From 82f2b76e25a4a67e01ec67e5ebe39d14ad771ea8 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 20 Apr 2017 03:09:25 +0200 Subject: [PATCH] Reorganize module loading. We now use webpack instead of SystemJS, effectively bundling modules into one file (plus commons chunks) for every entry point. This results in a much smaller extension size (almost half). Furthermore we use yarn/npm even for extension run-time dependencies. This relieves us from manually vendoring and building dependencies. It's also easier to understand for new developers familiar with node. --- .gitignore | 2 + decl/jed.d.ts | 18 + decl/jquery/jquery.d.ts | 3190 - decl/lib.es6.d.ts | 20674 ------ decl/node.d.ts | 2178 - decl/react-dom.d.ts | 75 - decl/react-global.d.ts | 11 - decl/react.d.ts | 2547 - decl/systemjs/systemjs.d.ts | 20 - decl/urijs.d.ts | 227 + decl/urijs/URIjs.d.ts | 236 - gulpfile.js | 48 +- manifest.json | 5 +- node_modules/.yarn-integrity | 2 +- node_modules/ansi-regex/index.js | 2 +- node_modules/ansi-regex/license | 21 - node_modules/ansi-regex/package.json | 11 +- node_modules/ansi-regex/readme.md | 4 +- node_modules/archiver/CHANGELOG.md | 6 + node_modules/archiver/README.md | 50 +- node_modules/archiver/lib/core.js | 113 +- node_modules/archiver/package.json | 7 +- node_modules/arr-flatten/LICENSE | 2 +- node_modules/arr-flatten/README.md | 102 +- node_modules/arr-flatten/index.js | 20 +- node_modules/arr-flatten/package.json | 67 +- node_modules/async/CHANGELOG.md | 20 + node_modules/async/LICENSE | 2 +- node_modules/async/README.md | 2 + node_modules/async/dist/async.js | 1633 +- node_modules/async/dist/async.min.js | 2 +- node_modules/async/package.json | 7 +- node_modules/babel-code-frame/README.md | 3 +- node_modules/babel-code-frame/lib/index.js | 52 +- node_modules/babel-code-frame/package.json | 4 +- node_modules/babel-generator/README.md | 4 +- node_modules/babel-generator/lib/buffer.js | 47 +- .../babel-generator/lib/generators/base.js | 7 +- .../lib/generators/expressions.js | 15 +- .../babel-generator/lib/generators/flow.js | 10 +- .../babel-generator/lib/generators/jsx.js | 8 + .../babel-generator/lib/generators/modules.js | 11 +- .../lib/generators/statements.js | 3 +- .../lib/generators/template-literals.js | 2 - .../babel-generator/lib/generators/types.js | 20 +- node_modules/babel-generator/lib/index.js | 22 +- .../babel-generator/lib/node/parentheses.js | 119 +- .../babel-generator/lib/node/whitespace.js | 25 +- node_modules/babel-generator/lib/printer.js | 2 - .../babel-generator/lib/source-map.js | 50 +- node_modules/babel-generator/package.json | 13 +- node_modules/babel-messages/README.md | 2 +- node_modules/babel-messages/lib/index.js | 33 +- node_modules/babel-messages/package.json | 4 +- .../babel-runtime/helpers/asyncGenerator.js | 8 +- .../babel-runtime/helpers/asyncIterator.js | 8 +- node_modules/babel-runtime/package.json | 8 +- node_modules/babel-template/README.md | 14 +- node_modules/babel-template/lib/index.js | 4 +- node_modules/babel-template/package.json | 8 +- node_modules/babel-traverse/lib/cache.js | 10 + node_modules/babel-traverse/lib/index.js | 3 + .../babel-traverse/lib/path/ancestry.js | 12 + .../babel-traverse/lib/path/comments.js | 2 + .../babel-traverse/lib/path/evaluation.js | 10 +- .../babel-traverse/lib/path/family.js | 101 + node_modules/babel-traverse/lib/path/index.js | 12 +- .../lib/path/inference/inferer-reference.js | 12 +- .../babel-traverse/lib/path/introspection.js | 24 +- .../babel-traverse/lib/path/lib/hoister.js | 91 +- .../lib/path/lib/removal-hooks.js | 21 +- .../lib/path/lib/virtual-types.js | 20 +- .../babel-traverse/lib/path/modification.js | 4 +- .../babel-traverse/lib/path/replacement.js | 12 +- .../babel-traverse/lib/scope/binding.js | 10 +- .../babel-traverse/lib/scope/index.js | 181 +- .../babel-traverse/lib/scope/lib/renamer.js | 10 +- node_modules/babel-traverse/package.json | 15 +- node_modules/babel-types/README.md | 1009 +- node_modules/babel-types/lib/converters.js | 12 +- .../babel-types/lib/definitions/es2015.js | 3 + .../lib/definitions/experimental.js | 4 + .../babel-types/lib/definitions/jsx.js | 12 +- node_modules/babel-types/lib/index.js | 32 +- node_modules/babel-types/lib/retrievers.js | 4 +- node_modules/babel-types/lib/validators.js | 64 + node_modules/babel-types/package.json | 7 +- node_modules/babylon/CHANGELOG.md | 327 +- node_modules/babylon/README.md | 16 +- .../babylon/bin/generate-identifier-regex.js | 2 +- node_modules/babylon/lib/index.js | 1633 +- node_modules/babylon/package.json | 51 +- node_modules/bl/.travis.yml | 4 +- node_modules/bl/LICENSE.md | 2 +- node_modules/bl/README.md | 10 +- node_modules/bl/bl.js | 55 +- node_modules/bl/package.json | 6 +- node_modules/bl/test/test.js | 59 + node_modules/brace-expansion/README.md | 1 + node_modules/brace-expansion/index.js | 2 +- node_modules/brace-expansion/package.json | 6 +- node_modules/buffer-crc32/.npmignore | 1 - node_modules/buffer-crc32/.travis.yml | 8 - node_modules/buffer-crc32/index.js | 30 +- node_modules/buffer-crc32/package.json | 9 +- node_modules/buffer-crc32/tests/crc.test.js | 89 - node_modules/camelcase/index.js | 39 +- node_modules/camelcase/package.json | 7 +- node_modules/camelcase/readme.md | 27 +- node_modules/clone-stats/package.json | 2 +- node_modules/cloneable-readable/package.json | 2 +- node_modules/compress-commons/README.md | 2 +- .../lib/archivers/zip/constants.js | 2 +- .../lib/archivers/zip/zip-archive-entry.js | 186 +- .../zip/zip-archive-output-stream.js | 3 +- node_modules/compress-commons/package.json | 6 +- node_modules/concat-stream/package.json | 10 +- node_modules/concat-stream/readme.md | 2 +- node_modules/convert-source-map/.travis.yml | 8 +- node_modules/convert-source-map/README.md | 20 +- .../example/comment-to-json.js | 6 +- node_modules/convert-source-map/index.js | 67 +- node_modules/convert-source-map/package.json | 8 +- .../convert-source-map/test/comment-regex.js | 9 +- .../test/convert-source-map.js | 52 +- node_modules/core-js/CHANGELOG.md | 188 +- node_modules/core-js/LICENSE | 2 +- node_modules/core-js/bower.json | 19 +- node_modules/core-js/build/Gruntfile.ls | 24 +- node_modules/core-js/build/build.ls | 222 +- node_modules/core-js/build/config.js | 251 - node_modules/core-js/build/index.js | 152 +- node_modules/core-js/client/core.js | 7511 +-- node_modules/core-js/client/core.min.js | 7 +- node_modules/core-js/client/core.min.js.map | 2 +- node_modules/core-js/client/library.js | 7122 +- node_modules/core-js/client/library.min.js | 7 +- .../core-js/client/library.min.js.map | 2 +- node_modules/core-js/client/shim.js | 7309 +-- node_modules/core-js/client/shim.min.js | 7 +- node_modules/core-js/client/shim.min.js.map | 2 +- node_modules/core-js/core/_.js | 2 +- node_modules/core-js/core/delay.js | 2 +- node_modules/core-js/core/dict.js | 2 +- node_modules/core-js/core/function.js | 2 +- node_modules/core-js/core/index.js | 4 +- node_modules/core-js/core/number.js | 2 +- node_modules/core-js/core/object.js | 2 +- node_modules/core-js/core/regexp.js | 2 - node_modules/core-js/core/string.js | 2 +- node_modules/core-js/es5/index.js | 32 +- node_modules/core-js/es6/array.js | 19 +- node_modules/core-js/es6/date.js | 6 - node_modules/core-js/es6/function.js | 3 +- node_modules/core-js/es6/index.js | 73 +- node_modules/core-js/es6/map.js | 2 +- node_modules/core-js/es6/math.js | 2 +- node_modules/core-js/es6/number.js | 4 +- node_modules/core-js/es6/object.js | 21 +- node_modules/core-js/es6/parse-float.js | 2 - node_modules/core-js/es6/parse-int.js | 2 - node_modules/core-js/es6/promise.js | 2 +- node_modules/core-js/es6/reflect.js | 2 +- node_modules/core-js/es6/regexp.js | 3 +- node_modules/core-js/es6/set.js | 2 +- node_modules/core-js/es6/string.js | 15 +- node_modules/core-js/es6/symbol.js | 2 +- node_modules/core-js/es6/typed.js | 13 - node_modules/core-js/es6/weak-map.js | 2 +- node_modules/core-js/es6/weak-set.js | 2 +- node_modules/core-js/es7/array.js | 2 +- node_modules/core-js/es7/asap.js | 2 - node_modules/core-js/es7/error.js | 2 - node_modules/core-js/es7/index.js | 31 +- node_modules/core-js/es7/map.js | 2 +- node_modules/core-js/es7/math.js | 5 - node_modules/core-js/es7/object.js | 6 +- node_modules/core-js/es7/observable.js | 7 - node_modules/core-js/es7/reflect.js | 10 - node_modules/core-js/es7/set.js | 2 +- node_modules/core-js/es7/string.js | 7 +- node_modules/core-js/es7/symbol.js | 3 - node_modules/core-js/es7/system.js | 2 - node_modules/core-js/fn/_.js | 2 +- node_modules/core-js/fn/array/concat.js | 6 +- node_modules/core-js/fn/array/copy-within.js | 2 +- node_modules/core-js/fn/array/entries.js | 2 +- node_modules/core-js/fn/array/every.js | 4 +- node_modules/core-js/fn/array/fill.js | 2 +- node_modules/core-js/fn/array/filter.js | 4 +- node_modules/core-js/fn/array/find-index.js | 2 +- node_modules/core-js/fn/array/find.js | 2 +- node_modules/core-js/fn/array/for-each.js | 4 +- node_modules/core-js/fn/array/from.js | 2 +- node_modules/core-js/fn/array/includes.js | 2 +- node_modules/core-js/fn/array/index-of.js | 4 +- node_modules/core-js/fn/array/index.js | 20 +- node_modules/core-js/fn/array/is-array.js | 2 - node_modules/core-js/fn/array/iterator.js | 2 +- node_modules/core-js/fn/array/join.js | 4 +- node_modules/core-js/fn/array/keys.js | 2 +- .../core-js/fn/array/last-index-of.js | 4 +- node_modules/core-js/fn/array/map.js | 4 +- node_modules/core-js/fn/array/of.js | 2 +- node_modules/core-js/fn/array/pop.js | 6 +- node_modules/core-js/fn/array/push.js | 6 +- node_modules/core-js/fn/array/reduce-right.js | 4 +- node_modules/core-js/fn/array/reduce.js | 4 +- node_modules/core-js/fn/array/reverse.js | 6 +- node_modules/core-js/fn/array/shift.js | 6 +- node_modules/core-js/fn/array/slice.js | 4 +- node_modules/core-js/fn/array/some.js | 4 +- node_modules/core-js/fn/array/sort.js | 4 +- node_modules/core-js/fn/array/splice.js | 6 +- node_modules/core-js/fn/array/unshift.js | 6 +- node_modules/core-js/fn/array/values.js | 2 +- .../core-js/fn/array/virtual/copy-within.js | 2 - .../core-js/fn/array/virtual/entries.js | 2 - .../core-js/fn/array/virtual/every.js | 2 - node_modules/core-js/fn/array/virtual/fill.js | 2 - .../core-js/fn/array/virtual/filter.js | 2 - .../core-js/fn/array/virtual/find-index.js | 2 - node_modules/core-js/fn/array/virtual/find.js | 2 - .../core-js/fn/array/virtual/for-each.js | 2 - .../core-js/fn/array/virtual/includes.js | 2 - .../core-js/fn/array/virtual/index-of.js | 2 - .../core-js/fn/array/virtual/index.js | 20 - .../core-js/fn/array/virtual/iterator.js | 2 - node_modules/core-js/fn/array/virtual/join.js | 2 - node_modules/core-js/fn/array/virtual/keys.js | 2 - .../core-js/fn/array/virtual/last-index-of.js | 2 - node_modules/core-js/fn/array/virtual/map.js | 2 - .../core-js/fn/array/virtual/reduce-right.js | 2 - .../core-js/fn/array/virtual/reduce.js | 2 - .../core-js/fn/array/virtual/slice.js | 2 - node_modules/core-js/fn/array/virtual/some.js | 2 - node_modules/core-js/fn/array/virtual/sort.js | 2 - .../core-js/fn/array/virtual/values.js | 2 - node_modules/core-js/fn/asap.js | 2 - node_modules/core-js/fn/clear-immediate.js | 2 +- node_modules/core-js/fn/date/index.js | 6 - node_modules/core-js/fn/date/now.js | 2 - node_modules/core-js/fn/date/to-iso-string.js | 3 - node_modules/core-js/fn/date/to-json.js | 2 - node_modules/core-js/fn/date/to-primitive.js | 5 - node_modules/core-js/fn/date/to-string.js | 5 - node_modules/core-js/fn/delay.js | 2 +- node_modules/core-js/fn/dict.js | 2 +- .../core-js/fn/dom-collections/index.js | 8 - .../core-js/fn/dom-collections/iterator.js | 2 - node_modules/core-js/fn/error/index.js | 2 - node_modules/core-js/fn/error/is-error.js | 2 - node_modules/core-js/fn/function/bind.js | 2 - .../core-js/fn/function/has-instance.js | 2 +- node_modules/core-js/fn/function/index.js | 3 +- node_modules/core-js/fn/function/part.js | 2 +- .../core-js/fn/function/virtual/bind.js | 2 - .../core-js/fn/function/virtual/index.js | 3 - .../core-js/fn/function/virtual/part.js | 2 - node_modules/core-js/fn/json/index.js | 2 - node_modules/core-js/fn/json/stringify.js | 5 +- node_modules/core-js/fn/map.js | 2 +- node_modules/core-js/fn/math/acosh.js | 2 +- node_modules/core-js/fn/math/asinh.js | 2 +- node_modules/core-js/fn/math/atanh.js | 2 +- node_modules/core-js/fn/math/cbrt.js | 2 +- node_modules/core-js/fn/math/clz32.js | 2 +- node_modules/core-js/fn/math/cosh.js | 2 +- node_modules/core-js/fn/math/expm1.js | 2 +- node_modules/core-js/fn/math/fround.js | 2 +- node_modules/core-js/fn/math/hypot.js | 2 +- node_modules/core-js/fn/math/iaddh.js | 2 - node_modules/core-js/fn/math/imul.js | 2 +- node_modules/core-js/fn/math/imulh.js | 2 - node_modules/core-js/fn/math/index.js | 6 +- node_modules/core-js/fn/math/isubh.js | 2 - node_modules/core-js/fn/math/log10.js | 2 +- node_modules/core-js/fn/math/log1p.js | 2 +- node_modules/core-js/fn/math/log2.js | 2 +- node_modules/core-js/fn/math/sign.js | 2 +- node_modules/core-js/fn/math/sinh.js | 2 +- node_modules/core-js/fn/math/tanh.js | 2 +- node_modules/core-js/fn/math/trunc.js | 2 +- node_modules/core-js/fn/math/umulh.js | 2 - node_modules/core-js/fn/number/constructor.js | 2 - node_modules/core-js/fn/number/index.js | 4 +- node_modules/core-js/fn/number/is-finite.js | 2 +- node_modules/core-js/fn/number/is-integer.js | 2 +- node_modules/core-js/fn/number/is-nan.js | 2 +- .../core-js/fn/number/is-safe-integer.js | 2 +- node_modules/core-js/fn/number/iterator.js | 2 +- node_modules/core-js/fn/number/to-fixed.js | 2 - .../core-js/fn/number/to-precision.js | 2 - .../core-js/fn/number/virtual/index.js | 4 - .../core-js/fn/number/virtual/iterator.js | 2 - .../core-js/fn/number/virtual/to-fixed.js | 2 - .../core-js/fn/number/virtual/to-precision.js | 2 - node_modules/core-js/fn/object/assign.js | 2 +- node_modules/core-js/fn/object/classof.js | 2 +- node_modules/core-js/fn/object/create.js | 5 +- .../core-js/fn/object/define-getter.js | 2 - .../core-js/fn/object/define-properties.js | 5 +- .../core-js/fn/object/define-property.js | 5 +- .../core-js/fn/object/define-setter.js | 2 - node_modules/core-js/fn/object/define.js | 2 +- node_modules/core-js/fn/object/entries.js | 2 +- node_modules/core-js/fn/object/freeze.js | 2 +- .../fn/object/get-own-property-descriptor.js | 4 +- .../fn/object/get-own-property-descriptors.js | 2 +- .../fn/object/get-own-property-names.js | 4 +- .../fn/object/get-own-property-symbols.js | 2 +- .../core-js/fn/object/get-prototype-of.js | 2 +- node_modules/core-js/fn/object/index.js | 25 +- .../core-js/fn/object/is-extensible.js | 2 +- node_modules/core-js/fn/object/is-frozen.js | 2 +- node_modules/core-js/fn/object/is-object.js | 2 +- node_modules/core-js/fn/object/is-sealed.js | 2 +- node_modules/core-js/fn/object/is.js | 2 +- node_modules/core-js/fn/object/keys.js | 2 +- .../core-js/fn/object/lookup-getter.js | 2 - .../core-js/fn/object/lookup-setter.js | 2 - node_modules/core-js/fn/object/make.js | 2 +- .../core-js/fn/object/prevent-extensions.js | 2 +- node_modules/core-js/fn/object/seal.js | 2 +- .../core-js/fn/object/set-prototype-of.js | 2 +- node_modules/core-js/fn/object/values.js | 2 +- node_modules/core-js/fn/observable.js | 7 - node_modules/core-js/fn/parse-float.js | 2 - node_modules/core-js/fn/parse-int.js | 2 - node_modules/core-js/fn/promise.js | 2 +- node_modules/core-js/fn/reflect/apply.js | 2 +- node_modules/core-js/fn/reflect/construct.js | 2 +- .../core-js/fn/reflect/define-metadata.js | 2 - .../core-js/fn/reflect/define-property.js | 2 +- .../core-js/fn/reflect/delete-metadata.js | 2 - .../core-js/fn/reflect/delete-property.js | 2 +- node_modules/core-js/fn/reflect/enumerate.js | 2 +- .../core-js/fn/reflect/get-metadata-keys.js | 2 - .../core-js/fn/reflect/get-metadata.js | 2 - .../fn/reflect/get-own-metadata-keys.js | 2 - .../core-js/fn/reflect/get-own-metadata.js | 2 - .../fn/reflect/get-own-property-descriptor.js | 2 +- .../core-js/fn/reflect/get-prototype-of.js | 2 +- node_modules/core-js/fn/reflect/get.js | 2 +- .../core-js/fn/reflect/has-metadata.js | 2 - .../core-js/fn/reflect/has-own-metadata.js | 2 - node_modules/core-js/fn/reflect/has.js | 2 +- node_modules/core-js/fn/reflect/index.js | 11 +- .../core-js/fn/reflect/is-extensible.js | 2 +- node_modules/core-js/fn/reflect/metadata.js | 2 - node_modules/core-js/fn/reflect/own-keys.js | 2 +- .../core-js/fn/reflect/prevent-extensions.js | 2 +- .../core-js/fn/reflect/set-prototype-of.js | 2 +- node_modules/core-js/fn/reflect/set.js | 2 +- node_modules/core-js/fn/regexp/constructor.js | 2 - node_modules/core-js/fn/regexp/escape.js | 4 +- node_modules/core-js/fn/regexp/flags.js | 5 - node_modules/core-js/fn/regexp/index.js | 5 +- node_modules/core-js/fn/regexp/match.js | 5 - node_modules/core-js/fn/regexp/replace.js | 5 - node_modules/core-js/fn/regexp/search.js | 5 - node_modules/core-js/fn/regexp/split.js | 5 - node_modules/core-js/fn/regexp/to-string.js | 5 - node_modules/core-js/fn/set-immediate.js | 2 +- node_modules/core-js/fn/set-interval.js | 2 +- node_modules/core-js/fn/set-timeout.js | 2 +- node_modules/core-js/fn/set.js | 2 +- node_modules/core-js/fn/string/anchor.js | 2 - node_modules/core-js/fn/string/at.js | 2 +- node_modules/core-js/fn/string/big.js | 2 - node_modules/core-js/fn/string/blink.js | 2 - node_modules/core-js/fn/string/bold.js | 2 - .../core-js/fn/string/code-point-at.js | 2 +- node_modules/core-js/fn/string/ends-with.js | 2 +- node_modules/core-js/fn/string/escape-html.js | 2 +- node_modules/core-js/fn/string/fixed.js | 2 - node_modules/core-js/fn/string/fontcolor.js | 2 - node_modules/core-js/fn/string/fontsize.js | 2 - .../core-js/fn/string/from-code-point.js | 2 +- node_modules/core-js/fn/string/includes.js | 2 +- node_modules/core-js/fn/string/index.js | 20 +- node_modules/core-js/fn/string/italics.js | 2 - node_modules/core-js/fn/string/iterator.js | 2 +- node_modules/core-js/fn/string/link.js | 2 - node_modules/core-js/fn/string/match-all.js | 2 - node_modules/core-js/fn/string/pad-end.js | 2 - node_modules/core-js/fn/string/pad-start.js | 2 - node_modules/core-js/fn/string/raw.js | 2 +- node_modules/core-js/fn/string/repeat.js | 2 +- node_modules/core-js/fn/string/small.js | 2 - node_modules/core-js/fn/string/starts-with.js | 2 +- node_modules/core-js/fn/string/strike.js | 2 - node_modules/core-js/fn/string/sub.js | 2 - node_modules/core-js/fn/string/sup.js | 2 - node_modules/core-js/fn/string/trim-end.js | 2 - node_modules/core-js/fn/string/trim-left.js | 2 +- node_modules/core-js/fn/string/trim-right.js | 2 +- node_modules/core-js/fn/string/trim-start.js | 2 - node_modules/core-js/fn/string/trim.js | 2 +- .../core-js/fn/string/unescape-html.js | 2 +- .../core-js/fn/string/virtual/anchor.js | 2 - node_modules/core-js/fn/string/virtual/at.js | 2 - node_modules/core-js/fn/string/virtual/big.js | 2 - .../core-js/fn/string/virtual/blink.js | 2 - .../core-js/fn/string/virtual/bold.js | 2 - .../fn/string/virtual/code-point-at.js | 2 - .../core-js/fn/string/virtual/ends-with.js | 2 - .../core-js/fn/string/virtual/escape-html.js | 2 - .../core-js/fn/string/virtual/fixed.js | 2 - .../core-js/fn/string/virtual/fontcolor.js | 2 - .../core-js/fn/string/virtual/fontsize.js | 2 - .../core-js/fn/string/virtual/includes.js | 2 - .../core-js/fn/string/virtual/index.js | 33 - .../core-js/fn/string/virtual/italics.js | 2 - .../core-js/fn/string/virtual/iterator.js | 2 - .../core-js/fn/string/virtual/link.js | 2 - .../core-js/fn/string/virtual/match-all.js | 2 - .../core-js/fn/string/virtual/pad-end.js | 2 - .../core-js/fn/string/virtual/pad-start.js | 2 - .../core-js/fn/string/virtual/repeat.js | 2 - .../core-js/fn/string/virtual/small.js | 2 - .../core-js/fn/string/virtual/starts-with.js | 2 - .../core-js/fn/string/virtual/strike.js | 2 - node_modules/core-js/fn/string/virtual/sub.js | 2 - node_modules/core-js/fn/string/virtual/sup.js | 2 - .../core-js/fn/string/virtual/trim-end.js | 2 - .../core-js/fn/string/virtual/trim-left.js | 2 - .../core-js/fn/string/virtual/trim-right.js | 2 - .../core-js/fn/string/virtual/trim-start.js | 2 - .../core-js/fn/string/virtual/trim.js | 2 - .../fn/string/virtual/unescape-html.js | 2 - .../core-js/fn/symbol/async-iterator.js | 2 - node_modules/core-js/fn/symbol/for.js | 2 +- .../core-js/fn/symbol/has-instance.js | 3 +- node_modules/core-js/fn/symbol/index.js | 4 +- .../core-js/fn/symbol/is-concat-spreadable.js | 2 +- node_modules/core-js/fn/symbol/iterator.js | 2 +- node_modules/core-js/fn/symbol/key-for.js | 2 +- node_modules/core-js/fn/symbol/match.js | 2 +- node_modules/core-js/fn/symbol/observable.js | 2 - node_modules/core-js/fn/symbol/replace.js | 2 +- node_modules/core-js/fn/symbol/search.js | 2 +- node_modules/core-js/fn/symbol/species.js | 2 +- node_modules/core-js/fn/symbol/split.js | 2 +- .../core-js/fn/symbol/to-primitive.js | 2 +- .../core-js/fn/symbol/to-string-tag.js | 2 +- node_modules/core-js/fn/symbol/unscopables.js | 2 +- node_modules/core-js/fn/system/global.js | 2 - node_modules/core-js/fn/system/index.js | 2 - node_modules/core-js/fn/typed/array-buffer.js | 3 - node_modules/core-js/fn/typed/data-view.js | 3 - .../core-js/fn/typed/float32-array.js | 2 - .../core-js/fn/typed/float64-array.js | 2 - node_modules/core-js/fn/typed/index.js | 13 - node_modules/core-js/fn/typed/int16-array.js | 2 - node_modules/core-js/fn/typed/int32-array.js | 2 - node_modules/core-js/fn/typed/int8-array.js | 2 - node_modules/core-js/fn/typed/uint16-array.js | 2 - node_modules/core-js/fn/typed/uint32-array.js | 2 - node_modules/core-js/fn/typed/uint8-array.js | 2 - .../core-js/fn/typed/uint8-clamped-array.js | 2 - node_modules/core-js/fn/weak-map.js | 2 +- node_modules/core-js/fn/weak-set.js | 2 +- node_modules/core-js/index.js | 4 +- node_modules/core-js/library/core/_.js | 2 +- node_modules/core-js/library/core/delay.js | 2 +- node_modules/core-js/library/core/dict.js | 2 +- node_modules/core-js/library/core/function.js | 2 +- node_modules/core-js/library/core/index.js | 4 +- node_modules/core-js/library/core/number.js | 2 +- node_modules/core-js/library/core/object.js | 2 +- node_modules/core-js/library/core/regexp.js | 2 - node_modules/core-js/library/core/string.js | 2 +- node_modules/core-js/library/es5/index.js | 32 +- node_modules/core-js/library/es6/array.js | 19 +- node_modules/core-js/library/es6/date.js | 6 - node_modules/core-js/library/es6/function.js | 3 +- node_modules/core-js/library/es6/index.js | 73 +- node_modules/core-js/library/es6/map.js | 2 +- node_modules/core-js/library/es6/math.js | 2 +- node_modules/core-js/library/es6/number.js | 4 +- node_modules/core-js/library/es6/object.js | 21 +- .../core-js/library/es6/parse-float.js | 2 - node_modules/core-js/library/es6/parse-int.js | 2 - node_modules/core-js/library/es6/promise.js | 2 +- node_modules/core-js/library/es6/reflect.js | 2 +- node_modules/core-js/library/es6/regexp.js | 3 +- node_modules/core-js/library/es6/set.js | 2 +- node_modules/core-js/library/es6/string.js | 15 +- node_modules/core-js/library/es6/symbol.js | 2 +- node_modules/core-js/library/es6/typed.js | 13 - node_modules/core-js/library/es6/weak-map.js | 2 +- node_modules/core-js/library/es6/weak-set.js | 2 +- node_modules/core-js/library/es7/array.js | 2 +- node_modules/core-js/library/es7/asap.js | 2 - node_modules/core-js/library/es7/error.js | 2 - node_modules/core-js/library/es7/index.js | 31 +- node_modules/core-js/library/es7/map.js | 2 +- node_modules/core-js/library/es7/math.js | 5 - node_modules/core-js/library/es7/object.js | 6 +- .../core-js/library/es7/observable.js | 7 - node_modules/core-js/library/es7/reflect.js | 10 - node_modules/core-js/library/es7/set.js | 2 +- node_modules/core-js/library/es7/string.js | 7 +- node_modules/core-js/library/es7/symbol.js | 3 - node_modules/core-js/library/es7/system.js | 2 - node_modules/core-js/library/fn/_.js | 2 +- .../core-js/library/fn/array/concat.js | 6 +- .../core-js/library/fn/array/copy-within.js | 2 +- .../core-js/library/fn/array/entries.js | 2 +- .../core-js/library/fn/array/every.js | 4 +- node_modules/core-js/library/fn/array/fill.js | 2 +- .../core-js/library/fn/array/filter.js | 4 +- .../core-js/library/fn/array/find-index.js | 2 +- node_modules/core-js/library/fn/array/find.js | 2 +- .../core-js/library/fn/array/for-each.js | 4 +- node_modules/core-js/library/fn/array/from.js | 2 +- .../core-js/library/fn/array/includes.js | 2 +- .../core-js/library/fn/array/index-of.js | 4 +- .../core-js/library/fn/array/index.js | 20 +- .../core-js/library/fn/array/is-array.js | 2 - .../core-js/library/fn/array/iterator.js | 2 +- node_modules/core-js/library/fn/array/join.js | 4 +- node_modules/core-js/library/fn/array/keys.js | 2 +- .../core-js/library/fn/array/last-index-of.js | 4 +- node_modules/core-js/library/fn/array/map.js | 4 +- node_modules/core-js/library/fn/array/of.js | 2 +- node_modules/core-js/library/fn/array/pop.js | 6 +- node_modules/core-js/library/fn/array/push.js | 6 +- .../core-js/library/fn/array/reduce-right.js | 4 +- .../core-js/library/fn/array/reduce.js | 4 +- .../core-js/library/fn/array/reverse.js | 6 +- .../core-js/library/fn/array/shift.js | 6 +- .../core-js/library/fn/array/slice.js | 4 +- node_modules/core-js/library/fn/array/some.js | 4 +- node_modules/core-js/library/fn/array/sort.js | 4 +- .../core-js/library/fn/array/splice.js | 6 +- .../core-js/library/fn/array/unshift.js | 6 +- .../core-js/library/fn/array/values.js | 2 +- .../library/fn/array/virtual/copy-within.js | 2 - .../library/fn/array/virtual/entries.js | 2 - .../core-js/library/fn/array/virtual/every.js | 2 - .../core-js/library/fn/array/virtual/fill.js | 2 - .../library/fn/array/virtual/filter.js | 2 - .../library/fn/array/virtual/find-index.js | 2 - .../core-js/library/fn/array/virtual/find.js | 2 - .../library/fn/array/virtual/for-each.js | 2 - .../library/fn/array/virtual/includes.js | 2 - .../library/fn/array/virtual/index-of.js | 2 - .../core-js/library/fn/array/virtual/index.js | 20 - .../library/fn/array/virtual/iterator.js | 2 - .../core-js/library/fn/array/virtual/join.js | 2 - .../core-js/library/fn/array/virtual/keys.js | 2 - .../library/fn/array/virtual/last-index-of.js | 2 - .../core-js/library/fn/array/virtual/map.js | 2 - .../library/fn/array/virtual/reduce-right.js | 2 - .../library/fn/array/virtual/reduce.js | 2 - .../core-js/library/fn/array/virtual/slice.js | 2 - .../core-js/library/fn/array/virtual/some.js | 2 - .../core-js/library/fn/array/virtual/sort.js | 2 - .../library/fn/array/virtual/values.js | 2 - node_modules/core-js/library/fn/asap.js | 2 - .../core-js/library/fn/clear-immediate.js | 2 +- node_modules/core-js/library/fn/date/index.js | 6 - node_modules/core-js/library/fn/date/now.js | 2 - .../core-js/library/fn/date/to-iso-string.js | 3 - .../core-js/library/fn/date/to-json.js | 2 - .../core-js/library/fn/date/to-primitive.js | 5 - .../core-js/library/fn/date/to-string.js | 5 - node_modules/core-js/library/fn/delay.js | 2 +- node_modules/core-js/library/fn/dict.js | 2 +- .../library/fn/dom-collections/index.js | 8 - .../library/fn/dom-collections/iterator.js | 2 - .../core-js/library/fn/error/index.js | 2 - .../core-js/library/fn/error/is-error.js | 2 - .../core-js/library/fn/function/bind.js | 2 - .../library/fn/function/has-instance.js | 2 +- .../core-js/library/fn/function/index.js | 3 +- .../core-js/library/fn/function/part.js | 2 +- .../library/fn/function/virtual/bind.js | 2 - .../library/fn/function/virtual/index.js | 3 - .../library/fn/function/virtual/part.js | 2 - node_modules/core-js/library/fn/json/index.js | 2 - .../core-js/library/fn/json/stringify.js | 5 +- node_modules/core-js/library/fn/map.js | 2 +- node_modules/core-js/library/fn/math/acosh.js | 2 +- node_modules/core-js/library/fn/math/asinh.js | 2 +- node_modules/core-js/library/fn/math/atanh.js | 2 +- node_modules/core-js/library/fn/math/cbrt.js | 2 +- node_modules/core-js/library/fn/math/clz32.js | 2 +- node_modules/core-js/library/fn/math/cosh.js | 2 +- node_modules/core-js/library/fn/math/expm1.js | 2 +- .../core-js/library/fn/math/fround.js | 2 +- node_modules/core-js/library/fn/math/hypot.js | 2 +- node_modules/core-js/library/fn/math/iaddh.js | 2 - node_modules/core-js/library/fn/math/imul.js | 2 +- node_modules/core-js/library/fn/math/imulh.js | 2 - node_modules/core-js/library/fn/math/index.js | 6 +- node_modules/core-js/library/fn/math/isubh.js | 2 - node_modules/core-js/library/fn/math/log10.js | 2 +- node_modules/core-js/library/fn/math/log1p.js | 2 +- node_modules/core-js/library/fn/math/log2.js | 2 +- node_modules/core-js/library/fn/math/sign.js | 2 +- node_modules/core-js/library/fn/math/sinh.js | 2 +- node_modules/core-js/library/fn/math/tanh.js | 2 +- node_modules/core-js/library/fn/math/trunc.js | 2 +- node_modules/core-js/library/fn/math/umulh.js | 2 - .../core-js/library/fn/number/constructor.js | 2 - .../core-js/library/fn/number/index.js | 4 +- .../core-js/library/fn/number/is-finite.js | 2 +- .../core-js/library/fn/number/is-integer.js | 2 +- .../core-js/library/fn/number/is-nan.js | 2 +- .../library/fn/number/is-safe-integer.js | 2 +- .../core-js/library/fn/number/iterator.js | 2 +- .../core-js/library/fn/number/to-fixed.js | 2 - .../core-js/library/fn/number/to-precision.js | 2 - .../library/fn/number/virtual/index.js | 4 - .../library/fn/number/virtual/iterator.js | 2 - .../library/fn/number/virtual/to-fixed.js | 2 - .../library/fn/number/virtual/to-precision.js | 2 - .../core-js/library/fn/object/assign.js | 2 +- .../core-js/library/fn/object/classof.js | 2 +- .../core-js/library/fn/object/create.js | 5 +- .../library/fn/object/define-getter.js | 2 - .../library/fn/object/define-properties.js | 5 +- .../library/fn/object/define-property.js | 5 +- .../library/fn/object/define-setter.js | 2 - .../core-js/library/fn/object/define.js | 2 +- .../core-js/library/fn/object/entries.js | 2 +- .../core-js/library/fn/object/freeze.js | 2 +- .../fn/object/get-own-property-descriptor.js | 4 +- .../fn/object/get-own-property-descriptors.js | 2 +- .../fn/object/get-own-property-names.js | 4 +- .../fn/object/get-own-property-symbols.js | 2 +- .../library/fn/object/get-prototype-of.js | 2 +- .../core-js/library/fn/object/index.js | 25 +- .../library/fn/object/is-extensible.js | 2 +- .../core-js/library/fn/object/is-frozen.js | 2 +- .../core-js/library/fn/object/is-object.js | 2 +- .../core-js/library/fn/object/is-sealed.js | 2 +- node_modules/core-js/library/fn/object/is.js | 2 +- .../core-js/library/fn/object/keys.js | 2 +- .../library/fn/object/lookup-getter.js | 2 - .../library/fn/object/lookup-setter.js | 2 - .../core-js/library/fn/object/make.js | 2 +- .../library/fn/object/prevent-extensions.js | 2 +- .../core-js/library/fn/object/seal.js | 2 +- .../library/fn/object/set-prototype-of.js | 2 +- .../core-js/library/fn/object/values.js | 2 +- node_modules/core-js/library/fn/observable.js | 7 - .../core-js/library/fn/parse-float.js | 2 - node_modules/core-js/library/fn/parse-int.js | 2 - node_modules/core-js/library/fn/promise.js | 2 +- .../core-js/library/fn/reflect/apply.js | 2 +- .../core-js/library/fn/reflect/construct.js | 2 +- .../library/fn/reflect/define-metadata.js | 2 - .../library/fn/reflect/define-property.js | 2 +- .../library/fn/reflect/delete-metadata.js | 2 - .../library/fn/reflect/delete-property.js | 2 +- .../core-js/library/fn/reflect/enumerate.js | 2 +- .../library/fn/reflect/get-metadata-keys.js | 2 - .../library/fn/reflect/get-metadata.js | 2 - .../fn/reflect/get-own-metadata-keys.js | 2 - .../library/fn/reflect/get-own-metadata.js | 2 - .../fn/reflect/get-own-property-descriptor.js | 2 +- .../library/fn/reflect/get-prototype-of.js | 2 +- .../core-js/library/fn/reflect/get.js | 2 +- .../library/fn/reflect/has-metadata.js | 2 - .../library/fn/reflect/has-own-metadata.js | 2 - .../core-js/library/fn/reflect/has.js | 2 +- .../core-js/library/fn/reflect/index.js | 11 +- .../library/fn/reflect/is-extensible.js | 2 +- .../core-js/library/fn/reflect/metadata.js | 2 - .../core-js/library/fn/reflect/own-keys.js | 2 +- .../library/fn/reflect/prevent-extensions.js | 2 +- .../library/fn/reflect/set-prototype-of.js | 2 +- .../core-js/library/fn/reflect/set.js | 2 +- .../core-js/library/fn/regexp/constructor.js | 2 - .../core-js/library/fn/regexp/escape.js | 4 +- .../core-js/library/fn/regexp/flags.js | 5 - .../core-js/library/fn/regexp/index.js | 5 +- .../core-js/library/fn/regexp/match.js | 5 - .../core-js/library/fn/regexp/replace.js | 5 - .../core-js/library/fn/regexp/search.js | 5 - .../core-js/library/fn/regexp/split.js | 5 - .../core-js/library/fn/regexp/to-string.js | 5 - .../core-js/library/fn/set-immediate.js | 2 +- .../core-js/library/fn/set-interval.js | 2 +- .../core-js/library/fn/set-timeout.js | 2 +- node_modules/core-js/library/fn/set.js | 2 +- .../core-js/library/fn/string/anchor.js | 2 - node_modules/core-js/library/fn/string/at.js | 2 +- node_modules/core-js/library/fn/string/big.js | 2 - .../core-js/library/fn/string/blink.js | 2 - .../core-js/library/fn/string/bold.js | 2 - .../library/fn/string/code-point-at.js | 2 +- .../core-js/library/fn/string/ends-with.js | 2 +- .../core-js/library/fn/string/escape-html.js | 2 +- .../core-js/library/fn/string/fixed.js | 2 - .../core-js/library/fn/string/fontcolor.js | 2 - .../core-js/library/fn/string/fontsize.js | 2 - .../library/fn/string/from-code-point.js | 2 +- .../core-js/library/fn/string/includes.js | 2 +- .../core-js/library/fn/string/index.js | 20 +- .../core-js/library/fn/string/italics.js | 2 - .../core-js/library/fn/string/iterator.js | 2 +- .../core-js/library/fn/string/link.js | 2 - .../core-js/library/fn/string/match-all.js | 2 - .../core-js/library/fn/string/pad-end.js | 2 - .../core-js/library/fn/string/pad-start.js | 2 - node_modules/core-js/library/fn/string/raw.js | 2 +- .../core-js/library/fn/string/repeat.js | 2 +- .../core-js/library/fn/string/small.js | 2 - .../core-js/library/fn/string/starts-with.js | 2 +- .../core-js/library/fn/string/strike.js | 2 - node_modules/core-js/library/fn/string/sub.js | 2 - node_modules/core-js/library/fn/string/sup.js | 2 - .../core-js/library/fn/string/trim-end.js | 2 - .../core-js/library/fn/string/trim-left.js | 2 +- .../core-js/library/fn/string/trim-right.js | 2 +- .../core-js/library/fn/string/trim-start.js | 2 - .../core-js/library/fn/string/trim.js | 2 +- .../library/fn/string/unescape-html.js | 2 +- .../library/fn/string/virtual/anchor.js | 2 - .../core-js/library/fn/string/virtual/at.js | 2 - .../core-js/library/fn/string/virtual/big.js | 2 - .../library/fn/string/virtual/blink.js | 2 - .../core-js/library/fn/string/virtual/bold.js | 2 - .../fn/string/virtual/code-point-at.js | 2 - .../library/fn/string/virtual/ends-with.js | 2 - .../library/fn/string/virtual/escape-html.js | 2 - .../library/fn/string/virtual/fixed.js | 2 - .../library/fn/string/virtual/fontcolor.js | 2 - .../library/fn/string/virtual/fontsize.js | 2 - .../library/fn/string/virtual/includes.js | 2 - .../library/fn/string/virtual/index.js | 33 - .../library/fn/string/virtual/italics.js | 2 - .../library/fn/string/virtual/iterator.js | 2 - .../core-js/library/fn/string/virtual/link.js | 2 - .../library/fn/string/virtual/match-all.js | 2 - .../library/fn/string/virtual/pad-end.js | 2 - .../library/fn/string/virtual/pad-start.js | 2 - .../library/fn/string/virtual/repeat.js | 2 - .../library/fn/string/virtual/small.js | 2 - .../library/fn/string/virtual/starts-with.js | 2 - .../library/fn/string/virtual/strike.js | 2 - .../core-js/library/fn/string/virtual/sub.js | 2 - .../core-js/library/fn/string/virtual/sup.js | 2 - .../library/fn/string/virtual/trim-end.js | 2 - .../library/fn/string/virtual/trim-left.js | 2 - .../library/fn/string/virtual/trim-right.js | 2 - .../library/fn/string/virtual/trim-start.js | 2 - .../core-js/library/fn/string/virtual/trim.js | 2 - .../fn/string/virtual/unescape-html.js | 2 - .../library/fn/symbol/async-iterator.js | 2 - node_modules/core-js/library/fn/symbol/for.js | 2 +- .../core-js/library/fn/symbol/has-instance.js | 3 +- .../core-js/library/fn/symbol/index.js | 4 +- .../library/fn/symbol/is-concat-spreadable.js | 2 +- .../core-js/library/fn/symbol/iterator.js | 2 +- .../core-js/library/fn/symbol/key-for.js | 2 +- .../core-js/library/fn/symbol/match.js | 2 +- .../core-js/library/fn/symbol/observable.js | 2 - .../core-js/library/fn/symbol/replace.js | 2 +- .../core-js/library/fn/symbol/search.js | 2 +- .../core-js/library/fn/symbol/species.js | 2 +- .../core-js/library/fn/symbol/split.js | 2 +- .../core-js/library/fn/symbol/to-primitive.js | 2 +- .../library/fn/symbol/to-string-tag.js | 2 +- .../core-js/library/fn/symbol/unscopables.js | 2 +- .../core-js/library/fn/system/global.js | 2 - .../core-js/library/fn/system/index.js | 2 - .../core-js/library/fn/typed/array-buffer.js | 3 - .../core-js/library/fn/typed/data-view.js | 3 - .../core-js/library/fn/typed/float32-array.js | 2 - .../core-js/library/fn/typed/float64-array.js | 2 - .../core-js/library/fn/typed/index.js | 13 - .../core-js/library/fn/typed/int16-array.js | 2 - .../core-js/library/fn/typed/int32-array.js | 2 - .../core-js/library/fn/typed/int8-array.js | 2 - .../core-js/library/fn/typed/uint16-array.js | 2 - .../core-js/library/fn/typed/uint32-array.js | 2 - .../core-js/library/fn/typed/uint8-array.js | 2 - .../library/fn/typed/uint8-clamped-array.js | 2 - node_modules/core-js/library/fn/weak-map.js | 2 +- node_modules/core-js/library/fn/weak-set.js | 2 +- node_modules/core-js/library/index.js | 4 +- .../core-js/library/modules/_a-function.js | 4 - .../library/modules/_a-number-value.js | 5 - .../library/modules/_add-to-unscopables.js | 1 - .../core-js/library/modules/_an-instance.js | 5 - .../core-js/library/modules/_an-object.js | 5 - .../library/modules/_array-copy-within.js | 26 - .../core-js/library/modules/_array-fill.js | 15 - .../library/modules/_array-from-iterable.js | 7 - .../library/modules/_array-includes.js | 21 - .../core-js/library/modules/_array-methods.js | 44 - .../core-js/library/modules/_array-reduce.js | 28 - .../modules/_array-species-constructor.js | 16 - .../library/modules/_array-species-create.js | 6 - node_modules/core-js/library/modules/_bind.js | 24 - .../core-js/library/modules/_classof.js | 23 - node_modules/core-js/library/modules/_cof.js | 5 - .../library/modules/_collection-strong.js | 142 - .../library/modules/_collection-to-json.js | 9 - .../library/modules/_collection-weak.js | 83 - .../core-js/library/modules/_collection.js | 59 - node_modules/core-js/library/modules/_core.js | 2 - .../library/modules/_create-property.js | 8 - node_modules/core-js/library/modules/_ctx.js | 20 - .../library/modules/_date-to-primitive.js | 9 - .../core-js/library/modules/_defined.js | 5 - .../core-js/library/modules/_descriptors.js | 4 - .../core-js/library/modules/_dom-create.js | 7 - .../core-js/library/modules/_entry-virtual.js | 5 - .../core-js/library/modules/_enum-bug-keys.js | 4 - .../core-js/library/modules/_enum-keys.js | 15 - .../core-js/library/modules/_export.js | 61 - .../library/modules/_fails-is-regexp.js | 12 - .../core-js/library/modules/_fails.js | 7 - .../core-js/library/modules/_fix-re-wks.js | 28 - .../core-js/library/modules/_flags.js | 13 - .../core-js/library/modules/_for-of.js | 25 - .../core-js/library/modules/_global.js | 4 - node_modules/core-js/library/modules/_has.js | 4 - node_modules/core-js/library/modules/_hide.js | 8 - node_modules/core-js/library/modules/_html.js | 1 - .../library/modules/_ie8-dom-define.js | 3 - .../library/modules/_inherit-if-required.js | 8 - .../core-js/library/modules/_invoke.js | 16 - .../core-js/library/modules/_iobject.js | 5 - .../core-js/library/modules/_is-array-iter.js | 8 - .../core-js/library/modules/_is-array.js | 5 - .../core-js/library/modules/_is-integer.js | 6 - .../core-js/library/modules/_is-object.js | 3 - .../core-js/library/modules/_is-regexp.js | 8 - .../core-js/library/modules/_iter-call.js | 12 - .../core-js/library/modules/_iter-create.js | 13 - .../core-js/library/modules/_iter-define.js | 70 - .../core-js/library/modules/_iter-detect.js | 21 - .../core-js/library/modules/_iter-step.js | 3 - .../core-js/library/modules/_iterators.js | 1 - .../core-js/library/modules/_keyof.js | 10 - .../core-js/library/modules/_library.js | 1 - .../core-js/library/modules/_math-expm1.js | 10 - .../core-js/library/modules/_math-log1p.js | 4 - .../core-js/library/modules/_math-sign.js | 4 - node_modules/core-js/library/modules/_meta.js | 53 - .../core-js/library/modules/_metadata.js | 51 - .../core-js/library/modules/_microtask.js | 68 - .../core-js/library/modules/_object-assign.js | 33 - .../core-js/library/modules/_object-create.js | 41 - .../core-js/library/modules/_object-define.js | 12 - .../core-js/library/modules/_object-dp.js | 16 - .../core-js/library/modules/_object-dps.js | 13 - .../library/modules/_object-forced-pam.js | 7 - .../core-js/library/modules/_object-gopd.js | 16 - .../library/modules/_object-gopn-ext.js | 19 - .../core-js/library/modules/_object-gopn.js | 7 - .../core-js/library/modules/_object-gops.js | 1 - .../core-js/library/modules/_object-gpo.js | 13 - .../library/modules/_object-keys-internal.js | 17 - .../core-js/library/modules/_object-keys.js | 7 - .../core-js/library/modules/_object-pie.js | 1 - .../core-js/library/modules/_object-sap.js | 10 - .../library/modules/_object-to-array.js | 16 - .../core-js/library/modules/_own-keys.js | 10 - .../core-js/library/modules/_parse-float.js | 8 - .../core-js/library/modules/_parse-int.js | 9 - .../core-js/library/modules/_partial.js | 23 - node_modules/core-js/library/modules/_path.js | 1 - .../core-js/library/modules/_property-desc.js | 8 - .../core-js/library/modules/_redefine-all.js | 7 - .../core-js/library/modules/_redefine.js | 1 - .../core-js/library/modules/_replacer.js | 8 - .../core-js/library/modules/_same-value.js | 4 - .../core-js/library/modules/_set-proto.js | 25 - .../core-js/library/modules/_set-species.js | 14 - .../library/modules/_set-to-string-tag.js | 7 - .../core-js/library/modules/_shared-key.js | 5 - .../core-js/library/modules/_shared.js | 6 - .../library/modules/_species-constructor.js | 8 - .../core-js/library/modules/_strict-method.js | 7 - .../core-js/library/modules/_string-at.js | 17 - .../library/modules/_string-context.js | 8 - .../core-js/library/modules/_string-html.js | 19 - .../core-js/library/modules/_string-pad.js | 16 - .../core-js/library/modules/_string-repeat.js | 12 - .../core-js/library/modules/_string-trim.js | 30 - .../core-js/library/modules/_string-ws.js | 2 - node_modules/core-js/library/modules/_task.js | 75 - .../core-js/library/modules/_to-index.js | 7 - .../core-js/library/modules/_to-integer.js | 6 - .../core-js/library/modules/_to-iobject.js | 6 - .../core-js/library/modules/_to-length.js | 6 - .../core-js/library/modules/_to-object.js | 5 - .../core-js/library/modules/_to-primitive.js | 12 - .../core-js/library/modules/_typed-array.js | 479 - .../core-js/library/modules/_typed-buffer.js | 273 - .../core-js/library/modules/_typed.js | 26 - node_modules/core-js/library/modules/_uid.js | 5 - .../core-js/library/modules/_wks-define.js | 9 - .../core-js/library/modules/_wks-ext.js | 1 - node_modules/core-js/library/modules/_wks.js | 11 - .../core-js/library/modules/core.delay.js | 8 +- .../core-js/library/modules/core.dict.js | 40 +- .../library/modules/core.function.part.js | 8 +- .../modules/core.get-iterator-method.js | 8 +- .../library/modules/core.get-iterator.js | 4 +- .../library/modules/core.is-iterable.js | 8 +- .../library/modules/core.number.iterator.js | 2 +- .../library/modules/core.object.classof.js | 4 +- .../library/modules/core.object.define.js | 4 +- .../library/modules/core.object.is-object.js | 4 +- .../library/modules/core.object.make.js | 6 +- .../library/modules/core.regexp.escape.js | 5 - .../modules/core.string.escape-html.js | 4 +- .../modules/core.string.unescape-html.js | 4 +- node_modules/core-js/library/modules/es5.js | 311 +- .../library/modules/es6.array.copy-within.js | 6 +- .../library/modules/es6.array.every.js | 10 - .../core-js/library/modules/es6.array.fill.js | 6 +- .../library/modules/es6.array.filter.js | 10 - .../library/modules/es6.array.find-index.js | 6 +- .../core-js/library/modules/es6.array.find.js | 6 +- .../library/modules/es6.array.for-each.js | 11 - .../core-js/library/modules/es6.array.from.js | 29 +- .../library/modules/es6.array.index-of.js | 15 - .../library/modules/es6.array.is-array.js | 4 - .../library/modules/es6.array.iterator.js | 10 +- .../core-js/library/modules/es6.array.join.js | 12 - .../modules/es6.array.last-index-of.js | 22 - .../core-js/library/modules/es6.array.map.js | 10 - .../core-js/library/modules/es6.array.of.js | 14 +- .../library/modules/es6.array.reduce-right.js | 10 - .../library/modules/es6.array.reduce.js | 10 - .../library/modules/es6.array.slice.js | 28 - .../core-js/library/modules/es6.array.some.js | 10 - .../core-js/library/modules/es6.array.sort.js | 23 - .../library/modules/es6.array.species.js | 2 +- .../core-js/library/modules/es6.date.now.js | 4 - .../library/modules/es6.date.to-iso-string.js | 28 - .../library/modules/es6.date.to-json.js | 14 - .../library/modules/es6.date.to-primitive.js | 0 .../library/modules/es6.function.bind.js | 4 - .../modules/es6.function.has-instance.js | 12 +- .../core-js/library/modules/es6.map.js | 4 +- .../core-js/library/modules/es6.math.acosh.js | 12 +- .../core-js/library/modules/es6.math.asinh.js | 6 +- .../core-js/library/modules/es6.math.atanh.js | 6 +- .../core-js/library/modules/es6.math.cbrt.js | 4 +- .../core-js/library/modules/es6.math.clz32.js | 2 +- .../core-js/library/modules/es6.math.cosh.js | 2 +- .../core-js/library/modules/es6.math.expm1.js | 5 +- .../library/modules/es6.math.fround.js | 4 +- .../core-js/library/modules/es6.math.hypot.js | 15 +- .../core-js/library/modules/es6.math.imul.js | 4 +- .../core-js/library/modules/es6.math.log10.js | 2 +- .../core-js/library/modules/es6.math.log1p.js | 4 +- .../core-js/library/modules/es6.math.log2.js | 2 +- .../core-js/library/modules/es6.math.sign.js | 4 +- .../core-js/library/modules/es6.math.sinh.js | 6 +- .../core-js/library/modules/es6.math.tanh.js | 4 +- .../core-js/library/modules/es6.math.trunc.js | 2 +- .../library/modules/es6.number.epsilon.js | 2 +- .../library/modules/es6.number.is-finite.js | 4 +- .../library/modules/es6.number.is-integer.js | 4 +- .../library/modules/es6.number.is-nan.js | 2 +- .../modules/es6.number.is-safe-integer.js | 4 +- .../modules/es6.number.max-safe-integer.js | 2 +- .../modules/es6.number.min-safe-integer.js | 2 +- .../library/modules/es6.number.parse-float.js | 6 +- .../library/modules/es6.number.parse-int.js | 6 +- .../library/modules/es6.number.to-fixed.js | 113 - .../modules/es6.number.to-precision.js | 18 - .../library/modules/es6.object.assign.js | 4 +- .../library/modules/es6.object.create.js | 3 - .../modules/es6.object.define-properties.js | 3 - .../modules/es6.object.define-property.js | 3 - .../library/modules/es6.object.freeze.js | 7 +- .../es6.object.get-own-property-descriptor.js | 5 +- .../es6.object.get-own-property-names.js | 4 +- .../modules/es6.object.get-prototype-of.js | 5 +- .../modules/es6.object.is-extensible.js | 4 +- .../library/modules/es6.object.is-frozen.js | 4 +- .../library/modules/es6.object.is-sealed.js | 4 +- .../core-js/library/modules/es6.object.is.js | 4 +- .../library/modules/es6.object.keys.js | 5 +- .../modules/es6.object.prevent-extensions.js | 7 +- .../library/modules/es6.object.seal.js | 7 +- .../modules/es6.object.set-prototype-of.js | 4 +- .../library/modules/es6.parse-float.js | 4 - .../core-js/library/modules/es6.parse-int.js | 4 - .../core-js/library/modules/es6.promise.js | 312 +- .../library/modules/es6.reflect.apply.js | 18 +- .../library/modules/es6.reflect.construct.js | 30 +- .../modules/es6.reflect.define-property.js | 15 +- .../modules/es6.reflect.delete-property.js | 8 +- .../library/modules/es6.reflect.enumerate.js | 6 +- ...es6.reflect.get-own-property-descriptor.js | 8 +- .../modules/es6.reflect.get-prototype-of.js | 6 +- .../library/modules/es6.reflect.get.js | 15 +- .../library/modules/es6.reflect.has.js | 2 +- .../modules/es6.reflect.is-extensible.js | 4 +- .../library/modules/es6.reflect.own-keys.js | 4 +- .../modules/es6.reflect.prevent-extensions.js | 4 +- .../modules/es6.reflect.set-prototype-of.js | 4 +- .../library/modules/es6.reflect.set.js | 22 +- .../library/modules/es6.regexp.constructor.js | 2 +- .../library/modules/es6.regexp.to-string.js | 0 .../core-js/library/modules/es6.set.js | 4 +- .../library/modules/es6.string.anchor.js | 7 - .../core-js/library/modules/es6.string.big.js | 7 - .../library/modules/es6.string.blink.js | 7 - .../library/modules/es6.string.bold.js | 7 - .../modules/es6.string.code-point-at.js | 4 +- .../library/modules/es6.string.ends-with.js | 11 +- .../library/modules/es6.string.fixed.js | 7 - .../library/modules/es6.string.fontcolor.js | 7 - .../library/modules/es6.string.fontsize.js | 7 - .../modules/es6.string.from-code-point.js | 15 +- .../library/modules/es6.string.includes.js | 6 +- .../library/modules/es6.string.italics.js | 7 - .../library/modules/es6.string.iterator.js | 4 +- .../library/modules/es6.string.link.js | 7 - .../core-js/library/modules/es6.string.raw.js | 19 +- .../library/modules/es6.string.repeat.js | 4 +- .../library/modules/es6.string.small.js | 7 - .../library/modules/es6.string.starts-with.js | 11 +- .../library/modules/es6.string.strike.js | 7 - .../core-js/library/modules/es6.string.sub.js | 7 - .../core-js/library/modules/es6.string.sup.js | 7 - .../library/modules/es6.string.trim.js | 2 +- .../core-js/library/modules/es6.symbol.js | 250 +- .../library/modules/es6.typed.array-buffer.js | 81 +- .../library/modules/es6.typed.data-view.js | 8 +- .../modules/es6.typed.float32-array.js | 2 +- .../modules/es6.typed.float64-array.js | 2 +- .../library/modules/es6.typed.int16-array.js | 2 +- .../library/modules/es6.typed.int32-array.js | 2 +- .../library/modules/es6.typed.int8-array.js | 2 +- .../library/modules/es6.typed.uint16-array.js | 2 +- .../library/modules/es6.typed.uint32-array.js | 2 +- .../library/modules/es6.typed.uint8-array.js | 2 +- .../modules/es6.typed.uint8-clamped-array.js | 2 +- .../core-js/library/modules/es6.weak-map.js | 51 +- .../core-js/library/modules/es6.weak-set.js | 4 +- .../library/modules/es7.array.includes.js | 8 +- .../core-js/library/modules/es7.asap.js | 12 - .../library/modules/es7.error.is-error.js | 9 - .../library/modules/es7.map.to-json.js | 4 +- .../core-js/library/modules/es7.math.iaddh.js | 11 - .../core-js/library/modules/es7.math.imulh.js | 16 - .../core-js/library/modules/es7.math.isubh.js | 11 - .../core-js/library/modules/es7.math.umulh.js | 16 - .../modules/es7.object.define-getter.js | 12 - .../modules/es7.object.define-setter.js | 12 - .../library/modules/es7.object.entries.js | 6 +- .../modules/es7.object.enumerable-entries.js | 12 - .../modules/es7.object.enumerable-keys.js | 12 - .../modules/es7.object.enumerable-values.js | 12 - ...es7.object.get-own-property-descriptors.js | 24 +- .../modules/es7.object.lookup-getter.js | 18 - .../modules/es7.object.lookup-setter.js | 18 - .../library/modules/es7.object.values.js | 6 +- .../core-js/library/modules/es7.observable.js | 199 - .../modules/es7.reflect.define-metadata.js | 8 - .../modules/es7.reflect.delete-metadata.js | 15 - .../modules/es7.reflect.get-metadata-keys.js | 19 - .../modules/es7.reflect.get-metadata.js | 17 - .../es7.reflect.get-own-metadata-keys.js | 8 - .../modules/es7.reflect.get-own-metadata.js | 9 - .../modules/es7.reflect.has-metadata.js | 16 - .../modules/es7.reflect.has-own-metadata.js | 9 - .../library/modules/es7.reflect.metadata.js | 15 - .../library/modules/es7.set.to-json.js | 4 +- .../core-js/library/modules/es7.string.at.js | 4 +- .../library/modules/es7.string.match-all.js | 30 - .../library/modules/es7.string.pad-end.js | 10 - .../library/modules/es7.string.pad-start.js | 10 - .../library/modules/es7.string.trim-left.js | 4 +- .../library/modules/es7.string.trim-right.js | 4 +- .../modules/es7.symbol.async-iterator.js | 1 - .../library/modules/es7.symbol.observable.js | 1 - .../library/modules/es7.system.global.js | 4 - .../library/modules/web.dom.iterable.js | 14 +- .../core-js/library/modules/web.immediate.js | 4 +- .../core-js/library/modules/web.timers.js | 8 +- node_modules/core-js/library/shim.js | 104 +- node_modules/core-js/library/stage/0.js | 10 - node_modules/core-js/library/stage/1.js | 6 - node_modules/core-js/library/stage/2.js | 3 - node_modules/core-js/library/stage/3.js | 4 - node_modules/core-js/library/stage/4.js | 8 - node_modules/core-js/library/stage/index.js | 1 - node_modules/core-js/library/stage/pre.js | 10 - .../core-js/library/web/dom-collections.js | 2 - node_modules/core-js/library/web/immediate.js | 2 +- node_modules/core-js/library/web/index.js | 2 +- node_modules/core-js/library/web/timers.js | 2 +- node_modules/core-js/modules/_a-function.js | 4 - .../core-js/modules/_a-number-value.js | 5 - .../core-js/modules/_add-to-unscopables.js | 7 - node_modules/core-js/modules/_an-instance.js | 5 - node_modules/core-js/modules/_an-object.js | 5 - .../core-js/modules/_array-copy-within.js | 26 - node_modules/core-js/modules/_array-fill.js | 15 - .../core-js/modules/_array-from-iterable.js | 7 - .../core-js/modules/_array-includes.js | 21 - .../core-js/modules/_array-methods.js | 44 - node_modules/core-js/modules/_array-reduce.js | 28 - .../modules/_array-species-constructor.js | 16 - .../core-js/modules/_array-species-create.js | 6 - node_modules/core-js/modules/_bind.js | 24 - node_modules/core-js/modules/_classof.js | 23 - node_modules/core-js/modules/_cof.js | 5 - .../core-js/modules/_collection-strong.js | 142 - .../core-js/modules/_collection-to-json.js | 9 - .../core-js/modules/_collection-weak.js | 83 - node_modules/core-js/modules/_collection.js | 85 - node_modules/core-js/modules/_core.js | 2 - .../core-js/modules/_create-property.js | 8 - node_modules/core-js/modules/_ctx.js | 20 - .../core-js/modules/_date-to-primitive.js | 9 - node_modules/core-js/modules/_defined.js | 5 - node_modules/core-js/modules/_descriptors.js | 4 - node_modules/core-js/modules/_dom-create.js | 7 - .../core-js/modules/_entry-virtual.js | 5 - .../core-js/modules/_enum-bug-keys.js | 4 - node_modules/core-js/modules/_enum-keys.js | 15 - node_modules/core-js/modules/_export.js | 43 - .../core-js/modules/_fails-is-regexp.js | 12 - node_modules/core-js/modules/_fails.js | 7 - node_modules/core-js/modules/_fix-re-wks.js | 28 - node_modules/core-js/modules/_flags.js | 13 - node_modules/core-js/modules/_for-of.js | 25 - node_modules/core-js/modules/_global.js | 4 - node_modules/core-js/modules/_has.js | 4 - node_modules/core-js/modules/_hide.js | 8 - node_modules/core-js/modules/_html.js | 1 - .../core-js/modules/_ie8-dom-define.js | 3 - .../core-js/modules/_inherit-if-required.js | 8 - node_modules/core-js/modules/_invoke.js | 16 - node_modules/core-js/modules/_iobject.js | 5 - .../core-js/modules/_is-array-iter.js | 8 - node_modules/core-js/modules/_is-array.js | 5 - node_modules/core-js/modules/_is-integer.js | 6 - node_modules/core-js/modules/_is-object.js | 3 - node_modules/core-js/modules/_is-regexp.js | 8 - node_modules/core-js/modules/_iter-call.js | 12 - node_modules/core-js/modules/_iter-create.js | 13 - node_modules/core-js/modules/_iter-define.js | 70 - node_modules/core-js/modules/_iter-detect.js | 21 - node_modules/core-js/modules/_iter-step.js | 3 - node_modules/core-js/modules/_iterators.js | 1 - node_modules/core-js/modules/_keyof.js | 10 - node_modules/core-js/modules/_library.js | 1 - node_modules/core-js/modules/_math-expm1.js | 10 - node_modules/core-js/modules/_math-log1p.js | 4 - node_modules/core-js/modules/_math-sign.js | 4 - node_modules/core-js/modules/_meta.js | 53 - node_modules/core-js/modules/_metadata.js | 51 - node_modules/core-js/modules/_microtask.js | 68 - .../core-js/modules/_object-assign.js | 33 - .../core-js/modules/_object-create.js | 41 - .../core-js/modules/_object-define.js | 12 - node_modules/core-js/modules/_object-dp.js | 16 - node_modules/core-js/modules/_object-dps.js | 13 - .../core-js/modules/_object-forced-pam.js | 7 - node_modules/core-js/modules/_object-gopd.js | 16 - .../core-js/modules/_object-gopn-ext.js | 19 - node_modules/core-js/modules/_object-gopn.js | 7 - node_modules/core-js/modules/_object-gops.js | 1 - node_modules/core-js/modules/_object-gpo.js | 13 - .../core-js/modules/_object-keys-internal.js | 17 - node_modules/core-js/modules/_object-keys.js | 7 - node_modules/core-js/modules/_object-pie.js | 1 - node_modules/core-js/modules/_object-sap.js | 10 - .../core-js/modules/_object-to-array.js | 16 - node_modules/core-js/modules/_own-keys.js | 10 - node_modules/core-js/modules/_parse-float.js | 8 - node_modules/core-js/modules/_parse-int.js | 9 - node_modules/core-js/modules/_partial.js | 23 - node_modules/core-js/modules/_path.js | 1 - .../core-js/modules/_property-desc.js | 8 - node_modules/core-js/modules/_redefine-all.js | 5 - node_modules/core-js/modules/_redefine.js | 32 - node_modules/core-js/modules/_replacer.js | 8 - node_modules/core-js/modules/_same-value.js | 4 - node_modules/core-js/modules/_set-proto.js | 25 - node_modules/core-js/modules/_set-species.js | 13 - .../core-js/modules/_set-to-string-tag.js | 7 - node_modules/core-js/modules/_shared-key.js | 5 - node_modules/core-js/modules/_shared.js | 6 - .../core-js/modules/_species-constructor.js | 8 - .../core-js/modules/_strict-method.js | 7 - node_modules/core-js/modules/_string-at.js | 17 - .../core-js/modules/_string-context.js | 8 - node_modules/core-js/modules/_string-html.js | 19 - node_modules/core-js/modules/_string-pad.js | 16 - .../core-js/modules/_string-repeat.js | 12 - node_modules/core-js/modules/_string-trim.js | 30 - node_modules/core-js/modules/_string-ws.js | 2 - node_modules/core-js/modules/_task.js | 75 - node_modules/core-js/modules/_to-index.js | 7 - node_modules/core-js/modules/_to-integer.js | 6 - node_modules/core-js/modules/_to-iobject.js | 6 - node_modules/core-js/modules/_to-length.js | 6 - node_modules/core-js/modules/_to-object.js | 5 - node_modules/core-js/modules/_to-primitive.js | 12 - node_modules/core-js/modules/_typed-array.js | 479 - node_modules/core-js/modules/_typed-buffer.js | 273 - node_modules/core-js/modules/_typed.js | 26 - node_modules/core-js/modules/_uid.js | 5 - node_modules/core-js/modules/_wks-define.js | 9 - node_modules/core-js/modules/_wks-ext.js | 1 - node_modules/core-js/modules/_wks.js | 11 - node_modules/core-js/modules/core.delay.js | 8 +- node_modules/core-js/modules/core.dict.js | 40 +- .../core-js/modules/core.function.part.js | 8 +- .../modules/core.get-iterator-method.js | 8 +- .../core-js/modules/core.get-iterator.js | 4 +- .../core-js/modules/core.is-iterable.js | 8 +- .../core-js/modules/core.number.iterator.js | 2 +- .../core-js/modules/core.object.classof.js | 4 +- .../core-js/modules/core.object.define.js | 4 +- .../core-js/modules/core.object.is-object.js | 4 +- .../core-js/modules/core.object.make.js | 6 +- .../core-js/modules/core.regexp.escape.js | 5 - .../modules/core.string.escape-html.js | 4 +- .../modules/core.string.unescape-html.js | 4 +- node_modules/core-js/modules/es5.js | 311 +- .../core-js/modules/es6.array.copy-within.js | 6 +- .../core-js/modules/es6.array.every.js | 10 - .../core-js/modules/es6.array.fill.js | 6 +- .../core-js/modules/es6.array.filter.js | 10 - .../core-js/modules/es6.array.find-index.js | 6 +- .../core-js/modules/es6.array.find.js | 6 +- .../core-js/modules/es6.array.for-each.js | 11 - .../core-js/modules/es6.array.from.js | 29 +- .../core-js/modules/es6.array.index-of.js | 15 - .../core-js/modules/es6.array.is-array.js | 4 - .../core-js/modules/es6.array.iterator.js | 10 +- .../core-js/modules/es6.array.join.js | 12 - .../modules/es6.array.last-index-of.js | 22 - node_modules/core-js/modules/es6.array.map.js | 10 - node_modules/core-js/modules/es6.array.of.js | 14 +- .../core-js/modules/es6.array.reduce-right.js | 10 - .../core-js/modules/es6.array.reduce.js | 10 - .../core-js/modules/es6.array.slice.js | 28 - .../core-js/modules/es6.array.some.js | 10 - .../core-js/modules/es6.array.sort.js | 23 - .../core-js/modules/es6.array.species.js | 2 +- node_modules/core-js/modules/es6.date.now.js | 4 - .../core-js/modules/es6.date.to-iso-string.js | 28 - .../core-js/modules/es6.date.to-json.js | 14 - .../core-js/modules/es6.date.to-primitive.js | 4 - .../core-js/modules/es6.date.to-string.js | 7 +- .../core-js/modules/es6.function.bind.js | 4 - .../modules/es6.function.has-instance.js | 12 +- .../core-js/modules/es6.function.name.js | 25 +- node_modules/core-js/modules/es6.map.js | 4 +- .../core-js/modules/es6.math.acosh.js | 12 +- .../core-js/modules/es6.math.asinh.js | 6 +- .../core-js/modules/es6.math.atanh.js | 6 +- node_modules/core-js/modules/es6.math.cbrt.js | 4 +- .../core-js/modules/es6.math.clz32.js | 2 +- node_modules/core-js/modules/es6.math.cosh.js | 2 +- .../core-js/modules/es6.math.expm1.js | 5 +- .../core-js/modules/es6.math.fround.js | 4 +- .../core-js/modules/es6.math.hypot.js | 15 +- node_modules/core-js/modules/es6.math.imul.js | 4 +- .../core-js/modules/es6.math.log10.js | 2 +- .../core-js/modules/es6.math.log1p.js | 4 +- node_modules/core-js/modules/es6.math.log2.js | 2 +- node_modules/core-js/modules/es6.math.sign.js | 4 +- node_modules/core-js/modules/es6.math.sinh.js | 6 +- node_modules/core-js/modules/es6.math.tanh.js | 4 +- .../core-js/modules/es6.math.trunc.js | 2 +- .../core-js/modules/es6.number.constructor.js | 43 +- .../core-js/modules/es6.number.epsilon.js | 2 +- .../core-js/modules/es6.number.is-finite.js | 4 +- .../core-js/modules/es6.number.is-integer.js | 4 +- .../core-js/modules/es6.number.is-nan.js | 2 +- .../modules/es6.number.is-safe-integer.js | 4 +- .../modules/es6.number.max-safe-integer.js | 2 +- .../modules/es6.number.min-safe-integer.js | 2 +- .../core-js/modules/es6.number.parse-float.js | 6 +- .../core-js/modules/es6.number.parse-int.js | 6 +- .../core-js/modules/es6.number.to-fixed.js | 113 - .../modules/es6.number.to-precision.js | 18 - .../core-js/modules/es6.object.assign.js | 4 +- .../core-js/modules/es6.object.create.js | 3 - .../modules/es6.object.define-properties.js | 3 - .../modules/es6.object.define-property.js | 3 - .../core-js/modules/es6.object.freeze.js | 7 +- .../es6.object.get-own-property-descriptor.js | 5 +- .../es6.object.get-own-property-names.js | 4 +- .../modules/es6.object.get-prototype-of.js | 5 +- .../modules/es6.object.is-extensible.js | 4 +- .../core-js/modules/es6.object.is-frozen.js | 4 +- .../core-js/modules/es6.object.is-sealed.js | 4 +- node_modules/core-js/modules/es6.object.is.js | 4 +- .../core-js/modules/es6.object.keys.js | 5 +- .../modules/es6.object.prevent-extensions.js | 7 +- .../core-js/modules/es6.object.seal.js | 7 +- .../modules/es6.object.set-prototype-of.js | 4 +- .../core-js/modules/es6.object.to-string.js | 6 +- .../core-js/modules/es6.parse-float.js | 4 - node_modules/core-js/modules/es6.parse-int.js | 4 - node_modules/core-js/modules/es6.promise.js | 312 +- .../core-js/modules/es6.reflect.apply.js | 18 +- .../core-js/modules/es6.reflect.construct.js | 30 +- .../modules/es6.reflect.define-property.js | 15 +- .../modules/es6.reflect.delete-property.js | 8 +- .../core-js/modules/es6.reflect.enumerate.js | 6 +- ...es6.reflect.get-own-property-descriptor.js | 8 +- .../modules/es6.reflect.get-prototype-of.js | 6 +- .../core-js/modules/es6.reflect.get.js | 15 +- .../core-js/modules/es6.reflect.has.js | 2 +- .../modules/es6.reflect.is-extensible.js | 4 +- .../core-js/modules/es6.reflect.own-keys.js | 4 +- .../modules/es6.reflect.prevent-extensions.js | 4 +- .../modules/es6.reflect.set-prototype-of.js | 4 +- .../core-js/modules/es6.reflect.set.js | 22 +- .../core-js/modules/es6.regexp.constructor.js | 47 +- .../core-js/modules/es6.regexp.flags.js | 5 +- .../core-js/modules/es6.regexp.match.js | 6 +- .../core-js/modules/es6.regexp.replace.js | 6 +- .../core-js/modules/es6.regexp.search.js | 6 +- .../core-js/modules/es6.regexp.split.js | 72 +- .../core-js/modules/es6.regexp.to-string.js | 25 - node_modules/core-js/modules/es6.set.js | 4 +- .../core-js/modules/es6.string.anchor.js | 7 - .../core-js/modules/es6.string.big.js | 7 - .../core-js/modules/es6.string.blink.js | 7 - .../core-js/modules/es6.string.bold.js | 7 - .../modules/es6.string.code-point-at.js | 4 +- .../core-js/modules/es6.string.ends-with.js | 11 +- .../core-js/modules/es6.string.fixed.js | 7 - .../core-js/modules/es6.string.fontcolor.js | 7 - .../core-js/modules/es6.string.fontsize.js | 7 - .../modules/es6.string.from-code-point.js | 15 +- .../core-js/modules/es6.string.includes.js | 6 +- .../core-js/modules/es6.string.italics.js | 7 - .../core-js/modules/es6.string.iterator.js | 4 +- .../core-js/modules/es6.string.link.js | 7 - .../core-js/modules/es6.string.raw.js | 19 +- .../core-js/modules/es6.string.repeat.js | 4 +- .../core-js/modules/es6.string.small.js | 7 - .../core-js/modules/es6.string.starts-with.js | 11 +- .../core-js/modules/es6.string.strike.js | 7 - .../core-js/modules/es6.string.sub.js | 7 - .../core-js/modules/es6.string.sup.js | 7 - .../core-js/modules/es6.string.trim.js | 2 +- node_modules/core-js/modules/es6.symbol.js | 250 +- .../core-js/modules/es6.typed.array-buffer.js | 81 +- .../core-js/modules/es6.typed.data-view.js | 8 +- .../modules/es6.typed.float32-array.js | 2 +- .../modules/es6.typed.float64-array.js | 2 +- .../core-js/modules/es6.typed.int16-array.js | 2 +- .../core-js/modules/es6.typed.int32-array.js | 2 +- .../core-js/modules/es6.typed.int8-array.js | 2 +- .../core-js/modules/es6.typed.uint16-array.js | 2 +- .../core-js/modules/es6.typed.uint32-array.js | 2 +- .../core-js/modules/es6.typed.uint8-array.js | 2 +- .../modules/es6.typed.uint8-clamped-array.js | 2 +- node_modules/core-js/modules/es6.weak-map.js | 51 +- node_modules/core-js/modules/es6.weak-set.js | 4 +- .../core-js/modules/es7.array.includes.js | 8 +- node_modules/core-js/modules/es7.asap.js | 12 - .../core-js/modules/es7.error.is-error.js | 9 - .../core-js/modules/es7.map.to-json.js | 4 +- .../core-js/modules/es7.math.iaddh.js | 11 - .../core-js/modules/es7.math.imulh.js | 16 - .../core-js/modules/es7.math.isubh.js | 11 - .../core-js/modules/es7.math.umulh.js | 16 - .../modules/es7.object.define-getter.js | 12 - .../modules/es7.object.define-setter.js | 12 - .../core-js/modules/es7.object.entries.js | 6 +- .../modules/es7.object.enumerable-entries.js | 12 - .../modules/es7.object.enumerable-keys.js | 12 - .../modules/es7.object.enumerable-values.js | 12 - ...es7.object.get-own-property-descriptors.js | 24 +- .../modules/es7.object.lookup-getter.js | 18 - .../modules/es7.object.lookup-setter.js | 18 - .../core-js/modules/es7.object.values.js | 6 +- .../core-js/modules/es7.observable.js | 199 - .../modules/es7.reflect.define-metadata.js | 8 - .../modules/es7.reflect.delete-metadata.js | 15 - .../modules/es7.reflect.get-metadata-keys.js | 19 - .../modules/es7.reflect.get-metadata.js | 17 - .../es7.reflect.get-own-metadata-keys.js | 8 - .../modules/es7.reflect.get-own-metadata.js | 9 - .../modules/es7.reflect.has-metadata.js | 16 - .../modules/es7.reflect.has-own-metadata.js | 9 - .../core-js/modules/es7.reflect.metadata.js | 15 - .../core-js/modules/es7.set.to-json.js | 4 +- node_modules/core-js/modules/es7.string.at.js | 4 +- .../core-js/modules/es7.string.match-all.js | 30 - .../core-js/modules/es7.string.pad-end.js | 10 - .../core-js/modules/es7.string.pad-start.js | 10 - .../core-js/modules/es7.string.trim-left.js | 4 +- .../core-js/modules/es7.string.trim-right.js | 4 +- .../modules/es7.symbol.async-iterator.js | 1 - .../core-js/modules/es7.symbol.observable.js | 1 - .../core-js/modules/es7.system.global.js | 4 - .../modules/library/_add-to-unscopables.js | 1 - .../core-js/modules/library/_collection.js | 59 - .../core-js/modules/library/_export.js | 61 - .../core-js/modules/library/_library.js | 1 - node_modules/core-js/modules/library/_path.js | 1 - .../core-js/modules/library/_redefine-all.js | 7 - .../core-js/modules/library/_redefine.js | 1 - .../core-js/modules/library/_set-species.js | 14 - .../modules/library/es6.date.to-primitive.js | 0 .../modules/library/es6.regexp.constructor.js | 2 +- .../modules/library/es6.regexp.to-string.js | 0 .../modules/library/web.dom.iterable.js | 14 +- .../core-js/modules/web.dom.iterable.js | 34 +- node_modules/core-js/modules/web.immediate.js | 4 +- node_modules/core-js/modules/web.timers.js | 8 +- node_modules/core-js/package.json | 56 +- node_modules/core-js/shim.js | 104 +- node_modules/core-js/stage/0.js | 10 - node_modules/core-js/stage/1.js | 6 - node_modules/core-js/stage/2.js | 3 - node_modules/core-js/stage/3.js | 4 - node_modules/core-js/stage/4.js | 8 - node_modules/core-js/stage/index.js | 1 - node_modules/core-js/stage/pre.js | 10 - node_modules/core-js/web/dom-collections.js | 2 - node_modules/core-js/web/immediate.js | 2 +- node_modules/core-js/web/index.js | 2 +- node_modules/core-js/web/timers.js | 2 +- node_modules/crc32-stream/README.md | 4 +- node_modules/crc32-stream/lib/crc32-stream.js | 12 +- .../crc32-stream/lib/deflate-crc32-stream.js | 12 +- node_modules/crc32-stream/package.json | 10 +- node_modules/dateformat/.npmignore | 59 +- node_modules/dateformat/.travis.yml | 4 - node_modules/dateformat/Readme.md | 135 +- node_modules/dateformat/bin/cli.js | 75 - node_modules/dateformat/package.json | 12 +- .../dateformat/test/test_dayofweek.js | 15 - node_modules/dateformat/test/test_formats.js | 76 - .../dateformat/test/test_isoutcdatetime.js | 11 - .../test/weekofyear/test_weekofyear.js | 4 - .../test/weekofyear/test_weekofyear.sh | 27 - node_modules/debug/.jshintrc | 3 - node_modules/debug/.npmignore | 2 + node_modules/debug/History.md | 195 - node_modules/debug/Makefile | 50 +- node_modules/debug/Readme.md | 188 - node_modules/debug/bower.json | 7 +- node_modules/debug/browser.js | 168 - node_modules/debug/component.json | 8 +- node_modules/debug/debug.js | 197 - node_modules/debug/node.js | 210 +- node_modules/debug/package.json | 27 +- node_modules/error-ex/index.js | 34 +- node_modules/error-ex/package.json | 4 +- node_modules/fancy-log/LICENSE | 2 +- node_modules/fancy-log/README.md | 18 +- node_modules/fancy-log/index.js | 24 + node_modules/fancy-log/package.json | 10 +- node_modules/for-in/LICENSE | 2 +- node_modules/for-in/README.md | 57 +- node_modules/for-in/index.js | 10 +- node_modules/for-in/package.json | 20 +- node_modules/for-own/LICENSE | 2 +- node_modules/for-own/README.md | 67 +- node_modules/for-own/index.js | 12 +- node_modules/for-own/package.json | 20 +- .../node_modules/glob-parent/.npmignore | 4 - .../node_modules/glob-parent/.travis.yml | 8 - .../node_modules/glob-parent/LICENSE | 15 - .../node_modules/glob-parent/README.md | 43 - .../node_modules/glob-parent/index.js | 10 - .../node_modules/glob-parent/package.json | 35 - .../node_modules/glob-parent/test.js | 28 - node_modules/glob-parent/.travis.yml | 8 +- node_modules/glob-parent/README.md | 22 - node_modules/glob-parent/appveyor.yml | 25 - node_modules/glob-parent/index.js | 5 +- .../node_modules/is-extglob/LICENSE | 21 - .../node_modules/is-extglob/README.md | 107 - .../node_modules/is-extglob/index.js | 20 - .../node_modules/is-extglob/package.json | 69 - .../glob-parent/node_modules/is-glob/LICENSE | 21 - .../node_modules/is-glob/README.md | 142 - .../glob-parent/node_modules/is-glob/index.js | 25 - .../node_modules/is-glob/package.json | 80 - node_modules/glob-parent/package.json | 16 +- node_modules/glob-parent/test.js | 103 +- node_modules/global-prefix/index.js | 16 +- node_modules/global-prefix/package.json | 21 +- node_modules/globals/globals.json | 4 + node_modules/globals/package.json | 2 +- node_modules/graceful-fs/package.json | 2 +- node_modules/graceful-fs/polyfills.js | 12 +- .../node_modules/clone-stats/LICENSE.md | 21 - .../node_modules/clone-stats/README.md | 17 - .../node_modules/clone-stats/index.js | 13 - .../node_modules/clone-stats/package.json | 31 - .../node_modules/clone-stats/test.js | 36 - .../gulp-debug/node_modules/gulp-util/LICENSE | 20 - .../node_modules/gulp-util/README.md | 146 - .../node_modules/gulp-util/index.js | 18 - .../node_modules/gulp-util/lib/PluginError.js | 130 - .../node_modules/gulp-util/lib/buffer.js | 15 - .../node_modules/gulp-util/lib/combine.js | 11 - .../node_modules/gulp-util/lib/env.js | 4 - .../node_modules/gulp-util/lib/isBuffer.js | 7 - .../node_modules/gulp-util/lib/isNull.js | 3 - .../node_modules/gulp-util/lib/isStream.js | 5 - .../node_modules/gulp-util/lib/log.js | 14 - .../node_modules/gulp-util/lib/noop.js | 5 - .../node_modules/gulp-util/lib/template.js | 23 - .../gulp-util/node_modules/.bin/dateformat | 1 - .../node_modules/object-assign/index.js | 39 - .../node_modules/object-assign/license | 21 - .../node_modules/object-assign/package.json | 38 - .../node_modules/object-assign/readme.md | 51 - .../node_modules/gulp-util/package.json | 51 - .../lodash._reinterpolate/LICENSE.txt | 22 - .../lodash._reinterpolate/README.md | 20 - .../lodash._reinterpolate/index.js | 13 - .../lodash._reinterpolate/package.json | 18 - .../node_modules/lodash.template/LICENSE | 22 - .../node_modules/lodash.template/README.md | 20 - .../node_modules/lodash.template/index.js | 389 - .../node_modules/lodash.template/package.json | 30 - .../node_modules/replace-ext/.npmignore | 6 - .../node_modules/replace-ext/.travis.yml | 8 - .../node_modules/replace-ext/LICENSE | 20 - .../node_modules/replace-ext/README.md | 44 - .../node_modules/replace-ext/index.js | 9 - .../node_modules/replace-ext/package.json | 35 - .../node_modules/replace-ext/test/main.js | 51 - .../gulp-debug/node_modules/vinyl/LICENSE | 20 - .../gulp-debug/node_modules/vinyl/README.md | 195 - .../gulp-debug/node_modules/vinyl/index.js | 213 - .../node_modules/vinyl/lib/cloneBuffer.js | 7 - .../node_modules/vinyl/lib/inspectStream.js | 11 - .../node_modules/vinyl/lib/isBuffer.js | 1 - .../node_modules/vinyl/lib/isNull.js | 3 - .../node_modules/vinyl/lib/isStream.js | 5 - .../node_modules/vinyl/package.json | 37 - .../node_modules/clone-stats/LICENSE.md | 21 - .../node_modules/clone-stats/README.md | 17 - .../node_modules/clone-stats/index.js | 13 - .../node_modules/clone-stats/package.json | 31 - .../node_modules/clone-stats/test.js | 36 - .../node_modules/gulp-util/LICENSE | 20 - .../node_modules/gulp-util/README.md | 146 - .../node_modules/gulp-util/index.js | 18 - .../node_modules/gulp-util/lib/PluginError.js | 130 - .../node_modules/gulp-util/lib/buffer.js | 15 - .../node_modules/gulp-util/lib/combine.js | 11 - .../node_modules/gulp-util/lib/env.js | 4 - .../node_modules/gulp-util/lib/isBuffer.js | 7 - .../node_modules/gulp-util/lib/isNull.js | 3 - .../node_modules/gulp-util/lib/isStream.js | 5 - .../node_modules/gulp-util/lib/log.js | 14 - .../node_modules/gulp-util/lib/noop.js | 5 - .../node_modules/gulp-util/lib/template.js | 23 - .../gulp-util/node_modules/.bin/dateformat | 1 - .../node_modules/gulp-util/package.json | 51 - .../lodash._reinterpolate/LICENSE.txt | 22 - .../lodash._reinterpolate/README.md | 20 - .../lodash._reinterpolate/index.js | 13 - .../lodash._reinterpolate/package.json | 18 - .../node_modules/lodash.template/LICENSE | 22 - .../node_modules/lodash.template/README.md | 20 - .../node_modules/lodash.template/index.js | 389 - .../node_modules/lodash.template/package.json | 30 - .../node_modules/object-assign/index.js | 39 - .../node_modules/object-assign/license | 21 - .../node_modules/object-assign/package.json | 38 - .../node_modules/object-assign/readme.md | 51 - .../node_modules/replace-ext/.npmignore | 6 - .../node_modules/replace-ext/.travis.yml | 8 - .../node_modules/replace-ext/LICENSE | 20 - .../node_modules/replace-ext/README.md | 44 - .../node_modules/replace-ext/index.js | 9 - .../node_modules/replace-ext/package.json | 35 - .../node_modules/replace-ext/test/main.js | 51 - .../node_modules/vinyl/LICENSE | 20 - .../node_modules/vinyl/README.md | 195 - .../node_modules/vinyl/index.js | 213 - .../node_modules/vinyl/lib/cloneBuffer.js | 7 - .../node_modules/vinyl/lib/inspectStream.js | 11 - .../node_modules/vinyl/lib/isBuffer.js | 1 - .../node_modules/vinyl/lib/isNull.js | 3 - .../node_modules/vinyl/lib/isStream.js | 5 - .../node_modules/vinyl/package.json | 37 - .../node_modules/clone-stats/LICENSE.md | 21 - .../node_modules/clone-stats/README.md | 17 - .../node_modules/clone-stats/index.js | 13 - .../node_modules/clone-stats/package.json | 31 - .../node_modules/clone-stats/test.js | 36 - .../node_modules/replace-ext/.npmignore | 6 - .../node_modules/replace-ext/.travis.yml | 8 - .../node_modules/replace-ext/LICENSE | 20 - .../node_modules/replace-ext/README.md | 44 - .../node_modules/replace-ext/index.js | 9 - .../node_modules/replace-ext/package.json | 35 - .../node_modules/replace-ext/test/main.js | 51 - .../node_modules/clone-stats/LICENSE.md | 21 - .../node_modules/clone-stats/README.md | 17 - .../node_modules/clone-stats/index.js | 13 - .../node_modules/clone-stats/package.json | 31 - .../gulp-tar/node_modules/clone-stats/test.js | 36 - .../gulp-tar/node_modules/gulp-util/LICENSE | 20 - .../gulp-tar/node_modules/gulp-util/README.md | 146 - .../gulp-tar/node_modules/gulp-util/index.js | 18 - .../node_modules/gulp-util/lib/PluginError.js | 130 - .../node_modules/gulp-util/lib/buffer.js | 15 - .../node_modules/gulp-util/lib/combine.js | 11 - .../node_modules/gulp-util/lib/env.js | 4 - .../node_modules/gulp-util/lib/isBuffer.js | 7 - .../node_modules/gulp-util/lib/isNull.js | 3 - .../node_modules/gulp-util/lib/isStream.js | 5 - .../node_modules/gulp-util/lib/log.js | 14 - .../node_modules/gulp-util/lib/noop.js | 5 - .../node_modules/gulp-util/lib/template.js | 23 - .../gulp-util/node_modules/.bin/dateformat | 1 - .../node_modules/object-assign/index.js | 39 - .../node_modules/object-assign/license | 21 - .../node_modules/object-assign/package.json | 38 - .../node_modules/object-assign/readme.md | 51 - .../node_modules/gulp-util/package.json | 51 - .../lodash._reinterpolate/LICENSE.txt | 22 - .../lodash._reinterpolate/README.md | 20 - .../lodash._reinterpolate/index.js | 13 - .../lodash._reinterpolate/package.json | 18 - .../node_modules/lodash.template/LICENSE | 22 - .../node_modules/lodash.template/README.md | 20 - .../node_modules/lodash.template/index.js | 389 - .../node_modules/lodash.template/package.json | 30 - .../node_modules/replace-ext/.npmignore | 6 - .../node_modules/replace-ext/.travis.yml | 8 - .../gulp-tar/node_modules/replace-ext/LICENSE | 20 - .../node_modules/replace-ext/README.md | 44 - .../node_modules/replace-ext/index.js | 9 - .../node_modules/replace-ext/package.json | 35 - .../node_modules/replace-ext/test/main.js | 51 - .../gulp-tar/node_modules/vinyl/LICENSE | 20 - .../gulp-tar/node_modules/vinyl/README.md | 195 - .../gulp-tar/node_modules/vinyl/index.js | 213 - .../node_modules/vinyl/lib/cloneBuffer.js | 7 - .../node_modules/vinyl/lib/inspectStream.js | 11 - .../node_modules/vinyl/lib/isBuffer.js | 1 - .../gulp-tar/node_modules/vinyl/lib/isNull.js | 3 - .../node_modules/vinyl/lib/isStream.js | 5 - .../gulp-tar/node_modules/vinyl/package.json | 37 - .../node_modules/clone-stats/LICENSE.md | 21 - .../node_modules/clone-stats/README.md | 17 - .../node_modules/clone-stats/index.js | 13 - .../node_modules/clone-stats/package.json | 31 - .../node_modules/clone-stats/test.js | 36 - .../node_modules/gulp-util/LICENSE | 20 - .../node_modules/gulp-util/README.md | 146 - .../node_modules/gulp-util/index.js | 18 - .../node_modules/gulp-util/lib/PluginError.js | 130 - .../node_modules/gulp-util/lib/buffer.js | 15 - .../node_modules/gulp-util/lib/combine.js | 11 - .../node_modules/gulp-util/lib/env.js | 4 - .../node_modules/gulp-util/lib/isBuffer.js | 7 - .../node_modules/gulp-util/lib/isNull.js | 3 - .../node_modules/gulp-util/lib/isStream.js | 5 - .../node_modules/gulp-util/lib/log.js | 14 - .../node_modules/gulp-util/lib/noop.js | 5 - .../node_modules/gulp-util/lib/template.js | 23 - .../gulp-util/node_modules/.bin/dateformat | 1 - .../node_modules/gulp-util/package.json | 51 - .../lodash._reinterpolate/LICENSE.txt | 22 - .../lodash._reinterpolate/README.md | 20 - .../lodash._reinterpolate/index.js | 13 - .../lodash._reinterpolate/package.json | 18 - .../node_modules/lodash.template/LICENSE | 22 - .../node_modules/lodash.template/README.md | 20 - .../node_modules/lodash.template/index.js | 389 - .../node_modules/lodash.template/package.json | 30 - .../node_modules/object-assign/index.js | 39 - .../node_modules/object-assign/license | 21 - .../node_modules/object-assign/package.json | 38 - .../node_modules/object-assign/readme.md | 51 - .../node_modules/replace-ext/.npmignore | 6 - .../node_modules/replace-ext/.travis.yml | 8 - .../node_modules/replace-ext/LICENSE | 20 - .../node_modules/replace-ext/README.md | 44 - .../node_modules/replace-ext/index.js | 9 - .../node_modules/replace-ext/package.json | 35 - .../node_modules/replace-ext/test/main.js | 51 - .../node_modules/vinyl/LICENSE | 20 - .../node_modules/vinyl/README.md | 195 - .../node_modules/vinyl/index.js | 213 - .../node_modules/vinyl/lib/cloneBuffer.js | 7 - .../node_modules/vinyl/lib/inspectStream.js | 11 - .../node_modules/vinyl/lib/isBuffer.js | 1 - .../node_modules/vinyl/lib/isNull.js | 3 - .../node_modules/vinyl/lib/isStream.js | 5 - .../node_modules/vinyl/package.json | 37 - node_modules/gulp-typescript/package.json | 5 +- .../gulp-typescript/release/compiler.d.ts | 4 +- .../gulp-typescript/release/compiler.js | 101 +- .../gulp-typescript/release/output.js | 4 +- .../gulp-typescript/release/project.d.ts | 1 + .../gulp-typescript/release/project.js | 1 + node_modules/gulp-util/.npmignore | 7 - node_modules/gulp-util/.travis.yml | 5 - node_modules/gulp-util/README.md | 33 +- node_modules/gulp-util/index.js | 14 +- node_modules/gulp-util/lib/File.js | 1 - node_modules/gulp-util/lib/PluginError.js | 114 +- node_modules/gulp-util/lib/beep.js | 3 - node_modules/gulp-util/lib/buffer.js | 2 +- node_modules/gulp-util/lib/colors.js | 1 - node_modules/gulp-util/lib/date.js | 1 - node_modules/gulp-util/lib/env.js | 2 +- node_modules/gulp-util/lib/isBuffer.js | 2 +- node_modules/gulp-util/lib/isNull.js | 2 +- node_modules/gulp-util/lib/isStream.js | 2 +- node_modules/gulp-util/lib/linefeed.js | 1 - node_modules/gulp-util/lib/log.js | 16 +- .../gulp-util/lib/replaceExtension.js | 9 - node_modules/gulp-util/lib/template.js | 14 +- .../gulp-util/node_modules/.bin/dateformat | 1 - .../node_modules/ansi-regex/index.js | 4 - .../node_modules/ansi-regex/package.json | 51 - .../node_modules/ansi-regex/readme.md | 33 - .../node_modules/ansi-styles/index.js | 40 - .../node_modules/ansi-styles/package.json | 46 - .../node_modules/ansi-styles/readme.md | 70 - .../gulp-util/node_modules/chalk/index.js | 95 - .../chalk/node_modules/.bin/has-ansi | 1 - .../chalk/node_modules/.bin/strip-ansi | 1 - .../chalk/node_modules/.bin/supports-color | 1 - .../gulp-util/node_modules/chalk/package.json | 53 - .../gulp-util/node_modules/chalk/readme.md | 175 - .../node_modules/clone-stats/LICENSE.md | 21 - .../node_modules/clone-stats/README.md | 17 - .../node_modules/clone-stats/index.js | 13 - .../node_modules/clone-stats/package.json | 31 - .../node_modules/clone-stats/test.js | 36 - .../gulp-util/node_modules/has-ansi/cli.js | 53 - .../gulp-util/node_modules/has-ansi/index.js | 4 - .../node_modules/has-ansi/package.json | 57 - .../gulp-util/node_modules/has-ansi/readme.md | 45 - .../gulp-util/node_modules/isarray/README.md | 54 - .../node_modules/isarray/build/build.js | 209 - .../node_modules/isarray/component.json | 19 - .../gulp-util/node_modules/isarray/index.js | 3 - .../node_modules/isarray/package.json | 25 - .../node_modules/minimist/.travis.yml | 4 - .../gulp-util/node_modules/minimist/LICENSE | 18 - .../node_modules/minimist/example/parse.js | 2 - .../gulp-util/node_modules/minimist/index.js | 200 - .../node_modules/minimist/package.json | 40 - .../node_modules/minimist/readme.markdown | 86 - .../node_modules/minimist/test/all_bool.js | 32 - .../node_modules/minimist/test/bool.js | 119 - .../node_modules/minimist/test/dash.js | 31 - .../minimist/test/default_bool.js | 20 - .../node_modules/minimist/test/dotted.js | 22 - .../node_modules/minimist/test/long.js | 31 - .../node_modules/minimist/test/num.js | 36 - .../node_modules/minimist/test/parse.js | 197 - .../minimist/test/parse_modified.js | 9 - .../node_modules/minimist/test/short.js | 67 - .../node_modules/minimist/test/whitespace.js | 8 - .../node_modules/readable-stream/.npmignore | 5 - .../node_modules/readable-stream/LICENSE | 18 - .../node_modules/readable-stream/README.md | 15 - .../node_modules/readable-stream/duplex.js | 1 - .../readable-stream/lib/_stream_duplex.js | 89 - .../lib/_stream_passthrough.js | 46 - .../readable-stream/lib/_stream_readable.js | 982 - .../readable-stream/lib/_stream_transform.js | 210 - .../readable-stream/lib/_stream_writable.js | 386 - .../node_modules/readable-stream/package.json | 32 - .../readable-stream/passthrough.js | 1 - .../node_modules/readable-stream/readable.js | 11 - .../node_modules/readable-stream/transform.js | 1 - .../node_modules/readable-stream/writable.js | 1 - .../gulp-util/node_modules/strip-ansi/cli.js | 39 - .../node_modules/strip-ansi/index.js | 6 - .../node_modules/strip-ansi/package.json | 56 - .../node_modules/strip-ansi/readme.md | 43 - .../node_modules/supports-color/cli.js | 28 - .../node_modules/supports-color/index.js | 32 - .../node_modules/supports-color/package.json | 50 - .../node_modules/supports-color/readme.md | 44 - .../node_modules/through2/.npmignore | 3 - .../gulp-util/node_modules/through2/LICENSE | 39 - .../gulp-util/node_modules/through2/README.md | 140 - .../node_modules/through2/package.json | 32 - .../node_modules/through2/through2.js | 78 - .../gulp-util/node_modules/vinyl/.npmignore | 6 - .../gulp-util/node_modules/vinyl/.travis.yml | 6 - .../gulp-util/node_modules/vinyl/LICENSE | 0 .../gulp-util/node_modules/vinyl/README.md | 156 +- .../gulp-util/node_modules/vinyl/index.js | 125 +- .../node_modules/vinyl/lib/cloneBuffer.js | 2 +- .../node_modules/vinyl/lib/inspectStream.js | 5 +- .../node_modules/vinyl/lib/isBuffer.js | 8 +- .../node_modules/vinyl/lib/isNull.js | 2 +- .../gulp-util/node_modules/vinyl/package.json | 40 +- .../gulp-util/node_modules/vinyl/test/File.js | 540 - .../node_modules/vinyl/test/cloneBuffer.js | 28 - .../node_modules/vinyl/test/inspectStream.js | 53 - .../node_modules/vinyl/test/isBuffer.js | 29 - .../node_modules/vinyl/test/isNull.js | 23 - .../node_modules/vinyl/test/isStream.js | 29 - .../gulp-util/node_modules/xtend/.jshintrc | 30 - .../gulp-util/node_modules/xtend/.npmignore | 1 - .../gulp-util/node_modules/xtend/LICENCE | 19 - .../gulp-util/node_modules/xtend/Makefile | 4 - .../gulp-util/node_modules/xtend/README.md | 28 - .../gulp-util/node_modules/xtend/index.js | 17 - .../gulp-util/node_modules/xtend/mutable.js | 15 - .../gulp-util/node_modules/xtend/package.json | 60 - .../gulp-util/node_modules/xtend/test.js | 63 - node_modules/gulp-util/package.json | 69 +- .../node_modules/clone-stats/LICENSE.md | 21 - .../node_modules/clone-stats/README.md | 17 - .../node_modules/clone-stats/index.js | 13 - .../node_modules/clone-stats/package.json | 31 - .../gulp-zip/node_modules/clone-stats/test.js | 36 - .../gulp-zip/node_modules/gulp-util/LICENSE | 20 - .../gulp-zip/node_modules/gulp-util/README.md | 146 - .../gulp-zip/node_modules/gulp-util/index.js | 18 - .../node_modules/gulp-util/lib/PluginError.js | 130 - .../node_modules/gulp-util/lib/buffer.js | 15 - .../node_modules/gulp-util/lib/combine.js | 11 - .../node_modules/gulp-util/lib/env.js | 4 - .../node_modules/gulp-util/lib/isBuffer.js | 7 - .../node_modules/gulp-util/lib/isNull.js | 3 - .../node_modules/gulp-util/lib/isStream.js | 5 - .../node_modules/gulp-util/lib/log.js | 14 - .../node_modules/gulp-util/lib/noop.js | 5 - .../node_modules/gulp-util/lib/template.js | 23 - .../gulp-util/node_modules/.bin/dateformat | 1 - .../node_modules/gulp-util/package.json | 51 - .../lodash._reinterpolate/LICENSE.txt | 22 - .../lodash._reinterpolate/README.md | 20 - .../lodash._reinterpolate/index.js | 13 - .../lodash._reinterpolate/package.json | 18 - .../node_modules/lodash.template/LICENSE | 22 - .../node_modules/lodash.template/README.md | 20 - .../node_modules/lodash.template/index.js | 389 - .../node_modules/lodash.template/package.json | 30 - .../node_modules/object-assign/index.js | 39 - .../node_modules/object-assign/license | 21 - .../node_modules/object-assign/package.json | 38 - .../node_modules/object-assign/readme.md | 51 - .../node_modules/replace-ext/.npmignore | 6 - .../node_modules/replace-ext/.travis.yml | 8 - .../gulp-zip/node_modules/replace-ext/LICENSE | 20 - .../node_modules/replace-ext/README.md | 44 - .../node_modules/replace-ext/index.js | 9 - .../node_modules/replace-ext/package.json | 35 - .../node_modules/replace-ext/test/main.js | 51 - .../gulp-zip/node_modules/vinyl/LICENSE | 20 - .../gulp-zip/node_modules/vinyl/README.md | 195 - .../gulp-zip/node_modules/vinyl/index.js | 213 - .../node_modules/vinyl/lib/cloneBuffer.js | 7 - .../node_modules/vinyl/lib/inspectStream.js | 11 - .../node_modules/vinyl/lib/isBuffer.js | 1 - .../gulp-zip/node_modules/vinyl/lib/isNull.js | 3 - .../node_modules/vinyl/lib/isStream.js | 5 - .../gulp-zip/node_modules/vinyl/package.json | 37 - node_modules/gulp/node_modules/.bin/semver | 2 +- .../gulp/node_modules/clone-stats/LICENSE.md | 21 - .../gulp/node_modules/clone-stats/README.md | 17 - .../gulp/node_modules/clone-stats/index.js | 13 - .../node_modules/clone-stats/package.json | 31 - .../gulp/node_modules/clone-stats/test.js | 36 - .../gulp/node_modules/gulp-util/LICENSE | 20 - .../gulp/node_modules/gulp-util/README.md | 146 - .../gulp/node_modules/gulp-util/index.js | 18 - .../node_modules/gulp-util/lib/PluginError.js | 130 - .../gulp/node_modules/gulp-util/lib/buffer.js | 15 - .../node_modules/gulp-util/lib/combine.js | 11 - .../gulp/node_modules/gulp-util/lib/env.js | 4 - .../node_modules/gulp-util/lib/isBuffer.js | 7 - .../gulp/node_modules/gulp-util/lib/isNull.js | 3 - .../node_modules/gulp-util/lib/isStream.js | 5 - .../gulp/node_modules/gulp-util/lib/log.js | 14 - .../gulp/node_modules/gulp-util/lib/noop.js | 5 - .../node_modules/gulp-util/lib/template.js | 23 - .../gulp-util/node_modules/.bin/dateformat | 1 - .../gulp-util/node_modules/clone/.npmignore | 1 - .../gulp-util/node_modules/clone/.travis.yml | 3 - .../gulp-util/node_modules/clone/LICENSE | 18 - .../gulp-util/node_modules/clone/README.md | 126 - .../gulp-util/node_modules/clone/clone.js | 160 - .../gulp-util/node_modules/clone/package.json | 51 - .../node_modules/clone/test-apart-ctx.html | 22 - .../gulp-util/node_modules/clone/test.html | 148 - .../gulp-util/node_modules/clone/test.js | 372 - .../node_modules/readable-stream/.npmignore | 5 - .../node_modules/readable-stream/.travis.yml | 52 - .../node_modules/readable-stream/.zuul.yml | 1 - .../node_modules/readable-stream/LICENSE | 18 - .../node_modules/readable-stream/README.md | 36 - .../readable-stream/doc/stream.markdown | 1760 - .../doc/wg-meetings/2015-01-30.md | 60 - .../node_modules/readable-stream/duplex.js | 1 - .../readable-stream/lib/_stream_duplex.js | 75 - .../lib/_stream_passthrough.js | 26 - .../readable-stream/lib/_stream_readable.js | 880 - .../readable-stream/lib/_stream_transform.js | 180 - .../readable-stream/lib/_stream_writable.js | 516 - .../node_modules/readable-stream/package.json | 37 - .../readable-stream/passthrough.js | 1 - .../node_modules/readable-stream/readable.js | 12 - .../node_modules/readable-stream/transform.js | 1 - .../node_modules/readable-stream/writable.js | 1 - .../node_modules/through2/.npmignore | 3 - .../gulp-util/node_modules/through2/LICENSE | 39 - .../gulp-util/node_modules/through2/README.md | 133 - .../node_modules/through2/package.json | 32 - .../node_modules/through2/through2.js | 96 - .../gulp-util/node_modules/vinyl/LICENSE | 20 - .../gulp-util/node_modules/vinyl/README.md | 195 - .../gulp-util/node_modules/vinyl/index.js | 213 - .../node_modules/vinyl/lib/cloneBuffer.js | 7 - .../node_modules/vinyl/lib/inspectStream.js | 11 - .../node_modules/vinyl/lib/isBuffer.js | 1 - .../node_modules/vinyl/lib/isNull.js | 3 - .../node_modules/vinyl/lib/isStream.js | 5 - .../gulp-util/node_modules/vinyl/package.json | 37 - .../gulp/node_modules/gulp-util/package.json | 51 - .../lodash._reinterpolate/LICENSE.txt | 22 - .../lodash._reinterpolate/README.md | 20 - .../lodash._reinterpolate/index.js | 13 - .../lodash._reinterpolate/package.json | 18 - .../gulp/node_modules/lodash.template/LICENSE | 22 - .../node_modules/lodash.template/README.md | 20 - .../node_modules/lodash.template/index.js | 389 - .../node_modules/lodash.template/package.json | 30 - .../gulp/node_modules/object-assign/index.js | 39 - .../gulp/node_modules/object-assign/license | 21 - .../node_modules/object-assign/package.json | 38 - .../gulp/node_modules/object-assign/readme.md | 51 - .../gulp/node_modules/replace-ext/.npmignore | 6 - .../gulp/node_modules/replace-ext/.travis.yml | 8 - .../gulp/node_modules/replace-ext/LICENSE | 20 - .../gulp/node_modules/replace-ext/README.md | 44 - .../gulp/node_modules/replace-ext/index.js | 9 - .../node_modules/replace-ext/package.json | 35 - .../node_modules/replace-ext/test/main.js | 51 - node_modules/hosted-git-info/.npmignore | 2 - node_modules/hosted-git-info/README.md | 61 +- node_modules/hosted-git-info/git-host-info.js | 16 +- node_modules/hosted-git-info/git-host.js | 84 +- node_modules/hosted-git-info/index.js | 56 +- node_modules/hosted-git-info/package.json | 15 +- node_modules/iconv-lite/.travis.yml | 14 +- node_modules/iconv-lite/Changelog.md | 15 + node_modules/iconv-lite/README.md | 4 +- .../iconv-lite/encodings/dbcs-data.js | 22 +- node_modules/iconv-lite/encodings/utf16.js | 2 + node_modules/iconv-lite/package.json | 9 +- node_modules/interpret/CHANGELOG | 12 + node_modules/interpret/README.md | 11 +- node_modules/interpret/index.js | 17 +- node_modules/interpret/package.json | 2 +- node_modules/is-buffer/.travis.yml | 8 - node_modules/is-buffer/.zuul.yml | 14 - node_modules/is-buffer/package.json | 4 +- node_modules/is-unc-path/LICENSE | 2 +- node_modules/is-unc-path/README.md | 155 +- node_modules/is-unc-path/package.json | 39 +- node_modules/isexe/README.md | 14 +- node_modules/isexe/access.js | 15 - node_modules/isexe/index.js | 2 - node_modules/isexe/mode.js | 10 +- node_modules/isexe/package.json | 9 +- node_modules/isexe/test/basic.js | 10 + node_modules/isexe/windows.js | 14 +- .../istanbul-lib-coverage/CHANGELOG.md | 16 +- node_modules/istanbul-lib-coverage/README.md | 1 + .../istanbul-lib-coverage/lib/file.js | 4 + .../istanbul-lib-coverage/package.json | 12 +- .../istanbul-lib-instrument/CHANGELOG.md | 70 +- .../dist/instrumenter.js | 3 +- .../dist/source-coverage.js | 8 +- .../istanbul-lib-instrument/dist/visitor.js | 11 + .../node_modules/.bin/semver | 2 +- .../node_modules/semver/LICENSE | 15 - .../node_modules/semver/README.md | 350 - .../node_modules/semver/bin/semver | 133 - .../node_modules/semver/package.json | 22 - .../node_modules/semver/range.bnf | 16 - .../node_modules/semver/semver.js | 1203 - .../istanbul-lib-instrument/package.json | 24 +- node_modules/js-tokens/LICENSE | 2 +- node_modules/js-tokens/changelog.md | 82 - node_modules/js-tokens/index.js | 12 +- node_modules/js-tokens/package.json | 8 +- node_modules/js-tokens/readme.md | 217 - node_modules/kind-of/README.md | 17 +- node_modules/kind-of/index.js | 3 + node_modules/kind-of/package.json | 12 +- .../node_modules/lodash.keys/LICENSE.txt | 22 - .../node_modules/lodash.keys/README.md | 15 - .../node_modules/lodash.keys/index.js | 36 - .../node_modules/lodash.keys/package.json | 22 - .../node_modules/lodash.keys/LICENSE.txt | 22 - .../node_modules/lodash.keys/README.md | 15 - .../node_modules/lodash.keys/index.js | 36 - .../node_modules/lodash.keys/package.json | 22 - node_modules/lodash.escape/LICENSE | 22 - node_modules/lodash.escape/README.md | 23 +- node_modules/lodash.escape/index.js | 181 +- node_modules/lodash.escape/package.json | 22 +- node_modules/lodash.isequal/LICENSE | 2 +- node_modules/lodash.isequal/README.md | 6 +- node_modules/lodash.isequal/index.js | 497 +- node_modules/lodash.isequal/package.json | 5 +- node_modules/lodash.keys/LICENSE | 22 - node_modules/lodash.keys/README.md | 25 +- node_modules/lodash.keys/index.js | 240 +- node_modules/lodash.keys/package.json | 22 +- node_modules/lodash.template/LICENSE.txt | 22 - node_modules/lodash.template/README.md | 25 +- node_modules/lodash.template/index.js | 387 +- .../node_modules/lodash.escape/LICENSE.txt | 22 - .../node_modules/lodash.escape/README.md | 23 +- .../node_modules/lodash.escape/index.js | 181 +- .../node_modules/lodash.escape/package.json | 22 +- .../node_modules/lodash.keys/LICENSE.txt | 22 - .../node_modules/lodash.keys/README.md | 25 +- .../node_modules/lodash.keys/index.js | 240 +- .../node_modules/lodash.keys/package.json | 22 +- .../lodash.templatesettings/LICENSE.txt | 22 - .../lodash.templatesettings/README.md | 15 - .../lodash.templatesettings/index.js | 73 - .../lodash.templatesettings/package.json | 21 - node_modules/lodash.template/package.json | 32 +- .../node_modules/lodash.keys/LICENSE.txt | 22 - .../node_modules/lodash.keys/README.md | 15 - .../node_modules/lodash.keys/index.js | 36 - .../node_modules/lodash.keys/package.json | 22 - node_modules/lodash/README.md | 6 +- node_modules/lodash/_assignInDefaults.js | 27 - node_modules/lodash/_baseGetTag.js | 3 +- node_modules/lodash/_baseIsEqual.js | 3 +- node_modules/lodash/_baseIsEqualDeep.js | 15 +- node_modules/lodash/_basePick.js | 1 - node_modules/lodash/_basePickBy.js | 5 +- node_modules/lodash/_basePullAt.js | 17 +- node_modules/lodash/_baseUnset.js | 9 +- node_modules/lodash/_createFlow.js | 6 +- node_modules/lodash/_createRound.js | 2 +- node_modules/lodash/_createWrap.js | 2 +- node_modules/lodash/_equalObjects.js | 6 +- node_modules/lodash/_getSymbols.js | 18 +- node_modules/lodash/_hashHas.js | 2 +- node_modules/lodash/_lazyValue.js | 6 +- node_modules/lodash/_mergeDefaults.js | 27 - node_modules/lodash/core.js | 67 +- node_modules/lodash/core.min.js | 44 +- node_modules/lodash/defaults.js | 6 +- node_modules/lodash/defaultsDeep.js | 4 +- node_modules/lodash/fp/_baseConvert.js | 42 +- node_modules/lodash/fp/_mapping.js | 3 +- node_modules/lodash/fp/_util.js | 1 - node_modules/lodash/isEqual.js | 2 +- node_modules/lodash/lodash.js | 222 +- node_modules/lodash/lodash.min.js | 218 +- node_modules/lodash/omit.js | 11 +- node_modules/lodash/package.json | 2 +- node_modules/lodash/result.js | 2 +- node_modules/lodash/spread.js | 6 +- node_modules/lodash/startsWith.js | 5 +- node_modules/lodash/takeWhile.js | 2 +- node_modules/lodash/template.js | 8 +- node_modules/lodash/templateSettings.js | 4 +- node_modules/lodash/toSafeInteger.js | 4 +- node_modules/lodash/wrapperLodash.js | 6 +- node_modules/loose-envify/package.json | 4 +- node_modules/loose-envify/replace.js | 2 +- node_modules/merge-stream/README.md | 12 +- node_modules/merge-stream/index.js | 1 + node_modules/merge-stream/package.json | 3 +- .../mocha/node_modules/.bin/supports-color | 2 +- node_modules/ms/.npmignore | 5 - node_modules/ms/History.md | 66 - node_modules/ms/LICENSE | 20 - node_modules/ms/README.md | 33 +- node_modules/ms/index.js | 102 +- node_modules/ms/package.json | 34 +- .../normalize-package-data/.npmignore | 2 +- node_modules/normalize-package-data/AUTHORS | 2 +- node_modules/normalize-package-data/LICENSE | 2 +- node_modules/normalize-package-data/README.md | 13 +- .../lib/make_warning.js | 2 +- .../normalize-package-data/lib/normalize.js | 6 +- .../normalize-package-data/lib/safe_format.js | 2 +- .../normalize-package-data/lib/typos.json | 2 +- .../node_modules/.bin/semver | 2 +- .../node_modules/semver/LICENSE | 15 - .../node_modules/semver/README.md | 350 - .../node_modules/semver/bin/semver | 133 - .../node_modules/semver/package.json | 22 - .../node_modules/semver/range.bnf | 16 - .../node_modules/semver/semver.js | 1203 - .../normalize-package-data/package.json | 2 +- .../test/consistency.js | 4 +- .../test/dependencies.js | 4 +- .../test/fixtures/async.json | 2 +- .../test/fixtures/bcrypt.json | 2 +- .../test/fixtures/coffee-script.json | 2 +- .../test/fixtures/http-server.json | 8 +- .../test/fixtures/movefile.json | 2 +- .../test/fixtures/no-description.json | 2 +- .../test/fixtures/node-module_exist.json | 2 +- .../test/fixtures/npm.json | 2 +- .../test/fixtures/request.json | 2 +- .../test/fixtures/underscore.json | 2 +- .../normalize-package-data/test/normalize.js | 6 - .../normalize-package-data/test/normalize.js~ | 253 - .../normalize-package-data/test/typo.js | 2 +- node_modules/normalize-path/LICENSE | 2 +- node_modules/normalize-path/README.md | 73 +- node_modules/normalize-path/index.js | 8 +- node_modules/normalize-path/package.json | 29 +- node_modules/object-assign/index.js | 15 +- node_modules/object-assign/package.json | 12 +- node_modules/object-assign/readme.md | 11 +- node_modules/osenv/.npmignore | 13 - node_modules/osenv/.travis.yml | 9 - node_modules/osenv/LICENSE | 15 - node_modules/osenv/README.md | 63 - node_modules/osenv/osenv.js | 72 - node_modules/osenv/package.json | 31 - node_modules/osenv/test/unix.js | 71 - node_modules/osenv/test/windows.js | 74 - node_modules/osenv/x.tap | 39 - node_modules/randomatic/LICENSE | 2 +- node_modules/randomatic/README.md | 66 +- node_modules/randomatic/package.json | 33 +- node_modules/readable-stream/.npmignore | 6 +- node_modules/readable-stream/.travis.yml | 15 +- node_modules/readable-stream/LICENSE | 29 + node_modules/readable-stream/README.md | 29 +- node_modules/readable-stream/duplex.js | 2 +- .../readable-stream/lib/_stream_readable.js | 315 +- .../readable-stream/lib/_stream_transform.js | 16 +- .../readable-stream/lib/_stream_writable.js | 112 +- node_modules/readable-stream/package.json | 33 +- node_modules/readable-stream/passthrough.js | 2 +- node_modules/readable-stream/readable.js | 31 +- node_modules/readable-stream/transform.js | 2 +- node_modules/readable-stream/writable.js | 9 +- node_modules/regenerator-runtime/package.json | 2 +- node_modules/regenerator-runtime/runtime.js | 266 +- node_modules/replace-ext/LICENSE | 35 +- node_modules/replace-ext/README.md | 62 +- node_modules/replace-ext/index.js | 19 +- node_modules/replace-ext/package.json | 67 +- node_modules/rimraf/bin.js | 16 +- node_modules/rimraf/package.json | 4 +- node_modules/rimraf/rimraf.js | 24 +- node_modules/sax/LICENSE-W3C.html | 188 - node_modules/sax/lib/sax.js | 41 +- node_modules/sax/package.json | 9 +- node_modules/selenium-webdriver/CHANGES.md | 39 + node_modules/selenium-webdriver/README.md | 18 +- node_modules/selenium-webdriver/chrome.js | 6 +- node_modules/selenium-webdriver/edge.js | 2 +- .../selenium-webdriver/firefox/binary.js | 175 +- .../selenium-webdriver/firefox/extension.js | 2 +- .../selenium-webdriver/firefox/index.js | 88 +- node_modules/selenium-webdriver/index.js | 4 +- node_modules/selenium-webdriver/lib/README | 5 +- .../selenium-webdriver/lib/actions.js | 8 +- node_modules/selenium-webdriver/lib/by.js | 2 +- .../selenium-webdriver/lib/capabilities.js | 8 +- node_modules/selenium-webdriver/lib/error.js | 19 +- node_modules/selenium-webdriver/lib/events.js | 2 +- .../lib/firefox/amd64/libnoblur64.so | Bin 41623 -> 0 bytes .../lib/firefox/i386/libnoblur.so | Bin 36934 -> 0 bytes .../lib/firefox/webdriver.json | 3 +- .../lib/firefox/webdriver.xpi | Bin 707042 -> 703396 bytes node_modules/selenium-webdriver/lib/http.js | 104 +- node_modules/selenium-webdriver/lib/input.js | 2 +- .../selenium-webdriver/lib/promise.js | 286 +- .../selenium-webdriver/lib/symbols.js | 2 +- .../selenium-webdriver/lib/test/index.js | 6 + node_modules/selenium-webdriver/lib/until.js | 2 +- .../selenium-webdriver/lib/webdriver.js | 24 +- node_modules/selenium-webdriver/opera.js | 2 +- node_modules/selenium-webdriver/package.json | 2 +- .../selenium-webdriver/remote/index.js | 7 +- node_modules/selenium-webdriver/safari.js | 51 +- .../test/firefox/firefox_test.js | 40 +- .../selenium-webdriver/test/lib/http_test.js | 31 + .../test/lib/promise_test.js | 19 + .../selenium-webdriver/test/lib/until_test.js | 41 +- .../selenium-webdriver/testing/index.js | 21 +- node_modules/semver/.npmignore | 4 - node_modules/semver/.travis.yml | 5 - node_modules/semver/Makefile | 24 - node_modules/semver/README.md | 63 +- node_modules/semver/foot.js.txt | 6 - node_modules/semver/head.js.txt | 2 - node_modules/semver/package.json | 19 +- node_modules/semver/semver.browser.js | 1201 - node_modules/semver/semver.browser.js.gz | Bin 7992 -> 0 bytes node_modules/semver/semver.js | 46 +- node_modules/semver/semver.min.js | 1 - node_modules/semver/semver.min.js.gz | Bin 3790 -> 0 bytes node_modules/semver/test/amd.js | 15 - node_modules/semver/test/big-numbers.js | 31 - node_modules/semver/test/clean.js | 29 - node_modules/semver/test/gtr.js | 173 - node_modules/semver/test/index.js | 685 - node_modules/semver/test/ltr.js | 181 - node_modules/semver/test/major-minor-patch.js | 72 - node_modules/semver/test/no-module.js | 19 - node_modules/signal-exit/index.js | 9 + node_modules/signal-exit/package.json | 4 +- node_modules/supports-color/index.js | 81 +- node_modules/supports-color/package.json | 41 +- node_modules/supports-color/readme.md | 42 +- node_modules/systemjs/README.md | 3 + .../systemjs/dist/system-csp-production.js | 6 +- .../dist/system-csp-production.js.map | 2 +- .../dist/system-csp-production.src.js | 162 +- .../systemjs/dist/system-polyfills.js | 2 +- .../systemjs/dist/system-polyfills.js.map | 2 +- .../systemjs/dist/system-register-only.js | 4 +- .../systemjs/dist/system-register-only.js.map | 2 +- .../systemjs/dist/system-register-only.src.js | 99 +- node_modules/systemjs/dist/system.js | 6 +- node_modules/systemjs/dist/system.js.map | 2 +- node_modules/systemjs/dist/system.src.js | 188 +- node_modules/systemjs/index.js | 11 +- node_modules/systemjs/package.json | 2 +- node_modules/through2/LICENSE | 39 - node_modules/through2/README.md | 3 + node_modules/through2/package.json | 10 +- node_modules/typescript/.mailmap | 82 +- node_modules/typescript/.npmignore | 3 + node_modules/typescript/AUTHORS.md | 68 + node_modules/typescript/Gulpfile.ts | 1046 - node_modules/typescript/README.md | 8 +- node_modules/typescript/lib/README.md | 10 +- .../typescript/lib/cancellationToken.js | 52 +- node_modules/typescript/lib/lib.d.ts | 37877 +++++------ node_modules/typescript/lib/lib.dom.d.ts | 28786 +++++---- .../typescript/lib/lib.dom.iterable.d.ts | 117 +- .../typescript/lib/lib.es2015.collection.d.ts | 176 +- .../typescript/lib/lib.es2015.core.d.ts | 1090 +- node_modules/typescript/lib/lib.es2015.d.ts | 50 +- .../typescript/lib/lib.es2015.generator.d.ts | 96 +- .../typescript/lib/lib.es2015.iterable.d.ts | 960 +- .../typescript/lib/lib.es2015.promise.d.ts | 487 +- .../typescript/lib/lib.es2015.proxy.d.ts | 76 +- .../typescript/lib/lib.es2015.reflect.d.ts | 62 +- .../typescript/lib/lib.es2015.symbol.d.ts | 102 +- .../lib/lib.es2015.symbol.wellknown.d.ts | 686 +- .../lib/lib.es2016.array.include.d.ts | 217 +- node_modules/typescript/lib/lib.es2016.d.ts | 34 +- node_modules/typescript/lib/lib.es2017.d.ts | 40 +- .../typescript/lib/lib.es2017.object.d.ts | 71 +- .../lib/lib.es2017.sharedmemory.d.ts | 84 +- node_modules/typescript/lib/lib.es5.d.ts | 8529 +-- node_modules/typescript/lib/lib.es6.d.ts | 41410 ++++++------ .../typescript/lib/lib.scripthost.d.ts | 614 +- .../typescript/lib/lib.webworker.d.ts | 3127 +- node_modules/typescript/lib/protocol.d.ts | 1031 +- node_modules/typescript/lib/tsc.js | 25628 +++++--- node_modules/typescript/lib/tsserver.js | 53592 +++++++++------- .../typescript/lib/tsserverlibrary.d.ts | 10993 +--- .../typescript/lib/tsserverlibrary.js | 40033 +++++++----- node_modules/typescript/lib/typescript.d.ts | 1641 +- node_modules/typescript/lib/typescript.js | 38508 ++++++----- .../typescript/lib/typescriptServices.d.ts | 1641 +- .../typescript/lib/typescriptServices.js | 38508 ++++++----- .../typescript/lib/typingsInstaller.js | 2649 +- node_modules/typescript/package.json | 6 +- node_modules/v8flags/README.md | 2 + node_modules/v8flags/index.js | 8 +- node_modules/v8flags/package.json | 2 +- .../node_modules/clone-stats/LICENSE.md | 21 - .../node_modules/clone-stats/README.md | 17 - .../node_modules/clone-stats/index.js | 13 - .../node_modules/clone-stats/package.json | 31 - .../vinyl-fs/node_modules/clone-stats/test.js | 36 - .../node_modules/replace-ext/.npmignore | 6 - .../node_modules/replace-ext/.travis.yml | 8 - .../vinyl-fs/node_modules/replace-ext/LICENSE | 20 - .../node_modules/replace-ext/README.md | 44 - .../node_modules/replace-ext/index.js | 9 - .../node_modules/replace-ext/package.json | 35 - .../node_modules/replace-ext/test/main.js | 51 - node_modules/vinyl/index.js | 2 + node_modules/vinyl/package.json | 4 +- node_modules/when/dist/browser/when.debug.js | 70 +- .../when/dist/browser/when.debug.js.map | 10 +- node_modules/when/dist/browser/when.js | 70 +- node_modules/when/dist/browser/when.js.map | 10 +- node_modules/when/dist/browser/when.min.js | 4 +- .../when/dist/browser/when.min.js.map | 2 +- node_modules/when/es6-shim/Promise.js | 52 +- node_modules/when/es6-shim/Promise.js.map | 8 +- node_modules/when/es6-shim/Promise.min.js | 4 +- node_modules/when/es6-shim/Promise.min.js.map | 2 +- node_modules/when/lib/decorators/array.js | 18 +- node_modules/when/lib/env.js | 4 +- node_modules/when/lib/makePromise.js | 48 +- node_modules/when/package.json | 18 +- node_modules/which/CHANGELOG.md | 12 + node_modules/which/package.json | 6 +- node_modules/zip-stream/README.md | 8 +- node_modules/zip-stream/index.js | 2 +- node_modules/zip-stream/package.json | 9 +- package.json | 13 +- src/background/background.html | 4 +- src/background/background.ts | 19 +- src/components.ts | 2 + src/content_scripts/notify.ts | 22 +- src/cryptoApi-test.ts | 4 +- src/cryptoApi.ts | 18 +- src/cryptoLib.ts | 359 - src/cryptoWorker.ts | 361 +- src/emscripten/taler-emscripten-lib.d.ts | 28 +- src/emscripten/taler-emscripten-lib.js | 24 +- src/emscriptif-test.ts | 2 +- src/emscriptif.ts | 30 +- src/helpers-test.ts | 2 +- src/helpers.ts | 6 +- src/http.ts | 28 +- src/i18n.tsx | 10 +- src/logging.ts | 2 +- src/moduleTrampoline.ts | 80 - src/pages/add-auditor.html | 54 +- src/pages/add-auditor.tsx | 28 +- src/pages/auditors.html | 51 +- src/pages/auditors.tsx | 22 +- src/pages/confirm-contract.html | 9 +- src/pages/confirm-contract.tsx | 42 +- src/pages/confirm-create-reserve.html | 16 +- src/pages/confirm-create-reserve.tsx | 27 +- src/pages/debug.html | 13 - src/pages/error.html | 23 +- src/pages/error.tsx | 8 +- src/pages/logs.html | 39 +- src/pages/logs.tsx | 4 +- src/{popup => pages}/popup.css | 0 src/{popup => pages}/popup.html | 8 +- src/{popup => pages}/popup.tsx | 59 +- src/pages/show-db.html | 6 +- src/pages/tree.html | 39 +- src/pages/tree.tsx | 23 +- src/query.ts | 16 +- src/renderHtml.tsx | 3 +- src/types-test.ts | 2 +- src/vendor/URI.js | 2162 - src/vendor/jed.d.ts | 13 - src/vendor/jed.js | 1 - src/vendor/react-dom.dev.js | 18525 ------ src/vendor/react-dom.js | 1 - src/vendor/react-dom.min.js | 15 - src/vendor/react.dev.js | 3783 -- src/vendor/react.js | 1 - src/vendor/react.min.js | 12 - src/vendor/system-csp-production.src.js | 4536 -- src/wallet-test.ts | 2 +- src/wallet.ts | 31 +- src/wxApi.ts | 2 +- src/wxBackend.ts | 19 +- thirdparty/README | 24 - thirdparty/URI.js/.editorconfig | 9 - thirdparty/URI.js/.gitignore | 2 - thirdparty/URI.js/.jshintrc | 31 - thirdparty/URI.js/CHANGELOG.md | 332 - thirdparty/URI.js/Gruntfile.js | 22 - thirdparty/URI.js/LICENSE.txt | 21 - thirdparty/URI.js/README.md | 244 - thirdparty/URI.js/about-uris.html | 189 - thirdparty/URI.js/bower.json | 16 - thirdparty/URI.js/build.html | 71 - thirdparty/URI.js/build.js | 78 - thirdparty/URI.js/contributing.md | 19 - thirdparty/URI.js/docs.html | 1399 - thirdparty/URI.js/index.html | 173 - thirdparty/URI.js/jquery-1.10.2.min.js | 6 - thirdparty/URI.js/jquery-1.7.2.min.js | 4 - thirdparty/URI.js/jquery-1.8.2.min.js | 2 - thirdparty/URI.js/jquery-1.9.1.min.js | 5 - thirdparty/URI.js/jquery-uri-plugin.html | 203 - thirdparty/URI.js/package.json | 78 - thirdparty/URI.js/prettify/lang-apollo.js | 2 - thirdparty/URI.js/prettify/lang-clj.js | 18 - thirdparty/URI.js/prettify/lang-css.js | 2 - thirdparty/URI.js/prettify/lang-go.js | 1 - thirdparty/URI.js/prettify/lang-hs.js | 2 - thirdparty/URI.js/prettify/lang-lisp.js | 3 - thirdparty/URI.js/prettify/lang-lua.js | 2 - thirdparty/URI.js/prettify/lang-ml.js | 2 - thirdparty/URI.js/prettify/lang-n.js | 4 - thirdparty/URI.js/prettify/lang-proto.js | 1 - thirdparty/URI.js/prettify/lang-scala.js | 2 - thirdparty/URI.js/prettify/lang-sql.js | 2 - thirdparty/URI.js/prettify/lang-tex.js | 1 - thirdparty/URI.js/prettify/lang-vb.js | 2 - thirdparty/URI.js/prettify/lang-vhdl.js | 3 - thirdparty/URI.js/prettify/lang-wiki.js | 2 - thirdparty/URI.js/prettify/lang-xq.js | 3 - thirdparty/URI.js/prettify/lang-yaml.js | 2 - thirdparty/URI.js/prettify/prettify.css | 1 - thirdparty/URI.js/prettify/prettify.js | 28 - .../URI.js/prettify/prettify.sunburst.css | 52 - thirdparty/URI.js/screen.css | 181 - thirdparty/URI.js/screen.js | 39 - thirdparty/URI.js/src/IPv6.js | 185 - thirdparty/URI.js/src/SecondLevelDomains.js | 240 - thirdparty/URI.js/src/URI.fragmentQuery.js | 104 - thirdparty/URI.js/src/URI.fragmentURI.js | 97 - thirdparty/URI.js/src/URI.js | 2218 - thirdparty/URI.js/src/URI.min.js | 89 - thirdparty/URI.js/src/URITemplate.js | 513 - thirdparty/URI.js/src/jquery.URI.js | 234 - thirdparty/URI.js/src/jquery.URI.min.js | 7 - thirdparty/URI.js/src/punycode.js | 533 - thirdparty/URI.js/test/index.html | 26 - thirdparty/URI.js/test/pre_libs.js | 7 - .../URI.js/test/qunit/qunit-composite.css | 13 - .../URI.js/test/qunit/qunit-composite.js | 167 - thirdparty/URI.js/test/qunit/qunit.css | 244 - thirdparty/URI.js/test/qunit/qunit.js | 2212 - thirdparty/URI.js/test/test.URI.html | 26 - .../URI.js/test/test.fragmentQuery.html | 31 - thirdparty/URI.js/test/test.fragmentURI.html | 31 - thirdparty/URI.js/test/test.jQuery-1.10.html | 31 - thirdparty/URI.js/test/test.jQuery-1.7.html | 31 - thirdparty/URI.js/test/test.jQuery-1.8.html | 31 - thirdparty/URI.js/test/test.jQuery-1.9.html | 31 - thirdparty/URI.js/test/test.js | 1837 - thirdparty/URI.js/test/test_fragmentQuery.js | 59 - thirdparty/URI.js/test/test_fragmentURI.js | 61 - thirdparty/URI.js/test/test_jim.js | 146 - thirdparty/URI.js/test/test_jquery.js | 141 - thirdparty/URI.js/test/test_template.js | 411 - thirdparty/URI.js/test/urls.js | 1892 - thirdparty/URI.js/uri-template.html | 234 - thirdparty/URI.js/utils/SLDs.php | 37 - thirdparty/URI.js/utils/sld.js | 101 - thirdparty/jed/.gitignore | 1 - thirdparty/jed/.travis.yml | 4 - thirdparty/jed/LICENSE | 19 - thirdparty/jed/Makefile | 13 - thirdparty/jed/README.md | 63 - thirdparty/jed/jed.js | 1033 - thirdparty/jed/package.json | 27 - thirdparty/jed/plurals.jison | 72 - thirdparty/jed/test/common.js | 2 - thirdparty/jed/test/index.html | 24 - thirdparty/jed/test/jquery.min.js | 4 - thirdparty/jed/test/tests.js | 746 - thirdparty/systemjs/.agignore | 1 - thirdparty/systemjs/.gitignore | 3 - thirdparty/systemjs/.travis.yml | 14 - thirdparty/systemjs/LICENSE | 10 - thirdparty/systemjs/Makefile | 186 - thirdparty/systemjs/README.md | 149 - thirdparty/systemjs/bench/cjs-sample/cjs.js | 949 - .../systemjs/bench/config-example/config.js | 1474 - .../bench/config-example/normalize-data.js | 69 - .../bench/config-example/pkg-configs.js | 972 - thirdparty/systemjs/bench/get-cjs-deps.js | 63 - thirdparty/systemjs/bench/normalize-perf.js | 67 - thirdparty/systemjs/bower.json | 17 - .../systemjs/dist/system-csp-production.js | 6 - .../dist/system-csp-production.js.map | 1 - .../dist/system-csp-production.src.js | 4536 -- thirdparty/systemjs/dist/system-polyfills.js | 5 - .../systemjs/dist/system-polyfills.js.map | 1 - .../systemjs/dist/system-polyfills.src.js | 1277 - .../systemjs/dist/system-register-only.js | 5 - .../systemjs/dist/system-register-only.js.map | 1 - .../systemjs/dist/system-register-only.src.js | 2198 - thirdparty/systemjs/dist/system.js | 6 - thirdparty/systemjs/dist/system.js.map | 1 - thirdparty/systemjs/dist/system.src.js | 5153 -- thirdparty/systemjs/docs/config-api.md | 292 - thirdparty/systemjs/docs/creating-plugins.md | 84 - .../systemjs/docs/es6-modules-overview.md | 108 - thirdparty/systemjs/docs/module-formats.md | 228 - thirdparty/systemjs/docs/overview.md | 166 - .../systemjs/docs/production-workflows.md | 83 - thirdparty/systemjs/docs/system-api.md | 141 - thirdparty/systemjs/index.js | 48 - thirdparty/systemjs/lib/alias.js | 38 - thirdparty/systemjs/lib/amd-helpers.js | 245 - thirdparty/systemjs/lib/amd.js | 42 - thirdparty/systemjs/lib/bundles.js | 73 - thirdparty/systemjs/lib/cjs-helpers.js | 43 - thirdparty/systemjs/lib/cjs.js | 138 - thirdparty/systemjs/lib/conditionals.js | 161 - thirdparty/systemjs/lib/core.js | 504 - thirdparty/systemjs/lib/createSystem.js | 3 - thirdparty/systemjs/lib/depCache.js | 44 - thirdparty/systemjs/lib/esm.js | 161 - thirdparty/systemjs/lib/global-eval.js | 142 - thirdparty/systemjs/lib/global-helpers.js | 147 - thirdparty/systemjs/lib/global.js | 70 - thirdparty/systemjs/lib/legacy-transpiler.js | 86 - thirdparty/systemjs/lib/loader-wrapper-end.js | 6 - .../systemjs/lib/loader-wrapper-start.js | 913 - thirdparty/systemjs/lib/meta.js | 155 - thirdparty/systemjs/lib/package.js | 596 - thirdparty/systemjs/lib/paths.js | 42 - thirdparty/systemjs/lib/perf.js | 227 - thirdparty/systemjs/lib/plugins.js | 263 - .../systemjs/lib/polyfills-bootstrap.js | 2 - thirdparty/systemjs/lib/proto.js | 268 - thirdparty/systemjs/lib/register.js | 633 - thirdparty/systemjs/lib/scriptLoader.js | 196 - thirdparty/systemjs/lib/scriptOnly.js | 17 - thirdparty/systemjs/lib/system-fetch.js | 125 - .../systemjs/lib/system-only-resolve.js | 24 - thirdparty/systemjs/lib/url-polyfill.js | 64 - thirdparty/systemjs/lib/wrapper-end.js | 47 - thirdparty/systemjs/lib/wrapper-start.js | 2 - thirdparty/systemjs/package.json | 34 - .../systemjs/test/test-babel-runtime.html | 44 - thirdparty/systemjs/test/test-babel.html | 29 - thirdparty/systemjs/test/test-babel.js | 3 - thirdparty/systemjs/test/test-csp-inline.html | 61 - thirdparty/systemjs/test/test-csp.html | 280 - .../systemjs/test/test-jsextensions.html | 112 - .../systemjs/test/test-register-only.html | 45 - thirdparty/systemjs/test/test-tracer.html | 71 - thirdparty/systemjs/test/test-traceur.html | 34 - thirdparty/systemjs/test/test-traceur.js | 3 - thirdparty/systemjs/test/test-typescript.html | 31 - thirdparty/systemjs/test/test-typescript.js | 4 - thirdparty/systemjs/test/test.js | 1462 - thirdparty/systemjs/test/tests/#.js | 1 - .../systemjs/test/tests/advanced-plugin.js | 20 - .../systemjs/test/tests/all-circular1.js | 9 - .../systemjs/test/tests/all-circular2.js | 3 - .../systemjs/test/tests/all-circular3.js | 10 - .../systemjs/test/tests/all-circular4.js | 5 - thirdparty/systemjs/test/tests/all-layers1.js | 3 - thirdparty/systemjs/test/tests/all-layers2.js | 20 - thirdparty/systemjs/test/tests/all-layers3.js | 17 - thirdparty/systemjs/test/tests/all-layers4.js | 1 - thirdparty/systemjs/test/tests/amd-bundle.js | 6 - .../systemjs/test/tests/amd-circular1.js | 7 - .../systemjs/test/tests/amd-circular2.js | 6 - .../systemjs/test/tests/amd-cjs-module.js | 4 - .../systemjs/test/tests/amd-contextual.js | 6 - thirdparty/systemjs/test/tests/amd-dep-A.js | 1 - thirdparty/systemjs/test/tests/amd-dep-B.js | 1 - thirdparty/systemjs/test/tests/amd-dep.js | 3 - .../test/tests/amd-dynamic-require.js | 19 - thirdparty/systemjs/test/tests/amd-dynamic.js | 3 - .../systemjs/test/tests/amd-extra-deps.js | 7 - thirdparty/systemjs/test/tests/amd-format.js | 18 - .../systemjs/test/tests/amd-module-2.js | 6 - .../systemjs/test/tests/amd-module-3.js | 13 - .../systemjs/test/tests/amd-module-bom.js | 4 - thirdparty/systemjs/test/tests/amd-module.js | 6 - thirdparty/systemjs/test/tests/amd-require.js | 3 - .../amd-simplified-cjs-aliased-require1.js | 7 - .../amd-simplified-cjs-aliased-require2.js | 8 - thirdparty/systemjs/test/tests/anon-named.js | 10 - thirdparty/systemjs/test/tests/async.js | 5 - .../test/tests/bootstrap@3.1.1/test.coffee | 1 - .../systemjs/test/tests/branch-boolean.js | 1 - thirdparty/systemjs/test/tests/branch-ie.js | 1 - thirdparty/systemjs/test/tests/bundle.js | 7 - .../systemjs/test/tests/cjs-circular1.js | 4 - .../systemjs/test/tests/cjs-circular2.js | 4 - .../systemjs/test/tests/cjs-exports-bom.js | 1 - .../systemjs/test/tests/cjs-exports-dep.js | 1 - thirdparty/systemjs/test/tests/cjs-exports.js | 6 - thirdparty/systemjs/test/tests/cjs-format.js | 4 - thirdparty/systemjs/test/tests/cjs-globals.js | 3 - .../systemjs/test/tests/cjs-loading-plugin.js | 1 - .../systemjs/test/tests/cjs-module-bom.js | 1 - .../systemjs/test/tests/cjs-named-export.js | 5 - thirdparty/systemjs/test/tests/cjs-process.js | 3 - thirdparty/systemjs/test/tests/cjs-resolve.js | 1 - thirdparty/systemjs/test/tests/cjs-this.js | 2 - .../systemjs/test/tests/common-js-dep.js | 1 - .../systemjs/test/tests/common-js-module.js | 2 - thirdparty/systemjs/test/tests/commonjs-d.js | 1 - thirdparty/systemjs/test/tests/commonjs-d2.js | 1 - .../systemjs/test/tests/commonjs-globals.js | 1 - .../systemjs/test/tests/commonjs-requires.js | 40 - .../systemjs/test/tests/commonjs-variation.js | 5 - .../test/tests/commonjs-variation2.js | 8 - .../systemjs/test/tests/compiled.coffee | 1 - .../systemjs/test/tests/compiler-plugin.js | 4 - .../systemjs/test/tests/compiler-test.coffee | 1 - .../systemjs/test/tests/connected-tree/a.js | 9 - .../systemjs/test/tests/connected-tree/b.js | 6 - .../systemjs/test/tests/connected-tree/c.js | 3 - .../systemjs/test/tests/contextual-map-dep.js | 1 - .../tests/contextual-test/contextual-map.js | 1 - thirdparty/systemjs/test/tests/cs-loader.js | 3 - thirdparty/systemjs/test/tests/cs/dep.js | 1 - thirdparty/systemjs/test/tests/cs/main.js | 1 - .../systemjs/test/tests/csp/integrity.js | 5 - thirdparty/systemjs/test/tests/csp/nonce.js | 3 - thirdparty/systemjs/test/tests/csp/nonce2.js | 3 - thirdparty/systemjs/test/tests/css.css | 3 - thirdparty/systemjs/test/tests/css.js | 3 - .../systemjs/test/tests/deep/deep-dep.js | 1 - thirdparty/systemjs/test/tests/deep/deep.js | 1 - .../systemjs/test/tests/default1-dep.js | 1 - thirdparty/systemjs/test/tests/default1.js | 3 - thirdparty/systemjs/test/tests/default2.js | 1 - thirdparty/systemjs/test/tests/default3.js | 1 - thirdparty/systemjs/test/tests/dep.js | 1 - .../systemjs/test/tests/duplicateDeps/m1.js | 23 - .../systemjs/test/tests/duplicateDeps/m2.js | 13 - thirdparty/systemjs/test/tests/eaa-amd.js | 3 - thirdparty/systemjs/test/tests/eaa-es6.js | 1 - thirdparty/systemjs/test/tests/empty-es6.js | 3 - .../systemjs/test/tests/ep/some-repo/main.js | 1 - .../systemjs/test/tests/error-loader.js | 1 - .../systemjs/test/tests/error-loader2.js | 1 - thirdparty/systemjs/test/tests/error.js | 1 - .../systemjs/test/tests/es-module-flag.js | 3 - .../test/tests/es-named-import-cjs-cjs.js | 3 - .../test/tests/es-named-import-cjs.js | 2 - thirdparty/systemjs/test/tests/es6-and-amd.js | 2 - .../systemjs/test/tests/es6-circular1.js | 10 - .../systemjs/test/tests/es6-circular2.js | 3 - .../test/tests/es6-cjs-named-export.js | 1 - .../systemjs/test/tests/es6-detection1.js | 1 - thirdparty/systemjs/test/tests/es6-format.js | 6 - .../test/tests/es6-import-star-amd.js | 3 - .../test/tests/es6-loading-amd-dep.js | 3 - .../systemjs/test/tests/es6-loading-amd.js | 9 - thirdparty/systemjs/test/tests/es6-plugin.js | 3 - thirdparty/systemjs/test/tests/esm-dep.js | 5 - .../systemjs/test/tests/esm-with-deps.js | 1 - thirdparty/systemjs/test/tests/export-star.js | 2 - thirdparty/systemjs/test/tests/foo.js | 10 - thirdparty/systemjs/test/tests/global-dep.js | 5 - .../test/tests/global-encapsulation.js | 3 - .../test/tests/global-exports-array.js | 5 - .../test/tests/global-inaccessible-props.js | 8 - .../systemjs/test/tests/global-inline-dep.js | 7 - .../test/tests/global-inline-export.js | 9 - .../systemjs/test/tests/global-multi-diff.js | 3 - .../systemjs/test/tests/global-multi.js | 6 - .../systemjs/test/tests/global-shim-amd.js | 6 - .../test/tests/global-shim-config-dep.js | 1 - .../test/tests/global-shim-config-exports.js | 1 - .../systemjs/test/tests/global-shim-config.js | 3 - .../test/tests/global-single-compiled.js | 9 - .../systemjs/test/tests/global-single.js | 1 - .../systemjs/test/tests/global-with-export.js | 5 - thirdparty/systemjs/test/tests/global.js | 6 - thirdparty/systemjs/test/tests/group-test.js | 34 - thirdparty/systemjs/test/tests/hbs.hbs | 1 - .../systemjs/test/tests/inline-depends-dep.js | 1 - .../systemjs/test/tests/inline-depends.js | 1 - .../systemjs/test/tests/jquery-named.js | 3 - thirdparty/systemjs/test/tests/jquery.js | 2 - .../systemjs/test/tests/legacy-plugin.js | 5 - .../systemjs/test/tests/loader-scoping.js | 1 - thirdparty/systemjs/test/tests/main-bundle.js | 3 - thirdparty/systemjs/test/tests/main-dep.js | 1 - thirdparty/systemjs/test/tests/main.js | 1 - .../systemjs/test/tests/map-test-dep.js | 1 - thirdparty/systemjs/test/tests/map-test.js | 1 - .../systemjs/test/tests/map-test/sub.js | 1 - thirdparty/systemjs/test/tests/map-version.js | 1 - thirdparty/systemjs/test/tests/meta-deps.js | 21 - .../systemjs/test/tests/meta-override.js | 2 - .../systemjs/test/tests/mixed-bundle.js | 68 - thirdparty/systemjs/test/tests/modA.js | 7 - thirdparty/systemjs/test/tests/modC.js | 5 - thirdparty/systemjs/test/tests/module-name.js | 8 - thirdparty/systemjs/test/tests/module.js | 3 - .../systemjs/test/tests/multiple-anonymous.js | 14 - .../systemjs/test/tests/mypackage/index.js | 1 - .../systemjs/test/tests/mypackage/lib/bar.js | 2 - .../systemjs/test/tests/mypackage/src/foo.js | 3 - thirdparty/systemjs/test/tests/nameddefine.js | 14 - .../test/tests/no-default-ext/file.ext | 1 - .../test/tests/normalize-hook-test.js | 1 - thirdparty/systemjs/test/tests/out.js | 19 - .../tests/package-local-alias/index-cjs.js | 6 - .../package-local-alias/index-default-cjs.js | 10 - .../package-local-alias/index-default-esm.js | 10 - .../tests/package-local-alias/index-esm.js | 5 - .../package-local-alias/local/index-cjs.js | 1 - .../local/index-default-cjs.js | 1 - .../local/index-default-esm.js | 2 - .../package-local-alias/local/index-esm.js | 1 - thirdparty/systemjs/test/tests/path/deep.js | 1 - thirdparty/systemjs/test/tests/plugin-dep.js | 8 - .../test/tests/plugin@1.2.3/plugin.js | 3 - thirdparty/systemjs/test/tests/reflection.js | 1 - .../systemjs/test/tests/register-circular1.js | 24 - .../systemjs/test/tests/register-circular2.js | 14 - .../test/tests/register-default-extension.js | 8 - .../systemjs/test/tests/register-regex-2.js | 15 - .../systemjs/test/tests/register-regex.js | 18 - .../test/tests/registerdynamic-main.js | 11 - .../test/tests/registerdynamic-notbundled.js | 5 - thirdparty/systemjs/test/tests/reldynamic.js | 5 - .../systemjs/test/tests/reldynamicdep.js | 1 - .../test/tests/shared-dep-bundles/a.js | 33 - .../test/tests/shared-dep-bundles/b.js | 33 - .../systemjs/test/tests/shim-map-test-dep.js | 1 - .../test/tests/shim-package/shim-map-test.js | 1 - thirdparty/systemjs/test/tests/some-json.json | 3 - thirdparty/systemjs/test/tests/some-text.txt | 1 - thirdparty/systemjs/test/tests/star-dep.js | 1 - .../test/tests/subcontextual-map/submodule.js | 3 - .../test/tests/subcontextual-mapdep.js | 1 - thirdparty/systemjs/test/tests/test.css | 1 - .../test/tests/testpkg/depcache-test.js | 1 - .../systemjs/test/tests/testpkg/dir/index.js | 2 - .../test/tests/testpkg/dir/self-load.js | 2 - .../test/tests/testpkg/dir2/index.json | 3 - .../test/tests/testpkg/env-module-browser.js | 1 - .../systemjs/test/tests/testpkg/env-module.js | 1 - .../systemjs/test/tests/testpkg/index.js | 1 - .../test/tests/testpkg/interpolate.js | 1 - .../systemjs/test/tests/testpkg/json.js | 4 - .../systemjs/test/tests/testpkg/json.json | 3 - .../systemjs/test/tests/testpkg/polate.js | 1 - .../systemjs/test/tests/testpkg/self-load.js | 2 - .../systemjs/test/tests/testpkg/self.js | 1 - .../systemjs/test/tests/testpkg/system.json | 28 - .../systemjs/test/tests/testpkg/test.ts | 1 - thirdparty/systemjs/test/tests/testpkg2.json | 6 - .../systemjs/test/tests/testpkg2/asdf.asdf.js | 3 - thirdparty/systemjs/test/tests/typescript.ts | 1 - thirdparty/systemjs/test/tests/umd-dep.js | 3 - thirdparty/systemjs/test/tests/umd.js | 10 - .../systemjs/test/tests/versioned@2.0.3.js | 1 - .../systemjs/test/tests/wildcard-test/2.js | 1 - .../test/tests/wildcard-test/2/sub.js | 1 - .../test/tests/wildcard-test/first.js | 1 - .../systemjs/test/tests/with-global-deps.js | 1 - .../systemjs/test/tests/with-runtime-babel.js | 16 - .../test/tests/with-runtime-traceur.js | 14 - .../systemjs/test/tests/worker-babel.js | 14 - .../systemjs/test/tests/worker-traceur.js | 12 - .../systemjs/test/tests/worker-typescript.js | 16 - thirdparty/systemjs/test/tests/wrapper.js | 1 - thirdparty/systemjs/test/tests/zero@0.js | 1 - {pogen => tooling/pogen}/.gitignore | 0 {pogen => tooling/pogen}/dumpTree.ts | 0 {pogen => tooling/pogen}/example/messages.po | 0 {pogen => tooling/pogen}/example/test.ts | 0 {pogen => tooling/pogen}/example/test2.tsx | 0 {pogen => tooling/pogen}/pogen.ts | 0 {pogen => tooling/pogen}/tsconfig.json | 0 .../talertest}/node/runtime.js | 44 +- tooling/talertest/package.json | 20 + .../talertest}/selenium/.gitignore | 0 .../talertest}/selenium/escodegen.browser.js | 0 .../talertest}/selenium/esprima.js | 0 .../talertest}/selenium/instrumenter.js | 0 .../talertest}/selenium/runtime.js | 0 .../talertest}/selenium/system.js | 0 .../talertest}/selenium/testhost.html | 0 tooling/talertest/talertest.d.ts | 19 + tooling/talertest/talertest.js | 111 + {testlib => tooling/talertest}/talertest.ts | 6 +- tooling/talertest/tsconfig.json | 19 + tooling/talertest/yarn.lock | 7 + tsconfig.json | 20 +- webpack.config.js | 124 + yarn.lock | 1959 +- 2785 files changed, 210963 insertions(+), 320486 deletions(-) create mode 100644 decl/jed.d.ts delete mode 100644 decl/jquery/jquery.d.ts delete mode 100644 decl/lib.es6.d.ts delete mode 100644 decl/node.d.ts delete mode 100644 decl/react-dom.d.ts delete mode 100644 decl/react-global.d.ts delete mode 100644 decl/react.d.ts delete mode 100644 decl/systemjs/systemjs.d.ts create mode 100644 decl/urijs.d.ts delete mode 100644 decl/urijs/URIjs.d.ts delete mode 100644 node_modules/ansi-regex/license mode change 100755 => 100644 node_modules/arr-flatten/index.js mode change 100755 => 100644 node_modules/arr-flatten/package.json delete mode 100644 node_modules/buffer-crc32/.npmignore delete mode 100644 node_modules/buffer-crc32/.travis.yml delete mode 100644 node_modules/buffer-crc32/tests/crc.test.js delete mode 100644 node_modules/core-js/core/regexp.js delete mode 100644 node_modules/core-js/es6/date.js delete mode 100644 node_modules/core-js/es6/parse-float.js delete mode 100644 node_modules/core-js/es6/parse-int.js delete mode 100644 node_modules/core-js/es6/typed.js delete mode 100644 node_modules/core-js/es7/asap.js delete mode 100644 node_modules/core-js/es7/error.js delete mode 100644 node_modules/core-js/es7/math.js delete mode 100644 node_modules/core-js/es7/observable.js delete mode 100644 node_modules/core-js/es7/reflect.js delete mode 100644 node_modules/core-js/es7/symbol.js delete mode 100644 node_modules/core-js/es7/system.js delete mode 100644 node_modules/core-js/fn/array/is-array.js delete mode 100644 node_modules/core-js/fn/array/virtual/copy-within.js delete mode 100644 node_modules/core-js/fn/array/virtual/entries.js delete mode 100644 node_modules/core-js/fn/array/virtual/every.js delete mode 100644 node_modules/core-js/fn/array/virtual/fill.js delete mode 100644 node_modules/core-js/fn/array/virtual/filter.js delete mode 100644 node_modules/core-js/fn/array/virtual/find-index.js delete mode 100644 node_modules/core-js/fn/array/virtual/find.js delete mode 100644 node_modules/core-js/fn/array/virtual/for-each.js delete mode 100644 node_modules/core-js/fn/array/virtual/includes.js delete mode 100644 node_modules/core-js/fn/array/virtual/index-of.js delete mode 100644 node_modules/core-js/fn/array/virtual/index.js delete mode 100644 node_modules/core-js/fn/array/virtual/iterator.js delete mode 100644 node_modules/core-js/fn/array/virtual/join.js delete mode 100644 node_modules/core-js/fn/array/virtual/keys.js delete mode 100644 node_modules/core-js/fn/array/virtual/last-index-of.js delete mode 100644 node_modules/core-js/fn/array/virtual/map.js delete mode 100644 node_modules/core-js/fn/array/virtual/reduce-right.js delete mode 100644 node_modules/core-js/fn/array/virtual/reduce.js delete mode 100644 node_modules/core-js/fn/array/virtual/slice.js delete mode 100644 node_modules/core-js/fn/array/virtual/some.js delete mode 100644 node_modules/core-js/fn/array/virtual/sort.js delete mode 100644 node_modules/core-js/fn/array/virtual/values.js delete mode 100644 node_modules/core-js/fn/asap.js delete mode 100644 node_modules/core-js/fn/date/index.js delete mode 100644 node_modules/core-js/fn/date/now.js delete mode 100644 node_modules/core-js/fn/date/to-iso-string.js delete mode 100644 node_modules/core-js/fn/date/to-json.js delete mode 100644 node_modules/core-js/fn/date/to-primitive.js delete mode 100644 node_modules/core-js/fn/date/to-string.js delete mode 100644 node_modules/core-js/fn/dom-collections/index.js delete mode 100644 node_modules/core-js/fn/dom-collections/iterator.js delete mode 100644 node_modules/core-js/fn/error/index.js delete mode 100644 node_modules/core-js/fn/error/is-error.js delete mode 100644 node_modules/core-js/fn/function/bind.js delete mode 100644 node_modules/core-js/fn/function/virtual/bind.js delete mode 100644 node_modules/core-js/fn/function/virtual/index.js delete mode 100644 node_modules/core-js/fn/function/virtual/part.js delete mode 100644 node_modules/core-js/fn/json/index.js delete mode 100644 node_modules/core-js/fn/math/iaddh.js delete mode 100644 node_modules/core-js/fn/math/imulh.js delete mode 100644 node_modules/core-js/fn/math/isubh.js delete mode 100644 node_modules/core-js/fn/math/umulh.js delete mode 100644 node_modules/core-js/fn/number/constructor.js delete mode 100644 node_modules/core-js/fn/number/to-fixed.js delete mode 100644 node_modules/core-js/fn/number/to-precision.js delete mode 100644 node_modules/core-js/fn/number/virtual/index.js delete mode 100644 node_modules/core-js/fn/number/virtual/iterator.js delete mode 100644 node_modules/core-js/fn/number/virtual/to-fixed.js delete mode 100644 node_modules/core-js/fn/number/virtual/to-precision.js delete mode 100644 node_modules/core-js/fn/object/define-getter.js delete mode 100644 node_modules/core-js/fn/object/define-setter.js delete mode 100644 node_modules/core-js/fn/object/lookup-getter.js delete mode 100644 node_modules/core-js/fn/object/lookup-setter.js delete mode 100644 node_modules/core-js/fn/observable.js delete mode 100644 node_modules/core-js/fn/parse-float.js delete mode 100644 node_modules/core-js/fn/parse-int.js delete mode 100644 node_modules/core-js/fn/reflect/define-metadata.js delete mode 100644 node_modules/core-js/fn/reflect/delete-metadata.js delete mode 100644 node_modules/core-js/fn/reflect/get-metadata-keys.js delete mode 100644 node_modules/core-js/fn/reflect/get-metadata.js delete mode 100644 node_modules/core-js/fn/reflect/get-own-metadata-keys.js delete mode 100644 node_modules/core-js/fn/reflect/get-own-metadata.js delete mode 100644 node_modules/core-js/fn/reflect/has-metadata.js delete mode 100644 node_modules/core-js/fn/reflect/has-own-metadata.js delete mode 100644 node_modules/core-js/fn/reflect/metadata.js delete mode 100644 node_modules/core-js/fn/regexp/constructor.js delete mode 100644 node_modules/core-js/fn/regexp/flags.js delete mode 100644 node_modules/core-js/fn/regexp/match.js delete mode 100644 node_modules/core-js/fn/regexp/replace.js delete mode 100644 node_modules/core-js/fn/regexp/search.js delete mode 100644 node_modules/core-js/fn/regexp/split.js delete mode 100644 node_modules/core-js/fn/regexp/to-string.js delete mode 100644 node_modules/core-js/fn/string/anchor.js delete mode 100644 node_modules/core-js/fn/string/big.js delete mode 100644 node_modules/core-js/fn/string/blink.js delete mode 100644 node_modules/core-js/fn/string/bold.js delete mode 100644 node_modules/core-js/fn/string/fixed.js delete mode 100644 node_modules/core-js/fn/string/fontcolor.js delete mode 100644 node_modules/core-js/fn/string/fontsize.js delete mode 100644 node_modules/core-js/fn/string/italics.js delete mode 100644 node_modules/core-js/fn/string/link.js delete mode 100644 node_modules/core-js/fn/string/match-all.js delete mode 100644 node_modules/core-js/fn/string/pad-end.js delete mode 100644 node_modules/core-js/fn/string/pad-start.js delete mode 100644 node_modules/core-js/fn/string/small.js delete mode 100644 node_modules/core-js/fn/string/strike.js delete mode 100644 node_modules/core-js/fn/string/sub.js delete mode 100644 node_modules/core-js/fn/string/sup.js delete mode 100644 node_modules/core-js/fn/string/trim-end.js delete mode 100644 node_modules/core-js/fn/string/trim-start.js delete mode 100644 node_modules/core-js/fn/string/virtual/anchor.js delete mode 100644 node_modules/core-js/fn/string/virtual/at.js delete mode 100644 node_modules/core-js/fn/string/virtual/big.js delete mode 100644 node_modules/core-js/fn/string/virtual/blink.js delete mode 100644 node_modules/core-js/fn/string/virtual/bold.js delete mode 100644 node_modules/core-js/fn/string/virtual/code-point-at.js delete mode 100644 node_modules/core-js/fn/string/virtual/ends-with.js delete mode 100644 node_modules/core-js/fn/string/virtual/escape-html.js delete mode 100644 node_modules/core-js/fn/string/virtual/fixed.js delete mode 100644 node_modules/core-js/fn/string/virtual/fontcolor.js delete mode 100644 node_modules/core-js/fn/string/virtual/fontsize.js delete mode 100644 node_modules/core-js/fn/string/virtual/includes.js delete mode 100644 node_modules/core-js/fn/string/virtual/index.js delete mode 100644 node_modules/core-js/fn/string/virtual/italics.js delete mode 100644 node_modules/core-js/fn/string/virtual/iterator.js delete mode 100644 node_modules/core-js/fn/string/virtual/link.js delete mode 100644 node_modules/core-js/fn/string/virtual/match-all.js delete mode 100644 node_modules/core-js/fn/string/virtual/pad-end.js delete mode 100644 node_modules/core-js/fn/string/virtual/pad-start.js delete mode 100644 node_modules/core-js/fn/string/virtual/repeat.js delete mode 100644 node_modules/core-js/fn/string/virtual/small.js delete mode 100644 node_modules/core-js/fn/string/virtual/starts-with.js delete mode 100644 node_modules/core-js/fn/string/virtual/strike.js delete mode 100644 node_modules/core-js/fn/string/virtual/sub.js delete mode 100644 node_modules/core-js/fn/string/virtual/sup.js delete mode 100644 node_modules/core-js/fn/string/virtual/trim-end.js delete mode 100644 node_modules/core-js/fn/string/virtual/trim-left.js delete mode 100644 node_modules/core-js/fn/string/virtual/trim-right.js delete mode 100644 node_modules/core-js/fn/string/virtual/trim-start.js delete mode 100644 node_modules/core-js/fn/string/virtual/trim.js delete mode 100644 node_modules/core-js/fn/string/virtual/unescape-html.js delete mode 100644 node_modules/core-js/fn/symbol/async-iterator.js delete mode 100644 node_modules/core-js/fn/symbol/observable.js delete mode 100644 node_modules/core-js/fn/system/global.js delete mode 100644 node_modules/core-js/fn/system/index.js delete mode 100644 node_modules/core-js/fn/typed/array-buffer.js delete mode 100644 node_modules/core-js/fn/typed/data-view.js delete mode 100644 node_modules/core-js/fn/typed/float32-array.js delete mode 100644 node_modules/core-js/fn/typed/float64-array.js delete mode 100644 node_modules/core-js/fn/typed/index.js delete mode 100644 node_modules/core-js/fn/typed/int16-array.js delete mode 100644 node_modules/core-js/fn/typed/int32-array.js delete mode 100644 node_modules/core-js/fn/typed/int8-array.js delete mode 100644 node_modules/core-js/fn/typed/uint16-array.js delete mode 100644 node_modules/core-js/fn/typed/uint32-array.js delete mode 100644 node_modules/core-js/fn/typed/uint8-array.js delete mode 100644 node_modules/core-js/fn/typed/uint8-clamped-array.js delete mode 100644 node_modules/core-js/library/core/regexp.js delete mode 100644 node_modules/core-js/library/es6/date.js delete mode 100644 node_modules/core-js/library/es6/parse-float.js delete mode 100644 node_modules/core-js/library/es6/parse-int.js delete mode 100644 node_modules/core-js/library/es6/typed.js delete mode 100644 node_modules/core-js/library/es7/asap.js delete mode 100644 node_modules/core-js/library/es7/error.js delete mode 100644 node_modules/core-js/library/es7/math.js delete mode 100644 node_modules/core-js/library/es7/observable.js delete mode 100644 node_modules/core-js/library/es7/reflect.js delete mode 100644 node_modules/core-js/library/es7/symbol.js delete mode 100644 node_modules/core-js/library/es7/system.js delete mode 100644 node_modules/core-js/library/fn/array/is-array.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/copy-within.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/entries.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/every.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/fill.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/filter.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/find-index.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/find.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/for-each.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/includes.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/index-of.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/index.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/iterator.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/join.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/keys.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/last-index-of.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/map.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/reduce-right.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/reduce.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/slice.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/some.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/sort.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/values.js delete mode 100644 node_modules/core-js/library/fn/asap.js delete mode 100644 node_modules/core-js/library/fn/date/index.js delete mode 100644 node_modules/core-js/library/fn/date/now.js delete mode 100644 node_modules/core-js/library/fn/date/to-iso-string.js delete mode 100644 node_modules/core-js/library/fn/date/to-json.js delete mode 100644 node_modules/core-js/library/fn/date/to-primitive.js delete mode 100644 node_modules/core-js/library/fn/date/to-string.js delete mode 100644 node_modules/core-js/library/fn/dom-collections/index.js delete mode 100644 node_modules/core-js/library/fn/dom-collections/iterator.js delete mode 100644 node_modules/core-js/library/fn/error/index.js delete mode 100644 node_modules/core-js/library/fn/error/is-error.js delete mode 100644 node_modules/core-js/library/fn/function/bind.js delete mode 100644 node_modules/core-js/library/fn/function/virtual/bind.js delete mode 100644 node_modules/core-js/library/fn/function/virtual/index.js delete mode 100644 node_modules/core-js/library/fn/function/virtual/part.js delete mode 100644 node_modules/core-js/library/fn/json/index.js delete mode 100644 node_modules/core-js/library/fn/math/iaddh.js delete mode 100644 node_modules/core-js/library/fn/math/imulh.js delete mode 100644 node_modules/core-js/library/fn/math/isubh.js delete mode 100644 node_modules/core-js/library/fn/math/umulh.js delete mode 100644 node_modules/core-js/library/fn/number/constructor.js delete mode 100644 node_modules/core-js/library/fn/number/to-fixed.js delete mode 100644 node_modules/core-js/library/fn/number/to-precision.js delete mode 100644 node_modules/core-js/library/fn/number/virtual/index.js delete mode 100644 node_modules/core-js/library/fn/number/virtual/iterator.js delete mode 100644 node_modules/core-js/library/fn/number/virtual/to-fixed.js delete mode 100644 node_modules/core-js/library/fn/number/virtual/to-precision.js delete mode 100644 node_modules/core-js/library/fn/object/define-getter.js delete mode 100644 node_modules/core-js/library/fn/object/define-setter.js delete mode 100644 node_modules/core-js/library/fn/object/lookup-getter.js delete mode 100644 node_modules/core-js/library/fn/object/lookup-setter.js delete mode 100644 node_modules/core-js/library/fn/observable.js delete mode 100644 node_modules/core-js/library/fn/parse-float.js delete mode 100644 node_modules/core-js/library/fn/parse-int.js delete mode 100644 node_modules/core-js/library/fn/reflect/define-metadata.js delete mode 100644 node_modules/core-js/library/fn/reflect/delete-metadata.js delete mode 100644 node_modules/core-js/library/fn/reflect/get-metadata-keys.js delete mode 100644 node_modules/core-js/library/fn/reflect/get-metadata.js delete mode 100644 node_modules/core-js/library/fn/reflect/get-own-metadata-keys.js delete mode 100644 node_modules/core-js/library/fn/reflect/get-own-metadata.js delete mode 100644 node_modules/core-js/library/fn/reflect/has-metadata.js delete mode 100644 node_modules/core-js/library/fn/reflect/has-own-metadata.js delete mode 100644 node_modules/core-js/library/fn/reflect/metadata.js delete mode 100644 node_modules/core-js/library/fn/regexp/constructor.js delete mode 100644 node_modules/core-js/library/fn/regexp/flags.js delete mode 100644 node_modules/core-js/library/fn/regexp/match.js delete mode 100644 node_modules/core-js/library/fn/regexp/replace.js delete mode 100644 node_modules/core-js/library/fn/regexp/search.js delete mode 100644 node_modules/core-js/library/fn/regexp/split.js delete mode 100644 node_modules/core-js/library/fn/regexp/to-string.js delete mode 100644 node_modules/core-js/library/fn/string/anchor.js delete mode 100644 node_modules/core-js/library/fn/string/big.js delete mode 100644 node_modules/core-js/library/fn/string/blink.js delete mode 100644 node_modules/core-js/library/fn/string/bold.js delete mode 100644 node_modules/core-js/library/fn/string/fixed.js delete mode 100644 node_modules/core-js/library/fn/string/fontcolor.js delete mode 100644 node_modules/core-js/library/fn/string/fontsize.js delete mode 100644 node_modules/core-js/library/fn/string/italics.js delete mode 100644 node_modules/core-js/library/fn/string/link.js delete mode 100644 node_modules/core-js/library/fn/string/match-all.js delete mode 100644 node_modules/core-js/library/fn/string/pad-end.js delete mode 100644 node_modules/core-js/library/fn/string/pad-start.js delete mode 100644 node_modules/core-js/library/fn/string/small.js delete mode 100644 node_modules/core-js/library/fn/string/strike.js delete mode 100644 node_modules/core-js/library/fn/string/sub.js delete mode 100644 node_modules/core-js/library/fn/string/sup.js delete mode 100644 node_modules/core-js/library/fn/string/trim-end.js delete mode 100644 node_modules/core-js/library/fn/string/trim-start.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/anchor.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/at.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/big.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/blink.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/bold.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/code-point-at.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/ends-with.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/escape-html.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/fixed.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/fontcolor.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/fontsize.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/includes.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/index.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/italics.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/iterator.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/link.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/match-all.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/pad-end.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/pad-start.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/repeat.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/small.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/starts-with.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/strike.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/sub.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/sup.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/trim-end.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/trim-left.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/trim-right.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/trim-start.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/trim.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/unescape-html.js delete mode 100644 node_modules/core-js/library/fn/symbol/async-iterator.js delete mode 100644 node_modules/core-js/library/fn/symbol/observable.js delete mode 100644 node_modules/core-js/library/fn/system/global.js delete mode 100644 node_modules/core-js/library/fn/system/index.js delete mode 100644 node_modules/core-js/library/fn/typed/array-buffer.js delete mode 100644 node_modules/core-js/library/fn/typed/data-view.js delete mode 100644 node_modules/core-js/library/fn/typed/float32-array.js delete mode 100644 node_modules/core-js/library/fn/typed/float64-array.js delete mode 100644 node_modules/core-js/library/fn/typed/index.js delete mode 100644 node_modules/core-js/library/fn/typed/int16-array.js delete mode 100644 node_modules/core-js/library/fn/typed/int32-array.js delete mode 100644 node_modules/core-js/library/fn/typed/int8-array.js delete mode 100644 node_modules/core-js/library/fn/typed/uint16-array.js delete mode 100644 node_modules/core-js/library/fn/typed/uint32-array.js delete mode 100644 node_modules/core-js/library/fn/typed/uint8-array.js delete mode 100644 node_modules/core-js/library/fn/typed/uint8-clamped-array.js delete mode 100644 node_modules/core-js/library/modules/_a-function.js delete mode 100644 node_modules/core-js/library/modules/_a-number-value.js delete mode 100644 node_modules/core-js/library/modules/_add-to-unscopables.js delete mode 100644 node_modules/core-js/library/modules/_an-instance.js delete mode 100644 node_modules/core-js/library/modules/_an-object.js delete mode 100644 node_modules/core-js/library/modules/_array-copy-within.js delete mode 100644 node_modules/core-js/library/modules/_array-fill.js delete mode 100644 node_modules/core-js/library/modules/_array-from-iterable.js delete mode 100644 node_modules/core-js/library/modules/_array-includes.js delete mode 100644 node_modules/core-js/library/modules/_array-methods.js delete mode 100644 node_modules/core-js/library/modules/_array-reduce.js delete mode 100644 node_modules/core-js/library/modules/_array-species-constructor.js delete mode 100644 node_modules/core-js/library/modules/_array-species-create.js delete mode 100644 node_modules/core-js/library/modules/_bind.js delete mode 100644 node_modules/core-js/library/modules/_classof.js delete mode 100644 node_modules/core-js/library/modules/_cof.js delete mode 100644 node_modules/core-js/library/modules/_collection-strong.js delete mode 100644 node_modules/core-js/library/modules/_collection-to-json.js delete mode 100644 node_modules/core-js/library/modules/_collection-weak.js delete mode 100644 node_modules/core-js/library/modules/_collection.js delete mode 100644 node_modules/core-js/library/modules/_core.js delete mode 100644 node_modules/core-js/library/modules/_create-property.js delete mode 100644 node_modules/core-js/library/modules/_ctx.js delete mode 100644 node_modules/core-js/library/modules/_date-to-primitive.js delete mode 100644 node_modules/core-js/library/modules/_defined.js delete mode 100644 node_modules/core-js/library/modules/_descriptors.js delete mode 100644 node_modules/core-js/library/modules/_dom-create.js delete mode 100644 node_modules/core-js/library/modules/_entry-virtual.js delete mode 100644 node_modules/core-js/library/modules/_enum-bug-keys.js delete mode 100644 node_modules/core-js/library/modules/_enum-keys.js delete mode 100644 node_modules/core-js/library/modules/_export.js delete mode 100644 node_modules/core-js/library/modules/_fails-is-regexp.js delete mode 100644 node_modules/core-js/library/modules/_fails.js delete mode 100644 node_modules/core-js/library/modules/_fix-re-wks.js delete mode 100644 node_modules/core-js/library/modules/_flags.js delete mode 100644 node_modules/core-js/library/modules/_for-of.js delete mode 100644 node_modules/core-js/library/modules/_global.js delete mode 100644 node_modules/core-js/library/modules/_has.js delete mode 100644 node_modules/core-js/library/modules/_hide.js delete mode 100644 node_modules/core-js/library/modules/_html.js delete mode 100644 node_modules/core-js/library/modules/_ie8-dom-define.js delete mode 100644 node_modules/core-js/library/modules/_inherit-if-required.js delete mode 100644 node_modules/core-js/library/modules/_invoke.js delete mode 100644 node_modules/core-js/library/modules/_iobject.js delete mode 100644 node_modules/core-js/library/modules/_is-array-iter.js delete mode 100644 node_modules/core-js/library/modules/_is-array.js delete mode 100644 node_modules/core-js/library/modules/_is-integer.js delete mode 100644 node_modules/core-js/library/modules/_is-object.js delete mode 100644 node_modules/core-js/library/modules/_is-regexp.js delete mode 100644 node_modules/core-js/library/modules/_iter-call.js delete mode 100644 node_modules/core-js/library/modules/_iter-create.js delete mode 100644 node_modules/core-js/library/modules/_iter-define.js delete mode 100644 node_modules/core-js/library/modules/_iter-detect.js delete mode 100644 node_modules/core-js/library/modules/_iter-step.js delete mode 100644 node_modules/core-js/library/modules/_iterators.js delete mode 100644 node_modules/core-js/library/modules/_keyof.js delete mode 100644 node_modules/core-js/library/modules/_library.js delete mode 100644 node_modules/core-js/library/modules/_math-expm1.js delete mode 100644 node_modules/core-js/library/modules/_math-log1p.js delete mode 100644 node_modules/core-js/library/modules/_math-sign.js delete mode 100644 node_modules/core-js/library/modules/_meta.js delete mode 100644 node_modules/core-js/library/modules/_metadata.js delete mode 100644 node_modules/core-js/library/modules/_microtask.js delete mode 100644 node_modules/core-js/library/modules/_object-assign.js delete mode 100644 node_modules/core-js/library/modules/_object-create.js delete mode 100644 node_modules/core-js/library/modules/_object-define.js delete mode 100644 node_modules/core-js/library/modules/_object-dp.js delete mode 100644 node_modules/core-js/library/modules/_object-dps.js delete mode 100644 node_modules/core-js/library/modules/_object-forced-pam.js delete mode 100644 node_modules/core-js/library/modules/_object-gopd.js delete mode 100644 node_modules/core-js/library/modules/_object-gopn-ext.js delete mode 100644 node_modules/core-js/library/modules/_object-gopn.js delete mode 100644 node_modules/core-js/library/modules/_object-gops.js delete mode 100644 node_modules/core-js/library/modules/_object-gpo.js delete mode 100644 node_modules/core-js/library/modules/_object-keys-internal.js delete mode 100644 node_modules/core-js/library/modules/_object-keys.js delete mode 100644 node_modules/core-js/library/modules/_object-pie.js delete mode 100644 node_modules/core-js/library/modules/_object-sap.js delete mode 100644 node_modules/core-js/library/modules/_object-to-array.js delete mode 100644 node_modules/core-js/library/modules/_own-keys.js delete mode 100644 node_modules/core-js/library/modules/_parse-float.js delete mode 100644 node_modules/core-js/library/modules/_parse-int.js delete mode 100644 node_modules/core-js/library/modules/_partial.js delete mode 100644 node_modules/core-js/library/modules/_path.js delete mode 100644 node_modules/core-js/library/modules/_property-desc.js delete mode 100644 node_modules/core-js/library/modules/_redefine-all.js delete mode 100644 node_modules/core-js/library/modules/_redefine.js delete mode 100644 node_modules/core-js/library/modules/_replacer.js delete mode 100644 node_modules/core-js/library/modules/_same-value.js delete mode 100644 node_modules/core-js/library/modules/_set-proto.js delete mode 100644 node_modules/core-js/library/modules/_set-species.js delete mode 100644 node_modules/core-js/library/modules/_set-to-string-tag.js delete mode 100644 node_modules/core-js/library/modules/_shared-key.js delete mode 100644 node_modules/core-js/library/modules/_shared.js delete mode 100644 node_modules/core-js/library/modules/_species-constructor.js delete mode 100644 node_modules/core-js/library/modules/_strict-method.js delete mode 100644 node_modules/core-js/library/modules/_string-at.js delete mode 100644 node_modules/core-js/library/modules/_string-context.js delete mode 100644 node_modules/core-js/library/modules/_string-html.js delete mode 100644 node_modules/core-js/library/modules/_string-pad.js delete mode 100644 node_modules/core-js/library/modules/_string-repeat.js delete mode 100644 node_modules/core-js/library/modules/_string-trim.js delete mode 100644 node_modules/core-js/library/modules/_string-ws.js delete mode 100644 node_modules/core-js/library/modules/_task.js delete mode 100644 node_modules/core-js/library/modules/_to-index.js delete mode 100644 node_modules/core-js/library/modules/_to-integer.js delete mode 100644 node_modules/core-js/library/modules/_to-iobject.js delete mode 100644 node_modules/core-js/library/modules/_to-length.js delete mode 100644 node_modules/core-js/library/modules/_to-object.js delete mode 100644 node_modules/core-js/library/modules/_to-primitive.js delete mode 100644 node_modules/core-js/library/modules/_typed-array.js delete mode 100644 node_modules/core-js/library/modules/_typed-buffer.js delete mode 100644 node_modules/core-js/library/modules/_typed.js delete mode 100644 node_modules/core-js/library/modules/_uid.js delete mode 100644 node_modules/core-js/library/modules/_wks-define.js delete mode 100644 node_modules/core-js/library/modules/_wks-ext.js delete mode 100644 node_modules/core-js/library/modules/_wks.js delete mode 100644 node_modules/core-js/library/modules/core.regexp.escape.js delete mode 100644 node_modules/core-js/library/modules/es6.array.every.js delete mode 100644 node_modules/core-js/library/modules/es6.array.filter.js delete mode 100644 node_modules/core-js/library/modules/es6.array.for-each.js delete mode 100644 node_modules/core-js/library/modules/es6.array.index-of.js delete mode 100644 node_modules/core-js/library/modules/es6.array.is-array.js delete mode 100644 node_modules/core-js/library/modules/es6.array.join.js delete mode 100644 node_modules/core-js/library/modules/es6.array.last-index-of.js delete mode 100644 node_modules/core-js/library/modules/es6.array.map.js delete mode 100644 node_modules/core-js/library/modules/es6.array.reduce-right.js delete mode 100644 node_modules/core-js/library/modules/es6.array.reduce.js delete mode 100644 node_modules/core-js/library/modules/es6.array.slice.js delete mode 100644 node_modules/core-js/library/modules/es6.array.some.js delete mode 100644 node_modules/core-js/library/modules/es6.array.sort.js delete mode 100644 node_modules/core-js/library/modules/es6.date.now.js delete mode 100644 node_modules/core-js/library/modules/es6.date.to-iso-string.js delete mode 100644 node_modules/core-js/library/modules/es6.date.to-json.js delete mode 100644 node_modules/core-js/library/modules/es6.date.to-primitive.js delete mode 100644 node_modules/core-js/library/modules/es6.function.bind.js delete mode 100644 node_modules/core-js/library/modules/es6.number.to-fixed.js delete mode 100644 node_modules/core-js/library/modules/es6.number.to-precision.js delete mode 100644 node_modules/core-js/library/modules/es6.object.create.js delete mode 100644 node_modules/core-js/library/modules/es6.object.define-properties.js delete mode 100644 node_modules/core-js/library/modules/es6.object.define-property.js delete mode 100644 node_modules/core-js/library/modules/es6.parse-float.js delete mode 100644 node_modules/core-js/library/modules/es6.parse-int.js delete mode 100644 node_modules/core-js/library/modules/es6.regexp.to-string.js delete mode 100644 node_modules/core-js/library/modules/es6.string.anchor.js delete mode 100644 node_modules/core-js/library/modules/es6.string.big.js delete mode 100644 node_modules/core-js/library/modules/es6.string.blink.js delete mode 100644 node_modules/core-js/library/modules/es6.string.bold.js delete mode 100644 node_modules/core-js/library/modules/es6.string.fixed.js delete mode 100644 node_modules/core-js/library/modules/es6.string.fontcolor.js delete mode 100644 node_modules/core-js/library/modules/es6.string.fontsize.js delete mode 100644 node_modules/core-js/library/modules/es6.string.italics.js delete mode 100644 node_modules/core-js/library/modules/es6.string.link.js delete mode 100644 node_modules/core-js/library/modules/es6.string.small.js delete mode 100644 node_modules/core-js/library/modules/es6.string.strike.js delete mode 100644 node_modules/core-js/library/modules/es6.string.sub.js delete mode 100644 node_modules/core-js/library/modules/es6.string.sup.js delete mode 100644 node_modules/core-js/library/modules/es7.asap.js delete mode 100644 node_modules/core-js/library/modules/es7.error.is-error.js delete mode 100644 node_modules/core-js/library/modules/es7.math.iaddh.js delete mode 100644 node_modules/core-js/library/modules/es7.math.imulh.js delete mode 100644 node_modules/core-js/library/modules/es7.math.isubh.js delete mode 100644 node_modules/core-js/library/modules/es7.math.umulh.js delete mode 100644 node_modules/core-js/library/modules/es7.object.define-getter.js delete mode 100644 node_modules/core-js/library/modules/es7.object.define-setter.js delete mode 100644 node_modules/core-js/library/modules/es7.object.enumerable-entries.js delete mode 100644 node_modules/core-js/library/modules/es7.object.enumerable-keys.js delete mode 100644 node_modules/core-js/library/modules/es7.object.enumerable-values.js delete mode 100644 node_modules/core-js/library/modules/es7.object.lookup-getter.js delete mode 100644 node_modules/core-js/library/modules/es7.object.lookup-setter.js delete mode 100644 node_modules/core-js/library/modules/es7.observable.js delete mode 100644 node_modules/core-js/library/modules/es7.reflect.define-metadata.js delete mode 100644 node_modules/core-js/library/modules/es7.reflect.delete-metadata.js delete mode 100644 node_modules/core-js/library/modules/es7.reflect.get-metadata-keys.js delete mode 100644 node_modules/core-js/library/modules/es7.reflect.get-metadata.js delete mode 100644 node_modules/core-js/library/modules/es7.reflect.get-own-metadata-keys.js delete mode 100644 node_modules/core-js/library/modules/es7.reflect.get-own-metadata.js delete mode 100644 node_modules/core-js/library/modules/es7.reflect.has-metadata.js delete mode 100644 node_modules/core-js/library/modules/es7.reflect.has-own-metadata.js delete mode 100644 node_modules/core-js/library/modules/es7.reflect.metadata.js delete mode 100644 node_modules/core-js/library/modules/es7.string.match-all.js delete mode 100644 node_modules/core-js/library/modules/es7.string.pad-end.js delete mode 100644 node_modules/core-js/library/modules/es7.string.pad-start.js delete mode 100644 node_modules/core-js/library/modules/es7.symbol.async-iterator.js delete mode 100644 node_modules/core-js/library/modules/es7.symbol.observable.js delete mode 100644 node_modules/core-js/library/modules/es7.system.global.js delete mode 100644 node_modules/core-js/library/stage/0.js delete mode 100644 node_modules/core-js/library/stage/1.js delete mode 100644 node_modules/core-js/library/stage/2.js delete mode 100644 node_modules/core-js/library/stage/3.js delete mode 100644 node_modules/core-js/library/stage/4.js delete mode 100644 node_modules/core-js/library/stage/index.js delete mode 100644 node_modules/core-js/library/stage/pre.js delete mode 100644 node_modules/core-js/library/web/dom-collections.js delete mode 100644 node_modules/core-js/modules/_a-function.js delete mode 100644 node_modules/core-js/modules/_a-number-value.js delete mode 100644 node_modules/core-js/modules/_add-to-unscopables.js delete mode 100644 node_modules/core-js/modules/_an-instance.js delete mode 100644 node_modules/core-js/modules/_an-object.js delete mode 100644 node_modules/core-js/modules/_array-copy-within.js delete mode 100644 node_modules/core-js/modules/_array-fill.js delete mode 100644 node_modules/core-js/modules/_array-from-iterable.js delete mode 100644 node_modules/core-js/modules/_array-includes.js delete mode 100644 node_modules/core-js/modules/_array-methods.js delete mode 100644 node_modules/core-js/modules/_array-reduce.js delete mode 100644 node_modules/core-js/modules/_array-species-constructor.js delete mode 100644 node_modules/core-js/modules/_array-species-create.js delete mode 100644 node_modules/core-js/modules/_bind.js delete mode 100644 node_modules/core-js/modules/_classof.js delete mode 100644 node_modules/core-js/modules/_cof.js delete mode 100644 node_modules/core-js/modules/_collection-strong.js delete mode 100644 node_modules/core-js/modules/_collection-to-json.js delete mode 100644 node_modules/core-js/modules/_collection-weak.js delete mode 100644 node_modules/core-js/modules/_collection.js delete mode 100644 node_modules/core-js/modules/_core.js delete mode 100644 node_modules/core-js/modules/_create-property.js delete mode 100644 node_modules/core-js/modules/_ctx.js delete mode 100644 node_modules/core-js/modules/_date-to-primitive.js delete mode 100644 node_modules/core-js/modules/_defined.js delete mode 100644 node_modules/core-js/modules/_descriptors.js delete mode 100644 node_modules/core-js/modules/_dom-create.js delete mode 100644 node_modules/core-js/modules/_entry-virtual.js delete mode 100644 node_modules/core-js/modules/_enum-bug-keys.js delete mode 100644 node_modules/core-js/modules/_enum-keys.js delete mode 100644 node_modules/core-js/modules/_export.js delete mode 100644 node_modules/core-js/modules/_fails-is-regexp.js delete mode 100644 node_modules/core-js/modules/_fails.js delete mode 100644 node_modules/core-js/modules/_fix-re-wks.js delete mode 100644 node_modules/core-js/modules/_flags.js delete mode 100644 node_modules/core-js/modules/_for-of.js delete mode 100644 node_modules/core-js/modules/_global.js delete mode 100644 node_modules/core-js/modules/_has.js delete mode 100644 node_modules/core-js/modules/_hide.js delete mode 100644 node_modules/core-js/modules/_html.js delete mode 100644 node_modules/core-js/modules/_ie8-dom-define.js delete mode 100644 node_modules/core-js/modules/_inherit-if-required.js delete mode 100644 node_modules/core-js/modules/_invoke.js delete mode 100644 node_modules/core-js/modules/_iobject.js delete mode 100644 node_modules/core-js/modules/_is-array-iter.js delete mode 100644 node_modules/core-js/modules/_is-array.js delete mode 100644 node_modules/core-js/modules/_is-integer.js delete mode 100644 node_modules/core-js/modules/_is-object.js delete mode 100644 node_modules/core-js/modules/_is-regexp.js delete mode 100644 node_modules/core-js/modules/_iter-call.js delete mode 100644 node_modules/core-js/modules/_iter-create.js delete mode 100644 node_modules/core-js/modules/_iter-define.js delete mode 100644 node_modules/core-js/modules/_iter-detect.js delete mode 100644 node_modules/core-js/modules/_iter-step.js delete mode 100644 node_modules/core-js/modules/_iterators.js delete mode 100644 node_modules/core-js/modules/_keyof.js delete mode 100644 node_modules/core-js/modules/_library.js delete mode 100644 node_modules/core-js/modules/_math-expm1.js delete mode 100644 node_modules/core-js/modules/_math-log1p.js delete mode 100644 node_modules/core-js/modules/_math-sign.js delete mode 100644 node_modules/core-js/modules/_meta.js delete mode 100644 node_modules/core-js/modules/_metadata.js delete mode 100644 node_modules/core-js/modules/_microtask.js delete mode 100644 node_modules/core-js/modules/_object-assign.js delete mode 100644 node_modules/core-js/modules/_object-create.js delete mode 100644 node_modules/core-js/modules/_object-define.js delete mode 100644 node_modules/core-js/modules/_object-dp.js delete mode 100644 node_modules/core-js/modules/_object-dps.js delete mode 100644 node_modules/core-js/modules/_object-forced-pam.js delete mode 100644 node_modules/core-js/modules/_object-gopd.js delete mode 100644 node_modules/core-js/modules/_object-gopn-ext.js delete mode 100644 node_modules/core-js/modules/_object-gopn.js delete mode 100644 node_modules/core-js/modules/_object-gops.js delete mode 100644 node_modules/core-js/modules/_object-gpo.js delete mode 100644 node_modules/core-js/modules/_object-keys-internal.js delete mode 100644 node_modules/core-js/modules/_object-keys.js delete mode 100644 node_modules/core-js/modules/_object-pie.js delete mode 100644 node_modules/core-js/modules/_object-sap.js delete mode 100644 node_modules/core-js/modules/_object-to-array.js delete mode 100644 node_modules/core-js/modules/_own-keys.js delete mode 100644 node_modules/core-js/modules/_parse-float.js delete mode 100644 node_modules/core-js/modules/_parse-int.js delete mode 100644 node_modules/core-js/modules/_partial.js delete mode 100644 node_modules/core-js/modules/_path.js delete mode 100644 node_modules/core-js/modules/_property-desc.js delete mode 100644 node_modules/core-js/modules/_redefine-all.js delete mode 100644 node_modules/core-js/modules/_redefine.js delete mode 100644 node_modules/core-js/modules/_replacer.js delete mode 100644 node_modules/core-js/modules/_same-value.js delete mode 100644 node_modules/core-js/modules/_set-proto.js delete mode 100644 node_modules/core-js/modules/_set-species.js delete mode 100644 node_modules/core-js/modules/_set-to-string-tag.js delete mode 100644 node_modules/core-js/modules/_shared-key.js delete mode 100644 node_modules/core-js/modules/_shared.js delete mode 100644 node_modules/core-js/modules/_species-constructor.js delete mode 100644 node_modules/core-js/modules/_strict-method.js delete mode 100644 node_modules/core-js/modules/_string-at.js delete mode 100644 node_modules/core-js/modules/_string-context.js delete mode 100644 node_modules/core-js/modules/_string-html.js delete mode 100644 node_modules/core-js/modules/_string-pad.js delete mode 100644 node_modules/core-js/modules/_string-repeat.js delete mode 100644 node_modules/core-js/modules/_string-trim.js delete mode 100644 node_modules/core-js/modules/_string-ws.js delete mode 100644 node_modules/core-js/modules/_task.js delete mode 100644 node_modules/core-js/modules/_to-index.js delete mode 100644 node_modules/core-js/modules/_to-integer.js delete mode 100644 node_modules/core-js/modules/_to-iobject.js delete mode 100644 node_modules/core-js/modules/_to-length.js delete mode 100644 node_modules/core-js/modules/_to-object.js delete mode 100644 node_modules/core-js/modules/_to-primitive.js delete mode 100644 node_modules/core-js/modules/_typed-array.js delete mode 100644 node_modules/core-js/modules/_typed-buffer.js delete mode 100644 node_modules/core-js/modules/_typed.js delete mode 100644 node_modules/core-js/modules/_uid.js delete mode 100644 node_modules/core-js/modules/_wks-define.js delete mode 100644 node_modules/core-js/modules/_wks-ext.js delete mode 100644 node_modules/core-js/modules/_wks.js delete mode 100644 node_modules/core-js/modules/core.regexp.escape.js delete mode 100644 node_modules/core-js/modules/es6.array.every.js delete mode 100644 node_modules/core-js/modules/es6.array.filter.js delete mode 100644 node_modules/core-js/modules/es6.array.for-each.js delete mode 100644 node_modules/core-js/modules/es6.array.index-of.js delete mode 100644 node_modules/core-js/modules/es6.array.is-array.js delete mode 100644 node_modules/core-js/modules/es6.array.join.js delete mode 100644 node_modules/core-js/modules/es6.array.last-index-of.js delete mode 100644 node_modules/core-js/modules/es6.array.map.js delete mode 100644 node_modules/core-js/modules/es6.array.reduce-right.js delete mode 100644 node_modules/core-js/modules/es6.array.reduce.js delete mode 100644 node_modules/core-js/modules/es6.array.slice.js delete mode 100644 node_modules/core-js/modules/es6.array.some.js delete mode 100644 node_modules/core-js/modules/es6.array.sort.js delete mode 100644 node_modules/core-js/modules/es6.date.now.js delete mode 100644 node_modules/core-js/modules/es6.date.to-iso-string.js delete mode 100644 node_modules/core-js/modules/es6.date.to-json.js delete mode 100644 node_modules/core-js/modules/es6.date.to-primitive.js delete mode 100644 node_modules/core-js/modules/es6.function.bind.js delete mode 100644 node_modules/core-js/modules/es6.number.to-fixed.js delete mode 100644 node_modules/core-js/modules/es6.number.to-precision.js delete mode 100644 node_modules/core-js/modules/es6.object.create.js delete mode 100644 node_modules/core-js/modules/es6.object.define-properties.js delete mode 100644 node_modules/core-js/modules/es6.object.define-property.js delete mode 100644 node_modules/core-js/modules/es6.parse-float.js delete mode 100644 node_modules/core-js/modules/es6.parse-int.js delete mode 100644 node_modules/core-js/modules/es6.regexp.to-string.js delete mode 100644 node_modules/core-js/modules/es6.string.anchor.js delete mode 100644 node_modules/core-js/modules/es6.string.big.js delete mode 100644 node_modules/core-js/modules/es6.string.blink.js delete mode 100644 node_modules/core-js/modules/es6.string.bold.js delete mode 100644 node_modules/core-js/modules/es6.string.fixed.js delete mode 100644 node_modules/core-js/modules/es6.string.fontcolor.js delete mode 100644 node_modules/core-js/modules/es6.string.fontsize.js delete mode 100644 node_modules/core-js/modules/es6.string.italics.js delete mode 100644 node_modules/core-js/modules/es6.string.link.js delete mode 100644 node_modules/core-js/modules/es6.string.small.js delete mode 100644 node_modules/core-js/modules/es6.string.strike.js delete mode 100644 node_modules/core-js/modules/es6.string.sub.js delete mode 100644 node_modules/core-js/modules/es6.string.sup.js delete mode 100644 node_modules/core-js/modules/es7.asap.js delete mode 100644 node_modules/core-js/modules/es7.error.is-error.js delete mode 100644 node_modules/core-js/modules/es7.math.iaddh.js delete mode 100644 node_modules/core-js/modules/es7.math.imulh.js delete mode 100644 node_modules/core-js/modules/es7.math.isubh.js delete mode 100644 node_modules/core-js/modules/es7.math.umulh.js delete mode 100644 node_modules/core-js/modules/es7.object.define-getter.js delete mode 100644 node_modules/core-js/modules/es7.object.define-setter.js delete mode 100644 node_modules/core-js/modules/es7.object.enumerable-entries.js delete mode 100644 node_modules/core-js/modules/es7.object.enumerable-keys.js delete mode 100644 node_modules/core-js/modules/es7.object.enumerable-values.js delete mode 100644 node_modules/core-js/modules/es7.object.lookup-getter.js delete mode 100644 node_modules/core-js/modules/es7.object.lookup-setter.js delete mode 100644 node_modules/core-js/modules/es7.observable.js delete mode 100644 node_modules/core-js/modules/es7.reflect.define-metadata.js delete mode 100644 node_modules/core-js/modules/es7.reflect.delete-metadata.js delete mode 100644 node_modules/core-js/modules/es7.reflect.get-metadata-keys.js delete mode 100644 node_modules/core-js/modules/es7.reflect.get-metadata.js delete mode 100644 node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js delete mode 100644 node_modules/core-js/modules/es7.reflect.get-own-metadata.js delete mode 100644 node_modules/core-js/modules/es7.reflect.has-metadata.js delete mode 100644 node_modules/core-js/modules/es7.reflect.has-own-metadata.js delete mode 100644 node_modules/core-js/modules/es7.reflect.metadata.js delete mode 100644 node_modules/core-js/modules/es7.string.match-all.js delete mode 100644 node_modules/core-js/modules/es7.string.pad-end.js delete mode 100644 node_modules/core-js/modules/es7.string.pad-start.js delete mode 100644 node_modules/core-js/modules/es7.symbol.async-iterator.js delete mode 100644 node_modules/core-js/modules/es7.symbol.observable.js delete mode 100644 node_modules/core-js/modules/es7.system.global.js delete mode 100644 node_modules/core-js/modules/library/_add-to-unscopables.js delete mode 100644 node_modules/core-js/modules/library/_collection.js delete mode 100644 node_modules/core-js/modules/library/_export.js delete mode 100644 node_modules/core-js/modules/library/_library.js delete mode 100644 node_modules/core-js/modules/library/_path.js delete mode 100644 node_modules/core-js/modules/library/_redefine-all.js delete mode 100644 node_modules/core-js/modules/library/_redefine.js delete mode 100644 node_modules/core-js/modules/library/_set-species.js delete mode 100644 node_modules/core-js/modules/library/es6.date.to-primitive.js delete mode 100644 node_modules/core-js/modules/library/es6.regexp.to-string.js delete mode 100644 node_modules/core-js/stage/0.js delete mode 100644 node_modules/core-js/stage/1.js delete mode 100644 node_modules/core-js/stage/2.js delete mode 100644 node_modules/core-js/stage/3.js delete mode 100644 node_modules/core-js/stage/4.js delete mode 100644 node_modules/core-js/stage/index.js delete mode 100644 node_modules/core-js/stage/pre.js delete mode 100644 node_modules/core-js/web/dom-collections.js delete mode 100644 node_modules/dateformat/.travis.yml delete mode 100755 node_modules/dateformat/bin/cli.js delete mode 100644 node_modules/dateformat/test/test_dayofweek.js delete mode 100644 node_modules/dateformat/test/test_formats.js delete mode 100644 node_modules/dateformat/test/test_isoutcdatetime.js delete mode 100644 node_modules/dateformat/test/weekofyear/test_weekofyear.js delete mode 100644 node_modules/dateformat/test/weekofyear/test_weekofyear.sh delete mode 100644 node_modules/debug/.jshintrc delete mode 100644 node_modules/debug/History.md delete mode 100644 node_modules/debug/Readme.md delete mode 100644 node_modules/debug/browser.js delete mode 100644 node_modules/debug/debug.js delete mode 100644 node_modules/glob-base/node_modules/glob-parent/.npmignore delete mode 100644 node_modules/glob-base/node_modules/glob-parent/.travis.yml delete mode 100644 node_modules/glob-base/node_modules/glob-parent/LICENSE delete mode 100644 node_modules/glob-base/node_modules/glob-parent/README.md delete mode 100644 node_modules/glob-base/node_modules/glob-parent/index.js delete mode 100644 node_modules/glob-base/node_modules/glob-parent/package.json delete mode 100644 node_modules/glob-base/node_modules/glob-parent/test.js delete mode 100644 node_modules/glob-parent/appveyor.yml delete mode 100644 node_modules/glob-parent/node_modules/is-extglob/LICENSE delete mode 100644 node_modules/glob-parent/node_modules/is-extglob/README.md delete mode 100644 node_modules/glob-parent/node_modules/is-extglob/index.js delete mode 100644 node_modules/glob-parent/node_modules/is-extglob/package.json delete mode 100644 node_modules/glob-parent/node_modules/is-glob/LICENSE delete mode 100644 node_modules/glob-parent/node_modules/is-glob/README.md delete mode 100644 node_modules/glob-parent/node_modules/is-glob/index.js delete mode 100644 node_modules/glob-parent/node_modules/is-glob/package.json delete mode 100644 node_modules/gulp-debug/node_modules/clone-stats/LICENSE.md delete mode 100644 node_modules/gulp-debug/node_modules/clone-stats/README.md delete mode 100644 node_modules/gulp-debug/node_modules/clone-stats/index.js delete mode 100644 node_modules/gulp-debug/node_modules/clone-stats/package.json delete mode 100644 node_modules/gulp-debug/node_modules/clone-stats/test.js delete mode 100755 node_modules/gulp-debug/node_modules/gulp-util/LICENSE delete mode 100644 node_modules/gulp-debug/node_modules/gulp-util/README.md delete mode 100644 node_modules/gulp-debug/node_modules/gulp-util/index.js delete mode 100644 node_modules/gulp-debug/node_modules/gulp-util/lib/PluginError.js delete mode 100644 node_modules/gulp-debug/node_modules/gulp-util/lib/buffer.js delete mode 100644 node_modules/gulp-debug/node_modules/gulp-util/lib/combine.js delete mode 100644 node_modules/gulp-debug/node_modules/gulp-util/lib/env.js delete mode 100644 node_modules/gulp-debug/node_modules/gulp-util/lib/isBuffer.js delete mode 100644 node_modules/gulp-debug/node_modules/gulp-util/lib/isNull.js delete mode 100644 node_modules/gulp-debug/node_modules/gulp-util/lib/isStream.js delete mode 100644 node_modules/gulp-debug/node_modules/gulp-util/lib/log.js delete mode 100644 node_modules/gulp-debug/node_modules/gulp-util/lib/noop.js delete mode 100644 node_modules/gulp-debug/node_modules/gulp-util/lib/template.js delete mode 120000 node_modules/gulp-debug/node_modules/gulp-util/node_modules/.bin/dateformat delete mode 100644 node_modules/gulp-debug/node_modules/gulp-util/node_modules/object-assign/index.js delete mode 100644 node_modules/gulp-debug/node_modules/gulp-util/node_modules/object-assign/license delete mode 100644 node_modules/gulp-debug/node_modules/gulp-util/node_modules/object-assign/package.json delete mode 100644 node_modules/gulp-debug/node_modules/gulp-util/node_modules/object-assign/readme.md delete mode 100644 node_modules/gulp-debug/node_modules/gulp-util/package.json delete mode 100644 node_modules/gulp-debug/node_modules/lodash._reinterpolate/LICENSE.txt delete mode 100644 node_modules/gulp-debug/node_modules/lodash._reinterpolate/README.md delete mode 100644 node_modules/gulp-debug/node_modules/lodash._reinterpolate/index.js delete mode 100644 node_modules/gulp-debug/node_modules/lodash._reinterpolate/package.json delete mode 100644 node_modules/gulp-debug/node_modules/lodash.template/LICENSE delete mode 100644 node_modules/gulp-debug/node_modules/lodash.template/README.md delete mode 100644 node_modules/gulp-debug/node_modules/lodash.template/index.js delete mode 100644 node_modules/gulp-debug/node_modules/lodash.template/package.json delete mode 100644 node_modules/gulp-debug/node_modules/replace-ext/.npmignore delete mode 100644 node_modules/gulp-debug/node_modules/replace-ext/.travis.yml delete mode 100755 node_modules/gulp-debug/node_modules/replace-ext/LICENSE delete mode 100644 node_modules/gulp-debug/node_modules/replace-ext/README.md delete mode 100644 node_modules/gulp-debug/node_modules/replace-ext/index.js delete mode 100644 node_modules/gulp-debug/node_modules/replace-ext/package.json delete mode 100644 node_modules/gulp-debug/node_modules/replace-ext/test/main.js delete mode 100644 node_modules/gulp-debug/node_modules/vinyl/LICENSE delete mode 100644 node_modules/gulp-debug/node_modules/vinyl/README.md delete mode 100644 node_modules/gulp-debug/node_modules/vinyl/index.js delete mode 100644 node_modules/gulp-debug/node_modules/vinyl/lib/cloneBuffer.js delete mode 100644 node_modules/gulp-debug/node_modules/vinyl/lib/inspectStream.js delete mode 100644 node_modules/gulp-debug/node_modules/vinyl/lib/isBuffer.js delete mode 100644 node_modules/gulp-debug/node_modules/vinyl/lib/isNull.js delete mode 100644 node_modules/gulp-debug/node_modules/vinyl/lib/isStream.js delete mode 100644 node_modules/gulp-debug/node_modules/vinyl/package.json delete mode 100644 node_modules/gulp-json-transform/node_modules/clone-stats/LICENSE.md delete mode 100644 node_modules/gulp-json-transform/node_modules/clone-stats/README.md delete mode 100644 node_modules/gulp-json-transform/node_modules/clone-stats/index.js delete mode 100644 node_modules/gulp-json-transform/node_modules/clone-stats/package.json delete mode 100644 node_modules/gulp-json-transform/node_modules/clone-stats/test.js delete mode 100755 node_modules/gulp-json-transform/node_modules/gulp-util/LICENSE delete mode 100644 node_modules/gulp-json-transform/node_modules/gulp-util/README.md delete mode 100644 node_modules/gulp-json-transform/node_modules/gulp-util/index.js delete mode 100644 node_modules/gulp-json-transform/node_modules/gulp-util/lib/PluginError.js delete mode 100644 node_modules/gulp-json-transform/node_modules/gulp-util/lib/buffer.js delete mode 100644 node_modules/gulp-json-transform/node_modules/gulp-util/lib/combine.js delete mode 100644 node_modules/gulp-json-transform/node_modules/gulp-util/lib/env.js delete mode 100644 node_modules/gulp-json-transform/node_modules/gulp-util/lib/isBuffer.js delete mode 100644 node_modules/gulp-json-transform/node_modules/gulp-util/lib/isNull.js delete mode 100644 node_modules/gulp-json-transform/node_modules/gulp-util/lib/isStream.js delete mode 100644 node_modules/gulp-json-transform/node_modules/gulp-util/lib/log.js delete mode 100644 node_modules/gulp-json-transform/node_modules/gulp-util/lib/noop.js delete mode 100644 node_modules/gulp-json-transform/node_modules/gulp-util/lib/template.js delete mode 120000 node_modules/gulp-json-transform/node_modules/gulp-util/node_modules/.bin/dateformat delete mode 100644 node_modules/gulp-json-transform/node_modules/gulp-util/package.json delete mode 100644 node_modules/gulp-json-transform/node_modules/lodash._reinterpolate/LICENSE.txt delete mode 100644 node_modules/gulp-json-transform/node_modules/lodash._reinterpolate/README.md delete mode 100644 node_modules/gulp-json-transform/node_modules/lodash._reinterpolate/index.js delete mode 100644 node_modules/gulp-json-transform/node_modules/lodash._reinterpolate/package.json delete mode 100644 node_modules/gulp-json-transform/node_modules/lodash.template/LICENSE delete mode 100644 node_modules/gulp-json-transform/node_modules/lodash.template/README.md delete mode 100644 node_modules/gulp-json-transform/node_modules/lodash.template/index.js delete mode 100644 node_modules/gulp-json-transform/node_modules/lodash.template/package.json delete mode 100644 node_modules/gulp-json-transform/node_modules/object-assign/index.js delete mode 100644 node_modules/gulp-json-transform/node_modules/object-assign/license delete mode 100644 node_modules/gulp-json-transform/node_modules/object-assign/package.json delete mode 100644 node_modules/gulp-json-transform/node_modules/object-assign/readme.md delete mode 100644 node_modules/gulp-json-transform/node_modules/replace-ext/.npmignore delete mode 100644 node_modules/gulp-json-transform/node_modules/replace-ext/.travis.yml delete mode 100755 node_modules/gulp-json-transform/node_modules/replace-ext/LICENSE delete mode 100644 node_modules/gulp-json-transform/node_modules/replace-ext/README.md delete mode 100644 node_modules/gulp-json-transform/node_modules/replace-ext/index.js delete mode 100644 node_modules/gulp-json-transform/node_modules/replace-ext/package.json delete mode 100644 node_modules/gulp-json-transform/node_modules/replace-ext/test/main.js delete mode 100644 node_modules/gulp-json-transform/node_modules/vinyl/LICENSE delete mode 100644 node_modules/gulp-json-transform/node_modules/vinyl/README.md delete mode 100644 node_modules/gulp-json-transform/node_modules/vinyl/index.js delete mode 100644 node_modules/gulp-json-transform/node_modules/vinyl/lib/cloneBuffer.js delete mode 100644 node_modules/gulp-json-transform/node_modules/vinyl/lib/inspectStream.js delete mode 100644 node_modules/gulp-json-transform/node_modules/vinyl/lib/isBuffer.js delete mode 100644 node_modules/gulp-json-transform/node_modules/vinyl/lib/isNull.js delete mode 100644 node_modules/gulp-json-transform/node_modules/vinyl/lib/isStream.js delete mode 100644 node_modules/gulp-json-transform/node_modules/vinyl/package.json delete mode 100644 node_modules/gulp-sourcemaps/node_modules/clone-stats/LICENSE.md delete mode 100644 node_modules/gulp-sourcemaps/node_modules/clone-stats/README.md delete mode 100644 node_modules/gulp-sourcemaps/node_modules/clone-stats/index.js delete mode 100644 node_modules/gulp-sourcemaps/node_modules/clone-stats/package.json delete mode 100644 node_modules/gulp-sourcemaps/node_modules/clone-stats/test.js delete mode 100644 node_modules/gulp-sourcemaps/node_modules/replace-ext/.npmignore delete mode 100644 node_modules/gulp-sourcemaps/node_modules/replace-ext/.travis.yml delete mode 100755 node_modules/gulp-sourcemaps/node_modules/replace-ext/LICENSE delete mode 100644 node_modules/gulp-sourcemaps/node_modules/replace-ext/README.md delete mode 100644 node_modules/gulp-sourcemaps/node_modules/replace-ext/index.js delete mode 100644 node_modules/gulp-sourcemaps/node_modules/replace-ext/package.json delete mode 100644 node_modules/gulp-sourcemaps/node_modules/replace-ext/test/main.js delete mode 100644 node_modules/gulp-tar/node_modules/clone-stats/LICENSE.md delete mode 100644 node_modules/gulp-tar/node_modules/clone-stats/README.md delete mode 100644 node_modules/gulp-tar/node_modules/clone-stats/index.js delete mode 100644 node_modules/gulp-tar/node_modules/clone-stats/package.json delete mode 100644 node_modules/gulp-tar/node_modules/clone-stats/test.js delete mode 100755 node_modules/gulp-tar/node_modules/gulp-util/LICENSE delete mode 100644 node_modules/gulp-tar/node_modules/gulp-util/README.md delete mode 100644 node_modules/gulp-tar/node_modules/gulp-util/index.js delete mode 100644 node_modules/gulp-tar/node_modules/gulp-util/lib/PluginError.js delete mode 100644 node_modules/gulp-tar/node_modules/gulp-util/lib/buffer.js delete mode 100644 node_modules/gulp-tar/node_modules/gulp-util/lib/combine.js delete mode 100644 node_modules/gulp-tar/node_modules/gulp-util/lib/env.js delete mode 100644 node_modules/gulp-tar/node_modules/gulp-util/lib/isBuffer.js delete mode 100644 node_modules/gulp-tar/node_modules/gulp-util/lib/isNull.js delete mode 100644 node_modules/gulp-tar/node_modules/gulp-util/lib/isStream.js delete mode 100644 node_modules/gulp-tar/node_modules/gulp-util/lib/log.js delete mode 100644 node_modules/gulp-tar/node_modules/gulp-util/lib/noop.js delete mode 100644 node_modules/gulp-tar/node_modules/gulp-util/lib/template.js delete mode 120000 node_modules/gulp-tar/node_modules/gulp-util/node_modules/.bin/dateformat delete mode 100644 node_modules/gulp-tar/node_modules/gulp-util/node_modules/object-assign/index.js delete mode 100644 node_modules/gulp-tar/node_modules/gulp-util/node_modules/object-assign/license delete mode 100644 node_modules/gulp-tar/node_modules/gulp-util/node_modules/object-assign/package.json delete mode 100644 node_modules/gulp-tar/node_modules/gulp-util/node_modules/object-assign/readme.md delete mode 100644 node_modules/gulp-tar/node_modules/gulp-util/package.json delete mode 100644 node_modules/gulp-tar/node_modules/lodash._reinterpolate/LICENSE.txt delete mode 100644 node_modules/gulp-tar/node_modules/lodash._reinterpolate/README.md delete mode 100644 node_modules/gulp-tar/node_modules/lodash._reinterpolate/index.js delete mode 100644 node_modules/gulp-tar/node_modules/lodash._reinterpolate/package.json delete mode 100644 node_modules/gulp-tar/node_modules/lodash.template/LICENSE delete mode 100644 node_modules/gulp-tar/node_modules/lodash.template/README.md delete mode 100644 node_modules/gulp-tar/node_modules/lodash.template/index.js delete mode 100644 node_modules/gulp-tar/node_modules/lodash.template/package.json delete mode 100644 node_modules/gulp-tar/node_modules/replace-ext/.npmignore delete mode 100644 node_modules/gulp-tar/node_modules/replace-ext/.travis.yml delete mode 100755 node_modules/gulp-tar/node_modules/replace-ext/LICENSE delete mode 100644 node_modules/gulp-tar/node_modules/replace-ext/README.md delete mode 100644 node_modules/gulp-tar/node_modules/replace-ext/index.js delete mode 100644 node_modules/gulp-tar/node_modules/replace-ext/package.json delete mode 100644 node_modules/gulp-tar/node_modules/replace-ext/test/main.js delete mode 100644 node_modules/gulp-tar/node_modules/vinyl/LICENSE delete mode 100644 node_modules/gulp-tar/node_modules/vinyl/README.md delete mode 100644 node_modules/gulp-tar/node_modules/vinyl/index.js delete mode 100644 node_modules/gulp-tar/node_modules/vinyl/lib/cloneBuffer.js delete mode 100644 node_modules/gulp-tar/node_modules/vinyl/lib/inspectStream.js delete mode 100644 node_modules/gulp-tar/node_modules/vinyl/lib/isBuffer.js delete mode 100644 node_modules/gulp-tar/node_modules/vinyl/lib/isNull.js delete mode 100644 node_modules/gulp-tar/node_modules/vinyl/lib/isStream.js delete mode 100644 node_modules/gulp-tar/node_modules/vinyl/package.json delete mode 100644 node_modules/gulp-typescript/node_modules/clone-stats/LICENSE.md delete mode 100644 node_modules/gulp-typescript/node_modules/clone-stats/README.md delete mode 100644 node_modules/gulp-typescript/node_modules/clone-stats/index.js delete mode 100644 node_modules/gulp-typescript/node_modules/clone-stats/package.json delete mode 100644 node_modules/gulp-typescript/node_modules/clone-stats/test.js delete mode 100755 node_modules/gulp-typescript/node_modules/gulp-util/LICENSE delete mode 100644 node_modules/gulp-typescript/node_modules/gulp-util/README.md delete mode 100644 node_modules/gulp-typescript/node_modules/gulp-util/index.js delete mode 100644 node_modules/gulp-typescript/node_modules/gulp-util/lib/PluginError.js delete mode 100644 node_modules/gulp-typescript/node_modules/gulp-util/lib/buffer.js delete mode 100644 node_modules/gulp-typescript/node_modules/gulp-util/lib/combine.js delete mode 100644 node_modules/gulp-typescript/node_modules/gulp-util/lib/env.js delete mode 100644 node_modules/gulp-typescript/node_modules/gulp-util/lib/isBuffer.js delete mode 100644 node_modules/gulp-typescript/node_modules/gulp-util/lib/isNull.js delete mode 100644 node_modules/gulp-typescript/node_modules/gulp-util/lib/isStream.js delete mode 100644 node_modules/gulp-typescript/node_modules/gulp-util/lib/log.js delete mode 100644 node_modules/gulp-typescript/node_modules/gulp-util/lib/noop.js delete mode 100644 node_modules/gulp-typescript/node_modules/gulp-util/lib/template.js delete mode 120000 node_modules/gulp-typescript/node_modules/gulp-util/node_modules/.bin/dateformat delete mode 100644 node_modules/gulp-typescript/node_modules/gulp-util/package.json delete mode 100644 node_modules/gulp-typescript/node_modules/lodash._reinterpolate/LICENSE.txt delete mode 100644 node_modules/gulp-typescript/node_modules/lodash._reinterpolate/README.md delete mode 100644 node_modules/gulp-typescript/node_modules/lodash._reinterpolate/index.js delete mode 100644 node_modules/gulp-typescript/node_modules/lodash._reinterpolate/package.json delete mode 100644 node_modules/gulp-typescript/node_modules/lodash.template/LICENSE delete mode 100644 node_modules/gulp-typescript/node_modules/lodash.template/README.md delete mode 100644 node_modules/gulp-typescript/node_modules/lodash.template/index.js delete mode 100644 node_modules/gulp-typescript/node_modules/lodash.template/package.json delete mode 100644 node_modules/gulp-typescript/node_modules/object-assign/index.js delete mode 100644 node_modules/gulp-typescript/node_modules/object-assign/license delete mode 100644 node_modules/gulp-typescript/node_modules/object-assign/package.json delete mode 100644 node_modules/gulp-typescript/node_modules/object-assign/readme.md delete mode 100644 node_modules/gulp-typescript/node_modules/replace-ext/.npmignore delete mode 100644 node_modules/gulp-typescript/node_modules/replace-ext/.travis.yml delete mode 100755 node_modules/gulp-typescript/node_modules/replace-ext/LICENSE delete mode 100644 node_modules/gulp-typescript/node_modules/replace-ext/README.md delete mode 100644 node_modules/gulp-typescript/node_modules/replace-ext/index.js delete mode 100644 node_modules/gulp-typescript/node_modules/replace-ext/package.json delete mode 100644 node_modules/gulp-typescript/node_modules/replace-ext/test/main.js delete mode 100644 node_modules/gulp-typescript/node_modules/vinyl/LICENSE delete mode 100644 node_modules/gulp-typescript/node_modules/vinyl/README.md delete mode 100644 node_modules/gulp-typescript/node_modules/vinyl/index.js delete mode 100644 node_modules/gulp-typescript/node_modules/vinyl/lib/cloneBuffer.js delete mode 100644 node_modules/gulp-typescript/node_modules/vinyl/lib/inspectStream.js delete mode 100644 node_modules/gulp-typescript/node_modules/vinyl/lib/isBuffer.js delete mode 100644 node_modules/gulp-typescript/node_modules/vinyl/lib/isNull.js delete mode 100644 node_modules/gulp-typescript/node_modules/vinyl/lib/isStream.js delete mode 100644 node_modules/gulp-typescript/node_modules/vinyl/package.json delete mode 100644 node_modules/gulp-util/.npmignore delete mode 100644 node_modules/gulp-util/.travis.yml delete mode 100644 node_modules/gulp-util/lib/File.js delete mode 100644 node_modules/gulp-util/lib/beep.js delete mode 100644 node_modules/gulp-util/lib/colors.js delete mode 100644 node_modules/gulp-util/lib/date.js delete mode 100644 node_modules/gulp-util/lib/linefeed.js delete mode 100644 node_modules/gulp-util/lib/replaceExtension.js delete mode 120000 node_modules/gulp-util/node_modules/.bin/dateformat delete mode 100644 node_modules/gulp-util/node_modules/ansi-regex/index.js delete mode 100644 node_modules/gulp-util/node_modules/ansi-regex/package.json delete mode 100644 node_modules/gulp-util/node_modules/ansi-regex/readme.md delete mode 100644 node_modules/gulp-util/node_modules/ansi-styles/index.js delete mode 100644 node_modules/gulp-util/node_modules/ansi-styles/package.json delete mode 100644 node_modules/gulp-util/node_modules/ansi-styles/readme.md delete mode 100644 node_modules/gulp-util/node_modules/chalk/index.js delete mode 120000 node_modules/gulp-util/node_modules/chalk/node_modules/.bin/has-ansi delete mode 120000 node_modules/gulp-util/node_modules/chalk/node_modules/.bin/strip-ansi delete mode 120000 node_modules/gulp-util/node_modules/chalk/node_modules/.bin/supports-color delete mode 100644 node_modules/gulp-util/node_modules/chalk/package.json delete mode 100644 node_modules/gulp-util/node_modules/chalk/readme.md delete mode 100644 node_modules/gulp-util/node_modules/clone-stats/LICENSE.md delete mode 100644 node_modules/gulp-util/node_modules/clone-stats/README.md delete mode 100644 node_modules/gulp-util/node_modules/clone-stats/index.js delete mode 100644 node_modules/gulp-util/node_modules/clone-stats/package.json delete mode 100644 node_modules/gulp-util/node_modules/clone-stats/test.js delete mode 100755 node_modules/gulp-util/node_modules/has-ansi/cli.js delete mode 100644 node_modules/gulp-util/node_modules/has-ansi/index.js delete mode 100644 node_modules/gulp-util/node_modules/has-ansi/package.json delete mode 100644 node_modules/gulp-util/node_modules/has-ansi/readme.md delete mode 100644 node_modules/gulp-util/node_modules/isarray/README.md delete mode 100644 node_modules/gulp-util/node_modules/isarray/build/build.js delete mode 100644 node_modules/gulp-util/node_modules/isarray/component.json delete mode 100644 node_modules/gulp-util/node_modules/isarray/index.js delete mode 100644 node_modules/gulp-util/node_modules/isarray/package.json delete mode 100644 node_modules/gulp-util/node_modules/minimist/.travis.yml delete mode 100644 node_modules/gulp-util/node_modules/minimist/LICENSE delete mode 100644 node_modules/gulp-util/node_modules/minimist/example/parse.js delete mode 100644 node_modules/gulp-util/node_modules/minimist/index.js delete mode 100644 node_modules/gulp-util/node_modules/minimist/package.json delete mode 100644 node_modules/gulp-util/node_modules/minimist/readme.markdown delete mode 100644 node_modules/gulp-util/node_modules/minimist/test/all_bool.js delete mode 100644 node_modules/gulp-util/node_modules/minimist/test/bool.js delete mode 100644 node_modules/gulp-util/node_modules/minimist/test/dash.js delete mode 100644 node_modules/gulp-util/node_modules/minimist/test/default_bool.js delete mode 100644 node_modules/gulp-util/node_modules/minimist/test/dotted.js delete mode 100644 node_modules/gulp-util/node_modules/minimist/test/long.js delete mode 100644 node_modules/gulp-util/node_modules/minimist/test/num.js delete mode 100644 node_modules/gulp-util/node_modules/minimist/test/parse.js delete mode 100644 node_modules/gulp-util/node_modules/minimist/test/parse_modified.js delete mode 100644 node_modules/gulp-util/node_modules/minimist/test/short.js delete mode 100644 node_modules/gulp-util/node_modules/minimist/test/whitespace.js delete mode 100644 node_modules/gulp-util/node_modules/readable-stream/.npmignore delete mode 100644 node_modules/gulp-util/node_modules/readable-stream/LICENSE delete mode 100644 node_modules/gulp-util/node_modules/readable-stream/README.md delete mode 100644 node_modules/gulp-util/node_modules/readable-stream/duplex.js delete mode 100644 node_modules/gulp-util/node_modules/readable-stream/lib/_stream_duplex.js delete mode 100644 node_modules/gulp-util/node_modules/readable-stream/lib/_stream_passthrough.js delete mode 100644 node_modules/gulp-util/node_modules/readable-stream/lib/_stream_readable.js delete mode 100644 node_modules/gulp-util/node_modules/readable-stream/lib/_stream_transform.js delete mode 100644 node_modules/gulp-util/node_modules/readable-stream/lib/_stream_writable.js delete mode 100644 node_modules/gulp-util/node_modules/readable-stream/package.json delete mode 100644 node_modules/gulp-util/node_modules/readable-stream/passthrough.js delete mode 100644 node_modules/gulp-util/node_modules/readable-stream/readable.js delete mode 100644 node_modules/gulp-util/node_modules/readable-stream/transform.js delete mode 100644 node_modules/gulp-util/node_modules/readable-stream/writable.js delete mode 100755 node_modules/gulp-util/node_modules/strip-ansi/cli.js delete mode 100644 node_modules/gulp-util/node_modules/strip-ansi/index.js delete mode 100644 node_modules/gulp-util/node_modules/strip-ansi/package.json delete mode 100644 node_modules/gulp-util/node_modules/strip-ansi/readme.md delete mode 100755 node_modules/gulp-util/node_modules/supports-color/cli.js delete mode 100644 node_modules/gulp-util/node_modules/supports-color/index.js delete mode 100644 node_modules/gulp-util/node_modules/supports-color/package.json delete mode 100644 node_modules/gulp-util/node_modules/supports-color/readme.md delete mode 100644 node_modules/gulp-util/node_modules/through2/.npmignore delete mode 100644 node_modules/gulp-util/node_modules/through2/LICENSE delete mode 100644 node_modules/gulp-util/node_modules/through2/README.md delete mode 100644 node_modules/gulp-util/node_modules/through2/package.json delete mode 100644 node_modules/gulp-util/node_modules/through2/through2.js delete mode 100644 node_modules/gulp-util/node_modules/vinyl/.npmignore delete mode 100644 node_modules/gulp-util/node_modules/vinyl/.travis.yml mode change 100755 => 100644 node_modules/gulp-util/node_modules/vinyl/LICENSE delete mode 100644 node_modules/gulp-util/node_modules/vinyl/test/File.js delete mode 100644 node_modules/gulp-util/node_modules/vinyl/test/cloneBuffer.js delete mode 100644 node_modules/gulp-util/node_modules/vinyl/test/inspectStream.js delete mode 100644 node_modules/gulp-util/node_modules/vinyl/test/isBuffer.js delete mode 100644 node_modules/gulp-util/node_modules/vinyl/test/isNull.js delete mode 100644 node_modules/gulp-util/node_modules/vinyl/test/isStream.js delete mode 100644 node_modules/gulp-util/node_modules/xtend/.jshintrc delete mode 100644 node_modules/gulp-util/node_modules/xtend/.npmignore delete mode 100644 node_modules/gulp-util/node_modules/xtend/LICENCE delete mode 100644 node_modules/gulp-util/node_modules/xtend/Makefile delete mode 100644 node_modules/gulp-util/node_modules/xtend/README.md delete mode 100644 node_modules/gulp-util/node_modules/xtend/index.js delete mode 100644 node_modules/gulp-util/node_modules/xtend/mutable.js delete mode 100644 node_modules/gulp-util/node_modules/xtend/package.json delete mode 100644 node_modules/gulp-util/node_modules/xtend/test.js delete mode 100644 node_modules/gulp-zip/node_modules/clone-stats/LICENSE.md delete mode 100644 node_modules/gulp-zip/node_modules/clone-stats/README.md delete mode 100644 node_modules/gulp-zip/node_modules/clone-stats/index.js delete mode 100644 node_modules/gulp-zip/node_modules/clone-stats/package.json delete mode 100644 node_modules/gulp-zip/node_modules/clone-stats/test.js delete mode 100755 node_modules/gulp-zip/node_modules/gulp-util/LICENSE delete mode 100644 node_modules/gulp-zip/node_modules/gulp-util/README.md delete mode 100644 node_modules/gulp-zip/node_modules/gulp-util/index.js delete mode 100644 node_modules/gulp-zip/node_modules/gulp-util/lib/PluginError.js delete mode 100644 node_modules/gulp-zip/node_modules/gulp-util/lib/buffer.js delete mode 100644 node_modules/gulp-zip/node_modules/gulp-util/lib/combine.js delete mode 100644 node_modules/gulp-zip/node_modules/gulp-util/lib/env.js delete mode 100644 node_modules/gulp-zip/node_modules/gulp-util/lib/isBuffer.js delete mode 100644 node_modules/gulp-zip/node_modules/gulp-util/lib/isNull.js delete mode 100644 node_modules/gulp-zip/node_modules/gulp-util/lib/isStream.js delete mode 100644 node_modules/gulp-zip/node_modules/gulp-util/lib/log.js delete mode 100644 node_modules/gulp-zip/node_modules/gulp-util/lib/noop.js delete mode 100644 node_modules/gulp-zip/node_modules/gulp-util/lib/template.js delete mode 120000 node_modules/gulp-zip/node_modules/gulp-util/node_modules/.bin/dateformat delete mode 100644 node_modules/gulp-zip/node_modules/gulp-util/package.json delete mode 100644 node_modules/gulp-zip/node_modules/lodash._reinterpolate/LICENSE.txt delete mode 100644 node_modules/gulp-zip/node_modules/lodash._reinterpolate/README.md delete mode 100644 node_modules/gulp-zip/node_modules/lodash._reinterpolate/index.js delete mode 100644 node_modules/gulp-zip/node_modules/lodash._reinterpolate/package.json delete mode 100644 node_modules/gulp-zip/node_modules/lodash.template/LICENSE delete mode 100644 node_modules/gulp-zip/node_modules/lodash.template/README.md delete mode 100644 node_modules/gulp-zip/node_modules/lodash.template/index.js delete mode 100644 node_modules/gulp-zip/node_modules/lodash.template/package.json delete mode 100644 node_modules/gulp-zip/node_modules/object-assign/index.js delete mode 100644 node_modules/gulp-zip/node_modules/object-assign/license delete mode 100644 node_modules/gulp-zip/node_modules/object-assign/package.json delete mode 100644 node_modules/gulp-zip/node_modules/object-assign/readme.md delete mode 100644 node_modules/gulp-zip/node_modules/replace-ext/.npmignore delete mode 100644 node_modules/gulp-zip/node_modules/replace-ext/.travis.yml delete mode 100755 node_modules/gulp-zip/node_modules/replace-ext/LICENSE delete mode 100644 node_modules/gulp-zip/node_modules/replace-ext/README.md delete mode 100644 node_modules/gulp-zip/node_modules/replace-ext/index.js delete mode 100644 node_modules/gulp-zip/node_modules/replace-ext/package.json delete mode 100644 node_modules/gulp-zip/node_modules/replace-ext/test/main.js delete mode 100644 node_modules/gulp-zip/node_modules/vinyl/LICENSE delete mode 100644 node_modules/gulp-zip/node_modules/vinyl/README.md delete mode 100644 node_modules/gulp-zip/node_modules/vinyl/index.js delete mode 100644 node_modules/gulp-zip/node_modules/vinyl/lib/cloneBuffer.js delete mode 100644 node_modules/gulp-zip/node_modules/vinyl/lib/inspectStream.js delete mode 100644 node_modules/gulp-zip/node_modules/vinyl/lib/isBuffer.js delete mode 100644 node_modules/gulp-zip/node_modules/vinyl/lib/isNull.js delete mode 100644 node_modules/gulp-zip/node_modules/vinyl/lib/isStream.js delete mode 100644 node_modules/gulp-zip/node_modules/vinyl/package.json delete mode 100644 node_modules/gulp/node_modules/clone-stats/LICENSE.md delete mode 100644 node_modules/gulp/node_modules/clone-stats/README.md delete mode 100644 node_modules/gulp/node_modules/clone-stats/index.js delete mode 100644 node_modules/gulp/node_modules/clone-stats/package.json delete mode 100644 node_modules/gulp/node_modules/clone-stats/test.js delete mode 100755 node_modules/gulp/node_modules/gulp-util/LICENSE delete mode 100644 node_modules/gulp/node_modules/gulp-util/README.md delete mode 100644 node_modules/gulp/node_modules/gulp-util/index.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/lib/PluginError.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/lib/buffer.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/lib/combine.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/lib/env.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/lib/isBuffer.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/lib/isNull.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/lib/isStream.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/lib/log.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/lib/noop.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/lib/template.js delete mode 120000 node_modules/gulp/node_modules/gulp-util/node_modules/.bin/dateformat delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/clone/.npmignore delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/clone/.travis.yml delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/clone/LICENSE delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/clone/README.md delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/clone/clone.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/clone/package.json delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/clone/test-apart-ctx.html delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/clone/test.html delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/clone/test.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/readable-stream/.npmignore delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/readable-stream/.travis.yml delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/readable-stream/.zuul.yml delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/readable-stream/LICENSE delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/readable-stream/README.md delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/readable-stream/doc/stream.markdown delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/readable-stream/duplex.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/readable-stream/lib/_stream_duplex.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/readable-stream/lib/_stream_passthrough.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/readable-stream/lib/_stream_readable.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/readable-stream/lib/_stream_transform.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/readable-stream/lib/_stream_writable.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/readable-stream/package.json delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/readable-stream/passthrough.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/readable-stream/readable.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/readable-stream/transform.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/readable-stream/writable.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/through2/.npmignore delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/through2/LICENSE delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/through2/README.md delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/through2/package.json delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/through2/through2.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/vinyl/LICENSE delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/vinyl/README.md delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/vinyl/index.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/vinyl/lib/cloneBuffer.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/vinyl/lib/inspectStream.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/vinyl/lib/isBuffer.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/vinyl/lib/isNull.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/vinyl/lib/isStream.js delete mode 100644 node_modules/gulp/node_modules/gulp-util/node_modules/vinyl/package.json delete mode 100644 node_modules/gulp/node_modules/gulp-util/package.json delete mode 100644 node_modules/gulp/node_modules/lodash._reinterpolate/LICENSE.txt delete mode 100644 node_modules/gulp/node_modules/lodash._reinterpolate/README.md delete mode 100644 node_modules/gulp/node_modules/lodash._reinterpolate/index.js delete mode 100644 node_modules/gulp/node_modules/lodash._reinterpolate/package.json delete mode 100644 node_modules/gulp/node_modules/lodash.template/LICENSE delete mode 100644 node_modules/gulp/node_modules/lodash.template/README.md delete mode 100644 node_modules/gulp/node_modules/lodash.template/index.js delete mode 100644 node_modules/gulp/node_modules/lodash.template/package.json delete mode 100644 node_modules/gulp/node_modules/object-assign/index.js delete mode 100644 node_modules/gulp/node_modules/object-assign/license delete mode 100644 node_modules/gulp/node_modules/object-assign/package.json delete mode 100644 node_modules/gulp/node_modules/object-assign/readme.md delete mode 100644 node_modules/gulp/node_modules/replace-ext/.npmignore delete mode 100644 node_modules/gulp/node_modules/replace-ext/.travis.yml delete mode 100755 node_modules/gulp/node_modules/replace-ext/LICENSE delete mode 100644 node_modules/gulp/node_modules/replace-ext/README.md delete mode 100644 node_modules/gulp/node_modules/replace-ext/index.js delete mode 100644 node_modules/gulp/node_modules/replace-ext/package.json delete mode 100644 node_modules/gulp/node_modules/replace-ext/test/main.js delete mode 100644 node_modules/hosted-git-info/.npmignore delete mode 100644 node_modules/is-buffer/.travis.yml delete mode 100644 node_modules/is-buffer/.zuul.yml delete mode 100644 node_modules/isexe/access.js delete mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/LICENSE delete mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/README.md delete mode 100755 node_modules/istanbul-lib-instrument/node_modules/semver/bin/semver delete mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/package.json delete mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/range.bnf delete mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/semver.js delete mode 100644 node_modules/js-tokens/changelog.md delete mode 100644 node_modules/js-tokens/readme.md delete mode 100644 node_modules/lodash._reunescapedhtml/node_modules/lodash.keys/LICENSE.txt delete mode 100644 node_modules/lodash._reunescapedhtml/node_modules/lodash.keys/README.md delete mode 100644 node_modules/lodash._reunescapedhtml/node_modules/lodash.keys/index.js delete mode 100644 node_modules/lodash._reunescapedhtml/node_modules/lodash.keys/package.json delete mode 100644 node_modules/lodash.defaults/node_modules/lodash.keys/LICENSE.txt delete mode 100644 node_modules/lodash.defaults/node_modules/lodash.keys/README.md delete mode 100644 node_modules/lodash.defaults/node_modules/lodash.keys/index.js delete mode 100644 node_modules/lodash.defaults/node_modules/lodash.keys/package.json delete mode 100644 node_modules/lodash.escape/LICENSE delete mode 100644 node_modules/lodash.keys/LICENSE delete mode 100644 node_modules/lodash.template/LICENSE.txt delete mode 100644 node_modules/lodash.template/node_modules/lodash.escape/LICENSE.txt delete mode 100644 node_modules/lodash.template/node_modules/lodash.keys/LICENSE.txt delete mode 100644 node_modules/lodash.template/node_modules/lodash.templatesettings/LICENSE.txt delete mode 100644 node_modules/lodash.template/node_modules/lodash.templatesettings/README.md delete mode 100644 node_modules/lodash.template/node_modules/lodash.templatesettings/index.js delete mode 100644 node_modules/lodash.template/node_modules/lodash.templatesettings/package.json delete mode 100644 node_modules/lodash.values/node_modules/lodash.keys/LICENSE.txt delete mode 100644 node_modules/lodash.values/node_modules/lodash.keys/README.md delete mode 100644 node_modules/lodash.values/node_modules/lodash.keys/index.js delete mode 100644 node_modules/lodash.values/node_modules/lodash.keys/package.json delete mode 100644 node_modules/lodash/_assignInDefaults.js delete mode 100644 node_modules/lodash/_mergeDefaults.js delete mode 100644 node_modules/ms/.npmignore delete mode 100644 node_modules/ms/History.md delete mode 100644 node_modules/ms/LICENSE delete mode 100644 node_modules/normalize-package-data/node_modules/semver/LICENSE delete mode 100644 node_modules/normalize-package-data/node_modules/semver/README.md delete mode 100755 node_modules/normalize-package-data/node_modules/semver/bin/semver delete mode 100644 node_modules/normalize-package-data/node_modules/semver/package.json delete mode 100644 node_modules/normalize-package-data/node_modules/semver/range.bnf delete mode 100644 node_modules/normalize-package-data/node_modules/semver/semver.js delete mode 100644 node_modules/normalize-package-data/test/normalize.js~ delete mode 100644 node_modules/osenv/.npmignore delete mode 100644 node_modules/osenv/.travis.yml delete mode 100644 node_modules/osenv/LICENSE delete mode 100644 node_modules/osenv/README.md delete mode 100644 node_modules/osenv/osenv.js delete mode 100644 node_modules/osenv/package.json delete mode 100644 node_modules/osenv/test/unix.js delete mode 100644 node_modules/osenv/test/windows.js delete mode 100644 node_modules/osenv/x.tap delete mode 100644 node_modules/sax/LICENSE-W3C.html delete mode 100644 node_modules/selenium-webdriver/lib/firefox/amd64/libnoblur64.so delete mode 100644 node_modules/selenium-webdriver/lib/firefox/i386/libnoblur.so delete mode 100644 node_modules/semver/.npmignore delete mode 100644 node_modules/semver/.travis.yml delete mode 100644 node_modules/semver/Makefile delete mode 100644 node_modules/semver/foot.js.txt delete mode 100644 node_modules/semver/head.js.txt delete mode 100644 node_modules/semver/semver.browser.js delete mode 100644 node_modules/semver/semver.browser.js.gz delete mode 100644 node_modules/semver/semver.min.js delete mode 100644 node_modules/semver/semver.min.js.gz delete mode 100644 node_modules/semver/test/amd.js delete mode 100644 node_modules/semver/test/big-numbers.js delete mode 100644 node_modules/semver/test/clean.js delete mode 100644 node_modules/semver/test/gtr.js delete mode 100644 node_modules/semver/test/index.js delete mode 100644 node_modules/semver/test/ltr.js delete mode 100644 node_modules/semver/test/major-minor-patch.js delete mode 100644 node_modules/semver/test/no-module.js delete mode 100644 node_modules/through2/LICENSE delete mode 100644 node_modules/typescript/Gulpfile.ts delete mode 100644 node_modules/vinyl-fs/node_modules/clone-stats/LICENSE.md delete mode 100644 node_modules/vinyl-fs/node_modules/clone-stats/README.md delete mode 100644 node_modules/vinyl-fs/node_modules/clone-stats/index.js delete mode 100644 node_modules/vinyl-fs/node_modules/clone-stats/package.json delete mode 100644 node_modules/vinyl-fs/node_modules/clone-stats/test.js delete mode 100644 node_modules/vinyl-fs/node_modules/replace-ext/.npmignore delete mode 100644 node_modules/vinyl-fs/node_modules/replace-ext/.travis.yml delete mode 100755 node_modules/vinyl-fs/node_modules/replace-ext/LICENSE delete mode 100644 node_modules/vinyl-fs/node_modules/replace-ext/README.md delete mode 100644 node_modules/vinyl-fs/node_modules/replace-ext/index.js delete mode 100644 node_modules/vinyl-fs/node_modules/replace-ext/package.json delete mode 100644 node_modules/vinyl-fs/node_modules/replace-ext/test/main.js delete mode 100644 src/cryptoLib.ts delete mode 100644 src/moduleTrampoline.ts delete mode 100644 src/pages/debug.html rename src/{popup => pages}/popup.css (100%) rename src/{popup => pages}/popup.html (50%) rename src/{popup => pages}/popup.tsx (92%) delete mode 100644 src/vendor/URI.js delete mode 100644 src/vendor/jed.d.ts delete mode 120000 src/vendor/jed.js delete mode 100644 src/vendor/react-dom.dev.js delete mode 120000 src/vendor/react-dom.js delete mode 100644 src/vendor/react-dom.min.js delete mode 100644 src/vendor/react.dev.js delete mode 120000 src/vendor/react.js delete mode 100644 src/vendor/react.min.js delete mode 100644 src/vendor/system-csp-production.src.js delete mode 100644 thirdparty/README delete mode 100644 thirdparty/URI.js/.editorconfig delete mode 100644 thirdparty/URI.js/.gitignore delete mode 100644 thirdparty/URI.js/.jshintrc delete mode 100644 thirdparty/URI.js/CHANGELOG.md delete mode 100644 thirdparty/URI.js/Gruntfile.js delete mode 100644 thirdparty/URI.js/LICENSE.txt delete mode 100644 thirdparty/URI.js/README.md delete mode 100644 thirdparty/URI.js/about-uris.html delete mode 100644 thirdparty/URI.js/bower.json delete mode 100644 thirdparty/URI.js/build.html delete mode 100644 thirdparty/URI.js/build.js delete mode 100644 thirdparty/URI.js/contributing.md delete mode 100644 thirdparty/URI.js/docs.html delete mode 100644 thirdparty/URI.js/index.html delete mode 100644 thirdparty/URI.js/jquery-1.10.2.min.js delete mode 100644 thirdparty/URI.js/jquery-1.7.2.min.js delete mode 100644 thirdparty/URI.js/jquery-1.8.2.min.js delete mode 100644 thirdparty/URI.js/jquery-1.9.1.min.js delete mode 100644 thirdparty/URI.js/jquery-uri-plugin.html delete mode 100644 thirdparty/URI.js/package.json delete mode 100644 thirdparty/URI.js/prettify/lang-apollo.js delete mode 100644 thirdparty/URI.js/prettify/lang-clj.js delete mode 100644 thirdparty/URI.js/prettify/lang-css.js delete mode 100644 thirdparty/URI.js/prettify/lang-go.js delete mode 100644 thirdparty/URI.js/prettify/lang-hs.js delete mode 100644 thirdparty/URI.js/prettify/lang-lisp.js delete mode 100644 thirdparty/URI.js/prettify/lang-lua.js delete mode 100644 thirdparty/URI.js/prettify/lang-ml.js delete mode 100644 thirdparty/URI.js/prettify/lang-n.js delete mode 100644 thirdparty/URI.js/prettify/lang-proto.js delete mode 100644 thirdparty/URI.js/prettify/lang-scala.js delete mode 100644 thirdparty/URI.js/prettify/lang-sql.js delete mode 100644 thirdparty/URI.js/prettify/lang-tex.js delete mode 100644 thirdparty/URI.js/prettify/lang-vb.js delete mode 100644 thirdparty/URI.js/prettify/lang-vhdl.js delete mode 100644 thirdparty/URI.js/prettify/lang-wiki.js delete mode 100644 thirdparty/URI.js/prettify/lang-xq.js delete mode 100644 thirdparty/URI.js/prettify/lang-yaml.js delete mode 100644 thirdparty/URI.js/prettify/prettify.css delete mode 100644 thirdparty/URI.js/prettify/prettify.js delete mode 100644 thirdparty/URI.js/prettify/prettify.sunburst.css delete mode 100644 thirdparty/URI.js/screen.css delete mode 100644 thirdparty/URI.js/screen.js delete mode 100644 thirdparty/URI.js/src/IPv6.js delete mode 100644 thirdparty/URI.js/src/SecondLevelDomains.js delete mode 100644 thirdparty/URI.js/src/URI.fragmentQuery.js delete mode 100644 thirdparty/URI.js/src/URI.fragmentURI.js delete mode 100644 thirdparty/URI.js/src/URI.js delete mode 100644 thirdparty/URI.js/src/URI.min.js delete mode 100644 thirdparty/URI.js/src/URITemplate.js delete mode 100644 thirdparty/URI.js/src/jquery.URI.js delete mode 100644 thirdparty/URI.js/src/jquery.URI.min.js delete mode 100644 thirdparty/URI.js/src/punycode.js delete mode 100644 thirdparty/URI.js/test/index.html delete mode 100644 thirdparty/URI.js/test/pre_libs.js delete mode 100644 thirdparty/URI.js/test/qunit/qunit-composite.css delete mode 100644 thirdparty/URI.js/test/qunit/qunit-composite.js delete mode 100644 thirdparty/URI.js/test/qunit/qunit.css delete mode 100644 thirdparty/URI.js/test/qunit/qunit.js delete mode 100644 thirdparty/URI.js/test/test.URI.html delete mode 100644 thirdparty/URI.js/test/test.fragmentQuery.html delete mode 100644 thirdparty/URI.js/test/test.fragmentURI.html delete mode 100644 thirdparty/URI.js/test/test.jQuery-1.10.html delete mode 100644 thirdparty/URI.js/test/test.jQuery-1.7.html delete mode 100644 thirdparty/URI.js/test/test.jQuery-1.8.html delete mode 100644 thirdparty/URI.js/test/test.jQuery-1.9.html delete mode 100644 thirdparty/URI.js/test/test.js delete mode 100644 thirdparty/URI.js/test/test_fragmentQuery.js delete mode 100644 thirdparty/URI.js/test/test_fragmentURI.js delete mode 100644 thirdparty/URI.js/test/test_jim.js delete mode 100644 thirdparty/URI.js/test/test_jquery.js delete mode 100644 thirdparty/URI.js/test/test_template.js delete mode 100644 thirdparty/URI.js/test/urls.js delete mode 100644 thirdparty/URI.js/uri-template.html delete mode 100644 thirdparty/URI.js/utils/SLDs.php delete mode 100644 thirdparty/URI.js/utils/sld.js delete mode 100644 thirdparty/jed/.gitignore delete mode 100644 thirdparty/jed/.travis.yml delete mode 100644 thirdparty/jed/LICENSE delete mode 100644 thirdparty/jed/Makefile delete mode 100644 thirdparty/jed/README.md delete mode 100644 thirdparty/jed/jed.js delete mode 100644 thirdparty/jed/package.json delete mode 100644 thirdparty/jed/plurals.jison delete mode 100644 thirdparty/jed/test/common.js delete mode 100644 thirdparty/jed/test/index.html delete mode 100644 thirdparty/jed/test/jquery.min.js delete mode 100644 thirdparty/jed/test/tests.js delete mode 100644 thirdparty/systemjs/.agignore delete mode 100644 thirdparty/systemjs/.gitignore delete mode 100644 thirdparty/systemjs/.travis.yml delete mode 100644 thirdparty/systemjs/LICENSE delete mode 100755 thirdparty/systemjs/Makefile delete mode 100644 thirdparty/systemjs/README.md delete mode 100644 thirdparty/systemjs/bench/cjs-sample/cjs.js delete mode 100644 thirdparty/systemjs/bench/config-example/config.js delete mode 100644 thirdparty/systemjs/bench/config-example/normalize-data.js delete mode 100644 thirdparty/systemjs/bench/config-example/pkg-configs.js delete mode 100644 thirdparty/systemjs/bench/get-cjs-deps.js delete mode 100644 thirdparty/systemjs/bench/normalize-perf.js delete mode 100644 thirdparty/systemjs/bower.json delete mode 100644 thirdparty/systemjs/dist/system-csp-production.js delete mode 100644 thirdparty/systemjs/dist/system-csp-production.js.map delete mode 100644 thirdparty/systemjs/dist/system-csp-production.src.js delete mode 100644 thirdparty/systemjs/dist/system-polyfills.js delete mode 100644 thirdparty/systemjs/dist/system-polyfills.js.map delete mode 100644 thirdparty/systemjs/dist/system-polyfills.src.js delete mode 100644 thirdparty/systemjs/dist/system-register-only.js delete mode 100644 thirdparty/systemjs/dist/system-register-only.js.map delete mode 100644 thirdparty/systemjs/dist/system-register-only.src.js delete mode 100644 thirdparty/systemjs/dist/system.js delete mode 100644 thirdparty/systemjs/dist/system.js.map delete mode 100644 thirdparty/systemjs/dist/system.src.js delete mode 100644 thirdparty/systemjs/docs/config-api.md delete mode 100644 thirdparty/systemjs/docs/creating-plugins.md delete mode 100644 thirdparty/systemjs/docs/es6-modules-overview.md delete mode 100644 thirdparty/systemjs/docs/module-formats.md delete mode 100644 thirdparty/systemjs/docs/overview.md delete mode 100644 thirdparty/systemjs/docs/production-workflows.md delete mode 100644 thirdparty/systemjs/docs/system-api.md delete mode 100644 thirdparty/systemjs/index.js delete mode 100644 thirdparty/systemjs/lib/alias.js delete mode 100644 thirdparty/systemjs/lib/amd-helpers.js delete mode 100644 thirdparty/systemjs/lib/amd.js delete mode 100644 thirdparty/systemjs/lib/bundles.js delete mode 100644 thirdparty/systemjs/lib/cjs-helpers.js delete mode 100644 thirdparty/systemjs/lib/cjs.js delete mode 100644 thirdparty/systemjs/lib/conditionals.js delete mode 100644 thirdparty/systemjs/lib/core.js delete mode 100644 thirdparty/systemjs/lib/createSystem.js delete mode 100644 thirdparty/systemjs/lib/depCache.js delete mode 100644 thirdparty/systemjs/lib/esm.js delete mode 100644 thirdparty/systemjs/lib/global-eval.js delete mode 100644 thirdparty/systemjs/lib/global-helpers.js delete mode 100644 thirdparty/systemjs/lib/global.js delete mode 100644 thirdparty/systemjs/lib/legacy-transpiler.js delete mode 100644 thirdparty/systemjs/lib/loader-wrapper-end.js delete mode 100644 thirdparty/systemjs/lib/loader-wrapper-start.js delete mode 100644 thirdparty/systemjs/lib/meta.js delete mode 100644 thirdparty/systemjs/lib/package.js delete mode 100644 thirdparty/systemjs/lib/paths.js delete mode 100644 thirdparty/systemjs/lib/perf.js delete mode 100644 thirdparty/systemjs/lib/plugins.js delete mode 100644 thirdparty/systemjs/lib/polyfills-bootstrap.js delete mode 100644 thirdparty/systemjs/lib/proto.js delete mode 100644 thirdparty/systemjs/lib/register.js delete mode 100644 thirdparty/systemjs/lib/scriptLoader.js delete mode 100644 thirdparty/systemjs/lib/scriptOnly.js delete mode 100644 thirdparty/systemjs/lib/system-fetch.js delete mode 100644 thirdparty/systemjs/lib/system-only-resolve.js delete mode 100644 thirdparty/systemjs/lib/url-polyfill.js delete mode 100644 thirdparty/systemjs/lib/wrapper-end.js delete mode 100644 thirdparty/systemjs/lib/wrapper-start.js delete mode 100644 thirdparty/systemjs/package.json delete mode 100644 thirdparty/systemjs/test/test-babel-runtime.html delete mode 100644 thirdparty/systemjs/test/test-babel.html delete mode 100644 thirdparty/systemjs/test/test-babel.js delete mode 100644 thirdparty/systemjs/test/test-csp-inline.html delete mode 100644 thirdparty/systemjs/test/test-csp.html delete mode 100644 thirdparty/systemjs/test/test-jsextensions.html delete mode 100644 thirdparty/systemjs/test/test-register-only.html delete mode 100644 thirdparty/systemjs/test/test-tracer.html delete mode 100644 thirdparty/systemjs/test/test-traceur.html delete mode 100644 thirdparty/systemjs/test/test-traceur.js delete mode 100644 thirdparty/systemjs/test/test-typescript.html delete mode 100644 thirdparty/systemjs/test/test-typescript.js delete mode 100644 thirdparty/systemjs/test/test.js delete mode 100644 thirdparty/systemjs/test/tests/#.js delete mode 100644 thirdparty/systemjs/test/tests/advanced-plugin.js delete mode 100644 thirdparty/systemjs/test/tests/all-circular1.js delete mode 100644 thirdparty/systemjs/test/tests/all-circular2.js delete mode 100644 thirdparty/systemjs/test/tests/all-circular3.js delete mode 100644 thirdparty/systemjs/test/tests/all-circular4.js delete mode 100644 thirdparty/systemjs/test/tests/all-layers1.js delete mode 100644 thirdparty/systemjs/test/tests/all-layers2.js delete mode 100644 thirdparty/systemjs/test/tests/all-layers3.js delete mode 100644 thirdparty/systemjs/test/tests/all-layers4.js delete mode 100644 thirdparty/systemjs/test/tests/amd-bundle.js delete mode 100644 thirdparty/systemjs/test/tests/amd-circular1.js delete mode 100644 thirdparty/systemjs/test/tests/amd-circular2.js delete mode 100644 thirdparty/systemjs/test/tests/amd-cjs-module.js delete mode 100644 thirdparty/systemjs/test/tests/amd-contextual.js delete mode 100644 thirdparty/systemjs/test/tests/amd-dep-A.js delete mode 100644 thirdparty/systemjs/test/tests/amd-dep-B.js delete mode 100644 thirdparty/systemjs/test/tests/amd-dep.js delete mode 100644 thirdparty/systemjs/test/tests/amd-dynamic-require.js delete mode 100644 thirdparty/systemjs/test/tests/amd-dynamic.js delete mode 100644 thirdparty/systemjs/test/tests/amd-extra-deps.js delete mode 100644 thirdparty/systemjs/test/tests/amd-format.js delete mode 100644 thirdparty/systemjs/test/tests/amd-module-2.js delete mode 100644 thirdparty/systemjs/test/tests/amd-module-3.js delete mode 100644 thirdparty/systemjs/test/tests/amd-module-bom.js delete mode 100644 thirdparty/systemjs/test/tests/amd-module.js delete mode 100644 thirdparty/systemjs/test/tests/amd-require.js delete mode 100644 thirdparty/systemjs/test/tests/amd-simplified-cjs-aliased-require1.js delete mode 100644 thirdparty/systemjs/test/tests/amd-simplified-cjs-aliased-require2.js delete mode 100644 thirdparty/systemjs/test/tests/anon-named.js delete mode 100644 thirdparty/systemjs/test/tests/async.js delete mode 100644 thirdparty/systemjs/test/tests/bootstrap@3.1.1/test.coffee delete mode 100644 thirdparty/systemjs/test/tests/branch-boolean.js delete mode 100644 thirdparty/systemjs/test/tests/branch-ie.js delete mode 100644 thirdparty/systemjs/test/tests/bundle.js delete mode 100644 thirdparty/systemjs/test/tests/cjs-circular1.js delete mode 100644 thirdparty/systemjs/test/tests/cjs-circular2.js delete mode 100644 thirdparty/systemjs/test/tests/cjs-exports-bom.js delete mode 100644 thirdparty/systemjs/test/tests/cjs-exports-dep.js delete mode 100644 thirdparty/systemjs/test/tests/cjs-exports.js delete mode 100644 thirdparty/systemjs/test/tests/cjs-format.js delete mode 100644 thirdparty/systemjs/test/tests/cjs-globals.js delete mode 100644 thirdparty/systemjs/test/tests/cjs-loading-plugin.js delete mode 100644 thirdparty/systemjs/test/tests/cjs-module-bom.js delete mode 100644 thirdparty/systemjs/test/tests/cjs-named-export.js delete mode 100644 thirdparty/systemjs/test/tests/cjs-process.js delete mode 100644 thirdparty/systemjs/test/tests/cjs-resolve.js delete mode 100644 thirdparty/systemjs/test/tests/cjs-this.js delete mode 100644 thirdparty/systemjs/test/tests/common-js-dep.js delete mode 100644 thirdparty/systemjs/test/tests/common-js-module.js delete mode 100644 thirdparty/systemjs/test/tests/commonjs-d.js delete mode 100644 thirdparty/systemjs/test/tests/commonjs-d2.js delete mode 100644 thirdparty/systemjs/test/tests/commonjs-globals.js delete mode 100644 thirdparty/systemjs/test/tests/commonjs-requires.js delete mode 100644 thirdparty/systemjs/test/tests/commonjs-variation.js delete mode 100644 thirdparty/systemjs/test/tests/commonjs-variation2.js delete mode 100644 thirdparty/systemjs/test/tests/compiled.coffee delete mode 100644 thirdparty/systemjs/test/tests/compiler-plugin.js delete mode 100644 thirdparty/systemjs/test/tests/compiler-test.coffee delete mode 100644 thirdparty/systemjs/test/tests/connected-tree/a.js delete mode 100644 thirdparty/systemjs/test/tests/connected-tree/b.js delete mode 100644 thirdparty/systemjs/test/tests/connected-tree/c.js delete mode 100644 thirdparty/systemjs/test/tests/contextual-map-dep.js delete mode 100644 thirdparty/systemjs/test/tests/contextual-test/contextual-map.js delete mode 100644 thirdparty/systemjs/test/tests/cs-loader.js delete mode 100644 thirdparty/systemjs/test/tests/cs/dep.js delete mode 100644 thirdparty/systemjs/test/tests/cs/main.js delete mode 100644 thirdparty/systemjs/test/tests/csp/integrity.js delete mode 100644 thirdparty/systemjs/test/tests/csp/nonce.js delete mode 100644 thirdparty/systemjs/test/tests/csp/nonce2.js delete mode 100644 thirdparty/systemjs/test/tests/css.css delete mode 100644 thirdparty/systemjs/test/tests/css.js delete mode 100644 thirdparty/systemjs/test/tests/deep/deep-dep.js delete mode 100644 thirdparty/systemjs/test/tests/deep/deep.js delete mode 100644 thirdparty/systemjs/test/tests/default1-dep.js delete mode 100644 thirdparty/systemjs/test/tests/default1.js delete mode 100644 thirdparty/systemjs/test/tests/default2.js delete mode 100644 thirdparty/systemjs/test/tests/default3.js delete mode 100644 thirdparty/systemjs/test/tests/dep.js delete mode 100644 thirdparty/systemjs/test/tests/duplicateDeps/m1.js delete mode 100644 thirdparty/systemjs/test/tests/duplicateDeps/m2.js delete mode 100644 thirdparty/systemjs/test/tests/eaa-amd.js delete mode 100644 thirdparty/systemjs/test/tests/eaa-es6.js delete mode 100644 thirdparty/systemjs/test/tests/empty-es6.js delete mode 100644 thirdparty/systemjs/test/tests/ep/some-repo/main.js delete mode 100644 thirdparty/systemjs/test/tests/error-loader.js delete mode 100644 thirdparty/systemjs/test/tests/error-loader2.js delete mode 100644 thirdparty/systemjs/test/tests/error.js delete mode 100644 thirdparty/systemjs/test/tests/es-module-flag.js delete mode 100644 thirdparty/systemjs/test/tests/es-named-import-cjs-cjs.js delete mode 100644 thirdparty/systemjs/test/tests/es-named-import-cjs.js delete mode 100644 thirdparty/systemjs/test/tests/es6-and-amd.js delete mode 100644 thirdparty/systemjs/test/tests/es6-circular1.js delete mode 100644 thirdparty/systemjs/test/tests/es6-circular2.js delete mode 100644 thirdparty/systemjs/test/tests/es6-cjs-named-export.js delete mode 100644 thirdparty/systemjs/test/tests/es6-detection1.js delete mode 100644 thirdparty/systemjs/test/tests/es6-format.js delete mode 100644 thirdparty/systemjs/test/tests/es6-import-star-amd.js delete mode 100644 thirdparty/systemjs/test/tests/es6-loading-amd-dep.js delete mode 100644 thirdparty/systemjs/test/tests/es6-loading-amd.js delete mode 100644 thirdparty/systemjs/test/tests/es6-plugin.js delete mode 100644 thirdparty/systemjs/test/tests/esm-dep.js delete mode 100644 thirdparty/systemjs/test/tests/esm-with-deps.js delete mode 100644 thirdparty/systemjs/test/tests/export-star.js delete mode 100644 thirdparty/systemjs/test/tests/foo.js delete mode 100644 thirdparty/systemjs/test/tests/global-dep.js delete mode 100644 thirdparty/systemjs/test/tests/global-encapsulation.js delete mode 100644 thirdparty/systemjs/test/tests/global-exports-array.js delete mode 100644 thirdparty/systemjs/test/tests/global-inaccessible-props.js delete mode 100644 thirdparty/systemjs/test/tests/global-inline-dep.js delete mode 100644 thirdparty/systemjs/test/tests/global-inline-export.js delete mode 100644 thirdparty/systemjs/test/tests/global-multi-diff.js delete mode 100644 thirdparty/systemjs/test/tests/global-multi.js delete mode 100644 thirdparty/systemjs/test/tests/global-shim-amd.js delete mode 100644 thirdparty/systemjs/test/tests/global-shim-config-dep.js delete mode 100644 thirdparty/systemjs/test/tests/global-shim-config-exports.js delete mode 100644 thirdparty/systemjs/test/tests/global-shim-config.js delete mode 100644 thirdparty/systemjs/test/tests/global-single-compiled.js delete mode 100644 thirdparty/systemjs/test/tests/global-single.js delete mode 100644 thirdparty/systemjs/test/tests/global-with-export.js delete mode 100644 thirdparty/systemjs/test/tests/global.js delete mode 100644 thirdparty/systemjs/test/tests/group-test.js delete mode 100644 thirdparty/systemjs/test/tests/hbs.hbs delete mode 100644 thirdparty/systemjs/test/tests/inline-depends-dep.js delete mode 100644 thirdparty/systemjs/test/tests/inline-depends.js delete mode 100644 thirdparty/systemjs/test/tests/jquery-named.js delete mode 100644 thirdparty/systemjs/test/tests/jquery.js delete mode 100644 thirdparty/systemjs/test/tests/legacy-plugin.js delete mode 100644 thirdparty/systemjs/test/tests/loader-scoping.js delete mode 100644 thirdparty/systemjs/test/tests/main-bundle.js delete mode 100644 thirdparty/systemjs/test/tests/main-dep.js delete mode 100644 thirdparty/systemjs/test/tests/main.js delete mode 100644 thirdparty/systemjs/test/tests/map-test-dep.js delete mode 100644 thirdparty/systemjs/test/tests/map-test.js delete mode 100644 thirdparty/systemjs/test/tests/map-test/sub.js delete mode 100644 thirdparty/systemjs/test/tests/map-version.js delete mode 100644 thirdparty/systemjs/test/tests/meta-deps.js delete mode 100644 thirdparty/systemjs/test/tests/meta-override.js delete mode 100644 thirdparty/systemjs/test/tests/mixed-bundle.js delete mode 100644 thirdparty/systemjs/test/tests/modA.js delete mode 100644 thirdparty/systemjs/test/tests/modC.js delete mode 100644 thirdparty/systemjs/test/tests/module-name.js delete mode 100644 thirdparty/systemjs/test/tests/module.js delete mode 100644 thirdparty/systemjs/test/tests/multiple-anonymous.js delete mode 100644 thirdparty/systemjs/test/tests/mypackage/index.js delete mode 100644 thirdparty/systemjs/test/tests/mypackage/lib/bar.js delete mode 100644 thirdparty/systemjs/test/tests/mypackage/src/foo.js delete mode 100644 thirdparty/systemjs/test/tests/nameddefine.js delete mode 100644 thirdparty/systemjs/test/tests/no-default-ext/file.ext delete mode 100644 thirdparty/systemjs/test/tests/normalize-hook-test.js delete mode 100644 thirdparty/systemjs/test/tests/out.js delete mode 100644 thirdparty/systemjs/test/tests/package-local-alias/index-cjs.js delete mode 100644 thirdparty/systemjs/test/tests/package-local-alias/index-default-cjs.js delete mode 100644 thirdparty/systemjs/test/tests/package-local-alias/index-default-esm.js delete mode 100644 thirdparty/systemjs/test/tests/package-local-alias/index-esm.js delete mode 100644 thirdparty/systemjs/test/tests/package-local-alias/local/index-cjs.js delete mode 100644 thirdparty/systemjs/test/tests/package-local-alias/local/index-default-cjs.js delete mode 100644 thirdparty/systemjs/test/tests/package-local-alias/local/index-default-esm.js delete mode 100644 thirdparty/systemjs/test/tests/package-local-alias/local/index-esm.js delete mode 100644 thirdparty/systemjs/test/tests/path/deep.js delete mode 100644 thirdparty/systemjs/test/tests/plugin-dep.js delete mode 100644 thirdparty/systemjs/test/tests/plugin@1.2.3/plugin.js delete mode 100644 thirdparty/systemjs/test/tests/reflection.js delete mode 100644 thirdparty/systemjs/test/tests/register-circular1.js delete mode 100644 thirdparty/systemjs/test/tests/register-circular2.js delete mode 100644 thirdparty/systemjs/test/tests/register-default-extension.js delete mode 100644 thirdparty/systemjs/test/tests/register-regex-2.js delete mode 100644 thirdparty/systemjs/test/tests/register-regex.js delete mode 100644 thirdparty/systemjs/test/tests/registerdynamic-main.js delete mode 100644 thirdparty/systemjs/test/tests/registerdynamic-notbundled.js delete mode 100644 thirdparty/systemjs/test/tests/reldynamic.js delete mode 100644 thirdparty/systemjs/test/tests/reldynamicdep.js delete mode 100644 thirdparty/systemjs/test/tests/shared-dep-bundles/a.js delete mode 100644 thirdparty/systemjs/test/tests/shared-dep-bundles/b.js delete mode 100644 thirdparty/systemjs/test/tests/shim-map-test-dep.js delete mode 100644 thirdparty/systemjs/test/tests/shim-package/shim-map-test.js delete mode 100644 thirdparty/systemjs/test/tests/some-json.json delete mode 100644 thirdparty/systemjs/test/tests/some-text.txt delete mode 100644 thirdparty/systemjs/test/tests/star-dep.js delete mode 100644 thirdparty/systemjs/test/tests/subcontextual-map/submodule.js delete mode 100644 thirdparty/systemjs/test/tests/subcontextual-mapdep.js delete mode 100644 thirdparty/systemjs/test/tests/test.css delete mode 100644 thirdparty/systemjs/test/tests/testpkg/depcache-test.js delete mode 100644 thirdparty/systemjs/test/tests/testpkg/dir/index.js delete mode 100644 thirdparty/systemjs/test/tests/testpkg/dir/self-load.js delete mode 100644 thirdparty/systemjs/test/tests/testpkg/dir2/index.json delete mode 100644 thirdparty/systemjs/test/tests/testpkg/env-module-browser.js delete mode 100644 thirdparty/systemjs/test/tests/testpkg/env-module.js delete mode 100644 thirdparty/systemjs/test/tests/testpkg/index.js delete mode 100644 thirdparty/systemjs/test/tests/testpkg/interpolate.js delete mode 100644 thirdparty/systemjs/test/tests/testpkg/json.js delete mode 100644 thirdparty/systemjs/test/tests/testpkg/json.json delete mode 100644 thirdparty/systemjs/test/tests/testpkg/polate.js delete mode 100644 thirdparty/systemjs/test/tests/testpkg/self-load.js delete mode 100644 thirdparty/systemjs/test/tests/testpkg/self.js delete mode 100644 thirdparty/systemjs/test/tests/testpkg/system.json delete mode 100644 thirdparty/systemjs/test/tests/testpkg/test.ts delete mode 100644 thirdparty/systemjs/test/tests/testpkg2.json delete mode 100644 thirdparty/systemjs/test/tests/testpkg2/asdf.asdf.js delete mode 100644 thirdparty/systemjs/test/tests/typescript.ts delete mode 100644 thirdparty/systemjs/test/tests/umd-dep.js delete mode 100644 thirdparty/systemjs/test/tests/umd.js delete mode 100644 thirdparty/systemjs/test/tests/versioned@2.0.3.js delete mode 100644 thirdparty/systemjs/test/tests/wildcard-test/2.js delete mode 100644 thirdparty/systemjs/test/tests/wildcard-test/2/sub.js delete mode 100644 thirdparty/systemjs/test/tests/wildcard-test/first.js delete mode 100644 thirdparty/systemjs/test/tests/with-global-deps.js delete mode 100644 thirdparty/systemjs/test/tests/with-runtime-babel.js delete mode 100644 thirdparty/systemjs/test/tests/with-runtime-traceur.js delete mode 100644 thirdparty/systemjs/test/tests/worker-babel.js delete mode 100644 thirdparty/systemjs/test/tests/worker-traceur.js delete mode 100644 thirdparty/systemjs/test/tests/worker-typescript.js delete mode 100644 thirdparty/systemjs/test/tests/wrapper.js delete mode 100644 thirdparty/systemjs/test/tests/zero@0.js rename {pogen => tooling/pogen}/.gitignore (100%) rename {pogen => tooling/pogen}/dumpTree.ts (100%) rename {pogen => tooling/pogen}/example/messages.po (100%) rename {pogen => tooling/pogen}/example/test.ts (100%) rename {pogen => tooling/pogen}/example/test2.tsx (100%) rename {pogen => tooling/pogen}/pogen.ts (100%) rename {pogen => tooling/pogen}/tsconfig.json (100%) rename {testlib => tooling/talertest}/node/runtime.js (50%) create mode 100644 tooling/talertest/package.json rename {testlib => tooling/talertest}/selenium/.gitignore (100%) rename {testlib => tooling/talertest}/selenium/escodegen.browser.js (100%) rename {testlib => tooling/talertest}/selenium/esprima.js (100%) rename {testlib => tooling/talertest}/selenium/instrumenter.js (100%) rename {testlib => tooling/talertest}/selenium/runtime.js (100%) rename {testlib => tooling/talertest}/selenium/system.js (100%) rename {testlib => tooling/talertest}/selenium/testhost.html (100%) create mode 100644 tooling/talertest/talertest.d.ts create mode 100644 tooling/talertest/talertest.js rename {testlib => tooling/talertest}/talertest.ts (95%) create mode 100644 tooling/talertest/tsconfig.json create mode 100644 tooling/talertest/yarn.lock create mode 100644 webpack.config.js diff --git a/.gitignore b/.gitignore index 958dc6d25..9a9b20544 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ node_modules coverage/ coverage-*.json + +dist/ diff --git a/decl/jed.d.ts b/decl/jed.d.ts new file mode 100644 index 000000000..b156702e0 --- /dev/null +++ b/decl/jed.d.ts @@ -0,0 +1,18 @@ + +interface JedInstance { + translate: any; + ngettext: any; +} + +interface JedConstructor { + new(s: any): JedInstance; +} + +declare namespace JedLib { + const Jed: JedConstructor; +} + +declare module "jed" { + export = JedLib; +} + diff --git a/decl/jquery/jquery.d.ts b/decl/jquery/jquery.d.ts deleted file mode 100644 index 8401753e3..000000000 --- a/decl/jquery/jquery.d.ts +++ /dev/null @@ -1,3190 +0,0 @@ -// Type definitions for jQuery 1.10.x / 2.0.x -// Project: http://jquery.com/ -// Definitions by: Boris Yankov , Christian Hoffmeister , Steve Fenton , Diullei Gomes , Tass Iliopoulos , Jason Swearingen , Sean Hill , Guus Goossens , Kelly Summerlin , Basarat Ali Syed , Nicholas Wolverson , Derek Cicerone , Andrew Gaspar , James Harrison Fisher , Seikichi Kondo , Benjamin Jackman , Poul Sorensen , Josh Strobl , John Reilly , Dick van den Brink -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/* ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - - -/** - * Interface for the AJAX setting that will configure the AJAX request - */ -interface JQueryAjaxSettings { - /** - * The content type sent in the request header that tells the server what kind of response it will accept in return. If the accepts setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. - */ - accepts?: any; - /** - * By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success(). - */ - async?: boolean; - /** - * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request. - */ - beforeSend? (jqXHR: JQueryXHR, settings: JQueryAjaxSettings): any; - /** - * If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET. - */ - cache?: boolean; - /** - * A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. - */ - complete? (jqXHR: JQueryXHR, textStatus: string): any; - /** - * An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. (version added: 1.5) - */ - contents?: { [key: string]: any; }; - //According to jQuery.ajax source code, ajax's option actually allows contentType to set to "false" - // https://github.com/borisyankov/DefinitelyTyped/issues/742 - /** - * When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. - */ - contentType?: any; - /** - * This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). - */ - context?: any; - /** - * An object containing dataType-to-dataType converters. Each converter's value is a function that returns the transformed value of the response. (version added: 1.5) - */ - converters?: { [key: string]: any; }; - /** - * If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of crossDomain to true. This allows, for example, server-side redirection to another domain. (version added: 1.5) - */ - crossDomain?: boolean; - /** - * Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below). - */ - data?: any; - /** - * A function to be used to handle the raw response data of XMLHttpRequest.This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter. - */ - dataFilter? (data: any, ty: any): any; - /** - * The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). - */ - dataType?: string; - /** - * A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event. - */ - error? (jqXHR: JQueryXHR, textStatus: string, errorThrown: string): any; - /** - * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events. - */ - global?: boolean; - /** - * An object of additional header key/value pairs to send along with requests using the XMLHttpRequest transport. The header X-Requested-With: XMLHttpRequest is always added, but its default XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from within the beforeSend function. (version added: 1.5) - */ - headers?: { [key: string]: any; }; - /** - * Allow the request to be successful only if the response has changed since the last request. This is done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data. - */ - ifModified?: boolean; - /** - * Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. (version added: 1.5.1) - */ - isLocal?: boolean; - /** - * Override the callback function name in a jsonp request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" } - */ - jsonp?: any; - /** - * Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function. - */ - jsonpCallback?: any; - /** - * The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). (version added: 1.9.0) - */ - method?: string; - /** - * A mime type to override the XHR mime type. (version added: 1.5.1) - */ - mimeType?: string; - /** - * A password to be used with XMLHttpRequest in response to an HTTP access authentication request. - */ - password?: string; - /** - * By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, set this option to false. - */ - processData?: boolean; - /** - * Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script. - */ - scriptCharset?: string; - /** - * An object of numeric HTTP codes and functions to be called when the response has the corresponding code. f the request is successful, the status code functions take the same parameters as the success callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback. (version added: 1.5) - */ - statusCode?: { [key: string]: any; }; - /** - * A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. - */ - success? (data: any, textStatus: string, jqXHR: JQueryXHR): any; - /** - * Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period. - */ - timeout?: number; - /** - * Set this to true if you wish to use the traditional style of param serialization. - */ - traditional?: boolean; - /** - * The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers. - */ - type?: string; - /** - * A string containing the URL to which the request is sent. - */ - url?: string; - /** - * A username to be used with XMLHttpRequest in response to an HTTP access authentication request. - */ - username?: string; - /** - * Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or enhancements to the factory. - */ - xhr?: any; - /** - * An object of fieldName-fieldValue pairs to set on the native XHR object. For example, you can use it to set withCredentials to true for cross-domain requests if needed. In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ should you require the use of it. (version added: 1.5.1) - */ - xhrFields?: { [key: string]: any; }; -} - -/** - * Interface for the jqXHR object - */ -interface JQueryXHR extends XMLHttpRequest, JQueryPromise { - /** - * The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header. As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5). - */ - overrideMimeType(mimeType: string): any; - /** - * Cancel the request. - * - * @param statusText A string passed as the textStatus parameter for the done callback. Default value: "canceled" - */ - abort(statusText?: string): void; - /** - * Incorporates the functionality of the .done() and .fail() methods, allowing (as of jQuery 1.8) the underlying Promise to be manipulated. Refer to deferred.then() for implementation details. - */ - then(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => void, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise; - /** - * Property containing the parsed response if the response Content-Type is json - */ - responseJSON?: any; - /** - * A function to be called if the request fails. - */ - error(xhr: JQueryXHR, textStatus: string, errorThrown: string): void; -} - -/** - * Interface for the JQuery callback - */ -interface JQueryCallback { - /** - * Add a callback or a collection of callbacks to a callback list. - * - * @param callbacks A function, or array of functions, that are to be added to the callback list. - */ - add(callbacks: Function): JQueryCallback; - /** - * Add a callback or a collection of callbacks to a callback list. - * - * @param callbacks A function, or array of functions, that are to be added to the callback list. - */ - add(callbacks: Function[]): JQueryCallback; - - /** - * Disable a callback list from doing anything more. - */ - disable(): JQueryCallback; - - /** - * Determine if the callbacks list has been disabled. - */ - disabled(): boolean; - - /** - * Remove all of the callbacks from a list. - */ - empty(): JQueryCallback; - - /** - * Call all of the callbacks with the given arguments - * - * @param arguments The argument or list of arguments to pass back to the callback list. - */ - fire(...arguments: any[]): JQueryCallback; - - /** - * Determine if the callbacks have already been called at least once. - */ - fired(): boolean; - - /** - * Call all callbacks in a list with the given context and arguments. - * - * @param context A reference to the context in which the callbacks in the list should be fired. - * @param arguments An argument, or array of arguments, to pass to the callbacks in the list. - */ - fireWith(context?: any, args?: any[]): JQueryCallback; - - /** - * Determine whether a supplied callback is in a list - * - * @param callback The callback to search for. - */ - has(callback: Function): boolean; - - /** - * Lock a callback list in its current state. - */ - lock(): JQueryCallback; - - /** - * Determine if the callbacks list has been locked. - */ - locked(): boolean; - - /** - * Remove a callback or a collection of callbacks from a callback list. - * - * @param callbacks A function, or array of functions, that are to be removed from the callback list. - */ - remove(callbacks: Function): JQueryCallback; - /** - * Remove a callback or a collection of callbacks from a callback list. - * - * @param callbacks A function, or array of functions, that are to be removed from the callback list. - */ - remove(callbacks: Function[]): JQueryCallback; -} - -/** - * Allows jQuery Promises to interop with non-jQuery promises - */ -interface JQueryGenericPromise { - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter A function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - */ - then(doneFilter: (value?: T, ...values: any[]) => U|JQueryPromise, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; - - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter A function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - */ - then(doneFilter: (value?: T, ...values: any[]) => void, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; -} - -/** - * Interface for the JQuery promise/deferred callbacks - */ -interface JQueryPromiseCallback { - (value?: T, ...args: any[]): void; -} - -interface JQueryPromiseOperator { - (callback1: JQueryPromiseCallback|JQueryPromiseCallback[], ...callbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; -} - -/** - * Interface for the JQuery promise, part of callbacks - */ -interface JQueryPromise extends JQueryGenericPromise { - /** - * Determine the current state of a Deferred object. - */ - state(): string; - /** - * Add handlers to be called when the Deferred object is either resolved or rejected. - * - * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected. - * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. - */ - always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; - /** - * Add handlers to be called when the Deferred object is resolved. - * - * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved. - * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. - */ - done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; - /** - * Add handlers to be called when the Deferred object is rejected. - * - * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected. - * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. - */ - fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; - /** - * Add handlers to be called when the Deferred object generates progress notifications. - * - * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. - */ - progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; - - // Deprecated - given no typings - pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; -} - -/** - * Interface for the JQuery deferred, part of callbacks - */ -interface JQueryDeferred extends JQueryGenericPromise { - /** - * Determine the current state of a Deferred object. - */ - state(): string; - /** - * Add handlers to be called when the Deferred object is either resolved or rejected. - * - * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected. - * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. - */ - always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbacksN: Array|JQueryPromiseCallback[]>): JQueryDeferred; - /** - * Add handlers to be called when the Deferred object is resolved. - * - * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved. - * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. - */ - done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; - /** - * Add handlers to be called when the Deferred object is rejected. - * - * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected. - * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. - */ - fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbacksN: Array|JQueryPromiseCallback[]>): JQueryDeferred; - /** - * Add handlers to be called when the Deferred object generates progress notifications. - * - * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. - */ - progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; - - /** - * Call the progressCallbacks on a Deferred object with the given args. - * - * @param args Optional arguments that are passed to the progressCallbacks. - */ - notify(value?: any, ...args: any[]): JQueryDeferred; - - /** - * Call the progressCallbacks on a Deferred object with the given context and args. - * - * @param context Context passed to the progressCallbacks as the this object. - * @param args Optional arguments that are passed to the progressCallbacks. - */ - notifyWith(context: any, value?: any[]): JQueryDeferred; - - /** - * Reject a Deferred object and call any failCallbacks with the given args. - * - * @param args Optional arguments that are passed to the failCallbacks. - */ - reject(value?: any, ...args: any[]): JQueryDeferred; - /** - * Reject a Deferred object and call any failCallbacks with the given context and args. - * - * @param context Context passed to the failCallbacks as the this object. - * @param args An optional array of arguments that are passed to the failCallbacks. - */ - rejectWith(context: any, value?: any[]): JQueryDeferred; - - /** - * Resolve a Deferred object and call any doneCallbacks with the given args. - * - * @param value First argument passed to doneCallbacks. - * @param args Optional subsequent arguments that are passed to the doneCallbacks. - */ - resolve(value?: T, ...args: any[]): JQueryDeferred; - - /** - * Resolve a Deferred object and call any doneCallbacks with the given context and args. - * - * @param context Context passed to the doneCallbacks as the this object. - * @param args An optional array of arguments that are passed to the doneCallbacks. - */ - resolveWith(context: any, value?: T[]): JQueryDeferred; - - /** - * Return a Deferred's Promise object. - * - * @param target Object onto which the promise methods have to be attached - */ - promise(target?: any): JQueryPromise; - - // Deprecated - given no typings - pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; -} - -/** - * Interface of the JQuery extension of the W3C event object - */ -interface BaseJQueryEventObject extends Event { - data: any; - delegateTarget: Element; - isDefaultPrevented(): boolean; - isImmediatePropagationStopped(): boolean; - isPropagationStopped(): boolean; - namespace: string; - originalEvent: Event; - preventDefault(): any; - relatedTarget: Element; - result: any; - stopImmediatePropagation(): void; - stopPropagation(): void; - target: Element; - pageX: number; - pageY: number; - which: number; - metaKey: boolean; -} - -interface JQueryInputEventObject extends BaseJQueryEventObject { - altKey: boolean; - ctrlKey: boolean; - metaKey: boolean; - shiftKey: boolean; -} - -interface JQueryMouseEventObject extends JQueryInputEventObject { - button: number; - clientX: number; - clientY: number; - offsetX: number; - offsetY: number; - pageX: number; - pageY: number; - screenX: number; - screenY: number; -} - -interface JQueryKeyEventObject extends JQueryInputEventObject { - char: any; - charCode: number; - key: any; - keyCode: number; -} - -interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{ -} - -/* - Collection of properties of the current browser -*/ - -interface JQuerySupport { - ajax?: boolean; - boxModel?: boolean; - changeBubbles?: boolean; - checkClone?: boolean; - checkOn?: boolean; - cors?: boolean; - cssFloat?: boolean; - hrefNormalized?: boolean; - htmlSerialize?: boolean; - leadingWhitespace?: boolean; - noCloneChecked?: boolean; - noCloneEvent?: boolean; - opacity?: boolean; - optDisabled?: boolean; - optSelected?: boolean; - scriptEval? (): boolean; - style?: boolean; - submitBubbles?: boolean; - tbody?: boolean; -} - -interface JQueryParam { - /** - * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. - * - * @param obj An array or object to serialize. - */ - (obj: any): string; - - /** - * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. - * - * @param obj An array or object to serialize. - * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. - */ - (obj: any, traditional: boolean): string; -} - -/** - * The interface used to construct jQuery events (with $.Event). It is - * defined separately instead of inline in JQueryStatic to allow - * overriding the construction function with specific strings - * returning specific event objects. - */ -interface JQueryEventConstructor { - (name: string, eventProperties?: any): JQueryEventObject; - new (name: string, eventProperties?: any): JQueryEventObject; -} - -/** - * The interface used to specify coordinates. - */ -interface JQueryCoordinates { - left: number; - top: number; -} - -/** - * Elements in the array returned by serializeArray() - */ -interface JQuerySerializeArrayElement { - name: string; - value: string; -} - -interface JQueryAnimationOptions { - /** - * A string or number determining how long the animation will run. - */ - duration?: any; - /** - * A string indicating which easing function to use for the transition. - */ - easing?: string; - /** - * A function to call once the animation is complete. - */ - complete?: Function; - /** - * A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set. - */ - step?: (now: number, tween: any) => any; - /** - * A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. (version added: 1.8) - */ - progress?: (animation: JQueryPromise, progress: number, remainingMs: number) => any; - /** - * A function to call when the animation begins. (version added: 1.8) - */ - start?: (animation: JQueryPromise) => any; - /** - * A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8) - */ - done?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; - /** - * A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8) - */ - fail?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; - /** - * A function to be called when the animation completes or stops without completing (its Promise object is either resolved or rejected). (version added: 1.8) - */ - always?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; - /** - * A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. When a custom queue name is used the animation does not automatically start; you must call .dequeue("queuename") to start it. - */ - queue?: any; - /** - * A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4) - */ - specialEasing?: Object; -} - -/** - * Static members of jQuery (those on $ and jQuery themselves) - */ -interface JQueryStatic { - - /** - * Perform an asynchronous HTTP (Ajax) request. - * - * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). - */ - ajax(settings: JQueryAjaxSettings): JQueryXHR; - /** - * Perform an asynchronous HTTP (Ajax) request. - * - * @param url A string containing the URL to which the request is sent. - * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). - */ - ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR; - - /** - * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). - * - * @param dataTypes An optional string containing one or more space-separated dataTypes - * @param handler A handler to set default values for future Ajax requests. - */ - ajaxPrefilter(dataTypes: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; - /** - * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). - * - * @param handler A handler to set default values for future Ajax requests. - */ - ajaxPrefilter(handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; - - ajaxSettings: JQueryAjaxSettings; - - /** - * Set default values for future Ajax requests. Its use is not recommended. - * - * @param options A set of key/value pairs that configure the default Ajax request. All options are optional. - */ - ajaxSetup(options: JQueryAjaxSettings): void; - - /** - * Load data from the server using a HTTP GET request. - * - * @param url A string containing the URL to which the request is sent. - * @param success A callback function that is executed if the request succeeds. - * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). - */ - get(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; - /** - * Load data from the server using a HTTP GET request. - * - * @param url A string containing the URL to which the request is sent. - * @param data A plain object or string that is sent to the server with the request. - * @param success A callback function that is executed if the request succeeds. - * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). - */ - get(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; - /** - * Load JSON-encoded data from the server using a GET HTTP request. - * - * @param url A string containing the URL to which the request is sent. - * @param success A callback function that is executed if the request succeeds. - */ - getJSON(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; - /** - * Load JSON-encoded data from the server using a GET HTTP request. - * - * @param url A string containing the URL to which the request is sent. - * @param data A plain object or string that is sent to the server with the request. - * @param success A callback function that is executed if the request succeeds. - */ - getJSON(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; - /** - * Load a JavaScript file from the server using a GET HTTP request, then execute it. - * - * @param url A string containing the URL to which the request is sent. - * @param success A callback function that is executed if the request succeeds. - */ - getScript(url: string, success?: (script: string, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; - - /** - * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. - */ - param: JQueryParam; - - /** - * Load data from the server using a HTTP POST request. - * - * @param url A string containing the URL to which the request is sent. - * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. - * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). - */ - post(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; - /** - * Load data from the server using a HTTP POST request. - * - * @param url A string containing the URL to which the request is sent. - * @param data A plain object or string that is sent to the server with the request. - * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. - * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). - */ - post(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; - - /** - * A multi-purpose callbacks list object that provides a powerful way to manage callback lists. - * - * @param flags An optional list of space-separated flags that change how the callback list behaves. - */ - Callbacks(flags?: string): JQueryCallback; - - /** - * Holds or releases the execution of jQuery's ready event. - * - * @param hold Indicates whether the ready hold is being requested or released - */ - holdReady(hold: boolean): void; - - /** - * Accepts a string containing a CSS selector which is then used to match a set of elements. - * - * @param selector A string containing a selector expression - * @param context A DOM Element, Document, or jQuery to use as context - */ - (selector: string, context?: Element|JQuery): JQuery; - - /** - * Accepts a string containing a CSS selector which is then used to match a set of elements. - * - * @param element A DOM element to wrap in a jQuery object. - */ - (element: Element): JQuery; - - /** - * Accepts a string containing a CSS selector which is then used to match a set of elements. - * - * @param elementArray An array containing a set of DOM elements to wrap in a jQuery object. - */ - (elementArray: Element[]): JQuery; - - /** - * Binds a function to be executed when the DOM has finished loading. - * - * @param callback A function to execute after the DOM is ready. - */ - (callback: (jQueryAlias?: JQueryStatic) => any): JQuery; - - /** - * Accepts a string containing a CSS selector which is then used to match a set of elements. - * - * @param object A plain object to wrap in a jQuery object. - */ - (object: {}): JQuery; - - /** - * Accepts a string containing a CSS selector which is then used to match a set of elements. - * - * @param object An existing jQuery object to clone. - */ - (object: JQuery): JQuery; - - /** - * Specify a function to execute when the DOM is fully loaded. - */ - (): JQuery; - - /** - * Creates DOM elements on the fly from the provided string of raw HTML. - * - * @param html A string of HTML to create on the fly. Note that this parses HTML, not XML. - * @param ownerDocument A document in which the new elements will be created. - */ - (html: string, ownerDocument?: Document): JQuery; - - /** - * Creates DOM elements on the fly from the provided string of raw HTML. - * - * @param html A string defining a single, standalone, HTML element (e.g.
or
). - * @param attributes An object of attributes, events, and methods to call on the newly-created element. - */ - (html: string, attributes: Object): JQuery; - - /** - * Relinquish jQuery's control of the $ variable. - * - * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). - */ - noConflict(removeAll?: boolean): Object; - - /** - * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. - * - * @param deferreds One or more Deferred objects, or plain JavaScript objects. - */ - when(...deferreds: Array/* as JQueryDeferred */>): JQueryPromise; - - /** - * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties. - */ - cssHooks: { [key: string]: any; }; - cssNumber: any; - - /** - * Store arbitrary data associated with the specified element. Returns the value that was set. - * - * @param element The DOM element to associate with the data. - * @param key A string naming the piece of data to set. - * @param value The new data value. - */ - data(element: Element, key: string, value: T): T; - /** - * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. - * - * @param element The DOM element to associate with the data. - * @param key A string naming the piece of data to set. - */ - data(element: Element, key: string): any; - /** - * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. - * - * @param element The DOM element to associate with the data. - */ - data(element: Element): any; - - /** - * Execute the next function on the queue for the matched element. - * - * @param element A DOM element from which to remove and execute a queued function. - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - */ - dequeue(element: Element, queueName?: string): void; - - /** - * Determine whether an element has any jQuery data associated with it. - * - * @param element A DOM element to be checked for data. - */ - hasData(element: Element): boolean; - - /** - * Show the queue of functions to be executed on the matched element. - * - * @param element A DOM element to inspect for an attached queue. - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - */ - queue(element: Element, queueName?: string): any[]; - /** - * Manipulate the queue of functions to be executed on the matched element. - * - * @param element A DOM element where the array of queued functions is attached. - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @param newQueue An array of functions to replace the current queue contents. - */ - queue(element: Element, queueName: string, newQueue: Function[]): JQuery; - /** - * Manipulate the queue of functions to be executed on the matched element. - * - * @param element A DOM element on which to add a queued function. - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @param callback The new function to add to the queue. - */ - queue(element: Element, queueName: string, callback: Function): JQuery; - - /** - * Remove a previously-stored piece of data. - * - * @param element A DOM element from which to remove data. - * @param name A string naming the piece of data to remove. - */ - removeData(element: Element, name?: string): JQuery; - - /** - * A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function. - * - * @param beforeStart A function that is called just before the constructor returns. - */ - Deferred(beforeStart?: (deferred: JQueryDeferred) => any): JQueryDeferred; - - /** - * Effects - */ - fx: { - tick: () => void; - /** - * The rate (in milliseconds) at which animations fire. - */ - interval: number; - stop: () => void; - speeds: { slow: number; fast: number; }; - /** - * Globally disable all animations. - */ - off: boolean; - step: any; - }; - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fnction The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument. - */ - proxy(fnction: (...args: any[]) => any, context: Object, ...additionalArguments: any[]): any; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param context The object to which the context (this) of the function should be set. - * @param name The name of the function whose context will be changed (should be a property of the context object). - * @param additionalArguments Any number of arguments to be passed to the function named in the name argument. - */ - proxy(context: Object, name: string, ...additionalArguments: any[]): any; - - Event: JQueryEventConstructor; - - /** - * Takes a string and throws an exception containing it. - * - * @param message The message to send out. - */ - error(message: any): JQuery; - - expr: any; - fn: any; //TODO: Decide how we want to type this - - isReady: boolean; - - // Properties - support: JQuerySupport; - - /** - * Check to see if a DOM element is a descendant of another DOM element. - * - * @param container The DOM element that may contain the other element. - * @param contained The DOM element that may be contained by (a descendant of) the other element. - */ - contains(container: Element, contained: Element): boolean; - - /** - * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. - * - * @param collection The object or array to iterate over. - * @param callback The function that will be executed on every object. - */ - each( - collection: T[], - callback: (indexInArray: number, valueOfElement: T) => any - ): any; - - /** - * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. - * - * @param collection The object or array to iterate over. - * @param callback The function that will be executed on every object. - */ - each( - collection: any, - callback: (indexInArray: any, valueOfElement: any) => any - ): any; - - /** - * Merge the contents of two or more objects together into the first object. - * - * @param target An object that will receive the new properties if additional objects are passed in or that will extend the jQuery namespace if it is the sole argument. - * @param object1 An object containing additional properties to merge in. - * @param objectN Additional objects containing properties to merge in. - */ - extend(target: any, object1?: any, ...objectN: any[]): any; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param deep If true, the merge becomes recursive (aka. deep copy). - * @param target The object to extend. It will receive the new properties. - * @param object1 An object containing additional properties to merge in. - * @param objectN Additional objects containing properties to merge in. - */ - extend(deep: boolean, target: any, object1?: any, ...objectN: any[]): any; - - /** - * Execute some JavaScript code globally. - * - * @param code The JavaScript code to execute. - */ - globalEval(code: string): any; - - /** - * Finds the elements of an array which satisfy a filter function. The original array is not affected. - * - * @param array The array to search through. - * @param func The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object. - * @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false. - */ - grep(array: T[], func: (elementOfArray: T, indexInArray: number) => boolean, invert?: boolean): T[]; - - /** - * Search for a specified value within an array and return its index (or -1 if not found). - * - * @param value The value to search for. - * @param array An array through which to search. - * @param fromIndex he index of the array at which to begin the search. The default is 0, which will search the whole array. - */ - inArray(value: T, array: T[], fromIndex?: number): number; - - /** - * Determine whether the argument is an array. - * - * @param obj Object to test whether or not it is an array. - */ - isArray(obj: any): boolean; - /** - * Check to see if an object is empty (contains no enumerable properties). - * - * @param obj The object that will be checked to see if it's empty. - */ - isEmptyObject(obj: any): boolean; - /** - * Determine if the argument passed is a Javascript function object. - * - * @param obj Object to test whether or not it is a function. - */ - isFunction(obj: any): boolean; - /** - * Determines whether its argument is a number. - * - * @param obj The value to be tested. - */ - isNumeric(value: any): boolean; - /** - * Check to see if an object is a plain object (created using "{}" or "new Object"). - * - * @param obj The object that will be checked to see if it's a plain object. - */ - isPlainObject(obj: any): boolean; - /** - * Determine whether the argument is a window. - * - * @param obj Object to test whether or not it is a window. - */ - isWindow(obj: any): boolean; - /** - * Check to see if a DOM node is within an XML document (or is an XML document). - * - * @param node he DOM node that will be checked to see if it's in an XML document. - */ - isXMLDoc(node: Node): boolean; - - /** - * Convert an array-like object into a true JavaScript array. - * - * @param obj Any object to turn into a native Array. - */ - makeArray(obj: any): any[]; - - /** - * Translate all items in an array or object to new array of items. - * - * @param array The Array to translate. - * @param callback The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object. - */ - map(array: T[], callback: (elementOfArray: T, indexInArray: number) => U): U[]; - /** - * Translate all items in an array or object to new array of items. - * - * @param arrayOrObject The Array or Object to translate. - * @param callback The function to process each item against. The first argument to the function is the value; the second argument is the index or key of the array or object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object. - */ - map(arrayOrObject: any, callback: (value: any, indexOrKey: any) => any): any; - - /** - * Merge the contents of two arrays together into the first array. - * - * @param first The first array to merge, the elements of second added. - * @param second The second array to merge into the first, unaltered. - */ - merge(first: T[], second: T[]): T[]; - - /** - * An empty function. - */ - noop(): any; - - /** - * Return a number representing the current time. - */ - now(): number; - - /** - * Takes a well-formed JSON string and returns the resulting JavaScript object. - * - * @param json The JSON string to parse. - */ - parseJSON(json: string): any; - - /** - * Parses a string into an XML document. - * - * @param data a well-formed XML string to be parsed - */ - parseXML(data: string): XMLDocument; - - /** - * Remove the whitespace from the beginning and end of a string. - * - * @param str Remove the whitespace from the beginning and end of a string. - */ - trim(str: string): string; - - /** - * Determine the internal JavaScript [[Class]] of an object. - * - * @param obj Object to get the internal JavaScript [[Class]] of. - */ - type(obj: any): string; - - /** - * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers. - * - * @param array The Array of DOM elements. - */ - unique(array: Element[]): Element[]; - - /** - * Parses a string into an array of DOM nodes. - * - * @param data HTML string to be parsed - * @param context DOM element to serve as the context in which the HTML fragment will be created - * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string - */ - parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[]; - - /** - * Parses a string into an array of DOM nodes. - * - * @param data HTML string to be parsed - * @param context DOM element to serve as the context in which the HTML fragment will be created - * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string - */ - parseHTML(data: string, context?: Document, keepScripts?: boolean): any[]; -} - -/** - * The jQuery instance members - */ -interface JQuery { - /** - * Register a handler to be called when Ajax requests complete. This is an AjaxEvent. - * - * @param handler The function to be invoked. - */ - ajaxComplete(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: any) => any): JQuery; - /** - * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. - * - * @param handler The function to be invoked. - */ - ajaxError(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxSettings: JQueryAjaxSettings, thrownError: any) => any): JQuery; - /** - * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. - * - * @param handler The function to be invoked. - */ - ajaxSend(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxOptions: JQueryAjaxSettings) => any): JQuery; - /** - * Register a handler to be called when the first Ajax request begins. This is an Ajax Event. - * - * @param handler The function to be invoked. - */ - ajaxStart(handler: () => any): JQuery; - /** - * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. - * - * @param handler The function to be invoked. - */ - ajaxStop(handler: () => any): JQuery; - /** - * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. - * - * @param handler The function to be invoked. - */ - ajaxSuccess(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: JQueryAjaxSettings) => any): JQuery; - - /** - * Load data from the server and place the returned HTML into the matched element. - * - * @param url A string containing the URL to which the request is sent. - * @param data A plain object or string that is sent to the server with the request. - * @param complete A callback function that is executed when the request completes. - */ - load(url: string, data?: string|Object, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery; - - /** - * Encode a set of form elements as a string for submission. - */ - serialize(): string; - /** - * Encode a set of form elements as an array of names and values. - */ - serializeArray(): JQuerySerializeArrayElement[]; - - /** - * Adds the specified class(es) to each of the set of matched elements. - * - * @param className One or more space-separated classes to be added to the class attribute of each matched element. - */ - addClass(className: string): JQuery; - /** - * Adds the specified class(es) to each of the set of matched elements. - * - * @param function A function returning one or more space-separated class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set. - */ - addClass(func: (index: number, className: string) => string): JQuery; - - /** - * Add the previous set of elements on the stack to the current set, optionally filtered by a selector. - */ - addBack(selector?: string): JQuery; - - /** - * Get the value of an attribute for the first element in the set of matched elements. - * - * @param attributeName The name of the attribute to get. - */ - attr(attributeName: string): string; - /** - * Set one or more attributes for the set of matched elements. - * - * @param attributeName The name of the attribute to set. - * @param value A value to set for the attribute. - */ - attr(attributeName: string, value: string|number): JQuery; - /** - * Set one or more attributes for the set of matched elements. - * - * @param attributeName The name of the attribute to set. - * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old attribute value as arguments. - */ - attr(attributeName: string, func: (index: number, attr: string) => string|number): JQuery; - /** - * Set one or more attributes for the set of matched elements. - * - * @param attributes An object of attribute-value pairs to set. - */ - attr(attributes: Object): JQuery; - - /** - * Determine whether any of the matched elements are assigned the given class. - * - * @param className The class name to search for. - */ - hasClass(className: string): boolean; - - /** - * Get the HTML contents of the first element in the set of matched elements. - */ - html(): string; - /** - * Set the HTML contents of each element in the set of matched elements. - * - * @param htmlString A string of HTML to set as the content of each matched element. - */ - html(htmlString: string): JQuery; - /** - * Set the HTML contents of each element in the set of matched elements. - * - * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. - */ - html(func: (index: number, oldhtml: string) => string): JQuery; - /** - * Set the HTML contents of each element in the set of matched elements. - * - * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. - */ - - /** - * Get the value of a property for the first element in the set of matched elements. - * - * @param propertyName The name of the property to get. - */ - prop(propertyName: string): any; - /** - * Set one or more properties for the set of matched elements. - * - * @param propertyName The name of the property to set. - * @param value A value to set for the property. - */ - prop(propertyName: string, value: string|number|boolean): JQuery; - /** - * Set one or more properties for the set of matched elements. - * - * @param properties An object of property-value pairs to set. - */ - prop(properties: Object): JQuery; - /** - * Set one or more properties for the set of matched elements. - * - * @param propertyName The name of the property to set. - * @param func A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element. - */ - prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): JQuery; - - /** - * Remove an attribute from each element in the set of matched elements. - * - * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes. - */ - removeAttr(attributeName: string): JQuery; - - /** - * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. - * - * @param className One or more space-separated classes to be removed from the class attribute of each matched element. - */ - removeClass(className?: string): JQuery; - /** - * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. - * - * @param function A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments. - */ - removeClass(func: (index: number, className: string) => string): JQuery; - - /** - * Remove a property for the set of matched elements. - * - * @param propertyName The name of the property to remove. - */ - removeProp(propertyName: string): JQuery; - - /** - * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. - * - * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set. - * @param swtch A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed. - */ - toggleClass(className: string, swtch?: boolean): JQuery; - /** - * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. - * - * @param swtch A boolean value to determine whether the class should be added or removed. - */ - toggleClass(swtch?: boolean): JQuery; - /** - * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. - * - * @param func A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the switch as arguments. - * @param swtch A boolean value to determine whether the class should be added or removed. - */ - toggleClass(func: (index: number, className: string, swtch: boolean) => string, swtch?: boolean): JQuery; - - /** - * Get the current value of the first element in the set of matched elements. - */ - val(): any; - /** - * Set the value of each element in the set of matched elements. - * - * @param value A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked. - */ - val(value: string|string[]): JQuery; - /** - * Set the value of each element in the set of matched elements. - * - * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. - */ - val(func: (index: number, value: string) => string): JQuery; - - - /** - * Get the value of style properties for the first element in the set of matched elements. - * - * @param propertyName A CSS property. - */ - css(propertyName: string): string; - /** - * Set one or more CSS properties for the set of matched elements. - * - * @param propertyName A CSS property name. - * @param value A value to set for the property. - */ - css(propertyName: string, value: string|number): JQuery; - /** - * Set one or more CSS properties for the set of matched elements. - * - * @param propertyName A CSS property name. - * @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. - */ - css(propertyName: string, value: (index: number, value: string) => string|number): JQuery; - /** - * Set one or more CSS properties for the set of matched elements. - * - * @param properties An object of property-value pairs to set. - */ - css(properties: Object): JQuery; - - /** - * Get the current computed height for the first element in the set of matched elements. - */ - height(): number; - /** - * Set the CSS height of every matched element. - * - * @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string). - */ - height(value: number|string): JQuery; - /** - * Set the CSS height of every matched element. - * - * @param func A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set. - */ - height(func: (index: number, height: number) => number|string): JQuery; - - /** - * Get the current computed height for the first element in the set of matched elements, including padding but not border. - */ - innerHeight(): number; - - /** - * Sets the inner height on elements in the set of matched elements, including padding but not border. - * - * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). - */ - innerHeight(height: number|string): JQuery; - - /** - * Get the current computed width for the first element in the set of matched elements, including padding but not border. - */ - innerWidth(): number; - - /** - * Sets the inner width on elements in the set of matched elements, including padding but not border. - * - * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). - */ - innerWidth(width: number|string): JQuery; - - /** - * Get the current coordinates of the first element in the set of matched elements, relative to the document. - */ - offset(): JQueryCoordinates; - /** - * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. - * - * @param coordinates An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. - */ - offset(coordinates: JQueryCoordinates): JQuery; - /** - * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. - * - * @param func A function to return the coordinates to set. Receives the index of the element in the collection as the first argument and the current coordinates as the second argument. The function should return an object with the new top and left properties. - */ - offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): JQuery; - - /** - * Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements. - * - * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. - */ - outerHeight(includeMargin?: boolean): number; - - /** - * Sets the outer height on elements in the set of matched elements, including padding and border. - * - * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). - */ - outerHeight(height: number|string): JQuery; - - /** - * Get the current computed width for the first element in the set of matched elements, including padding and border. - * - * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. - */ - outerWidth(includeMargin?: boolean): number; - - /** - * Sets the outer width on elements in the set of matched elements, including padding and border. - * - * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). - */ - outerWidth(width: number|string): JQuery; - - /** - * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. - */ - position(): JQueryCoordinates; - - /** - * Get the current horizontal position of the scroll bar for the first element in the set of matched elements or set the horizontal position of the scroll bar for every matched element. - */ - scrollLeft(): number; - /** - * Set the current horizontal position of the scroll bar for each of the set of matched elements. - * - * @param value An integer indicating the new position to set the scroll bar to. - */ - scrollLeft(value: number): JQuery; - - /** - * Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element. - */ - scrollTop(): number; - /** - * Set the current vertical position of the scroll bar for each of the set of matched elements. - * - * @param value An integer indicating the new position to set the scroll bar to. - */ - scrollTop(value: number): JQuery; - - /** - * Get the current computed width for the first element in the set of matched elements. - */ - width(): number; - /** - * Set the CSS width of each element in the set of matched elements. - * - * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). - */ - width(value: number|string): JQuery; - /** - * Set the CSS width of each element in the set of matched elements. - * - * @param func A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set. - */ - width(func: (index: number, width: number) => number|string): JQuery; - - /** - * Remove from the queue all items that have not yet been run. - * - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - */ - clearQueue(queueName?: string): JQuery; - - /** - * Store arbitrary data associated with the matched elements. - * - * @param key A string naming the piece of data to set. - * @param value The new data value; it can be any Javascript type including Array or Object. - */ - data(key: string, value: any): JQuery; - /** - * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. - * - * @param key Name of the data stored. - */ - data(key: string): any; - /** - * Store arbitrary data associated with the matched elements. - * - * @param obj An object of key-value pairs of data to update. - */ - data(obj: { [key: string]: any; }): JQuery; - /** - * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. - */ - data(): any; - - /** - * Execute the next function on the queue for the matched elements. - * - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - */ - dequeue(queueName?: string): JQuery; - - /** - * Remove a previously-stored piece of data. - * - * @param name A string naming the piece of data to delete or space-separated string naming the pieces of data to delete. - */ - removeData(name: string): JQuery; - /** - * Remove a previously-stored piece of data. - * - * @param list An array of strings naming the pieces of data to delete. - */ - removeData(list: string[]): JQuery; - /** - * Remove all previously-stored piece of data. - */ - removeData(): JQuery; - - /** - * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished. - * - * @param type The type of queue that needs to be observed. (default: fx) - * @param target Object onto which the promise methods have to be attached - */ - promise(type?: string, target?: Object): JQueryPromise; - - /** - * Perform a custom animation of a set of CSS properties. - * - * @param properties An object of CSS properties and values that the animation will move toward. - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - */ - animate(properties: Object, duration?: string|number, complete?: Function): JQuery; - /** - * Perform a custom animation of a set of CSS properties. - * - * @param properties An object of CSS properties and values that the animation will move toward. - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. (default: swing) - * @param complete A function to call once the animation is complete. - */ - animate(properties: Object, duration?: string|number, easing?: string, complete?: Function): JQuery; - /** - * Perform a custom animation of a set of CSS properties. - * - * @param properties An object of CSS properties and values that the animation will move toward. - * @param options A map of additional options to pass to the method. - */ - animate(properties: Object, options: JQueryAnimationOptions): JQuery; - - /** - * Set a timer to delay execution of subsequent items in the queue. - * - * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue. - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - */ - delay(duration: number, queueName?: string): JQuery; - - /** - * Display the matched elements by fading them to opaque. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - */ - fadeIn(duration?: number|string, complete?: Function): JQuery; - /** - * Display the matched elements by fading them to opaque. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - */ - fadeIn(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Display the matched elements by fading them to opaque. - * - * @param options A map of additional options to pass to the method. - */ - fadeIn(options: JQueryAnimationOptions): JQuery; - - /** - * Hide the matched elements by fading them to transparent. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - */ - fadeOut(duration?: number|string, complete?: Function): JQuery; - /** - * Hide the matched elements by fading them to transparent. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - */ - fadeOut(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Hide the matched elements by fading them to transparent. - * - * @param options A map of additional options to pass to the method. - */ - fadeOut(options: JQueryAnimationOptions): JQuery; - - /** - * Adjust the opacity of the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param opacity A number between 0 and 1 denoting the target opacity. - * @param complete A function to call once the animation is complete. - */ - fadeTo(duration: string|number, opacity: number, complete?: Function): JQuery; - /** - * Adjust the opacity of the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param opacity A number between 0 and 1 denoting the target opacity. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - */ - fadeTo(duration: string|number, opacity: number, easing?: string, complete?: Function): JQuery; - - /** - * Display or hide the matched elements by animating their opacity. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - */ - fadeToggle(duration?: number|string, complete?: Function): JQuery; - /** - * Display or hide the matched elements by animating their opacity. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - */ - fadeToggle(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Display or hide the matched elements by animating their opacity. - * - * @param options A map of additional options to pass to the method. - */ - fadeToggle(options: JQueryAnimationOptions): JQuery; - - /** - * Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements. - * - * @param queue The name of the queue in which to stop animations. - */ - finish(queue?: string): JQuery; - - /** - * Hide the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - */ - hide(duration?: number|string, complete?: Function): JQuery; - /** - * Hide the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - */ - hide(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Hide the matched elements. - * - * @param options A map of additional options to pass to the method. - */ - hide(options: JQueryAnimationOptions): JQuery; - - /** - * Display the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - */ - show(duration?: number|string, complete?: Function): JQuery; - /** - * Display the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - */ - show(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Display the matched elements. - * - * @param options A map of additional options to pass to the method. - */ - show(options: JQueryAnimationOptions): JQuery; - - /** - * Display the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - */ - slideDown(duration?: number|string, complete?: Function): JQuery; - /** - * Display the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - */ - slideDown(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Display the matched elements with a sliding motion. - * - * @param options A map of additional options to pass to the method. - */ - slideDown(options: JQueryAnimationOptions): JQuery; - - /** - * Display or hide the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - */ - slideToggle(duration?: number|string, complete?: Function): JQuery; - /** - * Display or hide the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - */ - slideToggle(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Display or hide the matched elements with a sliding motion. - * - * @param options A map of additional options to pass to the method. - */ - slideToggle(options: JQueryAnimationOptions): JQuery; - - /** - * Hide the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - */ - slideUp(duration?: number|string, complete?: Function): JQuery; - /** - * Hide the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - */ - slideUp(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Hide the matched elements with a sliding motion. - * - * @param options A map of additional options to pass to the method. - */ - slideUp(options: JQueryAnimationOptions): JQuery; - - /** - * Stop the currently-running animation on the matched elements. - * - * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. - * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. - */ - stop(clearQueue?: boolean, jumpToEnd?: boolean): JQuery; - /** - * Stop the currently-running animation on the matched elements. - * - * @param queue The name of the queue in which to stop animations. - * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. - * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. - */ - stop(queue?: string, clearQueue?: boolean, jumpToEnd?: boolean): JQuery; - - /** - * Display or hide the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - */ - toggle(duration?: number|string, complete?: Function): JQuery; - /** - * Display or hide the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - */ - toggle(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Display or hide the matched elements. - * - * @param options A map of additional options to pass to the method. - */ - toggle(options: JQueryAnimationOptions): JQuery; - /** - * Display or hide the matched elements. - * - * @param showOrHide A Boolean indicating whether to show or hide the elements. - */ - toggle(showOrHide: boolean): JQuery; - - /** - * Attach a handler to an event for the elements. - * - * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - */ - bind(eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Attach a handler to an event for the elements. - * - * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. - * @param handler A function to execute each time the event is triggered. - */ - bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Attach a handler to an event for the elements. - * - * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. - * @param eventData An object containing data that will be passed to the event handler. - * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. - */ - bind(eventType: string, eventData: any, preventBubble: boolean): JQuery; - /** - * Attach a handler to an event for the elements. - * - * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. - * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. - */ - bind(eventType: string, preventBubble: boolean): JQuery; - /** - * Attach a handler to an event for the elements. - * - * @param events An object containing one or more DOM event types and functions to execute for them. - */ - bind(events: any): JQuery; - - /** - * Trigger the "blur" event on an element - */ - blur(): JQuery; - /** - * Bind an event handler to the "blur" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - */ - blur(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "blur" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - */ - blur(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "change" event on an element. - */ - change(): JQuery; - /** - * Bind an event handler to the "change" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - */ - change(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "change" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - */ - change(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "click" event on an element. - */ - click(): JQuery; - /** - * Bind an event handler to the "click" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - */ - click(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "click" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - */ - click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "dblclick" event on an element. - */ - dblclick(): JQuery; - /** - * Bind an event handler to the "dblclick" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - */ - dblclick(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "dblclick" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - */ - dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; - delegate(selector: any, eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "focus" event on an element. - */ - focus(): JQuery; - /** - * Bind an event handler to the "focus" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - */ - focus(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "focus" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - */ - focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "focusin" event on an element. - */ - focusin(): JQuery; - /** - * Bind an event handler to the "focusin" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - */ - focusin(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "focusin" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - */ - focusin(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "focusout" event on an element. - */ - focusout(): JQuery; - /** - * Bind an event handler to the "focusout" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - */ - focusout(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "focusout" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - */ - focusout(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements. - * - * @param handlerIn A function to execute when the mouse pointer enters the element. - * @param handlerOut A function to execute when the mouse pointer leaves the element. - */ - hover(handlerIn: (eventObject: JQueryEventObject) => any, handlerOut: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements. - * - * @param handlerInOut A function to execute when the mouse pointer enters or leaves the element. - */ - hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "keydown" event on an element. - */ - keydown(): JQuery; - /** - * Bind an event handler to the "keydown" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - */ - keydown(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; - /** - * Bind an event handler to the "keydown" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - */ - keydown(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; - - /** - * Trigger the "keypress" event on an element. - */ - keypress(): JQuery; - /** - * Bind an event handler to the "keypress" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - */ - keypress(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; - /** - * Bind an event handler to the "keypress" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - */ - keypress(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; - - /** - * Trigger the "keyup" event on an element. - */ - keyup(): JQuery; - /** - * Bind an event handler to the "keyup" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - */ - keyup(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; - /** - * Bind an event handler to the "keyup" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - */ - keyup(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; - - /** - * Bind an event handler to the "load" JavaScript event. - * - * @param handler A function to execute when the event is triggered. - */ - load(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "load" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute when the event is triggered. - */ - load(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "mousedown" event on an element. - */ - mousedown(): JQuery; - /** - * Bind an event handler to the "mousedown" JavaScript event. - * - * @param handler A function to execute when the event is triggered. - */ - mousedown(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - /** - * Bind an event handler to the "mousedown" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute when the event is triggered. - */ - mousedown(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - - /** - * Trigger the "mouseenter" event on an element. - */ - mouseenter(): JQuery; - /** - * Bind an event handler to be fired when the mouse enters an element. - * - * @param handler A function to execute when the event is triggered. - */ - mouseenter(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - /** - * Bind an event handler to be fired when the mouse enters an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute when the event is triggered. - */ - mouseenter(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - - /** - * Trigger the "mouseleave" event on an element. - */ - mouseleave(): JQuery; - /** - * Bind an event handler to be fired when the mouse leaves an element. - * - * @param handler A function to execute when the event is triggered. - */ - mouseleave(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - /** - * Bind an event handler to be fired when the mouse leaves an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute when the event is triggered. - */ - mouseleave(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - - /** - * Trigger the "mousemove" event on an element. - */ - mousemove(): JQuery; - /** - * Bind an event handler to the "mousemove" JavaScript event. - * - * @param handler A function to execute when the event is triggered. - */ - mousemove(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - /** - * Bind an event handler to the "mousemove" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute when the event is triggered. - */ - mousemove(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - - /** - * Trigger the "mouseout" event on an element. - */ - mouseout(): JQuery; - /** - * Bind an event handler to the "mouseout" JavaScript event. - * - * @param handler A function to execute when the event is triggered. - */ - mouseout(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - /** - * Bind an event handler to the "mouseout" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute when the event is triggered. - */ - mouseout(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - - /** - * Trigger the "mouseover" event on an element. - */ - mouseover(): JQuery; - /** - * Bind an event handler to the "mouseover" JavaScript event. - * - * @param handler A function to execute when the event is triggered. - */ - mouseover(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - /** - * Bind an event handler to the "mouseover" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute when the event is triggered. - */ - mouseover(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - - /** - * Trigger the "mouseup" event on an element. - */ - mouseup(): JQuery; - /** - * Bind an event handler to the "mouseup" JavaScript event. - * - * @param handler A function to execute when the event is triggered. - */ - mouseup(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - /** - * Bind an event handler to the "mouseup" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute when the event is triggered. - */ - mouseup(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - - /** - * Remove an event handler. - */ - off(): JQuery; - /** - * Remove an event handler. - * - * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". - * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. - * @param handler A handler function previously attached for the event(s), or the special value false. - */ - off(events: string, selector?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Remove an event handler. - * - * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". - * @param handler A handler function previously attached for the event(s), or the special value false. - */ - off(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Remove an event handler. - * - * @param events An object where the string keys represent one or more space-separated event types and optional namespaces, and the values represent handler functions previously attached for the event(s). - * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. - */ - off(events: { [key: string]: any; }, selector?: string): JQuery; - - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. Rest parameter args is for optional parameters passed to jQuery.trigger(). Note that the actual parameters on the event handler function must be marked as optional (? syntax). - */ - on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param data Data to be passed to the handler in event.data when an event is triggered. - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. - */ - on(events: string, data : any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. - */ - on(events: string, selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param data Data to be passed to the handler in event.data when an event is triggered. - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. - */ - on(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). - * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. - * @param data Data to be passed to the handler in event.data when an event occurs. - */ - on(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). - * @param data Data to be passed to the handler in event.data when an event occurs. - */ - on(events: { [key: string]: any; }, data?: any): JQuery; - - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. - * @param handler A function to execute at the time the event is triggered. - */ - one(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. - * @param data An object containing data that will be passed to the event handler. - * @param handler A function to execute at the time the event is triggered. - */ - one(events: string, data: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. - */ - one(events: string, selector: string, handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param data Data to be passed to the handler in event.data when an event is triggered. - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. - */ - one(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). - * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. - * @param data Data to be passed to the handler in event.data when an event occurs. - */ - one(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; - - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). - * @param data Data to be passed to the handler in event.data when an event occurs. - */ - one(events: { [key: string]: any; }, data?: any): JQuery; - - - /** - * Specify a function to execute when the DOM is fully loaded. - * - * @param handler A function to execute after the DOM is ready. - */ - ready(handler: (jQueryAlias?: JQueryStatic) => any): JQuery; - - /** - * Trigger the "resize" event on an element. - */ - resize(): JQuery; - /** - * Bind an event handler to the "resize" JavaScript event. - * - * @param handler A function to execute each time the event is triggered. - */ - resize(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "resize" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - */ - resize(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "scroll" event on an element. - */ - scroll(): JQuery; - /** - * Bind an event handler to the "scroll" JavaScript event. - * - * @param handler A function to execute each time the event is triggered. - */ - scroll(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "scroll" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - */ - scroll(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "select" event on an element. - */ - select(): JQuery; - /** - * Bind an event handler to the "select" JavaScript event. - * - * @param handler A function to execute each time the event is triggered. - */ - select(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "select" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - */ - select(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "submit" event on an element. - */ - submit(): JQuery; - /** - * Bind an event handler to the "submit" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - */ - submit(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "submit" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - */ - submit(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Execute all handlers and behaviors attached to the matched elements for the given event type. - * - * @param eventType A string containing a JavaScript event type, such as click or submit. - * @param extraParameters Additional parameters to pass along to the event handler. - */ - trigger(eventType: string, extraParameters?: any[]|Object): JQuery; - /** - * Execute all handlers and behaviors attached to the matched elements for the given event type. - * - * @param event A jQuery.Event object. - * @param extraParameters Additional parameters to pass along to the event handler. - */ - trigger(event: JQueryEventObject, extraParameters?: any[]|Object): JQuery; - - /** - * Execute all handlers attached to an element for an event. - * - * @param eventType A string containing a JavaScript event type, such as click or submit. - * @param extraParameters An array of additional parameters to pass along to the event handler. - */ - triggerHandler(eventType: string, ...extraParameters: any[]): Object; - - /** - * Execute all handlers attached to an element for an event. - * - * @param event A jQuery.Event object. - * @param extraParameters An array of additional parameters to pass along to the event handler. - */ - triggerHandler(event: JQueryEventObject, ...extraParameters: any[]): Object; - - /** - * Remove a previously-attached event handler from the elements. - * - * @param eventType A string containing a JavaScript event type, such as click or submit. - * @param handler The function that is to be no longer executed. - */ - unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Remove a previously-attached event handler from the elements. - * - * @param eventType A string containing a JavaScript event type, such as click or submit. - * @param fls Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ). - */ - unbind(eventType: string, fls: boolean): JQuery; - /** - * Remove a previously-attached event handler from the elements. - * - * @param evt A JavaScript event object as passed to an event handler. - */ - unbind(evt: any): JQuery; - - /** - * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. - */ - undelegate(): JQuery; - /** - * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. - * - * @param selector A selector which will be used to filter the event results. - * @param eventType A string containing a JavaScript event type, such as "click" or "keydown" - * @param handler A function to execute at the time the event is triggered. - */ - undelegate(selector: string, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. - * - * @param selector A selector which will be used to filter the event results. - * @param events An object of one or more event types and previously bound functions to unbind from them. - */ - undelegate(selector: string, events: Object): JQuery; - /** - * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. - * - * @param namespace A string containing a namespace to unbind all events from. - */ - undelegate(namespace: string): JQuery; - - /** - * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) - * - * @param handler A function to execute when the event is triggered. - */ - unload(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) - * - * @param eventData A plain object of data that will be passed to the event handler. - * @param handler A function to execute when the event is triggered. - */ - unload(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. (DEPRECATED from v1.10) - */ - context: Element; - - jquery: string; - - /** - * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) - * - * @param handler A function to execute when the event is triggered. - */ - error(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) - * - * @param eventData A plain object of data that will be passed to the event handler. - * @param handler A function to execute when the event is triggered. - */ - error(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Add a collection of DOM elements onto the jQuery stack. - * - * @param elements An array of elements to push onto the stack and make into a new jQuery object. - */ - pushStack(elements: any[]): JQuery; - /** - * Add a collection of DOM elements onto the jQuery stack. - * - * @param elements An array of elements to push onto the stack and make into a new jQuery object. - * @param name The name of a jQuery method that generated the array of elements. - * @param arguments The arguments that were passed in to the jQuery method (for serialization). - */ - pushStack(elements: any[], name: string, arguments: any[]): JQuery; - - /** - * Insert content, specified by the parameter, after each element in the set of matched elements. - * - * param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements. - * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements. - */ - after(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; - /** - * Insert content, specified by the parameter, after each element in the set of matched elements. - * - * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. - */ - after(func: (index: number, html: string) => string|Element|JQuery): JQuery; - - /** - * Insert content, specified by the parameter, to the end of each element in the set of matched elements. - * - * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements. - * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements. - */ - append(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; - /** - * Insert content, specified by the parameter, to the end of each element in the set of matched elements. - * - * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. - */ - append(func: (index: number, html: string) => string|Element|JQuery): JQuery; - - /** - * Insert every element in the set of matched elements to the end of the target. - * - * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter. - */ - appendTo(target: JQuery|any[]|Element|string): JQuery; - - /** - * Insert content, specified by the parameter, before each element in the set of matched elements. - * - * param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements. - * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements. - */ - before(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; - /** - * Insert content, specified by the parameter, before each element in the set of matched elements. - * - * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. - */ - before(func: (index: number, html: string) => string|Element|JQuery): JQuery; - - /** - * Create a deep copy of the set of matched elements. - * - * param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false. - * param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false). - */ - clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): JQuery; - - /** - * Remove the set of matched elements from the DOM. - * - * param selector A selector expression that filters the set of matched elements to be removed. - */ - detach(selector?: string): JQuery; - - /** - * Remove all child nodes of the set of matched elements from the DOM. - */ - empty(): JQuery; - - /** - * Insert every element in the set of matched elements after the target. - * - * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter. - */ - insertAfter(target: JQuery|any[]|Element|Text|string): JQuery; - - /** - * Insert every element in the set of matched elements before the target. - * - * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter. - */ - insertBefore(target: JQuery|any[]|Element|Text|string): JQuery; - - /** - * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. - * - * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements. - * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements. - */ - prepend(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; - /** - * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. - * - * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. - */ - prepend(func: (index: number, html: string) => string|Element|JQuery): JQuery; - - /** - * Insert every element in the set of matched elements to the beginning of the target. - * - * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter. - */ - prependTo(target: JQuery|any[]|Element|string): JQuery; - - /** - * Remove the set of matched elements from the DOM. - * - * @param selector A selector expression that filters the set of matched elements to be removed. - */ - remove(selector?: string): JQuery; - - /** - * Replace each target element with the set of matched elements. - * - * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace. - */ - replaceAll(target: JQuery|any[]|Element|string): JQuery; - - /** - * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. - * - * param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object. - */ - replaceWith(newContent: JQuery|any[]|Element|Text|string): JQuery; - /** - * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. - * - * param func A function that returns content with which to replace the set of matched elements. - */ - replaceWith(func: () => Element|JQuery): JQuery; - - /** - * Get the combined text contents of each element in the set of matched elements, including their descendants. - */ - text(): string; - /** - * Set the content of each element in the set of matched elements to the specified text. - * - * @param text The text to set as the content of each matched element. When Number or Boolean is supplied, it will be converted to a String representation. - */ - text(text: string|number|boolean): JQuery; - /** - * Set the content of each element in the set of matched elements to the specified text. - * - * @param func A function returning the text content to set. Receives the index position of the element in the set and the old text value as arguments. - */ - text(func: (index: number, text: string) => string): JQuery; - - /** - * Retrieve all the elements contained in the jQuery set, as an array. - */ - toArray(): any[]; - - /** - * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. - */ - unwrap(): JQuery; - - /** - * Wrap an HTML structure around each element in the set of matched elements. - * - * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. - */ - wrap(wrappingElement: JQuery|Element|string): JQuery; - /** - * Wrap an HTML structure around each element in the set of matched elements. - * - * @param func A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. - */ - wrap(func: (index: number) => string|JQuery): JQuery; - - /** - * Wrap an HTML structure around all elements in the set of matched elements. - * - * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. - */ - wrapAll(wrappingElement: JQuery|Element|string): JQuery; - wrapAll(func: (index: number) => string): JQuery; - - /** - * Wrap an HTML structure around the content of each element in the set of matched elements. - * - * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements. - */ - wrapInner(wrappingElement: JQuery|Element|string): JQuery; - /** - * Wrap an HTML structure around the content of each element in the set of matched elements. - * - * @param func A callback function which generates a structure to wrap around the content of the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. - */ - wrapInner(func: (index: number) => string): JQuery; - - /** - * Iterate over a jQuery object, executing a function for each matched element. - * - * @param func A function to execute for each matched element. - */ - each(func: (index: number, elem: Element) => any): JQuery; - - /** - * Retrieve one of the elements matched by the jQuery object. - * - * @param index A zero-based integer indicating which element to retrieve. - */ - get(index: number): HTMLElement; - /** - * Retrieve the elements matched by the jQuery object. - */ - get(): any[]; - - /** - * Search for a given element from among the matched elements. - */ - index(): number; - /** - * Search for a given element from among the matched elements. - * - * @param selector A selector representing a jQuery collection in which to look for an element. - */ - index(selector: string|JQuery|Element): number; - - /** - * The number of elements in the jQuery object. - */ - length: number; - /** - * A selector representing selector passed to jQuery(), if any, when creating the original set. - * version deprecated: 1.7, removed: 1.9 - */ - selector: string; - [index: string]: any; - [index: number]: HTMLElement; - - /** - * Add elements to the set of matched elements. - * - * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements. - * @param context The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method. - */ - add(selector: string, context?: Element): JQuery; - /** - * Add elements to the set of matched elements. - * - * @param elements One or more elements to add to the set of matched elements. - */ - add(...elements: Element[]): JQuery; - /** - * Add elements to the set of matched elements. - * - * @param html An HTML fragment to add to the set of matched elements. - */ - add(html: string): JQuery; - /** - * Add elements to the set of matched elements. - * - * @param obj An existing jQuery object to add to the set of matched elements. - */ - add(obj: JQuery): JQuery; - - /** - * Get the children of each element in the set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - */ - children(selector?: string): JQuery; - - /** - * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. - * - * @param selector A string containing a selector expression to match elements against. - */ - closest(selector: string): JQuery; - /** - * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. - * - * @param selector A string containing a selector expression to match elements against. - * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. - */ - closest(selector: string, context?: Element): JQuery; - /** - * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. - * - * @param obj A jQuery object to match elements against. - */ - closest(obj: JQuery): JQuery; - /** - * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. - * - * @param element An element to match elements against. - */ - closest(element: Element): JQuery; - - /** - * Get an array of all the elements and selectors matched against the current element up through the DOM tree. - * - * @param selectors An array or string containing a selector expression to match elements against (can also be a jQuery object). - * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. - */ - closest(selectors: any, context?: Element): any[]; - - /** - * Get the children of each element in the set of matched elements, including text and comment nodes. - */ - contents(): JQuery; - - /** - * End the most recent filtering operation in the current chain and return the set of matched elements to its previous state. - */ - end(): JQuery; - - /** - * Reduce the set of matched elements to the one at the specified index. - * - * @param index An integer indicating the 0-based position of the element. OR An integer indicating the position of the element, counting backwards from the last element in the set. - * - */ - eq(index: number): JQuery; - - /** - * Reduce the set of matched elements to those that match the selector or pass the function's test. - * - * @param selector A string containing a selector expression to match the current set of elements against. - */ - filter(selector: string): JQuery; - /** - * Reduce the set of matched elements to those that match the selector or pass the function's test. - * - * @param func A function used as a test for each element in the set. this is the current DOM element. - */ - filter(func: (index: number, element: Element) => any): JQuery; - /** - * Reduce the set of matched elements to those that match the selector or pass the function's test. - * - * @param element An element to match the current set of elements against. - */ - filter(element: Element): JQuery; - /** - * Reduce the set of matched elements to those that match the selector or pass the function's test. - * - * @param obj An existing jQuery object to match the current set of elements against. - */ - filter(obj: JQuery): JQuery; - - /** - * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. - * - * @param selector A string containing a selector expression to match elements against. - */ - find(selector: string): JQuery; - /** - * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. - * - * @param element An element to match elements against. - */ - find(element: Element): JQuery; - /** - * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. - * - * @param obj A jQuery object to match elements against. - */ - find(obj: JQuery): JQuery; - - /** - * Reduce the set of matched elements to the first in the set. - */ - first(): JQuery; - - /** - * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. - * - * @param selector A string containing a selector expression to match elements against. - */ - has(selector: string): JQuery; - /** - * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. - * - * @param contained A DOM element to match elements against. - */ - has(contained: Element): JQuery; - - /** - * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. - * - * @param selector A string containing a selector expression to match elements against. - */ - is(selector: string): boolean; - /** - * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. - * - * @param func A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection.Within the function, this refers to the current DOM element. - */ - is(func: (index: number, element: Element) => boolean): boolean; - /** - * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. - * - * @param obj An existing jQuery object to match the current set of elements against. - */ - is(obj: JQuery): boolean; - /** - * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. - * - * @param elements One or more elements to match the current set of elements against. - */ - is(elements: any): boolean; - - /** - * Reduce the set of matched elements to the final one in the set. - */ - last(): JQuery; - - /** - * Pass each element in the current matched set through a function, producing a new jQuery object containing the return values. - * - * @param callback A function object that will be invoked for each element in the current set. - */ - map(callback: (index: number, domElement: Element) => any): JQuery; - - /** - * Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector. - * - * @param selector A string containing a selector expression to match elements against. - */ - next(selector?: string): JQuery; - - /** - * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - */ - nextAll(selector?: string): JQuery; - - /** - * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. - * - * @param selector A string containing a selector expression to indicate where to stop matching following sibling elements. - * @param filter A string containing a selector expression to match elements against. - */ - nextUntil(selector?: string, filter?: string): JQuery; - /** - * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. - * - * @param element A DOM node or jQuery object indicating where to stop matching following sibling elements. - * @param filter A string containing a selector expression to match elements against. - */ - nextUntil(element?: Element, filter?: string): JQuery; - /** - * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. - * - * @param obj A DOM node or jQuery object indicating where to stop matching following sibling elements. - * @param filter A string containing a selector expression to match elements against. - */ - nextUntil(obj?: JQuery, filter?: string): JQuery; - - /** - * Remove elements from the set of matched elements. - * - * @param selector A string containing a selector expression to match elements against. - */ - not(selector: string): JQuery; - /** - * Remove elements from the set of matched elements. - * - * @param func A function used as a test for each element in the set. this is the current DOM element. - */ - not(func: (index: number, element: Element) => boolean): JQuery; - /** - * Remove elements from the set of matched elements. - * - * @param elements One or more DOM elements to remove from the matched set. - */ - not(elements: Element|Element[]): JQuery; - /** - * Remove elements from the set of matched elements. - * - * @param obj An existing jQuery object to match the current set of elements against. - */ - not(obj: JQuery): JQuery; - - /** - * Get the closest ancestor element that is positioned. - */ - offsetParent(): JQuery; - - /** - * Get the parent of each element in the current set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - */ - parent(selector?: string): JQuery; - - /** - * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - */ - parents(selector?: string): JQuery; - - /** - * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. - * - * @param selector A string containing a selector expression to indicate where to stop matching ancestor elements. - * @param filter A string containing a selector expression to match elements against. - */ - parentsUntil(selector?: string, filter?: string): JQuery; - /** - * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. - * - * @param element A DOM node or jQuery object indicating where to stop matching ancestor elements. - * @param filter A string containing a selector expression to match elements against. - */ - parentsUntil(element?: Element, filter?: string): JQuery; - /** - * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. - * - * @param obj A DOM node or jQuery object indicating where to stop matching ancestor elements. - * @param filter A string containing a selector expression to match elements against. - */ - parentsUntil(obj?: JQuery, filter?: string): JQuery; - - /** - * Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - */ - prev(selector?: string): JQuery; - - /** - * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - */ - prevAll(selector?: string): JQuery; - - /** - * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. - * - * @param selector A string containing a selector expression to indicate where to stop matching preceding sibling elements. - * @param filter A string containing a selector expression to match elements against. - */ - prevUntil(selector?: string, filter?: string): JQuery; - /** - * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. - * - * @param element A DOM node or jQuery object indicating where to stop matching preceding sibling elements. - * @param filter A string containing a selector expression to match elements against. - */ - prevUntil(element?: Element, filter?: string): JQuery; - /** - * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. - * - * @param obj A DOM node or jQuery object indicating where to stop matching preceding sibling elements. - * @param filter A string containing a selector expression to match elements against. - */ - prevUntil(obj?: JQuery, filter?: string): JQuery; - - /** - * Get the siblings of each element in the set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - */ - siblings(selector?: string): JQuery; - - /** - * Reduce the set of matched elements to a subset specified by a range of indices. - * - * @param start An integer indicating the 0-based position at which the elements begin to be selected. If negative, it indicates an offset from the end of the set. - * @param end An integer indicating the 0-based position at which the elements stop being selected. If negative, it indicates an offset from the end of the set. If omitted, the range continues until the end of the set. - */ - slice(start: number, end?: number): JQuery; - - /** - * Show the queue of functions to be executed on the matched elements. - * - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - */ - queue(queueName?: string): any[]; - /** - * Manipulate the queue of functions to be executed, once for each matched element. - * - * @param newQueue An array of functions to replace the current queue contents. - */ - queue(newQueue: Function[]): JQuery; - /** - * Manipulate the queue of functions to be executed, once for each matched element. - * - * @param callback The new function to add to the queue, with a function to call that will dequeue the next item. - */ - queue(callback: Function): JQuery; - /** - * Manipulate the queue of functions to be executed, once for each matched element. - * - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @param newQueue An array of functions to replace the current queue contents. - */ - queue(queueName: string, newQueue: Function[]): JQuery; - /** - * Manipulate the queue of functions to be executed, once for each matched element. - * - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @param callback The new function to add to the queue, with a function to call that will dequeue the next item. - */ - queue(queueName: string, callback: Function): JQuery; -} -declare module "jquery" { - export = $; -} -declare var jQuery: JQueryStatic; -declare var $: JQueryStatic; diff --git a/decl/lib.es6.d.ts b/decl/lib.es6.d.ts deleted file mode 100644 index 084ed4e8a..000000000 --- a/decl/lib.es6.d.ts +++ /dev/null @@ -1,20674 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -/// -///////////////////////////// -/// ECMAScript APIs -///////////////////////////// - -declare const NaN: number; -declare const Infinity: number; - -/** - * Evaluates JavaScript code and executes it. - * @param x A String value that contains valid JavaScript code. - */ -declare function eval(x: string): any; - -/** - * Converts A string to an integer. - * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. - * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. - * All other strings are considered decimal. - */ -declare function parseInt(s: string, radix?: number): number; - -/** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. - */ -declare function parseFloat(string: string): number; - -/** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number). - * @param number A numeric value. - */ -declare function isNaN(number: number): boolean; - -/** - * Determines whether a supplied number is finite. - * @param number Any numeric value. - */ -declare function isFinite(number: number): boolean; - -/** - * Gets the unencoded version of an encoded Uniform Resource Identifier (URI). - * @param encodedURI A value representing an encoded URI. - */ -declare function decodeURI(encodedURI: string): string; - -/** - * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI). - * @param encodedURIComponent A value representing an encoded URI component. - */ -declare function decodeURIComponent(encodedURIComponent: string): string; - -/** - * Encodes a text string as a valid Uniform Resource Identifier (URI) - * @param uri A value representing an encoded URI. - */ -declare function encodeURI(uri: string): string; - -/** - * Encodes a text string as a valid component of a Uniform Resource Identifier (URI). - * @param uriComponent A value representing an encoded URI component. - */ -declare function encodeURIComponent(uriComponent: string): string; - -interface PropertyDescriptor { - configurable?: boolean; - enumerable?: boolean; - value?: any; - writable?: boolean; - get? (): any; - set? (v: any): void; -} - -interface PropertyDescriptorMap { - [s: string]: PropertyDescriptor; -} - -interface Object { - /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */ - constructor: Function; - - /** Returns a string representation of an object. */ - toString(): string; - - /** Returns a date converted to a string using the current locale. */ - toLocaleString(): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): Object; - - /** - * Determines whether an object has a property with the specified name. - * @param v A property name. - */ - hasOwnProperty(v: string): boolean; - - /** - * Determines whether an object exists in another object's prototype chain. - * @param v Another object whose prototype chain is to be checked. - */ - isPrototypeOf(v: Object): boolean; - - /** - * Determines whether a specified property is enumerable. - * @param v A property name. - */ - propertyIsEnumerable(v: string): boolean; -} - -interface ObjectConstructor { - new (value?: any): Object; - (): any; - (value: any): any; - - /** A reference to the prototype for a class of objects. */ - readonly prototype: Object; - - /** - * Returns the prototype of an object. - * @param o The object that references the prototype. - */ - getPrototypeOf(o: any): any; - - /** - * Gets the own property descriptor of the specified object. - * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype. - * @param o Object that contains the property. - * @param p Name of the property. - */ - getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; - - /** - * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly - * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. - * @param o Object that contains the own properties. - */ - getOwnPropertyNames(o: any): string[]; - - /** - * Creates an object that has null prototype. - * @param o Object to use as a prototype. May be null - */ - create(o: null): any; - - /** - * Creates an object that has the specified prototype, and that optionally contains specified properties. - * @param o Object to use as a prototype. May be null - */ - create(o: T): T; - - /** - * Creates an object that has the specified prototype, and that optionally contains specified properties. - * @param o Object to use as a prototype. May be null - * @param properties JavaScript object that contains one or more property descriptors. - */ - create(o: any, properties: PropertyDescriptorMap): any; - - /** - * Adds a property to an object, or modifies attributes of an existing property. - * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object. - * @param p The property name. - * @param attributes Descriptor for the property. It can be for a data property or an accessor property. - */ - defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; - - /** - * Adds one or more properties to an object, and/or modifies attributes of existing properties. - * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object. - * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property. - */ - defineProperties(o: any, properties: PropertyDescriptorMap): any; - - /** - * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - seal(o: T): T; - - /** - * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - freeze(o: T): T; - - /** - * Prevents the addition of new properties to an object. - * @param o Object to make non-extensible. - */ - preventExtensions(o: T): T; - - /** - * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. - * @param o Object to test. - */ - isSealed(o: any): boolean; - - /** - * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. - * @param o Object to test. - */ - isFrozen(o: any): boolean; - - /** - * Returns a value that indicates whether new properties can be added to an object. - * @param o Object to test. - */ - isExtensible(o: any): boolean; - - /** - * Returns the names of the enumerable properties and methods of an object. - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ - keys(o: any): string[]; -} - -/** - * Provides functionality common to all JavaScript objects. - */ -declare const Object: ObjectConstructor; - -/** - * Creates a new function. - */ -interface Function { - /** - * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. - * @param thisArg The object to be used as the this object. - * @param argArray A set of arguments to be passed to the function. - */ - apply(this: Function, thisArg: any, argArray?: any): any; - - /** - * Calls a method of an object, substituting another object for the current object. - * @param thisArg The object to be used as the current object. - * @param argArray A list of arguments to be passed to the method. - */ - call(this: Function, thisArg: any, ...argArray: any[]): any; - - /** - * For a given function, creates a bound function that has the same body as the original function. - * The this object of the bound function is associated with the specified object, and has the specified initial parameters. - * @param thisArg An object to which the this keyword can refer inside the new function. - * @param argArray A list of arguments to be passed to the new function. - */ - bind(this: Function, thisArg: any, ...argArray: any[]): any; - - prototype: any; - readonly length: number; - - // Non-standard extensions - arguments: any; - caller: Function; -} - -interface FunctionConstructor { - /** - * Creates a new function. - * @param args A list of arguments the function accepts. - */ - new (...args: string[]): Function; - (...args: string[]): Function; - readonly prototype: Function; -} - -declare const Function: FunctionConstructor; - -interface IArguments { - [index: number]: any; - length: number; - callee: Function; -} - -interface String { - /** Returns a string representation of a string. */ - toString(): string; - - /** - * Returns the character at the specified index. - * @param pos The zero-based index of the desired character. - */ - charAt(pos: number): string; - - /** - * Returns the Unicode value of the character at the specified location. - * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned. - */ - charCodeAt(index: number): number; - - /** - * Returns a string that contains the concatenation of two or more strings. - * @param strings The strings to append to the end of the string. - */ - concat(...strings: string[]): string; - - /** - * Returns the position of the first occurrence of a substring. - * @param searchString The substring to search for in the string - * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string. - */ - indexOf(searchString: string, position?: number): number; - - /** - * Returns the last occurrence of a substring in the string. - * @param searchString The substring to search for. - * @param position The index at which to begin searching. If omitted, the search begins at the end of the string. - */ - lastIndexOf(searchString: string, position?: number): number; - - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - */ - localeCompare(that: string): number; - - /** - * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A variable name or string literal containing the regular expression pattern and flags. - */ - match(regexp: string): RegExpMatchArray | null; - - /** - * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A regular expression object that contains the regular expression pattern and applicable flags. - */ - match(regexp: RegExp): RegExpMatchArray | null; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A string that represents the regular expression. - * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. - */ - replace(searchValue: string, replaceValue: string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A string that represents the regular expression. - * @param replacer A function that returns the replacement text. - */ - replace(searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags. - * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. - */ - replace(searchValue: RegExp, replaceValue: string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags - * @param replacer A function that returns the replacement text. - */ - replace(searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; - - /** - * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. - */ - search(regexp: string): number; - - /** - * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. - */ - search(regexp: RegExp): number; - - /** - * Returns a section of a string. - * @param start The index to the beginning of the specified portion of stringObj. - * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. - * If this value is not specified, the substring continues to the end of stringObj. - */ - slice(start?: number, end?: number): string; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(separator: string, limit?: number): string[]; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param separator A Regular Express that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(separator: RegExp, limit?: number): string[]; - - /** - * Returns the substring at the specified location within a String object. - * @param start The zero-based index number indicating the beginning of the substring. - * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. - * If end is omitted, the characters from start through the end of the original string are returned. - */ - substring(start: number, end?: number): string; - - /** Converts all the alphabetic characters in a string to lowercase. */ - toLowerCase(): string; - - /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ - toLocaleLowerCase(): string; - - /** Converts all the alphabetic characters in a string to uppercase. */ - toUpperCase(): string; - - /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */ - toLocaleUpperCase(): string; - - /** Removes the leading and trailing white space and line terminator characters from a string. */ - trim(): string; - - /** Returns the length of a String object. */ - readonly length: number; - - // IE extensions - /** - * Gets a substring beginning at the specified location and having the specified length. - * @param from The starting position of the desired substring. The index of the first character in the string is zero. - * @param length The number of characters to include in the returned substring. - */ - substr(from: number, length?: number): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): string; - - readonly [index: number]: string; -} - -interface StringConstructor { - new (value?: any): String; - (value?: any): string; - readonly prototype: String; - fromCharCode(...codes: number[]): string; -} - -/** - * Allows manipulation and formatting of text strings and determination and location of substrings within strings. - */ -declare const String: StringConstructor; - -interface Boolean { - /** Returns the primitive value of the specified object. */ - valueOf(): boolean; -} - -interface BooleanConstructor { - new (value?: any): Boolean; - (value?: any): boolean; - readonly prototype: Boolean; -} - -declare const Boolean: BooleanConstructor; - -interface Number { - /** - * Returns a string representation of an object. - * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers. - */ - toString(radix?: number): string; - - /** - * Returns a string representing a number in fixed-point notation. - * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. - */ - toFixed(fractionDigits?: number): string; - - /** - * Returns a string containing a number represented in exponential notation. - * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. - */ - toExponential(fractionDigits?: number): string; - - /** - * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits. - * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive. - */ - toPrecision(precision?: number): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): number; -} - -interface NumberConstructor { - new (value?: any): Number; - (value?: any): number; - readonly prototype: Number; - - /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */ - readonly MAX_VALUE: number; - - /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */ - readonly MIN_VALUE: number; - - /** - * A value that is not a number. - * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function. - */ - readonly NaN: number; - - /** - * A value that is less than the largest negative number that can be represented in JavaScript. - * JavaScript displays NEGATIVE_INFINITY values as -infinity. - */ - readonly NEGATIVE_INFINITY: number; - - /** - * A value greater than the largest number that can be represented in JavaScript. - * JavaScript displays POSITIVE_INFINITY values as infinity. - */ - readonly POSITIVE_INFINITY: number; -} - -/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */ -declare const Number: NumberConstructor; - -interface TemplateStringsArray extends ReadonlyArray { - readonly raw: ReadonlyArray -} - -interface Math { - /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ - readonly E: number; - /** The natural logarithm of 10. */ - readonly LN10: number; - /** The natural logarithm of 2. */ - readonly LN2: number; - /** The base-2 logarithm of e. */ - readonly LOG2E: number; - /** The base-10 logarithm of e. */ - readonly LOG10E: number; - /** Pi. This is the ratio of the circumference of a circle to its diameter. */ - readonly PI: number; - /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */ - readonly SQRT1_2: number; - /** The square root of 2. */ - readonly SQRT2: number; - /** - * Returns the absolute value of a number (the value without regard to whether it is positive or negative). - * For example, the absolute value of -5 is the same as the absolute value of 5. - * @param x A numeric expression for which the absolute value is needed. - */ - abs(x: number): number; - /** - * Returns the arc cosine (or inverse cosine) of a number. - * @param x A numeric expression. - */ - acos(x: number): number; - /** - * Returns the arcsine of a number. - * @param x A numeric expression. - */ - asin(x: number): number; - /** - * Returns the arctangent of a number. - * @param x A numeric expression for which the arctangent is needed. - */ - atan(x: number): number; - /** - * Returns the angle (in radians) from the X axis to a point. - * @param y A numeric expression representing the cartesian y-coordinate. - * @param x A numeric expression representing the cartesian x-coordinate. - */ - atan2(y: number, x: number): number; - /** - * Returns the smallest number greater than or equal to its numeric argument. - * @param x A numeric expression. - */ - ceil(x: number): number; - /** - * Returns the cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - cos(x: number): number; - /** - * Returns e (the base of natural logarithms) raised to a power. - * @param x A numeric expression representing the power of e. - */ - exp(x: number): number; - /** - * Returns the greatest number less than or equal to its numeric argument. - * @param x A numeric expression. - */ - floor(x: number): number; - /** - * Returns the natural logarithm (base e) of a number. - * @param x A numeric expression. - */ - log(x: number): number; - /** - * Returns the larger of a set of supplied numeric expressions. - * @param values Numeric expressions to be evaluated. - */ - max(...values: number[]): number; - /** - * Returns the smaller of a set of supplied numeric expressions. - * @param values Numeric expressions to be evaluated. - */ - min(...values: number[]): number; - /** - * Returns the value of a base expression taken to a specified power. - * @param x The base value of the expression. - * @param y The exponent value of the expression. - */ - pow(x: number, y: number): number; - /** Returns a pseudorandom number between 0 and 1. */ - random(): number; - /** - * Returns a supplied numeric expression rounded to the nearest number. - * @param x The value to be rounded to the nearest number. - */ - round(x: number): number; - /** - * Returns the sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - sin(x: number): number; - /** - * Returns the square root of a number. - * @param x A numeric expression. - */ - sqrt(x: number): number; - /** - * Returns the tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - tan(x: number): number; -} -/** An intrinsic object that provides basic mathematics functionality and constants. */ -declare const Math: Math; - -/** Enables basic storage and retrieval of dates and times. */ -interface Date { - /** Returns a string representation of a date. The format of the string depends on the locale. */ - toString(): string; - /** Returns a date as a string value. */ - toDateString(): string; - /** Returns a time as a string value. */ - toTimeString(): string; - /** Returns a value as a string value appropriate to the host environment's current locale. */ - toLocaleString(): string; - /** Returns a date as a string value appropriate to the host environment's current locale. */ - toLocaleDateString(): string; - /** Returns a time as a string value appropriate to the host environment's current locale. */ - toLocaleTimeString(): string; - /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */ - valueOf(): number; - /** Gets the time value in milliseconds. */ - getTime(): number; - /** Gets the year, using local time. */ - getFullYear(): number; - /** Gets the year using Universal Coordinated Time (UTC). */ - getUTCFullYear(): number; - /** Gets the month, using local time. */ - getMonth(): number; - /** Gets the month of a Date object using Universal Coordinated Time (UTC). */ - getUTCMonth(): number; - /** Gets the day-of-the-month, using local time. */ - getDate(): number; - /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */ - getUTCDate(): number; - /** Gets the day of the week, using local time. */ - getDay(): number; - /** Gets the day of the week using Universal Coordinated Time (UTC). */ - getUTCDay(): number; - /** Gets the hours in a date, using local time. */ - getHours(): number; - /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */ - getUTCHours(): number; - /** Gets the minutes of a Date object, using local time. */ - getMinutes(): number; - /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */ - getUTCMinutes(): number; - /** Gets the seconds of a Date object, using local time. */ - getSeconds(): number; - /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */ - getUTCSeconds(): number; - /** Gets the milliseconds of a Date, using local time. */ - getMilliseconds(): number; - /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */ - getUTCMilliseconds(): number; - /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */ - getTimezoneOffset(): number; - /** - * Sets the date and time value in the Date object. - * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT. - */ - setTime(time: number): number; - /** - * Sets the milliseconds value in the Date object using local time. - * @param ms A numeric value equal to the millisecond value. - */ - setMilliseconds(ms: number): number; - /** - * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). - * @param ms A numeric value equal to the millisecond value. - */ - setUTCMilliseconds(ms: number): number; - - /** - * Sets the seconds value in the Date object using local time. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setSeconds(sec: number, ms?: number): number; - /** - * Sets the seconds value in the Date object using Universal Coordinated Time (UTC). - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCSeconds(sec: number, ms?: number): number; - /** - * Sets the minutes value in the Date object using local time. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setMinutes(min: number, sec?: number, ms?: number): number; - /** - * Sets the minutes value in the Date object using Universal Coordinated Time (UTC). - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCMinutes(min: number, sec?: number, ms?: number): number; - /** - * Sets the hour value in the Date object using local time. - * @param hours A numeric value equal to the hours value. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setHours(hours: number, min?: number, sec?: number, ms?: number): number; - /** - * Sets the hours value in the Date object using Universal Coordinated Time (UTC). - * @param hours A numeric value equal to the hours value. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number; - /** - * Sets the numeric day-of-the-month value of the Date object using local time. - * @param date A numeric value equal to the day of the month. - */ - setDate(date: number): number; - /** - * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). - * @param date A numeric value equal to the day of the month. - */ - setUTCDate(date: number): number; - /** - * Sets the month value in the Date object using local time. - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. - * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used. - */ - setMonth(month: number, date?: number): number; - /** - * Sets the month value in the Date object using Universal Coordinated Time (UTC). - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. - * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used. - */ - setUTCMonth(month: number, date?: number): number; - /** - * Sets the year of the Date object using local time. - * @param year A numeric value for the year. - * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified. - * @param date A numeric value equal for the day of the month. - */ - setFullYear(year: number, month?: number, date?: number): number; - /** - * Sets the year value in the Date object using Universal Coordinated Time (UTC). - * @param year A numeric value equal to the year. - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied. - * @param date A numeric value equal to the day of the month. - */ - setUTCFullYear(year: number, month?: number, date?: number): number; - /** Returns a date converted to a string using Universal Coordinated Time (UTC). */ - toUTCString(): string; - /** Returns a date as a string value in ISO format. */ - toISOString(): string; - /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */ - toJSON(key?: any): string; -} - -interface DateConstructor { - new (): Date; - new (value: number): Date; - new (value: string): Date; - new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; - (): string; - readonly prototype: Date; - /** - * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. - * @param s A date string - */ - parse(s: string): number; - /** - * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date. - * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year. - * @param month The month as an number between 0 and 11 (January to December). - * @param date The date as an number between 1 and 31. - * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour. - * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes. - * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds. - * @param ms An number from 0 to 999 that specifies the milliseconds. - */ - UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; - now(): number; -} - -declare const Date: DateConstructor; - -interface RegExpMatchArray extends Array { - index?: number; - input?: string; -} - -interface RegExpExecArray extends Array { - index: number; - input: string; -} - -interface RegExp { - /** - * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. - * @param string The String object or string literal on which to perform the search. - */ - exec(string: string): RegExpExecArray | null; - - /** - * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. - * @param string String on which to perform the search. - */ - test(string: string): boolean; - - /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */ - readonly source: string; - - /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ - readonly global: boolean; - - /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */ - readonly ignoreCase: boolean; - - /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */ - readonly multiline: boolean; - - lastIndex: number; - - // Non-standard extensions - compile(): this; -} - -interface RegExpConstructor { - new (pattern: RegExp): RegExp; - new (pattern: string, flags?: string): RegExp; - (pattern: RegExp): RegExp; - (pattern: string, flags?: string): RegExp; - readonly prototype: RegExp; - - // Non-standard extensions - $1: string; - $2: string; - $3: string; - $4: string; - $5: string; - $6: string; - $7: string; - $8: string; - $9: string; - lastMatch: string; -} - -declare const RegExp: RegExpConstructor; - -interface Error { - name: string; - message: string; - stack?: string; -} - -interface ErrorConstructor { - new (message?: string): Error; - (message?: string): Error; - readonly prototype: Error; -} - -declare const Error: ErrorConstructor; - -interface EvalError extends Error { -} - -interface EvalErrorConstructor { - new (message?: string): EvalError; - (message?: string): EvalError; - readonly prototype: EvalError; -} - -declare const EvalError: EvalErrorConstructor; - -interface RangeError extends Error { -} - -interface RangeErrorConstructor { - new (message?: string): RangeError; - (message?: string): RangeError; - readonly prototype: RangeError; -} - -declare const RangeError: RangeErrorConstructor; - -interface ReferenceError extends Error { -} - -interface ReferenceErrorConstructor { - new (message?: string): ReferenceError; - (message?: string): ReferenceError; - readonly prototype: ReferenceError; -} - -declare const ReferenceError: ReferenceErrorConstructor; - -interface SyntaxError extends Error { -} - -interface SyntaxErrorConstructor { - new (message?: string): SyntaxError; - (message?: string): SyntaxError; - readonly prototype: SyntaxError; -} - -declare const SyntaxError: SyntaxErrorConstructor; - -interface TypeError extends Error { -} - -interface TypeErrorConstructor { - new (message?: string): TypeError; - (message?: string): TypeError; - readonly prototype: TypeError; -} - -declare const TypeError: TypeErrorConstructor; - -interface URIError extends Error { -} - -interface URIErrorConstructor { - new (message?: string): URIError; - (message?: string): URIError; - readonly prototype: URIError; -} - -declare const URIError: URIErrorConstructor; - -interface JSON { - /** - * Converts a JavaScript Object Notation (JSON) string into an object. - * @param text A valid JSON string. - * @param reviver A function that transforms the results. This function is called for each member of the object. - * If a member contains nested objects, the nested objects are transformed before the parent object is. - */ - parse(text: string, reviver?: (key: any, value: any) => any): any; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer A function that transforms the results. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - */ - stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer An array of strings and numbers that acts as a approved list for selecting the object properties that will be stringified. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - */ - stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string; -} - -/** - * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format. - */ -declare const JSON: JSON; - - -///////////////////////////// -/// ECMAScript Array API (specially handled by compiler) -///////////////////////////// - -interface ReadonlyArray { - /** - * Gets the length of the array. This is a number one higher than the highest element defined in an array. - */ - readonly length: number; - /** - * Returns a string representation of an array. - */ - toString(): string; - toLocaleString(): string; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat>(...items: U[]): T[]; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: T[][]): T[]; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: (T | T[])[]): T[]; - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): T[]; - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. - */ - indexOf(searchElement: T, fromIndex?: number): number; - - /** - * Returns the index of the last occurrence of a specified value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. - */ - lastIndexOf(searchElement: T, fromIndex?: number): number; - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: T, index: number, array: ReadonlyArray) => boolean, thisArg?: any): boolean; - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: T, index: number, array: ReadonlyArray) => boolean, thisArg?: any): boolean; - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: T, index: number, array: ReadonlyArray) => void, thisArg?: any): void; - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: T, index: number, array: ReadonlyArray) => U, thisArg?: any): U[]; - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: T, index: number, array: ReadonlyArray) => any, thisArg?: any): T[]; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U; - - readonly [n: number]: T; -} - -interface Array { - /** - * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. - */ - length: number; - /** - * Returns a string representation of an array. - */ - toString(): string; - toLocaleString(): string; - /** - * Appends new elements to an array, and returns the new length of the array. - * @param items New elements of the Array. - */ - push(...items: T[]): number; - /** - * Removes the last element from an array and returns it. - */ - pop(): T | undefined; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: T[][]): T[]; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: (T | T[])[]): T[]; - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - /** - * Reverses the elements in an Array. - */ - reverse(): T[]; - /** - * Removes the first element from an array and returns it. - */ - shift(): T | undefined; - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): T[]; - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: T, b: T) => number): this; - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - */ - splice(start: number): T[]; - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - * @param deleteCount The number of elements to remove. - * @param items Elements to insert into the array in place of the deleted elements. - */ - splice(start: number, deleteCount: number, ...items: T[]): T[]; - /** - * Inserts new elements at the start of an array. - * @param items Elements to insert at the start of the Array. - */ - unshift(...items: T[]): number; - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. - */ - indexOf(searchElement: T, fromIndex?: number): number; - /** - * Returns the index of the last occurrence of a specified value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. - */ - lastIndexOf(searchElement: T, fromIndex?: number): number; - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[]; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - - [n: number]: T; -} - -interface ArrayConstructor { - new (arrayLength?: number): any[]; - new (arrayLength: number): T[]; - new (...items: T[]): T[]; - (arrayLength?: number): any[]; - (arrayLength: number): T[]; - (...items: T[]): T[]; - isArray(arg: any): arg is Array; - readonly prototype: Array; -} - -declare const Array: ArrayConstructor; - -interface TypedPropertyDescriptor { - enumerable?: boolean; - configurable?: boolean; - writable?: boolean; - value?: T; - get?: () => T; - set?: (value: T) => void; -} - -declare type ClassDecorator = (target: TFunction) => TFunction | void; -declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; -declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; -declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; - -declare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike; - -interface PromiseLike { - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): PromiseLike; -} - -interface ArrayLike { - readonly length: number; - readonly [n: number]: T; -} - -/** - * Represents a raw buffer of binary data, which is used to store data for the - * different typed arrays. ArrayBuffers cannot be read from or written to directly, - * but can be passed to a typed array or DataView Object to interpret the raw - * buffer as needed. - */ -interface ArrayBuffer { - /** - * Read-only. The length of the ArrayBuffer (in bytes). - */ - readonly byteLength: number; - - /** - * Returns a section of an ArrayBuffer. - */ - slice(begin:number, end?:number): ArrayBuffer; -} - -interface ArrayBufferConstructor { - readonly prototype: ArrayBuffer; - new (byteLength: number): ArrayBuffer; - isView(arg: any): arg is ArrayBufferView; -} -declare const ArrayBuffer: ArrayBufferConstructor; - -interface ArrayBufferView { - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; -} - -interface DataView { - readonly buffer: ArrayBuffer; - readonly byteLength: number; - readonly byteOffset: number; - /** - * Gets the Float32 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Float64 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat64(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Int8 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt8(byteOffset: number): number; - - /** - * Gets the Int16 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt16(byteOffset: number, littleEndian?: boolean): number; - /** - * Gets the Int32 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint8 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint8(byteOffset: number): number; - - /** - * Gets the Uint16 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint16(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint32 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Stores an Float32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Float64 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Int8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setInt8(byteOffset: number, value: number): void; - - /** - * Stores an Int16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Int32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setUint8(byteOffset: number, value: number): void; - - /** - * Stores an Uint16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; -} - -interface DataViewConstructor { - new (buffer: ArrayBuffer, byteOffset?: number, byteLength?: number): DataView; -} -declare const DataView: DataViewConstructor; - -/** - * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Int8Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Int8Array) => any, thisArg?: any): Int8Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Int8Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Int8Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int8Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} -interface Int8ArrayConstructor { - readonly prototype: Int8Array; - new (length: number): Int8Array; - new (array: ArrayLike): Int8Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Int8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; - -} -declare const Int8Array: Int8ArrayConstructor; - -/** - * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint8Array) => any, thisArg?: any): Uint8Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint8Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint8Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint8Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Uint8ArrayConstructor { - readonly prototype: Uint8Array; - new (length: number): Uint8Array; - new (array: ArrayLike): Uint8Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; - -} -declare const Uint8Array: Uint8ArrayConstructor; - -/** - * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. - * If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8ClampedArray { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => any, thisArg?: any): Uint8ClampedArray; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint8ClampedArray; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint8ClampedArray, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint8ClampedArray; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint8ClampedArray; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Uint8ClampedArrayConstructor { - readonly prototype: Uint8ClampedArray; - new (length: number): Uint8ClampedArray; - new (array: ArrayLike): Uint8ClampedArray; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8ClampedArray; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint8ClampedArray; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; -} -declare const Uint8ClampedArray: Uint8ClampedArrayConstructor; - -/** - * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int16Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Int16Array) => any, thisArg?: any): Int16Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Int16Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Int16Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int16Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Int16ArrayConstructor { - readonly prototype: Int16Array; - new (length: number): Int16Array; - new (array: ArrayLike): Int16Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Int16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; - -} -declare const Int16Array: Int16ArrayConstructor; - -/** - * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint16Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint16Array) => any, thisArg?: any): Uint16Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint16Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint16Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint16Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Uint16ArrayConstructor { - readonly prototype: Uint16Array; - new (length: number): Uint16Array; - new (array: ArrayLike): Uint16Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; - -} -declare const Uint16Array: Uint16ArrayConstructor; -/** - * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int32Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Int32Array) => any, thisArg?: any): Int32Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Int32Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Int32Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int32Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Int32ArrayConstructor { - readonly prototype: Int32Array; - new (length: number): Int32Array; - new (array: ArrayLike): Int32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Int32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; -} -declare const Int32Array: Int32ArrayConstructor; - -/** - * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint32Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint32Array) => any, thisArg?: any): Uint32Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint32Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint32Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint32Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Uint32ArrayConstructor { - readonly prototype: Uint32Array; - new (length: number): Uint32Array; - new (array: ArrayLike): Uint32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; -} -declare const Uint32Array: Uint32ArrayConstructor; - -/** - * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number - * of bytes could not be allocated an exception is raised. - */ -interface Float32Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Float32Array) => any, thisArg?: any): Float32Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Float32Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Float32Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Float32Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Float32ArrayConstructor { - readonly prototype: Float32Array; - new (length: number): Float32Array; - new (array: ArrayLike): Float32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Float32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; - -} -declare const Float32Array: Float32ArrayConstructor; - -/** - * A typed array of 64-bit float values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Float64Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Float64Array) => any, thisArg?: any): Float64Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Float64Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Float64Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Float64Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Float64ArrayConstructor { - readonly prototype: Float64Array; - new (length: number): Float64Array; - new (array: ArrayLike): Float64Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Float64Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; -} -declare const Float64Array: Float64ArrayConstructor; - -///////////////////////////// -/// ECMAScript Internationalization API -///////////////////////////// - -declare module Intl { - interface CollatorOptions { - usage?: string; - localeMatcher?: string; - numeric?: boolean; - caseFirst?: string; - sensitivity?: string; - ignorePunctuation?: boolean; - } - - interface ResolvedCollatorOptions { - locale: string; - usage: string; - sensitivity: string; - ignorePunctuation: boolean; - collation: string; - caseFirst: string; - numeric: boolean; - } - - interface Collator { - compare(x: string, y: string): number; - resolvedOptions(): ResolvedCollatorOptions; - } - var Collator: { - new (locales?: string[], options?: CollatorOptions): Collator; - new (locale?: string, options?: CollatorOptions): Collator; - (locales?: string[], options?: CollatorOptions): Collator; - (locale?: string, options?: CollatorOptions): Collator; - supportedLocalesOf(locales: string[], options?: CollatorOptions): string[]; - supportedLocalesOf(locale: string, options?: CollatorOptions): string[]; - } - - interface NumberFormatOptions { - localeMatcher?: string; - style?: string; - currency?: string; - currencyDisplay?: string; - useGrouping?: boolean; - minimumIntegerDigits?: number; - minimumFractionDigits?: number; - maximumFractionDigits?: number; - minimumSignificantDigits?: number; - maximumSignificantDigits?: number; - } - - interface ResolvedNumberFormatOptions { - locale: string; - numberingSystem: string; - style: string; - currency?: string; - currencyDisplay?: string; - minimumIntegerDigits: number; - minimumFractionDigits: number; - maximumFractionDigits: number; - minimumSignificantDigits?: number; - maximumSignificantDigits?: number; - useGrouping: boolean; - } - - interface NumberFormat { - format(value: number): string; - resolvedOptions(): ResolvedNumberFormatOptions; - } - var NumberFormat: { - new (locales?: string[], options?: NumberFormatOptions): NumberFormat; - new (locale?: string, options?: NumberFormatOptions): NumberFormat; - (locales?: string[], options?: NumberFormatOptions): NumberFormat; - (locale?: string, options?: NumberFormatOptions): NumberFormat; - supportedLocalesOf(locales: string[], options?: NumberFormatOptions): string[]; - supportedLocalesOf(locale: string, options?: NumberFormatOptions): string[]; - } - - interface DateTimeFormatOptions { - localeMatcher?: string; - weekday?: string; - era?: string; - year?: string; - month?: string; - day?: string; - hour?: string; - minute?: string; - second?: string; - timeZoneName?: string; - formatMatcher?: string; - hour12?: boolean; - timeZone?: string; - } - - interface ResolvedDateTimeFormatOptions { - locale: string; - calendar: string; - numberingSystem: string; - timeZone: string; - hour12?: boolean; - weekday?: string; - era?: string; - year?: string; - month?: string; - day?: string; - hour?: string; - minute?: string; - second?: string; - timeZoneName?: string; - } - - interface DateTimeFormat { - format(date?: Date | number): string; - resolvedOptions(): ResolvedDateTimeFormatOptions; - } - var DateTimeFormat: { - new (locales?: string[], options?: DateTimeFormatOptions): DateTimeFormat; - new (locale?: string, options?: DateTimeFormatOptions): DateTimeFormat; - (locales?: string[], options?: DateTimeFormatOptions): DateTimeFormat; - (locale?: string, options?: DateTimeFormatOptions): DateTimeFormat; - supportedLocalesOf(locales: string[], options?: DateTimeFormatOptions): string[]; - supportedLocalesOf(locale: string, options?: DateTimeFormatOptions): string[]; - } -} - -interface String { - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. - * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. - */ - localeCompare(that: string, locales: string[], options?: Intl.CollatorOptions): number; - - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. - * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. - */ - localeCompare(that: string, locale: string, options?: Intl.CollatorOptions): number; -} - -interface Number { - /** - * Converts a number to a string by using the current or specified locale. - * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locales?: string[], options?: Intl.NumberFormatOptions): string; - - /** - * Converts a number to a string by using the current or specified locale. - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locale?: string, options?: Intl.NumberFormatOptions): string; -} - -interface Date { - /** - * Converts a date and time to a string by using the current or specified locale. - * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locales?: string[], options?: Intl.DateTimeFormatOptions): string; - /** - * Converts a date to a string by using the current or specified locale. - * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleDateString(locales?: string[], options?: Intl.DateTimeFormatOptions): string; - - /** - * Converts a time to a string by using the current or specified locale. - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleTimeString(locale?: string[], options?: Intl.DateTimeFormatOptions): string; - - /** - * Converts a date and time to a string by using the current or specified locale. - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string; - - /** - * Converts a date to a string by using the current or specified locale. - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleDateString(locale?: string, options?: Intl.DateTimeFormatOptions): string; - - /** - * Converts a time to a string by using the current or specified locale. - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleTimeString(locale?: string, options?: Intl.DateTimeFormatOptions): string; -} -declare type PropertyKey = string | number | symbol; - -interface Array { - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: T) => boolean, thisArg?: any): number; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: T, start?: number, end?: number): this; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; -} - -interface ArrayConstructor { - /** - * Creates an array from an array-like object. - * @param arrayLike An array-like object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - - - /** - * Creates an array from an array-like object. - * @param arrayLike An array-like object to convert to an array. - */ - from(arrayLike: ArrayLike): Array; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: T[]): Array; -} - -interface DateConstructor { - new (value: Date): Date; -} - -interface Function { - /** - * Returns the name of the function. Function names are read-only and can not be changed. - */ - readonly name: string; -} - -interface Math { - /** - * Returns the number of leading zero bits in the 32-bit binary representation of a number. - * @param x A numeric expression. - */ - clz32(x: number): number; - - /** - * Returns the result of 32-bit multiplication of two numbers. - * @param x First number - * @param y Second number - */ - imul(x: number, y: number): number; - - /** - * Returns the sign of the x, indicating whether x is positive, negative or zero. - * @param x The numeric expression to test - */ - sign(x: number): number; - - /** - * Returns the base 10 logarithm of a number. - * @param x A numeric expression. - */ - log10(x: number): number; - - /** - * Returns the base 2 logarithm of a number. - * @param x A numeric expression. - */ - log2(x: number): number; - - /** - * Returns the natural logarithm of 1 + x. - * @param x A numeric expression. - */ - log1p(x: number): number; - - /** - * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of - * the natural logarithms). - * @param x A numeric expression. - */ - expm1(x: number): number; - - /** - * Returns the hyperbolic cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - cosh(x: number): number; - - /** - * Returns the hyperbolic sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - sinh(x: number): number; - - /** - * Returns the hyperbolic tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - tanh(x: number): number; - - /** - * Returns the inverse hyperbolic cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - acosh(x: number): number; - - /** - * Returns the inverse hyperbolic sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - asinh(x: number): number; - - /** - * Returns the inverse hyperbolic tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - atanh(x: number): number; - - /** - * Returns the square root of the sum of squares of its arguments. - * @param values Values to compute the square root for. - * If no arguments are passed, the result is +0. - * If there is only one argument, the result is the absolute value. - * If any argument is +Infinity or -Infinity, the result is +Infinity. - * If any argument is NaN, the result is NaN. - * If all arguments are either +0 or −0, the result is +0. - */ - hypot(...values: number[] ): number; - - /** - * Returns the integral part of the a numeric expression, x, removing any fractional digits. - * If x is already an integer, the result is x. - * @param x A numeric expression. - */ - trunc(x: number): number; - - /** - * Returns the nearest single precision float representation of a number. - * @param x A numeric expression. - */ - fround(x: number): number; - - /** - * Returns an implementation-dependent approximation to the cube root of number. - * @param x A numeric expression. - */ - cbrt(x: number): number; -} - -interface NumberConstructor { - /** - * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 - * that is representable as a Number value, which is approximately: - * 2.2204460492503130808472633361816 x 10â€âˆ’â€16. - */ - readonly EPSILON: number; - - /** - * Returns true if passed value is finite. - * Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a - * number. Only finite values of the type number, result in true. - * @param number A numeric value. - */ - isFinite(number: number): boolean; - - /** - * Returns true if the value passed is an integer, false otherwise. - * @param number A numeric value. - */ - isInteger(number: number): boolean; - - /** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a - * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter - * to a number. Only values of the type number, that are also NaN, result in true. - * @param number A numeric value. - */ - isNaN(number: number): boolean; - - /** - * Returns true if the value passed is a safe integer. - * @param number A numeric value. - */ - isSafeInteger(number: number): boolean; - - /** - * The value of the largest integer n such that n and n + 1 are both exactly representable as - * a Number value. - * The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1. - */ - readonly MAX_SAFE_INTEGER: number; - - /** - * The value of the smallest integer n such that n and n − 1 are both exactly representable as - * a Number value. - * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). - */ - readonly MIN_SAFE_INTEGER: number; - - /** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. - */ - parseFloat(string: string): number; - - /** - * Converts A string to an integer. - * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. - * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. - * All other strings are considered decimal. - */ - parseInt(string: string, radix?: number): number; -} - -interface Object { - /** - * Determines whether an object has a property with the specified name. - * @param v A property name. - */ - hasOwnProperty(v: PropertyKey): boolean - - /** - * Determines whether a specified property is enumerable. - * @param v A property name. - */ - propertyIsEnumerable(v: PropertyKey): boolean; -} - -interface ObjectConstructor { - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source The source object from which to copy properties. - */ - assign(target: T, source: U): T & U; - - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source1 The first source object from which to copy properties. - * @param source2 The second source object from which to copy properties. - */ - assign(target: T, source1: U, source2: V): T & U & V; - - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source1 The first source object from which to copy properties. - * @param source2 The second source object from which to copy properties. - * @param source3 The third source object from which to copy properties. - */ - assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; - - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param sources One or more source objects from which to copy properties - */ - assign(target: any, ...sources: any[]): any; - - /** - * Returns an array of all symbol properties found directly on object o. - * @param o Object to retrieve the symbols from. - */ - getOwnPropertySymbols(o: any): symbol[]; - - /** - * Returns true if the values are the same value, false otherwise. - * @param value1 The first value. - * @param value2 The second value. - */ - is(value1: any, value2: any): boolean; - - /** - * Sets the prototype of a specified object o to object proto or null. Returns the object o. - * @param o The object to change its prototype. - * @param proto The value of the new prototype or null. - */ - setPrototypeOf(o: any, proto: any): any; - - /** - * Gets the own property descriptor of the specified object. - * An own property descriptor is one that is defined directly on the object and is not - * inherited from the object's prototype. - * @param o Object that contains the property. - * @param p Name of the property. - */ - getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor; - - /** - * Adds a property to an object, or modifies attributes of an existing property. - * @param o Object on which to add or modify the property. This can be a native JavaScript - * object (that is, a user-defined object or a built in object) or a DOM object. - * @param p The property name. - * @param attributes Descriptor for the property. It can be for a data property or an accessor - * property. - */ - defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any; -} - -interface ReadonlyArray { - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: T, index: number, obj: ReadonlyArray) => boolean, thisArg?: any): T | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: T) => boolean, thisArg?: any): number; -} - -interface RegExp { - /** - * Returns a string indicating the flags of the regular expression in question. This field is read-only. - * The characters in this string are sequenced and concatenated in the following order: - * - * - "g" for global - * - "i" for ignoreCase - * - "m" for multiline - * - "u" for unicode - * - "y" for sticky - * - * If no flags are set, the value is the empty string. - */ - readonly flags: string; - - /** - * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular - * expression. Default is false. Read-only. - */ - readonly sticky: boolean; - - /** - * Returns a Boolean value indicating the state of the Unicode flag (u) used with a regular - * expression. Default is false. Read-only. - */ - readonly unicode: boolean; -} - -interface RegExpConstructor { - new (pattern: RegExp, flags?: string): RegExp; - (pattern: RegExp, flags?: string): RegExp; -} - -interface String { - /** - * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point - * value of the UTF-16 encoded code point starting at the string element at position pos in - * the String resulting from converting this object to a String. - * If there is no element at that position, the result is undefined. - * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. - */ - codePointAt(pos: number): number | undefined; - - /** - * Returns true if searchString appears as a substring of the result of converting this - * object to a String, at one or more positions that are - * greater than or equal to position; otherwise, returns false. - * @param searchString search string - * @param position If position is undefined, 0 is assumed, so as to search all of the String. - */ - includes(searchString: string, position?: number): boolean; - - /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * endPosition – length(this). Otherwise returns false. - */ - endsWith(searchString: string, endPosition?: number): boolean; - - /** - * Returns the String value result of normalizing the string into the normalization form - * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. - * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default - * is "NFC" - */ - normalize(form: "NFC" | "NFD" | "NFKC" | "NFKD"): string; - - /** - * Returns the String value result of normalizing the string into the normalization form - * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. - * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default - * is "NFC" - */ - normalize(form?: string): string; - - /** - * Returns a String value that is made from count copies appended together. If count is 0, - * T is the empty String is returned. - * @param count number of copies to append - */ - repeat(count: number): string; - - /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * position. Otherwise returns false. - */ - startsWith(searchString: string, position?: number): boolean; - - /** - * Returns an HTML anchor element and sets the name attribute to the text value - * @param name - */ - anchor(name: string): string; - - /** Returns a HTML element */ - big(): string; - - /** Returns a HTML element */ - blink(): string; - - /** Returns a HTML element */ - bold(): string; - - /** Returns a HTML element */ - fixed(): string - - /** Returns a HTML element and sets the color attribute value */ - fontcolor(color: string): string - - /** Returns a HTML element and sets the size attribute value */ - fontsize(size: number): string; - - /** Returns a HTML element and sets the size attribute value */ - fontsize(size: string): string; - - /** Returns an HTML element */ - italics(): string; - - /** Returns an HTML element and sets the href attribute value */ - link(url: string): string; - - /** Returns a HTML element */ - small(): string; - - /** Returns a HTML element */ - strike(): string; - - /** Returns a HTML element */ - sub(): string; - - /** Returns a HTML element */ - sup(): string; -} - -interface StringConstructor { - /** - * Return the String value whose elements are, in order, the elements in the List elements. - * If length is 0, the empty string is returned. - */ - fromCodePoint(...codePoints: number[]): string; - - /** - * String.raw is intended for use as a tag function of a Tagged Template String. When called - * as such the first argument will be a well formed template call site object and the rest - * parameter will contain the substitution values. - * @param template A well-formed template string call site representation. - * @param substitutions A set of substitution values. - */ - raw(template: TemplateStringsArray, ...substitutions: any[]): string; -} -interface Map { - clear(): void; - delete(key: K): boolean; - forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; - get(key: K): V | undefined; - has(key: K): boolean; - set(key: K, value?: V): this; - readonly size: number; -} - -interface MapConstructor { - new (): Map; - new (entries?: [K, V][]): Map; - readonly prototype: Map; -} -declare var Map: MapConstructor; - -interface WeakMap { - clear(): void; - delete(key: K): boolean; - get(key: K): V | undefined; - has(key: K): boolean; - set(key: K, value?: V): this; -} - -interface WeakMapConstructor { - new (): WeakMap; - new (entries?: [K, V][]): WeakMap; - readonly prototype: WeakMap; -} -declare var WeakMap: WeakMapConstructor; - -interface Set { - add(value: T): this; - clear(): void; - delete(value: T): boolean; - forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; - has(value: T): boolean; - readonly size: number; -} - -interface SetConstructor { - new (): Set; - new (values?: T[]): Set; - readonly prototype: Set; -} -declare var Set: SetConstructor; - -interface WeakSet { - add(value: T): this; - clear(): void; - delete(value: T): boolean; - has(value: T): boolean; -} - -interface WeakSetConstructor { - new (): WeakSet; - new (values?: T[]): WeakSet; - readonly prototype: WeakSet; -} -declare var WeakSet: WeakSetConstructor; -interface GeneratorFunction extends Function { } - -interface GeneratorFunctionConstructor { - /** - * Creates a new Generator function. - * @param args A list of arguments the function accepts. - */ - new (...args: string[]): GeneratorFunction; - (...args: string[]): GeneratorFunction; - readonly prototype: GeneratorFunction; -} -declare var GeneratorFunction: GeneratorFunctionConstructor; -/// - -interface SymbolConstructor { - /** - * A method that returns the default iterator for an object. Called by the semantics of the - * for-of statement. - */ - readonly iterator: symbol; -} - -interface IteratorResult { - done: boolean; - value: T; -} - -interface Iterator { - next(value?: any): IteratorResult; - return?(value?: any): IteratorResult; - throw?(e?: any): IteratorResult; -} - -interface Iterable { - [Symbol.iterator](): Iterator; -} - -interface IterableIterator extends Iterator { - [Symbol.iterator](): IterableIterator; -} - -interface Array { - /** Iterator */ - [Symbol.iterator](): IterableIterator; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, T]>; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface ArrayConstructor { - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - */ - from(iterable: Iterable): Array; -} - -interface ReadonlyArray { - /** Iterator */ - [Symbol.iterator](): IterableIterator; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, T]>; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface IArguments { - /** Iterator */ - [Symbol.iterator](): IterableIterator; -} - -interface Map { - [Symbol.iterator](): IterableIterator<[K,V]>; - entries(): IterableIterator<[K, V]>; - keys(): IterableIterator; - values(): IterableIterator; -} - -interface MapConstructor { - new (iterable: Iterable<[K, V]>): Map; -} - -interface WeakMap { } - -interface WeakMapConstructor { - new (iterable: Iterable<[K, V]>): WeakMap; -} - -interface Set { - [Symbol.iterator](): IterableIterator; - entries(): IterableIterator<[T, T]>; - keys(): IterableIterator; - values(): IterableIterator; -} - -interface SetConstructor { - new (iterable: Iterable): Set; -} - -interface WeakSet { } - -interface WeakSetConstructor { - new (iterable: Iterable): WeakSet; -} - -interface Promise { } - -interface PromiseConstructor { - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: Iterable>): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: Iterable>): Promise; -} - -declare namespace Reflect { - function enumerate(target: any): IterableIterator; -} - -interface String { - /** Iterator */ - [Symbol.iterator](): IterableIterator; -} - -/** - * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Int8Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Int8ArrayConstructor { - new (elements: Iterable): Int8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; -} - -/** - * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Uint8ArrayConstructor { - new (elements: Iterable): Uint8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; -} - -/** - * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. - * If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8ClampedArray { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Uint8ClampedArrayConstructor { - new (elements: Iterable): Uint8ClampedArray; - - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; -} - -/** - * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int16Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Int16ArrayConstructor { - new (elements: Iterable): Int16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; -} - -/** - * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint16Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Uint16ArrayConstructor { - new (elements: Iterable): Uint16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; -} - -/** - * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int32Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Int32ArrayConstructor { - new (elements: Iterable): Int32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; -} - -/** - * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint32Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Uint32ArrayConstructor { - new (elements: Iterable): Uint32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; -} - -/** - * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number - * of bytes could not be allocated an exception is raised. - */ -interface Float32Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Float32ArrayConstructor { - new (elements: Iterable): Float32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; -} - -/** - * A typed array of 64-bit float values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Float64Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Float64ArrayConstructor { - new (elements: Iterable): Float64Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; -}/** - * Represents the completion of an asynchronous operation - */ -interface Promise { - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled: (value: T) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled: (value: T) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled: (value: T) => TResult | PromiseLike): Promise; - - /** - * Creates a new Promise with the same internal state of this Promise. - * @returns A Promise. - */ - then(): Promise; - - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected: (reason: any) => TResult | PromiseLike): Promise; - - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected: (reason: any) => T | PromiseLike): Promise; -} - -interface PromiseConstructor { - /** - * A reference to the prototype. - */ - readonly prototype: Promise; - - /** - * Creates a new Promise. - * @param executor A callback used to initialize the promise. This callback is passed two arguments: - * a resolve callback used resolve the promise with a value or the result of another promise, - * and a reject callback used to reject the promise with a provided reason or error. - */ - new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: (T | PromiseLike)[]): Promise; - - /** - * Creates a new rejected promise for the provided reason. - * @param reason The reason the promise was rejected. - * @returns A new rejected Promise. - */ - reject(reason: any): Promise; - - /** - * Creates a new rejected promise for the provided reason. - * @param reason The reason the promise was rejected. - * @returns A new rejected Promise. - */ - reject(reason: any): Promise; - - /** - * Creates a new resolved promise for the provided value. - * @param value A promise. - * @returns A promise whose internal state matches the provided promise. - */ - resolve(value: T | PromiseLike): Promise; - - /** - * Creates a new resolved promise . - * @returns A resolved promise. - */ - resolve(): Promise; -} - -declare var Promise: PromiseConstructor;interface ProxyHandler { - getPrototypeOf? (target: T): any; - setPrototypeOf? (target: T, v: any): boolean; - isExtensible? (target: T): boolean; - preventExtensions? (target: T): boolean; - getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor; - has? (target: T, p: PropertyKey): boolean; - get? (target: T, p: PropertyKey, receiver: any): any; - set? (target: T, p: PropertyKey, value: any, receiver: any): boolean; - deleteProperty? (target: T, p: PropertyKey): boolean; - defineProperty? (target: T, p: PropertyKey, attributes: PropertyDescriptor): boolean; - enumerate? (target: T): PropertyKey[]; - ownKeys? (target: T): PropertyKey[]; - apply? (target: T, thisArg: any, argArray?: any): any; - construct? (target: T, thisArg: any, argArray?: any): any; -} - -interface ProxyConstructor { - revocable(target: T, handler: ProxyHandler): { proxy: T; revoke: () => void; }; - new (target: T, handler: ProxyHandler): T -} -declare var Proxy: ProxyConstructor;declare namespace Reflect { - function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; - function construct(target: Function, argumentsList: ArrayLike, newTarget?: any): any; - function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; - function deleteProperty(target: any, propertyKey: PropertyKey): boolean; - function get(target: any, propertyKey: PropertyKey, receiver?: any): any; - function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; - function getPrototypeOf(target: any): any; - function has(target: any, propertyKey: string): boolean; - function has(target: any, propertyKey: symbol): boolean; - function isExtensible(target: any): boolean; - function ownKeys(target: any): Array; - function preventExtensions(target: any): boolean; - function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; - function setPrototypeOf(target: any, proto: any): boolean; -}interface Symbol { - /** Returns a string representation of an object. */ - toString(): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): Object; -} - -interface SymbolConstructor { - /** - * A reference to the prototype. - */ - readonly prototype: Symbol; - - /** - * Returns a new unique Symbol value. - * @param description Description of the new Symbol object. - */ - (description?: string|number): symbol; - - /** - * Returns a Symbol object from the global symbol registry matching the given key if found. - * Otherwise, returns a new symbol with this key. - * @param key key to search for. - */ - for(key: string): symbol; - - /** - * Returns a key from the global symbol registry matching the given Symbol if found. - * Otherwise, returns a undefined. - * @param sym Symbol to find the key for. - */ - keyFor(sym: symbol): string | undefined; -} - -declare var Symbol: SymbolConstructor;/// - -interface SymbolConstructor { - /** - * A method that determines if a constructor object recognizes an object as one of the - * constructor’s instances. Called by the semantics of the instanceof operator. - */ - readonly hasInstance: symbol; - - /** - * A Boolean value that if true indicates that an object should flatten to its array elements - * by Array.prototype.concat. - */ - readonly isConcatSpreadable: symbol; - - /** - * A regular expression method that matches the regular expression against a string. Called - * by the String.prototype.match method. - */ - readonly match: symbol; - - /** - * A regular expression method that replaces matched substrings of a string. Called by the - * String.prototype.replace method. - */ - readonly replace: symbol; - - /** - * A regular expression method that returns the index within a string that matches the - * regular expression. Called by the String.prototype.search method. - */ - readonly search: symbol; - - /** - * A function valued property that is the constructor function that is used to create - * derived objects. - */ - readonly species: symbol; - - /** - * A regular expression method that splits a string at the indices that match the regular - * expression. Called by the String.prototype.split method. - */ - readonly split: symbol; - - /** - * A method that converts an object to a corresponding primitive value. - * Called by the ToPrimitive abstract operation. - */ - readonly toPrimitive: symbol; - - /** - * A String value that is used in the creation of the default string description of an object. - * Called by the built-in method Object.prototype.toString. - */ - readonly toStringTag: symbol; - - /** - * An Object whose own property names are property names that are excluded from the 'with' - * environment bindings of the associated objects. - */ - readonly unscopables: symbol; -} - -interface Symbol { - readonly [Symbol.toStringTag]: "Symbol"; -} - -interface Array { - /** - * Returns an object whose properties have the value 'true' - * when they will be absent when used in a 'with' statement. - */ - [Symbol.unscopables](): { - copyWithin: boolean; - entries: boolean; - fill: boolean; - find: boolean; - findIndex: boolean; - keys: boolean; - values: boolean; - }; -} - -interface Date { - /** - * Converts a Date object to a string. - */ - [Symbol.toPrimitive](hint: "default"): string; - /** - * Converts a Date object to a string. - */ - [Symbol.toPrimitive](hint: "string"): string; - /** - * Converts a Date object to a number. - */ - [Symbol.toPrimitive](hint: "number"): number; - /** - * Converts a Date object to a string or number. - * - * @param hint The strings "number", "string", or "default" to specify what primitive to return. - * - * @throws {TypeError} If 'hint' was given something other than "number", "string", or "default". - * @returns A number if 'hint' was "number", a string if 'hint' was "string" or "default". - */ - [Symbol.toPrimitive](hint: string): string | number; -} - -interface Map { - readonly [Symbol.toStringTag]: "Map"; -} - -interface WeakMap{ - readonly [Symbol.toStringTag]: "WeakMap"; -} - -interface Set { - readonly [Symbol.toStringTag]: "Set"; -} - -interface WeakSet { - readonly [Symbol.toStringTag]: "WeakSet"; -} - -interface JSON { - readonly [Symbol.toStringTag]: "JSON"; -} - -interface Function { - /** - * Determines whether the given value inherits from this function if this function was used - * as a constructor function. - * - * A constructor function can control which objects are recognized as its instances by - * 'instanceof' by overriding this method. - */ - [Symbol.hasInstance](value: any): boolean; -} - -interface GeneratorFunction extends Function { - readonly [Symbol.toStringTag]: "GeneratorFunction"; -} - -interface Math { - readonly [Symbol.toStringTag]: "Math"; -} - -interface Promise { - readonly [Symbol.toStringTag]: "Promise"; -} - -interface PromiseConstructor { - readonly [Symbol.species]: Function; -} - -interface RegExp { - /** - * Matches a string with this regular expression, and returns an array containing the results of - * that search. - * @param string A string to search within. - */ - [Symbol.match](string: string): RegExpMatchArray | null; - - /** - * Replaces text in a string, using this regular expression. - * @param string A String object or string literal whose contents matching against - * this regular expression will be replaced - * @param replaceValue A String object or string literal containing the text to replace for every - * successful match of this regular expression. - */ - [Symbol.replace](string: string, replaceValue: string): string; - - /** - * Replaces text in a string, using this regular expression. - * @param string A String object or string literal whose contents matching against - * this regular expression will be replaced - * @param replacer A function that returns the replacement text. - */ - [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; - - /** - * Finds the position beginning first substring match in a regular expression search - * using this regular expression. - * - * @param string The string to search within. - */ - [Symbol.search](string: string): number; - - /** - * Returns an array of substrings that were delimited by strings in the original input that - * match against this regular expression. - * - * If the regular expression contains capturing parentheses, then each time this - * regular expression matches, the results (including any undefined results) of the - * capturing parentheses are spliced. - * - * @param string string value to split - * @param limit if not undefined, the output array is truncated so that it contains no more - * than 'limit' elements. - */ - [Symbol.split](string: string, limit?: number): string[]; -} - -interface RegExpConstructor { - [Symbol.species](): RegExpConstructor; -} - -interface String { - /** - * Matches a string an object that supports being matched against, and returns an array containing the results of that search. - * @param matcher An object that supports being matched against. - */ - match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null; - - /** - * Replaces text in a string, using an object that supports replacement within a string. - * @param searchValue A object can search for and replace matches within a string. - * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. - */ - replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string; - - /** - * Replaces text in a string, using an object that supports replacement within a string. - * @param searchValue A object can search for and replace matches within a string. - * @param replacer A function that returns the replacement text. - */ - replace(searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string; - - /** - * Finds the first substring match in a regular expression search. - * @param searcher An object which supports searching within a string. - */ - search(searcher: { [Symbol.search](string: string): number; }): number; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param splitter An object that can split a string. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number): string[]; -} - -/** - * Represents a raw buffer of binary data, which is used to store data for the - * different typed arrays. ArrayBuffers cannot be read from or written to directly, - * but can be passed to a typed array or DataView Object to interpret the raw - * buffer as needed. - */ -interface ArrayBuffer { - readonly [Symbol.toStringTag]: "ArrayBuffer"; -} - -interface DataView { - readonly [Symbol.toStringTag]: "DataView"; -} - -/** - * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Int8Array { - readonly [Symbol.toStringTag]: "Int8Array"; -} - -/** - * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8Array { - readonly [Symbol.toStringTag]: "UInt8Array"; -} - -/** - * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. - * If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8ClampedArray { - readonly [Symbol.toStringTag]: "Uint8ClampedArray"; -} - -/** - * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int16Array { - readonly [Symbol.toStringTag]: "Int16Array"; -} - -/** - * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint16Array { - readonly [Symbol.toStringTag]: "Uint16Array"; -} - -/** - * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int32Array { - readonly [Symbol.toStringTag]: "Int32Array"; -} - -/** - * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint32Array { - readonly [Symbol.toStringTag]: "Uint32Array"; -} - -/** - * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number - * of bytes could not be allocated an exception is raised. - */ -interface Float32Array { - readonly [Symbol.toStringTag]: "Float32Array"; -} - -/** - * A typed array of 64-bit float values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Float64Array { - readonly [Symbol.toStringTag]: "Float64Array"; -} -///////////////////////////// -/// IE DOM APIs -///////////////////////////// - -interface Algorithm { - name: string; -} - -interface AriaRequestEventInit extends EventInit { - attributeName?: string; - attributeValue?: string; -} - -interface CommandEventInit extends EventInit { - commandName?: string; - detail?: string; -} - -interface CompositionEventInit extends UIEventInit { - data?: string; -} - -interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation { - arrayOfDomainStrings?: string[]; -} - -interface ConstrainBooleanParameters { - exact?: boolean; - ideal?: boolean; -} - -interface ConstrainDOMStringParameters { - exact?: string | string[]; - ideal?: string | string[]; -} - -interface ConstrainDoubleRange extends DoubleRange { - exact?: number; - ideal?: number; -} - -interface ConstrainLongRange extends LongRange { - exact?: number; - ideal?: number; -} - -interface ConstrainVideoFacingModeParameters { - exact?: string | string[]; - ideal?: string | string[]; -} - -interface CustomEventInit extends EventInit { - detail?: any; -} - -interface DeviceAccelerationDict { - x?: number; - y?: number; - z?: number; -} - -interface DeviceLightEventInit extends EventInit { - value?: number; -} - -interface DeviceRotationRateDict { - alpha?: number; - beta?: number; - gamma?: number; -} - -interface DoubleRange { - max?: number; - min?: number; -} - -interface EventInit { - bubbles?: boolean; - cancelable?: boolean; -} - -interface EventModifierInit extends UIEventInit { - ctrlKey?: boolean; - shiftKey?: boolean; - altKey?: boolean; - metaKey?: boolean; - modifierAltGraph?: boolean; - modifierCapsLock?: boolean; - modifierFn?: boolean; - modifierFnLock?: boolean; - modifierHyper?: boolean; - modifierNumLock?: boolean; - modifierOS?: boolean; - modifierScrollLock?: boolean; - modifierSuper?: boolean; - modifierSymbol?: boolean; - modifierSymbolLock?: boolean; -} - -interface ExceptionInformation { - domain?: string; -} - -interface FocusEventInit extends UIEventInit { - relatedTarget?: EventTarget; -} - -interface HashChangeEventInit extends EventInit { - newURL?: string; - oldURL?: string; -} - -interface IDBIndexParameters { - multiEntry?: boolean; - unique?: boolean; -} - -interface IDBObjectStoreParameters { - autoIncrement?: boolean; - keyPath?: IDBKeyPath; -} - -interface KeyAlgorithm { - name?: string; -} - -interface KeyboardEventInit extends EventModifierInit { - code?: string; - key?: string; - location?: number; - repeat?: boolean; -} - -interface LongRange { - max?: number; - min?: number; -} - -interface MSAccountInfo { - rpDisplayName?: string; - userDisplayName?: string; - accountName?: string; - userId?: string; - accountImageUri?: string; -} - -interface MSAudioLocalClientEvent extends MSLocalClientEventBase { - networkSendQualityEventRatio?: number; - networkDelayEventRatio?: number; - cpuInsufficientEventRatio?: number; - deviceHalfDuplexAECEventRatio?: number; - deviceRenderNotFunctioningEventRatio?: number; - deviceCaptureNotFunctioningEventRatio?: number; - deviceGlitchesEventRatio?: number; - deviceLowSNREventRatio?: number; - deviceLowSpeechLevelEventRatio?: number; - deviceClippingEventRatio?: number; - deviceEchoEventRatio?: number; - deviceNearEndToEchoRatioEventRatio?: number; - deviceRenderZeroVolumeEventRatio?: number; - deviceRenderMuteEventRatio?: number; - deviceMultipleEndpointsEventCount?: number; - deviceHowlingEventCount?: number; -} - -interface MSAudioRecvPayload extends MSPayloadBase { - samplingRate?: number; - signal?: MSAudioRecvSignal; - packetReorderRatio?: number; - packetReorderDepthAvg?: number; - packetReorderDepthMax?: number; - burstLossLength1?: number; - burstLossLength2?: number; - burstLossLength3?: number; - burstLossLength4?: number; - burstLossLength5?: number; - burstLossLength6?: number; - burstLossLength7?: number; - burstLossLength8OrHigher?: number; - fecRecvDistance1?: number; - fecRecvDistance2?: number; - fecRecvDistance3?: number; - ratioConcealedSamplesAvg?: number; - ratioStretchedSamplesAvg?: number; - ratioCompressedSamplesAvg?: number; -} - -interface MSAudioRecvSignal { - initialSignalLevelRMS?: number; - recvSignalLevelCh1?: number; - recvNoiseLevelCh1?: number; - renderSignalLevel?: number; - renderNoiseLevel?: number; - renderLoopbackSignalLevel?: number; -} - -interface MSAudioSendPayload extends MSPayloadBase { - samplingRate?: number; - signal?: MSAudioSendSignal; - audioFECUsed?: boolean; - sendMutePercent?: number; -} - -interface MSAudioSendSignal { - noiseLevel?: number; - sendSignalLevelCh1?: number; - sendNoiseLevelCh1?: number; -} - -interface MSConnectivity { - iceType?: string; - iceWarningFlags?: MSIceWarningFlags; - relayAddress?: MSRelayAddress; -} - -interface MSCredentialFilter { - accept?: MSCredentialSpec[]; -} - -interface MSCredentialParameters { - type?: string; -} - -interface MSCredentialSpec { - type?: string; - id?: string; -} - -interface MSDelay { - roundTrip?: number; - roundTripMax?: number; -} - -interface MSDescription extends RTCStats { - connectivity?: MSConnectivity; - transport?: string; - networkconnectivity?: MSNetworkConnectivityInfo; - localAddr?: MSIPAddressInfo; - remoteAddr?: MSIPAddressInfo; - deviceDevName?: string; - reflexiveLocalIPAddr?: MSIPAddressInfo; -} - -interface MSFIDOCredentialParameters extends MSCredentialParameters { - algorithm?: string | Algorithm; - authenticators?: AAGUID[]; -} - -interface MSIPAddressInfo { - ipAddr?: string; - port?: number; - manufacturerMacAddrMask?: string; -} - -interface MSIceWarningFlags { - turnTcpTimedOut?: boolean; - turnUdpAllocateFailed?: boolean; - turnUdpSendFailed?: boolean; - turnTcpAllocateFailed?: boolean; - turnTcpSendFailed?: boolean; - udpLocalConnectivityFailed?: boolean; - udpNatConnectivityFailed?: boolean; - udpRelayConnectivityFailed?: boolean; - tcpNatConnectivityFailed?: boolean; - tcpRelayConnectivityFailed?: boolean; - connCheckMessageIntegrityFailed?: boolean; - allocationMessageIntegrityFailed?: boolean; - connCheckOtherError?: boolean; - turnAuthUnknownUsernameError?: boolean; - noRelayServersConfigured?: boolean; - multipleRelayServersAttempted?: boolean; - portRangeExhausted?: boolean; - alternateServerReceived?: boolean; - pseudoTLSFailure?: boolean; - turnTurnTcpConnectivityFailed?: boolean; - useCandidateChecksFailed?: boolean; - fipsAllocationFailure?: boolean; -} - -interface MSJitter { - interArrival?: number; - interArrivalMax?: number; - interArrivalSD?: number; -} - -interface MSLocalClientEventBase extends RTCStats { - networkReceiveQualityEventRatio?: number; - networkBandwidthLowEventRatio?: number; -} - -interface MSNetwork extends RTCStats { - jitter?: MSJitter; - delay?: MSDelay; - packetLoss?: MSPacketLoss; - utilization?: MSUtilization; -} - -interface MSNetworkConnectivityInfo { - vpn?: boolean; - linkspeed?: number; - networkConnectionDetails?: string; -} - -interface MSNetworkInterfaceType { - interfaceTypeEthernet?: boolean; - interfaceTypeWireless?: boolean; - interfaceTypePPP?: boolean; - interfaceTypeTunnel?: boolean; - interfaceTypeWWAN?: boolean; -} - -interface MSOutboundNetwork extends MSNetwork { - appliedBandwidthLimit?: number; -} - -interface MSPacketLoss { - lossRate?: number; - lossRateMax?: number; -} - -interface MSPayloadBase extends RTCStats { - payloadDescription?: string; -} - -interface MSRelayAddress { - relayAddress?: string; - port?: number; -} - -interface MSSignatureParameters { - userPrompt?: string; -} - -interface MSTransportDiagnosticsStats extends RTCStats { - baseAddress?: string; - localAddress?: string; - localSite?: string; - networkName?: string; - remoteAddress?: string; - remoteSite?: string; - localMR?: string; - remoteMR?: string; - iceWarningFlags?: MSIceWarningFlags; - portRangeMin?: number; - portRangeMax?: number; - localMRTCPPort?: number; - remoteMRTCPPort?: number; - stunVer?: number; - numConsentReqSent?: number; - numConsentReqReceived?: number; - numConsentRespSent?: number; - numConsentRespReceived?: number; - interfaces?: MSNetworkInterfaceType; - baseInterface?: MSNetworkInterfaceType; - protocol?: string; - localInterface?: MSNetworkInterfaceType; - localAddrType?: string; - remoteAddrType?: string; - iceRole?: string; - rtpRtcpMux?: boolean; - allocationTimeInMs?: number; - msRtcEngineVersion?: string; -} - -interface MSUtilization { - packets?: number; - bandwidthEstimation?: number; - bandwidthEstimationMin?: number; - bandwidthEstimationMax?: number; - bandwidthEstimationStdDev?: number; - bandwidthEstimationAvg?: number; -} - -interface MSVideoPayload extends MSPayloadBase { - resoluton?: string; - videoBitRateAvg?: number; - videoBitRateMax?: number; - videoFrameRateAvg?: number; - videoPacketLossRate?: number; - durationSeconds?: number; -} - -interface MSVideoRecvPayload extends MSVideoPayload { - videoFrameLossRate?: number; - recvCodecType?: string; - recvResolutionWidth?: number; - recvResolutionHeight?: number; - videoResolutions?: MSVideoResolutionDistribution; - recvFrameRateAverage?: number; - recvBitRateMaximum?: number; - recvBitRateAverage?: number; - recvVideoStreamsMax?: number; - recvVideoStreamsMin?: number; - recvVideoStreamsMode?: number; - videoPostFECPLR?: number; - lowBitRateCallPercent?: number; - lowFrameRateCallPercent?: number; - reorderBufferTotalPackets?: number; - recvReorderBufferReorderedPackets?: number; - recvReorderBufferPacketsDroppedDueToBufferExhaustion?: number; - recvReorderBufferMaxSuccessfullyOrderedExtent?: number; - recvReorderBufferMaxSuccessfullyOrderedLateTime?: number; - recvReorderBufferPacketsDroppedDueToTimeout?: number; - recvFpsHarmonicAverage?: number; - recvNumResSwitches?: number; -} - -interface MSVideoResolutionDistribution { - cifQuality?: number; - vgaQuality?: number; - h720Quality?: number; - h1080Quality?: number; - h1440Quality?: number; - h2160Quality?: number; -} - -interface MSVideoSendPayload extends MSVideoPayload { - sendFrameRateAverage?: number; - sendBitRateMaximum?: number; - sendBitRateAverage?: number; - sendVideoStreamsMax?: number; - sendResolutionWidth?: number; - sendResolutionHeight?: number; -} - -interface MediaEncryptedEventInit extends EventInit { - initDataType?: string; - initData?: ArrayBuffer; -} - -interface MediaKeyMessageEventInit extends EventInit { - messageType?: string; - message?: ArrayBuffer; -} - -interface MediaKeySystemConfiguration { - initDataTypes?: string[]; - audioCapabilities?: MediaKeySystemMediaCapability[]; - videoCapabilities?: MediaKeySystemMediaCapability[]; - distinctiveIdentifier?: string; - persistentState?: string; -} - -interface MediaKeySystemMediaCapability { - contentType?: string; - robustness?: string; -} - -interface MediaStreamConstraints { - video?: boolean | MediaTrackConstraints; - audio?: boolean | MediaTrackConstraints; -} - -interface MediaStreamErrorEventInit extends EventInit { - error?: MediaStreamError; -} - -interface MediaStreamTrackEventInit extends EventInit { - track?: MediaStreamTrack; -} - -interface MediaTrackCapabilities { - width?: number | LongRange; - height?: number | LongRange; - aspectRatio?: number | DoubleRange; - frameRate?: number | DoubleRange; - facingMode?: string; - volume?: number | DoubleRange; - sampleRate?: number | LongRange; - sampleSize?: number | LongRange; - echoCancellation?: boolean[]; - deviceId?: string; - groupId?: string; -} - -interface MediaTrackConstraintSet { - width?: number | ConstrainLongRange; - height?: number | ConstrainLongRange; - aspectRatio?: number | ConstrainDoubleRange; - frameRate?: number | ConstrainDoubleRange; - facingMode?: string | string[] | ConstrainDOMStringParameters; - volume?: number | ConstrainDoubleRange; - sampleRate?: number | ConstrainLongRange; - sampleSize?: number | ConstrainLongRange; - echoCancelation?: boolean | ConstrainBooleanParameters; - deviceId?: string | string[] | ConstrainDOMStringParameters; - groupId?: string | string[] | ConstrainDOMStringParameters; -} - -interface MediaTrackConstraints extends MediaTrackConstraintSet { - advanced?: MediaTrackConstraintSet[]; -} - -interface MediaTrackSettings { - width?: number; - height?: number; - aspectRatio?: number; - frameRate?: number; - facingMode?: string; - volume?: number; - sampleRate?: number; - sampleSize?: number; - echoCancellation?: boolean; - deviceId?: string; - groupId?: string; -} - -interface MediaTrackSupportedConstraints { - width?: boolean; - height?: boolean; - aspectRatio?: boolean; - frameRate?: boolean; - facingMode?: boolean; - volume?: boolean; - sampleRate?: boolean; - sampleSize?: boolean; - echoCancellation?: boolean; - deviceId?: boolean; - groupId?: boolean; -} - -interface MouseEventInit extends EventModifierInit { - screenX?: number; - screenY?: number; - clientX?: number; - clientY?: number; - button?: number; - buttons?: number; - relatedTarget?: EventTarget; -} - -interface MsZoomToOptions { - contentX?: number; - contentY?: number; - viewportX?: string; - viewportY?: string; - scaleFactor?: number; - animate?: string; -} - -interface MutationObserverInit { - childList?: boolean; - attributes?: boolean; - characterData?: boolean; - subtree?: boolean; - attributeOldValue?: boolean; - characterDataOldValue?: boolean; - attributeFilter?: string[]; -} - -interface ObjectURLOptions { - oneTimeOnly?: boolean; -} - -interface PeriodicWaveConstraints { - disableNormalization?: boolean; -} - -interface PointerEventInit extends MouseEventInit { - pointerId?: number; - width?: number; - height?: number; - pressure?: number; - tiltX?: number; - tiltY?: number; - pointerType?: string; - isPrimary?: boolean; -} - -interface PositionOptions { - enableHighAccuracy?: boolean; - timeout?: number; - maximumAge?: number; -} - -interface RTCDTMFToneChangeEventInit extends EventInit { - tone?: string; -} - -interface RTCDtlsFingerprint { - algorithm?: string; - value?: string; -} - -interface RTCDtlsParameters { - role?: string; - fingerprints?: RTCDtlsFingerprint[]; -} - -interface RTCIceCandidate { - foundation?: string; - priority?: number; - ip?: string; - protocol?: string; - port?: number; - type?: string; - tcpType?: string; - relatedAddress?: string; - relatedPort?: number; -} - -interface RTCIceCandidateAttributes extends RTCStats { - ipAddress?: string; - portNumber?: number; - transport?: string; - candidateType?: string; - priority?: number; - addressSourceUrl?: string; -} - -interface RTCIceCandidateComplete { -} - -interface RTCIceCandidatePair { - local?: RTCIceCandidate; - remote?: RTCIceCandidate; -} - -interface RTCIceCandidatePairStats extends RTCStats { - transportId?: string; - localCandidateId?: string; - remoteCandidateId?: string; - state?: string; - priority?: number; - nominated?: boolean; - writable?: boolean; - readable?: boolean; - bytesSent?: number; - bytesReceived?: number; - roundTripTime?: number; - availableOutgoingBitrate?: number; - availableIncomingBitrate?: number; -} - -interface RTCIceGatherOptions { - gatherPolicy?: string; - iceservers?: RTCIceServer[]; -} - -interface RTCIceParameters { - usernameFragment?: string; - password?: string; -} - -interface RTCIceServer { - urls?: any; - username?: string; - credential?: string; -} - -interface RTCInboundRTPStreamStats extends RTCRTPStreamStats { - packetsReceived?: number; - bytesReceived?: number; - packetsLost?: number; - jitter?: number; - fractionLost?: number; -} - -interface RTCMediaStreamTrackStats extends RTCStats { - trackIdentifier?: string; - remoteSource?: boolean; - ssrcIds?: string[]; - frameWidth?: number; - frameHeight?: number; - framesPerSecond?: number; - framesSent?: number; - framesReceived?: number; - framesDecoded?: number; - framesDropped?: number; - framesCorrupted?: number; - audioLevel?: number; - echoReturnLoss?: number; - echoReturnLossEnhancement?: number; -} - -interface RTCOutboundRTPStreamStats extends RTCRTPStreamStats { - packetsSent?: number; - bytesSent?: number; - targetBitrate?: number; - roundTripTime?: number; -} - -interface RTCRTPStreamStats extends RTCStats { - ssrc?: string; - associateStatsId?: string; - isRemote?: boolean; - mediaTrackId?: string; - transportId?: string; - codecId?: string; - firCount?: number; - pliCount?: number; - nackCount?: number; - sliCount?: number; -} - -interface RTCRtcpFeedback { - type?: string; - parameter?: string; -} - -interface RTCRtcpParameters { - ssrc?: number; - cname?: string; - reducedSize?: boolean; - mux?: boolean; -} - -interface RTCRtpCapabilities { - codecs?: RTCRtpCodecCapability[]; - headerExtensions?: RTCRtpHeaderExtension[]; - fecMechanisms?: string[]; -} - -interface RTCRtpCodecCapability { - name?: string; - kind?: string; - clockRate?: number; - preferredPayloadType?: number; - maxptime?: number; - numChannels?: number; - rtcpFeedback?: RTCRtcpFeedback[]; - parameters?: any; - options?: any; - maxTemporalLayers?: number; - maxSpatialLayers?: number; - svcMultiStreamSupport?: boolean; -} - -interface RTCRtpCodecParameters { - name?: string; - payloadType?: any; - clockRate?: number; - maxptime?: number; - numChannels?: number; - rtcpFeedback?: RTCRtcpFeedback[]; - parameters?: any; -} - -interface RTCRtpContributingSource { - timestamp?: number; - csrc?: number; - audioLevel?: number; -} - -interface RTCRtpEncodingParameters { - ssrc?: number; - codecPayloadType?: number; - fec?: RTCRtpFecParameters; - rtx?: RTCRtpRtxParameters; - priority?: number; - maxBitrate?: number; - minQuality?: number; - framerateBias?: number; - resolutionScale?: number; - framerateScale?: number; - active?: boolean; - encodingId?: string; - dependencyEncodingIds?: string[]; - ssrcRange?: RTCSsrcRange; -} - -interface RTCRtpFecParameters { - ssrc?: number; - mechanism?: string; -} - -interface RTCRtpHeaderExtension { - kind?: string; - uri?: string; - preferredId?: number; - preferredEncrypt?: boolean; -} - -interface RTCRtpHeaderExtensionParameters { - uri?: string; - id?: number; - encrypt?: boolean; -} - -interface RTCRtpParameters { - muxId?: string; - codecs?: RTCRtpCodecParameters[]; - headerExtensions?: RTCRtpHeaderExtensionParameters[]; - encodings?: RTCRtpEncodingParameters[]; - rtcp?: RTCRtcpParameters; -} - -interface RTCRtpRtxParameters { - ssrc?: number; -} - -interface RTCRtpUnhandled { - ssrc?: number; - payloadType?: number; - muxId?: string; -} - -interface RTCSrtpKeyParam { - keyMethod?: string; - keySalt?: string; - lifetime?: string; - mkiValue?: number; - mkiLength?: number; -} - -interface RTCSrtpSdesParameters { - tag?: number; - cryptoSuite?: string; - keyParams?: RTCSrtpKeyParam[]; - sessionParams?: string[]; -} - -interface RTCSsrcRange { - min?: number; - max?: number; -} - -interface RTCStats { - timestamp?: number; - type?: string; - id?: string; - msType?: string; -} - -interface RTCStatsReport { -} - -interface RTCTransportStats extends RTCStats { - bytesSent?: number; - bytesReceived?: number; - rtcpTransportStatsId?: string; - activeConnection?: boolean; - selectedCandidatePairId?: string; - localCertificateId?: string; - remoteCertificateId?: string; -} - -interface StoreExceptionsInformation extends ExceptionInformation { - siteName?: string; - explanationString?: string; - detailURI?: string; -} - -interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { - arrayOfDomainStrings?: string[]; -} - -interface UIEventInit extends EventInit { - view?: Window; - detail?: number; -} - -interface WebGLContextAttributes { - failIfMajorPerformanceCaveat?: boolean; - alpha?: boolean; - depth?: boolean; - stencil?: boolean; - antialias?: boolean; - premultipliedAlpha?: boolean; - preserveDrawingBuffer?: boolean; -} - -interface WebGLContextEventInit extends EventInit { - statusMessage?: string; -} - -interface WheelEventInit extends MouseEventInit { - deltaX?: number; - deltaY?: number; - deltaZ?: number; - deltaMode?: number; -} - -interface EventListener { - (evt: Event): void; -} - -interface ANGLE_instanced_arrays { - drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void; - drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void; - vertexAttribDivisorANGLE(index: number, divisor: number): void; - readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; -} - -declare var ANGLE_instanced_arrays: { - prototype: ANGLE_instanced_arrays; - new(): ANGLE_instanced_arrays; - readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; -} - -interface AnalyserNode extends AudioNode { - fftSize: number; - readonly frequencyBinCount: number; - maxDecibels: number; - minDecibels: number; - smoothingTimeConstant: number; - getByteFrequencyData(array: Uint8Array): void; - getByteTimeDomainData(array: Uint8Array): void; - getFloatFrequencyData(array: Float32Array): void; - getFloatTimeDomainData(array: Float32Array): void; -} - -declare var AnalyserNode: { - prototype: AnalyserNode; - new(): AnalyserNode; -} - -interface AnimationEvent extends Event { - readonly animationName: string; - readonly elapsedTime: number; - initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; -} - -declare var AnimationEvent: { - prototype: AnimationEvent; - new(): AnimationEvent; -} - -interface ApplicationCache extends EventTarget { - oncached: (this: this, ev: Event) => any; - onchecking: (this: this, ev: Event) => any; - ondownloading: (this: this, ev: Event) => any; - onerror: (this: this, ev: ErrorEvent) => any; - onnoupdate: (this: this, ev: Event) => any; - onobsolete: (this: this, ev: Event) => any; - onprogress: (this: this, ev: ProgressEvent) => any; - onupdateready: (this: this, ev: Event) => any; - readonly status: number; - abort(): void; - swapCache(): void; - update(): void; - readonly CHECKING: number; - readonly DOWNLOADING: number; - readonly IDLE: number; - readonly OBSOLETE: number; - readonly UNCACHED: number; - readonly UPDATEREADY: number; - addEventListener(type: "cached", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "checking", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "downloading", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "noupdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "obsolete", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "updateready", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var ApplicationCache: { - prototype: ApplicationCache; - new(): ApplicationCache; - readonly CHECKING: number; - readonly DOWNLOADING: number; - readonly IDLE: number; - readonly OBSOLETE: number; - readonly UNCACHED: number; - readonly UPDATEREADY: number; -} - -interface AriaRequestEvent extends Event { - readonly attributeName: string; - attributeValue: string | null; -} - -declare var AriaRequestEvent: { - prototype: AriaRequestEvent; - new(type: string, eventInitDict?: AriaRequestEventInit): AriaRequestEvent; -} - -interface Attr extends Node { - readonly name: string; - readonly ownerElement: Element; - readonly prefix: string | null; - readonly specified: boolean; - value: string; -} - -declare var Attr: { - prototype: Attr; - new(): Attr; -} - -interface AudioBuffer { - readonly duration: number; - readonly length: number; - readonly numberOfChannels: number; - readonly sampleRate: number; - copyFromChannel(destination: Float32Array, channelNumber: number, startInChannel?: number): void; - copyToChannel(source: Float32Array, channelNumber: number, startInChannel?: number): void; - getChannelData(channel: number): Float32Array; -} - -declare var AudioBuffer: { - prototype: AudioBuffer; - new(): AudioBuffer; -} - -interface AudioBufferSourceNode extends AudioNode { - buffer: AudioBuffer | null; - readonly detune: AudioParam; - loop: boolean; - loopEnd: number; - loopStart: number; - onended: (this: this, ev: MediaStreamErrorEvent) => any; - readonly playbackRate: AudioParam; - start(when?: number, offset?: number, duration?: number): void; - stop(when?: number): void; - addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var AudioBufferSourceNode: { - prototype: AudioBufferSourceNode; - new(): AudioBufferSourceNode; -} - -interface AudioContext extends EventTarget { - readonly currentTime: number; - readonly destination: AudioDestinationNode; - readonly listener: AudioListener; - readonly sampleRate: number; - state: string; - createAnalyser(): AnalyserNode; - createBiquadFilter(): BiquadFilterNode; - createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; - createBufferSource(): AudioBufferSourceNode; - createChannelMerger(numberOfInputs?: number): ChannelMergerNode; - createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode; - createConvolver(): ConvolverNode; - createDelay(maxDelayTime?: number): DelayNode; - createDynamicsCompressor(): DynamicsCompressorNode; - createGain(): GainNode; - createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode; - createMediaStreamSource(mediaStream: MediaStream): MediaStreamAudioSourceNode; - createOscillator(): OscillatorNode; - createPanner(): PannerNode; - createPeriodicWave(real: Float32Array, imag: Float32Array, constraints?: PeriodicWaveConstraints): PeriodicWave; - createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode; - createStereoPanner(): StereoPannerNode; - createWaveShaper(): WaveShaperNode; - decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): PromiseLike; -} - -declare var AudioContext: { - prototype: AudioContext; - new(): AudioContext; -} - -interface AudioDestinationNode extends AudioNode { - readonly maxChannelCount: number; -} - -declare var AudioDestinationNode: { - prototype: AudioDestinationNode; - new(): AudioDestinationNode; -} - -interface AudioListener { - dopplerFactor: number; - speedOfSound: number; - setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void; - setPosition(x: number, y: number, z: number): void; - setVelocity(x: number, y: number, z: number): void; -} - -declare var AudioListener: { - prototype: AudioListener; - new(): AudioListener; -} - -interface AudioNode extends EventTarget { - channelCount: number; - channelCountMode: string; - channelInterpretation: string; - readonly context: AudioContext; - readonly numberOfInputs: number; - readonly numberOfOutputs: number; - connect(destination: AudioNode, output?: number, input?: number): void; - disconnect(output?: number): void; - disconnect(destination: AudioNode, output?: number, input?: number): void; - disconnect(destination: AudioParam, output?: number): void; -} - -declare var AudioNode: { - prototype: AudioNode; - new(): AudioNode; -} - -interface AudioParam { - readonly defaultValue: number; - value: number; - cancelScheduledValues(startTime: number): void; - exponentialRampToValueAtTime(value: number, endTime: number): void; - linearRampToValueAtTime(value: number, endTime: number): void; - setTargetAtTime(target: number, startTime: number, timeConstant: number): void; - setValueAtTime(value: number, startTime: number): void; - setValueCurveAtTime(values: Float32Array, startTime: number, duration: number): void; -} - -declare var AudioParam: { - prototype: AudioParam; - new(): AudioParam; -} - -interface AudioProcessingEvent extends Event { - readonly inputBuffer: AudioBuffer; - readonly outputBuffer: AudioBuffer; - readonly playbackTime: number; -} - -declare var AudioProcessingEvent: { - prototype: AudioProcessingEvent; - new(): AudioProcessingEvent; -} - -interface AudioTrack { - enabled: boolean; - readonly id: string; - kind: string; - readonly label: string; - language: string; - readonly sourceBuffer: SourceBuffer; -} - -declare var AudioTrack: { - prototype: AudioTrack; - new(): AudioTrack; -} - -interface AudioTrackList extends EventTarget { - readonly length: number; - onaddtrack: (this: this, ev: TrackEvent) => any; - onchange: (this: this, ev: Event) => any; - onremovetrack: (this: this, ev: TrackEvent) => any; - getTrackById(id: string): AudioTrack | null; - item(index: number): AudioTrack; - addEventListener(type: "addtrack", listener: (this: this, ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "removetrack", listener: (this: this, ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [index: number]: AudioTrack; -} - -declare var AudioTrackList: { - prototype: AudioTrackList; - new(): AudioTrackList; -} - -interface BarProp { - readonly visible: boolean; -} - -declare var BarProp: { - prototype: BarProp; - new(): BarProp; -} - -interface BeforeUnloadEvent extends Event { - returnValue: any; -} - -declare var BeforeUnloadEvent: { - prototype: BeforeUnloadEvent; - new(): BeforeUnloadEvent; -} - -interface BiquadFilterNode extends AudioNode { - readonly Q: AudioParam; - readonly detune: AudioParam; - readonly frequency: AudioParam; - readonly gain: AudioParam; - type: string; - getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void; -} - -declare var BiquadFilterNode: { - prototype: BiquadFilterNode; - new(): BiquadFilterNode; -} - -interface Blob { - readonly size: number; - readonly type: string; - msClose(): void; - msDetachStream(): any; - slice(start?: number, end?: number, contentType?: string): Blob; -} - -declare var Blob: { - prototype: Blob; - new (blobParts?: any[], options?: BlobPropertyBag): Blob; -} - -interface CDATASection extends Text { -} - -declare var CDATASection: { - prototype: CDATASection; - new(): CDATASection; -} - -interface CSS { - supports(property: string, value?: string): boolean; -} -declare var CSS: CSS; - -interface CSSConditionRule extends CSSGroupingRule { - conditionText: string; -} - -declare var CSSConditionRule: { - prototype: CSSConditionRule; - new(): CSSConditionRule; -} - -interface CSSFontFaceRule extends CSSRule { - readonly style: CSSStyleDeclaration; -} - -declare var CSSFontFaceRule: { - prototype: CSSFontFaceRule; - new(): CSSFontFaceRule; -} - -interface CSSGroupingRule extends CSSRule { - readonly cssRules: CSSRuleList; - deleteRule(index: number): void; - insertRule(rule: string, index: number): number; -} - -declare var CSSGroupingRule: { - prototype: CSSGroupingRule; - new(): CSSGroupingRule; -} - -interface CSSImportRule extends CSSRule { - readonly href: string; - readonly media: MediaList; - readonly styleSheet: CSSStyleSheet; -} - -declare var CSSImportRule: { - prototype: CSSImportRule; - new(): CSSImportRule; -} - -interface CSSKeyframeRule extends CSSRule { - keyText: string; - readonly style: CSSStyleDeclaration; -} - -declare var CSSKeyframeRule: { - prototype: CSSKeyframeRule; - new(): CSSKeyframeRule; -} - -interface CSSKeyframesRule extends CSSRule { - readonly cssRules: CSSRuleList; - name: string; - appendRule(rule: string): void; - deleteRule(rule: string): void; - findRule(rule: string): CSSKeyframeRule; -} - -declare var CSSKeyframesRule: { - prototype: CSSKeyframesRule; - new(): CSSKeyframesRule; -} - -interface CSSMediaRule extends CSSConditionRule { - readonly media: MediaList; -} - -declare var CSSMediaRule: { - prototype: CSSMediaRule; - new(): CSSMediaRule; -} - -interface CSSNamespaceRule extends CSSRule { - readonly namespaceURI: string; - readonly prefix: string; -} - -declare var CSSNamespaceRule: { - prototype: CSSNamespaceRule; - new(): CSSNamespaceRule; -} - -interface CSSPageRule extends CSSRule { - readonly pseudoClass: string; - readonly selector: string; - selectorText: string; - readonly style: CSSStyleDeclaration; -} - -declare var CSSPageRule: { - prototype: CSSPageRule; - new(): CSSPageRule; -} - -interface CSSRule { - cssText: string; - readonly parentRule: CSSRule; - readonly parentStyleSheet: CSSStyleSheet; - readonly type: number; - readonly CHARSET_RULE: number; - readonly FONT_FACE_RULE: number; - readonly IMPORT_RULE: number; - readonly KEYFRAMES_RULE: number; - readonly KEYFRAME_RULE: number; - readonly MEDIA_RULE: number; - readonly NAMESPACE_RULE: number; - readonly PAGE_RULE: number; - readonly STYLE_RULE: number; - readonly SUPPORTS_RULE: number; - readonly UNKNOWN_RULE: number; - readonly VIEWPORT_RULE: number; -} - -declare var CSSRule: { - prototype: CSSRule; - new(): CSSRule; - readonly CHARSET_RULE: number; - readonly FONT_FACE_RULE: number; - readonly IMPORT_RULE: number; - readonly KEYFRAMES_RULE: number; - readonly KEYFRAME_RULE: number; - readonly MEDIA_RULE: number; - readonly NAMESPACE_RULE: number; - readonly PAGE_RULE: number; - readonly STYLE_RULE: number; - readonly SUPPORTS_RULE: number; - readonly UNKNOWN_RULE: number; - readonly VIEWPORT_RULE: number; -} - -interface CSSRuleList { - readonly length: number; - item(index: number): CSSRule; - [index: number]: CSSRule; -} - -declare var CSSRuleList: { - prototype: CSSRuleList; - new(): CSSRuleList; -} - -interface CSSStyleDeclaration { - alignContent: string | null; - alignItems: string | null; - alignSelf: string | null; - alignmentBaseline: string | null; - animation: string | null; - animationDelay: string | null; - animationDirection: string | null; - animationDuration: string | null; - animationFillMode: string | null; - animationIterationCount: string | null; - animationName: string | null; - animationPlayState: string | null; - animationTimingFunction: string | null; - backfaceVisibility: string | null; - background: string | null; - backgroundAttachment: string | null; - backgroundClip: string | null; - backgroundColor: string | null; - backgroundImage: string | null; - backgroundOrigin: string | null; - backgroundPosition: string | null; - backgroundPositionX: string | null; - backgroundPositionY: string | null; - backgroundRepeat: string | null; - backgroundSize: string | null; - baselineShift: string | null; - border: string | null; - borderBottom: string | null; - borderBottomColor: string | null; - borderBottomLeftRadius: string | null; - borderBottomRightRadius: string | null; - borderBottomStyle: string | null; - borderBottomWidth: string | null; - borderCollapse: string | null; - borderColor: string | null; - borderImage: string | null; - borderImageOutset: string | null; - borderImageRepeat: string | null; - borderImageSlice: string | null; - borderImageSource: string | null; - borderImageWidth: string | null; - borderLeft: string | null; - borderLeftColor: string | null; - borderLeftStyle: string | null; - borderLeftWidth: string | null; - borderRadius: string | null; - borderRight: string | null; - borderRightColor: string | null; - borderRightStyle: string | null; - borderRightWidth: string | null; - borderSpacing: string | null; - borderStyle: string | null; - borderTop: string | null; - borderTopColor: string | null; - borderTopLeftRadius: string | null; - borderTopRightRadius: string | null; - borderTopStyle: string | null; - borderTopWidth: string | null; - borderWidth: string | null; - bottom: string | null; - boxShadow: string | null; - boxSizing: string | null; - breakAfter: string | null; - breakBefore: string | null; - breakInside: string | null; - captionSide: string | null; - clear: string | null; - clip: string | null; - clipPath: string | null; - clipRule: string | null; - color: string | null; - colorInterpolationFilters: string | null; - columnCount: any; - columnFill: string | null; - columnGap: any; - columnRule: string | null; - columnRuleColor: any; - columnRuleStyle: string | null; - columnRuleWidth: any; - columnSpan: string | null; - columnWidth: any; - columns: string | null; - content: string | null; - counterIncrement: string | null; - counterReset: string | null; - cssFloat: string | null; - cssText: string; - cursor: string | null; - direction: string | null; - display: string | null; - dominantBaseline: string | null; - emptyCells: string | null; - enableBackground: string | null; - fill: string | null; - fillOpacity: string | null; - fillRule: string | null; - filter: string | null; - flex: string | null; - flexBasis: string | null; - flexDirection: string | null; - flexFlow: string | null; - flexGrow: string | null; - flexShrink: string | null; - flexWrap: string | null; - floodColor: string | null; - floodOpacity: string | null; - font: string | null; - fontFamily: string | null; - fontFeatureSettings: string | null; - fontSize: string | null; - fontSizeAdjust: string | null; - fontStretch: string | null; - fontStyle: string | null; - fontVariant: string | null; - fontWeight: string | null; - glyphOrientationHorizontal: string | null; - glyphOrientationVertical: string | null; - height: string | null; - imeMode: string | null; - justifyContent: string | null; - kerning: string | null; - left: string | null; - readonly length: number; - letterSpacing: string | null; - lightingColor: string | null; - lineHeight: string | null; - listStyle: string | null; - listStyleImage: string | null; - listStylePosition: string | null; - listStyleType: string | null; - margin: string | null; - marginBottom: string | null; - marginLeft: string | null; - marginRight: string | null; - marginTop: string | null; - marker: string | null; - markerEnd: string | null; - markerMid: string | null; - markerStart: string | null; - mask: string | null; - maxHeight: string | null; - maxWidth: string | null; - minHeight: string | null; - minWidth: string | null; - msContentZoomChaining: string | null; - msContentZoomLimit: string | null; - msContentZoomLimitMax: any; - msContentZoomLimitMin: any; - msContentZoomSnap: string | null; - msContentZoomSnapPoints: string | null; - msContentZoomSnapType: string | null; - msContentZooming: string | null; - msFlowFrom: string | null; - msFlowInto: string | null; - msFontFeatureSettings: string | null; - msGridColumn: any; - msGridColumnAlign: string | null; - msGridColumnSpan: any; - msGridColumns: string | null; - msGridRow: any; - msGridRowAlign: string | null; - msGridRowSpan: any; - msGridRows: string | null; - msHighContrastAdjust: string | null; - msHyphenateLimitChars: string | null; - msHyphenateLimitLines: any; - msHyphenateLimitZone: any; - msHyphens: string | null; - msImeAlign: string | null; - msOverflowStyle: string | null; - msScrollChaining: string | null; - msScrollLimit: string | null; - msScrollLimitXMax: any; - msScrollLimitXMin: any; - msScrollLimitYMax: any; - msScrollLimitYMin: any; - msScrollRails: string | null; - msScrollSnapPointsX: string | null; - msScrollSnapPointsY: string | null; - msScrollSnapType: string | null; - msScrollSnapX: string | null; - msScrollSnapY: string | null; - msScrollTranslation: string | null; - msTextCombineHorizontal: string | null; - msTextSizeAdjust: any; - msTouchAction: string | null; - msTouchSelect: string | null; - msUserSelect: string | null; - msWrapFlow: string; - msWrapMargin: any; - msWrapThrough: string; - opacity: string | null; - order: string | null; - orphans: string | null; - outline: string | null; - outlineColor: string | null; - outlineStyle: string | null; - outlineWidth: string | null; - overflow: string | null; - overflowX: string | null; - overflowY: string | null; - padding: string | null; - paddingBottom: string | null; - paddingLeft: string | null; - paddingRight: string | null; - paddingTop: string | null; - pageBreakAfter: string | null; - pageBreakBefore: string | null; - pageBreakInside: string | null; - readonly parentRule: CSSRule; - perspective: string | null; - perspectiveOrigin: string | null; - pointerEvents: string | null; - position: string | null; - quotes: string | null; - right: string | null; - rubyAlign: string | null; - rubyOverhang: string | null; - rubyPosition: string | null; - stopColor: string | null; - stopOpacity: string | null; - stroke: string | null; - strokeDasharray: string | null; - strokeDashoffset: string | null; - strokeLinecap: string | null; - strokeLinejoin: string | null; - strokeMiterlimit: string | null; - strokeOpacity: string | null; - strokeWidth: string | null; - tableLayout: string | null; - textAlign: string | null; - textAlignLast: string | null; - textAnchor: string | null; - textDecoration: string | null; - textIndent: string | null; - textJustify: string | null; - textKashida: string | null; - textKashidaSpace: string | null; - textOverflow: string | null; - textShadow: string | null; - textTransform: string | null; - textUnderlinePosition: string | null; - top: string | null; - touchAction: string | null; - transform: string | null; - transformOrigin: string | null; - transformStyle: string | null; - transition: string | null; - transitionDelay: string | null; - transitionDuration: string | null; - transitionProperty: string | null; - transitionTimingFunction: string | null; - unicodeBidi: string | null; - verticalAlign: string | null; - visibility: string | null; - webkitAlignContent: string | null; - webkitAlignItems: string | null; - webkitAlignSelf: string | null; - webkitAnimation: string | null; - webkitAnimationDelay: string | null; - webkitAnimationDirection: string | null; - webkitAnimationDuration: string | null; - webkitAnimationFillMode: string | null; - webkitAnimationIterationCount: string | null; - webkitAnimationName: string | null; - webkitAnimationPlayState: string | null; - webkitAnimationTimingFunction: string | null; - webkitAppearance: string | null; - webkitBackfaceVisibility: string | null; - webkitBackgroundClip: string | null; - webkitBackgroundOrigin: string | null; - webkitBackgroundSize: string | null; - webkitBorderBottomLeftRadius: string | null; - webkitBorderBottomRightRadius: string | null; - webkitBorderImage: string | null; - webkitBorderRadius: string | null; - webkitBorderTopLeftRadius: string | null; - webkitBorderTopRightRadius: string | null; - webkitBoxAlign: string | null; - webkitBoxDirection: string | null; - webkitBoxFlex: string | null; - webkitBoxOrdinalGroup: string | null; - webkitBoxOrient: string | null; - webkitBoxPack: string | null; - webkitBoxSizing: string | null; - webkitColumnBreakAfter: string | null; - webkitColumnBreakBefore: string | null; - webkitColumnBreakInside: string | null; - webkitColumnCount: any; - webkitColumnGap: any; - webkitColumnRule: string | null; - webkitColumnRuleColor: any; - webkitColumnRuleStyle: string | null; - webkitColumnRuleWidth: any; - webkitColumnSpan: string | null; - webkitColumnWidth: any; - webkitColumns: string | null; - webkitFilter: string | null; - webkitFlex: string | null; - webkitFlexBasis: string | null; - webkitFlexDirection: string | null; - webkitFlexFlow: string | null; - webkitFlexGrow: string | null; - webkitFlexShrink: string | null; - webkitFlexWrap: string | null; - webkitJustifyContent: string | null; - webkitOrder: string | null; - webkitPerspective: string | null; - webkitPerspectiveOrigin: string | null; - webkitTapHighlightColor: string | null; - webkitTextFillColor: string | null; - webkitTextSizeAdjust: any; - webkitTransform: string | null; - webkitTransformOrigin: string | null; - webkitTransformStyle: string | null; - webkitTransition: string | null; - webkitTransitionDelay: string | null; - webkitTransitionDuration: string | null; - webkitTransitionProperty: string | null; - webkitTransitionTimingFunction: string | null; - webkitUserModify: string | null; - webkitUserSelect: string | null; - webkitWritingMode: string | null; - whiteSpace: string | null; - widows: string | null; - width: string | null; - wordBreak: string | null; - wordSpacing: string | null; - wordWrap: string | null; - writingMode: string | null; - zIndex: string | null; - zoom: string | null; - getPropertyPriority(propertyName: string): string; - getPropertyValue(propertyName: string): string; - item(index: number): string; - removeProperty(propertyName: string): string; - setProperty(propertyName: string, value: string | null, priority?: string): void; - [index: number]: string; -} - -declare var CSSStyleDeclaration: { - prototype: CSSStyleDeclaration; - new(): CSSStyleDeclaration; -} - -interface CSSStyleRule extends CSSRule { - readonly readOnly: boolean; - selectorText: string; - readonly style: CSSStyleDeclaration; -} - -declare var CSSStyleRule: { - prototype: CSSStyleRule; - new(): CSSStyleRule; -} - -interface CSSStyleSheet extends StyleSheet { - readonly cssRules: CSSRuleList; - cssText: string; - readonly href: string; - readonly id: string; - readonly imports: StyleSheetList; - readonly isAlternate: boolean; - readonly isPrefAlternate: boolean; - readonly ownerRule: CSSRule; - readonly owningElement: Element; - readonly pages: StyleSheetPageList; - readonly readOnly: boolean; - readonly rules: CSSRuleList; - addImport(bstrURL: string, lIndex?: number): number; - addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; - addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; - deleteRule(index?: number): void; - insertRule(rule: string, index?: number): number; - removeImport(lIndex: number): void; - removeRule(lIndex: number): void; -} - -declare var CSSStyleSheet: { - prototype: CSSStyleSheet; - new(): CSSStyleSheet; -} - -interface CSSSupportsRule extends CSSConditionRule { -} - -declare var CSSSupportsRule: { - prototype: CSSSupportsRule; - new(): CSSSupportsRule; -} - -interface CanvasGradient { - addColorStop(offset: number, color: string): void; -} - -declare var CanvasGradient: { - prototype: CanvasGradient; - new(): CanvasGradient; -} - -interface CanvasPattern { -} - -declare var CanvasPattern: { - prototype: CanvasPattern; - new(): CanvasPattern; -} - -interface CanvasRenderingContext2D extends Object, CanvasPathMethods { - readonly canvas: HTMLCanvasElement; - fillStyle: string | CanvasGradient | CanvasPattern; - font: string; - globalAlpha: number; - globalCompositeOperation: string; - lineCap: string; - lineDashOffset: number; - lineJoin: string; - lineWidth: number; - miterLimit: number; - msFillRule: string; - msImageSmoothingEnabled: boolean; - shadowBlur: number; - shadowColor: string; - shadowOffsetX: number; - shadowOffsetY: number; - strokeStyle: string | CanvasGradient | CanvasPattern; - textAlign: string; - textBaseline: string; - mozImageSmoothingEnabled: boolean; - webkitImageSmoothingEnabled: boolean; - oImageSmoothingEnabled: boolean; - beginPath(): void; - clearRect(x: number, y: number, w: number, h: number): void; - clip(fillRule?: string): void; - createImageData(imageDataOrSw: number | ImageData, sh?: number): ImageData; - createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; - createPattern(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, repetition: string): CanvasPattern; - createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; - drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; - fill(fillRule?: string): void; - fillRect(x: number, y: number, w: number, h: number): void; - fillText(text: string, x: number, y: number, maxWidth?: number): void; - getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; - getLineDash(): number[]; - isPointInPath(x: number, y: number, fillRule?: string): boolean; - measureText(text: string): TextMetrics; - putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; - restore(): void; - rotate(angle: number): void; - save(): void; - scale(x: number, y: number): void; - setLineDash(segments: number[]): void; - setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - stroke(): void; - strokeRect(x: number, y: number, w: number, h: number): void; - strokeText(text: string, x: number, y: number, maxWidth?: number): void; - transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - translate(x: number, y: number): void; -} - -declare var CanvasRenderingContext2D: { - prototype: CanvasRenderingContext2D; - new(): CanvasRenderingContext2D; -} - -interface ChannelMergerNode extends AudioNode { -} - -declare var ChannelMergerNode: { - prototype: ChannelMergerNode; - new(): ChannelMergerNode; -} - -interface ChannelSplitterNode extends AudioNode { -} - -declare var ChannelSplitterNode: { - prototype: ChannelSplitterNode; - new(): ChannelSplitterNode; -} - -interface CharacterData extends Node, ChildNode { - data: string; - readonly length: number; - appendData(arg: string): void; - deleteData(offset: number, count: number): void; - insertData(offset: number, arg: string): void; - replaceData(offset: number, count: number, arg: string): void; - substringData(offset: number, count: number): string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var CharacterData: { - prototype: CharacterData; - new(): CharacterData; -} - -interface ClientRect { - bottom: number; - readonly height: number; - left: number; - right: number; - top: number; - readonly width: number; -} - -declare var ClientRect: { - prototype: ClientRect; - new(): ClientRect; -} - -interface ClientRectList { - readonly length: number; - item(index: number): ClientRect; - [index: number]: ClientRect; -} - -declare var ClientRectList: { - prototype: ClientRectList; - new(): ClientRectList; -} - -interface ClipboardEvent extends Event { - readonly clipboardData: DataTransfer; -} - -declare var ClipboardEvent: { - prototype: ClipboardEvent; - new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent; -} - -interface CloseEvent extends Event { - readonly code: number; - readonly reason: string; - readonly wasClean: boolean; - initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; -} - -declare var CloseEvent: { - prototype: CloseEvent; - new(): CloseEvent; -} - -interface CommandEvent extends Event { - readonly commandName: string; - readonly detail: string | null; -} - -declare var CommandEvent: { - prototype: CommandEvent; - new(type: string, eventInitDict?: CommandEventInit): CommandEvent; -} - -interface Comment extends CharacterData { - text: string; -} - -declare var Comment: { - prototype: Comment; - new(): Comment; -} - -interface CompositionEvent extends UIEvent { - readonly data: string; - readonly locale: string; - initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; -} - -declare var CompositionEvent: { - prototype: CompositionEvent; - new(typeArg: string, eventInitDict?: CompositionEventInit): CompositionEvent; -} - -interface Console { - assert(test?: boolean, message?: string, ...optionalParams: any[]): void; - clear(): void; - count(countTitle?: string): void; - debug(message?: string, ...optionalParams: any[]): void; - dir(value?: any, ...optionalParams: any[]): void; - dirxml(value: any): void; - error(message?: any, ...optionalParams: any[]): void; - exception(message?: string, ...optionalParams: any[]): void; - group(groupTitle?: string): void; - groupCollapsed(groupTitle?: string): void; - groupEnd(): void; - info(message?: any, ...optionalParams: any[]): void; - log(message?: any, ...optionalParams: any[]): void; - msIsIndependentlyComposed(element: Element): boolean; - profile(reportName?: string): void; - profileEnd(): void; - select(element: Element): void; - table(...data: any[]): void; - time(timerName?: string): void; - timeEnd(timerName?: string): void; - trace(message?: any, ...optionalParams: any[]): void; - warn(message?: any, ...optionalParams: any[]): void; -} - -declare var Console: { - prototype: Console; - new(): Console; -} - -interface ConvolverNode extends AudioNode { - buffer: AudioBuffer | null; - normalize: boolean; -} - -declare var ConvolverNode: { - prototype: ConvolverNode; - new(): ConvolverNode; -} - -interface Coordinates { - readonly accuracy: number; - readonly altitude: number | null; - readonly altitudeAccuracy: number | null; - readonly heading: number | null; - readonly latitude: number; - readonly longitude: number; - readonly speed: number | null; -} - -declare var Coordinates: { - prototype: Coordinates; - new(): Coordinates; -} - -interface Crypto extends Object, RandomSource { - readonly subtle: SubtleCrypto; -} - -declare var Crypto: { - prototype: Crypto; - new(): Crypto; -} - -interface CryptoKey { - readonly algorithm: KeyAlgorithm; - readonly extractable: boolean; - readonly type: string; - readonly usages: string[]; -} - -declare var CryptoKey: { - prototype: CryptoKey; - new(): CryptoKey; -} - -interface CryptoKeyPair { - privateKey: CryptoKey; - publicKey: CryptoKey; -} - -declare var CryptoKeyPair: { - prototype: CryptoKeyPair; - new(): CryptoKeyPair; -} - -interface CustomEvent extends Event { - readonly detail: any; - initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; -} - -declare var CustomEvent: { - prototype: CustomEvent; - new(typeArg: string, eventInitDict?: CustomEventInit): CustomEvent; -} - -interface DOMError { - readonly name: string; - toString(): string; -} - -declare var DOMError: { - prototype: DOMError; - new(): DOMError; -} - -interface DOMException { - readonly code: number; - readonly message: string; - readonly name: string; - toString(): string; - readonly ABORT_ERR: number; - readonly DATA_CLONE_ERR: number; - readonly DOMSTRING_SIZE_ERR: number; - readonly HIERARCHY_REQUEST_ERR: number; - readonly INDEX_SIZE_ERR: number; - readonly INUSE_ATTRIBUTE_ERR: number; - readonly INVALID_ACCESS_ERR: number; - readonly INVALID_CHARACTER_ERR: number; - readonly INVALID_MODIFICATION_ERR: number; - readonly INVALID_NODE_TYPE_ERR: number; - readonly INVALID_STATE_ERR: number; - readonly NAMESPACE_ERR: number; - readonly NETWORK_ERR: number; - readonly NOT_FOUND_ERR: number; - readonly NOT_SUPPORTED_ERR: number; - readonly NO_DATA_ALLOWED_ERR: number; - readonly NO_MODIFICATION_ALLOWED_ERR: number; - readonly PARSE_ERR: number; - readonly QUOTA_EXCEEDED_ERR: number; - readonly SECURITY_ERR: number; - readonly SERIALIZE_ERR: number; - readonly SYNTAX_ERR: number; - readonly TIMEOUT_ERR: number; - readonly TYPE_MISMATCH_ERR: number; - readonly URL_MISMATCH_ERR: number; - readonly VALIDATION_ERR: number; - readonly WRONG_DOCUMENT_ERR: number; -} - -declare var DOMException: { - prototype: DOMException; - new(): DOMException; - readonly ABORT_ERR: number; - readonly DATA_CLONE_ERR: number; - readonly DOMSTRING_SIZE_ERR: number; - readonly HIERARCHY_REQUEST_ERR: number; - readonly INDEX_SIZE_ERR: number; - readonly INUSE_ATTRIBUTE_ERR: number; - readonly INVALID_ACCESS_ERR: number; - readonly INVALID_CHARACTER_ERR: number; - readonly INVALID_MODIFICATION_ERR: number; - readonly INVALID_NODE_TYPE_ERR: number; - readonly INVALID_STATE_ERR: number; - readonly NAMESPACE_ERR: number; - readonly NETWORK_ERR: number; - readonly NOT_FOUND_ERR: number; - readonly NOT_SUPPORTED_ERR: number; - readonly NO_DATA_ALLOWED_ERR: number; - readonly NO_MODIFICATION_ALLOWED_ERR: number; - readonly PARSE_ERR: number; - readonly QUOTA_EXCEEDED_ERR: number; - readonly SECURITY_ERR: number; - readonly SERIALIZE_ERR: number; - readonly SYNTAX_ERR: number; - readonly TIMEOUT_ERR: number; - readonly TYPE_MISMATCH_ERR: number; - readonly URL_MISMATCH_ERR: number; - readonly VALIDATION_ERR: number; - readonly WRONG_DOCUMENT_ERR: number; -} - -interface DOMImplementation { - createDocument(namespaceURI: string | null, qualifiedName: string | null, doctype: DocumentType): Document; - createDocumentType(qualifiedName: string, publicId: string | null, systemId: string | null): DocumentType; - createHTMLDocument(title: string): Document; - hasFeature(feature: string | null, version: string | null): boolean; -} - -declare var DOMImplementation: { - prototype: DOMImplementation; - new(): DOMImplementation; -} - -interface DOMParser { - parseFromString(source: string, mimeType: string): Document; -} - -declare var DOMParser: { - prototype: DOMParser; - new(): DOMParser; -} - -interface DOMSettableTokenList extends DOMTokenList { - value: string; -} - -declare var DOMSettableTokenList: { - prototype: DOMSettableTokenList; - new(): DOMSettableTokenList; -} - -interface DOMStringList { - readonly length: number; - contains(str: string): boolean; - item(index: number): string | null; - [index: number]: string; -} - -declare var DOMStringList: { - prototype: DOMStringList; - new(): DOMStringList; -} - -interface DOMStringMap { - [name: string]: string; -} - -declare var DOMStringMap: { - prototype: DOMStringMap; - new(): DOMStringMap; -} - -interface DOMTokenList { - readonly length: number; - add(...token: string[]): void; - contains(token: string): boolean; - item(index: number): string; - remove(...token: string[]): void; - toString(): string; - toggle(token: string, force?: boolean): boolean; - [index: number]: string; -} - -declare var DOMTokenList: { - prototype: DOMTokenList; - new(): DOMTokenList; -} - -interface DataCue extends TextTrackCue { - data: ArrayBuffer; -} - -declare var DataCue: { - prototype: DataCue; - new(): DataCue; -} - -interface DataTransfer { - dropEffect: string; - effectAllowed: string; - readonly files: FileList; - readonly items: DataTransferItemList; - readonly types: DOMStringList; - clearData(format?: string): boolean; - getData(format: string): string; - setData(format: string, data: string): boolean; -} - -declare var DataTransfer: { - prototype: DataTransfer; - new(): DataTransfer; -} - -interface DataTransferItem { - readonly kind: string; - readonly type: string; - getAsFile(): File | null; - getAsString(_callback: FunctionStringCallback | null): void; -} - -declare var DataTransferItem: { - prototype: DataTransferItem; - new(): DataTransferItem; -} - -interface DataTransferItemList { - readonly length: number; - add(data: File): DataTransferItem | null; - clear(): void; - item(index: number): DataTransferItem; - remove(index: number): void; - [index: number]: DataTransferItem; -} - -declare var DataTransferItemList: { - prototype: DataTransferItemList; - new(): DataTransferItemList; -} - -interface DeferredPermissionRequest { - readonly id: number; - readonly type: string; - readonly uri: string; - allow(): void; - deny(): void; -} - -declare var DeferredPermissionRequest: { - prototype: DeferredPermissionRequest; - new(): DeferredPermissionRequest; -} - -interface DelayNode extends AudioNode { - readonly delayTime: AudioParam; -} - -declare var DelayNode: { - prototype: DelayNode; - new(): DelayNode; -} - -interface DeviceAcceleration { - readonly x: number | null; - readonly y: number | null; - readonly z: number | null; -} - -declare var DeviceAcceleration: { - prototype: DeviceAcceleration; - new(): DeviceAcceleration; -} - -interface DeviceLightEvent extends Event { - readonly value: number; -} - -declare var DeviceLightEvent: { - prototype: DeviceLightEvent; - new(type: string, eventInitDict?: DeviceLightEventInit): DeviceLightEvent; -} - -interface DeviceMotionEvent extends Event { - readonly acceleration: DeviceAcceleration | null; - readonly accelerationIncludingGravity: DeviceAcceleration | null; - readonly interval: number | null; - readonly rotationRate: DeviceRotationRate | null; - initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict | null, accelerationIncludingGravity: DeviceAccelerationDict | null, rotationRate: DeviceRotationRateDict | null, interval: number | null): void; -} - -declare var DeviceMotionEvent: { - prototype: DeviceMotionEvent; - new(): DeviceMotionEvent; -} - -interface DeviceOrientationEvent extends Event { - readonly absolute: boolean; - readonly alpha: number | null; - readonly beta: number | null; - readonly gamma: number | null; - initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number | null, beta: number | null, gamma: number | null, absolute: boolean): void; -} - -declare var DeviceOrientationEvent: { - prototype: DeviceOrientationEvent; - new(): DeviceOrientationEvent; -} - -interface DeviceRotationRate { - readonly alpha: number | null; - readonly beta: number | null; - readonly gamma: number | null; -} - -declare var DeviceRotationRate: { - prototype: DeviceRotationRate; - new(): DeviceRotationRate; -} - -interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEvent, ParentNode { - /** - * Sets or gets the URL for the current document. - */ - readonly URL: string; - /** - * Gets the URL for the document, stripped of any character encoding. - */ - readonly URLUnencoded: string; - /** - * Gets the object that has the focus when the parent document has focus. - */ - readonly activeElement: Element; - /** - * Sets or gets the color of all active links in the document. - */ - alinkColor: string; - /** - * Returns a reference to the collection of elements contained by the object. - */ - readonly all: HTMLAllCollection; - /** - * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. - */ - anchors: HTMLCollectionOf; - /** - * Retrieves a collection of all applet objects in the document. - */ - applets: HTMLCollectionOf; - /** - * Deprecated. Sets or retrieves a value that indicates the background color behind the object. - */ - bgColor: string; - /** - * Specifies the beginning and end of the document body. - */ - body: HTMLElement; - readonly characterSet: string; - /** - * Gets or sets the character set used to encode the object. - */ - charset: string; - /** - * Gets a value that indicates whether standards-compliant mode is switched on for the object. - */ - readonly compatMode: string; - cookie: string; - readonly currentScript: HTMLScriptElement | SVGScriptElement; - /** - * Gets the default character set from the current regional language settings. - */ - readonly defaultCharset: string; - readonly defaultView: Window; - /** - * Sets or gets a value that indicates whether the document can be edited. - */ - designMode: string; - /** - * Sets or retrieves a value that indicates the reading order of the object. - */ - dir: string; - /** - * Gets an object representing the document type declaration associated with the current document. - */ - readonly doctype: DocumentType; - /** - * Gets a reference to the root node of the document. - */ - documentElement: HTMLElement; - /** - * Sets or gets the security domain of the document. - */ - domain: string; - /** - * Retrieves a collection of all embed objects in the document. - */ - embeds: HTMLCollectionOf; - /** - * Sets or gets the foreground (text) color of the document. - */ - fgColor: string; - /** - * Retrieves a collection, in source order, of all form objects in the document. - */ - forms: HTMLCollectionOf; - readonly fullscreenElement: Element | null; - readonly fullscreenEnabled: boolean; - readonly head: HTMLHeadElement; - readonly hidden: boolean; - /** - * Retrieves a collection, in source order, of img objects in the document. - */ - images: HTMLCollectionOf; - /** - * Gets the implementation object of the current document. - */ - readonly implementation: DOMImplementation; - /** - * Returns the character encoding used to create the webpage that is loaded into the document object. - */ - readonly inputEncoding: string | null; - /** - * Gets the date that the page was last modified, if the page supplies one. - */ - readonly lastModified: string; - /** - * Sets or gets the color of the document links. - */ - linkColor: string; - /** - * Retrieves a collection of all a objects that specify the href property and all area objects in the document. - */ - links: HTMLCollectionOf; - /** - * Contains information about the current URL. - */ - readonly location: Location; - msCSSOMElementFloatMetrics: boolean; - msCapsLockWarningOff: boolean; - /** - * Fires when the user aborts the download. - * @param ev The event. - */ - onabort: (this: this, ev: UIEvent) => any; - /** - * Fires when the object is set as the active element. - * @param ev The event. - */ - onactivate: (this: this, ev: UIEvent) => any; - /** - * Fires immediately before the object is set as the active element. - * @param ev The event. - */ - onbeforeactivate: (this: this, ev: UIEvent) => any; - /** - * Fires immediately before the activeElement is changed from the current object to another object in the parent document. - * @param ev The event. - */ - onbeforedeactivate: (this: this, ev: UIEvent) => any; - /** - * Fires when the object loses the input focus. - * @param ev The focus event. - */ - onblur: (this: this, ev: FocusEvent) => any; - /** - * Occurs when playback is possible, but would require further buffering. - * @param ev The event. - */ - oncanplay: (this: this, ev: Event) => any; - oncanplaythrough: (this: this, ev: Event) => any; - /** - * Fires when the contents of the object or selection have changed. - * @param ev The event. - */ - onchange: (this: this, ev: Event) => any; - /** - * Fires when the user clicks the left mouse button on the object - * @param ev The mouse event. - */ - onclick: (this: this, ev: MouseEvent) => any; - /** - * Fires when the user clicks the right mouse button in the client area, opening the context menu. - * @param ev The mouse event. - */ - oncontextmenu: (this: this, ev: PointerEvent) => any; - /** - * Fires when the user double-clicks the object. - * @param ev The mouse event. - */ - ondblclick: (this: this, ev: MouseEvent) => any; - /** - * Fires when the activeElement is changed from the current object to another object in the parent document. - * @param ev The UI Event - */ - ondeactivate: (this: this, ev: UIEvent) => any; - /** - * Fires on the source object continuously during a drag operation. - * @param ev The event. - */ - ondrag: (this: this, ev: DragEvent) => any; - /** - * Fires on the source object when the user releases the mouse at the close of a drag operation. - * @param ev The event. - */ - ondragend: (this: this, ev: DragEvent) => any; - /** - * Fires on the target element when the user drags the object to a valid drop target. - * @param ev The drag event. - */ - ondragenter: (this: this, ev: DragEvent) => any; - /** - * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. - * @param ev The drag event. - */ - ondragleave: (this: this, ev: DragEvent) => any; - /** - * Fires on the target element continuously while the user drags the object over a valid drop target. - * @param ev The event. - */ - ondragover: (this: this, ev: DragEvent) => any; - /** - * Fires on the source object when the user starts to drag a text selection or selected object. - * @param ev The event. - */ - ondragstart: (this: this, ev: DragEvent) => any; - ondrop: (this: this, ev: DragEvent) => any; - /** - * Occurs when the duration attribute is updated. - * @param ev The event. - */ - ondurationchange: (this: this, ev: Event) => any; - /** - * Occurs when the media element is reset to its initial state. - * @param ev The event. - */ - onemptied: (this: this, ev: Event) => any; - /** - * Occurs when the end of playback is reached. - * @param ev The event - */ - onended: (this: this, ev: MediaStreamErrorEvent) => any; - /** - * Fires when an error occurs during object loading. - * @param ev The event. - */ - onerror: (this: this, ev: ErrorEvent) => any; - /** - * Fires when the object receives focus. - * @param ev The event. - */ - onfocus: (this: this, ev: FocusEvent) => any; - onfullscreenchange: (this: this, ev: Event) => any; - onfullscreenerror: (this: this, ev: Event) => any; - oninput: (this: this, ev: Event) => any; - oninvalid: (this: this, ev: Event) => any; - /** - * Fires when the user presses a key. - * @param ev The keyboard event - */ - onkeydown: (this: this, ev: KeyboardEvent) => any; - /** - * Fires when the user presses an alphanumeric key. - * @param ev The event. - */ - onkeypress: (this: this, ev: KeyboardEvent) => any; - /** - * Fires when the user releases a key. - * @param ev The keyboard event - */ - onkeyup: (this: this, ev: KeyboardEvent) => any; - /** - * Fires immediately after the browser loads the object. - * @param ev The event. - */ - onload: (this: this, ev: Event) => any; - /** - * Occurs when media data is loaded at the current playback position. - * @param ev The event. - */ - onloadeddata: (this: this, ev: Event) => any; - /** - * Occurs when the duration and dimensions of the media have been determined. - * @param ev The event. - */ - onloadedmetadata: (this: this, ev: Event) => any; - /** - * Occurs when Internet Explorer begins looking for media data. - * @param ev The event. - */ - onloadstart: (this: this, ev: Event) => any; - /** - * Fires when the user clicks the object with either mouse button. - * @param ev The mouse event. - */ - onmousedown: (this: this, ev: MouseEvent) => any; - /** - * Fires when the user moves the mouse over the object. - * @param ev The mouse event. - */ - onmousemove: (this: this, ev: MouseEvent) => any; - /** - * Fires when the user moves the mouse pointer outside the boundaries of the object. - * @param ev The mouse event. - */ - onmouseout: (this: this, ev: MouseEvent) => any; - /** - * Fires when the user moves the mouse pointer into the object. - * @param ev The mouse event. - */ - onmouseover: (this: this, ev: MouseEvent) => any; - /** - * Fires when the user releases a mouse button while the mouse is over the object. - * @param ev The mouse event. - */ - onmouseup: (this: this, ev: MouseEvent) => any; - /** - * Fires when the wheel button is rotated. - * @param ev The mouse event - */ - onmousewheel: (this: this, ev: WheelEvent) => any; - onmscontentzoom: (this: this, ev: UIEvent) => any; - onmsgesturechange: (this: this, ev: MSGestureEvent) => any; - onmsgesturedoubletap: (this: this, ev: MSGestureEvent) => any; - onmsgestureend: (this: this, ev: MSGestureEvent) => any; - onmsgesturehold: (this: this, ev: MSGestureEvent) => any; - onmsgesturestart: (this: this, ev: MSGestureEvent) => any; - onmsgesturetap: (this: this, ev: MSGestureEvent) => any; - onmsinertiastart: (this: this, ev: MSGestureEvent) => any; - onmsmanipulationstatechanged: (this: this, ev: MSManipulationEvent) => any; - onmspointercancel: (this: this, ev: MSPointerEvent) => any; - onmspointerdown: (this: this, ev: MSPointerEvent) => any; - onmspointerenter: (this: this, ev: MSPointerEvent) => any; - onmspointerleave: (this: this, ev: MSPointerEvent) => any; - onmspointermove: (this: this, ev: MSPointerEvent) => any; - onmspointerout: (this: this, ev: MSPointerEvent) => any; - onmspointerover: (this: this, ev: MSPointerEvent) => any; - onmspointerup: (this: this, ev: MSPointerEvent) => any; - /** - * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. - * @param ev The event. - */ - onmssitemodejumplistitemremoved: (this: this, ev: MSSiteModeEvent) => any; - /** - * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. - * @param ev The event. - */ - onmsthumbnailclick: (this: this, ev: MSSiteModeEvent) => any; - /** - * Occurs when playback is paused. - * @param ev The event. - */ - onpause: (this: this, ev: Event) => any; - /** - * Occurs when the play method is requested. - * @param ev The event. - */ - onplay: (this: this, ev: Event) => any; - /** - * Occurs when the audio or video has started playing. - * @param ev The event. - */ - onplaying: (this: this, ev: Event) => any; - onpointerlockchange: (this: this, ev: Event) => any; - onpointerlockerror: (this: this, ev: Event) => any; - /** - * Occurs to indicate progress while downloading media data. - * @param ev The event. - */ - onprogress: (this: this, ev: ProgressEvent) => any; - /** - * Occurs when the playback rate is increased or decreased. - * @param ev The event. - */ - onratechange: (this: this, ev: Event) => any; - /** - * Fires when the state of the object has changed. - * @param ev The event - */ - onreadystatechange: (this: this, ev: ProgressEvent) => any; - /** - * Fires when the user resets a form. - * @param ev The event. - */ - onreset: (this: this, ev: Event) => any; - /** - * Fires when the user repositions the scroll box in the scroll bar on the object. - * @param ev The event. - */ - onscroll: (this: this, ev: UIEvent) => any; - /** - * Occurs when the seek operation ends. - * @param ev The event. - */ - onseeked: (this: this, ev: Event) => any; - /** - * Occurs when the current playback position is moved. - * @param ev The event. - */ - onseeking: (this: this, ev: Event) => any; - /** - * Fires when the current selection changes. - * @param ev The event. - */ - onselect: (this: this, ev: UIEvent) => any; - /** - * Fires when the selection state of a document changes. - * @param ev The event. - */ - onselectionchange: (this: this, ev: Event) => any; - onselectstart: (this: this, ev: Event) => any; - /** - * Occurs when the download has stopped. - * @param ev The event. - */ - onstalled: (this: this, ev: Event) => any; - /** - * Fires when the user clicks the Stop button or leaves the Web page. - * @param ev The event. - */ - onstop: (this: this, ev: Event) => any; - onsubmit: (this: this, ev: Event) => any; - /** - * Occurs if the load operation has been intentionally halted. - * @param ev The event. - */ - onsuspend: (this: this, ev: Event) => any; - /** - * Occurs to indicate the current playback position. - * @param ev The event. - */ - ontimeupdate: (this: this, ev: Event) => any; - ontouchcancel: (ev: TouchEvent) => any; - ontouchend: (ev: TouchEvent) => any; - ontouchmove: (ev: TouchEvent) => any; - ontouchstart: (ev: TouchEvent) => any; - /** - * Occurs when the volume is changed, or playback is muted or unmuted. - * @param ev The event. - */ - onvolumechange: (this: this, ev: Event) => any; - /** - * Occurs when playback stops because the next frame of a video resource is not available. - * @param ev The event. - */ - onwaiting: (this: this, ev: Event) => any; - onwebkitfullscreenchange: (this: this, ev: Event) => any; - onwebkitfullscreenerror: (this: this, ev: Event) => any; - plugins: HTMLCollectionOf; - readonly pointerLockElement: Element; - /** - * Retrieves a value that indicates the current state of the object. - */ - readonly readyState: string; - /** - * Gets the URL of the location that referred the user to the current page. - */ - readonly referrer: string; - /** - * Gets the root svg element in the document hierarchy. - */ - readonly rootElement: SVGSVGElement; - /** - * Retrieves a collection of all script objects in the document. - */ - scripts: HTMLCollectionOf; - readonly scrollingElement: Element | null; - /** - * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. - */ - readonly styleSheets: StyleSheetList; - /** - * Contains the title of the document. - */ - title: string; - readonly visibilityState: string; - /** - * Sets or gets the color of the links that the user has visited. - */ - vlinkColor: string; - readonly webkitCurrentFullScreenElement: Element | null; - readonly webkitFullscreenElement: Element | null; - readonly webkitFullscreenEnabled: boolean; - readonly webkitIsFullScreen: boolean; - readonly xmlEncoding: string | null; - xmlStandalone: boolean; - /** - * Gets or sets the version attribute specified in the declaration of an XML document. - */ - xmlVersion: string | null; - adoptNode(source: Node): Node; - captureEvents(): void; - caretRangeFromPoint(x: number, y: number): Range; - clear(): void; - /** - * Closes an output stream and forces the sent data to display. - */ - close(): void; - /** - * Creates an attribute object with a specified name. - * @param name String that sets the attribute object's name. - */ - createAttribute(name: string): Attr; - createAttributeNS(namespaceURI: string | null, qualifiedName: string): Attr; - createCDATASection(data: string): CDATASection; - /** - * Creates a comment object with the specified data. - * @param data Sets the comment object's data. - */ - createComment(data: string): Comment; - /** - * Creates a new document. - */ - createDocumentFragment(): DocumentFragment; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "a"): HTMLAnchorElement; - createElement(tagName: "applet"): HTMLAppletElement; - createElement(tagName: "area"): HTMLAreaElement; - createElement(tagName: "audio"): HTMLAudioElement; - createElement(tagName: "base"): HTMLBaseElement; - createElement(tagName: "basefont"): HTMLBaseFontElement; - createElement(tagName: "blockquote"): HTMLQuoteElement; - createElement(tagName: "body"): HTMLBodyElement; - createElement(tagName: "br"): HTMLBRElement; - createElement(tagName: "button"): HTMLButtonElement; - createElement(tagName: "canvas"): HTMLCanvasElement; - createElement(tagName: "caption"): HTMLTableCaptionElement; - createElement(tagName: "col"): HTMLTableColElement; - createElement(tagName: "colgroup"): HTMLTableColElement; - createElement(tagName: "datalist"): HTMLDataListElement; - createElement(tagName: "del"): HTMLModElement; - createElement(tagName: "dir"): HTMLDirectoryElement; - createElement(tagName: "div"): HTMLDivElement; - createElement(tagName: "dl"): HTMLDListElement; - createElement(tagName: "embed"): HTMLEmbedElement; - createElement(tagName: "fieldset"): HTMLFieldSetElement; - createElement(tagName: "font"): HTMLFontElement; - createElement(tagName: "form"): HTMLFormElement; - createElement(tagName: "frame"): HTMLFrameElement; - createElement(tagName: "frameset"): HTMLFrameSetElement; - createElement(tagName: "h1"): HTMLHeadingElement; - createElement(tagName: "h2"): HTMLHeadingElement; - createElement(tagName: "h3"): HTMLHeadingElement; - createElement(tagName: "h4"): HTMLHeadingElement; - createElement(tagName: "h5"): HTMLHeadingElement; - createElement(tagName: "h6"): HTMLHeadingElement; - createElement(tagName: "head"): HTMLHeadElement; - createElement(tagName: "hr"): HTMLHRElement; - createElement(tagName: "html"): HTMLHtmlElement; - createElement(tagName: "iframe"): HTMLIFrameElement; - createElement(tagName: "img"): HTMLImageElement; - createElement(tagName: "input"): HTMLInputElement; - createElement(tagName: "ins"): HTMLModElement; - createElement(tagName: "isindex"): HTMLUnknownElement; - createElement(tagName: "label"): HTMLLabelElement; - createElement(tagName: "legend"): HTMLLegendElement; - createElement(tagName: "li"): HTMLLIElement; - createElement(tagName: "link"): HTMLLinkElement; - createElement(tagName: "listing"): HTMLPreElement; - createElement(tagName: "map"): HTMLMapElement; - createElement(tagName: "marquee"): HTMLMarqueeElement; - createElement(tagName: "menu"): HTMLMenuElement; - createElement(tagName: "meta"): HTMLMetaElement; - createElement(tagName: "meter"): HTMLMeterElement; - createElement(tagName: "nextid"): HTMLUnknownElement; - createElement(tagName: "object"): HTMLObjectElement; - createElement(tagName: "ol"): HTMLOListElement; - createElement(tagName: "optgroup"): HTMLOptGroupElement; - createElement(tagName: "option"): HTMLOptionElement; - createElement(tagName: "p"): HTMLParagraphElement; - createElement(tagName: "param"): HTMLParamElement; - createElement(tagName: "picture"): HTMLPictureElement; - createElement(tagName: "pre"): HTMLPreElement; - createElement(tagName: "progress"): HTMLProgressElement; - createElement(tagName: "q"): HTMLQuoteElement; - createElement(tagName: "script"): HTMLScriptElement; - createElement(tagName: "select"): HTMLSelectElement; - createElement(tagName: "source"): HTMLSourceElement; - createElement(tagName: "span"): HTMLSpanElement; - createElement(tagName: "style"): HTMLStyleElement; - createElement(tagName: "table"): HTMLTableElement; - createElement(tagName: "tbody"): HTMLTableSectionElement; - createElement(tagName: "td"): HTMLTableDataCellElement; - createElement(tagName: "template"): HTMLTemplateElement; - createElement(tagName: "textarea"): HTMLTextAreaElement; - createElement(tagName: "tfoot"): HTMLTableSectionElement; - createElement(tagName: "th"): HTMLTableHeaderCellElement; - createElement(tagName: "thead"): HTMLTableSectionElement; - createElement(tagName: "title"): HTMLTitleElement; - createElement(tagName: "tr"): HTMLTableRowElement; - createElement(tagName: "track"): HTMLTrackElement; - createElement(tagName: "ul"): HTMLUListElement; - createElement(tagName: "video"): HTMLVideoElement; - createElement(tagName: "x-ms-webview"): MSHTMLWebViewElement; - createElement(tagName: "xmp"): HTMLPreElement; - createElement(tagName: string): HTMLElement; - createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "a"): SVGAElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "circle"): SVGCircleElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "clipPath"): SVGClipPathElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "componentTransferFunction"): SVGComponentTransferFunctionElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "defs"): SVGDefsElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "desc"): SVGDescElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "ellipse"): SVGEllipseElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feBlend"): SVGFEBlendElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feColorMatrix"): SVGFEColorMatrixElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feComponentTransfer"): SVGFEComponentTransferElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feComposite"): SVGFECompositeElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feConvolveMatrix"): SVGFEConvolveMatrixElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDiffuseLighting"): SVGFEDiffuseLightingElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDisplacementMap"): SVGFEDisplacementMapElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDistantLight"): SVGFEDistantLightElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFlood"): SVGFEFloodElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncA"): SVGFEFuncAElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncB"): SVGFEFuncBElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncG"): SVGFEFuncGElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncR"): SVGFEFuncRElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feGaussianBlur"): SVGFEGaussianBlurElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feImage"): SVGFEImageElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMerge"): SVGFEMergeElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMergeNode"): SVGFEMergeNodeElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMorphology"): SVGFEMorphologyElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feOffset"): SVGFEOffsetElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "fePointLight"): SVGFEPointLightElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feSpecularLighting"): SVGFESpecularLightingElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feSpotLight"): SVGFESpotLightElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feTile"): SVGFETileElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feTurbulence"): SVGFETurbulenceElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "filter"): SVGFilterElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "foreignObject"): SVGForeignObjectElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "g"): SVGGElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "image"): SVGImageElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "gradient"): SVGGradientElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "line"): SVGLineElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "linearGradient"): SVGLinearGradientElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "marker"): SVGMarkerElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "mask"): SVGMaskElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "path"): SVGPathElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "metadata"): SVGMetadataElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "pattern"): SVGPatternElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "polygon"): SVGPolygonElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "polyline"): SVGPolylineElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "radialGradient"): SVGRadialGradientElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "rect"): SVGRectElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "svg"): SVGSVGElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "script"): SVGScriptElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "stop"): SVGStopElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "style"): SVGStyleElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "switch"): SVGSwitchElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "symbol"): SVGSymbolElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "tspan"): SVGTSpanElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textContent"): SVGTextContentElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "text"): SVGTextElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textPath"): SVGTextPathElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textPositioning"): SVGTextPositioningElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "title"): SVGTitleElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "use"): SVGUseElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "view"): SVGViewElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement - createElementNS(namespaceURI: string | null, qualifiedName: string): Element; - createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; - createNSResolver(nodeResolver: Node): XPathNSResolver; - /** - * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list - * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): NodeIterator; - createProcessingInstruction(target: string, data: string): ProcessingInstruction; - /** - * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. - */ - createRange(): Range; - /** - * Creates a text string from the specified value. - * @param data String that specifies the nodeValue property of the text node. - */ - createTextNode(data: string): Text; - createTouch(view: Window, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch; - createTouchList(...touches: Touch[]): TouchList; - /** - * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. - * @param filter A custom NodeFilter function to use. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker; - /** - * Returns the element for the specified x coordinate and the specified y coordinate. - * @param x The x-offset - * @param y The y-offset - */ - elementFromPoint(x: number, y: number): Element; - evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver, type: number, result: XPathResult): XPathResult; - /** - * Executes a command on the current document, current selection, or the given range. - * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. - * @param showUI Display the user interface, defaults to false. - * @param value Value to assign. - */ - execCommand(commandId: string, showUI?: boolean, value?: any): boolean; - /** - * Displays help information for the given command identifier. - * @param commandId Displays help information for the given command identifier. - */ - execCommandShowHelp(commandId: string): boolean; - exitFullscreen(): void; - exitPointerLock(): void; - /** - * Causes the element to receive the focus and executes the code specified by the onfocus event. - */ - focus(): void; - /** - * Returns a reference to the first object with the specified value of the ID or NAME attribute. - * @param elementId String that specifies the ID value. Case-insensitive. - */ - getElementById(elementId: string): HTMLElement | null; - getElementsByClassName(classNames: string): HTMLCollectionOf; - /** - * Gets a collection of objects based on the value of the NAME or ID attribute. - * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. - */ - getElementsByName(elementName: string): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(tagname: "a"): NodeListOf; - getElementsByTagName(tagname: "abbr"): NodeListOf; - getElementsByTagName(tagname: "acronym"): NodeListOf; - getElementsByTagName(tagname: "address"): NodeListOf; - getElementsByTagName(tagname: "applet"): NodeListOf; - getElementsByTagName(tagname: "area"): NodeListOf; - getElementsByTagName(tagname: "article"): NodeListOf; - getElementsByTagName(tagname: "aside"): NodeListOf; - getElementsByTagName(tagname: "audio"): NodeListOf; - getElementsByTagName(tagname: "b"): NodeListOf; - getElementsByTagName(tagname: "base"): NodeListOf; - getElementsByTagName(tagname: "basefont"): NodeListOf; - getElementsByTagName(tagname: "bdo"): NodeListOf; - getElementsByTagName(tagname: "big"): NodeListOf; - getElementsByTagName(tagname: "blockquote"): NodeListOf; - getElementsByTagName(tagname: "body"): NodeListOf; - getElementsByTagName(tagname: "br"): NodeListOf; - getElementsByTagName(tagname: "button"): NodeListOf; - getElementsByTagName(tagname: "canvas"): NodeListOf; - getElementsByTagName(tagname: "caption"): NodeListOf; - getElementsByTagName(tagname: "center"): NodeListOf; - getElementsByTagName(tagname: "circle"): NodeListOf; - getElementsByTagName(tagname: "cite"): NodeListOf; - getElementsByTagName(tagname: "clippath"): NodeListOf; - getElementsByTagName(tagname: "code"): NodeListOf; - getElementsByTagName(tagname: "col"): NodeListOf; - getElementsByTagName(tagname: "colgroup"): NodeListOf; - getElementsByTagName(tagname: "datalist"): NodeListOf; - getElementsByTagName(tagname: "dd"): NodeListOf; - getElementsByTagName(tagname: "defs"): NodeListOf; - getElementsByTagName(tagname: "del"): NodeListOf; - getElementsByTagName(tagname: "desc"): NodeListOf; - getElementsByTagName(tagname: "dfn"): NodeListOf; - getElementsByTagName(tagname: "dir"): NodeListOf; - getElementsByTagName(tagname: "div"): NodeListOf; - getElementsByTagName(tagname: "dl"): NodeListOf; - getElementsByTagName(tagname: "dt"): NodeListOf; - getElementsByTagName(tagname: "ellipse"): NodeListOf; - getElementsByTagName(tagname: "em"): NodeListOf; - getElementsByTagName(tagname: "embed"): NodeListOf; - getElementsByTagName(tagname: "feblend"): NodeListOf; - getElementsByTagName(tagname: "fecolormatrix"): NodeListOf; - getElementsByTagName(tagname: "fecomponenttransfer"): NodeListOf; - getElementsByTagName(tagname: "fecomposite"): NodeListOf; - getElementsByTagName(tagname: "feconvolvematrix"): NodeListOf; - getElementsByTagName(tagname: "fediffuselighting"): NodeListOf; - getElementsByTagName(tagname: "fedisplacementmap"): NodeListOf; - getElementsByTagName(tagname: "fedistantlight"): NodeListOf; - getElementsByTagName(tagname: "feflood"): NodeListOf; - getElementsByTagName(tagname: "fefunca"): NodeListOf; - getElementsByTagName(tagname: "fefuncb"): NodeListOf; - getElementsByTagName(tagname: "fefuncg"): NodeListOf; - getElementsByTagName(tagname: "fefuncr"): NodeListOf; - getElementsByTagName(tagname: "fegaussianblur"): NodeListOf; - getElementsByTagName(tagname: "feimage"): NodeListOf; - getElementsByTagName(tagname: "femerge"): NodeListOf; - getElementsByTagName(tagname: "femergenode"): NodeListOf; - getElementsByTagName(tagname: "femorphology"): NodeListOf; - getElementsByTagName(tagname: "feoffset"): NodeListOf; - getElementsByTagName(tagname: "fepointlight"): NodeListOf; - getElementsByTagName(tagname: "fespecularlighting"): NodeListOf; - getElementsByTagName(tagname: "fespotlight"): NodeListOf; - getElementsByTagName(tagname: "fetile"): NodeListOf; - getElementsByTagName(tagname: "feturbulence"): NodeListOf; - getElementsByTagName(tagname: "fieldset"): NodeListOf; - getElementsByTagName(tagname: "figcaption"): NodeListOf; - getElementsByTagName(tagname: "figure"): NodeListOf; - getElementsByTagName(tagname: "filter"): NodeListOf; - getElementsByTagName(tagname: "font"): NodeListOf; - getElementsByTagName(tagname: "footer"): NodeListOf; - getElementsByTagName(tagname: "foreignobject"): NodeListOf; - getElementsByTagName(tagname: "form"): NodeListOf; - getElementsByTagName(tagname: "frame"): NodeListOf; - getElementsByTagName(tagname: "frameset"): NodeListOf; - getElementsByTagName(tagname: "g"): NodeListOf; - getElementsByTagName(tagname: "h1"): NodeListOf; - getElementsByTagName(tagname: "h2"): NodeListOf; - getElementsByTagName(tagname: "h3"): NodeListOf; - getElementsByTagName(tagname: "h4"): NodeListOf; - getElementsByTagName(tagname: "h5"): NodeListOf; - getElementsByTagName(tagname: "h6"): NodeListOf; - getElementsByTagName(tagname: "head"): NodeListOf; - getElementsByTagName(tagname: "header"): NodeListOf; - getElementsByTagName(tagname: "hgroup"): NodeListOf; - getElementsByTagName(tagname: "hr"): NodeListOf; - getElementsByTagName(tagname: "html"): NodeListOf; - getElementsByTagName(tagname: "i"): NodeListOf; - getElementsByTagName(tagname: "iframe"): NodeListOf; - getElementsByTagName(tagname: "image"): NodeListOf; - getElementsByTagName(tagname: "img"): NodeListOf; - getElementsByTagName(tagname: "input"): NodeListOf; - getElementsByTagName(tagname: "ins"): NodeListOf; - getElementsByTagName(tagname: "isindex"): NodeListOf; - getElementsByTagName(tagname: "kbd"): NodeListOf; - getElementsByTagName(tagname: "keygen"): NodeListOf; - getElementsByTagName(tagname: "label"): NodeListOf; - getElementsByTagName(tagname: "legend"): NodeListOf; - getElementsByTagName(tagname: "li"): NodeListOf; - getElementsByTagName(tagname: "line"): NodeListOf; - getElementsByTagName(tagname: "lineargradient"): NodeListOf; - getElementsByTagName(tagname: "link"): NodeListOf; - getElementsByTagName(tagname: "listing"): NodeListOf; - getElementsByTagName(tagname: "map"): NodeListOf; - getElementsByTagName(tagname: "mark"): NodeListOf; - getElementsByTagName(tagname: "marker"): NodeListOf; - getElementsByTagName(tagname: "marquee"): NodeListOf; - getElementsByTagName(tagname: "mask"): NodeListOf; - getElementsByTagName(tagname: "menu"): NodeListOf; - getElementsByTagName(tagname: "meta"): NodeListOf; - getElementsByTagName(tagname: "metadata"): NodeListOf; - getElementsByTagName(tagname: "meter"): NodeListOf; - getElementsByTagName(tagname: "nav"): NodeListOf; - getElementsByTagName(tagname: "nextid"): NodeListOf; - getElementsByTagName(tagname: "nobr"): NodeListOf; - getElementsByTagName(tagname: "noframes"): NodeListOf; - getElementsByTagName(tagname: "noscript"): NodeListOf; - getElementsByTagName(tagname: "object"): NodeListOf; - getElementsByTagName(tagname: "ol"): NodeListOf; - getElementsByTagName(tagname: "optgroup"): NodeListOf; - getElementsByTagName(tagname: "option"): NodeListOf; - getElementsByTagName(tagname: "p"): NodeListOf; - getElementsByTagName(tagname: "param"): NodeListOf; - getElementsByTagName(tagname: "path"): NodeListOf; - getElementsByTagName(tagname: "pattern"): NodeListOf; - getElementsByTagName(tagname: "picture"): NodeListOf; - getElementsByTagName(tagname: "plaintext"): NodeListOf; - getElementsByTagName(tagname: "polygon"): NodeListOf; - getElementsByTagName(tagname: "polyline"): NodeListOf; - getElementsByTagName(tagname: "pre"): NodeListOf; - getElementsByTagName(tagname: "progress"): NodeListOf; - getElementsByTagName(tagname: "q"): NodeListOf; - getElementsByTagName(tagname: "radialgradient"): NodeListOf; - getElementsByTagName(tagname: "rect"): NodeListOf; - getElementsByTagName(tagname: "rt"): NodeListOf; - getElementsByTagName(tagname: "ruby"): NodeListOf; - getElementsByTagName(tagname: "s"): NodeListOf; - getElementsByTagName(tagname: "samp"): NodeListOf; - getElementsByTagName(tagname: "script"): NodeListOf; - getElementsByTagName(tagname: "section"): NodeListOf; - getElementsByTagName(tagname: "select"): NodeListOf; - getElementsByTagName(tagname: "small"): NodeListOf; - getElementsByTagName(tagname: "source"): NodeListOf; - getElementsByTagName(tagname: "span"): NodeListOf; - getElementsByTagName(tagname: "stop"): NodeListOf; - getElementsByTagName(tagname: "strike"): NodeListOf; - getElementsByTagName(tagname: "strong"): NodeListOf; - getElementsByTagName(tagname: "style"): NodeListOf; - getElementsByTagName(tagname: "sub"): NodeListOf; - getElementsByTagName(tagname: "sup"): NodeListOf; - getElementsByTagName(tagname: "svg"): NodeListOf; - getElementsByTagName(tagname: "switch"): NodeListOf; - getElementsByTagName(tagname: "symbol"): NodeListOf; - getElementsByTagName(tagname: "table"): NodeListOf; - getElementsByTagName(tagname: "tbody"): NodeListOf; - getElementsByTagName(tagname: "td"): NodeListOf; - getElementsByTagName(tagname: "template"): NodeListOf; - getElementsByTagName(tagname: "text"): NodeListOf; - getElementsByTagName(tagname: "textpath"): NodeListOf; - getElementsByTagName(tagname: "textarea"): NodeListOf; - getElementsByTagName(tagname: "tfoot"): NodeListOf; - getElementsByTagName(tagname: "th"): NodeListOf; - getElementsByTagName(tagname: "thead"): NodeListOf; - getElementsByTagName(tagname: "title"): NodeListOf; - getElementsByTagName(tagname: "tr"): NodeListOf; - getElementsByTagName(tagname: "track"): NodeListOf; - getElementsByTagName(tagname: "tspan"): NodeListOf; - getElementsByTagName(tagname: "tt"): NodeListOf; - getElementsByTagName(tagname: "u"): NodeListOf; - getElementsByTagName(tagname: "ul"): NodeListOf; - getElementsByTagName(tagname: "use"): NodeListOf; - getElementsByTagName(tagname: "var"): NodeListOf; - getElementsByTagName(tagname: "video"): NodeListOf; - getElementsByTagName(tagname: "view"): NodeListOf; - getElementsByTagName(tagname: "wbr"): NodeListOf; - getElementsByTagName(tagname: "x-ms-webview"): NodeListOf; - getElementsByTagName(tagname: "xmp"): NodeListOf; - getElementsByTagName(tagname: string): NodeListOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf; - /** - * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. - */ - getSelection(): Selection; - /** - * Gets a value indicating whether the object currently has focus. - */ - hasFocus(): boolean; - importNode(importedNode: Node, deep: boolean): Node; - msElementsFromPoint(x: number, y: number): NodeListOf; - msElementsFromRect(left: number, top: number, width: number, height: number): NodeListOf; - /** - * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. - * @param url Specifies a MIME type for the document. - * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. - * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. - * @param replace Specifies whether the existing entry for the document is replaced in the history list. - */ - open(url?: string, name?: string, features?: string, replace?: boolean): Document; - /** - * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. - * @param commandId Specifies a command identifier. - */ - queryCommandEnabled(commandId: string): boolean; - /** - * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. - * @param commandId String that specifies a command identifier. - */ - queryCommandIndeterm(commandId: string): boolean; - /** - * Returns a Boolean value that indicates the current state of the command. - * @param commandId String that specifies a command identifier. - */ - queryCommandState(commandId: string): boolean; - /** - * Returns a Boolean value that indicates whether the current command is supported on the current range. - * @param commandId Specifies a command identifier. - */ - queryCommandSupported(commandId: string): boolean; - /** - * Retrieves the string associated with a command. - * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. - */ - queryCommandText(commandId: string): string; - /** - * Returns the current value of the document, range, or current selection for the given command. - * @param commandId String that specifies a command identifier. - */ - queryCommandValue(commandId: string): string; - releaseEvents(): void; - /** - * Allows updating the print settings for the page. - */ - updateSettings(): void; - webkitCancelFullScreen(): void; - webkitExitFullscreen(): void; - /** - * Writes one or more HTML expressions to a document in the specified window. - * @param content Specifies the text and HTML tags to write. - */ - write(...content: string[]): void; - /** - * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. - * @param content The text and HTML tags to write. - */ - writeln(...content: string[]): void; - addEventListener(type: "MSContentZoom", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (this: this, ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "fullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "fullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "invalid", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mssitemodejumplistitemremoved", listener: (this: this, ev: MSSiteModeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "msthumbnailclick", listener: (this: this, ev: MSSiteModeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerlockchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointerlockerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectionchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stop", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Document: { - prototype: Document; - new(): Document; -} - -interface DocumentFragment extends Node, NodeSelector, ParentNode { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var DocumentFragment: { - prototype: DocumentFragment; - new(): DocumentFragment; -} - -interface DocumentType extends Node, ChildNode { - readonly entities: NamedNodeMap; - readonly internalSubset: string | null; - readonly name: string; - readonly notations: NamedNodeMap; - readonly publicId: string | null; - readonly systemId: string | null; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var DocumentType: { - prototype: DocumentType; - new(): DocumentType; -} - -interface DragEvent extends MouseEvent { - readonly dataTransfer: DataTransfer; - initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; - msConvertURL(file: File, targetType: string, targetURL?: string): void; -} - -declare var DragEvent: { - prototype: DragEvent; - new(): DragEvent; -} - -interface DynamicsCompressorNode extends AudioNode { - readonly attack: AudioParam; - readonly knee: AudioParam; - readonly ratio: AudioParam; - readonly reduction: AudioParam; - readonly release: AudioParam; - readonly threshold: AudioParam; -} - -declare var DynamicsCompressorNode: { - prototype: DynamicsCompressorNode; - new(): DynamicsCompressorNode; -} - -interface EXT_frag_depth { -} - -declare var EXT_frag_depth: { - prototype: EXT_frag_depth; - new(): EXT_frag_depth; -} - -interface EXT_texture_filter_anisotropic { - readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; - readonly TEXTURE_MAX_ANISOTROPY_EXT: number; -} - -declare var EXT_texture_filter_anisotropic: { - prototype: EXT_texture_filter_anisotropic; - new(): EXT_texture_filter_anisotropic; - readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; - readonly TEXTURE_MAX_ANISOTROPY_EXT: number; -} - -interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelector, ChildNode, ParentNode { - readonly classList: DOMTokenList; - className: string; - readonly clientHeight: number; - readonly clientLeft: number; - readonly clientTop: number; - readonly clientWidth: number; - id: string; - msContentZoomFactor: number; - readonly msRegionOverflow: string; - onariarequest: (this: this, ev: AriaRequestEvent) => any; - oncommand: (this: this, ev: CommandEvent) => any; - ongotpointercapture: (this: this, ev: PointerEvent) => any; - onlostpointercapture: (this: this, ev: PointerEvent) => any; - onmsgesturechange: (this: this, ev: MSGestureEvent) => any; - onmsgesturedoubletap: (this: this, ev: MSGestureEvent) => any; - onmsgestureend: (this: this, ev: MSGestureEvent) => any; - onmsgesturehold: (this: this, ev: MSGestureEvent) => any; - onmsgesturestart: (this: this, ev: MSGestureEvent) => any; - onmsgesturetap: (this: this, ev: MSGestureEvent) => any; - onmsgotpointercapture: (this: this, ev: MSPointerEvent) => any; - onmsinertiastart: (this: this, ev: MSGestureEvent) => any; - onmslostpointercapture: (this: this, ev: MSPointerEvent) => any; - onmspointercancel: (this: this, ev: MSPointerEvent) => any; - onmspointerdown: (this: this, ev: MSPointerEvent) => any; - onmspointerenter: (this: this, ev: MSPointerEvent) => any; - onmspointerleave: (this: this, ev: MSPointerEvent) => any; - onmspointermove: (this: this, ev: MSPointerEvent) => any; - onmspointerout: (this: this, ev: MSPointerEvent) => any; - onmspointerover: (this: this, ev: MSPointerEvent) => any; - onmspointerup: (this: this, ev: MSPointerEvent) => any; - ontouchcancel: (ev: TouchEvent) => any; - ontouchend: (ev: TouchEvent) => any; - ontouchmove: (ev: TouchEvent) => any; - ontouchstart: (ev: TouchEvent) => any; - onwebkitfullscreenchange: (this: this, ev: Event) => any; - onwebkitfullscreenerror: (this: this, ev: Event) => any; - readonly prefix: string | null; - readonly scrollHeight: number; - scrollLeft: number; - scrollTop: number; - readonly scrollWidth: number; - readonly tagName: string; - innerHTML: string; - getAttribute(name: string): string | null; - getAttributeNS(namespaceURI: string, localName: string): string; - getAttributeNode(name: string): Attr; - getAttributeNodeNS(namespaceURI: string, localName: string): Attr; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; - getElementsByTagName(name: "a"): NodeListOf; - getElementsByTagName(name: "abbr"): NodeListOf; - getElementsByTagName(name: "acronym"): NodeListOf; - getElementsByTagName(name: "address"): NodeListOf; - getElementsByTagName(name: "applet"): NodeListOf; - getElementsByTagName(name: "area"): NodeListOf; - getElementsByTagName(name: "article"): NodeListOf; - getElementsByTagName(name: "aside"): NodeListOf; - getElementsByTagName(name: "audio"): NodeListOf; - getElementsByTagName(name: "b"): NodeListOf; - getElementsByTagName(name: "base"): NodeListOf; - getElementsByTagName(name: "basefont"): NodeListOf; - getElementsByTagName(name: "bdo"): NodeListOf; - getElementsByTagName(name: "big"): NodeListOf; - getElementsByTagName(name: "blockquote"): NodeListOf; - getElementsByTagName(name: "body"): NodeListOf; - getElementsByTagName(name: "br"): NodeListOf; - getElementsByTagName(name: "button"): NodeListOf; - getElementsByTagName(name: "canvas"): NodeListOf; - getElementsByTagName(name: "caption"): NodeListOf; - getElementsByTagName(name: "center"): NodeListOf; - getElementsByTagName(name: "circle"): NodeListOf; - getElementsByTagName(name: "cite"): NodeListOf; - getElementsByTagName(name: "clippath"): NodeListOf; - getElementsByTagName(name: "code"): NodeListOf; - getElementsByTagName(name: "col"): NodeListOf; - getElementsByTagName(name: "colgroup"): NodeListOf; - getElementsByTagName(name: "datalist"): NodeListOf; - getElementsByTagName(name: "dd"): NodeListOf; - getElementsByTagName(name: "defs"): NodeListOf; - getElementsByTagName(name: "del"): NodeListOf; - getElementsByTagName(name: "desc"): NodeListOf; - getElementsByTagName(name: "dfn"): NodeListOf; - getElementsByTagName(name: "dir"): NodeListOf; - getElementsByTagName(name: "div"): NodeListOf; - getElementsByTagName(name: "dl"): NodeListOf; - getElementsByTagName(name: "dt"): NodeListOf; - getElementsByTagName(name: "ellipse"): NodeListOf; - getElementsByTagName(name: "em"): NodeListOf; - getElementsByTagName(name: "embed"): NodeListOf; - getElementsByTagName(name: "feblend"): NodeListOf; - getElementsByTagName(name: "fecolormatrix"): NodeListOf; - getElementsByTagName(name: "fecomponenttransfer"): NodeListOf; - getElementsByTagName(name: "fecomposite"): NodeListOf; - getElementsByTagName(name: "feconvolvematrix"): NodeListOf; - getElementsByTagName(name: "fediffuselighting"): NodeListOf; - getElementsByTagName(name: "fedisplacementmap"): NodeListOf; - getElementsByTagName(name: "fedistantlight"): NodeListOf; - getElementsByTagName(name: "feflood"): NodeListOf; - getElementsByTagName(name: "fefunca"): NodeListOf; - getElementsByTagName(name: "fefuncb"): NodeListOf; - getElementsByTagName(name: "fefuncg"): NodeListOf; - getElementsByTagName(name: "fefuncr"): NodeListOf; - getElementsByTagName(name: "fegaussianblur"): NodeListOf; - getElementsByTagName(name: "feimage"): NodeListOf; - getElementsByTagName(name: "femerge"): NodeListOf; - getElementsByTagName(name: "femergenode"): NodeListOf; - getElementsByTagName(name: "femorphology"): NodeListOf; - getElementsByTagName(name: "feoffset"): NodeListOf; - getElementsByTagName(name: "fepointlight"): NodeListOf; - getElementsByTagName(name: "fespecularlighting"): NodeListOf; - getElementsByTagName(name: "fespotlight"): NodeListOf; - getElementsByTagName(name: "fetile"): NodeListOf; - getElementsByTagName(name: "feturbulence"): NodeListOf; - getElementsByTagName(name: "fieldset"): NodeListOf; - getElementsByTagName(name: "figcaption"): NodeListOf; - getElementsByTagName(name: "figure"): NodeListOf; - getElementsByTagName(name: "filter"): NodeListOf; - getElementsByTagName(name: "font"): NodeListOf; - getElementsByTagName(name: "footer"): NodeListOf; - getElementsByTagName(name: "foreignobject"): NodeListOf; - getElementsByTagName(name: "form"): NodeListOf; - getElementsByTagName(name: "frame"): NodeListOf; - getElementsByTagName(name: "frameset"): NodeListOf; - getElementsByTagName(name: "g"): NodeListOf; - getElementsByTagName(name: "h1"): NodeListOf; - getElementsByTagName(name: "h2"): NodeListOf; - getElementsByTagName(name: "h3"): NodeListOf; - getElementsByTagName(name: "h4"): NodeListOf; - getElementsByTagName(name: "h5"): NodeListOf; - getElementsByTagName(name: "h6"): NodeListOf; - getElementsByTagName(name: "head"): NodeListOf; - getElementsByTagName(name: "header"): NodeListOf; - getElementsByTagName(name: "hgroup"): NodeListOf; - getElementsByTagName(name: "hr"): NodeListOf; - getElementsByTagName(name: "html"): NodeListOf; - getElementsByTagName(name: "i"): NodeListOf; - getElementsByTagName(name: "iframe"): NodeListOf; - getElementsByTagName(name: "image"): NodeListOf; - getElementsByTagName(name: "img"): NodeListOf; - getElementsByTagName(name: "input"): NodeListOf; - getElementsByTagName(name: "ins"): NodeListOf; - getElementsByTagName(name: "isindex"): NodeListOf; - getElementsByTagName(name: "kbd"): NodeListOf; - getElementsByTagName(name: "keygen"): NodeListOf; - getElementsByTagName(name: "label"): NodeListOf; - getElementsByTagName(name: "legend"): NodeListOf; - getElementsByTagName(name: "li"): NodeListOf; - getElementsByTagName(name: "line"): NodeListOf; - getElementsByTagName(name: "lineargradient"): NodeListOf; - getElementsByTagName(name: "link"): NodeListOf; - getElementsByTagName(name: "listing"): NodeListOf; - getElementsByTagName(name: "map"): NodeListOf; - getElementsByTagName(name: "mark"): NodeListOf; - getElementsByTagName(name: "marker"): NodeListOf; - getElementsByTagName(name: "marquee"): NodeListOf; - getElementsByTagName(name: "mask"): NodeListOf; - getElementsByTagName(name: "menu"): NodeListOf; - getElementsByTagName(name: "meta"): NodeListOf; - getElementsByTagName(name: "metadata"): NodeListOf; - getElementsByTagName(name: "meter"): NodeListOf; - getElementsByTagName(name: "nav"): NodeListOf; - getElementsByTagName(name: "nextid"): NodeListOf; - getElementsByTagName(name: "nobr"): NodeListOf; - getElementsByTagName(name: "noframes"): NodeListOf; - getElementsByTagName(name: "noscript"): NodeListOf; - getElementsByTagName(name: "object"): NodeListOf; - getElementsByTagName(name: "ol"): NodeListOf; - getElementsByTagName(name: "optgroup"): NodeListOf; - getElementsByTagName(name: "option"): NodeListOf; - getElementsByTagName(name: "p"): NodeListOf; - getElementsByTagName(name: "param"): NodeListOf; - getElementsByTagName(name: "path"): NodeListOf; - getElementsByTagName(name: "pattern"): NodeListOf; - getElementsByTagName(name: "picture"): NodeListOf; - getElementsByTagName(name: "plaintext"): NodeListOf; - getElementsByTagName(name: "polygon"): NodeListOf; - getElementsByTagName(name: "polyline"): NodeListOf; - getElementsByTagName(name: "pre"): NodeListOf; - getElementsByTagName(name: "progress"): NodeListOf; - getElementsByTagName(name: "q"): NodeListOf; - getElementsByTagName(name: "radialgradient"): NodeListOf; - getElementsByTagName(name: "rect"): NodeListOf; - getElementsByTagName(name: "rt"): NodeListOf; - getElementsByTagName(name: "ruby"): NodeListOf; - getElementsByTagName(name: "s"): NodeListOf; - getElementsByTagName(name: "samp"): NodeListOf; - getElementsByTagName(name: "script"): NodeListOf; - getElementsByTagName(name: "section"): NodeListOf; - getElementsByTagName(name: "select"): NodeListOf; - getElementsByTagName(name: "small"): NodeListOf; - getElementsByTagName(name: "source"): NodeListOf; - getElementsByTagName(name: "span"): NodeListOf; - getElementsByTagName(name: "stop"): NodeListOf; - getElementsByTagName(name: "strike"): NodeListOf; - getElementsByTagName(name: "strong"): NodeListOf; - getElementsByTagName(name: "style"): NodeListOf; - getElementsByTagName(name: "sub"): NodeListOf; - getElementsByTagName(name: "sup"): NodeListOf; - getElementsByTagName(name: "svg"): NodeListOf; - getElementsByTagName(name: "switch"): NodeListOf; - getElementsByTagName(name: "symbol"): NodeListOf; - getElementsByTagName(name: "table"): NodeListOf; - getElementsByTagName(name: "tbody"): NodeListOf; - getElementsByTagName(name: "td"): NodeListOf; - getElementsByTagName(name: "template"): NodeListOf; - getElementsByTagName(name: "text"): NodeListOf; - getElementsByTagName(name: "textpath"): NodeListOf; - getElementsByTagName(name: "textarea"): NodeListOf; - getElementsByTagName(name: "tfoot"): NodeListOf; - getElementsByTagName(name: "th"): NodeListOf; - getElementsByTagName(name: "thead"): NodeListOf; - getElementsByTagName(name: "title"): NodeListOf; - getElementsByTagName(name: "tr"): NodeListOf; - getElementsByTagName(name: "track"): NodeListOf; - getElementsByTagName(name: "tspan"): NodeListOf; - getElementsByTagName(name: "tt"): NodeListOf; - getElementsByTagName(name: "u"): NodeListOf; - getElementsByTagName(name: "ul"): NodeListOf; - getElementsByTagName(name: "use"): NodeListOf; - getElementsByTagName(name: "var"): NodeListOf; - getElementsByTagName(name: "video"): NodeListOf; - getElementsByTagName(name: "view"): NodeListOf; - getElementsByTagName(name: "wbr"): NodeListOf; - getElementsByTagName(name: "x-ms-webview"): NodeListOf; - getElementsByTagName(name: "xmp"): NodeListOf; - getElementsByTagName(name: string): NodeListOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf; - hasAttribute(name: string): boolean; - hasAttributeNS(namespaceURI: string, localName: string): boolean; - msGetRegionContent(): MSRangeCollection; - msGetUntransformedBounds(): ClientRect; - msMatchesSelector(selectors: string): boolean; - msReleasePointerCapture(pointerId: number): void; - msSetPointerCapture(pointerId: number): void; - msZoomTo(args: MsZoomToOptions): void; - releasePointerCapture(pointerId: number): void; - removeAttribute(name?: string): void; - removeAttributeNS(namespaceURI: string, localName: string): void; - removeAttributeNode(oldAttr: Attr): Attr; - requestFullscreen(): void; - requestPointerLock(): void; - setAttribute(name: string, value: string): void; - setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; - setAttributeNode(newAttr: Attr): Attr; - setAttributeNodeNS(newAttr: Attr): Attr; - setPointerCapture(pointerId: number): void; - webkitMatchesSelector(selectors: string): boolean; - webkitRequestFullScreen(): void; - webkitRequestFullscreen(): void; - getElementsByClassName(classNames: string): NodeListOf; - matches(selector: string): boolean; - closest(selector: string): Element | null; - scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void; - scroll(options?: ScrollToOptions): void; - scroll(x: number, y: number): void; - scrollTo(options?: ScrollToOptions): void; - scrollTo(x: number, y: number): void; - scrollBy(options?: ScrollToOptions): void; - scrollBy(x: number, y: number): void; - insertAdjacentElement(position: string, insertedElement: Element): Element | null; - insertAdjacentHTML(where: string, html: string): void; - insertAdjacentText(where: string, text: string): void; - addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (this: this, ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (this: this, ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Element: { - prototype: Element; - new(): Element; -} - -interface ErrorEvent extends Event { - readonly colno: number; - readonly error: any; - readonly filename: string; - readonly lineno: number; - readonly message: string; - initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; -} - -declare var ErrorEvent: { - prototype: ErrorEvent; - new(): ErrorEvent; -} - -interface Event { - readonly bubbles: boolean; - cancelBubble: boolean; - readonly cancelable: boolean; - readonly currentTarget: EventTarget; - readonly defaultPrevented: boolean; - readonly eventPhase: number; - readonly isTrusted: boolean; - returnValue: boolean; - readonly srcElement: Element | null; - readonly target: EventTarget; - readonly timeStamp: number; - readonly type: string; - initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; - preventDefault(): void; - stopImmediatePropagation(): void; - stopPropagation(): void; - readonly AT_TARGET: number; - readonly BUBBLING_PHASE: number; - readonly CAPTURING_PHASE: number; -} - -declare var Event: { - prototype: Event; - new(type: string, eventInitDict?: EventInit): Event; - readonly AT_TARGET: number; - readonly BUBBLING_PHASE: number; - readonly CAPTURING_PHASE: number; -} - -interface EventTarget { - addEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void; - dispatchEvent(evt: Event): boolean; - removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var EventTarget: { - prototype: EventTarget; - new(): EventTarget; -} - -interface External { -} - -declare var External: { - prototype: External; - new(): External; -} - -interface File extends Blob { - readonly lastModifiedDate: any; - readonly name: string; - readonly webkitRelativePath: string; -} - -declare var File: { - prototype: File; - new (parts: (ArrayBuffer | ArrayBufferView | Blob | string)[], filename: string, properties?: FilePropertyBag): File; -} - -interface FileList { - readonly length: number; - item(index: number): File; - [index: number]: File; -} - -declare var FileList: { - prototype: FileList; - new(): FileList; -} - -interface FileReader extends EventTarget, MSBaseReader { - readonly error: DOMError; - readAsArrayBuffer(blob: Blob): void; - readAsBinaryString(blob: Blob): void; - readAsDataURL(blob: Blob): void; - readAsText(blob: Blob, encoding?: string): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var FileReader: { - prototype: FileReader; - new(): FileReader; -} - -interface FocusEvent extends UIEvent { - readonly relatedTarget: EventTarget; - initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; -} - -declare var FocusEvent: { - prototype: FocusEvent; - new(typeArg: string, eventInitDict?: FocusEventInit): FocusEvent; -} - -interface FormData { - append(name: any, value: any, blobName?: string): void; -} - -declare var FormData: { - prototype: FormData; - new (form?: HTMLFormElement): FormData; -} - -interface GainNode extends AudioNode { - readonly gain: AudioParam; -} - -declare var GainNode: { - prototype: GainNode; - new(): GainNode; -} - -interface Gamepad { - readonly axes: number[]; - readonly buttons: GamepadButton[]; - readonly connected: boolean; - readonly id: string; - readonly index: number; - readonly mapping: string; - readonly timestamp: number; -} - -declare var Gamepad: { - prototype: Gamepad; - new(): Gamepad; -} - -interface GamepadButton { - readonly pressed: boolean; - readonly value: number; -} - -declare var GamepadButton: { - prototype: GamepadButton; - new(): GamepadButton; -} - -interface GamepadEvent extends Event { - readonly gamepad: Gamepad; -} - -declare var GamepadEvent: { - prototype: GamepadEvent; - new(): GamepadEvent; -} - -interface Geolocation { - clearWatch(watchId: number): void; - getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; - watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; -} - -declare var Geolocation: { - prototype: Geolocation; - new(): Geolocation; -} - -interface HTMLAllCollection extends HTMLCollection { - namedItem(name: string): Element; -} - -declare var HTMLAllCollection: { - prototype: HTMLAllCollection; - new(): HTMLAllCollection; -} - -interface HTMLAnchorElement extends HTMLElement { - Methods: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - download: string; - /** - * Contains the anchor portion of the URL including the hash sign (#). - */ - hash: string; - /** - * Contains the hostname and port values of the URL. - */ - host: string; - /** - * Contains the hostname of a URL. - */ - hostname: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; - readonly mimeType: string; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - readonly nameProp: string; - /** - * Contains the pathname of the URL. - */ - pathname: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Contains the protocol of the URL. - */ - protocol: string; - readonly protocolLong: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - type: string; - urn: string; - /** - * Returns a string representation of an object. - */ - toString(): string; -} - -declare var HTMLAnchorElement: { - prototype: HTMLAnchorElement; - new(): HTMLAnchorElement; -} - -interface HTMLAppletElement extends HTMLElement { - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - readonly BaseHref: string; - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. - */ - altHtml: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - border: string; - code: string; - /** - * Sets or retrieves the URL of the component. - */ - codeBase: string; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - /** - * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. - */ - readonly contentDocument: Document; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; - /** - * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. - */ - declare: boolean; - readonly form: HTMLFormElement; - /** - * Sets or retrieves the height of the object. - */ - height: string; - hspace: number; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - object: string | null; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - vspace: number; - width: number; -} - -declare var HTMLAppletElement: { - prototype: HTMLAppletElement; - new(): HTMLAppletElement; -} - -interface HTMLAreaElement extends HTMLElement { - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - download: string; - /** - * Sets or retrieves the subsection of the href property that follows the number sign (#). - */ - hash: string; - /** - * Sets or retrieves the hostname and port number of the location or URL. - */ - host: string; - /** - * Sets or retrieves the host name part of the location or URL. - */ - hostname: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or gets whether clicks in this region cause action. - */ - noHref: boolean; - /** - * Sets or retrieves the file name or path specified by the object. - */ - pathname: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Sets or retrieves the protocol portion of a URL. - */ - protocol: string; - rel: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Returns a string representation of an object. - */ - toString(): string; -} - -declare var HTMLAreaElement: { - prototype: HTMLAreaElement; - new(): HTMLAreaElement; -} - -interface HTMLAreasCollection extends HTMLCollection { - /** - * Adds an element to the areas, controlRange, or options collection. - */ - add(element: HTMLElement, before?: HTMLElement | number): void; - /** - * Removes an element from the collection. - */ - remove(index?: number): void; -} - -declare var HTMLAreasCollection: { - prototype: HTMLAreasCollection; - new(): HTMLAreasCollection; -} - -interface HTMLAudioElement extends HTMLMediaElement { -} - -declare var HTMLAudioElement: { - prototype: HTMLAudioElement; - new(): HTMLAudioElement; -} - -interface HTMLBRElement extends HTMLElement { - /** - * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. - */ - clear: string; -} - -declare var HTMLBRElement: { - prototype: HTMLBRElement; - new(): HTMLBRElement; -} - -interface HTMLBaseElement extends HTMLElement { - /** - * Gets or sets the baseline URL on which relative links are based. - */ - href: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; -} - -declare var HTMLBaseElement: { - prototype: HTMLBaseElement; - new(): HTMLBaseElement; -} - -interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; - /** - * Sets or retrieves the font size of the object. - */ - size: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLBaseFontElement: { - prototype: HTMLBaseFontElement; - new(): HTMLBaseFontElement; -} - -interface HTMLBodyElement extends HTMLElement { - aLink: any; - background: string; - bgColor: any; - bgProperties: string; - link: any; - noWrap: boolean; - onafterprint: (this: this, ev: Event) => any; - onbeforeprint: (this: this, ev: Event) => any; - onbeforeunload: (this: this, ev: BeforeUnloadEvent) => any; - onblur: (this: this, ev: FocusEvent) => any; - onerror: (this: this, ev: ErrorEvent) => any; - onfocus: (this: this, ev: FocusEvent) => any; - onhashchange: (this: this, ev: HashChangeEvent) => any; - onload: (this: this, ev: Event) => any; - onmessage: (this: this, ev: MessageEvent) => any; - onoffline: (this: this, ev: Event) => any; - ononline: (this: this, ev: Event) => any; - onorientationchange: (this: this, ev: Event) => any; - onpagehide: (this: this, ev: PageTransitionEvent) => any; - onpageshow: (this: this, ev: PageTransitionEvent) => any; - onpopstate: (this: this, ev: PopStateEvent) => any; - onresize: (this: this, ev: UIEvent) => any; - onstorage: (this: this, ev: StorageEvent) => any; - onunload: (this: this, ev: Event) => any; - text: any; - vLink: any; - addEventListener(type: "MSContentZoom", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (this: this, ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (this: this, ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (this: this, ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (this: this, ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (this: this, ev: HashChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "invalid", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (this: this, ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "orientationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (this: this, ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (this: this, ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "popstate", listener: (this: this, ev: PopStateEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (this: this, ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLBodyElement: { - prototype: HTMLBodyElement; - new(): HTMLBodyElement; -} - -interface HTMLButtonElement extends HTMLElement { - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. - */ - formAction: string; - /** - * Used to override the encoding (formEnctype attribute) specified on the form element. - */ - formEnctype: string; - /** - * Overrides the submit method attribute previously specified on a form element. - */ - formMethod: string; - /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. - */ - formNoValidate: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - status: any; - /** - * Gets the classification and default behavior of the button. - */ - type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - /** - * Sets or retrieves the default or selected value of the control. - */ - value: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} - -declare var HTMLButtonElement: { - prototype: HTMLButtonElement; - new(): HTMLButtonElement; -} - -interface HTMLCanvasElement extends HTMLElement { - /** - * Gets or sets the height of a canvas element on a document. - */ - height: number; - /** - * Gets or sets the width of a canvas element on a document. - */ - width: number; - /** - * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. - * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); - */ - getContext(contextId: "2d", contextAttributes?: Canvas2DContextAttributes): CanvasRenderingContext2D | null; - getContext(contextId: "webgl" | "experimental-webgl", contextAttributes?: WebGLContextAttributes): WebGLRenderingContext | null; - getContext(contextId: string, contextAttributes?: {}): CanvasRenderingContext2D | WebGLRenderingContext | null; - /** - * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. - */ - msToBlob(): Blob; - /** - * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. - * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. - */ - toDataURL(type?: string, ...args: any[]): string; - toBlob(callback: (result: Blob | null) => void, type?: string, ...arguments: any[]): void; -} - -declare var HTMLCanvasElement: { - prototype: HTMLCanvasElement; - new(): HTMLCanvasElement; -} - -interface HTMLCollection { - /** - * Sets or retrieves the number of objects in a collection. - */ - readonly length: number; - /** - * Retrieves an object from various collections. - */ - item(index: number): Element; - /** - * Retrieves a select object or an object from an options collection. - */ - namedItem(name: string): Element; - [index: number]: Element; -} - -declare var HTMLCollection: { - prototype: HTMLCollection; - new(): HTMLCollection; -} - -interface HTMLDListElement extends HTMLElement { - compact: boolean; -} - -declare var HTMLDListElement: { - prototype: HTMLDListElement; - new(): HTMLDListElement; -} - -interface HTMLDataListElement extends HTMLElement { - options: HTMLCollectionOf; -} - -declare var HTMLDataListElement: { - prototype: HTMLDataListElement; - new(): HTMLDataListElement; -} - -interface HTMLDirectoryElement extends HTMLElement { - compact: boolean; -} - -declare var HTMLDirectoryElement: { - prototype: HTMLDirectoryElement; - new(): HTMLDirectoryElement; -} - -interface HTMLDivElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} - -declare var HTMLDivElement: { - prototype: HTMLDivElement; - new(): HTMLDivElement; -} - -interface HTMLDocument extends Document { -} - -declare var HTMLDocument: { - prototype: HTMLDocument; - new(): HTMLDocument; -} - -interface HTMLElement extends Element { - accessKey: string; - readonly children: HTMLCollection; - contentEditable: string; - readonly dataset: DOMStringMap; - dir: string; - draggable: boolean; - hidden: boolean; - hideFocus: boolean; - innerHTML: string; - innerText: string; - readonly isContentEditable: boolean; - lang: string; - readonly offsetHeight: number; - readonly offsetLeft: number; - readonly offsetParent: Element; - readonly offsetTop: number; - readonly offsetWidth: number; - onabort: (this: this, ev: UIEvent) => any; - onactivate: (this: this, ev: UIEvent) => any; - onbeforeactivate: (this: this, ev: UIEvent) => any; - onbeforecopy: (this: this, ev: ClipboardEvent) => any; - onbeforecut: (this: this, ev: ClipboardEvent) => any; - onbeforedeactivate: (this: this, ev: UIEvent) => any; - onbeforepaste: (this: this, ev: ClipboardEvent) => any; - onblur: (this: this, ev: FocusEvent) => any; - oncanplay: (this: this, ev: Event) => any; - oncanplaythrough: (this: this, ev: Event) => any; - onchange: (this: this, ev: Event) => any; - onclick: (this: this, ev: MouseEvent) => any; - oncontextmenu: (this: this, ev: PointerEvent) => any; - oncopy: (this: this, ev: ClipboardEvent) => any; - oncuechange: (this: this, ev: Event) => any; - oncut: (this: this, ev: ClipboardEvent) => any; - ondblclick: (this: this, ev: MouseEvent) => any; - ondeactivate: (this: this, ev: UIEvent) => any; - ondrag: (this: this, ev: DragEvent) => any; - ondragend: (this: this, ev: DragEvent) => any; - ondragenter: (this: this, ev: DragEvent) => any; - ondragleave: (this: this, ev: DragEvent) => any; - ondragover: (this: this, ev: DragEvent) => any; - ondragstart: (this: this, ev: DragEvent) => any; - ondrop: (this: this, ev: DragEvent) => any; - ondurationchange: (this: this, ev: Event) => any; - onemptied: (this: this, ev: Event) => any; - onended: (this: this, ev: MediaStreamErrorEvent) => any; - onerror: (this: this, ev: ErrorEvent) => any; - onfocus: (this: this, ev: FocusEvent) => any; - oninput: (this: this, ev: Event) => any; - oninvalid: (this: this, ev: Event) => any; - onkeydown: (this: this, ev: KeyboardEvent) => any; - onkeypress: (this: this, ev: KeyboardEvent) => any; - onkeyup: (this: this, ev: KeyboardEvent) => any; - onload: (this: this, ev: Event) => any; - onloadeddata: (this: this, ev: Event) => any; - onloadedmetadata: (this: this, ev: Event) => any; - onloadstart: (this: this, ev: Event) => any; - onmousedown: (this: this, ev: MouseEvent) => any; - onmouseenter: (this: this, ev: MouseEvent) => any; - onmouseleave: (this: this, ev: MouseEvent) => any; - onmousemove: (this: this, ev: MouseEvent) => any; - onmouseout: (this: this, ev: MouseEvent) => any; - onmouseover: (this: this, ev: MouseEvent) => any; - onmouseup: (this: this, ev: MouseEvent) => any; - onmousewheel: (this: this, ev: WheelEvent) => any; - onmscontentzoom: (this: this, ev: UIEvent) => any; - onmsmanipulationstatechanged: (this: this, ev: MSManipulationEvent) => any; - onpaste: (this: this, ev: ClipboardEvent) => any; - onpause: (this: this, ev: Event) => any; - onplay: (this: this, ev: Event) => any; - onplaying: (this: this, ev: Event) => any; - onprogress: (this: this, ev: ProgressEvent) => any; - onratechange: (this: this, ev: Event) => any; - onreset: (this: this, ev: Event) => any; - onscroll: (this: this, ev: UIEvent) => any; - onseeked: (this: this, ev: Event) => any; - onseeking: (this: this, ev: Event) => any; - onselect: (this: this, ev: UIEvent) => any; - onselectstart: (this: this, ev: Event) => any; - onstalled: (this: this, ev: Event) => any; - onsubmit: (this: this, ev: Event) => any; - onsuspend: (this: this, ev: Event) => any; - ontimeupdate: (this: this, ev: Event) => any; - onvolumechange: (this: this, ev: Event) => any; - onwaiting: (this: this, ev: Event) => any; - outerHTML: string; - outerText: string; - spellcheck: boolean; - readonly style: CSSStyleDeclaration; - tabIndex: number; - title: string; - blur(): void; - click(): void; - dragDrop(): boolean; - focus(): void; - msGetInputContext(): MSInputMethodContext; - setActive(): void; - addEventListener(type: "MSContentZoom", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (this: this, ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (this: this, ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (this: this, ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "invalid", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLElement: { - prototype: HTMLElement; - new(): HTMLElement; -} - -interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { - /** - * Sets or retrieves the height of the object. - */ - height: string; - hidden: any; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - readonly msPlayToSource: any; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Retrieves the palette used for the embedded document. - */ - readonly palette: string; - /** - * Retrieves the URL of the plug-in used to view an embedded document. - */ - readonly pluginspage: string; - readonly readyState: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the height and width units of the embed object. - */ - units: string; - /** - * Sets or retrieves the width of the object. - */ - width: string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLEmbedElement: { - prototype: HTMLEmbedElement; - new(): HTMLEmbedElement; -} - -interface HTMLFieldSetElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} - -declare var HTMLFieldSetElement: { - prototype: HTMLFieldSetElement; - new(): HTMLFieldSetElement; -} - -interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLFontElement: { - prototype: HTMLFontElement; - new(): HTMLFontElement; -} - -interface HTMLFormElement extends HTMLElement { - /** - * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. - */ - acceptCharset: string; - /** - * Sets or retrieves the URL to which the form content is sent for processing. - */ - action: string; - /** - * Specifies whether autocomplete is applied to an editable text field. - */ - autocomplete: string; - /** - * Retrieves a collection, in source order, of all controls in a given form. - */ - readonly elements: HTMLCollection; - /** - * Sets or retrieves the MIME encoding for the form. - */ - encoding: string; - /** - * Sets or retrieves the encoding type for the form. - */ - enctype: string; - /** - * Sets or retrieves the number of objects in a collection. - */ - readonly length: number; - /** - * Sets or retrieves how to send the form data to the server. - */ - method: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Designates a form that is not validated when submitted. - */ - noValidate: boolean; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Retrieves a form object or an object from an elements collection. - * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. - * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. - */ - item(name?: any, index?: any): any; - /** - * Retrieves a form object or an object from an elements collection. - */ - namedItem(name: string): any; - /** - * Fires when the user resets a form. - */ - reset(): void; - /** - * Fires when a FORM is about to be submitted. - */ - submit(): void; - [name: string]: any; -} - -declare var HTMLFormElement: { - prototype: HTMLFormElement; - new(): HTMLFormElement; -} - -interface HTMLFrameElement extends HTMLElement, GetSVGDocument { - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Retrieves the document object of the page or frame. - */ - readonly contentDocument: Document; - /** - * Retrieves the object of the specified. - */ - readonly contentWindow: Window; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves the height of the object. - */ - height: string | number; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Raised when the object has been completely received from the server. - */ - onload: (this: this, ev: Event) => any; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the width of the object. - */ - width: string | number; - addEventListener(type: "MSContentZoom", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (this: this, ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (this: this, ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (this: this, ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "invalid", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLFrameElement: { - prototype: HTMLFrameElement; - new(): HTMLFrameElement; -} - -interface HTMLFrameSetElement extends HTMLElement { - border: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the frame widths of the object. - */ - cols: string; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - name: string; - onafterprint: (this: this, ev: Event) => any; - onbeforeprint: (this: this, ev: Event) => any; - onbeforeunload: (this: this, ev: BeforeUnloadEvent) => any; - /** - * Fires when the object loses the input focus. - */ - onblur: (this: this, ev: FocusEvent) => any; - onerror: (this: this, ev: ErrorEvent) => any; - /** - * Fires when the object receives focus. - */ - onfocus: (this: this, ev: FocusEvent) => any; - onhashchange: (this: this, ev: HashChangeEvent) => any; - onload: (this: this, ev: Event) => any; - onmessage: (this: this, ev: MessageEvent) => any; - onoffline: (this: this, ev: Event) => any; - ononline: (this: this, ev: Event) => any; - onorientationchange: (this: this, ev: Event) => any; - onpagehide: (this: this, ev: PageTransitionEvent) => any; - onpageshow: (this: this, ev: PageTransitionEvent) => any; - onresize: (this: this, ev: UIEvent) => any; - onstorage: (this: this, ev: StorageEvent) => any; - onunload: (this: this, ev: Event) => any; - /** - * Sets or retrieves the frame heights of the object. - */ - rows: string; - addEventListener(type: "MSContentZoom", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (this: this, ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (this: this, ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (this: this, ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (this: this, ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (this: this, ev: HashChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "invalid", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (this: this, ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "orientationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (this: this, ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (this: this, ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (this: this, ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLFrameSetElement: { - prototype: HTMLFrameSetElement; - new(): HTMLFrameSetElement; -} - -interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. - */ - noShade: boolean; - /** - * Sets or retrieves the width of the object. - */ - width: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLHRElement: { - prototype: HTMLHRElement; - new(): HTMLHRElement; -} - -interface HTMLHeadElement extends HTMLElement { - profile: string; -} - -declare var HTMLHeadElement: { - prototype: HTMLHeadElement; - new(): HTMLHeadElement; -} - -interface HTMLHeadingElement extends HTMLElement { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; -} - -declare var HTMLHeadingElement: { - prototype: HTMLHeadingElement; - new(): HTMLHeadingElement; -} - -interface HTMLHtmlElement extends HTMLElement { - /** - * Sets or retrieves the DTD version that governs the current document. - */ - version: string; -} - -declare var HTMLHtmlElement: { - prototype: HTMLHtmlElement; - new(): HTMLHtmlElement; -} - -interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - allowFullscreen: boolean; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Retrieves the document object of the page or frame. - */ - readonly contentDocument: Document; - /** - * Retrieves the object of the specified. - */ - readonly contentWindow: Window; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the horizontal margin for the object. - */ - hspace: number; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Raised when the object has been completely received from the server. - */ - onload: (this: this, ev: Event) => any; - readonly sandbox: DOMSettableTokenList; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Sets or retrieves the width of the object. - */ - width: string; - addEventListener(type: "MSContentZoom", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (this: this, ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (this: this, ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (this: this, ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "invalid", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLIFrameElement: { - prototype: HTMLIFrameElement; - new(): HTMLIFrameElement; -} - -interface HTMLImageElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Retrieves whether the object is fully loaded. - */ - readonly complete: boolean; - crossOrigin: string; - readonly currentSrc: string; - /** - * Sets or retrieves the height of the object. - */ - height: number; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - /** - * Sets or retrieves whether the image is a server-side image map. - */ - isMap: boolean; - /** - * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. - */ - longDesc: string; - lowsrc: string; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - readonly msPlayToSource: any; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * The original height of the image resource before sizing. - */ - readonly naturalHeight: number; - /** - * The original width of the image resource before sizing. - */ - readonly naturalWidth: number; - sizes: string; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - srcset: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Sets or retrieves the width of the object. - */ - width: number; - readonly x: number; - readonly y: number; - msGetAsCastingSource(): any; -} - -declare var HTMLImageElement: { - prototype: HTMLImageElement; - new(): HTMLImageElement; - create(): HTMLImageElement; -} - -interface HTMLInputElement extends HTMLElement { - /** - * Sets or retrieves a comma-separated list of content types. - */ - accept: string; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Specifies whether autocomplete is applied to an editable text field. - */ - autocomplete: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - /** - * Sets or retrieves the state of the check box or radio button. - */ - checked: boolean; - /** - * Retrieves whether the object is fully loaded. - */ - readonly complete: boolean; - /** - * Sets or retrieves the state of the check box or radio button. - */ - defaultChecked: boolean; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - disabled: boolean; - /** - * Returns a FileList object on a file type input object. - */ - readonly files: FileList | null; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. - */ - formAction: string; - /** - * Used to override the encoding (formEnctype attribute) specified on the form element. - */ - formEnctype: string; - /** - * Overrides the submit method attribute previously specified on a form element. - */ - formMethod: string; - /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. - */ - formNoValidate: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - indeterminate: boolean; - /** - * Specifies the ID of a pre-defined datalist of options for an input element. - */ - readonly list: HTMLElement; - /** - * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. - */ - max: string; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. - */ - min: string; - /** - * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. - */ - multiple: boolean; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets or sets a string containing a regular expression that the user's input must match. - */ - pattern: string; - /** - * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. - */ - placeholder: string; - readOnly: boolean; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - selectionDirection: string; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - size: number; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - status: boolean; - /** - * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. - */ - step: string; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - /** - * Returns the value of the data at the cursor's current position. - */ - value: string; - valueAsDate: Date; - /** - * Returns the input field value as a number. - */ - valueAsNumber: number; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - webkitdirectory: boolean; - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - minLength: number; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Makes the selection equal to the current object. - */ - select(): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - /** - * Sets the start and end positions of a selection in a text field. - * @param start The offset into the text field for the start of the selection. - * @param end The offset into the text field for the end of the selection. - */ - setSelectionRange(start?: number, end?: number, direction?: string): void; - /** - * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. - * @param n Value to decrement the value by. - */ - stepDown(n?: number): void; - /** - * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. - * @param n Value to increment the value by. - */ - stepUp(n?: number): void; -} - -declare var HTMLInputElement: { - prototype: HTMLInputElement; - new(): HTMLInputElement; -} - -interface HTMLLIElement extends HTMLElement { - type: string; - /** - * Sets or retrieves the value of a list item. - */ - value: number; -} - -declare var HTMLLIElement: { - prototype: HTMLLIElement; - new(): HTMLLIElement; -} - -interface HTMLLabelElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the object to which the given label object is assigned. - */ - htmlFor: string; -} - -declare var HTMLLabelElement: { - prototype: HTMLLabelElement; - new(): HTMLLabelElement; -} - -interface HTMLLegendElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - align: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; -} - -declare var HTMLLegendElement: { - prototype: HTMLLegendElement; - new(): HTMLLegendElement; -} - -interface HTMLLinkElement extends HTMLElement, LinkStyle { - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - disabled: boolean; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; - /** - * Sets or retrieves the media type. - */ - media: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves the MIME type of the object. - */ - type: string; - import?: Document; - integrity: string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLLinkElement: { - prototype: HTMLLinkElement; - new(): HTMLLinkElement; -} - -interface HTMLMapElement extends HTMLElement { - /** - * Retrieves a collection of the area objects defined for the given map object. - */ - readonly areas: HTMLAreasCollection; - /** - * Sets or retrieves the name of the object. - */ - name: string; -} - -declare var HTMLMapElement: { - prototype: HTMLMapElement; - new(): HTMLMapElement; -} - -interface HTMLMarqueeElement extends HTMLElement { - behavior: string; - bgColor: any; - direction: string; - height: string; - hspace: number; - loop: number; - onbounce: (this: this, ev: Event) => any; - onfinish: (this: this, ev: Event) => any; - onstart: (this: this, ev: Event) => any; - scrollAmount: number; - scrollDelay: number; - trueSpeed: boolean; - vspace: number; - width: string; - start(): void; - stop(): void; - addEventListener(type: "MSContentZoom", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (this: this, ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (this: this, ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "bounce", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (this: this, ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "finish", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "invalid", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "start", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMarqueeElement: { - prototype: HTMLMarqueeElement; - new(): HTMLMarqueeElement; -} - -interface HTMLMediaElement extends HTMLElement { - /** - * Returns an AudioTrackList object with the audio tracks for a given video element. - */ - readonly audioTracks: AudioTrackList; - /** - * Gets or sets a value that indicates whether to start playing the media automatically. - */ - autoplay: boolean; - /** - * Gets a collection of buffered time ranges. - */ - readonly buffered: TimeRanges; - /** - * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). - */ - controls: boolean; - crossOrigin: string; - /** - * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. - */ - readonly currentSrc: string; - /** - * Gets or sets the current playback position, in seconds. - */ - currentTime: number; - defaultMuted: boolean; - /** - * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. - */ - defaultPlaybackRate: number; - /** - * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. - */ - readonly duration: number; - /** - * Gets information about whether the playback has ended or not. - */ - readonly ended: boolean; - /** - * Returns an object representing the current error state of the audio or video element. - */ - readonly error: MediaError; - /** - * Gets or sets a flag to specify whether playback should restart after it completes. - */ - loop: boolean; - readonly mediaKeys: MediaKeys | null; - /** - * Specifies the purpose of the audio or video media, such as background audio or alerts. - */ - msAudioCategory: string; - /** - * Specifies the output device id that the audio will be sent to. - */ - msAudioDeviceType: string; - readonly msGraphicsTrustStatus: MSGraphicsTrust; - /** - * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. - */ - readonly msKeys: MSMediaKeys; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - readonly msPlayToSource: any; - /** - * Specifies whether or not to enable low-latency playback on the media element. - */ - msRealTime: boolean; - /** - * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. - */ - muted: boolean; - /** - * Gets the current network activity for the element. - */ - readonly networkState: number; - onencrypted: (this: this, ev: MediaEncryptedEvent) => any; - onmsneedkey: (this: this, ev: MSMediaKeyNeededEvent) => any; - /** - * Gets a flag that specifies whether playback is paused. - */ - readonly paused: boolean; - /** - * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. - */ - playbackRate: number; - /** - * Gets TimeRanges for the current media resource that has been played. - */ - readonly played: TimeRanges; - /** - * Gets or sets the current playback position, in seconds. - */ - preload: string; - readyState: number; - /** - * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. - */ - readonly seekable: TimeRanges; - /** - * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. - */ - readonly seeking: boolean; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - srcObject: MediaStream | null; - readonly textTracks: TextTrackList; - readonly videoTracks: VideoTrackList; - /** - * Gets or sets the volume level for audio portions of the media element. - */ - volume: number; - addTextTrack(kind: string, label?: string, language?: string): TextTrack; - /** - * Returns a string that specifies whether the client can play a given media resource type. - */ - canPlayType(type: string): string; - /** - * Resets the audio or video object and loads a new media resource. - */ - load(): void; - /** - * Clears all effects from the media pipeline. - */ - msClearEffects(): void; - msGetAsCastingSource(): any; - /** - * Inserts the specified audio effect into media pipeline. - */ - msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetMediaKeys(mediaKeys: MSMediaKeys): void; - /** - * Specifies the media protection manager for a given media pipeline. - */ - msSetMediaProtectionManager(mediaProtectionManager?: any): void; - /** - * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. - */ - pause(): void; - /** - * Loads and starts playback of a media resource. - */ - play(): void; - setMediaKeys(mediaKeys: MediaKeys | null): PromiseLike; - readonly HAVE_CURRENT_DATA: number; - readonly HAVE_ENOUGH_DATA: number; - readonly HAVE_FUTURE_DATA: number; - readonly HAVE_METADATA: number; - readonly HAVE_NOTHING: number; - readonly NETWORK_EMPTY: number; - readonly NETWORK_IDLE: number; - readonly NETWORK_LOADING: number; - readonly NETWORK_NO_SOURCE: number; - addEventListener(type: "MSContentZoom", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (this: this, ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (this: this, ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (this: this, ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "encrypted", listener: (this: this, ev: MediaEncryptedEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "invalid", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "msneedkey", listener: (this: this, ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMediaElement: { - prototype: HTMLMediaElement; - new(): HTMLMediaElement; - readonly HAVE_CURRENT_DATA: number; - readonly HAVE_ENOUGH_DATA: number; - readonly HAVE_FUTURE_DATA: number; - readonly HAVE_METADATA: number; - readonly HAVE_NOTHING: number; - readonly NETWORK_EMPTY: number; - readonly NETWORK_IDLE: number; - readonly NETWORK_LOADING: number; - readonly NETWORK_NO_SOURCE: number; -} - -interface HTMLMenuElement extends HTMLElement { - compact: boolean; - type: string; -} - -declare var HTMLMenuElement: { - prototype: HTMLMenuElement; - new(): HTMLMenuElement; -} - -interface HTMLMetaElement extends HTMLElement { - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Gets or sets meta-information to associate with httpEquiv or name. - */ - content: string; - /** - * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. - */ - httpEquiv: string; - /** - * Sets or retrieves the value specified in the content attribute of the meta object. - */ - name: string; - /** - * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. - */ - scheme: string; - /** - * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. - */ - url: string; -} - -declare var HTMLMetaElement: { - prototype: HTMLMetaElement; - new(): HTMLMetaElement; -} - -interface HTMLMeterElement extends HTMLElement { - high: number; - low: number; - max: number; - min: number; - optimum: number; - value: number; -} - -declare var HTMLMeterElement: { - prototype: HTMLMeterElement; - new(): HTMLMeterElement; -} - -interface HTMLModElement extends HTMLElement { - /** - * Sets or retrieves reference information about the object. - */ - cite: string; - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; -} - -declare var HTMLModElement: { - prototype: HTMLModElement; - new(): HTMLModElement; -} - -interface HTMLOListElement extends HTMLElement { - compact: boolean; - /** - * The starting number. - */ - start: number; - type: string; -} - -declare var HTMLOListElement: { - prototype: HTMLOListElement; - new(): HTMLOListElement; -} - -interface HTMLObjectElement extends HTMLElement, GetSVGDocument { - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - readonly BaseHref: string; - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. - */ - altHtml: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - border: string; - /** - * Sets or retrieves the URL of the file containing the compiled Java class. - */ - code: string; - /** - * Sets or retrieves the URL of the component. - */ - codeBase: string; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - /** - * Retrieves the document object of the page or frame. - */ - readonly contentDocument: Document; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; - declare: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the height of the object. - */ - height: string; - hspace: number; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - readonly msPlayToSource: any; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Retrieves the contained object. - */ - readonly object: any; - readonly readyState: number; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Sets or retrieves the MIME type of the object. - */ - type: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - vspace: number; - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLObjectElement: { - prototype: HTMLObjectElement; - new(): HTMLObjectElement; -} - -interface HTMLOptGroupElement extends HTMLElement { - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the ordinal position of an option in a list box. - */ - readonly index: number; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; - /** - * Sets or retrieves the text string specified by the option tag. - */ - readonly text: string; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; -} - -declare var HTMLOptGroupElement: { - prototype: HTMLOptGroupElement; - new(): HTMLOptGroupElement; -} - -interface HTMLOptionElement extends HTMLElement { - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the ordinal position of an option in a list box. - */ - readonly index: number; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; - /** - * Sets or retrieves the text string specified by the option tag. - */ - text: string; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; -} - -declare var HTMLOptionElement: { - prototype: HTMLOptionElement; - new(): HTMLOptionElement; - create(): HTMLOptionElement; -} - -interface HTMLOptionsCollection extends HTMLCollectionOf { - length: number; - selectedIndex: number; - add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number): void; - remove(index: number): void; -} - -declare var HTMLOptionsCollection: { - prototype: HTMLOptionsCollection; - new(): HTMLOptionsCollection; -} - -interface HTMLParagraphElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - clear: string; -} - -declare var HTMLParagraphElement: { - prototype: HTMLParagraphElement; - new(): HTMLParagraphElement; -} - -interface HTMLParamElement extends HTMLElement { - /** - * Sets or retrieves the name of an input parameter for an element. - */ - name: string; - /** - * Sets or retrieves the content type of the resource designated by the value attribute. - */ - type: string; - /** - * Sets or retrieves the value of an input parameter for an element. - */ - value: string; - /** - * Sets or retrieves the data type of the value attribute. - */ - valueType: string; -} - -declare var HTMLParamElement: { - prototype: HTMLParamElement; - new(): HTMLParamElement; -} - -interface HTMLPictureElement extends HTMLElement { -} - -declare var HTMLPictureElement: { - prototype: HTMLPictureElement; - new(): HTMLPictureElement; -} - -interface HTMLPreElement extends HTMLElement { - /** - * Sets or gets a value that you can use to implement your own width functionality for the object. - */ - width: number; -} - -declare var HTMLPreElement: { - prototype: HTMLPreElement; - new(): HTMLPreElement; -} - -interface HTMLProgressElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Defines the maximum, or "done" value for a progress element. - */ - max: number; - /** - * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). - */ - readonly position: number; - /** - * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. - */ - value: number; -} - -declare var HTMLProgressElement: { - prototype: HTMLProgressElement; - new(): HTMLProgressElement; -} - -interface HTMLQuoteElement extends HTMLElement { - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} - -declare var HTMLQuoteElement: { - prototype: HTMLQuoteElement; - new(): HTMLQuoteElement; -} - -interface HTMLScriptElement extends HTMLElement { - async: boolean; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the status of the script. - */ - defer: boolean; - /** - * Sets or retrieves the event for which the script is written. - */ - event: string; - /** - * Sets or retrieves the object that is bound to the event script. - */ - htmlFor: string; - /** - * Retrieves the URL to an external file that contains the source code or data. - */ - src: string; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - /** - * Sets or retrieves the MIME type for the associated scripting engine. - */ - type: string; - integrity: string; -} - -declare var HTMLScriptElement: { - prototype: HTMLScriptElement; - new(): HTMLScriptElement; -} - -interface HTMLSelectElement extends HTMLElement { - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. - */ - multiple: boolean; - /** - * Sets or retrieves the name of the object. - */ - name: string; - readonly options: HTMLOptionsCollection; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Sets or retrieves the index of the selected option in a select object. - */ - selectedIndex: number; - selectedOptions: HTMLCollectionOf; - /** - * Sets or retrieves the number of rows in the list box. - */ - size: number; - /** - * Retrieves the type of select control based on the value of the MULTIPLE attribute. - */ - readonly type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - /** - * Adds an element to the areas, controlRange, or options collection. - * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. - * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection. - */ - add(element: HTMLElement, before?: HTMLElement | number): void; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Retrieves a select object or an object from an options collection. - * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. - * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. - */ - item(name?: any, index?: any): any; - /** - * Retrieves a select object or an object from an options collection. - * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made. - */ - namedItem(name: string): any; - /** - * Removes an element from the collection. - * @param index Number that specifies the zero-based index of the element to remove from the collection. - */ - remove(index?: number): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - [name: string]: any; -} - -declare var HTMLSelectElement: { - prototype: HTMLSelectElement; - new(): HTMLSelectElement; -} - -interface HTMLSourceElement extends HTMLElement { - /** - * Gets or sets the intended media type of the media source. - */ - media: string; - msKeySystem: string; - sizes: string; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - srcset: string; - /** - * Gets or sets the MIME type of a media resource. - */ - type: string; -} - -declare var HTMLSourceElement: { - prototype: HTMLSourceElement; - new(): HTMLSourceElement; -} - -interface HTMLSpanElement extends HTMLElement { -} - -declare var HTMLSpanElement: { - prototype: HTMLSpanElement; - new(): HTMLSpanElement; -} - -interface HTMLStyleElement extends HTMLElement, LinkStyle { - disabled: boolean; - /** - * Sets or retrieves the media type. - */ - media: string; - /** - * Retrieves the CSS language in which the style sheet is written. - */ - type: string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLStyleElement: { - prototype: HTMLStyleElement; - new(): HTMLStyleElement; -} - -interface HTMLTableCaptionElement extends HTMLElement { - /** - * Sets or retrieves the alignment of the caption or legend. - */ - align: string; - /** - * Sets or retrieves whether the caption appears at the top or bottom of the table. - */ - vAlign: string; -} - -declare var HTMLTableCaptionElement: { - prototype: HTMLTableCaptionElement; - new(): HTMLTableCaptionElement; -} - -interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves abbreviated text for the object. - */ - abbr: string; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. - */ - axis: string; - bgColor: any; - /** - * Retrieves the position of the object in the cells collection of a row. - */ - readonly cellIndex: number; - /** - * Sets or retrieves the number columns in the table that the object should span. - */ - colSpan: number; - /** - * Sets or retrieves a list of header cells that provide information for the object. - */ - headers: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; - /** - * Sets or retrieves how many rows in a table the cell should span. - */ - rowSpan: number; - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; - /** - * Sets or retrieves the width of the object. - */ - width: string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableCellElement: { - prototype: HTMLTableCellElement; - new(): HTMLTableCellElement; -} - -interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves the alignment of the object relative to the display or table. - */ - align: string; - /** - * Sets or retrieves the number of columns in the group. - */ - span: number; - /** - * Sets or retrieves the width of the object. - */ - width: any; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableColElement: { - prototype: HTMLTableColElement; - new(): HTMLTableColElement; -} - -interface HTMLTableDataCellElement extends HTMLTableCellElement { -} - -declare var HTMLTableDataCellElement: { - prototype: HTMLTableDataCellElement; - new(): HTMLTableDataCellElement; -} - -interface HTMLTableElement extends HTMLElement { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - bgColor: any; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Retrieves the caption object of a table. - */ - caption: HTMLTableCaptionElement; - /** - * Sets or retrieves the amount of space between the border of the cell and the content of the cell. - */ - cellPadding: string; - /** - * Sets or retrieves the amount of space between cells in a table. - */ - cellSpacing: string; - /** - * Sets or retrieves the number of columns in the table. - */ - cols: number; - /** - * Sets or retrieves the way the border frame around the table is displayed. - */ - frame: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: HTMLCollectionOf; - /** - * Sets or retrieves which dividing lines (inner borders) are displayed. - */ - rules: string; - /** - * Sets or retrieves a description and/or structure of the object. - */ - summary: string; - /** - * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. - */ - tBodies: HTMLCollectionOf; - /** - * Retrieves the tFoot object of the table. - */ - tFoot: HTMLTableSectionElement; - /** - * Retrieves the tHead object of the table. - */ - tHead: HTMLTableSectionElement; - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Creates an empty caption element in the table. - */ - createCaption(): HTMLTableCaptionElement; - /** - * Creates an empty tBody element in the table. - */ - createTBody(): HTMLTableSectionElement; - /** - * Creates an empty tFoot element in the table. - */ - createTFoot(): HTMLTableSectionElement; - /** - * Returns the tHead element object if successful, or null otherwise. - */ - createTHead(): HTMLTableSectionElement; - /** - * Deletes the caption element and its contents from the table. - */ - deleteCaption(): void; - /** - * Removes the specified row (tr) from the element and from the rows collection. - * @param index Number that specifies the zero-based position in the rows collection of the row to remove. - */ - deleteRow(index?: number): void; - /** - * Deletes the tFoot element and its contents from the table. - */ - deleteTFoot(): void; - /** - * Deletes the tHead element and its contents from the table. - */ - deleteTHead(): void; - /** - * Creates a new row (tr) in the table, and adds the row to the rows collection. - * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. - */ - insertRow(index?: number): HTMLTableRowElement; -} - -declare var HTMLTableElement: { - prototype: HTMLTableElement; - new(): HTMLTableElement; -} - -interface HTMLTableHeaderCellElement extends HTMLTableCellElement { - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; -} - -declare var HTMLTableHeaderCellElement: { - prototype: HTMLTableHeaderCellElement; - new(): HTMLTableHeaderCellElement; -} - -interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - bgColor: any; - /** - * Retrieves a collection of all cells in the table row. - */ - cells: HTMLCollectionOf; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Retrieves the position of the object in the rows collection for the table. - */ - readonly rowIndex: number; - /** - * Retrieves the position of the object in the collection. - */ - readonly sectionRowIndex: number; - /** - * Removes the specified cell from the table row, as well as from the cells collection. - * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted. - */ - deleteCell(index?: number): void; - /** - * Creates a new cell in the table row, and adds the cell to the cells collection. - * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. - */ - insertCell(index?: number): HTMLTableDataCellElement; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableRowElement: { - prototype: HTMLTableRowElement; - new(): HTMLTableRowElement; -} - -interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: HTMLCollectionOf; - /** - * Removes the specified row (tr) from the element and from the rows collection. - * @param index Number that specifies the zero-based position in the rows collection of the row to remove. - */ - deleteRow(index?: number): void; - /** - * Creates a new row (tr) in the table, and adds the row to the rows collection. - * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. - */ - insertRow(index?: number): HTMLTableRowElement; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableSectionElement: { - prototype: HTMLTableSectionElement; - new(): HTMLTableSectionElement; -} - -interface HTMLTemplateElement extends HTMLElement { - readonly content: DocumentFragment; -} - -declare var HTMLTemplateElement: { - prototype: HTMLTemplateElement; - new(): HTMLTemplateElement; -} - -interface HTMLTextAreaElement extends HTMLElement { - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Sets or retrieves the width of the object. - */ - cols: number; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. - */ - placeholder: string; - /** - * Sets or retrieves the value indicated whether the content of the object is read-only. - */ - readOnly: boolean; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: number; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - /** - * Sets or retrieves the value indicating whether the control is selected. - */ - status: any; - /** - * Retrieves the type of control. - */ - readonly type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - /** - * Retrieves or sets the text in the entry field of the textArea element. - */ - value: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - /** - * Sets or retrieves how to handle wordwrapping in the object. - */ - wrap: string; - minLength: number; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Highlights the input area of a form element. - */ - select(): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - /** - * Sets the start and end positions of a selection in a text field. - * @param start The offset into the text field for the start of the selection. - * @param end The offset into the text field for the end of the selection. - */ - setSelectionRange(start: number, end: number): void; -} - -declare var HTMLTextAreaElement: { - prototype: HTMLTextAreaElement; - new(): HTMLTextAreaElement; -} - -interface HTMLTitleElement extends HTMLElement { - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; -} - -declare var HTMLTitleElement: { - prototype: HTMLTitleElement; - new(): HTMLTitleElement; -} - -interface HTMLTrackElement extends HTMLElement { - default: boolean; - kind: string; - label: string; - readonly readyState: number; - src: string; - srclang: string; - readonly track: TextTrack; - readonly ERROR: number; - readonly LOADED: number; - readonly LOADING: number; - readonly NONE: number; -} - -declare var HTMLTrackElement: { - prototype: HTMLTrackElement; - new(): HTMLTrackElement; - readonly ERROR: number; - readonly LOADED: number; - readonly LOADING: number; - readonly NONE: number; -} - -interface HTMLUListElement extends HTMLElement { - compact: boolean; - type: string; -} - -declare var HTMLUListElement: { - prototype: HTMLUListElement; - new(): HTMLUListElement; -} - -interface HTMLUnknownElement extends HTMLElement { -} - -declare var HTMLUnknownElement: { - prototype: HTMLUnknownElement; - new(): HTMLUnknownElement; -} - -interface HTMLVideoElement extends HTMLMediaElement { - /** - * Gets or sets the height of the video element. - */ - height: number; - msHorizontalMirror: boolean; - readonly msIsLayoutOptimalForPlayback: boolean; - readonly msIsStereo3D: boolean; - msStereo3DPackingMode: string; - msStereo3DRenderMode: string; - msZoom: boolean; - onMSVideoFormatChanged: (this: this, ev: Event) => any; - onMSVideoFrameStepCompleted: (this: this, ev: Event) => any; - onMSVideoOptimalLayoutChanged: (this: this, ev: Event) => any; - /** - * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. - */ - poster: string; - /** - * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. - */ - readonly videoHeight: number; - /** - * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. - */ - readonly videoWidth: number; - readonly webkitDisplayingFullscreen: boolean; - readonly webkitSupportsFullscreen: boolean; - /** - * Gets or sets the width of the video element. - */ - width: number; - getVideoPlaybackQuality(): VideoPlaybackQuality; - msFrameStep(forward: boolean): void; - msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; - webkitEnterFullScreen(): void; - webkitEnterFullscreen(): void; - webkitExitFullScreen(): void; - webkitExitFullscreen(): void; - addEventListener(type: "MSContentZoom", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (this: this, ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoFormatChanged", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoFrameStepCompleted", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoOptimalLayoutChanged", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (this: this, ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (this: this, ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "encrypted", listener: (this: this, ev: MediaEncryptedEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "invalid", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "msneedkey", listener: (this: this, ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLVideoElement: { - prototype: HTMLVideoElement; - new(): HTMLVideoElement; -} - -interface HashChangeEvent extends Event { - readonly newURL: string | null; - readonly oldURL: string | null; -} - -declare var HashChangeEvent: { - prototype: HashChangeEvent; - new(type: string, eventInitDict?: HashChangeEventInit): HashChangeEvent; -} - -interface History { - readonly length: number; - readonly state: any; - back(distance?: any): void; - forward(distance?: any): void; - go(delta?: any): void; - pushState(statedata: any, title?: string, url?: string): void; - replaceState(statedata: any, title?: string, url?: string): void; -} - -declare var History: { - prototype: History; - new(): History; -} - -interface IDBCursor { - readonly direction: string; - key: IDBKeyRange | IDBValidKey; - readonly primaryKey: any; - source: IDBObjectStore | IDBIndex; - advance(count: number): void; - continue(key?: IDBKeyRange | IDBValidKey): void; - delete(): IDBRequest; - update(value: any): IDBRequest; - readonly NEXT: string; - readonly NEXT_NO_DUPLICATE: string; - readonly PREV: string; - readonly PREV_NO_DUPLICATE: string; -} - -declare var IDBCursor: { - prototype: IDBCursor; - new(): IDBCursor; - readonly NEXT: string; - readonly NEXT_NO_DUPLICATE: string; - readonly PREV: string; - readonly PREV_NO_DUPLICATE: string; -} - -interface IDBCursorWithValue extends IDBCursor { - readonly value: any; -} - -declare var IDBCursorWithValue: { - prototype: IDBCursorWithValue; - new(): IDBCursorWithValue; -} - -interface IDBDatabase extends EventTarget { - readonly name: string; - readonly objectStoreNames: DOMStringList; - onabort: (this: this, ev: Event) => any; - onerror: (this: this, ev: ErrorEvent) => any; - version: number; - onversionchange: (ev: IDBVersionChangeEvent) => any; - close(): void; - createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore; - deleteObjectStore(name: string): void; - transaction(storeNames: string | string[], mode?: string): IDBTransaction; - addEventListener(type: "versionchange", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBDatabase: { - prototype: IDBDatabase; - new(): IDBDatabase; -} - -interface IDBFactory { - cmp(first: any, second: any): number; - deleteDatabase(name: string): IDBOpenDBRequest; - open(name: string, version?: number): IDBOpenDBRequest; -} - -declare var IDBFactory: { - prototype: IDBFactory; - new(): IDBFactory; -} - -interface IDBIndex { - keyPath: string | string[]; - readonly name: string; - readonly objectStore: IDBObjectStore; - readonly unique: boolean; - multiEntry: boolean; - count(key?: IDBKeyRange | IDBValidKey): IDBRequest; - get(key: IDBKeyRange | IDBValidKey): IDBRequest; - getKey(key: IDBKeyRange | IDBValidKey): IDBRequest; - openCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; - openKeyCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; -} - -declare var IDBIndex: { - prototype: IDBIndex; - new(): IDBIndex; -} - -interface IDBKeyRange { - readonly lower: any; - readonly lowerOpen: boolean; - readonly upper: any; - readonly upperOpen: boolean; -} - -declare var IDBKeyRange: { - prototype: IDBKeyRange; - new(): IDBKeyRange; - bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; - lowerBound(lower: any, open?: boolean): IDBKeyRange; - only(value: any): IDBKeyRange; - upperBound(upper: any, open?: boolean): IDBKeyRange; -} - -interface IDBObjectStore { - readonly indexNames: DOMStringList; - keyPath: string | string[]; - readonly name: string; - readonly transaction: IDBTransaction; - autoIncrement: boolean; - add(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest; - clear(): IDBRequest; - count(key?: IDBKeyRange | IDBValidKey): IDBRequest; - createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex; - delete(key: IDBKeyRange | IDBValidKey): IDBRequest; - deleteIndex(indexName: string): void; - get(key: any): IDBRequest; - index(name: string): IDBIndex; - openCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; - put(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest; -} - -declare var IDBObjectStore: { - prototype: IDBObjectStore; - new(): IDBObjectStore; -} - -interface IDBOpenDBRequest extends IDBRequest { - onblocked: (this: this, ev: Event) => any; - onupgradeneeded: (this: this, ev: IDBVersionChangeEvent) => any; - addEventListener(type: "blocked", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "success", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "upgradeneeded", listener: (this: this, ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBOpenDBRequest: { - prototype: IDBOpenDBRequest; - new(): IDBOpenDBRequest; -} - -interface IDBRequest extends EventTarget { - readonly error: DOMError; - onerror: (this: this, ev: ErrorEvent) => any; - onsuccess: (this: this, ev: Event) => any; - readonly readyState: string; - readonly result: any; - source: IDBObjectStore | IDBIndex | IDBCursor; - readonly transaction: IDBTransaction; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "success", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBRequest: { - prototype: IDBRequest; - new(): IDBRequest; -} - -interface IDBTransaction extends EventTarget { - readonly db: IDBDatabase; - readonly error: DOMError; - readonly mode: string; - onabort: (this: this, ev: Event) => any; - oncomplete: (this: this, ev: Event) => any; - onerror: (this: this, ev: ErrorEvent) => any; - abort(): void; - objectStore(name: string): IDBObjectStore; - readonly READ_ONLY: string; - readonly READ_WRITE: string; - readonly VERSION_CHANGE: string; - addEventListener(type: "abort", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "complete", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBTransaction: { - prototype: IDBTransaction; - new(): IDBTransaction; - readonly READ_ONLY: string; - readonly READ_WRITE: string; - readonly VERSION_CHANGE: string; -} - -interface IDBVersionChangeEvent extends Event { - readonly newVersion: number | null; - readonly oldVersion: number; -} - -declare var IDBVersionChangeEvent: { - prototype: IDBVersionChangeEvent; - new(): IDBVersionChangeEvent; -} - -interface ImageData { - data: Uint8ClampedArray; - readonly height: number; - readonly width: number; -} - -declare var ImageData: { - prototype: ImageData; - new(width: number, height: number): ImageData; - new(array: Uint8ClampedArray, width: number, height: number): ImageData; -} - -interface KeyboardEvent extends UIEvent { - readonly altKey: boolean; - readonly char: string | null; - readonly charCode: number; - readonly ctrlKey: boolean; - readonly key: string; - readonly keyCode: number; - readonly locale: string; - readonly location: number; - readonly metaKey: boolean; - readonly repeat: boolean; - readonly shiftKey: boolean; - readonly which: number; - readonly code: string; - getModifierState(keyArg: string): boolean; - initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; - readonly DOM_KEY_LOCATION_JOYSTICK: number; - readonly DOM_KEY_LOCATION_LEFT: number; - readonly DOM_KEY_LOCATION_MOBILE: number; - readonly DOM_KEY_LOCATION_NUMPAD: number; - readonly DOM_KEY_LOCATION_RIGHT: number; - readonly DOM_KEY_LOCATION_STANDARD: number; -} - -declare var KeyboardEvent: { - prototype: KeyboardEvent; - new(typeArg: string, eventInitDict?: KeyboardEventInit): KeyboardEvent; - readonly DOM_KEY_LOCATION_JOYSTICK: number; - readonly DOM_KEY_LOCATION_LEFT: number; - readonly DOM_KEY_LOCATION_MOBILE: number; - readonly DOM_KEY_LOCATION_NUMPAD: number; - readonly DOM_KEY_LOCATION_RIGHT: number; - readonly DOM_KEY_LOCATION_STANDARD: number; -} - -interface ListeningStateChangedEvent extends Event { - readonly label: string; - readonly state: string; -} - -declare var ListeningStateChangedEvent: { - prototype: ListeningStateChangedEvent; - new(): ListeningStateChangedEvent; -} - -interface Location { - hash: string; - host: string; - hostname: string; - href: string; - readonly origin: string; - pathname: string; - port: string; - protocol: string; - search: string; - assign(url: string): void; - reload(forcedReload?: boolean): void; - replace(url: string): void; - toString(): string; -} - -declare var Location: { - prototype: Location; - new(): Location; -} - -interface LongRunningScriptDetectedEvent extends Event { - readonly executionTime: number; - stopPageScriptExecution: boolean; -} - -declare var LongRunningScriptDetectedEvent: { - prototype: LongRunningScriptDetectedEvent; - new(): LongRunningScriptDetectedEvent; -} - -interface MSApp { - clearTemporaryWebDataAsync(): MSAppAsyncOperation; - createBlobFromRandomAccessStream(type: string, seeker: any): Blob; - createDataPackage(object: any): any; - createDataPackageFromSelection(): any; - createFileFromStorageFile(storageFile: any): File; - createStreamFromInputStream(type: string, inputStream: any): MSStream; - execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; - execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; - getCurrentPriority(): string; - getHtmlPrintDocumentSourceAsync(htmlDoc: any): PromiseLike; - getViewId(view: any): any; - isTaskScheduledAtPriorityOrHigher(priority: string): boolean; - pageHandlesAllApplicationActivations(enabled: boolean): void; - suppressSubdownloadCredentialPrompts(suppress: boolean): void; - terminateApp(exceptionObject: any): void; - readonly CURRENT: string; - readonly HIGH: string; - readonly IDLE: string; - readonly NORMAL: string; -} -declare var MSApp: MSApp; - -interface MSAppAsyncOperation extends EventTarget { - readonly error: DOMError; - oncomplete: (this: this, ev: Event) => any; - onerror: (this: this, ev: ErrorEvent) => any; - readonly readyState: number; - readonly result: any; - start(): void; - readonly COMPLETED: number; - readonly ERROR: number; - readonly STARTED: number; - addEventListener(type: "complete", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSAppAsyncOperation: { - prototype: MSAppAsyncOperation; - new(): MSAppAsyncOperation; - readonly COMPLETED: number; - readonly ERROR: number; - readonly STARTED: number; -} - -interface MSAssertion { - readonly id: string; - readonly type: string; -} - -declare var MSAssertion: { - prototype: MSAssertion; - new(): MSAssertion; -} - -interface MSBlobBuilder { - append(data: any, endings?: string): void; - getBlob(contentType?: string): Blob; -} - -declare var MSBlobBuilder: { - prototype: MSBlobBuilder; - new(): MSBlobBuilder; -} - -interface MSCredentials { - getAssertion(challenge: string, filter?: MSCredentialFilter, params?: MSSignatureParameters): PromiseLike; - makeCredential(accountInfo: MSAccountInfo, params: MSCredentialParameters[], challenge?: string): PromiseLike; -} - -declare var MSCredentials: { - prototype: MSCredentials; - new(): MSCredentials; -} - -interface MSFIDOCredentialAssertion extends MSAssertion { - readonly algorithm: string | Algorithm; - readonly attestation: any; - readonly publicKey: string; - readonly transportHints: string[]; -} - -declare var MSFIDOCredentialAssertion: { - prototype: MSFIDOCredentialAssertion; - new(): MSFIDOCredentialAssertion; -} - -interface MSFIDOSignature { - readonly authnrData: string; - readonly clientData: string; - readonly signature: string; -} - -declare var MSFIDOSignature: { - prototype: MSFIDOSignature; - new(): MSFIDOSignature; -} - -interface MSFIDOSignatureAssertion extends MSAssertion { - readonly signature: MSFIDOSignature; -} - -declare var MSFIDOSignatureAssertion: { - prototype: MSFIDOSignatureAssertion; - new(): MSFIDOSignatureAssertion; -} - -interface MSGesture { - target: Element; - addPointer(pointerId: number): void; - stop(): void; -} - -declare var MSGesture: { - prototype: MSGesture; - new(): MSGesture; -} - -interface MSGestureEvent extends UIEvent { - readonly clientX: number; - readonly clientY: number; - readonly expansion: number; - readonly gestureObject: any; - readonly hwTimestamp: number; - readonly offsetX: number; - readonly offsetY: number; - readonly rotation: number; - readonly scale: number; - readonly screenX: number; - readonly screenY: number; - readonly translationX: number; - readonly translationY: number; - readonly velocityAngular: number; - readonly velocityExpansion: number; - readonly velocityX: number; - readonly velocityY: number; - initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; - readonly MSGESTURE_FLAG_BEGIN: number; - readonly MSGESTURE_FLAG_CANCEL: number; - readonly MSGESTURE_FLAG_END: number; - readonly MSGESTURE_FLAG_INERTIA: number; - readonly MSGESTURE_FLAG_NONE: number; -} - -declare var MSGestureEvent: { - prototype: MSGestureEvent; - new(): MSGestureEvent; - readonly MSGESTURE_FLAG_BEGIN: number; - readonly MSGESTURE_FLAG_CANCEL: number; - readonly MSGESTURE_FLAG_END: number; - readonly MSGESTURE_FLAG_INERTIA: number; - readonly MSGESTURE_FLAG_NONE: number; -} - -interface MSGraphicsTrust { - readonly constrictionActive: boolean; - readonly status: string; -} - -declare var MSGraphicsTrust: { - prototype: MSGraphicsTrust; - new(): MSGraphicsTrust; -} - -interface MSHTMLWebViewElement extends HTMLElement { - readonly canGoBack: boolean; - readonly canGoForward: boolean; - readonly containsFullScreenElement: boolean; - readonly documentTitle: string; - height: number; - readonly settings: MSWebViewSettings; - src: string; - width: number; - addWebAllowedObject(name: string, applicationObject: any): void; - buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; - capturePreviewToBlobAsync(): MSWebViewAsyncOperation; - captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; - getDeferredPermissionRequestById(id: number): DeferredPermissionRequest; - getDeferredPermissionRequests(): DeferredPermissionRequest[]; - goBack(): void; - goForward(): void; - invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; - navigate(uri: string): void; - navigateToLocalStreamUri(source: string, streamResolver: any): void; - navigateToString(contents: string): void; - navigateWithHttpRequestMessage(requestMessage: any): void; - refresh(): void; - stop(): void; -} - -declare var MSHTMLWebViewElement: { - prototype: MSHTMLWebViewElement; - new(): MSHTMLWebViewElement; -} - -interface MSInputMethodContext extends EventTarget { - readonly compositionEndOffset: number; - readonly compositionStartOffset: number; - oncandidatewindowhide: (this: this, ev: Event) => any; - oncandidatewindowshow: (this: this, ev: Event) => any; - oncandidatewindowupdate: (this: this, ev: Event) => any; - readonly target: HTMLElement; - getCandidateWindowClientRect(): ClientRect; - getCompositionAlternatives(): string[]; - hasComposition(): boolean; - isCandidateWindowVisible(): boolean; - addEventListener(type: "MSCandidateWindowHide", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "MSCandidateWindowShow", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "MSCandidateWindowUpdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSInputMethodContext: { - prototype: MSInputMethodContext; - new(): MSInputMethodContext; -} - -interface MSManipulationEvent extends UIEvent { - readonly currentState: number; - readonly inertiaDestinationX: number; - readonly inertiaDestinationY: number; - readonly lastState: number; - initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; - readonly MS_MANIPULATION_STATE_ACTIVE: number; - readonly MS_MANIPULATION_STATE_CANCELLED: number; - readonly MS_MANIPULATION_STATE_COMMITTED: number; - readonly MS_MANIPULATION_STATE_DRAGGING: number; - readonly MS_MANIPULATION_STATE_INERTIA: number; - readonly MS_MANIPULATION_STATE_PRESELECT: number; - readonly MS_MANIPULATION_STATE_SELECTING: number; - readonly MS_MANIPULATION_STATE_STOPPED: number; -} - -declare var MSManipulationEvent: { - prototype: MSManipulationEvent; - new(): MSManipulationEvent; - readonly MS_MANIPULATION_STATE_ACTIVE: number; - readonly MS_MANIPULATION_STATE_CANCELLED: number; - readonly MS_MANIPULATION_STATE_COMMITTED: number; - readonly MS_MANIPULATION_STATE_DRAGGING: number; - readonly MS_MANIPULATION_STATE_INERTIA: number; - readonly MS_MANIPULATION_STATE_PRESELECT: number; - readonly MS_MANIPULATION_STATE_SELECTING: number; - readonly MS_MANIPULATION_STATE_STOPPED: number; -} - -interface MSMediaKeyError { - readonly code: number; - readonly systemCode: number; - readonly MS_MEDIA_KEYERR_CLIENT: number; - readonly MS_MEDIA_KEYERR_DOMAIN: number; - readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number; - readonly MS_MEDIA_KEYERR_OUTPUT: number; - readonly MS_MEDIA_KEYERR_SERVICE: number; - readonly MS_MEDIA_KEYERR_UNKNOWN: number; -} - -declare var MSMediaKeyError: { - prototype: MSMediaKeyError; - new(): MSMediaKeyError; - readonly MS_MEDIA_KEYERR_CLIENT: number; - readonly MS_MEDIA_KEYERR_DOMAIN: number; - readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number; - readonly MS_MEDIA_KEYERR_OUTPUT: number; - readonly MS_MEDIA_KEYERR_SERVICE: number; - readonly MS_MEDIA_KEYERR_UNKNOWN: number; -} - -interface MSMediaKeyMessageEvent extends Event { - readonly destinationURL: string | null; - readonly message: Uint8Array; -} - -declare var MSMediaKeyMessageEvent: { - prototype: MSMediaKeyMessageEvent; - new(): MSMediaKeyMessageEvent; -} - -interface MSMediaKeyNeededEvent extends Event { - readonly initData: Uint8Array | null; -} - -declare var MSMediaKeyNeededEvent: { - prototype: MSMediaKeyNeededEvent; - new(): MSMediaKeyNeededEvent; -} - -interface MSMediaKeySession extends EventTarget { - readonly error: MSMediaKeyError | null; - readonly keySystem: string; - readonly sessionId: string; - close(): void; - update(key: Uint8Array): void; -} - -declare var MSMediaKeySession: { - prototype: MSMediaKeySession; - new(): MSMediaKeySession; -} - -interface MSMediaKeys { - readonly keySystem: string; - createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; -} - -declare var MSMediaKeys: { - prototype: MSMediaKeys; - new(keySystem: string): MSMediaKeys; - isTypeSupported(keySystem: string, type?: string): boolean; - isTypeSupportedWithFeatures(keySystem: string, type?: string): string; -} - -interface MSPointerEvent extends MouseEvent { - readonly currentPoint: any; - readonly height: number; - readonly hwTimestamp: number; - readonly intermediatePoints: any; - readonly isPrimary: boolean; - readonly pointerId: number; - readonly pointerType: any; - readonly pressure: number; - readonly rotation: number; - readonly tiltX: number; - readonly tiltY: number; - readonly width: number; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; -} - -declare var MSPointerEvent: { - prototype: MSPointerEvent; - new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent; -} - -interface MSRangeCollection { - readonly length: number; - item(index: number): Range; - [index: number]: Range; -} - -declare var MSRangeCollection: { - prototype: MSRangeCollection; - new(): MSRangeCollection; -} - -interface MSSiteModeEvent extends Event { - readonly actionURL: string; - readonly buttonID: number; -} - -declare var MSSiteModeEvent: { - prototype: MSSiteModeEvent; - new(): MSSiteModeEvent; -} - -interface MSStream { - readonly type: string; - msClose(): void; - msDetachStream(): any; -} - -declare var MSStream: { - prototype: MSStream; - new(): MSStream; -} - -interface MSStreamReader extends EventTarget, MSBaseReader { - readonly error: DOMError; - readAsArrayBuffer(stream: MSStream, size?: number): void; - readAsBinaryString(stream: MSStream, size?: number): void; - readAsBlob(stream: MSStream, size?: number): void; - readAsDataURL(stream: MSStream, size?: number): void; - readAsText(stream: MSStream, encoding?: string, size?: number): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSStreamReader: { - prototype: MSStreamReader; - new(): MSStreamReader; -} - -interface MSWebViewAsyncOperation extends EventTarget { - readonly error: DOMError; - oncomplete: (this: this, ev: Event) => any; - onerror: (this: this, ev: ErrorEvent) => any; - readonly readyState: number; - readonly result: any; - readonly target: MSHTMLWebViewElement; - readonly type: number; - start(): void; - readonly COMPLETED: number; - readonly ERROR: number; - readonly STARTED: number; - readonly TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - readonly TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - readonly TYPE_INVOKE_SCRIPT: number; - addEventListener(type: "complete", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSWebViewAsyncOperation: { - prototype: MSWebViewAsyncOperation; - new(): MSWebViewAsyncOperation; - readonly COMPLETED: number; - readonly ERROR: number; - readonly STARTED: number; - readonly TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - readonly TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - readonly TYPE_INVOKE_SCRIPT: number; -} - -interface MSWebViewSettings { - isIndexedDBEnabled: boolean; - isJavaScriptEnabled: boolean; -} - -declare var MSWebViewSettings: { - prototype: MSWebViewSettings; - new(): MSWebViewSettings; -} - -interface MediaDeviceInfo { - readonly deviceId: string; - readonly groupId: string; - readonly kind: string; - readonly label: string; -} - -declare var MediaDeviceInfo: { - prototype: MediaDeviceInfo; - new(): MediaDeviceInfo; -} - -interface MediaDevices extends EventTarget { - ondevicechange: (this: this, ev: Event) => any; - enumerateDevices(): any; - getSupportedConstraints(): MediaTrackSupportedConstraints; - getUserMedia(constraints: MediaStreamConstraints): PromiseLike; - addEventListener(type: "devicechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MediaDevices: { - prototype: MediaDevices; - new(): MediaDevices; -} - -interface MediaElementAudioSourceNode extends AudioNode { -} - -declare var MediaElementAudioSourceNode: { - prototype: MediaElementAudioSourceNode; - new(): MediaElementAudioSourceNode; -} - -interface MediaEncryptedEvent extends Event { - readonly initData: ArrayBuffer | null; - readonly initDataType: string; -} - -declare var MediaEncryptedEvent: { - prototype: MediaEncryptedEvent; - new(type: string, eventInitDict?: MediaEncryptedEventInit): MediaEncryptedEvent; -} - -interface MediaError { - readonly code: number; - readonly msExtendedCode: number; - readonly MEDIA_ERR_ABORTED: number; - readonly MEDIA_ERR_DECODE: number; - readonly MEDIA_ERR_NETWORK: number; - readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number; - readonly MS_MEDIA_ERR_ENCRYPTED: number; -} - -declare var MediaError: { - prototype: MediaError; - new(): MediaError; - readonly MEDIA_ERR_ABORTED: number; - readonly MEDIA_ERR_DECODE: number; - readonly MEDIA_ERR_NETWORK: number; - readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number; - readonly MS_MEDIA_ERR_ENCRYPTED: number; -} - -interface MediaKeyMessageEvent extends Event { - readonly message: ArrayBuffer; - readonly messageType: string; -} - -declare var MediaKeyMessageEvent: { - prototype: MediaKeyMessageEvent; - new(type: string, eventInitDict?: MediaKeyMessageEventInit): MediaKeyMessageEvent; -} - -interface MediaKeySession extends EventTarget { - readonly closed: PromiseLike; - readonly expiration: number; - readonly keyStatuses: MediaKeyStatusMap; - readonly sessionId: string; - close(): PromiseLike; - generateRequest(initDataType: string, initData: any): PromiseLike; - load(sessionId: string): PromiseLike; - remove(): PromiseLike; - update(response: any): PromiseLike; -} - -declare var MediaKeySession: { - prototype: MediaKeySession; - new(): MediaKeySession; -} - -interface MediaKeyStatusMap { - readonly size: number; - forEach(callback: ForEachCallback): void; - get(keyId: any): string; - has(keyId: any): boolean; -} - -declare var MediaKeyStatusMap: { - prototype: MediaKeyStatusMap; - new(): MediaKeyStatusMap; -} - -interface MediaKeySystemAccess { - readonly keySystem: string; - createMediaKeys(): PromiseLike; - getConfiguration(): MediaKeySystemConfiguration; -} - -declare var MediaKeySystemAccess: { - prototype: MediaKeySystemAccess; - new(): MediaKeySystemAccess; -} - -interface MediaKeys { - createSession(sessionType?: string): MediaKeySession; - setServerCertificate(serverCertificate: any): PromiseLike; -} - -declare var MediaKeys: { - prototype: MediaKeys; - new(): MediaKeys; -} - -interface MediaList { - readonly length: number; - mediaText: string; - appendMedium(newMedium: string): void; - deleteMedium(oldMedium: string): void; - item(index: number): string; - toString(): string; - [index: number]: string; -} - -declare var MediaList: { - prototype: MediaList; - new(): MediaList; -} - -interface MediaQueryList { - readonly matches: boolean; - readonly media: string; - addListener(listener: MediaQueryListListener): void; - removeListener(listener: MediaQueryListListener): void; -} - -declare var MediaQueryList: { - prototype: MediaQueryList; - new(): MediaQueryList; -} - -interface MediaSource extends EventTarget { - readonly activeSourceBuffers: SourceBufferList; - duration: number; - readonly readyState: string; - readonly sourceBuffers: SourceBufferList; - addSourceBuffer(type: string): SourceBuffer; - endOfStream(error?: number): void; - removeSourceBuffer(sourceBuffer: SourceBuffer): void; -} - -declare var MediaSource: { - prototype: MediaSource; - new(): MediaSource; - isTypeSupported(type: string): boolean; -} - -interface MediaStream extends EventTarget { - readonly active: boolean; - readonly id: string; - onactive: (this: this, ev: Event) => any; - onaddtrack: (this: this, ev: TrackEvent) => any; - oninactive: (this: this, ev: Event) => any; - onremovetrack: (this: this, ev: TrackEvent) => any; - addTrack(track: MediaStreamTrack): void; - clone(): MediaStream; - getAudioTracks(): MediaStreamTrack[]; - getTrackById(trackId: string): MediaStreamTrack | null; - getTracks(): MediaStreamTrack[]; - getVideoTracks(): MediaStreamTrack[]; - removeTrack(track: MediaStreamTrack): void; - stop(): void; - addEventListener(type: "active", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "addtrack", listener: (this: this, ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: "inactive", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "removetrack", listener: (this: this, ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MediaStream: { - prototype: MediaStream; - new(streamOrTracks?: MediaStream | MediaStreamTrack[]): MediaStream; -} - -interface MediaStreamAudioSourceNode extends AudioNode { -} - -declare var MediaStreamAudioSourceNode: { - prototype: MediaStreamAudioSourceNode; - new(): MediaStreamAudioSourceNode; -} - -interface MediaStreamError { - readonly constraintName: string | null; - readonly message: string | null; - readonly name: string; -} - -declare var MediaStreamError: { - prototype: MediaStreamError; - new(): MediaStreamError; -} - -interface MediaStreamErrorEvent extends Event { - readonly error: MediaStreamError | null; -} - -declare var MediaStreamErrorEvent: { - prototype: MediaStreamErrorEvent; - new(type: string, eventInitDict?: MediaStreamErrorEventInit): MediaStreamErrorEvent; -} - -interface MediaStreamTrack extends EventTarget { - enabled: boolean; - readonly id: string; - readonly kind: string; - readonly label: string; - readonly muted: boolean; - onended: (this: this, ev: MediaStreamErrorEvent) => any; - onmute: (this: this, ev: Event) => any; - onoverconstrained: (this: this, ev: MediaStreamErrorEvent) => any; - onunmute: (this: this, ev: Event) => any; - readonly readonly: boolean; - readonly readyState: string; - readonly remote: boolean; - applyConstraints(constraints: MediaTrackConstraints): PromiseLike; - clone(): MediaStreamTrack; - getCapabilities(): MediaTrackCapabilities; - getConstraints(): MediaTrackConstraints; - getSettings(): MediaTrackSettings; - stop(): void; - addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mute", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "overconstrained", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "unmute", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MediaStreamTrack: { - prototype: MediaStreamTrack; - new(): MediaStreamTrack; -} - -interface MediaStreamTrackEvent extends Event { - readonly track: MediaStreamTrack; -} - -declare var MediaStreamTrackEvent: { - prototype: MediaStreamTrackEvent; - new(type: string, eventInitDict?: MediaStreamTrackEventInit): MediaStreamTrackEvent; -} - -interface MessageChannel { - readonly port1: MessagePort; - readonly port2: MessagePort; -} - -declare var MessageChannel: { - prototype: MessageChannel; - new(): MessageChannel; -} - -interface MessageEvent extends Event { - readonly data: any; - readonly origin: string; - readonly ports: any; - readonly source: Window; - initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; -} - -declare var MessageEvent: { - prototype: MessageEvent; - new(type: string, eventInitDict?: MessageEventInit): MessageEvent; -} - -interface MessagePort extends EventTarget { - onmessage: (this: this, ev: MessageEvent) => any; - close(): void; - postMessage(message?: any, ports?: any): void; - start(): void; - addEventListener(type: "message", listener: (this: this, ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MessagePort: { - prototype: MessagePort; - new(): MessagePort; -} - -interface MimeType { - readonly description: string; - readonly enabledPlugin: Plugin; - readonly suffixes: string; - readonly type: string; -} - -declare var MimeType: { - prototype: MimeType; - new(): MimeType; -} - -interface MimeTypeArray { - readonly length: number; - item(index: number): Plugin; - namedItem(type: string): Plugin; - [index: number]: Plugin; -} - -declare var MimeTypeArray: { - prototype: MimeTypeArray; - new(): MimeTypeArray; -} - -interface MouseEvent extends UIEvent { - readonly altKey: boolean; - readonly button: number; - readonly buttons: number; - readonly clientX: number; - readonly clientY: number; - readonly ctrlKey: boolean; - readonly fromElement: Element; - readonly layerX: number; - readonly layerY: number; - readonly metaKey: boolean; - readonly movementX: number; - readonly movementY: number; - readonly offsetX: number; - readonly offsetY: number; - readonly pageX: number; - readonly pageY: number; - readonly relatedTarget: EventTarget; - readonly screenX: number; - readonly screenY: number; - readonly shiftKey: boolean; - readonly toElement: Element; - readonly which: number; - readonly x: number; - readonly y: number; - getModifierState(keyArg: string): boolean; - initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget): void; -} - -declare var MouseEvent: { - prototype: MouseEvent; - new(typeArg: string, eventInitDict?: MouseEventInit): MouseEvent; -} - -interface MutationEvent extends Event { - readonly attrChange: number; - readonly attrName: string; - readonly newValue: string; - readonly prevValue: string; - readonly relatedNode: Node; - initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; - readonly ADDITION: number; - readonly MODIFICATION: number; - readonly REMOVAL: number; -} - -declare var MutationEvent: { - prototype: MutationEvent; - new(): MutationEvent; - readonly ADDITION: number; - readonly MODIFICATION: number; - readonly REMOVAL: number; -} - -interface MutationObserver { - disconnect(): void; - observe(target: Node, options: MutationObserverInit): void; - takeRecords(): MutationRecord[]; -} - -declare var MutationObserver: { - prototype: MutationObserver; - new(callback: MutationCallback): MutationObserver; -} - -interface MutationRecord { - readonly addedNodes: NodeList; - readonly attributeName: string | null; - readonly attributeNamespace: string | null; - readonly nextSibling: Node | null; - readonly oldValue: string | null; - readonly previousSibling: Node | null; - readonly removedNodes: NodeList; - readonly target: Node; - readonly type: string; -} - -declare var MutationRecord: { - prototype: MutationRecord; - new(): MutationRecord; -} - -interface NamedNodeMap { - readonly length: number; - getNamedItem(name: string): Attr; - getNamedItemNS(namespaceURI: string | null, localName: string | null): Attr; - item(index: number): Attr; - removeNamedItem(name: string): Attr; - removeNamedItemNS(namespaceURI: string | null, localName: string | null): Attr; - setNamedItem(arg: Attr): Attr; - setNamedItemNS(arg: Attr): Attr; - [index: number]: Attr; -} - -declare var NamedNodeMap: { - prototype: NamedNodeMap; - new(): NamedNodeMap; -} - -interface NavigationCompletedEvent extends NavigationEvent { - readonly isSuccess: boolean; - readonly webErrorStatus: number; -} - -declare var NavigationCompletedEvent: { - prototype: NavigationCompletedEvent; - new(): NavigationCompletedEvent; -} - -interface NavigationEvent extends Event { - readonly uri: string; -} - -declare var NavigationEvent: { - prototype: NavigationEvent; - new(): NavigationEvent; -} - -interface NavigationEventWithReferrer extends NavigationEvent { - readonly referer: string; -} - -declare var NavigationEventWithReferrer: { - prototype: NavigationEventWithReferrer; - new(): NavigationEventWithReferrer; -} - -interface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, NavigatorGeolocation, MSNavigatorDoNotTrack, MSFileSaver, NavigatorUserMedia { - readonly appCodeName: string; - readonly cookieEnabled: boolean; - readonly language: string; - readonly maxTouchPoints: number; - readonly mimeTypes: MimeTypeArray; - readonly msManipulationViewsEnabled: boolean; - readonly msMaxTouchPoints: number; - readonly msPointerEnabled: boolean; - readonly plugins: PluginArray; - readonly pointerEnabled: boolean; - readonly webdriver: boolean; - getGamepads(): Gamepad[]; - javaEnabled(): boolean; - msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; - requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): PromiseLike; - vibrate(pattern: number | number[]): boolean; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Navigator: { - prototype: Navigator; - new(): Navigator; -} - -interface Node extends EventTarget { - readonly attributes: NamedNodeMap; - readonly baseURI: string | null; - readonly childNodes: NodeList; - readonly firstChild: Node; - readonly lastChild: Node; - readonly localName: string | null; - readonly namespaceURI: string | null; - readonly nextSibling: Node; - readonly nodeName: string; - readonly nodeType: number; - nodeValue: string | null; - readonly ownerDocument: Document; - readonly parentElement: HTMLElement; - readonly parentNode: Node; - readonly previousSibling: Node; - textContent: string | null; - appendChild(newChild: Node): Node; - cloneNode(deep?: boolean): Node; - compareDocumentPosition(other: Node): number; - contains(child: Node): boolean; - hasAttributes(): boolean; - hasChildNodes(): boolean; - insertBefore(newChild: Node, refChild: Node | null): Node; - isDefaultNamespace(namespaceURI: string | null): boolean; - isEqualNode(arg: Node): boolean; - isSameNode(other: Node): boolean; - lookupNamespaceURI(prefix: string | null): string | null; - lookupPrefix(namespaceURI: string | null): string | null; - normalize(): void; - removeChild(oldChild: Node): Node; - replaceChild(newChild: Node, oldChild: Node): Node; - readonly ATTRIBUTE_NODE: number; - readonly CDATA_SECTION_NODE: number; - readonly COMMENT_NODE: number; - readonly DOCUMENT_FRAGMENT_NODE: number; - readonly DOCUMENT_NODE: number; - readonly DOCUMENT_POSITION_CONTAINED_BY: number; - readonly DOCUMENT_POSITION_CONTAINS: number; - readonly DOCUMENT_POSITION_DISCONNECTED: number; - readonly DOCUMENT_POSITION_FOLLOWING: number; - readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - readonly DOCUMENT_POSITION_PRECEDING: number; - readonly DOCUMENT_TYPE_NODE: number; - readonly ELEMENT_NODE: number; - readonly ENTITY_NODE: number; - readonly ENTITY_REFERENCE_NODE: number; - readonly NOTATION_NODE: number; - readonly PROCESSING_INSTRUCTION_NODE: number; - readonly TEXT_NODE: number; -} - -declare var Node: { - prototype: Node; - new(): Node; - readonly ATTRIBUTE_NODE: number; - readonly CDATA_SECTION_NODE: number; - readonly COMMENT_NODE: number; - readonly DOCUMENT_FRAGMENT_NODE: number; - readonly DOCUMENT_NODE: number; - readonly DOCUMENT_POSITION_CONTAINED_BY: number; - readonly DOCUMENT_POSITION_CONTAINS: number; - readonly DOCUMENT_POSITION_DISCONNECTED: number; - readonly DOCUMENT_POSITION_FOLLOWING: number; - readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - readonly DOCUMENT_POSITION_PRECEDING: number; - readonly DOCUMENT_TYPE_NODE: number; - readonly ELEMENT_NODE: number; - readonly ENTITY_NODE: number; - readonly ENTITY_REFERENCE_NODE: number; - readonly NOTATION_NODE: number; - readonly PROCESSING_INSTRUCTION_NODE: number; - readonly TEXT_NODE: number; -} - -interface NodeFilter { - acceptNode(n: Node): number; -} - -declare var NodeFilter: { - readonly FILTER_ACCEPT: number; - readonly FILTER_REJECT: number; - readonly FILTER_SKIP: number; - readonly SHOW_ALL: number; - readonly SHOW_ATTRIBUTE: number; - readonly SHOW_CDATA_SECTION: number; - readonly SHOW_COMMENT: number; - readonly SHOW_DOCUMENT: number; - readonly SHOW_DOCUMENT_FRAGMENT: number; - readonly SHOW_DOCUMENT_TYPE: number; - readonly SHOW_ELEMENT: number; - readonly SHOW_ENTITY: number; - readonly SHOW_ENTITY_REFERENCE: number; - readonly SHOW_NOTATION: number; - readonly SHOW_PROCESSING_INSTRUCTION: number; - readonly SHOW_TEXT: number; -} - -interface NodeIterator { - readonly expandEntityReferences: boolean; - readonly filter: NodeFilter; - readonly root: Node; - readonly whatToShow: number; - detach(): void; - nextNode(): Node; - previousNode(): Node; -} - -declare var NodeIterator: { - prototype: NodeIterator; - new(): NodeIterator; -} - -interface NodeList { - readonly length: number; - item(index: number): Node; - [index: number]: Node; -} - -declare var NodeList: { - prototype: NodeList; - new(): NodeList; -} - -interface OES_element_index_uint { -} - -declare var OES_element_index_uint: { - prototype: OES_element_index_uint; - new(): OES_element_index_uint; -} - -interface OES_standard_derivatives { - readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} - -declare var OES_standard_derivatives: { - prototype: OES_standard_derivatives; - new(): OES_standard_derivatives; - readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} - -interface OES_texture_float { -} - -declare var OES_texture_float: { - prototype: OES_texture_float; - new(): OES_texture_float; -} - -interface OES_texture_float_linear { -} - -declare var OES_texture_float_linear: { - prototype: OES_texture_float_linear; - new(): OES_texture_float_linear; -} - -interface OfflineAudioCompletionEvent extends Event { - readonly renderedBuffer: AudioBuffer; -} - -declare var OfflineAudioCompletionEvent: { - prototype: OfflineAudioCompletionEvent; - new(): OfflineAudioCompletionEvent; -} - -interface OfflineAudioContext extends AudioContext { - oncomplete: (this: this, ev: Event) => any; - startRendering(): PromiseLike; - addEventListener(type: "complete", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var OfflineAudioContext: { - prototype: OfflineAudioContext; - new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext; -} - -interface OscillatorNode extends AudioNode { - readonly detune: AudioParam; - readonly frequency: AudioParam; - onended: (this: this, ev: MediaStreamErrorEvent) => any; - type: string; - setPeriodicWave(periodicWave: PeriodicWave): void; - start(when?: number): void; - stop(when?: number): void; - addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var OscillatorNode: { - prototype: OscillatorNode; - new(): OscillatorNode; -} - -interface OverflowEvent extends UIEvent { - readonly horizontalOverflow: boolean; - readonly orient: number; - readonly verticalOverflow: boolean; - readonly BOTH: number; - readonly HORIZONTAL: number; - readonly VERTICAL: number; -} - -declare var OverflowEvent: { - prototype: OverflowEvent; - new(): OverflowEvent; - readonly BOTH: number; - readonly HORIZONTAL: number; - readonly VERTICAL: number; -} - -interface PageTransitionEvent extends Event { - readonly persisted: boolean; -} - -declare var PageTransitionEvent: { - prototype: PageTransitionEvent; - new(): PageTransitionEvent; -} - -interface PannerNode extends AudioNode { - coneInnerAngle: number; - coneOuterAngle: number; - coneOuterGain: number; - distanceModel: string; - maxDistance: number; - panningModel: string; - refDistance: number; - rolloffFactor: number; - setOrientation(x: number, y: number, z: number): void; - setPosition(x: number, y: number, z: number): void; - setVelocity(x: number, y: number, z: number): void; -} - -declare var PannerNode: { - prototype: PannerNode; - new(): PannerNode; -} - -interface PerfWidgetExternal { - readonly activeNetworkRequestCount: number; - readonly averageFrameTime: number; - readonly averagePaintTime: number; - readonly extraInformationEnabled: boolean; - readonly independentRenderingEnabled: boolean; - readonly irDisablingContentString: string; - readonly irStatusAvailable: boolean; - readonly maxCpuSpeed: number; - readonly paintRequestsPerSecond: number; - readonly performanceCounter: number; - readonly performanceCounterFrequency: number; - addEventListener(eventType: string, callback: Function): void; - getMemoryUsage(): number; - getProcessCpuUsage(): number; - getRecentCpuUsage(last: number | null): any; - getRecentFrames(last: number | null): any; - getRecentMemoryUsage(last: number | null): any; - getRecentPaintRequests(last: number | null): any; - removeEventListener(eventType: string, callback: Function): void; - repositionWindow(x: number, y: number): void; - resizeWindow(width: number, height: number): void; -} - -declare var PerfWidgetExternal: { - prototype: PerfWidgetExternal; - new(): PerfWidgetExternal; -} - -interface Performance { - readonly navigation: PerformanceNavigation; - readonly timing: PerformanceTiming; - clearMarks(markName?: string): void; - clearMeasures(measureName?: string): void; - clearResourceTimings(): void; - getEntries(): any; - getEntriesByName(name: string, entryType?: string): any; - getEntriesByType(entryType: string): any; - getMarks(markName?: string): any; - getMeasures(measureName?: string): any; - mark(markName: string): void; - measure(measureName: string, startMarkName?: string, endMarkName?: string): void; - now(): number; - setResourceTimingBufferSize(maxSize: number): void; - toJSON(): any; -} - -declare var Performance: { - prototype: Performance; - new(): Performance; -} - -interface PerformanceEntry { - readonly duration: number; - readonly entryType: string; - readonly name: string; - readonly startTime: number; -} - -declare var PerformanceEntry: { - prototype: PerformanceEntry; - new(): PerformanceEntry; -} - -interface PerformanceMark extends PerformanceEntry { -} - -declare var PerformanceMark: { - prototype: PerformanceMark; - new(): PerformanceMark; -} - -interface PerformanceMeasure extends PerformanceEntry { -} - -declare var PerformanceMeasure: { - prototype: PerformanceMeasure; - new(): PerformanceMeasure; -} - -interface PerformanceNavigation { - readonly redirectCount: number; - readonly type: number; - toJSON(): any; - readonly TYPE_BACK_FORWARD: number; - readonly TYPE_NAVIGATE: number; - readonly TYPE_RELOAD: number; - readonly TYPE_RESERVED: number; -} - -declare var PerformanceNavigation: { - prototype: PerformanceNavigation; - new(): PerformanceNavigation; - readonly TYPE_BACK_FORWARD: number; - readonly TYPE_NAVIGATE: number; - readonly TYPE_RELOAD: number; - readonly TYPE_RESERVED: number; -} - -interface PerformanceNavigationTiming extends PerformanceEntry { - readonly connectEnd: number; - readonly connectStart: number; - readonly domComplete: number; - readonly domContentLoadedEventEnd: number; - readonly domContentLoadedEventStart: number; - readonly domInteractive: number; - readonly domLoading: number; - readonly domainLookupEnd: number; - readonly domainLookupStart: number; - readonly fetchStart: number; - readonly loadEventEnd: number; - readonly loadEventStart: number; - readonly navigationStart: number; - readonly redirectCount: number; - readonly redirectEnd: number; - readonly redirectStart: number; - readonly requestStart: number; - readonly responseEnd: number; - readonly responseStart: number; - readonly type: string; - readonly unloadEventEnd: number; - readonly unloadEventStart: number; -} - -declare var PerformanceNavigationTiming: { - prototype: PerformanceNavigationTiming; - new(): PerformanceNavigationTiming; -} - -interface PerformanceResourceTiming extends PerformanceEntry { - readonly connectEnd: number; - readonly connectStart: number; - readonly domainLookupEnd: number; - readonly domainLookupStart: number; - readonly fetchStart: number; - readonly initiatorType: string; - readonly redirectEnd: number; - readonly redirectStart: number; - readonly requestStart: number; - readonly responseEnd: number; - readonly responseStart: number; -} - -declare var PerformanceResourceTiming: { - prototype: PerformanceResourceTiming; - new(): PerformanceResourceTiming; -} - -interface PerformanceTiming { - readonly connectEnd: number; - readonly connectStart: number; - readonly domComplete: number; - readonly domContentLoadedEventEnd: number; - readonly domContentLoadedEventStart: number; - readonly domInteractive: number; - readonly domLoading: number; - readonly domainLookupEnd: number; - readonly domainLookupStart: number; - readonly fetchStart: number; - readonly loadEventEnd: number; - readonly loadEventStart: number; - readonly msFirstPaint: number; - readonly navigationStart: number; - readonly redirectEnd: number; - readonly redirectStart: number; - readonly requestStart: number; - readonly responseEnd: number; - readonly responseStart: number; - readonly unloadEventEnd: number; - readonly unloadEventStart: number; - readonly secureConnectionStart: number; - toJSON(): any; -} - -declare var PerformanceTiming: { - prototype: PerformanceTiming; - new(): PerformanceTiming; -} - -interface PeriodicWave { -} - -declare var PeriodicWave: { - prototype: PeriodicWave; - new(): PeriodicWave; -} - -interface PermissionRequest extends DeferredPermissionRequest { - readonly state: string; - defer(): void; -} - -declare var PermissionRequest: { - prototype: PermissionRequest; - new(): PermissionRequest; -} - -interface PermissionRequestedEvent extends Event { - readonly permissionRequest: PermissionRequest; -} - -declare var PermissionRequestedEvent: { - prototype: PermissionRequestedEvent; - new(): PermissionRequestedEvent; -} - -interface Plugin { - readonly description: string; - readonly filename: string; - readonly length: number; - readonly name: string; - readonly version: string; - item(index: number): MimeType; - namedItem(type: string): MimeType; - [index: number]: MimeType; -} - -declare var Plugin: { - prototype: Plugin; - new(): Plugin; -} - -interface PluginArray { - readonly length: number; - item(index: number): Plugin; - namedItem(name: string): Plugin; - refresh(reload?: boolean): void; - [index: number]: Plugin; -} - -declare var PluginArray: { - prototype: PluginArray; - new(): PluginArray; -} - -interface PointerEvent extends MouseEvent { - readonly currentPoint: any; - readonly height: number; - readonly hwTimestamp: number; - readonly intermediatePoints: any; - readonly isPrimary: boolean; - readonly pointerId: number; - readonly pointerType: any; - readonly pressure: number; - readonly rotation: number; - readonly tiltX: number; - readonly tiltY: number; - readonly width: number; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; -} - -declare var PointerEvent: { - prototype: PointerEvent; - new(typeArg: string, eventInitDict?: PointerEventInit): PointerEvent; -} - -interface PopStateEvent extends Event { - readonly state: any; - initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void; -} - -declare var PopStateEvent: { - prototype: PopStateEvent; - new(): PopStateEvent; -} - -interface Position { - readonly coords: Coordinates; - readonly timestamp: number; -} - -declare var Position: { - prototype: Position; - new(): Position; -} - -interface PositionError { - readonly code: number; - readonly message: string; - toString(): string; - readonly PERMISSION_DENIED: number; - readonly POSITION_UNAVAILABLE: number; - readonly TIMEOUT: number; -} - -declare var PositionError: { - prototype: PositionError; - new(): PositionError; - readonly PERMISSION_DENIED: number; - readonly POSITION_UNAVAILABLE: number; - readonly TIMEOUT: number; -} - -interface ProcessingInstruction extends CharacterData { - readonly target: string; -} - -declare var ProcessingInstruction: { - prototype: ProcessingInstruction; - new(): ProcessingInstruction; -} - -interface ProgressEvent extends Event { - readonly lengthComputable: boolean; - readonly loaded: number; - readonly total: number; - initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; -} - -declare var ProgressEvent: { - prototype: ProgressEvent; - new(type: string, eventInitDict?: ProgressEventInit): ProgressEvent; -} - -interface RTCDTMFToneChangeEvent extends Event { - readonly tone: string; -} - -declare var RTCDTMFToneChangeEvent: { - prototype: RTCDTMFToneChangeEvent; - new(type: string, eventInitDict: RTCDTMFToneChangeEventInit): RTCDTMFToneChangeEvent; -} - -interface RTCDtlsTransport extends RTCStatsProvider { - ondtlsstatechange: ((this: this, ev: RTCDtlsTransportStateChangedEvent) => any) | null; - onerror: ((this: this, ev: ErrorEvent) => any) | null; - readonly state: string; - readonly transport: RTCIceTransport; - getLocalParameters(): RTCDtlsParameters; - getRemoteCertificates(): ArrayBuffer[]; - getRemoteParameters(): RTCDtlsParameters | null; - start(remoteParameters: RTCDtlsParameters): void; - stop(): void; - addEventListener(type: "dtlsstatechange", listener: (this: this, ev: RTCDtlsTransportStateChangedEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCDtlsTransport: { - prototype: RTCDtlsTransport; - new(transport: RTCIceTransport): RTCDtlsTransport; -} - -interface RTCDtlsTransportStateChangedEvent extends Event { - readonly state: string; -} - -declare var RTCDtlsTransportStateChangedEvent: { - prototype: RTCDtlsTransportStateChangedEvent; - new(): RTCDtlsTransportStateChangedEvent; -} - -interface RTCDtmfSender extends EventTarget { - readonly canInsertDTMF: boolean; - readonly duration: number; - readonly interToneGap: number; - ontonechange: (this: this, ev: RTCDTMFToneChangeEvent) => any; - readonly sender: RTCRtpSender; - readonly toneBuffer: string; - insertDTMF(tones: string, duration?: number, interToneGap?: number): void; - addEventListener(type: "tonechange", listener: (this: this, ev: RTCDTMFToneChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCDtmfSender: { - prototype: RTCDtmfSender; - new(sender: RTCRtpSender): RTCDtmfSender; -} - -interface RTCIceCandidatePairChangedEvent extends Event { - readonly pair: RTCIceCandidatePair; -} - -declare var RTCIceCandidatePairChangedEvent: { - prototype: RTCIceCandidatePairChangedEvent; - new(): RTCIceCandidatePairChangedEvent; -} - -interface RTCIceGatherer extends RTCStatsProvider { - readonly component: string; - onerror: ((this: this, ev: ErrorEvent) => any) | null; - onlocalcandidate: ((this: this, ev: RTCIceGathererEvent) => any) | null; - createAssociatedGatherer(): RTCIceGatherer; - getLocalCandidates(): RTCIceCandidate[]; - getLocalParameters(): RTCIceParameters; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "localcandidate", listener: (this: this, ev: RTCIceGathererEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCIceGatherer: { - prototype: RTCIceGatherer; - new(options: RTCIceGatherOptions): RTCIceGatherer; -} - -interface RTCIceGathererEvent extends Event { - readonly candidate: RTCIceCandidate | RTCIceCandidateComplete; -} - -declare var RTCIceGathererEvent: { - prototype: RTCIceGathererEvent; - new(): RTCIceGathererEvent; -} - -interface RTCIceTransport extends RTCStatsProvider { - readonly component: string; - readonly iceGatherer: RTCIceGatherer | null; - oncandidatepairchange: ((this: this, ev: RTCIceCandidatePairChangedEvent) => any) | null; - onicestatechange: ((this: this, ev: RTCIceTransportStateChangedEvent) => any) | null; - readonly role: string; - readonly state: string; - addRemoteCandidate(remoteCandidate: RTCIceCandidate | RTCIceCandidateComplete): void; - createAssociatedTransport(): RTCIceTransport; - getNominatedCandidatePair(): RTCIceCandidatePair | null; - getRemoteCandidates(): RTCIceCandidate[]; - getRemoteParameters(): RTCIceParameters | null; - setRemoteCandidates(remoteCandidates: RTCIceCandidate[]): void; - start(gatherer: RTCIceGatherer, remoteParameters: RTCIceParameters, role?: string): void; - stop(): void; - addEventListener(type: "candidatepairchange", listener: (this: this, ev: RTCIceCandidatePairChangedEvent) => any, useCapture?: boolean): void; - addEventListener(type: "icestatechange", listener: (this: this, ev: RTCIceTransportStateChangedEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCIceTransport: { - prototype: RTCIceTransport; - new(): RTCIceTransport; -} - -interface RTCIceTransportStateChangedEvent extends Event { - readonly state: string; -} - -declare var RTCIceTransportStateChangedEvent: { - prototype: RTCIceTransportStateChangedEvent; - new(): RTCIceTransportStateChangedEvent; -} - -interface RTCRtpReceiver extends RTCStatsProvider { - onerror: ((this: this, ev: ErrorEvent) => any) | null; - readonly rtcpTransport: RTCDtlsTransport; - readonly track: MediaStreamTrack | null; - readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport; - getContributingSources(): RTCRtpContributingSource[]; - receive(parameters: RTCRtpParameters): void; - requestSendCSRC(csrc: number): void; - setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void; - stop(): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCRtpReceiver: { - prototype: RTCRtpReceiver; - new(transport: RTCDtlsTransport | RTCSrtpSdesTransport, kind: string, rtcpTransport?: RTCDtlsTransport): RTCRtpReceiver; - getCapabilities(kind?: string): RTCRtpCapabilities; -} - -interface RTCRtpSender extends RTCStatsProvider { - onerror: ((this: this, ev: ErrorEvent) => any) | null; - onssrcconflict: ((this: this, ev: RTCSsrcConflictEvent) => any) | null; - readonly rtcpTransport: RTCDtlsTransport; - readonly track: MediaStreamTrack; - readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport; - send(parameters: RTCRtpParameters): void; - setTrack(track: MediaStreamTrack): void; - setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void; - stop(): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ssrcconflict", listener: (this: this, ev: RTCSsrcConflictEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCRtpSender: { - prototype: RTCRtpSender; - new(track: MediaStreamTrack, transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): RTCRtpSender; - getCapabilities(kind?: string): RTCRtpCapabilities; -} - -interface RTCSrtpSdesTransport extends EventTarget { - onerror: ((this: this, ev: ErrorEvent) => any) | null; - readonly transport: RTCIceTransport; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCSrtpSdesTransport: { - prototype: RTCSrtpSdesTransport; - new(transport: RTCIceTransport, encryptParameters: RTCSrtpSdesParameters, decryptParameters: RTCSrtpSdesParameters): RTCSrtpSdesTransport; - getLocalParameters(): RTCSrtpSdesParameters[]; -} - -interface RTCSsrcConflictEvent extends Event { - readonly ssrc: number; -} - -declare var RTCSsrcConflictEvent: { - prototype: RTCSsrcConflictEvent; - new(): RTCSsrcConflictEvent; -} - -interface RTCStatsProvider extends EventTarget { - getStats(): PromiseLike; - msGetStats(): PromiseLike; -} - -declare var RTCStatsProvider: { - prototype: RTCStatsProvider; - new(): RTCStatsProvider; -} - -interface Range { - readonly collapsed: boolean; - readonly commonAncestorContainer: Node; - readonly endContainer: Node; - readonly endOffset: number; - readonly startContainer: Node; - readonly startOffset: number; - cloneContents(): DocumentFragment; - cloneRange(): Range; - collapse(toStart: boolean): void; - compareBoundaryPoints(how: number, sourceRange: Range): number; - createContextualFragment(fragment: string): DocumentFragment; - deleteContents(): void; - detach(): void; - expand(Unit: string): boolean; - extractContents(): DocumentFragment; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; - insertNode(newNode: Node): void; - selectNode(refNode: Node): void; - selectNodeContents(refNode: Node): void; - setEnd(refNode: Node, offset: number): void; - setEndAfter(refNode: Node): void; - setEndBefore(refNode: Node): void; - setStart(refNode: Node, offset: number): void; - setStartAfter(refNode: Node): void; - setStartBefore(refNode: Node): void; - surroundContents(newParent: Node): void; - toString(): string; - readonly END_TO_END: number; - readonly END_TO_START: number; - readonly START_TO_END: number; - readonly START_TO_START: number; -} - -declare var Range: { - prototype: Range; - new(): Range; - readonly END_TO_END: number; - readonly END_TO_START: number; - readonly START_TO_END: number; - readonly START_TO_START: number; -} - -interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { - readonly target: SVGAnimatedString; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGAElement: { - prototype: SVGAElement; - new(): SVGAElement; -} - -interface SVGAngle { - readonly unitType: number; - value: number; - valueAsString: string; - valueInSpecifiedUnits: number; - convertToSpecifiedUnits(unitType: number): void; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - readonly SVG_ANGLETYPE_DEG: number; - readonly SVG_ANGLETYPE_GRAD: number; - readonly SVG_ANGLETYPE_RAD: number; - readonly SVG_ANGLETYPE_UNKNOWN: number; - readonly SVG_ANGLETYPE_UNSPECIFIED: number; -} - -declare var SVGAngle: { - prototype: SVGAngle; - new(): SVGAngle; - readonly SVG_ANGLETYPE_DEG: number; - readonly SVG_ANGLETYPE_GRAD: number; - readonly SVG_ANGLETYPE_RAD: number; - readonly SVG_ANGLETYPE_UNKNOWN: number; - readonly SVG_ANGLETYPE_UNSPECIFIED: number; -} - -interface SVGAnimatedAngle { - readonly animVal: SVGAngle; - readonly baseVal: SVGAngle; -} - -declare var SVGAnimatedAngle: { - prototype: SVGAnimatedAngle; - new(): SVGAnimatedAngle; -} - -interface SVGAnimatedBoolean { - readonly animVal: boolean; - baseVal: boolean; -} - -declare var SVGAnimatedBoolean: { - prototype: SVGAnimatedBoolean; - new(): SVGAnimatedBoolean; -} - -interface SVGAnimatedEnumeration { - readonly animVal: number; - baseVal: number; -} - -declare var SVGAnimatedEnumeration: { - prototype: SVGAnimatedEnumeration; - new(): SVGAnimatedEnumeration; -} - -interface SVGAnimatedInteger { - readonly animVal: number; - baseVal: number; -} - -declare var SVGAnimatedInteger: { - prototype: SVGAnimatedInteger; - new(): SVGAnimatedInteger; -} - -interface SVGAnimatedLength { - readonly animVal: SVGLength; - readonly baseVal: SVGLength; -} - -declare var SVGAnimatedLength: { - prototype: SVGAnimatedLength; - new(): SVGAnimatedLength; -} - -interface SVGAnimatedLengthList { - readonly animVal: SVGLengthList; - readonly baseVal: SVGLengthList; -} - -declare var SVGAnimatedLengthList: { - prototype: SVGAnimatedLengthList; - new(): SVGAnimatedLengthList; -} - -interface SVGAnimatedNumber { - readonly animVal: number; - baseVal: number; -} - -declare var SVGAnimatedNumber: { - prototype: SVGAnimatedNumber; - new(): SVGAnimatedNumber; -} - -interface SVGAnimatedNumberList { - readonly animVal: SVGNumberList; - readonly baseVal: SVGNumberList; -} - -declare var SVGAnimatedNumberList: { - prototype: SVGAnimatedNumberList; - new(): SVGAnimatedNumberList; -} - -interface SVGAnimatedPreserveAspectRatio { - readonly animVal: SVGPreserveAspectRatio; - readonly baseVal: SVGPreserveAspectRatio; -} - -declare var SVGAnimatedPreserveAspectRatio: { - prototype: SVGAnimatedPreserveAspectRatio; - new(): SVGAnimatedPreserveAspectRatio; -} - -interface SVGAnimatedRect { - readonly animVal: SVGRect; - readonly baseVal: SVGRect; -} - -declare var SVGAnimatedRect: { - prototype: SVGAnimatedRect; - new(): SVGAnimatedRect; -} - -interface SVGAnimatedString { - readonly animVal: string; - baseVal: string; -} - -declare var SVGAnimatedString: { - prototype: SVGAnimatedString; - new(): SVGAnimatedString; -} - -interface SVGAnimatedTransformList { - readonly animVal: SVGTransformList; - readonly baseVal: SVGTransformList; -} - -declare var SVGAnimatedTransformList: { - prototype: SVGAnimatedTransformList; - new(): SVGAnimatedTransformList; -} - -interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly cx: SVGAnimatedLength; - readonly cy: SVGAnimatedLength; - readonly r: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGCircleElement: { - prototype: SVGCircleElement; - new(): SVGCircleElement; -} - -interface SVGClipPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes { - readonly clipPathUnits: SVGAnimatedEnumeration; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGClipPathElement: { - prototype: SVGClipPathElement; - new(): SVGClipPathElement; -} - -interface SVGComponentTransferFunctionElement extends SVGElement { - readonly amplitude: SVGAnimatedNumber; - readonly exponent: SVGAnimatedNumber; - readonly intercept: SVGAnimatedNumber; - readonly offset: SVGAnimatedNumber; - readonly slope: SVGAnimatedNumber; - readonly tableValues: SVGAnimatedNumberList; - readonly type: SVGAnimatedEnumeration; - readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; -} - -declare var SVGComponentTransferFunctionElement: { - prototype: SVGComponentTransferFunctionElement; - new(): SVGComponentTransferFunctionElement; - readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; -} - -interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGDefsElement: { - prototype: SVGDefsElement; - new(): SVGDefsElement; -} - -interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGDescElement: { - prototype: SVGDescElement; - new(): SVGDescElement; -} - -interface SVGElement extends Element { - onclick: (this: this, ev: MouseEvent) => any; - ondblclick: (this: this, ev: MouseEvent) => any; - onfocusin: (this: this, ev: FocusEvent) => any; - onfocusout: (this: this, ev: FocusEvent) => any; - onload: (this: this, ev: Event) => any; - onmousedown: (this: this, ev: MouseEvent) => any; - onmousemove: (this: this, ev: MouseEvent) => any; - onmouseout: (this: this, ev: MouseEvent) => any; - onmouseover: (this: this, ev: MouseEvent) => any; - onmouseup: (this: this, ev: MouseEvent) => any; - readonly ownerSVGElement: SVGSVGElement; - readonly viewportElement: SVGElement; - xmlbase: string; - className: any; - addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (this: this, ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (this: this, ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGElement: { - prototype: SVGElement; - new(): SVGElement; -} - -interface SVGElementInstance extends EventTarget { - readonly childNodes: SVGElementInstanceList; - readonly correspondingElement: SVGElement; - readonly correspondingUseElement: SVGUseElement; - readonly firstChild: SVGElementInstance; - readonly lastChild: SVGElementInstance; - readonly nextSibling: SVGElementInstance; - readonly parentNode: SVGElementInstance; - readonly previousSibling: SVGElementInstance; -} - -declare var SVGElementInstance: { - prototype: SVGElementInstance; - new(): SVGElementInstance; -} - -interface SVGElementInstanceList { - readonly length: number; - item(index: number): SVGElementInstance; -} - -declare var SVGElementInstanceList: { - prototype: SVGElementInstanceList; - new(): SVGElementInstanceList; -} - -interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly cx: SVGAnimatedLength; - readonly cy: SVGAnimatedLength; - readonly rx: SVGAnimatedLength; - readonly ry: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGEllipseElement: { - prototype: SVGEllipseElement; - new(): SVGEllipseElement; -} - -interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly in2: SVGAnimatedString; - readonly mode: SVGAnimatedEnumeration; - readonly SVG_FEBLEND_MODE_COLOR: number; - readonly SVG_FEBLEND_MODE_COLOR_BURN: number; - readonly SVG_FEBLEND_MODE_COLOR_DODGE: number; - readonly SVG_FEBLEND_MODE_DARKEN: number; - readonly SVG_FEBLEND_MODE_DIFFERENCE: number; - readonly SVG_FEBLEND_MODE_EXCLUSION: number; - readonly SVG_FEBLEND_MODE_HARD_LIGHT: number; - readonly SVG_FEBLEND_MODE_HUE: number; - readonly SVG_FEBLEND_MODE_LIGHTEN: number; - readonly SVG_FEBLEND_MODE_LUMINOSITY: number; - readonly SVG_FEBLEND_MODE_MULTIPLY: number; - readonly SVG_FEBLEND_MODE_NORMAL: number; - readonly SVG_FEBLEND_MODE_OVERLAY: number; - readonly SVG_FEBLEND_MODE_SATURATION: number; - readonly SVG_FEBLEND_MODE_SCREEN: number; - readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number; - readonly SVG_FEBLEND_MODE_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEBlendElement: { - prototype: SVGFEBlendElement; - new(): SVGFEBlendElement; - readonly SVG_FEBLEND_MODE_COLOR: number; - readonly SVG_FEBLEND_MODE_COLOR_BURN: number; - readonly SVG_FEBLEND_MODE_COLOR_DODGE: number; - readonly SVG_FEBLEND_MODE_DARKEN: number; - readonly SVG_FEBLEND_MODE_DIFFERENCE: number; - readonly SVG_FEBLEND_MODE_EXCLUSION: number; - readonly SVG_FEBLEND_MODE_HARD_LIGHT: number; - readonly SVG_FEBLEND_MODE_HUE: number; - readonly SVG_FEBLEND_MODE_LIGHTEN: number; - readonly SVG_FEBLEND_MODE_LUMINOSITY: number; - readonly SVG_FEBLEND_MODE_MULTIPLY: number; - readonly SVG_FEBLEND_MODE_NORMAL: number; - readonly SVG_FEBLEND_MODE_OVERLAY: number; - readonly SVG_FEBLEND_MODE_SATURATION: number; - readonly SVG_FEBLEND_MODE_SCREEN: number; - readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number; - readonly SVG_FEBLEND_MODE_UNKNOWN: number; -} - -interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly type: SVGAnimatedEnumeration; - readonly values: SVGAnimatedNumberList; - readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; - readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number; - readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number; - readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEColorMatrixElement: { - prototype: SVGFEColorMatrixElement; - new(): SVGFEColorMatrixElement; - readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; - readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number; - readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number; - readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; -} - -interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEComponentTransferElement: { - prototype: SVGFEComponentTransferElement; - new(): SVGFEComponentTransferElement; -} - -interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly in2: SVGAnimatedString; - readonly k1: SVGAnimatedNumber; - readonly k2: SVGAnimatedNumber; - readonly k3: SVGAnimatedNumber; - readonly k4: SVGAnimatedNumber; - readonly operator: SVGAnimatedEnumeration; - readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number; - readonly SVG_FECOMPOSITE_OPERATOR_IN: number; - readonly SVG_FECOMPOSITE_OPERATOR_OUT: number; - readonly SVG_FECOMPOSITE_OPERATOR_OVER: number; - readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - readonly SVG_FECOMPOSITE_OPERATOR_XOR: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFECompositeElement: { - prototype: SVGFECompositeElement; - new(): SVGFECompositeElement; - readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number; - readonly SVG_FECOMPOSITE_OPERATOR_IN: number; - readonly SVG_FECOMPOSITE_OPERATOR_OUT: number; - readonly SVG_FECOMPOSITE_OPERATOR_OVER: number; - readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - readonly SVG_FECOMPOSITE_OPERATOR_XOR: number; -} - -interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly bias: SVGAnimatedNumber; - readonly divisor: SVGAnimatedNumber; - readonly edgeMode: SVGAnimatedEnumeration; - readonly in1: SVGAnimatedString; - readonly kernelMatrix: SVGAnimatedNumberList; - readonly kernelUnitLengthX: SVGAnimatedNumber; - readonly kernelUnitLengthY: SVGAnimatedNumber; - readonly orderX: SVGAnimatedInteger; - readonly orderY: SVGAnimatedInteger; - readonly preserveAlpha: SVGAnimatedBoolean; - readonly targetX: SVGAnimatedInteger; - readonly targetY: SVGAnimatedInteger; - readonly SVG_EDGEMODE_DUPLICATE: number; - readonly SVG_EDGEMODE_NONE: number; - readonly SVG_EDGEMODE_UNKNOWN: number; - readonly SVG_EDGEMODE_WRAP: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEConvolveMatrixElement: { - prototype: SVGFEConvolveMatrixElement; - new(): SVGFEConvolveMatrixElement; - readonly SVG_EDGEMODE_DUPLICATE: number; - readonly SVG_EDGEMODE_NONE: number; - readonly SVG_EDGEMODE_UNKNOWN: number; - readonly SVG_EDGEMODE_WRAP: number; -} - -interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly diffuseConstant: SVGAnimatedNumber; - readonly in1: SVGAnimatedString; - readonly kernelUnitLengthX: SVGAnimatedNumber; - readonly kernelUnitLengthY: SVGAnimatedNumber; - readonly surfaceScale: SVGAnimatedNumber; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEDiffuseLightingElement: { - prototype: SVGFEDiffuseLightingElement; - new(): SVGFEDiffuseLightingElement; -} - -interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly in2: SVGAnimatedString; - readonly scale: SVGAnimatedNumber; - readonly xChannelSelector: SVGAnimatedEnumeration; - readonly yChannelSelector: SVGAnimatedEnumeration; - readonly SVG_CHANNEL_A: number; - readonly SVG_CHANNEL_B: number; - readonly SVG_CHANNEL_G: number; - readonly SVG_CHANNEL_R: number; - readonly SVG_CHANNEL_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEDisplacementMapElement: { - prototype: SVGFEDisplacementMapElement; - new(): SVGFEDisplacementMapElement; - readonly SVG_CHANNEL_A: number; - readonly SVG_CHANNEL_B: number; - readonly SVG_CHANNEL_G: number; - readonly SVG_CHANNEL_R: number; - readonly SVG_CHANNEL_UNKNOWN: number; -} - -interface SVGFEDistantLightElement extends SVGElement { - readonly azimuth: SVGAnimatedNumber; - readonly elevation: SVGAnimatedNumber; -} - -declare var SVGFEDistantLightElement: { - prototype: SVGFEDistantLightElement; - new(): SVGFEDistantLightElement; -} - -interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEFloodElement: { - prototype: SVGFEFloodElement; - new(): SVGFEFloodElement; -} - -interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncAElement: { - prototype: SVGFEFuncAElement; - new(): SVGFEFuncAElement; -} - -interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncBElement: { - prototype: SVGFEFuncBElement; - new(): SVGFEFuncBElement; -} - -interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncGElement: { - prototype: SVGFEFuncGElement; - new(): SVGFEFuncGElement; -} - -interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncRElement: { - prototype: SVGFEFuncRElement; - new(): SVGFEFuncRElement; -} - -interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly stdDeviationX: SVGAnimatedNumber; - readonly stdDeviationY: SVGAnimatedNumber; - setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEGaussianBlurElement: { - prototype: SVGFEGaussianBlurElement; - new(): SVGFEGaussianBlurElement; -} - -interface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { - readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEImageElement: { - prototype: SVGFEImageElement; - new(): SVGFEImageElement; -} - -interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEMergeElement: { - prototype: SVGFEMergeElement; - new(): SVGFEMergeElement; -} - -interface SVGFEMergeNodeElement extends SVGElement { - readonly in1: SVGAnimatedString; -} - -declare var SVGFEMergeNodeElement: { - prototype: SVGFEMergeNodeElement; - new(): SVGFEMergeNodeElement; -} - -interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly operator: SVGAnimatedEnumeration; - readonly radiusX: SVGAnimatedNumber; - readonly radiusY: SVGAnimatedNumber; - readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number; - readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number; - readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEMorphologyElement: { - prototype: SVGFEMorphologyElement; - new(): SVGFEMorphologyElement; - readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number; - readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number; - readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; -} - -interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly dx: SVGAnimatedNumber; - readonly dy: SVGAnimatedNumber; - readonly in1: SVGAnimatedString; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEOffsetElement: { - prototype: SVGFEOffsetElement; - new(): SVGFEOffsetElement; -} - -interface SVGFEPointLightElement extends SVGElement { - readonly x: SVGAnimatedNumber; - readonly y: SVGAnimatedNumber; - readonly z: SVGAnimatedNumber; -} - -declare var SVGFEPointLightElement: { - prototype: SVGFEPointLightElement; - new(): SVGFEPointLightElement; -} - -interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly kernelUnitLengthX: SVGAnimatedNumber; - readonly kernelUnitLengthY: SVGAnimatedNumber; - readonly specularConstant: SVGAnimatedNumber; - readonly specularExponent: SVGAnimatedNumber; - readonly surfaceScale: SVGAnimatedNumber; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFESpecularLightingElement: { - prototype: SVGFESpecularLightingElement; - new(): SVGFESpecularLightingElement; -} - -interface SVGFESpotLightElement extends SVGElement { - readonly limitingConeAngle: SVGAnimatedNumber; - readonly pointsAtX: SVGAnimatedNumber; - readonly pointsAtY: SVGAnimatedNumber; - readonly pointsAtZ: SVGAnimatedNumber; - readonly specularExponent: SVGAnimatedNumber; - readonly x: SVGAnimatedNumber; - readonly y: SVGAnimatedNumber; - readonly z: SVGAnimatedNumber; -} - -declare var SVGFESpotLightElement: { - prototype: SVGFESpotLightElement; - new(): SVGFESpotLightElement; -} - -interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFETileElement: { - prototype: SVGFETileElement; - new(): SVGFETileElement; -} - -interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly baseFrequencyX: SVGAnimatedNumber; - readonly baseFrequencyY: SVGAnimatedNumber; - readonly numOctaves: SVGAnimatedInteger; - readonly seed: SVGAnimatedNumber; - readonly stitchTiles: SVGAnimatedEnumeration; - readonly type: SVGAnimatedEnumeration; - readonly SVG_STITCHTYPE_NOSTITCH: number; - readonly SVG_STITCHTYPE_STITCH: number; - readonly SVG_STITCHTYPE_UNKNOWN: number; - readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - readonly SVG_TURBULENCE_TYPE_TURBULENCE: number; - readonly SVG_TURBULENCE_TYPE_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFETurbulenceElement: { - prototype: SVGFETurbulenceElement; - new(): SVGFETurbulenceElement; - readonly SVG_STITCHTYPE_NOSTITCH: number; - readonly SVG_STITCHTYPE_STITCH: number; - readonly SVG_STITCHTYPE_UNKNOWN: number; - readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - readonly SVG_TURBULENCE_TYPE_TURBULENCE: number; - readonly SVG_TURBULENCE_TYPE_UNKNOWN: number; -} - -interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { - readonly filterResX: SVGAnimatedInteger; - readonly filterResY: SVGAnimatedInteger; - readonly filterUnits: SVGAnimatedEnumeration; - readonly height: SVGAnimatedLength; - readonly primitiveUnits: SVGAnimatedEnumeration; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - setFilterRes(filterResX: number, filterResY: number): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFilterElement: { - prototype: SVGFilterElement; - new(): SVGFilterElement; -} - -interface SVGForeignObjectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly height: SVGAnimatedLength; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGForeignObjectElement: { - prototype: SVGForeignObjectElement; - new(): SVGForeignObjectElement; -} - -interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGGElement: { - prototype: SVGGElement; - new(): SVGGElement; -} - -interface SVGGradientElement extends SVGElement, SVGStylable, SVGExternalResourcesRequired, SVGURIReference, SVGUnitTypes { - readonly gradientTransform: SVGAnimatedTransformList; - readonly gradientUnits: SVGAnimatedEnumeration; - readonly spreadMethod: SVGAnimatedEnumeration; - readonly SVG_SPREADMETHOD_PAD: number; - readonly SVG_SPREADMETHOD_REFLECT: number; - readonly SVG_SPREADMETHOD_REPEAT: number; - readonly SVG_SPREADMETHOD_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGGradientElement: { - prototype: SVGGradientElement; - new(): SVGGradientElement; - readonly SVG_SPREADMETHOD_PAD: number; - readonly SVG_SPREADMETHOD_REFLECT: number; - readonly SVG_SPREADMETHOD_REPEAT: number; - readonly SVG_SPREADMETHOD_UNKNOWN: number; -} - -interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { - readonly height: SVGAnimatedLength; - readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGImageElement: { - prototype: SVGImageElement; - new(): SVGImageElement; -} - -interface SVGLength { - readonly unitType: number; - value: number; - valueAsString: string; - valueInSpecifiedUnits: number; - convertToSpecifiedUnits(unitType: number): void; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - readonly SVG_LENGTHTYPE_CM: number; - readonly SVG_LENGTHTYPE_EMS: number; - readonly SVG_LENGTHTYPE_EXS: number; - readonly SVG_LENGTHTYPE_IN: number; - readonly SVG_LENGTHTYPE_MM: number; - readonly SVG_LENGTHTYPE_NUMBER: number; - readonly SVG_LENGTHTYPE_PC: number; - readonly SVG_LENGTHTYPE_PERCENTAGE: number; - readonly SVG_LENGTHTYPE_PT: number; - readonly SVG_LENGTHTYPE_PX: number; - readonly SVG_LENGTHTYPE_UNKNOWN: number; -} - -declare var SVGLength: { - prototype: SVGLength; - new(): SVGLength; - readonly SVG_LENGTHTYPE_CM: number; - readonly SVG_LENGTHTYPE_EMS: number; - readonly SVG_LENGTHTYPE_EXS: number; - readonly SVG_LENGTHTYPE_IN: number; - readonly SVG_LENGTHTYPE_MM: number; - readonly SVG_LENGTHTYPE_NUMBER: number; - readonly SVG_LENGTHTYPE_PC: number; - readonly SVG_LENGTHTYPE_PERCENTAGE: number; - readonly SVG_LENGTHTYPE_PT: number; - readonly SVG_LENGTHTYPE_PX: number; - readonly SVG_LENGTHTYPE_UNKNOWN: number; -} - -interface SVGLengthList { - readonly numberOfItems: number; - appendItem(newItem: SVGLength): SVGLength; - clear(): void; - getItem(index: number): SVGLength; - initialize(newItem: SVGLength): SVGLength; - insertItemBefore(newItem: SVGLength, index: number): SVGLength; - removeItem(index: number): SVGLength; - replaceItem(newItem: SVGLength, index: number): SVGLength; -} - -declare var SVGLengthList: { - prototype: SVGLengthList; - new(): SVGLengthList; -} - -interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly x1: SVGAnimatedLength; - readonly x2: SVGAnimatedLength; - readonly y1: SVGAnimatedLength; - readonly y2: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGLineElement: { - prototype: SVGLineElement; - new(): SVGLineElement; -} - -interface SVGLinearGradientElement extends SVGGradientElement { - readonly x1: SVGAnimatedLength; - readonly x2: SVGAnimatedLength; - readonly y1: SVGAnimatedLength; - readonly y2: SVGAnimatedLength; -} - -declare var SVGLinearGradientElement: { - prototype: SVGLinearGradientElement; - new(): SVGLinearGradientElement; -} - -interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox { - readonly markerHeight: SVGAnimatedLength; - readonly markerUnits: SVGAnimatedEnumeration; - readonly markerWidth: SVGAnimatedLength; - readonly orientAngle: SVGAnimatedAngle; - readonly orientType: SVGAnimatedEnumeration; - readonly refX: SVGAnimatedLength; - readonly refY: SVGAnimatedLength; - setOrientToAngle(angle: SVGAngle): void; - setOrientToAuto(): void; - readonly SVG_MARKERUNITS_STROKEWIDTH: number; - readonly SVG_MARKERUNITS_UNKNOWN: number; - readonly SVG_MARKERUNITS_USERSPACEONUSE: number; - readonly SVG_MARKER_ORIENT_ANGLE: number; - readonly SVG_MARKER_ORIENT_AUTO: number; - readonly SVG_MARKER_ORIENT_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGMarkerElement: { - prototype: SVGMarkerElement; - new(): SVGMarkerElement; - readonly SVG_MARKERUNITS_STROKEWIDTH: number; - readonly SVG_MARKERUNITS_UNKNOWN: number; - readonly SVG_MARKERUNITS_USERSPACEONUSE: number; - readonly SVG_MARKER_ORIENT_ANGLE: number; - readonly SVG_MARKER_ORIENT_AUTO: number; - readonly SVG_MARKER_ORIENT_UNKNOWN: number; -} - -interface SVGMaskElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes { - readonly height: SVGAnimatedLength; - readonly maskContentUnits: SVGAnimatedEnumeration; - readonly maskUnits: SVGAnimatedEnumeration; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGMaskElement: { - prototype: SVGMaskElement; - new(): SVGMaskElement; -} - -interface SVGMatrix { - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; - flipX(): SVGMatrix; - flipY(): SVGMatrix; - inverse(): SVGMatrix; - multiply(secondMatrix: SVGMatrix): SVGMatrix; - rotate(angle: number): SVGMatrix; - rotateFromVector(x: number, y: number): SVGMatrix; - scale(scaleFactor: number): SVGMatrix; - scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; - skewX(angle: number): SVGMatrix; - skewY(angle: number): SVGMatrix; - translate(x: number, y: number): SVGMatrix; -} - -declare var SVGMatrix: { - prototype: SVGMatrix; - new(): SVGMatrix; -} - -interface SVGMetadataElement extends SVGElement { -} - -declare var SVGMetadataElement: { - prototype: SVGMetadataElement; - new(): SVGMetadataElement; -} - -interface SVGNumber { - value: number; -} - -declare var SVGNumber: { - prototype: SVGNumber; - new(): SVGNumber; -} - -interface SVGNumberList { - readonly numberOfItems: number; - appendItem(newItem: SVGNumber): SVGNumber; - clear(): void; - getItem(index: number): SVGNumber; - initialize(newItem: SVGNumber): SVGNumber; - insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; - removeItem(index: number): SVGNumber; - replaceItem(newItem: SVGNumber, index: number): SVGNumber; -} - -declare var SVGNumberList: { - prototype: SVGNumberList; - new(): SVGNumberList; -} - -interface SVGPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPathData { - createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; - createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; - createSVGPathSegClosePath(): SVGPathSegClosePath; - createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; - createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; - createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; - createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; - createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; - createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; - createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; - createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; - createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; - createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; - createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; - createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; - createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; - createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; - createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; - createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; - getPathSegAtLength(distance: number): number; - getPointAtLength(distance: number): SVGPoint; - getTotalLength(): number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPathElement: { - prototype: SVGPathElement; - new(): SVGPathElement; -} - -interface SVGPathSeg { - readonly pathSegType: number; - readonly pathSegTypeAsLetter: string; - readonly PATHSEG_ARC_ABS: number; - readonly PATHSEG_ARC_REL: number; - readonly PATHSEG_CLOSEPATH: number; - readonly PATHSEG_CURVETO_CUBIC_ABS: number; - readonly PATHSEG_CURVETO_CUBIC_REL: number; - readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - readonly PATHSEG_CURVETO_QUADRATIC_ABS: number; - readonly PATHSEG_CURVETO_QUADRATIC_REL: number; - readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; - readonly PATHSEG_LINETO_ABS: number; - readonly PATHSEG_LINETO_HORIZONTAL_ABS: number; - readonly PATHSEG_LINETO_HORIZONTAL_REL: number; - readonly PATHSEG_LINETO_REL: number; - readonly PATHSEG_LINETO_VERTICAL_ABS: number; - readonly PATHSEG_LINETO_VERTICAL_REL: number; - readonly PATHSEG_MOVETO_ABS: number; - readonly PATHSEG_MOVETO_REL: number; - readonly PATHSEG_UNKNOWN: number; -} - -declare var SVGPathSeg: { - prototype: SVGPathSeg; - new(): SVGPathSeg; - readonly PATHSEG_ARC_ABS: number; - readonly PATHSEG_ARC_REL: number; - readonly PATHSEG_CLOSEPATH: number; - readonly PATHSEG_CURVETO_CUBIC_ABS: number; - readonly PATHSEG_CURVETO_CUBIC_REL: number; - readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - readonly PATHSEG_CURVETO_QUADRATIC_ABS: number; - readonly PATHSEG_CURVETO_QUADRATIC_REL: number; - readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; - readonly PATHSEG_LINETO_ABS: number; - readonly PATHSEG_LINETO_HORIZONTAL_ABS: number; - readonly PATHSEG_LINETO_HORIZONTAL_REL: number; - readonly PATHSEG_LINETO_REL: number; - readonly PATHSEG_LINETO_VERTICAL_ABS: number; - readonly PATHSEG_LINETO_VERTICAL_REL: number; - readonly PATHSEG_MOVETO_ABS: number; - readonly PATHSEG_MOVETO_REL: number; - readonly PATHSEG_UNKNOWN: number; -} - -interface SVGPathSegArcAbs extends SVGPathSeg { - angle: number; - largeArcFlag: boolean; - r1: number; - r2: number; - sweepFlag: boolean; - x: number; - y: number; -} - -declare var SVGPathSegArcAbs: { - prototype: SVGPathSegArcAbs; - new(): SVGPathSegArcAbs; -} - -interface SVGPathSegArcRel extends SVGPathSeg { - angle: number; - largeArcFlag: boolean; - r1: number; - r2: number; - sweepFlag: boolean; - x: number; - y: number; -} - -declare var SVGPathSegArcRel: { - prototype: SVGPathSegArcRel; - new(): SVGPathSegArcRel; -} - -interface SVGPathSegClosePath extends SVGPathSeg { -} - -declare var SVGPathSegClosePath: { - prototype: SVGPathSegClosePath; - new(): SVGPathSegClosePath; -} - -interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { - x: number; - x1: number; - x2: number; - y: number; - y1: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicAbs: { - prototype: SVGPathSegCurvetoCubicAbs; - new(): SVGPathSegCurvetoCubicAbs; -} - -interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { - x: number; - x1: number; - x2: number; - y: number; - y1: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicRel: { - prototype: SVGPathSegCurvetoCubicRel; - new(): SVGPathSegCurvetoCubicRel; -} - -interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { - x: number; - x2: number; - y: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicSmoothAbs: { - prototype: SVGPathSegCurvetoCubicSmoothAbs; - new(): SVGPathSegCurvetoCubicSmoothAbs; -} - -interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { - x: number; - x2: number; - y: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicSmoothRel: { - prototype: SVGPathSegCurvetoCubicSmoothRel; - new(): SVGPathSegCurvetoCubicSmoothRel; -} - -interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { - x: number; - x1: number; - y: number; - y1: number; -} - -declare var SVGPathSegCurvetoQuadraticAbs: { - prototype: SVGPathSegCurvetoQuadraticAbs; - new(): SVGPathSegCurvetoQuadraticAbs; -} - -interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { - x: number; - x1: number; - y: number; - y1: number; -} - -declare var SVGPathSegCurvetoQuadraticRel: { - prototype: SVGPathSegCurvetoQuadraticRel; - new(): SVGPathSegCurvetoQuadraticRel; -} - -interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegCurvetoQuadraticSmoothAbs: { - prototype: SVGPathSegCurvetoQuadraticSmoothAbs; - new(): SVGPathSegCurvetoQuadraticSmoothAbs; -} - -interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegCurvetoQuadraticSmoothRel: { - prototype: SVGPathSegCurvetoQuadraticSmoothRel; - new(): SVGPathSegCurvetoQuadraticSmoothRel; -} - -interface SVGPathSegLinetoAbs extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegLinetoAbs: { - prototype: SVGPathSegLinetoAbs; - new(): SVGPathSegLinetoAbs; -} - -interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { - x: number; -} - -declare var SVGPathSegLinetoHorizontalAbs: { - prototype: SVGPathSegLinetoHorizontalAbs; - new(): SVGPathSegLinetoHorizontalAbs; -} - -interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { - x: number; -} - -declare var SVGPathSegLinetoHorizontalRel: { - prototype: SVGPathSegLinetoHorizontalRel; - new(): SVGPathSegLinetoHorizontalRel; -} - -interface SVGPathSegLinetoRel extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegLinetoRel: { - prototype: SVGPathSegLinetoRel; - new(): SVGPathSegLinetoRel; -} - -interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { - y: number; -} - -declare var SVGPathSegLinetoVerticalAbs: { - prototype: SVGPathSegLinetoVerticalAbs; - new(): SVGPathSegLinetoVerticalAbs; -} - -interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { - y: number; -} - -declare var SVGPathSegLinetoVerticalRel: { - prototype: SVGPathSegLinetoVerticalRel; - new(): SVGPathSegLinetoVerticalRel; -} - -interface SVGPathSegList { - readonly numberOfItems: number; - appendItem(newItem: SVGPathSeg): SVGPathSeg; - clear(): void; - getItem(index: number): SVGPathSeg; - initialize(newItem: SVGPathSeg): SVGPathSeg; - insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; - removeItem(index: number): SVGPathSeg; - replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; -} - -declare var SVGPathSegList: { - prototype: SVGPathSegList; - new(): SVGPathSegList; -} - -interface SVGPathSegMovetoAbs extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegMovetoAbs: { - prototype: SVGPathSegMovetoAbs; - new(): SVGPathSegMovetoAbs; -} - -interface SVGPathSegMovetoRel extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegMovetoRel: { - prototype: SVGPathSegMovetoRel; - new(): SVGPathSegMovetoRel; -} - -interface SVGPatternElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGURIReference, SVGUnitTypes { - readonly height: SVGAnimatedLength; - readonly patternContentUnits: SVGAnimatedEnumeration; - readonly patternTransform: SVGAnimatedTransformList; - readonly patternUnits: SVGAnimatedEnumeration; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPatternElement: { - prototype: SVGPatternElement; - new(): SVGPatternElement; -} - -interface SVGPoint { - x: number; - y: number; - matrixTransform(matrix: SVGMatrix): SVGPoint; -} - -declare var SVGPoint: { - prototype: SVGPoint; - new(): SVGPoint; -} - -interface SVGPointList { - readonly numberOfItems: number; - appendItem(newItem: SVGPoint): SVGPoint; - clear(): void; - getItem(index: number): SVGPoint; - initialize(newItem: SVGPoint): SVGPoint; - insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; - removeItem(index: number): SVGPoint; - replaceItem(newItem: SVGPoint, index: number): SVGPoint; -} - -declare var SVGPointList: { - prototype: SVGPointList; - new(): SVGPointList; -} - -interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPolygonElement: { - prototype: SVGPolygonElement; - new(): SVGPolygonElement; -} - -interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPolylineElement: { - prototype: SVGPolylineElement; - new(): SVGPolylineElement; -} - -interface SVGPreserveAspectRatio { - align: number; - meetOrSlice: number; - readonly SVG_MEETORSLICE_MEET: number; - readonly SVG_MEETORSLICE_SLICE: number; - readonly SVG_MEETORSLICE_UNKNOWN: number; - readonly SVG_PRESERVEASPECTRATIO_NONE: number; - readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number; -} - -declare var SVGPreserveAspectRatio: { - prototype: SVGPreserveAspectRatio; - new(): SVGPreserveAspectRatio; - readonly SVG_MEETORSLICE_MEET: number; - readonly SVG_MEETORSLICE_SLICE: number; - readonly SVG_MEETORSLICE_UNKNOWN: number; - readonly SVG_PRESERVEASPECTRATIO_NONE: number; - readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number; -} - -interface SVGRadialGradientElement extends SVGGradientElement { - readonly cx: SVGAnimatedLength; - readonly cy: SVGAnimatedLength; - readonly fx: SVGAnimatedLength; - readonly fy: SVGAnimatedLength; - readonly r: SVGAnimatedLength; -} - -declare var SVGRadialGradientElement: { - prototype: SVGRadialGradientElement; - new(): SVGRadialGradientElement; -} - -interface SVGRect { - height: number; - width: number; - x: number; - y: number; -} - -declare var SVGRect: { - prototype: SVGRect; - new(): SVGRect; -} - -interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly height: SVGAnimatedLength; - readonly rx: SVGAnimatedLength; - readonly ry: SVGAnimatedLength; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGRectElement: { - prototype: SVGRectElement; - new(): SVGRectElement; -} - -interface SVGSVGElement extends SVGElement, DocumentEvent, SVGLocatable, SVGTests, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan { - contentScriptType: string; - contentStyleType: string; - currentScale: number; - readonly currentTranslate: SVGPoint; - readonly height: SVGAnimatedLength; - onabort: (this: this, ev: Event) => any; - onerror: (this: this, ev: Event) => any; - onresize: (this: this, ev: UIEvent) => any; - onscroll: (this: this, ev: UIEvent) => any; - onunload: (this: this, ev: Event) => any; - onzoom: (this: this, ev: SVGZoomEvent) => any; - readonly pixelUnitToMillimeterX: number; - readonly pixelUnitToMillimeterY: number; - readonly screenPixelToMillimeterX: number; - readonly screenPixelToMillimeterY: number; - readonly viewport: SVGRect; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - checkEnclosure(element: SVGElement, rect: SVGRect): boolean; - checkIntersection(element: SVGElement, rect: SVGRect): boolean; - createSVGAngle(): SVGAngle; - createSVGLength(): SVGLength; - createSVGMatrix(): SVGMatrix; - createSVGNumber(): SVGNumber; - createSVGPoint(): SVGPoint; - createSVGRect(): SVGRect; - createSVGTransform(): SVGTransform; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; - deselectAll(): void; - forceRedraw(): void; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - getCurrentTime(): number; - getElementById(elementId: string): Element; - getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeListOf; - getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeListOf; - pauseAnimations(): void; - setCurrentTime(seconds: number): void; - suspendRedraw(maxWaitMilliseconds: number): number; - unpauseAnimations(): void; - unsuspendRedraw(suspendHandleID: number): void; - unsuspendRedrawAll(): void; - addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "SVGAbort", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "SVGError", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "SVGUnload", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "SVGZoom", listener: (this: this, ev: SVGZoomEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (this: this, ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (this: this, ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGSVGElement: { - prototype: SVGSVGElement; - new(): SVGSVGElement; -} - -interface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference { - type: string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGScriptElement: { - prototype: SVGScriptElement; - new(): SVGScriptElement; -} - -interface SVGStopElement extends SVGElement, SVGStylable { - readonly offset: SVGAnimatedNumber; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGStopElement: { - prototype: SVGStopElement; - new(): SVGStopElement; -} - -interface SVGStringList { - readonly numberOfItems: number; - appendItem(newItem: string): string; - clear(): void; - getItem(index: number): string; - initialize(newItem: string): string; - insertItemBefore(newItem: string, index: number): string; - removeItem(index: number): string; - replaceItem(newItem: string, index: number): string; -} - -declare var SVGStringList: { - prototype: SVGStringList; - new(): SVGStringList; -} - -interface SVGStyleElement extends SVGElement, SVGLangSpace { - disabled: boolean; - media: string; - title: string; - type: string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGStyleElement: { - prototype: SVGStyleElement; - new(): SVGStyleElement; -} - -interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGSwitchElement: { - prototype: SVGSwitchElement; - new(): SVGSwitchElement; -} - -interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGSymbolElement: { - prototype: SVGSymbolElement; - new(): SVGSymbolElement; -} - -interface SVGTSpanElement extends SVGTextPositioningElement { -} - -declare var SVGTSpanElement: { - prototype: SVGTSpanElement; - new(): SVGTSpanElement; -} - -interface SVGTextContentElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly lengthAdjust: SVGAnimatedEnumeration; - readonly textLength: SVGAnimatedLength; - getCharNumAtPosition(point: SVGPoint): number; - getComputedTextLength(): number; - getEndPositionOfChar(charnum: number): SVGPoint; - getExtentOfChar(charnum: number): SVGRect; - getNumberOfChars(): number; - getRotationOfChar(charnum: number): number; - getStartPositionOfChar(charnum: number): SVGPoint; - getSubStringLength(charnum: number, nchars: number): number; - selectSubString(charnum: number, nchars: number): void; - readonly LENGTHADJUST_SPACING: number; - readonly LENGTHADJUST_SPACINGANDGLYPHS: number; - readonly LENGTHADJUST_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGTextContentElement: { - prototype: SVGTextContentElement; - new(): SVGTextContentElement; - readonly LENGTHADJUST_SPACING: number; - readonly LENGTHADJUST_SPACINGANDGLYPHS: number; - readonly LENGTHADJUST_UNKNOWN: number; -} - -interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGTextElement: { - prototype: SVGTextElement; - new(): SVGTextElement; -} - -interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { - readonly method: SVGAnimatedEnumeration; - readonly spacing: SVGAnimatedEnumeration; - readonly startOffset: SVGAnimatedLength; - readonly TEXTPATH_METHODTYPE_ALIGN: number; - readonly TEXTPATH_METHODTYPE_STRETCH: number; - readonly TEXTPATH_METHODTYPE_UNKNOWN: number; - readonly TEXTPATH_SPACINGTYPE_AUTO: number; - readonly TEXTPATH_SPACINGTYPE_EXACT: number; - readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGTextPathElement: { - prototype: SVGTextPathElement; - new(): SVGTextPathElement; - readonly TEXTPATH_METHODTYPE_ALIGN: number; - readonly TEXTPATH_METHODTYPE_STRETCH: number; - readonly TEXTPATH_METHODTYPE_UNKNOWN: number; - readonly TEXTPATH_SPACINGTYPE_AUTO: number; - readonly TEXTPATH_SPACINGTYPE_EXACT: number; - readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number; -} - -interface SVGTextPositioningElement extends SVGTextContentElement { - readonly dx: SVGAnimatedLengthList; - readonly dy: SVGAnimatedLengthList; - readonly rotate: SVGAnimatedNumberList; - readonly x: SVGAnimatedLengthList; - readonly y: SVGAnimatedLengthList; -} - -declare var SVGTextPositioningElement: { - prototype: SVGTextPositioningElement; - new(): SVGTextPositioningElement; -} - -interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGTitleElement: { - prototype: SVGTitleElement; - new(): SVGTitleElement; -} - -interface SVGTransform { - readonly angle: number; - readonly matrix: SVGMatrix; - readonly type: number; - setMatrix(matrix: SVGMatrix): void; - setRotate(angle: number, cx: number, cy: number): void; - setScale(sx: number, sy: number): void; - setSkewX(angle: number): void; - setSkewY(angle: number): void; - setTranslate(tx: number, ty: number): void; - readonly SVG_TRANSFORM_MATRIX: number; - readonly SVG_TRANSFORM_ROTATE: number; - readonly SVG_TRANSFORM_SCALE: number; - readonly SVG_TRANSFORM_SKEWX: number; - readonly SVG_TRANSFORM_SKEWY: number; - readonly SVG_TRANSFORM_TRANSLATE: number; - readonly SVG_TRANSFORM_UNKNOWN: number; -} - -declare var SVGTransform: { - prototype: SVGTransform; - new(): SVGTransform; - readonly SVG_TRANSFORM_MATRIX: number; - readonly SVG_TRANSFORM_ROTATE: number; - readonly SVG_TRANSFORM_SCALE: number; - readonly SVG_TRANSFORM_SKEWX: number; - readonly SVG_TRANSFORM_SKEWY: number; - readonly SVG_TRANSFORM_TRANSLATE: number; - readonly SVG_TRANSFORM_UNKNOWN: number; -} - -interface SVGTransformList { - readonly numberOfItems: number; - appendItem(newItem: SVGTransform): SVGTransform; - clear(): void; - consolidate(): SVGTransform; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; - getItem(index: number): SVGTransform; - initialize(newItem: SVGTransform): SVGTransform; - insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; - removeItem(index: number): SVGTransform; - replaceItem(newItem: SVGTransform, index: number): SVGTransform; -} - -declare var SVGTransformList: { - prototype: SVGTransformList; - new(): SVGTransformList; -} - -interface SVGUnitTypes { - readonly SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; - readonly SVG_UNIT_TYPE_UNKNOWN: number; - readonly SVG_UNIT_TYPE_USERSPACEONUSE: number; -} -declare var SVGUnitTypes: SVGUnitTypes; - -interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { - readonly animatedInstanceRoot: SVGElementInstance; - readonly height: SVGAnimatedLength; - readonly instanceRoot: SVGElementInstance; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGUseElement: { - prototype: SVGUseElement; - new(): SVGUseElement; -} - -interface SVGViewElement extends SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan { - readonly viewTarget: SVGStringList; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGViewElement: { - prototype: SVGViewElement; - new(): SVGViewElement; -} - -interface SVGZoomAndPan { - readonly zoomAndPan: number; -} - -declare var SVGZoomAndPan: { - readonly SVG_ZOOMANDPAN_DISABLE: number; - readonly SVG_ZOOMANDPAN_MAGNIFY: number; - readonly SVG_ZOOMANDPAN_UNKNOWN: number; -} - -interface SVGZoomEvent extends UIEvent { - readonly newScale: number; - readonly newTranslate: SVGPoint; - readonly previousScale: number; - readonly previousTranslate: SVGPoint; - readonly zoomRectScreen: SVGRect; -} - -declare var SVGZoomEvent: { - prototype: SVGZoomEvent; - new(): SVGZoomEvent; -} - -interface Screen extends EventTarget { - readonly availHeight: number; - readonly availWidth: number; - bufferDepth: number; - readonly colorDepth: number; - readonly deviceXDPI: number; - readonly deviceYDPI: number; - readonly fontSmoothingEnabled: boolean; - readonly height: number; - readonly logicalXDPI: number; - readonly logicalYDPI: number; - readonly msOrientation: string; - onmsorientationchange: (this: this, ev: Event) => any; - readonly pixelDepth: number; - readonly systemXDPI: number; - readonly systemYDPI: number; - readonly width: number; - msLockOrientation(orientations: string | string[]): boolean; - msUnlockOrientation(): void; - addEventListener(type: "MSOrientationChange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Screen: { - prototype: Screen; - new(): Screen; -} - -interface ScriptNotifyEvent extends Event { - readonly callingUri: string; - readonly value: string; -} - -declare var ScriptNotifyEvent: { - prototype: ScriptNotifyEvent; - new(): ScriptNotifyEvent; -} - -interface ScriptProcessorNode extends AudioNode { - readonly bufferSize: number; - onaudioprocess: (this: this, ev: AudioProcessingEvent) => any; - addEventListener(type: "audioprocess", listener: (this: this, ev: AudioProcessingEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var ScriptProcessorNode: { - prototype: ScriptProcessorNode; - new(): ScriptProcessorNode; -} - -interface Selection { - readonly anchorNode: Node; - readonly anchorOffset: number; - readonly focusNode: Node; - readonly focusOffset: number; - readonly isCollapsed: boolean; - readonly rangeCount: number; - readonly type: string; - addRange(range: Range): void; - collapse(parentNode: Node, offset: number): void; - collapseToEnd(): void; - collapseToStart(): void; - containsNode(node: Node, partlyContained: boolean): boolean; - deleteFromDocument(): void; - empty(): void; - extend(newNode: Node, offset: number): void; - getRangeAt(index: number): Range; - removeAllRanges(): void; - removeRange(range: Range): void; - selectAllChildren(parentNode: Node): void; - setBaseAndExtent(baseNode: Node, baseOffset: number, extentNode: Node, extentOffset: number): void; - toString(): string; -} - -declare var Selection: { - prototype: Selection; - new(): Selection; -} - -interface SourceBuffer extends EventTarget { - appendWindowEnd: number; - appendWindowStart: number; - readonly audioTracks: AudioTrackList; - readonly buffered: TimeRanges; - mode: string; - timestampOffset: number; - readonly updating: boolean; - readonly videoTracks: VideoTrackList; - abort(): void; - appendBuffer(data: ArrayBuffer | ArrayBufferView): void; - appendStream(stream: MSStream, maxSize?: number): void; - remove(start: number, end: number): void; -} - -declare var SourceBuffer: { - prototype: SourceBuffer; - new(): SourceBuffer; -} - -interface SourceBufferList extends EventTarget { - readonly length: number; - item(index: number): SourceBuffer; - [index: number]: SourceBuffer; -} - -declare var SourceBufferList: { - prototype: SourceBufferList; - new(): SourceBufferList; -} - -interface StereoPannerNode extends AudioNode { - readonly pan: AudioParam; -} - -declare var StereoPannerNode: { - prototype: StereoPannerNode; - new(): StereoPannerNode; -} - -interface Storage { - readonly length: number; - clear(): void; - getItem(key: string): string | null; - key(index: number): string | null; - removeItem(key: string): void; - setItem(key: string, data: string): void; - [key: string]: any; - [index: number]: string; -} - -declare var Storage: { - prototype: Storage; - new(): Storage; -} - -interface StorageEvent extends Event { - readonly url: string; - key?: string; - oldValue?: string; - newValue?: string; - storageArea?: Storage; -} - -declare var StorageEvent: { - prototype: StorageEvent; - new (type: string, eventInitDict?: StorageEventInit): StorageEvent; -} - -interface StyleMedia { - readonly type: string; - matchMedium(mediaquery: string): boolean; -} - -declare var StyleMedia: { - prototype: StyleMedia; - new(): StyleMedia; -} - -interface StyleSheet { - disabled: boolean; - readonly href: string; - readonly media: MediaList; - readonly ownerNode: Node; - readonly parentStyleSheet: StyleSheet; - readonly title: string; - readonly type: string; -} - -declare var StyleSheet: { - prototype: StyleSheet; - new(): StyleSheet; -} - -interface StyleSheetList { - readonly length: number; - item(index?: number): StyleSheet; - [index: number]: StyleSheet; -} - -declare var StyleSheetList: { - prototype: StyleSheetList; - new(): StyleSheetList; -} - -interface StyleSheetPageList { - readonly length: number; - item(index: number): CSSPageRule; - [index: number]: CSSPageRule; -} - -declare var StyleSheetPageList: { - prototype: StyleSheetPageList; - new(): StyleSheetPageList; -} - -interface SubtleCrypto { - decrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): PromiseLike; - deriveBits(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, length: number): PromiseLike; - deriveKey(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike; - digest(algorithm: AlgorithmIdentifier, data: BufferSource): PromiseLike; - encrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): PromiseLike; - exportKey(format: "jwk", key: CryptoKey): PromiseLike; - exportKey(format: "raw" | "pkcs8" | "spki", key: CryptoKey): PromiseLike; - exportKey(format: string, key: CryptoKey): PromiseLike; - generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): PromiseLike; - generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: string[]): PromiseLike; - generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike; - importKey(format: "jwk", keyData: JsonWebKey, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike; - importKey(format: "raw" | "pkcs8" | "spki", keyData: BufferSource, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike; - importKey(format: string, keyData: JsonWebKey | BufferSource, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike; - sign(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, data: BufferSource): PromiseLike; - unwrapKey(format: string, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: string[]): PromiseLike; - verify(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, signature: BufferSource, data: BufferSource): PromiseLike; - wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier): PromiseLike; -} - -declare var SubtleCrypto: { - prototype: SubtleCrypto; - new(): SubtleCrypto; -} - -interface Text extends CharacterData { - readonly wholeText: string; - splitText(offset: number): Text; -} - -declare var Text: { - prototype: Text; - new(): Text; -} - -interface TextEvent extends UIEvent { - readonly data: string; - readonly inputMethod: number; - readonly locale: string; - initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; - readonly DOM_INPUT_METHOD_DROP: number; - readonly DOM_INPUT_METHOD_HANDWRITING: number; - readonly DOM_INPUT_METHOD_IME: number; - readonly DOM_INPUT_METHOD_KEYBOARD: number; - readonly DOM_INPUT_METHOD_MULTIMODAL: number; - readonly DOM_INPUT_METHOD_OPTION: number; - readonly DOM_INPUT_METHOD_PASTE: number; - readonly DOM_INPUT_METHOD_SCRIPT: number; - readonly DOM_INPUT_METHOD_UNKNOWN: number; - readonly DOM_INPUT_METHOD_VOICE: number; -} - -declare var TextEvent: { - prototype: TextEvent; - new(): TextEvent; - readonly DOM_INPUT_METHOD_DROP: number; - readonly DOM_INPUT_METHOD_HANDWRITING: number; - readonly DOM_INPUT_METHOD_IME: number; - readonly DOM_INPUT_METHOD_KEYBOARD: number; - readonly DOM_INPUT_METHOD_MULTIMODAL: number; - readonly DOM_INPUT_METHOD_OPTION: number; - readonly DOM_INPUT_METHOD_PASTE: number; - readonly DOM_INPUT_METHOD_SCRIPT: number; - readonly DOM_INPUT_METHOD_UNKNOWN: number; - readonly DOM_INPUT_METHOD_VOICE: number; -} - -interface TextMetrics { - readonly width: number; -} - -declare var TextMetrics: { - prototype: TextMetrics; - new(): TextMetrics; -} - -interface TextTrack extends EventTarget { - readonly activeCues: TextTrackCueList; - readonly cues: TextTrackCueList; - readonly inBandMetadataTrackDispatchType: string; - readonly kind: string; - readonly label: string; - readonly language: string; - mode: any; - oncuechange: (this: this, ev: Event) => any; - onerror: (this: this, ev: ErrorEvent) => any; - onload: (this: this, ev: Event) => any; - readonly readyState: number; - addCue(cue: TextTrackCue): void; - removeCue(cue: TextTrackCue): void; - readonly DISABLED: number; - readonly ERROR: number; - readonly HIDDEN: number; - readonly LOADED: number; - readonly LOADING: number; - readonly NONE: number; - readonly SHOWING: number; - addEventListener(type: "cuechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var TextTrack: { - prototype: TextTrack; - new(): TextTrack; - readonly DISABLED: number; - readonly ERROR: number; - readonly HIDDEN: number; - readonly LOADED: number; - readonly LOADING: number; - readonly NONE: number; - readonly SHOWING: number; -} - -interface TextTrackCue extends EventTarget { - endTime: number; - id: string; - onenter: (this: this, ev: Event) => any; - onexit: (this: this, ev: Event) => any; - pauseOnExit: boolean; - startTime: number; - text: string; - readonly track: TextTrack; - getCueAsHTML(): DocumentFragment; - addEventListener(type: "enter", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "exit", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var TextTrackCue: { - prototype: TextTrackCue; - new(startTime: number, endTime: number, text: string): TextTrackCue; -} - -interface TextTrackCueList { - readonly length: number; - getCueById(id: string): TextTrackCue; - item(index: number): TextTrackCue; - [index: number]: TextTrackCue; -} - -declare var TextTrackCueList: { - prototype: TextTrackCueList; - new(): TextTrackCueList; -} - -interface TextTrackList extends EventTarget { - readonly length: number; - onaddtrack: ((this: this, ev: TrackEvent) => any) | null; - item(index: number): TextTrack; - addEventListener(type: "addtrack", listener: (this: this, ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [index: number]: TextTrack; -} - -declare var TextTrackList: { - prototype: TextTrackList; - new(): TextTrackList; -} - -interface TimeRanges { - readonly length: number; - end(index: number): number; - start(index: number): number; -} - -declare var TimeRanges: { - prototype: TimeRanges; - new(): TimeRanges; -} - -interface Touch { - readonly clientX: number; - readonly clientY: number; - readonly identifier: number; - readonly pageX: number; - readonly pageY: number; - readonly screenX: number; - readonly screenY: number; - readonly target: EventTarget; -} - -declare var Touch: { - prototype: Touch; - new(): Touch; -} - -interface TouchEvent extends UIEvent { - readonly altKey: boolean; - readonly changedTouches: TouchList; - readonly ctrlKey: boolean; - readonly metaKey: boolean; - readonly shiftKey: boolean; - readonly targetTouches: TouchList; - readonly touches: TouchList; -} - -declare var TouchEvent: { - prototype: TouchEvent; - new(): TouchEvent; -} - -interface TouchList { - readonly length: number; - item(index: number): Touch | null; - [index: number]: Touch; -} - -declare var TouchList: { - prototype: TouchList; - new(): TouchList; -} - -interface TrackEvent extends Event { - readonly track: any; -} - -declare var TrackEvent: { - prototype: TrackEvent; - new(): TrackEvent; -} - -interface TransitionEvent extends Event { - readonly elapsedTime: number; - readonly propertyName: string; - initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; -} - -declare var TransitionEvent: { - prototype: TransitionEvent; - new(): TransitionEvent; -} - -interface TreeWalker { - currentNode: Node; - readonly expandEntityReferences: boolean; - readonly filter: NodeFilter; - readonly root: Node; - readonly whatToShow: number; - firstChild(): Node; - lastChild(): Node; - nextNode(): Node; - nextSibling(): Node; - parentNode(): Node; - previousNode(): Node; - previousSibling(): Node; -} - -declare var TreeWalker: { - prototype: TreeWalker; - new(): TreeWalker; -} - -interface UIEvent extends Event { - readonly detail: number; - readonly view: Window; - initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; -} - -declare var UIEvent: { - prototype: UIEvent; - new(type: string, eventInitDict?: UIEventInit): UIEvent; -} - -interface URL { - hash: string; - host: string; - hostname: string; - href: string; - readonly origin: string; - password: string; - pathname: string; - port: string; - protocol: string; - search: string; - username: string; - toString(): string; -} - -declare var URL: { - prototype: URL; - new(url: string, base?: string): URL; - createObjectURL(object: any, options?: ObjectURLOptions): string; - revokeObjectURL(url: string): void; -} - -interface UnviewableContentIdentifiedEvent extends NavigationEventWithReferrer { - readonly mediaType: string; -} - -declare var UnviewableContentIdentifiedEvent: { - prototype: UnviewableContentIdentifiedEvent; - new(): UnviewableContentIdentifiedEvent; -} - -interface ValidityState { - readonly badInput: boolean; - readonly customError: boolean; - readonly patternMismatch: boolean; - readonly rangeOverflow: boolean; - readonly rangeUnderflow: boolean; - readonly stepMismatch: boolean; - readonly tooLong: boolean; - readonly typeMismatch: boolean; - readonly valid: boolean; - readonly valueMissing: boolean; -} - -declare var ValidityState: { - prototype: ValidityState; - new(): ValidityState; -} - -interface VideoPlaybackQuality { - readonly corruptedVideoFrames: number; - readonly creationTime: number; - readonly droppedVideoFrames: number; - readonly totalFrameDelay: number; - readonly totalVideoFrames: number; -} - -declare var VideoPlaybackQuality: { - prototype: VideoPlaybackQuality; - new(): VideoPlaybackQuality; -} - -interface VideoTrack { - readonly id: string; - kind: string; - readonly label: string; - language: string; - selected: boolean; - readonly sourceBuffer: SourceBuffer; -} - -declare var VideoTrack: { - prototype: VideoTrack; - new(): VideoTrack; -} - -interface VideoTrackList extends EventTarget { - readonly length: number; - onaddtrack: (this: this, ev: TrackEvent) => any; - onchange: (this: this, ev: Event) => any; - onremovetrack: (this: this, ev: TrackEvent) => any; - readonly selectedIndex: number; - getTrackById(id: string): VideoTrack | null; - item(index: number): VideoTrack; - addEventListener(type: "addtrack", listener: (this: this, ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "removetrack", listener: (this: this, ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [index: number]: VideoTrack; -} - -declare var VideoTrackList: { - prototype: VideoTrackList; - new(): VideoTrackList; -} - -interface WEBGL_compressed_texture_s3tc { - readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} - -declare var WEBGL_compressed_texture_s3tc: { - prototype: WEBGL_compressed_texture_s3tc; - new(): WEBGL_compressed_texture_s3tc; - readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} - -interface WEBGL_debug_renderer_info { - readonly UNMASKED_RENDERER_WEBGL: number; - readonly UNMASKED_VENDOR_WEBGL: number; -} - -declare var WEBGL_debug_renderer_info: { - prototype: WEBGL_debug_renderer_info; - new(): WEBGL_debug_renderer_info; - readonly UNMASKED_RENDERER_WEBGL: number; - readonly UNMASKED_VENDOR_WEBGL: number; -} - -interface WEBGL_depth_texture { - readonly UNSIGNED_INT_24_8_WEBGL: number; -} - -declare var WEBGL_depth_texture: { - prototype: WEBGL_depth_texture; - new(): WEBGL_depth_texture; - readonly UNSIGNED_INT_24_8_WEBGL: number; -} - -interface WaveShaperNode extends AudioNode { - curve: Float32Array | null; - oversample: string; -} - -declare var WaveShaperNode: { - prototype: WaveShaperNode; - new(): WaveShaperNode; -} - -interface WebGLActiveInfo { - readonly name: string; - readonly size: number; - readonly type: number; -} - -declare var WebGLActiveInfo: { - prototype: WebGLActiveInfo; - new(): WebGLActiveInfo; -} - -interface WebGLBuffer extends WebGLObject { -} - -declare var WebGLBuffer: { - prototype: WebGLBuffer; - new(): WebGLBuffer; -} - -interface WebGLContextEvent extends Event { - readonly statusMessage: string; -} - -declare var WebGLContextEvent: { - prototype: WebGLContextEvent; - new(type: string, eventInitDict?: WebGLContextEventInit): WebGLContextEvent; -} - -interface WebGLFramebuffer extends WebGLObject { -} - -declare var WebGLFramebuffer: { - prototype: WebGLFramebuffer; - new(): WebGLFramebuffer; -} - -interface WebGLObject { -} - -declare var WebGLObject: { - prototype: WebGLObject; - new(): WebGLObject; -} - -interface WebGLProgram extends WebGLObject { -} - -declare var WebGLProgram: { - prototype: WebGLProgram; - new(): WebGLProgram; -} - -interface WebGLRenderbuffer extends WebGLObject { -} - -declare var WebGLRenderbuffer: { - prototype: WebGLRenderbuffer; - new(): WebGLRenderbuffer; -} - -interface WebGLRenderingContext { - readonly canvas: HTMLCanvasElement; - readonly drawingBufferHeight: number; - readonly drawingBufferWidth: number; - activeTexture(texture: number): void; - attachShader(program: WebGLProgram | null, shader: WebGLShader | null): void; - bindAttribLocation(program: WebGLProgram | null, index: number, name: string): void; - bindBuffer(target: number, buffer: WebGLBuffer | null): void; - bindFramebuffer(target: number, framebuffer: WebGLFramebuffer | null): void; - bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer | null): void; - bindTexture(target: number, texture: WebGLTexture | null): void; - blendColor(red: number, green: number, blue: number, alpha: number): void; - blendEquation(mode: number): void; - blendEquationSeparate(modeRGB: number, modeAlpha: number): void; - blendFunc(sfactor: number, dfactor: number): void; - blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; - bufferData(target: number, size: number | ArrayBufferView | ArrayBuffer, usage: number): void; - bufferSubData(target: number, offset: number, data: ArrayBufferView | ArrayBuffer): void; - checkFramebufferStatus(target: number): number; - clear(mask: number): void; - clearColor(red: number, green: number, blue: number, alpha: number): void; - clearDepth(depth: number): void; - clearStencil(s: number): void; - colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; - compileShader(shader: WebGLShader | null): void; - compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; - compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; - copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; - copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; - createBuffer(): WebGLBuffer | null; - createFramebuffer(): WebGLFramebuffer | null; - createProgram(): WebGLProgram | null; - createRenderbuffer(): WebGLRenderbuffer | null; - createShader(type: number): WebGLShader | null; - createTexture(): WebGLTexture | null; - cullFace(mode: number): void; - deleteBuffer(buffer: WebGLBuffer | null): void; - deleteFramebuffer(framebuffer: WebGLFramebuffer | null): void; - deleteProgram(program: WebGLProgram | null): void; - deleteRenderbuffer(renderbuffer: WebGLRenderbuffer | null): void; - deleteShader(shader: WebGLShader | null): void; - deleteTexture(texture: WebGLTexture | null): void; - depthFunc(func: number): void; - depthMask(flag: boolean): void; - depthRange(zNear: number, zFar: number): void; - detachShader(program: WebGLProgram | null, shader: WebGLShader | null): void; - disable(cap: number): void; - disableVertexAttribArray(index: number): void; - drawArrays(mode: number, first: number, count: number): void; - drawElements(mode: number, count: number, type: number, offset: number): void; - enable(cap: number): void; - enableVertexAttribArray(index: number): void; - finish(): void; - flush(): void; - framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer | null): void; - framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture | null, level: number): void; - frontFace(mode: number): void; - generateMipmap(target: number): void; - getActiveAttrib(program: WebGLProgram | null, index: number): WebGLActiveInfo | null; - getActiveUniform(program: WebGLProgram | null, index: number): WebGLActiveInfo | null; - getAttachedShaders(program: WebGLProgram | null): WebGLShader[] | null; - getAttribLocation(program: WebGLProgram | null, name: string): number; - getBufferParameter(target: number, pname: number): any; - getContextAttributes(): WebGLContextAttributes; - getError(): number; - getExtension(name: string): any; - getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; - getParameter(pname: number): any; - getProgramInfoLog(program: WebGLProgram | null): string | null; - getProgramParameter(program: WebGLProgram | null, pname: number): any; - getRenderbufferParameter(target: number, pname: number): any; - getShaderInfoLog(shader: WebGLShader | null): string | null; - getShaderParameter(shader: WebGLShader | null, pname: number): any; - getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat | null; - getShaderSource(shader: WebGLShader | null): string | null; - getSupportedExtensions(): string[] | null; - getTexParameter(target: number, pname: number): any; - getUniform(program: WebGLProgram | null, location: WebGLUniformLocation | null): any; - getUniformLocation(program: WebGLProgram | null, name: string): WebGLUniformLocation | null; - getVertexAttrib(index: number, pname: number): any; - getVertexAttribOffset(index: number, pname: number): number; - hint(target: number, mode: number): void; - isBuffer(buffer: WebGLBuffer | null): boolean; - isContextLost(): boolean; - isEnabled(cap: number): boolean; - isFramebuffer(framebuffer: WebGLFramebuffer | null): boolean; - isProgram(program: WebGLProgram | null): boolean; - isRenderbuffer(renderbuffer: WebGLRenderbuffer | null): boolean; - isShader(shader: WebGLShader | null): boolean; - isTexture(texture: WebGLTexture | null): boolean; - lineWidth(width: number): void; - linkProgram(program: WebGLProgram | null): void; - pixelStorei(pname: number, param: number): void; - polygonOffset(factor: number, units: number): void; - readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void; - renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; - sampleCoverage(value: number, invert: boolean): void; - scissor(x: number, y: number, width: number, height: number): void; - shaderSource(shader: WebGLShader | null, source: string): void; - stencilFunc(func: number, ref: number, mask: number): void; - stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; - stencilMask(mask: number): void; - stencilMaskSeparate(face: number, mask: number): void; - stencilOp(fail: number, zfail: number, zpass: number): void; - stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; - texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels?: ArrayBufferView): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels?: ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void; - texParameterf(target: number, pname: number, param: number): void; - texParameteri(target: number, pname: number, param: number): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels?: ArrayBufferView): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels?: ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void; - uniform1f(location: WebGLUniformLocation | null, x: number): void; - uniform1fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; - uniform1i(location: WebGLUniformLocation | null, x: number): void; - uniform1iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniform2f(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; - uniform2i(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniform3f(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; - uniform3i(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniform4f(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; - uniform4i(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - useProgram(program: WebGLProgram | null): void; - validateProgram(program: WebGLProgram | null): void; - vertexAttrib1f(indx: number, x: number): void; - vertexAttrib1fv(indx: number, values: Float32Array | number[]): void; - vertexAttrib2f(indx: number, x: number, y: number): void; - vertexAttrib2fv(indx: number, values: Float32Array | number[]): void; - vertexAttrib3f(indx: number, x: number, y: number, z: number): void; - vertexAttrib3fv(indx: number, values: Float32Array | number[]): void; - vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; - vertexAttrib4fv(indx: number, values: Float32Array | number[]): void; - vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; - viewport(x: number, y: number, width: number, height: number): void; - readonly ACTIVE_ATTRIBUTES: number; - readonly ACTIVE_TEXTURE: number; - readonly ACTIVE_UNIFORMS: number; - readonly ALIASED_LINE_WIDTH_RANGE: number; - readonly ALIASED_POINT_SIZE_RANGE: number; - readonly ALPHA: number; - readonly ALPHA_BITS: number; - readonly ALWAYS: number; - readonly ARRAY_BUFFER: number; - readonly ARRAY_BUFFER_BINDING: number; - readonly ATTACHED_SHADERS: number; - readonly BACK: number; - readonly BLEND: number; - readonly BLEND_COLOR: number; - readonly BLEND_DST_ALPHA: number; - readonly BLEND_DST_RGB: number; - readonly BLEND_EQUATION: number; - readonly BLEND_EQUATION_ALPHA: number; - readonly BLEND_EQUATION_RGB: number; - readonly BLEND_SRC_ALPHA: number; - readonly BLEND_SRC_RGB: number; - readonly BLUE_BITS: number; - readonly BOOL: number; - readonly BOOL_VEC2: number; - readonly BOOL_VEC3: number; - readonly BOOL_VEC4: number; - readonly BROWSER_DEFAULT_WEBGL: number; - readonly BUFFER_SIZE: number; - readonly BUFFER_USAGE: number; - readonly BYTE: number; - readonly CCW: number; - readonly CLAMP_TO_EDGE: number; - readonly COLOR_ATTACHMENT0: number; - readonly COLOR_BUFFER_BIT: number; - readonly COLOR_CLEAR_VALUE: number; - readonly COLOR_WRITEMASK: number; - readonly COMPILE_STATUS: number; - readonly COMPRESSED_TEXTURE_FORMATS: number; - readonly CONSTANT_ALPHA: number; - readonly CONSTANT_COLOR: number; - readonly CONTEXT_LOST_WEBGL: number; - readonly CULL_FACE: number; - readonly CULL_FACE_MODE: number; - readonly CURRENT_PROGRAM: number; - readonly CURRENT_VERTEX_ATTRIB: number; - readonly CW: number; - readonly DECR: number; - readonly DECR_WRAP: number; - readonly DELETE_STATUS: number; - readonly DEPTH_ATTACHMENT: number; - readonly DEPTH_BITS: number; - readonly DEPTH_BUFFER_BIT: number; - readonly DEPTH_CLEAR_VALUE: number; - readonly DEPTH_COMPONENT: number; - readonly DEPTH_COMPONENT16: number; - readonly DEPTH_FUNC: number; - readonly DEPTH_RANGE: number; - readonly DEPTH_STENCIL: number; - readonly DEPTH_STENCIL_ATTACHMENT: number; - readonly DEPTH_TEST: number; - readonly DEPTH_WRITEMASK: number; - readonly DITHER: number; - readonly DONT_CARE: number; - readonly DST_ALPHA: number; - readonly DST_COLOR: number; - readonly DYNAMIC_DRAW: number; - readonly ELEMENT_ARRAY_BUFFER: number; - readonly ELEMENT_ARRAY_BUFFER_BINDING: number; - readonly EQUAL: number; - readonly FASTEST: number; - readonly FLOAT: number; - readonly FLOAT_MAT2: number; - readonly FLOAT_MAT3: number; - readonly FLOAT_MAT4: number; - readonly FLOAT_VEC2: number; - readonly FLOAT_VEC3: number; - readonly FLOAT_VEC4: number; - readonly FRAGMENT_SHADER: number; - readonly FRAMEBUFFER: number; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - readonly FRAMEBUFFER_BINDING: number; - readonly FRAMEBUFFER_COMPLETE: number; - readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - readonly FRAMEBUFFER_UNSUPPORTED: number; - readonly FRONT: number; - readonly FRONT_AND_BACK: number; - readonly FRONT_FACE: number; - readonly FUNC_ADD: number; - readonly FUNC_REVERSE_SUBTRACT: number; - readonly FUNC_SUBTRACT: number; - readonly GENERATE_MIPMAP_HINT: number; - readonly GEQUAL: number; - readonly GREATER: number; - readonly GREEN_BITS: number; - readonly HIGH_FLOAT: number; - readonly HIGH_INT: number; - readonly IMPLEMENTATION_COLOR_READ_FORMAT: number; - readonly IMPLEMENTATION_COLOR_READ_TYPE: number; - readonly INCR: number; - readonly INCR_WRAP: number; - readonly INT: number; - readonly INT_VEC2: number; - readonly INT_VEC3: number; - readonly INT_VEC4: number; - readonly INVALID_ENUM: number; - readonly INVALID_FRAMEBUFFER_OPERATION: number; - readonly INVALID_OPERATION: number; - readonly INVALID_VALUE: number; - readonly INVERT: number; - readonly KEEP: number; - readonly LEQUAL: number; - readonly LESS: number; - readonly LINEAR: number; - readonly LINEAR_MIPMAP_LINEAR: number; - readonly LINEAR_MIPMAP_NEAREST: number; - readonly LINES: number; - readonly LINE_LOOP: number; - readonly LINE_STRIP: number; - readonly LINE_WIDTH: number; - readonly LINK_STATUS: number; - readonly LOW_FLOAT: number; - readonly LOW_INT: number; - readonly LUMINANCE: number; - readonly LUMINANCE_ALPHA: number; - readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - readonly MAX_CUBE_MAP_TEXTURE_SIZE: number; - readonly MAX_FRAGMENT_UNIFORM_VECTORS: number; - readonly MAX_RENDERBUFFER_SIZE: number; - readonly MAX_TEXTURE_IMAGE_UNITS: number; - readonly MAX_TEXTURE_SIZE: number; - readonly MAX_VARYING_VECTORS: number; - readonly MAX_VERTEX_ATTRIBS: number; - readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - readonly MAX_VERTEX_UNIFORM_VECTORS: number; - readonly MAX_VIEWPORT_DIMS: number; - readonly MEDIUM_FLOAT: number; - readonly MEDIUM_INT: number; - readonly MIRRORED_REPEAT: number; - readonly NEAREST: number; - readonly NEAREST_MIPMAP_LINEAR: number; - readonly NEAREST_MIPMAP_NEAREST: number; - readonly NEVER: number; - readonly NICEST: number; - readonly NONE: number; - readonly NOTEQUAL: number; - readonly NO_ERROR: number; - readonly ONE: number; - readonly ONE_MINUS_CONSTANT_ALPHA: number; - readonly ONE_MINUS_CONSTANT_COLOR: number; - readonly ONE_MINUS_DST_ALPHA: number; - readonly ONE_MINUS_DST_COLOR: number; - readonly ONE_MINUS_SRC_ALPHA: number; - readonly ONE_MINUS_SRC_COLOR: number; - readonly OUT_OF_MEMORY: number; - readonly PACK_ALIGNMENT: number; - readonly POINTS: number; - readonly POLYGON_OFFSET_FACTOR: number; - readonly POLYGON_OFFSET_FILL: number; - readonly POLYGON_OFFSET_UNITS: number; - readonly RED_BITS: number; - readonly RENDERBUFFER: number; - readonly RENDERBUFFER_ALPHA_SIZE: number; - readonly RENDERBUFFER_BINDING: number; - readonly RENDERBUFFER_BLUE_SIZE: number; - readonly RENDERBUFFER_DEPTH_SIZE: number; - readonly RENDERBUFFER_GREEN_SIZE: number; - readonly RENDERBUFFER_HEIGHT: number; - readonly RENDERBUFFER_INTERNAL_FORMAT: number; - readonly RENDERBUFFER_RED_SIZE: number; - readonly RENDERBUFFER_STENCIL_SIZE: number; - readonly RENDERBUFFER_WIDTH: number; - readonly RENDERER: number; - readonly REPEAT: number; - readonly REPLACE: number; - readonly RGB: number; - readonly RGB565: number; - readonly RGB5_A1: number; - readonly RGBA: number; - readonly RGBA4: number; - readonly SAMPLER_2D: number; - readonly SAMPLER_CUBE: number; - readonly SAMPLES: number; - readonly SAMPLE_ALPHA_TO_COVERAGE: number; - readonly SAMPLE_BUFFERS: number; - readonly SAMPLE_COVERAGE: number; - readonly SAMPLE_COVERAGE_INVERT: number; - readonly SAMPLE_COVERAGE_VALUE: number; - readonly SCISSOR_BOX: number; - readonly SCISSOR_TEST: number; - readonly SHADER_TYPE: number; - readonly SHADING_LANGUAGE_VERSION: number; - readonly SHORT: number; - readonly SRC_ALPHA: number; - readonly SRC_ALPHA_SATURATE: number; - readonly SRC_COLOR: number; - readonly STATIC_DRAW: number; - readonly STENCIL_ATTACHMENT: number; - readonly STENCIL_BACK_FAIL: number; - readonly STENCIL_BACK_FUNC: number; - readonly STENCIL_BACK_PASS_DEPTH_FAIL: number; - readonly STENCIL_BACK_PASS_DEPTH_PASS: number; - readonly STENCIL_BACK_REF: number; - readonly STENCIL_BACK_VALUE_MASK: number; - readonly STENCIL_BACK_WRITEMASK: number; - readonly STENCIL_BITS: number; - readonly STENCIL_BUFFER_BIT: number; - readonly STENCIL_CLEAR_VALUE: number; - readonly STENCIL_FAIL: number; - readonly STENCIL_FUNC: number; - readonly STENCIL_INDEX: number; - readonly STENCIL_INDEX8: number; - readonly STENCIL_PASS_DEPTH_FAIL: number; - readonly STENCIL_PASS_DEPTH_PASS: number; - readonly STENCIL_REF: number; - readonly STENCIL_TEST: number; - readonly STENCIL_VALUE_MASK: number; - readonly STENCIL_WRITEMASK: number; - readonly STREAM_DRAW: number; - readonly SUBPIXEL_BITS: number; - readonly TEXTURE: number; - readonly TEXTURE0: number; - readonly TEXTURE1: number; - readonly TEXTURE10: number; - readonly TEXTURE11: number; - readonly TEXTURE12: number; - readonly TEXTURE13: number; - readonly TEXTURE14: number; - readonly TEXTURE15: number; - readonly TEXTURE16: number; - readonly TEXTURE17: number; - readonly TEXTURE18: number; - readonly TEXTURE19: number; - readonly TEXTURE2: number; - readonly TEXTURE20: number; - readonly TEXTURE21: number; - readonly TEXTURE22: number; - readonly TEXTURE23: number; - readonly TEXTURE24: number; - readonly TEXTURE25: number; - readonly TEXTURE26: number; - readonly TEXTURE27: number; - readonly TEXTURE28: number; - readonly TEXTURE29: number; - readonly TEXTURE3: number; - readonly TEXTURE30: number; - readonly TEXTURE31: number; - readonly TEXTURE4: number; - readonly TEXTURE5: number; - readonly TEXTURE6: number; - readonly TEXTURE7: number; - readonly TEXTURE8: number; - readonly TEXTURE9: number; - readonly TEXTURE_2D: number; - readonly TEXTURE_BINDING_2D: number; - readonly TEXTURE_BINDING_CUBE_MAP: number; - readonly TEXTURE_CUBE_MAP: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_X: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number; - readonly TEXTURE_MAG_FILTER: number; - readonly TEXTURE_MIN_FILTER: number; - readonly TEXTURE_WRAP_S: number; - readonly TEXTURE_WRAP_T: number; - readonly TRIANGLES: number; - readonly TRIANGLE_FAN: number; - readonly TRIANGLE_STRIP: number; - readonly UNPACK_ALIGNMENT: number; - readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - readonly UNPACK_FLIP_Y_WEBGL: number; - readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - readonly UNSIGNED_BYTE: number; - readonly UNSIGNED_INT: number; - readonly UNSIGNED_SHORT: number; - readonly UNSIGNED_SHORT_4_4_4_4: number; - readonly UNSIGNED_SHORT_5_5_5_1: number; - readonly UNSIGNED_SHORT_5_6_5: number; - readonly VALIDATE_STATUS: number; - readonly VENDOR: number; - readonly VERSION: number; - readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - readonly VERTEX_ATTRIB_ARRAY_ENABLED: number; - readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - readonly VERTEX_ATTRIB_ARRAY_POINTER: number; - readonly VERTEX_ATTRIB_ARRAY_SIZE: number; - readonly VERTEX_ATTRIB_ARRAY_STRIDE: number; - readonly VERTEX_ATTRIB_ARRAY_TYPE: number; - readonly VERTEX_SHADER: number; - readonly VIEWPORT: number; - readonly ZERO: number; -} - -declare var WebGLRenderingContext: { - prototype: WebGLRenderingContext; - new(): WebGLRenderingContext; - readonly ACTIVE_ATTRIBUTES: number; - readonly ACTIVE_TEXTURE: number; - readonly ACTIVE_UNIFORMS: number; - readonly ALIASED_LINE_WIDTH_RANGE: number; - readonly ALIASED_POINT_SIZE_RANGE: number; - readonly ALPHA: number; - readonly ALPHA_BITS: number; - readonly ALWAYS: number; - readonly ARRAY_BUFFER: number; - readonly ARRAY_BUFFER_BINDING: number; - readonly ATTACHED_SHADERS: number; - readonly BACK: number; - readonly BLEND: number; - readonly BLEND_COLOR: number; - readonly BLEND_DST_ALPHA: number; - readonly BLEND_DST_RGB: number; - readonly BLEND_EQUATION: number; - readonly BLEND_EQUATION_ALPHA: number; - readonly BLEND_EQUATION_RGB: number; - readonly BLEND_SRC_ALPHA: number; - readonly BLEND_SRC_RGB: number; - readonly BLUE_BITS: number; - readonly BOOL: number; - readonly BOOL_VEC2: number; - readonly BOOL_VEC3: number; - readonly BOOL_VEC4: number; - readonly BROWSER_DEFAULT_WEBGL: number; - readonly BUFFER_SIZE: number; - readonly BUFFER_USAGE: number; - readonly BYTE: number; - readonly CCW: number; - readonly CLAMP_TO_EDGE: number; - readonly COLOR_ATTACHMENT0: number; - readonly COLOR_BUFFER_BIT: number; - readonly COLOR_CLEAR_VALUE: number; - readonly COLOR_WRITEMASK: number; - readonly COMPILE_STATUS: number; - readonly COMPRESSED_TEXTURE_FORMATS: number; - readonly CONSTANT_ALPHA: number; - readonly CONSTANT_COLOR: number; - readonly CONTEXT_LOST_WEBGL: number; - readonly CULL_FACE: number; - readonly CULL_FACE_MODE: number; - readonly CURRENT_PROGRAM: number; - readonly CURRENT_VERTEX_ATTRIB: number; - readonly CW: number; - readonly DECR: number; - readonly DECR_WRAP: number; - readonly DELETE_STATUS: number; - readonly DEPTH_ATTACHMENT: number; - readonly DEPTH_BITS: number; - readonly DEPTH_BUFFER_BIT: number; - readonly DEPTH_CLEAR_VALUE: number; - readonly DEPTH_COMPONENT: number; - readonly DEPTH_COMPONENT16: number; - readonly DEPTH_FUNC: number; - readonly DEPTH_RANGE: number; - readonly DEPTH_STENCIL: number; - readonly DEPTH_STENCIL_ATTACHMENT: number; - readonly DEPTH_TEST: number; - readonly DEPTH_WRITEMASK: number; - readonly DITHER: number; - readonly DONT_CARE: number; - readonly DST_ALPHA: number; - readonly DST_COLOR: number; - readonly DYNAMIC_DRAW: number; - readonly ELEMENT_ARRAY_BUFFER: number; - readonly ELEMENT_ARRAY_BUFFER_BINDING: number; - readonly EQUAL: number; - readonly FASTEST: number; - readonly FLOAT: number; - readonly FLOAT_MAT2: number; - readonly FLOAT_MAT3: number; - readonly FLOAT_MAT4: number; - readonly FLOAT_VEC2: number; - readonly FLOAT_VEC3: number; - readonly FLOAT_VEC4: number; - readonly FRAGMENT_SHADER: number; - readonly FRAMEBUFFER: number; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - readonly FRAMEBUFFER_BINDING: number; - readonly FRAMEBUFFER_COMPLETE: number; - readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - readonly FRAMEBUFFER_UNSUPPORTED: number; - readonly FRONT: number; - readonly FRONT_AND_BACK: number; - readonly FRONT_FACE: number; - readonly FUNC_ADD: number; - readonly FUNC_REVERSE_SUBTRACT: number; - readonly FUNC_SUBTRACT: number; - readonly GENERATE_MIPMAP_HINT: number; - readonly GEQUAL: number; - readonly GREATER: number; - readonly GREEN_BITS: number; - readonly HIGH_FLOAT: number; - readonly HIGH_INT: number; - readonly IMPLEMENTATION_COLOR_READ_FORMAT: number; - readonly IMPLEMENTATION_COLOR_READ_TYPE: number; - readonly INCR: number; - readonly INCR_WRAP: number; - readonly INT: number; - readonly INT_VEC2: number; - readonly INT_VEC3: number; - readonly INT_VEC4: number; - readonly INVALID_ENUM: number; - readonly INVALID_FRAMEBUFFER_OPERATION: number; - readonly INVALID_OPERATION: number; - readonly INVALID_VALUE: number; - readonly INVERT: number; - readonly KEEP: number; - readonly LEQUAL: number; - readonly LESS: number; - readonly LINEAR: number; - readonly LINEAR_MIPMAP_LINEAR: number; - readonly LINEAR_MIPMAP_NEAREST: number; - readonly LINES: number; - readonly LINE_LOOP: number; - readonly LINE_STRIP: number; - readonly LINE_WIDTH: number; - readonly LINK_STATUS: number; - readonly LOW_FLOAT: number; - readonly LOW_INT: number; - readonly LUMINANCE: number; - readonly LUMINANCE_ALPHA: number; - readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - readonly MAX_CUBE_MAP_TEXTURE_SIZE: number; - readonly MAX_FRAGMENT_UNIFORM_VECTORS: number; - readonly MAX_RENDERBUFFER_SIZE: number; - readonly MAX_TEXTURE_IMAGE_UNITS: number; - readonly MAX_TEXTURE_SIZE: number; - readonly MAX_VARYING_VECTORS: number; - readonly MAX_VERTEX_ATTRIBS: number; - readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - readonly MAX_VERTEX_UNIFORM_VECTORS: number; - readonly MAX_VIEWPORT_DIMS: number; - readonly MEDIUM_FLOAT: number; - readonly MEDIUM_INT: number; - readonly MIRRORED_REPEAT: number; - readonly NEAREST: number; - readonly NEAREST_MIPMAP_LINEAR: number; - readonly NEAREST_MIPMAP_NEAREST: number; - readonly NEVER: number; - readonly NICEST: number; - readonly NONE: number; - readonly NOTEQUAL: number; - readonly NO_ERROR: number; - readonly ONE: number; - readonly ONE_MINUS_CONSTANT_ALPHA: number; - readonly ONE_MINUS_CONSTANT_COLOR: number; - readonly ONE_MINUS_DST_ALPHA: number; - readonly ONE_MINUS_DST_COLOR: number; - readonly ONE_MINUS_SRC_ALPHA: number; - readonly ONE_MINUS_SRC_COLOR: number; - readonly OUT_OF_MEMORY: number; - readonly PACK_ALIGNMENT: number; - readonly POINTS: number; - readonly POLYGON_OFFSET_FACTOR: number; - readonly POLYGON_OFFSET_FILL: number; - readonly POLYGON_OFFSET_UNITS: number; - readonly RED_BITS: number; - readonly RENDERBUFFER: number; - readonly RENDERBUFFER_ALPHA_SIZE: number; - readonly RENDERBUFFER_BINDING: number; - readonly RENDERBUFFER_BLUE_SIZE: number; - readonly RENDERBUFFER_DEPTH_SIZE: number; - readonly RENDERBUFFER_GREEN_SIZE: number; - readonly RENDERBUFFER_HEIGHT: number; - readonly RENDERBUFFER_INTERNAL_FORMAT: number; - readonly RENDERBUFFER_RED_SIZE: number; - readonly RENDERBUFFER_STENCIL_SIZE: number; - readonly RENDERBUFFER_WIDTH: number; - readonly RENDERER: number; - readonly REPEAT: number; - readonly REPLACE: number; - readonly RGB: number; - readonly RGB565: number; - readonly RGB5_A1: number; - readonly RGBA: number; - readonly RGBA4: number; - readonly SAMPLER_2D: number; - readonly SAMPLER_CUBE: number; - readonly SAMPLES: number; - readonly SAMPLE_ALPHA_TO_COVERAGE: number; - readonly SAMPLE_BUFFERS: number; - readonly SAMPLE_COVERAGE: number; - readonly SAMPLE_COVERAGE_INVERT: number; - readonly SAMPLE_COVERAGE_VALUE: number; - readonly SCISSOR_BOX: number; - readonly SCISSOR_TEST: number; - readonly SHADER_TYPE: number; - readonly SHADING_LANGUAGE_VERSION: number; - readonly SHORT: number; - readonly SRC_ALPHA: number; - readonly SRC_ALPHA_SATURATE: number; - readonly SRC_COLOR: number; - readonly STATIC_DRAW: number; - readonly STENCIL_ATTACHMENT: number; - readonly STENCIL_BACK_FAIL: number; - readonly STENCIL_BACK_FUNC: number; - readonly STENCIL_BACK_PASS_DEPTH_FAIL: number; - readonly STENCIL_BACK_PASS_DEPTH_PASS: number; - readonly STENCIL_BACK_REF: number; - readonly STENCIL_BACK_VALUE_MASK: number; - readonly STENCIL_BACK_WRITEMASK: number; - readonly STENCIL_BITS: number; - readonly STENCIL_BUFFER_BIT: number; - readonly STENCIL_CLEAR_VALUE: number; - readonly STENCIL_FAIL: number; - readonly STENCIL_FUNC: number; - readonly STENCIL_INDEX: number; - readonly STENCIL_INDEX8: number; - readonly STENCIL_PASS_DEPTH_FAIL: number; - readonly STENCIL_PASS_DEPTH_PASS: number; - readonly STENCIL_REF: number; - readonly STENCIL_TEST: number; - readonly STENCIL_VALUE_MASK: number; - readonly STENCIL_WRITEMASK: number; - readonly STREAM_DRAW: number; - readonly SUBPIXEL_BITS: number; - readonly TEXTURE: number; - readonly TEXTURE0: number; - readonly TEXTURE1: number; - readonly TEXTURE10: number; - readonly TEXTURE11: number; - readonly TEXTURE12: number; - readonly TEXTURE13: number; - readonly TEXTURE14: number; - readonly TEXTURE15: number; - readonly TEXTURE16: number; - readonly TEXTURE17: number; - readonly TEXTURE18: number; - readonly TEXTURE19: number; - readonly TEXTURE2: number; - readonly TEXTURE20: number; - readonly TEXTURE21: number; - readonly TEXTURE22: number; - readonly TEXTURE23: number; - readonly TEXTURE24: number; - readonly TEXTURE25: number; - readonly TEXTURE26: number; - readonly TEXTURE27: number; - readonly TEXTURE28: number; - readonly TEXTURE29: number; - readonly TEXTURE3: number; - readonly TEXTURE30: number; - readonly TEXTURE31: number; - readonly TEXTURE4: number; - readonly TEXTURE5: number; - readonly TEXTURE6: number; - readonly TEXTURE7: number; - readonly TEXTURE8: number; - readonly TEXTURE9: number; - readonly TEXTURE_2D: number; - readonly TEXTURE_BINDING_2D: number; - readonly TEXTURE_BINDING_CUBE_MAP: number; - readonly TEXTURE_CUBE_MAP: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_X: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number; - readonly TEXTURE_MAG_FILTER: number; - readonly TEXTURE_MIN_FILTER: number; - readonly TEXTURE_WRAP_S: number; - readonly TEXTURE_WRAP_T: number; - readonly TRIANGLES: number; - readonly TRIANGLE_FAN: number; - readonly TRIANGLE_STRIP: number; - readonly UNPACK_ALIGNMENT: number; - readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - readonly UNPACK_FLIP_Y_WEBGL: number; - readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - readonly UNSIGNED_BYTE: number; - readonly UNSIGNED_INT: number; - readonly UNSIGNED_SHORT: number; - readonly UNSIGNED_SHORT_4_4_4_4: number; - readonly UNSIGNED_SHORT_5_5_5_1: number; - readonly UNSIGNED_SHORT_5_6_5: number; - readonly VALIDATE_STATUS: number; - readonly VENDOR: number; - readonly VERSION: number; - readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - readonly VERTEX_ATTRIB_ARRAY_ENABLED: number; - readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - readonly VERTEX_ATTRIB_ARRAY_POINTER: number; - readonly VERTEX_ATTRIB_ARRAY_SIZE: number; - readonly VERTEX_ATTRIB_ARRAY_STRIDE: number; - readonly VERTEX_ATTRIB_ARRAY_TYPE: number; - readonly VERTEX_SHADER: number; - readonly VIEWPORT: number; - readonly ZERO: number; -} - -interface WebGLShader extends WebGLObject { -} - -declare var WebGLShader: { - prototype: WebGLShader; - new(): WebGLShader; -} - -interface WebGLShaderPrecisionFormat { - readonly precision: number; - readonly rangeMax: number; - readonly rangeMin: number; -} - -declare var WebGLShaderPrecisionFormat: { - prototype: WebGLShaderPrecisionFormat; - new(): WebGLShaderPrecisionFormat; -} - -interface WebGLTexture extends WebGLObject { -} - -declare var WebGLTexture: { - prototype: WebGLTexture; - new(): WebGLTexture; -} - -interface WebGLUniformLocation { -} - -declare var WebGLUniformLocation: { - prototype: WebGLUniformLocation; - new(): WebGLUniformLocation; -} - -interface WebKitCSSMatrix { - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; - m11: number; - m12: number; - m13: number; - m14: number; - m21: number; - m22: number; - m23: number; - m24: number; - m31: number; - m32: number; - m33: number; - m34: number; - m41: number; - m42: number; - m43: number; - m44: number; - inverse(): WebKitCSSMatrix; - multiply(secondMatrix: WebKitCSSMatrix): WebKitCSSMatrix; - rotate(angleX: number, angleY?: number, angleZ?: number): WebKitCSSMatrix; - rotateAxisAngle(x: number, y: number, z: number, angle: number): WebKitCSSMatrix; - scale(scaleX: number, scaleY?: number, scaleZ?: number): WebKitCSSMatrix; - setMatrixValue(value: string): void; - skewX(angle: number): WebKitCSSMatrix; - skewY(angle: number): WebKitCSSMatrix; - toString(): string; - translate(x: number, y: number, z?: number): WebKitCSSMatrix; -} - -declare var WebKitCSSMatrix: { - prototype: WebKitCSSMatrix; - new(text?: string): WebKitCSSMatrix; -} - -interface WebKitPoint { - x: number; - y: number; -} - -declare var WebKitPoint: { - prototype: WebKitPoint; - new(x?: number, y?: number): WebKitPoint; -} - -interface WebSocket extends EventTarget { - binaryType: string; - readonly bufferedAmount: number; - readonly extensions: string; - onclose: (this: this, ev: CloseEvent) => any; - onerror: (this: this, ev: ErrorEvent) => any; - onmessage: (this: this, ev: MessageEvent) => any; - onopen: (this: this, ev: Event) => any; - readonly protocol: string; - readonly readyState: number; - readonly url: string; - close(code?: number, reason?: string): void; - send(data: any): void; - readonly CLOSED: number; - readonly CLOSING: number; - readonly CONNECTING: number; - readonly OPEN: number; - addEventListener(type: "close", listener: (this: this, ev: CloseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (this: this, ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "open", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var WebSocket: { - prototype: WebSocket; - new(url: string, protocols?: string | string[]): WebSocket; - readonly CLOSED: number; - readonly CLOSING: number; - readonly CONNECTING: number; - readonly OPEN: number; -} - -interface WheelEvent extends MouseEvent { - readonly deltaMode: number; - readonly deltaX: number; - readonly deltaY: number; - readonly deltaZ: number; - readonly wheelDelta: number; - readonly wheelDeltaX: number; - readonly wheelDeltaY: number; - getCurrentPoint(element: Element): void; - initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; - readonly DOM_DELTA_LINE: number; - readonly DOM_DELTA_PAGE: number; - readonly DOM_DELTA_PIXEL: number; -} - -declare var WheelEvent: { - prototype: WheelEvent; - new(typeArg: string, eventInitDict?: WheelEventInit): WheelEvent; - readonly DOM_DELTA_LINE: number; - readonly DOM_DELTA_PAGE: number; - readonly DOM_DELTA_PIXEL: number; -} - -interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64 { - readonly applicationCache: ApplicationCache; - readonly clientInformation: Navigator; - readonly closed: boolean; - readonly crypto: Crypto; - defaultStatus: string; - readonly devicePixelRatio: number; - readonly doNotTrack: string; - readonly document: Document; - event: Event; - readonly external: External; - readonly frameElement: Element; - readonly frames: Window; - readonly history: History; - readonly innerHeight: number; - readonly innerWidth: number; - readonly length: number; - readonly location: Location; - readonly locationbar: BarProp; - readonly menubar: BarProp; - readonly msCredentials: MSCredentials; - name: string; - readonly navigator: Navigator; - offscreenBuffering: string | boolean; - onabort: (this: this, ev: UIEvent) => any; - onafterprint: (this: this, ev: Event) => any; - onbeforeprint: (this: this, ev: Event) => any; - onbeforeunload: (this: this, ev: BeforeUnloadEvent) => any; - onblur: (this: this, ev: FocusEvent) => any; - oncanplay: (this: this, ev: Event) => any; - oncanplaythrough: (this: this, ev: Event) => any; - onchange: (this: this, ev: Event) => any; - onclick: (this: this, ev: MouseEvent) => any; - oncompassneedscalibration: (this: this, ev: Event) => any; - oncontextmenu: (this: this, ev: PointerEvent) => any; - ondblclick: (this: this, ev: MouseEvent) => any; - ondevicelight: (this: this, ev: DeviceLightEvent) => any; - ondevicemotion: (this: this, ev: DeviceMotionEvent) => any; - ondeviceorientation: (this: this, ev: DeviceOrientationEvent) => any; - ondrag: (this: this, ev: DragEvent) => any; - ondragend: (this: this, ev: DragEvent) => any; - ondragenter: (this: this, ev: DragEvent) => any; - ondragleave: (this: this, ev: DragEvent) => any; - ondragover: (this: this, ev: DragEvent) => any; - ondragstart: (this: this, ev: DragEvent) => any; - ondrop: (this: this, ev: DragEvent) => any; - ondurationchange: (this: this, ev: Event) => any; - onemptied: (this: this, ev: Event) => any; - onended: (this: this, ev: MediaStreamErrorEvent) => any; - onerror: ErrorEventHandler; - onfocus: (this: this, ev: FocusEvent) => any; - onhashchange: (this: this, ev: HashChangeEvent) => any; - oninput: (this: this, ev: Event) => any; - oninvalid: (this: this, ev: Event) => any; - onkeydown: (this: this, ev: KeyboardEvent) => any; - onkeypress: (this: this, ev: KeyboardEvent) => any; - onkeyup: (this: this, ev: KeyboardEvent) => any; - onload: (this: this, ev: Event) => any; - onloadeddata: (this: this, ev: Event) => any; - onloadedmetadata: (this: this, ev: Event) => any; - onloadstart: (this: this, ev: Event) => any; - onmessage: (this: this, ev: MessageEvent) => any; - onmousedown: (this: this, ev: MouseEvent) => any; - onmouseenter: (this: this, ev: MouseEvent) => any; - onmouseleave: (this: this, ev: MouseEvent) => any; - onmousemove: (this: this, ev: MouseEvent) => any; - onmouseout: (this: this, ev: MouseEvent) => any; - onmouseover: (this: this, ev: MouseEvent) => any; - onmouseup: (this: this, ev: MouseEvent) => any; - onmousewheel: (this: this, ev: WheelEvent) => any; - onmsgesturechange: (this: this, ev: MSGestureEvent) => any; - onmsgesturedoubletap: (this: this, ev: MSGestureEvent) => any; - onmsgestureend: (this: this, ev: MSGestureEvent) => any; - onmsgesturehold: (this: this, ev: MSGestureEvent) => any; - onmsgesturestart: (this: this, ev: MSGestureEvent) => any; - onmsgesturetap: (this: this, ev: MSGestureEvent) => any; - onmsinertiastart: (this: this, ev: MSGestureEvent) => any; - onmspointercancel: (this: this, ev: MSPointerEvent) => any; - onmspointerdown: (this: this, ev: MSPointerEvent) => any; - onmspointerenter: (this: this, ev: MSPointerEvent) => any; - onmspointerleave: (this: this, ev: MSPointerEvent) => any; - onmspointermove: (this: this, ev: MSPointerEvent) => any; - onmspointerout: (this: this, ev: MSPointerEvent) => any; - onmspointerover: (this: this, ev: MSPointerEvent) => any; - onmspointerup: (this: this, ev: MSPointerEvent) => any; - onoffline: (this: this, ev: Event) => any; - ononline: (this: this, ev: Event) => any; - onorientationchange: (this: this, ev: Event) => any; - onpagehide: (this: this, ev: PageTransitionEvent) => any; - onpageshow: (this: this, ev: PageTransitionEvent) => any; - onpause: (this: this, ev: Event) => any; - onplay: (this: this, ev: Event) => any; - onplaying: (this: this, ev: Event) => any; - onpopstate: (this: this, ev: PopStateEvent) => any; - onprogress: (this: this, ev: ProgressEvent) => any; - onratechange: (this: this, ev: Event) => any; - onreadystatechange: (this: this, ev: ProgressEvent) => any; - onreset: (this: this, ev: Event) => any; - onresize: (this: this, ev: UIEvent) => any; - onscroll: (this: this, ev: UIEvent) => any; - onseeked: (this: this, ev: Event) => any; - onseeking: (this: this, ev: Event) => any; - onselect: (this: this, ev: UIEvent) => any; - onstalled: (this: this, ev: Event) => any; - onstorage: (this: this, ev: StorageEvent) => any; - onsubmit: (this: this, ev: Event) => any; - onsuspend: (this: this, ev: Event) => any; - ontimeupdate: (this: this, ev: Event) => any; - ontouchcancel: (ev: TouchEvent) => any; - ontouchend: (ev: TouchEvent) => any; - ontouchmove: (ev: TouchEvent) => any; - ontouchstart: (ev: TouchEvent) => any; - onunload: (this: this, ev: Event) => any; - onvolumechange: (this: this, ev: Event) => any; - onwaiting: (this: this, ev: Event) => any; - opener: any; - orientation: string | number; - readonly outerHeight: number; - readonly outerWidth: number; - readonly pageXOffset: number; - readonly pageYOffset: number; - readonly parent: Window; - readonly performance: Performance; - readonly personalbar: BarProp; - readonly screen: Screen; - readonly screenLeft: number; - readonly screenTop: number; - readonly screenX: number; - readonly screenY: number; - readonly scrollX: number; - readonly scrollY: number; - readonly scrollbars: BarProp; - readonly self: Window; - status: string; - readonly statusbar: BarProp; - readonly styleMedia: StyleMedia; - readonly toolbar: BarProp; - readonly top: Window; - readonly window: Window; - URL: typeof URL; - Blob: typeof Blob; - alert(message?: any): void; - blur(): void; - cancelAnimationFrame(handle: number): void; - captureEvents(): void; - close(): void; - confirm(message?: string): boolean; - focus(): void; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; - getSelection(): Selection; - matchMedia(mediaQuery: string): MediaQueryList; - moveBy(x?: number, y?: number): void; - moveTo(x?: number, y?: number): void; - msWriteProfilerMark(profilerMarkName: string): void; - open(url?: string, target?: string, features?: string, replace?: boolean): Window; - postMessage(message: any, targetOrigin: string, transfer?: any[]): void; - print(): void; - prompt(message?: string, _default?: string): string | null; - releaseEvents(): void; - requestAnimationFrame(callback: FrameRequestCallback): number; - resizeBy(x?: number, y?: number): void; - resizeTo(x?: number, y?: number): void; - scroll(x?: number, y?: number): void; - scrollBy(x?: number, y?: number): void; - scrollTo(x?: number, y?: number): void; - webkitCancelAnimationFrame(handle: number): void; - webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; - webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; - webkitRequestAnimationFrame(callback: FrameRequestCallback): number; - scroll(options?: ScrollToOptions): void; - scrollTo(options?: ScrollToOptions): void; - scrollBy(options?: ScrollToOptions): void; - addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (this: this, ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "compassneedscalibration", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "devicelight", listener: (this: this, ev: DeviceLightEvent) => any, useCapture?: boolean): void; - addEventListener(type: "devicemotion", listener: (this: this, ev: DeviceMotionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deviceorientation", listener: (this: this, ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (this: this, ev: HashChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "invalid", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (this: this, ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "orientationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (this: this, ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (this: this, ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "popstate", listener: (this: this, ev: PopStateEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (this: this, ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [index: number]: Window; -} - -declare var Window: { - prototype: Window; - new(): Window; -} - -interface Worker extends EventTarget, AbstractWorker { - onmessage: (this: this, ev: MessageEvent) => any; - postMessage(message: any, ports?: any): void; - terminate(): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (this: this, ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Worker: { - prototype: Worker; - new(stringUrl: string): Worker; -} - -interface XMLDocument extends Document { -} - -declare var XMLDocument: { - prototype: XMLDocument; - new(): XMLDocument; -} - -interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { - onreadystatechange: (this: this, ev: ProgressEvent) => any; - readonly readyState: number; - readonly response: any; - readonly responseText: string; - responseType: string; - readonly responseXML: any; - readonly status: number; - readonly statusText: string; - timeout: number; - readonly upload: XMLHttpRequestUpload; - withCredentials: boolean; - msCaching?: string; - abort(): void; - getAllResponseHeaders(): string; - getResponseHeader(header: string): string | null; - msCachingEnabled(): boolean; - open(method: string, url: string, async?: boolean, user?: string, password?: string): void; - overrideMimeType(mime: string): void; - send(data?: Document): void; - send(data?: string): void; - send(data?: any): void; - setRequestHeader(header: string, value: string): void; - readonly DONE: number; - readonly HEADERS_RECEIVED: number; - readonly LOADING: number; - readonly OPENED: number; - readonly UNSENT: number; - addEventListener(type: "abort", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeout", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var XMLHttpRequest: { - prototype: XMLHttpRequest; - new(): XMLHttpRequest; - readonly DONE: number; - readonly HEADERS_RECEIVED: number; - readonly LOADING: number; - readonly OPENED: number; - readonly UNSENT: number; - create(): XMLHttpRequest; -} - -interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var XMLHttpRequestUpload: { - prototype: XMLHttpRequestUpload; - new(): XMLHttpRequestUpload; -} - -interface XMLSerializer { - serializeToString(target: Node): string; -} - -declare var XMLSerializer: { - prototype: XMLSerializer; - new(): XMLSerializer; -} - -interface XPathEvaluator { - createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; - createNSResolver(nodeResolver?: Node): XPathNSResolver; - evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver, type: number, result: XPathResult): XPathResult; -} - -declare var XPathEvaluator: { - prototype: XPathEvaluator; - new(): XPathEvaluator; -} - -interface XPathExpression { - evaluate(contextNode: Node, type: number, result: XPathResult): XPathExpression; -} - -declare var XPathExpression: { - prototype: XPathExpression; - new(): XPathExpression; -} - -interface XPathNSResolver { - lookupNamespaceURI(prefix: string): string; -} - -declare var XPathNSResolver: { - prototype: XPathNSResolver; - new(): XPathNSResolver; -} - -interface XPathResult { - readonly booleanValue: boolean; - readonly invalidIteratorState: boolean; - readonly numberValue: number; - readonly resultType: number; - readonly singleNodeValue: Node; - readonly snapshotLength: number; - readonly stringValue: string; - iterateNext(): Node; - snapshotItem(index: number): Node; - readonly ANY_TYPE: number; - readonly ANY_UNORDERED_NODE_TYPE: number; - readonly BOOLEAN_TYPE: number; - readonly FIRST_ORDERED_NODE_TYPE: number; - readonly NUMBER_TYPE: number; - readonly ORDERED_NODE_ITERATOR_TYPE: number; - readonly ORDERED_NODE_SNAPSHOT_TYPE: number; - readonly STRING_TYPE: number; - readonly UNORDERED_NODE_ITERATOR_TYPE: number; - readonly UNORDERED_NODE_SNAPSHOT_TYPE: number; -} - -declare var XPathResult: { - prototype: XPathResult; - new(): XPathResult; - readonly ANY_TYPE: number; - readonly ANY_UNORDERED_NODE_TYPE: number; - readonly BOOLEAN_TYPE: number; - readonly FIRST_ORDERED_NODE_TYPE: number; - readonly NUMBER_TYPE: number; - readonly ORDERED_NODE_ITERATOR_TYPE: number; - readonly ORDERED_NODE_SNAPSHOT_TYPE: number; - readonly STRING_TYPE: number; - readonly UNORDERED_NODE_ITERATOR_TYPE: number; - readonly UNORDERED_NODE_SNAPSHOT_TYPE: number; -} - -interface XSLTProcessor { - clearParameters(): void; - getParameter(namespaceURI: string, localName: string): any; - importStylesheet(style: Node): void; - removeParameter(namespaceURI: string, localName: string): void; - reset(): void; - setParameter(namespaceURI: string, localName: string, value: any): void; - transformToDocument(source: Node): Document; - transformToFragment(source: Node, document: Document): DocumentFragment; -} - -declare var XSLTProcessor: { - prototype: XSLTProcessor; - new(): XSLTProcessor; -} - -interface AbstractWorker { - onerror: (this: this, ev: ErrorEvent) => any; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface CanvasPathMethods { - arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; - arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; - bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; - closePath(): void; - ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; - lineTo(x: number, y: number): void; - moveTo(x: number, y: number): void; - quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; - rect(x: number, y: number, w: number, h: number): void; -} - -interface ChildNode { - remove(): void; -} - -interface DOML2DeprecatedColorProperty { - color: string; -} - -interface DOML2DeprecatedSizeProperty { - size: number; -} - -interface DocumentEvent { - createEvent(eventInterface:"AnimationEvent"): AnimationEvent; - createEvent(eventInterface:"AriaRequestEvent"): AriaRequestEvent; - createEvent(eventInterface:"AudioProcessingEvent"): AudioProcessingEvent; - createEvent(eventInterface:"BeforeUnloadEvent"): BeforeUnloadEvent; - createEvent(eventInterface:"ClipboardEvent"): ClipboardEvent; - createEvent(eventInterface:"CloseEvent"): CloseEvent; - createEvent(eventInterface:"CommandEvent"): CommandEvent; - createEvent(eventInterface:"CompositionEvent"): CompositionEvent; - createEvent(eventInterface:"CustomEvent"): CustomEvent; - createEvent(eventInterface:"DeviceLightEvent"): DeviceLightEvent; - createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent; - createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent; - createEvent(eventInterface:"DragEvent"): DragEvent; - createEvent(eventInterface:"ErrorEvent"): ErrorEvent; - createEvent(eventInterface:"Event"): Event; - createEvent(eventInterface:"Events"): Event; - createEvent(eventInterface:"FocusEvent"): FocusEvent; - createEvent(eventInterface:"GamepadEvent"): GamepadEvent; - createEvent(eventInterface:"HashChangeEvent"): HashChangeEvent; - createEvent(eventInterface:"IDBVersionChangeEvent"): IDBVersionChangeEvent; - createEvent(eventInterface:"KeyboardEvent"): KeyboardEvent; - createEvent(eventInterface:"ListeningStateChangedEvent"): ListeningStateChangedEvent; - createEvent(eventInterface:"LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent; - createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; - createEvent(eventInterface:"MSManipulationEvent"): MSManipulationEvent; - createEvent(eventInterface:"MSMediaKeyMessageEvent"): MSMediaKeyMessageEvent; - createEvent(eventInterface:"MSMediaKeyNeededEvent"): MSMediaKeyNeededEvent; - createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; - createEvent(eventInterface:"MSSiteModeEvent"): MSSiteModeEvent; - createEvent(eventInterface:"MediaEncryptedEvent"): MediaEncryptedEvent; - createEvent(eventInterface:"MediaKeyMessageEvent"): MediaKeyMessageEvent; - createEvent(eventInterface:"MediaStreamErrorEvent"): MediaStreamErrorEvent; - createEvent(eventInterface:"MediaStreamTrackEvent"): MediaStreamTrackEvent; - createEvent(eventInterface:"MessageEvent"): MessageEvent; - createEvent(eventInterface:"MouseEvent"): MouseEvent; - createEvent(eventInterface:"MouseEvents"): MouseEvent; - createEvent(eventInterface:"MutationEvent"): MutationEvent; - createEvent(eventInterface:"MutationEvents"): MutationEvent; - createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent; - createEvent(eventInterface:"NavigationEvent"): NavigationEvent; - createEvent(eventInterface:"NavigationEventWithReferrer"): NavigationEventWithReferrer; - createEvent(eventInterface:"OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; - createEvent(eventInterface:"OverflowEvent"): OverflowEvent; - createEvent(eventInterface:"PageTransitionEvent"): PageTransitionEvent; - createEvent(eventInterface:"PermissionRequestedEvent"): PermissionRequestedEvent; - createEvent(eventInterface:"PointerEvent"): PointerEvent; - createEvent(eventInterface:"PopStateEvent"): PopStateEvent; - createEvent(eventInterface:"ProgressEvent"): ProgressEvent; - createEvent(eventInterface:"RTCDTMFToneChangeEvent"): RTCDTMFToneChangeEvent; - createEvent(eventInterface:"RTCDtlsTransportStateChangedEvent"): RTCDtlsTransportStateChangedEvent; - createEvent(eventInterface:"RTCIceCandidatePairChangedEvent"): RTCIceCandidatePairChangedEvent; - createEvent(eventInterface:"RTCIceGathererEvent"): RTCIceGathererEvent; - createEvent(eventInterface:"RTCIceTransportStateChangedEvent"): RTCIceTransportStateChangedEvent; - createEvent(eventInterface:"RTCSsrcConflictEvent"): RTCSsrcConflictEvent; - createEvent(eventInterface:"SVGZoomEvent"): SVGZoomEvent; - createEvent(eventInterface:"SVGZoomEvents"): SVGZoomEvent; - createEvent(eventInterface:"ScriptNotifyEvent"): ScriptNotifyEvent; - createEvent(eventInterface:"StorageEvent"): StorageEvent; - createEvent(eventInterface:"TextEvent"): TextEvent; - createEvent(eventInterface:"TouchEvent"): TouchEvent; - createEvent(eventInterface:"TrackEvent"): TrackEvent; - createEvent(eventInterface:"TransitionEvent"): TransitionEvent; - createEvent(eventInterface:"UIEvent"): UIEvent; - createEvent(eventInterface:"UIEvents"): UIEvent; - createEvent(eventInterface:"UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; - createEvent(eventInterface:"WebGLContextEvent"): WebGLContextEvent; - createEvent(eventInterface:"WheelEvent"): WheelEvent; - createEvent(eventInterface: string): Event; -} - -interface ElementTraversal { - readonly childElementCount: number; - readonly firstElementChild: Element; - readonly lastElementChild: Element; - readonly nextElementSibling: Element; - readonly previousElementSibling: Element; -} - -interface GetSVGDocument { - getSVGDocument(): Document; -} - -interface GlobalEventHandlers { - onpointercancel: (this: this, ev: PointerEvent) => any; - onpointerdown: (this: this, ev: PointerEvent) => any; - onpointerenter: (this: this, ev: PointerEvent) => any; - onpointerleave: (this: this, ev: PointerEvent) => any; - onpointermove: (this: this, ev: PointerEvent) => any; - onpointerout: (this: this, ev: PointerEvent) => any; - onpointerover: (this: this, ev: PointerEvent) => any; - onpointerup: (this: this, ev: PointerEvent) => any; - onwheel: (this: this, ev: WheelEvent) => any; - addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface HTMLTableAlignment { - /** - * Sets or retrieves a value that you can use to implement your own ch functionality for the object. - */ - ch: string; - /** - * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. - */ - chOff: string; - /** - * Sets or retrieves how text and other content are vertically aligned within the object that contains them. - */ - vAlign: string; -} - -interface IDBEnvironment { - readonly indexedDB: IDBFactory; -} - -interface LinkStyle { - readonly sheet: StyleSheet; -} - -interface MSBaseReader { - onabort: (this: this, ev: Event) => any; - onerror: (this: this, ev: ErrorEvent) => any; - onload: (this: this, ev: Event) => any; - onloadend: (this: this, ev: ProgressEvent) => any; - onloadstart: (this: this, ev: Event) => any; - onprogress: (this: this, ev: ProgressEvent) => any; - readonly readyState: number; - readonly result: any; - abort(): void; - readonly DONE: number; - readonly EMPTY: number; - readonly LOADING: number; - addEventListener(type: "abort", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface MSFileSaver { - msSaveBlob(blob: any, defaultName?: string): boolean; - msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; -} - -interface MSNavigatorDoNotTrack { - confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; - confirmWebWideTrackingException(args: ExceptionInformation): boolean; - removeSiteSpecificTrackingException(args: ExceptionInformation): void; - removeWebWideTrackingException(args: ExceptionInformation): void; - storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; - storeWebWideTrackingException(args: StoreExceptionsInformation): void; -} - -interface NavigatorContentUtils { -} - -interface NavigatorGeolocation { - readonly geolocation: Geolocation; -} - -interface NavigatorID { - readonly appName: string; - readonly appVersion: string; - readonly platform: string; - readonly product: string; - readonly productSub: string; - readonly userAgent: string; - readonly vendor: string; - readonly vendorSub: string; -} - -interface NavigatorOnLine { - readonly onLine: boolean; -} - -interface NavigatorStorageUtils { -} - -interface NavigatorUserMedia { - readonly mediaDevices: MediaDevices; - getUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback): void; -} - -interface NodeSelector { - querySelector(selectors: "a"): HTMLAnchorElement; - querySelector(selectors: "abbr"): HTMLElement; - querySelector(selectors: "acronym"): HTMLElement; - querySelector(selectors: "address"): HTMLElement; - querySelector(selectors: "applet"): HTMLAppletElement; - querySelector(selectors: "area"): HTMLAreaElement; - querySelector(selectors: "article"): HTMLElement; - querySelector(selectors: "aside"): HTMLElement; - querySelector(selectors: "audio"): HTMLAudioElement; - querySelector(selectors: "b"): HTMLElement; - querySelector(selectors: "base"): HTMLBaseElement; - querySelector(selectors: "basefont"): HTMLBaseFontElement; - querySelector(selectors: "bdo"): HTMLElement; - querySelector(selectors: "big"): HTMLElement; - querySelector(selectors: "blockquote"): HTMLQuoteElement; - querySelector(selectors: "body"): HTMLBodyElement; - querySelector(selectors: "br"): HTMLBRElement; - querySelector(selectors: "button"): HTMLButtonElement; - querySelector(selectors: "canvas"): HTMLCanvasElement; - querySelector(selectors: "caption"): HTMLTableCaptionElement; - querySelector(selectors: "center"): HTMLElement; - querySelector(selectors: "circle"): SVGCircleElement; - querySelector(selectors: "cite"): HTMLElement; - querySelector(selectors: "clippath"): SVGClipPathElement; - querySelector(selectors: "code"): HTMLElement; - querySelector(selectors: "col"): HTMLTableColElement; - querySelector(selectors: "colgroup"): HTMLTableColElement; - querySelector(selectors: "datalist"): HTMLDataListElement; - querySelector(selectors: "dd"): HTMLElement; - querySelector(selectors: "defs"): SVGDefsElement; - querySelector(selectors: "del"): HTMLModElement; - querySelector(selectors: "desc"): SVGDescElement; - querySelector(selectors: "dfn"): HTMLElement; - querySelector(selectors: "dir"): HTMLDirectoryElement; - querySelector(selectors: "div"): HTMLDivElement; - querySelector(selectors: "dl"): HTMLDListElement; - querySelector(selectors: "dt"): HTMLElement; - querySelector(selectors: "ellipse"): SVGEllipseElement; - querySelector(selectors: "em"): HTMLElement; - querySelector(selectors: "embed"): HTMLEmbedElement; - querySelector(selectors: "feblend"): SVGFEBlendElement; - querySelector(selectors: "fecolormatrix"): SVGFEColorMatrixElement; - querySelector(selectors: "fecomponenttransfer"): SVGFEComponentTransferElement; - querySelector(selectors: "fecomposite"): SVGFECompositeElement; - querySelector(selectors: "feconvolvematrix"): SVGFEConvolveMatrixElement; - querySelector(selectors: "fediffuselighting"): SVGFEDiffuseLightingElement; - querySelector(selectors: "fedisplacementmap"): SVGFEDisplacementMapElement; - querySelector(selectors: "fedistantlight"): SVGFEDistantLightElement; - querySelector(selectors: "feflood"): SVGFEFloodElement; - querySelector(selectors: "fefunca"): SVGFEFuncAElement; - querySelector(selectors: "fefuncb"): SVGFEFuncBElement; - querySelector(selectors: "fefuncg"): SVGFEFuncGElement; - querySelector(selectors: "fefuncr"): SVGFEFuncRElement; - querySelector(selectors: "fegaussianblur"): SVGFEGaussianBlurElement; - querySelector(selectors: "feimage"): SVGFEImageElement; - querySelector(selectors: "femerge"): SVGFEMergeElement; - querySelector(selectors: "femergenode"): SVGFEMergeNodeElement; - querySelector(selectors: "femorphology"): SVGFEMorphologyElement; - querySelector(selectors: "feoffset"): SVGFEOffsetElement; - querySelector(selectors: "fepointlight"): SVGFEPointLightElement; - querySelector(selectors: "fespecularlighting"): SVGFESpecularLightingElement; - querySelector(selectors: "fespotlight"): SVGFESpotLightElement; - querySelector(selectors: "fetile"): SVGFETileElement; - querySelector(selectors: "feturbulence"): SVGFETurbulenceElement; - querySelector(selectors: "fieldset"): HTMLFieldSetElement; - querySelector(selectors: "figcaption"): HTMLElement; - querySelector(selectors: "figure"): HTMLElement; - querySelector(selectors: "filter"): SVGFilterElement; - querySelector(selectors: "font"): HTMLFontElement; - querySelector(selectors: "footer"): HTMLElement; - querySelector(selectors: "foreignobject"): SVGForeignObjectElement; - querySelector(selectors: "form"): HTMLFormElement; - querySelector(selectors: "frame"): HTMLFrameElement; - querySelector(selectors: "frameset"): HTMLFrameSetElement; - querySelector(selectors: "g"): SVGGElement; - querySelector(selectors: "h1"): HTMLHeadingElement; - querySelector(selectors: "h2"): HTMLHeadingElement; - querySelector(selectors: "h3"): HTMLHeadingElement; - querySelector(selectors: "h4"): HTMLHeadingElement; - querySelector(selectors: "h5"): HTMLHeadingElement; - querySelector(selectors: "h6"): HTMLHeadingElement; - querySelector(selectors: "head"): HTMLHeadElement; - querySelector(selectors: "header"): HTMLElement; - querySelector(selectors: "hgroup"): HTMLElement; - querySelector(selectors: "hr"): HTMLHRElement; - querySelector(selectors: "html"): HTMLHtmlElement; - querySelector(selectors: "i"): HTMLElement; - querySelector(selectors: "iframe"): HTMLIFrameElement; - querySelector(selectors: "image"): SVGImageElement; - querySelector(selectors: "img"): HTMLImageElement; - querySelector(selectors: "input"): HTMLInputElement; - querySelector(selectors: "ins"): HTMLModElement; - querySelector(selectors: "isindex"): HTMLUnknownElement; - querySelector(selectors: "kbd"): HTMLElement; - querySelector(selectors: "keygen"): HTMLElement; - querySelector(selectors: "label"): HTMLLabelElement; - querySelector(selectors: "legend"): HTMLLegendElement; - querySelector(selectors: "li"): HTMLLIElement; - querySelector(selectors: "line"): SVGLineElement; - querySelector(selectors: "lineargradient"): SVGLinearGradientElement; - querySelector(selectors: "link"): HTMLLinkElement; - querySelector(selectors: "listing"): HTMLPreElement; - querySelector(selectors: "map"): HTMLMapElement; - querySelector(selectors: "mark"): HTMLElement; - querySelector(selectors: "marker"): SVGMarkerElement; - querySelector(selectors: "marquee"): HTMLMarqueeElement; - querySelector(selectors: "mask"): SVGMaskElement; - querySelector(selectors: "menu"): HTMLMenuElement; - querySelector(selectors: "meta"): HTMLMetaElement; - querySelector(selectors: "metadata"): SVGMetadataElement; - querySelector(selectors: "meter"): HTMLMeterElement; - querySelector(selectors: "nav"): HTMLElement; - querySelector(selectors: "nextid"): HTMLUnknownElement; - querySelector(selectors: "nobr"): HTMLElement; - querySelector(selectors: "noframes"): HTMLElement; - querySelector(selectors: "noscript"): HTMLElement; - querySelector(selectors: "object"): HTMLObjectElement; - querySelector(selectors: "ol"): HTMLOListElement; - querySelector(selectors: "optgroup"): HTMLOptGroupElement; - querySelector(selectors: "option"): HTMLOptionElement; - querySelector(selectors: "p"): HTMLParagraphElement; - querySelector(selectors: "param"): HTMLParamElement; - querySelector(selectors: "path"): SVGPathElement; - querySelector(selectors: "pattern"): SVGPatternElement; - querySelector(selectors: "picture"): HTMLPictureElement; - querySelector(selectors: "plaintext"): HTMLElement; - querySelector(selectors: "polygon"): SVGPolygonElement; - querySelector(selectors: "polyline"): SVGPolylineElement; - querySelector(selectors: "pre"): HTMLPreElement; - querySelector(selectors: "progress"): HTMLProgressElement; - querySelector(selectors: "q"): HTMLQuoteElement; - querySelector(selectors: "radialgradient"): SVGRadialGradientElement; - querySelector(selectors: "rect"): SVGRectElement; - querySelector(selectors: "rt"): HTMLElement; - querySelector(selectors: "ruby"): HTMLElement; - querySelector(selectors: "s"): HTMLElement; - querySelector(selectors: "samp"): HTMLElement; - querySelector(selectors: "script"): HTMLScriptElement; - querySelector(selectors: "section"): HTMLElement; - querySelector(selectors: "select"): HTMLSelectElement; - querySelector(selectors: "small"): HTMLElement; - querySelector(selectors: "source"): HTMLSourceElement; - querySelector(selectors: "span"): HTMLSpanElement; - querySelector(selectors: "stop"): SVGStopElement; - querySelector(selectors: "strike"): HTMLElement; - querySelector(selectors: "strong"): HTMLElement; - querySelector(selectors: "style"): HTMLStyleElement; - querySelector(selectors: "sub"): HTMLElement; - querySelector(selectors: "sup"): HTMLElement; - querySelector(selectors: "svg"): SVGSVGElement; - querySelector(selectors: "switch"): SVGSwitchElement; - querySelector(selectors: "symbol"): SVGSymbolElement; - querySelector(selectors: "table"): HTMLTableElement; - querySelector(selectors: "tbody"): HTMLTableSectionElement; - querySelector(selectors: "td"): HTMLTableDataCellElement; - querySelector(selectors: "template"): HTMLTemplateElement; - querySelector(selectors: "text"): SVGTextElement; - querySelector(selectors: "textpath"): SVGTextPathElement; - querySelector(selectors: "textarea"): HTMLTextAreaElement; - querySelector(selectors: "tfoot"): HTMLTableSectionElement; - querySelector(selectors: "th"): HTMLTableHeaderCellElement; - querySelector(selectors: "thead"): HTMLTableSectionElement; - querySelector(selectors: "title"): HTMLTitleElement; - querySelector(selectors: "tr"): HTMLTableRowElement; - querySelector(selectors: "track"): HTMLTrackElement; - querySelector(selectors: "tspan"): SVGTSpanElement; - querySelector(selectors: "tt"): HTMLElement; - querySelector(selectors: "u"): HTMLElement; - querySelector(selectors: "ul"): HTMLUListElement; - querySelector(selectors: "use"): SVGUseElement; - querySelector(selectors: "var"): HTMLElement; - querySelector(selectors: "video"): HTMLVideoElement; - querySelector(selectors: "view"): SVGViewElement; - querySelector(selectors: "wbr"): HTMLElement; - querySelector(selectors: "x-ms-webview"): MSHTMLWebViewElement; - querySelector(selectors: "xmp"): HTMLPreElement; - querySelector(selectors: string): Element; - querySelectorAll(selectors: "a"): NodeListOf; - querySelectorAll(selectors: "abbr"): NodeListOf; - querySelectorAll(selectors: "acronym"): NodeListOf; - querySelectorAll(selectors: "address"): NodeListOf; - querySelectorAll(selectors: "applet"): NodeListOf; - querySelectorAll(selectors: "area"): NodeListOf; - querySelectorAll(selectors: "article"): NodeListOf; - querySelectorAll(selectors: "aside"): NodeListOf; - querySelectorAll(selectors: "audio"): NodeListOf; - querySelectorAll(selectors: "b"): NodeListOf; - querySelectorAll(selectors: "base"): NodeListOf; - querySelectorAll(selectors: "basefont"): NodeListOf; - querySelectorAll(selectors: "bdo"): NodeListOf; - querySelectorAll(selectors: "big"): NodeListOf; - querySelectorAll(selectors: "blockquote"): NodeListOf; - querySelectorAll(selectors: "body"): NodeListOf; - querySelectorAll(selectors: "br"): NodeListOf; - querySelectorAll(selectors: "button"): NodeListOf; - querySelectorAll(selectors: "canvas"): NodeListOf; - querySelectorAll(selectors: "caption"): NodeListOf; - querySelectorAll(selectors: "center"): NodeListOf; - querySelectorAll(selectors: "circle"): NodeListOf; - querySelectorAll(selectors: "cite"): NodeListOf; - querySelectorAll(selectors: "clippath"): NodeListOf; - querySelectorAll(selectors: "code"): NodeListOf; - querySelectorAll(selectors: "col"): NodeListOf; - querySelectorAll(selectors: "colgroup"): NodeListOf; - querySelectorAll(selectors: "datalist"): NodeListOf; - querySelectorAll(selectors: "dd"): NodeListOf; - querySelectorAll(selectors: "defs"): NodeListOf; - querySelectorAll(selectors: "del"): NodeListOf; - querySelectorAll(selectors: "desc"): NodeListOf; - querySelectorAll(selectors: "dfn"): NodeListOf; - querySelectorAll(selectors: "dir"): NodeListOf; - querySelectorAll(selectors: "div"): NodeListOf; - querySelectorAll(selectors: "dl"): NodeListOf; - querySelectorAll(selectors: "dt"): NodeListOf; - querySelectorAll(selectors: "ellipse"): NodeListOf; - querySelectorAll(selectors: "em"): NodeListOf; - querySelectorAll(selectors: "embed"): NodeListOf; - querySelectorAll(selectors: "feblend"): NodeListOf; - querySelectorAll(selectors: "fecolormatrix"): NodeListOf; - querySelectorAll(selectors: "fecomponenttransfer"): NodeListOf; - querySelectorAll(selectors: "fecomposite"): NodeListOf; - querySelectorAll(selectors: "feconvolvematrix"): NodeListOf; - querySelectorAll(selectors: "fediffuselighting"): NodeListOf; - querySelectorAll(selectors: "fedisplacementmap"): NodeListOf; - querySelectorAll(selectors: "fedistantlight"): NodeListOf; - querySelectorAll(selectors: "feflood"): NodeListOf; - querySelectorAll(selectors: "fefunca"): NodeListOf; - querySelectorAll(selectors: "fefuncb"): NodeListOf; - querySelectorAll(selectors: "fefuncg"): NodeListOf; - querySelectorAll(selectors: "fefuncr"): NodeListOf; - querySelectorAll(selectors: "fegaussianblur"): NodeListOf; - querySelectorAll(selectors: "feimage"): NodeListOf; - querySelectorAll(selectors: "femerge"): NodeListOf; - querySelectorAll(selectors: "femergenode"): NodeListOf; - querySelectorAll(selectors: "femorphology"): NodeListOf; - querySelectorAll(selectors: "feoffset"): NodeListOf; - querySelectorAll(selectors: "fepointlight"): NodeListOf; - querySelectorAll(selectors: "fespecularlighting"): NodeListOf; - querySelectorAll(selectors: "fespotlight"): NodeListOf; - querySelectorAll(selectors: "fetile"): NodeListOf; - querySelectorAll(selectors: "feturbulence"): NodeListOf; - querySelectorAll(selectors: "fieldset"): NodeListOf; - querySelectorAll(selectors: "figcaption"): NodeListOf; - querySelectorAll(selectors: "figure"): NodeListOf; - querySelectorAll(selectors: "filter"): NodeListOf; - querySelectorAll(selectors: "font"): NodeListOf; - querySelectorAll(selectors: "footer"): NodeListOf; - querySelectorAll(selectors: "foreignobject"): NodeListOf; - querySelectorAll(selectors: "form"): NodeListOf; - querySelectorAll(selectors: "frame"): NodeListOf; - querySelectorAll(selectors: "frameset"): NodeListOf; - querySelectorAll(selectors: "g"): NodeListOf; - querySelectorAll(selectors: "h1"): NodeListOf; - querySelectorAll(selectors: "h2"): NodeListOf; - querySelectorAll(selectors: "h3"): NodeListOf; - querySelectorAll(selectors: "h4"): NodeListOf; - querySelectorAll(selectors: "h5"): NodeListOf; - querySelectorAll(selectors: "h6"): NodeListOf; - querySelectorAll(selectors: "head"): NodeListOf; - querySelectorAll(selectors: "header"): NodeListOf; - querySelectorAll(selectors: "hgroup"): NodeListOf; - querySelectorAll(selectors: "hr"): NodeListOf; - querySelectorAll(selectors: "html"): NodeListOf; - querySelectorAll(selectors: "i"): NodeListOf; - querySelectorAll(selectors: "iframe"): NodeListOf; - querySelectorAll(selectors: "image"): NodeListOf; - querySelectorAll(selectors: "img"): NodeListOf; - querySelectorAll(selectors: "input"): NodeListOf; - querySelectorAll(selectors: "ins"): NodeListOf; - querySelectorAll(selectors: "isindex"): NodeListOf; - querySelectorAll(selectors: "kbd"): NodeListOf; - querySelectorAll(selectors: "keygen"): NodeListOf; - querySelectorAll(selectors: "label"): NodeListOf; - querySelectorAll(selectors: "legend"): NodeListOf; - querySelectorAll(selectors: "li"): NodeListOf; - querySelectorAll(selectors: "line"): NodeListOf; - querySelectorAll(selectors: "lineargradient"): NodeListOf; - querySelectorAll(selectors: "link"): NodeListOf; - querySelectorAll(selectors: "listing"): NodeListOf; - querySelectorAll(selectors: "map"): NodeListOf; - querySelectorAll(selectors: "mark"): NodeListOf; - querySelectorAll(selectors: "marker"): NodeListOf; - querySelectorAll(selectors: "marquee"): NodeListOf; - querySelectorAll(selectors: "mask"): NodeListOf; - querySelectorAll(selectors: "menu"): NodeListOf; - querySelectorAll(selectors: "meta"): NodeListOf; - querySelectorAll(selectors: "metadata"): NodeListOf; - querySelectorAll(selectors: "meter"): NodeListOf; - querySelectorAll(selectors: "nav"): NodeListOf; - querySelectorAll(selectors: "nextid"): NodeListOf; - querySelectorAll(selectors: "nobr"): NodeListOf; - querySelectorAll(selectors: "noframes"): NodeListOf; - querySelectorAll(selectors: "noscript"): NodeListOf; - querySelectorAll(selectors: "object"): NodeListOf; - querySelectorAll(selectors: "ol"): NodeListOf; - querySelectorAll(selectors: "optgroup"): NodeListOf; - querySelectorAll(selectors: "option"): NodeListOf; - querySelectorAll(selectors: "p"): NodeListOf; - querySelectorAll(selectors: "param"): NodeListOf; - querySelectorAll(selectors: "path"): NodeListOf; - querySelectorAll(selectors: "pattern"): NodeListOf; - querySelectorAll(selectors: "picture"): NodeListOf; - querySelectorAll(selectors: "plaintext"): NodeListOf; - querySelectorAll(selectors: "polygon"): NodeListOf; - querySelectorAll(selectors: "polyline"): NodeListOf; - querySelectorAll(selectors: "pre"): NodeListOf; - querySelectorAll(selectors: "progress"): NodeListOf; - querySelectorAll(selectors: "q"): NodeListOf; - querySelectorAll(selectors: "radialgradient"): NodeListOf; - querySelectorAll(selectors: "rect"): NodeListOf; - querySelectorAll(selectors: "rt"): NodeListOf; - querySelectorAll(selectors: "ruby"): NodeListOf; - querySelectorAll(selectors: "s"): NodeListOf; - querySelectorAll(selectors: "samp"): NodeListOf; - querySelectorAll(selectors: "script"): NodeListOf; - querySelectorAll(selectors: "section"): NodeListOf; - querySelectorAll(selectors: "select"): NodeListOf; - querySelectorAll(selectors: "small"): NodeListOf; - querySelectorAll(selectors: "source"): NodeListOf; - querySelectorAll(selectors: "span"): NodeListOf; - querySelectorAll(selectors: "stop"): NodeListOf; - querySelectorAll(selectors: "strike"): NodeListOf; - querySelectorAll(selectors: "strong"): NodeListOf; - querySelectorAll(selectors: "style"): NodeListOf; - querySelectorAll(selectors: "sub"): NodeListOf; - querySelectorAll(selectors: "sup"): NodeListOf; - querySelectorAll(selectors: "svg"): NodeListOf; - querySelectorAll(selectors: "switch"): NodeListOf; - querySelectorAll(selectors: "symbol"): NodeListOf; - querySelectorAll(selectors: "table"): NodeListOf; - querySelectorAll(selectors: "tbody"): NodeListOf; - querySelectorAll(selectors: "td"): NodeListOf; - querySelectorAll(selectors: "template"): NodeListOf; - querySelectorAll(selectors: "text"): NodeListOf; - querySelectorAll(selectors: "textpath"): NodeListOf; - querySelectorAll(selectors: "textarea"): NodeListOf; - querySelectorAll(selectors: "tfoot"): NodeListOf; - querySelectorAll(selectors: "th"): NodeListOf; - querySelectorAll(selectors: "thead"): NodeListOf; - querySelectorAll(selectors: "title"): NodeListOf; - querySelectorAll(selectors: "tr"): NodeListOf; - querySelectorAll(selectors: "track"): NodeListOf; - querySelectorAll(selectors: "tspan"): NodeListOf; - querySelectorAll(selectors: "tt"): NodeListOf; - querySelectorAll(selectors: "u"): NodeListOf; - querySelectorAll(selectors: "ul"): NodeListOf; - querySelectorAll(selectors: "use"): NodeListOf; - querySelectorAll(selectors: "var"): NodeListOf; - querySelectorAll(selectors: "video"): NodeListOf; - querySelectorAll(selectors: "view"): NodeListOf; - querySelectorAll(selectors: "wbr"): NodeListOf; - querySelectorAll(selectors: "x-ms-webview"): NodeListOf; - querySelectorAll(selectors: "xmp"): NodeListOf; - querySelectorAll(selectors: string): NodeListOf; -} - -interface RandomSource { - getRandomValues(array: ArrayBufferView): ArrayBufferView; -} - -interface SVGAnimatedPathData { - readonly pathSegList: SVGPathSegList; -} - -interface SVGAnimatedPoints { - readonly animatedPoints: SVGPointList; - readonly points: SVGPointList; -} - -interface SVGExternalResourcesRequired { - readonly externalResourcesRequired: SVGAnimatedBoolean; -} - -interface SVGFilterPrimitiveStandardAttributes extends SVGStylable { - readonly height: SVGAnimatedLength; - readonly result: SVGAnimatedString; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; -} - -interface SVGFitToViewBox { - readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - readonly viewBox: SVGAnimatedRect; -} - -interface SVGLangSpace { - xmllang: string; - xmlspace: string; -} - -interface SVGLocatable { - readonly farthestViewportElement: SVGElement; - readonly nearestViewportElement: SVGElement; - getBBox(): SVGRect; - getCTM(): SVGMatrix; - getScreenCTM(): SVGMatrix; - getTransformToElement(element: SVGElement): SVGMatrix; -} - -interface SVGStylable { - className: any; - readonly style: CSSStyleDeclaration; -} - -interface SVGTests { - readonly requiredExtensions: SVGStringList; - readonly requiredFeatures: SVGStringList; - readonly systemLanguage: SVGStringList; - hasExtension(extension: string): boolean; -} - -interface SVGTransformable extends SVGLocatable { - readonly transform: SVGAnimatedTransformList; -} - -interface SVGURIReference { - readonly href: SVGAnimatedString; -} - -interface WindowBase64 { - atob(encodedString: string): string; - btoa(rawString: string): string; -} - -interface WindowConsole { - readonly console: Console; -} - -interface WindowLocalStorage { - readonly localStorage: Storage; -} - -interface WindowSessionStorage { - readonly sessionStorage: Storage; -} - -interface WindowTimers extends Object, WindowTimersExtension { - clearInterval(handle: number): void; - clearTimeout(handle: number): void; - setInterval(handler: (...args: any[]) => void, timeout: number): number; - setInterval(handler: any, timeout?: any, ...args: any[]): number; - setTimeout(handler: (...args: any[]) => void, timeout: number): number; - setTimeout(handler: any, timeout?: any, ...args: any[]): number; -} - -interface WindowTimersExtension { - clearImmediate(handle: number): void; - setImmediate(handler: (...args: any[]) => void): number; - setImmediate(handler: any, ...args: any[]): number; -} - -interface XMLHttpRequestEventTarget { - onabort: (this: this, ev: Event) => any; - onerror: (this: this, ev: ErrorEvent) => any; - onload: (this: this, ev: Event) => any; - onloadend: (this: this, ev: ProgressEvent) => any; - onloadstart: (this: this, ev: Event) => any; - onprogress: (this: this, ev: ProgressEvent) => any; - ontimeout: (this: this, ev: ProgressEvent) => any; - addEventListener(type: "abort", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeout", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface StorageEventInit extends EventInit { - key?: string; - oldValue?: string; - newValue?: string; - url: string; - storageArea?: Storage; -} - -interface Canvas2DContextAttributes { - alpha?: boolean; - willReadFrequently?: boolean; - storage?: boolean; - [attribute: string]: boolean | string | undefined; -} - -interface NodeListOf extends NodeList { - length: number; - item(index: number): TNode; - [index: number]: TNode; -} - -interface HTMLCollectionOf extends HTMLCollection { - item(index: number): T; - namedItem(name: string): T; - [index: number]: T; -} - -interface BlobPropertyBag { - type?: string; - endings?: string; -} - -interface FilePropertyBag { - type?: string; - lastModified?: number; -} - -interface EventListenerObject { - handleEvent(evt: Event): void; -} - -interface MessageEventInit extends EventInit { - data?: any; - origin?: string; - lastEventId?: string; - channel?: string; - source?: any; - ports?: MessagePort[]; -} - -interface ProgressEventInit extends EventInit { - lengthComputable?: boolean; - loaded?: number; - total?: number; -} - -interface ScrollOptions { - behavior?: ScrollBehavior; -} - -interface ScrollToOptions extends ScrollOptions { - left?: number; - top?: number; -} - -interface ScrollIntoViewOptions extends ScrollOptions { - block?: ScrollLogicalPosition; - inline?: ScrollLogicalPosition; -} - -interface ClipboardEventInit extends EventInit { - data?: string; - dataType?: string; -} - -interface IDBArrayKey extends Array { -} - -interface RsaKeyGenParams extends Algorithm { - modulusLength: number; - publicExponent: Uint8Array; -} - -interface RsaHashedKeyGenParams extends RsaKeyGenParams { - hash: AlgorithmIdentifier; -} - -interface RsaKeyAlgorithm extends KeyAlgorithm { - modulusLength: number; - publicExponent: Uint8Array; -} - -interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { - hash: AlgorithmIdentifier; -} - -interface RsaHashedImportParams { - hash: AlgorithmIdentifier; -} - -interface RsaPssParams { - saltLength: number; -} - -interface RsaOaepParams extends Algorithm { - label?: BufferSource; -} - -interface EcdsaParams extends Algorithm { - hash: AlgorithmIdentifier; -} - -interface EcKeyGenParams extends Algorithm { - namedCurve: string; -} - -interface EcKeyAlgorithm extends KeyAlgorithm { - typedCurve: string; -} - -interface EcKeyImportParams { - namedCurve: string; -} - -interface EcdhKeyDeriveParams extends Algorithm { - public: CryptoKey; -} - -interface AesCtrParams extends Algorithm { - counter: BufferSource; - length: number; -} - -interface AesKeyAlgorithm extends KeyAlgorithm { - length: number; -} - -interface AesKeyGenParams extends Algorithm { - length: number; -} - -interface AesDerivedKeyParams extends Algorithm { - length: number; -} - -interface AesCbcParams extends Algorithm { - iv: BufferSource; -} - -interface AesCmacParams extends Algorithm { - length: number; -} - -interface AesGcmParams extends Algorithm { - iv: BufferSource; - additionalData?: BufferSource; - tagLength?: number; -} - -interface AesCfbParams extends Algorithm { - iv: BufferSource; -} - -interface HmacImportParams extends Algorithm { - hash?: AlgorithmIdentifier; - length?: number; -} - -interface HmacKeyAlgorithm extends KeyAlgorithm { - hash: AlgorithmIdentifier; - length: number; -} - -interface HmacKeyGenParams extends Algorithm { - hash: AlgorithmIdentifier; - length?: number; -} - -interface DhKeyGenParams extends Algorithm { - prime: Uint8Array; - generator: Uint8Array; -} - -interface DhKeyAlgorithm extends KeyAlgorithm { - prime: Uint8Array; - generator: Uint8Array; -} - -interface DhKeyDeriveParams extends Algorithm { - public: CryptoKey; -} - -interface DhImportKeyParams extends Algorithm { - prime: Uint8Array; - generator: Uint8Array; -} - -interface ConcatParams extends Algorithm { - hash?: AlgorithmIdentifier; - algorithmId: Uint8Array; - partyUInfo: Uint8Array; - partyVInfo: Uint8Array; - publicInfo?: Uint8Array; - privateInfo?: Uint8Array; -} - -interface HkdfCtrParams extends Algorithm { - hash: AlgorithmIdentifier; - label: BufferSource; - context: BufferSource; -} - -interface Pbkdf2Params extends Algorithm { - salt: BufferSource; - iterations: number; - hash: AlgorithmIdentifier; -} - -interface RsaOtherPrimesInfo { - r: string; - d: string; - t: string; -} - -interface JsonWebKey { - kty: string; - use?: string; - key_ops?: string[]; - alg?: string; - kid?: string; - x5u?: string; - x5c?: string; - x5t?: string; - ext?: boolean; - crv?: string; - x?: string; - y?: string; - d?: string; - n?: string; - e?: string; - p?: string; - q?: string; - dp?: string; - dq?: string; - qi?: string; - oth?: RsaOtherPrimesInfo[]; - k?: string; -} - -interface ParentNode { - readonly children: HTMLCollection; - readonly firstElementChild: Element; - readonly lastElementChild: Element; - readonly childElementCount: number; -} - -declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; - -interface ErrorEventHandler { - (message: string, filename?: string, lineno?: number, colno?: number, error?:Error): void; -} -interface PositionCallback { - (position: Position): void; -} -interface PositionErrorCallback { - (error: PositionError): void; -} -interface MediaQueryListListener { - (mql: MediaQueryList): void; -} -interface MSLaunchUriCallback { - (): void; -} -interface FrameRequestCallback { - (time: number): void; -} -interface MSUnsafeFunctionCallback { - (): any; -} -interface MSExecAtPriorityFunctionCallback { - (...args: any[]): any; -} -interface MutationCallback { - (mutations: MutationRecord[], observer: MutationObserver): void; -} -interface DecodeSuccessCallback { - (decodedData: AudioBuffer): void; -} -interface DecodeErrorCallback { - (error: DOMException): void; -} -interface FunctionStringCallback { - (data: string): void; -} -interface NavigatorUserMediaSuccessCallback { - (stream: MediaStream): void; -} -interface NavigatorUserMediaErrorCallback { - (error: MediaStreamError): void; -} -interface ForEachCallback { - (keyId: any, status: string): void; -} -declare var Audio: {new(src?: string): HTMLAudioElement; }; -declare var Image: {new(width?: number, height?: number): HTMLImageElement; }; -declare var Option: {new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; }; -declare var applicationCache: ApplicationCache; -declare var clientInformation: Navigator; -declare var closed: boolean; -declare var crypto: Crypto; -declare var defaultStatus: string; -declare var devicePixelRatio: number; -declare var doNotTrack: string; -declare var document: Document; -declare var event: Event; -declare var external: External; -declare var frameElement: Element; -declare var frames: Window; -declare var history: History; -declare var innerHeight: number; -declare var innerWidth: number; -declare var length: number; -declare var location: Location; -declare var locationbar: BarProp; -declare var menubar: BarProp; -declare var msCredentials: MSCredentials; -declare const name: never; -declare var navigator: Navigator; -declare var offscreenBuffering: string | boolean; -declare var onabort: (this: Window, ev: UIEvent) => any; -declare var onafterprint: (this: Window, ev: Event) => any; -declare var onbeforeprint: (this: Window, ev: Event) => any; -declare var onbeforeunload: (this: Window, ev: BeforeUnloadEvent) => any; -declare var onblur: (this: Window, ev: FocusEvent) => any; -declare var oncanplay: (this: Window, ev: Event) => any; -declare var oncanplaythrough: (this: Window, ev: Event) => any; -declare var onchange: (this: Window, ev: Event) => any; -declare var onclick: (this: Window, ev: MouseEvent) => any; -declare var oncompassneedscalibration: (this: Window, ev: Event) => any; -declare var oncontextmenu: (this: Window, ev: PointerEvent) => any; -declare var ondblclick: (this: Window, ev: MouseEvent) => any; -declare var ondevicelight: (this: Window, ev: DeviceLightEvent) => any; -declare var ondevicemotion: (this: Window, ev: DeviceMotionEvent) => any; -declare var ondeviceorientation: (this: Window, ev: DeviceOrientationEvent) => any; -declare var ondrag: (this: Window, ev: DragEvent) => any; -declare var ondragend: (this: Window, ev: DragEvent) => any; -declare var ondragenter: (this: Window, ev: DragEvent) => any; -declare var ondragleave: (this: Window, ev: DragEvent) => any; -declare var ondragover: (this: Window, ev: DragEvent) => any; -declare var ondragstart: (this: Window, ev: DragEvent) => any; -declare var ondrop: (this: Window, ev: DragEvent) => any; -declare var ondurationchange: (this: Window, ev: Event) => any; -declare var onemptied: (this: Window, ev: Event) => any; -declare var onended: (this: Window, ev: MediaStreamErrorEvent) => any; -declare var onerror: ErrorEventHandler; -declare var onfocus: (this: Window, ev: FocusEvent) => any; -declare var onhashchange: (this: Window, ev: HashChangeEvent) => any; -declare var oninput: (this: Window, ev: Event) => any; -declare var oninvalid: (this: Window, ev: Event) => any; -declare var onkeydown: (this: Window, ev: KeyboardEvent) => any; -declare var onkeypress: (this: Window, ev: KeyboardEvent) => any; -declare var onkeyup: (this: Window, ev: KeyboardEvent) => any; -declare var onload: (this: Window, ev: Event) => any; -declare var onloadeddata: (this: Window, ev: Event) => any; -declare var onloadedmetadata: (this: Window, ev: Event) => any; -declare var onloadstart: (this: Window, ev: Event) => any; -declare var onmessage: (this: Window, ev: MessageEvent) => any; -declare var onmousedown: (this: Window, ev: MouseEvent) => any; -declare var onmouseenter: (this: Window, ev: MouseEvent) => any; -declare var onmouseleave: (this: Window, ev: MouseEvent) => any; -declare var onmousemove: (this: Window, ev: MouseEvent) => any; -declare var onmouseout: (this: Window, ev: MouseEvent) => any; -declare var onmouseover: (this: Window, ev: MouseEvent) => any; -declare var onmouseup: (this: Window, ev: MouseEvent) => any; -declare var onmousewheel: (this: Window, ev: WheelEvent) => any; -declare var onmsgesturechange: (this: Window, ev: MSGestureEvent) => any; -declare var onmsgesturedoubletap: (this: Window, ev: MSGestureEvent) => any; -declare var onmsgestureend: (this: Window, ev: MSGestureEvent) => any; -declare var onmsgesturehold: (this: Window, ev: MSGestureEvent) => any; -declare var onmsgesturestart: (this: Window, ev: MSGestureEvent) => any; -declare var onmsgesturetap: (this: Window, ev: MSGestureEvent) => any; -declare var onmsinertiastart: (this: Window, ev: MSGestureEvent) => any; -declare var onmspointercancel: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerdown: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerenter: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerleave: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointermove: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerout: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerover: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerup: (this: Window, ev: MSPointerEvent) => any; -declare var onoffline: (this: Window, ev: Event) => any; -declare var ononline: (this: Window, ev: Event) => any; -declare var onorientationchange: (this: Window, ev: Event) => any; -declare var onpagehide: (this: Window, ev: PageTransitionEvent) => any; -declare var onpageshow: (this: Window, ev: PageTransitionEvent) => any; -declare var onpause: (this: Window, ev: Event) => any; -declare var onplay: (this: Window, ev: Event) => any; -declare var onplaying: (this: Window, ev: Event) => any; -declare var onpopstate: (this: Window, ev: PopStateEvent) => any; -declare var onprogress: (this: Window, ev: ProgressEvent) => any; -declare var onratechange: (this: Window, ev: Event) => any; -declare var onreadystatechange: (this: Window, ev: ProgressEvent) => any; -declare var onreset: (this: Window, ev: Event) => any; -declare var onresize: (this: Window, ev: UIEvent) => any; -declare var onscroll: (this: Window, ev: UIEvent) => any; -declare var onseeked: (this: Window, ev: Event) => any; -declare var onseeking: (this: Window, ev: Event) => any; -declare var onselect: (this: Window, ev: UIEvent) => any; -declare var onstalled: (this: Window, ev: Event) => any; -declare var onstorage: (this: Window, ev: StorageEvent) => any; -declare var onsubmit: (this: Window, ev: Event) => any; -declare var onsuspend: (this: Window, ev: Event) => any; -declare var ontimeupdate: (this: Window, ev: Event) => any; -declare var ontouchcancel: (ev: TouchEvent) => any; -declare var ontouchend: (ev: TouchEvent) => any; -declare var ontouchmove: (ev: TouchEvent) => any; -declare var ontouchstart: (ev: TouchEvent) => any; -declare var onunload: (this: Window, ev: Event) => any; -declare var onvolumechange: (this: Window, ev: Event) => any; -declare var onwaiting: (this: Window, ev: Event) => any; -declare var opener: any; -declare var orientation: string | number; -declare var outerHeight: number; -declare var outerWidth: number; -declare var pageXOffset: number; -declare var pageYOffset: number; -declare var parent: Window; -declare var performance: Performance; -declare var personalbar: BarProp; -declare var screen: Screen; -declare var screenLeft: number; -declare var screenTop: number; -declare var screenX: number; -declare var screenY: number; -declare var scrollX: number; -declare var scrollY: number; -declare var scrollbars: BarProp; -declare var self: Window; -declare var status: string; -declare var statusbar: BarProp; -declare var styleMedia: StyleMedia; -declare var toolbar: BarProp; -declare var top: Window; -declare var window: Window; -declare function alert(message?: any): void; -declare function blur(): void; -declare function cancelAnimationFrame(handle: number): void; -declare function captureEvents(): void; -declare function close(): void; -declare function confirm(message?: string): boolean; -declare function focus(): void; -declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; -declare function getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; -declare function getSelection(): Selection; -declare function matchMedia(mediaQuery: string): MediaQueryList; -declare function moveBy(x?: number, y?: number): void; -declare function moveTo(x?: number, y?: number): void; -declare function msWriteProfilerMark(profilerMarkName: string): void; -declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window; -declare function postMessage(message: any, targetOrigin: string, transfer?: any[]): void; -declare function print(): void; -declare function prompt(message?: string, _default?: string): string | null; -declare function releaseEvents(): void; -declare function requestAnimationFrame(callback: FrameRequestCallback): number; -declare function resizeBy(x?: number, y?: number): void; -declare function resizeTo(x?: number, y?: number): void; -declare function scroll(x?: number, y?: number): void; -declare function scrollBy(x?: number, y?: number): void; -declare function scrollTo(x?: number, y?: number): void; -declare function webkitCancelAnimationFrame(handle: number): void; -declare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; -declare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; -declare function webkitRequestAnimationFrame(callback: FrameRequestCallback): number; -declare function scroll(options?: ScrollToOptions): void; -declare function scrollTo(options?: ScrollToOptions): void; -declare function scrollBy(options?: ScrollToOptions): void; -declare function toString(): string; -declare function addEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void; -declare function dispatchEvent(evt: Event): boolean; -declare function removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void; -declare function clearInterval(handle: number): void; -declare function clearTimeout(handle: number): void; -declare function setInterval(handler: (...args: any[]) => void, timeout: number): number; -declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; -declare function setTimeout(handler: (...args: any[]) => void, timeout: number): number; -declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; -declare function clearImmediate(handle: number): void; -declare function setImmediate(handler: (...args: any[]) => void): number; -declare function setImmediate(handler: any, ...args: any[]): number; -declare var sessionStorage: Storage; -declare var localStorage: Storage; -declare var console: Console; -declare var onpointercancel: (this: Window, ev: PointerEvent) => any; -declare var onpointerdown: (this: Window, ev: PointerEvent) => any; -declare var onpointerenter: (this: Window, ev: PointerEvent) => any; -declare var onpointerleave: (this: Window, ev: PointerEvent) => any; -declare var onpointermove: (this: Window, ev: PointerEvent) => any; -declare var onpointerout: (this: Window, ev: PointerEvent) => any; -declare var onpointerover: (this: Window, ev: PointerEvent) => any; -declare var onpointerup: (this: Window, ev: PointerEvent) => any; -declare var onwheel: (this: Window, ev: WheelEvent) => any; -declare var indexedDB: IDBFactory; -declare function atob(encodedString: string): string; -declare function btoa(rawString: string): string; -declare function addEventListener(type: "MSGestureChange", listener: (this: Window, ev: MSGestureEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSGestureDoubleTap", listener: (this: Window, ev: MSGestureEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSGestureEnd", listener: (this: Window, ev: MSGestureEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSGestureHold", listener: (this: Window, ev: MSGestureEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSGestureStart", listener: (this: Window, ev: MSGestureEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSGestureTap", listener: (this: Window, ev: MSGestureEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSInertiaStart", listener: (this: Window, ev: MSGestureEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerCancel", listener: (this: Window, ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerDown", listener: (this: Window, ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerEnter", listener: (this: Window, ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerLeave", listener: (this: Window, ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerMove", listener: (this: Window, ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerOut", listener: (this: Window, ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerOver", listener: (this: Window, ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerUp", listener: (this: Window, ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "abort", listener: (this: Window, ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "afterprint", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "beforeprint", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "beforeunload", listener: (this: Window, ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "blur", listener: (this: Window, ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "canplay", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "canplaythrough", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "change", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "click", listener: (this: Window, ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "compassneedscalibration", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "contextmenu", listener: (this: Window, ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dblclick", listener: (this: Window, ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "devicelight", listener: (this: Window, ev: DeviceLightEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "devicemotion", listener: (this: Window, ev: DeviceMotionEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "deviceorientation", listener: (this: Window, ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "drag", listener: (this: Window, ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragend", listener: (this: Window, ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragenter", listener: (this: Window, ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragleave", listener: (this: Window, ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragover", listener: (this: Window, ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragstart", listener: (this: Window, ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "drop", listener: (this: Window, ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "durationchange", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "emptied", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "ended", listener: (this: Window, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focus", listener: (this: Window, ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "hashchange", listener: (this: Window, ev: HashChangeEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "input", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "invalid", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keydown", listener: (this: Window, ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keypress", listener: (this: Window, ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keyup", listener: (this: Window, ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "load", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadeddata", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadedmetadata", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadstart", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "message", listener: (this: Window, ev: MessageEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousedown", listener: (this: Window, ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseenter", listener: (this: Window, ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseleave", listener: (this: Window, ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousemove", listener: (this: Window, ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseout", listener: (this: Window, ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseover", listener: (this: Window, ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseup", listener: (this: Window, ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousewheel", listener: (this: Window, ev: WheelEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "offline", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "online", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "orientationchange", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pagehide", listener: (this: Window, ev: PageTransitionEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pageshow", listener: (this: Window, ev: PageTransitionEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pause", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "play", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "playing", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointercancel", listener: (this: Window, ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerdown", listener: (this: Window, ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerenter", listener: (this: Window, ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerleave", listener: (this: Window, ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointermove", listener: (this: Window, ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerout", listener: (this: Window, ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerover", listener: (this: Window, ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerup", listener: (this: Window, ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "popstate", listener: (this: Window, ev: PopStateEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "progress", listener: (this: Window, ev: ProgressEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "ratechange", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "readystatechange", listener: (this: Window, ev: ProgressEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "reset", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "resize", listener: (this: Window, ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "scroll", listener: (this: Window, ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "seeked", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "seeking", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "select", listener: (this: Window, ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "stalled", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "storage", listener: (this: Window, ev: StorageEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "submit", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "suspend", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "timeupdate", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "unload", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "volumechange", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "waiting", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "wheel", listener: (this: Window, ev: WheelEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -type AAGUID = string; -type AlgorithmIdentifier = string | Algorithm; -type ConstrainBoolean = boolean | ConstrainBooleanParameters; -type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters; -type ConstrainDouble = number | ConstrainDoubleRange; -type ConstrainLong = number | ConstrainLongRange; -type CryptoOperationData = ArrayBufferView; -type GLbitfield = number; -type GLboolean = boolean; -type GLbyte = number; -type GLclampf = number; -type GLenum = number; -type GLfloat = number; -type GLint = number; -type GLintptr = number; -type GLshort = number; -type GLsizei = number; -type GLsizeiptr = number; -type GLubyte = number; -type GLuint = number; -type GLushort = number; -type IDBKeyPath = string; -type KeyFormat = string; -type KeyType = string; -type KeyUsage = string; -type MSInboundPayload = MSVideoRecvPayload | MSAudioRecvPayload; -type MSLocalClientEvent = MSLocalClientEventBase | MSAudioLocalClientEvent; -type MSOutboundPayload = MSVideoSendPayload | MSAudioSendPayload; -type RTCIceGatherCandidate = RTCIceCandidate | RTCIceCandidateComplete; -type RTCTransport = RTCDtlsTransport | RTCSrtpSdesTransport; -type payloadtype = number; -type ScrollBehavior = "auto" | "instant" | "smooth"; -type ScrollLogicalPosition = "start" | "center" | "end" | "nearest"; -type IDBValidKey = number | string | Date | IDBArrayKey; -type BufferSource = ArrayBuffer | ArrayBufferView; -type MouseWheelEvent = WheelEvent; -///////////////////////////// -/// WorkerGlobalScope APIs -///////////////////////////// -// These are only available in a Web Worker -declare function importScripts(...urls: string[]): void; - - -///////////////////////////// -/// Windows Script Host APIS -///////////////////////////// - - -interface ActiveXObject { - new (s: string): any; -} -declare var ActiveXObject: ActiveXObject; - -interface ITextWriter { - Write(s: string): void; - WriteLine(s: string): void; - Close(): void; -} - -interface TextStreamBase { - /** - * The column number of the current character position in an input stream. - */ - Column: number; - - /** - * The current line number in an input stream. - */ - Line: number; - - /** - * Closes a text stream. - * It is not necessary to close standard streams; they close automatically when the process ends. If - * you close a standard stream, be aware that any other pointers to that standard stream become invalid. - */ - Close(): void; -} - -interface TextStreamWriter extends TextStreamBase { - /** - * Sends a string to an output stream. - */ - Write(s: string): void; - - /** - * Sends a specified number of blank lines (newline characters) to an output stream. - */ - WriteBlankLines(intLines: number): void; - - /** - * Sends a string followed by a newline character to an output stream. - */ - WriteLine(s: string): void; -} - -interface TextStreamReader extends TextStreamBase { - /** - * Returns a specified number of characters from an input stream, starting at the current pointer position. - * Does not return until the ENTER key is pressed. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - */ - Read(characters: number): string; - - /** - * Returns all characters from an input stream. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - */ - ReadAll(): string; - - /** - * Returns an entire line from an input stream. - * Although this method extracts the newline character, it does not add it to the returned string. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - */ - ReadLine(): string; - - /** - * Skips a specified number of characters when reading from an input text stream. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.) - */ - Skip(characters: number): void; - - /** - * Skips the next line when reading from an input text stream. - * Can only be used on a stream in reading mode, not writing or appending mode. - */ - SkipLine(): void; - - /** - * Indicates whether the stream pointer position is at the end of a line. - */ - AtEndOfLine: boolean; - - /** - * Indicates whether the stream pointer position is at the end of a stream. - */ - AtEndOfStream: boolean; -} - -declare var WScript: { - /** - * Outputs text to either a message box (under WScript.exe) or the command console window followed by - * a newline (under CScript.exe). - */ - Echo(s: any): void; - - /** - * Exposes the write-only error output stream for the current script. - * Can be accessed only while using CScript.exe. - */ - StdErr: TextStreamWriter; - - /** - * Exposes the write-only output stream for the current script. - * Can be accessed only while using CScript.exe. - */ - StdOut: TextStreamWriter; - Arguments: { length: number; Item(n: number): string; }; - - /** - * The full path of the currently running script. - */ - ScriptFullName: string; - - /** - * Forces the script to stop immediately, with an optional exit code. - */ - Quit(exitCode?: number): number; - - /** - * The Windows Script Host build version number. - */ - BuildVersion: number; - - /** - * Fully qualified path of the host executable. - */ - FullName: string; - - /** - * Gets/sets the script mode - interactive(true) or batch(false). - */ - Interactive: boolean; - - /** - * The name of the host executable (WScript.exe or CScript.exe). - */ - Name: string; - - /** - * Path of the directory containing the host executable. - */ - Path: string; - - /** - * The filename of the currently running script. - */ - ScriptName: string; - - /** - * Exposes the read-only input stream for the current script. - * Can be accessed only while using CScript.exe. - */ - StdIn: TextStreamReader; - - /** - * Windows Script Host version - */ - Version: string; - - /** - * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event. - */ - ConnectObject(objEventSource: any, strPrefix: string): void; - - /** - * Creates a COM object. - * @param strProgiID - * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. - */ - CreateObject(strProgID: string, strPrefix?: string): any; - - /** - * Disconnects a COM object from its event sources. - */ - DisconnectObject(obj: any): void; - - /** - * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file. - * @param strPathname Fully qualified path to the file containing the object persisted to disk. - * For objects in memory, pass a zero-length string. - * @param strProgID - * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. - */ - GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; - - /** - * Suspends script execution for a specified length of time, then continues execution. - * @param intTime Interval (in milliseconds) to suspend script execution. - */ - Sleep(intTime: number): void; -}; - -/** - * Allows enumerating over a COM collection, which may not have indexed item access. - */ -interface Enumerator { - /** - * Returns true if the current item is the last one in the collection, or the collection is empty, - * or the current item is undefined. - */ - atEnd(): boolean; - - /** - * Returns the current item in the collection - */ - item(): T; - - /** - * Resets the current item in the collection to the first item. If there are no items in the collection, - * the current item is set to undefined. - */ - moveFirst(): void; - - /** - * Moves the current item to the next item in the collection. If the enumerator is at the end of - * the collection or the collection is empty, the current item is set to undefined. - */ - moveNext(): void; -} - -interface EnumeratorConstructor { - new (collection: any): Enumerator; - new (collection: any): Enumerator; -} - -declare var Enumerator: EnumeratorConstructor; - -/** - * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions. - */ -interface VBArray { - /** - * Returns the number of dimensions (1-based). - */ - dimensions(): number; - - /** - * Takes an index for each dimension in the array, and returns the item at the corresponding location. - */ - getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T; - - /** - * Returns the smallest available index for a given dimension. - * @param dimension 1-based dimension (defaults to 1) - */ - lbound(dimension?: number): number; - - /** - * Returns the largest available index for a given dimension. - * @param dimension 1-based dimension (defaults to 1) - */ - ubound(dimension?: number): number; - - /** - * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions, - * each successive dimension is appended to the end of the array. - * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6] - */ - toArray(): T[]; -} - -interface VBArrayConstructor { - new (safeArray: any): VBArray; - new (safeArray: any): VBArray; -} - -declare var VBArray: VBArrayConstructor; - -/** - * Automation date (VT_DATE) - */ -interface VarDate { } - -interface DateConstructor { - new (vd: VarDate): Date; -} - -interface Date { - getVarDate: () => VarDate; -} -/// - -interface DOMTokenList { - [Symbol.iterator](): IterableIterator; -} - -interface NodeList { - [Symbol.iterator](): IterableIterator -} - -interface NodeListOf { - [Symbol.iterator](): IterableIterator -} diff --git a/decl/node.d.ts b/decl/node.d.ts deleted file mode 100644 index 8df3d16a7..000000000 --- a/decl/node.d.ts +++ /dev/null @@ -1,2178 +0,0 @@ -// Type definitions for Node.js v4.x -// Project: http://nodejs.org/ -// Definitions by: Microsoft TypeScript , DefinitelyTyped -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/************************************************ -* * -* Node.js v4.x API * -* * -************************************************/ - -interface Error { - stack?: string; -} - - -// compat for TypeScript 1.5.3 -// if you use with --target es3 or --target es5 and use below definitions, -// use the lib.es6.d.ts that is bundled with TypeScript 1.5.3. -interface MapConstructor {} -interface WeakMapConstructor {} -interface SetConstructor {} -interface WeakSetConstructor {} - -/************************************************ -* * -* GLOBAL * -* * -************************************************/ -declare var process: NodeJS.Process; -declare var global: NodeJS.Global; - -declare var __filename: string; -declare var __dirname: string; - -declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; -declare function clearTimeout(timeoutId: NodeJS.Timer): void; -declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; -declare function clearInterval(intervalId: NodeJS.Timer): void; -declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any; -declare function clearImmediate(immediateId: any): void; - -interface NodeRequireFunction { - (id: string): any; -} - -interface NodeRequire extends NodeRequireFunction { - resolve(id:string): string; - cache: any; - extensions: any; - main: any; -} - -declare var require: NodeRequire; - -interface NodeModule { - exports: any; - require: NodeRequireFunction; - id: string; - filename: string; - loaded: boolean; - parent: any; - children: any[]; -} - -declare var module: NodeModule; - -// Same as module.exports -declare var exports: any; -declare var SlowBuffer: { - new (str: string, encoding?: string): Buffer; - new (size: number): Buffer; - new (size: Uint8Array): Buffer; - new (array: any[]): Buffer; - prototype: Buffer; - isBuffer(obj: any): boolean; - byteLength(string: string, encoding?: string): number; - concat(list: Buffer[], totalLength?: number): Buffer; -}; - - -// Buffer class -interface Buffer extends NodeBuffer {} - -/** - * Raw data is stored in instances of the Buffer class. - * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. - * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' - */ -declare var Buffer: { - /** - * Allocates a new buffer containing the given {str}. - * - * @param str String to store in buffer. - * @param encoding encoding to use, optional. Default is 'utf8' - */ - new (str: string, encoding?: string): Buffer; - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - */ - new (size: number): Buffer; - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - */ - new (array: Uint8Array): Buffer; - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - */ - new (array: any[]): Buffer; - /** - * Copies the passed {buffer} data onto a new {Buffer} instance. - * - * @param buffer The buffer to copy. - */ - new (buffer: Buffer): Buffer; - prototype: Buffer; - /** - * Returns true if {obj} is a Buffer - * - * @param obj object to test. - */ - isBuffer(obj: any): obj is Buffer; - /** - * Returns true if {encoding} is a valid encoding argument. - * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' - * - * @param encoding string to test. - */ - isEncoding(encoding: string): boolean; - /** - * Gives the actual byte length of a string. encoding defaults to 'utf8'. - * This is not the same as String.prototype.length since that returns the number of characters in a string. - * - * @param string string to test. - * @param encoding encoding used to evaluate (defaults to 'utf8') - */ - byteLength(string: string, encoding?: string): number; - /** - * Returns a buffer which is the result of concatenating all the buffers in the list together. - * - * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. - * If the list has exactly one item, then the first item of the list is returned. - * If the list has more than one item, then a new Buffer is created. - * - * @param list An array of Buffer objects to concatenate - * @param totalLength Total length of the buffers when concatenated. - * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. - */ - concat(list: Buffer[], totalLength?: number): Buffer; - /** - * The same as buf1.compare(buf2). - */ - compare(buf1: Buffer, buf2: Buffer): number; -}; - -/************************************************ -* * -* GLOBAL INTERFACES * -* * -************************************************/ -declare module NodeJS { - export interface ErrnoException extends Error { - errno?: number; - code?: string; - path?: string; - syscall?: string; - stack?: string; - } - - export interface EventEmitter { - addListener(event: string, listener: Function): EventEmitter; - on(event: string, listener: Function): EventEmitter; - once(event: string, listener: Function): EventEmitter; - removeListener(event: string, listener: Function): EventEmitter; - removeAllListeners(event?: string): EventEmitter; - setMaxListeners(n: number): EventEmitter; - getMaxListeners(): number; - listeners(event: string): Function[]; - emit(event: string, ...args: any[]): boolean; - listenerCount(type: string): number; - } - - export interface ReadableStream extends EventEmitter { - readable: boolean; - read(size?: number): string|Buffer; - setEncoding(encoding: string): void; - pause(): void; - resume(): void; - pipe(destination: T, options?: { end?: boolean; }): T; - unpipe(destination?: T): void; - unshift(chunk: string): void; - unshift(chunk: Buffer): void; - wrap(oldStream: ReadableStream): ReadableStream; - } - - export interface WritableStream extends EventEmitter { - writable: boolean; - write(buffer: Buffer|string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; - end(): void; - end(buffer: Buffer, cb?: Function): void; - end(str: string, cb?: Function): void; - end(str: string, encoding?: string, cb?: Function): void; - } - - export interface ReadWriteStream extends ReadableStream, WritableStream {} - - export interface Process extends EventEmitter { - stdout: WritableStream; - stderr: WritableStream; - stdin: ReadableStream; - argv: string[]; - execPath: string; - abort(): void; - chdir(directory: string): void; - cwd(): string; - env: any; - exit(code?: number): void; - getgid(): number; - setgid(id: number): void; - setgid(id: string): void; - getuid(): number; - setuid(id: number): void; - setuid(id: string): void; - version: string; - versions: { - http_parser: string; - node: string; - v8: string; - ares: string; - uv: string; - zlib: string; - openssl: string; - }; - config: { - target_defaults: { - cflags: any[]; - default_configuration: string; - defines: string[]; - include_dirs: string[]; - libraries: string[]; - }; - variables: { - clang: number; - host_arch: string; - node_install_npm: boolean; - node_install_waf: boolean; - node_prefix: string; - node_shared_openssl: boolean; - node_shared_v8: boolean; - node_shared_zlib: boolean; - node_use_dtrace: boolean; - node_use_etw: boolean; - node_use_openssl: boolean; - target_arch: string; - v8_no_strict_aliasing: number; - v8_use_snapshot: boolean; - visibility: string; - }; - }; - kill(pid:number, signal?: string|number): void; - pid: number; - title: string; - arch: string; - platform: string; - memoryUsage(): { rss: number; heapTotal: number; heapUsed: number; }; - nextTick(callback: Function): void; - umask(mask?: number): number; - uptime(): number; - hrtime(time?:number[]): number[]; - - // Worker - send?(message: any, sendHandle?: any): void; - } - - export interface Global { - Array: typeof Array; - ArrayBuffer: typeof ArrayBuffer; - Boolean: typeof Boolean; - Buffer: typeof Buffer; - DataView: typeof DataView; - Date: typeof Date; - Error: typeof Error; - EvalError: typeof EvalError; - Float32Array: typeof Float32Array; - Float64Array: typeof Float64Array; - Function: typeof Function; - GLOBAL: Global; - Infinity: typeof Infinity; - Int16Array: typeof Int16Array; - Int32Array: typeof Int32Array; - Int8Array: typeof Int8Array; - Intl: typeof Intl; - JSON: typeof JSON; - Map: MapConstructor; - Math: typeof Math; - NaN: typeof NaN; - Number: typeof Number; - Object: typeof Object; - Promise: Function; - RangeError: typeof RangeError; - ReferenceError: typeof ReferenceError; - RegExp: typeof RegExp; - Set: SetConstructor; - String: typeof String; - Symbol: Function; - SyntaxError: typeof SyntaxError; - TypeError: typeof TypeError; - URIError: typeof URIError; - Uint16Array: typeof Uint16Array; - Uint32Array: typeof Uint32Array; - Uint8Array: typeof Uint8Array; - Uint8ClampedArray: Function; - WeakMap: WeakMapConstructor; - WeakSet: WeakSetConstructor; - clearImmediate: (immediateId: any) => void; - clearInterval: (intervalId: NodeJS.Timer) => void; - clearTimeout: (timeoutId: NodeJS.Timer) => void; - console: typeof console; - decodeURI: typeof decodeURI; - decodeURIComponent: typeof decodeURIComponent; - encodeURI: typeof encodeURI; - encodeURIComponent: typeof encodeURIComponent; - escape: (str: string) => string; - eval: typeof eval; - global: Global; - isFinite: typeof isFinite; - isNaN: typeof isNaN; - parseFloat: typeof parseFloat; - parseInt: typeof parseInt; - process: Process; - root: Global; - setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => any; - setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer; - setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer; - undefined: typeof undefined; - unescape: (str: string) => string; - gc: () => void; - v8debug?: any; - } - - export interface Timer { - ref() : void; - unref() : void; - } -} - -/** - * @deprecated - */ -interface NodeBuffer { - [index: number]: number; - write(string: string, offset?: number, length?: number, encoding?: string): number; - toString(encoding?: string, start?: number, end?: number): string; - toJSON(): any; - length: number; - equals(otherBuffer: Buffer): boolean; - compare(otherBuffer: Buffer): number; - copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; - slice(start?: number, end?: number): Buffer; - writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; - readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; - readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; - readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; - readUInt8(offset: number, noAsset?: boolean): number; - readUInt16LE(offset: number, noAssert?: boolean): number; - readUInt16BE(offset: number, noAssert?: boolean): number; - readUInt32LE(offset: number, noAssert?: boolean): number; - readUInt32BE(offset: number, noAssert?: boolean): number; - readInt8(offset: number, noAssert?: boolean): number; - readInt16LE(offset: number, noAssert?: boolean): number; - readInt16BE(offset: number, noAssert?: boolean): number; - readInt32LE(offset: number, noAssert?: boolean): number; - readInt32BE(offset: number, noAssert?: boolean): number; - readFloatLE(offset: number, noAssert?: boolean): number; - readFloatBE(offset: number, noAssert?: boolean): number; - readDoubleLE(offset: number, noAssert?: boolean): number; - readDoubleBE(offset: number, noAssert?: boolean): number; - writeUInt8(value: number, offset: number, noAssert?: boolean): number; - writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; - writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; - writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; - writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; - writeInt8(value: number, offset: number, noAssert?: boolean): number; - writeInt16LE(value: number, offset: number, noAssert?: boolean): number; - writeInt16BE(value: number, offset: number, noAssert?: boolean): number; - writeInt32LE(value: number, offset: number, noAssert?: boolean): number; - writeInt32BE(value: number, offset: number, noAssert?: boolean): number; - writeFloatLE(value: number, offset: number, noAssert?: boolean): number; - writeFloatBE(value: number, offset: number, noAssert?: boolean): number; - writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; - writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; - fill(value: any, offset?: number, end?: number): Buffer; - indexOf(value: string | number | Buffer, byteOffset?: number): number; -} - -/************************************************ -* * -* MODULES * -* * -************************************************/ -declare module "buffer" { - export var INSPECT_MAX_BYTES: number; -} - -declare module "querystring" { - export interface StringifyOptions { - encodeURIComponent?: Function; - } - - export interface ParseOptions { - maxKeys?: number; - decodeURIComponent?: Function; - } - - export function stringify(obj: T, sep?: string, eq?: string, options?: StringifyOptions): string; - export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): any; - export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): T; - export function escape(str: string): string; - export function unescape(str: string): string; -} - -declare module "events" { - export class EventEmitter implements NodeJS.EventEmitter { - static EventEmitter: EventEmitter; - static listenerCount(emitter: EventEmitter, event: string): number; // deprecated - static defaultMaxListeners: number; - - addListener(event: string, listener: Function): EventEmitter; - on(event: string, listener: Function): EventEmitter; - once(event: string, listener: Function): EventEmitter; - removeListener(event: string, listener: Function): EventEmitter; - removeAllListeners(event?: string): EventEmitter; - setMaxListeners(n: number): EventEmitter; - getMaxListeners(): number; - listeners(event: string): Function[]; - emit(event: string, ...args: any[]): boolean; - listenerCount(type: string): number; - } -} - -declare module "http" { - import * as events from "events"; - import * as net from "net"; - import * as stream from "stream"; - - export interface RequestOptions { - protocol?: string; - host?: string; - hostname?: string; - family?: number; - port?: number; - localAddress?: string; - socketPath?: string; - method?: string; - path?: string; - headers?: { [key: string]: any }; - auth?: string; - agent?: Agent|boolean; - } - - export interface Server extends events.EventEmitter { - listen(port: number, hostname?: string, backlog?: number, callback?: Function): Server; - listen(port: number, hostname?: string, callback?: Function): Server; - listen(path: string, callback?: Function): Server; - listen(handle: any, listeningListener?: Function): Server; - close(cb?: any): Server; - address(): { port: number; family: string; address: string; }; - maxHeadersCount: number; - } - /** - * @deprecated Use IncomingMessage - */ - export interface ServerRequest extends IncomingMessage { - connection: net.Socket; - } - export interface ServerResponse extends events.EventEmitter, stream.Writable { - // Extended base methods - write(buffer: Buffer): boolean; - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; - write(str: string, encoding?: string, fd?: string): boolean; - - writeContinue(): void; - writeHead(statusCode: number, reasonPhrase?: string, headers?: any): void; - writeHead(statusCode: number, headers?: any): void; - statusCode: number; - statusMessage: string; - headersSent: boolean; - setHeader(name: string, value: string): void; - sendDate: boolean; - getHeader(name: string): string; - removeHeader(name: string): void; - write(chunk: any, encoding?: string): any; - addTrailers(headers: any): void; - - // Extended base methods - end(): void; - end(buffer: Buffer, cb?: Function): void; - end(str: string, cb?: Function): void; - end(str: string, encoding?: string, cb?: Function): void; - end(data?: any, encoding?: string): void; - } - export interface ClientRequest extends events.EventEmitter, stream.Writable { - // Extended base methods - write(buffer: Buffer): boolean; - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; - write(str: string, encoding?: string, fd?: string): boolean; - - write(chunk: any, encoding?: string): void; - abort(): void; - setTimeout(timeout: number, callback?: Function): void; - setNoDelay(noDelay?: boolean): void; - setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; - - // Extended base methods - end(): void; - end(buffer: Buffer, cb?: Function): void; - end(str: string, cb?: Function): void; - end(str: string, encoding?: string, cb?: Function): void; - end(data?: any, encoding?: string): void; - } - export interface IncomingMessage extends events.EventEmitter, stream.Readable { - httpVersion: string; - headers: any; - rawHeaders: string[]; - trailers: any; - rawTrailers: any; - setTimeout(msecs: number, callback: Function): NodeJS.Timer; - /** - * Only valid for request obtained from http.Server. - */ - method?: string; - /** - * Only valid for request obtained from http.Server. - */ - url?: string; - /** - * Only valid for response obtained from http.ClientRequest. - */ - statusCode?: number; - /** - * Only valid for response obtained from http.ClientRequest. - */ - statusMessage?: string; - socket: net.Socket; - } - /** - * @deprecated Use IncomingMessage - */ - export interface ClientResponse extends IncomingMessage { } - - export interface AgentOptions { - /** - * Keep sockets around in a pool to be used by other requests in the future. Default = false - */ - keepAlive?: boolean; - /** - * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. - * Only relevant if keepAlive is set to true. - */ - keepAliveMsecs?: number; - /** - * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity - */ - maxSockets?: number; - /** - * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. - */ - maxFreeSockets?: number; - } - - export class Agent { - maxSockets: number; - sockets: any; - requests: any; - - constructor(opts?: AgentOptions); - - /** - * Destroy any sockets that are currently in use by the agent. - * It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled, - * then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise, - * sockets may hang open for quite a long time before the server terminates them. - */ - destroy(): void; - } - - export var METHODS: string[]; - - export var STATUS_CODES: { - [errorCode: number]: string; - [errorCode: string]: string; - }; - export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) =>void ): Server; - export function createClient(port?: number, host?: string): any; - export function request(options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; - export function get(options: any, callback?: (res: IncomingMessage) => void): ClientRequest; - export var globalAgent: Agent; -} - -declare module "cluster" { - import * as child from "child_process"; - import * as events from "events"; - - export interface ClusterSettings { - exec?: string; - args?: string[]; - silent?: boolean; - } - - export class Worker extends events.EventEmitter { - id: string; - process: child.ChildProcess; - suicide: boolean; - send(message: any, sendHandle?: any): void; - kill(signal?: string): void; - destroy(signal?: string): void; - disconnect(): void; - } - - export var settings: ClusterSettings; - export var isMaster: boolean; - export var isWorker: boolean; - export function setupMaster(settings?: ClusterSettings): void; - export function fork(env?: any): Worker; - export function disconnect(callback?: Function): void; - export var worker: Worker; - export var workers: Worker[]; - - // Event emitter - export function addListener(event: string, listener: Function): void; - export function on(event: "disconnect", listener: (worker: Worker) => void): void; - export function on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): void; - export function on(event: "fork", listener: (worker: Worker) => void): void; - export function on(event: "listening", listener: (worker: Worker, address: any) => void): void; - export function on(event: "message", listener: (worker: Worker, message: any) => void): void; - export function on(event: "online", listener: (worker: Worker) => void): void; - export function on(event: "setup", listener: (settings: any) => void): void; - export function on(event: string, listener: Function): any; - export function once(event: string, listener: Function): void; - export function removeListener(event: string, listener: Function): void; - export function removeAllListeners(event?: string): void; - export function setMaxListeners(n: number): void; - export function listeners(event: string): Function[]; - export function emit(event: string, ...args: any[]): boolean; -} - -declare module "zlib" { - import * as stream from "stream"; - export interface ZlibOptions { chunkSize?: number; windowBits?: number; level?: number; memLevel?: number; strategy?: number; dictionary?: any; } - - export interface Gzip extends stream.Transform { } - export interface Gunzip extends stream.Transform { } - export interface Deflate extends stream.Transform { } - export interface Inflate extends stream.Transform { } - export interface DeflateRaw extends stream.Transform { } - export interface InflateRaw extends stream.Transform { } - export interface Unzip extends stream.Transform { } - - export function createGzip(options?: ZlibOptions): Gzip; - export function createGunzip(options?: ZlibOptions): Gunzip; - export function createDeflate(options?: ZlibOptions): Deflate; - export function createInflate(options?: ZlibOptions): Inflate; - export function createDeflateRaw(options?: ZlibOptions): DeflateRaw; - export function createInflateRaw(options?: ZlibOptions): InflateRaw; - export function createUnzip(options?: ZlibOptions): Unzip; - - export function deflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function deflateSync(buf: Buffer, options?: ZlibOptions): any; - export function deflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function deflateRawSync(buf: Buffer, options?: ZlibOptions): any; - export function gzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function gzipSync(buf: Buffer, options?: ZlibOptions): any; - export function gunzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function gunzipSync(buf: Buffer, options?: ZlibOptions): any; - export function inflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function inflateSync(buf: Buffer, options?: ZlibOptions): any; - export function inflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function inflateRawSync(buf: Buffer, options?: ZlibOptions): any; - export function unzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function unzipSync(buf: Buffer, options?: ZlibOptions): any; - - // Constants - export var Z_NO_FLUSH: number; - export var Z_PARTIAL_FLUSH: number; - export var Z_SYNC_FLUSH: number; - export var Z_FULL_FLUSH: number; - export var Z_FINISH: number; - export var Z_BLOCK: number; - export var Z_TREES: number; - export var Z_OK: number; - export var Z_STREAM_END: number; - export var Z_NEED_DICT: number; - export var Z_ERRNO: number; - export var Z_STREAM_ERROR: number; - export var Z_DATA_ERROR: number; - export var Z_MEM_ERROR: number; - export var Z_BUF_ERROR: number; - export var Z_VERSION_ERROR: number; - export var Z_NO_COMPRESSION: number; - export var Z_BEST_SPEED: number; - export var Z_BEST_COMPRESSION: number; - export var Z_DEFAULT_COMPRESSION: number; - export var Z_FILTERED: number; - export var Z_HUFFMAN_ONLY: number; - export var Z_RLE: number; - export var Z_FIXED: number; - export var Z_DEFAULT_STRATEGY: number; - export var Z_BINARY: number; - export var Z_TEXT: number; - export var Z_ASCII: number; - export var Z_UNKNOWN: number; - export var Z_DEFLATED: number; - export var Z_NULL: number; -} - -declare module "os" { - export interface CpuInfo { - model: string; - speed: number; - times: { - user: number; - nice: number; - sys: number; - idle: number; - irq: number; - }; - } - - export interface NetworkInterfaceInfo { - address: string; - netmask: string; - family: string; - mac: string; - internal: boolean; - } - - export function tmpdir(): string; - export function homedir(): string; - export function endianness(): string; - export function hostname(): string; - export function type(): string; - export function platform(): string; - export function arch(): string; - export function release(): string; - export function uptime(): number; - export function loadavg(): number[]; - export function totalmem(): number; - export function freemem(): number; - export function cpus(): CpuInfo[]; - export function networkInterfaces(): {[index: string]: NetworkInterfaceInfo[]}; - export var EOL: string; -} - -declare module "https" { - import * as tls from "tls"; - import * as events from "events"; - import * as http from "http"; - - export interface ServerOptions { - pfx?: any; - key?: any; - passphrase?: string; - cert?: any; - ca?: any; - crl?: any; - ciphers?: string; - honorCipherOrder?: boolean; - requestCert?: boolean; - rejectUnauthorized?: boolean; - NPNProtocols?: any; - SNICallback?: (servername: string) => any; - } - - export interface RequestOptions extends http.RequestOptions{ - pfx?: any; - key?: any; - passphrase?: string; - cert?: any; - ca?: any; - ciphers?: string; - rejectUnauthorized?: boolean; - secureProtocol?: string; - } - - export interface Agent { - maxSockets: number; - sockets: any; - requests: any; - } - export var Agent: { - new (options?: RequestOptions): Agent; - }; - export interface Server extends tls.Server { } - export function createServer(options: ServerOptions, requestListener?: Function): Server; - export function request(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest; - export function get(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest; - export var globalAgent: Agent; -} - -declare module "punycode" { - export function decode(string: string): string; - export function encode(string: string): string; - export function toUnicode(domain: string): string; - export function toASCII(domain: string): string; - export var ucs2: ucs2; - interface ucs2 { - decode(string: string): number[]; - encode(codePoints: number[]): string; - } - export var version: any; -} - -declare module "repl" { - import * as stream from "stream"; - import * as events from "events"; - - export interface ReplOptions { - prompt?: string; - input?: NodeJS.ReadableStream; - output?: NodeJS.WritableStream; - terminal?: boolean; - eval?: Function; - useColors?: boolean; - useGlobal?: boolean; - ignoreUndefined?: boolean; - writer?: Function; - } - export function start(options: ReplOptions): events.EventEmitter; -} - -declare module "readline" { - import * as events from "events"; - import * as stream from "stream"; - - export interface Key { - sequence?: string; - name?: string; - ctrl?: boolean; - meta?: boolean; - shift?: boolean; - } - - export interface ReadLine extends events.EventEmitter { - setPrompt(prompt: string): void; - prompt(preserveCursor?: boolean): void; - question(query: string, callback: (answer: string) => void): void; - pause(): ReadLine; - resume(): ReadLine; - close(): void; - write(data: string|Buffer, key?: Key): void; - } - - export interface Completer { - (line: string): CompleterResult; - (line: string, callback: (err: any, result: CompleterResult) => void): any; - } - - export interface CompleterResult { - completions: string[]; - line: string; - } - - export interface ReadLineOptions { - input: NodeJS.ReadableStream; - output?: NodeJS.WritableStream; - completer?: Completer; - terminal?: boolean; - historySize?: number; - } - - export function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer, terminal?: boolean): ReadLine; - export function createInterface(options: ReadLineOptions): ReadLine; - - export function cursorTo(stream: NodeJS.WritableStream, x: number, y: number): void; - export function moveCursor(stream: NodeJS.WritableStream, dx: number|string, dy: number|string): void; - export function clearLine(stream: NodeJS.WritableStream, dir: number): void; - export function clearScreenDown(stream: NodeJS.WritableStream): void; -} - -declare module "vm" { - export interface Context { } - export interface Script { - runInThisContext(): void; - runInNewContext(sandbox?: Context): void; - } - export function runInThisContext(code: string, filename?: string): void; - export function runInNewContext(code: string, sandbox?: Context, filename?: string): void; - export function runInContext(code: string, context: Context, filename?: string): void; - export function createContext(initSandbox?: Context): Context; - export function createScript(code: string, filename?: string): Script; -} - -declare module "child_process" { - import * as events from "events"; - import * as stream from "stream"; - - export interface ChildProcess extends events.EventEmitter { - stdin: stream.Writable; - stdout: stream.Readable; - stderr: stream.Readable; - pid: number; - kill(signal?: string): void; - send(message: any, sendHandle?: any): void; - disconnect(): void; - unref(): void; - } - - export function spawn(command: string, args?: string[], options?: { - cwd?: string; - stdio?: any; - custom?: any; - env?: any; - detached?: boolean; - }): ChildProcess; - export function exec(command: string, options: { - cwd?: string; - stdio?: any; - customFds?: any; - env?: any; - encoding?: string; - timeout?: number; - maxBuffer?: number; - killSignal?: string; - }, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; - export function exec(command: string, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; - export function execFile(file: string, - callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; - export function execFile(file: string, args?: string[], - callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; - export function execFile(file: string, args?: string[], options?: { - cwd?: string; - stdio?: any; - customFds?: any; - env?: any; - encoding?: string; - timeout?: number; - maxBuffer?: number; - killSignal?: string; - }, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; - export function fork(modulePath: string, args?: string[], options?: { - cwd?: string; - env?: any; - execPath?: string; - execArgv?: string[]; - silent?: boolean; - uid?: number; - gid?: number; - }): ChildProcess; - export function spawnSync(command: string, args?: string[], options?: { - cwd?: string; - input?: string | Buffer; - stdio?: any; - env?: any; - uid?: number; - gid?: number; - timeout?: number; - maxBuffer?: number; - killSignal?: string; - encoding?: string; - }): { - pid: number; - output: string[]; - stdout: string | Buffer; - stderr: string | Buffer; - status: number; - signal: string; - error: Error; - }; - export function execSync(command: string, options?: { - cwd?: string; - input?: string|Buffer; - stdio?: any; - env?: any; - uid?: number; - gid?: number; - timeout?: number; - maxBuffer?: number; - killSignal?: string; - encoding?: string; - }): string | Buffer; - export function execFileSync(command: string, args?: string[], options?: { - cwd?: string; - input?: string|Buffer; - stdio?: any; - env?: any; - uid?: number; - gid?: number; - timeout?: number; - maxBuffer?: number; - killSignal?: string; - encoding?: string; - }): string | Buffer; -} - -declare module "url" { - export interface Url { - href?: string; - protocol?: string; - auth?: string; - hostname?: string; - port?: string; - host?: string; - pathname?: string; - search?: string; - query?: any; // string | Object - slashes?: boolean; - hash?: string; - path?: string; - } - - export function parse(urlStr: string, parseQueryString?: boolean , slashesDenoteHost?: boolean ): Url; - export function format(url: Url): string; - export function resolve(from: string, to: string): string; -} - -declare module "dns" { - export function lookup(domain: string, family: number, callback: (err: Error, address: string, family: number) =>void ): string; - export function lookup(domain: string, callback: (err: Error, address: string, family: number) =>void ): string; - export function resolve(domain: string, rrtype: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolve(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolve4(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolve6(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveMx(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveTxt(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveSrv(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveNs(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveCname(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function reverse(ip: string, callback: (err: Error, domains: string[]) =>void ): string[]; -} - -declare module "net" { - import * as stream from "stream"; - - export interface Socket extends stream.Duplex { - // Extended base methods - write(buffer: Buffer): boolean; - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; - write(str: string, encoding?: string, fd?: string): boolean; - - connect(port: number, host?: string, connectionListener?: Function): void; - connect(path: string, connectionListener?: Function): void; - bufferSize: number; - setEncoding(encoding?: string): void; - write(data: any, encoding?: string, callback?: Function): void; - destroy(): void; - pause(): void; - resume(): void; - setTimeout(timeout: number, callback?: Function): void; - setNoDelay(noDelay?: boolean): void; - setKeepAlive(enable?: boolean, initialDelay?: number): void; - address(): { port: number; family: string; address: string; }; - unref(): void; - ref(): void; - - remoteAddress: string; - remoteFamily: string; - remotePort: number; - localAddress: string; - localPort: number; - bytesRead: number; - bytesWritten: number; - - // Extended base methods - end(): void; - end(buffer: Buffer, cb?: Function): void; - end(str: string, cb?: Function): void; - end(str: string, encoding?: string, cb?: Function): void; - end(data?: any, encoding?: string): void; - } - - export var Socket: { - new (options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): Socket; - }; - - export interface Server extends Socket { - listen(port: number, host?: string, backlog?: number, listeningListener?: Function): Server; - listen(path: string, listeningListener?: Function): Server; - listen(handle: any, listeningListener?: Function): Server; - close(callback?: Function): Server; - address(): { port: number; family: string; address: string; }; - maxConnections: number; - connections: number; - } - export function createServer(connectionListener?: (socket: Socket) =>void ): Server; - export function createServer(options?: { allowHalfOpen?: boolean; }, connectionListener?: (socket: Socket) =>void ): Server; - export function connect(options: { port: number, host?: string, localAddress? : string, localPort? : string, family? : number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; - export function connect(port: number, host?: string, connectionListener?: Function): Socket; - export function connect(path: string, connectionListener?: Function): Socket; - export function createConnection(options: { port: number, host?: string, localAddress? : string, localPort? : string, family? : number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; - export function createConnection(port: number, host?: string, connectionListener?: Function): Socket; - export function createConnection(path: string, connectionListener?: Function): Socket; - export function isIP(input: string): number; - export function isIPv4(input: string): boolean; - export function isIPv6(input: string): boolean; -} - -declare module "dgram" { - import * as events from "events"; - - interface RemoteInfo { - address: string; - port: number; - size: number; - } - - interface AddressInfo { - address: string; - family: string; - port: number; - } - - export function createSocket(type: string, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; - - interface Socket extends events.EventEmitter { - send(buf: Buffer, offset: number, length: number, port: number, address: string, callback?: (error: Error, bytes: number) => void): void; - bind(port: number, address?: string, callback?: () => void): void; - close(): void; - address(): AddressInfo; - setBroadcast(flag: boolean): void; - setMulticastTTL(ttl: number): void; - setMulticastLoopback(flag: boolean): void; - addMembership(multicastAddress: string, multicastInterface?: string): void; - dropMembership(multicastAddress: string, multicastInterface?: string): void; - } -} - -declare module "fs" { - import * as stream from "stream"; - import * as events from "events"; - - interface Stats { - isFile(): boolean; - isDirectory(): boolean; - isBlockDevice(): boolean; - isCharacterDevice(): boolean; - isSymbolicLink(): boolean; - isFIFO(): boolean; - isSocket(): boolean; - dev: number; - ino: number; - mode: number; - nlink: number; - uid: number; - gid: number; - rdev: number; - size: number; - blksize: number; - blocks: number; - atime: Date; - mtime: Date; - ctime: Date; - birthtime: Date; - } - - interface FSWatcher extends events.EventEmitter { - close(): void; - } - - export interface ReadStream extends stream.Readable { - close(): void; - } - export interface WriteStream extends stream.Writable { - close(): void; - bytesWritten: number; - } - - /** - * Asynchronous rename. - * @param oldPath - * @param newPath - * @param callback No arguments other than a possible exception are given to the completion callback. - */ - export function rename(oldPath: string, newPath: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - /** - * Synchronous rename - * @param oldPath - * @param newPath - */ - export function renameSync(oldPath: string, newPath: string): void; - export function truncate(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function truncate(path: string, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function truncateSync(path: string, len?: number): void; - export function ftruncate(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function ftruncate(fd: number, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function ftruncateSync(fd: number, len?: number): void; - export function chown(path: string, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function chownSync(path: string, uid: number, gid: number): void; - export function fchown(fd: number, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function fchownSync(fd: number, uid: number, gid: number): void; - export function lchown(path: string, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function lchownSync(path: string, uid: number, gid: number): void; - export function chmod(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function chmod(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function chmodSync(path: string, mode: number): void; - export function chmodSync(path: string, mode: string): void; - export function fchmod(fd: number, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function fchmod(fd: number, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function fchmodSync(fd: number, mode: number): void; - export function fchmodSync(fd: number, mode: string): void; - export function lchmod(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function lchmod(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function lchmodSync(path: string, mode: number): void; - export function lchmodSync(path: string, mode: string): void; - export function stat(path: string, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; - export function lstat(path: string, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; - export function fstat(fd: number, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; - export function statSync(path: string): Stats; - export function lstatSync(path: string): Stats; - export function fstatSync(fd: number): Stats; - export function link(srcpath: string, dstpath: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function linkSync(srcpath: string, dstpath: string): void; - export function symlink(srcpath: string, dstpath: string, type?: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function symlinkSync(srcpath: string, dstpath: string, type?: string): void; - export function readlink(path: string, callback?: (err: NodeJS.ErrnoException, linkString: string) => any): void; - export function readlinkSync(path: string): string; - export function realpath(path: string, callback?: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void; - export function realpath(path: string, cache: {[path: string]: string}, callback: (err: NodeJS.ErrnoException, resolvedPath: string) =>any): void; - export function realpathSync(path: string, cache?: { [path: string]: string }): string; - /* - * Asynchronous unlink - deletes the file specified in {path} - * - * @param path - * @param callback No arguments other than a possible exception are given to the completion callback. - */ - export function unlink(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - /* - * Synchronous unlink - deletes the file specified in {path} - * - * @param path - */ - export function unlinkSync(path: string): void; - /* - * Asynchronous rmdir - removes the directory specified in {path} - * - * @param path - * @param callback No arguments other than a possible exception are given to the completion callback. - */ - export function rmdir(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - /* - * Synchronous rmdir - removes the directory specified in {path} - * - * @param path - */ - export function rmdirSync(path: string): void; - /* - * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. - * - * @param path - * @param callback No arguments other than a possible exception are given to the completion callback. - */ - export function mkdir(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - /* - * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. - * - * @param path - * @param mode - * @param callback No arguments other than a possible exception are given to the completion callback. - */ - export function mkdir(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - /* - * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. - * - * @param path - * @param mode - * @param callback No arguments other than a possible exception are given to the completion callback. - */ - export function mkdir(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - /* - * Synchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. - * - * @param path - * @param mode - * @param callback No arguments other than a possible exception are given to the completion callback. - */ - export function mkdirSync(path: string, mode?: number): void; - /* - * Synchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. - * - * @param path - * @param mode - * @param callback No arguments other than a possible exception are given to the completion callback. - */ - export function mkdirSync(path: string, mode?: string): void; - export function readdir(path: string, callback?: (err: NodeJS.ErrnoException, files: string[]) => void): void; - export function readdirSync(path: string): string[]; - export function close(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function closeSync(fd: number): void; - export function open(path: string, flags: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; - export function open(path: string, flags: string, mode: number, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; - export function open(path: string, flags: string, mode: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; - export function openSync(path: string, flags: string, mode?: number): number; - export function openSync(path: string, flags: string, mode?: string): number; - export function utimes(path: string, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function utimes(path: string, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function utimesSync(path: string, atime: number, mtime: number): void; - export function utimesSync(path: string, atime: Date, mtime: Date): void; - export function futimes(fd: number, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function futimes(fd: number, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function futimesSync(fd: number, atime: number, mtime: number): void; - export function futimesSync(fd: number, atime: Date, mtime: Date): void; - export function fsync(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function fsyncSync(fd: number): void; - export function write(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void; - export function write(fd: number, buffer: Buffer, offset: number, length: number, callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void; - export function write(fd: number, data: any, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; - export function write(fd: number, data: any, offset: number, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; - export function write(fd: number, data: any, offset: number, encoding: string, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; - export function writeSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number; - export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, bytesRead: number, buffer: Buffer) => void): void; - export function readSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number; - /* - * Asynchronous readFile - Asynchronously reads the entire contents of a file. - * - * @param fileName - * @param encoding - * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file. - */ - export function readFile(filename: string, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void; - /* - * Asynchronous readFile - Asynchronously reads the entire contents of a file. - * - * @param fileName - * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFile returns a string; otherwise it returns a Buffer. - * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file. - */ - export function readFile(filename: string, options: { encoding: string; flag?: string; }, callback: (err: NodeJS.ErrnoException, data: string) => void): void; - /* - * Asynchronous readFile - Asynchronously reads the entire contents of a file. - * - * @param fileName - * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFile returns a string; otherwise it returns a Buffer. - * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file. - */ - export function readFile(filename: string, options: { flag?: string; }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; - /* - * Asynchronous readFile - Asynchronously reads the entire contents of a file. - * - * @param fileName - * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file. - */ - export function readFile(filename: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; - /* - * Synchronous readFile - Synchronously reads the entire contents of a file. - * - * @param fileName - * @param encoding - */ - export function readFileSync(filename: string, encoding: string): string; - /* - * Synchronous readFile - Synchronously reads the entire contents of a file. - * - * @param fileName - * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFileSync returns a string; otherwise it returns a Buffer. - */ - export function readFileSync(filename: string, options: { encoding: string; flag?: string; }): string; - /* - * Synchronous readFile - Synchronously reads the entire contents of a file. - * - * @param fileName - * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFileSync returns a string; otherwise it returns a Buffer. - */ - export function readFileSync(filename: string, options?: { flag?: string; }): Buffer; - export function writeFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void; - export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; - export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; - export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void; - export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void; - export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; - export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; - export function appendFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void; - export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void; - export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void; - export function watchFile(filename: string, listener: (curr: Stats, prev: Stats) => void): void; - export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: (curr: Stats, prev: Stats) => void): void; - export function unwatchFile(filename: string, listener?: (curr: Stats, prev: Stats) => void): void; - export function watch(filename: string, listener?: (event: string, filename: string) => any): FSWatcher; - export function watch(filename: string, options: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher; - export function exists(path: string, callback?: (exists: boolean) => void): void; - export function existsSync(path: string): boolean; - /** Constant for fs.access(). File is visible to the calling process. */ - export var F_OK: number; - /** Constant for fs.access(). File can be read by the calling process. */ - export var R_OK: number; - /** Constant for fs.access(). File can be written by the calling process. */ - export var W_OK: number; - /** Constant for fs.access(). File can be executed by the calling process. */ - export var X_OK: number; - /** Tests a user's permissions for the file specified by path. */ - export function access(path: string, callback: (err: NodeJS.ErrnoException) => void): void; - export function access(path: string, mode: number, callback: (err: NodeJS.ErrnoException) => void): void; - /** Synchronous version of fs.access. This throws if any accessibility checks fail, and does nothing otherwise. */ - export function accessSync(path: string, mode ?: number): void; - export function createReadStream(path: string, options?: { - flags?: string; - encoding?: string; - fd?: number; - mode?: number; - autoClose?: boolean; - }): ReadStream; - export function createWriteStream(path: string, options?: { - flags?: string; - encoding?: string; - fd?: number; - mode?: number; - }): WriteStream; -} - -declare module "path" { - - /** - * A parsed path object generated by path.parse() or consumed by path.format(). - */ - export interface ParsedPath { - /** - * The root of the path such as '/' or 'c:\' - */ - root: string; - /** - * The full directory path such as '/home/user/dir' or 'c:\path\dir' - */ - dir: string; - /** - * The file name including extension (if any) such as 'index.html' - */ - base: string; - /** - * The file extension (if any) such as '.html' - */ - ext: string; - /** - * The file name without extension (if any) such as 'index' - */ - name: string; - } - - /** - * Normalize a string path, reducing '..' and '.' parts. - * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. - * - * @param p string path to normalize. - */ - export function normalize(p: string): string; - /** - * Join all arguments together and normalize the resulting path. - * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown. - * - * @param paths string paths to join. - */ - export function join(...paths: any[]): string; - /** - * Join all arguments together and normalize the resulting path. - * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown. - * - * @param paths string paths to join. - */ - export function join(...paths: string[]): string; - /** - * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. - * - * Starting from leftmost {from} paramter, resolves {to} to an absolute path. - * - * If {to} isn't already absolute, {from} arguments are prepended in right to left order, until an absolute path is found. If after using all {from} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory. - * - * @param pathSegments string paths to join. Non-string arguments are ignored. - */ - export function resolve(...pathSegments: any[]): string; - /** - * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. - * - * @param path path to test. - */ - export function isAbsolute(path: string): boolean; - /** - * Solve the relative path from {from} to {to}. - * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. - * - * @param from - * @param to - */ - export function relative(from: string, to: string): string; - /** - * Return the directory name of a path. Similar to the Unix dirname command. - * - * @param p the path to evaluate. - */ - export function dirname(p: string): string; - /** - * Return the last portion of a path. Similar to the Unix basename command. - * Often used to extract the file name from a fully qualified path. - * - * @param p the path to evaluate. - * @param ext optionally, an extension to remove from the result. - */ - export function basename(p: string, ext?: string): string; - /** - * Return the extension of the path, from the last '.' to end of string in the last portion of the path. - * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string - * - * @param p the path to evaluate. - */ - export function extname(p: string): string; - /** - * The platform-specific file separator. '\\' or '/'. - */ - export var sep: string; - /** - * The platform-specific file delimiter. ';' or ':'. - */ - export var delimiter: string; - /** - * Returns an object from a path string - the opposite of format(). - * - * @param pathString path to evaluate. - */ - export function parse(pathString: string): ParsedPath; - /** - * Returns a path string from an object - the opposite of parse(). - * - * @param pathString path to evaluate. - */ - export function format(pathObject: ParsedPath): string; - - export module posix { - export function normalize(p: string): string; - export function join(...paths: any[]): string; - export function resolve(...pathSegments: any[]): string; - export function isAbsolute(p: string): boolean; - export function relative(from: string, to: string): string; - export function dirname(p: string): string; - export function basename(p: string, ext?: string): string; - export function extname(p: string): string; - export var sep: string; - export var delimiter: string; - export function parse(p: string): ParsedPath; - export function format(pP: ParsedPath): string; - } - - export module win32 { - export function normalize(p: string): string; - export function join(...paths: any[]): string; - export function resolve(...pathSegments: any[]): string; - export function isAbsolute(p: string): boolean; - export function relative(from: string, to: string): string; - export function dirname(p: string): string; - export function basename(p: string, ext?: string): string; - export function extname(p: string): string; - export var sep: string; - export var delimiter: string; - export function parse(p: string): ParsedPath; - export function format(pP: ParsedPath): string; - } -} - -declare module "string_decoder" { - export interface NodeStringDecoder { - write(buffer: Buffer): string; - detectIncompleteChar(buffer: Buffer): number; - } - export var StringDecoder: { - new (encoding: string): NodeStringDecoder; - }; -} - -declare module "tls" { - import * as crypto from "crypto"; - import * as net from "net"; - import * as stream from "stream"; - - var CLIENT_RENEG_LIMIT: number; - var CLIENT_RENEG_WINDOW: number; - - export interface TlsOptions { - host?: string; - port?: number; - pfx?: any; //string or buffer - key?: any; //string or buffer - passphrase?: string; - cert?: any; - ca?: any; //string or buffer - crl?: any; //string or string array - ciphers?: string; - honorCipherOrder?: any; - requestCert?: boolean; - rejectUnauthorized?: boolean; - NPNProtocols?: any; //array or Buffer; - SNICallback?: (servername: string) => any; - } - - export interface ConnectionOptions { - host?: string; - port?: number; - socket?: net.Socket; - pfx?: any; //string | Buffer - key?: any; //string | Buffer - passphrase?: string; - cert?: any; //string | Buffer - ca?: any; //Array of string | Buffer - rejectUnauthorized?: boolean; - NPNProtocols?: any; //Array of string | Buffer - servername?: string; - } - - export interface Server extends net.Server { - // Extended base methods - listen(port: number, host?: string, backlog?: number, listeningListener?: Function): Server; - listen(path: string, listeningListener?: Function): Server; - listen(handle: any, listeningListener?: Function): Server; - - listen(port: number, host?: string, callback?: Function): Server; - close(): Server; - address(): { port: number; family: string; address: string; }; - addContext(hostName: string, credentials: { - key: string; - cert: string; - ca: string; - }): void; - maxConnections: number; - connections: number; - } - - export interface ClearTextStream extends stream.Duplex { - authorized: boolean; - authorizationError: Error; - getPeerCertificate(): any; - getCipher: { - name: string; - version: string; - }; - address: { - port: number; - family: string; - address: string; - }; - remoteAddress: string; - remotePort: number; - } - - export interface SecurePair { - encrypted: any; - cleartext: any; - } - - export interface SecureContextOptions { - pfx?: any; //string | buffer - key?: any; //string | buffer - passphrase?: string; - cert?: any; // string | buffer - ca?: any; // string | buffer - crl?: any; // string | string[] - ciphers?: string; - honorCipherOrder?: boolean; - } - - export interface SecureContext { - context: any; - } - - export function createServer(options: TlsOptions, secureConnectionListener?: (cleartextStream: ClearTextStream) =>void ): Server; - export function connect(options: TlsOptions, secureConnectionListener?: () =>void ): ClearTextStream; - export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream; - export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream; - export function createSecurePair(credentials?: crypto.Credentials, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; - export function createSecureContext(details: SecureContextOptions): SecureContext; -} - -declare module "crypto" { - export interface CredentialDetails { - pfx: string; - key: string; - passphrase: string; - cert: string; - ca: any; //string | string array - crl: any; //string | string array - ciphers: string; - } - export interface Credentials { context?: any; } - export function createCredentials(details: CredentialDetails): Credentials; - export function createHash(algorithm: string): Hash; - export function createHmac(algorithm: string, key: string): Hmac; - export function createHmac(algorithm: string, key: Buffer): Hmac; - export interface Hash { - update(data: any, input_encoding?: string): Hash; - digest(encoding: 'buffer'): Buffer; - digest(encoding: string): any; - digest(): Buffer; - } - export interface Hmac extends NodeJS.ReadWriteStream { - update(data: any, input_encoding?: string): Hmac; - digest(encoding: 'buffer'): Buffer; - digest(encoding: string): any; - digest(): Buffer; - } - export function createCipher(algorithm: string, password: any): Cipher; - export function createCipheriv(algorithm: string, key: any, iv: any): Cipher; - export interface Cipher { - update(data: Buffer): Buffer; - update(data: string, input_encoding?: string, output_encoding?: string): string; - final(): Buffer; - final(output_encoding: string): string; - setAutoPadding(auto_padding: boolean): void; - } - export function createDecipher(algorithm: string, password: any): Decipher; - export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher; - export interface Decipher { - update(data: Buffer): Buffer; - update(data: string, input_encoding?: string, output_encoding?: string): string; - final(): Buffer; - final(output_encoding: string): string; - setAutoPadding(auto_padding: boolean): void; - } - export function createSign(algorithm: string): Signer; - export interface Signer extends NodeJS.WritableStream { - update(data: any): void; - sign(private_key: string, output_format: string): string; - } - export function createVerify(algorith: string): Verify; - export interface Verify extends NodeJS.WritableStream { - update(data: any): void; - verify(object: string, signature: string, signature_format?: string): boolean; - } - export function createDiffieHellman(prime_length: number): DiffieHellman; - export function createDiffieHellman(prime: number, encoding?: string): DiffieHellman; - export interface DiffieHellman { - generateKeys(encoding?: string): string; - computeSecret(other_public_key: string, input_encoding?: string, output_encoding?: string): string; - getPrime(encoding?: string): string; - getGenerator(encoding: string): string; - getPublicKey(encoding?: string): string; - getPrivateKey(encoding?: string): string; - setPublicKey(public_key: string, encoding?: string): void; - setPrivateKey(public_key: string, encoding?: string): void; - } - export function getDiffieHellman(group_name: string): DiffieHellman; - export function pbkdf2(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, callback: (err: Error, derivedKey: Buffer) => any): void; - export function pbkdf2(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, digest: string, callback: (err: Error, derivedKey: Buffer) => any): void; - export function pbkdf2Sync(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number) : Buffer; - export function pbkdf2Sync(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, digest: string) : Buffer; - export function randomBytes(size: number): Buffer; - export function randomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void; - export function pseudoRandomBytes(size: number): Buffer; - export function pseudoRandomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void; -} - -declare module "stream" { - import * as events from "events"; - - export class Stream extends events.EventEmitter { - pipe(destination: T, options?: { end?: boolean; }): T; - } - - export interface ReadableOptions { - highWaterMark?: number; - encoding?: string; - objectMode?: boolean; - } - - export class Readable extends events.EventEmitter implements NodeJS.ReadableStream { - readable: boolean; - constructor(opts?: ReadableOptions); - _read(size: number): void; - read(size?: number): any; - setEncoding(encoding: string): void; - pause(): void; - resume(): void; - pipe(destination: T, options?: { end?: boolean; }): T; - unpipe(destination?: T): void; - unshift(chunk: any): void; - wrap(oldStream: NodeJS.ReadableStream): NodeJS.ReadableStream; - push(chunk: any, encoding?: string): boolean; - } - - export interface WritableOptions { - highWaterMark?: number; - decodeStrings?: boolean; - objectMode?: boolean; - } - - export class Writable extends events.EventEmitter implements NodeJS.WritableStream { - writable: boolean; - constructor(opts?: WritableOptions); - _write(chunk: any, encoding: string, callback: Function): void; - write(chunk: any, cb?: Function): boolean; - write(chunk: any, encoding?: string, cb?: Function): boolean; - end(): void; - end(chunk: any, cb?: Function): void; - end(chunk: any, encoding?: string, cb?: Function): void; - } - - export interface DuplexOptions extends ReadableOptions, WritableOptions { - allowHalfOpen?: boolean; - } - - // Note: Duplex extends both Readable and Writable. - export class Duplex extends Readable implements NodeJS.ReadWriteStream { - writable: boolean; - constructor(opts?: DuplexOptions); - _write(chunk: any, encoding: string, callback: Function): void; - write(chunk: any, cb?: Function): boolean; - write(chunk: any, encoding?: string, cb?: Function): boolean; - end(): void; - end(chunk: any, cb?: Function): void; - end(chunk: any, encoding?: string, cb?: Function): void; - } - - export interface TransformOptions extends ReadableOptions, WritableOptions {} - - // Note: Transform lacks the _read and _write methods of Readable/Writable. - export class Transform extends events.EventEmitter implements NodeJS.ReadWriteStream { - readable: boolean; - writable: boolean; - constructor(opts?: TransformOptions); - _transform(chunk: any, encoding: string, callback: Function): void; - _flush(callback: Function): void; - read(size?: number): any; - setEncoding(encoding: string): void; - pause(): void; - resume(): void; - pipe(destination: T, options?: { end?: boolean; }): T; - unpipe(destination?: T): void; - unshift(chunk: any): void; - wrap(oldStream: NodeJS.ReadableStream): NodeJS.ReadableStream; - push(chunk: any, encoding?: string): boolean; - write(chunk: any, cb?: Function): boolean; - write(chunk: any, encoding?: string, cb?: Function): boolean; - end(): void; - end(chunk: any, cb?: Function): void; - end(chunk: any, encoding?: string, cb?: Function): void; - } - - export class PassThrough extends Transform {} -} - -declare module "util" { - export interface InspectOptions { - showHidden?: boolean; - depth?: number; - colors?: boolean; - customInspect?: boolean; - } - - export function format(format: any, ...param: any[]): string; - export function debug(string: string): void; - export function error(...param: any[]): void; - export function puts(...param: any[]): void; - export function print(...param: any[]): void; - export function log(string: string): void; - export function inspect(object: any, showHidden?: boolean, depth?: number, color?: boolean): string; - export function inspect(object: any, options: InspectOptions): string; - export function isArray(object: any): boolean; - export function isRegExp(object: any): boolean; - export function isDate(object: any): boolean; - export function isError(object: any): boolean; - export function inherits(constructor: any, superConstructor: any): void; - export function debuglog(key:string): (msg:string,...param: any[])=>void; -} - -declare module "assert" { - function internal (value: any, message?: string): void; - module internal { - export class AssertionError implements Error { - name: string; - message: string; - actual: any; - expected: any; - operator: string; - generatedMessage: boolean; - - constructor(options?: {message?: string; actual?: any; expected?: any; - operator?: string; stackStartFunction?: Function}); - } - - export function fail(actual?: any, expected?: any, message?: string, operator?: string): void; - export function ok(value: any, message?: string): void; - export function equal(actual: any, expected: any, message?: string): void; - export function notEqual(actual: any, expected: any, message?: string): void; - export function deepEqual(actual: any, expected: any, message?: string): void; - export function notDeepEqual(acutal: any, expected: any, message?: string): void; - export function strictEqual(actual: any, expected: any, message?: string): void; - export function notStrictEqual(actual: any, expected: any, message?: string): void; - export function deepStrictEqual(actual: any, expected: any, message?: string): void; - export function notDeepStrictEqual(actual: any, expected: any, message?: string): void; - export var throws: { - (block: Function, message?: string): void; - (block: Function, error: Function, message?: string): void; - (block: Function, error: RegExp, message?: string): void; - (block: Function, error: (err: any) => boolean, message?: string): void; - }; - - export var doesNotThrow: { - (block: Function, message?: string): void; - (block: Function, error: Function, message?: string): void; - (block: Function, error: RegExp, message?: string): void; - (block: Function, error: (err: any) => boolean, message?: string): void; - }; - - export function ifError(value: any): void; - } - - export = internal; -} - -declare module "tty" { - import * as net from "net"; - - export function isatty(fd: number): boolean; - export interface ReadStream extends net.Socket { - isRaw: boolean; - setRawMode(mode: boolean): void; - isTTY: boolean; - } - export interface WriteStream extends net.Socket { - columns: number; - rows: number; - isTTY: boolean; - } -} - -declare module "domain" { - import * as events from "events"; - - export class Domain extends events.EventEmitter { - run(fn: Function): void; - add(emitter: events.EventEmitter): void; - remove(emitter: events.EventEmitter): void; - bind(cb: (err: Error, data: any) => any): any; - intercept(cb: (data: any) => any): any; - dispose(): void; - - addListener(event: string, listener: Function): Domain; - on(event: string, listener: Function): Domain; - once(event: string, listener: Function): Domain; - removeListener(event: string, listener: Function): Domain; - removeAllListeners(event?: string): Domain; - } - - export function create(): Domain; -} - -declare module "constants" { - export var E2BIG: number; - export var EACCES: number; - export var EADDRINUSE: number; - export var EADDRNOTAVAIL: number; - export var EAFNOSUPPORT: number; - export var EAGAIN: number; - export var EALREADY: number; - export var EBADF: number; - export var EBADMSG: number; - export var EBUSY: number; - export var ECANCELED: number; - export var ECHILD: number; - export var ECONNABORTED: number; - export var ECONNREFUSED: number; - export var ECONNRESET: number; - export var EDEADLK: number; - export var EDESTADDRREQ: number; - export var EDOM: number; - export var EEXIST: number; - export var EFAULT: number; - export var EFBIG: number; - export var EHOSTUNREACH: number; - export var EIDRM: number; - export var EILSEQ: number; - export var EINPROGRESS: number; - export var EINTR: number; - export var EINVAL: number; - export var EIO: number; - export var EISCONN: number; - export var EISDIR: number; - export var ELOOP: number; - export var EMFILE: number; - export var EMLINK: number; - export var EMSGSIZE: number; - export var ENAMETOOLONG: number; - export var ENETDOWN: number; - export var ENETRESET: number; - export var ENETUNREACH: number; - export var ENFILE: number; - export var ENOBUFS: number; - export var ENODATA: number; - export var ENODEV: number; - export var ENOENT: number; - export var ENOEXEC: number; - export var ENOLCK: number; - export var ENOLINK: number; - export var ENOMEM: number; - export var ENOMSG: number; - export var ENOPROTOOPT: number; - export var ENOSPC: number; - export var ENOSR: number; - export var ENOSTR: number; - export var ENOSYS: number; - export var ENOTCONN: number; - export var ENOTDIR: number; - export var ENOTEMPTY: number; - export var ENOTSOCK: number; - export var ENOTSUP: number; - export var ENOTTY: number; - export var ENXIO: number; - export var EOPNOTSUPP: number; - export var EOVERFLOW: number; - export var EPERM: number; - export var EPIPE: number; - export var EPROTO: number; - export var EPROTONOSUPPORT: number; - export var EPROTOTYPE: number; - export var ERANGE: number; - export var EROFS: number; - export var ESPIPE: number; - export var ESRCH: number; - export var ETIME: number; - export var ETIMEDOUT: number; - export var ETXTBSY: number; - export var EWOULDBLOCK: number; - export var EXDEV: number; - export var WSAEINTR: number; - export var WSAEBADF: number; - export var WSAEACCES: number; - export var WSAEFAULT: number; - export var WSAEINVAL: number; - export var WSAEMFILE: number; - export var WSAEWOULDBLOCK: number; - export var WSAEINPROGRESS: number; - export var WSAEALREADY: number; - export var WSAENOTSOCK: number; - export var WSAEDESTADDRREQ: number; - export var WSAEMSGSIZE: number; - export var WSAEPROTOTYPE: number; - export var WSAENOPROTOOPT: number; - export var WSAEPROTONOSUPPORT: number; - export var WSAESOCKTNOSUPPORT: number; - export var WSAEOPNOTSUPP: number; - export var WSAEPFNOSUPPORT: number; - export var WSAEAFNOSUPPORT: number; - export var WSAEADDRINUSE: number; - export var WSAEADDRNOTAVAIL: number; - export var WSAENETDOWN: number; - export var WSAENETUNREACH: number; - export var WSAENETRESET: number; - export var WSAECONNABORTED: number; - export var WSAECONNRESET: number; - export var WSAENOBUFS: number; - export var WSAEISCONN: number; - export var WSAENOTCONN: number; - export var WSAESHUTDOWN: number; - export var WSAETOOMANYREFS: number; - export var WSAETIMEDOUT: number; - export var WSAECONNREFUSED: number; - export var WSAELOOP: number; - export var WSAENAMETOOLONG: number; - export var WSAEHOSTDOWN: number; - export var WSAEHOSTUNREACH: number; - export var WSAENOTEMPTY: number; - export var WSAEPROCLIM: number; - export var WSAEUSERS: number; - export var WSAEDQUOT: number; - export var WSAESTALE: number; - export var WSAEREMOTE: number; - export var WSASYSNOTREADY: number; - export var WSAVERNOTSUPPORTED: number; - export var WSANOTINITIALISED: number; - export var WSAEDISCON: number; - export var WSAENOMORE: number; - export var WSAECANCELLED: number; - export var WSAEINVALIDPROCTABLE: number; - export var WSAEINVALIDPROVIDER: number; - export var WSAEPROVIDERFAILEDINIT: number; - export var WSASYSCALLFAILURE: number; - export var WSASERVICE_NOT_FOUND: number; - export var WSATYPE_NOT_FOUND: number; - export var WSA_E_NO_MORE: number; - export var WSA_E_CANCELLED: number; - export var WSAEREFUSED: number; - export var SIGHUP: number; - export var SIGINT: number; - export var SIGILL: number; - export var SIGABRT: number; - export var SIGFPE: number; - export var SIGKILL: number; - export var SIGSEGV: number; - export var SIGTERM: number; - export var SIGBREAK: number; - export var SIGWINCH: number; - export var SSL_OP_ALL: number; - export var SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; - export var SSL_OP_CIPHER_SERVER_PREFERENCE: number; - export var SSL_OP_CISCO_ANYCONNECT: number; - export var SSL_OP_COOKIE_EXCHANGE: number; - export var SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; - export var SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; - export var SSL_OP_EPHEMERAL_RSA: number; - export var SSL_OP_LEGACY_SERVER_CONNECT: number; - export var SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number; - export var SSL_OP_MICROSOFT_SESS_ID_BUG: number; - export var SSL_OP_MSIE_SSLV2_RSA_PADDING: number; - export var SSL_OP_NETSCAPE_CA_DN_BUG: number; - export var SSL_OP_NETSCAPE_CHALLENGE_BUG: number; - export var SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number; - export var SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number; - export var SSL_OP_NO_COMPRESSION: number; - export var SSL_OP_NO_QUERY_MTU: number; - export var SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; - export var SSL_OP_NO_SSLv2: number; - export var SSL_OP_NO_SSLv3: number; - export var SSL_OP_NO_TICKET: number; - export var SSL_OP_NO_TLSv1: number; - export var SSL_OP_NO_TLSv1_1: number; - export var SSL_OP_NO_TLSv1_2: number; - export var SSL_OP_PKCS1_CHECK_1: number; - export var SSL_OP_PKCS1_CHECK_2: number; - export var SSL_OP_SINGLE_DH_USE: number; - export var SSL_OP_SINGLE_ECDH_USE: number; - export var SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number; - export var SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number; - export var SSL_OP_TLS_BLOCK_PADDING_BUG: number; - export var SSL_OP_TLS_D5_BUG: number; - export var SSL_OP_TLS_ROLLBACK_BUG: number; - export var ENGINE_METHOD_DSA: number; - export var ENGINE_METHOD_DH: number; - export var ENGINE_METHOD_RAND: number; - export var ENGINE_METHOD_ECDH: number; - export var ENGINE_METHOD_ECDSA: number; - export var ENGINE_METHOD_CIPHERS: number; - export var ENGINE_METHOD_DIGESTS: number; - export var ENGINE_METHOD_STORE: number; - export var ENGINE_METHOD_PKEY_METHS: number; - export var ENGINE_METHOD_PKEY_ASN1_METHS: number; - export var ENGINE_METHOD_ALL: number; - export var ENGINE_METHOD_NONE: number; - export var DH_CHECK_P_NOT_SAFE_PRIME: number; - export var DH_CHECK_P_NOT_PRIME: number; - export var DH_UNABLE_TO_CHECK_GENERATOR: number; - export var DH_NOT_SUITABLE_GENERATOR: number; - export var NPN_ENABLED: number; - export var RSA_PKCS1_PADDING: number; - export var RSA_SSLV23_PADDING: number; - export var RSA_NO_PADDING: number; - export var RSA_PKCS1_OAEP_PADDING: number; - export var RSA_X931_PADDING: number; - export var RSA_PKCS1_PSS_PADDING: number; - export var POINT_CONVERSION_COMPRESSED: number; - export var POINT_CONVERSION_UNCOMPRESSED: number; - export var POINT_CONVERSION_HYBRID: number; - export var O_RDONLY: number; - export var O_WRONLY: number; - export var O_RDWR: number; - export var S_IFMT: number; - export var S_IFREG: number; - export var S_IFDIR: number; - export var S_IFCHR: number; - export var S_IFLNK: number; - export var O_CREAT: number; - export var O_EXCL: number; - export var O_TRUNC: number; - export var O_APPEND: number; - export var F_OK: number; - export var R_OK: number; - export var W_OK: number; - export var X_OK: number; - export var UV_UDP_REUSEADDR: number; -} diff --git a/decl/react-dom.d.ts b/decl/react-dom.d.ts deleted file mode 100644 index 1f6ca6efd..000000000 --- a/decl/react-dom.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -// Type definitions for React v0.14 (react-dom) -// Project: http://facebook.github.io/react/ -// Definitions by: Asana , AssureSign , Microsoft -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare namespace __React { - namespace __DOM { - function findDOMNode(instance: ReactInstance): E; - function findDOMNode(instance: ReactInstance): Element; - - function render

( - element: DOMElement, - container: Element, - callback?: (element: T) => any): T; - function render

( - element: SFCElement

, - container: Element, - callback?: () => any): void; - function render>( - element: CElement, - container: Element, - callback?: (component: T) => any): T; - function render

( - element: ReactElement

( - parentComponent: Component, - element: DOMElement, - container: Element, - callback?: (element: T) => any): T; - function unstable_renderSubtreeIntoContainer>( - parentComponent: Component, - element: CElement, - container: Element, - callback?: (component: T) => any): T; - function render

( - parentComponent: Component, - element: SFCElement

, - container: Element, - callback?: () => any): void; - function unstable_renderSubtreeIntoContainer

( - parentComponent: Component, - element: ReactElement

, - container: Element, - callback?: (component?: Component | Element) => any): Component | Element | void; - } - - namespace __DOMServer { - function renderToString(element: ReactElement): string; - function renderToStaticMarkup(element: ReactElement): string; - var version: string; - } -} - -declare module "react-dom" { - import DOM = __React.__DOM; - export = DOM; -} - -declare module "react-dom/server" { - import DOMServer = __React.__DOMServer; - export = DOMServer; -} diff --git a/decl/react-global.d.ts b/decl/react-global.d.ts deleted file mode 100644 index 912d029e9..000000000 --- a/decl/react-global.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Type definitions for React v0.14 (namespace) -// Project: http://facebook.github.io/react/ -// Definitions by: Asana , AssureSign , Microsoft -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// -/// - -import React = __React; -import ReactDOM = __React.__DOM; - diff --git a/decl/react.d.ts b/decl/react.d.ts deleted file mode 100644 index 5cba33227..000000000 --- a/decl/react.d.ts +++ /dev/null @@ -1,2547 +0,0 @@ -// Type definitions for React v0.14 -// Project: http://facebook.github.io/react/ -// Definitions by: Asana , AssureSign , Microsoft , John Reilly -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace __React { - - // - // React Elements - // ---------------------------------------------------------------------- - - type ReactType = string | ComponentClass | StatelessComponent; - - type Key = string | number; - type Ref = string | ((instance: T) => any); - type ComponentState = {} | void; - - interface Attributes { - key?: Key; - } - interface ClassAttributes extends Attributes { - ref?: Ref; - } - - interface ReactElement

{ - type: string | ComponentClass

| SFC

; - props: P; - key?: Key; - } - - interface SFCElement

extends ReactElement

{ - type: SFC

; - } - - type CElement> = ComponentElement; - interface ComponentElement> extends ReactElement

{ - type: ComponentClass

; - ref?: Ref; - } - - type ClassicElement

= CElement>; - - interface DOMElement

extends ReactElement

{ - type: string; - ref: Ref; - } - - interface ReactHTMLElement extends DOMElement { - } - - interface ReactSVGElement extends DOMElement { - } - - // - // Factories - // ---------------------------------------------------------------------- - - interface Factory

{ - (props?: P & Attributes, ...children: ReactNode[]): ReactElement

; - } - - interface SFCFactory

{ - (props?: P & Attributes, ...children: ReactNode[]): SFCElement

; - } - - interface ComponentFactory> { - (props?: P & ClassAttributes, ...children: ReactNode[]): CElement; - } - - type CFactory> = ComponentFactory; - type ClassicFactory

= CFactory>; - - interface DOMFactory

{ - (props?: P & ClassAttributes, ...children: ReactNode[]): DOMElement; - } - - interface HTMLFactory extends DOMFactory { - } - - interface SVGFactory extends DOMFactory { - } - - // - // React Nodes - // http://facebook.github.io/react/docs/glossary.html - // ---------------------------------------------------------------------- - - type ReactText = string | number; - type ReactChild = ReactElement | ReactText; - - // Should be Array but type aliases cannot be recursive - type ReactFragment = {} | Array; - type ReactNode = ReactChild | ReactFragment | boolean; - - // - // Top Level API - // ---------------------------------------------------------------------- - - function createClass(spec: ComponentSpec): ClassicComponentClass

; - - function createFactory

( - type: string): DOMFactory; - function createFactory

(type: SFC

): SFCFactory

; - function createFactory

( - type: ClassType, ClassicComponentClass

>): CFactory>; - function createFactory, C extends ComponentClass

>( - type: ClassType): CFactory; - function createFactory

(type: ComponentClass

| SFC

): Factory

; - - function createElement

( - type: string, - props?: P & ClassAttributes, - ...children: ReactNode[]): DOMElement; - function createElement

( - type: SFC

, - props?: P & Attributes, - ...children: ReactNode[]): SFCElement

; - function createElement

( - type: ClassType, ClassicComponentClass

>, - props?: P & ClassAttributes>, - ...children: ReactNode[]): CElement>; - function createElement, C extends ComponentClass

>( - type: ClassType, - props?: P & ClassAttributes, - ...children: ReactNode[]): CElement; - function createElement

( - type: ComponentClass

| SFC

, - props?: P & Attributes, - ...children: ReactNode[]): ReactElement

; - - function cloneElement

( - element: DOMElement, - props?: P & ClassAttributes, - ...children: ReactNode[]): DOMElement; - function cloneElement

( - element: SFCElement

, - props?: Q, // should be Q & Attributes, but then Q is inferred as {} - ...children: ReactNode[]): SFCElement

; - function cloneElement

>( - element: CElement, - props?: Q, // should be Q & ClassAttributes - ...children: ReactNode[]): CElement; - function cloneElement

( - element: ReactElement

, - props?: Q, // should be Q & Attributes - ...children: ReactNode[]): ReactElement

; - - function isValidElement

(object: {}): object is ReactElement

; - - var DOM: ReactDOM; - var PropTypes: ReactPropTypes; - var Children: ReactChildren; - var version: string; - - // - // Component API - // ---------------------------------------------------------------------- - - type ReactInstance = Component | Element; - - // Base component for plain JS classes - class Component implements ComponentLifecycle { - constructor(props?: P, context?: any); - setState(f: (prevState: S, props: P) => S, callback?: () => any): void; - setState(state: S, callback?: () => any): void; - forceUpdate(callback?: () => any): void; - render(): JSX.Element; - - // React.Props is now deprecated, which means that the `children` - // property is not available on `P` by default, even though you can - // always pass children as variadic arguments to `createElement`. - // In the future, if we can define its call signature conditionally - // on the existence of `children` in `P`, then we should remove this. - props: P & { children?: ReactNode }; - state: S; - context: any; - refs: { - [key: string]: ReactInstance - }; - } - - class PureComponent extends Component {} - - interface ClassicComponent extends Component { - replaceState(nextState: S, callback?: () => any): void; - isMounted(): boolean; - getInitialState?(): S; - } - - interface ChildContextProvider { - getChildContext(): CC; - } - - // - // Class Interfaces - // ---------------------------------------------------------------------- - - type SFC

= StatelessComponent

; - interface StatelessComponent

{ - (props: P, context?: any): ReactElement; - propTypes?: ValidationMap

; - contextTypes?: ValidationMap; - defaultProps?: P; - displayName?: string; - } - - interface ComponentClass

{ - new(props?: P, context?: any): Component; - propTypes?: ValidationMap

; - contextTypes?: ValidationMap; - childContextTypes?: ValidationMap; - defaultProps?: P; - displayName?: string; - } - - interface ClassicComponentClass

extends ComponentClass

{ - new(props?: P, context?: any): ClassicComponent; - getDefaultProps?(): P; - } - - /** - * We use an intersection type to infer multiple type parameters from - * a single argument, which is useful for many top-level API defs. - * See https://github.com/Microsoft/TypeScript/issues/7234 for more info. - */ - type ClassType, C extends ComponentClass

> = - C & - (new() => T) & - (new() => { props: P }); - - // - // Component Specs and Lifecycle - // ---------------------------------------------------------------------- - - interface ComponentLifecycle { - componentWillMount?(): void; - componentDidMount?(): void; - componentWillReceiveProps?(nextProps: P, nextContext: any): void; - shouldComponentUpdate?(nextProps: P, nextState: S, nextContext: any): boolean; - componentWillUpdate?(nextProps: P, nextState: S, nextContext: any): void; - componentDidUpdate?(prevProps: P, prevState: S, prevContext: any): void; - componentWillUnmount?(): void; - } - - interface Mixin extends ComponentLifecycle { - mixins?: Mixin; - statics?: { - [key: string]: any; - }; - - displayName?: string; - propTypes?: ValidationMap; - contextTypes?: ValidationMap; - childContextTypes?: ValidationMap; - - getDefaultProps?(): P; - getInitialState?(): S; - } - - interface ComponentSpec extends Mixin { - render(): ReactElement; - - [propertyName: string]: any; - } - - // - // Event System - // ---------------------------------------------------------------------- - - interface SyntheticEvent { - bubbles: boolean; - cancelable: boolean; - currentTarget: EventTarget; - defaultPrevented: boolean; - eventPhase: number; - isTrusted: boolean; - nativeEvent: Event; - preventDefault(): void; - isDefaultPrevented(): boolean; - stopPropagation(): void; - isPropagationStopped(): boolean; - persist(): void; - target: EventTarget; - timeStamp: Date; - type: string; - } - - interface ClipboardEvent extends SyntheticEvent { - clipboardData: DataTransfer; - } - - interface CompositionEvent extends SyntheticEvent { - data: string; - } - - interface DragEvent extends MouseEvent { - dataTransfer: DataTransfer; - } - - interface FocusEvent extends SyntheticEvent { - relatedTarget: EventTarget; - } - - interface FormEvent extends SyntheticEvent { - } - - interface KeyboardEvent extends SyntheticEvent { - altKey: boolean; - charCode: number; - ctrlKey: boolean; - getModifierState(key: string): boolean; - key: string; - keyCode: number; - locale: string; - location: number; - metaKey: boolean; - repeat: boolean; - shiftKey: boolean; - which: number; - } - - interface MouseEvent extends SyntheticEvent { - altKey: boolean; - button: number; - buttons: number; - clientX: number; - clientY: number; - ctrlKey: boolean; - getModifierState(key: string): boolean; - metaKey: boolean; - pageX: number; - pageY: number; - relatedTarget: EventTarget; - screenX: number; - screenY: number; - shiftKey: boolean; - } - - interface TouchEvent extends SyntheticEvent { - altKey: boolean; - changedTouches: TouchList; - ctrlKey: boolean; - getModifierState(key: string): boolean; - metaKey: boolean; - shiftKey: boolean; - targetTouches: TouchList; - touches: TouchList; - } - - interface UIEvent extends SyntheticEvent { - detail: number; - view: AbstractView; - } - - interface WheelEvent extends MouseEvent { - deltaMode: number; - deltaX: number; - deltaY: number; - deltaZ: number; - } - - interface AnimationEvent extends SyntheticEvent { - animationName: string; - pseudoElement: string; - elapsedTime: number; - } - - interface TransitionEvent extends SyntheticEvent { - propertyName: string; - pseudoElement: string; - elapsedTime: number; - } - - // - // Event Handler Types - // ---------------------------------------------------------------------- - - interface EventHandler { - (event: E): void; - } - - type ReactEventHandler = EventHandler; - - type ClipboardEventHandler = EventHandler; - type CompositionEventHandler = EventHandler; - type DragEventHandler = EventHandler; - type FocusEventHandler = EventHandler; - type FormEventHandler = EventHandler; - type KeyboardEventHandler = EventHandler; - type MouseEventHandler = EventHandler; - type TouchEventHandler = EventHandler; - type UIEventHandler = EventHandler; - type WheelEventHandler = EventHandler; - type AnimationEventHandler = EventHandler; - type TransitionEventHandler = EventHandler; - - // - // Props / DOM Attributes - // ---------------------------------------------------------------------- - - /** - * @deprecated. This was used to allow clients to pass `ref` and `key` - * to `createElement`, which is no longer necessary due to intersection - * types. If you need to declare a props object before passing it to - * `createElement` or a factory, use `ClassAttributes`: - * - * ```ts - * var b: Button; - * var props: ButtonProps & ClassAttributes

, - container: Element, - callback?: (component?: Component | Element) => any): Component | Element | void; - - function unmountComponentAtNode(container: Element): boolean; - - var version: string; - - function unstable_batchedUpdates(callback: (a: A, b: B) => any, a: A, b: B): void; - function unstable_batchedUpdates(callback: (a: A) => any, a: A): void; - function unstable_batchedUpdates(callback: () => any): void; - - function unstable_renderSubtreeIntoContainer

diff --git a/node_modules/sax/lib/sax.js b/node_modules/sax/lib/sax.js index f125c5fee..db0d4c316 100644 --- a/node_modules/sax/lib/sax.js +++ b/node_modules/sax/lib/sax.js @@ -267,8 +267,6 @@ // this really needs to be replaced with character classes. // XML allows all manner of ridiculous numbers and digits. - var number = '0124356789' - var letter = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' // (Letter | "_" | ":") var quote = '\'"' @@ -281,8 +279,6 @@ // turn all the string character sets into character class objects. whitespace = charClass(whitespace) - number = charClass(number) - letter = charClass(letter) // http://www.w3.org/TR/REC-xml/#NT-NameStartChar // This implementation works on strings, a single character at a time @@ -292,10 +288,10 @@ // is left as an exercise for the reader. var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ - var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/ + var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ - var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/ + var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ quote = charClass(quote) attribEnd = charClass(attribEnd) @@ -307,12 +303,16 @@ }, {}) } - function isRegExp (c) { - return Object.prototype.toString.call(c) === '[object RegExp]' + function isMatch (regex, c) { + return regex.test(c) } function is (charclass, c) { - return isRegExp(charclass) ? !!c.match(charclass) : charclass[c] + return charclass[c] + } + + function notMatch (regex, c) { + return !isMatch(regex, c) } function not (charclass, c) { @@ -998,9 +998,11 @@ while (true) { c = charAt(chunk, i++) parser.c = c + if (!c) { break } + if (parser.trackPosition) { parser.position++ if (c === '\n') { @@ -1010,6 +1012,7 @@ parser.column++ } } + switch (parser.state) { case S.BEGIN: parser.state = S.BEGIN_WHITESPACE @@ -1080,7 +1083,7 @@ parser.sgmlDecl = '' } else if (is(whitespace, c)) { // wait for it... - } else if (is(nameStart, c)) { + } else if (isMatch(nameStart, c)) { parser.state = S.OPEN_TAG parser.tagName = c } else if (c === '/') { @@ -1283,7 +1286,7 @@ continue case S.OPEN_TAG: - if (is(nameBody, c)) { + if (isMatch(nameBody, c)) { parser.tagName += c } else { newTag(parser) @@ -1318,7 +1321,7 @@ openTag(parser) } else if (c === '/') { parser.state = S.OPEN_TAG_SLASH - } else if (is(nameStart, c)) { + } else if (isMatch(nameStart, c)) { parser.attribName = c parser.attribValue = '' parser.state = S.ATTRIB_NAME @@ -1337,7 +1340,7 @@ openTag(parser) } else if (is(whitespace, c)) { parser.state = S.ATTRIB_NAME_SAW_WHITE - } else if (is(nameBody, c)) { + } else if (isMatch(nameBody, c)) { parser.attribName += c } else { strictFail(parser, 'Invalid attribute name') @@ -1360,7 +1363,7 @@ parser.attribName = '' if (c === '>') { openTag(parser) - } else if (is(nameStart, c)) { + } else if (isMatch(nameStart, c)) { parser.attribName = c parser.state = S.ATTRIB_NAME } else { @@ -1404,7 +1407,7 @@ openTag(parser) } else if (c === '/') { parser.state = S.OPEN_TAG_SLASH - } else if (is(nameStart, c)) { + } else if (isMatch(nameStart, c)) { strictFail(parser, 'No whitespace between attributes') parser.attribName = c parser.attribValue = '' @@ -1435,7 +1438,7 @@ if (!parser.tagName) { if (is(whitespace, c)) { continue - } else if (not(nameStart, c)) { + } else if (notMatch(nameStart, c)) { if (parser.script) { parser.script += '') { closeTag(parser) - } else if (is(nameBody, c)) { + } else if (isMatch(nameBody, c)) { parser.tagName += c } else if (parser.script) { parser.script += ' (http://blog.izs.me/)", - "version": "1.2.1", + "version": "1.2.2", "main": "lib/sax.js", "license": "ISC", "scripts": { - "test": "tap test/*.js --cov", + "test": "tap test/*.js --cov -j4", "posttest": "standard -F test/*.js lib/*.js" }, "repository": "git://github.com/isaacs/sax-js.git", "files": [ "lib/sax.js", "LICENSE", - "LICENSE-W3C.html", "README.md" ], "devDependencies": { - "standard": "^5.3.1", - "tap": "^5.2.0" + "standard": "^8.6.0", + "tap": "^10.0.2" } } diff --git a/node_modules/selenium-webdriver/CHANGES.md b/node_modules/selenium-webdriver/CHANGES.md index b9ac5fd22..1cdc96814 100644 --- a/node_modules/selenium-webdriver/CHANGES.md +++ b/node_modules/selenium-webdriver/CHANGES.md @@ -1,3 +1,42 @@ +## v3.3.0 + +* Added warning log messages when the user creates new managed promises, or + schedules unchained tasks. Users may opt in to printing these log messages + with + + ```js + const {logging} = require('selenium-webdriver'); + logging.installConsoleHandler(); + logging.getLogger('promise.ControlFlow').setLevel(logging.Level.WARNING); + ``` +* If the `JAVA_HOME` environment variable is set, use it to locate java.exe. + + +## v3.2.0 + +* Release skipped to stay in sync with the main Selenium project. + + +## v3.1.0 + +* The `lib` package is once again platform agnostic (excluding `lib/devmode`). +* Deprecated `promise.when(value, callback, errback)`. + Use `promise.fulfilled(value).then(callback, errback)` +* Changed `promise.fulfilled(value)`, `promise.rejected(reason)` and + `promise.defer()` to all use native promises when the promise manager is + disabled. +* Properly handle W3C error responses to new session commands. +* Updated `selenium-webdriver/testing` to export `describe.only` along with + `describe.skip`. +* Fixed `selenium-webdriver/lib/until.ableToSwitchToFrame`. It was previously + dropping arguments and would never work. +* Added the ability to use Firefox Nightly +* If Firefox cannot be found in the default location, look for it on the PATH +* Allow SafariDriver to use Safari Technology Preview. +* Use the proper wire command for WebElement.getLocation() and + WebElement.getSize() for W3C compliant drivers. + + ## v3.0.1 * More API adjustments to align with native Promises diff --git a/node_modules/selenium-webdriver/README.md b/node_modules/selenium-webdriver/README.md index bc281d504..31708b186 100644 --- a/node_modules/selenium-webdriver/README.md +++ b/node_modules/selenium-webdriver/README.md @@ -136,16 +136,16 @@ will also have "best effort" support. Releases older than the latest LTS, _semver-major_ releases, and all unstable release branches (e.g. "v.Next") are considered strictly unsupported. -For example, suppose the current LTS and stable releases are v4.2.4 and v5.4.1, +For example, suppose the current LTS and stable releases are v6.9.5 and v7.5.0, respectively. Then a Selenium release would have the following support levels: | Version | Support | | ------- | ------------- | -| <= 4.1 | _unsupported_ | -| 4.2 | supported | -| 5.0-3 | best effort | -| 5.4 | supported | -| >= 5.5 | best effort | +| <= 6.8 | _unsupported_ | +| 6.9 | supported | +| 7.0-4 | best effort | +| 7.5 | supported | +| >= 7.5 | best effort | | v.Next | _unsupported_ | ### Support Level Definitions @@ -168,11 +168,11 @@ months, the support window for selenium-webdriver will be roughly: | Date | LTS | Stable | | --------- | ---: | -----: | -| (current) | 4.2 | 5.0 | -| 2016-04 | 4.2 | 6.0 | -| 2016-10 | 6.0 | 7.0 | +| (current) | 6.9 | 7.5 | | 2017-04 | 6.0 | 8.0 | | 2017-10 | 8.0 | 9.0 | +| 2018-04 | 8.0 | 10.0 | +| 2018-10 | 10.0 | 11.0 | ## Issues diff --git a/node_modules/selenium-webdriver/chrome.js b/node_modules/selenium-webdriver/chrome.js index eb33df9ed..2dbc93351 100644 --- a/node_modules/selenium-webdriver/chrome.js +++ b/node_modules/selenium-webdriver/chrome.js @@ -59,7 +59,7 @@ * let options = new chrome.Options(); * // configure browser options ... * - * let driver = new chrome.Driver(options, service); + * let driver = chrome.Driver.createSession(options, service); * * Users should only instantiate the {@link Driver} class directly when they * need a custom driver service configuration (as shown above). For normal @@ -595,7 +595,7 @@ class Options { * let options = new chrome.Options().setMobileEmulation( * {deviceName: 'Google Nexus 5'}); * - * let driver = new chrome.Driver(options); + * let driver = chrome.Driver.createSession(options); * * __Example 2: Using Custom Screen Configuration__ * @@ -605,7 +605,7 @@ class Options { * pixelRatio: 3.0 * }); * - * let driver = new chrome.Driver(options); + * let driver = chrome.Driver.createSession(options); * * * [em]: https://sites.google.com/a/chromium.org/chromedriver/mobile-emulation diff --git a/node_modules/selenium-webdriver/edge.js b/node_modules/selenium-webdriver/edge.js index ee9d43383..9280cabd9 100644 --- a/node_modules/selenium-webdriver/edge.js +++ b/node_modules/selenium-webdriver/edge.js @@ -58,7 +58,7 @@ * var options = new edge.Options(); * // configure browser options ... * - * var driver = new edge.Driver(options, service); + * var driver = edge.Driver.createSession(options, service); * * Users should only instantiate the {@link Driver} class directly when they * need a custom driver service configuration (as shown above). For normal diff --git a/node_modules/selenium-webdriver/firefox/binary.js b/node_modules/selenium-webdriver/firefox/binary.js index b997b480d..a1360bab7 100644 --- a/node_modules/selenium-webdriver/firefox/binary.js +++ b/node_modules/selenium-webdriver/firefox/binary.js @@ -47,27 +47,17 @@ const NO_FOCUS_LIB_AMD64 = isDevMode ? const X_IGNORE_NO_FOCUS_LIB = 'x_ignore_nofocus.so'; -let foundBinary = null; -let foundDevBinary = null; - - /** - * Checks the default Windows Firefox locations in Program Files. - * - * @param {boolean=} opt_dev Whether to find the Developer Edition. + * @param {string} file Path to the file to find, relative to the program files + * root. * @return {!Promise} A promise for the located executable. * The promise will resolve to {@code null} if Firefox was not found. */ -function defaultWindowsLocation(opt_dev) { - var files = [ +function findInProgramFiles(file) { + let files = [ process.env['PROGRAMFILES'] || 'C:\\Program Files', process.env['PROGRAMFILES(X86)'] || 'C:\\Program Files (x86)' - ].map(function(prefix) { - if (opt_dev) { - return path.join(prefix, 'Firefox Developer Edition\\firefox.exe'); - } - return path.join(prefix, 'Mozilla Firefox\\firefox.exe'); - }); + ].map(prefix => path.join(prefix, file)); return io.exists(files[0]).then(function(exists) { return exists ? files[0] : io.exists(files[1]).then(function(exists) { return exists ? files[1] : null; @@ -77,51 +67,106 @@ function defaultWindowsLocation(opt_dev) { /** - * Locates the Firefox binary for the current system. + * Provides methods for locating the executable for a Firefox release channel + * on Windows and MacOS. For other systems (i.e. Linux), Firefox will always + * be located on the system PATH. * - * @param {boolean=} opt_dev Whether to find the Developer Edition. This only - * used on Windows and OSX. - * @return {!Promise} A promise for the located binary. The promise will - * be rejected if Firefox cannot be located. + * @final */ -function findFirefox(opt_dev) { - if (opt_dev && foundDevBinary) { - return foundDevBinary; +class Channel { + /** + * @param {string} darwin The path to check when running on MacOS. + * @param {string} win32 The path to check when running on Windows. + */ + constructor(darwin, win32) { + /** @private @const */ this.darwin_ = darwin; + /** @private @const */ this.win32_ = win32; + /** @private {Promise} */ + this.found_ = null; } - if (!opt_dev && foundBinary) { - return foundBinary; - } - - let found; - if (process.platform === 'darwin') { - let exe = opt_dev - ? '/Applications/FirefoxDeveloperEdition.app/Contents/MacOS/firefox-bin' - : '/Applications/Firefox.app/Contents/MacOS/firefox-bin'; - found = io.exists(exe).then(exists => exists ? exe : null); - - } else if (process.platform === 'win32') { - found = defaultWindowsLocation(opt_dev); - - } else { - found = Promise.resolve(io.findInPath('firefox')); - } - - found = found.then(found => { - if (found) { - return found; + /** + * Attempts to locate the Firefox executable for this release channel. This + * will first check the default installation location for the channel before + * checking the user's PATH. The returned promise will be rejected if Firefox + * can not be found. + * + * @return {!Promise} A promise for the location of the located + * Firefox executable. + */ + locate() { + if (this.found_) { + return this.found_; } - throw Error('Could not locate Firefox on the current system'); - }); - if (opt_dev) { - return foundDevBinary = found; - } else { - return foundBinary = found; + let found; + switch (process.platform) { + case 'darwin': + found = io.exists(this.darwin_) + .then(exists => exists ? this.darwin_ : io.findInPath('firefox')); + break; + + case 'win32': + found = findInProgramFiles(this.win32_) + .then(found => found || io.findInPath('firefox.exe')); + break; + + default: + found = Promise.resolve(io.findInPath('firefox')); + break; + } + + this.found_ = found.then(found => { + if (found) { + // TODO: verify version info. + return found; + } + throw Error('Could not locate Firefox on the current system'); + }); + return this.found_; } } +/** + * Firefox's developer channel. + * @const + * @see + */ +Channel.AURORA = new Channel( + '/Applications/FirefoxDeveloperEdition.app/Contents/MacOS/firefox-bin', + 'Firefox Developer Edition\\firefox.exe'); + +/** + * Firefox's beta channel. Note this is provided mainly for convenience as + * the beta channel has the same installation location as the main release + * channel. + * @const + * @see + */ +Channel.BETA = new Channel( + '/Applications/Firefox.app/Contents/MacOS/firefox-bin', + 'Mozilla Firefox\\firefox.exe'); + +/** + * Firefox's release channel. + * @const + * @see + */ +Channel.RELEASE = new Channel( + '/Applications/Firefox.app/Contents/MacOS/firefox-bin', + 'Mozilla Firefox\\firefox.exe'); + +/** + * Firefox's nightly release channel. + * @const + * @see + */ +Channel.NIGHTLY = new Channel( + '/Applications/FirefoxNightly.app/Contents/MacOS/firefox-bin', + 'Nightly\\firefox.exe'); + + /** * Copies the no focus libs into the given profile directory. * @param {string} profileDir Path to the profile directory to install into. @@ -151,20 +196,23 @@ function installNoFocusLibs(profileDir) { * use with WebDriver. * * If created _without_ a path for the Firefox binary to use, this class will - * attempt to find Firefox when {@link #launch()} is called. For OSX and + * attempt to find Firefox when {@link #launch()} is called. For MacOS and * Windows, this class will look for Firefox in the current platform's default - * installation location (e.g. /Applications/Firefox.app on OSX). For all other - * platforms, the Firefox executable must be available on your system `PATH`. + * installation location (e.g. /Applications/Firefox.app on MacOS). For all + * other platforms, the Firefox executable must be available on your system + * `PATH`. * * @final */ class Binary { /** - * @param {string=} opt_exe Path to the Firefox binary to use. + * @param {?(string|Channel)=} opt_exeOrChannel Either the path to a specific + * Firefox binary to use, or a {@link Channel} instance that describes + * how to locate the desired Firefox version. */ - constructor(opt_exe) { - /** @private {(string|undefined)} */ - this.exe_ = opt_exe; + constructor(opt_exeOrChannel) { + /** @private {?(string|Channel)} */ + this.exe_ = opt_exeOrChannel || null; /** @private {!Array.} */ this.args_ = []; @@ -187,7 +235,7 @@ class Binary { * on the current system. */ getExe() { - return this.exe_; + return typeof this.exe_ === 'string' ? this.exe_ : undefined; } /** @@ -223,6 +271,8 @@ class Binary { * * @param {boolean=} opt_use Whether to use the developer edition. Defaults to * true. + * @deprecated Use the {@link Channel} class to indicate the desired Firefox + * version when creating a new binary: `new Binary(Channel.AURORA)`. */ useDevEdition(opt_use) { this.devEdition_ = opt_use === undefined || !!opt_use; @@ -238,7 +288,13 @@ class Binary { * used by this instance. */ locate() { - return Promise.resolve(this.exe_ || findFirefox(this.devEdition_)); + if (typeof this.exe_ === 'string') { + return Promise.resolve(this.exe_); + } else if (this.exe_ instanceof Channel) { + return this.exe_.locate(); + } + let channel = this.devEdition_ ? Channel.AURORA : Channel.RELEASE; + return channel.locate(); } /** @@ -284,4 +340,5 @@ class Binary { exports.Binary = Binary; +exports.Channel = Channel; diff --git a/node_modules/selenium-webdriver/firefox/extension.js b/node_modules/selenium-webdriver/firefox/extension.js index 60abb06b8..3bda759a7 100644 --- a/node_modules/selenium-webdriver/firefox/extension.js +++ b/node_modules/selenium-webdriver/firefox/extension.js @@ -161,7 +161,7 @@ function readManifest(addonPath) { manifest = io.stat(addonPath).then(function(stats) { if (!stats.isDirectory()) { throw Error( - 'Add-on path is niether a xpi nor a directory: ' + addonPath); + 'Add-on path is neither a xpi nor a directory: ' + addonPath); } return io.read(path.join(addonPath, 'install.rdf')); }); diff --git a/node_modules/selenium-webdriver/firefox/index.js b/node_modules/selenium-webdriver/firefox/index.js index 4ea1702a9..d5c88274a 100644 --- a/node_modules/selenium-webdriver/firefox/index.js +++ b/node_modules/selenium-webdriver/firefox/index.js @@ -26,28 +26,31 @@ * * __Customizing the Firefox Profile__ * - * The {@link Profile} class may be used to configure the browser profile used - * with WebDriver, with functions to install additional + * The {@linkplain Profile} class may be used to configure the browser profile + * used with WebDriver, with functions to install additional * {@linkplain Profile#addExtension extensions}, configure browser * {@linkplain Profile#setPreference preferences}, and more. For example, you * may wish to include Firebug: * - * var firefox = require('selenium-webdriver/firefox'); + * const {Builder} = require('selenium-webdriver'); + * const firefox = require('selenium-webdriver/firefox'); * - * var profile = new firefox.Profile(); + * let profile = new firefox.Profile(); * profile.addExtension('/path/to/firebug.xpi'); * profile.setPreference('extensions.firebug.showChromeErrors', true); * - * var options = new firefox.Options().setProfile(profile); - * var driver = new firefox.Driver(options); + * let options = new firefox.Options().setProfile(profile); + * let driver = new Builder() + * .forBrowser('firefox') + * .setFirefoxOptions(options) + * .build(); * - * The {@link Profile} class may also be used to configure WebDriver based on a - * pre-existing browser profile: + * The {@linkplain Profile} class may also be used to configure WebDriver based + * on a pre-existing browser profile: * - * var profile = new firefox.Profile( + * let profile = new firefox.Profile( * '/usr/local/home/bob/.mozilla/firefox/3fgog75h.testing'); - * var options = new firefox.Options().setProfile(profile); - * var driver = new firefox.Driver(options); + * let options = new firefox.Options().setProfile(profile); * * The FirefoxDriver will _never_ modify a pre-existing profile; instead it will * create a copy for it to modify. By extension, there are certain browser @@ -56,21 +59,35 @@ * * __Using a Custom Firefox Binary__ * - * On Windows and OSX, the FirefoxDriver will search for Firefox in its + * On Windows and MacOS, the FirefoxDriver will search for Firefox in its * default installation location: * - * * Windows: C:\Program Files and C:\Program Files (x86). - * * Mac OS X: /Applications/Firefox.app + * - Windows: C:\Program Files and C:\Program Files (x86). + * - MacOS: /Applications/Firefox.app * - * For Linux, Firefox will be located on the PATH: `$(where firefox)`. + * For Linux, Firefox will always be located on the PATH: `$(where firefox)`. * - * You can configure WebDriver to start use a custom Firefox installation with - * the {@link Binary} class: + * Several methods are provided for starting Firefox with a custom executable. + * First, on Windows and MacOS, you may configure WebDriver to check the default + * install location for a non-release channel. If the requested channel cannot + * be found in its default location, WebDriver will fallback to searching your + * PATH. _Note:_ on Linux, Firefox is _always_ located on your path, regardless + * of the requested channel. * - * var firefox = require('selenium-webdriver/firefox'); - * var binary = new firefox.Binary('/my/firefox/install/dir/firefox-bin'); - * var options = new firefox.Options().setBinary(binary); - * var driver = new firefox.Driver(options); + * const {Builder} = require('selenium-webdriver'); + * const firefox = require('selenium-webdriver/firefox'); + * + * let options = new firefox.Options().setBinary(firefox.Channel.NIGHTLY); + * let driver = new Builder() + * .forBrowser('firefox') + * .setFirefoxOptions(options) + * .build(); + * + * On all platforms, you may configrue WebDriver to use a Firefox specific + * executable: + * + * let options = new firefox.Options() + * .setBinary('/my/firefox/install/dir/firefox-bin'); * * __Remote Testing__ * @@ -84,11 +101,14 @@ * binaries are never copied to remote machines and must be referenced by * installation path. * - * var options = new firefox.Options() + * const {Builder} = require('selenium-webdriver'); + * const firefox = require('selenium-webdriver/firefox'); + * + * let options = new firefox.Options() * .setProfile('/profile/path/on/remote/host') * .setBinary('/install/dir/on/remote/host/firefox-bin'); * - * var driver = new (require('selenium-webdriver')).Builder() + * let driver = new Builder() * .forBrowser('firefox') * .usingServer('http://127.0.0.1:4444/wd/hub') * .setFirefoxOptions(options) @@ -99,8 +119,7 @@ * To test versions of Firefox prior to Firefox 47, you must disable the use of * the geckodriver using the {@link Options} class. * - * var options = new firefox.Options().useGeckoDriver(false); - * var driver = new firefox.Driver(options); + * let options = new firefox.Options().useGeckoDriver(false); * * Alternatively, you may disable the geckodriver at runtime by setting the * environment variable `SELENIUM_MARIONETTE=false`. @@ -113,7 +132,7 @@ const url = require('url'); -const Binary = require('./binary').Binary, +const {Binary, Channel} = require('./binary'), Profile = require('./profile').Profile, decodeProfile = require('./profile').decode, http = require('../http'), @@ -196,16 +215,24 @@ class Options { } /** - * Sets the binary to use. The binary may be specified as the path to a Firefox - * executable, or as a {@link Binary} object. + * Sets the binary to use. The binary may be specified as the path to a + * Firefox executable, a specific {@link Channel}, or as a {@link Binary} + * object. * - * @param {(string|!Binary)} binary The binary to use. + * @param {(string|!Binary|!Channel)} binary The binary to use. * @return {!Options} A self reference. + * @throws {TypeError} If `binary` is an invalid type. */ setBinary(binary) { - if (typeof binary === 'string') { + if (typeof binary === 'string' || binary instanceof Channel) { binary = new Binary(binary); } + + if (!(binary instanceof Binary)) { + throw TypeError( + 'binary must be a string path, Channel, or Binary object'); + } + this.binary_ = binary; return this; } @@ -687,6 +714,7 @@ class Driver extends webdriver.WebDriver { exports.Binary = Binary; +exports.Channel = Channel; exports.Context = Context; exports.Driver = Driver; exports.Options = Options; diff --git a/node_modules/selenium-webdriver/index.js b/node_modules/selenium-webdriver/index.js index 3cde7f396..a1e208b46 100644 --- a/node_modules/selenium-webdriver/index.js +++ b/node_modules/selenium-webdriver/index.js @@ -58,7 +58,7 @@ var seleniumServer; * Starts an instance of the Selenium server if not yet running. * @param {string} jar Path to the server jar to use. * @return {!Promise} A promise for the server's - * addrss once started. + * address once started. */ function startSeleniumServer(jar) { if (!seleniumServer) { @@ -160,7 +160,7 @@ function createDriver(ctor, ...args) { /** @override */ this.catch = pd.then.bind(pd); } - } + }; promise.CancellableThenable.addImplementation(thenableWebDriverProxy); THENABLE_DRIVERS.set(ctor, thenableWebDriverProxy); } diff --git a/node_modules/selenium-webdriver/lib/README b/node_modules/selenium-webdriver/lib/README index 583293864..c39abbece 100644 --- a/node_modules/selenium-webdriver/lib/README +++ b/node_modules/selenium-webdriver/lib/README @@ -1,6 +1,5 @@ This directory contains modules internal to selenium-webdriver that are not intended for general consumption. They may change at any time. -With the exception of the test/ directory, all files under this directory -may only depend on built-in JavaScript features and other modules in the -directory. +All files in this directory and the atoms/ subdirectory may only depend on +built-in JavaScript features and other modules in this directory. diff --git a/node_modules/selenium-webdriver/lib/actions.js b/node_modules/selenium-webdriver/lib/actions.js index 1b059bbbf..0e34f3783 100644 --- a/node_modules/selenium-webdriver/lib/actions.js +++ b/node_modules/selenium-webdriver/lib/actions.js @@ -128,7 +128,7 @@ class ActionSequence { } /** - * Moves the mouse. The location to move to may be specified in terms of the + * Moves the mouse. The location to move to may be specified in terms of the * mouse's current location, an offset relative to the top-left corner of an * element, or an element (in which case the middle of the element is used). * @@ -333,7 +333,7 @@ class ActionSequence { /** * Performs a modifier key press. The modifier key is not released * until {@link #keyUp} or {@link #sendKeys} is called. The key press will be - * targetted at the currently focused element. + * targeted at the currently focused element. * * @param {!input.Key} key The modifier key to push. Must be one of * {ALT, CONTROL, SHIFT, COMMAND, META}. @@ -347,7 +347,7 @@ class ActionSequence { } /** - * Performs a modifier key release. The release is targetted at the currently + * Performs a modifier key release. The release is targeted at the currently * focused element. * @param {!input.Key} key The modifier key to release. Must be one of * {ALT, CONTROL, SHIFT, COMMAND, META}. @@ -363,7 +363,7 @@ class ActionSequence { /** * Simulates typing multiple keys. Each modifier key encountered in the * sequence will not be released until it is encountered again. All key events - * will be targetted at the currently focused element. + * will be targeted at the currently focused element. * * @param {...(string|!input.Key|!Array<(string|!input.Key)>)} var_args * The keys to type. diff --git a/node_modules/selenium-webdriver/lib/by.js b/node_modules/selenium-webdriver/lib/by.js index ac448e683..8c718be64 100644 --- a/node_modules/selenium-webdriver/lib/by.js +++ b/node_modules/selenium-webdriver/lib/by.js @@ -153,7 +153,7 @@ class By { } /** - * Locates eleemnts by the ID attribute. This locator uses the CSS selector + * Locates elements by the ID attribute. This locator uses the CSS selector * `*[id="$ID"]`, _not_ `document.getElementById`. * * @param {string} id The ID to search for. diff --git a/node_modules/selenium-webdriver/lib/capabilities.js b/node_modules/selenium-webdriver/lib/capabilities.js index 61396d54d..65b290f5f 100644 --- a/node_modules/selenium-webdriver/lib/capabilities.js +++ b/node_modules/selenium-webdriver/lib/capabilities.js @@ -103,7 +103,7 @@ const Capability = { */ PROXY: 'proxy', - /** Whether the driver supports changing the brower's orientation. */ + /** Whether the driver supports changing the browser's orientation. */ ROTATABLE: 'rotatable', /** @@ -130,7 +130,7 @@ const Capability = { /** * Defines how the driver should handle unexpected alerts. The value should - * be one of "accept", "dismiss", or "ignore. + * be one of "accept", "dismiss", or "ignore". */ UNEXPECTED_ALERT_BEHAVIOR: 'unexpectedAlertBehavior', @@ -367,7 +367,7 @@ class Capabilities extends Map { /** * Sets the logging preferences. Preferences may be specified as a - * {@link ./logging.Preferences} instance, or a as a map of log-type to + * {@link ./logging.Preferences} instance, or as a map of log-type to * log-level. * @param {!(./logging.Preferences|Object)} prefs The logging * preferences. @@ -408,7 +408,7 @@ class Capabilities extends Map { /** * Sets the default action to take with an unexpected alert before returning * an error. - * @param {string} behavior The desired behavior; should be "accept", + * @param {string} behavior The desired behavior should be "accept", * "dismiss", or "ignore". Defaults to "dismiss". * @return {!Capabilities} A self reference. */ diff --git a/node_modules/selenium-webdriver/lib/error.js b/node_modules/selenium-webdriver/lib/error.js index 555e5cbc5..82f81b07c 100644 --- a/node_modules/selenium-webdriver/lib/error.js +++ b/node_modules/selenium-webdriver/lib/error.js @@ -311,7 +311,7 @@ class UnknownMethodError extends WebDriverError { /** - * Reports an unsupport operation. + * Reports an unsupported operation. */ class UnsupportedOperationError extends WebDriverError { /** @param {string=} opt_error the error message, if any. */ @@ -462,17 +462,29 @@ function checkResponse(data) { return data; } +/** + * Tests if the given value is a valid error response object according to the + * W3C WebDriver spec. + * + * @param {?} data The value to test. + * @return {boolean} Whether the given value data object is a valid error + * response. + * @see https://w3c.github.io/webdriver/webdriver-spec.html#protocol + */ +function isErrorResponse(data) { + return data && typeof data === 'object' && typeof data.error === 'string'; +} /** * Throws an error coded from the W3C protocol. A generic error will be thrown - * if the privded `data` is not a valid encoded error. + * if the provided `data` is not a valid encoded error. * * @param {{error: string, message: string}} data The error data to decode. * @throws {WebDriverError} the decoded error. * @see https://w3c.github.io/webdriver/webdriver-spec.html#protocol */ function throwDecodedError(data) { - if (data && typeof data === 'object' && typeof data.error === 'string') { + if (isErrorResponse(data)) { let ctor = ERROR_CODE_TO_TYPE.get(data.error) || WebDriverError; throw new ctor(data.message); } @@ -551,5 +563,6 @@ module.exports = { checkResponse: checkResponse, checkLegacyResponse: checkLegacyResponse, encodeError: encodeError, + isErrorResponse: isErrorResponse, throwDecodedError: throwDecodedError, }; diff --git a/node_modules/selenium-webdriver/lib/events.js b/node_modules/selenium-webdriver/lib/events.js index 65e63de8c..82b34803e 100644 --- a/node_modules/selenium-webdriver/lib/events.js +++ b/node_modules/selenium-webdriver/lib/events.js @@ -22,7 +22,7 @@ */ class Listener { /** - * @param {!Function} fn The acutal listener function. + * @param {!Function} fn The actual listener function. * @param {(Object|undefined)} scope The object in whose scope to invoke the * listener. * @param {boolean} oneshot Whether this listener should only be used once. diff --git a/node_modules/selenium-webdriver/lib/firefox/amd64/libnoblur64.so b/node_modules/selenium-webdriver/lib/firefox/amd64/libnoblur64.so deleted file mode 100644 index 248c32db52cb67302b214c4955f248ffd45e0cfa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 41623 zcmeIb3wTu3)i-_;2p}klcdA&A3KSG#xQc+100RROh#|q)N{2~il8huX>0BUD5MqcL zr+JH3tycS%Dz#Kw#o8)Wu@RBPOKrSVQ>A`U(Pj*7(W;G>n(w#PUi-{BlZpE8|GPZj z^LXH#wbym8z4rB-IcI0HYx&~Lj0{5`LyQXz!q$#elzd_2H%S5@-ISomcj-q#>K1xrnVsrqUM-Ji8Q0rX`J@WI*9yuadEcp!M!56yFPgdKwTsJ2iWiYQ9TRYV1Lq{1=ir=-la5@R=i;1-b2?6a%s}EioU?^6 z2k-)%`GOY!F2K1Erwiv|oJ(=)V;K?`;Vcxw3cwqN*``L=Dv>~oj*UivOV-(+cT3N z%)al3SH^l?E%{`~4X>B~rS0sA{qy&nGH&;YH{I~Y*z?yv8NJka{;sorxVE|d`hr8h zet+rjt{e6Cp>y9oZO!%H{oAbLPX5z(%EmtW_Kh14zPnDNlu+y6PV_0-SaopI~PH=^~wZGC_AhT0FVlj5WWLyV)0 zwPT#D=TM=?IZ2FB`%XvyA>?&iva3xU#13_H(=I6K_Xd%#9fTekguVz3EuBBNBA;~r zKM8s|`8Nl#f6gHE2>MAn`#*tvI{Ui@@#l&`>{CUivrqle#F=_LHAsCu1i^IvJUs|~ z#31qf<{u4qzE?({bZq!qyY-Y zQK(ls4hntR5`{;E{wC1lj8VqcnTq}wnG{Z9`q9Sr5=Gb7weX+hhYS5eVN4SHH!M&D z9?X$^4*8J$`~pS4UF4q<`ED9qaTJR`=Sz9}Ww0Hk*v45Lx08*v5}!Pwzc2EWX#mDi z54&_s6F+}dq;Ls`akKbyP#ix?v5icz^HaAX{8H#sMLs0*y6zf9zE|qyN|A4b{ISN# zM*h_%Q*;}+UCP@p_4TI6Uncf{CHB82^p)cO5%GT%@}r{xC$*Ctv9H_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Dg%8)^koBpuO6zZufvJy_)d$NK zYU4XTTZVwk_T@5A`^U>bU3T?mPi!i8FT z$?}y83YL3TE?&IKRpKcrSg_pXF|a>@Ke#?We+j+ns0iEWa%3C z=_^=KTj%t^v$UiT-<0Y8j$+XOP~t5|aiLIA*Wi?|^6+=hKD*QSEe$*TctVvP^~szk z8nS$%?yOu`=l9onU@}$_rAT;vPQz)790*E@J%0YRtCByqb1Ejk^)`5*LFHgSg^G2a zit2TqN_>f!6rW*~Ev6`Q5u^n84muLUk9LtDS4L%0nyO4ykcxT?zrv-|ADSKtkA0A; zkgGR>9iLEIN0wy7SHo@__4p01vMv^_aOP3#uN_b=*nuX=?Hq{epKoM#Yb^QLRN<}<>E$_zQQ$o<9pK`dBC^o zWECH_hP~kigbQ&FGYBF>OtPDCey zX-|0r!n59R5Gb2uxTRZRGn|;0_S!Hiv4cx6#U4I+rR_Xwy>-+ksY9w}OTT!B);Wbe z%hqF#P*eQE8fv%^6h`$^+KeO?G1T{}h!(!y4^-kSbw9pZr)b0?G&tyz8>sPVE1wo&EB=A(!duce}&x)On e@EXG?!$u2BgXoQHg9@gK9|)pzU_cBzmHsEtKNxiY diff --git a/node_modules/selenium-webdriver/lib/firefox/i386/libnoblur.so b/node_modules/selenium-webdriver/lib/firefox/i386/libnoblur.so deleted file mode 100644 index 004062c7b6482bbc85574c8a9252dcb3d7159d91..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36934 zcmeHwdwi6|+4kfBLwklL$yP0hWUXh!7O(VM($ZvXJbidw|e_kSQK?czjV2OQ+D4^{O50eYT@0=9m0H@`?sr`?^X$%U7VZ0fzxVrn zfAoRL%r$f0_uO;OJ%{Jn=djUUH8&$8Ls&q`9hQNf#(F_0gTjM02pLWp^bmWkOvd#QB9_KxZk zzcb>b`I%3Z-7w|Sg_BTLfRLj@?iMj9+^v0QAHQ|e+0GRuLbT1FA6+qO%I4QETV6AN z4rzIi?<|DL2kSLMeiElp!${;R2m89q~+ri#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Jz8opQ-$F0slS4a6Wm@Kc9an;Cu=wDW-&y5^|T6kiMiu)>%T1lIdhAnNISO z>5_iBq@PalrN!hbEhblKvDB`ZT&2ZQ$zs-2S}b)fmdeVyN{c10tg%$qSSo8Ql{J=@ zNZu03TOxT&ByWjqX^G@5mGzd&dX-g5WxdKcrIJ_KNE)e3mX^u94*Q}xn6cFKWucdM>Ra_^>s#?up>JJ)AEH+`s0)9iH`wHK=*K7YhwO3F zxI;cxDXzry>W9Aio@{kbcbW%hm?dvGcYs$o7St@n{oB^O42?Na*VNWExx`9`d|t@u zFm%ChJb1F*;calJThJW=ul2Eee*kiP6&2PO?283|wb6C0cDY($CSR~VfLYq*GRctb z47McYq-(0%qg(25$scMODvF(s_xpa*cH)0vB z^Va&DdLBprz(esC1q^|*Qan21@UKHNn?-Fs-o4;YR8P0S&w$Dnq;@sS$0ePL4RZKf zCVq|dp-om_;P+1c66#%T%30)9qhRPrg4E>4%vcYePx00I*1_!P8Xq1Z;xl-7upVR4 zD&n9*A2fNrtAj1r*I1q@YY^}`j91V)>ej(rYmzf45?vGwB)LVrgY=M2I8_6lQ{l6= z&9yD`agKa7**Gp)gUx{2%gt`8_4_gTtkllJr-Flip(Y@Q+lh9%8}Rs;3y+ft|Il7V zvx9z4I93zs%a)7kX-rO2X(uU|+>`v&a=1#Xq{2$K<3&Q{a diff --git a/node_modules/selenium-webdriver/lib/firefox/webdriver.json b/node_modules/selenium-webdriver/lib/firefox/webdriver.json index 38601a28c..0dbe56bbd 100644 --- a/node_modules/selenium-webdriver/lib/firefox/webdriver.json +++ b/node_modules/selenium-webdriver/lib/firefox/webdriver.json @@ -37,7 +37,6 @@ "network.http.phishy-userpass-length": 255, "offline-apps.allow_by_default": true, "prompts.tab_modal.enabled": false, - "security.csp.enable": false, "security.fileuri.origin_policy": 3, "security.fileuri.strict_origin_policy": false, "signon.rememberSignons": false, @@ -61,6 +60,8 @@ "dom.max_script_run_time": 30, "dom.report_all_js_exceptions": true, "javascript.options.showInConsole": true, + "network.captive-portal-service.enabled": false, + "security.csp.enable": false, "startup.homepage_welcome_url": "about:blank", "startup.homepage_welcome_url.additional": "about:blank", "webdriver_accept_untrusted_certs": true, diff --git a/node_modules/selenium-webdriver/lib/firefox/webdriver.xpi b/node_modules/selenium-webdriver/lib/firefox/webdriver.xpi index f9a51cf4fc1c923f3770a590add4f6e2c6c13bd7..a7b0fa3a7c71db9b064f4603254335dae64e64ec 100644 GIT binary patch delta 315622 zcmV)DK*7J_lPje6Dh^Of0|XQR2nYxOCy`}Jkq#t(mD_IAFc60C_bK)Trm+*paX?7y zA*&*Ugy<7E_P9++;+36cyHvb8&Ys!;-3BhWjQ!6)pJ&F7LvJ@u;nX~6SA9b_b;p%x zGEuheuFm~{i%yc`_tnFueiEIG&Z^VGUMAP;x>B;M zZ2Rti5tSebF&U_sNMM{9$V-Ai6Pd^y^DGhU$7E6kA7`XOAK;p`ZG)?iTK{2Tn?|tGbp~*4;)P)y7rbF6#CDV7N--TRJl70Fy3AA(n!}oO23{Xach$ zS;AsQXuO&&S2QC7%)|J=d1Xj>Ywc}~%4)m{ifD`FasEzo*HezlIiO4#8g2xIgh&H_ ztfU&GN>dP}6qLq!f{YF*@4|TLO9kvFFS_@=u16Y`V1UH)7*k3!kW9uQf)L2_aC-2la#b+{j}K3|Y=mHREO=N*-Oz>6{0rB)hr66S+x)F6aPfUA;ZhzaI6Y;?%i ztUKsSRVjSAmIvLTv!jyyA1rK2)P3B4FA@KUN%KUjj6&Lv1~Vw3WGV&>Ylfw1W{4SJ z`p~NItd8vQRv-0yx-q#1bY;qDp6UbyqX;b12Fi@&fZEVfu@J}kpXk7M*5ThW?t`9H zb5!;LZy{Fss#q1UNNExtfINd-%nO(ogv=OSCY%lLj^DN29d?z1X8$1XiO+Uhalz(1 zpXU(M;K@XINN4ei!)%_U>5?zw)uI^KHOKcKzV<(WamPQ!^dbGJMLzuJu-lm#i!WB!Bq)?M3UfdEz{Gc4`%8G@p;) zk^X%C?0mXA{05(^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f`QRHezmbZvp(#8=YW3OyyK8ST-RPqsOeFF+_4t?t)==Jh z6$oaYd#RomZ-c*({;(v#T^X3TKdO%2`gMlq#2Hbw4m!i#4O00@+myUv^oz4Zsu;nG zHDwHozMCMViE4R7zihaJFtJi3kIxLgM|05&*U_fBRIwa=53PvL3R7TW6fsTk? zfk^(}GJieF!N#EGk}>|D+W%eo9kk$eK?Vq9j|2n4{zn1YW+-rAJ<`AQB``@nq$(_J zXfR(r5)Ij(Hd6G91*GJFK)agIAk2T1e1!}H25ON=|JBH_21v>6a>z@1h;RR=eg!f( z+&T{^5X~C|5Ya!f2v@>@2kMdN{;EuKBk|6;916q>aeavY5hlU_2e#9OCPDx2I|G0G zQ!(rkJlIDUkp%43fb{xb4f3jiybiYvAM+806x>*Y^jh}M?R3f3G>kzq(?b{`f`8O7 z<%0nFo4;e@C@E*)WZ_~WDJ#b0X6N)j_43t0@*e>RV2wH?+P_-=cMa>Gxt;wHz#X;! z?$H6-$$6~=5NK{58btVyCg}9N0t?*15rNU_kzW6mvQ%+`-wqN32?vq=BNkc@5e(eI zk^fIu*C6n^$3jA9AV2?1-w7#_p@T>SX8AvzG!E%JsC4jA0}?gQf6qt=t@O7`+W-;L zJvL4d-3Wpk{d;czdv<|k8zFt+XMhN9H$Z$#|KD%hIiTdyMf&X*_H;ykN$ic+X*4e?x4w|^p- diff --git a/node_modules/selenium-webdriver/lib/http.js b/node_modules/selenium-webdriver/lib/http.js index 68bc43213..136a48e63 100644 --- a/node_modules/selenium-webdriver/lib/http.js +++ b/node_modules/selenium-webdriver/lib/http.js @@ -25,17 +25,26 @@ 'use strict'; -const fs = require('fs'); -const path = require('path'); - const cmd = require('./command'); -const devmode = require('./devmode'); const error = require('./error'); const logging = require('./logging'); const promise = require('./promise'); const Session = require('./session').Session; const WebElement = require('./webdriver').WebElement; +const {getAttribute, isDisplayed} = (function() { + try { + return { + getAttribute: require('./atoms/getAttribute.js'), + isDisplayed: require('./atoms/is-displayed.js') + }; + } catch (ex) { + throw Error( + 'Failed to import atoms modules. If running in devmode, you need to run' + + ' `./go node:atoms` from the project root: ' + ex); + } +})(); + /** * Converts a headers map to a HTTP header block string. @@ -116,43 +125,15 @@ class Response { const DEV_ROOT = '../../../../buck-out/gen/javascript/'; -/** @enum {string} */ +/** @enum {!Function} */ const Atom = { - GET_ATTRIBUTE: devmode - ? path.join(__dirname, DEV_ROOT, 'webdriver/atoms/getAttribute.js') - : path.join(__dirname, 'atoms/getAttribute.js'), - IS_DISPLAYED: devmode - ? path.join(__dirname, DEV_ROOT, 'atoms/fragments/is-displayed.js') - : path.join(__dirname, 'atoms/isDisplayed.js'), + GET_ATTRIBUTE: getAttribute, + IS_DISPLAYED: isDisplayed }; -const ATOMS = /** !Map> */new Map(); const LOG = logging.getLogger('webdriver.http'); -/** - * @param {Atom} file The atom file to load. - * @return {!Promise} A promise that will resolve to the contents of the - * file. - */ -function loadAtom(file) { - if (ATOMS.has(file)) { - return ATOMS.get(file); - } - let contents = /** !Promise */new Promise((resolve, reject) => { - LOG.finest(() => `Loading atom ${file}`); - fs.readFile(file, 'utf8', function(err, data) { - if (err) { - reject(err); - } else { - resolve(data); - } - }); - }); - ATOMS.set(file, contents); - return contents; -} - function post(path) { return resource('POST', path); } function del(path) { return resource('DELETE', path); } @@ -168,17 +149,26 @@ var CommandSpec; var CommandTransformer; +class InternalTypeError extends TypeError {} + + /** * @param {!cmd.Command} command The initial command. * @param {Atom} atom The name of the atom to execute. * @return {!Promise} The transformed command to execute. */ function toExecuteAtomCommand(command, atom, ...params) { - return loadAtom(atom).then(atom => { - return new cmd.Command(cmd.Name.EXECUTE_SCRIPT) + return new Promise((resolve, reject) => { + if (typeof atom !== 'function') { + reject(new InternalTypeError('atom is not a function: ' + typeof atom)); + return; + } + + let newCmd = new cmd.Command(cmd.Name.EXECUTE_SCRIPT) .setParameter('sessionId', command.getParameter('sessionId')) .setParameter('script', `return (${atom}).apply(null, arguments)`) .setParameter('args', params.map(param => command.getParameter(param))); + resolve(newCmd); }); } @@ -269,6 +259,8 @@ const W3C_COMMAND_MAP = new Map([ [cmd.Name.GET_ELEMENT_ATTRIBUTE, (cmd) => { return toExecuteAtomCommand(cmd, Atom.GET_ATTRIBUTE, 'id', 'name'); }], + [cmd.Name.GET_ELEMENT_LOCATION, get('/session/:sessionId/element/:id/rect')], + [cmd.Name.GET_ELEMENT_SIZE, get('/session/:sessionId/element/:id/rect')], [cmd.Name.IS_ELEMENT_DISPLAYED, (cmd) => { return toExecuteAtomCommand(cmd, Atom.IS_DISPLAYED, 'id'); }], @@ -437,7 +429,8 @@ class Executor { this.log_.finer(() => `>>>\n${request}\n<<<\n${response}`); let parsed = - parseHttpResponse(/** @type {!Response} */ (response), this.w3c); + parseHttpResponse( + command, /** @type {!Response} */ (response), this.w3c); if (command.getName() === cmd.Name.NEW_SESSION || command.getName() === cmd.Name.DESCRIBE_SESSION) { @@ -447,7 +440,7 @@ class Executor { } // The remote end is a W3C compliant server if there is no `status` - // field in the response. This is not appliable for the DESCRIBE_SESSION + // field in the response. This is not applicable for the DESCRIBE_SESSION // command, which is not defined in the W3C spec. if (command.getName() === cmd.Name.NEW_SESSION) { this.w3c = this.w3c || !('status' in parsed); @@ -485,29 +478,42 @@ function tryParse(str) { /** * Callback used to parse {@link Response} objects from a * {@link HttpClient}. + * + * @param {!cmd.Command} command The command the response is for. * @param {!Response} httpResponse The HTTP response to parse. * @param {boolean} w3c Whether the response should be processed using the * W3C wire protocol. * @return {?} The parsed response. * @throws {WebDriverError} If the HTTP response is an error. */ -function parseHttpResponse(httpResponse, w3c) { +function parseHttpResponse(command, httpResponse, w3c) { let parsed = tryParse(httpResponse.body); if (parsed !== undefined) { + if (httpResponse.status < 200) { + // This should never happen, but throw the raw response so + // users report it. + throw new error.WebDriverError( + `Unexpected HTTP response:\n${httpResponse}`); + } + if (w3c) { if (httpResponse.status > 399) { error.throwDecodedError(parsed); } - - if (httpResponse.status < 200) { - // This should never happen, but throw the raw response so - // users report it. - throw new error.WebDriverError( - `Unexpected HTTP response:\n${httpResponse}`); - } - } else { - error.checkLegacyResponse(parsed); + return parsed; } + + // If this is a new session command, we need to check for a W3C compliant + // error object. This is necessary since a successful new session command + // is what puts the executor into W3C mode. + if (httpResponse.status > 399 + && (command.getName() == cmd.Name.NEW_SESSION + || command.getName() === cmd.Name.DESCRIBE_SESSION) + && error.isErrorResponse(parsed)) { + error.throwDecodedError(parsed); + } + + error.checkLegacyResponse(parsed); return parsed; } diff --git a/node_modules/selenium-webdriver/lib/input.js b/node_modules/selenium-webdriver/lib/input.js index 058530ebc..4ea938d45 100644 --- a/node_modules/selenium-webdriver/lib/input.js +++ b/node_modules/selenium-webdriver/lib/input.js @@ -144,7 +144,7 @@ class FileDetector { /** * Handles the file specified by the given path, preparing it for use with * the current browser. If the path does not refer to a valid file, it will - * be returned unchanged, otherwisee a path suitable for use with the current + * be returned unchanged, otherwise a path suitable for use with the current * browser will be returned. * * This default implementation is a no-op. Subtypes may override this function diff --git a/node_modules/selenium-webdriver/lib/promise.js b/node_modules/selenium-webdriver/lib/promise.js index 32d0c98e6..b26cd23ff 100644 --- a/node_modules/selenium-webdriver/lib/promise.js +++ b/node_modules/selenium-webdriver/lib/promise.js @@ -48,7 +48,7 @@ * > e => console.error('FAILURE: ' + e)); * > ``` * > - * > The motiviation behind this change and full deprecation plan are documented + * > The motivation behind this change and full deprecation plan are documented * > in [issue 2969](https://github.com/SeleniumHQ/selenium/issues/2969). * > * > @@ -87,8 +87,7 @@ * The control flow is based on the concept of tasks and task queues. Tasks are * functions that define the basic unit of work for the control flow to execute. * Each task is scheduled via {@link ControlFlow#execute()}, which will return - * a {@link ManagedPromise ManagedPromise} that will be resolved with the task's - * result. + * a {@link ManagedPromise} that will be resolved with the task's result. * * A task queue contains all of the tasks scheduled within a single turn of the * [JavaScript event loop][JSEL]. The control flow will create a new task queue @@ -103,13 +102,13 @@ * * Whenever the control flow creates a new task queue, it will automatically * begin executing tasks in the next available turn of the event loop. This - * execution is scheduled using a "micro-task" timer, such as a (native) - * `ManagedPromise.then()` callback. + * execution is [scheduled as a microtask][MicrotasksArticle] like e.g. a + * (native) `Promise.then()` callback. * * setTimeout(() => console.log('a')); - * ManagedPromise.resolve().then(() => console.log('b')); // A native promise. + * Promise.resolve().then(() => console.log('b')); // A native promise. * flow.execute(() => console.log('c')); - * ManagedPromise.resolve().then(() => console.log('d')); + * Promise.resolve().then(() => console.log('d')); * setTimeout(() => console.log('fin')); * // b * // c @@ -118,13 +117,13 @@ * // fin * * In the example above, b/c/d is logged before a/fin because native promises - * and this module use "micro-task" timers, which have a higher priority than - * "macro-tasks" like `setTimeout`. + * and this module use "microtask" timers, which have a higher priority than + * "macrotasks" like `setTimeout`. * * ## Task Execution * - * Upon creating a task queue, and whenever an exisiting queue completes a task, - * the control flow will schedule a micro-task timer to process any scheduled + * Upon creating a task queue, and whenever an existing queue completes a task, + * the control flow will schedule a microtask timer to process any scheduled * tasks. This ensures no task is ever started within the same turn of the * JavaScript event loop in which it was scheduled, nor is a task ever started * within the same turn that another finishes. @@ -140,13 +139,13 @@ * discarded and the task's promised result (previously returned by * {@link ControlFlow#execute()}) is immediately rejected with the thrown * error. - * 3. The task function returns sucessfully. + * 3. The task function returns successfully. * * If a task function created a new task queue, the control flow will wait for * that queue to complete before processing the task result. If the queue * completes without error, the flow will settle the task's promise with the - * value originaly returned by the task function. On the other hand, if the task - * queue termintes with an error, the task's promise will be rejected with that + * value originally returned by the task function. On the other hand, if the task + * queue terminates with an error, the task's promise will be rejected with that * error. * * flow.execute(function() { @@ -161,7 +160,7 @@ * ## ManagedPromise Integration * * In addition to the {@link ControlFlow} class, the promise module also exports - * a [ManagedPromise/A+] {@linkplain ManagedPromise implementation} that is deeply + * a [Promises/A+] {@linkplain ManagedPromise implementation} that is deeply * integrated with the ControlFlow. First and foremost, each promise * {@linkplain ManagedPromise#then() callback} is scheduled with the * control flow as a task. As a result, each callback is invoked in its own turn @@ -328,7 +327,7 @@ * Even though a subtask's promised result will never resolve while the task * function is on the stack, it will be treated as a promise resolved within the * task. In all other scenarios, a task's promise behaves just like a normal - * promise. In the sample below, `C/D` is loggged before `B` because the + * promise. In the sample below, `C/D` is logged before `B` because the * resolution of `subtask1` interrupts the flow of the enclosing task. Within * the final subtask, `E/F` is logged in order because `subtask1` is a resolved * promise when that task runs. @@ -467,17 +466,17 @@ * * ES6 promises do not require users to handle a promise rejections. This can * result in subtle bugs as the rejections are silently "swallowed" by the - * ManagedPromise class. + * Promise class. * - * ManagedPromise.reject(Error('boom')); + * Promise.reject(Error('boom')); * // ... *crickets* ... * * Selenium's promise module, on the other hand, requires that every rejection * be explicitly handled. When a {@linkplain ManagedPromise ManagedPromise} is * rejected and no callbacks are defined on that promise, it is considered an - * _unhandled rejection_ and reproted to the active task queue. If the rejection + * _unhandled rejection_ and reported to the active task queue. If the rejection * remains unhandled after a single turn of the [event loop][JSEL] (scheduled - * with a micro-task), it will propagate up the stack. + * with a microtask), it will propagate up the stack. * * ## Error Propagation * @@ -534,7 +533,7 @@ * * When a subtask is discarded due to an unreported rejection in its parent * frame, the existing callbacks on that task will never settle and the - * callbacks will not be invoked. If a new callback is attached ot the subtask + * callbacks will not be invoked. If a new callback is attached to the subtask * _after_ it has been discarded, it is handled the same as adding a callback * to a cancelled promise: the error-callback path is invoked. This behavior is * intended to handle cases where the user saves a reference to a task promise, @@ -582,9 +581,9 @@ * * Bottom line: you __*must*__ handle rejected promises. * - * # ManagedPromise/A+ Compatibility + * # Promises/A+ Compatibility * - * This `promise` module is compliant with the [ManagedPromise/A+][] specification + * This `promise` module is compliant with the [Promises/A+] specification * except for sections `2.2.6.1` and `2.2.6.2`: * * > @@ -595,10 +594,10 @@ * > must execute in the order of their originating calls to `then`. * > * - * Specifically, the conformance tests contains the following scenario (for + * Specifically, the conformance tests contain the following scenario (for * brevity, only the fulfillment version is shown): * - * var p1 = ManagedPromise.resolve(); + * var p1 = Promise.resolve(); * p1.then(function() { * console.log('A'); * p1.then(() => console.log('B')); @@ -609,7 +608,7 @@ * // B * * Since the [ControlFlow](#scheduling_callbacks) executes promise callbacks as - * tasks, with this module, the result would be + * tasks, with this module, the result would be: * * var p2 = promise.fulfilled(); * p2.then(function() { @@ -623,7 +622,8 @@ * * [JSEL]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop * [GF]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function* - * [ManagedPromise/A+]: https://promisesaplus.com/ + * [Promises/A+]: https://promisesaplus.com/ + * [MicrotasksArticle]: https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/ */ 'use strict'; @@ -667,7 +667,7 @@ function getUid(obj) { /** - * Runs the given function after a micro-task yield. + * Runs the given function after a microtask yield. * @param {function()} fn The function to run. */ function asyncRun(fn) { @@ -942,7 +942,7 @@ class Thenable { /** * Marker interface for objects that allow consumers to request the cancellation - * of a promies-based operation. A cancelled promise will be rejected with a + * of a promise-based operation. A cancelled promise will be rejected with a * {@link CancellationError}. * * This interface is considered package-private and should not be used outside @@ -1003,6 +1003,9 @@ const PromiseState = { */ const ON_CANCEL_HANDLER = new WeakMap; +const SKIP_LOG = Symbol('skip-log'); +const FLOW_LOG = logging.getLogger('promise.ControlFlow'); + /** * Represents the eventual value of a completed operation. Each promise may be @@ -1025,14 +1028,29 @@ class ManagedPromise { * functions, one for fulfilling the promise and another for rejecting it. * @param {ControlFlow=} opt_flow The control flow * this instance was created under. Defaults to the currently active flow. + * @param {?=} opt_skipLog An internal parameter used to skip logging the + * creation of this promise. This parameter has no effect unless it is + * strictly equal to an internal symbol. In other words, this parameter + * is always ignored for external code. */ - constructor(resolver, opt_flow) { + constructor(resolver, opt_flow, opt_skipLog) { if (!usePromiseManager()) { throw TypeError( 'Unable to create a managed promise instance: the promise manager has' + ' been disabled by the SELENIUM_PROMISE_MANAGER environment' + ' variable: ' + process.env['SELENIUM_PROMISE_MANAGER']); + } else if (opt_skipLog !== SKIP_LOG) { + FLOW_LOG.warning(() => { + let e = + captureStackTrace( + 'ManagedPromiseError', + 'Creating a new managed Promise. This call will fail when the' + + ' promise manager is disabled', + ManagedPromise) + return e.stack; + }); } + getUid(this); /** @private {!ControlFlow} */ @@ -1308,7 +1326,7 @@ class ManagedPromise { * @param {!Function} fn The function to use as the top of the stack when * recording the callback's creation point. * @return {!ManagedPromise} A new promise which will be resolved with the - * esult of the invoked callback. + * result of the invoked callback. * @template R * @private */ @@ -1383,6 +1401,37 @@ function isPending(promise) { } +/** + * Structural interface for a deferred promise resolver. + * @record + * @template T + */ +function Resolver() {} + + +/** + * The promised value for this resolver. + * @type {!Thenable} + */ +Resolver.prototype.promise; + + +/** + * Resolves the promised value with the given `value`. + * @param {T|Thenable} value + * @return {void} + */ +Resolver.prototype.resolve; + + +/** + * Rejects the promised value with the given `reason`. + * @param {*} reason + * @return {void} + */ +Resolver.prototype.reject; + + /** * Represents a value that will be resolved at some point in the future. This * class represents the protected "producer" half of a ManagedPromise - each Deferred @@ -1395,20 +1444,25 @@ function isPending(promise) { * {@link ControlFlow} as an unhandled failure. * * @template T + * @implements {Resolver} */ class Deferred { /** * @param {ControlFlow=} opt_flow The control flow this instance was * created under. This should only be provided during unit tests. + * @param {?=} opt_skipLog An internal parameter used to skip logging the + * creation of this promise. This parameter has no effect unless it is + * strictly equal to an internal symbol. In other words, this parameter + * is always ignored for external code. */ - constructor(opt_flow) { + constructor(opt_flow, opt_skipLog) { var fulfill, reject; /** @type {!ManagedPromise} */ this.promise = new ManagedPromise(function(f, r) { fulfill = f; reject = r; - }, opt_flow); + }, opt_flow, opt_skipLog); var self = this; var checkNotSelf = function(value) { @@ -1421,16 +1475,24 @@ class Deferred { * Resolves this deferred with the given value. It is safe to call this as a * normal function (with no bound "this"). * @param {(T|IThenable|Thenable)=} opt_value The fulfilled value. + * @const */ - this.fulfill = function(opt_value) { + this.resolve = function(opt_value) { checkNotSelf(opt_value); fulfill(opt_value); }; + /** + * An alias for {@link #resolve}. + * @const + */ + this.fulfill = this.resolve; + /** * Rejects this promise with the given reason. It is safe to call this as a * normal function (with no bound "this"). * @param {*=} opt_reason The rejection reason. + * @const */ this.reject = function(opt_reason) { checkNotSelf(opt_reason); @@ -1487,36 +1549,76 @@ function delayed(ms) { /** - * Creates a new deferred object. - * @return {!Deferred} The new deferred object. + * Creates a new deferred resolver. + * + * If the promise manager is currently enabled, this function will return a + * {@link Deferred} instance. Otherwise, it will return a resolver for a + * {@linkplain NativePromise native promise}. + * + * @return {!Resolver} A new deferred resolver. * @template T */ function defer() { - return new Deferred(); + if (usePromiseManager()) { + return new Deferred(); + } + let resolve, reject; + let promise = new NativePromise((_resolve, _reject) => { + resolve = _resolve; + reject = _reject; + }); + return {promise, resolve, reject}; } /** * Creates a promise that has been resolved with the given value. + * + * If the promise manager is currently enabled, this function will return a + * {@linkplain ManagedPromise managed promise}. Otherwise, it will return a + * {@linkplain NativePromise native promise}. + * * @param {T=} opt_value The resolved value. - * @return {!ManagedPromise} The resolved promise. - * @deprecated Use {@link ManagedPromise#resolve Promise.resolve(value)}. + * @return {!Thenable} The resolved promise. * @template T */ function fulfilled(opt_value) { - return ManagedPromise.resolve(opt_value); + let ctor = usePromiseManager() ? ManagedPromise : NativePromise; + if (opt_value instanceof ctor) { + return /** @type {!Thenable} */(opt_value); + } + + if (usePromiseManager()) { + // We can skip logging warnings about creating a managed promise because + // this function will automatically switch to use a native promise when + // the promise manager is disabled. + return new ManagedPromise( + resolve => resolve(opt_value), undefined, SKIP_LOG); + } + return NativePromise.resolve(opt_value); } /** * Creates a promise that has been rejected with the given reason. + * + * If the promise manager is currently enabled, this function will return a + * {@linkplain ManagedPromise managed promise}. Otherwise, it will return a + * {@linkplain NativePromise native promise}. + * * @param {*=} opt_reason The rejection reason; may be any value, but is * usually an Error or a string. - * @return {!ManagedPromise} The rejected promise. - * @deprecated Use {@link ManagedPromise#reject Promise.reject(reason)}. + * @return {!Thenable} The rejected promise. */ function rejected(opt_reason) { - return ManagedPromise.reject(opt_reason); + if (usePromiseManager()) { + // We can skip logging warnings about creating a managed promise because + // this function will automatically switch to use a native promise when + // the promise manager is disabled. + return new ManagedPromise( + (_, reject) => reject(opt_reason), undefined, SKIP_LOG); + } + return NativePromise.reject(opt_reason); } @@ -1610,21 +1712,17 @@ function thenFinally(promise, callback) { * @param {Function=} opt_errback The function to call when the value is * rejected. * @return {!Thenable} A new promise. + * @deprecated Use `promise.fulfilled(value).then(opt_callback, opt_errback)` */ function when(value, opt_callback, opt_errback) { - if (Thenable.isImplementation(value)) { - return value.then(opt_callback, opt_errback); - } - - return createPromise(resolve => resolve(value)) - .then(opt_callback, opt_errback); + return fulfilled(value).then(opt_callback, opt_errback); } /** * Invokes the appropriate callback function as soon as a promised `value` is - * resolved. This function is similar to `when()`, except it does not return - * a new promise. + * resolved. + * * @param {*} value The value to observe. * @param {Function} callback The function to call when the value is * resolved successfully. @@ -1826,7 +1924,7 @@ function filter(arr, fn, opt_self) { */ function fullyResolved(value) { if (isPromise(value)) { - return when(value, fullyResolveValue); + return fulfilled(value).then(fullyResolveValue); } return fullyResolveValue(value); } @@ -1973,7 +2071,7 @@ class Scheduler { /** * Schedules a task to wait for a condition to hold. * - * If the condition is defined as a function, it may return any value. Promies + * If the condition is defined as a function, it may return any value. Promise * will be resolved before testing if the condition holds (resolution time * counts towards the timeout). Once resolved, values are always evaluated as * booleans. @@ -1997,7 +2095,7 @@ class Scheduler { * @param {string=} opt_message An optional error message to include if the * wait times out; defaults to the empty string. * @return {!Thenable} A promise that will be fulfilled - * when the condition has been satisified. The promise shall be rejected + * when the condition has been satisfied. The promise shall be rejected * if the wait times out waiting for the condition. * @throws {TypeError} If condition is not a function or promise or if timeout * is not a number >= 0. @@ -2018,6 +2116,10 @@ function usePromiseManager() { /** + * Creates a new promise with the given `resolver` function. If the promise + * manager is currently enabled, the returned promise will be a + * {@linkplain ManagedPromise} instance. Otherwise, it will be a native promise. + * * @param {function( * function((T|IThenable|Thenable|null)=), * function(*=))} resolver @@ -2040,7 +2142,7 @@ function createPromise(resolver) { * @param {string=} opt_message An optional error message to include if the * wait times out; defaults to the empty string. * @return {!Thenable} A promise that will be fulfilled - * when the condition has been satisified. The promise shall be rejected + * when the condition has been satisfied. The promise shall be rejected * if the wait times out waiting for the condition. * @throws {TypeError} If condition is not a function or promise or if timeout * is not a number >= 0. @@ -2164,7 +2266,7 @@ const SIMPLE_SCHEDULER = new SimpleScheduler; /** * Handles the execution of scheduled tasks, each of which may be an * asynchronous operation. The control flow will ensure tasks are executed in - * the ordered scheduled, starting each task only once those before it have + * the order scheduled, starting each task only once those before it have * completed. * * Each task scheduled within this flow may return a {@link ManagedPromise} to @@ -2172,21 +2274,21 @@ const SIMPLE_SCHEDULER = new SimpleScheduler; * promises to be resolved before marking the task as completed. * * Tasks and each callback registered on a {@link ManagedPromise} will be run - * in their own ControlFlow frame. Any tasks scheduled within a frame will take + * in their own ControlFlow frame. Any tasks scheduled within a frame will take * priority over previously scheduled tasks. Furthermore, if any of the tasks in * the frame fail, the remainder of the tasks in that frame will be discarded * and the failure will be propagated to the user through the callback/task's * promised result. * * Each time a ControlFlow empties its task queue, it will fire an - * {@link ControlFlow.EventType.IDLE IDLE} event. Conversely, - * whenever the flow terminates due to an unhandled error, it will remove all + * {@link ControlFlow.EventType.IDLE IDLE} event. Conversely, whenever + * the flow terminates due to an unhandled error, it will remove all * remaining tasks in its queue and fire an * {@link ControlFlow.EventType.UNCAUGHT_EXCEPTION UNCAUGHT_EXCEPTION} event. * If there are no listeners registered with the flow, the error will be * rethrown to the global error handler. * - * Refer to the {@link ./promise} module documentation for a detailed + * Refer to the {@link ./promise} module documentation for a detailed * explanation of how the ControlFlow coordinates task execution. * * @implements {Scheduler} @@ -2212,7 +2314,7 @@ class ControlFlow extends events.EventEmitter { this.taskQueues_ = null; /** - * Micro task that controls shutting down the control flow. Upon shut down, + * Microtask that controls shutting down the control flow. Upon shut down, * the flow will emit an * {@link ControlFlow.EventType.IDLE} event. Idle events * always follow a brief timeout in order to catch latent errors from the @@ -2221,8 +2323,8 @@ class ControlFlow extends events.EventEmitter { * by the promise system until the next turn of the event loop: * * // Schedule 1 task that fails. - * var result = promise.controlFlow().schedule('example', - * function() { return promise.rejected('failed'); }); + * var result = promise.controlFlow().execute( + * () => promise.rejected('failed'), 'example'); * // Set a callback on the result. This delays reporting the unhandled * // failure for 1 turn of the event loop. * result.then(function() {}); @@ -2246,7 +2348,7 @@ class ControlFlow extends events.EventEmitter { /** * Returns a string representation of this control flow, which is its current * {@linkplain #getSchedule() schedule}, sans task stack traces. - * @return {string} The string representation of this contorl flow. + * @return {string} The string representation of this control flow. * @override */ toString() { @@ -2258,8 +2360,7 @@ class ControlFlow extends events.EventEmitter { * control flow stack and cause rejections within parent tasks. If error * propagation is disabled, tasks will not be aborted when an unhandled * promise rejection is detected, but the rejection _will_ trigger an - * {@link ControlFlow.EventType.UNCAUGHT_EXCEPTION} - * event. + * {@link ControlFlow.EventType.UNCAUGHT_EXCEPTION} event. * * The default behavior is to propagate all unhandled rejections. _The use * of this option is highly discouraged._ @@ -2293,7 +2394,7 @@ class ControlFlow extends events.EventEmitter { * {@code opt_includeStackTraces === true}, the string will include the * stack trace from when each task was scheduled. * @param {string=} opt_includeStackTraces Whether to include the stack traces - * from when each task was scheduled. Defaults to false. + * from when each task was scheduled. Defaults to false. * @return {string} String representation of this flow's internal state. */ getSchedule(opt_includeStackTraces) { @@ -2345,7 +2446,7 @@ class ControlFlow extends events.EventEmitter { } /** - * Returns the currently actively task queue for this flow. If there is no + * Returns the currently active task queue for this flow. If there is no * active queue, one will be created. * @return {!TaskQueue} the currently active task queue for this flow. * @private @@ -2377,15 +2478,31 @@ class ControlFlow extends events.EventEmitter { } if (!this.hold_) { - var holdIntervalMs = 2147483647; // 2^31-1; max timer length for Node.js + let holdIntervalMs = 2147483647; // 2^31-1; max timer length for Node.js this.hold_ = setInterval(function() {}, holdIntervalMs); } - var task = new Task( + let task = new Task( this, fn, opt_description || '', - {name: 'Task', top: ControlFlow.prototype.execute}); + {name: 'Task', top: ControlFlow.prototype.execute}, + true); + + let q = this.getActiveQueue_(); + + for (let i = q.tasks_.length; i > 0; i--) { + let previousTask = q.tasks_[i - 1]; + if (previousTask.userTask_) { + FLOW_LOG.warning(() => { + return `Detected scheduling of an unchained task. +When the promise manager is disabled, unchained tasks will not wait for +previously scheduled tasks to finish before starting to execute. +New task: ${task.promise.stack_.stack} +Previous task: ${previousTask.promise.stack_.stack}`.split(/\n/).join('\n '); + }); + break; + } + } - var q = this.getActiveQueue_(); q.enqueue(task); this.emit(ControlFlow.EventType.SCHEDULE_TASK, task.description); return task.promise; @@ -2393,7 +2510,7 @@ class ControlFlow extends events.EventEmitter { /** @override */ promise(resolver) { - return new ManagedPromise(resolver, this); + return new ManagedPromise(resolver, this, SKIP_LOG); } /** @override */ @@ -2622,7 +2739,7 @@ class MicroTask { } /** - * Runs the given function after a micro-task yield. + * Runs the given function after a microtask yield. * @param {function()} fn The function to run. */ static run(fn) { @@ -2662,9 +2779,11 @@ class Task extends Deferred { * @param {string} description A description of the task for debugging. * @param {{name: string, top: !Function}=} opt_stackOptions Options to use * when capturing the stacktrace for when this task was created. + * @param {boolean=} opt_isUserTask Whether this task was explicitly scheduled + * by the use of the promise manager. */ - constructor(flow, fn, description, opt_stackOptions) { - super(flow); + constructor(flow, fn, description, opt_stackOptions, opt_isUserTask) { + super(flow, SKIP_LOG); getUid(this); /** @type {function(): (T|!ManagedPromise)} */ @@ -2676,6 +2795,9 @@ class Task extends Deferred { /** @type {TaskQueue} */ this.queue = null; + /** @private @const {boolean} */ + this.userTask_ = !!opt_isUserTask; + /** * Whether this task is considered block. A blocked task may be registered * in a task queue, but will be dropped if it is still blocked when it @@ -2889,7 +3011,7 @@ class TaskQueue extends events.EventEmitter { } // Now that all of the remaining tasks have been silently cancelled (e.g. no - // exisitng callbacks on those tasks will fire), clear the silence bit on + // existing callbacks on those tasks will fire), clear the silence bit on // the cancellation error. This ensures additional callbacks registered in // the future will actually execute. cancellation.silent_ = false; @@ -2935,7 +3057,7 @@ class TaskQueue extends events.EventEmitter { this.subQ_.once('end', () => { // On task completion. this.subQ_ = null; - this.pending_ && this.pending_.task.fulfill(result); + this.pending_ && this.pending_.task.resolve(result); }); this.subQ_.once('error', e => { // On task failure. @@ -3068,7 +3190,7 @@ class TaskQueue extends events.EventEmitter { } return task; } -}; +} @@ -3214,7 +3336,7 @@ function consume(generatorFn, opt_self, ...var_args) { function pump(fn, opt_arg) { if (ret instanceof ManagedPromise && !isPending(ret)) { - return; // Defererd was cancelled; silently abort. + return; // Deferred was cancelled; silently abort. } try { @@ -3246,6 +3368,7 @@ module.exports = { MultipleUnhandledRejectionError: MultipleUnhandledRejectionError, Thenable: Thenable, Promise: ManagedPromise, + Resolver: Resolver, Scheduler: Scheduler, all: all, asap: asap, @@ -3254,6 +3377,7 @@ module.exports = { consume: consume, controlFlow: controlFlow, createFlow: createFlow, + createPromise: createPromise, defer: defer, delayed: delayed, filter: filter, @@ -3275,7 +3399,7 @@ module.exports = { * The promise manager is currently enabled by default, but may be disabled * by setting the environment variable `SELENIUM_PROMISE_MANAGER=0` or by * setting this property to false. Setting this property will always take - * precedence ove the use of the environment variable. + * precedence over the use of the environment variable. * * @return {boolean} Whether the promise manager is enabled. * @see diff --git a/node_modules/selenium-webdriver/lib/symbols.js b/node_modules/selenium-webdriver/lib/symbols.js index d5c62504e..6c7cd1d9d 100644 --- a/node_modules/selenium-webdriver/lib/symbols.js +++ b/node_modules/selenium-webdriver/lib/symbols.js @@ -30,7 +30,7 @@ module.exports = { * available, the serialize method will return a promise that will be resolved * with the serialized form. * - * Note that the described method is analgous to objects that define a + * Note that the described method is analogous to objects that define a * `toJSON()` method, except the serialized result may be a promise, or * another object with a promised property. */ diff --git a/node_modules/selenium-webdriver/lib/test/index.js b/node_modules/selenium-webdriver/lib/test/index.js index ba34ddab4..b3275ccbb 100644 --- a/node_modules/selenium-webdriver/lib/test/index.js +++ b/node_modules/selenium-webdriver/lib/test/index.js @@ -24,6 +24,7 @@ var build = require('./build'), webdriver = require('../../'), flow = webdriver.promise.controlFlow(), firefox = require('../../firefox'), + logging = require('../../lib/logging'), safari = require('../../safari'), remote = require('../../remote'), testing = require('../../testing'), @@ -56,6 +57,11 @@ var noMarionette = /^0|false$/i.test(process.env['SELENIUM_GECKODRIVER']); var startServer = !!serverJar && !remoteUrl; var nativeRun = !serverJar && !remoteUrl; +if (/^1|true$/i.test(process.env['SELENIUM_VERBOSE'])) { + logging.installConsoleHandler(); + logging.getLogger('webdriver.http').setLevel(logging.Level.ALL); +} + var browsersToTest = (function() { var permitRemoteBrowsers = !!remoteUrl || !!serverJar; var permitUnknownBrowsers = !nativeRun; diff --git a/node_modules/selenium-webdriver/lib/until.js b/node_modules/selenium-webdriver/lib/until.js index 0cc6f5ea3..b0e68b88b 100644 --- a/node_modules/selenium-webdriver/lib/until.js +++ b/node_modules/selenium-webdriver/lib/until.js @@ -72,7 +72,7 @@ const webdriver = require('./webdriver'), exports.ableToSwitchToFrame = function ableToSwitchToFrame(frame) { var condition; if (typeof frame === 'number' || frame instanceof webdriver.WebElement) { - condition = attemptToSwitchFrames; + condition = driver => attemptToSwitchFrames(driver, frame); } else { condition = function(driver) { let locator = /** @type {!(By|Function)} */(frame); diff --git a/node_modules/selenium-webdriver/lib/webdriver.js b/node_modules/selenium-webdriver/lib/webdriver.js index 081d77bda..c8d04e82a 100644 --- a/node_modules/selenium-webdriver/lib/webdriver.js +++ b/node_modules/selenium-webdriver/lib/webdriver.js @@ -457,12 +457,12 @@ class IWebDriver { * while evaluating the condition, they will be allowed to propagate. In the * event a condition returns a {@link promise.Promise promise}, the polling * loop will wait for it to be resolved and use the resolved value for whether - * the condition has been satisified. Note the resolution time for a promise + * the condition has been satisfied. Note the resolution time for a promise * is factored into whether a wait has timed out. * * Note, if the provided condition is a {@link WebElementCondition}, then * the wait will return a {@link WebElementPromise} that will resolve to the - * element that satisified the condition. + * element that satisfied the condition. * * _Example:_ waiting up to 10 seconds for an element to be present on the * page. @@ -779,7 +779,7 @@ class WebDriver { 'WebDriver.createSession()'); if (typeof opt_onQuit === 'function') { session = session.catch(err => { - return Promise.resolve(opt_onQuit.call(void 0)).then(_ => {throw err}); + return Promise.resolve(opt_onQuit.call(void 0)).then(_ => {throw err;}); }); } const ctor = opt_ctor || WebDriver; @@ -850,7 +850,7 @@ class WebDriver { new command.Command(command.Name.QUIT), 'WebDriver.quit()'); // Delete our session ID when the quit command finishes; this will allow us - // to throw an error when attemnpting to use a driver post-quit. + // to throw an error when attempting to use a driver post-quit. return /** @type {!promise.Thenable} */(promise.finally(result, () => { this.session_ = this.flow_.promise((_, reject) => { reject(new error.NoSuchSessionError( @@ -1181,7 +1181,7 @@ class Navigation { /** * Provides methods for managing browser and driver state. * - * This class should never be instantiated directly. Insead, obtain an instance + * This class should never be instantiated directly. Instead, obtain an instance * with {@linkplain WebDriver#manage() webdriver.manage()}. */ class Options { @@ -1427,7 +1427,7 @@ Options.Cookie.prototype.expiry; /** * An interface for managing timeout behavior for WebDriver instances. * - * This class should never be instantiated directly. Insead, obtain an instance + * This class should never be instantiated directly. Instead, obtain an instance * with * * webdriver.manage().timeouts() @@ -2009,7 +2009,7 @@ class WebElement { * this instance. * * Modifier keys (SHIFT, CONTROL, ALT, META) are stateful; once a modifier is - * processed in the keysequence, that key state is toggled until one of the + * processed in the key sequence, that key state is toggled until one of the * following occurs: * * - The modifier key is encountered again in the sequence. At this point the @@ -2028,13 +2028,13 @@ class WebElement { * Key.chord(Key.CONTROL, "a"), * "now text is"); * - * - The end of the keysequence is encountered. When there are no more keys + * - The end of the key sequence is encountered. When there are no more keys * to type, all depressed modifier keys are released (with accompanying * keyup events). * * If this element is a file input ({@code }), the * specified key sequence should specify the path to the file to attach to - * the element. This is analgous to the user clicking "Browse..." and entering + * the element. This is analogous to the user clicking "Browse..." and entering * the path into the file select dialog. * * var form = driver.findElement(By.css('form')); @@ -2050,7 +2050,7 @@ class WebElement { * * __Note:__ On browsers where native keyboard events are not supported * (e.g. Firefox on OS X), key events will be synthesized. Special - * punctionation keys will be synthesized according to a standard QWERTY en-us + * punctuation keys will be synthesized according to a standard QWERTY en-us * keyboard layout. * * @param {...(number|string|!IThenable<(number|string)>)} var_args The @@ -2214,7 +2214,7 @@ class WebElement { /** * Schedules a command to query whether the DOM element represented by this - * instance is enabled, as dicted by the {@code disabled} attribute. + * instance is enabled, as dictated by the {@code disabled} attribute. * @return {!promise.Thenable} A promise that will be * resolved with whether this element is currently enabled. */ @@ -2327,7 +2327,7 @@ class WebElementPromise extends WebElement { if (promise.CancellableThenable.isImplementation(el)) { /** @type {!promise.CancellableThenable} */(el).cancel(opt_reason); } - } + }; /** @override */ this.then = el.then.bind(el); diff --git a/node_modules/selenium-webdriver/opera.js b/node_modules/selenium-webdriver/opera.js index cc84f2af5..5107bae4e 100644 --- a/node_modules/selenium-webdriver/opera.js +++ b/node_modules/selenium-webdriver/opera.js @@ -62,7 +62,7 @@ * var options = new opera.Options(); * // configure browser options ... * - * var driver = new opera.Driver(options, service); + * var driver = opera.Driver.createSession(options, service); * * Users should only instantiate the {@link Driver} class directly when they * need a custom driver service configuration (as shown above). For normal diff --git a/node_modules/selenium-webdriver/package.json b/node_modules/selenium-webdriver/package.json index 5c3935833..dfb557bf4 100644 --- a/node_modules/selenium-webdriver/package.json +++ b/node_modules/selenium-webdriver/package.json @@ -1,6 +1,6 @@ { "name": "selenium-webdriver", - "version": "3.0.1", + "version": "3.3.0", "description": "The official WebDriver JavaScript bindings from the Selenium project", "license": "Apache-2.0", "keywords": [ diff --git a/node_modules/selenium-webdriver/remote/index.js b/node_modules/selenium-webdriver/remote/index.js index 87dee7e8d..cc0b66462 100644 --- a/node_modules/selenium-webdriver/remote/index.js +++ b/node_modules/selenium-webdriver/remote/index.js @@ -492,7 +492,12 @@ class SeleniumServer extends DriverService { return jvmArgs.concat('-jar', jar, '-port', port).concat(args); }); - super('java', { + let java = 'java'; + if (process.env['JAVA_HOME']) { + java = path.join(process.env['JAVA_HOME'], 'bin/java'); + } + + super(java, { loopback: options.loopback, port: port, args: args, diff --git a/node_modules/selenium-webdriver/safari.js b/node_modules/selenium-webdriver/safari.js index 97d512bc7..5a57387c1 100644 --- a/node_modules/selenium-webdriver/safari.js +++ b/node_modules/selenium-webdriver/safari.js @@ -68,7 +68,7 @@ class ServiceBuilder extends remote.DriverService.Builder { const OPTIONS_CAPABILITY_KEY = 'safari.options'; - +const TECHNOLOGY_PREVIEW_OPTIONS_KEY = 'technologyPreview'; /** * Configuration options specific to the {@link Driver SafariDriver}. @@ -89,16 +89,17 @@ class Options { * Extracts the SafariDriver specific options from the given capabilities * object. * @param {!Capabilities} capabilities The capabilities object. - * @return {!Options} The ChromeDriver options. + * @return {!Options} The SafariDriver options. */ static fromCapabilities(capabilities) { var options = new Options(); - var o = capabilities.get(OPTIONS_CAPABILITY_KEY); + if (o instanceof Options) { options = o; } else if (o) { options.setCleanSession(o.cleanSession); + options.setTechnologyPreview(o[TECHNOLOGY_PREVIEW_OPTIONS_KEY]); } if (capabilities.has(Capability.PROXY)) { @@ -148,6 +149,22 @@ class Options { return this; } + /** + * Instruct the SafariDriver to use the Safari Technology Preview if true. + * Otherwise, use the release version of Safari. Defaults to using the release version of Safari. + * + * @param {boolean} useTechnologyPreview + * @return {!Options} A self reference. + */ + setTechnologyPreview(useTechnologyPreview) { + if (!this.options_) { + this.options_ = {}; + } + + this.options_[TECHNOLOGY_PREVIEW_OPTIONS_KEY] = !!useTechnologyPreview; + return this; + } + /** * Converts this options instance to a {@link Capabilities} object. * @param {Capabilities=} opt_capabilities The capabilities to @@ -179,6 +196,23 @@ class Options { } } +/** + * @param {(Options|Object)=} o The options object + * @return {boolean} + */ +function useTechnologyPreview(o) { + if (o instanceof Options) { + return !!(o.options_ && o.options_[TECHNOLOGY_PREVIEW_OPTIONS_KEY]); + } + + if (o && typeof o === 'object') { + return !!o[TECHNOLOGY_PREVIEW_OPTIONS_KEY]; + } + + return false; +} + +const SAFARIDRIVER_TECHNOLOGY_PREVIEW_EXE = '/Applications/Safari Technology Preview.app/Contents/MacOS/safaridriver'; /** * A WebDriver client for Safari. This class should never be instantiated @@ -200,14 +234,19 @@ class Driver extends webdriver.WebDriver { * @return {!Driver} A new driver instance. */ static createSession(opt_config, opt_flow) { - let caps; + let caps, exe; + if (opt_config instanceof Options) { caps = opt_config.toCapabilities(); } else { - caps = opt_config || Capabilities.safari() + caps = opt_config || Capabilities.safari(); } - let service = new ServiceBuilder().build(); + if (useTechnologyPreview(caps.get(OPTIONS_CAPABILITY_KEY))) { + exe = SAFARIDRIVER_TECHNOLOGY_PREVIEW_EXE; + } + + let service = new ServiceBuilder(exe).build(); let executor = new http.Executor( service.start().then(url => new http.HttpClient(url))); diff --git a/node_modules/selenium-webdriver/test/firefox/firefox_test.js b/node_modules/selenium-webdriver/test/firefox/firefox_test.js index 485964f91..dbf9910fa 100644 --- a/node_modules/selenium-webdriver/test/firefox/firefox_test.js +++ b/node_modules/selenium-webdriver/test/firefox/firefox_test.js @@ -26,6 +26,8 @@ var firefox = require('../../firefox'), Context = require('../../firefox').Context, error = require('../..').error; +var {consume} = require('../../lib/promise'); + var JETPACK_EXTENSION = path.join(__dirname, '../../lib/test/data/firefox/jetpack-sample.xpi'); @@ -53,9 +55,7 @@ test.suite(function(env) { * skipped if dev cannot be found on the current system. */ function runWithFirefoxDev(options, testFn) { - let binary = new firefox.Binary(); - binary.useDevEdition(); - return binary.locate().then(exe => { + return firefox.Channel.AURORA.locate().then(exe => { options.setBinary(exe); driver = env.builder() .setFirefoxOptions(options) @@ -67,21 +67,33 @@ test.suite(function(env) { }); } - test.it('can start Firefox with custom preferences', function*() { - var profile = new firefox.Profile(); - profile.setPreference('general.useragent.override', 'foo;bar'); + describe('can start Firefox with custom preferences', function() { + function runTest(opt_dir) { + return consume(function*() { + let profile = new firefox.Profile(opt_dir); + profile.setPreference('general.useragent.override', 'foo;bar'); - var options = new firefox.Options().setProfile(profile); + let options = new firefox.Options().setProfile(profile); - driver = env.builder(). - setFirefoxOptions(options). - build(); + driver = env.builder(). + setFirefoxOptions(options). + build(); - yield driver.get('data:text/html,

'); + yield driver.get('data:text/html,
content
'); - var userAgent = yield driver.executeScript( - 'return window.navigator.userAgent'); - assert(userAgent).equalTo('foo;bar'); + var userAgent = yield driver.executeScript( + 'return window.navigator.userAgent'); + assert(userAgent).equalTo('foo;bar'); + }); + } + + test.it('profile created from scratch', function() { + return runTest(); + }); + + test.it('profile created from template', function() { + return io.tmpDir().then(runTest); + }); }); test.it('can start Firefox with a jetpack extension', function() { diff --git a/node_modules/selenium-webdriver/test/lib/http_test.js b/node_modules/selenium-webdriver/test/lib/http_test.js index 1c6c073ad..2dd27869d 100644 --- a/node_modules/selenium-webdriver/test/lib/http_test.js +++ b/node_modules/selenium-webdriver/test/lib/http_test.js @@ -325,6 +325,37 @@ describe('http', function() { assert.ok(executor.w3c, 'should never downgrade'); }); }); + + it('handles legacy new session failures', function() { + let rawResponse = { + status: error.ErrorCode.NO_SUCH_ELEMENT, + value: {message: 'hi'} + }; + + send.returns(Promise.resolve( + new http.Response(500, {}, JSON.stringify(rawResponse)))); + + return executor.execute(command) + .then(() => assert.fail('should have failed'), + e => { + assert.ok(e instanceof error.NoSuchElementError); + assert.equal(e.message, 'hi'); + }); + }); + + it('handles w3c new session failures', function() { + let rawResponse = {error: 'no such element', message: 'oops'}; + + send.returns(Promise.resolve( + new http.Response(500, {}, JSON.stringify(rawResponse)))); + + return executor.execute(command) + .then(() => assert.fail('should have failed'), + e => { + assert.ok(e instanceof error.NoSuchElementError); + assert.equal(e.message, 'oops'); + }); + }); }); describe('extracts Session from DESCRIBE_SESSION response', function() { diff --git a/node_modules/selenium-webdriver/test/lib/promise_test.js b/node_modules/selenium-webdriver/test/lib/promise_test.js index 96d2ccc22..8da1cd89e 100644 --- a/node_modules/selenium-webdriver/test/lib/promise_test.js +++ b/node_modules/selenium-webdriver/test/lib/promise_test.js @@ -301,6 +301,25 @@ describe('promise', function() { }); promiseManagerSuite(() => { + describe('fulfilled', function() { + it('returns input value if it is already a valid promise', function() { + let p = promise.createPromise(function() {}); + let r = promise.fulfilled(p); + assert.strictEqual(p, r); + }); + + it('creates a new promise fulfilled with input', function() { + return promise.fulfilled(1234).then(v => assert.equal(1234, v)); + }); + + it('can convert thenables to valid promise', function() { + let thenable = {then: function(cb) {cb(1234)}}; + let p = promise.fulfilled(thenable); + assert.notStrictEqual(thenable, p); + return p.then(v => assert.equal(1234, v)); + }); + }); + describe('when', function() { it('ReturnsAResolvedPromiseIfGivenANonPromiseValue', function() { var ret = promise.when('abc'); diff --git a/node_modules/selenium-webdriver/test/lib/until_test.js b/node_modules/selenium-webdriver/test/lib/until_test.js index 31b2b32ad..3226a467a 100644 --- a/node_modules/selenium-webdriver/test/lib/until_test.js +++ b/node_modules/selenium-webdriver/test/lib/until_test.js @@ -70,39 +70,54 @@ describe('until', function() { .then(fail, (e2) => assert.strictEqual(e2, e)); }); + const ELEMENT_ID = 'some-element-id'; + const ELEMENT_INDEX = 1234; + + function onSwitchFrame(expectedId) { + if (typeof expectedId === 'string') { + expectedId = WebElement.buildId(expectedId); + } else { + assert.equal(typeof expectedId, 'number', 'must be string or number'); + } + return cmd => { + assert.deepEqual( + cmd.getParameter('id'), expectedId, 'frame ID not specified'); + return true; + }; + } + it('byIndex', function() { - executor.on(CommandName.SWITCH_TO_FRAME, () => true); - return driver.wait(until.ableToSwitchToFrame(0), 100); + executor.on(CommandName.SWITCH_TO_FRAME, onSwitchFrame(ELEMENT_INDEX)); + return driver.wait(until.ableToSwitchToFrame(ELEMENT_INDEX), 100); }); it('byWebElement', function() { - executor.on(CommandName.SWITCH_TO_FRAME, () => true); - var el = new webdriver.WebElement(driver, {ELEMENT: 1234}); + executor.on(CommandName.SWITCH_TO_FRAME, onSwitchFrame(ELEMENT_ID)); + + var el = new webdriver.WebElement(driver, ELEMENT_ID); return driver.wait(until.ableToSwitchToFrame(el), 100); }); it('byWebElementPromise', function() { - executor.on(CommandName.SWITCH_TO_FRAME, () => true); + executor.on(CommandName.SWITCH_TO_FRAME, onSwitchFrame(ELEMENT_ID)); var el = new webdriver.WebElementPromise(driver, - Promise.resolve(new webdriver.WebElement(driver, {ELEMENT: 1234}))); + Promise.resolve(new webdriver.WebElement(driver, ELEMENT_ID))); return driver.wait(until.ableToSwitchToFrame(el), 100); }); it('byLocator', function() { - executor.on(CommandName.FIND_ELEMENTS, () => [WebElement.buildId(1234)]); - executor.on(CommandName.SWITCH_TO_FRAME, () => true); + executor.on(CommandName.FIND_ELEMENTS, () => [WebElement.buildId(ELEMENT_ID)]); + executor.on(CommandName.SWITCH_TO_FRAME, onSwitchFrame(ELEMENT_ID)); return driver.wait(until.ableToSwitchToFrame(By.id('foo')), 100); }); it('byLocator_elementNotInitiallyFound', function() { - var foundResponses = [[], [], [WebElement.buildId(1234)]]; + let foundResponses = [[], [], [WebElement.buildId(ELEMENT_ID)]]; executor.on(CommandName.FIND_ELEMENTS, () => foundResponses.shift()); - executor.on(CommandName.SWITCH_TO_FRAME, () => true); + executor.on(CommandName.SWITCH_TO_FRAME, onSwitchFrame(ELEMENT_ID)); return driver.wait(until.ableToSwitchToFrame(By.id('foo')), 2000) - .then(function() { - assert.equal(foundResponses.length, 0); - }); + .then(() => assert.deepEqual(foundResponses, [])); }); it('timesOutIfNeverAbletoSwitchFrames', function() { diff --git a/node_modules/selenium-webdriver/testing/index.js b/node_modules/selenium-webdriver/testing/index.js index 5bb82d15f..88763c7d5 100644 --- a/node_modules/selenium-webdriver/testing/index.js +++ b/node_modules/selenium-webdriver/testing/index.js @@ -41,16 +41,14 @@ * The provided wrappers leverage the {@link webdriver.promise.ControlFlow} * to simplify writing asynchronous tests: * - * var By = require('selenium-webdriver').By, - * until = require('selenium-webdriver').until, - * firefox = require('selenium-webdriver/firefox'), - * test = require('selenium-webdriver/testing'); + * var {Builder, By, until} = require('selenium-webdriver'); + * var test = require('selenium-webdriver/testing'); * * test.describe('Google Search', function() { * var driver; * * test.before(function() { - * driver = new firefox.Driver(); + * driver = new Builder().forBrowser('firefox').build(); * }); * * test.after(function() { @@ -292,6 +290,19 @@ exports.describe = function(name, opt_fn) { }; +/** + * An alias for {@link #describe()} that marks the suite as exclusive, + * suppressing all other test suites. + * @param {string} name The suite name. + * @param {function()=} opt_fn The suite function, or `undefined` to define + * a pending test suite. + */ +exports.describe.only = function(name, opt_fn) { + let desc = getMochaGlobal('describe'); + return opt_fn ? desc.only(name, opt_fn) : desc.only(name); +}; + + /** * Defines a suppressed test suite. * @param {string} name The suite name. diff --git a/node_modules/semver/.npmignore b/node_modules/semver/.npmignore deleted file mode 100644 index 534108e3f..000000000 --- a/node_modules/semver/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules/ -coverage/ -.nyc_output/ -nyc_output/ diff --git a/node_modules/semver/.travis.yml b/node_modules/semver/.travis.yml deleted file mode 100644 index 991d04b6e..000000000 --- a/node_modules/semver/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - '0.10' - - '0.12' - - 'iojs' diff --git a/node_modules/semver/Makefile b/node_modules/semver/Makefile deleted file mode 100644 index 71af0e975..000000000 --- a/node_modules/semver/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -files = semver.browser.js \ - semver.min.js \ - semver.browser.js.gz \ - semver.min.js.gz - -all: $(files) - -clean: - rm -f $(files) - -semver.browser.js: head.js.txt semver.js foot.js.txt - ( cat head.js.txt; \ - cat semver.js | \ - egrep -v '^ *\/\* nomin \*\/' | \ - perl -pi -e 's/debug\([^\)]+\)//g'; \ - cat foot.js.txt ) > semver.browser.js - -semver.min.js: semver.browser.js - uglifyjs -m semver.min.js - -%.gz: % - gzip --stdout -9 <$< >$@ - -.PHONY: all clean diff --git a/node_modules/semver/README.md b/node_modules/semver/README.md index b5e35ff0b..cbd956549 100644 --- a/node_modules/semver/README.md +++ b/node_modules/semver/README.md @@ -4,6 +4,8 @@ semver(1) -- The semantic versioner for npm ## Usage $ npm install semver + $ node + var semver = require('semver') semver.valid('1.2.3') // '1.2.3' semver.valid('a.b.c') // null @@ -16,18 +18,35 @@ As a command-line utility: $ semver -h - Usage: semver [ [...]] [-r | -i | --preid | -l | -rv] - Test if version(s) satisfy the supplied range(s), and sort them. + SemVer 5.1.0 - Multiple versions or ranges may be supplied, unless increment - option is specified. In that case, only a single version may - be used, and it is incremented by the specified level + A JavaScript implementation of the http://semver.org/ specification + Copyright Isaac Z. Schlueter + + Usage: semver [options] [ [...]] + Prints valid versions sorted by SemVer precedence + + Options: + -r --range + Print versions that match the specified range. + + -i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, or prerelease. Default level is 'patch'. + Only one version may be specified. + + --preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + + -l --loose + Interpret versions and ranges loosely Program exits successfully if any valid version satisfies all supplied ranges, and prints all satisfying versions. - If no versions are valid, or ranges are not satisfied, - then exits failure. + If no satisfying versions are found, then exits failure. Versions are printed in ascending order, so supplying multiple versions to the utility will just sort them. @@ -107,7 +126,7 @@ The method `.inc` takes an additional `identifier` string argument that will append the value of the string as a prerelease identifier: ```javascript -> semver.inc('1.2.3', 'pre', 'beta') +> semver.inc('1.2.3', 'prerelease', 'beta') '1.2.4-beta.0' ``` @@ -228,6 +247,30 @@ zero. * `^1.x` := `>=1.0.0 <2.0.0` * `^0.x` := `>=0.0.0 <1.0.0` +### Range Grammar + +Putting all this together, here is a Backus-Naur grammar for ranges, +for the benefit of parser authors: + +```bnf +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ +``` + ## Functions All methods and classes take a final `loose` boolean argument that, if @@ -248,6 +291,8 @@ strings that they parse. same as `prepatch`. It increments the patch version, then makes a prerelease. If the input version is already a prerelease it simply increments it. +* `prerelease(v)`: Returns an array of prerelease components, or null + if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` * `major(v)`: Return the major version number. * `minor(v)`: Return the minor version number. * `patch(v)`: Return the patch version number. @@ -282,6 +327,8 @@ strings that they parse. range. * `maxSatisfying(versions, range)`: Return the highest version in the list that satisfies the range, or `null` if none of them do. +* `minSatisfying(versions, range)`: Return the lowest version in the list + that satisfies the range, or `null` if none of them do. * `gtr(version, range)`: Return `true` if version is greater than all the versions possible in the range. * `ltr(version, range)`: Return `true` if version is less than all the diff --git a/node_modules/semver/foot.js.txt b/node_modules/semver/foot.js.txt deleted file mode 100644 index 8f83c20f8..000000000 --- a/node_modules/semver/foot.js.txt +++ /dev/null @@ -1,6 +0,0 @@ - -})( - typeof exports === 'object' ? exports : - typeof define === 'function' && define.amd ? {} : - semver = {} -); diff --git a/node_modules/semver/head.js.txt b/node_modules/semver/head.js.txt deleted file mode 100644 index 653686517..000000000 --- a/node_modules/semver/head.js.txt +++ /dev/null @@ -1,2 +0,0 @@ -;(function(exports) { - diff --git a/node_modules/semver/package.json b/node_modules/semver/package.json index fff26bd8c..ec9b01643 100644 --- a/node_modules/semver/package.json +++ b/node_modules/semver/package.json @@ -1,21 +1,22 @@ { "name": "semver", - "version": "4.3.6", + "version": "5.3.0", "description": "The semantic version parser used by npm.", "main": "semver.js", - "browser": "semver.browser.js", - "min": "semver.min.js", "scripts": { - "test": "tap test/*.js", - "prepublish": "make" + "test": "tap test/*.js" }, "devDependencies": { - "tap": "^1.2.0", - "uglify-js": "~2.3.6" + "tap": "^2.0.0" }, "license": "ISC", - "repository": "git://github.com/npm/node-semver.git", + "repository": "https://github.com/npm/node-semver", "bin": { "semver": "./bin/semver" - } + }, + "files": [ + "bin", + "range.bnf", + "semver.js" + ] } diff --git a/node_modules/semver/semver.browser.js b/node_modules/semver/semver.browser.js deleted file mode 100644 index 4b0cfecf2..000000000 --- a/node_modules/semver/semver.browser.js +++ /dev/null @@ -1,1201 +0,0 @@ -;(function(exports) { - -// export the class if we are in a Node-like system. -if (typeof module === 'object' && module.exports === exports) - exports = module.exports = SemVer; - -// The debug function is excluded entirely from the minified version. - -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -exports.SEMVER_SPEC_VERSION = '2.0.0'; - -var MAX_LENGTH = 256; -var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; - -// The actual regexps go on exports.re -var re = exports.re = []; -var src = exports.src = []; -var R = 0; - -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. - -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. - -var NUMERICIDENTIFIER = R++; -src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; -var NUMERICIDENTIFIERLOOSE = R++; -src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; - - -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. - -var NONNUMERICIDENTIFIER = R++; -src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; - - -// ## Main Version -// Three dot-separated numeric identifiers. - -var MAINVERSION = R++; -src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')'; - -var MAINVERSIONLOOSE = R++; -src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; - -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. - -var PRERELEASEIDENTIFIER = R++; -src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + - '|' + src[NONNUMERICIDENTIFIER] + ')'; - -var PRERELEASEIDENTIFIERLOOSE = R++; -src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + - '|' + src[NONNUMERICIDENTIFIER] + ')'; - - -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. - -var PRERELEASE = R++; -src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + - '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; - -var PRERELEASELOOSE = R++; -src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + - '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; - -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. - -var BUILDIDENTIFIER = R++; -src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; - -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. - -var BUILD = R++; -src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + - '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; - - -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. - -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. - -var FULL = R++; -var FULLPLAIN = 'v?' + src[MAINVERSION] + - src[PRERELEASE] + '?' + - src[BUILD] + '?'; - -src[FULL] = '^' + FULLPLAIN + '$'; - -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + - src[PRERELEASELOOSE] + '?' + - src[BUILD] + '?'; - -var LOOSE = R++; -src[LOOSE] = '^' + LOOSEPLAIN + '$'; - -var GTLT = R++; -src[GTLT] = '((?:<|>)?=?)'; - -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -var XRANGEIDENTIFIERLOOSE = R++; -src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; -var XRANGEIDENTIFIER = R++; -src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; - -var XRANGEPLAIN = R++; -src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:' + src[PRERELEASE] + ')?' + - src[BUILD] + '?' + - ')?)?'; - -var XRANGEPLAINLOOSE = R++; -src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:' + src[PRERELEASELOOSE] + ')?' + - src[BUILD] + '?' + - ')?)?'; - -var XRANGE = R++; -src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; -var XRANGELOOSE = R++; -src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; - -// Tilde ranges. -// Meaning is "reasonably at or greater than" -var LONETILDE = R++; -src[LONETILDE] = '(?:~>?)'; - -var TILDETRIM = R++; -src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; -re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); -var tildeTrimReplace = '$1~'; - -var TILDE = R++; -src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; -var TILDELOOSE = R++; -src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; - -// Caret ranges. -// Meaning is "at least and backwards compatible with" -var LONECARET = R++; -src[LONECARET] = '(?:\\^)'; - -var CARETTRIM = R++; -src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; -re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); -var caretTrimReplace = '$1^'; - -var CARET = R++; -src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; -var CARETLOOSE = R++; -src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; - -// A simple gt/lt/eq thing, or just "" to indicate "any version" -var COMPARATORLOOSE = R++; -src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; -var COMPARATOR = R++; -src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; - - -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -var COMPARATORTRIM = R++; -src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + - '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; - -// this one has to use the /g flag -re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); -var comparatorTrimReplace = '$1$2$3'; - - -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -var HYPHENRANGE = R++; -src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + - '\\s+-\\s+' + - '(' + src[XRANGEPLAIN] + ')' + - '\\s*$'; - -var HYPHENRANGELOOSE = R++; -src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s+-\\s+' + - '(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s*$'; - -// Star ranges basically just allow anything at all. -var STAR = R++; -src[STAR] = '(<|>)?=?\\s*\\*'; - -// Compile to actual regexp objects. -// All are flag-free, unless they were created above with a flag. -for (var i = 0; i < R; i++) { - ; - if (!re[i]) - re[i] = new RegExp(src[i]); -} - -exports.parse = parse; -function parse(version, loose) { - if (version instanceof SemVer) - return version; - - if (typeof version !== 'string') - return null; - - if (version.length > MAX_LENGTH) - return null; - - var r = loose ? re[LOOSE] : re[FULL]; - if (!r.test(version)) - return null; - - try { - return new SemVer(version, loose); - } catch (er) { - return null; - } -} - -exports.valid = valid; -function valid(version, loose) { - var v = parse(version, loose); - return v ? v.version : null; -} - - -exports.clean = clean; -function clean(version, loose) { - var s = parse(version.trim().replace(/^[=v]+/, ''), loose); - return s ? s.version : null; -} - -exports.SemVer = SemVer; - -function SemVer(version, loose) { - if (version instanceof SemVer) { - if (version.loose === loose) - return version; - else - version = version.version; - } else if (typeof version !== 'string') { - throw new TypeError('Invalid Version: ' + version); - } - - if (version.length > MAX_LENGTH) - throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') - - if (!(this instanceof SemVer)) - return new SemVer(version, loose); - - ; - this.loose = loose; - var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); - - if (!m) - throw new TypeError('Invalid Version: ' + version); - - this.raw = version; - - // these are actually numbers - this.major = +m[1]; - this.minor = +m[2]; - this.patch = +m[3]; - - if (this.major > MAX_SAFE_INTEGER || this.major < 0) - throw new TypeError('Invalid major version') - - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) - throw new TypeError('Invalid minor version') - - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) - throw new TypeError('Invalid patch version') - - // numberify any prerelease numeric ids - if (!m[4]) - this.prerelease = []; - else - this.prerelease = m[4].split('.').map(function(id) { - if (/^[0-9]+$/.test(id)) { - var num = +id - if (num >= 0 && num < MAX_SAFE_INTEGER) - return num - } - return id; - }); - - this.build = m[5] ? m[5].split('.') : []; - this.format(); -} - -SemVer.prototype.format = function() { - this.version = this.major + '.' + this.minor + '.' + this.patch; - if (this.prerelease.length) - this.version += '-' + this.prerelease.join('.'); - return this.version; -}; - -SemVer.prototype.inspect = function() { - return ''; -}; - -SemVer.prototype.toString = function() { - return this.version; -}; - -SemVer.prototype.compare = function(other) { - ; - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - return this.compareMain(other) || this.comparePre(other); -}; - -SemVer.prototype.compareMain = function(other) { - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - return compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch); -}; - -SemVer.prototype.comparePre = function(other) { - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) - return -1; - else if (!this.prerelease.length && other.prerelease.length) - return 1; - else if (!this.prerelease.length && !other.prerelease.length) - return 0; - - var i = 0; - do { - var a = this.prerelease[i]; - var b = other.prerelease[i]; - ; - if (a === undefined && b === undefined) - return 0; - else if (b === undefined) - return 1; - else if (a === undefined) - return -1; - else if (a === b) - continue; - else - return compareIdentifiers(a, b); - } while (++i); -}; - -// preminor will bump the version up to the next minor release, and immediately -// down to pre-release. premajor and prepatch work the same way. -SemVer.prototype.inc = function(release, identifier) { - switch (release) { - case 'premajor': - this.prerelease.length = 0; - this.patch = 0; - this.minor = 0; - this.major++; - this.inc('pre', identifier); - break; - case 'preminor': - this.prerelease.length = 0; - this.patch = 0; - this.minor++; - this.inc('pre', identifier); - break; - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0; - this.inc('patch', identifier); - this.inc('pre', identifier); - break; - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case 'prerelease': - if (this.prerelease.length === 0) - this.inc('patch', identifier); - this.inc('pre', identifier); - break; - - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) - this.major++; - this.minor = 0; - this.patch = 0; - this.prerelease = []; - break; - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) - this.minor++; - this.patch = 0; - this.prerelease = []; - break; - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) - this.patch++; - this.prerelease = []; - break; - // This probably shouldn't be used publicly. - // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. - case 'pre': - if (this.prerelease.length === 0) - this.prerelease = [0]; - else { - var i = this.prerelease.length; - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++; - i = -2; - } - } - if (i === -1) // didn't increment anything - this.prerelease.push(0); - } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) - this.prerelease = [identifier, 0]; - } else - this.prerelease = [identifier, 0]; - } - break; - - default: - throw new Error('invalid increment argument: ' + release); - } - this.format(); - return this; -}; - -exports.inc = inc; -function inc(version, release, loose, identifier) { - if (typeof(loose) === 'string') { - identifier = loose; - loose = undefined; - } - - try { - return new SemVer(version, loose).inc(release, identifier).version; - } catch (er) { - return null; - } -} - -exports.diff = diff; -function diff(version1, version2) { - if (eq(version1, version2)) { - return null; - } else { - var v1 = parse(version1); - var v2 = parse(version2); - if (v1.prerelease.length || v2.prerelease.length) { - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return 'pre'+key; - } - } - } - return 'prerelease'; - } - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return key; - } - } - } - } -} - -exports.compareIdentifiers = compareIdentifiers; - -var numeric = /^[0-9]+$/; -function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.test(b); - - if (anum && bnum) { - a = +a; - b = +b; - } - - return (anum && !bnum) ? -1 : - (bnum && !anum) ? 1 : - a < b ? -1 : - a > b ? 1 : - 0; -} - -exports.rcompareIdentifiers = rcompareIdentifiers; -function rcompareIdentifiers(a, b) { - return compareIdentifiers(b, a); -} - -exports.major = major; -function major(a, loose) { - return new SemVer(a, loose).major; -} - -exports.minor = minor; -function minor(a, loose) { - return new SemVer(a, loose).minor; -} - -exports.patch = patch; -function patch(a, loose) { - return new SemVer(a, loose).patch; -} - -exports.compare = compare; -function compare(a, b, loose) { - return new SemVer(a, loose).compare(b); -} - -exports.compareLoose = compareLoose; -function compareLoose(a, b) { - return compare(a, b, true); -} - -exports.rcompare = rcompare; -function rcompare(a, b, loose) { - return compare(b, a, loose); -} - -exports.sort = sort; -function sort(list, loose) { - return list.sort(function(a, b) { - return exports.compare(a, b, loose); - }); -} - -exports.rsort = rsort; -function rsort(list, loose) { - return list.sort(function(a, b) { - return exports.rcompare(a, b, loose); - }); -} - -exports.gt = gt; -function gt(a, b, loose) { - return compare(a, b, loose) > 0; -} - -exports.lt = lt; -function lt(a, b, loose) { - return compare(a, b, loose) < 0; -} - -exports.eq = eq; -function eq(a, b, loose) { - return compare(a, b, loose) === 0; -} - -exports.neq = neq; -function neq(a, b, loose) { - return compare(a, b, loose) !== 0; -} - -exports.gte = gte; -function gte(a, b, loose) { - return compare(a, b, loose) >= 0; -} - -exports.lte = lte; -function lte(a, b, loose) { - return compare(a, b, loose) <= 0; -} - -exports.cmp = cmp; -function cmp(a, op, b, loose) { - var ret; - switch (op) { - case '===': - if (typeof a === 'object') a = a.version; - if (typeof b === 'object') b = b.version; - ret = a === b; - break; - case '!==': - if (typeof a === 'object') a = a.version; - if (typeof b === 'object') b = b.version; - ret = a !== b; - break; - case '': case '=': case '==': ret = eq(a, b, loose); break; - case '!=': ret = neq(a, b, loose); break; - case '>': ret = gt(a, b, loose); break; - case '>=': ret = gte(a, b, loose); break; - case '<': ret = lt(a, b, loose); break; - case '<=': ret = lte(a, b, loose); break; - default: throw new TypeError('Invalid operator: ' + op); - } - return ret; -} - -exports.Comparator = Comparator; -function Comparator(comp, loose) { - if (comp instanceof Comparator) { - if (comp.loose === loose) - return comp; - else - comp = comp.value; - } - - if (!(this instanceof Comparator)) - return new Comparator(comp, loose); - - ; - this.loose = loose; - this.parse(comp); - - if (this.semver === ANY) - this.value = ''; - else - this.value = this.operator + this.semver.version; - - ; -} - -var ANY = {}; -Comparator.prototype.parse = function(comp) { - var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; - var m = comp.match(r); - - if (!m) - throw new TypeError('Invalid comparator: ' + comp); - - this.operator = m[1]; - if (this.operator === '=') - this.operator = ''; - - // if it literally is just '>' or '' then allow anything. - if (!m[2]) - this.semver = ANY; - else - this.semver = new SemVer(m[2], this.loose); -}; - -Comparator.prototype.inspect = function() { - return ''; -}; - -Comparator.prototype.toString = function() { - return this.value; -}; - -Comparator.prototype.test = function(version) { - ; - - if (this.semver === ANY) - return true; - - if (typeof version === 'string') - version = new SemVer(version, this.loose); - - return cmp(version, this.operator, this.semver, this.loose); -}; - - -exports.Range = Range; -function Range(range, loose) { - if ((range instanceof Range) && range.loose === loose) - return range; - - if (!(this instanceof Range)) - return new Range(range, loose); - - this.loose = loose; - - // First, split based on boolean or || - this.raw = range; - this.set = range.split(/\s*\|\|\s*/).map(function(range) { - return this.parseRange(range.trim()); - }, this).filter(function(c) { - // throw out any that are not relevant for whatever reason - return c.length; - }); - - if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range); - } - - this.format(); -} - -Range.prototype.inspect = function() { - return ''; -}; - -Range.prototype.format = function() { - this.range = this.set.map(function(comps) { - return comps.join(' ').trim(); - }).join('||').trim(); - return this.range; -}; - -Range.prototype.toString = function() { - return this.range; -}; - -Range.prototype.parseRange = function(range) { - var loose = this.loose; - range = range.trim(); - ; - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - ; - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); - ; - - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[TILDETRIM], tildeTrimReplace); - - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[CARETTRIM], caretTrimReplace); - - // normalize spaces - range = range.split(/\s+/).join(' '); - - // At this point, the range is completely trimmed and - // ready to be split into comparators. - - var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; - var set = range.split(' ').map(function(comp) { - return parseComparator(comp, loose); - }).join(' ').split(/\s+/); - if (this.loose) { - // in loose mode, throw out any that are not valid comparators - set = set.filter(function(comp) { - return !!comp.match(compRe); - }); - } - set = set.map(function(comp) { - return new Comparator(comp, loose); - }); - - return set; -}; - -// Mostly just for testing and legacy API reasons -exports.toComparators = toComparators; -function toComparators(range, loose) { - return new Range(range, loose).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(' ').trim().split(' '); - }); -} - -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -function parseComparator(comp, loose) { - ; - comp = replaceCarets(comp, loose); - ; - comp = replaceTildes(comp, loose); - ; - comp = replaceXRanges(comp, loose); - ; - comp = replaceStars(comp, loose); - ; - return comp; -} - -function isX(id) { - return !id || id.toLowerCase() === 'x' || id === '*'; -} - -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 -function replaceTildes(comp, loose) { - return comp.trim().split(/\s+/).map(function(comp) { - return replaceTilde(comp, loose); - }).join(' '); -} - -function replaceTilde(comp, loose) { - var r = loose ? re[TILDELOOSE] : re[TILDE]; - return comp.replace(r, function(_, M, m, p, pr) { - ; - var ret; - - if (isX(M)) - ret = ''; - else if (isX(m)) - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - else if (isX(p)) - // ~1.2 == >=1.2.0- <1.3.0- - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - else if (pr) { - ; - if (pr.charAt(0) !== '-') - pr = '-' + pr; - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0'; - } else - // ~1.2.3 == >=1.2.3 <1.3.0 - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0'; - - ; - return ret; - }); -} - -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 -// ^1.2.3 --> >=1.2.3 <2.0.0 -// ^1.2.0 --> >=1.2.0 <2.0.0 -function replaceCarets(comp, loose) { - return comp.trim().split(/\s+/).map(function(comp) { - return replaceCaret(comp, loose); - }).join(' '); -} - -function replaceCaret(comp, loose) { - ; - var r = loose ? re[CARETLOOSE] : re[CARET]; - return comp.replace(r, function(_, M, m, p, pr) { - ; - var ret; - - if (isX(M)) - ret = ''; - else if (isX(m)) - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - else if (isX(p)) { - if (M === '0') - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - else - ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; - } else if (pr) { - ; - if (pr.charAt(0) !== '-') - pr = '-' + pr; - if (M === '0') { - if (m === '0') - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + m + '.' + (+p + 1); - else - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0'; - } else - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + (+M + 1) + '.0.0'; - } else { - ; - if (M === '0') { - if (m === '0') - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + m + '.' + (+p + 1); - else - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0'; - } else - ret = '>=' + M + '.' + m + '.' + p + - ' <' + (+M + 1) + '.0.0'; - } - - ; - return ret; - }); -} - -function replaceXRanges(comp, loose) { - ; - return comp.split(/\s+/).map(function(comp) { - return replaceXRange(comp, loose); - }).join(' '); -} - -function replaceXRange(comp, loose) { - comp = comp.trim(); - var r = loose ? re[XRANGELOOSE] : re[XRANGE]; - return comp.replace(r, function(ret, gtlt, M, m, p, pr) { - ; - var xM = isX(M); - var xm = xM || isX(m); - var xp = xm || isX(p); - var anyX = xp; - - if (gtlt === '=' && anyX) - gtlt = ''; - - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0'; - } else { - // nothing is forbidden - ret = '*'; - } - } else if (gtlt && anyX) { - // replace X with 0 - if (xm) - m = 0; - if (xp) - p = 0; - - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - // >1.2.3 => >= 1.2.4 - gtlt = '>='; - if (xm) { - M = +M + 1; - m = 0; - p = 0; - } else if (xp) { - m = +m + 1; - p = 0; - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<' - if (xm) - M = +M + 1 - else - m = +m + 1 - } - - ret = gtlt + M + '.' + m + '.' + p; - } else if (xm) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - } else if (xp) { - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - } - - ; - - return ret; - }); -} - -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -function replaceStars(comp, loose) { - ; - // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[STAR], ''); -} - -// This function is passed to string.replace(re[HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0 -function hyphenReplace($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr, tb) { - - if (isX(fM)) - from = ''; - else if (isX(fm)) - from = '>=' + fM + '.0.0'; - else if (isX(fp)) - from = '>=' + fM + '.' + fm + '.0'; - else - from = '>=' + from; - - if (isX(tM)) - to = ''; - else if (isX(tm)) - to = '<' + (+tM + 1) + '.0.0'; - else if (isX(tp)) - to = '<' + tM + '.' + (+tm + 1) + '.0'; - else if (tpr) - to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; - else - to = '<=' + to; - - return (from + ' ' + to).trim(); -} - - -// if ANY of the sets match ALL of its comparators, then pass -Range.prototype.test = function(version) { - if (!version) - return false; - - if (typeof version === 'string') - version = new SemVer(version, this.loose); - - for (var i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version)) - return true; - } - return false; -}; - -function testSet(set, version) { - for (var i = 0; i < set.length; i++) { - if (!set[i].test(version)) - return false; - } - - if (version.prerelease.length) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (var i = 0; i < set.length; i++) { - ; - if (set[i].semver === ANY) - continue; - - if (set[i].semver.prerelease.length > 0) { - var allowed = set[i].semver; - if (allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch) - return true; - } - } - - // Version has a -pre, but it's not one of the ones we like. - return false; - } - - return true; -} - -exports.satisfies = satisfies; -function satisfies(version, range, loose) { - try { - range = new Range(range, loose); - } catch (er) { - return false; - } - return range.test(version); -} - -exports.maxSatisfying = maxSatisfying; -function maxSatisfying(versions, range, loose) { - return versions.filter(function(version) { - return satisfies(version, range, loose); - }).sort(function(a, b) { - return rcompare(a, b, loose); - })[0] || null; -} - -exports.validRange = validRange; -function validRange(range, loose) { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, loose).range || '*'; - } catch (er) { - return null; - } -} - -// Determine if version is less than all the versions possible in the range -exports.ltr = ltr; -function ltr(version, range, loose) { - return outside(version, range, '<', loose); -} - -// Determine if version is greater than all the versions possible in the range. -exports.gtr = gtr; -function gtr(version, range, loose) { - return outside(version, range, '>', loose); -} - -exports.outside = outside; -function outside(version, range, hilo, loose) { - version = new SemVer(version, loose); - range = new Range(range, loose); - - var gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case '>': - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = '>'; - ecomp = '>='; - break; - case '<': - gtfn = lt; - ltefn = gte; - ltfn = gt; - comp = '<'; - ecomp = '<='; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); - } - - // If it satisifes the range it is not outside - if (satisfies(version, range, loose)) { - return false; - } - - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. - - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i]; - - var high = null; - var low = null; - - comparators.forEach(function(comparator) { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0') - } - high = high || comparator; - low = low || comparator; - if (gtfn(comparator.semver, high.semver, loose)) { - high = comparator; - } else if (ltfn(comparator.semver, low.semver, loose)) { - low = comparator; - } - }); - - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false; - } - - // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ((!low.operator || low.operator === comp) && - ltefn(version, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false; - } - } - return true; -} - -// Use the define() function if we're in AMD land -if (typeof define === 'function' && define.amd) - define(exports); - -})( - typeof exports === 'object' ? exports : - typeof define === 'function' && define.amd ? {} : - semver = {} -); diff --git a/node_modules/semver/semver.browser.js.gz b/node_modules/semver/semver.browser.js.gz deleted file mode 100644 index d67009d8ad2cd540874578704d097e4ffefd47d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7992 zcmV-8AIIPyiwFQ;=V(;|1KmAqR~tvN-}x17)+dsTBnuqh-53OiBqZ@Y2KxZn<6Rr# zku->jM>ERIh(`kc?YAENo`;0v?4EP)-B_p})z$Ut>gwv&cKc$HjEg8u+TqPS&5FDu z{#aXk`c&{&QCx;%90z$Wq6={yiXaO`l!!narIWB1M;}9x-{wU)>#sqBc5yoo(+e?6 zCyO`~!{Jc0($TNsxM+#5zLLd#ITBT?QP+gf#ie%QB%J*-%(e-!Q^05vjuum)P!~}S zoyYNF5>7;z6j2t&x8fp8XN3MNN}`Jhs;D8 z9Q^X~==9*ngJY;WTFgd(d#UE`PJA;M{C)GAZ?>L){r9g2-+Z%as2GfkMG%WDoB~d{ zn5F`dRp@0QjRou;T4nI%-5Fz%XJf01zo|MzXW%u+Flrodjt6;K)73Mz(1vlM1d z)d(Lac=Yq(!ST!QUVeXYbo%m#m&AkPjg9R!pu@XT?%MFa#y z0JteYP>^&dO`O+9&Gf0Lr#T^Q-UYqi_j~{Doyk97n!U3p);tdbus{D~uCst;AxtYR zdU*)45fm^dMTbb!LE(0||MJLan?}hhCQRBbu_0=BxglDe_wW1A0*qGa|NhFZ#w=)T zOCsafEt!sN(~Q_M?7lRR*0y5yn=I^sH4lS4R6H+fbeY+fW|u3aAiOy~I6ioFuzzw; zEu>ZTOv}9&O>C;2I!*shcdgU`o5@uOl(=2nXep|S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B%bS41_aSf!^ppGz`<6 zb9*6c(glfHx+wB!5|&zm%j8_}X~5ckntw&a`_^rajJAZCbDQH&VZPg{yqYB237f&Ge*Kk#4Pq=hPzU0nr1RNTuTyZYhT7fE+vo9xq#kR#iV!IAnuud6KeeRD7Yoeb+x8eu5la8bLT>U~R%w#>r z&Pu%db#AxJ|FT>pe7VcI>pgZ-jdXK*NqJVSff|ML6S*{5ylk~Lu*#4%(8eQ1DsKq-mh-3V$5^rm%jS8M0 z={?Q|QB=#BS!&hP+K-S2dIXq~^IgrgV|(6Y80}?3F|pG)Z%Z8fA=qes^%WV|heLLK zSM6*AX?~VJuD~x{v^!Ri&N5E>hu@1BlUA+x0QcbVfa*kNDqPVIX7m=J1gw5q8$|NH u(?<7>q1Zpat$&?+PZz&1Ems&1I{tA_ee@-pKknCH%>M%jFB%A1d;kFdn5hB) diff --git a/node_modules/semver/semver.js b/node_modules/semver/semver.js index cafcc006b..5f1a3c5c9 100644 --- a/node_modules/semver/semver.js +++ b/node_modules/semver/semver.js @@ -1,6 +1,4 @@ -// export the class if we are in a Node-like system. -if (typeof module === 'object' && module.exports === exports) - exports = module.exports = SemVer; +exports = module.exports = SemVer; // The debug function is excluded entirely from the minified version. /* nomin */ var debug; @@ -316,9 +314,9 @@ function SemVer(version, loose) { else this.prerelease = m[4].split('.').map(function(id) { if (/^[0-9]+$/.test(id)) { - var num = +id + var num = +id; if (num >= 0 && num < MAX_SAFE_INTEGER) - return num + return num; } return id; }); @@ -334,10 +332,6 @@ SemVer.prototype.format = function() { return this.version; }; -SemVer.prototype.inspect = function() { - return ''; -}; - SemVer.prototype.toString = function() { return this.version; }; @@ -483,6 +477,7 @@ SemVer.prototype.inc = function(release, identifier) { throw new Error('invalid increment argument: ' + release); } this.format(); + this.raw = this.version; return this; }; @@ -693,10 +688,6 @@ Comparator.prototype.parse = function(comp) { this.semver = new SemVer(m[2], this.loose); }; -Comparator.prototype.inspect = function() { - return ''; -}; - Comparator.prototype.toString = function() { return this.value; }; @@ -740,10 +731,6 @@ function Range(range, loose) { this.format(); } -Range.prototype.inspect = function() { - return ''; -}; - Range.prototype.format = function() { this.range = this.set.map(function(comps) { return comps.join(' ').trim(); @@ -849,7 +836,7 @@ function replaceTilde(comp, loose) { else if (isX(m)) ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; else if (isX(p)) - // ~1.2 == >=1.2.0- <1.3.0- + // ~1.2 == >=1.2.0 <1.3.0 ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; else if (pr) { debug('replaceTilde pr', pr); @@ -979,11 +966,11 @@ function replaceXRange(comp, loose) { } else if (gtlt === '<=') { // <=0.7.x is actually <0.8.0, since any 0.7.x should // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<' + gtlt = '<'; if (xm) - M = +M + 1 + M = +M + 1; else - m = +m + 1 + m = +m + 1; } ret = gtlt + M + '.' + m + '.' + p; @@ -1107,6 +1094,15 @@ function maxSatisfying(versions, range, loose) { })[0] || null; } +exports.minSatisfying = minSatisfying; +function minSatisfying(versions, range, loose) { + return versions.filter(function(version) { + return satisfies(version, range, loose); + }).sort(function(a, b) { + return compare(a, b, loose); + })[0] || null; +} + exports.validRange = validRange; function validRange(range, loose) { try { @@ -1200,6 +1196,8 @@ function outside(version, range, hilo, loose) { return true; } -// Use the define() function if we're in AMD land -if (typeof define === 'function' && define.amd) - define(exports); +exports.prerelease = prerelease; +function prerelease(version, loose) { + var parsed = parse(version, loose); + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null; +} diff --git a/node_modules/semver/semver.min.js b/node_modules/semver/semver.min.js deleted file mode 100644 index dea027b11..000000000 --- a/node_modules/semver/semver.min.js +++ /dev/null @@ -1 +0,0 @@ -(function(e){if(typeof module==="object"&&module.exports===e)e=module.exports=K;e.SEMVER_SPEC_VERSION="2.0.0";var r=256;var t=Number.MAX_SAFE_INTEGER||9007199254740991;var n=e.re=[];var i=e.src=[];var s=0;var o=s++;i[o]="0|[1-9]\\d*";var a=s++;i[a]="[0-9]+";var f=s++;i[f]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=s++;i[u]="("+i[o]+")\\."+"("+i[o]+")\\."+"("+i[o]+")";var l=s++;i[l]="("+i[a]+")\\."+"("+i[a]+")\\."+"("+i[a]+")";var p=s++;i[p]="(?:"+i[o]+"|"+i[f]+")";var c=s++;i[c]="(?:"+i[a]+"|"+i[f]+")";var h=s++;i[h]="(?:-("+i[p]+"(?:\\."+i[p]+")*))";var v=s++;i[v]="(?:-?("+i[c]+"(?:\\."+i[c]+")*))";var m=s++;i[m]="[0-9A-Za-z-]+";var g=s++;i[g]="(?:\\+("+i[m]+"(?:\\."+i[m]+")*))";var w=s++;var y="v?"+i[u]+i[h]+"?"+i[g]+"?";i[w]="^"+y+"$";var d="[v=\\s]*"+i[l]+i[v]+"?"+i[g]+"?";var j=s++;i[j]="^"+d+"$";var b=s++;i[b]="((?:<|>)?=?)";var E=s++;i[E]=i[a]+"|x|X|\\*";var $=s++;i[$]=i[o]+"|x|X|\\*";var k=s++;i[k]="[v=\\s]*("+i[$]+")"+"(?:\\.("+i[$]+")"+"(?:\\.("+i[$]+")"+"(?:"+i[h]+")?"+i[g]+"?"+")?)?";var R=s++;i[R]="[v=\\s]*("+i[E]+")"+"(?:\\.("+i[E]+")"+"(?:\\.("+i[E]+")"+"(?:"+i[v]+")?"+i[g]+"?"+")?)?";var S=s++;i[S]="^"+i[b]+"\\s*"+i[k]+"$";var x=s++;i[x]="^"+i[b]+"\\s*"+i[R]+"$";var I=s++;i[I]="(?:~>?)";var T=s++;i[T]="(\\s*)"+i[I]+"\\s+";n[T]=new RegExp(i[T],"g");var V="$1~";var A=s++;i[A]="^"+i[I]+i[k]+"$";var C=s++;i[C]="^"+i[I]+i[R]+"$";var M=s++;i[M]="(?:\\^)";var N=s++;i[N]="(\\s*)"+i[M]+"\\s+";n[N]=new RegExp(i[N],"g");var _="$1^";var z=s++;i[z]="^"+i[M]+i[k]+"$";var P=s++;i[P]="^"+i[M]+i[R]+"$";var X=s++;i[X]="^"+i[b]+"\\s*("+d+")$|^$";var Z=s++;i[Z]="^"+i[b]+"\\s*("+y+")$|^$";var q=s++;i[q]="(\\s*)"+i[b]+"\\s*("+d+"|"+i[k]+")";n[q]=new RegExp(i[q],"g");var L="$1$2$3";var F=s++;i[F]="^\\s*("+i[k]+")"+"\\s+-\\s+"+"("+i[k]+")"+"\\s*$";var G=s++;i[G]="^\\s*("+i[R]+")"+"\\s+-\\s+"+"("+i[R]+")"+"\\s*$";var O=s++;i[O]="(<|>)?=?\\s*\\*";for(var B=0;Br)return null;var i=t?n[j]:n[w];if(!i.test(e))return null;try{return new K(e,t)}catch(s){return null}}e.valid=H;function H(e,r){var t=D(e,r);return t?t.version:null}e.clean=J;function J(e,r){var t=D(e.trim().replace(/^[=v]+/,""),r);return t?t.version:null}e.SemVer=K;function K(e,i){if(e instanceof K){if(e.loose===i)return e;else e=e.version}else if(typeof e!=="string"){throw new TypeError("Invalid Version: "+e)}if(e.length>r)throw new TypeError("version is longer than "+r+" characters");if(!(this instanceof K))return new K(e,i);this.loose=i;var s=e.trim().match(i?n[j]:n[w]);if(!s)throw new TypeError("Invalid Version: "+e);this.raw=e;this.major=+s[1];this.minor=+s[2];this.patch=+s[3];if(this.major>t||this.major<0)throw new TypeError("Invalid major version");if(this.minor>t||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>t||this.patch<0)throw new TypeError("Invalid patch version");if(!s[4])this.prerelease=[];else this.prerelease=s[4].split(".").map(function(e){if(/^[0-9]+$/.test(e)){var r=+e;if(r>=0&&r'};K.prototype.toString=function(){return this.version};K.prototype.compare=function(e){if(!(e instanceof K))e=new K(e,this.loose);return this.compareMain(e)||this.comparePre(e)};K.prototype.compareMain=function(e){if(!(e instanceof K))e=new K(e,this.loose);return Y(this.major,e.major)||Y(this.minor,e.minor)||Y(this.patch,e.patch)};K.prototype.comparePre=function(e){if(!(e instanceof K))e=new K(e,this.loose);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;var r=0;do{var t=this.prerelease[r];var n=e.prerelease[r];if(t===undefined&&n===undefined)return 0;else if(n===undefined)return 1;else if(t===undefined)return-1;else if(t===n)continue;else return Y(t,n)}while(++r)};K.prototype.inc=function(e,r){switch(e){case"premajor":this.prerelease.length=0;this.patch=0;this.minor=0;this.major++;this.inc("pre",r);break;case"preminor":this.prerelease.length=0;this.patch=0;this.minor++;this.inc("pre",r);break;case"prepatch":this.prerelease.length=0;this.inc("patch",r);this.inc("pre",r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",r);this.inc("pre",r);break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0;this.patch=0;this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0;this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{var t=this.prerelease.length;while(--t>=0){if(typeof this.prerelease[t]==="number"){this.prerelease[t]++;t=-2}}if(t===-1)this.prerelease.push(0)}if(r){if(this.prerelease[0]===r){if(isNaN(this.prerelease[1]))this.prerelease=[r,0]}else this.prerelease=[r,0]}break;default:throw new Error("invalid increment argument: "+e)}this.format();return this};e.inc=Q;function Q(e,r,t,n){if(typeof t==="string"){n=t;t=undefined}try{return new K(e,t).inc(r,n).version}catch(i){return null}}e.diff=U;function U(e,r){if(pr(e,r)){return null}else{var t=D(e);var n=D(r);if(t.prerelease.length||n.prerelease.length){for(var i in t){if(i==="major"||i==="minor"||i==="patch"){if(t[i]!==n[i]){return"pre"+i}}}return"prerelease"}for(var i in t){if(i==="major"||i==="minor"||i==="patch"){if(t[i]!==n[i]){return i}}}}}e.compareIdentifiers=Y;var W=/^[0-9]+$/;function Y(e,r){var t=W.test(e);var n=W.test(r);if(t&&n){e=+e;r=+r}return t&&!n?-1:n&&!t?1:er?1:0}e.rcompareIdentifiers=er;function er(e,r){return Y(r,e)}e.major=rr;function rr(e,r){return new K(e,r).major}e.minor=tr;function tr(e,r){return new K(e,r).minor}e.patch=nr;function nr(e,r){return new K(e,r).patch}e.compare=ir;function ir(e,r,t){return new K(e,t).compare(r)}e.compareLoose=sr;function sr(e,r){return ir(e,r,true)}e.rcompare=or;function or(e,r,t){return ir(r,e,t)}e.sort=ar;function ar(r,t){return r.sort(function(r,n){return e.compare(r,n,t)})}e.rsort=fr;function fr(r,t){return r.sort(function(r,n){return e.rcompare(r,n,t)})}e.gt=ur;function ur(e,r,t){return ir(e,r,t)>0}e.lt=lr;function lr(e,r,t){return ir(e,r,t)<0}e.eq=pr;function pr(e,r,t){return ir(e,r,t)===0}e.neq=cr;function cr(e,r,t){return ir(e,r,t)!==0}e.gte=hr;function hr(e,r,t){return ir(e,r,t)>=0}e.lte=vr;function vr(e,r,t){return ir(e,r,t)<=0}e.cmp=mr;function mr(e,r,t,n){var i;switch(r){case"===":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e===t;break;case"!==":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e!==t;break;case"":case"=":case"==":i=pr(e,t,n);break;case"!=":i=cr(e,t,n);break;case">":i=ur(e,t,n);break;case">=":i=hr(e,t,n);break;case"<":i=lr(e,t,n);break;case"<=":i=vr(e,t,n);break;default:throw new TypeError("Invalid operator: "+r)}return i}e.Comparator=gr;function gr(e,r){if(e instanceof gr){if(e.loose===r)return e;else e=e.value}if(!(this instanceof gr))return new gr(e,r);this.loose=r;this.parse(e);if(this.semver===wr)this.value="";else this.value=this.operator+this.semver.version}var wr={};gr.prototype.parse=function(e){var r=this.loose?n[X]:n[Z];var t=e.match(r);if(!t)throw new TypeError("Invalid comparator: "+e);this.operator=t[1];if(this.operator==="=")this.operator="";if(!t[2])this.semver=wr;else this.semver=new K(t[2],this.loose)};gr.prototype.inspect=function(){return''};gr.prototype.toString=function(){return this.value};gr.prototype.test=function(e){if(this.semver===wr)return true;if(typeof e==="string")e=new K(e,this.loose);return mr(e,this.operator,this.semver,this.loose)};e.Range=yr;function yr(e,r){if(e instanceof yr&&e.loose===r)return e;if(!(this instanceof yr))return new yr(e,r);this.loose=r;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+e)}this.format()}yr.prototype.inspect=function(){return''};yr.prototype.format=function(){this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim();return this.range};yr.prototype.toString=function(){return this.range};yr.prototype.parseRange=function(e){var r=this.loose;e=e.trim();var t=r?n[G]:n[F];e=e.replace(t,Tr);e=e.replace(n[q],L);e=e.replace(n[T],V);e=e.replace(n[N],_);e=e.split(/\s+/).join(" ");var i=r?n[X]:n[Z];var s=e.split(" ").map(function(e){return jr(e,r)}).join(" ").split(/\s+/);if(this.loose){s=s.filter(function(e){return!!e.match(i)})}s=s.map(function(e){return new gr(e,r)});return s};e.toComparators=dr;function dr(e,r){return new yr(e,r).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function jr(e,r){e=kr(e,r);e=Er(e,r);e=Sr(e,r);e=Ir(e,r);return e}function br(e){return!e||e.toLowerCase()==="x"||e==="*"}function Er(e,r){return e.trim().split(/\s+/).map(function(e){return $r(e,r)}).join(" ")}function $r(e,r){var t=r?n[C]:n[A];return e.replace(t,function(e,r,t,n,i){var s;if(br(r))s="";else if(br(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(br(n))s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else if(i){if(i.charAt(0)!=="-")i="-"+i;s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0";return s})}function kr(e,r){return e.trim().split(/\s+/).map(function(e){return Rr(e,r)}).join(" ")}function Rr(e,r){var t=r?n[P]:n[z];return e.replace(t,function(e,r,t,n,i){var s;if(br(r))s="";else if(br(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(br(n)){if(r==="0")s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else s=">="+r+"."+t+".0 <"+(+r+1)+".0.0"}else if(i){if(i.charAt(0)!=="-")i="-"+i;if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+i+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+i+" <"+(+r+1)+".0.0"}else{if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+(+r+1)+".0.0"}return s})}function Sr(e,r){return e.split(/\s+/).map(function(e){return xr(e,r)}).join(" ")}function xr(e,r){e=e.trim();var t=r?n[x]:n[S];return e.replace(t,function(e,r,t,n,i,s){var o=br(t);var a=o||br(n);var f=a||br(i);var u=f;if(r==="="&&u)r="";if(o){if(r===">"||r==="<"){e="<0.0.0"}else{e="*"}}else if(r&&u){if(a)n=0;if(f)i=0;if(r===">"){r=">=";if(a){t=+t+1;n=0;i=0}else if(f){n=+n+1;i=0}}else if(r==="<="){r="<";if(a)t=+t+1;else n=+n+1}e=r+t+"."+n+"."+i}else if(a){e=">="+t+".0.0 <"+(+t+1)+".0.0"}else if(f){e=">="+t+"."+n+".0 <"+t+"."+(+n+1)+".0"}return e})}function Ir(e,r){return e.trim().replace(n[O],"")}function Tr(e,r,t,n,i,s,o,a,f,u,l,p,c){if(br(t))r="";else if(br(n))r=">="+t+".0.0";else if(br(i))r=">="+t+"."+n+".0";else r=">="+r;if(br(f))a="";else if(br(u))a="<"+(+f+1)+".0.0";else if(br(l))a="<"+f+"."+(+u+1)+".0";else if(p)a="<="+f+"."+u+"."+l+"-"+p;else a="<="+a;return(r+" "+a).trim()}yr.prototype.test=function(e){if(!e)return false;if(typeof e==="string")e=new K(e,this.loose);for(var r=0;r0){var n=e[t].semver;if(n.major===r.major&&n.minor===r.minor&&n.patch===r.patch)return true}}return false}return true}e.satisfies=Ar;function Ar(e,r,t){try{r=new yr(r,t)}catch(n){return false}return r.test(e)}e.maxSatisfying=Cr;function Cr(e,r,t){return e.filter(function(e){return Ar(e,r,t)}).sort(function(e,r){return or(e,r,t)})[0]||null}e.validRange=Mr;function Mr(e,r){try{return new yr(e,r).range||"*"}catch(t){return null}}e.ltr=Nr;function Nr(e,r,t){return zr(e,r,"<",t)}e.gtr=_r;function _r(e,r,t){return zr(e,r,">",t)}e.outside=zr;function zr(e,r,t,n){e=new K(e,n);r=new yr(r,n);var i,s,o,a,f;switch(t){case">":i=ur;s=vr;o=lr;a=">";f=">=";break;case"<":i=lr;s=hr;o=ur;a="<";f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Ar(e,r,n)){return false}for(var u=0;u=0.0.0")}p=p||e;c=c||e;if(i(e.semver,p.semver,n)){p=e}else if(o(e.semver,c.semver,n)){c=e}});if(p.operator===a||p.operator===f){return false}if((!c.operator||c.operator===a)&&s(e,c.semver)){return false}else if(c.operator===f&&o(e,c.semver)){return false}}return true}if(typeof define==="function"&&define.amd)define(e)})(typeof exports==="object"?exports:typeof define==="function"&&define.amd?{}:semver={}); \ No newline at end of file diff --git a/node_modules/semver/semver.min.js.gz b/node_modules/semver/semver.min.js.gz deleted file mode 100644 index cbbc16188002f2ca4bd733d2b9cdc3c4c79a0f7e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3790 zcmV;<4l(f`iwFQ<=V(;|1H~H+bJMu;uOyyMh;b6q-rc*QiP|Zpa6M?@T8;zK&@ri! z8WKCmPCrO|zy0k>YfEyRw7q*XZ+Fh+peK-pTNf3o~?#_c@J-MCoXjqv< z7qc;Ej5*PluY8a=wVIl0@tbKRk{Fh_%U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t#v#&gwt&YMae6k3KDW^nG0UW}PeF-5!`x|@Q>)F~tY(k2NAExwmJeMAxpca1!-`x+ z=iEaD(m+h#4Otrr4Z%Cx9Zd_ABGuoKK=Xv5bvhClukS=>hz(M-v7FW9B^yi;=@Jbh zAz>6!3iYWrEPlk7Q}Cq-X#T`J*h$H08(N@>lms_jP`Q@|NS`DmKl7b*;K~NkVx~^ZKJ(E*XMZ@yg zH_jl2q?OrHVwy?_mVwOV-?4`=YpQ@~-6ub<?19Fb&@rX zElK2Cl69T;6%-{w^J1F6Mzt50N$<2(6bYFDhFBqWm*M)To@%v_n#XbqpKwa`hH*;0 zbvM;y>&aY!Na`m+JPdfu_KZq*FK_qBHzbToU7^1P)7?^ws>mAivMqjdDyiS%5+!&wfl<&eFi2kpXwfUWH4|<9#VM!lU4KbMg~_r2(n7r zWa-t4%ztL#kTbBS1Je5YAU2><~gUOXA>yvmXZ152LNBj}@dD!$g#H z@?e&AUK8rPQsWUS(<{-5uuJV@is%eghFI=40^}t^&Lm`4LUwb=buGq6N3%GoKoGeC zK`MUbG8jh{Fi8bM1Q4oVyJ*LGB;QJsnM1eWSlN-A!I7JFg&8C~Z>CPon92FxtWO`z z=bt?e)Z-W%0S7*4p%B8jbzDiOa4!T^sD$gLQ#OSgQD?vg_=BZjj@6iE56JeE@jQ)1 z8fIX^3;;&;Po`!Q59$MJJS->y;Oo^v4zXAaENr({i$QzYPDK@FOj$_7S}j_GV}%JF z*wu?ujP98tp@317Eq`+1sz*HkZk`MB|2LBL*LP`Z`+h`s=jk?CX%4#kFU4gR3b`@> E01snB{Qv*} diff --git a/node_modules/semver/test/amd.js b/node_modules/semver/test/amd.js deleted file mode 100644 index a6041341b..000000000 --- a/node_modules/semver/test/amd.js +++ /dev/null @@ -1,15 +0,0 @@ -var tap = require('tap'); -var test = tap.test; - -test('amd', function(t) { - global.define = define; - define.amd = true; - var defined = null; - function define(stuff) { - defined = stuff; - } - var fromRequire = require('../'); - t.ok(defined, 'amd function called'); - t.equal(fromRequire, defined, 'amd stuff same as require stuff'); - t.end(); -}); diff --git a/node_modules/semver/test/big-numbers.js b/node_modules/semver/test/big-numbers.js deleted file mode 100644 index c051864bc..000000000 --- a/node_modules/semver/test/big-numbers.js +++ /dev/null @@ -1,31 +0,0 @@ -var test = require('tap').test -var semver = require('../') - -test('long version is too long', function (t) { - var v = '1.2.' + new Array(256).join('1') - t.throws(function () { - new semver.SemVer(v) - }) - t.equal(semver.valid(v, false), null) - t.equal(semver.valid(v, true), null) - t.equal(semver.inc(v, 'patch'), null) - t.end() -}) - -test('big number is like too long version', function (t) { - var v = '1.2.' + new Array(100).join('1') - t.throws(function () { - new semver.SemVer(v) - }) - t.equal(semver.valid(v, false), null) - t.equal(semver.valid(v, true), null) - t.equal(semver.inc(v, 'patch'), null) - t.end() -}) - -test('parsing null does not throw', function (t) { - t.equal(semver.parse(null), null) - t.equal(semver.parse({}), null) - t.equal(semver.parse(new semver.SemVer('1.2.3')).version, '1.2.3') - t.end() -}) diff --git a/node_modules/semver/test/clean.js b/node_modules/semver/test/clean.js deleted file mode 100644 index 9e268de95..000000000 --- a/node_modules/semver/test/clean.js +++ /dev/null @@ -1,29 +0,0 @@ -var tap = require('tap'); -var test = tap.test; -var semver = require('../semver.js'); -var clean = semver.clean; - -test('\nclean tests', function(t) { - // [range, version] - // Version should be detectable despite extra characters - [ - ['1.2.3', '1.2.3'], - [' 1.2.3 ', '1.2.3'], - [' 1.2.3-4 ', '1.2.3-4'], - [' 1.2.3-pre ', '1.2.3-pre'], - [' =v1.2.3 ', '1.2.3'], - ['v1.2.3', '1.2.3'], - [' v1.2.3 ', '1.2.3'], - ['\t1.2.3', '1.2.3'], - ['>1.2.3', null], - ['~1.2.3', null], - ['<=1.2.3', null], - ['1.2.x', null] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var msg = 'clean(' + range + ') = ' + version; - t.equal(clean(range), version, msg); - }); - t.end(); -}); diff --git a/node_modules/semver/test/gtr.js b/node_modules/semver/test/gtr.js deleted file mode 100644 index bbb87896c..000000000 --- a/node_modules/semver/test/gtr.js +++ /dev/null @@ -1,173 +0,0 @@ -var tap = require('tap'); -var test = tap.test; -var semver = require('../semver.js'); -var gtr = semver.gtr; - -test('\ngtr tests', function(t) { - // [range, version, loose] - // Version should be greater than range - [ - ['~1.2.2', '1.3.0'], - ['~0.6.1-1', '0.7.1-1'], - ['1.0.0 - 2.0.0', '2.0.1'], - ['1.0.0', '1.0.1-beta1'], - ['1.0.0', '2.0.0'], - ['<=2.0.0', '2.1.1'], - ['<=2.0.0', '3.2.9'], - ['<2.0.0', '2.0.0'], - ['0.1.20 || 1.2.4', '1.2.5'], - ['2.x.x', '3.0.0'], - ['1.2.x', '1.3.0'], - ['1.2.x || 2.x', '3.0.0'], - ['2.*.*', '5.0.1'], - ['1.2.*', '1.3.3'], - ['1.2.* || 2.*', '4.0.0'], - ['2', '3.0.0'], - ['2.3', '2.4.2'], - ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.5.5'], - ['~>3.2.1', '3.3.0'], // >=3.2.1 <3.3.0 - ['~1', '2.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '2.2.4'], - ['~> 1', '3.2.3'], - ['~1.0', '1.1.2'], // >=1.0.0 <1.1.0 - ['~ 1.0', '1.1.0'], - ['<1.2', '1.2.0'], - ['< 1.2', '1.2.1'], - ['1', '2.0.0beta', true], - ['~v0.5.4-pre', '0.6.0'], - ['~v0.5.4-pre', '0.6.1-pre'], - ['=0.7.x', '0.8.0'], - ['=0.7.x', '0.8.0-asdf'], - ['<0.7.x', '0.7.0'], - ['~1.2.2', '1.3.0'], - ['1.0.0 - 2.0.0', '2.2.3'], - ['1.0.0', '1.0.1'], - ['<=2.0.0', '3.0.0'], - ['<=2.0.0', '2.9999.9999'], - ['<=2.0.0', '2.2.9'], - ['<2.0.0', '2.9999.9999'], - ['<2.0.0', '2.2.9'], - ['2.x.x', '3.1.3'], - ['1.2.x', '1.3.3'], - ['1.2.x || 2.x', '3.1.3'], - ['2.*.*', '3.1.3'], - ['1.2.*', '1.3.3'], - ['1.2.* || 2.*', '3.1.3'], - ['2', '3.1.2'], - ['2.3', '2.4.1'], - ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 - ['~>3.2.1', '3.3.2'], // >=3.2.1 <3.3.0 - ['~1', '2.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '2.2.3'], - ['~1.0', '1.1.0'], // >=1.0.0 <1.1.0 - ['<1', '1.0.0'], - ['1', '2.0.0beta', true], - ['<1', '1.0.0beta', true], - ['< 1', '1.0.0beta', true], - ['=0.7.x', '0.8.2'], - ['<0.7.x', '0.7.2'] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = 'gtr(' + version + ', ' + range + ', ' + loose + ')'; - t.ok(gtr(version, range, loose), msg); - }); - t.end(); -}); - -test('\nnegative gtr tests', function(t) { - // [range, version, loose] - // Version should NOT be greater than range - [ - ['~0.6.1-1', '0.6.1-1'], - ['1.0.0 - 2.0.0', '1.2.3'], - ['1.0.0 - 2.0.0', '0.9.9'], - ['1.0.0', '1.0.0'], - ['>=*', '0.2.4'], - ['', '1.0.0', true], - ['*', '1.2.3'], - ['*', 'v1.2.3-foo'], - ['>=1.0.0', '1.0.0'], - ['>=1.0.0', '1.0.1'], - ['>=1.0.0', '1.1.0'], - ['>1.0.0', '1.0.1'], - ['>1.0.0', '1.1.0'], - ['<=2.0.0', '2.0.0'], - ['<=2.0.0', '1.9999.9999'], - ['<=2.0.0', '0.2.9'], - ['<2.0.0', '1.9999.9999'], - ['<2.0.0', '0.2.9'], - ['>= 1.0.0', '1.0.0'], - ['>= 1.0.0', '1.0.1'], - ['>= 1.0.0', '1.1.0'], - ['> 1.0.0', '1.0.1'], - ['> 1.0.0', '1.1.0'], - ['<= 2.0.0', '2.0.0'], - ['<= 2.0.0', '1.9999.9999'], - ['<= 2.0.0', '0.2.9'], - ['< 2.0.0', '1.9999.9999'], - ['<\t2.0.0', '0.2.9'], - ['>=0.1.97', 'v0.1.97'], - ['>=0.1.97', '0.1.97'], - ['0.1.20 || 1.2.4', '1.2.4'], - ['0.1.20 || >1.2.4', '1.2.4'], - ['0.1.20 || 1.2.4', '1.2.3'], - ['0.1.20 || 1.2.4', '0.1.20'], - ['>=0.2.3 || <0.0.1', '0.0.0'], - ['>=0.2.3 || <0.0.1', '0.2.3'], - ['>=0.2.3 || <0.0.1', '0.2.4'], - ['||', '1.3.4'], - ['2.x.x', '2.1.3'], - ['1.2.x', '1.2.3'], - ['1.2.x || 2.x', '2.1.3'], - ['1.2.x || 2.x', '1.2.3'], - ['x', '1.2.3'], - ['2.*.*', '2.1.3'], - ['1.2.*', '1.2.3'], - ['1.2.* || 2.*', '2.1.3'], - ['1.2.* || 2.*', '1.2.3'], - ['1.2.* || 2.*', '1.2.3'], - ['*', '1.2.3'], - ['2', '2.1.2'], - ['2.3', '2.3.1'], - ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.4.5'], - ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0 - ['~1', '1.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '1.2.3'], - ['~> 1', '1.2.3'], - ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0 - ['~ 1.0', '1.0.2'], - ['>=1', '1.0.0'], - ['>= 1', '1.0.0'], - ['<1.2', '1.1.1'], - ['< 1.2', '1.1.1'], - ['1', '1.0.0beta', true], - ['~v0.5.4-pre', '0.5.5'], - ['~v0.5.4-pre', '0.5.4'], - ['=0.7.x', '0.7.2'], - ['>=0.7.x', '0.7.2'], - ['=0.7.x', '0.7.0-asdf'], - ['>=0.7.x', '0.7.0-asdf'], - ['<=0.7.x', '0.6.2'], - ['>0.2.3 >0.2.4 <=0.2.5', '0.2.5'], - ['>=0.2.3 <=0.2.4', '0.2.4'], - ['1.0.0 - 2.0.0', '2.0.0'], - ['^1', '0.0.0-0'], - ['^3.0.0', '2.0.0'], - ['^1.0.0 || ~2.0.1', '2.0.0'], - ['^0.1.0 || ~3.0.1 || 5.0.0', '3.2.0'], - ['^0.1.0 || ~3.0.1 || 5.0.0', '1.0.0beta', true], - ['^0.1.0 || ~3.0.1 || 5.0.0', '5.0.0-0', true], - ['^0.1.0 || ~3.0.1 || >4 <=5.0.0', '3.5.0'] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = '!gtr(' + version + ', ' + range + ', ' + loose + ')'; - t.notOk(gtr(version, range, loose), msg); - }); - t.end(); -}); diff --git a/node_modules/semver/test/index.js b/node_modules/semver/test/index.js deleted file mode 100644 index c256c7947..000000000 --- a/node_modules/semver/test/index.js +++ /dev/null @@ -1,685 +0,0 @@ -'use strict'; - -var tap = require('tap'); -var test = tap.test; -var semver = require('../semver.js'); -var eq = semver.eq; -var gt = semver.gt; -var lt = semver.lt; -var neq = semver.neq; -var cmp = semver.cmp; -var gte = semver.gte; -var lte = semver.lte; -var satisfies = semver.satisfies; -var validRange = semver.validRange; -var inc = semver.inc; -var diff = semver.diff; -var replaceStars = semver.replaceStars; -var toComparators = semver.toComparators; -var SemVer = semver.SemVer; -var Range = semver.Range; - -test('\ncomparison tests', function(t) { - // [version1, version2] - // version1 should be greater than version2 - [['0.0.0', '0.0.0-foo'], - ['0.0.1', '0.0.0'], - ['1.0.0', '0.9.9'], - ['0.10.0', '0.9.0'], - ['0.99.0', '0.10.0'], - ['2.0.0', '1.2.3'], - ['v0.0.0', '0.0.0-foo', true], - ['v0.0.1', '0.0.0', true], - ['v1.0.0', '0.9.9', true], - ['v0.10.0', '0.9.0', true], - ['v0.99.0', '0.10.0', true], - ['v2.0.0', '1.2.3', true], - ['0.0.0', 'v0.0.0-foo', true], - ['0.0.1', 'v0.0.0', true], - ['1.0.0', 'v0.9.9', true], - ['0.10.0', 'v0.9.0', true], - ['0.99.0', 'v0.10.0', true], - ['2.0.0', 'v1.2.3', true], - ['1.2.3', '1.2.3-asdf'], - ['1.2.3', '1.2.3-4'], - ['1.2.3', '1.2.3-4-foo'], - ['1.2.3-5-foo', '1.2.3-5'], - ['1.2.3-5', '1.2.3-4'], - ['1.2.3-5-foo', '1.2.3-5-Foo'], - ['3.0.0', '2.7.2+asdf'], - ['1.2.3-a.10', '1.2.3-a.5'], - ['1.2.3-a.b', '1.2.3-a.5'], - ['1.2.3-a.b', '1.2.3-a'], - ['1.2.3-a.b.c.10.d.5', '1.2.3-a.b.c.5.d.100'], - ['1.2.3-r2', '1.2.3-r100'], - ['1.2.3-r100', '1.2.3-R2'] - ].forEach(function(v) { - var v0 = v[0]; - var v1 = v[1]; - var loose = v[2]; - t.ok(gt(v0, v1, loose), "gt('" + v0 + "', '" + v1 + "')"); - t.ok(lt(v1, v0, loose), "lt('" + v1 + "', '" + v0 + "')"); - t.ok(!gt(v1, v0, loose), "!gt('" + v1 + "', '" + v0 + "')"); - t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')"); - t.ok(eq(v0, v0, loose), "eq('" + v0 + "', '" + v0 + "')"); - t.ok(eq(v1, v1, loose), "eq('" + v1 + "', '" + v1 + "')"); - t.ok(neq(v0, v1, loose), "neq('" + v0 + "', '" + v1 + "')"); - t.ok(cmp(v1, '==', v1, loose), "cmp('" + v1 + "' == '" + v1 + "')"); - t.ok(cmp(v0, '>=', v1, loose), "cmp('" + v0 + "' >= '" + v1 + "')"); - t.ok(cmp(v1, '<=', v0, loose), "cmp('" + v1 + "' <= '" + v0 + "')"); - t.ok(cmp(v0, '!=', v1, loose), "cmp('" + v0 + "' != '" + v1 + "')"); - }); - t.end(); -}); - -test('\nequality tests', function(t) { - // [version1, version2] - // version1 should be equivalent to version2 - [['1.2.3', 'v1.2.3', true], - ['1.2.3', '=1.2.3', true], - ['1.2.3', 'v 1.2.3', true], - ['1.2.3', '= 1.2.3', true], - ['1.2.3', ' v1.2.3', true], - ['1.2.3', ' =1.2.3', true], - ['1.2.3', ' v 1.2.3', true], - ['1.2.3', ' = 1.2.3', true], - ['1.2.3-0', 'v1.2.3-0', true], - ['1.2.3-0', '=1.2.3-0', true], - ['1.2.3-0', 'v 1.2.3-0', true], - ['1.2.3-0', '= 1.2.3-0', true], - ['1.2.3-0', ' v1.2.3-0', true], - ['1.2.3-0', ' =1.2.3-0', true], - ['1.2.3-0', ' v 1.2.3-0', true], - ['1.2.3-0', ' = 1.2.3-0', true], - ['1.2.3-1', 'v1.2.3-1', true], - ['1.2.3-1', '=1.2.3-1', true], - ['1.2.3-1', 'v 1.2.3-1', true], - ['1.2.3-1', '= 1.2.3-1', true], - ['1.2.3-1', ' v1.2.3-1', true], - ['1.2.3-1', ' =1.2.3-1', true], - ['1.2.3-1', ' v 1.2.3-1', true], - ['1.2.3-1', ' = 1.2.3-1', true], - ['1.2.3-beta', 'v1.2.3-beta', true], - ['1.2.3-beta', '=1.2.3-beta', true], - ['1.2.3-beta', 'v 1.2.3-beta', true], - ['1.2.3-beta', '= 1.2.3-beta', true], - ['1.2.3-beta', ' v1.2.3-beta', true], - ['1.2.3-beta', ' =1.2.3-beta', true], - ['1.2.3-beta', ' v 1.2.3-beta', true], - ['1.2.3-beta', ' = 1.2.3-beta', true], - ['1.2.3-beta+build', ' = 1.2.3-beta+otherbuild', true], - ['1.2.3+build', ' = 1.2.3+otherbuild', true], - ['1.2.3-beta+build', '1.2.3-beta+otherbuild'], - ['1.2.3+build', '1.2.3+otherbuild'], - [' v1.2.3+build', '1.2.3+otherbuild'] - ].forEach(function(v) { - var v0 = v[0]; - var v1 = v[1]; - var loose = v[2]; - t.ok(eq(v0, v1, loose), "eq('" + v0 + "', '" + v1 + "')"); - t.ok(!neq(v0, v1, loose), "!neq('" + v0 + "', '" + v1 + "')"); - t.ok(cmp(v0, '==', v1, loose), 'cmp(' + v0 + '==' + v1 + ')'); - t.ok(!cmp(v0, '!=', v1, loose), '!cmp(' + v0 + '!=' + v1 + ')'); - t.ok(!cmp(v0, '===', v1, loose), '!cmp(' + v0 + '===' + v1 + ')'); - t.ok(cmp(v0, '!==', v1, loose), 'cmp(' + v0 + '!==' + v1 + ')'); - t.ok(!gt(v0, v1, loose), "!gt('" + v0 + "', '" + v1 + "')"); - t.ok(gte(v0, v1, loose), "gte('" + v0 + "', '" + v1 + "')"); - t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')"); - t.ok(lte(v0, v1, loose), "lte('" + v0 + "', '" + v1 + "')"); - }); - t.end(); -}); - - -test('\nrange tests', function(t) { - // [range, version] - // version should be included by range - [['1.0.0 - 2.0.0', '1.2.3'], - ['^1.2.3+build', '1.2.3'], - ['^1.2.3+build', '1.3.0'], - ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3'], - ['1.2.3pre+asdf - 2.4.3-pre+asdf', '1.2.3', true], - ['1.2.3-pre+asdf - 2.4.3pre+asdf', '1.2.3', true], - ['1.2.3pre+asdf - 2.4.3pre+asdf', '1.2.3', true], - ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3-pre.2'], - ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '2.4.3-alpha'], - ['1.2.3+asdf - 2.4.3+asdf', '1.2.3'], - ['1.0.0', '1.0.0'], - ['>=*', '0.2.4'], - ['', '1.0.0'], - ['*', '1.2.3'], - ['*', 'v1.2.3', true], - ['>=1.0.0', '1.0.0'], - ['>=1.0.0', '1.0.1'], - ['>=1.0.0', '1.1.0'], - ['>1.0.0', '1.0.1'], - ['>1.0.0', '1.1.0'], - ['<=2.0.0', '2.0.0'], - ['<=2.0.0', '1.9999.9999'], - ['<=2.0.0', '0.2.9'], - ['<2.0.0', '1.9999.9999'], - ['<2.0.0', '0.2.9'], - ['>= 1.0.0', '1.0.0'], - ['>= 1.0.0', '1.0.1'], - ['>= 1.0.0', '1.1.0'], - ['> 1.0.0', '1.0.1'], - ['> 1.0.0', '1.1.0'], - ['<= 2.0.0', '2.0.0'], - ['<= 2.0.0', '1.9999.9999'], - ['<= 2.0.0', '0.2.9'], - ['< 2.0.0', '1.9999.9999'], - ['<\t2.0.0', '0.2.9'], - ['>=0.1.97', 'v0.1.97', true], - ['>=0.1.97', '0.1.97'], - ['0.1.20 || 1.2.4', '1.2.4'], - ['>=0.2.3 || <0.0.1', '0.0.0'], - ['>=0.2.3 || <0.0.1', '0.2.3'], - ['>=0.2.3 || <0.0.1', '0.2.4'], - ['||', '1.3.4'], - ['2.x.x', '2.1.3'], - ['1.2.x', '1.2.3'], - ['1.2.x || 2.x', '2.1.3'], - ['1.2.x || 2.x', '1.2.3'], - ['x', '1.2.3'], - ['2.*.*', '2.1.3'], - ['1.2.*', '1.2.3'], - ['1.2.* || 2.*', '2.1.3'], - ['1.2.* || 2.*', '1.2.3'], - ['*', '1.2.3'], - ['2', '2.1.2'], - ['2.3', '2.3.1'], - ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.4.5'], - ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0, - ['~1', '1.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '1.2.3'], - ['~> 1', '1.2.3'], - ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0, - ['~ 1.0', '1.0.2'], - ['~ 1.0.3', '1.0.12'], - ['>=1', '1.0.0'], - ['>= 1', '1.0.0'], - ['<1.2', '1.1.1'], - ['< 1.2', '1.1.1'], - ['~v0.5.4-pre', '0.5.5'], - ['~v0.5.4-pre', '0.5.4'], - ['=0.7.x', '0.7.2'], - ['<=0.7.x', '0.7.2'], - ['>=0.7.x', '0.7.2'], - ['<=0.7.x', '0.6.2'], - ['~1.2.1 >=1.2.3', '1.2.3'], - ['~1.2.1 =1.2.3', '1.2.3'], - ['~1.2.1 1.2.3', '1.2.3'], - ['~1.2.1 >=1.2.3 1.2.3', '1.2.3'], - ['~1.2.1 1.2.3 >=1.2.3', '1.2.3'], - ['~1.2.1 1.2.3', '1.2.3'], - ['>=1.2.1 1.2.3', '1.2.3'], - ['1.2.3 >=1.2.1', '1.2.3'], - ['>=1.2.3 >=1.2.1', '1.2.3'], - ['>=1.2.1 >=1.2.3', '1.2.3'], - ['>=1.2', '1.2.8'], - ['^1.2.3', '1.8.1'], - ['^0.1.2', '0.1.2'], - ['^0.1', '0.1.2'], - ['^1.2', '1.4.2'], - ['^1.2 ^1', '1.4.2'], - ['^1.2.3-alpha', '1.2.3-pre'], - ['^1.2.0-alpha', '1.2.0-pre'], - ['^0.0.1-alpha', '0.0.1-beta'] - ].forEach(function(v) { - var range = v[0]; - var ver = v[1]; - var loose = v[2]; - t.ok(satisfies(ver, range, loose), range + ' satisfied by ' + ver); - }); - t.end(); -}); - -test('\nnegative range tests', function(t) { - // [range, version] - // version should not be included by range - [['1.0.0 - 2.0.0', '2.2.3'], - ['1.2.3+asdf - 2.4.3+asdf', '1.2.3-pre.2'], - ['1.2.3+asdf - 2.4.3+asdf', '2.4.3-alpha'], - ['^1.2.3+build', '2.0.0'], - ['^1.2.3+build', '1.2.0'], - ['^1.2.3', '1.2.3-pre'], - ['^1.2', '1.2.0-pre'], - ['>1.2', '1.3.0-beta'], - ['<=1.2.3', '1.2.3-beta'], - ['^1.2.3', '1.2.3-beta'], - ['=0.7.x', '0.7.0-asdf'], - ['>=0.7.x', '0.7.0-asdf'], - ['1', '1.0.0beta', true], - ['<1', '1.0.0beta', true], - ['< 1', '1.0.0beta', true], - ['1.0.0', '1.0.1'], - ['>=1.0.0', '0.0.0'], - ['>=1.0.0', '0.0.1'], - ['>=1.0.0', '0.1.0'], - ['>1.0.0', '0.0.1'], - ['>1.0.0', '0.1.0'], - ['<=2.0.0', '3.0.0'], - ['<=2.0.0', '2.9999.9999'], - ['<=2.0.0', '2.2.9'], - ['<2.0.0', '2.9999.9999'], - ['<2.0.0', '2.2.9'], - ['>=0.1.97', 'v0.1.93', true], - ['>=0.1.97', '0.1.93'], - ['0.1.20 || 1.2.4', '1.2.3'], - ['>=0.2.3 || <0.0.1', '0.0.3'], - ['>=0.2.3 || <0.0.1', '0.2.2'], - ['2.x.x', '1.1.3'], - ['2.x.x', '3.1.3'], - ['1.2.x', '1.3.3'], - ['1.2.x || 2.x', '3.1.3'], - ['1.2.x || 2.x', '1.1.3'], - ['2.*.*', '1.1.3'], - ['2.*.*', '3.1.3'], - ['1.2.*', '1.3.3'], - ['1.2.* || 2.*', '3.1.3'], - ['1.2.* || 2.*', '1.1.3'], - ['2', '1.1.2'], - ['2.3', '2.4.1'], - ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.3.9'], - ['~>3.2.1', '3.3.2'], // >=3.2.1 <3.3.0 - ['~>3.2.1', '3.2.0'], // >=3.2.1 <3.3.0 - ['~1', '0.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '2.2.3'], - ['~1.0', '1.1.0'], // >=1.0.0 <1.1.0 - ['<1', '1.0.0'], - ['>=1.2', '1.1.1'], - ['1', '2.0.0beta', true], - ['~v0.5.4-beta', '0.5.4-alpha'], - ['=0.7.x', '0.8.2'], - ['>=0.7.x', '0.6.2'], - ['<0.7.x', '0.7.2'], - ['<1.2.3', '1.2.3-beta'], - ['=1.2.3', '1.2.3-beta'], - ['>1.2', '1.2.8'], - ['^1.2.3', '2.0.0-alpha'], - ['^1.2.3', '1.2.2'], - ['^1.2', '1.1.9'], - ['*', 'v1.2.3-foo', true], - // invalid ranges never satisfied! - ['blerg', '1.2.3'], - ['git+https://user:password0123@github.com/foo', '123.0.0', true], - ['^1.2.3', '2.0.0-pre'] - ].forEach(function(v) { - var range = v[0]; - var ver = v[1]; - var loose = v[2]; - var found = satisfies(ver, range, loose); - t.ok(!found, ver + ' not satisfied by ' + range); - }); - t.end(); -}); - -test('\nincrement versions test', function(t) { -// [version, inc, result, identifier] -// inc(version, inc) -> result - [['1.2.3', 'major', '2.0.0'], - ['1.2.3', 'minor', '1.3.0'], - ['1.2.3', 'patch', '1.2.4'], - ['1.2.3tag', 'major', '2.0.0', true], - ['1.2.3-tag', 'major', '2.0.0'], - ['1.2.3', 'fake', null], - ['1.2.0-0', 'patch', '1.2.0'], - ['fake', 'major', null], - ['1.2.3-4', 'major', '2.0.0'], - ['1.2.3-4', 'minor', '1.3.0'], - ['1.2.3-4', 'patch', '1.2.3'], - ['1.2.3-alpha.0.beta', 'major', '2.0.0'], - ['1.2.3-alpha.0.beta', 'minor', '1.3.0'], - ['1.2.3-alpha.0.beta', 'patch', '1.2.3'], - ['1.2.4', 'prerelease', '1.2.5-0'], - ['1.2.3-0', 'prerelease', '1.2.3-1'], - ['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1'], - ['1.2.3-alpha.1', 'prerelease', '1.2.3-alpha.2'], - ['1.2.3-alpha.2', 'prerelease', '1.2.3-alpha.3'], - ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta'], - ['1.2.3-alpha.1.beta', 'prerelease', '1.2.3-alpha.2.beta'], - ['1.2.3-alpha.2.beta', 'prerelease', '1.2.3-alpha.3.beta'], - ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta'], - ['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta'], - ['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta'], - ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1'], - ['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2'], - ['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3'], - ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta'], - ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta'], - ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta'], - ['1.2.0', 'prepatch', '1.2.1-0'], - ['1.2.0-1', 'prepatch', '1.2.1-0'], - ['1.2.0', 'preminor', '1.3.0-0'], - ['1.2.3-1', 'preminor', '1.3.0-0'], - ['1.2.0', 'premajor', '2.0.0-0'], - ['1.2.3-1', 'premajor', '2.0.0-0'], - ['1.2.0-1', 'minor', '1.2.0'], - ['1.0.0-1', 'major', '1.0.0'], - - ['1.2.3', 'major', '2.0.0', false, 'dev'], - ['1.2.3', 'minor', '1.3.0', false, 'dev'], - ['1.2.3', 'patch', '1.2.4', false, 'dev'], - ['1.2.3tag', 'major', '2.0.0', true, 'dev'], - ['1.2.3-tag', 'major', '2.0.0', false, 'dev'], - ['1.2.3', 'fake', null, false, 'dev'], - ['1.2.0-0', 'patch', '1.2.0', false, 'dev'], - ['fake', 'major', null, false, 'dev'], - ['1.2.3-4', 'major', '2.0.0', false, 'dev'], - ['1.2.3-4', 'minor', '1.3.0', false, 'dev'], - ['1.2.3-4', 'patch', '1.2.3', false, 'dev'], - ['1.2.3-alpha.0.beta', 'major', '2.0.0', false, 'dev'], - ['1.2.3-alpha.0.beta', 'minor', '1.3.0', false, 'dev'], - ['1.2.3-alpha.0.beta', 'patch', '1.2.3', false, 'dev'], - ['1.2.4', 'prerelease', '1.2.5-dev.0', false, 'dev'], - ['1.2.3-0', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.0', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1', false, 'alpha'], - ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta', false, 'alpha'], - ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta', false, 'alpha'], - ['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta', false, 'alpha'], - ['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta', false, 'alpha'], - ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1', false, 'alpha'], - ['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2', false, 'alpha'], - ['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3', false, 'alpha'], - ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta', false, 'alpha'], - ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta', false, 'alpha'], - ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta', false, 'alpha'], - ['1.2.0', 'prepatch', '1.2.1-dev.0', 'dev'], - ['1.2.0-1', 'prepatch', '1.2.1-dev.0', 'dev'], - ['1.2.0', 'preminor', '1.3.0-dev.0', 'dev'], - ['1.2.3-1', 'preminor', '1.3.0-dev.0', 'dev'], - ['1.2.0', 'premajor', '2.0.0-dev.0', 'dev'], - ['1.2.3-1', 'premajor', '2.0.0-dev.0', 'dev'], - ['1.2.0-1', 'minor', '1.2.0', 'dev'], - ['1.0.0-1', 'major', '1.0.0', 'dev'], - ['1.2.3-dev.bar', 'prerelease', '1.2.3-dev.0', false, 'dev'] - - ].forEach(function(v) { - var pre = v[0]; - var what = v[1]; - var wanted = v[2]; - var loose = v[3]; - var id = v[4]; - var found = inc(pre, what, loose, id); - var cmd = 'inc(' + pre + ', ' + what + ', ' + id + ')'; - t.equal(found, wanted, cmd + ' === ' + wanted); - }); - - t.end(); -}); - -test('\ndiff versions test', function(t) { -// [version1, version2, result] -// diff(version1, version2) -> result - [['1.2.3', '0.2.3', 'major'], - ['1.4.5', '0.2.3', 'major'], - ['1.2.3', '2.0.0-pre', 'premajor'], - ['1.2.3', '1.3.3', 'minor'], - ['1.0.1', '1.1.0-pre', 'preminor'], - ['1.2.3', '1.2.4', 'patch'], - ['1.2.3', '1.2.4-pre', 'prepatch'], - ['0.0.1', '0.0.1-pre', 'prerelease'], - ['0.0.1', '0.0.1-pre-2', 'prerelease'], - ['1.1.0', '1.1.0-pre', 'prerelease'], - ['1.1.0-pre-1', '1.1.0-pre-2', 'prerelease'], - ['1.0.0', '1.0.0', null] - - ].forEach(function(v) { - var version1 = v[0]; - var version2 = v[1]; - var wanted = v[2]; - var found = diff(version1, version2); - var cmd = 'diff(' + version1 + ', ' + version2 + ')'; - t.equal(found, wanted, cmd + ' === ' + wanted); - }); - - t.end(); -}); - -test('\nvalid range test', function(t) { - // [range, result] - // validRange(range) -> result - // translate ranges into their canonical form - [['1.0.0 - 2.0.0', '>=1.0.0 <=2.0.0'], - ['1.0.0', '1.0.0'], - ['>=*', '*'], - ['', '*'], - ['*', '*'], - ['*', '*'], - ['>=1.0.0', '>=1.0.0'], - ['>1.0.0', '>1.0.0'], - ['<=2.0.0', '<=2.0.0'], - ['1', '>=1.0.0 <2.0.0'], - ['<=2.0.0', '<=2.0.0'], - ['<=2.0.0', '<=2.0.0'], - ['<2.0.0', '<2.0.0'], - ['<2.0.0', '<2.0.0'], - ['>= 1.0.0', '>=1.0.0'], - ['>= 1.0.0', '>=1.0.0'], - ['>= 1.0.0', '>=1.0.0'], - ['> 1.0.0', '>1.0.0'], - ['> 1.0.0', '>1.0.0'], - ['<= 2.0.0', '<=2.0.0'], - ['<= 2.0.0', '<=2.0.0'], - ['<= 2.0.0', '<=2.0.0'], - ['< 2.0.0', '<2.0.0'], - ['< 2.0.0', '<2.0.0'], - ['>=0.1.97', '>=0.1.97'], - ['>=0.1.97', '>=0.1.97'], - ['0.1.20 || 1.2.4', '0.1.20||1.2.4'], - ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], - ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], - ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], - ['||', '||'], - ['2.x.x', '>=2.0.0 <3.0.0'], - ['1.2.x', '>=1.2.0 <1.3.0'], - ['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], - ['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], - ['x', '*'], - ['2.*.*', '>=2.0.0 <3.0.0'], - ['1.2.*', '>=1.2.0 <1.3.0'], - ['1.2.* || 2.*', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], - ['*', '*'], - ['2', '>=2.0.0 <3.0.0'], - ['2.3', '>=2.3.0 <2.4.0'], - ['~2.4', '>=2.4.0 <2.5.0'], - ['~2.4', '>=2.4.0 <2.5.0'], - ['~>3.2.1', '>=3.2.1 <3.3.0'], - ['~1', '>=1.0.0 <2.0.0'], - ['~>1', '>=1.0.0 <2.0.0'], - ['~> 1', '>=1.0.0 <2.0.0'], - ['~1.0', '>=1.0.0 <1.1.0'], - ['~ 1.0', '>=1.0.0 <1.1.0'], - ['^0', '>=0.0.0 <1.0.0'], - ['^ 1', '>=1.0.0 <2.0.0'], - ['^0.1', '>=0.1.0 <0.2.0'], - ['^1.0', '>=1.0.0 <2.0.0'], - ['^1.2', '>=1.2.0 <2.0.0'], - ['^0.0.1', '>=0.0.1 <0.0.2'], - ['^0.0.1-beta', '>=0.0.1-beta <0.0.2'], - ['^0.1.2', '>=0.1.2 <0.2.0'], - ['^1.2.3', '>=1.2.3 <2.0.0'], - ['^1.2.3-beta.4', '>=1.2.3-beta.4 <2.0.0'], - ['<1', '<1.0.0'], - ['< 1', '<1.0.0'], - ['>=1', '>=1.0.0'], - ['>= 1', '>=1.0.0'], - ['<1.2', '<1.2.0'], - ['< 1.2', '<1.2.0'], - ['1', '>=1.0.0 <2.0.0'], - ['>01.02.03', '>1.2.3', true], - ['>01.02.03', null], - ['~1.2.3beta', '>=1.2.3-beta <1.3.0', true], - ['~1.2.3beta', null], - ['^ 1.2 ^ 1', '>=1.2.0 <2.0.0 >=1.0.0 <2.0.0'] - ].forEach(function(v) { - var pre = v[0]; - var wanted = v[1]; - var loose = v[2]; - var found = validRange(pre, loose); - - t.equal(found, wanted, 'validRange(' + pre + ') === ' + wanted); - }); - - t.end(); -}); - -test('\ncomparators test', function(t) { - // [range, comparators] - // turn range into a set of individual comparators - [['1.0.0 - 2.0.0', [['>=1.0.0', '<=2.0.0']]], - ['1.0.0', [['1.0.0']]], - ['>=*', [['']]], - ['', [['']]], - ['*', [['']]], - ['*', [['']]], - ['>=1.0.0', [['>=1.0.0']]], - ['>=1.0.0', [['>=1.0.0']]], - ['>=1.0.0', [['>=1.0.0']]], - ['>1.0.0', [['>1.0.0']]], - ['>1.0.0', [['>1.0.0']]], - ['<=2.0.0', [['<=2.0.0']]], - ['1', [['>=1.0.0', '<2.0.0']]], - ['<=2.0.0', [['<=2.0.0']]], - ['<=2.0.0', [['<=2.0.0']]], - ['<2.0.0', [['<2.0.0']]], - ['<2.0.0', [['<2.0.0']]], - ['>= 1.0.0', [['>=1.0.0']]], - ['>= 1.0.0', [['>=1.0.0']]], - ['>= 1.0.0', [['>=1.0.0']]], - ['> 1.0.0', [['>1.0.0']]], - ['> 1.0.0', [['>1.0.0']]], - ['<= 2.0.0', [['<=2.0.0']]], - ['<= 2.0.0', [['<=2.0.0']]], - ['<= 2.0.0', [['<=2.0.0']]], - ['< 2.0.0', [['<2.0.0']]], - ['<\t2.0.0', [['<2.0.0']]], - ['>=0.1.97', [['>=0.1.97']]], - ['>=0.1.97', [['>=0.1.97']]], - ['0.1.20 || 1.2.4', [['0.1.20'], ['1.2.4']]], - ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], - ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], - ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], - ['||', [[''], ['']]], - ['2.x.x', [['>=2.0.0', '<3.0.0']]], - ['1.2.x', [['>=1.2.0', '<1.3.0']]], - ['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], - ['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], - ['x', [['']]], - ['2.*.*', [['>=2.0.0', '<3.0.0']]], - ['1.2.*', [['>=1.2.0', '<1.3.0']]], - ['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], - ['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], - ['*', [['']]], - ['2', [['>=2.0.0', '<3.0.0']]], - ['2.3', [['>=2.3.0', '<2.4.0']]], - ['~2.4', [['>=2.4.0', '<2.5.0']]], - ['~2.4', [['>=2.4.0', '<2.5.0']]], - ['~>3.2.1', [['>=3.2.1', '<3.3.0']]], - ['~1', [['>=1.0.0', '<2.0.0']]], - ['~>1', [['>=1.0.0', '<2.0.0']]], - ['~> 1', [['>=1.0.0', '<2.0.0']]], - ['~1.0', [['>=1.0.0', '<1.1.0']]], - ['~ 1.0', [['>=1.0.0', '<1.1.0']]], - ['~ 1.0.3', [['>=1.0.3', '<1.1.0']]], - ['~> 1.0.3', [['>=1.0.3', '<1.1.0']]], - ['<1', [['<1.0.0']]], - ['< 1', [['<1.0.0']]], - ['>=1', [['>=1.0.0']]], - ['>= 1', [['>=1.0.0']]], - ['<1.2', [['<1.2.0']]], - ['< 1.2', [['<1.2.0']]], - ['1', [['>=1.0.0', '<2.0.0']]], - ['1 2', [['>=1.0.0', '<2.0.0', '>=2.0.0', '<3.0.0']]], - ['1.2 - 3.4.5', [['>=1.2.0', '<=3.4.5']]], - ['1.2.3 - 3.4', [['>=1.2.3', '<3.5.0']]], - ['1.2.3 - 3', [['>=1.2.3', '<4.0.0']]], - ['>*', [['<0.0.0']]], - ['<*', [['<0.0.0']]] - ].forEach(function(v) { - var pre = v[0]; - var wanted = v[1]; - var found = toComparators(v[0]); - var jw = JSON.stringify(wanted); - t.equivalent(found, wanted, 'toComparators(' + pre + ') === ' + jw); - }); - - t.end(); -}); - -test('\ninvalid version numbers', function(t) { - ['1.2.3.4', - 'NOT VALID', - 1.2, - null, - 'Infinity.NaN.Infinity' - ].forEach(function(v) { - t.throws(function() { - new SemVer(v); - }, {name:'TypeError', message:'Invalid Version: ' + v}); - }); - - t.end(); -}); - -test('\nstrict vs loose version numbers', function(t) { - [['=1.2.3', '1.2.3'], - ['01.02.03', '1.2.3'], - ['1.2.3-beta.01', '1.2.3-beta.1'], - [' =1.2.3', '1.2.3'], - ['1.2.3foo', '1.2.3-foo'] - ].forEach(function(v) { - var loose = v[0]; - var strict = v[1]; - t.throws(function() { - new SemVer(loose); - }); - var lv = new SemVer(loose, true); - t.equal(lv.version, strict); - t.ok(eq(loose, strict, true)); - t.throws(function() { - eq(loose, strict); - }); - t.throws(function() { - new SemVer(strict).compare(loose); - }); - }); - t.end(); -}); - -test('\nstrict vs loose ranges', function(t) { - [['>=01.02.03', '>=1.2.3'], - ['~1.02.03beta', '>=1.2.3-beta <1.3.0'] - ].forEach(function(v) { - var loose = v[0]; - var comps = v[1]; - t.throws(function() { - new Range(loose); - }); - t.equal(new Range(loose, true).range, comps); - }); - t.end(); -}); - -test('\nmax satisfying', function(t) { - [[['1.2.3', '1.2.4'], '1.2', '1.2.4'], - [['1.2.4', '1.2.3'], '1.2', '1.2.4'], - [['1.2.3', '1.2.4', '1.2.5', '1.2.6'], '~1.2.3', '1.2.6'], - [['1.1.0', '1.2.0', '1.2.1', '1.3.0', '2.0.0b1', '2.0.0b2', '2.0.0b3', '2.0.0', '2.1.0'], '~2.0.0', '2.0.0', true] - ].forEach(function(v) { - var versions = v[0]; - var range = v[1]; - var expect = v[2]; - var loose = v[3]; - var actual = semver.maxSatisfying(versions, range, loose); - t.equal(actual, expect); - }); - t.end(); -}); diff --git a/node_modules/semver/test/ltr.js b/node_modules/semver/test/ltr.js deleted file mode 100644 index 0f7167d65..000000000 --- a/node_modules/semver/test/ltr.js +++ /dev/null @@ -1,181 +0,0 @@ -var tap = require('tap'); -var test = tap.test; -var semver = require('../semver.js'); -var ltr = semver.ltr; - -test('\nltr tests', function(t) { - // [range, version, loose] - // Version should be less than range - [ - ['~1.2.2', '1.2.1'], - ['~0.6.1-1', '0.6.1-0'], - ['1.0.0 - 2.0.0', '0.0.1'], - ['1.0.0-beta.2', '1.0.0-beta.1'], - ['1.0.0', '0.0.0'], - ['>=2.0.0', '1.1.1'], - ['>=2.0.0', '1.2.9'], - ['>2.0.0', '2.0.0'], - ['0.1.20 || 1.2.4', '0.1.5'], - ['2.x.x', '1.0.0'], - ['1.2.x', '1.1.0'], - ['1.2.x || 2.x', '1.0.0'], - ['2.*.*', '1.0.1'], - ['1.2.*', '1.1.3'], - ['1.2.* || 2.*', '1.1.9999'], - ['2', '1.0.0'], - ['2.3', '2.2.2'], - ['~2.4', '2.3.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.3.5'], - ['~>3.2.1', '3.2.0'], // >=3.2.1 <3.3.0 - ['~1', '0.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '0.2.4'], - ['~> 1', '0.2.3'], - ['~1.0', '0.1.2'], // >=1.0.0 <1.1.0 - ['~ 1.0', '0.1.0'], - ['>1.2', '1.2.0'], - ['> 1.2', '1.2.1'], - ['1', '0.0.0beta', true], - ['~v0.5.4-pre', '0.5.4-alpha'], - ['~v0.5.4-pre', '0.5.4-alpha'], - ['=0.7.x', '0.6.0'], - ['=0.7.x', '0.6.0-asdf'], - ['>=0.7.x', '0.6.0'], - ['~1.2.2', '1.2.1'], - ['1.0.0 - 2.0.0', '0.2.3'], - ['1.0.0', '0.0.1'], - ['>=2.0.0', '1.0.0'], - ['>=2.0.0', '1.9999.9999'], - ['>=2.0.0', '1.2.9'], - ['>2.0.0', '2.0.0'], - ['>2.0.0', '1.2.9'], - ['2.x.x', '1.1.3'], - ['1.2.x', '1.1.3'], - ['1.2.x || 2.x', '1.1.3'], - ['2.*.*', '1.1.3'], - ['1.2.*', '1.1.3'], - ['1.2.* || 2.*', '1.1.3'], - ['2', '1.9999.9999'], - ['2.3', '2.2.1'], - ['~2.4', '2.3.0'], // >=2.4.0 <2.5.0 - ['~>3.2.1', '2.3.2'], // >=3.2.1 <3.3.0 - ['~1', '0.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '0.2.3'], - ['~1.0', '0.0.0'], // >=1.0.0 <1.1.0 - ['>1', '1.0.0'], - ['2', '1.0.0beta', true], - ['>1', '1.0.0beta', true], - ['> 1', '1.0.0beta', true], - ['=0.7.x', '0.6.2'], - ['=0.7.x', '0.7.0-asdf'], - ['^1', '1.0.0-0'], - ['>=0.7.x', '0.7.0-asdf'], - ['1', '1.0.0beta', true], - ['>=0.7.x', '0.6.2'], - ['>1.2.3', '1.3.0-alpha'] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = 'ltr(' + version + ', ' + range + ', ' + loose + ')'; - t.ok(ltr(version, range, loose), msg); - }); - t.end(); -}); - -test('\nnegative ltr tests', function(t) { - // [range, version, loose] - // Version should NOT be less than range - [ - ['~ 1.0', '1.1.0'], - ['~0.6.1-1', '0.6.1-1'], - ['1.0.0 - 2.0.0', '1.2.3'], - ['1.0.0 - 2.0.0', '2.9.9'], - ['1.0.0', '1.0.0'], - ['>=*', '0.2.4'], - ['', '1.0.0', true], - ['*', '1.2.3'], - ['>=1.0.0', '1.0.0'], - ['>=1.0.0', '1.0.1'], - ['>=1.0.0', '1.1.0'], - ['>1.0.0', '1.0.1'], - ['>1.0.0', '1.1.0'], - ['<=2.0.0', '2.0.0'], - ['<=2.0.0', '1.9999.9999'], - ['<=2.0.0', '0.2.9'], - ['<2.0.0', '1.9999.9999'], - ['<2.0.0', '0.2.9'], - ['>= 1.0.0', '1.0.0'], - ['>= 1.0.0', '1.0.1'], - ['>= 1.0.0', '1.1.0'], - ['> 1.0.0', '1.0.1'], - ['> 1.0.0', '1.1.0'], - ['<= 2.0.0', '2.0.0'], - ['<= 2.0.0', '1.9999.9999'], - ['<= 2.0.0', '0.2.9'], - ['< 2.0.0', '1.9999.9999'], - ['<\t2.0.0', '0.2.9'], - ['>=0.1.97', 'v0.1.97'], - ['>=0.1.97', '0.1.97'], - ['0.1.20 || 1.2.4', '1.2.4'], - ['0.1.20 || >1.2.4', '1.2.4'], - ['0.1.20 || 1.2.4', '1.2.3'], - ['0.1.20 || 1.2.4', '0.1.20'], - ['>=0.2.3 || <0.0.1', '0.0.0'], - ['>=0.2.3 || <0.0.1', '0.2.3'], - ['>=0.2.3 || <0.0.1', '0.2.4'], - ['||', '1.3.4'], - ['2.x.x', '2.1.3'], - ['1.2.x', '1.2.3'], - ['1.2.x || 2.x', '2.1.3'], - ['1.2.x || 2.x', '1.2.3'], - ['x', '1.2.3'], - ['2.*.*', '2.1.3'], - ['1.2.*', '1.2.3'], - ['1.2.* || 2.*', '2.1.3'], - ['1.2.* || 2.*', '1.2.3'], - ['1.2.* || 2.*', '1.2.3'], - ['*', '1.2.3'], - ['2', '2.1.2'], - ['2.3', '2.3.1'], - ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.4.5'], - ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0 - ['~1', '1.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '1.2.3'], - ['~> 1', '1.2.3'], - ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0 - ['~ 1.0', '1.0.2'], - ['>=1', '1.0.0'], - ['>= 1', '1.0.0'], - ['<1.2', '1.1.1'], - ['< 1.2', '1.1.1'], - ['~v0.5.4-pre', '0.5.5'], - ['~v0.5.4-pre', '0.5.4'], - ['=0.7.x', '0.7.2'], - ['>=0.7.x', '0.7.2'], - ['<=0.7.x', '0.6.2'], - ['>0.2.3 >0.2.4 <=0.2.5', '0.2.5'], - ['>=0.2.3 <=0.2.4', '0.2.4'], - ['1.0.0 - 2.0.0', '2.0.0'], - ['^3.0.0', '4.0.0'], - ['^1.0.0 || ~2.0.1', '2.0.0'], - ['^0.1.0 || ~3.0.1 || 5.0.0', '3.2.0'], - ['^0.1.0 || ~3.0.1 || 5.0.0', '1.0.0beta', true], - ['^0.1.0 || ~3.0.1 || 5.0.0', '5.0.0-0', true], - ['^0.1.0 || ~3.0.1 || >4 <=5.0.0', '3.5.0'], - ['^1.0.0alpha', '1.0.0beta', true], - ['~1.0.0alpha', '1.0.0beta', true], - ['^1.0.0-alpha', '1.0.0beta', true], - ['~1.0.0-alpha', '1.0.0beta', true], - ['^1.0.0-alpha', '1.0.0-beta'], - ['~1.0.0-alpha', '1.0.0-beta'], - ['=0.1.0', '1.0.0'] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = '!ltr(' + version + ', ' + range + ', ' + loose + ')'; - t.notOk(ltr(version, range, loose), msg); - }); - t.end(); -}); diff --git a/node_modules/semver/test/major-minor-patch.js b/node_modules/semver/test/major-minor-patch.js deleted file mode 100644 index e9d4039c8..000000000 --- a/node_modules/semver/test/major-minor-patch.js +++ /dev/null @@ -1,72 +0,0 @@ -var tap = require('tap'); -var test = tap.test; -var semver = require('../semver.js'); - -test('\nmajor tests', function(t) { - // [range, version] - // Version should be detectable despite extra characters - [ - ['1.2.3', 1], - [' 1.2.3 ', 1], - [' 2.2.3-4 ', 2], - [' 3.2.3-pre ', 3], - ['v5.2.3', 5], - [' v8.2.3 ', 8], - ['\t13.2.3', 13], - ['=21.2.3', 21, true], - ['v=34.2.3', 34, true] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = 'major(' + range + ') = ' + version; - t.equal(semver.major(range, loose), version, msg); - }); - t.end(); -}); - -test('\nminor tests', function(t) { - // [range, version] - // Version should be detectable despite extra characters - [ - ['1.1.3', 1], - [' 1.1.3 ', 1], - [' 1.2.3-4 ', 2], - [' 1.3.3-pre ', 3], - ['v1.5.3', 5], - [' v1.8.3 ', 8], - ['\t1.13.3', 13], - ['=1.21.3', 21, true], - ['v=1.34.3', 34, true] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = 'minor(' + range + ') = ' + version; - t.equal(semver.minor(range, loose), version, msg); - }); - t.end(); -}); - -test('\npatch tests', function(t) { - // [range, version] - // Version should be detectable despite extra characters - [ - ['1.2.1', 1], - [' 1.2.1 ', 1], - [' 1.2.2-4 ', 2], - [' 1.2.3-pre ', 3], - ['v1.2.5', 5], - [' v1.2.8 ', 8], - ['\t1.2.13', 13], - ['=1.2.21', 21, true], - ['v=1.2.34', 34, true] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = 'patch(' + range + ') = ' + version; - t.equal(semver.patch(range, loose), version, msg); - }); - t.end(); -}); diff --git a/node_modules/semver/test/no-module.js b/node_modules/semver/test/no-module.js deleted file mode 100644 index 8b50873f1..000000000 --- a/node_modules/semver/test/no-module.js +++ /dev/null @@ -1,19 +0,0 @@ -var tap = require('tap'); -var test = tap.test; - -test('no module system', function(t) { - var fs = require('fs'); - var vm = require('vm'); - var head = fs.readFileSync(require.resolve('../head.js.txt'), 'utf8'); - var src = fs.readFileSync(require.resolve('../'), 'utf8'); - var foot = fs.readFileSync(require.resolve('../foot.js.txt'), 'utf8'); - vm.runInThisContext(head + src + foot, 'semver.js'); - - // just some basic poking to see if it did some stuff - t.type(global.semver, 'object'); - t.type(global.semver.SemVer, 'function'); - t.type(global.semver.Range, 'function'); - t.ok(global.semver.satisfies('1.2.3', '1.2')); - t.end(); -}); - diff --git a/node_modules/signal-exit/index.js b/node_modules/signal-exit/index.js index 7dd8d917d..337f691ed 100644 --- a/node_modules/signal-exit/index.js +++ b/node_modules/signal-exit/index.js @@ -19,6 +19,15 @@ if (process.__signal_exit_emitter__) { emitter.emitted = {} } +// Because this emitter is a global, we have to check to see if a +// previous version of this library failed to enable infinite listeners. +// I know what you're about to say. But literally everything about +// signal-exit is a compromise with evil. Get used to it. +if (!emitter.infinite) { + emitter.setMaxListeners(Infinity) + emitter.infinite = true +} + module.exports = function (cb, opts) { assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler') diff --git a/node_modules/signal-exit/package.json b/node_modules/signal-exit/package.json index 8429fac49..50364ccb6 100644 --- a/node_modules/signal-exit/package.json +++ b/node_modules/signal-exit/package.json @@ -1,6 +1,6 @@ { "name": "signal-exit", - "version": "3.0.1", + "version": "3.0.2", "description": "when you want to fire an event no matter how a process exits.", "main": "index.js", "scripts": { @@ -33,6 +33,6 @@ "nyc": "^8.1.0", "standard": "^7.1.2", "standard-version": "^2.3.0", - "tap": "^7.1.0" + "tap": "^8.0.1" } } diff --git a/node_modules/supports-color/index.js b/node_modules/supports-color/index.js index a2b978450..2571c735f 100644 --- a/node_modules/supports-color/index.js +++ b/node_modules/supports-color/index.js @@ -1,39 +1,84 @@ 'use strict'; -var argv = process.argv; +var hasFlag = require('has-flag'); -module.exports = (function () { - if (argv.indexOf('--no-color') !== -1 || - argv.indexOf('--no-colors') !== -1 || - argv.indexOf('--color=false') !== -1) { +var support = function (level) { + if (level === 0) { return false; } - if (argv.indexOf('--color') !== -1 || - argv.indexOf('--colors') !== -1 || - argv.indexOf('--color=true') !== -1 || - argv.indexOf('--color=always') !== -1) { - return true; + return { + level: level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; +}; + +var supportLevel = (function () { + if (hasFlag('no-color') || + hasFlag('no-colors') || + hasFlag('color=false')) { + return 0; + } + + if (hasFlag('color=16m') || + hasFlag('color=full') || + hasFlag('color=truecolor')) { + return 3; + } + + if (hasFlag('color=256')) { + return 2; + } + + if (hasFlag('color') || + hasFlag('colors') || + hasFlag('color=true') || + hasFlag('color=always')) { + return 1; } if (process.stdout && !process.stdout.isTTY) { - return false; + return 0; } if (process.platform === 'win32') { - return true; + return 1; } - if ('COLORTERM' in process.env) { - return true; + if ('CI' in process.env) { + if ('TRAVIS' in process.env || process.env.CI === 'Travis') { + return 1; + } + + return 0; } - if (process.env.TERM === 'dumb') { - return false; + if ('TEAMCITY_VERSION' in process.env) { + return process.env.TEAMCITY_VERSION.match(/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/) === null ? 0 : 1; + } + + if (/^(screen|xterm)-256(?:color)?/.test(process.env.TERM)) { + return 2; } if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { - return true; + return 1; } - return false; + if ('COLORTERM' in process.env) { + return 1; + } + + if (process.env.TERM === 'dumb') { + return 0; + } + + return 0; })(); + +if (supportLevel === 0 && 'FORCE_COLOR' in process.env) { + supportLevel = 1; +} + +module.exports = process && support(supportLevel); diff --git a/node_modules/supports-color/package.json b/node_modules/supports-color/package.json index 7f72e762a..0cc4b383d 100644 --- a/node_modules/supports-color/package.json +++ b/node_modules/supports-color/package.json @@ -1,30 +1,32 @@ { "name": "supports-color", - "version": "1.2.0", + "version": "3.2.3", "description": "Detect whether a terminal supports color", "license": "MIT", - "repository": "sindresorhus/supports-color", + "repository": "chalk/supports-color", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "bin": { - "supports-color": "cli.js" + "url": "sindresorhus.com" }, + "maintainers": [ + "Sindre Sorhus (sindresorhus.com)", + "Joshua Boy Nicolai Appelman (jbna.nl)", + "JD Ballard (github.com/qix-)" + ], + "browser": "browser.js", "engines": { - "node": ">=0.10.0" + "node": ">=0.8.0" }, "scripts": { - "test": "mocha" + "test": "xo && mocha", + "travis": "mocha" }, "files": [ "index.js", - "cli.js" + "browser.js" ], "keywords": [ - "cli", - "bin", "color", "colour", "colors", @@ -42,10 +44,23 @@ "support", "supports", "capability", - "detect" + "detect", + "truecolor", + "16m", + "million" ], + "dependencies": { + "has-flag": "^1.0.0" + }, "devDependencies": { "mocha": "*", - "require-uncached": "^1.0.2" + "require-uncached": "^1.0.2", + "xo": "*" + }, + "xo": { + "envs": [ + "node", + "mocha" + ] } } diff --git a/node_modules/supports-color/readme.md b/node_modules/supports-color/readme.md index 32d4f46e9..f7bae4c54 100644 --- a/node_modules/supports-color/readme.md +++ b/node_modules/supports-color/readme.md @@ -1,11 +1,11 @@ -# supports-color [![Build Status](https://travis-ci.org/sindresorhus/supports-color.svg?branch=master)](https://travis-ci.org/sindresorhus/supports-color) +# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color) > Detect whether a terminal supports color ## Install -```sh +``` $ npm install --save supports-color ``` @@ -18,25 +18,41 @@ var supportsColor = require('supports-color'); if (supportsColor) { console.log('Terminal supports color'); } + +if (supportsColor.has256) { + console.log('Terminal supports 256 colors'); +} + +if (supportsColor.has16m) { + console.log('Terminal supports 16 million colors (truecolor)'); +} ``` + +## API + +Returns an `object`, or `false` if color is not supported. + +The returned object specifies a level of support for color through a `.level` property and a corresponding flag: + +- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors) +- `.level = 2` and `.has256 = true`: 256 color support +- `.level = 3` and `.has16m = true`: 16 million (truecolor) support + + +## Info + It obeys the `--color` and `--no-color` CLI flags. +For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`. -## CLI +Explicit 256/truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. -```sh -$ npm install --global supports-color -``` -``` -$ supports-color --help +## Related - Usage - supports-color - - Exits with code 0 if color is supported and 1 if not -``` +- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right ## License diff --git a/node_modules/systemjs/README.md b/node_modules/systemjs/README.md index afe998a27..8eab2cc46 100644 --- a/node_modules/systemjs/README.md +++ b/node_modules/systemjs/README.md @@ -5,6 +5,8 @@ SystemJS [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/systemjs/systemjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Support](https://supporterhq.com/api/b/33df4abbec4d39260f49015d2457eafe/SystemJS)](https://supporterhq.com/support/33df4abbec4d39260f49015d2457eafe/SystemJS) +_SystemJS 0.20.0-alpha.1 is now available with performance improvements and Web Assembly support. [Try it out here](https://github.com/systemjs/systemjs/releases/tag/0.20.0-alpha.1)._ + Universal dynamic module loader - loads ES6 modules, AMD, CommonJS and global scripts in the browser and NodeJS. * [Loads any module format](docs/module-formats.md) with [exact circular reference and binding support](https://github.com/ModuleLoader/es6-module-loader/blob/v0.17.0/docs/circular-references-bindings.md). @@ -125,6 +127,7 @@ Additional Plugins: * [SASS](https://github.com/screendriver/plugin-sass) * [SCSS](https://github.com/kevcjones/plugin-scss) * [sofe](https://github.com/CanopyTax/sofe) +* [svelte](https://github.com/CanopyTax/system-svelte) * [SVG](https://github.com/vuzonp/systemjs-plugin-svg) * [WebFont](https://github.com/guybedford/plugin-font) * [WebWorkers](https://github.com/casperlamboo/plugin-worker) diff --git a/node_modules/systemjs/dist/system-csp-production.js b/node_modules/systemjs/dist/system-csp-production.js index 2fb9fdd75..8cbabeb0e 100644 --- a/node_modules/systemjs/dist/system-csp-production.js +++ b/node_modules/systemjs/dist/system-csp-production.js @@ -1,6 +1,6 @@ /* - * SystemJS v0.19.41 + * SystemJS v0.19.47 */ -!function(){function e(){!function(e){function t(e,n){if("string"!=typeof e)throw new TypeError("URL must be a string");var r=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);if(!r)throw new RangeError("Invalid URL format");var a=r[1]||"",o=r[2]||"",i=r[3]||"",s=r[4]||"",l=r[5]||"",u=r[6]||"",d=r[7]||"",c=r[8]||"",f=r[9]||"";if(void 0!==n){var m=n instanceof t?n:new t(n),p=!a&&!s&&!o;!p||d||c||(c=m.search),p&&"/"!==d[0]&&(d=d?(!m.host&&!m.username||m.pathname?"":"/")+m.pathname.slice(0,m.pathname.lastIndexOf("/")+1)+d:m.pathname);var h=[];d.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?h.pop():h.push(e)}),d=h.join("").replace(/^\//,"/"===d[0]?"/":""),p&&(u=m.port,l=m.hostname,s=m.host,i=m.password,o=m.username),a||(a=m.protocol)}d=d.replace(/\\/g,"/"),this.origin=s?a+(""!==a||""!==s?"//":"")+s:"",this.href=a+(a&&s||"file:"==a?"//":"")+(""!==o?o+(""!==i?":"+i:"")+"@":"")+s+d+c+f,this.protocol=a,this.username=o,this.password=i,this.host=s,this.hostname=l,this.port=u,this.pathname=d,this.search=c,this.hash=f}e.URLPolyfill=t}("undefined"!=typeof self?self:global),function(e){function t(e,t){if(!e.originalErr)for(var n=((e.message||e)+(e.stack?"\n"+e.stack:"")).toString().split("\n"),r=[],a=0;as.length?(o[s]&&"/"||"")+t.substr(s.length):"")}else{var d=s.split("*");if(d.length>2)throw new TypeError("Only one wildcard in a path is permitted");var f=d[0].length;f>=a&&t.substr(0,d[0].length)==d[0]&&t.substr(t.length-d[1].length)==d[1]&&(a=f,r=s,n=t.substr(d[0].length,t.length-d[1].length-d[0].length))}}var m=o[r];return"string"==typeof n&&(m=m.replace("*",n)),m}function m(e){for(var t=[],n=[],r=0,a=e.length;r",linkSets:[],dependencies:[],metadata:{}}}function a(e,t,n){return new Promise(u({step:n.address?"fetch":"locate",loader:e,moduleName:t,moduleMetadata:n&&n.metadata||{},moduleSource:n.source,moduleAddress:n.address}))}function o(t,n,r,a){return new Promise(function(e,o){e(t.loaderObj.normalize(n,r,a))}).then(function(n){var r;if(t.modules[n])return r=e(n),r.status="linked",r.module=t.modules[n],r;for(var a=0,o=t.loads.length;a0)){var n=e.startingLoad;if(e.loader.loaderObj.execute===!1){for(var r=[].concat(e.loads),a=0,o=r.length;a "'+r.paths[o]+'" uses wildcards which are being deprecated for just leaving a trailing "/" to indicate folder paths.')}if(e.defaultJSExtensions&&(r.defaultJSExtensions=e.defaultJSExtensions,w.call(r,"The defaultJSExtensions configuration option is deprecated, use packages configuration instead.")),e.pluginFirst&&(r.pluginFirst=e.pluginFirst),e.map)for(var o in e.map){var i=e.map[o];if("string"!=typeof i){var s=r.defaultJSExtensions&&".js"!=o.substr(o.length-3,3),l=r.decanonicalize(o);s&&".js"==l.substr(l.length-3,3)&&(l=l.substr(0,l.length-3));var u="";for(var c in r.packages)l.substr(0,c.length)==c&&(!l[c.length]||"/"==l[c.length])&&u.split("/").lengtha&&(n=o,a=r));return n}function t(e,t,n,r,a){if(!r||"/"==r[r.length-1]||a||t.defaultExtension===!1)return r;var o=!1;if(t.meta&&p(t.meta,r,function(e,t,n){if(0==n||e.lastIndexOf("*")!=e.length-1)return o=!0}),!o&&e.meta&&p(e.meta,n+"/"+r,function(e,t,n){if(0==n||e.lastIndexOf("*")!=e.length-1)return o=!0}),o)return r;var i="."+(t.defaultExtension||"js");return r.substr(r.length-i.length)!=i?r+i:r}function n(e,n,r,a,i){if(!a){if(!n.main)return r+(e.defaultJSExtensions?".js":"");a="./"==n.main.substr(0,2)?n.main.substr(2):n.main}if(n.map){var s="./"+a,l=S(n.map,s);if(l||(s="./"+t(e,n,r,a,i),s!="./"+a&&(l=S(n.map,s))),l){var u=o(e,n,r,l,s,i);if(u)return u}}return r+"/"+t(e,n,r,a,i)}function r(e,t,n,r){if("."==e)throw new Error("Package "+n+' has a map entry for "." which is not permitted.');return!(t.substr(0,e.length)==e&&r.length>e.length)}function o(e,n,a,o,i,s){"/"==i[i.length-1]&&(i=i.substr(0,i.length-1));var l=n.map[o];if("object"==typeof l)throw new Error("Synchronous conditional normalization not supported sync normalizing "+o+" in "+a);if(r(o,l,a,i)&&"string"==typeof l){if("."==l)l=a;else if("./"==l.substr(0,2))return a+"/"+t(e,n,a,l.substr(2)+i.substr(o.length),s);return e.normalizeSync(l+i.substr(o.length),a+"/")}}function l(e,n,r,a,o){if(!a){if(!n.main)return Promise.resolve(r+(e.defaultJSExtensions?".js":""));a="./"==n.main.substr(0,2)?n.main.substr(2):n.main}var i,s;return n.map&&(i="./"+a,s=S(n.map,i),s||(i="./"+t(e,n,r,a,o),i!="./"+a&&(s=S(n.map,i)))),(s?d(e,n,r,s,i,o):Promise.resolve()).then(function(i){return i?Promise.resolve(i):Promise.resolve(r+"/"+t(e,n,r,a,o))})}function u(e,n,r,a,o,i,s){if("."==o)o=r;else if("./"==o.substr(0,2))return Promise.resolve(r+"/"+t(e,n,r,o.substr(2)+i.substr(a.length),s)).then(function(t){return L.call(e,t,r+"/")});return e.normalize(o+i.substr(a.length),r+"/")}function d(e,t,n,a,o,i){"/"==o[o.length-1]&&(o=o.substr(0,o.length-1));var s=t.map[a];if("string"==typeof s)return r(a,s,n,o)?u(e,t,n,a,s,o,i):Promise.resolve();if(e.builder)return Promise.resolve(n+"/#:"+o);var l=[],d=[];for(var c in s){var f=z(c);d.push({condition:f,map:s[c]}),l.push(e.import(f.module,n))}return Promise.all(l).then(function(e){for(var t=0;tl&&(l=n),v(s,t,n&&l>n)}),v(n.metadata,s)}o.format&&!n.metadata.loader&&(n.metadata.format=n.metadata.format||o.format)}return t})}})}(),function(){function t(){if(s&&"interactive"===s.script.readyState)return s.load;for(var e=0;e=0;i--){for(var s=a[i],l=0;l1;)r=a.shift(),e=e[r]=e[r]||{};r=a.shift(),r in e||(e[r]=n)}s(function(e){return function(){this.meta={},e.call(this)}}),i("locate",function(e){return function(t){var n,r=this.meta,a=t.name,o=0;for(var i in r)if(n=i.indexOf("*"),n!==-1&&i.substr(0,n)===a.substr(0,n)&&i.substr(n+1)===a.substr(a.length-i.length+n+1)){var s=i.split("/").length;s>o&&(o=s),v(t.metadata,r[i],o!=s)}return r[a]&&v(t.metadata,r[a]),e.call(this,t)}});var t=/^(\s*\/\*[^\*]*(\*(?!\/)[^\*]*)*\*\/|\s*\/\/[^\n]*|\s*"[^"]+"\s*;?|\s*'[^']+'\s*;?)+/,n=/\/\*[^\*]*(\*(?!\/)[^\*]*)*\*\/|\/\/[^\n]*|"[^"]+"\s*;?|'[^']+'\s*;?/g;i("translate",function(r){return function(a){if("defined"==a.metadata.format)return a.metadata.deps=a.metadata.deps||[],Promise.resolve(a.source);var o=a.source.match(t);if(o)for(var i=o[0].match(n),s=0;s')}else e()}else if("undefined"!=typeof importScripts){var a="";try{throw new Error("_")}catch(e){e.stack.replace(/(?:at|@).*(http.+):[\d]+:[\d]+/,function(e,t){$__curScript={src:t},a=t.replace(/\/[^\/]*$/,"/")})}t&&importScripts(a+"system-polyfills.js"),e()}else $__curScript="undefined"!=typeof __filename?{src:__filename}:null,e()}(); +!function(){function e(){!function(e){function t(e,n){if("string"!=typeof e)throw new TypeError("URL must be a string");var r=String(e).replace(/^\s+|\s+$/g,"").replace(/\\/g,"/").match(/^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);if(!r)throw new RangeError("Invalid URL format");var a=r[1]||"",o=r[2]||"",i=r[3]||"",s=r[4]||"",l=r[5]||"",u=r[6]||"",d=r[7]||"",c=r[8]||"",f=r[9]||"";if(void 0!==n){var m=n instanceof t?n:new t(n),p=!a&&!s&&!o;!p||d||c||(c=m.search),p&&"/"!==d[0]&&(d=d?(!m.host&&!m.username||m.pathname?"":"/")+m.pathname.slice(0,m.pathname.lastIndexOf("/")+1)+d:m.pathname);var h=[];d.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?h.pop():h.push(e)}),d=h.join("").replace(/^\//,"/"===d[0]?"/":""),p&&(u=m.port,l=m.hostname,s=m.host,i=m.password,o=m.username),a||(a=m.protocol)}d=d.replace(/\\/g,"/"),this.origin=s?a+(""!==a||""!==s?"//":"")+s:"",this.href=a+(a&&s||"file:"==a?"//":"")+(""!==o?o+(""!==i?":"+i:"")+"@":"")+s+d+c+f,this.protocol=a,this.username=o,this.password=i,this.host=s,this.hostname=l,this.port=u,this.pathname=d,this.search=c,this.hash=f}e.URLPolyfill=t}("undefined"!=typeof self?self:global),function(e){function t(e,t){if(!e.originalErr)for(var n=((e.message||e)+(e.stack?"\n"+e.stack:"")).toString().split("\n"),r=[],a=0;as.length?(o[s]&&"/"||"")+t.substr(s.length):"")}else{var d=s.split("*");if(d.length>2)throw new TypeError("Only one wildcard in a path is permitted");var f=d[0].length;f>=a&&t.substr(0,d[0].length)==d[0]&&t.substr(t.length-d[1].length)==d[1]&&(a=f,r=s,n=t.substr(d[0].length,t.length-d[1].length-d[0].length))}}var m=o[r];return"string"==typeof n&&(m=m.replace("*",n)),m}function m(e){for(var t=[],n=[],r=0,a=e.length;a>r;r++){var o=$.call(t,e[r]);-1===o?(t.push(e[r]),n.push([r])):n[o].push(r)}return{names:t,indices:n}}function p(t){var n={};if(("object"==typeof t||"function"==typeof t)&&t!==e)if(Q)for(var r in t)"default"!==r&&h(n,t,r);else g(n,t);return n["default"]=t,J(n,"__useDefault",{value:!0}),n}function h(e,t,n){try{var r;(r=Object.getOwnPropertyDescriptor(t,n))&&J(e,n,r)}catch(a){return e[n]=t[n],!1}}function g(e,t,n){var r=t&&t.hasOwnProperty;for(var a in t)(!r||t.hasOwnProperty(a))&&(n&&a in e||(e[a]=t[a]));return e}function v(e,t,n){var r=t&&t.hasOwnProperty;for(var a in t)if(!r||t.hasOwnProperty(a)){var o=t[a];a in e?o instanceof Array&&e[a]instanceof Array?e[a]=[].concat(n?o:e[a]).concat(n?e[a]:o):"object"==typeof o&&null!==o&&"object"==typeof e[a]?e[a]=g(g({},e[a]),o,n):n||(e[a]=o):e[a]=o}}function y(e,t,n,r,a){for(var o in t)if(-1!=$.call(["main","format","defaultExtension","basePath"],o))e[o]=t[o];else if("map"==o)g(e.map=e.map||{},t.map);else if("meta"==o)g(e.meta=e.meta||{},t.meta);else if("depCache"==o)for(var i in t.depCache){var s;s="./"==i.substr(0,2)?n+"/"+i.substr(2):k.call(r,i),r.depCache[s]=(r.depCache[s]||[]).concat(t.depCache[i])}else!a||-1!=$.call(["browserConfig","nodeConfig","devConfig","productionConfig"],o)||t.hasOwnProperty&&!t.hasOwnProperty(o)||w.call(r,'"'+o+'" is not a valid package configuration option in package '+n)}function b(e,t,n,r){var a;if(e.packages[t]){var o=e.packages[t];a=e.packages[t]={},y(a,r?n:o,t,e,r),y(a,r?o:n,t,e,!r)}else a=e.packages[t]=n;return"object"==typeof a.main&&(a.map=a.map||{},a.map["./@main"]=a.main,a.main["default"]=a.main["default"]||"./",a.main="@main"),a}function w(e){this.warnings&&"undefined"!=typeof console&&console.warn&&console.warn(e)}function x(e,t){e.metadata.entry=R(),e.metadata.entry.execute=function(){return t},e.metadata.entry.deps=[],e.metadata.format="defined"}function S(e,t){for(var n=e.split(".");n.length;)t=t[n.shift()];return t}function E(e,t){var n,r=0;for(var a in e)if(t.substr(0,a.length)==a&&(t.length==a.length||"/"==t[a.length])){var o=a.split("/").length;if(r>=o)continue;n=a,r=o}return n}function _(e){this._loader.baseURL!==this.baseURL&&("/"!=this.baseURL[this.baseURL.length-1]&&(this.baseURL+="/"),this._loader.baseURL=this.baseURL=new G(this.baseURL,K).href)}function P(e,t){this.set("@system-env",te=this.newModule({browser:U,node:!!this._nodeRequire,production:!t&&e,dev:t||!e,build:t,"default":!0}))}function j(e,t){if(!d(e))throw new Error("Node module "+e+" can't be loaded as it is not a package require.");if(!ne){var n=this._nodeRequire("module"),r=t.substr(A?8:7);ne=new n(r),ne.paths=n._nodeModulePaths(r)}return ne.require(e)}function k(e,t){if(u(e))return c(e,t);if(l(e))return e;var n=E(this.map,e);if(n){if(e=this.map[n]+e.substr(n.length),u(e))return c(e);if(l(e))return e}if(this.has(e))return e;if("@node/"==e.substr(0,6)){if(!this._nodeRequire)throw new TypeError("Error loading "+e+". Can only load node core modules in Node.");return this.builder?this.set(e,this.newModule({})):this.set(e,this.newModule(p(j.call(this,e.substr(6),this.baseURL)))),e}return _.call(this),f(this,e)||this.baseURL+e}function O(e,t,n){te.browser&&t.browserConfig&&n(t.browserConfig),te.node&&t.nodeConfig&&n(t.nodeConfig),te.dev&&t.devConfig&&n(t.devConfig),te.build&&t.buildConfig&&n(t.buildConfig),te.production&&t.productionConfig&&n(t.productionConfig)}function M(e){var t=e.match(oe);return t&&"System.register"==e.substr(t[0].length,15)}function R(){return{name:null,deps:null,originalIndices:null,declare:null,execute:null,executingRequire:!1,declarative:!1,normalizedDeps:null,groupIndex:null,evaluated:!1,module:null,esModule:null,esmExports:!1}}function z(t){if("string"==typeof t)return S(t,e);if(!(t instanceof Array))throw new Error("Global exports must be a string or array.");for(var n={},r=!0,a=0;at;t++)if(this[t]===e)return t;return-1};!function(){try{Object.defineProperty({},"a",{})&&(J=Object.defineProperty)}catch(e){J=function(e,t,n){try{e[t]=n.value||n.get.call(e)}catch(r){}}}}();var N,F="_"==new Error(0,"_").fileName;if("undefined"!=typeof document&&document.getElementsByTagName){if(N=document.baseURI,!N){var B=document.getElementsByTagName("base");N=B[0]&&B[0].href||window.location.href}}else"undefined"!=typeof location&&(N=e.location.href);if(N)N=N.split("#")[0].split("?")[0],N=N.substr(0,N.lastIndexOf("/")+1);else{if("undefined"==typeof process||!process.cwd)throw new TypeError("No environment baseURI");N="file://"+(A?"/":"")+process.cwd()+"/",A&&(N=N.replace(/\\/g,"/"))}try{var H="test:"==new e.URL("test:///").protocol}catch(X){}var G=H?e.URL:e.URLPolyfill;J(n.prototype,"toString",{value:function(){return"Module"}}),function(){function e(e){return{status:"loading",name:e||"",linkSets:[],dependencies:[],metadata:{}}}function a(e,t,n){return new Promise(u({step:n.address?"fetch":"locate",loader:e,moduleName:t,moduleMetadata:n&&n.metadata||{},moduleSource:n.source,moduleAddress:n.address}))}function o(t,n,r,a){return new Promise(function(e,o){e(t.loaderObj.normalize(n,r,a))}).then(function(n){var r;if(t.modules[n])return r=e(n),r.status="linked",r.module=t.modules[n],r;for(var a=0,o=t.loads.length;o>a;a++)if(r=t.loads[a],r.name==n)return r;return r=e(n),t.loads.push(r),i(t,r),r})}function i(e,t){s(e,t,Promise.resolve().then(function(){return e.loaderObj.locate({name:t.name,metadata:t.metadata})}))}function s(e,t,n){l(e,t,n.then(function(n){return"loading"==t.status?(t.address=n,e.loaderObj.fetch({name:t.name,metadata:t.metadata,address:n})):void 0}))}function l(e,t,n){n.then(function(n){return"loading"==t.status?(t.address=t.address||t.name,Promise.resolve(e.loaderObj.translate({name:t.name,metadata:t.metadata,address:t.address,source:n})).then(function(n){return t.source=n,e.loaderObj.instantiate({name:t.name,metadata:t.metadata,address:t.address,source:n})}).then(function(e){if(void 0===e)throw new TypeError("Declarative modules unsupported in the polyfill.");if("object"!=typeof e)throw new TypeError("Invalid instantiate return value");t.depsList=e.deps||[],t.execute=e.execute}).then(function(){t.dependencies=[];for(var n=t.depsList,r=[],a=0,i=n.length;i>a;a++)(function(n,a){r.push(o(e,n,t.name,t.address).then(function(e){if(t.dependencies[a]={key:n,value:e.name},"linked"!=e.status)for(var r=t.linkSets.concat([]),o=0,i=r.length;i>o;o++)c(r[o],e)}))})(n[a],a);return Promise.all(r)}).then(function(){t.status="loaded";for(var e=t.linkSets.concat([]),n=0,r=e.length;r>n;n++)m(e[n],t)})):void 0})["catch"](function(e){t.status="failed",t.exception=e;for(var n=t.linkSets.concat([]),r=0,a=n.length;a>r;r++)p(n[r],t,e)})}function u(t){return function(n,r){var a=t.loader,o=t.moduleName,u=t.step;if(a.modules[o])throw new TypeError('"'+o+'" already exists in the module table');for(var c,f=0,m=a.loads.length;m>f;f++)if(a.loads[f].name==o&&(c=a.loads[f],"translate"!=u||c.source||(c.address=t.moduleAddress,l(a,c,Promise.resolve(t.moduleSource))),c.linkSets.length&&c.linkSets[0].loads[0].name==c.name))return c.linkSets[0].done.then(function(){n(c)});var p=c||e(o);p.metadata=t.moduleMetadata;var h=d(a,p);a.loads.push(p),n(h.done),"locate"==u?i(a,p):"fetch"==u?s(a,p,Promise.resolve(t.moduleAddress)):(p.address=t.moduleAddress,l(a,p,Promise.resolve(t.moduleSource)))}}function d(e,t){var n={loader:e,loads:[],startingLoad:t,loadingCount:0};return n.done=new Promise(function(e,t){n.resolve=e,n.reject=t}),c(n,t),n}function c(e,t){if("failed"!=t.status){for(var n=0,r=e.loads.length;r>n;n++)if(e.loads[n]==t)return;e.loads.push(t),t.linkSets.push(e),"loaded"!=t.status&&e.loadingCount++;for(var a=e.loader,n=0,r=t.dependencies.length;r>n;n++)if(t.dependencies[n]){var o=t.dependencies[n].value;if(!a.modules[o])for(var i=0,s=a.loads.length;s>i;i++)if(a.loads[i].name==o){c(e,a.loads[i]);break}}}}function f(e){var t=!1;try{y(e,function(n,r){p(e,n,r),t=!0})}catch(n){p(e,null,n),t=!0}return t}function m(e,t){if(e.loadingCount--,!(e.loadingCount>0)){var n=e.startingLoad;if(e.loader.loaderObj.execute===!1){for(var r=[].concat(e.loads),a=0,o=r.length;o>a;a++){var t=r[a];t.module={name:t.name,module:w({}),evaluated:!0},t.status="linked",h(e.loader,t)}return e.resolve(n)}var i=f(e);i||e.resolve(n)}}function p(e,n,r){var a=e.loader;e:if(n)if(e.loads[0].name==n.name)r=t(r,"Error loading "+n.name);else{for(var o=0;oo;o++){var n=u[o];a.loaderObj.failed=a.loaderObj.failed||[],-1==$.call(a.loaderObj.failed,n)&&a.loaderObj.failed.push(n);var c=$.call(n.linkSets,e);if(n.linkSets.splice(c,1),0==n.linkSets.length){var f=$.call(e.loader.loads,n);-1!=f&&e.loader.loads.splice(f,1)}}e.reject(r)}function h(e,t){if(e.loaderObj.trace){e.loaderObj.loads||(e.loaderObj.loads={});var n={};t.dependencies.forEach(function(e){n[e.key]=e.value}),e.loaderObj.loads[t.name]={name:t.name,deps:t.dependencies.map(function(e){return e.key}),depMap:n,address:t.address,metadata:t.metadata,source:t.source}}t.name&&(e.modules[t.name]=t.module);var r=$.call(e.loads,t);-1!=r&&e.loads.splice(r,1);for(var a=0,o=t.linkSets.length;o>a;a++)r=$.call(t.linkSets[a].loads,t),-1!=r&&t.linkSets[a].loads.splice(r,1);t.linkSets.splice(0,t.linkSets.length)}function g(e,t,r){try{var a=t.execute()}catch(o){return void r(t,o)}return a&&a instanceof n?a:void r(t,new TypeError("Execution must define a Module instance"))}function v(e,t,n){var r=e._loader.importPromises;return r[t]=n.then(function(e){return r[t]=void 0,e},function(e){throw r[t]=void 0,e})}function y(e,t){var n=e.loader;if(e.loads.length)for(var r=e.loads.concat([]),a=0;a "'+r.paths[o]+'" uses wildcards which are being deprecated for just leaving a trailing "/" to indicate folder paths.')}if(e.defaultJSExtensions&&(r.defaultJSExtensions=e.defaultJSExtensions,w.call(r,"The defaultJSExtensions configuration option is deprecated, use packages configuration instead.")),e.pluginFirst&&(r.pluginFirst=e.pluginFirst),e.map)for(var o in e.map){var i=e.map[o];if("string"!=typeof i){var s=r.defaultJSExtensions&&".js"!=o.substr(o.length-3,3),l=r.decanonicalize(o);s&&".js"==l.substr(l.length-3,3)&&(l=l.substr(0,l.length-3));var u="";for(var c in r.packages)l.substr(0,c.length)==c&&(!l[c.length]||"/"==l[c.length])&&u.split("/").lengtha&&(n=o,a=r));return n}function t(e,t,n,r,a){if(!r||"/"==r[r.length-1]||a||t.defaultExtension===!1)return r;var o=!1;if(t.meta&&p(t.meta,r,function(e,t,n){return 0==n||e.lastIndexOf("*")!=e.length-1?o=!0:void 0}),!o&&e.meta&&p(e.meta,n+"/"+r,function(e,t,n){return 0==n||e.lastIndexOf("*")!=e.length-1?o=!0:void 0}),o)return r;var i="."+(t.defaultExtension||"js");return r.substr(r.length-i.length)!=i?r+i:r}function n(e,n,r,a,i){if(!a){if(!n.main)return r+(e.defaultJSExtensions?".js":"");a="./"==n.main.substr(0,2)?n.main.substr(2):n.main}if(n.map){var s="./"+a,l=E(n.map,s);if(l||(s="./"+t(e,n,r,a,i),s!="./"+a&&(l=E(n.map,s))),l){var u=o(e,n,r,l,s,i);if(u)return u}}return r+"/"+t(e,n,r,a,i)}function r(e,t,n,r){if("."==e)throw new Error("Package "+n+' has a map entry for "." which is not permitted.');return t.substr(0,e.length)==e&&r.length>e.length?!1:!0}function o(e,n,a,o,i,s){"/"==i[i.length-1]&&(i=i.substr(0,i.length-1));var l=n.map[o];if("object"==typeof l)throw new Error("Synchronous conditional normalization not supported sync normalizing "+o+" in "+a);if(r(o,l,a,i)&&"string"==typeof l){if("."==l)l=a;else if("./"==l.substr(0,2))return a+"/"+t(e,n,a,l.substr(2)+i.substr(o.length),s);return e.normalizeSync(l+i.substr(o.length),a+"/")}}function l(e,n,r,a,o){if(!a){if(!n.main)return Promise.resolve(r+(e.defaultJSExtensions?".js":""));a="./"==n.main.substr(0,2)?n.main.substr(2):n.main}var i,s;return n.map&&(i="./"+a,s=E(n.map,i),s||(i="./"+t(e,n,r,a,o),i!="./"+a&&(s=E(n.map,i)))),(s?d(e,n,r,s,i,o):Promise.resolve()).then(function(i){return i?Promise.resolve(i):Promise.resolve(r+"/"+t(e,n,r,a,o))})}function u(e,n,r,a,o,i,s){if("."==o)o=r;else if("./"==o.substr(0,2))return Promise.resolve(r+"/"+t(e,n,r,o.substr(2)+i.substr(a.length),s)).then(function(t){return T.call(e,t,r+"/")});return e.normalize(o+i.substr(a.length),r+"/")}function d(e,t,n,a,o,i){"/"==o[o.length-1]&&(o=o.substr(0,o.length-1));var s=t.map[a];if("string"==typeof s)return r(a,s,n,o)?u(e,t,n,a,s,o,i):Promise.resolve();if(e.builder)return Promise.resolve(n+"/#:"+o);var l=[],d=[];for(var c in s){var f=I(c);d.push({condition:f,map:s[c]}),l.push(e["import"](f.module,n))}return Promise.all(l).then(function(e){for(var t=0;tl&&(l=n),v(s,t,n&&l>n)}),v(n.metadata,s)}o.format&&!n.metadata.loader&&(n.metadata.format=n.metadata.format||o.format)}return t})}})}(),function(){function t(){if(s&&"interactive"===s.script.readyState)return s.load;for(var e=0;ea;a++){var i=e.normalizedDeps[a],s=n.defined[i];if(s&&!s.evaluated){var l=e.groupIndex+(s.declarative!=e.declarative);if(null===s.groupIndex||s.groupIndex=0;i--){for(var s=a[i],l=0;lr;r++){var s=a.importers[r];if(!s.locked){var l=$.call(s.dependencies,a),u=s.setters[l];u&&u(o)}}return a.locked=!1,t},{id:t.name});if("function"==typeof i&&(i={setters:[],execute:i}),i=i||{setters:[],execute:function(){}},a.setters=i.setters,a.execute=i.execute,!a.setters||!a.execute)throw new TypeError("Invalid System.register form for "+t.name);for(var s=0,d=t.normalizedDeps.length;d>s;s++){var c,f=t.normalizedDeps[s],m=n.defined[f],p=r[f];p?c=p.exports:m&&!m.declarative?c=m.esModule:m?(u(m,n),p=m.module,c=p.exports):c=n.get(f),p&&p.importers?(p.importers.push(a),a.dependencies.push(p)):a.dependencies.push(null);for(var h=t.originalIndices[s],g=0,v=h.length;v>g;++g){var y=h[g];a.setters[y]&&a.setters[y](c)}}}}function d(e,t){var n,r=t.defined[e];if(r)r.declarative?f(e,r,[],t):r.evaluated||c(r,t),n=r.module.exports;else if(n=t.get(e),!n)throw new Error("Unable to load dependency "+e+".");return(!r||r.declarative)&&n&&n.__useDefault?n["default"]:n}function c(t,r){if(!t.module){var a={},o=t.module={exports:a,id:t.name};if(!t.executingRequire)for(var i=0,s=t.normalizedDeps.length;s>i;i++){var l=t.normalizedDeps[i],u=r.defined[l];u&&c(u,r)}t.evaluated=!0;var f=t.execute.call(e,function(e){for(var n=0,a=t.deps.length;a>n;n++)if(t.deps[n]==e)return d(t.normalizedDeps[n],r);var o=r.normalizeSync(e,t.name);if(-1!=$.call(t.normalizedDeps,o))return d(o,r);throw new Error("Module "+e+" not declared as a dependency of "+t.name)},a,o);void 0!==f&&(o.exports=f),a=o.exports,a&&(a.__esModule||a instanceof n)?t.esModule=r.newModule(a):t.esmExports&&a!==e?t.esModule=r.newModule(p(a)):t.esModule=r.newModule({"default":a,__useDefault:!0})}}function f(t,n,r,a){if(n&&!n.evaluated&&n.declarative){r.push(t);for(var o=0,i=n.normalizedDeps.length;i>o;o++){var s=n.normalizedDeps[o];-1==$.call(r,s)&&(a.defined[s]?f(s,a.defined[s],r,a):a.get(s))}n.evaluated||(n.evaluated=!0,n.module.execute.call(e))}}a.prototype.register=function(e,t,n){if("string"!=typeof e&&(n=t,t=e,e=null),"boolean"==typeof n)return this.registerDynamic.apply(this,arguments);var r=R();r.name=e&&(this.decanonicalize||this.normalize).call(this,e),r.declarative=!0,r.deps=t,r.declare=n,this.pushRegister_({amd:!1,entry:r})},a.prototype.registerDynamic=function(e,t,n,r){"string"!=typeof e&&(r=n,n=t,t=e,e=null);var a=R();a.name=e&&(this.decanonicalize||this.normalize).call(this,e),a.deps=t,a.execute=r,a.executingRequire=n,this.pushRegister_({amd:!1,entry:a})},i("reduceRegister_",function(){return function(e,t){if(t){var n=t.entry,r=e&&e.metadata;if(n.name&&(n.name in this.defined||(this.defined[n.name]=n),r&&(r.bundle=!0)),!n.name||e&&!r.entry&&n.name==e.name){if(!r)throw new TypeError("Invalid System.register call. Anonymous System.register calls can only be made by modules loaded by SystemJS.import and not via script tags.");if(r.entry)throw"register"==r.format?new Error("Multiple anonymous System.register calls in module "+e.name+". If loading a bundle, ensure all the System.register calls are named."):new Error("Module "+e.name+" interpreted as "+r.format+" module format, but called System.register.");r.format||(r.format="register"),r.entry=n}}}}),s(function(e){return function(){e.call(this),this.defined={},this._loader.moduleRecords={}}}),J(o,"toString",{value:function(){return"Module"}}),i("delete",function(e){return function(t){return delete this._loader.moduleRecords[t],delete this.defined[t],e.call(this,t)}}),i("fetch",function(e){return function(t){return this.defined[t.name]?(t.metadata.format="defined",""):(t.metadata.deps=t.metadata.deps||[],e.call(this,t))}}),i("translate",function(e){return function(t){return t.metadata.deps=t.metadata.deps||[],Promise.resolve(e.apply(this,arguments)).then(function(e){return("register"==t.metadata.format||"system"==t.metadata.format||!t.metadata.format&&M(t.source))&&(t.metadata.format="register"),e})}}),i("load",function(e){return function(t){var n=this,a=n.defined[t];return!a||a.deps.length?e.apply(this,arguments):(a.originalIndices=a.normalizedDeps=[],r(t,a,n),f(t,a,[],n),a.esModule||(a.esModule=n.newModule(a.module.exports)),n.trace||(n.defined[t]=void 0),n.set(t,a.esModule),Promise.resolve())}}),i("instantiate",function(e){return function(t){"detect"==t.metadata.format&&(t.metadata.format=void 0),e.call(this,t);var n,a=this;if(a.defined[t.name])n=a.defined[t.name],n.declarative||(n.deps=n.deps.concat(t.metadata.deps)),n.deps=n.deps.concat(t.metadata.deps);else if(t.metadata.entry)n=t.metadata.entry,n.deps=n.deps.concat(t.metadata.deps);else if(!(a.builder&&t.metadata.bundle||"register"!=t.metadata.format&&"esm"!=t.metadata.format&&"es6"!=t.metadata.format)){if("undefined"!=typeof __exec&&__exec.call(a,t),!t.metadata.entry&&!t.metadata.bundle)throw new Error(t.name+" detected as "+t.metadata.format+" but didn't execute.");n=t.metadata.entry,n&&t.metadata.deps&&(n.deps=n.deps.concat(t.metadata.deps))}n||(n=R(),n.deps=t.metadata.deps,n.execute=function(){}),a.defined[t.name]=n;var o=m(n.deps);n.deps=o.names,n.originalIndices=o.indices,n.name=t.name,n.esmExports=t.metadata.esmExports!==!1;for(var i=[],s=0,l=n.deps.length;l>s;s++)i.push(Promise.resolve(a.normalize(n.deps[s],t.name)));return Promise.all(i).then(function(e){return n.normalizedDeps=e,{deps:n.deps,execute:function(){return r(t.name,n,a),f(t.name,n,[],a),n.esModule||(n.esModule=a.newModule(n.module.exports)),a.trace||(a.defined[t.name]=void 0),n.esModule}}})}})}(),i("reduceRegister_",function(e){return function(t,n){if(n||!t.metadata.exports&&(!q||"global"!=t.metadata.format))return e.call(this,t,n);t.metadata.format="global";var r=t.metadata.entry=R();r.deps=t.metadata.deps;var a=z(t.metadata.exports);r.execute=function(){return a}}}),s(function(t){return function(){function n(t){if(Object.keys)Object.keys(e).forEach(t);else for(var n in e)i.call(e,n)&&t(n)}function r(t){n(function(n){if(-1==$.call(s,n)){try{var r=e[n]}catch(a){s.push(n)}t(n,r)}})}var a=this;t.call(a);var o,i=Object.prototype.hasOwnProperty,s=["_g","sessionStorage","localStorage","clipboardData","frames","frameElement","external","mozAnimationStartTime","webkitStorageInfo","webkitIndexedDB","mozInnerScreenY","mozInnerScreenX"];a.set("@@global-helpers",a.newModule({prepareGlobal:function(t,n,a,i){var s=e.define;e.define=void 0;var l;if(a){l={};for(var u in a)l[u]=e[u],e[u]=a[u]}return n||(o={},r(function(e,t){o[e]=t})),function(){var t,a=n?z(n):{},u=!!n;if((!n||i)&&r(function(r,s){o[r]!==s&&"undefined"!=typeof s&&(i&&(e[r]=void 0),n||(a[r]=s,"undefined"!=typeof t?u||t===s||(u=!0):t=s))}),a=u?a:t,l)for(var d in l)e[d]=l[d];return e.define=s,a}}}))}}),s(function(e){return function(){function t(e){return"file:///"==e.substr(0,8)?e.substr(7+!!A):r&&e.substr(0,r.length)==r?e.substr(r.length):e}var n=this;if(e.call(n),"undefined"!=typeof window&&"undefined"!=typeof document&&window.location)var r=location.protocol+"//"+location.hostname+(location.port?":"+location.port:"");n.set("@@cjs-helpers",n.newModule({requireResolve:function(e,r){return t(n.normalizeSync(e,r))},getPathVars:function(e){var n,r=e.lastIndexOf("!");n=-1!=r?e.substr(0,r):e;var a=n.split("/");return a.pop(),a=a.join("/"),{filename:t(n),dirname:t(a)}}}))}}),i("fetch",function(t){return function(n){return n.metadata.scriptLoad&&U&&(e.define=this.amdDefine),t.call(this,n)}}),s(function(t){return function(){function n(e,t){e=e.replace(s,"");var n=e.match(d),r=(n[1].split(",")[t]||"require").replace(c,""),a=f[r]||(f[r]=new RegExp(l+r+u,"g"));a.lastIndex=0;for(var o,i=[];o=a.exec(e);)i.push(o[2]||o[3]);return i}function r(e,t,n,a){if("object"==typeof e&&!(e instanceof Array))return r.apply(null,Array.prototype.splice.call(arguments,1,arguments.length-1));if("string"==typeof e&&"function"==typeof t&&(e=[e]),!(e instanceof Array)){if("string"==typeof e){var i=o.defaultJSExtensions&&".js"!=e.substr(e.length-3,3),s=o.decanonicalize(e,a);i&&".js"==s.substr(s.length-3,3)&&(s=s.substr(0,s.length-3));var l=o.get(s);if(!l)throw new Error('Module not already loaded loading "'+e+'" as '+s+(a?' from "'+a+'".':"."));return l.__useDefault?l["default"]:l}throw new TypeError("Invalid require")}for(var u=[],d=0;d1;)r=a.shift(),e=e[r]=e[r]||{};r=a.shift(),r in e||(e[r]=n)}s(function(e){return function(){this.meta={},e.call(this)}}),i("locate",function(e){return function(t){var n,r=this.meta,a=t.name,o=0;for(var i in r)if(n=i.indexOf("*"),-1!==n&&i.substr(0,n)===a.substr(0,n)&&i.substr(n+1)===a.substr(a.length-i.length+n+1)){var s=i.split("/").length;s>o&&(o=s),v(t.metadata,r[i],o!=s)}return r[a]&&v(t.metadata,r[a]),e.call(this,t)}});var t=/^(\s*\/\*[^\*]*(\*(?!\/)[^\*]*)*\*\/|\s*\/\/[^\n]*|\s*"[^"]+"\s*;?|\s*'[^']+'\s*;?)+/,n=/\/\*[^\*]*(\*(?!\/)[^\*]*)*\*\/|\/\/[^\n]*|"[^"]+"\s*;?|'[^']+'\s*;?/g;i("translate",function(r){return function(a){if("defined"==a.metadata.format)return a.metadata.deps=a.metadata.deps||[],Promise.resolve(a.source);var o=a.source.match(t);if(o)for(var i=o[0].match(n),s=0;s')}else e()}else if("undefined"!=typeof importScripts){var a="";try{throw new Error("_")}catch(o){o.stack.replace(/(?:at|@).*(http.+):[\d]+:[\d]+/,function(e,t){$__curScript={src:t},a=t.replace(/\/[^\/]*$/,"/")})}t&&importScripts(a+"system-polyfills.js"),e()}else $__curScript="undefined"!=typeof __filename?{src:__filename}:null,e()}(); //# sourceMappingURL=system-csp-production.js.map diff --git a/node_modules/systemjs/dist/system-csp-production.js.map b/node_modules/systemjs/dist/system-csp-production.js.map index 2898b5b1f..e1fb76817 100644 --- a/node_modules/systemjs/dist/system-csp-production.js.map +++ b/node_modules/systemjs/dist/system-csp-production.js.map @@ -1 +1 @@ -{"version":3,"sources":["system-csp-production.src.js"],"names":["bootstrap","global","URLPolyfill","url","baseURL","TypeError","m","String","replace","match","RangeError","protocol","username","password","host","hostname","port","pathname","search","hash","undefined","base","flag","slice","lastIndexOf","output","p","pop","push","join","this","origin","href","self","__global","addToError","err","msg","originalErr","stack","message","toString","split","newStack","i","length","$__curScript","indexOf","src","newMsg","substr","isBrowser","isWindows","newErr","errArgs","Error","fileName","lineNumber","Module","Loader","options","_loader","loaderObj","loads","modules","importPromises","moduleRecords","defineProperty","get","SystemJSLoader","call","paths","systemJSConstructor","SystemProto","hook","name","prototype","hookConstructor","isAbsolute","absURLRegEx","isRel","isPlain","urlResolve","parent","baseURI","URL","baseURIObj","applyPaths","loader","wildcard","pathMatch","maxWildcardPrefixLen","pathsCache","hasOwnProperty","path","pathParts","wildcardPrefixLen","outPath","group","deps","names","indices","l","index","getESModule","exports","esModule","getOwnPropertyDescriptor","defineOrCopyProperty","extend","value","targetObj","sourceObj","propName","d","Object","ex","a","b","prepend","extendMeta","val","Array","concat","extendPkgConfig","pkgCfgA","pkgCfgB","pkgName","warnInvalidProperties","prop","map","meta","depCache","dNormalized","coreResolve","warn","setPkgConfig","cfg","prependConfig","pkg","packages","basePkg","main","warnings","console","readMemberExpression","pParts","shift","getMapMatch","bestMatch","bestMatchLength","curMatchLength","prepareBaseURL","setProduction","isProduction","isBuilder","set","envModule","newModule","browser","node","_nodeRequire","production","dev","build","default","getNodeModule","parentModuleContext","_nodeModulePaths","require","parentName","mapMatch","has","builder","envSet","envCallback","browserConfig","nodeConfig","devConfig","buildConfig","productionConfig","detectRegisterFormat","source","leadingCommentAndMeta","leadingCommentAndMetaRegEx","createEntry","originalIndices","declare","execute","executingRequire","declarative","normalizedDeps","groupIndex","evaluated","module","esmExports","getGlobalValue","globalValue","first","parseCondition","condition","conditionExport","conditionModule","negation","conditionExportIndex","sysConditions","negate","serializeCondition","conditionObj","resolveCondition","bool","normalize","then","normalizedCondition","load","q","interpolateConditional","conditionalMatch","interpolationRegEx","Promise","resolve","conditionValue","booleanConditional","booleanIndex","isWorker","window","importScripts","document","process","platform","assert","item","thisLen","e","obj","opt","getElementsByTagName","bases","location","cwd","nativeURL","createLoad","status","anonCnt","linkSets","dependencies","metadata","loadModule","asyncStartLoadPartwayThrough","step","address","moduleName","moduleMetadata","moduleSource","moduleAddress","requestLoad","request","refererName","refererAddress","reject","proceedToLocate","proceedToFetch","locate","proceedToTranslate","fetch","translate","instantiate","instantiateResult","depsList","loadPromises","depLoad","key","addLoadToLinkSet","all","updateLinkSetOnLoad","exc","exception","linkSetFailed","stepState","existingLoad","done","linkSet","createLinkSet","startingLoad","loadingCount","j","doLink","error","link","_newModule","finishLoad","abrupt","checkError","pLoad","dep","failed","linkIndex","splice","globalLoadsIndex","trace","depMap","forEach","loadIndex","doDynamicExecute","linkError","createImportPromise","promise","constructor","define","delete","import","parentAddress","sourcePromise","pNames","getOwnPropertyNames","configurable","enumerable","freeze","referrerName","referrerAddress","System","fetchTextFromURL","XMLHttpRequest","authorization","fulfill","xhr","responseText","statusText","sameDomain","doTimeout","domainCheck","exec","XDomainRequest","onload","onerror","ontimeout","onprogress","timeout","onreadystatechange","readyState","addEventListener","open","setRequestHeader","withCredentials","setTimeout","send","fs","readFile","data","dataString","opts","headers","Accept","credentials","r","ok","text","scriptSrc","defaultJSExtensions","pluginFirst","loaderErrorStack","skipExt","resolved","httpRequest","systemImport","__useDefault","systemTranslate","format","apply","arguments","entry","JSON","parse","getConfig","curCurScript","config","isEnvConfig","checkHasConfig","transpilerRuntime","loadedTranspilerRuntime","bundles","packageConfigPaths","v","defaultJSExtension","decanonicalize","pkgMatch","packageLength","Math","max","normalized","bundle","normalizedBundleDep","c","getPackage","curPkg","pkgLen","curPkgLen","addDefaultExtension","subPath","skipExtensions","defaultExtension","metaMatch","getMetaMatches","metaPattern","matchMeta","matchDepth","applyPackageConfigSync","mapPath","mapped","doMapSync","validMapping","normalizeSync","applyPackageConfig","doMap","doStringMap","conditionPromises","conditions","conditionValues","createPkgConfigPathObj","lastWildcard","regEx","RegExp","getPackageConfigMatch","configPath","exactMatch","packageConfigPath","packageName","loadPackageConfigPath","pkgConfigPath","configLoader","pluginLoader","systemjs","pkgMeta","matchFn","wildcardIndex","dotRel","exactMeta","decanonicalized","isPlugin","parentPackageName","parentPackage","parentMap","parentMapMatch","pkgConfigMatch","isConfigured","configured","bestDepth","getInteractiveScriptLoad","interactiveScript","script","interactiveLoadingScripts","webWorkerImport","integrity","workerLoad","head","curSystem","curRequire","ieEvents","s","createElement","isOpera","opera","attachEvent","loadingCnt","registerQueue","pushRegister","register","reduceRegister_","scriptLoad","complete","evt","cleanup","detachEvent","removeEventListener","removeChild","async","crossOrigin","setAttribute","appendChild","buildGroups","groups","depName","depEntry","defined","depGroupIndex","startEntry","curGroupDeclarative","linkDeclarativeModule","linkDynamicModule","ModuleRecord","getOrCreateModuleRecord","importers","declaration","locked","importerModule","importerIndex","setter","setters","id","depExports","depModule","len","getModule","ensureEvaluated","nameNormalized","__esModule","seen","registerDynamic","pushRegister_","amd","curMeta","del","doLoad","__exec","grouped","normalizePromises","reduceRegister","forEachGlobal","callback","keys","g","forEachGlobalValue","globalName","ignoredGlobalProps","globalSnapshot","prepareGlobal","globals","encapsulate","curDefine","oldGlobals","singleGlobal","multipleExports","stripOrigin","windowOrigin","requireResolve","parentId","getPathVars","moduleId","filename","pluginIndex","dirname","amdDefine","getCJSDeps","requireIndex","commentRegEx","params","fnBracketRegEx","requireAlias","wsRegEx","requireRegEx","requireRegExs","cjsRequirePre","cjsRequirePost","lastIndex","errback","referer","dynamicRequires","factory","req","contextualRequire","depValues","uri","moduleIndex","exportsIndex","toUrl","amdRequire","getParentName","parentPluginIndex","parsePlugin","argumentName","pluginName","argument","plugin","combinePluginParts","checkDefaultExtension","arg","createNormalizeSync","parsed","pluginSyntaxIndex","loaderNormalized","loaderModule","args","result","sourceMap","originalName","file","sources","calledInstantiate","alias","aliasDeps","_export","setMetaProperty","target","curPart","depth","metaRegEx","metaPartRegEx","metaParts","firstChar","metaString","metaName","metaValue","loadedBundles","matched","curModule","parts","substring","SystemJS","version","doPolyfill","scripts","currentScript","defer","curPath","basePath","systemJSBootstrap","write","__filename"],"mappings":";;;CAGA,WACA,QAASA,MACT,SAA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E,IACvBsjB,EAAWD,EAAQnjB,OAAO,EAAGmjB,EAAQ7kB,YAAY,KAAO,EAC5DyM,QAAOsY,kBAAoBvmB,EAC3BmO,SAASqY,MACP,uCAA8CF,EAAW,sCAI3DtmB,SAIC,IAA6B,mBAAlBkO,eAA+B,CAC7C,GAAIoY,GAAW,EACf,KACE,KAAM,IAAI/iB,OAAM,KAChB,MAAOkL,GACPA,EAAElM,MAAM/B,QAAQ,iCAAkC,SAASF,EAAGH,GAC5D2C,cAAiBE,IAAK7C,GACtBmmB,EAAWnmB,EAAIK,QAAQ,YAAa,OAGpCylB,GACF/X,cAAcoY,EAAW,uBAC3BtmB,QAGA8C,cAAoC,mBAAd2jB,aAA8BzjB,IAAKyjB,YAAe,KACxEzmB"} \ No newline at end of file +{"version":3,"sources":["system-csp-production.src.js"],"names":["bootstrap","global","URLPolyfill","url","baseURL","TypeError","m","String","replace","match","RangeError","protocol","username","password","host","hostname","port","pathname","search","hash","undefined","base","flag","slice","lastIndexOf","output","p","pop","push","join","this","origin","href","self","__global","addToError","err","msg","originalErr","stack","message","toString","split","newStack","i","length","$__curScript","indexOf","src","newMsg","substr","isBrowser","isWindows","newErr","errArgs","Error","fileName","lineNumber","Module","Loader","options","_loader","loaderObj","loads","modules","importPromises","moduleRecords","defineProperty","get","SystemJSLoader","call","paths","systemJSConstructor","SystemProto","hook","name","prototype","hookConstructor","isAbsolute","absURLRegEx","isRel","isPlain","urlResolve","parent","baseURI","URL","baseURIObj","applyPaths","loader","wildcard","pathMatch","maxWildcardPrefixLen","pathsCache","hasOwnProperty","path","pathParts","wildcardPrefixLen","outPath","group","deps","names","indices","l","index","getESModule","exports","esModule","getOwnPropertyDescriptor","defineOrCopyProperty","extend","value","targetObj","sourceObj","propName","d","Object","ex","a","b","prepend","extendMeta","val","Array","concat","extendPkgConfig","pkgCfgA","pkgCfgB","pkgName","warnInvalidProperties","prop","map","meta","depCache","dNormalized","coreResolve","warn","setPkgConfig","cfg","prependConfig","pkg","packages","basePkg","main","warnings","console","createInstantiate","load","result","metadata","entry","createEntry","execute","format","readMemberExpression","pParts","shift","getMapMatch","bestMatch","bestMatchLength","curMatchLength","prepareBaseURL","setProduction","isProduction","isBuilder","set","envModule","newModule","browser","node","_nodeRequire","production","dev","build","default","getNodeModule","parentModuleContext","_nodeModulePaths","require","parentName","mapMatch","has","builder","envSet","envCallback","browserConfig","nodeConfig","devConfig","buildConfig","productionConfig","detectRegisterFormat","source","leadingCommentAndMeta","leadingCommentAndMetaRegEx","originalIndices","declare","executingRequire","declarative","normalizedDeps","groupIndex","evaluated","module","esmExports","getGlobalValue","globalValue","first","parseCondition","condition","conditionExport","conditionModule","negation","conditionExportIndex","sysConditions","negate","serializeCondition","conditionObj","resolveCondition","bool","normalize","then","normalizedCondition","q","interpolateConditional","conditionalMatch","interpolationRegEx","Promise","resolve","conditionValue","booleanConditional","booleanIndex","isWorker","window","importScripts","document","process","platform","assert","item","thisLen","e","obj","opt","getElementsByTagName","bases","location","cwd","nativeURL","createLoad","status","anonCnt","linkSets","dependencies","loadModule","asyncStartLoadPartwayThrough","step","address","moduleName","moduleMetadata","moduleSource","moduleAddress","requestLoad","request","refererName","refererAddress","reject","proceedToLocate","proceedToFetch","locate","proceedToTranslate","fetch","translate","instantiate","instantiateResult","depsList","loadPromises","depLoad","key","addLoadToLinkSet","all","updateLinkSetOnLoad","exc","exception","linkSetFailed","stepState","existingLoad","done","linkSet","createLinkSet","startingLoad","loadingCount","j","doLink","error","link","_newModule","finishLoad","abrupt","checkError","pLoad","dep","failed","linkIndex","splice","globalLoadsIndex","trace","depMap","forEach","loadIndex","doDynamicExecute","linkError","createImportPromise","promise","constructor","define","delete","import","parentAddress","sourcePromise","pNames","getOwnPropertyNames","configurable","enumerable","freeze","referrerName","referrerAddress","System","fetchTextFromURL","XMLHttpRequest","authorization","fulfill","xhr","responseText","statusText","sameDomain","doTimeout","domainCheck","exec","XDomainRequest","onload","onerror","ontimeout","onprogress","timeout","onreadystatechange","readyState","addEventListener","open","setRequestHeader","withCredentials","setTimeout","send","fs","readFile","data","dataString","opts","headers","Accept","credentials","r","ok","text","scriptSrc","defaultJSExtensions","pluginFirst","loaderErrorStack","skipExt","resolved","httpRequest","systemImport","__useDefault","systemTranslate","apply","arguments","JSON","parse","getConfig","curCurScript","config","isEnvConfig","checkHasConfig","transpilerRuntime","loadedTranspilerRuntime","bundles","packageConfigPaths","v","defaultJSExtension","decanonicalize","pkgMatch","packageLength","Math","max","normalized","bundle","normalizedBundleDep","c","getPackage","curPkg","pkgLen","curPkgLen","addDefaultExtension","subPath","skipExtensions","defaultExtension","metaMatch","getMetaMatches","metaPattern","matchMeta","matchDepth","applyPackageConfigSync","mapPath","mapped","doMapSync","validMapping","normalizeSync","applyPackageConfig","doMap","doStringMap","conditionPromises","conditions","conditionValues","createPkgConfigPathObj","lastWildcard","regEx","RegExp","getPackageConfigMatch","configPath","exactMatch","packageConfigPath","packageName","loadPackageConfigPath","pkgConfigPath","configLoader","pluginLoader","systemjs","pkgMeta","matchFn","wildcardIndex","dotRel","exactMeta","decanonicalized","isPlugin","parentPackageName","parentPackage","parentMap","parentMapMatch","pkgConfigMatch","isConfigured","configured","bestDepth","getInteractiveScriptLoad","interactiveScript","script","interactiveLoadingScripts","webWorkerImport","integrity","workerLoad","head","curSystem","curRequire","ieEvents","s","createElement","isOpera","opera","attachEvent","loadingCnt","registerQueue","pushRegister","register","reduceRegister_","scriptLoad","complete","evt","cleanup","detachEvent","removeEventListener","removeChild","async","crossOrigin","setAttribute","appendChild","buildGroups","groups","depName","depEntry","defined","depGroupIndex","startEntry","curGroupDeclarative","linkDeclarativeModule","linkDynamicModule","ModuleRecord","getOrCreateModuleRecord","importers","declaration","locked","importerModule","importerIndex","setter","setters","id","depExports","depModule","len","getModule","ensureEvaluated","nameNormalized","__esModule","seen","registerDynamic","pushRegister_","amd","curMeta","del","doLoad","__exec","grouped","normalizePromises","reduceRegister","forEachGlobal","callback","keys","g","forEachGlobalValue","globalName","ignoredGlobalProps","globalSnapshot","prepareGlobal","globals","encapsulate","curDefine","oldGlobals","singleGlobal","multipleExports","stripOrigin","windowOrigin","requireResolve","parentId","getPathVars","moduleId","filename","pluginIndex","dirname","amdDefine","getCJSDeps","requireIndex","commentRegEx","params","fnBracketRegEx","requireAlias","wsRegEx","requireRegEx","requireRegExs","cjsRequirePre","cjsRequirePost","lastIndex","errback","referer","dynamicRequires","factory","req","contextualRequire","depValues","uri","moduleIndex","exportsIndex","toUrl","amdRequire","getParentName","parentPluginIndex","parsePlugin","argumentName","pluginName","argument","plugin","combinePluginParts","checkDefaultExtension","arg","createNormalizeSync","parsed","pluginSyntaxIndex","loaderNormalized","loaderModule","args","sourceMap","originalName","file","sources","calledInstantiate","alias","aliasDeps","_export","setMetaProperty","target","curPart","depth","metaRegEx","metaPartRegEx","metaParts","firstChar","metaString","metaName","metaValue","loadedBundles","matched","curModule","parts","substring","SystemJS","version","doPolyfill","scripts","currentScript","defer","curPath","basePath","systemJSBootstrap","write","__filename"],"mappings":";;;CAGA,WACA,QAASA,MACT,SAAUC,GACV,QAASC,GAAYC,EAAKC,GACxB,GAAkB,gBAAPD,GACT,KAAM,IAAIE,WAAU,uBACtB,IAAIC,GAAIC,OAAOJ,GAAKK,QAAQ,aAAc,IAAIA,QAAQ,MAAO,KAAKC,MAAM,mHACxE,KAAKH,EACH,KAAM,IAAII,YAAW,qBACvB,IAAIC,GAAWL,EAAE,IAAM,GACnBM,EAAWN,EAAE,IAAM,GACnBO,EAAWP,EAAE,IAAM,GACnBQ,EAAOR,EAAE,IAAM,GACfS,EAAWT,EAAE,IAAM,GACnBU,EAAOV,EAAE,IAAM,GACfW,EAAWX,EAAE,IAAM,GACnBY,EAASZ,EAAE,IAAM,GACjBa,EAAOb,EAAE,IAAM,EACnB,IAAgBc,SAAZhB,EAAuB,CACzB,GAAIiB,GAAOjB,YAAmBF,GAAcE,EAAU,GAAIF,GAAYE,GAClEkB,GAAQX,IAAaG,IAASF,GAC9BU,GAASL,GAAaC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OuL,GACPA,EAAEvM,MAAM/B,QAAQ,iCAAkC,SAASF,EAAGH,GAC5D2C,cAAiBE,IAAK7C,GACtBomB,EAAWpmB,EAAIK,QAAQ,YAAa,OAGpC0lB,GACF3X,cAAcgY,EAAW,uBAC3BvmB,QAGA8C,cAAoC,mBAAd4jB,aAA8B1jB,IAAK0jB,YAAe,KACxE1mB"} \ No newline at end of file diff --git a/node_modules/systemjs/dist/system-csp-production.src.js b/node_modules/systemjs/dist/system-csp-production.src.js index 70dd9125f..b727e9bdf 100644 --- a/node_modules/systemjs/dist/system-csp-production.src.js +++ b/node_modules/systemjs/dist/system-csp-production.src.js @@ -1,5 +1,5 @@ /* - * SystemJS v0.19.41 + * SystemJS v0.19.47 */ (function() { function bootstrap() {// from https://gist.github.com/Yaffle/1088850 @@ -7,7 +7,7 @@ function bootstrap() {// from https://gist.github.com/Yaffle/1088850 function URLPolyfill(url, baseURL) { if (typeof url != 'string') throw new TypeError('URL must be a string'); - var m = String(url).replace(/^\s+|\s+$/g, "").match(/^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/); + var m = String(url).replace(/^\s+|\s+$/g, "").replace(/\\/g, '/').match(/^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/); if (!m) throw new RangeError('Invalid URL format'); var protocol = m[1] || ""; @@ -65,7 +65,8 @@ function URLPolyfill(url, baseURL) { this.hash = hash; } global.URLPolyfill = URLPolyfill; -})(typeof self != 'undefined' ? self : global);(function(__global) { +})(typeof self != 'undefined' ? self : global); +(function(__global) { var isWorker = typeof window == 'undefined' && typeof self != 'undefined' && typeof importScripts != 'undefined'; var isBrowser = typeof window != 'undefined' && typeof document != 'undefined'; @@ -83,7 +84,7 @@ global.URLPolyfill = URLPolyfill; } return -1; }; - + var defineProperty; (function () { try { @@ -120,9 +121,9 @@ global.URLPolyfill = URLPolyfill; newMsg = newMsg.replace(isWindows ? /file:\/\/\//g : /file:\/\//g, ''); var newErr = errArgs ? new Error(newMsg, err.fileName, err.lineNumber) : new Error(newMsg); - + newErr.stack = newMsg; - + // track the original error newErr.originalErr = err.originalErr || err; @@ -431,7 +432,7 @@ function logloads(loads) { .then(function(instantiateResult) { if (instantiateResult === undefined) throw new TypeError('Declarative modules unsupported in the polyfill.'); - + if (typeof instantiateResult != 'object') throw new TypeError('Invalid instantiate return value'); @@ -494,8 +495,6 @@ function logloads(loads) { for (var i = 0, l = linkSets.length; i < l; i++) { linkSetFailed(linkSets[i], load, exc); } - - console.assert(load.linkSets.length == 0, 'linkSets not removed'); }); } @@ -548,7 +547,6 @@ function logloads(loads) { proceedToFetch(loader, load, Promise.resolve(stepState.moduleAddress)); else { - console.assert(step == 'translate', 'translate step'); load.address = stepState.moduleAddress; proceedToTranslate(loader, load, Promise.resolve(stepState.moduleSource)); } @@ -636,9 +634,6 @@ function logloads(loads) { function updateLinkSetOnLoad(linkSet, load) { // console.log('update linkset on load ' + load.name); // snapshot(linkSet.loader); - - console.assert(load.status == 'loaded' || load.status == 'linked', 'loaded or linked'); - linkSet.loadingCount--; if (linkSet.loadingCount > 0) @@ -671,8 +666,6 @@ function logloads(loads) { if (abrupt) return; - console.assert(linkSet.loads.length == 0, 'loads cleared'); - linkSet.resolve(startingLoad); } @@ -681,7 +674,7 @@ function logloads(loads) { var loader = linkSet.loader; var requests; - checkError: + checkError: if (load) { if (linkSet.loads[0].name == load.name) { exc = addToError(exc, 'Error loading ' + load.name); @@ -715,7 +708,6 @@ function logloads(loads) { loader.loaderObj.failed.push(load); var linkIndex = indexOf.call(load.linkSets, linkSet); - console.assert(linkIndex != -1, 'link not present'); load.linkSets.splice(linkIndex, 1); if (load.linkSets.length == 0) { var globalLoadsIndex = indexOf.call(linkSet.loader.loads, load); @@ -747,7 +739,6 @@ function logloads(loads) { } // if not anonymous, add to the module table if (load.name) { - console.assert(!loader.modules[load.name] || loader.modules[load.name].module === load.module.module, 'load not in module table'); loader.modules[load.name] = load.module; } var loadIndex = indexOf.call(loader.loads, load); @@ -857,7 +848,7 @@ function logloads(loads) { var loader = this._loader; if (loader.modules[name]) return Promise.resolve(); - return loader.importPromises[name] || createImportPromise(this, name, new Promise(asyncStartLoadPartwayThrough({ + return (loader.importPromises[name] || createImportPromise(this, name, new Promise(asyncStartLoadPartwayThrough({ step: 'locate', loader: loader, moduleName: name, @@ -865,9 +856,11 @@ function logloads(loads) { moduleSource: undefined, moduleAddress: undefined })) - .then(function() { + .then(function(load) { delete loader.importPromises[name]; - })); + return load.module.module; + }))) + .then(function () {}); }, // 26.3.3.11 module: function(source, options) { @@ -977,7 +970,6 @@ function logloads(loads) { })(); var System; - // SystemJS Loader Class and Extension helpers function SystemJSLoader() { Loader.call(this); @@ -1054,7 +1046,7 @@ function applyPaths(loader, name) { if (p.indexOf('*') === -1) { if (name == p) return paths[p]; - + // support trailing / in paths rules else if (name.substr(0, p.length - 1) == p.substr(0, p.length - 1) && (name.length < p.length || name[p.length - 1] == p[p.length - 1]) && (paths[p][paths[p].length - 1] == '/' || paths[p] == '')) { return paths[p].substr(0, paths[p].length - 1) + (name.length > p.length ? (paths[p] && '/' || '') + name.substr(p.length) : ''); @@ -1208,7 +1200,7 @@ function extendPkgConfig(pkgCfgA, pkgCfgB, pkgName, loader, warnInvalidPropertie loader.depCache[dNormalized] = (loader.depCache[dNormalized] || []).concat(pkgCfgB.depCache[d]); } } - else if (warnInvalidProperties && indexOf.call(['browserConfig', 'nodeConfig', 'devConfig', 'productionConfig'], prop) == -1 && + else if (warnInvalidProperties && indexOf.call(['browserConfig', 'nodeConfig', 'devConfig', 'productionConfig'], prop) == -1 && (!pkgCfgB.hasOwnProperty || pkgCfgB.hasOwnProperty(prop))) { warn.call(loader, '"' + prop + '" is not a valid package configuration option in package ' + pkgName); } @@ -1230,7 +1222,7 @@ function setPkgConfig(loader, pkgName, cfg, prependConfig) { extendPkgConfig(pkg, prependConfig ? cfg : basePkg, pkgName, loader, prependConfig); extendPkgConfig(pkg, prependConfig ? basePkg : cfg, pkgName, loader, !prependConfig); } - + // main object becomes main map if (typeof pkg.main == 'object') { pkg.map = pkg.map || {}; @@ -1246,6 +1238,15 @@ function warn(msg) { if (this.warnings && typeof console != 'undefined' && console.warn) console.warn(msg); } + +function createInstantiate (load, result) { + load.metadata.entry = createEntry(); + load.metadata.entry.execute = function() { + return result; + } + load.metadata.entry.deps = []; + load.metadata.format = 'defined'; +} var fetchTextFromURL; if (typeof XMLHttpRequest != 'undefined') { fetchTextFromURL = function(url, authorization, fulfill, reject) { @@ -2674,7 +2675,7 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) { * * * The code here replicates the ES6 linking groups algorithm to ensure that - * circular ES6 compiled into System.register can work alongside circular AMD + * circular ES6 compiled into System.register can work alongside circular AMD * and CommonJS, identically to the actual ES6 loader. * */ @@ -2684,7 +2685,7 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) { * Registry side table entries in loader.defined * Registry Entry Contains: * - name - * - deps + * - deps * - declare for declarative modules * - execute for dynamic modules, different to declarative execute on module * - executingRequire indicates require drives execution for circularity of dynamic modules @@ -2702,7 +2703,7 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) { * For dynamic we track the es module with: * - esModule actual es module value * - esmExports whether to extend the esModule with named exports - * + * * Then for declarative only we track dynamic bindings with the 'module' records: * - name * - exports @@ -2747,7 +2748,7 @@ function createEntry() { * see https://github.com/ModuleLoader/es6-module-loader/wiki/System.register-Explained * * 2. System.registerDynamic for dynamic modules (3-4 params) - System.registerDynamic([name, ]deps, executingRequire, execute) - * the true or false statement + * the true or false statement * * this extension implements the linking algorithm for the two variations identical to the spec * allowing compiled ES6 circular references to work alongside AMD and CJS circular references. @@ -2766,7 +2767,7 @@ function createEntry() { return this.registerDynamic.apply(this, arguments); var entry = createEntry(); - // ideally wouldn't apply map config to bundle names but + // ideally wouldn't apply map config to bundle names but // dependencies go through map regardless so we can't restrict // could reconsider in shift to new spec entry.name = name && (this.decanonicalize || this.normalize).call(this, name); @@ -2852,17 +2853,17 @@ function createEntry() { for (var i = 0, l = entry.normalizedDeps.length; i < l; i++) { var depName = entry.normalizedDeps[i]; var depEntry = loader.defined[depName]; - + // not in the registry means already linked / ES6 if (!depEntry || depEntry.evaluated) continue; - + // now we know the entry is in our unlinked linkage group var depGroupIndex = entry.groupIndex + (depEntry.declarative != entry.declarative); // the group index of an entry is always the maximum if (depEntry.groupIndex === null || depEntry.groupIndex < depGroupIndex) { - + // if already in a group, remove from the old group if (depEntry.groupIndex !== null) { groups[depEntry.groupIndex].splice(indexOf.call(groups[depEntry.groupIndex], depEntry), 1); @@ -2902,7 +2903,7 @@ function createEntry() { else linkDynamicModule(entry, loader); } - curGroupDeclarative = !curGroupDeclarative; + curGroupDeclarative = !curGroupDeclarative; } } @@ -2962,7 +2963,7 @@ function createEntry() { // allowing undefined declaration was a mistake! To be deprecated. declaration = declaration || { setters: [], execute: function() {} }; - + module.setters = declaration.setters; module.execute = declaration.execute; @@ -3005,7 +3006,7 @@ function createEntry() { else { module.dependencies.push(null); } - + // run setters for all entries with the matching dependency name var originalIndices = entry.originalIndices[i]; for (var j = 0, len = originalIndices.length; j < len; ++j) { @@ -3031,7 +3032,7 @@ function createEntry() { else { if (entry.declarative) ensureEvaluated(name, entry, [], loader); - + else if (!entry.evaluated) linkDynamicModule(entry, loader); @@ -3040,7 +3041,7 @@ function createEntry() { if ((!entry || entry.declarative) && exports && exports.__useDefault) return exports['default']; - + return exports; } @@ -3078,7 +3079,7 @@ function createEntry() { throw new Error('Module ' + name + ' not declared as a dependency of ' + entry.name); }, exports, module); - + if (output !== undefined) module.exports = output; @@ -3102,7 +3103,7 @@ function createEntry() { * (unless one is a circular dependency already in the list of seen * modules, in which case we execute it) * - * Then we evaluate the module itself depth-first left to right + * Then we evaluate the module itself depth-first left to right * execution to match ES6 modules */ function ensureEvaluated(moduleName, entry, seen, loader) { @@ -3148,7 +3149,7 @@ function createEntry() { } load.metadata.deps = load.metadata.deps || []; - + return fetch.call(this, load); }; }); @@ -3159,7 +3160,7 @@ function createEntry() { load.metadata.deps = load.metadata.deps || []; return Promise.resolve(translate.apply(this, arguments)).then(function(source) { // run detection for register format - if (load.metadata.format == 'register' || !load.metadata.format && detectRegisterFormat(load.source)) + if (load.metadata.format == 'register' || load.metadata.format == 'system' || !load.metadata.format && detectRegisterFormat(load.source)) load.metadata.format = 'register'; return source; }); @@ -3177,7 +3178,7 @@ function createEntry() { entry.originalIndices = entry.normalizedDeps = []; - // recursively ensure that the module and all its + // recursively ensure that the module and all its // dependencies are linked (with dependency group handling) link(normalized, entry, loader); @@ -3228,9 +3229,9 @@ function createEntry() { // Contains System.register calls // (dont run bundles in the builder) - else if (!(loader.builder && load.metadata.bundle) + else if (!(loader.builder && load.metadata.bundle) && (load.metadata.format == 'register' || load.metadata.format == 'esm' || load.metadata.format == 'es6')) { - + if (typeof __exec != 'undefined') __exec.call(loader, load); @@ -3253,9 +3254,9 @@ function createEntry() { // place this module onto defined for circular references loader.defined[load.name] = entry; - + var grouped = group(entry.deps); - + entry.deps = grouped.names; entry.originalIndices = grouped.indices; entry.name = load.name; @@ -3273,7 +3274,7 @@ function createEntry() { return { deps: entry.deps, execute: function() { - // recursively ensure that the module and all its + // recursively ensure that the module and all its // dependencies are linked (with dependency group handling) link(load.name, entry, loader); @@ -3909,15 +3910,16 @@ hookConstructor(function(constructor) { hook('fetch', function(fetch) { return function(load) { var loader = this; - if (load.metadata.loaderModule && load.metadata.loaderModule.fetch && load.metadata.format != 'defined') { + if (load.metadata.loaderModule && load.metadata.format != 'defined') { + if (typeof load.metadata.loaderModule === 'function' || load.metadata.loaderModule instanceof Module && typeof load.metadata.loaderModule.default === 'function') + return ''; load.metadata.scriptLoad = false; - return load.metadata.loaderModule.fetch.call(loader, load, function(load) { - return fetch.call(loader, load); - }); - } - else { - return fetch.call(loader, load); + if (load.metadata.loaderModule.fetch) + return load.metadata.loaderModule.fetch.call(loader, load, function(load) { + return fetch.call(loader, load); + }); } + return fetch.call(loader, load); }; }); @@ -3954,9 +3956,7 @@ hookConstructor(function(constructor) { return translate.apply(loader, args); }); } - else { - return translate.apply(loader, args); - } + return translate.apply(loader, args); }; }); @@ -3965,28 +3965,30 @@ hookConstructor(function(constructor) { var loader = this; var calledInstantiate = false; - if (load.metadata.loaderModule && load.metadata.loaderModule.instantiate && !loader.builder && load.metadata.format != 'defined') - return Promise.resolve(load.metadata.loaderModule.instantiate.call(loader, load, function(load) { - if (calledInstantiate) - throw new Error('Instantiate must only be called once.'); - calledInstantiate = true; - return instantiate.call(loader, load); - })).then(function(result) { - if (calledInstantiate) - return result; - - if (result !== undefined) { - load.metadata.entry = createEntry(); - load.metadata.entry.execute = function() { + if (load.metadata.loaderModule && !loader.builder && load.metadata.format != 'defined') { + if (load.metadata.loaderModule.instantiate) + return Promise.resolve(load.metadata.loaderModule.instantiate.call(loader, load, function(load) { + if (calledInstantiate) + throw new Error('Instantiate must only be called once.'); + calledInstantiate = true; + return instantiate.call(loader, load); + })).then(function(result) { + if (calledInstantiate) return result; - } - load.metadata.entry.deps = load.metadata.deps; - load.metadata.format = 'defined'; - } - return instantiate.call(loader, load); - }); - else - return instantiate.call(loader, load); + + if (result !== undefined) + createInstantiate(load, result); + return instantiate.call(loader, load); + }); + else if (typeof load.metadata.loaderModule === 'function' || load.metadata.loaderModule instanceof Module && typeof load.metadata.loaderModule.default === 'function') + return Promise.resolve((load.metadata.loaderModule.default || load.metadata.loaderModule).call(loader, load.address, load.name)) + .then(function (result) { + if (result !== undefined) + createInstantiate(load, result); + return instantiate.call(loader, load); + }); + } + return instantiate.call(loader, load); }; }); @@ -4480,7 +4482,7 @@ hook('fetch', function(fetch) { });System = new SystemJSLoader(); __global.SystemJS = System; -System.version = '0.19.41 CSP'; +System.version = '0.19.47 CSP'; if (typeof module == 'object' && module.exports && typeof exports == 'object') module.exports = System; diff --git a/node_modules/systemjs/dist/system-polyfills.js b/node_modules/systemjs/dist/system-polyfills.js index ca76c2418..bf3aaab1b 100644 --- a/node_modules/systemjs/dist/system-polyfills.js +++ b/node_modules/systemjs/dist/system-polyfills.js @@ -1,5 +1,5 @@ /* * SystemJS Promise Polyfill */ -!function(t){!function(e){"object"==typeof exports?module.exports=e():"function"==typeof t&&t.amd?t(e):"undefined"!=typeof window?window.Promise=e():"undefined"!=typeof global?global.Promise=e():"undefined"!=typeof self&&(self.Promise=e())}(function(){var t;return function t(e,n,o){function r(u,c){if(!n[u]){if(!e[u]){var f="function"==typeof require&&require;if(!c&&f)return f(u,!0);if(i)return i(u,!0);throw new Error("Cannot find module '"+u+"'")}var s=n[u]={exports:{}};e[u][0].call(s.exports,function(t){var n=e[u][1][t];return r(n?n:t)},s,s.exports,t,e,n,o)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u=0&&(l.splice(e,1),h("Handled previous rejection ["+t.id+"] "+r.formatObject(t.value)))}function c(t,e){p.push(t,e),null===d&&(d=o(f,0))}function f(){for(d=null;p.length>0;)p.shift()(p.shift())}var s,a=n,h=n;"undefined"!=typeof console&&(s=console,a="undefined"!=typeof s.error?function(t){s.error(t)}:function(t){s.log(t)},h="undefined"!=typeof s.info?function(t){s.info(t)}:function(t){s.log(t)}),t.onPotentiallyUnhandledRejection=function(t){c(i,t)},t.onPotentiallyUnhandledRejectionHandled=function(t){c(u,t)},t.onFatalRejection=function(t){c(e,t.value)};var p=[],l=[],d=null;return t}})}("function"==typeof t&&t.amd?t:function(t){n.exports=t(e)})},{"../env":5,"../format":6}],5:[function(e,n,o){!function(t){"use strict";t(function(t){function e(){return"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process)}function n(){return"function"==typeof MutationObserver&&MutationObserver||"function"==typeof WebKitMutationObserver&&WebKitMutationObserver}function o(t){function e(){var t=n;n=void 0,t()}var n,o=document.createTextNode(""),r=new t(e);r.observe(o,{characterData:!0});var i=0;return function(t){n=t,o.data=i^=1}}var r,i="undefined"!=typeof setTimeout&&setTimeout,u=function(t,e){return setTimeout(t,e)},c=function(t){return clearTimeout(t)},f=function(t){return i(t,0)};if(e())f=function(t){return process.nextTick(t)};else if(r=n())f=o(r);else if(!i){var s=t,a=s("vertx");u=function(t,e){return a.setTimer(e,t)},c=a.cancelTimer,f=a.runOnLoop||a.runOnContext}return{setTimer:u,clearTimer:c,asap:f}})}("function"==typeof t&&t.amd?t:function(t){n.exports=t(e)})},{}],6:[function(e,n,o){!function(t){"use strict";t(function(){function t(t){var n="object"==typeof t&&null!==t&&(t.stack||t.message)?t.stack||t.message:e(t);return t instanceof Error?n:n+" (WARNING: non-Error used)"}function e(t){var e=String(t);return"[object Object]"===e&&"undefined"!=typeof JSON&&(e=n(t,e)),e}function n(t,e){try{return JSON.stringify(t)}catch(t){return e}}return{formatError:t,formatObject:e,tryStringify:n}})}("function"==typeof t&&t.amd?t:function(t){n.exports=t()})},{}],7:[function(e,n,o){!function(t){"use strict";t(function(){return function(t){function e(t,e){this._handler=t===_?e:n(t)}function n(t){function e(t){r.resolve(t)}function n(t){r.reject(t)}function o(t){r.notify(t)}var r=new b;try{t(e,n,o)}catch(t){n(t)}return r}function o(t){return k(t)?t:new e(_,new x(v(t)))}function r(t){return new e(_,new x(new P(t)))}function i(){return $}function u(){return new e(_,new b)}function c(t,e){var n=new b(t.receiver,t.join().context);return new e(_,n)}function f(t){return a(B,null,t)}function s(t,e){return a(M,t,e)}function a(t,n,o){function r(e,r,u){u.resolved||h(o,i,e,t(n,r,e),u)}function i(t,e,n){a[t]=e,0===--s&&n.become(new q(a))}for(var u,c="function"==typeof n?r:i,f=new b,s=o.length>>>0,a=new Array(s),p=0;p0?e(n,i.value,r):(r.become(i),p(t,n+1,i))}else e(n,o,r)}function p(t,e,n){for(var o=e;o0||"function"!=typeof e&&r<0)return new this.constructor(_,o);var i=this._beget(),u=i._handler;return o.chain(u,o.receiver,t,e,n),i},e.prototype.catch=function(t){return this.then(void 0,t)},e.prototype._beget=function(){return c(this._handler,this.constructor)},e.all=f,e.race=d,e._traverse=s,e._visitRemaining=p,_.prototype.when=_.prototype.become=_.prototype.notify=_.prototype.fail=_.prototype._unreport=_.prototype._report=K,_.prototype._state=0,_.prototype.state=function(){return this._state},_.prototype.join=function(){for(var t=this;void 0!==t.handler;)t=t.handler;return t},_.prototype.chain=function(t,e,n,o,r){this.when({resolver:t,receiver:e,fulfilled:n,rejected:o,progress:r})},_.prototype.visit=function(t,e,n,o){this.chain(X,t,e,n,o)},_.prototype.fold=function(t,e,n,o){this.when(new S(t,e,n,o))},A(_,w),w.prototype.become=function(t){t.fail()};var X=new w;A(_,b),b.prototype._state=0,b.prototype.resolve=function(t){this.become(v(t))},b.prototype.reject=function(t){this.resolved||this.become(new P(t))},b.prototype.join=function(){if(!this.resolved)return this;for(var t=this;void 0!==t.handler;)if(t=t.handler,t===this)return this.handler=O();return t},b.prototype.run=function(){var t=this.consumers,e=this.handler;this.handler=this.handler.join(),this.consumers=void 0;for(var n=0;n=0&&(l.splice(e,1),h("Handled previous rejection ["+t.id+"] "+r.formatObject(t.value)))}function c(t,e){p.push(t,e),null===d&&(d=o(f,0))}function f(){for(d=null;p.length>0;)p.shift()(p.shift())}var s,a=n,h=n;"undefined"!=typeof console&&(s=console,a="undefined"!=typeof s.error?function(t){s.error(t)}:function(t){s.log(t)},h="undefined"!=typeof s.info?function(t){s.info(t)}:function(t){s.log(t)}),t.onPotentiallyUnhandledRejection=function(t){c(i,t)},t.onPotentiallyUnhandledRejectionHandled=function(t){c(u,t)},t.onFatalRejection=function(t){c(e,t.value)};var p=[],l=[],d=null;return t}})}("function"==typeof t&&t.amd?t:function(t){n.exports=t(e)})},{"../env":5,"../format":6}],5:[function(e,n,o){!function(t){"use strict";t(function(t){function e(){return"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process)}function n(){return"function"==typeof MutationObserver&&MutationObserver||"function"==typeof WebKitMutationObserver&&WebKitMutationObserver}function o(t){function e(){var t=n;n=void 0,t()}var n,o=document.createTextNode(""),r=new t(e);r.observe(o,{characterData:!0});var i=0;return function(t){n=t,o.data=i^=1}}var r,i="undefined"!=typeof setTimeout&&setTimeout,u=function(t,e){return setTimeout(t,e)},c=function(t){return clearTimeout(t)},f=function(t){return i(t,0)};if(e())f=function(t){return process.nextTick(t)};else if(r=n())f=o(r);else if(!i){var s=t,a=s("vertx");u=function(t,e){return a.setTimer(e,t)},c=a.cancelTimer,f=a.runOnLoop||a.runOnContext}return{setTimer:u,clearTimer:c,asap:f}})}("function"==typeof t&&t.amd?t:function(t){n.exports=t(e)})},{}],6:[function(e,n,o){!function(t){"use strict";t(function(){function t(t){var n="object"==typeof t&&null!==t&&(t.stack||t.message)?t.stack||t.message:e(t);return t instanceof Error?n:n+" (WARNING: non-Error used)"}function e(t){var e=String(t);return"[object Object]"===e&&"undefined"!=typeof JSON&&(e=n(t,e)),e}function n(t,e){try{return JSON.stringify(t)}catch(n){return e}}return{formatError:t,formatObject:e,tryStringify:n}})}("function"==typeof t&&t.amd?t:function(t){n.exports=t()})},{}],7:[function(e,n,o){!function(t){"use strict";t(function(){return function(t){function e(t,e){this._handler=t===_?e:n(t)}function n(t){function e(t){r.resolve(t)}function n(t){r.reject(t)}function o(t){r.notify(t)}var r=new b;try{t(e,n,o)}catch(i){n(i)}return r}function o(t){return k(t)?t:new e(_,new x(v(t)))}function r(t){return new e(_,new x(new P(t)))}function i(){return $}function u(){return new e(_,new b)}function c(t,e){var n=new b(t.receiver,t.join().context);return new e(_,n)}function f(t){return a(B,null,t)}function s(t,e){return a(M,t,e)}function a(t,n,o){function r(e,r,u){u.resolved||h(o,i,e,t(n,r,e),u)}function i(t,e,n){a[t]=e,0===--s&&n.become(new q(a))}for(var u,c="function"==typeof n?r:i,f=new b,s=o.length>>>0,a=new Array(s),p=0;p0?e(n,i.value,r):(r.become(i),p(t,n+1,i))}else e(n,o,r)}function p(t,e,n){for(var o=e;on&&t._unreport()}}function d(t){return"object"!=typeof t||null===t?r(new TypeError("non-iterable passed to race()")):0===t.length?i():1===t.length?o(t[0]):y(t)}function y(t){var n,o,r,i=new b;for(n=0;n0||"function"!=typeof e&&0>r)return new this.constructor(_,o);var i=this._beget(),u=i._handler;return o.chain(u,o.receiver,t,e,n),i},e.prototype["catch"]=function(t){return this.then(void 0,t)},e.prototype._beget=function(){return c(this._handler,this.constructor)},e.all=f,e.race=d,e._traverse=s,e._visitRemaining=p,_.prototype.when=_.prototype.become=_.prototype.notify=_.prototype.fail=_.prototype._unreport=_.prototype._report=K,_.prototype._state=0,_.prototype.state=function(){return this._state},_.prototype.join=function(){for(var t=this;void 0!==t.handler;)t=t.handler;return t},_.prototype.chain=function(t,e,n,o,r){this.when({resolver:t,receiver:e,fulfilled:n,rejected:o,progress:r})},_.prototype.visit=function(t,e,n,o){this.chain(X,t,e,n,o)},_.prototype.fold=function(t,e,n,o){this.when(new S(t,e,n,o))},A(_,w),w.prototype.become=function(t){t.fail()};var X=new w;A(_,b),b.prototype._state=0,b.prototype.resolve=function(t){this.become(v(t))},b.prototype.reject=function(t){this.resolved||this.become(new P(t))},b.prototype.join=function(){if(!this.resolved)return this;for(var t=this;void 0!==t.handler;)if(t=t.handler,t===this)return this.handler=O();return t},b.prototype.run=function(){var t=this.consumers,e=this.handler;this.handler=this.handler.join(),this.consumers=void 0;for(var n=0;ns.length?(o[s]&&"/"||"")+t.substr(s.length):"")}else{var c=s.split("*");if(c.length>2)throw new TypeError("Only one wildcard in a path is permitted");var f=c[0].length;f>=a&&t.substr(0,c[0].length)==c[0]&&t.substr(t.length-c[1].length)==c[1]&&(a=f,r=s,n=t.substr(c[0].length,t.length-c[1].length-c[0].length))}}var m=o[r];return"string"==typeof n&&(m=m.replace("*",n)),m}function c(e){for(var t=[],n=[],r=0,a=e.length;r",linkSets:[],dependencies:[],metadata:{}}}function a(e,t,n){return new Promise(l({step:n.address?"fetch":"locate",loader:e,moduleName:t,moduleMetadata:n&&n.metadata||{},moduleSource:n.source,moduleAddress:n.address}))}function o(t,n,r,a){return new Promise(function(e,o){e(t.loaderObj.normalize(n,r,a))}).then(function(n){var r;if(t.modules[n])return r=e(n),r.status="linked",r.module=t.modules[n],r;for(var a=0,o=t.loads.length;a0)){var n=e.startingLoad;if(e.loader.loaderObj.execute===!1){for(var r=[].concat(e.loads),a=0,o=r.length;a=0;i--){for(var s=a[i],d=0;di.length?(o[i]&&"/"||"")+t.substr(i.length):"")}else{var c=i.split("*");if(c.length>2)throw new TypeError("Only one wildcard in a path is permitted");var f=c[0].length;f>=a&&t.substr(0,c[0].length)==c[0]&&t.substr(t.length-c[1].length)==c[1]&&(a=f,r=i,n=t.substr(c[0].length,t.length-c[1].length-c[0].length))}}var m=o[r];return"string"==typeof n&&(m=m.replace("*",n)),m}function c(e){for(var t=[],n=[],r=0,a=e.length;a>r;r++){var o=x.call(t,e[r]);-1===o?(t.push(e[r]),n.push([r])):n[o].push(r)}return{names:t,indices:n}}function f(t){var n={};if(("object"==typeof t||"function"==typeof t)&&t!==e)if(z)for(var r in t)"default"!==r&&m(n,t,r);else p(n,t);return n["default"]=t,w(n,"__useDefault",{value:!0}),n}function m(e,t,n){try{var r;(r=Object.getOwnPropertyDescriptor(t,n))&&w(e,n,r)}catch(a){return e[n]=t[n],!1}}function p(e,t,n){var r=t&&t.hasOwnProperty;for(var a in t)(!r||t.hasOwnProperty(a))&&(n&&a in e||(e[a]=t[a]));return e}function h(e){var t=e.match(D);return t&&"System.register"==e.substr(t[0].length,15)}function g(){return{name:null,deps:null,originalIndices:null,declare:null,execute:null,executingRequire:!1,declarative:!1,normalizedDeps:null,groupIndex:null,evaluated:!1,module:null,esModule:null,esmExports:!1}}var v="undefined"==typeof window&&"undefined"!=typeof self&&"undefined"!=typeof importScripts,y="undefined"!=typeof window&&"undefined"!=typeof document,b="undefined"!=typeof process&&"undefined"!=typeof process.platform&&!!process.platform.match(/^win/);e.console||(e.console={assert:function(){}});var w,x=Array.prototype.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1};!function(){try{Object.defineProperty({},"a",{})&&(w=Object.defineProperty)}catch(e){w=function(e,t,n){try{e[t]=n.value||n.get.call(e)}catch(r){}}}}();var S,E="_"==new Error(0,"_").fileName;if("undefined"!=typeof document&&document.getElementsByTagName){if(S=document.baseURI,!S){var O=document.getElementsByTagName("base");S=O[0]&&O[0].href||window.location.href}}else"undefined"!=typeof location&&(S=e.location.href);if(S)S=S.split("#")[0].split("?")[0],S=S.substr(0,S.lastIndexOf("/")+1);else{if("undefined"==typeof process||!process.cwd)throw new TypeError("No environment baseURI");S="file://"+(b?"/":"")+process.cwd()+"/",b&&(S=S.replace(/\\/g,"/"))}try{var _="test:"==new e.URL("test:///").protocol}catch(P){}var j=_?e.URL:e.URLPolyfill;w(n.prototype,"toString",{value:function(){return"Module"}}),function(){function e(e){return{status:"loading",name:e||"",linkSets:[],dependencies:[],metadata:{}}}function a(e,t,n){return new Promise(l({step:n.address?"fetch":"locate",loader:e,moduleName:t,moduleMetadata:n&&n.metadata||{},moduleSource:n.source,moduleAddress:n.address}))}function o(t,n,r,a){return new Promise(function(e,o){e(t.loaderObj.normalize(n,r,a))}).then(function(n){var r;if(t.modules[n])return r=e(n),r.status="linked",r.module=t.modules[n],r;for(var a=0,o=t.loads.length;o>a;a++)if(r=t.loads[a],r.name==n)return r;return r=e(n),t.loads.push(r),s(t,r),r})}function s(e,t){i(e,t,Promise.resolve().then(function(){return e.loaderObj.locate({name:t.name,metadata:t.metadata})}))}function i(e,t,n){d(e,t,n.then(function(n){return"loading"==t.status?(t.address=n,e.loaderObj.fetch({name:t.name,metadata:t.metadata,address:n})):void 0}))}function d(e,t,n){n.then(function(n){return"loading"==t.status?(t.address=t.address||t.name,Promise.resolve(e.loaderObj.translate({name:t.name,metadata:t.metadata,address:t.address,source:n})).then(function(n){return t.source=n,e.loaderObj.instantiate({name:t.name,metadata:t.metadata,address:t.address,source:n})}).then(function(e){if(void 0===e)throw new TypeError("Declarative modules unsupported in the polyfill.");if("object"!=typeof e)throw new TypeError("Invalid instantiate return value");t.depsList=e.deps||[],t.execute=e.execute}).then(function(){t.dependencies=[];for(var n=t.depsList,r=[],a=0,s=n.length;s>a;a++)(function(n,a){r.push(o(e,n,t.name,t.address).then(function(e){if(t.dependencies[a]={key:n,value:e.name},"linked"!=e.status)for(var r=t.linkSets.concat([]),o=0,s=r.length;s>o;o++)c(r[o],e)}))})(n[a],a);return Promise.all(r)}).then(function(){t.status="loaded";for(var e=t.linkSets.concat([]),n=0,r=e.length;r>n;n++)m(e[n],t)})):void 0})["catch"](function(e){t.status="failed",t.exception=e;for(var n=t.linkSets.concat([]),r=0,a=n.length;a>r;r++)p(n[r],t,e)})}function l(t){return function(n,r){var a=t.loader,o=t.moduleName,l=t.step;if(a.modules[o])throw new TypeError('"'+o+'" already exists in the module table');for(var c,f=0,m=a.loads.length;m>f;f++)if(a.loads[f].name==o&&(c=a.loads[f],"translate"!=l||c.source||(c.address=t.moduleAddress,d(a,c,Promise.resolve(t.moduleSource))),c.linkSets.length&&c.linkSets[0].loads[0].name==c.name))return c.linkSets[0].done.then(function(){n(c)});var p=c||e(o);p.metadata=t.moduleMetadata;var h=u(a,p);a.loads.push(p),n(h.done),"locate"==l?s(a,p):"fetch"==l?i(a,p,Promise.resolve(t.moduleAddress)):(p.address=t.moduleAddress,d(a,p,Promise.resolve(t.moduleSource)))}}function u(e,t){var n={loader:e,loads:[],startingLoad:t,loadingCount:0};return n.done=new Promise(function(e,t){n.resolve=e,n.reject=t}),c(n,t),n}function c(e,t){if("failed"!=t.status){for(var n=0,r=e.loads.length;r>n;n++)if(e.loads[n]==t)return;e.loads.push(t),t.linkSets.push(e),"loaded"!=t.status&&e.loadingCount++;for(var a=e.loader,n=0,r=t.dependencies.length;r>n;n++)if(t.dependencies[n]){var o=t.dependencies[n].value;if(!a.modules[o])for(var s=0,i=a.loads.length;i>s;s++)if(a.loads[s].name==o){c(e,a.loads[s]);break}}}}function f(e){var t=!1;try{y(e,function(n,r){p(e,n,r),t=!0})}catch(n){p(e,null,n),t=!0}return t}function m(e,t){if(e.loadingCount--,!(e.loadingCount>0)){var n=e.startingLoad;if(e.loader.loaderObj.execute===!1){for(var r=[].concat(e.loads),a=0,o=r.length;o>a;a++){var t=r[a];t.module={name:t.name,module:S({}),evaluated:!0},t.status="linked",h(e.loader,t)}return e.resolve(n)}var s=f(e);s||e.resolve(n)}}function p(e,n,r){var a=e.loader;e:if(n)if(e.loads[0].name==n.name)r=t(r,"Error loading "+n.name);else{for(var o=0;oo;o++){var n=l[o];a.loaderObj.failed=a.loaderObj.failed||[],-1==x.call(a.loaderObj.failed,n)&&a.loaderObj.failed.push(n);var c=x.call(n.linkSets,e);if(n.linkSets.splice(c,1),0==n.linkSets.length){var f=x.call(e.loader.loads,n);-1!=f&&e.loader.loads.splice(f,1)}}e.reject(r)}function h(e,t){if(e.loaderObj.trace){e.loaderObj.loads||(e.loaderObj.loads={});var n={};t.dependencies.forEach(function(e){n[e.key]=e.value}),e.loaderObj.loads[t.name]={name:t.name,deps:t.dependencies.map(function(e){return e.key}),depMap:n,address:t.address,metadata:t.metadata,source:t.source}}t.name&&(e.modules[t.name]=t.module);var r=x.call(e.loads,t);-1!=r&&e.loads.splice(r,1);for(var a=0,o=t.linkSets.length;o>a;a++)r=x.call(t.linkSets[a].loads,t),-1!=r&&t.linkSets[a].loads.splice(r,1);t.linkSets.splice(0,t.linkSets.length)}function g(e,t,r){try{var a=t.execute()}catch(o){return void r(t,o)}return a&&a instanceof n?a:void r(t,new TypeError("Execution must define a Module instance"))}function v(e,t,n){var r=e._loader.importPromises;return r[t]=n.then(function(e){return r[t]=void 0,e},function(e){throw r[t]=void 0,e})}function y(e,t){var n=e.loader;if(e.loads.length)for(var r=e.loads.concat([]),a=0;aa;a++){var s=e.normalizedDeps[a],i=n.defined[s];if(i&&!i.evaluated){var d=e.groupIndex+(i.declarative!=e.declarative);if(null===i.groupIndex||i.groupIndex=0;s--){for(var i=a[s],d=0;dr;r++){var i=a.importers[r];if(!i.locked){var d=x.call(i.dependencies,a),l=i.setters[d];l&&l(o)}}return a.locked=!1,t},{id:t.name});if("function"==typeof s&&(s={setters:[],execute:s}),s=s||{setters:[],execute:function(){}},a.setters=s.setters,a.execute=s.execute,!a.setters||!a.execute)throw new TypeError("Invalid System.register form for "+t.name);for(var i=0,u=t.normalizedDeps.length;u>i;i++){var c,f=t.normalizedDeps[i],m=n.defined[f],p=r[f];p?c=p.exports:m&&!m.declarative?c=m.esModule:m?(l(m,n),p=m.module,c=p.exports):c=n.get(f),p&&p.importers?(p.importers.push(a),a.dependencies.push(p)):a.dependencies.push(null);for(var h=t.originalIndices[i],g=0,v=h.length;v>g;++g){var y=h[g];a.setters[y]&&a.setters[y](c)}}}}function u(e,t){var n,r=t.defined[e];if(r)r.declarative?p(e,r,[],t):r.evaluated||m(r,t),n=r.module.exports;else if(n=t.get(e),!n)throw new Error("Unable to load dependency "+e+".");return(!r||r.declarative)&&n&&n.__useDefault?n["default"]:n}function m(t,r){if(!t.module){var a={},o=t.module={exports:a,id:t.name};if(!t.executingRequire)for(var s=0,i=t.normalizedDeps.length;i>s;s++){var d=t.normalizedDeps[s],l=r.defined[d];l&&m(l,r)}t.evaluated=!0;var c=t.execute.call(e,function(e){for(var n=0,a=t.deps.length;a>n;n++)if(t.deps[n]==e)return u(t.normalizedDeps[n],r);var o=r.normalizeSync(e,t.name);if(-1!=x.call(t.normalizedDeps,o))return u(o,r);throw new Error("Module "+e+" not declared as a dependency of "+t.name)},a,o);void 0!==c&&(o.exports=c),a=o.exports,a&&(a.__esModule||a instanceof n)?t.esModule=r.newModule(a):t.esmExports&&a!==e?t.esModule=r.newModule(f(a)):t.esModule=r.newModule({"default":a,__useDefault:!0})}}function p(t,n,r,a){if(n&&!n.evaluated&&n.declarative){r.push(t);for(var o=0,s=n.normalizedDeps.length;s>o;o++){var i=n.normalizedDeps[o];-1==x.call(r,i)&&(a.defined[i]?p(i,a.defined[i],r,a):a.get(i))}n.evaluated||(n.evaluated=!0,n.module.execute.call(e))}}a.prototype.register=function(e,t,n){if("string"!=typeof e&&(n=t,t=e,e=null),"boolean"==typeof n)return this.registerDynamic.apply(this,arguments);var r=g();r.name=e&&(this.decanonicalize||this.normalize).call(this,e),r.declarative=!0,r.deps=t,r.declare=n,this.pushRegister_({amd:!1,entry:r})},a.prototype.registerDynamic=function(e,t,n,r){"string"!=typeof e&&(r=n,n=t,t=e,e=null);var a=g();a.name=e&&(this.decanonicalize||this.normalize).call(this,e),a.deps=t,a.execute=r,a.executingRequire=n,this.pushRegister_({amd:!1,entry:a})},s("reduceRegister_",function(){return function(e,t){if(t){var n=t.entry,r=e&&e.metadata;if(n.name&&(n.name in this.defined||(this.defined[n.name]=n),r&&(r.bundle=!0)),!n.name||e&&!r.entry&&n.name==e.name){if(!r)throw new TypeError("Invalid System.register call. Anonymous System.register calls can only be made by modules loaded by SystemJS.import and not via script tags.");if(r.entry)throw"register"==r.format?new Error("Multiple anonymous System.register calls in module "+e.name+". If loading a bundle, ensure all the System.register calls are named."):new Error("Module "+e.name+" interpreted as "+r.format+" module format, but called System.register.");r.format||(r.format="register"),r.entry=n}}}}),i(function(e){return function(){e.call(this),this.defined={},this._loader.moduleRecords={}}}),w(o,"toString",{value:function(){return"Module"}}),s("delete",function(e){return function(t){return delete this._loader.moduleRecords[t],delete this.defined[t],e.call(this,t)}}),s("fetch",function(e){return function(t){return this.defined[t.name]?(t.metadata.format="defined",""):(t.metadata.deps=t.metadata.deps||[],e.call(this,t))}}),s("translate",function(e){return function(t){return t.metadata.deps=t.metadata.deps||[],Promise.resolve(e.apply(this,arguments)).then(function(e){return("register"==t.metadata.format||"system"==t.metadata.format||!t.metadata.format&&h(t.source))&&(t.metadata.format="register"),e})}}),s("load",function(e){return function(t){var n=this,a=n.defined[t];return!a||a.deps.length?e.apply(this,arguments):(a.originalIndices=a.normalizedDeps=[],r(t,a,n),p(t,a,[],n),a.esModule||(a.esModule=n.newModule(a.module.exports)),n.trace||(n.defined[t]=void 0),n.set(t,a.esModule),Promise.resolve())}}),s("instantiate",function(e){return function(t){"detect"==t.metadata.format&&(t.metadata.format=void 0),e.call(this,t);var n,a=this;if(a.defined[t.name])n=a.defined[t.name],n.declarative||(n.deps=n.deps.concat(t.metadata.deps)),n.deps=n.deps.concat(t.metadata.deps);else if(t.metadata.entry)n=t.metadata.entry,n.deps=n.deps.concat(t.metadata.deps);else if(!(a.builder&&t.metadata.bundle||"register"!=t.metadata.format&&"esm"!=t.metadata.format&&"es6"!=t.metadata.format)){if("undefined"!=typeof __exec&&__exec.call(a,t),!t.metadata.entry&&!t.metadata.bundle)throw new Error(t.name+" detected as "+t.metadata.format+" but didn't execute.");n=t.metadata.entry,n&&t.metadata.deps&&(n.deps=n.deps.concat(t.metadata.deps))}n||(n=g(),n.deps=t.metadata.deps,n.execute=function(){}),a.defined[t.name]=n;var o=c(n.deps);n.deps=o.names,n.originalIndices=o.indices,n.name=t.name,n.esmExports=t.metadata.esmExports!==!1;for(var s=[],i=0,d=n.deps.length;d>i;i++)s.push(Promise.resolve(a.normalize(n.deps[i],t.name)));return Promise.all(s).then(function(e){return n.normalizedDeps=e,{deps:n.deps,execute:function(){return r(t.name,n,a),p(t.name,n,[],a),n.esModule||(n.esModule=a.newModule(n.module.exports)),a.trace||(a.defined[t.name]=void 0),n.esModule}}})}})}(),function(){i(function(e){return function(){e.call(this),this.bundles={},this._loader.loadedBundles={}}}),s("locate",function(e){return function(t){var n=this,r=!1;if(!(t.name in n.defined))for(var a in n.bundles){for(var o=0;o 0) @@ -670,8 +665,6 @@ function logloads(loads) { if (abrupt) return; - console.assert(linkSet.loads.length == 0, 'loads cleared'); - linkSet.resolve(startingLoad); } @@ -680,7 +673,7 @@ function logloads(loads) { var loader = linkSet.loader; var requests; - checkError: + checkError: if (load) { if (linkSet.loads[0].name == load.name) { exc = addToError(exc, 'Error loading ' + load.name); @@ -714,7 +707,6 @@ function logloads(loads) { loader.loaderObj.failed.push(load); var linkIndex = indexOf.call(load.linkSets, linkSet); - console.assert(linkIndex != -1, 'link not present'); load.linkSets.splice(linkIndex, 1); if (load.linkSets.length == 0) { var globalLoadsIndex = indexOf.call(linkSet.loader.loads, load); @@ -746,7 +738,6 @@ function logloads(loads) { } // if not anonymous, add to the module table if (load.name) { - console.assert(!loader.modules[load.name] || loader.modules[load.name].module === load.module.module, 'load not in module table'); loader.modules[load.name] = load.module; } var loadIndex = indexOf.call(loader.loads, load); @@ -856,7 +847,7 @@ function logloads(loads) { var loader = this._loader; if (loader.modules[name]) return Promise.resolve(); - return loader.importPromises[name] || createImportPromise(this, name, new Promise(asyncStartLoadPartwayThrough({ + return (loader.importPromises[name] || createImportPromise(this, name, new Promise(asyncStartLoadPartwayThrough({ step: 'locate', loader: loader, moduleName: name, @@ -864,9 +855,11 @@ function logloads(loads) { moduleSource: undefined, moduleAddress: undefined })) - .then(function() { + .then(function(load) { delete loader.importPromises[name]; - })); + return load.module.module; + }))) + .then(function () {}); }, // 26.3.3.11 module: function(source, options) { @@ -976,7 +969,6 @@ function logloads(loads) { })(); var System; - // SystemJS Loader Class and Extension helpers function SystemJSLoader() { Loader.call(this); @@ -1053,7 +1045,7 @@ function applyPaths(loader, name) { if (p.indexOf('*') === -1) { if (name == p) return paths[p]; - + // support trailing / in paths rules else if (name.substr(0, p.length - 1) == p.substr(0, p.length - 1) && (name.length < p.length || name[p.length - 1] == p[p.length - 1]) && (paths[p][paths[p].length - 1] == '/' || paths[p] == '')) { return paths[p].substr(0, paths[p].length - 1) + (name.length > p.length ? (paths[p] && '/' || '') + name.substr(p.length) : ''); @@ -1207,7 +1199,7 @@ function extendPkgConfig(pkgCfgA, pkgCfgB, pkgName, loader, warnInvalidPropertie loader.depCache[dNormalized] = (loader.depCache[dNormalized] || []).concat(pkgCfgB.depCache[d]); } } - else if (warnInvalidProperties && indexOf.call(['browserConfig', 'nodeConfig', 'devConfig', 'productionConfig'], prop) == -1 && + else if (warnInvalidProperties && indexOf.call(['browserConfig', 'nodeConfig', 'devConfig', 'productionConfig'], prop) == -1 && (!pkgCfgB.hasOwnProperty || pkgCfgB.hasOwnProperty(prop))) { warn.call(loader, '"' + prop + '" is not a valid package configuration option in package ' + pkgName); } @@ -1229,7 +1221,7 @@ function setPkgConfig(loader, pkgName, cfg, prependConfig) { extendPkgConfig(pkg, prependConfig ? cfg : basePkg, pkgName, loader, prependConfig); extendPkgConfig(pkg, prependConfig ? basePkg : cfg, pkgName, loader, !prependConfig); } - + // main object becomes main map if (typeof pkg.main == 'object') { pkg.map = pkg.map || {}; @@ -1245,6 +1237,15 @@ function warn(msg) { if (this.warnings && typeof console != 'undefined' && console.warn) console.warn(msg); } + +function createInstantiate (load, result) { + load.metadata.entry = createEntry(); + load.metadata.entry.execute = function() { + return result; + } + load.metadata.entry.deps = []; + load.metadata.format = 'defined'; +} var absURLRegEx = /^([^\/]+:\/\/|\/)/; // Normalization with module names as absolute URLs @@ -1476,7 +1477,7 @@ SystemJSLoader.prototype.locate = function(load) { * * * The code here replicates the ES6 linking groups algorithm to ensure that - * circular ES6 compiled into System.register can work alongside circular AMD + * circular ES6 compiled into System.register can work alongside circular AMD * and CommonJS, identically to the actual ES6 loader. * */ @@ -1486,7 +1487,7 @@ SystemJSLoader.prototype.locate = function(load) { * Registry side table entries in loader.defined * Registry Entry Contains: * - name - * - deps + * - deps * - declare for declarative modules * - execute for dynamic modules, different to declarative execute on module * - executingRequire indicates require drives execution for circularity of dynamic modules @@ -1504,7 +1505,7 @@ SystemJSLoader.prototype.locate = function(load) { * For dynamic we track the es module with: * - esModule actual es module value * - esmExports whether to extend the esModule with named exports - * + * * Then for declarative only we track dynamic bindings with the 'module' records: * - name * - exports @@ -1549,7 +1550,7 @@ function createEntry() { * see https://github.com/ModuleLoader/es6-module-loader/wiki/System.register-Explained * * 2. System.registerDynamic for dynamic modules (3-4 params) - System.registerDynamic([name, ]deps, executingRequire, execute) - * the true or false statement + * the true or false statement * * this extension implements the linking algorithm for the two variations identical to the spec * allowing compiled ES6 circular references to work alongside AMD and CJS circular references. @@ -1568,7 +1569,7 @@ function createEntry() { return this.registerDynamic.apply(this, arguments); var entry = createEntry(); - // ideally wouldn't apply map config to bundle names but + // ideally wouldn't apply map config to bundle names but // dependencies go through map regardless so we can't restrict // could reconsider in shift to new spec entry.name = name && (this.decanonicalize || this.normalize).call(this, name); @@ -1654,17 +1655,17 @@ function createEntry() { for (var i = 0, l = entry.normalizedDeps.length; i < l; i++) { var depName = entry.normalizedDeps[i]; var depEntry = loader.defined[depName]; - + // not in the registry means already linked / ES6 if (!depEntry || depEntry.evaluated) continue; - + // now we know the entry is in our unlinked linkage group var depGroupIndex = entry.groupIndex + (depEntry.declarative != entry.declarative); // the group index of an entry is always the maximum if (depEntry.groupIndex === null || depEntry.groupIndex < depGroupIndex) { - + // if already in a group, remove from the old group if (depEntry.groupIndex !== null) { groups[depEntry.groupIndex].splice(indexOf.call(groups[depEntry.groupIndex], depEntry), 1); @@ -1704,7 +1705,7 @@ function createEntry() { else linkDynamicModule(entry, loader); } - curGroupDeclarative = !curGroupDeclarative; + curGroupDeclarative = !curGroupDeclarative; } } @@ -1764,7 +1765,7 @@ function createEntry() { // allowing undefined declaration was a mistake! To be deprecated. declaration = declaration || { setters: [], execute: function() {} }; - + module.setters = declaration.setters; module.execute = declaration.execute; @@ -1807,7 +1808,7 @@ function createEntry() { else { module.dependencies.push(null); } - + // run setters for all entries with the matching dependency name var originalIndices = entry.originalIndices[i]; for (var j = 0, len = originalIndices.length; j < len; ++j) { @@ -1833,7 +1834,7 @@ function createEntry() { else { if (entry.declarative) ensureEvaluated(name, entry, [], loader); - + else if (!entry.evaluated) linkDynamicModule(entry, loader); @@ -1842,7 +1843,7 @@ function createEntry() { if ((!entry || entry.declarative) && exports && exports.__useDefault) return exports['default']; - + return exports; } @@ -1880,7 +1881,7 @@ function createEntry() { throw new Error('Module ' + name + ' not declared as a dependency of ' + entry.name); }, exports, module); - + if (output !== undefined) module.exports = output; @@ -1904,7 +1905,7 @@ function createEntry() { * (unless one is a circular dependency already in the list of seen * modules, in which case we execute it) * - * Then we evaluate the module itself depth-first left to right + * Then we evaluate the module itself depth-first left to right * execution to match ES6 modules */ function ensureEvaluated(moduleName, entry, seen, loader) { @@ -1950,7 +1951,7 @@ function createEntry() { } load.metadata.deps = load.metadata.deps || []; - + return fetch.call(this, load); }; }); @@ -1961,7 +1962,7 @@ function createEntry() { load.metadata.deps = load.metadata.deps || []; return Promise.resolve(translate.apply(this, arguments)).then(function(source) { // run detection for register format - if (load.metadata.format == 'register' || !load.metadata.format && detectRegisterFormat(load.source)) + if (load.metadata.format == 'register' || load.metadata.format == 'system' || !load.metadata.format && detectRegisterFormat(load.source)) load.metadata.format = 'register'; return source; }); @@ -1979,7 +1980,7 @@ function createEntry() { entry.originalIndices = entry.normalizedDeps = []; - // recursively ensure that the module and all its + // recursively ensure that the module and all its // dependencies are linked (with dependency group handling) link(normalized, entry, loader); @@ -2030,9 +2031,9 @@ function createEntry() { // Contains System.register calls // (dont run bundles in the builder) - else if (!(loader.builder && load.metadata.bundle) + else if (!(loader.builder && load.metadata.bundle) && (load.metadata.format == 'register' || load.metadata.format == 'esm' || load.metadata.format == 'es6')) { - + if (typeof __exec != 'undefined') __exec.call(loader, load); @@ -2055,9 +2056,9 @@ function createEntry() { // place this module onto defined for circular references loader.defined[load.name] = entry; - + var grouped = group(entry.deps); - + entry.deps = grouped.names; entry.originalIndices = grouped.indices; entry.name = load.name; @@ -2075,7 +2076,7 @@ function createEntry() { return { deps: entry.deps, execute: function() { - // recursively ensure that the module and all its + // recursively ensure that the module and all its // dependencies are linked (with dependency group handling) link(load.name, entry, loader); @@ -2189,7 +2190,7 @@ hook('fetch', function(fetch) { });System = new SystemJSLoader(); __global.SystemJS = System; -System.version = '0.19.41 Register Only'; +System.version = '0.19.47 Register Only'; if (typeof module == 'object' && module.exports && typeof exports == 'object') module.exports = System; diff --git a/node_modules/systemjs/dist/system.js b/node_modules/systemjs/dist/system.js index 1b7c1f82f..171b0d3cb 100644 --- a/node_modules/systemjs/dist/system.js +++ b/node_modules/systemjs/dist/system.js @@ -1,6 +1,6 @@ /* - * SystemJS v0.19.41 + * SystemJS v0.19.47 */ -!function(){function e(){!function(e){function t(e,r){if("string"!=typeof e)throw new TypeError("URL must be a string");var n=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);if(!n)throw new RangeError("Invalid URL format");var a=n[1]||"",o=n[2]||"",i=n[3]||"",s=n[4]||"",l=n[5]||"",u=n[6]||"",d=n[7]||"",c=n[8]||"",f=n[9]||"";if(void 0!==r){var m=r instanceof t?r:new t(r),p=!a&&!s&&!o;!p||d||c||(c=m.search),p&&"/"!==d[0]&&(d=d?(!m.host&&!m.username||m.pathname?"":"/")+m.pathname.slice(0,m.pathname.lastIndexOf("/")+1)+d:m.pathname);var h=[];d.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?h.pop():h.push(e)}),d=h.join("").replace(/^\//,"/"===d[0]?"/":""),p&&(u=m.port,l=m.hostname,s=m.host,i=m.password,o=m.username),a||(a=m.protocol)}d=d.replace(/\\/g,"/"),this.origin=s?a+(""!==a||""!==s?"//":"")+s:"",this.href=a+(a&&s||"file:"==a?"//":"")+(""!==o?o+(""!==i?":"+i:"")+"@":"")+s+d+c+f,this.protocol=a,this.username=o,this.password=i,this.host=s,this.hostname=l,this.port=u,this.pathname=d,this.search=c,this.hash=f}e.URLPolyfill=t}("undefined"!=typeof self?self:global),function(e){function t(e,t){if(!e.originalErr)for(var r=((e.message||e)+(e.stack?"\n"+e.stack:"")).toString().split("\n"),n=[],a=0;as.length?(o[s]&&"/"||"")+t.substr(s.length):"")}else{var d=s.split("*");if(d.length>2)throw new TypeError("Only one wildcard in a path is permitted");var f=d[0].length;f>=a&&t.substr(0,d[0].length)==d[0]&&t.substr(t.length-d[1].length)==d[1]&&(a=f,n=s,r=t.substr(d[0].length,t.length-d[1].length-d[0].length))}}var m=o[n];return"string"==typeof r&&(m=m.replace("*",r)),m}function m(e){for(var t=[],r=[],n=0,a=e.length;n",linkSets:[],dependencies:[],metadata:{}}}function a(e,t,r){return new Promise(u({step:r.address?"fetch":"locate",loader:e,moduleName:t,moduleMetadata:r&&r.metadata||{},moduleSource:r.source,moduleAddress:r.address}))}function o(t,r,n,a){return new Promise(function(e,o){e(t.loaderObj.normalize(r,n,a))}).then(function(r){var n;if(t.modules[r])return n=e(r),n.status="linked",n.module=t.modules[r],n;for(var a=0,o=t.loads.length;a0)){var r=e.startingLoad;if(e.loader.loaderObj.execute===!1){for(var n=[].concat(e.loads),a=0,o=n.length;a "'+n.paths[o]+'" uses wildcards which are being deprecated for just leaving a trailing "/" to indicate folder paths.')}if(e.defaultJSExtensions&&(n.defaultJSExtensions=e.defaultJSExtensions,w.call(n,"The defaultJSExtensions configuration option is deprecated, use packages configuration instead.")),e.pluginFirst&&(n.pluginFirst=e.pluginFirst),e.map)for(var o in e.map){var i=e.map[o];if("string"!=typeof i){var s=n.defaultJSExtensions&&".js"!=o.substr(o.length-3,3),l=n.decanonicalize(o);s&&".js"==l.substr(l.length-3,3)&&(l=l.substr(0,l.length-3));var u="";for(var c in n.packages)l.substr(0,c.length)==c&&(!l[c.length]||"/"==l[c.length])&&u.split("/").lengtha&&(r=o,a=n));return r}function t(e,t,r,n,a){if(!n||"/"==n[n.length-1]||a||t.defaultExtension===!1)return n;var o=!1;if(t.meta&&p(t.meta,n,function(e,t,r){if(0==r||e.lastIndexOf("*")!=e.length-1)return o=!0}),!o&&e.meta&&p(e.meta,r+"/"+n,function(e,t,r){if(0==r||e.lastIndexOf("*")!=e.length-1)return o=!0}),o)return n;var i="."+(t.defaultExtension||"js");return n.substr(n.length-i.length)!=i?n+i:n}function r(e,r,n,a,i){if(!a){if(!r.main)return n+(e.defaultJSExtensions?".js":"");a="./"==r.main.substr(0,2)?r.main.substr(2):r.main}if(r.map){var s="./"+a,l=S(r.map,s);if(l||(s="./"+t(e,r,n,a,i),s!="./"+a&&(l=S(r.map,s))),l){var u=o(e,r,n,l,s,i);if(u)return u}}return n+"/"+t(e,r,n,a,i)}function n(e,t,r,n){if("."==e)throw new Error("Package "+r+' has a map entry for "." which is not permitted.');return!(t.substr(0,e.length)==e&&n.length>e.length)}function o(e,r,a,o,i,s){"/"==i[i.length-1]&&(i=i.substr(0,i.length-1));var l=r.map[o];if("object"==typeof l)throw new Error("Synchronous conditional normalization not supported sync normalizing "+o+" in "+a);if(n(o,l,a,i)&&"string"==typeof l){if("."==l)l=a;else if("./"==l.substr(0,2))return a+"/"+t(e,r,a,l.substr(2)+i.substr(o.length),s);return e.normalizeSync(l+i.substr(o.length),a+"/")}}function l(e,r,n,a,o){if(!a){if(!r.main)return Promise.resolve(n+(e.defaultJSExtensions?".js":""));a="./"==r.main.substr(0,2)?r.main.substr(2):r.main}var i,s;return r.map&&(i="./"+a,s=S(r.map,i),s||(i="./"+t(e,r,n,a,o),i!="./"+a&&(s=S(r.map,i)))),(s?d(e,r,n,s,i,o):Promise.resolve()).then(function(i){return i?Promise.resolve(i):Promise.resolve(n+"/"+t(e,r,n,a,o))})}function u(e,r,n,a,o,i,s){if("."==o)o=n;else if("./"==o.substr(0,2))return Promise.resolve(n+"/"+t(e,r,n,o.substr(2)+i.substr(a.length),s)).then(function(t){return C.call(e,t,n+"/")});return e.normalize(o+i.substr(a.length),n+"/")}function d(e,t,r,a,o,i){"/"==o[o.length-1]&&(o=o.substr(0,o.length-1));var s=t.map[a];if("string"==typeof s)return n(a,s,r,o)?u(e,t,r,a,s,o,i):Promise.resolve();if(e.builder)return Promise.resolve(r+"/#:"+o);var l=[],d=[];for(var c in s){var f=z(c);d.push({condition:f,map:s[c]}),l.push(e.import(f.module,r))}return Promise.all(l).then(function(e){for(var t=0;tl&&(l=r),v(s,t,r&&l>r)}),v(r.metadata,s)}o.format&&!r.metadata.loader&&(r.metadata.format=r.metadata.format||o.format)}return t})}})}(),function(){function t(){if(s&&"interactive"===s.script.readyState)return s.load;for(var e=0;e=0;i--){for(var s=a[i],l=0;l100&&!i.metadata.format&&(i.metadata.format="global","traceur"===s.transpiler&&(i.metadata.exports="traceur"),"typescript"===s.transpiler&&(i.metadata.exports="ts")),s._loader.loadedTranspiler=!0),s._loader.loadedTranspilerRuntime===!1&&(i.name!=s.normalizeSync("traceur-runtime")&&i.name!=s.normalizeSync("babel/external-helpers*")||(o.length>100&&(i.metadata.format=i.metadata.format||"global"),s._loader.loadedTranspilerRuntime=!0)),("register"==i.metadata.format||i.metadata.bundle)&&s._loader.loadedTranspilerRuntime!==!0){if("traceur"==s.transpiler&&!e.$traceurRuntime&&i.source.match(n))return s._loader.loadedTranspilerRuntime=s._loader.loadedTranspilerRuntime||!1,s.import("traceur-runtime").then(function(){return o});if("babel"==s.transpiler&&!e.babelHelpers&&i.source.match(a))return s._loader.loadedTranspilerRuntime=s._loader.loadedTranspilerRuntime||!1,s.import("babel/external-helpers").then(function(){return o})}return o})}})}();var ie="undefined"!=typeof self?"self":"global";i("fetch",function(e){return function(t){return t.metadata.exports&&!t.metadata.format&&(t.metadata.format="global"),e.call(this,t)}}),i("instantiate",function(e){return function(t){var r=this;if(t.metadata.format||(t.metadata.format="global"),"global"==t.metadata.format&&!t.metadata.entry){var n=k();t.metadata.entry=n,n.deps=[];for(var a in t.metadata.globals){var o=t.metadata.globals[a];o&&n.deps.push(o)}n.execute=function(e,n,a){var o;if(t.metadata.globals){o={};for(var i in t.metadata.globals)t.metadata.globals[i]&&(o[i]=e(t.metadata.globals[i]))}var s=t.metadata.exports;s&&(t.source+="\n"+ie+'["'+s+'"] = '+s+";");var l=r.get("@@global-helpers").prepareGlobal(a.id,s,o,!!t.metadata.encapsulateGlobal);return ee.call(r,t),l()}}return e.call(this,t)}}),i("reduceRegister_",function(e){return function(t,r){if(r||!t.metadata.exports&&(!A||"global"!=t.metadata.format))return e.call(this,t,r);t.metadata.format="global";var n=t.metadata.entry=k();n.deps=t.metadata.deps;var a=R(t.metadata.exports);n.execute=function(){return a}}}),s(function(t){return function(){function r(t){if(Object.keys)Object.keys(e).forEach(t);else for(var r in e)i.call(e,r)&&t(r)}function n(t){r(function(r){if(U.call(s,r)==-1){try{var n=e[r]}catch(e){s.push(r)}t(r,n)}})}var a=this;t.call(a);var o,i=Object.prototype.hasOwnProperty,s=["_g","sessionStorage","localStorage","clipboardData","frames","frameElement","external","mozAnimationStartTime","webkitStorageInfo","webkitIndexedDB","mozInnerScreenY","mozInnerScreenX"];a.set("@@global-helpers",a.newModule({prepareGlobal:function(t,r,a,i){var s=e.define;e.define=void 0;var l;if(a){l={};for(var u in a)l[u]=e[u],e[u]=a[u]}return r||(o={},n(function(e,t){o[e]=t})),function(){var t,a=r?R(r):{},u=!!r;if(r&&!i||n(function(n,s){o[n]!==s&&"undefined"!=typeof s&&(i&&(e[n]=void 0),r||(a[n]=s,"undefined"!=typeof t?u||t===s||(u=!0):t=s))}),a=u?a:t,l)for(var d in l)e[d]=l[d];return e.define=s,a}}}))}}),function(){function t(e){function t(e,t){for(var r=0;rt.index)return!0;return!1}n.lastIndex=a.lastIndex=o.lastIndex=0;var r,i=[],s=[],l=[];if(e.length/e.split("\n").length<200){for(;r=o.exec(e);)s.push([r.index,r.index+r[0].length]);for(;r=a.exec(e);)t(s,r)||l.push([r.index+r[1].length,r.index+r[0].length-1])}for(;r=n.exec(e);)if(!t(s,r)&&!t(l,r)){var u=r[1].substr(1,r[1].length-2);if(u.match(/"|'/))continue;"/"==u[u.length-1]&&(u=u.substr(0,u.length-1)),i.push(u)}return i}var r=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF.])(exports\s*(\[['"]|\.)|module(\.exports|\['exports'\]|\["exports"\])\s*(\[['"]|[=,\.]))/,n=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF."'])require\s*\(\s*("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')\s*\)/g,a=/(^|[^\\])(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,o=/("[^"\\\n\r]*(\\.[^"\\\n\r]*)*"|'[^'\\\n\r]*(\\.[^'\\\n\r]*)*')/g,s=/^\#\!.*/;i("instantiate",function(a){return function(o){var i=this;if(o.metadata.format||(r.lastIndex=0,n.lastIndex=0,(n.exec(o.source)||r.exec(o.source))&&(o.metadata.format="cjs")),"cjs"==o.metadata.format){var l=o.metadata.deps,u=o.metadata.cjsRequireDetection===!1?[]:t(o.source);for(var d in o.metadata.globals)o.metadata.globals[d]&&u.push(o.metadata.globals[d]);var c=k();o.metadata.entry=c,c.deps=u,c.executingRequire=!0,c.execute=function(t,r,n){function a(e){return"/"==e[e.length-1]&&(e=e.substr(0,e.length-1)),t.apply(this,arguments)}if(a.resolve=function(e){return i.get("@@cjs-helpers").requireResolve(e,n.id)},n.paths=[],n.require=t,!o.metadata.cjsDeferDepsExecute)for(var u=0;u1;)n=a.shift(),e=e[n]=e[n]||{};n=a.shift(),n in e||(e[n]=r)}s(function(e){return function(){this.meta={},e.call(this)}}),i("locate",function(e){return function(t){var r,n=this.meta,a=t.name,o=0;for(var i in n)if(r=i.indexOf("*"),r!==-1&&i.substr(0,r)===a.substr(0,r)&&i.substr(r+1)===a.substr(a.length-i.length+r+1)){var s=i.split("/").length;s>o&&(o=s),v(t.metadata,n[i],o!=s)}return n[a]&&v(t.metadata,n[a]),e.call(this,t)}});var t=/^(\s*\/\*[^\*]*(\*(?!\/)[^\*]*)*\*\/|\s*\/\/[^\n]*|\s*"[^"]+"\s*;?|\s*'[^']+'\s*;?)+/,r=/\/\*[^\*]*(\*(?!\/)[^\*]*)*\*\/|\/\/[^\n]*|"[^"]+"\s*;?|'[^']+'\s*;?/g;i("translate",function(n){return function(a){if("defined"==a.metadata.format)return a.metadata.deps=a.metadata.deps||[],Promise.resolve(a.source);var o=a.source.match(t);if(o)for(var i=o[0].match(r),s=0;s')}else e()}else if("undefined"!=typeof importScripts){var a="";try{throw new Error("_")}catch(e){e.stack.replace(/(?:at|@).*(http.+):[\d]+:[\d]+/,function(e,t){$__curScript={src:t},a=t.replace(/\/[^\/]*$/,"/")})}t&&importScripts(a+"system-polyfills.js"),e()}else $__curScript="undefined"!=typeof __filename?{src:__filename}:null,e()}(); +!function(){function e(){!function(e){function t(e,r){if("string"!=typeof e)throw new TypeError("URL must be a string");var n=String(e).replace(/^\s+|\s+$/g,"").replace(/\\/g,"/").match(/^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);if(!n)throw new RangeError("Invalid URL format");var a=n[1]||"",o=n[2]||"",i=n[3]||"",s=n[4]||"",l=n[5]||"",u=n[6]||"",d=n[7]||"",c=n[8]||"",f=n[9]||"";if(void 0!==r){var m=r instanceof t?r:new t(r),p=!a&&!s&&!o;!p||d||c||(c=m.search),p&&"/"!==d[0]&&(d=d?(!m.host&&!m.username||m.pathname?"":"/")+m.pathname.slice(0,m.pathname.lastIndexOf("/")+1)+d:m.pathname);var h=[];d.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?h.pop():h.push(e)}),d=h.join("").replace(/^\//,"/"===d[0]?"/":""),p&&(u=m.port,l=m.hostname,s=m.host,i=m.password,o=m.username),a||(a=m.protocol)}d=d.replace(/\\/g,"/"),this.origin=s?a+(""!==a||""!==s?"//":"")+s:"",this.href=a+(a&&s||"file:"==a?"//":"")+(""!==o?o+(""!==i?":"+i:"")+"@":"")+s+d+c+f,this.protocol=a,this.username=o,this.password=i,this.host=s,this.hostname=l,this.port=u,this.pathname=d,this.search=c,this.hash=f}e.URLPolyfill=t}("undefined"!=typeof self?self:global),function(e){function t(e,t){if(!e.originalErr)for(var r=((e.message||e)+(e.stack?"\n"+e.stack:"")).toString().split("\n"),n=[],a=0;as.length?(o[s]&&"/"||"")+t.substr(s.length):"")}else{var d=s.split("*");if(d.length>2)throw new TypeError("Only one wildcard in a path is permitted");var f=d[0].length;f>=a&&t.substr(0,d[0].length)==d[0]&&t.substr(t.length-d[1].length)==d[1]&&(a=f,n=s,r=t.substr(d[0].length,t.length-d[1].length-d[0].length))}}var m=o[n];return"string"==typeof r&&(m=m.replace("*",r)),m}function m(e){for(var t=[],r=[],n=0,a=e.length;a>n;n++){var o=$.call(t,e[n]);-1===o?(t.push(e[n]),r.push([n])):r[o].push(n)}return{names:t,indices:r}}function p(t){var r={};if(("object"==typeof t||"function"==typeof t)&&t!==e)if(te)for(var n in t)"default"!==n&&h(r,t,n);else g(r,t);return r["default"]=t,U(r,"__useDefault",{value:!0}),r}function h(e,t,r){try{var n;(n=Object.getOwnPropertyDescriptor(t,r))&&U(e,r,n)}catch(a){return e[r]=t[r],!1}}function g(e,t,r){var n=t&&t.hasOwnProperty;for(var a in t)(!n||t.hasOwnProperty(a))&&(r&&a in e||(e[a]=t[a]));return e}function v(e,t,r){var n=t&&t.hasOwnProperty;for(var a in t)if(!n||t.hasOwnProperty(a)){var o=t[a];a in e?o instanceof Array&&e[a]instanceof Array?e[a]=[].concat(r?o:e[a]).concat(r?e[a]:o):"object"==typeof o&&null!==o&&"object"==typeof e[a]?e[a]=g(g({},e[a]),o,r):r||(e[a]=o):e[a]=o}}function y(e,t,r,n,a){for(var o in t)if(-1!=$.call(["main","format","defaultExtension","basePath"],o))e[o]=t[o];else if("map"==o)g(e.map=e.map||{},t.map);else if("meta"==o)g(e.meta=e.meta||{},t.meta);else if("depCache"==o)for(var i in t.depCache){var s;s="./"==i.substr(0,2)?r+"/"+i.substr(2):M.call(n,i),n.depCache[s]=(n.depCache[s]||[]).concat(t.depCache[i])}else!a||-1!=$.call(["browserConfig","nodeConfig","devConfig","productionConfig"],o)||t.hasOwnProperty&&!t.hasOwnProperty(o)||w.call(n,'"'+o+'" is not a valid package configuration option in package '+r)}function b(e,t,r,n){var a;if(e.packages[t]){var o=e.packages[t];a=e.packages[t]={},y(a,n?r:o,t,e,n),y(a,n?o:r,t,e,!n)}else a=e.packages[t]=r;return"object"==typeof a.main&&(a.map=a.map||{},a.map["./@main"]=a.main,a.main["default"]=a.main["default"]||"./",a.main="@main"),a}function w(e){this.warnings&&"undefined"!=typeof console&&console.warn&&console.warn(e)}function x(e,t){e.metadata.entry=R(),e.metadata.entry.execute=function(){return t},e.metadata.entry.deps=[],e.metadata.format="defined"}function S(e,t){for(var r=e.split(".");r.length;)t=t[r.shift()];return t}function _(e,t){var r,n=0;for(var a in e)if(t.substr(0,a.length)==a&&(t.length==a.length||"/"==t[a.length])){var o=a.split("/").length;if(n>=o)continue;r=a,n=o}return r}function E(e){this._loader.baseURL!==this.baseURL&&("/"!=this.baseURL[this.baseURL.length-1]&&(this.baseURL+="/"),this._loader.baseURL=this.baseURL=new G(this.baseURL,ee).href)}function j(e,t){this.set("@system-env",ne=this.newModule({browser:D,node:!!this._nodeRequire,production:!t&&e,dev:t||!e,build:t,"default":!0}))}function P(e,t){if(!d(e))throw new Error("Node module "+e+" can't be loaded as it is not a package require.");if(!ae){var r=this._nodeRequire("module"),n=t.substr(q?8:7);ae=new r(n),ae.paths=r._nodeModulePaths(n)}return ae.require(e)}function M(e,t){if(u(e))return c(e,t);if(l(e))return e;var r=_(this.map,e);if(r){if(e=this.map[r]+e.substr(r.length),u(e))return c(e);if(l(e))return e}if(this.has(e))return e;if("@node/"==e.substr(0,6)){if(!this._nodeRequire)throw new TypeError("Error loading "+e+". Can only load node core modules in Node.");return this.builder?this.set(e,this.newModule({})):this.set(e,this.newModule(p(P.call(this,e.substr(6),this.baseURL)))),e}return E.call(this),f(this,e)||this.baseURL+e}function O(e,t,r){ne.browser&&t.browserConfig&&r(t.browserConfig),ne.node&&t.nodeConfig&&r(t.nodeConfig),ne.dev&&t.devConfig&&r(t.devConfig),ne.build&&t.buildConfig&&r(t.buildConfig),ne.production&&t.productionConfig&&r(t.productionConfig)}function k(e){var t=e.match(se);return t&&"System.register"==e.substr(t[0].length,15)}function R(){return{name:null,deps:null,originalIndices:null,declare:null,execute:null,executingRequire:!1,declarative:!1,normalizedDeps:null,groupIndex:null,evaluated:!1,module:null,esModule:null,esmExports:!1}}function z(t){if("string"==typeof t)return S(t,e);if(!(t instanceof Array))throw new Error("Global exports must be a string or array.");for(var r={},n=!0,a=0;at;t++)if(this[t]===e)return t;return-1};!function(){try{Object.defineProperty({},"a",{})&&(U=Object.defineProperty)}catch(e){U=function(e,t,r){try{e[t]=r.value||r.get.call(e)}catch(n){}}}}();var J,N="_"==new Error(0,"_").fileName;if("undefined"!=typeof document&&document.getElementsByTagName){if(J=document.baseURI,!J){var B=document.getElementsByTagName("base");J=B[0]&&B[0].href||window.location.href}}else"undefined"!=typeof location&&(J=e.location.href);if(J)J=J.split("#")[0].split("?")[0],J=J.substr(0,J.lastIndexOf("/")+1);else{if("undefined"==typeof process||!process.cwd)throw new TypeError("No environment baseURI");J="file://"+(q?"/":"")+process.cwd()+"/",q&&(J=J.replace(/\\/g,"/"))}try{var H="test:"==new e.URL("test:///").protocol}catch(X){}var G=H?e.URL:e.URLPolyfill;U(r.prototype,"toString",{value:function(){return"Module"}}),function(){function e(e){return{status:"loading",name:e||"",linkSets:[],dependencies:[],metadata:{}}}function a(e,t,r){return new Promise(u({step:r.address?"fetch":"locate",loader:e,moduleName:t,moduleMetadata:r&&r.metadata||{},moduleSource:r.source,moduleAddress:r.address}))}function o(t,r,n,a){return new Promise(function(e,o){e(t.loaderObj.normalize(r,n,a))}).then(function(r){var n;if(t.modules[r])return n=e(r),n.status="linked",n.module=t.modules[r],n;for(var a=0,o=t.loads.length;o>a;a++)if(n=t.loads[a],n.name==r)return n;return n=e(r),t.loads.push(n),i(t,n),n})}function i(e,t){s(e,t,Promise.resolve().then(function(){return e.loaderObj.locate({name:t.name,metadata:t.metadata})}))}function s(e,t,r){l(e,t,r.then(function(r){return"loading"==t.status?(t.address=r,e.loaderObj.fetch({name:t.name,metadata:t.metadata,address:r})):void 0}))}function l(e,t,r){r.then(function(r){return"loading"==t.status?(t.address=t.address||t.name,Promise.resolve(e.loaderObj.translate({name:t.name,metadata:t.metadata,address:t.address,source:r})).then(function(r){return t.source=r,e.loaderObj.instantiate({name:t.name,metadata:t.metadata,address:t.address,source:r})}).then(function(e){if(void 0===e)throw new TypeError("Declarative modules unsupported in the polyfill.");if("object"!=typeof e)throw new TypeError("Invalid instantiate return value");t.depsList=e.deps||[],t.execute=e.execute}).then(function(){t.dependencies=[];for(var r=t.depsList,n=[],a=0,i=r.length;i>a;a++)(function(r,a){n.push(o(e,r,t.name,t.address).then(function(e){if(t.dependencies[a]={key:r,value:e.name},"linked"!=e.status)for(var n=t.linkSets.concat([]),o=0,i=n.length;i>o;o++)c(n[o],e)}))})(r[a],a);return Promise.all(n)}).then(function(){t.status="loaded";for(var e=t.linkSets.concat([]),r=0,n=e.length;n>r;r++)m(e[r],t)})):void 0})["catch"](function(e){t.status="failed",t.exception=e;for(var r=t.linkSets.concat([]),n=0,a=r.length;a>n;n++)p(r[n],t,e)})}function u(t){return function(r,n){var a=t.loader,o=t.moduleName,u=t.step;if(a.modules[o])throw new TypeError('"'+o+'" already exists in the module table');for(var c,f=0,m=a.loads.length;m>f;f++)if(a.loads[f].name==o&&(c=a.loads[f],"translate"!=u||c.source||(c.address=t.moduleAddress,l(a,c,Promise.resolve(t.moduleSource))),c.linkSets.length&&c.linkSets[0].loads[0].name==c.name))return c.linkSets[0].done.then(function(){r(c)});var p=c||e(o);p.metadata=t.moduleMetadata;var h=d(a,p);a.loads.push(p),r(h.done),"locate"==u?i(a,p):"fetch"==u?s(a,p,Promise.resolve(t.moduleAddress)):(p.address=t.moduleAddress,l(a,p,Promise.resolve(t.moduleSource)))}}function d(e,t){var r={loader:e,loads:[],startingLoad:t,loadingCount:0};return r.done=new Promise(function(e,t){r.resolve=e,r.reject=t}),c(r,t),r}function c(e,t){if("failed"!=t.status){for(var r=0,n=e.loads.length;n>r;r++)if(e.loads[r]==t)return;e.loads.push(t),t.linkSets.push(e),"loaded"!=t.status&&e.loadingCount++;for(var a=e.loader,r=0,n=t.dependencies.length;n>r;r++)if(t.dependencies[r]){var o=t.dependencies[r].value;if(!a.modules[o])for(var i=0,s=a.loads.length;s>i;i++)if(a.loads[i].name==o){c(e,a.loads[i]);break}}}}function f(e){var t=!1;try{y(e,function(r,n){p(e,r,n),t=!0})}catch(r){p(e,null,r),t=!0}return t}function m(e,t){if(e.loadingCount--,!(e.loadingCount>0)){var r=e.startingLoad;if(e.loader.loaderObj.execute===!1){for(var n=[].concat(e.loads),a=0,o=n.length;o>a;a++){var t=n[a];t.module={name:t.name,module:w({}),evaluated:!0},t.status="linked",h(e.loader,t)}return e.resolve(r)}var i=f(e);i||e.resolve(r)}}function p(e,r,n){var a=e.loader;e:if(r)if(e.loads[0].name==r.name)n=t(n,"Error loading "+r.name);else{for(var o=0;oo;o++){var r=u[o];a.loaderObj.failed=a.loaderObj.failed||[],-1==$.call(a.loaderObj.failed,r)&&a.loaderObj.failed.push(r);var c=$.call(r.linkSets,e);if(r.linkSets.splice(c,1),0==r.linkSets.length){var f=$.call(e.loader.loads,r);-1!=f&&e.loader.loads.splice(f,1)}}e.reject(n)}function h(e,t){if(e.loaderObj.trace){e.loaderObj.loads||(e.loaderObj.loads={});var r={};t.dependencies.forEach(function(e){r[e.key]=e.value}),e.loaderObj.loads[t.name]={name:t.name,deps:t.dependencies.map(function(e){return e.key}),depMap:r,address:t.address,metadata:t.metadata,source:t.source}}t.name&&(e.modules[t.name]=t.module);var n=$.call(e.loads,t);-1!=n&&e.loads.splice(n,1);for(var a=0,o=t.linkSets.length;o>a;a++)n=$.call(t.linkSets[a].loads,t),-1!=n&&t.linkSets[a].loads.splice(n,1);t.linkSets.splice(0,t.linkSets.length)}function g(e,t,n){try{var a=t.execute()}catch(o){return void n(t,o)}return a&&a instanceof r?a:void n(t,new TypeError("Execution must define a Module instance"))}function v(e,t,r){var n=e._loader.importPromises;return n[t]=r.then(function(e){return n[t]=void 0,e},function(e){throw n[t]=void 0,e})}function y(e,t){var r=e.loader;if(e.loads.length)for(var n=e.loads.concat([]),a=0;a "'+n.paths[o]+'" uses wildcards which are being deprecated for just leaving a trailing "/" to indicate folder paths.')}if(e.defaultJSExtensions&&(n.defaultJSExtensions=e.defaultJSExtensions,w.call(n,"The defaultJSExtensions configuration option is deprecated, use packages configuration instead.")),e.pluginFirst&&(n.pluginFirst=e.pluginFirst),e.map)for(var o in e.map){var i=e.map[o];if("string"!=typeof i){var s=n.defaultJSExtensions&&".js"!=o.substr(o.length-3,3),l=n.decanonicalize(o);s&&".js"==l.substr(l.length-3,3)&&(l=l.substr(0,l.length-3));var u="";for(var c in n.packages)l.substr(0,c.length)==c&&(!l[c.length]||"/"==l[c.length])&&u.split("/").lengtha&&(r=o,a=n));return r}function t(e,t,r,n,a){if(!n||"/"==n[n.length-1]||a||t.defaultExtension===!1)return n;var o=!1;if(t.meta&&p(t.meta,n,function(e,t,r){return 0==r||e.lastIndexOf("*")!=e.length-1?o=!0:void 0}),!o&&e.meta&&p(e.meta,r+"/"+n,function(e,t,r){return 0==r||e.lastIndexOf("*")!=e.length-1?o=!0:void 0}),o)return n;var i="."+(t.defaultExtension||"js");return n.substr(n.length-i.length)!=i?n+i:n}function r(e,r,n,a,i){if(!a){if(!r.main)return n+(e.defaultJSExtensions?".js":"");a="./"==r.main.substr(0,2)?r.main.substr(2):r.main}if(r.map){var s="./"+a,l=_(r.map,s);if(l||(s="./"+t(e,r,n,a,i),s!="./"+a&&(l=_(r.map,s))),l){var u=o(e,r,n,l,s,i);if(u)return u}}return n+"/"+t(e,r,n,a,i)}function n(e,t,r,n){if("."==e)throw new Error("Package "+r+' has a map entry for "." which is not permitted.');return t.substr(0,e.length)==e&&n.length>e.length?!1:!0}function o(e,r,a,o,i,s){"/"==i[i.length-1]&&(i=i.substr(0,i.length-1));var l=r.map[o];if("object"==typeof l)throw new Error("Synchronous conditional normalization not supported sync normalizing "+o+" in "+a);if(n(o,l,a,i)&&"string"==typeof l){if("."==l)l=a;else if("./"==l.substr(0,2))return a+"/"+t(e,r,a,l.substr(2)+i.substr(o.length),s);return e.normalizeSync(l+i.substr(o.length),a+"/")}}function l(e,r,n,a,o){if(!a){if(!r.main)return Promise.resolve(n+(e.defaultJSExtensions?".js":""));a="./"==r.main.substr(0,2)?r.main.substr(2):r.main}var i,s;return r.map&&(i="./"+a,s=_(r.map,i),s||(i="./"+t(e,r,n,a,o),i!="./"+a&&(s=_(r.map,i)))),(s?d(e,r,n,s,i,o):Promise.resolve()).then(function(i){return i?Promise.resolve(i):Promise.resolve(n+"/"+t(e,r,n,a,o))})}function u(e,r,n,a,o,i,s){if("."==o)o=n;else if("./"==o.substr(0,2))return Promise.resolve(n+"/"+t(e,r,n,o.substr(2)+i.substr(a.length),s)).then(function(t){return C.call(e,t,n+"/")});return e.normalize(o+i.substr(a.length),n+"/")}function d(e,t,r,a,o,i){"/"==o[o.length-1]&&(o=o.substr(0,o.length-1));var s=t.map[a];if("string"==typeof s)return n(a,s,r,o)?u(e,t,r,a,s,o,i):Promise.resolve();if(e.builder)return Promise.resolve(r+"/#:"+o);var l=[],d=[];for(var c in s){var f=I(c);d.push({condition:f,map:s[c]}),l.push(e["import"](f.module,r))}return Promise.all(l).then(function(e){for(var t=0;tl&&(l=r),v(s,t,r&&l>r)}),v(r.metadata,s)}o.format&&!r.metadata.loader&&(r.metadata.format=r.metadata.format||o.format)}return t})}})}(),function(){function t(){if(s&&"interactive"===s.script.readyState)return s.load;for(var e=0;ea;a++){var i=e.normalizedDeps[a],s=r.defined[i];if(s&&!s.evaluated){var l=e.groupIndex+(s.declarative!=e.declarative);if(null===s.groupIndex||s.groupIndex=0;i--){for(var s=a[i],l=0;ln;n++){var s=a.importers[n];if(!s.locked){var l=$.call(s.dependencies,a),u=s.setters[l];u&&u(o)}}return a.locked=!1,t},{id:t.name});if("function"==typeof i&&(i={setters:[],execute:i}),i=i||{setters:[],execute:function(){}},a.setters=i.setters,a.execute=i.execute,!a.setters||!a.execute)throw new TypeError("Invalid System.register form for "+t.name);for(var s=0,d=t.normalizedDeps.length;d>s;s++){var c,f=t.normalizedDeps[s],m=r.defined[f],p=n[f];p?c=p.exports:m&&!m.declarative?c=m.esModule:m?(u(m,r),p=m.module,c=p.exports):c=r.get(f),p&&p.importers?(p.importers.push(a),a.dependencies.push(p)):a.dependencies.push(null);for(var h=t.originalIndices[s],g=0,v=h.length;v>g;++g){var y=h[g];a.setters[y]&&a.setters[y](c)}}}}function d(e,t){var r,n=t.defined[e];if(n)n.declarative?f(e,n,[],t):n.evaluated||c(n,t),r=n.module.exports;else if(r=t.get(e),!r)throw new Error("Unable to load dependency "+e+".");return(!n||n.declarative)&&r&&r.__useDefault?r["default"]:r}function c(t,n){if(!t.module){var a={},o=t.module={exports:a,id:t.name};if(!t.executingRequire)for(var i=0,s=t.normalizedDeps.length;s>i;i++){var l=t.normalizedDeps[i],u=n.defined[l];u&&c(u,n)}t.evaluated=!0;var f=t.execute.call(e,function(e){for(var r=0,a=t.deps.length;a>r;r++)if(t.deps[r]==e)return d(t.normalizedDeps[r],n);var o=n.normalizeSync(e,t.name);if(-1!=$.call(t.normalizedDeps,o))return d(o,n);throw new Error("Module "+e+" not declared as a dependency of "+t.name)},a,o);void 0!==f&&(o.exports=f),a=o.exports,a&&(a.__esModule||a instanceof r)?t.esModule=n.newModule(a):t.esmExports&&a!==e?t.esModule=n.newModule(p(a)):t.esModule=n.newModule({"default":a,__useDefault:!0})}}function f(t,r,n,a){if(r&&!r.evaluated&&r.declarative){n.push(t);for(var o=0,i=r.normalizedDeps.length;i>o;o++){var s=r.normalizedDeps[o];-1==$.call(n,s)&&(a.defined[s]?f(s,a.defined[s],n,a):a.get(s))}r.evaluated||(r.evaluated=!0,r.module.execute.call(e))}}a.prototype.register=function(e,t,r){if("string"!=typeof e&&(r=t,t=e,e=null),"boolean"==typeof r)return this.registerDynamic.apply(this,arguments);var n=R();n.name=e&&(this.decanonicalize||this.normalize).call(this,e),n.declarative=!0,n.deps=t,n.declare=r,this.pushRegister_({amd:!1,entry:n})},a.prototype.registerDynamic=function(e,t,r,n){"string"!=typeof e&&(n=r,r=t,t=e,e=null);var a=R();a.name=e&&(this.decanonicalize||this.normalize).call(this,e),a.deps=t,a.execute=n,a.executingRequire=r,this.pushRegister_({amd:!1,entry:a})},i("reduceRegister_",function(){return function(e,t){if(t){var r=t.entry,n=e&&e.metadata;if(r.name&&(r.name in this.defined||(this.defined[r.name]=r),n&&(n.bundle=!0)),!r.name||e&&!n.entry&&r.name==e.name){if(!n)throw new TypeError("Invalid System.register call. Anonymous System.register calls can only be made by modules loaded by SystemJS.import and not via script tags.");if(n.entry)throw"register"==n.format?new Error("Multiple anonymous System.register calls in module "+e.name+". If loading a bundle, ensure all the System.register calls are named."):new Error("Module "+e.name+" interpreted as "+n.format+" module format, but called System.register.");n.format||(n.format="register"),n.entry=r}}}}),s(function(e){return function(){e.call(this),this.defined={},this._loader.moduleRecords={}}}),U(o,"toString",{value:function(){return"Module"}}),i("delete",function(e){return function(t){return delete this._loader.moduleRecords[t],delete this.defined[t],e.call(this,t)}}),i("fetch",function(e){return function(t){return this.defined[t.name]?(t.metadata.format="defined",""):(t.metadata.deps=t.metadata.deps||[],e.call(this,t))}}),i("translate",function(e){return function(t){return t.metadata.deps=t.metadata.deps||[],Promise.resolve(e.apply(this,arguments)).then(function(e){return("register"==t.metadata.format||"system"==t.metadata.format||!t.metadata.format&&k(t.source))&&(t.metadata.format="register"),e})}}),i("load",function(e){return function(t){var r=this,a=r.defined[t];return!a||a.deps.length?e.apply(this,arguments):(a.originalIndices=a.normalizedDeps=[],n(t,a,r),f(t,a,[],r),a.esModule||(a.esModule=r.newModule(a.module.exports)),r.trace||(r.defined[t]=void 0),r.set(t,a.esModule),Promise.resolve())}}),i("instantiate",function(e){return function(t){"detect"==t.metadata.format&&(t.metadata.format=void 0),e.call(this,t);var r,a=this;if(a.defined[t.name])r=a.defined[t.name],r.declarative||(r.deps=r.deps.concat(t.metadata.deps)),r.deps=r.deps.concat(t.metadata.deps);else if(t.metadata.entry)r=t.metadata.entry,r.deps=r.deps.concat(t.metadata.deps);else if(!(a.builder&&t.metadata.bundle||"register"!=t.metadata.format&&"esm"!=t.metadata.format&&"es6"!=t.metadata.format)){if("undefined"!=typeof re&&re.call(a,t),!t.metadata.entry&&!t.metadata.bundle)throw new Error(t.name+" detected as "+t.metadata.format+" but didn't execute.");r=t.metadata.entry,r&&t.metadata.deps&&(r.deps=r.deps.concat(t.metadata.deps))}r||(r=R(),r.deps=t.metadata.deps,r.execute=function(){}),a.defined[t.name]=r;var o=m(r.deps);r.deps=o.names,r.originalIndices=o.indices,r.name=t.name,r.esmExports=t.metadata.esmExports!==!1;for(var i=[],s=0,l=r.deps.length;l>s;s++)i.push(Promise.resolve(a.normalize(r.deps[s],t.name)));return Promise.all(i).then(function(e){return r.normalizedDeps=e,{deps:r.deps,execute:function(){return n(t.name,r,a),f(t.name,r,[],a),r.esModule||(r.esModule=a.newModule(r.module.exports)),a.trace||(a.defined[t.name]=void 0),r.esModule}}})}})}(),function(){var r=/(^\s*|[}\);\n]\s*)(import\s*(['"]|(\*\s+as\s+)?[^"'\(\)\n;]+\s*from\s*['"]|\{)|export\s+\*\s+from\s+["']|export\s*(\{|default|function|class|var|const|let|async\s+function))/,n=/\$traceurRuntime\s*\./,a=/babelHelpers\s*\./;i("translate",function(o){return function(i){var s=this,l=arguments;return o.apply(s,l).then(function(o){if("esm"==i.metadata.format||"es6"==i.metadata.format||!i.metadata.format&&o.match(r)){if("es6"==i.metadata.format&&w.call(s,"Module "+i.name+' has metadata setting its format to "es6", which is deprecated.\nThis should be updated to "esm".'),i.metadata.format="esm",i.metadata.deps){for(var u="",d=0;d100&&!i.metadata.format&&(i.metadata.format="global","traceur"===s.transpiler&&(i.metadata.exports="traceur"),"typescript"===s.transpiler&&(i.metadata.exports="ts")),s._loader.loadedTranspiler=!0),s._loader.loadedTranspilerRuntime===!1&&(i.name==s.normalizeSync("traceur-runtime")||i.name==s.normalizeSync("babel/external-helpers*"))&&(o.length>100&&(i.metadata.format=i.metadata.format||"global"),s._loader.loadedTranspilerRuntime=!0),("register"==i.metadata.format||i.metadata.bundle)&&s._loader.loadedTranspilerRuntime!==!0){if("traceur"==s.transpiler&&!e.$traceurRuntime&&i.source.match(n))return s._loader.loadedTranspilerRuntime=s._loader.loadedTranspilerRuntime||!1,s["import"]("traceur-runtime").then(function(){return o});if("babel"==s.transpiler&&!e.babelHelpers&&i.source.match(a))return s._loader.loadedTranspilerRuntime=s._loader.loadedTranspilerRuntime||!1,s["import"]("babel/external-helpers").then(function(){return o})}return o})}})}();var le="undefined"!=typeof self?"self":"global";i("fetch",function(e){return function(t){return t.metadata.exports&&!t.metadata.format&&(t.metadata.format="global"),e.call(this,t)}}),i("instantiate",function(e){return function(t){var r=this;if(t.metadata.format||(t.metadata.format="global"),"global"==t.metadata.format&&!t.metadata.entry){var n=R();t.metadata.entry=n,n.deps=[];for(var a in t.metadata.globals){var o=t.metadata.globals[a];o&&n.deps.push(o)}n.execute=function(e,n,a){var o;if(t.metadata.globals){o={};for(var i in t.metadata.globals)t.metadata.globals[i]&&(o[i]=e(t.metadata.globals[i]))}var s=t.metadata.exports;s&&(t.source+="\n"+le+'["'+s+'"] = '+s+";");var l=r.get("@@global-helpers").prepareGlobal(a.id,s,o,!!t.metadata.encapsulateGlobal);return re.call(r,t),l()}}return e.call(this,t)}}),i("reduceRegister_",function(e){return function(t,r){if(r||!t.metadata.exports&&(!F||"global"!=t.metadata.format))return e.call(this,t,r);t.metadata.format="global";var n=t.metadata.entry=R();n.deps=t.metadata.deps;var a=z(t.metadata.exports);n.execute=function(){return a}}}),s(function(t){return function(){function r(t){if(Object.keys)Object.keys(e).forEach(t);else for(var r in e)i.call(e,r)&&t(r)}function n(t){r(function(r){if(-1==$.call(s,r)){try{var n=e[r]}catch(a){s.push(r)}t(r,n)}})}var a=this;t.call(a);var o,i=Object.prototype.hasOwnProperty,s=["_g","sessionStorage","localStorage","clipboardData","frames","frameElement","external","mozAnimationStartTime","webkitStorageInfo","webkitIndexedDB","mozInnerScreenY","mozInnerScreenX"];a.set("@@global-helpers",a.newModule({prepareGlobal:function(t,r,a,i){var s=e.define;e.define=void 0;var l;if(a){l={};for(var u in a)l[u]=e[u],e[u]=a[u]}return r||(o={},n(function(e,t){o[e]=t})),function(){var t,a=r?z(r):{},u=!!r;if((!r||i)&&n(function(n,s){o[n]!==s&&"undefined"!=typeof s&&(i&&(e[n]=void 0),r||(a[n]=s,"undefined"!=typeof t?u||t===s||(u=!0):t=s))}),a=u?a:t,l)for(var d in l)e[d]=l[d];return e.define=s,a}}}))}}),function(){function t(e){function t(e,t){for(var r=0;rt.index)return!0;return!1}n.lastIndex=a.lastIndex=o.lastIndex=0;var r,i=[],s=[],l=[];if(e.length/e.split("\n").length<200){for(;r=o.exec(e);)s.push([r.index,r.index+r[0].length]);for(;r=a.exec(e);)t(s,r)||l.push([r.index+r[1].length,r.index+r[0].length-1])}for(;r=n.exec(e);)if(!t(s,r)&&!t(l,r)){var u=r[1].substr(1,r[1].length-2);if(u.match(/"|'/))continue;"/"==u[u.length-1]&&(u=u.substr(0,u.length-1)),i.push(u)}return i}var r=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF.])(exports\s*(\[['"]|\.)|module(\.exports|\['exports'\]|\["exports"\])\s*(\[['"]|[=,\.]))/,n=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF."'])require\s*\(\s*("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')\s*\)/g,a=/(^|[^\\])(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,o=/("[^"\\\n\r]*(\\.[^"\\\n\r]*)*"|'[^'\\\n\r]*(\\.[^'\\\n\r]*)*')/g,s=/^\#\!.*/;i("instantiate",function(a){return function(o){var i=this;if(o.metadata.format||(r.lastIndex=0,n.lastIndex=0,(n.exec(o.source)||r.exec(o.source))&&(o.metadata.format="cjs")),"cjs"==o.metadata.format){var l=o.metadata.deps,u=o.metadata.cjsRequireDetection===!1?[]:t(o.source);for(var d in o.metadata.globals)o.metadata.globals[d]&&u.push(o.metadata.globals[d]);var c=R();o.metadata.entry=c,c.deps=u,c.executingRequire=!0,c.execute=function(t,r,n){function a(e){return"/"==e[e.length-1]&&(e=e.substr(0,e.length-1)),t.apply(this,arguments)}if(a.resolve=function(e){return i.get("@@cjs-helpers").requireResolve(e,n.id)},n.paths=[],n.require=t,!o.metadata.cjsDeferDepsExecute)for(var u=0;u1;)n=a.shift(),e=e[n]=e[n]||{};n=a.shift(),n in e||(e[n]=r)}s(function(e){return function(){this.meta={},e.call(this)}}),i("locate",function(e){return function(t){var r,n=this.meta,a=t.name,o=0;for(var i in n)if(r=i.indexOf("*"),-1!==r&&i.substr(0,r)===a.substr(0,r)&&i.substr(r+1)===a.substr(a.length-i.length+r+1)){var s=i.split("/").length;s>o&&(o=s),v(t.metadata,n[i],o!=s)}return n[a]&&v(t.metadata,n[a]),e.call(this,t)}});var t=/^(\s*\/\*[^\*]*(\*(?!\/)[^\*]*)*\*\/|\s*\/\/[^\n]*|\s*"[^"]+"\s*;?|\s*'[^']+'\s*;?)+/,r=/\/\*[^\*]*(\*(?!\/)[^\*]*)*\*\/|\/\/[^\n]*|"[^"]+"\s*;?|'[^']+'\s*;?/g;i("translate",function(n){return function(a){if("defined"==a.metadata.format)return a.metadata.deps=a.metadata.deps||[],Promise.resolve(a.source);var o=a.source.match(t);if(o)for(var i=o[0].match(r),s=0;s')}else e()}else if("undefined"!=typeof importScripts){var a="";try{throw new Error("_")}catch(o){o.stack.replace(/(?:at|@).*(http.+):[\d]+:[\d]+/,function(e,t){$__curScript={src:t},a=t.replace(/\/[^\/]*$/,"/")})}t&&importScripts(a+"system-polyfills.js"),e()}else $__curScript="undefined"!=typeof __filename?{src:__filename}:null,e()}(); //# sourceMappingURL=system.js.map diff --git a/node_modules/systemjs/dist/system.js.map b/node_modules/systemjs/dist/system.js.map index bda47f38e..362c1f5ea 100644 --- a/node_modules/systemjs/dist/system.js.map +++ b/node_modules/systemjs/dist/system.js.map @@ -1 +1 @@ -{"version":3,"sources":["system.src.js"],"names":["bootstrap","global","URLPolyfill","url","baseURL","TypeError","m","String","replace","match","RangeError","protocol","username","password","host","hostname","port","pathname","search","hash","undefined","base","flag","slice","lastIndexOf","output","p","pop","push","join","this","origin","href","self","__global","addToError","err","msg","originalErr","stack","message","toString","split","newStack","i","length","$__curScript","indexOf","src","newMsg","substr","isBrowser","isWindows","newErr","errArgs","Error","fileName","lineNumber","Module","Loader","options","_loader","loaderObj","loads","modules","importPromises","moduleRecords","defineProperty","get","SystemJSLoader","call","paths","systemJSConstructor","SystemProto","hook","name","prototype","hookConstructor","isAbsolute","absURLRegEx","isRel","isPlain","urlResolve","parent","baseURI","URL","baseURIObj","applyPaths","loader","wildcard","pathMatch","maxWildcardPrefixLen","pathsCache","hasOwnProperty","path","pathParts","wildcardPrefixLen","outPath","group","deps","names","indices","l","index","getESModule","exports","esModule","getOwnPropertyDescriptor","defineOrCopyProperty","extend","value","targetObj","sourceObj","propName","d","Object","ex","a","b","prepend","extendMeta","val","Array","concat","extendPkgConfig","pkgCfgA","pkgCfgB","pkgName","warnInvalidProperties","prop","map","meta","depCache","dNormalized","coreResolve","warn","setPkgConfig","cfg","prependConfig","pkg","packages","basePkg","main","warnings","console","readMemberExpression","pParts","shift","getMapMatch","bestMatch","bestMatchLength","curMatchLength","prepareBaseURL","setProduction","isProduction","isBuilder","set","envModule","newModule","browser","node","_nodeRequire","production","dev","build","default","getNodeModule","parentModuleContext","_nodeModulePaths","require","parentName","mapMatch","has","builder","envSet","envCallback","browserConfig","nodeConfig","devConfig","buildConfig","productionConfig","detectRegisterFormat","source","leadingCommentAndMeta","leadingCommentAndMetaRegEx","createEntry","originalIndices","declare","execute","executingRequire","declarative","normalizedDeps","groupIndex","evaluated","module","esmExports","getGlobalValue","globalValue","first","parseCondition","condition","conditionExport","conditionModule","negation","conditionExportIndex","sysConditions","negate","serializeCondition","conditionObj","resolveCondition","bool","normalize","then","normalizedCondition","load","q","interpolateConditional","conditionalMatch","interpolationRegEx","Promise","resolve","conditionValue","booleanConditional","booleanIndex","isWorker","window","importScripts","document","process","platform","assert","item","thisLen","e","obj","opt","getElementsByTagName","bases","location","cwd","nativeURL","createLoad","status","anonCnt","linkSets","dependencies","metadata","loadModule","asyncStartLoadPartwayThrough","step","address","moduleName","moduleMetadata","moduleSource","moduleAddress","requestLoad","request","refererName","refererAddress","reject","proceedToLocate","proceedToFetch","locate","proceedToTranslate","fetch","translate","instantiate","instantiateResult","depsList","loadPromises","depLoad","key","addLoadToLinkSet","all","updateLinkSetOnLoad","exc","exception","linkSetFailed","stepState","existingLoad","done","linkSet","createLinkSet","startingLoad","loadingCount","j","doLink","error","link","_newModule","finishLoad","abrupt","checkError","pLoad","dep","failed","linkIndex","splice","globalLoadsIndex","trace","depMap","forEach","loadIndex","doDynamicExecute","linkError","createImportPromise","promise","constructor","define","delete","import","parentAddress","sourcePromise","pNames","getOwnPropertyNames","configurable","enumerable","freeze","referrerName","referrerAddress","System","fetchTextFromURL","XMLHttpRequest","authorization","fulfill","xhr","responseText","statusText","sameDomain","doTimeout","domainCheck","exec","XDomainRequest","onload","onerror","ontimeout","onprogress","timeout","onreadystatechange","readyState","addEventListener","open","setRequestHeader","withCredentials","setTimeout","send","fs","readFile","data","dataString","opts","headers","Accept","credentials","r","ok","text","transpile","transpiler","pluginLoader","__useDefault","transpileFunction","Compiler","traceurTranspile","createLanguageService","typescriptTranspile","babelTranspile","traceur","traceurOptions","script","sourceMaps","filename","inputSourceMap","sourceMap","compiler","doTraceurCompile","compile","babel","babelOptions","code","ast","transform","ts","typescriptOptions","target","ScriptTarget","ES5","inlineSourceMap","ModuleKind","__exec","sourceMapString","hasBuffer","sourceMapPrefix","Buffer","btoa","unescape","encodeURIComponent","getSource","wrap","lastLineIndex","format","JSON","stringify","preExec","curLoad","callCounter","curSystem","SystemJS","postExec","scriptExec","head","body","documentElement","createElement","_e","apply","arguments","integrity","setAttribute","nonce","appendChild","removeChild","register","reduceRegister_","useVm","vm","supportsScriptExec","runInThisContext","eval","chrome","extension","navigator","userAgent","scriptSrc","defaultJSExtensions","pluginFirst","loaderErrorStack","skipExt","resolved","httpRequest","systemImport","systemTranslate","entry","parse","getConfig","curCurScript","config","isEnvConfig","checkHasConfig","transpilerRuntime","loadedTranspilerRuntime","bundles","packageConfigPaths","v","defaultJSExtension","decanonicalize","pkgMatch","packageLength","Math","max","normalized","bundle","normalizedBundleDep","c","getPackage","curPkg","pkgLen","curPkgLen","addDefaultExtension","subPath","skipExtensions","defaultExtension","metaMatch","getMetaMatches","metaPattern","matchMeta","matchDepth","applyPackageConfigSync","mapPath","mapped","doMapSync","validMapping","normalizeSync","applyPackageConfig","doMap","doStringMap","conditionPromises","conditions","conditionValues","createPkgConfigPathObj","lastWildcard","regEx","RegExp","getPackageConfigMatch","configPath","exactMatch","packageConfigPath","packageName","loadPackageConfigPath","pkgConfigPath","configLoader","systemjs","pkgMeta","matchFn","wildcardIndex","dotRel","exactMeta","decanonicalized","isPlugin","parentPackageName","parentPackage","parentMap","parentMapMatch","pkgConfigMatch","isConfigured","configured","bestDepth","getInteractiveScriptLoad","interactiveScript","interactiveLoadingScripts","webWorkerImport","workerLoad","curRequire","ieEvents","s","isOpera","opera","attachEvent","loadingCnt","registerQueue","pushRegister","scriptLoad","complete","evt","cleanup","detachEvent","removeEventListener","async","crossOrigin","buildGroups","groups","depName","depEntry","defined","depGroupIndex","startEntry","curGroupDeclarative","linkDeclarativeModule","linkDynamicModule","ModuleRecord","getOrCreateModuleRecord","importers","declaration","locked","importerModule","importerIndex","setter","setters","id","depExports","depModule","len","getModule","ensureEvaluated","nameNormalized","__esModule","seen","registerDynamic","pushRegister_","amd","curMeta","del","doLoad","grouped","normalizePromises","esmRegEx","traceurRuntimeRegEx","babelHelpersRegEx","args","depInject","loadedTranspiler","transpilerPromise","loaderModule","originalName","file","sources","originalSource","$traceurRuntime","babelHelpers","__globalName","g","globals","gl","exportName","retrieveGlobal","prepareGlobal","encapsulateGlobal","reduceRegister","forEachGlobal","callback","keys","forEachGlobalValue","globalName","ignoredGlobalProps","globalSnapshot","encapsulate","curDefine","oldGlobals","singleGlobal","multipleExports","getCJSDeps","inLocation","locations","cjsRequireRegEx","lastIndex","commentRegEx","stringRegEx","stringLocations","commentLocations","cjsExportsRegEx","hashBangRegEx","metaDeps","cjsRequireDetection","_require","requireResolve","cjsDeferDepsExecute","pathVars","getPathVars","__cjsWrapper","dirname","cjsWrapper","stripOrigin","windowOrigin","parentId","moduleId","pluginIndex","amdDefine","requireIndex","params","fnBracketRegEx","requireAlias","wsRegEx","requireRegEx","requireRegExs","cjsRequirePre","cjsRequirePost","errback","referer","dynamicRequires","factory","req","contextualRequire","depValues","uri","moduleIndex","exportsIndex","toUrl","amdRequire","amdRegEx","builderExecute","getParentName","parentPluginIndex","parsePlugin","argumentName","pluginName","argument","plugin","combinePluginParts","checkDefaultExtension","arg","createNormalizeSync","parsed","pluginSyntaxIndex","loaderNormalized","result","calledInstantiate","alias","aliasDeps","_export","setMetaProperty","curPart","depth","metaRegEx","metaPartRegEx","metaParts","firstChar","metaString","metaName","metaValue","loadedBundles","matched","curModule","parts","substring","version","doPolyfill","scripts","currentScript","defer","curPath","basePath","systemJSBootstrap","write","__filename"],"mappings":";;;CAGA,WACA,QAASA,MACT,SAAUC,GACV,QAASC,GAAYC,EAAKC,GACxB,GAAkB,gBAAPD,GACT,KAAM,IAAIE,WAAU,uBACtB,IAAIC,GAAIC,OAAOJ,GAAKK,QAAQ,aAAc,IAAIC,MAAM,mHACpD,KAAKH,EACH,KAA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,EAAOX,EAAO4C,SAASkF,EAAK3I,KAChC,IAAIwB,EACF,IAAK,GAAIvD,GAAI,EAAGA,EAAIuD,EAAKtD,OAAQD,IAC/B4C,EAAe,OAAEW,EAAKvD,GAAI0K,EAAK3I,KAEnC,OAAO2L,GAAOhM,KAAKkB,EAAQ8H,SAKjC0G,EAAS,GAAI3P,GAEbnC,EAASqX,SAAWvF,EACpBA,EAAOsX,QAAU,mBACM,gBAAVpf,SAAsBA,OAAOzF,SAA6B,gBAAXA,WACxDyF,OAAOzF,QAAUuN,GAEnB9R,EAAS8R,OAASA,GAEF,mBAAR/R,MAAsBA,KAAOhC,QAGvC,GAAIsrB,GAAgC,mBAAZ5d,QAGxB,IAAwB,mBAAbQ,UAA0B,CACnC,GAAIqd,GAAUrd,SAASS,qBAAqB,SAM5C,IALA9L,aAAe0oB,EAAQA,EAAQ3oB,OAAS,GACpCsL,SAASsd,gBAAkB3oB,aAAa4oB,OAAS5oB,aAAa2e,SAChE3e,aAAeqL,SAASsd,eACrB3oB,aAAaE,MAChBF,aAAe1B,QACbmqB,EAAY,CACd,GAAII,GAAU7oB,aAAaE,IACvB4oB,EAAWD,EAAQzoB,OAAO,EAAGyoB,EAAQnqB,YAAY,KAAO,EAC5DyM,QAAO4d,kBAAoB7rB,EAC3BmO,SAAS2d,MACP,uCAA8CF,EAAW,sCAI3D5rB,SAIC,IAA6B,mBAAlBkO,eAA+B,CAC7C,GAAI0d,GAAW,EACf,KACE,KAAM,IAAIroB,OAAM,KAChB,MAAOkL,GACPA,EAAElM,MAAM/B,QAAQ,iCAAkC,SAASF,EAAGH,GAC5D2C,cAAiBE,IAAK7C,GACtByrB,EAAWzrB,EAAIK,QAAQ,YAAa,OAGpC+qB,GACFrd,cAAc0d,EAAW,uBAC3B5rB,QAGA8C,cAAoC,mBAAdipB,aAA8B/oB,IAAK+oB,YAAe,KACxE/rB"} \ No newline at end of file +{"version":3,"sources":["system.src.js"],"names":["bootstrap","global","URLPolyfill","url","baseURL","TypeError","m","String","replace","match","RangeError","protocol","username","password","host","hostname","port","pathname","search","hash","undefined","base","flag","slice","lastIndexOf","output","p","pop","push","join","this","origin","href","self","__global","addToError","err","msg","originalErr","stack","message","toString","split","newStack","i","length","$__curScript","indexOf","src","newMsg","substr","isBrowser","isWindows","newErr","errArgs","Error","fileName","lineNumber","Module","Loader","options","_loader","loaderObj","loads","modules","importPromises","moduleRecords","defineProperty","get","SystemJSLoader","call","paths","systemJSConstructor","SystemProto","hook","name","prototype","hookConstructor","isAbsolute","absURLRegEx","isRel","isPlain","urlResolve","parent","baseURI","URL","baseURIObj","applyPaths","loader","wildcard","pathMatch","maxWildcardPrefixLen","pathsCache","hasOwnProperty","path","pathParts","wildcardPrefixLen","outPath","group","deps","names","indices","l","index","getESModule","exports","esModule","getOwnPropertyDescriptor","defineOrCopyProperty","extend","value","targetObj","sourceObj","propName","d","Object","ex","a","b","prepend","extendMeta","val","Array","concat","extendPkgConfig","pkgCfgA","pkgCfgB","pkgName","warnInvalidProperties","prop","map","meta","depCache","dNormalized","coreResolve","warn","setPkgConfig","cfg","prependConfig","pkg","packages","basePkg","main","warnings","console","createInstantiate","load","result","metadata","entry","createEntry","execute","format","readMemberExpression","pParts","shift","getMapMatch","bestMatch","bestMatchLength","curMatchLength","prepareBaseURL","setProduction","isProduction","isBuilder","set","envModule","newModule","browser","node","_nodeRequire","production","dev","build","default","getNodeModule","parentModuleContext","_nodeModulePaths","require","parentName","mapMatch","has","builder","envSet","envCallback","browserConfig","nodeConfig","devConfig","buildConfig","productionConfig","detectRegisterFormat","source","leadingCommentAndMeta","leadingCommentAndMetaRegEx","originalIndices","declare","executingRequire","declarative","normalizedDeps","groupIndex","evaluated","module","esmExports","getGlobalValue","globalValue","first","parseCondition","condition","conditionExport","conditionModule","negation","conditionExportIndex","sysConditions","negate","serializeCondition","conditionObj","resolveCondition","bool","normalize","then","normalizedCondition","q","interpolateConditional","conditionalMatch","interpolationRegEx","Promise","resolve","conditionValue","booleanConditional","booleanIndex","isWorker","window","importScripts","document","process","platform","assert","item","thisLen","e","obj","opt","getElementsByTagName","bases","location","cwd","nativeURL","createLoad","status","anonCnt","linkSets","dependencies","loadModule","asyncStartLoadPartwayThrough","step","address","moduleName","moduleMetadata","moduleSource","moduleAddress","requestLoad","request","refererName","refererAddress","reject","proceedToLocate","proceedToFetch","locate","proceedToTranslate","fetch","translate","instantiate","instantiateResult","depsList","loadPromises","depLoad","key","addLoadToLinkSet","all","updateLinkSetOnLoad","exc","exception","linkSetFailed","stepState","existingLoad","done","linkSet","createLinkSet","startingLoad","loadingCount","j","doLink","error","link","_newModule","finishLoad","abrupt","checkError","pLoad","dep","failed","linkIndex","splice","globalLoadsIndex","trace","depMap","forEach","loadIndex","doDynamicExecute","linkError","createImportPromise","promise","constructor","define","delete","import","parentAddress","sourcePromise","pNames","getOwnPropertyNames","configurable","enumerable","freeze","referrerName","referrerAddress","System","fetchTextFromURL","XMLHttpRequest","authorization","fulfill","xhr","responseText","statusText","sameDomain","doTimeout","domainCheck","exec","XDomainRequest","onload","onerror","ontimeout","onprogress","timeout","onreadystatechange","readyState","addEventListener","open","setRequestHeader","withCredentials","setTimeout","send","fs","readFile","data","dataString","opts","headers","Accept","credentials","r","ok","text","transpile","transpiler","pluginLoader","__useDefault","transpileFunction","Compiler","traceurTranspile","createLanguageService","typescriptTranspile","babelTranspile","traceur","traceurOptions","script","sourceMaps","filename","inputSourceMap","sourceMap","compiler","doTraceurCompile","compile","babel","babelOptions","code","ast","transform","ts","typescriptOptions","target","ScriptTarget","ES5","inlineSourceMap","ModuleKind","__exec","sourceMapString","hasBuffer","sourceMapPrefix","Buffer","btoa","unescape","encodeURIComponent","getSource","wrap","lastLineIndex","JSON","stringify","preExec","curLoad","callCounter","curSystem","SystemJS","postExec","scriptExec","head","body","documentElement","createElement","_e","apply","arguments","integrity","setAttribute","nonce","appendChild","removeChild","register","reduceRegister_","useVm","vm","supportsScriptExec","runInThisContext","eval","chrome","extension","navigator","userAgent","scriptSrc","defaultJSExtensions","pluginFirst","loaderErrorStack","skipExt","resolved","httpRequest","systemImport","systemTranslate","parse","getConfig","curCurScript","config","isEnvConfig","checkHasConfig","transpilerRuntime","loadedTranspilerRuntime","bundles","packageConfigPaths","v","defaultJSExtension","decanonicalize","pkgMatch","packageLength","Math","max","normalized","bundle","normalizedBundleDep","c","getPackage","curPkg","pkgLen","curPkgLen","addDefaultExtension","subPath","skipExtensions","defaultExtension","metaMatch","getMetaMatches","metaPattern","matchMeta","matchDepth","applyPackageConfigSync","mapPath","mapped","doMapSync","validMapping","normalizeSync","applyPackageConfig","doMap","doStringMap","conditionPromises","conditions","conditionValues","createPkgConfigPathObj","lastWildcard","regEx","RegExp","getPackageConfigMatch","configPath","exactMatch","packageConfigPath","packageName","loadPackageConfigPath","pkgConfigPath","configLoader","systemjs","pkgMeta","matchFn","wildcardIndex","dotRel","exactMeta","decanonicalized","isPlugin","parentPackageName","parentPackage","parentMap","parentMapMatch","pkgConfigMatch","isConfigured","configured","bestDepth","getInteractiveScriptLoad","interactiveScript","interactiveLoadingScripts","webWorkerImport","workerLoad","curRequire","ieEvents","s","isOpera","opera","attachEvent","loadingCnt","registerQueue","pushRegister","scriptLoad","complete","evt","cleanup","detachEvent","removeEventListener","async","crossOrigin","buildGroups","groups","depName","depEntry","defined","depGroupIndex","startEntry","curGroupDeclarative","linkDeclarativeModule","linkDynamicModule","ModuleRecord","getOrCreateModuleRecord","importers","declaration","locked","importerModule","importerIndex","setter","setters","id","depExports","depModule","len","getModule","ensureEvaluated","nameNormalized","__esModule","seen","registerDynamic","pushRegister_","amd","curMeta","del","doLoad","grouped","normalizePromises","esmRegEx","traceurRuntimeRegEx","babelHelpersRegEx","args","depInject","loadedTranspiler","transpilerPromise","transpilerNormalized","loaderModule","originalName","file","sources","originalSource","$traceurRuntime","babelHelpers","__globalName","g","globals","gl","exportName","retrieveGlobal","prepareGlobal","encapsulateGlobal","reduceRegister","forEachGlobal","callback","keys","forEachGlobalValue","globalName","ignoredGlobalProps","globalSnapshot","encapsulate","curDefine","oldGlobals","singleGlobal","multipleExports","getCJSDeps","inLocation","locations","cjsRequireRegEx","lastIndex","commentRegEx","stringRegEx","stringLocations","commentLocations","cjsExportsRegEx","hashBangRegEx","metaDeps","cjsRequireDetection","_require","requireResolve","cjsDeferDepsExecute","pathVars","getPathVars","__cjsWrapper","dirname","cjsWrapper","stripOrigin","windowOrigin","parentId","moduleId","pluginIndex","amdDefine","requireIndex","params","fnBracketRegEx","requireAlias","wsRegEx","requireRegEx","requireRegExs","cjsRequirePre","cjsRequirePost","errback","referer","dynamicRequires","factory","req","contextualRequire","depValues","uri","moduleIndex","exportsIndex","toUrl","amdRequire","amdRegEx","builderExecute","getParentName","parentPluginIndex","parsePlugin","argumentName","pluginName","argument","plugin","combinePluginParts","checkDefaultExtension","arg","createNormalizeSync","parsed","pluginSyntaxIndex","loaderNormalized","calledInstantiate","alias","aliasDeps","_export","setMetaProperty","curPart","depth","metaRegEx","metaPartRegEx","metaParts","firstChar","metaString","metaName","metaValue","loadedBundles","matched","curModule","parts","substring","version","doPolyfill","scripts","currentScript","defer","curPath","basePath","systemJSBootstrap","write","__filename"],"mappings":";;;CAGA,WACA,QAASA,MACT,SAAUC,GACV,QAASC,GAAYC,EAAKC,GACxB,GAAkB,gBAAPD,GACT,KAAM,IAAIE,WAAU,uBACtB,IAAIC,GAAIC,OAAOJ,GAAKK,QAAQ,aAAc,IAAIA,QAAQ,MAAO,KAAKC,MAAM,mHACxE,KAAKH,EACH,KAAM,IAAII,YAAW,qBACvB,IAAIC,GAAWL,EAAE,IAAM,GACnBM,EAAWN,EAAE,IAAM,GACnBO,EAAWP,EAAE,IAAM,GACnBQ,EAAOR,EAAE,IAAM,GACfS,EAAWT,EAAE,IAAM,GACnBU,EAAOV,EAAE,IAAM,GACfW,EAAWX,EAAE,IAAM,GACnBY,EAASZ,EAAE,IAAM,GACjBa,EAAOb,EAAE,IAAM,EACnB,IAAgBc,SAAZhB,EAAuB,CACzB,GAA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6B,mBAAlBuO,eAA+B,CAC7C,GAAIud,GAAW,EACf,KACE,KAAM,IAAIvoB,OAAM,KAChB,MAAOuL,GACPA,EAAEvM,MAAM/B,QAAQ,iCAAkC,SAASF,EAAGH,GAC5D2C,cAAiBE,IAAK7C,GACtB2rB,EAAW3rB,EAAIK,QAAQ,YAAa,OAGpCirB,GACFld,cAAcud,EAAW,uBAC3B9rB,QAGA8C,cAAoC,mBAAdmpB,aAA8BjpB,IAAKipB,YAAe,KACxEjsB"} \ No newline at end of file diff --git a/node_modules/systemjs/dist/system.src.js b/node_modules/systemjs/dist/system.src.js index 13dbc2fe5..e7e59edc3 100644 --- a/node_modules/systemjs/dist/system.src.js +++ b/node_modules/systemjs/dist/system.src.js @@ -1,5 +1,5 @@ /* - * SystemJS v0.19.41 + * SystemJS v0.19.47 */ (function() { function bootstrap() {// from https://gist.github.com/Yaffle/1088850 @@ -7,7 +7,7 @@ function bootstrap() {// from https://gist.github.com/Yaffle/1088850 function URLPolyfill(url, baseURL) { if (typeof url != 'string') throw new TypeError('URL must be a string'); - var m = String(url).replace(/^\s+|\s+$/g, "").match(/^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/); + var m = String(url).replace(/^\s+|\s+$/g, "").replace(/\\/g, '/').match(/^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/); if (!m) throw new RangeError('Invalid URL format'); var protocol = m[1] || ""; @@ -65,7 +65,8 @@ function URLPolyfill(url, baseURL) { this.hash = hash; } global.URLPolyfill = URLPolyfill; -})(typeof self != 'undefined' ? self : global);(function(__global) { +})(typeof self != 'undefined' ? self : global); +(function(__global) { var isWorker = typeof window == 'undefined' && typeof self != 'undefined' && typeof importScripts != 'undefined'; var isBrowser = typeof window != 'undefined' && typeof document != 'undefined'; @@ -83,7 +84,7 @@ global.URLPolyfill = URLPolyfill; } return -1; }; - + var defineProperty; (function () { try { @@ -120,9 +121,9 @@ global.URLPolyfill = URLPolyfill; newMsg = newMsg.replace(isWindows ? /file:\/\/\//g : /file:\/\//g, ''); var newErr = errArgs ? new Error(newMsg, err.fileName, err.lineNumber) : new Error(newMsg); - + newErr.stack = newMsg; - + // track the original error newErr.originalErr = err.originalErr || err; @@ -431,7 +432,7 @@ function logloads(loads) { .then(function(instantiateResult) { if (instantiateResult === undefined) throw new TypeError('Declarative modules unsupported in the polyfill.'); - + if (typeof instantiateResult != 'object') throw new TypeError('Invalid instantiate return value'); @@ -494,8 +495,6 @@ function logloads(loads) { for (var i = 0, l = linkSets.length; i < l; i++) { linkSetFailed(linkSets[i], load, exc); } - - console.assert(load.linkSets.length == 0, 'linkSets not removed'); }); } @@ -548,7 +547,6 @@ function logloads(loads) { proceedToFetch(loader, load, Promise.resolve(stepState.moduleAddress)); else { - console.assert(step == 'translate', 'translate step'); load.address = stepState.moduleAddress; proceedToTranslate(loader, load, Promise.resolve(stepState.moduleSource)); } @@ -636,9 +634,6 @@ function logloads(loads) { function updateLinkSetOnLoad(linkSet, load) { // console.log('update linkset on load ' + load.name); // snapshot(linkSet.loader); - - console.assert(load.status == 'loaded' || load.status == 'linked', 'loaded or linked'); - linkSet.loadingCount--; if (linkSet.loadingCount > 0) @@ -671,8 +666,6 @@ function logloads(loads) { if (abrupt) return; - console.assert(linkSet.loads.length == 0, 'loads cleared'); - linkSet.resolve(startingLoad); } @@ -681,7 +674,7 @@ function logloads(loads) { var loader = linkSet.loader; var requests; - checkError: + checkError: if (load) { if (linkSet.loads[0].name == load.name) { exc = addToError(exc, 'Error loading ' + load.name); @@ -715,7 +708,6 @@ function logloads(loads) { loader.loaderObj.failed.push(load); var linkIndex = indexOf.call(load.linkSets, linkSet); - console.assert(linkIndex != -1, 'link not present'); load.linkSets.splice(linkIndex, 1); if (load.linkSets.length == 0) { var globalLoadsIndex = indexOf.call(linkSet.loader.loads, load); @@ -747,7 +739,6 @@ function logloads(loads) { } // if not anonymous, add to the module table if (load.name) { - console.assert(!loader.modules[load.name] || loader.modules[load.name].module === load.module.module, 'load not in module table'); loader.modules[load.name] = load.module; } var loadIndex = indexOf.call(loader.loads, load); @@ -857,7 +848,7 @@ function logloads(loads) { var loader = this._loader; if (loader.modules[name]) return Promise.resolve(); - return loader.importPromises[name] || createImportPromise(this, name, new Promise(asyncStartLoadPartwayThrough({ + return (loader.importPromises[name] || createImportPromise(this, name, new Promise(asyncStartLoadPartwayThrough({ step: 'locate', loader: loader, moduleName: name, @@ -865,9 +856,11 @@ function logloads(loads) { moduleSource: undefined, moduleAddress: undefined })) - .then(function() { + .then(function(load) { delete loader.importPromises[name]; - })); + return load.module.module; + }))) + .then(function () {}); }, // 26.3.3.11 module: function(source, options) { @@ -977,7 +970,6 @@ function logloads(loads) { })(); var System; - var fetchTextFromURL; if (typeof XMLHttpRequest != 'undefined') { fetchTextFromURL = function(url, authorization, fulfill, reject) { @@ -1265,7 +1257,7 @@ function applyPaths(loader, name) { if (p.indexOf('*') === -1) { if (name == p) return paths[p]; - + // support trailing / in paths rules else if (name.substr(0, p.length - 1) == p.substr(0, p.length - 1) && (name.length < p.length || name[p.length - 1] == p[p.length - 1]) && (paths[p][paths[p].length - 1] == '/' || paths[p] == '')) { return paths[p].substr(0, paths[p].length - 1) + (name.length > p.length ? (paths[p] && '/' || '') + name.substr(p.length) : ''); @@ -1419,7 +1411,7 @@ function extendPkgConfig(pkgCfgA, pkgCfgB, pkgName, loader, warnInvalidPropertie loader.depCache[dNormalized] = (loader.depCache[dNormalized] || []).concat(pkgCfgB.depCache[d]); } } - else if (warnInvalidProperties && indexOf.call(['browserConfig', 'nodeConfig', 'devConfig', 'productionConfig'], prop) == -1 && + else if (warnInvalidProperties && indexOf.call(['browserConfig', 'nodeConfig', 'devConfig', 'productionConfig'], prop) == -1 && (!pkgCfgB.hasOwnProperty || pkgCfgB.hasOwnProperty(prop))) { warn.call(loader, '"' + prop + '" is not a valid package configuration option in package ' + pkgName); } @@ -1441,7 +1433,7 @@ function setPkgConfig(loader, pkgName, cfg, prependConfig) { extendPkgConfig(pkg, prependConfig ? cfg : basePkg, pkgName, loader, prependConfig); extendPkgConfig(pkg, prependConfig ? basePkg : cfg, pkgName, loader, !prependConfig); } - + // main object becomes main map if (typeof pkg.main == 'object') { pkg.map = pkg.map || {}; @@ -1457,6 +1449,15 @@ function warn(msg) { if (this.warnings && typeof console != 'undefined' && console.warn) console.warn(msg); } + +function createInstantiate (load, result) { + load.metadata.entry = createEntry(); + load.metadata.entry.execute = function() { + return result; + } + load.metadata.entry.deps = []; + load.metadata.format = 'defined'; +} // we define a __exec for globally-scoped execution // used by module format implementations var __exec; @@ -2902,7 +2903,7 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) { * * * The code here replicates the ES6 linking groups algorithm to ensure that - * circular ES6 compiled into System.register can work alongside circular AMD + * circular ES6 compiled into System.register can work alongside circular AMD * and CommonJS, identically to the actual ES6 loader. * */ @@ -2912,7 +2913,7 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) { * Registry side table entries in loader.defined * Registry Entry Contains: * - name - * - deps + * - deps * - declare for declarative modules * - execute for dynamic modules, different to declarative execute on module * - executingRequire indicates require drives execution for circularity of dynamic modules @@ -2930,7 +2931,7 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) { * For dynamic we track the es module with: * - esModule actual es module value * - esmExports whether to extend the esModule with named exports - * + * * Then for declarative only we track dynamic bindings with the 'module' records: * - name * - exports @@ -2975,7 +2976,7 @@ function createEntry() { * see https://github.com/ModuleLoader/es6-module-loader/wiki/System.register-Explained * * 2. System.registerDynamic for dynamic modules (3-4 params) - System.registerDynamic([name, ]deps, executingRequire, execute) - * the true or false statement + * the true or false statement * * this extension implements the linking algorithm for the two variations identical to the spec * allowing compiled ES6 circular references to work alongside AMD and CJS circular references. @@ -2994,7 +2995,7 @@ function createEntry() { return this.registerDynamic.apply(this, arguments); var entry = createEntry(); - // ideally wouldn't apply map config to bundle names but + // ideally wouldn't apply map config to bundle names but // dependencies go through map regardless so we can't restrict // could reconsider in shift to new spec entry.name = name && (this.decanonicalize || this.normalize).call(this, name); @@ -3080,17 +3081,17 @@ function createEntry() { for (var i = 0, l = entry.normalizedDeps.length; i < l; i++) { var depName = entry.normalizedDeps[i]; var depEntry = loader.defined[depName]; - + // not in the registry means already linked / ES6 if (!depEntry || depEntry.evaluated) continue; - + // now we know the entry is in our unlinked linkage group var depGroupIndex = entry.groupIndex + (depEntry.declarative != entry.declarative); // the group index of an entry is always the maximum if (depEntry.groupIndex === null || depEntry.groupIndex < depGroupIndex) { - + // if already in a group, remove from the old group if (depEntry.groupIndex !== null) { groups[depEntry.groupIndex].splice(indexOf.call(groups[depEntry.groupIndex], depEntry), 1); @@ -3130,7 +3131,7 @@ function createEntry() { else linkDynamicModule(entry, loader); } - curGroupDeclarative = !curGroupDeclarative; + curGroupDeclarative = !curGroupDeclarative; } } @@ -3190,7 +3191,7 @@ function createEntry() { // allowing undefined declaration was a mistake! To be deprecated. declaration = declaration || { setters: [], execute: function() {} }; - + module.setters = declaration.setters; module.execute = declaration.execute; @@ -3233,7 +3234,7 @@ function createEntry() { else { module.dependencies.push(null); } - + // run setters for all entries with the matching dependency name var originalIndices = entry.originalIndices[i]; for (var j = 0, len = originalIndices.length; j < len; ++j) { @@ -3259,7 +3260,7 @@ function createEntry() { else { if (entry.declarative) ensureEvaluated(name, entry, [], loader); - + else if (!entry.evaluated) linkDynamicModule(entry, loader); @@ -3268,7 +3269,7 @@ function createEntry() { if ((!entry || entry.declarative) && exports && exports.__useDefault) return exports['default']; - + return exports; } @@ -3306,7 +3307,7 @@ function createEntry() { throw new Error('Module ' + name + ' not declared as a dependency of ' + entry.name); }, exports, module); - + if (output !== undefined) module.exports = output; @@ -3330,7 +3331,7 @@ function createEntry() { * (unless one is a circular dependency already in the list of seen * modules, in which case we execute it) * - * Then we evaluate the module itself depth-first left to right + * Then we evaluate the module itself depth-first left to right * execution to match ES6 modules */ function ensureEvaluated(moduleName, entry, seen, loader) { @@ -3376,7 +3377,7 @@ function createEntry() { } load.metadata.deps = load.metadata.deps || []; - + return fetch.call(this, load); }; }); @@ -3387,7 +3388,7 @@ function createEntry() { load.metadata.deps = load.metadata.deps || []; return Promise.resolve(translate.apply(this, arguments)).then(function(source) { // run detection for register format - if (load.metadata.format == 'register' || !load.metadata.format && detectRegisterFormat(load.source)) + if (load.metadata.format == 'register' || load.metadata.format == 'system' || !load.metadata.format && detectRegisterFormat(load.source)) load.metadata.format = 'register'; return source; }); @@ -3405,7 +3406,7 @@ function createEntry() { entry.originalIndices = entry.normalizedDeps = []; - // recursively ensure that the module and all its + // recursively ensure that the module and all its // dependencies are linked (with dependency group handling) link(normalized, entry, loader); @@ -3456,9 +3457,9 @@ function createEntry() { // Contains System.register calls // (dont run bundles in the builder) - else if (!(loader.builder && load.metadata.bundle) + else if (!(loader.builder && load.metadata.bundle) && (load.metadata.format == 'register' || load.metadata.format == 'esm' || load.metadata.format == 'es6')) { - + if (typeof __exec != 'undefined') __exec.call(loader, load); @@ -3481,9 +3482,9 @@ function createEntry() { // place this module onto defined for circular references loader.defined[load.name] = entry; - + var grouped = group(entry.deps); - + entry.deps = grouped.names; entry.originalIndices = grouped.indices; entry.name = load.name; @@ -3501,7 +3502,7 @@ function createEntry() { return { deps: entry.deps, execute: function() { - // recursively ensure that the module and all its + // recursively ensure that the module and all its // dependencies are linked (with dependency group handling) link(load.name, entry, loader); @@ -3569,10 +3570,28 @@ function createEntry() { // do transpilation return (loader._loader.transpilerPromise || ( loader._loader.transpilerPromise = Promise.resolve( - __global[loader.transpiler == 'typescript' ? 'ts' : loader.transpiler] || (loader.pluginLoader || loader)['import'](loader.transpiler) + __global[loader.transpiler == 'typescript' ? 'ts' : loader.transpiler] || (loader.pluginLoader || loader).normalize(loader.transpiler) + .then(function(normalized) { + loader._loader.transpilerNormalized = normalized; + return (loader.pluginLoader || loader).load(normalized) + .then(function() { + return (loader.pluginLoader || loader).get(normalized); + }); + }) ))).then(function(transpiler) { loader._loader.loadedTranspilerRuntime = true; + if (typeof transpiler.default === 'function' && !__global[loader.transpiler == 'typescript' ? 'ts' : loader.transpiler]) { + // instantiate plugins dont build + if (loader.builder) + return source; + return Promise.resolve(transpiler.default.call(loader, load.address, load.name)) + .then(function (result) { + createInstantiate(load, result); + return ''; + }); + } + // translate hooks means this is a transpiler plugin instead of a raw implementation if (transpiler.translate) { // if transpiler is the same as the plugin loader, then don't run twice @@ -3589,7 +3608,7 @@ function createEntry() { var sourceMap = load.metadata.sourceMap; if (sourceMap && typeof sourceMap == 'object') { var originalName = load.address.split('!')[0]; - + // force set the filename of the original file if (!sourceMap.file || sourceMap.file == load.address) sourceMap.file = originalName + '!transpiled'; @@ -3608,14 +3627,14 @@ function createEntry() { // legacy builder support if (loader.builder) load.metadata.originalSource = load.source; - + // defined in es6-module-loader/src/transpile.js return transpile.call(loader, load) .then(function(source) { // clear sourceMap as transpiler embeds it load.metadata.sourceMap = undefined; return source; - }); + }); }, function(err) { throw addToError(err, 'Unable to load transpiler to transpile ' + load.name); }); @@ -4539,15 +4558,16 @@ hookConstructor(function(constructor) { hook('fetch', function(fetch) { return function(load) { var loader = this; - if (load.metadata.loaderModule && load.metadata.loaderModule.fetch && load.metadata.format != 'defined') { + if (load.metadata.loaderModule && load.metadata.format != 'defined') { + if (typeof load.metadata.loaderModule === 'function' || load.metadata.loaderModule instanceof Module && typeof load.metadata.loaderModule.default === 'function') + return ''; load.metadata.scriptLoad = false; - return load.metadata.loaderModule.fetch.call(loader, load, function(load) { - return fetch.call(loader, load); - }); - } - else { - return fetch.call(loader, load); + if (load.metadata.loaderModule.fetch) + return load.metadata.loaderModule.fetch.call(loader, load, function(load) { + return fetch.call(loader, load); + }); } + return fetch.call(loader, load); }; }); @@ -4584,9 +4604,7 @@ hookConstructor(function(constructor) { return translate.apply(loader, args); }); } - else { - return translate.apply(loader, args); - } + return translate.apply(loader, args); }; }); @@ -4595,28 +4613,30 @@ hookConstructor(function(constructor) { var loader = this; var calledInstantiate = false; - if (load.metadata.loaderModule && load.metadata.loaderModule.instantiate && !loader.builder && load.metadata.format != 'defined') - return Promise.resolve(load.metadata.loaderModule.instantiate.call(loader, load, function(load) { - if (calledInstantiate) - throw new Error('Instantiate must only be called once.'); - calledInstantiate = true; - return instantiate.call(loader, load); - })).then(function(result) { - if (calledInstantiate) - return result; - - if (result !== undefined) { - load.metadata.entry = createEntry(); - load.metadata.entry.execute = function() { + if (load.metadata.loaderModule && !loader.builder && load.metadata.format != 'defined') { + if (load.metadata.loaderModule.instantiate) + return Promise.resolve(load.metadata.loaderModule.instantiate.call(loader, load, function(load) { + if (calledInstantiate) + throw new Error('Instantiate must only be called once.'); + calledInstantiate = true; + return instantiate.call(loader, load); + })).then(function(result) { + if (calledInstantiate) return result; - } - load.metadata.entry.deps = load.metadata.deps; - load.metadata.format = 'defined'; - } - return instantiate.call(loader, load); - }); - else - return instantiate.call(loader, load); + + if (result !== undefined) + createInstantiate(load, result); + return instantiate.call(loader, load); + }); + else if (typeof load.metadata.loaderModule === 'function' || load.metadata.loaderModule instanceof Module && typeof load.metadata.loaderModule.default === 'function') + return Promise.resolve((load.metadata.loaderModule.default || load.metadata.loaderModule).call(loader, load.address, load.name)) + .then(function (result) { + if (result !== undefined) + createInstantiate(load, result); + return instantiate.call(loader, load); + }); + } + return instantiate.call(loader, load); }; }); @@ -5094,7 +5114,7 @@ hookConstructor(function(constructor) { System = new SystemJSLoader(); __global.SystemJS = System; -System.version = '0.19.41 Standard'; +System.version = '0.19.47 Standard'; if (typeof module == 'object' && module.exports && typeof exports == 'object') module.exports = System; diff --git a/node_modules/systemjs/index.js b/node_modules/systemjs/index.js index 6a958ecff..f8ebe41f2 100644 --- a/node_modules/systemjs/index.js +++ b/node_modules/systemjs/index.js @@ -7,18 +7,17 @@ var isWindows = typeof process.platform != 'undefined' && process.platform.match // set transpiler paths in Node var nodeResolver = typeof process != 'undefined' && typeof require != 'undefined' && require.resolve; -function configNodePath(loader, module, nodeModule, wildcard) { +function configNodePath(loader, module, nodeModule) { if (loader.paths[module]) return; - var ext = wildcard ? '/package.json' : ''; try { - var match = nodeResolver(nodeModule + ext).replace(/\\/g, '/'); + var match = nodeResolver(nodeModule + (module[module.length - 1] === '/' ? 'package.json' : '')).replace(/\\/g, '/'); } catch(e) {} - + if (match) - loader.paths[module] = 'file://' + (isWindows ? '/' : '') + match.substr(0, match.length - ext.length) + (wildcard ? '/*.js' : ''); + loader.paths[module] = 'file://' + (isWindows ? '/' : '') + match.substr(0, match.length - (module[module.length - 1] === '/' ? 12 : 0)); } var SystemJSLoader = require('./dist/system.src').constructor; @@ -32,7 +31,7 @@ function SystemJSNodeLoader() { configNodePath(this, 'traceur-runtime', 'traceur/bin/traceur-runtime.js'); configNodePath(this, 'babel', 'babel-core/browser.js'); configNodePath(this, 'babel/external-helpers', 'babel-core/external-helpers.js'); - configNodePath(this, 'babel-runtime/*', 'babel-runtime', true); + configNodePath(this, 'babel-runtime/', 'babel-runtime/'); } } SystemJSNodeLoader.prototype = Object.create(SystemJSLoader.prototype); diff --git a/node_modules/systemjs/package.json b/node_modules/systemjs/package.json index a32d45585..f4ceb08da 100644 --- a/node_modules/systemjs/package.json +++ b/node_modules/systemjs/package.json @@ -1,6 +1,6 @@ { "name": "systemjs", - "version": "0.19.41", + "version": "0.19.47", "description": "Universal dynamic module loader", "repository": { "type": "git", diff --git a/node_modules/through2/LICENSE b/node_modules/through2/LICENSE deleted file mode 100644 index f6a0029de..000000000 --- a/node_modules/through2/LICENSE +++ /dev/null @@ -1,39 +0,0 @@ -Copyright 2013, Rod Vagg (the "Original Author") -All rights reserved. - -MIT +no-false-attribs License - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -Distributions of all or part of the Software intended to be used -by the recipients as they would use the unmodified Software, -containing modifications that substantially alter, remove, or -disable functionality of the Software, outside of the documented -configuration mechanisms provided by the Software, shall be -modified such that the Original Author's bug reporting email -addresses and urls are either replaced with the contact information -of the parties responsible for the changes, or removed entirely. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - - -Except where noted, this license applies to any and all software -programs and associated documentation files created by the -Original Author, when distributed with the Software. \ No newline at end of file diff --git a/node_modules/through2/README.md b/node_modules/through2/README.md index c84b3464a..a916f15ef 100644 --- a/node_modules/through2/README.md +++ b/node_modules/through2/README.md @@ -20,6 +20,9 @@ fs.createReadStream('ex.txt') callback() })) .pipe(fs.createWriteStream('out.txt')) + .on('finish', function () { + doSomethingSpecial() + }) ``` Or object streams: diff --git a/node_modules/through2/package.json b/node_modules/through2/package.json index c7afac7f0..12d8fd665 100644 --- a/node_modules/through2/package.json +++ b/node_modules/through2/package.json @@ -1,6 +1,6 @@ { "name": "through2", - "version": "2.0.1", + "version": "2.0.3", "description": "A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise", "main": "through2.js", "scripts": { @@ -20,13 +20,13 @@ "author": "Rod Vagg (https://github.com/rvagg)", "license": "MIT", "dependencies": { - "readable-stream": "~2.0.0", - "xtend": "~4.0.0" + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" }, "devDependencies": { - "bl": "~0.9.4", + "bl": "~1.1.2", "faucet": "0.0.1", "stream-spigot": "~3.0.5", - "tape": "~4.0.0" + "tape": "~4.6.2" } } diff --git a/node_modules/typescript/.mailmap b/node_modules/typescript/.mailmap index cc101c051..73ebed0cc 100644 --- a/node_modules/typescript/.mailmap +++ b/node_modules/typescript/.mailmap @@ -1,18 +1,22 @@  AbubakerB # Abubaker Bashir Alexander # Alexander Kuvaev +Aluan Haddad Adam Freidin Adam Freidin Adi Dahiya Adi Dahiya Ahmad Farid ahmad-farid Alexander Rusakov Alex Eagle Anatoly Ressin -Anders Hejlsberg unknown unknown +Anders Hejlsberg unknown unknown Anders Hejlsberg +about-code # Andreas Martin Andrej Baran +Andrew Ochsner Andrew Z Allen Andy Hanson Andy Anil Anar Anton Tolmachev +Anubha Mathur anubmat Arnavion # Arnav Singh Arthur Ozga Arthur Ozga Arthur Ozga Arthur Ozga Arthur Ozga Asad Saeeduddin @@ -21,6 +25,7 @@ Basarat Ali Syed Basarat Syed basa Bill Ticehurst Bill Ticehurst Ben Duffield Ben Mosher +Benjamin Bock Blake Embrey Bowden Kelly Brett Mayen @@ -37,6 +42,7 @@ Dan Corder Dan Quirk Dan Quirk nknown Daniel Rosenwasser Daniel Rosenwasser Daniel Rosenwasser Daniel Rosenwasser Daniel Rosenwasser David Li +David Sheldrick David Souther Denis Nedelyaev Dick van den Brink unknown unknown @@ -45,6 +51,7 @@ Dirk Holtwick Dom Chen Doug Ilijev Erik Edrosa +Erik McClenney erictsangx # Eric Tsang Ethan Rubio Evan Martin @@ -52,6 +59,7 @@ Evan Sebastian Eyas # Eyas Sharaiha Fabian Cook falsandtru # @falsandtru +flowmemo # @flowmemo Frank Wallis FrantiÅ¡ek Žiacik FrantiÅ¡ek Žiacik Gabe Moothart @@ -62,13 +70,19 @@ Graeme Wicksted Guillaume Salles Guy Bedford guybedford Harald Niesche +Homa Wong +Hendrik Liebau Iain Monro +IgorNovozhilov # Igor Novozhilov Ingvar Stepanyan impinball # Isiah Meadows +Iwata Hidetaka Ivo Gabe de Wolff Jakub MÅ‚okosiewicz James Whitney +James Henry Jason Freeman Jason Freeman +Jason Jarrett Jason Killian Jason Ramsay jramsay Jed Mao @@ -81,7 +95,9 @@ Jonathan Park Jonathan Turner Jonathan Turner Jonathan Toland Jesse Schalken +Joel Day Josh Abernathy joshaber +Josh Goldberg Josh Kalderimis Josh Soref Juan Luis Boya García @@ -95,22 +111,31 @@ Kanchalai Tanglertsampan Yui T Kanchalai Tanglertsampan Yui Kanchalai Tanglertsampan Yui Kanchalai Tanglertsampan yui T +KÄrlis Gaņģis Keith Mashinter kmashint Ken Howard Kevin Lang kimamula # Kenji Imamula +Kitson Kelly +Klaus Meinhardt Kyle Kelley Lorant Pinter Lucien Greathouse Lukas Elmer Lukas Elmer +Magnus Hiie Martin Vseticka Martin VÅ¡eticka MartyIX gcnew # Marin Marinov vvakame # Masahiro Wakame -Matt McCutchen +Matt McCutchen Matt McCutchen +Matt Bierner +MANISH-GIRI # Manish Giri Max Deepfield Micah Zoltu Michael +Mike Busyrev +Mine Starks Mine Starks Mohamed Hegazy +ncoley # Natalie Coley Nathan Shively-Sanders Nathan Yee Nima Zahedi @@ -133,12 +158,14 @@ Rado Kirov Ron Buckton Ron Buckton rbuckton Rostislav Galimsky Richard Knoll Richard Knoll +Richard Karmazín Rowan Wyborn Ryan Cavanaugh Ryan Cavanaugh Ryan Cavanaugh Ryohei Ikegami Sarangan Rajamanickam Sébastien Arod Sergey Shandar +chico # Sergey Rubanov Sheetal Nandi Shengping Zhong shyyko.serhiy@gmail.com # Shyyko Serhiy @@ -146,6 +173,7 @@ Sam El-Husseini Simon Hürlimann Slawomir Sadziak Solal Pirelli +Soo Jae Hwang Stan Thomas Stanislav Sysoev Steve Lucco steveluc @@ -163,6 +191,7 @@ Torben Fitschen TruongSinh Tran-Nguyen vilicvane # Vilic Vane Vladimir Matveev vladima v2m +Vadi Taslim Wesley Wigham Wesley Wigham York Yao york yao yaoyao Yuichi Nukiyama YuichiNukiyama @@ -172,4 +201,51 @@ zhongsp # Patrick Zhong T18970237136 # @T18970237136 JBerger bootstraponline # @bootstraponline -yortus # @yortus \ No newline at end of file +yortus # @yortus +András Parditka +Anton Khlynovskiy +Charly POLY +Cotton Hou +Ethan Resnick +Marius Schulz +Mattias Buelens +Myles Megyesi +Tim Lancina +Aaron Holmes Aaron Holmes +Akshar Patel +Ali Sabzevari +Aliaksandr Radzivanovich +BuildTools # Franklin Tse +ChogyDan # Daniel Hollocher +Daniel Rosenwasser Daniel Rosenwasser +DLehenbauer # Daniel Lehenbauer +David Kmenta +E020873 # Nicolas Henry +Elisée Maurer +Emilio García-Pumarino dashaus +Guilherme Oenning +Herrington Darkholme +Ivo Gabe de Wolff +Joey Wilson +Jonathon Smith +Juan Luis Boya García +Kagami Sascha Rosylight +Lucien Greathouse +Martin Vseticka +Mattias Buelens +Michael Bromley +Paul Jolly +Perry Jiang +Peter Burns +Robert Coie +Thomas Loubiou +Tim Perry +Vidar Tonaas Fauske +Viktor Zozulyak +rix # Richard Sentino +rohitverma007 # Rohit Verma +rdosanjh # Raj Dosanjh +gdh1995 # Dahan Gong +cedvdb # @cedvdb +kpreisser # K. Preißer +e-cloud # @e-cloud \ No newline at end of file diff --git a/node_modules/typescript/.npmignore b/node_modules/typescript/.npmignore index 02d8fe428..d3c27afef 100644 --- a/node_modules/typescript/.npmignore +++ b/node_modules/typescript/.npmignore @@ -1,8 +1,11 @@ built doc +Gulpfile.ts internal issue_template.md +jenkins.sh lib/README.md +netci.groovy pull_request_template.md scripts src diff --git a/node_modules/typescript/AUTHORS.md b/node_modules/typescript/AUTHORS.md index 50f1ea12c..4772d5371 100644 --- a/node_modules/typescript/AUTHORS.md +++ b/node_modules/typescript/AUTHORS.md @@ -1,18 +1,28 @@ TypeScript is authored by: +* Aaron Holmes * Abubaker Bashir * Adam Freidin * Adi Dahiya * Ahmad Farid +* Akshar Patel * Alex Eagle * Alexander Kuvaev * Alexander Rusakov +* Ali Sabzevari +* Aliaksandr Radzivanovich +* Aluan Haddad * Anatoly Ressin * Anders Hejlsberg +* Andreas Martin * Andrej Baran +* Andrew Ochsner * Andrew Z Allen +* András Parditka * Andy Hanson * Anil Anar +* Anton Khlynovskiy * Anton Tolmachev +* Anubha Mathur * Arnav Singh * Arthur Ozga * Asad Saeeduddin @@ -20,6 +30,7 @@ TypeScript is authored by: * Basarat Ali Syed * Ben Duffield * Ben Mosher +* Benjamin Bock * Bill Ticehurst * Blake Embrey * @bootstraponline @@ -27,17 +38,25 @@ TypeScript is authored by: * Brett Mayen * Bryan Forbes * Caitlin Potter +* @cedvdb +* Charly POLY * Chris Bubernak * Christophe Vidal * Chuck Jazdzewski * Colby Russell * Colin Snover +* Cotton Hou * Cyrus Najmabadi * Dafrok Zhang +* Dahan Gong * Dan Corder * Dan Quirk +* Daniel Hollocher +* Daniel Lehenbauer * Daniel Rosenwasser +* David Kmenta * David Li +* David Sheldrick * David Souther * Denis Nedelyaev * Dick van den Brink @@ -45,32 +64,46 @@ TypeScript is authored by: * Dirk Holtwick * Dom Chen * Doug Ilijev +* @e-cloud +* Elisée Maurer +* Emilio García-Pumarino * Eric Tsang * Erik Edrosa +* Erik McClenney +* Ethan Resnick * Ethan Rubio * Evan Martin * Evan Sebastian * Eyas Sharaiha * Fabian Cook * @falsandtru +* @flowmemo * Frank Wallis +* Franklin Tse * FrantiÅ¡ek Žiacik * Gabe Moothart * Gabriel Isenberg * Gilad Peleg * Godfrey Chan * Graeme Wicksted +* Guilherme Oenning * Guillaume Salles * Guy Bedford * Harald Niesche +* Hendrik Liebau * Herrington Darkholme +* Homa Wong * Iain Monro +* Igor Novozhilov * Ingvar Stepanyan * Isiah Meadows * Ivo Gabe de Wolff +* Iwata Hidetaka * Jakub MÅ‚okosiewicz +* James Henry * James Whitney * Jason Freeman +* Jason Jarrett * Jason Killian * Jason Ramsay * JBerger @@ -78,39 +111,59 @@ TypeScript is authored by: * Jeffrey Morlan * Jesse Schalken * Jiri Tobisek +* Joel Day +* Joey Wilson * Johannes Rieken * John Vilk * Jonathan Bond-Caron * Jonathan Park * Jonathan Toland * Jonathan Turner +* Jonathon Smith * Josh Abernathy +* Josh Goldberg * Josh Kalderimis * Josh Soref * Juan Luis Boya García * Julian Williams * Justin Bay * Justin Johansson +* K. Preißer * Kagami Sascha Rosylight * Kanchalai Tanglertsampan * Keith Mashinter * Ken Howard * Kenji Imamula * Kevin Lang +* Kitson Kelly +* Klaus Meinhardt * Kyle Kelley +* KÄrlis Gaņģis * Lorant Pinter * Lucien Greathouse * Lukas Elmer +* Magnus Hiie +* Manish Giri * Marin Marinov +* Marius Schulz * Martin Vseticka * Masahiro Wakame +* Matt Bierner * Matt McCutchen +* Mattias Buelens +* Mattias Buelens * Max Deepfield * Micah Zoltu * Michael +* Michael Bromley +* Mike Busyrev +* Mine Starks * Mohamed Hegazy +* Myles Megyesi +* Natalie Coley * Nathan Shively-Sanders * Nathan Yee +* Nicolas Henry * Nima Zahedi * Noah Chen * Noj Vek @@ -119,9 +172,12 @@ TypeScript is authored by: * Omer Sheikh * Oskar Segersva¨rd * Patrick Zhong +* Paul Jolly * Paul van Brenk * @pcbro * Pedro Maltez +* Perry Jiang +* Peter Burns * Philip Bulley * Piero Cangianiello * @piloopin @@ -129,7 +185,12 @@ TypeScript is authored by: * @progre * Punya Biswal * Rado Kirov +* Raj Dosanjh +* Richard Karmazín * Richard Knoll +* Richard Sentino +* Robert Coie +* Rohit Verma * Ron Buckton * Rostislav Galimsky * Rowan Wyborn @@ -137,6 +198,7 @@ TypeScript is authored by: * Ryohei Ikegami * Sam El-Husseini * Sarangan Rajamanickam +* Sergey Rubanov * Sergey Shandar * Sheetal Nandi * Shengping Zhong @@ -144,6 +206,7 @@ TypeScript is authored by: * Simon Hürlimann * Slawomir Sadziak * Solal Pirelli +* Soo Jae Hwang * Stan Thomas * Stanislav Sysoev * Steve Lucco @@ -152,7 +215,9 @@ TypeScript is authored by: * @T18970237136 * Tarik Ozket * Tetsuharu Ohzeki +* Thomas Loubiou * Tien Hoanhtien +* Tim Lancina * Tim Perry * Tim Viiding-Spader * Tingan Ho @@ -161,6 +226,9 @@ TypeScript is authored by: * Tomas Grubliauskas * Torben Fitschen * TruongSinh Tran-Nguyen +* Vadi Taslim +* Vidar Tonaas Fauske +* Viktor Zozulyak * Vilic Vane * Vladimir Matveev * Wesley Wigham diff --git a/node_modules/typescript/Gulpfile.ts b/node_modules/typescript/Gulpfile.ts deleted file mode 100644 index 054e99c80..000000000 --- a/node_modules/typescript/Gulpfile.ts +++ /dev/null @@ -1,1046 +0,0 @@ -/// -import * as cp from "child_process"; -import * as path from "path"; -import * as fs from "fs"; -import originalGulp = require("gulp"); -import helpMaker = require("gulp-help"); -import runSequence = require("run-sequence"); -import concat = require("gulp-concat"); -import clone = require("gulp-clone"); -import newer = require("gulp-newer"); -import tsc = require("gulp-typescript"); -declare module "gulp-typescript" { - interface Settings { - pretty?: boolean; - newLine?: string; - noImplicitThis?: boolean; - stripInternal?: boolean; - types?: string[]; - } -} -import * as insert from "gulp-insert"; -import * as sourcemaps from "gulp-sourcemaps"; -import Q = require("q"); -declare global { - // `del` further depends on `Promise` (and is also not included), so we just, patch the global scope's Promise to Q's (which we already include in our deps because gulp depends on it) - type Promise = Q.Promise; -} -import del = require("del"); -import mkdirP = require("mkdirp"); -import minimist = require("minimist"); -import browserify = require("browserify"); -import through2 = require("through2"); -import merge2 = require("merge2"); -import intoStream = require("into-stream"); -import * as os from "os"; -import fold = require("travis-fold"); -const gulp = helpMaker(originalGulp); -const mochaParallel = require("./scripts/mocha-parallel.js"); -const {runTestsInParallel} = mochaParallel; - -Error.stackTraceLimit = 1000; - -const cmdLineOptions = minimist(process.argv.slice(2), { - boolean: ["debug", "light", "colors", "lint", "soft"], - string: ["browser", "tests", "host", "reporter", "stackTraceLimit"], - alias: { - d: "debug", - t: "tests", - test: "tests", - r: "reporter", - color: "colors", - f: "files", - file: "files" - }, - default: { - soft: false, - colors: process.env.colors || process.env.color || true, - debug: process.env.debug || process.env.d, - host: process.env.TYPESCRIPT_HOST || process.env.host || "node", - browser: process.env.browser || process.env.b || "IE", - tests: process.env.test || process.env.tests || process.env.t, - light: process.env.light || false, - reporter: process.env.reporter || process.env.r, - lint: process.env.lint || true, - files: process.env.f || process.env.file || process.env.files || "", - } -}); - -function exec(cmd: string, args: string[], complete: () => void = (() => { }), error: (e: any, status: number) => void = (() => { })) { - console.log(`${cmd} ${args.join(" ")}`); - // TODO (weswig): Update child_process types to add windowsVerbatimArguments to the type definition - const subshellFlag = isWin ? "/c" : "-c"; - const command = isWin ? [possiblyQuote(cmd), ...args] : [`${cmd} ${args.join(" ")}`]; - const ex = cp.spawn(isWin ? "cmd" : "/bin/sh", [subshellFlag, ...command], { stdio: "inherit", windowsVerbatimArguments: true } as any); - ex.on("exit", (code) => code === 0 ? complete() : error(/*e*/ undefined, code)); - ex.on("error", error); -} - -function possiblyQuote(cmd: string) { - return cmd.indexOf(" ") >= 0 ? `"${cmd}"` : cmd; -} - -let useDebugMode = true; -let host = cmdLineOptions["host"]; - -// Constants -const compilerDirectory = "src/compiler/"; -const harnessDirectory = "src/harness/"; -const libraryDirectory = "src/lib/"; -const scriptsDirectory = "scripts/"; -const docDirectory = "doc/"; - -const builtDirectory = "built/"; -const builtLocalDirectory = "built/local/"; -const LKGDirectory = "lib/"; - -const copyright = "CopyrightNotice.txt"; - -const compilerFilename = "tsc.js"; -const LKGCompiler = path.join(LKGDirectory, compilerFilename); -const builtLocalCompiler = path.join(builtLocalDirectory, compilerFilename); - -const nodeModulesPathPrefix = path.resolve("./node_modules/.bin/"); -const isWin = /^win/.test(process.platform); -const mocha = path.join(nodeModulesPathPrefix, "mocha") + (isWin ? ".cmd" : ""); - -const es2015LibrarySources = [ - "es2015.core.d.ts", - "es2015.collection.d.ts", - "es2015.generator.d.ts", - "es2015.iterable.d.ts", - "es2015.promise.d.ts", - "es2015.proxy.d.ts", - "es2015.reflect.d.ts", - "es2015.symbol.d.ts", - "es2015.symbol.wellknown.d.ts" -]; - -const es2015LibrarySourceMap = es2015LibrarySources.map(function(source) { - return { target: "lib." + source, sources: ["header.d.ts", source] }; -}); - -const es2016LibrarySource = ["es2016.array.include.d.ts"]; - -const es2016LibrarySourceMap = es2016LibrarySource.map(function(source) { - return { target: "lib." + source, sources: ["header.d.ts", source] }; -}); - -const es2017LibrarySource = [ - "es2017.object.d.ts", - "es2017.sharedmemory.d.ts", - "es2017.string.d.ts", -]; - -const es2017LibrarySourceMap = es2017LibrarySource.map(function(source) { - return { target: "lib." + source, sources: ["header.d.ts", source] }; -}); - -const hostsLibrarySources = ["dom.generated.d.ts", "webworker.importscripts.d.ts", "scripthost.d.ts"]; - -const librarySourceMap = [ - // Host library - { target: "lib.dom.d.ts", sources: ["header.d.ts", "dom.generated.d.ts"] }, - { target: "lib.dom.iterable.d.ts", sources: ["header.d.ts", "dom.iterable.d.ts"] }, - { target: "lib.webworker.d.ts", sources: ["header.d.ts", "webworker.generated.d.ts"] }, - { target: "lib.scripthost.d.ts", sources: ["header.d.ts", "scripthost.d.ts"] }, - - // JavaScript library - { target: "lib.es5.d.ts", sources: ["header.d.ts", "es5.d.ts"] }, - { target: "lib.es2015.d.ts", sources: ["header.d.ts", "es2015.d.ts"] }, - { target: "lib.es2016.d.ts", sources: ["header.d.ts", "es2016.d.ts"] }, - { target: "lib.es2017.d.ts", sources: ["header.d.ts", "es2017.d.ts"] }, - - // JavaScript + all host library - { target: "lib.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(hostsLibrarySources) }, - { target: "lib.es6.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(es2015LibrarySources, hostsLibrarySources, "dom.iterable.d.ts") } -].concat(es2015LibrarySourceMap, es2016LibrarySourceMap, es2017LibrarySourceMap); - -const libraryTargets = librarySourceMap.map(function(f) { - return path.join(builtLocalDirectory, f.target); -}); - -for (const i in libraryTargets) { - const entry = librarySourceMap[i]; - const target = libraryTargets[i]; - const sources = [copyright].concat(entry.sources.map(function(s) { - return path.join(libraryDirectory, s); - })); - gulp.task(target, false, [], function() { - return gulp.src(sources) - .pipe(newer(target)) - .pipe(concat(target, { newLine: "\n\n" })) - .pipe(gulp.dest(".")); - }); -} - -const configureNightlyJs = path.join(scriptsDirectory, "configureNightly.js"); -const configureNightlyTs = path.join(scriptsDirectory, "configureNightly.ts"); -const packageJson = "package.json"; -const versionFile = path.join(compilerDirectory, "core.ts"); - -function needsUpdate(source: string | string[], dest: string | string[]): boolean { - if (typeof source === "string" && typeof dest === "string") { - if (fs.existsSync(dest)) { - const {mtime: outTime} = fs.statSync(dest); - const {mtime: inTime} = fs.statSync(source); - if (+inTime <= +outTime) { - return false; - } - } - } - else if (typeof source === "string" && typeof dest !== "string") { - const {mtime: inTime} = fs.statSync(source); - for (const filepath of dest) { - if (fs.existsSync(filepath)) { - const {mtime: outTime} = fs.statSync(filepath); - if (+inTime > +outTime) { - return true; - } - } - else { - return true; - } - } - return false; - } - else if (typeof source !== "string" && typeof dest === "string") { - if (fs.existsSync(dest)) { - const {mtime: outTime} = fs.statSync(dest); - for (const filepath of source) { - if (fs.existsSync(filepath)) { - const {mtime: inTime} = fs.statSync(filepath); - if (+inTime > +outTime) { - return true; - } - } - else { - return true; - } - } - return false; - } - } - else if (typeof source !== "string" && typeof dest !== "string") { - for (let i = 0; i < source.length; i++) { - if (!dest[i]) { - continue; - } - if (fs.existsSync(dest[i])) { - const {mtime: outTime} = fs.statSync(dest[i]); - const {mtime: inTime} = fs.statSync(source[i]); - if (+inTime > +outTime) { - return true; - } - } - else { - return true; - } - } - return false; - } - return true; -} - -function getCompilerSettings(base: tsc.Settings, useBuiltCompiler?: boolean): tsc.Settings { - const copy: tsc.Settings = {}; - copy.noEmitOnError = true; - copy.noImplicitAny = true; - copy.noImplicitThis = true; - copy.pretty = true; - copy.types = []; - for (const key in base) { - copy[key] = base[key]; - } - if (!useDebugMode) { - if (copy.removeComments === undefined) copy.removeComments = true; - copy.newLine = "lf"; - } - else { - copy.preserveConstEnums = true; - } - if (useBuiltCompiler === true) { - copy.typescript = require("./built/local/typescript.js"); - } - else if (useBuiltCompiler === false) { - copy.typescript = require("./lib/typescript.js"); - } - return copy; -} - -gulp.task(configureNightlyJs, false, [], () => { - const settings: tsc.Settings = { - declaration: false, - removeComments: true, - noResolve: false, - stripInternal: false, - }; - return gulp.src(configureNightlyTs) - .pipe(sourcemaps.init()) - .pipe(tsc(settings)) - .pipe(sourcemaps.write(path.dirname(configureNightlyJs))) - .pipe(gulp.dest(path.dirname(configureNightlyJs))); -}); - - -// Nightly management tasks -gulp.task("configure-nightly", "Runs scripts/configureNightly.ts to prepare a build for nightly publishing", [configureNightlyJs], (done) => { - exec(host, [configureNightlyJs, packageJson, versionFile], done, done); -}); -gulp.task("publish-nightly", "Runs `npm publish --tag next` to create a new nightly build on npm", ["LKG"], () => { - return runSequence("clean", "useDebugMode", "runtests", (done) => { - exec("npm", ["publish", "--tag", "next"], done, done); - }); -}); - -const importDefinitelyTypedTestsDirectory = path.join(scriptsDirectory, "importDefinitelyTypedTests"); -const importDefinitelyTypedTestsJs = path.join(importDefinitelyTypedTestsDirectory, "importDefinitelyTypedTests.js"); -const importDefinitelyTypedTestsTs = path.join(importDefinitelyTypedTestsDirectory, "importDefinitelyTypedTests.ts"); - -gulp.task(importDefinitelyTypedTestsJs, false, [], () => { - const settings: tsc.Settings = getCompilerSettings({ - declaration: false, - removeComments: true, - noResolve: false, - stripInternal: false, - outFile: importDefinitelyTypedTestsJs - }, /*useBuiltCompiler*/ false); - return gulp.src(importDefinitelyTypedTestsTs) - .pipe(sourcemaps.init()) - .pipe(tsc(settings)) - .pipe(sourcemaps.write(".")) - .pipe(gulp.dest(".")); -}); - -gulp.task("importDefinitelyTypedTests", "Runs scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.ts to copy DT's tests to the TS-internal RWC tests", [importDefinitelyTypedTestsJs], (done) => { - exec(host, [importDefinitelyTypedTestsJs, "./", "../DefinitelyTyped"], done, done); -}); - -gulp.task("lib", "Builds the library targets", libraryTargets); - - -// Generate diagnostics -const processDiagnosticMessagesJs = path.join(scriptsDirectory, "processDiagnosticMessages.js"); -const processDiagnosticMessagesTs = path.join(scriptsDirectory, "processDiagnosticMessages.ts"); -const diagnosticMessagesJson = path.join(compilerDirectory, "diagnosticMessages.json"); -const diagnosticInfoMapTs = path.join(compilerDirectory, "diagnosticInformationMap.generated.ts"); -const generatedDiagnosticMessagesJSON = path.join(compilerDirectory, "diagnosticMessages.generated.json"); -const builtGeneratedDiagnosticMessagesJSON = path.join(builtLocalDirectory, "diagnosticMessages.generated.json"); - -// processDiagnosticMessages script -gulp.task(processDiagnosticMessagesJs, false, [], () => { - const settings: tsc.Settings = getCompilerSettings({ - declaration: false, - removeComments: true, - noResolve: false, - stripInternal: false, - outFile: processDiagnosticMessagesJs - }, /*useBuiltCompiler*/ false); - return gulp.src(processDiagnosticMessagesTs) - .pipe(newer(processDiagnosticMessagesJs)) - .pipe(sourcemaps.init()) - .pipe(tsc(settings)) - .pipe(sourcemaps.write(".")) - .pipe(gulp.dest(".")); -}); - -// The generated diagnostics map; built for the compiler and for the "generate-diagnostics" task -gulp.task(diagnosticInfoMapTs, [processDiagnosticMessagesJs], (done) => { - if (needsUpdate(diagnosticMessagesJson, [generatedDiagnosticMessagesJSON, diagnosticInfoMapTs])) { - exec(host, [processDiagnosticMessagesJs, diagnosticMessagesJson], done, done); - } - else { - done(); - } -}); - -gulp.task(builtGeneratedDiagnosticMessagesJSON, [diagnosticInfoMapTs], (done) => { - if (fs.existsSync(builtLocalDirectory) && needsUpdate(generatedDiagnosticMessagesJSON, builtGeneratedDiagnosticMessagesJSON)) { - fs.writeFileSync(builtGeneratedDiagnosticMessagesJSON, fs.readFileSync(generatedDiagnosticMessagesJSON)); - } - done(); -}); - -gulp.task("generate-diagnostics", "Generates a diagnostic file in TypeScript based on an input JSON file", [diagnosticInfoMapTs]); - - -const servicesFile = path.join(builtLocalDirectory, "typescriptServices.js"); -const standaloneDefinitionsFile = path.join(builtLocalDirectory, "typescriptServices.d.ts"); -const nodePackageFile = path.join(builtLocalDirectory, "typescript.js"); -const nodeDefinitionsFile = path.join(builtLocalDirectory, "typescript.d.ts"); -const nodeStandaloneDefinitionsFile = path.join(builtLocalDirectory, "typescript_standalone.d.ts"); - -let copyrightContent: string; -function prependCopyright(outputCopyright: boolean = !useDebugMode) { - return insert.prepend(outputCopyright ? (copyrightContent || (copyrightContent = fs.readFileSync(copyright).toString())) : ""); -} - -gulp.task(builtLocalCompiler, false, [servicesFile], () => { - const localCompilerProject = tsc.createProject("src/compiler/tsconfig.json", getCompilerSettings({}, /*useBuiltCompiler*/true)); - return localCompilerProject.src() - .pipe(newer(builtLocalCompiler)) - .pipe(sourcemaps.init()) - .pipe(localCompilerProject()) - .pipe(prependCopyright()) - .pipe(sourcemaps.write(".")) - .pipe(gulp.dest(".")); -}); - -gulp.task(servicesFile, false, ["lib", "generate-diagnostics"], () => { - const servicesProject = tsc.createProject("src/services/tsconfig.json", getCompilerSettings({ removeComments: false }, /*useBuiltCompiler*/false)); - const {js, dts} = servicesProject.src() - .pipe(newer(servicesFile)) - .pipe(sourcemaps.init()) - .pipe(servicesProject()); - const completedJs = js.pipe(prependCopyright()) - .pipe(sourcemaps.write(".")); - const completedDts = dts.pipe(prependCopyright(/*outputCopyright*/true)) - .pipe(insert.transform((contents, file) => { - file.path = standaloneDefinitionsFile; - return contents.replace(/^(\s*)(export )?const enum (\S+) {(\s*)$/gm, "$1$2enum $3 {$4"); - })); - return merge2([ - completedJs, - completedJs.pipe(clone()) - .pipe(insert.transform((content, file) => (file.path = nodePackageFile, content))), - completedDts, - completedDts.pipe(clone()) - .pipe(insert.transform((content, file) => { - file.path = nodeDefinitionsFile; - return content + "\r\nexport = ts;"; - })) - .pipe(gulp.dest(".")), - completedDts.pipe(clone()) - .pipe(insert.transform((content, file) => { - file.path = nodeStandaloneDefinitionsFile; - return content.replace(/declare (namespace|module) ts/g, 'declare module "typescript"'); - })) - ]).pipe(gulp.dest(".")); -}); - -// cancellationToken.js -const cancellationTokenJs = path.join(builtLocalDirectory, "cancellationToken.js"); -gulp.task(cancellationTokenJs, false, [servicesFile], () => { - const cancellationTokenProject = tsc.createProject("src/server/cancellationToken/tsconfig.json", getCompilerSettings({}, /*useBuiltCompiler*/true)); - return cancellationTokenProject.src() - .pipe(newer(cancellationTokenJs)) - .pipe(sourcemaps.init()) - .pipe(cancellationTokenProject()) - .pipe(prependCopyright()) - .pipe(sourcemaps.write(".")) - .pipe(gulp.dest(builtLocalDirectory)); -}); - -// typingsInstallerFile.js -const typingsInstallerJs = path.join(builtLocalDirectory, "typingsInstaller.js"); -gulp.task(typingsInstallerJs, false, [servicesFile], () => { - const cancellationTokenProject = tsc.createProject("src/server/typingsInstaller/tsconfig.json", getCompilerSettings({}, /*useBuiltCompiler*/true)); - return cancellationTokenProject.src() - .pipe(newer(typingsInstallerJs)) - .pipe(sourcemaps.init()) - .pipe(cancellationTokenProject()) - .pipe(prependCopyright()) - .pipe(sourcemaps.write(".")) - .pipe(gulp.dest(".")); -}); - -const serverFile = path.join(builtLocalDirectory, "tsserver.js"); - -gulp.task(serverFile, false, [servicesFile, typingsInstallerJs, cancellationTokenJs], () => { - const serverProject = tsc.createProject("src/server/tsconfig.json", getCompilerSettings({}, /*useBuiltCompiler*/true)); - return serverProject.src() - .pipe(newer(serverFile)) - .pipe(sourcemaps.init()) - .pipe(serverProject()) - .pipe(prependCopyright()) - .pipe(sourcemaps.write(".")) - .pipe(gulp.dest(".")); -}); - -const tsserverLibraryFile = path.join(builtLocalDirectory, "tsserverlibrary.js"); -const tsserverLibraryDefinitionFile = path.join(builtLocalDirectory, "tsserverlibrary.d.ts"); - -gulp.task(tsserverLibraryFile, false, [servicesFile], (done) => { - const serverLibraryProject = tsc.createProject("src/server/tsconfig.library.json", getCompilerSettings({}, /*useBuiltCompiler*/ true)); - const {js, dts}: { js: NodeJS.ReadableStream, dts: NodeJS.ReadableStream } = serverLibraryProject.src() - .pipe(sourcemaps.init()) - .pipe(newer(tsserverLibraryFile)) - .pipe(serverLibraryProject()); - - return merge2([ - js.pipe(prependCopyright()) - .pipe(sourcemaps.write(".")) - .pipe(gulp.dest(".")), - dts.pipe(prependCopyright()) - .pipe(gulp.dest(".")) - ]); -}); - -gulp.task("lssl", "Builds language service server library", [tsserverLibraryFile]); -gulp.task("local", "Builds the full compiler and services", [builtLocalCompiler, servicesFile, serverFile, builtGeneratedDiagnosticMessagesJSON, tsserverLibraryFile]); -gulp.task("tsc", "Builds only the compiler", [builtLocalCompiler]); - -// Generate Markdown spec -const word2mdJs = path.join(scriptsDirectory, "word2md.js"); -const word2mdTs = path.join(scriptsDirectory, "word2md.ts"); -const specWord = path.join(docDirectory, "TypeScript Language Specification.docx"); -const specMd = path.join(docDirectory, "spec.md"); - -gulp.task(word2mdJs, false, [], () => { - const settings: tsc.Settings = getCompilerSettings({ - outFile: word2mdJs - }, /*useBuiltCompiler*/ false); - return gulp.src(word2mdTs) - .pipe(newer(word2mdJs)) - .pipe(sourcemaps.init()) - .pipe(tsc(settings)) - .pipe(sourcemaps.write(".")) - .pipe(gulp.dest(".")); -}); - -gulp.task(specMd, false, [word2mdJs], (done) => { - const specWordFullPath = path.resolve(specWord); - const specMDFullPath = path.resolve(specMd); - const cmd = "cscript //nologo " + word2mdJs + " \"" + specWordFullPath + "\" " + "\"" + specMDFullPath + "\""; - console.log(cmd); - cp.exec(cmd, function() { - done(); - }); -}); - -gulp.task("generate-spec", "Generates a Markdown version of the Language Specification", [specMd]); - -gulp.task("clean", "Cleans the compiler output, declare files, and tests", [], () => { - return del([builtDirectory]); -}); - -gulp.task("useDebugMode", false, [], (done) => { useDebugMode = true; done(); }); -gulp.task("dontUseDebugMode", false, [], (done) => { useDebugMode = false; done(); }); - -gulp.task("VerifyLKG", false, [], () => { - const expectedFiles = [builtLocalCompiler, servicesFile, serverFile, nodePackageFile, nodeDefinitionsFile, standaloneDefinitionsFile, tsserverLibraryFile, tsserverLibraryDefinitionFile, typingsInstallerJs, cancellationTokenJs].concat(libraryTargets); - const missingFiles = expectedFiles.filter(function(f) { - return !fs.existsSync(f); - }); - if (missingFiles.length > 0) { - throw new Error("Cannot replace the LKG unless all built targets are present in directory " + builtLocalDirectory + - ". The following files are missing:\n" + missingFiles.join("\n")); - } - // Copy all the targets into the LKG directory - return gulp.src(expectedFiles).pipe(gulp.dest(LKGDirectory)); -}); - -gulp.task("LKGInternal", false, ["lib", "local"]); - -gulp.task("LKG", "Makes a new LKG out of the built js files", ["clean", "dontUseDebugMode"], () => { - return runSequence("LKGInternal", "VerifyLKG"); -}); - - -// Task to build the tests infrastructure using the built compiler -const run = path.join(builtLocalDirectory, "run.js"); -gulp.task(run, false, [servicesFile], () => { - const testProject = tsc.createProject("src/harness/tsconfig.json", getCompilerSettings({}, /*useBuiltCompiler*/true)); - return testProject.src() - .pipe(newer(run)) - .pipe(sourcemaps.init()) - .pipe(testProject()) - .pipe(sourcemaps.write(".", { includeContent: false, sourceRoot: "../../" })) - .pipe(gulp.dest(".")); -}); - -const internalTests = "internal/"; - -const localBaseline = "tests/baselines/local/"; -const refBaseline = "tests/baselines/reference/"; - -const localRwcBaseline = path.join(internalTests, "baselines/rwc/local"); -const refRwcBaseline = path.join(internalTests, "baselines/rwc/reference"); - -const localTest262Baseline = path.join(internalTests, "baselines/test262/local"); - -gulp.task("tests", "Builds the test infrastructure using the built compiler", [run]); -gulp.task("tests-debug", "Builds the test sources and automation in debug mode", () => { - return runSequence("useDebugMode", "tests"); -}); - -function deleteTemporaryProjectOutput() { - return del(path.join(localBaseline, "projectOutput/")); -} - -let savedNodeEnv: string; -function setNodeEnvToDevelopment() { - savedNodeEnv = process.env.NODE_ENV; - process.env.NODE_ENV = "development"; -} - -function restoreSavedNodeEnv() { - process.env.NODE_ENV = savedNodeEnv; -} - -let testTimeout = 40000; -function runConsoleTests(defaultReporter: string, runInParallel: boolean, done: (e?: any) => void) { - const lintFlag = cmdLineOptions["lint"]; - cleanTestDirs((err) => { - if (err) { console.error(err); failWithStatus(err, 1); } - const debug = cmdLineOptions["debug"]; - const tests = cmdLineOptions["tests"]; - const light = cmdLineOptions["light"]; - const stackTraceLimit = cmdLineOptions["stackTraceLimit"]; - const testConfigFile = "test.config"; - if (fs.existsSync(testConfigFile)) { - fs.unlinkSync(testConfigFile); - } - let workerCount, taskConfigsFolder; - if (runInParallel) { - // generate name to store task configuration files - const prefix = os.tmpdir() + "/ts-tests"; - let i = 1; - do { - taskConfigsFolder = prefix + i; - i++; - } while (fs.existsSync(taskConfigsFolder)); - fs.mkdirSync(taskConfigsFolder); - - workerCount = process.env.workerCount || os.cpus().length; - } - - if (tests || light || taskConfigsFolder) { - writeTestConfigFile(tests, light, taskConfigsFolder, workerCount, stackTraceLimit); - } - - if (tests && tests.toLocaleLowerCase() === "rwc") { - testTimeout = 400000; - } - - const colors = cmdLineOptions["colors"]; - const reporter = cmdLineOptions["reporter"] || defaultReporter; - - // timeout normally isn"t necessary but Travis-CI has been timing out on compiler baselines occasionally - // default timeout is 2sec which really should be enough, but maybe we just need a small amount longer - if (!runInParallel) { - const args = []; - if (debug) { - args.push("--debug-brk"); - } - args.push("-R", reporter); - if (tests) { - args.push("-g", `"${tests}"`); - } - if (colors) { - args.push("--colors"); - } - else { - args.push("--no-colors"); - } - args.push("-t", testTimeout); - args.push(run); - setNodeEnvToDevelopment(); - exec(mocha, args, lintThenFinish, function(e, status) { - finish(e, status); - }); - - } - else { - // run task to load all tests and partition them between workers - const args = []; - args.push("-R", "min"); - if (colors) { - args.push("--colors"); - } - else { - args.push("--no-colors"); - } - args.push(run); - setNodeEnvToDevelopment(); - runTestsInParallel(taskConfigsFolder, run, { testTimeout: testTimeout, noColors: colors === " --no-colors " }, function(err) { - // last worker clean everything and runs linter in case if there were no errors - del(taskConfigsFolder).then(() => { - if (!err) { - lintThenFinish(); - } - else { - finish(err); - } - }); - }); - } - }); - - function failWithStatus(err?: any, status?: number) { - if (err) { - console.log(err); - } - done(err || status); - process.exit(status); - } - - function lintThenFinish() { - if (lintFlag) { - runSequence("lint", finish); - } - else { - finish(); - } - } - - function finish(error?: any, errorStatus?: number) { - restoreSavedNodeEnv(); - deleteTemporaryProjectOutput().then(() => { - if (error !== undefined || errorStatus !== undefined) { - failWithStatus(error, errorStatus); - } - else { - done(); - } - }); - } -} - -gulp.task("runtests-parallel", "Runs all the tests in parallel using the built run.js file. Optional arguments are: --t[ests]=category1|category2|... --d[ebug]=true.", ["build-rules", "tests"], (done) => { - runConsoleTests("min", /*runInParallel*/ true, done); -}); -gulp.task("runtests", - "Runs the tests using the built run.js file. Optional arguments are: --t[ests]=regex --r[eporter]=[list|spec|json|] --d[ebug]=true --color[s]=false --lint=true.", - ["build-rules", "tests"], - (done) => { - runConsoleTests("mocha-fivemat-progress-reporter", /*runInParallel*/ false, done); - }); - -const nodeServerOutFile = "tests/webTestServer.js"; -const nodeServerInFile = "tests/webTestServer.ts"; -gulp.task(nodeServerOutFile, false, [servicesFile], () => { - const settings: tsc.Settings = getCompilerSettings({ module: "commonjs" }, /*useBuiltCompiler*/ true); - return gulp.src(nodeServerInFile) - .pipe(newer(nodeServerOutFile)) - .pipe(sourcemaps.init()) - .pipe(tsc(settings)) - .pipe(sourcemaps.write(".")) - .pipe(gulp.dest(path.dirname(nodeServerOutFile))); -}); - -import convertMap = require("convert-source-map"); -import sorcery = require("sorcery"); -declare module "convert-source-map" { - export function fromSource(source: string, largeSource?: boolean): SourceMapConverter; -} - -gulp.task("browserify", "Runs browserify on run.js to produce a file suitable for running tests in the browser", [servicesFile], (done) => { - const testProject = tsc.createProject("src/harness/tsconfig.json", getCompilerSettings({ outFile: "../../built/local/bundle.js" }, /*useBuiltCompiler*/ true)); - return testProject.src() - .pipe(newer("built/local/bundle.js")) - .pipe(sourcemaps.init()) - .pipe(testProject()) - .pipe(through2.obj((file, enc, next) => { - const originalMap = file.sourceMap; - const prebundledContent = file.contents.toString(); - // Make paths absolute to help sorcery deal with all the terrible paths being thrown around - originalMap.sources = originalMap.sources.map(s => path.resolve(s)); - // intoStream (below) makes browserify think the input file is named this, so this is what it puts in the sourcemap - originalMap.file = "built/local/_stream_0.js"; - - browserify(intoStream(file.contents), { debug: true }) - .bundle((err, res) => { - // assumes file.contents is a Buffer - const maps = JSON.parse(convertMap.fromSource(res.toString(), /*largeSource*/true).toJSON()); - delete maps.sourceRoot; - maps.sources = maps.sources.map(s => path.resolve(s === "_stream_0.js" ? "built/local/_stream_0.js" : s)); - // Strip browserify's inline comments away (could probably just let sorcery do this, but then we couldn't fix the paths) - file.contents = new Buffer(convertMap.removeComments(res.toString())); - const chain = sorcery.loadSync("built/local/bundle.js", { - content: { - "built/local/_stream_0.js": prebundledContent, - "built/local/bundle.js": file.contents.toString() - }, - sourcemaps: { - "built/local/_stream_0.js": originalMap, - "built/local/bundle.js": maps, - "node_modules/source-map-support/source-map-support.js": undefined, - } - }); - const finalMap = chain.apply(); - file.sourceMap = finalMap; - next(undefined, file); - }); - })) - .pipe(sourcemaps.write(".", { includeContent: false })) - .pipe(gulp.dest(".")); -}); - - -function cleanTestDirs(done: (e?: any) => void) { - // Clean the local baselines & Rwc baselines directories - del([ - localBaseline, - localRwcBaseline, - ]).then(() => { - mkdirP(localRwcBaseline, (err) => { - if (err) done(err); - mkdirP(localTest262Baseline, () => { - if (err) done(err); - mkdirP(localBaseline, (err) => done(err)); - }); - }); - }); -} - -// used to pass data from jake command line directly to run.js -function writeTestConfigFile(tests: string, light: boolean, taskConfigsFolder?: string, workerCount?: number, stackTraceLimit?: string) { - const testConfigContents = JSON.stringify({ test: tests ? [tests] : undefined, light, workerCount, stackTraceLimit, taskConfigsFolder }); - console.log("Running tests with config: " + testConfigContents); - fs.writeFileSync("test.config", testConfigContents); -} - - -gulp.task("runtests-browser", "Runs the tests using the built run.js file like 'gulp runtests'. Syntax is gulp runtests-browser. Additional optional parameters --tests=[regex], --browser=[chrome|IE]", ["browserify", nodeServerOutFile], (done) => { - cleanTestDirs((err) => { - if (err) { console.error(err); done(err); process.exit(1); } - host = "node"; - const tests = cmdLineOptions["tests"]; - const light = cmdLineOptions["light"]; - const testConfigFile = "test.config"; - if (fs.existsSync(testConfigFile)) { - fs.unlinkSync(testConfigFile); - } - if (tests || light) { - writeTestConfigFile(tests, light); - } - - const args = [nodeServerOutFile]; - if (cmdLineOptions["browser"]) { - args.push(cmdLineOptions["browser"]); - } - if (tests) { - args.push(JSON.stringify(tests)); - } - exec(host, args, done, done); - }); -}); - -gulp.task("generate-code-coverage", "Generates code coverage data via istanbul", ["tests"], (done) => { - exec("istanbul", ["cover", "node_modules/mocha/bin/_mocha", "--", "-R", "min", "-t", testTimeout.toString(), run], done, done); -}); - - -function getDiffTool() { - const program = process.env["DIFF"]; - if (!program) { - console.error("Add the 'DIFF' environment variable to the path of the program you want to use."); - process.exit(1); - } - return program; -} - -gulp.task("diff", "Diffs the compiler baselines using the diff tool specified by the 'DIFF' environment variable", (done) => { - exec(getDiffTool(), [refBaseline, localBaseline], done, done); -}); -gulp.task("diff-rwc", "Diffs the RWC baselines using the diff tool specified by the 'DIFF' environment variable", (done) => { - exec(getDiffTool(), [refRwcBaseline, localRwcBaseline], done, done); -}); - -gulp.task("baseline-accept", "Makes the most recent test results the new baseline, overwriting the old baseline", () => { - return baselineAccept(""); -}); - -function baselineAccept(subfolder = "") { - return merge2(baselineCopy(subfolder), baselineDelete(subfolder)); -} - -function baselineCopy(subfolder = "") { - return gulp.src([`tests/baselines/local/${subfolder}/**`, `!tests/baselines/local/${subfolder}/**/*.delete`]) - .pipe(gulp.dest(refBaseline)); -} - -function baselineDelete(subfolder = "") { - return gulp.src(["tests/baselines/local/**/*.delete"]) - .pipe(insert.transform((content, fileObj) => { - const target = path.join(refBaseline, fileObj.relative.substr(0, fileObj.relative.length - ".delete".length)); - del.sync(target); - del.sync(fileObj.path); - return ""; - })); -} - -gulp.task("baseline-accept-rwc", "Makes the most recent rwc test results the new baseline, overwriting the old baseline", () => { - return baselineAccept("rwc"); -}); - - -gulp.task("baseline-accept-test262", "Makes the most recent test262 test results the new baseline, overwriting the old baseline", () => { - return baselineAccept("test262"); -}); - - -// Webhost -const webhostPath = "tests/webhost/webtsc.ts"; -const webhostJsPath = "tests/webhost/webtsc.js"; -gulp.task(webhostJsPath, false, [servicesFile], () => { - const settings: tsc.Settings = getCompilerSettings({ - outFile: webhostJsPath - }, /*useBuiltCompiler*/ true); - return gulp.src(webhostPath) - .pipe(newer(webhostJsPath)) - .pipe(sourcemaps.init()) - .pipe(tsc(settings)) - .pipe(sourcemaps.write(".")) - .pipe(gulp.dest(path.dirname(webhostJsPath))); -}); - -gulp.task("webhost", "Builds the tsc web host", [webhostJsPath], () => { - return gulp.src(path.join(builtLocalDirectory, "lib.d.ts")).pipe(gulp.dest("tests/webhost/")); -}); - - -// Perf compiler -const perftscPath = "tests/perftsc.ts"; -const perftscJsPath = "built/local/perftsc.js"; -gulp.task(perftscJsPath, false, [servicesFile], () => { - const settings: tsc.Settings = getCompilerSettings({ - outFile: perftscJsPath - }, /*useBuiltCompiler*/ true); - return gulp.src(perftscPath) - .pipe(newer(perftscJsPath)) - .pipe(sourcemaps.init()) - .pipe(tsc(settings)) - .pipe(sourcemaps.write(".")) - .pipe(gulp.dest(".")); -}); - -gulp.task("perftsc", "Builds augmented version of the compiler for perf tests", [perftscJsPath]); - - -// Instrumented compiler -const loggedIOpath = path.join(harnessDirectory, "loggedIO.ts"); -const loggedIOJsPath = path.join(builtLocalDirectory, "loggedIO.js"); -gulp.task(loggedIOJsPath, false, [], (done) => { - const temp = path.join(builtLocalDirectory, "temp"); - mkdirP(temp, (err) => { - if (err) { console.error(err); done(err); process.exit(1); }; - exec(host, [LKGCompiler, "--types --outdir", temp, loggedIOpath], () => { - fs.renameSync(path.join(temp, "/harness/loggedIO.js"), loggedIOJsPath); - del(temp).then(() => done(), done); - }, done); - }); -}); - -const instrumenterPath = path.join(harnessDirectory, "instrumenter.ts"); -const instrumenterJsPath = path.join(builtLocalDirectory, "instrumenter.js"); -gulp.task(instrumenterJsPath, false, [servicesFile], () => { - const settings: tsc.Settings = getCompilerSettings({ - outFile: instrumenterJsPath - }, /*useBuiltCompiler*/ true); - return gulp.src(instrumenterPath) - .pipe(newer(instrumenterJsPath)) - .pipe(sourcemaps.init()) - .pipe(tsc(settings)) - .pipe(sourcemaps.write(".")) - .pipe(gulp.dest(".")); -}); - -gulp.task("tsc-instrumented", "Builds an instrumented tsc.js", ["local", loggedIOJsPath, instrumenterJsPath, servicesFile], (done) => { - exec(host, [instrumenterJsPath, "record", "iocapture", builtLocalCompiler], done, done); -}); - -gulp.task("update-sublime", "Updates the sublime plugin's tsserver", ["local", serverFile], () => { - return gulp.src([serverFile, serverFile + ".map"]).pipe(gulp.dest("../TypeScript-Sublime-Plugin/tsserver/")); -}); - -gulp.task("build-rules", "Compiles tslint rules to js", () => { - const settings: tsc.Settings = getCompilerSettings({ module: "commonjs" }, /*useBuiltCompiler*/ false); - const dest = path.join(builtLocalDirectory, "tslint"); - return gulp.src("scripts/tslint/**/*.ts") - .pipe(newer({ - dest, - ext: ".js" - })) - .pipe(sourcemaps.init()) - .pipe(tsc(settings)) - .pipe(sourcemaps.write(".")) - .pipe(gulp.dest(dest)); -}); - -const lintTargets = [ - "Gulpfile.ts", - "src/compiler/**/*.ts", - "src/harness/**/*.ts", - "!src/harness/unittests/services/formatting/**/*.ts", - "src/server/**/*.ts", - "scripts/tslint/**/*.ts", - "src/services/**/*.ts", - "tests/*.ts", "tests/webhost/*.ts" // Note: does *not* descend recursively -]; - -function sendNextFile(files: {path: string}[], child: cp.ChildProcess, callback: (failures: number) => void, failures: number) { - const file = files.pop(); - if (file) { - console.log(`Linting '${file.path}'.`); - child.send({ kind: "file", name: file.path }); - } - else { - child.send({ kind: "close" }); - callback(failures); - } -} - -function spawnLintWorker(files: {path: string}[], callback: (failures: number) => void) { - const child = cp.fork("./scripts/parallel-lint"); - let failures = 0; - child.on("message", function(data) { - switch (data.kind) { - case "result": - if (data.failures > 0) { - failures += data.failures; - console.log(data.output); - } - sendNextFile(files, child, callback, failures); - break; - case "error": - console.error(data.error); - failures++; - sendNextFile(files, child, callback, failures); - break; - } - }); - sendNextFile(files, child, callback, failures); -} - -gulp.task("lint", "Runs tslint on the compiler sources. Optional arguments are: --f[iles]=regex", ["build-rules"], () => { - const fileMatcher = RegExp(cmdLineOptions["files"]); - if (fold.isTravis()) console.log(fold.start("lint")); - - let files: {stat: fs.Stats, path: string}[] = []; - return gulp.src(lintTargets, { read: false }) - .pipe(through2.obj((chunk, enc, cb) => { - files.push(chunk); - cb(); - }, (cb) => { - files = files.filter(file => fileMatcher.test(file.path)).sort((filea, fileb) => filea.stat.size - fileb.stat.size); - const workerCount = (process.env.workerCount && +process.env.workerCount) || os.cpus().length; - for (let i = 0; i < workerCount; i++) { - spawnLintWorker(files, finished); - } - - let completed = 0; - let failures = 0; - function finished(fails) { - completed++; - failures += fails; - if (completed === workerCount) { - if (fold.isTravis()) console.log(fold.end("lint")); - if (failures > 0) { - throw new Error(`Linter errors: ${failures}`); - } - else { - cb(); - } - } - } - })); -}); - - -gulp.task("default", "Runs 'local'", ["local"]); - -gulp.task("watch", "Watches the src/ directory for changes and executes runtests-parallel.", [], () => { - gulp.watch("src/**/*.*", ["runtests-parallel"]); -}); diff --git a/node_modules/typescript/README.md b/node_modules/typescript/README.md index 2f631439e..053d03641 100644 --- a/node_modules/typescript/README.md +++ b/node_modules/typescript/README.md @@ -1,6 +1,6 @@ [![Build Status](https://travis-ci.org/Microsoft/TypeScript.svg?branch=master)](https://travis-ci.org/Microsoft/TypeScript) [![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript) -[![Downloads](https://img.shields.io/npm/dm/TypeScript.svg)](https://www.npmjs.com/package/typescript) +[![Downloads](https://img.shields.io/npm/dm/typescript.svg)](https://www.npmjs.com/package/typescript) # TypeScript @@ -39,8 +39,8 @@ with any additional questions or comments. ## Documentation -* [Quick tutorial](http://www.typescriptlang.org/Tutorial) -* [Programming handbook](http://www.typescriptlang.org/Handbook) +* [Quick tutorial](http://www.typescriptlang.org/docs/tutorial.html) +* [Programming handbook](http://www.typescriptlang.org/docs/handbook/basic-types.html) * [Language specification](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md) * [Homepage](http://www.typescriptlang.org/) @@ -95,4 +95,4 @@ node built/local/tsc.js hello.ts ## Roadmap -For details on our planned features and future direction please refer to our [roadmap](https://github.com/Microsoft/TypeScript/wiki/Roadmap). \ No newline at end of file +For details on our planned features and future direction please refer to our [roadmap](https://github.com/Microsoft/TypeScript/wiki/Roadmap). diff --git a/node_modules/typescript/lib/README.md b/node_modules/typescript/lib/README.md index 852d449f1..0a85a9e7b 100644 --- a/node_modules/typescript/lib/README.md +++ b/node_modules/typescript/lib/README.md @@ -1,5 +1,5 @@ -# Read This! - -**These files are not meant to be edited by hand.** -If you need to make modifications, the respective files should be changed within the repository's top-level `src` directory. -Running `jake LKG` will then appropriately update the files in this directory. +# Read This! + +**These files are not meant to be edited by hand.** +If you need to make modifications, the respective files should be changed within the repository's top-level `src` directory. +Running `jake LKG` will then appropriately update the files in this directory. diff --git a/node_modules/typescript/lib/cancellationToken.js b/node_modules/typescript/lib/cancellationToken.js index 8af21172d..f40321990 100644 --- a/node_modules/typescript/lib/cancellationToken.js +++ b/node_modules/typescript/lib/cancellationToken.js @@ -15,6 +15,15 @@ and limitations under the License. "use strict"; var fs = require("fs"); +function pipeExists(name) { + try { + fs.statSync(name); + return true; + } + catch (e) { + return false; + } +} function createCancellationToken(args) { var cancellationPipeName; for (var i = 0; i < args.length - 1; i++) { @@ -24,18 +33,39 @@ function createCancellationToken(args) { } } if (!cancellationPipeName) { - return { isCancellationRequested: function () { return false; } }; + return { + isCancellationRequested: function () { return false; }, + setRequest: function (_requestId) { return void 0; }, + resetRequest: function (_requestId) { return void 0; } + }; } - return { - isCancellationRequested: function () { - try { - fs.statSync(cancellationPipeName); - return true; - } - catch (e) { - return false; - } + if (cancellationPipeName.charAt(cancellationPipeName.length - 1) === "*") { + var namePrefix_1 = cancellationPipeName.slice(0, -1); + if (namePrefix_1.length === 0 || namePrefix_1.indexOf("*") >= 0) { + throw new Error("Invalid name for template cancellation pipe: it should have length greater than 2 characters and contain only one '*'."); } - }; + var perRequestPipeName_1; + var currentRequestId_1; + return { + isCancellationRequested: function () { return perRequestPipeName_1 !== undefined && pipeExists(perRequestPipeName_1); }, + setRequest: function (requestId) { + currentRequestId_1 = requestId; + perRequestPipeName_1 = namePrefix_1 + requestId; + }, + resetRequest: function (requestId) { + if (currentRequestId_1 !== requestId) { + throw new Error("Mismatched request id, expected " + currentRequestId_1 + ", actual " + requestId); + } + perRequestPipeName_1 = undefined; + } + }; + } + else { + return { + isCancellationRequested: function () { return pipeExists(cancellationPipeName); }, + setRequest: function (_requestId) { return void 0; }, + resetRequest: function (_requestId) { return void 0; } + }; + } } module.exports = createCancellationToken; diff --git a/node_modules/typescript/lib/lib.d.ts b/node_modules/typescript/lib/lib.d.ts index ed066deeb..cb9294153 100644 --- a/node_modules/typescript/lib/lib.d.ts +++ b/node_modules/typescript/lib/lib.d.ts @@ -1,18215 +1,19680 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ -/// + +/// -///////////////////////////// -/// ECMAScript APIs -///////////////////////////// - -declare const NaN: number; -declare const Infinity: number; - -/** - * Evaluates JavaScript code and executes it. - * @param x A String value that contains valid JavaScript code. - */ -declare function eval(x: string): any; - -/** - * Converts A string to an integer. - * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. - * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. - * All other strings are considered decimal. - */ -declare function parseInt(s: string, radix?: number): number; - -/** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. - */ -declare function parseFloat(string: string): number; - -/** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number). - * @param number A numeric value. - */ -declare function isNaN(number: number): boolean; - -/** - * Determines whether a supplied number is finite. - * @param number Any numeric value. - */ -declare function isFinite(number: number): boolean; - -/** - * Gets the unencoded version of an encoded Uniform Resource Identifier (URI). - * @param encodedURI A value representing an encoded URI. - */ -declare function decodeURI(encodedURI: string): string; - -/** - * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI). - * @param encodedURIComponent A value representing an encoded URI component. - */ -declare function decodeURIComponent(encodedURIComponent: string): string; - -/** - * Encodes a text string as a valid Uniform Resource Identifier (URI) - * @param uri A value representing an encoded URI. - */ -declare function encodeURI(uri: string): string; - -/** - * Encodes a text string as a valid component of a Uniform Resource Identifier (URI). - * @param uriComponent A value representing an encoded URI component. - */ -declare function encodeURIComponent(uriComponent: string): string; - -interface PropertyDescriptor { - configurable?: boolean; - enumerable?: boolean; - value?: any; - writable?: boolean; - get? (): any; - set? (v: any): void; -} - -interface PropertyDescriptorMap { - [s: string]: PropertyDescriptor; -} - -interface Object { - /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */ - constructor: Function; - - /** Returns a string representation of an object. */ - toString(): string; - - /** Returns a date converted to a string using the current locale. */ - toLocaleString(): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): Object; - - /** - * Determines whether an object has a property with the specified name. - * @param v A property name. - */ - hasOwnProperty(v: string): boolean; - - /** - * Determines whether an object exists in another object's prototype chain. - * @param v Another object whose prototype chain is to be checked. - */ - isPrototypeOf(v: Object): boolean; - - /** - * Determines whether a specified property is enumerable. - * @param v A property name. - */ - propertyIsEnumerable(v: string): boolean; -} - -interface ObjectConstructor { - new (value?: any): Object; - (): any; - (value: any): any; - - /** A reference to the prototype for a class of objects. */ - readonly prototype: Object; - - /** - * Returns the prototype of an object. - * @param o The object that references the prototype. - */ - getPrototypeOf(o: any): any; - - /** - * Gets the own property descriptor of the specified object. - * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype. - * @param o Object that contains the property. - * @param p Name of the property. - */ - getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; - - /** - * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly - * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. - * @param o Object that contains the own properties. - */ - getOwnPropertyNames(o: any): string[]; - - /** - * Creates an object that has null prototype. - * @param o Object to use as a prototype. May be null - */ - create(o: null): any; - - /** - * Creates an object that has the specified prototype, and that optionally contains specified properties. - * @param o Object to use as a prototype. May be null - */ - create(o: T): T; - - /** - * Creates an object that has the specified prototype, and that optionally contains specified properties. - * @param o Object to use as a prototype. May be null - * @param properties JavaScript object that contains one or more property descriptors. - */ - create(o: any, properties: PropertyDescriptorMap): any; - - /** - * Adds a property to an object, or modifies attributes of an existing property. - * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object. - * @param p The property name. - * @param attributes Descriptor for the property. It can be for a data property or an accessor property. - */ - defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; - - /** - * Adds one or more properties to an object, and/or modifies attributes of existing properties. - * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object. - * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property. - */ - defineProperties(o: any, properties: PropertyDescriptorMap): any; - - /** - * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - seal(o: T): T; - - /** - * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - freeze(a: T[]): ReadonlyArray; - - /** - * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - freeze(f: T): T; - - /** - * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - freeze(o: T): Readonly; - - /** - * Prevents the addition of new properties to an object. - * @param o Object to make non-extensible. - */ - preventExtensions(o: T): T; - - /** - * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. - * @param o Object to test. - */ - isSealed(o: any): boolean; - - /** - * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. - * @param o Object to test. - */ - isFrozen(o: any): boolean; - - /** - * Returns a value that indicates whether new properties can be added to an object. - * @param o Object to test. - */ - isExtensible(o: any): boolean; - - /** - * Returns the names of the enumerable properties and methods of an object. - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ - keys(o: any): string[]; -} - -/** - * Provides functionality common to all JavaScript objects. - */ -declare const Object: ObjectConstructor; - -/** - * Creates a new function. - */ -interface Function { - /** - * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. - * @param thisArg The object to be used as the this object. - * @param argArray A set of arguments to be passed to the function. - */ - apply(this: Function, thisArg: any, argArray?: any): any; - - /** - * Calls a method of an object, substituting another object for the current object. - * @param thisArg The object to be used as the current object. - * @param argArray A list of arguments to be passed to the method. - */ - call(this: Function, thisArg: any, ...argArray: any[]): any; - - /** - * For a given function, creates a bound function that has the same body as the original function. - * The this object of the bound function is associated with the specified object, and has the specified initial parameters. - * @param thisArg An object to which the this keyword can refer inside the new function. - * @param argArray A list of arguments to be passed to the new function. - */ - bind(this: Function, thisArg: any, ...argArray: any[]): any; - - /** Returns a string representation of a function. */ - toString(): string; - - prototype: any; - readonly length: number; - - // Non-standard extensions - arguments: any; - caller: Function; -} - -interface FunctionConstructor { - /** - * Creates a new function. - * @param args A list of arguments the function accepts. - */ - new (...args: string[]): Function; - (...args: string[]): Function; - readonly prototype: Function; -} - -declare const Function: FunctionConstructor; - -interface IArguments { - [index: number]: any; - length: number; - callee: Function; -} - -interface String { - /** Returns a string representation of a string. */ - toString(): string; - - /** - * Returns the character at the specified index. - * @param pos The zero-based index of the desired character. - */ - charAt(pos: number): string; - - /** - * Returns the Unicode value of the character at the specified location. - * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned. - */ - charCodeAt(index: number): number; - - /** - * Returns a string that contains the concatenation of two or more strings. - * @param strings The strings to append to the end of the string. - */ - concat(...strings: string[]): string; - - /** - * Returns the position of the first occurrence of a substring. - * @param searchString The substring to search for in the string - * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string. - */ - indexOf(searchString: string, position?: number): number; - - /** - * Returns the last occurrence of a substring in the string. - * @param searchString The substring to search for. - * @param position The index at which to begin searching. If omitted, the search begins at the end of the string. - */ - lastIndexOf(searchString: string, position?: number): number; - - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - */ - localeCompare(that: string): number; - - /** - * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A variable name or string literal containing the regular expression pattern and flags. - */ - match(regexp: string): RegExpMatchArray | null; - - /** - * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A regular expression object that contains the regular expression pattern and applicable flags. - */ - match(regexp: RegExp): RegExpMatchArray | null; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A string that represents the regular expression. - * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. - */ - replace(searchValue: string, replaceValue: string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A string that represents the regular expression. - * @param replacer A function that returns the replacement text. - */ - replace(searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags. - * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. - */ - replace(searchValue: RegExp, replaceValue: string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags - * @param replacer A function that returns the replacement text. - */ - replace(searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; - - /** - * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. - */ - search(regexp: string): number; - - /** - * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. - */ - search(regexp: RegExp): number; - - /** - * Returns a section of a string. - * @param start The index to the beginning of the specified portion of stringObj. - * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. - * If this value is not specified, the substring continues to the end of stringObj. - */ - slice(start?: number, end?: number): string; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(separator: string, limit?: number): string[]; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param separator A Regular Express that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(separator: RegExp, limit?: number): string[]; - - /** - * Returns the substring at the specified location within a String object. - * @param start The zero-based index number indicating the beginning of the substring. - * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. - * If end is omitted, the characters from start through the end of the original string are returned. - */ - substring(start: number, end?: number): string; - - /** Converts all the alphabetic characters in a string to lowercase. */ - toLowerCase(): string; - - /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ - toLocaleLowerCase(): string; - - /** Converts all the alphabetic characters in a string to uppercase. */ - toUpperCase(): string; - - /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */ - toLocaleUpperCase(): string; - - /** Removes the leading and trailing white space and line terminator characters from a string. */ - trim(): string; - - /** Returns the length of a String object. */ - readonly length: number; - - // IE extensions - /** - * Gets a substring beginning at the specified location and having the specified length. - * @param from The starting position of the desired substring. The index of the first character in the string is zero. - * @param length The number of characters to include in the returned substring. - */ - substr(from: number, length?: number): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): string; - - readonly [index: number]: string; -} - -interface StringConstructor { - new (value?: any): String; - (value?: any): string; - readonly prototype: String; - fromCharCode(...codes: number[]): string; -} - -/** - * Allows manipulation and formatting of text strings and determination and location of substrings within strings. - */ -declare const String: StringConstructor; - -interface Boolean { - /** Returns the primitive value of the specified object. */ - valueOf(): boolean; -} - -interface BooleanConstructor { - new (value?: any): Boolean; - (value?: any): boolean; - readonly prototype: Boolean; -} - -declare const Boolean: BooleanConstructor; - -interface Number { - /** - * Returns a string representation of an object. - * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers. - */ - toString(radix?: number): string; - - /** - * Returns a string representing a number in fixed-point notation. - * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. - */ - toFixed(fractionDigits?: number): string; - - /** - * Returns a string containing a number represented in exponential notation. - * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. - */ - toExponential(fractionDigits?: number): string; - - /** - * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits. - * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive. - */ - toPrecision(precision?: number): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): number; -} - -interface NumberConstructor { - new (value?: any): Number; - (value?: any): number; - readonly prototype: Number; - - /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */ - readonly MAX_VALUE: number; - - /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */ - readonly MIN_VALUE: number; - - /** - * A value that is not a number. - * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function. - */ - readonly NaN: number; - - /** - * A value that is less than the largest negative number that can be represented in JavaScript. - * JavaScript displays NEGATIVE_INFINITY values as -infinity. - */ - readonly NEGATIVE_INFINITY: number; - - /** - * A value greater than the largest number that can be represented in JavaScript. - * JavaScript displays POSITIVE_INFINITY values as infinity. - */ - readonly POSITIVE_INFINITY: number; -} - -/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */ -declare const Number: NumberConstructor; - -interface TemplateStringsArray extends ReadonlyArray { - readonly raw: ReadonlyArray -} - -interface Math { - /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ - readonly E: number; - /** The natural logarithm of 10. */ - readonly LN10: number; - /** The natural logarithm of 2. */ - readonly LN2: number; - /** The base-2 logarithm of e. */ - readonly LOG2E: number; - /** The base-10 logarithm of e. */ - readonly LOG10E: number; - /** Pi. This is the ratio of the circumference of a circle to its diameter. */ - readonly PI: number; - /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */ - readonly SQRT1_2: number; - /** The square root of 2. */ - readonly SQRT2: number; - /** - * Returns the absolute value of a number (the value without regard to whether it is positive or negative). - * For example, the absolute value of -5 is the same as the absolute value of 5. - * @param x A numeric expression for which the absolute value is needed. - */ - abs(x: number): number; - /** - * Returns the arc cosine (or inverse cosine) of a number. - * @param x A numeric expression. - */ - acos(x: number): number; - /** - * Returns the arcsine of a number. - * @param x A numeric expression. - */ - asin(x: number): number; - /** - * Returns the arctangent of a number. - * @param x A numeric expression for which the arctangent is needed. - */ - atan(x: number): number; - /** - * Returns the angle (in radians) from the X axis to a point. - * @param y A numeric expression representing the cartesian y-coordinate. - * @param x A numeric expression representing the cartesian x-coordinate. - */ - atan2(y: number, x: number): number; - /** - * Returns the smallest number greater than or equal to its numeric argument. - * @param x A numeric expression. - */ - ceil(x: number): number; - /** - * Returns the cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - cos(x: number): number; - /** - * Returns e (the base of natural logarithms) raised to a power. - * @param x A numeric expression representing the power of e. - */ - exp(x: number): number; - /** - * Returns the greatest number less than or equal to its numeric argument. - * @param x A numeric expression. - */ - floor(x: number): number; - /** - * Returns the natural logarithm (base e) of a number. - * @param x A numeric expression. - */ - log(x: number): number; - /** - * Returns the larger of a set of supplied numeric expressions. - * @param values Numeric expressions to be evaluated. - */ - max(...values: number[]): number; - /** - * Returns the smaller of a set of supplied numeric expressions. - * @param values Numeric expressions to be evaluated. - */ - min(...values: number[]): number; - /** - * Returns the value of a base expression taken to a specified power. - * @param x The base value of the expression. - * @param y The exponent value of the expression. - */ - pow(x: number, y: number): number; - /** Returns a pseudorandom number between 0 and 1. */ - random(): number; - /** - * Returns a supplied numeric expression rounded to the nearest number. - * @param x The value to be rounded to the nearest number. - */ - round(x: number): number; - /** - * Returns the sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - sin(x: number): number; - /** - * Returns the square root of a number. - * @param x A numeric expression. - */ - sqrt(x: number): number; - /** - * Returns the tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - tan(x: number): number; -} -/** An intrinsic object that provides basic mathematics functionality and constants. */ -declare const Math: Math; - -/** Enables basic storage and retrieval of dates and times. */ -interface Date { - /** Returns a string representation of a date. The format of the string depends on the locale. */ - toString(): string; - /** Returns a date as a string value. */ - toDateString(): string; - /** Returns a time as a string value. */ - toTimeString(): string; - /** Returns a value as a string value appropriate to the host environment's current locale. */ - toLocaleString(): string; - /** Returns a date as a string value appropriate to the host environment's current locale. */ - toLocaleDateString(): string; - /** Returns a time as a string value appropriate to the host environment's current locale. */ - toLocaleTimeString(): string; - /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */ - valueOf(): number; - /** Gets the time value in milliseconds. */ - getTime(): number; - /** Gets the year, using local time. */ - getFullYear(): number; - /** Gets the year using Universal Coordinated Time (UTC). */ - getUTCFullYear(): number; - /** Gets the month, using local time. */ - getMonth(): number; - /** Gets the month of a Date object using Universal Coordinated Time (UTC). */ - getUTCMonth(): number; - /** Gets the day-of-the-month, using local time. */ - getDate(): number; - /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */ - getUTCDate(): number; - /** Gets the day of the week, using local time. */ - getDay(): number; - /** Gets the day of the week using Universal Coordinated Time (UTC). */ - getUTCDay(): number; - /** Gets the hours in a date, using local time. */ - getHours(): number; - /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */ - getUTCHours(): number; - /** Gets the minutes of a Date object, using local time. */ - getMinutes(): number; - /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */ - getUTCMinutes(): number; - /** Gets the seconds of a Date object, using local time. */ - getSeconds(): number; - /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */ - getUTCSeconds(): number; - /** Gets the milliseconds of a Date, using local time. */ - getMilliseconds(): number; - /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */ - getUTCMilliseconds(): number; - /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */ - getTimezoneOffset(): number; - /** - * Sets the date and time value in the Date object. - * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT. - */ - setTime(time: number): number; - /** - * Sets the milliseconds value in the Date object using local time. - * @param ms A numeric value equal to the millisecond value. - */ - setMilliseconds(ms: number): number; - /** - * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). - * @param ms A numeric value equal to the millisecond value. - */ - setUTCMilliseconds(ms: number): number; - - /** - * Sets the seconds value in the Date object using local time. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setSeconds(sec: number, ms?: number): number; - /** - * Sets the seconds value in the Date object using Universal Coordinated Time (UTC). - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCSeconds(sec: number, ms?: number): number; - /** - * Sets the minutes value in the Date object using local time. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setMinutes(min: number, sec?: number, ms?: number): number; - /** - * Sets the minutes value in the Date object using Universal Coordinated Time (UTC). - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCMinutes(min: number, sec?: number, ms?: number): number; - /** - * Sets the hour value in the Date object using local time. - * @param hours A numeric value equal to the hours value. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setHours(hours: number, min?: number, sec?: number, ms?: number): number; - /** - * Sets the hours value in the Date object using Universal Coordinated Time (UTC). - * @param hours A numeric value equal to the hours value. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number; - /** - * Sets the numeric day-of-the-month value of the Date object using local time. - * @param date A numeric value equal to the day of the month. - */ - setDate(date: number): number; - /** - * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). - * @param date A numeric value equal to the day of the month. - */ - setUTCDate(date: number): number; - /** - * Sets the month value in the Date object using local time. - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. - * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used. - */ - setMonth(month: number, date?: number): number; - /** - * Sets the month value in the Date object using Universal Coordinated Time (UTC). - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. - * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used. - */ - setUTCMonth(month: number, date?: number): number; - /** - * Sets the year of the Date object using local time. - * @param year A numeric value for the year. - * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified. - * @param date A numeric value equal for the day of the month. - */ - setFullYear(year: number, month?: number, date?: number): number; - /** - * Sets the year value in the Date object using Universal Coordinated Time (UTC). - * @param year A numeric value equal to the year. - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied. - * @param date A numeric value equal to the day of the month. - */ - setUTCFullYear(year: number, month?: number, date?: number): number; - /** Returns a date converted to a string using Universal Coordinated Time (UTC). */ - toUTCString(): string; - /** Returns a date as a string value in ISO format. */ - toISOString(): string; - /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */ - toJSON(key?: any): string; -} - -interface DateConstructor { - new (): Date; - new (value: number): Date; - new (value: string): Date; - new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; - (): string; - readonly prototype: Date; - /** - * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. - * @param s A date string - */ - parse(s: string): number; - /** - * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date. - * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year. - * @param month The month as an number between 0 and 11 (January to December). - * @param date The date as an number between 1 and 31. - * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour. - * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes. - * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds. - * @param ms An number from 0 to 999 that specifies the milliseconds. - */ - UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; - now(): number; -} - -declare const Date: DateConstructor; - -interface RegExpMatchArray extends Array { - index?: number; - input?: string; -} - -interface RegExpExecArray extends Array { - index: number; - input: string; -} - -interface RegExp { - /** - * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. - * @param string The String object or string literal on which to perform the search. - */ - exec(string: string): RegExpExecArray | null; - - /** - * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. - * @param string String on which to perform the search. - */ - test(string: string): boolean; - - /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */ - readonly source: string; - - /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ - readonly global: boolean; - - /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */ - readonly ignoreCase: boolean; - - /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */ - readonly multiline: boolean; - - lastIndex: number; - - // Non-standard extensions - compile(): this; -} - -interface RegExpConstructor { - new (pattern: RegExp): RegExp; - new (pattern: string, flags?: string): RegExp; - (pattern: RegExp): RegExp; - (pattern: string, flags?: string): RegExp; - readonly prototype: RegExp; - - // Non-standard extensions - $1: string; - $2: string; - $3: string; - $4: string; - $5: string; - $6: string; - $7: string; - $8: string; - $9: string; - lastMatch: string; -} - -declare const RegExp: RegExpConstructor; - -interface Error { - name: string; - message: string; - stack?: string; -} - -interface ErrorConstructor { - new (message?: string): Error; - (message?: string): Error; - readonly prototype: Error; -} - -declare const Error: ErrorConstructor; - -interface EvalError extends Error { -} - -interface EvalErrorConstructor { - new (message?: string): EvalError; - (message?: string): EvalError; - readonly prototype: EvalError; -} - -declare const EvalError: EvalErrorConstructor; - -interface RangeError extends Error { -} - -interface RangeErrorConstructor { - new (message?: string): RangeError; - (message?: string): RangeError; - readonly prototype: RangeError; -} - -declare const RangeError: RangeErrorConstructor; - -interface ReferenceError extends Error { -} - -interface ReferenceErrorConstructor { - new (message?: string): ReferenceError; - (message?: string): ReferenceError; - readonly prototype: ReferenceError; -} - -declare const ReferenceError: ReferenceErrorConstructor; - -interface SyntaxError extends Error { -} - -interface SyntaxErrorConstructor { - new (message?: string): SyntaxError; - (message?: string): SyntaxError; - readonly prototype: SyntaxError; -} - -declare const SyntaxError: SyntaxErrorConstructor; - -interface TypeError extends Error { -} - -interface TypeErrorConstructor { - new (message?: string): TypeError; - (message?: string): TypeError; - readonly prototype: TypeError; -} - -declare const TypeError: TypeErrorConstructor; - -interface URIError extends Error { -} - -interface URIErrorConstructor { - new (message?: string): URIError; - (message?: string): URIError; - readonly prototype: URIError; -} - -declare const URIError: URIErrorConstructor; - -interface JSON { - /** - * Converts a JavaScript Object Notation (JSON) string into an object. - * @param text A valid JSON string. - * @param reviver A function that transforms the results. This function is called for each member of the object. - * If a member contains nested objects, the nested objects are transformed before the parent object is. - */ - parse(text: string, reviver?: (key: any, value: any) => any): any; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer A function that transforms the results. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - */ - stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer An array of strings and numbers that acts as a approved list for selecting the object properties that will be stringified. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - */ - stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string; -} - -/** - * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format. - */ -declare const JSON: JSON; - - -///////////////////////////// -/// ECMAScript Array API (specially handled by compiler) -///////////////////////////// - -interface ReadonlyArray { - /** - * Gets the length of the array. This is a number one higher than the highest element defined in an array. - */ - readonly length: number; - /** - * Returns a string representation of an array. - */ - toString(): string; - toLocaleString(): string; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat>(...items: U[]): T[]; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: T[][]): T[]; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: (T | T[])[]): T[]; - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): T[]; - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. - */ - indexOf(searchElement: T, fromIndex?: number): number; - - /** - * Returns the index of the last occurrence of a specified value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. - */ - lastIndexOf(searchElement: T, fromIndex?: number): number; - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: T, index: number, array: ReadonlyArray) => boolean, thisArg?: any): boolean; - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: T, index: number, array: ReadonlyArray) => boolean, thisArg?: any): boolean; - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: T, index: number, array: ReadonlyArray) => void, thisArg?: any): void; - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: T, index: number, array: ReadonlyArray) => U, thisArg?: any): U[]; - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: T, index: number, array: ReadonlyArray) => value is S, thisArg?: any): S[]; - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: T, index: number, array: ReadonlyArray) => any, thisArg?: any): T[]; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U; - - readonly [n: number]: T; -} - -interface Array { - /** - * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. - */ - length: number; - /** - * Returns a string representation of an array. - */ - toString(): string; - toLocaleString(): string; - /** - * Appends new elements to an array, and returns the new length of the array. - * @param items New elements of the Array. - */ - push(...items: T[]): number; - /** - * Removes the last element from an array and returns it. - */ - pop(): T | undefined; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: T[][]): T[]; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: (T | T[])[]): T[]; - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - /** - * Reverses the elements in an Array. - */ - reverse(): T[]; - /** - * Removes the first element from an array and returns it. - */ - shift(): T | undefined; - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): T[]; - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: T, b: T) => number): this; - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - */ - splice(start: number): T[]; - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - * @param deleteCount The number of elements to remove. - * @param items Elements to insert into the array in place of the deleted elements. - */ - splice(start: number, deleteCount: number, ...items: T[]): T[]; - /** - * Inserts new elements at the start of an array. - * @param items Elements to insert at the start of the Array. - */ - unshift(...items: T[]): number; - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. - */ - indexOf(searchElement: T, fromIndex?: number): number; - /** - * Returns the index of the last occurrence of a specified value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. - */ - lastIndexOf(searchElement: T, fromIndex?: number): number; - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(this: [T, T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U, U]; - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(this: [T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U]; - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(this: [T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U]; - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(this: [T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U]; - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[]; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - - [n: number]: T; -} - -interface ArrayConstructor { - new (arrayLength?: number): any[]; - new (arrayLength: number): T[]; - new (...items: T[]): T[]; - (arrayLength?: number): any[]; - (arrayLength: number): T[]; - (...items: T[]): T[]; - isArray(arg: any): arg is Array; - readonly prototype: Array; -} - -declare const Array: ArrayConstructor; - -interface TypedPropertyDescriptor { - enumerable?: boolean; - configurable?: boolean; - writable?: boolean; - value?: T; - get?: () => T; - set?: (value: T) => void; -} - -declare type ClassDecorator = (target: TFunction) => TFunction | void; -declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; -declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; -declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; - -declare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike; - -interface PromiseLike { - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then( - onfulfilled?: ((value: T) => T | PromiseLike) | undefined | null, - onrejected?: ((reason: any) => T | PromiseLike) | undefined | null): PromiseLike; - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then( - onfulfilled: ((value: T) => T | PromiseLike) | undefined | null, - onrejected: (reason: any) => TResult | PromiseLike): PromiseLike; - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then( - onfulfilled: (value: T) => TResult | PromiseLike, - onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): PromiseLike; - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then( - onfulfilled: (value: T) => TResult1 | PromiseLike, - onrejected: (reason: any) => TResult2 | PromiseLike): PromiseLike; -} - -interface ArrayLike { - readonly length: number; - readonly [n: number]: T; -} - -/** - * Make all properties in T optional - */ -type Partial = { - [P in keyof T]?: T[P]; -}; - -/** - * Make all properties in T readonly - */ -type Readonly = { - readonly [P in keyof T]: T[P]; -}; - -/** - * From T pick a set of properties K - */ -type Pick = { - [P in K]: T[P]; -} - -/** - * Construct a type with a set of properties K of type T - */ -type Record = { - [P in K]: T; -} - -/** - * Represents a raw buffer of binary data, which is used to store data for the - * different typed arrays. ArrayBuffers cannot be read from or written to directly, - * but can be passed to a typed array or DataView Object to interpret the raw - * buffer as needed. - */ -interface ArrayBuffer { - /** - * Read-only. The length of the ArrayBuffer (in bytes). - */ - readonly byteLength: number; - - /** - * Returns a section of an ArrayBuffer. - */ - slice(begin:number, end?:number): ArrayBuffer; -} - -interface ArrayBufferConstructor { - readonly prototype: ArrayBuffer; - new (byteLength: number): ArrayBuffer; - isView(arg: any): arg is ArrayBufferView; -} -declare const ArrayBuffer: ArrayBufferConstructor; - -interface ArrayBufferView { - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; -} - -interface DataView { - readonly buffer: ArrayBuffer; - readonly byteLength: number; - readonly byteOffset: number; - /** - * Gets the Float32 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Float64 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat64(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Int8 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt8(byteOffset: number): number; - - /** - * Gets the Int16 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt16(byteOffset: number, littleEndian?: boolean): number; - /** - * Gets the Int32 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint8 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint8(byteOffset: number): number; - - /** - * Gets the Uint16 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint16(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint32 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Stores an Float32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Float64 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Int8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setInt8(byteOffset: number, value: number): void; - - /** - * Stores an Int16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Int32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setUint8(byteOffset: number, value: number): void; - - /** - * Stores an Uint16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; -} - -interface DataViewConstructor { - new (buffer: ArrayBuffer, byteOffset?: number, byteLength?: number): DataView; -} -declare const DataView: DataViewConstructor; - -/** - * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Int8Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Int8Array) => any, thisArg?: any): Int8Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Int8Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Int8Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int8Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} -interface Int8ArrayConstructor { - readonly prototype: Int8Array; - new (length: number): Int8Array; - new (array: ArrayLike): Int8Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Int8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; - -} -declare const Int8Array: Int8ArrayConstructor; - -/** - * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint8Array) => any, thisArg?: any): Uint8Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint8Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint8Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint8Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Uint8ArrayConstructor { - readonly prototype: Uint8Array; - new (length: number): Uint8Array; - new (array: ArrayLike): Uint8Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; - -} -declare const Uint8Array: Uint8ArrayConstructor; - -/** - * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. - * If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8ClampedArray { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => any, thisArg?: any): Uint8ClampedArray; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint8ClampedArray; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint8ClampedArray, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint8ClampedArray; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint8ClampedArray; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Uint8ClampedArrayConstructor { - readonly prototype: Uint8ClampedArray; - new (length: number): Uint8ClampedArray; - new (array: ArrayLike): Uint8ClampedArray; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8ClampedArray; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint8ClampedArray; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; -} -declare const Uint8ClampedArray: Uint8ClampedArrayConstructor; - -/** - * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int16Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Int16Array) => any, thisArg?: any): Int16Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Int16Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Int16Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int16Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Int16ArrayConstructor { - readonly prototype: Int16Array; - new (length: number): Int16Array; - new (array: ArrayLike): Int16Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Int16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; - -} -declare const Int16Array: Int16ArrayConstructor; - -/** - * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint16Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint16Array) => any, thisArg?: any): Uint16Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint16Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint16Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint16Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Uint16ArrayConstructor { - readonly prototype: Uint16Array; - new (length: number): Uint16Array; - new (array: ArrayLike): Uint16Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; - -} -declare const Uint16Array: Uint16ArrayConstructor; -/** - * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int32Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Int32Array) => any, thisArg?: any): Int32Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Int32Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Int32Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int32Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Int32ArrayConstructor { - readonly prototype: Int32Array; - new (length: number): Int32Array; - new (array: ArrayLike): Int32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Int32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; -} -declare const Int32Array: Int32ArrayConstructor; - -/** - * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint32Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint32Array) => any, thisArg?: any): Uint32Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint32Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint32Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint32Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Uint32ArrayConstructor { - readonly prototype: Uint32Array; - new (length: number): Uint32Array; - new (array: ArrayLike): Uint32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; -} -declare const Uint32Array: Uint32ArrayConstructor; - -/** - * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number - * of bytes could not be allocated an exception is raised. - */ -interface Float32Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Float32Array) => any, thisArg?: any): Float32Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Float32Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Float32Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Float32Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Float32ArrayConstructor { - readonly prototype: Float32Array; - new (length: number): Float32Array; - new (array: ArrayLike): Float32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Float32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; - -} -declare const Float32Array: Float32ArrayConstructor; - -/** - * A typed array of 64-bit float values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Float64Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Float64Array) => any, thisArg?: any): Float64Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Float64Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Float64Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Float64Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Float64ArrayConstructor { - readonly prototype: Float64Array; - new (length: number): Float64Array; - new (array: ArrayLike): Float64Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Float64Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; -} -declare const Float64Array: Float64ArrayConstructor; - -///////////////////////////// -/// ECMAScript Internationalization API -///////////////////////////// - -declare module Intl { - interface CollatorOptions { - usage?: string; - localeMatcher?: string; - numeric?: boolean; - caseFirst?: string; - sensitivity?: string; - ignorePunctuation?: boolean; - } - - interface ResolvedCollatorOptions { - locale: string; - usage: string; - sensitivity: string; - ignorePunctuation: boolean; - collation: string; - caseFirst: string; - numeric: boolean; - } - - interface Collator { - compare(x: string, y: string): number; - resolvedOptions(): ResolvedCollatorOptions; - } - var Collator: { - new (locales?: string | string[], options?: CollatorOptions): Collator; - (locales?: string | string[], options?: CollatorOptions): Collator; - supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[]; - } - - interface NumberFormatOptions { - localeMatcher?: string; - style?: string; - currency?: string; - currencyDisplay?: string; - useGrouping?: boolean; - minimumIntegerDigits?: number; - minimumFractionDigits?: number; - maximumFractionDigits?: number; - minimumSignificantDigits?: number; - maximumSignificantDigits?: number; - } - - interface ResolvedNumberFormatOptions { - locale: string; - numberingSystem: string; - style: string; - currency?: string; - currencyDisplay?: string; - minimumIntegerDigits: number; - minimumFractionDigits: number; - maximumFractionDigits: number; - minimumSignificantDigits?: number; - maximumSignificantDigits?: number; - useGrouping: boolean; - } - - interface NumberFormat { - format(value: number): string; - resolvedOptions(): ResolvedNumberFormatOptions; - } - var NumberFormat: { - new (locales?: string | string[], options?: NumberFormatOptions): NumberFormat; - (locales?: string | string[], options?: NumberFormatOptions): NumberFormat; - supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[]; - } - - interface DateTimeFormatOptions { - localeMatcher?: string; - weekday?: string; - era?: string; - year?: string; - month?: string; - day?: string; - hour?: string; - minute?: string; - second?: string; - timeZoneName?: string; - formatMatcher?: string; - hour12?: boolean; - timeZone?: string; - } - - interface ResolvedDateTimeFormatOptions { - locale: string; - calendar: string; - numberingSystem: string; - timeZone: string; - hour12?: boolean; - weekday?: string; - era?: string; - year?: string; - month?: string; - day?: string; - hour?: string; - minute?: string; - second?: string; - timeZoneName?: string; - } - - interface DateTimeFormat { - format(date?: Date | number): string; - resolvedOptions(): ResolvedDateTimeFormatOptions; - } - var DateTimeFormat: { - new (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat; - (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat; - supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[]; - } -} - -interface String { - /** - * Determines whether two strings are equivalent in the current or specified locale. - * @param that String to compare to target string - * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. - * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. - */ - localeCompare(that: string, locales?: string | string[], options?: Intl.CollatorOptions): number; -} - -interface Number { - /** - * Converts a number to a string by using the current or specified locale. - * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string; -} - -interface Date { - /** - * Converts a date and time to a string by using the current or specified locale. - * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; - /** - * Converts a date to a string by using the current or specified locale. - * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; - - /** - * Converts a time to a string by using the current or specified locale. - * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; -} +///////////////////////////// +/// ECMAScript APIs +///////////////////////////// + +declare const NaN: number; +declare const Infinity: number; + +/** + * Evaluates JavaScript code and executes it. + * @param x A String value that contains valid JavaScript code. + */ +declare function eval(x: string): any; + +/** + * Converts A string to an integer. + * @param s A string to convert into a number. + * @param radix A value between 2 and 36 that specifies the base of the number in numString. + * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. + * All other strings are considered decimal. + */ +declare function parseInt(s: string, radix?: number): number; + +/** + * Converts a string to a floating-point number. + * @param string A string that contains a floating-point number. + */ +declare function parseFloat(string: string): number; + +/** + * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number). + * @param number A numeric value. + */ +declare function isNaN(number: number): boolean; + +/** + * Determines whether a supplied number is finite. + * @param number Any numeric value. + */ +declare function isFinite(number: number): boolean; + +/** + * Gets the unencoded version of an encoded Uniform Resource Identifier (URI). + * @param encodedURI A value representing an encoded URI. + */ +declare function decodeURI(encodedURI: string): string; + +/** + * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI). + * @param encodedURIComponent A value representing an encoded URI component. + */ +declare function decodeURIComponent(encodedURIComponent: string): string; + +/** + * Encodes a text string as a valid Uniform Resource Identifier (URI) + * @param uri A value representing an encoded URI. + */ +declare function encodeURI(uri: string): string; + +/** + * Encodes a text string as a valid component of a Uniform Resource Identifier (URI). + * @param uriComponent A value representing an encoded URI component. + */ +declare function encodeURIComponent(uriComponent: string): string; + +interface PropertyDescriptor { + configurable?: boolean; + enumerable?: boolean; + value?: any; + writable?: boolean; + get? (): any; + set? (v: any): void; +} + +interface PropertyDescriptorMap { + [s: string]: PropertyDescriptor; +} + +interface Object { + /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */ + constructor: Function; + + /** Returns a string representation of an object. */ + toString(): string; + + /** Returns a date converted to a string using the current locale. */ + toLocaleString(): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): Object; + + /** + * Determines whether an object has a property with the specified name. + * @param v A property name. + */ + hasOwnProperty(v: string): boolean; + + /** + * Determines whether an object exists in another object's prototype chain. + * @param v Another object whose prototype chain is to be checked. + */ + isPrototypeOf(v: Object): boolean; + + /** + * Determines whether a specified property is enumerable. + * @param v A property name. + */ + propertyIsEnumerable(v: string): boolean; +} + +interface ObjectConstructor { + new (value?: any): Object; + (): any; + (value: any): any; + + /** A reference to the prototype for a class of objects. */ + readonly prototype: Object; + + /** + * Returns the prototype of an object. + * @param o The object that references the prototype. + */ + getPrototypeOf(o: any): any; + + /** + * Gets the own property descriptor of the specified object. + * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype. + * @param o Object that contains the property. + * @param p Name of the property. + */ + getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; + + /** + * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly + * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. + * @param o Object that contains the own properties. + */ + getOwnPropertyNames(o: any): string[]; + + /** + * Creates an object that has the specified prototype or that has null prototype. + * @param o Object to use as a prototype. May be null. + */ + create(o: object | null): any; + + /** + * Creates an object that has the specified prototype, and that optionally contains specified properties. + * @param o Object to use as a prototype. May be null + * @param properties JavaScript object that contains one or more property descriptors. + */ + create(o: object | null, properties: PropertyDescriptorMap & ThisType): any; + + /** + * Adds a property to an object, or modifies attributes of an existing property. + * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object. + * @param p The property name. + * @param attributes Descriptor for the property. It can be for a data property or an accessor property. + */ + defineProperty(o: any, p: string, attributes: PropertyDescriptor & ThisType): any; + + /** + * Adds one or more properties to an object, and/or modifies attributes of existing properties. + * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object. + * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property. + */ + defineProperties(o: any, properties: PropertyDescriptorMap & ThisType): any; + + /** + * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + seal(o: T): T; + + /** + * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + freeze(a: T[]): ReadonlyArray; + + /** + * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + freeze(f: T): T; + + /** + * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + freeze(o: T): Readonly; + + /** + * Prevents the addition of new properties to an object. + * @param o Object to make non-extensible. + */ + preventExtensions(o: T): T; + + /** + * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. + * @param o Object to test. + */ + isSealed(o: any): boolean; + + /** + * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. + * @param o Object to test. + */ + isFrozen(o: any): boolean; + + /** + * Returns a value that indicates whether new properties can be added to an object. + * @param o Object to test. + */ + isExtensible(o: any): boolean; + + /** + * Returns the names of the enumerable properties and methods of an object. + * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. + */ + keys(o: any): string[]; +} + +/** + * Provides functionality common to all JavaScript objects. + */ +declare const Object: ObjectConstructor; + +/** + * Creates a new function. + */ +interface Function { + /** + * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. + * @param thisArg The object to be used as the this object. + * @param argArray A set of arguments to be passed to the function. + */ + apply(this: Function, thisArg: any, argArray?: any): any; + + /** + * Calls a method of an object, substituting another object for the current object. + * @param thisArg The object to be used as the current object. + * @param argArray A list of arguments to be passed to the method. + */ + call(this: Function, thisArg: any, ...argArray: any[]): any; + + /** + * For a given function, creates a bound function that has the same body as the original function. + * The this object of the bound function is associated with the specified object, and has the specified initial parameters. + * @param thisArg An object to which the this keyword can refer inside the new function. + * @param argArray A list of arguments to be passed to the new function. + */ + bind(this: Function, thisArg: any, ...argArray: any[]): any; + + /** Returns a string representation of a function. */ + toString(): string; + + prototype: any; + readonly length: number; + + // Non-standard extensions + arguments: any; + caller: Function; +} + +interface FunctionConstructor { + /** + * Creates a new function. + * @param args A list of arguments the function accepts. + */ + new (...args: string[]): Function; + (...args: string[]): Function; + readonly prototype: Function; +} + +declare const Function: FunctionConstructor; + +interface IArguments { + [index: number]: any; + length: number; + callee: Function; +} + +interface String { + /** Returns a string representation of a string. */ + toString(): string; + + /** + * Returns the character at the specified index. + * @param pos The zero-based index of the desired character. + */ + charAt(pos: number): string; + + /** + * Returns the Unicode value of the character at the specified location. + * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned. + */ + charCodeAt(index: number): number; + + /** + * Returns a string that contains the concatenation of two or more strings. + * @param strings The strings to append to the end of the string. + */ + concat(...strings: string[]): string; + + /** + * Returns the position of the first occurrence of a substring. + * @param searchString The substring to search for in the string + * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string. + */ + indexOf(searchString: string, position?: number): number; + + /** + * Returns the last occurrence of a substring in the string. + * @param searchString The substring to search for. + * @param position The index at which to begin searching. If omitted, the search begins at the end of the string. + */ + lastIndexOf(searchString: string, position?: number): number; + + /** + * Determines whether two strings are equivalent in the current locale. + * @param that String to compare to target string + */ + localeCompare(that: string): number; + + /** + * Matches a string with a regular expression, and returns an array containing the results of that search. + * @param regexp A variable name or string literal containing the regular expression pattern and flags. + */ + match(regexp: string | RegExp): RegExpMatchArray | null; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A string to search for. + * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. + */ + replace(searchValue: string | RegExp, replaceValue: string): string; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A string to search for. + * @param replacer A function that returns the replacement text. + */ + replace(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; + + /** + * Finds the first substring match in a regular expression search. + * @param regexp The regular expression pattern and applicable flags. + */ + search(regexp: string | RegExp): number; + + /** + * Returns a section of a string. + * @param start The index to the beginning of the specified portion of stringObj. + * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. + * If this value is not specified, the substring continues to the end of stringObj. + */ + slice(start?: number, end?: number): string; + + /** + * Split a string into substrings using the specified separator and return them as an array. + * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. + * @param limit A value used to limit the number of elements returned in the array. + */ + split(separator: string | RegExp, limit?: number): string[]; + + /** + * Returns the substring at the specified location within a String object. + * @param start The zero-based index number indicating the beginning of the substring. + * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. + * If end is omitted, the characters from start through the end of the original string are returned. + */ + substring(start: number, end?: number): string; + + /** Converts all the alphabetic characters in a string to lowercase. */ + toLowerCase(): string; + + /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ + toLocaleLowerCase(): string; + + /** Converts all the alphabetic characters in a string to uppercase. */ + toUpperCase(): string; + + /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */ + toLocaleUpperCase(): string; + + /** Removes the leading and trailing white space and line terminator characters from a string. */ + trim(): string; + + /** Returns the length of a String object. */ + readonly length: number; + + // IE extensions + /** + * Gets a substring beginning at the specified location and having the specified length. + * @param from The starting position of the desired substring. The index of the first character in the string is zero. + * @param length The number of characters to include in the returned substring. + */ + substr(from: number, length?: number): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): string; + + readonly [index: number]: string; +} + +interface StringConstructor { + new (value?: any): String; + (value?: any): string; + readonly prototype: String; + fromCharCode(...codes: number[]): string; +} + +/** + * Allows manipulation and formatting of text strings and determination and location of substrings within strings. + */ +declare const String: StringConstructor; + +interface Boolean { + /** Returns the primitive value of the specified object. */ + valueOf(): boolean; +} + +interface BooleanConstructor { + new (value?: any): Boolean; + (value?: any): boolean; + readonly prototype: Boolean; +} + +declare const Boolean: BooleanConstructor; + +interface Number { + /** + * Returns a string representation of an object. + * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers. + */ + toString(radix?: number): string; + + /** + * Returns a string representing a number in fixed-point notation. + * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. + */ + toFixed(fractionDigits?: number): string; + + /** + * Returns a string containing a number represented in exponential notation. + * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. + */ + toExponential(fractionDigits?: number): string; + + /** + * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits. + * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive. + */ + toPrecision(precision?: number): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): number; +} + +interface NumberConstructor { + new (value?: any): Number; + (value?: any): number; + readonly prototype: Number; + + /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */ + readonly MAX_VALUE: number; + + /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */ + readonly MIN_VALUE: number; + + /** + * A value that is not a number. + * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function. + */ + readonly NaN: number; + + /** + * A value that is less than the largest negative number that can be represented in JavaScript. + * JavaScript displays NEGATIVE_INFINITY values as -infinity. + */ + readonly NEGATIVE_INFINITY: number; + + /** + * A value greater than the largest number that can be represented in JavaScript. + * JavaScript displays POSITIVE_INFINITY values as infinity. + */ + readonly POSITIVE_INFINITY: number; +} + +/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */ +declare const Number: NumberConstructor; + +interface TemplateStringsArray extends ReadonlyArray { + readonly raw: ReadonlyArray; +} + +interface Math { + /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ + readonly E: number; + /** The natural logarithm of 10. */ + readonly LN10: number; + /** The natural logarithm of 2. */ + readonly LN2: number; + /** The base-2 logarithm of e. */ + readonly LOG2E: number; + /** The base-10 logarithm of e. */ + readonly LOG10E: number; + /** Pi. This is the ratio of the circumference of a circle to its diameter. */ + readonly PI: number; + /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */ + readonly SQRT1_2: number; + /** The square root of 2. */ + readonly SQRT2: number; + /** + * Returns the absolute value of a number (the value without regard to whether it is positive or negative). + * For example, the absolute value of -5 is the same as the absolute value of 5. + * @param x A numeric expression for which the absolute value is needed. + */ + abs(x: number): number; + /** + * Returns the arc cosine (or inverse cosine) of a number. + * @param x A numeric expression. + */ + acos(x: number): number; + /** + * Returns the arcsine of a number. + * @param x A numeric expression. + */ + asin(x: number): number; + /** + * Returns the arctangent of a number. + * @param x A numeric expression for which the arctangent is needed. + */ + atan(x: number): number; + /** + * Returns the angle (in radians) from the X axis to a point. + * @param y A numeric expression representing the cartesian y-coordinate. + * @param x A numeric expression representing the cartesian x-coordinate. + */ + atan2(y: number, x: number): number; + /** + * Returns the smallest number greater than or equal to its numeric argument. + * @param x A numeric expression. + */ + ceil(x: number): number; + /** + * Returns the cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + cos(x: number): number; + /** + * Returns e (the base of natural logarithms) raised to a power. + * @param x A numeric expression representing the power of e. + */ + exp(x: number): number; + /** + * Returns the greatest number less than or equal to its numeric argument. + * @param x A numeric expression. + */ + floor(x: number): number; + /** + * Returns the natural logarithm (base e) of a number. + * @param x A numeric expression. + */ + log(x: number): number; + /** + * Returns the larger of a set of supplied numeric expressions. + * @param values Numeric expressions to be evaluated. + */ + max(...values: number[]): number; + /** + * Returns the smaller of a set of supplied numeric expressions. + * @param values Numeric expressions to be evaluated. + */ + min(...values: number[]): number; + /** + * Returns the value of a base expression taken to a specified power. + * @param x The base value of the expression. + * @param y The exponent value of the expression. + */ + pow(x: number, y: number): number; + /** Returns a pseudorandom number between 0 and 1. */ + random(): number; + /** + * Returns a supplied numeric expression rounded to the nearest number. + * @param x The value to be rounded to the nearest number. + */ + round(x: number): number; + /** + * Returns the sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + sin(x: number): number; + /** + * Returns the square root of a number. + * @param x A numeric expression. + */ + sqrt(x: number): number; + /** + * Returns the tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + tan(x: number): number; +} +/** An intrinsic object that provides basic mathematics functionality and constants. */ +declare const Math: Math; + +/** Enables basic storage and retrieval of dates and times. */ +interface Date { + /** Returns a string representation of a date. The format of the string depends on the locale. */ + toString(): string; + /** Returns a date as a string value. */ + toDateString(): string; + /** Returns a time as a string value. */ + toTimeString(): string; + /** Returns a value as a string value appropriate to the host environment's current locale. */ + toLocaleString(): string; + /** Returns a date as a string value appropriate to the host environment's current locale. */ + toLocaleDateString(): string; + /** Returns a time as a string value appropriate to the host environment's current locale. */ + toLocaleTimeString(): string; + /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */ + valueOf(): number; + /** Gets the time value in milliseconds. */ + getTime(): number; + /** Gets the year, using local time. */ + getFullYear(): number; + /** Gets the year using Universal Coordinated Time (UTC). */ + getUTCFullYear(): number; + /** Gets the month, using local time. */ + getMonth(): number; + /** Gets the month of a Date object using Universal Coordinated Time (UTC). */ + getUTCMonth(): number; + /** Gets the day-of-the-month, using local time. */ + getDate(): number; + /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */ + getUTCDate(): number; + /** Gets the day of the week, using local time. */ + getDay(): number; + /** Gets the day of the week using Universal Coordinated Time (UTC). */ + getUTCDay(): number; + /** Gets the hours in a date, using local time. */ + getHours(): number; + /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */ + getUTCHours(): number; + /** Gets the minutes of a Date object, using local time. */ + getMinutes(): number; + /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */ + getUTCMinutes(): number; + /** Gets the seconds of a Date object, using local time. */ + getSeconds(): number; + /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */ + getUTCSeconds(): number; + /** Gets the milliseconds of a Date, using local time. */ + getMilliseconds(): number; + /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */ + getUTCMilliseconds(): number; + /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */ + getTimezoneOffset(): number; + /** + * Sets the date and time value in the Date object. + * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT. + */ + setTime(time: number): number; + /** + * Sets the milliseconds value in the Date object using local time. + * @param ms A numeric value equal to the millisecond value. + */ + setMilliseconds(ms: number): number; + /** + * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). + * @param ms A numeric value equal to the millisecond value. + */ + setUTCMilliseconds(ms: number): number; + + /** + * Sets the seconds value in the Date object using local time. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setSeconds(sec: number, ms?: number): number; + /** + * Sets the seconds value in the Date object using Universal Coordinated Time (UTC). + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCSeconds(sec: number, ms?: number): number; + /** + * Sets the minutes value in the Date object using local time. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setMinutes(min: number, sec?: number, ms?: number): number; + /** + * Sets the minutes value in the Date object using Universal Coordinated Time (UTC). + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCMinutes(min: number, sec?: number, ms?: number): number; + /** + * Sets the hour value in the Date object using local time. + * @param hours A numeric value equal to the hours value. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setHours(hours: number, min?: number, sec?: number, ms?: number): number; + /** + * Sets the hours value in the Date object using Universal Coordinated Time (UTC). + * @param hours A numeric value equal to the hours value. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number; + /** + * Sets the numeric day-of-the-month value of the Date object using local time. + * @param date A numeric value equal to the day of the month. + */ + setDate(date: number): number; + /** + * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). + * @param date A numeric value equal to the day of the month. + */ + setUTCDate(date: number): number; + /** + * Sets the month value in the Date object using local time. + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. + * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used. + */ + setMonth(month: number, date?: number): number; + /** + * Sets the month value in the Date object using Universal Coordinated Time (UTC). + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. + * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used. + */ + setUTCMonth(month: number, date?: number): number; + /** + * Sets the year of the Date object using local time. + * @param year A numeric value for the year. + * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified. + * @param date A numeric value equal for the day of the month. + */ + setFullYear(year: number, month?: number, date?: number): number; + /** + * Sets the year value in the Date object using Universal Coordinated Time (UTC). + * @param year A numeric value equal to the year. + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied. + * @param date A numeric value equal to the day of the month. + */ + setUTCFullYear(year: number, month?: number, date?: number): number; + /** Returns a date converted to a string using Universal Coordinated Time (UTC). */ + toUTCString(): string; + /** Returns a date as a string value in ISO format. */ + toISOString(): string; + /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */ + toJSON(key?: any): string; +} + +interface DateConstructor { + new (): Date; + new (value: number): Date; + new (value: string): Date; + new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; + (): string; + readonly prototype: Date; + /** + * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. + * @param s A date string + */ + parse(s: string): number; + /** + * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date. + * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year. + * @param month The month as an number between 0 and 11 (January to December). + * @param date The date as an number between 1 and 31. + * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour. + * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes. + * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds. + * @param ms An number from 0 to 999 that specifies the milliseconds. + */ + UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; + now(): number; +} + +declare const Date: DateConstructor; + +interface RegExpMatchArray extends Array { + index?: number; + input?: string; +} + +interface RegExpExecArray extends Array { + index: number; + input: string; +} + +interface RegExp { + /** + * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. + * @param string The String object or string literal on which to perform the search. + */ + exec(string: string): RegExpExecArray | null; + + /** + * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. + * @param string String on which to perform the search. + */ + test(string: string): boolean; + + /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */ + readonly source: string; + + /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ + readonly global: boolean; + + /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */ + readonly ignoreCase: boolean; + + /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */ + readonly multiline: boolean; + + lastIndex: number; + + // Non-standard extensions + compile(): this; +} + +interface RegExpConstructor { + new (pattern: RegExp | string): RegExp; + new (pattern: string, flags?: string): RegExp; + (pattern: RegExp | string): RegExp; + (pattern: string, flags?: string): RegExp; + readonly prototype: RegExp; + + // Non-standard extensions + $1: string; + $2: string; + $3: string; + $4: string; + $5: string; + $6: string; + $7: string; + $8: string; + $9: string; + lastMatch: string; +} + +declare const RegExp: RegExpConstructor; + +interface Error { + name: string; + message: string; + stack?: string; +} + +interface ErrorConstructor { + new (message?: string): Error; + (message?: string): Error; + readonly prototype: Error; +} + +declare const Error: ErrorConstructor; + +interface EvalError extends Error { +} + +interface EvalErrorConstructor { + new (message?: string): EvalError; + (message?: string): EvalError; + readonly prototype: EvalError; +} + +declare const EvalError: EvalErrorConstructor; + +interface RangeError extends Error { +} + +interface RangeErrorConstructor { + new (message?: string): RangeError; + (message?: string): RangeError; + readonly prototype: RangeError; +} + +declare const RangeError: RangeErrorConstructor; + +interface ReferenceError extends Error { +} + +interface ReferenceErrorConstructor { + new (message?: string): ReferenceError; + (message?: string): ReferenceError; + readonly prototype: ReferenceError; +} + +declare const ReferenceError: ReferenceErrorConstructor; + +interface SyntaxError extends Error { +} + +interface SyntaxErrorConstructor { + new (message?: string): SyntaxError; + (message?: string): SyntaxError; + readonly prototype: SyntaxError; +} + +declare const SyntaxError: SyntaxErrorConstructor; + +interface TypeError extends Error { +} + +interface TypeErrorConstructor { + new (message?: string): TypeError; + (message?: string): TypeError; + readonly prototype: TypeError; +} + +declare const TypeError: TypeErrorConstructor; + +interface URIError extends Error { +} + +interface URIErrorConstructor { + new (message?: string): URIError; + (message?: string): URIError; + readonly prototype: URIError; +} + +declare const URIError: URIErrorConstructor; + +interface JSON { + /** + * Converts a JavaScript Object Notation (JSON) string into an object. + * @param text A valid JSON string. + * @param reviver A function that transforms the results. This function is called for each member of the object. + * If a member contains nested objects, the nested objects are transformed before the parent object is. + */ + parse(text: string, reviver?: (key: any, value: any) => any): any; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer A function that transforms the results. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + */ + stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer An array of strings and numbers that acts as a approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + */ + stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string; +} + +/** + * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format. + */ +declare const JSON: JSON; - -///////////////////////////// -/// IE DOM APIs -///////////////////////////// - -interface Algorithm { - name: string; -} - -interface AriaRequestEventInit extends EventInit { - attributeName?: string; - attributeValue?: string; -} - -interface CommandEventInit extends EventInit { - commandName?: string; - detail?: string; -} - -interface CompositionEventInit extends UIEventInit { - data?: string; -} - -interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation { - arrayOfDomainStrings?: string[]; -} - -interface ConstrainBooleanParameters { - exact?: boolean; - ideal?: boolean; -} - -interface ConstrainDOMStringParameters { - exact?: string | string[]; - ideal?: string | string[]; -} - -interface ConstrainDoubleRange extends DoubleRange { - exact?: number; - ideal?: number; -} - -interface ConstrainLongRange extends LongRange { - exact?: number; - ideal?: number; -} - -interface ConstrainVideoFacingModeParameters { - exact?: string | string[]; - ideal?: string | string[]; -} - -interface CustomEventInit extends EventInit { - detail?: any; -} - -interface DeviceAccelerationDict { - x?: number; - y?: number; - z?: number; -} - -interface DeviceLightEventInit extends EventInit { - value?: number; -} - -interface DeviceRotationRateDict { - alpha?: number; - beta?: number; - gamma?: number; -} - -interface DoubleRange { - max?: number; - min?: number; -} - -interface EventInit { - scoped?: boolean; - bubbles?: boolean; - cancelable?: boolean; -} - -interface EventModifierInit extends UIEventInit { - ctrlKey?: boolean; - shiftKey?: boolean; - altKey?: boolean; - metaKey?: boolean; - modifierAltGraph?: boolean; - modifierCapsLock?: boolean; - modifierFn?: boolean; - modifierFnLock?: boolean; - modifierHyper?: boolean; - modifierNumLock?: boolean; - modifierOS?: boolean; - modifierScrollLock?: boolean; - modifierSuper?: boolean; - modifierSymbol?: boolean; - modifierSymbolLock?: boolean; -} - -interface ExceptionInformation { - domain?: string; -} - -interface FocusEventInit extends UIEventInit { - relatedTarget?: EventTarget; -} - -interface HashChangeEventInit extends EventInit { - newURL?: string; - oldURL?: string; -} - -interface IDBIndexParameters { - multiEntry?: boolean; - unique?: boolean; -} - -interface IDBObjectStoreParameters { - autoIncrement?: boolean; - keyPath?: IDBKeyPath; -} - -interface KeyAlgorithm { - name?: string; -} - -interface KeyboardEventInit extends EventModifierInit { - code?: string; - key?: string; - location?: number; - repeat?: boolean; -} - -interface LongRange { - max?: number; - min?: number; -} - -interface MSAccountInfo { - rpDisplayName?: string; - userDisplayName?: string; - accountName?: string; - userId?: string; - accountImageUri?: string; -} - -interface MSAudioLocalClientEvent extends MSLocalClientEventBase { - networkSendQualityEventRatio?: number; - networkDelayEventRatio?: number; - cpuInsufficientEventRatio?: number; - deviceHalfDuplexAECEventRatio?: number; - deviceRenderNotFunctioningEventRatio?: number; - deviceCaptureNotFunctioningEventRatio?: number; - deviceGlitchesEventRatio?: number; - deviceLowSNREventRatio?: number; - deviceLowSpeechLevelEventRatio?: number; - deviceClippingEventRatio?: number; - deviceEchoEventRatio?: number; - deviceNearEndToEchoRatioEventRatio?: number; - deviceRenderZeroVolumeEventRatio?: number; - deviceRenderMuteEventRatio?: number; - deviceMultipleEndpointsEventCount?: number; - deviceHowlingEventCount?: number; -} - -interface MSAudioRecvPayload extends MSPayloadBase { - samplingRate?: number; - signal?: MSAudioRecvSignal; - packetReorderRatio?: number; - packetReorderDepthAvg?: number; - packetReorderDepthMax?: number; - burstLossLength1?: number; - burstLossLength2?: number; - burstLossLength3?: number; - burstLossLength4?: number; - burstLossLength5?: number; - burstLossLength6?: number; - burstLossLength7?: number; - burstLossLength8OrHigher?: number; - fecRecvDistance1?: number; - fecRecvDistance2?: number; - fecRecvDistance3?: number; - ratioConcealedSamplesAvg?: number; - ratioStretchedSamplesAvg?: number; - ratioCompressedSamplesAvg?: number; -} - -interface MSAudioRecvSignal { - initialSignalLevelRMS?: number; - recvSignalLevelCh1?: number; - recvNoiseLevelCh1?: number; - renderSignalLevel?: number; - renderNoiseLevel?: number; - renderLoopbackSignalLevel?: number; -} - -interface MSAudioSendPayload extends MSPayloadBase { - samplingRate?: number; - signal?: MSAudioSendSignal; - audioFECUsed?: boolean; - sendMutePercent?: number; -} - -interface MSAudioSendSignal { - noiseLevel?: number; - sendSignalLevelCh1?: number; - sendNoiseLevelCh1?: number; -} - -interface MSConnectivity { - iceType?: string; - iceWarningFlags?: MSIceWarningFlags; - relayAddress?: MSRelayAddress; -} - -interface MSCredentialFilter { - accept?: MSCredentialSpec[]; -} - -interface MSCredentialParameters { - type?: string; -} - -interface MSCredentialSpec { - type?: string; - id?: string; -} - -interface MSDelay { - roundTrip?: number; - roundTripMax?: number; -} - -interface MSDescription extends RTCStats { - connectivity?: MSConnectivity; - transport?: string; - networkconnectivity?: MSNetworkConnectivityInfo; - localAddr?: MSIPAddressInfo; - remoteAddr?: MSIPAddressInfo; - deviceDevName?: string; - reflexiveLocalIPAddr?: MSIPAddressInfo; -} - -interface MSFIDOCredentialParameters extends MSCredentialParameters { - algorithm?: string | Algorithm; - authenticators?: AAGUID[]; -} - -interface MSIPAddressInfo { - ipAddr?: string; - port?: number; - manufacturerMacAddrMask?: string; -} - -interface MSIceWarningFlags { - turnTcpTimedOut?: boolean; - turnUdpAllocateFailed?: boolean; - turnUdpSendFailed?: boolean; - turnTcpAllocateFailed?: boolean; - turnTcpSendFailed?: boolean; - udpLocalConnectivityFailed?: boolean; - udpNatConnectivityFailed?: boolean; - udpRelayConnectivityFailed?: boolean; - tcpNatConnectivityFailed?: boolean; - tcpRelayConnectivityFailed?: boolean; - connCheckMessageIntegrityFailed?: boolean; - allocationMessageIntegrityFailed?: boolean; - connCheckOtherError?: boolean; - turnAuthUnknownUsernameError?: boolean; - noRelayServersConfigured?: boolean; - multipleRelayServersAttempted?: boolean; - portRangeExhausted?: boolean; - alternateServerReceived?: boolean; - pseudoTLSFailure?: boolean; - turnTurnTcpConnectivityFailed?: boolean; - useCandidateChecksFailed?: boolean; - fipsAllocationFailure?: boolean; -} - -interface MSJitter { - interArrival?: number; - interArrivalMax?: number; - interArrivalSD?: number; -} - -interface MSLocalClientEventBase extends RTCStats { - networkReceiveQualityEventRatio?: number; - networkBandwidthLowEventRatio?: number; -} - -interface MSNetwork extends RTCStats { - jitter?: MSJitter; - delay?: MSDelay; - packetLoss?: MSPacketLoss; - utilization?: MSUtilization; -} - -interface MSNetworkConnectivityInfo { - vpn?: boolean; - linkspeed?: number; - networkConnectionDetails?: string; -} - -interface MSNetworkInterfaceType { - interfaceTypeEthernet?: boolean; - interfaceTypeWireless?: boolean; - interfaceTypePPP?: boolean; - interfaceTypeTunnel?: boolean; - interfaceTypeWWAN?: boolean; -} - -interface MSOutboundNetwork extends MSNetwork { - appliedBandwidthLimit?: number; -} - -interface MSPacketLoss { - lossRate?: number; - lossRateMax?: number; -} - -interface MSPayloadBase extends RTCStats { - payloadDescription?: string; -} - -interface MSRelayAddress { - relayAddress?: string; - port?: number; -} - -interface MSSignatureParameters { - userPrompt?: string; -} - -interface MSTransportDiagnosticsStats extends RTCStats { - baseAddress?: string; - localAddress?: string; - localSite?: string; - networkName?: string; - remoteAddress?: string; - remoteSite?: string; - localMR?: string; - remoteMR?: string; - iceWarningFlags?: MSIceWarningFlags; - portRangeMin?: number; - portRangeMax?: number; - localMRTCPPort?: number; - remoteMRTCPPort?: number; - stunVer?: number; - numConsentReqSent?: number; - numConsentReqReceived?: number; - numConsentRespSent?: number; - numConsentRespReceived?: number; - interfaces?: MSNetworkInterfaceType; - baseInterface?: MSNetworkInterfaceType; - protocol?: string; - localInterface?: MSNetworkInterfaceType; - localAddrType?: string; - remoteAddrType?: string; - iceRole?: string; - rtpRtcpMux?: boolean; - allocationTimeInMs?: number; - msRtcEngineVersion?: string; -} - -interface MSUtilization { - packets?: number; - bandwidthEstimation?: number; - bandwidthEstimationMin?: number; - bandwidthEstimationMax?: number; - bandwidthEstimationStdDev?: number; - bandwidthEstimationAvg?: number; -} - -interface MSVideoPayload extends MSPayloadBase { - resoluton?: string; - videoBitRateAvg?: number; - videoBitRateMax?: number; - videoFrameRateAvg?: number; - videoPacketLossRate?: number; - durationSeconds?: number; -} - -interface MSVideoRecvPayload extends MSVideoPayload { - videoFrameLossRate?: number; - recvCodecType?: string; - recvResolutionWidth?: number; - recvResolutionHeight?: number; - videoResolutions?: MSVideoResolutionDistribution; - recvFrameRateAverage?: number; - recvBitRateMaximum?: number; - recvBitRateAverage?: number; - recvVideoStreamsMax?: number; - recvVideoStreamsMin?: number; - recvVideoStreamsMode?: number; - videoPostFECPLR?: number; - lowBitRateCallPercent?: number; - lowFrameRateCallPercent?: number; - reorderBufferTotalPackets?: number; - recvReorderBufferReorderedPackets?: number; - recvReorderBufferPacketsDroppedDueToBufferExhaustion?: number; - recvReorderBufferMaxSuccessfullyOrderedExtent?: number; - recvReorderBufferMaxSuccessfullyOrderedLateTime?: number; - recvReorderBufferPacketsDroppedDueToTimeout?: number; - recvFpsHarmonicAverage?: number; - recvNumResSwitches?: number; -} - -interface MSVideoResolutionDistribution { - cifQuality?: number; - vgaQuality?: number; - h720Quality?: number; - h1080Quality?: number; - h1440Quality?: number; - h2160Quality?: number; -} - -interface MSVideoSendPayload extends MSVideoPayload { - sendFrameRateAverage?: number; - sendBitRateMaximum?: number; - sendBitRateAverage?: number; - sendVideoStreamsMax?: number; - sendResolutionWidth?: number; - sendResolutionHeight?: number; -} - -interface MediaEncryptedEventInit extends EventInit { - initDataType?: string; - initData?: ArrayBuffer; -} - -interface MediaKeyMessageEventInit extends EventInit { - messageType?: string; - message?: ArrayBuffer; -} - -interface MediaKeySystemConfiguration { - initDataTypes?: string[]; - audioCapabilities?: MediaKeySystemMediaCapability[]; - videoCapabilities?: MediaKeySystemMediaCapability[]; - distinctiveIdentifier?: string; - persistentState?: string; -} - -interface MediaKeySystemMediaCapability { - contentType?: string; - robustness?: string; -} - -interface MediaStreamConstraints { - video?: boolean | MediaTrackConstraints; - audio?: boolean | MediaTrackConstraints; -} - -interface MediaStreamErrorEventInit extends EventInit { - error?: MediaStreamError; -} - -interface MediaStreamTrackEventInit extends EventInit { - track?: MediaStreamTrack; -} - -interface MediaTrackCapabilities { - width?: number | LongRange; - height?: number | LongRange; - aspectRatio?: number | DoubleRange; - frameRate?: number | DoubleRange; - facingMode?: string; - volume?: number | DoubleRange; - sampleRate?: number | LongRange; - sampleSize?: number | LongRange; - echoCancellation?: boolean[]; - deviceId?: string; - groupId?: string; -} - -interface MediaTrackConstraintSet { - width?: number | ConstrainLongRange; - height?: number | ConstrainLongRange; - aspectRatio?: number | ConstrainDoubleRange; - frameRate?: number | ConstrainDoubleRange; - facingMode?: string | string[] | ConstrainDOMStringParameters; - volume?: number | ConstrainDoubleRange; - sampleRate?: number | ConstrainLongRange; - sampleSize?: number | ConstrainLongRange; - echoCancelation?: boolean | ConstrainBooleanParameters; - deviceId?: string | string[] | ConstrainDOMStringParameters; - groupId?: string | string[] | ConstrainDOMStringParameters; -} - -interface MediaTrackConstraints extends MediaTrackConstraintSet { - advanced?: MediaTrackConstraintSet[]; -} - -interface MediaTrackSettings { - width?: number; - height?: number; - aspectRatio?: number; - frameRate?: number; - facingMode?: string; - volume?: number; - sampleRate?: number; - sampleSize?: number; - echoCancellation?: boolean; - deviceId?: string; - groupId?: string; -} - -interface MediaTrackSupportedConstraints { - width?: boolean; - height?: boolean; - aspectRatio?: boolean; - frameRate?: boolean; - facingMode?: boolean; - volume?: boolean; - sampleRate?: boolean; - sampleSize?: boolean; - echoCancellation?: boolean; - deviceId?: boolean; - groupId?: boolean; -} - -interface MouseEventInit extends EventModifierInit { - screenX?: number; - screenY?: number; - clientX?: number; - clientY?: number; - button?: number; - buttons?: number; - relatedTarget?: EventTarget; -} - -interface MsZoomToOptions { - contentX?: number; - contentY?: number; - viewportX?: string; - viewportY?: string; - scaleFactor?: number; - animate?: string; -} - -interface MutationObserverInit { - childList?: boolean; - attributes?: boolean; - characterData?: boolean; - subtree?: boolean; - attributeOldValue?: boolean; - characterDataOldValue?: boolean; - attributeFilter?: string[]; -} - -interface ObjectURLOptions { - oneTimeOnly?: boolean; -} - -interface PeriodicWaveConstraints { - disableNormalization?: boolean; -} - -interface PointerEventInit extends MouseEventInit { - pointerId?: number; - width?: number; - height?: number; - pressure?: number; - tiltX?: number; - tiltY?: number; - pointerType?: string; - isPrimary?: boolean; -} - -interface PositionOptions { - enableHighAccuracy?: boolean; - timeout?: number; - maximumAge?: number; -} - -interface RTCDTMFToneChangeEventInit extends EventInit { - tone?: string; -} - -interface RTCDtlsFingerprint { - algorithm?: string; - value?: string; -} - -interface RTCDtlsParameters { - role?: string; - fingerprints?: RTCDtlsFingerprint[]; -} - -interface RTCIceCandidate { - foundation?: string; - priority?: number; - ip?: string; - protocol?: string; - port?: number; - type?: string; - tcpType?: string; - relatedAddress?: string; - relatedPort?: number; -} - -interface RTCIceCandidateAttributes extends RTCStats { - ipAddress?: string; - portNumber?: number; - transport?: string; - candidateType?: string; - priority?: number; - addressSourceUrl?: string; -} - -interface RTCIceCandidateComplete { -} - -interface RTCIceCandidatePair { - local?: RTCIceCandidate; - remote?: RTCIceCandidate; -} - -interface RTCIceCandidatePairStats extends RTCStats { - transportId?: string; - localCandidateId?: string; - remoteCandidateId?: string; - state?: string; - priority?: number; - nominated?: boolean; - writable?: boolean; - readable?: boolean; - bytesSent?: number; - bytesReceived?: number; - roundTripTime?: number; - availableOutgoingBitrate?: number; - availableIncomingBitrate?: number; -} - -interface RTCIceGatherOptions { - gatherPolicy?: string; - iceservers?: RTCIceServer[]; -} - -interface RTCIceParameters { - usernameFragment?: string; - password?: string; -} - -interface RTCIceServer { - urls?: any; - username?: string; - credential?: string; -} - -interface RTCInboundRTPStreamStats extends RTCRTPStreamStats { - packetsReceived?: number; - bytesReceived?: number; - packetsLost?: number; - jitter?: number; - fractionLost?: number; -} - -interface RTCMediaStreamTrackStats extends RTCStats { - trackIdentifier?: string; - remoteSource?: boolean; - ssrcIds?: string[]; - frameWidth?: number; - frameHeight?: number; - framesPerSecond?: number; - framesSent?: number; - framesReceived?: number; - framesDecoded?: number; - framesDropped?: number; - framesCorrupted?: number; - audioLevel?: number; - echoReturnLoss?: number; - echoReturnLossEnhancement?: number; -} - -interface RTCOutboundRTPStreamStats extends RTCRTPStreamStats { - packetsSent?: number; - bytesSent?: number; - targetBitrate?: number; - roundTripTime?: number; -} - -interface RTCRTPStreamStats extends RTCStats { - ssrc?: string; - associateStatsId?: string; - isRemote?: boolean; - mediaTrackId?: string; - transportId?: string; - codecId?: string; - firCount?: number; - pliCount?: number; - nackCount?: number; - sliCount?: number; -} - -interface RTCRtcpFeedback { - type?: string; - parameter?: string; -} - -interface RTCRtcpParameters { - ssrc?: number; - cname?: string; - reducedSize?: boolean; - mux?: boolean; -} - -interface RTCRtpCapabilities { - codecs?: RTCRtpCodecCapability[]; - headerExtensions?: RTCRtpHeaderExtension[]; - fecMechanisms?: string[]; -} - -interface RTCRtpCodecCapability { - name?: string; - kind?: string; - clockRate?: number; - preferredPayloadType?: number; - maxptime?: number; - numChannels?: number; - rtcpFeedback?: RTCRtcpFeedback[]; - parameters?: any; - options?: any; - maxTemporalLayers?: number; - maxSpatialLayers?: number; - svcMultiStreamSupport?: boolean; -} - -interface RTCRtpCodecParameters { - name?: string; - payloadType?: any; - clockRate?: number; - maxptime?: number; - numChannels?: number; - rtcpFeedback?: RTCRtcpFeedback[]; - parameters?: any; -} - -interface RTCRtpContributingSource { - timestamp?: number; - csrc?: number; - audioLevel?: number; -} - -interface RTCRtpEncodingParameters { - ssrc?: number; - codecPayloadType?: number; - fec?: RTCRtpFecParameters; - rtx?: RTCRtpRtxParameters; - priority?: number; - maxBitrate?: number; - minQuality?: number; - framerateBias?: number; - resolutionScale?: number; - framerateScale?: number; - active?: boolean; - encodingId?: string; - dependencyEncodingIds?: string[]; - ssrcRange?: RTCSsrcRange; -} - -interface RTCRtpFecParameters { - ssrc?: number; - mechanism?: string; -} - -interface RTCRtpHeaderExtension { - kind?: string; - uri?: string; - preferredId?: number; - preferredEncrypt?: boolean; -} - -interface RTCRtpHeaderExtensionParameters { - uri?: string; - id?: number; - encrypt?: boolean; -} - -interface RTCRtpParameters { - muxId?: string; - codecs?: RTCRtpCodecParameters[]; - headerExtensions?: RTCRtpHeaderExtensionParameters[]; - encodings?: RTCRtpEncodingParameters[]; - rtcp?: RTCRtcpParameters; -} - -interface RTCRtpRtxParameters { - ssrc?: number; -} - -interface RTCRtpUnhandled { - ssrc?: number; - payloadType?: number; - muxId?: string; -} - -interface RTCSrtpKeyParam { - keyMethod?: string; - keySalt?: string; - lifetime?: string; - mkiValue?: number; - mkiLength?: number; -} - -interface RTCSrtpSdesParameters { - tag?: number; - cryptoSuite?: string; - keyParams?: RTCSrtpKeyParam[]; - sessionParams?: string[]; -} - -interface RTCSsrcRange { - min?: number; - max?: number; -} - -interface RTCStats { - timestamp?: number; - type?: string; - id?: string; - msType?: string; -} - -interface RTCStatsReport { -} - -interface RTCTransportStats extends RTCStats { - bytesSent?: number; - bytesReceived?: number; - rtcpTransportStatsId?: string; - activeConnection?: boolean; - selectedCandidatePairId?: string; - localCertificateId?: string; - remoteCertificateId?: string; -} - -interface StoreExceptionsInformation extends ExceptionInformation { - siteName?: string; - explanationString?: string; - detailURI?: string; -} - -interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { - arrayOfDomainStrings?: string[]; -} - -interface UIEventInit extends EventInit { - view?: Window; - detail?: number; -} - -interface WebGLContextAttributes { - failIfMajorPerformanceCaveat?: boolean; - alpha?: boolean; - depth?: boolean; - stencil?: boolean; - antialias?: boolean; - premultipliedAlpha?: boolean; - preserveDrawingBuffer?: boolean; -} - -interface WebGLContextEventInit extends EventInit { - statusMessage?: string; -} - -interface WheelEventInit extends MouseEventInit { - deltaX?: number; - deltaY?: number; - deltaZ?: number; - deltaMode?: number; -} - -interface EventListener { - (evt: Event): void; -} - -interface ANGLE_instanced_arrays { - drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void; - drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void; - vertexAttribDivisorANGLE(index: number, divisor: number): void; - readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; -} - -declare var ANGLE_instanced_arrays: { - prototype: ANGLE_instanced_arrays; - new(): ANGLE_instanced_arrays; - readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; -} - -interface AnalyserNode extends AudioNode { - fftSize: number; - readonly frequencyBinCount: number; - maxDecibels: number; - minDecibels: number; - smoothingTimeConstant: number; - getByteFrequencyData(array: Uint8Array): void; - getByteTimeDomainData(array: Uint8Array): void; - getFloatFrequencyData(array: Float32Array): void; - getFloatTimeDomainData(array: Float32Array): void; -} - -declare var AnalyserNode: { - prototype: AnalyserNode; - new(): AnalyserNode; -} - -interface AnimationEvent extends Event { - readonly animationName: string; - readonly elapsedTime: number; - initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; -} - -declare var AnimationEvent: { - prototype: AnimationEvent; - new(): AnimationEvent; -} - -interface ApplicationCacheEventMap { - "cached": Event; - "checking": Event; - "downloading": Event; - "error": ErrorEvent; - "noupdate": Event; - "obsolete": Event; - "progress": ProgressEvent; - "updateready": Event; -} - -interface ApplicationCache extends EventTarget { - oncached: (this: ApplicationCache, ev: Event) => any; - onchecking: (this: ApplicationCache, ev: Event) => any; - ondownloading: (this: ApplicationCache, ev: Event) => any; - onerror: (this: ApplicationCache, ev: ErrorEvent) => any; - onnoupdate: (this: ApplicationCache, ev: Event) => any; - onobsolete: (this: ApplicationCache, ev: Event) => any; - onprogress: (this: ApplicationCache, ev: ProgressEvent) => any; - onupdateready: (this: ApplicationCache, ev: Event) => any; - readonly status: number; - abort(): void; - swapCache(): void; - update(): void; - readonly CHECKING: number; - readonly DOWNLOADING: number; - readonly IDLE: number; - readonly OBSOLETE: number; - readonly UNCACHED: number; - readonly UPDATEREADY: number; - addEventListener(type: K, listener: (this: ApplicationCache, ev: ApplicationCacheEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var ApplicationCache: { - prototype: ApplicationCache; - new(): ApplicationCache; - readonly CHECKING: number; - readonly DOWNLOADING: number; - readonly IDLE: number; - readonly OBSOLETE: number; - readonly UNCACHED: number; - readonly UPDATEREADY: number; -} - -interface AriaRequestEvent extends Event { - readonly attributeName: string; - attributeValue: string | null; -} - -declare var AriaRequestEvent: { - prototype: AriaRequestEvent; - new(type: string, eventInitDict?: AriaRequestEventInit): AriaRequestEvent; -} - -interface Attr extends Node { - readonly name: string; - readonly ownerElement: Element; - readonly prefix: string | null; - readonly specified: boolean; - value: string; -} - -declare var Attr: { - prototype: Attr; - new(): Attr; -} - -interface AudioBuffer { - readonly duration: number; - readonly length: number; - readonly numberOfChannels: number; - readonly sampleRate: number; - copyFromChannel(destination: Float32Array, channelNumber: number, startInChannel?: number): void; - copyToChannel(source: Float32Array, channelNumber: number, startInChannel?: number): void; - getChannelData(channel: number): Float32Array; -} - -declare var AudioBuffer: { - prototype: AudioBuffer; - new(): AudioBuffer; -} - -interface AudioBufferSourceNodeEventMap { - "ended": MediaStreamErrorEvent; -} - -interface AudioBufferSourceNode extends AudioNode { - buffer: AudioBuffer | null; - readonly detune: AudioParam; - loop: boolean; - loopEnd: number; - loopStart: number; - onended: (this: AudioBufferSourceNode, ev: MediaStreamErrorEvent) => any; - readonly playbackRate: AudioParam; - start(when?: number, offset?: number, duration?: number): void; - stop(when?: number): void; - addEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioBufferSourceNodeEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var AudioBufferSourceNode: { - prototype: AudioBufferSourceNode; - new(): AudioBufferSourceNode; -} - -interface AudioContext extends EventTarget { - readonly currentTime: number; - readonly destination: AudioDestinationNode; - readonly listener: AudioListener; - readonly sampleRate: number; - state: string; - createAnalyser(): AnalyserNode; - createBiquadFilter(): BiquadFilterNode; - createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; - createBufferSource(): AudioBufferSourceNode; - createChannelMerger(numberOfInputs?: number): ChannelMergerNode; - createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode; - createConvolver(): ConvolverNode; - createDelay(maxDelayTime?: number): DelayNode; - createDynamicsCompressor(): DynamicsCompressorNode; - createGain(): GainNode; - createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode; - createMediaStreamSource(mediaStream: MediaStream): MediaStreamAudioSourceNode; - createOscillator(): OscillatorNode; - createPanner(): PannerNode; - createPeriodicWave(real: Float32Array, imag: Float32Array, constraints?: PeriodicWaveConstraints): PeriodicWave; - createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode; - createStereoPanner(): StereoPannerNode; - createWaveShaper(): WaveShaperNode; - decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): PromiseLike; -} - -declare var AudioContext: { - prototype: AudioContext; - new(): AudioContext; -} - -interface AudioDestinationNode extends AudioNode { - readonly maxChannelCount: number; -} - -declare var AudioDestinationNode: { - prototype: AudioDestinationNode; - new(): AudioDestinationNode; -} - -interface AudioListener { - dopplerFactor: number; - speedOfSound: number; - setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void; - setPosition(x: number, y: number, z: number): void; - setVelocity(x: number, y: number, z: number): void; -} - -declare var AudioListener: { - prototype: AudioListener; - new(): AudioListener; -} - -interface AudioNode extends EventTarget { - channelCount: number; - channelCountMode: string; - channelInterpretation: string; - readonly context: AudioContext; - readonly numberOfInputs: number; - readonly numberOfOutputs: number; - connect(destination: AudioNode, output?: number, input?: number): void; - disconnect(output?: number): void; - disconnect(destination: AudioNode, output?: number, input?: number): void; - disconnect(destination: AudioParam, output?: number): void; -} - -declare var AudioNode: { - prototype: AudioNode; - new(): AudioNode; -} - -interface AudioParam { - readonly defaultValue: number; - value: number; - cancelScheduledValues(startTime: number): void; - exponentialRampToValueAtTime(value: number, endTime: number): void; - linearRampToValueAtTime(value: number, endTime: number): void; - setTargetAtTime(target: number, startTime: number, timeConstant: number): void; - setValueAtTime(value: number, startTime: number): void; - setValueCurveAtTime(values: Float32Array, startTime: number, duration: number): void; -} - -declare var AudioParam: { - prototype: AudioParam; - new(): AudioParam; -} - -interface AudioProcessingEvent extends Event { - readonly inputBuffer: AudioBuffer; - readonly outputBuffer: AudioBuffer; - readonly playbackTime: number; -} - -declare var AudioProcessingEvent: { - prototype: AudioProcessingEvent; - new(): AudioProcessingEvent; -} - -interface AudioTrack { - enabled: boolean; - readonly id: string; - kind: string; - readonly label: string; - language: string; - readonly sourceBuffer: SourceBuffer; -} - -declare var AudioTrack: { - prototype: AudioTrack; - new(): AudioTrack; -} - -interface AudioTrackListEventMap { - "addtrack": TrackEvent; - "change": Event; - "removetrack": TrackEvent; -} - -interface AudioTrackList extends EventTarget { - readonly length: number; - onaddtrack: (this: AudioTrackList, ev: TrackEvent) => any; - onchange: (this: AudioTrackList, ev: Event) => any; - onremovetrack: (this: AudioTrackList, ev: TrackEvent) => any; - getTrackById(id: string): AudioTrack | null; - item(index: number): AudioTrack; - addEventListener(type: K, listener: (this: AudioTrackList, ev: AudioTrackListEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [index: number]: AudioTrack; -} - -declare var AudioTrackList: { - prototype: AudioTrackList; - new(): AudioTrackList; -} - -interface BarProp { - readonly visible: boolean; -} - -declare var BarProp: { - prototype: BarProp; - new(): BarProp; -} - -interface BeforeUnloadEvent extends Event { - returnValue: any; -} - -declare var BeforeUnloadEvent: { - prototype: BeforeUnloadEvent; - new(): BeforeUnloadEvent; -} - -interface BiquadFilterNode extends AudioNode { - readonly Q: AudioParam; - readonly detune: AudioParam; - readonly frequency: AudioParam; - readonly gain: AudioParam; - type: string; - getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void; -} - -declare var BiquadFilterNode: { - prototype: BiquadFilterNode; - new(): BiquadFilterNode; -} - -interface Blob { - readonly size: number; - readonly type: string; - msClose(): void; - msDetachStream(): any; - slice(start?: number, end?: number, contentType?: string): Blob; -} - -declare var Blob: { - prototype: Blob; - new (blobParts?: any[], options?: BlobPropertyBag): Blob; -} - -interface CDATASection extends Text { -} - -declare var CDATASection: { - prototype: CDATASection; - new(): CDATASection; -} - -interface CSS { - supports(property: string, value?: string): boolean; -} -declare var CSS: CSS; - -interface CSSConditionRule extends CSSGroupingRule { - conditionText: string; -} - -declare var CSSConditionRule: { - prototype: CSSConditionRule; - new(): CSSConditionRule; -} - -interface CSSFontFaceRule extends CSSRule { - readonly style: CSSStyleDeclaration; -} - -declare var CSSFontFaceRule: { - prototype: CSSFontFaceRule; - new(): CSSFontFaceRule; -} - -interface CSSGroupingRule extends CSSRule { - readonly cssRules: CSSRuleList; - deleteRule(index: number): void; - insertRule(rule: string, index: number): number; -} - -declare var CSSGroupingRule: { - prototype: CSSGroupingRule; - new(): CSSGroupingRule; -} - -interface CSSImportRule extends CSSRule { - readonly href: string; - readonly media: MediaList; - readonly styleSheet: CSSStyleSheet; -} - -declare var CSSImportRule: { - prototype: CSSImportRule; - new(): CSSImportRule; -} - -interface CSSKeyframeRule extends CSSRule { - keyText: string; - readonly style: CSSStyleDeclaration; -} - -declare var CSSKeyframeRule: { - prototype: CSSKeyframeRule; - new(): CSSKeyframeRule; -} - -interface CSSKeyframesRule extends CSSRule { - readonly cssRules: CSSRuleList; - name: string; - appendRule(rule: string): void; - deleteRule(rule: string): void; - findRule(rule: string): CSSKeyframeRule; -} - -declare var CSSKeyframesRule: { - prototype: CSSKeyframesRule; - new(): CSSKeyframesRule; -} - -interface CSSMediaRule extends CSSConditionRule { - readonly media: MediaList; -} - -declare var CSSMediaRule: { - prototype: CSSMediaRule; - new(): CSSMediaRule; -} - -interface CSSNamespaceRule extends CSSRule { - readonly namespaceURI: string; - readonly prefix: string; -} - -declare var CSSNamespaceRule: { - prototype: CSSNamespaceRule; - new(): CSSNamespaceRule; -} - -interface CSSPageRule extends CSSRule { - readonly pseudoClass: string; - readonly selector: string; - selectorText: string; - readonly style: CSSStyleDeclaration; -} - -declare var CSSPageRule: { - prototype: CSSPageRule; - new(): CSSPageRule; -} - -interface CSSRule { - cssText: string; - readonly parentRule: CSSRule; - readonly parentStyleSheet: CSSStyleSheet; - readonly type: number; - readonly CHARSET_RULE: number; - readonly FONT_FACE_RULE: number; - readonly IMPORT_RULE: number; - readonly KEYFRAMES_RULE: number; - readonly KEYFRAME_RULE: number; - readonly MEDIA_RULE: number; - readonly NAMESPACE_RULE: number; - readonly PAGE_RULE: number; - readonly STYLE_RULE: number; - readonly SUPPORTS_RULE: number; - readonly UNKNOWN_RULE: number; - readonly VIEWPORT_RULE: number; -} - -declare var CSSRule: { - prototype: CSSRule; - new(): CSSRule; - readonly CHARSET_RULE: number; - readonly FONT_FACE_RULE: number; - readonly IMPORT_RULE: number; - readonly KEYFRAMES_RULE: number; - readonly KEYFRAME_RULE: number; - readonly MEDIA_RULE: number; - readonly NAMESPACE_RULE: number; - readonly PAGE_RULE: number; - readonly STYLE_RULE: number; - readonly SUPPORTS_RULE: number; - readonly UNKNOWN_RULE: number; - readonly VIEWPORT_RULE: number; -} - -interface CSSRuleList { - readonly length: number; - item(index: number): CSSRule; - [index: number]: CSSRule; -} - -declare var CSSRuleList: { - prototype: CSSRuleList; - new(): CSSRuleList; -} - -interface CSSStyleDeclaration { - alignContent: string | null; - alignItems: string | null; - alignSelf: string | null; - alignmentBaseline: string | null; - animation: string | null; - animationDelay: string | null; - animationDirection: string | null; - animationDuration: string | null; - animationFillMode: string | null; - animationIterationCount: string | null; - animationName: string | null; - animationPlayState: string | null; - animationTimingFunction: string | null; - backfaceVisibility: string | null; - background: string | null; - backgroundAttachment: string | null; - backgroundClip: string | null; - backgroundColor: string | null; - backgroundImage: string | null; - backgroundOrigin: string | null; - backgroundPosition: string | null; - backgroundPositionX: string | null; - backgroundPositionY: string | null; - backgroundRepeat: string | null; - backgroundSize: string | null; - baselineShift: string | null; - border: string | null; - borderBottom: string | null; - borderBottomColor: string | null; - borderBottomLeftRadius: string | null; - borderBottomRightRadius: string | null; - borderBottomStyle: string | null; - borderBottomWidth: string | null; - borderCollapse: string | null; - borderColor: string | null; - borderImage: string | null; - borderImageOutset: string | null; - borderImageRepeat: string | null; - borderImageSlice: string | null; - borderImageSource: string | null; - borderImageWidth: string | null; - borderLeft: string | null; - borderLeftColor: string | null; - borderLeftStyle: string | null; - borderLeftWidth: string | null; - borderRadius: string | null; - borderRight: string | null; - borderRightColor: string | null; - borderRightStyle: string | null; - borderRightWidth: string | null; - borderSpacing: string | null; - borderStyle: string | null; - borderTop: string | null; - borderTopColor: string | null; - borderTopLeftRadius: string | null; - borderTopRightRadius: string | null; - borderTopStyle: string | null; - borderTopWidth: string | null; - borderWidth: string | null; - bottom: string | null; - boxShadow: string | null; - boxSizing: string | null; - breakAfter: string | null; - breakBefore: string | null; - breakInside: string | null; - captionSide: string | null; - clear: string | null; - clip: string | null; - clipPath: string | null; - clipRule: string | null; - color: string | null; - colorInterpolationFilters: string | null; - columnCount: any; - columnFill: string | null; - columnGap: any; - columnRule: string | null; - columnRuleColor: any; - columnRuleStyle: string | null; - columnRuleWidth: any; - columnSpan: string | null; - columnWidth: any; - columns: string | null; - content: string | null; - counterIncrement: string | null; - counterReset: string | null; - cssFloat: string | null; - cssText: string; - cursor: string | null; - direction: string | null; - display: string | null; - dominantBaseline: string | null; - emptyCells: string | null; - enableBackground: string | null; - fill: string | null; - fillOpacity: string | null; - fillRule: string | null; - filter: string | null; - flex: string | null; - flexBasis: string | null; - flexDirection: string | null; - flexFlow: string | null; - flexGrow: string | null; - flexShrink: string | null; - flexWrap: string | null; - floodColor: string | null; - floodOpacity: string | null; - font: string | null; - fontFamily: string | null; - fontFeatureSettings: string | null; - fontSize: string | null; - fontSizeAdjust: string | null; - fontStretch: string | null; - fontStyle: string | null; - fontVariant: string | null; - fontWeight: string | null; - glyphOrientationHorizontal: string | null; - glyphOrientationVertical: string | null; - height: string | null; - imeMode: string | null; - justifyContent: string | null; - kerning: string | null; - left: string | null; - readonly length: number; - letterSpacing: string | null; - lightingColor: string | null; - lineHeight: string | null; - listStyle: string | null; - listStyleImage: string | null; - listStylePosition: string | null; - listStyleType: string | null; - margin: string | null; - marginBottom: string | null; - marginLeft: string | null; - marginRight: string | null; - marginTop: string | null; - marker: string | null; - markerEnd: string | null; - markerMid: string | null; - markerStart: string | null; - mask: string | null; - maxHeight: string | null; - maxWidth: string | null; - minHeight: string | null; - minWidth: string | null; - msContentZoomChaining: string | null; - msContentZoomLimit: string | null; - msContentZoomLimitMax: any; - msContentZoomLimitMin: any; - msContentZoomSnap: string | null; - msContentZoomSnapPoints: string | null; - msContentZoomSnapType: string | null; - msContentZooming: string | null; - msFlowFrom: string | null; - msFlowInto: string | null; - msFontFeatureSettings: string | null; - msGridColumn: any; - msGridColumnAlign: string | null; - msGridColumnSpan: any; - msGridColumns: string | null; - msGridRow: any; - msGridRowAlign: string | null; - msGridRowSpan: any; - msGridRows: string | null; - msHighContrastAdjust: string | null; - msHyphenateLimitChars: string | null; - msHyphenateLimitLines: any; - msHyphenateLimitZone: any; - msHyphens: string | null; - msImeAlign: string | null; - msOverflowStyle: string | null; - msScrollChaining: string | null; - msScrollLimit: string | null; - msScrollLimitXMax: any; - msScrollLimitXMin: any; - msScrollLimitYMax: any; - msScrollLimitYMin: any; - msScrollRails: string | null; - msScrollSnapPointsX: string | null; - msScrollSnapPointsY: string | null; - msScrollSnapType: string | null; - msScrollSnapX: string | null; - msScrollSnapY: string | null; - msScrollTranslation: string | null; - msTextCombineHorizontal: string | null; - msTextSizeAdjust: any; - msTouchAction: string | null; - msTouchSelect: string | null; - msUserSelect: string | null; - msWrapFlow: string; - msWrapMargin: any; - msWrapThrough: string; - opacity: string | null; - order: string | null; - orphans: string | null; - outline: string | null; - outlineColor: string | null; - outlineStyle: string | null; - outlineWidth: string | null; - overflow: string | null; - overflowX: string | null; - overflowY: string | null; - padding: string | null; - paddingBottom: string | null; - paddingLeft: string | null; - paddingRight: string | null; - paddingTop: string | null; - pageBreakAfter: string | null; - pageBreakBefore: string | null; - pageBreakInside: string | null; - readonly parentRule: CSSRule; - perspective: string | null; - perspectiveOrigin: string | null; - pointerEvents: string | null; - position: string | null; - quotes: string | null; - right: string | null; - rubyAlign: string | null; - rubyOverhang: string | null; - rubyPosition: string | null; - stopColor: string | null; - stopOpacity: string | null; - stroke: string | null; - strokeDasharray: string | null; - strokeDashoffset: string | null; - strokeLinecap: string | null; - strokeLinejoin: string | null; - strokeMiterlimit: string | null; - strokeOpacity: string | null; - strokeWidth: string | null; - tableLayout: string | null; - textAlign: string | null; - textAlignLast: string | null; - textAnchor: string | null; - textDecoration: string | null; - textIndent: string | null; - textJustify: string | null; - textKashida: string | null; - textKashidaSpace: string | null; - textOverflow: string | null; - textShadow: string | null; - textTransform: string | null; - textUnderlinePosition: string | null; - top: string | null; - touchAction: string | null; - transform: string | null; - transformOrigin: string | null; - transformStyle: string | null; - transition: string | null; - transitionDelay: string | null; - transitionDuration: string | null; - transitionProperty: string | null; - transitionTimingFunction: string | null; - unicodeBidi: string | null; - verticalAlign: string | null; - visibility: string | null; - webkitAlignContent: string | null; - webkitAlignItems: string | null; - webkitAlignSelf: string | null; - webkitAnimation: string | null; - webkitAnimationDelay: string | null; - webkitAnimationDirection: string | null; - webkitAnimationDuration: string | null; - webkitAnimationFillMode: string | null; - webkitAnimationIterationCount: string | null; - webkitAnimationName: string | null; - webkitAnimationPlayState: string | null; - webkitAnimationTimingFunction: string | null; - webkitAppearance: string | null; - webkitBackfaceVisibility: string | null; - webkitBackgroundClip: string | null; - webkitBackgroundOrigin: string | null; - webkitBackgroundSize: string | null; - webkitBorderBottomLeftRadius: string | null; - webkitBorderBottomRightRadius: string | null; - webkitBorderImage: string | null; - webkitBorderRadius: string | null; - webkitBorderTopLeftRadius: string | null; - webkitBorderTopRightRadius: string | null; - webkitBoxAlign: string | null; - webkitBoxDirection: string | null; - webkitBoxFlex: string | null; - webkitBoxOrdinalGroup: string | null; - webkitBoxOrient: string | null; - webkitBoxPack: string | null; - webkitBoxSizing: string | null; - webkitColumnBreakAfter: string | null; - webkitColumnBreakBefore: string | null; - webkitColumnBreakInside: string | null; - webkitColumnCount: any; - webkitColumnGap: any; - webkitColumnRule: string | null; - webkitColumnRuleColor: any; - webkitColumnRuleStyle: string | null; - webkitColumnRuleWidth: any; - webkitColumnSpan: string | null; - webkitColumnWidth: any; - webkitColumns: string | null; - webkitFilter: string | null; - webkitFlex: string | null; - webkitFlexBasis: string | null; - webkitFlexDirection: string | null; - webkitFlexFlow: string | null; - webkitFlexGrow: string | null; - webkitFlexShrink: string | null; - webkitFlexWrap: string | null; - webkitJustifyContent: string | null; - webkitOrder: string | null; - webkitPerspective: string | null; - webkitPerspectiveOrigin: string | null; - webkitTapHighlightColor: string | null; - webkitTextFillColor: string | null; - webkitTextSizeAdjust: any; - webkitTransform: string | null; - webkitTransformOrigin: string | null; - webkitTransformStyle: string | null; - webkitTransition: string | null; - webkitTransitionDelay: string | null; - webkitTransitionDuration: string | null; - webkitTransitionProperty: string | null; - webkitTransitionTimingFunction: string | null; - webkitUserModify: string | null; - webkitUserSelect: string | null; - webkitWritingMode: string | null; - whiteSpace: string | null; - widows: string | null; - width: string | null; - wordBreak: string | null; - wordSpacing: string | null; - wordWrap: string | null; - writingMode: string | null; - zIndex: string | null; - zoom: string | null; - resize: string | null; - getPropertyPriority(propertyName: string): string; - getPropertyValue(propertyName: string): string; - item(index: number): string; - removeProperty(propertyName: string): string; - setProperty(propertyName: string, value: string | null, priority?: string): void; - [index: number]: string; -} - -declare var CSSStyleDeclaration: { - prototype: CSSStyleDeclaration; - new(): CSSStyleDeclaration; -} - -interface CSSStyleRule extends CSSRule { - readonly readOnly: boolean; - selectorText: string; - readonly style: CSSStyleDeclaration; -} - -declare var CSSStyleRule: { - prototype: CSSStyleRule; - new(): CSSStyleRule; -} - -interface CSSStyleSheet extends StyleSheet { - readonly cssRules: CSSRuleList; - cssText: string; - readonly href: string; - readonly id: string; - readonly imports: StyleSheetList; - readonly isAlternate: boolean; - readonly isPrefAlternate: boolean; - readonly ownerRule: CSSRule; - readonly owningElement: Element; - readonly pages: StyleSheetPageList; - readonly readOnly: boolean; - readonly rules: CSSRuleList; - addImport(bstrURL: string, lIndex?: number): number; - addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; - addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; - deleteRule(index?: number): void; - insertRule(rule: string, index?: number): number; - removeImport(lIndex: number): void; - removeRule(lIndex: number): void; -} - -declare var CSSStyleSheet: { - prototype: CSSStyleSheet; - new(): CSSStyleSheet; -} - -interface CSSSupportsRule extends CSSConditionRule { -} - -declare var CSSSupportsRule: { - prototype: CSSSupportsRule; - new(): CSSSupportsRule; -} - -interface CanvasGradient { - addColorStop(offset: number, color: string): void; -} - -declare var CanvasGradient: { - prototype: CanvasGradient; - new(): CanvasGradient; -} - -interface CanvasPattern { - setTransform(matrix: SVGMatrix): void; -} - -declare var CanvasPattern: { - prototype: CanvasPattern; - new(): CanvasPattern; -} - -interface CanvasRenderingContext2D extends Object, CanvasPathMethods { - readonly canvas: HTMLCanvasElement; - fillStyle: string | CanvasGradient | CanvasPattern; - font: string; - globalAlpha: number; - globalCompositeOperation: string; - lineCap: string; - lineDashOffset: number; - lineJoin: string; - lineWidth: number; - miterLimit: number; - msFillRule: string; - msImageSmoothingEnabled: boolean; - shadowBlur: number; - shadowColor: string; - shadowOffsetX: number; - shadowOffsetY: number; - strokeStyle: string | CanvasGradient | CanvasPattern; - textAlign: string; - textBaseline: string; - mozImageSmoothingEnabled: boolean; - webkitImageSmoothingEnabled: boolean; - oImageSmoothingEnabled: boolean; - beginPath(): void; - clearRect(x: number, y: number, w: number, h: number): void; - clip(fillRule?: string): void; - createImageData(imageDataOrSw: number | ImageData, sh?: number): ImageData; - createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; - createPattern(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, repetition: string): CanvasPattern; - createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; - drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; - fill(fillRule?: string): void; - fillRect(x: number, y: number, w: number, h: number): void; - fillText(text: string, x: number, y: number, maxWidth?: number): void; - getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; - getLineDash(): number[]; - isPointInPath(x: number, y: number, fillRule?: string): boolean; - measureText(text: string): TextMetrics; - putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; - restore(): void; - rotate(angle: number): void; - save(): void; - scale(x: number, y: number): void; - setLineDash(segments: number[]): void; - setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - stroke(): void; - strokeRect(x: number, y: number, w: number, h: number): void; - strokeText(text: string, x: number, y: number, maxWidth?: number): void; - transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - translate(x: number, y: number): void; -} - -declare var CanvasRenderingContext2D: { - prototype: CanvasRenderingContext2D; - new(): CanvasRenderingContext2D; -} - -interface ChannelMergerNode extends AudioNode { -} - -declare var ChannelMergerNode: { - prototype: ChannelMergerNode; - new(): ChannelMergerNode; -} - -interface ChannelSplitterNode extends AudioNode { -} - -declare var ChannelSplitterNode: { - prototype: ChannelSplitterNode; - new(): ChannelSplitterNode; -} - -interface CharacterData extends Node, ChildNode { - data: string; - readonly length: number; - appendData(arg: string): void; - deleteData(offset: number, count: number): void; - insertData(offset: number, arg: string): void; - replaceData(offset: number, count: number, arg: string): void; - substringData(offset: number, count: number): string; -} - -declare var CharacterData: { - prototype: CharacterData; - new(): CharacterData; -} - -interface ClientRect { - bottom: number; - readonly height: number; - left: number; - right: number; - top: number; - readonly width: number; -} - -declare var ClientRect: { - prototype: ClientRect; - new(): ClientRect; -} - -interface ClientRectList { - readonly length: number; - item(index: number): ClientRect; - [index: number]: ClientRect; -} - -declare var ClientRectList: { - prototype: ClientRectList; - new(): ClientRectList; -} - -interface ClipboardEvent extends Event { - readonly clipboardData: DataTransfer; -} - -declare var ClipboardEvent: { - prototype: ClipboardEvent; - new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent; -} - -interface CloseEvent extends Event { - readonly code: number; - readonly reason: string; - readonly wasClean: boolean; - initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; -} - -declare var CloseEvent: { - prototype: CloseEvent; - new(): CloseEvent; -} - -interface CommandEvent extends Event { - readonly commandName: string; - readonly detail: string | null; -} - -declare var CommandEvent: { - prototype: CommandEvent; - new(type: string, eventInitDict?: CommandEventInit): CommandEvent; -} - -interface Comment extends CharacterData { - text: string; -} - -declare var Comment: { - prototype: Comment; - new(): Comment; -} - -interface CompositionEvent extends UIEvent { - readonly data: string; - readonly locale: string; - initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; -} - -declare var CompositionEvent: { - prototype: CompositionEvent; - new(typeArg: string, eventInitDict?: CompositionEventInit): CompositionEvent; -} - -interface Console { - assert(test?: boolean, message?: string, ...optionalParams: any[]): void; - clear(): void; - count(countTitle?: string): void; - debug(message?: string, ...optionalParams: any[]): void; - dir(value?: any, ...optionalParams: any[]): void; - dirxml(value: any): void; - error(message?: any, ...optionalParams: any[]): void; - exception(message?: string, ...optionalParams: any[]): void; - group(groupTitle?: string): void; - groupCollapsed(groupTitle?: string): void; - groupEnd(): void; - info(message?: any, ...optionalParams: any[]): void; - log(message?: any, ...optionalParams: any[]): void; - msIsIndependentlyComposed(element: Element): boolean; - profile(reportName?: string): void; - profileEnd(): void; - select(element: Element): void; - table(...data: any[]): void; - time(timerName?: string): void; - timeEnd(timerName?: string): void; - trace(message?: any, ...optionalParams: any[]): void; - warn(message?: any, ...optionalParams: any[]): void; -} - -declare var Console: { - prototype: Console; - new(): Console; -} - -interface ConvolverNode extends AudioNode { - buffer: AudioBuffer | null; - normalize: boolean; -} - -declare var ConvolverNode: { - prototype: ConvolverNode; - new(): ConvolverNode; -} - -interface Coordinates { - readonly accuracy: number; - readonly altitude: number | null; - readonly altitudeAccuracy: number | null; - readonly heading: number | null; - readonly latitude: number; - readonly longitude: number; - readonly speed: number | null; -} - -declare var Coordinates: { - prototype: Coordinates; - new(): Coordinates; -} - -interface Crypto extends Object, RandomSource { - readonly subtle: SubtleCrypto; -} - -declare var Crypto: { - prototype: Crypto; - new(): Crypto; -} - -interface CryptoKey { - readonly algorithm: KeyAlgorithm; - readonly extractable: boolean; - readonly type: string; - readonly usages: string[]; -} - -declare var CryptoKey: { - prototype: CryptoKey; - new(): CryptoKey; -} - -interface CryptoKeyPair { - privateKey: CryptoKey; - publicKey: CryptoKey; -} - -declare var CryptoKeyPair: { - prototype: CryptoKeyPair; - new(): CryptoKeyPair; -} - -interface CustomEvent extends Event { - readonly detail: any; - initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; -} - -declare var CustomEvent: { - prototype: CustomEvent; - new(typeArg: string, eventInitDict?: CustomEventInit): CustomEvent; -} - -interface DOMError { - readonly name: string; - toString(): string; -} - -declare var DOMError: { - prototype: DOMError; - new(): DOMError; -} - -interface DOMException { - readonly code: number; - readonly message: string; - readonly name: string; - toString(): string; - readonly ABORT_ERR: number; - readonly DATA_CLONE_ERR: number; - readonly DOMSTRING_SIZE_ERR: number; - readonly HIERARCHY_REQUEST_ERR: number; - readonly INDEX_SIZE_ERR: number; - readonly INUSE_ATTRIBUTE_ERR: number; - readonly INVALID_ACCESS_ERR: number; - readonly INVALID_CHARACTER_ERR: number; - readonly INVALID_MODIFICATION_ERR: number; - readonly INVALID_NODE_TYPE_ERR: number; - readonly INVALID_STATE_ERR: number; - readonly NAMESPACE_ERR: number; - readonly NETWORK_ERR: number; - readonly NOT_FOUND_ERR: number; - readonly NOT_SUPPORTED_ERR: number; - readonly NO_DATA_ALLOWED_ERR: number; - readonly NO_MODIFICATION_ALLOWED_ERR: number; - readonly PARSE_ERR: number; - readonly QUOTA_EXCEEDED_ERR: number; - readonly SECURITY_ERR: number; - readonly SERIALIZE_ERR: number; - readonly SYNTAX_ERR: number; - readonly TIMEOUT_ERR: number; - readonly TYPE_MISMATCH_ERR: number; - readonly URL_MISMATCH_ERR: number; - readonly VALIDATION_ERR: number; - readonly WRONG_DOCUMENT_ERR: number; -} - -declare var DOMException: { - prototype: DOMException; - new(): DOMException; - readonly ABORT_ERR: number; - readonly DATA_CLONE_ERR: number; - readonly DOMSTRING_SIZE_ERR: number; - readonly HIERARCHY_REQUEST_ERR: number; - readonly INDEX_SIZE_ERR: number; - readonly INUSE_ATTRIBUTE_ERR: number; - readonly INVALID_ACCESS_ERR: number; - readonly INVALID_CHARACTER_ERR: number; - readonly INVALID_MODIFICATION_ERR: number; - readonly INVALID_NODE_TYPE_ERR: number; - readonly INVALID_STATE_ERR: number; - readonly NAMESPACE_ERR: number; - readonly NETWORK_ERR: number; - readonly NOT_FOUND_ERR: number; - readonly NOT_SUPPORTED_ERR: number; - readonly NO_DATA_ALLOWED_ERR: number; - readonly NO_MODIFICATION_ALLOWED_ERR: number; - readonly PARSE_ERR: number; - readonly QUOTA_EXCEEDED_ERR: number; - readonly SECURITY_ERR: number; - readonly SERIALIZE_ERR: number; - readonly SYNTAX_ERR: number; - readonly TIMEOUT_ERR: number; - readonly TYPE_MISMATCH_ERR: number; - readonly URL_MISMATCH_ERR: number; - readonly VALIDATION_ERR: number; - readonly WRONG_DOCUMENT_ERR: number; -} - -interface DOMImplementation { - createDocument(namespaceURI: string | null, qualifiedName: string | null, doctype: DocumentType): Document; - createDocumentType(qualifiedName: string, publicId: string | null, systemId: string | null): DocumentType; - createHTMLDocument(title: string): Document; - hasFeature(feature: string | null, version: string | null): boolean; -} - -declare var DOMImplementation: { - prototype: DOMImplementation; - new(): DOMImplementation; -} - -interface DOMParser { - parseFromString(source: string, mimeType: string): Document; -} - -declare var DOMParser: { - prototype: DOMParser; - new(): DOMParser; -} - -interface DOMSettableTokenList extends DOMTokenList { - value: string; -} - -declare var DOMSettableTokenList: { - prototype: DOMSettableTokenList; - new(): DOMSettableTokenList; -} - -interface DOMStringList { - readonly length: number; - contains(str: string): boolean; - item(index: number): string | null; - [index: number]: string; -} - -declare var DOMStringList: { - prototype: DOMStringList; - new(): DOMStringList; -} - -interface DOMStringMap { - [name: string]: string; -} - -declare var DOMStringMap: { - prototype: DOMStringMap; - new(): DOMStringMap; -} - -interface DOMTokenList { - readonly length: number; - add(...token: string[]): void; - contains(token: string): boolean; - item(index: number): string; - remove(...token: string[]): void; - toString(): string; - toggle(token: string, force?: boolean): boolean; - [index: number]: string; -} - -declare var DOMTokenList: { - prototype: DOMTokenList; - new(): DOMTokenList; -} - -interface DataCue extends TextTrackCue { - data: ArrayBuffer; - addEventListener(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var DataCue: { - prototype: DataCue; - new(): DataCue; -} - -interface DataTransfer { - dropEffect: string; - effectAllowed: string; - readonly files: FileList; - readonly items: DataTransferItemList; - readonly types: string[]; - clearData(format?: string): boolean; - getData(format: string): string; - setData(format: string, data: string): boolean; -} - -declare var DataTransfer: { - prototype: DataTransfer; - new(): DataTransfer; -} - -interface DataTransferItem { - readonly kind: string; - readonly type: string; - getAsFile(): File | null; - getAsString(_callback: FunctionStringCallback | null): void; -} - -declare var DataTransferItem: { - prototype: DataTransferItem; - new(): DataTransferItem; -} - -interface DataTransferItemList { - readonly length: number; - add(data: File): DataTransferItem | null; - clear(): void; - item(index: number): DataTransferItem; - remove(index: number): void; - [index: number]: DataTransferItem; -} - -declare var DataTransferItemList: { - prototype: DataTransferItemList; - new(): DataTransferItemList; -} - -interface DeferredPermissionRequest { - readonly id: number; - readonly type: string; - readonly uri: string; - allow(): void; - deny(): void; -} - -declare var DeferredPermissionRequest: { - prototype: DeferredPermissionRequest; - new(): DeferredPermissionRequest; -} - -interface DelayNode extends AudioNode { - readonly delayTime: AudioParam; -} - -declare var DelayNode: { - prototype: DelayNode; - new(): DelayNode; -} - -interface DeviceAcceleration { - readonly x: number | null; - readonly y: number | null; - readonly z: number | null; -} - -declare var DeviceAcceleration: { - prototype: DeviceAcceleration; - new(): DeviceAcceleration; -} - -interface DeviceLightEvent extends Event { - readonly value: number; -} - -declare var DeviceLightEvent: { - prototype: DeviceLightEvent; - new(type: string, eventInitDict?: DeviceLightEventInit): DeviceLightEvent; -} - -interface DeviceMotionEvent extends Event { - readonly acceleration: DeviceAcceleration | null; - readonly accelerationIncludingGravity: DeviceAcceleration | null; - readonly interval: number | null; - readonly rotationRate: DeviceRotationRate | null; - initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict | null, accelerationIncludingGravity: DeviceAccelerationDict | null, rotationRate: DeviceRotationRateDict | null, interval: number | null): void; -} - -declare var DeviceMotionEvent: { - prototype: DeviceMotionEvent; - new(): DeviceMotionEvent; -} - -interface DeviceOrientationEvent extends Event { - readonly absolute: boolean; - readonly alpha: number | null; - readonly beta: number | null; - readonly gamma: number | null; - initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number | null, beta: number | null, gamma: number | null, absolute: boolean): void; -} - -declare var DeviceOrientationEvent: { - prototype: DeviceOrientationEvent; - new(): DeviceOrientationEvent; -} - -interface DeviceRotationRate { - readonly alpha: number | null; - readonly beta: number | null; - readonly gamma: number | null; -} - -declare var DeviceRotationRate: { - prototype: DeviceRotationRate; - new(): DeviceRotationRate; -} - -interface DocumentEventMap extends GlobalEventHandlersEventMap { - "abort": UIEvent; - "activate": UIEvent; - "beforeactivate": UIEvent; - "beforedeactivate": UIEvent; - "blur": FocusEvent; - "canplay": Event; - "canplaythrough": Event; - "change": Event; - "click": MouseEvent; - "contextmenu": PointerEvent; - "dblclick": MouseEvent; - "deactivate": UIEvent; - "drag": DragEvent; - "dragend": DragEvent; - "dragenter": DragEvent; - "dragleave": DragEvent; - "dragover": DragEvent; - "dragstart": DragEvent; - "drop": DragEvent; - "durationchange": Event; - "emptied": Event; - "ended": MediaStreamErrorEvent; - "error": ErrorEvent; - "focus": FocusEvent; - "fullscreenchange": Event; - "fullscreenerror": Event; - "input": Event; - "invalid": Event; - "keydown": KeyboardEvent; - "keypress": KeyboardEvent; - "keyup": KeyboardEvent; - "load": Event; - "loadeddata": Event; - "loadedmetadata": Event; - "loadstart": Event; - "mousedown": MouseEvent; - "mousemove": MouseEvent; - "mouseout": MouseEvent; - "mouseover": MouseEvent; - "mouseup": MouseEvent; - "mousewheel": WheelEvent; - "MSContentZoom": UIEvent; - "MSGestureChange": MSGestureEvent; - "MSGestureDoubleTap": MSGestureEvent; - "MSGestureEnd": MSGestureEvent; - "MSGestureHold": MSGestureEvent; - "MSGestureStart": MSGestureEvent; - "MSGestureTap": MSGestureEvent; - "MSInertiaStart": MSGestureEvent; - "MSManipulationStateChanged": MSManipulationEvent; - "MSPointerCancel": MSPointerEvent; - "MSPointerDown": MSPointerEvent; - "MSPointerEnter": MSPointerEvent; - "MSPointerLeave": MSPointerEvent; - "MSPointerMove": MSPointerEvent; - "MSPointerOut": MSPointerEvent; - "MSPointerOver": MSPointerEvent; - "MSPointerUp": MSPointerEvent; - "mssitemodejumplistitemremoved": MSSiteModeEvent; - "msthumbnailclick": MSSiteModeEvent; - "pause": Event; - "play": Event; - "playing": Event; - "pointerlockchange": Event; - "pointerlockerror": Event; - "progress": ProgressEvent; - "ratechange": Event; - "readystatechange": ProgressEvent; - "reset": Event; - "scroll": UIEvent; - "seeked": Event; - "seeking": Event; - "select": UIEvent; - "selectionchange": Event; - "selectstart": Event; - "stalled": Event; - "stop": Event; - "submit": Event; - "suspend": Event; - "timeupdate": Event; - "touchcancel": TouchEvent; - "touchend": TouchEvent; - "touchmove": TouchEvent; - "touchstart": TouchEvent; - "volumechange": Event; - "waiting": Event; - "webkitfullscreenchange": Event; - "webkitfullscreenerror": Event; -} - -interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEvent, ParentNode, DocumentOrShadowRoot { - /** - * Sets or gets the URL for the current document. - */ - readonly URL: string; - /** - * Gets the URL for the document, stripped of any character encoding. - */ - readonly URLUnencoded: string; - /** - * Gets the object that has the focus when the parent document has focus. - */ - readonly activeElement: Element; - /** - * Sets or gets the color of all active links in the document. - */ - alinkColor: string; - /** - * Returns a reference to the collection of elements contained by the object. - */ - readonly all: HTMLAllCollection; - /** - * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. - */ - anchors: HTMLCollectionOf; - /** - * Retrieves a collection of all applet objects in the document. - */ - applets: HTMLCollectionOf; - /** - * Deprecated. Sets or retrieves a value that indicates the background color behind the object. - */ - bgColor: string; - /** - * Specifies the beginning and end of the document body. - */ - body: HTMLElement; - readonly characterSet: string; - /** - * Gets or sets the character set used to encode the object. - */ - charset: string; - /** - * Gets a value that indicates whether standards-compliant mode is switched on for the object. - */ - readonly compatMode: string; - cookie: string; - readonly currentScript: HTMLScriptElement | SVGScriptElement; - /** - * Gets the default character set from the current regional language settings. - */ - readonly defaultCharset: string; - readonly defaultView: Window; - /** - * Sets or gets a value that indicates whether the document can be edited. - */ - designMode: string; - /** - * Sets or retrieves a value that indicates the reading order of the object. - */ - dir: string; - /** - * Gets an object representing the document type declaration associated with the current document. - */ - readonly doctype: DocumentType; - /** - * Gets a reference to the root node of the document. - */ - documentElement: HTMLElement; - /** - * Sets or gets the security domain of the document. - */ - domain: string; - /** - * Retrieves a collection of all embed objects in the document. - */ - embeds: HTMLCollectionOf; - /** - * Sets or gets the foreground (text) color of the document. - */ - fgColor: string; - /** - * Retrieves a collection, in source order, of all form objects in the document. - */ - forms: HTMLCollectionOf; - readonly fullscreenElement: Element | null; - readonly fullscreenEnabled: boolean; - readonly head: HTMLHeadElement; - readonly hidden: boolean; - /** - * Retrieves a collection, in source order, of img objects in the document. - */ - images: HTMLCollectionOf; - /** - * Gets the implementation object of the current document. - */ - readonly implementation: DOMImplementation; - /** - * Returns the character encoding used to create the webpage that is loaded into the document object. - */ - readonly inputEncoding: string | null; - /** - * Gets the date that the page was last modified, if the page supplies one. - */ - readonly lastModified: string; - /** - * Sets or gets the color of the document links. - */ - linkColor: string; - /** - * Retrieves a collection of all a objects that specify the href property and all area objects in the document. - */ - links: HTMLCollectionOf; - /** - * Contains information about the current URL. - */ - readonly location: Location; - msCSSOMElementFloatMetrics: boolean; - msCapsLockWarningOff: boolean; - /** - * Fires when the user aborts the download. - * @param ev The event. - */ - onabort: (this: Document, ev: UIEvent) => any; - /** - * Fires when the object is set as the active element. - * @param ev The event. - */ - onactivate: (this: Document, ev: UIEvent) => any; - /** - * Fires immediately before the object is set as the active element. - * @param ev The event. - */ - onbeforeactivate: (this: Document, ev: UIEvent) => any; - /** - * Fires immediately before the activeElement is changed from the current object to another object in the parent document. - * @param ev The event. - */ - onbeforedeactivate: (this: Document, ev: UIEvent) => any; - /** - * Fires when the object loses the input focus. - * @param ev The focus event. - */ - onblur: (this: Document, ev: FocusEvent) => any; - /** - * Occurs when playback is possible, but would require further buffering. - * @param ev The event. - */ - oncanplay: (this: Document, ev: Event) => any; - oncanplaythrough: (this: Document, ev: Event) => any; - /** - * Fires when the contents of the object or selection have changed. - * @param ev The event. - */ - onchange: (this: Document, ev: Event) => any; - /** - * Fires when the user clicks the left mouse button on the object - * @param ev The mouse event. - */ - onclick: (this: Document, ev: MouseEvent) => any; - /** - * Fires when the user clicks the right mouse button in the client area, opening the context menu. - * @param ev The mouse event. - */ - oncontextmenu: (this: Document, ev: PointerEvent) => any; - /** - * Fires when the user double-clicks the object. - * @param ev The mouse event. - */ - ondblclick: (this: Document, ev: MouseEvent) => any; - /** - * Fires when the activeElement is changed from the current object to another object in the parent document. - * @param ev The UI Event - */ - ondeactivate: (this: Document, ev: UIEvent) => any; - /** - * Fires on the source object continuously during a drag operation. - * @param ev The event. - */ - ondrag: (this: Document, ev: DragEvent) => any; - /** - * Fires on the source object when the user releases the mouse at the close of a drag operation. - * @param ev The event. - */ - ondragend: (this: Document, ev: DragEvent) => any; - /** - * Fires on the target element when the user drags the object to a valid drop target. - * @param ev The drag event. - */ - ondragenter: (this: Document, ev: DragEvent) => any; - /** - * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. - * @param ev The drag event. - */ - ondragleave: (this: Document, ev: DragEvent) => any; - /** - * Fires on the target element continuously while the user drags the object over a valid drop target. - * @param ev The event. - */ - ondragover: (this: Document, ev: DragEvent) => any; - /** - * Fires on the source object when the user starts to drag a text selection or selected object. - * @param ev The event. - */ - ondragstart: (this: Document, ev: DragEvent) => any; - ondrop: (this: Document, ev: DragEvent) => any; - /** - * Occurs when the duration attribute is updated. - * @param ev The event. - */ - ondurationchange: (this: Document, ev: Event) => any; - /** - * Occurs when the media element is reset to its initial state. - * @param ev The event. - */ - onemptied: (this: Document, ev: Event) => any; - /** - * Occurs when the end of playback is reached. - * @param ev The event - */ - onended: (this: Document, ev: MediaStreamErrorEvent) => any; - /** - * Fires when an error occurs during object loading. - * @param ev The event. - */ - onerror: (this: Document, ev: ErrorEvent) => any; - /** - * Fires when the object receives focus. - * @param ev The event. - */ - onfocus: (this: Document, ev: FocusEvent) => any; - onfullscreenchange: (this: Document, ev: Event) => any; - onfullscreenerror: (this: Document, ev: Event) => any; - oninput: (this: Document, ev: Event) => any; - oninvalid: (this: Document, ev: Event) => any; - /** - * Fires when the user presses a key. - * @param ev The keyboard event - */ - onkeydown: (this: Document, ev: KeyboardEvent) => any; - /** - * Fires when the user presses an alphanumeric key. - * @param ev The event. - */ - onkeypress: (this: Document, ev: KeyboardEvent) => any; - /** - * Fires when the user releases a key. - * @param ev The keyboard event - */ - onkeyup: (this: Document, ev: KeyboardEvent) => any; - /** - * Fires immediately after the browser loads the object. - * @param ev The event. - */ - onload: (this: Document, ev: Event) => any; - /** - * Occurs when media data is loaded at the current playback position. - * @param ev The event. - */ - onloadeddata: (this: Document, ev: Event) => any; - /** - * Occurs when the duration and dimensions of the media have been determined. - * @param ev The event. - */ - onloadedmetadata: (this: Document, ev: Event) => any; - /** - * Occurs when Internet Explorer begins looking for media data. - * @param ev The event. - */ - onloadstart: (this: Document, ev: Event) => any; - /** - * Fires when the user clicks the object with either mouse button. - * @param ev The mouse event. - */ - onmousedown: (this: Document, ev: MouseEvent) => any; - /** - * Fires when the user moves the mouse over the object. - * @param ev The mouse event. - */ - onmousemove: (this: Document, ev: MouseEvent) => any; - /** - * Fires when the user moves the mouse pointer outside the boundaries of the object. - * @param ev The mouse event. - */ - onmouseout: (this: Document, ev: MouseEvent) => any; - /** - * Fires when the user moves the mouse pointer into the object. - * @param ev The mouse event. - */ - onmouseover: (this: Document, ev: MouseEvent) => any; - /** - * Fires when the user releases a mouse button while the mouse is over the object. - * @param ev The mouse event. - */ - onmouseup: (this: Document, ev: MouseEvent) => any; - /** - * Fires when the wheel button is rotated. - * @param ev The mouse event - */ - onmousewheel: (this: Document, ev: WheelEvent) => any; - onmscontentzoom: (this: Document, ev: UIEvent) => any; - onmsgesturechange: (this: Document, ev: MSGestureEvent) => any; - onmsgesturedoubletap: (this: Document, ev: MSGestureEvent) => any; - onmsgestureend: (this: Document, ev: MSGestureEvent) => any; - onmsgesturehold: (this: Document, ev: MSGestureEvent) => any; - onmsgesturestart: (this: Document, ev: MSGestureEvent) => any; - onmsgesturetap: (this: Document, ev: MSGestureEvent) => any; - onmsinertiastart: (this: Document, ev: MSGestureEvent) => any; - onmsmanipulationstatechanged: (this: Document, ev: MSManipulationEvent) => any; - onmspointercancel: (this: Document, ev: MSPointerEvent) => any; - onmspointerdown: (this: Document, ev: MSPointerEvent) => any; - onmspointerenter: (this: Document, ev: MSPointerEvent) => any; - onmspointerleave: (this: Document, ev: MSPointerEvent) => any; - onmspointermove: (this: Document, ev: MSPointerEvent) => any; - onmspointerout: (this: Document, ev: MSPointerEvent) => any; - onmspointerover: (this: Document, ev: MSPointerEvent) => any; - onmspointerup: (this: Document, ev: MSPointerEvent) => any; - /** - * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. - * @param ev The event. - */ - onmssitemodejumplistitemremoved: (this: Document, ev: MSSiteModeEvent) => any; - /** - * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. - * @param ev The event. - */ - onmsthumbnailclick: (this: Document, ev: MSSiteModeEvent) => any; - /** - * Occurs when playback is paused. - * @param ev The event. - */ - onpause: (this: Document, ev: Event) => any; - /** - * Occurs when the play method is requested. - * @param ev The event. - */ - onplay: (this: Document, ev: Event) => any; - /** - * Occurs when the audio or video has started playing. - * @param ev The event. - */ - onplaying: (this: Document, ev: Event) => any; - onpointerlockchange: (this: Document, ev: Event) => any; - onpointerlockerror: (this: Document, ev: Event) => any; - /** - * Occurs to indicate progress while downloading media data. - * @param ev The event. - */ - onprogress: (this: Document, ev: ProgressEvent) => any; - /** - * Occurs when the playback rate is increased or decreased. - * @param ev The event. - */ - onratechange: (this: Document, ev: Event) => any; - /** - * Fires when the state of the object has changed. - * @param ev The event - */ - onreadystatechange: (this: Document, ev: ProgressEvent) => any; - /** - * Fires when the user resets a form. - * @param ev The event. - */ - onreset: (this: Document, ev: Event) => any; - /** - * Fires when the user repositions the scroll box in the scroll bar on the object. - * @param ev The event. - */ - onscroll: (this: Document, ev: UIEvent) => any; - /** - * Occurs when the seek operation ends. - * @param ev The event. - */ - onseeked: (this: Document, ev: Event) => any; - /** - * Occurs when the current playback position is moved. - * @param ev The event. - */ - onseeking: (this: Document, ev: Event) => any; - /** - * Fires when the current selection changes. - * @param ev The event. - */ - onselect: (this: Document, ev: UIEvent) => any; - /** - * Fires when the selection state of a document changes. - * @param ev The event. - */ - onselectionchange: (this: Document, ev: Event) => any; - onselectstart: (this: Document, ev: Event) => any; - /** - * Occurs when the download has stopped. - * @param ev The event. - */ - onstalled: (this: Document, ev: Event) => any; - /** - * Fires when the user clicks the Stop button or leaves the Web page. - * @param ev The event. - */ - onstop: (this: Document, ev: Event) => any; - onsubmit: (this: Document, ev: Event) => any; - /** - * Occurs if the load operation has been intentionally halted. - * @param ev The event. - */ - onsuspend: (this: Document, ev: Event) => any; - /** - * Occurs to indicate the current playback position. - * @param ev The event. - */ - ontimeupdate: (this: Document, ev: Event) => any; - ontouchcancel: (ev: TouchEvent) => any; - ontouchend: (ev: TouchEvent) => any; - ontouchmove: (ev: TouchEvent) => any; - ontouchstart: (ev: TouchEvent) => any; - /** - * Occurs when the volume is changed, or playback is muted or unmuted. - * @param ev The event. - */ - onvolumechange: (this: Document, ev: Event) => any; - /** - * Occurs when playback stops because the next frame of a video resource is not available. - * @param ev The event. - */ - onwaiting: (this: Document, ev: Event) => any; - onwebkitfullscreenchange: (this: Document, ev: Event) => any; - onwebkitfullscreenerror: (this: Document, ev: Event) => any; - plugins: HTMLCollectionOf; - readonly pointerLockElement: Element; - /** - * Retrieves a value that indicates the current state of the object. - */ - readonly readyState: string; - /** - * Gets the URL of the location that referred the user to the current page. - */ - readonly referrer: string; - /** - * Gets the root svg element in the document hierarchy. - */ - readonly rootElement: SVGSVGElement; - /** - * Retrieves a collection of all script objects in the document. - */ - scripts: HTMLCollectionOf; - readonly scrollingElement: Element | null; - /** - * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. - */ - readonly styleSheets: StyleSheetList; - /** - * Contains the title of the document. - */ - title: string; - readonly visibilityState: string; - /** - * Sets or gets the color of the links that the user has visited. - */ - vlinkColor: string; - readonly webkitCurrentFullScreenElement: Element | null; - readonly webkitFullscreenElement: Element | null; - readonly webkitFullscreenEnabled: boolean; - readonly webkitIsFullScreen: boolean; - readonly xmlEncoding: string | null; - xmlStandalone: boolean; - /** - * Gets or sets the version attribute specified in the declaration of an XML document. - */ - xmlVersion: string | null; - adoptNode(source: Node): Node; - captureEvents(): void; - caretRangeFromPoint(x: number, y: number): Range; - clear(): void; - /** - * Closes an output stream and forces the sent data to display. - */ - close(): void; - /** - * Creates an attribute object with a specified name. - * @param name String that sets the attribute object's name. - */ - createAttribute(name: string): Attr; - createAttributeNS(namespaceURI: string | null, qualifiedName: string): Attr; - createCDATASection(data: string): CDATASection; - /** - * Creates a comment object with the specified data. - * @param data Sets the comment object's data. - */ - createComment(data: string): Comment; - /** - * Creates a new document. - */ - createDocumentFragment(): DocumentFragment; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: K): HTMLElementTagNameMap[K]; - createElement(tagName: string): HTMLElement; - createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "a"): SVGAElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "circle"): SVGCircleElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "clipPath"): SVGClipPathElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "componentTransferFunction"): SVGComponentTransferFunctionElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "defs"): SVGDefsElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "desc"): SVGDescElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "ellipse"): SVGEllipseElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feBlend"): SVGFEBlendElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feColorMatrix"): SVGFEColorMatrixElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feComponentTransfer"): SVGFEComponentTransferElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feComposite"): SVGFECompositeElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feConvolveMatrix"): SVGFEConvolveMatrixElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDiffuseLighting"): SVGFEDiffuseLightingElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDisplacementMap"): SVGFEDisplacementMapElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDistantLight"): SVGFEDistantLightElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFlood"): SVGFEFloodElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncA"): SVGFEFuncAElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncB"): SVGFEFuncBElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncG"): SVGFEFuncGElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncR"): SVGFEFuncRElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feGaussianBlur"): SVGFEGaussianBlurElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feImage"): SVGFEImageElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMerge"): SVGFEMergeElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMergeNode"): SVGFEMergeNodeElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMorphology"): SVGFEMorphologyElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feOffset"): SVGFEOffsetElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "fePointLight"): SVGFEPointLightElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feSpecularLighting"): SVGFESpecularLightingElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feSpotLight"): SVGFESpotLightElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feTile"): SVGFETileElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feTurbulence"): SVGFETurbulenceElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "filter"): SVGFilterElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "foreignObject"): SVGForeignObjectElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "g"): SVGGElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "image"): SVGImageElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "gradient"): SVGGradientElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "line"): SVGLineElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "linearGradient"): SVGLinearGradientElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "marker"): SVGMarkerElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "mask"): SVGMaskElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "path"): SVGPathElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "metadata"): SVGMetadataElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "pattern"): SVGPatternElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "polygon"): SVGPolygonElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "polyline"): SVGPolylineElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "radialGradient"): SVGRadialGradientElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "rect"): SVGRectElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "svg"): SVGSVGElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "script"): SVGScriptElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "stop"): SVGStopElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "style"): SVGStyleElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "switch"): SVGSwitchElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "symbol"): SVGSymbolElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "tspan"): SVGTSpanElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textContent"): SVGTextContentElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "text"): SVGTextElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textPath"): SVGTextPathElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textPositioning"): SVGTextPositioningElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "title"): SVGTitleElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "use"): SVGUseElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "view"): SVGViewElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement - createElementNS(namespaceURI: string | null, qualifiedName: string): Element; - createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; - createNSResolver(nodeResolver: Node): XPathNSResolver; - /** - * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list - * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): NodeIterator; - createProcessingInstruction(target: string, data: string): ProcessingInstruction; - /** - * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. - */ - createRange(): Range; - /** - * Creates a text string from the specified value. - * @param data String that specifies the nodeValue property of the text node. - */ - createTextNode(data: string): Text; - createTouch(view: Window, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch; - createTouchList(...touches: Touch[]): TouchList; - /** - * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. - * @param filter A custom NodeFilter function to use. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker; - /** - * Returns the element for the specified x coordinate and the specified y coordinate. - * @param x The x-offset - * @param y The y-offset - */ - elementFromPoint(x: number, y: number): Element; - evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult; - /** - * Executes a command on the current document, current selection, or the given range. - * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. - * @param showUI Display the user interface, defaults to false. - * @param value Value to assign. - */ - execCommand(commandId: string, showUI?: boolean, value?: any): boolean; - /** - * Displays help information for the given command identifier. - * @param commandId Displays help information for the given command identifier. - */ - execCommandShowHelp(commandId: string): boolean; - exitFullscreen(): void; - exitPointerLock(): void; - /** - * Causes the element to receive the focus and executes the code specified by the onfocus event. - */ - focus(): void; - /** - * Returns a reference to the first object with the specified value of the ID or NAME attribute. - * @param elementId String that specifies the ID value. Case-insensitive. - */ - getElementById(elementId: string): HTMLElement | null; - getElementsByClassName(classNames: string): HTMLCollectionOf; - /** - * Gets a collection of objects based on the value of the NAME or ID attribute. - * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. - */ - getElementsByName(elementName: string): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(tagname: K): ElementListTagNameMap[K]; - getElementsByTagName(tagname: string): NodeListOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf; - /** - * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. - */ - getSelection(): Selection; - /** - * Gets a value indicating whether the object currently has focus. - */ - hasFocus(): boolean; - importNode(importedNode: Node, deep: boolean): Node; - msElementsFromPoint(x: number, y: number): NodeListOf; - msElementsFromRect(left: number, top: number, width: number, height: number): NodeListOf; - /** - * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. - * @param url Specifies a MIME type for the document. - * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. - * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. - * @param replace Specifies whether the existing entry for the document is replaced in the history list. - */ - open(url?: string, name?: string, features?: string, replace?: boolean): Document; - /** - * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. - * @param commandId Specifies a command identifier. - */ - queryCommandEnabled(commandId: string): boolean; - /** - * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. - * @param commandId String that specifies a command identifier. - */ - queryCommandIndeterm(commandId: string): boolean; - /** - * Returns a Boolean value that indicates the current state of the command. - * @param commandId String that specifies a command identifier. - */ - queryCommandState(commandId: string): boolean; - /** - * Returns a Boolean value that indicates whether the current command is supported on the current range. - * @param commandId Specifies a command identifier. - */ - queryCommandSupported(commandId: string): boolean; - /** - * Retrieves the string associated with a command. - * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. - */ - queryCommandText(commandId: string): string; - /** - * Returns the current value of the document, range, or current selection for the given command. - * @param commandId String that specifies a command identifier. - */ - queryCommandValue(commandId: string): string; - releaseEvents(): void; - /** - * Allows updating the print settings for the page. - */ - updateSettings(): void; - webkitCancelFullScreen(): void; - webkitExitFullscreen(): void; - /** - * Writes one or more HTML expressions to a document in the specified window. - * @param content Specifies the text and HTML tags to write. - */ - write(...content: string[]): void; - /** - * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. - * @param content The text and HTML tags to write. - */ - writeln(...content: string[]): void; - addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Document: { - prototype: Document; - new(): Document; -} - -interface DocumentFragment extends Node, NodeSelector, ParentNode { -} - -declare var DocumentFragment: { - prototype: DocumentFragment; - new(): DocumentFragment; -} - -interface DocumentType extends Node, ChildNode { - readonly entities: NamedNodeMap; - readonly internalSubset: string | null; - readonly name: string; - readonly notations: NamedNodeMap; - readonly publicId: string | null; - readonly systemId: string | null; -} - -declare var DocumentType: { - prototype: DocumentType; - new(): DocumentType; -} - -interface DragEvent extends MouseEvent { - readonly dataTransfer: DataTransfer; - initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; - msConvertURL(file: File, targetType: string, targetURL?: string): void; -} - -declare var DragEvent: { - prototype: DragEvent; - new(): DragEvent; -} - -interface DynamicsCompressorNode extends AudioNode { - readonly attack: AudioParam; - readonly knee: AudioParam; - readonly ratio: AudioParam; - readonly reduction: AudioParam; - readonly release: AudioParam; - readonly threshold: AudioParam; -} - -declare var DynamicsCompressorNode: { - prototype: DynamicsCompressorNode; - new(): DynamicsCompressorNode; -} - -interface EXT_frag_depth { -} - -declare var EXT_frag_depth: { - prototype: EXT_frag_depth; - new(): EXT_frag_depth; -} - -interface EXT_texture_filter_anisotropic { - readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; - readonly TEXTURE_MAX_ANISOTROPY_EXT: number; -} - -declare var EXT_texture_filter_anisotropic: { - prototype: EXT_texture_filter_anisotropic; - new(): EXT_texture_filter_anisotropic; - readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; - readonly TEXTURE_MAX_ANISOTROPY_EXT: number; -} - -interface ElementEventMap extends GlobalEventHandlersEventMap { - "ariarequest": AriaRequestEvent; - "command": CommandEvent; - "gotpointercapture": PointerEvent; - "lostpointercapture": PointerEvent; - "MSGestureChange": MSGestureEvent; - "MSGestureDoubleTap": MSGestureEvent; - "MSGestureEnd": MSGestureEvent; - "MSGestureHold": MSGestureEvent; - "MSGestureStart": MSGestureEvent; - "MSGestureTap": MSGestureEvent; - "MSGotPointerCapture": MSPointerEvent; - "MSInertiaStart": MSGestureEvent; - "MSLostPointerCapture": MSPointerEvent; - "MSPointerCancel": MSPointerEvent; - "MSPointerDown": MSPointerEvent; - "MSPointerEnter": MSPointerEvent; - "MSPointerLeave": MSPointerEvent; - "MSPointerMove": MSPointerEvent; - "MSPointerOut": MSPointerEvent; - "MSPointerOver": MSPointerEvent; - "MSPointerUp": MSPointerEvent; - "touchcancel": TouchEvent; - "touchend": TouchEvent; - "touchmove": TouchEvent; - "touchstart": TouchEvent; - "webkitfullscreenchange": Event; - "webkitfullscreenerror": Event; -} - -interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelector, ChildNode, ParentNode { - readonly classList: DOMTokenList; - className: string; - readonly clientHeight: number; - readonly clientLeft: number; - readonly clientTop: number; - readonly clientWidth: number; - id: string; - msContentZoomFactor: number; - readonly msRegionOverflow: string; - onariarequest: (this: Element, ev: AriaRequestEvent) => any; - oncommand: (this: Element, ev: CommandEvent) => any; - ongotpointercapture: (this: Element, ev: PointerEvent) => any; - onlostpointercapture: (this: Element, ev: PointerEvent) => any; - onmsgesturechange: (this: Element, ev: MSGestureEvent) => any; - onmsgesturedoubletap: (this: Element, ev: MSGestureEvent) => any; - onmsgestureend: (this: Element, ev: MSGestureEvent) => any; - onmsgesturehold: (this: Element, ev: MSGestureEvent) => any; - onmsgesturestart: (this: Element, ev: MSGestureEvent) => any; - onmsgesturetap: (this: Element, ev: MSGestureEvent) => any; - onmsgotpointercapture: (this: Element, ev: MSPointerEvent) => any; - onmsinertiastart: (this: Element, ev: MSGestureEvent) => any; - onmslostpointercapture: (this: Element, ev: MSPointerEvent) => any; - onmspointercancel: (this: Element, ev: MSPointerEvent) => any; - onmspointerdown: (this: Element, ev: MSPointerEvent) => any; - onmspointerenter: (this: Element, ev: MSPointerEvent) => any; - onmspointerleave: (this: Element, ev: MSPointerEvent) => any; - onmspointermove: (this: Element, ev: MSPointerEvent) => any; - onmspointerout: (this: Element, ev: MSPointerEvent) => any; - onmspointerover: (this: Element, ev: MSPointerEvent) => any; - onmspointerup: (this: Element, ev: MSPointerEvent) => any; - ontouchcancel: (ev: TouchEvent) => any; - ontouchend: (ev: TouchEvent) => any; - ontouchmove: (ev: TouchEvent) => any; - ontouchstart: (ev: TouchEvent) => any; - onwebkitfullscreenchange: (this: Element, ev: Event) => any; - onwebkitfullscreenerror: (this: Element, ev: Event) => any; - readonly prefix: string | null; - readonly scrollHeight: number; - scrollLeft: number; - scrollTop: number; - readonly scrollWidth: number; - readonly tagName: string; - innerHTML: string; - readonly assignedSlot: HTMLSlotElement | null; - slot: string; - readonly shadowRoot: ShadowRoot | null; - getAttribute(name: string): string | null; - getAttributeNS(namespaceURI: string, localName: string): string; - getAttributeNode(name: string): Attr; - getAttributeNodeNS(namespaceURI: string, localName: string): Attr; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; - getElementsByTagName(name: K): ElementListTagNameMap[K]; - getElementsByTagName(name: string): NodeListOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf; - hasAttribute(name: string): boolean; - hasAttributeNS(namespaceURI: string, localName: string): boolean; - msGetRegionContent(): MSRangeCollection; - msGetUntransformedBounds(): ClientRect; - msMatchesSelector(selectors: string): boolean; - msReleasePointerCapture(pointerId: number): void; - msSetPointerCapture(pointerId: number): void; - msZoomTo(args: MsZoomToOptions): void; - releasePointerCapture(pointerId: number): void; - removeAttribute(name?: string): void; - removeAttributeNS(namespaceURI: string, localName: string): void; - removeAttributeNode(oldAttr: Attr): Attr; - requestFullscreen(): void; - requestPointerLock(): void; - setAttribute(name: string, value: string): void; - setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; - setAttributeNode(newAttr: Attr): Attr; - setAttributeNodeNS(newAttr: Attr): Attr; - setPointerCapture(pointerId: number): void; - webkitMatchesSelector(selectors: string): boolean; - webkitRequestFullScreen(): void; - webkitRequestFullscreen(): void; - getElementsByClassName(classNames: string): NodeListOf; - matches(selector: string): boolean; - closest(selector: string): Element | null; - scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void; - scroll(options?: ScrollToOptions): void; - scroll(x: number, y: number): void; - scrollTo(options?: ScrollToOptions): void; - scrollTo(x: number, y: number): void; - scrollBy(options?: ScrollToOptions): void; - scrollBy(x: number, y: number): void; - insertAdjacentElement(position: string, insertedElement: Element): Element | null; - insertAdjacentHTML(where: string, html: string): void; - insertAdjacentText(where: string, text: string): void; - attachShadow(shadowRootInitDict: ShadowRootInit): ShadowRoot; - addEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Element: { - prototype: Element; - new(): Element; -} - -interface ErrorEvent extends Event { - readonly colno: number; - readonly error: any; - readonly filename: string; - readonly lineno: number; - readonly message: string; - initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; -} - -declare var ErrorEvent: { - prototype: ErrorEvent; - new(): ErrorEvent; -} - -interface Event { - readonly bubbles: boolean; - cancelBubble: boolean; - readonly cancelable: boolean; - readonly currentTarget: EventTarget; - readonly defaultPrevented: boolean; - readonly eventPhase: number; - readonly isTrusted: boolean; - returnValue: boolean; - readonly srcElement: Element | null; - readonly target: EventTarget; - readonly timeStamp: number; - readonly type: string; - readonly scoped: boolean; - initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; - preventDefault(): void; - stopImmediatePropagation(): void; - stopPropagation(): void; - deepPath(): EventTarget[]; - readonly AT_TARGET: number; - readonly BUBBLING_PHASE: number; - readonly CAPTURING_PHASE: number; -} - -declare var Event: { - prototype: Event; - new(type: string, eventInitDict?: EventInit): Event; - readonly AT_TARGET: number; - readonly BUBBLING_PHASE: number; - readonly CAPTURING_PHASE: number; -} - -interface EventTarget { - addEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void; - dispatchEvent(evt: Event): boolean; - removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var EventTarget: { - prototype: EventTarget; - new(): EventTarget; -} - -interface External { -} - -declare var External: { - prototype: External; - new(): External; -} - -interface File extends Blob { - readonly lastModifiedDate: any; - readonly name: string; - readonly webkitRelativePath: string; -} - -declare var File: { - prototype: File; - new (parts: (ArrayBuffer | ArrayBufferView | Blob | string)[], filename: string, properties?: FilePropertyBag): File; -} - -interface FileList { - readonly length: number; - item(index: number): File; - [index: number]: File; -} - -declare var FileList: { - prototype: FileList; - new(): FileList; -} - -interface FileReader extends EventTarget, MSBaseReader { - readonly error: DOMError; - readAsArrayBuffer(blob: Blob): void; - readAsBinaryString(blob: Blob): void; - readAsDataURL(blob: Blob): void; - readAsText(blob: Blob, encoding?: string): void; - addEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var FileReader: { - prototype: FileReader; - new(): FileReader; -} - -interface FocusEvent extends UIEvent { - readonly relatedTarget: EventTarget; - initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; -} - -declare var FocusEvent: { - prototype: FocusEvent; - new(typeArg: string, eventInitDict?: FocusEventInit): FocusEvent; -} - -interface FormData { - append(name: any, value: any, blobName?: string): void; -} - -declare var FormData: { - prototype: FormData; - new (form?: HTMLFormElement): FormData; -} - -interface GainNode extends AudioNode { - readonly gain: AudioParam; -} - -declare var GainNode: { - prototype: GainNode; - new(): GainNode; -} - -interface Gamepad { - readonly axes: number[]; - readonly buttons: GamepadButton[]; - readonly connected: boolean; - readonly id: string; - readonly index: number; - readonly mapping: string; - readonly timestamp: number; -} - -declare var Gamepad: { - prototype: Gamepad; - new(): Gamepad; -} - -interface GamepadButton { - readonly pressed: boolean; - readonly value: number; -} - -declare var GamepadButton: { - prototype: GamepadButton; - new(): GamepadButton; -} - -interface GamepadEvent extends Event { - readonly gamepad: Gamepad; -} - -declare var GamepadEvent: { - prototype: GamepadEvent; - new(): GamepadEvent; -} - -interface Geolocation { - clearWatch(watchId: number): void; - getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; - watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; -} - -declare var Geolocation: { - prototype: Geolocation; - new(): Geolocation; -} - -interface HTMLAllCollection extends HTMLCollection { - namedItem(name: string): Element; -} - -declare var HTMLAllCollection: { - prototype: HTMLAllCollection; - new(): HTMLAllCollection; -} - -interface HTMLAnchorElement extends HTMLElement { - Methods: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - download: string; - /** - * Contains the anchor portion of the URL including the hash sign (#). - */ - hash: string; - /** - * Contains the hostname and port values of the URL. - */ - host: string; - /** - * Contains the hostname of a URL. - */ - hostname: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; - readonly mimeType: string; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - readonly nameProp: string; - /** - * Contains the pathname of the URL. - */ - pathname: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Contains the protocol of the URL. - */ - protocol: string; - readonly protocolLong: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - type: string; - urn: string; - /** - * Returns a string representation of an object. - */ - toString(): string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLAnchorElement: { - prototype: HTMLAnchorElement; - new(): HTMLAnchorElement; -} - -interface HTMLAppletElement extends HTMLElement { - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - readonly BaseHref: string; - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. - */ - altHtml: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - border: string; - code: string; - /** - * Sets or retrieves the URL of the component. - */ - codeBase: string; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - /** - * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. - */ - readonly contentDocument: Document; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; - /** - * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. - */ - declare: boolean; - readonly form: HTMLFormElement; - /** - * Sets or retrieves the height of the object. - */ - height: string; - hspace: number; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - object: string | null; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - vspace: number; - width: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLAppletElement: { - prototype: HTMLAppletElement; - new(): HTMLAppletElement; -} - -interface HTMLAreaElement extends HTMLElement { - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - download: string; - /** - * Sets or retrieves the subsection of the href property that follows the number sign (#). - */ - hash: string; - /** - * Sets or retrieves the hostname and port number of the location or URL. - */ - host: string; - /** - * Sets or retrieves the host name part of the location or URL. - */ - hostname: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or gets whether clicks in this region cause action. - */ - noHref: boolean; - /** - * Sets or retrieves the file name or path specified by the object. - */ - pathname: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Sets or retrieves the protocol portion of a URL. - */ - protocol: string; - rel: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Returns a string representation of an object. - */ - toString(): string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLAreaElement: { - prototype: HTMLAreaElement; - new(): HTMLAreaElement; -} - -interface HTMLAreasCollection extends HTMLCollection { - /** - * Adds an element to the areas, controlRange, or options collection. - */ - add(element: HTMLElement, before?: HTMLElement | number): void; - /** - * Removes an element from the collection. - */ - remove(index?: number): void; -} - -declare var HTMLAreasCollection: { - prototype: HTMLAreasCollection; - new(): HTMLAreasCollection; -} - -interface HTMLAudioElement extends HTMLMediaElement { - addEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLAudioElement: { - prototype: HTMLAudioElement; - new(): HTMLAudioElement; -} - -interface HTMLBRElement extends HTMLElement { - /** - * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. - */ - clear: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLBRElement: { - prototype: HTMLBRElement; - new(): HTMLBRElement; -} - -interface HTMLBaseElement extends HTMLElement { - /** - * Gets or sets the baseline URL on which relative links are based. - */ - href: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLBaseElement: { - prototype: HTMLBaseElement; - new(): HTMLBaseElement; -} - -interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; - /** - * Sets or retrieves the font size of the object. - */ - size: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLBaseFontElement: { - prototype: HTMLBaseFontElement; - new(): HTMLBaseFontElement; -} - -interface HTMLBodyElementEventMap extends HTMLElementEventMap { - "afterprint": Event; - "beforeprint": Event; - "beforeunload": BeforeUnloadEvent; - "blur": FocusEvent; - "error": ErrorEvent; - "focus": FocusEvent; - "hashchange": HashChangeEvent; - "load": Event; - "message": MessageEvent; - "offline": Event; - "online": Event; - "orientationchange": Event; - "pagehide": PageTransitionEvent; - "pageshow": PageTransitionEvent; - "popstate": PopStateEvent; - "resize": UIEvent; - "storage": StorageEvent; - "unload": Event; -} - -interface HTMLBodyElement extends HTMLElement { - aLink: any; - background: string; - bgColor: any; - bgProperties: string; - link: any; - noWrap: boolean; - onafterprint: (this: HTMLBodyElement, ev: Event) => any; - onbeforeprint: (this: HTMLBodyElement, ev: Event) => any; - onbeforeunload: (this: HTMLBodyElement, ev: BeforeUnloadEvent) => any; - onblur: (this: HTMLBodyElement, ev: FocusEvent) => any; - onerror: (this: HTMLBodyElement, ev: ErrorEvent) => any; - onfocus: (this: HTMLBodyElement, ev: FocusEvent) => any; - onhashchange: (this: HTMLBodyElement, ev: HashChangeEvent) => any; - onload: (this: HTMLBodyElement, ev: Event) => any; - onmessage: (this: HTMLBodyElement, ev: MessageEvent) => any; - onoffline: (this: HTMLBodyElement, ev: Event) => any; - ononline: (this: HTMLBodyElement, ev: Event) => any; - onorientationchange: (this: HTMLBodyElement, ev: Event) => any; - onpagehide: (this: HTMLBodyElement, ev: PageTransitionEvent) => any; - onpageshow: (this: HTMLBodyElement, ev: PageTransitionEvent) => any; - onpopstate: (this: HTMLBodyElement, ev: PopStateEvent) => any; - onresize: (this: HTMLBodyElement, ev: UIEvent) => any; - onstorage: (this: HTMLBodyElement, ev: StorageEvent) => any; - onunload: (this: HTMLBodyElement, ev: Event) => any; - text: any; - vLink: any; - addEventListener(type: K, listener: (this: HTMLBodyElement, ev: HTMLBodyElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLBodyElement: { - prototype: HTMLBodyElement; - new(): HTMLBodyElement; -} - -interface HTMLButtonElement extends HTMLElement { - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. - */ - formAction: string; - /** - * Used to override the encoding (formEnctype attribute) specified on the form element. - */ - formEnctype: string; - /** - * Overrides the submit method attribute previously specified on a form element. - */ - formMethod: string; - /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. - */ - formNoValidate: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - status: any; - /** - * Gets the classification and default behavior of the button. - */ - type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - /** - * Sets or retrieves the default or selected value of the control. - */ - value: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLButtonElement: { - prototype: HTMLButtonElement; - new(): HTMLButtonElement; -} - -interface HTMLCanvasElement extends HTMLElement { - /** - * Gets or sets the height of a canvas element on a document. - */ - height: number; - /** - * Gets or sets the width of a canvas element on a document. - */ - width: number; - /** - * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. - * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); - */ - getContext(contextId: "2d", contextAttributes?: Canvas2DContextAttributes): CanvasRenderingContext2D | null; - getContext(contextId: "webgl" | "experimental-webgl", contextAttributes?: WebGLContextAttributes): WebGLRenderingContext | null; - getContext(contextId: string, contextAttributes?: {}): CanvasRenderingContext2D | WebGLRenderingContext | null; - /** - * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. - */ - msToBlob(): Blob; - /** - * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. - * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. - */ - toDataURL(type?: string, ...args: any[]): string; - toBlob(callback: (result: Blob | null) => void, type?: string, ...arguments: any[]): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLCanvasElement: { - prototype: HTMLCanvasElement; - new(): HTMLCanvasElement; -} - -interface HTMLCollection { - /** - * Sets or retrieves the number of objects in a collection. - */ - readonly length: number; - /** - * Retrieves an object from various collections. - */ - item(index: number): Element; - /** - * Retrieves a select object or an object from an options collection. - */ - namedItem(name: string): Element; - [index: number]: Element; -} - -declare var HTMLCollection: { - prototype: HTMLCollection; - new(): HTMLCollection; -} - -interface HTMLDListElement extends HTMLElement { - compact: boolean; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLDListElement: { - prototype: HTMLDListElement; - new(): HTMLDListElement; -} - -interface HTMLDataListElement extends HTMLElement { - options: HTMLCollectionOf; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLDataListElement: { - prototype: HTMLDataListElement; - new(): HTMLDataListElement; -} - -interface HTMLDirectoryElement extends HTMLElement { - compact: boolean; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLDirectoryElement: { - prototype: HTMLDirectoryElement; - new(): HTMLDirectoryElement; -} - -interface HTMLDivElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLDivElement: { - prototype: HTMLDivElement; - new(): HTMLDivElement; -} - -interface HTMLDocument extends Document { - addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLDocument: { - prototype: HTMLDocument; - new(): HTMLDocument; -} - -interface HTMLElementEventMap extends ElementEventMap { - "abort": UIEvent; - "activate": UIEvent; - "beforeactivate": UIEvent; - "beforecopy": ClipboardEvent; - "beforecut": ClipboardEvent; - "beforedeactivate": UIEvent; - "beforepaste": ClipboardEvent; - "blur": FocusEvent; - "canplay": Event; - "canplaythrough": Event; - "change": Event; - "click": MouseEvent; - "contextmenu": PointerEvent; - "copy": ClipboardEvent; - "cuechange": Event; - "cut": ClipboardEvent; - "dblclick": MouseEvent; - "deactivate": UIEvent; - "drag": DragEvent; - "dragend": DragEvent; - "dragenter": DragEvent; - "dragleave": DragEvent; - "dragover": DragEvent; - "dragstart": DragEvent; - "drop": DragEvent; - "durationchange": Event; - "emptied": Event; - "ended": MediaStreamErrorEvent; - "error": ErrorEvent; - "focus": FocusEvent; - "input": Event; - "invalid": Event; - "keydown": KeyboardEvent; - "keypress": KeyboardEvent; - "keyup": KeyboardEvent; - "load": Event; - "loadeddata": Event; - "loadedmetadata": Event; - "loadstart": Event; - "mousedown": MouseEvent; - "mouseenter": MouseEvent; - "mouseleave": MouseEvent; - "mousemove": MouseEvent; - "mouseout": MouseEvent; - "mouseover": MouseEvent; - "mouseup": MouseEvent; - "mousewheel": WheelEvent; - "MSContentZoom": UIEvent; - "MSManipulationStateChanged": MSManipulationEvent; - "paste": ClipboardEvent; - "pause": Event; - "play": Event; - "playing": Event; - "progress": ProgressEvent; - "ratechange": Event; - "reset": Event; - "scroll": UIEvent; - "seeked": Event; - "seeking": Event; - "select": UIEvent; - "selectstart": Event; - "stalled": Event; - "submit": Event; - "suspend": Event; - "timeupdate": Event; - "volumechange": Event; - "waiting": Event; -} - -interface HTMLElement extends Element { - accessKey: string; - readonly children: HTMLCollection; - contentEditable: string; - readonly dataset: DOMStringMap; - dir: string; - draggable: boolean; - hidden: boolean; - hideFocus: boolean; - innerHTML: string; - innerText: string; - readonly isContentEditable: boolean; - lang: string; - readonly offsetHeight: number; - readonly offsetLeft: number; - readonly offsetParent: Element; - readonly offsetTop: number; - readonly offsetWidth: number; - onabort: (this: HTMLElement, ev: UIEvent) => any; - onactivate: (this: HTMLElement, ev: UIEvent) => any; - onbeforeactivate: (this: HTMLElement, ev: UIEvent) => any; - onbeforecopy: (this: HTMLElement, ev: ClipboardEvent) => any; - onbeforecut: (this: HTMLElement, ev: ClipboardEvent) => any; - onbeforedeactivate: (this: HTMLElement, ev: UIEvent) => any; - onbeforepaste: (this: HTMLElement, ev: ClipboardEvent) => any; - onblur: (this: HTMLElement, ev: FocusEvent) => any; - oncanplay: (this: HTMLElement, ev: Event) => any; - oncanplaythrough: (this: HTMLElement, ev: Event) => any; - onchange: (this: HTMLElement, ev: Event) => any; - onclick: (this: HTMLElement, ev: MouseEvent) => any; - oncontextmenu: (this: HTMLElement, ev: PointerEvent) => any; - oncopy: (this: HTMLElement, ev: ClipboardEvent) => any; - oncuechange: (this: HTMLElement, ev: Event) => any; - oncut: (this: HTMLElement, ev: ClipboardEvent) => any; - ondblclick: (this: HTMLElement, ev: MouseEvent) => any; - ondeactivate: (this: HTMLElement, ev: UIEvent) => any; - ondrag: (this: HTMLElement, ev: DragEvent) => any; - ondragend: (this: HTMLElement, ev: DragEvent) => any; - ondragenter: (this: HTMLElement, ev: DragEvent) => any; - ondragleave: (this: HTMLElement, ev: DragEvent) => any; - ondragover: (this: HTMLElement, ev: DragEvent) => any; - ondragstart: (this: HTMLElement, ev: DragEvent) => any; - ondrop: (this: HTMLElement, ev: DragEvent) => any; - ondurationchange: (this: HTMLElement, ev: Event) => any; - onemptied: (this: HTMLElement, ev: Event) => any; - onended: (this: HTMLElement, ev: MediaStreamErrorEvent) => any; - onerror: (this: HTMLElement, ev: ErrorEvent) => any; - onfocus: (this: HTMLElement, ev: FocusEvent) => any; - oninput: (this: HTMLElement, ev: Event) => any; - oninvalid: (this: HTMLElement, ev: Event) => any; - onkeydown: (this: HTMLElement, ev: KeyboardEvent) => any; - onkeypress: (this: HTMLElement, ev: KeyboardEvent) => any; - onkeyup: (this: HTMLElement, ev: KeyboardEvent) => any; - onload: (this: HTMLElement, ev: Event) => any; - onloadeddata: (this: HTMLElement, ev: Event) => any; - onloadedmetadata: (this: HTMLElement, ev: Event) => any; - onloadstart: (this: HTMLElement, ev: Event) => any; - onmousedown: (this: HTMLElement, ev: MouseEvent) => any; - onmouseenter: (this: HTMLElement, ev: MouseEvent) => any; - onmouseleave: (this: HTMLElement, ev: MouseEvent) => any; - onmousemove: (this: HTMLElement, ev: MouseEvent) => any; - onmouseout: (this: HTMLElement, ev: MouseEvent) => any; - onmouseover: (this: HTMLElement, ev: MouseEvent) => any; - onmouseup: (this: HTMLElement, ev: MouseEvent) => any; - onmousewheel: (this: HTMLElement, ev: WheelEvent) => any; - onmscontentzoom: (this: HTMLElement, ev: UIEvent) => any; - onmsmanipulationstatechanged: (this: HTMLElement, ev: MSManipulationEvent) => any; - onpaste: (this: HTMLElement, ev: ClipboardEvent) => any; - onpause: (this: HTMLElement, ev: Event) => any; - onplay: (this: HTMLElement, ev: Event) => any; - onplaying: (this: HTMLElement, ev: Event) => any; - onprogress: (this: HTMLElement, ev: ProgressEvent) => any; - onratechange: (this: HTMLElement, ev: Event) => any; - onreset: (this: HTMLElement, ev: Event) => any; - onscroll: (this: HTMLElement, ev: UIEvent) => any; - onseeked: (this: HTMLElement, ev: Event) => any; - onseeking: (this: HTMLElement, ev: Event) => any; - onselect: (this: HTMLElement, ev: UIEvent) => any; - onselectstart: (this: HTMLElement, ev: Event) => any; - onstalled: (this: HTMLElement, ev: Event) => any; - onsubmit: (this: HTMLElement, ev: Event) => any; - onsuspend: (this: HTMLElement, ev: Event) => any; - ontimeupdate: (this: HTMLElement, ev: Event) => any; - onvolumechange: (this: HTMLElement, ev: Event) => any; - onwaiting: (this: HTMLElement, ev: Event) => any; - outerHTML: string; - outerText: string; - spellcheck: boolean; - readonly style: CSSStyleDeclaration; - tabIndex: number; - title: string; - blur(): void; - click(): void; - dragDrop(): boolean; - focus(): void; - msGetInputContext(): MSInputMethodContext; - setActive(): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLElement: { - prototype: HTMLElement; - new(): HTMLElement; -} - -interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { - /** - * Sets or retrieves the height of the object. - */ - height: string; - hidden: any; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - readonly msPlayToSource: any; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Retrieves the palette used for the embedded document. - */ - readonly palette: string; - /** - * Retrieves the URL of the plug-in used to view an embedded document. - */ - readonly pluginspage: string; - readonly readyState: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the height and width units of the embed object. - */ - units: string; - /** - * Sets or retrieves the width of the object. - */ - width: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLEmbedElement: { - prototype: HTMLEmbedElement; - new(): HTMLEmbedElement; -} - -interface HTMLFieldSetElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLFieldSetElement: { - prototype: HTMLFieldSetElement; - new(): HTMLFieldSetElement; -} - -interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLFontElement: { - prototype: HTMLFontElement; - new(): HTMLFontElement; -} - -interface HTMLFormElement extends HTMLElement { - /** - * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. - */ - acceptCharset: string; - /** - * Sets or retrieves the URL to which the form content is sent for processing. - */ - action: string; - /** - * Specifies whether autocomplete is applied to an editable text field. - */ - autocomplete: string; - /** - * Retrieves a collection, in source order, of all controls in a given form. - */ - readonly elements: HTMLCollection; - /** - * Sets or retrieves the MIME encoding for the form. - */ - encoding: string; - /** - * Sets or retrieves the encoding type for the form. - */ - enctype: string; - /** - * Sets or retrieves the number of objects in a collection. - */ - readonly length: number; - /** - * Sets or retrieves how to send the form data to the server. - */ - method: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Designates a form that is not validated when submitted. - */ - noValidate: boolean; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Retrieves a form object or an object from an elements collection. - * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. - * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. - */ - item(name?: any, index?: any): any; - /** - * Retrieves a form object or an object from an elements collection. - */ - namedItem(name: string): any; - /** - * Fires when the user resets a form. - */ - reset(): void; - /** - * Fires when a FORM is about to be submitted. - */ - submit(): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [name: string]: any; -} - -declare var HTMLFormElement: { - prototype: HTMLFormElement; - new(): HTMLFormElement; -} - -interface HTMLFrameElementEventMap extends HTMLElementEventMap { - "load": Event; -} - -interface HTMLFrameElement extends HTMLElement, GetSVGDocument { - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Retrieves the document object of the page or frame. - */ - readonly contentDocument: Document; - /** - * Retrieves the object of the specified. - */ - readonly contentWindow: Window; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves the height of the object. - */ - height: string | number; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Raised when the object has been completely received from the server. - */ - onload: (this: HTMLFrameElement, ev: Event) => any; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the width of the object. - */ - width: string | number; - addEventListener(type: K, listener: (this: HTMLFrameElement, ev: HTMLFrameElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLFrameElement: { - prototype: HTMLFrameElement; - new(): HTMLFrameElement; -} - -interface HTMLFrameSetElementEventMap extends HTMLElementEventMap { - "beforeprint": Event; - "beforeunload": BeforeUnloadEvent; - "blur": FocusEvent; - "error": ErrorEvent; - "focus": FocusEvent; - "hashchange": HashChangeEvent; - "load": Event; - "message": MessageEvent; - "offline": Event; - "online": Event; - "orientationchange": Event; - "pagehide": PageTransitionEvent; - "pageshow": PageTransitionEvent; - "resize": UIEvent; - "storage": StorageEvent; - "unload": Event; -} - -interface HTMLFrameSetElement extends HTMLElement { - border: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the frame widths of the object. - */ - cols: string; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - name: string; - onafterprint: (this: HTMLFrameSetElement, ev: Event) => any; - onbeforeprint: (this: HTMLFrameSetElement, ev: Event) => any; - onbeforeunload: (this: HTMLFrameSetElement, ev: BeforeUnloadEvent) => any; - /** - * Fires when the object loses the input focus. - */ - onblur: (this: HTMLFrameSetElement, ev: FocusEvent) => any; - onerror: (this: HTMLFrameSetElement, ev: ErrorEvent) => any; - /** - * Fires when the object receives focus. - */ - onfocus: (this: HTMLFrameSetElement, ev: FocusEvent) => any; - onhashchange: (this: HTMLFrameSetElement, ev: HashChangeEvent) => any; - onload: (this: HTMLFrameSetElement, ev: Event) => any; - onmessage: (this: HTMLFrameSetElement, ev: MessageEvent) => any; - onoffline: (this: HTMLFrameSetElement, ev: Event) => any; - ononline: (this: HTMLFrameSetElement, ev: Event) => any; - onorientationchange: (this: HTMLFrameSetElement, ev: Event) => any; - onpagehide: (this: HTMLFrameSetElement, ev: PageTransitionEvent) => any; - onpageshow: (this: HTMLFrameSetElement, ev: PageTransitionEvent) => any; - onresize: (this: HTMLFrameSetElement, ev: UIEvent) => any; - onstorage: (this: HTMLFrameSetElement, ev: StorageEvent) => any; - onunload: (this: HTMLFrameSetElement, ev: Event) => any; - /** - * Sets or retrieves the frame heights of the object. - */ - rows: string; - addEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLFrameSetElement: { - prototype: HTMLFrameSetElement; - new(): HTMLFrameSetElement; -} - -interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. - */ - noShade: boolean; - /** - * Sets or retrieves the width of the object. - */ - width: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLHRElement: { - prototype: HTMLHRElement; - new(): HTMLHRElement; -} - -interface HTMLHeadElement extends HTMLElement { - profile: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLHeadElement: { - prototype: HTMLHeadElement; - new(): HTMLHeadElement; -} - -interface HTMLHeadingElement extends HTMLElement { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLHeadingElement: { - prototype: HTMLHeadingElement; - new(): HTMLHeadingElement; -} - -interface HTMLHtmlElement extends HTMLElement { - /** - * Sets or retrieves the DTD version that governs the current document. - */ - version: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLHtmlElement: { - prototype: HTMLHtmlElement; - new(): HTMLHtmlElement; -} - -interface HTMLIFrameElementEventMap extends HTMLElementEventMap { - "load": Event; -} - -interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - allowFullscreen: boolean; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Retrieves the document object of the page or frame. - */ - readonly contentDocument: Document; - /** - * Retrieves the object of the specified. - */ - readonly contentWindow: Window; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the horizontal margin for the object. - */ - hspace: number; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Raised when the object has been completely received from the server. - */ - onload: (this: HTMLIFrameElement, ev: Event) => any; - readonly sandbox: DOMSettableTokenList; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Sets or retrieves the width of the object. - */ - width: string; - addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLIFrameElement: { - prototype: HTMLIFrameElement; - new(): HTMLIFrameElement; -} - -interface HTMLImageElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Retrieves whether the object is fully loaded. - */ - readonly complete: boolean; - crossOrigin: string; - readonly currentSrc: string; - /** - * Sets or retrieves the height of the object. - */ - height: number; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - /** - * Sets or retrieves whether the image is a server-side image map. - */ - isMap: boolean; - /** - * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. - */ - longDesc: string; - lowsrc: string; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - readonly msPlayToSource: any; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * The original height of the image resource before sizing. - */ - readonly naturalHeight: number; - /** - * The original width of the image resource before sizing. - */ - readonly naturalWidth: number; - sizes: string; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - srcset: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Sets or retrieves the width of the object. - */ - width: number; - readonly x: number; - readonly y: number; - msGetAsCastingSource(): any; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLImageElement: { - prototype: HTMLImageElement; - new(): HTMLImageElement; - create(): HTMLImageElement; -} - -interface HTMLInputElement extends HTMLElement { - /** - * Sets or retrieves a comma-separated list of content types. - */ - accept: string; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Specifies whether autocomplete is applied to an editable text field. - */ - autocomplete: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - /** - * Sets or retrieves the state of the check box or radio button. - */ - checked: boolean; - /** - * Retrieves whether the object is fully loaded. - */ - readonly complete: boolean; - /** - * Sets or retrieves the state of the check box or radio button. - */ - defaultChecked: boolean; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - disabled: boolean; - /** - * Returns a FileList object on a file type input object. - */ - readonly files: FileList | null; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. - */ - formAction: string; - /** - * Used to override the encoding (formEnctype attribute) specified on the form element. - */ - formEnctype: string; - /** - * Overrides the submit method attribute previously specified on a form element. - */ - formMethod: string; - /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. - */ - formNoValidate: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - indeterminate: boolean; - /** - * Specifies the ID of a pre-defined datalist of options for an input element. - */ - readonly list: HTMLElement; - /** - * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. - */ - max: string; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. - */ - min: string; - /** - * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. - */ - multiple: boolean; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets or sets a string containing a regular expression that the user's input must match. - */ - pattern: string; - /** - * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. - */ - placeholder: string; - readOnly: boolean; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - selectionDirection: string; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - size: number; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - status: boolean; - /** - * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. - */ - step: string; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - /** - * Returns the value of the data at the cursor's current position. - */ - value: string; - valueAsDate: Date; - /** - * Returns the input field value as a number. - */ - valueAsNumber: number; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - webkitdirectory: boolean; - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - minLength: number; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Makes the selection equal to the current object. - */ - select(): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - /** - * Sets the start and end positions of a selection in a text field. - * @param start The offset into the text field for the start of the selection. - * @param end The offset into the text field for the end of the selection. - */ - setSelectionRange(start?: number, end?: number, direction?: string): void; - /** - * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. - * @param n Value to decrement the value by. - */ - stepDown(n?: number): void; - /** - * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. - * @param n Value to increment the value by. - */ - stepUp(n?: number): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLInputElement: { - prototype: HTMLInputElement; - new(): HTMLInputElement; -} - -interface HTMLLIElement extends HTMLElement { - type: string; - /** - * Sets or retrieves the value of a list item. - */ - value: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLLIElement: { - prototype: HTMLLIElement; - new(): HTMLLIElement; -} - -interface HTMLLabelElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the object to which the given label object is assigned. - */ - htmlFor: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLLabelElement: { - prototype: HTMLLabelElement; - new(): HTMLLabelElement; -} - -interface HTMLLegendElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - align: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLLegendElement: { - prototype: HTMLLegendElement; - new(): HTMLLegendElement; -} - -interface HTMLLinkElement extends HTMLElement, LinkStyle { - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - disabled: boolean; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; - /** - * Sets or retrieves the media type. - */ - media: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves the MIME type of the object. - */ - type: string; - import?: Document; - integrity: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLLinkElement: { - prototype: HTMLLinkElement; - new(): HTMLLinkElement; -} - -interface HTMLMapElement extends HTMLElement { - /** - * Retrieves a collection of the area objects defined for the given map object. - */ - readonly areas: HTMLAreasCollection; - /** - * Sets or retrieves the name of the object. - */ - name: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMapElement: { - prototype: HTMLMapElement; - new(): HTMLMapElement; -} - -interface HTMLMarqueeElementEventMap extends HTMLElementEventMap { - "bounce": Event; - "finish": Event; - "start": Event; -} - -interface HTMLMarqueeElement extends HTMLElement { - behavior: string; - bgColor: any; - direction: string; - height: string; - hspace: number; - loop: number; - onbounce: (this: HTMLMarqueeElement, ev: Event) => any; - onfinish: (this: HTMLMarqueeElement, ev: Event) => any; - onstart: (this: HTMLMarqueeElement, ev: Event) => any; - scrollAmount: number; - scrollDelay: number; - trueSpeed: boolean; - vspace: number; - width: string; - start(): void; - stop(): void; - addEventListener(type: K, listener: (this: HTMLMarqueeElement, ev: HTMLMarqueeElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMarqueeElement: { - prototype: HTMLMarqueeElement; - new(): HTMLMarqueeElement; -} - -interface HTMLMediaElementEventMap extends HTMLElementEventMap { - "encrypted": MediaEncryptedEvent; - "msneedkey": MSMediaKeyNeededEvent; -} - -interface HTMLMediaElement extends HTMLElement { - /** - * Returns an AudioTrackList object with the audio tracks for a given video element. - */ - readonly audioTracks: AudioTrackList; - /** - * Gets or sets a value that indicates whether to start playing the media automatically. - */ - autoplay: boolean; - /** - * Gets a collection of buffered time ranges. - */ - readonly buffered: TimeRanges; - /** - * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). - */ - controls: boolean; - crossOrigin: string; - /** - * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. - */ - readonly currentSrc: string; - /** - * Gets or sets the current playback position, in seconds. - */ - currentTime: number; - defaultMuted: boolean; - /** - * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. - */ - defaultPlaybackRate: number; - /** - * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. - */ - readonly duration: number; - /** - * Gets information about whether the playback has ended or not. - */ - readonly ended: boolean; - /** - * Returns an object representing the current error state of the audio or video element. - */ - readonly error: MediaError; - /** - * Gets or sets a flag to specify whether playback should restart after it completes. - */ - loop: boolean; - readonly mediaKeys: MediaKeys | null; - /** - * Specifies the purpose of the audio or video media, such as background audio or alerts. - */ - msAudioCategory: string; - /** - * Specifies the output device id that the audio will be sent to. - */ - msAudioDeviceType: string; - readonly msGraphicsTrustStatus: MSGraphicsTrust; - /** - * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. - */ - readonly msKeys: MSMediaKeys; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - readonly msPlayToSource: any; - /** - * Specifies whether or not to enable low-latency playback on the media element. - */ - msRealTime: boolean; - /** - * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. - */ - muted: boolean; - /** - * Gets the current network activity for the element. - */ - readonly networkState: number; - onencrypted: (this: HTMLMediaElement, ev: MediaEncryptedEvent) => any; - onmsneedkey: (this: HTMLMediaElement, ev: MSMediaKeyNeededEvent) => any; - /** - * Gets a flag that specifies whether playback is paused. - */ - readonly paused: boolean; - /** - * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. - */ - playbackRate: number; - /** - * Gets TimeRanges for the current media resource that has been played. - */ - readonly played: TimeRanges; - /** - * Gets or sets the current playback position, in seconds. - */ - preload: string; - readyState: number; - /** - * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. - */ - readonly seekable: TimeRanges; - /** - * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. - */ - readonly seeking: boolean; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - srcObject: MediaStream | null; - readonly textTracks: TextTrackList; - readonly videoTracks: VideoTrackList; - /** - * Gets or sets the volume level for audio portions of the media element. - */ - volume: number; - addTextTrack(kind: string, label?: string, language?: string): TextTrack; - /** - * Returns a string that specifies whether the client can play a given media resource type. - */ - canPlayType(type: string): string; - /** - * Resets the audio or video object and loads a new media resource. - */ - load(): void; - /** - * Clears all effects from the media pipeline. - */ - msClearEffects(): void; - msGetAsCastingSource(): any; - /** - * Inserts the specified audio effect into media pipeline. - */ - msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetMediaKeys(mediaKeys: MSMediaKeys): void; - /** - * Specifies the media protection manager for a given media pipeline. - */ - msSetMediaProtectionManager(mediaProtectionManager?: any): void; - /** - * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. - */ - pause(): void; - /** - * Loads and starts playback of a media resource. - */ - play(): void; - setMediaKeys(mediaKeys: MediaKeys | null): PromiseLike; - readonly HAVE_CURRENT_DATA: number; - readonly HAVE_ENOUGH_DATA: number; - readonly HAVE_FUTURE_DATA: number; - readonly HAVE_METADATA: number; - readonly HAVE_NOTHING: number; - readonly NETWORK_EMPTY: number; - readonly NETWORK_IDLE: number; - readonly NETWORK_LOADING: number; - readonly NETWORK_NO_SOURCE: number; - addEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMediaElement: { - prototype: HTMLMediaElement; - new(): HTMLMediaElement; - readonly HAVE_CURRENT_DATA: number; - readonly HAVE_ENOUGH_DATA: number; - readonly HAVE_FUTURE_DATA: number; - readonly HAVE_METADATA: number; - readonly HAVE_NOTHING: number; - readonly NETWORK_EMPTY: number; - readonly NETWORK_IDLE: number; - readonly NETWORK_LOADING: number; - readonly NETWORK_NO_SOURCE: number; -} - -interface HTMLMenuElement extends HTMLElement { - compact: boolean; - type: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMenuElement: { - prototype: HTMLMenuElement; - new(): HTMLMenuElement; -} - -interface HTMLMetaElement extends HTMLElement { - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Gets or sets meta-information to associate with httpEquiv or name. - */ - content: string; - /** - * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. - */ - httpEquiv: string; - /** - * Sets or retrieves the value specified in the content attribute of the meta object. - */ - name: string; - /** - * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. - */ - scheme: string; - /** - * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. - */ - url: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMetaElement: { - prototype: HTMLMetaElement; - new(): HTMLMetaElement; -} - -interface HTMLMeterElement extends HTMLElement { - high: number; - low: number; - max: number; - min: number; - optimum: number; - value: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMeterElement: { - prototype: HTMLMeterElement; - new(): HTMLMeterElement; -} - -interface HTMLModElement extends HTMLElement { - /** - * Sets or retrieves reference information about the object. - */ - cite: string; - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLModElement: { - prototype: HTMLModElement; - new(): HTMLModElement; -} - -interface HTMLOListElement extends HTMLElement { - compact: boolean; - /** - * The starting number. - */ - start: number; - type: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLOListElement: { - prototype: HTMLOListElement; - new(): HTMLOListElement; -} - -interface HTMLObjectElement extends HTMLElement, GetSVGDocument { - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - readonly BaseHref: string; - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. - */ - altHtml: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - border: string; - /** - * Sets or retrieves the URL of the file containing the compiled Java class. - */ - code: string; - /** - * Sets or retrieves the URL of the component. - */ - codeBase: string; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - /** - * Retrieves the document object of the page or frame. - */ - readonly contentDocument: Document; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; - declare: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the height of the object. - */ - height: string; - hspace: number; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - readonly msPlayToSource: any; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Retrieves the contained object. - */ - readonly object: any; - readonly readyState: number; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Sets or retrieves the MIME type of the object. - */ - type: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - vspace: number; - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLObjectElement: { - prototype: HTMLObjectElement; - new(): HTMLObjectElement; -} - -interface HTMLOptGroupElement extends HTMLElement { - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the ordinal position of an option in a list box. - */ - readonly index: number; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; - /** - * Sets or retrieves the text string specified by the option tag. - */ - readonly text: string; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLOptGroupElement: { - prototype: HTMLOptGroupElement; - new(): HTMLOptGroupElement; -} - -interface HTMLOptionElement extends HTMLElement { - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the ordinal position of an option in a list box. - */ - readonly index: number; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; - /** - * Sets or retrieves the text string specified by the option tag. - */ - text: string; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLOptionElement: { - prototype: HTMLOptionElement; - new(): HTMLOptionElement; - create(): HTMLOptionElement; -} - -interface HTMLOptionsCollection extends HTMLCollectionOf { - length: number; - selectedIndex: number; - add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number): void; - remove(index: number): void; -} - -declare var HTMLOptionsCollection: { - prototype: HTMLOptionsCollection; - new(): HTMLOptionsCollection; -} - -interface HTMLParagraphElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - clear: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLParagraphElement: { - prototype: HTMLParagraphElement; - new(): HTMLParagraphElement; -} - -interface HTMLParamElement extends HTMLElement { - /** - * Sets or retrieves the name of an input parameter for an element. - */ - name: string; - /** - * Sets or retrieves the content type of the resource designated by the value attribute. - */ - type: string; - /** - * Sets or retrieves the value of an input parameter for an element. - */ - value: string; - /** - * Sets or retrieves the data type of the value attribute. - */ - valueType: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLParamElement: { - prototype: HTMLParamElement; - new(): HTMLParamElement; -} - -interface HTMLPictureElement extends HTMLElement { - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLPictureElement: { - prototype: HTMLPictureElement; - new(): HTMLPictureElement; -} - -interface HTMLPreElement extends HTMLElement { - /** - * Sets or gets a value that you can use to implement your own width functionality for the object. - */ - width: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLPreElement: { - prototype: HTMLPreElement; - new(): HTMLPreElement; -} - -interface HTMLProgressElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Defines the maximum, or "done" value for a progress element. - */ - max: number; - /** - * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). - */ - readonly position: number; - /** - * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. - */ - value: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLProgressElement: { - prototype: HTMLProgressElement; - new(): HTMLProgressElement; -} - -interface HTMLQuoteElement extends HTMLElement { - /** - * Sets or retrieves reference information about the object. - */ - cite: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLQuoteElement: { - prototype: HTMLQuoteElement; - new(): HTMLQuoteElement; -} - -interface HTMLScriptElement extends HTMLElement { - async: boolean; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the status of the script. - */ - defer: boolean; - /** - * Sets or retrieves the event for which the script is written. - */ - event: string; - /** - * Sets or retrieves the object that is bound to the event script. - */ - htmlFor: string; - /** - * Retrieves the URL to an external file that contains the source code or data. - */ - src: string; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - /** - * Sets or retrieves the MIME type for the associated scripting engine. - */ - type: string; - integrity: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLScriptElement: { - prototype: HTMLScriptElement; - new(): HTMLScriptElement; -} - -interface HTMLSelectElement extends HTMLElement { - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. - */ - multiple: boolean; - /** - * Sets or retrieves the name of the object. - */ - name: string; - readonly options: HTMLOptionsCollection; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Sets or retrieves the index of the selected option in a select object. - */ - selectedIndex: number; - selectedOptions: HTMLCollectionOf; - /** - * Sets or retrieves the number of rows in the list box. - */ - size: number; - /** - * Retrieves the type of select control based on the value of the MULTIPLE attribute. - */ - readonly type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - /** - * Adds an element to the areas, controlRange, or options collection. - * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. - * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection. - */ - add(element: HTMLElement, before?: HTMLElement | number): void; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Retrieves a select object or an object from an options collection. - * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. - * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. - */ - item(name?: any, index?: any): any; - /** - * Retrieves a select object or an object from an options collection. - * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made. - */ - namedItem(name: string): any; - /** - * Removes an element from the collection. - * @param index Number that specifies the zero-based index of the element to remove from the collection. - */ - remove(index?: number): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [name: string]: any; -} - -declare var HTMLSelectElement: { - prototype: HTMLSelectElement; - new(): HTMLSelectElement; -} - -interface HTMLSourceElement extends HTMLElement { - /** - * Gets or sets the intended media type of the media source. - */ - media: string; - msKeySystem: string; - sizes: string; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - srcset: string; - /** - * Gets or sets the MIME type of a media resource. - */ - type: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLSourceElement: { - prototype: HTMLSourceElement; - new(): HTMLSourceElement; -} - -interface HTMLSpanElement extends HTMLElement { - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLSpanElement: { - prototype: HTMLSpanElement; - new(): HTMLSpanElement; -} - -interface HTMLStyleElement extends HTMLElement, LinkStyle { - disabled: boolean; - /** - * Sets or retrieves the media type. - */ - media: string; - /** - * Retrieves the CSS language in which the style sheet is written. - */ - type: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLStyleElement: { - prototype: HTMLStyleElement; - new(): HTMLStyleElement; -} - -interface HTMLTableCaptionElement extends HTMLElement { - /** - * Sets or retrieves the alignment of the caption or legend. - */ - align: string; - /** - * Sets or retrieves whether the caption appears at the top or bottom of the table. - */ - vAlign: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableCaptionElement: { - prototype: HTMLTableCaptionElement; - new(): HTMLTableCaptionElement; -} - -interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves abbreviated text for the object. - */ - abbr: string; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. - */ - axis: string; - bgColor: any; - /** - * Retrieves the position of the object in the cells collection of a row. - */ - readonly cellIndex: number; - /** - * Sets or retrieves the number columns in the table that the object should span. - */ - colSpan: number; - /** - * Sets or retrieves a list of header cells that provide information for the object. - */ - headers: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; - /** - * Sets or retrieves how many rows in a table the cell should span. - */ - rowSpan: number; - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; - /** - * Sets or retrieves the width of the object. - */ - width: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableCellElement: { - prototype: HTMLTableCellElement; - new(): HTMLTableCellElement; -} - -interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves the alignment of the object relative to the display or table. - */ - align: string; - /** - * Sets or retrieves the number of columns in the group. - */ - span: number; - /** - * Sets or retrieves the width of the object. - */ - width: any; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableColElement: { - prototype: HTMLTableColElement; - new(): HTMLTableColElement; -} - -interface HTMLTableDataCellElement extends HTMLTableCellElement { -} - -declare var HTMLTableDataCellElement: { - prototype: HTMLTableDataCellElement; - new(): HTMLTableDataCellElement; -} - -interface HTMLTableElement extends HTMLElement { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - bgColor: any; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Retrieves the caption object of a table. - */ - caption: HTMLTableCaptionElement; - /** - * Sets or retrieves the amount of space between the border of the cell and the content of the cell. - */ - cellPadding: string; - /** - * Sets or retrieves the amount of space between cells in a table. - */ - cellSpacing: string; - /** - * Sets or retrieves the number of columns in the table. - */ - cols: number; - /** - * Sets or retrieves the way the border frame around the table is displayed. - */ - frame: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: HTMLCollectionOf; - /** - * Sets or retrieves which dividing lines (inner borders) are displayed. - */ - rules: string; - /** - * Sets or retrieves a description and/or structure of the object. - */ - summary: string; - /** - * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. - */ - tBodies: HTMLCollectionOf; - /** - * Retrieves the tFoot object of the table. - */ - tFoot: HTMLTableSectionElement; - /** - * Retrieves the tHead object of the table. - */ - tHead: HTMLTableSectionElement; - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Creates an empty caption element in the table. - */ - createCaption(): HTMLTableCaptionElement; - /** - * Creates an empty tBody element in the table. - */ - createTBody(): HTMLTableSectionElement; - /** - * Creates an empty tFoot element in the table. - */ - createTFoot(): HTMLTableSectionElement; - /** - * Returns the tHead element object if successful, or null otherwise. - */ - createTHead(): HTMLTableSectionElement; - /** - * Deletes the caption element and its contents from the table. - */ - deleteCaption(): void; - /** - * Removes the specified row (tr) from the element and from the rows collection. - * @param index Number that specifies the zero-based position in the rows collection of the row to remove. - */ - deleteRow(index?: number): void; - /** - * Deletes the tFoot element and its contents from the table. - */ - deleteTFoot(): void; - /** - * Deletes the tHead element and its contents from the table. - */ - deleteTHead(): void; - /** - * Creates a new row (tr) in the table, and adds the row to the rows collection. - * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. - */ - insertRow(index?: number): HTMLTableRowElement; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableElement: { - prototype: HTMLTableElement; - new(): HTMLTableElement; -} - -interface HTMLTableHeaderCellElement extends HTMLTableCellElement { - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; -} - -declare var HTMLTableHeaderCellElement: { - prototype: HTMLTableHeaderCellElement; - new(): HTMLTableHeaderCellElement; -} - -interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - bgColor: any; - /** - * Retrieves a collection of all cells in the table row. - */ - cells: HTMLCollectionOf; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Retrieves the position of the object in the rows collection for the table. - */ - readonly rowIndex: number; - /** - * Retrieves the position of the object in the collection. - */ - readonly sectionRowIndex: number; - /** - * Removes the specified cell from the table row, as well as from the cells collection. - * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted. - */ - deleteCell(index?: number): void; - /** - * Creates a new cell in the table row, and adds the cell to the cells collection. - * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. - */ - insertCell(index?: number): HTMLTableDataCellElement; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableRowElement: { - prototype: HTMLTableRowElement; - new(): HTMLTableRowElement; -} - -interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: HTMLCollectionOf; - /** - * Removes the specified row (tr) from the element and from the rows collection. - * @param index Number that specifies the zero-based position in the rows collection of the row to remove. - */ - deleteRow(index?: number): void; - /** - * Creates a new row (tr) in the table, and adds the row to the rows collection. - * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. - */ - insertRow(index?: number): HTMLTableRowElement; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableSectionElement: { - prototype: HTMLTableSectionElement; - new(): HTMLTableSectionElement; -} - -interface HTMLTemplateElement extends HTMLElement { - readonly content: DocumentFragment; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTemplateElement: { - prototype: HTMLTemplateElement; - new(): HTMLTemplateElement; -} - -interface HTMLTextAreaElement extends HTMLElement { - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Sets or retrieves the width of the object. - */ - cols: number; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. - */ - placeholder: string; - /** - * Sets or retrieves the value indicated whether the content of the object is read-only. - */ - readOnly: boolean; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: number; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - /** - * Sets or retrieves the value indicating whether the control is selected. - */ - status: any; - /** - * Retrieves the type of control. - */ - readonly type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - /** - * Retrieves or sets the text in the entry field of the textArea element. - */ - value: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - /** - * Sets or retrieves how to handle wordwrapping in the object. - */ - wrap: string; - minLength: number; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Highlights the input area of a form element. - */ - select(): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - /** - * Sets the start and end positions of a selection in a text field. - * @param start The offset into the text field for the start of the selection. - * @param end The offset into the text field for the end of the selection. - */ - setSelectionRange(start: number, end: number): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTextAreaElement: { - prototype: HTMLTextAreaElement; - new(): HTMLTextAreaElement; -} - -interface HTMLTitleElement extends HTMLElement { - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTitleElement: { - prototype: HTMLTitleElement; - new(): HTMLTitleElement; -} - -interface HTMLTrackElement extends HTMLElement { - default: boolean; - kind: string; - label: string; - readonly readyState: number; - src: string; - srclang: string; - readonly track: TextTrack; - readonly ERROR: number; - readonly LOADED: number; - readonly LOADING: number; - readonly NONE: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTrackElement: { - prototype: HTMLTrackElement; - new(): HTMLTrackElement; - readonly ERROR: number; - readonly LOADED: number; - readonly LOADING: number; - readonly NONE: number; -} - -interface HTMLUListElement extends HTMLElement { - compact: boolean; - type: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLUListElement: { - prototype: HTMLUListElement; - new(): HTMLUListElement; -} - -interface HTMLUnknownElement extends HTMLElement { - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLUnknownElement: { - prototype: HTMLUnknownElement; - new(): HTMLUnknownElement; -} - -interface HTMLVideoElementEventMap extends HTMLMediaElementEventMap { - "MSVideoFormatChanged": Event; - "MSVideoFrameStepCompleted": Event; - "MSVideoOptimalLayoutChanged": Event; -} - -interface HTMLVideoElement extends HTMLMediaElement { - /** - * Gets or sets the height of the video element. - */ - height: number; - msHorizontalMirror: boolean; - readonly msIsLayoutOptimalForPlayback: boolean; - readonly msIsStereo3D: boolean; - msStereo3DPackingMode: string; - msStereo3DRenderMode: string; - msZoom: boolean; - onMSVideoFormatChanged: (this: HTMLVideoElement, ev: Event) => any; - onMSVideoFrameStepCompleted: (this: HTMLVideoElement, ev: Event) => any; - onMSVideoOptimalLayoutChanged: (this: HTMLVideoElement, ev: Event) => any; - /** - * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. - */ - poster: string; - /** - * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. - */ - readonly videoHeight: number; - /** - * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. - */ - readonly videoWidth: number; - readonly webkitDisplayingFullscreen: boolean; - readonly webkitSupportsFullscreen: boolean; - /** - * Gets or sets the width of the video element. - */ - width: number; - getVideoPlaybackQuality(): VideoPlaybackQuality; - msFrameStep(forward: boolean): void; - msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; - webkitEnterFullScreen(): void; - webkitEnterFullscreen(): void; - webkitExitFullScreen(): void; - webkitExitFullscreen(): void; - addEventListener(type: K, listener: (this: HTMLVideoElement, ev: HTMLVideoElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLVideoElement: { - prototype: HTMLVideoElement; - new(): HTMLVideoElement; -} - -interface HashChangeEvent extends Event { - readonly newURL: string | null; - readonly oldURL: string | null; -} - -declare var HashChangeEvent: { - prototype: HashChangeEvent; - new(type: string, eventInitDict?: HashChangeEventInit): HashChangeEvent; -} - -interface History { - readonly length: number; - readonly state: any; - scrollRestoration: ScrollRestoration; - back(): void; - forward(): void; - go(delta?: number): void; - pushState(data: any, title: string, url?: string | null): void; - replaceState(data: any, title: string, url?: string | null): void; -} - -declare var History: { - prototype: History; - new(): History; -} - -interface IDBCursor { - readonly direction: string; - key: IDBKeyRange | IDBValidKey; - readonly primaryKey: any; - source: IDBObjectStore | IDBIndex; - advance(count: number): void; - continue(key?: IDBKeyRange | IDBValidKey): void; - delete(): IDBRequest; - update(value: any): IDBRequest; - readonly NEXT: string; - readonly NEXT_NO_DUPLICATE: string; - readonly PREV: string; - readonly PREV_NO_DUPLICATE: string; -} - -declare var IDBCursor: { - prototype: IDBCursor; - new(): IDBCursor; - readonly NEXT: string; - readonly NEXT_NO_DUPLICATE: string; - readonly PREV: string; - readonly PREV_NO_DUPLICATE: string; -} - -interface IDBCursorWithValue extends IDBCursor { - readonly value: any; -} - -declare var IDBCursorWithValue: { - prototype: IDBCursorWithValue; - new(): IDBCursorWithValue; -} - -interface IDBDatabaseEventMap { - "abort": Event; - "error": ErrorEvent; -} - -interface IDBDatabase extends EventTarget { - readonly name: string; - readonly objectStoreNames: DOMStringList; - onabort: (this: IDBDatabase, ev: Event) => any; - onerror: (this: IDBDatabase, ev: ErrorEvent) => any; - version: number; - onversionchange: (ev: IDBVersionChangeEvent) => any; - close(): void; - createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore; - deleteObjectStore(name: string): void; - transaction(storeNames: string | string[], mode?: string): IDBTransaction; - addEventListener(type: "versionchange", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBDatabase: { - prototype: IDBDatabase; - new(): IDBDatabase; -} - -interface IDBFactory { - cmp(first: any, second: any): number; - deleteDatabase(name: string): IDBOpenDBRequest; - open(name: string, version?: number): IDBOpenDBRequest; -} - -declare var IDBFactory: { - prototype: IDBFactory; - new(): IDBFactory; -} - -interface IDBIndex { - keyPath: string | string[]; - readonly name: string; - readonly objectStore: IDBObjectStore; - readonly unique: boolean; - multiEntry: boolean; - count(key?: IDBKeyRange | IDBValidKey): IDBRequest; - get(key: IDBKeyRange | IDBValidKey): IDBRequest; - getKey(key: IDBKeyRange | IDBValidKey): IDBRequest; - openCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; - openKeyCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; -} - -declare var IDBIndex: { - prototype: IDBIndex; - new(): IDBIndex; -} - -interface IDBKeyRange { - readonly lower: any; - readonly lowerOpen: boolean; - readonly upper: any; - readonly upperOpen: boolean; -} - -declare var IDBKeyRange: { - prototype: IDBKeyRange; - new(): IDBKeyRange; - bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; - lowerBound(lower: any, open?: boolean): IDBKeyRange; - only(value: any): IDBKeyRange; - upperBound(upper: any, open?: boolean): IDBKeyRange; -} - -interface IDBObjectStore { - readonly indexNames: DOMStringList; - keyPath: string | string[]; - readonly name: string; - readonly transaction: IDBTransaction; - autoIncrement: boolean; - add(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest; - clear(): IDBRequest; - count(key?: IDBKeyRange | IDBValidKey): IDBRequest; - createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex; - delete(key: IDBKeyRange | IDBValidKey): IDBRequest; - deleteIndex(indexName: string): void; - get(key: any): IDBRequest; - index(name: string): IDBIndex; - openCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; - put(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest; -} - -declare var IDBObjectStore: { - prototype: IDBObjectStore; - new(): IDBObjectStore; -} - -interface IDBOpenDBRequestEventMap extends IDBRequestEventMap { - "blocked": Event; - "upgradeneeded": IDBVersionChangeEvent; -} - -interface IDBOpenDBRequest extends IDBRequest { - onblocked: (this: IDBOpenDBRequest, ev: Event) => any; - onupgradeneeded: (this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any; - addEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBOpenDBRequest: { - prototype: IDBOpenDBRequest; - new(): IDBOpenDBRequest; -} - -interface IDBRequestEventMap { - "error": ErrorEvent; - "success": Event; -} - -interface IDBRequest extends EventTarget { - readonly error: DOMError; - onerror: (this: IDBRequest, ev: ErrorEvent) => any; - onsuccess: (this: IDBRequest, ev: Event) => any; - readonly readyState: string; - readonly result: any; - source: IDBObjectStore | IDBIndex | IDBCursor; - readonly transaction: IDBTransaction; - addEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBRequest: { - prototype: IDBRequest; - new(): IDBRequest; -} - -interface IDBTransactionEventMap { - "abort": Event; - "complete": Event; - "error": ErrorEvent; -} - -interface IDBTransaction extends EventTarget { - readonly db: IDBDatabase; - readonly error: DOMError; - readonly mode: string; - onabort: (this: IDBTransaction, ev: Event) => any; - oncomplete: (this: IDBTransaction, ev: Event) => any; - onerror: (this: IDBTransaction, ev: ErrorEvent) => any; - abort(): void; - objectStore(name: string): IDBObjectStore; - readonly READ_ONLY: string; - readonly READ_WRITE: string; - readonly VERSION_CHANGE: string; - addEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBTransaction: { - prototype: IDBTransaction; - new(): IDBTransaction; - readonly READ_ONLY: string; - readonly READ_WRITE: string; - readonly VERSION_CHANGE: string; -} - -interface IDBVersionChangeEvent extends Event { - readonly newVersion: number | null; - readonly oldVersion: number; -} - -declare var IDBVersionChangeEvent: { - prototype: IDBVersionChangeEvent; - new(): IDBVersionChangeEvent; -} - -interface ImageData { - data: Uint8ClampedArray; - readonly height: number; - readonly width: number; -} - -declare var ImageData: { - prototype: ImageData; - new(width: number, height: number): ImageData; - new(array: Uint8ClampedArray, width: number, height: number): ImageData; -} - -interface KeyboardEvent extends UIEvent { - readonly altKey: boolean; - readonly char: string | null; - readonly charCode: number; - readonly ctrlKey: boolean; - readonly key: string; - readonly keyCode: number; - readonly locale: string; - readonly location: number; - readonly metaKey: boolean; - readonly repeat: boolean; - readonly shiftKey: boolean; - readonly which: number; - readonly code: string; - getModifierState(keyArg: string): boolean; - initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; - readonly DOM_KEY_LOCATION_JOYSTICK: number; - readonly DOM_KEY_LOCATION_LEFT: number; - readonly DOM_KEY_LOCATION_MOBILE: number; - readonly DOM_KEY_LOCATION_NUMPAD: number; - readonly DOM_KEY_LOCATION_RIGHT: number; - readonly DOM_KEY_LOCATION_STANDARD: number; -} - -declare var KeyboardEvent: { - prototype: KeyboardEvent; - new(typeArg: string, eventInitDict?: KeyboardEventInit): KeyboardEvent; - readonly DOM_KEY_LOCATION_JOYSTICK: number; - readonly DOM_KEY_LOCATION_LEFT: number; - readonly DOM_KEY_LOCATION_MOBILE: number; - readonly DOM_KEY_LOCATION_NUMPAD: number; - readonly DOM_KEY_LOCATION_RIGHT: number; - readonly DOM_KEY_LOCATION_STANDARD: number; -} - -interface ListeningStateChangedEvent extends Event { - readonly label: string; - readonly state: string; -} - -declare var ListeningStateChangedEvent: { - prototype: ListeningStateChangedEvent; - new(): ListeningStateChangedEvent; -} - -interface Location { - hash: string; - host: string; - hostname: string; - href: string; - readonly origin: string; - pathname: string; - port: string; - protocol: string; - search: string; - assign(url: string): void; - reload(forcedReload?: boolean): void; - replace(url: string): void; - toString(): string; -} - -declare var Location: { - prototype: Location; - new(): Location; -} - -interface LongRunningScriptDetectedEvent extends Event { - readonly executionTime: number; - stopPageScriptExecution: boolean; -} - -declare var LongRunningScriptDetectedEvent: { - prototype: LongRunningScriptDetectedEvent; - new(): LongRunningScriptDetectedEvent; -} - -interface MSApp { - clearTemporaryWebDataAsync(): MSAppAsyncOperation; - createBlobFromRandomAccessStream(type: string, seeker: any): Blob; - createDataPackage(object: any): any; - createDataPackageFromSelection(): any; - createFileFromStorageFile(storageFile: any): File; - createStreamFromInputStream(type: string, inputStream: any): MSStream; - execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; - execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; - getCurrentPriority(): string; - getHtmlPrintDocumentSourceAsync(htmlDoc: any): PromiseLike; - getViewId(view: any): any; - isTaskScheduledAtPriorityOrHigher(priority: string): boolean; - pageHandlesAllApplicationActivations(enabled: boolean): void; - suppressSubdownloadCredentialPrompts(suppress: boolean): void; - terminateApp(exceptionObject: any): void; - readonly CURRENT: string; - readonly HIGH: string; - readonly IDLE: string; - readonly NORMAL: string; -} -declare var MSApp: MSApp; - -interface MSAppAsyncOperationEventMap { - "complete": Event; - "error": ErrorEvent; -} - -interface MSAppAsyncOperation extends EventTarget { - readonly error: DOMError; - oncomplete: (this: MSAppAsyncOperation, ev: Event) => any; - onerror: (this: MSAppAsyncOperation, ev: ErrorEvent) => any; - readonly readyState: number; - readonly result: any; - start(): void; - readonly COMPLETED: number; - readonly ERROR: number; - readonly STARTED: number; - addEventListener(type: K, listener: (this: MSAppAsyncOperation, ev: MSAppAsyncOperationEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSAppAsyncOperation: { - prototype: MSAppAsyncOperation; - new(): MSAppAsyncOperation; - readonly COMPLETED: number; - readonly ERROR: number; - readonly STARTED: number; -} - -interface MSAssertion { - readonly id: string; - readonly type: string; -} - -declare var MSAssertion: { - prototype: MSAssertion; - new(): MSAssertion; -} - -interface MSBlobBuilder { - append(data: any, endings?: string): void; - getBlob(contentType?: string): Blob; -} - -declare var MSBlobBuilder: { - prototype: MSBlobBuilder; - new(): MSBlobBuilder; -} - -interface MSCredentials { - getAssertion(challenge: string, filter?: MSCredentialFilter, params?: MSSignatureParameters): PromiseLike; - makeCredential(accountInfo: MSAccountInfo, params: MSCredentialParameters[], challenge?: string): PromiseLike; -} - -declare var MSCredentials: { - prototype: MSCredentials; - new(): MSCredentials; -} - -interface MSFIDOCredentialAssertion extends MSAssertion { - readonly algorithm: string | Algorithm; - readonly attestation: any; - readonly publicKey: string; - readonly transportHints: string[]; -} - -declare var MSFIDOCredentialAssertion: { - prototype: MSFIDOCredentialAssertion; - new(): MSFIDOCredentialAssertion; -} - -interface MSFIDOSignature { - readonly authnrData: string; - readonly clientData: string; - readonly signature: string; -} - -declare var MSFIDOSignature: { - prototype: MSFIDOSignature; - new(): MSFIDOSignature; -} - -interface MSFIDOSignatureAssertion extends MSAssertion { - readonly signature: MSFIDOSignature; -} - -declare var MSFIDOSignatureAssertion: { - prototype: MSFIDOSignatureAssertion; - new(): MSFIDOSignatureAssertion; -} - -interface MSGesture { - target: Element; - addPointer(pointerId: number): void; - stop(): void; -} - -declare var MSGesture: { - prototype: MSGesture; - new(): MSGesture; -} - -interface MSGestureEvent extends UIEvent { - readonly clientX: number; - readonly clientY: number; - readonly expansion: number; - readonly gestureObject: any; - readonly hwTimestamp: number; - readonly offsetX: number; - readonly offsetY: number; - readonly rotation: number; - readonly scale: number; - readonly screenX: number; - readonly screenY: number; - readonly translationX: number; - readonly translationY: number; - readonly velocityAngular: number; - readonly velocityExpansion: number; - readonly velocityX: number; - readonly velocityY: number; - initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; - readonly MSGESTURE_FLAG_BEGIN: number; - readonly MSGESTURE_FLAG_CANCEL: number; - readonly MSGESTURE_FLAG_END: number; - readonly MSGESTURE_FLAG_INERTIA: number; - readonly MSGESTURE_FLAG_NONE: number; -} - -declare var MSGestureEvent: { - prototype: MSGestureEvent; - new(): MSGestureEvent; - readonly MSGESTURE_FLAG_BEGIN: number; - readonly MSGESTURE_FLAG_CANCEL: number; - readonly MSGESTURE_FLAG_END: number; - readonly MSGESTURE_FLAG_INERTIA: number; - readonly MSGESTURE_FLAG_NONE: number; -} - -interface MSGraphicsTrust { - readonly constrictionActive: boolean; - readonly status: string; -} - -declare var MSGraphicsTrust: { - prototype: MSGraphicsTrust; - new(): MSGraphicsTrust; -} - -interface MSHTMLWebViewElement extends HTMLElement { - readonly canGoBack: boolean; - readonly canGoForward: boolean; - readonly containsFullScreenElement: boolean; - readonly documentTitle: string; - height: number; - readonly settings: MSWebViewSettings; - src: string; - width: number; - addWebAllowedObject(name: string, applicationObject: any): void; - buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; - capturePreviewToBlobAsync(): MSWebViewAsyncOperation; - captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; - getDeferredPermissionRequestById(id: number): DeferredPermissionRequest; - getDeferredPermissionRequests(): DeferredPermissionRequest[]; - goBack(): void; - goForward(): void; - invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; - navigate(uri: string): void; - navigateToLocalStreamUri(source: string, streamResolver: any): void; - navigateToString(contents: string): void; - navigateWithHttpRequestMessage(requestMessage: any): void; - refresh(): void; - stop(): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSHTMLWebViewElement: { - prototype: MSHTMLWebViewElement; - new(): MSHTMLWebViewElement; -} - -interface MSInputMethodContextEventMap { - "MSCandidateWindowHide": Event; - "MSCandidateWindowShow": Event; - "MSCandidateWindowUpdate": Event; -} - -interface MSInputMethodContext extends EventTarget { - readonly compositionEndOffset: number; - readonly compositionStartOffset: number; - oncandidatewindowhide: (this: MSInputMethodContext, ev: Event) => any; - oncandidatewindowshow: (this: MSInputMethodContext, ev: Event) => any; - oncandidatewindowupdate: (this: MSInputMethodContext, ev: Event) => any; - readonly target: HTMLElement; - getCandidateWindowClientRect(): ClientRect; - getCompositionAlternatives(): string[]; - hasComposition(): boolean; - isCandidateWindowVisible(): boolean; - addEventListener(type: K, listener: (this: MSInputMethodContext, ev: MSInputMethodContextEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSInputMethodContext: { - prototype: MSInputMethodContext; - new(): MSInputMethodContext; -} - -interface MSManipulationEvent extends UIEvent { - readonly currentState: number; - readonly inertiaDestinationX: number; - readonly inertiaDestinationY: number; - readonly lastState: number; - initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; - readonly MS_MANIPULATION_STATE_ACTIVE: number; - readonly MS_MANIPULATION_STATE_CANCELLED: number; - readonly MS_MANIPULATION_STATE_COMMITTED: number; - readonly MS_MANIPULATION_STATE_DRAGGING: number; - readonly MS_MANIPULATION_STATE_INERTIA: number; - readonly MS_MANIPULATION_STATE_PRESELECT: number; - readonly MS_MANIPULATION_STATE_SELECTING: number; - readonly MS_MANIPULATION_STATE_STOPPED: number; -} - -declare var MSManipulationEvent: { - prototype: MSManipulationEvent; - new(): MSManipulationEvent; - readonly MS_MANIPULATION_STATE_ACTIVE: number; - readonly MS_MANIPULATION_STATE_CANCELLED: number; - readonly MS_MANIPULATION_STATE_COMMITTED: number; - readonly MS_MANIPULATION_STATE_DRAGGING: number; - readonly MS_MANIPULATION_STATE_INERTIA: number; - readonly MS_MANIPULATION_STATE_PRESELECT: number; - readonly MS_MANIPULATION_STATE_SELECTING: number; - readonly MS_MANIPULATION_STATE_STOPPED: number; -} - -interface MSMediaKeyError { - readonly code: number; - readonly systemCode: number; - readonly MS_MEDIA_KEYERR_CLIENT: number; - readonly MS_MEDIA_KEYERR_DOMAIN: number; - readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number; - readonly MS_MEDIA_KEYERR_OUTPUT: number; - readonly MS_MEDIA_KEYERR_SERVICE: number; - readonly MS_MEDIA_KEYERR_UNKNOWN: number; -} - -declare var MSMediaKeyError: { - prototype: MSMediaKeyError; - new(): MSMediaKeyError; - readonly MS_MEDIA_KEYERR_CLIENT: number; - readonly MS_MEDIA_KEYERR_DOMAIN: number; - readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number; - readonly MS_MEDIA_KEYERR_OUTPUT: number; - readonly MS_MEDIA_KEYERR_SERVICE: number; - readonly MS_MEDIA_KEYERR_UNKNOWN: number; -} - -interface MSMediaKeyMessageEvent extends Event { - readonly destinationURL: string | null; - readonly message: Uint8Array; -} - -declare var MSMediaKeyMessageEvent: { - prototype: MSMediaKeyMessageEvent; - new(): MSMediaKeyMessageEvent; -} - -interface MSMediaKeyNeededEvent extends Event { - readonly initData: Uint8Array | null; -} - -declare var MSMediaKeyNeededEvent: { - prototype: MSMediaKeyNeededEvent; - new(): MSMediaKeyNeededEvent; -} - -interface MSMediaKeySession extends EventTarget { - readonly error: MSMediaKeyError | null; - readonly keySystem: string; - readonly sessionId: string; - close(): void; - update(key: Uint8Array): void; -} - -declare var MSMediaKeySession: { - prototype: MSMediaKeySession; - new(): MSMediaKeySession; -} - -interface MSMediaKeys { - readonly keySystem: string; - createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; -} - -declare var MSMediaKeys: { - prototype: MSMediaKeys; - new(keySystem: string): MSMediaKeys; - isTypeSupported(keySystem: string, type?: string): boolean; - isTypeSupportedWithFeatures(keySystem: string, type?: string): string; -} - -interface MSPointerEvent extends MouseEvent { - readonly currentPoint: any; - readonly height: number; - readonly hwTimestamp: number; - readonly intermediatePoints: any; - readonly isPrimary: boolean; - readonly pointerId: number; - readonly pointerType: any; - readonly pressure: number; - readonly rotation: number; - readonly tiltX: number; - readonly tiltY: number; - readonly width: number; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; -} - -declare var MSPointerEvent: { - prototype: MSPointerEvent; - new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent; -} - -interface MSRangeCollection { - readonly length: number; - item(index: number): Range; - [index: number]: Range; -} - -declare var MSRangeCollection: { - prototype: MSRangeCollection; - new(): MSRangeCollection; -} - -interface MSSiteModeEvent extends Event { - readonly actionURL: string; - readonly buttonID: number; -} - -declare var MSSiteModeEvent: { - prototype: MSSiteModeEvent; - new(): MSSiteModeEvent; -} - -interface MSStream { - readonly type: string; - msClose(): void; - msDetachStream(): any; -} - -declare var MSStream: { - prototype: MSStream; - new(): MSStream; -} - -interface MSStreamReader extends EventTarget, MSBaseReader { - readonly error: DOMError; - readAsArrayBuffer(stream: MSStream, size?: number): void; - readAsBinaryString(stream: MSStream, size?: number): void; - readAsBlob(stream: MSStream, size?: number): void; - readAsDataURL(stream: MSStream, size?: number): void; - readAsText(stream: MSStream, encoding?: string, size?: number): void; - addEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSStreamReader: { - prototype: MSStreamReader; - new(): MSStreamReader; -} - -interface MSWebViewAsyncOperationEventMap { - "complete": Event; - "error": ErrorEvent; -} - -interface MSWebViewAsyncOperation extends EventTarget { - readonly error: DOMError; - oncomplete: (this: MSWebViewAsyncOperation, ev: Event) => any; - onerror: (this: MSWebViewAsyncOperation, ev: ErrorEvent) => any; - readonly readyState: number; - readonly result: any; - readonly target: MSHTMLWebViewElement; - readonly type: number; - start(): void; - readonly COMPLETED: number; - readonly ERROR: number; - readonly STARTED: number; - readonly TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - readonly TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - readonly TYPE_INVOKE_SCRIPT: number; - addEventListener(type: K, listener: (this: MSWebViewAsyncOperation, ev: MSWebViewAsyncOperationEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSWebViewAsyncOperation: { - prototype: MSWebViewAsyncOperation; - new(): MSWebViewAsyncOperation; - readonly COMPLETED: number; - readonly ERROR: number; - readonly STARTED: number; - readonly TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - readonly TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - readonly TYPE_INVOKE_SCRIPT: number; -} - -interface MSWebViewSettings { - isIndexedDBEnabled: boolean; - isJavaScriptEnabled: boolean; -} - -declare var MSWebViewSettings: { - prototype: MSWebViewSettings; - new(): MSWebViewSettings; -} - -interface MediaDeviceInfo { - readonly deviceId: string; - readonly groupId: string; - readonly kind: string; - readonly label: string; -} - -declare var MediaDeviceInfo: { - prototype: MediaDeviceInfo; - new(): MediaDeviceInfo; -} - -interface MediaDevicesEventMap { - "devicechange": Event; -} - -interface MediaDevices extends EventTarget { - ondevicechange: (this: MediaDevices, ev: Event) => any; - enumerateDevices(): any; - getSupportedConstraints(): MediaTrackSupportedConstraints; - getUserMedia(constraints: MediaStreamConstraints): PromiseLike; - addEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MediaDevices: { - prototype: MediaDevices; - new(): MediaDevices; -} - -interface MediaElementAudioSourceNode extends AudioNode { -} - -declare var MediaElementAudioSourceNode: { - prototype: MediaElementAudioSourceNode; - new(): MediaElementAudioSourceNode; -} - -interface MediaEncryptedEvent extends Event { - readonly initData: ArrayBuffer | null; - readonly initDataType: string; -} - -declare var MediaEncryptedEvent: { - prototype: MediaEncryptedEvent; - new(type: string, eventInitDict?: MediaEncryptedEventInit): MediaEncryptedEvent; -} - -interface MediaError { - readonly code: number; - readonly msExtendedCode: number; - readonly MEDIA_ERR_ABORTED: number; - readonly MEDIA_ERR_DECODE: number; - readonly MEDIA_ERR_NETWORK: number; - readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number; - readonly MS_MEDIA_ERR_ENCRYPTED: number; -} - -declare var MediaError: { - prototype: MediaError; - new(): MediaError; - readonly MEDIA_ERR_ABORTED: number; - readonly MEDIA_ERR_DECODE: number; - readonly MEDIA_ERR_NETWORK: number; - readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number; - readonly MS_MEDIA_ERR_ENCRYPTED: number; -} - -interface MediaKeyMessageEvent extends Event { - readonly message: ArrayBuffer; - readonly messageType: string; -} - -declare var MediaKeyMessageEvent: { - prototype: MediaKeyMessageEvent; - new(type: string, eventInitDict?: MediaKeyMessageEventInit): MediaKeyMessageEvent; -} - -interface MediaKeySession extends EventTarget { - readonly closed: PromiseLike; - readonly expiration: number; - readonly keyStatuses: MediaKeyStatusMap; - readonly sessionId: string; - close(): PromiseLike; - generateRequest(initDataType: string, initData: any): PromiseLike; - load(sessionId: string): PromiseLike; - remove(): PromiseLike; - update(response: any): PromiseLike; -} - -declare var MediaKeySession: { - prototype: MediaKeySession; - new(): MediaKeySession; -} - -interface MediaKeyStatusMap { - readonly size: number; - forEach(callback: ForEachCallback): void; - get(keyId: any): string; - has(keyId: any): boolean; -} - -declare var MediaKeyStatusMap: { - prototype: MediaKeyStatusMap; - new(): MediaKeyStatusMap; -} - -interface MediaKeySystemAccess { - readonly keySystem: string; - createMediaKeys(): PromiseLike; - getConfiguration(): MediaKeySystemConfiguration; -} - -declare var MediaKeySystemAccess: { - prototype: MediaKeySystemAccess; - new(): MediaKeySystemAccess; -} - -interface MediaKeys { - createSession(sessionType?: string): MediaKeySession; - setServerCertificate(serverCertificate: any): PromiseLike; -} - -declare var MediaKeys: { - prototype: MediaKeys; - new(): MediaKeys; -} - -interface MediaList { - readonly length: number; - mediaText: string; - appendMedium(newMedium: string): void; - deleteMedium(oldMedium: string): void; - item(index: number): string; - toString(): string; - [index: number]: string; -} - -declare var MediaList: { - prototype: MediaList; - new(): MediaList; -} - -interface MediaQueryList { - readonly matches: boolean; - readonly media: string; - addListener(listener: MediaQueryListListener): void; - removeListener(listener: MediaQueryListListener): void; -} - -declare var MediaQueryList: { - prototype: MediaQueryList; - new(): MediaQueryList; -} - -interface MediaSource extends EventTarget { - readonly activeSourceBuffers: SourceBufferList; - duration: number; - readonly readyState: string; - readonly sourceBuffers: SourceBufferList; - addSourceBuffer(type: string): SourceBuffer; - endOfStream(error?: number): void; - removeSourceBuffer(sourceBuffer: SourceBuffer): void; -} - -declare var MediaSource: { - prototype: MediaSource; - new(): MediaSource; - isTypeSupported(type: string): boolean; -} - -interface MediaStreamEventMap { - "active": Event; - "addtrack": TrackEvent; - "inactive": Event; - "removetrack": TrackEvent; -} - -interface MediaStream extends EventTarget { - readonly active: boolean; - readonly id: string; - onactive: (this: MediaStream, ev: Event) => any; - onaddtrack: (this: MediaStream, ev: TrackEvent) => any; - oninactive: (this: MediaStream, ev: Event) => any; - onremovetrack: (this: MediaStream, ev: TrackEvent) => any; - addTrack(track: MediaStreamTrack): void; - clone(): MediaStream; - getAudioTracks(): MediaStreamTrack[]; - getTrackById(trackId: string): MediaStreamTrack | null; - getTracks(): MediaStreamTrack[]; - getVideoTracks(): MediaStreamTrack[]; - removeTrack(track: MediaStreamTrack): void; - stop(): void; - addEventListener(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MediaStream: { - prototype: MediaStream; - new(streamOrTracks?: MediaStream | MediaStreamTrack[]): MediaStream; -} - -interface MediaStreamAudioSourceNode extends AudioNode { -} - -declare var MediaStreamAudioSourceNode: { - prototype: MediaStreamAudioSourceNode; - new(): MediaStreamAudioSourceNode; -} - -interface MediaStreamError { - readonly constraintName: string | null; - readonly message: string | null; - readonly name: string; -} - -declare var MediaStreamError: { - prototype: MediaStreamError; - new(): MediaStreamError; -} - -interface MediaStreamErrorEvent extends Event { - readonly error: MediaStreamError | null; -} - -declare var MediaStreamErrorEvent: { - prototype: MediaStreamErrorEvent; - new(type: string, eventInitDict?: MediaStreamErrorEventInit): MediaStreamErrorEvent; -} - -interface MediaStreamTrackEventMap { - "ended": MediaStreamErrorEvent; - "mute": Event; - "overconstrained": MediaStreamErrorEvent; - "unmute": Event; -} - -interface MediaStreamTrack extends EventTarget { - enabled: boolean; - readonly id: string; - readonly kind: string; - readonly label: string; - readonly muted: boolean; - onended: (this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any; - onmute: (this: MediaStreamTrack, ev: Event) => any; - onoverconstrained: (this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any; - onunmute: (this: MediaStreamTrack, ev: Event) => any; - readonly readonly: boolean; - readonly readyState: string; - readonly remote: boolean; - applyConstraints(constraints: MediaTrackConstraints): PromiseLike; - clone(): MediaStreamTrack; - getCapabilities(): MediaTrackCapabilities; - getConstraints(): MediaTrackConstraints; - getSettings(): MediaTrackSettings; - stop(): void; - addEventListener(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MediaStreamTrack: { - prototype: MediaStreamTrack; - new(): MediaStreamTrack; -} - -interface MediaStreamTrackEvent extends Event { - readonly track: MediaStreamTrack; -} - -declare var MediaStreamTrackEvent: { - prototype: MediaStreamTrackEvent; - new(type: string, eventInitDict?: MediaStreamTrackEventInit): MediaStreamTrackEvent; -} - -interface MessageChannel { - readonly port1: MessagePort; - readonly port2: MessagePort; -} - -declare var MessageChannel: { - prototype: MessageChannel; - new(): MessageChannel; -} - -interface MessageEvent extends Event { - readonly data: any; - readonly origin: string; - readonly ports: any; - readonly source: Window; - initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; -} - -declare var MessageEvent: { - prototype: MessageEvent; - new(type: string, eventInitDict?: MessageEventInit): MessageEvent; -} - -interface MessagePortEventMap { - "message": MessageEvent; -} - -interface MessagePort extends EventTarget { - onmessage: (this: MessagePort, ev: MessageEvent) => any; - close(): void; - postMessage(message?: any, ports?: any): void; - start(): void; - addEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MessagePort: { - prototype: MessagePort; - new(): MessagePort; -} - -interface MimeType { - readonly description: string; - readonly enabledPlugin: Plugin; - readonly suffixes: string; - readonly type: string; -} - -declare var MimeType: { - prototype: MimeType; - new(): MimeType; -} - -interface MimeTypeArray { - readonly length: number; - item(index: number): Plugin; - namedItem(type: string): Plugin; - [index: number]: Plugin; -} - -declare var MimeTypeArray: { - prototype: MimeTypeArray; - new(): MimeTypeArray; -} - -interface MouseEvent extends UIEvent { - readonly altKey: boolean; - readonly button: number; - readonly buttons: number; - readonly clientX: number; - readonly clientY: number; - readonly ctrlKey: boolean; - readonly fromElement: Element; - readonly layerX: number; - readonly layerY: number; - readonly metaKey: boolean; - readonly movementX: number; - readonly movementY: number; - readonly offsetX: number; - readonly offsetY: number; - readonly pageX: number; - readonly pageY: number; - readonly relatedTarget: EventTarget; - readonly screenX: number; - readonly screenY: number; - readonly shiftKey: boolean; - readonly toElement: Element; - readonly which: number; - readonly x: number; - readonly y: number; - getModifierState(keyArg: string): boolean; - initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget | null): void; -} - -declare var MouseEvent: { - prototype: MouseEvent; - new(typeArg: string, eventInitDict?: MouseEventInit): MouseEvent; -} - -interface MutationEvent extends Event { - readonly attrChange: number; - readonly attrName: string; - readonly newValue: string; - readonly prevValue: string; - readonly relatedNode: Node; - initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; - readonly ADDITION: number; - readonly MODIFICATION: number; - readonly REMOVAL: number; -} - -declare var MutationEvent: { - prototype: MutationEvent; - new(): MutationEvent; - readonly ADDITION: number; - readonly MODIFICATION: number; - readonly REMOVAL: number; -} - -interface MutationObserver { - disconnect(): void; - observe(target: Node, options: MutationObserverInit): void; - takeRecords(): MutationRecord[]; -} - -declare var MutationObserver: { - prototype: MutationObserver; - new(callback: MutationCallback): MutationObserver; -} - -interface MutationRecord { - readonly addedNodes: NodeList; - readonly attributeName: string | null; - readonly attributeNamespace: string | null; - readonly nextSibling: Node | null; - readonly oldValue: string | null; - readonly previousSibling: Node | null; - readonly removedNodes: NodeList; - readonly target: Node; - readonly type: string; -} - -declare var MutationRecord: { - prototype: MutationRecord; - new(): MutationRecord; -} - -interface NamedNodeMap { - readonly length: number; - getNamedItem(name: string): Attr; - getNamedItemNS(namespaceURI: string | null, localName: string | null): Attr; - item(index: number): Attr; - removeNamedItem(name: string): Attr; - removeNamedItemNS(namespaceURI: string | null, localName: string | null): Attr; - setNamedItem(arg: Attr): Attr; - setNamedItemNS(arg: Attr): Attr; - [index: number]: Attr; -} - -declare var NamedNodeMap: { - prototype: NamedNodeMap; - new(): NamedNodeMap; -} - -interface NavigationCompletedEvent extends NavigationEvent { - readonly isSuccess: boolean; - readonly webErrorStatus: number; -} - -declare var NavigationCompletedEvent: { - prototype: NavigationCompletedEvent; - new(): NavigationCompletedEvent; -} - -interface NavigationEvent extends Event { - readonly uri: string; -} - -declare var NavigationEvent: { - prototype: NavigationEvent; - new(): NavigationEvent; -} - -interface NavigationEventWithReferrer extends NavigationEvent { - readonly referer: string; -} - -declare var NavigationEventWithReferrer: { - prototype: NavigationEventWithReferrer; - new(): NavigationEventWithReferrer; -} - -interface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, NavigatorGeolocation, MSNavigatorDoNotTrack, MSFileSaver, NavigatorUserMedia { - readonly appCodeName: string; - readonly cookieEnabled: boolean; - readonly language: string; - readonly maxTouchPoints: number; - readonly mimeTypes: MimeTypeArray; - readonly msManipulationViewsEnabled: boolean; - readonly msMaxTouchPoints: number; - readonly msPointerEnabled: boolean; - readonly plugins: PluginArray; - readonly pointerEnabled: boolean; - readonly webdriver: boolean; - readonly hardwareConcurrency: number; - getGamepads(): Gamepad[]; - javaEnabled(): boolean; - msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; - requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): PromiseLike; - vibrate(pattern: number | number[]): boolean; -} - -declare var Navigator: { - prototype: Navigator; - new(): Navigator; -} - -interface Node extends EventTarget { - readonly attributes: NamedNodeMap; - readonly baseURI: string | null; - readonly childNodes: NodeList; - readonly firstChild: Node | null; - readonly lastChild: Node | null; - readonly localName: string | null; - readonly namespaceURI: string | null; - readonly nextSibling: Node | null; - readonly nodeName: string; - readonly nodeType: number; - nodeValue: string | null; - readonly ownerDocument: Document; - readonly parentElement: HTMLElement | null; - readonly parentNode: Node | null; - readonly previousSibling: Node | null; - textContent: string | null; - appendChild(newChild: Node): Node; - cloneNode(deep?: boolean): Node; - compareDocumentPosition(other: Node): number; - contains(child: Node): boolean; - hasAttributes(): boolean; - hasChildNodes(): boolean; - insertBefore(newChild: Node, refChild: Node | null): Node; - isDefaultNamespace(namespaceURI: string | null): boolean; - isEqualNode(arg: Node): boolean; - isSameNode(other: Node): boolean; - lookupNamespaceURI(prefix: string | null): string | null; - lookupPrefix(namespaceURI: string | null): string | null; - normalize(): void; - removeChild(oldChild: Node): Node; - replaceChild(newChild: Node, oldChild: Node): Node; - readonly ATTRIBUTE_NODE: number; - readonly CDATA_SECTION_NODE: number; - readonly COMMENT_NODE: number; - readonly DOCUMENT_FRAGMENT_NODE: number; - readonly DOCUMENT_NODE: number; - readonly DOCUMENT_POSITION_CONTAINED_BY: number; - readonly DOCUMENT_POSITION_CONTAINS: number; - readonly DOCUMENT_POSITION_DISCONNECTED: number; - readonly DOCUMENT_POSITION_FOLLOWING: number; - readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - readonly DOCUMENT_POSITION_PRECEDING: number; - readonly DOCUMENT_TYPE_NODE: number; - readonly ELEMENT_NODE: number; - readonly ENTITY_NODE: number; - readonly ENTITY_REFERENCE_NODE: number; - readonly NOTATION_NODE: number; - readonly PROCESSING_INSTRUCTION_NODE: number; - readonly TEXT_NODE: number; -} - -declare var Node: { - prototype: Node; - new(): Node; - readonly ATTRIBUTE_NODE: number; - readonly CDATA_SECTION_NODE: number; - readonly COMMENT_NODE: number; - readonly DOCUMENT_FRAGMENT_NODE: number; - readonly DOCUMENT_NODE: number; - readonly DOCUMENT_POSITION_CONTAINED_BY: number; - readonly DOCUMENT_POSITION_CONTAINS: number; - readonly DOCUMENT_POSITION_DISCONNECTED: number; - readonly DOCUMENT_POSITION_FOLLOWING: number; - readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - readonly DOCUMENT_POSITION_PRECEDING: number; - readonly DOCUMENT_TYPE_NODE: number; - readonly ELEMENT_NODE: number; - readonly ENTITY_NODE: number; - readonly ENTITY_REFERENCE_NODE: number; - readonly NOTATION_NODE: number; - readonly PROCESSING_INSTRUCTION_NODE: number; - readonly TEXT_NODE: number; -} - -interface NodeFilter { - acceptNode(n: Node): number; -} - -declare var NodeFilter: { - readonly FILTER_ACCEPT: number; - readonly FILTER_REJECT: number; - readonly FILTER_SKIP: number; - readonly SHOW_ALL: number; - readonly SHOW_ATTRIBUTE: number; - readonly SHOW_CDATA_SECTION: number; - readonly SHOW_COMMENT: number; - readonly SHOW_DOCUMENT: number; - readonly SHOW_DOCUMENT_FRAGMENT: number; - readonly SHOW_DOCUMENT_TYPE: number; - readonly SHOW_ELEMENT: number; - readonly SHOW_ENTITY: number; - readonly SHOW_ENTITY_REFERENCE: number; - readonly SHOW_NOTATION: number; - readonly SHOW_PROCESSING_INSTRUCTION: number; - readonly SHOW_TEXT: number; -} - -interface NodeIterator { - readonly expandEntityReferences: boolean; - readonly filter: NodeFilter; - readonly root: Node; - readonly whatToShow: number; - detach(): void; - nextNode(): Node; - previousNode(): Node; -} - -declare var NodeIterator: { - prototype: NodeIterator; - new(): NodeIterator; -} - -interface NodeList { - readonly length: number; - item(index: number): Node; - [index: number]: Node; -} - -declare var NodeList: { - prototype: NodeList; - new(): NodeList; -} - -interface OES_element_index_uint { -} - -declare var OES_element_index_uint: { - prototype: OES_element_index_uint; - new(): OES_element_index_uint; -} - -interface OES_standard_derivatives { - readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} - -declare var OES_standard_derivatives: { - prototype: OES_standard_derivatives; - new(): OES_standard_derivatives; - readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} - -interface OES_texture_float { -} - -declare var OES_texture_float: { - prototype: OES_texture_float; - new(): OES_texture_float; -} - -interface OES_texture_float_linear { -} - -declare var OES_texture_float_linear: { - prototype: OES_texture_float_linear; - new(): OES_texture_float_linear; -} - -interface OfflineAudioCompletionEvent extends Event { - readonly renderedBuffer: AudioBuffer; -} - -declare var OfflineAudioCompletionEvent: { - prototype: OfflineAudioCompletionEvent; - new(): OfflineAudioCompletionEvent; -} - -interface OfflineAudioContextEventMap { - "complete": Event; -} - -interface OfflineAudioContext extends AudioContext { - oncomplete: (this: OfflineAudioContext, ev: Event) => any; - startRendering(): PromiseLike; - addEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var OfflineAudioContext: { - prototype: OfflineAudioContext; - new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext; -} - -interface OscillatorNodeEventMap { - "ended": MediaStreamErrorEvent; -} - -interface OscillatorNode extends AudioNode { - readonly detune: AudioParam; - readonly frequency: AudioParam; - onended: (this: OscillatorNode, ev: MediaStreamErrorEvent) => any; - type: string; - setPeriodicWave(periodicWave: PeriodicWave): void; - start(when?: number): void; - stop(when?: number): void; - addEventListener(type: K, listener: (this: OscillatorNode, ev: OscillatorNodeEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var OscillatorNode: { - prototype: OscillatorNode; - new(): OscillatorNode; -} - -interface OverflowEvent extends UIEvent { - readonly horizontalOverflow: boolean; - readonly orient: number; - readonly verticalOverflow: boolean; - readonly BOTH: number; - readonly HORIZONTAL: number; - readonly VERTICAL: number; -} - -declare var OverflowEvent: { - prototype: OverflowEvent; - new(): OverflowEvent; - readonly BOTH: number; - readonly HORIZONTAL: number; - readonly VERTICAL: number; -} - -interface PageTransitionEvent extends Event { - readonly persisted: boolean; -} - -declare var PageTransitionEvent: { - prototype: PageTransitionEvent; - new(): PageTransitionEvent; -} - -interface PannerNode extends AudioNode { - coneInnerAngle: number; - coneOuterAngle: number; - coneOuterGain: number; - distanceModel: string; - maxDistance: number; - panningModel: string; - refDistance: number; - rolloffFactor: number; - setOrientation(x: number, y: number, z: number): void; - setPosition(x: number, y: number, z: number): void; - setVelocity(x: number, y: number, z: number): void; -} - -declare var PannerNode: { - prototype: PannerNode; - new(): PannerNode; -} - -interface PerfWidgetExternal { - readonly activeNetworkRequestCount: number; - readonly averageFrameTime: number; - readonly averagePaintTime: number; - readonly extraInformationEnabled: boolean; - readonly independentRenderingEnabled: boolean; - readonly irDisablingContentString: string; - readonly irStatusAvailable: boolean; - readonly maxCpuSpeed: number; - readonly paintRequestsPerSecond: number; - readonly performanceCounter: number; - readonly performanceCounterFrequency: number; - addEventListener(eventType: string, callback: Function): void; - getMemoryUsage(): number; - getProcessCpuUsage(): number; - getRecentCpuUsage(last: number | null): any; - getRecentFrames(last: number | null): any; - getRecentMemoryUsage(last: number | null): any; - getRecentPaintRequests(last: number | null): any; - removeEventListener(eventType: string, callback: Function): void; - repositionWindow(x: number, y: number): void; - resizeWindow(width: number, height: number): void; -} - -declare var PerfWidgetExternal: { - prototype: PerfWidgetExternal; - new(): PerfWidgetExternal; -} - -interface Performance { - readonly navigation: PerformanceNavigation; - readonly timing: PerformanceTiming; - clearMarks(markName?: string): void; - clearMeasures(measureName?: string): void; - clearResourceTimings(): void; - getEntries(): any; - getEntriesByName(name: string, entryType?: string): any; - getEntriesByType(entryType: string): any; - getMarks(markName?: string): any; - getMeasures(measureName?: string): any; - mark(markName: string): void; - measure(measureName: string, startMarkName?: string, endMarkName?: string): void; - now(): number; - setResourceTimingBufferSize(maxSize: number): void; - toJSON(): any; -} - -declare var Performance: { - prototype: Performance; - new(): Performance; -} - -interface PerformanceEntry { - readonly duration: number; - readonly entryType: string; - readonly name: string; - readonly startTime: number; -} - -declare var PerformanceEntry: { - prototype: PerformanceEntry; - new(): PerformanceEntry; -} - -interface PerformanceMark extends PerformanceEntry { -} - -declare var PerformanceMark: { - prototype: PerformanceMark; - new(): PerformanceMark; -} - -interface PerformanceMeasure extends PerformanceEntry { -} - -declare var PerformanceMeasure: { - prototype: PerformanceMeasure; - new(): PerformanceMeasure; -} - -interface PerformanceNavigation { - readonly redirectCount: number; - readonly type: number; - toJSON(): any; - readonly TYPE_BACK_FORWARD: number; - readonly TYPE_NAVIGATE: number; - readonly TYPE_RELOAD: number; - readonly TYPE_RESERVED: number; -} - -declare var PerformanceNavigation: { - prototype: PerformanceNavigation; - new(): PerformanceNavigation; - readonly TYPE_BACK_FORWARD: number; - readonly TYPE_NAVIGATE: number; - readonly TYPE_RELOAD: number; - readonly TYPE_RESERVED: number; -} - -interface PerformanceNavigationTiming extends PerformanceEntry { - readonly connectEnd: number; - readonly connectStart: number; - readonly domComplete: number; - readonly domContentLoadedEventEnd: number; - readonly domContentLoadedEventStart: number; - readonly domInteractive: number; - readonly domLoading: number; - readonly domainLookupEnd: number; - readonly domainLookupStart: number; - readonly fetchStart: number; - readonly loadEventEnd: number; - readonly loadEventStart: number; - readonly navigationStart: number; - readonly redirectCount: number; - readonly redirectEnd: number; - readonly redirectStart: number; - readonly requestStart: number; - readonly responseEnd: number; - readonly responseStart: number; - readonly type: string; - readonly unloadEventEnd: number; - readonly unloadEventStart: number; -} - -declare var PerformanceNavigationTiming: { - prototype: PerformanceNavigationTiming; - new(): PerformanceNavigationTiming; -} - -interface PerformanceResourceTiming extends PerformanceEntry { - readonly connectEnd: number; - readonly connectStart: number; - readonly domainLookupEnd: number; - readonly domainLookupStart: number; - readonly fetchStart: number; - readonly initiatorType: string; - readonly redirectEnd: number; - readonly redirectStart: number; - readonly requestStart: number; - readonly responseEnd: number; - readonly responseStart: number; -} - -declare var PerformanceResourceTiming: { - prototype: PerformanceResourceTiming; - new(): PerformanceResourceTiming; -} - -interface PerformanceTiming { - readonly connectEnd: number; - readonly connectStart: number; - readonly domComplete: number; - readonly domContentLoadedEventEnd: number; - readonly domContentLoadedEventStart: number; - readonly domInteractive: number; - readonly domLoading: number; - readonly domainLookupEnd: number; - readonly domainLookupStart: number; - readonly fetchStart: number; - readonly loadEventEnd: number; - readonly loadEventStart: number; - readonly msFirstPaint: number; - readonly navigationStart: number; - readonly redirectEnd: number; - readonly redirectStart: number; - readonly requestStart: number; - readonly responseEnd: number; - readonly responseStart: number; - readonly unloadEventEnd: number; - readonly unloadEventStart: number; - readonly secureConnectionStart: number; - toJSON(): any; -} - -declare var PerformanceTiming: { - prototype: PerformanceTiming; - new(): PerformanceTiming; -} - -interface PeriodicWave { -} - -declare var PeriodicWave: { - prototype: PeriodicWave; - new(): PeriodicWave; -} - -interface PermissionRequest extends DeferredPermissionRequest { - readonly state: string; - defer(): void; -} - -declare var PermissionRequest: { - prototype: PermissionRequest; - new(): PermissionRequest; -} - -interface PermissionRequestedEvent extends Event { - readonly permissionRequest: PermissionRequest; -} - -declare var PermissionRequestedEvent: { - prototype: PermissionRequestedEvent; - new(): PermissionRequestedEvent; -} - -interface Plugin { - readonly description: string; - readonly filename: string; - readonly length: number; - readonly name: string; - readonly version: string; - item(index: number): MimeType; - namedItem(type: string): MimeType; - [index: number]: MimeType; -} - -declare var Plugin: { - prototype: Plugin; - new(): Plugin; -} - -interface PluginArray { - readonly length: number; - item(index: number): Plugin; - namedItem(name: string): Plugin; - refresh(reload?: boolean): void; - [index: number]: Plugin; -} - -declare var PluginArray: { - prototype: PluginArray; - new(): PluginArray; -} - -interface PointerEvent extends MouseEvent { - readonly currentPoint: any; - readonly height: number; - readonly hwTimestamp: number; - readonly intermediatePoints: any; - readonly isPrimary: boolean; - readonly pointerId: number; - readonly pointerType: any; - readonly pressure: number; - readonly rotation: number; - readonly tiltX: number; - readonly tiltY: number; - readonly width: number; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; -} - -declare var PointerEvent: { - prototype: PointerEvent; - new(typeArg: string, eventInitDict?: PointerEventInit): PointerEvent; -} - -interface PopStateEvent extends Event { - readonly state: any; - initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void; -} - -declare var PopStateEvent: { - prototype: PopStateEvent; - new(): PopStateEvent; -} - -interface Position { - readonly coords: Coordinates; - readonly timestamp: number; -} - -declare var Position: { - prototype: Position; - new(): Position; -} - -interface PositionError { - readonly code: number; - readonly message: string; - toString(): string; - readonly PERMISSION_DENIED: number; - readonly POSITION_UNAVAILABLE: number; - readonly TIMEOUT: number; -} - -declare var PositionError: { - prototype: PositionError; - new(): PositionError; - readonly PERMISSION_DENIED: number; - readonly POSITION_UNAVAILABLE: number; - readonly TIMEOUT: number; -} - -interface ProcessingInstruction extends CharacterData { - readonly target: string; -} - -declare var ProcessingInstruction: { - prototype: ProcessingInstruction; - new(): ProcessingInstruction; -} - -interface ProgressEvent extends Event { - readonly lengthComputable: boolean; - readonly loaded: number; - readonly total: number; - initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; -} - -declare var ProgressEvent: { - prototype: ProgressEvent; - new(type: string, eventInitDict?: ProgressEventInit): ProgressEvent; -} - -interface RTCDTMFToneChangeEvent extends Event { - readonly tone: string; -} - -declare var RTCDTMFToneChangeEvent: { - prototype: RTCDTMFToneChangeEvent; - new(type: string, eventInitDict: RTCDTMFToneChangeEventInit): RTCDTMFToneChangeEvent; -} - -interface RTCDtlsTransportEventMap { - "dtlsstatechange": RTCDtlsTransportStateChangedEvent; - "error": ErrorEvent; -} - -interface RTCDtlsTransport extends RTCStatsProvider { - ondtlsstatechange: ((this: RTCDtlsTransport, ev: RTCDtlsTransportStateChangedEvent) => any) | null; - onerror: ((this: RTCDtlsTransport, ev: ErrorEvent) => any) | null; - readonly state: string; - readonly transport: RTCIceTransport; - getLocalParameters(): RTCDtlsParameters; - getRemoteCertificates(): ArrayBuffer[]; - getRemoteParameters(): RTCDtlsParameters | null; - start(remoteParameters: RTCDtlsParameters): void; - stop(): void; - addEventListener(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCDtlsTransport: { - prototype: RTCDtlsTransport; - new(transport: RTCIceTransport): RTCDtlsTransport; -} - -interface RTCDtlsTransportStateChangedEvent extends Event { - readonly state: string; -} - -declare var RTCDtlsTransportStateChangedEvent: { - prototype: RTCDtlsTransportStateChangedEvent; - new(): RTCDtlsTransportStateChangedEvent; -} - -interface RTCDtmfSenderEventMap { - "tonechange": RTCDTMFToneChangeEvent; -} - -interface RTCDtmfSender extends EventTarget { - readonly canInsertDTMF: boolean; - readonly duration: number; - readonly interToneGap: number; - ontonechange: (this: RTCDtmfSender, ev: RTCDTMFToneChangeEvent) => any; - readonly sender: RTCRtpSender; - readonly toneBuffer: string; - insertDTMF(tones: string, duration?: number, interToneGap?: number): void; - addEventListener(type: K, listener: (this: RTCDtmfSender, ev: RTCDtmfSenderEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCDtmfSender: { - prototype: RTCDtmfSender; - new(sender: RTCRtpSender): RTCDtmfSender; -} - -interface RTCIceCandidatePairChangedEvent extends Event { - readonly pair: RTCIceCandidatePair; -} - -declare var RTCIceCandidatePairChangedEvent: { - prototype: RTCIceCandidatePairChangedEvent; - new(): RTCIceCandidatePairChangedEvent; -} - -interface RTCIceGathererEventMap { - "error": ErrorEvent; - "localcandidate": RTCIceGathererEvent; -} - -interface RTCIceGatherer extends RTCStatsProvider { - readonly component: string; - onerror: ((this: RTCIceGatherer, ev: ErrorEvent) => any) | null; - onlocalcandidate: ((this: RTCIceGatherer, ev: RTCIceGathererEvent) => any) | null; - createAssociatedGatherer(): RTCIceGatherer; - getLocalCandidates(): RTCIceCandidate[]; - getLocalParameters(): RTCIceParameters; - addEventListener(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCIceGatherer: { - prototype: RTCIceGatherer; - new(options: RTCIceGatherOptions): RTCIceGatherer; -} - -interface RTCIceGathererEvent extends Event { - readonly candidate: RTCIceCandidate | RTCIceCandidateComplete; -} - -declare var RTCIceGathererEvent: { - prototype: RTCIceGathererEvent; - new(): RTCIceGathererEvent; -} - -interface RTCIceTransportEventMap { - "candidatepairchange": RTCIceCandidatePairChangedEvent; - "icestatechange": RTCIceTransportStateChangedEvent; -} - -interface RTCIceTransport extends RTCStatsProvider { - readonly component: string; - readonly iceGatherer: RTCIceGatherer | null; - oncandidatepairchange: ((this: RTCIceTransport, ev: RTCIceCandidatePairChangedEvent) => any) | null; - onicestatechange: ((this: RTCIceTransport, ev: RTCIceTransportStateChangedEvent) => any) | null; - readonly role: string; - readonly state: string; - addRemoteCandidate(remoteCandidate: RTCIceCandidate | RTCIceCandidateComplete): void; - createAssociatedTransport(): RTCIceTransport; - getNominatedCandidatePair(): RTCIceCandidatePair | null; - getRemoteCandidates(): RTCIceCandidate[]; - getRemoteParameters(): RTCIceParameters | null; - setRemoteCandidates(remoteCandidates: RTCIceCandidate[]): void; - start(gatherer: RTCIceGatherer, remoteParameters: RTCIceParameters, role?: string): void; - stop(): void; - addEventListener(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCIceTransport: { - prototype: RTCIceTransport; - new(): RTCIceTransport; -} - -interface RTCIceTransportStateChangedEvent extends Event { - readonly state: string; -} - -declare var RTCIceTransportStateChangedEvent: { - prototype: RTCIceTransportStateChangedEvent; - new(): RTCIceTransportStateChangedEvent; -} - -interface RTCRtpReceiverEventMap { - "error": ErrorEvent; -} - -interface RTCRtpReceiver extends RTCStatsProvider { - onerror: ((this: RTCRtpReceiver, ev: ErrorEvent) => any) | null; - readonly rtcpTransport: RTCDtlsTransport; - readonly track: MediaStreamTrack | null; - readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport; - getContributingSources(): RTCRtpContributingSource[]; - receive(parameters: RTCRtpParameters): void; - requestSendCSRC(csrc: number): void; - setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void; - stop(): void; - addEventListener(type: K, listener: (this: RTCRtpReceiver, ev: RTCRtpReceiverEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCRtpReceiver: { - prototype: RTCRtpReceiver; - new(transport: RTCDtlsTransport | RTCSrtpSdesTransport, kind: string, rtcpTransport?: RTCDtlsTransport): RTCRtpReceiver; - getCapabilities(kind?: string): RTCRtpCapabilities; -} - -interface RTCRtpSenderEventMap { - "error": ErrorEvent; - "ssrcconflict": RTCSsrcConflictEvent; -} - -interface RTCRtpSender extends RTCStatsProvider { - onerror: ((this: RTCRtpSender, ev: ErrorEvent) => any) | null; - onssrcconflict: ((this: RTCRtpSender, ev: RTCSsrcConflictEvent) => any) | null; - readonly rtcpTransport: RTCDtlsTransport; - readonly track: MediaStreamTrack; - readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport; - send(parameters: RTCRtpParameters): void; - setTrack(track: MediaStreamTrack): void; - setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void; - stop(): void; - addEventListener(type: K, listener: (this: RTCRtpSender, ev: RTCRtpSenderEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCRtpSender: { - prototype: RTCRtpSender; - new(track: MediaStreamTrack, transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): RTCRtpSender; - getCapabilities(kind?: string): RTCRtpCapabilities; -} - -interface RTCSrtpSdesTransportEventMap { - "error": ErrorEvent; -} - -interface RTCSrtpSdesTransport extends EventTarget { - onerror: ((this: RTCSrtpSdesTransport, ev: ErrorEvent) => any) | null; - readonly transport: RTCIceTransport; - addEventListener(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCSrtpSdesTransport: { - prototype: RTCSrtpSdesTransport; - new(transport: RTCIceTransport, encryptParameters: RTCSrtpSdesParameters, decryptParameters: RTCSrtpSdesParameters): RTCSrtpSdesTransport; - getLocalParameters(): RTCSrtpSdesParameters[]; -} - -interface RTCSsrcConflictEvent extends Event { - readonly ssrc: number; -} - -declare var RTCSsrcConflictEvent: { - prototype: RTCSsrcConflictEvent; - new(): RTCSsrcConflictEvent; -} - -interface RTCStatsProvider extends EventTarget { - getStats(): PromiseLike; - msGetStats(): PromiseLike; -} - -declare var RTCStatsProvider: { - prototype: RTCStatsProvider; - new(): RTCStatsProvider; -} - -interface Range { - readonly collapsed: boolean; - readonly commonAncestorContainer: Node; - readonly endContainer: Node; - readonly endOffset: number; - readonly startContainer: Node; - readonly startOffset: number; - cloneContents(): DocumentFragment; - cloneRange(): Range; - collapse(toStart: boolean): void; - compareBoundaryPoints(how: number, sourceRange: Range): number; - createContextualFragment(fragment: string): DocumentFragment; - deleteContents(): void; - detach(): void; - expand(Unit: string): boolean; - extractContents(): DocumentFragment; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; - insertNode(newNode: Node): void; - selectNode(refNode: Node): void; - selectNodeContents(refNode: Node): void; - setEnd(refNode: Node, offset: number): void; - setEndAfter(refNode: Node): void; - setEndBefore(refNode: Node): void; - setStart(refNode: Node, offset: number): void; - setStartAfter(refNode: Node): void; - setStartBefore(refNode: Node): void; - surroundContents(newParent: Node): void; - toString(): string; - readonly END_TO_END: number; - readonly END_TO_START: number; - readonly START_TO_END: number; - readonly START_TO_START: number; -} - -declare var Range: { - prototype: Range; - new(): Range; - readonly END_TO_END: number; - readonly END_TO_START: number; - readonly START_TO_END: number; - readonly START_TO_START: number; -} - -interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { - readonly target: SVGAnimatedString; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGAElement: { - prototype: SVGAElement; - new(): SVGAElement; -} - -interface SVGAngle { - readonly unitType: number; - value: number; - valueAsString: string; - valueInSpecifiedUnits: number; - convertToSpecifiedUnits(unitType: number): void; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - readonly SVG_ANGLETYPE_DEG: number; - readonly SVG_ANGLETYPE_GRAD: number; - readonly SVG_ANGLETYPE_RAD: number; - readonly SVG_ANGLETYPE_UNKNOWN: number; - readonly SVG_ANGLETYPE_UNSPECIFIED: number; -} - -declare var SVGAngle: { - prototype: SVGAngle; - new(): SVGAngle; - readonly SVG_ANGLETYPE_DEG: number; - readonly SVG_ANGLETYPE_GRAD: number; - readonly SVG_ANGLETYPE_RAD: number; - readonly SVG_ANGLETYPE_UNKNOWN: number; - readonly SVG_ANGLETYPE_UNSPECIFIED: number; -} - -interface SVGAnimatedAngle { - readonly animVal: SVGAngle; - readonly baseVal: SVGAngle; -} - -declare var SVGAnimatedAngle: { - prototype: SVGAnimatedAngle; - new(): SVGAnimatedAngle; -} - -interface SVGAnimatedBoolean { - readonly animVal: boolean; - baseVal: boolean; -} - -declare var SVGAnimatedBoolean: { - prototype: SVGAnimatedBoolean; - new(): SVGAnimatedBoolean; -} - -interface SVGAnimatedEnumeration { - readonly animVal: number; - baseVal: number; -} - -declare var SVGAnimatedEnumeration: { - prototype: SVGAnimatedEnumeration; - new(): SVGAnimatedEnumeration; -} - -interface SVGAnimatedInteger { - readonly animVal: number; - baseVal: number; -} - -declare var SVGAnimatedInteger: { - prototype: SVGAnimatedInteger; - new(): SVGAnimatedInteger; -} - -interface SVGAnimatedLength { - readonly animVal: SVGLength; - readonly baseVal: SVGLength; -} - -declare var SVGAnimatedLength: { - prototype: SVGAnimatedLength; - new(): SVGAnimatedLength; -} - -interface SVGAnimatedLengthList { - readonly animVal: SVGLengthList; - readonly baseVal: SVGLengthList; -} - -declare var SVGAnimatedLengthList: { - prototype: SVGAnimatedLengthList; - new(): SVGAnimatedLengthList; -} - -interface SVGAnimatedNumber { - readonly animVal: number; - baseVal: number; -} - -declare var SVGAnimatedNumber: { - prototype: SVGAnimatedNumber; - new(): SVGAnimatedNumber; -} - -interface SVGAnimatedNumberList { - readonly animVal: SVGNumberList; - readonly baseVal: SVGNumberList; -} - -declare var SVGAnimatedNumberList: { - prototype: SVGAnimatedNumberList; - new(): SVGAnimatedNumberList; -} - -interface SVGAnimatedPreserveAspectRatio { - readonly animVal: SVGPreserveAspectRatio; - readonly baseVal: SVGPreserveAspectRatio; -} - -declare var SVGAnimatedPreserveAspectRatio: { - prototype: SVGAnimatedPreserveAspectRatio; - new(): SVGAnimatedPreserveAspectRatio; -} - -interface SVGAnimatedRect { - readonly animVal: SVGRect; - readonly baseVal: SVGRect; -} - -declare var SVGAnimatedRect: { - prototype: SVGAnimatedRect; - new(): SVGAnimatedRect; -} - -interface SVGAnimatedString { - readonly animVal: string; - baseVal: string; -} - -declare var SVGAnimatedString: { - prototype: SVGAnimatedString; - new(): SVGAnimatedString; -} - -interface SVGAnimatedTransformList { - readonly animVal: SVGTransformList; - readonly baseVal: SVGTransformList; -} - -declare var SVGAnimatedTransformList: { - prototype: SVGAnimatedTransformList; - new(): SVGAnimatedTransformList; -} - -interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly cx: SVGAnimatedLength; - readonly cy: SVGAnimatedLength; - readonly r: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGCircleElement: { - prototype: SVGCircleElement; - new(): SVGCircleElement; -} - -interface SVGClipPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes { - readonly clipPathUnits: SVGAnimatedEnumeration; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGClipPathElement: { - prototype: SVGClipPathElement; - new(): SVGClipPathElement; -} - -interface SVGComponentTransferFunctionElement extends SVGElement { - readonly amplitude: SVGAnimatedNumber; - readonly exponent: SVGAnimatedNumber; - readonly intercept: SVGAnimatedNumber; - readonly offset: SVGAnimatedNumber; - readonly slope: SVGAnimatedNumber; - readonly tableValues: SVGAnimatedNumberList; - readonly type: SVGAnimatedEnumeration; - readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGComponentTransferFunctionElement: { - prototype: SVGComponentTransferFunctionElement; - new(): SVGComponentTransferFunctionElement; - readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; -} - -interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGDefsElement: { - prototype: SVGDefsElement; - new(): SVGDefsElement; -} - -interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGDescElement: { - prototype: SVGDescElement; - new(): SVGDescElement; -} - -interface SVGElementEventMap extends ElementEventMap { - "click": MouseEvent; - "dblclick": MouseEvent; - "focusin": FocusEvent; - "focusout": FocusEvent; - "load": Event; - "mousedown": MouseEvent; - "mousemove": MouseEvent; - "mouseout": MouseEvent; - "mouseover": MouseEvent; - "mouseup": MouseEvent; -} - -interface SVGElement extends Element { - onclick: (this: SVGElement, ev: MouseEvent) => any; - ondblclick: (this: SVGElement, ev: MouseEvent) => any; - onfocusin: (this: SVGElement, ev: FocusEvent) => any; - onfocusout: (this: SVGElement, ev: FocusEvent) => any; - onload: (this: SVGElement, ev: Event) => any; - onmousedown: (this: SVGElement, ev: MouseEvent) => any; - onmousemove: (this: SVGElement, ev: MouseEvent) => any; - onmouseout: (this: SVGElement, ev: MouseEvent) => any; - onmouseover: (this: SVGElement, ev: MouseEvent) => any; - onmouseup: (this: SVGElement, ev: MouseEvent) => any; - readonly ownerSVGElement: SVGSVGElement; - readonly viewportElement: SVGElement; - xmlbase: string; - className: any; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGElement: { - prototype: SVGElement; - new(): SVGElement; -} - -interface SVGElementInstance extends EventTarget { - readonly childNodes: SVGElementInstanceList; - readonly correspondingElement: SVGElement; - readonly correspondingUseElement: SVGUseElement; - readonly firstChild: SVGElementInstance; - readonly lastChild: SVGElementInstance; - readonly nextSibling: SVGElementInstance; - readonly parentNode: SVGElementInstance; - readonly previousSibling: SVGElementInstance; -} - -declare var SVGElementInstance: { - prototype: SVGElementInstance; - new(): SVGElementInstance; -} - -interface SVGElementInstanceList { - readonly length: number; - item(index: number): SVGElementInstance; -} - -declare var SVGElementInstanceList: { - prototype: SVGElementInstanceList; - new(): SVGElementInstanceList; -} - -interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly cx: SVGAnimatedLength; - readonly cy: SVGAnimatedLength; - readonly rx: SVGAnimatedLength; - readonly ry: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGEllipseElement: { - prototype: SVGEllipseElement; - new(): SVGEllipseElement; -} - -interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly in2: SVGAnimatedString; - readonly mode: SVGAnimatedEnumeration; - readonly SVG_FEBLEND_MODE_COLOR: number; - readonly SVG_FEBLEND_MODE_COLOR_BURN: number; - readonly SVG_FEBLEND_MODE_COLOR_DODGE: number; - readonly SVG_FEBLEND_MODE_DARKEN: number; - readonly SVG_FEBLEND_MODE_DIFFERENCE: number; - readonly SVG_FEBLEND_MODE_EXCLUSION: number; - readonly SVG_FEBLEND_MODE_HARD_LIGHT: number; - readonly SVG_FEBLEND_MODE_HUE: number; - readonly SVG_FEBLEND_MODE_LIGHTEN: number; - readonly SVG_FEBLEND_MODE_LUMINOSITY: number; - readonly SVG_FEBLEND_MODE_MULTIPLY: number; - readonly SVG_FEBLEND_MODE_NORMAL: number; - readonly SVG_FEBLEND_MODE_OVERLAY: number; - readonly SVG_FEBLEND_MODE_SATURATION: number; - readonly SVG_FEBLEND_MODE_SCREEN: number; - readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number; - readonly SVG_FEBLEND_MODE_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEBlendElement: { - prototype: SVGFEBlendElement; - new(): SVGFEBlendElement; - readonly SVG_FEBLEND_MODE_COLOR: number; - readonly SVG_FEBLEND_MODE_COLOR_BURN: number; - readonly SVG_FEBLEND_MODE_COLOR_DODGE: number; - readonly SVG_FEBLEND_MODE_DARKEN: number; - readonly SVG_FEBLEND_MODE_DIFFERENCE: number; - readonly SVG_FEBLEND_MODE_EXCLUSION: number; - readonly SVG_FEBLEND_MODE_HARD_LIGHT: number; - readonly SVG_FEBLEND_MODE_HUE: number; - readonly SVG_FEBLEND_MODE_LIGHTEN: number; - readonly SVG_FEBLEND_MODE_LUMINOSITY: number; - readonly SVG_FEBLEND_MODE_MULTIPLY: number; - readonly SVG_FEBLEND_MODE_NORMAL: number; - readonly SVG_FEBLEND_MODE_OVERLAY: number; - readonly SVG_FEBLEND_MODE_SATURATION: number; - readonly SVG_FEBLEND_MODE_SCREEN: number; - readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number; - readonly SVG_FEBLEND_MODE_UNKNOWN: number; -} - -interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly type: SVGAnimatedEnumeration; - readonly values: SVGAnimatedNumberList; - readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; - readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number; - readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number; - readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEColorMatrixElement: { - prototype: SVGFEColorMatrixElement; - new(): SVGFEColorMatrixElement; - readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; - readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number; - readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number; - readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; -} - -interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEComponentTransferElement: { - prototype: SVGFEComponentTransferElement; - new(): SVGFEComponentTransferElement; -} - -interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly in2: SVGAnimatedString; - readonly k1: SVGAnimatedNumber; - readonly k2: SVGAnimatedNumber; - readonly k3: SVGAnimatedNumber; - readonly k4: SVGAnimatedNumber; - readonly operator: SVGAnimatedEnumeration; - readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number; - readonly SVG_FECOMPOSITE_OPERATOR_IN: number; - readonly SVG_FECOMPOSITE_OPERATOR_OUT: number; - readonly SVG_FECOMPOSITE_OPERATOR_OVER: number; - readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - readonly SVG_FECOMPOSITE_OPERATOR_XOR: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFECompositeElement: { - prototype: SVGFECompositeElement; - new(): SVGFECompositeElement; - readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number; - readonly SVG_FECOMPOSITE_OPERATOR_IN: number; - readonly SVG_FECOMPOSITE_OPERATOR_OUT: number; - readonly SVG_FECOMPOSITE_OPERATOR_OVER: number; - readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - readonly SVG_FECOMPOSITE_OPERATOR_XOR: number; -} - -interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly bias: SVGAnimatedNumber; - readonly divisor: SVGAnimatedNumber; - readonly edgeMode: SVGAnimatedEnumeration; - readonly in1: SVGAnimatedString; - readonly kernelMatrix: SVGAnimatedNumberList; - readonly kernelUnitLengthX: SVGAnimatedNumber; - readonly kernelUnitLengthY: SVGAnimatedNumber; - readonly orderX: SVGAnimatedInteger; - readonly orderY: SVGAnimatedInteger; - readonly preserveAlpha: SVGAnimatedBoolean; - readonly targetX: SVGAnimatedInteger; - readonly targetY: SVGAnimatedInteger; - readonly SVG_EDGEMODE_DUPLICATE: number; - readonly SVG_EDGEMODE_NONE: number; - readonly SVG_EDGEMODE_UNKNOWN: number; - readonly SVG_EDGEMODE_WRAP: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEConvolveMatrixElement: { - prototype: SVGFEConvolveMatrixElement; - new(): SVGFEConvolveMatrixElement; - readonly SVG_EDGEMODE_DUPLICATE: number; - readonly SVG_EDGEMODE_NONE: number; - readonly SVG_EDGEMODE_UNKNOWN: number; - readonly SVG_EDGEMODE_WRAP: number; -} - -interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly diffuseConstant: SVGAnimatedNumber; - readonly in1: SVGAnimatedString; - readonly kernelUnitLengthX: SVGAnimatedNumber; - readonly kernelUnitLengthY: SVGAnimatedNumber; - readonly surfaceScale: SVGAnimatedNumber; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEDiffuseLightingElement: { - prototype: SVGFEDiffuseLightingElement; - new(): SVGFEDiffuseLightingElement; -} - -interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly in2: SVGAnimatedString; - readonly scale: SVGAnimatedNumber; - readonly xChannelSelector: SVGAnimatedEnumeration; - readonly yChannelSelector: SVGAnimatedEnumeration; - readonly SVG_CHANNEL_A: number; - readonly SVG_CHANNEL_B: number; - readonly SVG_CHANNEL_G: number; - readonly SVG_CHANNEL_R: number; - readonly SVG_CHANNEL_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEDisplacementMapElement: { - prototype: SVGFEDisplacementMapElement; - new(): SVGFEDisplacementMapElement; - readonly SVG_CHANNEL_A: number; - readonly SVG_CHANNEL_B: number; - readonly SVG_CHANNEL_G: number; - readonly SVG_CHANNEL_R: number; - readonly SVG_CHANNEL_UNKNOWN: number; -} - -interface SVGFEDistantLightElement extends SVGElement { - readonly azimuth: SVGAnimatedNumber; - readonly elevation: SVGAnimatedNumber; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEDistantLightElement: { - prototype: SVGFEDistantLightElement; - new(): SVGFEDistantLightElement; -} - -interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEFloodElement: { - prototype: SVGFEFloodElement; - new(): SVGFEFloodElement; -} - -interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncAElement: { - prototype: SVGFEFuncAElement; - new(): SVGFEFuncAElement; -} - -interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncBElement: { - prototype: SVGFEFuncBElement; - new(): SVGFEFuncBElement; -} - -interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncGElement: { - prototype: SVGFEFuncGElement; - new(): SVGFEFuncGElement; -} - -interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncRElement: { - prototype: SVGFEFuncRElement; - new(): SVGFEFuncRElement; -} - -interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly stdDeviationX: SVGAnimatedNumber; - readonly stdDeviationY: SVGAnimatedNumber; - setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEGaussianBlurElement: { - prototype: SVGFEGaussianBlurElement; - new(): SVGFEGaussianBlurElement; -} - -interface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { - readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEImageElement: { - prototype: SVGFEImageElement; - new(): SVGFEImageElement; -} - -interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEMergeElement: { - prototype: SVGFEMergeElement; - new(): SVGFEMergeElement; -} - -interface SVGFEMergeNodeElement extends SVGElement { - readonly in1: SVGAnimatedString; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEMergeNodeElement: { - prototype: SVGFEMergeNodeElement; - new(): SVGFEMergeNodeElement; -} - -interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly operator: SVGAnimatedEnumeration; - readonly radiusX: SVGAnimatedNumber; - readonly radiusY: SVGAnimatedNumber; - readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number; - readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number; - readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEMorphologyElement: { - prototype: SVGFEMorphologyElement; - new(): SVGFEMorphologyElement; - readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number; - readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number; - readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; -} - -interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly dx: SVGAnimatedNumber; - readonly dy: SVGAnimatedNumber; - readonly in1: SVGAnimatedString; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEOffsetElement: { - prototype: SVGFEOffsetElement; - new(): SVGFEOffsetElement; -} - -interface SVGFEPointLightElement extends SVGElement { - readonly x: SVGAnimatedNumber; - readonly y: SVGAnimatedNumber; - readonly z: SVGAnimatedNumber; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEPointLightElement: { - prototype: SVGFEPointLightElement; - new(): SVGFEPointLightElement; -} - -interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly kernelUnitLengthX: SVGAnimatedNumber; - readonly kernelUnitLengthY: SVGAnimatedNumber; - readonly specularConstant: SVGAnimatedNumber; - readonly specularExponent: SVGAnimatedNumber; - readonly surfaceScale: SVGAnimatedNumber; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFESpecularLightingElement: { - prototype: SVGFESpecularLightingElement; - new(): SVGFESpecularLightingElement; -} - -interface SVGFESpotLightElement extends SVGElement { - readonly limitingConeAngle: SVGAnimatedNumber; - readonly pointsAtX: SVGAnimatedNumber; - readonly pointsAtY: SVGAnimatedNumber; - readonly pointsAtZ: SVGAnimatedNumber; - readonly specularExponent: SVGAnimatedNumber; - readonly x: SVGAnimatedNumber; - readonly y: SVGAnimatedNumber; - readonly z: SVGAnimatedNumber; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFESpotLightElement: { - prototype: SVGFESpotLightElement; - new(): SVGFESpotLightElement; -} - -interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFETileElement: { - prototype: SVGFETileElement; - new(): SVGFETileElement; -} - -interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly baseFrequencyX: SVGAnimatedNumber; - readonly baseFrequencyY: SVGAnimatedNumber; - readonly numOctaves: SVGAnimatedInteger; - readonly seed: SVGAnimatedNumber; - readonly stitchTiles: SVGAnimatedEnumeration; - readonly type: SVGAnimatedEnumeration; - readonly SVG_STITCHTYPE_NOSTITCH: number; - readonly SVG_STITCHTYPE_STITCH: number; - readonly SVG_STITCHTYPE_UNKNOWN: number; - readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - readonly SVG_TURBULENCE_TYPE_TURBULENCE: number; - readonly SVG_TURBULENCE_TYPE_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFETurbulenceElement: { - prototype: SVGFETurbulenceElement; - new(): SVGFETurbulenceElement; - readonly SVG_STITCHTYPE_NOSTITCH: number; - readonly SVG_STITCHTYPE_STITCH: number; - readonly SVG_STITCHTYPE_UNKNOWN: number; - readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - readonly SVG_TURBULENCE_TYPE_TURBULENCE: number; - readonly SVG_TURBULENCE_TYPE_UNKNOWN: number; -} - -interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { - readonly filterResX: SVGAnimatedInteger; - readonly filterResY: SVGAnimatedInteger; - readonly filterUnits: SVGAnimatedEnumeration; - readonly height: SVGAnimatedLength; - readonly primitiveUnits: SVGAnimatedEnumeration; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - setFilterRes(filterResX: number, filterResY: number): void; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFilterElement: { - prototype: SVGFilterElement; - new(): SVGFilterElement; -} - -interface SVGForeignObjectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly height: SVGAnimatedLength; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGForeignObjectElement: { - prototype: SVGForeignObjectElement; - new(): SVGForeignObjectElement; -} - -interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGGElement: { - prototype: SVGGElement; - new(): SVGGElement; -} - -interface SVGGradientElement extends SVGElement, SVGStylable, SVGExternalResourcesRequired, SVGURIReference, SVGUnitTypes { - readonly gradientTransform: SVGAnimatedTransformList; - readonly gradientUnits: SVGAnimatedEnumeration; - readonly spreadMethod: SVGAnimatedEnumeration; - readonly SVG_SPREADMETHOD_PAD: number; - readonly SVG_SPREADMETHOD_REFLECT: number; - readonly SVG_SPREADMETHOD_REPEAT: number; - readonly SVG_SPREADMETHOD_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGGradientElement: { - prototype: SVGGradientElement; - new(): SVGGradientElement; - readonly SVG_SPREADMETHOD_PAD: number; - readonly SVG_SPREADMETHOD_REFLECT: number; - readonly SVG_SPREADMETHOD_REPEAT: number; - readonly SVG_SPREADMETHOD_UNKNOWN: number; -} - -interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { - readonly height: SVGAnimatedLength; - readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGImageElement: { - prototype: SVGImageElement; - new(): SVGImageElement; -} - -interface SVGLength { - readonly unitType: number; - value: number; - valueAsString: string; - valueInSpecifiedUnits: number; - convertToSpecifiedUnits(unitType: number): void; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - readonly SVG_LENGTHTYPE_CM: number; - readonly SVG_LENGTHTYPE_EMS: number; - readonly SVG_LENGTHTYPE_EXS: number; - readonly SVG_LENGTHTYPE_IN: number; - readonly SVG_LENGTHTYPE_MM: number; - readonly SVG_LENGTHTYPE_NUMBER: number; - readonly SVG_LENGTHTYPE_PC: number; - readonly SVG_LENGTHTYPE_PERCENTAGE: number; - readonly SVG_LENGTHTYPE_PT: number; - readonly SVG_LENGTHTYPE_PX: number; - readonly SVG_LENGTHTYPE_UNKNOWN: number; -} - -declare var SVGLength: { - prototype: SVGLength; - new(): SVGLength; - readonly SVG_LENGTHTYPE_CM: number; - readonly SVG_LENGTHTYPE_EMS: number; - readonly SVG_LENGTHTYPE_EXS: number; - readonly SVG_LENGTHTYPE_IN: number; - readonly SVG_LENGTHTYPE_MM: number; - readonly SVG_LENGTHTYPE_NUMBER: number; - readonly SVG_LENGTHTYPE_PC: number; - readonly SVG_LENGTHTYPE_PERCENTAGE: number; - readonly SVG_LENGTHTYPE_PT: number; - readonly SVG_LENGTHTYPE_PX: number; - readonly SVG_LENGTHTYPE_UNKNOWN: number; -} - -interface SVGLengthList { - readonly numberOfItems: number; - appendItem(newItem: SVGLength): SVGLength; - clear(): void; - getItem(index: number): SVGLength; - initialize(newItem: SVGLength): SVGLength; - insertItemBefore(newItem: SVGLength, index: number): SVGLength; - removeItem(index: number): SVGLength; - replaceItem(newItem: SVGLength, index: number): SVGLength; -} - -declare var SVGLengthList: { - prototype: SVGLengthList; - new(): SVGLengthList; -} - -interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly x1: SVGAnimatedLength; - readonly x2: SVGAnimatedLength; - readonly y1: SVGAnimatedLength; - readonly y2: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGLineElement: { - prototype: SVGLineElement; - new(): SVGLineElement; -} - -interface SVGLinearGradientElement extends SVGGradientElement { - readonly x1: SVGAnimatedLength; - readonly x2: SVGAnimatedLength; - readonly y1: SVGAnimatedLength; - readonly y2: SVGAnimatedLength; -} - -declare var SVGLinearGradientElement: { - prototype: SVGLinearGradientElement; - new(): SVGLinearGradientElement; -} - -interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox { - readonly markerHeight: SVGAnimatedLength; - readonly markerUnits: SVGAnimatedEnumeration; - readonly markerWidth: SVGAnimatedLength; - readonly orientAngle: SVGAnimatedAngle; - readonly orientType: SVGAnimatedEnumeration; - readonly refX: SVGAnimatedLength; - readonly refY: SVGAnimatedLength; - setOrientToAngle(angle: SVGAngle): void; - setOrientToAuto(): void; - readonly SVG_MARKERUNITS_STROKEWIDTH: number; - readonly SVG_MARKERUNITS_UNKNOWN: number; - readonly SVG_MARKERUNITS_USERSPACEONUSE: number; - readonly SVG_MARKER_ORIENT_ANGLE: number; - readonly SVG_MARKER_ORIENT_AUTO: number; - readonly SVG_MARKER_ORIENT_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGMarkerElement: { - prototype: SVGMarkerElement; - new(): SVGMarkerElement; - readonly SVG_MARKERUNITS_STROKEWIDTH: number; - readonly SVG_MARKERUNITS_UNKNOWN: number; - readonly SVG_MARKERUNITS_USERSPACEONUSE: number; - readonly SVG_MARKER_ORIENT_ANGLE: number; - readonly SVG_MARKER_ORIENT_AUTO: number; - readonly SVG_MARKER_ORIENT_UNKNOWN: number; -} - -interface SVGMaskElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes { - readonly height: SVGAnimatedLength; - readonly maskContentUnits: SVGAnimatedEnumeration; - readonly maskUnits: SVGAnimatedEnumeration; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGMaskElement: { - prototype: SVGMaskElement; - new(): SVGMaskElement; -} - -interface SVGMatrix { - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; - flipX(): SVGMatrix; - flipY(): SVGMatrix; - inverse(): SVGMatrix; - multiply(secondMatrix: SVGMatrix): SVGMatrix; - rotate(angle: number): SVGMatrix; - rotateFromVector(x: number, y: number): SVGMatrix; - scale(scaleFactor: number): SVGMatrix; - scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; - skewX(angle: number): SVGMatrix; - skewY(angle: number): SVGMatrix; - translate(x: number, y: number): SVGMatrix; -} - -declare var SVGMatrix: { - prototype: SVGMatrix; - new(): SVGMatrix; -} - -interface SVGMetadataElement extends SVGElement { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGMetadataElement: { - prototype: SVGMetadataElement; - new(): SVGMetadataElement; -} - -interface SVGNumber { - value: number; -} - -declare var SVGNumber: { - prototype: SVGNumber; - new(): SVGNumber; -} - -interface SVGNumberList { - readonly numberOfItems: number; - appendItem(newItem: SVGNumber): SVGNumber; - clear(): void; - getItem(index: number): SVGNumber; - initialize(newItem: SVGNumber): SVGNumber; - insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; - removeItem(index: number): SVGNumber; - replaceItem(newItem: SVGNumber, index: number): SVGNumber; -} - -declare var SVGNumberList: { - prototype: SVGNumberList; - new(): SVGNumberList; -} - -interface SVGPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPathData { - createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; - createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; - createSVGPathSegClosePath(): SVGPathSegClosePath; - createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; - createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; - createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; - createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; - createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; - createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; - createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; - createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; - createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; - createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; - createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; - createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; - createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; - createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; - createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; - createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; - getPathSegAtLength(distance: number): number; - getPointAtLength(distance: number): SVGPoint; - getTotalLength(): number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPathElement: { - prototype: SVGPathElement; - new(): SVGPathElement; -} - -interface SVGPathSeg { - readonly pathSegType: number; - readonly pathSegTypeAsLetter: string; - readonly PATHSEG_ARC_ABS: number; - readonly PATHSEG_ARC_REL: number; - readonly PATHSEG_CLOSEPATH: number; - readonly PATHSEG_CURVETO_CUBIC_ABS: number; - readonly PATHSEG_CURVETO_CUBIC_REL: number; - readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - readonly PATHSEG_CURVETO_QUADRATIC_ABS: number; - readonly PATHSEG_CURVETO_QUADRATIC_REL: number; - readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; - readonly PATHSEG_LINETO_ABS: number; - readonly PATHSEG_LINETO_HORIZONTAL_ABS: number; - readonly PATHSEG_LINETO_HORIZONTAL_REL: number; - readonly PATHSEG_LINETO_REL: number; - readonly PATHSEG_LINETO_VERTICAL_ABS: number; - readonly PATHSEG_LINETO_VERTICAL_REL: number; - readonly PATHSEG_MOVETO_ABS: number; - readonly PATHSEG_MOVETO_REL: number; - readonly PATHSEG_UNKNOWN: number; -} - -declare var SVGPathSeg: { - prototype: SVGPathSeg; - new(): SVGPathSeg; - readonly PATHSEG_ARC_ABS: number; - readonly PATHSEG_ARC_REL: number; - readonly PATHSEG_CLOSEPATH: number; - readonly PATHSEG_CURVETO_CUBIC_ABS: number; - readonly PATHSEG_CURVETO_CUBIC_REL: number; - readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - readonly PATHSEG_CURVETO_QUADRATIC_ABS: number; - readonly PATHSEG_CURVETO_QUADRATIC_REL: number; - readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; - readonly PATHSEG_LINETO_ABS: number; - readonly PATHSEG_LINETO_HORIZONTAL_ABS: number; - readonly PATHSEG_LINETO_HORIZONTAL_REL: number; - readonly PATHSEG_LINETO_REL: number; - readonly PATHSEG_LINETO_VERTICAL_ABS: number; - readonly PATHSEG_LINETO_VERTICAL_REL: number; - readonly PATHSEG_MOVETO_ABS: number; - readonly PATHSEG_MOVETO_REL: number; - readonly PATHSEG_UNKNOWN: number; -} - -interface SVGPathSegArcAbs extends SVGPathSeg { - angle: number; - largeArcFlag: boolean; - r1: number; - r2: number; - sweepFlag: boolean; - x: number; - y: number; -} - -declare var SVGPathSegArcAbs: { - prototype: SVGPathSegArcAbs; - new(): SVGPathSegArcAbs; -} - -interface SVGPathSegArcRel extends SVGPathSeg { - angle: number; - largeArcFlag: boolean; - r1: number; - r2: number; - sweepFlag: boolean; - x: number; - y: number; -} - -declare var SVGPathSegArcRel: { - prototype: SVGPathSegArcRel; - new(): SVGPathSegArcRel; -} - -interface SVGPathSegClosePath extends SVGPathSeg { -} - -declare var SVGPathSegClosePath: { - prototype: SVGPathSegClosePath; - new(): SVGPathSegClosePath; -} - -interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { - x: number; - x1: number; - x2: number; - y: number; - y1: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicAbs: { - prototype: SVGPathSegCurvetoCubicAbs; - new(): SVGPathSegCurvetoCubicAbs; -} - -interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { - x: number; - x1: number; - x2: number; - y: number; - y1: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicRel: { - prototype: SVGPathSegCurvetoCubicRel; - new(): SVGPathSegCurvetoCubicRel; -} - -interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { - x: number; - x2: number; - y: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicSmoothAbs: { - prototype: SVGPathSegCurvetoCubicSmoothAbs; - new(): SVGPathSegCurvetoCubicSmoothAbs; -} - -interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { - x: number; - x2: number; - y: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicSmoothRel: { - prototype: SVGPathSegCurvetoCubicSmoothRel; - new(): SVGPathSegCurvetoCubicSmoothRel; -} - -interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { - x: number; - x1: number; - y: number; - y1: number; -} - -declare var SVGPathSegCurvetoQuadraticAbs: { - prototype: SVGPathSegCurvetoQuadraticAbs; - new(): SVGPathSegCurvetoQuadraticAbs; -} - -interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { - x: number; - x1: number; - y: number; - y1: number; -} - -declare var SVGPathSegCurvetoQuadraticRel: { - prototype: SVGPathSegCurvetoQuadraticRel; - new(): SVGPathSegCurvetoQuadraticRel; -} - -interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegCurvetoQuadraticSmoothAbs: { - prototype: SVGPathSegCurvetoQuadraticSmoothAbs; - new(): SVGPathSegCurvetoQuadraticSmoothAbs; -} - -interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegCurvetoQuadraticSmoothRel: { - prototype: SVGPathSegCurvetoQuadraticSmoothRel; - new(): SVGPathSegCurvetoQuadraticSmoothRel; -} - -interface SVGPathSegLinetoAbs extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegLinetoAbs: { - prototype: SVGPathSegLinetoAbs; - new(): SVGPathSegLinetoAbs; -} - -interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { - x: number; -} - -declare var SVGPathSegLinetoHorizontalAbs: { - prototype: SVGPathSegLinetoHorizontalAbs; - new(): SVGPathSegLinetoHorizontalAbs; -} - -interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { - x: number; -} - -declare var SVGPathSegLinetoHorizontalRel: { - prototype: SVGPathSegLinetoHorizontalRel; - new(): SVGPathSegLinetoHorizontalRel; -} - -interface SVGPathSegLinetoRel extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegLinetoRel: { - prototype: SVGPathSegLinetoRel; - new(): SVGPathSegLinetoRel; -} - -interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { - y: number; -} - -declare var SVGPathSegLinetoVerticalAbs: { - prototype: SVGPathSegLinetoVerticalAbs; - new(): SVGPathSegLinetoVerticalAbs; -} - -interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { - y: number; -} - -declare var SVGPathSegLinetoVerticalRel: { - prototype: SVGPathSegLinetoVerticalRel; - new(): SVGPathSegLinetoVerticalRel; -} - -interface SVGPathSegList { - readonly numberOfItems: number; - appendItem(newItem: SVGPathSeg): SVGPathSeg; - clear(): void; - getItem(index: number): SVGPathSeg; - initialize(newItem: SVGPathSeg): SVGPathSeg; - insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; - removeItem(index: number): SVGPathSeg; - replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; -} - -declare var SVGPathSegList: { - prototype: SVGPathSegList; - new(): SVGPathSegList; -} - -interface SVGPathSegMovetoAbs extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegMovetoAbs: { - prototype: SVGPathSegMovetoAbs; - new(): SVGPathSegMovetoAbs; -} - -interface SVGPathSegMovetoRel extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegMovetoRel: { - prototype: SVGPathSegMovetoRel; - new(): SVGPathSegMovetoRel; -} - -interface SVGPatternElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGURIReference, SVGUnitTypes { - readonly height: SVGAnimatedLength; - readonly patternContentUnits: SVGAnimatedEnumeration; - readonly patternTransform: SVGAnimatedTransformList; - readonly patternUnits: SVGAnimatedEnumeration; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPatternElement: { - prototype: SVGPatternElement; - new(): SVGPatternElement; -} - -interface SVGPoint { - x: number; - y: number; - matrixTransform(matrix: SVGMatrix): SVGPoint; -} - -declare var SVGPoint: { - prototype: SVGPoint; - new(): SVGPoint; -} - -interface SVGPointList { - readonly numberOfItems: number; - appendItem(newItem: SVGPoint): SVGPoint; - clear(): void; - getItem(index: number): SVGPoint; - initialize(newItem: SVGPoint): SVGPoint; - insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; - removeItem(index: number): SVGPoint; - replaceItem(newItem: SVGPoint, index: number): SVGPoint; -} - -declare var SVGPointList: { - prototype: SVGPointList; - new(): SVGPointList; -} - -interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPolygonElement: { - prototype: SVGPolygonElement; - new(): SVGPolygonElement; -} - -interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPolylineElement: { - prototype: SVGPolylineElement; - new(): SVGPolylineElement; -} - -interface SVGPreserveAspectRatio { - align: number; - meetOrSlice: number; - readonly SVG_MEETORSLICE_MEET: number; - readonly SVG_MEETORSLICE_SLICE: number; - readonly SVG_MEETORSLICE_UNKNOWN: number; - readonly SVG_PRESERVEASPECTRATIO_NONE: number; - readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number; -} - -declare var SVGPreserveAspectRatio: { - prototype: SVGPreserveAspectRatio; - new(): SVGPreserveAspectRatio; - readonly SVG_MEETORSLICE_MEET: number; - readonly SVG_MEETORSLICE_SLICE: number; - readonly SVG_MEETORSLICE_UNKNOWN: number; - readonly SVG_PRESERVEASPECTRATIO_NONE: number; - readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number; -} - -interface SVGRadialGradientElement extends SVGGradientElement { - readonly cx: SVGAnimatedLength; - readonly cy: SVGAnimatedLength; - readonly fx: SVGAnimatedLength; - readonly fy: SVGAnimatedLength; - readonly r: SVGAnimatedLength; -} - -declare var SVGRadialGradientElement: { - prototype: SVGRadialGradientElement; - new(): SVGRadialGradientElement; -} - -interface SVGRect { - height: number; - width: number; - x: number; - y: number; -} - -declare var SVGRect: { - prototype: SVGRect; - new(): SVGRect; -} - -interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly height: SVGAnimatedLength; - readonly rx: SVGAnimatedLength; - readonly ry: SVGAnimatedLength; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGRectElement: { - prototype: SVGRectElement; - new(): SVGRectElement; -} - -interface SVGSVGElementEventMap extends SVGElementEventMap { - "SVGAbort": Event; - "SVGError": Event; - "resize": UIEvent; - "scroll": UIEvent; - "SVGUnload": Event; - "SVGZoom": SVGZoomEvent; -} - -interface SVGSVGElement extends SVGElement, DocumentEvent, SVGLocatable, SVGTests, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan { - contentScriptType: string; - contentStyleType: string; - currentScale: number; - readonly currentTranslate: SVGPoint; - readonly height: SVGAnimatedLength; - onabort: (this: SVGSVGElement, ev: Event) => any; - onerror: (this: SVGSVGElement, ev: Event) => any; - onresize: (this: SVGSVGElement, ev: UIEvent) => any; - onscroll: (this: SVGSVGElement, ev: UIEvent) => any; - onunload: (this: SVGSVGElement, ev: Event) => any; - onzoom: (this: SVGSVGElement, ev: SVGZoomEvent) => any; - readonly pixelUnitToMillimeterX: number; - readonly pixelUnitToMillimeterY: number; - readonly screenPixelToMillimeterX: number; - readonly screenPixelToMillimeterY: number; - readonly viewport: SVGRect; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - checkEnclosure(element: SVGElement, rect: SVGRect): boolean; - checkIntersection(element: SVGElement, rect: SVGRect): boolean; - createSVGAngle(): SVGAngle; - createSVGLength(): SVGLength; - createSVGMatrix(): SVGMatrix; - createSVGNumber(): SVGNumber; - createSVGPoint(): SVGPoint; - createSVGRect(): SVGRect; - createSVGTransform(): SVGTransform; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; - deselectAll(): void; - forceRedraw(): void; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - getCurrentTime(): number; - getElementById(elementId: string): Element; - getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeListOf; - getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeListOf; - pauseAnimations(): void; - setCurrentTime(seconds: number): void; - suspendRedraw(maxWaitMilliseconds: number): number; - unpauseAnimations(): void; - unsuspendRedraw(suspendHandleID: number): void; - unsuspendRedrawAll(): void; - addEventListener(type: K, listener: (this: SVGSVGElement, ev: SVGSVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGSVGElement: { - prototype: SVGSVGElement; - new(): SVGSVGElement; -} - -interface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference { - type: string; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGScriptElement: { - prototype: SVGScriptElement; - new(): SVGScriptElement; -} - -interface SVGStopElement extends SVGElement, SVGStylable { - readonly offset: SVGAnimatedNumber; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGStopElement: { - prototype: SVGStopElement; - new(): SVGStopElement; -} - -interface SVGStringList { - readonly numberOfItems: number; - appendItem(newItem: string): string; - clear(): void; - getItem(index: number): string; - initialize(newItem: string): string; - insertItemBefore(newItem: string, index: number): string; - removeItem(index: number): string; - replaceItem(newItem: string, index: number): string; -} - -declare var SVGStringList: { - prototype: SVGStringList; - new(): SVGStringList; -} - -interface SVGStyleElement extends SVGElement, SVGLangSpace { - disabled: boolean; - media: string; - title: string; - type: string; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGStyleElement: { - prototype: SVGStyleElement; - new(): SVGStyleElement; -} - -interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGSwitchElement: { - prototype: SVGSwitchElement; - new(): SVGSwitchElement; -} - -interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGSymbolElement: { - prototype: SVGSymbolElement; - new(): SVGSymbolElement; -} - -interface SVGTSpanElement extends SVGTextPositioningElement { -} - -declare var SVGTSpanElement: { - prototype: SVGTSpanElement; - new(): SVGTSpanElement; -} - -interface SVGTextContentElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly lengthAdjust: SVGAnimatedEnumeration; - readonly textLength: SVGAnimatedLength; - getCharNumAtPosition(point: SVGPoint): number; - getComputedTextLength(): number; - getEndPositionOfChar(charnum: number): SVGPoint; - getExtentOfChar(charnum: number): SVGRect; - getNumberOfChars(): number; - getRotationOfChar(charnum: number): number; - getStartPositionOfChar(charnum: number): SVGPoint; - getSubStringLength(charnum: number, nchars: number): number; - selectSubString(charnum: number, nchars: number): void; - readonly LENGTHADJUST_SPACING: number; - readonly LENGTHADJUST_SPACINGANDGLYPHS: number; - readonly LENGTHADJUST_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGTextContentElement: { - prototype: SVGTextContentElement; - new(): SVGTextContentElement; - readonly LENGTHADJUST_SPACING: number; - readonly LENGTHADJUST_SPACINGANDGLYPHS: number; - readonly LENGTHADJUST_UNKNOWN: number; -} - -interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable { -} - -declare var SVGTextElement: { - prototype: SVGTextElement; - new(): SVGTextElement; -} - -interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { - readonly method: SVGAnimatedEnumeration; - readonly spacing: SVGAnimatedEnumeration; - readonly startOffset: SVGAnimatedLength; - readonly TEXTPATH_METHODTYPE_ALIGN: number; - readonly TEXTPATH_METHODTYPE_STRETCH: number; - readonly TEXTPATH_METHODTYPE_UNKNOWN: number; - readonly TEXTPATH_SPACINGTYPE_AUTO: number; - readonly TEXTPATH_SPACINGTYPE_EXACT: number; - readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number; -} - -declare var SVGTextPathElement: { - prototype: SVGTextPathElement; - new(): SVGTextPathElement; - readonly TEXTPATH_METHODTYPE_ALIGN: number; - readonly TEXTPATH_METHODTYPE_STRETCH: number; - readonly TEXTPATH_METHODTYPE_UNKNOWN: number; - readonly TEXTPATH_SPACINGTYPE_AUTO: number; - readonly TEXTPATH_SPACINGTYPE_EXACT: number; - readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number; -} - -interface SVGTextPositioningElement extends SVGTextContentElement { - readonly dx: SVGAnimatedLengthList; - readonly dy: SVGAnimatedLengthList; - readonly rotate: SVGAnimatedNumberList; - readonly x: SVGAnimatedLengthList; - readonly y: SVGAnimatedLengthList; -} - -declare var SVGTextPositioningElement: { - prototype: SVGTextPositioningElement; - new(): SVGTextPositioningElement; -} - -interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGTitleElement: { - prototype: SVGTitleElement; - new(): SVGTitleElement; -} - -interface SVGTransform { - readonly angle: number; - readonly matrix: SVGMatrix; - readonly type: number; - setMatrix(matrix: SVGMatrix): void; - setRotate(angle: number, cx: number, cy: number): void; - setScale(sx: number, sy: number): void; - setSkewX(angle: number): void; - setSkewY(angle: number): void; - setTranslate(tx: number, ty: number): void; - readonly SVG_TRANSFORM_MATRIX: number; - readonly SVG_TRANSFORM_ROTATE: number; - readonly SVG_TRANSFORM_SCALE: number; - readonly SVG_TRANSFORM_SKEWX: number; - readonly SVG_TRANSFORM_SKEWY: number; - readonly SVG_TRANSFORM_TRANSLATE: number; - readonly SVG_TRANSFORM_UNKNOWN: number; -} - -declare var SVGTransform: { - prototype: SVGTransform; - new(): SVGTransform; - readonly SVG_TRANSFORM_MATRIX: number; - readonly SVG_TRANSFORM_ROTATE: number; - readonly SVG_TRANSFORM_SCALE: number; - readonly SVG_TRANSFORM_SKEWX: number; - readonly SVG_TRANSFORM_SKEWY: number; - readonly SVG_TRANSFORM_TRANSLATE: number; - readonly SVG_TRANSFORM_UNKNOWN: number; -} - -interface SVGTransformList { - readonly numberOfItems: number; - appendItem(newItem: SVGTransform): SVGTransform; - clear(): void; - consolidate(): SVGTransform; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; - getItem(index: number): SVGTransform; - initialize(newItem: SVGTransform): SVGTransform; - insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; - removeItem(index: number): SVGTransform; - replaceItem(newItem: SVGTransform, index: number): SVGTransform; -} - -declare var SVGTransformList: { - prototype: SVGTransformList; - new(): SVGTransformList; -} - -interface SVGUnitTypes { - readonly SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; - readonly SVG_UNIT_TYPE_UNKNOWN: number; - readonly SVG_UNIT_TYPE_USERSPACEONUSE: number; -} -declare var SVGUnitTypes: SVGUnitTypes; - -interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { - readonly animatedInstanceRoot: SVGElementInstance; - readonly height: SVGAnimatedLength; - readonly instanceRoot: SVGElementInstance; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGUseElement: { - prototype: SVGUseElement; - new(): SVGUseElement; -} - -interface SVGViewElement extends SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan { - readonly viewTarget: SVGStringList; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGViewElement: { - prototype: SVGViewElement; - new(): SVGViewElement; -} - -interface SVGZoomAndPan { - readonly zoomAndPan: number; -} - -declare var SVGZoomAndPan: { - readonly SVG_ZOOMANDPAN_DISABLE: number; - readonly SVG_ZOOMANDPAN_MAGNIFY: number; - readonly SVG_ZOOMANDPAN_UNKNOWN: number; -} - -interface SVGZoomEvent extends UIEvent { - readonly newScale: number; - readonly newTranslate: SVGPoint; - readonly previousScale: number; - readonly previousTranslate: SVGPoint; - readonly zoomRectScreen: SVGRect; -} - -declare var SVGZoomEvent: { - prototype: SVGZoomEvent; - new(): SVGZoomEvent; -} - -interface ScreenEventMap { - "MSOrientationChange": Event; -} - -interface Screen extends EventTarget { - readonly availHeight: number; - readonly availWidth: number; - bufferDepth: number; - readonly colorDepth: number; - readonly deviceXDPI: number; - readonly deviceYDPI: number; - readonly fontSmoothingEnabled: boolean; - readonly height: number; - readonly logicalXDPI: number; - readonly logicalYDPI: number; - readonly msOrientation: string; - onmsorientationchange: (this: Screen, ev: Event) => any; - readonly pixelDepth: number; - readonly systemXDPI: number; - readonly systemYDPI: number; - readonly width: number; - msLockOrientation(orientations: string | string[]): boolean; - msUnlockOrientation(): void; - addEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Screen: { - prototype: Screen; - new(): Screen; -} - -interface ScriptNotifyEvent extends Event { - readonly callingUri: string; - readonly value: string; -} - -declare var ScriptNotifyEvent: { - prototype: ScriptNotifyEvent; - new(): ScriptNotifyEvent; -} - -interface ScriptProcessorNodeEventMap { - "audioprocess": AudioProcessingEvent; -} - -interface ScriptProcessorNode extends AudioNode { - readonly bufferSize: number; - onaudioprocess: (this: ScriptProcessorNode, ev: AudioProcessingEvent) => any; - addEventListener(type: K, listener: (this: ScriptProcessorNode, ev: ScriptProcessorNodeEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var ScriptProcessorNode: { - prototype: ScriptProcessorNode; - new(): ScriptProcessorNode; -} - -interface Selection { - readonly anchorNode: Node; - readonly anchorOffset: number; - readonly focusNode: Node; - readonly focusOffset: number; - readonly isCollapsed: boolean; - readonly rangeCount: number; - readonly type: string; - addRange(range: Range): void; - collapse(parentNode: Node, offset: number): void; - collapseToEnd(): void; - collapseToStart(): void; - containsNode(node: Node, partlyContained: boolean): boolean; - deleteFromDocument(): void; - empty(): void; - extend(newNode: Node, offset: number): void; - getRangeAt(index: number): Range; - removeAllRanges(): void; - removeRange(range: Range): void; - selectAllChildren(parentNode: Node): void; - setBaseAndExtent(baseNode: Node, baseOffset: number, extentNode: Node, extentOffset: number): void; - toString(): string; -} - -declare var Selection: { - prototype: Selection; - new(): Selection; -} - -interface SourceBuffer extends EventTarget { - appendWindowEnd: number; - appendWindowStart: number; - readonly audioTracks: AudioTrackList; - readonly buffered: TimeRanges; - mode: string; - timestampOffset: number; - readonly updating: boolean; - readonly videoTracks: VideoTrackList; - abort(): void; - appendBuffer(data: ArrayBuffer | ArrayBufferView): void; - appendStream(stream: MSStream, maxSize?: number): void; - remove(start: number, end: number): void; -} - -declare var SourceBuffer: { - prototype: SourceBuffer; - new(): SourceBuffer; -} - -interface SourceBufferList extends EventTarget { - readonly length: number; - item(index: number): SourceBuffer; - [index: number]: SourceBuffer; -} - -declare var SourceBufferList: { - prototype: SourceBufferList; - new(): SourceBufferList; -} - -interface StereoPannerNode extends AudioNode { - readonly pan: AudioParam; -} - -declare var StereoPannerNode: { - prototype: StereoPannerNode; - new(): StereoPannerNode; -} - -interface Storage { - readonly length: number; - clear(): void; - getItem(key: string): string | null; - key(index: number): string | null; - removeItem(key: string): void; - setItem(key: string, data: string): void; - [key: string]: any; - [index: number]: string; -} - -declare var Storage: { - prototype: Storage; - new(): Storage; -} - -interface StorageEvent extends Event { - readonly url: string; - key?: string; - oldValue?: string; - newValue?: string; - storageArea?: Storage; -} - -declare var StorageEvent: { - prototype: StorageEvent; - new (type: string, eventInitDict?: StorageEventInit): StorageEvent; -} - -interface StyleMedia { - readonly type: string; - matchMedium(mediaquery: string): boolean; -} - -declare var StyleMedia: { - prototype: StyleMedia; - new(): StyleMedia; -} - -interface StyleSheet { - disabled: boolean; - readonly href: string; - readonly media: MediaList; - readonly ownerNode: Node; - readonly parentStyleSheet: StyleSheet; - readonly title: string; - readonly type: string; -} - -declare var StyleSheet: { - prototype: StyleSheet; - new(): StyleSheet; -} - -interface StyleSheetList { - readonly length: number; - item(index?: number): StyleSheet; - [index: number]: StyleSheet; -} - -declare var StyleSheetList: { - prototype: StyleSheetList; - new(): StyleSheetList; -} - -interface StyleSheetPageList { - readonly length: number; - item(index: number): CSSPageRule; - [index: number]: CSSPageRule; -} - -declare var StyleSheetPageList: { - prototype: StyleSheetPageList; - new(): StyleSheetPageList; -} - -interface SubtleCrypto { - decrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): PromiseLike; - deriveBits(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, length: number): PromiseLike; - deriveKey(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike; - digest(algorithm: AlgorithmIdentifier, data: BufferSource): PromiseLike; - encrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): PromiseLike; - exportKey(format: "jwk", key: CryptoKey): PromiseLike; - exportKey(format: "raw" | "pkcs8" | "spki", key: CryptoKey): PromiseLike; - exportKey(format: string, key: CryptoKey): PromiseLike; - generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): PromiseLike; - generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: string[]): PromiseLike; - generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike; - importKey(format: "jwk", keyData: JsonWebKey, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike; - importKey(format: "raw" | "pkcs8" | "spki", keyData: BufferSource, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike; - importKey(format: string, keyData: JsonWebKey | BufferSource, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike; - sign(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, data: BufferSource): PromiseLike; - unwrapKey(format: string, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: string[]): PromiseLike; - verify(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, signature: BufferSource, data: BufferSource): PromiseLike; - wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier): PromiseLike; -} - -declare var SubtleCrypto: { - prototype: SubtleCrypto; - new(): SubtleCrypto; -} - -interface Text extends CharacterData { - readonly wholeText: string; - readonly assignedSlot: HTMLSlotElement | null; - splitText(offset: number): Text; -} - -declare var Text: { - prototype: Text; - new(): Text; -} - -interface TextEvent extends UIEvent { - readonly data: string; - readonly inputMethod: number; - readonly locale: string; - initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; - readonly DOM_INPUT_METHOD_DROP: number; - readonly DOM_INPUT_METHOD_HANDWRITING: number; - readonly DOM_INPUT_METHOD_IME: number; - readonly DOM_INPUT_METHOD_KEYBOARD: number; - readonly DOM_INPUT_METHOD_MULTIMODAL: number; - readonly DOM_INPUT_METHOD_OPTION: number; - readonly DOM_INPUT_METHOD_PASTE: number; - readonly DOM_INPUT_METHOD_SCRIPT: number; - readonly DOM_INPUT_METHOD_UNKNOWN: number; - readonly DOM_INPUT_METHOD_VOICE: number; -} - -declare var TextEvent: { - prototype: TextEvent; - new(): TextEvent; - readonly DOM_INPUT_METHOD_DROP: number; - readonly DOM_INPUT_METHOD_HANDWRITING: number; - readonly DOM_INPUT_METHOD_IME: number; - readonly DOM_INPUT_METHOD_KEYBOARD: number; - readonly DOM_INPUT_METHOD_MULTIMODAL: number; - readonly DOM_INPUT_METHOD_OPTION: number; - readonly DOM_INPUT_METHOD_PASTE: number; - readonly DOM_INPUT_METHOD_SCRIPT: number; - readonly DOM_INPUT_METHOD_UNKNOWN: number; - readonly DOM_INPUT_METHOD_VOICE: number; -} - -interface TextMetrics { - readonly width: number; -} - -declare var TextMetrics: { - prototype: TextMetrics; - new(): TextMetrics; -} - -interface TextTrackEventMap { - "cuechange": Event; - "error": ErrorEvent; - "load": Event; -} - -interface TextTrack extends EventTarget { - readonly activeCues: TextTrackCueList; - readonly cues: TextTrackCueList; - readonly inBandMetadataTrackDispatchType: string; - readonly kind: string; - readonly label: string; - readonly language: string; - mode: any; - oncuechange: (this: TextTrack, ev: Event) => any; - onerror: (this: TextTrack, ev: ErrorEvent) => any; - onload: (this: TextTrack, ev: Event) => any; - readonly readyState: number; - addCue(cue: TextTrackCue): void; - removeCue(cue: TextTrackCue): void; - readonly DISABLED: number; - readonly ERROR: number; - readonly HIDDEN: number; - readonly LOADED: number; - readonly LOADING: number; - readonly NONE: number; - readonly SHOWING: number; - addEventListener(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var TextTrack: { - prototype: TextTrack; - new(): TextTrack; - readonly DISABLED: number; - readonly ERROR: number; - readonly HIDDEN: number; - readonly LOADED: number; - readonly LOADING: number; - readonly NONE: number; - readonly SHOWING: number; -} - -interface TextTrackCueEventMap { - "enter": Event; - "exit": Event; -} - -interface TextTrackCue extends EventTarget { - endTime: number; - id: string; - onenter: (this: TextTrackCue, ev: Event) => any; - onexit: (this: TextTrackCue, ev: Event) => any; - pauseOnExit: boolean; - startTime: number; - text: string; - readonly track: TextTrack; - getCueAsHTML(): DocumentFragment; - addEventListener(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var TextTrackCue: { - prototype: TextTrackCue; - new(startTime: number, endTime: number, text: string): TextTrackCue; -} - -interface TextTrackCueList { - readonly length: number; - getCueById(id: string): TextTrackCue; - item(index: number): TextTrackCue; - [index: number]: TextTrackCue; -} - -declare var TextTrackCueList: { - prototype: TextTrackCueList; - new(): TextTrackCueList; -} - -interface TextTrackListEventMap { - "addtrack": TrackEvent; -} - -interface TextTrackList extends EventTarget { - readonly length: number; - onaddtrack: ((this: TextTrackList, ev: TrackEvent) => any) | null; - item(index: number): TextTrack; - addEventListener(type: K, listener: (this: TextTrackList, ev: TextTrackListEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [index: number]: TextTrack; -} - -declare var TextTrackList: { - prototype: TextTrackList; - new(): TextTrackList; -} - -interface TimeRanges { - readonly length: number; - end(index: number): number; - start(index: number): number; -} - -declare var TimeRanges: { - prototype: TimeRanges; - new(): TimeRanges; -} - -interface Touch { - readonly clientX: number; - readonly clientY: number; - readonly identifier: number; - readonly pageX: number; - readonly pageY: number; - readonly screenX: number; - readonly screenY: number; - readonly target: EventTarget; -} - -declare var Touch: { - prototype: Touch; - new(): Touch; -} - -interface TouchEvent extends UIEvent { - readonly altKey: boolean; - readonly changedTouches: TouchList; - readonly ctrlKey: boolean; - readonly metaKey: boolean; - readonly shiftKey: boolean; - readonly targetTouches: TouchList; - readonly touches: TouchList; -} - -declare var TouchEvent: { - prototype: TouchEvent; - new(): TouchEvent; -} - -interface TouchList { - readonly length: number; - item(index: number): Touch | null; - [index: number]: Touch; -} - -declare var TouchList: { - prototype: TouchList; - new(): TouchList; -} - -interface TrackEvent extends Event { - readonly track: any; -} - -declare var TrackEvent: { - prototype: TrackEvent; - new(): TrackEvent; -} - -interface TransitionEvent extends Event { - readonly elapsedTime: number; - readonly propertyName: string; - initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; -} - -declare var TransitionEvent: { - prototype: TransitionEvent; - new(): TransitionEvent; -} - -interface TreeWalker { - currentNode: Node; - readonly expandEntityReferences: boolean; - readonly filter: NodeFilter; - readonly root: Node; - readonly whatToShow: number; - firstChild(): Node; - lastChild(): Node; - nextNode(): Node; - nextSibling(): Node; - parentNode(): Node; - previousNode(): Node; - previousSibling(): Node; -} - -declare var TreeWalker: { - prototype: TreeWalker; - new(): TreeWalker; -} - -interface UIEvent extends Event { - readonly detail: number; - readonly view: Window; - initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; -} - -declare var UIEvent: { - prototype: UIEvent; - new(type: string, eventInitDict?: UIEventInit): UIEvent; -} - -interface URL { - hash: string; - host: string; - hostname: string; - href: string; - readonly origin: string; - password: string; - pathname: string; - port: string; - protocol: string; - search: string; - username: string; - toString(): string; -} - -declare var URL: { - prototype: URL; - new(url: string, base?: string): URL; - createObjectURL(object: any, options?: ObjectURLOptions): string; - revokeObjectURL(url: string): void; -} - -interface UnviewableContentIdentifiedEvent extends NavigationEventWithReferrer { - readonly mediaType: string; -} - -declare var UnviewableContentIdentifiedEvent: { - prototype: UnviewableContentIdentifiedEvent; - new(): UnviewableContentIdentifiedEvent; -} - -interface ValidityState { - readonly badInput: boolean; - readonly customError: boolean; - readonly patternMismatch: boolean; - readonly rangeOverflow: boolean; - readonly rangeUnderflow: boolean; - readonly stepMismatch: boolean; - readonly tooLong: boolean; - readonly typeMismatch: boolean; - readonly valid: boolean; - readonly valueMissing: boolean; -} - -declare var ValidityState: { - prototype: ValidityState; - new(): ValidityState; -} - -interface VideoPlaybackQuality { - readonly corruptedVideoFrames: number; - readonly creationTime: number; - readonly droppedVideoFrames: number; - readonly totalFrameDelay: number; - readonly totalVideoFrames: number; -} - -declare var VideoPlaybackQuality: { - prototype: VideoPlaybackQuality; - new(): VideoPlaybackQuality; -} - -interface VideoTrack { - readonly id: string; - kind: string; - readonly label: string; - language: string; - selected: boolean; - readonly sourceBuffer: SourceBuffer; -} - -declare var VideoTrack: { - prototype: VideoTrack; - new(): VideoTrack; -} - -interface VideoTrackListEventMap { - "addtrack": TrackEvent; - "change": Event; - "removetrack": TrackEvent; -} - -interface VideoTrackList extends EventTarget { - readonly length: number; - onaddtrack: (this: VideoTrackList, ev: TrackEvent) => any; - onchange: (this: VideoTrackList, ev: Event) => any; - onremovetrack: (this: VideoTrackList, ev: TrackEvent) => any; - readonly selectedIndex: number; - getTrackById(id: string): VideoTrack | null; - item(index: number): VideoTrack; - addEventListener(type: K, listener: (this: VideoTrackList, ev: VideoTrackListEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [index: number]: VideoTrack; -} - -declare var VideoTrackList: { - prototype: VideoTrackList; - new(): VideoTrackList; -} - -interface WEBGL_compressed_texture_s3tc { - readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} - -declare var WEBGL_compressed_texture_s3tc: { - prototype: WEBGL_compressed_texture_s3tc; - new(): WEBGL_compressed_texture_s3tc; - readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} - -interface WEBGL_debug_renderer_info { - readonly UNMASKED_RENDERER_WEBGL: number; - readonly UNMASKED_VENDOR_WEBGL: number; -} - -declare var WEBGL_debug_renderer_info: { - prototype: WEBGL_debug_renderer_info; - new(): WEBGL_debug_renderer_info; - readonly UNMASKED_RENDERER_WEBGL: number; - readonly UNMASKED_VENDOR_WEBGL: number; -} - -interface WEBGL_depth_texture { - readonly UNSIGNED_INT_24_8_WEBGL: number; -} - -declare var WEBGL_depth_texture: { - prototype: WEBGL_depth_texture; - new(): WEBGL_depth_texture; - readonly UNSIGNED_INT_24_8_WEBGL: number; -} - -interface WaveShaperNode extends AudioNode { - curve: Float32Array | null; - oversample: string; -} - -declare var WaveShaperNode: { - prototype: WaveShaperNode; - new(): WaveShaperNode; -} - -interface WebGLActiveInfo { - readonly name: string; - readonly size: number; - readonly type: number; -} - -declare var WebGLActiveInfo: { - prototype: WebGLActiveInfo; - new(): WebGLActiveInfo; -} - -interface WebGLBuffer extends WebGLObject { -} - -declare var WebGLBuffer: { - prototype: WebGLBuffer; - new(): WebGLBuffer; -} - -interface WebGLContextEvent extends Event { - readonly statusMessage: string; -} - -declare var WebGLContextEvent: { - prototype: WebGLContextEvent; - new(type: string, eventInitDict?: WebGLContextEventInit): WebGLContextEvent; -} - -interface WebGLFramebuffer extends WebGLObject { -} - -declare var WebGLFramebuffer: { - prototype: WebGLFramebuffer; - new(): WebGLFramebuffer; -} - -interface WebGLObject { -} - -declare var WebGLObject: { - prototype: WebGLObject; - new(): WebGLObject; -} - -interface WebGLProgram extends WebGLObject { -} - -declare var WebGLProgram: { - prototype: WebGLProgram; - new(): WebGLProgram; -} - -interface WebGLRenderbuffer extends WebGLObject { -} - -declare var WebGLRenderbuffer: { - prototype: WebGLRenderbuffer; - new(): WebGLRenderbuffer; -} - -interface WebGLRenderingContext { - readonly canvas: HTMLCanvasElement; - readonly drawingBufferHeight: number; - readonly drawingBufferWidth: number; - activeTexture(texture: number): void; - attachShader(program: WebGLProgram | null, shader: WebGLShader | null): void; - bindAttribLocation(program: WebGLProgram | null, index: number, name: string): void; - bindBuffer(target: number, buffer: WebGLBuffer | null): void; - bindFramebuffer(target: number, framebuffer: WebGLFramebuffer | null): void; - bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer | null): void; - bindTexture(target: number, texture: WebGLTexture | null): void; - blendColor(red: number, green: number, blue: number, alpha: number): void; - blendEquation(mode: number): void; - blendEquationSeparate(modeRGB: number, modeAlpha: number): void; - blendFunc(sfactor: number, dfactor: number): void; - blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; - bufferData(target: number, size: number | ArrayBufferView | ArrayBuffer, usage: number): void; - bufferSubData(target: number, offset: number, data: ArrayBufferView | ArrayBuffer): void; - checkFramebufferStatus(target: number): number; - clear(mask: number): void; - clearColor(red: number, green: number, blue: number, alpha: number): void; - clearDepth(depth: number): void; - clearStencil(s: number): void; - colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; - compileShader(shader: WebGLShader | null): void; - compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; - compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; - copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; - copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; - createBuffer(): WebGLBuffer | null; - createFramebuffer(): WebGLFramebuffer | null; - createProgram(): WebGLProgram | null; - createRenderbuffer(): WebGLRenderbuffer | null; - createShader(type: number): WebGLShader | null; - createTexture(): WebGLTexture | null; - cullFace(mode: number): void; - deleteBuffer(buffer: WebGLBuffer | null): void; - deleteFramebuffer(framebuffer: WebGLFramebuffer | null): void; - deleteProgram(program: WebGLProgram | null): void; - deleteRenderbuffer(renderbuffer: WebGLRenderbuffer | null): void; - deleteShader(shader: WebGLShader | null): void; - deleteTexture(texture: WebGLTexture | null): void; - depthFunc(func: number): void; - depthMask(flag: boolean): void; - depthRange(zNear: number, zFar: number): void; - detachShader(program: WebGLProgram | null, shader: WebGLShader | null): void; - disable(cap: number): void; - disableVertexAttribArray(index: number): void; - drawArrays(mode: number, first: number, count: number): void; - drawElements(mode: number, count: number, type: number, offset: number): void; - enable(cap: number): void; - enableVertexAttribArray(index: number): void; - finish(): void; - flush(): void; - framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer | null): void; - framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture | null, level: number): void; - frontFace(mode: number): void; - generateMipmap(target: number): void; - getActiveAttrib(program: WebGLProgram | null, index: number): WebGLActiveInfo | null; - getActiveUniform(program: WebGLProgram | null, index: number): WebGLActiveInfo | null; - getAttachedShaders(program: WebGLProgram | null): WebGLShader[] | null; - getAttribLocation(program: WebGLProgram | null, name: string): number; - getBufferParameter(target: number, pname: number): any; - getContextAttributes(): WebGLContextAttributes; - getError(): number; - getExtension(name: string): any; - getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; - getParameter(pname: number): any; - getProgramInfoLog(program: WebGLProgram | null): string | null; - getProgramParameter(program: WebGLProgram | null, pname: number): any; - getRenderbufferParameter(target: number, pname: number): any; - getShaderInfoLog(shader: WebGLShader | null): string | null; - getShaderParameter(shader: WebGLShader | null, pname: number): any; - getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat | null; - getShaderSource(shader: WebGLShader | null): string | null; - getSupportedExtensions(): string[] | null; - getTexParameter(target: number, pname: number): any; - getUniform(program: WebGLProgram | null, location: WebGLUniformLocation | null): any; - getUniformLocation(program: WebGLProgram | null, name: string): WebGLUniformLocation | null; - getVertexAttrib(index: number, pname: number): any; - getVertexAttribOffset(index: number, pname: number): number; - hint(target: number, mode: number): void; - isBuffer(buffer: WebGLBuffer | null): boolean; - isContextLost(): boolean; - isEnabled(cap: number): boolean; - isFramebuffer(framebuffer: WebGLFramebuffer | null): boolean; - isProgram(program: WebGLProgram | null): boolean; - isRenderbuffer(renderbuffer: WebGLRenderbuffer | null): boolean; - isShader(shader: WebGLShader | null): boolean; - isTexture(texture: WebGLTexture | null): boolean; - lineWidth(width: number): void; - linkProgram(program: WebGLProgram | null): void; - pixelStorei(pname: number, param: number): void; - polygonOffset(factor: number, units: number): void; - readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void; - renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; - sampleCoverage(value: number, invert: boolean): void; - scissor(x: number, y: number, width: number, height: number): void; - shaderSource(shader: WebGLShader | null, source: string): void; - stencilFunc(func: number, ref: number, mask: number): void; - stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; - stencilMask(mask: number): void; - stencilMaskSeparate(face: number, mask: number): void; - stencilOp(fail: number, zfail: number, zpass: number): void; - stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; - texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels?: ArrayBufferView): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels?: ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void; - texParameterf(target: number, pname: number, param: number): void; - texParameteri(target: number, pname: number, param: number): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels?: ArrayBufferView): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels?: ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void; - uniform1f(location: WebGLUniformLocation | null, x: number): void; - uniform1fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; - uniform1i(location: WebGLUniformLocation | null, x: number): void; - uniform1iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniform2f(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; - uniform2i(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniform3f(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; - uniform3i(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniform4f(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; - uniform4i(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - useProgram(program: WebGLProgram | null): void; - validateProgram(program: WebGLProgram | null): void; - vertexAttrib1f(indx: number, x: number): void; - vertexAttrib1fv(indx: number, values: Float32Array | number[]): void; - vertexAttrib2f(indx: number, x: number, y: number): void; - vertexAttrib2fv(indx: number, values: Float32Array | number[]): void; - vertexAttrib3f(indx: number, x: number, y: number, z: number): void; - vertexAttrib3fv(indx: number, values: Float32Array | number[]): void; - vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; - vertexAttrib4fv(indx: number, values: Float32Array | number[]): void; - vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; - viewport(x: number, y: number, width: number, height: number): void; - readonly ACTIVE_ATTRIBUTES: number; - readonly ACTIVE_TEXTURE: number; - readonly ACTIVE_UNIFORMS: number; - readonly ALIASED_LINE_WIDTH_RANGE: number; - readonly ALIASED_POINT_SIZE_RANGE: number; - readonly ALPHA: number; - readonly ALPHA_BITS: number; - readonly ALWAYS: number; - readonly ARRAY_BUFFER: number; - readonly ARRAY_BUFFER_BINDING: number; - readonly ATTACHED_SHADERS: number; - readonly BACK: number; - readonly BLEND: number; - readonly BLEND_COLOR: number; - readonly BLEND_DST_ALPHA: number; - readonly BLEND_DST_RGB: number; - readonly BLEND_EQUATION: number; - readonly BLEND_EQUATION_ALPHA: number; - readonly BLEND_EQUATION_RGB: number; - readonly BLEND_SRC_ALPHA: number; - readonly BLEND_SRC_RGB: number; - readonly BLUE_BITS: number; - readonly BOOL: number; - readonly BOOL_VEC2: number; - readonly BOOL_VEC3: number; - readonly BOOL_VEC4: number; - readonly BROWSER_DEFAULT_WEBGL: number; - readonly BUFFER_SIZE: number; - readonly BUFFER_USAGE: number; - readonly BYTE: number; - readonly CCW: number; - readonly CLAMP_TO_EDGE: number; - readonly COLOR_ATTACHMENT0: number; - readonly COLOR_BUFFER_BIT: number; - readonly COLOR_CLEAR_VALUE: number; - readonly COLOR_WRITEMASK: number; - readonly COMPILE_STATUS: number; - readonly COMPRESSED_TEXTURE_FORMATS: number; - readonly CONSTANT_ALPHA: number; - readonly CONSTANT_COLOR: number; - readonly CONTEXT_LOST_WEBGL: number; - readonly CULL_FACE: number; - readonly CULL_FACE_MODE: number; - readonly CURRENT_PROGRAM: number; - readonly CURRENT_VERTEX_ATTRIB: number; - readonly CW: number; - readonly DECR: number; - readonly DECR_WRAP: number; - readonly DELETE_STATUS: number; - readonly DEPTH_ATTACHMENT: number; - readonly DEPTH_BITS: number; - readonly DEPTH_BUFFER_BIT: number; - readonly DEPTH_CLEAR_VALUE: number; - readonly DEPTH_COMPONENT: number; - readonly DEPTH_COMPONENT16: number; - readonly DEPTH_FUNC: number; - readonly DEPTH_RANGE: number; - readonly DEPTH_STENCIL: number; - readonly DEPTH_STENCIL_ATTACHMENT: number; - readonly DEPTH_TEST: number; - readonly DEPTH_WRITEMASK: number; - readonly DITHER: number; - readonly DONT_CARE: number; - readonly DST_ALPHA: number; - readonly DST_COLOR: number; - readonly DYNAMIC_DRAW: number; - readonly ELEMENT_ARRAY_BUFFER: number; - readonly ELEMENT_ARRAY_BUFFER_BINDING: number; - readonly EQUAL: number; - readonly FASTEST: number; - readonly FLOAT: number; - readonly FLOAT_MAT2: number; - readonly FLOAT_MAT3: number; - readonly FLOAT_MAT4: number; - readonly FLOAT_VEC2: number; - readonly FLOAT_VEC3: number; - readonly FLOAT_VEC4: number; - readonly FRAGMENT_SHADER: number; - readonly FRAMEBUFFER: number; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - readonly FRAMEBUFFER_BINDING: number; - readonly FRAMEBUFFER_COMPLETE: number; - readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - readonly FRAMEBUFFER_UNSUPPORTED: number; - readonly FRONT: number; - readonly FRONT_AND_BACK: number; - readonly FRONT_FACE: number; - readonly FUNC_ADD: number; - readonly FUNC_REVERSE_SUBTRACT: number; - readonly FUNC_SUBTRACT: number; - readonly GENERATE_MIPMAP_HINT: number; - readonly GEQUAL: number; - readonly GREATER: number; - readonly GREEN_BITS: number; - readonly HIGH_FLOAT: number; - readonly HIGH_INT: number; - readonly IMPLEMENTATION_COLOR_READ_FORMAT: number; - readonly IMPLEMENTATION_COLOR_READ_TYPE: number; - readonly INCR: number; - readonly INCR_WRAP: number; - readonly INT: number; - readonly INT_VEC2: number; - readonly INT_VEC3: number; - readonly INT_VEC4: number; - readonly INVALID_ENUM: number; - readonly INVALID_FRAMEBUFFER_OPERATION: number; - readonly INVALID_OPERATION: number; - readonly INVALID_VALUE: number; - readonly INVERT: number; - readonly KEEP: number; - readonly LEQUAL: number; - readonly LESS: number; - readonly LINEAR: number; - readonly LINEAR_MIPMAP_LINEAR: number; - readonly LINEAR_MIPMAP_NEAREST: number; - readonly LINES: number; - readonly LINE_LOOP: number; - readonly LINE_STRIP: number; - readonly LINE_WIDTH: number; - readonly LINK_STATUS: number; - readonly LOW_FLOAT: number; - readonly LOW_INT: number; - readonly LUMINANCE: number; - readonly LUMINANCE_ALPHA: number; - readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - readonly MAX_CUBE_MAP_TEXTURE_SIZE: number; - readonly MAX_FRAGMENT_UNIFORM_VECTORS: number; - readonly MAX_RENDERBUFFER_SIZE: number; - readonly MAX_TEXTURE_IMAGE_UNITS: number; - readonly MAX_TEXTURE_SIZE: number; - readonly MAX_VARYING_VECTORS: number; - readonly MAX_VERTEX_ATTRIBS: number; - readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - readonly MAX_VERTEX_UNIFORM_VECTORS: number; - readonly MAX_VIEWPORT_DIMS: number; - readonly MEDIUM_FLOAT: number; - readonly MEDIUM_INT: number; - readonly MIRRORED_REPEAT: number; - readonly NEAREST: number; - readonly NEAREST_MIPMAP_LINEAR: number; - readonly NEAREST_MIPMAP_NEAREST: number; - readonly NEVER: number; - readonly NICEST: number; - readonly NONE: number; - readonly NOTEQUAL: number; - readonly NO_ERROR: number; - readonly ONE: number; - readonly ONE_MINUS_CONSTANT_ALPHA: number; - readonly ONE_MINUS_CONSTANT_COLOR: number; - readonly ONE_MINUS_DST_ALPHA: number; - readonly ONE_MINUS_DST_COLOR: number; - readonly ONE_MINUS_SRC_ALPHA: number; - readonly ONE_MINUS_SRC_COLOR: number; - readonly OUT_OF_MEMORY: number; - readonly PACK_ALIGNMENT: number; - readonly POINTS: number; - readonly POLYGON_OFFSET_FACTOR: number; - readonly POLYGON_OFFSET_FILL: number; - readonly POLYGON_OFFSET_UNITS: number; - readonly RED_BITS: number; - readonly RENDERBUFFER: number; - readonly RENDERBUFFER_ALPHA_SIZE: number; - readonly RENDERBUFFER_BINDING: number; - readonly RENDERBUFFER_BLUE_SIZE: number; - readonly RENDERBUFFER_DEPTH_SIZE: number; - readonly RENDERBUFFER_GREEN_SIZE: number; - readonly RENDERBUFFER_HEIGHT: number; - readonly RENDERBUFFER_INTERNAL_FORMAT: number; - readonly RENDERBUFFER_RED_SIZE: number; - readonly RENDERBUFFER_STENCIL_SIZE: number; - readonly RENDERBUFFER_WIDTH: number; - readonly RENDERER: number; - readonly REPEAT: number; - readonly REPLACE: number; - readonly RGB: number; - readonly RGB565: number; - readonly RGB5_A1: number; - readonly RGBA: number; - readonly RGBA4: number; - readonly SAMPLER_2D: number; - readonly SAMPLER_CUBE: number; - readonly SAMPLES: number; - readonly SAMPLE_ALPHA_TO_COVERAGE: number; - readonly SAMPLE_BUFFERS: number; - readonly SAMPLE_COVERAGE: number; - readonly SAMPLE_COVERAGE_INVERT: number; - readonly SAMPLE_COVERAGE_VALUE: number; - readonly SCISSOR_BOX: number; - readonly SCISSOR_TEST: number; - readonly SHADER_TYPE: number; - readonly SHADING_LANGUAGE_VERSION: number; - readonly SHORT: number; - readonly SRC_ALPHA: number; - readonly SRC_ALPHA_SATURATE: number; - readonly SRC_COLOR: number; - readonly STATIC_DRAW: number; - readonly STENCIL_ATTACHMENT: number; - readonly STENCIL_BACK_FAIL: number; - readonly STENCIL_BACK_FUNC: number; - readonly STENCIL_BACK_PASS_DEPTH_FAIL: number; - readonly STENCIL_BACK_PASS_DEPTH_PASS: number; - readonly STENCIL_BACK_REF: number; - readonly STENCIL_BACK_VALUE_MASK: number; - readonly STENCIL_BACK_WRITEMASK: number; - readonly STENCIL_BITS: number; - readonly STENCIL_BUFFER_BIT: number; - readonly STENCIL_CLEAR_VALUE: number; - readonly STENCIL_FAIL: number; - readonly STENCIL_FUNC: number; - readonly STENCIL_INDEX: number; - readonly STENCIL_INDEX8: number; - readonly STENCIL_PASS_DEPTH_FAIL: number; - readonly STENCIL_PASS_DEPTH_PASS: number; - readonly STENCIL_REF: number; - readonly STENCIL_TEST: number; - readonly STENCIL_VALUE_MASK: number; - readonly STENCIL_WRITEMASK: number; - readonly STREAM_DRAW: number; - readonly SUBPIXEL_BITS: number; - readonly TEXTURE: number; - readonly TEXTURE0: number; - readonly TEXTURE1: number; - readonly TEXTURE10: number; - readonly TEXTURE11: number; - readonly TEXTURE12: number; - readonly TEXTURE13: number; - readonly TEXTURE14: number; - readonly TEXTURE15: number; - readonly TEXTURE16: number; - readonly TEXTURE17: number; - readonly TEXTURE18: number; - readonly TEXTURE19: number; - readonly TEXTURE2: number; - readonly TEXTURE20: number; - readonly TEXTURE21: number; - readonly TEXTURE22: number; - readonly TEXTURE23: number; - readonly TEXTURE24: number; - readonly TEXTURE25: number; - readonly TEXTURE26: number; - readonly TEXTURE27: number; - readonly TEXTURE28: number; - readonly TEXTURE29: number; - readonly TEXTURE3: number; - readonly TEXTURE30: number; - readonly TEXTURE31: number; - readonly TEXTURE4: number; - readonly TEXTURE5: number; - readonly TEXTURE6: number; - readonly TEXTURE7: number; - readonly TEXTURE8: number; - readonly TEXTURE9: number; - readonly TEXTURE_2D: number; - readonly TEXTURE_BINDING_2D: number; - readonly TEXTURE_BINDING_CUBE_MAP: number; - readonly TEXTURE_CUBE_MAP: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_X: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number; - readonly TEXTURE_MAG_FILTER: number; - readonly TEXTURE_MIN_FILTER: number; - readonly TEXTURE_WRAP_S: number; - readonly TEXTURE_WRAP_T: number; - readonly TRIANGLES: number; - readonly TRIANGLE_FAN: number; - readonly TRIANGLE_STRIP: number; - readonly UNPACK_ALIGNMENT: number; - readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - readonly UNPACK_FLIP_Y_WEBGL: number; - readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - readonly UNSIGNED_BYTE: number; - readonly UNSIGNED_INT: number; - readonly UNSIGNED_SHORT: number; - readonly UNSIGNED_SHORT_4_4_4_4: number; - readonly UNSIGNED_SHORT_5_5_5_1: number; - readonly UNSIGNED_SHORT_5_6_5: number; - readonly VALIDATE_STATUS: number; - readonly VENDOR: number; - readonly VERSION: number; - readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - readonly VERTEX_ATTRIB_ARRAY_ENABLED: number; - readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - readonly VERTEX_ATTRIB_ARRAY_POINTER: number; - readonly VERTEX_ATTRIB_ARRAY_SIZE: number; - readonly VERTEX_ATTRIB_ARRAY_STRIDE: number; - readonly VERTEX_ATTRIB_ARRAY_TYPE: number; - readonly VERTEX_SHADER: number; - readonly VIEWPORT: number; - readonly ZERO: number; -} - -declare var WebGLRenderingContext: { - prototype: WebGLRenderingContext; - new(): WebGLRenderingContext; - readonly ACTIVE_ATTRIBUTES: number; - readonly ACTIVE_TEXTURE: number; - readonly ACTIVE_UNIFORMS: number; - readonly ALIASED_LINE_WIDTH_RANGE: number; - readonly ALIASED_POINT_SIZE_RANGE: number; - readonly ALPHA: number; - readonly ALPHA_BITS: number; - readonly ALWAYS: number; - readonly ARRAY_BUFFER: number; - readonly ARRAY_BUFFER_BINDING: number; - readonly ATTACHED_SHADERS: number; - readonly BACK: number; - readonly BLEND: number; - readonly BLEND_COLOR: number; - readonly BLEND_DST_ALPHA: number; - readonly BLEND_DST_RGB: number; - readonly BLEND_EQUATION: number; - readonly BLEND_EQUATION_ALPHA: number; - readonly BLEND_EQUATION_RGB: number; - readonly BLEND_SRC_ALPHA: number; - readonly BLEND_SRC_RGB: number; - readonly BLUE_BITS: number; - readonly BOOL: number; - readonly BOOL_VEC2: number; - readonly BOOL_VEC3: number; - readonly BOOL_VEC4: number; - readonly BROWSER_DEFAULT_WEBGL: number; - readonly BUFFER_SIZE: number; - readonly BUFFER_USAGE: number; - readonly BYTE: number; - readonly CCW: number; - readonly CLAMP_TO_EDGE: number; - readonly COLOR_ATTACHMENT0: number; - readonly COLOR_BUFFER_BIT: number; - readonly COLOR_CLEAR_VALUE: number; - readonly COLOR_WRITEMASK: number; - readonly COMPILE_STATUS: number; - readonly COMPRESSED_TEXTURE_FORMATS: number; - readonly CONSTANT_ALPHA: number; - readonly CONSTANT_COLOR: number; - readonly CONTEXT_LOST_WEBGL: number; - readonly CULL_FACE: number; - readonly CULL_FACE_MODE: number; - readonly CURRENT_PROGRAM: number; - readonly CURRENT_VERTEX_ATTRIB: number; - readonly CW: number; - readonly DECR: number; - readonly DECR_WRAP: number; - readonly DELETE_STATUS: number; - readonly DEPTH_ATTACHMENT: number; - readonly DEPTH_BITS: number; - readonly DEPTH_BUFFER_BIT: number; - readonly DEPTH_CLEAR_VALUE: number; - readonly DEPTH_COMPONENT: number; - readonly DEPTH_COMPONENT16: number; - readonly DEPTH_FUNC: number; - readonly DEPTH_RANGE: number; - readonly DEPTH_STENCIL: number; - readonly DEPTH_STENCIL_ATTACHMENT: number; - readonly DEPTH_TEST: number; - readonly DEPTH_WRITEMASK: number; - readonly DITHER: number; - readonly DONT_CARE: number; - readonly DST_ALPHA: number; - readonly DST_COLOR: number; - readonly DYNAMIC_DRAW: number; - readonly ELEMENT_ARRAY_BUFFER: number; - readonly ELEMENT_ARRAY_BUFFER_BINDING: number; - readonly EQUAL: number; - readonly FASTEST: number; - readonly FLOAT: number; - readonly FLOAT_MAT2: number; - readonly FLOAT_MAT3: number; - readonly FLOAT_MAT4: number; - readonly FLOAT_VEC2: number; - readonly FLOAT_VEC3: number; - readonly FLOAT_VEC4: number; - readonly FRAGMENT_SHADER: number; - readonly FRAMEBUFFER: number; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - readonly FRAMEBUFFER_BINDING: number; - readonly FRAMEBUFFER_COMPLETE: number; - readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - readonly FRAMEBUFFER_UNSUPPORTED: number; - readonly FRONT: number; - readonly FRONT_AND_BACK: number; - readonly FRONT_FACE: number; - readonly FUNC_ADD: number; - readonly FUNC_REVERSE_SUBTRACT: number; - readonly FUNC_SUBTRACT: number; - readonly GENERATE_MIPMAP_HINT: number; - readonly GEQUAL: number; - readonly GREATER: number; - readonly GREEN_BITS: number; - readonly HIGH_FLOAT: number; - readonly HIGH_INT: number; - readonly IMPLEMENTATION_COLOR_READ_FORMAT: number; - readonly IMPLEMENTATION_COLOR_READ_TYPE: number; - readonly INCR: number; - readonly INCR_WRAP: number; - readonly INT: number; - readonly INT_VEC2: number; - readonly INT_VEC3: number; - readonly INT_VEC4: number; - readonly INVALID_ENUM: number; - readonly INVALID_FRAMEBUFFER_OPERATION: number; - readonly INVALID_OPERATION: number; - readonly INVALID_VALUE: number; - readonly INVERT: number; - readonly KEEP: number; - readonly LEQUAL: number; - readonly LESS: number; - readonly LINEAR: number; - readonly LINEAR_MIPMAP_LINEAR: number; - readonly LINEAR_MIPMAP_NEAREST: number; - readonly LINES: number; - readonly LINE_LOOP: number; - readonly LINE_STRIP: number; - readonly LINE_WIDTH: number; - readonly LINK_STATUS: number; - readonly LOW_FLOAT: number; - readonly LOW_INT: number; - readonly LUMINANCE: number; - readonly LUMINANCE_ALPHA: number; - readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - readonly MAX_CUBE_MAP_TEXTURE_SIZE: number; - readonly MAX_FRAGMENT_UNIFORM_VECTORS: number; - readonly MAX_RENDERBUFFER_SIZE: number; - readonly MAX_TEXTURE_IMAGE_UNITS: number; - readonly MAX_TEXTURE_SIZE: number; - readonly MAX_VARYING_VECTORS: number; - readonly MAX_VERTEX_ATTRIBS: number; - readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - readonly MAX_VERTEX_UNIFORM_VECTORS: number; - readonly MAX_VIEWPORT_DIMS: number; - readonly MEDIUM_FLOAT: number; - readonly MEDIUM_INT: number; - readonly MIRRORED_REPEAT: number; - readonly NEAREST: number; - readonly NEAREST_MIPMAP_LINEAR: number; - readonly NEAREST_MIPMAP_NEAREST: number; - readonly NEVER: number; - readonly NICEST: number; - readonly NONE: number; - readonly NOTEQUAL: number; - readonly NO_ERROR: number; - readonly ONE: number; - readonly ONE_MINUS_CONSTANT_ALPHA: number; - readonly ONE_MINUS_CONSTANT_COLOR: number; - readonly ONE_MINUS_DST_ALPHA: number; - readonly ONE_MINUS_DST_COLOR: number; - readonly ONE_MINUS_SRC_ALPHA: number; - readonly ONE_MINUS_SRC_COLOR: number; - readonly OUT_OF_MEMORY: number; - readonly PACK_ALIGNMENT: number; - readonly POINTS: number; - readonly POLYGON_OFFSET_FACTOR: number; - readonly POLYGON_OFFSET_FILL: number; - readonly POLYGON_OFFSET_UNITS: number; - readonly RED_BITS: number; - readonly RENDERBUFFER: number; - readonly RENDERBUFFER_ALPHA_SIZE: number; - readonly RENDERBUFFER_BINDING: number; - readonly RENDERBUFFER_BLUE_SIZE: number; - readonly RENDERBUFFER_DEPTH_SIZE: number; - readonly RENDERBUFFER_GREEN_SIZE: number; - readonly RENDERBUFFER_HEIGHT: number; - readonly RENDERBUFFER_INTERNAL_FORMAT: number; - readonly RENDERBUFFER_RED_SIZE: number; - readonly RENDERBUFFER_STENCIL_SIZE: number; - readonly RENDERBUFFER_WIDTH: number; - readonly RENDERER: number; - readonly REPEAT: number; - readonly REPLACE: number; - readonly RGB: number; - readonly RGB565: number; - readonly RGB5_A1: number; - readonly RGBA: number; - readonly RGBA4: number; - readonly SAMPLER_2D: number; - readonly SAMPLER_CUBE: number; - readonly SAMPLES: number; - readonly SAMPLE_ALPHA_TO_COVERAGE: number; - readonly SAMPLE_BUFFERS: number; - readonly SAMPLE_COVERAGE: number; - readonly SAMPLE_COVERAGE_INVERT: number; - readonly SAMPLE_COVERAGE_VALUE: number; - readonly SCISSOR_BOX: number; - readonly SCISSOR_TEST: number; - readonly SHADER_TYPE: number; - readonly SHADING_LANGUAGE_VERSION: number; - readonly SHORT: number; - readonly SRC_ALPHA: number; - readonly SRC_ALPHA_SATURATE: number; - readonly SRC_COLOR: number; - readonly STATIC_DRAW: number; - readonly STENCIL_ATTACHMENT: number; - readonly STENCIL_BACK_FAIL: number; - readonly STENCIL_BACK_FUNC: number; - readonly STENCIL_BACK_PASS_DEPTH_FAIL: number; - readonly STENCIL_BACK_PASS_DEPTH_PASS: number; - readonly STENCIL_BACK_REF: number; - readonly STENCIL_BACK_VALUE_MASK: number; - readonly STENCIL_BACK_WRITEMASK: number; - readonly STENCIL_BITS: number; - readonly STENCIL_BUFFER_BIT: number; - readonly STENCIL_CLEAR_VALUE: number; - readonly STENCIL_FAIL: number; - readonly STENCIL_FUNC: number; - readonly STENCIL_INDEX: number; - readonly STENCIL_INDEX8: number; - readonly STENCIL_PASS_DEPTH_FAIL: number; - readonly STENCIL_PASS_DEPTH_PASS: number; - readonly STENCIL_REF: number; - readonly STENCIL_TEST: number; - readonly STENCIL_VALUE_MASK: number; - readonly STENCIL_WRITEMASK: number; - readonly STREAM_DRAW: number; - readonly SUBPIXEL_BITS: number; - readonly TEXTURE: number; - readonly TEXTURE0: number; - readonly TEXTURE1: number; - readonly TEXTURE10: number; - readonly TEXTURE11: number; - readonly TEXTURE12: number; - readonly TEXTURE13: number; - readonly TEXTURE14: number; - readonly TEXTURE15: number; - readonly TEXTURE16: number; - readonly TEXTURE17: number; - readonly TEXTURE18: number; - readonly TEXTURE19: number; - readonly TEXTURE2: number; - readonly TEXTURE20: number; - readonly TEXTURE21: number; - readonly TEXTURE22: number; - readonly TEXTURE23: number; - readonly TEXTURE24: number; - readonly TEXTURE25: number; - readonly TEXTURE26: number; - readonly TEXTURE27: number; - readonly TEXTURE28: number; - readonly TEXTURE29: number; - readonly TEXTURE3: number; - readonly TEXTURE30: number; - readonly TEXTURE31: number; - readonly TEXTURE4: number; - readonly TEXTURE5: number; - readonly TEXTURE6: number; - readonly TEXTURE7: number; - readonly TEXTURE8: number; - readonly TEXTURE9: number; - readonly TEXTURE_2D: number; - readonly TEXTURE_BINDING_2D: number; - readonly TEXTURE_BINDING_CUBE_MAP: number; - readonly TEXTURE_CUBE_MAP: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_X: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number; - readonly TEXTURE_MAG_FILTER: number; - readonly TEXTURE_MIN_FILTER: number; - readonly TEXTURE_WRAP_S: number; - readonly TEXTURE_WRAP_T: number; - readonly TRIANGLES: number; - readonly TRIANGLE_FAN: number; - readonly TRIANGLE_STRIP: number; - readonly UNPACK_ALIGNMENT: number; - readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - readonly UNPACK_FLIP_Y_WEBGL: number; - readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - readonly UNSIGNED_BYTE: number; - readonly UNSIGNED_INT: number; - readonly UNSIGNED_SHORT: number; - readonly UNSIGNED_SHORT_4_4_4_4: number; - readonly UNSIGNED_SHORT_5_5_5_1: number; - readonly UNSIGNED_SHORT_5_6_5: number; - readonly VALIDATE_STATUS: number; - readonly VENDOR: number; - readonly VERSION: number; - readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - readonly VERTEX_ATTRIB_ARRAY_ENABLED: number; - readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - readonly VERTEX_ATTRIB_ARRAY_POINTER: number; - readonly VERTEX_ATTRIB_ARRAY_SIZE: number; - readonly VERTEX_ATTRIB_ARRAY_STRIDE: number; - readonly VERTEX_ATTRIB_ARRAY_TYPE: number; - readonly VERTEX_SHADER: number; - readonly VIEWPORT: number; - readonly ZERO: number; -} - -interface WebGLShader extends WebGLObject { -} - -declare var WebGLShader: { - prototype: WebGLShader; - new(): WebGLShader; -} - -interface WebGLShaderPrecisionFormat { - readonly precision: number; - readonly rangeMax: number; - readonly rangeMin: number; -} - -declare var WebGLShaderPrecisionFormat: { - prototype: WebGLShaderPrecisionFormat; - new(): WebGLShaderPrecisionFormat; -} - -interface WebGLTexture extends WebGLObject { -} - -declare var WebGLTexture: { - prototype: WebGLTexture; - new(): WebGLTexture; -} - -interface WebGLUniformLocation { -} - -declare var WebGLUniformLocation: { - prototype: WebGLUniformLocation; - new(): WebGLUniformLocation; -} - -interface WebKitCSSMatrix { - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; - m11: number; - m12: number; - m13: number; - m14: number; - m21: number; - m22: number; - m23: number; - m24: number; - m31: number; - m32: number; - m33: number; - m34: number; - m41: number; - m42: number; - m43: number; - m44: number; - inverse(): WebKitCSSMatrix; - multiply(secondMatrix: WebKitCSSMatrix): WebKitCSSMatrix; - rotate(angleX: number, angleY?: number, angleZ?: number): WebKitCSSMatrix; - rotateAxisAngle(x: number, y: number, z: number, angle: number): WebKitCSSMatrix; - scale(scaleX: number, scaleY?: number, scaleZ?: number): WebKitCSSMatrix; - setMatrixValue(value: string): void; - skewX(angle: number): WebKitCSSMatrix; - skewY(angle: number): WebKitCSSMatrix; - toString(): string; - translate(x: number, y: number, z?: number): WebKitCSSMatrix; -} - -declare var WebKitCSSMatrix: { - prototype: WebKitCSSMatrix; - new(text?: string): WebKitCSSMatrix; -} - -interface WebKitPoint { - x: number; - y: number; -} - -declare var WebKitPoint: { - prototype: WebKitPoint; - new(x?: number, y?: number): WebKitPoint; -} - -interface WebSocketEventMap { - "close": CloseEvent; - "error": ErrorEvent; - "message": MessageEvent; - "open": Event; -} - -interface WebSocket extends EventTarget { - binaryType: string; - readonly bufferedAmount: number; - readonly extensions: string; - onclose: (this: WebSocket, ev: CloseEvent) => any; - onerror: (this: WebSocket, ev: ErrorEvent) => any; - onmessage: (this: WebSocket, ev: MessageEvent) => any; - onopen: (this: WebSocket, ev: Event) => any; - readonly protocol: string; - readonly readyState: number; - readonly url: string; - close(code?: number, reason?: string): void; - send(data: any): void; - readonly CLOSED: number; - readonly CLOSING: number; - readonly CONNECTING: number; - readonly OPEN: number; - addEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var WebSocket: { - prototype: WebSocket; - new(url: string, protocols?: string | string[]): WebSocket; - readonly CLOSED: number; - readonly CLOSING: number; - readonly CONNECTING: number; - readonly OPEN: number; -} - -interface WheelEvent extends MouseEvent { - readonly deltaMode: number; - readonly deltaX: number; - readonly deltaY: number; - readonly deltaZ: number; - readonly wheelDelta: number; - readonly wheelDeltaX: number; - readonly wheelDeltaY: number; - getCurrentPoint(element: Element): void; - initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; - readonly DOM_DELTA_LINE: number; - readonly DOM_DELTA_PAGE: number; - readonly DOM_DELTA_PIXEL: number; -} - -declare var WheelEvent: { - prototype: WheelEvent; - new(typeArg: string, eventInitDict?: WheelEventInit): WheelEvent; - readonly DOM_DELTA_LINE: number; - readonly DOM_DELTA_PAGE: number; - readonly DOM_DELTA_PIXEL: number; -} - -interface WindowEventMap extends GlobalEventHandlersEventMap { - "abort": UIEvent; - "afterprint": Event; - "beforeprint": Event; - "beforeunload": BeforeUnloadEvent; - "blur": FocusEvent; - "canplay": Event; - "canplaythrough": Event; - "change": Event; - "click": MouseEvent; - "compassneedscalibration": Event; - "contextmenu": PointerEvent; - "dblclick": MouseEvent; - "devicelight": DeviceLightEvent; - "devicemotion": DeviceMotionEvent; - "deviceorientation": DeviceOrientationEvent; - "drag": DragEvent; - "dragend": DragEvent; - "dragenter": DragEvent; - "dragleave": DragEvent; - "dragover": DragEvent; - "dragstart": DragEvent; - "drop": DragEvent; - "durationchange": Event; - "emptied": Event; - "ended": MediaStreamErrorEvent; - "focus": FocusEvent; - "hashchange": HashChangeEvent; - "input": Event; - "invalid": Event; - "keydown": KeyboardEvent; - "keypress": KeyboardEvent; - "keyup": KeyboardEvent; - "load": Event; - "loadeddata": Event; - "loadedmetadata": Event; - "loadstart": Event; - "message": MessageEvent; - "mousedown": MouseEvent; - "mouseenter": MouseEvent; - "mouseleave": MouseEvent; - "mousemove": MouseEvent; - "mouseout": MouseEvent; - "mouseover": MouseEvent; - "mouseup": MouseEvent; - "mousewheel": WheelEvent; - "MSGestureChange": MSGestureEvent; - "MSGestureDoubleTap": MSGestureEvent; - "MSGestureEnd": MSGestureEvent; - "MSGestureHold": MSGestureEvent; - "MSGestureStart": MSGestureEvent; - "MSGestureTap": MSGestureEvent; - "MSInertiaStart": MSGestureEvent; - "MSPointerCancel": MSPointerEvent; - "MSPointerDown": MSPointerEvent; - "MSPointerEnter": MSPointerEvent; - "MSPointerLeave": MSPointerEvent; - "MSPointerMove": MSPointerEvent; - "MSPointerOut": MSPointerEvent; - "MSPointerOver": MSPointerEvent; - "MSPointerUp": MSPointerEvent; - "offline": Event; - "online": Event; - "orientationchange": Event; - "pagehide": PageTransitionEvent; - "pageshow": PageTransitionEvent; - "pause": Event; - "play": Event; - "playing": Event; - "popstate": PopStateEvent; - "progress": ProgressEvent; - "ratechange": Event; - "readystatechange": ProgressEvent; - "reset": Event; - "resize": UIEvent; - "scroll": UIEvent; - "seeked": Event; - "seeking": Event; - "select": UIEvent; - "stalled": Event; - "storage": StorageEvent; - "submit": Event; - "suspend": Event; - "timeupdate": Event; - "unload": Event; - "volumechange": Event; - "waiting": Event; -} - -interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64 { - readonly applicationCache: ApplicationCache; - readonly clientInformation: Navigator; - readonly closed: boolean; - readonly crypto: Crypto; - defaultStatus: string; - readonly devicePixelRatio: number; - readonly doNotTrack: string; - readonly document: Document; - event: Event | undefined; - readonly external: External; - readonly frameElement: Element; - readonly frames: Window; - readonly history: History; - readonly innerHeight: number; - readonly innerWidth: number; - readonly length: number; - readonly location: Location; - readonly locationbar: BarProp; - readonly menubar: BarProp; - readonly msCredentials: MSCredentials; - name: string; - readonly navigator: Navigator; - offscreenBuffering: string | boolean; - onabort: (this: Window, ev: UIEvent) => any; - onafterprint: (this: Window, ev: Event) => any; - onbeforeprint: (this: Window, ev: Event) => any; - onbeforeunload: (this: Window, ev: BeforeUnloadEvent) => any; - onblur: (this: Window, ev: FocusEvent) => any; - oncanplay: (this: Window, ev: Event) => any; - oncanplaythrough: (this: Window, ev: Event) => any; - onchange: (this: Window, ev: Event) => any; - onclick: (this: Window, ev: MouseEvent) => any; - oncompassneedscalibration: (this: Window, ev: Event) => any; - oncontextmenu: (this: Window, ev: PointerEvent) => any; - ondblclick: (this: Window, ev: MouseEvent) => any; - ondevicelight: (this: Window, ev: DeviceLightEvent) => any; - ondevicemotion: (this: Window, ev: DeviceMotionEvent) => any; - ondeviceorientation: (this: Window, ev: DeviceOrientationEvent) => any; - ondrag: (this: Window, ev: DragEvent) => any; - ondragend: (this: Window, ev: DragEvent) => any; - ondragenter: (this: Window, ev: DragEvent) => any; - ondragleave: (this: Window, ev: DragEvent) => any; - ondragover: (this: Window, ev: DragEvent) => any; - ondragstart: (this: Window, ev: DragEvent) => any; - ondrop: (this: Window, ev: DragEvent) => any; - ondurationchange: (this: Window, ev: Event) => any; - onemptied: (this: Window, ev: Event) => any; - onended: (this: Window, ev: MediaStreamErrorEvent) => any; - onerror: ErrorEventHandler; - onfocus: (this: Window, ev: FocusEvent) => any; - onhashchange: (this: Window, ev: HashChangeEvent) => any; - oninput: (this: Window, ev: Event) => any; - oninvalid: (this: Window, ev: Event) => any; - onkeydown: (this: Window, ev: KeyboardEvent) => any; - onkeypress: (this: Window, ev: KeyboardEvent) => any; - onkeyup: (this: Window, ev: KeyboardEvent) => any; - onload: (this: Window, ev: Event) => any; - onloadeddata: (this: Window, ev: Event) => any; - onloadedmetadata: (this: Window, ev: Event) => any; - onloadstart: (this: Window, ev: Event) => any; - onmessage: (this: Window, ev: MessageEvent) => any; - onmousedown: (this: Window, ev: MouseEvent) => any; - onmouseenter: (this: Window, ev: MouseEvent) => any; - onmouseleave: (this: Window, ev: MouseEvent) => any; - onmousemove: (this: Window, ev: MouseEvent) => any; - onmouseout: (this: Window, ev: MouseEvent) => any; - onmouseover: (this: Window, ev: MouseEvent) => any; - onmouseup: (this: Window, ev: MouseEvent) => any; - onmousewheel: (this: Window, ev: WheelEvent) => any; - onmsgesturechange: (this: Window, ev: MSGestureEvent) => any; - onmsgesturedoubletap: (this: Window, ev: MSGestureEvent) => any; - onmsgestureend: (this: Window, ev: MSGestureEvent) => any; - onmsgesturehold: (this: Window, ev: MSGestureEvent) => any; - onmsgesturestart: (this: Window, ev: MSGestureEvent) => any; - onmsgesturetap: (this: Window, ev: MSGestureEvent) => any; - onmsinertiastart: (this: Window, ev: MSGestureEvent) => any; - onmspointercancel: (this: Window, ev: MSPointerEvent) => any; - onmspointerdown: (this: Window, ev: MSPointerEvent) => any; - onmspointerenter: (this: Window, ev: MSPointerEvent) => any; - onmspointerleave: (this: Window, ev: MSPointerEvent) => any; - onmspointermove: (this: Window, ev: MSPointerEvent) => any; - onmspointerout: (this: Window, ev: MSPointerEvent) => any; - onmspointerover: (this: Window, ev: MSPointerEvent) => any; - onmspointerup: (this: Window, ev: MSPointerEvent) => any; - onoffline: (this: Window, ev: Event) => any; - ononline: (this: Window, ev: Event) => any; - onorientationchange: (this: Window, ev: Event) => any; - onpagehide: (this: Window, ev: PageTransitionEvent) => any; - onpageshow: (this: Window, ev: PageTransitionEvent) => any; - onpause: (this: Window, ev: Event) => any; - onplay: (this: Window, ev: Event) => any; - onplaying: (this: Window, ev: Event) => any; - onpopstate: (this: Window, ev: PopStateEvent) => any; - onprogress: (this: Window, ev: ProgressEvent) => any; - onratechange: (this: Window, ev: Event) => any; - onreadystatechange: (this: Window, ev: ProgressEvent) => any; - onreset: (this: Window, ev: Event) => any; - onresize: (this: Window, ev: UIEvent) => any; - onscroll: (this: Window, ev: UIEvent) => any; - onseeked: (this: Window, ev: Event) => any; - onseeking: (this: Window, ev: Event) => any; - onselect: (this: Window, ev: UIEvent) => any; - onstalled: (this: Window, ev: Event) => any; - onstorage: (this: Window, ev: StorageEvent) => any; - onsubmit: (this: Window, ev: Event) => any; - onsuspend: (this: Window, ev: Event) => any; - ontimeupdate: (this: Window, ev: Event) => any; - ontouchcancel: (ev: TouchEvent) => any; - ontouchend: (ev: TouchEvent) => any; - ontouchmove: (ev: TouchEvent) => any; - ontouchstart: (ev: TouchEvent) => any; - onunload: (this: Window, ev: Event) => any; - onvolumechange: (this: Window, ev: Event) => any; - onwaiting: (this: Window, ev: Event) => any; - opener: any; - orientation: string | number; - readonly outerHeight: number; - readonly outerWidth: number; - readonly pageXOffset: number; - readonly pageYOffset: number; - readonly parent: Window; - readonly performance: Performance; - readonly personalbar: BarProp; - readonly screen: Screen; - readonly screenLeft: number; - readonly screenTop: number; - readonly screenX: number; - readonly screenY: number; - readonly scrollX: number; - readonly scrollY: number; - readonly scrollbars: BarProp; - readonly self: Window; - status: string; - readonly statusbar: BarProp; - readonly styleMedia: StyleMedia; - readonly toolbar: BarProp; - readonly top: Window; - readonly window: Window; - URL: typeof URL; - Blob: typeof Blob; - alert(message?: any): void; - blur(): void; - cancelAnimationFrame(handle: number): void; - captureEvents(): void; - close(): void; - confirm(message?: string): boolean; - focus(): void; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; - getSelection(): Selection; - matchMedia(mediaQuery: string): MediaQueryList; - moveBy(x?: number, y?: number): void; - moveTo(x?: number, y?: number): void; - msWriteProfilerMark(profilerMarkName: string): void; - open(url?: string, target?: string, features?: string, replace?: boolean): Window; - postMessage(message: any, targetOrigin: string, transfer?: any[]): void; - print(): void; - prompt(message?: string, _default?: string): string | null; - releaseEvents(): void; - requestAnimationFrame(callback: FrameRequestCallback): number; - resizeBy(x?: number, y?: number): void; - resizeTo(x?: number, y?: number): void; - scroll(x?: number, y?: number): void; - scrollBy(x?: number, y?: number): void; - scrollTo(x?: number, y?: number): void; - webkitCancelAnimationFrame(handle: number): void; - webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; - webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; - webkitRequestAnimationFrame(callback: FrameRequestCallback): number; - scroll(options?: ScrollToOptions): void; - scrollTo(options?: ScrollToOptions): void; - scrollBy(options?: ScrollToOptions): void; - addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Window: { - prototype: Window; - new(): Window; -} - -interface WorkerEventMap extends AbstractWorkerEventMap { - "message": MessageEvent; -} - -interface Worker extends EventTarget, AbstractWorker { - onmessage: (this: Worker, ev: MessageEvent) => any; - postMessage(message: any, ports?: any): void; - terminate(): void; - addEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Worker: { - prototype: Worker; - new(stringUrl: string): Worker; -} - -interface XMLDocument extends Document { - addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var XMLDocument: { - prototype: XMLDocument; - new(): XMLDocument; -} - -interface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap { - "readystatechange": Event; -} - -interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { - onreadystatechange: (this: XMLHttpRequest, ev: Event) => any; - readonly readyState: number; - readonly response: any; - readonly responseText: string; - responseType: string; - readonly responseXML: any; - readonly status: number; - readonly statusText: string; - timeout: number; - readonly upload: XMLHttpRequestUpload; - withCredentials: boolean; - msCaching?: string; - readonly responseURL: string; - abort(): void; - getAllResponseHeaders(): string; - getResponseHeader(header: string): string | null; - msCachingEnabled(): boolean; - open(method: string, url: string, async?: boolean, user?: string, password?: string): void; - overrideMimeType(mime: string): void; - send(data?: Document): void; - send(data?: string): void; - send(data?: any): void; - setRequestHeader(header: string, value: string): void; - readonly DONE: number; - readonly HEADERS_RECEIVED: number; - readonly LOADING: number; - readonly OPENED: number; - readonly UNSENT: number; - addEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var XMLHttpRequest: { - prototype: XMLHttpRequest; - new(): XMLHttpRequest; - readonly DONE: number; - readonly HEADERS_RECEIVED: number; - readonly LOADING: number; - readonly OPENED: number; - readonly UNSENT: number; - create(): XMLHttpRequest; -} - -interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget { - addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var XMLHttpRequestUpload: { - prototype: XMLHttpRequestUpload; - new(): XMLHttpRequestUpload; -} - -interface XMLSerializer { - serializeToString(target: Node): string; -} - -declare var XMLSerializer: { - prototype: XMLSerializer; - new(): XMLSerializer; -} - -interface XPathEvaluator { - createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; - createNSResolver(nodeResolver?: Node): XPathNSResolver; - evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult; -} - -declare var XPathEvaluator: { - prototype: XPathEvaluator; - new(): XPathEvaluator; -} - -interface XPathExpression { - evaluate(contextNode: Node, type: number, result: XPathResult | null): XPathResult; -} - -declare var XPathExpression: { - prototype: XPathExpression; - new(): XPathExpression; -} - -interface XPathNSResolver { - lookupNamespaceURI(prefix: string): string; -} - -declare var XPathNSResolver: { - prototype: XPathNSResolver; - new(): XPathNSResolver; -} - -interface XPathResult { - readonly booleanValue: boolean; - readonly invalidIteratorState: boolean; - readonly numberValue: number; - readonly resultType: number; - readonly singleNodeValue: Node; - readonly snapshotLength: number; - readonly stringValue: string; - iterateNext(): Node; - snapshotItem(index: number): Node; - readonly ANY_TYPE: number; - readonly ANY_UNORDERED_NODE_TYPE: number; - readonly BOOLEAN_TYPE: number; - readonly FIRST_ORDERED_NODE_TYPE: number; - readonly NUMBER_TYPE: number; - readonly ORDERED_NODE_ITERATOR_TYPE: number; - readonly ORDERED_NODE_SNAPSHOT_TYPE: number; - readonly STRING_TYPE: number; - readonly UNORDERED_NODE_ITERATOR_TYPE: number; - readonly UNORDERED_NODE_SNAPSHOT_TYPE: number; -} - -declare var XPathResult: { - prototype: XPathResult; - new(): XPathResult; - readonly ANY_TYPE: number; - readonly ANY_UNORDERED_NODE_TYPE: number; - readonly BOOLEAN_TYPE: number; - readonly FIRST_ORDERED_NODE_TYPE: number; - readonly NUMBER_TYPE: number; - readonly ORDERED_NODE_ITERATOR_TYPE: number; - readonly ORDERED_NODE_SNAPSHOT_TYPE: number; - readonly STRING_TYPE: number; - readonly UNORDERED_NODE_ITERATOR_TYPE: number; - readonly UNORDERED_NODE_SNAPSHOT_TYPE: number; -} - -interface XSLTProcessor { - clearParameters(): void; - getParameter(namespaceURI: string, localName: string): any; - importStylesheet(style: Node): void; - removeParameter(namespaceURI: string, localName: string): void; - reset(): void; - setParameter(namespaceURI: string, localName: string, value: any): void; - transformToDocument(source: Node): Document; - transformToFragment(source: Node, document: Document): DocumentFragment; -} - -declare var XSLTProcessor: { - prototype: XSLTProcessor; - new(): XSLTProcessor; -} - -interface AbstractWorkerEventMap { - "error": ErrorEvent; -} - -interface AbstractWorker { - onerror: (this: AbstractWorker, ev: ErrorEvent) => any; - addEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface CanvasPathMethods { - arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; - arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; - bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; - closePath(): void; - ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; - lineTo(x: number, y: number): void; - moveTo(x: number, y: number): void; - quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; - rect(x: number, y: number, w: number, h: number): void; -} - -interface ChildNode { - remove(): void; -} - -interface DOML2DeprecatedColorProperty { - color: string; -} - -interface DOML2DeprecatedSizeProperty { - size: number; -} - -interface DocumentEvent { - createEvent(eventInterface:"AnimationEvent"): AnimationEvent; - createEvent(eventInterface:"AriaRequestEvent"): AriaRequestEvent; - createEvent(eventInterface:"AudioProcessingEvent"): AudioProcessingEvent; - createEvent(eventInterface:"BeforeUnloadEvent"): BeforeUnloadEvent; - createEvent(eventInterface:"ClipboardEvent"): ClipboardEvent; - createEvent(eventInterface:"CloseEvent"): CloseEvent; - createEvent(eventInterface:"CommandEvent"): CommandEvent; - createEvent(eventInterface:"CompositionEvent"): CompositionEvent; - createEvent(eventInterface:"CustomEvent"): CustomEvent; - createEvent(eventInterface:"DeviceLightEvent"): DeviceLightEvent; - createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent; - createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent; - createEvent(eventInterface:"DragEvent"): DragEvent; - createEvent(eventInterface:"ErrorEvent"): ErrorEvent; - createEvent(eventInterface:"Event"): Event; - createEvent(eventInterface:"Events"): Event; - createEvent(eventInterface:"FocusEvent"): FocusEvent; - createEvent(eventInterface:"GamepadEvent"): GamepadEvent; - createEvent(eventInterface:"HashChangeEvent"): HashChangeEvent; - createEvent(eventInterface:"IDBVersionChangeEvent"): IDBVersionChangeEvent; - createEvent(eventInterface:"KeyboardEvent"): KeyboardEvent; - createEvent(eventInterface:"ListeningStateChangedEvent"): ListeningStateChangedEvent; - createEvent(eventInterface:"LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent; - createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; - createEvent(eventInterface:"MSManipulationEvent"): MSManipulationEvent; - createEvent(eventInterface:"MSMediaKeyMessageEvent"): MSMediaKeyMessageEvent; - createEvent(eventInterface:"MSMediaKeyNeededEvent"): MSMediaKeyNeededEvent; - createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; - createEvent(eventInterface:"MSSiteModeEvent"): MSSiteModeEvent; - createEvent(eventInterface:"MediaEncryptedEvent"): MediaEncryptedEvent; - createEvent(eventInterface:"MediaKeyMessageEvent"): MediaKeyMessageEvent; - createEvent(eventInterface:"MediaStreamErrorEvent"): MediaStreamErrorEvent; - createEvent(eventInterface:"MediaStreamTrackEvent"): MediaStreamTrackEvent; - createEvent(eventInterface:"MessageEvent"): MessageEvent; - createEvent(eventInterface:"MouseEvent"): MouseEvent; - createEvent(eventInterface:"MouseEvents"): MouseEvent; - createEvent(eventInterface:"MutationEvent"): MutationEvent; - createEvent(eventInterface:"MutationEvents"): MutationEvent; - createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent; - createEvent(eventInterface:"NavigationEvent"): NavigationEvent; - createEvent(eventInterface:"NavigationEventWithReferrer"): NavigationEventWithReferrer; - createEvent(eventInterface:"OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; - createEvent(eventInterface:"OverflowEvent"): OverflowEvent; - createEvent(eventInterface:"PageTransitionEvent"): PageTransitionEvent; - createEvent(eventInterface:"PermissionRequestedEvent"): PermissionRequestedEvent; - createEvent(eventInterface:"PointerEvent"): PointerEvent; - createEvent(eventInterface:"PopStateEvent"): PopStateEvent; - createEvent(eventInterface:"ProgressEvent"): ProgressEvent; - createEvent(eventInterface:"RTCDTMFToneChangeEvent"): RTCDTMFToneChangeEvent; - createEvent(eventInterface:"RTCDtlsTransportStateChangedEvent"): RTCDtlsTransportStateChangedEvent; - createEvent(eventInterface:"RTCIceCandidatePairChangedEvent"): RTCIceCandidatePairChangedEvent; - createEvent(eventInterface:"RTCIceGathererEvent"): RTCIceGathererEvent; - createEvent(eventInterface:"RTCIceTransportStateChangedEvent"): RTCIceTransportStateChangedEvent; - createEvent(eventInterface:"RTCSsrcConflictEvent"): RTCSsrcConflictEvent; - createEvent(eventInterface:"SVGZoomEvent"): SVGZoomEvent; - createEvent(eventInterface:"SVGZoomEvents"): SVGZoomEvent; - createEvent(eventInterface:"ScriptNotifyEvent"): ScriptNotifyEvent; - createEvent(eventInterface:"StorageEvent"): StorageEvent; - createEvent(eventInterface:"TextEvent"): TextEvent; - createEvent(eventInterface:"TouchEvent"): TouchEvent; - createEvent(eventInterface:"TrackEvent"): TrackEvent; - createEvent(eventInterface:"TransitionEvent"): TransitionEvent; - createEvent(eventInterface:"UIEvent"): UIEvent; - createEvent(eventInterface:"UIEvents"): UIEvent; - createEvent(eventInterface:"UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; - createEvent(eventInterface:"WebGLContextEvent"): WebGLContextEvent; - createEvent(eventInterface:"WheelEvent"): WheelEvent; - createEvent(eventInterface: string): Event; -} - -interface ElementTraversal { - readonly childElementCount: number; - readonly firstElementChild: Element; - readonly lastElementChild: Element; - readonly nextElementSibling: Element; - readonly previousElementSibling: Element; -} - -interface GetSVGDocument { - getSVGDocument(): Document; -} - -interface GlobalEventHandlersEventMap { - "pointercancel": PointerEvent; - "pointerdown": PointerEvent; - "pointerenter": PointerEvent; - "pointerleave": PointerEvent; - "pointermove": PointerEvent; - "pointerout": PointerEvent; - "pointerover": PointerEvent; - "pointerup": PointerEvent; - "wheel": WheelEvent; -} - -interface GlobalEventHandlers { - onpointercancel: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onpointerdown: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onpointerenter: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onpointerleave: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onpointermove: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onpointerout: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onpointerover: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onpointerup: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onwheel: (this: GlobalEventHandlers, ev: WheelEvent) => any; - addEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface HTMLTableAlignment { - /** - * Sets or retrieves a value that you can use to implement your own ch functionality for the object. - */ - ch: string; - /** - * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. - */ - chOff: string; - /** - * Sets or retrieves how text and other content are vertically aligned within the object that contains them. - */ - vAlign: string; -} - -interface IDBEnvironment { - readonly indexedDB: IDBFactory; -} - -interface LinkStyle { - readonly sheet: StyleSheet; -} - -interface MSBaseReaderEventMap { - "abort": Event; - "error": ErrorEvent; - "load": Event; - "loadend": ProgressEvent; - "loadstart": Event; - "progress": ProgressEvent; -} - -interface MSBaseReader { - onabort: (this: MSBaseReader, ev: Event) => any; - onerror: (this: MSBaseReader, ev: ErrorEvent) => any; - onload: (this: MSBaseReader, ev: Event) => any; - onloadend: (this: MSBaseReader, ev: ProgressEvent) => any; - onloadstart: (this: MSBaseReader, ev: Event) => any; - onprogress: (this: MSBaseReader, ev: ProgressEvent) => any; - readonly readyState: number; - readonly result: any; - abort(): void; - readonly DONE: number; - readonly EMPTY: number; - readonly LOADING: number; - addEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface MSFileSaver { - msSaveBlob(blob: any, defaultName?: string): boolean; - msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; -} - -interface MSNavigatorDoNotTrack { - confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; - confirmWebWideTrackingException(args: ExceptionInformation): boolean; - removeSiteSpecificTrackingException(args: ExceptionInformation): void; - removeWebWideTrackingException(args: ExceptionInformation): void; - storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; - storeWebWideTrackingException(args: StoreExceptionsInformation): void; -} - -interface NavigatorContentUtils { -} - -interface NavigatorGeolocation { - readonly geolocation: Geolocation; -} - -interface NavigatorID { - readonly appName: string; - readonly appVersion: string; - readonly platform: string; - readonly product: string; - readonly productSub: string; - readonly userAgent: string; - readonly vendor: string; - readonly vendorSub: string; -} - -interface NavigatorOnLine { - readonly onLine: boolean; -} - -interface NavigatorStorageUtils { -} - -interface NavigatorUserMedia { - readonly mediaDevices: MediaDevices; - getUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback): void; -} - -interface NodeSelector { - querySelector(selectors: K): ElementTagNameMap[K] | null; - querySelector(selectors: string): Element | null; - querySelectorAll(selectors: K): ElementListTagNameMap[K]; - querySelectorAll(selectors: string): NodeListOf; -} - -interface RandomSource { - getRandomValues(array: ArrayBufferView): ArrayBufferView; -} - -interface SVGAnimatedPathData { - readonly pathSegList: SVGPathSegList; -} - -interface SVGAnimatedPoints { - readonly animatedPoints: SVGPointList; - readonly points: SVGPointList; -} - -interface SVGExternalResourcesRequired { - readonly externalResourcesRequired: SVGAnimatedBoolean; -} - -interface SVGFilterPrimitiveStandardAttributes extends SVGStylable { - readonly height: SVGAnimatedLength; - readonly result: SVGAnimatedString; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; -} - -interface SVGFitToViewBox { - readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - readonly viewBox: SVGAnimatedRect; -} - -interface SVGLangSpace { - xmllang: string; - xmlspace: string; -} - -interface SVGLocatable { - readonly farthestViewportElement: SVGElement; - readonly nearestViewportElement: SVGElement; - getBBox(): SVGRect; - getCTM(): SVGMatrix; - getScreenCTM(): SVGMatrix; - getTransformToElement(element: SVGElement): SVGMatrix; -} - -interface SVGStylable { - className: any; - readonly style: CSSStyleDeclaration; -} - -interface SVGTests { - readonly requiredExtensions: SVGStringList; - readonly requiredFeatures: SVGStringList; - readonly systemLanguage: SVGStringList; - hasExtension(extension: string): boolean; -} - -interface SVGTransformable extends SVGLocatable { - readonly transform: SVGAnimatedTransformList; -} - -interface SVGURIReference { - readonly href: SVGAnimatedString; -} - -interface WindowBase64 { - atob(encodedString: string): string; - btoa(rawString: string): string; -} - -interface WindowConsole { - readonly console: Console; -} - -interface WindowLocalStorage { - readonly localStorage: Storage; -} - -interface WindowSessionStorage { - readonly sessionStorage: Storage; -} - -interface WindowTimers extends Object, WindowTimersExtension { - clearInterval(handle: number): void; - clearTimeout(handle: number): void; - setInterval(handler: (...args: any[]) => void, timeout: number): number; - setInterval(handler: any, timeout?: any, ...args: any[]): number; - setTimeout(handler: (...args: any[]) => void, timeout: number): number; - setTimeout(handler: any, timeout?: any, ...args: any[]): number; -} - -interface WindowTimersExtension { - clearImmediate(handle: number): void; - setImmediate(handler: (...args: any[]) => void): number; - setImmediate(handler: any, ...args: any[]): number; -} - -interface XMLHttpRequestEventTargetEventMap { - "abort": Event; - "error": ErrorEvent; - "load": Event; - "loadend": ProgressEvent; - "loadstart": Event; - "progress": ProgressEvent; - "timeout": ProgressEvent; -} - -interface XMLHttpRequestEventTarget { - onabort: (this: XMLHttpRequestEventTarget, ev: Event) => any; - onerror: (this: XMLHttpRequestEventTarget, ev: ErrorEvent) => any; - onload: (this: XMLHttpRequestEventTarget, ev: Event) => any; - onloadend: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; - onloadstart: (this: XMLHttpRequestEventTarget, ev: Event) => any; - onprogress: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; - ontimeout: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; - addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface StorageEventInit extends EventInit { - key?: string; - oldValue?: string; - newValue?: string; - url: string; - storageArea?: Storage; -} - -interface Canvas2DContextAttributes { - alpha?: boolean; - willReadFrequently?: boolean; - storage?: boolean; - [attribute: string]: boolean | string | undefined; -} - -interface NodeListOf extends NodeList { - length: number; - item(index: number): TNode; - [index: number]: TNode; -} - -interface HTMLCollectionOf extends HTMLCollection { - item(index: number): T; - namedItem(name: string): T; - [index: number]: T; -} - -interface BlobPropertyBag { - type?: string; - endings?: string; -} - -interface FilePropertyBag { - type?: string; - lastModified?: number; -} - -interface EventListenerObject { - handleEvent(evt: Event): void; -} - -interface MessageEventInit extends EventInit { - data?: any; - origin?: string; - lastEventId?: string; - channel?: string; - source?: any; - ports?: MessagePort[]; -} - -interface ProgressEventInit extends EventInit { - lengthComputable?: boolean; - loaded?: number; - total?: number; -} - -interface ScrollOptions { - behavior?: ScrollBehavior; -} - -interface ScrollToOptions extends ScrollOptions { - left?: number; - top?: number; -} - -interface ScrollIntoViewOptions extends ScrollOptions { - block?: ScrollLogicalPosition; - inline?: ScrollLogicalPosition; -} - -interface ClipboardEventInit extends EventInit { - data?: string; - dataType?: string; -} - -interface IDBArrayKey extends Array { -} - -interface RsaKeyGenParams extends Algorithm { - modulusLength: number; - publicExponent: Uint8Array; -} - -interface RsaHashedKeyGenParams extends RsaKeyGenParams { - hash: AlgorithmIdentifier; -} - -interface RsaKeyAlgorithm extends KeyAlgorithm { - modulusLength: number; - publicExponent: Uint8Array; -} - -interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { - hash: AlgorithmIdentifier; -} - -interface RsaHashedImportParams { - hash: AlgorithmIdentifier; -} - -interface RsaPssParams { - saltLength: number; -} - -interface RsaOaepParams extends Algorithm { - label?: BufferSource; -} - -interface EcdsaParams extends Algorithm { - hash: AlgorithmIdentifier; -} - -interface EcKeyGenParams extends Algorithm { - namedCurve: string; -} - -interface EcKeyAlgorithm extends KeyAlgorithm { - typedCurve: string; -} - -interface EcKeyImportParams { - namedCurve: string; -} - -interface EcdhKeyDeriveParams extends Algorithm { - public: CryptoKey; -} - -interface AesCtrParams extends Algorithm { - counter: BufferSource; - length: number; -} - -interface AesKeyAlgorithm extends KeyAlgorithm { - length: number; -} - -interface AesKeyGenParams extends Algorithm { - length: number; -} - -interface AesDerivedKeyParams extends Algorithm { - length: number; -} - -interface AesCbcParams extends Algorithm { - iv: BufferSource; -} - -interface AesCmacParams extends Algorithm { - length: number; -} - -interface AesGcmParams extends Algorithm { - iv: BufferSource; - additionalData?: BufferSource; - tagLength?: number; -} - -interface AesCfbParams extends Algorithm { - iv: BufferSource; -} - -interface HmacImportParams extends Algorithm { - hash?: AlgorithmIdentifier; - length?: number; -} - -interface HmacKeyAlgorithm extends KeyAlgorithm { - hash: AlgorithmIdentifier; - length: number; -} - -interface HmacKeyGenParams extends Algorithm { - hash: AlgorithmIdentifier; - length?: number; -} - -interface DhKeyGenParams extends Algorithm { - prime: Uint8Array; - generator: Uint8Array; -} - -interface DhKeyAlgorithm extends KeyAlgorithm { - prime: Uint8Array; - generator: Uint8Array; -} - -interface DhKeyDeriveParams extends Algorithm { - public: CryptoKey; -} - -interface DhImportKeyParams extends Algorithm { - prime: Uint8Array; - generator: Uint8Array; -} - -interface ConcatParams extends Algorithm { - hash?: AlgorithmIdentifier; - algorithmId: Uint8Array; - partyUInfo: Uint8Array; - partyVInfo: Uint8Array; - publicInfo?: Uint8Array; - privateInfo?: Uint8Array; -} - -interface HkdfCtrParams extends Algorithm { - hash: AlgorithmIdentifier; - label: BufferSource; - context: BufferSource; -} - -interface Pbkdf2Params extends Algorithm { - salt: BufferSource; - iterations: number; - hash: AlgorithmIdentifier; -} - -interface RsaOtherPrimesInfo { - r: string; - d: string; - t: string; -} - -interface JsonWebKey { - kty: string; - use?: string; - key_ops?: string[]; - alg?: string; - kid?: string; - x5u?: string; - x5c?: string; - x5t?: string; - ext?: boolean; - crv?: string; - x?: string; - y?: string; - d?: string; - n?: string; - e?: string; - p?: string; - q?: string; - dp?: string; - dq?: string; - qi?: string; - oth?: RsaOtherPrimesInfo[]; - k?: string; -} - -interface ParentNode { - readonly children: HTMLCollection; - readonly firstElementChild: Element; - readonly lastElementChild: Element; - readonly childElementCount: number; -} - -interface DocumentOrShadowRoot { - readonly activeElement: Element | null; - readonly stylesheets: StyleSheetList; - getSelection(): Selection | null; - elementFromPoint(x: number, y: number): Element | null; - elementsFromPoint(x: number, y: number): Element[]; -} - -interface ShadowRoot extends DocumentOrShadowRoot, DocumentFragment { - readonly host: Element; - innerHTML: string; -} - -interface ShadowRootInit { - mode: 'open'|'closed'; - delegatesFocus?: boolean; -} - -interface HTMLSlotElement extends HTMLElement { - name: string; - assignedNodes(options?: AssignedNodesOptions): Node[]; -} - -interface AssignedNodesOptions { - flatten?: boolean; -} - -declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; - -interface ErrorEventHandler { - (message: string, filename?: string, lineno?: number, colno?: number, error?:Error): void; -} -interface PositionCallback { - (position: Position): void; -} -interface PositionErrorCallback { - (error: PositionError): void; -} -interface MediaQueryListListener { - (mql: MediaQueryList): void; -} -interface MSLaunchUriCallback { - (): void; -} -interface FrameRequestCallback { - (time: number): void; -} -interface MSUnsafeFunctionCallback { - (): any; -} -interface MSExecAtPriorityFunctionCallback { - (...args: any[]): any; -} -interface MutationCallback { - (mutations: MutationRecord[], observer: MutationObserver): void; -} -interface DecodeSuccessCallback { - (decodedData: AudioBuffer): void; -} -interface DecodeErrorCallback { - (error: DOMException): void; -} -interface FunctionStringCallback { - (data: string): void; -} -interface NavigatorUserMediaSuccessCallback { - (stream: MediaStream): void; -} -interface NavigatorUserMediaErrorCallback { - (error: MediaStreamError): void; -} -interface ForEachCallback { - (keyId: any, status: string): void; -} -interface HTMLElementTagNameMap { - "a": HTMLAnchorElement; - "applet": HTMLAppletElement; - "area": HTMLAreaElement; - "audio": HTMLAudioElement; - "base": HTMLBaseElement; - "basefont": HTMLBaseFontElement; - "blockquote": HTMLQuoteElement; - "body": HTMLBodyElement; - "br": HTMLBRElement; - "button": HTMLButtonElement; - "canvas": HTMLCanvasElement; - "caption": HTMLTableCaptionElement; - "col": HTMLTableColElement; - "colgroup": HTMLTableColElement; - "datalist": HTMLDataListElement; - "del": HTMLModElement; - "dir": HTMLDirectoryElement; - "div": HTMLDivElement; - "dl": HTMLDListElement; - "embed": HTMLEmbedElement; - "fieldset": HTMLFieldSetElement; - "font": HTMLFontElement; - "form": HTMLFormElement; - "frame": HTMLFrameElement; - "frameset": HTMLFrameSetElement; - "h1": HTMLHeadingElement; - "h2": HTMLHeadingElement; - "h3": HTMLHeadingElement; - "h4": HTMLHeadingElement; - "h5": HTMLHeadingElement; - "h6": HTMLHeadingElement; - "head": HTMLHeadElement; - "hr": HTMLHRElement; - "html": HTMLHtmlElement; - "iframe": HTMLIFrameElement; - "img": HTMLImageElement; - "input": HTMLInputElement; - "ins": HTMLModElement; - "isindex": HTMLUnknownElement; - "label": HTMLLabelElement; - "legend": HTMLLegendElement; - "li": HTMLLIElement; - "link": HTMLLinkElement; - "listing": HTMLPreElement; - "map": HTMLMapElement; - "marquee": HTMLMarqueeElement; - "menu": HTMLMenuElement; - "meta": HTMLMetaElement; - "meter": HTMLMeterElement; - "nextid": HTMLUnknownElement; - "object": HTMLObjectElement; - "ol": HTMLOListElement; - "optgroup": HTMLOptGroupElement; - "option": HTMLOptionElement; - "p": HTMLParagraphElement; - "param": HTMLParamElement; - "picture": HTMLPictureElement; - "pre": HTMLPreElement; - "progress": HTMLProgressElement; - "q": HTMLQuoteElement; - "script": HTMLScriptElement; - "select": HTMLSelectElement; - "source": HTMLSourceElement; - "span": HTMLSpanElement; - "style": HTMLStyleElement; - "table": HTMLTableElement; - "tbody": HTMLTableSectionElement; - "td": HTMLTableDataCellElement; - "template": HTMLTemplateElement; - "textarea": HTMLTextAreaElement; - "tfoot": HTMLTableSectionElement; - "th": HTMLTableHeaderCellElement; - "thead": HTMLTableSectionElement; - "title": HTMLTitleElement; - "tr": HTMLTableRowElement; - "track": HTMLTrackElement; - "ul": HTMLUListElement; - "video": HTMLVideoElement; - "x-ms-webview": MSHTMLWebViewElement; - "xmp": HTMLPreElement; -} - -interface ElementTagNameMap { - "a": HTMLAnchorElement; - "abbr": HTMLElement; - "acronym": HTMLElement; - "address": HTMLElement; - "applet": HTMLAppletElement; - "area": HTMLAreaElement; - "article": HTMLElement; - "aside": HTMLElement; - "audio": HTMLAudioElement; - "b": HTMLElement; - "base": HTMLBaseElement; - "basefont": HTMLBaseFontElement; - "bdo": HTMLElement; - "big": HTMLElement; - "blockquote": HTMLQuoteElement; - "body": HTMLBodyElement; - "br": HTMLBRElement; - "button": HTMLButtonElement; - "canvas": HTMLCanvasElement; - "caption": HTMLTableCaptionElement; - "center": HTMLElement; - "circle": SVGCircleElement; - "cite": HTMLElement; - "clippath": SVGClipPathElement; - "code": HTMLElement; - "col": HTMLTableColElement; - "colgroup": HTMLTableColElement; - "datalist": HTMLDataListElement; - "dd": HTMLElement; - "defs": SVGDefsElement; - "del": HTMLModElement; - "desc": SVGDescElement; - "dfn": HTMLElement; - "dir": HTMLDirectoryElement; - "div": HTMLDivElement; - "dl": HTMLDListElement; - "dt": HTMLElement; - "ellipse": SVGEllipseElement; - "em": HTMLElement; - "embed": HTMLEmbedElement; - "feblend": SVGFEBlendElement; - "fecolormatrix": SVGFEColorMatrixElement; - "fecomponenttransfer": SVGFEComponentTransferElement; - "fecomposite": SVGFECompositeElement; - "feconvolvematrix": SVGFEConvolveMatrixElement; - "fediffuselighting": SVGFEDiffuseLightingElement; - "fedisplacementmap": SVGFEDisplacementMapElement; - "fedistantlight": SVGFEDistantLightElement; - "feflood": SVGFEFloodElement; - "fefunca": SVGFEFuncAElement; - "fefuncb": SVGFEFuncBElement; - "fefuncg": SVGFEFuncGElement; - "fefuncr": SVGFEFuncRElement; - "fegaussianblur": SVGFEGaussianBlurElement; - "feimage": SVGFEImageElement; - "femerge": SVGFEMergeElement; - "femergenode": SVGFEMergeNodeElement; - "femorphology": SVGFEMorphologyElement; - "feoffset": SVGFEOffsetElement; - "fepointlight": SVGFEPointLightElement; - "fespecularlighting": SVGFESpecularLightingElement; - "fespotlight": SVGFESpotLightElement; - "fetile": SVGFETileElement; - "feturbulence": SVGFETurbulenceElement; - "fieldset": HTMLFieldSetElement; - "figcaption": HTMLElement; - "figure": HTMLElement; - "filter": SVGFilterElement; - "font": HTMLFontElement; - "footer": HTMLElement; - "foreignobject": SVGForeignObjectElement; - "form": HTMLFormElement; - "frame": HTMLFrameElement; - "frameset": HTMLFrameSetElement; - "g": SVGGElement; - "h1": HTMLHeadingElement; - "h2": HTMLHeadingElement; - "h3": HTMLHeadingElement; - "h4": HTMLHeadingElement; - "h5": HTMLHeadingElement; - "h6": HTMLHeadingElement; - "head": HTMLHeadElement; - "header": HTMLElement; - "hgroup": HTMLElement; - "hr": HTMLHRElement; - "html": HTMLHtmlElement; - "i": HTMLElement; - "iframe": HTMLIFrameElement; - "image": SVGImageElement; - "img": HTMLImageElement; - "input": HTMLInputElement; - "ins": HTMLModElement; - "isindex": HTMLUnknownElement; - "kbd": HTMLElement; - "keygen": HTMLElement; - "label": HTMLLabelElement; - "legend": HTMLLegendElement; - "li": HTMLLIElement; - "line": SVGLineElement; - "lineargradient": SVGLinearGradientElement; - "link": HTMLLinkElement; - "listing": HTMLPreElement; - "map": HTMLMapElement; - "mark": HTMLElement; - "marker": SVGMarkerElement; - "marquee": HTMLMarqueeElement; - "mask": SVGMaskElement; - "menu": HTMLMenuElement; - "meta": HTMLMetaElement; - "metadata": SVGMetadataElement; - "meter": HTMLMeterElement; - "nav": HTMLElement; - "nextid": HTMLUnknownElement; - "nobr": HTMLElement; - "noframes": HTMLElement; - "noscript": HTMLElement; - "object": HTMLObjectElement; - "ol": HTMLOListElement; - "optgroup": HTMLOptGroupElement; - "option": HTMLOptionElement; - "p": HTMLParagraphElement; - "param": HTMLParamElement; - "path": SVGPathElement; - "pattern": SVGPatternElement; - "picture": HTMLPictureElement; - "plaintext": HTMLElement; - "polygon": SVGPolygonElement; - "polyline": SVGPolylineElement; - "pre": HTMLPreElement; - "progress": HTMLProgressElement; - "q": HTMLQuoteElement; - "radialgradient": SVGRadialGradientElement; - "rect": SVGRectElement; - "rt": HTMLElement; - "ruby": HTMLElement; - "s": HTMLElement; - "samp": HTMLElement; - "script": HTMLScriptElement; - "section": HTMLElement; - "select": HTMLSelectElement; - "small": HTMLElement; - "source": HTMLSourceElement; - "span": HTMLSpanElement; - "stop": SVGStopElement; - "strike": HTMLElement; - "strong": HTMLElement; - "style": HTMLStyleElement; - "sub": HTMLElement; - "sup": HTMLElement; - "svg": SVGSVGElement; - "switch": SVGSwitchElement; - "symbol": SVGSymbolElement; - "table": HTMLTableElement; - "tbody": HTMLTableSectionElement; - "td": HTMLTableDataCellElement; - "template": HTMLTemplateElement; - "text": SVGTextElement; - "textpath": SVGTextPathElement; - "textarea": HTMLTextAreaElement; - "tfoot": HTMLTableSectionElement; - "th": HTMLTableHeaderCellElement; - "thead": HTMLTableSectionElement; - "title": HTMLTitleElement; - "tr": HTMLTableRowElement; - "track": HTMLTrackElement; - "tspan": SVGTSpanElement; - "tt": HTMLElement; - "u": HTMLElement; - "ul": HTMLUListElement; - "use": SVGUseElement; - "var": HTMLElement; - "video": HTMLVideoElement; - "view": SVGViewElement; - "wbr": HTMLElement; - "x-ms-webview": MSHTMLWebViewElement; - "xmp": HTMLPreElement; -} - -interface ElementListTagNameMap { - "a": NodeListOf; - "abbr": NodeListOf; - "acronym": NodeListOf; - "address": NodeListOf; - "applet": NodeListOf; - "area": NodeListOf; - "article": NodeListOf; - "aside": NodeListOf; - "audio": NodeListOf; - "b": NodeListOf; - "base": NodeListOf; - "basefont": NodeListOf; - "bdo": NodeListOf; - "big": NodeListOf; - "blockquote": NodeListOf; - "body": NodeListOf; - "br": NodeListOf; - "button": NodeListOf; - "canvas": NodeListOf; - "caption": NodeListOf; - "center": NodeListOf; - "circle": NodeListOf; - "cite": NodeListOf; - "clippath": NodeListOf; - "code": NodeListOf; - "col": NodeListOf; - "colgroup": NodeListOf; - "datalist": NodeListOf; - "dd": NodeListOf; - "defs": NodeListOf; - "del": NodeListOf; - "desc": NodeListOf; - "dfn": NodeListOf; - "dir": NodeListOf; - "div": NodeListOf; - "dl": NodeListOf; - "dt": NodeListOf; - "ellipse": NodeListOf; - "em": NodeListOf; - "embed": NodeListOf; - "feblend": NodeListOf; - "fecolormatrix": NodeListOf; - "fecomponenttransfer": NodeListOf; - "fecomposite": NodeListOf; - "feconvolvematrix": NodeListOf; - "fediffuselighting": NodeListOf; - "fedisplacementmap": NodeListOf; - "fedistantlight": NodeListOf; - "feflood": NodeListOf; - "fefunca": NodeListOf; - "fefuncb": NodeListOf; - "fefuncg": NodeListOf; - "fefuncr": NodeListOf; - "fegaussianblur": NodeListOf; - "feimage": NodeListOf; - "femerge": NodeListOf; - "femergenode": NodeListOf; - "femorphology": NodeListOf; - "feoffset": NodeListOf; - "fepointlight": NodeListOf; - "fespecularlighting": NodeListOf; - "fespotlight": NodeListOf; - "fetile": NodeListOf; - "feturbulence": NodeListOf; - "fieldset": NodeListOf; - "figcaption": NodeListOf; - "figure": NodeListOf; - "filter": NodeListOf; - "font": NodeListOf; - "footer": NodeListOf; - "foreignobject": NodeListOf; - "form": NodeListOf; - "frame": NodeListOf; - "frameset": NodeListOf; - "g": NodeListOf; - "h1": NodeListOf; - "h2": NodeListOf; - "h3": NodeListOf; - "h4": NodeListOf; - "h5": NodeListOf; - "h6": NodeListOf; - "head": NodeListOf; - "header": NodeListOf; - "hgroup": NodeListOf; - "hr": NodeListOf; - "html": NodeListOf; - "i": NodeListOf; - "iframe": NodeListOf; - "image": NodeListOf; - "img": NodeListOf; - "input": NodeListOf; - "ins": NodeListOf; - "isindex": NodeListOf; - "kbd": NodeListOf; - "keygen": NodeListOf; - "label": NodeListOf; - "legend": NodeListOf; - "li": NodeListOf; - "line": NodeListOf; - "lineargradient": NodeListOf; - "link": NodeListOf; - "listing": NodeListOf; - "map": NodeListOf; - "mark": NodeListOf; - "marker": NodeListOf; - "marquee": NodeListOf; - "mask": NodeListOf; - "menu": NodeListOf; - "meta": NodeListOf; - "metadata": NodeListOf; - "meter": NodeListOf; - "nav": NodeListOf; - "nextid": NodeListOf; - "nobr": NodeListOf; - "noframes": NodeListOf; - "noscript": NodeListOf; - "object": NodeListOf; - "ol": NodeListOf; - "optgroup": NodeListOf; - "option": NodeListOf; - "p": NodeListOf; - "param": NodeListOf; - "path": NodeListOf; - "pattern": NodeListOf; - "picture": NodeListOf; - "plaintext": NodeListOf; - "polygon": NodeListOf; - "polyline": NodeListOf; - "pre": NodeListOf; - "progress": NodeListOf; - "q": NodeListOf; - "radialgradient": NodeListOf; - "rect": NodeListOf; - "rt": NodeListOf; - "ruby": NodeListOf; - "s": NodeListOf; - "samp": NodeListOf; - "script": NodeListOf; - "section": NodeListOf; - "select": NodeListOf; - "small": NodeListOf; - "source": NodeListOf; - "span": NodeListOf; - "stop": NodeListOf; - "strike": NodeListOf; - "strong": NodeListOf; - "style": NodeListOf; - "sub": NodeListOf; - "sup": NodeListOf; - "svg": NodeListOf; - "switch": NodeListOf; - "symbol": NodeListOf; - "table": NodeListOf; - "tbody": NodeListOf; - "td": NodeListOf; - "template": NodeListOf; - "text": NodeListOf; - "textpath": NodeListOf; - "textarea": NodeListOf; - "tfoot": NodeListOf; - "th": NodeListOf; - "thead": NodeListOf; - "title": NodeListOf; - "tr": NodeListOf; - "track": NodeListOf; - "tspan": NodeListOf; - "tt": NodeListOf; - "u": NodeListOf; - "ul": NodeListOf; - "use": NodeListOf; - "var": NodeListOf; - "video": NodeListOf; - "view": NodeListOf; - "wbr": NodeListOf; - "x-ms-webview": NodeListOf; - "xmp": NodeListOf; -} - -declare var Audio: {new(src?: string): HTMLAudioElement; }; -declare var Image: {new(width?: number, height?: number): HTMLImageElement; }; -declare var Option: {new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; }; -declare var applicationCache: ApplicationCache; -declare var clientInformation: Navigator; -declare var closed: boolean; -declare var crypto: Crypto; -declare var defaultStatus: string; -declare var devicePixelRatio: number; -declare var doNotTrack: string; -declare var document: Document; -declare var event: Event | undefined; -declare var external: External; -declare var frameElement: Element; -declare var frames: Window; -declare var history: History; -declare var innerHeight: number; -declare var innerWidth: number; -declare var length: number; -declare var location: Location; -declare var locationbar: BarProp; -declare var menubar: BarProp; -declare var msCredentials: MSCredentials; -declare const name: never; -declare var navigator: Navigator; -declare var offscreenBuffering: string | boolean; -declare var onabort: (this: Window, ev: UIEvent) => any; -declare var onafterprint: (this: Window, ev: Event) => any; -declare var onbeforeprint: (this: Window, ev: Event) => any; -declare var onbeforeunload: (this: Window, ev: BeforeUnloadEvent) => any; -declare var onblur: (this: Window, ev: FocusEvent) => any; -declare var oncanplay: (this: Window, ev: Event) => any; -declare var oncanplaythrough: (this: Window, ev: Event) => any; -declare var onchange: (this: Window, ev: Event) => any; -declare var onclick: (this: Window, ev: MouseEvent) => any; -declare var oncompassneedscalibration: (this: Window, ev: Event) => any; -declare var oncontextmenu: (this: Window, ev: PointerEvent) => any; -declare var ondblclick: (this: Window, ev: MouseEvent) => any; -declare var ondevicelight: (this: Window, ev: DeviceLightEvent) => any; -declare var ondevicemotion: (this: Window, ev: DeviceMotionEvent) => any; -declare var ondeviceorientation: (this: Window, ev: DeviceOrientationEvent) => any; -declare var ondrag: (this: Window, ev: DragEvent) => any; -declare var ondragend: (this: Window, ev: DragEvent) => any; -declare var ondragenter: (this: Window, ev: DragEvent) => any; -declare var ondragleave: (this: Window, ev: DragEvent) => any; -declare var ondragover: (this: Window, ev: DragEvent) => any; -declare var ondragstart: (this: Window, ev: DragEvent) => any; -declare var ondrop: (this: Window, ev: DragEvent) => any; -declare var ondurationchange: (this: Window, ev: Event) => any; -declare var onemptied: (this: Window, ev: Event) => any; -declare var onended: (this: Window, ev: MediaStreamErrorEvent) => any; -declare var onerror: ErrorEventHandler; -declare var onfocus: (this: Window, ev: FocusEvent) => any; -declare var onhashchange: (this: Window, ev: HashChangeEvent) => any; -declare var oninput: (this: Window, ev: Event) => any; -declare var oninvalid: (this: Window, ev: Event) => any; -declare var onkeydown: (this: Window, ev: KeyboardEvent) => any; -declare var onkeypress: (this: Window, ev: KeyboardEvent) => any; -declare var onkeyup: (this: Window, ev: KeyboardEvent) => any; -declare var onload: (this: Window, ev: Event) => any; -declare var onloadeddata: (this: Window, ev: Event) => any; -declare var onloadedmetadata: (this: Window, ev: Event) => any; -declare var onloadstart: (this: Window, ev: Event) => any; -declare var onmessage: (this: Window, ev: MessageEvent) => any; -declare var onmousedown: (this: Window, ev: MouseEvent) => any; -declare var onmouseenter: (this: Window, ev: MouseEvent) => any; -declare var onmouseleave: (this: Window, ev: MouseEvent) => any; -declare var onmousemove: (this: Window, ev: MouseEvent) => any; -declare var onmouseout: (this: Window, ev: MouseEvent) => any; -declare var onmouseover: (this: Window, ev: MouseEvent) => any; -declare var onmouseup: (this: Window, ev: MouseEvent) => any; -declare var onmousewheel: (this: Window, ev: WheelEvent) => any; -declare var onmsgesturechange: (this: Window, ev: MSGestureEvent) => any; -declare var onmsgesturedoubletap: (this: Window, ev: MSGestureEvent) => any; -declare var onmsgestureend: (this: Window, ev: MSGestureEvent) => any; -declare var onmsgesturehold: (this: Window, ev: MSGestureEvent) => any; -declare var onmsgesturestart: (this: Window, ev: MSGestureEvent) => any; -declare var onmsgesturetap: (this: Window, ev: MSGestureEvent) => any; -declare var onmsinertiastart: (this: Window, ev: MSGestureEvent) => any; -declare var onmspointercancel: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerdown: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerenter: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerleave: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointermove: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerout: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerover: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerup: (this: Window, ev: MSPointerEvent) => any; -declare var onoffline: (this: Window, ev: Event) => any; -declare var ononline: (this: Window, ev: Event) => any; -declare var onorientationchange: (this: Window, ev: Event) => any; -declare var onpagehide: (this: Window, ev: PageTransitionEvent) => any; -declare var onpageshow: (this: Window, ev: PageTransitionEvent) => any; -declare var onpause: (this: Window, ev: Event) => any; -declare var onplay: (this: Window, ev: Event) => any; -declare var onplaying: (this: Window, ev: Event) => any; -declare var onpopstate: (this: Window, ev: PopStateEvent) => any; -declare var onprogress: (this: Window, ev: ProgressEvent) => any; -declare var onratechange: (this: Window, ev: Event) => any; -declare var onreadystatechange: (this: Window, ev: ProgressEvent) => any; -declare var onreset: (this: Window, ev: Event) => any; -declare var onresize: (this: Window, ev: UIEvent) => any; -declare var onscroll: (this: Window, ev: UIEvent) => any; -declare var onseeked: (this: Window, ev: Event) => any; -declare var onseeking: (this: Window, ev: Event) => any; -declare var onselect: (this: Window, ev: UIEvent) => any; -declare var onstalled: (this: Window, ev: Event) => any; -declare var onstorage: (this: Window, ev: StorageEvent) => any; -declare var onsubmit: (this: Window, ev: Event) => any; -declare var onsuspend: (this: Window, ev: Event) => any; -declare var ontimeupdate: (this: Window, ev: Event) => any; -declare var ontouchcancel: (ev: TouchEvent) => any; -declare var ontouchend: (ev: TouchEvent) => any; -declare var ontouchmove: (ev: TouchEvent) => any; -declare var ontouchstart: (ev: TouchEvent) => any; -declare var onunload: (this: Window, ev: Event) => any; -declare var onvolumechange: (this: Window, ev: Event) => any; -declare var onwaiting: (this: Window, ev: Event) => any; -declare var opener: any; -declare var orientation: string | number; -declare var outerHeight: number; -declare var outerWidth: number; -declare var pageXOffset: number; -declare var pageYOffset: number; -declare var parent: Window; -declare var performance: Performance; -declare var personalbar: BarProp; -declare var screen: Screen; -declare var screenLeft: number; -declare var screenTop: number; -declare var screenX: number; -declare var screenY: number; -declare var scrollX: number; -declare var scrollY: number; -declare var scrollbars: BarProp; -declare var self: Window; -declare var status: string; -declare var statusbar: BarProp; -declare var styleMedia: StyleMedia; -declare var toolbar: BarProp; -declare var top: Window; -declare var window: Window; -declare function alert(message?: any): void; -declare function blur(): void; -declare function cancelAnimationFrame(handle: number): void; -declare function captureEvents(): void; -declare function close(): void; -declare function confirm(message?: string): boolean; -declare function focus(): void; -declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; -declare function getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; -declare function getSelection(): Selection; -declare function matchMedia(mediaQuery: string): MediaQueryList; -declare function moveBy(x?: number, y?: number): void; -declare function moveTo(x?: number, y?: number): void; -declare function msWriteProfilerMark(profilerMarkName: string): void; -declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window; -declare function postMessage(message: any, targetOrigin: string, transfer?: any[]): void; -declare function print(): void; -declare function prompt(message?: string, _default?: string): string | null; -declare function releaseEvents(): void; -declare function requestAnimationFrame(callback: FrameRequestCallback): number; -declare function resizeBy(x?: number, y?: number): void; -declare function resizeTo(x?: number, y?: number): void; -declare function scroll(x?: number, y?: number): void; -declare function scrollBy(x?: number, y?: number): void; -declare function scrollTo(x?: number, y?: number): void; -declare function webkitCancelAnimationFrame(handle: number): void; -declare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; -declare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; -declare function webkitRequestAnimationFrame(callback: FrameRequestCallback): number; -declare function scroll(options?: ScrollToOptions): void; -declare function scrollTo(options?: ScrollToOptions): void; -declare function scrollBy(options?: ScrollToOptions): void; -declare function toString(): string; -declare function dispatchEvent(evt: Event): boolean; -declare function removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void; -declare function clearInterval(handle: number): void; -declare function clearTimeout(handle: number): void; -declare function setInterval(handler: (...args: any[]) => void, timeout: number): number; -declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; -declare function setTimeout(handler: (...args: any[]) => void, timeout: number): number; -declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; -declare function clearImmediate(handle: number): void; -declare function setImmediate(handler: (...args: any[]) => void): number; -declare function setImmediate(handler: any, ...args: any[]): number; -declare var sessionStorage: Storage; -declare var localStorage: Storage; -declare var console: Console; -declare var onpointercancel: (this: Window, ev: PointerEvent) => any; -declare var onpointerdown: (this: Window, ev: PointerEvent) => any; -declare var onpointerenter: (this: Window, ev: PointerEvent) => any; -declare var onpointerleave: (this: Window, ev: PointerEvent) => any; -declare var onpointermove: (this: Window, ev: PointerEvent) => any; -declare var onpointerout: (this: Window, ev: PointerEvent) => any; -declare var onpointerover: (this: Window, ev: PointerEvent) => any; -declare var onpointerup: (this: Window, ev: PointerEvent) => any; -declare var onwheel: (this: Window, ev: WheelEvent) => any; -declare var indexedDB: IDBFactory; -declare function atob(encodedString: string): string; -declare function btoa(rawString: string): string; -declare function addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, useCapture?: boolean): void; -declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -type AAGUID = string; -type AlgorithmIdentifier = string | Algorithm; -type ConstrainBoolean = boolean | ConstrainBooleanParameters; -type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters; -type ConstrainDouble = number | ConstrainDoubleRange; -type ConstrainLong = number | ConstrainLongRange; -type CryptoOperationData = ArrayBufferView; -type GLbitfield = number; -type GLboolean = boolean; -type GLbyte = number; -type GLclampf = number; -type GLenum = number; -type GLfloat = number; -type GLint = number; -type GLintptr = number; -type GLshort = number; -type GLsizei = number; -type GLsizeiptr = number; -type GLubyte = number; -type GLuint = number; -type GLushort = number; -type IDBKeyPath = string; -type KeyFormat = string; -type KeyType = string; -type KeyUsage = string; -type MSInboundPayload = MSVideoRecvPayload | MSAudioRecvPayload; -type MSLocalClientEvent = MSLocalClientEventBase | MSAudioLocalClientEvent; -type MSOutboundPayload = MSVideoSendPayload | MSAudioSendPayload; -type RTCIceGatherCandidate = RTCIceCandidate | RTCIceCandidateComplete; -type RTCTransport = RTCDtlsTransport | RTCSrtpSdesTransport; -type payloadtype = number; -type ScrollBehavior = "auto" | "instant" | "smooth"; -type ScrollLogicalPosition = "start" | "center" | "end" | "nearest"; -type IDBValidKey = number | string | Date | IDBArrayKey; -type BufferSource = ArrayBuffer | ArrayBufferView; -type MouseWheelEvent = WheelEvent; +///////////////////////////// +/// ECMAScript Array API (specially handled by compiler) +///////////////////////////// + +interface ReadonlyArray { + /** + * Gets the length of the array. This is a number one higher than the highest element defined in an array. + */ + readonly length: number; + /** + * Returns a string representation of an array. + */ + toString(): string; + toLocaleString(): string; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat>(...items: U[]): T[]; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: T[][]): T[]; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: (T | T[])[]): T[]; + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): T[]; + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. + */ + indexOf(searchElement: T, fromIndex?: number): number; + + /** + * Returns the index of the last occurrence of a specified value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. + */ + lastIndexOf(searchElement: T, fromIndex?: number): number; + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => boolean): boolean; + every(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => boolean, thisArg: Z): boolean; + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => boolean): boolean; + some(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => boolean, thisArg: Z): boolean; + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => void): void; + forEach(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => void, thisArg: Z): void; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => U): U[]; + map(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => U, thisArg: undefined): U[]; + map(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => U, thisArg: Z): U[]; + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => value is S): S[]; + filter(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => value is S, thisArg: undefined): S[]; + filter(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => value is S, thisArg: Z): S[]; + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => any): T[]; + filter(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => any, thisArg: undefined): T[]; + filter(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => any, thisArg: Z): T[]; + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue?: T): T; + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U; + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue?: T): T; + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U; + + readonly [n: number]: T; +} + +interface Array { + /** + * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. + */ + length: number; + /** + * Returns a string representation of an array. + */ + toString(): string; + toLocaleString(): string; + /** + * Appends new elements to an array, and returns the new length of the array. + * @param items New elements of the Array. + */ + push(...items: T[]): number; + /** + * Removes the last element from an array and returns it. + */ + pop(): T | undefined; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: T[][]): T[]; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: (T | T[])[]): T[]; + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + /** + * Reverses the elements in an Array. + */ + reverse(): T[]; + /** + * Removes the first element from an array and returns it. + */ + shift(): T | undefined; + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): T[]; + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: T, b: T) => number): this; + /** + * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. + * @param start The zero-based location in the array from which to start removing elements. + * @param deleteCount The number of elements to remove. + */ + splice(start: number, deleteCount?: number): T[]; + /** + * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. + * @param start The zero-based location in the array from which to start removing elements. + * @param deleteCount The number of elements to remove. + * @param items Elements to insert into the array in place of the deleted elements. + */ + splice(start: number, deleteCount: number, ...items: T[]): T[]; + /** + * Inserts new elements at the start of an array. + * @param items Elements to insert at the start of the Array. + */ + unshift(...items: T[]): number; + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. + */ + indexOf(searchElement: T, fromIndex?: number): number; + /** + * Returns the index of the last occurrence of a specified value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. + */ + lastIndexOf(searchElement: T, fromIndex?: number): number; + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: T, index: number, array: T[]) => boolean): boolean; + every(callbackfn: (this: void, value: T, index: number, array: T[]) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: T, index: number, array: T[]) => boolean, thisArg: Z): boolean; + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: T, index: number, array: T[]) => boolean): boolean; + some(callbackfn: (this: void, value: T, index: number, array: T[]) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: T, index: number, array: T[]) => boolean, thisArg: Z): boolean; + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: T, index: number, array: T[]) => void): void; + forEach(callbackfn: (this: void, value: T, index: number, array: T[]) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: T, index: number, array: T[]) => void, thisArg: Z): void; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U, U]; + map(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U, U]; + map(this: [T, T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U, U]; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U]; + map(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U]; + map(this: [T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U]; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U]; + map(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U]; + map(this: [T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U]; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U]; + map(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U]; + map(this: [T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U]; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: T, index: number, array: T[]) => U): U[]; + map(callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): U[]; + map(callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): U[]; + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: T, index: number, array: T[]) => any): T[]; + filter(callbackfn: (this: void, value: T, index: number, array: T[]) => any, thisArg: undefined): T[]; + filter(callbackfn: (this: Z, value: T, index: number, array: T[]) => any, thisArg: Z): T[]; + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + + [n: number]: T; +} + +interface ArrayConstructor { + new (arrayLength?: number): any[]; + new (arrayLength: number): T[]; + new (...items: T[]): T[]; + (arrayLength?: number): any[]; + (arrayLength: number): T[]; + (...items: T[]): T[]; + isArray(arg: any): arg is Array; + readonly prototype: Array; +} + +declare const Array: ArrayConstructor; + +interface TypedPropertyDescriptor { + enumerable?: boolean; + configurable?: boolean; + writable?: boolean; + value?: T; + get?: () => T; + set?: (value: T) => void; +} + +declare type ClassDecorator = (target: TFunction) => TFunction | void; +declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; +declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; +declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; + +declare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike; + +interface PromiseLike { + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): PromiseLike; +} + +/** + * Represents the completion of an asynchronous operation + */ +interface Promise { + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; + + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; +} + +interface ArrayLike { + readonly length: number; + readonly [n: number]: T; +} + +/** + * Make all properties in T optional + */ +type Partial = { + [P in keyof T]?: T[P]; +}; + +/** + * Make all properties in T readonly + */ +type Readonly = { + readonly [P in keyof T]: T[P]; +}; + +/** + * From T pick a set of properties K + */ +type Pick = { + [P in K]: T[P]; +}; + +/** + * Construct a type with a set of properties K of type T + */ +type Record = { + [P in K]: T; +}; + +/** + * Marker for contextual 'this' type + */ +interface ThisType { } + +/** + * Represents a raw buffer of binary data, which is used to store data for the + * different typed arrays. ArrayBuffers cannot be read from or written to directly, + * but can be passed to a typed array or DataView Object to interpret the raw + * buffer as needed. + */ +interface ArrayBuffer { + /** + * Read-only. The length of the ArrayBuffer (in bytes). + */ + readonly byteLength: number; + + /** + * Returns a section of an ArrayBuffer. + */ + slice(begin: number, end?: number): ArrayBuffer; +} + +interface ArrayBufferConstructor { + readonly prototype: ArrayBuffer; + new (byteLength: number): ArrayBuffer; + isView(arg: any): arg is ArrayBufferView; +} +declare const ArrayBuffer: ArrayBufferConstructor; + +interface ArrayBufferView { + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; +} + +interface DataView { + readonly buffer: ArrayBuffer; + readonly byteLength: number; + readonly byteOffset: number; + /** + * Gets the Float32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Float64 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat64(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Int8 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt8(byteOffset: number): number; + + /** + * Gets the Int16 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt16(byteOffset: number, littleEndian?: boolean): number; + /** + * Gets the Int32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Uint8 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint8(byteOffset: number): number; + + /** + * Gets the Uint16 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint16(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Uint32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Stores an Float32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Float64 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Int8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setInt8(byteOffset: number, value: number): void; + + /** + * Stores an Int16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Int32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Uint8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setUint8(byteOffset: number, value: number): void; + + /** + * Stores an Uint16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Uint32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; +} + +interface DataViewConstructor { + new (buffer: ArrayBuffer, byteOffset?: number, byteLength?: number): DataView; +} +declare const DataView: DataViewConstructor; + +/** + * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Int8Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Int8Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Int8Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Int8Array) => any): Int8Array; + filter(callbackfn: (this: void, value: number, index: number, array: Int8Array) => any, thisArg: undefined): Int8Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => any, thisArg: Z): Int8Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Int8Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Int8Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Int8Array) => number): Int8Array; + map(callbackfn: (this: void, value: number, index: number, array: Int8Array) => number, thisArg: undefined): Int8Array; + map(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => number, thisArg: Z): Int8Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int8Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Int8Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Int8Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Int8Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int8Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} +interface Int8ArrayConstructor { + readonly prototype: Int8Array; + new (length: number): Int8Array; + new (array: ArrayLike): Int8Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Int8Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int8Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int8Array; + + from(arrayLike: ArrayLike): Int8Array; + +} +declare const Int8Array: Int8ArrayConstructor; + +/** + * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => any): Uint8Array; + filter(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => any, thisArg: undefined): Uint8Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => any, thisArg: Z): Uint8Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => number): Uint8Array; + map(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => number, thisArg: undefined): Uint8Array; + map(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => number, thisArg: Z): Uint8Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint8Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Uint8Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint8Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Uint8ArrayConstructor { + readonly prototype: Uint8Array; + new (length: number): Uint8Array; + new (array: ArrayLike): Uint8Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Uint8Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8Array; + + from(arrayLike: ArrayLike): Uint8Array; + +} +declare const Uint8Array: Uint8ArrayConstructor; + +/** + * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. + * If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8ClampedArray { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => any): Uint8ClampedArray; + filter(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => any, thisArg: undefined): Uint8ClampedArray; + filter(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => any, thisArg: Z): Uint8ClampedArray; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => number): Uint8ClampedArray; + map(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => number, thisArg: undefined): Uint8ClampedArray; + map(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => number, thisArg: Z): Uint8ClampedArray; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint8ClampedArray; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Uint8ClampedArray, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Uint8ClampedArray; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint8ClampedArray; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Uint8ClampedArrayConstructor { + readonly prototype: Uint8ClampedArray; + new (length: number): Uint8ClampedArray; + new (array: ArrayLike): Uint8ClampedArray; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8ClampedArray; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint8ClampedArray; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Uint8ClampedArray; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8ClampedArray; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8ClampedArray; + + from(arrayLike: ArrayLike): Uint8ClampedArray; +} +declare const Uint8ClampedArray: Uint8ClampedArrayConstructor; + +/** + * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int16Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Int16Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Int16Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Int16Array) => any): Int16Array; + filter(callbackfn: (this: void, value: number, index: number, array: Int16Array) => any, thisArg: undefined): Int16Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => any, thisArg: Z): Int16Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Int16Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Int16Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Int16Array) => number): Int16Array; + map(callbackfn: (this: void, value: number, index: number, array: Int16Array) => number, thisArg: undefined): Int16Array; + map(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => number, thisArg: Z): Int16Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int16Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Int16Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Int16Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Int16Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int16Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Int16ArrayConstructor { + readonly prototype: Int16Array; + new (length: number): Int16Array; + new (array: ArrayLike): Int16Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Int16Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int16Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int16Array; + + from(arrayLike: ArrayLike): Int16Array; + +} +declare const Int16Array: Int16ArrayConstructor; + +/** + * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint16Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => any): Uint16Array; + filter(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => any, thisArg: undefined): Uint16Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => any, thisArg: Z): Uint16Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => number): Uint16Array; + map(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => number, thisArg: undefined): Uint16Array; + map(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => number, thisArg: Z): Uint16Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint16Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Uint16Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint16Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Uint16ArrayConstructor { + readonly prototype: Uint16Array; + new (length: number): Uint16Array; + new (array: ArrayLike): Uint16Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Uint16Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint16Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint16Array; + + from(arrayLike: ArrayLike): Uint16Array; + +} +declare const Uint16Array: Uint16ArrayConstructor; +/** + * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int32Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Int32Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Int32Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Int32Array) => any): Int32Array; + filter(callbackfn: (this: void, value: number, index: number, array: Int32Array) => any, thisArg: undefined): Int32Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => any, thisArg: Z): Int32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Int32Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Int32Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Int32Array) => number): Int32Array; + map(callbackfn: (this: void, value: number, index: number, array: Int32Array) => number, thisArg: undefined): Int32Array; + map(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => number, thisArg: Z): Int32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int32Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Int32Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Int32Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Int32Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Int32ArrayConstructor { + readonly prototype: Int32Array; + new (length: number): Int32Array; + new (array: ArrayLike): Int32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Int32Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int32Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int32Array; + + from(arrayLike: ArrayLike): Int32Array; +} +declare const Int32Array: Int32ArrayConstructor; + +/** + * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint32Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => any): Uint32Array; + filter(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => any, thisArg: undefined): Uint32Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => any, thisArg: Z): Uint32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => number): Uint32Array; + map(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => number, thisArg: undefined): Uint32Array; + map(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => number, thisArg: Z): Uint32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint32Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Uint32Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Uint32ArrayConstructor { + readonly prototype: Uint32Array; + new (length: number): Uint32Array; + new (array: ArrayLike): Uint32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Uint32Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint32Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint32Array; + + from(arrayLike: ArrayLike): Uint32Array; +} +declare const Uint32Array: Uint32ArrayConstructor; + +/** + * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number + * of bytes could not be allocated an exception is raised. + */ +interface Float32Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Float32Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Float32Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Float32Array) => any): Float32Array; + filter(callbackfn: (this: void, value: number, index: number, array: Float32Array) => any, thisArg: undefined): Float32Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => any, thisArg: Z): Float32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Float32Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Float32Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Float32Array) => number): Float32Array; + map(callbackfn: (this: void, value: number, index: number, array: Float32Array) => number, thisArg: undefined): Float32Array; + map(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => number, thisArg: Z): Float32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Float32Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Float32Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Float32Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Float32Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Float32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Float32ArrayConstructor { + readonly prototype: Float32Array; + new (length: number): Float32Array; + new (array: ArrayLike): Float32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Float32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Float32Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float32Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float32Array; + + from(arrayLike: ArrayLike): Float32Array; + +} +declare const Float32Array: Float32ArrayConstructor; + +/** + * A typed array of 64-bit float values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Float64Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Float64Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Float64Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Float64Array) => any): Float64Array; + filter(callbackfn: (this: void, value: number, index: number, array: Float64Array) => any, thisArg: undefined): Float64Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => any, thisArg: Z): Float64Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Float64Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Float64Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Float64Array) => number): Float64Array; + map(callbackfn: (this: void, value: number, index: number, array: Float64Array) => number, thisArg: undefined): Float64Array; + map(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => number, thisArg: Z): Float64Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Float64Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Float64Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Float64Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Float64Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Float64Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Float64ArrayConstructor { + readonly prototype: Float64Array; + new (length: number): Float64Array; + new (array: ArrayLike): Float64Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Float64Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Float64Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float64Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float64Array; + + from(arrayLike: ArrayLike): Float64Array; +} +declare const Float64Array: Float64ArrayConstructor; + +///////////////////////////// +/// ECMAScript Internationalization API +///////////////////////////// + +declare namespace Intl { + interface CollatorOptions { + usage?: string; + localeMatcher?: string; + numeric?: boolean; + caseFirst?: string; + sensitivity?: string; + ignorePunctuation?: boolean; + } + + interface ResolvedCollatorOptions { + locale: string; + usage: string; + sensitivity: string; + ignorePunctuation: boolean; + collation: string; + caseFirst: string; + numeric: boolean; + } + + interface Collator { + compare(x: string, y: string): number; + resolvedOptions(): ResolvedCollatorOptions; + } + var Collator: { + new (locales?: string | string[], options?: CollatorOptions): Collator; + (locales?: string | string[], options?: CollatorOptions): Collator; + supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[]; + }; + + interface NumberFormatOptions { + localeMatcher?: string; + style?: string; + currency?: string; + currencyDisplay?: string; + useGrouping?: boolean; + minimumIntegerDigits?: number; + minimumFractionDigits?: number; + maximumFractionDigits?: number; + minimumSignificantDigits?: number; + maximumSignificantDigits?: number; + } + + interface ResolvedNumberFormatOptions { + locale: string; + numberingSystem: string; + style: string; + currency?: string; + currencyDisplay?: string; + minimumIntegerDigits: number; + minimumFractionDigits: number; + maximumFractionDigits: number; + minimumSignificantDigits?: number; + maximumSignificantDigits?: number; + useGrouping: boolean; + } + + interface NumberFormat { + format(value: number): string; + resolvedOptions(): ResolvedNumberFormatOptions; + } + var NumberFormat: { + new (locales?: string | string[], options?: NumberFormatOptions): NumberFormat; + (locales?: string | string[], options?: NumberFormatOptions): NumberFormat; + supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[]; + }; + + interface DateTimeFormatOptions { + localeMatcher?: string; + weekday?: string; + era?: string; + year?: string; + month?: string; + day?: string; + hour?: string; + minute?: string; + second?: string; + timeZoneName?: string; + formatMatcher?: string; + hour12?: boolean; + timeZone?: string; + } + + interface ResolvedDateTimeFormatOptions { + locale: string; + calendar: string; + numberingSystem: string; + timeZone: string; + hour12?: boolean; + weekday?: string; + era?: string; + year?: string; + month?: string; + day?: string; + hour?: string; + minute?: string; + second?: string; + timeZoneName?: string; + } + + interface DateTimeFormat { + format(date?: Date | number): string; + resolvedOptions(): ResolvedDateTimeFormatOptions; + } + var DateTimeFormat: { + new (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat; + (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat; + supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[]; + }; +} + +interface String { + /** + * Determines whether two strings are equivalent in the current or specified locale. + * @param that String to compare to target string + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. + * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. + */ + localeCompare(that: string, locales?: string | string[], options?: Intl.CollatorOptions): number; +} + +interface Number { + /** + * Converts a number to a string by using the current or specified locale. + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string; +} + +interface Date { + /** + * Converts a date and time to a string by using the current or specified locale. + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; + /** + * Converts a date to a string by using the current or specified locale. + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; + + /** + * Converts a time to a string by using the current or specified locale. + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; +} + + + +///////////////////////////// +/// IE DOM APIs +///////////////////////////// + +interface Account { + rpDisplayName?: string; + displayName?: string; + id?: string; + name?: string; + imageURL?: string; +} + +interface Algorithm { + name: string; +} + +interface AnimationEventInit extends EventInit { + animationName?: string; + elapsedTime?: number; +} + +interface AssertionOptions { + timeoutSeconds?: number; + rpId?: USVString; + allowList?: ScopedCredentialDescriptor[]; + extensions?: WebAuthnExtensions; +} + +interface CacheQueryOptions { + ignoreSearch?: boolean; + ignoreMethod?: boolean; + ignoreVary?: boolean; + cacheName?: string; +} + +interface ClientData { + challenge?: string; + origin?: string; + rpId?: string; + hashAlg?: string | Algorithm; + tokenBinding?: string; + extensions?: WebAuthnExtensions; +} + +interface CloseEventInit extends EventInit { + wasClean?: boolean; + code?: number; + reason?: string; +} + +interface CompositionEventInit extends UIEventInit { + data?: string; +} + +interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation { + arrayOfDomainStrings?: string[]; +} + +interface ConstrainBooleanParameters { + exact?: boolean; + ideal?: boolean; +} + +interface ConstrainDOMStringParameters { + exact?: string | string[]; + ideal?: string | string[]; +} + +interface ConstrainDoubleRange extends DoubleRange { + exact?: number; + ideal?: number; +} + +interface ConstrainLongRange extends LongRange { + exact?: number; + ideal?: number; +} + +interface ConstrainVideoFacingModeParameters { + exact?: VideoFacingModeEnum | VideoFacingModeEnum[]; + ideal?: VideoFacingModeEnum | VideoFacingModeEnum[]; +} + +interface CustomEventInit extends EventInit { + detail?: any; +} + +interface DOMRectInit { + x?: any; + y?: any; + width?: any; + height?: any; +} + +interface DeviceAccelerationDict { + x?: number; + y?: number; + z?: number; +} + +interface DeviceLightEventInit extends EventInit { + value?: number; +} + +interface DeviceMotionEventInit extends EventInit { + acceleration?: DeviceAccelerationDict; + accelerationIncludingGravity?: DeviceAccelerationDict; + rotationRate?: DeviceRotationRateDict; + interval?: number; +} + +interface DeviceOrientationEventInit extends EventInit { + alpha?: number; + beta?: number; + gamma?: number; + absolute?: boolean; +} + +interface DeviceRotationRateDict { + alpha?: number; + beta?: number; + gamma?: number; +} + +interface DoubleRange { + max?: number; + min?: number; +} + +interface ErrorEventInit extends EventInit { + message?: string; + filename?: string; + lineno?: number; + colno?: number; + error?: any; +} + +interface EventInit { + scoped?: boolean; + bubbles?: boolean; + cancelable?: boolean; +} + +interface EventModifierInit extends UIEventInit { + ctrlKey?: boolean; + shiftKey?: boolean; + altKey?: boolean; + metaKey?: boolean; + modifierAltGraph?: boolean; + modifierCapsLock?: boolean; + modifierFn?: boolean; + modifierFnLock?: boolean; + modifierHyper?: boolean; + modifierNumLock?: boolean; + modifierOS?: boolean; + modifierScrollLock?: boolean; + modifierSuper?: boolean; + modifierSymbol?: boolean; + modifierSymbolLock?: boolean; +} + +interface ExceptionInformation { + domain?: string; +} + +interface FocusEventInit extends UIEventInit { + relatedTarget?: EventTarget; +} + +interface FocusNavigationEventInit extends EventInit { + navigationReason?: string; + originLeft?: number; + originTop?: number; + originWidth?: number; + originHeight?: number; +} + +interface FocusNavigationOrigin { + originLeft?: number; + originTop?: number; + originWidth?: number; + originHeight?: number; +} + +interface GamepadEventInit extends EventInit { + gamepad?: Gamepad; +} + +interface GetNotificationOptions { + tag?: string; +} + +interface HashChangeEventInit extends EventInit { + newURL?: string; + oldURL?: string; +} + +interface IDBIndexParameters { + multiEntry?: boolean; + unique?: boolean; +} + +interface IDBObjectStoreParameters { + autoIncrement?: boolean; + keyPath?: IDBKeyPath; +} + +interface IntersectionObserverEntryInit { + time?: number; + rootBounds?: DOMRectInit; + boundingClientRect?: DOMRectInit; + intersectionRect?: DOMRectInit; + target?: Element; +} + +interface IntersectionObserverInit { + root?: Element; + rootMargin?: string; + threshold?: number | number[]; +} + +interface KeyAlgorithm { + name?: string; +} + +interface KeyboardEventInit extends EventModifierInit { + code?: string; + key?: string; + location?: number; + repeat?: boolean; +} + +interface LongRange { + max?: number; + min?: number; +} + +interface MSAccountInfo { + rpDisplayName?: string; + userDisplayName?: string; + accountName?: string; + userId?: string; + accountImageUri?: string; +} + +interface MSAudioLocalClientEvent extends MSLocalClientEventBase { + networkSendQualityEventRatio?: number; + networkDelayEventRatio?: number; + cpuInsufficientEventRatio?: number; + deviceHalfDuplexAECEventRatio?: number; + deviceRenderNotFunctioningEventRatio?: number; + deviceCaptureNotFunctioningEventRatio?: number; + deviceGlitchesEventRatio?: number; + deviceLowSNREventRatio?: number; + deviceLowSpeechLevelEventRatio?: number; + deviceClippingEventRatio?: number; + deviceEchoEventRatio?: number; + deviceNearEndToEchoRatioEventRatio?: number; + deviceRenderZeroVolumeEventRatio?: number; + deviceRenderMuteEventRatio?: number; + deviceMultipleEndpointsEventCount?: number; + deviceHowlingEventCount?: number; +} + +interface MSAudioRecvPayload extends MSPayloadBase { + samplingRate?: number; + signal?: MSAudioRecvSignal; + packetReorderRatio?: number; + packetReorderDepthAvg?: number; + packetReorderDepthMax?: number; + burstLossLength1?: number; + burstLossLength2?: number; + burstLossLength3?: number; + burstLossLength4?: number; + burstLossLength5?: number; + burstLossLength6?: number; + burstLossLength7?: number; + burstLossLength8OrHigher?: number; + fecRecvDistance1?: number; + fecRecvDistance2?: number; + fecRecvDistance3?: number; + ratioConcealedSamplesAvg?: number; + ratioStretchedSamplesAvg?: number; + ratioCompressedSamplesAvg?: number; +} + +interface MSAudioRecvSignal { + initialSignalLevelRMS?: number; + recvSignalLevelCh1?: number; + recvNoiseLevelCh1?: number; + renderSignalLevel?: number; + renderNoiseLevel?: number; + renderLoopbackSignalLevel?: number; +} + +interface MSAudioSendPayload extends MSPayloadBase { + samplingRate?: number; + signal?: MSAudioSendSignal; + audioFECUsed?: boolean; + sendMutePercent?: number; +} + +interface MSAudioSendSignal { + noiseLevel?: number; + sendSignalLevelCh1?: number; + sendNoiseLevelCh1?: number; +} + +interface MSConnectivity { + iceType?: MSIceType; + iceWarningFlags?: MSIceWarningFlags; + relayAddress?: MSRelayAddress; +} + +interface MSCredentialFilter { + accept?: MSCredentialSpec[]; +} + +interface MSCredentialParameters { + type?: MSCredentialType; +} + +interface MSCredentialSpec { + type?: MSCredentialType; + id?: string; +} + +interface MSDelay { + roundTrip?: number; + roundTripMax?: number; +} + +interface MSDescription extends RTCStats { + connectivity?: MSConnectivity; + transport?: RTCIceProtocol; + networkconnectivity?: MSNetworkConnectivityInfo; + localAddr?: MSIPAddressInfo; + remoteAddr?: MSIPAddressInfo; + deviceDevName?: string; + reflexiveLocalIPAddr?: MSIPAddressInfo; +} + +interface MSFIDOCredentialParameters extends MSCredentialParameters { + algorithm?: string | Algorithm; + authenticators?: AAGUID[]; +} + +interface MSIPAddressInfo { + ipAddr?: string; + port?: number; + manufacturerMacAddrMask?: string; +} + +interface MSIceWarningFlags { + turnTcpTimedOut?: boolean; + turnUdpAllocateFailed?: boolean; + turnUdpSendFailed?: boolean; + turnTcpAllocateFailed?: boolean; + turnTcpSendFailed?: boolean; + udpLocalConnectivityFailed?: boolean; + udpNatConnectivityFailed?: boolean; + udpRelayConnectivityFailed?: boolean; + tcpNatConnectivityFailed?: boolean; + tcpRelayConnectivityFailed?: boolean; + connCheckMessageIntegrityFailed?: boolean; + allocationMessageIntegrityFailed?: boolean; + connCheckOtherError?: boolean; + turnAuthUnknownUsernameError?: boolean; + noRelayServersConfigured?: boolean; + multipleRelayServersAttempted?: boolean; + portRangeExhausted?: boolean; + alternateServerReceived?: boolean; + pseudoTLSFailure?: boolean; + turnTurnTcpConnectivityFailed?: boolean; + useCandidateChecksFailed?: boolean; + fipsAllocationFailure?: boolean; +} + +interface MSJitter { + interArrival?: number; + interArrivalMax?: number; + interArrivalSD?: number; +} + +interface MSLocalClientEventBase extends RTCStats { + networkReceiveQualityEventRatio?: number; + networkBandwidthLowEventRatio?: number; +} + +interface MSNetwork extends RTCStats { + jitter?: MSJitter; + delay?: MSDelay; + packetLoss?: MSPacketLoss; + utilization?: MSUtilization; +} + +interface MSNetworkConnectivityInfo { + vpn?: boolean; + linkspeed?: number; + networkConnectionDetails?: string; +} + +interface MSNetworkInterfaceType { + interfaceTypeEthernet?: boolean; + interfaceTypeWireless?: boolean; + interfaceTypePPP?: boolean; + interfaceTypeTunnel?: boolean; + interfaceTypeWWAN?: boolean; +} + +interface MSOutboundNetwork extends MSNetwork { + appliedBandwidthLimit?: number; +} + +interface MSPacketLoss { + lossRate?: number; + lossRateMax?: number; +} + +interface MSPayloadBase extends RTCStats { + payloadDescription?: string; +} + +interface MSPortRange { + min?: number; + max?: number; +} + +interface MSRelayAddress { + relayAddress?: string; + port?: number; +} + +interface MSSignatureParameters { + userPrompt?: string; +} + +interface MSTransportDiagnosticsStats extends RTCStats { + baseAddress?: string; + localAddress?: string; + localSite?: string; + networkName?: string; + remoteAddress?: string; + remoteSite?: string; + localMR?: string; + remoteMR?: string; + iceWarningFlags?: MSIceWarningFlags; + portRangeMin?: number; + portRangeMax?: number; + localMRTCPPort?: number; + remoteMRTCPPort?: number; + stunVer?: number; + numConsentReqSent?: number; + numConsentReqReceived?: number; + numConsentRespSent?: number; + numConsentRespReceived?: number; + interfaces?: MSNetworkInterfaceType; + baseInterface?: MSNetworkInterfaceType; + protocol?: RTCIceProtocol; + localInterface?: MSNetworkInterfaceType; + localAddrType?: MSIceAddrType; + remoteAddrType?: MSIceAddrType; + iceRole?: RTCIceRole; + rtpRtcpMux?: boolean; + allocationTimeInMs?: number; + msRtcEngineVersion?: string; +} + +interface MSUtilization { + packets?: number; + bandwidthEstimation?: number; + bandwidthEstimationMin?: number; + bandwidthEstimationMax?: number; + bandwidthEstimationStdDev?: number; + bandwidthEstimationAvg?: number; +} + +interface MSVideoPayload extends MSPayloadBase { + resolution?: string; + videoBitRateAvg?: number; + videoBitRateMax?: number; + videoFrameRateAvg?: number; + videoPacketLossRate?: number; + durationSeconds?: number; +} + +interface MSVideoRecvPayload extends MSVideoPayload { + videoFrameLossRate?: number; + recvCodecType?: string; + recvResolutionWidth?: number; + recvResolutionHeight?: number; + videoResolutions?: MSVideoResolutionDistribution; + recvFrameRateAverage?: number; + recvBitRateMaximum?: number; + recvBitRateAverage?: number; + recvVideoStreamsMax?: number; + recvVideoStreamsMin?: number; + recvVideoStreamsMode?: number; + videoPostFECPLR?: number; + lowBitRateCallPercent?: number; + lowFrameRateCallPercent?: number; + reorderBufferTotalPackets?: number; + recvReorderBufferReorderedPackets?: number; + recvReorderBufferPacketsDroppedDueToBufferExhaustion?: number; + recvReorderBufferMaxSuccessfullyOrderedExtent?: number; + recvReorderBufferMaxSuccessfullyOrderedLateTime?: number; + recvReorderBufferPacketsDroppedDueToTimeout?: number; + recvFpsHarmonicAverage?: number; + recvNumResSwitches?: number; +} + +interface MSVideoResolutionDistribution { + cifQuality?: number; + vgaQuality?: number; + h720Quality?: number; + h1080Quality?: number; + h1440Quality?: number; + h2160Quality?: number; +} + +interface MSVideoSendPayload extends MSVideoPayload { + sendFrameRateAverage?: number; + sendBitRateMaximum?: number; + sendBitRateAverage?: number; + sendVideoStreamsMax?: number; + sendResolutionWidth?: number; + sendResolutionHeight?: number; +} + +interface MediaEncryptedEventInit extends EventInit { + initDataType?: string; + initData?: ArrayBuffer; +} + +interface MediaKeyMessageEventInit extends EventInit { + messageType?: MediaKeyMessageType; + message?: ArrayBuffer; +} + +interface MediaKeySystemConfiguration { + initDataTypes?: string[]; + audioCapabilities?: MediaKeySystemMediaCapability[]; + videoCapabilities?: MediaKeySystemMediaCapability[]; + distinctiveIdentifier?: MediaKeysRequirement; + persistentState?: MediaKeysRequirement; +} + +interface MediaKeySystemMediaCapability { + contentType?: string; + robustness?: string; +} + +interface MediaStreamConstraints { + video?: boolean | MediaTrackConstraints; + audio?: boolean | MediaTrackConstraints; +} + +interface MediaStreamErrorEventInit extends EventInit { + error?: MediaStreamError; +} + +interface MediaStreamEventInit extends EventInit { + stream?: MediaStream; +} + +interface MediaStreamTrackEventInit extends EventInit { + track?: MediaStreamTrack; +} + +interface MediaTrackCapabilities { + width?: number | LongRange; + height?: number | LongRange; + aspectRatio?: number | DoubleRange; + frameRate?: number | DoubleRange; + facingMode?: string; + volume?: number | DoubleRange; + sampleRate?: number | LongRange; + sampleSize?: number | LongRange; + echoCancellation?: boolean[]; + deviceId?: string; + groupId?: string; +} + +interface MediaTrackConstraintSet { + width?: number | ConstrainLongRange; + height?: number | ConstrainLongRange; + aspectRatio?: number | ConstrainDoubleRange; + frameRate?: number | ConstrainDoubleRange; + facingMode?: string | string[] | ConstrainDOMStringParameters; + volume?: number | ConstrainDoubleRange; + sampleRate?: number | ConstrainLongRange; + sampleSize?: number | ConstrainLongRange; + echoCancelation?: boolean | ConstrainBooleanParameters; + deviceId?: string | string[] | ConstrainDOMStringParameters; + groupId?: string | string[] | ConstrainDOMStringParameters; +} + +interface MediaTrackConstraints extends MediaTrackConstraintSet { + advanced?: MediaTrackConstraintSet[]; +} + +interface MediaTrackSettings { + width?: number; + height?: number; + aspectRatio?: number; + frameRate?: number; + facingMode?: string; + volume?: number; + sampleRate?: number; + sampleSize?: number; + echoCancellation?: boolean; + deviceId?: string; + groupId?: string; +} + +interface MediaTrackSupportedConstraints { + width?: boolean; + height?: boolean; + aspectRatio?: boolean; + frameRate?: boolean; + facingMode?: boolean; + volume?: boolean; + sampleRate?: boolean; + sampleSize?: boolean; + echoCancellation?: boolean; + deviceId?: boolean; + groupId?: boolean; +} + +interface MessageEventInit extends EventInit { + lastEventId?: string; + channel?: string; + data?: any; + origin?: string; + source?: Window; + ports?: MessagePort[]; +} + +interface MouseEventInit extends EventModifierInit { + screenX?: number; + screenY?: number; + clientX?: number; + clientY?: number; + button?: number; + buttons?: number; + relatedTarget?: EventTarget; +} + +interface MsZoomToOptions { + contentX?: number; + contentY?: number; + viewportX?: string; + viewportY?: string; + scaleFactor?: number; + animate?: string; +} + +interface MutationObserverInit { + childList?: boolean; + attributes?: boolean; + characterData?: boolean; + subtree?: boolean; + attributeOldValue?: boolean; + characterDataOldValue?: boolean; + attributeFilter?: string[]; +} + +interface NotificationOptions { + dir?: NotificationDirection; + lang?: string; + body?: string; + tag?: string; + icon?: string; +} + +interface ObjectURLOptions { + oneTimeOnly?: boolean; +} + +interface PaymentCurrencyAmount { + currency?: string; + value?: string; + currencySystem?: string; +} + +interface PaymentDetails { + total?: PaymentItem; + displayItems?: PaymentItem[]; + shippingOptions?: PaymentShippingOption[]; + modifiers?: PaymentDetailsModifier[]; + error?: string; +} + +interface PaymentDetailsModifier { + supportedMethods?: string[]; + total?: PaymentItem; + additionalDisplayItems?: PaymentItem[]; + data?: any; +} + +interface PaymentItem { + label?: string; + amount?: PaymentCurrencyAmount; + pending?: boolean; +} + +interface PaymentMethodData { + supportedMethods?: string[]; + data?: any; +} + +interface PaymentOptions { + requestPayerName?: boolean; + requestPayerEmail?: boolean; + requestPayerPhone?: boolean; + requestShipping?: boolean; + shippingType?: string; +} + +interface PaymentRequestUpdateEventInit extends EventInit { +} + +interface PaymentShippingOption { + id?: string; + label?: string; + amount?: PaymentCurrencyAmount; + selected?: boolean; +} + +interface PeriodicWaveConstraints { + disableNormalization?: boolean; +} + +interface PointerEventInit extends MouseEventInit { + pointerId?: number; + width?: number; + height?: number; + pressure?: number; + tiltX?: number; + tiltY?: number; + pointerType?: string; + isPrimary?: boolean; +} + +interface PopStateEventInit extends EventInit { + state?: any; +} + +interface PositionOptions { + enableHighAccuracy?: boolean; + timeout?: number; + maximumAge?: number; +} + +interface ProgressEventInit extends EventInit { + lengthComputable?: boolean; + loaded?: number; + total?: number; +} + +interface PushSubscriptionOptionsInit { + userVisibleOnly?: boolean; + applicationServerKey?: any; +} + +interface RTCConfiguration { + iceServers?: RTCIceServer[]; + iceTransportPolicy?: RTCIceTransportPolicy; + bundlePolicy?: RTCBundlePolicy; + peerIdentity?: string; +} + +interface RTCDTMFToneChangeEventInit extends EventInit { + tone?: string; +} + +interface RTCDtlsFingerprint { + algorithm?: string; + value?: string; +} + +interface RTCDtlsParameters { + role?: RTCDtlsRole; + fingerprints?: RTCDtlsFingerprint[]; +} + +interface RTCIceCandidateAttributes extends RTCStats { + ipAddress?: string; + portNumber?: number; + transport?: string; + candidateType?: RTCStatsIceCandidateType; + priority?: number; + addressSourceUrl?: string; +} + +interface RTCIceCandidateComplete { +} + +interface RTCIceCandidateDictionary { + foundation?: string; + priority?: number; + ip?: string; + protocol?: RTCIceProtocol; + port?: number; + type?: RTCIceCandidateType; + tcpType?: RTCIceTcpCandidateType; + relatedAddress?: string; + relatedPort?: number; + msMTurnSessionId?: string; +} + +interface RTCIceCandidateInit { + candidate?: string; + sdpMid?: string; + sdpMLineIndex?: number; +} + +interface RTCIceCandidatePair { + local?: RTCIceCandidateDictionary; + remote?: RTCIceCandidateDictionary; +} + +interface RTCIceCandidatePairStats extends RTCStats { + transportId?: string; + localCandidateId?: string; + remoteCandidateId?: string; + state?: RTCStatsIceCandidatePairState; + priority?: number; + nominated?: boolean; + writable?: boolean; + readable?: boolean; + bytesSent?: number; + bytesReceived?: number; + roundTripTime?: number; + availableOutgoingBitrate?: number; + availableIncomingBitrate?: number; +} + +interface RTCIceGatherOptions { + gatherPolicy?: RTCIceGatherPolicy; + iceservers?: RTCIceServer[]; + portRange?: MSPortRange; +} + +interface RTCIceParameters { + usernameFragment?: string; + password?: string; + iceLite?: boolean; +} + +interface RTCIceServer { + urls?: any; + username?: string; + credential?: string; +} + +interface RTCInboundRTPStreamStats extends RTCRTPStreamStats { + packetsReceived?: number; + bytesReceived?: number; + packetsLost?: number; + jitter?: number; + fractionLost?: number; +} + +interface RTCMediaStreamTrackStats extends RTCStats { + trackIdentifier?: string; + remoteSource?: boolean; + ssrcIds?: string[]; + frameWidth?: number; + frameHeight?: number; + framesPerSecond?: number; + framesSent?: number; + framesReceived?: number; + framesDecoded?: number; + framesDropped?: number; + framesCorrupted?: number; + audioLevel?: number; + echoReturnLoss?: number; + echoReturnLossEnhancement?: number; +} + +interface RTCOfferOptions { + offerToReceiveVideo?: number; + offerToReceiveAudio?: number; + voiceActivityDetection?: boolean; + iceRestart?: boolean; +} + +interface RTCOutboundRTPStreamStats extends RTCRTPStreamStats { + packetsSent?: number; + bytesSent?: number; + targetBitrate?: number; + roundTripTime?: number; +} + +interface RTCPeerConnectionIceEventInit extends EventInit { + candidate?: RTCIceCandidate; +} + +interface RTCRTPStreamStats extends RTCStats { + ssrc?: string; + associateStatsId?: string; + isRemote?: boolean; + mediaTrackId?: string; + transportId?: string; + codecId?: string; + firCount?: number; + pliCount?: number; + nackCount?: number; + sliCount?: number; +} + +interface RTCRtcpFeedback { + type?: string; + parameter?: string; +} + +interface RTCRtcpParameters { + ssrc?: number; + cname?: string; + reducedSize?: boolean; + mux?: boolean; +} + +interface RTCRtpCapabilities { + codecs?: RTCRtpCodecCapability[]; + headerExtensions?: RTCRtpHeaderExtension[]; + fecMechanisms?: string[]; +} + +interface RTCRtpCodecCapability { + name?: string; + kind?: string; + clockRate?: number; + preferredPayloadType?: number; + maxptime?: number; + ptime?: number; + numChannels?: number; + rtcpFeedback?: RTCRtcpFeedback[]; + parameters?: any; + options?: any; + maxTemporalLayers?: number; + maxSpatialLayers?: number; + svcMultiStreamSupport?: boolean; +} + +interface RTCRtpCodecParameters { + name?: string; + payloadType?: any; + clockRate?: number; + maxptime?: number; + ptime?: number; + numChannels?: number; + rtcpFeedback?: RTCRtcpFeedback[]; + parameters?: any; +} + +interface RTCRtpContributingSource { + timestamp?: number; + csrc?: number; + audioLevel?: number; +} + +interface RTCRtpEncodingParameters { + ssrc?: number; + codecPayloadType?: number; + fec?: RTCRtpFecParameters; + rtx?: RTCRtpRtxParameters; + priority?: number; + maxBitrate?: number; + minQuality?: number; + resolutionScale?: number; + framerateScale?: number; + maxFramerate?: number; + active?: boolean; + encodingId?: string; + dependencyEncodingIds?: string[]; + ssrcRange?: RTCSsrcRange; +} + +interface RTCRtpFecParameters { + ssrc?: number; + mechanism?: string; +} + +interface RTCRtpHeaderExtension { + kind?: string; + uri?: string; + preferredId?: number; + preferredEncrypt?: boolean; +} + +interface RTCRtpHeaderExtensionParameters { + uri?: string; + id?: number; + encrypt?: boolean; +} + +interface RTCRtpParameters { + muxId?: string; + codecs?: RTCRtpCodecParameters[]; + headerExtensions?: RTCRtpHeaderExtensionParameters[]; + encodings?: RTCRtpEncodingParameters[]; + rtcp?: RTCRtcpParameters; + degradationPreference?: RTCDegradationPreference; +} + +interface RTCRtpRtxParameters { + ssrc?: number; +} + +interface RTCRtpUnhandled { + ssrc?: number; + payloadType?: number; + muxId?: string; +} + +interface RTCSessionDescriptionInit { + type?: RTCSdpType; + sdp?: string; +} + +interface RTCSrtpKeyParam { + keyMethod?: string; + keySalt?: string; + lifetime?: string; + mkiValue?: number; + mkiLength?: number; +} + +interface RTCSrtpSdesParameters { + tag?: number; + cryptoSuite?: string; + keyParams?: RTCSrtpKeyParam[]; + sessionParams?: string[]; +} + +interface RTCSsrcRange { + min?: number; + max?: number; +} + +interface RTCStats { + timestamp?: number; + type?: RTCStatsType; + id?: string; + msType?: MSStatsType; +} + +interface RTCStatsReport { +} + +interface RTCTransportStats extends RTCStats { + bytesSent?: number; + bytesReceived?: number; + rtcpTransportStatsId?: string; + activeConnection?: boolean; + selectedCandidatePairId?: string; + localCertificateId?: string; + remoteCertificateId?: string; +} + +interface RegistrationOptions { + scope?: string; +} + +interface RequestInit { + method?: string; + headers?: any; + body?: any; + referrer?: string; + referrerPolicy?: ReferrerPolicy; + mode?: RequestMode; + credentials?: RequestCredentials; + cache?: RequestCache; + redirect?: RequestRedirect; + integrity?: string; + keepalive?: boolean; + window?: any; +} + +interface ResponseInit { + status?: number; + statusText?: string; + headers?: any; +} + +interface ScopedCredentialDescriptor { + type?: ScopedCredentialType; + id?: any; + transports?: Transport[]; +} + +interface ScopedCredentialOptions { + timeoutSeconds?: number; + rpId?: USVString; + excludeList?: ScopedCredentialDescriptor[]; + extensions?: WebAuthnExtensions; +} + +interface ScopedCredentialParameters { + type?: ScopedCredentialType; + algorithm?: string | Algorithm; +} + +interface ServiceWorkerMessageEventInit extends EventInit { + data?: any; + origin?: string; + lastEventId?: string; + source?: ServiceWorker | MessagePort; + ports?: MessagePort[]; +} + +interface SpeechSynthesisEventInit extends EventInit { + utterance?: SpeechSynthesisUtterance; + charIndex?: number; + elapsedTime?: number; + name?: string; +} + +interface StoreExceptionsInformation extends ExceptionInformation { + siteName?: string; + explanationString?: string; + detailURI?: string; +} + +interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { + arrayOfDomainStrings?: string[]; +} + +interface TrackEventInit extends EventInit { + track?: VideoTrack | AudioTrack | TextTrack; +} + +interface TransitionEventInit extends EventInit { + propertyName?: string; + elapsedTime?: number; +} + +interface UIEventInit extends EventInit { + view?: Window; + detail?: number; +} + +interface WebAuthnExtensions { +} + +interface WebGLContextAttributes { + failIfMajorPerformanceCaveat?: boolean; + alpha?: boolean; + depth?: boolean; + stencil?: boolean; + antialias?: boolean; + premultipliedAlpha?: boolean; + preserveDrawingBuffer?: boolean; +} + +interface WebGLContextEventInit extends EventInit { + statusMessage?: string; +} + +interface WheelEventInit extends MouseEventInit { + deltaX?: number; + deltaY?: number; + deltaZ?: number; + deltaMode?: number; +} + +interface EventListener { + (evt: Event): void; +} + +interface WebKitEntriesCallback { + (evt: Event): void; +} + +interface WebKitErrorCallback { + (evt: Event): void; +} + +interface WebKitFileCallback { + (evt: Event): void; +} + +interface ANGLE_instanced_arrays { + drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void; + drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void; + vertexAttribDivisorANGLE(index: number, divisor: number): void; + readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; +} + +declare var ANGLE_instanced_arrays: { + prototype: ANGLE_instanced_arrays; + new(): ANGLE_instanced_arrays; + readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; +} + +interface AnalyserNode extends AudioNode { + fftSize: number; + readonly frequencyBinCount: number; + maxDecibels: number; + minDecibels: number; + smoothingTimeConstant: number; + getByteFrequencyData(array: Uint8Array): void; + getByteTimeDomainData(array: Uint8Array): void; + getFloatFrequencyData(array: Float32Array): void; + getFloatTimeDomainData(array: Float32Array): void; +} + +declare var AnalyserNode: { + prototype: AnalyserNode; + new(): AnalyserNode; +} + +interface AnimationEvent extends Event { + readonly animationName: string; + readonly elapsedTime: number; + initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; +} + +declare var AnimationEvent: { + prototype: AnimationEvent; + new(typeArg: string, eventInitDict?: AnimationEventInit): AnimationEvent; +} + +interface ApplicationCacheEventMap { + "cached": Event; + "checking": Event; + "downloading": Event; + "error": Event; + "noupdate": Event; + "obsolete": Event; + "progress": ProgressEvent; + "updateready": Event; +} + +interface ApplicationCache extends EventTarget { + oncached: (this: ApplicationCache, ev: Event) => any; + onchecking: (this: ApplicationCache, ev: Event) => any; + ondownloading: (this: ApplicationCache, ev: Event) => any; + onerror: (this: ApplicationCache, ev: Event) => any; + onnoupdate: (this: ApplicationCache, ev: Event) => any; + onobsolete: (this: ApplicationCache, ev: Event) => any; + onprogress: (this: ApplicationCache, ev: ProgressEvent) => any; + onupdateready: (this: ApplicationCache, ev: Event) => any; + readonly status: number; + abort(): void; + swapCache(): void; + update(): void; + readonly CHECKING: number; + readonly DOWNLOADING: number; + readonly IDLE: number; + readonly OBSOLETE: number; + readonly UNCACHED: number; + readonly UPDATEREADY: number; + addEventListener(type: K, listener: (this: ApplicationCache, ev: ApplicationCacheEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ApplicationCache: { + prototype: ApplicationCache; + new(): ApplicationCache; + readonly CHECKING: number; + readonly DOWNLOADING: number; + readonly IDLE: number; + readonly OBSOLETE: number; + readonly UNCACHED: number; + readonly UPDATEREADY: number; +} + +interface Attr extends Node { + readonly name: string; + readonly ownerElement: Element; + readonly prefix: string | null; + readonly specified: boolean; + value: string; +} + +declare var Attr: { + prototype: Attr; + new(): Attr; +} + +interface AudioBuffer { + readonly duration: number; + readonly length: number; + readonly numberOfChannels: number; + readonly sampleRate: number; + copyFromChannel(destination: Float32Array, channelNumber: number, startInChannel?: number): void; + copyToChannel(source: Float32Array, channelNumber: number, startInChannel?: number): void; + getChannelData(channel: number): Float32Array; +} + +declare var AudioBuffer: { + prototype: AudioBuffer; + new(): AudioBuffer; +} + +interface AudioBufferSourceNodeEventMap { + "ended": MediaStreamErrorEvent; +} + +interface AudioBufferSourceNode extends AudioNode { + buffer: AudioBuffer | null; + readonly detune: AudioParam; + loop: boolean; + loopEnd: number; + loopStart: number; + onended: (this: AudioBufferSourceNode, ev: MediaStreamErrorEvent) => any; + readonly playbackRate: AudioParam; + start(when?: number, offset?: number, duration?: number): void; + stop(when?: number): void; + addEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioBufferSourceNodeEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var AudioBufferSourceNode: { + prototype: AudioBufferSourceNode; + new(): AudioBufferSourceNode; +} + +interface AudioContextEventMap { + "statechange": Event; +} + +interface AudioContextBase extends EventTarget { + readonly currentTime: number; + readonly destination: AudioDestinationNode; + readonly listener: AudioListener; + onstatechange: (this: AudioContext, ev: Event) => any; + readonly sampleRate: number; + readonly state: AudioContextState; + close(): Promise; + createAnalyser(): AnalyserNode; + createBiquadFilter(): BiquadFilterNode; + createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; + createBufferSource(): AudioBufferSourceNode; + createChannelMerger(numberOfInputs?: number): ChannelMergerNode; + createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode; + createConvolver(): ConvolverNode; + createDelay(maxDelayTime?: number): DelayNode; + createDynamicsCompressor(): DynamicsCompressorNode; + createGain(): GainNode; + createIIRFilter(feedforward: number[], feedback: number[]): IIRFilterNode; + createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode; + createMediaStreamSource(mediaStream: MediaStream): MediaStreamAudioSourceNode; + createOscillator(): OscillatorNode; + createPanner(): PannerNode; + createPeriodicWave(real: Float32Array, imag: Float32Array, constraints?: PeriodicWaveConstraints): PeriodicWave; + createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode; + createStereoPanner(): StereoPannerNode; + createWaveShaper(): WaveShaperNode; + decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): Promise; + resume(): Promise; + addEventListener(type: K, listener: (this: AudioContext, ev: AudioContextEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface AudioContext extends AudioContextBase { + suspend(): Promise; +} + +declare var AudioContext: { + prototype: AudioContext; + new(): AudioContext; +} + +interface AudioDestinationNode extends AudioNode { + readonly maxChannelCount: number; +} + +declare var AudioDestinationNode: { + prototype: AudioDestinationNode; + new(): AudioDestinationNode; +} + +interface AudioListener { + dopplerFactor: number; + speedOfSound: number; + setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void; + setPosition(x: number, y: number, z: number): void; + setVelocity(x: number, y: number, z: number): void; +} + +declare var AudioListener: { + prototype: AudioListener; + new(): AudioListener; +} + +interface AudioNode extends EventTarget { + channelCount: number; + channelCountMode: ChannelCountMode; + channelInterpretation: ChannelInterpretation; + readonly context: AudioContext; + readonly numberOfInputs: number; + readonly numberOfOutputs: number; + connect(destination: AudioNode, output?: number, input?: number): AudioNode; + connect(destination: AudioParam, output?: number): void; + disconnect(output?: number): void; + disconnect(destination: AudioNode, output?: number, input?: number): void; + disconnect(destination: AudioParam, output?: number): void; +} + +declare var AudioNode: { + prototype: AudioNode; + new(): AudioNode; +} + +interface AudioParam { + readonly defaultValue: number; + value: number; + cancelScheduledValues(startTime: number): AudioParam; + exponentialRampToValueAtTime(value: number, endTime: number): AudioParam; + linearRampToValueAtTime(value: number, endTime: number): AudioParam; + setTargetAtTime(target: number, startTime: number, timeConstant: number): AudioParam; + setValueAtTime(value: number, startTime: number): AudioParam; + setValueCurveAtTime(values: Float32Array, startTime: number, duration: number): AudioParam; +} + +declare var AudioParam: { + prototype: AudioParam; + new(): AudioParam; +} + +interface AudioProcessingEvent extends Event { + readonly inputBuffer: AudioBuffer; + readonly outputBuffer: AudioBuffer; + readonly playbackTime: number; +} + +declare var AudioProcessingEvent: { + prototype: AudioProcessingEvent; + new(): AudioProcessingEvent; +} + +interface AudioTrack { + enabled: boolean; + readonly id: string; + kind: string; + readonly label: string; + language: string; + readonly sourceBuffer: SourceBuffer; +} + +declare var AudioTrack: { + prototype: AudioTrack; + new(): AudioTrack; +} + +interface AudioTrackListEventMap { + "addtrack": TrackEvent; + "change": Event; + "removetrack": TrackEvent; +} + +interface AudioTrackList extends EventTarget { + readonly length: number; + onaddtrack: (this: AudioTrackList, ev: TrackEvent) => any; + onchange: (this: AudioTrackList, ev: Event) => any; + onremovetrack: (this: AudioTrackList, ev: TrackEvent) => any; + getTrackById(id: string): AudioTrack | null; + item(index: number): AudioTrack; + addEventListener(type: K, listener: (this: AudioTrackList, ev: AudioTrackListEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: AudioTrack; +} + +declare var AudioTrackList: { + prototype: AudioTrackList; + new(): AudioTrackList; +} + +interface BarProp { + readonly visible: boolean; +} + +declare var BarProp: { + prototype: BarProp; + new(): BarProp; +} + +interface BeforeUnloadEvent extends Event { + returnValue: any; +} + +declare var BeforeUnloadEvent: { + prototype: BeforeUnloadEvent; + new(): BeforeUnloadEvent; +} + +interface BiquadFilterNode extends AudioNode { + readonly Q: AudioParam; + readonly detune: AudioParam; + readonly frequency: AudioParam; + readonly gain: AudioParam; + type: BiquadFilterType; + getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void; +} + +declare var BiquadFilterNode: { + prototype: BiquadFilterNode; + new(): BiquadFilterNode; +} + +interface Blob { + readonly size: number; + readonly type: string; + msClose(): void; + msDetachStream(): any; + slice(start?: number, end?: number, contentType?: string): Blob; +} + +declare var Blob: { + prototype: Blob; + new (blobParts?: any[], options?: BlobPropertyBag): Blob; +} + +interface CDATASection extends Text { +} + +declare var CDATASection: { + prototype: CDATASection; + new(): CDATASection; +} + +interface CSS { + supports(property: string, value?: string): boolean; +} +declare var CSS: CSS; + +interface CSSConditionRule extends CSSGroupingRule { + conditionText: string; +} + +declare var CSSConditionRule: { + prototype: CSSConditionRule; + new(): CSSConditionRule; +} + +interface CSSFontFaceRule extends CSSRule { + readonly style: CSSStyleDeclaration; +} + +declare var CSSFontFaceRule: { + prototype: CSSFontFaceRule; + new(): CSSFontFaceRule; +} + +interface CSSGroupingRule extends CSSRule { + readonly cssRules: CSSRuleList; + deleteRule(index: number): void; + insertRule(rule: string, index: number): number; +} + +declare var CSSGroupingRule: { + prototype: CSSGroupingRule; + new(): CSSGroupingRule; +} + +interface CSSImportRule extends CSSRule { + readonly href: string; + readonly media: MediaList; + readonly styleSheet: CSSStyleSheet; +} + +declare var CSSImportRule: { + prototype: CSSImportRule; + new(): CSSImportRule; +} + +interface CSSKeyframeRule extends CSSRule { + keyText: string; + readonly style: CSSStyleDeclaration; +} + +declare var CSSKeyframeRule: { + prototype: CSSKeyframeRule; + new(): CSSKeyframeRule; +} + +interface CSSKeyframesRule extends CSSRule { + readonly cssRules: CSSRuleList; + name: string; + appendRule(rule: string): void; + deleteRule(rule: string): void; + findRule(rule: string): CSSKeyframeRule; +} + +declare var CSSKeyframesRule: { + prototype: CSSKeyframesRule; + new(): CSSKeyframesRule; +} + +interface CSSMediaRule extends CSSConditionRule { + readonly media: MediaList; +} + +declare var CSSMediaRule: { + prototype: CSSMediaRule; + new(): CSSMediaRule; +} + +interface CSSNamespaceRule extends CSSRule { + readonly namespaceURI: string; + readonly prefix: string; +} + +declare var CSSNamespaceRule: { + prototype: CSSNamespaceRule; + new(): CSSNamespaceRule; +} + +interface CSSPageRule extends CSSRule { + readonly pseudoClass: string; + readonly selector: string; + selectorText: string; + readonly style: CSSStyleDeclaration; +} + +declare var CSSPageRule: { + prototype: CSSPageRule; + new(): CSSPageRule; +} + +interface CSSRule { + cssText: string; + readonly parentRule: CSSRule; + readonly parentStyleSheet: CSSStyleSheet; + readonly type: number; + readonly CHARSET_RULE: number; + readonly FONT_FACE_RULE: number; + readonly IMPORT_RULE: number; + readonly KEYFRAMES_RULE: number; + readonly KEYFRAME_RULE: number; + readonly MEDIA_RULE: number; + readonly NAMESPACE_RULE: number; + readonly PAGE_RULE: number; + readonly STYLE_RULE: number; + readonly SUPPORTS_RULE: number; + readonly UNKNOWN_RULE: number; + readonly VIEWPORT_RULE: number; +} + +declare var CSSRule: { + prototype: CSSRule; + new(): CSSRule; + readonly CHARSET_RULE: number; + readonly FONT_FACE_RULE: number; + readonly IMPORT_RULE: number; + readonly KEYFRAMES_RULE: number; + readonly KEYFRAME_RULE: number; + readonly MEDIA_RULE: number; + readonly NAMESPACE_RULE: number; + readonly PAGE_RULE: number; + readonly STYLE_RULE: number; + readonly SUPPORTS_RULE: number; + readonly UNKNOWN_RULE: number; + readonly VIEWPORT_RULE: number; +} + +interface CSSRuleList { + readonly length: number; + item(index: number): CSSRule; + [index: number]: CSSRule; +} + +declare var CSSRuleList: { + prototype: CSSRuleList; + new(): CSSRuleList; +} + +interface CSSStyleDeclaration { + alignContent: string | null; + alignItems: string | null; + alignSelf: string | null; + alignmentBaseline: string | null; + animation: string | null; + animationDelay: string | null; + animationDirection: string | null; + animationDuration: string | null; + animationFillMode: string | null; + animationIterationCount: string | null; + animationName: string | null; + animationPlayState: string | null; + animationTimingFunction: string | null; + backfaceVisibility: string | null; + background: string | null; + backgroundAttachment: string | null; + backgroundClip: string | null; + backgroundColor: string | null; + backgroundImage: string | null; + backgroundOrigin: string | null; + backgroundPosition: string | null; + backgroundPositionX: string | null; + backgroundPositionY: string | null; + backgroundRepeat: string | null; + backgroundSize: string | null; + baselineShift: string | null; + border: string | null; + borderBottom: string | null; + borderBottomColor: string | null; + borderBottomLeftRadius: string | null; + borderBottomRightRadius: string | null; + borderBottomStyle: string | null; + borderBottomWidth: string | null; + borderCollapse: string | null; + borderColor: string | null; + borderImage: string | null; + borderImageOutset: string | null; + borderImageRepeat: string | null; + borderImageSlice: string | null; + borderImageSource: string | null; + borderImageWidth: string | null; + borderLeft: string | null; + borderLeftColor: string | null; + borderLeftStyle: string | null; + borderLeftWidth: string | null; + borderRadius: string | null; + borderRight: string | null; + borderRightColor: string | null; + borderRightStyle: string | null; + borderRightWidth: string | null; + borderSpacing: string | null; + borderStyle: string | null; + borderTop: string | null; + borderTopColor: string | null; + borderTopLeftRadius: string | null; + borderTopRightRadius: string | null; + borderTopStyle: string | null; + borderTopWidth: string | null; + borderWidth: string | null; + bottom: string | null; + boxShadow: string | null; + boxSizing: string | null; + breakAfter: string | null; + breakBefore: string | null; + breakInside: string | null; + captionSide: string | null; + clear: string | null; + clip: string | null; + clipPath: string | null; + clipRule: string | null; + color: string | null; + colorInterpolationFilters: string | null; + columnCount: any; + columnFill: string | null; + columnGap: any; + columnRule: string | null; + columnRuleColor: any; + columnRuleStyle: string | null; + columnRuleWidth: any; + columnSpan: string | null; + columnWidth: any; + columns: string | null; + content: string | null; + counterIncrement: string | null; + counterReset: string | null; + cssFloat: string | null; + cssText: string; + cursor: string | null; + direction: string | null; + display: string | null; + dominantBaseline: string | null; + emptyCells: string | null; + enableBackground: string | null; + fill: string | null; + fillOpacity: string | null; + fillRule: string | null; + filter: string | null; + flex: string | null; + flexBasis: string | null; + flexDirection: string | null; + flexFlow: string | null; + flexGrow: string | null; + flexShrink: string | null; + flexWrap: string | null; + floodColor: string | null; + floodOpacity: string | null; + font: string | null; + fontFamily: string | null; + fontFeatureSettings: string | null; + fontSize: string | null; + fontSizeAdjust: string | null; + fontStretch: string | null; + fontStyle: string | null; + fontVariant: string | null; + fontWeight: string | null; + glyphOrientationHorizontal: string | null; + glyphOrientationVertical: string | null; + height: string | null; + imeMode: string | null; + justifyContent: string | null; + kerning: string | null; + layoutGrid: string | null; + layoutGridChar: string | null; + layoutGridLine: string | null; + layoutGridMode: string | null; + layoutGridType: string | null; + left: string | null; + readonly length: number; + letterSpacing: string | null; + lightingColor: string | null; + lineBreak: string | null; + lineHeight: string | null; + listStyle: string | null; + listStyleImage: string | null; + listStylePosition: string | null; + listStyleType: string | null; + margin: string | null; + marginBottom: string | null; + marginLeft: string | null; + marginRight: string | null; + marginTop: string | null; + marker: string | null; + markerEnd: string | null; + markerMid: string | null; + markerStart: string | null; + mask: string | null; + maxHeight: string | null; + maxWidth: string | null; + minHeight: string | null; + minWidth: string | null; + msContentZoomChaining: string | null; + msContentZoomLimit: string | null; + msContentZoomLimitMax: any; + msContentZoomLimitMin: any; + msContentZoomSnap: string | null; + msContentZoomSnapPoints: string | null; + msContentZoomSnapType: string | null; + msContentZooming: string | null; + msFlowFrom: string | null; + msFlowInto: string | null; + msFontFeatureSettings: string | null; + msGridColumn: any; + msGridColumnAlign: string | null; + msGridColumnSpan: any; + msGridColumns: string | null; + msGridRow: any; + msGridRowAlign: string | null; + msGridRowSpan: any; + msGridRows: string | null; + msHighContrastAdjust: string | null; + msHyphenateLimitChars: string | null; + msHyphenateLimitLines: any; + msHyphenateLimitZone: any; + msHyphens: string | null; + msImeAlign: string | null; + msOverflowStyle: string | null; + msScrollChaining: string | null; + msScrollLimit: string | null; + msScrollLimitXMax: any; + msScrollLimitXMin: any; + msScrollLimitYMax: any; + msScrollLimitYMin: any; + msScrollRails: string | null; + msScrollSnapPointsX: string | null; + msScrollSnapPointsY: string | null; + msScrollSnapType: string | null; + msScrollSnapX: string | null; + msScrollSnapY: string | null; + msScrollTranslation: string | null; + msTextCombineHorizontal: string | null; + msTextSizeAdjust: any; + msTouchAction: string | null; + msTouchSelect: string | null; + msUserSelect: string | null; + msWrapFlow: string; + msWrapMargin: any; + msWrapThrough: string; + opacity: string | null; + order: string | null; + orphans: string | null; + outline: string | null; + outlineColor: string | null; + outlineOffset: string | null; + outlineStyle: string | null; + outlineWidth: string | null; + overflow: string | null; + overflowX: string | null; + overflowY: string | null; + padding: string | null; + paddingBottom: string | null; + paddingLeft: string | null; + paddingRight: string | null; + paddingTop: string | null; + pageBreakAfter: string | null; + pageBreakBefore: string | null; + pageBreakInside: string | null; + readonly parentRule: CSSRule; + perspective: string | null; + perspectiveOrigin: string | null; + pointerEvents: string | null; + position: string | null; + quotes: string | null; + right: string | null; + rotate: string | null; + rubyAlign: string | null; + rubyOverhang: string | null; + rubyPosition: string | null; + scale: string | null; + stopColor: string | null; + stopOpacity: string | null; + stroke: string | null; + strokeDasharray: string | null; + strokeDashoffset: string | null; + strokeLinecap: string | null; + strokeLinejoin: string | null; + strokeMiterlimit: string | null; + strokeOpacity: string | null; + strokeWidth: string | null; + tableLayout: string | null; + textAlign: string | null; + textAlignLast: string | null; + textAnchor: string | null; + textDecoration: string | null; + textIndent: string | null; + textJustify: string | null; + textKashida: string | null; + textKashidaSpace: string | null; + textOverflow: string | null; + textShadow: string | null; + textTransform: string | null; + textUnderlinePosition: string | null; + top: string | null; + touchAction: string | null; + transform: string | null; + transformOrigin: string | null; + transformStyle: string | null; + transition: string | null; + transitionDelay: string | null; + transitionDuration: string | null; + transitionProperty: string | null; + transitionTimingFunction: string | null; + translate: string | null; + unicodeBidi: string | null; + verticalAlign: string | null; + visibility: string | null; + webkitAlignContent: string | null; + webkitAlignItems: string | null; + webkitAlignSelf: string | null; + webkitAnimation: string | null; + webkitAnimationDelay: string | null; + webkitAnimationDirection: string | null; + webkitAnimationDuration: string | null; + webkitAnimationFillMode: string | null; + webkitAnimationIterationCount: string | null; + webkitAnimationName: string | null; + webkitAnimationPlayState: string | null; + webkitAnimationTimingFunction: string | null; + webkitAppearance: string | null; + webkitBackfaceVisibility: string | null; + webkitBackgroundClip: string | null; + webkitBackgroundOrigin: string | null; + webkitBackgroundSize: string | null; + webkitBorderBottomLeftRadius: string | null; + webkitBorderBottomRightRadius: string | null; + webkitBorderImage: string | null; + webkitBorderRadius: string | null; + webkitBorderTopLeftRadius: string | null; + webkitBorderTopRightRadius: string | null; + webkitBoxAlign: string | null; + webkitBoxDirection: string | null; + webkitBoxFlex: string | null; + webkitBoxOrdinalGroup: string | null; + webkitBoxOrient: string | null; + webkitBoxPack: string | null; + webkitBoxSizing: string | null; + webkitColumnBreakAfter: string | null; + webkitColumnBreakBefore: string | null; + webkitColumnBreakInside: string | null; + webkitColumnCount: any; + webkitColumnGap: any; + webkitColumnRule: string | null; + webkitColumnRuleColor: any; + webkitColumnRuleStyle: string | null; + webkitColumnRuleWidth: any; + webkitColumnSpan: string | null; + webkitColumnWidth: any; + webkitColumns: string | null; + webkitFilter: string | null; + webkitFlex: string | null; + webkitFlexBasis: string | null; + webkitFlexDirection: string | null; + webkitFlexFlow: string | null; + webkitFlexGrow: string | null; + webkitFlexShrink: string | null; + webkitFlexWrap: string | null; + webkitJustifyContent: string | null; + webkitOrder: string | null; + webkitPerspective: string | null; + webkitPerspectiveOrigin: string | null; + webkitTapHighlightColor: string | null; + webkitTextFillColor: string | null; + webkitTextSizeAdjust: any; + webkitTextStroke: string | null; + webkitTextStrokeColor: string | null; + webkitTextStrokeWidth: string | null; + webkitTransform: string | null; + webkitTransformOrigin: string | null; + webkitTransformStyle: string | null; + webkitTransition: string | null; + webkitTransitionDelay: string | null; + webkitTransitionDuration: string | null; + webkitTransitionProperty: string | null; + webkitTransitionTimingFunction: string | null; + webkitUserModify: string | null; + webkitUserSelect: string | null; + webkitWritingMode: string | null; + whiteSpace: string | null; + widows: string | null; + width: string | null; + wordBreak: string | null; + wordSpacing: string | null; + wordWrap: string | null; + writingMode: string | null; + zIndex: string | null; + zoom: string | null; + resize: string | null; + userSelect: string | null; + getPropertyPriority(propertyName: string): string; + getPropertyValue(propertyName: string): string; + item(index: number): string; + removeProperty(propertyName: string): string; + setProperty(propertyName: string, value: string | null, priority?: string): void; + [index: number]: string; +} + +declare var CSSStyleDeclaration: { + prototype: CSSStyleDeclaration; + new(): CSSStyleDeclaration; +} + +interface CSSStyleRule extends CSSRule { + readonly readOnly: boolean; + selectorText: string; + readonly style: CSSStyleDeclaration; +} + +declare var CSSStyleRule: { + prototype: CSSStyleRule; + new(): CSSStyleRule; +} + +interface CSSStyleSheet extends StyleSheet { + readonly cssRules: CSSRuleList; + cssText: string; + readonly id: string; + readonly imports: StyleSheetList; + readonly isAlternate: boolean; + readonly isPrefAlternate: boolean; + readonly ownerRule: CSSRule; + readonly owningElement: Element; + readonly pages: StyleSheetPageList; + readonly readOnly: boolean; + readonly rules: CSSRuleList; + addImport(bstrURL: string, lIndex?: number): number; + addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; + addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; + deleteRule(index?: number): void; + insertRule(rule: string, index?: number): number; + removeImport(lIndex: number): void; + removeRule(lIndex: number): void; +} + +declare var CSSStyleSheet: { + prototype: CSSStyleSheet; + new(): CSSStyleSheet; +} + +interface CSSSupportsRule extends CSSConditionRule { +} + +declare var CSSSupportsRule: { + prototype: CSSSupportsRule; + new(): CSSSupportsRule; +} + +interface Cache { + add(request: RequestInfo): Promise; + addAll(requests: RequestInfo[]): Promise; + delete(request: RequestInfo, options?: CacheQueryOptions): Promise; + keys(request?: RequestInfo, options?: CacheQueryOptions): any; + match(request: RequestInfo, options?: CacheQueryOptions): Promise; + matchAll(request?: RequestInfo, options?: CacheQueryOptions): any; + put(request: RequestInfo, response: Response): Promise; +} + +declare var Cache: { + prototype: Cache; + new(): Cache; +} + +interface CacheStorage { + delete(cacheName: string): Promise; + has(cacheName: string): Promise; + keys(): any; + match(request: RequestInfo, options?: CacheQueryOptions): Promise; + open(cacheName: string): Promise; +} + +declare var CacheStorage: { + prototype: CacheStorage; + new(): CacheStorage; +} + +interface CanvasGradient { + addColorStop(offset: number, color: string): void; +} + +declare var CanvasGradient: { + prototype: CanvasGradient; + new(): CanvasGradient; +} + +interface CanvasPattern { + setTransform(matrix: SVGMatrix): void; +} + +declare var CanvasPattern: { + prototype: CanvasPattern; + new(): CanvasPattern; +} + +interface CanvasRenderingContext2D extends Object, CanvasPathMethods { + readonly canvas: HTMLCanvasElement; + fillStyle: string | CanvasGradient | CanvasPattern; + font: string; + globalAlpha: number; + globalCompositeOperation: string; + imageSmoothingEnabled: boolean; + lineCap: string; + lineDashOffset: number; + lineJoin: string; + lineWidth: number; + miterLimit: number; + msFillRule: CanvasFillRule; + shadowBlur: number; + shadowColor: string; + shadowOffsetX: number; + shadowOffsetY: number; + strokeStyle: string | CanvasGradient | CanvasPattern; + textAlign: string; + textBaseline: string; + mozImageSmoothingEnabled: boolean; + webkitImageSmoothingEnabled: boolean; + oImageSmoothingEnabled: boolean; + beginPath(): void; + clearRect(x: number, y: number, w: number, h: number): void; + clip(fillRule?: CanvasFillRule): void; + createImageData(imageDataOrSw: number | ImageData, sh?: number): ImageData; + createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; + createPattern(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, repetition: string): CanvasPattern; + createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; + drawFocusIfNeeded(element: Element): void; + drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, dstX: number, dstY: number): void; + drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, dstX: number, dstY: number, dstW: number, dstH: number): void; + drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, srcX: number, srcY: number, srcW: number, srcH: number, dstX: number, dstY: number, dstW: number, dstH: number): void; + fill(fillRule?: CanvasFillRule): void; + fillRect(x: number, y: number, w: number, h: number): void; + fillText(text: string, x: number, y: number, maxWidth?: number): void; + getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; + getLineDash(): number[]; + isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean; + measureText(text: string): TextMetrics; + putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; + restore(): void; + rotate(angle: number): void; + save(): void; + scale(x: number, y: number): void; + setLineDash(segments: number[]): void; + setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + stroke(path?: Path2D): void; + strokeRect(x: number, y: number, w: number, h: number): void; + strokeText(text: string, x: number, y: number, maxWidth?: number): void; + transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + translate(x: number, y: number): void; +} + +declare var CanvasRenderingContext2D: { + prototype: CanvasRenderingContext2D; + new(): CanvasRenderingContext2D; +} + +interface ChannelMergerNode extends AudioNode { +} + +declare var ChannelMergerNode: { + prototype: ChannelMergerNode; + new(): ChannelMergerNode; +} + +interface ChannelSplitterNode extends AudioNode { +} + +declare var ChannelSplitterNode: { + prototype: ChannelSplitterNode; + new(): ChannelSplitterNode; +} + +interface CharacterData extends Node, ChildNode { + data: string; + readonly length: number; + appendData(arg: string): void; + deleteData(offset: number, count: number): void; + insertData(offset: number, arg: string): void; + replaceData(offset: number, count: number, arg: string): void; + substringData(offset: number, count: number): string; +} + +declare var CharacterData: { + prototype: CharacterData; + new(): CharacterData; +} + +interface ClientRect { + bottom: number; + readonly height: number; + left: number; + right: number; + top: number; + readonly width: number; +} + +declare var ClientRect: { + prototype: ClientRect; + new(): ClientRect; +} + +interface ClientRectList { + readonly length: number; + item(index: number): ClientRect; + [index: number]: ClientRect; +} + +declare var ClientRectList: { + prototype: ClientRectList; + new(): ClientRectList; +} + +interface ClipboardEvent extends Event { + readonly clipboardData: DataTransfer; +} + +declare var ClipboardEvent: { + prototype: ClipboardEvent; + new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent; +} + +interface CloseEvent extends Event { + readonly code: number; + readonly reason: string; + readonly wasClean: boolean; + initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; +} + +declare var CloseEvent: { + prototype: CloseEvent; + new(typeArg: string, eventInitDict?: CloseEventInit): CloseEvent; +} + +interface Comment extends CharacterData { + text: string; +} + +declare var Comment: { + prototype: Comment; + new(): Comment; +} + +interface CompositionEvent extends UIEvent { + readonly data: string; + readonly locale: string; + initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; +} + +declare var CompositionEvent: { + prototype: CompositionEvent; + new(typeArg: string, eventInitDict?: CompositionEventInit): CompositionEvent; +} + +interface Console { + assert(test?: boolean, message?: string, ...optionalParams: any[]): void; + clear(): void; + count(countTitle?: string): void; + debug(message?: any, ...optionalParams: any[]): void; + dir(value?: any, ...optionalParams: any[]): void; + dirxml(value: any): void; + error(message?: any, ...optionalParams: any[]): void; + exception(message?: string, ...optionalParams: any[]): void; + group(groupTitle?: string): void; + groupCollapsed(groupTitle?: string): void; + groupEnd(): void; + info(message?: any, ...optionalParams: any[]): void; + log(message?: any, ...optionalParams: any[]): void; + msIsIndependentlyComposed(element: Element): boolean; + profile(reportName?: string): void; + profileEnd(): void; + select(element: Element): void; + table(...data: any[]): void; + time(timerName?: string): void; + timeEnd(timerName?: string): void; + trace(message?: any, ...optionalParams: any[]): void; + warn(message?: any, ...optionalParams: any[]): void; +} + +declare var Console: { + prototype: Console; + new(): Console; +} + +interface ConvolverNode extends AudioNode { + buffer: AudioBuffer | null; + normalize: boolean; +} + +declare var ConvolverNode: { + prototype: ConvolverNode; + new(): ConvolverNode; +} + +interface Coordinates { + readonly accuracy: number; + readonly altitude: number | null; + readonly altitudeAccuracy: number | null; + readonly heading: number | null; + readonly latitude: number; + readonly longitude: number; + readonly speed: number | null; +} + +declare var Coordinates: { + prototype: Coordinates; + new(): Coordinates; +} + +interface Crypto extends Object, RandomSource { + readonly subtle: SubtleCrypto; +} + +declare var Crypto: { + prototype: Crypto; + new(): Crypto; +} + +interface CryptoKey { + readonly algorithm: KeyAlgorithm; + readonly extractable: boolean; + readonly type: string; + readonly usages: string[]; +} + +declare var CryptoKey: { + prototype: CryptoKey; + new(): CryptoKey; +} + +interface CryptoKeyPair { + privateKey: CryptoKey; + publicKey: CryptoKey; +} + +declare var CryptoKeyPair: { + prototype: CryptoKeyPair; + new(): CryptoKeyPair; +} + +interface CustomEvent extends Event { + readonly detail: any; + initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; +} + +declare var CustomEvent: { + prototype: CustomEvent; + new(typeArg: string, eventInitDict?: CustomEventInit): CustomEvent; +} + +interface DOMError { + readonly name: string; + toString(): string; +} + +declare var DOMError: { + prototype: DOMError; + new(): DOMError; +} + +interface DOMException { + readonly code: number; + readonly message: string; + readonly name: string; + toString(): string; + readonly ABORT_ERR: number; + readonly DATA_CLONE_ERR: number; + readonly DOMSTRING_SIZE_ERR: number; + readonly HIERARCHY_REQUEST_ERR: number; + readonly INDEX_SIZE_ERR: number; + readonly INUSE_ATTRIBUTE_ERR: number; + readonly INVALID_ACCESS_ERR: number; + readonly INVALID_CHARACTER_ERR: number; + readonly INVALID_MODIFICATION_ERR: number; + readonly INVALID_NODE_TYPE_ERR: number; + readonly INVALID_STATE_ERR: number; + readonly NAMESPACE_ERR: number; + readonly NETWORK_ERR: number; + readonly NOT_FOUND_ERR: number; + readonly NOT_SUPPORTED_ERR: number; + readonly NO_DATA_ALLOWED_ERR: number; + readonly NO_MODIFICATION_ALLOWED_ERR: number; + readonly PARSE_ERR: number; + readonly QUOTA_EXCEEDED_ERR: number; + readonly SECURITY_ERR: number; + readonly SERIALIZE_ERR: number; + readonly SYNTAX_ERR: number; + readonly TIMEOUT_ERR: number; + readonly TYPE_MISMATCH_ERR: number; + readonly URL_MISMATCH_ERR: number; + readonly VALIDATION_ERR: number; + readonly WRONG_DOCUMENT_ERR: number; +} + +declare var DOMException: { + prototype: DOMException; + new(): DOMException; + readonly ABORT_ERR: number; + readonly DATA_CLONE_ERR: number; + readonly DOMSTRING_SIZE_ERR: number; + readonly HIERARCHY_REQUEST_ERR: number; + readonly INDEX_SIZE_ERR: number; + readonly INUSE_ATTRIBUTE_ERR: number; + readonly INVALID_ACCESS_ERR: number; + readonly INVALID_CHARACTER_ERR: number; + readonly INVALID_MODIFICATION_ERR: number; + readonly INVALID_NODE_TYPE_ERR: number; + readonly INVALID_STATE_ERR: number; + readonly NAMESPACE_ERR: number; + readonly NETWORK_ERR: number; + readonly NOT_FOUND_ERR: number; + readonly NOT_SUPPORTED_ERR: number; + readonly NO_DATA_ALLOWED_ERR: number; + readonly NO_MODIFICATION_ALLOWED_ERR: number; + readonly PARSE_ERR: number; + readonly QUOTA_EXCEEDED_ERR: number; + readonly SECURITY_ERR: number; + readonly SERIALIZE_ERR: number; + readonly SYNTAX_ERR: number; + readonly TIMEOUT_ERR: number; + readonly TYPE_MISMATCH_ERR: number; + readonly URL_MISMATCH_ERR: number; + readonly VALIDATION_ERR: number; + readonly WRONG_DOCUMENT_ERR: number; +} + +interface DOMImplementation { + createDocument(namespaceURI: string | null, qualifiedName: string | null, doctype: DocumentType | null): Document; + createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; + createHTMLDocument(title: string): Document; + hasFeature(feature: string | null, version: string | null): boolean; +} + +declare var DOMImplementation: { + prototype: DOMImplementation; + new(): DOMImplementation; +} + +interface DOMParser { + parseFromString(source: string, mimeType: string): Document; +} + +declare var DOMParser: { + prototype: DOMParser; + new(): DOMParser; +} + +interface DOMSettableTokenList extends DOMTokenList { + value: string; +} + +declare var DOMSettableTokenList: { + prototype: DOMSettableTokenList; + new(): DOMSettableTokenList; +} + +interface DOMStringList { + readonly length: number; + contains(str: string): boolean; + item(index: number): string | null; + [index: number]: string; +} + +declare var DOMStringList: { + prototype: DOMStringList; + new(): DOMStringList; +} + +interface DOMStringMap { + [name: string]: string | undefined; +} + +declare var DOMStringMap: { + prototype: DOMStringMap; + new(): DOMStringMap; +} + +interface DOMTokenList { + readonly length: number; + add(...token: string[]): void; + contains(token: string): boolean; + item(index: number): string; + remove(...token: string[]): void; + toString(): string; + toggle(token: string, force?: boolean): boolean; + [index: number]: string; +} + +declare var DOMTokenList: { + prototype: DOMTokenList; + new(): DOMTokenList; +} + +interface DataCue extends TextTrackCue { + data: ArrayBuffer; + addEventListener(type: K, listener: (this: DataCue, ev: TextTrackCueEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var DataCue: { + prototype: DataCue; + new(): DataCue; +} + +interface DataTransfer { + dropEffect: string; + effectAllowed: string; + readonly files: FileList; + readonly items: DataTransferItemList; + readonly types: string[]; + clearData(format?: string): boolean; + getData(format: string): string; + setData(format: string, data: string): boolean; + setDragImage(image: Element, x: number, y: number): void; +} + +declare var DataTransfer: { + prototype: DataTransfer; + new(): DataTransfer; +} + +interface DataTransferItem { + readonly kind: string; + readonly type: string; + getAsFile(): File | null; + getAsString(_callback: FunctionStringCallback | null): void; + webkitGetAsEntry(): any; +} + +declare var DataTransferItem: { + prototype: DataTransferItem; + new(): DataTransferItem; +} + +interface DataTransferItemList { + readonly length: number; + add(data: File): DataTransferItem | null; + clear(): void; + item(index: number): DataTransferItem; + remove(index: number): void; + [index: number]: DataTransferItem; +} + +declare var DataTransferItemList: { + prototype: DataTransferItemList; + new(): DataTransferItemList; +} + +interface DeferredPermissionRequest { + readonly id: number; + readonly type: MSWebViewPermissionType; + readonly uri: string; + allow(): void; + deny(): void; +} + +declare var DeferredPermissionRequest: { + prototype: DeferredPermissionRequest; + new(): DeferredPermissionRequest; +} + +interface DelayNode extends AudioNode { + readonly delayTime: AudioParam; +} + +declare var DelayNode: { + prototype: DelayNode; + new(): DelayNode; +} + +interface DeviceAcceleration { + readonly x: number | null; + readonly y: number | null; + readonly z: number | null; +} + +declare var DeviceAcceleration: { + prototype: DeviceAcceleration; + new(): DeviceAcceleration; +} + +interface DeviceLightEvent extends Event { + readonly value: number; +} + +declare var DeviceLightEvent: { + prototype: DeviceLightEvent; + new(typeArg: string, eventInitDict?: DeviceLightEventInit): DeviceLightEvent; +} + +interface DeviceMotionEvent extends Event { + readonly acceleration: DeviceAcceleration | null; + readonly accelerationIncludingGravity: DeviceAcceleration | null; + readonly interval: number | null; + readonly rotationRate: DeviceRotationRate | null; + initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict | null, accelerationIncludingGravity: DeviceAccelerationDict | null, rotationRate: DeviceRotationRateDict | null, interval: number | null): void; +} + +declare var DeviceMotionEvent: { + prototype: DeviceMotionEvent; + new(typeArg: string, eventInitDict?: DeviceMotionEventInit): DeviceMotionEvent; +} + +interface DeviceOrientationEvent extends Event { + readonly absolute: boolean; + readonly alpha: number | null; + readonly beta: number | null; + readonly gamma: number | null; + initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number | null, beta: number | null, gamma: number | null, absolute: boolean): void; +} + +declare var DeviceOrientationEvent: { + prototype: DeviceOrientationEvent; + new(typeArg: string, eventInitDict?: DeviceOrientationEventInit): DeviceOrientationEvent; +} + +interface DeviceRotationRate { + readonly alpha: number | null; + readonly beta: number | null; + readonly gamma: number | null; +} + +declare var DeviceRotationRate: { + prototype: DeviceRotationRate; + new(): DeviceRotationRate; +} + +interface DocumentEventMap extends GlobalEventHandlersEventMap { + "abort": UIEvent; + "activate": UIEvent; + "beforeactivate": UIEvent; + "beforedeactivate": UIEvent; + "blur": FocusEvent; + "canplay": Event; + "canplaythrough": Event; + "change": Event; + "click": MouseEvent; + "contextmenu": PointerEvent; + "dblclick": MouseEvent; + "deactivate": UIEvent; + "drag": DragEvent; + "dragend": DragEvent; + "dragenter": DragEvent; + "dragleave": DragEvent; + "dragover": DragEvent; + "dragstart": DragEvent; + "drop": DragEvent; + "durationchange": Event; + "emptied": Event; + "ended": MediaStreamErrorEvent; + "error": ErrorEvent; + "focus": FocusEvent; + "fullscreenchange": Event; + "fullscreenerror": Event; + "input": Event; + "invalid": Event; + "keydown": KeyboardEvent; + "keypress": KeyboardEvent; + "keyup": KeyboardEvent; + "load": Event; + "loadeddata": Event; + "loadedmetadata": Event; + "loadstart": Event; + "mousedown": MouseEvent; + "mousemove": MouseEvent; + "mouseout": MouseEvent; + "mouseover": MouseEvent; + "mouseup": MouseEvent; + "mousewheel": WheelEvent; + "MSContentZoom": UIEvent; + "MSGestureChange": MSGestureEvent; + "MSGestureDoubleTap": MSGestureEvent; + "MSGestureEnd": MSGestureEvent; + "MSGestureHold": MSGestureEvent; + "MSGestureStart": MSGestureEvent; + "MSGestureTap": MSGestureEvent; + "MSInertiaStart": MSGestureEvent; + "MSManipulationStateChanged": MSManipulationEvent; + "MSPointerCancel": MSPointerEvent; + "MSPointerDown": MSPointerEvent; + "MSPointerEnter": MSPointerEvent; + "MSPointerLeave": MSPointerEvent; + "MSPointerMove": MSPointerEvent; + "MSPointerOut": MSPointerEvent; + "MSPointerOver": MSPointerEvent; + "MSPointerUp": MSPointerEvent; + "mssitemodejumplistitemremoved": MSSiteModeEvent; + "msthumbnailclick": MSSiteModeEvent; + "pause": Event; + "play": Event; + "playing": Event; + "pointerlockchange": Event; + "pointerlockerror": Event; + "progress": ProgressEvent; + "ratechange": Event; + "readystatechange": Event; + "reset": Event; + "scroll": UIEvent; + "seeked": Event; + "seeking": Event; + "select": UIEvent; + "selectionchange": Event; + "selectstart": Event; + "stalled": Event; + "stop": Event; + "submit": Event; + "suspend": Event; + "timeupdate": Event; + "touchcancel": TouchEvent; + "touchend": TouchEvent; + "touchmove": TouchEvent; + "touchstart": TouchEvent; + "volumechange": Event; + "waiting": Event; + "webkitfullscreenchange": Event; + "webkitfullscreenerror": Event; +} + +interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEvent, ParentNode, DocumentOrShadowRoot { + /** + * Sets or gets the URL for the current document. + */ + readonly URL: string; + /** + * Gets the URL for the document, stripped of any character encoding. + */ + readonly URLUnencoded: string; + /** + * Gets the object that has the focus when the parent document has focus. + */ + readonly activeElement: Element; + /** + * Sets or gets the color of all active links in the document. + */ + alinkColor: string; + /** + * Returns a reference to the collection of elements contained by the object. + */ + readonly all: HTMLAllCollection; + /** + * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. + */ + anchors: HTMLCollectionOf; + /** + * Retrieves a collection of all applet objects in the document. + */ + applets: HTMLCollectionOf; + /** + * Deprecated. Sets or retrieves a value that indicates the background color behind the object. + */ + bgColor: string; + /** + * Specifies the beginning and end of the document body. + */ + body: HTMLElement; + readonly characterSet: string; + /** + * Gets or sets the character set used to encode the object. + */ + charset: string; + /** + * Gets a value that indicates whether standards-compliant mode is switched on for the object. + */ + readonly compatMode: string; + cookie: string; + readonly currentScript: HTMLScriptElement | SVGScriptElement; + readonly defaultView: Window; + /** + * Sets or gets a value that indicates whether the document can be edited. + */ + designMode: string; + /** + * Sets or retrieves a value that indicates the reading order of the object. + */ + dir: string; + /** + * Gets an object representing the document type declaration associated with the current document. + */ + readonly doctype: DocumentType; + /** + * Gets a reference to the root node of the document. + */ + documentElement: HTMLElement; + /** + * Sets or gets the security domain of the document. + */ + domain: string; + /** + * Retrieves a collection of all embed objects in the document. + */ + embeds: HTMLCollectionOf; + /** + * Sets or gets the foreground (text) color of the document. + */ + fgColor: string; + /** + * Retrieves a collection, in source order, of all form objects in the document. + */ + forms: HTMLCollectionOf; + readonly fullscreenElement: Element | null; + readonly fullscreenEnabled: boolean; + readonly head: HTMLHeadElement; + readonly hidden: boolean; + /** + * Retrieves a collection, in source order, of img objects in the document. + */ + images: HTMLCollectionOf; + /** + * Gets the implementation object of the current document. + */ + readonly implementation: DOMImplementation; + /** + * Returns the character encoding used to create the webpage that is loaded into the document object. + */ + readonly inputEncoding: string | null; + /** + * Gets the date that the page was last modified, if the page supplies one. + */ + readonly lastModified: string; + /** + * Sets or gets the color of the document links. + */ + linkColor: string; + /** + * Retrieves a collection of all a objects that specify the href property and all area objects in the document. + */ + links: HTMLCollectionOf; + /** + * Contains information about the current URL. + */ + readonly location: Location; + msCSSOMElementFloatMetrics: boolean; + msCapsLockWarningOff: boolean; + /** + * Fires when the user aborts the download. + * @param ev The event. + */ + onabort: (this: Document, ev: UIEvent) => any; + /** + * Fires when the object is set as the active element. + * @param ev The event. + */ + onactivate: (this: Document, ev: UIEvent) => any; + /** + * Fires immediately before the object is set as the active element. + * @param ev The event. + */ + onbeforeactivate: (this: Document, ev: UIEvent) => any; + /** + * Fires immediately before the activeElement is changed from the current object to another object in the parent document. + * @param ev The event. + */ + onbeforedeactivate: (this: Document, ev: UIEvent) => any; + /** + * Fires when the object loses the input focus. + * @param ev The focus event. + */ + onblur: (this: Document, ev: FocusEvent) => any; + /** + * Occurs when playback is possible, but would require further buffering. + * @param ev The event. + */ + oncanplay: (this: Document, ev: Event) => any; + oncanplaythrough: (this: Document, ev: Event) => any; + /** + * Fires when the contents of the object or selection have changed. + * @param ev The event. + */ + onchange: (this: Document, ev: Event) => any; + /** + * Fires when the user clicks the left mouse button on the object + * @param ev The mouse event. + */ + onclick: (this: Document, ev: MouseEvent) => any; + /** + * Fires when the user clicks the right mouse button in the client area, opening the context menu. + * @param ev The mouse event. + */ + oncontextmenu: (this: Document, ev: PointerEvent) => any; + /** + * Fires when the user double-clicks the object. + * @param ev The mouse event. + */ + ondblclick: (this: Document, ev: MouseEvent) => any; + /** + * Fires when the activeElement is changed from the current object to another object in the parent document. + * @param ev The UI Event + */ + ondeactivate: (this: Document, ev: UIEvent) => any; + /** + * Fires on the source object continuously during a drag operation. + * @param ev The event. + */ + ondrag: (this: Document, ev: DragEvent) => any; + /** + * Fires on the source object when the user releases the mouse at the close of a drag operation. + * @param ev The event. + */ + ondragend: (this: Document, ev: DragEvent) => any; + /** + * Fires on the target element when the user drags the object to a valid drop target. + * @param ev The drag event. + */ + ondragenter: (this: Document, ev: DragEvent) => any; + /** + * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. + * @param ev The drag event. + */ + ondragleave: (this: Document, ev: DragEvent) => any; + /** + * Fires on the target element continuously while the user drags the object over a valid drop target. + * @param ev The event. + */ + ondragover: (this: Document, ev: DragEvent) => any; + /** + * Fires on the source object when the user starts to drag a text selection or selected object. + * @param ev The event. + */ + ondragstart: (this: Document, ev: DragEvent) => any; + ondrop: (this: Document, ev: DragEvent) => any; + /** + * Occurs when the duration attribute is updated. + * @param ev The event. + */ + ondurationchange: (this: Document, ev: Event) => any; + /** + * Occurs when the media element is reset to its initial state. + * @param ev The event. + */ + onemptied: (this: Document, ev: Event) => any; + /** + * Occurs when the end of playback is reached. + * @param ev The event + */ + onended: (this: Document, ev: MediaStreamErrorEvent) => any; + /** + * Fires when an error occurs during object loading. + * @param ev The event. + */ + onerror: (this: Document, ev: ErrorEvent) => any; + /** + * Fires when the object receives focus. + * @param ev The event. + */ + onfocus: (this: Document, ev: FocusEvent) => any; + onfullscreenchange: (this: Document, ev: Event) => any; + onfullscreenerror: (this: Document, ev: Event) => any; + oninput: (this: Document, ev: Event) => any; + oninvalid: (this: Document, ev: Event) => any; + /** + * Fires when the user presses a key. + * @param ev The keyboard event + */ + onkeydown: (this: Document, ev: KeyboardEvent) => any; + /** + * Fires when the user presses an alphanumeric key. + * @param ev The event. + */ + onkeypress: (this: Document, ev: KeyboardEvent) => any; + /** + * Fires when the user releases a key. + * @param ev The keyboard event + */ + onkeyup: (this: Document, ev: KeyboardEvent) => any; + /** + * Fires immediately after the browser loads the object. + * @param ev The event. + */ + onload: (this: Document, ev: Event) => any; + /** + * Occurs when media data is loaded at the current playback position. + * @param ev The event. + */ + onloadeddata: (this: Document, ev: Event) => any; + /** + * Occurs when the duration and dimensions of the media have been determined. + * @param ev The event. + */ + onloadedmetadata: (this: Document, ev: Event) => any; + /** + * Occurs when Internet Explorer begins looking for media data. + * @param ev The event. + */ + onloadstart: (this: Document, ev: Event) => any; + /** + * Fires when the user clicks the object with either mouse button. + * @param ev The mouse event. + */ + onmousedown: (this: Document, ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse over the object. + * @param ev The mouse event. + */ + onmousemove: (this: Document, ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse pointer outside the boundaries of the object. + * @param ev The mouse event. + */ + onmouseout: (this: Document, ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse pointer into the object. + * @param ev The mouse event. + */ + onmouseover: (this: Document, ev: MouseEvent) => any; + /** + * Fires when the user releases a mouse button while the mouse is over the object. + * @param ev The mouse event. + */ + onmouseup: (this: Document, ev: MouseEvent) => any; + /** + * Fires when the wheel button is rotated. + * @param ev The mouse event + */ + onmousewheel: (this: Document, ev: WheelEvent) => any; + onmscontentzoom: (this: Document, ev: UIEvent) => any; + onmsgesturechange: (this: Document, ev: MSGestureEvent) => any; + onmsgesturedoubletap: (this: Document, ev: MSGestureEvent) => any; + onmsgestureend: (this: Document, ev: MSGestureEvent) => any; + onmsgesturehold: (this: Document, ev: MSGestureEvent) => any; + onmsgesturestart: (this: Document, ev: MSGestureEvent) => any; + onmsgesturetap: (this: Document, ev: MSGestureEvent) => any; + onmsinertiastart: (this: Document, ev: MSGestureEvent) => any; + onmsmanipulationstatechanged: (this: Document, ev: MSManipulationEvent) => any; + onmspointercancel: (this: Document, ev: MSPointerEvent) => any; + onmspointerdown: (this: Document, ev: MSPointerEvent) => any; + onmspointerenter: (this: Document, ev: MSPointerEvent) => any; + onmspointerleave: (this: Document, ev: MSPointerEvent) => any; + onmspointermove: (this: Document, ev: MSPointerEvent) => any; + onmspointerout: (this: Document, ev: MSPointerEvent) => any; + onmspointerover: (this: Document, ev: MSPointerEvent) => any; + onmspointerup: (this: Document, ev: MSPointerEvent) => any; + /** + * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. + * @param ev The event. + */ + onmssitemodejumplistitemremoved: (this: Document, ev: MSSiteModeEvent) => any; + /** + * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. + * @param ev The event. + */ + onmsthumbnailclick: (this: Document, ev: MSSiteModeEvent) => any; + /** + * Occurs when playback is paused. + * @param ev The event. + */ + onpause: (this: Document, ev: Event) => any; + /** + * Occurs when the play method is requested. + * @param ev The event. + */ + onplay: (this: Document, ev: Event) => any; + /** + * Occurs when the audio or video has started playing. + * @param ev The event. + */ + onplaying: (this: Document, ev: Event) => any; + onpointerlockchange: (this: Document, ev: Event) => any; + onpointerlockerror: (this: Document, ev: Event) => any; + /** + * Occurs to indicate progress while downloading media data. + * @param ev The event. + */ + onprogress: (this: Document, ev: ProgressEvent) => any; + /** + * Occurs when the playback rate is increased or decreased. + * @param ev The event. + */ + onratechange: (this: Document, ev: Event) => any; + /** + * Fires when the state of the object has changed. + * @param ev The event + */ + onreadystatechange: (this: Document, ev: Event) => any; + /** + * Fires when the user resets a form. + * @param ev The event. + */ + onreset: (this: Document, ev: Event) => any; + /** + * Fires when the user repositions the scroll box in the scroll bar on the object. + * @param ev The event. + */ + onscroll: (this: Document, ev: UIEvent) => any; + /** + * Occurs when the seek operation ends. + * @param ev The event. + */ + onseeked: (this: Document, ev: Event) => any; + /** + * Occurs when the current playback position is moved. + * @param ev The event. + */ + onseeking: (this: Document, ev: Event) => any; + /** + * Fires when the current selection changes. + * @param ev The event. + */ + onselect: (this: Document, ev: UIEvent) => any; + /** + * Fires when the selection state of a document changes. + * @param ev The event. + */ + onselectionchange: (this: Document, ev: Event) => any; + onselectstart: (this: Document, ev: Event) => any; + /** + * Occurs when the download has stopped. + * @param ev The event. + */ + onstalled: (this: Document, ev: Event) => any; + /** + * Fires when the user clicks the Stop button or leaves the Web page. + * @param ev The event. + */ + onstop: (this: Document, ev: Event) => any; + onsubmit: (this: Document, ev: Event) => any; + /** + * Occurs if the load operation has been intentionally halted. + * @param ev The event. + */ + onsuspend: (this: Document, ev: Event) => any; + /** + * Occurs to indicate the current playback position. + * @param ev The event. + */ + ontimeupdate: (this: Document, ev: Event) => any; + ontouchcancel: (ev: TouchEvent) => any; + ontouchend: (ev: TouchEvent) => any; + ontouchmove: (ev: TouchEvent) => any; + ontouchstart: (ev: TouchEvent) => any; + /** + * Occurs when the volume is changed, or playback is muted or unmuted. + * @param ev The event. + */ + onvolumechange: (this: Document, ev: Event) => any; + /** + * Occurs when playback stops because the next frame of a video resource is not available. + * @param ev The event. + */ + onwaiting: (this: Document, ev: Event) => any; + onwebkitfullscreenchange: (this: Document, ev: Event) => any; + onwebkitfullscreenerror: (this: Document, ev: Event) => any; + plugins: HTMLCollectionOf; + readonly pointerLockElement: Element; + /** + * Retrieves a value that indicates the current state of the object. + */ + readonly readyState: string; + /** + * Gets the URL of the location that referred the user to the current page. + */ + readonly referrer: string; + /** + * Gets the root svg element in the document hierarchy. + */ + readonly rootElement: SVGSVGElement; + /** + * Retrieves a collection of all script objects in the document. + */ + scripts: HTMLCollectionOf; + readonly scrollingElement: Element | null; + /** + * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. + */ + readonly styleSheets: StyleSheetList; + /** + * Contains the title of the document. + */ + title: string; + readonly visibilityState: VisibilityState; + /** + * Sets or gets the color of the links that the user has visited. + */ + vlinkColor: string; + readonly webkitCurrentFullScreenElement: Element | null; + readonly webkitFullscreenElement: Element | null; + readonly webkitFullscreenEnabled: boolean; + readonly webkitIsFullScreen: boolean; + readonly xmlEncoding: string | null; + xmlStandalone: boolean; + /** + * Gets or sets the version attribute specified in the declaration of an XML document. + */ + xmlVersion: string | null; + adoptNode(source: T): T; + captureEvents(): void; + caretRangeFromPoint(x: number, y: number): Range; + clear(): void; + /** + * Closes an output stream and forces the sent data to display. + */ + close(): void; + /** + * Creates an attribute object with a specified name. + * @param name String that sets the attribute object's name. + */ + createAttribute(name: string): Attr; + createAttributeNS(namespaceURI: string | null, qualifiedName: string): Attr; + createCDATASection(data: string): CDATASection; + /** + * Creates a comment object with the specified data. + * @param data Sets the comment object's data. + */ + createComment(data: string): Comment; + /** + * Creates a new document. + */ + createDocumentFragment(): DocumentFragment; + /** + * Creates an instance of the element for the specified tag. + * @param tagName The name of an element. + */ + createElement(tagName: K): HTMLElementTagNameMap[K]; + createElement(tagName: string): HTMLElement; + createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "a"): SVGAElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "circle"): SVGCircleElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "clipPath"): SVGClipPathElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "componentTransferFunction"): SVGComponentTransferFunctionElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "defs"): SVGDefsElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "desc"): SVGDescElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "ellipse"): SVGEllipseElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feBlend"): SVGFEBlendElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feColorMatrix"): SVGFEColorMatrixElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feComponentTransfer"): SVGFEComponentTransferElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feComposite"): SVGFECompositeElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feConvolveMatrix"): SVGFEConvolveMatrixElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDiffuseLighting"): SVGFEDiffuseLightingElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDisplacementMap"): SVGFEDisplacementMapElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDistantLight"): SVGFEDistantLightElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFlood"): SVGFEFloodElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncA"): SVGFEFuncAElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncB"): SVGFEFuncBElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncG"): SVGFEFuncGElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncR"): SVGFEFuncRElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feGaussianBlur"): SVGFEGaussianBlurElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feImage"): SVGFEImageElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMerge"): SVGFEMergeElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMergeNode"): SVGFEMergeNodeElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMorphology"): SVGFEMorphologyElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feOffset"): SVGFEOffsetElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "fePointLight"): SVGFEPointLightElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feSpecularLighting"): SVGFESpecularLightingElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feSpotLight"): SVGFESpotLightElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feTile"): SVGFETileElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feTurbulence"): SVGFETurbulenceElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "filter"): SVGFilterElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "foreignObject"): SVGForeignObjectElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "g"): SVGGElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "image"): SVGImageElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "gradient"): SVGGradientElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "line"): SVGLineElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "linearGradient"): SVGLinearGradientElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "marker"): SVGMarkerElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "mask"): SVGMaskElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "path"): SVGPathElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "metadata"): SVGMetadataElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "pattern"): SVGPatternElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "polygon"): SVGPolygonElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "polyline"): SVGPolylineElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "radialGradient"): SVGRadialGradientElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "rect"): SVGRectElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "svg"): SVGSVGElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "script"): SVGScriptElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "stop"): SVGStopElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "style"): SVGStyleElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "switch"): SVGSwitchElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "symbol"): SVGSymbolElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "tspan"): SVGTSpanElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textContent"): SVGTextContentElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "text"): SVGTextElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textPath"): SVGTextPathElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textPositioning"): SVGTextPositioningElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "title"): SVGTitleElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "use"): SVGUseElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "view"): SVGViewElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement + createElementNS(namespaceURI: string | null, qualifiedName: string): Element; + createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; + createNSResolver(nodeResolver: Node): XPathNSResolver; + /** + * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list + * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. + * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. + */ + createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): NodeIterator; + createProcessingInstruction(target: string, data: string): ProcessingInstruction; + /** + * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. + */ + createRange(): Range; + /** + * Creates a text string from the specified value. + * @param data String that specifies the nodeValue property of the text node. + */ + createTextNode(data: string): Text; + createTouch(view: Window, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch; + createTouchList(...touches: Touch[]): TouchList; + /** + * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. + * @param filter A custom NodeFilter function to use. + * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. + */ + createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker; + /** + * Returns the element for the specified x coordinate and the specified y coordinate. + * @param x The x-offset + * @param y The y-offset + */ + elementFromPoint(x: number, y: number): Element; + evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult; + /** + * Executes a command on the current document, current selection, or the given range. + * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. + * @param showUI Display the user interface, defaults to false. + * @param value Value to assign. + */ + execCommand(commandId: string, showUI?: boolean, value?: any): boolean; + /** + * Displays help information for the given command identifier. + * @param commandId Displays help information for the given command identifier. + */ + execCommandShowHelp(commandId: string): boolean; + exitFullscreen(): void; + exitPointerLock(): void; + /** + * Causes the element to receive the focus and executes the code specified by the onfocus event. + */ + focus(): void; + /** + * Returns a reference to the first object with the specified value of the ID or NAME attribute. + * @param elementId String that specifies the ID value. Case-insensitive. + */ + getElementById(elementId: string): HTMLElement | null; + getElementsByClassName(classNames: string): HTMLCollectionOf; + /** + * Gets a collection of objects based on the value of the NAME or ID attribute. + * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. + */ + getElementsByName(elementName: string): NodeListOf; + /** + * Retrieves a collection of objects based on the specified element name. + * @param name Specifies the name of an element. + */ + getElementsByTagName(tagname: K): ElementListTagNameMap[K]; + getElementsByTagName(tagname: string): NodeListOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf; + /** + * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. + */ + getSelection(): Selection; + /** + * Gets a value indicating whether the object currently has focus. + */ + hasFocus(): boolean; + importNode(importedNode: T, deep: boolean): T; + msElementsFromPoint(x: number, y: number): NodeListOf; + msElementsFromRect(left: number, top: number, width: number, height: number): NodeListOf; + /** + * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. + * @param url Specifies a MIME type for the document. + * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. + * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. + * @param replace Specifies whether the existing entry for the document is replaced in the history list. + */ + open(url?: string, name?: string, features?: string, replace?: boolean): Document; + /** + * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. + * @param commandId Specifies a command identifier. + */ + queryCommandEnabled(commandId: string): boolean; + /** + * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. + * @param commandId String that specifies a command identifier. + */ + queryCommandIndeterm(commandId: string): boolean; + /** + * Returns a Boolean value that indicates the current state of the command. + * @param commandId String that specifies a command identifier. + */ + queryCommandState(commandId: string): boolean; + /** + * Returns a Boolean value that indicates whether the current command is supported on the current range. + * @param commandId Specifies a command identifier. + */ + queryCommandSupported(commandId: string): boolean; + /** + * Retrieves the string associated with a command. + * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. + */ + queryCommandText(commandId: string): string; + /** + * Returns the current value of the document, range, or current selection for the given command. + * @param commandId String that specifies a command identifier. + */ + queryCommandValue(commandId: string): string; + releaseEvents(): void; + /** + * Allows updating the print settings for the page. + */ + updateSettings(): void; + webkitCancelFullScreen(): void; + webkitExitFullscreen(): void; + /** + * Writes one or more HTML expressions to a document in the specified window. + * @param content Specifies the text and HTML tags to write. + */ + write(...content: string[]): void; + /** + * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. + * @param content The text and HTML tags to write. + */ + writeln(...content: string[]): void; + addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Document: { + prototype: Document; + new(): Document; +} + +interface DocumentFragment extends Node, NodeSelector, ParentNode { + getElementById(elementId: string): HTMLElement | null; +} + +declare var DocumentFragment: { + prototype: DocumentFragment; + new(): DocumentFragment; +} + +interface DocumentType extends Node, ChildNode { + readonly entities: NamedNodeMap; + readonly internalSubset: string | null; + readonly name: string; + readonly notations: NamedNodeMap; + readonly publicId: string; + readonly systemId: string; +} + +declare var DocumentType: { + prototype: DocumentType; + new(): DocumentType; +} + +interface DragEvent extends MouseEvent { + readonly dataTransfer: DataTransfer; + initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; + msConvertURL(file: File, targetType: string, targetURL?: string): void; +} + +declare var DragEvent: { + prototype: DragEvent; + new(): DragEvent; +} + +interface DynamicsCompressorNode extends AudioNode { + readonly attack: AudioParam; + readonly knee: AudioParam; + readonly ratio: AudioParam; + readonly reduction: number; + readonly release: AudioParam; + readonly threshold: AudioParam; +} + +declare var DynamicsCompressorNode: { + prototype: DynamicsCompressorNode; + new(): DynamicsCompressorNode; +} + +interface EXT_frag_depth { +} + +declare var EXT_frag_depth: { + prototype: EXT_frag_depth; + new(): EXT_frag_depth; +} + +interface EXT_texture_filter_anisotropic { + readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; + readonly TEXTURE_MAX_ANISOTROPY_EXT: number; +} + +declare var EXT_texture_filter_anisotropic: { + prototype: EXT_texture_filter_anisotropic; + new(): EXT_texture_filter_anisotropic; + readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; + readonly TEXTURE_MAX_ANISOTROPY_EXT: number; +} + +interface ElementEventMap extends GlobalEventHandlersEventMap { + "ariarequest": Event; + "command": Event; + "gotpointercapture": PointerEvent; + "lostpointercapture": PointerEvent; + "MSGestureChange": MSGestureEvent; + "MSGestureDoubleTap": MSGestureEvent; + "MSGestureEnd": MSGestureEvent; + "MSGestureHold": MSGestureEvent; + "MSGestureStart": MSGestureEvent; + "MSGestureTap": MSGestureEvent; + "MSGotPointerCapture": MSPointerEvent; + "MSInertiaStart": MSGestureEvent; + "MSLostPointerCapture": MSPointerEvent; + "MSPointerCancel": MSPointerEvent; + "MSPointerDown": MSPointerEvent; + "MSPointerEnter": MSPointerEvent; + "MSPointerLeave": MSPointerEvent; + "MSPointerMove": MSPointerEvent; + "MSPointerOut": MSPointerEvent; + "MSPointerOver": MSPointerEvent; + "MSPointerUp": MSPointerEvent; + "touchcancel": TouchEvent; + "touchend": TouchEvent; + "touchmove": TouchEvent; + "touchstart": TouchEvent; + "webkitfullscreenchange": Event; + "webkitfullscreenerror": Event; +} + +interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelector, ChildNode, ParentNode { + readonly classList: DOMTokenList; + className: string; + readonly clientHeight: number; + readonly clientLeft: number; + readonly clientTop: number; + readonly clientWidth: number; + id: string; + innerHTML: string; + msContentZoomFactor: number; + readonly msRegionOverflow: string; + onariarequest: (this: Element, ev: Event) => any; + oncommand: (this: Element, ev: Event) => any; + ongotpointercapture: (this: Element, ev: PointerEvent) => any; + onlostpointercapture: (this: Element, ev: PointerEvent) => any; + onmsgesturechange: (this: Element, ev: MSGestureEvent) => any; + onmsgesturedoubletap: (this: Element, ev: MSGestureEvent) => any; + onmsgestureend: (this: Element, ev: MSGestureEvent) => any; + onmsgesturehold: (this: Element, ev: MSGestureEvent) => any; + onmsgesturestart: (this: Element, ev: MSGestureEvent) => any; + onmsgesturetap: (this: Element, ev: MSGestureEvent) => any; + onmsgotpointercapture: (this: Element, ev: MSPointerEvent) => any; + onmsinertiastart: (this: Element, ev: MSGestureEvent) => any; + onmslostpointercapture: (this: Element, ev: MSPointerEvent) => any; + onmspointercancel: (this: Element, ev: MSPointerEvent) => any; + onmspointerdown: (this: Element, ev: MSPointerEvent) => any; + onmspointerenter: (this: Element, ev: MSPointerEvent) => any; + onmspointerleave: (this: Element, ev: MSPointerEvent) => any; + onmspointermove: (this: Element, ev: MSPointerEvent) => any; + onmspointerout: (this: Element, ev: MSPointerEvent) => any; + onmspointerover: (this: Element, ev: MSPointerEvent) => any; + onmspointerup: (this: Element, ev: MSPointerEvent) => any; + ontouchcancel: (ev: TouchEvent) => any; + ontouchend: (ev: TouchEvent) => any; + ontouchmove: (ev: TouchEvent) => any; + ontouchstart: (ev: TouchEvent) => any; + onwebkitfullscreenchange: (this: Element, ev: Event) => any; + onwebkitfullscreenerror: (this: Element, ev: Event) => any; + outerHTML: string; + readonly prefix: string | null; + readonly scrollHeight: number; + scrollLeft: number; + scrollTop: number; + readonly scrollWidth: number; + readonly tagName: string; + readonly assignedSlot: HTMLSlotElement | null; + slot: string; + readonly shadowRoot: ShadowRoot | null; + getAttribute(name: string): string | null; + getAttributeNS(namespaceURI: string, localName: string): string; + getAttributeNode(name: string): Attr; + getAttributeNodeNS(namespaceURI: string, localName: string): Attr; + getBoundingClientRect(): ClientRect; + getClientRects(): ClientRectList; + getElementsByTagName(name: K): ElementListTagNameMap[K]; + getElementsByTagName(name: string): NodeListOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf; + hasAttribute(name: string): boolean; + hasAttributeNS(namespaceURI: string, localName: string): boolean; + msGetRegionContent(): MSRangeCollection; + msGetUntransformedBounds(): ClientRect; + msMatchesSelector(selectors: string): boolean; + msReleasePointerCapture(pointerId: number): void; + msSetPointerCapture(pointerId: number): void; + msZoomTo(args: MsZoomToOptions): void; + releasePointerCapture(pointerId: number): void; + removeAttribute(qualifiedName: string): void; + removeAttributeNS(namespaceURI: string, localName: string): void; + removeAttributeNode(oldAttr: Attr): Attr; + requestFullscreen(): void; + requestPointerLock(): void; + setAttribute(name: string, value: string): void; + setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; + setAttributeNode(newAttr: Attr): Attr; + setAttributeNodeNS(newAttr: Attr): Attr; + setPointerCapture(pointerId: number): void; + webkitMatchesSelector(selectors: string): boolean; + webkitRequestFullScreen(): void; + webkitRequestFullscreen(): void; + getElementsByClassName(classNames: string): NodeListOf; + matches(selector: string): boolean; + closest(selector: string): Element | null; + scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void; + scroll(options?: ScrollToOptions): void; + scroll(x: number, y: number): void; + scrollTo(options?: ScrollToOptions): void; + scrollTo(x: number, y: number): void; + scrollBy(options?: ScrollToOptions): void; + scrollBy(x: number, y: number): void; + insertAdjacentElement(position: string, insertedElement: Element): Element | null; + insertAdjacentHTML(where: string, html: string): void; + insertAdjacentText(where: string, text: string): void; + attachShadow(shadowRootInitDict: ShadowRootInit): ShadowRoot; + addEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Element: { + prototype: Element; + new(): Element; +} + +interface ErrorEvent extends Event { + readonly colno: number; + readonly error: any; + readonly filename: string; + readonly lineno: number; + readonly message: string; + initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; +} + +declare var ErrorEvent: { + prototype: ErrorEvent; + new(type: string, errorEventInitDict?: ErrorEventInit): ErrorEvent; +} + +interface Event { + readonly bubbles: boolean; + cancelBubble: boolean; + readonly cancelable: boolean; + readonly currentTarget: EventTarget; + readonly defaultPrevented: boolean; + readonly eventPhase: number; + readonly isTrusted: boolean; + returnValue: boolean; + readonly srcElement: Element | null; + readonly target: EventTarget; + readonly timeStamp: number; + readonly type: string; + readonly scoped: boolean; + initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; + preventDefault(): void; + stopImmediatePropagation(): void; + stopPropagation(): void; + deepPath(): EventTarget[]; + readonly AT_TARGET: number; + readonly BUBBLING_PHASE: number; + readonly CAPTURING_PHASE: number; +} + +declare var Event: { + prototype: Event; + new(typeArg: string, eventInitDict?: EventInit): Event; + readonly AT_TARGET: number; + readonly BUBBLING_PHASE: number; + readonly CAPTURING_PHASE: number; +} + +interface EventTarget { + addEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + dispatchEvent(evt: Event): boolean; + removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var EventTarget: { + prototype: EventTarget; + new(): EventTarget; +} + +interface ExtensionScriptApis { + extensionIdToShortId(extensionId: string): number; + fireExtensionApiTelemetry(functionName: string, isSucceeded: boolean, isSupported: boolean): void; + genericFunction(routerAddress: any, parameters?: string, callbackId?: number): void; + genericSynchronousFunction(functionId: number, parameters?: string): string; + getExtensionId(): string; + registerGenericFunctionCallbackHandler(callbackHandler: any): void; + registerGenericPersistentCallbackHandler(callbackHandler: any): void; +} + +declare var ExtensionScriptApis: { + prototype: ExtensionScriptApis; + new(): ExtensionScriptApis; +} + +interface External { +} + +declare var External: { + prototype: External; + new(): External; +} + +interface File extends Blob { + readonly lastModifiedDate: any; + readonly name: string; + readonly webkitRelativePath: string; +} + +declare var File: { + prototype: File; + new (parts: (ArrayBuffer | ArrayBufferView | Blob | string)[], filename: string, properties?: FilePropertyBag): File; +} + +interface FileList { + readonly length: number; + item(index: number): File; + [index: number]: File; +} + +declare var FileList: { + prototype: FileList; + new(): FileList; +} + +interface FileReader extends EventTarget, MSBaseReader { + readonly error: DOMError; + readAsArrayBuffer(blob: Blob): void; + readAsBinaryString(blob: Blob): void; + readAsDataURL(blob: Blob): void; + readAsText(blob: Blob, encoding?: string): void; + addEventListener(type: K, listener: (this: FileReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var FileReader: { + prototype: FileReader; + new(): FileReader; +} + +interface FocusEvent extends UIEvent { + readonly relatedTarget: EventTarget; + initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; +} + +declare var FocusEvent: { + prototype: FocusEvent; + new(typeArg: string, eventInitDict?: FocusEventInit): FocusEvent; +} + +interface FocusNavigationEvent extends Event { + readonly navigationReason: NavigationReason; + readonly originHeight: number; + readonly originLeft: number; + readonly originTop: number; + readonly originWidth: number; + requestFocus(): void; +} + +declare var FocusNavigationEvent: { + prototype: FocusNavigationEvent; + new(type: string, eventInitDict?: FocusNavigationEventInit): FocusNavigationEvent; +} + +interface FormData { + append(name: string, value: string | Blob, fileName?: string): void; + delete(name: string): void; + get(name: string): FormDataEntryValue | null; + getAll(name: string): FormDataEntryValue[]; + has(name: string): boolean; + set(name: string, value: string | Blob, fileName?: string): void; +} + +declare var FormData: { + prototype: FormData; + new (form?: HTMLFormElement): FormData; +} + +interface GainNode extends AudioNode { + readonly gain: AudioParam; +} + +declare var GainNode: { + prototype: GainNode; + new(): GainNode; +} + +interface Gamepad { + readonly axes: number[]; + readonly buttons: GamepadButton[]; + readonly connected: boolean; + readonly id: string; + readonly index: number; + readonly mapping: string; + readonly timestamp: number; +} + +declare var Gamepad: { + prototype: Gamepad; + new(): Gamepad; +} + +interface GamepadButton { + readonly pressed: boolean; + readonly value: number; +} + +declare var GamepadButton: { + prototype: GamepadButton; + new(): GamepadButton; +} + +interface GamepadEvent extends Event { + readonly gamepad: Gamepad; +} + +declare var GamepadEvent: { + prototype: GamepadEvent; + new(typeArg: string, eventInitDict?: GamepadEventInit): GamepadEvent; +} + +interface Geolocation { + clearWatch(watchId: number): void; + getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; + watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; +} + +declare var Geolocation: { + prototype: Geolocation; + new(): Geolocation; +} + +interface HTMLAllCollection { + readonly length: number; + item(nameOrIndex?: string): HTMLCollection | Element | null; + namedItem(name: string): HTMLCollection | Element | null; + [index: number]: Element; +} + +declare var HTMLAllCollection: { + prototype: HTMLAllCollection; + new(): HTMLAllCollection; +} + +interface HTMLAnchorElement extends HTMLElement { + Methods: string; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Sets or retrieves the coordinates of the object. + */ + coords: string; + download: string; + /** + * Contains the anchor portion of the URL including the hash sign (#). + */ + hash: string; + /** + * Contains the hostname and port values of the URL. + */ + host: string; + /** + * Contains the hostname of a URL. + */ + hostname: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or retrieves the language code of the object. + */ + hreflang: string; + readonly mimeType: string; + /** + * Sets or retrieves the shape of the object. + */ + name: string; + readonly nameProp: string; + /** + * Contains the pathname of the URL. + */ + pathname: string; + /** + * Sets or retrieves the port number associated with a URL. + */ + port: string; + /** + * Contains the protocol of the URL. + */ + protocol: string; + readonly protocolLong: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rel: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rev: string; + /** + * Sets or retrieves the substring of the href property that follows the question mark. + */ + search: string; + /** + * Sets or retrieves the shape of the object. + */ + shape: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + type: string; + urn: string; + /** + * Returns a string representation of an object. + */ + toString(): string; + addEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLAnchorElement: { + prototype: HTMLAnchorElement; + new(): HTMLAnchorElement; +} + +interface HTMLAppletElement extends HTMLElement { + /** + * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. + */ + readonly BaseHref: string; + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Gets or sets the optional alternative HTML script to execute if the object fails to load. + */ + altHtml: string; + /** + * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. + */ + archive: string; + border: string; + code: string; + /** + * Sets or retrieves the URL of the component. + */ + codeBase: string; + /** + * Sets or retrieves the Internet media type for the code associated with the object. + */ + codeType: string; + /** + * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. + */ + readonly contentDocument: Document; + /** + * Sets or retrieves the URL that references the data of the object. + */ + data: string; + /** + * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. + */ + declare: boolean; + readonly form: HTMLFormElement; + /** + * Sets or retrieves the height of the object. + */ + height: string; + hspace: number; + /** + * Sets or retrieves the shape of the object. + */ + name: string; + object: string | null; + /** + * Sets or retrieves a message to be displayed while an object is loading. + */ + standby: string; + /** + * Returns the content type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + vspace: number; + width: number; + addEventListener(type: K, listener: (this: HTMLAppletElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLAppletElement: { + prototype: HTMLAppletElement; + new(): HTMLAppletElement; +} + +interface HTMLAreaElement extends HTMLElement { + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Sets or retrieves the coordinates of the object. + */ + coords: string; + download: string; + /** + * Sets or retrieves the subsection of the href property that follows the number sign (#). + */ + hash: string; + /** + * Sets or retrieves the hostname and port number of the location or URL. + */ + host: string; + /** + * Sets or retrieves the host name part of the location or URL. + */ + hostname: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or gets whether clicks in this region cause action. + */ + noHref: boolean; + /** + * Sets or retrieves the file name or path specified by the object. + */ + pathname: string; + /** + * Sets or retrieves the port number associated with a URL. + */ + port: string; + /** + * Sets or retrieves the protocol portion of a URL. + */ + protocol: string; + rel: string; + /** + * Sets or retrieves the substring of the href property that follows the question mark. + */ + search: string; + /** + * Sets or retrieves the shape of the object. + */ + shape: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Returns a string representation of an object. + */ + toString(): string; + addEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLAreaElement: { + prototype: HTMLAreaElement; + new(): HTMLAreaElement; +} + +interface HTMLAreasCollection extends HTMLCollectionBase { +} + +declare var HTMLAreasCollection: { + prototype: HTMLAreasCollection; + new(): HTMLAreasCollection; +} + +interface HTMLAudioElement extends HTMLMediaElement { + addEventListener(type: K, listener: (this: HTMLAudioElement, ev: HTMLMediaElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLAudioElement: { + prototype: HTMLAudioElement; + new(): HTMLAudioElement; +} + +interface HTMLBRElement extends HTMLElement { + /** + * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. + */ + clear: string; + addEventListener(type: K, listener: (this: HTMLBRElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLBRElement: { + prototype: HTMLBRElement; + new(): HTMLBRElement; +} + +interface HTMLBaseElement extends HTMLElement { + /** + * Gets or sets the baseline URL on which relative links are based. + */ + href: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + addEventListener(type: K, listener: (this: HTMLBaseElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLBaseElement: { + prototype: HTMLBaseElement; + new(): HTMLBaseElement; +} + +interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { + /** + * Sets or retrieves the current typeface family. + */ + face: string; + /** + * Sets or retrieves the font size of the object. + */ + size: number; + addEventListener(type: K, listener: (this: HTMLBaseFontElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLBaseFontElement: { + prototype: HTMLBaseFontElement; + new(): HTMLBaseFontElement; +} + +interface HTMLBodyElementEventMap extends HTMLElementEventMap { + "afterprint": Event; + "beforeprint": Event; + "beforeunload": BeforeUnloadEvent; + "blur": FocusEvent; + "error": ErrorEvent; + "focus": FocusEvent; + "hashchange": HashChangeEvent; + "load": Event; + "message": MessageEvent; + "offline": Event; + "online": Event; + "orientationchange": Event; + "pagehide": PageTransitionEvent; + "pageshow": PageTransitionEvent; + "popstate": PopStateEvent; + "resize": UIEvent; + "scroll": UIEvent; + "storage": StorageEvent; + "unload": Event; +} + +interface HTMLBodyElement extends HTMLElement { + aLink: any; + background: string; + bgColor: any; + bgProperties: string; + link: any; + noWrap: boolean; + onafterprint: (this: HTMLBodyElement, ev: Event) => any; + onbeforeprint: (this: HTMLBodyElement, ev: Event) => any; + onbeforeunload: (this: HTMLBodyElement, ev: BeforeUnloadEvent) => any; + onblur: (this: HTMLBodyElement, ev: FocusEvent) => any; + onerror: (this: HTMLBodyElement, ev: ErrorEvent) => any; + onfocus: (this: HTMLBodyElement, ev: FocusEvent) => any; + onhashchange: (this: HTMLBodyElement, ev: HashChangeEvent) => any; + onload: (this: HTMLBodyElement, ev: Event) => any; + onmessage: (this: HTMLBodyElement, ev: MessageEvent) => any; + onoffline: (this: HTMLBodyElement, ev: Event) => any; + ononline: (this: HTMLBodyElement, ev: Event) => any; + onorientationchange: (this: HTMLBodyElement, ev: Event) => any; + onpagehide: (this: HTMLBodyElement, ev: PageTransitionEvent) => any; + onpageshow: (this: HTMLBodyElement, ev: PageTransitionEvent) => any; + onpopstate: (this: HTMLBodyElement, ev: PopStateEvent) => any; + onresize: (this: HTMLBodyElement, ev: UIEvent) => any; + onscroll: (this: HTMLBodyElement, ev: UIEvent) => any; + onstorage: (this: HTMLBodyElement, ev: StorageEvent) => any; + onunload: (this: HTMLBodyElement, ev: Event) => any; + text: any; + vLink: any; + addEventListener(type: K, listener: (this: HTMLBodyElement, ev: HTMLBodyElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLBodyElement: { + prototype: HTMLBodyElement; + new(): HTMLBodyElement; +} + +interface HTMLButtonElement extends HTMLElement { + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Overrides the action attribute (where the data on a form is sent) on the parent form element. + */ + formAction: string; + /** + * Used to override the encoding (formEnctype attribute) specified on the form element. + */ + formEnctype: string; + /** + * Overrides the submit method attribute previously specified on a form element. + */ + formMethod: string; + /** + * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + */ + formNoValidate: string; + /** + * Overrides the target attribute on a form element. + */ + formTarget: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + status: any; + /** + * Gets the classification and default behavior of the button. + */ + type: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + readonly validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + readonly validity: ValidityState; + /** + * Sets or retrieves the default or selected value of the control. + */ + value: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + readonly willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + addEventListener(type: K, listener: (this: HTMLButtonElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLButtonElement: { + prototype: HTMLButtonElement; + new(): HTMLButtonElement; +} + +interface HTMLCanvasElement extends HTMLElement { + /** + * Gets or sets the height of a canvas element on a document. + */ + height: number; + /** + * Gets or sets the width of a canvas element on a document. + */ + width: number; + /** + * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. + * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); + */ + getContext(contextId: "2d", contextAttributes?: Canvas2DContextAttributes): CanvasRenderingContext2D | null; + getContext(contextId: "webgl" | "experimental-webgl", contextAttributes?: WebGLContextAttributes): WebGLRenderingContext | null; + getContext(contextId: string, contextAttributes?: {}): CanvasRenderingContext2D | WebGLRenderingContext | null; + /** + * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. + */ + msToBlob(): Blob; + /** + * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. + * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. + */ + toDataURL(type?: string, ...args: any[]): string; + toBlob(callback: (result: Blob | null) => void, type?: string, ...arguments: any[]): void; + addEventListener(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLCanvasElement: { + prototype: HTMLCanvasElement; + new(): HTMLCanvasElement; +} + +interface HTMLCollectionBase { + /** + * Sets or retrieves the number of objects in a collection. + */ + readonly length: number; + /** + * Retrieves an object from various collections. + */ + item(index: number): Element; + [index: number]: Element; +} + +interface HTMLCollection extends HTMLCollectionBase { + /** + * Retrieves a select object or an object from an options collection. + */ + namedItem(name: string): Element | null; +} + +declare var HTMLCollection: { + prototype: HTMLCollection; + new(): HTMLCollection; +} + +interface HTMLDListElement extends HTMLElement { + compact: boolean; + addEventListener(type: K, listener: (this: HTMLDListElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLDListElement: { + prototype: HTMLDListElement; + new(): HTMLDListElement; +} + +interface HTMLDataElement extends HTMLElement { + value: string; + addEventListener(type: K, listener: (this: HTMLDataElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLDataElement: { + prototype: HTMLDataElement; + new(): HTMLDataElement; +} + +interface HTMLDataListElement extends HTMLElement { + options: HTMLCollectionOf; + addEventListener(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLDataListElement: { + prototype: HTMLDataListElement; + new(): HTMLDataListElement; +} + +interface HTMLDirectoryElement extends HTMLElement { + compact: boolean; + addEventListener(type: K, listener: (this: HTMLDirectoryElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLDirectoryElement: { + prototype: HTMLDirectoryElement; + new(): HTMLDirectoryElement; +} + +interface HTMLDivElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; + addEventListener(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLDivElement: { + prototype: HTMLDivElement; + new(): HTMLDivElement; +} + +interface HTMLDocument extends Document { + addEventListener(type: K, listener: (this: HTMLDocument, ev: DocumentEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLDocument: { + prototype: HTMLDocument; + new(): HTMLDocument; +} + +interface HTMLElementEventMap extends ElementEventMap { + "abort": UIEvent; + "activate": UIEvent; + "beforeactivate": UIEvent; + "beforecopy": ClipboardEvent; + "beforecut": ClipboardEvent; + "beforedeactivate": UIEvent; + "beforepaste": ClipboardEvent; + "blur": FocusEvent; + "canplay": Event; + "canplaythrough": Event; + "change": Event; + "click": MouseEvent; + "contextmenu": PointerEvent; + "copy": ClipboardEvent; + "cuechange": Event; + "cut": ClipboardEvent; + "dblclick": MouseEvent; + "deactivate": UIEvent; + "drag": DragEvent; + "dragend": DragEvent; + "dragenter": DragEvent; + "dragleave": DragEvent; + "dragover": DragEvent; + "dragstart": DragEvent; + "drop": DragEvent; + "durationchange": Event; + "emptied": Event; + "ended": MediaStreamErrorEvent; + "error": ErrorEvent; + "focus": FocusEvent; + "input": Event; + "invalid": Event; + "keydown": KeyboardEvent; + "keypress": KeyboardEvent; + "keyup": KeyboardEvent; + "load": Event; + "loadeddata": Event; + "loadedmetadata": Event; + "loadstart": Event; + "mousedown": MouseEvent; + "mouseenter": MouseEvent; + "mouseleave": MouseEvent; + "mousemove": MouseEvent; + "mouseout": MouseEvent; + "mouseover": MouseEvent; + "mouseup": MouseEvent; + "mousewheel": WheelEvent; + "MSContentZoom": UIEvent; + "MSManipulationStateChanged": MSManipulationEvent; + "paste": ClipboardEvent; + "pause": Event; + "play": Event; + "playing": Event; + "progress": ProgressEvent; + "ratechange": Event; + "reset": Event; + "scroll": UIEvent; + "seeked": Event; + "seeking": Event; + "select": UIEvent; + "selectstart": Event; + "stalled": Event; + "submit": Event; + "suspend": Event; + "timeupdate": Event; + "volumechange": Event; + "waiting": Event; +} + +interface HTMLElement extends Element { + accessKey: string; + readonly children: HTMLCollection; + contentEditable: string; + readonly dataset: DOMStringMap; + dir: string; + draggable: boolean; + hidden: boolean; + hideFocus: boolean; + innerText: string; + readonly isContentEditable: boolean; + lang: string; + readonly offsetHeight: number; + readonly offsetLeft: number; + readonly offsetParent: Element; + readonly offsetTop: number; + readonly offsetWidth: number; + onabort: (this: HTMLElement, ev: UIEvent) => any; + onactivate: (this: HTMLElement, ev: UIEvent) => any; + onbeforeactivate: (this: HTMLElement, ev: UIEvent) => any; + onbeforecopy: (this: HTMLElement, ev: ClipboardEvent) => any; + onbeforecut: (this: HTMLElement, ev: ClipboardEvent) => any; + onbeforedeactivate: (this: HTMLElement, ev: UIEvent) => any; + onbeforepaste: (this: HTMLElement, ev: ClipboardEvent) => any; + onblur: (this: HTMLElement, ev: FocusEvent) => any; + oncanplay: (this: HTMLElement, ev: Event) => any; + oncanplaythrough: (this: HTMLElement, ev: Event) => any; + onchange: (this: HTMLElement, ev: Event) => any; + onclick: (this: HTMLElement, ev: MouseEvent) => any; + oncontextmenu: (this: HTMLElement, ev: PointerEvent) => any; + oncopy: (this: HTMLElement, ev: ClipboardEvent) => any; + oncuechange: (this: HTMLElement, ev: Event) => any; + oncut: (this: HTMLElement, ev: ClipboardEvent) => any; + ondblclick: (this: HTMLElement, ev: MouseEvent) => any; + ondeactivate: (this: HTMLElement, ev: UIEvent) => any; + ondrag: (this: HTMLElement, ev: DragEvent) => any; + ondragend: (this: HTMLElement, ev: DragEvent) => any; + ondragenter: (this: HTMLElement, ev: DragEvent) => any; + ondragleave: (this: HTMLElement, ev: DragEvent) => any; + ondragover: (this: HTMLElement, ev: DragEvent) => any; + ondragstart: (this: HTMLElement, ev: DragEvent) => any; + ondrop: (this: HTMLElement, ev: DragEvent) => any; + ondurationchange: (this: HTMLElement, ev: Event) => any; + onemptied: (this: HTMLElement, ev: Event) => any; + onended: (this: HTMLElement, ev: MediaStreamErrorEvent) => any; + onerror: (this: HTMLElement, ev: ErrorEvent) => any; + onfocus: (this: HTMLElement, ev: FocusEvent) => any; + oninput: (this: HTMLElement, ev: Event) => any; + oninvalid: (this: HTMLElement, ev: Event) => any; + onkeydown: (this: HTMLElement, ev: KeyboardEvent) => any; + onkeypress: (this: HTMLElement, ev: KeyboardEvent) => any; + onkeyup: (this: HTMLElement, ev: KeyboardEvent) => any; + onload: (this: HTMLElement, ev: Event) => any; + onloadeddata: (this: HTMLElement, ev: Event) => any; + onloadedmetadata: (this: HTMLElement, ev: Event) => any; + onloadstart: (this: HTMLElement, ev: Event) => any; + onmousedown: (this: HTMLElement, ev: MouseEvent) => any; + onmouseenter: (this: HTMLElement, ev: MouseEvent) => any; + onmouseleave: (this: HTMLElement, ev: MouseEvent) => any; + onmousemove: (this: HTMLElement, ev: MouseEvent) => any; + onmouseout: (this: HTMLElement, ev: MouseEvent) => any; + onmouseover: (this: HTMLElement, ev: MouseEvent) => any; + onmouseup: (this: HTMLElement, ev: MouseEvent) => any; + onmousewheel: (this: HTMLElement, ev: WheelEvent) => any; + onmscontentzoom: (this: HTMLElement, ev: UIEvent) => any; + onmsmanipulationstatechanged: (this: HTMLElement, ev: MSManipulationEvent) => any; + onpaste: (this: HTMLElement, ev: ClipboardEvent) => any; + onpause: (this: HTMLElement, ev: Event) => any; + onplay: (this: HTMLElement, ev: Event) => any; + onplaying: (this: HTMLElement, ev: Event) => any; + onprogress: (this: HTMLElement, ev: ProgressEvent) => any; + onratechange: (this: HTMLElement, ev: Event) => any; + onreset: (this: HTMLElement, ev: Event) => any; + onscroll: (this: HTMLElement, ev: UIEvent) => any; + onseeked: (this: HTMLElement, ev: Event) => any; + onseeking: (this: HTMLElement, ev: Event) => any; + onselect: (this: HTMLElement, ev: UIEvent) => any; + onselectstart: (this: HTMLElement, ev: Event) => any; + onstalled: (this: HTMLElement, ev: Event) => any; + onsubmit: (this: HTMLElement, ev: Event) => any; + onsuspend: (this: HTMLElement, ev: Event) => any; + ontimeupdate: (this: HTMLElement, ev: Event) => any; + onvolumechange: (this: HTMLElement, ev: Event) => any; + onwaiting: (this: HTMLElement, ev: Event) => any; + outerText: string; + spellcheck: boolean; + readonly style: CSSStyleDeclaration; + tabIndex: number; + title: string; + blur(): void; + click(): void; + dragDrop(): boolean; + focus(): void; + msGetInputContext(): MSInputMethodContext; + addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLElement: { + prototype: HTMLElement; + new(): HTMLElement; +} + +interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { + /** + * Sets or retrieves the height of the object. + */ + height: string; + hidden: any; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + readonly msPlayToSource: any; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Retrieves the palette used for the embedded document. + */ + readonly palette: string; + /** + * Retrieves the URL of the plug-in used to view an embedded document. + */ + readonly pluginspage: string; + readonly readyState: string; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the height and width units of the embed object. + */ + units: string; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: K, listener: (this: HTMLEmbedElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLEmbedElement: { + prototype: HTMLEmbedElement; + new(): HTMLEmbedElement; +} + +interface HTMLFieldSetElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + name: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + readonly validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + readonly validity: ValidityState; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + readonly willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + addEventListener(type: K, listener: (this: HTMLFieldSetElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFieldSetElement: { + prototype: HTMLFieldSetElement; + new(): HTMLFieldSetElement; +} + +interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { + /** + * Sets or retrieves the current typeface family. + */ + face: string; + addEventListener(type: K, listener: (this: HTMLFontElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFontElement: { + prototype: HTMLFontElement; + new(): HTMLFontElement; +} + +interface HTMLFormControlsCollection extends HTMLCollectionBase { + namedItem(name: string): HTMLCollection | Element | null; +} + +declare var HTMLFormControlsCollection: { + prototype: HTMLFormControlsCollection; + new(): HTMLFormControlsCollection; +} + +interface HTMLFormElement extends HTMLElement { + /** + * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. + */ + acceptCharset: string; + /** + * Sets or retrieves the URL to which the form content is sent for processing. + */ + action: string; + /** + * Specifies whether autocomplete is applied to an editable text field. + */ + autocomplete: string; + /** + * Retrieves a collection, in source order, of all controls in a given form. + */ + readonly elements: HTMLFormControlsCollection; + /** + * Sets or retrieves the MIME encoding for the form. + */ + encoding: string; + /** + * Sets or retrieves the encoding type for the form. + */ + enctype: string; + /** + * Sets or retrieves the number of objects in a collection. + */ + readonly length: number; + /** + * Sets or retrieves how to send the form data to the server. + */ + method: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Designates a form that is not validated when submitted. + */ + noValidate: boolean; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Retrieves a form object or an object from an elements collection. + * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. + * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. + */ + item(name?: any, index?: any): any; + /** + * Retrieves a form object or an object from an elements collection. + */ + namedItem(name: string): any; + /** + * Fires when the user resets a form. + */ + reset(): void; + /** + * Fires when a FORM is about to be submitted. + */ + submit(): void; + addEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [name: string]: any; +} + +declare var HTMLFormElement: { + prototype: HTMLFormElement; + new(): HTMLFormElement; +} + +interface HTMLFrameElementEventMap extends HTMLElementEventMap { + "load": Event; +} + +interface HTMLFrameElement extends HTMLElement, GetSVGDocument { + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Retrieves the document object of the page or frame. + */ + readonly contentDocument: Document; + /** + * Retrieves the object of the specified. + */ + readonly contentWindow: Window; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Sets or retrieves the height of the object. + */ + height: string | number; + /** + * Sets or retrieves a URI to a long description of the object. + */ + longDesc: string; + /** + * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. + */ + marginHeight: string; + /** + * Sets or retrieves the left and right margin widths before displaying the text in a frame. + */ + marginWidth: string; + /** + * Sets or retrieves the frame name. + */ + name: string; + /** + * Sets or retrieves whether the user can resize the frame. + */ + noResize: boolean; + /** + * Raised when the object has been completely received from the server. + */ + onload: (this: HTMLFrameElement, ev: Event) => any; + /** + * Sets or retrieves whether the frame can be scrolled. + */ + scrolling: string; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the width of the object. + */ + width: string | number; + addEventListener(type: K, listener: (this: HTMLFrameElement, ev: HTMLFrameElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFrameElement: { + prototype: HTMLFrameElement; + new(): HTMLFrameElement; +} + +interface HTMLFrameSetElementEventMap extends HTMLElementEventMap { + "afterprint": Event; + "beforeprint": Event; + "beforeunload": BeforeUnloadEvent; + "blur": FocusEvent; + "error": ErrorEvent; + "focus": FocusEvent; + "hashchange": HashChangeEvent; + "load": Event; + "message": MessageEvent; + "offline": Event; + "online": Event; + "orientationchange": Event; + "pagehide": PageTransitionEvent; + "pageshow": PageTransitionEvent; + "popstate": PopStateEvent; + "resize": UIEvent; + "scroll": UIEvent; + "storage": StorageEvent; + "unload": Event; +} + +interface HTMLFrameSetElement extends HTMLElement { + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Sets or retrieves the frame widths of the object. + */ + cols: string; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + name: string; + onafterprint: (this: HTMLFrameSetElement, ev: Event) => any; + onbeforeprint: (this: HTMLFrameSetElement, ev: Event) => any; + onbeforeunload: (this: HTMLFrameSetElement, ev: BeforeUnloadEvent) => any; + /** + * Fires when the object loses the input focus. + */ + onblur: (this: HTMLFrameSetElement, ev: FocusEvent) => any; + onerror: (this: HTMLFrameSetElement, ev: ErrorEvent) => any; + /** + * Fires when the object receives focus. + */ + onfocus: (this: HTMLFrameSetElement, ev: FocusEvent) => any; + onhashchange: (this: HTMLFrameSetElement, ev: HashChangeEvent) => any; + onload: (this: HTMLFrameSetElement, ev: Event) => any; + onmessage: (this: HTMLFrameSetElement, ev: MessageEvent) => any; + onoffline: (this: HTMLFrameSetElement, ev: Event) => any; + ononline: (this: HTMLFrameSetElement, ev: Event) => any; + onorientationchange: (this: HTMLFrameSetElement, ev: Event) => any; + onpagehide: (this: HTMLFrameSetElement, ev: PageTransitionEvent) => any; + onpageshow: (this: HTMLFrameSetElement, ev: PageTransitionEvent) => any; + onpopstate: (this: HTMLFrameSetElement, ev: PopStateEvent) => any; + onresize: (this: HTMLFrameSetElement, ev: UIEvent) => any; + onscroll: (this: HTMLFrameSetElement, ev: UIEvent) => any; + onstorage: (this: HTMLFrameSetElement, ev: StorageEvent) => any; + onunload: (this: HTMLFrameSetElement, ev: Event) => any; + /** + * Sets or retrieves the frame heights of the object. + */ + rows: string; + addEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFrameSetElement: { + prototype: HTMLFrameSetElement; + new(): HTMLFrameSetElement; +} + +interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. + */ + noShade: boolean; + /** + * Sets or retrieves the width of the object. + */ + width: number; + addEventListener(type: K, listener: (this: HTMLHRElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLHRElement: { + prototype: HTMLHRElement; + new(): HTMLHRElement; +} + +interface HTMLHeadElement extends HTMLElement { + profile: string; + addEventListener(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLHeadElement: { + prototype: HTMLHeadElement; + new(): HTMLHeadElement; +} + +interface HTMLHeadingElement extends HTMLElement { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + addEventListener(type: K, listener: (this: HTMLHeadingElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLHeadingElement: { + prototype: HTMLHeadingElement; + new(): HTMLHeadingElement; +} + +interface HTMLHtmlElement extends HTMLElement { + /** + * Sets or retrieves the DTD version that governs the current document. + */ + version: string; + addEventListener(type: K, listener: (this: HTMLHtmlElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLHtmlElement: { + prototype: HTMLHtmlElement; + new(): HTMLHtmlElement; +} + +interface HTMLIFrameElementEventMap extends HTMLElementEventMap { + "load": Event; +} + +interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + allowFullscreen: boolean; + allowPaymentRequest: boolean; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Retrieves the document object of the page or frame. + */ + readonly contentDocument: Document; + /** + * Retrieves the object of the specified. + */ + readonly contentWindow: Window; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Sets or retrieves the horizontal margin for the object. + */ + hspace: number; + /** + * Sets or retrieves a URI to a long description of the object. + */ + longDesc: string; + /** + * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. + */ + marginHeight: string; + /** + * Sets or retrieves the left and right margin widths before displaying the text in a frame. + */ + marginWidth: string; + /** + * Sets or retrieves the frame name. + */ + name: string; + /** + * Sets or retrieves whether the user can resize the frame. + */ + noResize: boolean; + /** + * Raised when the object has been completely received from the server. + */ + onload: (this: HTMLIFrameElement, ev: Event) => any; + readonly sandbox: DOMSettableTokenList; + /** + * Sets or retrieves whether the frame can be scrolled. + */ + scrolling: string; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLIFrameElement: { + prototype: HTMLIFrameElement; + new(): HTMLIFrameElement; +} + +interface HTMLImageElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Retrieves whether the object is fully loaded. + */ + readonly complete: boolean; + crossOrigin: string | null; + readonly currentSrc: string; + /** + * Sets or retrieves the height of the object. + */ + height: number; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + hspace: number; + /** + * Sets or retrieves whether the image is a server-side image map. + */ + isMap: boolean; + /** + * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. + */ + longDesc: string; + lowsrc: string; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + readonly msPlayToSource: any; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * The original height of the image resource before sizing. + */ + readonly naturalHeight: number; + /** + * The original width of the image resource before sizing. + */ + readonly naturalWidth: number; + sizes: string; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + srcset: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: number; + readonly x: number; + readonly y: number; + msGetAsCastingSource(): any; + addEventListener(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLImageElement: { + prototype: HTMLImageElement; + new(): HTMLImageElement; +} + +interface HTMLInputElement extends HTMLElement { + /** + * Sets or retrieves a comma-separated list of content types. + */ + accept: string; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Specifies whether autocomplete is applied to an editable text field. + */ + autocomplete: string; + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + border: string; + /** + * Sets or retrieves the state of the check box or radio button. + */ + checked: boolean; + /** + * Retrieves whether the object is fully loaded. + */ + readonly complete: boolean; + /** + * Sets or retrieves the state of the check box or radio button. + */ + defaultChecked: boolean; + /** + * Sets or retrieves the initial contents of the object. + */ + defaultValue: string; + disabled: boolean; + /** + * Returns a FileList object on a file type input object. + */ + readonly files: FileList | null; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Overrides the action attribute (where the data on a form is sent) on the parent form element. + */ + formAction: string; + /** + * Used to override the encoding (formEnctype attribute) specified on the form element. + */ + formEnctype: string; + /** + * Overrides the submit method attribute previously specified on a form element. + */ + formMethod: string; + /** + * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + */ + formNoValidate: string; + /** + * Overrides the target attribute on a form element. + */ + formTarget: string; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + hspace: number; + indeterminate: boolean; + /** + * Specifies the ID of a pre-defined datalist of options for an input element. + */ + readonly list: HTMLElement; + /** + * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. + */ + max: string; + /** + * Sets or retrieves the maximum number of characters that the user can enter in a text control. + */ + maxLength: number; + /** + * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. + */ + min: string; + /** + * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. + */ + multiple: boolean; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Gets or sets a string containing a regular expression that the user's input must match. + */ + pattern: string; + /** + * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. + */ + placeholder: string; + readOnly: boolean; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + selectionDirection: string; + /** + * Gets or sets the end position or offset of a text selection. + */ + selectionEnd: number; + /** + * Gets or sets the starting position or offset of a text selection. + */ + selectionStart: number; + size: number; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + status: boolean; + /** + * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. + */ + step: string; + /** + * Returns the content type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + readonly validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + readonly validity: ValidityState; + /** + * Returns the value of the data at the cursor's current position. + */ + value: string; + valueAsDate: Date; + /** + * Returns the input field value as a number. + */ + valueAsNumber: number; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + webkitdirectory: boolean; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + readonly willValidate: boolean; + minLength: number; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Makes the selection equal to the current object. + */ + select(): void; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + /** + * Sets the start and end positions of a selection in a text field. + * @param start The offset into the text field for the start of the selection. + * @param end The offset into the text field for the end of the selection. + */ + setSelectionRange(start?: number, end?: number, direction?: string): void; + /** + * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. + * @param n Value to decrement the value by. + */ + stepDown(n?: number): void; + /** + * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. + * @param n Value to increment the value by. + */ + stepUp(n?: number): void; + addEventListener(type: K, listener: (this: HTMLInputElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLInputElement: { + prototype: HTMLInputElement; + new(): HTMLInputElement; +} + +interface HTMLLIElement extends HTMLElement { + type: string; + /** + * Sets or retrieves the value of a list item. + */ + value: number; + addEventListener(type: K, listener: (this: HTMLLIElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLLIElement: { + prototype: HTMLLIElement; + new(): HTMLLIElement; +} + +interface HTMLLabelElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Sets or retrieves the object to which the given label object is assigned. + */ + htmlFor: string; + addEventListener(type: K, listener: (this: HTMLLabelElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLLabelElement: { + prototype: HTMLLabelElement; + new(): HTMLLabelElement; +} + +interface HTMLLegendElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + align: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + addEventListener(type: K, listener: (this: HTMLLegendElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLLegendElement: { + prototype: HTMLLegendElement; + new(): HTMLLegendElement; +} + +interface HTMLLinkElement extends HTMLElement, LinkStyle { + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + disabled: boolean; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or retrieves the language code of the object. + */ + hreflang: string; + /** + * Sets or retrieves the media type. + */ + media: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rel: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rev: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Sets or retrieves the MIME type of the object. + */ + type: string; + import?: Document; + integrity: string; + addEventListener(type: K, listener: (this: HTMLLinkElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLLinkElement: { + prototype: HTMLLinkElement; + new(): HTMLLinkElement; +} + +interface HTMLMapElement extends HTMLElement { + /** + * Retrieves a collection of the area objects defined for the given map object. + */ + readonly areas: HTMLAreasCollection; + /** + * Sets or retrieves the name of the object. + */ + name: string; + addEventListener(type: K, listener: (this: HTMLMapElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMapElement: { + prototype: HTMLMapElement; + new(): HTMLMapElement; +} + +interface HTMLMarqueeElementEventMap extends HTMLElementEventMap { + "bounce": Event; + "finish": Event; + "start": Event; +} + +interface HTMLMarqueeElement extends HTMLElement { + behavior: string; + bgColor: any; + direction: string; + height: string; + hspace: number; + loop: number; + onbounce: (this: HTMLMarqueeElement, ev: Event) => any; + onfinish: (this: HTMLMarqueeElement, ev: Event) => any; + onstart: (this: HTMLMarqueeElement, ev: Event) => any; + scrollAmount: number; + scrollDelay: number; + trueSpeed: boolean; + vspace: number; + width: string; + start(): void; + stop(): void; + addEventListener(type: K, listener: (this: HTMLMarqueeElement, ev: HTMLMarqueeElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMarqueeElement: { + prototype: HTMLMarqueeElement; + new(): HTMLMarqueeElement; +} + +interface HTMLMediaElementEventMap extends HTMLElementEventMap { + "encrypted": MediaEncryptedEvent; + "msneedkey": MSMediaKeyNeededEvent; +} + +interface HTMLMediaElement extends HTMLElement { + /** + * Returns an AudioTrackList object with the audio tracks for a given video element. + */ + readonly audioTracks: AudioTrackList; + /** + * Gets or sets a value that indicates whether to start playing the media automatically. + */ + autoplay: boolean; + /** + * Gets a collection of buffered time ranges. + */ + readonly buffered: TimeRanges; + /** + * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). + */ + controls: boolean; + crossOrigin: string | null; + /** + * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. + */ + readonly currentSrc: string; + /** + * Gets or sets the current playback position, in seconds. + */ + currentTime: number; + defaultMuted: boolean; + /** + * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. + */ + defaultPlaybackRate: number; + /** + * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. + */ + readonly duration: number; + /** + * Gets information about whether the playback has ended or not. + */ + readonly ended: boolean; + /** + * Returns an object representing the current error state of the audio or video element. + */ + readonly error: MediaError; + /** + * Gets or sets a flag to specify whether playback should restart after it completes. + */ + loop: boolean; + readonly mediaKeys: MediaKeys | null; + /** + * Specifies the purpose of the audio or video media, such as background audio or alerts. + */ + msAudioCategory: string; + /** + * Specifies the output device id that the audio will be sent to. + */ + msAudioDeviceType: string; + readonly msGraphicsTrustStatus: MSGraphicsTrust; + /** + * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. + */ + readonly msKeys: MSMediaKeys; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + readonly msPlayToSource: any; + /** + * Specifies whether or not to enable low-latency playback on the media element. + */ + msRealTime: boolean; + /** + * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. + */ + muted: boolean; + /** + * Gets the current network activity for the element. + */ + readonly networkState: number; + onencrypted: (this: HTMLMediaElement, ev: MediaEncryptedEvent) => any; + onmsneedkey: (this: HTMLMediaElement, ev: MSMediaKeyNeededEvent) => any; + /** + * Gets a flag that specifies whether playback is paused. + */ + readonly paused: boolean; + /** + * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. + */ + playbackRate: number; + /** + * Gets TimeRanges for the current media resource that has been played. + */ + readonly played: TimeRanges; + /** + * Gets or sets the current playback position, in seconds. + */ + preload: string; + readyState: number; + /** + * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. + */ + readonly seekable: TimeRanges; + /** + * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. + */ + readonly seeking: boolean; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + srcObject: MediaStream | null; + readonly textTracks: TextTrackList; + readonly videoTracks: VideoTrackList; + /** + * Gets or sets the volume level for audio portions of the media element. + */ + volume: number; + addTextTrack(kind: string, label?: string, language?: string): TextTrack; + /** + * Returns a string that specifies whether the client can play a given media resource type. + */ + canPlayType(type: string): string; + /** + * Resets the audio or video object and loads a new media resource. + */ + load(): void; + /** + * Clears all effects from the media pipeline. + */ + msClearEffects(): void; + msGetAsCastingSource(): any; + /** + * Inserts the specified audio effect into media pipeline. + */ + msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; + msSetMediaKeys(mediaKeys: MSMediaKeys): void; + /** + * Specifies the media protection manager for a given media pipeline. + */ + msSetMediaProtectionManager(mediaProtectionManager?: any): void; + /** + * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. + */ + pause(): void; + /** + * Loads and starts playback of a media resource. + */ + play(): void; + setMediaKeys(mediaKeys: MediaKeys | null): Promise; + readonly HAVE_CURRENT_DATA: number; + readonly HAVE_ENOUGH_DATA: number; + readonly HAVE_FUTURE_DATA: number; + readonly HAVE_METADATA: number; + readonly HAVE_NOTHING: number; + readonly NETWORK_EMPTY: number; + readonly NETWORK_IDLE: number; + readonly NETWORK_LOADING: number; + readonly NETWORK_NO_SOURCE: number; + addEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMediaElement: { + prototype: HTMLMediaElement; + new(): HTMLMediaElement; + readonly HAVE_CURRENT_DATA: number; + readonly HAVE_ENOUGH_DATA: number; + readonly HAVE_FUTURE_DATA: number; + readonly HAVE_METADATA: number; + readonly HAVE_NOTHING: number; + readonly NETWORK_EMPTY: number; + readonly NETWORK_IDLE: number; + readonly NETWORK_LOADING: number; + readonly NETWORK_NO_SOURCE: number; +} + +interface HTMLMenuElement extends HTMLElement { + compact: boolean; + type: string; + addEventListener(type: K, listener: (this: HTMLMenuElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMenuElement: { + prototype: HTMLMenuElement; + new(): HTMLMenuElement; +} + +interface HTMLMetaElement extends HTMLElement { + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Gets or sets meta-information to associate with httpEquiv or name. + */ + content: string; + /** + * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. + */ + httpEquiv: string; + /** + * Sets or retrieves the value specified in the content attribute of the meta object. + */ + name: string; + /** + * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. + */ + scheme: string; + /** + * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. + */ + url: string; + addEventListener(type: K, listener: (this: HTMLMetaElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMetaElement: { + prototype: HTMLMetaElement; + new(): HTMLMetaElement; +} + +interface HTMLMeterElement extends HTMLElement { + high: number; + low: number; + max: number; + min: number; + optimum: number; + value: number; + addEventListener(type: K, listener: (this: HTMLMeterElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMeterElement: { + prototype: HTMLMeterElement; + new(): HTMLMeterElement; +} + +interface HTMLModElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; + addEventListener(type: K, listener: (this: HTMLModElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLModElement: { + prototype: HTMLModElement; + new(): HTMLModElement; +} + +interface HTMLOListElement extends HTMLElement { + compact: boolean; + /** + * The starting number. + */ + start: number; + type: string; + addEventListener(type: K, listener: (this: HTMLOListElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLOListElement: { + prototype: HTMLOListElement; + new(): HTMLOListElement; +} + +interface HTMLObjectElement extends HTMLElement, GetSVGDocument { + /** + * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. + */ + readonly BaseHref: string; + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Gets or sets the optional alternative HTML script to execute if the object fails to load. + */ + altHtml: string; + /** + * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. + */ + archive: string; + border: string; + /** + * Sets or retrieves the URL of the file containing the compiled Java class. + */ + code: string; + /** + * Sets or retrieves the URL of the component. + */ + codeBase: string; + /** + * Sets or retrieves the Internet media type for the code associated with the object. + */ + codeType: string; + /** + * Retrieves the document object of the page or frame. + */ + readonly contentDocument: Document; + /** + * Sets or retrieves the URL that references the data of the object. + */ + data: string; + declare: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Sets or retrieves the height of the object. + */ + height: string; + hspace: number; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + readonly msPlayToSource: any; + /** + * Sets or retrieves the name of the object. + */ + name: string; + readonly readyState: number; + /** + * Sets or retrieves a message to be displayed while an object is loading. + */ + standby: string; + /** + * Sets or retrieves the MIME type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + readonly validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + readonly validity: ValidityState; + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + readonly willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + addEventListener(type: K, listener: (this: HTMLObjectElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLObjectElement: { + prototype: HTMLObjectElement; + new(): HTMLObjectElement; +} + +interface HTMLOptGroupElement extends HTMLElement { + /** + * Sets or retrieves the status of an option. + */ + defaultSelected: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Sets or retrieves the ordinal position of an option in a list box. + */ + readonly index: number; + /** + * Sets or retrieves a value that you can use to implement your own label functionality for the object. + */ + label: string; + /** + * Sets or retrieves whether the option in the list box is the default item. + */ + selected: boolean; + /** + * Sets or retrieves the text string specified by the option tag. + */ + readonly text: string; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; + addEventListener(type: K, listener: (this: HTMLOptGroupElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLOptGroupElement: { + prototype: HTMLOptGroupElement; + new(): HTMLOptGroupElement; +} + +interface HTMLOptionElement extends HTMLElement { + /** + * Sets or retrieves the status of an option. + */ + defaultSelected: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Sets or retrieves the ordinal position of an option in a list box. + */ + readonly index: number; + /** + * Sets or retrieves a value that you can use to implement your own label functionality for the object. + */ + label: string; + /** + * Sets or retrieves whether the option in the list box is the default item. + */ + selected: boolean; + /** + * Sets or retrieves the text string specified by the option tag. + */ + text: string; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; + addEventListener(type: K, listener: (this: HTMLOptionElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLOptionElement: { + prototype: HTMLOptionElement; + new(): HTMLOptionElement; +} + +interface HTMLOptionsCollection extends HTMLCollectionOf { + length: number; + selectedIndex: number; + add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number): void; + remove(index: number): void; +} + +declare var HTMLOptionsCollection: { + prototype: HTMLOptionsCollection; + new(): HTMLOptionsCollection; +} + +interface HTMLOutputElement extends HTMLElement { + defaultValue: string; + readonly form: HTMLFormElement; + readonly htmlFor: DOMSettableTokenList; + name: string; + readonly type: string; + readonly validationMessage: string; + readonly validity: ValidityState; + value: string; + readonly willValidate: boolean; + checkValidity(): boolean; + reportValidity(): boolean; + setCustomValidity(error: string): void; + addEventListener(type: K, listener: (this: HTMLOutputElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLOutputElement: { + prototype: HTMLOutputElement; + new(): HTMLOutputElement; +} + +interface HTMLParagraphElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + clear: string; + addEventListener(type: K, listener: (this: HTMLParagraphElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLParagraphElement: { + prototype: HTMLParagraphElement; + new(): HTMLParagraphElement; +} + +interface HTMLParamElement extends HTMLElement { + /** + * Sets or retrieves the name of an input parameter for an element. + */ + name: string; + /** + * Sets or retrieves the content type of the resource designated by the value attribute. + */ + type: string; + /** + * Sets or retrieves the value of an input parameter for an element. + */ + value: string; + /** + * Sets or retrieves the data type of the value attribute. + */ + valueType: string; + addEventListener(type: K, listener: (this: HTMLParamElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLParamElement: { + prototype: HTMLParamElement; + new(): HTMLParamElement; +} + +interface HTMLPictureElement extends HTMLElement { + addEventListener(type: K, listener: (this: HTMLPictureElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLPictureElement: { + prototype: HTMLPictureElement; + new(): HTMLPictureElement; +} + +interface HTMLPreElement extends HTMLElement { + /** + * Sets or gets a value that you can use to implement your own width functionality for the object. + */ + width: number; + addEventListener(type: K, listener: (this: HTMLPreElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLPreElement: { + prototype: HTMLPreElement; + new(): HTMLPreElement; +} + +interface HTMLProgressElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Defines the maximum, or "done" value for a progress element. + */ + max: number; + /** + * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). + */ + readonly position: number; + /** + * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. + */ + value: number; + addEventListener(type: K, listener: (this: HTMLProgressElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLProgressElement: { + prototype: HTMLProgressElement; + new(): HTMLProgressElement; +} + +interface HTMLQuoteElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + addEventListener(type: K, listener: (this: HTMLQuoteElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLQuoteElement: { + prototype: HTMLQuoteElement; + new(): HTMLQuoteElement; +} + +interface HTMLScriptElement extends HTMLElement { + async: boolean; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + crossOrigin: string | null; + /** + * Sets or retrieves the status of the script. + */ + defer: boolean; + /** + * Sets or retrieves the event for which the script is written. + */ + event: string; + /** + * Sets or retrieves the object that is bound to the event script. + */ + htmlFor: string; + /** + * Retrieves the URL to an external file that contains the source code or data. + */ + src: string; + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + /** + * Sets or retrieves the MIME type for the associated scripting engine. + */ + type: string; + integrity: string; + addEventListener(type: K, listener: (this: HTMLScriptElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLScriptElement: { + prototype: HTMLScriptElement; + new(): HTMLScriptElement; +} + +interface HTMLSelectElement extends HTMLElement { + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Sets or retrieves the number of objects in a collection. + */ + length: number; + /** + * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. + */ + multiple: boolean; + /** + * Sets or retrieves the name of the object. + */ + name: string; + readonly options: HTMLOptionsCollection; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Sets or retrieves the index of the selected option in a select object. + */ + selectedIndex: number; + selectedOptions: HTMLCollectionOf; + /** + * Sets or retrieves the number of rows in the list box. + */ + size: number; + /** + * Retrieves the type of select control based on the value of the MULTIPLE attribute. + */ + readonly type: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + readonly validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + readonly validity: ValidityState; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + readonly willValidate: boolean; + /** + * Adds an element to the areas, controlRange, or options collection. + * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. + * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection. + */ + add(element: HTMLElement, before?: HTMLElement | number): void; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Retrieves a select object or an object from an options collection. + * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. + * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. + */ + item(name?: any, index?: any): any; + /** + * Retrieves a select object or an object from an options collection. + * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made. + */ + namedItem(name: string): any; + /** + * Removes an element from the collection. + * @param index Number that specifies the zero-based index of the element to remove from the collection. + */ + remove(index?: number): void; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + addEventListener(type: K, listener: (this: HTMLSelectElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [name: string]: any; +} + +declare var HTMLSelectElement: { + prototype: HTMLSelectElement; + new(): HTMLSelectElement; +} + +interface HTMLSourceElement extends HTMLElement { + /** + * Gets or sets the intended media type of the media source. + */ + media: string; + msKeySystem: string; + sizes: string; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + srcset: string; + /** + * Gets or sets the MIME type of a media resource. + */ + type: string; + addEventListener(type: K, listener: (this: HTMLSourceElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLSourceElement: { + prototype: HTMLSourceElement; + new(): HTMLSourceElement; +} + +interface HTMLSpanElement extends HTMLElement { + addEventListener(type: K, listener: (this: HTMLSpanElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLSpanElement: { + prototype: HTMLSpanElement; + new(): HTMLSpanElement; +} + +interface HTMLStyleElement extends HTMLElement, LinkStyle { + disabled: boolean; + /** + * Sets or retrieves the media type. + */ + media: string; + /** + * Retrieves the CSS language in which the style sheet is written. + */ + type: string; + addEventListener(type: K, listener: (this: HTMLStyleElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLStyleElement: { + prototype: HTMLStyleElement; + new(): HTMLStyleElement; +} + +interface HTMLTableCaptionElement extends HTMLElement { + /** + * Sets or retrieves the alignment of the caption or legend. + */ + align: string; + /** + * Sets or retrieves whether the caption appears at the top or bottom of the table. + */ + vAlign: string; + addEventListener(type: K, listener: (this: HTMLTableCaptionElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableCaptionElement: { + prototype: HTMLTableCaptionElement; + new(): HTMLTableCaptionElement; +} + +interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves abbreviated text for the object. + */ + abbr: string; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. + */ + axis: string; + bgColor: any; + /** + * Retrieves the position of the object in the cells collection of a row. + */ + readonly cellIndex: number; + /** + * Sets or retrieves the number columns in the table that the object should span. + */ + colSpan: number; + /** + * Sets or retrieves a list of header cells that provide information for the object. + */ + headers: string; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; + /** + * Sets or retrieves how many rows in a table the cell should span. + */ + rowSpan: number; + /** + * Sets or retrieves the group of cells in a table to which the object's information applies. + */ + scope: string; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: K, listener: (this: HTMLTableCellElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableCellElement: { + prototype: HTMLTableCellElement; + new(): HTMLTableCellElement; +} + +interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves the alignment of the object relative to the display or table. + */ + align: string; + /** + * Sets or retrieves the number of columns in the group. + */ + span: number; + /** + * Sets or retrieves the width of the object. + */ + width: any; + addEventListener(type: K, listener: (this: HTMLTableColElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableColElement: { + prototype: HTMLTableColElement; + new(): HTMLTableColElement; +} + +interface HTMLTableDataCellElement extends HTMLTableCellElement { + addEventListener(type: K, listener: (this: HTMLTableDataCellElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableDataCellElement: { + prototype: HTMLTableDataCellElement; + new(): HTMLTableDataCellElement; +} + +interface HTMLTableElement extends HTMLElement { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + bgColor: any; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Retrieves the caption object of a table. + */ + caption: HTMLTableCaptionElement; + /** + * Sets or retrieves the amount of space between the border of the cell and the content of the cell. + */ + cellPadding: string; + /** + * Sets or retrieves the amount of space between cells in a table. + */ + cellSpacing: string; + /** + * Sets or retrieves the number of columns in the table. + */ + cols: number; + /** + * Sets or retrieves the way the border frame around the table is displayed. + */ + frame: string; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: HTMLCollectionOf; + /** + * Sets or retrieves which dividing lines (inner borders) are displayed. + */ + rules: string; + /** + * Sets or retrieves a description and/or structure of the object. + */ + summary: string; + /** + * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. + */ + tBodies: HTMLCollectionOf; + /** + * Retrieves the tFoot object of the table. + */ + tFoot: HTMLTableSectionElement; + /** + * Retrieves the tHead object of the table. + */ + tHead: HTMLTableSectionElement; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Creates an empty caption element in the table. + */ + createCaption(): HTMLTableCaptionElement; + /** + * Creates an empty tBody element in the table. + */ + createTBody(): HTMLTableSectionElement; + /** + * Creates an empty tFoot element in the table. + */ + createTFoot(): HTMLTableSectionElement; + /** + * Returns the tHead element object if successful, or null otherwise. + */ + createTHead(): HTMLTableSectionElement; + /** + * Deletes the caption element and its contents from the table. + */ + deleteCaption(): void; + /** + * Removes the specified row (tr) from the element and from the rows collection. + * @param index Number that specifies the zero-based position in the rows collection of the row to remove. + */ + deleteRow(index?: number): void; + /** + * Deletes the tFoot element and its contents from the table. + */ + deleteTFoot(): void; + /** + * Deletes the tHead element and its contents from the table. + */ + deleteTHead(): void; + /** + * Creates a new row (tr) in the table, and adds the row to the rows collection. + * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. + */ + insertRow(index?: number): HTMLTableRowElement; + addEventListener(type: K, listener: (this: HTMLTableElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableElement: { + prototype: HTMLTableElement; + new(): HTMLTableElement; +} + +interface HTMLTableHeaderCellElement extends HTMLTableCellElement { + /** + * Sets or retrieves the group of cells in a table to which the object's information applies. + */ + scope: string; + addEventListener(type: K, listener: (this: HTMLTableHeaderCellElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableHeaderCellElement: { + prototype: HTMLTableHeaderCellElement; + new(): HTMLTableHeaderCellElement; +} + +interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + bgColor: any; + /** + * Retrieves a collection of all cells in the table row. + */ + cells: HTMLCollectionOf; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Retrieves the position of the object in the rows collection for the table. + */ + readonly rowIndex: number; + /** + * Retrieves the position of the object in the collection. + */ + readonly sectionRowIndex: number; + /** + * Removes the specified cell from the table row, as well as from the cells collection. + * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted. + */ + deleteCell(index?: number): void; + /** + * Creates a new cell in the table row, and adds the cell to the cells collection. + * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. + */ + insertCell(index?: number): HTMLTableDataCellElement; + addEventListener(type: K, listener: (this: HTMLTableRowElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableRowElement: { + prototype: HTMLTableRowElement; + new(): HTMLTableRowElement; +} + +interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: HTMLCollectionOf; + /** + * Removes the specified row (tr) from the element and from the rows collection. + * @param index Number that specifies the zero-based position in the rows collection of the row to remove. + */ + deleteRow(index?: number): void; + /** + * Creates a new row (tr) in the table, and adds the row to the rows collection. + * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. + */ + insertRow(index?: number): HTMLTableRowElement; + addEventListener(type: K, listener: (this: HTMLTableSectionElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableSectionElement: { + prototype: HTMLTableSectionElement; + new(): HTMLTableSectionElement; +} + +interface HTMLTemplateElement extends HTMLElement { + readonly content: DocumentFragment; + addEventListener(type: K, listener: (this: HTMLTemplateElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTemplateElement: { + prototype: HTMLTemplateElement; + new(): HTMLTemplateElement; +} + +interface HTMLTextAreaElement extends HTMLElement { + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * Sets or retrieves the width of the object. + */ + cols: number; + /** + * Sets or retrieves the initial contents of the object. + */ + defaultValue: string; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Sets or retrieves the maximum number of characters that the user can enter in a text control. + */ + maxLength: number; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. + */ + placeholder: string; + /** + * Sets or retrieves the value indicated whether the content of the object is read-only. + */ + readOnly: boolean; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: number; + /** + * Gets or sets the end position or offset of a text selection. + */ + selectionEnd: number; + /** + * Gets or sets the starting position or offset of a text selection. + */ + selectionStart: number; + /** + * Sets or retrieves the value indicating whether the control is selected. + */ + status: any; + /** + * Retrieves the type of control. + */ + readonly type: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + readonly validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + readonly validity: ValidityState; + /** + * Retrieves or sets the text in the entry field of the textArea element. + */ + value: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + readonly willValidate: boolean; + /** + * Sets or retrieves how to handle wordwrapping in the object. + */ + wrap: string; + minLength: number; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Highlights the input area of a form element. + */ + select(): void; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + /** + * Sets the start and end positions of a selection in a text field. + * @param start The offset into the text field for the start of the selection. + * @param end The offset into the text field for the end of the selection. + */ + setSelectionRange(start: number, end: number): void; + addEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTextAreaElement: { + prototype: HTMLTextAreaElement; + new(): HTMLTextAreaElement; +} + +interface HTMLTimeElement extends HTMLElement { + dateTime: string; + addEventListener(type: K, listener: (this: HTMLTimeElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTimeElement: { + prototype: HTMLTimeElement; + new(): HTMLTimeElement; +} + +interface HTMLTitleElement extends HTMLElement { + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + addEventListener(type: K, listener: (this: HTMLTitleElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTitleElement: { + prototype: HTMLTitleElement; + new(): HTMLTitleElement; +} + +interface HTMLTrackElement extends HTMLElement { + default: boolean; + kind: string; + label: string; + readonly readyState: number; + src: string; + srclang: string; + readonly track: TextTrack; + readonly ERROR: number; + readonly LOADED: number; + readonly LOADING: number; + readonly NONE: number; + addEventListener(type: K, listener: (this: HTMLTrackElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTrackElement: { + prototype: HTMLTrackElement; + new(): HTMLTrackElement; + readonly ERROR: number; + readonly LOADED: number; + readonly LOADING: number; + readonly NONE: number; +} + +interface HTMLUListElement extends HTMLElement { + compact: boolean; + type: string; + addEventListener(type: K, listener: (this: HTMLUListElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLUListElement: { + prototype: HTMLUListElement; + new(): HTMLUListElement; +} + +interface HTMLUnknownElement extends HTMLElement { + addEventListener(type: K, listener: (this: HTMLUnknownElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLUnknownElement: { + prototype: HTMLUnknownElement; + new(): HTMLUnknownElement; +} + +interface HTMLVideoElementEventMap extends HTMLMediaElementEventMap { + "MSVideoFormatChanged": Event; + "MSVideoFrameStepCompleted": Event; + "MSVideoOptimalLayoutChanged": Event; +} + +interface HTMLVideoElement extends HTMLMediaElement { + /** + * Gets or sets the height of the video element. + */ + height: number; + msHorizontalMirror: boolean; + readonly msIsLayoutOptimalForPlayback: boolean; + readonly msIsStereo3D: boolean; + msStereo3DPackingMode: string; + msStereo3DRenderMode: string; + msZoom: boolean; + onMSVideoFormatChanged: (this: HTMLVideoElement, ev: Event) => any; + onMSVideoFrameStepCompleted: (this: HTMLVideoElement, ev: Event) => any; + onMSVideoOptimalLayoutChanged: (this: HTMLVideoElement, ev: Event) => any; + /** + * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. + */ + poster: string; + /** + * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. + */ + readonly videoHeight: number; + /** + * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. + */ + readonly videoWidth: number; + readonly webkitDisplayingFullscreen: boolean; + readonly webkitSupportsFullscreen: boolean; + /** + * Gets or sets the width of the video element. + */ + width: number; + getVideoPlaybackQuality(): VideoPlaybackQuality; + msFrameStep(forward: boolean): void; + msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; + msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; + webkitEnterFullScreen(): void; + webkitEnterFullscreen(): void; + webkitExitFullScreen(): void; + webkitExitFullscreen(): void; + addEventListener(type: K, listener: (this: HTMLVideoElement, ev: HTMLVideoElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLVideoElement: { + prototype: HTMLVideoElement; + new(): HTMLVideoElement; +} + +interface HashChangeEvent extends Event { + readonly newURL: string | null; + readonly oldURL: string | null; +} + +declare var HashChangeEvent: { + prototype: HashChangeEvent; + new(typeArg: string, eventInitDict?: HashChangeEventInit): HashChangeEvent; +} + +interface Headers { + append(name: string, value: string): void; + delete(name: string): void; + forEach(callback: ForEachCallback): void; + get(name: string): string | null; + has(name: string): boolean; + set(name: string, value: string): void; +} + +declare var Headers: { + prototype: Headers; + new(init?: any): Headers; +} + +interface History { + readonly length: number; + readonly state: any; + scrollRestoration: ScrollRestoration; + back(): void; + forward(): void; + go(delta?: number): void; + pushState(data: any, title: string, url?: string | null): void; + replaceState(data: any, title: string, url?: string | null): void; +} + +declare var History: { + prototype: History; + new(): History; +} + +interface IDBCursor { + readonly direction: IDBCursorDirection; + key: IDBKeyRange | IDBValidKey; + readonly primaryKey: any; + source: IDBObjectStore | IDBIndex; + advance(count: number): void; + continue(key?: IDBKeyRange | IDBValidKey): void; + delete(): IDBRequest; + update(value: any): IDBRequest; + readonly NEXT: string; + readonly NEXT_NO_DUPLICATE: string; + readonly PREV: string; + readonly PREV_NO_DUPLICATE: string; +} + +declare var IDBCursor: { + prototype: IDBCursor; + new(): IDBCursor; + readonly NEXT: string; + readonly NEXT_NO_DUPLICATE: string; + readonly PREV: string; + readonly PREV_NO_DUPLICATE: string; +} + +interface IDBCursorWithValue extends IDBCursor { + readonly value: any; +} + +declare var IDBCursorWithValue: { + prototype: IDBCursorWithValue; + new(): IDBCursorWithValue; +} + +interface IDBDatabaseEventMap { + "abort": Event; + "error": Event; +} + +interface IDBDatabase extends EventTarget { + readonly name: string; + readonly objectStoreNames: DOMStringList; + onabort: (this: IDBDatabase, ev: Event) => any; + onerror: (this: IDBDatabase, ev: Event) => any; + version: number; + onversionchange: (ev: IDBVersionChangeEvent) => any; + close(): void; + createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore; + deleteObjectStore(name: string): void; + transaction(storeNames: string | string[], mode?: string): IDBTransaction; + addEventListener(type: "versionchange", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBDatabase: { + prototype: IDBDatabase; + new(): IDBDatabase; +} + +interface IDBFactory { + cmp(first: any, second: any): number; + deleteDatabase(name: string): IDBOpenDBRequest; + open(name: string, version?: number): IDBOpenDBRequest; +} + +declare var IDBFactory: { + prototype: IDBFactory; + new(): IDBFactory; +} + +interface IDBIndex { + keyPath: string | string[]; + readonly name: string; + readonly objectStore: IDBObjectStore; + readonly unique: boolean; + multiEntry: boolean; + count(key?: IDBKeyRange | IDBValidKey): IDBRequest; + get(key: IDBKeyRange | IDBValidKey): IDBRequest; + getKey(key: IDBKeyRange | IDBValidKey): IDBRequest; + openCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; + openKeyCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; +} + +declare var IDBIndex: { + prototype: IDBIndex; + new(): IDBIndex; +} + +interface IDBKeyRange { + readonly lower: any; + readonly lowerOpen: boolean; + readonly upper: any; + readonly upperOpen: boolean; +} + +declare var IDBKeyRange: { + prototype: IDBKeyRange; + new(): IDBKeyRange; + bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; + lowerBound(lower: any, open?: boolean): IDBKeyRange; + only(value: any): IDBKeyRange; + upperBound(upper: any, open?: boolean): IDBKeyRange; +} + +interface IDBObjectStore { + readonly indexNames: DOMStringList; + keyPath: string | string[]; + readonly name: string; + readonly transaction: IDBTransaction; + autoIncrement: boolean; + add(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest; + clear(): IDBRequest; + count(key?: IDBKeyRange | IDBValidKey): IDBRequest; + createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex; + delete(key: IDBKeyRange | IDBValidKey): IDBRequest; + deleteIndex(indexName: string): void; + get(key: any): IDBRequest; + index(name: string): IDBIndex; + openCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; + put(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest; +} + +declare var IDBObjectStore: { + prototype: IDBObjectStore; + new(): IDBObjectStore; +} + +interface IDBOpenDBRequestEventMap extends IDBRequestEventMap { + "blocked": Event; + "upgradeneeded": IDBVersionChangeEvent; +} + +interface IDBOpenDBRequest extends IDBRequest { + onblocked: (this: IDBOpenDBRequest, ev: Event) => any; + onupgradeneeded: (this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any; + addEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBOpenDBRequest: { + prototype: IDBOpenDBRequest; + new(): IDBOpenDBRequest; +} + +interface IDBRequestEventMap { + "error": Event; + "success": Event; +} + +interface IDBRequest extends EventTarget { + readonly error: DOMError; + onerror: (this: IDBRequest, ev: Event) => any; + onsuccess: (this: IDBRequest, ev: Event) => any; + readonly readyState: IDBRequestReadyState; + readonly result: any; + source: IDBObjectStore | IDBIndex | IDBCursor; + readonly transaction: IDBTransaction; + addEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBRequest: { + prototype: IDBRequest; + new(): IDBRequest; +} + +interface IDBTransactionEventMap { + "abort": Event; + "complete": Event; + "error": Event; +} + +interface IDBTransaction extends EventTarget { + readonly db: IDBDatabase; + readonly error: DOMError; + readonly mode: IDBTransactionMode; + onabort: (this: IDBTransaction, ev: Event) => any; + oncomplete: (this: IDBTransaction, ev: Event) => any; + onerror: (this: IDBTransaction, ev: Event) => any; + abort(): void; + objectStore(name: string): IDBObjectStore; + readonly READ_ONLY: string; + readonly READ_WRITE: string; + readonly VERSION_CHANGE: string; + addEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBTransaction: { + prototype: IDBTransaction; + new(): IDBTransaction; + readonly READ_ONLY: string; + readonly READ_WRITE: string; + readonly VERSION_CHANGE: string; +} + +interface IDBVersionChangeEvent extends Event { + readonly newVersion: number | null; + readonly oldVersion: number; +} + +declare var IDBVersionChangeEvent: { + prototype: IDBVersionChangeEvent; + new(): IDBVersionChangeEvent; +} + +interface IIRFilterNode extends AudioNode { + getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void; +} + +declare var IIRFilterNode: { + prototype: IIRFilterNode; + new(): IIRFilterNode; +} + +interface ImageData { + data: Uint8ClampedArray; + readonly height: number; + readonly width: number; +} + +declare var ImageData: { + prototype: ImageData; + new(width: number, height: number): ImageData; + new(array: Uint8ClampedArray, width: number, height: number): ImageData; +} + +interface IntersectionObserver { + readonly root: Element | null; + readonly rootMargin: string; + readonly thresholds: number[]; + disconnect(): void; + observe(target: Element): void; + takeRecords(): IntersectionObserverEntry[]; + unobserve(target: Element): void; +} + +declare var IntersectionObserver: { + prototype: IntersectionObserver; + new(callback: IntersectionObserverCallback, options?: IntersectionObserverInit): IntersectionObserver; +} + +interface IntersectionObserverEntry { + readonly boundingClientRect: ClientRect; + readonly intersectionRatio: number; + readonly intersectionRect: ClientRect; + readonly rootBounds: ClientRect; + readonly target: Element; + readonly time: number; +} + +declare var IntersectionObserverEntry: { + prototype: IntersectionObserverEntry; + new(intersectionObserverEntryInit: IntersectionObserverEntryInit): IntersectionObserverEntry; +} + +interface KeyboardEvent extends UIEvent { + readonly altKey: boolean; + readonly char: string | null; + readonly charCode: number; + readonly ctrlKey: boolean; + readonly key: string; + readonly keyCode: number; + readonly locale: string; + readonly location: number; + readonly metaKey: boolean; + readonly repeat: boolean; + readonly shiftKey: boolean; + readonly which: number; + readonly code: string; + getModifierState(keyArg: string): boolean; + initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; + readonly DOM_KEY_LOCATION_JOYSTICK: number; + readonly DOM_KEY_LOCATION_LEFT: number; + readonly DOM_KEY_LOCATION_MOBILE: number; + readonly DOM_KEY_LOCATION_NUMPAD: number; + readonly DOM_KEY_LOCATION_RIGHT: number; + readonly DOM_KEY_LOCATION_STANDARD: number; +} + +declare var KeyboardEvent: { + prototype: KeyboardEvent; + new(typeArg: string, eventInitDict?: KeyboardEventInit): KeyboardEvent; + readonly DOM_KEY_LOCATION_JOYSTICK: number; + readonly DOM_KEY_LOCATION_LEFT: number; + readonly DOM_KEY_LOCATION_MOBILE: number; + readonly DOM_KEY_LOCATION_NUMPAD: number; + readonly DOM_KEY_LOCATION_RIGHT: number; + readonly DOM_KEY_LOCATION_STANDARD: number; +} + +interface ListeningStateChangedEvent extends Event { + readonly label: string; + readonly state: ListeningState; +} + +declare var ListeningStateChangedEvent: { + prototype: ListeningStateChangedEvent; + new(): ListeningStateChangedEvent; +} + +interface Location { + hash: string; + host: string; + hostname: string; + href: string; + readonly origin: string; + pathname: string; + port: string; + protocol: string; + search: string; + assign(url: string): void; + reload(forcedReload?: boolean): void; + replace(url: string): void; + toString(): string; +} + +declare var Location: { + prototype: Location; + new(): Location; +} + +interface LongRunningScriptDetectedEvent extends Event { + readonly executionTime: number; + stopPageScriptExecution: boolean; +} + +declare var LongRunningScriptDetectedEvent: { + prototype: LongRunningScriptDetectedEvent; + new(): LongRunningScriptDetectedEvent; +} + +interface MSApp { + clearTemporaryWebDataAsync(): MSAppAsyncOperation; + createBlobFromRandomAccessStream(type: string, seeker: any): Blob; + createDataPackage(object: any): any; + createDataPackageFromSelection(): any; + createFileFromStorageFile(storageFile: any): File; + createStreamFromInputStream(type: string, inputStream: any): MSStream; + execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; + execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; + getCurrentPriority(): string; + getHtmlPrintDocumentSourceAsync(htmlDoc: any): Promise; + getViewId(view: any): any; + isTaskScheduledAtPriorityOrHigher(priority: string): boolean; + pageHandlesAllApplicationActivations(enabled: boolean): void; + suppressSubdownloadCredentialPrompts(suppress: boolean): void; + terminateApp(exceptionObject: any): void; + readonly CURRENT: string; + readonly HIGH: string; + readonly IDLE: string; + readonly NORMAL: string; +} +declare var MSApp: MSApp; + +interface MSAppAsyncOperationEventMap { + "complete": Event; + "error": Event; +} + +interface MSAppAsyncOperation extends EventTarget { + readonly error: DOMError; + oncomplete: (this: MSAppAsyncOperation, ev: Event) => any; + onerror: (this: MSAppAsyncOperation, ev: Event) => any; + readonly readyState: number; + readonly result: any; + start(): void; + readonly COMPLETED: number; + readonly ERROR: number; + readonly STARTED: number; + addEventListener(type: K, listener: (this: MSAppAsyncOperation, ev: MSAppAsyncOperationEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSAppAsyncOperation: { + prototype: MSAppAsyncOperation; + new(): MSAppAsyncOperation; + readonly COMPLETED: number; + readonly ERROR: number; + readonly STARTED: number; +} + +interface MSAssertion { + readonly id: string; + readonly type: MSCredentialType; +} + +declare var MSAssertion: { + prototype: MSAssertion; + new(): MSAssertion; +} + +interface MSBlobBuilder { + append(data: any, endings?: string): void; + getBlob(contentType?: string): Blob; +} + +declare var MSBlobBuilder: { + prototype: MSBlobBuilder; + new(): MSBlobBuilder; +} + +interface MSCredentials { + getAssertion(challenge: string, filter?: MSCredentialFilter, params?: MSSignatureParameters): Promise; + makeCredential(accountInfo: MSAccountInfo, params: MSCredentialParameters[], challenge?: string): Promise; +} + +declare var MSCredentials: { + prototype: MSCredentials; + new(): MSCredentials; +} + +interface MSFIDOCredentialAssertion extends MSAssertion { + readonly algorithm: string | Algorithm; + readonly attestation: any; + readonly publicKey: string; + readonly transportHints: MSTransportType[]; +} + +declare var MSFIDOCredentialAssertion: { + prototype: MSFIDOCredentialAssertion; + new(): MSFIDOCredentialAssertion; +} + +interface MSFIDOSignature { + readonly authnrData: string; + readonly clientData: string; + readonly signature: string; +} + +declare var MSFIDOSignature: { + prototype: MSFIDOSignature; + new(): MSFIDOSignature; +} + +interface MSFIDOSignatureAssertion extends MSAssertion { + readonly signature: MSFIDOSignature; +} + +declare var MSFIDOSignatureAssertion: { + prototype: MSFIDOSignatureAssertion; + new(): MSFIDOSignatureAssertion; +} + +interface MSGesture { + target: Element; + addPointer(pointerId: number): void; + stop(): void; +} + +declare var MSGesture: { + prototype: MSGesture; + new(): MSGesture; +} + +interface MSGestureEvent extends UIEvent { + readonly clientX: number; + readonly clientY: number; + readonly expansion: number; + readonly gestureObject: any; + readonly hwTimestamp: number; + readonly offsetX: number; + readonly offsetY: number; + readonly rotation: number; + readonly scale: number; + readonly screenX: number; + readonly screenY: number; + readonly translationX: number; + readonly translationY: number; + readonly velocityAngular: number; + readonly velocityExpansion: number; + readonly velocityX: number; + readonly velocityY: number; + initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; + readonly MSGESTURE_FLAG_BEGIN: number; + readonly MSGESTURE_FLAG_CANCEL: number; + readonly MSGESTURE_FLAG_END: number; + readonly MSGESTURE_FLAG_INERTIA: number; + readonly MSGESTURE_FLAG_NONE: number; +} + +declare var MSGestureEvent: { + prototype: MSGestureEvent; + new(): MSGestureEvent; + readonly MSGESTURE_FLAG_BEGIN: number; + readonly MSGESTURE_FLAG_CANCEL: number; + readonly MSGESTURE_FLAG_END: number; + readonly MSGESTURE_FLAG_INERTIA: number; + readonly MSGESTURE_FLAG_NONE: number; +} + +interface MSGraphicsTrust { + readonly constrictionActive: boolean; + readonly status: string; +} + +declare var MSGraphicsTrust: { + prototype: MSGraphicsTrust; + new(): MSGraphicsTrust; +} + +interface MSHTMLWebViewElement extends HTMLElement { + readonly canGoBack: boolean; + readonly canGoForward: boolean; + readonly containsFullScreenElement: boolean; + readonly documentTitle: string; + height: number; + readonly settings: MSWebViewSettings; + src: string; + width: number; + addWebAllowedObject(name: string, applicationObject: any): void; + buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; + capturePreviewToBlobAsync(): MSWebViewAsyncOperation; + captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; + getDeferredPermissionRequestById(id: number): DeferredPermissionRequest; + getDeferredPermissionRequests(): DeferredPermissionRequest[]; + goBack(): void; + goForward(): void; + invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; + navigate(uri: string): void; + navigateFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void; + navigateToLocalStreamUri(source: string, streamResolver: any): void; + navigateToString(contents: string): void; + navigateWithHttpRequestMessage(requestMessage: any): void; + refresh(): void; + stop(): void; + addEventListener(type: K, listener: (this: MSHTMLWebViewElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSHTMLWebViewElement: { + prototype: MSHTMLWebViewElement; + new(): MSHTMLWebViewElement; +} + +interface MSInputMethodContextEventMap { + "MSCandidateWindowHide": Event; + "MSCandidateWindowShow": Event; + "MSCandidateWindowUpdate": Event; +} + +interface MSInputMethodContext extends EventTarget { + readonly compositionEndOffset: number; + readonly compositionStartOffset: number; + oncandidatewindowhide: (this: MSInputMethodContext, ev: Event) => any; + oncandidatewindowshow: (this: MSInputMethodContext, ev: Event) => any; + oncandidatewindowupdate: (this: MSInputMethodContext, ev: Event) => any; + readonly target: HTMLElement; + getCandidateWindowClientRect(): ClientRect; + getCompositionAlternatives(): string[]; + hasComposition(): boolean; + isCandidateWindowVisible(): boolean; + addEventListener(type: K, listener: (this: MSInputMethodContext, ev: MSInputMethodContextEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSInputMethodContext: { + prototype: MSInputMethodContext; + new(): MSInputMethodContext; +} + +interface MSManipulationEvent extends UIEvent { + readonly currentState: number; + readonly inertiaDestinationX: number; + readonly inertiaDestinationY: number; + readonly lastState: number; + initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; + readonly MS_MANIPULATION_STATE_ACTIVE: number; + readonly MS_MANIPULATION_STATE_CANCELLED: number; + readonly MS_MANIPULATION_STATE_COMMITTED: number; + readonly MS_MANIPULATION_STATE_DRAGGING: number; + readonly MS_MANIPULATION_STATE_INERTIA: number; + readonly MS_MANIPULATION_STATE_PRESELECT: number; + readonly MS_MANIPULATION_STATE_SELECTING: number; + readonly MS_MANIPULATION_STATE_STOPPED: number; +} + +declare var MSManipulationEvent: { + prototype: MSManipulationEvent; + new(): MSManipulationEvent; + readonly MS_MANIPULATION_STATE_ACTIVE: number; + readonly MS_MANIPULATION_STATE_CANCELLED: number; + readonly MS_MANIPULATION_STATE_COMMITTED: number; + readonly MS_MANIPULATION_STATE_DRAGGING: number; + readonly MS_MANIPULATION_STATE_INERTIA: number; + readonly MS_MANIPULATION_STATE_PRESELECT: number; + readonly MS_MANIPULATION_STATE_SELECTING: number; + readonly MS_MANIPULATION_STATE_STOPPED: number; +} + +interface MSMediaKeyError { + readonly code: number; + readonly systemCode: number; + readonly MS_MEDIA_KEYERR_CLIENT: number; + readonly MS_MEDIA_KEYERR_DOMAIN: number; + readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number; + readonly MS_MEDIA_KEYERR_OUTPUT: number; + readonly MS_MEDIA_KEYERR_SERVICE: number; + readonly MS_MEDIA_KEYERR_UNKNOWN: number; +} + +declare var MSMediaKeyError: { + prototype: MSMediaKeyError; + new(): MSMediaKeyError; + readonly MS_MEDIA_KEYERR_CLIENT: number; + readonly MS_MEDIA_KEYERR_DOMAIN: number; + readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number; + readonly MS_MEDIA_KEYERR_OUTPUT: number; + readonly MS_MEDIA_KEYERR_SERVICE: number; + readonly MS_MEDIA_KEYERR_UNKNOWN: number; +} + +interface MSMediaKeyMessageEvent extends Event { + readonly destinationURL: string | null; + readonly message: Uint8Array; +} + +declare var MSMediaKeyMessageEvent: { + prototype: MSMediaKeyMessageEvent; + new(): MSMediaKeyMessageEvent; +} + +interface MSMediaKeyNeededEvent extends Event { + readonly initData: Uint8Array | null; +} + +declare var MSMediaKeyNeededEvent: { + prototype: MSMediaKeyNeededEvent; + new(): MSMediaKeyNeededEvent; +} + +interface MSMediaKeySession extends EventTarget { + readonly error: MSMediaKeyError | null; + readonly keySystem: string; + readonly sessionId: string; + close(): void; + update(key: Uint8Array): void; +} + +declare var MSMediaKeySession: { + prototype: MSMediaKeySession; + new(): MSMediaKeySession; +} + +interface MSMediaKeys { + readonly keySystem: string; + createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; +} + +declare var MSMediaKeys: { + prototype: MSMediaKeys; + new(keySystem: string): MSMediaKeys; + isTypeSupported(keySystem: string, type?: string): boolean; + isTypeSupportedWithFeatures(keySystem: string, type?: string): string; +} + +interface MSPointerEvent extends MouseEvent { + readonly currentPoint: any; + readonly height: number; + readonly hwTimestamp: number; + readonly intermediatePoints: any; + readonly isPrimary: boolean; + readonly pointerId: number; + readonly pointerType: any; + readonly pressure: number; + readonly rotation: number; + readonly tiltX: number; + readonly tiltY: number; + readonly width: number; + getCurrentPoint(element: Element): void; + getIntermediatePoints(element: Element): void; + initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; +} + +declare var MSPointerEvent: { + prototype: MSPointerEvent; + new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent; +} + +interface MSRangeCollection { + readonly length: number; + item(index: number): Range; + [index: number]: Range; +} + +declare var MSRangeCollection: { + prototype: MSRangeCollection; + new(): MSRangeCollection; +} + +interface MSSiteModeEvent extends Event { + readonly actionURL: string; + readonly buttonID: number; +} + +declare var MSSiteModeEvent: { + prototype: MSSiteModeEvent; + new(): MSSiteModeEvent; +} + +interface MSStream { + readonly type: string; + msClose(): void; + msDetachStream(): any; +} + +declare var MSStream: { + prototype: MSStream; + new(): MSStream; +} + +interface MSStreamReader extends EventTarget, MSBaseReader { + readonly error: DOMError; + readAsArrayBuffer(stream: MSStream, size?: number): void; + readAsBinaryString(stream: MSStream, size?: number): void; + readAsBlob(stream: MSStream, size?: number): void; + readAsDataURL(stream: MSStream, size?: number): void; + readAsText(stream: MSStream, encoding?: string, size?: number): void; + addEventListener(type: K, listener: (this: MSStreamReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSStreamReader: { + prototype: MSStreamReader; + new(): MSStreamReader; +} + +interface MSWebViewAsyncOperationEventMap { + "complete": Event; + "error": Event; +} + +interface MSWebViewAsyncOperation extends EventTarget { + readonly error: DOMError; + oncomplete: (this: MSWebViewAsyncOperation, ev: Event) => any; + onerror: (this: MSWebViewAsyncOperation, ev: Event) => any; + readonly readyState: number; + readonly result: any; + readonly target: MSHTMLWebViewElement; + readonly type: number; + start(): void; + readonly COMPLETED: number; + readonly ERROR: number; + readonly STARTED: number; + readonly TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; + readonly TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; + readonly TYPE_INVOKE_SCRIPT: number; + addEventListener(type: K, listener: (this: MSWebViewAsyncOperation, ev: MSWebViewAsyncOperationEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSWebViewAsyncOperation: { + prototype: MSWebViewAsyncOperation; + new(): MSWebViewAsyncOperation; + readonly COMPLETED: number; + readonly ERROR: number; + readonly STARTED: number; + readonly TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; + readonly TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; + readonly TYPE_INVOKE_SCRIPT: number; +} + +interface MSWebViewSettings { + isIndexedDBEnabled: boolean; + isJavaScriptEnabled: boolean; +} + +declare var MSWebViewSettings: { + prototype: MSWebViewSettings; + new(): MSWebViewSettings; +} + +interface MediaDeviceInfo { + readonly deviceId: string; + readonly groupId: string; + readonly kind: MediaDeviceKind; + readonly label: string; +} + +declare var MediaDeviceInfo: { + prototype: MediaDeviceInfo; + new(): MediaDeviceInfo; +} + +interface MediaDevicesEventMap { + "devicechange": Event; +} + +interface MediaDevices extends EventTarget { + ondevicechange: (this: MediaDevices, ev: Event) => any; + enumerateDevices(): any; + getSupportedConstraints(): MediaTrackSupportedConstraints; + getUserMedia(constraints: MediaStreamConstraints): Promise; + addEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MediaDevices: { + prototype: MediaDevices; + new(): MediaDevices; +} + +interface MediaElementAudioSourceNode extends AudioNode { +} + +declare var MediaElementAudioSourceNode: { + prototype: MediaElementAudioSourceNode; + new(): MediaElementAudioSourceNode; +} + +interface MediaEncryptedEvent extends Event { + readonly initData: ArrayBuffer | null; + readonly initDataType: string; +} + +declare var MediaEncryptedEvent: { + prototype: MediaEncryptedEvent; + new(type: string, eventInitDict?: MediaEncryptedEventInit): MediaEncryptedEvent; +} + +interface MediaError { + readonly code: number; + readonly msExtendedCode: number; + readonly MEDIA_ERR_ABORTED: number; + readonly MEDIA_ERR_DECODE: number; + readonly MEDIA_ERR_NETWORK: number; + readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number; + readonly MS_MEDIA_ERR_ENCRYPTED: number; +} + +declare var MediaError: { + prototype: MediaError; + new(): MediaError; + readonly MEDIA_ERR_ABORTED: number; + readonly MEDIA_ERR_DECODE: number; + readonly MEDIA_ERR_NETWORK: number; + readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number; + readonly MS_MEDIA_ERR_ENCRYPTED: number; +} + +interface MediaKeyMessageEvent extends Event { + readonly message: ArrayBuffer; + readonly messageType: MediaKeyMessageType; +} + +declare var MediaKeyMessageEvent: { + prototype: MediaKeyMessageEvent; + new(type: string, eventInitDict?: MediaKeyMessageEventInit): MediaKeyMessageEvent; +} + +interface MediaKeySession extends EventTarget { + readonly closed: Promise; + readonly expiration: number; + readonly keyStatuses: MediaKeyStatusMap; + readonly sessionId: string; + close(): Promise; + generateRequest(initDataType: string, initData: any): Promise; + load(sessionId: string): Promise; + remove(): Promise; + update(response: any): Promise; +} + +declare var MediaKeySession: { + prototype: MediaKeySession; + new(): MediaKeySession; +} + +interface MediaKeyStatusMap { + readonly size: number; + forEach(callback: ForEachCallback): void; + get(keyId: any): MediaKeyStatus; + has(keyId: any): boolean; +} + +declare var MediaKeyStatusMap: { + prototype: MediaKeyStatusMap; + new(): MediaKeyStatusMap; +} + +interface MediaKeySystemAccess { + readonly keySystem: string; + createMediaKeys(): Promise; + getConfiguration(): MediaKeySystemConfiguration; +} + +declare var MediaKeySystemAccess: { + prototype: MediaKeySystemAccess; + new(): MediaKeySystemAccess; +} + +interface MediaKeys { + createSession(sessionType?: MediaKeySessionType): MediaKeySession; + setServerCertificate(serverCertificate: any): Promise; +} + +declare var MediaKeys: { + prototype: MediaKeys; + new(): MediaKeys; +} + +interface MediaList { + readonly length: number; + mediaText: string; + appendMedium(newMedium: string): void; + deleteMedium(oldMedium: string): void; + item(index: number): string; + toString(): string; + [index: number]: string; +} + +declare var MediaList: { + prototype: MediaList; + new(): MediaList; +} + +interface MediaQueryList { + readonly matches: boolean; + readonly media: string; + addListener(listener: MediaQueryListListener): void; + removeListener(listener: MediaQueryListListener): void; +} + +declare var MediaQueryList: { + prototype: MediaQueryList; + new(): MediaQueryList; +} + +interface MediaSource extends EventTarget { + readonly activeSourceBuffers: SourceBufferList; + duration: number; + readonly readyState: string; + readonly sourceBuffers: SourceBufferList; + addSourceBuffer(type: string): SourceBuffer; + endOfStream(error?: number): void; + removeSourceBuffer(sourceBuffer: SourceBuffer): void; +} + +declare var MediaSource: { + prototype: MediaSource; + new(): MediaSource; + isTypeSupported(type: string): boolean; +} + +interface MediaStreamEventMap { + "active": Event; + "addtrack": MediaStreamTrackEvent; + "inactive": Event; + "removetrack": MediaStreamTrackEvent; +} + +interface MediaStream extends EventTarget { + readonly active: boolean; + readonly id: string; + onactive: (this: MediaStream, ev: Event) => any; + onaddtrack: (this: MediaStream, ev: MediaStreamTrackEvent) => any; + oninactive: (this: MediaStream, ev: Event) => any; + onremovetrack: (this: MediaStream, ev: MediaStreamTrackEvent) => any; + addTrack(track: MediaStreamTrack): void; + clone(): MediaStream; + getAudioTracks(): MediaStreamTrack[]; + getTrackById(trackId: string): MediaStreamTrack | null; + getTracks(): MediaStreamTrack[]; + getVideoTracks(): MediaStreamTrack[]; + removeTrack(track: MediaStreamTrack): void; + stop(): void; + addEventListener(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MediaStream: { + prototype: MediaStream; + new(streamOrTracks?: MediaStream | MediaStreamTrack[]): MediaStream; +} + +interface MediaStreamAudioSourceNode extends AudioNode { +} + +declare var MediaStreamAudioSourceNode: { + prototype: MediaStreamAudioSourceNode; + new(): MediaStreamAudioSourceNode; +} + +interface MediaStreamError { + readonly constraintName: string | null; + readonly message: string | null; + readonly name: string; +} + +declare var MediaStreamError: { + prototype: MediaStreamError; + new(): MediaStreamError; +} + +interface MediaStreamErrorEvent extends Event { + readonly error: MediaStreamError | null; +} + +declare var MediaStreamErrorEvent: { + prototype: MediaStreamErrorEvent; + new(typeArg: string, eventInitDict?: MediaStreamErrorEventInit): MediaStreamErrorEvent; +} + +interface MediaStreamEvent extends Event { + readonly stream: MediaStream | null; +} + +declare var MediaStreamEvent: { + prototype: MediaStreamEvent; + new(type: string, eventInitDict: MediaStreamEventInit): MediaStreamEvent; +} + +interface MediaStreamTrackEventMap { + "ended": MediaStreamErrorEvent; + "mute": Event; + "overconstrained": MediaStreamErrorEvent; + "unmute": Event; +} + +interface MediaStreamTrack extends EventTarget { + enabled: boolean; + readonly id: string; + readonly kind: string; + readonly label: string; + readonly muted: boolean; + onended: (this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any; + onmute: (this: MediaStreamTrack, ev: Event) => any; + onoverconstrained: (this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any; + onunmute: (this: MediaStreamTrack, ev: Event) => any; + readonly readonly: boolean; + readonly readyState: MediaStreamTrackState; + readonly remote: boolean; + applyConstraints(constraints: MediaTrackConstraints): Promise; + clone(): MediaStreamTrack; + getCapabilities(): MediaTrackCapabilities; + getConstraints(): MediaTrackConstraints; + getSettings(): MediaTrackSettings; + stop(): void; + addEventListener(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MediaStreamTrack: { + prototype: MediaStreamTrack; + new(): MediaStreamTrack; +} + +interface MediaStreamTrackEvent extends Event { + readonly track: MediaStreamTrack; +} + +declare var MediaStreamTrackEvent: { + prototype: MediaStreamTrackEvent; + new(typeArg: string, eventInitDict?: MediaStreamTrackEventInit): MediaStreamTrackEvent; +} + +interface MessageChannel { + readonly port1: MessagePort; + readonly port2: MessagePort; +} + +declare var MessageChannel: { + prototype: MessageChannel; + new(): MessageChannel; +} + +interface MessageEvent extends Event { + readonly data: any; + readonly origin: string; + readonly ports: any; + readonly source: Window; + initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; +} + +declare var MessageEvent: { + prototype: MessageEvent; + new(type: string, eventInitDict?: MessageEventInit): MessageEvent; +} + +interface MessagePortEventMap { + "message": MessageEvent; +} + +interface MessagePort extends EventTarget { + onmessage: (this: MessagePort, ev: MessageEvent) => any; + close(): void; + postMessage(message?: any, transfer?: any[]): void; + start(): void; + addEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MessagePort: { + prototype: MessagePort; + new(): MessagePort; +} + +interface MimeType { + readonly description: string; + readonly enabledPlugin: Plugin; + readonly suffixes: string; + readonly type: string; +} + +declare var MimeType: { + prototype: MimeType; + new(): MimeType; +} + +interface MimeTypeArray { + readonly length: number; + item(index: number): Plugin; + namedItem(type: string): Plugin; + [index: number]: Plugin; +} + +declare var MimeTypeArray: { + prototype: MimeTypeArray; + new(): MimeTypeArray; +} + +interface MouseEvent extends UIEvent { + readonly altKey: boolean; + readonly button: number; + readonly buttons: number; + readonly clientX: number; + readonly clientY: number; + readonly ctrlKey: boolean; + readonly fromElement: Element; + readonly layerX: number; + readonly layerY: number; + readonly metaKey: boolean; + readonly movementX: number; + readonly movementY: number; + readonly offsetX: number; + readonly offsetY: number; + readonly pageX: number; + readonly pageY: number; + readonly relatedTarget: EventTarget; + readonly screenX: number; + readonly screenY: number; + readonly shiftKey: boolean; + readonly toElement: Element; + readonly which: number; + readonly x: number; + readonly y: number; + getModifierState(keyArg: string): boolean; + initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget | null): void; +} + +declare var MouseEvent: { + prototype: MouseEvent; + new(typeArg: string, eventInitDict?: MouseEventInit): MouseEvent; +} + +interface MutationEvent extends Event { + readonly attrChange: number; + readonly attrName: string; + readonly newValue: string; + readonly prevValue: string; + readonly relatedNode: Node; + initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; + readonly ADDITION: number; + readonly MODIFICATION: number; + readonly REMOVAL: number; +} + +declare var MutationEvent: { + prototype: MutationEvent; + new(): MutationEvent; + readonly ADDITION: number; + readonly MODIFICATION: number; + readonly REMOVAL: number; +} + +interface MutationObserver { + disconnect(): void; + observe(target: Node, options: MutationObserverInit): void; + takeRecords(): MutationRecord[]; +} + +declare var MutationObserver: { + prototype: MutationObserver; + new(callback: MutationCallback): MutationObserver; +} + +interface MutationRecord { + readonly addedNodes: NodeList; + readonly attributeName: string | null; + readonly attributeNamespace: string | null; + readonly nextSibling: Node | null; + readonly oldValue: string | null; + readonly previousSibling: Node | null; + readonly removedNodes: NodeList; + readonly target: Node; + readonly type: string; +} + +declare var MutationRecord: { + prototype: MutationRecord; + new(): MutationRecord; +} + +interface NamedNodeMap { + readonly length: number; + getNamedItem(name: string): Attr; + getNamedItemNS(namespaceURI: string | null, localName: string | null): Attr; + item(index: number): Attr; + removeNamedItem(name: string): Attr; + removeNamedItemNS(namespaceURI: string | null, localName: string | null): Attr; + setNamedItem(arg: Attr): Attr; + setNamedItemNS(arg: Attr): Attr; + [index: number]: Attr; +} + +declare var NamedNodeMap: { + prototype: NamedNodeMap; + new(): NamedNodeMap; +} + +interface NavigationCompletedEvent extends NavigationEvent { + readonly isSuccess: boolean; + readonly webErrorStatus: number; +} + +declare var NavigationCompletedEvent: { + prototype: NavigationCompletedEvent; + new(): NavigationCompletedEvent; +} + +interface NavigationEvent extends Event { + readonly uri: string; +} + +declare var NavigationEvent: { + prototype: NavigationEvent; + new(): NavigationEvent; +} + +interface NavigationEventWithReferrer extends NavigationEvent { + readonly referer: string; +} + +declare var NavigationEventWithReferrer: { + prototype: NavigationEventWithReferrer; + new(): NavigationEventWithReferrer; +} + +interface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, NavigatorGeolocation, MSNavigatorDoNotTrack, MSFileSaver, NavigatorBeacon, NavigatorConcurrentHardware, NavigatorUserMedia { + readonly authentication: WebAuthentication; + readonly cookieEnabled: boolean; + gamepadInputEmulation: GamepadInputEmulationType; + readonly language: string; + readonly maxTouchPoints: number; + readonly mimeTypes: MimeTypeArray; + readonly msManipulationViewsEnabled: boolean; + readonly msMaxTouchPoints: number; + readonly msPointerEnabled: boolean; + readonly plugins: PluginArray; + readonly pointerEnabled: boolean; + readonly serviceWorker: ServiceWorkerContainer; + readonly webdriver: boolean; + readonly hardwareConcurrency: number; + getGamepads(): Gamepad[]; + javaEnabled(): boolean; + msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; + requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): Promise; + vibrate(pattern: number | number[]): boolean; +} + +declare var Navigator: { + prototype: Navigator; + new(): Navigator; +} + +interface Node extends EventTarget { + readonly attributes: NamedNodeMap; + readonly baseURI: string | null; + readonly childNodes: NodeList; + readonly firstChild: Node | null; + readonly lastChild: Node | null; + readonly localName: string | null; + readonly namespaceURI: string | null; + readonly nextSibling: Node | null; + readonly nodeName: string; + readonly nodeType: number; + nodeValue: string | null; + readonly ownerDocument: Document; + readonly parentElement: HTMLElement | null; + readonly parentNode: Node | null; + readonly previousSibling: Node | null; + textContent: string | null; + appendChild(newChild: T): T; + cloneNode(deep?: boolean): Node; + compareDocumentPosition(other: Node): number; + contains(child: Node): boolean; + hasAttributes(): boolean; + hasChildNodes(): boolean; + insertBefore(newChild: T, refChild: Node | null): T; + isDefaultNamespace(namespaceURI: string | null): boolean; + isEqualNode(arg: Node): boolean; + isSameNode(other: Node): boolean; + lookupNamespaceURI(prefix: string | null): string | null; + lookupPrefix(namespaceURI: string | null): string | null; + normalize(): void; + removeChild(oldChild: T): T; + replaceChild(newChild: Node, oldChild: T): T; + readonly ATTRIBUTE_NODE: number; + readonly CDATA_SECTION_NODE: number; + readonly COMMENT_NODE: number; + readonly DOCUMENT_FRAGMENT_NODE: number; + readonly DOCUMENT_NODE: number; + readonly DOCUMENT_POSITION_CONTAINED_BY: number; + readonly DOCUMENT_POSITION_CONTAINS: number; + readonly DOCUMENT_POSITION_DISCONNECTED: number; + readonly DOCUMENT_POSITION_FOLLOWING: number; + readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + readonly DOCUMENT_POSITION_PRECEDING: number; + readonly DOCUMENT_TYPE_NODE: number; + readonly ELEMENT_NODE: number; + readonly ENTITY_NODE: number; + readonly ENTITY_REFERENCE_NODE: number; + readonly NOTATION_NODE: number; + readonly PROCESSING_INSTRUCTION_NODE: number; + readonly TEXT_NODE: number; +} + +declare var Node: { + prototype: Node; + new(): Node; + readonly ATTRIBUTE_NODE: number; + readonly CDATA_SECTION_NODE: number; + readonly COMMENT_NODE: number; + readonly DOCUMENT_FRAGMENT_NODE: number; + readonly DOCUMENT_NODE: number; + readonly DOCUMENT_POSITION_CONTAINED_BY: number; + readonly DOCUMENT_POSITION_CONTAINS: number; + readonly DOCUMENT_POSITION_DISCONNECTED: number; + readonly DOCUMENT_POSITION_FOLLOWING: number; + readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + readonly DOCUMENT_POSITION_PRECEDING: number; + readonly DOCUMENT_TYPE_NODE: number; + readonly ELEMENT_NODE: number; + readonly ENTITY_NODE: number; + readonly ENTITY_REFERENCE_NODE: number; + readonly NOTATION_NODE: number; + readonly PROCESSING_INSTRUCTION_NODE: number; + readonly TEXT_NODE: number; +} + +interface NodeFilter { + acceptNode(n: Node): number; +} + +declare var NodeFilter: { + readonly FILTER_ACCEPT: number; + readonly FILTER_REJECT: number; + readonly FILTER_SKIP: number; + readonly SHOW_ALL: number; + readonly SHOW_ATTRIBUTE: number; + readonly SHOW_CDATA_SECTION: number; + readonly SHOW_COMMENT: number; + readonly SHOW_DOCUMENT: number; + readonly SHOW_DOCUMENT_FRAGMENT: number; + readonly SHOW_DOCUMENT_TYPE: number; + readonly SHOW_ELEMENT: number; + readonly SHOW_ENTITY: number; + readonly SHOW_ENTITY_REFERENCE: number; + readonly SHOW_NOTATION: number; + readonly SHOW_PROCESSING_INSTRUCTION: number; + readonly SHOW_TEXT: number; +} + +interface NodeIterator { + readonly expandEntityReferences: boolean; + readonly filter: NodeFilter; + readonly root: Node; + readonly whatToShow: number; + detach(): void; + nextNode(): Node; + previousNode(): Node; +} + +declare var NodeIterator: { + prototype: NodeIterator; + new(): NodeIterator; +} + +interface NodeList { + readonly length: number; + item(index: number): Node; + [index: number]: Node; +} + +declare var NodeList: { + prototype: NodeList; + new(): NodeList; +} + +interface NotificationEventMap { + "click": Event; + "close": Event; + "error": Event; + "show": Event; +} + +interface Notification extends EventTarget { + readonly body: string; + readonly dir: NotificationDirection; + readonly icon: string; + readonly lang: string; + onclick: (this: Notification, ev: Event) => any; + onclose: (this: Notification, ev: Event) => any; + onerror: (this: Notification, ev: Event) => any; + onshow: (this: Notification, ev: Event) => any; + readonly permission: NotificationPermission; + readonly tag: string; + readonly title: string; + close(): void; + addEventListener(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Notification: { + prototype: Notification; + new(title: string, options?: NotificationOptions): Notification; + requestPermission(callback?: NotificationPermissionCallback): Promise; +} + +interface OES_element_index_uint { +} + +declare var OES_element_index_uint: { + prototype: OES_element_index_uint; + new(): OES_element_index_uint; +} + +interface OES_standard_derivatives { + readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} + +declare var OES_standard_derivatives: { + prototype: OES_standard_derivatives; + new(): OES_standard_derivatives; + readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} + +interface OES_texture_float { +} + +declare var OES_texture_float: { + prototype: OES_texture_float; + new(): OES_texture_float; +} + +interface OES_texture_float_linear { +} + +declare var OES_texture_float_linear: { + prototype: OES_texture_float_linear; + new(): OES_texture_float_linear; +} + +interface OES_texture_half_float { + readonly HALF_FLOAT_OES: number; +} + +declare var OES_texture_half_float: { + prototype: OES_texture_half_float; + new(): OES_texture_half_float; + readonly HALF_FLOAT_OES: number; +} + +interface OES_texture_half_float_linear { +} + +declare var OES_texture_half_float_linear: { + prototype: OES_texture_half_float_linear; + new(): OES_texture_half_float_linear; +} + +interface OfflineAudioCompletionEvent extends Event { + readonly renderedBuffer: AudioBuffer; +} + +declare var OfflineAudioCompletionEvent: { + prototype: OfflineAudioCompletionEvent; + new(): OfflineAudioCompletionEvent; +} + +interface OfflineAudioContextEventMap extends AudioContextEventMap { + "complete": OfflineAudioCompletionEvent; +} + +interface OfflineAudioContext extends AudioContextBase { + readonly length: number; + oncomplete: (this: OfflineAudioContext, ev: OfflineAudioCompletionEvent) => any; + startRendering(): Promise; + suspend(suspendTime: number): Promise; + addEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var OfflineAudioContext: { + prototype: OfflineAudioContext; + new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext; +} + +interface OscillatorNodeEventMap { + "ended": MediaStreamErrorEvent; +} + +interface OscillatorNode extends AudioNode { + readonly detune: AudioParam; + readonly frequency: AudioParam; + onended: (this: OscillatorNode, ev: MediaStreamErrorEvent) => any; + type: OscillatorType; + setPeriodicWave(periodicWave: PeriodicWave): void; + start(when?: number): void; + stop(when?: number): void; + addEventListener(type: K, listener: (this: OscillatorNode, ev: OscillatorNodeEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var OscillatorNode: { + prototype: OscillatorNode; + new(): OscillatorNode; +} + +interface OverflowEvent extends UIEvent { + readonly horizontalOverflow: boolean; + readonly orient: number; + readonly verticalOverflow: boolean; + readonly BOTH: number; + readonly HORIZONTAL: number; + readonly VERTICAL: number; +} + +declare var OverflowEvent: { + prototype: OverflowEvent; + new(): OverflowEvent; + readonly BOTH: number; + readonly HORIZONTAL: number; + readonly VERTICAL: number; +} + +interface PageTransitionEvent extends Event { + readonly persisted: boolean; +} + +declare var PageTransitionEvent: { + prototype: PageTransitionEvent; + new(): PageTransitionEvent; +} + +interface PannerNode extends AudioNode { + coneInnerAngle: number; + coneOuterAngle: number; + coneOuterGain: number; + distanceModel: DistanceModelType; + maxDistance: number; + panningModel: PanningModelType; + refDistance: number; + rolloffFactor: number; + setOrientation(x: number, y: number, z: number): void; + setPosition(x: number, y: number, z: number): void; + setVelocity(x: number, y: number, z: number): void; +} + +declare var PannerNode: { + prototype: PannerNode; + new(): PannerNode; +} + +interface Path2D extends Object, CanvasPathMethods { +} + +declare var Path2D: { + prototype: Path2D; + new(path?: Path2D): Path2D; +} + +interface PaymentAddress { + readonly addressLine: string[]; + readonly city: string; + readonly country: string; + readonly dependentLocality: string; + readonly languageCode: string; + readonly organization: string; + readonly phone: string; + readonly postalCode: string; + readonly recipient: string; + readonly region: string; + readonly sortingCode: string; + toJSON(): any; +} + +declare var PaymentAddress: { + prototype: PaymentAddress; + new(): PaymentAddress; +} + +interface PaymentRequestEventMap { + "shippingaddresschange": Event; + "shippingoptionchange": Event; +} + +interface PaymentRequest extends EventTarget { + onshippingaddresschange: (this: PaymentRequest, ev: Event) => any; + onshippingoptionchange: (this: PaymentRequest, ev: Event) => any; + readonly shippingAddress: PaymentAddress | null; + readonly shippingOption: string | null; + readonly shippingType: PaymentShippingType | null; + abort(): Promise; + show(): Promise; + addEventListener(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var PaymentRequest: { + prototype: PaymentRequest; + new(methodData: PaymentMethodData[], details: PaymentDetails, options?: PaymentOptions): PaymentRequest; +} + +interface PaymentRequestUpdateEvent extends Event { + updateWith(d: Promise): void; +} + +declare var PaymentRequestUpdateEvent: { + prototype: PaymentRequestUpdateEvent; + new(type: string, eventInitDict?: PaymentRequestUpdateEventInit): PaymentRequestUpdateEvent; +} + +interface PaymentResponse { + readonly details: any; + readonly methodName: string; + readonly payerEmail: string | null; + readonly payerName: string | null; + readonly payerPhone: string | null; + readonly shippingAddress: PaymentAddress | null; + readonly shippingOption: string | null; + complete(result?: PaymentComplete): Promise; + toJSON(): any; +} + +declare var PaymentResponse: { + prototype: PaymentResponse; + new(): PaymentResponse; +} + +interface PerfWidgetExternal { + readonly activeNetworkRequestCount: number; + readonly averageFrameTime: number; + readonly averagePaintTime: number; + readonly extraInformationEnabled: boolean; + readonly independentRenderingEnabled: boolean; + readonly irDisablingContentString: string; + readonly irStatusAvailable: boolean; + readonly maxCpuSpeed: number; + readonly paintRequestsPerSecond: number; + readonly performanceCounter: number; + readonly performanceCounterFrequency: number; + addEventListener(eventType: string, callback: Function): void; + getMemoryUsage(): number; + getProcessCpuUsage(): number; + getRecentCpuUsage(last: number | null): any; + getRecentFrames(last: number | null): any; + getRecentMemoryUsage(last: number | null): any; + getRecentPaintRequests(last: number | null): any; + removeEventListener(eventType: string, callback: Function): void; + repositionWindow(x: number, y: number): void; + resizeWindow(width: number, height: number): void; +} + +declare var PerfWidgetExternal: { + prototype: PerfWidgetExternal; + new(): PerfWidgetExternal; +} + +interface Performance { + readonly navigation: PerformanceNavigation; + readonly timing: PerformanceTiming; + clearMarks(markName?: string): void; + clearMeasures(measureName?: string): void; + clearResourceTimings(): void; + getEntries(): any; + getEntriesByName(name: string, entryType?: string): any; + getEntriesByType(entryType: string): any; + getMarks(markName?: string): any; + getMeasures(measureName?: string): any; + mark(markName: string): void; + measure(measureName: string, startMarkName?: string, endMarkName?: string): void; + now(): number; + setResourceTimingBufferSize(maxSize: number): void; + toJSON(): any; +} + +declare var Performance: { + prototype: Performance; + new(): Performance; +} + +interface PerformanceEntry { + readonly duration: number; + readonly entryType: string; + readonly name: string; + readonly startTime: number; +} + +declare var PerformanceEntry: { + prototype: PerformanceEntry; + new(): PerformanceEntry; +} + +interface PerformanceMark extends PerformanceEntry { +} + +declare var PerformanceMark: { + prototype: PerformanceMark; + new(): PerformanceMark; +} + +interface PerformanceMeasure extends PerformanceEntry { +} + +declare var PerformanceMeasure: { + prototype: PerformanceMeasure; + new(): PerformanceMeasure; +} + +interface PerformanceNavigation { + readonly redirectCount: number; + readonly type: number; + toJSON(): any; + readonly TYPE_BACK_FORWARD: number; + readonly TYPE_NAVIGATE: number; + readonly TYPE_RELOAD: number; + readonly TYPE_RESERVED: number; +} + +declare var PerformanceNavigation: { + prototype: PerformanceNavigation; + new(): PerformanceNavigation; + readonly TYPE_BACK_FORWARD: number; + readonly TYPE_NAVIGATE: number; + readonly TYPE_RELOAD: number; + readonly TYPE_RESERVED: number; +} + +interface PerformanceNavigationTiming extends PerformanceEntry { + readonly connectEnd: number; + readonly connectStart: number; + readonly domComplete: number; + readonly domContentLoadedEventEnd: number; + readonly domContentLoadedEventStart: number; + readonly domInteractive: number; + readonly domLoading: number; + readonly domainLookupEnd: number; + readonly domainLookupStart: number; + readonly fetchStart: number; + readonly loadEventEnd: number; + readonly loadEventStart: number; + readonly navigationStart: number; + readonly redirectCount: number; + readonly redirectEnd: number; + readonly redirectStart: number; + readonly requestStart: number; + readonly responseEnd: number; + readonly responseStart: number; + readonly type: NavigationType; + readonly unloadEventEnd: number; + readonly unloadEventStart: number; +} + +declare var PerformanceNavigationTiming: { + prototype: PerformanceNavigationTiming; + new(): PerformanceNavigationTiming; +} + +interface PerformanceResourceTiming extends PerformanceEntry { + readonly connectEnd: number; + readonly connectStart: number; + readonly domainLookupEnd: number; + readonly domainLookupStart: number; + readonly fetchStart: number; + readonly initiatorType: string; + readonly redirectEnd: number; + readonly redirectStart: number; + readonly requestStart: number; + readonly responseEnd: number; + readonly responseStart: number; +} + +declare var PerformanceResourceTiming: { + prototype: PerformanceResourceTiming; + new(): PerformanceResourceTiming; +} + +interface PerformanceTiming { + readonly connectEnd: number; + readonly connectStart: number; + readonly domComplete: number; + readonly domContentLoadedEventEnd: number; + readonly domContentLoadedEventStart: number; + readonly domInteractive: number; + readonly domLoading: number; + readonly domainLookupEnd: number; + readonly domainLookupStart: number; + readonly fetchStart: number; + readonly loadEventEnd: number; + readonly loadEventStart: number; + readonly msFirstPaint: number; + readonly navigationStart: number; + readonly redirectEnd: number; + readonly redirectStart: number; + readonly requestStart: number; + readonly responseEnd: number; + readonly responseStart: number; + readonly unloadEventEnd: number; + readonly unloadEventStart: number; + readonly secureConnectionStart: number; + toJSON(): any; +} + +declare var PerformanceTiming: { + prototype: PerformanceTiming; + new(): PerformanceTiming; +} + +interface PeriodicWave { +} + +declare var PeriodicWave: { + prototype: PeriodicWave; + new(): PeriodicWave; +} + +interface PermissionRequest extends DeferredPermissionRequest { + readonly state: MSWebViewPermissionState; + defer(): void; +} + +declare var PermissionRequest: { + prototype: PermissionRequest; + new(): PermissionRequest; +} + +interface PermissionRequestedEvent extends Event { + readonly permissionRequest: PermissionRequest; +} + +declare var PermissionRequestedEvent: { + prototype: PermissionRequestedEvent; + new(): PermissionRequestedEvent; +} + +interface Plugin { + readonly description: string; + readonly filename: string; + readonly length: number; + readonly name: string; + readonly version: string; + item(index: number): MimeType; + namedItem(type: string): MimeType; + [index: number]: MimeType; +} + +declare var Plugin: { + prototype: Plugin; + new(): Plugin; +} + +interface PluginArray { + readonly length: number; + item(index: number): Plugin; + namedItem(name: string): Plugin; + refresh(reload?: boolean): void; + [index: number]: Plugin; +} + +declare var PluginArray: { + prototype: PluginArray; + new(): PluginArray; +} + +interface PointerEvent extends MouseEvent { + readonly currentPoint: any; + readonly height: number; + readonly hwTimestamp: number; + readonly intermediatePoints: any; + readonly isPrimary: boolean; + readonly pointerId: number; + readonly pointerType: any; + readonly pressure: number; + readonly rotation: number; + readonly tiltX: number; + readonly tiltY: number; + readonly width: number; + getCurrentPoint(element: Element): void; + getIntermediatePoints(element: Element): void; + initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; +} + +declare var PointerEvent: { + prototype: PointerEvent; + new(typeArg: string, eventInitDict?: PointerEventInit): PointerEvent; +} + +interface PopStateEvent extends Event { + readonly state: any; + initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void; +} + +declare var PopStateEvent: { + prototype: PopStateEvent; + new(typeArg: string, eventInitDict?: PopStateEventInit): PopStateEvent; +} + +interface Position { + readonly coords: Coordinates; + readonly timestamp: number; +} + +declare var Position: { + prototype: Position; + new(): Position; +} + +interface PositionError { + readonly code: number; + readonly message: string; + toString(): string; + readonly PERMISSION_DENIED: number; + readonly POSITION_UNAVAILABLE: number; + readonly TIMEOUT: number; +} + +declare var PositionError: { + prototype: PositionError; + new(): PositionError; + readonly PERMISSION_DENIED: number; + readonly POSITION_UNAVAILABLE: number; + readonly TIMEOUT: number; +} + +interface ProcessingInstruction extends CharacterData { + readonly target: string; +} + +declare var ProcessingInstruction: { + prototype: ProcessingInstruction; + new(): ProcessingInstruction; +} + +interface ProgressEvent extends Event { + readonly lengthComputable: boolean; + readonly loaded: number; + readonly total: number; + initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; +} + +declare var ProgressEvent: { + prototype: ProgressEvent; + new(type: string, eventInitDict?: ProgressEventInit): ProgressEvent; +} + +interface PushManager { + getSubscription(): Promise; + permissionState(options?: PushSubscriptionOptionsInit): Promise; + subscribe(options?: PushSubscriptionOptionsInit): Promise; +} + +declare var PushManager: { + prototype: PushManager; + new(): PushManager; +} + +interface PushSubscription { + readonly endpoint: USVString; + readonly options: PushSubscriptionOptions; + getKey(name: PushEncryptionKeyName): ArrayBuffer | null; + toJSON(): any; + unsubscribe(): Promise; +} + +declare var PushSubscription: { + prototype: PushSubscription; + new(): PushSubscription; +} + +interface PushSubscriptionOptions { + readonly applicationServerKey: ArrayBuffer | null; + readonly userVisibleOnly: boolean; +} + +declare var PushSubscriptionOptions: { + prototype: PushSubscriptionOptions; + new(): PushSubscriptionOptions; +} + +interface RTCDTMFToneChangeEvent extends Event { + readonly tone: string; +} + +declare var RTCDTMFToneChangeEvent: { + prototype: RTCDTMFToneChangeEvent; + new(typeArg: string, eventInitDict: RTCDTMFToneChangeEventInit): RTCDTMFToneChangeEvent; +} + +interface RTCDtlsTransportEventMap { + "dtlsstatechange": RTCDtlsTransportStateChangedEvent; + "error": Event; +} + +interface RTCDtlsTransport extends RTCStatsProvider { + ondtlsstatechange: ((this: RTCDtlsTransport, ev: RTCDtlsTransportStateChangedEvent) => any) | null; + onerror: ((this: RTCDtlsTransport, ev: Event) => any) | null; + readonly state: RTCDtlsTransportState; + readonly transport: RTCIceTransport; + getLocalParameters(): RTCDtlsParameters; + getRemoteCertificates(): ArrayBuffer[]; + getRemoteParameters(): RTCDtlsParameters | null; + start(remoteParameters: RTCDtlsParameters): void; + stop(): void; + addEventListener(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCDtlsTransport: { + prototype: RTCDtlsTransport; + new(transport: RTCIceTransport): RTCDtlsTransport; +} + +interface RTCDtlsTransportStateChangedEvent extends Event { + readonly state: RTCDtlsTransportState; +} + +declare var RTCDtlsTransportStateChangedEvent: { + prototype: RTCDtlsTransportStateChangedEvent; + new(): RTCDtlsTransportStateChangedEvent; +} + +interface RTCDtmfSenderEventMap { + "tonechange": RTCDTMFToneChangeEvent; +} + +interface RTCDtmfSender extends EventTarget { + readonly canInsertDTMF: boolean; + readonly duration: number; + readonly interToneGap: number; + ontonechange: (this: RTCDtmfSender, ev: RTCDTMFToneChangeEvent) => any; + readonly sender: RTCRtpSender; + readonly toneBuffer: string; + insertDTMF(tones: string, duration?: number, interToneGap?: number): void; + addEventListener(type: K, listener: (this: RTCDtmfSender, ev: RTCDtmfSenderEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCDtmfSender: { + prototype: RTCDtmfSender; + new(sender: RTCRtpSender): RTCDtmfSender; +} + +interface RTCIceCandidate { + candidate: string | null; + sdpMLineIndex: number | null; + sdpMid: string | null; + toJSON(): any; +} + +declare var RTCIceCandidate: { + prototype: RTCIceCandidate; + new(candidateInitDict?: RTCIceCandidateInit): RTCIceCandidate; +} + +interface RTCIceCandidatePairChangedEvent extends Event { + readonly pair: RTCIceCandidatePair; +} + +declare var RTCIceCandidatePairChangedEvent: { + prototype: RTCIceCandidatePairChangedEvent; + new(): RTCIceCandidatePairChangedEvent; +} + +interface RTCIceGathererEventMap { + "error": Event; + "localcandidate": RTCIceGathererEvent; +} + +interface RTCIceGatherer extends RTCStatsProvider { + readonly component: RTCIceComponent; + onerror: ((this: RTCIceGatherer, ev: Event) => any) | null; + onlocalcandidate: ((this: RTCIceGatherer, ev: RTCIceGathererEvent) => any) | null; + createAssociatedGatherer(): RTCIceGatherer; + getLocalCandidates(): RTCIceCandidateDictionary[]; + getLocalParameters(): RTCIceParameters; + addEventListener(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCIceGatherer: { + prototype: RTCIceGatherer; + new(options: RTCIceGatherOptions): RTCIceGatherer; +} + +interface RTCIceGathererEvent extends Event { + readonly candidate: RTCIceCandidateDictionary | RTCIceCandidateComplete; +} + +declare var RTCIceGathererEvent: { + prototype: RTCIceGathererEvent; + new(): RTCIceGathererEvent; +} + +interface RTCIceTransportEventMap { + "candidatepairchange": RTCIceCandidatePairChangedEvent; + "icestatechange": RTCIceTransportStateChangedEvent; +} + +interface RTCIceTransport extends RTCStatsProvider { + readonly component: RTCIceComponent; + readonly iceGatherer: RTCIceGatherer | null; + oncandidatepairchange: ((this: RTCIceTransport, ev: RTCIceCandidatePairChangedEvent) => any) | null; + onicestatechange: ((this: RTCIceTransport, ev: RTCIceTransportStateChangedEvent) => any) | null; + readonly role: RTCIceRole; + readonly state: RTCIceTransportState; + addRemoteCandidate(remoteCandidate: RTCIceCandidateDictionary | RTCIceCandidateComplete): void; + createAssociatedTransport(): RTCIceTransport; + getNominatedCandidatePair(): RTCIceCandidatePair | null; + getRemoteCandidates(): RTCIceCandidateDictionary[]; + getRemoteParameters(): RTCIceParameters | null; + setRemoteCandidates(remoteCandidates: RTCIceCandidateDictionary[]): void; + start(gatherer: RTCIceGatherer, remoteParameters: RTCIceParameters, role?: RTCIceRole): void; + stop(): void; + addEventListener(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCIceTransport: { + prototype: RTCIceTransport; + new(): RTCIceTransport; +} + +interface RTCIceTransportStateChangedEvent extends Event { + readonly state: RTCIceTransportState; +} + +declare var RTCIceTransportStateChangedEvent: { + prototype: RTCIceTransportStateChangedEvent; + new(): RTCIceTransportStateChangedEvent; +} + +interface RTCPeerConnectionEventMap { + "addstream": MediaStreamEvent; + "icecandidate": RTCPeerConnectionIceEvent; + "iceconnectionstatechange": Event; + "icegatheringstatechange": Event; + "negotiationneeded": Event; + "removestream": MediaStreamEvent; + "signalingstatechange": Event; +} + +interface RTCPeerConnection extends EventTarget { + readonly canTrickleIceCandidates: boolean | null; + readonly iceConnectionState: RTCIceConnectionState; + readonly iceGatheringState: RTCIceGatheringState; + readonly localDescription: RTCSessionDescription | null; + onaddstream: (this: RTCPeerConnection, ev: MediaStreamEvent) => any; + onicecandidate: (this: RTCPeerConnection, ev: RTCPeerConnectionIceEvent) => any; + oniceconnectionstatechange: (this: RTCPeerConnection, ev: Event) => any; + onicegatheringstatechange: (this: RTCPeerConnection, ev: Event) => any; + onnegotiationneeded: (this: RTCPeerConnection, ev: Event) => any; + onremovestream: (this: RTCPeerConnection, ev: MediaStreamEvent) => any; + onsignalingstatechange: (this: RTCPeerConnection, ev: Event) => any; + readonly remoteDescription: RTCSessionDescription | null; + readonly signalingState: RTCSignalingState; + addIceCandidate(candidate: RTCIceCandidate, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise; + addStream(stream: MediaStream): void; + close(): void; + createAnswer(successCallback?: RTCSessionDescriptionCallback, failureCallback?: RTCPeerConnectionErrorCallback): Promise; + createOffer(successCallback?: RTCSessionDescriptionCallback, failureCallback?: RTCPeerConnectionErrorCallback, options?: RTCOfferOptions): Promise; + getConfiguration(): RTCConfiguration; + getLocalStreams(): MediaStream[]; + getRemoteStreams(): MediaStream[]; + getStats(selector: MediaStreamTrack | null, successCallback?: RTCStatsCallback, failureCallback?: RTCPeerConnectionErrorCallback): Promise; + getStreamById(streamId: string): MediaStream | null; + removeStream(stream: MediaStream): void; + setLocalDescription(description: RTCSessionDescription, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise; + setRemoteDescription(description: RTCSessionDescription, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise; + addEventListener(type: K, listener: (this: RTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCPeerConnection: { + prototype: RTCPeerConnection; + new(configuration: RTCConfiguration): RTCPeerConnection; +} + +interface RTCPeerConnectionIceEvent extends Event { + readonly candidate: RTCIceCandidate; +} + +declare var RTCPeerConnectionIceEvent: { + prototype: RTCPeerConnectionIceEvent; + new(type: string, eventInitDict: RTCPeerConnectionIceEventInit): RTCPeerConnectionIceEvent; +} + +interface RTCRtpReceiverEventMap { + "error": Event; +} + +interface RTCRtpReceiver extends RTCStatsProvider { + onerror: ((this: RTCRtpReceiver, ev: Event) => any) | null; + readonly rtcpTransport: RTCDtlsTransport; + readonly track: MediaStreamTrack | null; + readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport; + getContributingSources(): RTCRtpContributingSource[]; + receive(parameters: RTCRtpParameters): void; + requestSendCSRC(csrc: number): void; + setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void; + stop(): void; + addEventListener(type: K, listener: (this: RTCRtpReceiver, ev: RTCRtpReceiverEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCRtpReceiver: { + prototype: RTCRtpReceiver; + new(transport: RTCDtlsTransport | RTCSrtpSdesTransport, kind: string, rtcpTransport?: RTCDtlsTransport): RTCRtpReceiver; + getCapabilities(kind?: string): RTCRtpCapabilities; +} + +interface RTCRtpSenderEventMap { + "error": Event; + "ssrcconflict": RTCSsrcConflictEvent; +} + +interface RTCRtpSender extends RTCStatsProvider { + onerror: ((this: RTCRtpSender, ev: Event) => any) | null; + onssrcconflict: ((this: RTCRtpSender, ev: RTCSsrcConflictEvent) => any) | null; + readonly rtcpTransport: RTCDtlsTransport; + readonly track: MediaStreamTrack; + readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport; + send(parameters: RTCRtpParameters): void; + setTrack(track: MediaStreamTrack): void; + setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void; + stop(): void; + addEventListener(type: K, listener: (this: RTCRtpSender, ev: RTCRtpSenderEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCRtpSender: { + prototype: RTCRtpSender; + new(track: MediaStreamTrack, transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): RTCRtpSender; + getCapabilities(kind?: string): RTCRtpCapabilities; +} + +interface RTCSessionDescription { + sdp: string | null; + type: RTCSdpType | null; + toJSON(): any; +} + +declare var RTCSessionDescription: { + prototype: RTCSessionDescription; + new(descriptionInitDict?: RTCSessionDescriptionInit): RTCSessionDescription; +} + +interface RTCSrtpSdesTransportEventMap { + "error": Event; +} + +interface RTCSrtpSdesTransport extends EventTarget { + onerror: ((this: RTCSrtpSdesTransport, ev: Event) => any) | null; + readonly transport: RTCIceTransport; + addEventListener(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCSrtpSdesTransport: { + prototype: RTCSrtpSdesTransport; + new(transport: RTCIceTransport, encryptParameters: RTCSrtpSdesParameters, decryptParameters: RTCSrtpSdesParameters): RTCSrtpSdesTransport; + getLocalParameters(): RTCSrtpSdesParameters[]; +} + +interface RTCSsrcConflictEvent extends Event { + readonly ssrc: number; +} + +declare var RTCSsrcConflictEvent: { + prototype: RTCSsrcConflictEvent; + new(): RTCSsrcConflictEvent; +} + +interface RTCStatsProvider extends EventTarget { + getStats(): Promise; + msGetStats(): Promise; +} + +declare var RTCStatsProvider: { + prototype: RTCStatsProvider; + new(): RTCStatsProvider; +} + +interface Range { + readonly collapsed: boolean; + readonly commonAncestorContainer: Node; + readonly endContainer: Node; + readonly endOffset: number; + readonly startContainer: Node; + readonly startOffset: number; + cloneContents(): DocumentFragment; + cloneRange(): Range; + collapse(toStart: boolean): void; + compareBoundaryPoints(how: number, sourceRange: Range): number; + createContextualFragment(fragment: string): DocumentFragment; + deleteContents(): void; + detach(): void; + expand(Unit: ExpandGranularity): boolean; + extractContents(): DocumentFragment; + getBoundingClientRect(): ClientRect; + getClientRects(): ClientRectList; + insertNode(newNode: Node): void; + selectNode(refNode: Node): void; + selectNodeContents(refNode: Node): void; + setEnd(refNode: Node, offset: number): void; + setEndAfter(refNode: Node): void; + setEndBefore(refNode: Node): void; + setStart(refNode: Node, offset: number): void; + setStartAfter(refNode: Node): void; + setStartBefore(refNode: Node): void; + surroundContents(newParent: Node): void; + toString(): string; + readonly END_TO_END: number; + readonly END_TO_START: number; + readonly START_TO_END: number; + readonly START_TO_START: number; +} + +declare var Range: { + prototype: Range; + new(): Range; + readonly END_TO_END: number; + readonly END_TO_START: number; + readonly START_TO_END: number; + readonly START_TO_START: number; +} + +interface ReadableStream { + readonly locked: boolean; + cancel(): Promise; + getReader(): ReadableStreamReader; +} + +declare var ReadableStream: { + prototype: ReadableStream; + new(): ReadableStream; +} + +interface ReadableStreamReader { + cancel(): Promise; + read(): Promise; + releaseLock(): void; +} + +declare var ReadableStreamReader: { + prototype: ReadableStreamReader; + new(): ReadableStreamReader; +} + +interface Request extends Object, Body { + readonly cache: RequestCache; + readonly credentials: RequestCredentials; + readonly destination: RequestDestination; + readonly headers: Headers; + readonly integrity: string; + readonly keepalive: boolean; + readonly method: string; + readonly mode: RequestMode; + readonly redirect: RequestRedirect; + readonly referrer: string; + readonly referrerPolicy: ReferrerPolicy; + readonly type: RequestType; + readonly url: string; + clone(): Request; +} + +declare var Request: { + prototype: Request; + new(input: Request | string, init?: RequestInit): Request; +} + +interface Response extends Object, Body { + readonly body: ReadableStream | null; + readonly headers: Headers; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly type: ResponseType; + readonly url: string; + clone(): Response; +} + +declare var Response: { + prototype: Response; + new(body?: any, init?: ResponseInit): Response; +} + +interface SVGAElement extends SVGGraphicsElement, SVGURIReference { + readonly target: SVGAnimatedString; + addEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGAElement: { + prototype: SVGAElement; + new(): SVGAElement; +} + +interface SVGAngle { + readonly unitType: number; + value: number; + valueAsString: string; + valueInSpecifiedUnits: number; + convertToSpecifiedUnits(unitType: number): void; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + readonly SVG_ANGLETYPE_DEG: number; + readonly SVG_ANGLETYPE_GRAD: number; + readonly SVG_ANGLETYPE_RAD: number; + readonly SVG_ANGLETYPE_UNKNOWN: number; + readonly SVG_ANGLETYPE_UNSPECIFIED: number; +} + +declare var SVGAngle: { + prototype: SVGAngle; + new(): SVGAngle; + readonly SVG_ANGLETYPE_DEG: number; + readonly SVG_ANGLETYPE_GRAD: number; + readonly SVG_ANGLETYPE_RAD: number; + readonly SVG_ANGLETYPE_UNKNOWN: number; + readonly SVG_ANGLETYPE_UNSPECIFIED: number; +} + +interface SVGAnimatedAngle { + readonly animVal: SVGAngle; + readonly baseVal: SVGAngle; +} + +declare var SVGAnimatedAngle: { + prototype: SVGAnimatedAngle; + new(): SVGAnimatedAngle; +} + +interface SVGAnimatedBoolean { + readonly animVal: boolean; + baseVal: boolean; +} + +declare var SVGAnimatedBoolean: { + prototype: SVGAnimatedBoolean; + new(): SVGAnimatedBoolean; +} + +interface SVGAnimatedEnumeration { + readonly animVal: number; + baseVal: number; +} + +declare var SVGAnimatedEnumeration: { + prototype: SVGAnimatedEnumeration; + new(): SVGAnimatedEnumeration; +} + +interface SVGAnimatedInteger { + readonly animVal: number; + baseVal: number; +} + +declare var SVGAnimatedInteger: { + prototype: SVGAnimatedInteger; + new(): SVGAnimatedInteger; +} + +interface SVGAnimatedLength { + readonly animVal: SVGLength; + readonly baseVal: SVGLength; +} + +declare var SVGAnimatedLength: { + prototype: SVGAnimatedLength; + new(): SVGAnimatedLength; +} + +interface SVGAnimatedLengthList { + readonly animVal: SVGLengthList; + readonly baseVal: SVGLengthList; +} + +declare var SVGAnimatedLengthList: { + prototype: SVGAnimatedLengthList; + new(): SVGAnimatedLengthList; +} + +interface SVGAnimatedNumber { + readonly animVal: number; + baseVal: number; +} + +declare var SVGAnimatedNumber: { + prototype: SVGAnimatedNumber; + new(): SVGAnimatedNumber; +} + +interface SVGAnimatedNumberList { + readonly animVal: SVGNumberList; + readonly baseVal: SVGNumberList; +} + +declare var SVGAnimatedNumberList: { + prototype: SVGAnimatedNumberList; + new(): SVGAnimatedNumberList; +} + +interface SVGAnimatedPreserveAspectRatio { + readonly animVal: SVGPreserveAspectRatio; + readonly baseVal: SVGPreserveAspectRatio; +} + +declare var SVGAnimatedPreserveAspectRatio: { + prototype: SVGAnimatedPreserveAspectRatio; + new(): SVGAnimatedPreserveAspectRatio; +} + +interface SVGAnimatedRect { + readonly animVal: SVGRect; + readonly baseVal: SVGRect; +} + +declare var SVGAnimatedRect: { + prototype: SVGAnimatedRect; + new(): SVGAnimatedRect; +} + +interface SVGAnimatedString { + readonly animVal: string; + baseVal: string; +} + +declare var SVGAnimatedString: { + prototype: SVGAnimatedString; + new(): SVGAnimatedString; +} + +interface SVGAnimatedTransformList { + readonly animVal: SVGTransformList; + readonly baseVal: SVGTransformList; +} + +declare var SVGAnimatedTransformList: { + prototype: SVGAnimatedTransformList; + new(): SVGAnimatedTransformList; +} + +interface SVGCircleElement extends SVGGraphicsElement { + readonly cx: SVGAnimatedLength; + readonly cy: SVGAnimatedLength; + readonly r: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGCircleElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGCircleElement: { + prototype: SVGCircleElement; + new(): SVGCircleElement; +} + +interface SVGClipPathElement extends SVGGraphicsElement, SVGUnitTypes { + readonly clipPathUnits: SVGAnimatedEnumeration; + addEventListener(type: K, listener: (this: SVGClipPathElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGClipPathElement: { + prototype: SVGClipPathElement; + new(): SVGClipPathElement; +} + +interface SVGComponentTransferFunctionElement extends SVGElement { + readonly amplitude: SVGAnimatedNumber; + readonly exponent: SVGAnimatedNumber; + readonly intercept: SVGAnimatedNumber; + readonly offset: SVGAnimatedNumber; + readonly slope: SVGAnimatedNumber; + readonly tableValues: SVGAnimatedNumberList; + readonly type: SVGAnimatedEnumeration; + readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGComponentTransferFunctionElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGComponentTransferFunctionElement: { + prototype: SVGComponentTransferFunctionElement; + new(): SVGComponentTransferFunctionElement; + readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; +} + +interface SVGDefsElement extends SVGGraphicsElement { + addEventListener(type: K, listener: (this: SVGDefsElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGDefsElement: { + prototype: SVGDefsElement; + new(): SVGDefsElement; +} + +interface SVGDescElement extends SVGElement { + addEventListener(type: K, listener: (this: SVGDescElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGDescElement: { + prototype: SVGDescElement; + new(): SVGDescElement; +} + +interface SVGElementEventMap extends ElementEventMap { + "click": MouseEvent; + "dblclick": MouseEvent; + "focusin": FocusEvent; + "focusout": FocusEvent; + "load": Event; + "mousedown": MouseEvent; + "mousemove": MouseEvent; + "mouseout": MouseEvent; + "mouseover": MouseEvent; + "mouseup": MouseEvent; +} + +interface SVGElement extends Element { + className: any; + onclick: (this: SVGElement, ev: MouseEvent) => any; + ondblclick: (this: SVGElement, ev: MouseEvent) => any; + onfocusin: (this: SVGElement, ev: FocusEvent) => any; + onfocusout: (this: SVGElement, ev: FocusEvent) => any; + onload: (this: SVGElement, ev: Event) => any; + onmousedown: (this: SVGElement, ev: MouseEvent) => any; + onmousemove: (this: SVGElement, ev: MouseEvent) => any; + onmouseout: (this: SVGElement, ev: MouseEvent) => any; + onmouseover: (this: SVGElement, ev: MouseEvent) => any; + onmouseup: (this: SVGElement, ev: MouseEvent) => any; + readonly ownerSVGElement: SVGSVGElement; + readonly style: CSSStyleDeclaration; + readonly viewportElement: SVGElement; + xmlbase: string; + addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGElement: { + prototype: SVGElement; + new(): SVGElement; +} + +interface SVGElementInstance extends EventTarget { + readonly childNodes: SVGElementInstanceList; + readonly correspondingElement: SVGElement; + readonly correspondingUseElement: SVGUseElement; + readonly firstChild: SVGElementInstance; + readonly lastChild: SVGElementInstance; + readonly nextSibling: SVGElementInstance; + readonly parentNode: SVGElementInstance; + readonly previousSibling: SVGElementInstance; +} + +declare var SVGElementInstance: { + prototype: SVGElementInstance; + new(): SVGElementInstance; +} + +interface SVGElementInstanceList { + readonly length: number; + item(index: number): SVGElementInstance; +} + +declare var SVGElementInstanceList: { + prototype: SVGElementInstanceList; + new(): SVGElementInstanceList; +} + +interface SVGEllipseElement extends SVGGraphicsElement { + readonly cx: SVGAnimatedLength; + readonly cy: SVGAnimatedLength; + readonly rx: SVGAnimatedLength; + readonly ry: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGEllipseElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGEllipseElement: { + prototype: SVGEllipseElement; + new(): SVGEllipseElement; +} + +interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + readonly in2: SVGAnimatedString; + readonly mode: SVGAnimatedEnumeration; + readonly SVG_FEBLEND_MODE_COLOR: number; + readonly SVG_FEBLEND_MODE_COLOR_BURN: number; + readonly SVG_FEBLEND_MODE_COLOR_DODGE: number; + readonly SVG_FEBLEND_MODE_DARKEN: number; + readonly SVG_FEBLEND_MODE_DIFFERENCE: number; + readonly SVG_FEBLEND_MODE_EXCLUSION: number; + readonly SVG_FEBLEND_MODE_HARD_LIGHT: number; + readonly SVG_FEBLEND_MODE_HUE: number; + readonly SVG_FEBLEND_MODE_LIGHTEN: number; + readonly SVG_FEBLEND_MODE_LUMINOSITY: number; + readonly SVG_FEBLEND_MODE_MULTIPLY: number; + readonly SVG_FEBLEND_MODE_NORMAL: number; + readonly SVG_FEBLEND_MODE_OVERLAY: number; + readonly SVG_FEBLEND_MODE_SATURATION: number; + readonly SVG_FEBLEND_MODE_SCREEN: number; + readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number; + readonly SVG_FEBLEND_MODE_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGFEBlendElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEBlendElement: { + prototype: SVGFEBlendElement; + new(): SVGFEBlendElement; + readonly SVG_FEBLEND_MODE_COLOR: number; + readonly SVG_FEBLEND_MODE_COLOR_BURN: number; + readonly SVG_FEBLEND_MODE_COLOR_DODGE: number; + readonly SVG_FEBLEND_MODE_DARKEN: number; + readonly SVG_FEBLEND_MODE_DIFFERENCE: number; + readonly SVG_FEBLEND_MODE_EXCLUSION: number; + readonly SVG_FEBLEND_MODE_HARD_LIGHT: number; + readonly SVG_FEBLEND_MODE_HUE: number; + readonly SVG_FEBLEND_MODE_LIGHTEN: number; + readonly SVG_FEBLEND_MODE_LUMINOSITY: number; + readonly SVG_FEBLEND_MODE_MULTIPLY: number; + readonly SVG_FEBLEND_MODE_NORMAL: number; + readonly SVG_FEBLEND_MODE_OVERLAY: number; + readonly SVG_FEBLEND_MODE_SATURATION: number; + readonly SVG_FEBLEND_MODE_SCREEN: number; + readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number; + readonly SVG_FEBLEND_MODE_UNKNOWN: number; +} + +interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + readonly type: SVGAnimatedEnumeration; + readonly values: SVGAnimatedNumberList; + readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; + readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number; + readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number; + readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGFEColorMatrixElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEColorMatrixElement: { + prototype: SVGFEColorMatrixElement; + new(): SVGFEColorMatrixElement; + readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; + readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number; + readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number; + readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; +} + +interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + addEventListener(type: K, listener: (this: SVGFEComponentTransferElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEComponentTransferElement: { + prototype: SVGFEComponentTransferElement; + new(): SVGFEComponentTransferElement; +} + +interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + readonly in2: SVGAnimatedString; + readonly k1: SVGAnimatedNumber; + readonly k2: SVGAnimatedNumber; + readonly k3: SVGAnimatedNumber; + readonly k4: SVGAnimatedNumber; + readonly operator: SVGAnimatedEnumeration; + readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number; + readonly SVG_FECOMPOSITE_OPERATOR_IN: number; + readonly SVG_FECOMPOSITE_OPERATOR_OUT: number; + readonly SVG_FECOMPOSITE_OPERATOR_OVER: number; + readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + readonly SVG_FECOMPOSITE_OPERATOR_XOR: number; + addEventListener(type: K, listener: (this: SVGFECompositeElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFECompositeElement: { + prototype: SVGFECompositeElement; + new(): SVGFECompositeElement; + readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number; + readonly SVG_FECOMPOSITE_OPERATOR_IN: number; + readonly SVG_FECOMPOSITE_OPERATOR_OUT: number; + readonly SVG_FECOMPOSITE_OPERATOR_OVER: number; + readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + readonly SVG_FECOMPOSITE_OPERATOR_XOR: number; +} + +interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly bias: SVGAnimatedNumber; + readonly divisor: SVGAnimatedNumber; + readonly edgeMode: SVGAnimatedEnumeration; + readonly in1: SVGAnimatedString; + readonly kernelMatrix: SVGAnimatedNumberList; + readonly kernelUnitLengthX: SVGAnimatedNumber; + readonly kernelUnitLengthY: SVGAnimatedNumber; + readonly orderX: SVGAnimatedInteger; + readonly orderY: SVGAnimatedInteger; + readonly preserveAlpha: SVGAnimatedBoolean; + readonly targetX: SVGAnimatedInteger; + readonly targetY: SVGAnimatedInteger; + readonly SVG_EDGEMODE_DUPLICATE: number; + readonly SVG_EDGEMODE_NONE: number; + readonly SVG_EDGEMODE_UNKNOWN: number; + readonly SVG_EDGEMODE_WRAP: number; + addEventListener(type: K, listener: (this: SVGFEConvolveMatrixElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEConvolveMatrixElement: { + prototype: SVGFEConvolveMatrixElement; + new(): SVGFEConvolveMatrixElement; + readonly SVG_EDGEMODE_DUPLICATE: number; + readonly SVG_EDGEMODE_NONE: number; + readonly SVG_EDGEMODE_UNKNOWN: number; + readonly SVG_EDGEMODE_WRAP: number; +} + +interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly diffuseConstant: SVGAnimatedNumber; + readonly in1: SVGAnimatedString; + readonly kernelUnitLengthX: SVGAnimatedNumber; + readonly kernelUnitLengthY: SVGAnimatedNumber; + readonly surfaceScale: SVGAnimatedNumber; + addEventListener(type: K, listener: (this: SVGFEDiffuseLightingElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEDiffuseLightingElement: { + prototype: SVGFEDiffuseLightingElement; + new(): SVGFEDiffuseLightingElement; +} + +interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + readonly in2: SVGAnimatedString; + readonly scale: SVGAnimatedNumber; + readonly xChannelSelector: SVGAnimatedEnumeration; + readonly yChannelSelector: SVGAnimatedEnumeration; + readonly SVG_CHANNEL_A: number; + readonly SVG_CHANNEL_B: number; + readonly SVG_CHANNEL_G: number; + readonly SVG_CHANNEL_R: number; + readonly SVG_CHANNEL_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGFEDisplacementMapElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEDisplacementMapElement: { + prototype: SVGFEDisplacementMapElement; + new(): SVGFEDisplacementMapElement; + readonly SVG_CHANNEL_A: number; + readonly SVG_CHANNEL_B: number; + readonly SVG_CHANNEL_G: number; + readonly SVG_CHANNEL_R: number; + readonly SVG_CHANNEL_UNKNOWN: number; +} + +interface SVGFEDistantLightElement extends SVGElement { + readonly azimuth: SVGAnimatedNumber; + readonly elevation: SVGAnimatedNumber; + addEventListener(type: K, listener: (this: SVGFEDistantLightElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEDistantLightElement: { + prototype: SVGFEDistantLightElement; + new(): SVGFEDistantLightElement; +} + +interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + addEventListener(type: K, listener: (this: SVGFEFloodElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEFloodElement: { + prototype: SVGFEFloodElement; + new(): SVGFEFloodElement; +} + +interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { + addEventListener(type: K, listener: (this: SVGFEFuncAElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEFuncAElement: { + prototype: SVGFEFuncAElement; + new(): SVGFEFuncAElement; +} + +interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { + addEventListener(type: K, listener: (this: SVGFEFuncBElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEFuncBElement: { + prototype: SVGFEFuncBElement; + new(): SVGFEFuncBElement; +} + +interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { + addEventListener(type: K, listener: (this: SVGFEFuncGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEFuncGElement: { + prototype: SVGFEFuncGElement; + new(): SVGFEFuncGElement; +} + +interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { + addEventListener(type: K, listener: (this: SVGFEFuncRElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEFuncRElement: { + prototype: SVGFEFuncRElement; + new(): SVGFEFuncRElement; +} + +interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + readonly stdDeviationX: SVGAnimatedNumber; + readonly stdDeviationY: SVGAnimatedNumber; + setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; + addEventListener(type: K, listener: (this: SVGFEGaussianBlurElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEGaussianBlurElement: { + prototype: SVGFEGaussianBlurElement; + new(): SVGFEGaussianBlurElement; +} + +interface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGURIReference { + readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + addEventListener(type: K, listener: (this: SVGFEImageElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEImageElement: { + prototype: SVGFEImageElement; + new(): SVGFEImageElement; +} + +interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + addEventListener(type: K, listener: (this: SVGFEMergeElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEMergeElement: { + prototype: SVGFEMergeElement; + new(): SVGFEMergeElement; +} + +interface SVGFEMergeNodeElement extends SVGElement { + readonly in1: SVGAnimatedString; + addEventListener(type: K, listener: (this: SVGFEMergeNodeElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEMergeNodeElement: { + prototype: SVGFEMergeNodeElement; + new(): SVGFEMergeNodeElement; +} + +interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + readonly operator: SVGAnimatedEnumeration; + readonly radiusX: SVGAnimatedNumber; + readonly radiusY: SVGAnimatedNumber; + readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number; + readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number; + readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGFEMorphologyElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEMorphologyElement: { + prototype: SVGFEMorphologyElement; + new(): SVGFEMorphologyElement; + readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number; + readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number; + readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; +} + +interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly dx: SVGAnimatedNumber; + readonly dy: SVGAnimatedNumber; + readonly in1: SVGAnimatedString; + addEventListener(type: K, listener: (this: SVGFEOffsetElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEOffsetElement: { + prototype: SVGFEOffsetElement; + new(): SVGFEOffsetElement; +} + +interface SVGFEPointLightElement extends SVGElement { + readonly x: SVGAnimatedNumber; + readonly y: SVGAnimatedNumber; + readonly z: SVGAnimatedNumber; + addEventListener(type: K, listener: (this: SVGFEPointLightElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEPointLightElement: { + prototype: SVGFEPointLightElement; + new(): SVGFEPointLightElement; +} + +interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + readonly kernelUnitLengthX: SVGAnimatedNumber; + readonly kernelUnitLengthY: SVGAnimatedNumber; + readonly specularConstant: SVGAnimatedNumber; + readonly specularExponent: SVGAnimatedNumber; + readonly surfaceScale: SVGAnimatedNumber; + addEventListener(type: K, listener: (this: SVGFESpecularLightingElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFESpecularLightingElement: { + prototype: SVGFESpecularLightingElement; + new(): SVGFESpecularLightingElement; +} + +interface SVGFESpotLightElement extends SVGElement { + readonly limitingConeAngle: SVGAnimatedNumber; + readonly pointsAtX: SVGAnimatedNumber; + readonly pointsAtY: SVGAnimatedNumber; + readonly pointsAtZ: SVGAnimatedNumber; + readonly specularExponent: SVGAnimatedNumber; + readonly x: SVGAnimatedNumber; + readonly y: SVGAnimatedNumber; + readonly z: SVGAnimatedNumber; + addEventListener(type: K, listener: (this: SVGFESpotLightElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFESpotLightElement: { + prototype: SVGFESpotLightElement; + new(): SVGFESpotLightElement; +} + +interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + addEventListener(type: K, listener: (this: SVGFETileElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFETileElement: { + prototype: SVGFETileElement; + new(): SVGFETileElement; +} + +interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly baseFrequencyX: SVGAnimatedNumber; + readonly baseFrequencyY: SVGAnimatedNumber; + readonly numOctaves: SVGAnimatedInteger; + readonly seed: SVGAnimatedNumber; + readonly stitchTiles: SVGAnimatedEnumeration; + readonly type: SVGAnimatedEnumeration; + readonly SVG_STITCHTYPE_NOSTITCH: number; + readonly SVG_STITCHTYPE_STITCH: number; + readonly SVG_STITCHTYPE_UNKNOWN: number; + readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + readonly SVG_TURBULENCE_TYPE_TURBULENCE: number; + readonly SVG_TURBULENCE_TYPE_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGFETurbulenceElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFETurbulenceElement: { + prototype: SVGFETurbulenceElement; + new(): SVGFETurbulenceElement; + readonly SVG_STITCHTYPE_NOSTITCH: number; + readonly SVG_STITCHTYPE_STITCH: number; + readonly SVG_STITCHTYPE_UNKNOWN: number; + readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + readonly SVG_TURBULENCE_TYPE_TURBULENCE: number; + readonly SVG_TURBULENCE_TYPE_UNKNOWN: number; +} + +interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGURIReference { + readonly filterResX: SVGAnimatedInteger; + readonly filterResY: SVGAnimatedInteger; + readonly filterUnits: SVGAnimatedEnumeration; + readonly height: SVGAnimatedLength; + readonly primitiveUnits: SVGAnimatedEnumeration; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + setFilterRes(filterResX: number, filterResY: number): void; + addEventListener(type: K, listener: (this: SVGFilterElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFilterElement: { + prototype: SVGFilterElement; + new(): SVGFilterElement; +} + +interface SVGForeignObjectElement extends SVGGraphicsElement { + readonly height: SVGAnimatedLength; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGForeignObjectElement: { + prototype: SVGForeignObjectElement; + new(): SVGForeignObjectElement; +} + +interface SVGGElement extends SVGGraphicsElement { + addEventListener(type: K, listener: (this: SVGGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGGElement: { + prototype: SVGGElement; + new(): SVGGElement; +} + +interface SVGGradientElement extends SVGElement, SVGUnitTypes, SVGURIReference { + readonly gradientTransform: SVGAnimatedTransformList; + readonly gradientUnits: SVGAnimatedEnumeration; + readonly spreadMethod: SVGAnimatedEnumeration; + readonly SVG_SPREADMETHOD_PAD: number; + readonly SVG_SPREADMETHOD_REFLECT: number; + readonly SVG_SPREADMETHOD_REPEAT: number; + readonly SVG_SPREADMETHOD_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGGradientElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGGradientElement: { + prototype: SVGGradientElement; + new(): SVGGradientElement; + readonly SVG_SPREADMETHOD_PAD: number; + readonly SVG_SPREADMETHOD_REFLECT: number; + readonly SVG_SPREADMETHOD_REPEAT: number; + readonly SVG_SPREADMETHOD_UNKNOWN: number; +} + +interface SVGGraphicsElement extends SVGElement, SVGTests { + readonly farthestViewportElement: SVGElement; + readonly nearestViewportElement: SVGElement; + readonly transform: SVGAnimatedTransformList; + getBBox(): SVGRect; + getCTM(): SVGMatrix; + getScreenCTM(): SVGMatrix; + getTransformToElement(element: SVGElement): SVGMatrix; + addEventListener(type: K, listener: (this: SVGGraphicsElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGGraphicsElement: { + prototype: SVGGraphicsElement; + new(): SVGGraphicsElement; +} + +interface SVGImageElement extends SVGGraphicsElement, SVGURIReference { + readonly height: SVGAnimatedLength; + readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGImageElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGImageElement: { + prototype: SVGImageElement; + new(): SVGImageElement; +} + +interface SVGLength { + readonly unitType: number; + value: number; + valueAsString: string; + valueInSpecifiedUnits: number; + convertToSpecifiedUnits(unitType: number): void; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + readonly SVG_LENGTHTYPE_CM: number; + readonly SVG_LENGTHTYPE_EMS: number; + readonly SVG_LENGTHTYPE_EXS: number; + readonly SVG_LENGTHTYPE_IN: number; + readonly SVG_LENGTHTYPE_MM: number; + readonly SVG_LENGTHTYPE_NUMBER: number; + readonly SVG_LENGTHTYPE_PC: number; + readonly SVG_LENGTHTYPE_PERCENTAGE: number; + readonly SVG_LENGTHTYPE_PT: number; + readonly SVG_LENGTHTYPE_PX: number; + readonly SVG_LENGTHTYPE_UNKNOWN: number; +} + +declare var SVGLength: { + prototype: SVGLength; + new(): SVGLength; + readonly SVG_LENGTHTYPE_CM: number; + readonly SVG_LENGTHTYPE_EMS: number; + readonly SVG_LENGTHTYPE_EXS: number; + readonly SVG_LENGTHTYPE_IN: number; + readonly SVG_LENGTHTYPE_MM: number; + readonly SVG_LENGTHTYPE_NUMBER: number; + readonly SVG_LENGTHTYPE_PC: number; + readonly SVG_LENGTHTYPE_PERCENTAGE: number; + readonly SVG_LENGTHTYPE_PT: number; + readonly SVG_LENGTHTYPE_PX: number; + readonly SVG_LENGTHTYPE_UNKNOWN: number; +} + +interface SVGLengthList { + readonly numberOfItems: number; + appendItem(newItem: SVGLength): SVGLength; + clear(): void; + getItem(index: number): SVGLength; + initialize(newItem: SVGLength): SVGLength; + insertItemBefore(newItem: SVGLength, index: number): SVGLength; + removeItem(index: number): SVGLength; + replaceItem(newItem: SVGLength, index: number): SVGLength; +} + +declare var SVGLengthList: { + prototype: SVGLengthList; + new(): SVGLengthList; +} + +interface SVGLineElement extends SVGGraphicsElement { + readonly x1: SVGAnimatedLength; + readonly x2: SVGAnimatedLength; + readonly y1: SVGAnimatedLength; + readonly y2: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGLineElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGLineElement: { + prototype: SVGLineElement; + new(): SVGLineElement; +} + +interface SVGLinearGradientElement extends SVGGradientElement { + readonly x1: SVGAnimatedLength; + readonly x2: SVGAnimatedLength; + readonly y1: SVGAnimatedLength; + readonly y2: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGLinearGradientElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGLinearGradientElement: { + prototype: SVGLinearGradientElement; + new(): SVGLinearGradientElement; +} + +interface SVGMarkerElement extends SVGElement, SVGFitToViewBox { + readonly markerHeight: SVGAnimatedLength; + readonly markerUnits: SVGAnimatedEnumeration; + readonly markerWidth: SVGAnimatedLength; + readonly orientAngle: SVGAnimatedAngle; + readonly orientType: SVGAnimatedEnumeration; + readonly refX: SVGAnimatedLength; + readonly refY: SVGAnimatedLength; + setOrientToAngle(angle: SVGAngle): void; + setOrientToAuto(): void; + readonly SVG_MARKERUNITS_STROKEWIDTH: number; + readonly SVG_MARKERUNITS_UNKNOWN: number; + readonly SVG_MARKERUNITS_USERSPACEONUSE: number; + readonly SVG_MARKER_ORIENT_ANGLE: number; + readonly SVG_MARKER_ORIENT_AUTO: number; + readonly SVG_MARKER_ORIENT_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGMarkerElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGMarkerElement: { + prototype: SVGMarkerElement; + new(): SVGMarkerElement; + readonly SVG_MARKERUNITS_STROKEWIDTH: number; + readonly SVG_MARKERUNITS_UNKNOWN: number; + readonly SVG_MARKERUNITS_USERSPACEONUSE: number; + readonly SVG_MARKER_ORIENT_ANGLE: number; + readonly SVG_MARKER_ORIENT_AUTO: number; + readonly SVG_MARKER_ORIENT_UNKNOWN: number; +} + +interface SVGMaskElement extends SVGElement, SVGTests, SVGUnitTypes { + readonly height: SVGAnimatedLength; + readonly maskContentUnits: SVGAnimatedEnumeration; + readonly maskUnits: SVGAnimatedEnumeration; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGMaskElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGMaskElement: { + prototype: SVGMaskElement; + new(): SVGMaskElement; +} + +interface SVGMatrix { + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + flipX(): SVGMatrix; + flipY(): SVGMatrix; + inverse(): SVGMatrix; + multiply(secondMatrix: SVGMatrix): SVGMatrix; + rotate(angle: number): SVGMatrix; + rotateFromVector(x: number, y: number): SVGMatrix; + scale(scaleFactor: number): SVGMatrix; + scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; + skewX(angle: number): SVGMatrix; + skewY(angle: number): SVGMatrix; + translate(x: number, y: number): SVGMatrix; +} + +declare var SVGMatrix: { + prototype: SVGMatrix; + new(): SVGMatrix; +} + +interface SVGMetadataElement extends SVGElement { + addEventListener(type: K, listener: (this: SVGMetadataElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGMetadataElement: { + prototype: SVGMetadataElement; + new(): SVGMetadataElement; +} + +interface SVGNumber { + value: number; +} + +declare var SVGNumber: { + prototype: SVGNumber; + new(): SVGNumber; +} + +interface SVGNumberList { + readonly numberOfItems: number; + appendItem(newItem: SVGNumber): SVGNumber; + clear(): void; + getItem(index: number): SVGNumber; + initialize(newItem: SVGNumber): SVGNumber; + insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; + removeItem(index: number): SVGNumber; + replaceItem(newItem: SVGNumber, index: number): SVGNumber; +} + +declare var SVGNumberList: { + prototype: SVGNumberList; + new(): SVGNumberList; +} + +interface SVGPathElement extends SVGGraphicsElement { + readonly pathSegList: SVGPathSegList; + createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; + createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; + createSVGPathSegClosePath(): SVGPathSegClosePath; + createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; + createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; + createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; + createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; + createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; + createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; + createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; + createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; + createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; + createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; + createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; + createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; + createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; + createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; + createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; + createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; + getPathSegAtLength(distance: number): number; + getPointAtLength(distance: number): SVGPoint; + getTotalLength(): number; + addEventListener(type: K, listener: (this: SVGPathElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPathElement: { + prototype: SVGPathElement; + new(): SVGPathElement; +} + +interface SVGPathSeg { + readonly pathSegType: number; + readonly pathSegTypeAsLetter: string; + readonly PATHSEG_ARC_ABS: number; + readonly PATHSEG_ARC_REL: number; + readonly PATHSEG_CLOSEPATH: number; + readonly PATHSEG_CURVETO_CUBIC_ABS: number; + readonly PATHSEG_CURVETO_CUBIC_REL: number; + readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + readonly PATHSEG_CURVETO_QUADRATIC_ABS: number; + readonly PATHSEG_CURVETO_QUADRATIC_REL: number; + readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; + readonly PATHSEG_LINETO_ABS: number; + readonly PATHSEG_LINETO_HORIZONTAL_ABS: number; + readonly PATHSEG_LINETO_HORIZONTAL_REL: number; + readonly PATHSEG_LINETO_REL: number; + readonly PATHSEG_LINETO_VERTICAL_ABS: number; + readonly PATHSEG_LINETO_VERTICAL_REL: number; + readonly PATHSEG_MOVETO_ABS: number; + readonly PATHSEG_MOVETO_REL: number; + readonly PATHSEG_UNKNOWN: number; +} + +declare var SVGPathSeg: { + prototype: SVGPathSeg; + new(): SVGPathSeg; + readonly PATHSEG_ARC_ABS: number; + readonly PATHSEG_ARC_REL: number; + readonly PATHSEG_CLOSEPATH: number; + readonly PATHSEG_CURVETO_CUBIC_ABS: number; + readonly PATHSEG_CURVETO_CUBIC_REL: number; + readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + readonly PATHSEG_CURVETO_QUADRATIC_ABS: number; + readonly PATHSEG_CURVETO_QUADRATIC_REL: number; + readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; + readonly PATHSEG_LINETO_ABS: number; + readonly PATHSEG_LINETO_HORIZONTAL_ABS: number; + readonly PATHSEG_LINETO_HORIZONTAL_REL: number; + readonly PATHSEG_LINETO_REL: number; + readonly PATHSEG_LINETO_VERTICAL_ABS: number; + readonly PATHSEG_LINETO_VERTICAL_REL: number; + readonly PATHSEG_MOVETO_ABS: number; + readonly PATHSEG_MOVETO_REL: number; + readonly PATHSEG_UNKNOWN: number; +} + +interface SVGPathSegArcAbs extends SVGPathSeg { + angle: number; + largeArcFlag: boolean; + r1: number; + r2: number; + sweepFlag: boolean; + x: number; + y: number; +} + +declare var SVGPathSegArcAbs: { + prototype: SVGPathSegArcAbs; + new(): SVGPathSegArcAbs; +} + +interface SVGPathSegArcRel extends SVGPathSeg { + angle: number; + largeArcFlag: boolean; + r1: number; + r2: number; + sweepFlag: boolean; + x: number; + y: number; +} + +declare var SVGPathSegArcRel: { + prototype: SVGPathSegArcRel; + new(): SVGPathSegArcRel; +} + +interface SVGPathSegClosePath extends SVGPathSeg { +} + +declare var SVGPathSegClosePath: { + prototype: SVGPathSegClosePath; + new(): SVGPathSegClosePath; +} + +interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { + x: number; + x1: number; + x2: number; + y: number; + y1: number; + y2: number; +} + +declare var SVGPathSegCurvetoCubicAbs: { + prototype: SVGPathSegCurvetoCubicAbs; + new(): SVGPathSegCurvetoCubicAbs; +} + +interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { + x: number; + x1: number; + x2: number; + y: number; + y1: number; + y2: number; +} + +declare var SVGPathSegCurvetoCubicRel: { + prototype: SVGPathSegCurvetoCubicRel; + new(): SVGPathSegCurvetoCubicRel; +} + +interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { + x: number; + x2: number; + y: number; + y2: number; +} + +declare var SVGPathSegCurvetoCubicSmoothAbs: { + prototype: SVGPathSegCurvetoCubicSmoothAbs; + new(): SVGPathSegCurvetoCubicSmoothAbs; +} + +interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { + x: number; + x2: number; + y: number; + y2: number; +} + +declare var SVGPathSegCurvetoCubicSmoothRel: { + prototype: SVGPathSegCurvetoCubicSmoothRel; + new(): SVGPathSegCurvetoCubicSmoothRel; +} + +interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { + x: number; + x1: number; + y: number; + y1: number; +} + +declare var SVGPathSegCurvetoQuadraticAbs: { + prototype: SVGPathSegCurvetoQuadraticAbs; + new(): SVGPathSegCurvetoQuadraticAbs; +} + +interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { + x: number; + x1: number; + y: number; + y1: number; +} + +declare var SVGPathSegCurvetoQuadraticRel: { + prototype: SVGPathSegCurvetoQuadraticRel; + new(): SVGPathSegCurvetoQuadraticRel; +} + +interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegCurvetoQuadraticSmoothAbs: { + prototype: SVGPathSegCurvetoQuadraticSmoothAbs; + new(): SVGPathSegCurvetoQuadraticSmoothAbs; +} + +interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegCurvetoQuadraticSmoothRel: { + prototype: SVGPathSegCurvetoQuadraticSmoothRel; + new(): SVGPathSegCurvetoQuadraticSmoothRel; +} + +interface SVGPathSegLinetoAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegLinetoAbs: { + prototype: SVGPathSegLinetoAbs; + new(): SVGPathSegLinetoAbs; +} + +interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { + x: number; +} + +declare var SVGPathSegLinetoHorizontalAbs: { + prototype: SVGPathSegLinetoHorizontalAbs; + new(): SVGPathSegLinetoHorizontalAbs; +} + +interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { + x: number; +} + +declare var SVGPathSegLinetoHorizontalRel: { + prototype: SVGPathSegLinetoHorizontalRel; + new(): SVGPathSegLinetoHorizontalRel; +} + +interface SVGPathSegLinetoRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegLinetoRel: { + prototype: SVGPathSegLinetoRel; + new(): SVGPathSegLinetoRel; +} + +interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { + y: number; +} + +declare var SVGPathSegLinetoVerticalAbs: { + prototype: SVGPathSegLinetoVerticalAbs; + new(): SVGPathSegLinetoVerticalAbs; +} + +interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { + y: number; +} + +declare var SVGPathSegLinetoVerticalRel: { + prototype: SVGPathSegLinetoVerticalRel; + new(): SVGPathSegLinetoVerticalRel; +} + +interface SVGPathSegList { + readonly numberOfItems: number; + appendItem(newItem: SVGPathSeg): SVGPathSeg; + clear(): void; + getItem(index: number): SVGPathSeg; + initialize(newItem: SVGPathSeg): SVGPathSeg; + insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; + removeItem(index: number): SVGPathSeg; + replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; +} + +declare var SVGPathSegList: { + prototype: SVGPathSegList; + new(): SVGPathSegList; +} + +interface SVGPathSegMovetoAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegMovetoAbs: { + prototype: SVGPathSegMovetoAbs; + new(): SVGPathSegMovetoAbs; +} + +interface SVGPathSegMovetoRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegMovetoRel: { + prototype: SVGPathSegMovetoRel; + new(): SVGPathSegMovetoRel; +} + +interface SVGPatternElement extends SVGElement, SVGTests, SVGUnitTypes, SVGFitToViewBox, SVGURIReference { + readonly height: SVGAnimatedLength; + readonly patternContentUnits: SVGAnimatedEnumeration; + readonly patternTransform: SVGAnimatedTransformList; + readonly patternUnits: SVGAnimatedEnumeration; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGPatternElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPatternElement: { + prototype: SVGPatternElement; + new(): SVGPatternElement; +} + +interface SVGPoint { + x: number; + y: number; + matrixTransform(matrix: SVGMatrix): SVGPoint; +} + +declare var SVGPoint: { + prototype: SVGPoint; + new(): SVGPoint; +} + +interface SVGPointList { + readonly numberOfItems: number; + appendItem(newItem: SVGPoint): SVGPoint; + clear(): void; + getItem(index: number): SVGPoint; + initialize(newItem: SVGPoint): SVGPoint; + insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; + removeItem(index: number): SVGPoint; + replaceItem(newItem: SVGPoint, index: number): SVGPoint; +} + +declare var SVGPointList: { + prototype: SVGPointList; + new(): SVGPointList; +} + +interface SVGPolygonElement extends SVGGraphicsElement, SVGAnimatedPoints { + addEventListener(type: K, listener: (this: SVGPolygonElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPolygonElement: { + prototype: SVGPolygonElement; + new(): SVGPolygonElement; +} + +interface SVGPolylineElement extends SVGGraphicsElement, SVGAnimatedPoints { + addEventListener(type: K, listener: (this: SVGPolylineElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPolylineElement: { + prototype: SVGPolylineElement; + new(): SVGPolylineElement; +} + +interface SVGPreserveAspectRatio { + align: number; + meetOrSlice: number; + readonly SVG_MEETORSLICE_MEET: number; + readonly SVG_MEETORSLICE_SLICE: number; + readonly SVG_MEETORSLICE_UNKNOWN: number; + readonly SVG_PRESERVEASPECTRATIO_NONE: number; + readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number; + readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number; +} + +declare var SVGPreserveAspectRatio: { + prototype: SVGPreserveAspectRatio; + new(): SVGPreserveAspectRatio; + readonly SVG_MEETORSLICE_MEET: number; + readonly SVG_MEETORSLICE_SLICE: number; + readonly SVG_MEETORSLICE_UNKNOWN: number; + readonly SVG_PRESERVEASPECTRATIO_NONE: number; + readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number; + readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number; +} + +interface SVGRadialGradientElement extends SVGGradientElement { + readonly cx: SVGAnimatedLength; + readonly cy: SVGAnimatedLength; + readonly fx: SVGAnimatedLength; + readonly fy: SVGAnimatedLength; + readonly r: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGRadialGradientElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGRadialGradientElement: { + prototype: SVGRadialGradientElement; + new(): SVGRadialGradientElement; +} + +interface SVGRect { + height: number; + width: number; + x: number; + y: number; +} + +declare var SVGRect: { + prototype: SVGRect; + new(): SVGRect; +} + +interface SVGRectElement extends SVGGraphicsElement { + readonly height: SVGAnimatedLength; + readonly rx: SVGAnimatedLength; + readonly ry: SVGAnimatedLength; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGRectElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGRectElement: { + prototype: SVGRectElement; + new(): SVGRectElement; +} + +interface SVGSVGElementEventMap extends SVGElementEventMap { + "SVGAbort": Event; + "SVGError": Event; + "resize": UIEvent; + "scroll": UIEvent; + "SVGUnload": Event; + "SVGZoom": SVGZoomEvent; +} + +interface SVGSVGElement extends SVGGraphicsElement, DocumentEvent, SVGFitToViewBox, SVGZoomAndPan { + contentScriptType: string; + contentStyleType: string; + currentScale: number; + readonly currentTranslate: SVGPoint; + readonly height: SVGAnimatedLength; + onabort: (this: SVGSVGElement, ev: Event) => any; + onerror: (this: SVGSVGElement, ev: Event) => any; + onresize: (this: SVGSVGElement, ev: UIEvent) => any; + onscroll: (this: SVGSVGElement, ev: UIEvent) => any; + onunload: (this: SVGSVGElement, ev: Event) => any; + onzoom: (this: SVGSVGElement, ev: SVGZoomEvent) => any; + readonly pixelUnitToMillimeterX: number; + readonly pixelUnitToMillimeterY: number; + readonly screenPixelToMillimeterX: number; + readonly screenPixelToMillimeterY: number; + readonly viewport: SVGRect; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + checkEnclosure(element: SVGElement, rect: SVGRect): boolean; + checkIntersection(element: SVGElement, rect: SVGRect): boolean; + createSVGAngle(): SVGAngle; + createSVGLength(): SVGLength; + createSVGMatrix(): SVGMatrix; + createSVGNumber(): SVGNumber; + createSVGPoint(): SVGPoint; + createSVGRect(): SVGRect; + createSVGTransform(): SVGTransform; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; + deselectAll(): void; + forceRedraw(): void; + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; + getCurrentTime(): number; + getElementById(elementId: string): Element; + getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeListOf; + getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeListOf; + pauseAnimations(): void; + setCurrentTime(seconds: number): void; + suspendRedraw(maxWaitMilliseconds: number): number; + unpauseAnimations(): void; + unsuspendRedraw(suspendHandleID: number): void; + unsuspendRedrawAll(): void; + addEventListener(type: K, listener: (this: SVGSVGElement, ev: SVGSVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSVGElement: { + prototype: SVGSVGElement; + new(): SVGSVGElement; +} + +interface SVGScriptElement extends SVGElement, SVGURIReference { + type: string; + addEventListener(type: K, listener: (this: SVGScriptElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGScriptElement: { + prototype: SVGScriptElement; + new(): SVGScriptElement; +} + +interface SVGStopElement extends SVGElement { + readonly offset: SVGAnimatedNumber; + addEventListener(type: K, listener: (this: SVGStopElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGStopElement: { + prototype: SVGStopElement; + new(): SVGStopElement; +} + +interface SVGStringList { + readonly numberOfItems: number; + appendItem(newItem: string): string; + clear(): void; + getItem(index: number): string; + initialize(newItem: string): string; + insertItemBefore(newItem: string, index: number): string; + removeItem(index: number): string; + replaceItem(newItem: string, index: number): string; +} + +declare var SVGStringList: { + prototype: SVGStringList; + new(): SVGStringList; +} + +interface SVGStyleElement extends SVGElement { + disabled: boolean; + media: string; + title: string; + type: string; + addEventListener(type: K, listener: (this: SVGStyleElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGStyleElement: { + prototype: SVGStyleElement; + new(): SVGStyleElement; +} + +interface SVGSwitchElement extends SVGGraphicsElement { + addEventListener(type: K, listener: (this: SVGSwitchElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSwitchElement: { + prototype: SVGSwitchElement; + new(): SVGSwitchElement; +} + +interface SVGSymbolElement extends SVGElement, SVGFitToViewBox { + addEventListener(type: K, listener: (this: SVGSymbolElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSymbolElement: { + prototype: SVGSymbolElement; + new(): SVGSymbolElement; +} + +interface SVGTSpanElement extends SVGTextPositioningElement { + addEventListener(type: K, listener: (this: SVGTSpanElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTSpanElement: { + prototype: SVGTSpanElement; + new(): SVGTSpanElement; +} + +interface SVGTextContentElement extends SVGGraphicsElement { + readonly lengthAdjust: SVGAnimatedEnumeration; + readonly textLength: SVGAnimatedLength; + getCharNumAtPosition(point: SVGPoint): number; + getComputedTextLength(): number; + getEndPositionOfChar(charnum: number): SVGPoint; + getExtentOfChar(charnum: number): SVGRect; + getNumberOfChars(): number; + getRotationOfChar(charnum: number): number; + getStartPositionOfChar(charnum: number): SVGPoint; + getSubStringLength(charnum: number, nchars: number): number; + selectSubString(charnum: number, nchars: number): void; + readonly LENGTHADJUST_SPACING: number; + readonly LENGTHADJUST_SPACINGANDGLYPHS: number; + readonly LENGTHADJUST_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGTextContentElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextContentElement: { + prototype: SVGTextContentElement; + new(): SVGTextContentElement; + readonly LENGTHADJUST_SPACING: number; + readonly LENGTHADJUST_SPACINGANDGLYPHS: number; + readonly LENGTHADJUST_UNKNOWN: number; +} + +interface SVGTextElement extends SVGTextPositioningElement { + addEventListener(type: K, listener: (this: SVGTextElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextElement: { + prototype: SVGTextElement; + new(): SVGTextElement; +} + +interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { + readonly method: SVGAnimatedEnumeration; + readonly spacing: SVGAnimatedEnumeration; + readonly startOffset: SVGAnimatedLength; + readonly TEXTPATH_METHODTYPE_ALIGN: number; + readonly TEXTPATH_METHODTYPE_STRETCH: number; + readonly TEXTPATH_METHODTYPE_UNKNOWN: number; + readonly TEXTPATH_SPACINGTYPE_AUTO: number; + readonly TEXTPATH_SPACINGTYPE_EXACT: number; + readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGTextPathElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextPathElement: { + prototype: SVGTextPathElement; + new(): SVGTextPathElement; + readonly TEXTPATH_METHODTYPE_ALIGN: number; + readonly TEXTPATH_METHODTYPE_STRETCH: number; + readonly TEXTPATH_METHODTYPE_UNKNOWN: number; + readonly TEXTPATH_SPACINGTYPE_AUTO: number; + readonly TEXTPATH_SPACINGTYPE_EXACT: number; + readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number; +} + +interface SVGTextPositioningElement extends SVGTextContentElement { + readonly dx: SVGAnimatedLengthList; + readonly dy: SVGAnimatedLengthList; + readonly rotate: SVGAnimatedNumberList; + readonly x: SVGAnimatedLengthList; + readonly y: SVGAnimatedLengthList; + addEventListener(type: K, listener: (this: SVGTextPositioningElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextPositioningElement: { + prototype: SVGTextPositioningElement; + new(): SVGTextPositioningElement; +} + +interface SVGTitleElement extends SVGElement { + addEventListener(type: K, listener: (this: SVGTitleElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTitleElement: { + prototype: SVGTitleElement; + new(): SVGTitleElement; +} + +interface SVGTransform { + readonly angle: number; + readonly matrix: SVGMatrix; + readonly type: number; + setMatrix(matrix: SVGMatrix): void; + setRotate(angle: number, cx: number, cy: number): void; + setScale(sx: number, sy: number): void; + setSkewX(angle: number): void; + setSkewY(angle: number): void; + setTranslate(tx: number, ty: number): void; + readonly SVG_TRANSFORM_MATRIX: number; + readonly SVG_TRANSFORM_ROTATE: number; + readonly SVG_TRANSFORM_SCALE: number; + readonly SVG_TRANSFORM_SKEWX: number; + readonly SVG_TRANSFORM_SKEWY: number; + readonly SVG_TRANSFORM_TRANSLATE: number; + readonly SVG_TRANSFORM_UNKNOWN: number; +} + +declare var SVGTransform: { + prototype: SVGTransform; + new(): SVGTransform; + readonly SVG_TRANSFORM_MATRIX: number; + readonly SVG_TRANSFORM_ROTATE: number; + readonly SVG_TRANSFORM_SCALE: number; + readonly SVG_TRANSFORM_SKEWX: number; + readonly SVG_TRANSFORM_SKEWY: number; + readonly SVG_TRANSFORM_TRANSLATE: number; + readonly SVG_TRANSFORM_UNKNOWN: number; +} + +interface SVGTransformList { + readonly numberOfItems: number; + appendItem(newItem: SVGTransform): SVGTransform; + clear(): void; + consolidate(): SVGTransform; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; + getItem(index: number): SVGTransform; + initialize(newItem: SVGTransform): SVGTransform; + insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; + removeItem(index: number): SVGTransform; + replaceItem(newItem: SVGTransform, index: number): SVGTransform; +} + +declare var SVGTransformList: { + prototype: SVGTransformList; + new(): SVGTransformList; +} + +interface SVGUnitTypes { + readonly SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; + readonly SVG_UNIT_TYPE_UNKNOWN: number; + readonly SVG_UNIT_TYPE_USERSPACEONUSE: number; +} +declare var SVGUnitTypes: SVGUnitTypes; + +interface SVGUseElement extends SVGGraphicsElement, SVGURIReference { + readonly animatedInstanceRoot: SVGElementInstance; + readonly height: SVGAnimatedLength; + readonly instanceRoot: SVGElementInstance; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGUseElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGUseElement: { + prototype: SVGUseElement; + new(): SVGUseElement; +} + +interface SVGViewElement extends SVGElement, SVGZoomAndPan, SVGFitToViewBox { + readonly viewTarget: SVGStringList; + addEventListener(type: K, listener: (this: SVGViewElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGViewElement: { + prototype: SVGViewElement; + new(): SVGViewElement; +} + +interface SVGZoomAndPan { + readonly zoomAndPan: number; +} + +declare var SVGZoomAndPan: { + readonly SVG_ZOOMANDPAN_DISABLE: number; + readonly SVG_ZOOMANDPAN_MAGNIFY: number; + readonly SVG_ZOOMANDPAN_UNKNOWN: number; +} + +interface SVGZoomEvent extends UIEvent { + readonly newScale: number; + readonly newTranslate: SVGPoint; + readonly previousScale: number; + readonly previousTranslate: SVGPoint; + readonly zoomRectScreen: SVGRect; +} + +declare var SVGZoomEvent: { + prototype: SVGZoomEvent; + new(): SVGZoomEvent; +} + +interface ScopedCredential { + readonly id: ArrayBuffer; + readonly type: ScopedCredentialType; +} + +declare var ScopedCredential: { + prototype: ScopedCredential; + new(): ScopedCredential; +} + +interface ScopedCredentialInfo { + readonly credential: ScopedCredential; + readonly publicKey: CryptoKey; +} + +declare var ScopedCredentialInfo: { + prototype: ScopedCredentialInfo; + new(): ScopedCredentialInfo; +} + +interface ScreenEventMap { + "MSOrientationChange": Event; +} + +interface Screen extends EventTarget { + readonly availHeight: number; + readonly availWidth: number; + bufferDepth: number; + readonly colorDepth: number; + readonly deviceXDPI: number; + readonly deviceYDPI: number; + readonly fontSmoothingEnabled: boolean; + readonly height: number; + readonly logicalXDPI: number; + readonly logicalYDPI: number; + readonly msOrientation: string; + onmsorientationchange: (this: Screen, ev: Event) => any; + readonly pixelDepth: number; + readonly systemXDPI: number; + readonly systemYDPI: number; + readonly width: number; + msLockOrientation(orientations: string | string[]): boolean; + msUnlockOrientation(): void; + addEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Screen: { + prototype: Screen; + new(): Screen; +} + +interface ScriptNotifyEvent extends Event { + readonly callingUri: string; + readonly value: string; +} + +declare var ScriptNotifyEvent: { + prototype: ScriptNotifyEvent; + new(): ScriptNotifyEvent; +} + +interface ScriptProcessorNodeEventMap { + "audioprocess": AudioProcessingEvent; +} + +interface ScriptProcessorNode extends AudioNode { + readonly bufferSize: number; + onaudioprocess: (this: ScriptProcessorNode, ev: AudioProcessingEvent) => any; + addEventListener(type: K, listener: (this: ScriptProcessorNode, ev: ScriptProcessorNodeEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ScriptProcessorNode: { + prototype: ScriptProcessorNode; + new(): ScriptProcessorNode; +} + +interface Selection { + readonly anchorNode: Node; + readonly anchorOffset: number; + readonly baseNode: Node; + readonly baseOffset: number; + readonly extentNode: Node; + readonly extentOffset: number; + readonly focusNode: Node; + readonly focusOffset: number; + readonly isCollapsed: boolean; + readonly rangeCount: number; + readonly type: string; + addRange(range: Range): void; + collapse(parentNode: Node, offset: number): void; + collapseToEnd(): void; + collapseToStart(): void; + containsNode(node: Node, partlyContained: boolean): boolean; + deleteFromDocument(): void; + empty(): void; + extend(newNode: Node, offset: number): void; + getRangeAt(index: number): Range; + removeAllRanges(): void; + removeRange(range: Range): void; + selectAllChildren(parentNode: Node): void; + setBaseAndExtent(baseNode: Node, baseOffset: number, extentNode: Node, extentOffset: number): void; + setPosition(parentNode: Node, offset: number): void; + toString(): string; +} + +declare var Selection: { + prototype: Selection; + new(): Selection; +} + +interface ServiceWorkerEventMap extends AbstractWorkerEventMap { + "statechange": Event; +} + +interface ServiceWorker extends EventTarget, AbstractWorker { + onstatechange: (this: ServiceWorker, ev: Event) => any; + readonly scriptURL: USVString; + readonly state: ServiceWorkerState; + postMessage(message: any, transfer?: any[]): void; + addEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ServiceWorker: { + prototype: ServiceWorker; + new(): ServiceWorker; +} + +interface ServiceWorkerContainerEventMap { + "controllerchange": Event; + "message": ServiceWorkerMessageEvent; +} + +interface ServiceWorkerContainer extends EventTarget { + readonly controller: ServiceWorker | null; + oncontrollerchange: (this: ServiceWorkerContainer, ev: Event) => any; + onmessage: (this: ServiceWorkerContainer, ev: ServiceWorkerMessageEvent) => any; + readonly ready: Promise; + getRegistration(clientURL?: USVString): Promise; + getRegistrations(): any; + register(scriptURL: USVString, options?: RegistrationOptions): Promise; + addEventListener(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ServiceWorkerContainer: { + prototype: ServiceWorkerContainer; + new(): ServiceWorkerContainer; +} + +interface ServiceWorkerMessageEvent extends Event { + readonly data: any; + readonly lastEventId: string; + readonly origin: string; + readonly ports: MessagePort[] | null; + readonly source: ServiceWorker | MessagePort | null; +} + +declare var ServiceWorkerMessageEvent: { + prototype: ServiceWorkerMessageEvent; + new(type: string, eventInitDict?: ServiceWorkerMessageEventInit): ServiceWorkerMessageEvent; +} + +interface ServiceWorkerRegistrationEventMap { + "updatefound": Event; +} + +interface ServiceWorkerRegistration extends EventTarget { + readonly active: ServiceWorker | null; + readonly installing: ServiceWorker | null; + onupdatefound: (this: ServiceWorkerRegistration, ev: Event) => any; + readonly pushManager: PushManager; + readonly scope: USVString; + readonly sync: SyncManager; + readonly waiting: ServiceWorker | null; + getNotifications(filter?: GetNotificationOptions): any; + showNotification(title: string, options?: NotificationOptions): Promise; + unregister(): Promise; + update(): Promise; + addEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ServiceWorkerRegistration: { + prototype: ServiceWorkerRegistration; + new(): ServiceWorkerRegistration; +} + +interface SourceBuffer extends EventTarget { + appendWindowEnd: number; + appendWindowStart: number; + readonly audioTracks: AudioTrackList; + readonly buffered: TimeRanges; + mode: AppendMode; + timestampOffset: number; + readonly updating: boolean; + readonly videoTracks: VideoTrackList; + abort(): void; + appendBuffer(data: ArrayBuffer | ArrayBufferView): void; + appendStream(stream: MSStream, maxSize?: number): void; + remove(start: number, end: number): void; +} + +declare var SourceBuffer: { + prototype: SourceBuffer; + new(): SourceBuffer; +} + +interface SourceBufferList extends EventTarget { + readonly length: number; + item(index: number): SourceBuffer; + [index: number]: SourceBuffer; +} + +declare var SourceBufferList: { + prototype: SourceBufferList; + new(): SourceBufferList; +} + +interface SpeechSynthesisEventMap { + "voiceschanged": Event; +} + +interface SpeechSynthesis extends EventTarget { + onvoiceschanged: (this: SpeechSynthesis, ev: Event) => any; + readonly paused: boolean; + readonly pending: boolean; + readonly speaking: boolean; + cancel(): void; + getVoices(): SpeechSynthesisVoice[]; + pause(): void; + resume(): void; + speak(utterance: SpeechSynthesisUtterance): void; + addEventListener(type: K, listener: (this: SpeechSynthesis, ev: SpeechSynthesisEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SpeechSynthesis: { + prototype: SpeechSynthesis; + new(): SpeechSynthesis; +} + +interface SpeechSynthesisEvent extends Event { + readonly charIndex: number; + readonly elapsedTime: number; + readonly name: string; + readonly utterance: SpeechSynthesisUtterance | null; +} + +declare var SpeechSynthesisEvent: { + prototype: SpeechSynthesisEvent; + new(type: string, eventInitDict?: SpeechSynthesisEventInit): SpeechSynthesisEvent; +} + +interface SpeechSynthesisUtteranceEventMap { + "boundary": Event; + "end": Event; + "error": Event; + "mark": Event; + "pause": Event; + "resume": Event; + "start": Event; +} + +interface SpeechSynthesisUtterance extends EventTarget { + lang: string; + onboundary: (this: SpeechSynthesisUtterance, ev: Event) => any; + onend: (this: SpeechSynthesisUtterance, ev: Event) => any; + onerror: (this: SpeechSynthesisUtterance, ev: Event) => any; + onmark: (this: SpeechSynthesisUtterance, ev: Event) => any; + onpause: (this: SpeechSynthesisUtterance, ev: Event) => any; + onresume: (this: SpeechSynthesisUtterance, ev: Event) => any; + onstart: (this: SpeechSynthesisUtterance, ev: Event) => any; + pitch: number; + rate: number; + text: string; + voice: SpeechSynthesisVoice; + volume: number; + addEventListener(type: K, listener: (this: SpeechSynthesisUtterance, ev: SpeechSynthesisUtteranceEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SpeechSynthesisUtterance: { + prototype: SpeechSynthesisUtterance; + new(text?: string): SpeechSynthesisUtterance; +} + +interface SpeechSynthesisVoice { + readonly default: boolean; + readonly lang: string; + readonly localService: boolean; + readonly name: string; + readonly voiceURI: string; +} + +declare var SpeechSynthesisVoice: { + prototype: SpeechSynthesisVoice; + new(): SpeechSynthesisVoice; +} + +interface StereoPannerNode extends AudioNode { + readonly pan: AudioParam; +} + +declare var StereoPannerNode: { + prototype: StereoPannerNode; + new(): StereoPannerNode; +} + +interface Storage { + readonly length: number; + clear(): void; + getItem(key: string): string | null; + key(index: number): string | null; + removeItem(key: string): void; + setItem(key: string, data: string): void; + [key: string]: any; + [index: number]: string; +} + +declare var Storage: { + prototype: Storage; + new(): Storage; +} + +interface StorageEvent extends Event { + readonly url: string; + key?: string; + oldValue?: string; + newValue?: string; + storageArea?: Storage; +} + +declare var StorageEvent: { + prototype: StorageEvent; + new (type: string, eventInitDict?: StorageEventInit): StorageEvent; +} + +interface StyleMedia { + readonly type: string; + matchMedium(mediaquery: string): boolean; +} + +declare var StyleMedia: { + prototype: StyleMedia; + new(): StyleMedia; +} + +interface StyleSheet { + disabled: boolean; + readonly href: string; + readonly media: MediaList; + readonly ownerNode: Node; + readonly parentStyleSheet: StyleSheet; + readonly title: string; + readonly type: string; +} + +declare var StyleSheet: { + prototype: StyleSheet; + new(): StyleSheet; +} + +interface StyleSheetList { + readonly length: number; + item(index?: number): StyleSheet; + [index: number]: StyleSheet; +} + +declare var StyleSheetList: { + prototype: StyleSheetList; + new(): StyleSheetList; +} + +interface StyleSheetPageList { + readonly length: number; + item(index: number): CSSPageRule; + [index: number]: CSSPageRule; +} + +declare var StyleSheetPageList: { + prototype: StyleSheetPageList; + new(): StyleSheetPageList; +} + +interface SubtleCrypto { + decrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): PromiseLike; + deriveBits(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, length: number): PromiseLike; + deriveKey(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike; + digest(algorithm: AlgorithmIdentifier, data: BufferSource): PromiseLike; + encrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): PromiseLike; + exportKey(format: "jwk", key: CryptoKey): PromiseLike; + exportKey(format: "raw" | "pkcs8" | "spki", key: CryptoKey): PromiseLike; + exportKey(format: string, key: CryptoKey): PromiseLike; + generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): PromiseLike; + generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: string[]): PromiseLike; + generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike; + importKey(format: "jwk", keyData: JsonWebKey, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike; + importKey(format: "raw" | "pkcs8" | "spki", keyData: BufferSource, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike; + importKey(format: string, keyData: JsonWebKey | BufferSource, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike; + sign(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, data: BufferSource): PromiseLike; + unwrapKey(format: string, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: string[]): PromiseLike; + verify(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, signature: BufferSource, data: BufferSource): PromiseLike; + wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier): PromiseLike; +} + +declare var SubtleCrypto: { + prototype: SubtleCrypto; + new(): SubtleCrypto; +} + +interface SyncManager { + getTags(): any; + register(tag: string): Promise; +} + +declare var SyncManager: { + prototype: SyncManager; + new(): SyncManager; +} + +interface Text extends CharacterData { + readonly wholeText: string; + readonly assignedSlot: HTMLSlotElement | null; + splitText(offset: number): Text; +} + +declare var Text: { + prototype: Text; + new(data?: string): Text; +} + +interface TextEvent extends UIEvent { + readonly data: string; + readonly inputMethod: number; + readonly locale: string; + initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; + readonly DOM_INPUT_METHOD_DROP: number; + readonly DOM_INPUT_METHOD_HANDWRITING: number; + readonly DOM_INPUT_METHOD_IME: number; + readonly DOM_INPUT_METHOD_KEYBOARD: number; + readonly DOM_INPUT_METHOD_MULTIMODAL: number; + readonly DOM_INPUT_METHOD_OPTION: number; + readonly DOM_INPUT_METHOD_PASTE: number; + readonly DOM_INPUT_METHOD_SCRIPT: number; + readonly DOM_INPUT_METHOD_UNKNOWN: number; + readonly DOM_INPUT_METHOD_VOICE: number; +} + +declare var TextEvent: { + prototype: TextEvent; + new(): TextEvent; + readonly DOM_INPUT_METHOD_DROP: number; + readonly DOM_INPUT_METHOD_HANDWRITING: number; + readonly DOM_INPUT_METHOD_IME: number; + readonly DOM_INPUT_METHOD_KEYBOARD: number; + readonly DOM_INPUT_METHOD_MULTIMODAL: number; + readonly DOM_INPUT_METHOD_OPTION: number; + readonly DOM_INPUT_METHOD_PASTE: number; + readonly DOM_INPUT_METHOD_SCRIPT: number; + readonly DOM_INPUT_METHOD_UNKNOWN: number; + readonly DOM_INPUT_METHOD_VOICE: number; +} + +interface TextMetrics { + readonly width: number; +} + +declare var TextMetrics: { + prototype: TextMetrics; + new(): TextMetrics; +} + +interface TextTrackEventMap { + "cuechange": Event; + "error": Event; + "load": Event; +} + +interface TextTrack extends EventTarget { + readonly activeCues: TextTrackCueList; + readonly cues: TextTrackCueList; + readonly inBandMetadataTrackDispatchType: string; + readonly kind: string; + readonly label: string; + readonly language: string; + mode: any; + oncuechange: (this: TextTrack, ev: Event) => any; + onerror: (this: TextTrack, ev: Event) => any; + onload: (this: TextTrack, ev: Event) => any; + readonly readyState: number; + addCue(cue: TextTrackCue): void; + removeCue(cue: TextTrackCue): void; + readonly DISABLED: number; + readonly ERROR: number; + readonly HIDDEN: number; + readonly LOADED: number; + readonly LOADING: number; + readonly NONE: number; + readonly SHOWING: number; + addEventListener(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var TextTrack: { + prototype: TextTrack; + new(): TextTrack; + readonly DISABLED: number; + readonly ERROR: number; + readonly HIDDEN: number; + readonly LOADED: number; + readonly LOADING: number; + readonly NONE: number; + readonly SHOWING: number; +} + +interface TextTrackCueEventMap { + "enter": Event; + "exit": Event; +} + +interface TextTrackCue extends EventTarget { + endTime: number; + id: string; + onenter: (this: TextTrackCue, ev: Event) => any; + onexit: (this: TextTrackCue, ev: Event) => any; + pauseOnExit: boolean; + startTime: number; + text: string; + readonly track: TextTrack; + getCueAsHTML(): DocumentFragment; + addEventListener(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var TextTrackCue: { + prototype: TextTrackCue; + new(startTime: number, endTime: number, text: string): TextTrackCue; +} + +interface TextTrackCueList { + readonly length: number; + getCueById(id: string): TextTrackCue; + item(index: number): TextTrackCue; + [index: number]: TextTrackCue; +} + +declare var TextTrackCueList: { + prototype: TextTrackCueList; + new(): TextTrackCueList; +} + +interface TextTrackListEventMap { + "addtrack": TrackEvent; +} + +interface TextTrackList extends EventTarget { + readonly length: number; + onaddtrack: ((this: TextTrackList, ev: TrackEvent) => any) | null; + item(index: number): TextTrack; + addEventListener(type: K, listener: (this: TextTrackList, ev: TextTrackListEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: TextTrack; +} + +declare var TextTrackList: { + prototype: TextTrackList; + new(): TextTrackList; +} + +interface TimeRanges { + readonly length: number; + end(index: number): number; + start(index: number): number; +} + +declare var TimeRanges: { + prototype: TimeRanges; + new(): TimeRanges; +} + +interface Touch { + readonly clientX: number; + readonly clientY: number; + readonly identifier: number; + readonly pageX: number; + readonly pageY: number; + readonly screenX: number; + readonly screenY: number; + readonly target: EventTarget; +} + +declare var Touch: { + prototype: Touch; + new(): Touch; +} + +interface TouchEvent extends UIEvent { + readonly altKey: boolean; + readonly changedTouches: TouchList; + readonly charCode: number; + readonly ctrlKey: boolean; + readonly keyCode: number; + readonly metaKey: boolean; + readonly shiftKey: boolean; + readonly targetTouches: TouchList; + readonly touches: TouchList; + readonly which: number; +} + +declare var TouchEvent: { + prototype: TouchEvent; + new(type: string, touchEventInit?: TouchEventInit): TouchEvent; +} + +interface TouchList { + readonly length: number; + item(index: number): Touch | null; + [index: number]: Touch; +} + +declare var TouchList: { + prototype: TouchList; + new(): TouchList; +} + +interface TrackEvent extends Event { + readonly track: VideoTrack | AudioTrack | TextTrack | null; +} + +declare var TrackEvent: { + prototype: TrackEvent; + new(typeArg: string, eventInitDict?: TrackEventInit): TrackEvent; +} + +interface TransitionEvent extends Event { + readonly elapsedTime: number; + readonly propertyName: string; + initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; +} + +declare var TransitionEvent: { + prototype: TransitionEvent; + new(typeArg: string, eventInitDict?: TransitionEventInit): TransitionEvent; +} + +interface TreeWalker { + currentNode: Node; + readonly expandEntityReferences: boolean; + readonly filter: NodeFilter; + readonly root: Node; + readonly whatToShow: number; + firstChild(): Node; + lastChild(): Node; + nextNode(): Node; + nextSibling(): Node; + parentNode(): Node; + previousNode(): Node; + previousSibling(): Node; +} + +declare var TreeWalker: { + prototype: TreeWalker; + new(): TreeWalker; +} + +interface UIEvent extends Event { + readonly detail: number; + readonly view: Window; + initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; +} + +declare var UIEvent: { + prototype: UIEvent; + new(typeArg: string, eventInitDict?: UIEventInit): UIEvent; +} + +interface URL { + hash: string; + host: string; + hostname: string; + href: string; + readonly origin: string; + password: string; + pathname: string; + port: string; + protocol: string; + search: string; + username: string; + readonly searchParams: URLSearchParams; + toString(): string; +} + +declare var URL: { + prototype: URL; + new(url: string, base?: string): URL; + createObjectURL(object: any, options?: ObjectURLOptions): string; + revokeObjectURL(url: string): void; +} + +interface UnviewableContentIdentifiedEvent extends NavigationEventWithReferrer { + readonly mediaType: string; +} + +declare var UnviewableContentIdentifiedEvent: { + prototype: UnviewableContentIdentifiedEvent; + new(): UnviewableContentIdentifiedEvent; +} + +interface ValidityState { + readonly badInput: boolean; + readonly customError: boolean; + readonly patternMismatch: boolean; + readonly rangeOverflow: boolean; + readonly rangeUnderflow: boolean; + readonly stepMismatch: boolean; + readonly tooLong: boolean; + readonly typeMismatch: boolean; + readonly valid: boolean; + readonly valueMissing: boolean; +} + +declare var ValidityState: { + prototype: ValidityState; + new(): ValidityState; +} + +interface VideoPlaybackQuality { + readonly corruptedVideoFrames: number; + readonly creationTime: number; + readonly droppedVideoFrames: number; + readonly totalFrameDelay: number; + readonly totalVideoFrames: number; +} + +declare var VideoPlaybackQuality: { + prototype: VideoPlaybackQuality; + new(): VideoPlaybackQuality; +} + +interface VideoTrack { + readonly id: string; + kind: string; + readonly label: string; + language: string; + selected: boolean; + readonly sourceBuffer: SourceBuffer; +} + +declare var VideoTrack: { + prototype: VideoTrack; + new(): VideoTrack; +} + +interface VideoTrackListEventMap { + "addtrack": TrackEvent; + "change": Event; + "removetrack": TrackEvent; +} + +interface VideoTrackList extends EventTarget { + readonly length: number; + onaddtrack: (this: VideoTrackList, ev: TrackEvent) => any; + onchange: (this: VideoTrackList, ev: Event) => any; + onremovetrack: (this: VideoTrackList, ev: TrackEvent) => any; + readonly selectedIndex: number; + getTrackById(id: string): VideoTrack | null; + item(index: number): VideoTrack; + addEventListener(type: K, listener: (this: VideoTrackList, ev: VideoTrackListEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: VideoTrack; +} + +declare var VideoTrackList: { + prototype: VideoTrackList; + new(): VideoTrackList; +} + +interface WEBGL_compressed_texture_s3tc { + readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number; + readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number; +} + +declare var WEBGL_compressed_texture_s3tc: { + prototype: WEBGL_compressed_texture_s3tc; + new(): WEBGL_compressed_texture_s3tc; + readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number; + readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number; +} + +interface WEBGL_debug_renderer_info { + readonly UNMASKED_RENDERER_WEBGL: number; + readonly UNMASKED_VENDOR_WEBGL: number; +} + +declare var WEBGL_debug_renderer_info: { + prototype: WEBGL_debug_renderer_info; + new(): WEBGL_debug_renderer_info; + readonly UNMASKED_RENDERER_WEBGL: number; + readonly UNMASKED_VENDOR_WEBGL: number; +} + +interface WEBGL_depth_texture { + readonly UNSIGNED_INT_24_8_WEBGL: number; +} + +declare var WEBGL_depth_texture: { + prototype: WEBGL_depth_texture; + new(): WEBGL_depth_texture; + readonly UNSIGNED_INT_24_8_WEBGL: number; +} + +interface WaveShaperNode extends AudioNode { + curve: Float32Array | null; + oversample: OverSampleType; +} + +declare var WaveShaperNode: { + prototype: WaveShaperNode; + new(): WaveShaperNode; +} + +interface WebAuthentication { + getAssertion(assertionChallenge: any, options?: AssertionOptions): Promise; + makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: any, options?: ScopedCredentialOptions): Promise; +} + +declare var WebAuthentication: { + prototype: WebAuthentication; + new(): WebAuthentication; +} + +interface WebAuthnAssertion { + readonly authenticatorData: ArrayBuffer; + readonly clientData: ArrayBuffer; + readonly credential: ScopedCredential; + readonly signature: ArrayBuffer; +} + +declare var WebAuthnAssertion: { + prototype: WebAuthnAssertion; + new(): WebAuthnAssertion; +} + +interface WebGLActiveInfo { + readonly name: string; + readonly size: number; + readonly type: number; +} + +declare var WebGLActiveInfo: { + prototype: WebGLActiveInfo; + new(): WebGLActiveInfo; +} + +interface WebGLBuffer extends WebGLObject { +} + +declare var WebGLBuffer: { + prototype: WebGLBuffer; + new(): WebGLBuffer; +} + +interface WebGLContextEvent extends Event { + readonly statusMessage: string; +} + +declare var WebGLContextEvent: { + prototype: WebGLContextEvent; + new(typeArg: string, eventInitDict?: WebGLContextEventInit): WebGLContextEvent; +} + +interface WebGLFramebuffer extends WebGLObject { +} + +declare var WebGLFramebuffer: { + prototype: WebGLFramebuffer; + new(): WebGLFramebuffer; +} + +interface WebGLObject { +} + +declare var WebGLObject: { + prototype: WebGLObject; + new(): WebGLObject; +} + +interface WebGLProgram extends WebGLObject { +} + +declare var WebGLProgram: { + prototype: WebGLProgram; + new(): WebGLProgram; +} + +interface WebGLRenderbuffer extends WebGLObject { +} + +declare var WebGLRenderbuffer: { + prototype: WebGLRenderbuffer; + new(): WebGLRenderbuffer; +} + +interface WebGLRenderingContext { + readonly canvas: HTMLCanvasElement; + readonly drawingBufferHeight: number; + readonly drawingBufferWidth: number; + activeTexture(texture: number): void; + attachShader(program: WebGLProgram | null, shader: WebGLShader | null): void; + bindAttribLocation(program: WebGLProgram | null, index: number, name: string): void; + bindBuffer(target: number, buffer: WebGLBuffer | null): void; + bindFramebuffer(target: number, framebuffer: WebGLFramebuffer | null): void; + bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer | null): void; + bindTexture(target: number, texture: WebGLTexture | null): void; + blendColor(red: number, green: number, blue: number, alpha: number): void; + blendEquation(mode: number): void; + blendEquationSeparate(modeRGB: number, modeAlpha: number): void; + blendFunc(sfactor: number, dfactor: number): void; + blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; + bufferData(target: number, size: number | ArrayBufferView | ArrayBuffer, usage: number): void; + bufferSubData(target: number, offset: number, data: ArrayBufferView | ArrayBuffer): void; + checkFramebufferStatus(target: number): number; + clear(mask: number): void; + clearColor(red: number, green: number, blue: number, alpha: number): void; + clearDepth(depth: number): void; + clearStencil(s: number): void; + colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; + compileShader(shader: WebGLShader | null): void; + compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; + compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; + copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; + copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; + createBuffer(): WebGLBuffer | null; + createFramebuffer(): WebGLFramebuffer | null; + createProgram(): WebGLProgram | null; + createRenderbuffer(): WebGLRenderbuffer | null; + createShader(type: number): WebGLShader | null; + createTexture(): WebGLTexture | null; + cullFace(mode: number): void; + deleteBuffer(buffer: WebGLBuffer | null): void; + deleteFramebuffer(framebuffer: WebGLFramebuffer | null): void; + deleteProgram(program: WebGLProgram | null): void; + deleteRenderbuffer(renderbuffer: WebGLRenderbuffer | null): void; + deleteShader(shader: WebGLShader | null): void; + deleteTexture(texture: WebGLTexture | null): void; + depthFunc(func: number): void; + depthMask(flag: boolean): void; + depthRange(zNear: number, zFar: number): void; + detachShader(program: WebGLProgram | null, shader: WebGLShader | null): void; + disable(cap: number): void; + disableVertexAttribArray(index: number): void; + drawArrays(mode: number, first: number, count: number): void; + drawElements(mode: number, count: number, type: number, offset: number): void; + enable(cap: number): void; + enableVertexAttribArray(index: number): void; + finish(): void; + flush(): void; + framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer | null): void; + framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture | null, level: number): void; + frontFace(mode: number): void; + generateMipmap(target: number): void; + getActiveAttrib(program: WebGLProgram | null, index: number): WebGLActiveInfo | null; + getActiveUniform(program: WebGLProgram | null, index: number): WebGLActiveInfo | null; + getAttachedShaders(program: WebGLProgram | null): WebGLShader[] | null; + getAttribLocation(program: WebGLProgram | null, name: string): number; + getBufferParameter(target: number, pname: number): any; + getContextAttributes(): WebGLContextAttributes; + getError(): number; + getExtension(name: string): any; + getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; + getParameter(pname: number): any; + getProgramInfoLog(program: WebGLProgram | null): string | null; + getProgramParameter(program: WebGLProgram | null, pname: number): any; + getRenderbufferParameter(target: number, pname: number): any; + getShaderInfoLog(shader: WebGLShader | null): string | null; + getShaderParameter(shader: WebGLShader | null, pname: number): any; + getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat | null; + getShaderSource(shader: WebGLShader | null): string | null; + getSupportedExtensions(): string[] | null; + getTexParameter(target: number, pname: number): any; + getUniform(program: WebGLProgram | null, location: WebGLUniformLocation | null): any; + getUniformLocation(program: WebGLProgram | null, name: string): WebGLUniformLocation | null; + getVertexAttrib(index: number, pname: number): any; + getVertexAttribOffset(index: number, pname: number): number; + hint(target: number, mode: number): void; + isBuffer(buffer: WebGLBuffer | null): boolean; + isContextLost(): boolean; + isEnabled(cap: number): boolean; + isFramebuffer(framebuffer: WebGLFramebuffer | null): boolean; + isProgram(program: WebGLProgram | null): boolean; + isRenderbuffer(renderbuffer: WebGLRenderbuffer | null): boolean; + isShader(shader: WebGLShader | null): boolean; + isTexture(texture: WebGLTexture | null): boolean; + lineWidth(width: number): void; + linkProgram(program: WebGLProgram | null): void; + pixelStorei(pname: number, param: number | boolean): void; + polygonOffset(factor: number, units: number): void; + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void; + renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; + sampleCoverage(value: number, invert: boolean): void; + scissor(x: number, y: number, width: number, height: number): void; + shaderSource(shader: WebGLShader | null, source: string): void; + stencilFunc(func: number, ref: number, mask: number): void; + stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; + stencilMask(mask: number): void; + stencilMaskSeparate(face: number, mask: number): void; + stencilOp(fail: number, zfail: number, zpass: number): void; + stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; + texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView | null): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void; + texParameterf(target: number, pname: number, param: number): void; + texParameteri(target: number, pname: number, param: number): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void; + uniform1f(location: WebGLUniformLocation | null, x: number): void; + uniform1fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform1i(location: WebGLUniformLocation | null, x: number): void; + uniform1iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform2f(location: WebGLUniformLocation | null, x: number, y: number): void; + uniform2fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform2i(location: WebGLUniformLocation | null, x: number, y: number): void; + uniform2iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform3f(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; + uniform3fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform3i(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; + uniform3iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform4f(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; + uniform4fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform4i(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; + uniform4iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; + uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; + uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; + useProgram(program: WebGLProgram | null): void; + validateProgram(program: WebGLProgram | null): void; + vertexAttrib1f(indx: number, x: number): void; + vertexAttrib1fv(indx: number, values: Float32Array | number[]): void; + vertexAttrib2f(indx: number, x: number, y: number): void; + vertexAttrib2fv(indx: number, values: Float32Array | number[]): void; + vertexAttrib3f(indx: number, x: number, y: number, z: number): void; + vertexAttrib3fv(indx: number, values: Float32Array | number[]): void; + vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; + vertexAttrib4fv(indx: number, values: Float32Array | number[]): void; + vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; + viewport(x: number, y: number, width: number, height: number): void; + readonly ACTIVE_ATTRIBUTES: number; + readonly ACTIVE_TEXTURE: number; + readonly ACTIVE_UNIFORMS: number; + readonly ALIASED_LINE_WIDTH_RANGE: number; + readonly ALIASED_POINT_SIZE_RANGE: number; + readonly ALPHA: number; + readonly ALPHA_BITS: number; + readonly ALWAYS: number; + readonly ARRAY_BUFFER: number; + readonly ARRAY_BUFFER_BINDING: number; + readonly ATTACHED_SHADERS: number; + readonly BACK: number; + readonly BLEND: number; + readonly BLEND_COLOR: number; + readonly BLEND_DST_ALPHA: number; + readonly BLEND_DST_RGB: number; + readonly BLEND_EQUATION: number; + readonly BLEND_EQUATION_ALPHA: number; + readonly BLEND_EQUATION_RGB: number; + readonly BLEND_SRC_ALPHA: number; + readonly BLEND_SRC_RGB: number; + readonly BLUE_BITS: number; + readonly BOOL: number; + readonly BOOL_VEC2: number; + readonly BOOL_VEC3: number; + readonly BOOL_VEC4: number; + readonly BROWSER_DEFAULT_WEBGL: number; + readonly BUFFER_SIZE: number; + readonly BUFFER_USAGE: number; + readonly BYTE: number; + readonly CCW: number; + readonly CLAMP_TO_EDGE: number; + readonly COLOR_ATTACHMENT0: number; + readonly COLOR_BUFFER_BIT: number; + readonly COLOR_CLEAR_VALUE: number; + readonly COLOR_WRITEMASK: number; + readonly COMPILE_STATUS: number; + readonly COMPRESSED_TEXTURE_FORMATS: number; + readonly CONSTANT_ALPHA: number; + readonly CONSTANT_COLOR: number; + readonly CONTEXT_LOST_WEBGL: number; + readonly CULL_FACE: number; + readonly CULL_FACE_MODE: number; + readonly CURRENT_PROGRAM: number; + readonly CURRENT_VERTEX_ATTRIB: number; + readonly CW: number; + readonly DECR: number; + readonly DECR_WRAP: number; + readonly DELETE_STATUS: number; + readonly DEPTH_ATTACHMENT: number; + readonly DEPTH_BITS: number; + readonly DEPTH_BUFFER_BIT: number; + readonly DEPTH_CLEAR_VALUE: number; + readonly DEPTH_COMPONENT: number; + readonly DEPTH_COMPONENT16: number; + readonly DEPTH_FUNC: number; + readonly DEPTH_RANGE: number; + readonly DEPTH_STENCIL: number; + readonly DEPTH_STENCIL_ATTACHMENT: number; + readonly DEPTH_TEST: number; + readonly DEPTH_WRITEMASK: number; + readonly DITHER: number; + readonly DONT_CARE: number; + readonly DST_ALPHA: number; + readonly DST_COLOR: number; + readonly DYNAMIC_DRAW: number; + readonly ELEMENT_ARRAY_BUFFER: number; + readonly ELEMENT_ARRAY_BUFFER_BINDING: number; + readonly EQUAL: number; + readonly FASTEST: number; + readonly FLOAT: number; + readonly FLOAT_MAT2: number; + readonly FLOAT_MAT3: number; + readonly FLOAT_MAT4: number; + readonly FLOAT_VEC2: number; + readonly FLOAT_VEC3: number; + readonly FLOAT_VEC4: number; + readonly FRAGMENT_SHADER: number; + readonly FRAMEBUFFER: number; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + readonly FRAMEBUFFER_BINDING: number; + readonly FRAMEBUFFER_COMPLETE: number; + readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + readonly FRAMEBUFFER_UNSUPPORTED: number; + readonly FRONT: number; + readonly FRONT_AND_BACK: number; + readonly FRONT_FACE: number; + readonly FUNC_ADD: number; + readonly FUNC_REVERSE_SUBTRACT: number; + readonly FUNC_SUBTRACT: number; + readonly GENERATE_MIPMAP_HINT: number; + readonly GEQUAL: number; + readonly GREATER: number; + readonly GREEN_BITS: number; + readonly HIGH_FLOAT: number; + readonly HIGH_INT: number; + readonly IMPLEMENTATION_COLOR_READ_FORMAT: number; + readonly IMPLEMENTATION_COLOR_READ_TYPE: number; + readonly INCR: number; + readonly INCR_WRAP: number; + readonly INT: number; + readonly INT_VEC2: number; + readonly INT_VEC3: number; + readonly INT_VEC4: number; + readonly INVALID_ENUM: number; + readonly INVALID_FRAMEBUFFER_OPERATION: number; + readonly INVALID_OPERATION: number; + readonly INVALID_VALUE: number; + readonly INVERT: number; + readonly KEEP: number; + readonly LEQUAL: number; + readonly LESS: number; + readonly LINEAR: number; + readonly LINEAR_MIPMAP_LINEAR: number; + readonly LINEAR_MIPMAP_NEAREST: number; + readonly LINES: number; + readonly LINE_LOOP: number; + readonly LINE_STRIP: number; + readonly LINE_WIDTH: number; + readonly LINK_STATUS: number; + readonly LOW_FLOAT: number; + readonly LOW_INT: number; + readonly LUMINANCE: number; + readonly LUMINANCE_ALPHA: number; + readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + readonly MAX_CUBE_MAP_TEXTURE_SIZE: number; + readonly MAX_FRAGMENT_UNIFORM_VECTORS: number; + readonly MAX_RENDERBUFFER_SIZE: number; + readonly MAX_TEXTURE_IMAGE_UNITS: number; + readonly MAX_TEXTURE_SIZE: number; + readonly MAX_VARYING_VECTORS: number; + readonly MAX_VERTEX_ATTRIBS: number; + readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + readonly MAX_VERTEX_UNIFORM_VECTORS: number; + readonly MAX_VIEWPORT_DIMS: number; + readonly MEDIUM_FLOAT: number; + readonly MEDIUM_INT: number; + readonly MIRRORED_REPEAT: number; + readonly NEAREST: number; + readonly NEAREST_MIPMAP_LINEAR: number; + readonly NEAREST_MIPMAP_NEAREST: number; + readonly NEVER: number; + readonly NICEST: number; + readonly NONE: number; + readonly NOTEQUAL: number; + readonly NO_ERROR: number; + readonly ONE: number; + readonly ONE_MINUS_CONSTANT_ALPHA: number; + readonly ONE_MINUS_CONSTANT_COLOR: number; + readonly ONE_MINUS_DST_ALPHA: number; + readonly ONE_MINUS_DST_COLOR: number; + readonly ONE_MINUS_SRC_ALPHA: number; + readonly ONE_MINUS_SRC_COLOR: number; + readonly OUT_OF_MEMORY: number; + readonly PACK_ALIGNMENT: number; + readonly POINTS: number; + readonly POLYGON_OFFSET_FACTOR: number; + readonly POLYGON_OFFSET_FILL: number; + readonly POLYGON_OFFSET_UNITS: number; + readonly RED_BITS: number; + readonly RENDERBUFFER: number; + readonly RENDERBUFFER_ALPHA_SIZE: number; + readonly RENDERBUFFER_BINDING: number; + readonly RENDERBUFFER_BLUE_SIZE: number; + readonly RENDERBUFFER_DEPTH_SIZE: number; + readonly RENDERBUFFER_GREEN_SIZE: number; + readonly RENDERBUFFER_HEIGHT: number; + readonly RENDERBUFFER_INTERNAL_FORMAT: number; + readonly RENDERBUFFER_RED_SIZE: number; + readonly RENDERBUFFER_STENCIL_SIZE: number; + readonly RENDERBUFFER_WIDTH: number; + readonly RENDERER: number; + readonly REPEAT: number; + readonly REPLACE: number; + readonly RGB: number; + readonly RGB565: number; + readonly RGB5_A1: number; + readonly RGBA: number; + readonly RGBA4: number; + readonly SAMPLER_2D: number; + readonly SAMPLER_CUBE: number; + readonly SAMPLES: number; + readonly SAMPLE_ALPHA_TO_COVERAGE: number; + readonly SAMPLE_BUFFERS: number; + readonly SAMPLE_COVERAGE: number; + readonly SAMPLE_COVERAGE_INVERT: number; + readonly SAMPLE_COVERAGE_VALUE: number; + readonly SCISSOR_BOX: number; + readonly SCISSOR_TEST: number; + readonly SHADER_TYPE: number; + readonly SHADING_LANGUAGE_VERSION: number; + readonly SHORT: number; + readonly SRC_ALPHA: number; + readonly SRC_ALPHA_SATURATE: number; + readonly SRC_COLOR: number; + readonly STATIC_DRAW: number; + readonly STENCIL_ATTACHMENT: number; + readonly STENCIL_BACK_FAIL: number; + readonly STENCIL_BACK_FUNC: number; + readonly STENCIL_BACK_PASS_DEPTH_FAIL: number; + readonly STENCIL_BACK_PASS_DEPTH_PASS: number; + readonly STENCIL_BACK_REF: number; + readonly STENCIL_BACK_VALUE_MASK: number; + readonly STENCIL_BACK_WRITEMASK: number; + readonly STENCIL_BITS: number; + readonly STENCIL_BUFFER_BIT: number; + readonly STENCIL_CLEAR_VALUE: number; + readonly STENCIL_FAIL: number; + readonly STENCIL_FUNC: number; + readonly STENCIL_INDEX: number; + readonly STENCIL_INDEX8: number; + readonly STENCIL_PASS_DEPTH_FAIL: number; + readonly STENCIL_PASS_DEPTH_PASS: number; + readonly STENCIL_REF: number; + readonly STENCIL_TEST: number; + readonly STENCIL_VALUE_MASK: number; + readonly STENCIL_WRITEMASK: number; + readonly STREAM_DRAW: number; + readonly SUBPIXEL_BITS: number; + readonly TEXTURE: number; + readonly TEXTURE0: number; + readonly TEXTURE1: number; + readonly TEXTURE10: number; + readonly TEXTURE11: number; + readonly TEXTURE12: number; + readonly TEXTURE13: number; + readonly TEXTURE14: number; + readonly TEXTURE15: number; + readonly TEXTURE16: number; + readonly TEXTURE17: number; + readonly TEXTURE18: number; + readonly TEXTURE19: number; + readonly TEXTURE2: number; + readonly TEXTURE20: number; + readonly TEXTURE21: number; + readonly TEXTURE22: number; + readonly TEXTURE23: number; + readonly TEXTURE24: number; + readonly TEXTURE25: number; + readonly TEXTURE26: number; + readonly TEXTURE27: number; + readonly TEXTURE28: number; + readonly TEXTURE29: number; + readonly TEXTURE3: number; + readonly TEXTURE30: number; + readonly TEXTURE31: number; + readonly TEXTURE4: number; + readonly TEXTURE5: number; + readonly TEXTURE6: number; + readonly TEXTURE7: number; + readonly TEXTURE8: number; + readonly TEXTURE9: number; + readonly TEXTURE_2D: number; + readonly TEXTURE_BINDING_2D: number; + readonly TEXTURE_BINDING_CUBE_MAP: number; + readonly TEXTURE_CUBE_MAP: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_X: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number; + readonly TEXTURE_MAG_FILTER: number; + readonly TEXTURE_MIN_FILTER: number; + readonly TEXTURE_WRAP_S: number; + readonly TEXTURE_WRAP_T: number; + readonly TRIANGLES: number; + readonly TRIANGLE_FAN: number; + readonly TRIANGLE_STRIP: number; + readonly UNPACK_ALIGNMENT: number; + readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + readonly UNPACK_FLIP_Y_WEBGL: number; + readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + readonly UNSIGNED_BYTE: number; + readonly UNSIGNED_INT: number; + readonly UNSIGNED_SHORT: number; + readonly UNSIGNED_SHORT_4_4_4_4: number; + readonly UNSIGNED_SHORT_5_5_5_1: number; + readonly UNSIGNED_SHORT_5_6_5: number; + readonly VALIDATE_STATUS: number; + readonly VENDOR: number; + readonly VERSION: number; + readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + readonly VERTEX_ATTRIB_ARRAY_ENABLED: number; + readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + readonly VERTEX_ATTRIB_ARRAY_POINTER: number; + readonly VERTEX_ATTRIB_ARRAY_SIZE: number; + readonly VERTEX_ATTRIB_ARRAY_STRIDE: number; + readonly VERTEX_ATTRIB_ARRAY_TYPE: number; + readonly VERTEX_SHADER: number; + readonly VIEWPORT: number; + readonly ZERO: number; +} + +declare var WebGLRenderingContext: { + prototype: WebGLRenderingContext; + new(): WebGLRenderingContext; + readonly ACTIVE_ATTRIBUTES: number; + readonly ACTIVE_TEXTURE: number; + readonly ACTIVE_UNIFORMS: number; + readonly ALIASED_LINE_WIDTH_RANGE: number; + readonly ALIASED_POINT_SIZE_RANGE: number; + readonly ALPHA: number; + readonly ALPHA_BITS: number; + readonly ALWAYS: number; + readonly ARRAY_BUFFER: number; + readonly ARRAY_BUFFER_BINDING: number; + readonly ATTACHED_SHADERS: number; + readonly BACK: number; + readonly BLEND: number; + readonly BLEND_COLOR: number; + readonly BLEND_DST_ALPHA: number; + readonly BLEND_DST_RGB: number; + readonly BLEND_EQUATION: number; + readonly BLEND_EQUATION_ALPHA: number; + readonly BLEND_EQUATION_RGB: number; + readonly BLEND_SRC_ALPHA: number; + readonly BLEND_SRC_RGB: number; + readonly BLUE_BITS: number; + readonly BOOL: number; + readonly BOOL_VEC2: number; + readonly BOOL_VEC3: number; + readonly BOOL_VEC4: number; + readonly BROWSER_DEFAULT_WEBGL: number; + readonly BUFFER_SIZE: number; + readonly BUFFER_USAGE: number; + readonly BYTE: number; + readonly CCW: number; + readonly CLAMP_TO_EDGE: number; + readonly COLOR_ATTACHMENT0: number; + readonly COLOR_BUFFER_BIT: number; + readonly COLOR_CLEAR_VALUE: number; + readonly COLOR_WRITEMASK: number; + readonly COMPILE_STATUS: number; + readonly COMPRESSED_TEXTURE_FORMATS: number; + readonly CONSTANT_ALPHA: number; + readonly CONSTANT_COLOR: number; + readonly CONTEXT_LOST_WEBGL: number; + readonly CULL_FACE: number; + readonly CULL_FACE_MODE: number; + readonly CURRENT_PROGRAM: number; + readonly CURRENT_VERTEX_ATTRIB: number; + readonly CW: number; + readonly DECR: number; + readonly DECR_WRAP: number; + readonly DELETE_STATUS: number; + readonly DEPTH_ATTACHMENT: number; + readonly DEPTH_BITS: number; + readonly DEPTH_BUFFER_BIT: number; + readonly DEPTH_CLEAR_VALUE: number; + readonly DEPTH_COMPONENT: number; + readonly DEPTH_COMPONENT16: number; + readonly DEPTH_FUNC: number; + readonly DEPTH_RANGE: number; + readonly DEPTH_STENCIL: number; + readonly DEPTH_STENCIL_ATTACHMENT: number; + readonly DEPTH_TEST: number; + readonly DEPTH_WRITEMASK: number; + readonly DITHER: number; + readonly DONT_CARE: number; + readonly DST_ALPHA: number; + readonly DST_COLOR: number; + readonly DYNAMIC_DRAW: number; + readonly ELEMENT_ARRAY_BUFFER: number; + readonly ELEMENT_ARRAY_BUFFER_BINDING: number; + readonly EQUAL: number; + readonly FASTEST: number; + readonly FLOAT: number; + readonly FLOAT_MAT2: number; + readonly FLOAT_MAT3: number; + readonly FLOAT_MAT4: number; + readonly FLOAT_VEC2: number; + readonly FLOAT_VEC3: number; + readonly FLOAT_VEC4: number; + readonly FRAGMENT_SHADER: number; + readonly FRAMEBUFFER: number; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + readonly FRAMEBUFFER_BINDING: number; + readonly FRAMEBUFFER_COMPLETE: number; + readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + readonly FRAMEBUFFER_UNSUPPORTED: number; + readonly FRONT: number; + readonly FRONT_AND_BACK: number; + readonly FRONT_FACE: number; + readonly FUNC_ADD: number; + readonly FUNC_REVERSE_SUBTRACT: number; + readonly FUNC_SUBTRACT: number; + readonly GENERATE_MIPMAP_HINT: number; + readonly GEQUAL: number; + readonly GREATER: number; + readonly GREEN_BITS: number; + readonly HIGH_FLOAT: number; + readonly HIGH_INT: number; + readonly IMPLEMENTATION_COLOR_READ_FORMAT: number; + readonly IMPLEMENTATION_COLOR_READ_TYPE: number; + readonly INCR: number; + readonly INCR_WRAP: number; + readonly INT: number; + readonly INT_VEC2: number; + readonly INT_VEC3: number; + readonly INT_VEC4: number; + readonly INVALID_ENUM: number; + readonly INVALID_FRAMEBUFFER_OPERATION: number; + readonly INVALID_OPERATION: number; + readonly INVALID_VALUE: number; + readonly INVERT: number; + readonly KEEP: number; + readonly LEQUAL: number; + readonly LESS: number; + readonly LINEAR: number; + readonly LINEAR_MIPMAP_LINEAR: number; + readonly LINEAR_MIPMAP_NEAREST: number; + readonly LINES: number; + readonly LINE_LOOP: number; + readonly LINE_STRIP: number; + readonly LINE_WIDTH: number; + readonly LINK_STATUS: number; + readonly LOW_FLOAT: number; + readonly LOW_INT: number; + readonly LUMINANCE: number; + readonly LUMINANCE_ALPHA: number; + readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + readonly MAX_CUBE_MAP_TEXTURE_SIZE: number; + readonly MAX_FRAGMENT_UNIFORM_VECTORS: number; + readonly MAX_RENDERBUFFER_SIZE: number; + readonly MAX_TEXTURE_IMAGE_UNITS: number; + readonly MAX_TEXTURE_SIZE: number; + readonly MAX_VARYING_VECTORS: number; + readonly MAX_VERTEX_ATTRIBS: number; + readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + readonly MAX_VERTEX_UNIFORM_VECTORS: number; + readonly MAX_VIEWPORT_DIMS: number; + readonly MEDIUM_FLOAT: number; + readonly MEDIUM_INT: number; + readonly MIRRORED_REPEAT: number; + readonly NEAREST: number; + readonly NEAREST_MIPMAP_LINEAR: number; + readonly NEAREST_MIPMAP_NEAREST: number; + readonly NEVER: number; + readonly NICEST: number; + readonly NONE: number; + readonly NOTEQUAL: number; + readonly NO_ERROR: number; + readonly ONE: number; + readonly ONE_MINUS_CONSTANT_ALPHA: number; + readonly ONE_MINUS_CONSTANT_COLOR: number; + readonly ONE_MINUS_DST_ALPHA: number; + readonly ONE_MINUS_DST_COLOR: number; + readonly ONE_MINUS_SRC_ALPHA: number; + readonly ONE_MINUS_SRC_COLOR: number; + readonly OUT_OF_MEMORY: number; + readonly PACK_ALIGNMENT: number; + readonly POINTS: number; + readonly POLYGON_OFFSET_FACTOR: number; + readonly POLYGON_OFFSET_FILL: number; + readonly POLYGON_OFFSET_UNITS: number; + readonly RED_BITS: number; + readonly RENDERBUFFER: number; + readonly RENDERBUFFER_ALPHA_SIZE: number; + readonly RENDERBUFFER_BINDING: number; + readonly RENDERBUFFER_BLUE_SIZE: number; + readonly RENDERBUFFER_DEPTH_SIZE: number; + readonly RENDERBUFFER_GREEN_SIZE: number; + readonly RENDERBUFFER_HEIGHT: number; + readonly RENDERBUFFER_INTERNAL_FORMAT: number; + readonly RENDERBUFFER_RED_SIZE: number; + readonly RENDERBUFFER_STENCIL_SIZE: number; + readonly RENDERBUFFER_WIDTH: number; + readonly RENDERER: number; + readonly REPEAT: number; + readonly REPLACE: number; + readonly RGB: number; + readonly RGB565: number; + readonly RGB5_A1: number; + readonly RGBA: number; + readonly RGBA4: number; + readonly SAMPLER_2D: number; + readonly SAMPLER_CUBE: number; + readonly SAMPLES: number; + readonly SAMPLE_ALPHA_TO_COVERAGE: number; + readonly SAMPLE_BUFFERS: number; + readonly SAMPLE_COVERAGE: number; + readonly SAMPLE_COVERAGE_INVERT: number; + readonly SAMPLE_COVERAGE_VALUE: number; + readonly SCISSOR_BOX: number; + readonly SCISSOR_TEST: number; + readonly SHADER_TYPE: number; + readonly SHADING_LANGUAGE_VERSION: number; + readonly SHORT: number; + readonly SRC_ALPHA: number; + readonly SRC_ALPHA_SATURATE: number; + readonly SRC_COLOR: number; + readonly STATIC_DRAW: number; + readonly STENCIL_ATTACHMENT: number; + readonly STENCIL_BACK_FAIL: number; + readonly STENCIL_BACK_FUNC: number; + readonly STENCIL_BACK_PASS_DEPTH_FAIL: number; + readonly STENCIL_BACK_PASS_DEPTH_PASS: number; + readonly STENCIL_BACK_REF: number; + readonly STENCIL_BACK_VALUE_MASK: number; + readonly STENCIL_BACK_WRITEMASK: number; + readonly STENCIL_BITS: number; + readonly STENCIL_BUFFER_BIT: number; + readonly STENCIL_CLEAR_VALUE: number; + readonly STENCIL_FAIL: number; + readonly STENCIL_FUNC: number; + readonly STENCIL_INDEX: number; + readonly STENCIL_INDEX8: number; + readonly STENCIL_PASS_DEPTH_FAIL: number; + readonly STENCIL_PASS_DEPTH_PASS: number; + readonly STENCIL_REF: number; + readonly STENCIL_TEST: number; + readonly STENCIL_VALUE_MASK: number; + readonly STENCIL_WRITEMASK: number; + readonly STREAM_DRAW: number; + readonly SUBPIXEL_BITS: number; + readonly TEXTURE: number; + readonly TEXTURE0: number; + readonly TEXTURE1: number; + readonly TEXTURE10: number; + readonly TEXTURE11: number; + readonly TEXTURE12: number; + readonly TEXTURE13: number; + readonly TEXTURE14: number; + readonly TEXTURE15: number; + readonly TEXTURE16: number; + readonly TEXTURE17: number; + readonly TEXTURE18: number; + readonly TEXTURE19: number; + readonly TEXTURE2: number; + readonly TEXTURE20: number; + readonly TEXTURE21: number; + readonly TEXTURE22: number; + readonly TEXTURE23: number; + readonly TEXTURE24: number; + readonly TEXTURE25: number; + readonly TEXTURE26: number; + readonly TEXTURE27: number; + readonly TEXTURE28: number; + readonly TEXTURE29: number; + readonly TEXTURE3: number; + readonly TEXTURE30: number; + readonly TEXTURE31: number; + readonly TEXTURE4: number; + readonly TEXTURE5: number; + readonly TEXTURE6: number; + readonly TEXTURE7: number; + readonly TEXTURE8: number; + readonly TEXTURE9: number; + readonly TEXTURE_2D: number; + readonly TEXTURE_BINDING_2D: number; + readonly TEXTURE_BINDING_CUBE_MAP: number; + readonly TEXTURE_CUBE_MAP: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_X: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number; + readonly TEXTURE_MAG_FILTER: number; + readonly TEXTURE_MIN_FILTER: number; + readonly TEXTURE_WRAP_S: number; + readonly TEXTURE_WRAP_T: number; + readonly TRIANGLES: number; + readonly TRIANGLE_FAN: number; + readonly TRIANGLE_STRIP: number; + readonly UNPACK_ALIGNMENT: number; + readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + readonly UNPACK_FLIP_Y_WEBGL: number; + readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + readonly UNSIGNED_BYTE: number; + readonly UNSIGNED_INT: number; + readonly UNSIGNED_SHORT: number; + readonly UNSIGNED_SHORT_4_4_4_4: number; + readonly UNSIGNED_SHORT_5_5_5_1: number; + readonly UNSIGNED_SHORT_5_6_5: number; + readonly VALIDATE_STATUS: number; + readonly VENDOR: number; + readonly VERSION: number; + readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + readonly VERTEX_ATTRIB_ARRAY_ENABLED: number; + readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + readonly VERTEX_ATTRIB_ARRAY_POINTER: number; + readonly VERTEX_ATTRIB_ARRAY_SIZE: number; + readonly VERTEX_ATTRIB_ARRAY_STRIDE: number; + readonly VERTEX_ATTRIB_ARRAY_TYPE: number; + readonly VERTEX_SHADER: number; + readonly VIEWPORT: number; + readonly ZERO: number; +} + +interface WebGLShader extends WebGLObject { +} + +declare var WebGLShader: { + prototype: WebGLShader; + new(): WebGLShader; +} + +interface WebGLShaderPrecisionFormat { + readonly precision: number; + readonly rangeMax: number; + readonly rangeMin: number; +} + +declare var WebGLShaderPrecisionFormat: { + prototype: WebGLShaderPrecisionFormat; + new(): WebGLShaderPrecisionFormat; +} + +interface WebGLTexture extends WebGLObject { +} + +declare var WebGLTexture: { + prototype: WebGLTexture; + new(): WebGLTexture; +} + +interface WebGLUniformLocation { +} + +declare var WebGLUniformLocation: { + prototype: WebGLUniformLocation; + new(): WebGLUniformLocation; +} + +interface WebKitCSSMatrix { + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + m11: number; + m12: number; + m13: number; + m14: number; + m21: number; + m22: number; + m23: number; + m24: number; + m31: number; + m32: number; + m33: number; + m34: number; + m41: number; + m42: number; + m43: number; + m44: number; + inverse(): WebKitCSSMatrix; + multiply(secondMatrix: WebKitCSSMatrix): WebKitCSSMatrix; + rotate(angleX: number, angleY?: number, angleZ?: number): WebKitCSSMatrix; + rotateAxisAngle(x: number, y: number, z: number, angle: number): WebKitCSSMatrix; + scale(scaleX: number, scaleY?: number, scaleZ?: number): WebKitCSSMatrix; + setMatrixValue(value: string): void; + skewX(angle: number): WebKitCSSMatrix; + skewY(angle: number): WebKitCSSMatrix; + toString(): string; + translate(x: number, y: number, z?: number): WebKitCSSMatrix; +} + +declare var WebKitCSSMatrix: { + prototype: WebKitCSSMatrix; + new(text?: string): WebKitCSSMatrix; +} + +interface WebKitDirectoryEntry extends WebKitEntry { + createReader(): WebKitDirectoryReader; +} + +declare var WebKitDirectoryEntry: { + prototype: WebKitDirectoryEntry; + new(): WebKitDirectoryEntry; +} + +interface WebKitDirectoryReader { + readEntries(successCallback: WebKitEntriesCallback, errorCallback?: WebKitErrorCallback): void; +} + +declare var WebKitDirectoryReader: { + prototype: WebKitDirectoryReader; + new(): WebKitDirectoryReader; +} + +interface WebKitEntry { + readonly filesystem: WebKitFileSystem; + readonly fullPath: string; + readonly isDirectory: boolean; + readonly isFile: boolean; + readonly name: string; +} + +declare var WebKitEntry: { + prototype: WebKitEntry; + new(): WebKitEntry; +} + +interface WebKitFileEntry extends WebKitEntry { + file(successCallback: WebKitFileCallback, errorCallback?: WebKitErrorCallback): void; +} + +declare var WebKitFileEntry: { + prototype: WebKitFileEntry; + new(): WebKitFileEntry; +} + +interface WebKitFileSystem { + readonly name: string; + readonly root: WebKitDirectoryEntry; +} + +declare var WebKitFileSystem: { + prototype: WebKitFileSystem; + new(): WebKitFileSystem; +} + +interface WebKitPoint { + x: number; + y: number; +} + +declare var WebKitPoint: { + prototype: WebKitPoint; + new(x?: number, y?: number): WebKitPoint; +} + +interface WebSocketEventMap { + "close": CloseEvent; + "error": Event; + "message": MessageEvent; + "open": Event; +} + +interface WebSocket extends EventTarget { + binaryType: string; + readonly bufferedAmount: number; + readonly extensions: string; + onclose: (this: WebSocket, ev: CloseEvent) => any; + onerror: (this: WebSocket, ev: Event) => any; + onmessage: (this: WebSocket, ev: MessageEvent) => any; + onopen: (this: WebSocket, ev: Event) => any; + readonly protocol: string; + readonly readyState: number; + readonly url: string; + close(code?: number, reason?: string): void; + send(data: any): void; + readonly CLOSED: number; + readonly CLOSING: number; + readonly CONNECTING: number; + readonly OPEN: number; + addEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var WebSocket: { + prototype: WebSocket; + new(url: string, protocols?: string | string[]): WebSocket; + readonly CLOSED: number; + readonly CLOSING: number; + readonly CONNECTING: number; + readonly OPEN: number; +} + +interface WheelEvent extends MouseEvent { + readonly deltaMode: number; + readonly deltaX: number; + readonly deltaY: number; + readonly deltaZ: number; + readonly wheelDelta: number; + readonly wheelDeltaX: number; + readonly wheelDeltaY: number; + getCurrentPoint(element: Element): void; + initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; + readonly DOM_DELTA_LINE: number; + readonly DOM_DELTA_PAGE: number; + readonly DOM_DELTA_PIXEL: number; +} + +declare var WheelEvent: { + prototype: WheelEvent; + new(typeArg: string, eventInitDict?: WheelEventInit): WheelEvent; + readonly DOM_DELTA_LINE: number; + readonly DOM_DELTA_PAGE: number; + readonly DOM_DELTA_PIXEL: number; +} + +interface WindowEventMap extends GlobalEventHandlersEventMap { + "abort": UIEvent; + "afterprint": Event; + "beforeprint": Event; + "beforeunload": BeforeUnloadEvent; + "blur": FocusEvent; + "canplay": Event; + "canplaythrough": Event; + "change": Event; + "click": MouseEvent; + "compassneedscalibration": Event; + "contextmenu": PointerEvent; + "dblclick": MouseEvent; + "devicelight": DeviceLightEvent; + "devicemotion": DeviceMotionEvent; + "deviceorientation": DeviceOrientationEvent; + "drag": DragEvent; + "dragend": DragEvent; + "dragenter": DragEvent; + "dragleave": DragEvent; + "dragover": DragEvent; + "dragstart": DragEvent; + "drop": DragEvent; + "durationchange": Event; + "emptied": Event; + "ended": MediaStreamErrorEvent; + "focus": FocusEvent; + "hashchange": HashChangeEvent; + "input": Event; + "invalid": Event; + "keydown": KeyboardEvent; + "keypress": KeyboardEvent; + "keyup": KeyboardEvent; + "load": Event; + "loadeddata": Event; + "loadedmetadata": Event; + "loadstart": Event; + "message": MessageEvent; + "mousedown": MouseEvent; + "mouseenter": MouseEvent; + "mouseleave": MouseEvent; + "mousemove": MouseEvent; + "mouseout": MouseEvent; + "mouseover": MouseEvent; + "mouseup": MouseEvent; + "mousewheel": WheelEvent; + "MSGestureChange": MSGestureEvent; + "MSGestureDoubleTap": MSGestureEvent; + "MSGestureEnd": MSGestureEvent; + "MSGestureHold": MSGestureEvent; + "MSGestureStart": MSGestureEvent; + "MSGestureTap": MSGestureEvent; + "MSInertiaStart": MSGestureEvent; + "MSPointerCancel": MSPointerEvent; + "MSPointerDown": MSPointerEvent; + "MSPointerEnter": MSPointerEvent; + "MSPointerLeave": MSPointerEvent; + "MSPointerMove": MSPointerEvent; + "MSPointerOut": MSPointerEvent; + "MSPointerOver": MSPointerEvent; + "MSPointerUp": MSPointerEvent; + "offline": Event; + "online": Event; + "orientationchange": Event; + "pagehide": PageTransitionEvent; + "pageshow": PageTransitionEvent; + "pause": Event; + "play": Event; + "playing": Event; + "popstate": PopStateEvent; + "progress": ProgressEvent; + "ratechange": Event; + "readystatechange": ProgressEvent; + "reset": Event; + "resize": UIEvent; + "scroll": UIEvent; + "seeked": Event; + "seeking": Event; + "select": UIEvent; + "stalled": Event; + "storage": StorageEvent; + "submit": Event; + "suspend": Event; + "timeupdate": Event; + "unload": Event; + "volumechange": Event; + "waiting": Event; +} + +interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64, GlobalFetch { + readonly applicationCache: ApplicationCache; + readonly caches: CacheStorage; + readonly clientInformation: Navigator; + readonly closed: boolean; + readonly crypto: Crypto; + defaultStatus: string; + readonly devicePixelRatio: number; + readonly doNotTrack: string; + readonly document: Document; + event: Event | undefined; + readonly external: External; + readonly frameElement: Element; + readonly frames: Window; + readonly history: History; + readonly innerHeight: number; + readonly innerWidth: number; + readonly isSecureContext: boolean; + readonly length: number; + readonly location: Location; + readonly locationbar: BarProp; + readonly menubar: BarProp; + readonly msContentScript: ExtensionScriptApis; + readonly msCredentials: MSCredentials; + name: string; + readonly navigator: Navigator; + offscreenBuffering: string | boolean; + onabort: (this: Window, ev: UIEvent) => any; + onafterprint: (this: Window, ev: Event) => any; + onbeforeprint: (this: Window, ev: Event) => any; + onbeforeunload: (this: Window, ev: BeforeUnloadEvent) => any; + onblur: (this: Window, ev: FocusEvent) => any; + oncanplay: (this: Window, ev: Event) => any; + oncanplaythrough: (this: Window, ev: Event) => any; + onchange: (this: Window, ev: Event) => any; + onclick: (this: Window, ev: MouseEvent) => any; + oncompassneedscalibration: (this: Window, ev: Event) => any; + oncontextmenu: (this: Window, ev: PointerEvent) => any; + ondblclick: (this: Window, ev: MouseEvent) => any; + ondevicelight: (this: Window, ev: DeviceLightEvent) => any; + ondevicemotion: (this: Window, ev: DeviceMotionEvent) => any; + ondeviceorientation: (this: Window, ev: DeviceOrientationEvent) => any; + ondrag: (this: Window, ev: DragEvent) => any; + ondragend: (this: Window, ev: DragEvent) => any; + ondragenter: (this: Window, ev: DragEvent) => any; + ondragleave: (this: Window, ev: DragEvent) => any; + ondragover: (this: Window, ev: DragEvent) => any; + ondragstart: (this: Window, ev: DragEvent) => any; + ondrop: (this: Window, ev: DragEvent) => any; + ondurationchange: (this: Window, ev: Event) => any; + onemptied: (this: Window, ev: Event) => any; + onended: (this: Window, ev: MediaStreamErrorEvent) => any; + onerror: ErrorEventHandler; + onfocus: (this: Window, ev: FocusEvent) => any; + onhashchange: (this: Window, ev: HashChangeEvent) => any; + oninput: (this: Window, ev: Event) => any; + oninvalid: (this: Window, ev: Event) => any; + onkeydown: (this: Window, ev: KeyboardEvent) => any; + onkeypress: (this: Window, ev: KeyboardEvent) => any; + onkeyup: (this: Window, ev: KeyboardEvent) => any; + onload: (this: Window, ev: Event) => any; + onloadeddata: (this: Window, ev: Event) => any; + onloadedmetadata: (this: Window, ev: Event) => any; + onloadstart: (this: Window, ev: Event) => any; + onmessage: (this: Window, ev: MessageEvent) => any; + onmousedown: (this: Window, ev: MouseEvent) => any; + onmouseenter: (this: Window, ev: MouseEvent) => any; + onmouseleave: (this: Window, ev: MouseEvent) => any; + onmousemove: (this: Window, ev: MouseEvent) => any; + onmouseout: (this: Window, ev: MouseEvent) => any; + onmouseover: (this: Window, ev: MouseEvent) => any; + onmouseup: (this: Window, ev: MouseEvent) => any; + onmousewheel: (this: Window, ev: WheelEvent) => any; + onmsgesturechange: (this: Window, ev: MSGestureEvent) => any; + onmsgesturedoubletap: (this: Window, ev: MSGestureEvent) => any; + onmsgestureend: (this: Window, ev: MSGestureEvent) => any; + onmsgesturehold: (this: Window, ev: MSGestureEvent) => any; + onmsgesturestart: (this: Window, ev: MSGestureEvent) => any; + onmsgesturetap: (this: Window, ev: MSGestureEvent) => any; + onmsinertiastart: (this: Window, ev: MSGestureEvent) => any; + onmspointercancel: (this: Window, ev: MSPointerEvent) => any; + onmspointerdown: (this: Window, ev: MSPointerEvent) => any; + onmspointerenter: (this: Window, ev: MSPointerEvent) => any; + onmspointerleave: (this: Window, ev: MSPointerEvent) => any; + onmspointermove: (this: Window, ev: MSPointerEvent) => any; + onmspointerout: (this: Window, ev: MSPointerEvent) => any; + onmspointerover: (this: Window, ev: MSPointerEvent) => any; + onmspointerup: (this: Window, ev: MSPointerEvent) => any; + onoffline: (this: Window, ev: Event) => any; + ononline: (this: Window, ev: Event) => any; + onorientationchange: (this: Window, ev: Event) => any; + onpagehide: (this: Window, ev: PageTransitionEvent) => any; + onpageshow: (this: Window, ev: PageTransitionEvent) => any; + onpause: (this: Window, ev: Event) => any; + onplay: (this: Window, ev: Event) => any; + onplaying: (this: Window, ev: Event) => any; + onpopstate: (this: Window, ev: PopStateEvent) => any; + onprogress: (this: Window, ev: ProgressEvent) => any; + onratechange: (this: Window, ev: Event) => any; + onreadystatechange: (this: Window, ev: ProgressEvent) => any; + onreset: (this: Window, ev: Event) => any; + onresize: (this: Window, ev: UIEvent) => any; + onscroll: (this: Window, ev: UIEvent) => any; + onseeked: (this: Window, ev: Event) => any; + onseeking: (this: Window, ev: Event) => any; + onselect: (this: Window, ev: UIEvent) => any; + onstalled: (this: Window, ev: Event) => any; + onstorage: (this: Window, ev: StorageEvent) => any; + onsubmit: (this: Window, ev: Event) => any; + onsuspend: (this: Window, ev: Event) => any; + ontimeupdate: (this: Window, ev: Event) => any; + ontouchcancel: (ev: TouchEvent) => any; + ontouchend: (ev: TouchEvent) => any; + ontouchmove: (ev: TouchEvent) => any; + ontouchstart: (ev: TouchEvent) => any; + onunload: (this: Window, ev: Event) => any; + onvolumechange: (this: Window, ev: Event) => any; + onwaiting: (this: Window, ev: Event) => any; + opener: any; + orientation: string | number; + readonly outerHeight: number; + readonly outerWidth: number; + readonly pageXOffset: number; + readonly pageYOffset: number; + readonly parent: Window; + readonly performance: Performance; + readonly personalbar: BarProp; + readonly screen: Screen; + readonly screenLeft: number; + readonly screenTop: number; + readonly screenX: number; + readonly screenY: number; + readonly scrollX: number; + readonly scrollY: number; + readonly scrollbars: BarProp; + readonly self: Window; + readonly speechSynthesis: SpeechSynthesis; + status: string; + readonly statusbar: BarProp; + readonly styleMedia: StyleMedia; + readonly toolbar: BarProp; + readonly top: Window; + readonly window: Window; + URL: typeof URL; + URLSearchParams: typeof URLSearchParams; + Blob: typeof Blob; + customElements: CustomElementRegistry; + alert(message?: any): void; + blur(): void; + cancelAnimationFrame(handle: number): void; + captureEvents(): void; + close(): void; + confirm(message?: string): boolean; + departFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void; + focus(): void; + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; + getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; + getSelection(): Selection; + matchMedia(mediaQuery: string): MediaQueryList; + moveBy(x?: number, y?: number): void; + moveTo(x?: number, y?: number): void; + msWriteProfilerMark(profilerMarkName: string): void; + open(url?: string, target?: string, features?: string, replace?: boolean): Window; + postMessage(message: any, targetOrigin: string, transfer?: any[]): void; + print(): void; + prompt(message?: string, _default?: string): string | null; + releaseEvents(): void; + requestAnimationFrame(callback: FrameRequestCallback): number; + resizeBy(x?: number, y?: number): void; + resizeTo(x?: number, y?: number): void; + scroll(x?: number, y?: number): void; + scrollBy(x?: number, y?: number): void; + scrollTo(x?: number, y?: number): void; + stop(): void; + webkitCancelAnimationFrame(handle: number): void; + webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; + webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; + webkitRequestAnimationFrame(callback: FrameRequestCallback): number; + createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise; + createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise; + scroll(options?: ScrollToOptions): void; + scrollTo(options?: ScrollToOptions): void; + scrollBy(options?: ScrollToOptions): void; + addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Window: { + prototype: Window; + new(): Window; +} + +interface WorkerEventMap extends AbstractWorkerEventMap { + "message": MessageEvent; +} + +interface Worker extends EventTarget, AbstractWorker { + onmessage: (this: Worker, ev: MessageEvent) => any; + postMessage(message: any, transfer?: any[]): void; + terminate(): void; + addEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Worker: { + prototype: Worker; + new(stringUrl: string): Worker; +} + +interface XMLDocument extends Document { + addEventListener(type: K, listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var XMLDocument: { + prototype: XMLDocument; + new(): XMLDocument; +} + +interface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap { + "readystatechange": Event; +} + +interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { + onreadystatechange: (this: XMLHttpRequest, ev: Event) => any; + readonly readyState: number; + readonly response: any; + readonly responseText: string; + responseType: XMLHttpRequestResponseType; + readonly responseURL: string; + readonly responseXML: Document | null; + readonly status: number; + readonly statusText: string; + timeout: number; + readonly upload: XMLHttpRequestUpload; + withCredentials: boolean; + msCaching?: string; + abort(): void; + getAllResponseHeaders(): string; + getResponseHeader(header: string): string | null; + msCachingEnabled(): boolean; + open(method: string, url: string, async?: boolean, user?: string, password?: string): void; + overrideMimeType(mime: string): void; + send(data?: Document): void; + send(data?: string): void; + send(data?: any): void; + setRequestHeader(header: string, value: string): void; + readonly DONE: number; + readonly HEADERS_RECEIVED: number; + readonly LOADING: number; + readonly OPENED: number; + readonly UNSENT: number; + addEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var XMLHttpRequest: { + prototype: XMLHttpRequest; + new(): XMLHttpRequest; + readonly DONE: number; + readonly HEADERS_RECEIVED: number; + readonly LOADING: number; + readonly OPENED: number; + readonly UNSENT: number; +} + +interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget { + addEventListener(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var XMLHttpRequestUpload: { + prototype: XMLHttpRequestUpload; + new(): XMLHttpRequestUpload; +} + +interface XMLSerializer { + serializeToString(target: Node): string; +} + +declare var XMLSerializer: { + prototype: XMLSerializer; + new(): XMLSerializer; +} + +interface XPathEvaluator { + createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; + createNSResolver(nodeResolver?: Node): XPathNSResolver; + evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult; +} + +declare var XPathEvaluator: { + prototype: XPathEvaluator; + new(): XPathEvaluator; +} + +interface XPathExpression { + evaluate(contextNode: Node, type: number, result: XPathResult | null): XPathResult; +} + +declare var XPathExpression: { + prototype: XPathExpression; + new(): XPathExpression; +} + +interface XPathNSResolver { + lookupNamespaceURI(prefix: string): string; +} + +declare var XPathNSResolver: { + prototype: XPathNSResolver; + new(): XPathNSResolver; +} + +interface XPathResult { + readonly booleanValue: boolean; + readonly invalidIteratorState: boolean; + readonly numberValue: number; + readonly resultType: number; + readonly singleNodeValue: Node; + readonly snapshotLength: number; + readonly stringValue: string; + iterateNext(): Node; + snapshotItem(index: number): Node; + readonly ANY_TYPE: number; + readonly ANY_UNORDERED_NODE_TYPE: number; + readonly BOOLEAN_TYPE: number; + readonly FIRST_ORDERED_NODE_TYPE: number; + readonly NUMBER_TYPE: number; + readonly ORDERED_NODE_ITERATOR_TYPE: number; + readonly ORDERED_NODE_SNAPSHOT_TYPE: number; + readonly STRING_TYPE: number; + readonly UNORDERED_NODE_ITERATOR_TYPE: number; + readonly UNORDERED_NODE_SNAPSHOT_TYPE: number; +} + +declare var XPathResult: { + prototype: XPathResult; + new(): XPathResult; + readonly ANY_TYPE: number; + readonly ANY_UNORDERED_NODE_TYPE: number; + readonly BOOLEAN_TYPE: number; + readonly FIRST_ORDERED_NODE_TYPE: number; + readonly NUMBER_TYPE: number; + readonly ORDERED_NODE_ITERATOR_TYPE: number; + readonly ORDERED_NODE_SNAPSHOT_TYPE: number; + readonly STRING_TYPE: number; + readonly UNORDERED_NODE_ITERATOR_TYPE: number; + readonly UNORDERED_NODE_SNAPSHOT_TYPE: number; +} + +interface XSLTProcessor { + clearParameters(): void; + getParameter(namespaceURI: string, localName: string): any; + importStylesheet(style: Node): void; + removeParameter(namespaceURI: string, localName: string): void; + reset(): void; + setParameter(namespaceURI: string, localName: string, value: any): void; + transformToDocument(source: Node): Document; + transformToFragment(source: Node, document: Document): DocumentFragment; +} + +declare var XSLTProcessor: { + prototype: XSLTProcessor; + new(): XSLTProcessor; +} + +interface webkitRTCPeerConnection extends RTCPeerConnection { + addEventListener(type: K, listener: (this: webkitRTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var webkitRTCPeerConnection: { + prototype: webkitRTCPeerConnection; + new(configuration: RTCConfiguration): webkitRTCPeerConnection; +} + +interface AbstractWorkerEventMap { + "error": ErrorEvent; +} + +interface AbstractWorker { + onerror: (this: AbstractWorker, ev: ErrorEvent) => any; + addEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface Body { + readonly bodyUsed: boolean; + arrayBuffer(): Promise; + blob(): Promise; + json(): Promise; + text(): Promise; + formData(): Promise; +} + +interface CanvasPathMethods { + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + closePath(): void; + ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + lineTo(x: number, y: number): void; + moveTo(x: number, y: number): void; + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + rect(x: number, y: number, w: number, h: number): void; +} + +interface ChildNode { + remove(): void; +} + +interface DOML2DeprecatedColorProperty { + color: string; +} + +interface DOML2DeprecatedSizeProperty { + size: number; +} + +interface DocumentEvent { + createEvent(eventInterface:"AnimationEvent"): AnimationEvent; + createEvent(eventInterface:"AudioProcessingEvent"): AudioProcessingEvent; + createEvent(eventInterface:"BeforeUnloadEvent"): BeforeUnloadEvent; + createEvent(eventInterface:"ClipboardEvent"): ClipboardEvent; + createEvent(eventInterface:"CloseEvent"): CloseEvent; + createEvent(eventInterface:"CompositionEvent"): CompositionEvent; + createEvent(eventInterface:"CustomEvent"): CustomEvent; + createEvent(eventInterface:"DeviceLightEvent"): DeviceLightEvent; + createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent; + createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent; + createEvent(eventInterface:"DragEvent"): DragEvent; + createEvent(eventInterface:"ErrorEvent"): ErrorEvent; + createEvent(eventInterface:"Event"): Event; + createEvent(eventInterface:"Events"): Event; + createEvent(eventInterface:"FocusEvent"): FocusEvent; + createEvent(eventInterface:"FocusNavigationEvent"): FocusNavigationEvent; + createEvent(eventInterface:"GamepadEvent"): GamepadEvent; + createEvent(eventInterface:"HashChangeEvent"): HashChangeEvent; + createEvent(eventInterface:"IDBVersionChangeEvent"): IDBVersionChangeEvent; + createEvent(eventInterface:"KeyboardEvent"): KeyboardEvent; + createEvent(eventInterface:"ListeningStateChangedEvent"): ListeningStateChangedEvent; + createEvent(eventInterface:"LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent; + createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; + createEvent(eventInterface:"MSManipulationEvent"): MSManipulationEvent; + createEvent(eventInterface:"MSMediaKeyMessageEvent"): MSMediaKeyMessageEvent; + createEvent(eventInterface:"MSMediaKeyNeededEvent"): MSMediaKeyNeededEvent; + createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; + createEvent(eventInterface:"MSSiteModeEvent"): MSSiteModeEvent; + createEvent(eventInterface:"MediaEncryptedEvent"): MediaEncryptedEvent; + createEvent(eventInterface:"MediaKeyMessageEvent"): MediaKeyMessageEvent; + createEvent(eventInterface:"MediaStreamErrorEvent"): MediaStreamErrorEvent; + createEvent(eventInterface:"MediaStreamEvent"): MediaStreamEvent; + createEvent(eventInterface:"MediaStreamTrackEvent"): MediaStreamTrackEvent; + createEvent(eventInterface:"MessageEvent"): MessageEvent; + createEvent(eventInterface:"MouseEvent"): MouseEvent; + createEvent(eventInterface:"MouseEvents"): MouseEvent; + createEvent(eventInterface:"MutationEvent"): MutationEvent; + createEvent(eventInterface:"MutationEvents"): MutationEvent; + createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent; + createEvent(eventInterface:"NavigationEvent"): NavigationEvent; + createEvent(eventInterface:"NavigationEventWithReferrer"): NavigationEventWithReferrer; + createEvent(eventInterface:"OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; + createEvent(eventInterface:"OverflowEvent"): OverflowEvent; + createEvent(eventInterface:"PageTransitionEvent"): PageTransitionEvent; + createEvent(eventInterface:"PaymentRequestUpdateEvent"): PaymentRequestUpdateEvent; + createEvent(eventInterface:"PermissionRequestedEvent"): PermissionRequestedEvent; + createEvent(eventInterface:"PointerEvent"): PointerEvent; + createEvent(eventInterface:"PopStateEvent"): PopStateEvent; + createEvent(eventInterface:"ProgressEvent"): ProgressEvent; + createEvent(eventInterface:"RTCDTMFToneChangeEvent"): RTCDTMFToneChangeEvent; + createEvent(eventInterface:"RTCDtlsTransportStateChangedEvent"): RTCDtlsTransportStateChangedEvent; + createEvent(eventInterface:"RTCIceCandidatePairChangedEvent"): RTCIceCandidatePairChangedEvent; + createEvent(eventInterface:"RTCIceGathererEvent"): RTCIceGathererEvent; + createEvent(eventInterface:"RTCIceTransportStateChangedEvent"): RTCIceTransportStateChangedEvent; + createEvent(eventInterface:"RTCPeerConnectionIceEvent"): RTCPeerConnectionIceEvent; + createEvent(eventInterface:"RTCSsrcConflictEvent"): RTCSsrcConflictEvent; + createEvent(eventInterface:"SVGZoomEvent"): SVGZoomEvent; + createEvent(eventInterface:"SVGZoomEvents"): SVGZoomEvent; + createEvent(eventInterface:"ScriptNotifyEvent"): ScriptNotifyEvent; + createEvent(eventInterface:"ServiceWorkerMessageEvent"): ServiceWorkerMessageEvent; + createEvent(eventInterface:"SpeechSynthesisEvent"): SpeechSynthesisEvent; + createEvent(eventInterface:"StorageEvent"): StorageEvent; + createEvent(eventInterface:"TextEvent"): TextEvent; + createEvent(eventInterface:"TouchEvent"): TouchEvent; + createEvent(eventInterface:"TrackEvent"): TrackEvent; + createEvent(eventInterface:"TransitionEvent"): TransitionEvent; + createEvent(eventInterface:"UIEvent"): UIEvent; + createEvent(eventInterface:"UIEvents"): UIEvent; + createEvent(eventInterface:"UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; + createEvent(eventInterface:"WebGLContextEvent"): WebGLContextEvent; + createEvent(eventInterface:"WheelEvent"): WheelEvent; + createEvent(eventInterface: string): Event; +} + +interface ElementTraversal { + readonly childElementCount: number; + readonly firstElementChild: Element | null; + readonly lastElementChild: Element | null; + readonly nextElementSibling: Element | null; + readonly previousElementSibling: Element | null; +} + +interface GetSVGDocument { + getSVGDocument(): Document; +} + +interface GlobalEventHandlersEventMap { + "pointercancel": PointerEvent; + "pointerdown": PointerEvent; + "pointerenter": PointerEvent; + "pointerleave": PointerEvent; + "pointermove": PointerEvent; + "pointerout": PointerEvent; + "pointerover": PointerEvent; + "pointerup": PointerEvent; + "wheel": WheelEvent; +} + +interface GlobalEventHandlers { + onpointercancel: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onpointerdown: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onpointerenter: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onpointerleave: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onpointermove: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onpointerout: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onpointerover: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onpointerup: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onwheel: (this: GlobalEventHandlers, ev: WheelEvent) => any; + addEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface GlobalFetch { + fetch(input: RequestInfo, init?: RequestInit): Promise; +} + +interface HTMLTableAlignment { + /** + * Sets or retrieves a value that you can use to implement your own ch functionality for the object. + */ + ch: string; + /** + * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. + */ + chOff: string; + /** + * Sets or retrieves how text and other content are vertically aligned within the object that contains them. + */ + vAlign: string; +} + +interface IDBEnvironment { + readonly indexedDB: IDBFactory; +} + +interface LinkStyle { + readonly sheet: StyleSheet; +} + +interface MSBaseReaderEventMap { + "abort": Event; + "error": ErrorEvent; + "load": Event; + "loadend": ProgressEvent; + "loadstart": Event; + "progress": ProgressEvent; +} + +interface MSBaseReader { + onabort: (this: MSBaseReader, ev: Event) => any; + onerror: (this: MSBaseReader, ev: ErrorEvent) => any; + onload: (this: MSBaseReader, ev: Event) => any; + onloadend: (this: MSBaseReader, ev: ProgressEvent) => any; + onloadstart: (this: MSBaseReader, ev: Event) => any; + onprogress: (this: MSBaseReader, ev: ProgressEvent) => any; + readonly readyState: number; + readonly result: any; + abort(): void; + readonly DONE: number; + readonly EMPTY: number; + readonly LOADING: number; + addEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface MSFileSaver { + msSaveBlob(blob: any, defaultName?: string): boolean; + msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; +} + +interface MSNavigatorDoNotTrack { + confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; + confirmWebWideTrackingException(args: ExceptionInformation): boolean; + removeSiteSpecificTrackingException(args: ExceptionInformation): void; + removeWebWideTrackingException(args: ExceptionInformation): void; + storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; + storeWebWideTrackingException(args: StoreExceptionsInformation): void; +} + +interface NavigatorBeacon { + sendBeacon(url: USVString, data?: BodyInit): boolean; +} + +interface NavigatorConcurrentHardware { + readonly hardwareConcurrency: number; +} + +interface NavigatorContentUtils { +} + +interface NavigatorGeolocation { + readonly geolocation: Geolocation; +} + +interface NavigatorID { + readonly appCodeName: string; + readonly appName: string; + readonly appVersion: string; + readonly platform: string; + readonly product: string; + readonly productSub: string; + readonly userAgent: string; + readonly vendor: string; + readonly vendorSub: string; +} + +interface NavigatorOnLine { + readonly onLine: boolean; +} + +interface NavigatorStorageUtils { +} + +interface NavigatorUserMedia { + readonly mediaDevices: MediaDevices; + getUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback): void; +} + +interface NodeSelector { + querySelector(selectors: K): ElementTagNameMap[K] | null; + querySelector(selectors: string): Element | null; + querySelectorAll(selectors: K): ElementListTagNameMap[K]; + querySelectorAll(selectors: string): NodeListOf; +} + +interface RandomSource { + getRandomValues(array: ArrayBufferView): ArrayBufferView; +} + +interface SVGAnimatedPoints { + readonly animatedPoints: SVGPointList; + readonly points: SVGPointList; +} + +interface SVGFilterPrimitiveStandardAttributes { + readonly height: SVGAnimatedLength; + readonly result: SVGAnimatedString; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; +} + +interface SVGFitToViewBox { + readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + readonly viewBox: SVGAnimatedRect; +} + +interface SVGTests { + readonly requiredExtensions: SVGStringList; + readonly requiredFeatures: SVGStringList; + readonly systemLanguage: SVGStringList; + hasExtension(extension: string): boolean; +} + +interface SVGURIReference { + readonly href: SVGAnimatedString; +} + +interface WindowBase64 { + atob(encodedString: string): string; + btoa(rawString: string): string; +} + +interface WindowConsole { + readonly console: Console; +} + +interface WindowLocalStorage { + readonly localStorage: Storage; +} + +interface WindowSessionStorage { + readonly sessionStorage: Storage; +} + +interface WindowTimers extends Object, WindowTimersExtension { + clearInterval(handle: number): void; + clearTimeout(handle: number): void; + setInterval(handler: (...args: any[]) => void, timeout: number): number; + setInterval(handler: any, timeout?: any, ...args: any[]): number; + setTimeout(handler: (...args: any[]) => void, timeout: number): number; + setTimeout(handler: any, timeout?: any, ...args: any[]): number; +} + +interface WindowTimersExtension { + clearImmediate(handle: number): void; + setImmediate(handler: (...args: any[]) => void): number; + setImmediate(handler: any, ...args: any[]): number; +} + +interface XMLHttpRequestEventTargetEventMap { + "abort": Event; + "error": ErrorEvent; + "load": Event; + "loadend": ProgressEvent; + "loadstart": Event; + "progress": ProgressEvent; + "timeout": ProgressEvent; +} + +interface XMLHttpRequestEventTarget { + onabort: (this: XMLHttpRequestEventTarget, ev: Event) => any; + onerror: (this: XMLHttpRequestEventTarget, ev: ErrorEvent) => any; + onload: (this: XMLHttpRequestEventTarget, ev: Event) => any; + onloadend: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; + onloadstart: (this: XMLHttpRequestEventTarget, ev: Event) => any; + onprogress: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; + ontimeout: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; + addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface ErrorEventInit { + message?: string; + filename?: string; + lineno?: number; + conlno?: number; + error?: any; +} + +interface StorageEventInit extends EventInit { + key?: string; + oldValue?: string; + newValue?: string; + url: string; + storageArea?: Storage; +} + +interface Canvas2DContextAttributes { + alpha?: boolean; + willReadFrequently?: boolean; + storage?: boolean; + [attribute: string]: boolean | string | undefined; +} + +interface ImageBitmapOptions { + imageOrientation?: "none" | "flipY"; + premultiplyAlpha?: "none" | "premultiply" | "default"; + colorSpaceConversion?: "none" | "default"; + resizeWidth?: number; + resizeHeight?: number; + resizeQuality?: "pixelated" | "low" | "medium" | "high"; +} + +interface ImageBitmap { + readonly width: number; + readonly height: number; + close(): void; +} + +interface URLSearchParams { + /** + * Appends a specified key/value pair as a new search parameter. + */ + append(name: string, value: string): void; + /** + * Deletes the given search parameter, and its associated value, from the list of all search parameters. + */ + delete(name: string): void; + /** + * Returns the first value associated to the given search parameter. + */ + get(name: string): string | null; + /** + * Returns all the values association with a given search parameter. + */ + getAll(name: string): string[]; + /** + * Returns a Boolean indicating if such a search parameter exists. + */ + has(name: string): boolean; + /** + * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others. + */ + set(name: string, value: string): void; +} + +declare var URLSearchParams: { + prototype: URLSearchParams; + /** + * Constructor returning a URLSearchParams object. + */ + new (init?: string | URLSearchParams): URLSearchParams; +} + +interface NodeListOf extends NodeList { + length: number; + item(index: number): TNode; + [index: number]: TNode; +} + +interface HTMLCollectionOf extends HTMLCollection { + item(index: number): T; + namedItem(name: string): T; + [index: number]: T; +} + +interface BlobPropertyBag { + type?: string; + endings?: string; +} + +interface FilePropertyBag { + type?: string; + lastModified?: number; +} + +interface EventListenerObject { + handleEvent(evt: Event): void; +} + +interface ProgressEventInit extends EventInit { + lengthComputable?: boolean; + loaded?: number; + total?: number; +} + +interface ScrollOptions { + behavior?: ScrollBehavior; +} + +interface ScrollToOptions extends ScrollOptions { + left?: number; + top?: number; +} + +interface ScrollIntoViewOptions extends ScrollOptions { + block?: ScrollLogicalPosition; + inline?: ScrollLogicalPosition; +} + +interface ClipboardEventInit extends EventInit { + data?: string; + dataType?: string; +} + +interface IDBArrayKey extends Array { +} + +interface RsaKeyGenParams extends Algorithm { + modulusLength: number; + publicExponent: Uint8Array; +} + +interface RsaHashedKeyGenParams extends RsaKeyGenParams { + hash: AlgorithmIdentifier; +} + +interface RsaKeyAlgorithm extends KeyAlgorithm { + modulusLength: number; + publicExponent: Uint8Array; +} + +interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { + hash: AlgorithmIdentifier; +} + +interface RsaHashedImportParams { + hash: AlgorithmIdentifier; +} + +interface RsaPssParams { + saltLength: number; +} + +interface RsaOaepParams extends Algorithm { + label?: BufferSource; +} + +interface EcdsaParams extends Algorithm { + hash: AlgorithmIdentifier; +} + +interface EcKeyGenParams extends Algorithm { + namedCurve: string; +} + +interface EcKeyAlgorithm extends KeyAlgorithm { + typedCurve: string; +} + +interface EcKeyImportParams { + namedCurve: string; +} + +interface EcdhKeyDeriveParams extends Algorithm { + public: CryptoKey; +} + +interface AesCtrParams extends Algorithm { + counter: BufferSource; + length: number; +} + +interface AesKeyAlgorithm extends KeyAlgorithm { + length: number; +} + +interface AesKeyGenParams extends Algorithm { + length: number; +} + +interface AesDerivedKeyParams extends Algorithm { + length: number; +} + +interface AesCbcParams extends Algorithm { + iv: BufferSource; +} + +interface AesCmacParams extends Algorithm { + length: number; +} + +interface AesGcmParams extends Algorithm { + iv: BufferSource; + additionalData?: BufferSource; + tagLength?: number; +} + +interface AesCfbParams extends Algorithm { + iv: BufferSource; +} + +interface HmacImportParams extends Algorithm { + hash?: AlgorithmIdentifier; + length?: number; +} + +interface HmacKeyAlgorithm extends KeyAlgorithm { + hash: AlgorithmIdentifier; + length: number; +} + +interface HmacKeyGenParams extends Algorithm { + hash: AlgorithmIdentifier; + length?: number; +} + +interface DhKeyGenParams extends Algorithm { + prime: Uint8Array; + generator: Uint8Array; +} + +interface DhKeyAlgorithm extends KeyAlgorithm { + prime: Uint8Array; + generator: Uint8Array; +} + +interface DhKeyDeriveParams extends Algorithm { + public: CryptoKey; +} + +interface DhImportKeyParams extends Algorithm { + prime: Uint8Array; + generator: Uint8Array; +} + +interface ConcatParams extends Algorithm { + hash?: AlgorithmIdentifier; + algorithmId: Uint8Array; + partyUInfo: Uint8Array; + partyVInfo: Uint8Array; + publicInfo?: Uint8Array; + privateInfo?: Uint8Array; +} + +interface HkdfCtrParams extends Algorithm { + hash: AlgorithmIdentifier; + label: BufferSource; + context: BufferSource; +} + +interface Pbkdf2Params extends Algorithm { + salt: BufferSource; + iterations: number; + hash: AlgorithmIdentifier; +} + +interface RsaOtherPrimesInfo { + r: string; + d: string; + t: string; +} + +interface JsonWebKey { + kty: string; + use?: string; + key_ops?: string[]; + alg?: string; + kid?: string; + x5u?: string; + x5c?: string; + x5t?: string; + ext?: boolean; + crv?: string; + x?: string; + y?: string; + d?: string; + n?: string; + e?: string; + p?: string; + q?: string; + dp?: string; + dq?: string; + qi?: string; + oth?: RsaOtherPrimesInfo[]; + k?: string; +} + +interface ParentNode { + readonly children: HTMLCollection; + readonly firstElementChild: Element | null; + readonly lastElementChild: Element | null; + readonly childElementCount: number; +} + +interface DocumentOrShadowRoot { + readonly activeElement: Element | null; + readonly stylesheets: StyleSheetList; + getSelection(): Selection | null; + elementFromPoint(x: number, y: number): Element | null; + elementsFromPoint(x: number, y: number): Element[]; +} + +interface ShadowRoot extends DocumentOrShadowRoot, DocumentFragment { + readonly host: Element; + innerHTML: string; +} + +interface ShadowRootInit { + mode: 'open'|'closed'; + delegatesFocus?: boolean; +} + +interface HTMLSlotElement extends HTMLElement { + name: string; + assignedNodes(options?: AssignedNodesOptions): Node[]; +} + +interface AssignedNodesOptions { + flatten?: boolean; +} + +interface ElementDefinitionOptions { + extends: string; +} + +interface CustomElementRegistry { + define(name: string, constructor: Function, options?: ElementDefinitionOptions): void; + get(name: string): any; + whenDefined(name: string): PromiseLike; +} + +interface PromiseRejectionEvent extends Event { + readonly promise: PromiseLike; + readonly reason: any; +} + +interface PromiseRejectionEventInit extends EventInit { + promise: PromiseLike; + reason?: any; +} + +interface EventListenerOptions { + capture?: boolean; +} + +interface AddEventListenerOptions extends EventListenerOptions { + passive?: boolean; + once?: boolean; +} + +interface TouchEventInit extends EventModifierInit { + touches?: Touch[]; + targetTouches?: Touch[]; + changedTouches?: Touch[]; +} + +declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; + +interface ErrorEventHandler { + (message: string, filename?: string, lineno?: number, colno?: number, error?:Error): void; +} +interface PositionCallback { + (position: Position): void; +} +interface PositionErrorCallback { + (error: PositionError): void; +} +interface MediaQueryListListener { + (mql: MediaQueryList): void; +} +interface MSLaunchUriCallback { + (): void; +} +interface FrameRequestCallback { + (time: number): void; +} +interface MSUnsafeFunctionCallback { + (): any; +} +interface MSExecAtPriorityFunctionCallback { + (...args: any[]): any; +} +interface MutationCallback { + (mutations: MutationRecord[], observer: MutationObserver): void; +} +interface DecodeSuccessCallback { + (decodedData: AudioBuffer): void; +} +interface DecodeErrorCallback { + (error: DOMException): void; +} +interface VoidFunction { + (): void; +} +interface RTCSessionDescriptionCallback { + (sdp: RTCSessionDescription): void; +} +interface RTCPeerConnectionErrorCallback { + (error: DOMError): void; +} +interface RTCStatsCallback { + (report: RTCStatsReport): void; +} +interface FunctionStringCallback { + (data: string): void; +} +interface NavigatorUserMediaSuccessCallback { + (stream: MediaStream): void; +} +interface NavigatorUserMediaErrorCallback { + (error: MediaStreamError): void; +} +interface ForEachCallback { + (keyId: any, status: MediaKeyStatus): void; +} +interface NotificationPermissionCallback { + (permission: NotificationPermission): void; +} +interface IntersectionObserverCallback { + (entries: IntersectionObserverEntry[], observer: IntersectionObserver): void; +} +interface HTMLElementTagNameMap { + "a": HTMLAnchorElement; + "applet": HTMLAppletElement; + "area": HTMLAreaElement; + "audio": HTMLAudioElement; + "base": HTMLBaseElement; + "basefont": HTMLBaseFontElement; + "blockquote": HTMLQuoteElement; + "body": HTMLBodyElement; + "br": HTMLBRElement; + "button": HTMLButtonElement; + "canvas": HTMLCanvasElement; + "caption": HTMLTableCaptionElement; + "col": HTMLTableColElement; + "colgroup": HTMLTableColElement; + "data": HTMLDataElement; + "datalist": HTMLDataListElement; + "del": HTMLModElement; + "dir": HTMLDirectoryElement; + "div": HTMLDivElement; + "dl": HTMLDListElement; + "embed": HTMLEmbedElement; + "fieldset": HTMLFieldSetElement; + "font": HTMLFontElement; + "form": HTMLFormElement; + "frame": HTMLFrameElement; + "frameset": HTMLFrameSetElement; + "h1": HTMLHeadingElement; + "h2": HTMLHeadingElement; + "h3": HTMLHeadingElement; + "h4": HTMLHeadingElement; + "h5": HTMLHeadingElement; + "h6": HTMLHeadingElement; + "head": HTMLHeadElement; + "hr": HTMLHRElement; + "html": HTMLHtmlElement; + "iframe": HTMLIFrameElement; + "img": HTMLImageElement; + "input": HTMLInputElement; + "ins": HTMLModElement; + "isindex": HTMLUnknownElement; + "label": HTMLLabelElement; + "legend": HTMLLegendElement; + "li": HTMLLIElement; + "link": HTMLLinkElement; + "listing": HTMLPreElement; + "map": HTMLMapElement; + "marquee": HTMLMarqueeElement; + "menu": HTMLMenuElement; + "meta": HTMLMetaElement; + "meter": HTMLMeterElement; + "nextid": HTMLUnknownElement; + "object": HTMLObjectElement; + "ol": HTMLOListElement; + "optgroup": HTMLOptGroupElement; + "option": HTMLOptionElement; + "output": HTMLOutputElement; + "p": HTMLParagraphElement; + "param": HTMLParamElement; + "picture": HTMLPictureElement; + "pre": HTMLPreElement; + "progress": HTMLProgressElement; + "q": HTMLQuoteElement; + "script": HTMLScriptElement; + "select": HTMLSelectElement; + "source": HTMLSourceElement; + "span": HTMLSpanElement; + "style": HTMLStyleElement; + "table": HTMLTableElement; + "tbody": HTMLTableSectionElement; + "td": HTMLTableDataCellElement; + "template": HTMLTemplateElement; + "textarea": HTMLTextAreaElement; + "tfoot": HTMLTableSectionElement; + "th": HTMLTableHeaderCellElement; + "thead": HTMLTableSectionElement; + "time": HTMLTimeElement; + "title": HTMLTitleElement; + "tr": HTMLTableRowElement; + "track": HTMLTrackElement; + "ul": HTMLUListElement; + "video": HTMLVideoElement; + "x-ms-webview": MSHTMLWebViewElement; + "xmp": HTMLPreElement; +} + +interface ElementTagNameMap { + "a": HTMLAnchorElement; + "abbr": HTMLElement; + "acronym": HTMLElement; + "address": HTMLElement; + "applet": HTMLAppletElement; + "area": HTMLAreaElement; + "article": HTMLElement; + "aside": HTMLElement; + "audio": HTMLAudioElement; + "b": HTMLElement; + "base": HTMLBaseElement; + "basefont": HTMLBaseFontElement; + "bdo": HTMLElement; + "big": HTMLElement; + "blockquote": HTMLQuoteElement; + "body": HTMLBodyElement; + "br": HTMLBRElement; + "button": HTMLButtonElement; + "canvas": HTMLCanvasElement; + "caption": HTMLTableCaptionElement; + "center": HTMLElement; + "circle": SVGCircleElement; + "cite": HTMLElement; + "clippath": SVGClipPathElement; + "code": HTMLElement; + "col": HTMLTableColElement; + "colgroup": HTMLTableColElement; + "data": HTMLDataElement; + "datalist": HTMLDataListElement; + "dd": HTMLElement; + "defs": SVGDefsElement; + "del": HTMLModElement; + "desc": SVGDescElement; + "dfn": HTMLElement; + "dir": HTMLDirectoryElement; + "div": HTMLDivElement; + "dl": HTMLDListElement; + "dt": HTMLElement; + "ellipse": SVGEllipseElement; + "em": HTMLElement; + "embed": HTMLEmbedElement; + "feblend": SVGFEBlendElement; + "fecolormatrix": SVGFEColorMatrixElement; + "fecomponenttransfer": SVGFEComponentTransferElement; + "fecomposite": SVGFECompositeElement; + "feconvolvematrix": SVGFEConvolveMatrixElement; + "fediffuselighting": SVGFEDiffuseLightingElement; + "fedisplacementmap": SVGFEDisplacementMapElement; + "fedistantlight": SVGFEDistantLightElement; + "feflood": SVGFEFloodElement; + "fefunca": SVGFEFuncAElement; + "fefuncb": SVGFEFuncBElement; + "fefuncg": SVGFEFuncGElement; + "fefuncr": SVGFEFuncRElement; + "fegaussianblur": SVGFEGaussianBlurElement; + "feimage": SVGFEImageElement; + "femerge": SVGFEMergeElement; + "femergenode": SVGFEMergeNodeElement; + "femorphology": SVGFEMorphologyElement; + "feoffset": SVGFEOffsetElement; + "fepointlight": SVGFEPointLightElement; + "fespecularlighting": SVGFESpecularLightingElement; + "fespotlight": SVGFESpotLightElement; + "fetile": SVGFETileElement; + "feturbulence": SVGFETurbulenceElement; + "fieldset": HTMLFieldSetElement; + "figcaption": HTMLElement; + "figure": HTMLElement; + "filter": SVGFilterElement; + "font": HTMLFontElement; + "footer": HTMLElement; + "foreignobject": SVGForeignObjectElement; + "form": HTMLFormElement; + "frame": HTMLFrameElement; + "frameset": HTMLFrameSetElement; + "g": SVGGElement; + "h1": HTMLHeadingElement; + "h2": HTMLHeadingElement; + "h3": HTMLHeadingElement; + "h4": HTMLHeadingElement; + "h5": HTMLHeadingElement; + "h6": HTMLHeadingElement; + "head": HTMLHeadElement; + "header": HTMLElement; + "hgroup": HTMLElement; + "hr": HTMLHRElement; + "html": HTMLHtmlElement; + "i": HTMLElement; + "iframe": HTMLIFrameElement; + "image": SVGImageElement; + "img": HTMLImageElement; + "input": HTMLInputElement; + "ins": HTMLModElement; + "isindex": HTMLUnknownElement; + "kbd": HTMLElement; + "keygen": HTMLElement; + "label": HTMLLabelElement; + "legend": HTMLLegendElement; + "li": HTMLLIElement; + "line": SVGLineElement; + "lineargradient": SVGLinearGradientElement; + "link": HTMLLinkElement; + "listing": HTMLPreElement; + "map": HTMLMapElement; + "mark": HTMLElement; + "marker": SVGMarkerElement; + "marquee": HTMLMarqueeElement; + "mask": SVGMaskElement; + "menu": HTMLMenuElement; + "meta": HTMLMetaElement; + "metadata": SVGMetadataElement; + "meter": HTMLMeterElement; + "nav": HTMLElement; + "nextid": HTMLUnknownElement; + "nobr": HTMLElement; + "noframes": HTMLElement; + "noscript": HTMLElement; + "object": HTMLObjectElement; + "ol": HTMLOListElement; + "optgroup": HTMLOptGroupElement; + "option": HTMLOptionElement; + "output": HTMLOutputElement; + "p": HTMLParagraphElement; + "param": HTMLParamElement; + "path": SVGPathElement; + "pattern": SVGPatternElement; + "picture": HTMLPictureElement; + "plaintext": HTMLElement; + "polygon": SVGPolygonElement; + "polyline": SVGPolylineElement; + "pre": HTMLPreElement; + "progress": HTMLProgressElement; + "q": HTMLQuoteElement; + "radialgradient": SVGRadialGradientElement; + "rect": SVGRectElement; + "rt": HTMLElement; + "ruby": HTMLElement; + "s": HTMLElement; + "samp": HTMLElement; + "script": HTMLScriptElement; + "section": HTMLElement; + "select": HTMLSelectElement; + "small": HTMLElement; + "source": HTMLSourceElement; + "span": HTMLSpanElement; + "stop": SVGStopElement; + "strike": HTMLElement; + "strong": HTMLElement; + "style": HTMLStyleElement; + "sub": HTMLElement; + "sup": HTMLElement; + "svg": SVGSVGElement; + "switch": SVGSwitchElement; + "symbol": SVGSymbolElement; + "table": HTMLTableElement; + "tbody": HTMLTableSectionElement; + "td": HTMLTableDataCellElement; + "template": HTMLTemplateElement; + "text": SVGTextElement; + "textpath": SVGTextPathElement; + "textarea": HTMLTextAreaElement; + "tfoot": HTMLTableSectionElement; + "th": HTMLTableHeaderCellElement; + "thead": HTMLTableSectionElement; + "time": HTMLTimeElement; + "title": HTMLTitleElement; + "tr": HTMLTableRowElement; + "track": HTMLTrackElement; + "tspan": SVGTSpanElement; + "tt": HTMLElement; + "u": HTMLElement; + "ul": HTMLUListElement; + "use": SVGUseElement; + "var": HTMLElement; + "video": HTMLVideoElement; + "view": SVGViewElement; + "wbr": HTMLElement; + "x-ms-webview": MSHTMLWebViewElement; + "xmp": HTMLPreElement; +} + +interface ElementListTagNameMap { + "a": NodeListOf; + "abbr": NodeListOf; + "acronym": NodeListOf; + "address": NodeListOf; + "applet": NodeListOf; + "area": NodeListOf; + "article": NodeListOf; + "aside": NodeListOf; + "audio": NodeListOf; + "b": NodeListOf; + "base": NodeListOf; + "basefont": NodeListOf; + "bdo": NodeListOf; + "big": NodeListOf; + "blockquote": NodeListOf; + "body": NodeListOf; + "br": NodeListOf; + "button": NodeListOf; + "canvas": NodeListOf; + "caption": NodeListOf; + "center": NodeListOf; + "circle": NodeListOf; + "cite": NodeListOf; + "clippath": NodeListOf; + "code": NodeListOf; + "col": NodeListOf; + "colgroup": NodeListOf; + "data": NodeListOf; + "datalist": NodeListOf; + "dd": NodeListOf; + "defs": NodeListOf; + "del": NodeListOf; + "desc": NodeListOf; + "dfn": NodeListOf; + "dir": NodeListOf; + "div": NodeListOf; + "dl": NodeListOf; + "dt": NodeListOf; + "ellipse": NodeListOf; + "em": NodeListOf; + "embed": NodeListOf; + "feblend": NodeListOf; + "fecolormatrix": NodeListOf; + "fecomponenttransfer": NodeListOf; + "fecomposite": NodeListOf; + "feconvolvematrix": NodeListOf; + "fediffuselighting": NodeListOf; + "fedisplacementmap": NodeListOf; + "fedistantlight": NodeListOf; + "feflood": NodeListOf; + "fefunca": NodeListOf; + "fefuncb": NodeListOf; + "fefuncg": NodeListOf; + "fefuncr": NodeListOf; + "fegaussianblur": NodeListOf; + "feimage": NodeListOf; + "femerge": NodeListOf; + "femergenode": NodeListOf; + "femorphology": NodeListOf; + "feoffset": NodeListOf; + "fepointlight": NodeListOf; + "fespecularlighting": NodeListOf; + "fespotlight": NodeListOf; + "fetile": NodeListOf; + "feturbulence": NodeListOf; + "fieldset": NodeListOf; + "figcaption": NodeListOf; + "figure": NodeListOf; + "filter": NodeListOf; + "font": NodeListOf; + "footer": NodeListOf; + "foreignobject": NodeListOf; + "form": NodeListOf; + "frame": NodeListOf; + "frameset": NodeListOf; + "g": NodeListOf; + "h1": NodeListOf; + "h2": NodeListOf; + "h3": NodeListOf; + "h4": NodeListOf; + "h5": NodeListOf; + "h6": NodeListOf; + "head": NodeListOf; + "header": NodeListOf; + "hgroup": NodeListOf; + "hr": NodeListOf; + "html": NodeListOf; + "i": NodeListOf; + "iframe": NodeListOf; + "image": NodeListOf; + "img": NodeListOf; + "input": NodeListOf; + "ins": NodeListOf; + "isindex": NodeListOf; + "kbd": NodeListOf; + "keygen": NodeListOf; + "label": NodeListOf; + "legend": NodeListOf; + "li": NodeListOf; + "line": NodeListOf; + "lineargradient": NodeListOf; + "link": NodeListOf; + "listing": NodeListOf; + "map": NodeListOf; + "mark": NodeListOf; + "marker": NodeListOf; + "marquee": NodeListOf; + "mask": NodeListOf; + "menu": NodeListOf; + "meta": NodeListOf; + "metadata": NodeListOf; + "meter": NodeListOf; + "nav": NodeListOf; + "nextid": NodeListOf; + "nobr": NodeListOf; + "noframes": NodeListOf; + "noscript": NodeListOf; + "object": NodeListOf; + "ol": NodeListOf; + "optgroup": NodeListOf; + "option": NodeListOf; + "output": NodeListOf; + "p": NodeListOf; + "param": NodeListOf; + "path": NodeListOf; + "pattern": NodeListOf; + "picture": NodeListOf; + "plaintext": NodeListOf; + "polygon": NodeListOf; + "polyline": NodeListOf; + "pre": NodeListOf; + "progress": NodeListOf; + "q": NodeListOf; + "radialgradient": NodeListOf; + "rect": NodeListOf; + "rt": NodeListOf; + "ruby": NodeListOf; + "s": NodeListOf; + "samp": NodeListOf; + "script": NodeListOf; + "section": NodeListOf; + "select": NodeListOf; + "small": NodeListOf; + "source": NodeListOf; + "span": NodeListOf; + "stop": NodeListOf; + "strike": NodeListOf; + "strong": NodeListOf; + "style": NodeListOf; + "sub": NodeListOf; + "sup": NodeListOf; + "svg": NodeListOf; + "switch": NodeListOf; + "symbol": NodeListOf; + "table": NodeListOf; + "tbody": NodeListOf; + "td": NodeListOf; + "template": NodeListOf; + "text": NodeListOf; + "textpath": NodeListOf; + "textarea": NodeListOf; + "tfoot": NodeListOf; + "th": NodeListOf; + "thead": NodeListOf; + "time": NodeListOf; + "title": NodeListOf; + "tr": NodeListOf; + "track": NodeListOf; + "tspan": NodeListOf; + "tt": NodeListOf; + "u": NodeListOf; + "ul": NodeListOf; + "use": NodeListOf; + "var": NodeListOf; + "video": NodeListOf; + "view": NodeListOf; + "wbr": NodeListOf; + "x-ms-webview": NodeListOf; + "xmp": NodeListOf; +} + +declare var Audio: {new(src?: string): HTMLAudioElement; }; +declare var Image: {new(width?: number, height?: number): HTMLImageElement; }; +declare var Option: {new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; }; +declare var applicationCache: ApplicationCache; +declare var caches: CacheStorage; +declare var clientInformation: Navigator; +declare var closed: boolean; +declare var crypto: Crypto; +declare var defaultStatus: string; +declare var devicePixelRatio: number; +declare var doNotTrack: string; +declare var document: Document; +declare var event: Event | undefined; +declare var external: External; +declare var frameElement: Element; +declare var frames: Window; +declare var history: History; +declare var innerHeight: number; +declare var innerWidth: number; +declare var isSecureContext: boolean; +declare var length: number; +declare var location: Location; +declare var locationbar: BarProp; +declare var menubar: BarProp; +declare var msContentScript: ExtensionScriptApis; +declare var msCredentials: MSCredentials; +declare const name: never; +declare var navigator: Navigator; +declare var offscreenBuffering: string | boolean; +declare var onabort: (this: Window, ev: UIEvent) => any; +declare var onafterprint: (this: Window, ev: Event) => any; +declare var onbeforeprint: (this: Window, ev: Event) => any; +declare var onbeforeunload: (this: Window, ev: BeforeUnloadEvent) => any; +declare var onblur: (this: Window, ev: FocusEvent) => any; +declare var oncanplay: (this: Window, ev: Event) => any; +declare var oncanplaythrough: (this: Window, ev: Event) => any; +declare var onchange: (this: Window, ev: Event) => any; +declare var onclick: (this: Window, ev: MouseEvent) => any; +declare var oncompassneedscalibration: (this: Window, ev: Event) => any; +declare var oncontextmenu: (this: Window, ev: PointerEvent) => any; +declare var ondblclick: (this: Window, ev: MouseEvent) => any; +declare var ondevicelight: (this: Window, ev: DeviceLightEvent) => any; +declare var ondevicemotion: (this: Window, ev: DeviceMotionEvent) => any; +declare var ondeviceorientation: (this: Window, ev: DeviceOrientationEvent) => any; +declare var ondrag: (this: Window, ev: DragEvent) => any; +declare var ondragend: (this: Window, ev: DragEvent) => any; +declare var ondragenter: (this: Window, ev: DragEvent) => any; +declare var ondragleave: (this: Window, ev: DragEvent) => any; +declare var ondragover: (this: Window, ev: DragEvent) => any; +declare var ondragstart: (this: Window, ev: DragEvent) => any; +declare var ondrop: (this: Window, ev: DragEvent) => any; +declare var ondurationchange: (this: Window, ev: Event) => any; +declare var onemptied: (this: Window, ev: Event) => any; +declare var onended: (this: Window, ev: MediaStreamErrorEvent) => any; +declare var onerror: ErrorEventHandler; +declare var onfocus: (this: Window, ev: FocusEvent) => any; +declare var onhashchange: (this: Window, ev: HashChangeEvent) => any; +declare var oninput: (this: Window, ev: Event) => any; +declare var oninvalid: (this: Window, ev: Event) => any; +declare var onkeydown: (this: Window, ev: KeyboardEvent) => any; +declare var onkeypress: (this: Window, ev: KeyboardEvent) => any; +declare var onkeyup: (this: Window, ev: KeyboardEvent) => any; +declare var onload: (this: Window, ev: Event) => any; +declare var onloadeddata: (this: Window, ev: Event) => any; +declare var onloadedmetadata: (this: Window, ev: Event) => any; +declare var onloadstart: (this: Window, ev: Event) => any; +declare var onmessage: (this: Window, ev: MessageEvent) => any; +declare var onmousedown: (this: Window, ev: MouseEvent) => any; +declare var onmouseenter: (this: Window, ev: MouseEvent) => any; +declare var onmouseleave: (this: Window, ev: MouseEvent) => any; +declare var onmousemove: (this: Window, ev: MouseEvent) => any; +declare var onmouseout: (this: Window, ev: MouseEvent) => any; +declare var onmouseover: (this: Window, ev: MouseEvent) => any; +declare var onmouseup: (this: Window, ev: MouseEvent) => any; +declare var onmousewheel: (this: Window, ev: WheelEvent) => any; +declare var onmsgesturechange: (this: Window, ev: MSGestureEvent) => any; +declare var onmsgesturedoubletap: (this: Window, ev: MSGestureEvent) => any; +declare var onmsgestureend: (this: Window, ev: MSGestureEvent) => any; +declare var onmsgesturehold: (this: Window, ev: MSGestureEvent) => any; +declare var onmsgesturestart: (this: Window, ev: MSGestureEvent) => any; +declare var onmsgesturetap: (this: Window, ev: MSGestureEvent) => any; +declare var onmsinertiastart: (this: Window, ev: MSGestureEvent) => any; +declare var onmspointercancel: (this: Window, ev: MSPointerEvent) => any; +declare var onmspointerdown: (this: Window, ev: MSPointerEvent) => any; +declare var onmspointerenter: (this: Window, ev: MSPointerEvent) => any; +declare var onmspointerleave: (this: Window, ev: MSPointerEvent) => any; +declare var onmspointermove: (this: Window, ev: MSPointerEvent) => any; +declare var onmspointerout: (this: Window, ev: MSPointerEvent) => any; +declare var onmspointerover: (this: Window, ev: MSPointerEvent) => any; +declare var onmspointerup: (this: Window, ev: MSPointerEvent) => any; +declare var onoffline: (this: Window, ev: Event) => any; +declare var ononline: (this: Window, ev: Event) => any; +declare var onorientationchange: (this: Window, ev: Event) => any; +declare var onpagehide: (this: Window, ev: PageTransitionEvent) => any; +declare var onpageshow: (this: Window, ev: PageTransitionEvent) => any; +declare var onpause: (this: Window, ev: Event) => any; +declare var onplay: (this: Window, ev: Event) => any; +declare var onplaying: (this: Window, ev: Event) => any; +declare var onpopstate: (this: Window, ev: PopStateEvent) => any; +declare var onprogress: (this: Window, ev: ProgressEvent) => any; +declare var onratechange: (this: Window, ev: Event) => any; +declare var onreadystatechange: (this: Window, ev: ProgressEvent) => any; +declare var onreset: (this: Window, ev: Event) => any; +declare var onresize: (this: Window, ev: UIEvent) => any; +declare var onscroll: (this: Window, ev: UIEvent) => any; +declare var onseeked: (this: Window, ev: Event) => any; +declare var onseeking: (this: Window, ev: Event) => any; +declare var onselect: (this: Window, ev: UIEvent) => any; +declare var onstalled: (this: Window, ev: Event) => any; +declare var onstorage: (this: Window, ev: StorageEvent) => any; +declare var onsubmit: (this: Window, ev: Event) => any; +declare var onsuspend: (this: Window, ev: Event) => any; +declare var ontimeupdate: (this: Window, ev: Event) => any; +declare var ontouchcancel: (ev: TouchEvent) => any; +declare var ontouchend: (ev: TouchEvent) => any; +declare var ontouchmove: (ev: TouchEvent) => any; +declare var ontouchstart: (ev: TouchEvent) => any; +declare var onunload: (this: Window, ev: Event) => any; +declare var onvolumechange: (this: Window, ev: Event) => any; +declare var onwaiting: (this: Window, ev: Event) => any; +declare var opener: any; +declare var orientation: string | number; +declare var outerHeight: number; +declare var outerWidth: number; +declare var pageXOffset: number; +declare var pageYOffset: number; +declare var parent: Window; +declare var performance: Performance; +declare var personalbar: BarProp; +declare var screen: Screen; +declare var screenLeft: number; +declare var screenTop: number; +declare var screenX: number; +declare var screenY: number; +declare var scrollX: number; +declare var scrollY: number; +declare var scrollbars: BarProp; +declare var self: Window; +declare var speechSynthesis: SpeechSynthesis; +declare var status: string; +declare var statusbar: BarProp; +declare var styleMedia: StyleMedia; +declare var toolbar: BarProp; +declare var top: Window; +declare var window: Window; +declare var customElements: CustomElementRegistry; +declare function alert(message?: any): void; +declare function blur(): void; +declare function cancelAnimationFrame(handle: number): void; +declare function captureEvents(): void; +declare function close(): void; +declare function confirm(message?: string): boolean; +declare function departFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void; +declare function focus(): void; +declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; +declare function getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; +declare function getSelection(): Selection; +declare function matchMedia(mediaQuery: string): MediaQueryList; +declare function moveBy(x?: number, y?: number): void; +declare function moveTo(x?: number, y?: number): void; +declare function msWriteProfilerMark(profilerMarkName: string): void; +declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window; +declare function postMessage(message: any, targetOrigin: string, transfer?: any[]): void; +declare function print(): void; +declare function prompt(message?: string, _default?: string): string | null; +declare function releaseEvents(): void; +declare function requestAnimationFrame(callback: FrameRequestCallback): number; +declare function resizeBy(x?: number, y?: number): void; +declare function resizeTo(x?: number, y?: number): void; +declare function scroll(x?: number, y?: number): void; +declare function scrollBy(x?: number, y?: number): void; +declare function scrollTo(x?: number, y?: number): void; +declare function stop(): void; +declare function webkitCancelAnimationFrame(handle: number): void; +declare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; +declare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; +declare function webkitRequestAnimationFrame(callback: FrameRequestCallback): number; +declare function createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise; +declare function createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise; +declare function scroll(options?: ScrollToOptions): void; +declare function scrollTo(options?: ScrollToOptions): void; +declare function scrollBy(options?: ScrollToOptions): void; +declare function toString(): string; +declare function dispatchEvent(evt: Event): boolean; +declare function removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +declare function clearInterval(handle: number): void; +declare function clearTimeout(handle: number): void; +declare function setInterval(handler: (...args: any[]) => void, timeout: number): number; +declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; +declare function setTimeout(handler: (...args: any[]) => void, timeout: number): number; +declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; +declare function clearImmediate(handle: number): void; +declare function setImmediate(handler: (...args: any[]) => void): number; +declare function setImmediate(handler: any, ...args: any[]): number; +declare var sessionStorage: Storage; +declare var localStorage: Storage; +declare var console: Console; +declare var onpointercancel: (this: Window, ev: PointerEvent) => any; +declare var onpointerdown: (this: Window, ev: PointerEvent) => any; +declare var onpointerenter: (this: Window, ev: PointerEvent) => any; +declare var onpointerleave: (this: Window, ev: PointerEvent) => any; +declare var onpointermove: (this: Window, ev: PointerEvent) => any; +declare var onpointerout: (this: Window, ev: PointerEvent) => any; +declare var onpointerover: (this: Window, ev: PointerEvent) => any; +declare var onpointerup: (this: Window, ev: PointerEvent) => any; +declare var onwheel: (this: Window, ev: WheelEvent) => any; +declare var indexedDB: IDBFactory; +declare function atob(encodedString: string): string; +declare function btoa(rawString: string): string; +declare function fetch(input: RequestInfo, init?: RequestInit): Promise; +declare function addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, useCapture?: boolean): void; +declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +type AAGUID = string; +type AlgorithmIdentifier = string | Algorithm; +type BodyInit = any; +type ByteString = string; +type ConstrainBoolean = boolean | ConstrainBooleanParameters; +type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters; +type ConstrainDouble = number | ConstrainDoubleRange; +type ConstrainLong = number | ConstrainLongRange; +type CryptoOperationData = ArrayBufferView; +type GLbitfield = number; +type GLboolean = boolean; +type GLbyte = number; +type GLclampf = number; +type GLenum = number; +type GLfloat = number; +type GLint = number; +type GLintptr = number; +type GLshort = number; +type GLsizei = number; +type GLsizeiptr = number; +type GLubyte = number; +type GLuint = number; +type GLushort = number; +type HeadersInit = any; +type IDBKeyPath = string; +type KeyFormat = string; +type KeyType = string; +type KeyUsage = string; +type MSInboundPayload = MSVideoRecvPayload | MSAudioRecvPayload; +type MSLocalClientEvent = MSLocalClientEventBase | MSAudioLocalClientEvent; +type MSOutboundPayload = MSVideoSendPayload | MSAudioSendPayload; +type RTCIceGatherCandidate = RTCIceCandidateDictionary | RTCIceCandidateComplete; +type RTCTransport = RTCDtlsTransport | RTCSrtpSdesTransport; +type RequestInfo = Request | string; +type USVString = string; +type payloadtype = number; +type ScrollBehavior = "auto" | "instant" | "smooth"; +type ScrollLogicalPosition = "start" | "center" | "end" | "nearest"; +type IDBValidKey = number | string | Date | IDBArrayKey; +type BufferSource = ArrayBuffer | ArrayBufferView; +type MouseWheelEvent = WheelEvent; type ScrollRestoration = "auto" | "manual"; - - -///////////////////////////// -/// WorkerGlobalScope APIs -///////////////////////////// -// These are only available in a Web Worker -declare function importScripts(...urls: string[]): void; +type FormDataEntryValue = string | File; +type AppendMode = "segments" | "sequence"; +type AudioContextState = "suspended" | "running" | "closed"; +type BiquadFilterType = "lowpass" | "highpass" | "bandpass" | "lowshelf" | "highshelf" | "peaking" | "notch" | "allpass"; +type CanvasFillRule = "nonzero" | "evenodd"; +type ChannelCountMode = "max" | "clamped-max" | "explicit"; +type ChannelInterpretation = "speakers" | "discrete"; +type DistanceModelType = "linear" | "inverse" | "exponential"; +type ExpandGranularity = "character" | "word" | "sentence" | "textedit"; +type GamepadInputEmulationType = "mouse" | "keyboard" | "gamepad"; +type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique"; +type IDBRequestReadyState = "pending" | "done"; +type IDBTransactionMode = "readonly" | "readwrite" | "versionchange"; +type ListeningState = "inactive" | "active" | "disambiguation"; +type MSCredentialType = "FIDO_2_0"; +type MSIceAddrType = "os" | "stun" | "turn" | "peer-derived"; +type MSIceType = "failed" | "direct" | "relay"; +type MSStatsType = "description" | "localclientevent" | "inbound-network" | "outbound-network" | "inbound-payload" | "outbound-payload" | "transportdiagnostics"; +type MSTransportType = "Embedded" | "USB" | "NFC" | "BT"; +type MSWebViewPermissionState = "unknown" | "defer" | "allow" | "deny"; +type MSWebViewPermissionType = "geolocation" | "unlimitedIndexedDBQuota" | "media" | "pointerlock" | "webnotifications"; +type MediaDeviceKind = "audioinput" | "audiooutput" | "videoinput"; +type MediaKeyMessageType = "license-request" | "license-renewal" | "license-release" | "individualization-request"; +type MediaKeySessionType = "temporary" | "persistent-license" | "persistent-release-message"; +type MediaKeyStatus = "usable" | "expired" | "output-downscaled" | "output-not-allowed" | "status-pending" | "internal-error"; +type MediaKeysRequirement = "required" | "optional" | "not-allowed"; +type MediaStreamTrackState = "live" | "ended"; +type NavigationReason = "up" | "down" | "left" | "right"; +type NavigationType = "navigate" | "reload" | "back_forward" | "prerender"; +type NotificationDirection = "auto" | "ltr" | "rtl"; +type NotificationPermission = "default" | "denied" | "granted"; +type OscillatorType = "sine" | "square" | "sawtooth" | "triangle" | "custom"; +type OverSampleType = "none" | "2x" | "4x"; +type PanningModelType = "equalpower"; +type PaymentComplete = "success" | "fail" | ""; +type PaymentShippingType = "shipping" | "delivery" | "pickup"; +type PushEncryptionKeyName = "p256dh" | "auth"; +type PushPermissionState = "granted" | "denied" | "prompt"; +type RTCBundlePolicy = "balanced" | "max-compat" | "max-bundle"; +type RTCDegradationPreference = "maintain-framerate" | "maintain-resolution" | "balanced"; +type RTCDtlsRole = "auto" | "client" | "server"; +type RTCDtlsTransportState = "new" | "connecting" | "connected" | "closed"; +type RTCIceCandidateType = "host" | "srflx" | "prflx" | "relay"; +type RTCIceComponent = "RTP" | "RTCP"; +type RTCIceConnectionState = "new" | "checking" | "connected" | "completed" | "failed" | "disconnected" | "closed"; +type RTCIceGatherPolicy = "all" | "nohost" | "relay"; +type RTCIceGathererState = "new" | "gathering" | "complete"; +type RTCIceGatheringState = "new" | "gathering" | "complete"; +type RTCIceProtocol = "udp" | "tcp"; +type RTCIceRole = "controlling" | "controlled"; +type RTCIceTcpCandidateType = "active" | "passive" | "so"; +type RTCIceTransportPolicy = "none" | "relay" | "all"; +type RTCIceTransportState = "new" | "checking" | "connected" | "completed" | "disconnected" | "closed"; +type RTCSdpType = "offer" | "pranswer" | "answer"; +type RTCSignalingState = "stable" | "have-local-offer" | "have-remote-offer" | "have-local-pranswer" | "have-remote-pranswer" | "closed"; +type RTCStatsIceCandidatePairState = "frozen" | "waiting" | "inprogress" | "failed" | "succeeded" | "cancelled"; +type RTCStatsIceCandidateType = "host" | "serverreflexive" | "peerreflexive" | "relayed"; +type RTCStatsType = "inboundrtp" | "outboundrtp" | "session" | "datachannel" | "track" | "transport" | "candidatepair" | "localcandidate" | "remotecandidate"; +type ReferrerPolicy = "" | "no-referrer" | "no-referrer-when-downgrade" | "origin-only" | "origin-when-cross-origin" | "unsafe-url"; +type RequestCache = "default" | "no-store" | "reload" | "no-cache" | "force-cache"; +type RequestCredentials = "omit" | "same-origin" | "include"; +type RequestDestination = "" | "document" | "sharedworker" | "subresource" | "unknown" | "worker"; +type RequestMode = "navigate" | "same-origin" | "no-cors" | "cors"; +type RequestRedirect = "follow" | "error" | "manual"; +type RequestType = "" | "audio" | "font" | "image" | "script" | "style" | "track" | "video"; +type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect"; +type ScopedCredentialType = "ScopedCred"; +type ServiceWorkerState = "installing" | "installed" | "activating" | "activated" | "redundant"; +type Transport = "usb" | "nfc" | "ble"; +type VideoFacingModeEnum = "user" | "environment" | "left" | "right"; +type VisibilityState = "hidden" | "visible" | "prerender" | "unloaded"; +type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text"; - - -///////////////////////////// -/// Windows Script Host APIS -///////////////////////////// - - -interface ActiveXObject { - new (s: string): any; -} -declare var ActiveXObject: ActiveXObject; - -interface ITextWriter { - Write(s: string): void; - WriteLine(s: string): void; - Close(): void; -} - -interface TextStreamBase { - /** - * The column number of the current character position in an input stream. - */ - Column: number; - - /** - * The current line number in an input stream. - */ - Line: number; - - /** - * Closes a text stream. - * It is not necessary to close standard streams; they close automatically when the process ends. If - * you close a standard stream, be aware that any other pointers to that standard stream become invalid. - */ - Close(): void; -} - -interface TextStreamWriter extends TextStreamBase { - /** - * Sends a string to an output stream. - */ - Write(s: string): void; - - /** - * Sends a specified number of blank lines (newline characters) to an output stream. - */ - WriteBlankLines(intLines: number): void; - - /** - * Sends a string followed by a newline character to an output stream. - */ - WriteLine(s: string): void; -} - -interface TextStreamReader extends TextStreamBase { - /** - * Returns a specified number of characters from an input stream, starting at the current pointer position. - * Does not return until the ENTER key is pressed. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - */ - Read(characters: number): string; - - /** - * Returns all characters from an input stream. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - */ - ReadAll(): string; - - /** - * Returns an entire line from an input stream. - * Although this method extracts the newline character, it does not add it to the returned string. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - */ - ReadLine(): string; - - /** - * Skips a specified number of characters when reading from an input text stream. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.) - */ - Skip(characters: number): void; - - /** - * Skips the next line when reading from an input text stream. - * Can only be used on a stream in reading mode, not writing or appending mode. - */ - SkipLine(): void; - - /** - * Indicates whether the stream pointer position is at the end of a line. - */ - AtEndOfLine: boolean; - - /** - * Indicates whether the stream pointer position is at the end of a stream. - */ - AtEndOfStream: boolean; -} - -declare var WScript: { - /** - * Outputs text to either a message box (under WScript.exe) or the command console window followed by - * a newline (under CScript.exe). - */ - Echo(s: any): void; - - /** - * Exposes the write-only error output stream for the current script. - * Can be accessed only while using CScript.exe. - */ - StdErr: TextStreamWriter; - - /** - * Exposes the write-only output stream for the current script. - * Can be accessed only while using CScript.exe. - */ - StdOut: TextStreamWriter; - Arguments: { length: number; Item(n: number): string; }; - - /** - * The full path of the currently running script. - */ - ScriptFullName: string; - - /** - * Forces the script to stop immediately, with an optional exit code. - */ - Quit(exitCode?: number): number; - - /** - * The Windows Script Host build version number. - */ - BuildVersion: number; - - /** - * Fully qualified path of the host executable. - */ - FullName: string; - - /** - * Gets/sets the script mode - interactive(true) or batch(false). - */ - Interactive: boolean; - - /** - * The name of the host executable (WScript.exe or CScript.exe). - */ - Name: string; - - /** - * Path of the directory containing the host executable. - */ - Path: string; - - /** - * The filename of the currently running script. - */ - ScriptName: string; - - /** - * Exposes the read-only input stream for the current script. - * Can be accessed only while using CScript.exe. - */ - StdIn: TextStreamReader; - - /** - * Windows Script Host version - */ - Version: string; - - /** - * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event. - */ - ConnectObject(objEventSource: any, strPrefix: string): void; - - /** - * Creates a COM object. - * @param strProgiID - * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. - */ - CreateObject(strProgID: string, strPrefix?: string): any; - - /** - * Disconnects a COM object from its event sources. - */ - DisconnectObject(obj: any): void; - - /** - * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file. - * @param strPathname Fully qualified path to the file containing the object persisted to disk. - * For objects in memory, pass a zero-length string. - * @param strProgID - * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. - */ - GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; - - /** - * Suspends script execution for a specified length of time, then continues execution. - * @param intTime Interval (in milliseconds) to suspend script execution. - */ - Sleep(intTime: number): void; -}; - -/** - * Allows enumerating over a COM collection, which may not have indexed item access. - */ -interface Enumerator { - /** - * Returns true if the current item is the last one in the collection, or the collection is empty, - * or the current item is undefined. - */ - atEnd(): boolean; - - /** - * Returns the current item in the collection - */ - item(): T; - - /** - * Resets the current item in the collection to the first item. If there are no items in the collection, - * the current item is set to undefined. - */ - moveFirst(): void; - - /** - * Moves the current item to the next item in the collection. If the enumerator is at the end of - * the collection or the collection is empty, the current item is set to undefined. - */ - moveNext(): void; -} - -interface EnumeratorConstructor { - new (collection: any): Enumerator; - new (collection: any): Enumerator; -} - -declare var Enumerator: EnumeratorConstructor; - -/** - * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions. - */ -interface VBArray { - /** - * Returns the number of dimensions (1-based). - */ - dimensions(): number; - - /** - * Takes an index for each dimension in the array, and returns the item at the corresponding location. - */ - getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T; - - /** - * Returns the smallest available index for a given dimension. - * @param dimension 1-based dimension (defaults to 1) - */ - lbound(dimension?: number): number; - - /** - * Returns the largest available index for a given dimension. - * @param dimension 1-based dimension (defaults to 1) - */ - ubound(dimension?: number): number; - - /** - * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions, - * each successive dimension is appended to the end of the array. - * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6] - */ - toArray(): T[]; -} - -interface VBArrayConstructor { - new (safeArray: any): VBArray; - new (safeArray: any): VBArray; -} - -declare var VBArray: VBArrayConstructor; - -/** - * Automation date (VT_DATE) - */ -interface VarDate { } - -interface DateConstructor { - new (vd: VarDate): Date; -} - -interface Date { - getVarDate: () => VarDate; -} +///////////////////////////// +/// WorkerGlobalScope APIs +///////////////////////////// +// These are only available in a Web Worker +declare function importScripts(...urls: string[]): void; + + + + +///////////////////////////// +/// Windows Script Host APIS +///////////////////////////// + + +interface ActiveXObject { + new (s: string): any; +} +declare var ActiveXObject: ActiveXObject; + +interface ITextWriter { + Write(s: string): void; + WriteLine(s: string): void; + Close(): void; +} + +interface TextStreamBase { + /** + * The column number of the current character position in an input stream. + */ + Column: number; + + /** + * The current line number in an input stream. + */ + Line: number; + + /** + * Closes a text stream. + * It is not necessary to close standard streams; they close automatically when the process ends. If + * you close a standard stream, be aware that any other pointers to that standard stream become invalid. + */ + Close(): void; +} + +interface TextStreamWriter extends TextStreamBase { + /** + * Sends a string to an output stream. + */ + Write(s: string): void; + + /** + * Sends a specified number of blank lines (newline characters) to an output stream. + */ + WriteBlankLines(intLines: number): void; + + /** + * Sends a string followed by a newline character to an output stream. + */ + WriteLine(s: string): void; +} + +interface TextStreamReader extends TextStreamBase { + /** + * Returns a specified number of characters from an input stream, starting at the current pointer position. + * Does not return until the ENTER key is pressed. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + Read(characters: number): string; + + /** + * Returns all characters from an input stream. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + ReadAll(): string; + + /** + * Returns an entire line from an input stream. + * Although this method extracts the newline character, it does not add it to the returned string. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + ReadLine(): string; + + /** + * Skips a specified number of characters when reading from an input text stream. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.) + */ + Skip(characters: number): void; + + /** + * Skips the next line when reading from an input text stream. + * Can only be used on a stream in reading mode, not writing or appending mode. + */ + SkipLine(): void; + + /** + * Indicates whether the stream pointer position is at the end of a line. + */ + AtEndOfLine: boolean; + + /** + * Indicates whether the stream pointer position is at the end of a stream. + */ + AtEndOfStream: boolean; +} + +declare var WScript: { + /** + * Outputs text to either a message box (under WScript.exe) or the command console window followed by + * a newline (under CScript.exe). + */ + Echo(s: any): void; + + /** + * Exposes the write-only error output stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdErr: TextStreamWriter; + + /** + * Exposes the write-only output stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdOut: TextStreamWriter; + Arguments: { length: number; Item(n: number): string; }; + + /** + * The full path of the currently running script. + */ + ScriptFullName: string; + + /** + * Forces the script to stop immediately, with an optional exit code. + */ + Quit(exitCode?: number): number; + + /** + * The Windows Script Host build version number. + */ + BuildVersion: number; + + /** + * Fully qualified path of the host executable. + */ + FullName: string; + + /** + * Gets/sets the script mode - interactive(true) or batch(false). + */ + Interactive: boolean; + + /** + * The name of the host executable (WScript.exe or CScript.exe). + */ + Name: string; + + /** + * Path of the directory containing the host executable. + */ + Path: string; + + /** + * The filename of the currently running script. + */ + ScriptName: string; + + /** + * Exposes the read-only input stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdIn: TextStreamReader; + + /** + * Windows Script Host version + */ + Version: string; + + /** + * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event. + */ + ConnectObject(objEventSource: any, strPrefix: string): void; + + /** + * Creates a COM object. + * @param strProgiID + * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. + */ + CreateObject(strProgID: string, strPrefix?: string): any; + + /** + * Disconnects a COM object from its event sources. + */ + DisconnectObject(obj: any): void; + + /** + * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file. + * @param strPathname Fully qualified path to the file containing the object persisted to disk. + * For objects in memory, pass a zero-length string. + * @param strProgID + * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. + */ + GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; + + /** + * Suspends script execution for a specified length of time, then continues execution. + * @param intTime Interval (in milliseconds) to suspend script execution. + */ + Sleep(intTime: number): void; +}; + +/** + * Allows enumerating over a COM collection, which may not have indexed item access. + */ +interface Enumerator { + /** + * Returns true if the current item is the last one in the collection, or the collection is empty, + * or the current item is undefined. + */ + atEnd(): boolean; + + /** + * Returns the current item in the collection + */ + item(): T; + + /** + * Resets the current item in the collection to the first item. If there are no items in the collection, + * the current item is set to undefined. + */ + moveFirst(): void; + + /** + * Moves the current item to the next item in the collection. If the enumerator is at the end of + * the collection or the collection is empty, the current item is set to undefined. + */ + moveNext(): void; +} + +interface EnumeratorConstructor { + new (collection: any): Enumerator; + new (collection: any): Enumerator; +} + +declare var Enumerator: EnumeratorConstructor; + +/** + * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions. + */ +interface VBArray { + /** + * Returns the number of dimensions (1-based). + */ + dimensions(): number; + + /** + * Takes an index for each dimension in the array, and returns the item at the corresponding location. + */ + getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T; + + /** + * Returns the smallest available index for a given dimension. + * @param dimension 1-based dimension (defaults to 1) + */ + lbound(dimension?: number): number; + + /** + * Returns the largest available index for a given dimension. + * @param dimension 1-based dimension (defaults to 1) + */ + ubound(dimension?: number): number; + + /** + * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions, + * each successive dimension is appended to the end of the array. + * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6] + */ + toArray(): T[]; +} + +interface VBArrayConstructor { + new (safeArray: any): VBArray; + new (safeArray: any): VBArray; +} + +declare var VBArray: VBArrayConstructor; + +/** + * Automation date (VT_DATE) + */ +interface VarDate { } + +interface DateConstructor { + new (vd: VarDate): Date; +} + +interface Date { + getVarDate: () => VarDate; +} diff --git a/node_modules/typescript/lib/lib.dom.d.ts b/node_modules/typescript/lib/lib.dom.d.ts index 8fb1b0b0a..94fb13c32 100644 --- a/node_modules/typescript/lib/lib.dom.d.ts +++ b/node_modules/typescript/lib/lib.dom.d.ts @@ -1,13738 +1,15056 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ -/// + +/// - -///////////////////////////// -/// IE DOM APIs -///////////////////////////// - -interface Algorithm { - name: string; -} - -interface AriaRequestEventInit extends EventInit { - attributeName?: string; - attributeValue?: string; -} - -interface CommandEventInit extends EventInit { - commandName?: string; - detail?: string; -} - -interface CompositionEventInit extends UIEventInit { - data?: string; -} - -interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation { - arrayOfDomainStrings?: string[]; -} - -interface ConstrainBooleanParameters { - exact?: boolean; - ideal?: boolean; -} - -interface ConstrainDOMStringParameters { - exact?: string | string[]; - ideal?: string | string[]; -} - -interface ConstrainDoubleRange extends DoubleRange { - exact?: number; - ideal?: number; -} - -interface ConstrainLongRange extends LongRange { - exact?: number; - ideal?: number; -} - -interface ConstrainVideoFacingModeParameters { - exact?: string | string[]; - ideal?: string | string[]; -} - -interface CustomEventInit extends EventInit { - detail?: any; -} - -interface DeviceAccelerationDict { - x?: number; - y?: number; - z?: number; -} - -interface DeviceLightEventInit extends EventInit { - value?: number; -} - -interface DeviceRotationRateDict { - alpha?: number; - beta?: number; - gamma?: number; -} - -interface DoubleRange { - max?: number; - min?: number; -} - -interface EventInit { - scoped?: boolean; - bubbles?: boolean; - cancelable?: boolean; -} - -interface EventModifierInit extends UIEventInit { - ctrlKey?: boolean; - shiftKey?: boolean; - altKey?: boolean; - metaKey?: boolean; - modifierAltGraph?: boolean; - modifierCapsLock?: boolean; - modifierFn?: boolean; - modifierFnLock?: boolean; - modifierHyper?: boolean; - modifierNumLock?: boolean; - modifierOS?: boolean; - modifierScrollLock?: boolean; - modifierSuper?: boolean; - modifierSymbol?: boolean; - modifierSymbolLock?: boolean; -} - -interface ExceptionInformation { - domain?: string; -} - -interface FocusEventInit extends UIEventInit { - relatedTarget?: EventTarget; -} - -interface HashChangeEventInit extends EventInit { - newURL?: string; - oldURL?: string; -} - -interface IDBIndexParameters { - multiEntry?: boolean; - unique?: boolean; -} - -interface IDBObjectStoreParameters { - autoIncrement?: boolean; - keyPath?: IDBKeyPath; -} - -interface KeyAlgorithm { - name?: string; -} - -interface KeyboardEventInit extends EventModifierInit { - code?: string; - key?: string; - location?: number; - repeat?: boolean; -} - -interface LongRange { - max?: number; - min?: number; -} - -interface MSAccountInfo { - rpDisplayName?: string; - userDisplayName?: string; - accountName?: string; - userId?: string; - accountImageUri?: string; -} - -interface MSAudioLocalClientEvent extends MSLocalClientEventBase { - networkSendQualityEventRatio?: number; - networkDelayEventRatio?: number; - cpuInsufficientEventRatio?: number; - deviceHalfDuplexAECEventRatio?: number; - deviceRenderNotFunctioningEventRatio?: number; - deviceCaptureNotFunctioningEventRatio?: number; - deviceGlitchesEventRatio?: number; - deviceLowSNREventRatio?: number; - deviceLowSpeechLevelEventRatio?: number; - deviceClippingEventRatio?: number; - deviceEchoEventRatio?: number; - deviceNearEndToEchoRatioEventRatio?: number; - deviceRenderZeroVolumeEventRatio?: number; - deviceRenderMuteEventRatio?: number; - deviceMultipleEndpointsEventCount?: number; - deviceHowlingEventCount?: number; -} - -interface MSAudioRecvPayload extends MSPayloadBase { - samplingRate?: number; - signal?: MSAudioRecvSignal; - packetReorderRatio?: number; - packetReorderDepthAvg?: number; - packetReorderDepthMax?: number; - burstLossLength1?: number; - burstLossLength2?: number; - burstLossLength3?: number; - burstLossLength4?: number; - burstLossLength5?: number; - burstLossLength6?: number; - burstLossLength7?: number; - burstLossLength8OrHigher?: number; - fecRecvDistance1?: number; - fecRecvDistance2?: number; - fecRecvDistance3?: number; - ratioConcealedSamplesAvg?: number; - ratioStretchedSamplesAvg?: number; - ratioCompressedSamplesAvg?: number; -} - -interface MSAudioRecvSignal { - initialSignalLevelRMS?: number; - recvSignalLevelCh1?: number; - recvNoiseLevelCh1?: number; - renderSignalLevel?: number; - renderNoiseLevel?: number; - renderLoopbackSignalLevel?: number; -} - -interface MSAudioSendPayload extends MSPayloadBase { - samplingRate?: number; - signal?: MSAudioSendSignal; - audioFECUsed?: boolean; - sendMutePercent?: number; -} - -interface MSAudioSendSignal { - noiseLevel?: number; - sendSignalLevelCh1?: number; - sendNoiseLevelCh1?: number; -} - -interface MSConnectivity { - iceType?: string; - iceWarningFlags?: MSIceWarningFlags; - relayAddress?: MSRelayAddress; -} - -interface MSCredentialFilter { - accept?: MSCredentialSpec[]; -} - -interface MSCredentialParameters { - type?: string; -} - -interface MSCredentialSpec { - type?: string; - id?: string; -} - -interface MSDelay { - roundTrip?: number; - roundTripMax?: number; -} - -interface MSDescription extends RTCStats { - connectivity?: MSConnectivity; - transport?: string; - networkconnectivity?: MSNetworkConnectivityInfo; - localAddr?: MSIPAddressInfo; - remoteAddr?: MSIPAddressInfo; - deviceDevName?: string; - reflexiveLocalIPAddr?: MSIPAddressInfo; -} - -interface MSFIDOCredentialParameters extends MSCredentialParameters { - algorithm?: string | Algorithm; - authenticators?: AAGUID[]; -} - -interface MSIPAddressInfo { - ipAddr?: string; - port?: number; - manufacturerMacAddrMask?: string; -} - -interface MSIceWarningFlags { - turnTcpTimedOut?: boolean; - turnUdpAllocateFailed?: boolean; - turnUdpSendFailed?: boolean; - turnTcpAllocateFailed?: boolean; - turnTcpSendFailed?: boolean; - udpLocalConnectivityFailed?: boolean; - udpNatConnectivityFailed?: boolean; - udpRelayConnectivityFailed?: boolean; - tcpNatConnectivityFailed?: boolean; - tcpRelayConnectivityFailed?: boolean; - connCheckMessageIntegrityFailed?: boolean; - allocationMessageIntegrityFailed?: boolean; - connCheckOtherError?: boolean; - turnAuthUnknownUsernameError?: boolean; - noRelayServersConfigured?: boolean; - multipleRelayServersAttempted?: boolean; - portRangeExhausted?: boolean; - alternateServerReceived?: boolean; - pseudoTLSFailure?: boolean; - turnTurnTcpConnectivityFailed?: boolean; - useCandidateChecksFailed?: boolean; - fipsAllocationFailure?: boolean; -} - -interface MSJitter { - interArrival?: number; - interArrivalMax?: number; - interArrivalSD?: number; -} - -interface MSLocalClientEventBase extends RTCStats { - networkReceiveQualityEventRatio?: number; - networkBandwidthLowEventRatio?: number; -} - -interface MSNetwork extends RTCStats { - jitter?: MSJitter; - delay?: MSDelay; - packetLoss?: MSPacketLoss; - utilization?: MSUtilization; -} - -interface MSNetworkConnectivityInfo { - vpn?: boolean; - linkspeed?: number; - networkConnectionDetails?: string; -} - -interface MSNetworkInterfaceType { - interfaceTypeEthernet?: boolean; - interfaceTypeWireless?: boolean; - interfaceTypePPP?: boolean; - interfaceTypeTunnel?: boolean; - interfaceTypeWWAN?: boolean; -} - -interface MSOutboundNetwork extends MSNetwork { - appliedBandwidthLimit?: number; -} - -interface MSPacketLoss { - lossRate?: number; - lossRateMax?: number; -} - -interface MSPayloadBase extends RTCStats { - payloadDescription?: string; -} - -interface MSRelayAddress { - relayAddress?: string; - port?: number; -} - -interface MSSignatureParameters { - userPrompt?: string; -} - -interface MSTransportDiagnosticsStats extends RTCStats { - baseAddress?: string; - localAddress?: string; - localSite?: string; - networkName?: string; - remoteAddress?: string; - remoteSite?: string; - localMR?: string; - remoteMR?: string; - iceWarningFlags?: MSIceWarningFlags; - portRangeMin?: number; - portRangeMax?: number; - localMRTCPPort?: number; - remoteMRTCPPort?: number; - stunVer?: number; - numConsentReqSent?: number; - numConsentReqReceived?: number; - numConsentRespSent?: number; - numConsentRespReceived?: number; - interfaces?: MSNetworkInterfaceType; - baseInterface?: MSNetworkInterfaceType; - protocol?: string; - localInterface?: MSNetworkInterfaceType; - localAddrType?: string; - remoteAddrType?: string; - iceRole?: string; - rtpRtcpMux?: boolean; - allocationTimeInMs?: number; - msRtcEngineVersion?: string; -} - -interface MSUtilization { - packets?: number; - bandwidthEstimation?: number; - bandwidthEstimationMin?: number; - bandwidthEstimationMax?: number; - bandwidthEstimationStdDev?: number; - bandwidthEstimationAvg?: number; -} - -interface MSVideoPayload extends MSPayloadBase { - resoluton?: string; - videoBitRateAvg?: number; - videoBitRateMax?: number; - videoFrameRateAvg?: number; - videoPacketLossRate?: number; - durationSeconds?: number; -} - -interface MSVideoRecvPayload extends MSVideoPayload { - videoFrameLossRate?: number; - recvCodecType?: string; - recvResolutionWidth?: number; - recvResolutionHeight?: number; - videoResolutions?: MSVideoResolutionDistribution; - recvFrameRateAverage?: number; - recvBitRateMaximum?: number; - recvBitRateAverage?: number; - recvVideoStreamsMax?: number; - recvVideoStreamsMin?: number; - recvVideoStreamsMode?: number; - videoPostFECPLR?: number; - lowBitRateCallPercent?: number; - lowFrameRateCallPercent?: number; - reorderBufferTotalPackets?: number; - recvReorderBufferReorderedPackets?: number; - recvReorderBufferPacketsDroppedDueToBufferExhaustion?: number; - recvReorderBufferMaxSuccessfullyOrderedExtent?: number; - recvReorderBufferMaxSuccessfullyOrderedLateTime?: number; - recvReorderBufferPacketsDroppedDueToTimeout?: number; - recvFpsHarmonicAverage?: number; - recvNumResSwitches?: number; -} - -interface MSVideoResolutionDistribution { - cifQuality?: number; - vgaQuality?: number; - h720Quality?: number; - h1080Quality?: number; - h1440Quality?: number; - h2160Quality?: number; -} - -interface MSVideoSendPayload extends MSVideoPayload { - sendFrameRateAverage?: number; - sendBitRateMaximum?: number; - sendBitRateAverage?: number; - sendVideoStreamsMax?: number; - sendResolutionWidth?: number; - sendResolutionHeight?: number; -} - -interface MediaEncryptedEventInit extends EventInit { - initDataType?: string; - initData?: ArrayBuffer; -} - -interface MediaKeyMessageEventInit extends EventInit { - messageType?: string; - message?: ArrayBuffer; -} - -interface MediaKeySystemConfiguration { - initDataTypes?: string[]; - audioCapabilities?: MediaKeySystemMediaCapability[]; - videoCapabilities?: MediaKeySystemMediaCapability[]; - distinctiveIdentifier?: string; - persistentState?: string; -} - -interface MediaKeySystemMediaCapability { - contentType?: string; - robustness?: string; -} - -interface MediaStreamConstraints { - video?: boolean | MediaTrackConstraints; - audio?: boolean | MediaTrackConstraints; -} - -interface MediaStreamErrorEventInit extends EventInit { - error?: MediaStreamError; -} - -interface MediaStreamTrackEventInit extends EventInit { - track?: MediaStreamTrack; -} - -interface MediaTrackCapabilities { - width?: number | LongRange; - height?: number | LongRange; - aspectRatio?: number | DoubleRange; - frameRate?: number | DoubleRange; - facingMode?: string; - volume?: number | DoubleRange; - sampleRate?: number | LongRange; - sampleSize?: number | LongRange; - echoCancellation?: boolean[]; - deviceId?: string; - groupId?: string; -} - -interface MediaTrackConstraintSet { - width?: number | ConstrainLongRange; - height?: number | ConstrainLongRange; - aspectRatio?: number | ConstrainDoubleRange; - frameRate?: number | ConstrainDoubleRange; - facingMode?: string | string[] | ConstrainDOMStringParameters; - volume?: number | ConstrainDoubleRange; - sampleRate?: number | ConstrainLongRange; - sampleSize?: number | ConstrainLongRange; - echoCancelation?: boolean | ConstrainBooleanParameters; - deviceId?: string | string[] | ConstrainDOMStringParameters; - groupId?: string | string[] | ConstrainDOMStringParameters; -} - -interface MediaTrackConstraints extends MediaTrackConstraintSet { - advanced?: MediaTrackConstraintSet[]; -} - -interface MediaTrackSettings { - width?: number; - height?: number; - aspectRatio?: number; - frameRate?: number; - facingMode?: string; - volume?: number; - sampleRate?: number; - sampleSize?: number; - echoCancellation?: boolean; - deviceId?: string; - groupId?: string; -} - -interface MediaTrackSupportedConstraints { - width?: boolean; - height?: boolean; - aspectRatio?: boolean; - frameRate?: boolean; - facingMode?: boolean; - volume?: boolean; - sampleRate?: boolean; - sampleSize?: boolean; - echoCancellation?: boolean; - deviceId?: boolean; - groupId?: boolean; -} - -interface MouseEventInit extends EventModifierInit { - screenX?: number; - screenY?: number; - clientX?: number; - clientY?: number; - button?: number; - buttons?: number; - relatedTarget?: EventTarget; -} - -interface MsZoomToOptions { - contentX?: number; - contentY?: number; - viewportX?: string; - viewportY?: string; - scaleFactor?: number; - animate?: string; -} - -interface MutationObserverInit { - childList?: boolean; - attributes?: boolean; - characterData?: boolean; - subtree?: boolean; - attributeOldValue?: boolean; - characterDataOldValue?: boolean; - attributeFilter?: string[]; -} - -interface ObjectURLOptions { - oneTimeOnly?: boolean; -} - -interface PeriodicWaveConstraints { - disableNormalization?: boolean; -} - -interface PointerEventInit extends MouseEventInit { - pointerId?: number; - width?: number; - height?: number; - pressure?: number; - tiltX?: number; - tiltY?: number; - pointerType?: string; - isPrimary?: boolean; -} - -interface PositionOptions { - enableHighAccuracy?: boolean; - timeout?: number; - maximumAge?: number; -} - -interface RTCDTMFToneChangeEventInit extends EventInit { - tone?: string; -} - -interface RTCDtlsFingerprint { - algorithm?: string; - value?: string; -} - -interface RTCDtlsParameters { - role?: string; - fingerprints?: RTCDtlsFingerprint[]; -} - -interface RTCIceCandidate { - foundation?: string; - priority?: number; - ip?: string; - protocol?: string; - port?: number; - type?: string; - tcpType?: string; - relatedAddress?: string; - relatedPort?: number; -} - -interface RTCIceCandidateAttributes extends RTCStats { - ipAddress?: string; - portNumber?: number; - transport?: string; - candidateType?: string; - priority?: number; - addressSourceUrl?: string; -} - -interface RTCIceCandidateComplete { -} - -interface RTCIceCandidatePair { - local?: RTCIceCandidate; - remote?: RTCIceCandidate; -} - -interface RTCIceCandidatePairStats extends RTCStats { - transportId?: string; - localCandidateId?: string; - remoteCandidateId?: string; - state?: string; - priority?: number; - nominated?: boolean; - writable?: boolean; - readable?: boolean; - bytesSent?: number; - bytesReceived?: number; - roundTripTime?: number; - availableOutgoingBitrate?: number; - availableIncomingBitrate?: number; -} - -interface RTCIceGatherOptions { - gatherPolicy?: string; - iceservers?: RTCIceServer[]; -} - -interface RTCIceParameters { - usernameFragment?: string; - password?: string; -} - -interface RTCIceServer { - urls?: any; - username?: string; - credential?: string; -} - -interface RTCInboundRTPStreamStats extends RTCRTPStreamStats { - packetsReceived?: number; - bytesReceived?: number; - packetsLost?: number; - jitter?: number; - fractionLost?: number; -} - -interface RTCMediaStreamTrackStats extends RTCStats { - trackIdentifier?: string; - remoteSource?: boolean; - ssrcIds?: string[]; - frameWidth?: number; - frameHeight?: number; - framesPerSecond?: number; - framesSent?: number; - framesReceived?: number; - framesDecoded?: number; - framesDropped?: number; - framesCorrupted?: number; - audioLevel?: number; - echoReturnLoss?: number; - echoReturnLossEnhancement?: number; -} - -interface RTCOutboundRTPStreamStats extends RTCRTPStreamStats { - packetsSent?: number; - bytesSent?: number; - targetBitrate?: number; - roundTripTime?: number; -} - -interface RTCRTPStreamStats extends RTCStats { - ssrc?: string; - associateStatsId?: string; - isRemote?: boolean; - mediaTrackId?: string; - transportId?: string; - codecId?: string; - firCount?: number; - pliCount?: number; - nackCount?: number; - sliCount?: number; -} - -interface RTCRtcpFeedback { - type?: string; - parameter?: string; -} - -interface RTCRtcpParameters { - ssrc?: number; - cname?: string; - reducedSize?: boolean; - mux?: boolean; -} - -interface RTCRtpCapabilities { - codecs?: RTCRtpCodecCapability[]; - headerExtensions?: RTCRtpHeaderExtension[]; - fecMechanisms?: string[]; -} - -interface RTCRtpCodecCapability { - name?: string; - kind?: string; - clockRate?: number; - preferredPayloadType?: number; - maxptime?: number; - numChannels?: number; - rtcpFeedback?: RTCRtcpFeedback[]; - parameters?: any; - options?: any; - maxTemporalLayers?: number; - maxSpatialLayers?: number; - svcMultiStreamSupport?: boolean; -} - -interface RTCRtpCodecParameters { - name?: string; - payloadType?: any; - clockRate?: number; - maxptime?: number; - numChannels?: number; - rtcpFeedback?: RTCRtcpFeedback[]; - parameters?: any; -} - -interface RTCRtpContributingSource { - timestamp?: number; - csrc?: number; - audioLevel?: number; -} - -interface RTCRtpEncodingParameters { - ssrc?: number; - codecPayloadType?: number; - fec?: RTCRtpFecParameters; - rtx?: RTCRtpRtxParameters; - priority?: number; - maxBitrate?: number; - minQuality?: number; - framerateBias?: number; - resolutionScale?: number; - framerateScale?: number; - active?: boolean; - encodingId?: string; - dependencyEncodingIds?: string[]; - ssrcRange?: RTCSsrcRange; -} - -interface RTCRtpFecParameters { - ssrc?: number; - mechanism?: string; -} - -interface RTCRtpHeaderExtension { - kind?: string; - uri?: string; - preferredId?: number; - preferredEncrypt?: boolean; -} - -interface RTCRtpHeaderExtensionParameters { - uri?: string; - id?: number; - encrypt?: boolean; -} - -interface RTCRtpParameters { - muxId?: string; - codecs?: RTCRtpCodecParameters[]; - headerExtensions?: RTCRtpHeaderExtensionParameters[]; - encodings?: RTCRtpEncodingParameters[]; - rtcp?: RTCRtcpParameters; -} - -interface RTCRtpRtxParameters { - ssrc?: number; -} - -interface RTCRtpUnhandled { - ssrc?: number; - payloadType?: number; - muxId?: string; -} - -interface RTCSrtpKeyParam { - keyMethod?: string; - keySalt?: string; - lifetime?: string; - mkiValue?: number; - mkiLength?: number; -} - -interface RTCSrtpSdesParameters { - tag?: number; - cryptoSuite?: string; - keyParams?: RTCSrtpKeyParam[]; - sessionParams?: string[]; -} - -interface RTCSsrcRange { - min?: number; - max?: number; -} - -interface RTCStats { - timestamp?: number; - type?: string; - id?: string; - msType?: string; -} - -interface RTCStatsReport { -} - -interface RTCTransportStats extends RTCStats { - bytesSent?: number; - bytesReceived?: number; - rtcpTransportStatsId?: string; - activeConnection?: boolean; - selectedCandidatePairId?: string; - localCertificateId?: string; - remoteCertificateId?: string; -} - -interface StoreExceptionsInformation extends ExceptionInformation { - siteName?: string; - explanationString?: string; - detailURI?: string; -} - -interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { - arrayOfDomainStrings?: string[]; -} - -interface UIEventInit extends EventInit { - view?: Window; - detail?: number; -} - -interface WebGLContextAttributes { - failIfMajorPerformanceCaveat?: boolean; - alpha?: boolean; - depth?: boolean; - stencil?: boolean; - antialias?: boolean; - premultipliedAlpha?: boolean; - preserveDrawingBuffer?: boolean; -} - -interface WebGLContextEventInit extends EventInit { - statusMessage?: string; -} - -interface WheelEventInit extends MouseEventInit { - deltaX?: number; - deltaY?: number; - deltaZ?: number; - deltaMode?: number; -} - -interface EventListener { - (evt: Event): void; -} - -interface ANGLE_instanced_arrays { - drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void; - drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void; - vertexAttribDivisorANGLE(index: number, divisor: number): void; - readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; -} - -declare var ANGLE_instanced_arrays: { - prototype: ANGLE_instanced_arrays; - new(): ANGLE_instanced_arrays; - readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; -} - -interface AnalyserNode extends AudioNode { - fftSize: number; - readonly frequencyBinCount: number; - maxDecibels: number; - minDecibels: number; - smoothingTimeConstant: number; - getByteFrequencyData(array: Uint8Array): void; - getByteTimeDomainData(array: Uint8Array): void; - getFloatFrequencyData(array: Float32Array): void; - getFloatTimeDomainData(array: Float32Array): void; -} - -declare var AnalyserNode: { - prototype: AnalyserNode; - new(): AnalyserNode; -} - -interface AnimationEvent extends Event { - readonly animationName: string; - readonly elapsedTime: number; - initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; -} - -declare var AnimationEvent: { - prototype: AnimationEvent; - new(): AnimationEvent; -} - -interface ApplicationCacheEventMap { - "cached": Event; - "checking": Event; - "downloading": Event; - "error": ErrorEvent; - "noupdate": Event; - "obsolete": Event; - "progress": ProgressEvent; - "updateready": Event; -} - -interface ApplicationCache extends EventTarget { - oncached: (this: ApplicationCache, ev: Event) => any; - onchecking: (this: ApplicationCache, ev: Event) => any; - ondownloading: (this: ApplicationCache, ev: Event) => any; - onerror: (this: ApplicationCache, ev: ErrorEvent) => any; - onnoupdate: (this: ApplicationCache, ev: Event) => any; - onobsolete: (this: ApplicationCache, ev: Event) => any; - onprogress: (this: ApplicationCache, ev: ProgressEvent) => any; - onupdateready: (this: ApplicationCache, ev: Event) => any; - readonly status: number; - abort(): void; - swapCache(): void; - update(): void; - readonly CHECKING: number; - readonly DOWNLOADING: number; - readonly IDLE: number; - readonly OBSOLETE: number; - readonly UNCACHED: number; - readonly UPDATEREADY: number; - addEventListener(type: K, listener: (this: ApplicationCache, ev: ApplicationCacheEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var ApplicationCache: { - prototype: ApplicationCache; - new(): ApplicationCache; - readonly CHECKING: number; - readonly DOWNLOADING: number; - readonly IDLE: number; - readonly OBSOLETE: number; - readonly UNCACHED: number; - readonly UPDATEREADY: number; -} - -interface AriaRequestEvent extends Event { - readonly attributeName: string; - attributeValue: string | null; -} - -declare var AriaRequestEvent: { - prototype: AriaRequestEvent; - new(type: string, eventInitDict?: AriaRequestEventInit): AriaRequestEvent; -} - -interface Attr extends Node { - readonly name: string; - readonly ownerElement: Element; - readonly prefix: string | null; - readonly specified: boolean; - value: string; -} - -declare var Attr: { - prototype: Attr; - new(): Attr; -} - -interface AudioBuffer { - readonly duration: number; - readonly length: number; - readonly numberOfChannels: number; - readonly sampleRate: number; - copyFromChannel(destination: Float32Array, channelNumber: number, startInChannel?: number): void; - copyToChannel(source: Float32Array, channelNumber: number, startInChannel?: number): void; - getChannelData(channel: number): Float32Array; -} - -declare var AudioBuffer: { - prototype: AudioBuffer; - new(): AudioBuffer; -} - -interface AudioBufferSourceNodeEventMap { - "ended": MediaStreamErrorEvent; -} - -interface AudioBufferSourceNode extends AudioNode { - buffer: AudioBuffer | null; - readonly detune: AudioParam; - loop: boolean; - loopEnd: number; - loopStart: number; - onended: (this: AudioBufferSourceNode, ev: MediaStreamErrorEvent) => any; - readonly playbackRate: AudioParam; - start(when?: number, offset?: number, duration?: number): void; - stop(when?: number): void; - addEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioBufferSourceNodeEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var AudioBufferSourceNode: { - prototype: AudioBufferSourceNode; - new(): AudioBufferSourceNode; -} - -interface AudioContext extends EventTarget { - readonly currentTime: number; - readonly destination: AudioDestinationNode; - readonly listener: AudioListener; - readonly sampleRate: number; - state: string; - createAnalyser(): AnalyserNode; - createBiquadFilter(): BiquadFilterNode; - createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; - createBufferSource(): AudioBufferSourceNode; - createChannelMerger(numberOfInputs?: number): ChannelMergerNode; - createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode; - createConvolver(): ConvolverNode; - createDelay(maxDelayTime?: number): DelayNode; - createDynamicsCompressor(): DynamicsCompressorNode; - createGain(): GainNode; - createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode; - createMediaStreamSource(mediaStream: MediaStream): MediaStreamAudioSourceNode; - createOscillator(): OscillatorNode; - createPanner(): PannerNode; - createPeriodicWave(real: Float32Array, imag: Float32Array, constraints?: PeriodicWaveConstraints): PeriodicWave; - createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode; - createStereoPanner(): StereoPannerNode; - createWaveShaper(): WaveShaperNode; - decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): PromiseLike; -} - -declare var AudioContext: { - prototype: AudioContext; - new(): AudioContext; -} - -interface AudioDestinationNode extends AudioNode { - readonly maxChannelCount: number; -} - -declare var AudioDestinationNode: { - prototype: AudioDestinationNode; - new(): AudioDestinationNode; -} - -interface AudioListener { - dopplerFactor: number; - speedOfSound: number; - setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void; - setPosition(x: number, y: number, z: number): void; - setVelocity(x: number, y: number, z: number): void; -} - -declare var AudioListener: { - prototype: AudioListener; - new(): AudioListener; -} - -interface AudioNode extends EventTarget { - channelCount: number; - channelCountMode: string; - channelInterpretation: string; - readonly context: AudioContext; - readonly numberOfInputs: number; - readonly numberOfOutputs: number; - connect(destination: AudioNode, output?: number, input?: number): void; - disconnect(output?: number): void; - disconnect(destination: AudioNode, output?: number, input?: number): void; - disconnect(destination: AudioParam, output?: number): void; -} - -declare var AudioNode: { - prototype: AudioNode; - new(): AudioNode; -} - -interface AudioParam { - readonly defaultValue: number; - value: number; - cancelScheduledValues(startTime: number): void; - exponentialRampToValueAtTime(value: number, endTime: number): void; - linearRampToValueAtTime(value: number, endTime: number): void; - setTargetAtTime(target: number, startTime: number, timeConstant: number): void; - setValueAtTime(value: number, startTime: number): void; - setValueCurveAtTime(values: Float32Array, startTime: number, duration: number): void; -} - -declare var AudioParam: { - prototype: AudioParam; - new(): AudioParam; -} - -interface AudioProcessingEvent extends Event { - readonly inputBuffer: AudioBuffer; - readonly outputBuffer: AudioBuffer; - readonly playbackTime: number; -} - -declare var AudioProcessingEvent: { - prototype: AudioProcessingEvent; - new(): AudioProcessingEvent; -} - -interface AudioTrack { - enabled: boolean; - readonly id: string; - kind: string; - readonly label: string; - language: string; - readonly sourceBuffer: SourceBuffer; -} - -declare var AudioTrack: { - prototype: AudioTrack; - new(): AudioTrack; -} - -interface AudioTrackListEventMap { - "addtrack": TrackEvent; - "change": Event; - "removetrack": TrackEvent; -} - -interface AudioTrackList extends EventTarget { - readonly length: number; - onaddtrack: (this: AudioTrackList, ev: TrackEvent) => any; - onchange: (this: AudioTrackList, ev: Event) => any; - onremovetrack: (this: AudioTrackList, ev: TrackEvent) => any; - getTrackById(id: string): AudioTrack | null; - item(index: number): AudioTrack; - addEventListener(type: K, listener: (this: AudioTrackList, ev: AudioTrackListEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [index: number]: AudioTrack; -} - -declare var AudioTrackList: { - prototype: AudioTrackList; - new(): AudioTrackList; -} - -interface BarProp { - readonly visible: boolean; -} - -declare var BarProp: { - prototype: BarProp; - new(): BarProp; -} - -interface BeforeUnloadEvent extends Event { - returnValue: any; -} - -declare var BeforeUnloadEvent: { - prototype: BeforeUnloadEvent; - new(): BeforeUnloadEvent; -} - -interface BiquadFilterNode extends AudioNode { - readonly Q: AudioParam; - readonly detune: AudioParam; - readonly frequency: AudioParam; - readonly gain: AudioParam; - type: string; - getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void; -} - -declare var BiquadFilterNode: { - prototype: BiquadFilterNode; - new(): BiquadFilterNode; -} - -interface Blob { - readonly size: number; - readonly type: string; - msClose(): void; - msDetachStream(): any; - slice(start?: number, end?: number, contentType?: string): Blob; -} - -declare var Blob: { - prototype: Blob; - new (blobParts?: any[], options?: BlobPropertyBag): Blob; -} - -interface CDATASection extends Text { -} - -declare var CDATASection: { - prototype: CDATASection; - new(): CDATASection; -} - -interface CSS { - supports(property: string, value?: string): boolean; -} -declare var CSS: CSS; - -interface CSSConditionRule extends CSSGroupingRule { - conditionText: string; -} - -declare var CSSConditionRule: { - prototype: CSSConditionRule; - new(): CSSConditionRule; -} - -interface CSSFontFaceRule extends CSSRule { - readonly style: CSSStyleDeclaration; -} - -declare var CSSFontFaceRule: { - prototype: CSSFontFaceRule; - new(): CSSFontFaceRule; -} - -interface CSSGroupingRule extends CSSRule { - readonly cssRules: CSSRuleList; - deleteRule(index: number): void; - insertRule(rule: string, index: number): number; -} - -declare var CSSGroupingRule: { - prototype: CSSGroupingRule; - new(): CSSGroupingRule; -} - -interface CSSImportRule extends CSSRule { - readonly href: string; - readonly media: MediaList; - readonly styleSheet: CSSStyleSheet; -} - -declare var CSSImportRule: { - prototype: CSSImportRule; - new(): CSSImportRule; -} - -interface CSSKeyframeRule extends CSSRule { - keyText: string; - readonly style: CSSStyleDeclaration; -} - -declare var CSSKeyframeRule: { - prototype: CSSKeyframeRule; - new(): CSSKeyframeRule; -} - -interface CSSKeyframesRule extends CSSRule { - readonly cssRules: CSSRuleList; - name: string; - appendRule(rule: string): void; - deleteRule(rule: string): void; - findRule(rule: string): CSSKeyframeRule; -} - -declare var CSSKeyframesRule: { - prototype: CSSKeyframesRule; - new(): CSSKeyframesRule; -} - -interface CSSMediaRule extends CSSConditionRule { - readonly media: MediaList; -} - -declare var CSSMediaRule: { - prototype: CSSMediaRule; - new(): CSSMediaRule; -} - -interface CSSNamespaceRule extends CSSRule { - readonly namespaceURI: string; - readonly prefix: string; -} - -declare var CSSNamespaceRule: { - prototype: CSSNamespaceRule; - new(): CSSNamespaceRule; -} - -interface CSSPageRule extends CSSRule { - readonly pseudoClass: string; - readonly selector: string; - selectorText: string; - readonly style: CSSStyleDeclaration; -} - -declare var CSSPageRule: { - prototype: CSSPageRule; - new(): CSSPageRule; -} - -interface CSSRule { - cssText: string; - readonly parentRule: CSSRule; - readonly parentStyleSheet: CSSStyleSheet; - readonly type: number; - readonly CHARSET_RULE: number; - readonly FONT_FACE_RULE: number; - readonly IMPORT_RULE: number; - readonly KEYFRAMES_RULE: number; - readonly KEYFRAME_RULE: number; - readonly MEDIA_RULE: number; - readonly NAMESPACE_RULE: number; - readonly PAGE_RULE: number; - readonly STYLE_RULE: number; - readonly SUPPORTS_RULE: number; - readonly UNKNOWN_RULE: number; - readonly VIEWPORT_RULE: number; -} - -declare var CSSRule: { - prototype: CSSRule; - new(): CSSRule; - readonly CHARSET_RULE: number; - readonly FONT_FACE_RULE: number; - readonly IMPORT_RULE: number; - readonly KEYFRAMES_RULE: number; - readonly KEYFRAME_RULE: number; - readonly MEDIA_RULE: number; - readonly NAMESPACE_RULE: number; - readonly PAGE_RULE: number; - readonly STYLE_RULE: number; - readonly SUPPORTS_RULE: number; - readonly UNKNOWN_RULE: number; - readonly VIEWPORT_RULE: number; -} - -interface CSSRuleList { - readonly length: number; - item(index: number): CSSRule; - [index: number]: CSSRule; -} - -declare var CSSRuleList: { - prototype: CSSRuleList; - new(): CSSRuleList; -} - -interface CSSStyleDeclaration { - alignContent: string | null; - alignItems: string | null; - alignSelf: string | null; - alignmentBaseline: string | null; - animation: string | null; - animationDelay: string | null; - animationDirection: string | null; - animationDuration: string | null; - animationFillMode: string | null; - animationIterationCount: string | null; - animationName: string | null; - animationPlayState: string | null; - animationTimingFunction: string | null; - backfaceVisibility: string | null; - background: string | null; - backgroundAttachment: string | null; - backgroundClip: string | null; - backgroundColor: string | null; - backgroundImage: string | null; - backgroundOrigin: string | null; - backgroundPosition: string | null; - backgroundPositionX: string | null; - backgroundPositionY: string | null; - backgroundRepeat: string | null; - backgroundSize: string | null; - baselineShift: string | null; - border: string | null; - borderBottom: string | null; - borderBottomColor: string | null; - borderBottomLeftRadius: string | null; - borderBottomRightRadius: string | null; - borderBottomStyle: string | null; - borderBottomWidth: string | null; - borderCollapse: string | null; - borderColor: string | null; - borderImage: string | null; - borderImageOutset: string | null; - borderImageRepeat: string | null; - borderImageSlice: string | null; - borderImageSource: string | null; - borderImageWidth: string | null; - borderLeft: string | null; - borderLeftColor: string | null; - borderLeftStyle: string | null; - borderLeftWidth: string | null; - borderRadius: string | null; - borderRight: string | null; - borderRightColor: string | null; - borderRightStyle: string | null; - borderRightWidth: string | null; - borderSpacing: string | null; - borderStyle: string | null; - borderTop: string | null; - borderTopColor: string | null; - borderTopLeftRadius: string | null; - borderTopRightRadius: string | null; - borderTopStyle: string | null; - borderTopWidth: string | null; - borderWidth: string | null; - bottom: string | null; - boxShadow: string | null; - boxSizing: string | null; - breakAfter: string | null; - breakBefore: string | null; - breakInside: string | null; - captionSide: string | null; - clear: string | null; - clip: string | null; - clipPath: string | null; - clipRule: string | null; - color: string | null; - colorInterpolationFilters: string | null; - columnCount: any; - columnFill: string | null; - columnGap: any; - columnRule: string | null; - columnRuleColor: any; - columnRuleStyle: string | null; - columnRuleWidth: any; - columnSpan: string | null; - columnWidth: any; - columns: string | null; - content: string | null; - counterIncrement: string | null; - counterReset: string | null; - cssFloat: string | null; - cssText: string; - cursor: string | null; - direction: string | null; - display: string | null; - dominantBaseline: string | null; - emptyCells: string | null; - enableBackground: string | null; - fill: string | null; - fillOpacity: string | null; - fillRule: string | null; - filter: string | null; - flex: string | null; - flexBasis: string | null; - flexDirection: string | null; - flexFlow: string | null; - flexGrow: string | null; - flexShrink: string | null; - flexWrap: string | null; - floodColor: string | null; - floodOpacity: string | null; - font: string | null; - fontFamily: string | null; - fontFeatureSettings: string | null; - fontSize: string | null; - fontSizeAdjust: string | null; - fontStretch: string | null; - fontStyle: string | null; - fontVariant: string | null; - fontWeight: string | null; - glyphOrientationHorizontal: string | null; - glyphOrientationVertical: string | null; - height: string | null; - imeMode: string | null; - justifyContent: string | null; - kerning: string | null; - left: string | null; - readonly length: number; - letterSpacing: string | null; - lightingColor: string | null; - lineHeight: string | null; - listStyle: string | null; - listStyleImage: string | null; - listStylePosition: string | null; - listStyleType: string | null; - margin: string | null; - marginBottom: string | null; - marginLeft: string | null; - marginRight: string | null; - marginTop: string | null; - marker: string | null; - markerEnd: string | null; - markerMid: string | null; - markerStart: string | null; - mask: string | null; - maxHeight: string | null; - maxWidth: string | null; - minHeight: string | null; - minWidth: string | null; - msContentZoomChaining: string | null; - msContentZoomLimit: string | null; - msContentZoomLimitMax: any; - msContentZoomLimitMin: any; - msContentZoomSnap: string | null; - msContentZoomSnapPoints: string | null; - msContentZoomSnapType: string | null; - msContentZooming: string | null; - msFlowFrom: string | null; - msFlowInto: string | null; - msFontFeatureSettings: string | null; - msGridColumn: any; - msGridColumnAlign: string | null; - msGridColumnSpan: any; - msGridColumns: string | null; - msGridRow: any; - msGridRowAlign: string | null; - msGridRowSpan: any; - msGridRows: string | null; - msHighContrastAdjust: string | null; - msHyphenateLimitChars: string | null; - msHyphenateLimitLines: any; - msHyphenateLimitZone: any; - msHyphens: string | null; - msImeAlign: string | null; - msOverflowStyle: string | null; - msScrollChaining: string | null; - msScrollLimit: string | null; - msScrollLimitXMax: any; - msScrollLimitXMin: any; - msScrollLimitYMax: any; - msScrollLimitYMin: any; - msScrollRails: string | null; - msScrollSnapPointsX: string | null; - msScrollSnapPointsY: string | null; - msScrollSnapType: string | null; - msScrollSnapX: string | null; - msScrollSnapY: string | null; - msScrollTranslation: string | null; - msTextCombineHorizontal: string | null; - msTextSizeAdjust: any; - msTouchAction: string | null; - msTouchSelect: string | null; - msUserSelect: string | null; - msWrapFlow: string; - msWrapMargin: any; - msWrapThrough: string; - opacity: string | null; - order: string | null; - orphans: string | null; - outline: string | null; - outlineColor: string | null; - outlineStyle: string | null; - outlineWidth: string | null; - overflow: string | null; - overflowX: string | null; - overflowY: string | null; - padding: string | null; - paddingBottom: string | null; - paddingLeft: string | null; - paddingRight: string | null; - paddingTop: string | null; - pageBreakAfter: string | null; - pageBreakBefore: string | null; - pageBreakInside: string | null; - readonly parentRule: CSSRule; - perspective: string | null; - perspectiveOrigin: string | null; - pointerEvents: string | null; - position: string | null; - quotes: string | null; - right: string | null; - rubyAlign: string | null; - rubyOverhang: string | null; - rubyPosition: string | null; - stopColor: string | null; - stopOpacity: string | null; - stroke: string | null; - strokeDasharray: string | null; - strokeDashoffset: string | null; - strokeLinecap: string | null; - strokeLinejoin: string | null; - strokeMiterlimit: string | null; - strokeOpacity: string | null; - strokeWidth: string | null; - tableLayout: string | null; - textAlign: string | null; - textAlignLast: string | null; - textAnchor: string | null; - textDecoration: string | null; - textIndent: string | null; - textJustify: string | null; - textKashida: string | null; - textKashidaSpace: string | null; - textOverflow: string | null; - textShadow: string | null; - textTransform: string | null; - textUnderlinePosition: string | null; - top: string | null; - touchAction: string | null; - transform: string | null; - transformOrigin: string | null; - transformStyle: string | null; - transition: string | null; - transitionDelay: string | null; - transitionDuration: string | null; - transitionProperty: string | null; - transitionTimingFunction: string | null; - unicodeBidi: string | null; - verticalAlign: string | null; - visibility: string | null; - webkitAlignContent: string | null; - webkitAlignItems: string | null; - webkitAlignSelf: string | null; - webkitAnimation: string | null; - webkitAnimationDelay: string | null; - webkitAnimationDirection: string | null; - webkitAnimationDuration: string | null; - webkitAnimationFillMode: string | null; - webkitAnimationIterationCount: string | null; - webkitAnimationName: string | null; - webkitAnimationPlayState: string | null; - webkitAnimationTimingFunction: string | null; - webkitAppearance: string | null; - webkitBackfaceVisibility: string | null; - webkitBackgroundClip: string | null; - webkitBackgroundOrigin: string | null; - webkitBackgroundSize: string | null; - webkitBorderBottomLeftRadius: string | null; - webkitBorderBottomRightRadius: string | null; - webkitBorderImage: string | null; - webkitBorderRadius: string | null; - webkitBorderTopLeftRadius: string | null; - webkitBorderTopRightRadius: string | null; - webkitBoxAlign: string | null; - webkitBoxDirection: string | null; - webkitBoxFlex: string | null; - webkitBoxOrdinalGroup: string | null; - webkitBoxOrient: string | null; - webkitBoxPack: string | null; - webkitBoxSizing: string | null; - webkitColumnBreakAfter: string | null; - webkitColumnBreakBefore: string | null; - webkitColumnBreakInside: string | null; - webkitColumnCount: any; - webkitColumnGap: any; - webkitColumnRule: string | null; - webkitColumnRuleColor: any; - webkitColumnRuleStyle: string | null; - webkitColumnRuleWidth: any; - webkitColumnSpan: string | null; - webkitColumnWidth: any; - webkitColumns: string | null; - webkitFilter: string | null; - webkitFlex: string | null; - webkitFlexBasis: string | null; - webkitFlexDirection: string | null; - webkitFlexFlow: string | null; - webkitFlexGrow: string | null; - webkitFlexShrink: string | null; - webkitFlexWrap: string | null; - webkitJustifyContent: string | null; - webkitOrder: string | null; - webkitPerspective: string | null; - webkitPerspectiveOrigin: string | null; - webkitTapHighlightColor: string | null; - webkitTextFillColor: string | null; - webkitTextSizeAdjust: any; - webkitTransform: string | null; - webkitTransformOrigin: string | null; - webkitTransformStyle: string | null; - webkitTransition: string | null; - webkitTransitionDelay: string | null; - webkitTransitionDuration: string | null; - webkitTransitionProperty: string | null; - webkitTransitionTimingFunction: string | null; - webkitUserModify: string | null; - webkitUserSelect: string | null; - webkitWritingMode: string | null; - whiteSpace: string | null; - widows: string | null; - width: string | null; - wordBreak: string | null; - wordSpacing: string | null; - wordWrap: string | null; - writingMode: string | null; - zIndex: string | null; - zoom: string | null; - resize: string | null; - getPropertyPriority(propertyName: string): string; - getPropertyValue(propertyName: string): string; - item(index: number): string; - removeProperty(propertyName: string): string; - setProperty(propertyName: string, value: string | null, priority?: string): void; - [index: number]: string; -} - -declare var CSSStyleDeclaration: { - prototype: CSSStyleDeclaration; - new(): CSSStyleDeclaration; -} - -interface CSSStyleRule extends CSSRule { - readonly readOnly: boolean; - selectorText: string; - readonly style: CSSStyleDeclaration; -} - -declare var CSSStyleRule: { - prototype: CSSStyleRule; - new(): CSSStyleRule; -} - -interface CSSStyleSheet extends StyleSheet { - readonly cssRules: CSSRuleList; - cssText: string; - readonly href: string; - readonly id: string; - readonly imports: StyleSheetList; - readonly isAlternate: boolean; - readonly isPrefAlternate: boolean; - readonly ownerRule: CSSRule; - readonly owningElement: Element; - readonly pages: StyleSheetPageList; - readonly readOnly: boolean; - readonly rules: CSSRuleList; - addImport(bstrURL: string, lIndex?: number): number; - addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; - addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; - deleteRule(index?: number): void; - insertRule(rule: string, index?: number): number; - removeImport(lIndex: number): void; - removeRule(lIndex: number): void; -} - -declare var CSSStyleSheet: { - prototype: CSSStyleSheet; - new(): CSSStyleSheet; -} - -interface CSSSupportsRule extends CSSConditionRule { -} - -declare var CSSSupportsRule: { - prototype: CSSSupportsRule; - new(): CSSSupportsRule; -} - -interface CanvasGradient { - addColorStop(offset: number, color: string): void; -} - -declare var CanvasGradient: { - prototype: CanvasGradient; - new(): CanvasGradient; -} - -interface CanvasPattern { - setTransform(matrix: SVGMatrix): void; -} - -declare var CanvasPattern: { - prototype: CanvasPattern; - new(): CanvasPattern; -} - -interface CanvasRenderingContext2D extends Object, CanvasPathMethods { - readonly canvas: HTMLCanvasElement; - fillStyle: string | CanvasGradient | CanvasPattern; - font: string; - globalAlpha: number; - globalCompositeOperation: string; - lineCap: string; - lineDashOffset: number; - lineJoin: string; - lineWidth: number; - miterLimit: number; - msFillRule: string; - msImageSmoothingEnabled: boolean; - shadowBlur: number; - shadowColor: string; - shadowOffsetX: number; - shadowOffsetY: number; - strokeStyle: string | CanvasGradient | CanvasPattern; - textAlign: string; - textBaseline: string; - mozImageSmoothingEnabled: boolean; - webkitImageSmoothingEnabled: boolean; - oImageSmoothingEnabled: boolean; - beginPath(): void; - clearRect(x: number, y: number, w: number, h: number): void; - clip(fillRule?: string): void; - createImageData(imageDataOrSw: number | ImageData, sh?: number): ImageData; - createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; - createPattern(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, repetition: string): CanvasPattern; - createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; - drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; - fill(fillRule?: string): void; - fillRect(x: number, y: number, w: number, h: number): void; - fillText(text: string, x: number, y: number, maxWidth?: number): void; - getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; - getLineDash(): number[]; - isPointInPath(x: number, y: number, fillRule?: string): boolean; - measureText(text: string): TextMetrics; - putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; - restore(): void; - rotate(angle: number): void; - save(): void; - scale(x: number, y: number): void; - setLineDash(segments: number[]): void; - setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - stroke(): void; - strokeRect(x: number, y: number, w: number, h: number): void; - strokeText(text: string, x: number, y: number, maxWidth?: number): void; - transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - translate(x: number, y: number): void; -} - -declare var CanvasRenderingContext2D: { - prototype: CanvasRenderingContext2D; - new(): CanvasRenderingContext2D; -} - -interface ChannelMergerNode extends AudioNode { -} - -declare var ChannelMergerNode: { - prototype: ChannelMergerNode; - new(): ChannelMergerNode; -} - -interface ChannelSplitterNode extends AudioNode { -} - -declare var ChannelSplitterNode: { - prototype: ChannelSplitterNode; - new(): ChannelSplitterNode; -} - -interface CharacterData extends Node, ChildNode { - data: string; - readonly length: number; - appendData(arg: string): void; - deleteData(offset: number, count: number): void; - insertData(offset: number, arg: string): void; - replaceData(offset: number, count: number, arg: string): void; - substringData(offset: number, count: number): string; -} - -declare var CharacterData: { - prototype: CharacterData; - new(): CharacterData; -} - -interface ClientRect { - bottom: number; - readonly height: number; - left: number; - right: number; - top: number; - readonly width: number; -} - -declare var ClientRect: { - prototype: ClientRect; - new(): ClientRect; -} - -interface ClientRectList { - readonly length: number; - item(index: number): ClientRect; - [index: number]: ClientRect; -} - -declare var ClientRectList: { - prototype: ClientRectList; - new(): ClientRectList; -} - -interface ClipboardEvent extends Event { - readonly clipboardData: DataTransfer; -} - -declare var ClipboardEvent: { - prototype: ClipboardEvent; - new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent; -} - -interface CloseEvent extends Event { - readonly code: number; - readonly reason: string; - readonly wasClean: boolean; - initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; -} - -declare var CloseEvent: { - prototype: CloseEvent; - new(): CloseEvent; -} - -interface CommandEvent extends Event { - readonly commandName: string; - readonly detail: string | null; -} - -declare var CommandEvent: { - prototype: CommandEvent; - new(type: string, eventInitDict?: CommandEventInit): CommandEvent; -} - -interface Comment extends CharacterData { - text: string; -} - -declare var Comment: { - prototype: Comment; - new(): Comment; -} - -interface CompositionEvent extends UIEvent { - readonly data: string; - readonly locale: string; - initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; -} - -declare var CompositionEvent: { - prototype: CompositionEvent; - new(typeArg: string, eventInitDict?: CompositionEventInit): CompositionEvent; -} - -interface Console { - assert(test?: boolean, message?: string, ...optionalParams: any[]): void; - clear(): void; - count(countTitle?: string): void; - debug(message?: string, ...optionalParams: any[]): void; - dir(value?: any, ...optionalParams: any[]): void; - dirxml(value: any): void; - error(message?: any, ...optionalParams: any[]): void; - exception(message?: string, ...optionalParams: any[]): void; - group(groupTitle?: string): void; - groupCollapsed(groupTitle?: string): void; - groupEnd(): void; - info(message?: any, ...optionalParams: any[]): void; - log(message?: any, ...optionalParams: any[]): void; - msIsIndependentlyComposed(element: Element): boolean; - profile(reportName?: string): void; - profileEnd(): void; - select(element: Element): void; - table(...data: any[]): void; - time(timerName?: string): void; - timeEnd(timerName?: string): void; - trace(message?: any, ...optionalParams: any[]): void; - warn(message?: any, ...optionalParams: any[]): void; -} - -declare var Console: { - prototype: Console; - new(): Console; -} - -interface ConvolverNode extends AudioNode { - buffer: AudioBuffer | null; - normalize: boolean; -} - -declare var ConvolverNode: { - prototype: ConvolverNode; - new(): ConvolverNode; -} - -interface Coordinates { - readonly accuracy: number; - readonly altitude: number | null; - readonly altitudeAccuracy: number | null; - readonly heading: number | null; - readonly latitude: number; - readonly longitude: number; - readonly speed: number | null; -} - -declare var Coordinates: { - prototype: Coordinates; - new(): Coordinates; -} - -interface Crypto extends Object, RandomSource { - readonly subtle: SubtleCrypto; -} - -declare var Crypto: { - prototype: Crypto; - new(): Crypto; -} - -interface CryptoKey { - readonly algorithm: KeyAlgorithm; - readonly extractable: boolean; - readonly type: string; - readonly usages: string[]; -} - -declare var CryptoKey: { - prototype: CryptoKey; - new(): CryptoKey; -} - -interface CryptoKeyPair { - privateKey: CryptoKey; - publicKey: CryptoKey; -} - -declare var CryptoKeyPair: { - prototype: CryptoKeyPair; - new(): CryptoKeyPair; -} - -interface CustomEvent extends Event { - readonly detail: any; - initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; -} - -declare var CustomEvent: { - prototype: CustomEvent; - new(typeArg: string, eventInitDict?: CustomEventInit): CustomEvent; -} - -interface DOMError { - readonly name: string; - toString(): string; -} - -declare var DOMError: { - prototype: DOMError; - new(): DOMError; -} - -interface DOMException { - readonly code: number; - readonly message: string; - readonly name: string; - toString(): string; - readonly ABORT_ERR: number; - readonly DATA_CLONE_ERR: number; - readonly DOMSTRING_SIZE_ERR: number; - readonly HIERARCHY_REQUEST_ERR: number; - readonly INDEX_SIZE_ERR: number; - readonly INUSE_ATTRIBUTE_ERR: number; - readonly INVALID_ACCESS_ERR: number; - readonly INVALID_CHARACTER_ERR: number; - readonly INVALID_MODIFICATION_ERR: number; - readonly INVALID_NODE_TYPE_ERR: number; - readonly INVALID_STATE_ERR: number; - readonly NAMESPACE_ERR: number; - readonly NETWORK_ERR: number; - readonly NOT_FOUND_ERR: number; - readonly NOT_SUPPORTED_ERR: number; - readonly NO_DATA_ALLOWED_ERR: number; - readonly NO_MODIFICATION_ALLOWED_ERR: number; - readonly PARSE_ERR: number; - readonly QUOTA_EXCEEDED_ERR: number; - readonly SECURITY_ERR: number; - readonly SERIALIZE_ERR: number; - readonly SYNTAX_ERR: number; - readonly TIMEOUT_ERR: number; - readonly TYPE_MISMATCH_ERR: number; - readonly URL_MISMATCH_ERR: number; - readonly VALIDATION_ERR: number; - readonly WRONG_DOCUMENT_ERR: number; -} - -declare var DOMException: { - prototype: DOMException; - new(): DOMException; - readonly ABORT_ERR: number; - readonly DATA_CLONE_ERR: number; - readonly DOMSTRING_SIZE_ERR: number; - readonly HIERARCHY_REQUEST_ERR: number; - readonly INDEX_SIZE_ERR: number; - readonly INUSE_ATTRIBUTE_ERR: number; - readonly INVALID_ACCESS_ERR: number; - readonly INVALID_CHARACTER_ERR: number; - readonly INVALID_MODIFICATION_ERR: number; - readonly INVALID_NODE_TYPE_ERR: number; - readonly INVALID_STATE_ERR: number; - readonly NAMESPACE_ERR: number; - readonly NETWORK_ERR: number; - readonly NOT_FOUND_ERR: number; - readonly NOT_SUPPORTED_ERR: number; - readonly NO_DATA_ALLOWED_ERR: number; - readonly NO_MODIFICATION_ALLOWED_ERR: number; - readonly PARSE_ERR: number; - readonly QUOTA_EXCEEDED_ERR: number; - readonly SECURITY_ERR: number; - readonly SERIALIZE_ERR: number; - readonly SYNTAX_ERR: number; - readonly TIMEOUT_ERR: number; - readonly TYPE_MISMATCH_ERR: number; - readonly URL_MISMATCH_ERR: number; - readonly VALIDATION_ERR: number; - readonly WRONG_DOCUMENT_ERR: number; -} - -interface DOMImplementation { - createDocument(namespaceURI: string | null, qualifiedName: string | null, doctype: DocumentType): Document; - createDocumentType(qualifiedName: string, publicId: string | null, systemId: string | null): DocumentType; - createHTMLDocument(title: string): Document; - hasFeature(feature: string | null, version: string | null): boolean; -} - -declare var DOMImplementation: { - prototype: DOMImplementation; - new(): DOMImplementation; -} - -interface DOMParser { - parseFromString(source: string, mimeType: string): Document; -} - -declare var DOMParser: { - prototype: DOMParser; - new(): DOMParser; -} - -interface DOMSettableTokenList extends DOMTokenList { - value: string; -} - -declare var DOMSettableTokenList: { - prototype: DOMSettableTokenList; - new(): DOMSettableTokenList; -} - -interface DOMStringList { - readonly length: number; - contains(str: string): boolean; - item(index: number): string | null; - [index: number]: string; -} - -declare var DOMStringList: { - prototype: DOMStringList; - new(): DOMStringList; -} - -interface DOMStringMap { - [name: string]: string; -} - -declare var DOMStringMap: { - prototype: DOMStringMap; - new(): DOMStringMap; -} - -interface DOMTokenList { - readonly length: number; - add(...token: string[]): void; - contains(token: string): boolean; - item(index: number): string; - remove(...token: string[]): void; - toString(): string; - toggle(token: string, force?: boolean): boolean; - [index: number]: string; -} - -declare var DOMTokenList: { - prototype: DOMTokenList; - new(): DOMTokenList; -} - -interface DataCue extends TextTrackCue { - data: ArrayBuffer; - addEventListener(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var DataCue: { - prototype: DataCue; - new(): DataCue; -} - -interface DataTransfer { - dropEffect: string; - effectAllowed: string; - readonly files: FileList; - readonly items: DataTransferItemList; - readonly types: string[]; - clearData(format?: string): boolean; - getData(format: string): string; - setData(format: string, data: string): boolean; -} - -declare var DataTransfer: { - prototype: DataTransfer; - new(): DataTransfer; -} - -interface DataTransferItem { - readonly kind: string; - readonly type: string; - getAsFile(): File | null; - getAsString(_callback: FunctionStringCallback | null): void; -} - -declare var DataTransferItem: { - prototype: DataTransferItem; - new(): DataTransferItem; -} - -interface DataTransferItemList { - readonly length: number; - add(data: File): DataTransferItem | null; - clear(): void; - item(index: number): DataTransferItem; - remove(index: number): void; - [index: number]: DataTransferItem; -} - -declare var DataTransferItemList: { - prototype: DataTransferItemList; - new(): DataTransferItemList; -} - -interface DeferredPermissionRequest { - readonly id: number; - readonly type: string; - readonly uri: string; - allow(): void; - deny(): void; -} - -declare var DeferredPermissionRequest: { - prototype: DeferredPermissionRequest; - new(): DeferredPermissionRequest; -} - -interface DelayNode extends AudioNode { - readonly delayTime: AudioParam; -} - -declare var DelayNode: { - prototype: DelayNode; - new(): DelayNode; -} - -interface DeviceAcceleration { - readonly x: number | null; - readonly y: number | null; - readonly z: number | null; -} - -declare var DeviceAcceleration: { - prototype: DeviceAcceleration; - new(): DeviceAcceleration; -} - -interface DeviceLightEvent extends Event { - readonly value: number; -} - -declare var DeviceLightEvent: { - prototype: DeviceLightEvent; - new(type: string, eventInitDict?: DeviceLightEventInit): DeviceLightEvent; -} - -interface DeviceMotionEvent extends Event { - readonly acceleration: DeviceAcceleration | null; - readonly accelerationIncludingGravity: DeviceAcceleration | null; - readonly interval: number | null; - readonly rotationRate: DeviceRotationRate | null; - initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict | null, accelerationIncludingGravity: DeviceAccelerationDict | null, rotationRate: DeviceRotationRateDict | null, interval: number | null): void; -} - -declare var DeviceMotionEvent: { - prototype: DeviceMotionEvent; - new(): DeviceMotionEvent; -} - -interface DeviceOrientationEvent extends Event { - readonly absolute: boolean; - readonly alpha: number | null; - readonly beta: number | null; - readonly gamma: number | null; - initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number | null, beta: number | null, gamma: number | null, absolute: boolean): void; -} - -declare var DeviceOrientationEvent: { - prototype: DeviceOrientationEvent; - new(): DeviceOrientationEvent; -} - -interface DeviceRotationRate { - readonly alpha: number | null; - readonly beta: number | null; - readonly gamma: number | null; -} - -declare var DeviceRotationRate: { - prototype: DeviceRotationRate; - new(): DeviceRotationRate; -} - -interface DocumentEventMap extends GlobalEventHandlersEventMap { - "abort": UIEvent; - "activate": UIEvent; - "beforeactivate": UIEvent; - "beforedeactivate": UIEvent; - "blur": FocusEvent; - "canplay": Event; - "canplaythrough": Event; - "change": Event; - "click": MouseEvent; - "contextmenu": PointerEvent; - "dblclick": MouseEvent; - "deactivate": UIEvent; - "drag": DragEvent; - "dragend": DragEvent; - "dragenter": DragEvent; - "dragleave": DragEvent; - "dragover": DragEvent; - "dragstart": DragEvent; - "drop": DragEvent; - "durationchange": Event; - "emptied": Event; - "ended": MediaStreamErrorEvent; - "error": ErrorEvent; - "focus": FocusEvent; - "fullscreenchange": Event; - "fullscreenerror": Event; - "input": Event; - "invalid": Event; - "keydown": KeyboardEvent; - "keypress": KeyboardEvent; - "keyup": KeyboardEvent; - "load": Event; - "loadeddata": Event; - "loadedmetadata": Event; - "loadstart": Event; - "mousedown": MouseEvent; - "mousemove": MouseEvent; - "mouseout": MouseEvent; - "mouseover": MouseEvent; - "mouseup": MouseEvent; - "mousewheel": WheelEvent; - "MSContentZoom": UIEvent; - "MSGestureChange": MSGestureEvent; - "MSGestureDoubleTap": MSGestureEvent; - "MSGestureEnd": MSGestureEvent; - "MSGestureHold": MSGestureEvent; - "MSGestureStart": MSGestureEvent; - "MSGestureTap": MSGestureEvent; - "MSInertiaStart": MSGestureEvent; - "MSManipulationStateChanged": MSManipulationEvent; - "MSPointerCancel": MSPointerEvent; - "MSPointerDown": MSPointerEvent; - "MSPointerEnter": MSPointerEvent; - "MSPointerLeave": MSPointerEvent; - "MSPointerMove": MSPointerEvent; - "MSPointerOut": MSPointerEvent; - "MSPointerOver": MSPointerEvent; - "MSPointerUp": MSPointerEvent; - "mssitemodejumplistitemremoved": MSSiteModeEvent; - "msthumbnailclick": MSSiteModeEvent; - "pause": Event; - "play": Event; - "playing": Event; - "pointerlockchange": Event; - "pointerlockerror": Event; - "progress": ProgressEvent; - "ratechange": Event; - "readystatechange": ProgressEvent; - "reset": Event; - "scroll": UIEvent; - "seeked": Event; - "seeking": Event; - "select": UIEvent; - "selectionchange": Event; - "selectstart": Event; - "stalled": Event; - "stop": Event; - "submit": Event; - "suspend": Event; - "timeupdate": Event; - "touchcancel": TouchEvent; - "touchend": TouchEvent; - "touchmove": TouchEvent; - "touchstart": TouchEvent; - "volumechange": Event; - "waiting": Event; - "webkitfullscreenchange": Event; - "webkitfullscreenerror": Event; -} - -interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEvent, ParentNode, DocumentOrShadowRoot { - /** - * Sets or gets the URL for the current document. - */ - readonly URL: string; - /** - * Gets the URL for the document, stripped of any character encoding. - */ - readonly URLUnencoded: string; - /** - * Gets the object that has the focus when the parent document has focus. - */ - readonly activeElement: Element; - /** - * Sets or gets the color of all active links in the document. - */ - alinkColor: string; - /** - * Returns a reference to the collection of elements contained by the object. - */ - readonly all: HTMLAllCollection; - /** - * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. - */ - anchors: HTMLCollectionOf; - /** - * Retrieves a collection of all applet objects in the document. - */ - applets: HTMLCollectionOf; - /** - * Deprecated. Sets or retrieves a value that indicates the background color behind the object. - */ - bgColor: string; - /** - * Specifies the beginning and end of the document body. - */ - body: HTMLElement; - readonly characterSet: string; - /** - * Gets or sets the character set used to encode the object. - */ - charset: string; - /** - * Gets a value that indicates whether standards-compliant mode is switched on for the object. - */ - readonly compatMode: string; - cookie: string; - readonly currentScript: HTMLScriptElement | SVGScriptElement; - /** - * Gets the default character set from the current regional language settings. - */ - readonly defaultCharset: string; - readonly defaultView: Window; - /** - * Sets or gets a value that indicates whether the document can be edited. - */ - designMode: string; - /** - * Sets or retrieves a value that indicates the reading order of the object. - */ - dir: string; - /** - * Gets an object representing the document type declaration associated with the current document. - */ - readonly doctype: DocumentType; - /** - * Gets a reference to the root node of the document. - */ - documentElement: HTMLElement; - /** - * Sets or gets the security domain of the document. - */ - domain: string; - /** - * Retrieves a collection of all embed objects in the document. - */ - embeds: HTMLCollectionOf; - /** - * Sets or gets the foreground (text) color of the document. - */ - fgColor: string; - /** - * Retrieves a collection, in source order, of all form objects in the document. - */ - forms: HTMLCollectionOf; - readonly fullscreenElement: Element | null; - readonly fullscreenEnabled: boolean; - readonly head: HTMLHeadElement; - readonly hidden: boolean; - /** - * Retrieves a collection, in source order, of img objects in the document. - */ - images: HTMLCollectionOf; - /** - * Gets the implementation object of the current document. - */ - readonly implementation: DOMImplementation; - /** - * Returns the character encoding used to create the webpage that is loaded into the document object. - */ - readonly inputEncoding: string | null; - /** - * Gets the date that the page was last modified, if the page supplies one. - */ - readonly lastModified: string; - /** - * Sets or gets the color of the document links. - */ - linkColor: string; - /** - * Retrieves a collection of all a objects that specify the href property and all area objects in the document. - */ - links: HTMLCollectionOf; - /** - * Contains information about the current URL. - */ - readonly location: Location; - msCSSOMElementFloatMetrics: boolean; - msCapsLockWarningOff: boolean; - /** - * Fires when the user aborts the download. - * @param ev The event. - */ - onabort: (this: Document, ev: UIEvent) => any; - /** - * Fires when the object is set as the active element. - * @param ev The event. - */ - onactivate: (this: Document, ev: UIEvent) => any; - /** - * Fires immediately before the object is set as the active element. - * @param ev The event. - */ - onbeforeactivate: (this: Document, ev: UIEvent) => any; - /** - * Fires immediately before the activeElement is changed from the current object to another object in the parent document. - * @param ev The event. - */ - onbeforedeactivate: (this: Document, ev: UIEvent) => any; - /** - * Fires when the object loses the input focus. - * @param ev The focus event. - */ - onblur: (this: Document, ev: FocusEvent) => any; - /** - * Occurs when playback is possible, but would require further buffering. - * @param ev The event. - */ - oncanplay: (this: Document, ev: Event) => any; - oncanplaythrough: (this: Document, ev: Event) => any; - /** - * Fires when the contents of the object or selection have changed. - * @param ev The event. - */ - onchange: (this: Document, ev: Event) => any; - /** - * Fires when the user clicks the left mouse button on the object - * @param ev The mouse event. - */ - onclick: (this: Document, ev: MouseEvent) => any; - /** - * Fires when the user clicks the right mouse button in the client area, opening the context menu. - * @param ev The mouse event. - */ - oncontextmenu: (this: Document, ev: PointerEvent) => any; - /** - * Fires when the user double-clicks the object. - * @param ev The mouse event. - */ - ondblclick: (this: Document, ev: MouseEvent) => any; - /** - * Fires when the activeElement is changed from the current object to another object in the parent document. - * @param ev The UI Event - */ - ondeactivate: (this: Document, ev: UIEvent) => any; - /** - * Fires on the source object continuously during a drag operation. - * @param ev The event. - */ - ondrag: (this: Document, ev: DragEvent) => any; - /** - * Fires on the source object when the user releases the mouse at the close of a drag operation. - * @param ev The event. - */ - ondragend: (this: Document, ev: DragEvent) => any; - /** - * Fires on the target element when the user drags the object to a valid drop target. - * @param ev The drag event. - */ - ondragenter: (this: Document, ev: DragEvent) => any; - /** - * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. - * @param ev The drag event. - */ - ondragleave: (this: Document, ev: DragEvent) => any; - /** - * Fires on the target element continuously while the user drags the object over a valid drop target. - * @param ev The event. - */ - ondragover: (this: Document, ev: DragEvent) => any; - /** - * Fires on the source object when the user starts to drag a text selection or selected object. - * @param ev The event. - */ - ondragstart: (this: Document, ev: DragEvent) => any; - ondrop: (this: Document, ev: DragEvent) => any; - /** - * Occurs when the duration attribute is updated. - * @param ev The event. - */ - ondurationchange: (this: Document, ev: Event) => any; - /** - * Occurs when the media element is reset to its initial state. - * @param ev The event. - */ - onemptied: (this: Document, ev: Event) => any; - /** - * Occurs when the end of playback is reached. - * @param ev The event - */ - onended: (this: Document, ev: MediaStreamErrorEvent) => any; - /** - * Fires when an error occurs during object loading. - * @param ev The event. - */ - onerror: (this: Document, ev: ErrorEvent) => any; - /** - * Fires when the object receives focus. - * @param ev The event. - */ - onfocus: (this: Document, ev: FocusEvent) => any; - onfullscreenchange: (this: Document, ev: Event) => any; - onfullscreenerror: (this: Document, ev: Event) => any; - oninput: (this: Document, ev: Event) => any; - oninvalid: (this: Document, ev: Event) => any; - /** - * Fires when the user presses a key. - * @param ev The keyboard event - */ - onkeydown: (this: Document, ev: KeyboardEvent) => any; - /** - * Fires when the user presses an alphanumeric key. - * @param ev The event. - */ - onkeypress: (this: Document, ev: KeyboardEvent) => any; - /** - * Fires when the user releases a key. - * @param ev The keyboard event - */ - onkeyup: (this: Document, ev: KeyboardEvent) => any; - /** - * Fires immediately after the browser loads the object. - * @param ev The event. - */ - onload: (this: Document, ev: Event) => any; - /** - * Occurs when media data is loaded at the current playback position. - * @param ev The event. - */ - onloadeddata: (this: Document, ev: Event) => any; - /** - * Occurs when the duration and dimensions of the media have been determined. - * @param ev The event. - */ - onloadedmetadata: (this: Document, ev: Event) => any; - /** - * Occurs when Internet Explorer begins looking for media data. - * @param ev The event. - */ - onloadstart: (this: Document, ev: Event) => any; - /** - * Fires when the user clicks the object with either mouse button. - * @param ev The mouse event. - */ - onmousedown: (this: Document, ev: MouseEvent) => any; - /** - * Fires when the user moves the mouse over the object. - * @param ev The mouse event. - */ - onmousemove: (this: Document, ev: MouseEvent) => any; - /** - * Fires when the user moves the mouse pointer outside the boundaries of the object. - * @param ev The mouse event. - */ - onmouseout: (this: Document, ev: MouseEvent) => any; - /** - * Fires when the user moves the mouse pointer into the object. - * @param ev The mouse event. - */ - onmouseover: (this: Document, ev: MouseEvent) => any; - /** - * Fires when the user releases a mouse button while the mouse is over the object. - * @param ev The mouse event. - */ - onmouseup: (this: Document, ev: MouseEvent) => any; - /** - * Fires when the wheel button is rotated. - * @param ev The mouse event - */ - onmousewheel: (this: Document, ev: WheelEvent) => any; - onmscontentzoom: (this: Document, ev: UIEvent) => any; - onmsgesturechange: (this: Document, ev: MSGestureEvent) => any; - onmsgesturedoubletap: (this: Document, ev: MSGestureEvent) => any; - onmsgestureend: (this: Document, ev: MSGestureEvent) => any; - onmsgesturehold: (this: Document, ev: MSGestureEvent) => any; - onmsgesturestart: (this: Document, ev: MSGestureEvent) => any; - onmsgesturetap: (this: Document, ev: MSGestureEvent) => any; - onmsinertiastart: (this: Document, ev: MSGestureEvent) => any; - onmsmanipulationstatechanged: (this: Document, ev: MSManipulationEvent) => any; - onmspointercancel: (this: Document, ev: MSPointerEvent) => any; - onmspointerdown: (this: Document, ev: MSPointerEvent) => any; - onmspointerenter: (this: Document, ev: MSPointerEvent) => any; - onmspointerleave: (this: Document, ev: MSPointerEvent) => any; - onmspointermove: (this: Document, ev: MSPointerEvent) => any; - onmspointerout: (this: Document, ev: MSPointerEvent) => any; - onmspointerover: (this: Document, ev: MSPointerEvent) => any; - onmspointerup: (this: Document, ev: MSPointerEvent) => any; - /** - * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. - * @param ev The event. - */ - onmssitemodejumplistitemremoved: (this: Document, ev: MSSiteModeEvent) => any; - /** - * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. - * @param ev The event. - */ - onmsthumbnailclick: (this: Document, ev: MSSiteModeEvent) => any; - /** - * Occurs when playback is paused. - * @param ev The event. - */ - onpause: (this: Document, ev: Event) => any; - /** - * Occurs when the play method is requested. - * @param ev The event. - */ - onplay: (this: Document, ev: Event) => any; - /** - * Occurs when the audio or video has started playing. - * @param ev The event. - */ - onplaying: (this: Document, ev: Event) => any; - onpointerlockchange: (this: Document, ev: Event) => any; - onpointerlockerror: (this: Document, ev: Event) => any; - /** - * Occurs to indicate progress while downloading media data. - * @param ev The event. - */ - onprogress: (this: Document, ev: ProgressEvent) => any; - /** - * Occurs when the playback rate is increased or decreased. - * @param ev The event. - */ - onratechange: (this: Document, ev: Event) => any; - /** - * Fires when the state of the object has changed. - * @param ev The event - */ - onreadystatechange: (this: Document, ev: ProgressEvent) => any; - /** - * Fires when the user resets a form. - * @param ev The event. - */ - onreset: (this: Document, ev: Event) => any; - /** - * Fires when the user repositions the scroll box in the scroll bar on the object. - * @param ev The event. - */ - onscroll: (this: Document, ev: UIEvent) => any; - /** - * Occurs when the seek operation ends. - * @param ev The event. - */ - onseeked: (this: Document, ev: Event) => any; - /** - * Occurs when the current playback position is moved. - * @param ev The event. - */ - onseeking: (this: Document, ev: Event) => any; - /** - * Fires when the current selection changes. - * @param ev The event. - */ - onselect: (this: Document, ev: UIEvent) => any; - /** - * Fires when the selection state of a document changes. - * @param ev The event. - */ - onselectionchange: (this: Document, ev: Event) => any; - onselectstart: (this: Document, ev: Event) => any; - /** - * Occurs when the download has stopped. - * @param ev The event. - */ - onstalled: (this: Document, ev: Event) => any; - /** - * Fires when the user clicks the Stop button or leaves the Web page. - * @param ev The event. - */ - onstop: (this: Document, ev: Event) => any; - onsubmit: (this: Document, ev: Event) => any; - /** - * Occurs if the load operation has been intentionally halted. - * @param ev The event. - */ - onsuspend: (this: Document, ev: Event) => any; - /** - * Occurs to indicate the current playback position. - * @param ev The event. - */ - ontimeupdate: (this: Document, ev: Event) => any; - ontouchcancel: (ev: TouchEvent) => any; - ontouchend: (ev: TouchEvent) => any; - ontouchmove: (ev: TouchEvent) => any; - ontouchstart: (ev: TouchEvent) => any; - /** - * Occurs when the volume is changed, or playback is muted or unmuted. - * @param ev The event. - */ - onvolumechange: (this: Document, ev: Event) => any; - /** - * Occurs when playback stops because the next frame of a video resource is not available. - * @param ev The event. - */ - onwaiting: (this: Document, ev: Event) => any; - onwebkitfullscreenchange: (this: Document, ev: Event) => any; - onwebkitfullscreenerror: (this: Document, ev: Event) => any; - plugins: HTMLCollectionOf; - readonly pointerLockElement: Element; - /** - * Retrieves a value that indicates the current state of the object. - */ - readonly readyState: string; - /** - * Gets the URL of the location that referred the user to the current page. - */ - readonly referrer: string; - /** - * Gets the root svg element in the document hierarchy. - */ - readonly rootElement: SVGSVGElement; - /** - * Retrieves a collection of all script objects in the document. - */ - scripts: HTMLCollectionOf; - readonly scrollingElement: Element | null; - /** - * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. - */ - readonly styleSheets: StyleSheetList; - /** - * Contains the title of the document. - */ - title: string; - readonly visibilityState: string; - /** - * Sets or gets the color of the links that the user has visited. - */ - vlinkColor: string; - readonly webkitCurrentFullScreenElement: Element | null; - readonly webkitFullscreenElement: Element | null; - readonly webkitFullscreenEnabled: boolean; - readonly webkitIsFullScreen: boolean; - readonly xmlEncoding: string | null; - xmlStandalone: boolean; - /** - * Gets or sets the version attribute specified in the declaration of an XML document. - */ - xmlVersion: string | null; - adoptNode(source: Node): Node; - captureEvents(): void; - caretRangeFromPoint(x: number, y: number): Range; - clear(): void; - /** - * Closes an output stream and forces the sent data to display. - */ - close(): void; - /** - * Creates an attribute object with a specified name. - * @param name String that sets the attribute object's name. - */ - createAttribute(name: string): Attr; - createAttributeNS(namespaceURI: string | null, qualifiedName: string): Attr; - createCDATASection(data: string): CDATASection; - /** - * Creates a comment object with the specified data. - * @param data Sets the comment object's data. - */ - createComment(data: string): Comment; - /** - * Creates a new document. - */ - createDocumentFragment(): DocumentFragment; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: K): HTMLElementTagNameMap[K]; - createElement(tagName: string): HTMLElement; - createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "a"): SVGAElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "circle"): SVGCircleElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "clipPath"): SVGClipPathElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "componentTransferFunction"): SVGComponentTransferFunctionElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "defs"): SVGDefsElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "desc"): SVGDescElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "ellipse"): SVGEllipseElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feBlend"): SVGFEBlendElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feColorMatrix"): SVGFEColorMatrixElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feComponentTransfer"): SVGFEComponentTransferElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feComposite"): SVGFECompositeElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feConvolveMatrix"): SVGFEConvolveMatrixElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDiffuseLighting"): SVGFEDiffuseLightingElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDisplacementMap"): SVGFEDisplacementMapElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDistantLight"): SVGFEDistantLightElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFlood"): SVGFEFloodElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncA"): SVGFEFuncAElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncB"): SVGFEFuncBElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncG"): SVGFEFuncGElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncR"): SVGFEFuncRElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feGaussianBlur"): SVGFEGaussianBlurElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feImage"): SVGFEImageElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMerge"): SVGFEMergeElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMergeNode"): SVGFEMergeNodeElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMorphology"): SVGFEMorphologyElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feOffset"): SVGFEOffsetElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "fePointLight"): SVGFEPointLightElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feSpecularLighting"): SVGFESpecularLightingElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feSpotLight"): SVGFESpotLightElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feTile"): SVGFETileElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feTurbulence"): SVGFETurbulenceElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "filter"): SVGFilterElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "foreignObject"): SVGForeignObjectElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "g"): SVGGElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "image"): SVGImageElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "gradient"): SVGGradientElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "line"): SVGLineElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "linearGradient"): SVGLinearGradientElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "marker"): SVGMarkerElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "mask"): SVGMaskElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "path"): SVGPathElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "metadata"): SVGMetadataElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "pattern"): SVGPatternElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "polygon"): SVGPolygonElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "polyline"): SVGPolylineElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "radialGradient"): SVGRadialGradientElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "rect"): SVGRectElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "svg"): SVGSVGElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "script"): SVGScriptElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "stop"): SVGStopElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "style"): SVGStyleElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "switch"): SVGSwitchElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "symbol"): SVGSymbolElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "tspan"): SVGTSpanElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textContent"): SVGTextContentElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "text"): SVGTextElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textPath"): SVGTextPathElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textPositioning"): SVGTextPositioningElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "title"): SVGTitleElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "use"): SVGUseElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "view"): SVGViewElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement - createElementNS(namespaceURI: string | null, qualifiedName: string): Element; - createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; - createNSResolver(nodeResolver: Node): XPathNSResolver; - /** - * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list - * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): NodeIterator; - createProcessingInstruction(target: string, data: string): ProcessingInstruction; - /** - * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. - */ - createRange(): Range; - /** - * Creates a text string from the specified value. - * @param data String that specifies the nodeValue property of the text node. - */ - createTextNode(data: string): Text; - createTouch(view: Window, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch; - createTouchList(...touches: Touch[]): TouchList; - /** - * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. - * @param filter A custom NodeFilter function to use. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker; - /** - * Returns the element for the specified x coordinate and the specified y coordinate. - * @param x The x-offset - * @param y The y-offset - */ - elementFromPoint(x: number, y: number): Element; - evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult; - /** - * Executes a command on the current document, current selection, or the given range. - * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. - * @param showUI Display the user interface, defaults to false. - * @param value Value to assign. - */ - execCommand(commandId: string, showUI?: boolean, value?: any): boolean; - /** - * Displays help information for the given command identifier. - * @param commandId Displays help information for the given command identifier. - */ - execCommandShowHelp(commandId: string): boolean; - exitFullscreen(): void; - exitPointerLock(): void; - /** - * Causes the element to receive the focus and executes the code specified by the onfocus event. - */ - focus(): void; - /** - * Returns a reference to the first object with the specified value of the ID or NAME attribute. - * @param elementId String that specifies the ID value. Case-insensitive. - */ - getElementById(elementId: string): HTMLElement | null; - getElementsByClassName(classNames: string): HTMLCollectionOf; - /** - * Gets a collection of objects based on the value of the NAME or ID attribute. - * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. - */ - getElementsByName(elementName: string): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(tagname: K): ElementListTagNameMap[K]; - getElementsByTagName(tagname: string): NodeListOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf; - /** - * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. - */ - getSelection(): Selection; - /** - * Gets a value indicating whether the object currently has focus. - */ - hasFocus(): boolean; - importNode(importedNode: Node, deep: boolean): Node; - msElementsFromPoint(x: number, y: number): NodeListOf; - msElementsFromRect(left: number, top: number, width: number, height: number): NodeListOf; - /** - * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. - * @param url Specifies a MIME type for the document. - * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. - * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. - * @param replace Specifies whether the existing entry for the document is replaced in the history list. - */ - open(url?: string, name?: string, features?: string, replace?: boolean): Document; - /** - * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. - * @param commandId Specifies a command identifier. - */ - queryCommandEnabled(commandId: string): boolean; - /** - * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. - * @param commandId String that specifies a command identifier. - */ - queryCommandIndeterm(commandId: string): boolean; - /** - * Returns a Boolean value that indicates the current state of the command. - * @param commandId String that specifies a command identifier. - */ - queryCommandState(commandId: string): boolean; - /** - * Returns a Boolean value that indicates whether the current command is supported on the current range. - * @param commandId Specifies a command identifier. - */ - queryCommandSupported(commandId: string): boolean; - /** - * Retrieves the string associated with a command. - * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. - */ - queryCommandText(commandId: string): string; - /** - * Returns the current value of the document, range, or current selection for the given command. - * @param commandId String that specifies a command identifier. - */ - queryCommandValue(commandId: string): string; - releaseEvents(): void; - /** - * Allows updating the print settings for the page. - */ - updateSettings(): void; - webkitCancelFullScreen(): void; - webkitExitFullscreen(): void; - /** - * Writes one or more HTML expressions to a document in the specified window. - * @param content Specifies the text and HTML tags to write. - */ - write(...content: string[]): void; - /** - * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. - * @param content The text and HTML tags to write. - */ - writeln(...content: string[]): void; - addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Document: { - prototype: Document; - new(): Document; -} - -interface DocumentFragment extends Node, NodeSelector, ParentNode { -} - -declare var DocumentFragment: { - prototype: DocumentFragment; - new(): DocumentFragment; -} - -interface DocumentType extends Node, ChildNode { - readonly entities: NamedNodeMap; - readonly internalSubset: string | null; - readonly name: string; - readonly notations: NamedNodeMap; - readonly publicId: string | null; - readonly systemId: string | null; -} - -declare var DocumentType: { - prototype: DocumentType; - new(): DocumentType; -} - -interface DragEvent extends MouseEvent { - readonly dataTransfer: DataTransfer; - initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; - msConvertURL(file: File, targetType: string, targetURL?: string): void; -} - -declare var DragEvent: { - prototype: DragEvent; - new(): DragEvent; -} - -interface DynamicsCompressorNode extends AudioNode { - readonly attack: AudioParam; - readonly knee: AudioParam; - readonly ratio: AudioParam; - readonly reduction: AudioParam; - readonly release: AudioParam; - readonly threshold: AudioParam; -} - -declare var DynamicsCompressorNode: { - prototype: DynamicsCompressorNode; - new(): DynamicsCompressorNode; -} - -interface EXT_frag_depth { -} - -declare var EXT_frag_depth: { - prototype: EXT_frag_depth; - new(): EXT_frag_depth; -} - -interface EXT_texture_filter_anisotropic { - readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; - readonly TEXTURE_MAX_ANISOTROPY_EXT: number; -} - -declare var EXT_texture_filter_anisotropic: { - prototype: EXT_texture_filter_anisotropic; - new(): EXT_texture_filter_anisotropic; - readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; - readonly TEXTURE_MAX_ANISOTROPY_EXT: number; -} - -interface ElementEventMap extends GlobalEventHandlersEventMap { - "ariarequest": AriaRequestEvent; - "command": CommandEvent; - "gotpointercapture": PointerEvent; - "lostpointercapture": PointerEvent; - "MSGestureChange": MSGestureEvent; - "MSGestureDoubleTap": MSGestureEvent; - "MSGestureEnd": MSGestureEvent; - "MSGestureHold": MSGestureEvent; - "MSGestureStart": MSGestureEvent; - "MSGestureTap": MSGestureEvent; - "MSGotPointerCapture": MSPointerEvent; - "MSInertiaStart": MSGestureEvent; - "MSLostPointerCapture": MSPointerEvent; - "MSPointerCancel": MSPointerEvent; - "MSPointerDown": MSPointerEvent; - "MSPointerEnter": MSPointerEvent; - "MSPointerLeave": MSPointerEvent; - "MSPointerMove": MSPointerEvent; - "MSPointerOut": MSPointerEvent; - "MSPointerOver": MSPointerEvent; - "MSPointerUp": MSPointerEvent; - "touchcancel": TouchEvent; - "touchend": TouchEvent; - "touchmove": TouchEvent; - "touchstart": TouchEvent; - "webkitfullscreenchange": Event; - "webkitfullscreenerror": Event; -} - -interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelector, ChildNode, ParentNode { - readonly classList: DOMTokenList; - className: string; - readonly clientHeight: number; - readonly clientLeft: number; - readonly clientTop: number; - readonly clientWidth: number; - id: string; - msContentZoomFactor: number; - readonly msRegionOverflow: string; - onariarequest: (this: Element, ev: AriaRequestEvent) => any; - oncommand: (this: Element, ev: CommandEvent) => any; - ongotpointercapture: (this: Element, ev: PointerEvent) => any; - onlostpointercapture: (this: Element, ev: PointerEvent) => any; - onmsgesturechange: (this: Element, ev: MSGestureEvent) => any; - onmsgesturedoubletap: (this: Element, ev: MSGestureEvent) => any; - onmsgestureend: (this: Element, ev: MSGestureEvent) => any; - onmsgesturehold: (this: Element, ev: MSGestureEvent) => any; - onmsgesturestart: (this: Element, ev: MSGestureEvent) => any; - onmsgesturetap: (this: Element, ev: MSGestureEvent) => any; - onmsgotpointercapture: (this: Element, ev: MSPointerEvent) => any; - onmsinertiastart: (this: Element, ev: MSGestureEvent) => any; - onmslostpointercapture: (this: Element, ev: MSPointerEvent) => any; - onmspointercancel: (this: Element, ev: MSPointerEvent) => any; - onmspointerdown: (this: Element, ev: MSPointerEvent) => any; - onmspointerenter: (this: Element, ev: MSPointerEvent) => any; - onmspointerleave: (this: Element, ev: MSPointerEvent) => any; - onmspointermove: (this: Element, ev: MSPointerEvent) => any; - onmspointerout: (this: Element, ev: MSPointerEvent) => any; - onmspointerover: (this: Element, ev: MSPointerEvent) => any; - onmspointerup: (this: Element, ev: MSPointerEvent) => any; - ontouchcancel: (ev: TouchEvent) => any; - ontouchend: (ev: TouchEvent) => any; - ontouchmove: (ev: TouchEvent) => any; - ontouchstart: (ev: TouchEvent) => any; - onwebkitfullscreenchange: (this: Element, ev: Event) => any; - onwebkitfullscreenerror: (this: Element, ev: Event) => any; - readonly prefix: string | null; - readonly scrollHeight: number; - scrollLeft: number; - scrollTop: number; - readonly scrollWidth: number; - readonly tagName: string; - innerHTML: string; - readonly assignedSlot: HTMLSlotElement | null; - slot: string; - readonly shadowRoot: ShadowRoot | null; - getAttribute(name: string): string | null; - getAttributeNS(namespaceURI: string, localName: string): string; - getAttributeNode(name: string): Attr; - getAttributeNodeNS(namespaceURI: string, localName: string): Attr; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; - getElementsByTagName(name: K): ElementListTagNameMap[K]; - getElementsByTagName(name: string): NodeListOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf; - hasAttribute(name: string): boolean; - hasAttributeNS(namespaceURI: string, localName: string): boolean; - msGetRegionContent(): MSRangeCollection; - msGetUntransformedBounds(): ClientRect; - msMatchesSelector(selectors: string): boolean; - msReleasePointerCapture(pointerId: number): void; - msSetPointerCapture(pointerId: number): void; - msZoomTo(args: MsZoomToOptions): void; - releasePointerCapture(pointerId: number): void; - removeAttribute(name?: string): void; - removeAttributeNS(namespaceURI: string, localName: string): void; - removeAttributeNode(oldAttr: Attr): Attr; - requestFullscreen(): void; - requestPointerLock(): void; - setAttribute(name: string, value: string): void; - setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; - setAttributeNode(newAttr: Attr): Attr; - setAttributeNodeNS(newAttr: Attr): Attr; - setPointerCapture(pointerId: number): void; - webkitMatchesSelector(selectors: string): boolean; - webkitRequestFullScreen(): void; - webkitRequestFullscreen(): void; - getElementsByClassName(classNames: string): NodeListOf; - matches(selector: string): boolean; - closest(selector: string): Element | null; - scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void; - scroll(options?: ScrollToOptions): void; - scroll(x: number, y: number): void; - scrollTo(options?: ScrollToOptions): void; - scrollTo(x: number, y: number): void; - scrollBy(options?: ScrollToOptions): void; - scrollBy(x: number, y: number): void; - insertAdjacentElement(position: string, insertedElement: Element): Element | null; - insertAdjacentHTML(where: string, html: string): void; - insertAdjacentText(where: string, text: string): void; - attachShadow(shadowRootInitDict: ShadowRootInit): ShadowRoot; - addEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Element: { - prototype: Element; - new(): Element; -} - -interface ErrorEvent extends Event { - readonly colno: number; - readonly error: any; - readonly filename: string; - readonly lineno: number; - readonly message: string; - initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; -} - -declare var ErrorEvent: { - prototype: ErrorEvent; - new(): ErrorEvent; -} - -interface Event { - readonly bubbles: boolean; - cancelBubble: boolean; - readonly cancelable: boolean; - readonly currentTarget: EventTarget; - readonly defaultPrevented: boolean; - readonly eventPhase: number; - readonly isTrusted: boolean; - returnValue: boolean; - readonly srcElement: Element | null; - readonly target: EventTarget; - readonly timeStamp: number; - readonly type: string; - readonly scoped: boolean; - initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; - preventDefault(): void; - stopImmediatePropagation(): void; - stopPropagation(): void; - deepPath(): EventTarget[]; - readonly AT_TARGET: number; - readonly BUBBLING_PHASE: number; - readonly CAPTURING_PHASE: number; -} - -declare var Event: { - prototype: Event; - new(type: string, eventInitDict?: EventInit): Event; - readonly AT_TARGET: number; - readonly BUBBLING_PHASE: number; - readonly CAPTURING_PHASE: number; -} - -interface EventTarget { - addEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void; - dispatchEvent(evt: Event): boolean; - removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var EventTarget: { - prototype: EventTarget; - new(): EventTarget; -} - -interface External { -} - -declare var External: { - prototype: External; - new(): External; -} - -interface File extends Blob { - readonly lastModifiedDate: any; - readonly name: string; - readonly webkitRelativePath: string; -} - -declare var File: { - prototype: File; - new (parts: (ArrayBuffer | ArrayBufferView | Blob | string)[], filename: string, properties?: FilePropertyBag): File; -} - -interface FileList { - readonly length: number; - item(index: number): File; - [index: number]: File; -} - -declare var FileList: { - prototype: FileList; - new(): FileList; -} - -interface FileReader extends EventTarget, MSBaseReader { - readonly error: DOMError; - readAsArrayBuffer(blob: Blob): void; - readAsBinaryString(blob: Blob): void; - readAsDataURL(blob: Blob): void; - readAsText(blob: Blob, encoding?: string): void; - addEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var FileReader: { - prototype: FileReader; - new(): FileReader; -} - -interface FocusEvent extends UIEvent { - readonly relatedTarget: EventTarget; - initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; -} - -declare var FocusEvent: { - prototype: FocusEvent; - new(typeArg: string, eventInitDict?: FocusEventInit): FocusEvent; -} - -interface FormData { - append(name: any, value: any, blobName?: string): void; -} - -declare var FormData: { - prototype: FormData; - new (form?: HTMLFormElement): FormData; -} - -interface GainNode extends AudioNode { - readonly gain: AudioParam; -} - -declare var GainNode: { - prototype: GainNode; - new(): GainNode; -} - -interface Gamepad { - readonly axes: number[]; - readonly buttons: GamepadButton[]; - readonly connected: boolean; - readonly id: string; - readonly index: number; - readonly mapping: string; - readonly timestamp: number; -} - -declare var Gamepad: { - prototype: Gamepad; - new(): Gamepad; -} - -interface GamepadButton { - readonly pressed: boolean; - readonly value: number; -} - -declare var GamepadButton: { - prototype: GamepadButton; - new(): GamepadButton; -} - -interface GamepadEvent extends Event { - readonly gamepad: Gamepad; -} - -declare var GamepadEvent: { - prototype: GamepadEvent; - new(): GamepadEvent; -} - -interface Geolocation { - clearWatch(watchId: number): void; - getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; - watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; -} - -declare var Geolocation: { - prototype: Geolocation; - new(): Geolocation; -} - -interface HTMLAllCollection extends HTMLCollection { - namedItem(name: string): Element; -} - -declare var HTMLAllCollection: { - prototype: HTMLAllCollection; - new(): HTMLAllCollection; -} - -interface HTMLAnchorElement extends HTMLElement { - Methods: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - download: string; - /** - * Contains the anchor portion of the URL including the hash sign (#). - */ - hash: string; - /** - * Contains the hostname and port values of the URL. - */ - host: string; - /** - * Contains the hostname of a URL. - */ - hostname: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; - readonly mimeType: string; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - readonly nameProp: string; - /** - * Contains the pathname of the URL. - */ - pathname: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Contains the protocol of the URL. - */ - protocol: string; - readonly protocolLong: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - type: string; - urn: string; - /** - * Returns a string representation of an object. - */ - toString(): string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLAnchorElement: { - prototype: HTMLAnchorElement; - new(): HTMLAnchorElement; -} - -interface HTMLAppletElement extends HTMLElement { - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - readonly BaseHref: string; - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. - */ - altHtml: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - border: string; - code: string; - /** - * Sets or retrieves the URL of the component. - */ - codeBase: string; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - /** - * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. - */ - readonly contentDocument: Document; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; - /** - * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. - */ - declare: boolean; - readonly form: HTMLFormElement; - /** - * Sets or retrieves the height of the object. - */ - height: string; - hspace: number; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - object: string | null; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - vspace: number; - width: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLAppletElement: { - prototype: HTMLAppletElement; - new(): HTMLAppletElement; -} - -interface HTMLAreaElement extends HTMLElement { - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - download: string; - /** - * Sets or retrieves the subsection of the href property that follows the number sign (#). - */ - hash: string; - /** - * Sets or retrieves the hostname and port number of the location or URL. - */ - host: string; - /** - * Sets or retrieves the host name part of the location or URL. - */ - hostname: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or gets whether clicks in this region cause action. - */ - noHref: boolean; - /** - * Sets or retrieves the file name or path specified by the object. - */ - pathname: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Sets or retrieves the protocol portion of a URL. - */ - protocol: string; - rel: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Returns a string representation of an object. - */ - toString(): string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLAreaElement: { - prototype: HTMLAreaElement; - new(): HTMLAreaElement; -} - -interface HTMLAreasCollection extends HTMLCollection { - /** - * Adds an element to the areas, controlRange, or options collection. - */ - add(element: HTMLElement, before?: HTMLElement | number): void; - /** - * Removes an element from the collection. - */ - remove(index?: number): void; -} - -declare var HTMLAreasCollection: { - prototype: HTMLAreasCollection; - new(): HTMLAreasCollection; -} - -interface HTMLAudioElement extends HTMLMediaElement { - addEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLAudioElement: { - prototype: HTMLAudioElement; - new(): HTMLAudioElement; -} - -interface HTMLBRElement extends HTMLElement { - /** - * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. - */ - clear: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLBRElement: { - prototype: HTMLBRElement; - new(): HTMLBRElement; -} - -interface HTMLBaseElement extends HTMLElement { - /** - * Gets or sets the baseline URL on which relative links are based. - */ - href: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLBaseElement: { - prototype: HTMLBaseElement; - new(): HTMLBaseElement; -} - -interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; - /** - * Sets or retrieves the font size of the object. - */ - size: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLBaseFontElement: { - prototype: HTMLBaseFontElement; - new(): HTMLBaseFontElement; -} - -interface HTMLBodyElementEventMap extends HTMLElementEventMap { - "afterprint": Event; - "beforeprint": Event; - "beforeunload": BeforeUnloadEvent; - "blur": FocusEvent; - "error": ErrorEvent; - "focus": FocusEvent; - "hashchange": HashChangeEvent; - "load": Event; - "message": MessageEvent; - "offline": Event; - "online": Event; - "orientationchange": Event; - "pagehide": PageTransitionEvent; - "pageshow": PageTransitionEvent; - "popstate": PopStateEvent; - "resize": UIEvent; - "storage": StorageEvent; - "unload": Event; -} - -interface HTMLBodyElement extends HTMLElement { - aLink: any; - background: string; - bgColor: any; - bgProperties: string; - link: any; - noWrap: boolean; - onafterprint: (this: HTMLBodyElement, ev: Event) => any; - onbeforeprint: (this: HTMLBodyElement, ev: Event) => any; - onbeforeunload: (this: HTMLBodyElement, ev: BeforeUnloadEvent) => any; - onblur: (this: HTMLBodyElement, ev: FocusEvent) => any; - onerror: (this: HTMLBodyElement, ev: ErrorEvent) => any; - onfocus: (this: HTMLBodyElement, ev: FocusEvent) => any; - onhashchange: (this: HTMLBodyElement, ev: HashChangeEvent) => any; - onload: (this: HTMLBodyElement, ev: Event) => any; - onmessage: (this: HTMLBodyElement, ev: MessageEvent) => any; - onoffline: (this: HTMLBodyElement, ev: Event) => any; - ononline: (this: HTMLBodyElement, ev: Event) => any; - onorientationchange: (this: HTMLBodyElement, ev: Event) => any; - onpagehide: (this: HTMLBodyElement, ev: PageTransitionEvent) => any; - onpageshow: (this: HTMLBodyElement, ev: PageTransitionEvent) => any; - onpopstate: (this: HTMLBodyElement, ev: PopStateEvent) => any; - onresize: (this: HTMLBodyElement, ev: UIEvent) => any; - onstorage: (this: HTMLBodyElement, ev: StorageEvent) => any; - onunload: (this: HTMLBodyElement, ev: Event) => any; - text: any; - vLink: any; - addEventListener(type: K, listener: (this: HTMLBodyElement, ev: HTMLBodyElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLBodyElement: { - prototype: HTMLBodyElement; - new(): HTMLBodyElement; -} - -interface HTMLButtonElement extends HTMLElement { - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. - */ - formAction: string; - /** - * Used to override the encoding (formEnctype attribute) specified on the form element. - */ - formEnctype: string; - /** - * Overrides the submit method attribute previously specified on a form element. - */ - formMethod: string; - /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. - */ - formNoValidate: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - status: any; - /** - * Gets the classification and default behavior of the button. - */ - type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - /** - * Sets or retrieves the default or selected value of the control. - */ - value: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLButtonElement: { - prototype: HTMLButtonElement; - new(): HTMLButtonElement; -} - -interface HTMLCanvasElement extends HTMLElement { - /** - * Gets or sets the height of a canvas element on a document. - */ - height: number; - /** - * Gets or sets the width of a canvas element on a document. - */ - width: number; - /** - * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. - * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); - */ - getContext(contextId: "2d", contextAttributes?: Canvas2DContextAttributes): CanvasRenderingContext2D | null; - getContext(contextId: "webgl" | "experimental-webgl", contextAttributes?: WebGLContextAttributes): WebGLRenderingContext | null; - getContext(contextId: string, contextAttributes?: {}): CanvasRenderingContext2D | WebGLRenderingContext | null; - /** - * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. - */ - msToBlob(): Blob; - /** - * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. - * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. - */ - toDataURL(type?: string, ...args: any[]): string; - toBlob(callback: (result: Blob | null) => void, type?: string, ...arguments: any[]): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLCanvasElement: { - prototype: HTMLCanvasElement; - new(): HTMLCanvasElement; -} - -interface HTMLCollection { - /** - * Sets or retrieves the number of objects in a collection. - */ - readonly length: number; - /** - * Retrieves an object from various collections. - */ - item(index: number): Element; - /** - * Retrieves a select object or an object from an options collection. - */ - namedItem(name: string): Element; - [index: number]: Element; -} - -declare var HTMLCollection: { - prototype: HTMLCollection; - new(): HTMLCollection; -} - -interface HTMLDListElement extends HTMLElement { - compact: boolean; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLDListElement: { - prototype: HTMLDListElement; - new(): HTMLDListElement; -} - -interface HTMLDataListElement extends HTMLElement { - options: HTMLCollectionOf; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLDataListElement: { - prototype: HTMLDataListElement; - new(): HTMLDataListElement; -} - -interface HTMLDirectoryElement extends HTMLElement { - compact: boolean; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLDirectoryElement: { - prototype: HTMLDirectoryElement; - new(): HTMLDirectoryElement; -} - -interface HTMLDivElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLDivElement: { - prototype: HTMLDivElement; - new(): HTMLDivElement; -} - -interface HTMLDocument extends Document { - addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLDocument: { - prototype: HTMLDocument; - new(): HTMLDocument; -} - -interface HTMLElementEventMap extends ElementEventMap { - "abort": UIEvent; - "activate": UIEvent; - "beforeactivate": UIEvent; - "beforecopy": ClipboardEvent; - "beforecut": ClipboardEvent; - "beforedeactivate": UIEvent; - "beforepaste": ClipboardEvent; - "blur": FocusEvent; - "canplay": Event; - "canplaythrough": Event; - "change": Event; - "click": MouseEvent; - "contextmenu": PointerEvent; - "copy": ClipboardEvent; - "cuechange": Event; - "cut": ClipboardEvent; - "dblclick": MouseEvent; - "deactivate": UIEvent; - "drag": DragEvent; - "dragend": DragEvent; - "dragenter": DragEvent; - "dragleave": DragEvent; - "dragover": DragEvent; - "dragstart": DragEvent; - "drop": DragEvent; - "durationchange": Event; - "emptied": Event; - "ended": MediaStreamErrorEvent; - "error": ErrorEvent; - "focus": FocusEvent; - "input": Event; - "invalid": Event; - "keydown": KeyboardEvent; - "keypress": KeyboardEvent; - "keyup": KeyboardEvent; - "load": Event; - "loadeddata": Event; - "loadedmetadata": Event; - "loadstart": Event; - "mousedown": MouseEvent; - "mouseenter": MouseEvent; - "mouseleave": MouseEvent; - "mousemove": MouseEvent; - "mouseout": MouseEvent; - "mouseover": MouseEvent; - "mouseup": MouseEvent; - "mousewheel": WheelEvent; - "MSContentZoom": UIEvent; - "MSManipulationStateChanged": MSManipulationEvent; - "paste": ClipboardEvent; - "pause": Event; - "play": Event; - "playing": Event; - "progress": ProgressEvent; - "ratechange": Event; - "reset": Event; - "scroll": UIEvent; - "seeked": Event; - "seeking": Event; - "select": UIEvent; - "selectstart": Event; - "stalled": Event; - "submit": Event; - "suspend": Event; - "timeupdate": Event; - "volumechange": Event; - "waiting": Event; -} - -interface HTMLElement extends Element { - accessKey: string; - readonly children: HTMLCollection; - contentEditable: string; - readonly dataset: DOMStringMap; - dir: string; - draggable: boolean; - hidden: boolean; - hideFocus: boolean; - innerHTML: string; - innerText: string; - readonly isContentEditable: boolean; - lang: string; - readonly offsetHeight: number; - readonly offsetLeft: number; - readonly offsetParent: Element; - readonly offsetTop: number; - readonly offsetWidth: number; - onabort: (this: HTMLElement, ev: UIEvent) => any; - onactivate: (this: HTMLElement, ev: UIEvent) => any; - onbeforeactivate: (this: HTMLElement, ev: UIEvent) => any; - onbeforecopy: (this: HTMLElement, ev: ClipboardEvent) => any; - onbeforecut: (this: HTMLElement, ev: ClipboardEvent) => any; - onbeforedeactivate: (this: HTMLElement, ev: UIEvent) => any; - onbeforepaste: (this: HTMLElement, ev: ClipboardEvent) => any; - onblur: (this: HTMLElement, ev: FocusEvent) => any; - oncanplay: (this: HTMLElement, ev: Event) => any; - oncanplaythrough: (this: HTMLElement, ev: Event) => any; - onchange: (this: HTMLElement, ev: Event) => any; - onclick: (this: HTMLElement, ev: MouseEvent) => any; - oncontextmenu: (this: HTMLElement, ev: PointerEvent) => any; - oncopy: (this: HTMLElement, ev: ClipboardEvent) => any; - oncuechange: (this: HTMLElement, ev: Event) => any; - oncut: (this: HTMLElement, ev: ClipboardEvent) => any; - ondblclick: (this: HTMLElement, ev: MouseEvent) => any; - ondeactivate: (this: HTMLElement, ev: UIEvent) => any; - ondrag: (this: HTMLElement, ev: DragEvent) => any; - ondragend: (this: HTMLElement, ev: DragEvent) => any; - ondragenter: (this: HTMLElement, ev: DragEvent) => any; - ondragleave: (this: HTMLElement, ev: DragEvent) => any; - ondragover: (this: HTMLElement, ev: DragEvent) => any; - ondragstart: (this: HTMLElement, ev: DragEvent) => any; - ondrop: (this: HTMLElement, ev: DragEvent) => any; - ondurationchange: (this: HTMLElement, ev: Event) => any; - onemptied: (this: HTMLElement, ev: Event) => any; - onended: (this: HTMLElement, ev: MediaStreamErrorEvent) => any; - onerror: (this: HTMLElement, ev: ErrorEvent) => any; - onfocus: (this: HTMLElement, ev: FocusEvent) => any; - oninput: (this: HTMLElement, ev: Event) => any; - oninvalid: (this: HTMLElement, ev: Event) => any; - onkeydown: (this: HTMLElement, ev: KeyboardEvent) => any; - onkeypress: (this: HTMLElement, ev: KeyboardEvent) => any; - onkeyup: (this: HTMLElement, ev: KeyboardEvent) => any; - onload: (this: HTMLElement, ev: Event) => any; - onloadeddata: (this: HTMLElement, ev: Event) => any; - onloadedmetadata: (this: HTMLElement, ev: Event) => any; - onloadstart: (this: HTMLElement, ev: Event) => any; - onmousedown: (this: HTMLElement, ev: MouseEvent) => any; - onmouseenter: (this: HTMLElement, ev: MouseEvent) => any; - onmouseleave: (this: HTMLElement, ev: MouseEvent) => any; - onmousemove: (this: HTMLElement, ev: MouseEvent) => any; - onmouseout: (this: HTMLElement, ev: MouseEvent) => any; - onmouseover: (this: HTMLElement, ev: MouseEvent) => any; - onmouseup: (this: HTMLElement, ev: MouseEvent) => any; - onmousewheel: (this: HTMLElement, ev: WheelEvent) => any; - onmscontentzoom: (this: HTMLElement, ev: UIEvent) => any; - onmsmanipulationstatechanged: (this: HTMLElement, ev: MSManipulationEvent) => any; - onpaste: (this: HTMLElement, ev: ClipboardEvent) => any; - onpause: (this: HTMLElement, ev: Event) => any; - onplay: (this: HTMLElement, ev: Event) => any; - onplaying: (this: HTMLElement, ev: Event) => any; - onprogress: (this: HTMLElement, ev: ProgressEvent) => any; - onratechange: (this: HTMLElement, ev: Event) => any; - onreset: (this: HTMLElement, ev: Event) => any; - onscroll: (this: HTMLElement, ev: UIEvent) => any; - onseeked: (this: HTMLElement, ev: Event) => any; - onseeking: (this: HTMLElement, ev: Event) => any; - onselect: (this: HTMLElement, ev: UIEvent) => any; - onselectstart: (this: HTMLElement, ev: Event) => any; - onstalled: (this: HTMLElement, ev: Event) => any; - onsubmit: (this: HTMLElement, ev: Event) => any; - onsuspend: (this: HTMLElement, ev: Event) => any; - ontimeupdate: (this: HTMLElement, ev: Event) => any; - onvolumechange: (this: HTMLElement, ev: Event) => any; - onwaiting: (this: HTMLElement, ev: Event) => any; - outerHTML: string; - outerText: string; - spellcheck: boolean; - readonly style: CSSStyleDeclaration; - tabIndex: number; - title: string; - blur(): void; - click(): void; - dragDrop(): boolean; - focus(): void; - msGetInputContext(): MSInputMethodContext; - setActive(): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLElement: { - prototype: HTMLElement; - new(): HTMLElement; -} - -interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { - /** - * Sets or retrieves the height of the object. - */ - height: string; - hidden: any; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - readonly msPlayToSource: any; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Retrieves the palette used for the embedded document. - */ - readonly palette: string; - /** - * Retrieves the URL of the plug-in used to view an embedded document. - */ - readonly pluginspage: string; - readonly readyState: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the height and width units of the embed object. - */ - units: string; - /** - * Sets or retrieves the width of the object. - */ - width: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLEmbedElement: { - prototype: HTMLEmbedElement; - new(): HTMLEmbedElement; -} - -interface HTMLFieldSetElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLFieldSetElement: { - prototype: HTMLFieldSetElement; - new(): HTMLFieldSetElement; -} - -interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLFontElement: { - prototype: HTMLFontElement; - new(): HTMLFontElement; -} - -interface HTMLFormElement extends HTMLElement { - /** - * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. - */ - acceptCharset: string; - /** - * Sets or retrieves the URL to which the form content is sent for processing. - */ - action: string; - /** - * Specifies whether autocomplete is applied to an editable text field. - */ - autocomplete: string; - /** - * Retrieves a collection, in source order, of all controls in a given form. - */ - readonly elements: HTMLCollection; - /** - * Sets or retrieves the MIME encoding for the form. - */ - encoding: string; - /** - * Sets or retrieves the encoding type for the form. - */ - enctype: string; - /** - * Sets or retrieves the number of objects in a collection. - */ - readonly length: number; - /** - * Sets or retrieves how to send the form data to the server. - */ - method: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Designates a form that is not validated when submitted. - */ - noValidate: boolean; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Retrieves a form object or an object from an elements collection. - * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. - * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. - */ - item(name?: any, index?: any): any; - /** - * Retrieves a form object or an object from an elements collection. - */ - namedItem(name: string): any; - /** - * Fires when the user resets a form. - */ - reset(): void; - /** - * Fires when a FORM is about to be submitted. - */ - submit(): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [name: string]: any; -} - -declare var HTMLFormElement: { - prototype: HTMLFormElement; - new(): HTMLFormElement; -} - -interface HTMLFrameElementEventMap extends HTMLElementEventMap { - "load": Event; -} - -interface HTMLFrameElement extends HTMLElement, GetSVGDocument { - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Retrieves the document object of the page or frame. - */ - readonly contentDocument: Document; - /** - * Retrieves the object of the specified. - */ - readonly contentWindow: Window; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves the height of the object. - */ - height: string | number; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Raised when the object has been completely received from the server. - */ - onload: (this: HTMLFrameElement, ev: Event) => any; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the width of the object. - */ - width: string | number; - addEventListener(type: K, listener: (this: HTMLFrameElement, ev: HTMLFrameElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLFrameElement: { - prototype: HTMLFrameElement; - new(): HTMLFrameElement; -} - -interface HTMLFrameSetElementEventMap extends HTMLElementEventMap { - "beforeprint": Event; - "beforeunload": BeforeUnloadEvent; - "blur": FocusEvent; - "error": ErrorEvent; - "focus": FocusEvent; - "hashchange": HashChangeEvent; - "load": Event; - "message": MessageEvent; - "offline": Event; - "online": Event; - "orientationchange": Event; - "pagehide": PageTransitionEvent; - "pageshow": PageTransitionEvent; - "resize": UIEvent; - "storage": StorageEvent; - "unload": Event; -} - -interface HTMLFrameSetElement extends HTMLElement { - border: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the frame widths of the object. - */ - cols: string; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - name: string; - onafterprint: (this: HTMLFrameSetElement, ev: Event) => any; - onbeforeprint: (this: HTMLFrameSetElement, ev: Event) => any; - onbeforeunload: (this: HTMLFrameSetElement, ev: BeforeUnloadEvent) => any; - /** - * Fires when the object loses the input focus. - */ - onblur: (this: HTMLFrameSetElement, ev: FocusEvent) => any; - onerror: (this: HTMLFrameSetElement, ev: ErrorEvent) => any; - /** - * Fires when the object receives focus. - */ - onfocus: (this: HTMLFrameSetElement, ev: FocusEvent) => any; - onhashchange: (this: HTMLFrameSetElement, ev: HashChangeEvent) => any; - onload: (this: HTMLFrameSetElement, ev: Event) => any; - onmessage: (this: HTMLFrameSetElement, ev: MessageEvent) => any; - onoffline: (this: HTMLFrameSetElement, ev: Event) => any; - ononline: (this: HTMLFrameSetElement, ev: Event) => any; - onorientationchange: (this: HTMLFrameSetElement, ev: Event) => any; - onpagehide: (this: HTMLFrameSetElement, ev: PageTransitionEvent) => any; - onpageshow: (this: HTMLFrameSetElement, ev: PageTransitionEvent) => any; - onresize: (this: HTMLFrameSetElement, ev: UIEvent) => any; - onstorage: (this: HTMLFrameSetElement, ev: StorageEvent) => any; - onunload: (this: HTMLFrameSetElement, ev: Event) => any; - /** - * Sets or retrieves the frame heights of the object. - */ - rows: string; - addEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLFrameSetElement: { - prototype: HTMLFrameSetElement; - new(): HTMLFrameSetElement; -} - -interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. - */ - noShade: boolean; - /** - * Sets or retrieves the width of the object. - */ - width: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLHRElement: { - prototype: HTMLHRElement; - new(): HTMLHRElement; -} - -interface HTMLHeadElement extends HTMLElement { - profile: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLHeadElement: { - prototype: HTMLHeadElement; - new(): HTMLHeadElement; -} - -interface HTMLHeadingElement extends HTMLElement { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLHeadingElement: { - prototype: HTMLHeadingElement; - new(): HTMLHeadingElement; -} - -interface HTMLHtmlElement extends HTMLElement { - /** - * Sets or retrieves the DTD version that governs the current document. - */ - version: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLHtmlElement: { - prototype: HTMLHtmlElement; - new(): HTMLHtmlElement; -} - -interface HTMLIFrameElementEventMap extends HTMLElementEventMap { - "load": Event; -} - -interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - allowFullscreen: boolean; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Retrieves the document object of the page or frame. - */ - readonly contentDocument: Document; - /** - * Retrieves the object of the specified. - */ - readonly contentWindow: Window; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the horizontal margin for the object. - */ - hspace: number; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Raised when the object has been completely received from the server. - */ - onload: (this: HTMLIFrameElement, ev: Event) => any; - readonly sandbox: DOMSettableTokenList; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Sets or retrieves the width of the object. - */ - width: string; - addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLIFrameElement: { - prototype: HTMLIFrameElement; - new(): HTMLIFrameElement; -} - -interface HTMLImageElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Retrieves whether the object is fully loaded. - */ - readonly complete: boolean; - crossOrigin: string; - readonly currentSrc: string; - /** - * Sets or retrieves the height of the object. - */ - height: number; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - /** - * Sets or retrieves whether the image is a server-side image map. - */ - isMap: boolean; - /** - * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. - */ - longDesc: string; - lowsrc: string; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - readonly msPlayToSource: any; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * The original height of the image resource before sizing. - */ - readonly naturalHeight: number; - /** - * The original width of the image resource before sizing. - */ - readonly naturalWidth: number; - sizes: string; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - srcset: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Sets or retrieves the width of the object. - */ - width: number; - readonly x: number; - readonly y: number; - msGetAsCastingSource(): any; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLImageElement: { - prototype: HTMLImageElement; - new(): HTMLImageElement; - create(): HTMLImageElement; -} - -interface HTMLInputElement extends HTMLElement { - /** - * Sets or retrieves a comma-separated list of content types. - */ - accept: string; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Specifies whether autocomplete is applied to an editable text field. - */ - autocomplete: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - /** - * Sets or retrieves the state of the check box or radio button. - */ - checked: boolean; - /** - * Retrieves whether the object is fully loaded. - */ - readonly complete: boolean; - /** - * Sets or retrieves the state of the check box or radio button. - */ - defaultChecked: boolean; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - disabled: boolean; - /** - * Returns a FileList object on a file type input object. - */ - readonly files: FileList | null; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. - */ - formAction: string; - /** - * Used to override the encoding (formEnctype attribute) specified on the form element. - */ - formEnctype: string; - /** - * Overrides the submit method attribute previously specified on a form element. - */ - formMethod: string; - /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. - */ - formNoValidate: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - indeterminate: boolean; - /** - * Specifies the ID of a pre-defined datalist of options for an input element. - */ - readonly list: HTMLElement; - /** - * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. - */ - max: string; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. - */ - min: string; - /** - * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. - */ - multiple: boolean; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets or sets a string containing a regular expression that the user's input must match. - */ - pattern: string; - /** - * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. - */ - placeholder: string; - readOnly: boolean; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - selectionDirection: string; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - size: number; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - status: boolean; - /** - * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. - */ - step: string; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - /** - * Returns the value of the data at the cursor's current position. - */ - value: string; - valueAsDate: Date; - /** - * Returns the input field value as a number. - */ - valueAsNumber: number; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - webkitdirectory: boolean; - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - minLength: number; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Makes the selection equal to the current object. - */ - select(): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - /** - * Sets the start and end positions of a selection in a text field. - * @param start The offset into the text field for the start of the selection. - * @param end The offset into the text field for the end of the selection. - */ - setSelectionRange(start?: number, end?: number, direction?: string): void; - /** - * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. - * @param n Value to decrement the value by. - */ - stepDown(n?: number): void; - /** - * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. - * @param n Value to increment the value by. - */ - stepUp(n?: number): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLInputElement: { - prototype: HTMLInputElement; - new(): HTMLInputElement; -} - -interface HTMLLIElement extends HTMLElement { - type: string; - /** - * Sets or retrieves the value of a list item. - */ - value: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLLIElement: { - prototype: HTMLLIElement; - new(): HTMLLIElement; -} - -interface HTMLLabelElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the object to which the given label object is assigned. - */ - htmlFor: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLLabelElement: { - prototype: HTMLLabelElement; - new(): HTMLLabelElement; -} - -interface HTMLLegendElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - align: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLLegendElement: { - prototype: HTMLLegendElement; - new(): HTMLLegendElement; -} - -interface HTMLLinkElement extends HTMLElement, LinkStyle { - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - disabled: boolean; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; - /** - * Sets or retrieves the media type. - */ - media: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves the MIME type of the object. - */ - type: string; - import?: Document; - integrity: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLLinkElement: { - prototype: HTMLLinkElement; - new(): HTMLLinkElement; -} - -interface HTMLMapElement extends HTMLElement { - /** - * Retrieves a collection of the area objects defined for the given map object. - */ - readonly areas: HTMLAreasCollection; - /** - * Sets or retrieves the name of the object. - */ - name: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMapElement: { - prototype: HTMLMapElement; - new(): HTMLMapElement; -} - -interface HTMLMarqueeElementEventMap extends HTMLElementEventMap { - "bounce": Event; - "finish": Event; - "start": Event; -} - -interface HTMLMarqueeElement extends HTMLElement { - behavior: string; - bgColor: any; - direction: string; - height: string; - hspace: number; - loop: number; - onbounce: (this: HTMLMarqueeElement, ev: Event) => any; - onfinish: (this: HTMLMarqueeElement, ev: Event) => any; - onstart: (this: HTMLMarqueeElement, ev: Event) => any; - scrollAmount: number; - scrollDelay: number; - trueSpeed: boolean; - vspace: number; - width: string; - start(): void; - stop(): void; - addEventListener(type: K, listener: (this: HTMLMarqueeElement, ev: HTMLMarqueeElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMarqueeElement: { - prototype: HTMLMarqueeElement; - new(): HTMLMarqueeElement; -} - -interface HTMLMediaElementEventMap extends HTMLElementEventMap { - "encrypted": MediaEncryptedEvent; - "msneedkey": MSMediaKeyNeededEvent; -} - -interface HTMLMediaElement extends HTMLElement { - /** - * Returns an AudioTrackList object with the audio tracks for a given video element. - */ - readonly audioTracks: AudioTrackList; - /** - * Gets or sets a value that indicates whether to start playing the media automatically. - */ - autoplay: boolean; - /** - * Gets a collection of buffered time ranges. - */ - readonly buffered: TimeRanges; - /** - * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). - */ - controls: boolean; - crossOrigin: string; - /** - * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. - */ - readonly currentSrc: string; - /** - * Gets or sets the current playback position, in seconds. - */ - currentTime: number; - defaultMuted: boolean; - /** - * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. - */ - defaultPlaybackRate: number; - /** - * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. - */ - readonly duration: number; - /** - * Gets information about whether the playback has ended or not. - */ - readonly ended: boolean; - /** - * Returns an object representing the current error state of the audio or video element. - */ - readonly error: MediaError; - /** - * Gets or sets a flag to specify whether playback should restart after it completes. - */ - loop: boolean; - readonly mediaKeys: MediaKeys | null; - /** - * Specifies the purpose of the audio or video media, such as background audio or alerts. - */ - msAudioCategory: string; - /** - * Specifies the output device id that the audio will be sent to. - */ - msAudioDeviceType: string; - readonly msGraphicsTrustStatus: MSGraphicsTrust; - /** - * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. - */ - readonly msKeys: MSMediaKeys; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - readonly msPlayToSource: any; - /** - * Specifies whether or not to enable low-latency playback on the media element. - */ - msRealTime: boolean; - /** - * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. - */ - muted: boolean; - /** - * Gets the current network activity for the element. - */ - readonly networkState: number; - onencrypted: (this: HTMLMediaElement, ev: MediaEncryptedEvent) => any; - onmsneedkey: (this: HTMLMediaElement, ev: MSMediaKeyNeededEvent) => any; - /** - * Gets a flag that specifies whether playback is paused. - */ - readonly paused: boolean; - /** - * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. - */ - playbackRate: number; - /** - * Gets TimeRanges for the current media resource that has been played. - */ - readonly played: TimeRanges; - /** - * Gets or sets the current playback position, in seconds. - */ - preload: string; - readyState: number; - /** - * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. - */ - readonly seekable: TimeRanges; - /** - * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. - */ - readonly seeking: boolean; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - srcObject: MediaStream | null; - readonly textTracks: TextTrackList; - readonly videoTracks: VideoTrackList; - /** - * Gets or sets the volume level for audio portions of the media element. - */ - volume: number; - addTextTrack(kind: string, label?: string, language?: string): TextTrack; - /** - * Returns a string that specifies whether the client can play a given media resource type. - */ - canPlayType(type: string): string; - /** - * Resets the audio or video object and loads a new media resource. - */ - load(): void; - /** - * Clears all effects from the media pipeline. - */ - msClearEffects(): void; - msGetAsCastingSource(): any; - /** - * Inserts the specified audio effect into media pipeline. - */ - msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetMediaKeys(mediaKeys: MSMediaKeys): void; - /** - * Specifies the media protection manager for a given media pipeline. - */ - msSetMediaProtectionManager(mediaProtectionManager?: any): void; - /** - * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. - */ - pause(): void; - /** - * Loads and starts playback of a media resource. - */ - play(): void; - setMediaKeys(mediaKeys: MediaKeys | null): PromiseLike; - readonly HAVE_CURRENT_DATA: number; - readonly HAVE_ENOUGH_DATA: number; - readonly HAVE_FUTURE_DATA: number; - readonly HAVE_METADATA: number; - readonly HAVE_NOTHING: number; - readonly NETWORK_EMPTY: number; - readonly NETWORK_IDLE: number; - readonly NETWORK_LOADING: number; - readonly NETWORK_NO_SOURCE: number; - addEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMediaElement: { - prototype: HTMLMediaElement; - new(): HTMLMediaElement; - readonly HAVE_CURRENT_DATA: number; - readonly HAVE_ENOUGH_DATA: number; - readonly HAVE_FUTURE_DATA: number; - readonly HAVE_METADATA: number; - readonly HAVE_NOTHING: number; - readonly NETWORK_EMPTY: number; - readonly NETWORK_IDLE: number; - readonly NETWORK_LOADING: number; - readonly NETWORK_NO_SOURCE: number; -} - -interface HTMLMenuElement extends HTMLElement { - compact: boolean; - type: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMenuElement: { - prototype: HTMLMenuElement; - new(): HTMLMenuElement; -} - -interface HTMLMetaElement extends HTMLElement { - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Gets or sets meta-information to associate with httpEquiv or name. - */ - content: string; - /** - * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. - */ - httpEquiv: string; - /** - * Sets or retrieves the value specified in the content attribute of the meta object. - */ - name: string; - /** - * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. - */ - scheme: string; - /** - * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. - */ - url: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMetaElement: { - prototype: HTMLMetaElement; - new(): HTMLMetaElement; -} - -interface HTMLMeterElement extends HTMLElement { - high: number; - low: number; - max: number; - min: number; - optimum: number; - value: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMeterElement: { - prototype: HTMLMeterElement; - new(): HTMLMeterElement; -} - -interface HTMLModElement extends HTMLElement { - /** - * Sets or retrieves reference information about the object. - */ - cite: string; - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLModElement: { - prototype: HTMLModElement; - new(): HTMLModElement; -} - -interface HTMLOListElement extends HTMLElement { - compact: boolean; - /** - * The starting number. - */ - start: number; - type: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLOListElement: { - prototype: HTMLOListElement; - new(): HTMLOListElement; -} - -interface HTMLObjectElement extends HTMLElement, GetSVGDocument { - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - readonly BaseHref: string; - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. - */ - altHtml: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - border: string; - /** - * Sets or retrieves the URL of the file containing the compiled Java class. - */ - code: string; - /** - * Sets or retrieves the URL of the component. - */ - codeBase: string; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - /** - * Retrieves the document object of the page or frame. - */ - readonly contentDocument: Document; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; - declare: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the height of the object. - */ - height: string; - hspace: number; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - readonly msPlayToSource: any; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Retrieves the contained object. - */ - readonly object: any; - readonly readyState: number; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Sets or retrieves the MIME type of the object. - */ - type: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - vspace: number; - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLObjectElement: { - prototype: HTMLObjectElement; - new(): HTMLObjectElement; -} - -interface HTMLOptGroupElement extends HTMLElement { - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the ordinal position of an option in a list box. - */ - readonly index: number; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; - /** - * Sets or retrieves the text string specified by the option tag. - */ - readonly text: string; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLOptGroupElement: { - prototype: HTMLOptGroupElement; - new(): HTMLOptGroupElement; -} - -interface HTMLOptionElement extends HTMLElement { - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the ordinal position of an option in a list box. - */ - readonly index: number; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; - /** - * Sets or retrieves the text string specified by the option tag. - */ - text: string; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLOptionElement: { - prototype: HTMLOptionElement; - new(): HTMLOptionElement; - create(): HTMLOptionElement; -} - -interface HTMLOptionsCollection extends HTMLCollectionOf { - length: number; - selectedIndex: number; - add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number): void; - remove(index: number): void; -} - -declare var HTMLOptionsCollection: { - prototype: HTMLOptionsCollection; - new(): HTMLOptionsCollection; -} - -interface HTMLParagraphElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - clear: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLParagraphElement: { - prototype: HTMLParagraphElement; - new(): HTMLParagraphElement; -} - -interface HTMLParamElement extends HTMLElement { - /** - * Sets or retrieves the name of an input parameter for an element. - */ - name: string; - /** - * Sets or retrieves the content type of the resource designated by the value attribute. - */ - type: string; - /** - * Sets or retrieves the value of an input parameter for an element. - */ - value: string; - /** - * Sets or retrieves the data type of the value attribute. - */ - valueType: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLParamElement: { - prototype: HTMLParamElement; - new(): HTMLParamElement; -} - -interface HTMLPictureElement extends HTMLElement { - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLPictureElement: { - prototype: HTMLPictureElement; - new(): HTMLPictureElement; -} - -interface HTMLPreElement extends HTMLElement { - /** - * Sets or gets a value that you can use to implement your own width functionality for the object. - */ - width: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLPreElement: { - prototype: HTMLPreElement; - new(): HTMLPreElement; -} - -interface HTMLProgressElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Defines the maximum, or "done" value for a progress element. - */ - max: number; - /** - * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). - */ - readonly position: number; - /** - * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. - */ - value: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLProgressElement: { - prototype: HTMLProgressElement; - new(): HTMLProgressElement; -} - -interface HTMLQuoteElement extends HTMLElement { - /** - * Sets or retrieves reference information about the object. - */ - cite: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLQuoteElement: { - prototype: HTMLQuoteElement; - new(): HTMLQuoteElement; -} - -interface HTMLScriptElement extends HTMLElement { - async: boolean; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the status of the script. - */ - defer: boolean; - /** - * Sets or retrieves the event for which the script is written. - */ - event: string; - /** - * Sets or retrieves the object that is bound to the event script. - */ - htmlFor: string; - /** - * Retrieves the URL to an external file that contains the source code or data. - */ - src: string; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - /** - * Sets or retrieves the MIME type for the associated scripting engine. - */ - type: string; - integrity: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLScriptElement: { - prototype: HTMLScriptElement; - new(): HTMLScriptElement; -} - -interface HTMLSelectElement extends HTMLElement { - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. - */ - multiple: boolean; - /** - * Sets or retrieves the name of the object. - */ - name: string; - readonly options: HTMLOptionsCollection; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Sets or retrieves the index of the selected option in a select object. - */ - selectedIndex: number; - selectedOptions: HTMLCollectionOf; - /** - * Sets or retrieves the number of rows in the list box. - */ - size: number; - /** - * Retrieves the type of select control based on the value of the MULTIPLE attribute. - */ - readonly type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - /** - * Adds an element to the areas, controlRange, or options collection. - * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. - * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection. - */ - add(element: HTMLElement, before?: HTMLElement | number): void; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Retrieves a select object or an object from an options collection. - * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. - * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. - */ - item(name?: any, index?: any): any; - /** - * Retrieves a select object or an object from an options collection. - * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made. - */ - namedItem(name: string): any; - /** - * Removes an element from the collection. - * @param index Number that specifies the zero-based index of the element to remove from the collection. - */ - remove(index?: number): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [name: string]: any; -} - -declare var HTMLSelectElement: { - prototype: HTMLSelectElement; - new(): HTMLSelectElement; -} - -interface HTMLSourceElement extends HTMLElement { - /** - * Gets or sets the intended media type of the media source. - */ - media: string; - msKeySystem: string; - sizes: string; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - srcset: string; - /** - * Gets or sets the MIME type of a media resource. - */ - type: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLSourceElement: { - prototype: HTMLSourceElement; - new(): HTMLSourceElement; -} - -interface HTMLSpanElement extends HTMLElement { - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLSpanElement: { - prototype: HTMLSpanElement; - new(): HTMLSpanElement; -} - -interface HTMLStyleElement extends HTMLElement, LinkStyle { - disabled: boolean; - /** - * Sets or retrieves the media type. - */ - media: string; - /** - * Retrieves the CSS language in which the style sheet is written. - */ - type: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLStyleElement: { - prototype: HTMLStyleElement; - new(): HTMLStyleElement; -} - -interface HTMLTableCaptionElement extends HTMLElement { - /** - * Sets or retrieves the alignment of the caption or legend. - */ - align: string; - /** - * Sets or retrieves whether the caption appears at the top or bottom of the table. - */ - vAlign: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableCaptionElement: { - prototype: HTMLTableCaptionElement; - new(): HTMLTableCaptionElement; -} - -interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves abbreviated text for the object. - */ - abbr: string; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. - */ - axis: string; - bgColor: any; - /** - * Retrieves the position of the object in the cells collection of a row. - */ - readonly cellIndex: number; - /** - * Sets or retrieves the number columns in the table that the object should span. - */ - colSpan: number; - /** - * Sets or retrieves a list of header cells that provide information for the object. - */ - headers: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; - /** - * Sets or retrieves how many rows in a table the cell should span. - */ - rowSpan: number; - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; - /** - * Sets or retrieves the width of the object. - */ - width: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableCellElement: { - prototype: HTMLTableCellElement; - new(): HTMLTableCellElement; -} - -interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves the alignment of the object relative to the display or table. - */ - align: string; - /** - * Sets or retrieves the number of columns in the group. - */ - span: number; - /** - * Sets or retrieves the width of the object. - */ - width: any; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableColElement: { - prototype: HTMLTableColElement; - new(): HTMLTableColElement; -} - -interface HTMLTableDataCellElement extends HTMLTableCellElement { -} - -declare var HTMLTableDataCellElement: { - prototype: HTMLTableDataCellElement; - new(): HTMLTableDataCellElement; -} - -interface HTMLTableElement extends HTMLElement { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - bgColor: any; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Retrieves the caption object of a table. - */ - caption: HTMLTableCaptionElement; - /** - * Sets or retrieves the amount of space between the border of the cell and the content of the cell. - */ - cellPadding: string; - /** - * Sets or retrieves the amount of space between cells in a table. - */ - cellSpacing: string; - /** - * Sets or retrieves the number of columns in the table. - */ - cols: number; - /** - * Sets or retrieves the way the border frame around the table is displayed. - */ - frame: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: HTMLCollectionOf; - /** - * Sets or retrieves which dividing lines (inner borders) are displayed. - */ - rules: string; - /** - * Sets or retrieves a description and/or structure of the object. - */ - summary: string; - /** - * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. - */ - tBodies: HTMLCollectionOf; - /** - * Retrieves the tFoot object of the table. - */ - tFoot: HTMLTableSectionElement; - /** - * Retrieves the tHead object of the table. - */ - tHead: HTMLTableSectionElement; - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Creates an empty caption element in the table. - */ - createCaption(): HTMLTableCaptionElement; - /** - * Creates an empty tBody element in the table. - */ - createTBody(): HTMLTableSectionElement; - /** - * Creates an empty tFoot element in the table. - */ - createTFoot(): HTMLTableSectionElement; - /** - * Returns the tHead element object if successful, or null otherwise. - */ - createTHead(): HTMLTableSectionElement; - /** - * Deletes the caption element and its contents from the table. - */ - deleteCaption(): void; - /** - * Removes the specified row (tr) from the element and from the rows collection. - * @param index Number that specifies the zero-based position in the rows collection of the row to remove. - */ - deleteRow(index?: number): void; - /** - * Deletes the tFoot element and its contents from the table. - */ - deleteTFoot(): void; - /** - * Deletes the tHead element and its contents from the table. - */ - deleteTHead(): void; - /** - * Creates a new row (tr) in the table, and adds the row to the rows collection. - * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. - */ - insertRow(index?: number): HTMLTableRowElement; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableElement: { - prototype: HTMLTableElement; - new(): HTMLTableElement; -} - -interface HTMLTableHeaderCellElement extends HTMLTableCellElement { - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; -} - -declare var HTMLTableHeaderCellElement: { - prototype: HTMLTableHeaderCellElement; - new(): HTMLTableHeaderCellElement; -} - -interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - bgColor: any; - /** - * Retrieves a collection of all cells in the table row. - */ - cells: HTMLCollectionOf; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Retrieves the position of the object in the rows collection for the table. - */ - readonly rowIndex: number; - /** - * Retrieves the position of the object in the collection. - */ - readonly sectionRowIndex: number; - /** - * Removes the specified cell from the table row, as well as from the cells collection. - * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted. - */ - deleteCell(index?: number): void; - /** - * Creates a new cell in the table row, and adds the cell to the cells collection. - * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. - */ - insertCell(index?: number): HTMLTableDataCellElement; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableRowElement: { - prototype: HTMLTableRowElement; - new(): HTMLTableRowElement; -} - -interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: HTMLCollectionOf; - /** - * Removes the specified row (tr) from the element and from the rows collection. - * @param index Number that specifies the zero-based position in the rows collection of the row to remove. - */ - deleteRow(index?: number): void; - /** - * Creates a new row (tr) in the table, and adds the row to the rows collection. - * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. - */ - insertRow(index?: number): HTMLTableRowElement; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableSectionElement: { - prototype: HTMLTableSectionElement; - new(): HTMLTableSectionElement; -} - -interface HTMLTemplateElement extends HTMLElement { - readonly content: DocumentFragment; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTemplateElement: { - prototype: HTMLTemplateElement; - new(): HTMLTemplateElement; -} - -interface HTMLTextAreaElement extends HTMLElement { - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Sets or retrieves the width of the object. - */ - cols: number; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. - */ - placeholder: string; - /** - * Sets or retrieves the value indicated whether the content of the object is read-only. - */ - readOnly: boolean; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: number; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - /** - * Sets or retrieves the value indicating whether the control is selected. - */ - status: any; - /** - * Retrieves the type of control. - */ - readonly type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - /** - * Retrieves or sets the text in the entry field of the textArea element. - */ - value: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - /** - * Sets or retrieves how to handle wordwrapping in the object. - */ - wrap: string; - minLength: number; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Highlights the input area of a form element. - */ - select(): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - /** - * Sets the start and end positions of a selection in a text field. - * @param start The offset into the text field for the start of the selection. - * @param end The offset into the text field for the end of the selection. - */ - setSelectionRange(start: number, end: number): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTextAreaElement: { - prototype: HTMLTextAreaElement; - new(): HTMLTextAreaElement; -} - -interface HTMLTitleElement extends HTMLElement { - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTitleElement: { - prototype: HTMLTitleElement; - new(): HTMLTitleElement; -} - -interface HTMLTrackElement extends HTMLElement { - default: boolean; - kind: string; - label: string; - readonly readyState: number; - src: string; - srclang: string; - readonly track: TextTrack; - readonly ERROR: number; - readonly LOADED: number; - readonly LOADING: number; - readonly NONE: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTrackElement: { - prototype: HTMLTrackElement; - new(): HTMLTrackElement; - readonly ERROR: number; - readonly LOADED: number; - readonly LOADING: number; - readonly NONE: number; -} - -interface HTMLUListElement extends HTMLElement { - compact: boolean; - type: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLUListElement: { - prototype: HTMLUListElement; - new(): HTMLUListElement; -} - -interface HTMLUnknownElement extends HTMLElement { - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLUnknownElement: { - prototype: HTMLUnknownElement; - new(): HTMLUnknownElement; -} - -interface HTMLVideoElementEventMap extends HTMLMediaElementEventMap { - "MSVideoFormatChanged": Event; - "MSVideoFrameStepCompleted": Event; - "MSVideoOptimalLayoutChanged": Event; -} - -interface HTMLVideoElement extends HTMLMediaElement { - /** - * Gets or sets the height of the video element. - */ - height: number; - msHorizontalMirror: boolean; - readonly msIsLayoutOptimalForPlayback: boolean; - readonly msIsStereo3D: boolean; - msStereo3DPackingMode: string; - msStereo3DRenderMode: string; - msZoom: boolean; - onMSVideoFormatChanged: (this: HTMLVideoElement, ev: Event) => any; - onMSVideoFrameStepCompleted: (this: HTMLVideoElement, ev: Event) => any; - onMSVideoOptimalLayoutChanged: (this: HTMLVideoElement, ev: Event) => any; - /** - * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. - */ - poster: string; - /** - * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. - */ - readonly videoHeight: number; - /** - * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. - */ - readonly videoWidth: number; - readonly webkitDisplayingFullscreen: boolean; - readonly webkitSupportsFullscreen: boolean; - /** - * Gets or sets the width of the video element. - */ - width: number; - getVideoPlaybackQuality(): VideoPlaybackQuality; - msFrameStep(forward: boolean): void; - msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; - webkitEnterFullScreen(): void; - webkitEnterFullscreen(): void; - webkitExitFullScreen(): void; - webkitExitFullscreen(): void; - addEventListener(type: K, listener: (this: HTMLVideoElement, ev: HTMLVideoElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLVideoElement: { - prototype: HTMLVideoElement; - new(): HTMLVideoElement; -} - -interface HashChangeEvent extends Event { - readonly newURL: string | null; - readonly oldURL: string | null; -} - -declare var HashChangeEvent: { - prototype: HashChangeEvent; - new(type: string, eventInitDict?: HashChangeEventInit): HashChangeEvent; -} - -interface History { - readonly length: number; - readonly state: any; - scrollRestoration: ScrollRestoration; - back(): void; - forward(): void; - go(delta?: number): void; - pushState(data: any, title: string, url?: string | null): void; - replaceState(data: any, title: string, url?: string | null): void; -} - -declare var History: { - prototype: History; - new(): History; -} - -interface IDBCursor { - readonly direction: string; - key: IDBKeyRange | IDBValidKey; - readonly primaryKey: any; - source: IDBObjectStore | IDBIndex; - advance(count: number): void; - continue(key?: IDBKeyRange | IDBValidKey): void; - delete(): IDBRequest; - update(value: any): IDBRequest; - readonly NEXT: string; - readonly NEXT_NO_DUPLICATE: string; - readonly PREV: string; - readonly PREV_NO_DUPLICATE: string; -} - -declare var IDBCursor: { - prototype: IDBCursor; - new(): IDBCursor; - readonly NEXT: string; - readonly NEXT_NO_DUPLICATE: string; - readonly PREV: string; - readonly PREV_NO_DUPLICATE: string; -} - -interface IDBCursorWithValue extends IDBCursor { - readonly value: any; -} - -declare var IDBCursorWithValue: { - prototype: IDBCursorWithValue; - new(): IDBCursorWithValue; -} - -interface IDBDatabaseEventMap { - "abort": Event; - "error": ErrorEvent; -} - -interface IDBDatabase extends EventTarget { - readonly name: string; - readonly objectStoreNames: DOMStringList; - onabort: (this: IDBDatabase, ev: Event) => any; - onerror: (this: IDBDatabase, ev: ErrorEvent) => any; - version: number; - onversionchange: (ev: IDBVersionChangeEvent) => any; - close(): void; - createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore; - deleteObjectStore(name: string): void; - transaction(storeNames: string | string[], mode?: string): IDBTransaction; - addEventListener(type: "versionchange", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBDatabase: { - prototype: IDBDatabase; - new(): IDBDatabase; -} - -interface IDBFactory { - cmp(first: any, second: any): number; - deleteDatabase(name: string): IDBOpenDBRequest; - open(name: string, version?: number): IDBOpenDBRequest; -} - -declare var IDBFactory: { - prototype: IDBFactory; - new(): IDBFactory; -} - -interface IDBIndex { - keyPath: string | string[]; - readonly name: string; - readonly objectStore: IDBObjectStore; - readonly unique: boolean; - multiEntry: boolean; - count(key?: IDBKeyRange | IDBValidKey): IDBRequest; - get(key: IDBKeyRange | IDBValidKey): IDBRequest; - getKey(key: IDBKeyRange | IDBValidKey): IDBRequest; - openCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; - openKeyCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; -} - -declare var IDBIndex: { - prototype: IDBIndex; - new(): IDBIndex; -} - -interface IDBKeyRange { - readonly lower: any; - readonly lowerOpen: boolean; - readonly upper: any; - readonly upperOpen: boolean; -} - -declare var IDBKeyRange: { - prototype: IDBKeyRange; - new(): IDBKeyRange; - bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; - lowerBound(lower: any, open?: boolean): IDBKeyRange; - only(value: any): IDBKeyRange; - upperBound(upper: any, open?: boolean): IDBKeyRange; -} - -interface IDBObjectStore { - readonly indexNames: DOMStringList; - keyPath: string | string[]; - readonly name: string; - readonly transaction: IDBTransaction; - autoIncrement: boolean; - add(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest; - clear(): IDBRequest; - count(key?: IDBKeyRange | IDBValidKey): IDBRequest; - createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex; - delete(key: IDBKeyRange | IDBValidKey): IDBRequest; - deleteIndex(indexName: string): void; - get(key: any): IDBRequest; - index(name: string): IDBIndex; - openCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; - put(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest; -} - -declare var IDBObjectStore: { - prototype: IDBObjectStore; - new(): IDBObjectStore; -} - -interface IDBOpenDBRequestEventMap extends IDBRequestEventMap { - "blocked": Event; - "upgradeneeded": IDBVersionChangeEvent; -} - -interface IDBOpenDBRequest extends IDBRequest { - onblocked: (this: IDBOpenDBRequest, ev: Event) => any; - onupgradeneeded: (this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any; - addEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBOpenDBRequest: { - prototype: IDBOpenDBRequest; - new(): IDBOpenDBRequest; -} - -interface IDBRequestEventMap { - "error": ErrorEvent; - "success": Event; -} - -interface IDBRequest extends EventTarget { - readonly error: DOMError; - onerror: (this: IDBRequest, ev: ErrorEvent) => any; - onsuccess: (this: IDBRequest, ev: Event) => any; - readonly readyState: string; - readonly result: any; - source: IDBObjectStore | IDBIndex | IDBCursor; - readonly transaction: IDBTransaction; - addEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBRequest: { - prototype: IDBRequest; - new(): IDBRequest; -} - -interface IDBTransactionEventMap { - "abort": Event; - "complete": Event; - "error": ErrorEvent; -} - -interface IDBTransaction extends EventTarget { - readonly db: IDBDatabase; - readonly error: DOMError; - readonly mode: string; - onabort: (this: IDBTransaction, ev: Event) => any; - oncomplete: (this: IDBTransaction, ev: Event) => any; - onerror: (this: IDBTransaction, ev: ErrorEvent) => any; - abort(): void; - objectStore(name: string): IDBObjectStore; - readonly READ_ONLY: string; - readonly READ_WRITE: string; - readonly VERSION_CHANGE: string; - addEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBTransaction: { - prototype: IDBTransaction; - new(): IDBTransaction; - readonly READ_ONLY: string; - readonly READ_WRITE: string; - readonly VERSION_CHANGE: string; -} - -interface IDBVersionChangeEvent extends Event { - readonly newVersion: number | null; - readonly oldVersion: number; -} - -declare var IDBVersionChangeEvent: { - prototype: IDBVersionChangeEvent; - new(): IDBVersionChangeEvent; -} - -interface ImageData { - data: Uint8ClampedArray; - readonly height: number; - readonly width: number; -} - -declare var ImageData: { - prototype: ImageData; - new(width: number, height: number): ImageData; - new(array: Uint8ClampedArray, width: number, height: number): ImageData; -} - -interface KeyboardEvent extends UIEvent { - readonly altKey: boolean; - readonly char: string | null; - readonly charCode: number; - readonly ctrlKey: boolean; - readonly key: string; - readonly keyCode: number; - readonly locale: string; - readonly location: number; - readonly metaKey: boolean; - readonly repeat: boolean; - readonly shiftKey: boolean; - readonly which: number; - readonly code: string; - getModifierState(keyArg: string): boolean; - initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; - readonly DOM_KEY_LOCATION_JOYSTICK: number; - readonly DOM_KEY_LOCATION_LEFT: number; - readonly DOM_KEY_LOCATION_MOBILE: number; - readonly DOM_KEY_LOCATION_NUMPAD: number; - readonly DOM_KEY_LOCATION_RIGHT: number; - readonly DOM_KEY_LOCATION_STANDARD: number; -} - -declare var KeyboardEvent: { - prototype: KeyboardEvent; - new(typeArg: string, eventInitDict?: KeyboardEventInit): KeyboardEvent; - readonly DOM_KEY_LOCATION_JOYSTICK: number; - readonly DOM_KEY_LOCATION_LEFT: number; - readonly DOM_KEY_LOCATION_MOBILE: number; - readonly DOM_KEY_LOCATION_NUMPAD: number; - readonly DOM_KEY_LOCATION_RIGHT: number; - readonly DOM_KEY_LOCATION_STANDARD: number; -} - -interface ListeningStateChangedEvent extends Event { - readonly label: string; - readonly state: string; -} - -declare var ListeningStateChangedEvent: { - prototype: ListeningStateChangedEvent; - new(): ListeningStateChangedEvent; -} - -interface Location { - hash: string; - host: string; - hostname: string; - href: string; - readonly origin: string; - pathname: string; - port: string; - protocol: string; - search: string; - assign(url: string): void; - reload(forcedReload?: boolean): void; - replace(url: string): void; - toString(): string; -} - -declare var Location: { - prototype: Location; - new(): Location; -} - -interface LongRunningScriptDetectedEvent extends Event { - readonly executionTime: number; - stopPageScriptExecution: boolean; -} - -declare var LongRunningScriptDetectedEvent: { - prototype: LongRunningScriptDetectedEvent; - new(): LongRunningScriptDetectedEvent; -} - -interface MSApp { - clearTemporaryWebDataAsync(): MSAppAsyncOperation; - createBlobFromRandomAccessStream(type: string, seeker: any): Blob; - createDataPackage(object: any): any; - createDataPackageFromSelection(): any; - createFileFromStorageFile(storageFile: any): File; - createStreamFromInputStream(type: string, inputStream: any): MSStream; - execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; - execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; - getCurrentPriority(): string; - getHtmlPrintDocumentSourceAsync(htmlDoc: any): PromiseLike; - getViewId(view: any): any; - isTaskScheduledAtPriorityOrHigher(priority: string): boolean; - pageHandlesAllApplicationActivations(enabled: boolean): void; - suppressSubdownloadCredentialPrompts(suppress: boolean): void; - terminateApp(exceptionObject: any): void; - readonly CURRENT: string; - readonly HIGH: string; - readonly IDLE: string; - readonly NORMAL: string; -} -declare var MSApp: MSApp; - -interface MSAppAsyncOperationEventMap { - "complete": Event; - "error": ErrorEvent; -} - -interface MSAppAsyncOperation extends EventTarget { - readonly error: DOMError; - oncomplete: (this: MSAppAsyncOperation, ev: Event) => any; - onerror: (this: MSAppAsyncOperation, ev: ErrorEvent) => any; - readonly readyState: number; - readonly result: any; - start(): void; - readonly COMPLETED: number; - readonly ERROR: number; - readonly STARTED: number; - addEventListener(type: K, listener: (this: MSAppAsyncOperation, ev: MSAppAsyncOperationEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSAppAsyncOperation: { - prototype: MSAppAsyncOperation; - new(): MSAppAsyncOperation; - readonly COMPLETED: number; - readonly ERROR: number; - readonly STARTED: number; -} - -interface MSAssertion { - readonly id: string; - readonly type: string; -} - -declare var MSAssertion: { - prototype: MSAssertion; - new(): MSAssertion; -} - -interface MSBlobBuilder { - append(data: any, endings?: string): void; - getBlob(contentType?: string): Blob; -} - -declare var MSBlobBuilder: { - prototype: MSBlobBuilder; - new(): MSBlobBuilder; -} - -interface MSCredentials { - getAssertion(challenge: string, filter?: MSCredentialFilter, params?: MSSignatureParameters): PromiseLike; - makeCredential(accountInfo: MSAccountInfo, params: MSCredentialParameters[], challenge?: string): PromiseLike; -} - -declare var MSCredentials: { - prototype: MSCredentials; - new(): MSCredentials; -} - -interface MSFIDOCredentialAssertion extends MSAssertion { - readonly algorithm: string | Algorithm; - readonly attestation: any; - readonly publicKey: string; - readonly transportHints: string[]; -} - -declare var MSFIDOCredentialAssertion: { - prototype: MSFIDOCredentialAssertion; - new(): MSFIDOCredentialAssertion; -} - -interface MSFIDOSignature { - readonly authnrData: string; - readonly clientData: string; - readonly signature: string; -} - -declare var MSFIDOSignature: { - prototype: MSFIDOSignature; - new(): MSFIDOSignature; -} - -interface MSFIDOSignatureAssertion extends MSAssertion { - readonly signature: MSFIDOSignature; -} - -declare var MSFIDOSignatureAssertion: { - prototype: MSFIDOSignatureAssertion; - new(): MSFIDOSignatureAssertion; -} - -interface MSGesture { - target: Element; - addPointer(pointerId: number): void; - stop(): void; -} - -declare var MSGesture: { - prototype: MSGesture; - new(): MSGesture; -} - -interface MSGestureEvent extends UIEvent { - readonly clientX: number; - readonly clientY: number; - readonly expansion: number; - readonly gestureObject: any; - readonly hwTimestamp: number; - readonly offsetX: number; - readonly offsetY: number; - readonly rotation: number; - readonly scale: number; - readonly screenX: number; - readonly screenY: number; - readonly translationX: number; - readonly translationY: number; - readonly velocityAngular: number; - readonly velocityExpansion: number; - readonly velocityX: number; - readonly velocityY: number; - initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; - readonly MSGESTURE_FLAG_BEGIN: number; - readonly MSGESTURE_FLAG_CANCEL: number; - readonly MSGESTURE_FLAG_END: number; - readonly MSGESTURE_FLAG_INERTIA: number; - readonly MSGESTURE_FLAG_NONE: number; -} - -declare var MSGestureEvent: { - prototype: MSGestureEvent; - new(): MSGestureEvent; - readonly MSGESTURE_FLAG_BEGIN: number; - readonly MSGESTURE_FLAG_CANCEL: number; - readonly MSGESTURE_FLAG_END: number; - readonly MSGESTURE_FLAG_INERTIA: number; - readonly MSGESTURE_FLAG_NONE: number; -} - -interface MSGraphicsTrust { - readonly constrictionActive: boolean; - readonly status: string; -} - -declare var MSGraphicsTrust: { - prototype: MSGraphicsTrust; - new(): MSGraphicsTrust; -} - -interface MSHTMLWebViewElement extends HTMLElement { - readonly canGoBack: boolean; - readonly canGoForward: boolean; - readonly containsFullScreenElement: boolean; - readonly documentTitle: string; - height: number; - readonly settings: MSWebViewSettings; - src: string; - width: number; - addWebAllowedObject(name: string, applicationObject: any): void; - buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; - capturePreviewToBlobAsync(): MSWebViewAsyncOperation; - captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; - getDeferredPermissionRequestById(id: number): DeferredPermissionRequest; - getDeferredPermissionRequests(): DeferredPermissionRequest[]; - goBack(): void; - goForward(): void; - invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; - navigate(uri: string): void; - navigateToLocalStreamUri(source: string, streamResolver: any): void; - navigateToString(contents: string): void; - navigateWithHttpRequestMessage(requestMessage: any): void; - refresh(): void; - stop(): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSHTMLWebViewElement: { - prototype: MSHTMLWebViewElement; - new(): MSHTMLWebViewElement; -} - -interface MSInputMethodContextEventMap { - "MSCandidateWindowHide": Event; - "MSCandidateWindowShow": Event; - "MSCandidateWindowUpdate": Event; -} - -interface MSInputMethodContext extends EventTarget { - readonly compositionEndOffset: number; - readonly compositionStartOffset: number; - oncandidatewindowhide: (this: MSInputMethodContext, ev: Event) => any; - oncandidatewindowshow: (this: MSInputMethodContext, ev: Event) => any; - oncandidatewindowupdate: (this: MSInputMethodContext, ev: Event) => any; - readonly target: HTMLElement; - getCandidateWindowClientRect(): ClientRect; - getCompositionAlternatives(): string[]; - hasComposition(): boolean; - isCandidateWindowVisible(): boolean; - addEventListener(type: K, listener: (this: MSInputMethodContext, ev: MSInputMethodContextEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSInputMethodContext: { - prototype: MSInputMethodContext; - new(): MSInputMethodContext; -} - -interface MSManipulationEvent extends UIEvent { - readonly currentState: number; - readonly inertiaDestinationX: number; - readonly inertiaDestinationY: number; - readonly lastState: number; - initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; - readonly MS_MANIPULATION_STATE_ACTIVE: number; - readonly MS_MANIPULATION_STATE_CANCELLED: number; - readonly MS_MANIPULATION_STATE_COMMITTED: number; - readonly MS_MANIPULATION_STATE_DRAGGING: number; - readonly MS_MANIPULATION_STATE_INERTIA: number; - readonly MS_MANIPULATION_STATE_PRESELECT: number; - readonly MS_MANIPULATION_STATE_SELECTING: number; - readonly MS_MANIPULATION_STATE_STOPPED: number; -} - -declare var MSManipulationEvent: { - prototype: MSManipulationEvent; - new(): MSManipulationEvent; - readonly MS_MANIPULATION_STATE_ACTIVE: number; - readonly MS_MANIPULATION_STATE_CANCELLED: number; - readonly MS_MANIPULATION_STATE_COMMITTED: number; - readonly MS_MANIPULATION_STATE_DRAGGING: number; - readonly MS_MANIPULATION_STATE_INERTIA: number; - readonly MS_MANIPULATION_STATE_PRESELECT: number; - readonly MS_MANIPULATION_STATE_SELECTING: number; - readonly MS_MANIPULATION_STATE_STOPPED: number; -} - -interface MSMediaKeyError { - readonly code: number; - readonly systemCode: number; - readonly MS_MEDIA_KEYERR_CLIENT: number; - readonly MS_MEDIA_KEYERR_DOMAIN: number; - readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number; - readonly MS_MEDIA_KEYERR_OUTPUT: number; - readonly MS_MEDIA_KEYERR_SERVICE: number; - readonly MS_MEDIA_KEYERR_UNKNOWN: number; -} - -declare var MSMediaKeyError: { - prototype: MSMediaKeyError; - new(): MSMediaKeyError; - readonly MS_MEDIA_KEYERR_CLIENT: number; - readonly MS_MEDIA_KEYERR_DOMAIN: number; - readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number; - readonly MS_MEDIA_KEYERR_OUTPUT: number; - readonly MS_MEDIA_KEYERR_SERVICE: number; - readonly MS_MEDIA_KEYERR_UNKNOWN: number; -} - -interface MSMediaKeyMessageEvent extends Event { - readonly destinationURL: string | null; - readonly message: Uint8Array; -} - -declare var MSMediaKeyMessageEvent: { - prototype: MSMediaKeyMessageEvent; - new(): MSMediaKeyMessageEvent; -} - -interface MSMediaKeyNeededEvent extends Event { - readonly initData: Uint8Array | null; -} - -declare var MSMediaKeyNeededEvent: { - prototype: MSMediaKeyNeededEvent; - new(): MSMediaKeyNeededEvent; -} - -interface MSMediaKeySession extends EventTarget { - readonly error: MSMediaKeyError | null; - readonly keySystem: string; - readonly sessionId: string; - close(): void; - update(key: Uint8Array): void; -} - -declare var MSMediaKeySession: { - prototype: MSMediaKeySession; - new(): MSMediaKeySession; -} - -interface MSMediaKeys { - readonly keySystem: string; - createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; -} - -declare var MSMediaKeys: { - prototype: MSMediaKeys; - new(keySystem: string): MSMediaKeys; - isTypeSupported(keySystem: string, type?: string): boolean; - isTypeSupportedWithFeatures(keySystem: string, type?: string): string; -} - -interface MSPointerEvent extends MouseEvent { - readonly currentPoint: any; - readonly height: number; - readonly hwTimestamp: number; - readonly intermediatePoints: any; - readonly isPrimary: boolean; - readonly pointerId: number; - readonly pointerType: any; - readonly pressure: number; - readonly rotation: number; - readonly tiltX: number; - readonly tiltY: number; - readonly width: number; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; -} - -declare var MSPointerEvent: { - prototype: MSPointerEvent; - new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent; -} - -interface MSRangeCollection { - readonly length: number; - item(index: number): Range; - [index: number]: Range; -} - -declare var MSRangeCollection: { - prototype: MSRangeCollection; - new(): MSRangeCollection; -} - -interface MSSiteModeEvent extends Event { - readonly actionURL: string; - readonly buttonID: number; -} - -declare var MSSiteModeEvent: { - prototype: MSSiteModeEvent; - new(): MSSiteModeEvent; -} - -interface MSStream { - readonly type: string; - msClose(): void; - msDetachStream(): any; -} - -declare var MSStream: { - prototype: MSStream; - new(): MSStream; -} - -interface MSStreamReader extends EventTarget, MSBaseReader { - readonly error: DOMError; - readAsArrayBuffer(stream: MSStream, size?: number): void; - readAsBinaryString(stream: MSStream, size?: number): void; - readAsBlob(stream: MSStream, size?: number): void; - readAsDataURL(stream: MSStream, size?: number): void; - readAsText(stream: MSStream, encoding?: string, size?: number): void; - addEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSStreamReader: { - prototype: MSStreamReader; - new(): MSStreamReader; -} - -interface MSWebViewAsyncOperationEventMap { - "complete": Event; - "error": ErrorEvent; -} - -interface MSWebViewAsyncOperation extends EventTarget { - readonly error: DOMError; - oncomplete: (this: MSWebViewAsyncOperation, ev: Event) => any; - onerror: (this: MSWebViewAsyncOperation, ev: ErrorEvent) => any; - readonly readyState: number; - readonly result: any; - readonly target: MSHTMLWebViewElement; - readonly type: number; - start(): void; - readonly COMPLETED: number; - readonly ERROR: number; - readonly STARTED: number; - readonly TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - readonly TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - readonly TYPE_INVOKE_SCRIPT: number; - addEventListener(type: K, listener: (this: MSWebViewAsyncOperation, ev: MSWebViewAsyncOperationEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSWebViewAsyncOperation: { - prototype: MSWebViewAsyncOperation; - new(): MSWebViewAsyncOperation; - readonly COMPLETED: number; - readonly ERROR: number; - readonly STARTED: number; - readonly TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - readonly TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - readonly TYPE_INVOKE_SCRIPT: number; -} - -interface MSWebViewSettings { - isIndexedDBEnabled: boolean; - isJavaScriptEnabled: boolean; -} - -declare var MSWebViewSettings: { - prototype: MSWebViewSettings; - new(): MSWebViewSettings; -} - -interface MediaDeviceInfo { - readonly deviceId: string; - readonly groupId: string; - readonly kind: string; - readonly label: string; -} - -declare var MediaDeviceInfo: { - prototype: MediaDeviceInfo; - new(): MediaDeviceInfo; -} - -interface MediaDevicesEventMap { - "devicechange": Event; -} - -interface MediaDevices extends EventTarget { - ondevicechange: (this: MediaDevices, ev: Event) => any; - enumerateDevices(): any; - getSupportedConstraints(): MediaTrackSupportedConstraints; - getUserMedia(constraints: MediaStreamConstraints): PromiseLike; - addEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MediaDevices: { - prototype: MediaDevices; - new(): MediaDevices; -} - -interface MediaElementAudioSourceNode extends AudioNode { -} - -declare var MediaElementAudioSourceNode: { - prototype: MediaElementAudioSourceNode; - new(): MediaElementAudioSourceNode; -} - -interface MediaEncryptedEvent extends Event { - readonly initData: ArrayBuffer | null; - readonly initDataType: string; -} - -declare var MediaEncryptedEvent: { - prototype: MediaEncryptedEvent; - new(type: string, eventInitDict?: MediaEncryptedEventInit): MediaEncryptedEvent; -} - -interface MediaError { - readonly code: number; - readonly msExtendedCode: number; - readonly MEDIA_ERR_ABORTED: number; - readonly MEDIA_ERR_DECODE: number; - readonly MEDIA_ERR_NETWORK: number; - readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number; - readonly MS_MEDIA_ERR_ENCRYPTED: number; -} - -declare var MediaError: { - prototype: MediaError; - new(): MediaError; - readonly MEDIA_ERR_ABORTED: number; - readonly MEDIA_ERR_DECODE: number; - readonly MEDIA_ERR_NETWORK: number; - readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number; - readonly MS_MEDIA_ERR_ENCRYPTED: number; -} - -interface MediaKeyMessageEvent extends Event { - readonly message: ArrayBuffer; - readonly messageType: string; -} - -declare var MediaKeyMessageEvent: { - prototype: MediaKeyMessageEvent; - new(type: string, eventInitDict?: MediaKeyMessageEventInit): MediaKeyMessageEvent; -} - -interface MediaKeySession extends EventTarget { - readonly closed: PromiseLike; - readonly expiration: number; - readonly keyStatuses: MediaKeyStatusMap; - readonly sessionId: string; - close(): PromiseLike; - generateRequest(initDataType: string, initData: any): PromiseLike; - load(sessionId: string): PromiseLike; - remove(): PromiseLike; - update(response: any): PromiseLike; -} - -declare var MediaKeySession: { - prototype: MediaKeySession; - new(): MediaKeySession; -} - -interface MediaKeyStatusMap { - readonly size: number; - forEach(callback: ForEachCallback): void; - get(keyId: any): string; - has(keyId: any): boolean; -} - -declare var MediaKeyStatusMap: { - prototype: MediaKeyStatusMap; - new(): MediaKeyStatusMap; -} - -interface MediaKeySystemAccess { - readonly keySystem: string; - createMediaKeys(): PromiseLike; - getConfiguration(): MediaKeySystemConfiguration; -} - -declare var MediaKeySystemAccess: { - prototype: MediaKeySystemAccess; - new(): MediaKeySystemAccess; -} - -interface MediaKeys { - createSession(sessionType?: string): MediaKeySession; - setServerCertificate(serverCertificate: any): PromiseLike; -} - -declare var MediaKeys: { - prototype: MediaKeys; - new(): MediaKeys; -} - -interface MediaList { - readonly length: number; - mediaText: string; - appendMedium(newMedium: string): void; - deleteMedium(oldMedium: string): void; - item(index: number): string; - toString(): string; - [index: number]: string; -} - -declare var MediaList: { - prototype: MediaList; - new(): MediaList; -} - -interface MediaQueryList { - readonly matches: boolean; - readonly media: string; - addListener(listener: MediaQueryListListener): void; - removeListener(listener: MediaQueryListListener): void; -} - -declare var MediaQueryList: { - prototype: MediaQueryList; - new(): MediaQueryList; -} - -interface MediaSource extends EventTarget { - readonly activeSourceBuffers: SourceBufferList; - duration: number; - readonly readyState: string; - readonly sourceBuffers: SourceBufferList; - addSourceBuffer(type: string): SourceBuffer; - endOfStream(error?: number): void; - removeSourceBuffer(sourceBuffer: SourceBuffer): void; -} - -declare var MediaSource: { - prototype: MediaSource; - new(): MediaSource; - isTypeSupported(type: string): boolean; -} - -interface MediaStreamEventMap { - "active": Event; - "addtrack": TrackEvent; - "inactive": Event; - "removetrack": TrackEvent; -} - -interface MediaStream extends EventTarget { - readonly active: boolean; - readonly id: string; - onactive: (this: MediaStream, ev: Event) => any; - onaddtrack: (this: MediaStream, ev: TrackEvent) => any; - oninactive: (this: MediaStream, ev: Event) => any; - onremovetrack: (this: MediaStream, ev: TrackEvent) => any; - addTrack(track: MediaStreamTrack): void; - clone(): MediaStream; - getAudioTracks(): MediaStreamTrack[]; - getTrackById(trackId: string): MediaStreamTrack | null; - getTracks(): MediaStreamTrack[]; - getVideoTracks(): MediaStreamTrack[]; - removeTrack(track: MediaStreamTrack): void; - stop(): void; - addEventListener(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MediaStream: { - prototype: MediaStream; - new(streamOrTracks?: MediaStream | MediaStreamTrack[]): MediaStream; -} - -interface MediaStreamAudioSourceNode extends AudioNode { -} - -declare var MediaStreamAudioSourceNode: { - prototype: MediaStreamAudioSourceNode; - new(): MediaStreamAudioSourceNode; -} - -interface MediaStreamError { - readonly constraintName: string | null; - readonly message: string | null; - readonly name: string; -} - -declare var MediaStreamError: { - prototype: MediaStreamError; - new(): MediaStreamError; -} - -interface MediaStreamErrorEvent extends Event { - readonly error: MediaStreamError | null; -} - -declare var MediaStreamErrorEvent: { - prototype: MediaStreamErrorEvent; - new(type: string, eventInitDict?: MediaStreamErrorEventInit): MediaStreamErrorEvent; -} - -interface MediaStreamTrackEventMap { - "ended": MediaStreamErrorEvent; - "mute": Event; - "overconstrained": MediaStreamErrorEvent; - "unmute": Event; -} - -interface MediaStreamTrack extends EventTarget { - enabled: boolean; - readonly id: string; - readonly kind: string; - readonly label: string; - readonly muted: boolean; - onended: (this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any; - onmute: (this: MediaStreamTrack, ev: Event) => any; - onoverconstrained: (this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any; - onunmute: (this: MediaStreamTrack, ev: Event) => any; - readonly readonly: boolean; - readonly readyState: string; - readonly remote: boolean; - applyConstraints(constraints: MediaTrackConstraints): PromiseLike; - clone(): MediaStreamTrack; - getCapabilities(): MediaTrackCapabilities; - getConstraints(): MediaTrackConstraints; - getSettings(): MediaTrackSettings; - stop(): void; - addEventListener(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MediaStreamTrack: { - prototype: MediaStreamTrack; - new(): MediaStreamTrack; -} - -interface MediaStreamTrackEvent extends Event { - readonly track: MediaStreamTrack; -} - -declare var MediaStreamTrackEvent: { - prototype: MediaStreamTrackEvent; - new(type: string, eventInitDict?: MediaStreamTrackEventInit): MediaStreamTrackEvent; -} - -interface MessageChannel { - readonly port1: MessagePort; - readonly port2: MessagePort; -} - -declare var MessageChannel: { - prototype: MessageChannel; - new(): MessageChannel; -} - -interface MessageEvent extends Event { - readonly data: any; - readonly origin: string; - readonly ports: any; - readonly source: Window; - initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; -} - -declare var MessageEvent: { - prototype: MessageEvent; - new(type: string, eventInitDict?: MessageEventInit): MessageEvent; -} - -interface MessagePortEventMap { - "message": MessageEvent; -} - -interface MessagePort extends EventTarget { - onmessage: (this: MessagePort, ev: MessageEvent) => any; - close(): void; - postMessage(message?: any, ports?: any): void; - start(): void; - addEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MessagePort: { - prototype: MessagePort; - new(): MessagePort; -} - -interface MimeType { - readonly description: string; - readonly enabledPlugin: Plugin; - readonly suffixes: string; - readonly type: string; -} - -declare var MimeType: { - prototype: MimeType; - new(): MimeType; -} - -interface MimeTypeArray { - readonly length: number; - item(index: number): Plugin; - namedItem(type: string): Plugin; - [index: number]: Plugin; -} - -declare var MimeTypeArray: { - prototype: MimeTypeArray; - new(): MimeTypeArray; -} - -interface MouseEvent extends UIEvent { - readonly altKey: boolean; - readonly button: number; - readonly buttons: number; - readonly clientX: number; - readonly clientY: number; - readonly ctrlKey: boolean; - readonly fromElement: Element; - readonly layerX: number; - readonly layerY: number; - readonly metaKey: boolean; - readonly movementX: number; - readonly movementY: number; - readonly offsetX: number; - readonly offsetY: number; - readonly pageX: number; - readonly pageY: number; - readonly relatedTarget: EventTarget; - readonly screenX: number; - readonly screenY: number; - readonly shiftKey: boolean; - readonly toElement: Element; - readonly which: number; - readonly x: number; - readonly y: number; - getModifierState(keyArg: string): boolean; - initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget | null): void; -} - -declare var MouseEvent: { - prototype: MouseEvent; - new(typeArg: string, eventInitDict?: MouseEventInit): MouseEvent; -} - -interface MutationEvent extends Event { - readonly attrChange: number; - readonly attrName: string; - readonly newValue: string; - readonly prevValue: string; - readonly relatedNode: Node; - initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; - readonly ADDITION: number; - readonly MODIFICATION: number; - readonly REMOVAL: number; -} - -declare var MutationEvent: { - prototype: MutationEvent; - new(): MutationEvent; - readonly ADDITION: number; - readonly MODIFICATION: number; - readonly REMOVAL: number; -} - -interface MutationObserver { - disconnect(): void; - observe(target: Node, options: MutationObserverInit): void; - takeRecords(): MutationRecord[]; -} - -declare var MutationObserver: { - prototype: MutationObserver; - new(callback: MutationCallback): MutationObserver; -} - -interface MutationRecord { - readonly addedNodes: NodeList; - readonly attributeName: string | null; - readonly attributeNamespace: string | null; - readonly nextSibling: Node | null; - readonly oldValue: string | null; - readonly previousSibling: Node | null; - readonly removedNodes: NodeList; - readonly target: Node; - readonly type: string; -} - -declare var MutationRecord: { - prototype: MutationRecord; - new(): MutationRecord; -} - -interface NamedNodeMap { - readonly length: number; - getNamedItem(name: string): Attr; - getNamedItemNS(namespaceURI: string | null, localName: string | null): Attr; - item(index: number): Attr; - removeNamedItem(name: string): Attr; - removeNamedItemNS(namespaceURI: string | null, localName: string | null): Attr; - setNamedItem(arg: Attr): Attr; - setNamedItemNS(arg: Attr): Attr; - [index: number]: Attr; -} - -declare var NamedNodeMap: { - prototype: NamedNodeMap; - new(): NamedNodeMap; -} - -interface NavigationCompletedEvent extends NavigationEvent { - readonly isSuccess: boolean; - readonly webErrorStatus: number; -} - -declare var NavigationCompletedEvent: { - prototype: NavigationCompletedEvent; - new(): NavigationCompletedEvent; -} - -interface NavigationEvent extends Event { - readonly uri: string; -} - -declare var NavigationEvent: { - prototype: NavigationEvent; - new(): NavigationEvent; -} - -interface NavigationEventWithReferrer extends NavigationEvent { - readonly referer: string; -} - -declare var NavigationEventWithReferrer: { - prototype: NavigationEventWithReferrer; - new(): NavigationEventWithReferrer; -} - -interface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, NavigatorGeolocation, MSNavigatorDoNotTrack, MSFileSaver, NavigatorUserMedia { - readonly appCodeName: string; - readonly cookieEnabled: boolean; - readonly language: string; - readonly maxTouchPoints: number; - readonly mimeTypes: MimeTypeArray; - readonly msManipulationViewsEnabled: boolean; - readonly msMaxTouchPoints: number; - readonly msPointerEnabled: boolean; - readonly plugins: PluginArray; - readonly pointerEnabled: boolean; - readonly webdriver: boolean; - readonly hardwareConcurrency: number; - getGamepads(): Gamepad[]; - javaEnabled(): boolean; - msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; - requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): PromiseLike; - vibrate(pattern: number | number[]): boolean; -} - -declare var Navigator: { - prototype: Navigator; - new(): Navigator; -} - -interface Node extends EventTarget { - readonly attributes: NamedNodeMap; - readonly baseURI: string | null; - readonly childNodes: NodeList; - readonly firstChild: Node | null; - readonly lastChild: Node | null; - readonly localName: string | null; - readonly namespaceURI: string | null; - readonly nextSibling: Node | null; - readonly nodeName: string; - readonly nodeType: number; - nodeValue: string | null; - readonly ownerDocument: Document; - readonly parentElement: HTMLElement | null; - readonly parentNode: Node | null; - readonly previousSibling: Node | null; - textContent: string | null; - appendChild(newChild: Node): Node; - cloneNode(deep?: boolean): Node; - compareDocumentPosition(other: Node): number; - contains(child: Node): boolean; - hasAttributes(): boolean; - hasChildNodes(): boolean; - insertBefore(newChild: Node, refChild: Node | null): Node; - isDefaultNamespace(namespaceURI: string | null): boolean; - isEqualNode(arg: Node): boolean; - isSameNode(other: Node): boolean; - lookupNamespaceURI(prefix: string | null): string | null; - lookupPrefix(namespaceURI: string | null): string | null; - normalize(): void; - removeChild(oldChild: Node): Node; - replaceChild(newChild: Node, oldChild: Node): Node; - readonly ATTRIBUTE_NODE: number; - readonly CDATA_SECTION_NODE: number; - readonly COMMENT_NODE: number; - readonly DOCUMENT_FRAGMENT_NODE: number; - readonly DOCUMENT_NODE: number; - readonly DOCUMENT_POSITION_CONTAINED_BY: number; - readonly DOCUMENT_POSITION_CONTAINS: number; - readonly DOCUMENT_POSITION_DISCONNECTED: number; - readonly DOCUMENT_POSITION_FOLLOWING: number; - readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - readonly DOCUMENT_POSITION_PRECEDING: number; - readonly DOCUMENT_TYPE_NODE: number; - readonly ELEMENT_NODE: number; - readonly ENTITY_NODE: number; - readonly ENTITY_REFERENCE_NODE: number; - readonly NOTATION_NODE: number; - readonly PROCESSING_INSTRUCTION_NODE: number; - readonly TEXT_NODE: number; -} - -declare var Node: { - prototype: Node; - new(): Node; - readonly ATTRIBUTE_NODE: number; - readonly CDATA_SECTION_NODE: number; - readonly COMMENT_NODE: number; - readonly DOCUMENT_FRAGMENT_NODE: number; - readonly DOCUMENT_NODE: number; - readonly DOCUMENT_POSITION_CONTAINED_BY: number; - readonly DOCUMENT_POSITION_CONTAINS: number; - readonly DOCUMENT_POSITION_DISCONNECTED: number; - readonly DOCUMENT_POSITION_FOLLOWING: number; - readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - readonly DOCUMENT_POSITION_PRECEDING: number; - readonly DOCUMENT_TYPE_NODE: number; - readonly ELEMENT_NODE: number; - readonly ENTITY_NODE: number; - readonly ENTITY_REFERENCE_NODE: number; - readonly NOTATION_NODE: number; - readonly PROCESSING_INSTRUCTION_NODE: number; - readonly TEXT_NODE: number; -} - -interface NodeFilter { - acceptNode(n: Node): number; -} - -declare var NodeFilter: { - readonly FILTER_ACCEPT: number; - readonly FILTER_REJECT: number; - readonly FILTER_SKIP: number; - readonly SHOW_ALL: number; - readonly SHOW_ATTRIBUTE: number; - readonly SHOW_CDATA_SECTION: number; - readonly SHOW_COMMENT: number; - readonly SHOW_DOCUMENT: number; - readonly SHOW_DOCUMENT_FRAGMENT: number; - readonly SHOW_DOCUMENT_TYPE: number; - readonly SHOW_ELEMENT: number; - readonly SHOW_ENTITY: number; - readonly SHOW_ENTITY_REFERENCE: number; - readonly SHOW_NOTATION: number; - readonly SHOW_PROCESSING_INSTRUCTION: number; - readonly SHOW_TEXT: number; -} - -interface NodeIterator { - readonly expandEntityReferences: boolean; - readonly filter: NodeFilter; - readonly root: Node; - readonly whatToShow: number; - detach(): void; - nextNode(): Node; - previousNode(): Node; -} - -declare var NodeIterator: { - prototype: NodeIterator; - new(): NodeIterator; -} - -interface NodeList { - readonly length: number; - item(index: number): Node; - [index: number]: Node; -} - -declare var NodeList: { - prototype: NodeList; - new(): NodeList; -} - -interface OES_element_index_uint { -} - -declare var OES_element_index_uint: { - prototype: OES_element_index_uint; - new(): OES_element_index_uint; -} - -interface OES_standard_derivatives { - readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} - -declare var OES_standard_derivatives: { - prototype: OES_standard_derivatives; - new(): OES_standard_derivatives; - readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} - -interface OES_texture_float { -} - -declare var OES_texture_float: { - prototype: OES_texture_float; - new(): OES_texture_float; -} - -interface OES_texture_float_linear { -} - -declare var OES_texture_float_linear: { - prototype: OES_texture_float_linear; - new(): OES_texture_float_linear; -} - -interface OfflineAudioCompletionEvent extends Event { - readonly renderedBuffer: AudioBuffer; -} - -declare var OfflineAudioCompletionEvent: { - prototype: OfflineAudioCompletionEvent; - new(): OfflineAudioCompletionEvent; -} - -interface OfflineAudioContextEventMap { - "complete": Event; -} - -interface OfflineAudioContext extends AudioContext { - oncomplete: (this: OfflineAudioContext, ev: Event) => any; - startRendering(): PromiseLike; - addEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var OfflineAudioContext: { - prototype: OfflineAudioContext; - new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext; -} - -interface OscillatorNodeEventMap { - "ended": MediaStreamErrorEvent; -} - -interface OscillatorNode extends AudioNode { - readonly detune: AudioParam; - readonly frequency: AudioParam; - onended: (this: OscillatorNode, ev: MediaStreamErrorEvent) => any; - type: string; - setPeriodicWave(periodicWave: PeriodicWave): void; - start(when?: number): void; - stop(when?: number): void; - addEventListener(type: K, listener: (this: OscillatorNode, ev: OscillatorNodeEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var OscillatorNode: { - prototype: OscillatorNode; - new(): OscillatorNode; -} - -interface OverflowEvent extends UIEvent { - readonly horizontalOverflow: boolean; - readonly orient: number; - readonly verticalOverflow: boolean; - readonly BOTH: number; - readonly HORIZONTAL: number; - readonly VERTICAL: number; -} - -declare var OverflowEvent: { - prototype: OverflowEvent; - new(): OverflowEvent; - readonly BOTH: number; - readonly HORIZONTAL: number; - readonly VERTICAL: number; -} - -interface PageTransitionEvent extends Event { - readonly persisted: boolean; -} - -declare var PageTransitionEvent: { - prototype: PageTransitionEvent; - new(): PageTransitionEvent; -} - -interface PannerNode extends AudioNode { - coneInnerAngle: number; - coneOuterAngle: number; - coneOuterGain: number; - distanceModel: string; - maxDistance: number; - panningModel: string; - refDistance: number; - rolloffFactor: number; - setOrientation(x: number, y: number, z: number): void; - setPosition(x: number, y: number, z: number): void; - setVelocity(x: number, y: number, z: number): void; -} - -declare var PannerNode: { - prototype: PannerNode; - new(): PannerNode; -} - -interface PerfWidgetExternal { - readonly activeNetworkRequestCount: number; - readonly averageFrameTime: number; - readonly averagePaintTime: number; - readonly extraInformationEnabled: boolean; - readonly independentRenderingEnabled: boolean; - readonly irDisablingContentString: string; - readonly irStatusAvailable: boolean; - readonly maxCpuSpeed: number; - readonly paintRequestsPerSecond: number; - readonly performanceCounter: number; - readonly performanceCounterFrequency: number; - addEventListener(eventType: string, callback: Function): void; - getMemoryUsage(): number; - getProcessCpuUsage(): number; - getRecentCpuUsage(last: number | null): any; - getRecentFrames(last: number | null): any; - getRecentMemoryUsage(last: number | null): any; - getRecentPaintRequests(last: number | null): any; - removeEventListener(eventType: string, callback: Function): void; - repositionWindow(x: number, y: number): void; - resizeWindow(width: number, height: number): void; -} - -declare var PerfWidgetExternal: { - prototype: PerfWidgetExternal; - new(): PerfWidgetExternal; -} - -interface Performance { - readonly navigation: PerformanceNavigation; - readonly timing: PerformanceTiming; - clearMarks(markName?: string): void; - clearMeasures(measureName?: string): void; - clearResourceTimings(): void; - getEntries(): any; - getEntriesByName(name: string, entryType?: string): any; - getEntriesByType(entryType: string): any; - getMarks(markName?: string): any; - getMeasures(measureName?: string): any; - mark(markName: string): void; - measure(measureName: string, startMarkName?: string, endMarkName?: string): void; - now(): number; - setResourceTimingBufferSize(maxSize: number): void; - toJSON(): any; -} - -declare var Performance: { - prototype: Performance; - new(): Performance; -} - -interface PerformanceEntry { - readonly duration: number; - readonly entryType: string; - readonly name: string; - readonly startTime: number; -} - -declare var PerformanceEntry: { - prototype: PerformanceEntry; - new(): PerformanceEntry; -} - -interface PerformanceMark extends PerformanceEntry { -} - -declare var PerformanceMark: { - prototype: PerformanceMark; - new(): PerformanceMark; -} - -interface PerformanceMeasure extends PerformanceEntry { -} - -declare var PerformanceMeasure: { - prototype: PerformanceMeasure; - new(): PerformanceMeasure; -} - -interface PerformanceNavigation { - readonly redirectCount: number; - readonly type: number; - toJSON(): any; - readonly TYPE_BACK_FORWARD: number; - readonly TYPE_NAVIGATE: number; - readonly TYPE_RELOAD: number; - readonly TYPE_RESERVED: number; -} - -declare var PerformanceNavigation: { - prototype: PerformanceNavigation; - new(): PerformanceNavigation; - readonly TYPE_BACK_FORWARD: number; - readonly TYPE_NAVIGATE: number; - readonly TYPE_RELOAD: number; - readonly TYPE_RESERVED: number; -} - -interface PerformanceNavigationTiming extends PerformanceEntry { - readonly connectEnd: number; - readonly connectStart: number; - readonly domComplete: number; - readonly domContentLoadedEventEnd: number; - readonly domContentLoadedEventStart: number; - readonly domInteractive: number; - readonly domLoading: number; - readonly domainLookupEnd: number; - readonly domainLookupStart: number; - readonly fetchStart: number; - readonly loadEventEnd: number; - readonly loadEventStart: number; - readonly navigationStart: number; - readonly redirectCount: number; - readonly redirectEnd: number; - readonly redirectStart: number; - readonly requestStart: number; - readonly responseEnd: number; - readonly responseStart: number; - readonly type: string; - readonly unloadEventEnd: number; - readonly unloadEventStart: number; -} - -declare var PerformanceNavigationTiming: { - prototype: PerformanceNavigationTiming; - new(): PerformanceNavigationTiming; -} - -interface PerformanceResourceTiming extends PerformanceEntry { - readonly connectEnd: number; - readonly connectStart: number; - readonly domainLookupEnd: number; - readonly domainLookupStart: number; - readonly fetchStart: number; - readonly initiatorType: string; - readonly redirectEnd: number; - readonly redirectStart: number; - readonly requestStart: number; - readonly responseEnd: number; - readonly responseStart: number; -} - -declare var PerformanceResourceTiming: { - prototype: PerformanceResourceTiming; - new(): PerformanceResourceTiming; -} - -interface PerformanceTiming { - readonly connectEnd: number; - readonly connectStart: number; - readonly domComplete: number; - readonly domContentLoadedEventEnd: number; - readonly domContentLoadedEventStart: number; - readonly domInteractive: number; - readonly domLoading: number; - readonly domainLookupEnd: number; - readonly domainLookupStart: number; - readonly fetchStart: number; - readonly loadEventEnd: number; - readonly loadEventStart: number; - readonly msFirstPaint: number; - readonly navigationStart: number; - readonly redirectEnd: number; - readonly redirectStart: number; - readonly requestStart: number; - readonly responseEnd: number; - readonly responseStart: number; - readonly unloadEventEnd: number; - readonly unloadEventStart: number; - readonly secureConnectionStart: number; - toJSON(): any; -} - -declare var PerformanceTiming: { - prototype: PerformanceTiming; - new(): PerformanceTiming; -} - -interface PeriodicWave { -} - -declare var PeriodicWave: { - prototype: PeriodicWave; - new(): PeriodicWave; -} - -interface PermissionRequest extends DeferredPermissionRequest { - readonly state: string; - defer(): void; -} - -declare var PermissionRequest: { - prototype: PermissionRequest; - new(): PermissionRequest; -} - -interface PermissionRequestedEvent extends Event { - readonly permissionRequest: PermissionRequest; -} - -declare var PermissionRequestedEvent: { - prototype: PermissionRequestedEvent; - new(): PermissionRequestedEvent; -} - -interface Plugin { - readonly description: string; - readonly filename: string; - readonly length: number; - readonly name: string; - readonly version: string; - item(index: number): MimeType; - namedItem(type: string): MimeType; - [index: number]: MimeType; -} - -declare var Plugin: { - prototype: Plugin; - new(): Plugin; -} - -interface PluginArray { - readonly length: number; - item(index: number): Plugin; - namedItem(name: string): Plugin; - refresh(reload?: boolean): void; - [index: number]: Plugin; -} - -declare var PluginArray: { - prototype: PluginArray; - new(): PluginArray; -} - -interface PointerEvent extends MouseEvent { - readonly currentPoint: any; - readonly height: number; - readonly hwTimestamp: number; - readonly intermediatePoints: any; - readonly isPrimary: boolean; - readonly pointerId: number; - readonly pointerType: any; - readonly pressure: number; - readonly rotation: number; - readonly tiltX: number; - readonly tiltY: number; - readonly width: number; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; -} - -declare var PointerEvent: { - prototype: PointerEvent; - new(typeArg: string, eventInitDict?: PointerEventInit): PointerEvent; -} - -interface PopStateEvent extends Event { - readonly state: any; - initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void; -} - -declare var PopStateEvent: { - prototype: PopStateEvent; - new(): PopStateEvent; -} - -interface Position { - readonly coords: Coordinates; - readonly timestamp: number; -} - -declare var Position: { - prototype: Position; - new(): Position; -} - -interface PositionError { - readonly code: number; - readonly message: string; - toString(): string; - readonly PERMISSION_DENIED: number; - readonly POSITION_UNAVAILABLE: number; - readonly TIMEOUT: number; -} - -declare var PositionError: { - prototype: PositionError; - new(): PositionError; - readonly PERMISSION_DENIED: number; - readonly POSITION_UNAVAILABLE: number; - readonly TIMEOUT: number; -} - -interface ProcessingInstruction extends CharacterData { - readonly target: string; -} - -declare var ProcessingInstruction: { - prototype: ProcessingInstruction; - new(): ProcessingInstruction; -} - -interface ProgressEvent extends Event { - readonly lengthComputable: boolean; - readonly loaded: number; - readonly total: number; - initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; -} - -declare var ProgressEvent: { - prototype: ProgressEvent; - new(type: string, eventInitDict?: ProgressEventInit): ProgressEvent; -} - -interface RTCDTMFToneChangeEvent extends Event { - readonly tone: string; -} - -declare var RTCDTMFToneChangeEvent: { - prototype: RTCDTMFToneChangeEvent; - new(type: string, eventInitDict: RTCDTMFToneChangeEventInit): RTCDTMFToneChangeEvent; -} - -interface RTCDtlsTransportEventMap { - "dtlsstatechange": RTCDtlsTransportStateChangedEvent; - "error": ErrorEvent; -} - -interface RTCDtlsTransport extends RTCStatsProvider { - ondtlsstatechange: ((this: RTCDtlsTransport, ev: RTCDtlsTransportStateChangedEvent) => any) | null; - onerror: ((this: RTCDtlsTransport, ev: ErrorEvent) => any) | null; - readonly state: string; - readonly transport: RTCIceTransport; - getLocalParameters(): RTCDtlsParameters; - getRemoteCertificates(): ArrayBuffer[]; - getRemoteParameters(): RTCDtlsParameters | null; - start(remoteParameters: RTCDtlsParameters): void; - stop(): void; - addEventListener(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCDtlsTransport: { - prototype: RTCDtlsTransport; - new(transport: RTCIceTransport): RTCDtlsTransport; -} - -interface RTCDtlsTransportStateChangedEvent extends Event { - readonly state: string; -} - -declare var RTCDtlsTransportStateChangedEvent: { - prototype: RTCDtlsTransportStateChangedEvent; - new(): RTCDtlsTransportStateChangedEvent; -} - -interface RTCDtmfSenderEventMap { - "tonechange": RTCDTMFToneChangeEvent; -} - -interface RTCDtmfSender extends EventTarget { - readonly canInsertDTMF: boolean; - readonly duration: number; - readonly interToneGap: number; - ontonechange: (this: RTCDtmfSender, ev: RTCDTMFToneChangeEvent) => any; - readonly sender: RTCRtpSender; - readonly toneBuffer: string; - insertDTMF(tones: string, duration?: number, interToneGap?: number): void; - addEventListener(type: K, listener: (this: RTCDtmfSender, ev: RTCDtmfSenderEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCDtmfSender: { - prototype: RTCDtmfSender; - new(sender: RTCRtpSender): RTCDtmfSender; -} - -interface RTCIceCandidatePairChangedEvent extends Event { - readonly pair: RTCIceCandidatePair; -} - -declare var RTCIceCandidatePairChangedEvent: { - prototype: RTCIceCandidatePairChangedEvent; - new(): RTCIceCandidatePairChangedEvent; -} - -interface RTCIceGathererEventMap { - "error": ErrorEvent; - "localcandidate": RTCIceGathererEvent; -} - -interface RTCIceGatherer extends RTCStatsProvider { - readonly component: string; - onerror: ((this: RTCIceGatherer, ev: ErrorEvent) => any) | null; - onlocalcandidate: ((this: RTCIceGatherer, ev: RTCIceGathererEvent) => any) | null; - createAssociatedGatherer(): RTCIceGatherer; - getLocalCandidates(): RTCIceCandidate[]; - getLocalParameters(): RTCIceParameters; - addEventListener(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCIceGatherer: { - prototype: RTCIceGatherer; - new(options: RTCIceGatherOptions): RTCIceGatherer; -} - -interface RTCIceGathererEvent extends Event { - readonly candidate: RTCIceCandidate | RTCIceCandidateComplete; -} - -declare var RTCIceGathererEvent: { - prototype: RTCIceGathererEvent; - new(): RTCIceGathererEvent; -} - -interface RTCIceTransportEventMap { - "candidatepairchange": RTCIceCandidatePairChangedEvent; - "icestatechange": RTCIceTransportStateChangedEvent; -} - -interface RTCIceTransport extends RTCStatsProvider { - readonly component: string; - readonly iceGatherer: RTCIceGatherer | null; - oncandidatepairchange: ((this: RTCIceTransport, ev: RTCIceCandidatePairChangedEvent) => any) | null; - onicestatechange: ((this: RTCIceTransport, ev: RTCIceTransportStateChangedEvent) => any) | null; - readonly role: string; - readonly state: string; - addRemoteCandidate(remoteCandidate: RTCIceCandidate | RTCIceCandidateComplete): void; - createAssociatedTransport(): RTCIceTransport; - getNominatedCandidatePair(): RTCIceCandidatePair | null; - getRemoteCandidates(): RTCIceCandidate[]; - getRemoteParameters(): RTCIceParameters | null; - setRemoteCandidates(remoteCandidates: RTCIceCandidate[]): void; - start(gatherer: RTCIceGatherer, remoteParameters: RTCIceParameters, role?: string): void; - stop(): void; - addEventListener(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCIceTransport: { - prototype: RTCIceTransport; - new(): RTCIceTransport; -} - -interface RTCIceTransportStateChangedEvent extends Event { - readonly state: string; -} - -declare var RTCIceTransportStateChangedEvent: { - prototype: RTCIceTransportStateChangedEvent; - new(): RTCIceTransportStateChangedEvent; -} - -interface RTCRtpReceiverEventMap { - "error": ErrorEvent; -} - -interface RTCRtpReceiver extends RTCStatsProvider { - onerror: ((this: RTCRtpReceiver, ev: ErrorEvent) => any) | null; - readonly rtcpTransport: RTCDtlsTransport; - readonly track: MediaStreamTrack | null; - readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport; - getContributingSources(): RTCRtpContributingSource[]; - receive(parameters: RTCRtpParameters): void; - requestSendCSRC(csrc: number): void; - setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void; - stop(): void; - addEventListener(type: K, listener: (this: RTCRtpReceiver, ev: RTCRtpReceiverEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCRtpReceiver: { - prototype: RTCRtpReceiver; - new(transport: RTCDtlsTransport | RTCSrtpSdesTransport, kind: string, rtcpTransport?: RTCDtlsTransport): RTCRtpReceiver; - getCapabilities(kind?: string): RTCRtpCapabilities; -} - -interface RTCRtpSenderEventMap { - "error": ErrorEvent; - "ssrcconflict": RTCSsrcConflictEvent; -} - -interface RTCRtpSender extends RTCStatsProvider { - onerror: ((this: RTCRtpSender, ev: ErrorEvent) => any) | null; - onssrcconflict: ((this: RTCRtpSender, ev: RTCSsrcConflictEvent) => any) | null; - readonly rtcpTransport: RTCDtlsTransport; - readonly track: MediaStreamTrack; - readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport; - send(parameters: RTCRtpParameters): void; - setTrack(track: MediaStreamTrack): void; - setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void; - stop(): void; - addEventListener(type: K, listener: (this: RTCRtpSender, ev: RTCRtpSenderEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCRtpSender: { - prototype: RTCRtpSender; - new(track: MediaStreamTrack, transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): RTCRtpSender; - getCapabilities(kind?: string): RTCRtpCapabilities; -} - -interface RTCSrtpSdesTransportEventMap { - "error": ErrorEvent; -} - -interface RTCSrtpSdesTransport extends EventTarget { - onerror: ((this: RTCSrtpSdesTransport, ev: ErrorEvent) => any) | null; - readonly transport: RTCIceTransport; - addEventListener(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCSrtpSdesTransport: { - prototype: RTCSrtpSdesTransport; - new(transport: RTCIceTransport, encryptParameters: RTCSrtpSdesParameters, decryptParameters: RTCSrtpSdesParameters): RTCSrtpSdesTransport; - getLocalParameters(): RTCSrtpSdesParameters[]; -} - -interface RTCSsrcConflictEvent extends Event { - readonly ssrc: number; -} - -declare var RTCSsrcConflictEvent: { - prototype: RTCSsrcConflictEvent; - new(): RTCSsrcConflictEvent; -} - -interface RTCStatsProvider extends EventTarget { - getStats(): PromiseLike; - msGetStats(): PromiseLike; -} - -declare var RTCStatsProvider: { - prototype: RTCStatsProvider; - new(): RTCStatsProvider; -} - -interface Range { - readonly collapsed: boolean; - readonly commonAncestorContainer: Node; - readonly endContainer: Node; - readonly endOffset: number; - readonly startContainer: Node; - readonly startOffset: number; - cloneContents(): DocumentFragment; - cloneRange(): Range; - collapse(toStart: boolean): void; - compareBoundaryPoints(how: number, sourceRange: Range): number; - createContextualFragment(fragment: string): DocumentFragment; - deleteContents(): void; - detach(): void; - expand(Unit: string): boolean; - extractContents(): DocumentFragment; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; - insertNode(newNode: Node): void; - selectNode(refNode: Node): void; - selectNodeContents(refNode: Node): void; - setEnd(refNode: Node, offset: number): void; - setEndAfter(refNode: Node): void; - setEndBefore(refNode: Node): void; - setStart(refNode: Node, offset: number): void; - setStartAfter(refNode: Node): void; - setStartBefore(refNode: Node): void; - surroundContents(newParent: Node): void; - toString(): string; - readonly END_TO_END: number; - readonly END_TO_START: number; - readonly START_TO_END: number; - readonly START_TO_START: number; -} - -declare var Range: { - prototype: Range; - new(): Range; - readonly END_TO_END: number; - readonly END_TO_START: number; - readonly START_TO_END: number; - readonly START_TO_START: number; -} - -interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { - readonly target: SVGAnimatedString; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGAElement: { - prototype: SVGAElement; - new(): SVGAElement; -} - -interface SVGAngle { - readonly unitType: number; - value: number; - valueAsString: string; - valueInSpecifiedUnits: number; - convertToSpecifiedUnits(unitType: number): void; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - readonly SVG_ANGLETYPE_DEG: number; - readonly SVG_ANGLETYPE_GRAD: number; - readonly SVG_ANGLETYPE_RAD: number; - readonly SVG_ANGLETYPE_UNKNOWN: number; - readonly SVG_ANGLETYPE_UNSPECIFIED: number; -} - -declare var SVGAngle: { - prototype: SVGAngle; - new(): SVGAngle; - readonly SVG_ANGLETYPE_DEG: number; - readonly SVG_ANGLETYPE_GRAD: number; - readonly SVG_ANGLETYPE_RAD: number; - readonly SVG_ANGLETYPE_UNKNOWN: number; - readonly SVG_ANGLETYPE_UNSPECIFIED: number; -} - -interface SVGAnimatedAngle { - readonly animVal: SVGAngle; - readonly baseVal: SVGAngle; -} - -declare var SVGAnimatedAngle: { - prototype: SVGAnimatedAngle; - new(): SVGAnimatedAngle; -} - -interface SVGAnimatedBoolean { - readonly animVal: boolean; - baseVal: boolean; -} - -declare var SVGAnimatedBoolean: { - prototype: SVGAnimatedBoolean; - new(): SVGAnimatedBoolean; -} - -interface SVGAnimatedEnumeration { - readonly animVal: number; - baseVal: number; -} - -declare var SVGAnimatedEnumeration: { - prototype: SVGAnimatedEnumeration; - new(): SVGAnimatedEnumeration; -} - -interface SVGAnimatedInteger { - readonly animVal: number; - baseVal: number; -} - -declare var SVGAnimatedInteger: { - prototype: SVGAnimatedInteger; - new(): SVGAnimatedInteger; -} - -interface SVGAnimatedLength { - readonly animVal: SVGLength; - readonly baseVal: SVGLength; -} - -declare var SVGAnimatedLength: { - prototype: SVGAnimatedLength; - new(): SVGAnimatedLength; -} - -interface SVGAnimatedLengthList { - readonly animVal: SVGLengthList; - readonly baseVal: SVGLengthList; -} - -declare var SVGAnimatedLengthList: { - prototype: SVGAnimatedLengthList; - new(): SVGAnimatedLengthList; -} - -interface SVGAnimatedNumber { - readonly animVal: number; - baseVal: number; -} - -declare var SVGAnimatedNumber: { - prototype: SVGAnimatedNumber; - new(): SVGAnimatedNumber; -} - -interface SVGAnimatedNumberList { - readonly animVal: SVGNumberList; - readonly baseVal: SVGNumberList; -} - -declare var SVGAnimatedNumberList: { - prototype: SVGAnimatedNumberList; - new(): SVGAnimatedNumberList; -} - -interface SVGAnimatedPreserveAspectRatio { - readonly animVal: SVGPreserveAspectRatio; - readonly baseVal: SVGPreserveAspectRatio; -} - -declare var SVGAnimatedPreserveAspectRatio: { - prototype: SVGAnimatedPreserveAspectRatio; - new(): SVGAnimatedPreserveAspectRatio; -} - -interface SVGAnimatedRect { - readonly animVal: SVGRect; - readonly baseVal: SVGRect; -} - -declare var SVGAnimatedRect: { - prototype: SVGAnimatedRect; - new(): SVGAnimatedRect; -} - -interface SVGAnimatedString { - readonly animVal: string; - baseVal: string; -} - -declare var SVGAnimatedString: { - prototype: SVGAnimatedString; - new(): SVGAnimatedString; -} - -interface SVGAnimatedTransformList { - readonly animVal: SVGTransformList; - readonly baseVal: SVGTransformList; -} - -declare var SVGAnimatedTransformList: { - prototype: SVGAnimatedTransformList; - new(): SVGAnimatedTransformList; -} - -interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly cx: SVGAnimatedLength; - readonly cy: SVGAnimatedLength; - readonly r: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGCircleElement: { - prototype: SVGCircleElement; - new(): SVGCircleElement; -} - -interface SVGClipPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes { - readonly clipPathUnits: SVGAnimatedEnumeration; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGClipPathElement: { - prototype: SVGClipPathElement; - new(): SVGClipPathElement; -} - -interface SVGComponentTransferFunctionElement extends SVGElement { - readonly amplitude: SVGAnimatedNumber; - readonly exponent: SVGAnimatedNumber; - readonly intercept: SVGAnimatedNumber; - readonly offset: SVGAnimatedNumber; - readonly slope: SVGAnimatedNumber; - readonly tableValues: SVGAnimatedNumberList; - readonly type: SVGAnimatedEnumeration; - readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGComponentTransferFunctionElement: { - prototype: SVGComponentTransferFunctionElement; - new(): SVGComponentTransferFunctionElement; - readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; -} - -interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGDefsElement: { - prototype: SVGDefsElement; - new(): SVGDefsElement; -} - -interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGDescElement: { - prototype: SVGDescElement; - new(): SVGDescElement; -} - -interface SVGElementEventMap extends ElementEventMap { - "click": MouseEvent; - "dblclick": MouseEvent; - "focusin": FocusEvent; - "focusout": FocusEvent; - "load": Event; - "mousedown": MouseEvent; - "mousemove": MouseEvent; - "mouseout": MouseEvent; - "mouseover": MouseEvent; - "mouseup": MouseEvent; -} - -interface SVGElement extends Element { - onclick: (this: SVGElement, ev: MouseEvent) => any; - ondblclick: (this: SVGElement, ev: MouseEvent) => any; - onfocusin: (this: SVGElement, ev: FocusEvent) => any; - onfocusout: (this: SVGElement, ev: FocusEvent) => any; - onload: (this: SVGElement, ev: Event) => any; - onmousedown: (this: SVGElement, ev: MouseEvent) => any; - onmousemove: (this: SVGElement, ev: MouseEvent) => any; - onmouseout: (this: SVGElement, ev: MouseEvent) => any; - onmouseover: (this: SVGElement, ev: MouseEvent) => any; - onmouseup: (this: SVGElement, ev: MouseEvent) => any; - readonly ownerSVGElement: SVGSVGElement; - readonly viewportElement: SVGElement; - xmlbase: string; - className: any; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGElement: { - prototype: SVGElement; - new(): SVGElement; -} - -interface SVGElementInstance extends EventTarget { - readonly childNodes: SVGElementInstanceList; - readonly correspondingElement: SVGElement; - readonly correspondingUseElement: SVGUseElement; - readonly firstChild: SVGElementInstance; - readonly lastChild: SVGElementInstance; - readonly nextSibling: SVGElementInstance; - readonly parentNode: SVGElementInstance; - readonly previousSibling: SVGElementInstance; -} - -declare var SVGElementInstance: { - prototype: SVGElementInstance; - new(): SVGElementInstance; -} - -interface SVGElementInstanceList { - readonly length: number; - item(index: number): SVGElementInstance; -} - -declare var SVGElementInstanceList: { - prototype: SVGElementInstanceList; - new(): SVGElementInstanceList; -} - -interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly cx: SVGAnimatedLength; - readonly cy: SVGAnimatedLength; - readonly rx: SVGAnimatedLength; - readonly ry: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGEllipseElement: { - prototype: SVGEllipseElement; - new(): SVGEllipseElement; -} - -interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly in2: SVGAnimatedString; - readonly mode: SVGAnimatedEnumeration; - readonly SVG_FEBLEND_MODE_COLOR: number; - readonly SVG_FEBLEND_MODE_COLOR_BURN: number; - readonly SVG_FEBLEND_MODE_COLOR_DODGE: number; - readonly SVG_FEBLEND_MODE_DARKEN: number; - readonly SVG_FEBLEND_MODE_DIFFERENCE: number; - readonly SVG_FEBLEND_MODE_EXCLUSION: number; - readonly SVG_FEBLEND_MODE_HARD_LIGHT: number; - readonly SVG_FEBLEND_MODE_HUE: number; - readonly SVG_FEBLEND_MODE_LIGHTEN: number; - readonly SVG_FEBLEND_MODE_LUMINOSITY: number; - readonly SVG_FEBLEND_MODE_MULTIPLY: number; - readonly SVG_FEBLEND_MODE_NORMAL: number; - readonly SVG_FEBLEND_MODE_OVERLAY: number; - readonly SVG_FEBLEND_MODE_SATURATION: number; - readonly SVG_FEBLEND_MODE_SCREEN: number; - readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number; - readonly SVG_FEBLEND_MODE_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEBlendElement: { - prototype: SVGFEBlendElement; - new(): SVGFEBlendElement; - readonly SVG_FEBLEND_MODE_COLOR: number; - readonly SVG_FEBLEND_MODE_COLOR_BURN: number; - readonly SVG_FEBLEND_MODE_COLOR_DODGE: number; - readonly SVG_FEBLEND_MODE_DARKEN: number; - readonly SVG_FEBLEND_MODE_DIFFERENCE: number; - readonly SVG_FEBLEND_MODE_EXCLUSION: number; - readonly SVG_FEBLEND_MODE_HARD_LIGHT: number; - readonly SVG_FEBLEND_MODE_HUE: number; - readonly SVG_FEBLEND_MODE_LIGHTEN: number; - readonly SVG_FEBLEND_MODE_LUMINOSITY: number; - readonly SVG_FEBLEND_MODE_MULTIPLY: number; - readonly SVG_FEBLEND_MODE_NORMAL: number; - readonly SVG_FEBLEND_MODE_OVERLAY: number; - readonly SVG_FEBLEND_MODE_SATURATION: number; - readonly SVG_FEBLEND_MODE_SCREEN: number; - readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number; - readonly SVG_FEBLEND_MODE_UNKNOWN: number; -} - -interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly type: SVGAnimatedEnumeration; - readonly values: SVGAnimatedNumberList; - readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; - readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number; - readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number; - readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEColorMatrixElement: { - prototype: SVGFEColorMatrixElement; - new(): SVGFEColorMatrixElement; - readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; - readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number; - readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number; - readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; -} - -interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEComponentTransferElement: { - prototype: SVGFEComponentTransferElement; - new(): SVGFEComponentTransferElement; -} - -interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly in2: SVGAnimatedString; - readonly k1: SVGAnimatedNumber; - readonly k2: SVGAnimatedNumber; - readonly k3: SVGAnimatedNumber; - readonly k4: SVGAnimatedNumber; - readonly operator: SVGAnimatedEnumeration; - readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number; - readonly SVG_FECOMPOSITE_OPERATOR_IN: number; - readonly SVG_FECOMPOSITE_OPERATOR_OUT: number; - readonly SVG_FECOMPOSITE_OPERATOR_OVER: number; - readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - readonly SVG_FECOMPOSITE_OPERATOR_XOR: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFECompositeElement: { - prototype: SVGFECompositeElement; - new(): SVGFECompositeElement; - readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number; - readonly SVG_FECOMPOSITE_OPERATOR_IN: number; - readonly SVG_FECOMPOSITE_OPERATOR_OUT: number; - readonly SVG_FECOMPOSITE_OPERATOR_OVER: number; - readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - readonly SVG_FECOMPOSITE_OPERATOR_XOR: number; -} - -interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly bias: SVGAnimatedNumber; - readonly divisor: SVGAnimatedNumber; - readonly edgeMode: SVGAnimatedEnumeration; - readonly in1: SVGAnimatedString; - readonly kernelMatrix: SVGAnimatedNumberList; - readonly kernelUnitLengthX: SVGAnimatedNumber; - readonly kernelUnitLengthY: SVGAnimatedNumber; - readonly orderX: SVGAnimatedInteger; - readonly orderY: SVGAnimatedInteger; - readonly preserveAlpha: SVGAnimatedBoolean; - readonly targetX: SVGAnimatedInteger; - readonly targetY: SVGAnimatedInteger; - readonly SVG_EDGEMODE_DUPLICATE: number; - readonly SVG_EDGEMODE_NONE: number; - readonly SVG_EDGEMODE_UNKNOWN: number; - readonly SVG_EDGEMODE_WRAP: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEConvolveMatrixElement: { - prototype: SVGFEConvolveMatrixElement; - new(): SVGFEConvolveMatrixElement; - readonly SVG_EDGEMODE_DUPLICATE: number; - readonly SVG_EDGEMODE_NONE: number; - readonly SVG_EDGEMODE_UNKNOWN: number; - readonly SVG_EDGEMODE_WRAP: number; -} - -interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly diffuseConstant: SVGAnimatedNumber; - readonly in1: SVGAnimatedString; - readonly kernelUnitLengthX: SVGAnimatedNumber; - readonly kernelUnitLengthY: SVGAnimatedNumber; - readonly surfaceScale: SVGAnimatedNumber; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEDiffuseLightingElement: { - prototype: SVGFEDiffuseLightingElement; - new(): SVGFEDiffuseLightingElement; -} - -interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly in2: SVGAnimatedString; - readonly scale: SVGAnimatedNumber; - readonly xChannelSelector: SVGAnimatedEnumeration; - readonly yChannelSelector: SVGAnimatedEnumeration; - readonly SVG_CHANNEL_A: number; - readonly SVG_CHANNEL_B: number; - readonly SVG_CHANNEL_G: number; - readonly SVG_CHANNEL_R: number; - readonly SVG_CHANNEL_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEDisplacementMapElement: { - prototype: SVGFEDisplacementMapElement; - new(): SVGFEDisplacementMapElement; - readonly SVG_CHANNEL_A: number; - readonly SVG_CHANNEL_B: number; - readonly SVG_CHANNEL_G: number; - readonly SVG_CHANNEL_R: number; - readonly SVG_CHANNEL_UNKNOWN: number; -} - -interface SVGFEDistantLightElement extends SVGElement { - readonly azimuth: SVGAnimatedNumber; - readonly elevation: SVGAnimatedNumber; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEDistantLightElement: { - prototype: SVGFEDistantLightElement; - new(): SVGFEDistantLightElement; -} - -interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEFloodElement: { - prototype: SVGFEFloodElement; - new(): SVGFEFloodElement; -} - -interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncAElement: { - prototype: SVGFEFuncAElement; - new(): SVGFEFuncAElement; -} - -interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncBElement: { - prototype: SVGFEFuncBElement; - new(): SVGFEFuncBElement; -} - -interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncGElement: { - prototype: SVGFEFuncGElement; - new(): SVGFEFuncGElement; -} - -interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncRElement: { - prototype: SVGFEFuncRElement; - new(): SVGFEFuncRElement; -} - -interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly stdDeviationX: SVGAnimatedNumber; - readonly stdDeviationY: SVGAnimatedNumber; - setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEGaussianBlurElement: { - prototype: SVGFEGaussianBlurElement; - new(): SVGFEGaussianBlurElement; -} - -interface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { - readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEImageElement: { - prototype: SVGFEImageElement; - new(): SVGFEImageElement; -} - -interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEMergeElement: { - prototype: SVGFEMergeElement; - new(): SVGFEMergeElement; -} - -interface SVGFEMergeNodeElement extends SVGElement { - readonly in1: SVGAnimatedString; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEMergeNodeElement: { - prototype: SVGFEMergeNodeElement; - new(): SVGFEMergeNodeElement; -} - -interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly operator: SVGAnimatedEnumeration; - readonly radiusX: SVGAnimatedNumber; - readonly radiusY: SVGAnimatedNumber; - readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number; - readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number; - readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEMorphologyElement: { - prototype: SVGFEMorphologyElement; - new(): SVGFEMorphologyElement; - readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number; - readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number; - readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; -} - -interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly dx: SVGAnimatedNumber; - readonly dy: SVGAnimatedNumber; - readonly in1: SVGAnimatedString; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEOffsetElement: { - prototype: SVGFEOffsetElement; - new(): SVGFEOffsetElement; -} - -interface SVGFEPointLightElement extends SVGElement { - readonly x: SVGAnimatedNumber; - readonly y: SVGAnimatedNumber; - readonly z: SVGAnimatedNumber; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEPointLightElement: { - prototype: SVGFEPointLightElement; - new(): SVGFEPointLightElement; -} - -interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly kernelUnitLengthX: SVGAnimatedNumber; - readonly kernelUnitLengthY: SVGAnimatedNumber; - readonly specularConstant: SVGAnimatedNumber; - readonly specularExponent: SVGAnimatedNumber; - readonly surfaceScale: SVGAnimatedNumber; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFESpecularLightingElement: { - prototype: SVGFESpecularLightingElement; - new(): SVGFESpecularLightingElement; -} - -interface SVGFESpotLightElement extends SVGElement { - readonly limitingConeAngle: SVGAnimatedNumber; - readonly pointsAtX: SVGAnimatedNumber; - readonly pointsAtY: SVGAnimatedNumber; - readonly pointsAtZ: SVGAnimatedNumber; - readonly specularExponent: SVGAnimatedNumber; - readonly x: SVGAnimatedNumber; - readonly y: SVGAnimatedNumber; - readonly z: SVGAnimatedNumber; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFESpotLightElement: { - prototype: SVGFESpotLightElement; - new(): SVGFESpotLightElement; -} - -interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFETileElement: { - prototype: SVGFETileElement; - new(): SVGFETileElement; -} - -interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly baseFrequencyX: SVGAnimatedNumber; - readonly baseFrequencyY: SVGAnimatedNumber; - readonly numOctaves: SVGAnimatedInteger; - readonly seed: SVGAnimatedNumber; - readonly stitchTiles: SVGAnimatedEnumeration; - readonly type: SVGAnimatedEnumeration; - readonly SVG_STITCHTYPE_NOSTITCH: number; - readonly SVG_STITCHTYPE_STITCH: number; - readonly SVG_STITCHTYPE_UNKNOWN: number; - readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - readonly SVG_TURBULENCE_TYPE_TURBULENCE: number; - readonly SVG_TURBULENCE_TYPE_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFETurbulenceElement: { - prototype: SVGFETurbulenceElement; - new(): SVGFETurbulenceElement; - readonly SVG_STITCHTYPE_NOSTITCH: number; - readonly SVG_STITCHTYPE_STITCH: number; - readonly SVG_STITCHTYPE_UNKNOWN: number; - readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - readonly SVG_TURBULENCE_TYPE_TURBULENCE: number; - readonly SVG_TURBULENCE_TYPE_UNKNOWN: number; -} - -interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { - readonly filterResX: SVGAnimatedInteger; - readonly filterResY: SVGAnimatedInteger; - readonly filterUnits: SVGAnimatedEnumeration; - readonly height: SVGAnimatedLength; - readonly primitiveUnits: SVGAnimatedEnumeration; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - setFilterRes(filterResX: number, filterResY: number): void; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFilterElement: { - prototype: SVGFilterElement; - new(): SVGFilterElement; -} - -interface SVGForeignObjectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly height: SVGAnimatedLength; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGForeignObjectElement: { - prototype: SVGForeignObjectElement; - new(): SVGForeignObjectElement; -} - -interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGGElement: { - prototype: SVGGElement; - new(): SVGGElement; -} - -interface SVGGradientElement extends SVGElement, SVGStylable, SVGExternalResourcesRequired, SVGURIReference, SVGUnitTypes { - readonly gradientTransform: SVGAnimatedTransformList; - readonly gradientUnits: SVGAnimatedEnumeration; - readonly spreadMethod: SVGAnimatedEnumeration; - readonly SVG_SPREADMETHOD_PAD: number; - readonly SVG_SPREADMETHOD_REFLECT: number; - readonly SVG_SPREADMETHOD_REPEAT: number; - readonly SVG_SPREADMETHOD_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGGradientElement: { - prototype: SVGGradientElement; - new(): SVGGradientElement; - readonly SVG_SPREADMETHOD_PAD: number; - readonly SVG_SPREADMETHOD_REFLECT: number; - readonly SVG_SPREADMETHOD_REPEAT: number; - readonly SVG_SPREADMETHOD_UNKNOWN: number; -} - -interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { - readonly height: SVGAnimatedLength; - readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGImageElement: { - prototype: SVGImageElement; - new(): SVGImageElement; -} - -interface SVGLength { - readonly unitType: number; - value: number; - valueAsString: string; - valueInSpecifiedUnits: number; - convertToSpecifiedUnits(unitType: number): void; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - readonly SVG_LENGTHTYPE_CM: number; - readonly SVG_LENGTHTYPE_EMS: number; - readonly SVG_LENGTHTYPE_EXS: number; - readonly SVG_LENGTHTYPE_IN: number; - readonly SVG_LENGTHTYPE_MM: number; - readonly SVG_LENGTHTYPE_NUMBER: number; - readonly SVG_LENGTHTYPE_PC: number; - readonly SVG_LENGTHTYPE_PERCENTAGE: number; - readonly SVG_LENGTHTYPE_PT: number; - readonly SVG_LENGTHTYPE_PX: number; - readonly SVG_LENGTHTYPE_UNKNOWN: number; -} - -declare var SVGLength: { - prototype: SVGLength; - new(): SVGLength; - readonly SVG_LENGTHTYPE_CM: number; - readonly SVG_LENGTHTYPE_EMS: number; - readonly SVG_LENGTHTYPE_EXS: number; - readonly SVG_LENGTHTYPE_IN: number; - readonly SVG_LENGTHTYPE_MM: number; - readonly SVG_LENGTHTYPE_NUMBER: number; - readonly SVG_LENGTHTYPE_PC: number; - readonly SVG_LENGTHTYPE_PERCENTAGE: number; - readonly SVG_LENGTHTYPE_PT: number; - readonly SVG_LENGTHTYPE_PX: number; - readonly SVG_LENGTHTYPE_UNKNOWN: number; -} - -interface SVGLengthList { - readonly numberOfItems: number; - appendItem(newItem: SVGLength): SVGLength; - clear(): void; - getItem(index: number): SVGLength; - initialize(newItem: SVGLength): SVGLength; - insertItemBefore(newItem: SVGLength, index: number): SVGLength; - removeItem(index: number): SVGLength; - replaceItem(newItem: SVGLength, index: number): SVGLength; -} - -declare var SVGLengthList: { - prototype: SVGLengthList; - new(): SVGLengthList; -} - -interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly x1: SVGAnimatedLength; - readonly x2: SVGAnimatedLength; - readonly y1: SVGAnimatedLength; - readonly y2: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGLineElement: { - prototype: SVGLineElement; - new(): SVGLineElement; -} - -interface SVGLinearGradientElement extends SVGGradientElement { - readonly x1: SVGAnimatedLength; - readonly x2: SVGAnimatedLength; - readonly y1: SVGAnimatedLength; - readonly y2: SVGAnimatedLength; -} - -declare var SVGLinearGradientElement: { - prototype: SVGLinearGradientElement; - new(): SVGLinearGradientElement; -} - -interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox { - readonly markerHeight: SVGAnimatedLength; - readonly markerUnits: SVGAnimatedEnumeration; - readonly markerWidth: SVGAnimatedLength; - readonly orientAngle: SVGAnimatedAngle; - readonly orientType: SVGAnimatedEnumeration; - readonly refX: SVGAnimatedLength; - readonly refY: SVGAnimatedLength; - setOrientToAngle(angle: SVGAngle): void; - setOrientToAuto(): void; - readonly SVG_MARKERUNITS_STROKEWIDTH: number; - readonly SVG_MARKERUNITS_UNKNOWN: number; - readonly SVG_MARKERUNITS_USERSPACEONUSE: number; - readonly SVG_MARKER_ORIENT_ANGLE: number; - readonly SVG_MARKER_ORIENT_AUTO: number; - readonly SVG_MARKER_ORIENT_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGMarkerElement: { - prototype: SVGMarkerElement; - new(): SVGMarkerElement; - readonly SVG_MARKERUNITS_STROKEWIDTH: number; - readonly SVG_MARKERUNITS_UNKNOWN: number; - readonly SVG_MARKERUNITS_USERSPACEONUSE: number; - readonly SVG_MARKER_ORIENT_ANGLE: number; - readonly SVG_MARKER_ORIENT_AUTO: number; - readonly SVG_MARKER_ORIENT_UNKNOWN: number; -} - -interface SVGMaskElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes { - readonly height: SVGAnimatedLength; - readonly maskContentUnits: SVGAnimatedEnumeration; - readonly maskUnits: SVGAnimatedEnumeration; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGMaskElement: { - prototype: SVGMaskElement; - new(): SVGMaskElement; -} - -interface SVGMatrix { - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; - flipX(): SVGMatrix; - flipY(): SVGMatrix; - inverse(): SVGMatrix; - multiply(secondMatrix: SVGMatrix): SVGMatrix; - rotate(angle: number): SVGMatrix; - rotateFromVector(x: number, y: number): SVGMatrix; - scale(scaleFactor: number): SVGMatrix; - scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; - skewX(angle: number): SVGMatrix; - skewY(angle: number): SVGMatrix; - translate(x: number, y: number): SVGMatrix; -} - -declare var SVGMatrix: { - prototype: SVGMatrix; - new(): SVGMatrix; -} - -interface SVGMetadataElement extends SVGElement { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGMetadataElement: { - prototype: SVGMetadataElement; - new(): SVGMetadataElement; -} - -interface SVGNumber { - value: number; -} - -declare var SVGNumber: { - prototype: SVGNumber; - new(): SVGNumber; -} - -interface SVGNumberList { - readonly numberOfItems: number; - appendItem(newItem: SVGNumber): SVGNumber; - clear(): void; - getItem(index: number): SVGNumber; - initialize(newItem: SVGNumber): SVGNumber; - insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; - removeItem(index: number): SVGNumber; - replaceItem(newItem: SVGNumber, index: number): SVGNumber; -} - -declare var SVGNumberList: { - prototype: SVGNumberList; - new(): SVGNumberList; -} - -interface SVGPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPathData { - createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; - createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; - createSVGPathSegClosePath(): SVGPathSegClosePath; - createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; - createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; - createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; - createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; - createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; - createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; - createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; - createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; - createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; - createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; - createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; - createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; - createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; - createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; - createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; - createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; - getPathSegAtLength(distance: number): number; - getPointAtLength(distance: number): SVGPoint; - getTotalLength(): number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPathElement: { - prototype: SVGPathElement; - new(): SVGPathElement; -} - -interface SVGPathSeg { - readonly pathSegType: number; - readonly pathSegTypeAsLetter: string; - readonly PATHSEG_ARC_ABS: number; - readonly PATHSEG_ARC_REL: number; - readonly PATHSEG_CLOSEPATH: number; - readonly PATHSEG_CURVETO_CUBIC_ABS: number; - readonly PATHSEG_CURVETO_CUBIC_REL: number; - readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - readonly PATHSEG_CURVETO_QUADRATIC_ABS: number; - readonly PATHSEG_CURVETO_QUADRATIC_REL: number; - readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; - readonly PATHSEG_LINETO_ABS: number; - readonly PATHSEG_LINETO_HORIZONTAL_ABS: number; - readonly PATHSEG_LINETO_HORIZONTAL_REL: number; - readonly PATHSEG_LINETO_REL: number; - readonly PATHSEG_LINETO_VERTICAL_ABS: number; - readonly PATHSEG_LINETO_VERTICAL_REL: number; - readonly PATHSEG_MOVETO_ABS: number; - readonly PATHSEG_MOVETO_REL: number; - readonly PATHSEG_UNKNOWN: number; -} - -declare var SVGPathSeg: { - prototype: SVGPathSeg; - new(): SVGPathSeg; - readonly PATHSEG_ARC_ABS: number; - readonly PATHSEG_ARC_REL: number; - readonly PATHSEG_CLOSEPATH: number; - readonly PATHSEG_CURVETO_CUBIC_ABS: number; - readonly PATHSEG_CURVETO_CUBIC_REL: number; - readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - readonly PATHSEG_CURVETO_QUADRATIC_ABS: number; - readonly PATHSEG_CURVETO_QUADRATIC_REL: number; - readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; - readonly PATHSEG_LINETO_ABS: number; - readonly PATHSEG_LINETO_HORIZONTAL_ABS: number; - readonly PATHSEG_LINETO_HORIZONTAL_REL: number; - readonly PATHSEG_LINETO_REL: number; - readonly PATHSEG_LINETO_VERTICAL_ABS: number; - readonly PATHSEG_LINETO_VERTICAL_REL: number; - readonly PATHSEG_MOVETO_ABS: number; - readonly PATHSEG_MOVETO_REL: number; - readonly PATHSEG_UNKNOWN: number; -} - -interface SVGPathSegArcAbs extends SVGPathSeg { - angle: number; - largeArcFlag: boolean; - r1: number; - r2: number; - sweepFlag: boolean; - x: number; - y: number; -} - -declare var SVGPathSegArcAbs: { - prototype: SVGPathSegArcAbs; - new(): SVGPathSegArcAbs; -} - -interface SVGPathSegArcRel extends SVGPathSeg { - angle: number; - largeArcFlag: boolean; - r1: number; - r2: number; - sweepFlag: boolean; - x: number; - y: number; -} - -declare var SVGPathSegArcRel: { - prototype: SVGPathSegArcRel; - new(): SVGPathSegArcRel; -} - -interface SVGPathSegClosePath extends SVGPathSeg { -} - -declare var SVGPathSegClosePath: { - prototype: SVGPathSegClosePath; - new(): SVGPathSegClosePath; -} - -interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { - x: number; - x1: number; - x2: number; - y: number; - y1: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicAbs: { - prototype: SVGPathSegCurvetoCubicAbs; - new(): SVGPathSegCurvetoCubicAbs; -} - -interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { - x: number; - x1: number; - x2: number; - y: number; - y1: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicRel: { - prototype: SVGPathSegCurvetoCubicRel; - new(): SVGPathSegCurvetoCubicRel; -} - -interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { - x: number; - x2: number; - y: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicSmoothAbs: { - prototype: SVGPathSegCurvetoCubicSmoothAbs; - new(): SVGPathSegCurvetoCubicSmoothAbs; -} - -interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { - x: number; - x2: number; - y: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicSmoothRel: { - prototype: SVGPathSegCurvetoCubicSmoothRel; - new(): SVGPathSegCurvetoCubicSmoothRel; -} - -interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { - x: number; - x1: number; - y: number; - y1: number; -} - -declare var SVGPathSegCurvetoQuadraticAbs: { - prototype: SVGPathSegCurvetoQuadraticAbs; - new(): SVGPathSegCurvetoQuadraticAbs; -} - -interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { - x: number; - x1: number; - y: number; - y1: number; -} - -declare var SVGPathSegCurvetoQuadraticRel: { - prototype: SVGPathSegCurvetoQuadraticRel; - new(): SVGPathSegCurvetoQuadraticRel; -} - -interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegCurvetoQuadraticSmoothAbs: { - prototype: SVGPathSegCurvetoQuadraticSmoothAbs; - new(): SVGPathSegCurvetoQuadraticSmoothAbs; -} - -interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegCurvetoQuadraticSmoothRel: { - prototype: SVGPathSegCurvetoQuadraticSmoothRel; - new(): SVGPathSegCurvetoQuadraticSmoothRel; -} - -interface SVGPathSegLinetoAbs extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegLinetoAbs: { - prototype: SVGPathSegLinetoAbs; - new(): SVGPathSegLinetoAbs; -} - -interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { - x: number; -} - -declare var SVGPathSegLinetoHorizontalAbs: { - prototype: SVGPathSegLinetoHorizontalAbs; - new(): SVGPathSegLinetoHorizontalAbs; -} - -interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { - x: number; -} - -declare var SVGPathSegLinetoHorizontalRel: { - prototype: SVGPathSegLinetoHorizontalRel; - new(): SVGPathSegLinetoHorizontalRel; -} - -interface SVGPathSegLinetoRel extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegLinetoRel: { - prototype: SVGPathSegLinetoRel; - new(): SVGPathSegLinetoRel; -} - -interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { - y: number; -} - -declare var SVGPathSegLinetoVerticalAbs: { - prototype: SVGPathSegLinetoVerticalAbs; - new(): SVGPathSegLinetoVerticalAbs; -} - -interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { - y: number; -} - -declare var SVGPathSegLinetoVerticalRel: { - prototype: SVGPathSegLinetoVerticalRel; - new(): SVGPathSegLinetoVerticalRel; -} - -interface SVGPathSegList { - readonly numberOfItems: number; - appendItem(newItem: SVGPathSeg): SVGPathSeg; - clear(): void; - getItem(index: number): SVGPathSeg; - initialize(newItem: SVGPathSeg): SVGPathSeg; - insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; - removeItem(index: number): SVGPathSeg; - replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; -} - -declare var SVGPathSegList: { - prototype: SVGPathSegList; - new(): SVGPathSegList; -} - -interface SVGPathSegMovetoAbs extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegMovetoAbs: { - prototype: SVGPathSegMovetoAbs; - new(): SVGPathSegMovetoAbs; -} - -interface SVGPathSegMovetoRel extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegMovetoRel: { - prototype: SVGPathSegMovetoRel; - new(): SVGPathSegMovetoRel; -} - -interface SVGPatternElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGURIReference, SVGUnitTypes { - readonly height: SVGAnimatedLength; - readonly patternContentUnits: SVGAnimatedEnumeration; - readonly patternTransform: SVGAnimatedTransformList; - readonly patternUnits: SVGAnimatedEnumeration; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPatternElement: { - prototype: SVGPatternElement; - new(): SVGPatternElement; -} - -interface SVGPoint { - x: number; - y: number; - matrixTransform(matrix: SVGMatrix): SVGPoint; -} - -declare var SVGPoint: { - prototype: SVGPoint; - new(): SVGPoint; -} - -interface SVGPointList { - readonly numberOfItems: number; - appendItem(newItem: SVGPoint): SVGPoint; - clear(): void; - getItem(index: number): SVGPoint; - initialize(newItem: SVGPoint): SVGPoint; - insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; - removeItem(index: number): SVGPoint; - replaceItem(newItem: SVGPoint, index: number): SVGPoint; -} - -declare var SVGPointList: { - prototype: SVGPointList; - new(): SVGPointList; -} - -interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPolygonElement: { - prototype: SVGPolygonElement; - new(): SVGPolygonElement; -} - -interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPolylineElement: { - prototype: SVGPolylineElement; - new(): SVGPolylineElement; -} - -interface SVGPreserveAspectRatio { - align: number; - meetOrSlice: number; - readonly SVG_MEETORSLICE_MEET: number; - readonly SVG_MEETORSLICE_SLICE: number; - readonly SVG_MEETORSLICE_UNKNOWN: number; - readonly SVG_PRESERVEASPECTRATIO_NONE: number; - readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number; -} - -declare var SVGPreserveAspectRatio: { - prototype: SVGPreserveAspectRatio; - new(): SVGPreserveAspectRatio; - readonly SVG_MEETORSLICE_MEET: number; - readonly SVG_MEETORSLICE_SLICE: number; - readonly SVG_MEETORSLICE_UNKNOWN: number; - readonly SVG_PRESERVEASPECTRATIO_NONE: number; - readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number; -} - -interface SVGRadialGradientElement extends SVGGradientElement { - readonly cx: SVGAnimatedLength; - readonly cy: SVGAnimatedLength; - readonly fx: SVGAnimatedLength; - readonly fy: SVGAnimatedLength; - readonly r: SVGAnimatedLength; -} - -declare var SVGRadialGradientElement: { - prototype: SVGRadialGradientElement; - new(): SVGRadialGradientElement; -} - -interface SVGRect { - height: number; - width: number; - x: number; - y: number; -} - -declare var SVGRect: { - prototype: SVGRect; - new(): SVGRect; -} - -interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly height: SVGAnimatedLength; - readonly rx: SVGAnimatedLength; - readonly ry: SVGAnimatedLength; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGRectElement: { - prototype: SVGRectElement; - new(): SVGRectElement; -} - -interface SVGSVGElementEventMap extends SVGElementEventMap { - "SVGAbort": Event; - "SVGError": Event; - "resize": UIEvent; - "scroll": UIEvent; - "SVGUnload": Event; - "SVGZoom": SVGZoomEvent; -} - -interface SVGSVGElement extends SVGElement, DocumentEvent, SVGLocatable, SVGTests, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan { - contentScriptType: string; - contentStyleType: string; - currentScale: number; - readonly currentTranslate: SVGPoint; - readonly height: SVGAnimatedLength; - onabort: (this: SVGSVGElement, ev: Event) => any; - onerror: (this: SVGSVGElement, ev: Event) => any; - onresize: (this: SVGSVGElement, ev: UIEvent) => any; - onscroll: (this: SVGSVGElement, ev: UIEvent) => any; - onunload: (this: SVGSVGElement, ev: Event) => any; - onzoom: (this: SVGSVGElement, ev: SVGZoomEvent) => any; - readonly pixelUnitToMillimeterX: number; - readonly pixelUnitToMillimeterY: number; - readonly screenPixelToMillimeterX: number; - readonly screenPixelToMillimeterY: number; - readonly viewport: SVGRect; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - checkEnclosure(element: SVGElement, rect: SVGRect): boolean; - checkIntersection(element: SVGElement, rect: SVGRect): boolean; - createSVGAngle(): SVGAngle; - createSVGLength(): SVGLength; - createSVGMatrix(): SVGMatrix; - createSVGNumber(): SVGNumber; - createSVGPoint(): SVGPoint; - createSVGRect(): SVGRect; - createSVGTransform(): SVGTransform; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; - deselectAll(): void; - forceRedraw(): void; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - getCurrentTime(): number; - getElementById(elementId: string): Element; - getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeListOf; - getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeListOf; - pauseAnimations(): void; - setCurrentTime(seconds: number): void; - suspendRedraw(maxWaitMilliseconds: number): number; - unpauseAnimations(): void; - unsuspendRedraw(suspendHandleID: number): void; - unsuspendRedrawAll(): void; - addEventListener(type: K, listener: (this: SVGSVGElement, ev: SVGSVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGSVGElement: { - prototype: SVGSVGElement; - new(): SVGSVGElement; -} - -interface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference { - type: string; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGScriptElement: { - prototype: SVGScriptElement; - new(): SVGScriptElement; -} - -interface SVGStopElement extends SVGElement, SVGStylable { - readonly offset: SVGAnimatedNumber; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGStopElement: { - prototype: SVGStopElement; - new(): SVGStopElement; -} - -interface SVGStringList { - readonly numberOfItems: number; - appendItem(newItem: string): string; - clear(): void; - getItem(index: number): string; - initialize(newItem: string): string; - insertItemBefore(newItem: string, index: number): string; - removeItem(index: number): string; - replaceItem(newItem: string, index: number): string; -} - -declare var SVGStringList: { - prototype: SVGStringList; - new(): SVGStringList; -} - -interface SVGStyleElement extends SVGElement, SVGLangSpace { - disabled: boolean; - media: string; - title: string; - type: string; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGStyleElement: { - prototype: SVGStyleElement; - new(): SVGStyleElement; -} - -interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGSwitchElement: { - prototype: SVGSwitchElement; - new(): SVGSwitchElement; -} - -interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGSymbolElement: { - prototype: SVGSymbolElement; - new(): SVGSymbolElement; -} - -interface SVGTSpanElement extends SVGTextPositioningElement { -} - -declare var SVGTSpanElement: { - prototype: SVGTSpanElement; - new(): SVGTSpanElement; -} - -interface SVGTextContentElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly lengthAdjust: SVGAnimatedEnumeration; - readonly textLength: SVGAnimatedLength; - getCharNumAtPosition(point: SVGPoint): number; - getComputedTextLength(): number; - getEndPositionOfChar(charnum: number): SVGPoint; - getExtentOfChar(charnum: number): SVGRect; - getNumberOfChars(): number; - getRotationOfChar(charnum: number): number; - getStartPositionOfChar(charnum: number): SVGPoint; - getSubStringLength(charnum: number, nchars: number): number; - selectSubString(charnum: number, nchars: number): void; - readonly LENGTHADJUST_SPACING: number; - readonly LENGTHADJUST_SPACINGANDGLYPHS: number; - readonly LENGTHADJUST_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGTextContentElement: { - prototype: SVGTextContentElement; - new(): SVGTextContentElement; - readonly LENGTHADJUST_SPACING: number; - readonly LENGTHADJUST_SPACINGANDGLYPHS: number; - readonly LENGTHADJUST_UNKNOWN: number; -} - -interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable { -} - -declare var SVGTextElement: { - prototype: SVGTextElement; - new(): SVGTextElement; -} - -interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { - readonly method: SVGAnimatedEnumeration; - readonly spacing: SVGAnimatedEnumeration; - readonly startOffset: SVGAnimatedLength; - readonly TEXTPATH_METHODTYPE_ALIGN: number; - readonly TEXTPATH_METHODTYPE_STRETCH: number; - readonly TEXTPATH_METHODTYPE_UNKNOWN: number; - readonly TEXTPATH_SPACINGTYPE_AUTO: number; - readonly TEXTPATH_SPACINGTYPE_EXACT: number; - readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number; -} - -declare var SVGTextPathElement: { - prototype: SVGTextPathElement; - new(): SVGTextPathElement; - readonly TEXTPATH_METHODTYPE_ALIGN: number; - readonly TEXTPATH_METHODTYPE_STRETCH: number; - readonly TEXTPATH_METHODTYPE_UNKNOWN: number; - readonly TEXTPATH_SPACINGTYPE_AUTO: number; - readonly TEXTPATH_SPACINGTYPE_EXACT: number; - readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number; -} - -interface SVGTextPositioningElement extends SVGTextContentElement { - readonly dx: SVGAnimatedLengthList; - readonly dy: SVGAnimatedLengthList; - readonly rotate: SVGAnimatedNumberList; - readonly x: SVGAnimatedLengthList; - readonly y: SVGAnimatedLengthList; -} - -declare var SVGTextPositioningElement: { - prototype: SVGTextPositioningElement; - new(): SVGTextPositioningElement; -} - -interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGTitleElement: { - prototype: SVGTitleElement; - new(): SVGTitleElement; -} - -interface SVGTransform { - readonly angle: number; - readonly matrix: SVGMatrix; - readonly type: number; - setMatrix(matrix: SVGMatrix): void; - setRotate(angle: number, cx: number, cy: number): void; - setScale(sx: number, sy: number): void; - setSkewX(angle: number): void; - setSkewY(angle: number): void; - setTranslate(tx: number, ty: number): void; - readonly SVG_TRANSFORM_MATRIX: number; - readonly SVG_TRANSFORM_ROTATE: number; - readonly SVG_TRANSFORM_SCALE: number; - readonly SVG_TRANSFORM_SKEWX: number; - readonly SVG_TRANSFORM_SKEWY: number; - readonly SVG_TRANSFORM_TRANSLATE: number; - readonly SVG_TRANSFORM_UNKNOWN: number; -} - -declare var SVGTransform: { - prototype: SVGTransform; - new(): SVGTransform; - readonly SVG_TRANSFORM_MATRIX: number; - readonly SVG_TRANSFORM_ROTATE: number; - readonly SVG_TRANSFORM_SCALE: number; - readonly SVG_TRANSFORM_SKEWX: number; - readonly SVG_TRANSFORM_SKEWY: number; - readonly SVG_TRANSFORM_TRANSLATE: number; - readonly SVG_TRANSFORM_UNKNOWN: number; -} - -interface SVGTransformList { - readonly numberOfItems: number; - appendItem(newItem: SVGTransform): SVGTransform; - clear(): void; - consolidate(): SVGTransform; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; - getItem(index: number): SVGTransform; - initialize(newItem: SVGTransform): SVGTransform; - insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; - removeItem(index: number): SVGTransform; - replaceItem(newItem: SVGTransform, index: number): SVGTransform; -} - -declare var SVGTransformList: { - prototype: SVGTransformList; - new(): SVGTransformList; -} - -interface SVGUnitTypes { - readonly SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; - readonly SVG_UNIT_TYPE_UNKNOWN: number; - readonly SVG_UNIT_TYPE_USERSPACEONUSE: number; -} -declare var SVGUnitTypes: SVGUnitTypes; - -interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { - readonly animatedInstanceRoot: SVGElementInstance; - readonly height: SVGAnimatedLength; - readonly instanceRoot: SVGElementInstance; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGUseElement: { - prototype: SVGUseElement; - new(): SVGUseElement; -} - -interface SVGViewElement extends SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan { - readonly viewTarget: SVGStringList; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGViewElement: { - prototype: SVGViewElement; - new(): SVGViewElement; -} - -interface SVGZoomAndPan { - readonly zoomAndPan: number; -} - -declare var SVGZoomAndPan: { - readonly SVG_ZOOMANDPAN_DISABLE: number; - readonly SVG_ZOOMANDPAN_MAGNIFY: number; - readonly SVG_ZOOMANDPAN_UNKNOWN: number; -} - -interface SVGZoomEvent extends UIEvent { - readonly newScale: number; - readonly newTranslate: SVGPoint; - readonly previousScale: number; - readonly previousTranslate: SVGPoint; - readonly zoomRectScreen: SVGRect; -} - -declare var SVGZoomEvent: { - prototype: SVGZoomEvent; - new(): SVGZoomEvent; -} - -interface ScreenEventMap { - "MSOrientationChange": Event; -} - -interface Screen extends EventTarget { - readonly availHeight: number; - readonly availWidth: number; - bufferDepth: number; - readonly colorDepth: number; - readonly deviceXDPI: number; - readonly deviceYDPI: number; - readonly fontSmoothingEnabled: boolean; - readonly height: number; - readonly logicalXDPI: number; - readonly logicalYDPI: number; - readonly msOrientation: string; - onmsorientationchange: (this: Screen, ev: Event) => any; - readonly pixelDepth: number; - readonly systemXDPI: number; - readonly systemYDPI: number; - readonly width: number; - msLockOrientation(orientations: string | string[]): boolean; - msUnlockOrientation(): void; - addEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Screen: { - prototype: Screen; - new(): Screen; -} - -interface ScriptNotifyEvent extends Event { - readonly callingUri: string; - readonly value: string; -} - -declare var ScriptNotifyEvent: { - prototype: ScriptNotifyEvent; - new(): ScriptNotifyEvent; -} - -interface ScriptProcessorNodeEventMap { - "audioprocess": AudioProcessingEvent; -} - -interface ScriptProcessorNode extends AudioNode { - readonly bufferSize: number; - onaudioprocess: (this: ScriptProcessorNode, ev: AudioProcessingEvent) => any; - addEventListener(type: K, listener: (this: ScriptProcessorNode, ev: ScriptProcessorNodeEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var ScriptProcessorNode: { - prototype: ScriptProcessorNode; - new(): ScriptProcessorNode; -} - -interface Selection { - readonly anchorNode: Node; - readonly anchorOffset: number; - readonly focusNode: Node; - readonly focusOffset: number; - readonly isCollapsed: boolean; - readonly rangeCount: number; - readonly type: string; - addRange(range: Range): void; - collapse(parentNode: Node, offset: number): void; - collapseToEnd(): void; - collapseToStart(): void; - containsNode(node: Node, partlyContained: boolean): boolean; - deleteFromDocument(): void; - empty(): void; - extend(newNode: Node, offset: number): void; - getRangeAt(index: number): Range; - removeAllRanges(): void; - removeRange(range: Range): void; - selectAllChildren(parentNode: Node): void; - setBaseAndExtent(baseNode: Node, baseOffset: number, extentNode: Node, extentOffset: number): void; - toString(): string; -} - -declare var Selection: { - prototype: Selection; - new(): Selection; -} - -interface SourceBuffer extends EventTarget { - appendWindowEnd: number; - appendWindowStart: number; - readonly audioTracks: AudioTrackList; - readonly buffered: TimeRanges; - mode: string; - timestampOffset: number; - readonly updating: boolean; - readonly videoTracks: VideoTrackList; - abort(): void; - appendBuffer(data: ArrayBuffer | ArrayBufferView): void; - appendStream(stream: MSStream, maxSize?: number): void; - remove(start: number, end: number): void; -} - -declare var SourceBuffer: { - prototype: SourceBuffer; - new(): SourceBuffer; -} - -interface SourceBufferList extends EventTarget { - readonly length: number; - item(index: number): SourceBuffer; - [index: number]: SourceBuffer; -} - -declare var SourceBufferList: { - prototype: SourceBufferList; - new(): SourceBufferList; -} - -interface StereoPannerNode extends AudioNode { - readonly pan: AudioParam; -} - -declare var StereoPannerNode: { - prototype: StereoPannerNode; - new(): StereoPannerNode; -} - -interface Storage { - readonly length: number; - clear(): void; - getItem(key: string): string | null; - key(index: number): string | null; - removeItem(key: string): void; - setItem(key: string, data: string): void; - [key: string]: any; - [index: number]: string; -} - -declare var Storage: { - prototype: Storage; - new(): Storage; -} - -interface StorageEvent extends Event { - readonly url: string; - key?: string; - oldValue?: string; - newValue?: string; - storageArea?: Storage; -} - -declare var StorageEvent: { - prototype: StorageEvent; - new (type: string, eventInitDict?: StorageEventInit): StorageEvent; -} - -interface StyleMedia { - readonly type: string; - matchMedium(mediaquery: string): boolean; -} - -declare var StyleMedia: { - prototype: StyleMedia; - new(): StyleMedia; -} - -interface StyleSheet { - disabled: boolean; - readonly href: string; - readonly media: MediaList; - readonly ownerNode: Node; - readonly parentStyleSheet: StyleSheet; - readonly title: string; - readonly type: string; -} - -declare var StyleSheet: { - prototype: StyleSheet; - new(): StyleSheet; -} - -interface StyleSheetList { - readonly length: number; - item(index?: number): StyleSheet; - [index: number]: StyleSheet; -} - -declare var StyleSheetList: { - prototype: StyleSheetList; - new(): StyleSheetList; -} - -interface StyleSheetPageList { - readonly length: number; - item(index: number): CSSPageRule; - [index: number]: CSSPageRule; -} - -declare var StyleSheetPageList: { - prototype: StyleSheetPageList; - new(): StyleSheetPageList; -} - -interface SubtleCrypto { - decrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): PromiseLike; - deriveBits(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, length: number): PromiseLike; - deriveKey(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike; - digest(algorithm: AlgorithmIdentifier, data: BufferSource): PromiseLike; - encrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): PromiseLike; - exportKey(format: "jwk", key: CryptoKey): PromiseLike; - exportKey(format: "raw" | "pkcs8" | "spki", key: CryptoKey): PromiseLike; - exportKey(format: string, key: CryptoKey): PromiseLike; - generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): PromiseLike; - generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: string[]): PromiseLike; - generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike; - importKey(format: "jwk", keyData: JsonWebKey, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike; - importKey(format: "raw" | "pkcs8" | "spki", keyData: BufferSource, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike; - importKey(format: string, keyData: JsonWebKey | BufferSource, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike; - sign(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, data: BufferSource): PromiseLike; - unwrapKey(format: string, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: string[]): PromiseLike; - verify(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, signature: BufferSource, data: BufferSource): PromiseLike; - wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier): PromiseLike; -} - -declare var SubtleCrypto: { - prototype: SubtleCrypto; - new(): SubtleCrypto; -} - -interface Text extends CharacterData { - readonly wholeText: string; - readonly assignedSlot: HTMLSlotElement | null; - splitText(offset: number): Text; -} - -declare var Text: { - prototype: Text; - new(): Text; -} - -interface TextEvent extends UIEvent { - readonly data: string; - readonly inputMethod: number; - readonly locale: string; - initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; - readonly DOM_INPUT_METHOD_DROP: number; - readonly DOM_INPUT_METHOD_HANDWRITING: number; - readonly DOM_INPUT_METHOD_IME: number; - readonly DOM_INPUT_METHOD_KEYBOARD: number; - readonly DOM_INPUT_METHOD_MULTIMODAL: number; - readonly DOM_INPUT_METHOD_OPTION: number; - readonly DOM_INPUT_METHOD_PASTE: number; - readonly DOM_INPUT_METHOD_SCRIPT: number; - readonly DOM_INPUT_METHOD_UNKNOWN: number; - readonly DOM_INPUT_METHOD_VOICE: number; -} - -declare var TextEvent: { - prototype: TextEvent; - new(): TextEvent; - readonly DOM_INPUT_METHOD_DROP: number; - readonly DOM_INPUT_METHOD_HANDWRITING: number; - readonly DOM_INPUT_METHOD_IME: number; - readonly DOM_INPUT_METHOD_KEYBOARD: number; - readonly DOM_INPUT_METHOD_MULTIMODAL: number; - readonly DOM_INPUT_METHOD_OPTION: number; - readonly DOM_INPUT_METHOD_PASTE: number; - readonly DOM_INPUT_METHOD_SCRIPT: number; - readonly DOM_INPUT_METHOD_UNKNOWN: number; - readonly DOM_INPUT_METHOD_VOICE: number; -} - -interface TextMetrics { - readonly width: number; -} - -declare var TextMetrics: { - prototype: TextMetrics; - new(): TextMetrics; -} - -interface TextTrackEventMap { - "cuechange": Event; - "error": ErrorEvent; - "load": Event; -} - -interface TextTrack extends EventTarget { - readonly activeCues: TextTrackCueList; - readonly cues: TextTrackCueList; - readonly inBandMetadataTrackDispatchType: string; - readonly kind: string; - readonly label: string; - readonly language: string; - mode: any; - oncuechange: (this: TextTrack, ev: Event) => any; - onerror: (this: TextTrack, ev: ErrorEvent) => any; - onload: (this: TextTrack, ev: Event) => any; - readonly readyState: number; - addCue(cue: TextTrackCue): void; - removeCue(cue: TextTrackCue): void; - readonly DISABLED: number; - readonly ERROR: number; - readonly HIDDEN: number; - readonly LOADED: number; - readonly LOADING: number; - readonly NONE: number; - readonly SHOWING: number; - addEventListener(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var TextTrack: { - prototype: TextTrack; - new(): TextTrack; - readonly DISABLED: number; - readonly ERROR: number; - readonly HIDDEN: number; - readonly LOADED: number; - readonly LOADING: number; - readonly NONE: number; - readonly SHOWING: number; -} - -interface TextTrackCueEventMap { - "enter": Event; - "exit": Event; -} - -interface TextTrackCue extends EventTarget { - endTime: number; - id: string; - onenter: (this: TextTrackCue, ev: Event) => any; - onexit: (this: TextTrackCue, ev: Event) => any; - pauseOnExit: boolean; - startTime: number; - text: string; - readonly track: TextTrack; - getCueAsHTML(): DocumentFragment; - addEventListener(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var TextTrackCue: { - prototype: TextTrackCue; - new(startTime: number, endTime: number, text: string): TextTrackCue; -} - -interface TextTrackCueList { - readonly length: number; - getCueById(id: string): TextTrackCue; - item(index: number): TextTrackCue; - [index: number]: TextTrackCue; -} - -declare var TextTrackCueList: { - prototype: TextTrackCueList; - new(): TextTrackCueList; -} - -interface TextTrackListEventMap { - "addtrack": TrackEvent; -} - -interface TextTrackList extends EventTarget { - readonly length: number; - onaddtrack: ((this: TextTrackList, ev: TrackEvent) => any) | null; - item(index: number): TextTrack; - addEventListener(type: K, listener: (this: TextTrackList, ev: TextTrackListEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [index: number]: TextTrack; -} - -declare var TextTrackList: { - prototype: TextTrackList; - new(): TextTrackList; -} - -interface TimeRanges { - readonly length: number; - end(index: number): number; - start(index: number): number; -} - -declare var TimeRanges: { - prototype: TimeRanges; - new(): TimeRanges; -} - -interface Touch { - readonly clientX: number; - readonly clientY: number; - readonly identifier: number; - readonly pageX: number; - readonly pageY: number; - readonly screenX: number; - readonly screenY: number; - readonly target: EventTarget; -} - -declare var Touch: { - prototype: Touch; - new(): Touch; -} - -interface TouchEvent extends UIEvent { - readonly altKey: boolean; - readonly changedTouches: TouchList; - readonly ctrlKey: boolean; - readonly metaKey: boolean; - readonly shiftKey: boolean; - readonly targetTouches: TouchList; - readonly touches: TouchList; -} - -declare var TouchEvent: { - prototype: TouchEvent; - new(): TouchEvent; -} - -interface TouchList { - readonly length: number; - item(index: number): Touch | null; - [index: number]: Touch; -} - -declare var TouchList: { - prototype: TouchList; - new(): TouchList; -} - -interface TrackEvent extends Event { - readonly track: any; -} - -declare var TrackEvent: { - prototype: TrackEvent; - new(): TrackEvent; -} - -interface TransitionEvent extends Event { - readonly elapsedTime: number; - readonly propertyName: string; - initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; -} - -declare var TransitionEvent: { - prototype: TransitionEvent; - new(): TransitionEvent; -} - -interface TreeWalker { - currentNode: Node; - readonly expandEntityReferences: boolean; - readonly filter: NodeFilter; - readonly root: Node; - readonly whatToShow: number; - firstChild(): Node; - lastChild(): Node; - nextNode(): Node; - nextSibling(): Node; - parentNode(): Node; - previousNode(): Node; - previousSibling(): Node; -} - -declare var TreeWalker: { - prototype: TreeWalker; - new(): TreeWalker; -} - -interface UIEvent extends Event { - readonly detail: number; - readonly view: Window; - initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; -} - -declare var UIEvent: { - prototype: UIEvent; - new(type: string, eventInitDict?: UIEventInit): UIEvent; -} - -interface URL { - hash: string; - host: string; - hostname: string; - href: string; - readonly origin: string; - password: string; - pathname: string; - port: string; - protocol: string; - search: string; - username: string; - toString(): string; -} - -declare var URL: { - prototype: URL; - new(url: string, base?: string): URL; - createObjectURL(object: any, options?: ObjectURLOptions): string; - revokeObjectURL(url: string): void; -} - -interface UnviewableContentIdentifiedEvent extends NavigationEventWithReferrer { - readonly mediaType: string; -} - -declare var UnviewableContentIdentifiedEvent: { - prototype: UnviewableContentIdentifiedEvent; - new(): UnviewableContentIdentifiedEvent; -} - -interface ValidityState { - readonly badInput: boolean; - readonly customError: boolean; - readonly patternMismatch: boolean; - readonly rangeOverflow: boolean; - readonly rangeUnderflow: boolean; - readonly stepMismatch: boolean; - readonly tooLong: boolean; - readonly typeMismatch: boolean; - readonly valid: boolean; - readonly valueMissing: boolean; -} - -declare var ValidityState: { - prototype: ValidityState; - new(): ValidityState; -} - -interface VideoPlaybackQuality { - readonly corruptedVideoFrames: number; - readonly creationTime: number; - readonly droppedVideoFrames: number; - readonly totalFrameDelay: number; - readonly totalVideoFrames: number; -} - -declare var VideoPlaybackQuality: { - prototype: VideoPlaybackQuality; - new(): VideoPlaybackQuality; -} - -interface VideoTrack { - readonly id: string; - kind: string; - readonly label: string; - language: string; - selected: boolean; - readonly sourceBuffer: SourceBuffer; -} - -declare var VideoTrack: { - prototype: VideoTrack; - new(): VideoTrack; -} - -interface VideoTrackListEventMap { - "addtrack": TrackEvent; - "change": Event; - "removetrack": TrackEvent; -} - -interface VideoTrackList extends EventTarget { - readonly length: number; - onaddtrack: (this: VideoTrackList, ev: TrackEvent) => any; - onchange: (this: VideoTrackList, ev: Event) => any; - onremovetrack: (this: VideoTrackList, ev: TrackEvent) => any; - readonly selectedIndex: number; - getTrackById(id: string): VideoTrack | null; - item(index: number): VideoTrack; - addEventListener(type: K, listener: (this: VideoTrackList, ev: VideoTrackListEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [index: number]: VideoTrack; -} - -declare var VideoTrackList: { - prototype: VideoTrackList; - new(): VideoTrackList; -} - -interface WEBGL_compressed_texture_s3tc { - readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} - -declare var WEBGL_compressed_texture_s3tc: { - prototype: WEBGL_compressed_texture_s3tc; - new(): WEBGL_compressed_texture_s3tc; - readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} - -interface WEBGL_debug_renderer_info { - readonly UNMASKED_RENDERER_WEBGL: number; - readonly UNMASKED_VENDOR_WEBGL: number; -} - -declare var WEBGL_debug_renderer_info: { - prototype: WEBGL_debug_renderer_info; - new(): WEBGL_debug_renderer_info; - readonly UNMASKED_RENDERER_WEBGL: number; - readonly UNMASKED_VENDOR_WEBGL: number; -} - -interface WEBGL_depth_texture { - readonly UNSIGNED_INT_24_8_WEBGL: number; -} - -declare var WEBGL_depth_texture: { - prototype: WEBGL_depth_texture; - new(): WEBGL_depth_texture; - readonly UNSIGNED_INT_24_8_WEBGL: number; -} - -interface WaveShaperNode extends AudioNode { - curve: Float32Array | null; - oversample: string; -} - -declare var WaveShaperNode: { - prototype: WaveShaperNode; - new(): WaveShaperNode; -} - -interface WebGLActiveInfo { - readonly name: string; - readonly size: number; - readonly type: number; -} - -declare var WebGLActiveInfo: { - prototype: WebGLActiveInfo; - new(): WebGLActiveInfo; -} - -interface WebGLBuffer extends WebGLObject { -} - -declare var WebGLBuffer: { - prototype: WebGLBuffer; - new(): WebGLBuffer; -} - -interface WebGLContextEvent extends Event { - readonly statusMessage: string; -} - -declare var WebGLContextEvent: { - prototype: WebGLContextEvent; - new(type: string, eventInitDict?: WebGLContextEventInit): WebGLContextEvent; -} - -interface WebGLFramebuffer extends WebGLObject { -} - -declare var WebGLFramebuffer: { - prototype: WebGLFramebuffer; - new(): WebGLFramebuffer; -} - -interface WebGLObject { -} - -declare var WebGLObject: { - prototype: WebGLObject; - new(): WebGLObject; -} - -interface WebGLProgram extends WebGLObject { -} - -declare var WebGLProgram: { - prototype: WebGLProgram; - new(): WebGLProgram; -} - -interface WebGLRenderbuffer extends WebGLObject { -} - -declare var WebGLRenderbuffer: { - prototype: WebGLRenderbuffer; - new(): WebGLRenderbuffer; -} - -interface WebGLRenderingContext { - readonly canvas: HTMLCanvasElement; - readonly drawingBufferHeight: number; - readonly drawingBufferWidth: number; - activeTexture(texture: number): void; - attachShader(program: WebGLProgram | null, shader: WebGLShader | null): void; - bindAttribLocation(program: WebGLProgram | null, index: number, name: string): void; - bindBuffer(target: number, buffer: WebGLBuffer | null): void; - bindFramebuffer(target: number, framebuffer: WebGLFramebuffer | null): void; - bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer | null): void; - bindTexture(target: number, texture: WebGLTexture | null): void; - blendColor(red: number, green: number, blue: number, alpha: number): void; - blendEquation(mode: number): void; - blendEquationSeparate(modeRGB: number, modeAlpha: number): void; - blendFunc(sfactor: number, dfactor: number): void; - blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; - bufferData(target: number, size: number | ArrayBufferView | ArrayBuffer, usage: number): void; - bufferSubData(target: number, offset: number, data: ArrayBufferView | ArrayBuffer): void; - checkFramebufferStatus(target: number): number; - clear(mask: number): void; - clearColor(red: number, green: number, blue: number, alpha: number): void; - clearDepth(depth: number): void; - clearStencil(s: number): void; - colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; - compileShader(shader: WebGLShader | null): void; - compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; - compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; - copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; - copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; - createBuffer(): WebGLBuffer | null; - createFramebuffer(): WebGLFramebuffer | null; - createProgram(): WebGLProgram | null; - createRenderbuffer(): WebGLRenderbuffer | null; - createShader(type: number): WebGLShader | null; - createTexture(): WebGLTexture | null; - cullFace(mode: number): void; - deleteBuffer(buffer: WebGLBuffer | null): void; - deleteFramebuffer(framebuffer: WebGLFramebuffer | null): void; - deleteProgram(program: WebGLProgram | null): void; - deleteRenderbuffer(renderbuffer: WebGLRenderbuffer | null): void; - deleteShader(shader: WebGLShader | null): void; - deleteTexture(texture: WebGLTexture | null): void; - depthFunc(func: number): void; - depthMask(flag: boolean): void; - depthRange(zNear: number, zFar: number): void; - detachShader(program: WebGLProgram | null, shader: WebGLShader | null): void; - disable(cap: number): void; - disableVertexAttribArray(index: number): void; - drawArrays(mode: number, first: number, count: number): void; - drawElements(mode: number, count: number, type: number, offset: number): void; - enable(cap: number): void; - enableVertexAttribArray(index: number): void; - finish(): void; - flush(): void; - framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer | null): void; - framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture | null, level: number): void; - frontFace(mode: number): void; - generateMipmap(target: number): void; - getActiveAttrib(program: WebGLProgram | null, index: number): WebGLActiveInfo | null; - getActiveUniform(program: WebGLProgram | null, index: number): WebGLActiveInfo | null; - getAttachedShaders(program: WebGLProgram | null): WebGLShader[] | null; - getAttribLocation(program: WebGLProgram | null, name: string): number; - getBufferParameter(target: number, pname: number): any; - getContextAttributes(): WebGLContextAttributes; - getError(): number; - getExtension(name: string): any; - getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; - getParameter(pname: number): any; - getProgramInfoLog(program: WebGLProgram | null): string | null; - getProgramParameter(program: WebGLProgram | null, pname: number): any; - getRenderbufferParameter(target: number, pname: number): any; - getShaderInfoLog(shader: WebGLShader | null): string | null; - getShaderParameter(shader: WebGLShader | null, pname: number): any; - getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat | null; - getShaderSource(shader: WebGLShader | null): string | null; - getSupportedExtensions(): string[] | null; - getTexParameter(target: number, pname: number): any; - getUniform(program: WebGLProgram | null, location: WebGLUniformLocation | null): any; - getUniformLocation(program: WebGLProgram | null, name: string): WebGLUniformLocation | null; - getVertexAttrib(index: number, pname: number): any; - getVertexAttribOffset(index: number, pname: number): number; - hint(target: number, mode: number): void; - isBuffer(buffer: WebGLBuffer | null): boolean; - isContextLost(): boolean; - isEnabled(cap: number): boolean; - isFramebuffer(framebuffer: WebGLFramebuffer | null): boolean; - isProgram(program: WebGLProgram | null): boolean; - isRenderbuffer(renderbuffer: WebGLRenderbuffer | null): boolean; - isShader(shader: WebGLShader | null): boolean; - isTexture(texture: WebGLTexture | null): boolean; - lineWidth(width: number): void; - linkProgram(program: WebGLProgram | null): void; - pixelStorei(pname: number, param: number): void; - polygonOffset(factor: number, units: number): void; - readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void; - renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; - sampleCoverage(value: number, invert: boolean): void; - scissor(x: number, y: number, width: number, height: number): void; - shaderSource(shader: WebGLShader | null, source: string): void; - stencilFunc(func: number, ref: number, mask: number): void; - stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; - stencilMask(mask: number): void; - stencilMaskSeparate(face: number, mask: number): void; - stencilOp(fail: number, zfail: number, zpass: number): void; - stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; - texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels?: ArrayBufferView): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels?: ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void; - texParameterf(target: number, pname: number, param: number): void; - texParameteri(target: number, pname: number, param: number): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels?: ArrayBufferView): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels?: ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void; - uniform1f(location: WebGLUniformLocation | null, x: number): void; - uniform1fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; - uniform1i(location: WebGLUniformLocation | null, x: number): void; - uniform1iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniform2f(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; - uniform2i(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniform3f(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; - uniform3i(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniform4f(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; - uniform4i(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - useProgram(program: WebGLProgram | null): void; - validateProgram(program: WebGLProgram | null): void; - vertexAttrib1f(indx: number, x: number): void; - vertexAttrib1fv(indx: number, values: Float32Array | number[]): void; - vertexAttrib2f(indx: number, x: number, y: number): void; - vertexAttrib2fv(indx: number, values: Float32Array | number[]): void; - vertexAttrib3f(indx: number, x: number, y: number, z: number): void; - vertexAttrib3fv(indx: number, values: Float32Array | number[]): void; - vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; - vertexAttrib4fv(indx: number, values: Float32Array | number[]): void; - vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; - viewport(x: number, y: number, width: number, height: number): void; - readonly ACTIVE_ATTRIBUTES: number; - readonly ACTIVE_TEXTURE: number; - readonly ACTIVE_UNIFORMS: number; - readonly ALIASED_LINE_WIDTH_RANGE: number; - readonly ALIASED_POINT_SIZE_RANGE: number; - readonly ALPHA: number; - readonly ALPHA_BITS: number; - readonly ALWAYS: number; - readonly ARRAY_BUFFER: number; - readonly ARRAY_BUFFER_BINDING: number; - readonly ATTACHED_SHADERS: number; - readonly BACK: number; - readonly BLEND: number; - readonly BLEND_COLOR: number; - readonly BLEND_DST_ALPHA: number; - readonly BLEND_DST_RGB: number; - readonly BLEND_EQUATION: number; - readonly BLEND_EQUATION_ALPHA: number; - readonly BLEND_EQUATION_RGB: number; - readonly BLEND_SRC_ALPHA: number; - readonly BLEND_SRC_RGB: number; - readonly BLUE_BITS: number; - readonly BOOL: number; - readonly BOOL_VEC2: number; - readonly BOOL_VEC3: number; - readonly BOOL_VEC4: number; - readonly BROWSER_DEFAULT_WEBGL: number; - readonly BUFFER_SIZE: number; - readonly BUFFER_USAGE: number; - readonly BYTE: number; - readonly CCW: number; - readonly CLAMP_TO_EDGE: number; - readonly COLOR_ATTACHMENT0: number; - readonly COLOR_BUFFER_BIT: number; - readonly COLOR_CLEAR_VALUE: number; - readonly COLOR_WRITEMASK: number; - readonly COMPILE_STATUS: number; - readonly COMPRESSED_TEXTURE_FORMATS: number; - readonly CONSTANT_ALPHA: number; - readonly CONSTANT_COLOR: number; - readonly CONTEXT_LOST_WEBGL: number; - readonly CULL_FACE: number; - readonly CULL_FACE_MODE: number; - readonly CURRENT_PROGRAM: number; - readonly CURRENT_VERTEX_ATTRIB: number; - readonly CW: number; - readonly DECR: number; - readonly DECR_WRAP: number; - readonly DELETE_STATUS: number; - readonly DEPTH_ATTACHMENT: number; - readonly DEPTH_BITS: number; - readonly DEPTH_BUFFER_BIT: number; - readonly DEPTH_CLEAR_VALUE: number; - readonly DEPTH_COMPONENT: number; - readonly DEPTH_COMPONENT16: number; - readonly DEPTH_FUNC: number; - readonly DEPTH_RANGE: number; - readonly DEPTH_STENCIL: number; - readonly DEPTH_STENCIL_ATTACHMENT: number; - readonly DEPTH_TEST: number; - readonly DEPTH_WRITEMASK: number; - readonly DITHER: number; - readonly DONT_CARE: number; - readonly DST_ALPHA: number; - readonly DST_COLOR: number; - readonly DYNAMIC_DRAW: number; - readonly ELEMENT_ARRAY_BUFFER: number; - readonly ELEMENT_ARRAY_BUFFER_BINDING: number; - readonly EQUAL: number; - readonly FASTEST: number; - readonly FLOAT: number; - readonly FLOAT_MAT2: number; - readonly FLOAT_MAT3: number; - readonly FLOAT_MAT4: number; - readonly FLOAT_VEC2: number; - readonly FLOAT_VEC3: number; - readonly FLOAT_VEC4: number; - readonly FRAGMENT_SHADER: number; - readonly FRAMEBUFFER: number; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - readonly FRAMEBUFFER_BINDING: number; - readonly FRAMEBUFFER_COMPLETE: number; - readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - readonly FRAMEBUFFER_UNSUPPORTED: number; - readonly FRONT: number; - readonly FRONT_AND_BACK: number; - readonly FRONT_FACE: number; - readonly FUNC_ADD: number; - readonly FUNC_REVERSE_SUBTRACT: number; - readonly FUNC_SUBTRACT: number; - readonly GENERATE_MIPMAP_HINT: number; - readonly GEQUAL: number; - readonly GREATER: number; - readonly GREEN_BITS: number; - readonly HIGH_FLOAT: number; - readonly HIGH_INT: number; - readonly IMPLEMENTATION_COLOR_READ_FORMAT: number; - readonly IMPLEMENTATION_COLOR_READ_TYPE: number; - readonly INCR: number; - readonly INCR_WRAP: number; - readonly INT: number; - readonly INT_VEC2: number; - readonly INT_VEC3: number; - readonly INT_VEC4: number; - readonly INVALID_ENUM: number; - readonly INVALID_FRAMEBUFFER_OPERATION: number; - readonly INVALID_OPERATION: number; - readonly INVALID_VALUE: number; - readonly INVERT: number; - readonly KEEP: number; - readonly LEQUAL: number; - readonly LESS: number; - readonly LINEAR: number; - readonly LINEAR_MIPMAP_LINEAR: number; - readonly LINEAR_MIPMAP_NEAREST: number; - readonly LINES: number; - readonly LINE_LOOP: number; - readonly LINE_STRIP: number; - readonly LINE_WIDTH: number; - readonly LINK_STATUS: number; - readonly LOW_FLOAT: number; - readonly LOW_INT: number; - readonly LUMINANCE: number; - readonly LUMINANCE_ALPHA: number; - readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - readonly MAX_CUBE_MAP_TEXTURE_SIZE: number; - readonly MAX_FRAGMENT_UNIFORM_VECTORS: number; - readonly MAX_RENDERBUFFER_SIZE: number; - readonly MAX_TEXTURE_IMAGE_UNITS: number; - readonly MAX_TEXTURE_SIZE: number; - readonly MAX_VARYING_VECTORS: number; - readonly MAX_VERTEX_ATTRIBS: number; - readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - readonly MAX_VERTEX_UNIFORM_VECTORS: number; - readonly MAX_VIEWPORT_DIMS: number; - readonly MEDIUM_FLOAT: number; - readonly MEDIUM_INT: number; - readonly MIRRORED_REPEAT: number; - readonly NEAREST: number; - readonly NEAREST_MIPMAP_LINEAR: number; - readonly NEAREST_MIPMAP_NEAREST: number; - readonly NEVER: number; - readonly NICEST: number; - readonly NONE: number; - readonly NOTEQUAL: number; - readonly NO_ERROR: number; - readonly ONE: number; - readonly ONE_MINUS_CONSTANT_ALPHA: number; - readonly ONE_MINUS_CONSTANT_COLOR: number; - readonly ONE_MINUS_DST_ALPHA: number; - readonly ONE_MINUS_DST_COLOR: number; - readonly ONE_MINUS_SRC_ALPHA: number; - readonly ONE_MINUS_SRC_COLOR: number; - readonly OUT_OF_MEMORY: number; - readonly PACK_ALIGNMENT: number; - readonly POINTS: number; - readonly POLYGON_OFFSET_FACTOR: number; - readonly POLYGON_OFFSET_FILL: number; - readonly POLYGON_OFFSET_UNITS: number; - readonly RED_BITS: number; - readonly RENDERBUFFER: number; - readonly RENDERBUFFER_ALPHA_SIZE: number; - readonly RENDERBUFFER_BINDING: number; - readonly RENDERBUFFER_BLUE_SIZE: number; - readonly RENDERBUFFER_DEPTH_SIZE: number; - readonly RENDERBUFFER_GREEN_SIZE: number; - readonly RENDERBUFFER_HEIGHT: number; - readonly RENDERBUFFER_INTERNAL_FORMAT: number; - readonly RENDERBUFFER_RED_SIZE: number; - readonly RENDERBUFFER_STENCIL_SIZE: number; - readonly RENDERBUFFER_WIDTH: number; - readonly RENDERER: number; - readonly REPEAT: number; - readonly REPLACE: number; - readonly RGB: number; - readonly RGB565: number; - readonly RGB5_A1: number; - readonly RGBA: number; - readonly RGBA4: number; - readonly SAMPLER_2D: number; - readonly SAMPLER_CUBE: number; - readonly SAMPLES: number; - readonly SAMPLE_ALPHA_TO_COVERAGE: number; - readonly SAMPLE_BUFFERS: number; - readonly SAMPLE_COVERAGE: number; - readonly SAMPLE_COVERAGE_INVERT: number; - readonly SAMPLE_COVERAGE_VALUE: number; - readonly SCISSOR_BOX: number; - readonly SCISSOR_TEST: number; - readonly SHADER_TYPE: number; - readonly SHADING_LANGUAGE_VERSION: number; - readonly SHORT: number; - readonly SRC_ALPHA: number; - readonly SRC_ALPHA_SATURATE: number; - readonly SRC_COLOR: number; - readonly STATIC_DRAW: number; - readonly STENCIL_ATTACHMENT: number; - readonly STENCIL_BACK_FAIL: number; - readonly STENCIL_BACK_FUNC: number; - readonly STENCIL_BACK_PASS_DEPTH_FAIL: number; - readonly STENCIL_BACK_PASS_DEPTH_PASS: number; - readonly STENCIL_BACK_REF: number; - readonly STENCIL_BACK_VALUE_MASK: number; - readonly STENCIL_BACK_WRITEMASK: number; - readonly STENCIL_BITS: number; - readonly STENCIL_BUFFER_BIT: number; - readonly STENCIL_CLEAR_VALUE: number; - readonly STENCIL_FAIL: number; - readonly STENCIL_FUNC: number; - readonly STENCIL_INDEX: number; - readonly STENCIL_INDEX8: number; - readonly STENCIL_PASS_DEPTH_FAIL: number; - readonly STENCIL_PASS_DEPTH_PASS: number; - readonly STENCIL_REF: number; - readonly STENCIL_TEST: number; - readonly STENCIL_VALUE_MASK: number; - readonly STENCIL_WRITEMASK: number; - readonly STREAM_DRAW: number; - readonly SUBPIXEL_BITS: number; - readonly TEXTURE: number; - readonly TEXTURE0: number; - readonly TEXTURE1: number; - readonly TEXTURE10: number; - readonly TEXTURE11: number; - readonly TEXTURE12: number; - readonly TEXTURE13: number; - readonly TEXTURE14: number; - readonly TEXTURE15: number; - readonly TEXTURE16: number; - readonly TEXTURE17: number; - readonly TEXTURE18: number; - readonly TEXTURE19: number; - readonly TEXTURE2: number; - readonly TEXTURE20: number; - readonly TEXTURE21: number; - readonly TEXTURE22: number; - readonly TEXTURE23: number; - readonly TEXTURE24: number; - readonly TEXTURE25: number; - readonly TEXTURE26: number; - readonly TEXTURE27: number; - readonly TEXTURE28: number; - readonly TEXTURE29: number; - readonly TEXTURE3: number; - readonly TEXTURE30: number; - readonly TEXTURE31: number; - readonly TEXTURE4: number; - readonly TEXTURE5: number; - readonly TEXTURE6: number; - readonly TEXTURE7: number; - readonly TEXTURE8: number; - readonly TEXTURE9: number; - readonly TEXTURE_2D: number; - readonly TEXTURE_BINDING_2D: number; - readonly TEXTURE_BINDING_CUBE_MAP: number; - readonly TEXTURE_CUBE_MAP: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_X: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number; - readonly TEXTURE_MAG_FILTER: number; - readonly TEXTURE_MIN_FILTER: number; - readonly TEXTURE_WRAP_S: number; - readonly TEXTURE_WRAP_T: number; - readonly TRIANGLES: number; - readonly TRIANGLE_FAN: number; - readonly TRIANGLE_STRIP: number; - readonly UNPACK_ALIGNMENT: number; - readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - readonly UNPACK_FLIP_Y_WEBGL: number; - readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - readonly UNSIGNED_BYTE: number; - readonly UNSIGNED_INT: number; - readonly UNSIGNED_SHORT: number; - readonly UNSIGNED_SHORT_4_4_4_4: number; - readonly UNSIGNED_SHORT_5_5_5_1: number; - readonly UNSIGNED_SHORT_5_6_5: number; - readonly VALIDATE_STATUS: number; - readonly VENDOR: number; - readonly VERSION: number; - readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - readonly VERTEX_ATTRIB_ARRAY_ENABLED: number; - readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - readonly VERTEX_ATTRIB_ARRAY_POINTER: number; - readonly VERTEX_ATTRIB_ARRAY_SIZE: number; - readonly VERTEX_ATTRIB_ARRAY_STRIDE: number; - readonly VERTEX_ATTRIB_ARRAY_TYPE: number; - readonly VERTEX_SHADER: number; - readonly VIEWPORT: number; - readonly ZERO: number; -} - -declare var WebGLRenderingContext: { - prototype: WebGLRenderingContext; - new(): WebGLRenderingContext; - readonly ACTIVE_ATTRIBUTES: number; - readonly ACTIVE_TEXTURE: number; - readonly ACTIVE_UNIFORMS: number; - readonly ALIASED_LINE_WIDTH_RANGE: number; - readonly ALIASED_POINT_SIZE_RANGE: number; - readonly ALPHA: number; - readonly ALPHA_BITS: number; - readonly ALWAYS: number; - readonly ARRAY_BUFFER: number; - readonly ARRAY_BUFFER_BINDING: number; - readonly ATTACHED_SHADERS: number; - readonly BACK: number; - readonly BLEND: number; - readonly BLEND_COLOR: number; - readonly BLEND_DST_ALPHA: number; - readonly BLEND_DST_RGB: number; - readonly BLEND_EQUATION: number; - readonly BLEND_EQUATION_ALPHA: number; - readonly BLEND_EQUATION_RGB: number; - readonly BLEND_SRC_ALPHA: number; - readonly BLEND_SRC_RGB: number; - readonly BLUE_BITS: number; - readonly BOOL: number; - readonly BOOL_VEC2: number; - readonly BOOL_VEC3: number; - readonly BOOL_VEC4: number; - readonly BROWSER_DEFAULT_WEBGL: number; - readonly BUFFER_SIZE: number; - readonly BUFFER_USAGE: number; - readonly BYTE: number; - readonly CCW: number; - readonly CLAMP_TO_EDGE: number; - readonly COLOR_ATTACHMENT0: number; - readonly COLOR_BUFFER_BIT: number; - readonly COLOR_CLEAR_VALUE: number; - readonly COLOR_WRITEMASK: number; - readonly COMPILE_STATUS: number; - readonly COMPRESSED_TEXTURE_FORMATS: number; - readonly CONSTANT_ALPHA: number; - readonly CONSTANT_COLOR: number; - readonly CONTEXT_LOST_WEBGL: number; - readonly CULL_FACE: number; - readonly CULL_FACE_MODE: number; - readonly CURRENT_PROGRAM: number; - readonly CURRENT_VERTEX_ATTRIB: number; - readonly CW: number; - readonly DECR: number; - readonly DECR_WRAP: number; - readonly DELETE_STATUS: number; - readonly DEPTH_ATTACHMENT: number; - readonly DEPTH_BITS: number; - readonly DEPTH_BUFFER_BIT: number; - readonly DEPTH_CLEAR_VALUE: number; - readonly DEPTH_COMPONENT: number; - readonly DEPTH_COMPONENT16: number; - readonly DEPTH_FUNC: number; - readonly DEPTH_RANGE: number; - readonly DEPTH_STENCIL: number; - readonly DEPTH_STENCIL_ATTACHMENT: number; - readonly DEPTH_TEST: number; - readonly DEPTH_WRITEMASK: number; - readonly DITHER: number; - readonly DONT_CARE: number; - readonly DST_ALPHA: number; - readonly DST_COLOR: number; - readonly DYNAMIC_DRAW: number; - readonly ELEMENT_ARRAY_BUFFER: number; - readonly ELEMENT_ARRAY_BUFFER_BINDING: number; - readonly EQUAL: number; - readonly FASTEST: number; - readonly FLOAT: number; - readonly FLOAT_MAT2: number; - readonly FLOAT_MAT3: number; - readonly FLOAT_MAT4: number; - readonly FLOAT_VEC2: number; - readonly FLOAT_VEC3: number; - readonly FLOAT_VEC4: number; - readonly FRAGMENT_SHADER: number; - readonly FRAMEBUFFER: number; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - readonly FRAMEBUFFER_BINDING: number; - readonly FRAMEBUFFER_COMPLETE: number; - readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - readonly FRAMEBUFFER_UNSUPPORTED: number; - readonly FRONT: number; - readonly FRONT_AND_BACK: number; - readonly FRONT_FACE: number; - readonly FUNC_ADD: number; - readonly FUNC_REVERSE_SUBTRACT: number; - readonly FUNC_SUBTRACT: number; - readonly GENERATE_MIPMAP_HINT: number; - readonly GEQUAL: number; - readonly GREATER: number; - readonly GREEN_BITS: number; - readonly HIGH_FLOAT: number; - readonly HIGH_INT: number; - readonly IMPLEMENTATION_COLOR_READ_FORMAT: number; - readonly IMPLEMENTATION_COLOR_READ_TYPE: number; - readonly INCR: number; - readonly INCR_WRAP: number; - readonly INT: number; - readonly INT_VEC2: number; - readonly INT_VEC3: number; - readonly INT_VEC4: number; - readonly INVALID_ENUM: number; - readonly INVALID_FRAMEBUFFER_OPERATION: number; - readonly INVALID_OPERATION: number; - readonly INVALID_VALUE: number; - readonly INVERT: number; - readonly KEEP: number; - readonly LEQUAL: number; - readonly LESS: number; - readonly LINEAR: number; - readonly LINEAR_MIPMAP_LINEAR: number; - readonly LINEAR_MIPMAP_NEAREST: number; - readonly LINES: number; - readonly LINE_LOOP: number; - readonly LINE_STRIP: number; - readonly LINE_WIDTH: number; - readonly LINK_STATUS: number; - readonly LOW_FLOAT: number; - readonly LOW_INT: number; - readonly LUMINANCE: number; - readonly LUMINANCE_ALPHA: number; - readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - readonly MAX_CUBE_MAP_TEXTURE_SIZE: number; - readonly MAX_FRAGMENT_UNIFORM_VECTORS: number; - readonly MAX_RENDERBUFFER_SIZE: number; - readonly MAX_TEXTURE_IMAGE_UNITS: number; - readonly MAX_TEXTURE_SIZE: number; - readonly MAX_VARYING_VECTORS: number; - readonly MAX_VERTEX_ATTRIBS: number; - readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - readonly MAX_VERTEX_UNIFORM_VECTORS: number; - readonly MAX_VIEWPORT_DIMS: number; - readonly MEDIUM_FLOAT: number; - readonly MEDIUM_INT: number; - readonly MIRRORED_REPEAT: number; - readonly NEAREST: number; - readonly NEAREST_MIPMAP_LINEAR: number; - readonly NEAREST_MIPMAP_NEAREST: number; - readonly NEVER: number; - readonly NICEST: number; - readonly NONE: number; - readonly NOTEQUAL: number; - readonly NO_ERROR: number; - readonly ONE: number; - readonly ONE_MINUS_CONSTANT_ALPHA: number; - readonly ONE_MINUS_CONSTANT_COLOR: number; - readonly ONE_MINUS_DST_ALPHA: number; - readonly ONE_MINUS_DST_COLOR: number; - readonly ONE_MINUS_SRC_ALPHA: number; - readonly ONE_MINUS_SRC_COLOR: number; - readonly OUT_OF_MEMORY: number; - readonly PACK_ALIGNMENT: number; - readonly POINTS: number; - readonly POLYGON_OFFSET_FACTOR: number; - readonly POLYGON_OFFSET_FILL: number; - readonly POLYGON_OFFSET_UNITS: number; - readonly RED_BITS: number; - readonly RENDERBUFFER: number; - readonly RENDERBUFFER_ALPHA_SIZE: number; - readonly RENDERBUFFER_BINDING: number; - readonly RENDERBUFFER_BLUE_SIZE: number; - readonly RENDERBUFFER_DEPTH_SIZE: number; - readonly RENDERBUFFER_GREEN_SIZE: number; - readonly RENDERBUFFER_HEIGHT: number; - readonly RENDERBUFFER_INTERNAL_FORMAT: number; - readonly RENDERBUFFER_RED_SIZE: number; - readonly RENDERBUFFER_STENCIL_SIZE: number; - readonly RENDERBUFFER_WIDTH: number; - readonly RENDERER: number; - readonly REPEAT: number; - readonly REPLACE: number; - readonly RGB: number; - readonly RGB565: number; - readonly RGB5_A1: number; - readonly RGBA: number; - readonly RGBA4: number; - readonly SAMPLER_2D: number; - readonly SAMPLER_CUBE: number; - readonly SAMPLES: number; - readonly SAMPLE_ALPHA_TO_COVERAGE: number; - readonly SAMPLE_BUFFERS: number; - readonly SAMPLE_COVERAGE: number; - readonly SAMPLE_COVERAGE_INVERT: number; - readonly SAMPLE_COVERAGE_VALUE: number; - readonly SCISSOR_BOX: number; - readonly SCISSOR_TEST: number; - readonly SHADER_TYPE: number; - readonly SHADING_LANGUAGE_VERSION: number; - readonly SHORT: number; - readonly SRC_ALPHA: number; - readonly SRC_ALPHA_SATURATE: number; - readonly SRC_COLOR: number; - readonly STATIC_DRAW: number; - readonly STENCIL_ATTACHMENT: number; - readonly STENCIL_BACK_FAIL: number; - readonly STENCIL_BACK_FUNC: number; - readonly STENCIL_BACK_PASS_DEPTH_FAIL: number; - readonly STENCIL_BACK_PASS_DEPTH_PASS: number; - readonly STENCIL_BACK_REF: number; - readonly STENCIL_BACK_VALUE_MASK: number; - readonly STENCIL_BACK_WRITEMASK: number; - readonly STENCIL_BITS: number; - readonly STENCIL_BUFFER_BIT: number; - readonly STENCIL_CLEAR_VALUE: number; - readonly STENCIL_FAIL: number; - readonly STENCIL_FUNC: number; - readonly STENCIL_INDEX: number; - readonly STENCIL_INDEX8: number; - readonly STENCIL_PASS_DEPTH_FAIL: number; - readonly STENCIL_PASS_DEPTH_PASS: number; - readonly STENCIL_REF: number; - readonly STENCIL_TEST: number; - readonly STENCIL_VALUE_MASK: number; - readonly STENCIL_WRITEMASK: number; - readonly STREAM_DRAW: number; - readonly SUBPIXEL_BITS: number; - readonly TEXTURE: number; - readonly TEXTURE0: number; - readonly TEXTURE1: number; - readonly TEXTURE10: number; - readonly TEXTURE11: number; - readonly TEXTURE12: number; - readonly TEXTURE13: number; - readonly TEXTURE14: number; - readonly TEXTURE15: number; - readonly TEXTURE16: number; - readonly TEXTURE17: number; - readonly TEXTURE18: number; - readonly TEXTURE19: number; - readonly TEXTURE2: number; - readonly TEXTURE20: number; - readonly TEXTURE21: number; - readonly TEXTURE22: number; - readonly TEXTURE23: number; - readonly TEXTURE24: number; - readonly TEXTURE25: number; - readonly TEXTURE26: number; - readonly TEXTURE27: number; - readonly TEXTURE28: number; - readonly TEXTURE29: number; - readonly TEXTURE3: number; - readonly TEXTURE30: number; - readonly TEXTURE31: number; - readonly TEXTURE4: number; - readonly TEXTURE5: number; - readonly TEXTURE6: number; - readonly TEXTURE7: number; - readonly TEXTURE8: number; - readonly TEXTURE9: number; - readonly TEXTURE_2D: number; - readonly TEXTURE_BINDING_2D: number; - readonly TEXTURE_BINDING_CUBE_MAP: number; - readonly TEXTURE_CUBE_MAP: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_X: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number; - readonly TEXTURE_MAG_FILTER: number; - readonly TEXTURE_MIN_FILTER: number; - readonly TEXTURE_WRAP_S: number; - readonly TEXTURE_WRAP_T: number; - readonly TRIANGLES: number; - readonly TRIANGLE_FAN: number; - readonly TRIANGLE_STRIP: number; - readonly UNPACK_ALIGNMENT: number; - readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - readonly UNPACK_FLIP_Y_WEBGL: number; - readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - readonly UNSIGNED_BYTE: number; - readonly UNSIGNED_INT: number; - readonly UNSIGNED_SHORT: number; - readonly UNSIGNED_SHORT_4_4_4_4: number; - readonly UNSIGNED_SHORT_5_5_5_1: number; - readonly UNSIGNED_SHORT_5_6_5: number; - readonly VALIDATE_STATUS: number; - readonly VENDOR: number; - readonly VERSION: number; - readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - readonly VERTEX_ATTRIB_ARRAY_ENABLED: number; - readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - readonly VERTEX_ATTRIB_ARRAY_POINTER: number; - readonly VERTEX_ATTRIB_ARRAY_SIZE: number; - readonly VERTEX_ATTRIB_ARRAY_STRIDE: number; - readonly VERTEX_ATTRIB_ARRAY_TYPE: number; - readonly VERTEX_SHADER: number; - readonly VIEWPORT: number; - readonly ZERO: number; -} - -interface WebGLShader extends WebGLObject { -} - -declare var WebGLShader: { - prototype: WebGLShader; - new(): WebGLShader; -} - -interface WebGLShaderPrecisionFormat { - readonly precision: number; - readonly rangeMax: number; - readonly rangeMin: number; -} - -declare var WebGLShaderPrecisionFormat: { - prototype: WebGLShaderPrecisionFormat; - new(): WebGLShaderPrecisionFormat; -} - -interface WebGLTexture extends WebGLObject { -} - -declare var WebGLTexture: { - prototype: WebGLTexture; - new(): WebGLTexture; -} - -interface WebGLUniformLocation { -} - -declare var WebGLUniformLocation: { - prototype: WebGLUniformLocation; - new(): WebGLUniformLocation; -} - -interface WebKitCSSMatrix { - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; - m11: number; - m12: number; - m13: number; - m14: number; - m21: number; - m22: number; - m23: number; - m24: number; - m31: number; - m32: number; - m33: number; - m34: number; - m41: number; - m42: number; - m43: number; - m44: number; - inverse(): WebKitCSSMatrix; - multiply(secondMatrix: WebKitCSSMatrix): WebKitCSSMatrix; - rotate(angleX: number, angleY?: number, angleZ?: number): WebKitCSSMatrix; - rotateAxisAngle(x: number, y: number, z: number, angle: number): WebKitCSSMatrix; - scale(scaleX: number, scaleY?: number, scaleZ?: number): WebKitCSSMatrix; - setMatrixValue(value: string): void; - skewX(angle: number): WebKitCSSMatrix; - skewY(angle: number): WebKitCSSMatrix; - toString(): string; - translate(x: number, y: number, z?: number): WebKitCSSMatrix; -} - -declare var WebKitCSSMatrix: { - prototype: WebKitCSSMatrix; - new(text?: string): WebKitCSSMatrix; -} - -interface WebKitPoint { - x: number; - y: number; -} - -declare var WebKitPoint: { - prototype: WebKitPoint; - new(x?: number, y?: number): WebKitPoint; -} - -interface WebSocketEventMap { - "close": CloseEvent; - "error": ErrorEvent; - "message": MessageEvent; - "open": Event; -} - -interface WebSocket extends EventTarget { - binaryType: string; - readonly bufferedAmount: number; - readonly extensions: string; - onclose: (this: WebSocket, ev: CloseEvent) => any; - onerror: (this: WebSocket, ev: ErrorEvent) => any; - onmessage: (this: WebSocket, ev: MessageEvent) => any; - onopen: (this: WebSocket, ev: Event) => any; - readonly protocol: string; - readonly readyState: number; - readonly url: string; - close(code?: number, reason?: string): void; - send(data: any): void; - readonly CLOSED: number; - readonly CLOSING: number; - readonly CONNECTING: number; - readonly OPEN: number; - addEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var WebSocket: { - prototype: WebSocket; - new(url: string, protocols?: string | string[]): WebSocket; - readonly CLOSED: number; - readonly CLOSING: number; - readonly CONNECTING: number; - readonly OPEN: number; -} - -interface WheelEvent extends MouseEvent { - readonly deltaMode: number; - readonly deltaX: number; - readonly deltaY: number; - readonly deltaZ: number; - readonly wheelDelta: number; - readonly wheelDeltaX: number; - readonly wheelDeltaY: number; - getCurrentPoint(element: Element): void; - initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; - readonly DOM_DELTA_LINE: number; - readonly DOM_DELTA_PAGE: number; - readonly DOM_DELTA_PIXEL: number; -} - -declare var WheelEvent: { - prototype: WheelEvent; - new(typeArg: string, eventInitDict?: WheelEventInit): WheelEvent; - readonly DOM_DELTA_LINE: number; - readonly DOM_DELTA_PAGE: number; - readonly DOM_DELTA_PIXEL: number; -} - -interface WindowEventMap extends GlobalEventHandlersEventMap { - "abort": UIEvent; - "afterprint": Event; - "beforeprint": Event; - "beforeunload": BeforeUnloadEvent; - "blur": FocusEvent; - "canplay": Event; - "canplaythrough": Event; - "change": Event; - "click": MouseEvent; - "compassneedscalibration": Event; - "contextmenu": PointerEvent; - "dblclick": MouseEvent; - "devicelight": DeviceLightEvent; - "devicemotion": DeviceMotionEvent; - "deviceorientation": DeviceOrientationEvent; - "drag": DragEvent; - "dragend": DragEvent; - "dragenter": DragEvent; - "dragleave": DragEvent; - "dragover": DragEvent; - "dragstart": DragEvent; - "drop": DragEvent; - "durationchange": Event; - "emptied": Event; - "ended": MediaStreamErrorEvent; - "focus": FocusEvent; - "hashchange": HashChangeEvent; - "input": Event; - "invalid": Event; - "keydown": KeyboardEvent; - "keypress": KeyboardEvent; - "keyup": KeyboardEvent; - "load": Event; - "loadeddata": Event; - "loadedmetadata": Event; - "loadstart": Event; - "message": MessageEvent; - "mousedown": MouseEvent; - "mouseenter": MouseEvent; - "mouseleave": MouseEvent; - "mousemove": MouseEvent; - "mouseout": MouseEvent; - "mouseover": MouseEvent; - "mouseup": MouseEvent; - "mousewheel": WheelEvent; - "MSGestureChange": MSGestureEvent; - "MSGestureDoubleTap": MSGestureEvent; - "MSGestureEnd": MSGestureEvent; - "MSGestureHold": MSGestureEvent; - "MSGestureStart": MSGestureEvent; - "MSGestureTap": MSGestureEvent; - "MSInertiaStart": MSGestureEvent; - "MSPointerCancel": MSPointerEvent; - "MSPointerDown": MSPointerEvent; - "MSPointerEnter": MSPointerEvent; - "MSPointerLeave": MSPointerEvent; - "MSPointerMove": MSPointerEvent; - "MSPointerOut": MSPointerEvent; - "MSPointerOver": MSPointerEvent; - "MSPointerUp": MSPointerEvent; - "offline": Event; - "online": Event; - "orientationchange": Event; - "pagehide": PageTransitionEvent; - "pageshow": PageTransitionEvent; - "pause": Event; - "play": Event; - "playing": Event; - "popstate": PopStateEvent; - "progress": ProgressEvent; - "ratechange": Event; - "readystatechange": ProgressEvent; - "reset": Event; - "resize": UIEvent; - "scroll": UIEvent; - "seeked": Event; - "seeking": Event; - "select": UIEvent; - "stalled": Event; - "storage": StorageEvent; - "submit": Event; - "suspend": Event; - "timeupdate": Event; - "unload": Event; - "volumechange": Event; - "waiting": Event; -} - -interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64 { - readonly applicationCache: ApplicationCache; - readonly clientInformation: Navigator; - readonly closed: boolean; - readonly crypto: Crypto; - defaultStatus: string; - readonly devicePixelRatio: number; - readonly doNotTrack: string; - readonly document: Document; - event: Event | undefined; - readonly external: External; - readonly frameElement: Element; - readonly frames: Window; - readonly history: History; - readonly innerHeight: number; - readonly innerWidth: number; - readonly length: number; - readonly location: Location; - readonly locationbar: BarProp; - readonly menubar: BarProp; - readonly msCredentials: MSCredentials; - name: string; - readonly navigator: Navigator; - offscreenBuffering: string | boolean; - onabort: (this: Window, ev: UIEvent) => any; - onafterprint: (this: Window, ev: Event) => any; - onbeforeprint: (this: Window, ev: Event) => any; - onbeforeunload: (this: Window, ev: BeforeUnloadEvent) => any; - onblur: (this: Window, ev: FocusEvent) => any; - oncanplay: (this: Window, ev: Event) => any; - oncanplaythrough: (this: Window, ev: Event) => any; - onchange: (this: Window, ev: Event) => any; - onclick: (this: Window, ev: MouseEvent) => any; - oncompassneedscalibration: (this: Window, ev: Event) => any; - oncontextmenu: (this: Window, ev: PointerEvent) => any; - ondblclick: (this: Window, ev: MouseEvent) => any; - ondevicelight: (this: Window, ev: DeviceLightEvent) => any; - ondevicemotion: (this: Window, ev: DeviceMotionEvent) => any; - ondeviceorientation: (this: Window, ev: DeviceOrientationEvent) => any; - ondrag: (this: Window, ev: DragEvent) => any; - ondragend: (this: Window, ev: DragEvent) => any; - ondragenter: (this: Window, ev: DragEvent) => any; - ondragleave: (this: Window, ev: DragEvent) => any; - ondragover: (this: Window, ev: DragEvent) => any; - ondragstart: (this: Window, ev: DragEvent) => any; - ondrop: (this: Window, ev: DragEvent) => any; - ondurationchange: (this: Window, ev: Event) => any; - onemptied: (this: Window, ev: Event) => any; - onended: (this: Window, ev: MediaStreamErrorEvent) => any; - onerror: ErrorEventHandler; - onfocus: (this: Window, ev: FocusEvent) => any; - onhashchange: (this: Window, ev: HashChangeEvent) => any; - oninput: (this: Window, ev: Event) => any; - oninvalid: (this: Window, ev: Event) => any; - onkeydown: (this: Window, ev: KeyboardEvent) => any; - onkeypress: (this: Window, ev: KeyboardEvent) => any; - onkeyup: (this: Window, ev: KeyboardEvent) => any; - onload: (this: Window, ev: Event) => any; - onloadeddata: (this: Window, ev: Event) => any; - onloadedmetadata: (this: Window, ev: Event) => any; - onloadstart: (this: Window, ev: Event) => any; - onmessage: (this: Window, ev: MessageEvent) => any; - onmousedown: (this: Window, ev: MouseEvent) => any; - onmouseenter: (this: Window, ev: MouseEvent) => any; - onmouseleave: (this: Window, ev: MouseEvent) => any; - onmousemove: (this: Window, ev: MouseEvent) => any; - onmouseout: (this: Window, ev: MouseEvent) => any; - onmouseover: (this: Window, ev: MouseEvent) => any; - onmouseup: (this: Window, ev: MouseEvent) => any; - onmousewheel: (this: Window, ev: WheelEvent) => any; - onmsgesturechange: (this: Window, ev: MSGestureEvent) => any; - onmsgesturedoubletap: (this: Window, ev: MSGestureEvent) => any; - onmsgestureend: (this: Window, ev: MSGestureEvent) => any; - onmsgesturehold: (this: Window, ev: MSGestureEvent) => any; - onmsgesturestart: (this: Window, ev: MSGestureEvent) => any; - onmsgesturetap: (this: Window, ev: MSGestureEvent) => any; - onmsinertiastart: (this: Window, ev: MSGestureEvent) => any; - onmspointercancel: (this: Window, ev: MSPointerEvent) => any; - onmspointerdown: (this: Window, ev: MSPointerEvent) => any; - onmspointerenter: (this: Window, ev: MSPointerEvent) => any; - onmspointerleave: (this: Window, ev: MSPointerEvent) => any; - onmspointermove: (this: Window, ev: MSPointerEvent) => any; - onmspointerout: (this: Window, ev: MSPointerEvent) => any; - onmspointerover: (this: Window, ev: MSPointerEvent) => any; - onmspointerup: (this: Window, ev: MSPointerEvent) => any; - onoffline: (this: Window, ev: Event) => any; - ononline: (this: Window, ev: Event) => any; - onorientationchange: (this: Window, ev: Event) => any; - onpagehide: (this: Window, ev: PageTransitionEvent) => any; - onpageshow: (this: Window, ev: PageTransitionEvent) => any; - onpause: (this: Window, ev: Event) => any; - onplay: (this: Window, ev: Event) => any; - onplaying: (this: Window, ev: Event) => any; - onpopstate: (this: Window, ev: PopStateEvent) => any; - onprogress: (this: Window, ev: ProgressEvent) => any; - onratechange: (this: Window, ev: Event) => any; - onreadystatechange: (this: Window, ev: ProgressEvent) => any; - onreset: (this: Window, ev: Event) => any; - onresize: (this: Window, ev: UIEvent) => any; - onscroll: (this: Window, ev: UIEvent) => any; - onseeked: (this: Window, ev: Event) => any; - onseeking: (this: Window, ev: Event) => any; - onselect: (this: Window, ev: UIEvent) => any; - onstalled: (this: Window, ev: Event) => any; - onstorage: (this: Window, ev: StorageEvent) => any; - onsubmit: (this: Window, ev: Event) => any; - onsuspend: (this: Window, ev: Event) => any; - ontimeupdate: (this: Window, ev: Event) => any; - ontouchcancel: (ev: TouchEvent) => any; - ontouchend: (ev: TouchEvent) => any; - ontouchmove: (ev: TouchEvent) => any; - ontouchstart: (ev: TouchEvent) => any; - onunload: (this: Window, ev: Event) => any; - onvolumechange: (this: Window, ev: Event) => any; - onwaiting: (this: Window, ev: Event) => any; - opener: any; - orientation: string | number; - readonly outerHeight: number; - readonly outerWidth: number; - readonly pageXOffset: number; - readonly pageYOffset: number; - readonly parent: Window; - readonly performance: Performance; - readonly personalbar: BarProp; - readonly screen: Screen; - readonly screenLeft: number; - readonly screenTop: number; - readonly screenX: number; - readonly screenY: number; - readonly scrollX: number; - readonly scrollY: number; - readonly scrollbars: BarProp; - readonly self: Window; - status: string; - readonly statusbar: BarProp; - readonly styleMedia: StyleMedia; - readonly toolbar: BarProp; - readonly top: Window; - readonly window: Window; - URL: typeof URL; - Blob: typeof Blob; - alert(message?: any): void; - blur(): void; - cancelAnimationFrame(handle: number): void; - captureEvents(): void; - close(): void; - confirm(message?: string): boolean; - focus(): void; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; - getSelection(): Selection; - matchMedia(mediaQuery: string): MediaQueryList; - moveBy(x?: number, y?: number): void; - moveTo(x?: number, y?: number): void; - msWriteProfilerMark(profilerMarkName: string): void; - open(url?: string, target?: string, features?: string, replace?: boolean): Window; - postMessage(message: any, targetOrigin: string, transfer?: any[]): void; - print(): void; - prompt(message?: string, _default?: string): string | null; - releaseEvents(): void; - requestAnimationFrame(callback: FrameRequestCallback): number; - resizeBy(x?: number, y?: number): void; - resizeTo(x?: number, y?: number): void; - scroll(x?: number, y?: number): void; - scrollBy(x?: number, y?: number): void; - scrollTo(x?: number, y?: number): void; - webkitCancelAnimationFrame(handle: number): void; - webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; - webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; - webkitRequestAnimationFrame(callback: FrameRequestCallback): number; - scroll(options?: ScrollToOptions): void; - scrollTo(options?: ScrollToOptions): void; - scrollBy(options?: ScrollToOptions): void; - addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Window: { - prototype: Window; - new(): Window; -} - -interface WorkerEventMap extends AbstractWorkerEventMap { - "message": MessageEvent; -} - -interface Worker extends EventTarget, AbstractWorker { - onmessage: (this: Worker, ev: MessageEvent) => any; - postMessage(message: any, ports?: any): void; - terminate(): void; - addEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Worker: { - prototype: Worker; - new(stringUrl: string): Worker; -} - -interface XMLDocument extends Document { - addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var XMLDocument: { - prototype: XMLDocument; - new(): XMLDocument; -} - -interface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap { - "readystatechange": Event; -} - -interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { - onreadystatechange: (this: XMLHttpRequest, ev: Event) => any; - readonly readyState: number; - readonly response: any; - readonly responseText: string; - responseType: string; - readonly responseXML: any; - readonly status: number; - readonly statusText: string; - timeout: number; - readonly upload: XMLHttpRequestUpload; - withCredentials: boolean; - msCaching?: string; - readonly responseURL: string; - abort(): void; - getAllResponseHeaders(): string; - getResponseHeader(header: string): string | null; - msCachingEnabled(): boolean; - open(method: string, url: string, async?: boolean, user?: string, password?: string): void; - overrideMimeType(mime: string): void; - send(data?: Document): void; - send(data?: string): void; - send(data?: any): void; - setRequestHeader(header: string, value: string): void; - readonly DONE: number; - readonly HEADERS_RECEIVED: number; - readonly LOADING: number; - readonly OPENED: number; - readonly UNSENT: number; - addEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var XMLHttpRequest: { - prototype: XMLHttpRequest; - new(): XMLHttpRequest; - readonly DONE: number; - readonly HEADERS_RECEIVED: number; - readonly LOADING: number; - readonly OPENED: number; - readonly UNSENT: number; - create(): XMLHttpRequest; -} - -interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget { - addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var XMLHttpRequestUpload: { - prototype: XMLHttpRequestUpload; - new(): XMLHttpRequestUpload; -} - -interface XMLSerializer { - serializeToString(target: Node): string; -} - -declare var XMLSerializer: { - prototype: XMLSerializer; - new(): XMLSerializer; -} - -interface XPathEvaluator { - createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; - createNSResolver(nodeResolver?: Node): XPathNSResolver; - evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult; -} - -declare var XPathEvaluator: { - prototype: XPathEvaluator; - new(): XPathEvaluator; -} - -interface XPathExpression { - evaluate(contextNode: Node, type: number, result: XPathResult | null): XPathResult; -} - -declare var XPathExpression: { - prototype: XPathExpression; - new(): XPathExpression; -} - -interface XPathNSResolver { - lookupNamespaceURI(prefix: string): string; -} - -declare var XPathNSResolver: { - prototype: XPathNSResolver; - new(): XPathNSResolver; -} - -interface XPathResult { - readonly booleanValue: boolean; - readonly invalidIteratorState: boolean; - readonly numberValue: number; - readonly resultType: number; - readonly singleNodeValue: Node; - readonly snapshotLength: number; - readonly stringValue: string; - iterateNext(): Node; - snapshotItem(index: number): Node; - readonly ANY_TYPE: number; - readonly ANY_UNORDERED_NODE_TYPE: number; - readonly BOOLEAN_TYPE: number; - readonly FIRST_ORDERED_NODE_TYPE: number; - readonly NUMBER_TYPE: number; - readonly ORDERED_NODE_ITERATOR_TYPE: number; - readonly ORDERED_NODE_SNAPSHOT_TYPE: number; - readonly STRING_TYPE: number; - readonly UNORDERED_NODE_ITERATOR_TYPE: number; - readonly UNORDERED_NODE_SNAPSHOT_TYPE: number; -} - -declare var XPathResult: { - prototype: XPathResult; - new(): XPathResult; - readonly ANY_TYPE: number; - readonly ANY_UNORDERED_NODE_TYPE: number; - readonly BOOLEAN_TYPE: number; - readonly FIRST_ORDERED_NODE_TYPE: number; - readonly NUMBER_TYPE: number; - readonly ORDERED_NODE_ITERATOR_TYPE: number; - readonly ORDERED_NODE_SNAPSHOT_TYPE: number; - readonly STRING_TYPE: number; - readonly UNORDERED_NODE_ITERATOR_TYPE: number; - readonly UNORDERED_NODE_SNAPSHOT_TYPE: number; -} - -interface XSLTProcessor { - clearParameters(): void; - getParameter(namespaceURI: string, localName: string): any; - importStylesheet(style: Node): void; - removeParameter(namespaceURI: string, localName: string): void; - reset(): void; - setParameter(namespaceURI: string, localName: string, value: any): void; - transformToDocument(source: Node): Document; - transformToFragment(source: Node, document: Document): DocumentFragment; -} - -declare var XSLTProcessor: { - prototype: XSLTProcessor; - new(): XSLTProcessor; -} - -interface AbstractWorkerEventMap { - "error": ErrorEvent; -} - -interface AbstractWorker { - onerror: (this: AbstractWorker, ev: ErrorEvent) => any; - addEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface CanvasPathMethods { - arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; - arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; - bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; - closePath(): void; - ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; - lineTo(x: number, y: number): void; - moveTo(x: number, y: number): void; - quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; - rect(x: number, y: number, w: number, h: number): void; -} - -interface ChildNode { - remove(): void; -} - -interface DOML2DeprecatedColorProperty { - color: string; -} - -interface DOML2DeprecatedSizeProperty { - size: number; -} - -interface DocumentEvent { - createEvent(eventInterface:"AnimationEvent"): AnimationEvent; - createEvent(eventInterface:"AriaRequestEvent"): AriaRequestEvent; - createEvent(eventInterface:"AudioProcessingEvent"): AudioProcessingEvent; - createEvent(eventInterface:"BeforeUnloadEvent"): BeforeUnloadEvent; - createEvent(eventInterface:"ClipboardEvent"): ClipboardEvent; - createEvent(eventInterface:"CloseEvent"): CloseEvent; - createEvent(eventInterface:"CommandEvent"): CommandEvent; - createEvent(eventInterface:"CompositionEvent"): CompositionEvent; - createEvent(eventInterface:"CustomEvent"): CustomEvent; - createEvent(eventInterface:"DeviceLightEvent"): DeviceLightEvent; - createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent; - createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent; - createEvent(eventInterface:"DragEvent"): DragEvent; - createEvent(eventInterface:"ErrorEvent"): ErrorEvent; - createEvent(eventInterface:"Event"): Event; - createEvent(eventInterface:"Events"): Event; - createEvent(eventInterface:"FocusEvent"): FocusEvent; - createEvent(eventInterface:"GamepadEvent"): GamepadEvent; - createEvent(eventInterface:"HashChangeEvent"): HashChangeEvent; - createEvent(eventInterface:"IDBVersionChangeEvent"): IDBVersionChangeEvent; - createEvent(eventInterface:"KeyboardEvent"): KeyboardEvent; - createEvent(eventInterface:"ListeningStateChangedEvent"): ListeningStateChangedEvent; - createEvent(eventInterface:"LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent; - createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; - createEvent(eventInterface:"MSManipulationEvent"): MSManipulationEvent; - createEvent(eventInterface:"MSMediaKeyMessageEvent"): MSMediaKeyMessageEvent; - createEvent(eventInterface:"MSMediaKeyNeededEvent"): MSMediaKeyNeededEvent; - createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; - createEvent(eventInterface:"MSSiteModeEvent"): MSSiteModeEvent; - createEvent(eventInterface:"MediaEncryptedEvent"): MediaEncryptedEvent; - createEvent(eventInterface:"MediaKeyMessageEvent"): MediaKeyMessageEvent; - createEvent(eventInterface:"MediaStreamErrorEvent"): MediaStreamErrorEvent; - createEvent(eventInterface:"MediaStreamTrackEvent"): MediaStreamTrackEvent; - createEvent(eventInterface:"MessageEvent"): MessageEvent; - createEvent(eventInterface:"MouseEvent"): MouseEvent; - createEvent(eventInterface:"MouseEvents"): MouseEvent; - createEvent(eventInterface:"MutationEvent"): MutationEvent; - createEvent(eventInterface:"MutationEvents"): MutationEvent; - createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent; - createEvent(eventInterface:"NavigationEvent"): NavigationEvent; - createEvent(eventInterface:"NavigationEventWithReferrer"): NavigationEventWithReferrer; - createEvent(eventInterface:"OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; - createEvent(eventInterface:"OverflowEvent"): OverflowEvent; - createEvent(eventInterface:"PageTransitionEvent"): PageTransitionEvent; - createEvent(eventInterface:"PermissionRequestedEvent"): PermissionRequestedEvent; - createEvent(eventInterface:"PointerEvent"): PointerEvent; - createEvent(eventInterface:"PopStateEvent"): PopStateEvent; - createEvent(eventInterface:"ProgressEvent"): ProgressEvent; - createEvent(eventInterface:"RTCDTMFToneChangeEvent"): RTCDTMFToneChangeEvent; - createEvent(eventInterface:"RTCDtlsTransportStateChangedEvent"): RTCDtlsTransportStateChangedEvent; - createEvent(eventInterface:"RTCIceCandidatePairChangedEvent"): RTCIceCandidatePairChangedEvent; - createEvent(eventInterface:"RTCIceGathererEvent"): RTCIceGathererEvent; - createEvent(eventInterface:"RTCIceTransportStateChangedEvent"): RTCIceTransportStateChangedEvent; - createEvent(eventInterface:"RTCSsrcConflictEvent"): RTCSsrcConflictEvent; - createEvent(eventInterface:"SVGZoomEvent"): SVGZoomEvent; - createEvent(eventInterface:"SVGZoomEvents"): SVGZoomEvent; - createEvent(eventInterface:"ScriptNotifyEvent"): ScriptNotifyEvent; - createEvent(eventInterface:"StorageEvent"): StorageEvent; - createEvent(eventInterface:"TextEvent"): TextEvent; - createEvent(eventInterface:"TouchEvent"): TouchEvent; - createEvent(eventInterface:"TrackEvent"): TrackEvent; - createEvent(eventInterface:"TransitionEvent"): TransitionEvent; - createEvent(eventInterface:"UIEvent"): UIEvent; - createEvent(eventInterface:"UIEvents"): UIEvent; - createEvent(eventInterface:"UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; - createEvent(eventInterface:"WebGLContextEvent"): WebGLContextEvent; - createEvent(eventInterface:"WheelEvent"): WheelEvent; - createEvent(eventInterface: string): Event; -} - -interface ElementTraversal { - readonly childElementCount: number; - readonly firstElementChild: Element; - readonly lastElementChild: Element; - readonly nextElementSibling: Element; - readonly previousElementSibling: Element; -} - -interface GetSVGDocument { - getSVGDocument(): Document; -} - -interface GlobalEventHandlersEventMap { - "pointercancel": PointerEvent; - "pointerdown": PointerEvent; - "pointerenter": PointerEvent; - "pointerleave": PointerEvent; - "pointermove": PointerEvent; - "pointerout": PointerEvent; - "pointerover": PointerEvent; - "pointerup": PointerEvent; - "wheel": WheelEvent; -} - -interface GlobalEventHandlers { - onpointercancel: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onpointerdown: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onpointerenter: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onpointerleave: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onpointermove: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onpointerout: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onpointerover: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onpointerup: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onwheel: (this: GlobalEventHandlers, ev: WheelEvent) => any; - addEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface HTMLTableAlignment { - /** - * Sets or retrieves a value that you can use to implement your own ch functionality for the object. - */ - ch: string; - /** - * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. - */ - chOff: string; - /** - * Sets or retrieves how text and other content are vertically aligned within the object that contains them. - */ - vAlign: string; -} - -interface IDBEnvironment { - readonly indexedDB: IDBFactory; -} - -interface LinkStyle { - readonly sheet: StyleSheet; -} - -interface MSBaseReaderEventMap { - "abort": Event; - "error": ErrorEvent; - "load": Event; - "loadend": ProgressEvent; - "loadstart": Event; - "progress": ProgressEvent; -} - -interface MSBaseReader { - onabort: (this: MSBaseReader, ev: Event) => any; - onerror: (this: MSBaseReader, ev: ErrorEvent) => any; - onload: (this: MSBaseReader, ev: Event) => any; - onloadend: (this: MSBaseReader, ev: ProgressEvent) => any; - onloadstart: (this: MSBaseReader, ev: Event) => any; - onprogress: (this: MSBaseReader, ev: ProgressEvent) => any; - readonly readyState: number; - readonly result: any; - abort(): void; - readonly DONE: number; - readonly EMPTY: number; - readonly LOADING: number; - addEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface MSFileSaver { - msSaveBlob(blob: any, defaultName?: string): boolean; - msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; -} - -interface MSNavigatorDoNotTrack { - confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; - confirmWebWideTrackingException(args: ExceptionInformation): boolean; - removeSiteSpecificTrackingException(args: ExceptionInformation): void; - removeWebWideTrackingException(args: ExceptionInformation): void; - storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; - storeWebWideTrackingException(args: StoreExceptionsInformation): void; -} - -interface NavigatorContentUtils { -} - -interface NavigatorGeolocation { - readonly geolocation: Geolocation; -} - -interface NavigatorID { - readonly appName: string; - readonly appVersion: string; - readonly platform: string; - readonly product: string; - readonly productSub: string; - readonly userAgent: string; - readonly vendor: string; - readonly vendorSub: string; -} - -interface NavigatorOnLine { - readonly onLine: boolean; -} - -interface NavigatorStorageUtils { -} - -interface NavigatorUserMedia { - readonly mediaDevices: MediaDevices; - getUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback): void; -} - -interface NodeSelector { - querySelector(selectors: K): ElementTagNameMap[K] | null; - querySelector(selectors: string): Element | null; - querySelectorAll(selectors: K): ElementListTagNameMap[K]; - querySelectorAll(selectors: string): NodeListOf; -} - -interface RandomSource { - getRandomValues(array: ArrayBufferView): ArrayBufferView; -} - -interface SVGAnimatedPathData { - readonly pathSegList: SVGPathSegList; -} - -interface SVGAnimatedPoints { - readonly animatedPoints: SVGPointList; - readonly points: SVGPointList; -} - -interface SVGExternalResourcesRequired { - readonly externalResourcesRequired: SVGAnimatedBoolean; -} - -interface SVGFilterPrimitiveStandardAttributes extends SVGStylable { - readonly height: SVGAnimatedLength; - readonly result: SVGAnimatedString; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; -} - -interface SVGFitToViewBox { - readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - readonly viewBox: SVGAnimatedRect; -} - -interface SVGLangSpace { - xmllang: string; - xmlspace: string; -} - -interface SVGLocatable { - readonly farthestViewportElement: SVGElement; - readonly nearestViewportElement: SVGElement; - getBBox(): SVGRect; - getCTM(): SVGMatrix; - getScreenCTM(): SVGMatrix; - getTransformToElement(element: SVGElement): SVGMatrix; -} - -interface SVGStylable { - className: any; - readonly style: CSSStyleDeclaration; -} - -interface SVGTests { - readonly requiredExtensions: SVGStringList; - readonly requiredFeatures: SVGStringList; - readonly systemLanguage: SVGStringList; - hasExtension(extension: string): boolean; -} - -interface SVGTransformable extends SVGLocatable { - readonly transform: SVGAnimatedTransformList; -} - -interface SVGURIReference { - readonly href: SVGAnimatedString; -} - -interface WindowBase64 { - atob(encodedString: string): string; - btoa(rawString: string): string; -} - -interface WindowConsole { - readonly console: Console; -} - -interface WindowLocalStorage { - readonly localStorage: Storage; -} - -interface WindowSessionStorage { - readonly sessionStorage: Storage; -} - -interface WindowTimers extends Object, WindowTimersExtension { - clearInterval(handle: number): void; - clearTimeout(handle: number): void; - setInterval(handler: (...args: any[]) => void, timeout: number): number; - setInterval(handler: any, timeout?: any, ...args: any[]): number; - setTimeout(handler: (...args: any[]) => void, timeout: number): number; - setTimeout(handler: any, timeout?: any, ...args: any[]): number; -} - -interface WindowTimersExtension { - clearImmediate(handle: number): void; - setImmediate(handler: (...args: any[]) => void): number; - setImmediate(handler: any, ...args: any[]): number; -} - -interface XMLHttpRequestEventTargetEventMap { - "abort": Event; - "error": ErrorEvent; - "load": Event; - "loadend": ProgressEvent; - "loadstart": Event; - "progress": ProgressEvent; - "timeout": ProgressEvent; -} - -interface XMLHttpRequestEventTarget { - onabort: (this: XMLHttpRequestEventTarget, ev: Event) => any; - onerror: (this: XMLHttpRequestEventTarget, ev: ErrorEvent) => any; - onload: (this: XMLHttpRequestEventTarget, ev: Event) => any; - onloadend: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; - onloadstart: (this: XMLHttpRequestEventTarget, ev: Event) => any; - onprogress: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; - ontimeout: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; - addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface StorageEventInit extends EventInit { - key?: string; - oldValue?: string; - newValue?: string; - url: string; - storageArea?: Storage; -} - -interface Canvas2DContextAttributes { - alpha?: boolean; - willReadFrequently?: boolean; - storage?: boolean; - [attribute: string]: boolean | string | undefined; -} - -interface NodeListOf extends NodeList { - length: number; - item(index: number): TNode; - [index: number]: TNode; -} - -interface HTMLCollectionOf extends HTMLCollection { - item(index: number): T; - namedItem(name: string): T; - [index: number]: T; -} - -interface BlobPropertyBag { - type?: string; - endings?: string; -} - -interface FilePropertyBag { - type?: string; - lastModified?: number; -} - -interface EventListenerObject { - handleEvent(evt: Event): void; -} - -interface MessageEventInit extends EventInit { - data?: any; - origin?: string; - lastEventId?: string; - channel?: string; - source?: any; - ports?: MessagePort[]; -} - -interface ProgressEventInit extends EventInit { - lengthComputable?: boolean; - loaded?: number; - total?: number; -} - -interface ScrollOptions { - behavior?: ScrollBehavior; -} - -interface ScrollToOptions extends ScrollOptions { - left?: number; - top?: number; -} - -interface ScrollIntoViewOptions extends ScrollOptions { - block?: ScrollLogicalPosition; - inline?: ScrollLogicalPosition; -} - -interface ClipboardEventInit extends EventInit { - data?: string; - dataType?: string; -} - -interface IDBArrayKey extends Array { -} - -interface RsaKeyGenParams extends Algorithm { - modulusLength: number; - publicExponent: Uint8Array; -} - -interface RsaHashedKeyGenParams extends RsaKeyGenParams { - hash: AlgorithmIdentifier; -} - -interface RsaKeyAlgorithm extends KeyAlgorithm { - modulusLength: number; - publicExponent: Uint8Array; -} - -interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { - hash: AlgorithmIdentifier; -} - -interface RsaHashedImportParams { - hash: AlgorithmIdentifier; -} - -interface RsaPssParams { - saltLength: number; -} - -interface RsaOaepParams extends Algorithm { - label?: BufferSource; -} - -interface EcdsaParams extends Algorithm { - hash: AlgorithmIdentifier; -} - -interface EcKeyGenParams extends Algorithm { - namedCurve: string; -} - -interface EcKeyAlgorithm extends KeyAlgorithm { - typedCurve: string; -} - -interface EcKeyImportParams { - namedCurve: string; -} - -interface EcdhKeyDeriveParams extends Algorithm { - public: CryptoKey; -} - -interface AesCtrParams extends Algorithm { - counter: BufferSource; - length: number; -} - -interface AesKeyAlgorithm extends KeyAlgorithm { - length: number; -} - -interface AesKeyGenParams extends Algorithm { - length: number; -} - -interface AesDerivedKeyParams extends Algorithm { - length: number; -} - -interface AesCbcParams extends Algorithm { - iv: BufferSource; -} - -interface AesCmacParams extends Algorithm { - length: number; -} - -interface AesGcmParams extends Algorithm { - iv: BufferSource; - additionalData?: BufferSource; - tagLength?: number; -} - -interface AesCfbParams extends Algorithm { - iv: BufferSource; -} - -interface HmacImportParams extends Algorithm { - hash?: AlgorithmIdentifier; - length?: number; -} - -interface HmacKeyAlgorithm extends KeyAlgorithm { - hash: AlgorithmIdentifier; - length: number; -} - -interface HmacKeyGenParams extends Algorithm { - hash: AlgorithmIdentifier; - length?: number; -} - -interface DhKeyGenParams extends Algorithm { - prime: Uint8Array; - generator: Uint8Array; -} - -interface DhKeyAlgorithm extends KeyAlgorithm { - prime: Uint8Array; - generator: Uint8Array; -} - -interface DhKeyDeriveParams extends Algorithm { - public: CryptoKey; -} - -interface DhImportKeyParams extends Algorithm { - prime: Uint8Array; - generator: Uint8Array; -} - -interface ConcatParams extends Algorithm { - hash?: AlgorithmIdentifier; - algorithmId: Uint8Array; - partyUInfo: Uint8Array; - partyVInfo: Uint8Array; - publicInfo?: Uint8Array; - privateInfo?: Uint8Array; -} - -interface HkdfCtrParams extends Algorithm { - hash: AlgorithmIdentifier; - label: BufferSource; - context: BufferSource; -} - -interface Pbkdf2Params extends Algorithm { - salt: BufferSource; - iterations: number; - hash: AlgorithmIdentifier; -} - -interface RsaOtherPrimesInfo { - r: string; - d: string; - t: string; -} - -interface JsonWebKey { - kty: string; - use?: string; - key_ops?: string[]; - alg?: string; - kid?: string; - x5u?: string; - x5c?: string; - x5t?: string; - ext?: boolean; - crv?: string; - x?: string; - y?: string; - d?: string; - n?: string; - e?: string; - p?: string; - q?: string; - dp?: string; - dq?: string; - qi?: string; - oth?: RsaOtherPrimesInfo[]; - k?: string; -} - -interface ParentNode { - readonly children: HTMLCollection; - readonly firstElementChild: Element; - readonly lastElementChild: Element; - readonly childElementCount: number; -} - -interface DocumentOrShadowRoot { - readonly activeElement: Element | null; - readonly stylesheets: StyleSheetList; - getSelection(): Selection | null; - elementFromPoint(x: number, y: number): Element | null; - elementsFromPoint(x: number, y: number): Element[]; -} - -interface ShadowRoot extends DocumentOrShadowRoot, DocumentFragment { - readonly host: Element; - innerHTML: string; -} - -interface ShadowRootInit { - mode: 'open'|'closed'; - delegatesFocus?: boolean; -} - -interface HTMLSlotElement extends HTMLElement { - name: string; - assignedNodes(options?: AssignedNodesOptions): Node[]; -} - -interface AssignedNodesOptions { - flatten?: boolean; -} - -declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; - -interface ErrorEventHandler { - (message: string, filename?: string, lineno?: number, colno?: number, error?:Error): void; -} -interface PositionCallback { - (position: Position): void; -} -interface PositionErrorCallback { - (error: PositionError): void; -} -interface MediaQueryListListener { - (mql: MediaQueryList): void; -} -interface MSLaunchUriCallback { - (): void; -} -interface FrameRequestCallback { - (time: number): void; -} -interface MSUnsafeFunctionCallback { - (): any; -} -interface MSExecAtPriorityFunctionCallback { - (...args: any[]): any; -} -interface MutationCallback { - (mutations: MutationRecord[], observer: MutationObserver): void; -} -interface DecodeSuccessCallback { - (decodedData: AudioBuffer): void; -} -interface DecodeErrorCallback { - (error: DOMException): void; -} -interface FunctionStringCallback { - (data: string): void; -} -interface NavigatorUserMediaSuccessCallback { - (stream: MediaStream): void; -} -interface NavigatorUserMediaErrorCallback { - (error: MediaStreamError): void; -} -interface ForEachCallback { - (keyId: any, status: string): void; -} -interface HTMLElementTagNameMap { - "a": HTMLAnchorElement; - "applet": HTMLAppletElement; - "area": HTMLAreaElement; - "audio": HTMLAudioElement; - "base": HTMLBaseElement; - "basefont": HTMLBaseFontElement; - "blockquote": HTMLQuoteElement; - "body": HTMLBodyElement; - "br": HTMLBRElement; - "button": HTMLButtonElement; - "canvas": HTMLCanvasElement; - "caption": HTMLTableCaptionElement; - "col": HTMLTableColElement; - "colgroup": HTMLTableColElement; - "datalist": HTMLDataListElement; - "del": HTMLModElement; - "dir": HTMLDirectoryElement; - "div": HTMLDivElement; - "dl": HTMLDListElement; - "embed": HTMLEmbedElement; - "fieldset": HTMLFieldSetElement; - "font": HTMLFontElement; - "form": HTMLFormElement; - "frame": HTMLFrameElement; - "frameset": HTMLFrameSetElement; - "h1": HTMLHeadingElement; - "h2": HTMLHeadingElement; - "h3": HTMLHeadingElement; - "h4": HTMLHeadingElement; - "h5": HTMLHeadingElement; - "h6": HTMLHeadingElement; - "head": HTMLHeadElement; - "hr": HTMLHRElement; - "html": HTMLHtmlElement; - "iframe": HTMLIFrameElement; - "img": HTMLImageElement; - "input": HTMLInputElement; - "ins": HTMLModElement; - "isindex": HTMLUnknownElement; - "label": HTMLLabelElement; - "legend": HTMLLegendElement; - "li": HTMLLIElement; - "link": HTMLLinkElement; - "listing": HTMLPreElement; - "map": HTMLMapElement; - "marquee": HTMLMarqueeElement; - "menu": HTMLMenuElement; - "meta": HTMLMetaElement; - "meter": HTMLMeterElement; - "nextid": HTMLUnknownElement; - "object": HTMLObjectElement; - "ol": HTMLOListElement; - "optgroup": HTMLOptGroupElement; - "option": HTMLOptionElement; - "p": HTMLParagraphElement; - "param": HTMLParamElement; - "picture": HTMLPictureElement; - "pre": HTMLPreElement; - "progress": HTMLProgressElement; - "q": HTMLQuoteElement; - "script": HTMLScriptElement; - "select": HTMLSelectElement; - "source": HTMLSourceElement; - "span": HTMLSpanElement; - "style": HTMLStyleElement; - "table": HTMLTableElement; - "tbody": HTMLTableSectionElement; - "td": HTMLTableDataCellElement; - "template": HTMLTemplateElement; - "textarea": HTMLTextAreaElement; - "tfoot": HTMLTableSectionElement; - "th": HTMLTableHeaderCellElement; - "thead": HTMLTableSectionElement; - "title": HTMLTitleElement; - "tr": HTMLTableRowElement; - "track": HTMLTrackElement; - "ul": HTMLUListElement; - "video": HTMLVideoElement; - "x-ms-webview": MSHTMLWebViewElement; - "xmp": HTMLPreElement; -} - -interface ElementTagNameMap { - "a": HTMLAnchorElement; - "abbr": HTMLElement; - "acronym": HTMLElement; - "address": HTMLElement; - "applet": HTMLAppletElement; - "area": HTMLAreaElement; - "article": HTMLElement; - "aside": HTMLElement; - "audio": HTMLAudioElement; - "b": HTMLElement; - "base": HTMLBaseElement; - "basefont": HTMLBaseFontElement; - "bdo": HTMLElement; - "big": HTMLElement; - "blockquote": HTMLQuoteElement; - "body": HTMLBodyElement; - "br": HTMLBRElement; - "button": HTMLButtonElement; - "canvas": HTMLCanvasElement; - "caption": HTMLTableCaptionElement; - "center": HTMLElement; - "circle": SVGCircleElement; - "cite": HTMLElement; - "clippath": SVGClipPathElement; - "code": HTMLElement; - "col": HTMLTableColElement; - "colgroup": HTMLTableColElement; - "datalist": HTMLDataListElement; - "dd": HTMLElement; - "defs": SVGDefsElement; - "del": HTMLModElement; - "desc": SVGDescElement; - "dfn": HTMLElement; - "dir": HTMLDirectoryElement; - "div": HTMLDivElement; - "dl": HTMLDListElement; - "dt": HTMLElement; - "ellipse": SVGEllipseElement; - "em": HTMLElement; - "embed": HTMLEmbedElement; - "feblend": SVGFEBlendElement; - "fecolormatrix": SVGFEColorMatrixElement; - "fecomponenttransfer": SVGFEComponentTransferElement; - "fecomposite": SVGFECompositeElement; - "feconvolvematrix": SVGFEConvolveMatrixElement; - "fediffuselighting": SVGFEDiffuseLightingElement; - "fedisplacementmap": SVGFEDisplacementMapElement; - "fedistantlight": SVGFEDistantLightElement; - "feflood": SVGFEFloodElement; - "fefunca": SVGFEFuncAElement; - "fefuncb": SVGFEFuncBElement; - "fefuncg": SVGFEFuncGElement; - "fefuncr": SVGFEFuncRElement; - "fegaussianblur": SVGFEGaussianBlurElement; - "feimage": SVGFEImageElement; - "femerge": SVGFEMergeElement; - "femergenode": SVGFEMergeNodeElement; - "femorphology": SVGFEMorphologyElement; - "feoffset": SVGFEOffsetElement; - "fepointlight": SVGFEPointLightElement; - "fespecularlighting": SVGFESpecularLightingElement; - "fespotlight": SVGFESpotLightElement; - "fetile": SVGFETileElement; - "feturbulence": SVGFETurbulenceElement; - "fieldset": HTMLFieldSetElement; - "figcaption": HTMLElement; - "figure": HTMLElement; - "filter": SVGFilterElement; - "font": HTMLFontElement; - "footer": HTMLElement; - "foreignobject": SVGForeignObjectElement; - "form": HTMLFormElement; - "frame": HTMLFrameElement; - "frameset": HTMLFrameSetElement; - "g": SVGGElement; - "h1": HTMLHeadingElement; - "h2": HTMLHeadingElement; - "h3": HTMLHeadingElement; - "h4": HTMLHeadingElement; - "h5": HTMLHeadingElement; - "h6": HTMLHeadingElement; - "head": HTMLHeadElement; - "header": HTMLElement; - "hgroup": HTMLElement; - "hr": HTMLHRElement; - "html": HTMLHtmlElement; - "i": HTMLElement; - "iframe": HTMLIFrameElement; - "image": SVGImageElement; - "img": HTMLImageElement; - "input": HTMLInputElement; - "ins": HTMLModElement; - "isindex": HTMLUnknownElement; - "kbd": HTMLElement; - "keygen": HTMLElement; - "label": HTMLLabelElement; - "legend": HTMLLegendElement; - "li": HTMLLIElement; - "line": SVGLineElement; - "lineargradient": SVGLinearGradientElement; - "link": HTMLLinkElement; - "listing": HTMLPreElement; - "map": HTMLMapElement; - "mark": HTMLElement; - "marker": SVGMarkerElement; - "marquee": HTMLMarqueeElement; - "mask": SVGMaskElement; - "menu": HTMLMenuElement; - "meta": HTMLMetaElement; - "metadata": SVGMetadataElement; - "meter": HTMLMeterElement; - "nav": HTMLElement; - "nextid": HTMLUnknownElement; - "nobr": HTMLElement; - "noframes": HTMLElement; - "noscript": HTMLElement; - "object": HTMLObjectElement; - "ol": HTMLOListElement; - "optgroup": HTMLOptGroupElement; - "option": HTMLOptionElement; - "p": HTMLParagraphElement; - "param": HTMLParamElement; - "path": SVGPathElement; - "pattern": SVGPatternElement; - "picture": HTMLPictureElement; - "plaintext": HTMLElement; - "polygon": SVGPolygonElement; - "polyline": SVGPolylineElement; - "pre": HTMLPreElement; - "progress": HTMLProgressElement; - "q": HTMLQuoteElement; - "radialgradient": SVGRadialGradientElement; - "rect": SVGRectElement; - "rt": HTMLElement; - "ruby": HTMLElement; - "s": HTMLElement; - "samp": HTMLElement; - "script": HTMLScriptElement; - "section": HTMLElement; - "select": HTMLSelectElement; - "small": HTMLElement; - "source": HTMLSourceElement; - "span": HTMLSpanElement; - "stop": SVGStopElement; - "strike": HTMLElement; - "strong": HTMLElement; - "style": HTMLStyleElement; - "sub": HTMLElement; - "sup": HTMLElement; - "svg": SVGSVGElement; - "switch": SVGSwitchElement; - "symbol": SVGSymbolElement; - "table": HTMLTableElement; - "tbody": HTMLTableSectionElement; - "td": HTMLTableDataCellElement; - "template": HTMLTemplateElement; - "text": SVGTextElement; - "textpath": SVGTextPathElement; - "textarea": HTMLTextAreaElement; - "tfoot": HTMLTableSectionElement; - "th": HTMLTableHeaderCellElement; - "thead": HTMLTableSectionElement; - "title": HTMLTitleElement; - "tr": HTMLTableRowElement; - "track": HTMLTrackElement; - "tspan": SVGTSpanElement; - "tt": HTMLElement; - "u": HTMLElement; - "ul": HTMLUListElement; - "use": SVGUseElement; - "var": HTMLElement; - "video": HTMLVideoElement; - "view": SVGViewElement; - "wbr": HTMLElement; - "x-ms-webview": MSHTMLWebViewElement; - "xmp": HTMLPreElement; -} - -interface ElementListTagNameMap { - "a": NodeListOf; - "abbr": NodeListOf; - "acronym": NodeListOf; - "address": NodeListOf; - "applet": NodeListOf; - "area": NodeListOf; - "article": NodeListOf; - "aside": NodeListOf; - "audio": NodeListOf; - "b": NodeListOf; - "base": NodeListOf; - "basefont": NodeListOf; - "bdo": NodeListOf; - "big": NodeListOf; - "blockquote": NodeListOf; - "body": NodeListOf; - "br": NodeListOf; - "button": NodeListOf; - "canvas": NodeListOf; - "caption": NodeListOf; - "center": NodeListOf; - "circle": NodeListOf; - "cite": NodeListOf; - "clippath": NodeListOf; - "code": NodeListOf; - "col": NodeListOf; - "colgroup": NodeListOf; - "datalist": NodeListOf; - "dd": NodeListOf; - "defs": NodeListOf; - "del": NodeListOf; - "desc": NodeListOf; - "dfn": NodeListOf; - "dir": NodeListOf; - "div": NodeListOf; - "dl": NodeListOf; - "dt": NodeListOf; - "ellipse": NodeListOf; - "em": NodeListOf; - "embed": NodeListOf; - "feblend": NodeListOf; - "fecolormatrix": NodeListOf; - "fecomponenttransfer": NodeListOf; - "fecomposite": NodeListOf; - "feconvolvematrix": NodeListOf; - "fediffuselighting": NodeListOf; - "fedisplacementmap": NodeListOf; - "fedistantlight": NodeListOf; - "feflood": NodeListOf; - "fefunca": NodeListOf; - "fefuncb": NodeListOf; - "fefuncg": NodeListOf; - "fefuncr": NodeListOf; - "fegaussianblur": NodeListOf; - "feimage": NodeListOf; - "femerge": NodeListOf; - "femergenode": NodeListOf; - "femorphology": NodeListOf; - "feoffset": NodeListOf; - "fepointlight": NodeListOf; - "fespecularlighting": NodeListOf; - "fespotlight": NodeListOf; - "fetile": NodeListOf; - "feturbulence": NodeListOf; - "fieldset": NodeListOf; - "figcaption": NodeListOf; - "figure": NodeListOf; - "filter": NodeListOf; - "font": NodeListOf; - "footer": NodeListOf; - "foreignobject": NodeListOf; - "form": NodeListOf; - "frame": NodeListOf; - "frameset": NodeListOf; - "g": NodeListOf; - "h1": NodeListOf; - "h2": NodeListOf; - "h3": NodeListOf; - "h4": NodeListOf; - "h5": NodeListOf; - "h6": NodeListOf; - "head": NodeListOf; - "header": NodeListOf; - "hgroup": NodeListOf; - "hr": NodeListOf; - "html": NodeListOf; - "i": NodeListOf; - "iframe": NodeListOf; - "image": NodeListOf; - "img": NodeListOf; - "input": NodeListOf; - "ins": NodeListOf; - "isindex": NodeListOf; - "kbd": NodeListOf; - "keygen": NodeListOf; - "label": NodeListOf; - "legend": NodeListOf; - "li": NodeListOf; - "line": NodeListOf; - "lineargradient": NodeListOf; - "link": NodeListOf; - "listing": NodeListOf; - "map": NodeListOf; - "mark": NodeListOf; - "marker": NodeListOf; - "marquee": NodeListOf; - "mask": NodeListOf; - "menu": NodeListOf; - "meta": NodeListOf; - "metadata": NodeListOf; - "meter": NodeListOf; - "nav": NodeListOf; - "nextid": NodeListOf; - "nobr": NodeListOf; - "noframes": NodeListOf; - "noscript": NodeListOf; - "object": NodeListOf; - "ol": NodeListOf; - "optgroup": NodeListOf; - "option": NodeListOf; - "p": NodeListOf; - "param": NodeListOf; - "path": NodeListOf; - "pattern": NodeListOf; - "picture": NodeListOf; - "plaintext": NodeListOf; - "polygon": NodeListOf; - "polyline": NodeListOf; - "pre": NodeListOf; - "progress": NodeListOf; - "q": NodeListOf; - "radialgradient": NodeListOf; - "rect": NodeListOf; - "rt": NodeListOf; - "ruby": NodeListOf; - "s": NodeListOf; - "samp": NodeListOf; - "script": NodeListOf; - "section": NodeListOf; - "select": NodeListOf; - "small": NodeListOf; - "source": NodeListOf; - "span": NodeListOf; - "stop": NodeListOf; - "strike": NodeListOf; - "strong": NodeListOf; - "style": NodeListOf; - "sub": NodeListOf; - "sup": NodeListOf; - "svg": NodeListOf; - "switch": NodeListOf; - "symbol": NodeListOf; - "table": NodeListOf; - "tbody": NodeListOf; - "td": NodeListOf; - "template": NodeListOf; - "text": NodeListOf; - "textpath": NodeListOf; - "textarea": NodeListOf; - "tfoot": NodeListOf; - "th": NodeListOf; - "thead": NodeListOf; - "title": NodeListOf; - "tr": NodeListOf; - "track": NodeListOf; - "tspan": NodeListOf; - "tt": NodeListOf; - "u": NodeListOf; - "ul": NodeListOf; - "use": NodeListOf; - "var": NodeListOf; - "video": NodeListOf; - "view": NodeListOf; - "wbr": NodeListOf; - "x-ms-webview": NodeListOf; - "xmp": NodeListOf; -} - -declare var Audio: {new(src?: string): HTMLAudioElement; }; -declare var Image: {new(width?: number, height?: number): HTMLImageElement; }; -declare var Option: {new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; }; -declare var applicationCache: ApplicationCache; -declare var clientInformation: Navigator; -declare var closed: boolean; -declare var crypto: Crypto; -declare var defaultStatus: string; -declare var devicePixelRatio: number; -declare var doNotTrack: string; -declare var document: Document; -declare var event: Event | undefined; -declare var external: External; -declare var frameElement: Element; -declare var frames: Window; -declare var history: History; -declare var innerHeight: number; -declare var innerWidth: number; -declare var length: number; -declare var location: Location; -declare var locationbar: BarProp; -declare var menubar: BarProp; -declare var msCredentials: MSCredentials; -declare const name: never; -declare var navigator: Navigator; -declare var offscreenBuffering: string | boolean; -declare var onabort: (this: Window, ev: UIEvent) => any; -declare var onafterprint: (this: Window, ev: Event) => any; -declare var onbeforeprint: (this: Window, ev: Event) => any; -declare var onbeforeunload: (this: Window, ev: BeforeUnloadEvent) => any; -declare var onblur: (this: Window, ev: FocusEvent) => any; -declare var oncanplay: (this: Window, ev: Event) => any; -declare var oncanplaythrough: (this: Window, ev: Event) => any; -declare var onchange: (this: Window, ev: Event) => any; -declare var onclick: (this: Window, ev: MouseEvent) => any; -declare var oncompassneedscalibration: (this: Window, ev: Event) => any; -declare var oncontextmenu: (this: Window, ev: PointerEvent) => any; -declare var ondblclick: (this: Window, ev: MouseEvent) => any; -declare var ondevicelight: (this: Window, ev: DeviceLightEvent) => any; -declare var ondevicemotion: (this: Window, ev: DeviceMotionEvent) => any; -declare var ondeviceorientation: (this: Window, ev: DeviceOrientationEvent) => any; -declare var ondrag: (this: Window, ev: DragEvent) => any; -declare var ondragend: (this: Window, ev: DragEvent) => any; -declare var ondragenter: (this: Window, ev: DragEvent) => any; -declare var ondragleave: (this: Window, ev: DragEvent) => any; -declare var ondragover: (this: Window, ev: DragEvent) => any; -declare var ondragstart: (this: Window, ev: DragEvent) => any; -declare var ondrop: (this: Window, ev: DragEvent) => any; -declare var ondurationchange: (this: Window, ev: Event) => any; -declare var onemptied: (this: Window, ev: Event) => any; -declare var onended: (this: Window, ev: MediaStreamErrorEvent) => any; -declare var onerror: ErrorEventHandler; -declare var onfocus: (this: Window, ev: FocusEvent) => any; -declare var onhashchange: (this: Window, ev: HashChangeEvent) => any; -declare var oninput: (this: Window, ev: Event) => any; -declare var oninvalid: (this: Window, ev: Event) => any; -declare var onkeydown: (this: Window, ev: KeyboardEvent) => any; -declare var onkeypress: (this: Window, ev: KeyboardEvent) => any; -declare var onkeyup: (this: Window, ev: KeyboardEvent) => any; -declare var onload: (this: Window, ev: Event) => any; -declare var onloadeddata: (this: Window, ev: Event) => any; -declare var onloadedmetadata: (this: Window, ev: Event) => any; -declare var onloadstart: (this: Window, ev: Event) => any; -declare var onmessage: (this: Window, ev: MessageEvent) => any; -declare var onmousedown: (this: Window, ev: MouseEvent) => any; -declare var onmouseenter: (this: Window, ev: MouseEvent) => any; -declare var onmouseleave: (this: Window, ev: MouseEvent) => any; -declare var onmousemove: (this: Window, ev: MouseEvent) => any; -declare var onmouseout: (this: Window, ev: MouseEvent) => any; -declare var onmouseover: (this: Window, ev: MouseEvent) => any; -declare var onmouseup: (this: Window, ev: MouseEvent) => any; -declare var onmousewheel: (this: Window, ev: WheelEvent) => any; -declare var onmsgesturechange: (this: Window, ev: MSGestureEvent) => any; -declare var onmsgesturedoubletap: (this: Window, ev: MSGestureEvent) => any; -declare var onmsgestureend: (this: Window, ev: MSGestureEvent) => any; -declare var onmsgesturehold: (this: Window, ev: MSGestureEvent) => any; -declare var onmsgesturestart: (this: Window, ev: MSGestureEvent) => any; -declare var onmsgesturetap: (this: Window, ev: MSGestureEvent) => any; -declare var onmsinertiastart: (this: Window, ev: MSGestureEvent) => any; -declare var onmspointercancel: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerdown: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerenter: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerleave: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointermove: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerout: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerover: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerup: (this: Window, ev: MSPointerEvent) => any; -declare var onoffline: (this: Window, ev: Event) => any; -declare var ononline: (this: Window, ev: Event) => any; -declare var onorientationchange: (this: Window, ev: Event) => any; -declare var onpagehide: (this: Window, ev: PageTransitionEvent) => any; -declare var onpageshow: (this: Window, ev: PageTransitionEvent) => any; -declare var onpause: (this: Window, ev: Event) => any; -declare var onplay: (this: Window, ev: Event) => any; -declare var onplaying: (this: Window, ev: Event) => any; -declare var onpopstate: (this: Window, ev: PopStateEvent) => any; -declare var onprogress: (this: Window, ev: ProgressEvent) => any; -declare var onratechange: (this: Window, ev: Event) => any; -declare var onreadystatechange: (this: Window, ev: ProgressEvent) => any; -declare var onreset: (this: Window, ev: Event) => any; -declare var onresize: (this: Window, ev: UIEvent) => any; -declare var onscroll: (this: Window, ev: UIEvent) => any; -declare var onseeked: (this: Window, ev: Event) => any; -declare var onseeking: (this: Window, ev: Event) => any; -declare var onselect: (this: Window, ev: UIEvent) => any; -declare var onstalled: (this: Window, ev: Event) => any; -declare var onstorage: (this: Window, ev: StorageEvent) => any; -declare var onsubmit: (this: Window, ev: Event) => any; -declare var onsuspend: (this: Window, ev: Event) => any; -declare var ontimeupdate: (this: Window, ev: Event) => any; -declare var ontouchcancel: (ev: TouchEvent) => any; -declare var ontouchend: (ev: TouchEvent) => any; -declare var ontouchmove: (ev: TouchEvent) => any; -declare var ontouchstart: (ev: TouchEvent) => any; -declare var onunload: (this: Window, ev: Event) => any; -declare var onvolumechange: (this: Window, ev: Event) => any; -declare var onwaiting: (this: Window, ev: Event) => any; -declare var opener: any; -declare var orientation: string | number; -declare var outerHeight: number; -declare var outerWidth: number; -declare var pageXOffset: number; -declare var pageYOffset: number; -declare var parent: Window; -declare var performance: Performance; -declare var personalbar: BarProp; -declare var screen: Screen; -declare var screenLeft: number; -declare var screenTop: number; -declare var screenX: number; -declare var screenY: number; -declare var scrollX: number; -declare var scrollY: number; -declare var scrollbars: BarProp; -declare var self: Window; -declare var status: string; -declare var statusbar: BarProp; -declare var styleMedia: StyleMedia; -declare var toolbar: BarProp; -declare var top: Window; -declare var window: Window; -declare function alert(message?: any): void; -declare function blur(): void; -declare function cancelAnimationFrame(handle: number): void; -declare function captureEvents(): void; -declare function close(): void; -declare function confirm(message?: string): boolean; -declare function focus(): void; -declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; -declare function getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; -declare function getSelection(): Selection; -declare function matchMedia(mediaQuery: string): MediaQueryList; -declare function moveBy(x?: number, y?: number): void; -declare function moveTo(x?: number, y?: number): void; -declare function msWriteProfilerMark(profilerMarkName: string): void; -declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window; -declare function postMessage(message: any, targetOrigin: string, transfer?: any[]): void; -declare function print(): void; -declare function prompt(message?: string, _default?: string): string | null; -declare function releaseEvents(): void; -declare function requestAnimationFrame(callback: FrameRequestCallback): number; -declare function resizeBy(x?: number, y?: number): void; -declare function resizeTo(x?: number, y?: number): void; -declare function scroll(x?: number, y?: number): void; -declare function scrollBy(x?: number, y?: number): void; -declare function scrollTo(x?: number, y?: number): void; -declare function webkitCancelAnimationFrame(handle: number): void; -declare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; -declare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; -declare function webkitRequestAnimationFrame(callback: FrameRequestCallback): number; -declare function scroll(options?: ScrollToOptions): void; -declare function scrollTo(options?: ScrollToOptions): void; -declare function scrollBy(options?: ScrollToOptions): void; -declare function toString(): string; -declare function dispatchEvent(evt: Event): boolean; -declare function removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void; -declare function clearInterval(handle: number): void; -declare function clearTimeout(handle: number): void; -declare function setInterval(handler: (...args: any[]) => void, timeout: number): number; -declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; -declare function setTimeout(handler: (...args: any[]) => void, timeout: number): number; -declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; -declare function clearImmediate(handle: number): void; -declare function setImmediate(handler: (...args: any[]) => void): number; -declare function setImmediate(handler: any, ...args: any[]): number; -declare var sessionStorage: Storage; -declare var localStorage: Storage; -declare var console: Console; -declare var onpointercancel: (this: Window, ev: PointerEvent) => any; -declare var onpointerdown: (this: Window, ev: PointerEvent) => any; -declare var onpointerenter: (this: Window, ev: PointerEvent) => any; -declare var onpointerleave: (this: Window, ev: PointerEvent) => any; -declare var onpointermove: (this: Window, ev: PointerEvent) => any; -declare var onpointerout: (this: Window, ev: PointerEvent) => any; -declare var onpointerover: (this: Window, ev: PointerEvent) => any; -declare var onpointerup: (this: Window, ev: PointerEvent) => any; -declare var onwheel: (this: Window, ev: WheelEvent) => any; -declare var indexedDB: IDBFactory; -declare function atob(encodedString: string): string; -declare function btoa(rawString: string): string; -declare function addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, useCapture?: boolean): void; -declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -type AAGUID = string; -type AlgorithmIdentifier = string | Algorithm; -type ConstrainBoolean = boolean | ConstrainBooleanParameters; -type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters; -type ConstrainDouble = number | ConstrainDoubleRange; -type ConstrainLong = number | ConstrainLongRange; -type CryptoOperationData = ArrayBufferView; -type GLbitfield = number; -type GLboolean = boolean; -type GLbyte = number; -type GLclampf = number; -type GLenum = number; -type GLfloat = number; -type GLint = number; -type GLintptr = number; -type GLshort = number; -type GLsizei = number; -type GLsizeiptr = number; -type GLubyte = number; -type GLuint = number; -type GLushort = number; -type IDBKeyPath = string; -type KeyFormat = string; -type KeyType = string; -type KeyUsage = string; -type MSInboundPayload = MSVideoRecvPayload | MSAudioRecvPayload; -type MSLocalClientEvent = MSLocalClientEventBase | MSAudioLocalClientEvent; -type MSOutboundPayload = MSVideoSendPayload | MSAudioSendPayload; -type RTCIceGatherCandidate = RTCIceCandidate | RTCIceCandidateComplete; -type RTCTransport = RTCDtlsTransport | RTCSrtpSdesTransport; -type payloadtype = number; -type ScrollBehavior = "auto" | "instant" | "smooth"; -type ScrollLogicalPosition = "start" | "center" | "end" | "nearest"; -type IDBValidKey = number | string | Date | IDBArrayKey; -type BufferSource = ArrayBuffer | ArrayBufferView; -type MouseWheelEvent = WheelEvent; -type ScrollRestoration = "auto" | "manual"; \ No newline at end of file + +///////////////////////////// +/// IE DOM APIs +///////////////////////////// + +interface Account { + rpDisplayName?: string; + displayName?: string; + id?: string; + name?: string; + imageURL?: string; +} + +interface Algorithm { + name: string; +} + +interface AnimationEventInit extends EventInit { + animationName?: string; + elapsedTime?: number; +} + +interface AssertionOptions { + timeoutSeconds?: number; + rpId?: USVString; + allowList?: ScopedCredentialDescriptor[]; + extensions?: WebAuthnExtensions; +} + +interface CacheQueryOptions { + ignoreSearch?: boolean; + ignoreMethod?: boolean; + ignoreVary?: boolean; + cacheName?: string; +} + +interface ClientData { + challenge?: string; + origin?: string; + rpId?: string; + hashAlg?: string | Algorithm; + tokenBinding?: string; + extensions?: WebAuthnExtensions; +} + +interface CloseEventInit extends EventInit { + wasClean?: boolean; + code?: number; + reason?: string; +} + +interface CompositionEventInit extends UIEventInit { + data?: string; +} + +interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation { + arrayOfDomainStrings?: string[]; +} + +interface ConstrainBooleanParameters { + exact?: boolean; + ideal?: boolean; +} + +interface ConstrainDOMStringParameters { + exact?: string | string[]; + ideal?: string | string[]; +} + +interface ConstrainDoubleRange extends DoubleRange { + exact?: number; + ideal?: number; +} + +interface ConstrainLongRange extends LongRange { + exact?: number; + ideal?: number; +} + +interface ConstrainVideoFacingModeParameters { + exact?: VideoFacingModeEnum | VideoFacingModeEnum[]; + ideal?: VideoFacingModeEnum | VideoFacingModeEnum[]; +} + +interface CustomEventInit extends EventInit { + detail?: any; +} + +interface DOMRectInit { + x?: any; + y?: any; + width?: any; + height?: any; +} + +interface DeviceAccelerationDict { + x?: number; + y?: number; + z?: number; +} + +interface DeviceLightEventInit extends EventInit { + value?: number; +} + +interface DeviceMotionEventInit extends EventInit { + acceleration?: DeviceAccelerationDict; + accelerationIncludingGravity?: DeviceAccelerationDict; + rotationRate?: DeviceRotationRateDict; + interval?: number; +} + +interface DeviceOrientationEventInit extends EventInit { + alpha?: number; + beta?: number; + gamma?: number; + absolute?: boolean; +} + +interface DeviceRotationRateDict { + alpha?: number; + beta?: number; + gamma?: number; +} + +interface DoubleRange { + max?: number; + min?: number; +} + +interface ErrorEventInit extends EventInit { + message?: string; + filename?: string; + lineno?: number; + colno?: number; + error?: any; +} + +interface EventInit { + scoped?: boolean; + bubbles?: boolean; + cancelable?: boolean; +} + +interface EventModifierInit extends UIEventInit { + ctrlKey?: boolean; + shiftKey?: boolean; + altKey?: boolean; + metaKey?: boolean; + modifierAltGraph?: boolean; + modifierCapsLock?: boolean; + modifierFn?: boolean; + modifierFnLock?: boolean; + modifierHyper?: boolean; + modifierNumLock?: boolean; + modifierOS?: boolean; + modifierScrollLock?: boolean; + modifierSuper?: boolean; + modifierSymbol?: boolean; + modifierSymbolLock?: boolean; +} + +interface ExceptionInformation { + domain?: string; +} + +interface FocusEventInit extends UIEventInit { + relatedTarget?: EventTarget; +} + +interface FocusNavigationEventInit extends EventInit { + navigationReason?: string; + originLeft?: number; + originTop?: number; + originWidth?: number; + originHeight?: number; +} + +interface FocusNavigationOrigin { + originLeft?: number; + originTop?: number; + originWidth?: number; + originHeight?: number; +} + +interface GamepadEventInit extends EventInit { + gamepad?: Gamepad; +} + +interface GetNotificationOptions { + tag?: string; +} + +interface HashChangeEventInit extends EventInit { + newURL?: string; + oldURL?: string; +} + +interface IDBIndexParameters { + multiEntry?: boolean; + unique?: boolean; +} + +interface IDBObjectStoreParameters { + autoIncrement?: boolean; + keyPath?: IDBKeyPath; +} + +interface IntersectionObserverEntryInit { + time?: number; + rootBounds?: DOMRectInit; + boundingClientRect?: DOMRectInit; + intersectionRect?: DOMRectInit; + target?: Element; +} + +interface IntersectionObserverInit { + root?: Element; + rootMargin?: string; + threshold?: number | number[]; +} + +interface KeyAlgorithm { + name?: string; +} + +interface KeyboardEventInit extends EventModifierInit { + code?: string; + key?: string; + location?: number; + repeat?: boolean; +} + +interface LongRange { + max?: number; + min?: number; +} + +interface MSAccountInfo { + rpDisplayName?: string; + userDisplayName?: string; + accountName?: string; + userId?: string; + accountImageUri?: string; +} + +interface MSAudioLocalClientEvent extends MSLocalClientEventBase { + networkSendQualityEventRatio?: number; + networkDelayEventRatio?: number; + cpuInsufficientEventRatio?: number; + deviceHalfDuplexAECEventRatio?: number; + deviceRenderNotFunctioningEventRatio?: number; + deviceCaptureNotFunctioningEventRatio?: number; + deviceGlitchesEventRatio?: number; + deviceLowSNREventRatio?: number; + deviceLowSpeechLevelEventRatio?: number; + deviceClippingEventRatio?: number; + deviceEchoEventRatio?: number; + deviceNearEndToEchoRatioEventRatio?: number; + deviceRenderZeroVolumeEventRatio?: number; + deviceRenderMuteEventRatio?: number; + deviceMultipleEndpointsEventCount?: number; + deviceHowlingEventCount?: number; +} + +interface MSAudioRecvPayload extends MSPayloadBase { + samplingRate?: number; + signal?: MSAudioRecvSignal; + packetReorderRatio?: number; + packetReorderDepthAvg?: number; + packetReorderDepthMax?: number; + burstLossLength1?: number; + burstLossLength2?: number; + burstLossLength3?: number; + burstLossLength4?: number; + burstLossLength5?: number; + burstLossLength6?: number; + burstLossLength7?: number; + burstLossLength8OrHigher?: number; + fecRecvDistance1?: number; + fecRecvDistance2?: number; + fecRecvDistance3?: number; + ratioConcealedSamplesAvg?: number; + ratioStretchedSamplesAvg?: number; + ratioCompressedSamplesAvg?: number; +} + +interface MSAudioRecvSignal { + initialSignalLevelRMS?: number; + recvSignalLevelCh1?: number; + recvNoiseLevelCh1?: number; + renderSignalLevel?: number; + renderNoiseLevel?: number; + renderLoopbackSignalLevel?: number; +} + +interface MSAudioSendPayload extends MSPayloadBase { + samplingRate?: number; + signal?: MSAudioSendSignal; + audioFECUsed?: boolean; + sendMutePercent?: number; +} + +interface MSAudioSendSignal { + noiseLevel?: number; + sendSignalLevelCh1?: number; + sendNoiseLevelCh1?: number; +} + +interface MSConnectivity { + iceType?: MSIceType; + iceWarningFlags?: MSIceWarningFlags; + relayAddress?: MSRelayAddress; +} + +interface MSCredentialFilter { + accept?: MSCredentialSpec[]; +} + +interface MSCredentialParameters { + type?: MSCredentialType; +} + +interface MSCredentialSpec { + type?: MSCredentialType; + id?: string; +} + +interface MSDelay { + roundTrip?: number; + roundTripMax?: number; +} + +interface MSDescription extends RTCStats { + connectivity?: MSConnectivity; + transport?: RTCIceProtocol; + networkconnectivity?: MSNetworkConnectivityInfo; + localAddr?: MSIPAddressInfo; + remoteAddr?: MSIPAddressInfo; + deviceDevName?: string; + reflexiveLocalIPAddr?: MSIPAddressInfo; +} + +interface MSFIDOCredentialParameters extends MSCredentialParameters { + algorithm?: string | Algorithm; + authenticators?: AAGUID[]; +} + +interface MSIPAddressInfo { + ipAddr?: string; + port?: number; + manufacturerMacAddrMask?: string; +} + +interface MSIceWarningFlags { + turnTcpTimedOut?: boolean; + turnUdpAllocateFailed?: boolean; + turnUdpSendFailed?: boolean; + turnTcpAllocateFailed?: boolean; + turnTcpSendFailed?: boolean; + udpLocalConnectivityFailed?: boolean; + udpNatConnectivityFailed?: boolean; + udpRelayConnectivityFailed?: boolean; + tcpNatConnectivityFailed?: boolean; + tcpRelayConnectivityFailed?: boolean; + connCheckMessageIntegrityFailed?: boolean; + allocationMessageIntegrityFailed?: boolean; + connCheckOtherError?: boolean; + turnAuthUnknownUsernameError?: boolean; + noRelayServersConfigured?: boolean; + multipleRelayServersAttempted?: boolean; + portRangeExhausted?: boolean; + alternateServerReceived?: boolean; + pseudoTLSFailure?: boolean; + turnTurnTcpConnectivityFailed?: boolean; + useCandidateChecksFailed?: boolean; + fipsAllocationFailure?: boolean; +} + +interface MSJitter { + interArrival?: number; + interArrivalMax?: number; + interArrivalSD?: number; +} + +interface MSLocalClientEventBase extends RTCStats { + networkReceiveQualityEventRatio?: number; + networkBandwidthLowEventRatio?: number; +} + +interface MSNetwork extends RTCStats { + jitter?: MSJitter; + delay?: MSDelay; + packetLoss?: MSPacketLoss; + utilization?: MSUtilization; +} + +interface MSNetworkConnectivityInfo { + vpn?: boolean; + linkspeed?: number; + networkConnectionDetails?: string; +} + +interface MSNetworkInterfaceType { + interfaceTypeEthernet?: boolean; + interfaceTypeWireless?: boolean; + interfaceTypePPP?: boolean; + interfaceTypeTunnel?: boolean; + interfaceTypeWWAN?: boolean; +} + +interface MSOutboundNetwork extends MSNetwork { + appliedBandwidthLimit?: number; +} + +interface MSPacketLoss { + lossRate?: number; + lossRateMax?: number; +} + +interface MSPayloadBase extends RTCStats { + payloadDescription?: string; +} + +interface MSPortRange { + min?: number; + max?: number; +} + +interface MSRelayAddress { + relayAddress?: string; + port?: number; +} + +interface MSSignatureParameters { + userPrompt?: string; +} + +interface MSTransportDiagnosticsStats extends RTCStats { + baseAddress?: string; + localAddress?: string; + localSite?: string; + networkName?: string; + remoteAddress?: string; + remoteSite?: string; + localMR?: string; + remoteMR?: string; + iceWarningFlags?: MSIceWarningFlags; + portRangeMin?: number; + portRangeMax?: number; + localMRTCPPort?: number; + remoteMRTCPPort?: number; + stunVer?: number; + numConsentReqSent?: number; + numConsentReqReceived?: number; + numConsentRespSent?: number; + numConsentRespReceived?: number; + interfaces?: MSNetworkInterfaceType; + baseInterface?: MSNetworkInterfaceType; + protocol?: RTCIceProtocol; + localInterface?: MSNetworkInterfaceType; + localAddrType?: MSIceAddrType; + remoteAddrType?: MSIceAddrType; + iceRole?: RTCIceRole; + rtpRtcpMux?: boolean; + allocationTimeInMs?: number; + msRtcEngineVersion?: string; +} + +interface MSUtilization { + packets?: number; + bandwidthEstimation?: number; + bandwidthEstimationMin?: number; + bandwidthEstimationMax?: number; + bandwidthEstimationStdDev?: number; + bandwidthEstimationAvg?: number; +} + +interface MSVideoPayload extends MSPayloadBase { + resolution?: string; + videoBitRateAvg?: number; + videoBitRateMax?: number; + videoFrameRateAvg?: number; + videoPacketLossRate?: number; + durationSeconds?: number; +} + +interface MSVideoRecvPayload extends MSVideoPayload { + videoFrameLossRate?: number; + recvCodecType?: string; + recvResolutionWidth?: number; + recvResolutionHeight?: number; + videoResolutions?: MSVideoResolutionDistribution; + recvFrameRateAverage?: number; + recvBitRateMaximum?: number; + recvBitRateAverage?: number; + recvVideoStreamsMax?: number; + recvVideoStreamsMin?: number; + recvVideoStreamsMode?: number; + videoPostFECPLR?: number; + lowBitRateCallPercent?: number; + lowFrameRateCallPercent?: number; + reorderBufferTotalPackets?: number; + recvReorderBufferReorderedPackets?: number; + recvReorderBufferPacketsDroppedDueToBufferExhaustion?: number; + recvReorderBufferMaxSuccessfullyOrderedExtent?: number; + recvReorderBufferMaxSuccessfullyOrderedLateTime?: number; + recvReorderBufferPacketsDroppedDueToTimeout?: number; + recvFpsHarmonicAverage?: number; + recvNumResSwitches?: number; +} + +interface MSVideoResolutionDistribution { + cifQuality?: number; + vgaQuality?: number; + h720Quality?: number; + h1080Quality?: number; + h1440Quality?: number; + h2160Quality?: number; +} + +interface MSVideoSendPayload extends MSVideoPayload { + sendFrameRateAverage?: number; + sendBitRateMaximum?: number; + sendBitRateAverage?: number; + sendVideoStreamsMax?: number; + sendResolutionWidth?: number; + sendResolutionHeight?: number; +} + +interface MediaEncryptedEventInit extends EventInit { + initDataType?: string; + initData?: ArrayBuffer; +} + +interface MediaKeyMessageEventInit extends EventInit { + messageType?: MediaKeyMessageType; + message?: ArrayBuffer; +} + +interface MediaKeySystemConfiguration { + initDataTypes?: string[]; + audioCapabilities?: MediaKeySystemMediaCapability[]; + videoCapabilities?: MediaKeySystemMediaCapability[]; + distinctiveIdentifier?: MediaKeysRequirement; + persistentState?: MediaKeysRequirement; +} + +interface MediaKeySystemMediaCapability { + contentType?: string; + robustness?: string; +} + +interface MediaStreamConstraints { + video?: boolean | MediaTrackConstraints; + audio?: boolean | MediaTrackConstraints; +} + +interface MediaStreamErrorEventInit extends EventInit { + error?: MediaStreamError; +} + +interface MediaStreamEventInit extends EventInit { + stream?: MediaStream; +} + +interface MediaStreamTrackEventInit extends EventInit { + track?: MediaStreamTrack; +} + +interface MediaTrackCapabilities { + width?: number | LongRange; + height?: number | LongRange; + aspectRatio?: number | DoubleRange; + frameRate?: number | DoubleRange; + facingMode?: string; + volume?: number | DoubleRange; + sampleRate?: number | LongRange; + sampleSize?: number | LongRange; + echoCancellation?: boolean[]; + deviceId?: string; + groupId?: string; +} + +interface MediaTrackConstraintSet { + width?: number | ConstrainLongRange; + height?: number | ConstrainLongRange; + aspectRatio?: number | ConstrainDoubleRange; + frameRate?: number | ConstrainDoubleRange; + facingMode?: string | string[] | ConstrainDOMStringParameters; + volume?: number | ConstrainDoubleRange; + sampleRate?: number | ConstrainLongRange; + sampleSize?: number | ConstrainLongRange; + echoCancelation?: boolean | ConstrainBooleanParameters; + deviceId?: string | string[] | ConstrainDOMStringParameters; + groupId?: string | string[] | ConstrainDOMStringParameters; +} + +interface MediaTrackConstraints extends MediaTrackConstraintSet { + advanced?: MediaTrackConstraintSet[]; +} + +interface MediaTrackSettings { + width?: number; + height?: number; + aspectRatio?: number; + frameRate?: number; + facingMode?: string; + volume?: number; + sampleRate?: number; + sampleSize?: number; + echoCancellation?: boolean; + deviceId?: string; + groupId?: string; +} + +interface MediaTrackSupportedConstraints { + width?: boolean; + height?: boolean; + aspectRatio?: boolean; + frameRate?: boolean; + facingMode?: boolean; + volume?: boolean; + sampleRate?: boolean; + sampleSize?: boolean; + echoCancellation?: boolean; + deviceId?: boolean; + groupId?: boolean; +} + +interface MessageEventInit extends EventInit { + lastEventId?: string; + channel?: string; + data?: any; + origin?: string; + source?: Window; + ports?: MessagePort[]; +} + +interface MouseEventInit extends EventModifierInit { + screenX?: number; + screenY?: number; + clientX?: number; + clientY?: number; + button?: number; + buttons?: number; + relatedTarget?: EventTarget; +} + +interface MsZoomToOptions { + contentX?: number; + contentY?: number; + viewportX?: string; + viewportY?: string; + scaleFactor?: number; + animate?: string; +} + +interface MutationObserverInit { + childList?: boolean; + attributes?: boolean; + characterData?: boolean; + subtree?: boolean; + attributeOldValue?: boolean; + characterDataOldValue?: boolean; + attributeFilter?: string[]; +} + +interface NotificationOptions { + dir?: NotificationDirection; + lang?: string; + body?: string; + tag?: string; + icon?: string; +} + +interface ObjectURLOptions { + oneTimeOnly?: boolean; +} + +interface PaymentCurrencyAmount { + currency?: string; + value?: string; + currencySystem?: string; +} + +interface PaymentDetails { + total?: PaymentItem; + displayItems?: PaymentItem[]; + shippingOptions?: PaymentShippingOption[]; + modifiers?: PaymentDetailsModifier[]; + error?: string; +} + +interface PaymentDetailsModifier { + supportedMethods?: string[]; + total?: PaymentItem; + additionalDisplayItems?: PaymentItem[]; + data?: any; +} + +interface PaymentItem { + label?: string; + amount?: PaymentCurrencyAmount; + pending?: boolean; +} + +interface PaymentMethodData { + supportedMethods?: string[]; + data?: any; +} + +interface PaymentOptions { + requestPayerName?: boolean; + requestPayerEmail?: boolean; + requestPayerPhone?: boolean; + requestShipping?: boolean; + shippingType?: string; +} + +interface PaymentRequestUpdateEventInit extends EventInit { +} + +interface PaymentShippingOption { + id?: string; + label?: string; + amount?: PaymentCurrencyAmount; + selected?: boolean; +} + +interface PeriodicWaveConstraints { + disableNormalization?: boolean; +} + +interface PointerEventInit extends MouseEventInit { + pointerId?: number; + width?: number; + height?: number; + pressure?: number; + tiltX?: number; + tiltY?: number; + pointerType?: string; + isPrimary?: boolean; +} + +interface PopStateEventInit extends EventInit { + state?: any; +} + +interface PositionOptions { + enableHighAccuracy?: boolean; + timeout?: number; + maximumAge?: number; +} + +interface ProgressEventInit extends EventInit { + lengthComputable?: boolean; + loaded?: number; + total?: number; +} + +interface PushSubscriptionOptionsInit { + userVisibleOnly?: boolean; + applicationServerKey?: any; +} + +interface RTCConfiguration { + iceServers?: RTCIceServer[]; + iceTransportPolicy?: RTCIceTransportPolicy; + bundlePolicy?: RTCBundlePolicy; + peerIdentity?: string; +} + +interface RTCDTMFToneChangeEventInit extends EventInit { + tone?: string; +} + +interface RTCDtlsFingerprint { + algorithm?: string; + value?: string; +} + +interface RTCDtlsParameters { + role?: RTCDtlsRole; + fingerprints?: RTCDtlsFingerprint[]; +} + +interface RTCIceCandidateAttributes extends RTCStats { + ipAddress?: string; + portNumber?: number; + transport?: string; + candidateType?: RTCStatsIceCandidateType; + priority?: number; + addressSourceUrl?: string; +} + +interface RTCIceCandidateComplete { +} + +interface RTCIceCandidateDictionary { + foundation?: string; + priority?: number; + ip?: string; + protocol?: RTCIceProtocol; + port?: number; + type?: RTCIceCandidateType; + tcpType?: RTCIceTcpCandidateType; + relatedAddress?: string; + relatedPort?: number; + msMTurnSessionId?: string; +} + +interface RTCIceCandidateInit { + candidate?: string; + sdpMid?: string; + sdpMLineIndex?: number; +} + +interface RTCIceCandidatePair { + local?: RTCIceCandidateDictionary; + remote?: RTCIceCandidateDictionary; +} + +interface RTCIceCandidatePairStats extends RTCStats { + transportId?: string; + localCandidateId?: string; + remoteCandidateId?: string; + state?: RTCStatsIceCandidatePairState; + priority?: number; + nominated?: boolean; + writable?: boolean; + readable?: boolean; + bytesSent?: number; + bytesReceived?: number; + roundTripTime?: number; + availableOutgoingBitrate?: number; + availableIncomingBitrate?: number; +} + +interface RTCIceGatherOptions { + gatherPolicy?: RTCIceGatherPolicy; + iceservers?: RTCIceServer[]; + portRange?: MSPortRange; +} + +interface RTCIceParameters { + usernameFragment?: string; + password?: string; + iceLite?: boolean; +} + +interface RTCIceServer { + urls?: any; + username?: string; + credential?: string; +} + +interface RTCInboundRTPStreamStats extends RTCRTPStreamStats { + packetsReceived?: number; + bytesReceived?: number; + packetsLost?: number; + jitter?: number; + fractionLost?: number; +} + +interface RTCMediaStreamTrackStats extends RTCStats { + trackIdentifier?: string; + remoteSource?: boolean; + ssrcIds?: string[]; + frameWidth?: number; + frameHeight?: number; + framesPerSecond?: number; + framesSent?: number; + framesReceived?: number; + framesDecoded?: number; + framesDropped?: number; + framesCorrupted?: number; + audioLevel?: number; + echoReturnLoss?: number; + echoReturnLossEnhancement?: number; +} + +interface RTCOfferOptions { + offerToReceiveVideo?: number; + offerToReceiveAudio?: number; + voiceActivityDetection?: boolean; + iceRestart?: boolean; +} + +interface RTCOutboundRTPStreamStats extends RTCRTPStreamStats { + packetsSent?: number; + bytesSent?: number; + targetBitrate?: number; + roundTripTime?: number; +} + +interface RTCPeerConnectionIceEventInit extends EventInit { + candidate?: RTCIceCandidate; +} + +interface RTCRTPStreamStats extends RTCStats { + ssrc?: string; + associateStatsId?: string; + isRemote?: boolean; + mediaTrackId?: string; + transportId?: string; + codecId?: string; + firCount?: number; + pliCount?: number; + nackCount?: number; + sliCount?: number; +} + +interface RTCRtcpFeedback { + type?: string; + parameter?: string; +} + +interface RTCRtcpParameters { + ssrc?: number; + cname?: string; + reducedSize?: boolean; + mux?: boolean; +} + +interface RTCRtpCapabilities { + codecs?: RTCRtpCodecCapability[]; + headerExtensions?: RTCRtpHeaderExtension[]; + fecMechanisms?: string[]; +} + +interface RTCRtpCodecCapability { + name?: string; + kind?: string; + clockRate?: number; + preferredPayloadType?: number; + maxptime?: number; + ptime?: number; + numChannels?: number; + rtcpFeedback?: RTCRtcpFeedback[]; + parameters?: any; + options?: any; + maxTemporalLayers?: number; + maxSpatialLayers?: number; + svcMultiStreamSupport?: boolean; +} + +interface RTCRtpCodecParameters { + name?: string; + payloadType?: any; + clockRate?: number; + maxptime?: number; + ptime?: number; + numChannels?: number; + rtcpFeedback?: RTCRtcpFeedback[]; + parameters?: any; +} + +interface RTCRtpContributingSource { + timestamp?: number; + csrc?: number; + audioLevel?: number; +} + +interface RTCRtpEncodingParameters { + ssrc?: number; + codecPayloadType?: number; + fec?: RTCRtpFecParameters; + rtx?: RTCRtpRtxParameters; + priority?: number; + maxBitrate?: number; + minQuality?: number; + resolutionScale?: number; + framerateScale?: number; + maxFramerate?: number; + active?: boolean; + encodingId?: string; + dependencyEncodingIds?: string[]; + ssrcRange?: RTCSsrcRange; +} + +interface RTCRtpFecParameters { + ssrc?: number; + mechanism?: string; +} + +interface RTCRtpHeaderExtension { + kind?: string; + uri?: string; + preferredId?: number; + preferredEncrypt?: boolean; +} + +interface RTCRtpHeaderExtensionParameters { + uri?: string; + id?: number; + encrypt?: boolean; +} + +interface RTCRtpParameters { + muxId?: string; + codecs?: RTCRtpCodecParameters[]; + headerExtensions?: RTCRtpHeaderExtensionParameters[]; + encodings?: RTCRtpEncodingParameters[]; + rtcp?: RTCRtcpParameters; + degradationPreference?: RTCDegradationPreference; +} + +interface RTCRtpRtxParameters { + ssrc?: number; +} + +interface RTCRtpUnhandled { + ssrc?: number; + payloadType?: number; + muxId?: string; +} + +interface RTCSessionDescriptionInit { + type?: RTCSdpType; + sdp?: string; +} + +interface RTCSrtpKeyParam { + keyMethod?: string; + keySalt?: string; + lifetime?: string; + mkiValue?: number; + mkiLength?: number; +} + +interface RTCSrtpSdesParameters { + tag?: number; + cryptoSuite?: string; + keyParams?: RTCSrtpKeyParam[]; + sessionParams?: string[]; +} + +interface RTCSsrcRange { + min?: number; + max?: number; +} + +interface RTCStats { + timestamp?: number; + type?: RTCStatsType; + id?: string; + msType?: MSStatsType; +} + +interface RTCStatsReport { +} + +interface RTCTransportStats extends RTCStats { + bytesSent?: number; + bytesReceived?: number; + rtcpTransportStatsId?: string; + activeConnection?: boolean; + selectedCandidatePairId?: string; + localCertificateId?: string; + remoteCertificateId?: string; +} + +interface RegistrationOptions { + scope?: string; +} + +interface RequestInit { + method?: string; + headers?: any; + body?: any; + referrer?: string; + referrerPolicy?: ReferrerPolicy; + mode?: RequestMode; + credentials?: RequestCredentials; + cache?: RequestCache; + redirect?: RequestRedirect; + integrity?: string; + keepalive?: boolean; + window?: any; +} + +interface ResponseInit { + status?: number; + statusText?: string; + headers?: any; +} + +interface ScopedCredentialDescriptor { + type?: ScopedCredentialType; + id?: any; + transports?: Transport[]; +} + +interface ScopedCredentialOptions { + timeoutSeconds?: number; + rpId?: USVString; + excludeList?: ScopedCredentialDescriptor[]; + extensions?: WebAuthnExtensions; +} + +interface ScopedCredentialParameters { + type?: ScopedCredentialType; + algorithm?: string | Algorithm; +} + +interface ServiceWorkerMessageEventInit extends EventInit { + data?: any; + origin?: string; + lastEventId?: string; + source?: ServiceWorker | MessagePort; + ports?: MessagePort[]; +} + +interface SpeechSynthesisEventInit extends EventInit { + utterance?: SpeechSynthesisUtterance; + charIndex?: number; + elapsedTime?: number; + name?: string; +} + +interface StoreExceptionsInformation extends ExceptionInformation { + siteName?: string; + explanationString?: string; + detailURI?: string; +} + +interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { + arrayOfDomainStrings?: string[]; +} + +interface TrackEventInit extends EventInit { + track?: VideoTrack | AudioTrack | TextTrack; +} + +interface TransitionEventInit extends EventInit { + propertyName?: string; + elapsedTime?: number; +} + +interface UIEventInit extends EventInit { + view?: Window; + detail?: number; +} + +interface WebAuthnExtensions { +} + +interface WebGLContextAttributes { + failIfMajorPerformanceCaveat?: boolean; + alpha?: boolean; + depth?: boolean; + stencil?: boolean; + antialias?: boolean; + premultipliedAlpha?: boolean; + preserveDrawingBuffer?: boolean; +} + +interface WebGLContextEventInit extends EventInit { + statusMessage?: string; +} + +interface WheelEventInit extends MouseEventInit { + deltaX?: number; + deltaY?: number; + deltaZ?: number; + deltaMode?: number; +} + +interface EventListener { + (evt: Event): void; +} + +interface WebKitEntriesCallback { + (evt: Event): void; +} + +interface WebKitErrorCallback { + (evt: Event): void; +} + +interface WebKitFileCallback { + (evt: Event): void; +} + +interface ANGLE_instanced_arrays { + drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void; + drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void; + vertexAttribDivisorANGLE(index: number, divisor: number): void; + readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; +} + +declare var ANGLE_instanced_arrays: { + prototype: ANGLE_instanced_arrays; + new(): ANGLE_instanced_arrays; + readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; +} + +interface AnalyserNode extends AudioNode { + fftSize: number; + readonly frequencyBinCount: number; + maxDecibels: number; + minDecibels: number; + smoothingTimeConstant: number; + getByteFrequencyData(array: Uint8Array): void; + getByteTimeDomainData(array: Uint8Array): void; + getFloatFrequencyData(array: Float32Array): void; + getFloatTimeDomainData(array: Float32Array): void; +} + +declare var AnalyserNode: { + prototype: AnalyserNode; + new(): AnalyserNode; +} + +interface AnimationEvent extends Event { + readonly animationName: string; + readonly elapsedTime: number; + initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; +} + +declare var AnimationEvent: { + prototype: AnimationEvent; + new(typeArg: string, eventInitDict?: AnimationEventInit): AnimationEvent; +} + +interface ApplicationCacheEventMap { + "cached": Event; + "checking": Event; + "downloading": Event; + "error": Event; + "noupdate": Event; + "obsolete": Event; + "progress": ProgressEvent; + "updateready": Event; +} + +interface ApplicationCache extends EventTarget { + oncached: (this: ApplicationCache, ev: Event) => any; + onchecking: (this: ApplicationCache, ev: Event) => any; + ondownloading: (this: ApplicationCache, ev: Event) => any; + onerror: (this: ApplicationCache, ev: Event) => any; + onnoupdate: (this: ApplicationCache, ev: Event) => any; + onobsolete: (this: ApplicationCache, ev: Event) => any; + onprogress: (this: ApplicationCache, ev: ProgressEvent) => any; + onupdateready: (this: ApplicationCache, ev: Event) => any; + readonly status: number; + abort(): void; + swapCache(): void; + update(): void; + readonly CHECKING: number; + readonly DOWNLOADING: number; + readonly IDLE: number; + readonly OBSOLETE: number; + readonly UNCACHED: number; + readonly UPDATEREADY: number; + addEventListener(type: K, listener: (this: ApplicationCache, ev: ApplicationCacheEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ApplicationCache: { + prototype: ApplicationCache; + new(): ApplicationCache; + readonly CHECKING: number; + readonly DOWNLOADING: number; + readonly IDLE: number; + readonly OBSOLETE: number; + readonly UNCACHED: number; + readonly UPDATEREADY: number; +} + +interface Attr extends Node { + readonly name: string; + readonly ownerElement: Element; + readonly prefix: string | null; + readonly specified: boolean; + value: string; +} + +declare var Attr: { + prototype: Attr; + new(): Attr; +} + +interface AudioBuffer { + readonly duration: number; + readonly length: number; + readonly numberOfChannels: number; + readonly sampleRate: number; + copyFromChannel(destination: Float32Array, channelNumber: number, startInChannel?: number): void; + copyToChannel(source: Float32Array, channelNumber: number, startInChannel?: number): void; + getChannelData(channel: number): Float32Array; +} + +declare var AudioBuffer: { + prototype: AudioBuffer; + new(): AudioBuffer; +} + +interface AudioBufferSourceNodeEventMap { + "ended": MediaStreamErrorEvent; +} + +interface AudioBufferSourceNode extends AudioNode { + buffer: AudioBuffer | null; + readonly detune: AudioParam; + loop: boolean; + loopEnd: number; + loopStart: number; + onended: (this: AudioBufferSourceNode, ev: MediaStreamErrorEvent) => any; + readonly playbackRate: AudioParam; + start(when?: number, offset?: number, duration?: number): void; + stop(when?: number): void; + addEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioBufferSourceNodeEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var AudioBufferSourceNode: { + prototype: AudioBufferSourceNode; + new(): AudioBufferSourceNode; +} + +interface AudioContextEventMap { + "statechange": Event; +} + +interface AudioContextBase extends EventTarget { + readonly currentTime: number; + readonly destination: AudioDestinationNode; + readonly listener: AudioListener; + onstatechange: (this: AudioContext, ev: Event) => any; + readonly sampleRate: number; + readonly state: AudioContextState; + close(): Promise; + createAnalyser(): AnalyserNode; + createBiquadFilter(): BiquadFilterNode; + createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; + createBufferSource(): AudioBufferSourceNode; + createChannelMerger(numberOfInputs?: number): ChannelMergerNode; + createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode; + createConvolver(): ConvolverNode; + createDelay(maxDelayTime?: number): DelayNode; + createDynamicsCompressor(): DynamicsCompressorNode; + createGain(): GainNode; + createIIRFilter(feedforward: number[], feedback: number[]): IIRFilterNode; + createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode; + createMediaStreamSource(mediaStream: MediaStream): MediaStreamAudioSourceNode; + createOscillator(): OscillatorNode; + createPanner(): PannerNode; + createPeriodicWave(real: Float32Array, imag: Float32Array, constraints?: PeriodicWaveConstraints): PeriodicWave; + createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode; + createStereoPanner(): StereoPannerNode; + createWaveShaper(): WaveShaperNode; + decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): Promise; + resume(): Promise; + addEventListener(type: K, listener: (this: AudioContext, ev: AudioContextEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface AudioContext extends AudioContextBase { + suspend(): Promise; +} + +declare var AudioContext: { + prototype: AudioContext; + new(): AudioContext; +} + +interface AudioDestinationNode extends AudioNode { + readonly maxChannelCount: number; +} + +declare var AudioDestinationNode: { + prototype: AudioDestinationNode; + new(): AudioDestinationNode; +} + +interface AudioListener { + dopplerFactor: number; + speedOfSound: number; + setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void; + setPosition(x: number, y: number, z: number): void; + setVelocity(x: number, y: number, z: number): void; +} + +declare var AudioListener: { + prototype: AudioListener; + new(): AudioListener; +} + +interface AudioNode extends EventTarget { + channelCount: number; + channelCountMode: ChannelCountMode; + channelInterpretation: ChannelInterpretation; + readonly context: AudioContext; + readonly numberOfInputs: number; + readonly numberOfOutputs: number; + connect(destination: AudioNode, output?: number, input?: number): AudioNode; + connect(destination: AudioParam, output?: number): void; + disconnect(output?: number): void; + disconnect(destination: AudioNode, output?: number, input?: number): void; + disconnect(destination: AudioParam, output?: number): void; +} + +declare var AudioNode: { + prototype: AudioNode; + new(): AudioNode; +} + +interface AudioParam { + readonly defaultValue: number; + value: number; + cancelScheduledValues(startTime: number): AudioParam; + exponentialRampToValueAtTime(value: number, endTime: number): AudioParam; + linearRampToValueAtTime(value: number, endTime: number): AudioParam; + setTargetAtTime(target: number, startTime: number, timeConstant: number): AudioParam; + setValueAtTime(value: number, startTime: number): AudioParam; + setValueCurveAtTime(values: Float32Array, startTime: number, duration: number): AudioParam; +} + +declare var AudioParam: { + prototype: AudioParam; + new(): AudioParam; +} + +interface AudioProcessingEvent extends Event { + readonly inputBuffer: AudioBuffer; + readonly outputBuffer: AudioBuffer; + readonly playbackTime: number; +} + +declare var AudioProcessingEvent: { + prototype: AudioProcessingEvent; + new(): AudioProcessingEvent; +} + +interface AudioTrack { + enabled: boolean; + readonly id: string; + kind: string; + readonly label: string; + language: string; + readonly sourceBuffer: SourceBuffer; +} + +declare var AudioTrack: { + prototype: AudioTrack; + new(): AudioTrack; +} + +interface AudioTrackListEventMap { + "addtrack": TrackEvent; + "change": Event; + "removetrack": TrackEvent; +} + +interface AudioTrackList extends EventTarget { + readonly length: number; + onaddtrack: (this: AudioTrackList, ev: TrackEvent) => any; + onchange: (this: AudioTrackList, ev: Event) => any; + onremovetrack: (this: AudioTrackList, ev: TrackEvent) => any; + getTrackById(id: string): AudioTrack | null; + item(index: number): AudioTrack; + addEventListener(type: K, listener: (this: AudioTrackList, ev: AudioTrackListEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: AudioTrack; +} + +declare var AudioTrackList: { + prototype: AudioTrackList; + new(): AudioTrackList; +} + +interface BarProp { + readonly visible: boolean; +} + +declare var BarProp: { + prototype: BarProp; + new(): BarProp; +} + +interface BeforeUnloadEvent extends Event { + returnValue: any; +} + +declare var BeforeUnloadEvent: { + prototype: BeforeUnloadEvent; + new(): BeforeUnloadEvent; +} + +interface BiquadFilterNode extends AudioNode { + readonly Q: AudioParam; + readonly detune: AudioParam; + readonly frequency: AudioParam; + readonly gain: AudioParam; + type: BiquadFilterType; + getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void; +} + +declare var BiquadFilterNode: { + prototype: BiquadFilterNode; + new(): BiquadFilterNode; +} + +interface Blob { + readonly size: number; + readonly type: string; + msClose(): void; + msDetachStream(): any; + slice(start?: number, end?: number, contentType?: string): Blob; +} + +declare var Blob: { + prototype: Blob; + new (blobParts?: any[], options?: BlobPropertyBag): Blob; +} + +interface CDATASection extends Text { +} + +declare var CDATASection: { + prototype: CDATASection; + new(): CDATASection; +} + +interface CSS { + supports(property: string, value?: string): boolean; +} +declare var CSS: CSS; + +interface CSSConditionRule extends CSSGroupingRule { + conditionText: string; +} + +declare var CSSConditionRule: { + prototype: CSSConditionRule; + new(): CSSConditionRule; +} + +interface CSSFontFaceRule extends CSSRule { + readonly style: CSSStyleDeclaration; +} + +declare var CSSFontFaceRule: { + prototype: CSSFontFaceRule; + new(): CSSFontFaceRule; +} + +interface CSSGroupingRule extends CSSRule { + readonly cssRules: CSSRuleList; + deleteRule(index: number): void; + insertRule(rule: string, index: number): number; +} + +declare var CSSGroupingRule: { + prototype: CSSGroupingRule; + new(): CSSGroupingRule; +} + +interface CSSImportRule extends CSSRule { + readonly href: string; + readonly media: MediaList; + readonly styleSheet: CSSStyleSheet; +} + +declare var CSSImportRule: { + prototype: CSSImportRule; + new(): CSSImportRule; +} + +interface CSSKeyframeRule extends CSSRule { + keyText: string; + readonly style: CSSStyleDeclaration; +} + +declare var CSSKeyframeRule: { + prototype: CSSKeyframeRule; + new(): CSSKeyframeRule; +} + +interface CSSKeyframesRule extends CSSRule { + readonly cssRules: CSSRuleList; + name: string; + appendRule(rule: string): void; + deleteRule(rule: string): void; + findRule(rule: string): CSSKeyframeRule; +} + +declare var CSSKeyframesRule: { + prototype: CSSKeyframesRule; + new(): CSSKeyframesRule; +} + +interface CSSMediaRule extends CSSConditionRule { + readonly media: MediaList; +} + +declare var CSSMediaRule: { + prototype: CSSMediaRule; + new(): CSSMediaRule; +} + +interface CSSNamespaceRule extends CSSRule { + readonly namespaceURI: string; + readonly prefix: string; +} + +declare var CSSNamespaceRule: { + prototype: CSSNamespaceRule; + new(): CSSNamespaceRule; +} + +interface CSSPageRule extends CSSRule { + readonly pseudoClass: string; + readonly selector: string; + selectorText: string; + readonly style: CSSStyleDeclaration; +} + +declare var CSSPageRule: { + prototype: CSSPageRule; + new(): CSSPageRule; +} + +interface CSSRule { + cssText: string; + readonly parentRule: CSSRule; + readonly parentStyleSheet: CSSStyleSheet; + readonly type: number; + readonly CHARSET_RULE: number; + readonly FONT_FACE_RULE: number; + readonly IMPORT_RULE: number; + readonly KEYFRAMES_RULE: number; + readonly KEYFRAME_RULE: number; + readonly MEDIA_RULE: number; + readonly NAMESPACE_RULE: number; + readonly PAGE_RULE: number; + readonly STYLE_RULE: number; + readonly SUPPORTS_RULE: number; + readonly UNKNOWN_RULE: number; + readonly VIEWPORT_RULE: number; +} + +declare var CSSRule: { + prototype: CSSRule; + new(): CSSRule; + readonly CHARSET_RULE: number; + readonly FONT_FACE_RULE: number; + readonly IMPORT_RULE: number; + readonly KEYFRAMES_RULE: number; + readonly KEYFRAME_RULE: number; + readonly MEDIA_RULE: number; + readonly NAMESPACE_RULE: number; + readonly PAGE_RULE: number; + readonly STYLE_RULE: number; + readonly SUPPORTS_RULE: number; + readonly UNKNOWN_RULE: number; + readonly VIEWPORT_RULE: number; +} + +interface CSSRuleList { + readonly length: number; + item(index: number): CSSRule; + [index: number]: CSSRule; +} + +declare var CSSRuleList: { + prototype: CSSRuleList; + new(): CSSRuleList; +} + +interface CSSStyleDeclaration { + alignContent: string | null; + alignItems: string | null; + alignSelf: string | null; + alignmentBaseline: string | null; + animation: string | null; + animationDelay: string | null; + animationDirection: string | null; + animationDuration: string | null; + animationFillMode: string | null; + animationIterationCount: string | null; + animationName: string | null; + animationPlayState: string | null; + animationTimingFunction: string | null; + backfaceVisibility: string | null; + background: string | null; + backgroundAttachment: string | null; + backgroundClip: string | null; + backgroundColor: string | null; + backgroundImage: string | null; + backgroundOrigin: string | null; + backgroundPosition: string | null; + backgroundPositionX: string | null; + backgroundPositionY: string | null; + backgroundRepeat: string | null; + backgroundSize: string | null; + baselineShift: string | null; + border: string | null; + borderBottom: string | null; + borderBottomColor: string | null; + borderBottomLeftRadius: string | null; + borderBottomRightRadius: string | null; + borderBottomStyle: string | null; + borderBottomWidth: string | null; + borderCollapse: string | null; + borderColor: string | null; + borderImage: string | null; + borderImageOutset: string | null; + borderImageRepeat: string | null; + borderImageSlice: string | null; + borderImageSource: string | null; + borderImageWidth: string | null; + borderLeft: string | null; + borderLeftColor: string | null; + borderLeftStyle: string | null; + borderLeftWidth: string | null; + borderRadius: string | null; + borderRight: string | null; + borderRightColor: string | null; + borderRightStyle: string | null; + borderRightWidth: string | null; + borderSpacing: string | null; + borderStyle: string | null; + borderTop: string | null; + borderTopColor: string | null; + borderTopLeftRadius: string | null; + borderTopRightRadius: string | null; + borderTopStyle: string | null; + borderTopWidth: string | null; + borderWidth: string | null; + bottom: string | null; + boxShadow: string | null; + boxSizing: string | null; + breakAfter: string | null; + breakBefore: string | null; + breakInside: string | null; + captionSide: string | null; + clear: string | null; + clip: string | null; + clipPath: string | null; + clipRule: string | null; + color: string | null; + colorInterpolationFilters: string | null; + columnCount: any; + columnFill: string | null; + columnGap: any; + columnRule: string | null; + columnRuleColor: any; + columnRuleStyle: string | null; + columnRuleWidth: any; + columnSpan: string | null; + columnWidth: any; + columns: string | null; + content: string | null; + counterIncrement: string | null; + counterReset: string | null; + cssFloat: string | null; + cssText: string; + cursor: string | null; + direction: string | null; + display: string | null; + dominantBaseline: string | null; + emptyCells: string | null; + enableBackground: string | null; + fill: string | null; + fillOpacity: string | null; + fillRule: string | null; + filter: string | null; + flex: string | null; + flexBasis: string | null; + flexDirection: string | null; + flexFlow: string | null; + flexGrow: string | null; + flexShrink: string | null; + flexWrap: string | null; + floodColor: string | null; + floodOpacity: string | null; + font: string | null; + fontFamily: string | null; + fontFeatureSettings: string | null; + fontSize: string | null; + fontSizeAdjust: string | null; + fontStretch: string | null; + fontStyle: string | null; + fontVariant: string | null; + fontWeight: string | null; + glyphOrientationHorizontal: string | null; + glyphOrientationVertical: string | null; + height: string | null; + imeMode: string | null; + justifyContent: string | null; + kerning: string | null; + layoutGrid: string | null; + layoutGridChar: string | null; + layoutGridLine: string | null; + layoutGridMode: string | null; + layoutGridType: string | null; + left: string | null; + readonly length: number; + letterSpacing: string | null; + lightingColor: string | null; + lineBreak: string | null; + lineHeight: string | null; + listStyle: string | null; + listStyleImage: string | null; + listStylePosition: string | null; + listStyleType: string | null; + margin: string | null; + marginBottom: string | null; + marginLeft: string | null; + marginRight: string | null; + marginTop: string | null; + marker: string | null; + markerEnd: string | null; + markerMid: string | null; + markerStart: string | null; + mask: string | null; + maxHeight: string | null; + maxWidth: string | null; + minHeight: string | null; + minWidth: string | null; + msContentZoomChaining: string | null; + msContentZoomLimit: string | null; + msContentZoomLimitMax: any; + msContentZoomLimitMin: any; + msContentZoomSnap: string | null; + msContentZoomSnapPoints: string | null; + msContentZoomSnapType: string | null; + msContentZooming: string | null; + msFlowFrom: string | null; + msFlowInto: string | null; + msFontFeatureSettings: string | null; + msGridColumn: any; + msGridColumnAlign: string | null; + msGridColumnSpan: any; + msGridColumns: string | null; + msGridRow: any; + msGridRowAlign: string | null; + msGridRowSpan: any; + msGridRows: string | null; + msHighContrastAdjust: string | null; + msHyphenateLimitChars: string | null; + msHyphenateLimitLines: any; + msHyphenateLimitZone: any; + msHyphens: string | null; + msImeAlign: string | null; + msOverflowStyle: string | null; + msScrollChaining: string | null; + msScrollLimit: string | null; + msScrollLimitXMax: any; + msScrollLimitXMin: any; + msScrollLimitYMax: any; + msScrollLimitYMin: any; + msScrollRails: string | null; + msScrollSnapPointsX: string | null; + msScrollSnapPointsY: string | null; + msScrollSnapType: string | null; + msScrollSnapX: string | null; + msScrollSnapY: string | null; + msScrollTranslation: string | null; + msTextCombineHorizontal: string | null; + msTextSizeAdjust: any; + msTouchAction: string | null; + msTouchSelect: string | null; + msUserSelect: string | null; + msWrapFlow: string; + msWrapMargin: any; + msWrapThrough: string; + opacity: string | null; + order: string | null; + orphans: string | null; + outline: string | null; + outlineColor: string | null; + outlineOffset: string | null; + outlineStyle: string | null; + outlineWidth: string | null; + overflow: string | null; + overflowX: string | null; + overflowY: string | null; + padding: string | null; + paddingBottom: string | null; + paddingLeft: string | null; + paddingRight: string | null; + paddingTop: string | null; + pageBreakAfter: string | null; + pageBreakBefore: string | null; + pageBreakInside: string | null; + readonly parentRule: CSSRule; + perspective: string | null; + perspectiveOrigin: string | null; + pointerEvents: string | null; + position: string | null; + quotes: string | null; + right: string | null; + rotate: string | null; + rubyAlign: string | null; + rubyOverhang: string | null; + rubyPosition: string | null; + scale: string | null; + stopColor: string | null; + stopOpacity: string | null; + stroke: string | null; + strokeDasharray: string | null; + strokeDashoffset: string | null; + strokeLinecap: string | null; + strokeLinejoin: string | null; + strokeMiterlimit: string | null; + strokeOpacity: string | null; + strokeWidth: string | null; + tableLayout: string | null; + textAlign: string | null; + textAlignLast: string | null; + textAnchor: string | null; + textDecoration: string | null; + textIndent: string | null; + textJustify: string | null; + textKashida: string | null; + textKashidaSpace: string | null; + textOverflow: string | null; + textShadow: string | null; + textTransform: string | null; + textUnderlinePosition: string | null; + top: string | null; + touchAction: string | null; + transform: string | null; + transformOrigin: string | null; + transformStyle: string | null; + transition: string | null; + transitionDelay: string | null; + transitionDuration: string | null; + transitionProperty: string | null; + transitionTimingFunction: string | null; + translate: string | null; + unicodeBidi: string | null; + verticalAlign: string | null; + visibility: string | null; + webkitAlignContent: string | null; + webkitAlignItems: string | null; + webkitAlignSelf: string | null; + webkitAnimation: string | null; + webkitAnimationDelay: string | null; + webkitAnimationDirection: string | null; + webkitAnimationDuration: string | null; + webkitAnimationFillMode: string | null; + webkitAnimationIterationCount: string | null; + webkitAnimationName: string | null; + webkitAnimationPlayState: string | null; + webkitAnimationTimingFunction: string | null; + webkitAppearance: string | null; + webkitBackfaceVisibility: string | null; + webkitBackgroundClip: string | null; + webkitBackgroundOrigin: string | null; + webkitBackgroundSize: string | null; + webkitBorderBottomLeftRadius: string | null; + webkitBorderBottomRightRadius: string | null; + webkitBorderImage: string | null; + webkitBorderRadius: string | null; + webkitBorderTopLeftRadius: string | null; + webkitBorderTopRightRadius: string | null; + webkitBoxAlign: string | null; + webkitBoxDirection: string | null; + webkitBoxFlex: string | null; + webkitBoxOrdinalGroup: string | null; + webkitBoxOrient: string | null; + webkitBoxPack: string | null; + webkitBoxSizing: string | null; + webkitColumnBreakAfter: string | null; + webkitColumnBreakBefore: string | null; + webkitColumnBreakInside: string | null; + webkitColumnCount: any; + webkitColumnGap: any; + webkitColumnRule: string | null; + webkitColumnRuleColor: any; + webkitColumnRuleStyle: string | null; + webkitColumnRuleWidth: any; + webkitColumnSpan: string | null; + webkitColumnWidth: any; + webkitColumns: string | null; + webkitFilter: string | null; + webkitFlex: string | null; + webkitFlexBasis: string | null; + webkitFlexDirection: string | null; + webkitFlexFlow: string | null; + webkitFlexGrow: string | null; + webkitFlexShrink: string | null; + webkitFlexWrap: string | null; + webkitJustifyContent: string | null; + webkitOrder: string | null; + webkitPerspective: string | null; + webkitPerspectiveOrigin: string | null; + webkitTapHighlightColor: string | null; + webkitTextFillColor: string | null; + webkitTextSizeAdjust: any; + webkitTextStroke: string | null; + webkitTextStrokeColor: string | null; + webkitTextStrokeWidth: string | null; + webkitTransform: string | null; + webkitTransformOrigin: string | null; + webkitTransformStyle: string | null; + webkitTransition: string | null; + webkitTransitionDelay: string | null; + webkitTransitionDuration: string | null; + webkitTransitionProperty: string | null; + webkitTransitionTimingFunction: string | null; + webkitUserModify: string | null; + webkitUserSelect: string | null; + webkitWritingMode: string | null; + whiteSpace: string | null; + widows: string | null; + width: string | null; + wordBreak: string | null; + wordSpacing: string | null; + wordWrap: string | null; + writingMode: string | null; + zIndex: string | null; + zoom: string | null; + resize: string | null; + userSelect: string | null; + getPropertyPriority(propertyName: string): string; + getPropertyValue(propertyName: string): string; + item(index: number): string; + removeProperty(propertyName: string): string; + setProperty(propertyName: string, value: string | null, priority?: string): void; + [index: number]: string; +} + +declare var CSSStyleDeclaration: { + prototype: CSSStyleDeclaration; + new(): CSSStyleDeclaration; +} + +interface CSSStyleRule extends CSSRule { + readonly readOnly: boolean; + selectorText: string; + readonly style: CSSStyleDeclaration; +} + +declare var CSSStyleRule: { + prototype: CSSStyleRule; + new(): CSSStyleRule; +} + +interface CSSStyleSheet extends StyleSheet { + readonly cssRules: CSSRuleList; + cssText: string; + readonly id: string; + readonly imports: StyleSheetList; + readonly isAlternate: boolean; + readonly isPrefAlternate: boolean; + readonly ownerRule: CSSRule; + readonly owningElement: Element; + readonly pages: StyleSheetPageList; + readonly readOnly: boolean; + readonly rules: CSSRuleList; + addImport(bstrURL: string, lIndex?: number): number; + addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; + addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; + deleteRule(index?: number): void; + insertRule(rule: string, index?: number): number; + removeImport(lIndex: number): void; + removeRule(lIndex: number): void; +} + +declare var CSSStyleSheet: { + prototype: CSSStyleSheet; + new(): CSSStyleSheet; +} + +interface CSSSupportsRule extends CSSConditionRule { +} + +declare var CSSSupportsRule: { + prototype: CSSSupportsRule; + new(): CSSSupportsRule; +} + +interface Cache { + add(request: RequestInfo): Promise; + addAll(requests: RequestInfo[]): Promise; + delete(request: RequestInfo, options?: CacheQueryOptions): Promise; + keys(request?: RequestInfo, options?: CacheQueryOptions): any; + match(request: RequestInfo, options?: CacheQueryOptions): Promise; + matchAll(request?: RequestInfo, options?: CacheQueryOptions): any; + put(request: RequestInfo, response: Response): Promise; +} + +declare var Cache: { + prototype: Cache; + new(): Cache; +} + +interface CacheStorage { + delete(cacheName: string): Promise; + has(cacheName: string): Promise; + keys(): any; + match(request: RequestInfo, options?: CacheQueryOptions): Promise; + open(cacheName: string): Promise; +} + +declare var CacheStorage: { + prototype: CacheStorage; + new(): CacheStorage; +} + +interface CanvasGradient { + addColorStop(offset: number, color: string): void; +} + +declare var CanvasGradient: { + prototype: CanvasGradient; + new(): CanvasGradient; +} + +interface CanvasPattern { + setTransform(matrix: SVGMatrix): void; +} + +declare var CanvasPattern: { + prototype: CanvasPattern; + new(): CanvasPattern; +} + +interface CanvasRenderingContext2D extends Object, CanvasPathMethods { + readonly canvas: HTMLCanvasElement; + fillStyle: string | CanvasGradient | CanvasPattern; + font: string; + globalAlpha: number; + globalCompositeOperation: string; + imageSmoothingEnabled: boolean; + lineCap: string; + lineDashOffset: number; + lineJoin: string; + lineWidth: number; + miterLimit: number; + msFillRule: CanvasFillRule; + shadowBlur: number; + shadowColor: string; + shadowOffsetX: number; + shadowOffsetY: number; + strokeStyle: string | CanvasGradient | CanvasPattern; + textAlign: string; + textBaseline: string; + mozImageSmoothingEnabled: boolean; + webkitImageSmoothingEnabled: boolean; + oImageSmoothingEnabled: boolean; + beginPath(): void; + clearRect(x: number, y: number, w: number, h: number): void; + clip(fillRule?: CanvasFillRule): void; + createImageData(imageDataOrSw: number | ImageData, sh?: number): ImageData; + createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; + createPattern(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, repetition: string): CanvasPattern; + createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; + drawFocusIfNeeded(element: Element): void; + drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, dstX: number, dstY: number): void; + drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, dstX: number, dstY: number, dstW: number, dstH: number): void; + drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, srcX: number, srcY: number, srcW: number, srcH: number, dstX: number, dstY: number, dstW: number, dstH: number): void; + fill(fillRule?: CanvasFillRule): void; + fillRect(x: number, y: number, w: number, h: number): void; + fillText(text: string, x: number, y: number, maxWidth?: number): void; + getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; + getLineDash(): number[]; + isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean; + measureText(text: string): TextMetrics; + putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; + restore(): void; + rotate(angle: number): void; + save(): void; + scale(x: number, y: number): void; + setLineDash(segments: number[]): void; + setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + stroke(path?: Path2D): void; + strokeRect(x: number, y: number, w: number, h: number): void; + strokeText(text: string, x: number, y: number, maxWidth?: number): void; + transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + translate(x: number, y: number): void; +} + +declare var CanvasRenderingContext2D: { + prototype: CanvasRenderingContext2D; + new(): CanvasRenderingContext2D; +} + +interface ChannelMergerNode extends AudioNode { +} + +declare var ChannelMergerNode: { + prototype: ChannelMergerNode; + new(): ChannelMergerNode; +} + +interface ChannelSplitterNode extends AudioNode { +} + +declare var ChannelSplitterNode: { + prototype: ChannelSplitterNode; + new(): ChannelSplitterNode; +} + +interface CharacterData extends Node, ChildNode { + data: string; + readonly length: number; + appendData(arg: string): void; + deleteData(offset: number, count: number): void; + insertData(offset: number, arg: string): void; + replaceData(offset: number, count: number, arg: string): void; + substringData(offset: number, count: number): string; +} + +declare var CharacterData: { + prototype: CharacterData; + new(): CharacterData; +} + +interface ClientRect { + bottom: number; + readonly height: number; + left: number; + right: number; + top: number; + readonly width: number; +} + +declare var ClientRect: { + prototype: ClientRect; + new(): ClientRect; +} + +interface ClientRectList { + readonly length: number; + item(index: number): ClientRect; + [index: number]: ClientRect; +} + +declare var ClientRectList: { + prototype: ClientRectList; + new(): ClientRectList; +} + +interface ClipboardEvent extends Event { + readonly clipboardData: DataTransfer; +} + +declare var ClipboardEvent: { + prototype: ClipboardEvent; + new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent; +} + +interface CloseEvent extends Event { + readonly code: number; + readonly reason: string; + readonly wasClean: boolean; + initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; +} + +declare var CloseEvent: { + prototype: CloseEvent; + new(typeArg: string, eventInitDict?: CloseEventInit): CloseEvent; +} + +interface Comment extends CharacterData { + text: string; +} + +declare var Comment: { + prototype: Comment; + new(): Comment; +} + +interface CompositionEvent extends UIEvent { + readonly data: string; + readonly locale: string; + initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; +} + +declare var CompositionEvent: { + prototype: CompositionEvent; + new(typeArg: string, eventInitDict?: CompositionEventInit): CompositionEvent; +} + +interface Console { + assert(test?: boolean, message?: string, ...optionalParams: any[]): void; + clear(): void; + count(countTitle?: string): void; + debug(message?: any, ...optionalParams: any[]): void; + dir(value?: any, ...optionalParams: any[]): void; + dirxml(value: any): void; + error(message?: any, ...optionalParams: any[]): void; + exception(message?: string, ...optionalParams: any[]): void; + group(groupTitle?: string): void; + groupCollapsed(groupTitle?: string): void; + groupEnd(): void; + info(message?: any, ...optionalParams: any[]): void; + log(message?: any, ...optionalParams: any[]): void; + msIsIndependentlyComposed(element: Element): boolean; + profile(reportName?: string): void; + profileEnd(): void; + select(element: Element): void; + table(...data: any[]): void; + time(timerName?: string): void; + timeEnd(timerName?: string): void; + trace(message?: any, ...optionalParams: any[]): void; + warn(message?: any, ...optionalParams: any[]): void; +} + +declare var Console: { + prototype: Console; + new(): Console; +} + +interface ConvolverNode extends AudioNode { + buffer: AudioBuffer | null; + normalize: boolean; +} + +declare var ConvolverNode: { + prototype: ConvolverNode; + new(): ConvolverNode; +} + +interface Coordinates { + readonly accuracy: number; + readonly altitude: number | null; + readonly altitudeAccuracy: number | null; + readonly heading: number | null; + readonly latitude: number; + readonly longitude: number; + readonly speed: number | null; +} + +declare var Coordinates: { + prototype: Coordinates; + new(): Coordinates; +} + +interface Crypto extends Object, RandomSource { + readonly subtle: SubtleCrypto; +} + +declare var Crypto: { + prototype: Crypto; + new(): Crypto; +} + +interface CryptoKey { + readonly algorithm: KeyAlgorithm; + readonly extractable: boolean; + readonly type: string; + readonly usages: string[]; +} + +declare var CryptoKey: { + prototype: CryptoKey; + new(): CryptoKey; +} + +interface CryptoKeyPair { + privateKey: CryptoKey; + publicKey: CryptoKey; +} + +declare var CryptoKeyPair: { + prototype: CryptoKeyPair; + new(): CryptoKeyPair; +} + +interface CustomEvent extends Event { + readonly detail: any; + initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; +} + +declare var CustomEvent: { + prototype: CustomEvent; + new(typeArg: string, eventInitDict?: CustomEventInit): CustomEvent; +} + +interface DOMError { + readonly name: string; + toString(): string; +} + +declare var DOMError: { + prototype: DOMError; + new(): DOMError; +} + +interface DOMException { + readonly code: number; + readonly message: string; + readonly name: string; + toString(): string; + readonly ABORT_ERR: number; + readonly DATA_CLONE_ERR: number; + readonly DOMSTRING_SIZE_ERR: number; + readonly HIERARCHY_REQUEST_ERR: number; + readonly INDEX_SIZE_ERR: number; + readonly INUSE_ATTRIBUTE_ERR: number; + readonly INVALID_ACCESS_ERR: number; + readonly INVALID_CHARACTER_ERR: number; + readonly INVALID_MODIFICATION_ERR: number; + readonly INVALID_NODE_TYPE_ERR: number; + readonly INVALID_STATE_ERR: number; + readonly NAMESPACE_ERR: number; + readonly NETWORK_ERR: number; + readonly NOT_FOUND_ERR: number; + readonly NOT_SUPPORTED_ERR: number; + readonly NO_DATA_ALLOWED_ERR: number; + readonly NO_MODIFICATION_ALLOWED_ERR: number; + readonly PARSE_ERR: number; + readonly QUOTA_EXCEEDED_ERR: number; + readonly SECURITY_ERR: number; + readonly SERIALIZE_ERR: number; + readonly SYNTAX_ERR: number; + readonly TIMEOUT_ERR: number; + readonly TYPE_MISMATCH_ERR: number; + readonly URL_MISMATCH_ERR: number; + readonly VALIDATION_ERR: number; + readonly WRONG_DOCUMENT_ERR: number; +} + +declare var DOMException: { + prototype: DOMException; + new(): DOMException; + readonly ABORT_ERR: number; + readonly DATA_CLONE_ERR: number; + readonly DOMSTRING_SIZE_ERR: number; + readonly HIERARCHY_REQUEST_ERR: number; + readonly INDEX_SIZE_ERR: number; + readonly INUSE_ATTRIBUTE_ERR: number; + readonly INVALID_ACCESS_ERR: number; + readonly INVALID_CHARACTER_ERR: number; + readonly INVALID_MODIFICATION_ERR: number; + readonly INVALID_NODE_TYPE_ERR: number; + readonly INVALID_STATE_ERR: number; + readonly NAMESPACE_ERR: number; + readonly NETWORK_ERR: number; + readonly NOT_FOUND_ERR: number; + readonly NOT_SUPPORTED_ERR: number; + readonly NO_DATA_ALLOWED_ERR: number; + readonly NO_MODIFICATION_ALLOWED_ERR: number; + readonly PARSE_ERR: number; + readonly QUOTA_EXCEEDED_ERR: number; + readonly SECURITY_ERR: number; + readonly SERIALIZE_ERR: number; + readonly SYNTAX_ERR: number; + readonly TIMEOUT_ERR: number; + readonly TYPE_MISMATCH_ERR: number; + readonly URL_MISMATCH_ERR: number; + readonly VALIDATION_ERR: number; + readonly WRONG_DOCUMENT_ERR: number; +} + +interface DOMImplementation { + createDocument(namespaceURI: string | null, qualifiedName: string | null, doctype: DocumentType | null): Document; + createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; + createHTMLDocument(title: string): Document; + hasFeature(feature: string | null, version: string | null): boolean; +} + +declare var DOMImplementation: { + prototype: DOMImplementation; + new(): DOMImplementation; +} + +interface DOMParser { + parseFromString(source: string, mimeType: string): Document; +} + +declare var DOMParser: { + prototype: DOMParser; + new(): DOMParser; +} + +interface DOMSettableTokenList extends DOMTokenList { + value: string; +} + +declare var DOMSettableTokenList: { + prototype: DOMSettableTokenList; + new(): DOMSettableTokenList; +} + +interface DOMStringList { + readonly length: number; + contains(str: string): boolean; + item(index: number): string | null; + [index: number]: string; +} + +declare var DOMStringList: { + prototype: DOMStringList; + new(): DOMStringList; +} + +interface DOMStringMap { + [name: string]: string | undefined; +} + +declare var DOMStringMap: { + prototype: DOMStringMap; + new(): DOMStringMap; +} + +interface DOMTokenList { + readonly length: number; + add(...token: string[]): void; + contains(token: string): boolean; + item(index: number): string; + remove(...token: string[]): void; + toString(): string; + toggle(token: string, force?: boolean): boolean; + [index: number]: string; +} + +declare var DOMTokenList: { + prototype: DOMTokenList; + new(): DOMTokenList; +} + +interface DataCue extends TextTrackCue { + data: ArrayBuffer; + addEventListener(type: K, listener: (this: DataCue, ev: TextTrackCueEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var DataCue: { + prototype: DataCue; + new(): DataCue; +} + +interface DataTransfer { + dropEffect: string; + effectAllowed: string; + readonly files: FileList; + readonly items: DataTransferItemList; + readonly types: string[]; + clearData(format?: string): boolean; + getData(format: string): string; + setData(format: string, data: string): boolean; + setDragImage(image: Element, x: number, y: number): void; +} + +declare var DataTransfer: { + prototype: DataTransfer; + new(): DataTransfer; +} + +interface DataTransferItem { + readonly kind: string; + readonly type: string; + getAsFile(): File | null; + getAsString(_callback: FunctionStringCallback | null): void; + webkitGetAsEntry(): any; +} + +declare var DataTransferItem: { + prototype: DataTransferItem; + new(): DataTransferItem; +} + +interface DataTransferItemList { + readonly length: number; + add(data: File): DataTransferItem | null; + clear(): void; + item(index: number): DataTransferItem; + remove(index: number): void; + [index: number]: DataTransferItem; +} + +declare var DataTransferItemList: { + prototype: DataTransferItemList; + new(): DataTransferItemList; +} + +interface DeferredPermissionRequest { + readonly id: number; + readonly type: MSWebViewPermissionType; + readonly uri: string; + allow(): void; + deny(): void; +} + +declare var DeferredPermissionRequest: { + prototype: DeferredPermissionRequest; + new(): DeferredPermissionRequest; +} + +interface DelayNode extends AudioNode { + readonly delayTime: AudioParam; +} + +declare var DelayNode: { + prototype: DelayNode; + new(): DelayNode; +} + +interface DeviceAcceleration { + readonly x: number | null; + readonly y: number | null; + readonly z: number | null; +} + +declare var DeviceAcceleration: { + prototype: DeviceAcceleration; + new(): DeviceAcceleration; +} + +interface DeviceLightEvent extends Event { + readonly value: number; +} + +declare var DeviceLightEvent: { + prototype: DeviceLightEvent; + new(typeArg: string, eventInitDict?: DeviceLightEventInit): DeviceLightEvent; +} + +interface DeviceMotionEvent extends Event { + readonly acceleration: DeviceAcceleration | null; + readonly accelerationIncludingGravity: DeviceAcceleration | null; + readonly interval: number | null; + readonly rotationRate: DeviceRotationRate | null; + initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict | null, accelerationIncludingGravity: DeviceAccelerationDict | null, rotationRate: DeviceRotationRateDict | null, interval: number | null): void; +} + +declare var DeviceMotionEvent: { + prototype: DeviceMotionEvent; + new(typeArg: string, eventInitDict?: DeviceMotionEventInit): DeviceMotionEvent; +} + +interface DeviceOrientationEvent extends Event { + readonly absolute: boolean; + readonly alpha: number | null; + readonly beta: number | null; + readonly gamma: number | null; + initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number | null, beta: number | null, gamma: number | null, absolute: boolean): void; +} + +declare var DeviceOrientationEvent: { + prototype: DeviceOrientationEvent; + new(typeArg: string, eventInitDict?: DeviceOrientationEventInit): DeviceOrientationEvent; +} + +interface DeviceRotationRate { + readonly alpha: number | null; + readonly beta: number | null; + readonly gamma: number | null; +} + +declare var DeviceRotationRate: { + prototype: DeviceRotationRate; + new(): DeviceRotationRate; +} + +interface DocumentEventMap extends GlobalEventHandlersEventMap { + "abort": UIEvent; + "activate": UIEvent; + "beforeactivate": UIEvent; + "beforedeactivate": UIEvent; + "blur": FocusEvent; + "canplay": Event; + "canplaythrough": Event; + "change": Event; + "click": MouseEvent; + "contextmenu": PointerEvent; + "dblclick": MouseEvent; + "deactivate": UIEvent; + "drag": DragEvent; + "dragend": DragEvent; + "dragenter": DragEvent; + "dragleave": DragEvent; + "dragover": DragEvent; + "dragstart": DragEvent; + "drop": DragEvent; + "durationchange": Event; + "emptied": Event; + "ended": MediaStreamErrorEvent; + "error": ErrorEvent; + "focus": FocusEvent; + "fullscreenchange": Event; + "fullscreenerror": Event; + "input": Event; + "invalid": Event; + "keydown": KeyboardEvent; + "keypress": KeyboardEvent; + "keyup": KeyboardEvent; + "load": Event; + "loadeddata": Event; + "loadedmetadata": Event; + "loadstart": Event; + "mousedown": MouseEvent; + "mousemove": MouseEvent; + "mouseout": MouseEvent; + "mouseover": MouseEvent; + "mouseup": MouseEvent; + "mousewheel": WheelEvent; + "MSContentZoom": UIEvent; + "MSGestureChange": MSGestureEvent; + "MSGestureDoubleTap": MSGestureEvent; + "MSGestureEnd": MSGestureEvent; + "MSGestureHold": MSGestureEvent; + "MSGestureStart": MSGestureEvent; + "MSGestureTap": MSGestureEvent; + "MSInertiaStart": MSGestureEvent; + "MSManipulationStateChanged": MSManipulationEvent; + "MSPointerCancel": MSPointerEvent; + "MSPointerDown": MSPointerEvent; + "MSPointerEnter": MSPointerEvent; + "MSPointerLeave": MSPointerEvent; + "MSPointerMove": MSPointerEvent; + "MSPointerOut": MSPointerEvent; + "MSPointerOver": MSPointerEvent; + "MSPointerUp": MSPointerEvent; + "mssitemodejumplistitemremoved": MSSiteModeEvent; + "msthumbnailclick": MSSiteModeEvent; + "pause": Event; + "play": Event; + "playing": Event; + "pointerlockchange": Event; + "pointerlockerror": Event; + "progress": ProgressEvent; + "ratechange": Event; + "readystatechange": Event; + "reset": Event; + "scroll": UIEvent; + "seeked": Event; + "seeking": Event; + "select": UIEvent; + "selectionchange": Event; + "selectstart": Event; + "stalled": Event; + "stop": Event; + "submit": Event; + "suspend": Event; + "timeupdate": Event; + "touchcancel": TouchEvent; + "touchend": TouchEvent; + "touchmove": TouchEvent; + "touchstart": TouchEvent; + "volumechange": Event; + "waiting": Event; + "webkitfullscreenchange": Event; + "webkitfullscreenerror": Event; +} + +interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEvent, ParentNode, DocumentOrShadowRoot { + /** + * Sets or gets the URL for the current document. + */ + readonly URL: string; + /** + * Gets the URL for the document, stripped of any character encoding. + */ + readonly URLUnencoded: string; + /** + * Gets the object that has the focus when the parent document has focus. + */ + readonly activeElement: Element; + /** + * Sets or gets the color of all active links in the document. + */ + alinkColor: string; + /** + * Returns a reference to the collection of elements contained by the object. + */ + readonly all: HTMLAllCollection; + /** + * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. + */ + anchors: HTMLCollectionOf; + /** + * Retrieves a collection of all applet objects in the document. + */ + applets: HTMLCollectionOf; + /** + * Deprecated. Sets or retrieves a value that indicates the background color behind the object. + */ + bgColor: string; + /** + * Specifies the beginning and end of the document body. + */ + body: HTMLElement; + readonly characterSet: string; + /** + * Gets or sets the character set used to encode the object. + */ + charset: string; + /** + * Gets a value that indicates whether standards-compliant mode is switched on for the object. + */ + readonly compatMode: string; + cookie: string; + readonly currentScript: HTMLScriptElement | SVGScriptElement; + readonly defaultView: Window; + /** + * Sets or gets a value that indicates whether the document can be edited. + */ + designMode: string; + /** + * Sets or retrieves a value that indicates the reading order of the object. + */ + dir: string; + /** + * Gets an object representing the document type declaration associated with the current document. + */ + readonly doctype: DocumentType; + /** + * Gets a reference to the root node of the document. + */ + documentElement: HTMLElement; + /** + * Sets or gets the security domain of the document. + */ + domain: string; + /** + * Retrieves a collection of all embed objects in the document. + */ + embeds: HTMLCollectionOf; + /** + * Sets or gets the foreground (text) color of the document. + */ + fgColor: string; + /** + * Retrieves a collection, in source order, of all form objects in the document. + */ + forms: HTMLCollectionOf; + readonly fullscreenElement: Element | null; + readonly fullscreenEnabled: boolean; + readonly head: HTMLHeadElement; + readonly hidden: boolean; + /** + * Retrieves a collection, in source order, of img objects in the document. + */ + images: HTMLCollectionOf; + /** + * Gets the implementation object of the current document. + */ + readonly implementation: DOMImplementation; + /** + * Returns the character encoding used to create the webpage that is loaded into the document object. + */ + readonly inputEncoding: string | null; + /** + * Gets the date that the page was last modified, if the page supplies one. + */ + readonly lastModified: string; + /** + * Sets or gets the color of the document links. + */ + linkColor: string; + /** + * Retrieves a collection of all a objects that specify the href property and all area objects in the document. + */ + links: HTMLCollectionOf; + /** + * Contains information about the current URL. + */ + readonly location: Location; + msCSSOMElementFloatMetrics: boolean; + msCapsLockWarningOff: boolean; + /** + * Fires when the user aborts the download. + * @param ev The event. + */ + onabort: (this: Document, ev: UIEvent) => any; + /** + * Fires when the object is set as the active element. + * @param ev The event. + */ + onactivate: (this: Document, ev: UIEvent) => any; + /** + * Fires immediately before the object is set as the active element. + * @param ev The event. + */ + onbeforeactivate: (this: Document, ev: UIEvent) => any; + /** + * Fires immediately before the activeElement is changed from the current object to another object in the parent document. + * @param ev The event. + */ + onbeforedeactivate: (this: Document, ev: UIEvent) => any; + /** + * Fires when the object loses the input focus. + * @param ev The focus event. + */ + onblur: (this: Document, ev: FocusEvent) => any; + /** + * Occurs when playback is possible, but would require further buffering. + * @param ev The event. + */ + oncanplay: (this: Document, ev: Event) => any; + oncanplaythrough: (this: Document, ev: Event) => any; + /** + * Fires when the contents of the object or selection have changed. + * @param ev The event. + */ + onchange: (this: Document, ev: Event) => any; + /** + * Fires when the user clicks the left mouse button on the object + * @param ev The mouse event. + */ + onclick: (this: Document, ev: MouseEvent) => any; + /** + * Fires when the user clicks the right mouse button in the client area, opening the context menu. + * @param ev The mouse event. + */ + oncontextmenu: (this: Document, ev: PointerEvent) => any; + /** + * Fires when the user double-clicks the object. + * @param ev The mouse event. + */ + ondblclick: (this: Document, ev: MouseEvent) => any; + /** + * Fires when the activeElement is changed from the current object to another object in the parent document. + * @param ev The UI Event + */ + ondeactivate: (this: Document, ev: UIEvent) => any; + /** + * Fires on the source object continuously during a drag operation. + * @param ev The event. + */ + ondrag: (this: Document, ev: DragEvent) => any; + /** + * Fires on the source object when the user releases the mouse at the close of a drag operation. + * @param ev The event. + */ + ondragend: (this: Document, ev: DragEvent) => any; + /** + * Fires on the target element when the user drags the object to a valid drop target. + * @param ev The drag event. + */ + ondragenter: (this: Document, ev: DragEvent) => any; + /** + * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. + * @param ev The drag event. + */ + ondragleave: (this: Document, ev: DragEvent) => any; + /** + * Fires on the target element continuously while the user drags the object over a valid drop target. + * @param ev The event. + */ + ondragover: (this: Document, ev: DragEvent) => any; + /** + * Fires on the source object when the user starts to drag a text selection or selected object. + * @param ev The event. + */ + ondragstart: (this: Document, ev: DragEvent) => any; + ondrop: (this: Document, ev: DragEvent) => any; + /** + * Occurs when the duration attribute is updated. + * @param ev The event. + */ + ondurationchange: (this: Document, ev: Event) => any; + /** + * Occurs when the media element is reset to its initial state. + * @param ev The event. + */ + onemptied: (this: Document, ev: Event) => any; + /** + * Occurs when the end of playback is reached. + * @param ev The event + */ + onended: (this: Document, ev: MediaStreamErrorEvent) => any; + /** + * Fires when an error occurs during object loading. + * @param ev The event. + */ + onerror: (this: Document, ev: ErrorEvent) => any; + /** + * Fires when the object receives focus. + * @param ev The event. + */ + onfocus: (this: Document, ev: FocusEvent) => any; + onfullscreenchange: (this: Document, ev: Event) => any; + onfullscreenerror: (this: Document, ev: Event) => any; + oninput: (this: Document, ev: Event) => any; + oninvalid: (this: Document, ev: Event) => any; + /** + * Fires when the user presses a key. + * @param ev The keyboard event + */ + onkeydown: (this: Document, ev: KeyboardEvent) => any; + /** + * Fires when the user presses an alphanumeric key. + * @param ev The event. + */ + onkeypress: (this: Document, ev: KeyboardEvent) => any; + /** + * Fires when the user releases a key. + * @param ev The keyboard event + */ + onkeyup: (this: Document, ev: KeyboardEvent) => any; + /** + * Fires immediately after the browser loads the object. + * @param ev The event. + */ + onload: (this: Document, ev: Event) => any; + /** + * Occurs when media data is loaded at the current playback position. + * @param ev The event. + */ + onloadeddata: (this: Document, ev: Event) => any; + /** + * Occurs when the duration and dimensions of the media have been determined. + * @param ev The event. + */ + onloadedmetadata: (this: Document, ev: Event) => any; + /** + * Occurs when Internet Explorer begins looking for media data. + * @param ev The event. + */ + onloadstart: (this: Document, ev: Event) => any; + /** + * Fires when the user clicks the object with either mouse button. + * @param ev The mouse event. + */ + onmousedown: (this: Document, ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse over the object. + * @param ev The mouse event. + */ + onmousemove: (this: Document, ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse pointer outside the boundaries of the object. + * @param ev The mouse event. + */ + onmouseout: (this: Document, ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse pointer into the object. + * @param ev The mouse event. + */ + onmouseover: (this: Document, ev: MouseEvent) => any; + /** + * Fires when the user releases a mouse button while the mouse is over the object. + * @param ev The mouse event. + */ + onmouseup: (this: Document, ev: MouseEvent) => any; + /** + * Fires when the wheel button is rotated. + * @param ev The mouse event + */ + onmousewheel: (this: Document, ev: WheelEvent) => any; + onmscontentzoom: (this: Document, ev: UIEvent) => any; + onmsgesturechange: (this: Document, ev: MSGestureEvent) => any; + onmsgesturedoubletap: (this: Document, ev: MSGestureEvent) => any; + onmsgestureend: (this: Document, ev: MSGestureEvent) => any; + onmsgesturehold: (this: Document, ev: MSGestureEvent) => any; + onmsgesturestart: (this: Document, ev: MSGestureEvent) => any; + onmsgesturetap: (this: Document, ev: MSGestureEvent) => any; + onmsinertiastart: (this: Document, ev: MSGestureEvent) => any; + onmsmanipulationstatechanged: (this: Document, ev: MSManipulationEvent) => any; + onmspointercancel: (this: Document, ev: MSPointerEvent) => any; + onmspointerdown: (this: Document, ev: MSPointerEvent) => any; + onmspointerenter: (this: Document, ev: MSPointerEvent) => any; + onmspointerleave: (this: Document, ev: MSPointerEvent) => any; + onmspointermove: (this: Document, ev: MSPointerEvent) => any; + onmspointerout: (this: Document, ev: MSPointerEvent) => any; + onmspointerover: (this: Document, ev: MSPointerEvent) => any; + onmspointerup: (this: Document, ev: MSPointerEvent) => any; + /** + * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. + * @param ev The event. + */ + onmssitemodejumplistitemremoved: (this: Document, ev: MSSiteModeEvent) => any; + /** + * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. + * @param ev The event. + */ + onmsthumbnailclick: (this: Document, ev: MSSiteModeEvent) => any; + /** + * Occurs when playback is paused. + * @param ev The event. + */ + onpause: (this: Document, ev: Event) => any; + /** + * Occurs when the play method is requested. + * @param ev The event. + */ + onplay: (this: Document, ev: Event) => any; + /** + * Occurs when the audio or video has started playing. + * @param ev The event. + */ + onplaying: (this: Document, ev: Event) => any; + onpointerlockchange: (this: Document, ev: Event) => any; + onpointerlockerror: (this: Document, ev: Event) => any; + /** + * Occurs to indicate progress while downloading media data. + * @param ev The event. + */ + onprogress: (this: Document, ev: ProgressEvent) => any; + /** + * Occurs when the playback rate is increased or decreased. + * @param ev The event. + */ + onratechange: (this: Document, ev: Event) => any; + /** + * Fires when the state of the object has changed. + * @param ev The event + */ + onreadystatechange: (this: Document, ev: Event) => any; + /** + * Fires when the user resets a form. + * @param ev The event. + */ + onreset: (this: Document, ev: Event) => any; + /** + * Fires when the user repositions the scroll box in the scroll bar on the object. + * @param ev The event. + */ + onscroll: (this: Document, ev: UIEvent) => any; + /** + * Occurs when the seek operation ends. + * @param ev The event. + */ + onseeked: (this: Document, ev: Event) => any; + /** + * Occurs when the current playback position is moved. + * @param ev The event. + */ + onseeking: (this: Document, ev: Event) => any; + /** + * Fires when the current selection changes. + * @param ev The event. + */ + onselect: (this: Document, ev: UIEvent) => any; + /** + * Fires when the selection state of a document changes. + * @param ev The event. + */ + onselectionchange: (this: Document, ev: Event) => any; + onselectstart: (this: Document, ev: Event) => any; + /** + * Occurs when the download has stopped. + * @param ev The event. + */ + onstalled: (this: Document, ev: Event) => any; + /** + * Fires when the user clicks the Stop button or leaves the Web page. + * @param ev The event. + */ + onstop: (this: Document, ev: Event) => any; + onsubmit: (this: Document, ev: Event) => any; + /** + * Occurs if the load operation has been intentionally halted. + * @param ev The event. + */ + onsuspend: (this: Document, ev: Event) => any; + /** + * Occurs to indicate the current playback position. + * @param ev The event. + */ + ontimeupdate: (this: Document, ev: Event) => any; + ontouchcancel: (ev: TouchEvent) => any; + ontouchend: (ev: TouchEvent) => any; + ontouchmove: (ev: TouchEvent) => any; + ontouchstart: (ev: TouchEvent) => any; + /** + * Occurs when the volume is changed, or playback is muted or unmuted. + * @param ev The event. + */ + onvolumechange: (this: Document, ev: Event) => any; + /** + * Occurs when playback stops because the next frame of a video resource is not available. + * @param ev The event. + */ + onwaiting: (this: Document, ev: Event) => any; + onwebkitfullscreenchange: (this: Document, ev: Event) => any; + onwebkitfullscreenerror: (this: Document, ev: Event) => any; + plugins: HTMLCollectionOf; + readonly pointerLockElement: Element; + /** + * Retrieves a value that indicates the current state of the object. + */ + readonly readyState: string; + /** + * Gets the URL of the location that referred the user to the current page. + */ + readonly referrer: string; + /** + * Gets the root svg element in the document hierarchy. + */ + readonly rootElement: SVGSVGElement; + /** + * Retrieves a collection of all script objects in the document. + */ + scripts: HTMLCollectionOf; + readonly scrollingElement: Element | null; + /** + * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. + */ + readonly styleSheets: StyleSheetList; + /** + * Contains the title of the document. + */ + title: string; + readonly visibilityState: VisibilityState; + /** + * Sets or gets the color of the links that the user has visited. + */ + vlinkColor: string; + readonly webkitCurrentFullScreenElement: Element | null; + readonly webkitFullscreenElement: Element | null; + readonly webkitFullscreenEnabled: boolean; + readonly webkitIsFullScreen: boolean; + readonly xmlEncoding: string | null; + xmlStandalone: boolean; + /** + * Gets or sets the version attribute specified in the declaration of an XML document. + */ + xmlVersion: string | null; + adoptNode(source: T): T; + captureEvents(): void; + caretRangeFromPoint(x: number, y: number): Range; + clear(): void; + /** + * Closes an output stream and forces the sent data to display. + */ + close(): void; + /** + * Creates an attribute object with a specified name. + * @param name String that sets the attribute object's name. + */ + createAttribute(name: string): Attr; + createAttributeNS(namespaceURI: string | null, qualifiedName: string): Attr; + createCDATASection(data: string): CDATASection; + /** + * Creates a comment object with the specified data. + * @param data Sets the comment object's data. + */ + createComment(data: string): Comment; + /** + * Creates a new document. + */ + createDocumentFragment(): DocumentFragment; + /** + * Creates an instance of the element for the specified tag. + * @param tagName The name of an element. + */ + createElement(tagName: K): HTMLElementTagNameMap[K]; + createElement(tagName: string): HTMLElement; + createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "a"): SVGAElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "circle"): SVGCircleElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "clipPath"): SVGClipPathElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "componentTransferFunction"): SVGComponentTransferFunctionElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "defs"): SVGDefsElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "desc"): SVGDescElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "ellipse"): SVGEllipseElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feBlend"): SVGFEBlendElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feColorMatrix"): SVGFEColorMatrixElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feComponentTransfer"): SVGFEComponentTransferElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feComposite"): SVGFECompositeElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feConvolveMatrix"): SVGFEConvolveMatrixElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDiffuseLighting"): SVGFEDiffuseLightingElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDisplacementMap"): SVGFEDisplacementMapElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDistantLight"): SVGFEDistantLightElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFlood"): SVGFEFloodElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncA"): SVGFEFuncAElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncB"): SVGFEFuncBElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncG"): SVGFEFuncGElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncR"): SVGFEFuncRElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feGaussianBlur"): SVGFEGaussianBlurElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feImage"): SVGFEImageElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMerge"): SVGFEMergeElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMergeNode"): SVGFEMergeNodeElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMorphology"): SVGFEMorphologyElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feOffset"): SVGFEOffsetElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "fePointLight"): SVGFEPointLightElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feSpecularLighting"): SVGFESpecularLightingElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feSpotLight"): SVGFESpotLightElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feTile"): SVGFETileElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feTurbulence"): SVGFETurbulenceElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "filter"): SVGFilterElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "foreignObject"): SVGForeignObjectElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "g"): SVGGElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "image"): SVGImageElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "gradient"): SVGGradientElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "line"): SVGLineElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "linearGradient"): SVGLinearGradientElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "marker"): SVGMarkerElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "mask"): SVGMaskElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "path"): SVGPathElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "metadata"): SVGMetadataElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "pattern"): SVGPatternElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "polygon"): SVGPolygonElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "polyline"): SVGPolylineElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "radialGradient"): SVGRadialGradientElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "rect"): SVGRectElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "svg"): SVGSVGElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "script"): SVGScriptElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "stop"): SVGStopElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "style"): SVGStyleElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "switch"): SVGSwitchElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "symbol"): SVGSymbolElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "tspan"): SVGTSpanElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textContent"): SVGTextContentElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "text"): SVGTextElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textPath"): SVGTextPathElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textPositioning"): SVGTextPositioningElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "title"): SVGTitleElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "use"): SVGUseElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "view"): SVGViewElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement + createElementNS(namespaceURI: string | null, qualifiedName: string): Element; + createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; + createNSResolver(nodeResolver: Node): XPathNSResolver; + /** + * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list + * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. + * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. + */ + createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): NodeIterator; + createProcessingInstruction(target: string, data: string): ProcessingInstruction; + /** + * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. + */ + createRange(): Range; + /** + * Creates a text string from the specified value. + * @param data String that specifies the nodeValue property of the text node. + */ + createTextNode(data: string): Text; + createTouch(view: Window, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch; + createTouchList(...touches: Touch[]): TouchList; + /** + * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. + * @param filter A custom NodeFilter function to use. + * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. + */ + createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker; + /** + * Returns the element for the specified x coordinate and the specified y coordinate. + * @param x The x-offset + * @param y The y-offset + */ + elementFromPoint(x: number, y: number): Element; + evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult; + /** + * Executes a command on the current document, current selection, or the given range. + * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. + * @param showUI Display the user interface, defaults to false. + * @param value Value to assign. + */ + execCommand(commandId: string, showUI?: boolean, value?: any): boolean; + /** + * Displays help information for the given command identifier. + * @param commandId Displays help information for the given command identifier. + */ + execCommandShowHelp(commandId: string): boolean; + exitFullscreen(): void; + exitPointerLock(): void; + /** + * Causes the element to receive the focus and executes the code specified by the onfocus event. + */ + focus(): void; + /** + * Returns a reference to the first object with the specified value of the ID or NAME attribute. + * @param elementId String that specifies the ID value. Case-insensitive. + */ + getElementById(elementId: string): HTMLElement | null; + getElementsByClassName(classNames: string): HTMLCollectionOf; + /** + * Gets a collection of objects based on the value of the NAME or ID attribute. + * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. + */ + getElementsByName(elementName: string): NodeListOf; + /** + * Retrieves a collection of objects based on the specified element name. + * @param name Specifies the name of an element. + */ + getElementsByTagName(tagname: K): ElementListTagNameMap[K]; + getElementsByTagName(tagname: string): NodeListOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf; + /** + * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. + */ + getSelection(): Selection; + /** + * Gets a value indicating whether the object currently has focus. + */ + hasFocus(): boolean; + importNode(importedNode: T, deep: boolean): T; + msElementsFromPoint(x: number, y: number): NodeListOf; + msElementsFromRect(left: number, top: number, width: number, height: number): NodeListOf; + /** + * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. + * @param url Specifies a MIME type for the document. + * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. + * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. + * @param replace Specifies whether the existing entry for the document is replaced in the history list. + */ + open(url?: string, name?: string, features?: string, replace?: boolean): Document; + /** + * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. + * @param commandId Specifies a command identifier. + */ + queryCommandEnabled(commandId: string): boolean; + /** + * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. + * @param commandId String that specifies a command identifier. + */ + queryCommandIndeterm(commandId: string): boolean; + /** + * Returns a Boolean value that indicates the current state of the command. + * @param commandId String that specifies a command identifier. + */ + queryCommandState(commandId: string): boolean; + /** + * Returns a Boolean value that indicates whether the current command is supported on the current range. + * @param commandId Specifies a command identifier. + */ + queryCommandSupported(commandId: string): boolean; + /** + * Retrieves the string associated with a command. + * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. + */ + queryCommandText(commandId: string): string; + /** + * Returns the current value of the document, range, or current selection for the given command. + * @param commandId String that specifies a command identifier. + */ + queryCommandValue(commandId: string): string; + releaseEvents(): void; + /** + * Allows updating the print settings for the page. + */ + updateSettings(): void; + webkitCancelFullScreen(): void; + webkitExitFullscreen(): void; + /** + * Writes one or more HTML expressions to a document in the specified window. + * @param content Specifies the text and HTML tags to write. + */ + write(...content: string[]): void; + /** + * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. + * @param content The text and HTML tags to write. + */ + writeln(...content: string[]): void; + addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Document: { + prototype: Document; + new(): Document; +} + +interface DocumentFragment extends Node, NodeSelector, ParentNode { + getElementById(elementId: string): HTMLElement | null; +} + +declare var DocumentFragment: { + prototype: DocumentFragment; + new(): DocumentFragment; +} + +interface DocumentType extends Node, ChildNode { + readonly entities: NamedNodeMap; + readonly internalSubset: string | null; + readonly name: string; + readonly notations: NamedNodeMap; + readonly publicId: string; + readonly systemId: string; +} + +declare var DocumentType: { + prototype: DocumentType; + new(): DocumentType; +} + +interface DragEvent extends MouseEvent { + readonly dataTransfer: DataTransfer; + initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; + msConvertURL(file: File, targetType: string, targetURL?: string): void; +} + +declare var DragEvent: { + prototype: DragEvent; + new(): DragEvent; +} + +interface DynamicsCompressorNode extends AudioNode { + readonly attack: AudioParam; + readonly knee: AudioParam; + readonly ratio: AudioParam; + readonly reduction: number; + readonly release: AudioParam; + readonly threshold: AudioParam; +} + +declare var DynamicsCompressorNode: { + prototype: DynamicsCompressorNode; + new(): DynamicsCompressorNode; +} + +interface EXT_frag_depth { +} + +declare var EXT_frag_depth: { + prototype: EXT_frag_depth; + new(): EXT_frag_depth; +} + +interface EXT_texture_filter_anisotropic { + readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; + readonly TEXTURE_MAX_ANISOTROPY_EXT: number; +} + +declare var EXT_texture_filter_anisotropic: { + prototype: EXT_texture_filter_anisotropic; + new(): EXT_texture_filter_anisotropic; + readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; + readonly TEXTURE_MAX_ANISOTROPY_EXT: number; +} + +interface ElementEventMap extends GlobalEventHandlersEventMap { + "ariarequest": Event; + "command": Event; + "gotpointercapture": PointerEvent; + "lostpointercapture": PointerEvent; + "MSGestureChange": MSGestureEvent; + "MSGestureDoubleTap": MSGestureEvent; + "MSGestureEnd": MSGestureEvent; + "MSGestureHold": MSGestureEvent; + "MSGestureStart": MSGestureEvent; + "MSGestureTap": MSGestureEvent; + "MSGotPointerCapture": MSPointerEvent; + "MSInertiaStart": MSGestureEvent; + "MSLostPointerCapture": MSPointerEvent; + "MSPointerCancel": MSPointerEvent; + "MSPointerDown": MSPointerEvent; + "MSPointerEnter": MSPointerEvent; + "MSPointerLeave": MSPointerEvent; + "MSPointerMove": MSPointerEvent; + "MSPointerOut": MSPointerEvent; + "MSPointerOver": MSPointerEvent; + "MSPointerUp": MSPointerEvent; + "touchcancel": TouchEvent; + "touchend": TouchEvent; + "touchmove": TouchEvent; + "touchstart": TouchEvent; + "webkitfullscreenchange": Event; + "webkitfullscreenerror": Event; +} + +interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelector, ChildNode, ParentNode { + readonly classList: DOMTokenList; + className: string; + readonly clientHeight: number; + readonly clientLeft: number; + readonly clientTop: number; + readonly clientWidth: number; + id: string; + innerHTML: string; + msContentZoomFactor: number; + readonly msRegionOverflow: string; + onariarequest: (this: Element, ev: Event) => any; + oncommand: (this: Element, ev: Event) => any; + ongotpointercapture: (this: Element, ev: PointerEvent) => any; + onlostpointercapture: (this: Element, ev: PointerEvent) => any; + onmsgesturechange: (this: Element, ev: MSGestureEvent) => any; + onmsgesturedoubletap: (this: Element, ev: MSGestureEvent) => any; + onmsgestureend: (this: Element, ev: MSGestureEvent) => any; + onmsgesturehold: (this: Element, ev: MSGestureEvent) => any; + onmsgesturestart: (this: Element, ev: MSGestureEvent) => any; + onmsgesturetap: (this: Element, ev: MSGestureEvent) => any; + onmsgotpointercapture: (this: Element, ev: MSPointerEvent) => any; + onmsinertiastart: (this: Element, ev: MSGestureEvent) => any; + onmslostpointercapture: (this: Element, ev: MSPointerEvent) => any; + onmspointercancel: (this: Element, ev: MSPointerEvent) => any; + onmspointerdown: (this: Element, ev: MSPointerEvent) => any; + onmspointerenter: (this: Element, ev: MSPointerEvent) => any; + onmspointerleave: (this: Element, ev: MSPointerEvent) => any; + onmspointermove: (this: Element, ev: MSPointerEvent) => any; + onmspointerout: (this: Element, ev: MSPointerEvent) => any; + onmspointerover: (this: Element, ev: MSPointerEvent) => any; + onmspointerup: (this: Element, ev: MSPointerEvent) => any; + ontouchcancel: (ev: TouchEvent) => any; + ontouchend: (ev: TouchEvent) => any; + ontouchmove: (ev: TouchEvent) => any; + ontouchstart: (ev: TouchEvent) => any; + onwebkitfullscreenchange: (this: Element, ev: Event) => any; + onwebkitfullscreenerror: (this: Element, ev: Event) => any; + outerHTML: string; + readonly prefix: string | null; + readonly scrollHeight: number; + scrollLeft: number; + scrollTop: number; + readonly scrollWidth: number; + readonly tagName: string; + readonly assignedSlot: HTMLSlotElement | null; + slot: string; + readonly shadowRoot: ShadowRoot | null; + getAttribute(name: string): string | null; + getAttributeNS(namespaceURI: string, localName: string): string; + getAttributeNode(name: string): Attr; + getAttributeNodeNS(namespaceURI: string, localName: string): Attr; + getBoundingClientRect(): ClientRect; + getClientRects(): ClientRectList; + getElementsByTagName(name: K): ElementListTagNameMap[K]; + getElementsByTagName(name: string): NodeListOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf; + hasAttribute(name: string): boolean; + hasAttributeNS(namespaceURI: string, localName: string): boolean; + msGetRegionContent(): MSRangeCollection; + msGetUntransformedBounds(): ClientRect; + msMatchesSelector(selectors: string): boolean; + msReleasePointerCapture(pointerId: number): void; + msSetPointerCapture(pointerId: number): void; + msZoomTo(args: MsZoomToOptions): void; + releasePointerCapture(pointerId: number): void; + removeAttribute(qualifiedName: string): void; + removeAttributeNS(namespaceURI: string, localName: string): void; + removeAttributeNode(oldAttr: Attr): Attr; + requestFullscreen(): void; + requestPointerLock(): void; + setAttribute(name: string, value: string): void; + setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; + setAttributeNode(newAttr: Attr): Attr; + setAttributeNodeNS(newAttr: Attr): Attr; + setPointerCapture(pointerId: number): void; + webkitMatchesSelector(selectors: string): boolean; + webkitRequestFullScreen(): void; + webkitRequestFullscreen(): void; + getElementsByClassName(classNames: string): NodeListOf; + matches(selector: string): boolean; + closest(selector: string): Element | null; + scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void; + scroll(options?: ScrollToOptions): void; + scroll(x: number, y: number): void; + scrollTo(options?: ScrollToOptions): void; + scrollTo(x: number, y: number): void; + scrollBy(options?: ScrollToOptions): void; + scrollBy(x: number, y: number): void; + insertAdjacentElement(position: string, insertedElement: Element): Element | null; + insertAdjacentHTML(where: string, html: string): void; + insertAdjacentText(where: string, text: string): void; + attachShadow(shadowRootInitDict: ShadowRootInit): ShadowRoot; + addEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Element: { + prototype: Element; + new(): Element; +} + +interface ErrorEvent extends Event { + readonly colno: number; + readonly error: any; + readonly filename: string; + readonly lineno: number; + readonly message: string; + initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; +} + +declare var ErrorEvent: { + prototype: ErrorEvent; + new(type: string, errorEventInitDict?: ErrorEventInit): ErrorEvent; +} + +interface Event { + readonly bubbles: boolean; + cancelBubble: boolean; + readonly cancelable: boolean; + readonly currentTarget: EventTarget; + readonly defaultPrevented: boolean; + readonly eventPhase: number; + readonly isTrusted: boolean; + returnValue: boolean; + readonly srcElement: Element | null; + readonly target: EventTarget; + readonly timeStamp: number; + readonly type: string; + readonly scoped: boolean; + initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; + preventDefault(): void; + stopImmediatePropagation(): void; + stopPropagation(): void; + deepPath(): EventTarget[]; + readonly AT_TARGET: number; + readonly BUBBLING_PHASE: number; + readonly CAPTURING_PHASE: number; +} + +declare var Event: { + prototype: Event; + new(typeArg: string, eventInitDict?: EventInit): Event; + readonly AT_TARGET: number; + readonly BUBBLING_PHASE: number; + readonly CAPTURING_PHASE: number; +} + +interface EventTarget { + addEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + dispatchEvent(evt: Event): boolean; + removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var EventTarget: { + prototype: EventTarget; + new(): EventTarget; +} + +interface ExtensionScriptApis { + extensionIdToShortId(extensionId: string): number; + fireExtensionApiTelemetry(functionName: string, isSucceeded: boolean, isSupported: boolean): void; + genericFunction(routerAddress: any, parameters?: string, callbackId?: number): void; + genericSynchronousFunction(functionId: number, parameters?: string): string; + getExtensionId(): string; + registerGenericFunctionCallbackHandler(callbackHandler: any): void; + registerGenericPersistentCallbackHandler(callbackHandler: any): void; +} + +declare var ExtensionScriptApis: { + prototype: ExtensionScriptApis; + new(): ExtensionScriptApis; +} + +interface External { +} + +declare var External: { + prototype: External; + new(): External; +} + +interface File extends Blob { + readonly lastModifiedDate: any; + readonly name: string; + readonly webkitRelativePath: string; +} + +declare var File: { + prototype: File; + new (parts: (ArrayBuffer | ArrayBufferView | Blob | string)[], filename: string, properties?: FilePropertyBag): File; +} + +interface FileList { + readonly length: number; + item(index: number): File; + [index: number]: File; +} + +declare var FileList: { + prototype: FileList; + new(): FileList; +} + +interface FileReader extends EventTarget, MSBaseReader { + readonly error: DOMError; + readAsArrayBuffer(blob: Blob): void; + readAsBinaryString(blob: Blob): void; + readAsDataURL(blob: Blob): void; + readAsText(blob: Blob, encoding?: string): void; + addEventListener(type: K, listener: (this: FileReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var FileReader: { + prototype: FileReader; + new(): FileReader; +} + +interface FocusEvent extends UIEvent { + readonly relatedTarget: EventTarget; + initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; +} + +declare var FocusEvent: { + prototype: FocusEvent; + new(typeArg: string, eventInitDict?: FocusEventInit): FocusEvent; +} + +interface FocusNavigationEvent extends Event { + readonly navigationReason: NavigationReason; + readonly originHeight: number; + readonly originLeft: number; + readonly originTop: number; + readonly originWidth: number; + requestFocus(): void; +} + +declare var FocusNavigationEvent: { + prototype: FocusNavigationEvent; + new(type: string, eventInitDict?: FocusNavigationEventInit): FocusNavigationEvent; +} + +interface FormData { + append(name: string, value: string | Blob, fileName?: string): void; + delete(name: string): void; + get(name: string): FormDataEntryValue | null; + getAll(name: string): FormDataEntryValue[]; + has(name: string): boolean; + set(name: string, value: string | Blob, fileName?: string): void; +} + +declare var FormData: { + prototype: FormData; + new (form?: HTMLFormElement): FormData; +} + +interface GainNode extends AudioNode { + readonly gain: AudioParam; +} + +declare var GainNode: { + prototype: GainNode; + new(): GainNode; +} + +interface Gamepad { + readonly axes: number[]; + readonly buttons: GamepadButton[]; + readonly connected: boolean; + readonly id: string; + readonly index: number; + readonly mapping: string; + readonly timestamp: number; +} + +declare var Gamepad: { + prototype: Gamepad; + new(): Gamepad; +} + +interface GamepadButton { + readonly pressed: boolean; + readonly value: number; +} + +declare var GamepadButton: { + prototype: GamepadButton; + new(): GamepadButton; +} + +interface GamepadEvent extends Event { + readonly gamepad: Gamepad; +} + +declare var GamepadEvent: { + prototype: GamepadEvent; + new(typeArg: string, eventInitDict?: GamepadEventInit): GamepadEvent; +} + +interface Geolocation { + clearWatch(watchId: number): void; + getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; + watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; +} + +declare var Geolocation: { + prototype: Geolocation; + new(): Geolocation; +} + +interface HTMLAllCollection { + readonly length: number; + item(nameOrIndex?: string): HTMLCollection | Element | null; + namedItem(name: string): HTMLCollection | Element | null; + [index: number]: Element; +} + +declare var HTMLAllCollection: { + prototype: HTMLAllCollection; + new(): HTMLAllCollection; +} + +interface HTMLAnchorElement extends HTMLElement { + Methods: string; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Sets or retrieves the coordinates of the object. + */ + coords: string; + download: string; + /** + * Contains the anchor portion of the URL including the hash sign (#). + */ + hash: string; + /** + * Contains the hostname and port values of the URL. + */ + host: string; + /** + * Contains the hostname of a URL. + */ + hostname: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or retrieves the language code of the object. + */ + hreflang: string; + readonly mimeType: string; + /** + * Sets or retrieves the shape of the object. + */ + name: string; + readonly nameProp: string; + /** + * Contains the pathname of the URL. + */ + pathname: string; + /** + * Sets or retrieves the port number associated with a URL. + */ + port: string; + /** + * Contains the protocol of the URL. + */ + protocol: string; + readonly protocolLong: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rel: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rev: string; + /** + * Sets or retrieves the substring of the href property that follows the question mark. + */ + search: string; + /** + * Sets or retrieves the shape of the object. + */ + shape: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + type: string; + urn: string; + /** + * Returns a string representation of an object. + */ + toString(): string; + addEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLAnchorElement: { + prototype: HTMLAnchorElement; + new(): HTMLAnchorElement; +} + +interface HTMLAppletElement extends HTMLElement { + /** + * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. + */ + readonly BaseHref: string; + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Gets or sets the optional alternative HTML script to execute if the object fails to load. + */ + altHtml: string; + /** + * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. + */ + archive: string; + border: string; + code: string; + /** + * Sets or retrieves the URL of the component. + */ + codeBase: string; + /** + * Sets or retrieves the Internet media type for the code associated with the object. + */ + codeType: string; + /** + * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. + */ + readonly contentDocument: Document; + /** + * Sets or retrieves the URL that references the data of the object. + */ + data: string; + /** + * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. + */ + declare: boolean; + readonly form: HTMLFormElement; + /** + * Sets or retrieves the height of the object. + */ + height: string; + hspace: number; + /** + * Sets or retrieves the shape of the object. + */ + name: string; + object: string | null; + /** + * Sets or retrieves a message to be displayed while an object is loading. + */ + standby: string; + /** + * Returns the content type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + vspace: number; + width: number; + addEventListener(type: K, listener: (this: HTMLAppletElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLAppletElement: { + prototype: HTMLAppletElement; + new(): HTMLAppletElement; +} + +interface HTMLAreaElement extends HTMLElement { + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Sets or retrieves the coordinates of the object. + */ + coords: string; + download: string; + /** + * Sets or retrieves the subsection of the href property that follows the number sign (#). + */ + hash: string; + /** + * Sets or retrieves the hostname and port number of the location or URL. + */ + host: string; + /** + * Sets or retrieves the host name part of the location or URL. + */ + hostname: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or gets whether clicks in this region cause action. + */ + noHref: boolean; + /** + * Sets or retrieves the file name or path specified by the object. + */ + pathname: string; + /** + * Sets or retrieves the port number associated with a URL. + */ + port: string; + /** + * Sets or retrieves the protocol portion of a URL. + */ + protocol: string; + rel: string; + /** + * Sets or retrieves the substring of the href property that follows the question mark. + */ + search: string; + /** + * Sets or retrieves the shape of the object. + */ + shape: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Returns a string representation of an object. + */ + toString(): string; + addEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLAreaElement: { + prototype: HTMLAreaElement; + new(): HTMLAreaElement; +} + +interface HTMLAreasCollection extends HTMLCollectionBase { +} + +declare var HTMLAreasCollection: { + prototype: HTMLAreasCollection; + new(): HTMLAreasCollection; +} + +interface HTMLAudioElement extends HTMLMediaElement { + addEventListener(type: K, listener: (this: HTMLAudioElement, ev: HTMLMediaElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLAudioElement: { + prototype: HTMLAudioElement; + new(): HTMLAudioElement; +} + +interface HTMLBRElement extends HTMLElement { + /** + * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. + */ + clear: string; + addEventListener(type: K, listener: (this: HTMLBRElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLBRElement: { + prototype: HTMLBRElement; + new(): HTMLBRElement; +} + +interface HTMLBaseElement extends HTMLElement { + /** + * Gets or sets the baseline URL on which relative links are based. + */ + href: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + addEventListener(type: K, listener: (this: HTMLBaseElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLBaseElement: { + prototype: HTMLBaseElement; + new(): HTMLBaseElement; +} + +interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { + /** + * Sets or retrieves the current typeface family. + */ + face: string; + /** + * Sets or retrieves the font size of the object. + */ + size: number; + addEventListener(type: K, listener: (this: HTMLBaseFontElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLBaseFontElement: { + prototype: HTMLBaseFontElement; + new(): HTMLBaseFontElement; +} + +interface HTMLBodyElementEventMap extends HTMLElementEventMap { + "afterprint": Event; + "beforeprint": Event; + "beforeunload": BeforeUnloadEvent; + "blur": FocusEvent; + "error": ErrorEvent; + "focus": FocusEvent; + "hashchange": HashChangeEvent; + "load": Event; + "message": MessageEvent; + "offline": Event; + "online": Event; + "orientationchange": Event; + "pagehide": PageTransitionEvent; + "pageshow": PageTransitionEvent; + "popstate": PopStateEvent; + "resize": UIEvent; + "scroll": UIEvent; + "storage": StorageEvent; + "unload": Event; +} + +interface HTMLBodyElement extends HTMLElement { + aLink: any; + background: string; + bgColor: any; + bgProperties: string; + link: any; + noWrap: boolean; + onafterprint: (this: HTMLBodyElement, ev: Event) => any; + onbeforeprint: (this: HTMLBodyElement, ev: Event) => any; + onbeforeunload: (this: HTMLBodyElement, ev: BeforeUnloadEvent) => any; + onblur: (this: HTMLBodyElement, ev: FocusEvent) => any; + onerror: (this: HTMLBodyElement, ev: ErrorEvent) => any; + onfocus: (this: HTMLBodyElement, ev: FocusEvent) => any; + onhashchange: (this: HTMLBodyElement, ev: HashChangeEvent) => any; + onload: (this: HTMLBodyElement, ev: Event) => any; + onmessage: (this: HTMLBodyElement, ev: MessageEvent) => any; + onoffline: (this: HTMLBodyElement, ev: Event) => any; + ononline: (this: HTMLBodyElement, ev: Event) => any; + onorientationchange: (this: HTMLBodyElement, ev: Event) => any; + onpagehide: (this: HTMLBodyElement, ev: PageTransitionEvent) => any; + onpageshow: (this: HTMLBodyElement, ev: PageTransitionEvent) => any; + onpopstate: (this: HTMLBodyElement, ev: PopStateEvent) => any; + onresize: (this: HTMLBodyElement, ev: UIEvent) => any; + onscroll: (this: HTMLBodyElement, ev: UIEvent) => any; + onstorage: (this: HTMLBodyElement, ev: StorageEvent) => any; + onunload: (this: HTMLBodyElement, ev: Event) => any; + text: any; + vLink: any; + addEventListener(type: K, listener: (this: HTMLBodyElement, ev: HTMLBodyElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLBodyElement: { + prototype: HTMLBodyElement; + new(): HTMLBodyElement; +} + +interface HTMLButtonElement extends HTMLElement { + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Overrides the action attribute (where the data on a form is sent) on the parent form element. + */ + formAction: string; + /** + * Used to override the encoding (formEnctype attribute) specified on the form element. + */ + formEnctype: string; + /** + * Overrides the submit method attribute previously specified on a form element. + */ + formMethod: string; + /** + * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + */ + formNoValidate: string; + /** + * Overrides the target attribute on a form element. + */ + formTarget: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + status: any; + /** + * Gets the classification and default behavior of the button. + */ + type: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + readonly validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + readonly validity: ValidityState; + /** + * Sets or retrieves the default or selected value of the control. + */ + value: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + readonly willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + addEventListener(type: K, listener: (this: HTMLButtonElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLButtonElement: { + prototype: HTMLButtonElement; + new(): HTMLButtonElement; +} + +interface HTMLCanvasElement extends HTMLElement { + /** + * Gets or sets the height of a canvas element on a document. + */ + height: number; + /** + * Gets or sets the width of a canvas element on a document. + */ + width: number; + /** + * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. + * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); + */ + getContext(contextId: "2d", contextAttributes?: Canvas2DContextAttributes): CanvasRenderingContext2D | null; + getContext(contextId: "webgl" | "experimental-webgl", contextAttributes?: WebGLContextAttributes): WebGLRenderingContext | null; + getContext(contextId: string, contextAttributes?: {}): CanvasRenderingContext2D | WebGLRenderingContext | null; + /** + * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. + */ + msToBlob(): Blob; + /** + * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. + * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. + */ + toDataURL(type?: string, ...args: any[]): string; + toBlob(callback: (result: Blob | null) => void, type?: string, ...arguments: any[]): void; + addEventListener(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLCanvasElement: { + prototype: HTMLCanvasElement; + new(): HTMLCanvasElement; +} + +interface HTMLCollectionBase { + /** + * Sets or retrieves the number of objects in a collection. + */ + readonly length: number; + /** + * Retrieves an object from various collections. + */ + item(index: number): Element; + [index: number]: Element; +} + +interface HTMLCollection extends HTMLCollectionBase { + /** + * Retrieves a select object or an object from an options collection. + */ + namedItem(name: string): Element | null; +} + +declare var HTMLCollection: { + prototype: HTMLCollection; + new(): HTMLCollection; +} + +interface HTMLDListElement extends HTMLElement { + compact: boolean; + addEventListener(type: K, listener: (this: HTMLDListElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLDListElement: { + prototype: HTMLDListElement; + new(): HTMLDListElement; +} + +interface HTMLDataElement extends HTMLElement { + value: string; + addEventListener(type: K, listener: (this: HTMLDataElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLDataElement: { + prototype: HTMLDataElement; + new(): HTMLDataElement; +} + +interface HTMLDataListElement extends HTMLElement { + options: HTMLCollectionOf; + addEventListener(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLDataListElement: { + prototype: HTMLDataListElement; + new(): HTMLDataListElement; +} + +interface HTMLDirectoryElement extends HTMLElement { + compact: boolean; + addEventListener(type: K, listener: (this: HTMLDirectoryElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLDirectoryElement: { + prototype: HTMLDirectoryElement; + new(): HTMLDirectoryElement; +} + +interface HTMLDivElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; + addEventListener(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLDivElement: { + prototype: HTMLDivElement; + new(): HTMLDivElement; +} + +interface HTMLDocument extends Document { + addEventListener(type: K, listener: (this: HTMLDocument, ev: DocumentEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLDocument: { + prototype: HTMLDocument; + new(): HTMLDocument; +} + +interface HTMLElementEventMap extends ElementEventMap { + "abort": UIEvent; + "activate": UIEvent; + "beforeactivate": UIEvent; + "beforecopy": ClipboardEvent; + "beforecut": ClipboardEvent; + "beforedeactivate": UIEvent; + "beforepaste": ClipboardEvent; + "blur": FocusEvent; + "canplay": Event; + "canplaythrough": Event; + "change": Event; + "click": MouseEvent; + "contextmenu": PointerEvent; + "copy": ClipboardEvent; + "cuechange": Event; + "cut": ClipboardEvent; + "dblclick": MouseEvent; + "deactivate": UIEvent; + "drag": DragEvent; + "dragend": DragEvent; + "dragenter": DragEvent; + "dragleave": DragEvent; + "dragover": DragEvent; + "dragstart": DragEvent; + "drop": DragEvent; + "durationchange": Event; + "emptied": Event; + "ended": MediaStreamErrorEvent; + "error": ErrorEvent; + "focus": FocusEvent; + "input": Event; + "invalid": Event; + "keydown": KeyboardEvent; + "keypress": KeyboardEvent; + "keyup": KeyboardEvent; + "load": Event; + "loadeddata": Event; + "loadedmetadata": Event; + "loadstart": Event; + "mousedown": MouseEvent; + "mouseenter": MouseEvent; + "mouseleave": MouseEvent; + "mousemove": MouseEvent; + "mouseout": MouseEvent; + "mouseover": MouseEvent; + "mouseup": MouseEvent; + "mousewheel": WheelEvent; + "MSContentZoom": UIEvent; + "MSManipulationStateChanged": MSManipulationEvent; + "paste": ClipboardEvent; + "pause": Event; + "play": Event; + "playing": Event; + "progress": ProgressEvent; + "ratechange": Event; + "reset": Event; + "scroll": UIEvent; + "seeked": Event; + "seeking": Event; + "select": UIEvent; + "selectstart": Event; + "stalled": Event; + "submit": Event; + "suspend": Event; + "timeupdate": Event; + "volumechange": Event; + "waiting": Event; +} + +interface HTMLElement extends Element { + accessKey: string; + readonly children: HTMLCollection; + contentEditable: string; + readonly dataset: DOMStringMap; + dir: string; + draggable: boolean; + hidden: boolean; + hideFocus: boolean; + innerText: string; + readonly isContentEditable: boolean; + lang: string; + readonly offsetHeight: number; + readonly offsetLeft: number; + readonly offsetParent: Element; + readonly offsetTop: number; + readonly offsetWidth: number; + onabort: (this: HTMLElement, ev: UIEvent) => any; + onactivate: (this: HTMLElement, ev: UIEvent) => any; + onbeforeactivate: (this: HTMLElement, ev: UIEvent) => any; + onbeforecopy: (this: HTMLElement, ev: ClipboardEvent) => any; + onbeforecut: (this: HTMLElement, ev: ClipboardEvent) => any; + onbeforedeactivate: (this: HTMLElement, ev: UIEvent) => any; + onbeforepaste: (this: HTMLElement, ev: ClipboardEvent) => any; + onblur: (this: HTMLElement, ev: FocusEvent) => any; + oncanplay: (this: HTMLElement, ev: Event) => any; + oncanplaythrough: (this: HTMLElement, ev: Event) => any; + onchange: (this: HTMLElement, ev: Event) => any; + onclick: (this: HTMLElement, ev: MouseEvent) => any; + oncontextmenu: (this: HTMLElement, ev: PointerEvent) => any; + oncopy: (this: HTMLElement, ev: ClipboardEvent) => any; + oncuechange: (this: HTMLElement, ev: Event) => any; + oncut: (this: HTMLElement, ev: ClipboardEvent) => any; + ondblclick: (this: HTMLElement, ev: MouseEvent) => any; + ondeactivate: (this: HTMLElement, ev: UIEvent) => any; + ondrag: (this: HTMLElement, ev: DragEvent) => any; + ondragend: (this: HTMLElement, ev: DragEvent) => any; + ondragenter: (this: HTMLElement, ev: DragEvent) => any; + ondragleave: (this: HTMLElement, ev: DragEvent) => any; + ondragover: (this: HTMLElement, ev: DragEvent) => any; + ondragstart: (this: HTMLElement, ev: DragEvent) => any; + ondrop: (this: HTMLElement, ev: DragEvent) => any; + ondurationchange: (this: HTMLElement, ev: Event) => any; + onemptied: (this: HTMLElement, ev: Event) => any; + onended: (this: HTMLElement, ev: MediaStreamErrorEvent) => any; + onerror: (this: HTMLElement, ev: ErrorEvent) => any; + onfocus: (this: HTMLElement, ev: FocusEvent) => any; + oninput: (this: HTMLElement, ev: Event) => any; + oninvalid: (this: HTMLElement, ev: Event) => any; + onkeydown: (this: HTMLElement, ev: KeyboardEvent) => any; + onkeypress: (this: HTMLElement, ev: KeyboardEvent) => any; + onkeyup: (this: HTMLElement, ev: KeyboardEvent) => any; + onload: (this: HTMLElement, ev: Event) => any; + onloadeddata: (this: HTMLElement, ev: Event) => any; + onloadedmetadata: (this: HTMLElement, ev: Event) => any; + onloadstart: (this: HTMLElement, ev: Event) => any; + onmousedown: (this: HTMLElement, ev: MouseEvent) => any; + onmouseenter: (this: HTMLElement, ev: MouseEvent) => any; + onmouseleave: (this: HTMLElement, ev: MouseEvent) => any; + onmousemove: (this: HTMLElement, ev: MouseEvent) => any; + onmouseout: (this: HTMLElement, ev: MouseEvent) => any; + onmouseover: (this: HTMLElement, ev: MouseEvent) => any; + onmouseup: (this: HTMLElement, ev: MouseEvent) => any; + onmousewheel: (this: HTMLElement, ev: WheelEvent) => any; + onmscontentzoom: (this: HTMLElement, ev: UIEvent) => any; + onmsmanipulationstatechanged: (this: HTMLElement, ev: MSManipulationEvent) => any; + onpaste: (this: HTMLElement, ev: ClipboardEvent) => any; + onpause: (this: HTMLElement, ev: Event) => any; + onplay: (this: HTMLElement, ev: Event) => any; + onplaying: (this: HTMLElement, ev: Event) => any; + onprogress: (this: HTMLElement, ev: ProgressEvent) => any; + onratechange: (this: HTMLElement, ev: Event) => any; + onreset: (this: HTMLElement, ev: Event) => any; + onscroll: (this: HTMLElement, ev: UIEvent) => any; + onseeked: (this: HTMLElement, ev: Event) => any; + onseeking: (this: HTMLElement, ev: Event) => any; + onselect: (this: HTMLElement, ev: UIEvent) => any; + onselectstart: (this: HTMLElement, ev: Event) => any; + onstalled: (this: HTMLElement, ev: Event) => any; + onsubmit: (this: HTMLElement, ev: Event) => any; + onsuspend: (this: HTMLElement, ev: Event) => any; + ontimeupdate: (this: HTMLElement, ev: Event) => any; + onvolumechange: (this: HTMLElement, ev: Event) => any; + onwaiting: (this: HTMLElement, ev: Event) => any; + outerText: string; + spellcheck: boolean; + readonly style: CSSStyleDeclaration; + tabIndex: number; + title: string; + blur(): void; + click(): void; + dragDrop(): boolean; + focus(): void; + msGetInputContext(): MSInputMethodContext; + addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLElement: { + prototype: HTMLElement; + new(): HTMLElement; +} + +interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { + /** + * Sets or retrieves the height of the object. + */ + height: string; + hidden: any; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + readonly msPlayToSource: any; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Retrieves the palette used for the embedded document. + */ + readonly palette: string; + /** + * Retrieves the URL of the plug-in used to view an embedded document. + */ + readonly pluginspage: string; + readonly readyState: string; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the height and width units of the embed object. + */ + units: string; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: K, listener: (this: HTMLEmbedElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLEmbedElement: { + prototype: HTMLEmbedElement; + new(): HTMLEmbedElement; +} + +interface HTMLFieldSetElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + name: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + readonly validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + readonly validity: ValidityState; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + readonly willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + addEventListener(type: K, listener: (this: HTMLFieldSetElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFieldSetElement: { + prototype: HTMLFieldSetElement; + new(): HTMLFieldSetElement; +} + +interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { + /** + * Sets or retrieves the current typeface family. + */ + face: string; + addEventListener(type: K, listener: (this: HTMLFontElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFontElement: { + prototype: HTMLFontElement; + new(): HTMLFontElement; +} + +interface HTMLFormControlsCollection extends HTMLCollectionBase { + namedItem(name: string): HTMLCollection | Element | null; +} + +declare var HTMLFormControlsCollection: { + prototype: HTMLFormControlsCollection; + new(): HTMLFormControlsCollection; +} + +interface HTMLFormElement extends HTMLElement { + /** + * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. + */ + acceptCharset: string; + /** + * Sets or retrieves the URL to which the form content is sent for processing. + */ + action: string; + /** + * Specifies whether autocomplete is applied to an editable text field. + */ + autocomplete: string; + /** + * Retrieves a collection, in source order, of all controls in a given form. + */ + readonly elements: HTMLFormControlsCollection; + /** + * Sets or retrieves the MIME encoding for the form. + */ + encoding: string; + /** + * Sets or retrieves the encoding type for the form. + */ + enctype: string; + /** + * Sets or retrieves the number of objects in a collection. + */ + readonly length: number; + /** + * Sets or retrieves how to send the form data to the server. + */ + method: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Designates a form that is not validated when submitted. + */ + noValidate: boolean; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Retrieves a form object or an object from an elements collection. + * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. + * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. + */ + item(name?: any, index?: any): any; + /** + * Retrieves a form object or an object from an elements collection. + */ + namedItem(name: string): any; + /** + * Fires when the user resets a form. + */ + reset(): void; + /** + * Fires when a FORM is about to be submitted. + */ + submit(): void; + addEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [name: string]: any; +} + +declare var HTMLFormElement: { + prototype: HTMLFormElement; + new(): HTMLFormElement; +} + +interface HTMLFrameElementEventMap extends HTMLElementEventMap { + "load": Event; +} + +interface HTMLFrameElement extends HTMLElement, GetSVGDocument { + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Retrieves the document object of the page or frame. + */ + readonly contentDocument: Document; + /** + * Retrieves the object of the specified. + */ + readonly contentWindow: Window; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Sets or retrieves the height of the object. + */ + height: string | number; + /** + * Sets or retrieves a URI to a long description of the object. + */ + longDesc: string; + /** + * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. + */ + marginHeight: string; + /** + * Sets or retrieves the left and right margin widths before displaying the text in a frame. + */ + marginWidth: string; + /** + * Sets or retrieves the frame name. + */ + name: string; + /** + * Sets or retrieves whether the user can resize the frame. + */ + noResize: boolean; + /** + * Raised when the object has been completely received from the server. + */ + onload: (this: HTMLFrameElement, ev: Event) => any; + /** + * Sets or retrieves whether the frame can be scrolled. + */ + scrolling: string; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the width of the object. + */ + width: string | number; + addEventListener(type: K, listener: (this: HTMLFrameElement, ev: HTMLFrameElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFrameElement: { + prototype: HTMLFrameElement; + new(): HTMLFrameElement; +} + +interface HTMLFrameSetElementEventMap extends HTMLElementEventMap { + "afterprint": Event; + "beforeprint": Event; + "beforeunload": BeforeUnloadEvent; + "blur": FocusEvent; + "error": ErrorEvent; + "focus": FocusEvent; + "hashchange": HashChangeEvent; + "load": Event; + "message": MessageEvent; + "offline": Event; + "online": Event; + "orientationchange": Event; + "pagehide": PageTransitionEvent; + "pageshow": PageTransitionEvent; + "popstate": PopStateEvent; + "resize": UIEvent; + "scroll": UIEvent; + "storage": StorageEvent; + "unload": Event; +} + +interface HTMLFrameSetElement extends HTMLElement { + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Sets or retrieves the frame widths of the object. + */ + cols: string; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + name: string; + onafterprint: (this: HTMLFrameSetElement, ev: Event) => any; + onbeforeprint: (this: HTMLFrameSetElement, ev: Event) => any; + onbeforeunload: (this: HTMLFrameSetElement, ev: BeforeUnloadEvent) => any; + /** + * Fires when the object loses the input focus. + */ + onblur: (this: HTMLFrameSetElement, ev: FocusEvent) => any; + onerror: (this: HTMLFrameSetElement, ev: ErrorEvent) => any; + /** + * Fires when the object receives focus. + */ + onfocus: (this: HTMLFrameSetElement, ev: FocusEvent) => any; + onhashchange: (this: HTMLFrameSetElement, ev: HashChangeEvent) => any; + onload: (this: HTMLFrameSetElement, ev: Event) => any; + onmessage: (this: HTMLFrameSetElement, ev: MessageEvent) => any; + onoffline: (this: HTMLFrameSetElement, ev: Event) => any; + ononline: (this: HTMLFrameSetElement, ev: Event) => any; + onorientationchange: (this: HTMLFrameSetElement, ev: Event) => any; + onpagehide: (this: HTMLFrameSetElement, ev: PageTransitionEvent) => any; + onpageshow: (this: HTMLFrameSetElement, ev: PageTransitionEvent) => any; + onpopstate: (this: HTMLFrameSetElement, ev: PopStateEvent) => any; + onresize: (this: HTMLFrameSetElement, ev: UIEvent) => any; + onscroll: (this: HTMLFrameSetElement, ev: UIEvent) => any; + onstorage: (this: HTMLFrameSetElement, ev: StorageEvent) => any; + onunload: (this: HTMLFrameSetElement, ev: Event) => any; + /** + * Sets or retrieves the frame heights of the object. + */ + rows: string; + addEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFrameSetElement: { + prototype: HTMLFrameSetElement; + new(): HTMLFrameSetElement; +} + +interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. + */ + noShade: boolean; + /** + * Sets or retrieves the width of the object. + */ + width: number; + addEventListener(type: K, listener: (this: HTMLHRElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLHRElement: { + prototype: HTMLHRElement; + new(): HTMLHRElement; +} + +interface HTMLHeadElement extends HTMLElement { + profile: string; + addEventListener(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLHeadElement: { + prototype: HTMLHeadElement; + new(): HTMLHeadElement; +} + +interface HTMLHeadingElement extends HTMLElement { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + addEventListener(type: K, listener: (this: HTMLHeadingElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLHeadingElement: { + prototype: HTMLHeadingElement; + new(): HTMLHeadingElement; +} + +interface HTMLHtmlElement extends HTMLElement { + /** + * Sets or retrieves the DTD version that governs the current document. + */ + version: string; + addEventListener(type: K, listener: (this: HTMLHtmlElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLHtmlElement: { + prototype: HTMLHtmlElement; + new(): HTMLHtmlElement; +} + +interface HTMLIFrameElementEventMap extends HTMLElementEventMap { + "load": Event; +} + +interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + allowFullscreen: boolean; + allowPaymentRequest: boolean; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Retrieves the document object of the page or frame. + */ + readonly contentDocument: Document; + /** + * Retrieves the object of the specified. + */ + readonly contentWindow: Window; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Sets or retrieves the horizontal margin for the object. + */ + hspace: number; + /** + * Sets or retrieves a URI to a long description of the object. + */ + longDesc: string; + /** + * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. + */ + marginHeight: string; + /** + * Sets or retrieves the left and right margin widths before displaying the text in a frame. + */ + marginWidth: string; + /** + * Sets or retrieves the frame name. + */ + name: string; + /** + * Sets or retrieves whether the user can resize the frame. + */ + noResize: boolean; + /** + * Raised when the object has been completely received from the server. + */ + onload: (this: HTMLIFrameElement, ev: Event) => any; + readonly sandbox: DOMSettableTokenList; + /** + * Sets or retrieves whether the frame can be scrolled. + */ + scrolling: string; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLIFrameElement: { + prototype: HTMLIFrameElement; + new(): HTMLIFrameElement; +} + +interface HTMLImageElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Retrieves whether the object is fully loaded. + */ + readonly complete: boolean; + crossOrigin: string | null; + readonly currentSrc: string; + /** + * Sets or retrieves the height of the object. + */ + height: number; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + hspace: number; + /** + * Sets or retrieves whether the image is a server-side image map. + */ + isMap: boolean; + /** + * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. + */ + longDesc: string; + lowsrc: string; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + readonly msPlayToSource: any; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * The original height of the image resource before sizing. + */ + readonly naturalHeight: number; + /** + * The original width of the image resource before sizing. + */ + readonly naturalWidth: number; + sizes: string; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + srcset: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: number; + readonly x: number; + readonly y: number; + msGetAsCastingSource(): any; + addEventListener(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLImageElement: { + prototype: HTMLImageElement; + new(): HTMLImageElement; +} + +interface HTMLInputElement extends HTMLElement { + /** + * Sets or retrieves a comma-separated list of content types. + */ + accept: string; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Specifies whether autocomplete is applied to an editable text field. + */ + autocomplete: string; + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + border: string; + /** + * Sets or retrieves the state of the check box or radio button. + */ + checked: boolean; + /** + * Retrieves whether the object is fully loaded. + */ + readonly complete: boolean; + /** + * Sets or retrieves the state of the check box or radio button. + */ + defaultChecked: boolean; + /** + * Sets or retrieves the initial contents of the object. + */ + defaultValue: string; + disabled: boolean; + /** + * Returns a FileList object on a file type input object. + */ + readonly files: FileList | null; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Overrides the action attribute (where the data on a form is sent) on the parent form element. + */ + formAction: string; + /** + * Used to override the encoding (formEnctype attribute) specified on the form element. + */ + formEnctype: string; + /** + * Overrides the submit method attribute previously specified on a form element. + */ + formMethod: string; + /** + * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + */ + formNoValidate: string; + /** + * Overrides the target attribute on a form element. + */ + formTarget: string; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + hspace: number; + indeterminate: boolean; + /** + * Specifies the ID of a pre-defined datalist of options for an input element. + */ + readonly list: HTMLElement; + /** + * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. + */ + max: string; + /** + * Sets or retrieves the maximum number of characters that the user can enter in a text control. + */ + maxLength: number; + /** + * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. + */ + min: string; + /** + * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. + */ + multiple: boolean; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Gets or sets a string containing a regular expression that the user's input must match. + */ + pattern: string; + /** + * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. + */ + placeholder: string; + readOnly: boolean; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + selectionDirection: string; + /** + * Gets or sets the end position or offset of a text selection. + */ + selectionEnd: number; + /** + * Gets or sets the starting position or offset of a text selection. + */ + selectionStart: number; + size: number; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + status: boolean; + /** + * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. + */ + step: string; + /** + * Returns the content type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + readonly validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + readonly validity: ValidityState; + /** + * Returns the value of the data at the cursor's current position. + */ + value: string; + valueAsDate: Date; + /** + * Returns the input field value as a number. + */ + valueAsNumber: number; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + webkitdirectory: boolean; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + readonly willValidate: boolean; + minLength: number; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Makes the selection equal to the current object. + */ + select(): void; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + /** + * Sets the start and end positions of a selection in a text field. + * @param start The offset into the text field for the start of the selection. + * @param end The offset into the text field for the end of the selection. + */ + setSelectionRange(start?: number, end?: number, direction?: string): void; + /** + * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. + * @param n Value to decrement the value by. + */ + stepDown(n?: number): void; + /** + * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. + * @param n Value to increment the value by. + */ + stepUp(n?: number): void; + addEventListener(type: K, listener: (this: HTMLInputElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLInputElement: { + prototype: HTMLInputElement; + new(): HTMLInputElement; +} + +interface HTMLLIElement extends HTMLElement { + type: string; + /** + * Sets or retrieves the value of a list item. + */ + value: number; + addEventListener(type: K, listener: (this: HTMLLIElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLLIElement: { + prototype: HTMLLIElement; + new(): HTMLLIElement; +} + +interface HTMLLabelElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Sets or retrieves the object to which the given label object is assigned. + */ + htmlFor: string; + addEventListener(type: K, listener: (this: HTMLLabelElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLLabelElement: { + prototype: HTMLLabelElement; + new(): HTMLLabelElement; +} + +interface HTMLLegendElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + align: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + addEventListener(type: K, listener: (this: HTMLLegendElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLLegendElement: { + prototype: HTMLLegendElement; + new(): HTMLLegendElement; +} + +interface HTMLLinkElement extends HTMLElement, LinkStyle { + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + disabled: boolean; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or retrieves the language code of the object. + */ + hreflang: string; + /** + * Sets or retrieves the media type. + */ + media: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rel: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rev: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Sets or retrieves the MIME type of the object. + */ + type: string; + import?: Document; + integrity: string; + addEventListener(type: K, listener: (this: HTMLLinkElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLLinkElement: { + prototype: HTMLLinkElement; + new(): HTMLLinkElement; +} + +interface HTMLMapElement extends HTMLElement { + /** + * Retrieves a collection of the area objects defined for the given map object. + */ + readonly areas: HTMLAreasCollection; + /** + * Sets or retrieves the name of the object. + */ + name: string; + addEventListener(type: K, listener: (this: HTMLMapElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMapElement: { + prototype: HTMLMapElement; + new(): HTMLMapElement; +} + +interface HTMLMarqueeElementEventMap extends HTMLElementEventMap { + "bounce": Event; + "finish": Event; + "start": Event; +} + +interface HTMLMarqueeElement extends HTMLElement { + behavior: string; + bgColor: any; + direction: string; + height: string; + hspace: number; + loop: number; + onbounce: (this: HTMLMarqueeElement, ev: Event) => any; + onfinish: (this: HTMLMarqueeElement, ev: Event) => any; + onstart: (this: HTMLMarqueeElement, ev: Event) => any; + scrollAmount: number; + scrollDelay: number; + trueSpeed: boolean; + vspace: number; + width: string; + start(): void; + stop(): void; + addEventListener(type: K, listener: (this: HTMLMarqueeElement, ev: HTMLMarqueeElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMarqueeElement: { + prototype: HTMLMarqueeElement; + new(): HTMLMarqueeElement; +} + +interface HTMLMediaElementEventMap extends HTMLElementEventMap { + "encrypted": MediaEncryptedEvent; + "msneedkey": MSMediaKeyNeededEvent; +} + +interface HTMLMediaElement extends HTMLElement { + /** + * Returns an AudioTrackList object with the audio tracks for a given video element. + */ + readonly audioTracks: AudioTrackList; + /** + * Gets or sets a value that indicates whether to start playing the media automatically. + */ + autoplay: boolean; + /** + * Gets a collection of buffered time ranges. + */ + readonly buffered: TimeRanges; + /** + * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). + */ + controls: boolean; + crossOrigin: string | null; + /** + * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. + */ + readonly currentSrc: string; + /** + * Gets or sets the current playback position, in seconds. + */ + currentTime: number; + defaultMuted: boolean; + /** + * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. + */ + defaultPlaybackRate: number; + /** + * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. + */ + readonly duration: number; + /** + * Gets information about whether the playback has ended or not. + */ + readonly ended: boolean; + /** + * Returns an object representing the current error state of the audio or video element. + */ + readonly error: MediaError; + /** + * Gets or sets a flag to specify whether playback should restart after it completes. + */ + loop: boolean; + readonly mediaKeys: MediaKeys | null; + /** + * Specifies the purpose of the audio or video media, such as background audio or alerts. + */ + msAudioCategory: string; + /** + * Specifies the output device id that the audio will be sent to. + */ + msAudioDeviceType: string; + readonly msGraphicsTrustStatus: MSGraphicsTrust; + /** + * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. + */ + readonly msKeys: MSMediaKeys; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + readonly msPlayToSource: any; + /** + * Specifies whether or not to enable low-latency playback on the media element. + */ + msRealTime: boolean; + /** + * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. + */ + muted: boolean; + /** + * Gets the current network activity for the element. + */ + readonly networkState: number; + onencrypted: (this: HTMLMediaElement, ev: MediaEncryptedEvent) => any; + onmsneedkey: (this: HTMLMediaElement, ev: MSMediaKeyNeededEvent) => any; + /** + * Gets a flag that specifies whether playback is paused. + */ + readonly paused: boolean; + /** + * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. + */ + playbackRate: number; + /** + * Gets TimeRanges for the current media resource that has been played. + */ + readonly played: TimeRanges; + /** + * Gets or sets the current playback position, in seconds. + */ + preload: string; + readyState: number; + /** + * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. + */ + readonly seekable: TimeRanges; + /** + * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. + */ + readonly seeking: boolean; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + srcObject: MediaStream | null; + readonly textTracks: TextTrackList; + readonly videoTracks: VideoTrackList; + /** + * Gets or sets the volume level for audio portions of the media element. + */ + volume: number; + addTextTrack(kind: string, label?: string, language?: string): TextTrack; + /** + * Returns a string that specifies whether the client can play a given media resource type. + */ + canPlayType(type: string): string; + /** + * Resets the audio or video object and loads a new media resource. + */ + load(): void; + /** + * Clears all effects from the media pipeline. + */ + msClearEffects(): void; + msGetAsCastingSource(): any; + /** + * Inserts the specified audio effect into media pipeline. + */ + msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; + msSetMediaKeys(mediaKeys: MSMediaKeys): void; + /** + * Specifies the media protection manager for a given media pipeline. + */ + msSetMediaProtectionManager(mediaProtectionManager?: any): void; + /** + * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. + */ + pause(): void; + /** + * Loads and starts playback of a media resource. + */ + play(): void; + setMediaKeys(mediaKeys: MediaKeys | null): Promise; + readonly HAVE_CURRENT_DATA: number; + readonly HAVE_ENOUGH_DATA: number; + readonly HAVE_FUTURE_DATA: number; + readonly HAVE_METADATA: number; + readonly HAVE_NOTHING: number; + readonly NETWORK_EMPTY: number; + readonly NETWORK_IDLE: number; + readonly NETWORK_LOADING: number; + readonly NETWORK_NO_SOURCE: number; + addEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMediaElement: { + prototype: HTMLMediaElement; + new(): HTMLMediaElement; + readonly HAVE_CURRENT_DATA: number; + readonly HAVE_ENOUGH_DATA: number; + readonly HAVE_FUTURE_DATA: number; + readonly HAVE_METADATA: number; + readonly HAVE_NOTHING: number; + readonly NETWORK_EMPTY: number; + readonly NETWORK_IDLE: number; + readonly NETWORK_LOADING: number; + readonly NETWORK_NO_SOURCE: number; +} + +interface HTMLMenuElement extends HTMLElement { + compact: boolean; + type: string; + addEventListener(type: K, listener: (this: HTMLMenuElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMenuElement: { + prototype: HTMLMenuElement; + new(): HTMLMenuElement; +} + +interface HTMLMetaElement extends HTMLElement { + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Gets or sets meta-information to associate with httpEquiv or name. + */ + content: string; + /** + * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. + */ + httpEquiv: string; + /** + * Sets or retrieves the value specified in the content attribute of the meta object. + */ + name: string; + /** + * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. + */ + scheme: string; + /** + * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. + */ + url: string; + addEventListener(type: K, listener: (this: HTMLMetaElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMetaElement: { + prototype: HTMLMetaElement; + new(): HTMLMetaElement; +} + +interface HTMLMeterElement extends HTMLElement { + high: number; + low: number; + max: number; + min: number; + optimum: number; + value: number; + addEventListener(type: K, listener: (this: HTMLMeterElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMeterElement: { + prototype: HTMLMeterElement; + new(): HTMLMeterElement; +} + +interface HTMLModElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; + addEventListener(type: K, listener: (this: HTMLModElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLModElement: { + prototype: HTMLModElement; + new(): HTMLModElement; +} + +interface HTMLOListElement extends HTMLElement { + compact: boolean; + /** + * The starting number. + */ + start: number; + type: string; + addEventListener(type: K, listener: (this: HTMLOListElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLOListElement: { + prototype: HTMLOListElement; + new(): HTMLOListElement; +} + +interface HTMLObjectElement extends HTMLElement, GetSVGDocument { + /** + * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. + */ + readonly BaseHref: string; + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Gets or sets the optional alternative HTML script to execute if the object fails to load. + */ + altHtml: string; + /** + * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. + */ + archive: string; + border: string; + /** + * Sets or retrieves the URL of the file containing the compiled Java class. + */ + code: string; + /** + * Sets or retrieves the URL of the component. + */ + codeBase: string; + /** + * Sets or retrieves the Internet media type for the code associated with the object. + */ + codeType: string; + /** + * Retrieves the document object of the page or frame. + */ + readonly contentDocument: Document; + /** + * Sets or retrieves the URL that references the data of the object. + */ + data: string; + declare: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Sets or retrieves the height of the object. + */ + height: string; + hspace: number; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + readonly msPlayToSource: any; + /** + * Sets or retrieves the name of the object. + */ + name: string; + readonly readyState: number; + /** + * Sets or retrieves a message to be displayed while an object is loading. + */ + standby: string; + /** + * Sets or retrieves the MIME type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + readonly validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + readonly validity: ValidityState; + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + readonly willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + addEventListener(type: K, listener: (this: HTMLObjectElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLObjectElement: { + prototype: HTMLObjectElement; + new(): HTMLObjectElement; +} + +interface HTMLOptGroupElement extends HTMLElement { + /** + * Sets or retrieves the status of an option. + */ + defaultSelected: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Sets or retrieves the ordinal position of an option in a list box. + */ + readonly index: number; + /** + * Sets or retrieves a value that you can use to implement your own label functionality for the object. + */ + label: string; + /** + * Sets or retrieves whether the option in the list box is the default item. + */ + selected: boolean; + /** + * Sets or retrieves the text string specified by the option tag. + */ + readonly text: string; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; + addEventListener(type: K, listener: (this: HTMLOptGroupElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLOptGroupElement: { + prototype: HTMLOptGroupElement; + new(): HTMLOptGroupElement; +} + +interface HTMLOptionElement extends HTMLElement { + /** + * Sets or retrieves the status of an option. + */ + defaultSelected: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Sets or retrieves the ordinal position of an option in a list box. + */ + readonly index: number; + /** + * Sets or retrieves a value that you can use to implement your own label functionality for the object. + */ + label: string; + /** + * Sets or retrieves whether the option in the list box is the default item. + */ + selected: boolean; + /** + * Sets or retrieves the text string specified by the option tag. + */ + text: string; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; + addEventListener(type: K, listener: (this: HTMLOptionElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLOptionElement: { + prototype: HTMLOptionElement; + new(): HTMLOptionElement; +} + +interface HTMLOptionsCollection extends HTMLCollectionOf { + length: number; + selectedIndex: number; + add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number): void; + remove(index: number): void; +} + +declare var HTMLOptionsCollection: { + prototype: HTMLOptionsCollection; + new(): HTMLOptionsCollection; +} + +interface HTMLOutputElement extends HTMLElement { + defaultValue: string; + readonly form: HTMLFormElement; + readonly htmlFor: DOMSettableTokenList; + name: string; + readonly type: string; + readonly validationMessage: string; + readonly validity: ValidityState; + value: string; + readonly willValidate: boolean; + checkValidity(): boolean; + reportValidity(): boolean; + setCustomValidity(error: string): void; + addEventListener(type: K, listener: (this: HTMLOutputElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLOutputElement: { + prototype: HTMLOutputElement; + new(): HTMLOutputElement; +} + +interface HTMLParagraphElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + clear: string; + addEventListener(type: K, listener: (this: HTMLParagraphElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLParagraphElement: { + prototype: HTMLParagraphElement; + new(): HTMLParagraphElement; +} + +interface HTMLParamElement extends HTMLElement { + /** + * Sets or retrieves the name of an input parameter for an element. + */ + name: string; + /** + * Sets or retrieves the content type of the resource designated by the value attribute. + */ + type: string; + /** + * Sets or retrieves the value of an input parameter for an element. + */ + value: string; + /** + * Sets or retrieves the data type of the value attribute. + */ + valueType: string; + addEventListener(type: K, listener: (this: HTMLParamElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLParamElement: { + prototype: HTMLParamElement; + new(): HTMLParamElement; +} + +interface HTMLPictureElement extends HTMLElement { + addEventListener(type: K, listener: (this: HTMLPictureElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLPictureElement: { + prototype: HTMLPictureElement; + new(): HTMLPictureElement; +} + +interface HTMLPreElement extends HTMLElement { + /** + * Sets or gets a value that you can use to implement your own width functionality for the object. + */ + width: number; + addEventListener(type: K, listener: (this: HTMLPreElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLPreElement: { + prototype: HTMLPreElement; + new(): HTMLPreElement; +} + +interface HTMLProgressElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Defines the maximum, or "done" value for a progress element. + */ + max: number; + /** + * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). + */ + readonly position: number; + /** + * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. + */ + value: number; + addEventListener(type: K, listener: (this: HTMLProgressElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLProgressElement: { + prototype: HTMLProgressElement; + new(): HTMLProgressElement; +} + +interface HTMLQuoteElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + addEventListener(type: K, listener: (this: HTMLQuoteElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLQuoteElement: { + prototype: HTMLQuoteElement; + new(): HTMLQuoteElement; +} + +interface HTMLScriptElement extends HTMLElement { + async: boolean; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + crossOrigin: string | null; + /** + * Sets or retrieves the status of the script. + */ + defer: boolean; + /** + * Sets or retrieves the event for which the script is written. + */ + event: string; + /** + * Sets or retrieves the object that is bound to the event script. + */ + htmlFor: string; + /** + * Retrieves the URL to an external file that contains the source code or data. + */ + src: string; + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + /** + * Sets or retrieves the MIME type for the associated scripting engine. + */ + type: string; + integrity: string; + addEventListener(type: K, listener: (this: HTMLScriptElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLScriptElement: { + prototype: HTMLScriptElement; + new(): HTMLScriptElement; +} + +interface HTMLSelectElement extends HTMLElement { + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Sets or retrieves the number of objects in a collection. + */ + length: number; + /** + * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. + */ + multiple: boolean; + /** + * Sets or retrieves the name of the object. + */ + name: string; + readonly options: HTMLOptionsCollection; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Sets or retrieves the index of the selected option in a select object. + */ + selectedIndex: number; + selectedOptions: HTMLCollectionOf; + /** + * Sets or retrieves the number of rows in the list box. + */ + size: number; + /** + * Retrieves the type of select control based on the value of the MULTIPLE attribute. + */ + readonly type: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + readonly validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + readonly validity: ValidityState; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + readonly willValidate: boolean; + /** + * Adds an element to the areas, controlRange, or options collection. + * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. + * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection. + */ + add(element: HTMLElement, before?: HTMLElement | number): void; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Retrieves a select object or an object from an options collection. + * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. + * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. + */ + item(name?: any, index?: any): any; + /** + * Retrieves a select object or an object from an options collection. + * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made. + */ + namedItem(name: string): any; + /** + * Removes an element from the collection. + * @param index Number that specifies the zero-based index of the element to remove from the collection. + */ + remove(index?: number): void; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + addEventListener(type: K, listener: (this: HTMLSelectElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [name: string]: any; +} + +declare var HTMLSelectElement: { + prototype: HTMLSelectElement; + new(): HTMLSelectElement; +} + +interface HTMLSourceElement extends HTMLElement { + /** + * Gets or sets the intended media type of the media source. + */ + media: string; + msKeySystem: string; + sizes: string; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + srcset: string; + /** + * Gets or sets the MIME type of a media resource. + */ + type: string; + addEventListener(type: K, listener: (this: HTMLSourceElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLSourceElement: { + prototype: HTMLSourceElement; + new(): HTMLSourceElement; +} + +interface HTMLSpanElement extends HTMLElement { + addEventListener(type: K, listener: (this: HTMLSpanElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLSpanElement: { + prototype: HTMLSpanElement; + new(): HTMLSpanElement; +} + +interface HTMLStyleElement extends HTMLElement, LinkStyle { + disabled: boolean; + /** + * Sets or retrieves the media type. + */ + media: string; + /** + * Retrieves the CSS language in which the style sheet is written. + */ + type: string; + addEventListener(type: K, listener: (this: HTMLStyleElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLStyleElement: { + prototype: HTMLStyleElement; + new(): HTMLStyleElement; +} + +interface HTMLTableCaptionElement extends HTMLElement { + /** + * Sets or retrieves the alignment of the caption or legend. + */ + align: string; + /** + * Sets or retrieves whether the caption appears at the top or bottom of the table. + */ + vAlign: string; + addEventListener(type: K, listener: (this: HTMLTableCaptionElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableCaptionElement: { + prototype: HTMLTableCaptionElement; + new(): HTMLTableCaptionElement; +} + +interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves abbreviated text for the object. + */ + abbr: string; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. + */ + axis: string; + bgColor: any; + /** + * Retrieves the position of the object in the cells collection of a row. + */ + readonly cellIndex: number; + /** + * Sets or retrieves the number columns in the table that the object should span. + */ + colSpan: number; + /** + * Sets or retrieves a list of header cells that provide information for the object. + */ + headers: string; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; + /** + * Sets or retrieves how many rows in a table the cell should span. + */ + rowSpan: number; + /** + * Sets or retrieves the group of cells in a table to which the object's information applies. + */ + scope: string; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: K, listener: (this: HTMLTableCellElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableCellElement: { + prototype: HTMLTableCellElement; + new(): HTMLTableCellElement; +} + +interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves the alignment of the object relative to the display or table. + */ + align: string; + /** + * Sets or retrieves the number of columns in the group. + */ + span: number; + /** + * Sets or retrieves the width of the object. + */ + width: any; + addEventListener(type: K, listener: (this: HTMLTableColElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableColElement: { + prototype: HTMLTableColElement; + new(): HTMLTableColElement; +} + +interface HTMLTableDataCellElement extends HTMLTableCellElement { + addEventListener(type: K, listener: (this: HTMLTableDataCellElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableDataCellElement: { + prototype: HTMLTableDataCellElement; + new(): HTMLTableDataCellElement; +} + +interface HTMLTableElement extends HTMLElement { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + bgColor: any; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Retrieves the caption object of a table. + */ + caption: HTMLTableCaptionElement; + /** + * Sets or retrieves the amount of space between the border of the cell and the content of the cell. + */ + cellPadding: string; + /** + * Sets or retrieves the amount of space between cells in a table. + */ + cellSpacing: string; + /** + * Sets or retrieves the number of columns in the table. + */ + cols: number; + /** + * Sets or retrieves the way the border frame around the table is displayed. + */ + frame: string; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: HTMLCollectionOf; + /** + * Sets or retrieves which dividing lines (inner borders) are displayed. + */ + rules: string; + /** + * Sets or retrieves a description and/or structure of the object. + */ + summary: string; + /** + * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. + */ + tBodies: HTMLCollectionOf; + /** + * Retrieves the tFoot object of the table. + */ + tFoot: HTMLTableSectionElement; + /** + * Retrieves the tHead object of the table. + */ + tHead: HTMLTableSectionElement; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Creates an empty caption element in the table. + */ + createCaption(): HTMLTableCaptionElement; + /** + * Creates an empty tBody element in the table. + */ + createTBody(): HTMLTableSectionElement; + /** + * Creates an empty tFoot element in the table. + */ + createTFoot(): HTMLTableSectionElement; + /** + * Returns the tHead element object if successful, or null otherwise. + */ + createTHead(): HTMLTableSectionElement; + /** + * Deletes the caption element and its contents from the table. + */ + deleteCaption(): void; + /** + * Removes the specified row (tr) from the element and from the rows collection. + * @param index Number that specifies the zero-based position in the rows collection of the row to remove. + */ + deleteRow(index?: number): void; + /** + * Deletes the tFoot element and its contents from the table. + */ + deleteTFoot(): void; + /** + * Deletes the tHead element and its contents from the table. + */ + deleteTHead(): void; + /** + * Creates a new row (tr) in the table, and adds the row to the rows collection. + * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. + */ + insertRow(index?: number): HTMLTableRowElement; + addEventListener(type: K, listener: (this: HTMLTableElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableElement: { + prototype: HTMLTableElement; + new(): HTMLTableElement; +} + +interface HTMLTableHeaderCellElement extends HTMLTableCellElement { + /** + * Sets or retrieves the group of cells in a table to which the object's information applies. + */ + scope: string; + addEventListener(type: K, listener: (this: HTMLTableHeaderCellElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableHeaderCellElement: { + prototype: HTMLTableHeaderCellElement; + new(): HTMLTableHeaderCellElement; +} + +interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + bgColor: any; + /** + * Retrieves a collection of all cells in the table row. + */ + cells: HTMLCollectionOf; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Retrieves the position of the object in the rows collection for the table. + */ + readonly rowIndex: number; + /** + * Retrieves the position of the object in the collection. + */ + readonly sectionRowIndex: number; + /** + * Removes the specified cell from the table row, as well as from the cells collection. + * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted. + */ + deleteCell(index?: number): void; + /** + * Creates a new cell in the table row, and adds the cell to the cells collection. + * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. + */ + insertCell(index?: number): HTMLTableDataCellElement; + addEventListener(type: K, listener: (this: HTMLTableRowElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableRowElement: { + prototype: HTMLTableRowElement; + new(): HTMLTableRowElement; +} + +interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: HTMLCollectionOf; + /** + * Removes the specified row (tr) from the element and from the rows collection. + * @param index Number that specifies the zero-based position in the rows collection of the row to remove. + */ + deleteRow(index?: number): void; + /** + * Creates a new row (tr) in the table, and adds the row to the rows collection. + * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. + */ + insertRow(index?: number): HTMLTableRowElement; + addEventListener(type: K, listener: (this: HTMLTableSectionElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableSectionElement: { + prototype: HTMLTableSectionElement; + new(): HTMLTableSectionElement; +} + +interface HTMLTemplateElement extends HTMLElement { + readonly content: DocumentFragment; + addEventListener(type: K, listener: (this: HTMLTemplateElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTemplateElement: { + prototype: HTMLTemplateElement; + new(): HTMLTemplateElement; +} + +interface HTMLTextAreaElement extends HTMLElement { + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * Sets or retrieves the width of the object. + */ + cols: number; + /** + * Sets or retrieves the initial contents of the object. + */ + defaultValue: string; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Sets or retrieves the maximum number of characters that the user can enter in a text control. + */ + maxLength: number; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. + */ + placeholder: string; + /** + * Sets or retrieves the value indicated whether the content of the object is read-only. + */ + readOnly: boolean; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: number; + /** + * Gets or sets the end position or offset of a text selection. + */ + selectionEnd: number; + /** + * Gets or sets the starting position or offset of a text selection. + */ + selectionStart: number; + /** + * Sets or retrieves the value indicating whether the control is selected. + */ + status: any; + /** + * Retrieves the type of control. + */ + readonly type: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + readonly validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + readonly validity: ValidityState; + /** + * Retrieves or sets the text in the entry field of the textArea element. + */ + value: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + readonly willValidate: boolean; + /** + * Sets or retrieves how to handle wordwrapping in the object. + */ + wrap: string; + minLength: number; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Highlights the input area of a form element. + */ + select(): void; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + /** + * Sets the start and end positions of a selection in a text field. + * @param start The offset into the text field for the start of the selection. + * @param end The offset into the text field for the end of the selection. + */ + setSelectionRange(start: number, end: number): void; + addEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTextAreaElement: { + prototype: HTMLTextAreaElement; + new(): HTMLTextAreaElement; +} + +interface HTMLTimeElement extends HTMLElement { + dateTime: string; + addEventListener(type: K, listener: (this: HTMLTimeElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTimeElement: { + prototype: HTMLTimeElement; + new(): HTMLTimeElement; +} + +interface HTMLTitleElement extends HTMLElement { + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + addEventListener(type: K, listener: (this: HTMLTitleElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTitleElement: { + prototype: HTMLTitleElement; + new(): HTMLTitleElement; +} + +interface HTMLTrackElement extends HTMLElement { + default: boolean; + kind: string; + label: string; + readonly readyState: number; + src: string; + srclang: string; + readonly track: TextTrack; + readonly ERROR: number; + readonly LOADED: number; + readonly LOADING: number; + readonly NONE: number; + addEventListener(type: K, listener: (this: HTMLTrackElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTrackElement: { + prototype: HTMLTrackElement; + new(): HTMLTrackElement; + readonly ERROR: number; + readonly LOADED: number; + readonly LOADING: number; + readonly NONE: number; +} + +interface HTMLUListElement extends HTMLElement { + compact: boolean; + type: string; + addEventListener(type: K, listener: (this: HTMLUListElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLUListElement: { + prototype: HTMLUListElement; + new(): HTMLUListElement; +} + +interface HTMLUnknownElement extends HTMLElement { + addEventListener(type: K, listener: (this: HTMLUnknownElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLUnknownElement: { + prototype: HTMLUnknownElement; + new(): HTMLUnknownElement; +} + +interface HTMLVideoElementEventMap extends HTMLMediaElementEventMap { + "MSVideoFormatChanged": Event; + "MSVideoFrameStepCompleted": Event; + "MSVideoOptimalLayoutChanged": Event; +} + +interface HTMLVideoElement extends HTMLMediaElement { + /** + * Gets or sets the height of the video element. + */ + height: number; + msHorizontalMirror: boolean; + readonly msIsLayoutOptimalForPlayback: boolean; + readonly msIsStereo3D: boolean; + msStereo3DPackingMode: string; + msStereo3DRenderMode: string; + msZoom: boolean; + onMSVideoFormatChanged: (this: HTMLVideoElement, ev: Event) => any; + onMSVideoFrameStepCompleted: (this: HTMLVideoElement, ev: Event) => any; + onMSVideoOptimalLayoutChanged: (this: HTMLVideoElement, ev: Event) => any; + /** + * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. + */ + poster: string; + /** + * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. + */ + readonly videoHeight: number; + /** + * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. + */ + readonly videoWidth: number; + readonly webkitDisplayingFullscreen: boolean; + readonly webkitSupportsFullscreen: boolean; + /** + * Gets or sets the width of the video element. + */ + width: number; + getVideoPlaybackQuality(): VideoPlaybackQuality; + msFrameStep(forward: boolean): void; + msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; + msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; + webkitEnterFullScreen(): void; + webkitEnterFullscreen(): void; + webkitExitFullScreen(): void; + webkitExitFullscreen(): void; + addEventListener(type: K, listener: (this: HTMLVideoElement, ev: HTMLVideoElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLVideoElement: { + prototype: HTMLVideoElement; + new(): HTMLVideoElement; +} + +interface HashChangeEvent extends Event { + readonly newURL: string | null; + readonly oldURL: string | null; +} + +declare var HashChangeEvent: { + prototype: HashChangeEvent; + new(typeArg: string, eventInitDict?: HashChangeEventInit): HashChangeEvent; +} + +interface Headers { + append(name: string, value: string): void; + delete(name: string): void; + forEach(callback: ForEachCallback): void; + get(name: string): string | null; + has(name: string): boolean; + set(name: string, value: string): void; +} + +declare var Headers: { + prototype: Headers; + new(init?: any): Headers; +} + +interface History { + readonly length: number; + readonly state: any; + scrollRestoration: ScrollRestoration; + back(): void; + forward(): void; + go(delta?: number): void; + pushState(data: any, title: string, url?: string | null): void; + replaceState(data: any, title: string, url?: string | null): void; +} + +declare var History: { + prototype: History; + new(): History; +} + +interface IDBCursor { + readonly direction: IDBCursorDirection; + key: IDBKeyRange | IDBValidKey; + readonly primaryKey: any; + source: IDBObjectStore | IDBIndex; + advance(count: number): void; + continue(key?: IDBKeyRange | IDBValidKey): void; + delete(): IDBRequest; + update(value: any): IDBRequest; + readonly NEXT: string; + readonly NEXT_NO_DUPLICATE: string; + readonly PREV: string; + readonly PREV_NO_DUPLICATE: string; +} + +declare var IDBCursor: { + prototype: IDBCursor; + new(): IDBCursor; + readonly NEXT: string; + readonly NEXT_NO_DUPLICATE: string; + readonly PREV: string; + readonly PREV_NO_DUPLICATE: string; +} + +interface IDBCursorWithValue extends IDBCursor { + readonly value: any; +} + +declare var IDBCursorWithValue: { + prototype: IDBCursorWithValue; + new(): IDBCursorWithValue; +} + +interface IDBDatabaseEventMap { + "abort": Event; + "error": Event; +} + +interface IDBDatabase extends EventTarget { + readonly name: string; + readonly objectStoreNames: DOMStringList; + onabort: (this: IDBDatabase, ev: Event) => any; + onerror: (this: IDBDatabase, ev: Event) => any; + version: number; + onversionchange: (ev: IDBVersionChangeEvent) => any; + close(): void; + createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore; + deleteObjectStore(name: string): void; + transaction(storeNames: string | string[], mode?: string): IDBTransaction; + addEventListener(type: "versionchange", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBDatabase: { + prototype: IDBDatabase; + new(): IDBDatabase; +} + +interface IDBFactory { + cmp(first: any, second: any): number; + deleteDatabase(name: string): IDBOpenDBRequest; + open(name: string, version?: number): IDBOpenDBRequest; +} + +declare var IDBFactory: { + prototype: IDBFactory; + new(): IDBFactory; +} + +interface IDBIndex { + keyPath: string | string[]; + readonly name: string; + readonly objectStore: IDBObjectStore; + readonly unique: boolean; + multiEntry: boolean; + count(key?: IDBKeyRange | IDBValidKey): IDBRequest; + get(key: IDBKeyRange | IDBValidKey): IDBRequest; + getKey(key: IDBKeyRange | IDBValidKey): IDBRequest; + openCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; + openKeyCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; +} + +declare var IDBIndex: { + prototype: IDBIndex; + new(): IDBIndex; +} + +interface IDBKeyRange { + readonly lower: any; + readonly lowerOpen: boolean; + readonly upper: any; + readonly upperOpen: boolean; +} + +declare var IDBKeyRange: { + prototype: IDBKeyRange; + new(): IDBKeyRange; + bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; + lowerBound(lower: any, open?: boolean): IDBKeyRange; + only(value: any): IDBKeyRange; + upperBound(upper: any, open?: boolean): IDBKeyRange; +} + +interface IDBObjectStore { + readonly indexNames: DOMStringList; + keyPath: string | string[]; + readonly name: string; + readonly transaction: IDBTransaction; + autoIncrement: boolean; + add(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest; + clear(): IDBRequest; + count(key?: IDBKeyRange | IDBValidKey): IDBRequest; + createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex; + delete(key: IDBKeyRange | IDBValidKey): IDBRequest; + deleteIndex(indexName: string): void; + get(key: any): IDBRequest; + index(name: string): IDBIndex; + openCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; + put(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest; +} + +declare var IDBObjectStore: { + prototype: IDBObjectStore; + new(): IDBObjectStore; +} + +interface IDBOpenDBRequestEventMap extends IDBRequestEventMap { + "blocked": Event; + "upgradeneeded": IDBVersionChangeEvent; +} + +interface IDBOpenDBRequest extends IDBRequest { + onblocked: (this: IDBOpenDBRequest, ev: Event) => any; + onupgradeneeded: (this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any; + addEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBOpenDBRequest: { + prototype: IDBOpenDBRequest; + new(): IDBOpenDBRequest; +} + +interface IDBRequestEventMap { + "error": Event; + "success": Event; +} + +interface IDBRequest extends EventTarget { + readonly error: DOMError; + onerror: (this: IDBRequest, ev: Event) => any; + onsuccess: (this: IDBRequest, ev: Event) => any; + readonly readyState: IDBRequestReadyState; + readonly result: any; + source: IDBObjectStore | IDBIndex | IDBCursor; + readonly transaction: IDBTransaction; + addEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBRequest: { + prototype: IDBRequest; + new(): IDBRequest; +} + +interface IDBTransactionEventMap { + "abort": Event; + "complete": Event; + "error": Event; +} + +interface IDBTransaction extends EventTarget { + readonly db: IDBDatabase; + readonly error: DOMError; + readonly mode: IDBTransactionMode; + onabort: (this: IDBTransaction, ev: Event) => any; + oncomplete: (this: IDBTransaction, ev: Event) => any; + onerror: (this: IDBTransaction, ev: Event) => any; + abort(): void; + objectStore(name: string): IDBObjectStore; + readonly READ_ONLY: string; + readonly READ_WRITE: string; + readonly VERSION_CHANGE: string; + addEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBTransaction: { + prototype: IDBTransaction; + new(): IDBTransaction; + readonly READ_ONLY: string; + readonly READ_WRITE: string; + readonly VERSION_CHANGE: string; +} + +interface IDBVersionChangeEvent extends Event { + readonly newVersion: number | null; + readonly oldVersion: number; +} + +declare var IDBVersionChangeEvent: { + prototype: IDBVersionChangeEvent; + new(): IDBVersionChangeEvent; +} + +interface IIRFilterNode extends AudioNode { + getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void; +} + +declare var IIRFilterNode: { + prototype: IIRFilterNode; + new(): IIRFilterNode; +} + +interface ImageData { + data: Uint8ClampedArray; + readonly height: number; + readonly width: number; +} + +declare var ImageData: { + prototype: ImageData; + new(width: number, height: number): ImageData; + new(array: Uint8ClampedArray, width: number, height: number): ImageData; +} + +interface IntersectionObserver { + readonly root: Element | null; + readonly rootMargin: string; + readonly thresholds: number[]; + disconnect(): void; + observe(target: Element): void; + takeRecords(): IntersectionObserverEntry[]; + unobserve(target: Element): void; +} + +declare var IntersectionObserver: { + prototype: IntersectionObserver; + new(callback: IntersectionObserverCallback, options?: IntersectionObserverInit): IntersectionObserver; +} + +interface IntersectionObserverEntry { + readonly boundingClientRect: ClientRect; + readonly intersectionRatio: number; + readonly intersectionRect: ClientRect; + readonly rootBounds: ClientRect; + readonly target: Element; + readonly time: number; +} + +declare var IntersectionObserverEntry: { + prototype: IntersectionObserverEntry; + new(intersectionObserverEntryInit: IntersectionObserverEntryInit): IntersectionObserverEntry; +} + +interface KeyboardEvent extends UIEvent { + readonly altKey: boolean; + readonly char: string | null; + readonly charCode: number; + readonly ctrlKey: boolean; + readonly key: string; + readonly keyCode: number; + readonly locale: string; + readonly location: number; + readonly metaKey: boolean; + readonly repeat: boolean; + readonly shiftKey: boolean; + readonly which: number; + readonly code: string; + getModifierState(keyArg: string): boolean; + initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; + readonly DOM_KEY_LOCATION_JOYSTICK: number; + readonly DOM_KEY_LOCATION_LEFT: number; + readonly DOM_KEY_LOCATION_MOBILE: number; + readonly DOM_KEY_LOCATION_NUMPAD: number; + readonly DOM_KEY_LOCATION_RIGHT: number; + readonly DOM_KEY_LOCATION_STANDARD: number; +} + +declare var KeyboardEvent: { + prototype: KeyboardEvent; + new(typeArg: string, eventInitDict?: KeyboardEventInit): KeyboardEvent; + readonly DOM_KEY_LOCATION_JOYSTICK: number; + readonly DOM_KEY_LOCATION_LEFT: number; + readonly DOM_KEY_LOCATION_MOBILE: number; + readonly DOM_KEY_LOCATION_NUMPAD: number; + readonly DOM_KEY_LOCATION_RIGHT: number; + readonly DOM_KEY_LOCATION_STANDARD: number; +} + +interface ListeningStateChangedEvent extends Event { + readonly label: string; + readonly state: ListeningState; +} + +declare var ListeningStateChangedEvent: { + prototype: ListeningStateChangedEvent; + new(): ListeningStateChangedEvent; +} + +interface Location { + hash: string; + host: string; + hostname: string; + href: string; + readonly origin: string; + pathname: string; + port: string; + protocol: string; + search: string; + assign(url: string): void; + reload(forcedReload?: boolean): void; + replace(url: string): void; + toString(): string; +} + +declare var Location: { + prototype: Location; + new(): Location; +} + +interface LongRunningScriptDetectedEvent extends Event { + readonly executionTime: number; + stopPageScriptExecution: boolean; +} + +declare var LongRunningScriptDetectedEvent: { + prototype: LongRunningScriptDetectedEvent; + new(): LongRunningScriptDetectedEvent; +} + +interface MSApp { + clearTemporaryWebDataAsync(): MSAppAsyncOperation; + createBlobFromRandomAccessStream(type: string, seeker: any): Blob; + createDataPackage(object: any): any; + createDataPackageFromSelection(): any; + createFileFromStorageFile(storageFile: any): File; + createStreamFromInputStream(type: string, inputStream: any): MSStream; + execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; + execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; + getCurrentPriority(): string; + getHtmlPrintDocumentSourceAsync(htmlDoc: any): Promise; + getViewId(view: any): any; + isTaskScheduledAtPriorityOrHigher(priority: string): boolean; + pageHandlesAllApplicationActivations(enabled: boolean): void; + suppressSubdownloadCredentialPrompts(suppress: boolean): void; + terminateApp(exceptionObject: any): void; + readonly CURRENT: string; + readonly HIGH: string; + readonly IDLE: string; + readonly NORMAL: string; +} +declare var MSApp: MSApp; + +interface MSAppAsyncOperationEventMap { + "complete": Event; + "error": Event; +} + +interface MSAppAsyncOperation extends EventTarget { + readonly error: DOMError; + oncomplete: (this: MSAppAsyncOperation, ev: Event) => any; + onerror: (this: MSAppAsyncOperation, ev: Event) => any; + readonly readyState: number; + readonly result: any; + start(): void; + readonly COMPLETED: number; + readonly ERROR: number; + readonly STARTED: number; + addEventListener(type: K, listener: (this: MSAppAsyncOperation, ev: MSAppAsyncOperationEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSAppAsyncOperation: { + prototype: MSAppAsyncOperation; + new(): MSAppAsyncOperation; + readonly COMPLETED: number; + readonly ERROR: number; + readonly STARTED: number; +} + +interface MSAssertion { + readonly id: string; + readonly type: MSCredentialType; +} + +declare var MSAssertion: { + prototype: MSAssertion; + new(): MSAssertion; +} + +interface MSBlobBuilder { + append(data: any, endings?: string): void; + getBlob(contentType?: string): Blob; +} + +declare var MSBlobBuilder: { + prototype: MSBlobBuilder; + new(): MSBlobBuilder; +} + +interface MSCredentials { + getAssertion(challenge: string, filter?: MSCredentialFilter, params?: MSSignatureParameters): Promise; + makeCredential(accountInfo: MSAccountInfo, params: MSCredentialParameters[], challenge?: string): Promise; +} + +declare var MSCredentials: { + prototype: MSCredentials; + new(): MSCredentials; +} + +interface MSFIDOCredentialAssertion extends MSAssertion { + readonly algorithm: string | Algorithm; + readonly attestation: any; + readonly publicKey: string; + readonly transportHints: MSTransportType[]; +} + +declare var MSFIDOCredentialAssertion: { + prototype: MSFIDOCredentialAssertion; + new(): MSFIDOCredentialAssertion; +} + +interface MSFIDOSignature { + readonly authnrData: string; + readonly clientData: string; + readonly signature: string; +} + +declare var MSFIDOSignature: { + prototype: MSFIDOSignature; + new(): MSFIDOSignature; +} + +interface MSFIDOSignatureAssertion extends MSAssertion { + readonly signature: MSFIDOSignature; +} + +declare var MSFIDOSignatureAssertion: { + prototype: MSFIDOSignatureAssertion; + new(): MSFIDOSignatureAssertion; +} + +interface MSGesture { + target: Element; + addPointer(pointerId: number): void; + stop(): void; +} + +declare var MSGesture: { + prototype: MSGesture; + new(): MSGesture; +} + +interface MSGestureEvent extends UIEvent { + readonly clientX: number; + readonly clientY: number; + readonly expansion: number; + readonly gestureObject: any; + readonly hwTimestamp: number; + readonly offsetX: number; + readonly offsetY: number; + readonly rotation: number; + readonly scale: number; + readonly screenX: number; + readonly screenY: number; + readonly translationX: number; + readonly translationY: number; + readonly velocityAngular: number; + readonly velocityExpansion: number; + readonly velocityX: number; + readonly velocityY: number; + initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; + readonly MSGESTURE_FLAG_BEGIN: number; + readonly MSGESTURE_FLAG_CANCEL: number; + readonly MSGESTURE_FLAG_END: number; + readonly MSGESTURE_FLAG_INERTIA: number; + readonly MSGESTURE_FLAG_NONE: number; +} + +declare var MSGestureEvent: { + prototype: MSGestureEvent; + new(): MSGestureEvent; + readonly MSGESTURE_FLAG_BEGIN: number; + readonly MSGESTURE_FLAG_CANCEL: number; + readonly MSGESTURE_FLAG_END: number; + readonly MSGESTURE_FLAG_INERTIA: number; + readonly MSGESTURE_FLAG_NONE: number; +} + +interface MSGraphicsTrust { + readonly constrictionActive: boolean; + readonly status: string; +} + +declare var MSGraphicsTrust: { + prototype: MSGraphicsTrust; + new(): MSGraphicsTrust; +} + +interface MSHTMLWebViewElement extends HTMLElement { + readonly canGoBack: boolean; + readonly canGoForward: boolean; + readonly containsFullScreenElement: boolean; + readonly documentTitle: string; + height: number; + readonly settings: MSWebViewSettings; + src: string; + width: number; + addWebAllowedObject(name: string, applicationObject: any): void; + buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; + capturePreviewToBlobAsync(): MSWebViewAsyncOperation; + captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; + getDeferredPermissionRequestById(id: number): DeferredPermissionRequest; + getDeferredPermissionRequests(): DeferredPermissionRequest[]; + goBack(): void; + goForward(): void; + invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; + navigate(uri: string): void; + navigateFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void; + navigateToLocalStreamUri(source: string, streamResolver: any): void; + navigateToString(contents: string): void; + navigateWithHttpRequestMessage(requestMessage: any): void; + refresh(): void; + stop(): void; + addEventListener(type: K, listener: (this: MSHTMLWebViewElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSHTMLWebViewElement: { + prototype: MSHTMLWebViewElement; + new(): MSHTMLWebViewElement; +} + +interface MSInputMethodContextEventMap { + "MSCandidateWindowHide": Event; + "MSCandidateWindowShow": Event; + "MSCandidateWindowUpdate": Event; +} + +interface MSInputMethodContext extends EventTarget { + readonly compositionEndOffset: number; + readonly compositionStartOffset: number; + oncandidatewindowhide: (this: MSInputMethodContext, ev: Event) => any; + oncandidatewindowshow: (this: MSInputMethodContext, ev: Event) => any; + oncandidatewindowupdate: (this: MSInputMethodContext, ev: Event) => any; + readonly target: HTMLElement; + getCandidateWindowClientRect(): ClientRect; + getCompositionAlternatives(): string[]; + hasComposition(): boolean; + isCandidateWindowVisible(): boolean; + addEventListener(type: K, listener: (this: MSInputMethodContext, ev: MSInputMethodContextEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSInputMethodContext: { + prototype: MSInputMethodContext; + new(): MSInputMethodContext; +} + +interface MSManipulationEvent extends UIEvent { + readonly currentState: number; + readonly inertiaDestinationX: number; + readonly inertiaDestinationY: number; + readonly lastState: number; + initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; + readonly MS_MANIPULATION_STATE_ACTIVE: number; + readonly MS_MANIPULATION_STATE_CANCELLED: number; + readonly MS_MANIPULATION_STATE_COMMITTED: number; + readonly MS_MANIPULATION_STATE_DRAGGING: number; + readonly MS_MANIPULATION_STATE_INERTIA: number; + readonly MS_MANIPULATION_STATE_PRESELECT: number; + readonly MS_MANIPULATION_STATE_SELECTING: number; + readonly MS_MANIPULATION_STATE_STOPPED: number; +} + +declare var MSManipulationEvent: { + prototype: MSManipulationEvent; + new(): MSManipulationEvent; + readonly MS_MANIPULATION_STATE_ACTIVE: number; + readonly MS_MANIPULATION_STATE_CANCELLED: number; + readonly MS_MANIPULATION_STATE_COMMITTED: number; + readonly MS_MANIPULATION_STATE_DRAGGING: number; + readonly MS_MANIPULATION_STATE_INERTIA: number; + readonly MS_MANIPULATION_STATE_PRESELECT: number; + readonly MS_MANIPULATION_STATE_SELECTING: number; + readonly MS_MANIPULATION_STATE_STOPPED: number; +} + +interface MSMediaKeyError { + readonly code: number; + readonly systemCode: number; + readonly MS_MEDIA_KEYERR_CLIENT: number; + readonly MS_MEDIA_KEYERR_DOMAIN: number; + readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number; + readonly MS_MEDIA_KEYERR_OUTPUT: number; + readonly MS_MEDIA_KEYERR_SERVICE: number; + readonly MS_MEDIA_KEYERR_UNKNOWN: number; +} + +declare var MSMediaKeyError: { + prototype: MSMediaKeyError; + new(): MSMediaKeyError; + readonly MS_MEDIA_KEYERR_CLIENT: number; + readonly MS_MEDIA_KEYERR_DOMAIN: number; + readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number; + readonly MS_MEDIA_KEYERR_OUTPUT: number; + readonly MS_MEDIA_KEYERR_SERVICE: number; + readonly MS_MEDIA_KEYERR_UNKNOWN: number; +} + +interface MSMediaKeyMessageEvent extends Event { + readonly destinationURL: string | null; + readonly message: Uint8Array; +} + +declare var MSMediaKeyMessageEvent: { + prototype: MSMediaKeyMessageEvent; + new(): MSMediaKeyMessageEvent; +} + +interface MSMediaKeyNeededEvent extends Event { + readonly initData: Uint8Array | null; +} + +declare var MSMediaKeyNeededEvent: { + prototype: MSMediaKeyNeededEvent; + new(): MSMediaKeyNeededEvent; +} + +interface MSMediaKeySession extends EventTarget { + readonly error: MSMediaKeyError | null; + readonly keySystem: string; + readonly sessionId: string; + close(): void; + update(key: Uint8Array): void; +} + +declare var MSMediaKeySession: { + prototype: MSMediaKeySession; + new(): MSMediaKeySession; +} + +interface MSMediaKeys { + readonly keySystem: string; + createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; +} + +declare var MSMediaKeys: { + prototype: MSMediaKeys; + new(keySystem: string): MSMediaKeys; + isTypeSupported(keySystem: string, type?: string): boolean; + isTypeSupportedWithFeatures(keySystem: string, type?: string): string; +} + +interface MSPointerEvent extends MouseEvent { + readonly currentPoint: any; + readonly height: number; + readonly hwTimestamp: number; + readonly intermediatePoints: any; + readonly isPrimary: boolean; + readonly pointerId: number; + readonly pointerType: any; + readonly pressure: number; + readonly rotation: number; + readonly tiltX: number; + readonly tiltY: number; + readonly width: number; + getCurrentPoint(element: Element): void; + getIntermediatePoints(element: Element): void; + initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; +} + +declare var MSPointerEvent: { + prototype: MSPointerEvent; + new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent; +} + +interface MSRangeCollection { + readonly length: number; + item(index: number): Range; + [index: number]: Range; +} + +declare var MSRangeCollection: { + prototype: MSRangeCollection; + new(): MSRangeCollection; +} + +interface MSSiteModeEvent extends Event { + readonly actionURL: string; + readonly buttonID: number; +} + +declare var MSSiteModeEvent: { + prototype: MSSiteModeEvent; + new(): MSSiteModeEvent; +} + +interface MSStream { + readonly type: string; + msClose(): void; + msDetachStream(): any; +} + +declare var MSStream: { + prototype: MSStream; + new(): MSStream; +} + +interface MSStreamReader extends EventTarget, MSBaseReader { + readonly error: DOMError; + readAsArrayBuffer(stream: MSStream, size?: number): void; + readAsBinaryString(stream: MSStream, size?: number): void; + readAsBlob(stream: MSStream, size?: number): void; + readAsDataURL(stream: MSStream, size?: number): void; + readAsText(stream: MSStream, encoding?: string, size?: number): void; + addEventListener(type: K, listener: (this: MSStreamReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSStreamReader: { + prototype: MSStreamReader; + new(): MSStreamReader; +} + +interface MSWebViewAsyncOperationEventMap { + "complete": Event; + "error": Event; +} + +interface MSWebViewAsyncOperation extends EventTarget { + readonly error: DOMError; + oncomplete: (this: MSWebViewAsyncOperation, ev: Event) => any; + onerror: (this: MSWebViewAsyncOperation, ev: Event) => any; + readonly readyState: number; + readonly result: any; + readonly target: MSHTMLWebViewElement; + readonly type: number; + start(): void; + readonly COMPLETED: number; + readonly ERROR: number; + readonly STARTED: number; + readonly TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; + readonly TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; + readonly TYPE_INVOKE_SCRIPT: number; + addEventListener(type: K, listener: (this: MSWebViewAsyncOperation, ev: MSWebViewAsyncOperationEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSWebViewAsyncOperation: { + prototype: MSWebViewAsyncOperation; + new(): MSWebViewAsyncOperation; + readonly COMPLETED: number; + readonly ERROR: number; + readonly STARTED: number; + readonly TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; + readonly TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; + readonly TYPE_INVOKE_SCRIPT: number; +} + +interface MSWebViewSettings { + isIndexedDBEnabled: boolean; + isJavaScriptEnabled: boolean; +} + +declare var MSWebViewSettings: { + prototype: MSWebViewSettings; + new(): MSWebViewSettings; +} + +interface MediaDeviceInfo { + readonly deviceId: string; + readonly groupId: string; + readonly kind: MediaDeviceKind; + readonly label: string; +} + +declare var MediaDeviceInfo: { + prototype: MediaDeviceInfo; + new(): MediaDeviceInfo; +} + +interface MediaDevicesEventMap { + "devicechange": Event; +} + +interface MediaDevices extends EventTarget { + ondevicechange: (this: MediaDevices, ev: Event) => any; + enumerateDevices(): any; + getSupportedConstraints(): MediaTrackSupportedConstraints; + getUserMedia(constraints: MediaStreamConstraints): Promise; + addEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MediaDevices: { + prototype: MediaDevices; + new(): MediaDevices; +} + +interface MediaElementAudioSourceNode extends AudioNode { +} + +declare var MediaElementAudioSourceNode: { + prototype: MediaElementAudioSourceNode; + new(): MediaElementAudioSourceNode; +} + +interface MediaEncryptedEvent extends Event { + readonly initData: ArrayBuffer | null; + readonly initDataType: string; +} + +declare var MediaEncryptedEvent: { + prototype: MediaEncryptedEvent; + new(type: string, eventInitDict?: MediaEncryptedEventInit): MediaEncryptedEvent; +} + +interface MediaError { + readonly code: number; + readonly msExtendedCode: number; + readonly MEDIA_ERR_ABORTED: number; + readonly MEDIA_ERR_DECODE: number; + readonly MEDIA_ERR_NETWORK: number; + readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number; + readonly MS_MEDIA_ERR_ENCRYPTED: number; +} + +declare var MediaError: { + prototype: MediaError; + new(): MediaError; + readonly MEDIA_ERR_ABORTED: number; + readonly MEDIA_ERR_DECODE: number; + readonly MEDIA_ERR_NETWORK: number; + readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number; + readonly MS_MEDIA_ERR_ENCRYPTED: number; +} + +interface MediaKeyMessageEvent extends Event { + readonly message: ArrayBuffer; + readonly messageType: MediaKeyMessageType; +} + +declare var MediaKeyMessageEvent: { + prototype: MediaKeyMessageEvent; + new(type: string, eventInitDict?: MediaKeyMessageEventInit): MediaKeyMessageEvent; +} + +interface MediaKeySession extends EventTarget { + readonly closed: Promise; + readonly expiration: number; + readonly keyStatuses: MediaKeyStatusMap; + readonly sessionId: string; + close(): Promise; + generateRequest(initDataType: string, initData: any): Promise; + load(sessionId: string): Promise; + remove(): Promise; + update(response: any): Promise; +} + +declare var MediaKeySession: { + prototype: MediaKeySession; + new(): MediaKeySession; +} + +interface MediaKeyStatusMap { + readonly size: number; + forEach(callback: ForEachCallback): void; + get(keyId: any): MediaKeyStatus; + has(keyId: any): boolean; +} + +declare var MediaKeyStatusMap: { + prototype: MediaKeyStatusMap; + new(): MediaKeyStatusMap; +} + +interface MediaKeySystemAccess { + readonly keySystem: string; + createMediaKeys(): Promise; + getConfiguration(): MediaKeySystemConfiguration; +} + +declare var MediaKeySystemAccess: { + prototype: MediaKeySystemAccess; + new(): MediaKeySystemAccess; +} + +interface MediaKeys { + createSession(sessionType?: MediaKeySessionType): MediaKeySession; + setServerCertificate(serverCertificate: any): Promise; +} + +declare var MediaKeys: { + prototype: MediaKeys; + new(): MediaKeys; +} + +interface MediaList { + readonly length: number; + mediaText: string; + appendMedium(newMedium: string): void; + deleteMedium(oldMedium: string): void; + item(index: number): string; + toString(): string; + [index: number]: string; +} + +declare var MediaList: { + prototype: MediaList; + new(): MediaList; +} + +interface MediaQueryList { + readonly matches: boolean; + readonly media: string; + addListener(listener: MediaQueryListListener): void; + removeListener(listener: MediaQueryListListener): void; +} + +declare var MediaQueryList: { + prototype: MediaQueryList; + new(): MediaQueryList; +} + +interface MediaSource extends EventTarget { + readonly activeSourceBuffers: SourceBufferList; + duration: number; + readonly readyState: string; + readonly sourceBuffers: SourceBufferList; + addSourceBuffer(type: string): SourceBuffer; + endOfStream(error?: number): void; + removeSourceBuffer(sourceBuffer: SourceBuffer): void; +} + +declare var MediaSource: { + prototype: MediaSource; + new(): MediaSource; + isTypeSupported(type: string): boolean; +} + +interface MediaStreamEventMap { + "active": Event; + "addtrack": MediaStreamTrackEvent; + "inactive": Event; + "removetrack": MediaStreamTrackEvent; +} + +interface MediaStream extends EventTarget { + readonly active: boolean; + readonly id: string; + onactive: (this: MediaStream, ev: Event) => any; + onaddtrack: (this: MediaStream, ev: MediaStreamTrackEvent) => any; + oninactive: (this: MediaStream, ev: Event) => any; + onremovetrack: (this: MediaStream, ev: MediaStreamTrackEvent) => any; + addTrack(track: MediaStreamTrack): void; + clone(): MediaStream; + getAudioTracks(): MediaStreamTrack[]; + getTrackById(trackId: string): MediaStreamTrack | null; + getTracks(): MediaStreamTrack[]; + getVideoTracks(): MediaStreamTrack[]; + removeTrack(track: MediaStreamTrack): void; + stop(): void; + addEventListener(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MediaStream: { + prototype: MediaStream; + new(streamOrTracks?: MediaStream | MediaStreamTrack[]): MediaStream; +} + +interface MediaStreamAudioSourceNode extends AudioNode { +} + +declare var MediaStreamAudioSourceNode: { + prototype: MediaStreamAudioSourceNode; + new(): MediaStreamAudioSourceNode; +} + +interface MediaStreamError { + readonly constraintName: string | null; + readonly message: string | null; + readonly name: string; +} + +declare var MediaStreamError: { + prototype: MediaStreamError; + new(): MediaStreamError; +} + +interface MediaStreamErrorEvent extends Event { + readonly error: MediaStreamError | null; +} + +declare var MediaStreamErrorEvent: { + prototype: MediaStreamErrorEvent; + new(typeArg: string, eventInitDict?: MediaStreamErrorEventInit): MediaStreamErrorEvent; +} + +interface MediaStreamEvent extends Event { + readonly stream: MediaStream | null; +} + +declare var MediaStreamEvent: { + prototype: MediaStreamEvent; + new(type: string, eventInitDict: MediaStreamEventInit): MediaStreamEvent; +} + +interface MediaStreamTrackEventMap { + "ended": MediaStreamErrorEvent; + "mute": Event; + "overconstrained": MediaStreamErrorEvent; + "unmute": Event; +} + +interface MediaStreamTrack extends EventTarget { + enabled: boolean; + readonly id: string; + readonly kind: string; + readonly label: string; + readonly muted: boolean; + onended: (this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any; + onmute: (this: MediaStreamTrack, ev: Event) => any; + onoverconstrained: (this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any; + onunmute: (this: MediaStreamTrack, ev: Event) => any; + readonly readonly: boolean; + readonly readyState: MediaStreamTrackState; + readonly remote: boolean; + applyConstraints(constraints: MediaTrackConstraints): Promise; + clone(): MediaStreamTrack; + getCapabilities(): MediaTrackCapabilities; + getConstraints(): MediaTrackConstraints; + getSettings(): MediaTrackSettings; + stop(): void; + addEventListener(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MediaStreamTrack: { + prototype: MediaStreamTrack; + new(): MediaStreamTrack; +} + +interface MediaStreamTrackEvent extends Event { + readonly track: MediaStreamTrack; +} + +declare var MediaStreamTrackEvent: { + prototype: MediaStreamTrackEvent; + new(typeArg: string, eventInitDict?: MediaStreamTrackEventInit): MediaStreamTrackEvent; +} + +interface MessageChannel { + readonly port1: MessagePort; + readonly port2: MessagePort; +} + +declare var MessageChannel: { + prototype: MessageChannel; + new(): MessageChannel; +} + +interface MessageEvent extends Event { + readonly data: any; + readonly origin: string; + readonly ports: any; + readonly source: Window; + initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; +} + +declare var MessageEvent: { + prototype: MessageEvent; + new(type: string, eventInitDict?: MessageEventInit): MessageEvent; +} + +interface MessagePortEventMap { + "message": MessageEvent; +} + +interface MessagePort extends EventTarget { + onmessage: (this: MessagePort, ev: MessageEvent) => any; + close(): void; + postMessage(message?: any, transfer?: any[]): void; + start(): void; + addEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MessagePort: { + prototype: MessagePort; + new(): MessagePort; +} + +interface MimeType { + readonly description: string; + readonly enabledPlugin: Plugin; + readonly suffixes: string; + readonly type: string; +} + +declare var MimeType: { + prototype: MimeType; + new(): MimeType; +} + +interface MimeTypeArray { + readonly length: number; + item(index: number): Plugin; + namedItem(type: string): Plugin; + [index: number]: Plugin; +} + +declare var MimeTypeArray: { + prototype: MimeTypeArray; + new(): MimeTypeArray; +} + +interface MouseEvent extends UIEvent { + readonly altKey: boolean; + readonly button: number; + readonly buttons: number; + readonly clientX: number; + readonly clientY: number; + readonly ctrlKey: boolean; + readonly fromElement: Element; + readonly layerX: number; + readonly layerY: number; + readonly metaKey: boolean; + readonly movementX: number; + readonly movementY: number; + readonly offsetX: number; + readonly offsetY: number; + readonly pageX: number; + readonly pageY: number; + readonly relatedTarget: EventTarget; + readonly screenX: number; + readonly screenY: number; + readonly shiftKey: boolean; + readonly toElement: Element; + readonly which: number; + readonly x: number; + readonly y: number; + getModifierState(keyArg: string): boolean; + initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget | null): void; +} + +declare var MouseEvent: { + prototype: MouseEvent; + new(typeArg: string, eventInitDict?: MouseEventInit): MouseEvent; +} + +interface MutationEvent extends Event { + readonly attrChange: number; + readonly attrName: string; + readonly newValue: string; + readonly prevValue: string; + readonly relatedNode: Node; + initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; + readonly ADDITION: number; + readonly MODIFICATION: number; + readonly REMOVAL: number; +} + +declare var MutationEvent: { + prototype: MutationEvent; + new(): MutationEvent; + readonly ADDITION: number; + readonly MODIFICATION: number; + readonly REMOVAL: number; +} + +interface MutationObserver { + disconnect(): void; + observe(target: Node, options: MutationObserverInit): void; + takeRecords(): MutationRecord[]; +} + +declare var MutationObserver: { + prototype: MutationObserver; + new(callback: MutationCallback): MutationObserver; +} + +interface MutationRecord { + readonly addedNodes: NodeList; + readonly attributeName: string | null; + readonly attributeNamespace: string | null; + readonly nextSibling: Node | null; + readonly oldValue: string | null; + readonly previousSibling: Node | null; + readonly removedNodes: NodeList; + readonly target: Node; + readonly type: string; +} + +declare var MutationRecord: { + prototype: MutationRecord; + new(): MutationRecord; +} + +interface NamedNodeMap { + readonly length: number; + getNamedItem(name: string): Attr; + getNamedItemNS(namespaceURI: string | null, localName: string | null): Attr; + item(index: number): Attr; + removeNamedItem(name: string): Attr; + removeNamedItemNS(namespaceURI: string | null, localName: string | null): Attr; + setNamedItem(arg: Attr): Attr; + setNamedItemNS(arg: Attr): Attr; + [index: number]: Attr; +} + +declare var NamedNodeMap: { + prototype: NamedNodeMap; + new(): NamedNodeMap; +} + +interface NavigationCompletedEvent extends NavigationEvent { + readonly isSuccess: boolean; + readonly webErrorStatus: number; +} + +declare var NavigationCompletedEvent: { + prototype: NavigationCompletedEvent; + new(): NavigationCompletedEvent; +} + +interface NavigationEvent extends Event { + readonly uri: string; +} + +declare var NavigationEvent: { + prototype: NavigationEvent; + new(): NavigationEvent; +} + +interface NavigationEventWithReferrer extends NavigationEvent { + readonly referer: string; +} + +declare var NavigationEventWithReferrer: { + prototype: NavigationEventWithReferrer; + new(): NavigationEventWithReferrer; +} + +interface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, NavigatorGeolocation, MSNavigatorDoNotTrack, MSFileSaver, NavigatorBeacon, NavigatorConcurrentHardware, NavigatorUserMedia { + readonly authentication: WebAuthentication; + readonly cookieEnabled: boolean; + gamepadInputEmulation: GamepadInputEmulationType; + readonly language: string; + readonly maxTouchPoints: number; + readonly mimeTypes: MimeTypeArray; + readonly msManipulationViewsEnabled: boolean; + readonly msMaxTouchPoints: number; + readonly msPointerEnabled: boolean; + readonly plugins: PluginArray; + readonly pointerEnabled: boolean; + readonly serviceWorker: ServiceWorkerContainer; + readonly webdriver: boolean; + readonly hardwareConcurrency: number; + getGamepads(): Gamepad[]; + javaEnabled(): boolean; + msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; + requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): Promise; + vibrate(pattern: number | number[]): boolean; +} + +declare var Navigator: { + prototype: Navigator; + new(): Navigator; +} + +interface Node extends EventTarget { + readonly attributes: NamedNodeMap; + readonly baseURI: string | null; + readonly childNodes: NodeList; + readonly firstChild: Node | null; + readonly lastChild: Node | null; + readonly localName: string | null; + readonly namespaceURI: string | null; + readonly nextSibling: Node | null; + readonly nodeName: string; + readonly nodeType: number; + nodeValue: string | null; + readonly ownerDocument: Document; + readonly parentElement: HTMLElement | null; + readonly parentNode: Node | null; + readonly previousSibling: Node | null; + textContent: string | null; + appendChild(newChild: T): T; + cloneNode(deep?: boolean): Node; + compareDocumentPosition(other: Node): number; + contains(child: Node): boolean; + hasAttributes(): boolean; + hasChildNodes(): boolean; + insertBefore(newChild: T, refChild: Node | null): T; + isDefaultNamespace(namespaceURI: string | null): boolean; + isEqualNode(arg: Node): boolean; + isSameNode(other: Node): boolean; + lookupNamespaceURI(prefix: string | null): string | null; + lookupPrefix(namespaceURI: string | null): string | null; + normalize(): void; + removeChild(oldChild: T): T; + replaceChild(newChild: Node, oldChild: T): T; + readonly ATTRIBUTE_NODE: number; + readonly CDATA_SECTION_NODE: number; + readonly COMMENT_NODE: number; + readonly DOCUMENT_FRAGMENT_NODE: number; + readonly DOCUMENT_NODE: number; + readonly DOCUMENT_POSITION_CONTAINED_BY: number; + readonly DOCUMENT_POSITION_CONTAINS: number; + readonly DOCUMENT_POSITION_DISCONNECTED: number; + readonly DOCUMENT_POSITION_FOLLOWING: number; + readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + readonly DOCUMENT_POSITION_PRECEDING: number; + readonly DOCUMENT_TYPE_NODE: number; + readonly ELEMENT_NODE: number; + readonly ENTITY_NODE: number; + readonly ENTITY_REFERENCE_NODE: number; + readonly NOTATION_NODE: number; + readonly PROCESSING_INSTRUCTION_NODE: number; + readonly TEXT_NODE: number; +} + +declare var Node: { + prototype: Node; + new(): Node; + readonly ATTRIBUTE_NODE: number; + readonly CDATA_SECTION_NODE: number; + readonly COMMENT_NODE: number; + readonly DOCUMENT_FRAGMENT_NODE: number; + readonly DOCUMENT_NODE: number; + readonly DOCUMENT_POSITION_CONTAINED_BY: number; + readonly DOCUMENT_POSITION_CONTAINS: number; + readonly DOCUMENT_POSITION_DISCONNECTED: number; + readonly DOCUMENT_POSITION_FOLLOWING: number; + readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + readonly DOCUMENT_POSITION_PRECEDING: number; + readonly DOCUMENT_TYPE_NODE: number; + readonly ELEMENT_NODE: number; + readonly ENTITY_NODE: number; + readonly ENTITY_REFERENCE_NODE: number; + readonly NOTATION_NODE: number; + readonly PROCESSING_INSTRUCTION_NODE: number; + readonly TEXT_NODE: number; +} + +interface NodeFilter { + acceptNode(n: Node): number; +} + +declare var NodeFilter: { + readonly FILTER_ACCEPT: number; + readonly FILTER_REJECT: number; + readonly FILTER_SKIP: number; + readonly SHOW_ALL: number; + readonly SHOW_ATTRIBUTE: number; + readonly SHOW_CDATA_SECTION: number; + readonly SHOW_COMMENT: number; + readonly SHOW_DOCUMENT: number; + readonly SHOW_DOCUMENT_FRAGMENT: number; + readonly SHOW_DOCUMENT_TYPE: number; + readonly SHOW_ELEMENT: number; + readonly SHOW_ENTITY: number; + readonly SHOW_ENTITY_REFERENCE: number; + readonly SHOW_NOTATION: number; + readonly SHOW_PROCESSING_INSTRUCTION: number; + readonly SHOW_TEXT: number; +} + +interface NodeIterator { + readonly expandEntityReferences: boolean; + readonly filter: NodeFilter; + readonly root: Node; + readonly whatToShow: number; + detach(): void; + nextNode(): Node; + previousNode(): Node; +} + +declare var NodeIterator: { + prototype: NodeIterator; + new(): NodeIterator; +} + +interface NodeList { + readonly length: number; + item(index: number): Node; + [index: number]: Node; +} + +declare var NodeList: { + prototype: NodeList; + new(): NodeList; +} + +interface NotificationEventMap { + "click": Event; + "close": Event; + "error": Event; + "show": Event; +} + +interface Notification extends EventTarget { + readonly body: string; + readonly dir: NotificationDirection; + readonly icon: string; + readonly lang: string; + onclick: (this: Notification, ev: Event) => any; + onclose: (this: Notification, ev: Event) => any; + onerror: (this: Notification, ev: Event) => any; + onshow: (this: Notification, ev: Event) => any; + readonly permission: NotificationPermission; + readonly tag: string; + readonly title: string; + close(): void; + addEventListener(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Notification: { + prototype: Notification; + new(title: string, options?: NotificationOptions): Notification; + requestPermission(callback?: NotificationPermissionCallback): Promise; +} + +interface OES_element_index_uint { +} + +declare var OES_element_index_uint: { + prototype: OES_element_index_uint; + new(): OES_element_index_uint; +} + +interface OES_standard_derivatives { + readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} + +declare var OES_standard_derivatives: { + prototype: OES_standard_derivatives; + new(): OES_standard_derivatives; + readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} + +interface OES_texture_float { +} + +declare var OES_texture_float: { + prototype: OES_texture_float; + new(): OES_texture_float; +} + +interface OES_texture_float_linear { +} + +declare var OES_texture_float_linear: { + prototype: OES_texture_float_linear; + new(): OES_texture_float_linear; +} + +interface OES_texture_half_float { + readonly HALF_FLOAT_OES: number; +} + +declare var OES_texture_half_float: { + prototype: OES_texture_half_float; + new(): OES_texture_half_float; + readonly HALF_FLOAT_OES: number; +} + +interface OES_texture_half_float_linear { +} + +declare var OES_texture_half_float_linear: { + prototype: OES_texture_half_float_linear; + new(): OES_texture_half_float_linear; +} + +interface OfflineAudioCompletionEvent extends Event { + readonly renderedBuffer: AudioBuffer; +} + +declare var OfflineAudioCompletionEvent: { + prototype: OfflineAudioCompletionEvent; + new(): OfflineAudioCompletionEvent; +} + +interface OfflineAudioContextEventMap extends AudioContextEventMap { + "complete": OfflineAudioCompletionEvent; +} + +interface OfflineAudioContext extends AudioContextBase { + readonly length: number; + oncomplete: (this: OfflineAudioContext, ev: OfflineAudioCompletionEvent) => any; + startRendering(): Promise; + suspend(suspendTime: number): Promise; + addEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var OfflineAudioContext: { + prototype: OfflineAudioContext; + new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext; +} + +interface OscillatorNodeEventMap { + "ended": MediaStreamErrorEvent; +} + +interface OscillatorNode extends AudioNode { + readonly detune: AudioParam; + readonly frequency: AudioParam; + onended: (this: OscillatorNode, ev: MediaStreamErrorEvent) => any; + type: OscillatorType; + setPeriodicWave(periodicWave: PeriodicWave): void; + start(when?: number): void; + stop(when?: number): void; + addEventListener(type: K, listener: (this: OscillatorNode, ev: OscillatorNodeEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var OscillatorNode: { + prototype: OscillatorNode; + new(): OscillatorNode; +} + +interface OverflowEvent extends UIEvent { + readonly horizontalOverflow: boolean; + readonly orient: number; + readonly verticalOverflow: boolean; + readonly BOTH: number; + readonly HORIZONTAL: number; + readonly VERTICAL: number; +} + +declare var OverflowEvent: { + prototype: OverflowEvent; + new(): OverflowEvent; + readonly BOTH: number; + readonly HORIZONTAL: number; + readonly VERTICAL: number; +} + +interface PageTransitionEvent extends Event { + readonly persisted: boolean; +} + +declare var PageTransitionEvent: { + prototype: PageTransitionEvent; + new(): PageTransitionEvent; +} + +interface PannerNode extends AudioNode { + coneInnerAngle: number; + coneOuterAngle: number; + coneOuterGain: number; + distanceModel: DistanceModelType; + maxDistance: number; + panningModel: PanningModelType; + refDistance: number; + rolloffFactor: number; + setOrientation(x: number, y: number, z: number): void; + setPosition(x: number, y: number, z: number): void; + setVelocity(x: number, y: number, z: number): void; +} + +declare var PannerNode: { + prototype: PannerNode; + new(): PannerNode; +} + +interface Path2D extends Object, CanvasPathMethods { +} + +declare var Path2D: { + prototype: Path2D; + new(path?: Path2D): Path2D; +} + +interface PaymentAddress { + readonly addressLine: string[]; + readonly city: string; + readonly country: string; + readonly dependentLocality: string; + readonly languageCode: string; + readonly organization: string; + readonly phone: string; + readonly postalCode: string; + readonly recipient: string; + readonly region: string; + readonly sortingCode: string; + toJSON(): any; +} + +declare var PaymentAddress: { + prototype: PaymentAddress; + new(): PaymentAddress; +} + +interface PaymentRequestEventMap { + "shippingaddresschange": Event; + "shippingoptionchange": Event; +} + +interface PaymentRequest extends EventTarget { + onshippingaddresschange: (this: PaymentRequest, ev: Event) => any; + onshippingoptionchange: (this: PaymentRequest, ev: Event) => any; + readonly shippingAddress: PaymentAddress | null; + readonly shippingOption: string | null; + readonly shippingType: PaymentShippingType | null; + abort(): Promise; + show(): Promise; + addEventListener(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var PaymentRequest: { + prototype: PaymentRequest; + new(methodData: PaymentMethodData[], details: PaymentDetails, options?: PaymentOptions): PaymentRequest; +} + +interface PaymentRequestUpdateEvent extends Event { + updateWith(d: Promise): void; +} + +declare var PaymentRequestUpdateEvent: { + prototype: PaymentRequestUpdateEvent; + new(type: string, eventInitDict?: PaymentRequestUpdateEventInit): PaymentRequestUpdateEvent; +} + +interface PaymentResponse { + readonly details: any; + readonly methodName: string; + readonly payerEmail: string | null; + readonly payerName: string | null; + readonly payerPhone: string | null; + readonly shippingAddress: PaymentAddress | null; + readonly shippingOption: string | null; + complete(result?: PaymentComplete): Promise; + toJSON(): any; +} + +declare var PaymentResponse: { + prototype: PaymentResponse; + new(): PaymentResponse; +} + +interface PerfWidgetExternal { + readonly activeNetworkRequestCount: number; + readonly averageFrameTime: number; + readonly averagePaintTime: number; + readonly extraInformationEnabled: boolean; + readonly independentRenderingEnabled: boolean; + readonly irDisablingContentString: string; + readonly irStatusAvailable: boolean; + readonly maxCpuSpeed: number; + readonly paintRequestsPerSecond: number; + readonly performanceCounter: number; + readonly performanceCounterFrequency: number; + addEventListener(eventType: string, callback: Function): void; + getMemoryUsage(): number; + getProcessCpuUsage(): number; + getRecentCpuUsage(last: number | null): any; + getRecentFrames(last: number | null): any; + getRecentMemoryUsage(last: number | null): any; + getRecentPaintRequests(last: number | null): any; + removeEventListener(eventType: string, callback: Function): void; + repositionWindow(x: number, y: number): void; + resizeWindow(width: number, height: number): void; +} + +declare var PerfWidgetExternal: { + prototype: PerfWidgetExternal; + new(): PerfWidgetExternal; +} + +interface Performance { + readonly navigation: PerformanceNavigation; + readonly timing: PerformanceTiming; + clearMarks(markName?: string): void; + clearMeasures(measureName?: string): void; + clearResourceTimings(): void; + getEntries(): any; + getEntriesByName(name: string, entryType?: string): any; + getEntriesByType(entryType: string): any; + getMarks(markName?: string): any; + getMeasures(measureName?: string): any; + mark(markName: string): void; + measure(measureName: string, startMarkName?: string, endMarkName?: string): void; + now(): number; + setResourceTimingBufferSize(maxSize: number): void; + toJSON(): any; +} + +declare var Performance: { + prototype: Performance; + new(): Performance; +} + +interface PerformanceEntry { + readonly duration: number; + readonly entryType: string; + readonly name: string; + readonly startTime: number; +} + +declare var PerformanceEntry: { + prototype: PerformanceEntry; + new(): PerformanceEntry; +} + +interface PerformanceMark extends PerformanceEntry { +} + +declare var PerformanceMark: { + prototype: PerformanceMark; + new(): PerformanceMark; +} + +interface PerformanceMeasure extends PerformanceEntry { +} + +declare var PerformanceMeasure: { + prototype: PerformanceMeasure; + new(): PerformanceMeasure; +} + +interface PerformanceNavigation { + readonly redirectCount: number; + readonly type: number; + toJSON(): any; + readonly TYPE_BACK_FORWARD: number; + readonly TYPE_NAVIGATE: number; + readonly TYPE_RELOAD: number; + readonly TYPE_RESERVED: number; +} + +declare var PerformanceNavigation: { + prototype: PerformanceNavigation; + new(): PerformanceNavigation; + readonly TYPE_BACK_FORWARD: number; + readonly TYPE_NAVIGATE: number; + readonly TYPE_RELOAD: number; + readonly TYPE_RESERVED: number; +} + +interface PerformanceNavigationTiming extends PerformanceEntry { + readonly connectEnd: number; + readonly connectStart: number; + readonly domComplete: number; + readonly domContentLoadedEventEnd: number; + readonly domContentLoadedEventStart: number; + readonly domInteractive: number; + readonly domLoading: number; + readonly domainLookupEnd: number; + readonly domainLookupStart: number; + readonly fetchStart: number; + readonly loadEventEnd: number; + readonly loadEventStart: number; + readonly navigationStart: number; + readonly redirectCount: number; + readonly redirectEnd: number; + readonly redirectStart: number; + readonly requestStart: number; + readonly responseEnd: number; + readonly responseStart: number; + readonly type: NavigationType; + readonly unloadEventEnd: number; + readonly unloadEventStart: number; +} + +declare var PerformanceNavigationTiming: { + prototype: PerformanceNavigationTiming; + new(): PerformanceNavigationTiming; +} + +interface PerformanceResourceTiming extends PerformanceEntry { + readonly connectEnd: number; + readonly connectStart: number; + readonly domainLookupEnd: number; + readonly domainLookupStart: number; + readonly fetchStart: number; + readonly initiatorType: string; + readonly redirectEnd: number; + readonly redirectStart: number; + readonly requestStart: number; + readonly responseEnd: number; + readonly responseStart: number; +} + +declare var PerformanceResourceTiming: { + prototype: PerformanceResourceTiming; + new(): PerformanceResourceTiming; +} + +interface PerformanceTiming { + readonly connectEnd: number; + readonly connectStart: number; + readonly domComplete: number; + readonly domContentLoadedEventEnd: number; + readonly domContentLoadedEventStart: number; + readonly domInteractive: number; + readonly domLoading: number; + readonly domainLookupEnd: number; + readonly domainLookupStart: number; + readonly fetchStart: number; + readonly loadEventEnd: number; + readonly loadEventStart: number; + readonly msFirstPaint: number; + readonly navigationStart: number; + readonly redirectEnd: number; + readonly redirectStart: number; + readonly requestStart: number; + readonly responseEnd: number; + readonly responseStart: number; + readonly unloadEventEnd: number; + readonly unloadEventStart: number; + readonly secureConnectionStart: number; + toJSON(): any; +} + +declare var PerformanceTiming: { + prototype: PerformanceTiming; + new(): PerformanceTiming; +} + +interface PeriodicWave { +} + +declare var PeriodicWave: { + prototype: PeriodicWave; + new(): PeriodicWave; +} + +interface PermissionRequest extends DeferredPermissionRequest { + readonly state: MSWebViewPermissionState; + defer(): void; +} + +declare var PermissionRequest: { + prototype: PermissionRequest; + new(): PermissionRequest; +} + +interface PermissionRequestedEvent extends Event { + readonly permissionRequest: PermissionRequest; +} + +declare var PermissionRequestedEvent: { + prototype: PermissionRequestedEvent; + new(): PermissionRequestedEvent; +} + +interface Plugin { + readonly description: string; + readonly filename: string; + readonly length: number; + readonly name: string; + readonly version: string; + item(index: number): MimeType; + namedItem(type: string): MimeType; + [index: number]: MimeType; +} + +declare var Plugin: { + prototype: Plugin; + new(): Plugin; +} + +interface PluginArray { + readonly length: number; + item(index: number): Plugin; + namedItem(name: string): Plugin; + refresh(reload?: boolean): void; + [index: number]: Plugin; +} + +declare var PluginArray: { + prototype: PluginArray; + new(): PluginArray; +} + +interface PointerEvent extends MouseEvent { + readonly currentPoint: any; + readonly height: number; + readonly hwTimestamp: number; + readonly intermediatePoints: any; + readonly isPrimary: boolean; + readonly pointerId: number; + readonly pointerType: any; + readonly pressure: number; + readonly rotation: number; + readonly tiltX: number; + readonly tiltY: number; + readonly width: number; + getCurrentPoint(element: Element): void; + getIntermediatePoints(element: Element): void; + initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; +} + +declare var PointerEvent: { + prototype: PointerEvent; + new(typeArg: string, eventInitDict?: PointerEventInit): PointerEvent; +} + +interface PopStateEvent extends Event { + readonly state: any; + initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void; +} + +declare var PopStateEvent: { + prototype: PopStateEvent; + new(typeArg: string, eventInitDict?: PopStateEventInit): PopStateEvent; +} + +interface Position { + readonly coords: Coordinates; + readonly timestamp: number; +} + +declare var Position: { + prototype: Position; + new(): Position; +} + +interface PositionError { + readonly code: number; + readonly message: string; + toString(): string; + readonly PERMISSION_DENIED: number; + readonly POSITION_UNAVAILABLE: number; + readonly TIMEOUT: number; +} + +declare var PositionError: { + prototype: PositionError; + new(): PositionError; + readonly PERMISSION_DENIED: number; + readonly POSITION_UNAVAILABLE: number; + readonly TIMEOUT: number; +} + +interface ProcessingInstruction extends CharacterData { + readonly target: string; +} + +declare var ProcessingInstruction: { + prototype: ProcessingInstruction; + new(): ProcessingInstruction; +} + +interface ProgressEvent extends Event { + readonly lengthComputable: boolean; + readonly loaded: number; + readonly total: number; + initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; +} + +declare var ProgressEvent: { + prototype: ProgressEvent; + new(type: string, eventInitDict?: ProgressEventInit): ProgressEvent; +} + +interface PushManager { + getSubscription(): Promise; + permissionState(options?: PushSubscriptionOptionsInit): Promise; + subscribe(options?: PushSubscriptionOptionsInit): Promise; +} + +declare var PushManager: { + prototype: PushManager; + new(): PushManager; +} + +interface PushSubscription { + readonly endpoint: USVString; + readonly options: PushSubscriptionOptions; + getKey(name: PushEncryptionKeyName): ArrayBuffer | null; + toJSON(): any; + unsubscribe(): Promise; +} + +declare var PushSubscription: { + prototype: PushSubscription; + new(): PushSubscription; +} + +interface PushSubscriptionOptions { + readonly applicationServerKey: ArrayBuffer | null; + readonly userVisibleOnly: boolean; +} + +declare var PushSubscriptionOptions: { + prototype: PushSubscriptionOptions; + new(): PushSubscriptionOptions; +} + +interface RTCDTMFToneChangeEvent extends Event { + readonly tone: string; +} + +declare var RTCDTMFToneChangeEvent: { + prototype: RTCDTMFToneChangeEvent; + new(typeArg: string, eventInitDict: RTCDTMFToneChangeEventInit): RTCDTMFToneChangeEvent; +} + +interface RTCDtlsTransportEventMap { + "dtlsstatechange": RTCDtlsTransportStateChangedEvent; + "error": Event; +} + +interface RTCDtlsTransport extends RTCStatsProvider { + ondtlsstatechange: ((this: RTCDtlsTransport, ev: RTCDtlsTransportStateChangedEvent) => any) | null; + onerror: ((this: RTCDtlsTransport, ev: Event) => any) | null; + readonly state: RTCDtlsTransportState; + readonly transport: RTCIceTransport; + getLocalParameters(): RTCDtlsParameters; + getRemoteCertificates(): ArrayBuffer[]; + getRemoteParameters(): RTCDtlsParameters | null; + start(remoteParameters: RTCDtlsParameters): void; + stop(): void; + addEventListener(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCDtlsTransport: { + prototype: RTCDtlsTransport; + new(transport: RTCIceTransport): RTCDtlsTransport; +} + +interface RTCDtlsTransportStateChangedEvent extends Event { + readonly state: RTCDtlsTransportState; +} + +declare var RTCDtlsTransportStateChangedEvent: { + prototype: RTCDtlsTransportStateChangedEvent; + new(): RTCDtlsTransportStateChangedEvent; +} + +interface RTCDtmfSenderEventMap { + "tonechange": RTCDTMFToneChangeEvent; +} + +interface RTCDtmfSender extends EventTarget { + readonly canInsertDTMF: boolean; + readonly duration: number; + readonly interToneGap: number; + ontonechange: (this: RTCDtmfSender, ev: RTCDTMFToneChangeEvent) => any; + readonly sender: RTCRtpSender; + readonly toneBuffer: string; + insertDTMF(tones: string, duration?: number, interToneGap?: number): void; + addEventListener(type: K, listener: (this: RTCDtmfSender, ev: RTCDtmfSenderEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCDtmfSender: { + prototype: RTCDtmfSender; + new(sender: RTCRtpSender): RTCDtmfSender; +} + +interface RTCIceCandidate { + candidate: string | null; + sdpMLineIndex: number | null; + sdpMid: string | null; + toJSON(): any; +} + +declare var RTCIceCandidate: { + prototype: RTCIceCandidate; + new(candidateInitDict?: RTCIceCandidateInit): RTCIceCandidate; +} + +interface RTCIceCandidatePairChangedEvent extends Event { + readonly pair: RTCIceCandidatePair; +} + +declare var RTCIceCandidatePairChangedEvent: { + prototype: RTCIceCandidatePairChangedEvent; + new(): RTCIceCandidatePairChangedEvent; +} + +interface RTCIceGathererEventMap { + "error": Event; + "localcandidate": RTCIceGathererEvent; +} + +interface RTCIceGatherer extends RTCStatsProvider { + readonly component: RTCIceComponent; + onerror: ((this: RTCIceGatherer, ev: Event) => any) | null; + onlocalcandidate: ((this: RTCIceGatherer, ev: RTCIceGathererEvent) => any) | null; + createAssociatedGatherer(): RTCIceGatherer; + getLocalCandidates(): RTCIceCandidateDictionary[]; + getLocalParameters(): RTCIceParameters; + addEventListener(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCIceGatherer: { + prototype: RTCIceGatherer; + new(options: RTCIceGatherOptions): RTCIceGatherer; +} + +interface RTCIceGathererEvent extends Event { + readonly candidate: RTCIceCandidateDictionary | RTCIceCandidateComplete; +} + +declare var RTCIceGathererEvent: { + prototype: RTCIceGathererEvent; + new(): RTCIceGathererEvent; +} + +interface RTCIceTransportEventMap { + "candidatepairchange": RTCIceCandidatePairChangedEvent; + "icestatechange": RTCIceTransportStateChangedEvent; +} + +interface RTCIceTransport extends RTCStatsProvider { + readonly component: RTCIceComponent; + readonly iceGatherer: RTCIceGatherer | null; + oncandidatepairchange: ((this: RTCIceTransport, ev: RTCIceCandidatePairChangedEvent) => any) | null; + onicestatechange: ((this: RTCIceTransport, ev: RTCIceTransportStateChangedEvent) => any) | null; + readonly role: RTCIceRole; + readonly state: RTCIceTransportState; + addRemoteCandidate(remoteCandidate: RTCIceCandidateDictionary | RTCIceCandidateComplete): void; + createAssociatedTransport(): RTCIceTransport; + getNominatedCandidatePair(): RTCIceCandidatePair | null; + getRemoteCandidates(): RTCIceCandidateDictionary[]; + getRemoteParameters(): RTCIceParameters | null; + setRemoteCandidates(remoteCandidates: RTCIceCandidateDictionary[]): void; + start(gatherer: RTCIceGatherer, remoteParameters: RTCIceParameters, role?: RTCIceRole): void; + stop(): void; + addEventListener(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCIceTransport: { + prototype: RTCIceTransport; + new(): RTCIceTransport; +} + +interface RTCIceTransportStateChangedEvent extends Event { + readonly state: RTCIceTransportState; +} + +declare var RTCIceTransportStateChangedEvent: { + prototype: RTCIceTransportStateChangedEvent; + new(): RTCIceTransportStateChangedEvent; +} + +interface RTCPeerConnectionEventMap { + "addstream": MediaStreamEvent; + "icecandidate": RTCPeerConnectionIceEvent; + "iceconnectionstatechange": Event; + "icegatheringstatechange": Event; + "negotiationneeded": Event; + "removestream": MediaStreamEvent; + "signalingstatechange": Event; +} + +interface RTCPeerConnection extends EventTarget { + readonly canTrickleIceCandidates: boolean | null; + readonly iceConnectionState: RTCIceConnectionState; + readonly iceGatheringState: RTCIceGatheringState; + readonly localDescription: RTCSessionDescription | null; + onaddstream: (this: RTCPeerConnection, ev: MediaStreamEvent) => any; + onicecandidate: (this: RTCPeerConnection, ev: RTCPeerConnectionIceEvent) => any; + oniceconnectionstatechange: (this: RTCPeerConnection, ev: Event) => any; + onicegatheringstatechange: (this: RTCPeerConnection, ev: Event) => any; + onnegotiationneeded: (this: RTCPeerConnection, ev: Event) => any; + onremovestream: (this: RTCPeerConnection, ev: MediaStreamEvent) => any; + onsignalingstatechange: (this: RTCPeerConnection, ev: Event) => any; + readonly remoteDescription: RTCSessionDescription | null; + readonly signalingState: RTCSignalingState; + addIceCandidate(candidate: RTCIceCandidate, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise; + addStream(stream: MediaStream): void; + close(): void; + createAnswer(successCallback?: RTCSessionDescriptionCallback, failureCallback?: RTCPeerConnectionErrorCallback): Promise; + createOffer(successCallback?: RTCSessionDescriptionCallback, failureCallback?: RTCPeerConnectionErrorCallback, options?: RTCOfferOptions): Promise; + getConfiguration(): RTCConfiguration; + getLocalStreams(): MediaStream[]; + getRemoteStreams(): MediaStream[]; + getStats(selector: MediaStreamTrack | null, successCallback?: RTCStatsCallback, failureCallback?: RTCPeerConnectionErrorCallback): Promise; + getStreamById(streamId: string): MediaStream | null; + removeStream(stream: MediaStream): void; + setLocalDescription(description: RTCSessionDescription, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise; + setRemoteDescription(description: RTCSessionDescription, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise; + addEventListener(type: K, listener: (this: RTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCPeerConnection: { + prototype: RTCPeerConnection; + new(configuration: RTCConfiguration): RTCPeerConnection; +} + +interface RTCPeerConnectionIceEvent extends Event { + readonly candidate: RTCIceCandidate; +} + +declare var RTCPeerConnectionIceEvent: { + prototype: RTCPeerConnectionIceEvent; + new(type: string, eventInitDict: RTCPeerConnectionIceEventInit): RTCPeerConnectionIceEvent; +} + +interface RTCRtpReceiverEventMap { + "error": Event; +} + +interface RTCRtpReceiver extends RTCStatsProvider { + onerror: ((this: RTCRtpReceiver, ev: Event) => any) | null; + readonly rtcpTransport: RTCDtlsTransport; + readonly track: MediaStreamTrack | null; + readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport; + getContributingSources(): RTCRtpContributingSource[]; + receive(parameters: RTCRtpParameters): void; + requestSendCSRC(csrc: number): void; + setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void; + stop(): void; + addEventListener(type: K, listener: (this: RTCRtpReceiver, ev: RTCRtpReceiverEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCRtpReceiver: { + prototype: RTCRtpReceiver; + new(transport: RTCDtlsTransport | RTCSrtpSdesTransport, kind: string, rtcpTransport?: RTCDtlsTransport): RTCRtpReceiver; + getCapabilities(kind?: string): RTCRtpCapabilities; +} + +interface RTCRtpSenderEventMap { + "error": Event; + "ssrcconflict": RTCSsrcConflictEvent; +} + +interface RTCRtpSender extends RTCStatsProvider { + onerror: ((this: RTCRtpSender, ev: Event) => any) | null; + onssrcconflict: ((this: RTCRtpSender, ev: RTCSsrcConflictEvent) => any) | null; + readonly rtcpTransport: RTCDtlsTransport; + readonly track: MediaStreamTrack; + readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport; + send(parameters: RTCRtpParameters): void; + setTrack(track: MediaStreamTrack): void; + setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void; + stop(): void; + addEventListener(type: K, listener: (this: RTCRtpSender, ev: RTCRtpSenderEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCRtpSender: { + prototype: RTCRtpSender; + new(track: MediaStreamTrack, transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): RTCRtpSender; + getCapabilities(kind?: string): RTCRtpCapabilities; +} + +interface RTCSessionDescription { + sdp: string | null; + type: RTCSdpType | null; + toJSON(): any; +} + +declare var RTCSessionDescription: { + prototype: RTCSessionDescription; + new(descriptionInitDict?: RTCSessionDescriptionInit): RTCSessionDescription; +} + +interface RTCSrtpSdesTransportEventMap { + "error": Event; +} + +interface RTCSrtpSdesTransport extends EventTarget { + onerror: ((this: RTCSrtpSdesTransport, ev: Event) => any) | null; + readonly transport: RTCIceTransport; + addEventListener(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCSrtpSdesTransport: { + prototype: RTCSrtpSdesTransport; + new(transport: RTCIceTransport, encryptParameters: RTCSrtpSdesParameters, decryptParameters: RTCSrtpSdesParameters): RTCSrtpSdesTransport; + getLocalParameters(): RTCSrtpSdesParameters[]; +} + +interface RTCSsrcConflictEvent extends Event { + readonly ssrc: number; +} + +declare var RTCSsrcConflictEvent: { + prototype: RTCSsrcConflictEvent; + new(): RTCSsrcConflictEvent; +} + +interface RTCStatsProvider extends EventTarget { + getStats(): Promise; + msGetStats(): Promise; +} + +declare var RTCStatsProvider: { + prototype: RTCStatsProvider; + new(): RTCStatsProvider; +} + +interface Range { + readonly collapsed: boolean; + readonly commonAncestorContainer: Node; + readonly endContainer: Node; + readonly endOffset: number; + readonly startContainer: Node; + readonly startOffset: number; + cloneContents(): DocumentFragment; + cloneRange(): Range; + collapse(toStart: boolean): void; + compareBoundaryPoints(how: number, sourceRange: Range): number; + createContextualFragment(fragment: string): DocumentFragment; + deleteContents(): void; + detach(): void; + expand(Unit: ExpandGranularity): boolean; + extractContents(): DocumentFragment; + getBoundingClientRect(): ClientRect; + getClientRects(): ClientRectList; + insertNode(newNode: Node): void; + selectNode(refNode: Node): void; + selectNodeContents(refNode: Node): void; + setEnd(refNode: Node, offset: number): void; + setEndAfter(refNode: Node): void; + setEndBefore(refNode: Node): void; + setStart(refNode: Node, offset: number): void; + setStartAfter(refNode: Node): void; + setStartBefore(refNode: Node): void; + surroundContents(newParent: Node): void; + toString(): string; + readonly END_TO_END: number; + readonly END_TO_START: number; + readonly START_TO_END: number; + readonly START_TO_START: number; +} + +declare var Range: { + prototype: Range; + new(): Range; + readonly END_TO_END: number; + readonly END_TO_START: number; + readonly START_TO_END: number; + readonly START_TO_START: number; +} + +interface ReadableStream { + readonly locked: boolean; + cancel(): Promise; + getReader(): ReadableStreamReader; +} + +declare var ReadableStream: { + prototype: ReadableStream; + new(): ReadableStream; +} + +interface ReadableStreamReader { + cancel(): Promise; + read(): Promise; + releaseLock(): void; +} + +declare var ReadableStreamReader: { + prototype: ReadableStreamReader; + new(): ReadableStreamReader; +} + +interface Request extends Object, Body { + readonly cache: RequestCache; + readonly credentials: RequestCredentials; + readonly destination: RequestDestination; + readonly headers: Headers; + readonly integrity: string; + readonly keepalive: boolean; + readonly method: string; + readonly mode: RequestMode; + readonly redirect: RequestRedirect; + readonly referrer: string; + readonly referrerPolicy: ReferrerPolicy; + readonly type: RequestType; + readonly url: string; + clone(): Request; +} + +declare var Request: { + prototype: Request; + new(input: Request | string, init?: RequestInit): Request; +} + +interface Response extends Object, Body { + readonly body: ReadableStream | null; + readonly headers: Headers; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly type: ResponseType; + readonly url: string; + clone(): Response; +} + +declare var Response: { + prototype: Response; + new(body?: any, init?: ResponseInit): Response; +} + +interface SVGAElement extends SVGGraphicsElement, SVGURIReference { + readonly target: SVGAnimatedString; + addEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGAElement: { + prototype: SVGAElement; + new(): SVGAElement; +} + +interface SVGAngle { + readonly unitType: number; + value: number; + valueAsString: string; + valueInSpecifiedUnits: number; + convertToSpecifiedUnits(unitType: number): void; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + readonly SVG_ANGLETYPE_DEG: number; + readonly SVG_ANGLETYPE_GRAD: number; + readonly SVG_ANGLETYPE_RAD: number; + readonly SVG_ANGLETYPE_UNKNOWN: number; + readonly SVG_ANGLETYPE_UNSPECIFIED: number; +} + +declare var SVGAngle: { + prototype: SVGAngle; + new(): SVGAngle; + readonly SVG_ANGLETYPE_DEG: number; + readonly SVG_ANGLETYPE_GRAD: number; + readonly SVG_ANGLETYPE_RAD: number; + readonly SVG_ANGLETYPE_UNKNOWN: number; + readonly SVG_ANGLETYPE_UNSPECIFIED: number; +} + +interface SVGAnimatedAngle { + readonly animVal: SVGAngle; + readonly baseVal: SVGAngle; +} + +declare var SVGAnimatedAngle: { + prototype: SVGAnimatedAngle; + new(): SVGAnimatedAngle; +} + +interface SVGAnimatedBoolean { + readonly animVal: boolean; + baseVal: boolean; +} + +declare var SVGAnimatedBoolean: { + prototype: SVGAnimatedBoolean; + new(): SVGAnimatedBoolean; +} + +interface SVGAnimatedEnumeration { + readonly animVal: number; + baseVal: number; +} + +declare var SVGAnimatedEnumeration: { + prototype: SVGAnimatedEnumeration; + new(): SVGAnimatedEnumeration; +} + +interface SVGAnimatedInteger { + readonly animVal: number; + baseVal: number; +} + +declare var SVGAnimatedInteger: { + prototype: SVGAnimatedInteger; + new(): SVGAnimatedInteger; +} + +interface SVGAnimatedLength { + readonly animVal: SVGLength; + readonly baseVal: SVGLength; +} + +declare var SVGAnimatedLength: { + prototype: SVGAnimatedLength; + new(): SVGAnimatedLength; +} + +interface SVGAnimatedLengthList { + readonly animVal: SVGLengthList; + readonly baseVal: SVGLengthList; +} + +declare var SVGAnimatedLengthList: { + prototype: SVGAnimatedLengthList; + new(): SVGAnimatedLengthList; +} + +interface SVGAnimatedNumber { + readonly animVal: number; + baseVal: number; +} + +declare var SVGAnimatedNumber: { + prototype: SVGAnimatedNumber; + new(): SVGAnimatedNumber; +} + +interface SVGAnimatedNumberList { + readonly animVal: SVGNumberList; + readonly baseVal: SVGNumberList; +} + +declare var SVGAnimatedNumberList: { + prototype: SVGAnimatedNumberList; + new(): SVGAnimatedNumberList; +} + +interface SVGAnimatedPreserveAspectRatio { + readonly animVal: SVGPreserveAspectRatio; + readonly baseVal: SVGPreserveAspectRatio; +} + +declare var SVGAnimatedPreserveAspectRatio: { + prototype: SVGAnimatedPreserveAspectRatio; + new(): SVGAnimatedPreserveAspectRatio; +} + +interface SVGAnimatedRect { + readonly animVal: SVGRect; + readonly baseVal: SVGRect; +} + +declare var SVGAnimatedRect: { + prototype: SVGAnimatedRect; + new(): SVGAnimatedRect; +} + +interface SVGAnimatedString { + readonly animVal: string; + baseVal: string; +} + +declare var SVGAnimatedString: { + prototype: SVGAnimatedString; + new(): SVGAnimatedString; +} + +interface SVGAnimatedTransformList { + readonly animVal: SVGTransformList; + readonly baseVal: SVGTransformList; +} + +declare var SVGAnimatedTransformList: { + prototype: SVGAnimatedTransformList; + new(): SVGAnimatedTransformList; +} + +interface SVGCircleElement extends SVGGraphicsElement { + readonly cx: SVGAnimatedLength; + readonly cy: SVGAnimatedLength; + readonly r: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGCircleElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGCircleElement: { + prototype: SVGCircleElement; + new(): SVGCircleElement; +} + +interface SVGClipPathElement extends SVGGraphicsElement, SVGUnitTypes { + readonly clipPathUnits: SVGAnimatedEnumeration; + addEventListener(type: K, listener: (this: SVGClipPathElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGClipPathElement: { + prototype: SVGClipPathElement; + new(): SVGClipPathElement; +} + +interface SVGComponentTransferFunctionElement extends SVGElement { + readonly amplitude: SVGAnimatedNumber; + readonly exponent: SVGAnimatedNumber; + readonly intercept: SVGAnimatedNumber; + readonly offset: SVGAnimatedNumber; + readonly slope: SVGAnimatedNumber; + readonly tableValues: SVGAnimatedNumberList; + readonly type: SVGAnimatedEnumeration; + readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGComponentTransferFunctionElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGComponentTransferFunctionElement: { + prototype: SVGComponentTransferFunctionElement; + new(): SVGComponentTransferFunctionElement; + readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; +} + +interface SVGDefsElement extends SVGGraphicsElement { + addEventListener(type: K, listener: (this: SVGDefsElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGDefsElement: { + prototype: SVGDefsElement; + new(): SVGDefsElement; +} + +interface SVGDescElement extends SVGElement { + addEventListener(type: K, listener: (this: SVGDescElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGDescElement: { + prototype: SVGDescElement; + new(): SVGDescElement; +} + +interface SVGElementEventMap extends ElementEventMap { + "click": MouseEvent; + "dblclick": MouseEvent; + "focusin": FocusEvent; + "focusout": FocusEvent; + "load": Event; + "mousedown": MouseEvent; + "mousemove": MouseEvent; + "mouseout": MouseEvent; + "mouseover": MouseEvent; + "mouseup": MouseEvent; +} + +interface SVGElement extends Element { + className: any; + onclick: (this: SVGElement, ev: MouseEvent) => any; + ondblclick: (this: SVGElement, ev: MouseEvent) => any; + onfocusin: (this: SVGElement, ev: FocusEvent) => any; + onfocusout: (this: SVGElement, ev: FocusEvent) => any; + onload: (this: SVGElement, ev: Event) => any; + onmousedown: (this: SVGElement, ev: MouseEvent) => any; + onmousemove: (this: SVGElement, ev: MouseEvent) => any; + onmouseout: (this: SVGElement, ev: MouseEvent) => any; + onmouseover: (this: SVGElement, ev: MouseEvent) => any; + onmouseup: (this: SVGElement, ev: MouseEvent) => any; + readonly ownerSVGElement: SVGSVGElement; + readonly style: CSSStyleDeclaration; + readonly viewportElement: SVGElement; + xmlbase: string; + addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGElement: { + prototype: SVGElement; + new(): SVGElement; +} + +interface SVGElementInstance extends EventTarget { + readonly childNodes: SVGElementInstanceList; + readonly correspondingElement: SVGElement; + readonly correspondingUseElement: SVGUseElement; + readonly firstChild: SVGElementInstance; + readonly lastChild: SVGElementInstance; + readonly nextSibling: SVGElementInstance; + readonly parentNode: SVGElementInstance; + readonly previousSibling: SVGElementInstance; +} + +declare var SVGElementInstance: { + prototype: SVGElementInstance; + new(): SVGElementInstance; +} + +interface SVGElementInstanceList { + readonly length: number; + item(index: number): SVGElementInstance; +} + +declare var SVGElementInstanceList: { + prototype: SVGElementInstanceList; + new(): SVGElementInstanceList; +} + +interface SVGEllipseElement extends SVGGraphicsElement { + readonly cx: SVGAnimatedLength; + readonly cy: SVGAnimatedLength; + readonly rx: SVGAnimatedLength; + readonly ry: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGEllipseElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGEllipseElement: { + prototype: SVGEllipseElement; + new(): SVGEllipseElement; +} + +interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + readonly in2: SVGAnimatedString; + readonly mode: SVGAnimatedEnumeration; + readonly SVG_FEBLEND_MODE_COLOR: number; + readonly SVG_FEBLEND_MODE_COLOR_BURN: number; + readonly SVG_FEBLEND_MODE_COLOR_DODGE: number; + readonly SVG_FEBLEND_MODE_DARKEN: number; + readonly SVG_FEBLEND_MODE_DIFFERENCE: number; + readonly SVG_FEBLEND_MODE_EXCLUSION: number; + readonly SVG_FEBLEND_MODE_HARD_LIGHT: number; + readonly SVG_FEBLEND_MODE_HUE: number; + readonly SVG_FEBLEND_MODE_LIGHTEN: number; + readonly SVG_FEBLEND_MODE_LUMINOSITY: number; + readonly SVG_FEBLEND_MODE_MULTIPLY: number; + readonly SVG_FEBLEND_MODE_NORMAL: number; + readonly SVG_FEBLEND_MODE_OVERLAY: number; + readonly SVG_FEBLEND_MODE_SATURATION: number; + readonly SVG_FEBLEND_MODE_SCREEN: number; + readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number; + readonly SVG_FEBLEND_MODE_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGFEBlendElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEBlendElement: { + prototype: SVGFEBlendElement; + new(): SVGFEBlendElement; + readonly SVG_FEBLEND_MODE_COLOR: number; + readonly SVG_FEBLEND_MODE_COLOR_BURN: number; + readonly SVG_FEBLEND_MODE_COLOR_DODGE: number; + readonly SVG_FEBLEND_MODE_DARKEN: number; + readonly SVG_FEBLEND_MODE_DIFFERENCE: number; + readonly SVG_FEBLEND_MODE_EXCLUSION: number; + readonly SVG_FEBLEND_MODE_HARD_LIGHT: number; + readonly SVG_FEBLEND_MODE_HUE: number; + readonly SVG_FEBLEND_MODE_LIGHTEN: number; + readonly SVG_FEBLEND_MODE_LUMINOSITY: number; + readonly SVG_FEBLEND_MODE_MULTIPLY: number; + readonly SVG_FEBLEND_MODE_NORMAL: number; + readonly SVG_FEBLEND_MODE_OVERLAY: number; + readonly SVG_FEBLEND_MODE_SATURATION: number; + readonly SVG_FEBLEND_MODE_SCREEN: number; + readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number; + readonly SVG_FEBLEND_MODE_UNKNOWN: number; +} + +interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + readonly type: SVGAnimatedEnumeration; + readonly values: SVGAnimatedNumberList; + readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; + readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number; + readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number; + readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGFEColorMatrixElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEColorMatrixElement: { + prototype: SVGFEColorMatrixElement; + new(): SVGFEColorMatrixElement; + readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; + readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number; + readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number; + readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; +} + +interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + addEventListener(type: K, listener: (this: SVGFEComponentTransferElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEComponentTransferElement: { + prototype: SVGFEComponentTransferElement; + new(): SVGFEComponentTransferElement; +} + +interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + readonly in2: SVGAnimatedString; + readonly k1: SVGAnimatedNumber; + readonly k2: SVGAnimatedNumber; + readonly k3: SVGAnimatedNumber; + readonly k4: SVGAnimatedNumber; + readonly operator: SVGAnimatedEnumeration; + readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number; + readonly SVG_FECOMPOSITE_OPERATOR_IN: number; + readonly SVG_FECOMPOSITE_OPERATOR_OUT: number; + readonly SVG_FECOMPOSITE_OPERATOR_OVER: number; + readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + readonly SVG_FECOMPOSITE_OPERATOR_XOR: number; + addEventListener(type: K, listener: (this: SVGFECompositeElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFECompositeElement: { + prototype: SVGFECompositeElement; + new(): SVGFECompositeElement; + readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number; + readonly SVG_FECOMPOSITE_OPERATOR_IN: number; + readonly SVG_FECOMPOSITE_OPERATOR_OUT: number; + readonly SVG_FECOMPOSITE_OPERATOR_OVER: number; + readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + readonly SVG_FECOMPOSITE_OPERATOR_XOR: number; +} + +interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly bias: SVGAnimatedNumber; + readonly divisor: SVGAnimatedNumber; + readonly edgeMode: SVGAnimatedEnumeration; + readonly in1: SVGAnimatedString; + readonly kernelMatrix: SVGAnimatedNumberList; + readonly kernelUnitLengthX: SVGAnimatedNumber; + readonly kernelUnitLengthY: SVGAnimatedNumber; + readonly orderX: SVGAnimatedInteger; + readonly orderY: SVGAnimatedInteger; + readonly preserveAlpha: SVGAnimatedBoolean; + readonly targetX: SVGAnimatedInteger; + readonly targetY: SVGAnimatedInteger; + readonly SVG_EDGEMODE_DUPLICATE: number; + readonly SVG_EDGEMODE_NONE: number; + readonly SVG_EDGEMODE_UNKNOWN: number; + readonly SVG_EDGEMODE_WRAP: number; + addEventListener(type: K, listener: (this: SVGFEConvolveMatrixElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEConvolveMatrixElement: { + prototype: SVGFEConvolveMatrixElement; + new(): SVGFEConvolveMatrixElement; + readonly SVG_EDGEMODE_DUPLICATE: number; + readonly SVG_EDGEMODE_NONE: number; + readonly SVG_EDGEMODE_UNKNOWN: number; + readonly SVG_EDGEMODE_WRAP: number; +} + +interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly diffuseConstant: SVGAnimatedNumber; + readonly in1: SVGAnimatedString; + readonly kernelUnitLengthX: SVGAnimatedNumber; + readonly kernelUnitLengthY: SVGAnimatedNumber; + readonly surfaceScale: SVGAnimatedNumber; + addEventListener(type: K, listener: (this: SVGFEDiffuseLightingElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEDiffuseLightingElement: { + prototype: SVGFEDiffuseLightingElement; + new(): SVGFEDiffuseLightingElement; +} + +interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + readonly in2: SVGAnimatedString; + readonly scale: SVGAnimatedNumber; + readonly xChannelSelector: SVGAnimatedEnumeration; + readonly yChannelSelector: SVGAnimatedEnumeration; + readonly SVG_CHANNEL_A: number; + readonly SVG_CHANNEL_B: number; + readonly SVG_CHANNEL_G: number; + readonly SVG_CHANNEL_R: number; + readonly SVG_CHANNEL_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGFEDisplacementMapElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEDisplacementMapElement: { + prototype: SVGFEDisplacementMapElement; + new(): SVGFEDisplacementMapElement; + readonly SVG_CHANNEL_A: number; + readonly SVG_CHANNEL_B: number; + readonly SVG_CHANNEL_G: number; + readonly SVG_CHANNEL_R: number; + readonly SVG_CHANNEL_UNKNOWN: number; +} + +interface SVGFEDistantLightElement extends SVGElement { + readonly azimuth: SVGAnimatedNumber; + readonly elevation: SVGAnimatedNumber; + addEventListener(type: K, listener: (this: SVGFEDistantLightElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEDistantLightElement: { + prototype: SVGFEDistantLightElement; + new(): SVGFEDistantLightElement; +} + +interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + addEventListener(type: K, listener: (this: SVGFEFloodElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEFloodElement: { + prototype: SVGFEFloodElement; + new(): SVGFEFloodElement; +} + +interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { + addEventListener(type: K, listener: (this: SVGFEFuncAElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEFuncAElement: { + prototype: SVGFEFuncAElement; + new(): SVGFEFuncAElement; +} + +interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { + addEventListener(type: K, listener: (this: SVGFEFuncBElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEFuncBElement: { + prototype: SVGFEFuncBElement; + new(): SVGFEFuncBElement; +} + +interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { + addEventListener(type: K, listener: (this: SVGFEFuncGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEFuncGElement: { + prototype: SVGFEFuncGElement; + new(): SVGFEFuncGElement; +} + +interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { + addEventListener(type: K, listener: (this: SVGFEFuncRElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEFuncRElement: { + prototype: SVGFEFuncRElement; + new(): SVGFEFuncRElement; +} + +interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + readonly stdDeviationX: SVGAnimatedNumber; + readonly stdDeviationY: SVGAnimatedNumber; + setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; + addEventListener(type: K, listener: (this: SVGFEGaussianBlurElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEGaussianBlurElement: { + prototype: SVGFEGaussianBlurElement; + new(): SVGFEGaussianBlurElement; +} + +interface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGURIReference { + readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + addEventListener(type: K, listener: (this: SVGFEImageElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEImageElement: { + prototype: SVGFEImageElement; + new(): SVGFEImageElement; +} + +interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + addEventListener(type: K, listener: (this: SVGFEMergeElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEMergeElement: { + prototype: SVGFEMergeElement; + new(): SVGFEMergeElement; +} + +interface SVGFEMergeNodeElement extends SVGElement { + readonly in1: SVGAnimatedString; + addEventListener(type: K, listener: (this: SVGFEMergeNodeElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEMergeNodeElement: { + prototype: SVGFEMergeNodeElement; + new(): SVGFEMergeNodeElement; +} + +interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + readonly operator: SVGAnimatedEnumeration; + readonly radiusX: SVGAnimatedNumber; + readonly radiusY: SVGAnimatedNumber; + readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number; + readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number; + readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGFEMorphologyElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEMorphologyElement: { + prototype: SVGFEMorphologyElement; + new(): SVGFEMorphologyElement; + readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number; + readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number; + readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; +} + +interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly dx: SVGAnimatedNumber; + readonly dy: SVGAnimatedNumber; + readonly in1: SVGAnimatedString; + addEventListener(type: K, listener: (this: SVGFEOffsetElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEOffsetElement: { + prototype: SVGFEOffsetElement; + new(): SVGFEOffsetElement; +} + +interface SVGFEPointLightElement extends SVGElement { + readonly x: SVGAnimatedNumber; + readonly y: SVGAnimatedNumber; + readonly z: SVGAnimatedNumber; + addEventListener(type: K, listener: (this: SVGFEPointLightElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEPointLightElement: { + prototype: SVGFEPointLightElement; + new(): SVGFEPointLightElement; +} + +interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + readonly kernelUnitLengthX: SVGAnimatedNumber; + readonly kernelUnitLengthY: SVGAnimatedNumber; + readonly specularConstant: SVGAnimatedNumber; + readonly specularExponent: SVGAnimatedNumber; + readonly surfaceScale: SVGAnimatedNumber; + addEventListener(type: K, listener: (this: SVGFESpecularLightingElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFESpecularLightingElement: { + prototype: SVGFESpecularLightingElement; + new(): SVGFESpecularLightingElement; +} + +interface SVGFESpotLightElement extends SVGElement { + readonly limitingConeAngle: SVGAnimatedNumber; + readonly pointsAtX: SVGAnimatedNumber; + readonly pointsAtY: SVGAnimatedNumber; + readonly pointsAtZ: SVGAnimatedNumber; + readonly specularExponent: SVGAnimatedNumber; + readonly x: SVGAnimatedNumber; + readonly y: SVGAnimatedNumber; + readonly z: SVGAnimatedNumber; + addEventListener(type: K, listener: (this: SVGFESpotLightElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFESpotLightElement: { + prototype: SVGFESpotLightElement; + new(): SVGFESpotLightElement; +} + +interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + addEventListener(type: K, listener: (this: SVGFETileElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFETileElement: { + prototype: SVGFETileElement; + new(): SVGFETileElement; +} + +interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly baseFrequencyX: SVGAnimatedNumber; + readonly baseFrequencyY: SVGAnimatedNumber; + readonly numOctaves: SVGAnimatedInteger; + readonly seed: SVGAnimatedNumber; + readonly stitchTiles: SVGAnimatedEnumeration; + readonly type: SVGAnimatedEnumeration; + readonly SVG_STITCHTYPE_NOSTITCH: number; + readonly SVG_STITCHTYPE_STITCH: number; + readonly SVG_STITCHTYPE_UNKNOWN: number; + readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + readonly SVG_TURBULENCE_TYPE_TURBULENCE: number; + readonly SVG_TURBULENCE_TYPE_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGFETurbulenceElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFETurbulenceElement: { + prototype: SVGFETurbulenceElement; + new(): SVGFETurbulenceElement; + readonly SVG_STITCHTYPE_NOSTITCH: number; + readonly SVG_STITCHTYPE_STITCH: number; + readonly SVG_STITCHTYPE_UNKNOWN: number; + readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + readonly SVG_TURBULENCE_TYPE_TURBULENCE: number; + readonly SVG_TURBULENCE_TYPE_UNKNOWN: number; +} + +interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGURIReference { + readonly filterResX: SVGAnimatedInteger; + readonly filterResY: SVGAnimatedInteger; + readonly filterUnits: SVGAnimatedEnumeration; + readonly height: SVGAnimatedLength; + readonly primitiveUnits: SVGAnimatedEnumeration; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + setFilterRes(filterResX: number, filterResY: number): void; + addEventListener(type: K, listener: (this: SVGFilterElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFilterElement: { + prototype: SVGFilterElement; + new(): SVGFilterElement; +} + +interface SVGForeignObjectElement extends SVGGraphicsElement { + readonly height: SVGAnimatedLength; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGForeignObjectElement: { + prototype: SVGForeignObjectElement; + new(): SVGForeignObjectElement; +} + +interface SVGGElement extends SVGGraphicsElement { + addEventListener(type: K, listener: (this: SVGGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGGElement: { + prototype: SVGGElement; + new(): SVGGElement; +} + +interface SVGGradientElement extends SVGElement, SVGUnitTypes, SVGURIReference { + readonly gradientTransform: SVGAnimatedTransformList; + readonly gradientUnits: SVGAnimatedEnumeration; + readonly spreadMethod: SVGAnimatedEnumeration; + readonly SVG_SPREADMETHOD_PAD: number; + readonly SVG_SPREADMETHOD_REFLECT: number; + readonly SVG_SPREADMETHOD_REPEAT: number; + readonly SVG_SPREADMETHOD_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGGradientElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGGradientElement: { + prototype: SVGGradientElement; + new(): SVGGradientElement; + readonly SVG_SPREADMETHOD_PAD: number; + readonly SVG_SPREADMETHOD_REFLECT: number; + readonly SVG_SPREADMETHOD_REPEAT: number; + readonly SVG_SPREADMETHOD_UNKNOWN: number; +} + +interface SVGGraphicsElement extends SVGElement, SVGTests { + readonly farthestViewportElement: SVGElement; + readonly nearestViewportElement: SVGElement; + readonly transform: SVGAnimatedTransformList; + getBBox(): SVGRect; + getCTM(): SVGMatrix; + getScreenCTM(): SVGMatrix; + getTransformToElement(element: SVGElement): SVGMatrix; + addEventListener(type: K, listener: (this: SVGGraphicsElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGGraphicsElement: { + prototype: SVGGraphicsElement; + new(): SVGGraphicsElement; +} + +interface SVGImageElement extends SVGGraphicsElement, SVGURIReference { + readonly height: SVGAnimatedLength; + readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGImageElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGImageElement: { + prototype: SVGImageElement; + new(): SVGImageElement; +} + +interface SVGLength { + readonly unitType: number; + value: number; + valueAsString: string; + valueInSpecifiedUnits: number; + convertToSpecifiedUnits(unitType: number): void; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + readonly SVG_LENGTHTYPE_CM: number; + readonly SVG_LENGTHTYPE_EMS: number; + readonly SVG_LENGTHTYPE_EXS: number; + readonly SVG_LENGTHTYPE_IN: number; + readonly SVG_LENGTHTYPE_MM: number; + readonly SVG_LENGTHTYPE_NUMBER: number; + readonly SVG_LENGTHTYPE_PC: number; + readonly SVG_LENGTHTYPE_PERCENTAGE: number; + readonly SVG_LENGTHTYPE_PT: number; + readonly SVG_LENGTHTYPE_PX: number; + readonly SVG_LENGTHTYPE_UNKNOWN: number; +} + +declare var SVGLength: { + prototype: SVGLength; + new(): SVGLength; + readonly SVG_LENGTHTYPE_CM: number; + readonly SVG_LENGTHTYPE_EMS: number; + readonly SVG_LENGTHTYPE_EXS: number; + readonly SVG_LENGTHTYPE_IN: number; + readonly SVG_LENGTHTYPE_MM: number; + readonly SVG_LENGTHTYPE_NUMBER: number; + readonly SVG_LENGTHTYPE_PC: number; + readonly SVG_LENGTHTYPE_PERCENTAGE: number; + readonly SVG_LENGTHTYPE_PT: number; + readonly SVG_LENGTHTYPE_PX: number; + readonly SVG_LENGTHTYPE_UNKNOWN: number; +} + +interface SVGLengthList { + readonly numberOfItems: number; + appendItem(newItem: SVGLength): SVGLength; + clear(): void; + getItem(index: number): SVGLength; + initialize(newItem: SVGLength): SVGLength; + insertItemBefore(newItem: SVGLength, index: number): SVGLength; + removeItem(index: number): SVGLength; + replaceItem(newItem: SVGLength, index: number): SVGLength; +} + +declare var SVGLengthList: { + prototype: SVGLengthList; + new(): SVGLengthList; +} + +interface SVGLineElement extends SVGGraphicsElement { + readonly x1: SVGAnimatedLength; + readonly x2: SVGAnimatedLength; + readonly y1: SVGAnimatedLength; + readonly y2: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGLineElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGLineElement: { + prototype: SVGLineElement; + new(): SVGLineElement; +} + +interface SVGLinearGradientElement extends SVGGradientElement { + readonly x1: SVGAnimatedLength; + readonly x2: SVGAnimatedLength; + readonly y1: SVGAnimatedLength; + readonly y2: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGLinearGradientElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGLinearGradientElement: { + prototype: SVGLinearGradientElement; + new(): SVGLinearGradientElement; +} + +interface SVGMarkerElement extends SVGElement, SVGFitToViewBox { + readonly markerHeight: SVGAnimatedLength; + readonly markerUnits: SVGAnimatedEnumeration; + readonly markerWidth: SVGAnimatedLength; + readonly orientAngle: SVGAnimatedAngle; + readonly orientType: SVGAnimatedEnumeration; + readonly refX: SVGAnimatedLength; + readonly refY: SVGAnimatedLength; + setOrientToAngle(angle: SVGAngle): void; + setOrientToAuto(): void; + readonly SVG_MARKERUNITS_STROKEWIDTH: number; + readonly SVG_MARKERUNITS_UNKNOWN: number; + readonly SVG_MARKERUNITS_USERSPACEONUSE: number; + readonly SVG_MARKER_ORIENT_ANGLE: number; + readonly SVG_MARKER_ORIENT_AUTO: number; + readonly SVG_MARKER_ORIENT_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGMarkerElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGMarkerElement: { + prototype: SVGMarkerElement; + new(): SVGMarkerElement; + readonly SVG_MARKERUNITS_STROKEWIDTH: number; + readonly SVG_MARKERUNITS_UNKNOWN: number; + readonly SVG_MARKERUNITS_USERSPACEONUSE: number; + readonly SVG_MARKER_ORIENT_ANGLE: number; + readonly SVG_MARKER_ORIENT_AUTO: number; + readonly SVG_MARKER_ORIENT_UNKNOWN: number; +} + +interface SVGMaskElement extends SVGElement, SVGTests, SVGUnitTypes { + readonly height: SVGAnimatedLength; + readonly maskContentUnits: SVGAnimatedEnumeration; + readonly maskUnits: SVGAnimatedEnumeration; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGMaskElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGMaskElement: { + prototype: SVGMaskElement; + new(): SVGMaskElement; +} + +interface SVGMatrix { + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + flipX(): SVGMatrix; + flipY(): SVGMatrix; + inverse(): SVGMatrix; + multiply(secondMatrix: SVGMatrix): SVGMatrix; + rotate(angle: number): SVGMatrix; + rotateFromVector(x: number, y: number): SVGMatrix; + scale(scaleFactor: number): SVGMatrix; + scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; + skewX(angle: number): SVGMatrix; + skewY(angle: number): SVGMatrix; + translate(x: number, y: number): SVGMatrix; +} + +declare var SVGMatrix: { + prototype: SVGMatrix; + new(): SVGMatrix; +} + +interface SVGMetadataElement extends SVGElement { + addEventListener(type: K, listener: (this: SVGMetadataElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGMetadataElement: { + prototype: SVGMetadataElement; + new(): SVGMetadataElement; +} + +interface SVGNumber { + value: number; +} + +declare var SVGNumber: { + prototype: SVGNumber; + new(): SVGNumber; +} + +interface SVGNumberList { + readonly numberOfItems: number; + appendItem(newItem: SVGNumber): SVGNumber; + clear(): void; + getItem(index: number): SVGNumber; + initialize(newItem: SVGNumber): SVGNumber; + insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; + removeItem(index: number): SVGNumber; + replaceItem(newItem: SVGNumber, index: number): SVGNumber; +} + +declare var SVGNumberList: { + prototype: SVGNumberList; + new(): SVGNumberList; +} + +interface SVGPathElement extends SVGGraphicsElement { + readonly pathSegList: SVGPathSegList; + createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; + createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; + createSVGPathSegClosePath(): SVGPathSegClosePath; + createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; + createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; + createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; + createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; + createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; + createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; + createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; + createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; + createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; + createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; + createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; + createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; + createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; + createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; + createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; + createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; + getPathSegAtLength(distance: number): number; + getPointAtLength(distance: number): SVGPoint; + getTotalLength(): number; + addEventListener(type: K, listener: (this: SVGPathElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPathElement: { + prototype: SVGPathElement; + new(): SVGPathElement; +} + +interface SVGPathSeg { + readonly pathSegType: number; + readonly pathSegTypeAsLetter: string; + readonly PATHSEG_ARC_ABS: number; + readonly PATHSEG_ARC_REL: number; + readonly PATHSEG_CLOSEPATH: number; + readonly PATHSEG_CURVETO_CUBIC_ABS: number; + readonly PATHSEG_CURVETO_CUBIC_REL: number; + readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + readonly PATHSEG_CURVETO_QUADRATIC_ABS: number; + readonly PATHSEG_CURVETO_QUADRATIC_REL: number; + readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; + readonly PATHSEG_LINETO_ABS: number; + readonly PATHSEG_LINETO_HORIZONTAL_ABS: number; + readonly PATHSEG_LINETO_HORIZONTAL_REL: number; + readonly PATHSEG_LINETO_REL: number; + readonly PATHSEG_LINETO_VERTICAL_ABS: number; + readonly PATHSEG_LINETO_VERTICAL_REL: number; + readonly PATHSEG_MOVETO_ABS: number; + readonly PATHSEG_MOVETO_REL: number; + readonly PATHSEG_UNKNOWN: number; +} + +declare var SVGPathSeg: { + prototype: SVGPathSeg; + new(): SVGPathSeg; + readonly PATHSEG_ARC_ABS: number; + readonly PATHSEG_ARC_REL: number; + readonly PATHSEG_CLOSEPATH: number; + readonly PATHSEG_CURVETO_CUBIC_ABS: number; + readonly PATHSEG_CURVETO_CUBIC_REL: number; + readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + readonly PATHSEG_CURVETO_QUADRATIC_ABS: number; + readonly PATHSEG_CURVETO_QUADRATIC_REL: number; + readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; + readonly PATHSEG_LINETO_ABS: number; + readonly PATHSEG_LINETO_HORIZONTAL_ABS: number; + readonly PATHSEG_LINETO_HORIZONTAL_REL: number; + readonly PATHSEG_LINETO_REL: number; + readonly PATHSEG_LINETO_VERTICAL_ABS: number; + readonly PATHSEG_LINETO_VERTICAL_REL: number; + readonly PATHSEG_MOVETO_ABS: number; + readonly PATHSEG_MOVETO_REL: number; + readonly PATHSEG_UNKNOWN: number; +} + +interface SVGPathSegArcAbs extends SVGPathSeg { + angle: number; + largeArcFlag: boolean; + r1: number; + r2: number; + sweepFlag: boolean; + x: number; + y: number; +} + +declare var SVGPathSegArcAbs: { + prototype: SVGPathSegArcAbs; + new(): SVGPathSegArcAbs; +} + +interface SVGPathSegArcRel extends SVGPathSeg { + angle: number; + largeArcFlag: boolean; + r1: number; + r2: number; + sweepFlag: boolean; + x: number; + y: number; +} + +declare var SVGPathSegArcRel: { + prototype: SVGPathSegArcRel; + new(): SVGPathSegArcRel; +} + +interface SVGPathSegClosePath extends SVGPathSeg { +} + +declare var SVGPathSegClosePath: { + prototype: SVGPathSegClosePath; + new(): SVGPathSegClosePath; +} + +interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { + x: number; + x1: number; + x2: number; + y: number; + y1: number; + y2: number; +} + +declare var SVGPathSegCurvetoCubicAbs: { + prototype: SVGPathSegCurvetoCubicAbs; + new(): SVGPathSegCurvetoCubicAbs; +} + +interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { + x: number; + x1: number; + x2: number; + y: number; + y1: number; + y2: number; +} + +declare var SVGPathSegCurvetoCubicRel: { + prototype: SVGPathSegCurvetoCubicRel; + new(): SVGPathSegCurvetoCubicRel; +} + +interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { + x: number; + x2: number; + y: number; + y2: number; +} + +declare var SVGPathSegCurvetoCubicSmoothAbs: { + prototype: SVGPathSegCurvetoCubicSmoothAbs; + new(): SVGPathSegCurvetoCubicSmoothAbs; +} + +interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { + x: number; + x2: number; + y: number; + y2: number; +} + +declare var SVGPathSegCurvetoCubicSmoothRel: { + prototype: SVGPathSegCurvetoCubicSmoothRel; + new(): SVGPathSegCurvetoCubicSmoothRel; +} + +interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { + x: number; + x1: number; + y: number; + y1: number; +} + +declare var SVGPathSegCurvetoQuadraticAbs: { + prototype: SVGPathSegCurvetoQuadraticAbs; + new(): SVGPathSegCurvetoQuadraticAbs; +} + +interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { + x: number; + x1: number; + y: number; + y1: number; +} + +declare var SVGPathSegCurvetoQuadraticRel: { + prototype: SVGPathSegCurvetoQuadraticRel; + new(): SVGPathSegCurvetoQuadraticRel; +} + +interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegCurvetoQuadraticSmoothAbs: { + prototype: SVGPathSegCurvetoQuadraticSmoothAbs; + new(): SVGPathSegCurvetoQuadraticSmoothAbs; +} + +interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegCurvetoQuadraticSmoothRel: { + prototype: SVGPathSegCurvetoQuadraticSmoothRel; + new(): SVGPathSegCurvetoQuadraticSmoothRel; +} + +interface SVGPathSegLinetoAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegLinetoAbs: { + prototype: SVGPathSegLinetoAbs; + new(): SVGPathSegLinetoAbs; +} + +interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { + x: number; +} + +declare var SVGPathSegLinetoHorizontalAbs: { + prototype: SVGPathSegLinetoHorizontalAbs; + new(): SVGPathSegLinetoHorizontalAbs; +} + +interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { + x: number; +} + +declare var SVGPathSegLinetoHorizontalRel: { + prototype: SVGPathSegLinetoHorizontalRel; + new(): SVGPathSegLinetoHorizontalRel; +} + +interface SVGPathSegLinetoRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegLinetoRel: { + prototype: SVGPathSegLinetoRel; + new(): SVGPathSegLinetoRel; +} + +interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { + y: number; +} + +declare var SVGPathSegLinetoVerticalAbs: { + prototype: SVGPathSegLinetoVerticalAbs; + new(): SVGPathSegLinetoVerticalAbs; +} + +interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { + y: number; +} + +declare var SVGPathSegLinetoVerticalRel: { + prototype: SVGPathSegLinetoVerticalRel; + new(): SVGPathSegLinetoVerticalRel; +} + +interface SVGPathSegList { + readonly numberOfItems: number; + appendItem(newItem: SVGPathSeg): SVGPathSeg; + clear(): void; + getItem(index: number): SVGPathSeg; + initialize(newItem: SVGPathSeg): SVGPathSeg; + insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; + removeItem(index: number): SVGPathSeg; + replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; +} + +declare var SVGPathSegList: { + prototype: SVGPathSegList; + new(): SVGPathSegList; +} + +interface SVGPathSegMovetoAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegMovetoAbs: { + prototype: SVGPathSegMovetoAbs; + new(): SVGPathSegMovetoAbs; +} + +interface SVGPathSegMovetoRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegMovetoRel: { + prototype: SVGPathSegMovetoRel; + new(): SVGPathSegMovetoRel; +} + +interface SVGPatternElement extends SVGElement, SVGTests, SVGUnitTypes, SVGFitToViewBox, SVGURIReference { + readonly height: SVGAnimatedLength; + readonly patternContentUnits: SVGAnimatedEnumeration; + readonly patternTransform: SVGAnimatedTransformList; + readonly patternUnits: SVGAnimatedEnumeration; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGPatternElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPatternElement: { + prototype: SVGPatternElement; + new(): SVGPatternElement; +} + +interface SVGPoint { + x: number; + y: number; + matrixTransform(matrix: SVGMatrix): SVGPoint; +} + +declare var SVGPoint: { + prototype: SVGPoint; + new(): SVGPoint; +} + +interface SVGPointList { + readonly numberOfItems: number; + appendItem(newItem: SVGPoint): SVGPoint; + clear(): void; + getItem(index: number): SVGPoint; + initialize(newItem: SVGPoint): SVGPoint; + insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; + removeItem(index: number): SVGPoint; + replaceItem(newItem: SVGPoint, index: number): SVGPoint; +} + +declare var SVGPointList: { + prototype: SVGPointList; + new(): SVGPointList; +} + +interface SVGPolygonElement extends SVGGraphicsElement, SVGAnimatedPoints { + addEventListener(type: K, listener: (this: SVGPolygonElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPolygonElement: { + prototype: SVGPolygonElement; + new(): SVGPolygonElement; +} + +interface SVGPolylineElement extends SVGGraphicsElement, SVGAnimatedPoints { + addEventListener(type: K, listener: (this: SVGPolylineElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPolylineElement: { + prototype: SVGPolylineElement; + new(): SVGPolylineElement; +} + +interface SVGPreserveAspectRatio { + align: number; + meetOrSlice: number; + readonly SVG_MEETORSLICE_MEET: number; + readonly SVG_MEETORSLICE_SLICE: number; + readonly SVG_MEETORSLICE_UNKNOWN: number; + readonly SVG_PRESERVEASPECTRATIO_NONE: number; + readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number; + readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number; +} + +declare var SVGPreserveAspectRatio: { + prototype: SVGPreserveAspectRatio; + new(): SVGPreserveAspectRatio; + readonly SVG_MEETORSLICE_MEET: number; + readonly SVG_MEETORSLICE_SLICE: number; + readonly SVG_MEETORSLICE_UNKNOWN: number; + readonly SVG_PRESERVEASPECTRATIO_NONE: number; + readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number; + readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number; +} + +interface SVGRadialGradientElement extends SVGGradientElement { + readonly cx: SVGAnimatedLength; + readonly cy: SVGAnimatedLength; + readonly fx: SVGAnimatedLength; + readonly fy: SVGAnimatedLength; + readonly r: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGRadialGradientElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGRadialGradientElement: { + prototype: SVGRadialGradientElement; + new(): SVGRadialGradientElement; +} + +interface SVGRect { + height: number; + width: number; + x: number; + y: number; +} + +declare var SVGRect: { + prototype: SVGRect; + new(): SVGRect; +} + +interface SVGRectElement extends SVGGraphicsElement { + readonly height: SVGAnimatedLength; + readonly rx: SVGAnimatedLength; + readonly ry: SVGAnimatedLength; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGRectElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGRectElement: { + prototype: SVGRectElement; + new(): SVGRectElement; +} + +interface SVGSVGElementEventMap extends SVGElementEventMap { + "SVGAbort": Event; + "SVGError": Event; + "resize": UIEvent; + "scroll": UIEvent; + "SVGUnload": Event; + "SVGZoom": SVGZoomEvent; +} + +interface SVGSVGElement extends SVGGraphicsElement, DocumentEvent, SVGFitToViewBox, SVGZoomAndPan { + contentScriptType: string; + contentStyleType: string; + currentScale: number; + readonly currentTranslate: SVGPoint; + readonly height: SVGAnimatedLength; + onabort: (this: SVGSVGElement, ev: Event) => any; + onerror: (this: SVGSVGElement, ev: Event) => any; + onresize: (this: SVGSVGElement, ev: UIEvent) => any; + onscroll: (this: SVGSVGElement, ev: UIEvent) => any; + onunload: (this: SVGSVGElement, ev: Event) => any; + onzoom: (this: SVGSVGElement, ev: SVGZoomEvent) => any; + readonly pixelUnitToMillimeterX: number; + readonly pixelUnitToMillimeterY: number; + readonly screenPixelToMillimeterX: number; + readonly screenPixelToMillimeterY: number; + readonly viewport: SVGRect; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + checkEnclosure(element: SVGElement, rect: SVGRect): boolean; + checkIntersection(element: SVGElement, rect: SVGRect): boolean; + createSVGAngle(): SVGAngle; + createSVGLength(): SVGLength; + createSVGMatrix(): SVGMatrix; + createSVGNumber(): SVGNumber; + createSVGPoint(): SVGPoint; + createSVGRect(): SVGRect; + createSVGTransform(): SVGTransform; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; + deselectAll(): void; + forceRedraw(): void; + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; + getCurrentTime(): number; + getElementById(elementId: string): Element; + getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeListOf; + getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeListOf; + pauseAnimations(): void; + setCurrentTime(seconds: number): void; + suspendRedraw(maxWaitMilliseconds: number): number; + unpauseAnimations(): void; + unsuspendRedraw(suspendHandleID: number): void; + unsuspendRedrawAll(): void; + addEventListener(type: K, listener: (this: SVGSVGElement, ev: SVGSVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSVGElement: { + prototype: SVGSVGElement; + new(): SVGSVGElement; +} + +interface SVGScriptElement extends SVGElement, SVGURIReference { + type: string; + addEventListener(type: K, listener: (this: SVGScriptElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGScriptElement: { + prototype: SVGScriptElement; + new(): SVGScriptElement; +} + +interface SVGStopElement extends SVGElement { + readonly offset: SVGAnimatedNumber; + addEventListener(type: K, listener: (this: SVGStopElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGStopElement: { + prototype: SVGStopElement; + new(): SVGStopElement; +} + +interface SVGStringList { + readonly numberOfItems: number; + appendItem(newItem: string): string; + clear(): void; + getItem(index: number): string; + initialize(newItem: string): string; + insertItemBefore(newItem: string, index: number): string; + removeItem(index: number): string; + replaceItem(newItem: string, index: number): string; +} + +declare var SVGStringList: { + prototype: SVGStringList; + new(): SVGStringList; +} + +interface SVGStyleElement extends SVGElement { + disabled: boolean; + media: string; + title: string; + type: string; + addEventListener(type: K, listener: (this: SVGStyleElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGStyleElement: { + prototype: SVGStyleElement; + new(): SVGStyleElement; +} + +interface SVGSwitchElement extends SVGGraphicsElement { + addEventListener(type: K, listener: (this: SVGSwitchElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSwitchElement: { + prototype: SVGSwitchElement; + new(): SVGSwitchElement; +} + +interface SVGSymbolElement extends SVGElement, SVGFitToViewBox { + addEventListener(type: K, listener: (this: SVGSymbolElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSymbolElement: { + prototype: SVGSymbolElement; + new(): SVGSymbolElement; +} + +interface SVGTSpanElement extends SVGTextPositioningElement { + addEventListener(type: K, listener: (this: SVGTSpanElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTSpanElement: { + prototype: SVGTSpanElement; + new(): SVGTSpanElement; +} + +interface SVGTextContentElement extends SVGGraphicsElement { + readonly lengthAdjust: SVGAnimatedEnumeration; + readonly textLength: SVGAnimatedLength; + getCharNumAtPosition(point: SVGPoint): number; + getComputedTextLength(): number; + getEndPositionOfChar(charnum: number): SVGPoint; + getExtentOfChar(charnum: number): SVGRect; + getNumberOfChars(): number; + getRotationOfChar(charnum: number): number; + getStartPositionOfChar(charnum: number): SVGPoint; + getSubStringLength(charnum: number, nchars: number): number; + selectSubString(charnum: number, nchars: number): void; + readonly LENGTHADJUST_SPACING: number; + readonly LENGTHADJUST_SPACINGANDGLYPHS: number; + readonly LENGTHADJUST_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGTextContentElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextContentElement: { + prototype: SVGTextContentElement; + new(): SVGTextContentElement; + readonly LENGTHADJUST_SPACING: number; + readonly LENGTHADJUST_SPACINGANDGLYPHS: number; + readonly LENGTHADJUST_UNKNOWN: number; +} + +interface SVGTextElement extends SVGTextPositioningElement { + addEventListener(type: K, listener: (this: SVGTextElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextElement: { + prototype: SVGTextElement; + new(): SVGTextElement; +} + +interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { + readonly method: SVGAnimatedEnumeration; + readonly spacing: SVGAnimatedEnumeration; + readonly startOffset: SVGAnimatedLength; + readonly TEXTPATH_METHODTYPE_ALIGN: number; + readonly TEXTPATH_METHODTYPE_STRETCH: number; + readonly TEXTPATH_METHODTYPE_UNKNOWN: number; + readonly TEXTPATH_SPACINGTYPE_AUTO: number; + readonly TEXTPATH_SPACINGTYPE_EXACT: number; + readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGTextPathElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextPathElement: { + prototype: SVGTextPathElement; + new(): SVGTextPathElement; + readonly TEXTPATH_METHODTYPE_ALIGN: number; + readonly TEXTPATH_METHODTYPE_STRETCH: number; + readonly TEXTPATH_METHODTYPE_UNKNOWN: number; + readonly TEXTPATH_SPACINGTYPE_AUTO: number; + readonly TEXTPATH_SPACINGTYPE_EXACT: number; + readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number; +} + +interface SVGTextPositioningElement extends SVGTextContentElement { + readonly dx: SVGAnimatedLengthList; + readonly dy: SVGAnimatedLengthList; + readonly rotate: SVGAnimatedNumberList; + readonly x: SVGAnimatedLengthList; + readonly y: SVGAnimatedLengthList; + addEventListener(type: K, listener: (this: SVGTextPositioningElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextPositioningElement: { + prototype: SVGTextPositioningElement; + new(): SVGTextPositioningElement; +} + +interface SVGTitleElement extends SVGElement { + addEventListener(type: K, listener: (this: SVGTitleElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTitleElement: { + prototype: SVGTitleElement; + new(): SVGTitleElement; +} + +interface SVGTransform { + readonly angle: number; + readonly matrix: SVGMatrix; + readonly type: number; + setMatrix(matrix: SVGMatrix): void; + setRotate(angle: number, cx: number, cy: number): void; + setScale(sx: number, sy: number): void; + setSkewX(angle: number): void; + setSkewY(angle: number): void; + setTranslate(tx: number, ty: number): void; + readonly SVG_TRANSFORM_MATRIX: number; + readonly SVG_TRANSFORM_ROTATE: number; + readonly SVG_TRANSFORM_SCALE: number; + readonly SVG_TRANSFORM_SKEWX: number; + readonly SVG_TRANSFORM_SKEWY: number; + readonly SVG_TRANSFORM_TRANSLATE: number; + readonly SVG_TRANSFORM_UNKNOWN: number; +} + +declare var SVGTransform: { + prototype: SVGTransform; + new(): SVGTransform; + readonly SVG_TRANSFORM_MATRIX: number; + readonly SVG_TRANSFORM_ROTATE: number; + readonly SVG_TRANSFORM_SCALE: number; + readonly SVG_TRANSFORM_SKEWX: number; + readonly SVG_TRANSFORM_SKEWY: number; + readonly SVG_TRANSFORM_TRANSLATE: number; + readonly SVG_TRANSFORM_UNKNOWN: number; +} + +interface SVGTransformList { + readonly numberOfItems: number; + appendItem(newItem: SVGTransform): SVGTransform; + clear(): void; + consolidate(): SVGTransform; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; + getItem(index: number): SVGTransform; + initialize(newItem: SVGTransform): SVGTransform; + insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; + removeItem(index: number): SVGTransform; + replaceItem(newItem: SVGTransform, index: number): SVGTransform; +} + +declare var SVGTransformList: { + prototype: SVGTransformList; + new(): SVGTransformList; +} + +interface SVGUnitTypes { + readonly SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; + readonly SVG_UNIT_TYPE_UNKNOWN: number; + readonly SVG_UNIT_TYPE_USERSPACEONUSE: number; +} +declare var SVGUnitTypes: SVGUnitTypes; + +interface SVGUseElement extends SVGGraphicsElement, SVGURIReference { + readonly animatedInstanceRoot: SVGElementInstance; + readonly height: SVGAnimatedLength; + readonly instanceRoot: SVGElementInstance; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGUseElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGUseElement: { + prototype: SVGUseElement; + new(): SVGUseElement; +} + +interface SVGViewElement extends SVGElement, SVGZoomAndPan, SVGFitToViewBox { + readonly viewTarget: SVGStringList; + addEventListener(type: K, listener: (this: SVGViewElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGViewElement: { + prototype: SVGViewElement; + new(): SVGViewElement; +} + +interface SVGZoomAndPan { + readonly zoomAndPan: number; +} + +declare var SVGZoomAndPan: { + readonly SVG_ZOOMANDPAN_DISABLE: number; + readonly SVG_ZOOMANDPAN_MAGNIFY: number; + readonly SVG_ZOOMANDPAN_UNKNOWN: number; +} + +interface SVGZoomEvent extends UIEvent { + readonly newScale: number; + readonly newTranslate: SVGPoint; + readonly previousScale: number; + readonly previousTranslate: SVGPoint; + readonly zoomRectScreen: SVGRect; +} + +declare var SVGZoomEvent: { + prototype: SVGZoomEvent; + new(): SVGZoomEvent; +} + +interface ScopedCredential { + readonly id: ArrayBuffer; + readonly type: ScopedCredentialType; +} + +declare var ScopedCredential: { + prototype: ScopedCredential; + new(): ScopedCredential; +} + +interface ScopedCredentialInfo { + readonly credential: ScopedCredential; + readonly publicKey: CryptoKey; +} + +declare var ScopedCredentialInfo: { + prototype: ScopedCredentialInfo; + new(): ScopedCredentialInfo; +} + +interface ScreenEventMap { + "MSOrientationChange": Event; +} + +interface Screen extends EventTarget { + readonly availHeight: number; + readonly availWidth: number; + bufferDepth: number; + readonly colorDepth: number; + readonly deviceXDPI: number; + readonly deviceYDPI: number; + readonly fontSmoothingEnabled: boolean; + readonly height: number; + readonly logicalXDPI: number; + readonly logicalYDPI: number; + readonly msOrientation: string; + onmsorientationchange: (this: Screen, ev: Event) => any; + readonly pixelDepth: number; + readonly systemXDPI: number; + readonly systemYDPI: number; + readonly width: number; + msLockOrientation(orientations: string | string[]): boolean; + msUnlockOrientation(): void; + addEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Screen: { + prototype: Screen; + new(): Screen; +} + +interface ScriptNotifyEvent extends Event { + readonly callingUri: string; + readonly value: string; +} + +declare var ScriptNotifyEvent: { + prototype: ScriptNotifyEvent; + new(): ScriptNotifyEvent; +} + +interface ScriptProcessorNodeEventMap { + "audioprocess": AudioProcessingEvent; +} + +interface ScriptProcessorNode extends AudioNode { + readonly bufferSize: number; + onaudioprocess: (this: ScriptProcessorNode, ev: AudioProcessingEvent) => any; + addEventListener(type: K, listener: (this: ScriptProcessorNode, ev: ScriptProcessorNodeEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ScriptProcessorNode: { + prototype: ScriptProcessorNode; + new(): ScriptProcessorNode; +} + +interface Selection { + readonly anchorNode: Node; + readonly anchorOffset: number; + readonly baseNode: Node; + readonly baseOffset: number; + readonly extentNode: Node; + readonly extentOffset: number; + readonly focusNode: Node; + readonly focusOffset: number; + readonly isCollapsed: boolean; + readonly rangeCount: number; + readonly type: string; + addRange(range: Range): void; + collapse(parentNode: Node, offset: number): void; + collapseToEnd(): void; + collapseToStart(): void; + containsNode(node: Node, partlyContained: boolean): boolean; + deleteFromDocument(): void; + empty(): void; + extend(newNode: Node, offset: number): void; + getRangeAt(index: number): Range; + removeAllRanges(): void; + removeRange(range: Range): void; + selectAllChildren(parentNode: Node): void; + setBaseAndExtent(baseNode: Node, baseOffset: number, extentNode: Node, extentOffset: number): void; + setPosition(parentNode: Node, offset: number): void; + toString(): string; +} + +declare var Selection: { + prototype: Selection; + new(): Selection; +} + +interface ServiceWorkerEventMap extends AbstractWorkerEventMap { + "statechange": Event; +} + +interface ServiceWorker extends EventTarget, AbstractWorker { + onstatechange: (this: ServiceWorker, ev: Event) => any; + readonly scriptURL: USVString; + readonly state: ServiceWorkerState; + postMessage(message: any, transfer?: any[]): void; + addEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ServiceWorker: { + prototype: ServiceWorker; + new(): ServiceWorker; +} + +interface ServiceWorkerContainerEventMap { + "controllerchange": Event; + "message": ServiceWorkerMessageEvent; +} + +interface ServiceWorkerContainer extends EventTarget { + readonly controller: ServiceWorker | null; + oncontrollerchange: (this: ServiceWorkerContainer, ev: Event) => any; + onmessage: (this: ServiceWorkerContainer, ev: ServiceWorkerMessageEvent) => any; + readonly ready: Promise; + getRegistration(clientURL?: USVString): Promise; + getRegistrations(): any; + register(scriptURL: USVString, options?: RegistrationOptions): Promise; + addEventListener(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ServiceWorkerContainer: { + prototype: ServiceWorkerContainer; + new(): ServiceWorkerContainer; +} + +interface ServiceWorkerMessageEvent extends Event { + readonly data: any; + readonly lastEventId: string; + readonly origin: string; + readonly ports: MessagePort[] | null; + readonly source: ServiceWorker | MessagePort | null; +} + +declare var ServiceWorkerMessageEvent: { + prototype: ServiceWorkerMessageEvent; + new(type: string, eventInitDict?: ServiceWorkerMessageEventInit): ServiceWorkerMessageEvent; +} + +interface ServiceWorkerRegistrationEventMap { + "updatefound": Event; +} + +interface ServiceWorkerRegistration extends EventTarget { + readonly active: ServiceWorker | null; + readonly installing: ServiceWorker | null; + onupdatefound: (this: ServiceWorkerRegistration, ev: Event) => any; + readonly pushManager: PushManager; + readonly scope: USVString; + readonly sync: SyncManager; + readonly waiting: ServiceWorker | null; + getNotifications(filter?: GetNotificationOptions): any; + showNotification(title: string, options?: NotificationOptions): Promise; + unregister(): Promise; + update(): Promise; + addEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ServiceWorkerRegistration: { + prototype: ServiceWorkerRegistration; + new(): ServiceWorkerRegistration; +} + +interface SourceBuffer extends EventTarget { + appendWindowEnd: number; + appendWindowStart: number; + readonly audioTracks: AudioTrackList; + readonly buffered: TimeRanges; + mode: AppendMode; + timestampOffset: number; + readonly updating: boolean; + readonly videoTracks: VideoTrackList; + abort(): void; + appendBuffer(data: ArrayBuffer | ArrayBufferView): void; + appendStream(stream: MSStream, maxSize?: number): void; + remove(start: number, end: number): void; +} + +declare var SourceBuffer: { + prototype: SourceBuffer; + new(): SourceBuffer; +} + +interface SourceBufferList extends EventTarget { + readonly length: number; + item(index: number): SourceBuffer; + [index: number]: SourceBuffer; +} + +declare var SourceBufferList: { + prototype: SourceBufferList; + new(): SourceBufferList; +} + +interface SpeechSynthesisEventMap { + "voiceschanged": Event; +} + +interface SpeechSynthesis extends EventTarget { + onvoiceschanged: (this: SpeechSynthesis, ev: Event) => any; + readonly paused: boolean; + readonly pending: boolean; + readonly speaking: boolean; + cancel(): void; + getVoices(): SpeechSynthesisVoice[]; + pause(): void; + resume(): void; + speak(utterance: SpeechSynthesisUtterance): void; + addEventListener(type: K, listener: (this: SpeechSynthesis, ev: SpeechSynthesisEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SpeechSynthesis: { + prototype: SpeechSynthesis; + new(): SpeechSynthesis; +} + +interface SpeechSynthesisEvent extends Event { + readonly charIndex: number; + readonly elapsedTime: number; + readonly name: string; + readonly utterance: SpeechSynthesisUtterance | null; +} + +declare var SpeechSynthesisEvent: { + prototype: SpeechSynthesisEvent; + new(type: string, eventInitDict?: SpeechSynthesisEventInit): SpeechSynthesisEvent; +} + +interface SpeechSynthesisUtteranceEventMap { + "boundary": Event; + "end": Event; + "error": Event; + "mark": Event; + "pause": Event; + "resume": Event; + "start": Event; +} + +interface SpeechSynthesisUtterance extends EventTarget { + lang: string; + onboundary: (this: SpeechSynthesisUtterance, ev: Event) => any; + onend: (this: SpeechSynthesisUtterance, ev: Event) => any; + onerror: (this: SpeechSynthesisUtterance, ev: Event) => any; + onmark: (this: SpeechSynthesisUtterance, ev: Event) => any; + onpause: (this: SpeechSynthesisUtterance, ev: Event) => any; + onresume: (this: SpeechSynthesisUtterance, ev: Event) => any; + onstart: (this: SpeechSynthesisUtterance, ev: Event) => any; + pitch: number; + rate: number; + text: string; + voice: SpeechSynthesisVoice; + volume: number; + addEventListener(type: K, listener: (this: SpeechSynthesisUtterance, ev: SpeechSynthesisUtteranceEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SpeechSynthesisUtterance: { + prototype: SpeechSynthesisUtterance; + new(text?: string): SpeechSynthesisUtterance; +} + +interface SpeechSynthesisVoice { + readonly default: boolean; + readonly lang: string; + readonly localService: boolean; + readonly name: string; + readonly voiceURI: string; +} + +declare var SpeechSynthesisVoice: { + prototype: SpeechSynthesisVoice; + new(): SpeechSynthesisVoice; +} + +interface StereoPannerNode extends AudioNode { + readonly pan: AudioParam; +} + +declare var StereoPannerNode: { + prototype: StereoPannerNode; + new(): StereoPannerNode; +} + +interface Storage { + readonly length: number; + clear(): void; + getItem(key: string): string | null; + key(index: number): string | null; + removeItem(key: string): void; + setItem(key: string, data: string): void; + [key: string]: any; + [index: number]: string; +} + +declare var Storage: { + prototype: Storage; + new(): Storage; +} + +interface StorageEvent extends Event { + readonly url: string; + key?: string; + oldValue?: string; + newValue?: string; + storageArea?: Storage; +} + +declare var StorageEvent: { + prototype: StorageEvent; + new (type: string, eventInitDict?: StorageEventInit): StorageEvent; +} + +interface StyleMedia { + readonly type: string; + matchMedium(mediaquery: string): boolean; +} + +declare var StyleMedia: { + prototype: StyleMedia; + new(): StyleMedia; +} + +interface StyleSheet { + disabled: boolean; + readonly href: string; + readonly media: MediaList; + readonly ownerNode: Node; + readonly parentStyleSheet: StyleSheet; + readonly title: string; + readonly type: string; +} + +declare var StyleSheet: { + prototype: StyleSheet; + new(): StyleSheet; +} + +interface StyleSheetList { + readonly length: number; + item(index?: number): StyleSheet; + [index: number]: StyleSheet; +} + +declare var StyleSheetList: { + prototype: StyleSheetList; + new(): StyleSheetList; +} + +interface StyleSheetPageList { + readonly length: number; + item(index: number): CSSPageRule; + [index: number]: CSSPageRule; +} + +declare var StyleSheetPageList: { + prototype: StyleSheetPageList; + new(): StyleSheetPageList; +} + +interface SubtleCrypto { + decrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): PromiseLike; + deriveBits(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, length: number): PromiseLike; + deriveKey(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike; + digest(algorithm: AlgorithmIdentifier, data: BufferSource): PromiseLike; + encrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): PromiseLike; + exportKey(format: "jwk", key: CryptoKey): PromiseLike; + exportKey(format: "raw" | "pkcs8" | "spki", key: CryptoKey): PromiseLike; + exportKey(format: string, key: CryptoKey): PromiseLike; + generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): PromiseLike; + generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: string[]): PromiseLike; + generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike; + importKey(format: "jwk", keyData: JsonWebKey, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike; + importKey(format: "raw" | "pkcs8" | "spki", keyData: BufferSource, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike; + importKey(format: string, keyData: JsonWebKey | BufferSource, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike; + sign(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, data: BufferSource): PromiseLike; + unwrapKey(format: string, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: string[]): PromiseLike; + verify(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, signature: BufferSource, data: BufferSource): PromiseLike; + wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier): PromiseLike; +} + +declare var SubtleCrypto: { + prototype: SubtleCrypto; + new(): SubtleCrypto; +} + +interface SyncManager { + getTags(): any; + register(tag: string): Promise; +} + +declare var SyncManager: { + prototype: SyncManager; + new(): SyncManager; +} + +interface Text extends CharacterData { + readonly wholeText: string; + readonly assignedSlot: HTMLSlotElement | null; + splitText(offset: number): Text; +} + +declare var Text: { + prototype: Text; + new(data?: string): Text; +} + +interface TextEvent extends UIEvent { + readonly data: string; + readonly inputMethod: number; + readonly locale: string; + initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; + readonly DOM_INPUT_METHOD_DROP: number; + readonly DOM_INPUT_METHOD_HANDWRITING: number; + readonly DOM_INPUT_METHOD_IME: number; + readonly DOM_INPUT_METHOD_KEYBOARD: number; + readonly DOM_INPUT_METHOD_MULTIMODAL: number; + readonly DOM_INPUT_METHOD_OPTION: number; + readonly DOM_INPUT_METHOD_PASTE: number; + readonly DOM_INPUT_METHOD_SCRIPT: number; + readonly DOM_INPUT_METHOD_UNKNOWN: number; + readonly DOM_INPUT_METHOD_VOICE: number; +} + +declare var TextEvent: { + prototype: TextEvent; + new(): TextEvent; + readonly DOM_INPUT_METHOD_DROP: number; + readonly DOM_INPUT_METHOD_HANDWRITING: number; + readonly DOM_INPUT_METHOD_IME: number; + readonly DOM_INPUT_METHOD_KEYBOARD: number; + readonly DOM_INPUT_METHOD_MULTIMODAL: number; + readonly DOM_INPUT_METHOD_OPTION: number; + readonly DOM_INPUT_METHOD_PASTE: number; + readonly DOM_INPUT_METHOD_SCRIPT: number; + readonly DOM_INPUT_METHOD_UNKNOWN: number; + readonly DOM_INPUT_METHOD_VOICE: number; +} + +interface TextMetrics { + readonly width: number; +} + +declare var TextMetrics: { + prototype: TextMetrics; + new(): TextMetrics; +} + +interface TextTrackEventMap { + "cuechange": Event; + "error": Event; + "load": Event; +} + +interface TextTrack extends EventTarget { + readonly activeCues: TextTrackCueList; + readonly cues: TextTrackCueList; + readonly inBandMetadataTrackDispatchType: string; + readonly kind: string; + readonly label: string; + readonly language: string; + mode: any; + oncuechange: (this: TextTrack, ev: Event) => any; + onerror: (this: TextTrack, ev: Event) => any; + onload: (this: TextTrack, ev: Event) => any; + readonly readyState: number; + addCue(cue: TextTrackCue): void; + removeCue(cue: TextTrackCue): void; + readonly DISABLED: number; + readonly ERROR: number; + readonly HIDDEN: number; + readonly LOADED: number; + readonly LOADING: number; + readonly NONE: number; + readonly SHOWING: number; + addEventListener(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var TextTrack: { + prototype: TextTrack; + new(): TextTrack; + readonly DISABLED: number; + readonly ERROR: number; + readonly HIDDEN: number; + readonly LOADED: number; + readonly LOADING: number; + readonly NONE: number; + readonly SHOWING: number; +} + +interface TextTrackCueEventMap { + "enter": Event; + "exit": Event; +} + +interface TextTrackCue extends EventTarget { + endTime: number; + id: string; + onenter: (this: TextTrackCue, ev: Event) => any; + onexit: (this: TextTrackCue, ev: Event) => any; + pauseOnExit: boolean; + startTime: number; + text: string; + readonly track: TextTrack; + getCueAsHTML(): DocumentFragment; + addEventListener(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var TextTrackCue: { + prototype: TextTrackCue; + new(startTime: number, endTime: number, text: string): TextTrackCue; +} + +interface TextTrackCueList { + readonly length: number; + getCueById(id: string): TextTrackCue; + item(index: number): TextTrackCue; + [index: number]: TextTrackCue; +} + +declare var TextTrackCueList: { + prototype: TextTrackCueList; + new(): TextTrackCueList; +} + +interface TextTrackListEventMap { + "addtrack": TrackEvent; +} + +interface TextTrackList extends EventTarget { + readonly length: number; + onaddtrack: ((this: TextTrackList, ev: TrackEvent) => any) | null; + item(index: number): TextTrack; + addEventListener(type: K, listener: (this: TextTrackList, ev: TextTrackListEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: TextTrack; +} + +declare var TextTrackList: { + prototype: TextTrackList; + new(): TextTrackList; +} + +interface TimeRanges { + readonly length: number; + end(index: number): number; + start(index: number): number; +} + +declare var TimeRanges: { + prototype: TimeRanges; + new(): TimeRanges; +} + +interface Touch { + readonly clientX: number; + readonly clientY: number; + readonly identifier: number; + readonly pageX: number; + readonly pageY: number; + readonly screenX: number; + readonly screenY: number; + readonly target: EventTarget; +} + +declare var Touch: { + prototype: Touch; + new(): Touch; +} + +interface TouchEvent extends UIEvent { + readonly altKey: boolean; + readonly changedTouches: TouchList; + readonly charCode: number; + readonly ctrlKey: boolean; + readonly keyCode: number; + readonly metaKey: boolean; + readonly shiftKey: boolean; + readonly targetTouches: TouchList; + readonly touches: TouchList; + readonly which: number; +} + +declare var TouchEvent: { + prototype: TouchEvent; + new(type: string, touchEventInit?: TouchEventInit): TouchEvent; +} + +interface TouchList { + readonly length: number; + item(index: number): Touch | null; + [index: number]: Touch; +} + +declare var TouchList: { + prototype: TouchList; + new(): TouchList; +} + +interface TrackEvent extends Event { + readonly track: VideoTrack | AudioTrack | TextTrack | null; +} + +declare var TrackEvent: { + prototype: TrackEvent; + new(typeArg: string, eventInitDict?: TrackEventInit): TrackEvent; +} + +interface TransitionEvent extends Event { + readonly elapsedTime: number; + readonly propertyName: string; + initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; +} + +declare var TransitionEvent: { + prototype: TransitionEvent; + new(typeArg: string, eventInitDict?: TransitionEventInit): TransitionEvent; +} + +interface TreeWalker { + currentNode: Node; + readonly expandEntityReferences: boolean; + readonly filter: NodeFilter; + readonly root: Node; + readonly whatToShow: number; + firstChild(): Node; + lastChild(): Node; + nextNode(): Node; + nextSibling(): Node; + parentNode(): Node; + previousNode(): Node; + previousSibling(): Node; +} + +declare var TreeWalker: { + prototype: TreeWalker; + new(): TreeWalker; +} + +interface UIEvent extends Event { + readonly detail: number; + readonly view: Window; + initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; +} + +declare var UIEvent: { + prototype: UIEvent; + new(typeArg: string, eventInitDict?: UIEventInit): UIEvent; +} + +interface URL { + hash: string; + host: string; + hostname: string; + href: string; + readonly origin: string; + password: string; + pathname: string; + port: string; + protocol: string; + search: string; + username: string; + readonly searchParams: URLSearchParams; + toString(): string; +} + +declare var URL: { + prototype: URL; + new(url: string, base?: string): URL; + createObjectURL(object: any, options?: ObjectURLOptions): string; + revokeObjectURL(url: string): void; +} + +interface UnviewableContentIdentifiedEvent extends NavigationEventWithReferrer { + readonly mediaType: string; +} + +declare var UnviewableContentIdentifiedEvent: { + prototype: UnviewableContentIdentifiedEvent; + new(): UnviewableContentIdentifiedEvent; +} + +interface ValidityState { + readonly badInput: boolean; + readonly customError: boolean; + readonly patternMismatch: boolean; + readonly rangeOverflow: boolean; + readonly rangeUnderflow: boolean; + readonly stepMismatch: boolean; + readonly tooLong: boolean; + readonly typeMismatch: boolean; + readonly valid: boolean; + readonly valueMissing: boolean; +} + +declare var ValidityState: { + prototype: ValidityState; + new(): ValidityState; +} + +interface VideoPlaybackQuality { + readonly corruptedVideoFrames: number; + readonly creationTime: number; + readonly droppedVideoFrames: number; + readonly totalFrameDelay: number; + readonly totalVideoFrames: number; +} + +declare var VideoPlaybackQuality: { + prototype: VideoPlaybackQuality; + new(): VideoPlaybackQuality; +} + +interface VideoTrack { + readonly id: string; + kind: string; + readonly label: string; + language: string; + selected: boolean; + readonly sourceBuffer: SourceBuffer; +} + +declare var VideoTrack: { + prototype: VideoTrack; + new(): VideoTrack; +} + +interface VideoTrackListEventMap { + "addtrack": TrackEvent; + "change": Event; + "removetrack": TrackEvent; +} + +interface VideoTrackList extends EventTarget { + readonly length: number; + onaddtrack: (this: VideoTrackList, ev: TrackEvent) => any; + onchange: (this: VideoTrackList, ev: Event) => any; + onremovetrack: (this: VideoTrackList, ev: TrackEvent) => any; + readonly selectedIndex: number; + getTrackById(id: string): VideoTrack | null; + item(index: number): VideoTrack; + addEventListener(type: K, listener: (this: VideoTrackList, ev: VideoTrackListEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: VideoTrack; +} + +declare var VideoTrackList: { + prototype: VideoTrackList; + new(): VideoTrackList; +} + +interface WEBGL_compressed_texture_s3tc { + readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number; + readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number; +} + +declare var WEBGL_compressed_texture_s3tc: { + prototype: WEBGL_compressed_texture_s3tc; + new(): WEBGL_compressed_texture_s3tc; + readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number; + readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number; +} + +interface WEBGL_debug_renderer_info { + readonly UNMASKED_RENDERER_WEBGL: number; + readonly UNMASKED_VENDOR_WEBGL: number; +} + +declare var WEBGL_debug_renderer_info: { + prototype: WEBGL_debug_renderer_info; + new(): WEBGL_debug_renderer_info; + readonly UNMASKED_RENDERER_WEBGL: number; + readonly UNMASKED_VENDOR_WEBGL: number; +} + +interface WEBGL_depth_texture { + readonly UNSIGNED_INT_24_8_WEBGL: number; +} + +declare var WEBGL_depth_texture: { + prototype: WEBGL_depth_texture; + new(): WEBGL_depth_texture; + readonly UNSIGNED_INT_24_8_WEBGL: number; +} + +interface WaveShaperNode extends AudioNode { + curve: Float32Array | null; + oversample: OverSampleType; +} + +declare var WaveShaperNode: { + prototype: WaveShaperNode; + new(): WaveShaperNode; +} + +interface WebAuthentication { + getAssertion(assertionChallenge: any, options?: AssertionOptions): Promise; + makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: any, options?: ScopedCredentialOptions): Promise; +} + +declare var WebAuthentication: { + prototype: WebAuthentication; + new(): WebAuthentication; +} + +interface WebAuthnAssertion { + readonly authenticatorData: ArrayBuffer; + readonly clientData: ArrayBuffer; + readonly credential: ScopedCredential; + readonly signature: ArrayBuffer; +} + +declare var WebAuthnAssertion: { + prototype: WebAuthnAssertion; + new(): WebAuthnAssertion; +} + +interface WebGLActiveInfo { + readonly name: string; + readonly size: number; + readonly type: number; +} + +declare var WebGLActiveInfo: { + prototype: WebGLActiveInfo; + new(): WebGLActiveInfo; +} + +interface WebGLBuffer extends WebGLObject { +} + +declare var WebGLBuffer: { + prototype: WebGLBuffer; + new(): WebGLBuffer; +} + +interface WebGLContextEvent extends Event { + readonly statusMessage: string; +} + +declare var WebGLContextEvent: { + prototype: WebGLContextEvent; + new(typeArg: string, eventInitDict?: WebGLContextEventInit): WebGLContextEvent; +} + +interface WebGLFramebuffer extends WebGLObject { +} + +declare var WebGLFramebuffer: { + prototype: WebGLFramebuffer; + new(): WebGLFramebuffer; +} + +interface WebGLObject { +} + +declare var WebGLObject: { + prototype: WebGLObject; + new(): WebGLObject; +} + +interface WebGLProgram extends WebGLObject { +} + +declare var WebGLProgram: { + prototype: WebGLProgram; + new(): WebGLProgram; +} + +interface WebGLRenderbuffer extends WebGLObject { +} + +declare var WebGLRenderbuffer: { + prototype: WebGLRenderbuffer; + new(): WebGLRenderbuffer; +} + +interface WebGLRenderingContext { + readonly canvas: HTMLCanvasElement; + readonly drawingBufferHeight: number; + readonly drawingBufferWidth: number; + activeTexture(texture: number): void; + attachShader(program: WebGLProgram | null, shader: WebGLShader | null): void; + bindAttribLocation(program: WebGLProgram | null, index: number, name: string): void; + bindBuffer(target: number, buffer: WebGLBuffer | null): void; + bindFramebuffer(target: number, framebuffer: WebGLFramebuffer | null): void; + bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer | null): void; + bindTexture(target: number, texture: WebGLTexture | null): void; + blendColor(red: number, green: number, blue: number, alpha: number): void; + blendEquation(mode: number): void; + blendEquationSeparate(modeRGB: number, modeAlpha: number): void; + blendFunc(sfactor: number, dfactor: number): void; + blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; + bufferData(target: number, size: number | ArrayBufferView | ArrayBuffer, usage: number): void; + bufferSubData(target: number, offset: number, data: ArrayBufferView | ArrayBuffer): void; + checkFramebufferStatus(target: number): number; + clear(mask: number): void; + clearColor(red: number, green: number, blue: number, alpha: number): void; + clearDepth(depth: number): void; + clearStencil(s: number): void; + colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; + compileShader(shader: WebGLShader | null): void; + compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; + compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; + copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; + copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; + createBuffer(): WebGLBuffer | null; + createFramebuffer(): WebGLFramebuffer | null; + createProgram(): WebGLProgram | null; + createRenderbuffer(): WebGLRenderbuffer | null; + createShader(type: number): WebGLShader | null; + createTexture(): WebGLTexture | null; + cullFace(mode: number): void; + deleteBuffer(buffer: WebGLBuffer | null): void; + deleteFramebuffer(framebuffer: WebGLFramebuffer | null): void; + deleteProgram(program: WebGLProgram | null): void; + deleteRenderbuffer(renderbuffer: WebGLRenderbuffer | null): void; + deleteShader(shader: WebGLShader | null): void; + deleteTexture(texture: WebGLTexture | null): void; + depthFunc(func: number): void; + depthMask(flag: boolean): void; + depthRange(zNear: number, zFar: number): void; + detachShader(program: WebGLProgram | null, shader: WebGLShader | null): void; + disable(cap: number): void; + disableVertexAttribArray(index: number): void; + drawArrays(mode: number, first: number, count: number): void; + drawElements(mode: number, count: number, type: number, offset: number): void; + enable(cap: number): void; + enableVertexAttribArray(index: number): void; + finish(): void; + flush(): void; + framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer | null): void; + framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture | null, level: number): void; + frontFace(mode: number): void; + generateMipmap(target: number): void; + getActiveAttrib(program: WebGLProgram | null, index: number): WebGLActiveInfo | null; + getActiveUniform(program: WebGLProgram | null, index: number): WebGLActiveInfo | null; + getAttachedShaders(program: WebGLProgram | null): WebGLShader[] | null; + getAttribLocation(program: WebGLProgram | null, name: string): number; + getBufferParameter(target: number, pname: number): any; + getContextAttributes(): WebGLContextAttributes; + getError(): number; + getExtension(name: string): any; + getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; + getParameter(pname: number): any; + getProgramInfoLog(program: WebGLProgram | null): string | null; + getProgramParameter(program: WebGLProgram | null, pname: number): any; + getRenderbufferParameter(target: number, pname: number): any; + getShaderInfoLog(shader: WebGLShader | null): string | null; + getShaderParameter(shader: WebGLShader | null, pname: number): any; + getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat | null; + getShaderSource(shader: WebGLShader | null): string | null; + getSupportedExtensions(): string[] | null; + getTexParameter(target: number, pname: number): any; + getUniform(program: WebGLProgram | null, location: WebGLUniformLocation | null): any; + getUniformLocation(program: WebGLProgram | null, name: string): WebGLUniformLocation | null; + getVertexAttrib(index: number, pname: number): any; + getVertexAttribOffset(index: number, pname: number): number; + hint(target: number, mode: number): void; + isBuffer(buffer: WebGLBuffer | null): boolean; + isContextLost(): boolean; + isEnabled(cap: number): boolean; + isFramebuffer(framebuffer: WebGLFramebuffer | null): boolean; + isProgram(program: WebGLProgram | null): boolean; + isRenderbuffer(renderbuffer: WebGLRenderbuffer | null): boolean; + isShader(shader: WebGLShader | null): boolean; + isTexture(texture: WebGLTexture | null): boolean; + lineWidth(width: number): void; + linkProgram(program: WebGLProgram | null): void; + pixelStorei(pname: number, param: number | boolean): void; + polygonOffset(factor: number, units: number): void; + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void; + renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; + sampleCoverage(value: number, invert: boolean): void; + scissor(x: number, y: number, width: number, height: number): void; + shaderSource(shader: WebGLShader | null, source: string): void; + stencilFunc(func: number, ref: number, mask: number): void; + stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; + stencilMask(mask: number): void; + stencilMaskSeparate(face: number, mask: number): void; + stencilOp(fail: number, zfail: number, zpass: number): void; + stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; + texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView | null): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void; + texParameterf(target: number, pname: number, param: number): void; + texParameteri(target: number, pname: number, param: number): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void; + uniform1f(location: WebGLUniformLocation | null, x: number): void; + uniform1fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform1i(location: WebGLUniformLocation | null, x: number): void; + uniform1iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform2f(location: WebGLUniformLocation | null, x: number, y: number): void; + uniform2fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform2i(location: WebGLUniformLocation | null, x: number, y: number): void; + uniform2iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform3f(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; + uniform3fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform3i(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; + uniform3iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform4f(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; + uniform4fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform4i(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; + uniform4iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; + uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; + uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; + useProgram(program: WebGLProgram | null): void; + validateProgram(program: WebGLProgram | null): void; + vertexAttrib1f(indx: number, x: number): void; + vertexAttrib1fv(indx: number, values: Float32Array | number[]): void; + vertexAttrib2f(indx: number, x: number, y: number): void; + vertexAttrib2fv(indx: number, values: Float32Array | number[]): void; + vertexAttrib3f(indx: number, x: number, y: number, z: number): void; + vertexAttrib3fv(indx: number, values: Float32Array | number[]): void; + vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; + vertexAttrib4fv(indx: number, values: Float32Array | number[]): void; + vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; + viewport(x: number, y: number, width: number, height: number): void; + readonly ACTIVE_ATTRIBUTES: number; + readonly ACTIVE_TEXTURE: number; + readonly ACTIVE_UNIFORMS: number; + readonly ALIASED_LINE_WIDTH_RANGE: number; + readonly ALIASED_POINT_SIZE_RANGE: number; + readonly ALPHA: number; + readonly ALPHA_BITS: number; + readonly ALWAYS: number; + readonly ARRAY_BUFFER: number; + readonly ARRAY_BUFFER_BINDING: number; + readonly ATTACHED_SHADERS: number; + readonly BACK: number; + readonly BLEND: number; + readonly BLEND_COLOR: number; + readonly BLEND_DST_ALPHA: number; + readonly BLEND_DST_RGB: number; + readonly BLEND_EQUATION: number; + readonly BLEND_EQUATION_ALPHA: number; + readonly BLEND_EQUATION_RGB: number; + readonly BLEND_SRC_ALPHA: number; + readonly BLEND_SRC_RGB: number; + readonly BLUE_BITS: number; + readonly BOOL: number; + readonly BOOL_VEC2: number; + readonly BOOL_VEC3: number; + readonly BOOL_VEC4: number; + readonly BROWSER_DEFAULT_WEBGL: number; + readonly BUFFER_SIZE: number; + readonly BUFFER_USAGE: number; + readonly BYTE: number; + readonly CCW: number; + readonly CLAMP_TO_EDGE: number; + readonly COLOR_ATTACHMENT0: number; + readonly COLOR_BUFFER_BIT: number; + readonly COLOR_CLEAR_VALUE: number; + readonly COLOR_WRITEMASK: number; + readonly COMPILE_STATUS: number; + readonly COMPRESSED_TEXTURE_FORMATS: number; + readonly CONSTANT_ALPHA: number; + readonly CONSTANT_COLOR: number; + readonly CONTEXT_LOST_WEBGL: number; + readonly CULL_FACE: number; + readonly CULL_FACE_MODE: number; + readonly CURRENT_PROGRAM: number; + readonly CURRENT_VERTEX_ATTRIB: number; + readonly CW: number; + readonly DECR: number; + readonly DECR_WRAP: number; + readonly DELETE_STATUS: number; + readonly DEPTH_ATTACHMENT: number; + readonly DEPTH_BITS: number; + readonly DEPTH_BUFFER_BIT: number; + readonly DEPTH_CLEAR_VALUE: number; + readonly DEPTH_COMPONENT: number; + readonly DEPTH_COMPONENT16: number; + readonly DEPTH_FUNC: number; + readonly DEPTH_RANGE: number; + readonly DEPTH_STENCIL: number; + readonly DEPTH_STENCIL_ATTACHMENT: number; + readonly DEPTH_TEST: number; + readonly DEPTH_WRITEMASK: number; + readonly DITHER: number; + readonly DONT_CARE: number; + readonly DST_ALPHA: number; + readonly DST_COLOR: number; + readonly DYNAMIC_DRAW: number; + readonly ELEMENT_ARRAY_BUFFER: number; + readonly ELEMENT_ARRAY_BUFFER_BINDING: number; + readonly EQUAL: number; + readonly FASTEST: number; + readonly FLOAT: number; + readonly FLOAT_MAT2: number; + readonly FLOAT_MAT3: number; + readonly FLOAT_MAT4: number; + readonly FLOAT_VEC2: number; + readonly FLOAT_VEC3: number; + readonly FLOAT_VEC4: number; + readonly FRAGMENT_SHADER: number; + readonly FRAMEBUFFER: number; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + readonly FRAMEBUFFER_BINDING: number; + readonly FRAMEBUFFER_COMPLETE: number; + readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + readonly FRAMEBUFFER_UNSUPPORTED: number; + readonly FRONT: number; + readonly FRONT_AND_BACK: number; + readonly FRONT_FACE: number; + readonly FUNC_ADD: number; + readonly FUNC_REVERSE_SUBTRACT: number; + readonly FUNC_SUBTRACT: number; + readonly GENERATE_MIPMAP_HINT: number; + readonly GEQUAL: number; + readonly GREATER: number; + readonly GREEN_BITS: number; + readonly HIGH_FLOAT: number; + readonly HIGH_INT: number; + readonly IMPLEMENTATION_COLOR_READ_FORMAT: number; + readonly IMPLEMENTATION_COLOR_READ_TYPE: number; + readonly INCR: number; + readonly INCR_WRAP: number; + readonly INT: number; + readonly INT_VEC2: number; + readonly INT_VEC3: number; + readonly INT_VEC4: number; + readonly INVALID_ENUM: number; + readonly INVALID_FRAMEBUFFER_OPERATION: number; + readonly INVALID_OPERATION: number; + readonly INVALID_VALUE: number; + readonly INVERT: number; + readonly KEEP: number; + readonly LEQUAL: number; + readonly LESS: number; + readonly LINEAR: number; + readonly LINEAR_MIPMAP_LINEAR: number; + readonly LINEAR_MIPMAP_NEAREST: number; + readonly LINES: number; + readonly LINE_LOOP: number; + readonly LINE_STRIP: number; + readonly LINE_WIDTH: number; + readonly LINK_STATUS: number; + readonly LOW_FLOAT: number; + readonly LOW_INT: number; + readonly LUMINANCE: number; + readonly LUMINANCE_ALPHA: number; + readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + readonly MAX_CUBE_MAP_TEXTURE_SIZE: number; + readonly MAX_FRAGMENT_UNIFORM_VECTORS: number; + readonly MAX_RENDERBUFFER_SIZE: number; + readonly MAX_TEXTURE_IMAGE_UNITS: number; + readonly MAX_TEXTURE_SIZE: number; + readonly MAX_VARYING_VECTORS: number; + readonly MAX_VERTEX_ATTRIBS: number; + readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + readonly MAX_VERTEX_UNIFORM_VECTORS: number; + readonly MAX_VIEWPORT_DIMS: number; + readonly MEDIUM_FLOAT: number; + readonly MEDIUM_INT: number; + readonly MIRRORED_REPEAT: number; + readonly NEAREST: number; + readonly NEAREST_MIPMAP_LINEAR: number; + readonly NEAREST_MIPMAP_NEAREST: number; + readonly NEVER: number; + readonly NICEST: number; + readonly NONE: number; + readonly NOTEQUAL: number; + readonly NO_ERROR: number; + readonly ONE: number; + readonly ONE_MINUS_CONSTANT_ALPHA: number; + readonly ONE_MINUS_CONSTANT_COLOR: number; + readonly ONE_MINUS_DST_ALPHA: number; + readonly ONE_MINUS_DST_COLOR: number; + readonly ONE_MINUS_SRC_ALPHA: number; + readonly ONE_MINUS_SRC_COLOR: number; + readonly OUT_OF_MEMORY: number; + readonly PACK_ALIGNMENT: number; + readonly POINTS: number; + readonly POLYGON_OFFSET_FACTOR: number; + readonly POLYGON_OFFSET_FILL: number; + readonly POLYGON_OFFSET_UNITS: number; + readonly RED_BITS: number; + readonly RENDERBUFFER: number; + readonly RENDERBUFFER_ALPHA_SIZE: number; + readonly RENDERBUFFER_BINDING: number; + readonly RENDERBUFFER_BLUE_SIZE: number; + readonly RENDERBUFFER_DEPTH_SIZE: number; + readonly RENDERBUFFER_GREEN_SIZE: number; + readonly RENDERBUFFER_HEIGHT: number; + readonly RENDERBUFFER_INTERNAL_FORMAT: number; + readonly RENDERBUFFER_RED_SIZE: number; + readonly RENDERBUFFER_STENCIL_SIZE: number; + readonly RENDERBUFFER_WIDTH: number; + readonly RENDERER: number; + readonly REPEAT: number; + readonly REPLACE: number; + readonly RGB: number; + readonly RGB565: number; + readonly RGB5_A1: number; + readonly RGBA: number; + readonly RGBA4: number; + readonly SAMPLER_2D: number; + readonly SAMPLER_CUBE: number; + readonly SAMPLES: number; + readonly SAMPLE_ALPHA_TO_COVERAGE: number; + readonly SAMPLE_BUFFERS: number; + readonly SAMPLE_COVERAGE: number; + readonly SAMPLE_COVERAGE_INVERT: number; + readonly SAMPLE_COVERAGE_VALUE: number; + readonly SCISSOR_BOX: number; + readonly SCISSOR_TEST: number; + readonly SHADER_TYPE: number; + readonly SHADING_LANGUAGE_VERSION: number; + readonly SHORT: number; + readonly SRC_ALPHA: number; + readonly SRC_ALPHA_SATURATE: number; + readonly SRC_COLOR: number; + readonly STATIC_DRAW: number; + readonly STENCIL_ATTACHMENT: number; + readonly STENCIL_BACK_FAIL: number; + readonly STENCIL_BACK_FUNC: number; + readonly STENCIL_BACK_PASS_DEPTH_FAIL: number; + readonly STENCIL_BACK_PASS_DEPTH_PASS: number; + readonly STENCIL_BACK_REF: number; + readonly STENCIL_BACK_VALUE_MASK: number; + readonly STENCIL_BACK_WRITEMASK: number; + readonly STENCIL_BITS: number; + readonly STENCIL_BUFFER_BIT: number; + readonly STENCIL_CLEAR_VALUE: number; + readonly STENCIL_FAIL: number; + readonly STENCIL_FUNC: number; + readonly STENCIL_INDEX: number; + readonly STENCIL_INDEX8: number; + readonly STENCIL_PASS_DEPTH_FAIL: number; + readonly STENCIL_PASS_DEPTH_PASS: number; + readonly STENCIL_REF: number; + readonly STENCIL_TEST: number; + readonly STENCIL_VALUE_MASK: number; + readonly STENCIL_WRITEMASK: number; + readonly STREAM_DRAW: number; + readonly SUBPIXEL_BITS: number; + readonly TEXTURE: number; + readonly TEXTURE0: number; + readonly TEXTURE1: number; + readonly TEXTURE10: number; + readonly TEXTURE11: number; + readonly TEXTURE12: number; + readonly TEXTURE13: number; + readonly TEXTURE14: number; + readonly TEXTURE15: number; + readonly TEXTURE16: number; + readonly TEXTURE17: number; + readonly TEXTURE18: number; + readonly TEXTURE19: number; + readonly TEXTURE2: number; + readonly TEXTURE20: number; + readonly TEXTURE21: number; + readonly TEXTURE22: number; + readonly TEXTURE23: number; + readonly TEXTURE24: number; + readonly TEXTURE25: number; + readonly TEXTURE26: number; + readonly TEXTURE27: number; + readonly TEXTURE28: number; + readonly TEXTURE29: number; + readonly TEXTURE3: number; + readonly TEXTURE30: number; + readonly TEXTURE31: number; + readonly TEXTURE4: number; + readonly TEXTURE5: number; + readonly TEXTURE6: number; + readonly TEXTURE7: number; + readonly TEXTURE8: number; + readonly TEXTURE9: number; + readonly TEXTURE_2D: number; + readonly TEXTURE_BINDING_2D: number; + readonly TEXTURE_BINDING_CUBE_MAP: number; + readonly TEXTURE_CUBE_MAP: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_X: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number; + readonly TEXTURE_MAG_FILTER: number; + readonly TEXTURE_MIN_FILTER: number; + readonly TEXTURE_WRAP_S: number; + readonly TEXTURE_WRAP_T: number; + readonly TRIANGLES: number; + readonly TRIANGLE_FAN: number; + readonly TRIANGLE_STRIP: number; + readonly UNPACK_ALIGNMENT: number; + readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + readonly UNPACK_FLIP_Y_WEBGL: number; + readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + readonly UNSIGNED_BYTE: number; + readonly UNSIGNED_INT: number; + readonly UNSIGNED_SHORT: number; + readonly UNSIGNED_SHORT_4_4_4_4: number; + readonly UNSIGNED_SHORT_5_5_5_1: number; + readonly UNSIGNED_SHORT_5_6_5: number; + readonly VALIDATE_STATUS: number; + readonly VENDOR: number; + readonly VERSION: number; + readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + readonly VERTEX_ATTRIB_ARRAY_ENABLED: number; + readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + readonly VERTEX_ATTRIB_ARRAY_POINTER: number; + readonly VERTEX_ATTRIB_ARRAY_SIZE: number; + readonly VERTEX_ATTRIB_ARRAY_STRIDE: number; + readonly VERTEX_ATTRIB_ARRAY_TYPE: number; + readonly VERTEX_SHADER: number; + readonly VIEWPORT: number; + readonly ZERO: number; +} + +declare var WebGLRenderingContext: { + prototype: WebGLRenderingContext; + new(): WebGLRenderingContext; + readonly ACTIVE_ATTRIBUTES: number; + readonly ACTIVE_TEXTURE: number; + readonly ACTIVE_UNIFORMS: number; + readonly ALIASED_LINE_WIDTH_RANGE: number; + readonly ALIASED_POINT_SIZE_RANGE: number; + readonly ALPHA: number; + readonly ALPHA_BITS: number; + readonly ALWAYS: number; + readonly ARRAY_BUFFER: number; + readonly ARRAY_BUFFER_BINDING: number; + readonly ATTACHED_SHADERS: number; + readonly BACK: number; + readonly BLEND: number; + readonly BLEND_COLOR: number; + readonly BLEND_DST_ALPHA: number; + readonly BLEND_DST_RGB: number; + readonly BLEND_EQUATION: number; + readonly BLEND_EQUATION_ALPHA: number; + readonly BLEND_EQUATION_RGB: number; + readonly BLEND_SRC_ALPHA: number; + readonly BLEND_SRC_RGB: number; + readonly BLUE_BITS: number; + readonly BOOL: number; + readonly BOOL_VEC2: number; + readonly BOOL_VEC3: number; + readonly BOOL_VEC4: number; + readonly BROWSER_DEFAULT_WEBGL: number; + readonly BUFFER_SIZE: number; + readonly BUFFER_USAGE: number; + readonly BYTE: number; + readonly CCW: number; + readonly CLAMP_TO_EDGE: number; + readonly COLOR_ATTACHMENT0: number; + readonly COLOR_BUFFER_BIT: number; + readonly COLOR_CLEAR_VALUE: number; + readonly COLOR_WRITEMASK: number; + readonly COMPILE_STATUS: number; + readonly COMPRESSED_TEXTURE_FORMATS: number; + readonly CONSTANT_ALPHA: number; + readonly CONSTANT_COLOR: number; + readonly CONTEXT_LOST_WEBGL: number; + readonly CULL_FACE: number; + readonly CULL_FACE_MODE: number; + readonly CURRENT_PROGRAM: number; + readonly CURRENT_VERTEX_ATTRIB: number; + readonly CW: number; + readonly DECR: number; + readonly DECR_WRAP: number; + readonly DELETE_STATUS: number; + readonly DEPTH_ATTACHMENT: number; + readonly DEPTH_BITS: number; + readonly DEPTH_BUFFER_BIT: number; + readonly DEPTH_CLEAR_VALUE: number; + readonly DEPTH_COMPONENT: number; + readonly DEPTH_COMPONENT16: number; + readonly DEPTH_FUNC: number; + readonly DEPTH_RANGE: number; + readonly DEPTH_STENCIL: number; + readonly DEPTH_STENCIL_ATTACHMENT: number; + readonly DEPTH_TEST: number; + readonly DEPTH_WRITEMASK: number; + readonly DITHER: number; + readonly DONT_CARE: number; + readonly DST_ALPHA: number; + readonly DST_COLOR: number; + readonly DYNAMIC_DRAW: number; + readonly ELEMENT_ARRAY_BUFFER: number; + readonly ELEMENT_ARRAY_BUFFER_BINDING: number; + readonly EQUAL: number; + readonly FASTEST: number; + readonly FLOAT: number; + readonly FLOAT_MAT2: number; + readonly FLOAT_MAT3: number; + readonly FLOAT_MAT4: number; + readonly FLOAT_VEC2: number; + readonly FLOAT_VEC3: number; + readonly FLOAT_VEC4: number; + readonly FRAGMENT_SHADER: number; + readonly FRAMEBUFFER: number; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + readonly FRAMEBUFFER_BINDING: number; + readonly FRAMEBUFFER_COMPLETE: number; + readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + readonly FRAMEBUFFER_UNSUPPORTED: number; + readonly FRONT: number; + readonly FRONT_AND_BACK: number; + readonly FRONT_FACE: number; + readonly FUNC_ADD: number; + readonly FUNC_REVERSE_SUBTRACT: number; + readonly FUNC_SUBTRACT: number; + readonly GENERATE_MIPMAP_HINT: number; + readonly GEQUAL: number; + readonly GREATER: number; + readonly GREEN_BITS: number; + readonly HIGH_FLOAT: number; + readonly HIGH_INT: number; + readonly IMPLEMENTATION_COLOR_READ_FORMAT: number; + readonly IMPLEMENTATION_COLOR_READ_TYPE: number; + readonly INCR: number; + readonly INCR_WRAP: number; + readonly INT: number; + readonly INT_VEC2: number; + readonly INT_VEC3: number; + readonly INT_VEC4: number; + readonly INVALID_ENUM: number; + readonly INVALID_FRAMEBUFFER_OPERATION: number; + readonly INVALID_OPERATION: number; + readonly INVALID_VALUE: number; + readonly INVERT: number; + readonly KEEP: number; + readonly LEQUAL: number; + readonly LESS: number; + readonly LINEAR: number; + readonly LINEAR_MIPMAP_LINEAR: number; + readonly LINEAR_MIPMAP_NEAREST: number; + readonly LINES: number; + readonly LINE_LOOP: number; + readonly LINE_STRIP: number; + readonly LINE_WIDTH: number; + readonly LINK_STATUS: number; + readonly LOW_FLOAT: number; + readonly LOW_INT: number; + readonly LUMINANCE: number; + readonly LUMINANCE_ALPHA: number; + readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + readonly MAX_CUBE_MAP_TEXTURE_SIZE: number; + readonly MAX_FRAGMENT_UNIFORM_VECTORS: number; + readonly MAX_RENDERBUFFER_SIZE: number; + readonly MAX_TEXTURE_IMAGE_UNITS: number; + readonly MAX_TEXTURE_SIZE: number; + readonly MAX_VARYING_VECTORS: number; + readonly MAX_VERTEX_ATTRIBS: number; + readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + readonly MAX_VERTEX_UNIFORM_VECTORS: number; + readonly MAX_VIEWPORT_DIMS: number; + readonly MEDIUM_FLOAT: number; + readonly MEDIUM_INT: number; + readonly MIRRORED_REPEAT: number; + readonly NEAREST: number; + readonly NEAREST_MIPMAP_LINEAR: number; + readonly NEAREST_MIPMAP_NEAREST: number; + readonly NEVER: number; + readonly NICEST: number; + readonly NONE: number; + readonly NOTEQUAL: number; + readonly NO_ERROR: number; + readonly ONE: number; + readonly ONE_MINUS_CONSTANT_ALPHA: number; + readonly ONE_MINUS_CONSTANT_COLOR: number; + readonly ONE_MINUS_DST_ALPHA: number; + readonly ONE_MINUS_DST_COLOR: number; + readonly ONE_MINUS_SRC_ALPHA: number; + readonly ONE_MINUS_SRC_COLOR: number; + readonly OUT_OF_MEMORY: number; + readonly PACK_ALIGNMENT: number; + readonly POINTS: number; + readonly POLYGON_OFFSET_FACTOR: number; + readonly POLYGON_OFFSET_FILL: number; + readonly POLYGON_OFFSET_UNITS: number; + readonly RED_BITS: number; + readonly RENDERBUFFER: number; + readonly RENDERBUFFER_ALPHA_SIZE: number; + readonly RENDERBUFFER_BINDING: number; + readonly RENDERBUFFER_BLUE_SIZE: number; + readonly RENDERBUFFER_DEPTH_SIZE: number; + readonly RENDERBUFFER_GREEN_SIZE: number; + readonly RENDERBUFFER_HEIGHT: number; + readonly RENDERBUFFER_INTERNAL_FORMAT: number; + readonly RENDERBUFFER_RED_SIZE: number; + readonly RENDERBUFFER_STENCIL_SIZE: number; + readonly RENDERBUFFER_WIDTH: number; + readonly RENDERER: number; + readonly REPEAT: number; + readonly REPLACE: number; + readonly RGB: number; + readonly RGB565: number; + readonly RGB5_A1: number; + readonly RGBA: number; + readonly RGBA4: number; + readonly SAMPLER_2D: number; + readonly SAMPLER_CUBE: number; + readonly SAMPLES: number; + readonly SAMPLE_ALPHA_TO_COVERAGE: number; + readonly SAMPLE_BUFFERS: number; + readonly SAMPLE_COVERAGE: number; + readonly SAMPLE_COVERAGE_INVERT: number; + readonly SAMPLE_COVERAGE_VALUE: number; + readonly SCISSOR_BOX: number; + readonly SCISSOR_TEST: number; + readonly SHADER_TYPE: number; + readonly SHADING_LANGUAGE_VERSION: number; + readonly SHORT: number; + readonly SRC_ALPHA: number; + readonly SRC_ALPHA_SATURATE: number; + readonly SRC_COLOR: number; + readonly STATIC_DRAW: number; + readonly STENCIL_ATTACHMENT: number; + readonly STENCIL_BACK_FAIL: number; + readonly STENCIL_BACK_FUNC: number; + readonly STENCIL_BACK_PASS_DEPTH_FAIL: number; + readonly STENCIL_BACK_PASS_DEPTH_PASS: number; + readonly STENCIL_BACK_REF: number; + readonly STENCIL_BACK_VALUE_MASK: number; + readonly STENCIL_BACK_WRITEMASK: number; + readonly STENCIL_BITS: number; + readonly STENCIL_BUFFER_BIT: number; + readonly STENCIL_CLEAR_VALUE: number; + readonly STENCIL_FAIL: number; + readonly STENCIL_FUNC: number; + readonly STENCIL_INDEX: number; + readonly STENCIL_INDEX8: number; + readonly STENCIL_PASS_DEPTH_FAIL: number; + readonly STENCIL_PASS_DEPTH_PASS: number; + readonly STENCIL_REF: number; + readonly STENCIL_TEST: number; + readonly STENCIL_VALUE_MASK: number; + readonly STENCIL_WRITEMASK: number; + readonly STREAM_DRAW: number; + readonly SUBPIXEL_BITS: number; + readonly TEXTURE: number; + readonly TEXTURE0: number; + readonly TEXTURE1: number; + readonly TEXTURE10: number; + readonly TEXTURE11: number; + readonly TEXTURE12: number; + readonly TEXTURE13: number; + readonly TEXTURE14: number; + readonly TEXTURE15: number; + readonly TEXTURE16: number; + readonly TEXTURE17: number; + readonly TEXTURE18: number; + readonly TEXTURE19: number; + readonly TEXTURE2: number; + readonly TEXTURE20: number; + readonly TEXTURE21: number; + readonly TEXTURE22: number; + readonly TEXTURE23: number; + readonly TEXTURE24: number; + readonly TEXTURE25: number; + readonly TEXTURE26: number; + readonly TEXTURE27: number; + readonly TEXTURE28: number; + readonly TEXTURE29: number; + readonly TEXTURE3: number; + readonly TEXTURE30: number; + readonly TEXTURE31: number; + readonly TEXTURE4: number; + readonly TEXTURE5: number; + readonly TEXTURE6: number; + readonly TEXTURE7: number; + readonly TEXTURE8: number; + readonly TEXTURE9: number; + readonly TEXTURE_2D: number; + readonly TEXTURE_BINDING_2D: number; + readonly TEXTURE_BINDING_CUBE_MAP: number; + readonly TEXTURE_CUBE_MAP: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_X: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number; + readonly TEXTURE_MAG_FILTER: number; + readonly TEXTURE_MIN_FILTER: number; + readonly TEXTURE_WRAP_S: number; + readonly TEXTURE_WRAP_T: number; + readonly TRIANGLES: number; + readonly TRIANGLE_FAN: number; + readonly TRIANGLE_STRIP: number; + readonly UNPACK_ALIGNMENT: number; + readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + readonly UNPACK_FLIP_Y_WEBGL: number; + readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + readonly UNSIGNED_BYTE: number; + readonly UNSIGNED_INT: number; + readonly UNSIGNED_SHORT: number; + readonly UNSIGNED_SHORT_4_4_4_4: number; + readonly UNSIGNED_SHORT_5_5_5_1: number; + readonly UNSIGNED_SHORT_5_6_5: number; + readonly VALIDATE_STATUS: number; + readonly VENDOR: number; + readonly VERSION: number; + readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + readonly VERTEX_ATTRIB_ARRAY_ENABLED: number; + readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + readonly VERTEX_ATTRIB_ARRAY_POINTER: number; + readonly VERTEX_ATTRIB_ARRAY_SIZE: number; + readonly VERTEX_ATTRIB_ARRAY_STRIDE: number; + readonly VERTEX_ATTRIB_ARRAY_TYPE: number; + readonly VERTEX_SHADER: number; + readonly VIEWPORT: number; + readonly ZERO: number; +} + +interface WebGLShader extends WebGLObject { +} + +declare var WebGLShader: { + prototype: WebGLShader; + new(): WebGLShader; +} + +interface WebGLShaderPrecisionFormat { + readonly precision: number; + readonly rangeMax: number; + readonly rangeMin: number; +} + +declare var WebGLShaderPrecisionFormat: { + prototype: WebGLShaderPrecisionFormat; + new(): WebGLShaderPrecisionFormat; +} + +interface WebGLTexture extends WebGLObject { +} + +declare var WebGLTexture: { + prototype: WebGLTexture; + new(): WebGLTexture; +} + +interface WebGLUniformLocation { +} + +declare var WebGLUniformLocation: { + prototype: WebGLUniformLocation; + new(): WebGLUniformLocation; +} + +interface WebKitCSSMatrix { + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + m11: number; + m12: number; + m13: number; + m14: number; + m21: number; + m22: number; + m23: number; + m24: number; + m31: number; + m32: number; + m33: number; + m34: number; + m41: number; + m42: number; + m43: number; + m44: number; + inverse(): WebKitCSSMatrix; + multiply(secondMatrix: WebKitCSSMatrix): WebKitCSSMatrix; + rotate(angleX: number, angleY?: number, angleZ?: number): WebKitCSSMatrix; + rotateAxisAngle(x: number, y: number, z: number, angle: number): WebKitCSSMatrix; + scale(scaleX: number, scaleY?: number, scaleZ?: number): WebKitCSSMatrix; + setMatrixValue(value: string): void; + skewX(angle: number): WebKitCSSMatrix; + skewY(angle: number): WebKitCSSMatrix; + toString(): string; + translate(x: number, y: number, z?: number): WebKitCSSMatrix; +} + +declare var WebKitCSSMatrix: { + prototype: WebKitCSSMatrix; + new(text?: string): WebKitCSSMatrix; +} + +interface WebKitDirectoryEntry extends WebKitEntry { + createReader(): WebKitDirectoryReader; +} + +declare var WebKitDirectoryEntry: { + prototype: WebKitDirectoryEntry; + new(): WebKitDirectoryEntry; +} + +interface WebKitDirectoryReader { + readEntries(successCallback: WebKitEntriesCallback, errorCallback?: WebKitErrorCallback): void; +} + +declare var WebKitDirectoryReader: { + prototype: WebKitDirectoryReader; + new(): WebKitDirectoryReader; +} + +interface WebKitEntry { + readonly filesystem: WebKitFileSystem; + readonly fullPath: string; + readonly isDirectory: boolean; + readonly isFile: boolean; + readonly name: string; +} + +declare var WebKitEntry: { + prototype: WebKitEntry; + new(): WebKitEntry; +} + +interface WebKitFileEntry extends WebKitEntry { + file(successCallback: WebKitFileCallback, errorCallback?: WebKitErrorCallback): void; +} + +declare var WebKitFileEntry: { + prototype: WebKitFileEntry; + new(): WebKitFileEntry; +} + +interface WebKitFileSystem { + readonly name: string; + readonly root: WebKitDirectoryEntry; +} + +declare var WebKitFileSystem: { + prototype: WebKitFileSystem; + new(): WebKitFileSystem; +} + +interface WebKitPoint { + x: number; + y: number; +} + +declare var WebKitPoint: { + prototype: WebKitPoint; + new(x?: number, y?: number): WebKitPoint; +} + +interface WebSocketEventMap { + "close": CloseEvent; + "error": Event; + "message": MessageEvent; + "open": Event; +} + +interface WebSocket extends EventTarget { + binaryType: string; + readonly bufferedAmount: number; + readonly extensions: string; + onclose: (this: WebSocket, ev: CloseEvent) => any; + onerror: (this: WebSocket, ev: Event) => any; + onmessage: (this: WebSocket, ev: MessageEvent) => any; + onopen: (this: WebSocket, ev: Event) => any; + readonly protocol: string; + readonly readyState: number; + readonly url: string; + close(code?: number, reason?: string): void; + send(data: any): void; + readonly CLOSED: number; + readonly CLOSING: number; + readonly CONNECTING: number; + readonly OPEN: number; + addEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var WebSocket: { + prototype: WebSocket; + new(url: string, protocols?: string | string[]): WebSocket; + readonly CLOSED: number; + readonly CLOSING: number; + readonly CONNECTING: number; + readonly OPEN: number; +} + +interface WheelEvent extends MouseEvent { + readonly deltaMode: number; + readonly deltaX: number; + readonly deltaY: number; + readonly deltaZ: number; + readonly wheelDelta: number; + readonly wheelDeltaX: number; + readonly wheelDeltaY: number; + getCurrentPoint(element: Element): void; + initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; + readonly DOM_DELTA_LINE: number; + readonly DOM_DELTA_PAGE: number; + readonly DOM_DELTA_PIXEL: number; +} + +declare var WheelEvent: { + prototype: WheelEvent; + new(typeArg: string, eventInitDict?: WheelEventInit): WheelEvent; + readonly DOM_DELTA_LINE: number; + readonly DOM_DELTA_PAGE: number; + readonly DOM_DELTA_PIXEL: number; +} + +interface WindowEventMap extends GlobalEventHandlersEventMap { + "abort": UIEvent; + "afterprint": Event; + "beforeprint": Event; + "beforeunload": BeforeUnloadEvent; + "blur": FocusEvent; + "canplay": Event; + "canplaythrough": Event; + "change": Event; + "click": MouseEvent; + "compassneedscalibration": Event; + "contextmenu": PointerEvent; + "dblclick": MouseEvent; + "devicelight": DeviceLightEvent; + "devicemotion": DeviceMotionEvent; + "deviceorientation": DeviceOrientationEvent; + "drag": DragEvent; + "dragend": DragEvent; + "dragenter": DragEvent; + "dragleave": DragEvent; + "dragover": DragEvent; + "dragstart": DragEvent; + "drop": DragEvent; + "durationchange": Event; + "emptied": Event; + "ended": MediaStreamErrorEvent; + "focus": FocusEvent; + "hashchange": HashChangeEvent; + "input": Event; + "invalid": Event; + "keydown": KeyboardEvent; + "keypress": KeyboardEvent; + "keyup": KeyboardEvent; + "load": Event; + "loadeddata": Event; + "loadedmetadata": Event; + "loadstart": Event; + "message": MessageEvent; + "mousedown": MouseEvent; + "mouseenter": MouseEvent; + "mouseleave": MouseEvent; + "mousemove": MouseEvent; + "mouseout": MouseEvent; + "mouseover": MouseEvent; + "mouseup": MouseEvent; + "mousewheel": WheelEvent; + "MSGestureChange": MSGestureEvent; + "MSGestureDoubleTap": MSGestureEvent; + "MSGestureEnd": MSGestureEvent; + "MSGestureHold": MSGestureEvent; + "MSGestureStart": MSGestureEvent; + "MSGestureTap": MSGestureEvent; + "MSInertiaStart": MSGestureEvent; + "MSPointerCancel": MSPointerEvent; + "MSPointerDown": MSPointerEvent; + "MSPointerEnter": MSPointerEvent; + "MSPointerLeave": MSPointerEvent; + "MSPointerMove": MSPointerEvent; + "MSPointerOut": MSPointerEvent; + "MSPointerOver": MSPointerEvent; + "MSPointerUp": MSPointerEvent; + "offline": Event; + "online": Event; + "orientationchange": Event; + "pagehide": PageTransitionEvent; + "pageshow": PageTransitionEvent; + "pause": Event; + "play": Event; + "playing": Event; + "popstate": PopStateEvent; + "progress": ProgressEvent; + "ratechange": Event; + "readystatechange": ProgressEvent; + "reset": Event; + "resize": UIEvent; + "scroll": UIEvent; + "seeked": Event; + "seeking": Event; + "select": UIEvent; + "stalled": Event; + "storage": StorageEvent; + "submit": Event; + "suspend": Event; + "timeupdate": Event; + "unload": Event; + "volumechange": Event; + "waiting": Event; +} + +interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64, GlobalFetch { + readonly applicationCache: ApplicationCache; + readonly caches: CacheStorage; + readonly clientInformation: Navigator; + readonly closed: boolean; + readonly crypto: Crypto; + defaultStatus: string; + readonly devicePixelRatio: number; + readonly doNotTrack: string; + readonly document: Document; + event: Event | undefined; + readonly external: External; + readonly frameElement: Element; + readonly frames: Window; + readonly history: History; + readonly innerHeight: number; + readonly innerWidth: number; + readonly isSecureContext: boolean; + readonly length: number; + readonly location: Location; + readonly locationbar: BarProp; + readonly menubar: BarProp; + readonly msContentScript: ExtensionScriptApis; + readonly msCredentials: MSCredentials; + name: string; + readonly navigator: Navigator; + offscreenBuffering: string | boolean; + onabort: (this: Window, ev: UIEvent) => any; + onafterprint: (this: Window, ev: Event) => any; + onbeforeprint: (this: Window, ev: Event) => any; + onbeforeunload: (this: Window, ev: BeforeUnloadEvent) => any; + onblur: (this: Window, ev: FocusEvent) => any; + oncanplay: (this: Window, ev: Event) => any; + oncanplaythrough: (this: Window, ev: Event) => any; + onchange: (this: Window, ev: Event) => any; + onclick: (this: Window, ev: MouseEvent) => any; + oncompassneedscalibration: (this: Window, ev: Event) => any; + oncontextmenu: (this: Window, ev: PointerEvent) => any; + ondblclick: (this: Window, ev: MouseEvent) => any; + ondevicelight: (this: Window, ev: DeviceLightEvent) => any; + ondevicemotion: (this: Window, ev: DeviceMotionEvent) => any; + ondeviceorientation: (this: Window, ev: DeviceOrientationEvent) => any; + ondrag: (this: Window, ev: DragEvent) => any; + ondragend: (this: Window, ev: DragEvent) => any; + ondragenter: (this: Window, ev: DragEvent) => any; + ondragleave: (this: Window, ev: DragEvent) => any; + ondragover: (this: Window, ev: DragEvent) => any; + ondragstart: (this: Window, ev: DragEvent) => any; + ondrop: (this: Window, ev: DragEvent) => any; + ondurationchange: (this: Window, ev: Event) => any; + onemptied: (this: Window, ev: Event) => any; + onended: (this: Window, ev: MediaStreamErrorEvent) => any; + onerror: ErrorEventHandler; + onfocus: (this: Window, ev: FocusEvent) => any; + onhashchange: (this: Window, ev: HashChangeEvent) => any; + oninput: (this: Window, ev: Event) => any; + oninvalid: (this: Window, ev: Event) => any; + onkeydown: (this: Window, ev: KeyboardEvent) => any; + onkeypress: (this: Window, ev: KeyboardEvent) => any; + onkeyup: (this: Window, ev: KeyboardEvent) => any; + onload: (this: Window, ev: Event) => any; + onloadeddata: (this: Window, ev: Event) => any; + onloadedmetadata: (this: Window, ev: Event) => any; + onloadstart: (this: Window, ev: Event) => any; + onmessage: (this: Window, ev: MessageEvent) => any; + onmousedown: (this: Window, ev: MouseEvent) => any; + onmouseenter: (this: Window, ev: MouseEvent) => any; + onmouseleave: (this: Window, ev: MouseEvent) => any; + onmousemove: (this: Window, ev: MouseEvent) => any; + onmouseout: (this: Window, ev: MouseEvent) => any; + onmouseover: (this: Window, ev: MouseEvent) => any; + onmouseup: (this: Window, ev: MouseEvent) => any; + onmousewheel: (this: Window, ev: WheelEvent) => any; + onmsgesturechange: (this: Window, ev: MSGestureEvent) => any; + onmsgesturedoubletap: (this: Window, ev: MSGestureEvent) => any; + onmsgestureend: (this: Window, ev: MSGestureEvent) => any; + onmsgesturehold: (this: Window, ev: MSGestureEvent) => any; + onmsgesturestart: (this: Window, ev: MSGestureEvent) => any; + onmsgesturetap: (this: Window, ev: MSGestureEvent) => any; + onmsinertiastart: (this: Window, ev: MSGestureEvent) => any; + onmspointercancel: (this: Window, ev: MSPointerEvent) => any; + onmspointerdown: (this: Window, ev: MSPointerEvent) => any; + onmspointerenter: (this: Window, ev: MSPointerEvent) => any; + onmspointerleave: (this: Window, ev: MSPointerEvent) => any; + onmspointermove: (this: Window, ev: MSPointerEvent) => any; + onmspointerout: (this: Window, ev: MSPointerEvent) => any; + onmspointerover: (this: Window, ev: MSPointerEvent) => any; + onmspointerup: (this: Window, ev: MSPointerEvent) => any; + onoffline: (this: Window, ev: Event) => any; + ononline: (this: Window, ev: Event) => any; + onorientationchange: (this: Window, ev: Event) => any; + onpagehide: (this: Window, ev: PageTransitionEvent) => any; + onpageshow: (this: Window, ev: PageTransitionEvent) => any; + onpause: (this: Window, ev: Event) => any; + onplay: (this: Window, ev: Event) => any; + onplaying: (this: Window, ev: Event) => any; + onpopstate: (this: Window, ev: PopStateEvent) => any; + onprogress: (this: Window, ev: ProgressEvent) => any; + onratechange: (this: Window, ev: Event) => any; + onreadystatechange: (this: Window, ev: ProgressEvent) => any; + onreset: (this: Window, ev: Event) => any; + onresize: (this: Window, ev: UIEvent) => any; + onscroll: (this: Window, ev: UIEvent) => any; + onseeked: (this: Window, ev: Event) => any; + onseeking: (this: Window, ev: Event) => any; + onselect: (this: Window, ev: UIEvent) => any; + onstalled: (this: Window, ev: Event) => any; + onstorage: (this: Window, ev: StorageEvent) => any; + onsubmit: (this: Window, ev: Event) => any; + onsuspend: (this: Window, ev: Event) => any; + ontimeupdate: (this: Window, ev: Event) => any; + ontouchcancel: (ev: TouchEvent) => any; + ontouchend: (ev: TouchEvent) => any; + ontouchmove: (ev: TouchEvent) => any; + ontouchstart: (ev: TouchEvent) => any; + onunload: (this: Window, ev: Event) => any; + onvolumechange: (this: Window, ev: Event) => any; + onwaiting: (this: Window, ev: Event) => any; + opener: any; + orientation: string | number; + readonly outerHeight: number; + readonly outerWidth: number; + readonly pageXOffset: number; + readonly pageYOffset: number; + readonly parent: Window; + readonly performance: Performance; + readonly personalbar: BarProp; + readonly screen: Screen; + readonly screenLeft: number; + readonly screenTop: number; + readonly screenX: number; + readonly screenY: number; + readonly scrollX: number; + readonly scrollY: number; + readonly scrollbars: BarProp; + readonly self: Window; + readonly speechSynthesis: SpeechSynthesis; + status: string; + readonly statusbar: BarProp; + readonly styleMedia: StyleMedia; + readonly toolbar: BarProp; + readonly top: Window; + readonly window: Window; + URL: typeof URL; + URLSearchParams: typeof URLSearchParams; + Blob: typeof Blob; + customElements: CustomElementRegistry; + alert(message?: any): void; + blur(): void; + cancelAnimationFrame(handle: number): void; + captureEvents(): void; + close(): void; + confirm(message?: string): boolean; + departFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void; + focus(): void; + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; + getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; + getSelection(): Selection; + matchMedia(mediaQuery: string): MediaQueryList; + moveBy(x?: number, y?: number): void; + moveTo(x?: number, y?: number): void; + msWriteProfilerMark(profilerMarkName: string): void; + open(url?: string, target?: string, features?: string, replace?: boolean): Window; + postMessage(message: any, targetOrigin: string, transfer?: any[]): void; + print(): void; + prompt(message?: string, _default?: string): string | null; + releaseEvents(): void; + requestAnimationFrame(callback: FrameRequestCallback): number; + resizeBy(x?: number, y?: number): void; + resizeTo(x?: number, y?: number): void; + scroll(x?: number, y?: number): void; + scrollBy(x?: number, y?: number): void; + scrollTo(x?: number, y?: number): void; + stop(): void; + webkitCancelAnimationFrame(handle: number): void; + webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; + webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; + webkitRequestAnimationFrame(callback: FrameRequestCallback): number; + createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise; + createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise; + scroll(options?: ScrollToOptions): void; + scrollTo(options?: ScrollToOptions): void; + scrollBy(options?: ScrollToOptions): void; + addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Window: { + prototype: Window; + new(): Window; +} + +interface WorkerEventMap extends AbstractWorkerEventMap { + "message": MessageEvent; +} + +interface Worker extends EventTarget, AbstractWorker { + onmessage: (this: Worker, ev: MessageEvent) => any; + postMessage(message: any, transfer?: any[]): void; + terminate(): void; + addEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Worker: { + prototype: Worker; + new(stringUrl: string): Worker; +} + +interface XMLDocument extends Document { + addEventListener(type: K, listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var XMLDocument: { + prototype: XMLDocument; + new(): XMLDocument; +} + +interface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap { + "readystatechange": Event; +} + +interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { + onreadystatechange: (this: XMLHttpRequest, ev: Event) => any; + readonly readyState: number; + readonly response: any; + readonly responseText: string; + responseType: XMLHttpRequestResponseType; + readonly responseURL: string; + readonly responseXML: Document | null; + readonly status: number; + readonly statusText: string; + timeout: number; + readonly upload: XMLHttpRequestUpload; + withCredentials: boolean; + msCaching?: string; + abort(): void; + getAllResponseHeaders(): string; + getResponseHeader(header: string): string | null; + msCachingEnabled(): boolean; + open(method: string, url: string, async?: boolean, user?: string, password?: string): void; + overrideMimeType(mime: string): void; + send(data?: Document): void; + send(data?: string): void; + send(data?: any): void; + setRequestHeader(header: string, value: string): void; + readonly DONE: number; + readonly HEADERS_RECEIVED: number; + readonly LOADING: number; + readonly OPENED: number; + readonly UNSENT: number; + addEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var XMLHttpRequest: { + prototype: XMLHttpRequest; + new(): XMLHttpRequest; + readonly DONE: number; + readonly HEADERS_RECEIVED: number; + readonly LOADING: number; + readonly OPENED: number; + readonly UNSENT: number; +} + +interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget { + addEventListener(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var XMLHttpRequestUpload: { + prototype: XMLHttpRequestUpload; + new(): XMLHttpRequestUpload; +} + +interface XMLSerializer { + serializeToString(target: Node): string; +} + +declare var XMLSerializer: { + prototype: XMLSerializer; + new(): XMLSerializer; +} + +interface XPathEvaluator { + createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; + createNSResolver(nodeResolver?: Node): XPathNSResolver; + evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult; +} + +declare var XPathEvaluator: { + prototype: XPathEvaluator; + new(): XPathEvaluator; +} + +interface XPathExpression { + evaluate(contextNode: Node, type: number, result: XPathResult | null): XPathResult; +} + +declare var XPathExpression: { + prototype: XPathExpression; + new(): XPathExpression; +} + +interface XPathNSResolver { + lookupNamespaceURI(prefix: string): string; +} + +declare var XPathNSResolver: { + prototype: XPathNSResolver; + new(): XPathNSResolver; +} + +interface XPathResult { + readonly booleanValue: boolean; + readonly invalidIteratorState: boolean; + readonly numberValue: number; + readonly resultType: number; + readonly singleNodeValue: Node; + readonly snapshotLength: number; + readonly stringValue: string; + iterateNext(): Node; + snapshotItem(index: number): Node; + readonly ANY_TYPE: number; + readonly ANY_UNORDERED_NODE_TYPE: number; + readonly BOOLEAN_TYPE: number; + readonly FIRST_ORDERED_NODE_TYPE: number; + readonly NUMBER_TYPE: number; + readonly ORDERED_NODE_ITERATOR_TYPE: number; + readonly ORDERED_NODE_SNAPSHOT_TYPE: number; + readonly STRING_TYPE: number; + readonly UNORDERED_NODE_ITERATOR_TYPE: number; + readonly UNORDERED_NODE_SNAPSHOT_TYPE: number; +} + +declare var XPathResult: { + prototype: XPathResult; + new(): XPathResult; + readonly ANY_TYPE: number; + readonly ANY_UNORDERED_NODE_TYPE: number; + readonly BOOLEAN_TYPE: number; + readonly FIRST_ORDERED_NODE_TYPE: number; + readonly NUMBER_TYPE: number; + readonly ORDERED_NODE_ITERATOR_TYPE: number; + readonly ORDERED_NODE_SNAPSHOT_TYPE: number; + readonly STRING_TYPE: number; + readonly UNORDERED_NODE_ITERATOR_TYPE: number; + readonly UNORDERED_NODE_SNAPSHOT_TYPE: number; +} + +interface XSLTProcessor { + clearParameters(): void; + getParameter(namespaceURI: string, localName: string): any; + importStylesheet(style: Node): void; + removeParameter(namespaceURI: string, localName: string): void; + reset(): void; + setParameter(namespaceURI: string, localName: string, value: any): void; + transformToDocument(source: Node): Document; + transformToFragment(source: Node, document: Document): DocumentFragment; +} + +declare var XSLTProcessor: { + prototype: XSLTProcessor; + new(): XSLTProcessor; +} + +interface webkitRTCPeerConnection extends RTCPeerConnection { + addEventListener(type: K, listener: (this: webkitRTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var webkitRTCPeerConnection: { + prototype: webkitRTCPeerConnection; + new(configuration: RTCConfiguration): webkitRTCPeerConnection; +} + +interface AbstractWorkerEventMap { + "error": ErrorEvent; +} + +interface AbstractWorker { + onerror: (this: AbstractWorker, ev: ErrorEvent) => any; + addEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface Body { + readonly bodyUsed: boolean; + arrayBuffer(): Promise; + blob(): Promise; + json(): Promise; + text(): Promise; + formData(): Promise; +} + +interface CanvasPathMethods { + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + closePath(): void; + ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + lineTo(x: number, y: number): void; + moveTo(x: number, y: number): void; + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + rect(x: number, y: number, w: number, h: number): void; +} + +interface ChildNode { + remove(): void; +} + +interface DOML2DeprecatedColorProperty { + color: string; +} + +interface DOML2DeprecatedSizeProperty { + size: number; +} + +interface DocumentEvent { + createEvent(eventInterface:"AnimationEvent"): AnimationEvent; + createEvent(eventInterface:"AudioProcessingEvent"): AudioProcessingEvent; + createEvent(eventInterface:"BeforeUnloadEvent"): BeforeUnloadEvent; + createEvent(eventInterface:"ClipboardEvent"): ClipboardEvent; + createEvent(eventInterface:"CloseEvent"): CloseEvent; + createEvent(eventInterface:"CompositionEvent"): CompositionEvent; + createEvent(eventInterface:"CustomEvent"): CustomEvent; + createEvent(eventInterface:"DeviceLightEvent"): DeviceLightEvent; + createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent; + createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent; + createEvent(eventInterface:"DragEvent"): DragEvent; + createEvent(eventInterface:"ErrorEvent"): ErrorEvent; + createEvent(eventInterface:"Event"): Event; + createEvent(eventInterface:"Events"): Event; + createEvent(eventInterface:"FocusEvent"): FocusEvent; + createEvent(eventInterface:"FocusNavigationEvent"): FocusNavigationEvent; + createEvent(eventInterface:"GamepadEvent"): GamepadEvent; + createEvent(eventInterface:"HashChangeEvent"): HashChangeEvent; + createEvent(eventInterface:"IDBVersionChangeEvent"): IDBVersionChangeEvent; + createEvent(eventInterface:"KeyboardEvent"): KeyboardEvent; + createEvent(eventInterface:"ListeningStateChangedEvent"): ListeningStateChangedEvent; + createEvent(eventInterface:"LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent; + createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; + createEvent(eventInterface:"MSManipulationEvent"): MSManipulationEvent; + createEvent(eventInterface:"MSMediaKeyMessageEvent"): MSMediaKeyMessageEvent; + createEvent(eventInterface:"MSMediaKeyNeededEvent"): MSMediaKeyNeededEvent; + createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; + createEvent(eventInterface:"MSSiteModeEvent"): MSSiteModeEvent; + createEvent(eventInterface:"MediaEncryptedEvent"): MediaEncryptedEvent; + createEvent(eventInterface:"MediaKeyMessageEvent"): MediaKeyMessageEvent; + createEvent(eventInterface:"MediaStreamErrorEvent"): MediaStreamErrorEvent; + createEvent(eventInterface:"MediaStreamEvent"): MediaStreamEvent; + createEvent(eventInterface:"MediaStreamTrackEvent"): MediaStreamTrackEvent; + createEvent(eventInterface:"MessageEvent"): MessageEvent; + createEvent(eventInterface:"MouseEvent"): MouseEvent; + createEvent(eventInterface:"MouseEvents"): MouseEvent; + createEvent(eventInterface:"MutationEvent"): MutationEvent; + createEvent(eventInterface:"MutationEvents"): MutationEvent; + createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent; + createEvent(eventInterface:"NavigationEvent"): NavigationEvent; + createEvent(eventInterface:"NavigationEventWithReferrer"): NavigationEventWithReferrer; + createEvent(eventInterface:"OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; + createEvent(eventInterface:"OverflowEvent"): OverflowEvent; + createEvent(eventInterface:"PageTransitionEvent"): PageTransitionEvent; + createEvent(eventInterface:"PaymentRequestUpdateEvent"): PaymentRequestUpdateEvent; + createEvent(eventInterface:"PermissionRequestedEvent"): PermissionRequestedEvent; + createEvent(eventInterface:"PointerEvent"): PointerEvent; + createEvent(eventInterface:"PopStateEvent"): PopStateEvent; + createEvent(eventInterface:"ProgressEvent"): ProgressEvent; + createEvent(eventInterface:"RTCDTMFToneChangeEvent"): RTCDTMFToneChangeEvent; + createEvent(eventInterface:"RTCDtlsTransportStateChangedEvent"): RTCDtlsTransportStateChangedEvent; + createEvent(eventInterface:"RTCIceCandidatePairChangedEvent"): RTCIceCandidatePairChangedEvent; + createEvent(eventInterface:"RTCIceGathererEvent"): RTCIceGathererEvent; + createEvent(eventInterface:"RTCIceTransportStateChangedEvent"): RTCIceTransportStateChangedEvent; + createEvent(eventInterface:"RTCPeerConnectionIceEvent"): RTCPeerConnectionIceEvent; + createEvent(eventInterface:"RTCSsrcConflictEvent"): RTCSsrcConflictEvent; + createEvent(eventInterface:"SVGZoomEvent"): SVGZoomEvent; + createEvent(eventInterface:"SVGZoomEvents"): SVGZoomEvent; + createEvent(eventInterface:"ScriptNotifyEvent"): ScriptNotifyEvent; + createEvent(eventInterface:"ServiceWorkerMessageEvent"): ServiceWorkerMessageEvent; + createEvent(eventInterface:"SpeechSynthesisEvent"): SpeechSynthesisEvent; + createEvent(eventInterface:"StorageEvent"): StorageEvent; + createEvent(eventInterface:"TextEvent"): TextEvent; + createEvent(eventInterface:"TouchEvent"): TouchEvent; + createEvent(eventInterface:"TrackEvent"): TrackEvent; + createEvent(eventInterface:"TransitionEvent"): TransitionEvent; + createEvent(eventInterface:"UIEvent"): UIEvent; + createEvent(eventInterface:"UIEvents"): UIEvent; + createEvent(eventInterface:"UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; + createEvent(eventInterface:"WebGLContextEvent"): WebGLContextEvent; + createEvent(eventInterface:"WheelEvent"): WheelEvent; + createEvent(eventInterface: string): Event; +} + +interface ElementTraversal { + readonly childElementCount: number; + readonly firstElementChild: Element | null; + readonly lastElementChild: Element | null; + readonly nextElementSibling: Element | null; + readonly previousElementSibling: Element | null; +} + +interface GetSVGDocument { + getSVGDocument(): Document; +} + +interface GlobalEventHandlersEventMap { + "pointercancel": PointerEvent; + "pointerdown": PointerEvent; + "pointerenter": PointerEvent; + "pointerleave": PointerEvent; + "pointermove": PointerEvent; + "pointerout": PointerEvent; + "pointerover": PointerEvent; + "pointerup": PointerEvent; + "wheel": WheelEvent; +} + +interface GlobalEventHandlers { + onpointercancel: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onpointerdown: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onpointerenter: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onpointerleave: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onpointermove: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onpointerout: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onpointerover: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onpointerup: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onwheel: (this: GlobalEventHandlers, ev: WheelEvent) => any; + addEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface GlobalFetch { + fetch(input: RequestInfo, init?: RequestInit): Promise; +} + +interface HTMLTableAlignment { + /** + * Sets or retrieves a value that you can use to implement your own ch functionality for the object. + */ + ch: string; + /** + * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. + */ + chOff: string; + /** + * Sets or retrieves how text and other content are vertically aligned within the object that contains them. + */ + vAlign: string; +} + +interface IDBEnvironment { + readonly indexedDB: IDBFactory; +} + +interface LinkStyle { + readonly sheet: StyleSheet; +} + +interface MSBaseReaderEventMap { + "abort": Event; + "error": ErrorEvent; + "load": Event; + "loadend": ProgressEvent; + "loadstart": Event; + "progress": ProgressEvent; +} + +interface MSBaseReader { + onabort: (this: MSBaseReader, ev: Event) => any; + onerror: (this: MSBaseReader, ev: ErrorEvent) => any; + onload: (this: MSBaseReader, ev: Event) => any; + onloadend: (this: MSBaseReader, ev: ProgressEvent) => any; + onloadstart: (this: MSBaseReader, ev: Event) => any; + onprogress: (this: MSBaseReader, ev: ProgressEvent) => any; + readonly readyState: number; + readonly result: any; + abort(): void; + readonly DONE: number; + readonly EMPTY: number; + readonly LOADING: number; + addEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface MSFileSaver { + msSaveBlob(blob: any, defaultName?: string): boolean; + msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; +} + +interface MSNavigatorDoNotTrack { + confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; + confirmWebWideTrackingException(args: ExceptionInformation): boolean; + removeSiteSpecificTrackingException(args: ExceptionInformation): void; + removeWebWideTrackingException(args: ExceptionInformation): void; + storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; + storeWebWideTrackingException(args: StoreExceptionsInformation): void; +} + +interface NavigatorBeacon { + sendBeacon(url: USVString, data?: BodyInit): boolean; +} + +interface NavigatorConcurrentHardware { + readonly hardwareConcurrency: number; +} + +interface NavigatorContentUtils { +} + +interface NavigatorGeolocation { + readonly geolocation: Geolocation; +} + +interface NavigatorID { + readonly appCodeName: string; + readonly appName: string; + readonly appVersion: string; + readonly platform: string; + readonly product: string; + readonly productSub: string; + readonly userAgent: string; + readonly vendor: string; + readonly vendorSub: string; +} + +interface NavigatorOnLine { + readonly onLine: boolean; +} + +interface NavigatorStorageUtils { +} + +interface NavigatorUserMedia { + readonly mediaDevices: MediaDevices; + getUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback): void; +} + +interface NodeSelector { + querySelector(selectors: K): ElementTagNameMap[K] | null; + querySelector(selectors: string): Element | null; + querySelectorAll(selectors: K): ElementListTagNameMap[K]; + querySelectorAll(selectors: string): NodeListOf; +} + +interface RandomSource { + getRandomValues(array: ArrayBufferView): ArrayBufferView; +} + +interface SVGAnimatedPoints { + readonly animatedPoints: SVGPointList; + readonly points: SVGPointList; +} + +interface SVGFilterPrimitiveStandardAttributes { + readonly height: SVGAnimatedLength; + readonly result: SVGAnimatedString; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; +} + +interface SVGFitToViewBox { + readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + readonly viewBox: SVGAnimatedRect; +} + +interface SVGTests { + readonly requiredExtensions: SVGStringList; + readonly requiredFeatures: SVGStringList; + readonly systemLanguage: SVGStringList; + hasExtension(extension: string): boolean; +} + +interface SVGURIReference { + readonly href: SVGAnimatedString; +} + +interface WindowBase64 { + atob(encodedString: string): string; + btoa(rawString: string): string; +} + +interface WindowConsole { + readonly console: Console; +} + +interface WindowLocalStorage { + readonly localStorage: Storage; +} + +interface WindowSessionStorage { + readonly sessionStorage: Storage; +} + +interface WindowTimers extends Object, WindowTimersExtension { + clearInterval(handle: number): void; + clearTimeout(handle: number): void; + setInterval(handler: (...args: any[]) => void, timeout: number): number; + setInterval(handler: any, timeout?: any, ...args: any[]): number; + setTimeout(handler: (...args: any[]) => void, timeout: number): number; + setTimeout(handler: any, timeout?: any, ...args: any[]): number; +} + +interface WindowTimersExtension { + clearImmediate(handle: number): void; + setImmediate(handler: (...args: any[]) => void): number; + setImmediate(handler: any, ...args: any[]): number; +} + +interface XMLHttpRequestEventTargetEventMap { + "abort": Event; + "error": ErrorEvent; + "load": Event; + "loadend": ProgressEvent; + "loadstart": Event; + "progress": ProgressEvent; + "timeout": ProgressEvent; +} + +interface XMLHttpRequestEventTarget { + onabort: (this: XMLHttpRequestEventTarget, ev: Event) => any; + onerror: (this: XMLHttpRequestEventTarget, ev: ErrorEvent) => any; + onload: (this: XMLHttpRequestEventTarget, ev: Event) => any; + onloadend: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; + onloadstart: (this: XMLHttpRequestEventTarget, ev: Event) => any; + onprogress: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; + ontimeout: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; + addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface ErrorEventInit { + message?: string; + filename?: string; + lineno?: number; + conlno?: number; + error?: any; +} + +interface StorageEventInit extends EventInit { + key?: string; + oldValue?: string; + newValue?: string; + url: string; + storageArea?: Storage; +} + +interface Canvas2DContextAttributes { + alpha?: boolean; + willReadFrequently?: boolean; + storage?: boolean; + [attribute: string]: boolean | string | undefined; +} + +interface ImageBitmapOptions { + imageOrientation?: "none" | "flipY"; + premultiplyAlpha?: "none" | "premultiply" | "default"; + colorSpaceConversion?: "none" | "default"; + resizeWidth?: number; + resizeHeight?: number; + resizeQuality?: "pixelated" | "low" | "medium" | "high"; +} + +interface ImageBitmap { + readonly width: number; + readonly height: number; + close(): void; +} + +interface URLSearchParams { + /** + * Appends a specified key/value pair as a new search parameter. + */ + append(name: string, value: string): void; + /** + * Deletes the given search parameter, and its associated value, from the list of all search parameters. + */ + delete(name: string): void; + /** + * Returns the first value associated to the given search parameter. + */ + get(name: string): string | null; + /** + * Returns all the values association with a given search parameter. + */ + getAll(name: string): string[]; + /** + * Returns a Boolean indicating if such a search parameter exists. + */ + has(name: string): boolean; + /** + * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others. + */ + set(name: string, value: string): void; +} + +declare var URLSearchParams: { + prototype: URLSearchParams; + /** + * Constructor returning a URLSearchParams object. + */ + new (init?: string | URLSearchParams): URLSearchParams; +} + +interface NodeListOf extends NodeList { + length: number; + item(index: number): TNode; + [index: number]: TNode; +} + +interface HTMLCollectionOf extends HTMLCollection { + item(index: number): T; + namedItem(name: string): T; + [index: number]: T; +} + +interface BlobPropertyBag { + type?: string; + endings?: string; +} + +interface FilePropertyBag { + type?: string; + lastModified?: number; +} + +interface EventListenerObject { + handleEvent(evt: Event): void; +} + +interface ProgressEventInit extends EventInit { + lengthComputable?: boolean; + loaded?: number; + total?: number; +} + +interface ScrollOptions { + behavior?: ScrollBehavior; +} + +interface ScrollToOptions extends ScrollOptions { + left?: number; + top?: number; +} + +interface ScrollIntoViewOptions extends ScrollOptions { + block?: ScrollLogicalPosition; + inline?: ScrollLogicalPosition; +} + +interface ClipboardEventInit extends EventInit { + data?: string; + dataType?: string; +} + +interface IDBArrayKey extends Array { +} + +interface RsaKeyGenParams extends Algorithm { + modulusLength: number; + publicExponent: Uint8Array; +} + +interface RsaHashedKeyGenParams extends RsaKeyGenParams { + hash: AlgorithmIdentifier; +} + +interface RsaKeyAlgorithm extends KeyAlgorithm { + modulusLength: number; + publicExponent: Uint8Array; +} + +interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { + hash: AlgorithmIdentifier; +} + +interface RsaHashedImportParams { + hash: AlgorithmIdentifier; +} + +interface RsaPssParams { + saltLength: number; +} + +interface RsaOaepParams extends Algorithm { + label?: BufferSource; +} + +interface EcdsaParams extends Algorithm { + hash: AlgorithmIdentifier; +} + +interface EcKeyGenParams extends Algorithm { + namedCurve: string; +} + +interface EcKeyAlgorithm extends KeyAlgorithm { + typedCurve: string; +} + +interface EcKeyImportParams { + namedCurve: string; +} + +interface EcdhKeyDeriveParams extends Algorithm { + public: CryptoKey; +} + +interface AesCtrParams extends Algorithm { + counter: BufferSource; + length: number; +} + +interface AesKeyAlgorithm extends KeyAlgorithm { + length: number; +} + +interface AesKeyGenParams extends Algorithm { + length: number; +} + +interface AesDerivedKeyParams extends Algorithm { + length: number; +} + +interface AesCbcParams extends Algorithm { + iv: BufferSource; +} + +interface AesCmacParams extends Algorithm { + length: number; +} + +interface AesGcmParams extends Algorithm { + iv: BufferSource; + additionalData?: BufferSource; + tagLength?: number; +} + +interface AesCfbParams extends Algorithm { + iv: BufferSource; +} + +interface HmacImportParams extends Algorithm { + hash?: AlgorithmIdentifier; + length?: number; +} + +interface HmacKeyAlgorithm extends KeyAlgorithm { + hash: AlgorithmIdentifier; + length: number; +} + +interface HmacKeyGenParams extends Algorithm { + hash: AlgorithmIdentifier; + length?: number; +} + +interface DhKeyGenParams extends Algorithm { + prime: Uint8Array; + generator: Uint8Array; +} + +interface DhKeyAlgorithm extends KeyAlgorithm { + prime: Uint8Array; + generator: Uint8Array; +} + +interface DhKeyDeriveParams extends Algorithm { + public: CryptoKey; +} + +interface DhImportKeyParams extends Algorithm { + prime: Uint8Array; + generator: Uint8Array; +} + +interface ConcatParams extends Algorithm { + hash?: AlgorithmIdentifier; + algorithmId: Uint8Array; + partyUInfo: Uint8Array; + partyVInfo: Uint8Array; + publicInfo?: Uint8Array; + privateInfo?: Uint8Array; +} + +interface HkdfCtrParams extends Algorithm { + hash: AlgorithmIdentifier; + label: BufferSource; + context: BufferSource; +} + +interface Pbkdf2Params extends Algorithm { + salt: BufferSource; + iterations: number; + hash: AlgorithmIdentifier; +} + +interface RsaOtherPrimesInfo { + r: string; + d: string; + t: string; +} + +interface JsonWebKey { + kty: string; + use?: string; + key_ops?: string[]; + alg?: string; + kid?: string; + x5u?: string; + x5c?: string; + x5t?: string; + ext?: boolean; + crv?: string; + x?: string; + y?: string; + d?: string; + n?: string; + e?: string; + p?: string; + q?: string; + dp?: string; + dq?: string; + qi?: string; + oth?: RsaOtherPrimesInfo[]; + k?: string; +} + +interface ParentNode { + readonly children: HTMLCollection; + readonly firstElementChild: Element | null; + readonly lastElementChild: Element | null; + readonly childElementCount: number; +} + +interface DocumentOrShadowRoot { + readonly activeElement: Element | null; + readonly stylesheets: StyleSheetList; + getSelection(): Selection | null; + elementFromPoint(x: number, y: number): Element | null; + elementsFromPoint(x: number, y: number): Element[]; +} + +interface ShadowRoot extends DocumentOrShadowRoot, DocumentFragment { + readonly host: Element; + innerHTML: string; +} + +interface ShadowRootInit { + mode: 'open'|'closed'; + delegatesFocus?: boolean; +} + +interface HTMLSlotElement extends HTMLElement { + name: string; + assignedNodes(options?: AssignedNodesOptions): Node[]; +} + +interface AssignedNodesOptions { + flatten?: boolean; +} + +interface ElementDefinitionOptions { + extends: string; +} + +interface CustomElementRegistry { + define(name: string, constructor: Function, options?: ElementDefinitionOptions): void; + get(name: string): any; + whenDefined(name: string): PromiseLike; +} + +interface PromiseRejectionEvent extends Event { + readonly promise: PromiseLike; + readonly reason: any; +} + +interface PromiseRejectionEventInit extends EventInit { + promise: PromiseLike; + reason?: any; +} + +interface EventListenerOptions { + capture?: boolean; +} + +interface AddEventListenerOptions extends EventListenerOptions { + passive?: boolean; + once?: boolean; +} + +interface TouchEventInit extends EventModifierInit { + touches?: Touch[]; + targetTouches?: Touch[]; + changedTouches?: Touch[]; +} + +declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; + +interface ErrorEventHandler { + (message: string, filename?: string, lineno?: number, colno?: number, error?:Error): void; +} +interface PositionCallback { + (position: Position): void; +} +interface PositionErrorCallback { + (error: PositionError): void; +} +interface MediaQueryListListener { + (mql: MediaQueryList): void; +} +interface MSLaunchUriCallback { + (): void; +} +interface FrameRequestCallback { + (time: number): void; +} +interface MSUnsafeFunctionCallback { + (): any; +} +interface MSExecAtPriorityFunctionCallback { + (...args: any[]): any; +} +interface MutationCallback { + (mutations: MutationRecord[], observer: MutationObserver): void; +} +interface DecodeSuccessCallback { + (decodedData: AudioBuffer): void; +} +interface DecodeErrorCallback { + (error: DOMException): void; +} +interface VoidFunction { + (): void; +} +interface RTCSessionDescriptionCallback { + (sdp: RTCSessionDescription): void; +} +interface RTCPeerConnectionErrorCallback { + (error: DOMError): void; +} +interface RTCStatsCallback { + (report: RTCStatsReport): void; +} +interface FunctionStringCallback { + (data: string): void; +} +interface NavigatorUserMediaSuccessCallback { + (stream: MediaStream): void; +} +interface NavigatorUserMediaErrorCallback { + (error: MediaStreamError): void; +} +interface ForEachCallback { + (keyId: any, status: MediaKeyStatus): void; +} +interface NotificationPermissionCallback { + (permission: NotificationPermission): void; +} +interface IntersectionObserverCallback { + (entries: IntersectionObserverEntry[], observer: IntersectionObserver): void; +} +interface HTMLElementTagNameMap { + "a": HTMLAnchorElement; + "applet": HTMLAppletElement; + "area": HTMLAreaElement; + "audio": HTMLAudioElement; + "base": HTMLBaseElement; + "basefont": HTMLBaseFontElement; + "blockquote": HTMLQuoteElement; + "body": HTMLBodyElement; + "br": HTMLBRElement; + "button": HTMLButtonElement; + "canvas": HTMLCanvasElement; + "caption": HTMLTableCaptionElement; + "col": HTMLTableColElement; + "colgroup": HTMLTableColElement; + "data": HTMLDataElement; + "datalist": HTMLDataListElement; + "del": HTMLModElement; + "dir": HTMLDirectoryElement; + "div": HTMLDivElement; + "dl": HTMLDListElement; + "embed": HTMLEmbedElement; + "fieldset": HTMLFieldSetElement; + "font": HTMLFontElement; + "form": HTMLFormElement; + "frame": HTMLFrameElement; + "frameset": HTMLFrameSetElement; + "h1": HTMLHeadingElement; + "h2": HTMLHeadingElement; + "h3": HTMLHeadingElement; + "h4": HTMLHeadingElement; + "h5": HTMLHeadingElement; + "h6": HTMLHeadingElement; + "head": HTMLHeadElement; + "hr": HTMLHRElement; + "html": HTMLHtmlElement; + "iframe": HTMLIFrameElement; + "img": HTMLImageElement; + "input": HTMLInputElement; + "ins": HTMLModElement; + "isindex": HTMLUnknownElement; + "label": HTMLLabelElement; + "legend": HTMLLegendElement; + "li": HTMLLIElement; + "link": HTMLLinkElement; + "listing": HTMLPreElement; + "map": HTMLMapElement; + "marquee": HTMLMarqueeElement; + "menu": HTMLMenuElement; + "meta": HTMLMetaElement; + "meter": HTMLMeterElement; + "nextid": HTMLUnknownElement; + "object": HTMLObjectElement; + "ol": HTMLOListElement; + "optgroup": HTMLOptGroupElement; + "option": HTMLOptionElement; + "output": HTMLOutputElement; + "p": HTMLParagraphElement; + "param": HTMLParamElement; + "picture": HTMLPictureElement; + "pre": HTMLPreElement; + "progress": HTMLProgressElement; + "q": HTMLQuoteElement; + "script": HTMLScriptElement; + "select": HTMLSelectElement; + "source": HTMLSourceElement; + "span": HTMLSpanElement; + "style": HTMLStyleElement; + "table": HTMLTableElement; + "tbody": HTMLTableSectionElement; + "td": HTMLTableDataCellElement; + "template": HTMLTemplateElement; + "textarea": HTMLTextAreaElement; + "tfoot": HTMLTableSectionElement; + "th": HTMLTableHeaderCellElement; + "thead": HTMLTableSectionElement; + "time": HTMLTimeElement; + "title": HTMLTitleElement; + "tr": HTMLTableRowElement; + "track": HTMLTrackElement; + "ul": HTMLUListElement; + "video": HTMLVideoElement; + "x-ms-webview": MSHTMLWebViewElement; + "xmp": HTMLPreElement; +} + +interface ElementTagNameMap { + "a": HTMLAnchorElement; + "abbr": HTMLElement; + "acronym": HTMLElement; + "address": HTMLElement; + "applet": HTMLAppletElement; + "area": HTMLAreaElement; + "article": HTMLElement; + "aside": HTMLElement; + "audio": HTMLAudioElement; + "b": HTMLElement; + "base": HTMLBaseElement; + "basefont": HTMLBaseFontElement; + "bdo": HTMLElement; + "big": HTMLElement; + "blockquote": HTMLQuoteElement; + "body": HTMLBodyElement; + "br": HTMLBRElement; + "button": HTMLButtonElement; + "canvas": HTMLCanvasElement; + "caption": HTMLTableCaptionElement; + "center": HTMLElement; + "circle": SVGCircleElement; + "cite": HTMLElement; + "clippath": SVGClipPathElement; + "code": HTMLElement; + "col": HTMLTableColElement; + "colgroup": HTMLTableColElement; + "data": HTMLDataElement; + "datalist": HTMLDataListElement; + "dd": HTMLElement; + "defs": SVGDefsElement; + "del": HTMLModElement; + "desc": SVGDescElement; + "dfn": HTMLElement; + "dir": HTMLDirectoryElement; + "div": HTMLDivElement; + "dl": HTMLDListElement; + "dt": HTMLElement; + "ellipse": SVGEllipseElement; + "em": HTMLElement; + "embed": HTMLEmbedElement; + "feblend": SVGFEBlendElement; + "fecolormatrix": SVGFEColorMatrixElement; + "fecomponenttransfer": SVGFEComponentTransferElement; + "fecomposite": SVGFECompositeElement; + "feconvolvematrix": SVGFEConvolveMatrixElement; + "fediffuselighting": SVGFEDiffuseLightingElement; + "fedisplacementmap": SVGFEDisplacementMapElement; + "fedistantlight": SVGFEDistantLightElement; + "feflood": SVGFEFloodElement; + "fefunca": SVGFEFuncAElement; + "fefuncb": SVGFEFuncBElement; + "fefuncg": SVGFEFuncGElement; + "fefuncr": SVGFEFuncRElement; + "fegaussianblur": SVGFEGaussianBlurElement; + "feimage": SVGFEImageElement; + "femerge": SVGFEMergeElement; + "femergenode": SVGFEMergeNodeElement; + "femorphology": SVGFEMorphologyElement; + "feoffset": SVGFEOffsetElement; + "fepointlight": SVGFEPointLightElement; + "fespecularlighting": SVGFESpecularLightingElement; + "fespotlight": SVGFESpotLightElement; + "fetile": SVGFETileElement; + "feturbulence": SVGFETurbulenceElement; + "fieldset": HTMLFieldSetElement; + "figcaption": HTMLElement; + "figure": HTMLElement; + "filter": SVGFilterElement; + "font": HTMLFontElement; + "footer": HTMLElement; + "foreignobject": SVGForeignObjectElement; + "form": HTMLFormElement; + "frame": HTMLFrameElement; + "frameset": HTMLFrameSetElement; + "g": SVGGElement; + "h1": HTMLHeadingElement; + "h2": HTMLHeadingElement; + "h3": HTMLHeadingElement; + "h4": HTMLHeadingElement; + "h5": HTMLHeadingElement; + "h6": HTMLHeadingElement; + "head": HTMLHeadElement; + "header": HTMLElement; + "hgroup": HTMLElement; + "hr": HTMLHRElement; + "html": HTMLHtmlElement; + "i": HTMLElement; + "iframe": HTMLIFrameElement; + "image": SVGImageElement; + "img": HTMLImageElement; + "input": HTMLInputElement; + "ins": HTMLModElement; + "isindex": HTMLUnknownElement; + "kbd": HTMLElement; + "keygen": HTMLElement; + "label": HTMLLabelElement; + "legend": HTMLLegendElement; + "li": HTMLLIElement; + "line": SVGLineElement; + "lineargradient": SVGLinearGradientElement; + "link": HTMLLinkElement; + "listing": HTMLPreElement; + "map": HTMLMapElement; + "mark": HTMLElement; + "marker": SVGMarkerElement; + "marquee": HTMLMarqueeElement; + "mask": SVGMaskElement; + "menu": HTMLMenuElement; + "meta": HTMLMetaElement; + "metadata": SVGMetadataElement; + "meter": HTMLMeterElement; + "nav": HTMLElement; + "nextid": HTMLUnknownElement; + "nobr": HTMLElement; + "noframes": HTMLElement; + "noscript": HTMLElement; + "object": HTMLObjectElement; + "ol": HTMLOListElement; + "optgroup": HTMLOptGroupElement; + "option": HTMLOptionElement; + "output": HTMLOutputElement; + "p": HTMLParagraphElement; + "param": HTMLParamElement; + "path": SVGPathElement; + "pattern": SVGPatternElement; + "picture": HTMLPictureElement; + "plaintext": HTMLElement; + "polygon": SVGPolygonElement; + "polyline": SVGPolylineElement; + "pre": HTMLPreElement; + "progress": HTMLProgressElement; + "q": HTMLQuoteElement; + "radialgradient": SVGRadialGradientElement; + "rect": SVGRectElement; + "rt": HTMLElement; + "ruby": HTMLElement; + "s": HTMLElement; + "samp": HTMLElement; + "script": HTMLScriptElement; + "section": HTMLElement; + "select": HTMLSelectElement; + "small": HTMLElement; + "source": HTMLSourceElement; + "span": HTMLSpanElement; + "stop": SVGStopElement; + "strike": HTMLElement; + "strong": HTMLElement; + "style": HTMLStyleElement; + "sub": HTMLElement; + "sup": HTMLElement; + "svg": SVGSVGElement; + "switch": SVGSwitchElement; + "symbol": SVGSymbolElement; + "table": HTMLTableElement; + "tbody": HTMLTableSectionElement; + "td": HTMLTableDataCellElement; + "template": HTMLTemplateElement; + "text": SVGTextElement; + "textpath": SVGTextPathElement; + "textarea": HTMLTextAreaElement; + "tfoot": HTMLTableSectionElement; + "th": HTMLTableHeaderCellElement; + "thead": HTMLTableSectionElement; + "time": HTMLTimeElement; + "title": HTMLTitleElement; + "tr": HTMLTableRowElement; + "track": HTMLTrackElement; + "tspan": SVGTSpanElement; + "tt": HTMLElement; + "u": HTMLElement; + "ul": HTMLUListElement; + "use": SVGUseElement; + "var": HTMLElement; + "video": HTMLVideoElement; + "view": SVGViewElement; + "wbr": HTMLElement; + "x-ms-webview": MSHTMLWebViewElement; + "xmp": HTMLPreElement; +} + +interface ElementListTagNameMap { + "a": NodeListOf; + "abbr": NodeListOf; + "acronym": NodeListOf; + "address": NodeListOf; + "applet": NodeListOf; + "area": NodeListOf; + "article": NodeListOf; + "aside": NodeListOf; + "audio": NodeListOf; + "b": NodeListOf; + "base": NodeListOf; + "basefont": NodeListOf; + "bdo": NodeListOf; + "big": NodeListOf; + "blockquote": NodeListOf; + "body": NodeListOf; + "br": NodeListOf; + "button": NodeListOf; + "canvas": NodeListOf; + "caption": NodeListOf; + "center": NodeListOf; + "circle": NodeListOf; + "cite": NodeListOf; + "clippath": NodeListOf; + "code": NodeListOf; + "col": NodeListOf; + "colgroup": NodeListOf; + "data": NodeListOf; + "datalist": NodeListOf; + "dd": NodeListOf; + "defs": NodeListOf; + "del": NodeListOf; + "desc": NodeListOf; + "dfn": NodeListOf; + "dir": NodeListOf; + "div": NodeListOf; + "dl": NodeListOf; + "dt": NodeListOf; + "ellipse": NodeListOf; + "em": NodeListOf; + "embed": NodeListOf; + "feblend": NodeListOf; + "fecolormatrix": NodeListOf; + "fecomponenttransfer": NodeListOf; + "fecomposite": NodeListOf; + "feconvolvematrix": NodeListOf; + "fediffuselighting": NodeListOf; + "fedisplacementmap": NodeListOf; + "fedistantlight": NodeListOf; + "feflood": NodeListOf; + "fefunca": NodeListOf; + "fefuncb": NodeListOf; + "fefuncg": NodeListOf; + "fefuncr": NodeListOf; + "fegaussianblur": NodeListOf; + "feimage": NodeListOf; + "femerge": NodeListOf; + "femergenode": NodeListOf; + "femorphology": NodeListOf; + "feoffset": NodeListOf; + "fepointlight": NodeListOf; + "fespecularlighting": NodeListOf; + "fespotlight": NodeListOf; + "fetile": NodeListOf; + "feturbulence": NodeListOf; + "fieldset": NodeListOf; + "figcaption": NodeListOf; + "figure": NodeListOf; + "filter": NodeListOf; + "font": NodeListOf; + "footer": NodeListOf; + "foreignobject": NodeListOf; + "form": NodeListOf; + "frame": NodeListOf; + "frameset": NodeListOf; + "g": NodeListOf; + "h1": NodeListOf; + "h2": NodeListOf; + "h3": NodeListOf; + "h4": NodeListOf; + "h5": NodeListOf; + "h6": NodeListOf; + "head": NodeListOf; + "header": NodeListOf; + "hgroup": NodeListOf; + "hr": NodeListOf; + "html": NodeListOf; + "i": NodeListOf; + "iframe": NodeListOf; + "image": NodeListOf; + "img": NodeListOf; + "input": NodeListOf; + "ins": NodeListOf; + "isindex": NodeListOf; + "kbd": NodeListOf; + "keygen": NodeListOf; + "label": NodeListOf; + "legend": NodeListOf; + "li": NodeListOf; + "line": NodeListOf; + "lineargradient": NodeListOf; + "link": NodeListOf; + "listing": NodeListOf; + "map": NodeListOf; + "mark": NodeListOf; + "marker": NodeListOf; + "marquee": NodeListOf; + "mask": NodeListOf; + "menu": NodeListOf; + "meta": NodeListOf; + "metadata": NodeListOf; + "meter": NodeListOf; + "nav": NodeListOf; + "nextid": NodeListOf; + "nobr": NodeListOf; + "noframes": NodeListOf; + "noscript": NodeListOf; + "object": NodeListOf; + "ol": NodeListOf; + "optgroup": NodeListOf; + "option": NodeListOf; + "output": NodeListOf; + "p": NodeListOf; + "param": NodeListOf; + "path": NodeListOf; + "pattern": NodeListOf; + "picture": NodeListOf; + "plaintext": NodeListOf; + "polygon": NodeListOf; + "polyline": NodeListOf; + "pre": NodeListOf; + "progress": NodeListOf; + "q": NodeListOf; + "radialgradient": NodeListOf; + "rect": NodeListOf; + "rt": NodeListOf; + "ruby": NodeListOf; + "s": NodeListOf; + "samp": NodeListOf; + "script": NodeListOf; + "section": NodeListOf; + "select": NodeListOf; + "small": NodeListOf; + "source": NodeListOf; + "span": NodeListOf; + "stop": NodeListOf; + "strike": NodeListOf; + "strong": NodeListOf; + "style": NodeListOf; + "sub": NodeListOf; + "sup": NodeListOf; + "svg": NodeListOf; + "switch": NodeListOf; + "symbol": NodeListOf; + "table": NodeListOf; + "tbody": NodeListOf; + "td": NodeListOf; + "template": NodeListOf; + "text": NodeListOf; + "textpath": NodeListOf; + "textarea": NodeListOf; + "tfoot": NodeListOf; + "th": NodeListOf; + "thead": NodeListOf; + "time": NodeListOf; + "title": NodeListOf; + "tr": NodeListOf; + "track": NodeListOf; + "tspan": NodeListOf; + "tt": NodeListOf; + "u": NodeListOf; + "ul": NodeListOf; + "use": NodeListOf; + "var": NodeListOf; + "video": NodeListOf; + "view": NodeListOf; + "wbr": NodeListOf; + "x-ms-webview": NodeListOf; + "xmp": NodeListOf; +} + +declare var Audio: {new(src?: string): HTMLAudioElement; }; +declare var Image: {new(width?: number, height?: number): HTMLImageElement; }; +declare var Option: {new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; }; +declare var applicationCache: ApplicationCache; +declare var caches: CacheStorage; +declare var clientInformation: Navigator; +declare var closed: boolean; +declare var crypto: Crypto; +declare var defaultStatus: string; +declare var devicePixelRatio: number; +declare var doNotTrack: string; +declare var document: Document; +declare var event: Event | undefined; +declare var external: External; +declare var frameElement: Element; +declare var frames: Window; +declare var history: History; +declare var innerHeight: number; +declare var innerWidth: number; +declare var isSecureContext: boolean; +declare var length: number; +declare var location: Location; +declare var locationbar: BarProp; +declare var menubar: BarProp; +declare var msContentScript: ExtensionScriptApis; +declare var msCredentials: MSCredentials; +declare const name: never; +declare var navigator: Navigator; +declare var offscreenBuffering: string | boolean; +declare var onabort: (this: Window, ev: UIEvent) => any; +declare var onafterprint: (this: Window, ev: Event) => any; +declare var onbeforeprint: (this: Window, ev: Event) => any; +declare var onbeforeunload: (this: Window, ev: BeforeUnloadEvent) => any; +declare var onblur: (this: Window, ev: FocusEvent) => any; +declare var oncanplay: (this: Window, ev: Event) => any; +declare var oncanplaythrough: (this: Window, ev: Event) => any; +declare var onchange: (this: Window, ev: Event) => any; +declare var onclick: (this: Window, ev: MouseEvent) => any; +declare var oncompassneedscalibration: (this: Window, ev: Event) => any; +declare var oncontextmenu: (this: Window, ev: PointerEvent) => any; +declare var ondblclick: (this: Window, ev: MouseEvent) => any; +declare var ondevicelight: (this: Window, ev: DeviceLightEvent) => any; +declare var ondevicemotion: (this: Window, ev: DeviceMotionEvent) => any; +declare var ondeviceorientation: (this: Window, ev: DeviceOrientationEvent) => any; +declare var ondrag: (this: Window, ev: DragEvent) => any; +declare var ondragend: (this: Window, ev: DragEvent) => any; +declare var ondragenter: (this: Window, ev: DragEvent) => any; +declare var ondragleave: (this: Window, ev: DragEvent) => any; +declare var ondragover: (this: Window, ev: DragEvent) => any; +declare var ondragstart: (this: Window, ev: DragEvent) => any; +declare var ondrop: (this: Window, ev: DragEvent) => any; +declare var ondurationchange: (this: Window, ev: Event) => any; +declare var onemptied: (this: Window, ev: Event) => any; +declare var onended: (this: Window, ev: MediaStreamErrorEvent) => any; +declare var onerror: ErrorEventHandler; +declare var onfocus: (this: Window, ev: FocusEvent) => any; +declare var onhashchange: (this: Window, ev: HashChangeEvent) => any; +declare var oninput: (this: Window, ev: Event) => any; +declare var oninvalid: (this: Window, ev: Event) => any; +declare var onkeydown: (this: Window, ev: KeyboardEvent) => any; +declare var onkeypress: (this: Window, ev: KeyboardEvent) => any; +declare var onkeyup: (this: Window, ev: KeyboardEvent) => any; +declare var onload: (this: Window, ev: Event) => any; +declare var onloadeddata: (this: Window, ev: Event) => any; +declare var onloadedmetadata: (this: Window, ev: Event) => any; +declare var onloadstart: (this: Window, ev: Event) => any; +declare var onmessage: (this: Window, ev: MessageEvent) => any; +declare var onmousedown: (this: Window, ev: MouseEvent) => any; +declare var onmouseenter: (this: Window, ev: MouseEvent) => any; +declare var onmouseleave: (this: Window, ev: MouseEvent) => any; +declare var onmousemove: (this: Window, ev: MouseEvent) => any; +declare var onmouseout: (this: Window, ev: MouseEvent) => any; +declare var onmouseover: (this: Window, ev: MouseEvent) => any; +declare var onmouseup: (this: Window, ev: MouseEvent) => any; +declare var onmousewheel: (this: Window, ev: WheelEvent) => any; +declare var onmsgesturechange: (this: Window, ev: MSGestureEvent) => any; +declare var onmsgesturedoubletap: (this: Window, ev: MSGestureEvent) => any; +declare var onmsgestureend: (this: Window, ev: MSGestureEvent) => any; +declare var onmsgesturehold: (this: Window, ev: MSGestureEvent) => any; +declare var onmsgesturestart: (this: Window, ev: MSGestureEvent) => any; +declare var onmsgesturetap: (this: Window, ev: MSGestureEvent) => any; +declare var onmsinertiastart: (this: Window, ev: MSGestureEvent) => any; +declare var onmspointercancel: (this: Window, ev: MSPointerEvent) => any; +declare var onmspointerdown: (this: Window, ev: MSPointerEvent) => any; +declare var onmspointerenter: (this: Window, ev: MSPointerEvent) => any; +declare var onmspointerleave: (this: Window, ev: MSPointerEvent) => any; +declare var onmspointermove: (this: Window, ev: MSPointerEvent) => any; +declare var onmspointerout: (this: Window, ev: MSPointerEvent) => any; +declare var onmspointerover: (this: Window, ev: MSPointerEvent) => any; +declare var onmspointerup: (this: Window, ev: MSPointerEvent) => any; +declare var onoffline: (this: Window, ev: Event) => any; +declare var ononline: (this: Window, ev: Event) => any; +declare var onorientationchange: (this: Window, ev: Event) => any; +declare var onpagehide: (this: Window, ev: PageTransitionEvent) => any; +declare var onpageshow: (this: Window, ev: PageTransitionEvent) => any; +declare var onpause: (this: Window, ev: Event) => any; +declare var onplay: (this: Window, ev: Event) => any; +declare var onplaying: (this: Window, ev: Event) => any; +declare var onpopstate: (this: Window, ev: PopStateEvent) => any; +declare var onprogress: (this: Window, ev: ProgressEvent) => any; +declare var onratechange: (this: Window, ev: Event) => any; +declare var onreadystatechange: (this: Window, ev: ProgressEvent) => any; +declare var onreset: (this: Window, ev: Event) => any; +declare var onresize: (this: Window, ev: UIEvent) => any; +declare var onscroll: (this: Window, ev: UIEvent) => any; +declare var onseeked: (this: Window, ev: Event) => any; +declare var onseeking: (this: Window, ev: Event) => any; +declare var onselect: (this: Window, ev: UIEvent) => any; +declare var onstalled: (this: Window, ev: Event) => any; +declare var onstorage: (this: Window, ev: StorageEvent) => any; +declare var onsubmit: (this: Window, ev: Event) => any; +declare var onsuspend: (this: Window, ev: Event) => any; +declare var ontimeupdate: (this: Window, ev: Event) => any; +declare var ontouchcancel: (ev: TouchEvent) => any; +declare var ontouchend: (ev: TouchEvent) => any; +declare var ontouchmove: (ev: TouchEvent) => any; +declare var ontouchstart: (ev: TouchEvent) => any; +declare var onunload: (this: Window, ev: Event) => any; +declare var onvolumechange: (this: Window, ev: Event) => any; +declare var onwaiting: (this: Window, ev: Event) => any; +declare var opener: any; +declare var orientation: string | number; +declare var outerHeight: number; +declare var outerWidth: number; +declare var pageXOffset: number; +declare var pageYOffset: number; +declare var parent: Window; +declare var performance: Performance; +declare var personalbar: BarProp; +declare var screen: Screen; +declare var screenLeft: number; +declare var screenTop: number; +declare var screenX: number; +declare var screenY: number; +declare var scrollX: number; +declare var scrollY: number; +declare var scrollbars: BarProp; +declare var self: Window; +declare var speechSynthesis: SpeechSynthesis; +declare var status: string; +declare var statusbar: BarProp; +declare var styleMedia: StyleMedia; +declare var toolbar: BarProp; +declare var top: Window; +declare var window: Window; +declare var customElements: CustomElementRegistry; +declare function alert(message?: any): void; +declare function blur(): void; +declare function cancelAnimationFrame(handle: number): void; +declare function captureEvents(): void; +declare function close(): void; +declare function confirm(message?: string): boolean; +declare function departFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void; +declare function focus(): void; +declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; +declare function getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; +declare function getSelection(): Selection; +declare function matchMedia(mediaQuery: string): MediaQueryList; +declare function moveBy(x?: number, y?: number): void; +declare function moveTo(x?: number, y?: number): void; +declare function msWriteProfilerMark(profilerMarkName: string): void; +declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window; +declare function postMessage(message: any, targetOrigin: string, transfer?: any[]): void; +declare function print(): void; +declare function prompt(message?: string, _default?: string): string | null; +declare function releaseEvents(): void; +declare function requestAnimationFrame(callback: FrameRequestCallback): number; +declare function resizeBy(x?: number, y?: number): void; +declare function resizeTo(x?: number, y?: number): void; +declare function scroll(x?: number, y?: number): void; +declare function scrollBy(x?: number, y?: number): void; +declare function scrollTo(x?: number, y?: number): void; +declare function stop(): void; +declare function webkitCancelAnimationFrame(handle: number): void; +declare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; +declare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; +declare function webkitRequestAnimationFrame(callback: FrameRequestCallback): number; +declare function createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise; +declare function createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise; +declare function scroll(options?: ScrollToOptions): void; +declare function scrollTo(options?: ScrollToOptions): void; +declare function scrollBy(options?: ScrollToOptions): void; +declare function toString(): string; +declare function dispatchEvent(evt: Event): boolean; +declare function removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +declare function clearInterval(handle: number): void; +declare function clearTimeout(handle: number): void; +declare function setInterval(handler: (...args: any[]) => void, timeout: number): number; +declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; +declare function setTimeout(handler: (...args: any[]) => void, timeout: number): number; +declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; +declare function clearImmediate(handle: number): void; +declare function setImmediate(handler: (...args: any[]) => void): number; +declare function setImmediate(handler: any, ...args: any[]): number; +declare var sessionStorage: Storage; +declare var localStorage: Storage; +declare var console: Console; +declare var onpointercancel: (this: Window, ev: PointerEvent) => any; +declare var onpointerdown: (this: Window, ev: PointerEvent) => any; +declare var onpointerenter: (this: Window, ev: PointerEvent) => any; +declare var onpointerleave: (this: Window, ev: PointerEvent) => any; +declare var onpointermove: (this: Window, ev: PointerEvent) => any; +declare var onpointerout: (this: Window, ev: PointerEvent) => any; +declare var onpointerover: (this: Window, ev: PointerEvent) => any; +declare var onpointerup: (this: Window, ev: PointerEvent) => any; +declare var onwheel: (this: Window, ev: WheelEvent) => any; +declare var indexedDB: IDBFactory; +declare function atob(encodedString: string): string; +declare function btoa(rawString: string): string; +declare function fetch(input: RequestInfo, init?: RequestInit): Promise; +declare function addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, useCapture?: boolean): void; +declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +type AAGUID = string; +type AlgorithmIdentifier = string | Algorithm; +type BodyInit = any; +type ByteString = string; +type ConstrainBoolean = boolean | ConstrainBooleanParameters; +type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters; +type ConstrainDouble = number | ConstrainDoubleRange; +type ConstrainLong = number | ConstrainLongRange; +type CryptoOperationData = ArrayBufferView; +type GLbitfield = number; +type GLboolean = boolean; +type GLbyte = number; +type GLclampf = number; +type GLenum = number; +type GLfloat = number; +type GLint = number; +type GLintptr = number; +type GLshort = number; +type GLsizei = number; +type GLsizeiptr = number; +type GLubyte = number; +type GLuint = number; +type GLushort = number; +type HeadersInit = any; +type IDBKeyPath = string; +type KeyFormat = string; +type KeyType = string; +type KeyUsage = string; +type MSInboundPayload = MSVideoRecvPayload | MSAudioRecvPayload; +type MSLocalClientEvent = MSLocalClientEventBase | MSAudioLocalClientEvent; +type MSOutboundPayload = MSVideoSendPayload | MSAudioSendPayload; +type RTCIceGatherCandidate = RTCIceCandidateDictionary | RTCIceCandidateComplete; +type RTCTransport = RTCDtlsTransport | RTCSrtpSdesTransport; +type RequestInfo = Request | string; +type USVString = string; +type payloadtype = number; +type ScrollBehavior = "auto" | "instant" | "smooth"; +type ScrollLogicalPosition = "start" | "center" | "end" | "nearest"; +type IDBValidKey = number | string | Date | IDBArrayKey; +type BufferSource = ArrayBuffer | ArrayBufferView; +type MouseWheelEvent = WheelEvent; +type ScrollRestoration = "auto" | "manual"; +type FormDataEntryValue = string | File; +type AppendMode = "segments" | "sequence"; +type AudioContextState = "suspended" | "running" | "closed"; +type BiquadFilterType = "lowpass" | "highpass" | "bandpass" | "lowshelf" | "highshelf" | "peaking" | "notch" | "allpass"; +type CanvasFillRule = "nonzero" | "evenodd"; +type ChannelCountMode = "max" | "clamped-max" | "explicit"; +type ChannelInterpretation = "speakers" | "discrete"; +type DistanceModelType = "linear" | "inverse" | "exponential"; +type ExpandGranularity = "character" | "word" | "sentence" | "textedit"; +type GamepadInputEmulationType = "mouse" | "keyboard" | "gamepad"; +type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique"; +type IDBRequestReadyState = "pending" | "done"; +type IDBTransactionMode = "readonly" | "readwrite" | "versionchange"; +type ListeningState = "inactive" | "active" | "disambiguation"; +type MSCredentialType = "FIDO_2_0"; +type MSIceAddrType = "os" | "stun" | "turn" | "peer-derived"; +type MSIceType = "failed" | "direct" | "relay"; +type MSStatsType = "description" | "localclientevent" | "inbound-network" | "outbound-network" | "inbound-payload" | "outbound-payload" | "transportdiagnostics"; +type MSTransportType = "Embedded" | "USB" | "NFC" | "BT"; +type MSWebViewPermissionState = "unknown" | "defer" | "allow" | "deny"; +type MSWebViewPermissionType = "geolocation" | "unlimitedIndexedDBQuota" | "media" | "pointerlock" | "webnotifications"; +type MediaDeviceKind = "audioinput" | "audiooutput" | "videoinput"; +type MediaKeyMessageType = "license-request" | "license-renewal" | "license-release" | "individualization-request"; +type MediaKeySessionType = "temporary" | "persistent-license" | "persistent-release-message"; +type MediaKeyStatus = "usable" | "expired" | "output-downscaled" | "output-not-allowed" | "status-pending" | "internal-error"; +type MediaKeysRequirement = "required" | "optional" | "not-allowed"; +type MediaStreamTrackState = "live" | "ended"; +type NavigationReason = "up" | "down" | "left" | "right"; +type NavigationType = "navigate" | "reload" | "back_forward" | "prerender"; +type NotificationDirection = "auto" | "ltr" | "rtl"; +type NotificationPermission = "default" | "denied" | "granted"; +type OscillatorType = "sine" | "square" | "sawtooth" | "triangle" | "custom"; +type OverSampleType = "none" | "2x" | "4x"; +type PanningModelType = "equalpower"; +type PaymentComplete = "success" | "fail" | ""; +type PaymentShippingType = "shipping" | "delivery" | "pickup"; +type PushEncryptionKeyName = "p256dh" | "auth"; +type PushPermissionState = "granted" | "denied" | "prompt"; +type RTCBundlePolicy = "balanced" | "max-compat" | "max-bundle"; +type RTCDegradationPreference = "maintain-framerate" | "maintain-resolution" | "balanced"; +type RTCDtlsRole = "auto" | "client" | "server"; +type RTCDtlsTransportState = "new" | "connecting" | "connected" | "closed"; +type RTCIceCandidateType = "host" | "srflx" | "prflx" | "relay"; +type RTCIceComponent = "RTP" | "RTCP"; +type RTCIceConnectionState = "new" | "checking" | "connected" | "completed" | "failed" | "disconnected" | "closed"; +type RTCIceGatherPolicy = "all" | "nohost" | "relay"; +type RTCIceGathererState = "new" | "gathering" | "complete"; +type RTCIceGatheringState = "new" | "gathering" | "complete"; +type RTCIceProtocol = "udp" | "tcp"; +type RTCIceRole = "controlling" | "controlled"; +type RTCIceTcpCandidateType = "active" | "passive" | "so"; +type RTCIceTransportPolicy = "none" | "relay" | "all"; +type RTCIceTransportState = "new" | "checking" | "connected" | "completed" | "disconnected" | "closed"; +type RTCSdpType = "offer" | "pranswer" | "answer"; +type RTCSignalingState = "stable" | "have-local-offer" | "have-remote-offer" | "have-local-pranswer" | "have-remote-pranswer" | "closed"; +type RTCStatsIceCandidatePairState = "frozen" | "waiting" | "inprogress" | "failed" | "succeeded" | "cancelled"; +type RTCStatsIceCandidateType = "host" | "serverreflexive" | "peerreflexive" | "relayed"; +type RTCStatsType = "inboundrtp" | "outboundrtp" | "session" | "datachannel" | "track" | "transport" | "candidatepair" | "localcandidate" | "remotecandidate"; +type ReferrerPolicy = "" | "no-referrer" | "no-referrer-when-downgrade" | "origin-only" | "origin-when-cross-origin" | "unsafe-url"; +type RequestCache = "default" | "no-store" | "reload" | "no-cache" | "force-cache"; +type RequestCredentials = "omit" | "same-origin" | "include"; +type RequestDestination = "" | "document" | "sharedworker" | "subresource" | "unknown" | "worker"; +type RequestMode = "navigate" | "same-origin" | "no-cors" | "cors"; +type RequestRedirect = "follow" | "error" | "manual"; +type RequestType = "" | "audio" | "font" | "image" | "script" | "style" | "track" | "video"; +type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect"; +type ScopedCredentialType = "ScopedCred"; +type ServiceWorkerState = "installing" | "installed" | "activating" | "activated" | "redundant"; +type Transport = "usb" | "nfc" | "ble"; +type VideoFacingModeEnum = "user" | "environment" | "left" | "right"; +type VisibilityState = "hidden" | "visible" | "prerender" | "unloaded"; +type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text"; \ No newline at end of file diff --git a/node_modules/typescript/lib/lib.dom.iterable.d.ts b/node_modules/typescript/lib/lib.dom.iterable.d.ts index 2b6205476..95bb1465d 100644 --- a/node_modules/typescript/lib/lib.dom.iterable.d.ts +++ b/node_modules/typescript/lib/lib.dom.iterable.d.ts @@ -1,33 +1,92 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ -/// + +/// -/// - -interface DOMTokenList { - [Symbol.iterator](): IterableIterator; -} - -interface NodeList { - [Symbol.iterator](): IterableIterator -} - -interface NodeListOf { - [Symbol.iterator](): IterableIterator -} +/// + +interface DOMTokenList { + [Symbol.iterator](): IterableIterator; +} + +interface FormData { + /** + * Returns an array of key, value pairs for every entry in the list + */ + entries(): IterableIterator<[string, string | File]>; + /** + * Returns a list of keys in the list + */ + keys(): IterableIterator; + /** + * Returns a list of values in the list + */ + values(): IterableIterator; + + [Symbol.iterator](): IterableIterator; +} + +interface NodeList { + /** + * Returns an array of key, value pairs for every entry in the list + */ + entries(): IterableIterator<[number, Node]>; + /** + * Performs the specified action for each node in an list. + * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: Node, index: number, listObj: NodeList) => void, thisArg?: any): void; + /** + * Returns an list of keys in the list + */ + keys(): IterableIterator; + + /** + * Returns an list of values in the list + */ + values(): IterableIterator; + + + [Symbol.iterator](): IterableIterator; +} + +interface NodeListOf { + + /** + * Returns an array of key, value pairs for every entry in the list + */ + entries(): IterableIterator<[number, TNode]>; + + /** + * Performs the specified action for each node in an list. + * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: TNode, index: number, listObj: NodeListOf) => void, thisArg?: any): void; + /** + * Returns an list of keys in the list + */ + keys(): IterableIterator; + /** + * Returns an list of values in the list + */ + values(): IterableIterator; + + [Symbol.iterator](): IterableIterator; +} diff --git a/node_modules/typescript/lib/lib.es2015.collection.d.ts b/node_modules/typescript/lib/lib.es2015.collection.d.ts index eabd6319d..37ebed50a 100644 --- a/node_modules/typescript/lib/lib.es2015.collection.d.ts +++ b/node_modules/typescript/lib/lib.es2015.collection.d.ts @@ -1,92 +1,92 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ -/// + +/// -interface Map { - clear(): void; - delete(key: K): boolean; - forEach(callbackfn: (value: V, key: K, map: Map) => void, thisArg?: any): void; - get(key: K): V | undefined; - has(key: K): boolean; - set(key: K, value?: V): this; - readonly size: number; -} - -interface MapConstructor { - new (): Map; - new (entries?: [K, V][]): Map; - readonly prototype: Map; -} -declare var Map: MapConstructor; - -interface ReadonlyMap { - forEach(callbackfn: (value: V, key: K, map: ReadonlyMap) => void, thisArg?: any): void; - get(key: K): V|undefined; - has(key: K): boolean; - readonly size: number; -} - -interface WeakMap { - delete(key: K): boolean; - get(key: K): V | undefined; - has(key: K): boolean; - set(key: K, value?: V): this; -} - -interface WeakMapConstructor { - new (): WeakMap; - new (entries?: [K, V][]): WeakMap; - readonly prototype: WeakMap; -} -declare var WeakMap: WeakMapConstructor; - -interface Set { - add(value: T): this; - clear(): void; - delete(value: T): boolean; - forEach(callbackfn: (value: T, value2: T, set: Set) => void, thisArg?: any): void; - has(value: T): boolean; - readonly size: number; -} - -interface SetConstructor { - new (): Set; - new (values?: T[]): Set; - readonly prototype: Set; -} -declare var Set: SetConstructor; - -interface ReadonlySet { - forEach(callbackfn: (value: T, value2: T, set: ReadonlySet) => void, thisArg?: any): void; - has(value: T): boolean; - readonly size: number; -} - -interface WeakSet { - add(value: T): this; - delete(value: T): boolean; - has(value: T): boolean; -} - -interface WeakSetConstructor { - new (): WeakSet; - new (values?: T[]): WeakSet; - readonly prototype: WeakSet; -} -declare var WeakSet: WeakSetConstructor; +interface Map { + clear(): void; + delete(key: K): boolean; + forEach(callbackfn: (value: V, key: K, map: Map) => void, thisArg?: any): void; + get(key: K): V | undefined; + has(key: K): boolean; + set(key: K, value: V): this; + readonly size: number; +} + +interface MapConstructor { + new (): Map; + new (entries?: [K, V][]): Map; + readonly prototype: Map; +} +declare var Map: MapConstructor; + +interface ReadonlyMap { + forEach(callbackfn: (value: V, key: K, map: ReadonlyMap) => void, thisArg?: any): void; + get(key: K): V | undefined; + has(key: K): boolean; + readonly size: number; +} + +interface WeakMap { + delete(key: K): boolean; + get(key: K): V | undefined; + has(key: K): boolean; + set(key: K, value: V): this; +} + +interface WeakMapConstructor { + new (): WeakMap; + new (entries?: [K, V][]): WeakMap; + readonly prototype: WeakMap; +} +declare var WeakMap: WeakMapConstructor; + +interface Set { + add(value: T): this; + clear(): void; + delete(value: T): boolean; + forEach(callbackfn: (value: T, value2: T, set: Set) => void, thisArg?: any): void; + has(value: T): boolean; + readonly size: number; +} + +interface SetConstructor { + new (): Set; + new (values?: T[]): Set; + readonly prototype: Set; +} +declare var Set: SetConstructor; + +interface ReadonlySet { + forEach(callbackfn: (value: T, value2: T, set: ReadonlySet) => void, thisArg?: any): void; + has(value: T): boolean; + readonly size: number; +} + +interface WeakSet { + add(value: T): this; + delete(value: T): boolean; + has(value: T): boolean; +} + +interface WeakSetConstructor { + new (): WeakSet; + new (values?: T[]): WeakSet; + readonly prototype: WeakSet; +} +declare var WeakSet: WeakSetConstructor; diff --git a/node_modules/typescript/lib/lib.es2015.core.d.ts b/node_modules/typescript/lib/lib.es2015.core.d.ts index 499d0de52..bf2edb82c 100644 --- a/node_modules/typescript/lib/lib.es2015.core.d.ts +++ b/node_modules/typescript/lib/lib.es2015.core.d.ts @@ -1,544 +1,554 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ -/// + +/// -declare type PropertyKey = string | number | symbol; - -interface Array { - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: T, start?: number, end?: number): this; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; -} - -interface ArrayConstructor { - /** - * Creates an array from an array-like object. - * @param arrayLike An array-like object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - - - /** - * Creates an array from an array-like object. - * @param arrayLike An array-like object to convert to an array. - */ - from(arrayLike: ArrayLike): Array; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: T[]): Array; -} - -interface DateConstructor { - new (value: Date): Date; -} - -interface Function { - /** - * Returns the name of the function. Function names are read-only and can not be changed. - */ - readonly name: string; -} - -interface Math { - /** - * Returns the number of leading zero bits in the 32-bit binary representation of a number. - * @param x A numeric expression. - */ - clz32(x: number): number; - - /** - * Returns the result of 32-bit multiplication of two numbers. - * @param x First number - * @param y Second number - */ - imul(x: number, y: number): number; - - /** - * Returns the sign of the x, indicating whether x is positive, negative or zero. - * @param x The numeric expression to test - */ - sign(x: number): number; - - /** - * Returns the base 10 logarithm of a number. - * @param x A numeric expression. - */ - log10(x: number): number; - - /** - * Returns the base 2 logarithm of a number. - * @param x A numeric expression. - */ - log2(x: number): number; - - /** - * Returns the natural logarithm of 1 + x. - * @param x A numeric expression. - */ - log1p(x: number): number; - - /** - * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of - * the natural logarithms). - * @param x A numeric expression. - */ - expm1(x: number): number; - - /** - * Returns the hyperbolic cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - cosh(x: number): number; - - /** - * Returns the hyperbolic sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - sinh(x: number): number; - - /** - * Returns the hyperbolic tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - tanh(x: number): number; - - /** - * Returns the inverse hyperbolic cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - acosh(x: number): number; - - /** - * Returns the inverse hyperbolic sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - asinh(x: number): number; - - /** - * Returns the inverse hyperbolic tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - atanh(x: number): number; - - /** - * Returns the square root of the sum of squares of its arguments. - * @param values Values to compute the square root for. - * If no arguments are passed, the result is +0. - * If there is only one argument, the result is the absolute value. - * If any argument is +Infinity or -Infinity, the result is +Infinity. - * If any argument is NaN, the result is NaN. - * If all arguments are either +0 or −0, the result is +0. - */ - hypot(...values: number[] ): number; - - /** - * Returns the integral part of the a numeric expression, x, removing any fractional digits. - * If x is already an integer, the result is x. - * @param x A numeric expression. - */ - trunc(x: number): number; - - /** - * Returns the nearest single precision float representation of a number. - * @param x A numeric expression. - */ - fround(x: number): number; - - /** - * Returns an implementation-dependent approximation to the cube root of number. - * @param x A numeric expression. - */ - cbrt(x: number): number; -} - -interface NumberConstructor { - /** - * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 - * that is representable as a Number value, which is approximately: - * 2.2204460492503130808472633361816 x 10â€âˆ’â€16. - */ - readonly EPSILON: number; - - /** - * Returns true if passed value is finite. - * Unlike the global isFinite, Number.isFinite doesn't forcibly convert the parameter to a - * number. Only finite values of the type number, result in true. - * @param number A numeric value. - */ - isFinite(number: number): boolean; - - /** - * Returns true if the value passed is an integer, false otherwise. - * @param number A numeric value. - */ - isInteger(number: number): boolean; - - /** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a - * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter - * to a number. Only values of the type number, that are also NaN, result in true. - * @param number A numeric value. - */ - isNaN(number: number): boolean; - - /** - * Returns true if the value passed is a safe integer. - * @param number A numeric value. - */ - isSafeInteger(number: number): boolean; - - /** - * The value of the largest integer n such that n and n + 1 are both exactly representable as - * a Number value. - * The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1. - */ - readonly MAX_SAFE_INTEGER: number; - - /** - * The value of the smallest integer n such that n and n − 1 are both exactly representable as - * a Number value. - * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). - */ - readonly MIN_SAFE_INTEGER: number; - - /** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. - */ - parseFloat(string: string): number; - - /** - * Converts A string to an integer. - * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. - * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. - * All other strings are considered decimal. - */ - parseInt(string: string, radix?: number): number; -} - -interface Object { - /** - * Determines whether an object has a property with the specified name. - * @param v A property name. - */ - hasOwnProperty(v: PropertyKey): boolean - - /** - * Determines whether a specified property is enumerable. - * @param v A property name. - */ - propertyIsEnumerable(v: PropertyKey): boolean; -} - -interface ObjectConstructor { - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source The source object from which to copy properties. - */ - assign(target: T, source: U): T & U; - - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source1 The first source object from which to copy properties. - * @param source2 The second source object from which to copy properties. - */ - assign(target: T, source1: U, source2: V): T & U & V; - - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source1 The first source object from which to copy properties. - * @param source2 The second source object from which to copy properties. - * @param source3 The third source object from which to copy properties. - */ - assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; - - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param sources One or more source objects from which to copy properties - */ - assign(target: any, ...sources: any[]): any; - - /** - * Returns an array of all symbol properties found directly on object o. - * @param o Object to retrieve the symbols from. - */ - getOwnPropertySymbols(o: any): symbol[]; - - /** - * Returns true if the values are the same value, false otherwise. - * @param value1 The first value. - * @param value2 The second value. - */ - is(value1: any, value2: any): boolean; - - /** - * Sets the prototype of a specified object o to object proto or null. Returns the object o. - * @param o The object to change its prototype. - * @param proto The value of the new prototype or null. - */ - setPrototypeOf(o: any, proto: any): any; - - /** - * Gets the own property descriptor of the specified object. - * An own property descriptor is one that is defined directly on the object and is not - * inherited from the object's prototype. - * @param o Object that contains the property. - * @param p Name of the property. - */ - getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor; - - /** - * Adds a property to an object, or modifies attributes of an existing property. - * @param o Object on which to add or modify the property. This can be a native JavaScript - * object (that is, a user-defined object or a built in object) or a DOM object. - * @param p The property name. - * @param attributes Descriptor for the property. It can be for a data property or an accessor - * property. - */ - defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any; -} - -interface ReadonlyArray { - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: T, index: number, obj: ReadonlyArray) => boolean, thisArg?: any): T | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): number; -} - -interface RegExp { - /** - * Returns a string indicating the flags of the regular expression in question. This field is read-only. - * The characters in this string are sequenced and concatenated in the following order: - * - * - "g" for global - * - "i" for ignoreCase - * - "m" for multiline - * - "u" for unicode - * - "y" for sticky - * - * If no flags are set, the value is the empty string. - */ - readonly flags: string; - - /** - * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular - * expression. Default is false. Read-only. - */ - readonly sticky: boolean; - - /** - * Returns a Boolean value indicating the state of the Unicode flag (u) used with a regular - * expression. Default is false. Read-only. - */ - readonly unicode: boolean; -} - -interface RegExpConstructor { - new (pattern: RegExp, flags?: string): RegExp; - (pattern: RegExp, flags?: string): RegExp; -} - -interface String { - /** - * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point - * value of the UTF-16 encoded code point starting at the string element at position pos in - * the String resulting from converting this object to a String. - * If there is no element at that position, the result is undefined. - * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. - */ - codePointAt(pos: number): number | undefined; - - /** - * Returns true if searchString appears as a substring of the result of converting this - * object to a String, at one or more positions that are - * greater than or equal to position; otherwise, returns false. - * @param searchString search string - * @param position If position is undefined, 0 is assumed, so as to search all of the String. - */ - includes(searchString: string, position?: number): boolean; - - /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * endPosition – length(this). Otherwise returns false. - */ - endsWith(searchString: string, endPosition?: number): boolean; - - /** - * Returns the String value result of normalizing the string into the normalization form - * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. - * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default - * is "NFC" - */ - normalize(form: "NFC" | "NFD" | "NFKC" | "NFKD"): string; - - /** - * Returns the String value result of normalizing the string into the normalization form - * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. - * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default - * is "NFC" - */ - normalize(form?: string): string; - - /** - * Returns a String value that is made from count copies appended together. If count is 0, - * T is the empty String is returned. - * @param count number of copies to append - */ - repeat(count: number): string; - - /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * position. Otherwise returns false. - */ - startsWith(searchString: string, position?: number): boolean; - - /** - * Returns an HTML anchor element and sets the name attribute to the text value - * @param name - */ - anchor(name: string): string; - - /** Returns a HTML element */ - big(): string; - - /** Returns a HTML element */ - blink(): string; - - /** Returns a HTML element */ - bold(): string; - - /** Returns a HTML element */ - fixed(): string - - /** Returns a HTML element and sets the color attribute value */ - fontcolor(color: string): string - - /** Returns a HTML element and sets the size attribute value */ - fontsize(size: number): string; - - /** Returns a HTML element and sets the size attribute value */ - fontsize(size: string): string; - - /** Returns an HTML element */ - italics(): string; - - /** Returns an HTML element and sets the href attribute value */ - link(url: string): string; - - /** Returns a HTML element */ - small(): string; - - /** Returns a HTML element */ - strike(): string; - - /** Returns a HTML element */ - sub(): string; - - /** Returns a HTML element */ - sup(): string; -} - -interface StringConstructor { - /** - * Return the String value whose elements are, in order, the elements in the List elements. - * If length is 0, the empty string is returned. - */ - fromCodePoint(...codePoints: number[]): string; - - /** - * String.raw is intended for use as a tag function of a Tagged Template String. When called - * as such the first argument will be a well formed template call site object and the rest - * parameter will contain the substitution values. - * @param template A well-formed template string call site representation. - * @param substitutions A set of substitution values. - */ - raw(template: TemplateStringsArray, ...substitutions: any[]): string; -} +declare type PropertyKey = string | number | symbol; + +interface Array { + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: T, index: number, obj: Array) => boolean): T | undefined; + find(predicate: (this: void, value: T, index: number, obj: Array) => boolean, thisArg: undefined): T | undefined; + find(predicate: (this: Z, value: T, index: number, obj: Array) => boolean, thisArg: Z): T | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: T, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: T, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: T, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: T, start?: number, end?: number): this; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; +} + +interface ArrayConstructor { + /** + * Creates an array from an array-like object. + * @param arrayLike An array-like object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: T, k: number) => U): Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: T, k: number) => U, thisArg: undefined): Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: T, k: number) => U, thisArg: Z): Array; + + + /** + * Creates an array from an array-like object. + * @param arrayLike An array-like object to convert to an array. + */ + from(arrayLike: ArrayLike): Array; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: T[]): Array; +} + +interface DateConstructor { + new (value: Date): Date; +} + +interface Function { + /** + * Returns the name of the function. Function names are read-only and can not be changed. + */ + readonly name: string; +} + +interface Math { + /** + * Returns the number of leading zero bits in the 32-bit binary representation of a number. + * @param x A numeric expression. + */ + clz32(x: number): number; + + /** + * Returns the result of 32-bit multiplication of two numbers. + * @param x First number + * @param y Second number + */ + imul(x: number, y: number): number; + + /** + * Returns the sign of the x, indicating whether x is positive, negative or zero. + * @param x The numeric expression to test + */ + sign(x: number): number; + + /** + * Returns the base 10 logarithm of a number. + * @param x A numeric expression. + */ + log10(x: number): number; + + /** + * Returns the base 2 logarithm of a number. + * @param x A numeric expression. + */ + log2(x: number): number; + + /** + * Returns the natural logarithm of 1 + x. + * @param x A numeric expression. + */ + log1p(x: number): number; + + /** + * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of + * the natural logarithms). + * @param x A numeric expression. + */ + expm1(x: number): number; + + /** + * Returns the hyperbolic cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + cosh(x: number): number; + + /** + * Returns the hyperbolic sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + sinh(x: number): number; + + /** + * Returns the hyperbolic tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + tanh(x: number): number; + + /** + * Returns the inverse hyperbolic cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + acosh(x: number): number; + + /** + * Returns the inverse hyperbolic sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + asinh(x: number): number; + + /** + * Returns the inverse hyperbolic tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + atanh(x: number): number; + + /** + * Returns the square root of the sum of squares of its arguments. + * @param values Values to compute the square root for. + * If no arguments are passed, the result is +0. + * If there is only one argument, the result is the absolute value. + * If any argument is +Infinity or -Infinity, the result is +Infinity. + * If any argument is NaN, the result is NaN. + * If all arguments are either +0 or −0, the result is +0. + */ + hypot(...values: number[] ): number; + + /** + * Returns the integral part of the a numeric expression, x, removing any fractional digits. + * If x is already an integer, the result is x. + * @param x A numeric expression. + */ + trunc(x: number): number; + + /** + * Returns the nearest single precision float representation of a number. + * @param x A numeric expression. + */ + fround(x: number): number; + + /** + * Returns an implementation-dependent approximation to the cube root of number. + * @param x A numeric expression. + */ + cbrt(x: number): number; +} + +interface NumberConstructor { + /** + * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 + * that is representable as a Number value, which is approximately: + * 2.2204460492503130808472633361816 x 10â€âˆ’â€16. + */ + readonly EPSILON: number; + + /** + * Returns true if passed value is finite. + * Unlike the global isFinite, Number.isFinite doesn't forcibly convert the parameter to a + * number. Only finite values of the type number, result in true. + * @param number A numeric value. + */ + isFinite(number: number): boolean; + + /** + * Returns true if the value passed is an integer, false otherwise. + * @param number A numeric value. + */ + isInteger(number: number): boolean; + + /** + * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a + * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter + * to a number. Only values of the type number, that are also NaN, result in true. + * @param number A numeric value. + */ + isNaN(number: number): boolean; + + /** + * Returns true if the value passed is a safe integer. + * @param number A numeric value. + */ + isSafeInteger(number: number): boolean; + + /** + * The value of the largest integer n such that n and n + 1 are both exactly representable as + * a Number value. + * The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1. + */ + readonly MAX_SAFE_INTEGER: number; + + /** + * The value of the smallest integer n such that n and n − 1 are both exactly representable as + * a Number value. + * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). + */ + readonly MIN_SAFE_INTEGER: number; + + /** + * Converts a string to a floating-point number. + * @param string A string that contains a floating-point number. + */ + parseFloat(string: string): number; + + /** + * Converts A string to an integer. + * @param s A string to convert into a number. + * @param radix A value between 2 and 36 that specifies the base of the number in numString. + * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. + * All other strings are considered decimal. + */ + parseInt(string: string, radix?: number): number; +} + +interface Object { + /** + * Determines whether an object has a property with the specified name. + * @param v A property name. + */ + hasOwnProperty(v: PropertyKey): boolean; + + /** + * Determines whether a specified property is enumerable. + * @param v A property name. + */ + propertyIsEnumerable(v: PropertyKey): boolean; +} + +interface ObjectConstructor { + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param source The source object from which to copy properties. + */ + assign(target: T, source: U): T & U; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param source1 The first source object from which to copy properties. + * @param source2 The second source object from which to copy properties. + */ + assign(target: T, source1: U, source2: V): T & U & V; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param source1 The first source object from which to copy properties. + * @param source2 The second source object from which to copy properties. + * @param source3 The third source object from which to copy properties. + */ + assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param sources One or more source objects from which to copy properties + */ + assign(target: object, ...sources: any[]): any; + + /** + * Returns an array of all symbol properties found directly on object o. + * @param o Object to retrieve the symbols from. + */ + getOwnPropertySymbols(o: any): symbol[]; + + /** + * Returns true if the values are the same value, false otherwise. + * @param value1 The first value. + * @param value2 The second value. + */ + is(value1: any, value2: any): boolean; + + /** + * Sets the prototype of a specified object o to object proto or null. Returns the object o. + * @param o The object to change its prototype. + * @param proto The value of the new prototype or null. + */ + setPrototypeOf(o: any, proto: object | null): any; + + /** + * Gets the own property descriptor of the specified object. + * An own property descriptor is one that is defined directly on the object and is not + * inherited from the object's prototype. + * @param o Object that contains the property. + * @param p Name of the property. + */ + getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor; + + /** + * Adds a property to an object, or modifies attributes of an existing property. + * @param o Object on which to add or modify the property. This can be a native JavaScript + * object (that is, a user-defined object or a built in object) or a DOM object. + * @param p The property name. + * @param attributes Descriptor for the property. It can be for a data property or an accessor + * property. + */ + defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any; +} + +interface ReadonlyArray { + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: T, index: number, obj: ReadonlyArray) => boolean): T | undefined; + find(predicate: (this: void, value: T, index: number, obj: ReadonlyArray) => boolean, thisArg: undefined): T | undefined; + find(predicate: (this: Z, value: T, index: number, obj: ReadonlyArray) => boolean, thisArg: Z): T | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: T, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: T, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: T, index: number, obj: Array) => boolean, thisArg: Z): number; +} + +interface RegExp { + /** + * Returns a string indicating the flags of the regular expression in question. This field is read-only. + * The characters in this string are sequenced and concatenated in the following order: + * + * - "g" for global + * - "i" for ignoreCase + * - "m" for multiline + * - "u" for unicode + * - "y" for sticky + * + * If no flags are set, the value is the empty string. + */ + readonly flags: string; + + /** + * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular + * expression. Default is false. Read-only. + */ + readonly sticky: boolean; + + /** + * Returns a Boolean value indicating the state of the Unicode flag (u) used with a regular + * expression. Default is false. Read-only. + */ + readonly unicode: boolean; +} + +interface RegExpConstructor { + new (pattern: RegExp, flags?: string): RegExp; + (pattern: RegExp, flags?: string): RegExp; +} + +interface String { + /** + * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point + * value of the UTF-16 encoded code point starting at the string element at position pos in + * the String resulting from converting this object to a String. + * If there is no element at that position, the result is undefined. + * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. + */ + codePointAt(pos: number): number | undefined; + + /** + * Returns true if searchString appears as a substring of the result of converting this + * object to a String, at one or more positions that are + * greater than or equal to position; otherwise, returns false. + * @param searchString search string + * @param position If position is undefined, 0 is assumed, so as to search all of the String. + */ + includes(searchString: string, position?: number): boolean; + + /** + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at + * endPosition – length(this). Otherwise returns false. + */ + endsWith(searchString: string, endPosition?: number): boolean; + + /** + * Returns the String value result of normalizing the string into the normalization form + * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. + * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default + * is "NFC" + */ + normalize(form: "NFC" | "NFD" | "NFKC" | "NFKD"): string; + + /** + * Returns the String value result of normalizing the string into the normalization form + * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. + * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default + * is "NFC" + */ + normalize(form?: string): string; + + /** + * Returns a String value that is made from count copies appended together. If count is 0, + * T is the empty String is returned. + * @param count number of copies to append + */ + repeat(count: number): string; + + /** + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at + * position. Otherwise returns false. + */ + startsWith(searchString: string, position?: number): boolean; + + /** + * Returns an HTML anchor element and sets the name attribute to the text value + * @param name + */ + anchor(name: string): string; + + /** Returns a HTML element */ + big(): string; + + /** Returns a HTML element */ + blink(): string; + + /** Returns a HTML element */ + bold(): string; + + /** Returns a HTML element */ + fixed(): string; + + /** Returns a HTML element and sets the color attribute value */ + fontcolor(color: string): string; + + /** Returns a HTML element and sets the size attribute value */ + fontsize(size: number): string; + + /** Returns a HTML element and sets the size attribute value */ + fontsize(size: string): string; + + /** Returns an HTML element */ + italics(): string; + + /** Returns an HTML element and sets the href attribute value */ + link(url: string): string; + + /** Returns a HTML element */ + small(): string; + + /** Returns a HTML element */ + strike(): string; + + /** Returns a HTML element */ + sub(): string; + + /** Returns a HTML element */ + sup(): string; +} + +interface StringConstructor { + /** + * Return the String value whose elements are, in order, the elements in the List elements. + * If length is 0, the empty string is returned. + */ + fromCodePoint(...codePoints: number[]): string; + + /** + * String.raw is intended for use as a tag function of a Tagged Template String. When called + * as such the first argument will be a well formed template call site object and the rest + * parameter will contain the substitution values. + * @param template A well-formed template string call site representation. + * @param substitutions A set of substitution values. + */ + raw(template: TemplateStringsArray, ...substitutions: any[]): string; +} diff --git a/node_modules/typescript/lib/lib.es2015.d.ts b/node_modules/typescript/lib/lib.es2015.d.ts index ff5c555bf..a536e9c89 100644 --- a/node_modules/typescript/lib/lib.es2015.d.ts +++ b/node_modules/typescript/lib/lib.es2015.d.ts @@ -1,30 +1,30 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ -/// + +/// -/// -/// -/// -/// -/// -/// -/// -/// -/// +/// +/// +/// +/// +/// +/// +/// +/// +/// /// \ No newline at end of file diff --git a/node_modules/typescript/lib/lib.es2015.generator.d.ts b/node_modules/typescript/lib/lib.es2015.generator.d.ts index 20d6725f6..d331a58b5 100644 --- a/node_modules/typescript/lib/lib.es2015.generator.d.ts +++ b/node_modules/typescript/lib/lib.es2015.generator.d.ts @@ -1,32 +1,72 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ -/// + +/// -interface GeneratorFunction extends Function { } - -interface GeneratorFunctionConstructor { - /** - * Creates a new Generator function. - * @param args A list of arguments the function accepts. - */ - new (...args: string[]): GeneratorFunction; - (...args: string[]): GeneratorFunction; - readonly prototype: GeneratorFunction; -} -declare var GeneratorFunction: GeneratorFunctionConstructor; +interface Generator extends Iterator { } + +interface GeneratorFunction { + /** + * Creates a new Generator object. + * @param args A list of arguments the function accepts. + */ + new (...args: any[]): Generator; + /** + * Creates a new Generator object. + * @param args A list of arguments the function accepts. + */ + (...args: any[]): Generator; + /** + * The length of the arguments. + */ + readonly length: number; + /** + * Returns the name of the function. + */ + readonly name: string; + /** + * A reference to the prototype. + */ + readonly prototype: Generator; +} + +interface GeneratorFunctionConstructor { + /** + * Creates a new Generator function. + * @param args A list of arguments the function accepts. + */ + new (...args: string[]): GeneratorFunction; + /** + * Creates a new Generator function. + * @param args A list of arguments the function accepts. + */ + (...args: string[]): GeneratorFunction; + /** + * The length of the arguments. + */ + readonly length: number; + /** + * Returns the name of the function. + */ + readonly name: string; + /** + * A reference to the prototype. + */ + readonly prototype: GeneratorFunction; +} +declare var GeneratorFunction: GeneratorFunctionConstructor; diff --git a/node_modules/typescript/lib/lib.es2015.iterable.d.ts b/node_modules/typescript/lib/lib.es2015.iterable.d.ts index cb92cb4b8..e083a89f7 100644 --- a/node_modules/typescript/lib/lib.es2015.iterable.d.ts +++ b/node_modules/typescript/lib/lib.es2015.iterable.d.ts @@ -1,465 +1,503 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ -/// + +/// -/// - -interface SymbolConstructor { - /** - * A method that returns the default iterator for an object. Called by the semantics of the - * for-of statement. - */ - readonly iterator: symbol; -} - -interface IteratorResult { - done: boolean; - value: T; -} - -interface Iterator { - next(value?: any): IteratorResult; - return?(value?: any): IteratorResult; - throw?(e?: any): IteratorResult; -} - -interface Iterable { - [Symbol.iterator](): Iterator; -} - -interface IterableIterator extends Iterator { - [Symbol.iterator](): IterableIterator; -} - -interface Array { - /** Iterator */ - [Symbol.iterator](): IterableIterator; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, T]>; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface ArrayConstructor { - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - */ - from(iterable: Iterable): Array; -} - -interface ReadonlyArray { - /** Iterator */ - [Symbol.iterator](): IterableIterator; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, T]>; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface IArguments { - /** Iterator */ - [Symbol.iterator](): IterableIterator; -} - -interface Map { - [Symbol.iterator](): IterableIterator<[K,V]>; - entries(): IterableIterator<[K, V]>; - keys(): IterableIterator; - values(): IterableIterator; -} - -interface MapConstructor { - new (iterable: Iterable<[K, V]>): Map; -} - -interface WeakMap { } - -interface WeakMapConstructor { - new (iterable: Iterable<[K, V]>): WeakMap; -} - -interface Set { - [Symbol.iterator](): IterableIterator; - entries(): IterableIterator<[T, T]>; - keys(): IterableIterator; - values(): IterableIterator; -} - -interface SetConstructor { - new (iterable: Iterable): Set; -} - -interface WeakSet { } - -interface WeakSetConstructor { - new (iterable: Iterable): WeakSet; -} - -interface Promise { } - -interface PromiseConstructor { - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: Iterable>): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: Iterable>): Promise; -} - -declare namespace Reflect { - function enumerate(target: any): IterableIterator; -} - -interface String { - /** Iterator */ - [Symbol.iterator](): IterableIterator; -} - -/** - * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Int8Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Int8ArrayConstructor { - new (elements: Iterable): Int8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; -} - -/** - * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Uint8ArrayConstructor { - new (elements: Iterable): Uint8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; -} - -/** - * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. - * If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8ClampedArray { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Uint8ClampedArrayConstructor { - new (elements: Iterable): Uint8ClampedArray; - - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; -} - -/** - * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int16Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Int16ArrayConstructor { - new (elements: Iterable): Int16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; -} - -/** - * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint16Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Uint16ArrayConstructor { - new (elements: Iterable): Uint16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; -} - -/** - * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int32Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Int32ArrayConstructor { - new (elements: Iterable): Int32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; -} - -/** - * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint32Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Uint32ArrayConstructor { - new (elements: Iterable): Uint32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; -} - -/** - * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number - * of bytes could not be allocated an exception is raised. - */ -interface Float32Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Float32ArrayConstructor { - new (elements: Iterable): Float32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; -} - -/** - * A typed array of 64-bit float values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Float64Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Float64ArrayConstructor { - new (elements: Iterable): Float64Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; -} \ No newline at end of file +/// + +interface SymbolConstructor { + /** + * A method that returns the default iterator for an object. Called by the semantics of the + * for-of statement. + */ + readonly iterator: symbol; +} + +interface IteratorResult { + done: boolean; + value: T; +} + +interface Iterator { + next(value?: any): IteratorResult; + return?(value?: any): IteratorResult; + throw?(e?: any): IteratorResult; +} + +interface Iterable { + [Symbol.iterator](): Iterator; +} + +interface IterableIterator extends Iterator { + [Symbol.iterator](): IterableIterator; +} + +interface Array { + /** Iterator */ + [Symbol.iterator](): IterableIterator; + + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, T]>; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface ArrayConstructor { + /** + * Creates an array from an iterable object. + * @param iterable An iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(iterable: Iterable, mapfn: (this: void, v: T, k: number) => U): Array; + from(iterable: Iterable, mapfn: (this: void, v: T, k: number) => U, thisArg: undefined): Array; + from(iterable: Iterable, mapfn: (this: Z, v: T, k: number) => U, thisArg: Z): Array; + + /** + * Creates an array from an iterable object. + * @param iterable An iterable object to convert to an array. + */ + from(iterable: Iterable): Array; +} + +interface ReadonlyArray { + /** Iterator */ + [Symbol.iterator](): IterableIterator; + + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, T]>; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface IArguments { + /** Iterator */ + [Symbol.iterator](): IterableIterator; +} + +interface Map { + [Symbol.iterator](): IterableIterator<[K, V]>; + entries(): IterableIterator<[K, V]>; + keys(): IterableIterator; + values(): IterableIterator; +} + +interface MapConstructor { + new (iterable: Iterable<[K, V]>): Map; +} + +interface WeakMap { } + +interface WeakMapConstructor { + new (iterable: Iterable<[K, V]>): WeakMap; +} + +interface Set { + [Symbol.iterator](): IterableIterator; + entries(): IterableIterator<[T, T]>; + keys(): IterableIterator; + values(): IterableIterator; +} + +interface SetConstructor { + new (iterable: Iterable): Set; +} + +interface WeakSet { } + +interface WeakSetConstructor { + new (iterable: Iterable): WeakSet; +} + +interface Promise { } + +interface PromiseConstructor { + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: Iterable>): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: Iterable>): Promise; +} + +declare namespace Reflect { + function enumerate(target: object): IterableIterator; +} + +interface String { + /** Iterator */ + [Symbol.iterator](): IterableIterator; +} + +/** + * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Int8Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Int8ArrayConstructor { + new (elements: Iterable): Int8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Int8Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int8Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int8Array; + + from(arrayLike: Iterable): Int8Array; +} + +/** + * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint8ArrayConstructor { + new (elements: Iterable): Uint8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Uint8Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8Array; + + from(arrayLike: Iterable): Uint8Array; +} + +/** + * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. + * If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8ClampedArray { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint8ClampedArrayConstructor { + new (elements: Iterable): Uint8ClampedArray; + + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Uint8ClampedArray; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8ClampedArray; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8ClampedArray; + + from(arrayLike: Iterable): Uint8ClampedArray; +} + +/** + * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int16Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Int16ArrayConstructor { + new (elements: Iterable): Int16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Int16Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int16Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int16Array; + + from(arrayLike: Iterable): Int16Array; +} + +/** + * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint16Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint16ArrayConstructor { + new (elements: Iterable): Uint16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Uint16Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint16Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint16Array; + + from(arrayLike: Iterable): Uint16Array; +} + +/** + * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int32Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Int32ArrayConstructor { + new (elements: Iterable): Int32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Int32Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int32Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int32Array; + + from(arrayLike: Iterable): Int32Array; +} + +/** + * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint32Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint32ArrayConstructor { + new (elements: Iterable): Uint32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Uint32Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint32Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint32Array; + + from(arrayLike: Iterable): Uint32Array; +} + +/** + * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number + * of bytes could not be allocated an exception is raised. + */ +interface Float32Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Float32ArrayConstructor { + new (elements: Iterable): Float32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Float32Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float32Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float32Array; + + from(arrayLike: Iterable): Float32Array; +} + +/** + * A typed array of 64-bit float values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Float64Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Float64ArrayConstructor { + new (elements: Iterable): Float64Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Float64Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float64Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float64Array; + + from(arrayLike: Iterable): Float64Array; +} diff --git a/node_modules/typescript/lib/lib.es2015.promise.d.ts b/node_modules/typescript/lib/lib.es2015.promise.d.ts index 02352da40..81118e89d 100644 --- a/node_modules/typescript/lib/lib.es2015.promise.d.ts +++ b/node_modules/typescript/lib/lib.es2015.promise.d.ts @@ -1,274 +1,223 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ -/// + +/// -/** - * Represents the completion of an asynchronous operation - */ -interface Promise { - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: ((value: T) => T | PromiseLike) | undefined | null, onrejected?: ((reason: any) => T | PromiseLike) | undefined | null): Promise; - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled: ((value: T) => T | PromiseLike) | undefined | null, onrejected: (reason: any) => TResult | PromiseLike): Promise; - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled: (value: T) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled: (value: T) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; - - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected?: ((reason: any) => T | PromiseLike) | undefined | null): Promise; - - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected: (reason: any) => TResult | PromiseLike): Promise; -} - -interface PromiseConstructor { - /** - * A reference to the prototype. - */ - readonly prototype: Promise; - - /** - * Creates a new Promise. - * @param executor A callback used to initialize the promise. This callback is passed two arguments: - * a resolve callback used resolve the promise with a value or the result of another promise, - * and a reject callback used to reject the promise with a provided reason or error. - */ - new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: (T | PromiseLike)[]): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: (T | PromiseLike)[]): Promise; - - /** - * Creates a new rejected promise for the provided reason. - * @param reason The reason the promise was rejected. - * @returns A new rejected Promise. - */ - reject(reason: any): Promise; - - /** - * Creates a new rejected promise for the provided reason. - * @param reason The reason the promise was rejected. - * @returns A new rejected Promise. - */ - reject(reason: any): Promise; - - /** - * Creates a new resolved promise for the provided value. - * @param value A promise. - * @returns A promise whose internal state matches the provided promise. - */ - resolve(value: T | PromiseLike): Promise; - - /** - * Creates a new resolved promise . - * @returns A resolved promise. - */ - resolve(): Promise; -} - +interface PromiseConstructor { + /** + * A reference to the prototype. + */ + readonly prototype: Promise; + + /** + * Creates a new Promise. + * @param executor A callback used to initialize the promise. This callback is passed two arguments: + * a resolve callback used resolve the promise with a value or the result of another promise, + * and a reject callback used to reject the promise with a provided reason or error. + */ + new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: (T | PromiseLike)[]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: (T | PromiseLike)[]): Promise; + + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected Promise. + */ + reject(reason: any): Promise; + + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected Promise. + */ + reject(reason: any): Promise; + + /** + * Creates a new resolved promise for the provided value. + * @param value A promise. + * @returns A promise whose internal state matches the provided promise. + */ + resolve(value: T | PromiseLike): Promise; + + /** + * Creates a new resolved promise . + * @returns A resolved promise. + */ + resolve(): Promise; +} + declare var Promise: PromiseConstructor; \ No newline at end of file diff --git a/node_modules/typescript/lib/lib.es2015.proxy.d.ts b/node_modules/typescript/lib/lib.es2015.proxy.d.ts index 6f01f10bf..29b12d91e 100644 --- a/node_modules/typescript/lib/lib.es2015.proxy.d.ts +++ b/node_modules/typescript/lib/lib.es2015.proxy.d.ts @@ -1,42 +1,42 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ -/// + +/// -interface ProxyHandler { - getPrototypeOf? (target: T): {} | null; - setPrototypeOf? (target: T, v: any): boolean; - isExtensible? (target: T): boolean; - preventExtensions? (target: T): boolean; - getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor; - has? (target: T, p: PropertyKey): boolean; - get? (target: T, p: PropertyKey, receiver: any): any; - set? (target: T, p: PropertyKey, value: any, receiver: any): boolean; - deleteProperty? (target: T, p: PropertyKey): boolean; - defineProperty? (target: T, p: PropertyKey, attributes: PropertyDescriptor): boolean; - enumerate? (target: T): PropertyKey[]; - ownKeys? (target: T): PropertyKey[]; - apply? (target: T, thisArg: any, argArray?: any): any; - construct? (target: T, argArray: any, newTarget?: any): {}; -} - -interface ProxyConstructor { - revocable(target: T, handler: ProxyHandler): { proxy: T; revoke: () => void; }; - new (target: T, handler: ProxyHandler): T -} -declare var Proxy: ProxyConstructor; +interface ProxyHandler { + getPrototypeOf? (target: T): object | null; + setPrototypeOf? (target: T, v: any): boolean; + isExtensible? (target: T): boolean; + preventExtensions? (target: T): boolean; + getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor; + has? (target: T, p: PropertyKey): boolean; + get? (target: T, p: PropertyKey, receiver: any): any; + set? (target: T, p: PropertyKey, value: any, receiver: any): boolean; + deleteProperty? (target: T, p: PropertyKey): boolean; + defineProperty? (target: T, p: PropertyKey, attributes: PropertyDescriptor): boolean; + enumerate? (target: T): PropertyKey[]; + ownKeys? (target: T): PropertyKey[]; + apply? (target: T, thisArg: any, argArray?: any): any; + construct? (target: T, argArray: any, newTarget?: any): object; +} + +interface ProxyConstructor { + revocable(target: T, handler: ProxyHandler): { proxy: T; revoke: () => void; }; + new (target: T, handler: ProxyHandler): T; +} +declare var Proxy: ProxyConstructor; diff --git a/node_modules/typescript/lib/lib.es2015.reflect.d.ts b/node_modules/typescript/lib/lib.es2015.reflect.d.ts index b6a685345..2bea5f1e5 100644 --- a/node_modules/typescript/lib/lib.es2015.reflect.d.ts +++ b/node_modules/typescript/lib/lib.es2015.reflect.d.ts @@ -1,35 +1,35 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ -/// + +/// -declare namespace Reflect { - function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; - function construct(target: Function, argumentsList: ArrayLike, newTarget?: any): any; - function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; - function deleteProperty(target: any, propertyKey: PropertyKey): boolean; - function get(target: any, propertyKey: PropertyKey, receiver?: any): any; - function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; - function getPrototypeOf(target: any): any; - function has(target: any, propertyKey: PropertyKey): boolean; - function isExtensible(target: any): boolean; - function ownKeys(target: any): Array; - function preventExtensions(target: any): boolean; - function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; - function setPrototypeOf(target: any, proto: any): boolean; -} \ No newline at end of file +declare namespace Reflect { + function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; + function construct(target: Function, argumentsList: ArrayLike, newTarget?: any): any; + function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; + function deleteProperty(target: object, propertyKey: PropertyKey): boolean; + function get(target: object, propertyKey: PropertyKey, receiver?: any): any; + function getOwnPropertyDescriptor(target: object, propertyKey: PropertyKey): PropertyDescriptor; + function getPrototypeOf(target: object): object; + function has(target: object, propertyKey: PropertyKey): boolean; + function isExtensible(target: object): boolean; + function ownKeys(target: object): Array; + function preventExtensions(target: object): boolean; + function set(target: object, propertyKey: PropertyKey, value: any, receiver?: any): boolean; + function setPrototypeOf(target: object, proto: any): boolean; +} diff --git a/node_modules/typescript/lib/lib.es2015.symbol.d.ts b/node_modules/typescript/lib/lib.es2015.symbol.d.ts index c0474aec0..a9cce3309 100644 --- a/node_modules/typescript/lib/lib.es2015.symbol.d.ts +++ b/node_modules/typescript/lib/lib.es2015.symbol.d.ts @@ -1,56 +1,56 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ -/// + +/// -interface Symbol { - /** Returns a string representation of an object. */ - toString(): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): Object; -} - -interface SymbolConstructor { - /** - * A reference to the prototype. - */ - readonly prototype: Symbol; - - /** - * Returns a new unique Symbol value. - * @param description Description of the new Symbol object. - */ - (description?: string|number): symbol; - - /** - * Returns a Symbol object from the global symbol registry matching the given key if found. - * Otherwise, returns a new symbol with this key. - * @param key key to search for. - */ - for(key: string): symbol; - - /** - * Returns a key from the global symbol registry matching the given Symbol if found. - * Otherwise, returns a undefined. - * @param sym Symbol to find the key for. - */ - keyFor(sym: symbol): string | undefined; -} - +interface Symbol { + /** Returns a string representation of an object. */ + toString(): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): symbol; +} + +interface SymbolConstructor { + /** + * A reference to the prototype. + */ + readonly prototype: Symbol; + + /** + * Returns a new unique Symbol value. + * @param description Description of the new Symbol object. + */ + (description?: string | number): symbol; + + /** + * Returns a Symbol object from the global symbol registry matching the given key if found. + * Otherwise, returns a new symbol with this key. + * @param key key to search for. + */ + for(key: string): symbol; + + /** + * Returns a key from the global symbol registry matching the given Symbol if found. + * Otherwise, returns a undefined. + * @param sym Symbol to find the key for. + */ + keyFor(sym: symbol): string | undefined; +} + declare var Symbol: SymbolConstructor; \ No newline at end of file diff --git a/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts b/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts index 42299fe7d..869da0561 100644 --- a/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +++ b/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts @@ -1,347 +1,347 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ -/// + +/// -/// - -interface SymbolConstructor { - /** - * A method that determines if a constructor object recognizes an object as one of the - * constructor’s instances. Called by the semantics of the instanceof operator. - */ - readonly hasInstance: symbol; - - /** - * A Boolean value that if true indicates that an object should flatten to its array elements - * by Array.prototype.concat. - */ - readonly isConcatSpreadable: symbol; - - /** - * A regular expression method that matches the regular expression against a string. Called - * by the String.prototype.match method. - */ - readonly match: symbol; - - /** - * A regular expression method that replaces matched substrings of a string. Called by the - * String.prototype.replace method. - */ - readonly replace: symbol; - - /** - * A regular expression method that returns the index within a string that matches the - * regular expression. Called by the String.prototype.search method. - */ - readonly search: symbol; - - /** - * A function valued property that is the constructor function that is used to create - * derived objects. - */ - readonly species: symbol; - - /** - * A regular expression method that splits a string at the indices that match the regular - * expression. Called by the String.prototype.split method. - */ - readonly split: symbol; - - /** - * A method that converts an object to a corresponding primitive value. - * Called by the ToPrimitive abstract operation. - */ - readonly toPrimitive: symbol; - - /** - * A String value that is used in the creation of the default string description of an object. - * Called by the built-in method Object.prototype.toString. - */ - readonly toStringTag: symbol; - - /** - * An Object whose own property names are property names that are excluded from the 'with' - * environment bindings of the associated objects. - */ - readonly unscopables: symbol; -} - -interface Symbol { - readonly [Symbol.toStringTag]: "Symbol"; -} - -interface Array { - /** - * Returns an object whose properties have the value 'true' - * when they will be absent when used in a 'with' statement. - */ - [Symbol.unscopables](): { - copyWithin: boolean; - entries: boolean; - fill: boolean; - find: boolean; - findIndex: boolean; - keys: boolean; - values: boolean; - }; -} - -interface Date { - /** - * Converts a Date object to a string. - */ - [Symbol.toPrimitive](hint: "default"): string; - /** - * Converts a Date object to a string. - */ - [Symbol.toPrimitive](hint: "string"): string; - /** - * Converts a Date object to a number. - */ - [Symbol.toPrimitive](hint: "number"): number; - /** - * Converts a Date object to a string or number. - * - * @param hint The strings "number", "string", or "default" to specify what primitive to return. - * - * @throws {TypeError} If 'hint' was given something other than "number", "string", or "default". - * @returns A number if 'hint' was "number", a string if 'hint' was "string" or "default". - */ - [Symbol.toPrimitive](hint: string): string | number; -} - -interface Map { - readonly [Symbol.toStringTag]: "Map"; -} - -interface WeakMap{ - readonly [Symbol.toStringTag]: "WeakMap"; -} - -interface Set { - readonly [Symbol.toStringTag]: "Set"; -} - -interface WeakSet { - readonly [Symbol.toStringTag]: "WeakSet"; -} - -interface JSON { - readonly [Symbol.toStringTag]: "JSON"; -} - -interface Function { - /** - * Determines whether the given value inherits from this function if this function was used - * as a constructor function. - * - * A constructor function can control which objects are recognized as its instances by - * 'instanceof' by overriding this method. - */ - [Symbol.hasInstance](value: any): boolean; -} - -interface GeneratorFunction extends Function { - readonly [Symbol.toStringTag]: "GeneratorFunction"; -} - -interface Math { - readonly [Symbol.toStringTag]: "Math"; -} - -interface Promise { - readonly [Symbol.toStringTag]: "Promise"; -} - -interface PromiseConstructor { - readonly [Symbol.species]: Function; -} - -interface RegExp { - /** - * Matches a string with this regular expression, and returns an array containing the results of - * that search. - * @param string A string to search within. - */ - [Symbol.match](string: string): RegExpMatchArray | null; - - /** - * Replaces text in a string, using this regular expression. - * @param string A String object or string literal whose contents matching against - * this regular expression will be replaced - * @param replaceValue A String object or string literal containing the text to replace for every - * successful match of this regular expression. - */ - [Symbol.replace](string: string, replaceValue: string): string; - - /** - * Replaces text in a string, using this regular expression. - * @param string A String object or string literal whose contents matching against - * this regular expression will be replaced - * @param replacer A function that returns the replacement text. - */ - [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; - - /** - * Finds the position beginning first substring match in a regular expression search - * using this regular expression. - * - * @param string The string to search within. - */ - [Symbol.search](string: string): number; - - /** - * Returns an array of substrings that were delimited by strings in the original input that - * match against this regular expression. - * - * If the regular expression contains capturing parentheses, then each time this - * regular expression matches, the results (including any undefined results) of the - * capturing parentheses are spliced. - * - * @param string string value to split - * @param limit if not undefined, the output array is truncated so that it contains no more - * than 'limit' elements. - */ - [Symbol.split](string: string, limit?: number): string[]; -} - -interface RegExpConstructor { - [Symbol.species](): RegExpConstructor; -} - -interface String { - /** - * Matches a string an object that supports being matched against, and returns an array containing the results of that search. - * @param matcher An object that supports being matched against. - */ - match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null; - - /** - * Replaces text in a string, using an object that supports replacement within a string. - * @param searchValue A object can search for and replace matches within a string. - * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. - */ - replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string; - - /** - * Replaces text in a string, using an object that supports replacement within a string. - * @param searchValue A object can search for and replace matches within a string. - * @param replacer A function that returns the replacement text. - */ - replace(searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string; - - /** - * Finds the first substring match in a regular expression search. - * @param searcher An object which supports searching within a string. - */ - search(searcher: { [Symbol.search](string: string): number; }): number; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param splitter An object that can split a string. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number): string[]; -} - -/** - * Represents a raw buffer of binary data, which is used to store data for the - * different typed arrays. ArrayBuffers cannot be read from or written to directly, - * but can be passed to a typed array or DataView Object to interpret the raw - * buffer as needed. - */ -interface ArrayBuffer { - readonly [Symbol.toStringTag]: "ArrayBuffer"; -} - -interface DataView { - readonly [Symbol.toStringTag]: "DataView"; -} - -/** - * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Int8Array { - readonly [Symbol.toStringTag]: "Int8Array"; -} - -/** - * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8Array { - readonly [Symbol.toStringTag]: "UInt8Array"; -} - -/** - * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. - * If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8ClampedArray { - readonly [Symbol.toStringTag]: "Uint8ClampedArray"; -} - -/** - * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int16Array { - readonly [Symbol.toStringTag]: "Int16Array"; -} - -/** - * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint16Array { - readonly [Symbol.toStringTag]: "Uint16Array"; -} - -/** - * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int32Array { - readonly [Symbol.toStringTag]: "Int32Array"; -} - -/** - * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint32Array { - readonly [Symbol.toStringTag]: "Uint32Array"; -} - -/** - * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number - * of bytes could not be allocated an exception is raised. - */ -interface Float32Array { - readonly [Symbol.toStringTag]: "Float32Array"; -} - -/** - * A typed array of 64-bit float values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Float64Array { - readonly [Symbol.toStringTag]: "Float64Array"; -} \ No newline at end of file +/// + +interface SymbolConstructor { + /** + * A method that determines if a constructor object recognizes an object as one of the + * constructor’s instances. Called by the semantics of the instanceof operator. + */ + readonly hasInstance: symbol; + + /** + * A Boolean value that if true indicates that an object should flatten to its array elements + * by Array.prototype.concat. + */ + readonly isConcatSpreadable: symbol; + + /** + * A regular expression method that matches the regular expression against a string. Called + * by the String.prototype.match method. + */ + readonly match: symbol; + + /** + * A regular expression method that replaces matched substrings of a string. Called by the + * String.prototype.replace method. + */ + readonly replace: symbol; + + /** + * A regular expression method that returns the index within a string that matches the + * regular expression. Called by the String.prototype.search method. + */ + readonly search: symbol; + + /** + * A function valued property that is the constructor function that is used to create + * derived objects. + */ + readonly species: symbol; + + /** + * A regular expression method that splits a string at the indices that match the regular + * expression. Called by the String.prototype.split method. + */ + readonly split: symbol; + + /** + * A method that converts an object to a corresponding primitive value. + * Called by the ToPrimitive abstract operation. + */ + readonly toPrimitive: symbol; + + /** + * A String value that is used in the creation of the default string description of an object. + * Called by the built-in method Object.prototype.toString. + */ + readonly toStringTag: symbol; + + /** + * An Object whose own property names are property names that are excluded from the 'with' + * environment bindings of the associated objects. + */ + readonly unscopables: symbol; +} + +interface Symbol { + readonly [Symbol.toStringTag]: "Symbol"; +} + +interface Array { + /** + * Returns an object whose properties have the value 'true' + * when they will be absent when used in a 'with' statement. + */ + [Symbol.unscopables](): { + copyWithin: boolean; + entries: boolean; + fill: boolean; + find: boolean; + findIndex: boolean; + keys: boolean; + values: boolean; + }; +} + +interface Date { + /** + * Converts a Date object to a string. + */ + [Symbol.toPrimitive](hint: "default"): string; + /** + * Converts a Date object to a string. + */ + [Symbol.toPrimitive](hint: "string"): string; + /** + * Converts a Date object to a number. + */ + [Symbol.toPrimitive](hint: "number"): number; + /** + * Converts a Date object to a string or number. + * + * @param hint The strings "number", "string", or "default" to specify what primitive to return. + * + * @throws {TypeError} If 'hint' was given something other than "number", "string", or "default". + * @returns A number if 'hint' was "number", a string if 'hint' was "string" or "default". + */ + [Symbol.toPrimitive](hint: string): string | number; +} + +interface Map { + readonly [Symbol.toStringTag]: "Map"; +} + +interface WeakMap{ + readonly [Symbol.toStringTag]: "WeakMap"; +} + +interface Set { + readonly [Symbol.toStringTag]: "Set"; +} + +interface WeakSet { + readonly [Symbol.toStringTag]: "WeakSet"; +} + +interface JSON { + readonly [Symbol.toStringTag]: "JSON"; +} + +interface Function { + /** + * Determines whether the given value inherits from this function if this function was used + * as a constructor function. + * + * A constructor function can control which objects are recognized as its instances by + * 'instanceof' by overriding this method. + */ + [Symbol.hasInstance](value: any): boolean; +} + +interface GeneratorFunction { + readonly [Symbol.toStringTag]: "GeneratorFunction"; +} + +interface Math { + readonly [Symbol.toStringTag]: "Math"; +} + +interface Promise { + readonly [Symbol.toStringTag]: "Promise"; +} + +interface PromiseConstructor { + readonly [Symbol.species]: Function; +} + +interface RegExp { + /** + * Matches a string with this regular expression, and returns an array containing the results of + * that search. + * @param string A string to search within. + */ + [Symbol.match](string: string): RegExpMatchArray | null; + + /** + * Replaces text in a string, using this regular expression. + * @param string A String object or string literal whose contents matching against + * this regular expression will be replaced + * @param replaceValue A String object or string literal containing the text to replace for every + * successful match of this regular expression. + */ + [Symbol.replace](string: string, replaceValue: string): string; + + /** + * Replaces text in a string, using this regular expression. + * @param string A String object or string literal whose contents matching against + * this regular expression will be replaced + * @param replacer A function that returns the replacement text. + */ + [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; + + /** + * Finds the position beginning first substring match in a regular expression search + * using this regular expression. + * + * @param string The string to search within. + */ + [Symbol.search](string: string): number; + + /** + * Returns an array of substrings that were delimited by strings in the original input that + * match against this regular expression. + * + * If the regular expression contains capturing parentheses, then each time this + * regular expression matches, the results (including any undefined results) of the + * capturing parentheses are spliced. + * + * @param string string value to split + * @param limit if not undefined, the output array is truncated so that it contains no more + * than 'limit' elements. + */ + [Symbol.split](string: string, limit?: number): string[]; +} + +interface RegExpConstructor { + [Symbol.species](): RegExpConstructor; +} + +interface String { + /** + * Matches a string an object that supports being matched against, and returns an array containing the results of that search. + * @param matcher An object that supports being matched against. + */ + match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null; + + /** + * Replaces text in a string, using an object that supports replacement within a string. + * @param searchValue A object can search for and replace matches within a string. + * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. + */ + replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string; + + /** + * Replaces text in a string, using an object that supports replacement within a string. + * @param searchValue A object can search for and replace matches within a string. + * @param replacer A function that returns the replacement text. + */ + replace(searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string; + + /** + * Finds the first substring match in a regular expression search. + * @param searcher An object which supports searching within a string. + */ + search(searcher: { [Symbol.search](string: string): number; }): number; + + /** + * Split a string into substrings using the specified separator and return them as an array. + * @param splitter An object that can split a string. + * @param limit A value used to limit the number of elements returned in the array. + */ + split(splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number): string[]; +} + +/** + * Represents a raw buffer of binary data, which is used to store data for the + * different typed arrays. ArrayBuffers cannot be read from or written to directly, + * but can be passed to a typed array or DataView Object to interpret the raw + * buffer as needed. + */ +interface ArrayBuffer { + readonly [Symbol.toStringTag]: "ArrayBuffer"; +} + +interface DataView { + readonly [Symbol.toStringTag]: "DataView"; +} + +/** + * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Int8Array { + readonly [Symbol.toStringTag]: "Int8Array"; +} + +/** + * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8Array { + readonly [Symbol.toStringTag]: "UInt8Array"; +} + +/** + * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. + * If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8ClampedArray { + readonly [Symbol.toStringTag]: "Uint8ClampedArray"; +} + +/** + * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int16Array { + readonly [Symbol.toStringTag]: "Int16Array"; +} + +/** + * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint16Array { + readonly [Symbol.toStringTag]: "Uint16Array"; +} + +/** + * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int32Array { + readonly [Symbol.toStringTag]: "Int32Array"; +} + +/** + * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint32Array { + readonly [Symbol.toStringTag]: "Uint32Array"; +} + +/** + * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number + * of bytes could not be allocated an exception is raised. + */ +interface Float32Array { + readonly [Symbol.toStringTag]: "Float32Array"; +} + +/** + * A typed array of 64-bit float values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Float64Array { + readonly [Symbol.toStringTag]: "Float64Array"; +} diff --git a/node_modules/typescript/lib/lib.es2016.array.include.d.ts b/node_modules/typescript/lib/lib.es2016.array.include.d.ts index 42b95c478..734fa450d 100644 --- a/node_modules/typescript/lib/lib.es2016.array.include.d.ts +++ b/node_modules/typescript/lib/lib.es2016.array.include.d.ts @@ -1,109 +1,118 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ -/// + +/// -interface Array { - /** - * Determines whether an array includes a certain element, returning true or false as appropriate. - * @param searchElement The element to search for. - * @param fromIndex The position in this array at which to begin searching for searchElement. - */ - includes(searchElement: T, fromIndex?: number): boolean; -} - -interface Int8Array { - /** - * Determines whether an array includes a certain element, returning true or false as appropriate. - * @param searchElement The element to search for. - * @param fromIndex The position in this array at which to begin searching for searchElement. - */ - includes(searchElement: number, fromIndex?: number): boolean; -} - -interface Uint8Array { - /** - * Determines whether an array includes a certain element, returning true or false as appropriate. - * @param searchElement The element to search for. - * @param fromIndex The position in this array at which to begin searching for searchElement. - */ - includes(searchElement: number, fromIndex?: number): boolean; -} - -interface Uint8ClampedArray { - /** - * Determines whether an array includes a certain element, returning true or false as appropriate. - * @param searchElement The element to search for. - * @param fromIndex The position in this array at which to begin searching for searchElement. - */ - includes(searchElement: number, fromIndex?: number): boolean; -} - -interface Int16Array { - /** - * Determines whether an array includes a certain element, returning true or false as appropriate. - * @param searchElement The element to search for. - * @param fromIndex The position in this array at which to begin searching for searchElement. - */ - includes(searchElement: number, fromIndex?: number): boolean; -} - -interface Uint16Array { - /** - * Determines whether an array includes a certain element, returning true or false as appropriate. - * @param searchElement The element to search for. - * @param fromIndex The position in this array at which to begin searching for searchElement. - */ - includes(searchElement: number, fromIndex?: number): boolean; -} - -interface Int32Array { - /** - * Determines whether an array includes a certain element, returning true or false as appropriate. - * @param searchElement The element to search for. - * @param fromIndex The position in this array at which to begin searching for searchElement. - */ - includes(searchElement: number, fromIndex?: number): boolean; -} - -interface Uint32Array { - /** - * Determines whether an array includes a certain element, returning true or false as appropriate. - * @param searchElement The element to search for. - * @param fromIndex The position in this array at which to begin searching for searchElement. - */ - includes(searchElement: number, fromIndex?: number): boolean; -} - -interface Float32Array { - /** - * Determines whether an array includes a certain element, returning true or false as appropriate. - * @param searchElement The element to search for. - * @param fromIndex The position in this array at which to begin searching for searchElement. - */ - includes(searchElement: number, fromIndex?: number): boolean; -} - -interface Float64Array { - /** - * Determines whether an array includes a certain element, returning true or false as appropriate. - * @param searchElement The element to search for. - * @param fromIndex The position in this array at which to begin searching for searchElement. - */ - includes(searchElement: number, fromIndex?: number): boolean; +interface Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: T, fromIndex?: number): boolean; +} + +interface ReadonlyArray { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: T, fromIndex?: number): boolean; +} + +interface Int8Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Uint8Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Uint8ClampedArray { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Int16Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Uint16Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Int32Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Uint32Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Float32Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Float64Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; } \ No newline at end of file diff --git a/node_modules/typescript/lib/lib.es2016.d.ts b/node_modules/typescript/lib/lib.es2016.d.ts index 5921e060d..50fdffa85 100644 --- a/node_modules/typescript/lib/lib.es2016.d.ts +++ b/node_modules/typescript/lib/lib.es2016.d.ts @@ -1,22 +1,22 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ -/// + +/// -/// +/// /// \ No newline at end of file diff --git a/node_modules/typescript/lib/lib.es2017.d.ts b/node_modules/typescript/lib/lib.es2017.d.ts index 94c75a1b4..a0d3a0aff 100644 --- a/node_modules/typescript/lib/lib.es2017.d.ts +++ b/node_modules/typescript/lib/lib.es2017.d.ts @@ -1,24 +1,24 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ -/// + +/// -/// -/// -/// -/// +/// +/// +/// +/// \ No newline at end of file diff --git a/node_modules/typescript/lib/lib.es2017.object.d.ts b/node_modules/typescript/lib/lib.es2017.object.d.ts index dc3806835..00c11be27 100644 --- a/node_modules/typescript/lib/lib.es2017.object.d.ts +++ b/node_modules/typescript/lib/lib.es2017.object.d.ts @@ -1,34 +1,45 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ -/// + +/// -interface ObjectConstructor { - /** - * Returns an array of values of the enumerable properties of an object - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ - values(o: { [s: string]: T }): T[]; - values(o: any): any[]; - /** - * Returns an array of key/values of the enumerable properties of an object - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ - entries(o: T): [keyof T, T[K]][]; - entries(o: any): [string, any][]; -} +interface ObjectConstructor { + /** + * Returns an array of values of the enumerable properties of an object + * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. + */ + values(o: { [s: string]: T }): T[]; + + /** + * Returns an array of values of the enumerable properties of an object + * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. + */ + values(o: any): any[]; + + /** + * Returns an array of key/values of the enumerable properties of an object + * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. + */ + entries(o: { [s: string]: T }): [string, T][]; + + /** + * Returns an array of key/values of the enumerable properties of an object + * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. + */ + entries(o: any): [string, any][]; +} diff --git a/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts b/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts index c59e12555..c0254f1dc 100644 --- a/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +++ b/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts @@ -1,47 +1,47 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ -/// + +/// -/// -/// - -interface SharedArrayBuffer { - /** - * Read-only. The length of the ArrayBuffer (in bytes). - */ - readonly byteLength: number; - - /* - * The SharedArrayBuffer constructor's length property whose value is 1. - */ - length: number; - /** - * Returns a section of an SharedArrayBuffer. - */ - slice(begin:number, end?:number): SharedArrayBuffer; - readonly [Symbol.species]: SharedArrayBuffer; - readonly [Symbol.toStringTag]: "SharedArrayBuffer"; -} - -interface SharedArrayBufferConstructor { - readonly prototype: SharedArrayBuffer; - new (byteLength: number): SharedArrayBuffer; -} - +/// +/// + +interface SharedArrayBuffer { + /** + * Read-only. The length of the ArrayBuffer (in bytes). + */ + readonly byteLength: number; + + /* + * The SharedArrayBuffer constructor's length property whose value is 1. + */ + length: number; + /** + * Returns a section of an SharedArrayBuffer. + */ + slice(begin: number, end?: number): SharedArrayBuffer; + readonly [Symbol.species]: SharedArrayBuffer; + readonly [Symbol.toStringTag]: "SharedArrayBuffer"; +} + +interface SharedArrayBufferConstructor { + readonly prototype: SharedArrayBuffer; + new (byteLength: number): SharedArrayBuffer; +} + declare var SharedArrayBuffer: SharedArrayBufferConstructor; \ No newline at end of file diff --git a/node_modules/typescript/lib/lib.es5.d.ts b/node_modules/typescript/lib/lib.es5.d.ts index 8e8b3b1b8..f43d062ad 100644 --- a/node_modules/typescript/lib/lib.es5.d.ts +++ b/node_modules/typescript/lib/lib.es5.d.ts @@ -1,4195 +1,4342 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ -/// + +/// -///////////////////////////// -/// ECMAScript APIs -///////////////////////////// - -declare const NaN: number; -declare const Infinity: number; - -/** - * Evaluates JavaScript code and executes it. - * @param x A String value that contains valid JavaScript code. - */ -declare function eval(x: string): any; - -/** - * Converts A string to an integer. - * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. - * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. - * All other strings are considered decimal. - */ -declare function parseInt(s: string, radix?: number): number; - -/** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. - */ -declare function parseFloat(string: string): number; - -/** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number). - * @param number A numeric value. - */ -declare function isNaN(number: number): boolean; - -/** - * Determines whether a supplied number is finite. - * @param number Any numeric value. - */ -declare function isFinite(number: number): boolean; - -/** - * Gets the unencoded version of an encoded Uniform Resource Identifier (URI). - * @param encodedURI A value representing an encoded URI. - */ -declare function decodeURI(encodedURI: string): string; - -/** - * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI). - * @param encodedURIComponent A value representing an encoded URI component. - */ -declare function decodeURIComponent(encodedURIComponent: string): string; - -/** - * Encodes a text string as a valid Uniform Resource Identifier (URI) - * @param uri A value representing an encoded URI. - */ -declare function encodeURI(uri: string): string; - -/** - * Encodes a text string as a valid component of a Uniform Resource Identifier (URI). - * @param uriComponent A value representing an encoded URI component. - */ -declare function encodeURIComponent(uriComponent: string): string; - -interface PropertyDescriptor { - configurable?: boolean; - enumerable?: boolean; - value?: any; - writable?: boolean; - get? (): any; - set? (v: any): void; -} - -interface PropertyDescriptorMap { - [s: string]: PropertyDescriptor; -} - -interface Object { - /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */ - constructor: Function; - - /** Returns a string representation of an object. */ - toString(): string; - - /** Returns a date converted to a string using the current locale. */ - toLocaleString(): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): Object; - - /** - * Determines whether an object has a property with the specified name. - * @param v A property name. - */ - hasOwnProperty(v: string): boolean; - - /** - * Determines whether an object exists in another object's prototype chain. - * @param v Another object whose prototype chain is to be checked. - */ - isPrototypeOf(v: Object): boolean; - - /** - * Determines whether a specified property is enumerable. - * @param v A property name. - */ - propertyIsEnumerable(v: string): boolean; -} - -interface ObjectConstructor { - new (value?: any): Object; - (): any; - (value: any): any; - - /** A reference to the prototype for a class of objects. */ - readonly prototype: Object; - - /** - * Returns the prototype of an object. - * @param o The object that references the prototype. - */ - getPrototypeOf(o: any): any; - - /** - * Gets the own property descriptor of the specified object. - * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype. - * @param o Object that contains the property. - * @param p Name of the property. - */ - getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; - - /** - * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly - * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. - * @param o Object that contains the own properties. - */ - getOwnPropertyNames(o: any): string[]; - - /** - * Creates an object that has null prototype. - * @param o Object to use as a prototype. May be null - */ - create(o: null): any; - - /** - * Creates an object that has the specified prototype, and that optionally contains specified properties. - * @param o Object to use as a prototype. May be null - */ - create(o: T): T; - - /** - * Creates an object that has the specified prototype, and that optionally contains specified properties. - * @param o Object to use as a prototype. May be null - * @param properties JavaScript object that contains one or more property descriptors. - */ - create(o: any, properties: PropertyDescriptorMap): any; - - /** - * Adds a property to an object, or modifies attributes of an existing property. - * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object. - * @param p The property name. - * @param attributes Descriptor for the property. It can be for a data property or an accessor property. - */ - defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; - - /** - * Adds one or more properties to an object, and/or modifies attributes of existing properties. - * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object. - * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property. - */ - defineProperties(o: any, properties: PropertyDescriptorMap): any; - - /** - * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - seal(o: T): T; - - /** - * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - freeze(a: T[]): ReadonlyArray; - - /** - * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - freeze(f: T): T; - - /** - * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - freeze(o: T): Readonly; - - /** - * Prevents the addition of new properties to an object. - * @param o Object to make non-extensible. - */ - preventExtensions(o: T): T; - - /** - * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. - * @param o Object to test. - */ - isSealed(o: any): boolean; - - /** - * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. - * @param o Object to test. - */ - isFrozen(o: any): boolean; - - /** - * Returns a value that indicates whether new properties can be added to an object. - * @param o Object to test. - */ - isExtensible(o: any): boolean; - - /** - * Returns the names of the enumerable properties and methods of an object. - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ - keys(o: any): string[]; -} - -/** - * Provides functionality common to all JavaScript objects. - */ -declare const Object: ObjectConstructor; - -/** - * Creates a new function. - */ -interface Function { - /** - * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. - * @param thisArg The object to be used as the this object. - * @param argArray A set of arguments to be passed to the function. - */ - apply(this: Function, thisArg: any, argArray?: any): any; - - /** - * Calls a method of an object, substituting another object for the current object. - * @param thisArg The object to be used as the current object. - * @param argArray A list of arguments to be passed to the method. - */ - call(this: Function, thisArg: any, ...argArray: any[]): any; - - /** - * For a given function, creates a bound function that has the same body as the original function. - * The this object of the bound function is associated with the specified object, and has the specified initial parameters. - * @param thisArg An object to which the this keyword can refer inside the new function. - * @param argArray A list of arguments to be passed to the new function. - */ - bind(this: Function, thisArg: any, ...argArray: any[]): any; - - /** Returns a string representation of a function. */ - toString(): string; - - prototype: any; - readonly length: number; - - // Non-standard extensions - arguments: any; - caller: Function; -} - -interface FunctionConstructor { - /** - * Creates a new function. - * @param args A list of arguments the function accepts. - */ - new (...args: string[]): Function; - (...args: string[]): Function; - readonly prototype: Function; -} - -declare const Function: FunctionConstructor; - -interface IArguments { - [index: number]: any; - length: number; - callee: Function; -} - -interface String { - /** Returns a string representation of a string. */ - toString(): string; - - /** - * Returns the character at the specified index. - * @param pos The zero-based index of the desired character. - */ - charAt(pos: number): string; - - /** - * Returns the Unicode value of the character at the specified location. - * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned. - */ - charCodeAt(index: number): number; - - /** - * Returns a string that contains the concatenation of two or more strings. - * @param strings The strings to append to the end of the string. - */ - concat(...strings: string[]): string; - - /** - * Returns the position of the first occurrence of a substring. - * @param searchString The substring to search for in the string - * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string. - */ - indexOf(searchString: string, position?: number): number; - - /** - * Returns the last occurrence of a substring in the string. - * @param searchString The substring to search for. - * @param position The index at which to begin searching. If omitted, the search begins at the end of the string. - */ - lastIndexOf(searchString: string, position?: number): number; - - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - */ - localeCompare(that: string): number; - - /** - * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A variable name or string literal containing the regular expression pattern and flags. - */ - match(regexp: string): RegExpMatchArray | null; - - /** - * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A regular expression object that contains the regular expression pattern and applicable flags. - */ - match(regexp: RegExp): RegExpMatchArray | null; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A string that represents the regular expression. - * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. - */ - replace(searchValue: string, replaceValue: string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A string that represents the regular expression. - * @param replacer A function that returns the replacement text. - */ - replace(searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags. - * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. - */ - replace(searchValue: RegExp, replaceValue: string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags - * @param replacer A function that returns the replacement text. - */ - replace(searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; - - /** - * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. - */ - search(regexp: string): number; - - /** - * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. - */ - search(regexp: RegExp): number; - - /** - * Returns a section of a string. - * @param start The index to the beginning of the specified portion of stringObj. - * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. - * If this value is not specified, the substring continues to the end of stringObj. - */ - slice(start?: number, end?: number): string; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(separator: string, limit?: number): string[]; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param separator A Regular Express that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(separator: RegExp, limit?: number): string[]; - - /** - * Returns the substring at the specified location within a String object. - * @param start The zero-based index number indicating the beginning of the substring. - * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. - * If end is omitted, the characters from start through the end of the original string are returned. - */ - substring(start: number, end?: number): string; - - /** Converts all the alphabetic characters in a string to lowercase. */ - toLowerCase(): string; - - /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ - toLocaleLowerCase(): string; - - /** Converts all the alphabetic characters in a string to uppercase. */ - toUpperCase(): string; - - /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */ - toLocaleUpperCase(): string; - - /** Removes the leading and trailing white space and line terminator characters from a string. */ - trim(): string; - - /** Returns the length of a String object. */ - readonly length: number; - - // IE extensions - /** - * Gets a substring beginning at the specified location and having the specified length. - * @param from The starting position of the desired substring. The index of the first character in the string is zero. - * @param length The number of characters to include in the returned substring. - */ - substr(from: number, length?: number): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): string; - - readonly [index: number]: string; -} - -interface StringConstructor { - new (value?: any): String; - (value?: any): string; - readonly prototype: String; - fromCharCode(...codes: number[]): string; -} - -/** - * Allows manipulation and formatting of text strings and determination and location of substrings within strings. - */ -declare const String: StringConstructor; - -interface Boolean { - /** Returns the primitive value of the specified object. */ - valueOf(): boolean; -} - -interface BooleanConstructor { - new (value?: any): Boolean; - (value?: any): boolean; - readonly prototype: Boolean; -} - -declare const Boolean: BooleanConstructor; - -interface Number { - /** - * Returns a string representation of an object. - * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers. - */ - toString(radix?: number): string; - - /** - * Returns a string representing a number in fixed-point notation. - * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. - */ - toFixed(fractionDigits?: number): string; - - /** - * Returns a string containing a number represented in exponential notation. - * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. - */ - toExponential(fractionDigits?: number): string; - - /** - * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits. - * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive. - */ - toPrecision(precision?: number): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): number; -} - -interface NumberConstructor { - new (value?: any): Number; - (value?: any): number; - readonly prototype: Number; - - /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */ - readonly MAX_VALUE: number; - - /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */ - readonly MIN_VALUE: number; - - /** - * A value that is not a number. - * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function. - */ - readonly NaN: number; - - /** - * A value that is less than the largest negative number that can be represented in JavaScript. - * JavaScript displays NEGATIVE_INFINITY values as -infinity. - */ - readonly NEGATIVE_INFINITY: number; - - /** - * A value greater than the largest number that can be represented in JavaScript. - * JavaScript displays POSITIVE_INFINITY values as infinity. - */ - readonly POSITIVE_INFINITY: number; -} - -/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */ -declare const Number: NumberConstructor; - -interface TemplateStringsArray extends ReadonlyArray { - readonly raw: ReadonlyArray -} - -interface Math { - /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ - readonly E: number; - /** The natural logarithm of 10. */ - readonly LN10: number; - /** The natural logarithm of 2. */ - readonly LN2: number; - /** The base-2 logarithm of e. */ - readonly LOG2E: number; - /** The base-10 logarithm of e. */ - readonly LOG10E: number; - /** Pi. This is the ratio of the circumference of a circle to its diameter. */ - readonly PI: number; - /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */ - readonly SQRT1_2: number; - /** The square root of 2. */ - readonly SQRT2: number; - /** - * Returns the absolute value of a number (the value without regard to whether it is positive or negative). - * For example, the absolute value of -5 is the same as the absolute value of 5. - * @param x A numeric expression for which the absolute value is needed. - */ - abs(x: number): number; - /** - * Returns the arc cosine (or inverse cosine) of a number. - * @param x A numeric expression. - */ - acos(x: number): number; - /** - * Returns the arcsine of a number. - * @param x A numeric expression. - */ - asin(x: number): number; - /** - * Returns the arctangent of a number. - * @param x A numeric expression for which the arctangent is needed. - */ - atan(x: number): number; - /** - * Returns the angle (in radians) from the X axis to a point. - * @param y A numeric expression representing the cartesian y-coordinate. - * @param x A numeric expression representing the cartesian x-coordinate. - */ - atan2(y: number, x: number): number; - /** - * Returns the smallest number greater than or equal to its numeric argument. - * @param x A numeric expression. - */ - ceil(x: number): number; - /** - * Returns the cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - cos(x: number): number; - /** - * Returns e (the base of natural logarithms) raised to a power. - * @param x A numeric expression representing the power of e. - */ - exp(x: number): number; - /** - * Returns the greatest number less than or equal to its numeric argument. - * @param x A numeric expression. - */ - floor(x: number): number; - /** - * Returns the natural logarithm (base e) of a number. - * @param x A numeric expression. - */ - log(x: number): number; - /** - * Returns the larger of a set of supplied numeric expressions. - * @param values Numeric expressions to be evaluated. - */ - max(...values: number[]): number; - /** - * Returns the smaller of a set of supplied numeric expressions. - * @param values Numeric expressions to be evaluated. - */ - min(...values: number[]): number; - /** - * Returns the value of a base expression taken to a specified power. - * @param x The base value of the expression. - * @param y The exponent value of the expression. - */ - pow(x: number, y: number): number; - /** Returns a pseudorandom number between 0 and 1. */ - random(): number; - /** - * Returns a supplied numeric expression rounded to the nearest number. - * @param x The value to be rounded to the nearest number. - */ - round(x: number): number; - /** - * Returns the sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - sin(x: number): number; - /** - * Returns the square root of a number. - * @param x A numeric expression. - */ - sqrt(x: number): number; - /** - * Returns the tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - tan(x: number): number; -} -/** An intrinsic object that provides basic mathematics functionality and constants. */ -declare const Math: Math; - -/** Enables basic storage and retrieval of dates and times. */ -interface Date { - /** Returns a string representation of a date. The format of the string depends on the locale. */ - toString(): string; - /** Returns a date as a string value. */ - toDateString(): string; - /** Returns a time as a string value. */ - toTimeString(): string; - /** Returns a value as a string value appropriate to the host environment's current locale. */ - toLocaleString(): string; - /** Returns a date as a string value appropriate to the host environment's current locale. */ - toLocaleDateString(): string; - /** Returns a time as a string value appropriate to the host environment's current locale. */ - toLocaleTimeString(): string; - /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */ - valueOf(): number; - /** Gets the time value in milliseconds. */ - getTime(): number; - /** Gets the year, using local time. */ - getFullYear(): number; - /** Gets the year using Universal Coordinated Time (UTC). */ - getUTCFullYear(): number; - /** Gets the month, using local time. */ - getMonth(): number; - /** Gets the month of a Date object using Universal Coordinated Time (UTC). */ - getUTCMonth(): number; - /** Gets the day-of-the-month, using local time. */ - getDate(): number; - /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */ - getUTCDate(): number; - /** Gets the day of the week, using local time. */ - getDay(): number; - /** Gets the day of the week using Universal Coordinated Time (UTC). */ - getUTCDay(): number; - /** Gets the hours in a date, using local time. */ - getHours(): number; - /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */ - getUTCHours(): number; - /** Gets the minutes of a Date object, using local time. */ - getMinutes(): number; - /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */ - getUTCMinutes(): number; - /** Gets the seconds of a Date object, using local time. */ - getSeconds(): number; - /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */ - getUTCSeconds(): number; - /** Gets the milliseconds of a Date, using local time. */ - getMilliseconds(): number; - /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */ - getUTCMilliseconds(): number; - /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */ - getTimezoneOffset(): number; - /** - * Sets the date and time value in the Date object. - * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT. - */ - setTime(time: number): number; - /** - * Sets the milliseconds value in the Date object using local time. - * @param ms A numeric value equal to the millisecond value. - */ - setMilliseconds(ms: number): number; - /** - * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). - * @param ms A numeric value equal to the millisecond value. - */ - setUTCMilliseconds(ms: number): number; - - /** - * Sets the seconds value in the Date object using local time. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setSeconds(sec: number, ms?: number): number; - /** - * Sets the seconds value in the Date object using Universal Coordinated Time (UTC). - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCSeconds(sec: number, ms?: number): number; - /** - * Sets the minutes value in the Date object using local time. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setMinutes(min: number, sec?: number, ms?: number): number; - /** - * Sets the minutes value in the Date object using Universal Coordinated Time (UTC). - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCMinutes(min: number, sec?: number, ms?: number): number; - /** - * Sets the hour value in the Date object using local time. - * @param hours A numeric value equal to the hours value. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setHours(hours: number, min?: number, sec?: number, ms?: number): number; - /** - * Sets the hours value in the Date object using Universal Coordinated Time (UTC). - * @param hours A numeric value equal to the hours value. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number; - /** - * Sets the numeric day-of-the-month value of the Date object using local time. - * @param date A numeric value equal to the day of the month. - */ - setDate(date: number): number; - /** - * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). - * @param date A numeric value equal to the day of the month. - */ - setUTCDate(date: number): number; - /** - * Sets the month value in the Date object using local time. - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. - * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used. - */ - setMonth(month: number, date?: number): number; - /** - * Sets the month value in the Date object using Universal Coordinated Time (UTC). - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. - * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used. - */ - setUTCMonth(month: number, date?: number): number; - /** - * Sets the year of the Date object using local time. - * @param year A numeric value for the year. - * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified. - * @param date A numeric value equal for the day of the month. - */ - setFullYear(year: number, month?: number, date?: number): number; - /** - * Sets the year value in the Date object using Universal Coordinated Time (UTC). - * @param year A numeric value equal to the year. - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied. - * @param date A numeric value equal to the day of the month. - */ - setUTCFullYear(year: number, month?: number, date?: number): number; - /** Returns a date converted to a string using Universal Coordinated Time (UTC). */ - toUTCString(): string; - /** Returns a date as a string value in ISO format. */ - toISOString(): string; - /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */ - toJSON(key?: any): string; -} - -interface DateConstructor { - new (): Date; - new (value: number): Date; - new (value: string): Date; - new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; - (): string; - readonly prototype: Date; - /** - * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. - * @param s A date string - */ - parse(s: string): number; - /** - * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date. - * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year. - * @param month The month as an number between 0 and 11 (January to December). - * @param date The date as an number between 1 and 31. - * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour. - * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes. - * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds. - * @param ms An number from 0 to 999 that specifies the milliseconds. - */ - UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; - now(): number; -} - -declare const Date: DateConstructor; - -interface RegExpMatchArray extends Array { - index?: number; - input?: string; -} - -interface RegExpExecArray extends Array { - index: number; - input: string; -} - -interface RegExp { - /** - * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. - * @param string The String object or string literal on which to perform the search. - */ - exec(string: string): RegExpExecArray | null; - - /** - * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. - * @param string String on which to perform the search. - */ - test(string: string): boolean; - - /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */ - readonly source: string; - - /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ - readonly global: boolean; - - /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */ - readonly ignoreCase: boolean; - - /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */ - readonly multiline: boolean; - - lastIndex: number; - - // Non-standard extensions - compile(): this; -} - -interface RegExpConstructor { - new (pattern: RegExp): RegExp; - new (pattern: string, flags?: string): RegExp; - (pattern: RegExp): RegExp; - (pattern: string, flags?: string): RegExp; - readonly prototype: RegExp; - - // Non-standard extensions - $1: string; - $2: string; - $3: string; - $4: string; - $5: string; - $6: string; - $7: string; - $8: string; - $9: string; - lastMatch: string; -} - -declare const RegExp: RegExpConstructor; - -interface Error { - name: string; - message: string; - stack?: string; -} - -interface ErrorConstructor { - new (message?: string): Error; - (message?: string): Error; - readonly prototype: Error; -} - -declare const Error: ErrorConstructor; - -interface EvalError extends Error { -} - -interface EvalErrorConstructor { - new (message?: string): EvalError; - (message?: string): EvalError; - readonly prototype: EvalError; -} - -declare const EvalError: EvalErrorConstructor; - -interface RangeError extends Error { -} - -interface RangeErrorConstructor { - new (message?: string): RangeError; - (message?: string): RangeError; - readonly prototype: RangeError; -} - -declare const RangeError: RangeErrorConstructor; - -interface ReferenceError extends Error { -} - -interface ReferenceErrorConstructor { - new (message?: string): ReferenceError; - (message?: string): ReferenceError; - readonly prototype: ReferenceError; -} - -declare const ReferenceError: ReferenceErrorConstructor; - -interface SyntaxError extends Error { -} - -interface SyntaxErrorConstructor { - new (message?: string): SyntaxError; - (message?: string): SyntaxError; - readonly prototype: SyntaxError; -} - -declare const SyntaxError: SyntaxErrorConstructor; - -interface TypeError extends Error { -} - -interface TypeErrorConstructor { - new (message?: string): TypeError; - (message?: string): TypeError; - readonly prototype: TypeError; -} - -declare const TypeError: TypeErrorConstructor; - -interface URIError extends Error { -} - -interface URIErrorConstructor { - new (message?: string): URIError; - (message?: string): URIError; - readonly prototype: URIError; -} - -declare const URIError: URIErrorConstructor; - -interface JSON { - /** - * Converts a JavaScript Object Notation (JSON) string into an object. - * @param text A valid JSON string. - * @param reviver A function that transforms the results. This function is called for each member of the object. - * If a member contains nested objects, the nested objects are transformed before the parent object is. - */ - parse(text: string, reviver?: (key: any, value: any) => any): any; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer A function that transforms the results. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - */ - stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer An array of strings and numbers that acts as a approved list for selecting the object properties that will be stringified. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - */ - stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string; -} - -/** - * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format. - */ -declare const JSON: JSON; - - -///////////////////////////// -/// ECMAScript Array API (specially handled by compiler) -///////////////////////////// - -interface ReadonlyArray { - /** - * Gets the length of the array. This is a number one higher than the highest element defined in an array. - */ - readonly length: number; - /** - * Returns a string representation of an array. - */ - toString(): string; - toLocaleString(): string; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat>(...items: U[]): T[]; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: T[][]): T[]; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: (T | T[])[]): T[]; - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): T[]; - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. - */ - indexOf(searchElement: T, fromIndex?: number): number; - - /** - * Returns the index of the last occurrence of a specified value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. - */ - lastIndexOf(searchElement: T, fromIndex?: number): number; - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: T, index: number, array: ReadonlyArray) => boolean, thisArg?: any): boolean; - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: T, index: number, array: ReadonlyArray) => boolean, thisArg?: any): boolean; - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: T, index: number, array: ReadonlyArray) => void, thisArg?: any): void; - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: T, index: number, array: ReadonlyArray) => U, thisArg?: any): U[]; - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: T, index: number, array: ReadonlyArray) => value is S, thisArg?: any): S[]; - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: T, index: number, array: ReadonlyArray) => any, thisArg?: any): T[]; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U; - - readonly [n: number]: T; -} - -interface Array { - /** - * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. - */ - length: number; - /** - * Returns a string representation of an array. - */ - toString(): string; - toLocaleString(): string; - /** - * Appends new elements to an array, and returns the new length of the array. - * @param items New elements of the Array. - */ - push(...items: T[]): number; - /** - * Removes the last element from an array and returns it. - */ - pop(): T | undefined; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: T[][]): T[]; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: (T | T[])[]): T[]; - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - /** - * Reverses the elements in an Array. - */ - reverse(): T[]; - /** - * Removes the first element from an array and returns it. - */ - shift(): T | undefined; - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): T[]; - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: T, b: T) => number): this; - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - */ - splice(start: number): T[]; - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - * @param deleteCount The number of elements to remove. - * @param items Elements to insert into the array in place of the deleted elements. - */ - splice(start: number, deleteCount: number, ...items: T[]): T[]; - /** - * Inserts new elements at the start of an array. - * @param items Elements to insert at the start of the Array. - */ - unshift(...items: T[]): number; - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. - */ - indexOf(searchElement: T, fromIndex?: number): number; - /** - * Returns the index of the last occurrence of a specified value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. - */ - lastIndexOf(searchElement: T, fromIndex?: number): number; - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(this: [T, T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U, U]; - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(this: [T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U]; - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(this: [T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U]; - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(this: [T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U]; - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[]; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - - [n: number]: T; -} - -interface ArrayConstructor { - new (arrayLength?: number): any[]; - new (arrayLength: number): T[]; - new (...items: T[]): T[]; - (arrayLength?: number): any[]; - (arrayLength: number): T[]; - (...items: T[]): T[]; - isArray(arg: any): arg is Array; - readonly prototype: Array; -} - -declare const Array: ArrayConstructor; - -interface TypedPropertyDescriptor { - enumerable?: boolean; - configurable?: boolean; - writable?: boolean; - value?: T; - get?: () => T; - set?: (value: T) => void; -} - -declare type ClassDecorator = (target: TFunction) => TFunction | void; -declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; -declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; -declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; - -declare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike; - -interface PromiseLike { - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then( - onfulfilled?: ((value: T) => T | PromiseLike) | undefined | null, - onrejected?: ((reason: any) => T | PromiseLike) | undefined | null): PromiseLike; - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then( - onfulfilled: ((value: T) => T | PromiseLike) | undefined | null, - onrejected: (reason: any) => TResult | PromiseLike): PromiseLike; - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then( - onfulfilled: (value: T) => TResult | PromiseLike, - onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): PromiseLike; - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then( - onfulfilled: (value: T) => TResult1 | PromiseLike, - onrejected: (reason: any) => TResult2 | PromiseLike): PromiseLike; -} - -interface ArrayLike { - readonly length: number; - readonly [n: number]: T; -} - -/** - * Make all properties in T optional - */ -type Partial = { - [P in keyof T]?: T[P]; -}; - -/** - * Make all properties in T readonly - */ -type Readonly = { - readonly [P in keyof T]: T[P]; -}; - -/** - * From T pick a set of properties K - */ -type Pick = { - [P in K]: T[P]; -} - -/** - * Construct a type with a set of properties K of type T - */ -type Record = { - [P in K]: T; -} - -/** - * Represents a raw buffer of binary data, which is used to store data for the - * different typed arrays. ArrayBuffers cannot be read from or written to directly, - * but can be passed to a typed array or DataView Object to interpret the raw - * buffer as needed. - */ -interface ArrayBuffer { - /** - * Read-only. The length of the ArrayBuffer (in bytes). - */ - readonly byteLength: number; - - /** - * Returns a section of an ArrayBuffer. - */ - slice(begin:number, end?:number): ArrayBuffer; -} - -interface ArrayBufferConstructor { - readonly prototype: ArrayBuffer; - new (byteLength: number): ArrayBuffer; - isView(arg: any): arg is ArrayBufferView; -} -declare const ArrayBuffer: ArrayBufferConstructor; - -interface ArrayBufferView { - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; -} - -interface DataView { - readonly buffer: ArrayBuffer; - readonly byteLength: number; - readonly byteOffset: number; - /** - * Gets the Float32 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Float64 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat64(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Int8 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt8(byteOffset: number): number; - - /** - * Gets the Int16 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt16(byteOffset: number, littleEndian?: boolean): number; - /** - * Gets the Int32 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint8 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint8(byteOffset: number): number; - - /** - * Gets the Uint16 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint16(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint32 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Stores an Float32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Float64 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Int8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setInt8(byteOffset: number, value: number): void; - - /** - * Stores an Int16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Int32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setUint8(byteOffset: number, value: number): void; - - /** - * Stores an Uint16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; -} - -interface DataViewConstructor { - new (buffer: ArrayBuffer, byteOffset?: number, byteLength?: number): DataView; -} -declare const DataView: DataViewConstructor; - -/** - * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Int8Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Int8Array) => any, thisArg?: any): Int8Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Int8Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Int8Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int8Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} -interface Int8ArrayConstructor { - readonly prototype: Int8Array; - new (length: number): Int8Array; - new (array: ArrayLike): Int8Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Int8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; - -} -declare const Int8Array: Int8ArrayConstructor; - -/** - * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint8Array) => any, thisArg?: any): Uint8Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint8Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint8Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint8Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Uint8ArrayConstructor { - readonly prototype: Uint8Array; - new (length: number): Uint8Array; - new (array: ArrayLike): Uint8Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; - -} -declare const Uint8Array: Uint8ArrayConstructor; - -/** - * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. - * If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8ClampedArray { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => any, thisArg?: any): Uint8ClampedArray; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint8ClampedArray; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint8ClampedArray, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint8ClampedArray; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint8ClampedArray; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Uint8ClampedArrayConstructor { - readonly prototype: Uint8ClampedArray; - new (length: number): Uint8ClampedArray; - new (array: ArrayLike): Uint8ClampedArray; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8ClampedArray; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint8ClampedArray; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; -} -declare const Uint8ClampedArray: Uint8ClampedArrayConstructor; - -/** - * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int16Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Int16Array) => any, thisArg?: any): Int16Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Int16Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Int16Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int16Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Int16ArrayConstructor { - readonly prototype: Int16Array; - new (length: number): Int16Array; - new (array: ArrayLike): Int16Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Int16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; - -} -declare const Int16Array: Int16ArrayConstructor; - -/** - * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint16Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint16Array) => any, thisArg?: any): Uint16Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint16Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint16Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint16Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Uint16ArrayConstructor { - readonly prototype: Uint16Array; - new (length: number): Uint16Array; - new (array: ArrayLike): Uint16Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; - -} -declare const Uint16Array: Uint16ArrayConstructor; -/** - * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int32Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Int32Array) => any, thisArg?: any): Int32Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Int32Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Int32Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int32Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Int32ArrayConstructor { - readonly prototype: Int32Array; - new (length: number): Int32Array; - new (array: ArrayLike): Int32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Int32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; -} -declare const Int32Array: Int32ArrayConstructor; - -/** - * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint32Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint32Array) => any, thisArg?: any): Uint32Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint32Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint32Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint32Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Uint32ArrayConstructor { - readonly prototype: Uint32Array; - new (length: number): Uint32Array; - new (array: ArrayLike): Uint32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; -} -declare const Uint32Array: Uint32ArrayConstructor; - -/** - * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number - * of bytes could not be allocated an exception is raised. - */ -interface Float32Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Float32Array) => any, thisArg?: any): Float32Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Float32Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Float32Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Float32Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Float32ArrayConstructor { - readonly prototype: Float32Array; - new (length: number): Float32Array; - new (array: ArrayLike): Float32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Float32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; - -} -declare const Float32Array: Float32ArrayConstructor; - -/** - * A typed array of 64-bit float values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Float64Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Float64Array) => any, thisArg?: any): Float64Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Float64Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Float64Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Float64Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Float64ArrayConstructor { - readonly prototype: Float64Array; - new (length: number): Float64Array; - new (array: ArrayLike): Float64Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Float64Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; -} -declare const Float64Array: Float64ArrayConstructor; - -///////////////////////////// -/// ECMAScript Internationalization API -///////////////////////////// - -declare module Intl { - interface CollatorOptions { - usage?: string; - localeMatcher?: string; - numeric?: boolean; - caseFirst?: string; - sensitivity?: string; - ignorePunctuation?: boolean; - } - - interface ResolvedCollatorOptions { - locale: string; - usage: string; - sensitivity: string; - ignorePunctuation: boolean; - collation: string; - caseFirst: string; - numeric: boolean; - } - - interface Collator { - compare(x: string, y: string): number; - resolvedOptions(): ResolvedCollatorOptions; - } - var Collator: { - new (locales?: string | string[], options?: CollatorOptions): Collator; - (locales?: string | string[], options?: CollatorOptions): Collator; - supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[]; - } - - interface NumberFormatOptions { - localeMatcher?: string; - style?: string; - currency?: string; - currencyDisplay?: string; - useGrouping?: boolean; - minimumIntegerDigits?: number; - minimumFractionDigits?: number; - maximumFractionDigits?: number; - minimumSignificantDigits?: number; - maximumSignificantDigits?: number; - } - - interface ResolvedNumberFormatOptions { - locale: string; - numberingSystem: string; - style: string; - currency?: string; - currencyDisplay?: string; - minimumIntegerDigits: number; - minimumFractionDigits: number; - maximumFractionDigits: number; - minimumSignificantDigits?: number; - maximumSignificantDigits?: number; - useGrouping: boolean; - } - - interface NumberFormat { - format(value: number): string; - resolvedOptions(): ResolvedNumberFormatOptions; - } - var NumberFormat: { - new (locales?: string | string[], options?: NumberFormatOptions): NumberFormat; - (locales?: string | string[], options?: NumberFormatOptions): NumberFormat; - supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[]; - } - - interface DateTimeFormatOptions { - localeMatcher?: string; - weekday?: string; - era?: string; - year?: string; - month?: string; - day?: string; - hour?: string; - minute?: string; - second?: string; - timeZoneName?: string; - formatMatcher?: string; - hour12?: boolean; - timeZone?: string; - } - - interface ResolvedDateTimeFormatOptions { - locale: string; - calendar: string; - numberingSystem: string; - timeZone: string; - hour12?: boolean; - weekday?: string; - era?: string; - year?: string; - month?: string; - day?: string; - hour?: string; - minute?: string; - second?: string; - timeZoneName?: string; - } - - interface DateTimeFormat { - format(date?: Date | number): string; - resolvedOptions(): ResolvedDateTimeFormatOptions; - } - var DateTimeFormat: { - new (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat; - (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat; - supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[]; - } -} - -interface String { - /** - * Determines whether two strings are equivalent in the current or specified locale. - * @param that String to compare to target string - * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. - * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. - */ - localeCompare(that: string, locales?: string | string[], options?: Intl.CollatorOptions): number; -} - -interface Number { - /** - * Converts a number to a string by using the current or specified locale. - * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string; -} - -interface Date { - /** - * Converts a date and time to a string by using the current or specified locale. - * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; - /** - * Converts a date to a string by using the current or specified locale. - * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; - - /** - * Converts a time to a string by using the current or specified locale. - * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; -} +///////////////////////////// +/// ECMAScript APIs +///////////////////////////// + +declare const NaN: number; +declare const Infinity: number; + +/** + * Evaluates JavaScript code and executes it. + * @param x A String value that contains valid JavaScript code. + */ +declare function eval(x: string): any; + +/** + * Converts A string to an integer. + * @param s A string to convert into a number. + * @param radix A value between 2 and 36 that specifies the base of the number in numString. + * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. + * All other strings are considered decimal. + */ +declare function parseInt(s: string, radix?: number): number; + +/** + * Converts a string to a floating-point number. + * @param string A string that contains a floating-point number. + */ +declare function parseFloat(string: string): number; + +/** + * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number). + * @param number A numeric value. + */ +declare function isNaN(number: number): boolean; + +/** + * Determines whether a supplied number is finite. + * @param number Any numeric value. + */ +declare function isFinite(number: number): boolean; + +/** + * Gets the unencoded version of an encoded Uniform Resource Identifier (URI). + * @param encodedURI A value representing an encoded URI. + */ +declare function decodeURI(encodedURI: string): string; + +/** + * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI). + * @param encodedURIComponent A value representing an encoded URI component. + */ +declare function decodeURIComponent(encodedURIComponent: string): string; + +/** + * Encodes a text string as a valid Uniform Resource Identifier (URI) + * @param uri A value representing an encoded URI. + */ +declare function encodeURI(uri: string): string; + +/** + * Encodes a text string as a valid component of a Uniform Resource Identifier (URI). + * @param uriComponent A value representing an encoded URI component. + */ +declare function encodeURIComponent(uriComponent: string): string; + +interface PropertyDescriptor { + configurable?: boolean; + enumerable?: boolean; + value?: any; + writable?: boolean; + get? (): any; + set? (v: any): void; +} + +interface PropertyDescriptorMap { + [s: string]: PropertyDescriptor; +} + +interface Object { + /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */ + constructor: Function; + + /** Returns a string representation of an object. */ + toString(): string; + + /** Returns a date converted to a string using the current locale. */ + toLocaleString(): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): Object; + + /** + * Determines whether an object has a property with the specified name. + * @param v A property name. + */ + hasOwnProperty(v: string): boolean; + + /** + * Determines whether an object exists in another object's prototype chain. + * @param v Another object whose prototype chain is to be checked. + */ + isPrototypeOf(v: Object): boolean; + + /** + * Determines whether a specified property is enumerable. + * @param v A property name. + */ + propertyIsEnumerable(v: string): boolean; +} + +interface ObjectConstructor { + new (value?: any): Object; + (): any; + (value: any): any; + + /** A reference to the prototype for a class of objects. */ + readonly prototype: Object; + + /** + * Returns the prototype of an object. + * @param o The object that references the prototype. + */ + getPrototypeOf(o: any): any; + + /** + * Gets the own property descriptor of the specified object. + * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype. + * @param o Object that contains the property. + * @param p Name of the property. + */ + getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; + + /** + * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly + * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. + * @param o Object that contains the own properties. + */ + getOwnPropertyNames(o: any): string[]; + + /** + * Creates an object that has the specified prototype or that has null prototype. + * @param o Object to use as a prototype. May be null. + */ + create(o: object | null): any; + + /** + * Creates an object that has the specified prototype, and that optionally contains specified properties. + * @param o Object to use as a prototype. May be null + * @param properties JavaScript object that contains one or more property descriptors. + */ + create(o: object | null, properties: PropertyDescriptorMap & ThisType): any; + + /** + * Adds a property to an object, or modifies attributes of an existing property. + * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object. + * @param p The property name. + * @param attributes Descriptor for the property. It can be for a data property or an accessor property. + */ + defineProperty(o: any, p: string, attributes: PropertyDescriptor & ThisType): any; + + /** + * Adds one or more properties to an object, and/or modifies attributes of existing properties. + * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object. + * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property. + */ + defineProperties(o: any, properties: PropertyDescriptorMap & ThisType): any; + + /** + * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + seal(o: T): T; + + /** + * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + freeze(a: T[]): ReadonlyArray; + + /** + * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + freeze(f: T): T; + + /** + * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + freeze(o: T): Readonly; + + /** + * Prevents the addition of new properties to an object. + * @param o Object to make non-extensible. + */ + preventExtensions(o: T): T; + + /** + * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. + * @param o Object to test. + */ + isSealed(o: any): boolean; + + /** + * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. + * @param o Object to test. + */ + isFrozen(o: any): boolean; + + /** + * Returns a value that indicates whether new properties can be added to an object. + * @param o Object to test. + */ + isExtensible(o: any): boolean; + + /** + * Returns the names of the enumerable properties and methods of an object. + * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. + */ + keys(o: any): string[]; +} + +/** + * Provides functionality common to all JavaScript objects. + */ +declare const Object: ObjectConstructor; + +/** + * Creates a new function. + */ +interface Function { + /** + * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. + * @param thisArg The object to be used as the this object. + * @param argArray A set of arguments to be passed to the function. + */ + apply(this: Function, thisArg: any, argArray?: any): any; + + /** + * Calls a method of an object, substituting another object for the current object. + * @param thisArg The object to be used as the current object. + * @param argArray A list of arguments to be passed to the method. + */ + call(this: Function, thisArg: any, ...argArray: any[]): any; + + /** + * For a given function, creates a bound function that has the same body as the original function. + * The this object of the bound function is associated with the specified object, and has the specified initial parameters. + * @param thisArg An object to which the this keyword can refer inside the new function. + * @param argArray A list of arguments to be passed to the new function. + */ + bind(this: Function, thisArg: any, ...argArray: any[]): any; + + /** Returns a string representation of a function. */ + toString(): string; + + prototype: any; + readonly length: number; + + // Non-standard extensions + arguments: any; + caller: Function; +} + +interface FunctionConstructor { + /** + * Creates a new function. + * @param args A list of arguments the function accepts. + */ + new (...args: string[]): Function; + (...args: string[]): Function; + readonly prototype: Function; +} + +declare const Function: FunctionConstructor; + +interface IArguments { + [index: number]: any; + length: number; + callee: Function; +} + +interface String { + /** Returns a string representation of a string. */ + toString(): string; + + /** + * Returns the character at the specified index. + * @param pos The zero-based index of the desired character. + */ + charAt(pos: number): string; + + /** + * Returns the Unicode value of the character at the specified location. + * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned. + */ + charCodeAt(index: number): number; + + /** + * Returns a string that contains the concatenation of two or more strings. + * @param strings The strings to append to the end of the string. + */ + concat(...strings: string[]): string; + + /** + * Returns the position of the first occurrence of a substring. + * @param searchString The substring to search for in the string + * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string. + */ + indexOf(searchString: string, position?: number): number; + + /** + * Returns the last occurrence of a substring in the string. + * @param searchString The substring to search for. + * @param position The index at which to begin searching. If omitted, the search begins at the end of the string. + */ + lastIndexOf(searchString: string, position?: number): number; + + /** + * Determines whether two strings are equivalent in the current locale. + * @param that String to compare to target string + */ + localeCompare(that: string): number; + + /** + * Matches a string with a regular expression, and returns an array containing the results of that search. + * @param regexp A variable name or string literal containing the regular expression pattern and flags. + */ + match(regexp: string | RegExp): RegExpMatchArray | null; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A string to search for. + * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. + */ + replace(searchValue: string | RegExp, replaceValue: string): string; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A string to search for. + * @param replacer A function that returns the replacement text. + */ + replace(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; + + /** + * Finds the first substring match in a regular expression search. + * @param regexp The regular expression pattern and applicable flags. + */ + search(regexp: string | RegExp): number; + + /** + * Returns a section of a string. + * @param start The index to the beginning of the specified portion of stringObj. + * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. + * If this value is not specified, the substring continues to the end of stringObj. + */ + slice(start?: number, end?: number): string; + + /** + * Split a string into substrings using the specified separator and return them as an array. + * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. + * @param limit A value used to limit the number of elements returned in the array. + */ + split(separator: string | RegExp, limit?: number): string[]; + + /** + * Returns the substring at the specified location within a String object. + * @param start The zero-based index number indicating the beginning of the substring. + * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. + * If end is omitted, the characters from start through the end of the original string are returned. + */ + substring(start: number, end?: number): string; + + /** Converts all the alphabetic characters in a string to lowercase. */ + toLowerCase(): string; + + /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ + toLocaleLowerCase(): string; + + /** Converts all the alphabetic characters in a string to uppercase. */ + toUpperCase(): string; + + /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */ + toLocaleUpperCase(): string; + + /** Removes the leading and trailing white space and line terminator characters from a string. */ + trim(): string; + + /** Returns the length of a String object. */ + readonly length: number; + + // IE extensions + /** + * Gets a substring beginning at the specified location and having the specified length. + * @param from The starting position of the desired substring. The index of the first character in the string is zero. + * @param length The number of characters to include in the returned substring. + */ + substr(from: number, length?: number): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): string; + + readonly [index: number]: string; +} + +interface StringConstructor { + new (value?: any): String; + (value?: any): string; + readonly prototype: String; + fromCharCode(...codes: number[]): string; +} + +/** + * Allows manipulation and formatting of text strings and determination and location of substrings within strings. + */ +declare const String: StringConstructor; + +interface Boolean { + /** Returns the primitive value of the specified object. */ + valueOf(): boolean; +} + +interface BooleanConstructor { + new (value?: any): Boolean; + (value?: any): boolean; + readonly prototype: Boolean; +} + +declare const Boolean: BooleanConstructor; + +interface Number { + /** + * Returns a string representation of an object. + * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers. + */ + toString(radix?: number): string; + + /** + * Returns a string representing a number in fixed-point notation. + * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. + */ + toFixed(fractionDigits?: number): string; + + /** + * Returns a string containing a number represented in exponential notation. + * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. + */ + toExponential(fractionDigits?: number): string; + + /** + * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits. + * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive. + */ + toPrecision(precision?: number): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): number; +} + +interface NumberConstructor { + new (value?: any): Number; + (value?: any): number; + readonly prototype: Number; + + /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */ + readonly MAX_VALUE: number; + + /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */ + readonly MIN_VALUE: number; + + /** + * A value that is not a number. + * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function. + */ + readonly NaN: number; + + /** + * A value that is less than the largest negative number that can be represented in JavaScript. + * JavaScript displays NEGATIVE_INFINITY values as -infinity. + */ + readonly NEGATIVE_INFINITY: number; + + /** + * A value greater than the largest number that can be represented in JavaScript. + * JavaScript displays POSITIVE_INFINITY values as infinity. + */ + readonly POSITIVE_INFINITY: number; +} + +/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */ +declare const Number: NumberConstructor; + +interface TemplateStringsArray extends ReadonlyArray { + readonly raw: ReadonlyArray; +} + +interface Math { + /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ + readonly E: number; + /** The natural logarithm of 10. */ + readonly LN10: number; + /** The natural logarithm of 2. */ + readonly LN2: number; + /** The base-2 logarithm of e. */ + readonly LOG2E: number; + /** The base-10 logarithm of e. */ + readonly LOG10E: number; + /** Pi. This is the ratio of the circumference of a circle to its diameter. */ + readonly PI: number; + /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */ + readonly SQRT1_2: number; + /** The square root of 2. */ + readonly SQRT2: number; + /** + * Returns the absolute value of a number (the value without regard to whether it is positive or negative). + * For example, the absolute value of -5 is the same as the absolute value of 5. + * @param x A numeric expression for which the absolute value is needed. + */ + abs(x: number): number; + /** + * Returns the arc cosine (or inverse cosine) of a number. + * @param x A numeric expression. + */ + acos(x: number): number; + /** + * Returns the arcsine of a number. + * @param x A numeric expression. + */ + asin(x: number): number; + /** + * Returns the arctangent of a number. + * @param x A numeric expression for which the arctangent is needed. + */ + atan(x: number): number; + /** + * Returns the angle (in radians) from the X axis to a point. + * @param y A numeric expression representing the cartesian y-coordinate. + * @param x A numeric expression representing the cartesian x-coordinate. + */ + atan2(y: number, x: number): number; + /** + * Returns the smallest number greater than or equal to its numeric argument. + * @param x A numeric expression. + */ + ceil(x: number): number; + /** + * Returns the cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + cos(x: number): number; + /** + * Returns e (the base of natural logarithms) raised to a power. + * @param x A numeric expression representing the power of e. + */ + exp(x: number): number; + /** + * Returns the greatest number less than or equal to its numeric argument. + * @param x A numeric expression. + */ + floor(x: number): number; + /** + * Returns the natural logarithm (base e) of a number. + * @param x A numeric expression. + */ + log(x: number): number; + /** + * Returns the larger of a set of supplied numeric expressions. + * @param values Numeric expressions to be evaluated. + */ + max(...values: number[]): number; + /** + * Returns the smaller of a set of supplied numeric expressions. + * @param values Numeric expressions to be evaluated. + */ + min(...values: number[]): number; + /** + * Returns the value of a base expression taken to a specified power. + * @param x The base value of the expression. + * @param y The exponent value of the expression. + */ + pow(x: number, y: number): number; + /** Returns a pseudorandom number between 0 and 1. */ + random(): number; + /** + * Returns a supplied numeric expression rounded to the nearest number. + * @param x The value to be rounded to the nearest number. + */ + round(x: number): number; + /** + * Returns the sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + sin(x: number): number; + /** + * Returns the square root of a number. + * @param x A numeric expression. + */ + sqrt(x: number): number; + /** + * Returns the tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + tan(x: number): number; +} +/** An intrinsic object that provides basic mathematics functionality and constants. */ +declare const Math: Math; + +/** Enables basic storage and retrieval of dates and times. */ +interface Date { + /** Returns a string representation of a date. The format of the string depends on the locale. */ + toString(): string; + /** Returns a date as a string value. */ + toDateString(): string; + /** Returns a time as a string value. */ + toTimeString(): string; + /** Returns a value as a string value appropriate to the host environment's current locale. */ + toLocaleString(): string; + /** Returns a date as a string value appropriate to the host environment's current locale. */ + toLocaleDateString(): string; + /** Returns a time as a string value appropriate to the host environment's current locale. */ + toLocaleTimeString(): string; + /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */ + valueOf(): number; + /** Gets the time value in milliseconds. */ + getTime(): number; + /** Gets the year, using local time. */ + getFullYear(): number; + /** Gets the year using Universal Coordinated Time (UTC). */ + getUTCFullYear(): number; + /** Gets the month, using local time. */ + getMonth(): number; + /** Gets the month of a Date object using Universal Coordinated Time (UTC). */ + getUTCMonth(): number; + /** Gets the day-of-the-month, using local time. */ + getDate(): number; + /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */ + getUTCDate(): number; + /** Gets the day of the week, using local time. */ + getDay(): number; + /** Gets the day of the week using Universal Coordinated Time (UTC). */ + getUTCDay(): number; + /** Gets the hours in a date, using local time. */ + getHours(): number; + /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */ + getUTCHours(): number; + /** Gets the minutes of a Date object, using local time. */ + getMinutes(): number; + /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */ + getUTCMinutes(): number; + /** Gets the seconds of a Date object, using local time. */ + getSeconds(): number; + /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */ + getUTCSeconds(): number; + /** Gets the milliseconds of a Date, using local time. */ + getMilliseconds(): number; + /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */ + getUTCMilliseconds(): number; + /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */ + getTimezoneOffset(): number; + /** + * Sets the date and time value in the Date object. + * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT. + */ + setTime(time: number): number; + /** + * Sets the milliseconds value in the Date object using local time. + * @param ms A numeric value equal to the millisecond value. + */ + setMilliseconds(ms: number): number; + /** + * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). + * @param ms A numeric value equal to the millisecond value. + */ + setUTCMilliseconds(ms: number): number; + + /** + * Sets the seconds value in the Date object using local time. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setSeconds(sec: number, ms?: number): number; + /** + * Sets the seconds value in the Date object using Universal Coordinated Time (UTC). + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCSeconds(sec: number, ms?: number): number; + /** + * Sets the minutes value in the Date object using local time. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setMinutes(min: number, sec?: number, ms?: number): number; + /** + * Sets the minutes value in the Date object using Universal Coordinated Time (UTC). + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCMinutes(min: number, sec?: number, ms?: number): number; + /** + * Sets the hour value in the Date object using local time. + * @param hours A numeric value equal to the hours value. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setHours(hours: number, min?: number, sec?: number, ms?: number): number; + /** + * Sets the hours value in the Date object using Universal Coordinated Time (UTC). + * @param hours A numeric value equal to the hours value. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number; + /** + * Sets the numeric day-of-the-month value of the Date object using local time. + * @param date A numeric value equal to the day of the month. + */ + setDate(date: number): number; + /** + * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). + * @param date A numeric value equal to the day of the month. + */ + setUTCDate(date: number): number; + /** + * Sets the month value in the Date object using local time. + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. + * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used. + */ + setMonth(month: number, date?: number): number; + /** + * Sets the month value in the Date object using Universal Coordinated Time (UTC). + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. + * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used. + */ + setUTCMonth(month: number, date?: number): number; + /** + * Sets the year of the Date object using local time. + * @param year A numeric value for the year. + * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified. + * @param date A numeric value equal for the day of the month. + */ + setFullYear(year: number, month?: number, date?: number): number; + /** + * Sets the year value in the Date object using Universal Coordinated Time (UTC). + * @param year A numeric value equal to the year. + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied. + * @param date A numeric value equal to the day of the month. + */ + setUTCFullYear(year: number, month?: number, date?: number): number; + /** Returns a date converted to a string using Universal Coordinated Time (UTC). */ + toUTCString(): string; + /** Returns a date as a string value in ISO format. */ + toISOString(): string; + /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */ + toJSON(key?: any): string; +} + +interface DateConstructor { + new (): Date; + new (value: number): Date; + new (value: string): Date; + new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; + (): string; + readonly prototype: Date; + /** + * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. + * @param s A date string + */ + parse(s: string): number; + /** + * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date. + * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year. + * @param month The month as an number between 0 and 11 (January to December). + * @param date The date as an number between 1 and 31. + * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour. + * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes. + * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds. + * @param ms An number from 0 to 999 that specifies the milliseconds. + */ + UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; + now(): number; +} + +declare const Date: DateConstructor; + +interface RegExpMatchArray extends Array { + index?: number; + input?: string; +} + +interface RegExpExecArray extends Array { + index: number; + input: string; +} + +interface RegExp { + /** + * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. + * @param string The String object or string literal on which to perform the search. + */ + exec(string: string): RegExpExecArray | null; + + /** + * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. + * @param string String on which to perform the search. + */ + test(string: string): boolean; + + /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */ + readonly source: string; + + /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ + readonly global: boolean; + + /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */ + readonly ignoreCase: boolean; + + /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */ + readonly multiline: boolean; + + lastIndex: number; + + // Non-standard extensions + compile(): this; +} + +interface RegExpConstructor { + new (pattern: RegExp | string): RegExp; + new (pattern: string, flags?: string): RegExp; + (pattern: RegExp | string): RegExp; + (pattern: string, flags?: string): RegExp; + readonly prototype: RegExp; + + // Non-standard extensions + $1: string; + $2: string; + $3: string; + $4: string; + $5: string; + $6: string; + $7: string; + $8: string; + $9: string; + lastMatch: string; +} + +declare const RegExp: RegExpConstructor; + +interface Error { + name: string; + message: string; + stack?: string; +} + +interface ErrorConstructor { + new (message?: string): Error; + (message?: string): Error; + readonly prototype: Error; +} + +declare const Error: ErrorConstructor; + +interface EvalError extends Error { +} + +interface EvalErrorConstructor { + new (message?: string): EvalError; + (message?: string): EvalError; + readonly prototype: EvalError; +} + +declare const EvalError: EvalErrorConstructor; + +interface RangeError extends Error { +} + +interface RangeErrorConstructor { + new (message?: string): RangeError; + (message?: string): RangeError; + readonly prototype: RangeError; +} + +declare const RangeError: RangeErrorConstructor; + +interface ReferenceError extends Error { +} + +interface ReferenceErrorConstructor { + new (message?: string): ReferenceError; + (message?: string): ReferenceError; + readonly prototype: ReferenceError; +} + +declare const ReferenceError: ReferenceErrorConstructor; + +interface SyntaxError extends Error { +} + +interface SyntaxErrorConstructor { + new (message?: string): SyntaxError; + (message?: string): SyntaxError; + readonly prototype: SyntaxError; +} + +declare const SyntaxError: SyntaxErrorConstructor; + +interface TypeError extends Error { +} + +interface TypeErrorConstructor { + new (message?: string): TypeError; + (message?: string): TypeError; + readonly prototype: TypeError; +} + +declare const TypeError: TypeErrorConstructor; + +interface URIError extends Error { +} + +interface URIErrorConstructor { + new (message?: string): URIError; + (message?: string): URIError; + readonly prototype: URIError; +} + +declare const URIError: URIErrorConstructor; + +interface JSON { + /** + * Converts a JavaScript Object Notation (JSON) string into an object. + * @param text A valid JSON string. + * @param reviver A function that transforms the results. This function is called for each member of the object. + * If a member contains nested objects, the nested objects are transformed before the parent object is. + */ + parse(text: string, reviver?: (key: any, value: any) => any): any; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer A function that transforms the results. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + */ + stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer An array of strings and numbers that acts as a approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + */ + stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string; +} + +/** + * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format. + */ +declare const JSON: JSON; + + +///////////////////////////// +/// ECMAScript Array API (specially handled by compiler) +///////////////////////////// + +interface ReadonlyArray { + /** + * Gets the length of the array. This is a number one higher than the highest element defined in an array. + */ + readonly length: number; + /** + * Returns a string representation of an array. + */ + toString(): string; + toLocaleString(): string; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat>(...items: U[]): T[]; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: T[][]): T[]; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: (T | T[])[]): T[]; + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): T[]; + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. + */ + indexOf(searchElement: T, fromIndex?: number): number; + + /** + * Returns the index of the last occurrence of a specified value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. + */ + lastIndexOf(searchElement: T, fromIndex?: number): number; + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => boolean): boolean; + every(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => boolean, thisArg: Z): boolean; + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => boolean): boolean; + some(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => boolean, thisArg: Z): boolean; + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => void): void; + forEach(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => void, thisArg: Z): void; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => U): U[]; + map(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => U, thisArg: undefined): U[]; + map(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => U, thisArg: Z): U[]; + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => value is S): S[]; + filter(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => value is S, thisArg: undefined): S[]; + filter(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => value is S, thisArg: Z): S[]; + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => any): T[]; + filter(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => any, thisArg: undefined): T[]; + filter(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => any, thisArg: Z): T[]; + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue?: T): T; + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U; + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue?: T): T; + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U; + + readonly [n: number]: T; +} + +interface Array { + /** + * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. + */ + length: number; + /** + * Returns a string representation of an array. + */ + toString(): string; + toLocaleString(): string; + /** + * Appends new elements to an array, and returns the new length of the array. + * @param items New elements of the Array. + */ + push(...items: T[]): number; + /** + * Removes the last element from an array and returns it. + */ + pop(): T | undefined; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: T[][]): T[]; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: (T | T[])[]): T[]; + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + /** + * Reverses the elements in an Array. + */ + reverse(): T[]; + /** + * Removes the first element from an array and returns it. + */ + shift(): T | undefined; + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): T[]; + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: T, b: T) => number): this; + /** + * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. + * @param start The zero-based location in the array from which to start removing elements. + * @param deleteCount The number of elements to remove. + */ + splice(start: number, deleteCount?: number): T[]; + /** + * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. + * @param start The zero-based location in the array from which to start removing elements. + * @param deleteCount The number of elements to remove. + * @param items Elements to insert into the array in place of the deleted elements. + */ + splice(start: number, deleteCount: number, ...items: T[]): T[]; + /** + * Inserts new elements at the start of an array. + * @param items Elements to insert at the start of the Array. + */ + unshift(...items: T[]): number; + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. + */ + indexOf(searchElement: T, fromIndex?: number): number; + /** + * Returns the index of the last occurrence of a specified value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. + */ + lastIndexOf(searchElement: T, fromIndex?: number): number; + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: T, index: number, array: T[]) => boolean): boolean; + every(callbackfn: (this: void, value: T, index: number, array: T[]) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: T, index: number, array: T[]) => boolean, thisArg: Z): boolean; + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: T, index: number, array: T[]) => boolean): boolean; + some(callbackfn: (this: void, value: T, index: number, array: T[]) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: T, index: number, array: T[]) => boolean, thisArg: Z): boolean; + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: T, index: number, array: T[]) => void): void; + forEach(callbackfn: (this: void, value: T, index: number, array: T[]) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: T, index: number, array: T[]) => void, thisArg: Z): void; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U, U]; + map(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U, U]; + map(this: [T, T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U, U]; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U]; + map(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U]; + map(this: [T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U]; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U]; + map(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U]; + map(this: [T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U]; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U]; + map(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U]; + map(this: [T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U]; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: T, index: number, array: T[]) => U): U[]; + map(callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): U[]; + map(callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): U[]; + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: T, index: number, array: T[]) => any): T[]; + filter(callbackfn: (this: void, value: T, index: number, array: T[]) => any, thisArg: undefined): T[]; + filter(callbackfn: (this: Z, value: T, index: number, array: T[]) => any, thisArg: Z): T[]; + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + + [n: number]: T; +} + +interface ArrayConstructor { + new (arrayLength?: number): any[]; + new (arrayLength: number): T[]; + new (...items: T[]): T[]; + (arrayLength?: number): any[]; + (arrayLength: number): T[]; + (...items: T[]): T[]; + isArray(arg: any): arg is Array; + readonly prototype: Array; +} + +declare const Array: ArrayConstructor; + +interface TypedPropertyDescriptor { + enumerable?: boolean; + configurable?: boolean; + writable?: boolean; + value?: T; + get?: () => T; + set?: (value: T) => void; +} + +declare type ClassDecorator = (target: TFunction) => TFunction | void; +declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; +declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; +declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; + +declare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike; + +interface PromiseLike { + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): PromiseLike; +} + +/** + * Represents the completion of an asynchronous operation + */ +interface Promise { + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; + + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; +} + +interface ArrayLike { + readonly length: number; + readonly [n: number]: T; +} + +/** + * Make all properties in T optional + */ +type Partial = { + [P in keyof T]?: T[P]; +}; + +/** + * Make all properties in T readonly + */ +type Readonly = { + readonly [P in keyof T]: T[P]; +}; + +/** + * From T pick a set of properties K + */ +type Pick = { + [P in K]: T[P]; +}; + +/** + * Construct a type with a set of properties K of type T + */ +type Record = { + [P in K]: T; +}; + +/** + * Marker for contextual 'this' type + */ +interface ThisType { } + +/** + * Represents a raw buffer of binary data, which is used to store data for the + * different typed arrays. ArrayBuffers cannot be read from or written to directly, + * but can be passed to a typed array or DataView Object to interpret the raw + * buffer as needed. + */ +interface ArrayBuffer { + /** + * Read-only. The length of the ArrayBuffer (in bytes). + */ + readonly byteLength: number; + + /** + * Returns a section of an ArrayBuffer. + */ + slice(begin: number, end?: number): ArrayBuffer; +} + +interface ArrayBufferConstructor { + readonly prototype: ArrayBuffer; + new (byteLength: number): ArrayBuffer; + isView(arg: any): arg is ArrayBufferView; +} +declare const ArrayBuffer: ArrayBufferConstructor; + +interface ArrayBufferView { + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; +} + +interface DataView { + readonly buffer: ArrayBuffer; + readonly byteLength: number; + readonly byteOffset: number; + /** + * Gets the Float32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Float64 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat64(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Int8 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt8(byteOffset: number): number; + + /** + * Gets the Int16 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt16(byteOffset: number, littleEndian?: boolean): number; + /** + * Gets the Int32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Uint8 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint8(byteOffset: number): number; + + /** + * Gets the Uint16 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint16(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Uint32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Stores an Float32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Float64 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Int8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setInt8(byteOffset: number, value: number): void; + + /** + * Stores an Int16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Int32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Uint8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setUint8(byteOffset: number, value: number): void; + + /** + * Stores an Uint16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Uint32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; +} + +interface DataViewConstructor { + new (buffer: ArrayBuffer, byteOffset?: number, byteLength?: number): DataView; +} +declare const DataView: DataViewConstructor; + +/** + * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Int8Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Int8Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Int8Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Int8Array) => any): Int8Array; + filter(callbackfn: (this: void, value: number, index: number, array: Int8Array) => any, thisArg: undefined): Int8Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => any, thisArg: Z): Int8Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Int8Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Int8Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Int8Array) => number): Int8Array; + map(callbackfn: (this: void, value: number, index: number, array: Int8Array) => number, thisArg: undefined): Int8Array; + map(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => number, thisArg: Z): Int8Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int8Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Int8Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Int8Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Int8Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int8Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} +interface Int8ArrayConstructor { + readonly prototype: Int8Array; + new (length: number): Int8Array; + new (array: ArrayLike): Int8Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Int8Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int8Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int8Array; + + from(arrayLike: ArrayLike): Int8Array; + +} +declare const Int8Array: Int8ArrayConstructor; + +/** + * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => any): Uint8Array; + filter(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => any, thisArg: undefined): Uint8Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => any, thisArg: Z): Uint8Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => number): Uint8Array; + map(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => number, thisArg: undefined): Uint8Array; + map(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => number, thisArg: Z): Uint8Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint8Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Uint8Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint8Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Uint8ArrayConstructor { + readonly prototype: Uint8Array; + new (length: number): Uint8Array; + new (array: ArrayLike): Uint8Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Uint8Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8Array; + + from(arrayLike: ArrayLike): Uint8Array; + +} +declare const Uint8Array: Uint8ArrayConstructor; + +/** + * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. + * If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8ClampedArray { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => any): Uint8ClampedArray; + filter(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => any, thisArg: undefined): Uint8ClampedArray; + filter(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => any, thisArg: Z): Uint8ClampedArray; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => number): Uint8ClampedArray; + map(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => number, thisArg: undefined): Uint8ClampedArray; + map(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => number, thisArg: Z): Uint8ClampedArray; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint8ClampedArray; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Uint8ClampedArray, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Uint8ClampedArray; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint8ClampedArray; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Uint8ClampedArrayConstructor { + readonly prototype: Uint8ClampedArray; + new (length: number): Uint8ClampedArray; + new (array: ArrayLike): Uint8ClampedArray; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8ClampedArray; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint8ClampedArray; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Uint8ClampedArray; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8ClampedArray; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8ClampedArray; + + from(arrayLike: ArrayLike): Uint8ClampedArray; +} +declare const Uint8ClampedArray: Uint8ClampedArrayConstructor; + +/** + * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int16Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Int16Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Int16Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Int16Array) => any): Int16Array; + filter(callbackfn: (this: void, value: number, index: number, array: Int16Array) => any, thisArg: undefined): Int16Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => any, thisArg: Z): Int16Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Int16Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Int16Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Int16Array) => number): Int16Array; + map(callbackfn: (this: void, value: number, index: number, array: Int16Array) => number, thisArg: undefined): Int16Array; + map(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => number, thisArg: Z): Int16Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int16Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Int16Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Int16Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Int16Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int16Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Int16ArrayConstructor { + readonly prototype: Int16Array; + new (length: number): Int16Array; + new (array: ArrayLike): Int16Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Int16Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int16Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int16Array; + + from(arrayLike: ArrayLike): Int16Array; + +} +declare const Int16Array: Int16ArrayConstructor; + +/** + * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint16Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => any): Uint16Array; + filter(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => any, thisArg: undefined): Uint16Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => any, thisArg: Z): Uint16Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => number): Uint16Array; + map(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => number, thisArg: undefined): Uint16Array; + map(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => number, thisArg: Z): Uint16Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint16Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Uint16Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint16Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Uint16ArrayConstructor { + readonly prototype: Uint16Array; + new (length: number): Uint16Array; + new (array: ArrayLike): Uint16Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Uint16Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint16Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint16Array; + + from(arrayLike: ArrayLike): Uint16Array; + +} +declare const Uint16Array: Uint16ArrayConstructor; +/** + * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int32Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Int32Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Int32Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Int32Array) => any): Int32Array; + filter(callbackfn: (this: void, value: number, index: number, array: Int32Array) => any, thisArg: undefined): Int32Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => any, thisArg: Z): Int32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Int32Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Int32Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Int32Array) => number): Int32Array; + map(callbackfn: (this: void, value: number, index: number, array: Int32Array) => number, thisArg: undefined): Int32Array; + map(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => number, thisArg: Z): Int32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int32Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Int32Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Int32Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Int32Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Int32ArrayConstructor { + readonly prototype: Int32Array; + new (length: number): Int32Array; + new (array: ArrayLike): Int32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Int32Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int32Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int32Array; + + from(arrayLike: ArrayLike): Int32Array; +} +declare const Int32Array: Int32ArrayConstructor; + +/** + * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint32Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => any): Uint32Array; + filter(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => any, thisArg: undefined): Uint32Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => any, thisArg: Z): Uint32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => number): Uint32Array; + map(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => number, thisArg: undefined): Uint32Array; + map(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => number, thisArg: Z): Uint32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint32Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Uint32Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Uint32ArrayConstructor { + readonly prototype: Uint32Array; + new (length: number): Uint32Array; + new (array: ArrayLike): Uint32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Uint32Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint32Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint32Array; + + from(arrayLike: ArrayLike): Uint32Array; +} +declare const Uint32Array: Uint32ArrayConstructor; + +/** + * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number + * of bytes could not be allocated an exception is raised. + */ +interface Float32Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Float32Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Float32Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Float32Array) => any): Float32Array; + filter(callbackfn: (this: void, value: number, index: number, array: Float32Array) => any, thisArg: undefined): Float32Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => any, thisArg: Z): Float32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Float32Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Float32Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Float32Array) => number): Float32Array; + map(callbackfn: (this: void, value: number, index: number, array: Float32Array) => number, thisArg: undefined): Float32Array; + map(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => number, thisArg: Z): Float32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Float32Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Float32Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Float32Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Float32Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Float32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Float32ArrayConstructor { + readonly prototype: Float32Array; + new (length: number): Float32Array; + new (array: ArrayLike): Float32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Float32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Float32Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float32Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float32Array; + + from(arrayLike: ArrayLike): Float32Array; + +} +declare const Float32Array: Float32ArrayConstructor; + +/** + * A typed array of 64-bit float values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Float64Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Float64Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Float64Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Float64Array) => any): Float64Array; + filter(callbackfn: (this: void, value: number, index: number, array: Float64Array) => any, thisArg: undefined): Float64Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => any, thisArg: Z): Float64Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Float64Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Float64Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Float64Array) => number): Float64Array; + map(callbackfn: (this: void, value: number, index: number, array: Float64Array) => number, thisArg: undefined): Float64Array; + map(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => number, thisArg: Z): Float64Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Float64Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Float64Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Float64Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Float64Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Float64Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Float64ArrayConstructor { + readonly prototype: Float64Array; + new (length: number): Float64Array; + new (array: ArrayLike): Float64Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Float64Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Float64Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float64Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float64Array; + + from(arrayLike: ArrayLike): Float64Array; +} +declare const Float64Array: Float64ArrayConstructor; + +///////////////////////////// +/// ECMAScript Internationalization API +///////////////////////////// + +declare namespace Intl { + interface CollatorOptions { + usage?: string; + localeMatcher?: string; + numeric?: boolean; + caseFirst?: string; + sensitivity?: string; + ignorePunctuation?: boolean; + } + + interface ResolvedCollatorOptions { + locale: string; + usage: string; + sensitivity: string; + ignorePunctuation: boolean; + collation: string; + caseFirst: string; + numeric: boolean; + } + + interface Collator { + compare(x: string, y: string): number; + resolvedOptions(): ResolvedCollatorOptions; + } + var Collator: { + new (locales?: string | string[], options?: CollatorOptions): Collator; + (locales?: string | string[], options?: CollatorOptions): Collator; + supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[]; + }; + + interface NumberFormatOptions { + localeMatcher?: string; + style?: string; + currency?: string; + currencyDisplay?: string; + useGrouping?: boolean; + minimumIntegerDigits?: number; + minimumFractionDigits?: number; + maximumFractionDigits?: number; + minimumSignificantDigits?: number; + maximumSignificantDigits?: number; + } + + interface ResolvedNumberFormatOptions { + locale: string; + numberingSystem: string; + style: string; + currency?: string; + currencyDisplay?: string; + minimumIntegerDigits: number; + minimumFractionDigits: number; + maximumFractionDigits: number; + minimumSignificantDigits?: number; + maximumSignificantDigits?: number; + useGrouping: boolean; + } + + interface NumberFormat { + format(value: number): string; + resolvedOptions(): ResolvedNumberFormatOptions; + } + var NumberFormat: { + new (locales?: string | string[], options?: NumberFormatOptions): NumberFormat; + (locales?: string | string[], options?: NumberFormatOptions): NumberFormat; + supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[]; + }; + + interface DateTimeFormatOptions { + localeMatcher?: string; + weekday?: string; + era?: string; + year?: string; + month?: string; + day?: string; + hour?: string; + minute?: string; + second?: string; + timeZoneName?: string; + formatMatcher?: string; + hour12?: boolean; + timeZone?: string; + } + + interface ResolvedDateTimeFormatOptions { + locale: string; + calendar: string; + numberingSystem: string; + timeZone: string; + hour12?: boolean; + weekday?: string; + era?: string; + year?: string; + month?: string; + day?: string; + hour?: string; + minute?: string; + second?: string; + timeZoneName?: string; + } + + interface DateTimeFormat { + format(date?: Date | number): string; + resolvedOptions(): ResolvedDateTimeFormatOptions; + } + var DateTimeFormat: { + new (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat; + (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat; + supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[]; + }; +} + +interface String { + /** + * Determines whether two strings are equivalent in the current or specified locale. + * @param that String to compare to target string + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. + * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. + */ + localeCompare(that: string, locales?: string | string[], options?: Intl.CollatorOptions): number; +} + +interface Number { + /** + * Converts a number to a string by using the current or specified locale. + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string; +} + +interface Date { + /** + * Converts a date and time to a string by using the current or specified locale. + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; + /** + * Converts a date to a string by using the current or specified locale. + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; + + /** + * Converts a time to a string by using the current or specified locale. + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; +} diff --git a/node_modules/typescript/lib/lib.es6.d.ts b/node_modules/typescript/lib/lib.es6.d.ts index e2b9565d8..9136af437 100644 --- a/node_modules/typescript/lib/lib.es6.d.ts +++ b/node_modules/typescript/lib/lib.es6.d.ts @@ -1,19950 +1,21514 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ -/// + +/// -///////////////////////////// -/// ECMAScript APIs -///////////////////////////// - -declare const NaN: number; -declare const Infinity: number; - -/** - * Evaluates JavaScript code and executes it. - * @param x A String value that contains valid JavaScript code. - */ -declare function eval(x: string): any; - -/** - * Converts A string to an integer. - * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. - * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. - * All other strings are considered decimal. - */ -declare function parseInt(s: string, radix?: number): number; - -/** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. - */ -declare function parseFloat(string: string): number; - -/** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number). - * @param number A numeric value. - */ -declare function isNaN(number: number): boolean; - -/** - * Determines whether a supplied number is finite. - * @param number Any numeric value. - */ -declare function isFinite(number: number): boolean; - -/** - * Gets the unencoded version of an encoded Uniform Resource Identifier (URI). - * @param encodedURI A value representing an encoded URI. - */ -declare function decodeURI(encodedURI: string): string; - -/** - * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI). - * @param encodedURIComponent A value representing an encoded URI component. - */ -declare function decodeURIComponent(encodedURIComponent: string): string; - -/** - * Encodes a text string as a valid Uniform Resource Identifier (URI) - * @param uri A value representing an encoded URI. - */ -declare function encodeURI(uri: string): string; - -/** - * Encodes a text string as a valid component of a Uniform Resource Identifier (URI). - * @param uriComponent A value representing an encoded URI component. - */ -declare function encodeURIComponent(uriComponent: string): string; - -interface PropertyDescriptor { - configurable?: boolean; - enumerable?: boolean; - value?: any; - writable?: boolean; - get? (): any; - set? (v: any): void; -} - -interface PropertyDescriptorMap { - [s: string]: PropertyDescriptor; -} - -interface Object { - /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */ - constructor: Function; - - /** Returns a string representation of an object. */ - toString(): string; - - /** Returns a date converted to a string using the current locale. */ - toLocaleString(): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): Object; - - /** - * Determines whether an object has a property with the specified name. - * @param v A property name. - */ - hasOwnProperty(v: string): boolean; - - /** - * Determines whether an object exists in another object's prototype chain. - * @param v Another object whose prototype chain is to be checked. - */ - isPrototypeOf(v: Object): boolean; - - /** - * Determines whether a specified property is enumerable. - * @param v A property name. - */ - propertyIsEnumerable(v: string): boolean; -} - -interface ObjectConstructor { - new (value?: any): Object; - (): any; - (value: any): any; - - /** A reference to the prototype for a class of objects. */ - readonly prototype: Object; - - /** - * Returns the prototype of an object. - * @param o The object that references the prototype. - */ - getPrototypeOf(o: any): any; - - /** - * Gets the own property descriptor of the specified object. - * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype. - * @param o Object that contains the property. - * @param p Name of the property. - */ - getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; - - /** - * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly - * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. - * @param o Object that contains the own properties. - */ - getOwnPropertyNames(o: any): string[]; - - /** - * Creates an object that has null prototype. - * @param o Object to use as a prototype. May be null - */ - create(o: null): any; - - /** - * Creates an object that has the specified prototype, and that optionally contains specified properties. - * @param o Object to use as a prototype. May be null - */ - create(o: T): T; - - /** - * Creates an object that has the specified prototype, and that optionally contains specified properties. - * @param o Object to use as a prototype. May be null - * @param properties JavaScript object that contains one or more property descriptors. - */ - create(o: any, properties: PropertyDescriptorMap): any; - - /** - * Adds a property to an object, or modifies attributes of an existing property. - * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object. - * @param p The property name. - * @param attributes Descriptor for the property. It can be for a data property or an accessor property. - */ - defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; - - /** - * Adds one or more properties to an object, and/or modifies attributes of existing properties. - * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object. - * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property. - */ - defineProperties(o: any, properties: PropertyDescriptorMap): any; - - /** - * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - seal(o: T): T; - - /** - * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - freeze(a: T[]): ReadonlyArray; - - /** - * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - freeze(f: T): T; - - /** - * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - freeze(o: T): Readonly; - - /** - * Prevents the addition of new properties to an object. - * @param o Object to make non-extensible. - */ - preventExtensions(o: T): T; - - /** - * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. - * @param o Object to test. - */ - isSealed(o: any): boolean; - - /** - * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. - * @param o Object to test. - */ - isFrozen(o: any): boolean; - - /** - * Returns a value that indicates whether new properties can be added to an object. - * @param o Object to test. - */ - isExtensible(o: any): boolean; - - /** - * Returns the names of the enumerable properties and methods of an object. - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ - keys(o: any): string[]; -} - -/** - * Provides functionality common to all JavaScript objects. - */ -declare const Object: ObjectConstructor; - -/** - * Creates a new function. - */ -interface Function { - /** - * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. - * @param thisArg The object to be used as the this object. - * @param argArray A set of arguments to be passed to the function. - */ - apply(this: Function, thisArg: any, argArray?: any): any; - - /** - * Calls a method of an object, substituting another object for the current object. - * @param thisArg The object to be used as the current object. - * @param argArray A list of arguments to be passed to the method. - */ - call(this: Function, thisArg: any, ...argArray: any[]): any; - - /** - * For a given function, creates a bound function that has the same body as the original function. - * The this object of the bound function is associated with the specified object, and has the specified initial parameters. - * @param thisArg An object to which the this keyword can refer inside the new function. - * @param argArray A list of arguments to be passed to the new function. - */ - bind(this: Function, thisArg: any, ...argArray: any[]): any; - - /** Returns a string representation of a function. */ - toString(): string; - - prototype: any; - readonly length: number; - - // Non-standard extensions - arguments: any; - caller: Function; -} - -interface FunctionConstructor { - /** - * Creates a new function. - * @param args A list of arguments the function accepts. - */ - new (...args: string[]): Function; - (...args: string[]): Function; - readonly prototype: Function; -} - -declare const Function: FunctionConstructor; - -interface IArguments { - [index: number]: any; - length: number; - callee: Function; -} - -interface String { - /** Returns a string representation of a string. */ - toString(): string; - - /** - * Returns the character at the specified index. - * @param pos The zero-based index of the desired character. - */ - charAt(pos: number): string; - - /** - * Returns the Unicode value of the character at the specified location. - * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned. - */ - charCodeAt(index: number): number; - - /** - * Returns a string that contains the concatenation of two or more strings. - * @param strings The strings to append to the end of the string. - */ - concat(...strings: string[]): string; - - /** - * Returns the position of the first occurrence of a substring. - * @param searchString The substring to search for in the string - * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string. - */ - indexOf(searchString: string, position?: number): number; - - /** - * Returns the last occurrence of a substring in the string. - * @param searchString The substring to search for. - * @param position The index at which to begin searching. If omitted, the search begins at the end of the string. - */ - lastIndexOf(searchString: string, position?: number): number; - - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - */ - localeCompare(that: string): number; - - /** - * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A variable name or string literal containing the regular expression pattern and flags. - */ - match(regexp: string): RegExpMatchArray | null; - - /** - * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A regular expression object that contains the regular expression pattern and applicable flags. - */ - match(regexp: RegExp): RegExpMatchArray | null; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A string that represents the regular expression. - * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. - */ - replace(searchValue: string, replaceValue: string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A string that represents the regular expression. - * @param replacer A function that returns the replacement text. - */ - replace(searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags. - * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. - */ - replace(searchValue: RegExp, replaceValue: string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags - * @param replacer A function that returns the replacement text. - */ - replace(searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; - - /** - * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. - */ - search(regexp: string): number; - - /** - * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. - */ - search(regexp: RegExp): number; - - /** - * Returns a section of a string. - * @param start The index to the beginning of the specified portion of stringObj. - * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. - * If this value is not specified, the substring continues to the end of stringObj. - */ - slice(start?: number, end?: number): string; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(separator: string, limit?: number): string[]; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param separator A Regular Express that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(separator: RegExp, limit?: number): string[]; - - /** - * Returns the substring at the specified location within a String object. - * @param start The zero-based index number indicating the beginning of the substring. - * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. - * If end is omitted, the characters from start through the end of the original string are returned. - */ - substring(start: number, end?: number): string; - - /** Converts all the alphabetic characters in a string to lowercase. */ - toLowerCase(): string; - - /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ - toLocaleLowerCase(): string; - - /** Converts all the alphabetic characters in a string to uppercase. */ - toUpperCase(): string; - - /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */ - toLocaleUpperCase(): string; - - /** Removes the leading and trailing white space and line terminator characters from a string. */ - trim(): string; - - /** Returns the length of a String object. */ - readonly length: number; - - // IE extensions - /** - * Gets a substring beginning at the specified location and having the specified length. - * @param from The starting position of the desired substring. The index of the first character in the string is zero. - * @param length The number of characters to include in the returned substring. - */ - substr(from: number, length?: number): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): string; - - readonly [index: number]: string; -} - -interface StringConstructor { - new (value?: any): String; - (value?: any): string; - readonly prototype: String; - fromCharCode(...codes: number[]): string; -} - -/** - * Allows manipulation and formatting of text strings and determination and location of substrings within strings. - */ -declare const String: StringConstructor; - -interface Boolean { - /** Returns the primitive value of the specified object. */ - valueOf(): boolean; -} - -interface BooleanConstructor { - new (value?: any): Boolean; - (value?: any): boolean; - readonly prototype: Boolean; -} - -declare const Boolean: BooleanConstructor; - -interface Number { - /** - * Returns a string representation of an object. - * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers. - */ - toString(radix?: number): string; - - /** - * Returns a string representing a number in fixed-point notation. - * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. - */ - toFixed(fractionDigits?: number): string; - - /** - * Returns a string containing a number represented in exponential notation. - * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. - */ - toExponential(fractionDigits?: number): string; - - /** - * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits. - * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive. - */ - toPrecision(precision?: number): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): number; -} - -interface NumberConstructor { - new (value?: any): Number; - (value?: any): number; - readonly prototype: Number; - - /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */ - readonly MAX_VALUE: number; - - /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */ - readonly MIN_VALUE: number; - - /** - * A value that is not a number. - * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function. - */ - readonly NaN: number; - - /** - * A value that is less than the largest negative number that can be represented in JavaScript. - * JavaScript displays NEGATIVE_INFINITY values as -infinity. - */ - readonly NEGATIVE_INFINITY: number; - - /** - * A value greater than the largest number that can be represented in JavaScript. - * JavaScript displays POSITIVE_INFINITY values as infinity. - */ - readonly POSITIVE_INFINITY: number; -} - -/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */ -declare const Number: NumberConstructor; - -interface TemplateStringsArray extends ReadonlyArray { - readonly raw: ReadonlyArray -} - -interface Math { - /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ - readonly E: number; - /** The natural logarithm of 10. */ - readonly LN10: number; - /** The natural logarithm of 2. */ - readonly LN2: number; - /** The base-2 logarithm of e. */ - readonly LOG2E: number; - /** The base-10 logarithm of e. */ - readonly LOG10E: number; - /** Pi. This is the ratio of the circumference of a circle to its diameter. */ - readonly PI: number; - /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */ - readonly SQRT1_2: number; - /** The square root of 2. */ - readonly SQRT2: number; - /** - * Returns the absolute value of a number (the value without regard to whether it is positive or negative). - * For example, the absolute value of -5 is the same as the absolute value of 5. - * @param x A numeric expression for which the absolute value is needed. - */ - abs(x: number): number; - /** - * Returns the arc cosine (or inverse cosine) of a number. - * @param x A numeric expression. - */ - acos(x: number): number; - /** - * Returns the arcsine of a number. - * @param x A numeric expression. - */ - asin(x: number): number; - /** - * Returns the arctangent of a number. - * @param x A numeric expression for which the arctangent is needed. - */ - atan(x: number): number; - /** - * Returns the angle (in radians) from the X axis to a point. - * @param y A numeric expression representing the cartesian y-coordinate. - * @param x A numeric expression representing the cartesian x-coordinate. - */ - atan2(y: number, x: number): number; - /** - * Returns the smallest number greater than or equal to its numeric argument. - * @param x A numeric expression. - */ - ceil(x: number): number; - /** - * Returns the cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - cos(x: number): number; - /** - * Returns e (the base of natural logarithms) raised to a power. - * @param x A numeric expression representing the power of e. - */ - exp(x: number): number; - /** - * Returns the greatest number less than or equal to its numeric argument. - * @param x A numeric expression. - */ - floor(x: number): number; - /** - * Returns the natural logarithm (base e) of a number. - * @param x A numeric expression. - */ - log(x: number): number; - /** - * Returns the larger of a set of supplied numeric expressions. - * @param values Numeric expressions to be evaluated. - */ - max(...values: number[]): number; - /** - * Returns the smaller of a set of supplied numeric expressions. - * @param values Numeric expressions to be evaluated. - */ - min(...values: number[]): number; - /** - * Returns the value of a base expression taken to a specified power. - * @param x The base value of the expression. - * @param y The exponent value of the expression. - */ - pow(x: number, y: number): number; - /** Returns a pseudorandom number between 0 and 1. */ - random(): number; - /** - * Returns a supplied numeric expression rounded to the nearest number. - * @param x The value to be rounded to the nearest number. - */ - round(x: number): number; - /** - * Returns the sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - sin(x: number): number; - /** - * Returns the square root of a number. - * @param x A numeric expression. - */ - sqrt(x: number): number; - /** - * Returns the tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - tan(x: number): number; -} -/** An intrinsic object that provides basic mathematics functionality and constants. */ -declare const Math: Math; - -/** Enables basic storage and retrieval of dates and times. */ -interface Date { - /** Returns a string representation of a date. The format of the string depends on the locale. */ - toString(): string; - /** Returns a date as a string value. */ - toDateString(): string; - /** Returns a time as a string value. */ - toTimeString(): string; - /** Returns a value as a string value appropriate to the host environment's current locale. */ - toLocaleString(): string; - /** Returns a date as a string value appropriate to the host environment's current locale. */ - toLocaleDateString(): string; - /** Returns a time as a string value appropriate to the host environment's current locale. */ - toLocaleTimeString(): string; - /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */ - valueOf(): number; - /** Gets the time value in milliseconds. */ - getTime(): number; - /** Gets the year, using local time. */ - getFullYear(): number; - /** Gets the year using Universal Coordinated Time (UTC). */ - getUTCFullYear(): number; - /** Gets the month, using local time. */ - getMonth(): number; - /** Gets the month of a Date object using Universal Coordinated Time (UTC). */ - getUTCMonth(): number; - /** Gets the day-of-the-month, using local time. */ - getDate(): number; - /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */ - getUTCDate(): number; - /** Gets the day of the week, using local time. */ - getDay(): number; - /** Gets the day of the week using Universal Coordinated Time (UTC). */ - getUTCDay(): number; - /** Gets the hours in a date, using local time. */ - getHours(): number; - /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */ - getUTCHours(): number; - /** Gets the minutes of a Date object, using local time. */ - getMinutes(): number; - /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */ - getUTCMinutes(): number; - /** Gets the seconds of a Date object, using local time. */ - getSeconds(): number; - /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */ - getUTCSeconds(): number; - /** Gets the milliseconds of a Date, using local time. */ - getMilliseconds(): number; - /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */ - getUTCMilliseconds(): number; - /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */ - getTimezoneOffset(): number; - /** - * Sets the date and time value in the Date object. - * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT. - */ - setTime(time: number): number; - /** - * Sets the milliseconds value in the Date object using local time. - * @param ms A numeric value equal to the millisecond value. - */ - setMilliseconds(ms: number): number; - /** - * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). - * @param ms A numeric value equal to the millisecond value. - */ - setUTCMilliseconds(ms: number): number; - - /** - * Sets the seconds value in the Date object using local time. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setSeconds(sec: number, ms?: number): number; - /** - * Sets the seconds value in the Date object using Universal Coordinated Time (UTC). - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCSeconds(sec: number, ms?: number): number; - /** - * Sets the minutes value in the Date object using local time. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setMinutes(min: number, sec?: number, ms?: number): number; - /** - * Sets the minutes value in the Date object using Universal Coordinated Time (UTC). - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCMinutes(min: number, sec?: number, ms?: number): number; - /** - * Sets the hour value in the Date object using local time. - * @param hours A numeric value equal to the hours value. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setHours(hours: number, min?: number, sec?: number, ms?: number): number; - /** - * Sets the hours value in the Date object using Universal Coordinated Time (UTC). - * @param hours A numeric value equal to the hours value. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number; - /** - * Sets the numeric day-of-the-month value of the Date object using local time. - * @param date A numeric value equal to the day of the month. - */ - setDate(date: number): number; - /** - * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). - * @param date A numeric value equal to the day of the month. - */ - setUTCDate(date: number): number; - /** - * Sets the month value in the Date object using local time. - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. - * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used. - */ - setMonth(month: number, date?: number): number; - /** - * Sets the month value in the Date object using Universal Coordinated Time (UTC). - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. - * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used. - */ - setUTCMonth(month: number, date?: number): number; - /** - * Sets the year of the Date object using local time. - * @param year A numeric value for the year. - * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified. - * @param date A numeric value equal for the day of the month. - */ - setFullYear(year: number, month?: number, date?: number): number; - /** - * Sets the year value in the Date object using Universal Coordinated Time (UTC). - * @param year A numeric value equal to the year. - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied. - * @param date A numeric value equal to the day of the month. - */ - setUTCFullYear(year: number, month?: number, date?: number): number; - /** Returns a date converted to a string using Universal Coordinated Time (UTC). */ - toUTCString(): string; - /** Returns a date as a string value in ISO format. */ - toISOString(): string; - /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */ - toJSON(key?: any): string; -} - -interface DateConstructor { - new (): Date; - new (value: number): Date; - new (value: string): Date; - new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; - (): string; - readonly prototype: Date; - /** - * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. - * @param s A date string - */ - parse(s: string): number; - /** - * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date. - * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year. - * @param month The month as an number between 0 and 11 (January to December). - * @param date The date as an number between 1 and 31. - * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour. - * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes. - * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds. - * @param ms An number from 0 to 999 that specifies the milliseconds. - */ - UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; - now(): number; -} - -declare const Date: DateConstructor; - -interface RegExpMatchArray extends Array { - index?: number; - input?: string; -} - -interface RegExpExecArray extends Array { - index: number; - input: string; -} - -interface RegExp { - /** - * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. - * @param string The String object or string literal on which to perform the search. - */ - exec(string: string): RegExpExecArray | null; - - /** - * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. - * @param string String on which to perform the search. - */ - test(string: string): boolean; - - /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */ - readonly source: string; - - /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ - readonly global: boolean; - - /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */ - readonly ignoreCase: boolean; - - /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */ - readonly multiline: boolean; - - lastIndex: number; - - // Non-standard extensions - compile(): this; -} - -interface RegExpConstructor { - new (pattern: RegExp): RegExp; - new (pattern: string, flags?: string): RegExp; - (pattern: RegExp): RegExp; - (pattern: string, flags?: string): RegExp; - readonly prototype: RegExp; - - // Non-standard extensions - $1: string; - $2: string; - $3: string; - $4: string; - $5: string; - $6: string; - $7: string; - $8: string; - $9: string; - lastMatch: string; -} - -declare const RegExp: RegExpConstructor; - -interface Error { - name: string; - message: string; - stack?: string; -} - -interface ErrorConstructor { - new (message?: string): Error; - (message?: string): Error; - readonly prototype: Error; -} - -declare const Error: ErrorConstructor; - -interface EvalError extends Error { -} - -interface EvalErrorConstructor { - new (message?: string): EvalError; - (message?: string): EvalError; - readonly prototype: EvalError; -} - -declare const EvalError: EvalErrorConstructor; - -interface RangeError extends Error { -} - -interface RangeErrorConstructor { - new (message?: string): RangeError; - (message?: string): RangeError; - readonly prototype: RangeError; -} - -declare const RangeError: RangeErrorConstructor; - -interface ReferenceError extends Error { -} - -interface ReferenceErrorConstructor { - new (message?: string): ReferenceError; - (message?: string): ReferenceError; - readonly prototype: ReferenceError; -} - -declare const ReferenceError: ReferenceErrorConstructor; - -interface SyntaxError extends Error { -} - -interface SyntaxErrorConstructor { - new (message?: string): SyntaxError; - (message?: string): SyntaxError; - readonly prototype: SyntaxError; -} - -declare const SyntaxError: SyntaxErrorConstructor; - -interface TypeError extends Error { -} - -interface TypeErrorConstructor { - new (message?: string): TypeError; - (message?: string): TypeError; - readonly prototype: TypeError; -} - -declare const TypeError: TypeErrorConstructor; - -interface URIError extends Error { -} - -interface URIErrorConstructor { - new (message?: string): URIError; - (message?: string): URIError; - readonly prototype: URIError; -} - -declare const URIError: URIErrorConstructor; - -interface JSON { - /** - * Converts a JavaScript Object Notation (JSON) string into an object. - * @param text A valid JSON string. - * @param reviver A function that transforms the results. This function is called for each member of the object. - * If a member contains nested objects, the nested objects are transformed before the parent object is. - */ - parse(text: string, reviver?: (key: any, value: any) => any): any; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer A function that transforms the results. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - */ - stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer An array of strings and numbers that acts as a approved list for selecting the object properties that will be stringified. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - */ - stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string; -} - -/** - * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format. - */ -declare const JSON: JSON; - - -///////////////////////////// -/// ECMAScript Array API (specially handled by compiler) -///////////////////////////// - -interface ReadonlyArray { - /** - * Gets the length of the array. This is a number one higher than the highest element defined in an array. - */ - readonly length: number; - /** - * Returns a string representation of an array. - */ - toString(): string; - toLocaleString(): string; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat>(...items: U[]): T[]; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: T[][]): T[]; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: (T | T[])[]): T[]; - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): T[]; - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. - */ - indexOf(searchElement: T, fromIndex?: number): number; - - /** - * Returns the index of the last occurrence of a specified value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. - */ - lastIndexOf(searchElement: T, fromIndex?: number): number; - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: T, index: number, array: ReadonlyArray) => boolean, thisArg?: any): boolean; - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: T, index: number, array: ReadonlyArray) => boolean, thisArg?: any): boolean; - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: T, index: number, array: ReadonlyArray) => void, thisArg?: any): void; - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: T, index: number, array: ReadonlyArray) => U, thisArg?: any): U[]; - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: T, index: number, array: ReadonlyArray) => value is S, thisArg?: any): S[]; - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: T, index: number, array: ReadonlyArray) => any, thisArg?: any): T[]; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U; - - readonly [n: number]: T; -} - -interface Array { - /** - * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. - */ - length: number; - /** - * Returns a string representation of an array. - */ - toString(): string; - toLocaleString(): string; - /** - * Appends new elements to an array, and returns the new length of the array. - * @param items New elements of the Array. - */ - push(...items: T[]): number; - /** - * Removes the last element from an array and returns it. - */ - pop(): T | undefined; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: T[][]): T[]; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: (T | T[])[]): T[]; - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - /** - * Reverses the elements in an Array. - */ - reverse(): T[]; - /** - * Removes the first element from an array and returns it. - */ - shift(): T | undefined; - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): T[]; - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: T, b: T) => number): this; - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - */ - splice(start: number): T[]; - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - * @param deleteCount The number of elements to remove. - * @param items Elements to insert into the array in place of the deleted elements. - */ - splice(start: number, deleteCount: number, ...items: T[]): T[]; - /** - * Inserts new elements at the start of an array. - * @param items Elements to insert at the start of the Array. - */ - unshift(...items: T[]): number; - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. - */ - indexOf(searchElement: T, fromIndex?: number): number; - /** - * Returns the index of the last occurrence of a specified value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. - */ - lastIndexOf(searchElement: T, fromIndex?: number): number; - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(this: [T, T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U, U]; - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(this: [T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U]; - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(this: [T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U]; - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(this: [T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U]; - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[]; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - - [n: number]: T; -} - -interface ArrayConstructor { - new (arrayLength?: number): any[]; - new (arrayLength: number): T[]; - new (...items: T[]): T[]; - (arrayLength?: number): any[]; - (arrayLength: number): T[]; - (...items: T[]): T[]; - isArray(arg: any): arg is Array; - readonly prototype: Array; -} - -declare const Array: ArrayConstructor; - -interface TypedPropertyDescriptor { - enumerable?: boolean; - configurable?: boolean; - writable?: boolean; - value?: T; - get?: () => T; - set?: (value: T) => void; -} - -declare type ClassDecorator = (target: TFunction) => TFunction | void; -declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; -declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; -declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; - -declare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike; - -interface PromiseLike { - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then( - onfulfilled?: ((value: T) => T | PromiseLike) | undefined | null, - onrejected?: ((reason: any) => T | PromiseLike) | undefined | null): PromiseLike; - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then( - onfulfilled: ((value: T) => T | PromiseLike) | undefined | null, - onrejected: (reason: any) => TResult | PromiseLike): PromiseLike; - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then( - onfulfilled: (value: T) => TResult | PromiseLike, - onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): PromiseLike; - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then( - onfulfilled: (value: T) => TResult1 | PromiseLike, - onrejected: (reason: any) => TResult2 | PromiseLike): PromiseLike; -} - -interface ArrayLike { - readonly length: number; - readonly [n: number]: T; -} - -/** - * Make all properties in T optional - */ -type Partial = { - [P in keyof T]?: T[P]; -}; - -/** - * Make all properties in T readonly - */ -type Readonly = { - readonly [P in keyof T]: T[P]; -}; - -/** - * From T pick a set of properties K - */ -type Pick = { - [P in K]: T[P]; -} - -/** - * Construct a type with a set of properties K of type T - */ -type Record = { - [P in K]: T; -} - -/** - * Represents a raw buffer of binary data, which is used to store data for the - * different typed arrays. ArrayBuffers cannot be read from or written to directly, - * but can be passed to a typed array or DataView Object to interpret the raw - * buffer as needed. - */ -interface ArrayBuffer { - /** - * Read-only. The length of the ArrayBuffer (in bytes). - */ - readonly byteLength: number; - - /** - * Returns a section of an ArrayBuffer. - */ - slice(begin:number, end?:number): ArrayBuffer; -} - -interface ArrayBufferConstructor { - readonly prototype: ArrayBuffer; - new (byteLength: number): ArrayBuffer; - isView(arg: any): arg is ArrayBufferView; -} -declare const ArrayBuffer: ArrayBufferConstructor; - -interface ArrayBufferView { - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; -} - -interface DataView { - readonly buffer: ArrayBuffer; - readonly byteLength: number; - readonly byteOffset: number; - /** - * Gets the Float32 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Float64 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat64(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Int8 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt8(byteOffset: number): number; - - /** - * Gets the Int16 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt16(byteOffset: number, littleEndian?: boolean): number; - /** - * Gets the Int32 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint8 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint8(byteOffset: number): number; - - /** - * Gets the Uint16 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint16(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint32 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Stores an Float32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Float64 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Int8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setInt8(byteOffset: number, value: number): void; - - /** - * Stores an Int16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Int32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setUint8(byteOffset: number, value: number): void; - - /** - * Stores an Uint16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; -} - -interface DataViewConstructor { - new (buffer: ArrayBuffer, byteOffset?: number, byteLength?: number): DataView; -} -declare const DataView: DataViewConstructor; - -/** - * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Int8Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Int8Array) => any, thisArg?: any): Int8Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Int8Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Int8Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int8Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} -interface Int8ArrayConstructor { - readonly prototype: Int8Array; - new (length: number): Int8Array; - new (array: ArrayLike): Int8Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Int8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; - -} -declare const Int8Array: Int8ArrayConstructor; - -/** - * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint8Array) => any, thisArg?: any): Uint8Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint8Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint8Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint8Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Uint8ArrayConstructor { - readonly prototype: Uint8Array; - new (length: number): Uint8Array; - new (array: ArrayLike): Uint8Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; - -} -declare const Uint8Array: Uint8ArrayConstructor; - -/** - * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. - * If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8ClampedArray { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => any, thisArg?: any): Uint8ClampedArray; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint8ClampedArray; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint8ClampedArray, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint8ClampedArray; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint8ClampedArray; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Uint8ClampedArrayConstructor { - readonly prototype: Uint8ClampedArray; - new (length: number): Uint8ClampedArray; - new (array: ArrayLike): Uint8ClampedArray; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8ClampedArray; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint8ClampedArray; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; -} -declare const Uint8ClampedArray: Uint8ClampedArrayConstructor; - -/** - * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int16Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Int16Array) => any, thisArg?: any): Int16Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Int16Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Int16Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int16Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Int16ArrayConstructor { - readonly prototype: Int16Array; - new (length: number): Int16Array; - new (array: ArrayLike): Int16Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Int16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; - -} -declare const Int16Array: Int16ArrayConstructor; - -/** - * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint16Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint16Array) => any, thisArg?: any): Uint16Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint16Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint16Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint16Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Uint16ArrayConstructor { - readonly prototype: Uint16Array; - new (length: number): Uint16Array; - new (array: ArrayLike): Uint16Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; - -} -declare const Uint16Array: Uint16ArrayConstructor; -/** - * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int32Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Int32Array) => any, thisArg?: any): Int32Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Int32Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Int32Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int32Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Int32ArrayConstructor { - readonly prototype: Int32Array; - new (length: number): Int32Array; - new (array: ArrayLike): Int32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Int32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; -} -declare const Int32Array: Int32ArrayConstructor; - -/** - * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint32Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint32Array) => any, thisArg?: any): Uint32Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint32Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint32Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint32Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Uint32ArrayConstructor { - readonly prototype: Uint32Array; - new (length: number): Uint32Array; - new (array: ArrayLike): Uint32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; -} -declare const Uint32Array: Uint32ArrayConstructor; - -/** - * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number - * of bytes could not be allocated an exception is raised. - */ -interface Float32Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Float32Array) => any, thisArg?: any): Float32Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Float32Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Float32Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Float32Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Float32ArrayConstructor { - readonly prototype: Float32Array; - new (length: number): Float32Array; - new (array: ArrayLike): Float32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Float32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; - -} -declare const Float32Array: Float32ArrayConstructor; - -/** - * A typed array of 64-bit float values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Float64Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Float64Array) => any, thisArg?: any): Float64Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Float64Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Float64Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Float64Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Float64ArrayConstructor { - readonly prototype: Float64Array; - new (length: number): Float64Array; - new (array: ArrayLike): Float64Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Float64Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; -} -declare const Float64Array: Float64ArrayConstructor; - -///////////////////////////// -/// ECMAScript Internationalization API -///////////////////////////// - -declare module Intl { - interface CollatorOptions { - usage?: string; - localeMatcher?: string; - numeric?: boolean; - caseFirst?: string; - sensitivity?: string; - ignorePunctuation?: boolean; - } - - interface ResolvedCollatorOptions { - locale: string; - usage: string; - sensitivity: string; - ignorePunctuation: boolean; - collation: string; - caseFirst: string; - numeric: boolean; - } - - interface Collator { - compare(x: string, y: string): number; - resolvedOptions(): ResolvedCollatorOptions; - } - var Collator: { - new (locales?: string | string[], options?: CollatorOptions): Collator; - (locales?: string | string[], options?: CollatorOptions): Collator; - supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[]; - } - - interface NumberFormatOptions { - localeMatcher?: string; - style?: string; - currency?: string; - currencyDisplay?: string; - useGrouping?: boolean; - minimumIntegerDigits?: number; - minimumFractionDigits?: number; - maximumFractionDigits?: number; - minimumSignificantDigits?: number; - maximumSignificantDigits?: number; - } - - interface ResolvedNumberFormatOptions { - locale: string; - numberingSystem: string; - style: string; - currency?: string; - currencyDisplay?: string; - minimumIntegerDigits: number; - minimumFractionDigits: number; - maximumFractionDigits: number; - minimumSignificantDigits?: number; - maximumSignificantDigits?: number; - useGrouping: boolean; - } - - interface NumberFormat { - format(value: number): string; - resolvedOptions(): ResolvedNumberFormatOptions; - } - var NumberFormat: { - new (locales?: string | string[], options?: NumberFormatOptions): NumberFormat; - (locales?: string | string[], options?: NumberFormatOptions): NumberFormat; - supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[]; - } - - interface DateTimeFormatOptions { - localeMatcher?: string; - weekday?: string; - era?: string; - year?: string; - month?: string; - day?: string; - hour?: string; - minute?: string; - second?: string; - timeZoneName?: string; - formatMatcher?: string; - hour12?: boolean; - timeZone?: string; - } - - interface ResolvedDateTimeFormatOptions { - locale: string; - calendar: string; - numberingSystem: string; - timeZone: string; - hour12?: boolean; - weekday?: string; - era?: string; - year?: string; - month?: string; - day?: string; - hour?: string; - minute?: string; - second?: string; - timeZoneName?: string; - } - - interface DateTimeFormat { - format(date?: Date | number): string; - resolvedOptions(): ResolvedDateTimeFormatOptions; - } - var DateTimeFormat: { - new (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat; - (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat; - supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[]; - } -} - -interface String { - /** - * Determines whether two strings are equivalent in the current or specified locale. - * @param that String to compare to target string - * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. - * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. - */ - localeCompare(that: string, locales?: string | string[], options?: Intl.CollatorOptions): number; -} - -interface Number { - /** - * Converts a number to a string by using the current or specified locale. - * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string; -} - -interface Date { - /** - * Converts a date and time to a string by using the current or specified locale. - * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; - /** - * Converts a date to a string by using the current or specified locale. - * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; - - /** - * Converts a time to a string by using the current or specified locale. - * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; -} +///////////////////////////// +/// ECMAScript APIs +///////////////////////////// +declare const NaN: number; +declare const Infinity: number; -declare type PropertyKey = string | number | symbol; - -interface Array { - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: T, start?: number, end?: number): this; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; -} - -interface ArrayConstructor { - /** - * Creates an array from an array-like object. - * @param arrayLike An array-like object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - - - /** - * Creates an array from an array-like object. - * @param arrayLike An array-like object to convert to an array. - */ - from(arrayLike: ArrayLike): Array; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: T[]): Array; -} - -interface DateConstructor { - new (value: Date): Date; -} - -interface Function { - /** - * Returns the name of the function. Function names are read-only and can not be changed. - */ - readonly name: string; -} - -interface Math { - /** - * Returns the number of leading zero bits in the 32-bit binary representation of a number. - * @param x A numeric expression. - */ - clz32(x: number): number; - - /** - * Returns the result of 32-bit multiplication of two numbers. - * @param x First number - * @param y Second number - */ - imul(x: number, y: number): number; - - /** - * Returns the sign of the x, indicating whether x is positive, negative or zero. - * @param x The numeric expression to test - */ - sign(x: number): number; - - /** - * Returns the base 10 logarithm of a number. - * @param x A numeric expression. - */ - log10(x: number): number; - - /** - * Returns the base 2 logarithm of a number. - * @param x A numeric expression. - */ - log2(x: number): number; - - /** - * Returns the natural logarithm of 1 + x. - * @param x A numeric expression. - */ - log1p(x: number): number; - - /** - * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of - * the natural logarithms). - * @param x A numeric expression. - */ - expm1(x: number): number; - - /** - * Returns the hyperbolic cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - cosh(x: number): number; - - /** - * Returns the hyperbolic sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - sinh(x: number): number; - - /** - * Returns the hyperbolic tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - tanh(x: number): number; - - /** - * Returns the inverse hyperbolic cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - acosh(x: number): number; - - /** - * Returns the inverse hyperbolic sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - asinh(x: number): number; - - /** - * Returns the inverse hyperbolic tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - atanh(x: number): number; - - /** - * Returns the square root of the sum of squares of its arguments. - * @param values Values to compute the square root for. - * If no arguments are passed, the result is +0. - * If there is only one argument, the result is the absolute value. - * If any argument is +Infinity or -Infinity, the result is +Infinity. - * If any argument is NaN, the result is NaN. - * If all arguments are either +0 or −0, the result is +0. - */ - hypot(...values: number[] ): number; - - /** - * Returns the integral part of the a numeric expression, x, removing any fractional digits. - * If x is already an integer, the result is x. - * @param x A numeric expression. - */ - trunc(x: number): number; - - /** - * Returns the nearest single precision float representation of a number. - * @param x A numeric expression. - */ - fround(x: number): number; - - /** - * Returns an implementation-dependent approximation to the cube root of number. - * @param x A numeric expression. - */ - cbrt(x: number): number; -} - -interface NumberConstructor { - /** - * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 - * that is representable as a Number value, which is approximately: - * 2.2204460492503130808472633361816 x 10â€âˆ’â€16. - */ - readonly EPSILON: number; - - /** - * Returns true if passed value is finite. - * Unlike the global isFinite, Number.isFinite doesn't forcibly convert the parameter to a - * number. Only finite values of the type number, result in true. - * @param number A numeric value. - */ - isFinite(number: number): boolean; - - /** - * Returns true if the value passed is an integer, false otherwise. - * @param number A numeric value. - */ - isInteger(number: number): boolean; - - /** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a - * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter - * to a number. Only values of the type number, that are also NaN, result in true. - * @param number A numeric value. - */ - isNaN(number: number): boolean; - - /** - * Returns true if the value passed is a safe integer. - * @param number A numeric value. - */ - isSafeInteger(number: number): boolean; - - /** - * The value of the largest integer n such that n and n + 1 are both exactly representable as - * a Number value. - * The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1. - */ - readonly MAX_SAFE_INTEGER: number; - - /** - * The value of the smallest integer n such that n and n − 1 are both exactly representable as - * a Number value. - * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). - */ - readonly MIN_SAFE_INTEGER: number; - - /** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. - */ - parseFloat(string: string): number; - - /** - * Converts A string to an integer. - * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. - * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. - * All other strings are considered decimal. - */ - parseInt(string: string, radix?: number): number; -} - -interface Object { - /** - * Determines whether an object has a property with the specified name. - * @param v A property name. - */ - hasOwnProperty(v: PropertyKey): boolean - - /** - * Determines whether a specified property is enumerable. - * @param v A property name. - */ - propertyIsEnumerable(v: PropertyKey): boolean; -} - -interface ObjectConstructor { - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source The source object from which to copy properties. - */ - assign(target: T, source: U): T & U; - - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source1 The first source object from which to copy properties. - * @param source2 The second source object from which to copy properties. - */ - assign(target: T, source1: U, source2: V): T & U & V; - - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source1 The first source object from which to copy properties. - * @param source2 The second source object from which to copy properties. - * @param source3 The third source object from which to copy properties. - */ - assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; - - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param sources One or more source objects from which to copy properties - */ - assign(target: any, ...sources: any[]): any; - - /** - * Returns an array of all symbol properties found directly on object o. - * @param o Object to retrieve the symbols from. - */ - getOwnPropertySymbols(o: any): symbol[]; - - /** - * Returns true if the values are the same value, false otherwise. - * @param value1 The first value. - * @param value2 The second value. - */ - is(value1: any, value2: any): boolean; - - /** - * Sets the prototype of a specified object o to object proto or null. Returns the object o. - * @param o The object to change its prototype. - * @param proto The value of the new prototype or null. - */ - setPrototypeOf(o: any, proto: any): any; - - /** - * Gets the own property descriptor of the specified object. - * An own property descriptor is one that is defined directly on the object and is not - * inherited from the object's prototype. - * @param o Object that contains the property. - * @param p Name of the property. - */ - getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor; - - /** - * Adds a property to an object, or modifies attributes of an existing property. - * @param o Object on which to add or modify the property. This can be a native JavaScript - * object (that is, a user-defined object or a built in object) or a DOM object. - * @param p The property name. - * @param attributes Descriptor for the property. It can be for a data property or an accessor - * property. - */ - defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any; -} - -interface ReadonlyArray { - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: T, index: number, obj: ReadonlyArray) => boolean, thisArg?: any): T | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): number; -} - -interface RegExp { - /** - * Returns a string indicating the flags of the regular expression in question. This field is read-only. - * The characters in this string are sequenced and concatenated in the following order: - * - * - "g" for global - * - "i" for ignoreCase - * - "m" for multiline - * - "u" for unicode - * - "y" for sticky - * - * If no flags are set, the value is the empty string. - */ - readonly flags: string; - - /** - * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular - * expression. Default is false. Read-only. - */ - readonly sticky: boolean; - - /** - * Returns a Boolean value indicating the state of the Unicode flag (u) used with a regular - * expression. Default is false. Read-only. - */ - readonly unicode: boolean; -} - -interface RegExpConstructor { - new (pattern: RegExp, flags?: string): RegExp; - (pattern: RegExp, flags?: string): RegExp; -} - -interface String { - /** - * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point - * value of the UTF-16 encoded code point starting at the string element at position pos in - * the String resulting from converting this object to a String. - * If there is no element at that position, the result is undefined. - * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. - */ - codePointAt(pos: number): number | undefined; - - /** - * Returns true if searchString appears as a substring of the result of converting this - * object to a String, at one or more positions that are - * greater than or equal to position; otherwise, returns false. - * @param searchString search string - * @param position If position is undefined, 0 is assumed, so as to search all of the String. - */ - includes(searchString: string, position?: number): boolean; - - /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * endPosition – length(this). Otherwise returns false. - */ - endsWith(searchString: string, endPosition?: number): boolean; - - /** - * Returns the String value result of normalizing the string into the normalization form - * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. - * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default - * is "NFC" - */ - normalize(form: "NFC" | "NFD" | "NFKC" | "NFKD"): string; - - /** - * Returns the String value result of normalizing the string into the normalization form - * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. - * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default - * is "NFC" - */ - normalize(form?: string): string; - - /** - * Returns a String value that is made from count copies appended together. If count is 0, - * T is the empty String is returned. - * @param count number of copies to append - */ - repeat(count: number): string; - - /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * position. Otherwise returns false. - */ - startsWith(searchString: string, position?: number): boolean; - - /** - * Returns an HTML anchor element and sets the name attribute to the text value - * @param name - */ - anchor(name: string): string; - - /** Returns a HTML element */ - big(): string; - - /** Returns a HTML element */ - blink(): string; - - /** Returns a HTML element */ - bold(): string; - - /** Returns a HTML element */ - fixed(): string - - /** Returns a HTML element and sets the color attribute value */ - fontcolor(color: string): string - - /** Returns a HTML element and sets the size attribute value */ - fontsize(size: number): string; - - /** Returns a HTML element and sets the size attribute value */ - fontsize(size: string): string; - - /** Returns an HTML element */ - italics(): string; - - /** Returns an HTML element and sets the href attribute value */ - link(url: string): string; - - /** Returns a HTML element */ - small(): string; - - /** Returns a HTML element */ - strike(): string; - - /** Returns a HTML element */ - sub(): string; - - /** Returns a HTML element */ - sup(): string; -} - -interface StringConstructor { - /** - * Return the String value whose elements are, in order, the elements in the List elements. - * If length is 0, the empty string is returned. - */ - fromCodePoint(...codePoints: number[]): string; - - /** - * String.raw is intended for use as a tag function of a Tagged Template String. When called - * as such the first argument will be a well formed template call site object and the rest - * parameter will contain the substitution values. - * @param template A well-formed template string call site representation. - * @param substitutions A set of substitution values. - */ - raw(template: TemplateStringsArray, ...substitutions: any[]): string; -} +/** + * Evaluates JavaScript code and executes it. + * @param x A String value that contains valid JavaScript code. + */ +declare function eval(x: string): any; +/** + * Converts A string to an integer. + * @param s A string to convert into a number. + * @param radix A value between 2 and 36 that specifies the base of the number in numString. + * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. + * All other strings are considered decimal. + */ +declare function parseInt(s: string, radix?: number): number; -interface Map { - clear(): void; - delete(key: K): boolean; - forEach(callbackfn: (value: V, key: K, map: Map) => void, thisArg?: any): void; - get(key: K): V | undefined; - has(key: K): boolean; - set(key: K, value?: V): this; - readonly size: number; -} - -interface MapConstructor { - new (): Map; - new (entries?: [K, V][]): Map; - readonly prototype: Map; -} -declare var Map: MapConstructor; - -interface ReadonlyMap { - forEach(callbackfn: (value: V, key: K, map: ReadonlyMap) => void, thisArg?: any): void; - get(key: K): V|undefined; - has(key: K): boolean; - readonly size: number; -} - -interface WeakMap { - delete(key: K): boolean; - get(key: K): V | undefined; - has(key: K): boolean; - set(key: K, value?: V): this; -} - -interface WeakMapConstructor { - new (): WeakMap; - new (entries?: [K, V][]): WeakMap; - readonly prototype: WeakMap; -} -declare var WeakMap: WeakMapConstructor; - -interface Set { - add(value: T): this; - clear(): void; - delete(value: T): boolean; - forEach(callbackfn: (value: T, value2: T, set: Set) => void, thisArg?: any): void; - has(value: T): boolean; - readonly size: number; -} - -interface SetConstructor { - new (): Set; - new (values?: T[]): Set; - readonly prototype: Set; -} -declare var Set: SetConstructor; - -interface ReadonlySet { - forEach(callbackfn: (value: T, value2: T, set: ReadonlySet) => void, thisArg?: any): void; - has(value: T): boolean; - readonly size: number; -} - -interface WeakSet { - add(value: T): this; - delete(value: T): boolean; - has(value: T): boolean; -} - -interface WeakSetConstructor { - new (): WeakSet; - new (values?: T[]): WeakSet; - readonly prototype: WeakSet; -} -declare var WeakSet: WeakSetConstructor; +/** + * Converts a string to a floating-point number. + * @param string A string that contains a floating-point number. + */ +declare function parseFloat(string: string): number; +/** + * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number). + * @param number A numeric value. + */ +declare function isNaN(number: number): boolean; -interface GeneratorFunction extends Function { } - -interface GeneratorFunctionConstructor { - /** - * Creates a new Generator function. - * @param args A list of arguments the function accepts. - */ - new (...args: string[]): GeneratorFunction; - (...args: string[]): GeneratorFunction; - readonly prototype: GeneratorFunction; -} -declare var GeneratorFunction: GeneratorFunctionConstructor; +/** + * Determines whether a supplied number is finite. + * @param number Any numeric value. + */ +declare function isFinite(number: number): boolean; +/** + * Gets the unencoded version of an encoded Uniform Resource Identifier (URI). + * @param encodedURI A value representing an encoded URI. + */ +declare function decodeURI(encodedURI: string): string; -/// - -interface SymbolConstructor { - /** - * A method that returns the default iterator for an object. Called by the semantics of the - * for-of statement. - */ - readonly iterator: symbol; -} - -interface IteratorResult { - done: boolean; - value: T; -} - -interface Iterator { - next(value?: any): IteratorResult; - return?(value?: any): IteratorResult; - throw?(e?: any): IteratorResult; -} - -interface Iterable { - [Symbol.iterator](): Iterator; -} - -interface IterableIterator extends Iterator { - [Symbol.iterator](): IterableIterator; -} - -interface Array { - /** Iterator */ - [Symbol.iterator](): IterableIterator; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, T]>; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface ArrayConstructor { - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - */ - from(iterable: Iterable): Array; -} - -interface ReadonlyArray { - /** Iterator */ - [Symbol.iterator](): IterableIterator; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, T]>; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface IArguments { - /** Iterator */ - [Symbol.iterator](): IterableIterator; -} - -interface Map { - [Symbol.iterator](): IterableIterator<[K,V]>; - entries(): IterableIterator<[K, V]>; - keys(): IterableIterator; - values(): IterableIterator; -} - -interface MapConstructor { - new (iterable: Iterable<[K, V]>): Map; -} - -interface WeakMap { } - -interface WeakMapConstructor { - new (iterable: Iterable<[K, V]>): WeakMap; -} - -interface Set { - [Symbol.iterator](): IterableIterator; - entries(): IterableIterator<[T, T]>; - keys(): IterableIterator; - values(): IterableIterator; -} - -interface SetConstructor { - new (iterable: Iterable): Set; -} - -interface WeakSet { } - -interface WeakSetConstructor { - new (iterable: Iterable): WeakSet; -} - -interface Promise { } - -interface PromiseConstructor { - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: Iterable>): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: Iterable>): Promise; -} - -declare namespace Reflect { - function enumerate(target: any): IterableIterator; -} - -interface String { - /** Iterator */ - [Symbol.iterator](): IterableIterator; -} - -/** - * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Int8Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Int8ArrayConstructor { - new (elements: Iterable): Int8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; -} - -/** - * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Uint8ArrayConstructor { - new (elements: Iterable): Uint8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; -} - -/** - * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. - * If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8ClampedArray { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Uint8ClampedArrayConstructor { - new (elements: Iterable): Uint8ClampedArray; - - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; -} - -/** - * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int16Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Int16ArrayConstructor { - new (elements: Iterable): Int16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; -} - -/** - * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint16Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Uint16ArrayConstructor { - new (elements: Iterable): Uint16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; -} - -/** - * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int32Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Int32ArrayConstructor { - new (elements: Iterable): Int32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; -} - -/** - * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint32Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Uint32ArrayConstructor { - new (elements: Iterable): Uint32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; -} - -/** - * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number - * of bytes could not be allocated an exception is raised. - */ -interface Float32Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Float32ArrayConstructor { - new (elements: Iterable): Float32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; -} - -/** - * A typed array of 64-bit float values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Float64Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Float64ArrayConstructor { - new (elements: Iterable): Float64Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; +/** + * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI). + * @param encodedURIComponent A value representing an encoded URI component. + */ +declare function decodeURIComponent(encodedURIComponent: string): string; + +/** + * Encodes a text string as a valid Uniform Resource Identifier (URI) + * @param uri A value representing an encoded URI. + */ +declare function encodeURI(uri: string): string; + +/** + * Encodes a text string as a valid component of a Uniform Resource Identifier (URI). + * @param uriComponent A value representing an encoded URI component. + */ +declare function encodeURIComponent(uriComponent: string): string; + +interface PropertyDescriptor { + configurable?: boolean; + enumerable?: boolean; + value?: any; + writable?: boolean; + get? (): any; + set? (v: any): void; +} + +interface PropertyDescriptorMap { + [s: string]: PropertyDescriptor; +} + +interface Object { + /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */ + constructor: Function; + + /** Returns a string representation of an object. */ + toString(): string; + + /** Returns a date converted to a string using the current locale. */ + toLocaleString(): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): Object; + + /** + * Determines whether an object has a property with the specified name. + * @param v A property name. + */ + hasOwnProperty(v: string): boolean; + + /** + * Determines whether an object exists in another object's prototype chain. + * @param v Another object whose prototype chain is to be checked. + */ + isPrototypeOf(v: Object): boolean; + + /** + * Determines whether a specified property is enumerable. + * @param v A property name. + */ + propertyIsEnumerable(v: string): boolean; +} + +interface ObjectConstructor { + new (value?: any): Object; + (): any; + (value: any): any; + + /** A reference to the prototype for a class of objects. */ + readonly prototype: Object; + + /** + * Returns the prototype of an object. + * @param o The object that references the prototype. + */ + getPrototypeOf(o: any): any; + + /** + * Gets the own property descriptor of the specified object. + * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype. + * @param o Object that contains the property. + * @param p Name of the property. + */ + getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; + + /** + * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly + * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. + * @param o Object that contains the own properties. + */ + getOwnPropertyNames(o: any): string[]; + + /** + * Creates an object that has the specified prototype or that has null prototype. + * @param o Object to use as a prototype. May be null. + */ + create(o: object | null): any; + + /** + * Creates an object that has the specified prototype, and that optionally contains specified properties. + * @param o Object to use as a prototype. May be null + * @param properties JavaScript object that contains one or more property descriptors. + */ + create(o: object | null, properties: PropertyDescriptorMap & ThisType): any; + + /** + * Adds a property to an object, or modifies attributes of an existing property. + * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object. + * @param p The property name. + * @param attributes Descriptor for the property. It can be for a data property or an accessor property. + */ + defineProperty(o: any, p: string, attributes: PropertyDescriptor & ThisType): any; + + /** + * Adds one or more properties to an object, and/or modifies attributes of existing properties. + * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object. + * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property. + */ + defineProperties(o: any, properties: PropertyDescriptorMap & ThisType): any; + + /** + * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + seal(o: T): T; + + /** + * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + freeze(a: T[]): ReadonlyArray; + + /** + * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + freeze(f: T): T; + + /** + * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + freeze(o: T): Readonly; + + /** + * Prevents the addition of new properties to an object. + * @param o Object to make non-extensible. + */ + preventExtensions(o: T): T; + + /** + * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. + * @param o Object to test. + */ + isSealed(o: any): boolean; + + /** + * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. + * @param o Object to test. + */ + isFrozen(o: any): boolean; + + /** + * Returns a value that indicates whether new properties can be added to an object. + * @param o Object to test. + */ + isExtensible(o: any): boolean; + + /** + * Returns the names of the enumerable properties and methods of an object. + * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. + */ + keys(o: any): string[]; +} + +/** + * Provides functionality common to all JavaScript objects. + */ +declare const Object: ObjectConstructor; + +/** + * Creates a new function. + */ +interface Function { + /** + * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. + * @param thisArg The object to be used as the this object. + * @param argArray A set of arguments to be passed to the function. + */ + apply(this: Function, thisArg: any, argArray?: any): any; + + /** + * Calls a method of an object, substituting another object for the current object. + * @param thisArg The object to be used as the current object. + * @param argArray A list of arguments to be passed to the method. + */ + call(this: Function, thisArg: any, ...argArray: any[]): any; + + /** + * For a given function, creates a bound function that has the same body as the original function. + * The this object of the bound function is associated with the specified object, and has the specified initial parameters. + * @param thisArg An object to which the this keyword can refer inside the new function. + * @param argArray A list of arguments to be passed to the new function. + */ + bind(this: Function, thisArg: any, ...argArray: any[]): any; + + /** Returns a string representation of a function. */ + toString(): string; + + prototype: any; + readonly length: number; + + // Non-standard extensions + arguments: any; + caller: Function; +} + +interface FunctionConstructor { + /** + * Creates a new function. + * @param args A list of arguments the function accepts. + */ + new (...args: string[]): Function; + (...args: string[]): Function; + readonly prototype: Function; +} + +declare const Function: FunctionConstructor; + +interface IArguments { + [index: number]: any; + length: number; + callee: Function; +} + +interface String { + /** Returns a string representation of a string. */ + toString(): string; + + /** + * Returns the character at the specified index. + * @param pos The zero-based index of the desired character. + */ + charAt(pos: number): string; + + /** + * Returns the Unicode value of the character at the specified location. + * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned. + */ + charCodeAt(index: number): number; + + /** + * Returns a string that contains the concatenation of two or more strings. + * @param strings The strings to append to the end of the string. + */ + concat(...strings: string[]): string; + + /** + * Returns the position of the first occurrence of a substring. + * @param searchString The substring to search for in the string + * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string. + */ + indexOf(searchString: string, position?: number): number; + + /** + * Returns the last occurrence of a substring in the string. + * @param searchString The substring to search for. + * @param position The index at which to begin searching. If omitted, the search begins at the end of the string. + */ + lastIndexOf(searchString: string, position?: number): number; + + /** + * Determines whether two strings are equivalent in the current locale. + * @param that String to compare to target string + */ + localeCompare(that: string): number; + + /** + * Matches a string with a regular expression, and returns an array containing the results of that search. + * @param regexp A variable name or string literal containing the regular expression pattern and flags. + */ + match(regexp: string | RegExp): RegExpMatchArray | null; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A string to search for. + * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. + */ + replace(searchValue: string | RegExp, replaceValue: string): string; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A string to search for. + * @param replacer A function that returns the replacement text. + */ + replace(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; + + /** + * Finds the first substring match in a regular expression search. + * @param regexp The regular expression pattern and applicable flags. + */ + search(regexp: string | RegExp): number; + + /** + * Returns a section of a string. + * @param start The index to the beginning of the specified portion of stringObj. + * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. + * If this value is not specified, the substring continues to the end of stringObj. + */ + slice(start?: number, end?: number): string; + + /** + * Split a string into substrings using the specified separator and return them as an array. + * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. + * @param limit A value used to limit the number of elements returned in the array. + */ + split(separator: string | RegExp, limit?: number): string[]; + + /** + * Returns the substring at the specified location within a String object. + * @param start The zero-based index number indicating the beginning of the substring. + * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. + * If end is omitted, the characters from start through the end of the original string are returned. + */ + substring(start: number, end?: number): string; + + /** Converts all the alphabetic characters in a string to lowercase. */ + toLowerCase(): string; + + /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ + toLocaleLowerCase(): string; + + /** Converts all the alphabetic characters in a string to uppercase. */ + toUpperCase(): string; + + /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */ + toLocaleUpperCase(): string; + + /** Removes the leading and trailing white space and line terminator characters from a string. */ + trim(): string; + + /** Returns the length of a String object. */ + readonly length: number; + + // IE extensions + /** + * Gets a substring beginning at the specified location and having the specified length. + * @param from The starting position of the desired substring. The index of the first character in the string is zero. + * @param length The number of characters to include in the returned substring. + */ + substr(from: number, length?: number): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): string; + + readonly [index: number]: string; +} + +interface StringConstructor { + new (value?: any): String; + (value?: any): string; + readonly prototype: String; + fromCharCode(...codes: number[]): string; +} + +/** + * Allows manipulation and formatting of text strings and determination and location of substrings within strings. + */ +declare const String: StringConstructor; + +interface Boolean { + /** Returns the primitive value of the specified object. */ + valueOf(): boolean; +} + +interface BooleanConstructor { + new (value?: any): Boolean; + (value?: any): boolean; + readonly prototype: Boolean; +} + +declare const Boolean: BooleanConstructor; + +interface Number { + /** + * Returns a string representation of an object. + * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers. + */ + toString(radix?: number): string; + + /** + * Returns a string representing a number in fixed-point notation. + * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. + */ + toFixed(fractionDigits?: number): string; + + /** + * Returns a string containing a number represented in exponential notation. + * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. + */ + toExponential(fractionDigits?: number): string; + + /** + * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits. + * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive. + */ + toPrecision(precision?: number): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): number; +} + +interface NumberConstructor { + new (value?: any): Number; + (value?: any): number; + readonly prototype: Number; + + /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */ + readonly MAX_VALUE: number; + + /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */ + readonly MIN_VALUE: number; + + /** + * A value that is not a number. + * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function. + */ + readonly NaN: number; + + /** + * A value that is less than the largest negative number that can be represented in JavaScript. + * JavaScript displays NEGATIVE_INFINITY values as -infinity. + */ + readonly NEGATIVE_INFINITY: number; + + /** + * A value greater than the largest number that can be represented in JavaScript. + * JavaScript displays POSITIVE_INFINITY values as infinity. + */ + readonly POSITIVE_INFINITY: number; +} + +/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */ +declare const Number: NumberConstructor; + +interface TemplateStringsArray extends ReadonlyArray { + readonly raw: ReadonlyArray; +} + +interface Math { + /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ + readonly E: number; + /** The natural logarithm of 10. */ + readonly LN10: number; + /** The natural logarithm of 2. */ + readonly LN2: number; + /** The base-2 logarithm of e. */ + readonly LOG2E: number; + /** The base-10 logarithm of e. */ + readonly LOG10E: number; + /** Pi. This is the ratio of the circumference of a circle to its diameter. */ + readonly PI: number; + /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */ + readonly SQRT1_2: number; + /** The square root of 2. */ + readonly SQRT2: number; + /** + * Returns the absolute value of a number (the value without regard to whether it is positive or negative). + * For example, the absolute value of -5 is the same as the absolute value of 5. + * @param x A numeric expression for which the absolute value is needed. + */ + abs(x: number): number; + /** + * Returns the arc cosine (or inverse cosine) of a number. + * @param x A numeric expression. + */ + acos(x: number): number; + /** + * Returns the arcsine of a number. + * @param x A numeric expression. + */ + asin(x: number): number; + /** + * Returns the arctangent of a number. + * @param x A numeric expression for which the arctangent is needed. + */ + atan(x: number): number; + /** + * Returns the angle (in radians) from the X axis to a point. + * @param y A numeric expression representing the cartesian y-coordinate. + * @param x A numeric expression representing the cartesian x-coordinate. + */ + atan2(y: number, x: number): number; + /** + * Returns the smallest number greater than or equal to its numeric argument. + * @param x A numeric expression. + */ + ceil(x: number): number; + /** + * Returns the cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + cos(x: number): number; + /** + * Returns e (the base of natural logarithms) raised to a power. + * @param x A numeric expression representing the power of e. + */ + exp(x: number): number; + /** + * Returns the greatest number less than or equal to its numeric argument. + * @param x A numeric expression. + */ + floor(x: number): number; + /** + * Returns the natural logarithm (base e) of a number. + * @param x A numeric expression. + */ + log(x: number): number; + /** + * Returns the larger of a set of supplied numeric expressions. + * @param values Numeric expressions to be evaluated. + */ + max(...values: number[]): number; + /** + * Returns the smaller of a set of supplied numeric expressions. + * @param values Numeric expressions to be evaluated. + */ + min(...values: number[]): number; + /** + * Returns the value of a base expression taken to a specified power. + * @param x The base value of the expression. + * @param y The exponent value of the expression. + */ + pow(x: number, y: number): number; + /** Returns a pseudorandom number between 0 and 1. */ + random(): number; + /** + * Returns a supplied numeric expression rounded to the nearest number. + * @param x The value to be rounded to the nearest number. + */ + round(x: number): number; + /** + * Returns the sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + sin(x: number): number; + /** + * Returns the square root of a number. + * @param x A numeric expression. + */ + sqrt(x: number): number; + /** + * Returns the tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + tan(x: number): number; +} +/** An intrinsic object that provides basic mathematics functionality and constants. */ +declare const Math: Math; + +/** Enables basic storage and retrieval of dates and times. */ +interface Date { + /** Returns a string representation of a date. The format of the string depends on the locale. */ + toString(): string; + /** Returns a date as a string value. */ + toDateString(): string; + /** Returns a time as a string value. */ + toTimeString(): string; + /** Returns a value as a string value appropriate to the host environment's current locale. */ + toLocaleString(): string; + /** Returns a date as a string value appropriate to the host environment's current locale. */ + toLocaleDateString(): string; + /** Returns a time as a string value appropriate to the host environment's current locale. */ + toLocaleTimeString(): string; + /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */ + valueOf(): number; + /** Gets the time value in milliseconds. */ + getTime(): number; + /** Gets the year, using local time. */ + getFullYear(): number; + /** Gets the year using Universal Coordinated Time (UTC). */ + getUTCFullYear(): number; + /** Gets the month, using local time. */ + getMonth(): number; + /** Gets the month of a Date object using Universal Coordinated Time (UTC). */ + getUTCMonth(): number; + /** Gets the day-of-the-month, using local time. */ + getDate(): number; + /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */ + getUTCDate(): number; + /** Gets the day of the week, using local time. */ + getDay(): number; + /** Gets the day of the week using Universal Coordinated Time (UTC). */ + getUTCDay(): number; + /** Gets the hours in a date, using local time. */ + getHours(): number; + /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */ + getUTCHours(): number; + /** Gets the minutes of a Date object, using local time. */ + getMinutes(): number; + /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */ + getUTCMinutes(): number; + /** Gets the seconds of a Date object, using local time. */ + getSeconds(): number; + /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */ + getUTCSeconds(): number; + /** Gets the milliseconds of a Date, using local time. */ + getMilliseconds(): number; + /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */ + getUTCMilliseconds(): number; + /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */ + getTimezoneOffset(): number; + /** + * Sets the date and time value in the Date object. + * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT. + */ + setTime(time: number): number; + /** + * Sets the milliseconds value in the Date object using local time. + * @param ms A numeric value equal to the millisecond value. + */ + setMilliseconds(ms: number): number; + /** + * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). + * @param ms A numeric value equal to the millisecond value. + */ + setUTCMilliseconds(ms: number): number; + + /** + * Sets the seconds value in the Date object using local time. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setSeconds(sec: number, ms?: number): number; + /** + * Sets the seconds value in the Date object using Universal Coordinated Time (UTC). + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCSeconds(sec: number, ms?: number): number; + /** + * Sets the minutes value in the Date object using local time. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setMinutes(min: number, sec?: number, ms?: number): number; + /** + * Sets the minutes value in the Date object using Universal Coordinated Time (UTC). + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCMinutes(min: number, sec?: number, ms?: number): number; + /** + * Sets the hour value in the Date object using local time. + * @param hours A numeric value equal to the hours value. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setHours(hours: number, min?: number, sec?: number, ms?: number): number; + /** + * Sets the hours value in the Date object using Universal Coordinated Time (UTC). + * @param hours A numeric value equal to the hours value. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number; + /** + * Sets the numeric day-of-the-month value of the Date object using local time. + * @param date A numeric value equal to the day of the month. + */ + setDate(date: number): number; + /** + * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). + * @param date A numeric value equal to the day of the month. + */ + setUTCDate(date: number): number; + /** + * Sets the month value in the Date object using local time. + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. + * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used. + */ + setMonth(month: number, date?: number): number; + /** + * Sets the month value in the Date object using Universal Coordinated Time (UTC). + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. + * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used. + */ + setUTCMonth(month: number, date?: number): number; + /** + * Sets the year of the Date object using local time. + * @param year A numeric value for the year. + * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified. + * @param date A numeric value equal for the day of the month. + */ + setFullYear(year: number, month?: number, date?: number): number; + /** + * Sets the year value in the Date object using Universal Coordinated Time (UTC). + * @param year A numeric value equal to the year. + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied. + * @param date A numeric value equal to the day of the month. + */ + setUTCFullYear(year: number, month?: number, date?: number): number; + /** Returns a date converted to a string using Universal Coordinated Time (UTC). */ + toUTCString(): string; + /** Returns a date as a string value in ISO format. */ + toISOString(): string; + /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */ + toJSON(key?: any): string; +} + +interface DateConstructor { + new (): Date; + new (value: number): Date; + new (value: string): Date; + new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; + (): string; + readonly prototype: Date; + /** + * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. + * @param s A date string + */ + parse(s: string): number; + /** + * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date. + * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year. + * @param month The month as an number between 0 and 11 (January to December). + * @param date The date as an number between 1 and 31. + * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour. + * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes. + * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds. + * @param ms An number from 0 to 999 that specifies the milliseconds. + */ + UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; + now(): number; +} + +declare const Date: DateConstructor; + +interface RegExpMatchArray extends Array { + index?: number; + input?: string; +} + +interface RegExpExecArray extends Array { + index: number; + input: string; +} + +interface RegExp { + /** + * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. + * @param string The String object or string literal on which to perform the search. + */ + exec(string: string): RegExpExecArray | null; + + /** + * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. + * @param string String on which to perform the search. + */ + test(string: string): boolean; + + /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */ + readonly source: string; + + /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ + readonly global: boolean; + + /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */ + readonly ignoreCase: boolean; + + /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */ + readonly multiline: boolean; + + lastIndex: number; + + // Non-standard extensions + compile(): this; +} + +interface RegExpConstructor { + new (pattern: RegExp | string): RegExp; + new (pattern: string, flags?: string): RegExp; + (pattern: RegExp | string): RegExp; + (pattern: string, flags?: string): RegExp; + readonly prototype: RegExp; + + // Non-standard extensions + $1: string; + $2: string; + $3: string; + $4: string; + $5: string; + $6: string; + $7: string; + $8: string; + $9: string; + lastMatch: string; +} + +declare const RegExp: RegExpConstructor; + +interface Error { + name: string; + message: string; + stack?: string; +} + +interface ErrorConstructor { + new (message?: string): Error; + (message?: string): Error; + readonly prototype: Error; +} + +declare const Error: ErrorConstructor; + +interface EvalError extends Error { +} + +interface EvalErrorConstructor { + new (message?: string): EvalError; + (message?: string): EvalError; + readonly prototype: EvalError; +} + +declare const EvalError: EvalErrorConstructor; + +interface RangeError extends Error { +} + +interface RangeErrorConstructor { + new (message?: string): RangeError; + (message?: string): RangeError; + readonly prototype: RangeError; +} + +declare const RangeError: RangeErrorConstructor; + +interface ReferenceError extends Error { +} + +interface ReferenceErrorConstructor { + new (message?: string): ReferenceError; + (message?: string): ReferenceError; + readonly prototype: ReferenceError; +} + +declare const ReferenceError: ReferenceErrorConstructor; + +interface SyntaxError extends Error { +} + +interface SyntaxErrorConstructor { + new (message?: string): SyntaxError; + (message?: string): SyntaxError; + readonly prototype: SyntaxError; +} + +declare const SyntaxError: SyntaxErrorConstructor; + +interface TypeError extends Error { +} + +interface TypeErrorConstructor { + new (message?: string): TypeError; + (message?: string): TypeError; + readonly prototype: TypeError; +} + +declare const TypeError: TypeErrorConstructor; + +interface URIError extends Error { +} + +interface URIErrorConstructor { + new (message?: string): URIError; + (message?: string): URIError; + readonly prototype: URIError; +} + +declare const URIError: URIErrorConstructor; + +interface JSON { + /** + * Converts a JavaScript Object Notation (JSON) string into an object. + * @param text A valid JSON string. + * @param reviver A function that transforms the results. This function is called for each member of the object. + * If a member contains nested objects, the nested objects are transformed before the parent object is. + */ + parse(text: string, reviver?: (key: any, value: any) => any): any; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer A function that transforms the results. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + */ + stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer An array of strings and numbers that acts as a approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + */ + stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string; +} + +/** + * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format. + */ +declare const JSON: JSON; + + +///////////////////////////// +/// ECMAScript Array API (specially handled by compiler) +///////////////////////////// + +interface ReadonlyArray { + /** + * Gets the length of the array. This is a number one higher than the highest element defined in an array. + */ + readonly length: number; + /** + * Returns a string representation of an array. + */ + toString(): string; + toLocaleString(): string; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat>(...items: U[]): T[]; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: T[][]): T[]; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: (T | T[])[]): T[]; + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): T[]; + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. + */ + indexOf(searchElement: T, fromIndex?: number): number; + + /** + * Returns the index of the last occurrence of a specified value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. + */ + lastIndexOf(searchElement: T, fromIndex?: number): number; + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => boolean): boolean; + every(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => boolean, thisArg: Z): boolean; + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => boolean): boolean; + some(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => boolean, thisArg: Z): boolean; + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => void): void; + forEach(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => void, thisArg: Z): void; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => U): U[]; + map(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => U, thisArg: undefined): U[]; + map(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => U, thisArg: Z): U[]; + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => value is S): S[]; + filter(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => value is S, thisArg: undefined): S[]; + filter(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => value is S, thisArg: Z): S[]; + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => any): T[]; + filter(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray) => any, thisArg: undefined): T[]; + filter(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray) => any, thisArg: Z): T[]; + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue?: T): T; + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U; + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue?: T): T; + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U; + + readonly [n: number]: T; +} + +interface Array { + /** + * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. + */ + length: number; + /** + * Returns a string representation of an array. + */ + toString(): string; + toLocaleString(): string; + /** + * Appends new elements to an array, and returns the new length of the array. + * @param items New elements of the Array. + */ + push(...items: T[]): number; + /** + * Removes the last element from an array and returns it. + */ + pop(): T | undefined; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: T[][]): T[]; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: (T | T[])[]): T[]; + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + /** + * Reverses the elements in an Array. + */ + reverse(): T[]; + /** + * Removes the first element from an array and returns it. + */ + shift(): T | undefined; + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): T[]; + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: T, b: T) => number): this; + /** + * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. + * @param start The zero-based location in the array from which to start removing elements. + * @param deleteCount The number of elements to remove. + */ + splice(start: number, deleteCount?: number): T[]; + /** + * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. + * @param start The zero-based location in the array from which to start removing elements. + * @param deleteCount The number of elements to remove. + * @param items Elements to insert into the array in place of the deleted elements. + */ + splice(start: number, deleteCount: number, ...items: T[]): T[]; + /** + * Inserts new elements at the start of an array. + * @param items Elements to insert at the start of the Array. + */ + unshift(...items: T[]): number; + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. + */ + indexOf(searchElement: T, fromIndex?: number): number; + /** + * Returns the index of the last occurrence of a specified value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. + */ + lastIndexOf(searchElement: T, fromIndex?: number): number; + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: T, index: number, array: T[]) => boolean): boolean; + every(callbackfn: (this: void, value: T, index: number, array: T[]) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: T, index: number, array: T[]) => boolean, thisArg: Z): boolean; + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: T, index: number, array: T[]) => boolean): boolean; + some(callbackfn: (this: void, value: T, index: number, array: T[]) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: T, index: number, array: T[]) => boolean, thisArg: Z): boolean; + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: T, index: number, array: T[]) => void): void; + forEach(callbackfn: (this: void, value: T, index: number, array: T[]) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: T, index: number, array: T[]) => void, thisArg: Z): void; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U, U]; + map(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U, U]; + map(this: [T, T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U, U]; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U]; + map(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U]; + map(this: [T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U]; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U]; + map(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U]; + map(this: [T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U]; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U]; + map(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U]; + map(this: [T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U]; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: T, index: number, array: T[]) => U): U[]; + map(callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): U[]; + map(callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): U[]; + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: T, index: number, array: T[]) => any): T[]; + filter(callbackfn: (this: void, value: T, index: number, array: T[]) => any, thisArg: undefined): T[]; + filter(callbackfn: (this: Z, value: T, index: number, array: T[]) => any, thisArg: Z): T[]; + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + + [n: number]: T; +} + +interface ArrayConstructor { + new (arrayLength?: number): any[]; + new (arrayLength: number): T[]; + new (...items: T[]): T[]; + (arrayLength?: number): any[]; + (arrayLength: number): T[]; + (...items: T[]): T[]; + isArray(arg: any): arg is Array; + readonly prototype: Array; +} + +declare const Array: ArrayConstructor; + +interface TypedPropertyDescriptor { + enumerable?: boolean; + configurable?: boolean; + writable?: boolean; + value?: T; + get?: () => T; + set?: (value: T) => void; +} + +declare type ClassDecorator = (target: TFunction) => TFunction | void; +declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; +declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; +declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; + +declare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike; + +interface PromiseLike { + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): PromiseLike; +} + +/** + * Represents the completion of an asynchronous operation + */ +interface Promise { + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; + + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; +} + +interface ArrayLike { + readonly length: number; + readonly [n: number]: T; +} + +/** + * Make all properties in T optional + */ +type Partial = { + [P in keyof T]?: T[P]; +}; + +/** + * Make all properties in T readonly + */ +type Readonly = { + readonly [P in keyof T]: T[P]; +}; + +/** + * From T pick a set of properties K + */ +type Pick = { + [P in K]: T[P]; +}; + +/** + * Construct a type with a set of properties K of type T + */ +type Record = { + [P in K]: T; +}; + +/** + * Marker for contextual 'this' type + */ +interface ThisType { } + +/** + * Represents a raw buffer of binary data, which is used to store data for the + * different typed arrays. ArrayBuffers cannot be read from or written to directly, + * but can be passed to a typed array or DataView Object to interpret the raw + * buffer as needed. + */ +interface ArrayBuffer { + /** + * Read-only. The length of the ArrayBuffer (in bytes). + */ + readonly byteLength: number; + + /** + * Returns a section of an ArrayBuffer. + */ + slice(begin: number, end?: number): ArrayBuffer; +} + +interface ArrayBufferConstructor { + readonly prototype: ArrayBuffer; + new (byteLength: number): ArrayBuffer; + isView(arg: any): arg is ArrayBufferView; +} +declare const ArrayBuffer: ArrayBufferConstructor; + +interface ArrayBufferView { + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; +} + +interface DataView { + readonly buffer: ArrayBuffer; + readonly byteLength: number; + readonly byteOffset: number; + /** + * Gets the Float32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Float64 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat64(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Int8 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt8(byteOffset: number): number; + + /** + * Gets the Int16 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt16(byteOffset: number, littleEndian?: boolean): number; + /** + * Gets the Int32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Uint8 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint8(byteOffset: number): number; + + /** + * Gets the Uint16 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint16(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Uint32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Stores an Float32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Float64 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Int8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setInt8(byteOffset: number, value: number): void; + + /** + * Stores an Int16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Int32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Uint8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setUint8(byteOffset: number, value: number): void; + + /** + * Stores an Uint16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Uint32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; +} + +interface DataViewConstructor { + new (buffer: ArrayBuffer, byteOffset?: number, byteLength?: number): DataView; +} +declare const DataView: DataViewConstructor; + +/** + * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Int8Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Int8Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Int8Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Int8Array) => any): Int8Array; + filter(callbackfn: (this: void, value: number, index: number, array: Int8Array) => any, thisArg: undefined): Int8Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => any, thisArg: Z): Int8Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Int8Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Int8Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Int8Array) => number): Int8Array; + map(callbackfn: (this: void, value: number, index: number, array: Int8Array) => number, thisArg: undefined): Int8Array; + map(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => number, thisArg: Z): Int8Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int8Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Int8Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Int8Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Int8Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int8Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} +interface Int8ArrayConstructor { + readonly prototype: Int8Array; + new (length: number): Int8Array; + new (array: ArrayLike): Int8Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Int8Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int8Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int8Array; + + from(arrayLike: ArrayLike): Int8Array; + +} +declare const Int8Array: Int8ArrayConstructor; + +/** + * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => any): Uint8Array; + filter(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => any, thisArg: undefined): Uint8Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => any, thisArg: Z): Uint8Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => number): Uint8Array; + map(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => number, thisArg: undefined): Uint8Array; + map(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => number, thisArg: Z): Uint8Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint8Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Uint8Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint8Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Uint8ArrayConstructor { + readonly prototype: Uint8Array; + new (length: number): Uint8Array; + new (array: ArrayLike): Uint8Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Uint8Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8Array; + + from(arrayLike: ArrayLike): Uint8Array; + +} +declare const Uint8Array: Uint8ArrayConstructor; + +/** + * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. + * If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8ClampedArray { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => any): Uint8ClampedArray; + filter(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => any, thisArg: undefined): Uint8ClampedArray; + filter(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => any, thisArg: Z): Uint8ClampedArray; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => number): Uint8ClampedArray; + map(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => number, thisArg: undefined): Uint8ClampedArray; + map(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => number, thisArg: Z): Uint8ClampedArray; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint8ClampedArray; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Uint8ClampedArray, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Uint8ClampedArray; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint8ClampedArray; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Uint8ClampedArrayConstructor { + readonly prototype: Uint8ClampedArray; + new (length: number): Uint8ClampedArray; + new (array: ArrayLike): Uint8ClampedArray; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8ClampedArray; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint8ClampedArray; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Uint8ClampedArray; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8ClampedArray; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8ClampedArray; + + from(arrayLike: ArrayLike): Uint8ClampedArray; +} +declare const Uint8ClampedArray: Uint8ClampedArrayConstructor; + +/** + * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int16Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Int16Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Int16Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Int16Array) => any): Int16Array; + filter(callbackfn: (this: void, value: number, index: number, array: Int16Array) => any, thisArg: undefined): Int16Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => any, thisArg: Z): Int16Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Int16Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Int16Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Int16Array) => number): Int16Array; + map(callbackfn: (this: void, value: number, index: number, array: Int16Array) => number, thisArg: undefined): Int16Array; + map(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => number, thisArg: Z): Int16Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int16Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Int16Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Int16Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Int16Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int16Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Int16ArrayConstructor { + readonly prototype: Int16Array; + new (length: number): Int16Array; + new (array: ArrayLike): Int16Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Int16Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int16Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int16Array; + + from(arrayLike: ArrayLike): Int16Array; + +} +declare const Int16Array: Int16ArrayConstructor; + +/** + * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint16Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => any): Uint16Array; + filter(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => any, thisArg: undefined): Uint16Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => any, thisArg: Z): Uint16Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => number): Uint16Array; + map(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => number, thisArg: undefined): Uint16Array; + map(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => number, thisArg: Z): Uint16Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint16Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Uint16Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint16Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Uint16ArrayConstructor { + readonly prototype: Uint16Array; + new (length: number): Uint16Array; + new (array: ArrayLike): Uint16Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Uint16Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint16Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint16Array; + + from(arrayLike: ArrayLike): Uint16Array; + +} +declare const Uint16Array: Uint16ArrayConstructor; +/** + * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int32Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Int32Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Int32Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Int32Array) => any): Int32Array; + filter(callbackfn: (this: void, value: number, index: number, array: Int32Array) => any, thisArg: undefined): Int32Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => any, thisArg: Z): Int32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Int32Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Int32Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Int32Array) => number): Int32Array; + map(callbackfn: (this: void, value: number, index: number, array: Int32Array) => number, thisArg: undefined): Int32Array; + map(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => number, thisArg: Z): Int32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int32Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Int32Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Int32Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Int32Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Int32ArrayConstructor { + readonly prototype: Int32Array; + new (length: number): Int32Array; + new (array: ArrayLike): Int32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Int32Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int32Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int32Array; + + from(arrayLike: ArrayLike): Int32Array; +} +declare const Int32Array: Int32ArrayConstructor; + +/** + * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint32Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => any): Uint32Array; + filter(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => any, thisArg: undefined): Uint32Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => any, thisArg: Z): Uint32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => number): Uint32Array; + map(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => number, thisArg: undefined): Uint32Array; + map(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => number, thisArg: Z): Uint32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint32Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Uint32Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Uint32ArrayConstructor { + readonly prototype: Uint32Array; + new (length: number): Uint32Array; + new (array: ArrayLike): Uint32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Uint32Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint32Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint32Array; + + from(arrayLike: ArrayLike): Uint32Array; +} +declare const Uint32Array: Uint32ArrayConstructor; + +/** + * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number + * of bytes could not be allocated an exception is raised. + */ +interface Float32Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Float32Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Float32Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Float32Array) => any): Float32Array; + filter(callbackfn: (this: void, value: number, index: number, array: Float32Array) => any, thisArg: undefined): Float32Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => any, thisArg: Z): Float32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Float32Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Float32Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Float32Array) => number): Float32Array; + map(callbackfn: (this: void, value: number, index: number, array: Float32Array) => number, thisArg: undefined): Float32Array; + map(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => number, thisArg: Z): Float32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Float32Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Float32Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Float32Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Float32Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Float32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Float32ArrayConstructor { + readonly prototype: Float32Array; + new (length: number): Float32Array; + new (array: ArrayLike): Float32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Float32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Float32Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float32Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float32Array; + + from(arrayLike: ArrayLike): Float32Array; + +} +declare const Float32Array: Float32ArrayConstructor; + +/** + * A typed array of 64-bit float values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Float64Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (this: void, value: number, index: number, array: Float64Array) => boolean): boolean; + every(callbackfn: (this: void, value: number, index: number, array: Float64Array) => boolean, thisArg: undefined): boolean; + every(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => boolean, thisArg: Z): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (this: void, value: number, index: number, array: Float64Array) => any): Float64Array; + filter(callbackfn: (this: void, value: number, index: number, array: Float64Array) => any, thisArg: undefined): Float64Array; + filter(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => any, thisArg: Z): Float64Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number | undefined; + find(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number | undefined; + find(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: number, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: number, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (this: void, value: number, index: number, array: Float64Array) => void): void; + forEach(callbackfn: (this: void, value: number, index: number, array: Float64Array) => void, thisArg: undefined): void; + forEach(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => void, thisArg: Z): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (this: void, value: number, index: number, array: Float64Array) => number): Float64Array; + map(callbackfn: (this: void, value: number, index: number, array: Float64Array) => number, thisArg: undefined): Float64Array; + map(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => number, thisArg: Z): Float64Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Float64Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Float64Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (this: void, value: number, index: number, array: Float64Array) => boolean): boolean; + some(callbackfn: (this: void, value: number, index: number, array: Float64Array) => boolean, thisArg: undefined): boolean; + some(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => boolean, thisArg: Z): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Float64Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Float64ArrayConstructor { + readonly prototype: Float64Array; + new (length: number): Float64Array; + new (array: ArrayLike): Float64Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Float64Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number): Float64Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float64Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float64Array; + + from(arrayLike: ArrayLike): Float64Array; +} +declare const Float64Array: Float64ArrayConstructor; + +///////////////////////////// +/// ECMAScript Internationalization API +///////////////////////////// + +declare namespace Intl { + interface CollatorOptions { + usage?: string; + localeMatcher?: string; + numeric?: boolean; + caseFirst?: string; + sensitivity?: string; + ignorePunctuation?: boolean; + } + + interface ResolvedCollatorOptions { + locale: string; + usage: string; + sensitivity: string; + ignorePunctuation: boolean; + collation: string; + caseFirst: string; + numeric: boolean; + } + + interface Collator { + compare(x: string, y: string): number; + resolvedOptions(): ResolvedCollatorOptions; + } + var Collator: { + new (locales?: string | string[], options?: CollatorOptions): Collator; + (locales?: string | string[], options?: CollatorOptions): Collator; + supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[]; + }; + + interface NumberFormatOptions { + localeMatcher?: string; + style?: string; + currency?: string; + currencyDisplay?: string; + useGrouping?: boolean; + minimumIntegerDigits?: number; + minimumFractionDigits?: number; + maximumFractionDigits?: number; + minimumSignificantDigits?: number; + maximumSignificantDigits?: number; + } + + interface ResolvedNumberFormatOptions { + locale: string; + numberingSystem: string; + style: string; + currency?: string; + currencyDisplay?: string; + minimumIntegerDigits: number; + minimumFractionDigits: number; + maximumFractionDigits: number; + minimumSignificantDigits?: number; + maximumSignificantDigits?: number; + useGrouping: boolean; + } + + interface NumberFormat { + format(value: number): string; + resolvedOptions(): ResolvedNumberFormatOptions; + } + var NumberFormat: { + new (locales?: string | string[], options?: NumberFormatOptions): NumberFormat; + (locales?: string | string[], options?: NumberFormatOptions): NumberFormat; + supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[]; + }; + + interface DateTimeFormatOptions { + localeMatcher?: string; + weekday?: string; + era?: string; + year?: string; + month?: string; + day?: string; + hour?: string; + minute?: string; + second?: string; + timeZoneName?: string; + formatMatcher?: string; + hour12?: boolean; + timeZone?: string; + } + + interface ResolvedDateTimeFormatOptions { + locale: string; + calendar: string; + numberingSystem: string; + timeZone: string; + hour12?: boolean; + weekday?: string; + era?: string; + year?: string; + month?: string; + day?: string; + hour?: string; + minute?: string; + second?: string; + timeZoneName?: string; + } + + interface DateTimeFormat { + format(date?: Date | number): string; + resolvedOptions(): ResolvedDateTimeFormatOptions; + } + var DateTimeFormat: { + new (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat; + (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat; + supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[]; + }; +} + +interface String { + /** + * Determines whether two strings are equivalent in the current or specified locale. + * @param that String to compare to target string + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. + * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. + */ + localeCompare(that: string, locales?: string | string[], options?: Intl.CollatorOptions): number; +} + +interface Number { + /** + * Converts a number to a string by using the current or specified locale. + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string; +} + +interface Date { + /** + * Converts a date and time to a string by using the current or specified locale. + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; + /** + * Converts a date to a string by using the current or specified locale. + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; + + /** + * Converts a time to a string by using the current or specified locale. + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; +} + + +declare type PropertyKey = string | number | symbol; + +interface Array { + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: T, index: number, obj: Array) => boolean): T | undefined; + find(predicate: (this: void, value: T, index: number, obj: Array) => boolean, thisArg: undefined): T | undefined; + find(predicate: (this: Z, value: T, index: number, obj: Array) => boolean, thisArg: Z): T | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: T, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: T, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: T, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: T, start?: number, end?: number): this; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; +} + +interface ArrayConstructor { + /** + * Creates an array from an array-like object. + * @param arrayLike An array-like object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: T, k: number) => U): Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: T, k: number) => U, thisArg: undefined): Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: T, k: number) => U, thisArg: Z): Array; + + + /** + * Creates an array from an array-like object. + * @param arrayLike An array-like object to convert to an array. + */ + from(arrayLike: ArrayLike): Array; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: T[]): Array; +} + +interface DateConstructor { + new (value: Date): Date; +} + +interface Function { + /** + * Returns the name of the function. Function names are read-only and can not be changed. + */ + readonly name: string; +} + +interface Math { + /** + * Returns the number of leading zero bits in the 32-bit binary representation of a number. + * @param x A numeric expression. + */ + clz32(x: number): number; + + /** + * Returns the result of 32-bit multiplication of two numbers. + * @param x First number + * @param y Second number + */ + imul(x: number, y: number): number; + + /** + * Returns the sign of the x, indicating whether x is positive, negative or zero. + * @param x The numeric expression to test + */ + sign(x: number): number; + + /** + * Returns the base 10 logarithm of a number. + * @param x A numeric expression. + */ + log10(x: number): number; + + /** + * Returns the base 2 logarithm of a number. + * @param x A numeric expression. + */ + log2(x: number): number; + + /** + * Returns the natural logarithm of 1 + x. + * @param x A numeric expression. + */ + log1p(x: number): number; + + /** + * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of + * the natural logarithms). + * @param x A numeric expression. + */ + expm1(x: number): number; + + /** + * Returns the hyperbolic cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + cosh(x: number): number; + + /** + * Returns the hyperbolic sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + sinh(x: number): number; + + /** + * Returns the hyperbolic tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + tanh(x: number): number; + + /** + * Returns the inverse hyperbolic cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + acosh(x: number): number; + + /** + * Returns the inverse hyperbolic sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + asinh(x: number): number; + + /** + * Returns the inverse hyperbolic tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + atanh(x: number): number; + + /** + * Returns the square root of the sum of squares of its arguments. + * @param values Values to compute the square root for. + * If no arguments are passed, the result is +0. + * If there is only one argument, the result is the absolute value. + * If any argument is +Infinity or -Infinity, the result is +Infinity. + * If any argument is NaN, the result is NaN. + * If all arguments are either +0 or −0, the result is +0. + */ + hypot(...values: number[] ): number; + + /** + * Returns the integral part of the a numeric expression, x, removing any fractional digits. + * If x is already an integer, the result is x. + * @param x A numeric expression. + */ + trunc(x: number): number; + + /** + * Returns the nearest single precision float representation of a number. + * @param x A numeric expression. + */ + fround(x: number): number; + + /** + * Returns an implementation-dependent approximation to the cube root of number. + * @param x A numeric expression. + */ + cbrt(x: number): number; +} + +interface NumberConstructor { + /** + * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 + * that is representable as a Number value, which is approximately: + * 2.2204460492503130808472633361816 x 10â€âˆ’â€16. + */ + readonly EPSILON: number; + + /** + * Returns true if passed value is finite. + * Unlike the global isFinite, Number.isFinite doesn't forcibly convert the parameter to a + * number. Only finite values of the type number, result in true. + * @param number A numeric value. + */ + isFinite(number: number): boolean; + + /** + * Returns true if the value passed is an integer, false otherwise. + * @param number A numeric value. + */ + isInteger(number: number): boolean; + + /** + * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a + * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter + * to a number. Only values of the type number, that are also NaN, result in true. + * @param number A numeric value. + */ + isNaN(number: number): boolean; + + /** + * Returns true if the value passed is a safe integer. + * @param number A numeric value. + */ + isSafeInteger(number: number): boolean; + + /** + * The value of the largest integer n such that n and n + 1 are both exactly representable as + * a Number value. + * The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1. + */ + readonly MAX_SAFE_INTEGER: number; + + /** + * The value of the smallest integer n such that n and n − 1 are both exactly representable as + * a Number value. + * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). + */ + readonly MIN_SAFE_INTEGER: number; + + /** + * Converts a string to a floating-point number. + * @param string A string that contains a floating-point number. + */ + parseFloat(string: string): number; + + /** + * Converts A string to an integer. + * @param s A string to convert into a number. + * @param radix A value between 2 and 36 that specifies the base of the number in numString. + * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. + * All other strings are considered decimal. + */ + parseInt(string: string, radix?: number): number; +} + +interface Object { + /** + * Determines whether an object has a property with the specified name. + * @param v A property name. + */ + hasOwnProperty(v: PropertyKey): boolean; + + /** + * Determines whether a specified property is enumerable. + * @param v A property name. + */ + propertyIsEnumerable(v: PropertyKey): boolean; +} + +interface ObjectConstructor { + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param source The source object from which to copy properties. + */ + assign(target: T, source: U): T & U; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param source1 The first source object from which to copy properties. + * @param source2 The second source object from which to copy properties. + */ + assign(target: T, source1: U, source2: V): T & U & V; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param source1 The first source object from which to copy properties. + * @param source2 The second source object from which to copy properties. + * @param source3 The third source object from which to copy properties. + */ + assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param sources One or more source objects from which to copy properties + */ + assign(target: object, ...sources: any[]): any; + + /** + * Returns an array of all symbol properties found directly on object o. + * @param o Object to retrieve the symbols from. + */ + getOwnPropertySymbols(o: any): symbol[]; + + /** + * Returns true if the values are the same value, false otherwise. + * @param value1 The first value. + * @param value2 The second value. + */ + is(value1: any, value2: any): boolean; + + /** + * Sets the prototype of a specified object o to object proto or null. Returns the object o. + * @param o The object to change its prototype. + * @param proto The value of the new prototype or null. + */ + setPrototypeOf(o: any, proto: object | null): any; + + /** + * Gets the own property descriptor of the specified object. + * An own property descriptor is one that is defined directly on the object and is not + * inherited from the object's prototype. + * @param o Object that contains the property. + * @param p Name of the property. + */ + getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor; + + /** + * Adds a property to an object, or modifies attributes of an existing property. + * @param o Object on which to add or modify the property. This can be a native JavaScript + * object (that is, a user-defined object or a built in object) or a DOM object. + * @param p The property name. + * @param attributes Descriptor for the property. It can be for a data property or an accessor + * property. + */ + defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any; +} + +interface ReadonlyArray { + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: T, index: number, obj: ReadonlyArray) => boolean): T | undefined; + find(predicate: (this: void, value: T, index: number, obj: ReadonlyArray) => boolean, thisArg: undefined): T | undefined; + find(predicate: (this: Z, value: T, index: number, obj: ReadonlyArray) => boolean, thisArg: Z): T | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: T, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: T, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: T, index: number, obj: Array) => boolean, thisArg: Z): number; +} + +interface RegExp { + /** + * Returns a string indicating the flags of the regular expression in question. This field is read-only. + * The characters in this string are sequenced and concatenated in the following order: + * + * - "g" for global + * - "i" for ignoreCase + * - "m" for multiline + * - "u" for unicode + * - "y" for sticky + * + * If no flags are set, the value is the empty string. + */ + readonly flags: string; + + /** + * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular + * expression. Default is false. Read-only. + */ + readonly sticky: boolean; + + /** + * Returns a Boolean value indicating the state of the Unicode flag (u) used with a regular + * expression. Default is false. Read-only. + */ + readonly unicode: boolean; +} + +interface RegExpConstructor { + new (pattern: RegExp, flags?: string): RegExp; + (pattern: RegExp, flags?: string): RegExp; +} + +interface String { + /** + * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point + * value of the UTF-16 encoded code point starting at the string element at position pos in + * the String resulting from converting this object to a String. + * If there is no element at that position, the result is undefined. + * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. + */ + codePointAt(pos: number): number | undefined; + + /** + * Returns true if searchString appears as a substring of the result of converting this + * object to a String, at one or more positions that are + * greater than or equal to position; otherwise, returns false. + * @param searchString search string + * @param position If position is undefined, 0 is assumed, so as to search all of the String. + */ + includes(searchString: string, position?: number): boolean; + + /** + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at + * endPosition – length(this). Otherwise returns false. + */ + endsWith(searchString: string, endPosition?: number): boolean; + + /** + * Returns the String value result of normalizing the string into the normalization form + * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. + * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default + * is "NFC" + */ + normalize(form: "NFC" | "NFD" | "NFKC" | "NFKD"): string; + + /** + * Returns the String value result of normalizing the string into the normalization form + * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. + * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default + * is "NFC" + */ + normalize(form?: string): string; + + /** + * Returns a String value that is made from count copies appended together. If count is 0, + * T is the empty String is returned. + * @param count number of copies to append + */ + repeat(count: number): string; + + /** + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at + * position. Otherwise returns false. + */ + startsWith(searchString: string, position?: number): boolean; + + /** + * Returns an HTML anchor element and sets the name attribute to the text value + * @param name + */ + anchor(name: string): string; + + /** Returns a HTML element */ + big(): string; + + /** Returns a HTML element */ + blink(): string; + + /** Returns a HTML element */ + bold(): string; + + /** Returns a HTML element */ + fixed(): string; + + /** Returns a HTML element and sets the color attribute value */ + fontcolor(color: string): string; + + /** Returns a HTML element and sets the size attribute value */ + fontsize(size: number): string; + + /** Returns a HTML element and sets the size attribute value */ + fontsize(size: string): string; + + /** Returns an HTML element */ + italics(): string; + + /** Returns an HTML element and sets the href attribute value */ + link(url: string): string; + + /** Returns a HTML element */ + small(): string; + + /** Returns a HTML element */ + strike(): string; + + /** Returns a HTML element */ + sub(): string; + + /** Returns a HTML element */ + sup(): string; +} + +interface StringConstructor { + /** + * Return the String value whose elements are, in order, the elements in the List elements. + * If length is 0, the empty string is returned. + */ + fromCodePoint(...codePoints: number[]): string; + + /** + * String.raw is intended for use as a tag function of a Tagged Template String. When called + * as such the first argument will be a well formed template call site object and the rest + * parameter will contain the substitution values. + * @param template A well-formed template string call site representation. + * @param substitutions A set of substitution values. + */ + raw(template: TemplateStringsArray, ...substitutions: any[]): string; +} + + +interface Map { + clear(): void; + delete(key: K): boolean; + forEach(callbackfn: (value: V, key: K, map: Map) => void, thisArg?: any): void; + get(key: K): V | undefined; + has(key: K): boolean; + set(key: K, value: V): this; + readonly size: number; +} + +interface MapConstructor { + new (): Map; + new (entries?: [K, V][]): Map; + readonly prototype: Map; +} +declare var Map: MapConstructor; + +interface ReadonlyMap { + forEach(callbackfn: (value: V, key: K, map: ReadonlyMap) => void, thisArg?: any): void; + get(key: K): V | undefined; + has(key: K): boolean; + readonly size: number; +} + +interface WeakMap { + delete(key: K): boolean; + get(key: K): V | undefined; + has(key: K): boolean; + set(key: K, value: V): this; +} + +interface WeakMapConstructor { + new (): WeakMap; + new (entries?: [K, V][]): WeakMap; + readonly prototype: WeakMap; +} +declare var WeakMap: WeakMapConstructor; + +interface Set { + add(value: T): this; + clear(): void; + delete(value: T): boolean; + forEach(callbackfn: (value: T, value2: T, set: Set) => void, thisArg?: any): void; + has(value: T): boolean; + readonly size: number; +} + +interface SetConstructor { + new (): Set; + new (values?: T[]): Set; + readonly prototype: Set; +} +declare var Set: SetConstructor; + +interface ReadonlySet { + forEach(callbackfn: (value: T, value2: T, set: ReadonlySet) => void, thisArg?: any): void; + has(value: T): boolean; + readonly size: number; +} + +interface WeakSet { + add(value: T): this; + delete(value: T): boolean; + has(value: T): boolean; +} + +interface WeakSetConstructor { + new (): WeakSet; + new (values?: T[]): WeakSet; + readonly prototype: WeakSet; +} +declare var WeakSet: WeakSetConstructor; + + +interface Generator extends Iterator { } + +interface GeneratorFunction { + /** + * Creates a new Generator object. + * @param args A list of arguments the function accepts. + */ + new (...args: any[]): Generator; + /** + * Creates a new Generator object. + * @param args A list of arguments the function accepts. + */ + (...args: any[]): Generator; + /** + * The length of the arguments. + */ + readonly length: number; + /** + * Returns the name of the function. + */ + readonly name: string; + /** + * A reference to the prototype. + */ + readonly prototype: Generator; +} + +interface GeneratorFunctionConstructor { + /** + * Creates a new Generator function. + * @param args A list of arguments the function accepts. + */ + new (...args: string[]): GeneratorFunction; + /** + * Creates a new Generator function. + * @param args A list of arguments the function accepts. + */ + (...args: string[]): GeneratorFunction; + /** + * The length of the arguments. + */ + readonly length: number; + /** + * Returns the name of the function. + */ + readonly name: string; + /** + * A reference to the prototype. + */ + readonly prototype: GeneratorFunction; +} +declare var GeneratorFunction: GeneratorFunctionConstructor; + + +/// + +interface SymbolConstructor { + /** + * A method that returns the default iterator for an object. Called by the semantics of the + * for-of statement. + */ + readonly iterator: symbol; +} + +interface IteratorResult { + done: boolean; + value: T; +} + +interface Iterator { + next(value?: any): IteratorResult; + return?(value?: any): IteratorResult; + throw?(e?: any): IteratorResult; +} + +interface Iterable { + [Symbol.iterator](): Iterator; +} + +interface IterableIterator extends Iterator { + [Symbol.iterator](): IterableIterator; +} + +interface Array { + /** Iterator */ + [Symbol.iterator](): IterableIterator; + + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, T]>; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface ArrayConstructor { + /** + * Creates an array from an iterable object. + * @param iterable An iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(iterable: Iterable, mapfn: (this: void, v: T, k: number) => U): Array; + from(iterable: Iterable, mapfn: (this: void, v: T, k: number) => U, thisArg: undefined): Array; + from(iterable: Iterable, mapfn: (this: Z, v: T, k: number) => U, thisArg: Z): Array; + + /** + * Creates an array from an iterable object. + * @param iterable An iterable object to convert to an array. + */ + from(iterable: Iterable): Array; +} + +interface ReadonlyArray { + /** Iterator */ + [Symbol.iterator](): IterableIterator; + + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, T]>; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface IArguments { + /** Iterator */ + [Symbol.iterator](): IterableIterator; +} + +interface Map { + [Symbol.iterator](): IterableIterator<[K, V]>; + entries(): IterableIterator<[K, V]>; + keys(): IterableIterator; + values(): IterableIterator; +} + +interface MapConstructor { + new (iterable: Iterable<[K, V]>): Map; +} + +interface WeakMap { } + +interface WeakMapConstructor { + new (iterable: Iterable<[K, V]>): WeakMap; +} + +interface Set { + [Symbol.iterator](): IterableIterator; + entries(): IterableIterator<[T, T]>; + keys(): IterableIterator; + values(): IterableIterator; +} + +interface SetConstructor { + new (iterable: Iterable): Set; +} + +interface WeakSet { } + +interface WeakSetConstructor { + new (iterable: Iterable): WeakSet; +} + +interface Promise { } + +interface PromiseConstructor { + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: Iterable>): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: Iterable>): Promise; +} + +declare namespace Reflect { + function enumerate(target: object): IterableIterator; +} + +interface String { + /** Iterator */ + [Symbol.iterator](): IterableIterator; +} + +/** + * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Int8Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Int8ArrayConstructor { + new (elements: Iterable): Int8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Int8Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int8Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int8Array; + + from(arrayLike: Iterable): Int8Array; +} + +/** + * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint8ArrayConstructor { + new (elements: Iterable): Uint8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Uint8Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8Array; + + from(arrayLike: Iterable): Uint8Array; +} + +/** + * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. + * If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8ClampedArray { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint8ClampedArrayConstructor { + new (elements: Iterable): Uint8ClampedArray; + + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Uint8ClampedArray; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8ClampedArray; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8ClampedArray; + + from(arrayLike: Iterable): Uint8ClampedArray; +} + +/** + * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int16Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Int16ArrayConstructor { + new (elements: Iterable): Int16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Int16Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int16Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int16Array; + + from(arrayLike: Iterable): Int16Array; +} + +/** + * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint16Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint16ArrayConstructor { + new (elements: Iterable): Uint16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Uint16Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint16Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint16Array; + + from(arrayLike: Iterable): Uint16Array; +} + +/** + * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int32Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Int32ArrayConstructor { + new (elements: Iterable): Int32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Int32Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int32Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int32Array; + + from(arrayLike: Iterable): Int32Array; +} + +/** + * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint32Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint32ArrayConstructor { + new (elements: Iterable): Uint32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Uint32Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint32Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint32Array; + + from(arrayLike: Iterable): Uint32Array; +} + +/** + * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number + * of bytes could not be allocated an exception is raised. + */ +interface Float32Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Float32ArrayConstructor { + new (elements: Iterable): Float32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Float32Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float32Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float32Array; + + from(arrayLike: Iterable): Float32Array; +} + +/** + * A typed array of 64-bit float values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Float64Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Float64ArrayConstructor { + new (elements: Iterable): Float64Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Float64Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float64Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float64Array; + + from(arrayLike: Iterable): Float64Array; +} + + +interface PromiseConstructor { + /** + * A reference to the prototype. + */ + readonly prototype: Promise; + + /** + * Creates a new Promise. + * @param executor A callback used to initialize the promise. This callback is passed two arguments: + * a resolve callback used resolve the promise with a value or the result of another promise, + * and a reject callback used to reject the promise with a provided reason or error. + */ + new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: (T | PromiseLike)[]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: (T | PromiseLike)[]): Promise; + + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected Promise. + */ + reject(reason: any): Promise; + + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected Promise. + */ + reject(reason: any): Promise; + + /** + * Creates a new resolved promise for the provided value. + * @param value A promise. + * @returns A promise whose internal state matches the provided promise. + */ + resolve(value: T | PromiseLike): Promise; + + /** + * Creates a new resolved promise . + * @returns A resolved promise. + */ + resolve(): Promise; } -/** - * Represents the completion of an asynchronous operation - */ -interface Promise { - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: ((value: T) => T | PromiseLike) | undefined | null, onrejected?: ((reason: any) => T | PromiseLike) | undefined | null): Promise; - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled: ((value: T) => T | PromiseLike) | undefined | null, onrejected: (reason: any) => TResult | PromiseLike): Promise; - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled: (value: T) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled: (value: T) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; - - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected?: ((reason: any) => T | PromiseLike) | undefined | null): Promise; - - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected: (reason: any) => TResult | PromiseLike): Promise; -} - -interface PromiseConstructor { - /** - * A reference to the prototype. - */ - readonly prototype: Promise; - - /** - * Creates a new Promise. - * @param executor A callback used to initialize the promise. This callback is passed two arguments: - * a resolve callback used resolve the promise with a value or the result of another promise, - * and a reject callback used to reject the promise with a provided reason or error. - */ - new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: (T | PromiseLike)[]): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: (T | PromiseLike)[]): Promise; - - /** - * Creates a new rejected promise for the provided reason. - * @param reason The reason the promise was rejected. - * @returns A new rejected Promise. - */ - reject(reason: any): Promise; - - /** - * Creates a new rejected promise for the provided reason. - * @param reason The reason the promise was rejected. - * @returns A new rejected Promise. - */ - reject(reason: any): Promise; - - /** - * Creates a new resolved promise for the provided value. - * @param value A promise. - * @returns A promise whose internal state matches the provided promise. - */ - resolve(value: T | PromiseLike): Promise; - - /** - * Creates a new resolved promise . - * @returns A resolved promise. - */ - resolve(): Promise; -} - declare var Promise: PromiseConstructor; -interface ProxyHandler { - getPrototypeOf? (target: T): {} | null; - setPrototypeOf? (target: T, v: any): boolean; - isExtensible? (target: T): boolean; - preventExtensions? (target: T): boolean; - getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor; - has? (target: T, p: PropertyKey): boolean; - get? (target: T, p: PropertyKey, receiver: any): any; - set? (target: T, p: PropertyKey, value: any, receiver: any): boolean; - deleteProperty? (target: T, p: PropertyKey): boolean; - defineProperty? (target: T, p: PropertyKey, attributes: PropertyDescriptor): boolean; - enumerate? (target: T): PropertyKey[]; - ownKeys? (target: T): PropertyKey[]; - apply? (target: T, thisArg: any, argArray?: any): any; - construct? (target: T, argArray: any, newTarget?: any): {}; -} - -interface ProxyConstructor { - revocable(target: T, handler: ProxyHandler): { proxy: T; revoke: () => void; }; - new (target: T, handler: ProxyHandler): T -} -declare var Proxy: ProxyConstructor; - - -declare namespace Reflect { - function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; - function construct(target: Function, argumentsList: ArrayLike, newTarget?: any): any; - function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; - function deleteProperty(target: any, propertyKey: PropertyKey): boolean; - function get(target: any, propertyKey: PropertyKey, receiver?: any): any; - function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; - function getPrototypeOf(target: any): any; - function has(target: any, propertyKey: PropertyKey): boolean; - function isExtensible(target: any): boolean; - function ownKeys(target: any): Array; - function preventExtensions(target: any): boolean; - function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; - function setPrototypeOf(target: any, proto: any): boolean; +interface ProxyHandler { + getPrototypeOf? (target: T): object | null; + setPrototypeOf? (target: T, v: any): boolean; + isExtensible? (target: T): boolean; + preventExtensions? (target: T): boolean; + getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor; + has? (target: T, p: PropertyKey): boolean; + get? (target: T, p: PropertyKey, receiver: any): any; + set? (target: T, p: PropertyKey, value: any, receiver: any): boolean; + deleteProperty? (target: T, p: PropertyKey): boolean; + defineProperty? (target: T, p: PropertyKey, attributes: PropertyDescriptor): boolean; + enumerate? (target: T): PropertyKey[]; + ownKeys? (target: T): PropertyKey[]; + apply? (target: T, thisArg: any, argArray?: any): any; + construct? (target: T, argArray: any, newTarget?: any): object; +} + +interface ProxyConstructor { + revocable(target: T, handler: ProxyHandler): { proxy: T; revoke: () => void; }; + new (target: T, handler: ProxyHandler): T; +} +declare var Proxy: ProxyConstructor; + + +declare namespace Reflect { + function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; + function construct(target: Function, argumentsList: ArrayLike, newTarget?: any): any; + function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; + function deleteProperty(target: object, propertyKey: PropertyKey): boolean; + function get(target: object, propertyKey: PropertyKey, receiver?: any): any; + function getOwnPropertyDescriptor(target: object, propertyKey: PropertyKey): PropertyDescriptor; + function getPrototypeOf(target: object): object; + function has(target: object, propertyKey: PropertyKey): boolean; + function isExtensible(target: object): boolean; + function ownKeys(target: object): Array; + function preventExtensions(target: object): boolean; + function set(target: object, propertyKey: PropertyKey, value: any, receiver?: any): boolean; + function setPrototypeOf(target: object, proto: any): boolean; +} + + +interface Symbol { + /** Returns a string representation of an object. */ + toString(): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): symbol; +} + +interface SymbolConstructor { + /** + * A reference to the prototype. + */ + readonly prototype: Symbol; + + /** + * Returns a new unique Symbol value. + * @param description Description of the new Symbol object. + */ + (description?: string | number): symbol; + + /** + * Returns a Symbol object from the global symbol registry matching the given key if found. + * Otherwise, returns a new symbol with this key. + * @param key key to search for. + */ + for(key: string): symbol; + + /** + * Returns a key from the global symbol registry matching the given Symbol if found. + * Otherwise, returns a undefined. + * @param sym Symbol to find the key for. + */ + keyFor(sym: symbol): string | undefined; } -interface Symbol { - /** Returns a string representation of an object. */ - toString(): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): Object; -} - -interface SymbolConstructor { - /** - * A reference to the prototype. - */ - readonly prototype: Symbol; - - /** - * Returns a new unique Symbol value. - * @param description Description of the new Symbol object. - */ - (description?: string|number): symbol; - - /** - * Returns a Symbol object from the global symbol registry matching the given key if found. - * Otherwise, returns a new symbol with this key. - * @param key key to search for. - */ - for(key: string): symbol; - - /** - * Returns a key from the global symbol registry matching the given Symbol if found. - * Otherwise, returns a undefined. - * @param sym Symbol to find the key for. - */ - keyFor(sym: symbol): string | undefined; -} - declare var Symbol: SymbolConstructor; -/// - -interface SymbolConstructor { - /** - * A method that determines if a constructor object recognizes an object as one of the - * constructor’s instances. Called by the semantics of the instanceof operator. - */ - readonly hasInstance: symbol; - - /** - * A Boolean value that if true indicates that an object should flatten to its array elements - * by Array.prototype.concat. - */ - readonly isConcatSpreadable: symbol; - - /** - * A regular expression method that matches the regular expression against a string. Called - * by the String.prototype.match method. - */ - readonly match: symbol; - - /** - * A regular expression method that replaces matched substrings of a string. Called by the - * String.prototype.replace method. - */ - readonly replace: symbol; - - /** - * A regular expression method that returns the index within a string that matches the - * regular expression. Called by the String.prototype.search method. - */ - readonly search: symbol; - - /** - * A function valued property that is the constructor function that is used to create - * derived objects. - */ - readonly species: symbol; - - /** - * A regular expression method that splits a string at the indices that match the regular - * expression. Called by the String.prototype.split method. - */ - readonly split: symbol; - - /** - * A method that converts an object to a corresponding primitive value. - * Called by the ToPrimitive abstract operation. - */ - readonly toPrimitive: symbol; - - /** - * A String value that is used in the creation of the default string description of an object. - * Called by the built-in method Object.prototype.toString. - */ - readonly toStringTag: symbol; - - /** - * An Object whose own property names are property names that are excluded from the 'with' - * environment bindings of the associated objects. - */ - readonly unscopables: symbol; -} - -interface Symbol { - readonly [Symbol.toStringTag]: "Symbol"; -} - -interface Array { - /** - * Returns an object whose properties have the value 'true' - * when they will be absent when used in a 'with' statement. - */ - [Symbol.unscopables](): { - copyWithin: boolean; - entries: boolean; - fill: boolean; - find: boolean; - findIndex: boolean; - keys: boolean; - values: boolean; - }; -} - -interface Date { - /** - * Converts a Date object to a string. - */ - [Symbol.toPrimitive](hint: "default"): string; - /** - * Converts a Date object to a string. - */ - [Symbol.toPrimitive](hint: "string"): string; - /** - * Converts a Date object to a number. - */ - [Symbol.toPrimitive](hint: "number"): number; - /** - * Converts a Date object to a string or number. - * - * @param hint The strings "number", "string", or "default" to specify what primitive to return. - * - * @throws {TypeError} If 'hint' was given something other than "number", "string", or "default". - * @returns A number if 'hint' was "number", a string if 'hint' was "string" or "default". - */ - [Symbol.toPrimitive](hint: string): string | number; -} - -interface Map { - readonly [Symbol.toStringTag]: "Map"; -} - -interface WeakMap{ - readonly [Symbol.toStringTag]: "WeakMap"; -} - -interface Set { - readonly [Symbol.toStringTag]: "Set"; -} - -interface WeakSet { - readonly [Symbol.toStringTag]: "WeakSet"; -} - -interface JSON { - readonly [Symbol.toStringTag]: "JSON"; -} - -interface Function { - /** - * Determines whether the given value inherits from this function if this function was used - * as a constructor function. - * - * A constructor function can control which objects are recognized as its instances by - * 'instanceof' by overriding this method. - */ - [Symbol.hasInstance](value: any): boolean; -} - -interface GeneratorFunction extends Function { - readonly [Symbol.toStringTag]: "GeneratorFunction"; -} - -interface Math { - readonly [Symbol.toStringTag]: "Math"; -} - -interface Promise { - readonly [Symbol.toStringTag]: "Promise"; -} - -interface PromiseConstructor { - readonly [Symbol.species]: Function; -} - -interface RegExp { - /** - * Matches a string with this regular expression, and returns an array containing the results of - * that search. - * @param string A string to search within. - */ - [Symbol.match](string: string): RegExpMatchArray | null; - - /** - * Replaces text in a string, using this regular expression. - * @param string A String object or string literal whose contents matching against - * this regular expression will be replaced - * @param replaceValue A String object or string literal containing the text to replace for every - * successful match of this regular expression. - */ - [Symbol.replace](string: string, replaceValue: string): string; - - /** - * Replaces text in a string, using this regular expression. - * @param string A String object or string literal whose contents matching against - * this regular expression will be replaced - * @param replacer A function that returns the replacement text. - */ - [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; - - /** - * Finds the position beginning first substring match in a regular expression search - * using this regular expression. - * - * @param string The string to search within. - */ - [Symbol.search](string: string): number; - - /** - * Returns an array of substrings that were delimited by strings in the original input that - * match against this regular expression. - * - * If the regular expression contains capturing parentheses, then each time this - * regular expression matches, the results (including any undefined results) of the - * capturing parentheses are spliced. - * - * @param string string value to split - * @param limit if not undefined, the output array is truncated so that it contains no more - * than 'limit' elements. - */ - [Symbol.split](string: string, limit?: number): string[]; -} - -interface RegExpConstructor { - [Symbol.species](): RegExpConstructor; -} - -interface String { - /** - * Matches a string an object that supports being matched against, and returns an array containing the results of that search. - * @param matcher An object that supports being matched against. - */ - match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null; - - /** - * Replaces text in a string, using an object that supports replacement within a string. - * @param searchValue A object can search for and replace matches within a string. - * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. - */ - replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string; - - /** - * Replaces text in a string, using an object that supports replacement within a string. - * @param searchValue A object can search for and replace matches within a string. - * @param replacer A function that returns the replacement text. - */ - replace(searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string; - - /** - * Finds the first substring match in a regular expression search. - * @param searcher An object which supports searching within a string. - */ - search(searcher: { [Symbol.search](string: string): number; }): number; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param splitter An object that can split a string. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number): string[]; -} - -/** - * Represents a raw buffer of binary data, which is used to store data for the - * different typed arrays. ArrayBuffers cannot be read from or written to directly, - * but can be passed to a typed array or DataView Object to interpret the raw - * buffer as needed. - */ -interface ArrayBuffer { - readonly [Symbol.toStringTag]: "ArrayBuffer"; -} - -interface DataView { - readonly [Symbol.toStringTag]: "DataView"; -} - -/** - * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Int8Array { - readonly [Symbol.toStringTag]: "Int8Array"; -} - -/** - * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8Array { - readonly [Symbol.toStringTag]: "UInt8Array"; -} - -/** - * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. - * If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8ClampedArray { - readonly [Symbol.toStringTag]: "Uint8ClampedArray"; -} - -/** - * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int16Array { - readonly [Symbol.toStringTag]: "Int16Array"; -} - -/** - * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint16Array { - readonly [Symbol.toStringTag]: "Uint16Array"; -} - -/** - * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int32Array { - readonly [Symbol.toStringTag]: "Int32Array"; -} - -/** - * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint32Array { - readonly [Symbol.toStringTag]: "Uint32Array"; -} - -/** - * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number - * of bytes could not be allocated an exception is raised. - */ -interface Float32Array { - readonly [Symbol.toStringTag]: "Float32Array"; -} - -/** - * A typed array of 64-bit float values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Float64Array { - readonly [Symbol.toStringTag]: "Float64Array"; +/// + +interface SymbolConstructor { + /** + * A method that determines if a constructor object recognizes an object as one of the + * constructor’s instances. Called by the semantics of the instanceof operator. + */ + readonly hasInstance: symbol; + + /** + * A Boolean value that if true indicates that an object should flatten to its array elements + * by Array.prototype.concat. + */ + readonly isConcatSpreadable: symbol; + + /** + * A regular expression method that matches the regular expression against a string. Called + * by the String.prototype.match method. + */ + readonly match: symbol; + + /** + * A regular expression method that replaces matched substrings of a string. Called by the + * String.prototype.replace method. + */ + readonly replace: symbol; + + /** + * A regular expression method that returns the index within a string that matches the + * regular expression. Called by the String.prototype.search method. + */ + readonly search: symbol; + + /** + * A function valued property that is the constructor function that is used to create + * derived objects. + */ + readonly species: symbol; + + /** + * A regular expression method that splits a string at the indices that match the regular + * expression. Called by the String.prototype.split method. + */ + readonly split: symbol; + + /** + * A method that converts an object to a corresponding primitive value. + * Called by the ToPrimitive abstract operation. + */ + readonly toPrimitive: symbol; + + /** + * A String value that is used in the creation of the default string description of an object. + * Called by the built-in method Object.prototype.toString. + */ + readonly toStringTag: symbol; + + /** + * An Object whose own property names are property names that are excluded from the 'with' + * environment bindings of the associated objects. + */ + readonly unscopables: symbol; } - -///////////////////////////// -/// IE DOM APIs -///////////////////////////// - -interface Algorithm { - name: string; -} - -interface AriaRequestEventInit extends EventInit { - attributeName?: string; - attributeValue?: string; -} - -interface CommandEventInit extends EventInit { - commandName?: string; - detail?: string; -} - -interface CompositionEventInit extends UIEventInit { - data?: string; -} - -interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation { - arrayOfDomainStrings?: string[]; -} - -interface ConstrainBooleanParameters { - exact?: boolean; - ideal?: boolean; -} - -interface ConstrainDOMStringParameters { - exact?: string | string[]; - ideal?: string | string[]; -} - -interface ConstrainDoubleRange extends DoubleRange { - exact?: number; - ideal?: number; -} - -interface ConstrainLongRange extends LongRange { - exact?: number; - ideal?: number; -} - -interface ConstrainVideoFacingModeParameters { - exact?: string | string[]; - ideal?: string | string[]; -} - -interface CustomEventInit extends EventInit { - detail?: any; -} - -interface DeviceAccelerationDict { - x?: number; - y?: number; - z?: number; -} - -interface DeviceLightEventInit extends EventInit { - value?: number; -} - -interface DeviceRotationRateDict { - alpha?: number; - beta?: number; - gamma?: number; -} - -interface DoubleRange { - max?: number; - min?: number; -} - -interface EventInit { - scoped?: boolean; - bubbles?: boolean; - cancelable?: boolean; -} - -interface EventModifierInit extends UIEventInit { - ctrlKey?: boolean; - shiftKey?: boolean; - altKey?: boolean; - metaKey?: boolean; - modifierAltGraph?: boolean; - modifierCapsLock?: boolean; - modifierFn?: boolean; - modifierFnLock?: boolean; - modifierHyper?: boolean; - modifierNumLock?: boolean; - modifierOS?: boolean; - modifierScrollLock?: boolean; - modifierSuper?: boolean; - modifierSymbol?: boolean; - modifierSymbolLock?: boolean; -} - -interface ExceptionInformation { - domain?: string; -} - -interface FocusEventInit extends UIEventInit { - relatedTarget?: EventTarget; -} - -interface HashChangeEventInit extends EventInit { - newURL?: string; - oldURL?: string; -} - -interface IDBIndexParameters { - multiEntry?: boolean; - unique?: boolean; -} - -interface IDBObjectStoreParameters { - autoIncrement?: boolean; - keyPath?: IDBKeyPath; -} - -interface KeyAlgorithm { - name?: string; -} - -interface KeyboardEventInit extends EventModifierInit { - code?: string; - key?: string; - location?: number; - repeat?: boolean; -} - -interface LongRange { - max?: number; - min?: number; -} - -interface MSAccountInfo { - rpDisplayName?: string; - userDisplayName?: string; - accountName?: string; - userId?: string; - accountImageUri?: string; -} - -interface MSAudioLocalClientEvent extends MSLocalClientEventBase { - networkSendQualityEventRatio?: number; - networkDelayEventRatio?: number; - cpuInsufficientEventRatio?: number; - deviceHalfDuplexAECEventRatio?: number; - deviceRenderNotFunctioningEventRatio?: number; - deviceCaptureNotFunctioningEventRatio?: number; - deviceGlitchesEventRatio?: number; - deviceLowSNREventRatio?: number; - deviceLowSpeechLevelEventRatio?: number; - deviceClippingEventRatio?: number; - deviceEchoEventRatio?: number; - deviceNearEndToEchoRatioEventRatio?: number; - deviceRenderZeroVolumeEventRatio?: number; - deviceRenderMuteEventRatio?: number; - deviceMultipleEndpointsEventCount?: number; - deviceHowlingEventCount?: number; -} - -interface MSAudioRecvPayload extends MSPayloadBase { - samplingRate?: number; - signal?: MSAudioRecvSignal; - packetReorderRatio?: number; - packetReorderDepthAvg?: number; - packetReorderDepthMax?: number; - burstLossLength1?: number; - burstLossLength2?: number; - burstLossLength3?: number; - burstLossLength4?: number; - burstLossLength5?: number; - burstLossLength6?: number; - burstLossLength7?: number; - burstLossLength8OrHigher?: number; - fecRecvDistance1?: number; - fecRecvDistance2?: number; - fecRecvDistance3?: number; - ratioConcealedSamplesAvg?: number; - ratioStretchedSamplesAvg?: number; - ratioCompressedSamplesAvg?: number; -} - -interface MSAudioRecvSignal { - initialSignalLevelRMS?: number; - recvSignalLevelCh1?: number; - recvNoiseLevelCh1?: number; - renderSignalLevel?: number; - renderNoiseLevel?: number; - renderLoopbackSignalLevel?: number; -} - -interface MSAudioSendPayload extends MSPayloadBase { - samplingRate?: number; - signal?: MSAudioSendSignal; - audioFECUsed?: boolean; - sendMutePercent?: number; -} - -interface MSAudioSendSignal { - noiseLevel?: number; - sendSignalLevelCh1?: number; - sendNoiseLevelCh1?: number; -} - -interface MSConnectivity { - iceType?: string; - iceWarningFlags?: MSIceWarningFlags; - relayAddress?: MSRelayAddress; -} - -interface MSCredentialFilter { - accept?: MSCredentialSpec[]; -} - -interface MSCredentialParameters { - type?: string; -} - -interface MSCredentialSpec { - type?: string; - id?: string; -} - -interface MSDelay { - roundTrip?: number; - roundTripMax?: number; -} - -interface MSDescription extends RTCStats { - connectivity?: MSConnectivity; - transport?: string; - networkconnectivity?: MSNetworkConnectivityInfo; - localAddr?: MSIPAddressInfo; - remoteAddr?: MSIPAddressInfo; - deviceDevName?: string; - reflexiveLocalIPAddr?: MSIPAddressInfo; -} - -interface MSFIDOCredentialParameters extends MSCredentialParameters { - algorithm?: string | Algorithm; - authenticators?: AAGUID[]; -} - -interface MSIPAddressInfo { - ipAddr?: string; - port?: number; - manufacturerMacAddrMask?: string; -} - -interface MSIceWarningFlags { - turnTcpTimedOut?: boolean; - turnUdpAllocateFailed?: boolean; - turnUdpSendFailed?: boolean; - turnTcpAllocateFailed?: boolean; - turnTcpSendFailed?: boolean; - udpLocalConnectivityFailed?: boolean; - udpNatConnectivityFailed?: boolean; - udpRelayConnectivityFailed?: boolean; - tcpNatConnectivityFailed?: boolean; - tcpRelayConnectivityFailed?: boolean; - connCheckMessageIntegrityFailed?: boolean; - allocationMessageIntegrityFailed?: boolean; - connCheckOtherError?: boolean; - turnAuthUnknownUsernameError?: boolean; - noRelayServersConfigured?: boolean; - multipleRelayServersAttempted?: boolean; - portRangeExhausted?: boolean; - alternateServerReceived?: boolean; - pseudoTLSFailure?: boolean; - turnTurnTcpConnectivityFailed?: boolean; - useCandidateChecksFailed?: boolean; - fipsAllocationFailure?: boolean; -} - -interface MSJitter { - interArrival?: number; - interArrivalMax?: number; - interArrivalSD?: number; -} - -interface MSLocalClientEventBase extends RTCStats { - networkReceiveQualityEventRatio?: number; - networkBandwidthLowEventRatio?: number; -} - -interface MSNetwork extends RTCStats { - jitter?: MSJitter; - delay?: MSDelay; - packetLoss?: MSPacketLoss; - utilization?: MSUtilization; -} - -interface MSNetworkConnectivityInfo { - vpn?: boolean; - linkspeed?: number; - networkConnectionDetails?: string; -} - -interface MSNetworkInterfaceType { - interfaceTypeEthernet?: boolean; - interfaceTypeWireless?: boolean; - interfaceTypePPP?: boolean; - interfaceTypeTunnel?: boolean; - interfaceTypeWWAN?: boolean; -} - -interface MSOutboundNetwork extends MSNetwork { - appliedBandwidthLimit?: number; -} - -interface MSPacketLoss { - lossRate?: number; - lossRateMax?: number; -} - -interface MSPayloadBase extends RTCStats { - payloadDescription?: string; -} - -interface MSRelayAddress { - relayAddress?: string; - port?: number; -} - -interface MSSignatureParameters { - userPrompt?: string; -} - -interface MSTransportDiagnosticsStats extends RTCStats { - baseAddress?: string; - localAddress?: string; - localSite?: string; - networkName?: string; - remoteAddress?: string; - remoteSite?: string; - localMR?: string; - remoteMR?: string; - iceWarningFlags?: MSIceWarningFlags; - portRangeMin?: number; - portRangeMax?: number; - localMRTCPPort?: number; - remoteMRTCPPort?: number; - stunVer?: number; - numConsentReqSent?: number; - numConsentReqReceived?: number; - numConsentRespSent?: number; - numConsentRespReceived?: number; - interfaces?: MSNetworkInterfaceType; - baseInterface?: MSNetworkInterfaceType; - protocol?: string; - localInterface?: MSNetworkInterfaceType; - localAddrType?: string; - remoteAddrType?: string; - iceRole?: string; - rtpRtcpMux?: boolean; - allocationTimeInMs?: number; - msRtcEngineVersion?: string; -} - -interface MSUtilization { - packets?: number; - bandwidthEstimation?: number; - bandwidthEstimationMin?: number; - bandwidthEstimationMax?: number; - bandwidthEstimationStdDev?: number; - bandwidthEstimationAvg?: number; -} - -interface MSVideoPayload extends MSPayloadBase { - resoluton?: string; - videoBitRateAvg?: number; - videoBitRateMax?: number; - videoFrameRateAvg?: number; - videoPacketLossRate?: number; - durationSeconds?: number; -} - -interface MSVideoRecvPayload extends MSVideoPayload { - videoFrameLossRate?: number; - recvCodecType?: string; - recvResolutionWidth?: number; - recvResolutionHeight?: number; - videoResolutions?: MSVideoResolutionDistribution; - recvFrameRateAverage?: number; - recvBitRateMaximum?: number; - recvBitRateAverage?: number; - recvVideoStreamsMax?: number; - recvVideoStreamsMin?: number; - recvVideoStreamsMode?: number; - videoPostFECPLR?: number; - lowBitRateCallPercent?: number; - lowFrameRateCallPercent?: number; - reorderBufferTotalPackets?: number; - recvReorderBufferReorderedPackets?: number; - recvReorderBufferPacketsDroppedDueToBufferExhaustion?: number; - recvReorderBufferMaxSuccessfullyOrderedExtent?: number; - recvReorderBufferMaxSuccessfullyOrderedLateTime?: number; - recvReorderBufferPacketsDroppedDueToTimeout?: number; - recvFpsHarmonicAverage?: number; - recvNumResSwitches?: number; -} - -interface MSVideoResolutionDistribution { - cifQuality?: number; - vgaQuality?: number; - h720Quality?: number; - h1080Quality?: number; - h1440Quality?: number; - h2160Quality?: number; -} - -interface MSVideoSendPayload extends MSVideoPayload { - sendFrameRateAverage?: number; - sendBitRateMaximum?: number; - sendBitRateAverage?: number; - sendVideoStreamsMax?: number; - sendResolutionWidth?: number; - sendResolutionHeight?: number; -} - -interface MediaEncryptedEventInit extends EventInit { - initDataType?: string; - initData?: ArrayBuffer; -} - -interface MediaKeyMessageEventInit extends EventInit { - messageType?: string; - message?: ArrayBuffer; -} - -interface MediaKeySystemConfiguration { - initDataTypes?: string[]; - audioCapabilities?: MediaKeySystemMediaCapability[]; - videoCapabilities?: MediaKeySystemMediaCapability[]; - distinctiveIdentifier?: string; - persistentState?: string; -} - -interface MediaKeySystemMediaCapability { - contentType?: string; - robustness?: string; -} - -interface MediaStreamConstraints { - video?: boolean | MediaTrackConstraints; - audio?: boolean | MediaTrackConstraints; -} - -interface MediaStreamErrorEventInit extends EventInit { - error?: MediaStreamError; -} - -interface MediaStreamTrackEventInit extends EventInit { - track?: MediaStreamTrack; -} - -interface MediaTrackCapabilities { - width?: number | LongRange; - height?: number | LongRange; - aspectRatio?: number | DoubleRange; - frameRate?: number | DoubleRange; - facingMode?: string; - volume?: number | DoubleRange; - sampleRate?: number | LongRange; - sampleSize?: number | LongRange; - echoCancellation?: boolean[]; - deviceId?: string; - groupId?: string; -} - -interface MediaTrackConstraintSet { - width?: number | ConstrainLongRange; - height?: number | ConstrainLongRange; - aspectRatio?: number | ConstrainDoubleRange; - frameRate?: number | ConstrainDoubleRange; - facingMode?: string | string[] | ConstrainDOMStringParameters; - volume?: number | ConstrainDoubleRange; - sampleRate?: number | ConstrainLongRange; - sampleSize?: number | ConstrainLongRange; - echoCancelation?: boolean | ConstrainBooleanParameters; - deviceId?: string | string[] | ConstrainDOMStringParameters; - groupId?: string | string[] | ConstrainDOMStringParameters; -} - -interface MediaTrackConstraints extends MediaTrackConstraintSet { - advanced?: MediaTrackConstraintSet[]; -} - -interface MediaTrackSettings { - width?: number; - height?: number; - aspectRatio?: number; - frameRate?: number; - facingMode?: string; - volume?: number; - sampleRate?: number; - sampleSize?: number; - echoCancellation?: boolean; - deviceId?: string; - groupId?: string; -} - -interface MediaTrackSupportedConstraints { - width?: boolean; - height?: boolean; - aspectRatio?: boolean; - frameRate?: boolean; - facingMode?: boolean; - volume?: boolean; - sampleRate?: boolean; - sampleSize?: boolean; - echoCancellation?: boolean; - deviceId?: boolean; - groupId?: boolean; -} - -interface MouseEventInit extends EventModifierInit { - screenX?: number; - screenY?: number; - clientX?: number; - clientY?: number; - button?: number; - buttons?: number; - relatedTarget?: EventTarget; -} - -interface MsZoomToOptions { - contentX?: number; - contentY?: number; - viewportX?: string; - viewportY?: string; - scaleFactor?: number; - animate?: string; -} - -interface MutationObserverInit { - childList?: boolean; - attributes?: boolean; - characterData?: boolean; - subtree?: boolean; - attributeOldValue?: boolean; - characterDataOldValue?: boolean; - attributeFilter?: string[]; -} - -interface ObjectURLOptions { - oneTimeOnly?: boolean; -} - -interface PeriodicWaveConstraints { - disableNormalization?: boolean; -} - -interface PointerEventInit extends MouseEventInit { - pointerId?: number; - width?: number; - height?: number; - pressure?: number; - tiltX?: number; - tiltY?: number; - pointerType?: string; - isPrimary?: boolean; -} - -interface PositionOptions { - enableHighAccuracy?: boolean; - timeout?: number; - maximumAge?: number; -} - -interface RTCDTMFToneChangeEventInit extends EventInit { - tone?: string; -} - -interface RTCDtlsFingerprint { - algorithm?: string; - value?: string; -} - -interface RTCDtlsParameters { - role?: string; - fingerprints?: RTCDtlsFingerprint[]; -} - -interface RTCIceCandidate { - foundation?: string; - priority?: number; - ip?: string; - protocol?: string; - port?: number; - type?: string; - tcpType?: string; - relatedAddress?: string; - relatedPort?: number; -} - -interface RTCIceCandidateAttributes extends RTCStats { - ipAddress?: string; - portNumber?: number; - transport?: string; - candidateType?: string; - priority?: number; - addressSourceUrl?: string; -} - -interface RTCIceCandidateComplete { -} - -interface RTCIceCandidatePair { - local?: RTCIceCandidate; - remote?: RTCIceCandidate; -} - -interface RTCIceCandidatePairStats extends RTCStats { - transportId?: string; - localCandidateId?: string; - remoteCandidateId?: string; - state?: string; - priority?: number; - nominated?: boolean; - writable?: boolean; - readable?: boolean; - bytesSent?: number; - bytesReceived?: number; - roundTripTime?: number; - availableOutgoingBitrate?: number; - availableIncomingBitrate?: number; -} - -interface RTCIceGatherOptions { - gatherPolicy?: string; - iceservers?: RTCIceServer[]; -} - -interface RTCIceParameters { - usernameFragment?: string; - password?: string; -} - -interface RTCIceServer { - urls?: any; - username?: string; - credential?: string; -} - -interface RTCInboundRTPStreamStats extends RTCRTPStreamStats { - packetsReceived?: number; - bytesReceived?: number; - packetsLost?: number; - jitter?: number; - fractionLost?: number; -} - -interface RTCMediaStreamTrackStats extends RTCStats { - trackIdentifier?: string; - remoteSource?: boolean; - ssrcIds?: string[]; - frameWidth?: number; - frameHeight?: number; - framesPerSecond?: number; - framesSent?: number; - framesReceived?: number; - framesDecoded?: number; - framesDropped?: number; - framesCorrupted?: number; - audioLevel?: number; - echoReturnLoss?: number; - echoReturnLossEnhancement?: number; -} - -interface RTCOutboundRTPStreamStats extends RTCRTPStreamStats { - packetsSent?: number; - bytesSent?: number; - targetBitrate?: number; - roundTripTime?: number; -} - -interface RTCRTPStreamStats extends RTCStats { - ssrc?: string; - associateStatsId?: string; - isRemote?: boolean; - mediaTrackId?: string; - transportId?: string; - codecId?: string; - firCount?: number; - pliCount?: number; - nackCount?: number; - sliCount?: number; -} - -interface RTCRtcpFeedback { - type?: string; - parameter?: string; -} - -interface RTCRtcpParameters { - ssrc?: number; - cname?: string; - reducedSize?: boolean; - mux?: boolean; -} - -interface RTCRtpCapabilities { - codecs?: RTCRtpCodecCapability[]; - headerExtensions?: RTCRtpHeaderExtension[]; - fecMechanisms?: string[]; -} - -interface RTCRtpCodecCapability { - name?: string; - kind?: string; - clockRate?: number; - preferredPayloadType?: number; - maxptime?: number; - numChannels?: number; - rtcpFeedback?: RTCRtcpFeedback[]; - parameters?: any; - options?: any; - maxTemporalLayers?: number; - maxSpatialLayers?: number; - svcMultiStreamSupport?: boolean; -} - -interface RTCRtpCodecParameters { - name?: string; - payloadType?: any; - clockRate?: number; - maxptime?: number; - numChannels?: number; - rtcpFeedback?: RTCRtcpFeedback[]; - parameters?: any; -} - -interface RTCRtpContributingSource { - timestamp?: number; - csrc?: number; - audioLevel?: number; -} - -interface RTCRtpEncodingParameters { - ssrc?: number; - codecPayloadType?: number; - fec?: RTCRtpFecParameters; - rtx?: RTCRtpRtxParameters; - priority?: number; - maxBitrate?: number; - minQuality?: number; - framerateBias?: number; - resolutionScale?: number; - framerateScale?: number; - active?: boolean; - encodingId?: string; - dependencyEncodingIds?: string[]; - ssrcRange?: RTCSsrcRange; -} - -interface RTCRtpFecParameters { - ssrc?: number; - mechanism?: string; -} - -interface RTCRtpHeaderExtension { - kind?: string; - uri?: string; - preferredId?: number; - preferredEncrypt?: boolean; -} - -interface RTCRtpHeaderExtensionParameters { - uri?: string; - id?: number; - encrypt?: boolean; -} - -interface RTCRtpParameters { - muxId?: string; - codecs?: RTCRtpCodecParameters[]; - headerExtensions?: RTCRtpHeaderExtensionParameters[]; - encodings?: RTCRtpEncodingParameters[]; - rtcp?: RTCRtcpParameters; -} - -interface RTCRtpRtxParameters { - ssrc?: number; -} - -interface RTCRtpUnhandled { - ssrc?: number; - payloadType?: number; - muxId?: string; -} - -interface RTCSrtpKeyParam { - keyMethod?: string; - keySalt?: string; - lifetime?: string; - mkiValue?: number; - mkiLength?: number; -} - -interface RTCSrtpSdesParameters { - tag?: number; - cryptoSuite?: string; - keyParams?: RTCSrtpKeyParam[]; - sessionParams?: string[]; -} - -interface RTCSsrcRange { - min?: number; - max?: number; -} - -interface RTCStats { - timestamp?: number; - type?: string; - id?: string; - msType?: string; -} - -interface RTCStatsReport { -} - -interface RTCTransportStats extends RTCStats { - bytesSent?: number; - bytesReceived?: number; - rtcpTransportStatsId?: string; - activeConnection?: boolean; - selectedCandidatePairId?: string; - localCertificateId?: string; - remoteCertificateId?: string; -} - -interface StoreExceptionsInformation extends ExceptionInformation { - siteName?: string; - explanationString?: string; - detailURI?: string; -} - -interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { - arrayOfDomainStrings?: string[]; -} - -interface UIEventInit extends EventInit { - view?: Window; - detail?: number; -} - -interface WebGLContextAttributes { - failIfMajorPerformanceCaveat?: boolean; - alpha?: boolean; - depth?: boolean; - stencil?: boolean; - antialias?: boolean; - premultipliedAlpha?: boolean; - preserveDrawingBuffer?: boolean; -} - -interface WebGLContextEventInit extends EventInit { - statusMessage?: string; -} - -interface WheelEventInit extends MouseEventInit { - deltaX?: number; - deltaY?: number; - deltaZ?: number; - deltaMode?: number; -} - -interface EventListener { - (evt: Event): void; -} - -interface ANGLE_instanced_arrays { - drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void; - drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void; - vertexAttribDivisorANGLE(index: number, divisor: number): void; - readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; -} - -declare var ANGLE_instanced_arrays: { - prototype: ANGLE_instanced_arrays; - new(): ANGLE_instanced_arrays; - readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; -} - -interface AnalyserNode extends AudioNode { - fftSize: number; - readonly frequencyBinCount: number; - maxDecibels: number; - minDecibels: number; - smoothingTimeConstant: number; - getByteFrequencyData(array: Uint8Array): void; - getByteTimeDomainData(array: Uint8Array): void; - getFloatFrequencyData(array: Float32Array): void; - getFloatTimeDomainData(array: Float32Array): void; -} - -declare var AnalyserNode: { - prototype: AnalyserNode; - new(): AnalyserNode; -} - -interface AnimationEvent extends Event { - readonly animationName: string; - readonly elapsedTime: number; - initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; -} - -declare var AnimationEvent: { - prototype: AnimationEvent; - new(): AnimationEvent; -} - -interface ApplicationCacheEventMap { - "cached": Event; - "checking": Event; - "downloading": Event; - "error": ErrorEvent; - "noupdate": Event; - "obsolete": Event; - "progress": ProgressEvent; - "updateready": Event; -} - -interface ApplicationCache extends EventTarget { - oncached: (this: ApplicationCache, ev: Event) => any; - onchecking: (this: ApplicationCache, ev: Event) => any; - ondownloading: (this: ApplicationCache, ev: Event) => any; - onerror: (this: ApplicationCache, ev: ErrorEvent) => any; - onnoupdate: (this: ApplicationCache, ev: Event) => any; - onobsolete: (this: ApplicationCache, ev: Event) => any; - onprogress: (this: ApplicationCache, ev: ProgressEvent) => any; - onupdateready: (this: ApplicationCache, ev: Event) => any; - readonly status: number; - abort(): void; - swapCache(): void; - update(): void; - readonly CHECKING: number; - readonly DOWNLOADING: number; - readonly IDLE: number; - readonly OBSOLETE: number; - readonly UNCACHED: number; - readonly UPDATEREADY: number; - addEventListener(type: K, listener: (this: ApplicationCache, ev: ApplicationCacheEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var ApplicationCache: { - prototype: ApplicationCache; - new(): ApplicationCache; - readonly CHECKING: number; - readonly DOWNLOADING: number; - readonly IDLE: number; - readonly OBSOLETE: number; - readonly UNCACHED: number; - readonly UPDATEREADY: number; -} - -interface AriaRequestEvent extends Event { - readonly attributeName: string; - attributeValue: string | null; -} - -declare var AriaRequestEvent: { - prototype: AriaRequestEvent; - new(type: string, eventInitDict?: AriaRequestEventInit): AriaRequestEvent; -} - -interface Attr extends Node { - readonly name: string; - readonly ownerElement: Element; - readonly prefix: string | null; - readonly specified: boolean; - value: string; -} - -declare var Attr: { - prototype: Attr; - new(): Attr; -} - -interface AudioBuffer { - readonly duration: number; - readonly length: number; - readonly numberOfChannels: number; - readonly sampleRate: number; - copyFromChannel(destination: Float32Array, channelNumber: number, startInChannel?: number): void; - copyToChannel(source: Float32Array, channelNumber: number, startInChannel?: number): void; - getChannelData(channel: number): Float32Array; -} - -declare var AudioBuffer: { - prototype: AudioBuffer; - new(): AudioBuffer; -} - -interface AudioBufferSourceNodeEventMap { - "ended": MediaStreamErrorEvent; -} - -interface AudioBufferSourceNode extends AudioNode { - buffer: AudioBuffer | null; - readonly detune: AudioParam; - loop: boolean; - loopEnd: number; - loopStart: number; - onended: (this: AudioBufferSourceNode, ev: MediaStreamErrorEvent) => any; - readonly playbackRate: AudioParam; - start(when?: number, offset?: number, duration?: number): void; - stop(when?: number): void; - addEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioBufferSourceNodeEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var AudioBufferSourceNode: { - prototype: AudioBufferSourceNode; - new(): AudioBufferSourceNode; -} - -interface AudioContext extends EventTarget { - readonly currentTime: number; - readonly destination: AudioDestinationNode; - readonly listener: AudioListener; - readonly sampleRate: number; - state: string; - createAnalyser(): AnalyserNode; - createBiquadFilter(): BiquadFilterNode; - createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; - createBufferSource(): AudioBufferSourceNode; - createChannelMerger(numberOfInputs?: number): ChannelMergerNode; - createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode; - createConvolver(): ConvolverNode; - createDelay(maxDelayTime?: number): DelayNode; - createDynamicsCompressor(): DynamicsCompressorNode; - createGain(): GainNode; - createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode; - createMediaStreamSource(mediaStream: MediaStream): MediaStreamAudioSourceNode; - createOscillator(): OscillatorNode; - createPanner(): PannerNode; - createPeriodicWave(real: Float32Array, imag: Float32Array, constraints?: PeriodicWaveConstraints): PeriodicWave; - createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode; - createStereoPanner(): StereoPannerNode; - createWaveShaper(): WaveShaperNode; - decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): PromiseLike; -} - -declare var AudioContext: { - prototype: AudioContext; - new(): AudioContext; -} - -interface AudioDestinationNode extends AudioNode { - readonly maxChannelCount: number; -} - -declare var AudioDestinationNode: { - prototype: AudioDestinationNode; - new(): AudioDestinationNode; -} - -interface AudioListener { - dopplerFactor: number; - speedOfSound: number; - setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void; - setPosition(x: number, y: number, z: number): void; - setVelocity(x: number, y: number, z: number): void; -} - -declare var AudioListener: { - prototype: AudioListener; - new(): AudioListener; -} - -interface AudioNode extends EventTarget { - channelCount: number; - channelCountMode: string; - channelInterpretation: string; - readonly context: AudioContext; - readonly numberOfInputs: number; - readonly numberOfOutputs: number; - connect(destination: AudioNode, output?: number, input?: number): void; - disconnect(output?: number): void; - disconnect(destination: AudioNode, output?: number, input?: number): void; - disconnect(destination: AudioParam, output?: number): void; -} - -declare var AudioNode: { - prototype: AudioNode; - new(): AudioNode; -} - -interface AudioParam { - readonly defaultValue: number; - value: number; - cancelScheduledValues(startTime: number): void; - exponentialRampToValueAtTime(value: number, endTime: number): void; - linearRampToValueAtTime(value: number, endTime: number): void; - setTargetAtTime(target: number, startTime: number, timeConstant: number): void; - setValueAtTime(value: number, startTime: number): void; - setValueCurveAtTime(values: Float32Array, startTime: number, duration: number): void; -} - -declare var AudioParam: { - prototype: AudioParam; - new(): AudioParam; -} - -interface AudioProcessingEvent extends Event { - readonly inputBuffer: AudioBuffer; - readonly outputBuffer: AudioBuffer; - readonly playbackTime: number; -} - -declare var AudioProcessingEvent: { - prototype: AudioProcessingEvent; - new(): AudioProcessingEvent; -} - -interface AudioTrack { - enabled: boolean; - readonly id: string; - kind: string; - readonly label: string; - language: string; - readonly sourceBuffer: SourceBuffer; -} - -declare var AudioTrack: { - prototype: AudioTrack; - new(): AudioTrack; -} - -interface AudioTrackListEventMap { - "addtrack": TrackEvent; - "change": Event; - "removetrack": TrackEvent; -} - -interface AudioTrackList extends EventTarget { - readonly length: number; - onaddtrack: (this: AudioTrackList, ev: TrackEvent) => any; - onchange: (this: AudioTrackList, ev: Event) => any; - onremovetrack: (this: AudioTrackList, ev: TrackEvent) => any; - getTrackById(id: string): AudioTrack | null; - item(index: number): AudioTrack; - addEventListener(type: K, listener: (this: AudioTrackList, ev: AudioTrackListEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [index: number]: AudioTrack; -} - -declare var AudioTrackList: { - prototype: AudioTrackList; - new(): AudioTrackList; -} - -interface BarProp { - readonly visible: boolean; -} - -declare var BarProp: { - prototype: BarProp; - new(): BarProp; -} - -interface BeforeUnloadEvent extends Event { - returnValue: any; -} - -declare var BeforeUnloadEvent: { - prototype: BeforeUnloadEvent; - new(): BeforeUnloadEvent; -} - -interface BiquadFilterNode extends AudioNode { - readonly Q: AudioParam; - readonly detune: AudioParam; - readonly frequency: AudioParam; - readonly gain: AudioParam; - type: string; - getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void; -} - -declare var BiquadFilterNode: { - prototype: BiquadFilterNode; - new(): BiquadFilterNode; -} - -interface Blob { - readonly size: number; - readonly type: string; - msClose(): void; - msDetachStream(): any; - slice(start?: number, end?: number, contentType?: string): Blob; -} - -declare var Blob: { - prototype: Blob; - new (blobParts?: any[], options?: BlobPropertyBag): Blob; -} - -interface CDATASection extends Text { -} - -declare var CDATASection: { - prototype: CDATASection; - new(): CDATASection; -} - -interface CSS { - supports(property: string, value?: string): boolean; -} -declare var CSS: CSS; - -interface CSSConditionRule extends CSSGroupingRule { - conditionText: string; -} - -declare var CSSConditionRule: { - prototype: CSSConditionRule; - new(): CSSConditionRule; -} - -interface CSSFontFaceRule extends CSSRule { - readonly style: CSSStyleDeclaration; -} - -declare var CSSFontFaceRule: { - prototype: CSSFontFaceRule; - new(): CSSFontFaceRule; -} - -interface CSSGroupingRule extends CSSRule { - readonly cssRules: CSSRuleList; - deleteRule(index: number): void; - insertRule(rule: string, index: number): number; -} - -declare var CSSGroupingRule: { - prototype: CSSGroupingRule; - new(): CSSGroupingRule; -} - -interface CSSImportRule extends CSSRule { - readonly href: string; - readonly media: MediaList; - readonly styleSheet: CSSStyleSheet; -} - -declare var CSSImportRule: { - prototype: CSSImportRule; - new(): CSSImportRule; -} - -interface CSSKeyframeRule extends CSSRule { - keyText: string; - readonly style: CSSStyleDeclaration; -} - -declare var CSSKeyframeRule: { - prototype: CSSKeyframeRule; - new(): CSSKeyframeRule; -} - -interface CSSKeyframesRule extends CSSRule { - readonly cssRules: CSSRuleList; - name: string; - appendRule(rule: string): void; - deleteRule(rule: string): void; - findRule(rule: string): CSSKeyframeRule; -} - -declare var CSSKeyframesRule: { - prototype: CSSKeyframesRule; - new(): CSSKeyframesRule; -} - -interface CSSMediaRule extends CSSConditionRule { - readonly media: MediaList; -} - -declare var CSSMediaRule: { - prototype: CSSMediaRule; - new(): CSSMediaRule; -} - -interface CSSNamespaceRule extends CSSRule { - readonly namespaceURI: string; - readonly prefix: string; -} - -declare var CSSNamespaceRule: { - prototype: CSSNamespaceRule; - new(): CSSNamespaceRule; -} - -interface CSSPageRule extends CSSRule { - readonly pseudoClass: string; - readonly selector: string; - selectorText: string; - readonly style: CSSStyleDeclaration; -} - -declare var CSSPageRule: { - prototype: CSSPageRule; - new(): CSSPageRule; -} - -interface CSSRule { - cssText: string; - readonly parentRule: CSSRule; - readonly parentStyleSheet: CSSStyleSheet; - readonly type: number; - readonly CHARSET_RULE: number; - readonly FONT_FACE_RULE: number; - readonly IMPORT_RULE: number; - readonly KEYFRAMES_RULE: number; - readonly KEYFRAME_RULE: number; - readonly MEDIA_RULE: number; - readonly NAMESPACE_RULE: number; - readonly PAGE_RULE: number; - readonly STYLE_RULE: number; - readonly SUPPORTS_RULE: number; - readonly UNKNOWN_RULE: number; - readonly VIEWPORT_RULE: number; -} - -declare var CSSRule: { - prototype: CSSRule; - new(): CSSRule; - readonly CHARSET_RULE: number; - readonly FONT_FACE_RULE: number; - readonly IMPORT_RULE: number; - readonly KEYFRAMES_RULE: number; - readonly KEYFRAME_RULE: number; - readonly MEDIA_RULE: number; - readonly NAMESPACE_RULE: number; - readonly PAGE_RULE: number; - readonly STYLE_RULE: number; - readonly SUPPORTS_RULE: number; - readonly UNKNOWN_RULE: number; - readonly VIEWPORT_RULE: number; -} - -interface CSSRuleList { - readonly length: number; - item(index: number): CSSRule; - [index: number]: CSSRule; -} - -declare var CSSRuleList: { - prototype: CSSRuleList; - new(): CSSRuleList; -} - -interface CSSStyleDeclaration { - alignContent: string | null; - alignItems: string | null; - alignSelf: string | null; - alignmentBaseline: string | null; - animation: string | null; - animationDelay: string | null; - animationDirection: string | null; - animationDuration: string | null; - animationFillMode: string | null; - animationIterationCount: string | null; - animationName: string | null; - animationPlayState: string | null; - animationTimingFunction: string | null; - backfaceVisibility: string | null; - background: string | null; - backgroundAttachment: string | null; - backgroundClip: string | null; - backgroundColor: string | null; - backgroundImage: string | null; - backgroundOrigin: string | null; - backgroundPosition: string | null; - backgroundPositionX: string | null; - backgroundPositionY: string | null; - backgroundRepeat: string | null; - backgroundSize: string | null; - baselineShift: string | null; - border: string | null; - borderBottom: string | null; - borderBottomColor: string | null; - borderBottomLeftRadius: string | null; - borderBottomRightRadius: string | null; - borderBottomStyle: string | null; - borderBottomWidth: string | null; - borderCollapse: string | null; - borderColor: string | null; - borderImage: string | null; - borderImageOutset: string | null; - borderImageRepeat: string | null; - borderImageSlice: string | null; - borderImageSource: string | null; - borderImageWidth: string | null; - borderLeft: string | null; - borderLeftColor: string | null; - borderLeftStyle: string | null; - borderLeftWidth: string | null; - borderRadius: string | null; - borderRight: string | null; - borderRightColor: string | null; - borderRightStyle: string | null; - borderRightWidth: string | null; - borderSpacing: string | null; - borderStyle: string | null; - borderTop: string | null; - borderTopColor: string | null; - borderTopLeftRadius: string | null; - borderTopRightRadius: string | null; - borderTopStyle: string | null; - borderTopWidth: string | null; - borderWidth: string | null; - bottom: string | null; - boxShadow: string | null; - boxSizing: string | null; - breakAfter: string | null; - breakBefore: string | null; - breakInside: string | null; - captionSide: string | null; - clear: string | null; - clip: string | null; - clipPath: string | null; - clipRule: string | null; - color: string | null; - colorInterpolationFilters: string | null; - columnCount: any; - columnFill: string | null; - columnGap: any; - columnRule: string | null; - columnRuleColor: any; - columnRuleStyle: string | null; - columnRuleWidth: any; - columnSpan: string | null; - columnWidth: any; - columns: string | null; - content: string | null; - counterIncrement: string | null; - counterReset: string | null; - cssFloat: string | null; - cssText: string; - cursor: string | null; - direction: string | null; - display: string | null; - dominantBaseline: string | null; - emptyCells: string | null; - enableBackground: string | null; - fill: string | null; - fillOpacity: string | null; - fillRule: string | null; - filter: string | null; - flex: string | null; - flexBasis: string | null; - flexDirection: string | null; - flexFlow: string | null; - flexGrow: string | null; - flexShrink: string | null; - flexWrap: string | null; - floodColor: string | null; - floodOpacity: string | null; - font: string | null; - fontFamily: string | null; - fontFeatureSettings: string | null; - fontSize: string | null; - fontSizeAdjust: string | null; - fontStretch: string | null; - fontStyle: string | null; - fontVariant: string | null; - fontWeight: string | null; - glyphOrientationHorizontal: string | null; - glyphOrientationVertical: string | null; - height: string | null; - imeMode: string | null; - justifyContent: string | null; - kerning: string | null; - left: string | null; - readonly length: number; - letterSpacing: string | null; - lightingColor: string | null; - lineHeight: string | null; - listStyle: string | null; - listStyleImage: string | null; - listStylePosition: string | null; - listStyleType: string | null; - margin: string | null; - marginBottom: string | null; - marginLeft: string | null; - marginRight: string | null; - marginTop: string | null; - marker: string | null; - markerEnd: string | null; - markerMid: string | null; - markerStart: string | null; - mask: string | null; - maxHeight: string | null; - maxWidth: string | null; - minHeight: string | null; - minWidth: string | null; - msContentZoomChaining: string | null; - msContentZoomLimit: string | null; - msContentZoomLimitMax: any; - msContentZoomLimitMin: any; - msContentZoomSnap: string | null; - msContentZoomSnapPoints: string | null; - msContentZoomSnapType: string | null; - msContentZooming: string | null; - msFlowFrom: string | null; - msFlowInto: string | null; - msFontFeatureSettings: string | null; - msGridColumn: any; - msGridColumnAlign: string | null; - msGridColumnSpan: any; - msGridColumns: string | null; - msGridRow: any; - msGridRowAlign: string | null; - msGridRowSpan: any; - msGridRows: string | null; - msHighContrastAdjust: string | null; - msHyphenateLimitChars: string | null; - msHyphenateLimitLines: any; - msHyphenateLimitZone: any; - msHyphens: string | null; - msImeAlign: string | null; - msOverflowStyle: string | null; - msScrollChaining: string | null; - msScrollLimit: string | null; - msScrollLimitXMax: any; - msScrollLimitXMin: any; - msScrollLimitYMax: any; - msScrollLimitYMin: any; - msScrollRails: string | null; - msScrollSnapPointsX: string | null; - msScrollSnapPointsY: string | null; - msScrollSnapType: string | null; - msScrollSnapX: string | null; - msScrollSnapY: string | null; - msScrollTranslation: string | null; - msTextCombineHorizontal: string | null; - msTextSizeAdjust: any; - msTouchAction: string | null; - msTouchSelect: string | null; - msUserSelect: string | null; - msWrapFlow: string; - msWrapMargin: any; - msWrapThrough: string; - opacity: string | null; - order: string | null; - orphans: string | null; - outline: string | null; - outlineColor: string | null; - outlineStyle: string | null; - outlineWidth: string | null; - overflow: string | null; - overflowX: string | null; - overflowY: string | null; - padding: string | null; - paddingBottom: string | null; - paddingLeft: string | null; - paddingRight: string | null; - paddingTop: string | null; - pageBreakAfter: string | null; - pageBreakBefore: string | null; - pageBreakInside: string | null; - readonly parentRule: CSSRule; - perspective: string | null; - perspectiveOrigin: string | null; - pointerEvents: string | null; - position: string | null; - quotes: string | null; - right: string | null; - rubyAlign: string | null; - rubyOverhang: string | null; - rubyPosition: string | null; - stopColor: string | null; - stopOpacity: string | null; - stroke: string | null; - strokeDasharray: string | null; - strokeDashoffset: string | null; - strokeLinecap: string | null; - strokeLinejoin: string | null; - strokeMiterlimit: string | null; - strokeOpacity: string | null; - strokeWidth: string | null; - tableLayout: string | null; - textAlign: string | null; - textAlignLast: string | null; - textAnchor: string | null; - textDecoration: string | null; - textIndent: string | null; - textJustify: string | null; - textKashida: string | null; - textKashidaSpace: string | null; - textOverflow: string | null; - textShadow: string | null; - textTransform: string | null; - textUnderlinePosition: string | null; - top: string | null; - touchAction: string | null; - transform: string | null; - transformOrigin: string | null; - transformStyle: string | null; - transition: string | null; - transitionDelay: string | null; - transitionDuration: string | null; - transitionProperty: string | null; - transitionTimingFunction: string | null; - unicodeBidi: string | null; - verticalAlign: string | null; - visibility: string | null; - webkitAlignContent: string | null; - webkitAlignItems: string | null; - webkitAlignSelf: string | null; - webkitAnimation: string | null; - webkitAnimationDelay: string | null; - webkitAnimationDirection: string | null; - webkitAnimationDuration: string | null; - webkitAnimationFillMode: string | null; - webkitAnimationIterationCount: string | null; - webkitAnimationName: string | null; - webkitAnimationPlayState: string | null; - webkitAnimationTimingFunction: string | null; - webkitAppearance: string | null; - webkitBackfaceVisibility: string | null; - webkitBackgroundClip: string | null; - webkitBackgroundOrigin: string | null; - webkitBackgroundSize: string | null; - webkitBorderBottomLeftRadius: string | null; - webkitBorderBottomRightRadius: string | null; - webkitBorderImage: string | null; - webkitBorderRadius: string | null; - webkitBorderTopLeftRadius: string | null; - webkitBorderTopRightRadius: string | null; - webkitBoxAlign: string | null; - webkitBoxDirection: string | null; - webkitBoxFlex: string | null; - webkitBoxOrdinalGroup: string | null; - webkitBoxOrient: string | null; - webkitBoxPack: string | null; - webkitBoxSizing: string | null; - webkitColumnBreakAfter: string | null; - webkitColumnBreakBefore: string | null; - webkitColumnBreakInside: string | null; - webkitColumnCount: any; - webkitColumnGap: any; - webkitColumnRule: string | null; - webkitColumnRuleColor: any; - webkitColumnRuleStyle: string | null; - webkitColumnRuleWidth: any; - webkitColumnSpan: string | null; - webkitColumnWidth: any; - webkitColumns: string | null; - webkitFilter: string | null; - webkitFlex: string | null; - webkitFlexBasis: string | null; - webkitFlexDirection: string | null; - webkitFlexFlow: string | null; - webkitFlexGrow: string | null; - webkitFlexShrink: string | null; - webkitFlexWrap: string | null; - webkitJustifyContent: string | null; - webkitOrder: string | null; - webkitPerspective: string | null; - webkitPerspectiveOrigin: string | null; - webkitTapHighlightColor: string | null; - webkitTextFillColor: string | null; - webkitTextSizeAdjust: any; - webkitTransform: string | null; - webkitTransformOrigin: string | null; - webkitTransformStyle: string | null; - webkitTransition: string | null; - webkitTransitionDelay: string | null; - webkitTransitionDuration: string | null; - webkitTransitionProperty: string | null; - webkitTransitionTimingFunction: string | null; - webkitUserModify: string | null; - webkitUserSelect: string | null; - webkitWritingMode: string | null; - whiteSpace: string | null; - widows: string | null; - width: string | null; - wordBreak: string | null; - wordSpacing: string | null; - wordWrap: string | null; - writingMode: string | null; - zIndex: string | null; - zoom: string | null; - resize: string | null; - getPropertyPriority(propertyName: string): string; - getPropertyValue(propertyName: string): string; - item(index: number): string; - removeProperty(propertyName: string): string; - setProperty(propertyName: string, value: string | null, priority?: string): void; - [index: number]: string; -} - -declare var CSSStyleDeclaration: { - prototype: CSSStyleDeclaration; - new(): CSSStyleDeclaration; -} - -interface CSSStyleRule extends CSSRule { - readonly readOnly: boolean; - selectorText: string; - readonly style: CSSStyleDeclaration; -} - -declare var CSSStyleRule: { - prototype: CSSStyleRule; - new(): CSSStyleRule; -} - -interface CSSStyleSheet extends StyleSheet { - readonly cssRules: CSSRuleList; - cssText: string; - readonly href: string; - readonly id: string; - readonly imports: StyleSheetList; - readonly isAlternate: boolean; - readonly isPrefAlternate: boolean; - readonly ownerRule: CSSRule; - readonly owningElement: Element; - readonly pages: StyleSheetPageList; - readonly readOnly: boolean; - readonly rules: CSSRuleList; - addImport(bstrURL: string, lIndex?: number): number; - addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; - addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; - deleteRule(index?: number): void; - insertRule(rule: string, index?: number): number; - removeImport(lIndex: number): void; - removeRule(lIndex: number): void; -} - -declare var CSSStyleSheet: { - prototype: CSSStyleSheet; - new(): CSSStyleSheet; -} - -interface CSSSupportsRule extends CSSConditionRule { -} - -declare var CSSSupportsRule: { - prototype: CSSSupportsRule; - new(): CSSSupportsRule; -} - -interface CanvasGradient { - addColorStop(offset: number, color: string): void; -} - -declare var CanvasGradient: { - prototype: CanvasGradient; - new(): CanvasGradient; -} - -interface CanvasPattern { - setTransform(matrix: SVGMatrix): void; -} - -declare var CanvasPattern: { - prototype: CanvasPattern; - new(): CanvasPattern; -} - -interface CanvasRenderingContext2D extends Object, CanvasPathMethods { - readonly canvas: HTMLCanvasElement; - fillStyle: string | CanvasGradient | CanvasPattern; - font: string; - globalAlpha: number; - globalCompositeOperation: string; - lineCap: string; - lineDashOffset: number; - lineJoin: string; - lineWidth: number; - miterLimit: number; - msFillRule: string; - msImageSmoothingEnabled: boolean; - shadowBlur: number; - shadowColor: string; - shadowOffsetX: number; - shadowOffsetY: number; - strokeStyle: string | CanvasGradient | CanvasPattern; - textAlign: string; - textBaseline: string; - mozImageSmoothingEnabled: boolean; - webkitImageSmoothingEnabled: boolean; - oImageSmoothingEnabled: boolean; - beginPath(): void; - clearRect(x: number, y: number, w: number, h: number): void; - clip(fillRule?: string): void; - createImageData(imageDataOrSw: number | ImageData, sh?: number): ImageData; - createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; - createPattern(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, repetition: string): CanvasPattern; - createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; - drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; - fill(fillRule?: string): void; - fillRect(x: number, y: number, w: number, h: number): void; - fillText(text: string, x: number, y: number, maxWidth?: number): void; - getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; - getLineDash(): number[]; - isPointInPath(x: number, y: number, fillRule?: string): boolean; - measureText(text: string): TextMetrics; - putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; - restore(): void; - rotate(angle: number): void; - save(): void; - scale(x: number, y: number): void; - setLineDash(segments: number[]): void; - setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - stroke(): void; - strokeRect(x: number, y: number, w: number, h: number): void; - strokeText(text: string, x: number, y: number, maxWidth?: number): void; - transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - translate(x: number, y: number): void; -} - -declare var CanvasRenderingContext2D: { - prototype: CanvasRenderingContext2D; - new(): CanvasRenderingContext2D; -} - -interface ChannelMergerNode extends AudioNode { -} - -declare var ChannelMergerNode: { - prototype: ChannelMergerNode; - new(): ChannelMergerNode; -} - -interface ChannelSplitterNode extends AudioNode { -} - -declare var ChannelSplitterNode: { - prototype: ChannelSplitterNode; - new(): ChannelSplitterNode; -} - -interface CharacterData extends Node, ChildNode { - data: string; - readonly length: number; - appendData(arg: string): void; - deleteData(offset: number, count: number): void; - insertData(offset: number, arg: string): void; - replaceData(offset: number, count: number, arg: string): void; - substringData(offset: number, count: number): string; -} - -declare var CharacterData: { - prototype: CharacterData; - new(): CharacterData; -} - -interface ClientRect { - bottom: number; - readonly height: number; - left: number; - right: number; - top: number; - readonly width: number; -} - -declare var ClientRect: { - prototype: ClientRect; - new(): ClientRect; -} - -interface ClientRectList { - readonly length: number; - item(index: number): ClientRect; - [index: number]: ClientRect; -} - -declare var ClientRectList: { - prototype: ClientRectList; - new(): ClientRectList; -} - -interface ClipboardEvent extends Event { - readonly clipboardData: DataTransfer; -} - -declare var ClipboardEvent: { - prototype: ClipboardEvent; - new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent; -} - -interface CloseEvent extends Event { - readonly code: number; - readonly reason: string; - readonly wasClean: boolean; - initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; -} - -declare var CloseEvent: { - prototype: CloseEvent; - new(): CloseEvent; -} - -interface CommandEvent extends Event { - readonly commandName: string; - readonly detail: string | null; -} - -declare var CommandEvent: { - prototype: CommandEvent; - new(type: string, eventInitDict?: CommandEventInit): CommandEvent; -} - -interface Comment extends CharacterData { - text: string; -} - -declare var Comment: { - prototype: Comment; - new(): Comment; -} - -interface CompositionEvent extends UIEvent { - readonly data: string; - readonly locale: string; - initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; -} - -declare var CompositionEvent: { - prototype: CompositionEvent; - new(typeArg: string, eventInitDict?: CompositionEventInit): CompositionEvent; -} - -interface Console { - assert(test?: boolean, message?: string, ...optionalParams: any[]): void; - clear(): void; - count(countTitle?: string): void; - debug(message?: string, ...optionalParams: any[]): void; - dir(value?: any, ...optionalParams: any[]): void; - dirxml(value: any): void; - error(message?: any, ...optionalParams: any[]): void; - exception(message?: string, ...optionalParams: any[]): void; - group(groupTitle?: string): void; - groupCollapsed(groupTitle?: string): void; - groupEnd(): void; - info(message?: any, ...optionalParams: any[]): void; - log(message?: any, ...optionalParams: any[]): void; - msIsIndependentlyComposed(element: Element): boolean; - profile(reportName?: string): void; - profileEnd(): void; - select(element: Element): void; - table(...data: any[]): void; - time(timerName?: string): void; - timeEnd(timerName?: string): void; - trace(message?: any, ...optionalParams: any[]): void; - warn(message?: any, ...optionalParams: any[]): void; -} - -declare var Console: { - prototype: Console; - new(): Console; -} - -interface ConvolverNode extends AudioNode { - buffer: AudioBuffer | null; - normalize: boolean; -} - -declare var ConvolverNode: { - prototype: ConvolverNode; - new(): ConvolverNode; -} - -interface Coordinates { - readonly accuracy: number; - readonly altitude: number | null; - readonly altitudeAccuracy: number | null; - readonly heading: number | null; - readonly latitude: number; - readonly longitude: number; - readonly speed: number | null; -} - -declare var Coordinates: { - prototype: Coordinates; - new(): Coordinates; -} - -interface Crypto extends Object, RandomSource { - readonly subtle: SubtleCrypto; -} - -declare var Crypto: { - prototype: Crypto; - new(): Crypto; -} - -interface CryptoKey { - readonly algorithm: KeyAlgorithm; - readonly extractable: boolean; - readonly type: string; - readonly usages: string[]; -} - -declare var CryptoKey: { - prototype: CryptoKey; - new(): CryptoKey; -} - -interface CryptoKeyPair { - privateKey: CryptoKey; - publicKey: CryptoKey; -} - -declare var CryptoKeyPair: { - prototype: CryptoKeyPair; - new(): CryptoKeyPair; -} - -interface CustomEvent extends Event { - readonly detail: any; - initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; -} - -declare var CustomEvent: { - prototype: CustomEvent; - new(typeArg: string, eventInitDict?: CustomEventInit): CustomEvent; -} - -interface DOMError { - readonly name: string; - toString(): string; -} - -declare var DOMError: { - prototype: DOMError; - new(): DOMError; -} - -interface DOMException { - readonly code: number; - readonly message: string; - readonly name: string; - toString(): string; - readonly ABORT_ERR: number; - readonly DATA_CLONE_ERR: number; - readonly DOMSTRING_SIZE_ERR: number; - readonly HIERARCHY_REQUEST_ERR: number; - readonly INDEX_SIZE_ERR: number; - readonly INUSE_ATTRIBUTE_ERR: number; - readonly INVALID_ACCESS_ERR: number; - readonly INVALID_CHARACTER_ERR: number; - readonly INVALID_MODIFICATION_ERR: number; - readonly INVALID_NODE_TYPE_ERR: number; - readonly INVALID_STATE_ERR: number; - readonly NAMESPACE_ERR: number; - readonly NETWORK_ERR: number; - readonly NOT_FOUND_ERR: number; - readonly NOT_SUPPORTED_ERR: number; - readonly NO_DATA_ALLOWED_ERR: number; - readonly NO_MODIFICATION_ALLOWED_ERR: number; - readonly PARSE_ERR: number; - readonly QUOTA_EXCEEDED_ERR: number; - readonly SECURITY_ERR: number; - readonly SERIALIZE_ERR: number; - readonly SYNTAX_ERR: number; - readonly TIMEOUT_ERR: number; - readonly TYPE_MISMATCH_ERR: number; - readonly URL_MISMATCH_ERR: number; - readonly VALIDATION_ERR: number; - readonly WRONG_DOCUMENT_ERR: number; -} - -declare var DOMException: { - prototype: DOMException; - new(): DOMException; - readonly ABORT_ERR: number; - readonly DATA_CLONE_ERR: number; - readonly DOMSTRING_SIZE_ERR: number; - readonly HIERARCHY_REQUEST_ERR: number; - readonly INDEX_SIZE_ERR: number; - readonly INUSE_ATTRIBUTE_ERR: number; - readonly INVALID_ACCESS_ERR: number; - readonly INVALID_CHARACTER_ERR: number; - readonly INVALID_MODIFICATION_ERR: number; - readonly INVALID_NODE_TYPE_ERR: number; - readonly INVALID_STATE_ERR: number; - readonly NAMESPACE_ERR: number; - readonly NETWORK_ERR: number; - readonly NOT_FOUND_ERR: number; - readonly NOT_SUPPORTED_ERR: number; - readonly NO_DATA_ALLOWED_ERR: number; - readonly NO_MODIFICATION_ALLOWED_ERR: number; - readonly PARSE_ERR: number; - readonly QUOTA_EXCEEDED_ERR: number; - readonly SECURITY_ERR: number; - readonly SERIALIZE_ERR: number; - readonly SYNTAX_ERR: number; - readonly TIMEOUT_ERR: number; - readonly TYPE_MISMATCH_ERR: number; - readonly URL_MISMATCH_ERR: number; - readonly VALIDATION_ERR: number; - readonly WRONG_DOCUMENT_ERR: number; -} - -interface DOMImplementation { - createDocument(namespaceURI: string | null, qualifiedName: string | null, doctype: DocumentType): Document; - createDocumentType(qualifiedName: string, publicId: string | null, systemId: string | null): DocumentType; - createHTMLDocument(title: string): Document; - hasFeature(feature: string | null, version: string | null): boolean; -} - -declare var DOMImplementation: { - prototype: DOMImplementation; - new(): DOMImplementation; -} - -interface DOMParser { - parseFromString(source: string, mimeType: string): Document; -} - -declare var DOMParser: { - prototype: DOMParser; - new(): DOMParser; -} - -interface DOMSettableTokenList extends DOMTokenList { - value: string; -} - -declare var DOMSettableTokenList: { - prototype: DOMSettableTokenList; - new(): DOMSettableTokenList; -} - -interface DOMStringList { - readonly length: number; - contains(str: string): boolean; - item(index: number): string | null; - [index: number]: string; -} - -declare var DOMStringList: { - prototype: DOMStringList; - new(): DOMStringList; -} - -interface DOMStringMap { - [name: string]: string; -} - -declare var DOMStringMap: { - prototype: DOMStringMap; - new(): DOMStringMap; -} - -interface DOMTokenList { - readonly length: number; - add(...token: string[]): void; - contains(token: string): boolean; - item(index: number): string; - remove(...token: string[]): void; - toString(): string; - toggle(token: string, force?: boolean): boolean; - [index: number]: string; -} - -declare var DOMTokenList: { - prototype: DOMTokenList; - new(): DOMTokenList; -} - -interface DataCue extends TextTrackCue { - data: ArrayBuffer; - addEventListener(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var DataCue: { - prototype: DataCue; - new(): DataCue; -} - -interface DataTransfer { - dropEffect: string; - effectAllowed: string; - readonly files: FileList; - readonly items: DataTransferItemList; - readonly types: string[]; - clearData(format?: string): boolean; - getData(format: string): string; - setData(format: string, data: string): boolean; -} - -declare var DataTransfer: { - prototype: DataTransfer; - new(): DataTransfer; -} - -interface DataTransferItem { - readonly kind: string; - readonly type: string; - getAsFile(): File | null; - getAsString(_callback: FunctionStringCallback | null): void; -} - -declare var DataTransferItem: { - prototype: DataTransferItem; - new(): DataTransferItem; -} - -interface DataTransferItemList { - readonly length: number; - add(data: File): DataTransferItem | null; - clear(): void; - item(index: number): DataTransferItem; - remove(index: number): void; - [index: number]: DataTransferItem; -} - -declare var DataTransferItemList: { - prototype: DataTransferItemList; - new(): DataTransferItemList; -} - -interface DeferredPermissionRequest { - readonly id: number; - readonly type: string; - readonly uri: string; - allow(): void; - deny(): void; -} - -declare var DeferredPermissionRequest: { - prototype: DeferredPermissionRequest; - new(): DeferredPermissionRequest; -} - -interface DelayNode extends AudioNode { - readonly delayTime: AudioParam; -} - -declare var DelayNode: { - prototype: DelayNode; - new(): DelayNode; -} - -interface DeviceAcceleration { - readonly x: number | null; - readonly y: number | null; - readonly z: number | null; -} - -declare var DeviceAcceleration: { - prototype: DeviceAcceleration; - new(): DeviceAcceleration; -} - -interface DeviceLightEvent extends Event { - readonly value: number; -} - -declare var DeviceLightEvent: { - prototype: DeviceLightEvent; - new(type: string, eventInitDict?: DeviceLightEventInit): DeviceLightEvent; -} - -interface DeviceMotionEvent extends Event { - readonly acceleration: DeviceAcceleration | null; - readonly accelerationIncludingGravity: DeviceAcceleration | null; - readonly interval: number | null; - readonly rotationRate: DeviceRotationRate | null; - initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict | null, accelerationIncludingGravity: DeviceAccelerationDict | null, rotationRate: DeviceRotationRateDict | null, interval: number | null): void; -} - -declare var DeviceMotionEvent: { - prototype: DeviceMotionEvent; - new(): DeviceMotionEvent; -} - -interface DeviceOrientationEvent extends Event { - readonly absolute: boolean; - readonly alpha: number | null; - readonly beta: number | null; - readonly gamma: number | null; - initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number | null, beta: number | null, gamma: number | null, absolute: boolean): void; -} - -declare var DeviceOrientationEvent: { - prototype: DeviceOrientationEvent; - new(): DeviceOrientationEvent; -} - -interface DeviceRotationRate { - readonly alpha: number | null; - readonly beta: number | null; - readonly gamma: number | null; -} - -declare var DeviceRotationRate: { - prototype: DeviceRotationRate; - new(): DeviceRotationRate; -} - -interface DocumentEventMap extends GlobalEventHandlersEventMap { - "abort": UIEvent; - "activate": UIEvent; - "beforeactivate": UIEvent; - "beforedeactivate": UIEvent; - "blur": FocusEvent; - "canplay": Event; - "canplaythrough": Event; - "change": Event; - "click": MouseEvent; - "contextmenu": PointerEvent; - "dblclick": MouseEvent; - "deactivate": UIEvent; - "drag": DragEvent; - "dragend": DragEvent; - "dragenter": DragEvent; - "dragleave": DragEvent; - "dragover": DragEvent; - "dragstart": DragEvent; - "drop": DragEvent; - "durationchange": Event; - "emptied": Event; - "ended": MediaStreamErrorEvent; - "error": ErrorEvent; - "focus": FocusEvent; - "fullscreenchange": Event; - "fullscreenerror": Event; - "input": Event; - "invalid": Event; - "keydown": KeyboardEvent; - "keypress": KeyboardEvent; - "keyup": KeyboardEvent; - "load": Event; - "loadeddata": Event; - "loadedmetadata": Event; - "loadstart": Event; - "mousedown": MouseEvent; - "mousemove": MouseEvent; - "mouseout": MouseEvent; - "mouseover": MouseEvent; - "mouseup": MouseEvent; - "mousewheel": WheelEvent; - "MSContentZoom": UIEvent; - "MSGestureChange": MSGestureEvent; - "MSGestureDoubleTap": MSGestureEvent; - "MSGestureEnd": MSGestureEvent; - "MSGestureHold": MSGestureEvent; - "MSGestureStart": MSGestureEvent; - "MSGestureTap": MSGestureEvent; - "MSInertiaStart": MSGestureEvent; - "MSManipulationStateChanged": MSManipulationEvent; - "MSPointerCancel": MSPointerEvent; - "MSPointerDown": MSPointerEvent; - "MSPointerEnter": MSPointerEvent; - "MSPointerLeave": MSPointerEvent; - "MSPointerMove": MSPointerEvent; - "MSPointerOut": MSPointerEvent; - "MSPointerOver": MSPointerEvent; - "MSPointerUp": MSPointerEvent; - "mssitemodejumplistitemremoved": MSSiteModeEvent; - "msthumbnailclick": MSSiteModeEvent; - "pause": Event; - "play": Event; - "playing": Event; - "pointerlockchange": Event; - "pointerlockerror": Event; - "progress": ProgressEvent; - "ratechange": Event; - "readystatechange": ProgressEvent; - "reset": Event; - "scroll": UIEvent; - "seeked": Event; - "seeking": Event; - "select": UIEvent; - "selectionchange": Event; - "selectstart": Event; - "stalled": Event; - "stop": Event; - "submit": Event; - "suspend": Event; - "timeupdate": Event; - "touchcancel": TouchEvent; - "touchend": TouchEvent; - "touchmove": TouchEvent; - "touchstart": TouchEvent; - "volumechange": Event; - "waiting": Event; - "webkitfullscreenchange": Event; - "webkitfullscreenerror": Event; -} - -interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEvent, ParentNode, DocumentOrShadowRoot { - /** - * Sets or gets the URL for the current document. - */ - readonly URL: string; - /** - * Gets the URL for the document, stripped of any character encoding. - */ - readonly URLUnencoded: string; - /** - * Gets the object that has the focus when the parent document has focus. - */ - readonly activeElement: Element; - /** - * Sets or gets the color of all active links in the document. - */ - alinkColor: string; - /** - * Returns a reference to the collection of elements contained by the object. - */ - readonly all: HTMLAllCollection; - /** - * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. - */ - anchors: HTMLCollectionOf; - /** - * Retrieves a collection of all applet objects in the document. - */ - applets: HTMLCollectionOf; - /** - * Deprecated. Sets or retrieves a value that indicates the background color behind the object. - */ - bgColor: string; - /** - * Specifies the beginning and end of the document body. - */ - body: HTMLElement; - readonly characterSet: string; - /** - * Gets or sets the character set used to encode the object. - */ - charset: string; - /** - * Gets a value that indicates whether standards-compliant mode is switched on for the object. - */ - readonly compatMode: string; - cookie: string; - readonly currentScript: HTMLScriptElement | SVGScriptElement; - /** - * Gets the default character set from the current regional language settings. - */ - readonly defaultCharset: string; - readonly defaultView: Window; - /** - * Sets or gets a value that indicates whether the document can be edited. - */ - designMode: string; - /** - * Sets or retrieves a value that indicates the reading order of the object. - */ - dir: string; - /** - * Gets an object representing the document type declaration associated with the current document. - */ - readonly doctype: DocumentType; - /** - * Gets a reference to the root node of the document. - */ - documentElement: HTMLElement; - /** - * Sets or gets the security domain of the document. - */ - domain: string; - /** - * Retrieves a collection of all embed objects in the document. - */ - embeds: HTMLCollectionOf; - /** - * Sets or gets the foreground (text) color of the document. - */ - fgColor: string; - /** - * Retrieves a collection, in source order, of all form objects in the document. - */ - forms: HTMLCollectionOf; - readonly fullscreenElement: Element | null; - readonly fullscreenEnabled: boolean; - readonly head: HTMLHeadElement; - readonly hidden: boolean; - /** - * Retrieves a collection, in source order, of img objects in the document. - */ - images: HTMLCollectionOf; - /** - * Gets the implementation object of the current document. - */ - readonly implementation: DOMImplementation; - /** - * Returns the character encoding used to create the webpage that is loaded into the document object. - */ - readonly inputEncoding: string | null; - /** - * Gets the date that the page was last modified, if the page supplies one. - */ - readonly lastModified: string; - /** - * Sets or gets the color of the document links. - */ - linkColor: string; - /** - * Retrieves a collection of all a objects that specify the href property and all area objects in the document. - */ - links: HTMLCollectionOf; - /** - * Contains information about the current URL. - */ - readonly location: Location; - msCSSOMElementFloatMetrics: boolean; - msCapsLockWarningOff: boolean; - /** - * Fires when the user aborts the download. - * @param ev The event. - */ - onabort: (this: Document, ev: UIEvent) => any; - /** - * Fires when the object is set as the active element. - * @param ev The event. - */ - onactivate: (this: Document, ev: UIEvent) => any; - /** - * Fires immediately before the object is set as the active element. - * @param ev The event. - */ - onbeforeactivate: (this: Document, ev: UIEvent) => any; - /** - * Fires immediately before the activeElement is changed from the current object to another object in the parent document. - * @param ev The event. - */ - onbeforedeactivate: (this: Document, ev: UIEvent) => any; - /** - * Fires when the object loses the input focus. - * @param ev The focus event. - */ - onblur: (this: Document, ev: FocusEvent) => any; - /** - * Occurs when playback is possible, but would require further buffering. - * @param ev The event. - */ - oncanplay: (this: Document, ev: Event) => any; - oncanplaythrough: (this: Document, ev: Event) => any; - /** - * Fires when the contents of the object or selection have changed. - * @param ev The event. - */ - onchange: (this: Document, ev: Event) => any; - /** - * Fires when the user clicks the left mouse button on the object - * @param ev The mouse event. - */ - onclick: (this: Document, ev: MouseEvent) => any; - /** - * Fires when the user clicks the right mouse button in the client area, opening the context menu. - * @param ev The mouse event. - */ - oncontextmenu: (this: Document, ev: PointerEvent) => any; - /** - * Fires when the user double-clicks the object. - * @param ev The mouse event. - */ - ondblclick: (this: Document, ev: MouseEvent) => any; - /** - * Fires when the activeElement is changed from the current object to another object in the parent document. - * @param ev The UI Event - */ - ondeactivate: (this: Document, ev: UIEvent) => any; - /** - * Fires on the source object continuously during a drag operation. - * @param ev The event. - */ - ondrag: (this: Document, ev: DragEvent) => any; - /** - * Fires on the source object when the user releases the mouse at the close of a drag operation. - * @param ev The event. - */ - ondragend: (this: Document, ev: DragEvent) => any; - /** - * Fires on the target element when the user drags the object to a valid drop target. - * @param ev The drag event. - */ - ondragenter: (this: Document, ev: DragEvent) => any; - /** - * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. - * @param ev The drag event. - */ - ondragleave: (this: Document, ev: DragEvent) => any; - /** - * Fires on the target element continuously while the user drags the object over a valid drop target. - * @param ev The event. - */ - ondragover: (this: Document, ev: DragEvent) => any; - /** - * Fires on the source object when the user starts to drag a text selection or selected object. - * @param ev The event. - */ - ondragstart: (this: Document, ev: DragEvent) => any; - ondrop: (this: Document, ev: DragEvent) => any; - /** - * Occurs when the duration attribute is updated. - * @param ev The event. - */ - ondurationchange: (this: Document, ev: Event) => any; - /** - * Occurs when the media element is reset to its initial state. - * @param ev The event. - */ - onemptied: (this: Document, ev: Event) => any; - /** - * Occurs when the end of playback is reached. - * @param ev The event - */ - onended: (this: Document, ev: MediaStreamErrorEvent) => any; - /** - * Fires when an error occurs during object loading. - * @param ev The event. - */ - onerror: (this: Document, ev: ErrorEvent) => any; - /** - * Fires when the object receives focus. - * @param ev The event. - */ - onfocus: (this: Document, ev: FocusEvent) => any; - onfullscreenchange: (this: Document, ev: Event) => any; - onfullscreenerror: (this: Document, ev: Event) => any; - oninput: (this: Document, ev: Event) => any; - oninvalid: (this: Document, ev: Event) => any; - /** - * Fires when the user presses a key. - * @param ev The keyboard event - */ - onkeydown: (this: Document, ev: KeyboardEvent) => any; - /** - * Fires when the user presses an alphanumeric key. - * @param ev The event. - */ - onkeypress: (this: Document, ev: KeyboardEvent) => any; - /** - * Fires when the user releases a key. - * @param ev The keyboard event - */ - onkeyup: (this: Document, ev: KeyboardEvent) => any; - /** - * Fires immediately after the browser loads the object. - * @param ev The event. - */ - onload: (this: Document, ev: Event) => any; - /** - * Occurs when media data is loaded at the current playback position. - * @param ev The event. - */ - onloadeddata: (this: Document, ev: Event) => any; - /** - * Occurs when the duration and dimensions of the media have been determined. - * @param ev The event. - */ - onloadedmetadata: (this: Document, ev: Event) => any; - /** - * Occurs when Internet Explorer begins looking for media data. - * @param ev The event. - */ - onloadstart: (this: Document, ev: Event) => any; - /** - * Fires when the user clicks the object with either mouse button. - * @param ev The mouse event. - */ - onmousedown: (this: Document, ev: MouseEvent) => any; - /** - * Fires when the user moves the mouse over the object. - * @param ev The mouse event. - */ - onmousemove: (this: Document, ev: MouseEvent) => any; - /** - * Fires when the user moves the mouse pointer outside the boundaries of the object. - * @param ev The mouse event. - */ - onmouseout: (this: Document, ev: MouseEvent) => any; - /** - * Fires when the user moves the mouse pointer into the object. - * @param ev The mouse event. - */ - onmouseover: (this: Document, ev: MouseEvent) => any; - /** - * Fires when the user releases a mouse button while the mouse is over the object. - * @param ev The mouse event. - */ - onmouseup: (this: Document, ev: MouseEvent) => any; - /** - * Fires when the wheel button is rotated. - * @param ev The mouse event - */ - onmousewheel: (this: Document, ev: WheelEvent) => any; - onmscontentzoom: (this: Document, ev: UIEvent) => any; - onmsgesturechange: (this: Document, ev: MSGestureEvent) => any; - onmsgesturedoubletap: (this: Document, ev: MSGestureEvent) => any; - onmsgestureend: (this: Document, ev: MSGestureEvent) => any; - onmsgesturehold: (this: Document, ev: MSGestureEvent) => any; - onmsgesturestart: (this: Document, ev: MSGestureEvent) => any; - onmsgesturetap: (this: Document, ev: MSGestureEvent) => any; - onmsinertiastart: (this: Document, ev: MSGestureEvent) => any; - onmsmanipulationstatechanged: (this: Document, ev: MSManipulationEvent) => any; - onmspointercancel: (this: Document, ev: MSPointerEvent) => any; - onmspointerdown: (this: Document, ev: MSPointerEvent) => any; - onmspointerenter: (this: Document, ev: MSPointerEvent) => any; - onmspointerleave: (this: Document, ev: MSPointerEvent) => any; - onmspointermove: (this: Document, ev: MSPointerEvent) => any; - onmspointerout: (this: Document, ev: MSPointerEvent) => any; - onmspointerover: (this: Document, ev: MSPointerEvent) => any; - onmspointerup: (this: Document, ev: MSPointerEvent) => any; - /** - * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. - * @param ev The event. - */ - onmssitemodejumplistitemremoved: (this: Document, ev: MSSiteModeEvent) => any; - /** - * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. - * @param ev The event. - */ - onmsthumbnailclick: (this: Document, ev: MSSiteModeEvent) => any; - /** - * Occurs when playback is paused. - * @param ev The event. - */ - onpause: (this: Document, ev: Event) => any; - /** - * Occurs when the play method is requested. - * @param ev The event. - */ - onplay: (this: Document, ev: Event) => any; - /** - * Occurs when the audio or video has started playing. - * @param ev The event. - */ - onplaying: (this: Document, ev: Event) => any; - onpointerlockchange: (this: Document, ev: Event) => any; - onpointerlockerror: (this: Document, ev: Event) => any; - /** - * Occurs to indicate progress while downloading media data. - * @param ev The event. - */ - onprogress: (this: Document, ev: ProgressEvent) => any; - /** - * Occurs when the playback rate is increased or decreased. - * @param ev The event. - */ - onratechange: (this: Document, ev: Event) => any; - /** - * Fires when the state of the object has changed. - * @param ev The event - */ - onreadystatechange: (this: Document, ev: ProgressEvent) => any; - /** - * Fires when the user resets a form. - * @param ev The event. - */ - onreset: (this: Document, ev: Event) => any; - /** - * Fires when the user repositions the scroll box in the scroll bar on the object. - * @param ev The event. - */ - onscroll: (this: Document, ev: UIEvent) => any; - /** - * Occurs when the seek operation ends. - * @param ev The event. - */ - onseeked: (this: Document, ev: Event) => any; - /** - * Occurs when the current playback position is moved. - * @param ev The event. - */ - onseeking: (this: Document, ev: Event) => any; - /** - * Fires when the current selection changes. - * @param ev The event. - */ - onselect: (this: Document, ev: UIEvent) => any; - /** - * Fires when the selection state of a document changes. - * @param ev The event. - */ - onselectionchange: (this: Document, ev: Event) => any; - onselectstart: (this: Document, ev: Event) => any; - /** - * Occurs when the download has stopped. - * @param ev The event. - */ - onstalled: (this: Document, ev: Event) => any; - /** - * Fires when the user clicks the Stop button or leaves the Web page. - * @param ev The event. - */ - onstop: (this: Document, ev: Event) => any; - onsubmit: (this: Document, ev: Event) => any; - /** - * Occurs if the load operation has been intentionally halted. - * @param ev The event. - */ - onsuspend: (this: Document, ev: Event) => any; - /** - * Occurs to indicate the current playback position. - * @param ev The event. - */ - ontimeupdate: (this: Document, ev: Event) => any; - ontouchcancel: (ev: TouchEvent) => any; - ontouchend: (ev: TouchEvent) => any; - ontouchmove: (ev: TouchEvent) => any; - ontouchstart: (ev: TouchEvent) => any; - /** - * Occurs when the volume is changed, or playback is muted or unmuted. - * @param ev The event. - */ - onvolumechange: (this: Document, ev: Event) => any; - /** - * Occurs when playback stops because the next frame of a video resource is not available. - * @param ev The event. - */ - onwaiting: (this: Document, ev: Event) => any; - onwebkitfullscreenchange: (this: Document, ev: Event) => any; - onwebkitfullscreenerror: (this: Document, ev: Event) => any; - plugins: HTMLCollectionOf; - readonly pointerLockElement: Element; - /** - * Retrieves a value that indicates the current state of the object. - */ - readonly readyState: string; - /** - * Gets the URL of the location that referred the user to the current page. - */ - readonly referrer: string; - /** - * Gets the root svg element in the document hierarchy. - */ - readonly rootElement: SVGSVGElement; - /** - * Retrieves a collection of all script objects in the document. - */ - scripts: HTMLCollectionOf; - readonly scrollingElement: Element | null; - /** - * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. - */ - readonly styleSheets: StyleSheetList; - /** - * Contains the title of the document. - */ - title: string; - readonly visibilityState: string; - /** - * Sets or gets the color of the links that the user has visited. - */ - vlinkColor: string; - readonly webkitCurrentFullScreenElement: Element | null; - readonly webkitFullscreenElement: Element | null; - readonly webkitFullscreenEnabled: boolean; - readonly webkitIsFullScreen: boolean; - readonly xmlEncoding: string | null; - xmlStandalone: boolean; - /** - * Gets or sets the version attribute specified in the declaration of an XML document. - */ - xmlVersion: string | null; - adoptNode(source: Node): Node; - captureEvents(): void; - caretRangeFromPoint(x: number, y: number): Range; - clear(): void; - /** - * Closes an output stream and forces the sent data to display. - */ - close(): void; - /** - * Creates an attribute object with a specified name. - * @param name String that sets the attribute object's name. - */ - createAttribute(name: string): Attr; - createAttributeNS(namespaceURI: string | null, qualifiedName: string): Attr; - createCDATASection(data: string): CDATASection; - /** - * Creates a comment object with the specified data. - * @param data Sets the comment object's data. - */ - createComment(data: string): Comment; - /** - * Creates a new document. - */ - createDocumentFragment(): DocumentFragment; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: K): HTMLElementTagNameMap[K]; - createElement(tagName: string): HTMLElement; - createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "a"): SVGAElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "circle"): SVGCircleElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "clipPath"): SVGClipPathElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "componentTransferFunction"): SVGComponentTransferFunctionElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "defs"): SVGDefsElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "desc"): SVGDescElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "ellipse"): SVGEllipseElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feBlend"): SVGFEBlendElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feColorMatrix"): SVGFEColorMatrixElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feComponentTransfer"): SVGFEComponentTransferElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feComposite"): SVGFECompositeElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feConvolveMatrix"): SVGFEConvolveMatrixElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDiffuseLighting"): SVGFEDiffuseLightingElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDisplacementMap"): SVGFEDisplacementMapElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDistantLight"): SVGFEDistantLightElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFlood"): SVGFEFloodElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncA"): SVGFEFuncAElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncB"): SVGFEFuncBElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncG"): SVGFEFuncGElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncR"): SVGFEFuncRElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feGaussianBlur"): SVGFEGaussianBlurElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feImage"): SVGFEImageElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMerge"): SVGFEMergeElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMergeNode"): SVGFEMergeNodeElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMorphology"): SVGFEMorphologyElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feOffset"): SVGFEOffsetElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "fePointLight"): SVGFEPointLightElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feSpecularLighting"): SVGFESpecularLightingElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feSpotLight"): SVGFESpotLightElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feTile"): SVGFETileElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feTurbulence"): SVGFETurbulenceElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "filter"): SVGFilterElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "foreignObject"): SVGForeignObjectElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "g"): SVGGElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "image"): SVGImageElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "gradient"): SVGGradientElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "line"): SVGLineElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "linearGradient"): SVGLinearGradientElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "marker"): SVGMarkerElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "mask"): SVGMaskElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "path"): SVGPathElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "metadata"): SVGMetadataElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "pattern"): SVGPatternElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "polygon"): SVGPolygonElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "polyline"): SVGPolylineElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "radialGradient"): SVGRadialGradientElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "rect"): SVGRectElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "svg"): SVGSVGElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "script"): SVGScriptElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "stop"): SVGStopElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "style"): SVGStyleElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "switch"): SVGSwitchElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "symbol"): SVGSymbolElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "tspan"): SVGTSpanElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textContent"): SVGTextContentElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "text"): SVGTextElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textPath"): SVGTextPathElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textPositioning"): SVGTextPositioningElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "title"): SVGTitleElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "use"): SVGUseElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "view"): SVGViewElement - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement - createElementNS(namespaceURI: string | null, qualifiedName: string): Element; - createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; - createNSResolver(nodeResolver: Node): XPathNSResolver; - /** - * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list - * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): NodeIterator; - createProcessingInstruction(target: string, data: string): ProcessingInstruction; - /** - * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. - */ - createRange(): Range; - /** - * Creates a text string from the specified value. - * @param data String that specifies the nodeValue property of the text node. - */ - createTextNode(data: string): Text; - createTouch(view: Window, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch; - createTouchList(...touches: Touch[]): TouchList; - /** - * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. - * @param filter A custom NodeFilter function to use. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker; - /** - * Returns the element for the specified x coordinate and the specified y coordinate. - * @param x The x-offset - * @param y The y-offset - */ - elementFromPoint(x: number, y: number): Element; - evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult; - /** - * Executes a command on the current document, current selection, or the given range. - * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. - * @param showUI Display the user interface, defaults to false. - * @param value Value to assign. - */ - execCommand(commandId: string, showUI?: boolean, value?: any): boolean; - /** - * Displays help information for the given command identifier. - * @param commandId Displays help information for the given command identifier. - */ - execCommandShowHelp(commandId: string): boolean; - exitFullscreen(): void; - exitPointerLock(): void; - /** - * Causes the element to receive the focus and executes the code specified by the onfocus event. - */ - focus(): void; - /** - * Returns a reference to the first object with the specified value of the ID or NAME attribute. - * @param elementId String that specifies the ID value. Case-insensitive. - */ - getElementById(elementId: string): HTMLElement | null; - getElementsByClassName(classNames: string): HTMLCollectionOf; - /** - * Gets a collection of objects based on the value of the NAME or ID attribute. - * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. - */ - getElementsByName(elementName: string): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(tagname: K): ElementListTagNameMap[K]; - getElementsByTagName(tagname: string): NodeListOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf; - /** - * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. - */ - getSelection(): Selection; - /** - * Gets a value indicating whether the object currently has focus. - */ - hasFocus(): boolean; - importNode(importedNode: Node, deep: boolean): Node; - msElementsFromPoint(x: number, y: number): NodeListOf; - msElementsFromRect(left: number, top: number, width: number, height: number): NodeListOf; - /** - * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. - * @param url Specifies a MIME type for the document. - * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. - * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. - * @param replace Specifies whether the existing entry for the document is replaced in the history list. - */ - open(url?: string, name?: string, features?: string, replace?: boolean): Document; - /** - * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. - * @param commandId Specifies a command identifier. - */ - queryCommandEnabled(commandId: string): boolean; - /** - * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. - * @param commandId String that specifies a command identifier. - */ - queryCommandIndeterm(commandId: string): boolean; - /** - * Returns a Boolean value that indicates the current state of the command. - * @param commandId String that specifies a command identifier. - */ - queryCommandState(commandId: string): boolean; - /** - * Returns a Boolean value that indicates whether the current command is supported on the current range. - * @param commandId Specifies a command identifier. - */ - queryCommandSupported(commandId: string): boolean; - /** - * Retrieves the string associated with a command. - * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. - */ - queryCommandText(commandId: string): string; - /** - * Returns the current value of the document, range, or current selection for the given command. - * @param commandId String that specifies a command identifier. - */ - queryCommandValue(commandId: string): string; - releaseEvents(): void; - /** - * Allows updating the print settings for the page. - */ - updateSettings(): void; - webkitCancelFullScreen(): void; - webkitExitFullscreen(): void; - /** - * Writes one or more HTML expressions to a document in the specified window. - * @param content Specifies the text and HTML tags to write. - */ - write(...content: string[]): void; - /** - * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. - * @param content The text and HTML tags to write. - */ - writeln(...content: string[]): void; - addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Document: { - prototype: Document; - new(): Document; -} - -interface DocumentFragment extends Node, NodeSelector, ParentNode { -} - -declare var DocumentFragment: { - prototype: DocumentFragment; - new(): DocumentFragment; -} - -interface DocumentType extends Node, ChildNode { - readonly entities: NamedNodeMap; - readonly internalSubset: string | null; - readonly name: string; - readonly notations: NamedNodeMap; - readonly publicId: string | null; - readonly systemId: string | null; -} - -declare var DocumentType: { - prototype: DocumentType; - new(): DocumentType; -} - -interface DragEvent extends MouseEvent { - readonly dataTransfer: DataTransfer; - initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; - msConvertURL(file: File, targetType: string, targetURL?: string): void; -} - -declare var DragEvent: { - prototype: DragEvent; - new(): DragEvent; -} - -interface DynamicsCompressorNode extends AudioNode { - readonly attack: AudioParam; - readonly knee: AudioParam; - readonly ratio: AudioParam; - readonly reduction: AudioParam; - readonly release: AudioParam; - readonly threshold: AudioParam; -} - -declare var DynamicsCompressorNode: { - prototype: DynamicsCompressorNode; - new(): DynamicsCompressorNode; -} - -interface EXT_frag_depth { -} - -declare var EXT_frag_depth: { - prototype: EXT_frag_depth; - new(): EXT_frag_depth; -} - -interface EXT_texture_filter_anisotropic { - readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; - readonly TEXTURE_MAX_ANISOTROPY_EXT: number; -} - -declare var EXT_texture_filter_anisotropic: { - prototype: EXT_texture_filter_anisotropic; - new(): EXT_texture_filter_anisotropic; - readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; - readonly TEXTURE_MAX_ANISOTROPY_EXT: number; -} - -interface ElementEventMap extends GlobalEventHandlersEventMap { - "ariarequest": AriaRequestEvent; - "command": CommandEvent; - "gotpointercapture": PointerEvent; - "lostpointercapture": PointerEvent; - "MSGestureChange": MSGestureEvent; - "MSGestureDoubleTap": MSGestureEvent; - "MSGestureEnd": MSGestureEvent; - "MSGestureHold": MSGestureEvent; - "MSGestureStart": MSGestureEvent; - "MSGestureTap": MSGestureEvent; - "MSGotPointerCapture": MSPointerEvent; - "MSInertiaStart": MSGestureEvent; - "MSLostPointerCapture": MSPointerEvent; - "MSPointerCancel": MSPointerEvent; - "MSPointerDown": MSPointerEvent; - "MSPointerEnter": MSPointerEvent; - "MSPointerLeave": MSPointerEvent; - "MSPointerMove": MSPointerEvent; - "MSPointerOut": MSPointerEvent; - "MSPointerOver": MSPointerEvent; - "MSPointerUp": MSPointerEvent; - "touchcancel": TouchEvent; - "touchend": TouchEvent; - "touchmove": TouchEvent; - "touchstart": TouchEvent; - "webkitfullscreenchange": Event; - "webkitfullscreenerror": Event; -} - -interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelector, ChildNode, ParentNode { - readonly classList: DOMTokenList; - className: string; - readonly clientHeight: number; - readonly clientLeft: number; - readonly clientTop: number; - readonly clientWidth: number; - id: string; - msContentZoomFactor: number; - readonly msRegionOverflow: string; - onariarequest: (this: Element, ev: AriaRequestEvent) => any; - oncommand: (this: Element, ev: CommandEvent) => any; - ongotpointercapture: (this: Element, ev: PointerEvent) => any; - onlostpointercapture: (this: Element, ev: PointerEvent) => any; - onmsgesturechange: (this: Element, ev: MSGestureEvent) => any; - onmsgesturedoubletap: (this: Element, ev: MSGestureEvent) => any; - onmsgestureend: (this: Element, ev: MSGestureEvent) => any; - onmsgesturehold: (this: Element, ev: MSGestureEvent) => any; - onmsgesturestart: (this: Element, ev: MSGestureEvent) => any; - onmsgesturetap: (this: Element, ev: MSGestureEvent) => any; - onmsgotpointercapture: (this: Element, ev: MSPointerEvent) => any; - onmsinertiastart: (this: Element, ev: MSGestureEvent) => any; - onmslostpointercapture: (this: Element, ev: MSPointerEvent) => any; - onmspointercancel: (this: Element, ev: MSPointerEvent) => any; - onmspointerdown: (this: Element, ev: MSPointerEvent) => any; - onmspointerenter: (this: Element, ev: MSPointerEvent) => any; - onmspointerleave: (this: Element, ev: MSPointerEvent) => any; - onmspointermove: (this: Element, ev: MSPointerEvent) => any; - onmspointerout: (this: Element, ev: MSPointerEvent) => any; - onmspointerover: (this: Element, ev: MSPointerEvent) => any; - onmspointerup: (this: Element, ev: MSPointerEvent) => any; - ontouchcancel: (ev: TouchEvent) => any; - ontouchend: (ev: TouchEvent) => any; - ontouchmove: (ev: TouchEvent) => any; - ontouchstart: (ev: TouchEvent) => any; - onwebkitfullscreenchange: (this: Element, ev: Event) => any; - onwebkitfullscreenerror: (this: Element, ev: Event) => any; - readonly prefix: string | null; - readonly scrollHeight: number; - scrollLeft: number; - scrollTop: number; - readonly scrollWidth: number; - readonly tagName: string; - innerHTML: string; - readonly assignedSlot: HTMLSlotElement | null; - slot: string; - readonly shadowRoot: ShadowRoot | null; - getAttribute(name: string): string | null; - getAttributeNS(namespaceURI: string, localName: string): string; - getAttributeNode(name: string): Attr; - getAttributeNodeNS(namespaceURI: string, localName: string): Attr; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; - getElementsByTagName(name: K): ElementListTagNameMap[K]; - getElementsByTagName(name: string): NodeListOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf; - hasAttribute(name: string): boolean; - hasAttributeNS(namespaceURI: string, localName: string): boolean; - msGetRegionContent(): MSRangeCollection; - msGetUntransformedBounds(): ClientRect; - msMatchesSelector(selectors: string): boolean; - msReleasePointerCapture(pointerId: number): void; - msSetPointerCapture(pointerId: number): void; - msZoomTo(args: MsZoomToOptions): void; - releasePointerCapture(pointerId: number): void; - removeAttribute(name?: string): void; - removeAttributeNS(namespaceURI: string, localName: string): void; - removeAttributeNode(oldAttr: Attr): Attr; - requestFullscreen(): void; - requestPointerLock(): void; - setAttribute(name: string, value: string): void; - setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; - setAttributeNode(newAttr: Attr): Attr; - setAttributeNodeNS(newAttr: Attr): Attr; - setPointerCapture(pointerId: number): void; - webkitMatchesSelector(selectors: string): boolean; - webkitRequestFullScreen(): void; - webkitRequestFullscreen(): void; - getElementsByClassName(classNames: string): NodeListOf; - matches(selector: string): boolean; - closest(selector: string): Element | null; - scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void; - scroll(options?: ScrollToOptions): void; - scroll(x: number, y: number): void; - scrollTo(options?: ScrollToOptions): void; - scrollTo(x: number, y: number): void; - scrollBy(options?: ScrollToOptions): void; - scrollBy(x: number, y: number): void; - insertAdjacentElement(position: string, insertedElement: Element): Element | null; - insertAdjacentHTML(where: string, html: string): void; - insertAdjacentText(where: string, text: string): void; - attachShadow(shadowRootInitDict: ShadowRootInit): ShadowRoot; - addEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Element: { - prototype: Element; - new(): Element; -} - -interface ErrorEvent extends Event { - readonly colno: number; - readonly error: any; - readonly filename: string; - readonly lineno: number; - readonly message: string; - initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; -} - -declare var ErrorEvent: { - prototype: ErrorEvent; - new(): ErrorEvent; -} - -interface Event { - readonly bubbles: boolean; - cancelBubble: boolean; - readonly cancelable: boolean; - readonly currentTarget: EventTarget; - readonly defaultPrevented: boolean; - readonly eventPhase: number; - readonly isTrusted: boolean; - returnValue: boolean; - readonly srcElement: Element | null; - readonly target: EventTarget; - readonly timeStamp: number; - readonly type: string; - readonly scoped: boolean; - initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; - preventDefault(): void; - stopImmediatePropagation(): void; - stopPropagation(): void; - deepPath(): EventTarget[]; - readonly AT_TARGET: number; - readonly BUBBLING_PHASE: number; - readonly CAPTURING_PHASE: number; -} - -declare var Event: { - prototype: Event; - new(type: string, eventInitDict?: EventInit): Event; - readonly AT_TARGET: number; - readonly BUBBLING_PHASE: number; - readonly CAPTURING_PHASE: number; -} - -interface EventTarget { - addEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void; - dispatchEvent(evt: Event): boolean; - removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var EventTarget: { - prototype: EventTarget; - new(): EventTarget; -} - -interface External { -} - -declare var External: { - prototype: External; - new(): External; -} - -interface File extends Blob { - readonly lastModifiedDate: any; - readonly name: string; - readonly webkitRelativePath: string; -} - -declare var File: { - prototype: File; - new (parts: (ArrayBuffer | ArrayBufferView | Blob | string)[], filename: string, properties?: FilePropertyBag): File; -} - -interface FileList { - readonly length: number; - item(index: number): File; - [index: number]: File; -} - -declare var FileList: { - prototype: FileList; - new(): FileList; -} - -interface FileReader extends EventTarget, MSBaseReader { - readonly error: DOMError; - readAsArrayBuffer(blob: Blob): void; - readAsBinaryString(blob: Blob): void; - readAsDataURL(blob: Blob): void; - readAsText(blob: Blob, encoding?: string): void; - addEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var FileReader: { - prototype: FileReader; - new(): FileReader; -} - -interface FocusEvent extends UIEvent { - readonly relatedTarget: EventTarget; - initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; -} - -declare var FocusEvent: { - prototype: FocusEvent; - new(typeArg: string, eventInitDict?: FocusEventInit): FocusEvent; -} - -interface FormData { - append(name: any, value: any, blobName?: string): void; -} - -declare var FormData: { - prototype: FormData; - new (form?: HTMLFormElement): FormData; -} - -interface GainNode extends AudioNode { - readonly gain: AudioParam; -} - -declare var GainNode: { - prototype: GainNode; - new(): GainNode; -} - -interface Gamepad { - readonly axes: number[]; - readonly buttons: GamepadButton[]; - readonly connected: boolean; - readonly id: string; - readonly index: number; - readonly mapping: string; - readonly timestamp: number; -} - -declare var Gamepad: { - prototype: Gamepad; - new(): Gamepad; -} - -interface GamepadButton { - readonly pressed: boolean; - readonly value: number; -} - -declare var GamepadButton: { - prototype: GamepadButton; - new(): GamepadButton; -} - -interface GamepadEvent extends Event { - readonly gamepad: Gamepad; -} - -declare var GamepadEvent: { - prototype: GamepadEvent; - new(): GamepadEvent; -} - -interface Geolocation { - clearWatch(watchId: number): void; - getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; - watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; -} - -declare var Geolocation: { - prototype: Geolocation; - new(): Geolocation; -} - -interface HTMLAllCollection extends HTMLCollection { - namedItem(name: string): Element; -} - -declare var HTMLAllCollection: { - prototype: HTMLAllCollection; - new(): HTMLAllCollection; -} - -interface HTMLAnchorElement extends HTMLElement { - Methods: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - download: string; - /** - * Contains the anchor portion of the URL including the hash sign (#). - */ - hash: string; - /** - * Contains the hostname and port values of the URL. - */ - host: string; - /** - * Contains the hostname of a URL. - */ - hostname: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; - readonly mimeType: string; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - readonly nameProp: string; - /** - * Contains the pathname of the URL. - */ - pathname: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Contains the protocol of the URL. - */ - protocol: string; - readonly protocolLong: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - type: string; - urn: string; - /** - * Returns a string representation of an object. - */ - toString(): string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLAnchorElement: { - prototype: HTMLAnchorElement; - new(): HTMLAnchorElement; -} - -interface HTMLAppletElement extends HTMLElement { - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - readonly BaseHref: string; - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. - */ - altHtml: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - border: string; - code: string; - /** - * Sets or retrieves the URL of the component. - */ - codeBase: string; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - /** - * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. - */ - readonly contentDocument: Document; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; - /** - * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. - */ - declare: boolean; - readonly form: HTMLFormElement; - /** - * Sets or retrieves the height of the object. - */ - height: string; - hspace: number; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - object: string | null; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - vspace: number; - width: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLAppletElement: { - prototype: HTMLAppletElement; - new(): HTMLAppletElement; -} - -interface HTMLAreaElement extends HTMLElement { - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - download: string; - /** - * Sets or retrieves the subsection of the href property that follows the number sign (#). - */ - hash: string; - /** - * Sets or retrieves the hostname and port number of the location or URL. - */ - host: string; - /** - * Sets or retrieves the host name part of the location or URL. - */ - hostname: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or gets whether clicks in this region cause action. - */ - noHref: boolean; - /** - * Sets or retrieves the file name or path specified by the object. - */ - pathname: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Sets or retrieves the protocol portion of a URL. - */ - protocol: string; - rel: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Returns a string representation of an object. - */ - toString(): string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLAreaElement: { - prototype: HTMLAreaElement; - new(): HTMLAreaElement; -} - -interface HTMLAreasCollection extends HTMLCollection { - /** - * Adds an element to the areas, controlRange, or options collection. - */ - add(element: HTMLElement, before?: HTMLElement | number): void; - /** - * Removes an element from the collection. - */ - remove(index?: number): void; -} - -declare var HTMLAreasCollection: { - prototype: HTMLAreasCollection; - new(): HTMLAreasCollection; -} - -interface HTMLAudioElement extends HTMLMediaElement { - addEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLAudioElement: { - prototype: HTMLAudioElement; - new(): HTMLAudioElement; -} - -interface HTMLBRElement extends HTMLElement { - /** - * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. - */ - clear: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLBRElement: { - prototype: HTMLBRElement; - new(): HTMLBRElement; -} - -interface HTMLBaseElement extends HTMLElement { - /** - * Gets or sets the baseline URL on which relative links are based. - */ - href: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLBaseElement: { - prototype: HTMLBaseElement; - new(): HTMLBaseElement; -} - -interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; - /** - * Sets or retrieves the font size of the object. - */ - size: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLBaseFontElement: { - prototype: HTMLBaseFontElement; - new(): HTMLBaseFontElement; -} - -interface HTMLBodyElementEventMap extends HTMLElementEventMap { - "afterprint": Event; - "beforeprint": Event; - "beforeunload": BeforeUnloadEvent; - "blur": FocusEvent; - "error": ErrorEvent; - "focus": FocusEvent; - "hashchange": HashChangeEvent; - "load": Event; - "message": MessageEvent; - "offline": Event; - "online": Event; - "orientationchange": Event; - "pagehide": PageTransitionEvent; - "pageshow": PageTransitionEvent; - "popstate": PopStateEvent; - "resize": UIEvent; - "storage": StorageEvent; - "unload": Event; -} - -interface HTMLBodyElement extends HTMLElement { - aLink: any; - background: string; - bgColor: any; - bgProperties: string; - link: any; - noWrap: boolean; - onafterprint: (this: HTMLBodyElement, ev: Event) => any; - onbeforeprint: (this: HTMLBodyElement, ev: Event) => any; - onbeforeunload: (this: HTMLBodyElement, ev: BeforeUnloadEvent) => any; - onblur: (this: HTMLBodyElement, ev: FocusEvent) => any; - onerror: (this: HTMLBodyElement, ev: ErrorEvent) => any; - onfocus: (this: HTMLBodyElement, ev: FocusEvent) => any; - onhashchange: (this: HTMLBodyElement, ev: HashChangeEvent) => any; - onload: (this: HTMLBodyElement, ev: Event) => any; - onmessage: (this: HTMLBodyElement, ev: MessageEvent) => any; - onoffline: (this: HTMLBodyElement, ev: Event) => any; - ononline: (this: HTMLBodyElement, ev: Event) => any; - onorientationchange: (this: HTMLBodyElement, ev: Event) => any; - onpagehide: (this: HTMLBodyElement, ev: PageTransitionEvent) => any; - onpageshow: (this: HTMLBodyElement, ev: PageTransitionEvent) => any; - onpopstate: (this: HTMLBodyElement, ev: PopStateEvent) => any; - onresize: (this: HTMLBodyElement, ev: UIEvent) => any; - onstorage: (this: HTMLBodyElement, ev: StorageEvent) => any; - onunload: (this: HTMLBodyElement, ev: Event) => any; - text: any; - vLink: any; - addEventListener(type: K, listener: (this: HTMLBodyElement, ev: HTMLBodyElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLBodyElement: { - prototype: HTMLBodyElement; - new(): HTMLBodyElement; -} - -interface HTMLButtonElement extends HTMLElement { - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. - */ - formAction: string; - /** - * Used to override the encoding (formEnctype attribute) specified on the form element. - */ - formEnctype: string; - /** - * Overrides the submit method attribute previously specified on a form element. - */ - formMethod: string; - /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. - */ - formNoValidate: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - status: any; - /** - * Gets the classification and default behavior of the button. - */ - type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - /** - * Sets or retrieves the default or selected value of the control. - */ - value: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLButtonElement: { - prototype: HTMLButtonElement; - new(): HTMLButtonElement; -} - -interface HTMLCanvasElement extends HTMLElement { - /** - * Gets or sets the height of a canvas element on a document. - */ - height: number; - /** - * Gets or sets the width of a canvas element on a document. - */ - width: number; - /** - * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. - * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); - */ - getContext(contextId: "2d", contextAttributes?: Canvas2DContextAttributes): CanvasRenderingContext2D | null; - getContext(contextId: "webgl" | "experimental-webgl", contextAttributes?: WebGLContextAttributes): WebGLRenderingContext | null; - getContext(contextId: string, contextAttributes?: {}): CanvasRenderingContext2D | WebGLRenderingContext | null; - /** - * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. - */ - msToBlob(): Blob; - /** - * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. - * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. - */ - toDataURL(type?: string, ...args: any[]): string; - toBlob(callback: (result: Blob | null) => void, type?: string, ...arguments: any[]): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLCanvasElement: { - prototype: HTMLCanvasElement; - new(): HTMLCanvasElement; -} - -interface HTMLCollection { - /** - * Sets or retrieves the number of objects in a collection. - */ - readonly length: number; - /** - * Retrieves an object from various collections. - */ - item(index: number): Element; - /** - * Retrieves a select object or an object from an options collection. - */ - namedItem(name: string): Element; - [index: number]: Element; -} - -declare var HTMLCollection: { - prototype: HTMLCollection; - new(): HTMLCollection; -} - -interface HTMLDListElement extends HTMLElement { - compact: boolean; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLDListElement: { - prototype: HTMLDListElement; - new(): HTMLDListElement; -} - -interface HTMLDataListElement extends HTMLElement { - options: HTMLCollectionOf; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLDataListElement: { - prototype: HTMLDataListElement; - new(): HTMLDataListElement; -} - -interface HTMLDirectoryElement extends HTMLElement { - compact: boolean; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLDirectoryElement: { - prototype: HTMLDirectoryElement; - new(): HTMLDirectoryElement; -} - -interface HTMLDivElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLDivElement: { - prototype: HTMLDivElement; - new(): HTMLDivElement; -} - -interface HTMLDocument extends Document { - addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLDocument: { - prototype: HTMLDocument; - new(): HTMLDocument; -} - -interface HTMLElementEventMap extends ElementEventMap { - "abort": UIEvent; - "activate": UIEvent; - "beforeactivate": UIEvent; - "beforecopy": ClipboardEvent; - "beforecut": ClipboardEvent; - "beforedeactivate": UIEvent; - "beforepaste": ClipboardEvent; - "blur": FocusEvent; - "canplay": Event; - "canplaythrough": Event; - "change": Event; - "click": MouseEvent; - "contextmenu": PointerEvent; - "copy": ClipboardEvent; - "cuechange": Event; - "cut": ClipboardEvent; - "dblclick": MouseEvent; - "deactivate": UIEvent; - "drag": DragEvent; - "dragend": DragEvent; - "dragenter": DragEvent; - "dragleave": DragEvent; - "dragover": DragEvent; - "dragstart": DragEvent; - "drop": DragEvent; - "durationchange": Event; - "emptied": Event; - "ended": MediaStreamErrorEvent; - "error": ErrorEvent; - "focus": FocusEvent; - "input": Event; - "invalid": Event; - "keydown": KeyboardEvent; - "keypress": KeyboardEvent; - "keyup": KeyboardEvent; - "load": Event; - "loadeddata": Event; - "loadedmetadata": Event; - "loadstart": Event; - "mousedown": MouseEvent; - "mouseenter": MouseEvent; - "mouseleave": MouseEvent; - "mousemove": MouseEvent; - "mouseout": MouseEvent; - "mouseover": MouseEvent; - "mouseup": MouseEvent; - "mousewheel": WheelEvent; - "MSContentZoom": UIEvent; - "MSManipulationStateChanged": MSManipulationEvent; - "paste": ClipboardEvent; - "pause": Event; - "play": Event; - "playing": Event; - "progress": ProgressEvent; - "ratechange": Event; - "reset": Event; - "scroll": UIEvent; - "seeked": Event; - "seeking": Event; - "select": UIEvent; - "selectstart": Event; - "stalled": Event; - "submit": Event; - "suspend": Event; - "timeupdate": Event; - "volumechange": Event; - "waiting": Event; -} - -interface HTMLElement extends Element { - accessKey: string; - readonly children: HTMLCollection; - contentEditable: string; - readonly dataset: DOMStringMap; - dir: string; - draggable: boolean; - hidden: boolean; - hideFocus: boolean; - innerHTML: string; - innerText: string; - readonly isContentEditable: boolean; - lang: string; - readonly offsetHeight: number; - readonly offsetLeft: number; - readonly offsetParent: Element; - readonly offsetTop: number; - readonly offsetWidth: number; - onabort: (this: HTMLElement, ev: UIEvent) => any; - onactivate: (this: HTMLElement, ev: UIEvent) => any; - onbeforeactivate: (this: HTMLElement, ev: UIEvent) => any; - onbeforecopy: (this: HTMLElement, ev: ClipboardEvent) => any; - onbeforecut: (this: HTMLElement, ev: ClipboardEvent) => any; - onbeforedeactivate: (this: HTMLElement, ev: UIEvent) => any; - onbeforepaste: (this: HTMLElement, ev: ClipboardEvent) => any; - onblur: (this: HTMLElement, ev: FocusEvent) => any; - oncanplay: (this: HTMLElement, ev: Event) => any; - oncanplaythrough: (this: HTMLElement, ev: Event) => any; - onchange: (this: HTMLElement, ev: Event) => any; - onclick: (this: HTMLElement, ev: MouseEvent) => any; - oncontextmenu: (this: HTMLElement, ev: PointerEvent) => any; - oncopy: (this: HTMLElement, ev: ClipboardEvent) => any; - oncuechange: (this: HTMLElement, ev: Event) => any; - oncut: (this: HTMLElement, ev: ClipboardEvent) => any; - ondblclick: (this: HTMLElement, ev: MouseEvent) => any; - ondeactivate: (this: HTMLElement, ev: UIEvent) => any; - ondrag: (this: HTMLElement, ev: DragEvent) => any; - ondragend: (this: HTMLElement, ev: DragEvent) => any; - ondragenter: (this: HTMLElement, ev: DragEvent) => any; - ondragleave: (this: HTMLElement, ev: DragEvent) => any; - ondragover: (this: HTMLElement, ev: DragEvent) => any; - ondragstart: (this: HTMLElement, ev: DragEvent) => any; - ondrop: (this: HTMLElement, ev: DragEvent) => any; - ondurationchange: (this: HTMLElement, ev: Event) => any; - onemptied: (this: HTMLElement, ev: Event) => any; - onended: (this: HTMLElement, ev: MediaStreamErrorEvent) => any; - onerror: (this: HTMLElement, ev: ErrorEvent) => any; - onfocus: (this: HTMLElement, ev: FocusEvent) => any; - oninput: (this: HTMLElement, ev: Event) => any; - oninvalid: (this: HTMLElement, ev: Event) => any; - onkeydown: (this: HTMLElement, ev: KeyboardEvent) => any; - onkeypress: (this: HTMLElement, ev: KeyboardEvent) => any; - onkeyup: (this: HTMLElement, ev: KeyboardEvent) => any; - onload: (this: HTMLElement, ev: Event) => any; - onloadeddata: (this: HTMLElement, ev: Event) => any; - onloadedmetadata: (this: HTMLElement, ev: Event) => any; - onloadstart: (this: HTMLElement, ev: Event) => any; - onmousedown: (this: HTMLElement, ev: MouseEvent) => any; - onmouseenter: (this: HTMLElement, ev: MouseEvent) => any; - onmouseleave: (this: HTMLElement, ev: MouseEvent) => any; - onmousemove: (this: HTMLElement, ev: MouseEvent) => any; - onmouseout: (this: HTMLElement, ev: MouseEvent) => any; - onmouseover: (this: HTMLElement, ev: MouseEvent) => any; - onmouseup: (this: HTMLElement, ev: MouseEvent) => any; - onmousewheel: (this: HTMLElement, ev: WheelEvent) => any; - onmscontentzoom: (this: HTMLElement, ev: UIEvent) => any; - onmsmanipulationstatechanged: (this: HTMLElement, ev: MSManipulationEvent) => any; - onpaste: (this: HTMLElement, ev: ClipboardEvent) => any; - onpause: (this: HTMLElement, ev: Event) => any; - onplay: (this: HTMLElement, ev: Event) => any; - onplaying: (this: HTMLElement, ev: Event) => any; - onprogress: (this: HTMLElement, ev: ProgressEvent) => any; - onratechange: (this: HTMLElement, ev: Event) => any; - onreset: (this: HTMLElement, ev: Event) => any; - onscroll: (this: HTMLElement, ev: UIEvent) => any; - onseeked: (this: HTMLElement, ev: Event) => any; - onseeking: (this: HTMLElement, ev: Event) => any; - onselect: (this: HTMLElement, ev: UIEvent) => any; - onselectstart: (this: HTMLElement, ev: Event) => any; - onstalled: (this: HTMLElement, ev: Event) => any; - onsubmit: (this: HTMLElement, ev: Event) => any; - onsuspend: (this: HTMLElement, ev: Event) => any; - ontimeupdate: (this: HTMLElement, ev: Event) => any; - onvolumechange: (this: HTMLElement, ev: Event) => any; - onwaiting: (this: HTMLElement, ev: Event) => any; - outerHTML: string; - outerText: string; - spellcheck: boolean; - readonly style: CSSStyleDeclaration; - tabIndex: number; - title: string; - blur(): void; - click(): void; - dragDrop(): boolean; - focus(): void; - msGetInputContext(): MSInputMethodContext; - setActive(): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLElement: { - prototype: HTMLElement; - new(): HTMLElement; -} - -interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { - /** - * Sets or retrieves the height of the object. - */ - height: string; - hidden: any; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - readonly msPlayToSource: any; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Retrieves the palette used for the embedded document. - */ - readonly palette: string; - /** - * Retrieves the URL of the plug-in used to view an embedded document. - */ - readonly pluginspage: string; - readonly readyState: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the height and width units of the embed object. - */ - units: string; - /** - * Sets or retrieves the width of the object. - */ - width: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLEmbedElement: { - prototype: HTMLEmbedElement; - new(): HTMLEmbedElement; -} - -interface HTMLFieldSetElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLFieldSetElement: { - prototype: HTMLFieldSetElement; - new(): HTMLFieldSetElement; -} - -interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLFontElement: { - prototype: HTMLFontElement; - new(): HTMLFontElement; -} - -interface HTMLFormElement extends HTMLElement { - /** - * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. - */ - acceptCharset: string; - /** - * Sets or retrieves the URL to which the form content is sent for processing. - */ - action: string; - /** - * Specifies whether autocomplete is applied to an editable text field. - */ - autocomplete: string; - /** - * Retrieves a collection, in source order, of all controls in a given form. - */ - readonly elements: HTMLCollection; - /** - * Sets or retrieves the MIME encoding for the form. - */ - encoding: string; - /** - * Sets or retrieves the encoding type for the form. - */ - enctype: string; - /** - * Sets or retrieves the number of objects in a collection. - */ - readonly length: number; - /** - * Sets or retrieves how to send the form data to the server. - */ - method: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Designates a form that is not validated when submitted. - */ - noValidate: boolean; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Retrieves a form object or an object from an elements collection. - * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. - * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. - */ - item(name?: any, index?: any): any; - /** - * Retrieves a form object or an object from an elements collection. - */ - namedItem(name: string): any; - /** - * Fires when the user resets a form. - */ - reset(): void; - /** - * Fires when a FORM is about to be submitted. - */ - submit(): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [name: string]: any; -} - -declare var HTMLFormElement: { - prototype: HTMLFormElement; - new(): HTMLFormElement; -} - -interface HTMLFrameElementEventMap extends HTMLElementEventMap { - "load": Event; -} - -interface HTMLFrameElement extends HTMLElement, GetSVGDocument { - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Retrieves the document object of the page or frame. - */ - readonly contentDocument: Document; - /** - * Retrieves the object of the specified. - */ - readonly contentWindow: Window; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves the height of the object. - */ - height: string | number; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Raised when the object has been completely received from the server. - */ - onload: (this: HTMLFrameElement, ev: Event) => any; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the width of the object. - */ - width: string | number; - addEventListener(type: K, listener: (this: HTMLFrameElement, ev: HTMLFrameElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLFrameElement: { - prototype: HTMLFrameElement; - new(): HTMLFrameElement; -} - -interface HTMLFrameSetElementEventMap extends HTMLElementEventMap { - "beforeprint": Event; - "beforeunload": BeforeUnloadEvent; - "blur": FocusEvent; - "error": ErrorEvent; - "focus": FocusEvent; - "hashchange": HashChangeEvent; - "load": Event; - "message": MessageEvent; - "offline": Event; - "online": Event; - "orientationchange": Event; - "pagehide": PageTransitionEvent; - "pageshow": PageTransitionEvent; - "resize": UIEvent; - "storage": StorageEvent; - "unload": Event; -} - -interface HTMLFrameSetElement extends HTMLElement { - border: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the frame widths of the object. - */ - cols: string; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - name: string; - onafterprint: (this: HTMLFrameSetElement, ev: Event) => any; - onbeforeprint: (this: HTMLFrameSetElement, ev: Event) => any; - onbeforeunload: (this: HTMLFrameSetElement, ev: BeforeUnloadEvent) => any; - /** - * Fires when the object loses the input focus. - */ - onblur: (this: HTMLFrameSetElement, ev: FocusEvent) => any; - onerror: (this: HTMLFrameSetElement, ev: ErrorEvent) => any; - /** - * Fires when the object receives focus. - */ - onfocus: (this: HTMLFrameSetElement, ev: FocusEvent) => any; - onhashchange: (this: HTMLFrameSetElement, ev: HashChangeEvent) => any; - onload: (this: HTMLFrameSetElement, ev: Event) => any; - onmessage: (this: HTMLFrameSetElement, ev: MessageEvent) => any; - onoffline: (this: HTMLFrameSetElement, ev: Event) => any; - ononline: (this: HTMLFrameSetElement, ev: Event) => any; - onorientationchange: (this: HTMLFrameSetElement, ev: Event) => any; - onpagehide: (this: HTMLFrameSetElement, ev: PageTransitionEvent) => any; - onpageshow: (this: HTMLFrameSetElement, ev: PageTransitionEvent) => any; - onresize: (this: HTMLFrameSetElement, ev: UIEvent) => any; - onstorage: (this: HTMLFrameSetElement, ev: StorageEvent) => any; - onunload: (this: HTMLFrameSetElement, ev: Event) => any; - /** - * Sets or retrieves the frame heights of the object. - */ - rows: string; - addEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLFrameSetElement: { - prototype: HTMLFrameSetElement; - new(): HTMLFrameSetElement; -} - -interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. - */ - noShade: boolean; - /** - * Sets or retrieves the width of the object. - */ - width: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLHRElement: { - prototype: HTMLHRElement; - new(): HTMLHRElement; -} - -interface HTMLHeadElement extends HTMLElement { - profile: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLHeadElement: { - prototype: HTMLHeadElement; - new(): HTMLHeadElement; -} - -interface HTMLHeadingElement extends HTMLElement { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLHeadingElement: { - prototype: HTMLHeadingElement; - new(): HTMLHeadingElement; -} - -interface HTMLHtmlElement extends HTMLElement { - /** - * Sets or retrieves the DTD version that governs the current document. - */ - version: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLHtmlElement: { - prototype: HTMLHtmlElement; - new(): HTMLHtmlElement; -} - -interface HTMLIFrameElementEventMap extends HTMLElementEventMap { - "load": Event; -} - -interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - allowFullscreen: boolean; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Retrieves the document object of the page or frame. - */ - readonly contentDocument: Document; - /** - * Retrieves the object of the specified. - */ - readonly contentWindow: Window; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the horizontal margin for the object. - */ - hspace: number; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Raised when the object has been completely received from the server. - */ - onload: (this: HTMLIFrameElement, ev: Event) => any; - readonly sandbox: DOMSettableTokenList; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Sets or retrieves the width of the object. - */ - width: string; - addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLIFrameElement: { - prototype: HTMLIFrameElement; - new(): HTMLIFrameElement; -} - -interface HTMLImageElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Retrieves whether the object is fully loaded. - */ - readonly complete: boolean; - crossOrigin: string; - readonly currentSrc: string; - /** - * Sets or retrieves the height of the object. - */ - height: number; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - /** - * Sets or retrieves whether the image is a server-side image map. - */ - isMap: boolean; - /** - * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. - */ - longDesc: string; - lowsrc: string; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - readonly msPlayToSource: any; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * The original height of the image resource before sizing. - */ - readonly naturalHeight: number; - /** - * The original width of the image resource before sizing. - */ - readonly naturalWidth: number; - sizes: string; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - srcset: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Sets or retrieves the width of the object. - */ - width: number; - readonly x: number; - readonly y: number; - msGetAsCastingSource(): any; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLImageElement: { - prototype: HTMLImageElement; - new(): HTMLImageElement; - create(): HTMLImageElement; -} - -interface HTMLInputElement extends HTMLElement { - /** - * Sets or retrieves a comma-separated list of content types. - */ - accept: string; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Specifies whether autocomplete is applied to an editable text field. - */ - autocomplete: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - /** - * Sets or retrieves the state of the check box or radio button. - */ - checked: boolean; - /** - * Retrieves whether the object is fully loaded. - */ - readonly complete: boolean; - /** - * Sets or retrieves the state of the check box or radio button. - */ - defaultChecked: boolean; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - disabled: boolean; - /** - * Returns a FileList object on a file type input object. - */ - readonly files: FileList | null; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. - */ - formAction: string; - /** - * Used to override the encoding (formEnctype attribute) specified on the form element. - */ - formEnctype: string; - /** - * Overrides the submit method attribute previously specified on a form element. - */ - formMethod: string; - /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. - */ - formNoValidate: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - indeterminate: boolean; - /** - * Specifies the ID of a pre-defined datalist of options for an input element. - */ - readonly list: HTMLElement; - /** - * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. - */ - max: string; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. - */ - min: string; - /** - * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. - */ - multiple: boolean; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets or sets a string containing a regular expression that the user's input must match. - */ - pattern: string; - /** - * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. - */ - placeholder: string; - readOnly: boolean; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - selectionDirection: string; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - size: number; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - status: boolean; - /** - * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. - */ - step: string; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - /** - * Returns the value of the data at the cursor's current position. - */ - value: string; - valueAsDate: Date; - /** - * Returns the input field value as a number. - */ - valueAsNumber: number; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - webkitdirectory: boolean; - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - minLength: number; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Makes the selection equal to the current object. - */ - select(): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - /** - * Sets the start and end positions of a selection in a text field. - * @param start The offset into the text field for the start of the selection. - * @param end The offset into the text field for the end of the selection. - */ - setSelectionRange(start?: number, end?: number, direction?: string): void; - /** - * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. - * @param n Value to decrement the value by. - */ - stepDown(n?: number): void; - /** - * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. - * @param n Value to increment the value by. - */ - stepUp(n?: number): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLInputElement: { - prototype: HTMLInputElement; - new(): HTMLInputElement; -} - -interface HTMLLIElement extends HTMLElement { - type: string; - /** - * Sets or retrieves the value of a list item. - */ - value: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLLIElement: { - prototype: HTMLLIElement; - new(): HTMLLIElement; -} - -interface HTMLLabelElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the object to which the given label object is assigned. - */ - htmlFor: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLLabelElement: { - prototype: HTMLLabelElement; - new(): HTMLLabelElement; -} - -interface HTMLLegendElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - align: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLLegendElement: { - prototype: HTMLLegendElement; - new(): HTMLLegendElement; -} - -interface HTMLLinkElement extends HTMLElement, LinkStyle { - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - disabled: boolean; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; - /** - * Sets or retrieves the media type. - */ - media: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves the MIME type of the object. - */ - type: string; - import?: Document; - integrity: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLLinkElement: { - prototype: HTMLLinkElement; - new(): HTMLLinkElement; -} - -interface HTMLMapElement extends HTMLElement { - /** - * Retrieves a collection of the area objects defined for the given map object. - */ - readonly areas: HTMLAreasCollection; - /** - * Sets or retrieves the name of the object. - */ - name: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMapElement: { - prototype: HTMLMapElement; - new(): HTMLMapElement; -} - -interface HTMLMarqueeElementEventMap extends HTMLElementEventMap { - "bounce": Event; - "finish": Event; - "start": Event; -} - -interface HTMLMarqueeElement extends HTMLElement { - behavior: string; - bgColor: any; - direction: string; - height: string; - hspace: number; - loop: number; - onbounce: (this: HTMLMarqueeElement, ev: Event) => any; - onfinish: (this: HTMLMarqueeElement, ev: Event) => any; - onstart: (this: HTMLMarqueeElement, ev: Event) => any; - scrollAmount: number; - scrollDelay: number; - trueSpeed: boolean; - vspace: number; - width: string; - start(): void; - stop(): void; - addEventListener(type: K, listener: (this: HTMLMarqueeElement, ev: HTMLMarqueeElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMarqueeElement: { - prototype: HTMLMarqueeElement; - new(): HTMLMarqueeElement; -} - -interface HTMLMediaElementEventMap extends HTMLElementEventMap { - "encrypted": MediaEncryptedEvent; - "msneedkey": MSMediaKeyNeededEvent; -} - -interface HTMLMediaElement extends HTMLElement { - /** - * Returns an AudioTrackList object with the audio tracks for a given video element. - */ - readonly audioTracks: AudioTrackList; - /** - * Gets or sets a value that indicates whether to start playing the media automatically. - */ - autoplay: boolean; - /** - * Gets a collection of buffered time ranges. - */ - readonly buffered: TimeRanges; - /** - * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). - */ - controls: boolean; - crossOrigin: string; - /** - * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. - */ - readonly currentSrc: string; - /** - * Gets or sets the current playback position, in seconds. - */ - currentTime: number; - defaultMuted: boolean; - /** - * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. - */ - defaultPlaybackRate: number; - /** - * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. - */ - readonly duration: number; - /** - * Gets information about whether the playback has ended or not. - */ - readonly ended: boolean; - /** - * Returns an object representing the current error state of the audio or video element. - */ - readonly error: MediaError; - /** - * Gets or sets a flag to specify whether playback should restart after it completes. - */ - loop: boolean; - readonly mediaKeys: MediaKeys | null; - /** - * Specifies the purpose of the audio or video media, such as background audio or alerts. - */ - msAudioCategory: string; - /** - * Specifies the output device id that the audio will be sent to. - */ - msAudioDeviceType: string; - readonly msGraphicsTrustStatus: MSGraphicsTrust; - /** - * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. - */ - readonly msKeys: MSMediaKeys; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - readonly msPlayToSource: any; - /** - * Specifies whether or not to enable low-latency playback on the media element. - */ - msRealTime: boolean; - /** - * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. - */ - muted: boolean; - /** - * Gets the current network activity for the element. - */ - readonly networkState: number; - onencrypted: (this: HTMLMediaElement, ev: MediaEncryptedEvent) => any; - onmsneedkey: (this: HTMLMediaElement, ev: MSMediaKeyNeededEvent) => any; - /** - * Gets a flag that specifies whether playback is paused. - */ - readonly paused: boolean; - /** - * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. - */ - playbackRate: number; - /** - * Gets TimeRanges for the current media resource that has been played. - */ - readonly played: TimeRanges; - /** - * Gets or sets the current playback position, in seconds. - */ - preload: string; - readyState: number; - /** - * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. - */ - readonly seekable: TimeRanges; - /** - * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. - */ - readonly seeking: boolean; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - srcObject: MediaStream | null; - readonly textTracks: TextTrackList; - readonly videoTracks: VideoTrackList; - /** - * Gets or sets the volume level for audio portions of the media element. - */ - volume: number; - addTextTrack(kind: string, label?: string, language?: string): TextTrack; - /** - * Returns a string that specifies whether the client can play a given media resource type. - */ - canPlayType(type: string): string; - /** - * Resets the audio or video object and loads a new media resource. - */ - load(): void; - /** - * Clears all effects from the media pipeline. - */ - msClearEffects(): void; - msGetAsCastingSource(): any; - /** - * Inserts the specified audio effect into media pipeline. - */ - msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetMediaKeys(mediaKeys: MSMediaKeys): void; - /** - * Specifies the media protection manager for a given media pipeline. - */ - msSetMediaProtectionManager(mediaProtectionManager?: any): void; - /** - * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. - */ - pause(): void; - /** - * Loads and starts playback of a media resource. - */ - play(): void; - setMediaKeys(mediaKeys: MediaKeys | null): PromiseLike; - readonly HAVE_CURRENT_DATA: number; - readonly HAVE_ENOUGH_DATA: number; - readonly HAVE_FUTURE_DATA: number; - readonly HAVE_METADATA: number; - readonly HAVE_NOTHING: number; - readonly NETWORK_EMPTY: number; - readonly NETWORK_IDLE: number; - readonly NETWORK_LOADING: number; - readonly NETWORK_NO_SOURCE: number; - addEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMediaElement: { - prototype: HTMLMediaElement; - new(): HTMLMediaElement; - readonly HAVE_CURRENT_DATA: number; - readonly HAVE_ENOUGH_DATA: number; - readonly HAVE_FUTURE_DATA: number; - readonly HAVE_METADATA: number; - readonly HAVE_NOTHING: number; - readonly NETWORK_EMPTY: number; - readonly NETWORK_IDLE: number; - readonly NETWORK_LOADING: number; - readonly NETWORK_NO_SOURCE: number; -} - -interface HTMLMenuElement extends HTMLElement { - compact: boolean; - type: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMenuElement: { - prototype: HTMLMenuElement; - new(): HTMLMenuElement; -} - -interface HTMLMetaElement extends HTMLElement { - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Gets or sets meta-information to associate with httpEquiv or name. - */ - content: string; - /** - * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. - */ - httpEquiv: string; - /** - * Sets or retrieves the value specified in the content attribute of the meta object. - */ - name: string; - /** - * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. - */ - scheme: string; - /** - * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. - */ - url: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMetaElement: { - prototype: HTMLMetaElement; - new(): HTMLMetaElement; -} - -interface HTMLMeterElement extends HTMLElement { - high: number; - low: number; - max: number; - min: number; - optimum: number; - value: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMeterElement: { - prototype: HTMLMeterElement; - new(): HTMLMeterElement; -} - -interface HTMLModElement extends HTMLElement { - /** - * Sets or retrieves reference information about the object. - */ - cite: string; - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLModElement: { - prototype: HTMLModElement; - new(): HTMLModElement; -} - -interface HTMLOListElement extends HTMLElement { - compact: boolean; - /** - * The starting number. - */ - start: number; - type: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLOListElement: { - prototype: HTMLOListElement; - new(): HTMLOListElement; -} - -interface HTMLObjectElement extends HTMLElement, GetSVGDocument { - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - readonly BaseHref: string; - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. - */ - altHtml: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - border: string; - /** - * Sets or retrieves the URL of the file containing the compiled Java class. - */ - code: string; - /** - * Sets or retrieves the URL of the component. - */ - codeBase: string; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - /** - * Retrieves the document object of the page or frame. - */ - readonly contentDocument: Document; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; - declare: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the height of the object. - */ - height: string; - hspace: number; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - readonly msPlayToSource: any; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Retrieves the contained object. - */ - readonly object: any; - readonly readyState: number; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Sets or retrieves the MIME type of the object. - */ - type: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - vspace: number; - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLObjectElement: { - prototype: HTMLObjectElement; - new(): HTMLObjectElement; -} - -interface HTMLOptGroupElement extends HTMLElement { - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the ordinal position of an option in a list box. - */ - readonly index: number; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; - /** - * Sets or retrieves the text string specified by the option tag. - */ - readonly text: string; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLOptGroupElement: { - prototype: HTMLOptGroupElement; - new(): HTMLOptGroupElement; -} - -interface HTMLOptionElement extends HTMLElement { - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the ordinal position of an option in a list box. - */ - readonly index: number; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; - /** - * Sets or retrieves the text string specified by the option tag. - */ - text: string; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLOptionElement: { - prototype: HTMLOptionElement; - new(): HTMLOptionElement; - create(): HTMLOptionElement; -} - -interface HTMLOptionsCollection extends HTMLCollectionOf { - length: number; - selectedIndex: number; - add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number): void; - remove(index: number): void; -} - -declare var HTMLOptionsCollection: { - prototype: HTMLOptionsCollection; - new(): HTMLOptionsCollection; -} - -interface HTMLParagraphElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - clear: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLParagraphElement: { - prototype: HTMLParagraphElement; - new(): HTMLParagraphElement; -} - -interface HTMLParamElement extends HTMLElement { - /** - * Sets or retrieves the name of an input parameter for an element. - */ - name: string; - /** - * Sets or retrieves the content type of the resource designated by the value attribute. - */ - type: string; - /** - * Sets or retrieves the value of an input parameter for an element. - */ - value: string; - /** - * Sets or retrieves the data type of the value attribute. - */ - valueType: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLParamElement: { - prototype: HTMLParamElement; - new(): HTMLParamElement; -} - -interface HTMLPictureElement extends HTMLElement { - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLPictureElement: { - prototype: HTMLPictureElement; - new(): HTMLPictureElement; -} - -interface HTMLPreElement extends HTMLElement { - /** - * Sets or gets a value that you can use to implement your own width functionality for the object. - */ - width: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLPreElement: { - prototype: HTMLPreElement; - new(): HTMLPreElement; -} - -interface HTMLProgressElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Defines the maximum, or "done" value for a progress element. - */ - max: number; - /** - * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). - */ - readonly position: number; - /** - * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. - */ - value: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLProgressElement: { - prototype: HTMLProgressElement; - new(): HTMLProgressElement; -} - -interface HTMLQuoteElement extends HTMLElement { - /** - * Sets or retrieves reference information about the object. - */ - cite: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLQuoteElement: { - prototype: HTMLQuoteElement; - new(): HTMLQuoteElement; -} - -interface HTMLScriptElement extends HTMLElement { - async: boolean; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the status of the script. - */ - defer: boolean; - /** - * Sets or retrieves the event for which the script is written. - */ - event: string; - /** - * Sets or retrieves the object that is bound to the event script. - */ - htmlFor: string; - /** - * Retrieves the URL to an external file that contains the source code or data. - */ - src: string; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - /** - * Sets or retrieves the MIME type for the associated scripting engine. - */ - type: string; - integrity: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLScriptElement: { - prototype: HTMLScriptElement; - new(): HTMLScriptElement; -} - -interface HTMLSelectElement extends HTMLElement { - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. - */ - multiple: boolean; - /** - * Sets or retrieves the name of the object. - */ - name: string; - readonly options: HTMLOptionsCollection; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Sets or retrieves the index of the selected option in a select object. - */ - selectedIndex: number; - selectedOptions: HTMLCollectionOf; - /** - * Sets or retrieves the number of rows in the list box. - */ - size: number; - /** - * Retrieves the type of select control based on the value of the MULTIPLE attribute. - */ - readonly type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - /** - * Adds an element to the areas, controlRange, or options collection. - * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. - * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection. - */ - add(element: HTMLElement, before?: HTMLElement | number): void; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Retrieves a select object or an object from an options collection. - * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. - * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. - */ - item(name?: any, index?: any): any; - /** - * Retrieves a select object or an object from an options collection. - * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made. - */ - namedItem(name: string): any; - /** - * Removes an element from the collection. - * @param index Number that specifies the zero-based index of the element to remove from the collection. - */ - remove(index?: number): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [name: string]: any; -} - -declare var HTMLSelectElement: { - prototype: HTMLSelectElement; - new(): HTMLSelectElement; -} - -interface HTMLSourceElement extends HTMLElement { - /** - * Gets or sets the intended media type of the media source. - */ - media: string; - msKeySystem: string; - sizes: string; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - srcset: string; - /** - * Gets or sets the MIME type of a media resource. - */ - type: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLSourceElement: { - prototype: HTMLSourceElement; - new(): HTMLSourceElement; -} - -interface HTMLSpanElement extends HTMLElement { - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLSpanElement: { - prototype: HTMLSpanElement; - new(): HTMLSpanElement; -} - -interface HTMLStyleElement extends HTMLElement, LinkStyle { - disabled: boolean; - /** - * Sets or retrieves the media type. - */ - media: string; - /** - * Retrieves the CSS language in which the style sheet is written. - */ - type: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLStyleElement: { - prototype: HTMLStyleElement; - new(): HTMLStyleElement; -} - -interface HTMLTableCaptionElement extends HTMLElement { - /** - * Sets or retrieves the alignment of the caption or legend. - */ - align: string; - /** - * Sets or retrieves whether the caption appears at the top or bottom of the table. - */ - vAlign: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableCaptionElement: { - prototype: HTMLTableCaptionElement; - new(): HTMLTableCaptionElement; -} - -interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves abbreviated text for the object. - */ - abbr: string; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. - */ - axis: string; - bgColor: any; - /** - * Retrieves the position of the object in the cells collection of a row. - */ - readonly cellIndex: number; - /** - * Sets or retrieves the number columns in the table that the object should span. - */ - colSpan: number; - /** - * Sets or retrieves a list of header cells that provide information for the object. - */ - headers: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; - /** - * Sets or retrieves how many rows in a table the cell should span. - */ - rowSpan: number; - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; - /** - * Sets or retrieves the width of the object. - */ - width: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableCellElement: { - prototype: HTMLTableCellElement; - new(): HTMLTableCellElement; -} - -interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves the alignment of the object relative to the display or table. - */ - align: string; - /** - * Sets or retrieves the number of columns in the group. - */ - span: number; - /** - * Sets or retrieves the width of the object. - */ - width: any; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableColElement: { - prototype: HTMLTableColElement; - new(): HTMLTableColElement; -} - -interface HTMLTableDataCellElement extends HTMLTableCellElement { -} - -declare var HTMLTableDataCellElement: { - prototype: HTMLTableDataCellElement; - new(): HTMLTableDataCellElement; -} - -interface HTMLTableElement extends HTMLElement { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - bgColor: any; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Retrieves the caption object of a table. - */ - caption: HTMLTableCaptionElement; - /** - * Sets or retrieves the amount of space between the border of the cell and the content of the cell. - */ - cellPadding: string; - /** - * Sets or retrieves the amount of space between cells in a table. - */ - cellSpacing: string; - /** - * Sets or retrieves the number of columns in the table. - */ - cols: number; - /** - * Sets or retrieves the way the border frame around the table is displayed. - */ - frame: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: HTMLCollectionOf; - /** - * Sets or retrieves which dividing lines (inner borders) are displayed. - */ - rules: string; - /** - * Sets or retrieves a description and/or structure of the object. - */ - summary: string; - /** - * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. - */ - tBodies: HTMLCollectionOf; - /** - * Retrieves the tFoot object of the table. - */ - tFoot: HTMLTableSectionElement; - /** - * Retrieves the tHead object of the table. - */ - tHead: HTMLTableSectionElement; - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Creates an empty caption element in the table. - */ - createCaption(): HTMLTableCaptionElement; - /** - * Creates an empty tBody element in the table. - */ - createTBody(): HTMLTableSectionElement; - /** - * Creates an empty tFoot element in the table. - */ - createTFoot(): HTMLTableSectionElement; - /** - * Returns the tHead element object if successful, or null otherwise. - */ - createTHead(): HTMLTableSectionElement; - /** - * Deletes the caption element and its contents from the table. - */ - deleteCaption(): void; - /** - * Removes the specified row (tr) from the element and from the rows collection. - * @param index Number that specifies the zero-based position in the rows collection of the row to remove. - */ - deleteRow(index?: number): void; - /** - * Deletes the tFoot element and its contents from the table. - */ - deleteTFoot(): void; - /** - * Deletes the tHead element and its contents from the table. - */ - deleteTHead(): void; - /** - * Creates a new row (tr) in the table, and adds the row to the rows collection. - * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. - */ - insertRow(index?: number): HTMLTableRowElement; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableElement: { - prototype: HTMLTableElement; - new(): HTMLTableElement; -} - -interface HTMLTableHeaderCellElement extends HTMLTableCellElement { - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; -} - -declare var HTMLTableHeaderCellElement: { - prototype: HTMLTableHeaderCellElement; - new(): HTMLTableHeaderCellElement; -} - -interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - bgColor: any; - /** - * Retrieves a collection of all cells in the table row. - */ - cells: HTMLCollectionOf; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Retrieves the position of the object in the rows collection for the table. - */ - readonly rowIndex: number; - /** - * Retrieves the position of the object in the collection. - */ - readonly sectionRowIndex: number; - /** - * Removes the specified cell from the table row, as well as from the cells collection. - * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted. - */ - deleteCell(index?: number): void; - /** - * Creates a new cell in the table row, and adds the cell to the cells collection. - * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. - */ - insertCell(index?: number): HTMLTableDataCellElement; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableRowElement: { - prototype: HTMLTableRowElement; - new(): HTMLTableRowElement; -} - -interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: HTMLCollectionOf; - /** - * Removes the specified row (tr) from the element and from the rows collection. - * @param index Number that specifies the zero-based position in the rows collection of the row to remove. - */ - deleteRow(index?: number): void; - /** - * Creates a new row (tr) in the table, and adds the row to the rows collection. - * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. - */ - insertRow(index?: number): HTMLTableRowElement; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableSectionElement: { - prototype: HTMLTableSectionElement; - new(): HTMLTableSectionElement; -} - -interface HTMLTemplateElement extends HTMLElement { - readonly content: DocumentFragment; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTemplateElement: { - prototype: HTMLTemplateElement; - new(): HTMLTemplateElement; -} - -interface HTMLTextAreaElement extends HTMLElement { - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Sets or retrieves the width of the object. - */ - cols: number; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - readonly form: HTMLFormElement; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. - */ - placeholder: string; - /** - * Sets or retrieves the value indicated whether the content of the object is read-only. - */ - readOnly: boolean; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: number; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - /** - * Sets or retrieves the value indicating whether the control is selected. - */ - status: any; - /** - * Retrieves the type of control. - */ - readonly type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - readonly validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - readonly validity: ValidityState; - /** - * Retrieves or sets the text in the entry field of the textArea element. - */ - value: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - readonly willValidate: boolean; - /** - * Sets or retrieves how to handle wordwrapping in the object. - */ - wrap: string; - minLength: number; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Highlights the input area of a form element. - */ - select(): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - /** - * Sets the start and end positions of a selection in a text field. - * @param start The offset into the text field for the start of the selection. - * @param end The offset into the text field for the end of the selection. - */ - setSelectionRange(start: number, end: number): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTextAreaElement: { - prototype: HTMLTextAreaElement; - new(): HTMLTextAreaElement; -} - -interface HTMLTitleElement extends HTMLElement { - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTitleElement: { - prototype: HTMLTitleElement; - new(): HTMLTitleElement; -} - -interface HTMLTrackElement extends HTMLElement { - default: boolean; - kind: string; - label: string; - readonly readyState: number; - src: string; - srclang: string; - readonly track: TextTrack; - readonly ERROR: number; - readonly LOADED: number; - readonly LOADING: number; - readonly NONE: number; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTrackElement: { - prototype: HTMLTrackElement; - new(): HTMLTrackElement; - readonly ERROR: number; - readonly LOADED: number; - readonly LOADING: number; - readonly NONE: number; -} - -interface HTMLUListElement extends HTMLElement { - compact: boolean; - type: string; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLUListElement: { - prototype: HTMLUListElement; - new(): HTMLUListElement; -} - -interface HTMLUnknownElement extends HTMLElement { - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLUnknownElement: { - prototype: HTMLUnknownElement; - new(): HTMLUnknownElement; -} - -interface HTMLVideoElementEventMap extends HTMLMediaElementEventMap { - "MSVideoFormatChanged": Event; - "MSVideoFrameStepCompleted": Event; - "MSVideoOptimalLayoutChanged": Event; -} - -interface HTMLVideoElement extends HTMLMediaElement { - /** - * Gets or sets the height of the video element. - */ - height: number; - msHorizontalMirror: boolean; - readonly msIsLayoutOptimalForPlayback: boolean; - readonly msIsStereo3D: boolean; - msStereo3DPackingMode: string; - msStereo3DRenderMode: string; - msZoom: boolean; - onMSVideoFormatChanged: (this: HTMLVideoElement, ev: Event) => any; - onMSVideoFrameStepCompleted: (this: HTMLVideoElement, ev: Event) => any; - onMSVideoOptimalLayoutChanged: (this: HTMLVideoElement, ev: Event) => any; - /** - * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. - */ - poster: string; - /** - * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. - */ - readonly videoHeight: number; - /** - * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. - */ - readonly videoWidth: number; - readonly webkitDisplayingFullscreen: boolean; - readonly webkitSupportsFullscreen: boolean; - /** - * Gets or sets the width of the video element. - */ - width: number; - getVideoPlaybackQuality(): VideoPlaybackQuality; - msFrameStep(forward: boolean): void; - msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; - webkitEnterFullScreen(): void; - webkitEnterFullscreen(): void; - webkitExitFullScreen(): void; - webkitExitFullscreen(): void; - addEventListener(type: K, listener: (this: HTMLVideoElement, ev: HTMLVideoElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLVideoElement: { - prototype: HTMLVideoElement; - new(): HTMLVideoElement; -} - -interface HashChangeEvent extends Event { - readonly newURL: string | null; - readonly oldURL: string | null; -} - -declare var HashChangeEvent: { - prototype: HashChangeEvent; - new(type: string, eventInitDict?: HashChangeEventInit): HashChangeEvent; -} - -interface History { - readonly length: number; - readonly state: any; - scrollRestoration: ScrollRestoration; - back(): void; - forward(): void; - go(delta?: number): void; - pushState(data: any, title: string, url?: string | null): void; - replaceState(data: any, title: string, url?: string | null): void; -} - -declare var History: { - prototype: History; - new(): History; -} - -interface IDBCursor { - readonly direction: string; - key: IDBKeyRange | IDBValidKey; - readonly primaryKey: any; - source: IDBObjectStore | IDBIndex; - advance(count: number): void; - continue(key?: IDBKeyRange | IDBValidKey): void; - delete(): IDBRequest; - update(value: any): IDBRequest; - readonly NEXT: string; - readonly NEXT_NO_DUPLICATE: string; - readonly PREV: string; - readonly PREV_NO_DUPLICATE: string; -} - -declare var IDBCursor: { - prototype: IDBCursor; - new(): IDBCursor; - readonly NEXT: string; - readonly NEXT_NO_DUPLICATE: string; - readonly PREV: string; - readonly PREV_NO_DUPLICATE: string; -} - -interface IDBCursorWithValue extends IDBCursor { - readonly value: any; -} - -declare var IDBCursorWithValue: { - prototype: IDBCursorWithValue; - new(): IDBCursorWithValue; -} - -interface IDBDatabaseEventMap { - "abort": Event; - "error": ErrorEvent; -} - -interface IDBDatabase extends EventTarget { - readonly name: string; - readonly objectStoreNames: DOMStringList; - onabort: (this: IDBDatabase, ev: Event) => any; - onerror: (this: IDBDatabase, ev: ErrorEvent) => any; - version: number; - onversionchange: (ev: IDBVersionChangeEvent) => any; - close(): void; - createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore; - deleteObjectStore(name: string): void; - transaction(storeNames: string | string[], mode?: string): IDBTransaction; - addEventListener(type: "versionchange", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBDatabase: { - prototype: IDBDatabase; - new(): IDBDatabase; -} - -interface IDBFactory { - cmp(first: any, second: any): number; - deleteDatabase(name: string): IDBOpenDBRequest; - open(name: string, version?: number): IDBOpenDBRequest; -} - -declare var IDBFactory: { - prototype: IDBFactory; - new(): IDBFactory; -} - -interface IDBIndex { - keyPath: string | string[]; - readonly name: string; - readonly objectStore: IDBObjectStore; - readonly unique: boolean; - multiEntry: boolean; - count(key?: IDBKeyRange | IDBValidKey): IDBRequest; - get(key: IDBKeyRange | IDBValidKey): IDBRequest; - getKey(key: IDBKeyRange | IDBValidKey): IDBRequest; - openCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; - openKeyCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; -} - -declare var IDBIndex: { - prototype: IDBIndex; - new(): IDBIndex; -} - -interface IDBKeyRange { - readonly lower: any; - readonly lowerOpen: boolean; - readonly upper: any; - readonly upperOpen: boolean; -} - -declare var IDBKeyRange: { - prototype: IDBKeyRange; - new(): IDBKeyRange; - bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; - lowerBound(lower: any, open?: boolean): IDBKeyRange; - only(value: any): IDBKeyRange; - upperBound(upper: any, open?: boolean): IDBKeyRange; -} - -interface IDBObjectStore { - readonly indexNames: DOMStringList; - keyPath: string | string[]; - readonly name: string; - readonly transaction: IDBTransaction; - autoIncrement: boolean; - add(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest; - clear(): IDBRequest; - count(key?: IDBKeyRange | IDBValidKey): IDBRequest; - createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex; - delete(key: IDBKeyRange | IDBValidKey): IDBRequest; - deleteIndex(indexName: string): void; - get(key: any): IDBRequest; - index(name: string): IDBIndex; - openCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; - put(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest; -} - -declare var IDBObjectStore: { - prototype: IDBObjectStore; - new(): IDBObjectStore; -} - -interface IDBOpenDBRequestEventMap extends IDBRequestEventMap { - "blocked": Event; - "upgradeneeded": IDBVersionChangeEvent; -} - -interface IDBOpenDBRequest extends IDBRequest { - onblocked: (this: IDBOpenDBRequest, ev: Event) => any; - onupgradeneeded: (this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any; - addEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBOpenDBRequest: { - prototype: IDBOpenDBRequest; - new(): IDBOpenDBRequest; -} - -interface IDBRequestEventMap { - "error": ErrorEvent; - "success": Event; -} - -interface IDBRequest extends EventTarget { - readonly error: DOMError; - onerror: (this: IDBRequest, ev: ErrorEvent) => any; - onsuccess: (this: IDBRequest, ev: Event) => any; - readonly readyState: string; - readonly result: any; - source: IDBObjectStore | IDBIndex | IDBCursor; - readonly transaction: IDBTransaction; - addEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBRequest: { - prototype: IDBRequest; - new(): IDBRequest; -} - -interface IDBTransactionEventMap { - "abort": Event; - "complete": Event; - "error": ErrorEvent; -} - -interface IDBTransaction extends EventTarget { - readonly db: IDBDatabase; - readonly error: DOMError; - readonly mode: string; - onabort: (this: IDBTransaction, ev: Event) => any; - oncomplete: (this: IDBTransaction, ev: Event) => any; - onerror: (this: IDBTransaction, ev: ErrorEvent) => any; - abort(): void; - objectStore(name: string): IDBObjectStore; - readonly READ_ONLY: string; - readonly READ_WRITE: string; - readonly VERSION_CHANGE: string; - addEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBTransaction: { - prototype: IDBTransaction; - new(): IDBTransaction; - readonly READ_ONLY: string; - readonly READ_WRITE: string; - readonly VERSION_CHANGE: string; -} - -interface IDBVersionChangeEvent extends Event { - readonly newVersion: number | null; - readonly oldVersion: number; -} - -declare var IDBVersionChangeEvent: { - prototype: IDBVersionChangeEvent; - new(): IDBVersionChangeEvent; -} - -interface ImageData { - data: Uint8ClampedArray; - readonly height: number; - readonly width: number; -} - -declare var ImageData: { - prototype: ImageData; - new(width: number, height: number): ImageData; - new(array: Uint8ClampedArray, width: number, height: number): ImageData; -} - -interface KeyboardEvent extends UIEvent { - readonly altKey: boolean; - readonly char: string | null; - readonly charCode: number; - readonly ctrlKey: boolean; - readonly key: string; - readonly keyCode: number; - readonly locale: string; - readonly location: number; - readonly metaKey: boolean; - readonly repeat: boolean; - readonly shiftKey: boolean; - readonly which: number; - readonly code: string; - getModifierState(keyArg: string): boolean; - initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; - readonly DOM_KEY_LOCATION_JOYSTICK: number; - readonly DOM_KEY_LOCATION_LEFT: number; - readonly DOM_KEY_LOCATION_MOBILE: number; - readonly DOM_KEY_LOCATION_NUMPAD: number; - readonly DOM_KEY_LOCATION_RIGHT: number; - readonly DOM_KEY_LOCATION_STANDARD: number; -} - -declare var KeyboardEvent: { - prototype: KeyboardEvent; - new(typeArg: string, eventInitDict?: KeyboardEventInit): KeyboardEvent; - readonly DOM_KEY_LOCATION_JOYSTICK: number; - readonly DOM_KEY_LOCATION_LEFT: number; - readonly DOM_KEY_LOCATION_MOBILE: number; - readonly DOM_KEY_LOCATION_NUMPAD: number; - readonly DOM_KEY_LOCATION_RIGHT: number; - readonly DOM_KEY_LOCATION_STANDARD: number; -} - -interface ListeningStateChangedEvent extends Event { - readonly label: string; - readonly state: string; -} - -declare var ListeningStateChangedEvent: { - prototype: ListeningStateChangedEvent; - new(): ListeningStateChangedEvent; -} - -interface Location { - hash: string; - host: string; - hostname: string; - href: string; - readonly origin: string; - pathname: string; - port: string; - protocol: string; - search: string; - assign(url: string): void; - reload(forcedReload?: boolean): void; - replace(url: string): void; - toString(): string; -} - -declare var Location: { - prototype: Location; - new(): Location; -} - -interface LongRunningScriptDetectedEvent extends Event { - readonly executionTime: number; - stopPageScriptExecution: boolean; -} - -declare var LongRunningScriptDetectedEvent: { - prototype: LongRunningScriptDetectedEvent; - new(): LongRunningScriptDetectedEvent; -} - -interface MSApp { - clearTemporaryWebDataAsync(): MSAppAsyncOperation; - createBlobFromRandomAccessStream(type: string, seeker: any): Blob; - createDataPackage(object: any): any; - createDataPackageFromSelection(): any; - createFileFromStorageFile(storageFile: any): File; - createStreamFromInputStream(type: string, inputStream: any): MSStream; - execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; - execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; - getCurrentPriority(): string; - getHtmlPrintDocumentSourceAsync(htmlDoc: any): PromiseLike; - getViewId(view: any): any; - isTaskScheduledAtPriorityOrHigher(priority: string): boolean; - pageHandlesAllApplicationActivations(enabled: boolean): void; - suppressSubdownloadCredentialPrompts(suppress: boolean): void; - terminateApp(exceptionObject: any): void; - readonly CURRENT: string; - readonly HIGH: string; - readonly IDLE: string; - readonly NORMAL: string; -} -declare var MSApp: MSApp; - -interface MSAppAsyncOperationEventMap { - "complete": Event; - "error": ErrorEvent; -} - -interface MSAppAsyncOperation extends EventTarget { - readonly error: DOMError; - oncomplete: (this: MSAppAsyncOperation, ev: Event) => any; - onerror: (this: MSAppAsyncOperation, ev: ErrorEvent) => any; - readonly readyState: number; - readonly result: any; - start(): void; - readonly COMPLETED: number; - readonly ERROR: number; - readonly STARTED: number; - addEventListener(type: K, listener: (this: MSAppAsyncOperation, ev: MSAppAsyncOperationEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSAppAsyncOperation: { - prototype: MSAppAsyncOperation; - new(): MSAppAsyncOperation; - readonly COMPLETED: number; - readonly ERROR: number; - readonly STARTED: number; -} - -interface MSAssertion { - readonly id: string; - readonly type: string; -} - -declare var MSAssertion: { - prototype: MSAssertion; - new(): MSAssertion; -} - -interface MSBlobBuilder { - append(data: any, endings?: string): void; - getBlob(contentType?: string): Blob; -} - -declare var MSBlobBuilder: { - prototype: MSBlobBuilder; - new(): MSBlobBuilder; -} - -interface MSCredentials { - getAssertion(challenge: string, filter?: MSCredentialFilter, params?: MSSignatureParameters): PromiseLike; - makeCredential(accountInfo: MSAccountInfo, params: MSCredentialParameters[], challenge?: string): PromiseLike; -} - -declare var MSCredentials: { - prototype: MSCredentials; - new(): MSCredentials; -} - -interface MSFIDOCredentialAssertion extends MSAssertion { - readonly algorithm: string | Algorithm; - readonly attestation: any; - readonly publicKey: string; - readonly transportHints: string[]; -} - -declare var MSFIDOCredentialAssertion: { - prototype: MSFIDOCredentialAssertion; - new(): MSFIDOCredentialAssertion; -} - -interface MSFIDOSignature { - readonly authnrData: string; - readonly clientData: string; - readonly signature: string; -} - -declare var MSFIDOSignature: { - prototype: MSFIDOSignature; - new(): MSFIDOSignature; -} - -interface MSFIDOSignatureAssertion extends MSAssertion { - readonly signature: MSFIDOSignature; -} - -declare var MSFIDOSignatureAssertion: { - prototype: MSFIDOSignatureAssertion; - new(): MSFIDOSignatureAssertion; -} - -interface MSGesture { - target: Element; - addPointer(pointerId: number): void; - stop(): void; -} - -declare var MSGesture: { - prototype: MSGesture; - new(): MSGesture; -} - -interface MSGestureEvent extends UIEvent { - readonly clientX: number; - readonly clientY: number; - readonly expansion: number; - readonly gestureObject: any; - readonly hwTimestamp: number; - readonly offsetX: number; - readonly offsetY: number; - readonly rotation: number; - readonly scale: number; - readonly screenX: number; - readonly screenY: number; - readonly translationX: number; - readonly translationY: number; - readonly velocityAngular: number; - readonly velocityExpansion: number; - readonly velocityX: number; - readonly velocityY: number; - initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; - readonly MSGESTURE_FLAG_BEGIN: number; - readonly MSGESTURE_FLAG_CANCEL: number; - readonly MSGESTURE_FLAG_END: number; - readonly MSGESTURE_FLAG_INERTIA: number; - readonly MSGESTURE_FLAG_NONE: number; -} - -declare var MSGestureEvent: { - prototype: MSGestureEvent; - new(): MSGestureEvent; - readonly MSGESTURE_FLAG_BEGIN: number; - readonly MSGESTURE_FLAG_CANCEL: number; - readonly MSGESTURE_FLAG_END: number; - readonly MSGESTURE_FLAG_INERTIA: number; - readonly MSGESTURE_FLAG_NONE: number; -} - -interface MSGraphicsTrust { - readonly constrictionActive: boolean; - readonly status: string; -} - -declare var MSGraphicsTrust: { - prototype: MSGraphicsTrust; - new(): MSGraphicsTrust; -} - -interface MSHTMLWebViewElement extends HTMLElement { - readonly canGoBack: boolean; - readonly canGoForward: boolean; - readonly containsFullScreenElement: boolean; - readonly documentTitle: string; - height: number; - readonly settings: MSWebViewSettings; - src: string; - width: number; - addWebAllowedObject(name: string, applicationObject: any): void; - buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; - capturePreviewToBlobAsync(): MSWebViewAsyncOperation; - captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; - getDeferredPermissionRequestById(id: number): DeferredPermissionRequest; - getDeferredPermissionRequests(): DeferredPermissionRequest[]; - goBack(): void; - goForward(): void; - invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; - navigate(uri: string): void; - navigateToLocalStreamUri(source: string, streamResolver: any): void; - navigateToString(contents: string): void; - navigateWithHttpRequestMessage(requestMessage: any): void; - refresh(): void; - stop(): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSHTMLWebViewElement: { - prototype: MSHTMLWebViewElement; - new(): MSHTMLWebViewElement; -} - -interface MSInputMethodContextEventMap { - "MSCandidateWindowHide": Event; - "MSCandidateWindowShow": Event; - "MSCandidateWindowUpdate": Event; -} - -interface MSInputMethodContext extends EventTarget { - readonly compositionEndOffset: number; - readonly compositionStartOffset: number; - oncandidatewindowhide: (this: MSInputMethodContext, ev: Event) => any; - oncandidatewindowshow: (this: MSInputMethodContext, ev: Event) => any; - oncandidatewindowupdate: (this: MSInputMethodContext, ev: Event) => any; - readonly target: HTMLElement; - getCandidateWindowClientRect(): ClientRect; - getCompositionAlternatives(): string[]; - hasComposition(): boolean; - isCandidateWindowVisible(): boolean; - addEventListener(type: K, listener: (this: MSInputMethodContext, ev: MSInputMethodContextEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSInputMethodContext: { - prototype: MSInputMethodContext; - new(): MSInputMethodContext; -} - -interface MSManipulationEvent extends UIEvent { - readonly currentState: number; - readonly inertiaDestinationX: number; - readonly inertiaDestinationY: number; - readonly lastState: number; - initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; - readonly MS_MANIPULATION_STATE_ACTIVE: number; - readonly MS_MANIPULATION_STATE_CANCELLED: number; - readonly MS_MANIPULATION_STATE_COMMITTED: number; - readonly MS_MANIPULATION_STATE_DRAGGING: number; - readonly MS_MANIPULATION_STATE_INERTIA: number; - readonly MS_MANIPULATION_STATE_PRESELECT: number; - readonly MS_MANIPULATION_STATE_SELECTING: number; - readonly MS_MANIPULATION_STATE_STOPPED: number; -} - -declare var MSManipulationEvent: { - prototype: MSManipulationEvent; - new(): MSManipulationEvent; - readonly MS_MANIPULATION_STATE_ACTIVE: number; - readonly MS_MANIPULATION_STATE_CANCELLED: number; - readonly MS_MANIPULATION_STATE_COMMITTED: number; - readonly MS_MANIPULATION_STATE_DRAGGING: number; - readonly MS_MANIPULATION_STATE_INERTIA: number; - readonly MS_MANIPULATION_STATE_PRESELECT: number; - readonly MS_MANIPULATION_STATE_SELECTING: number; - readonly MS_MANIPULATION_STATE_STOPPED: number; -} - -interface MSMediaKeyError { - readonly code: number; - readonly systemCode: number; - readonly MS_MEDIA_KEYERR_CLIENT: number; - readonly MS_MEDIA_KEYERR_DOMAIN: number; - readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number; - readonly MS_MEDIA_KEYERR_OUTPUT: number; - readonly MS_MEDIA_KEYERR_SERVICE: number; - readonly MS_MEDIA_KEYERR_UNKNOWN: number; -} - -declare var MSMediaKeyError: { - prototype: MSMediaKeyError; - new(): MSMediaKeyError; - readonly MS_MEDIA_KEYERR_CLIENT: number; - readonly MS_MEDIA_KEYERR_DOMAIN: number; - readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number; - readonly MS_MEDIA_KEYERR_OUTPUT: number; - readonly MS_MEDIA_KEYERR_SERVICE: number; - readonly MS_MEDIA_KEYERR_UNKNOWN: number; -} - -interface MSMediaKeyMessageEvent extends Event { - readonly destinationURL: string | null; - readonly message: Uint8Array; -} - -declare var MSMediaKeyMessageEvent: { - prototype: MSMediaKeyMessageEvent; - new(): MSMediaKeyMessageEvent; -} - -interface MSMediaKeyNeededEvent extends Event { - readonly initData: Uint8Array | null; -} - -declare var MSMediaKeyNeededEvent: { - prototype: MSMediaKeyNeededEvent; - new(): MSMediaKeyNeededEvent; -} - -interface MSMediaKeySession extends EventTarget { - readonly error: MSMediaKeyError | null; - readonly keySystem: string; - readonly sessionId: string; - close(): void; - update(key: Uint8Array): void; -} - -declare var MSMediaKeySession: { - prototype: MSMediaKeySession; - new(): MSMediaKeySession; -} - -interface MSMediaKeys { - readonly keySystem: string; - createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; -} - -declare var MSMediaKeys: { - prototype: MSMediaKeys; - new(keySystem: string): MSMediaKeys; - isTypeSupported(keySystem: string, type?: string): boolean; - isTypeSupportedWithFeatures(keySystem: string, type?: string): string; -} - -interface MSPointerEvent extends MouseEvent { - readonly currentPoint: any; - readonly height: number; - readonly hwTimestamp: number; - readonly intermediatePoints: any; - readonly isPrimary: boolean; - readonly pointerId: number; - readonly pointerType: any; - readonly pressure: number; - readonly rotation: number; - readonly tiltX: number; - readonly tiltY: number; - readonly width: number; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; -} - -declare var MSPointerEvent: { - prototype: MSPointerEvent; - new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent; -} - -interface MSRangeCollection { - readonly length: number; - item(index: number): Range; - [index: number]: Range; -} - -declare var MSRangeCollection: { - prototype: MSRangeCollection; - new(): MSRangeCollection; -} - -interface MSSiteModeEvent extends Event { - readonly actionURL: string; - readonly buttonID: number; -} - -declare var MSSiteModeEvent: { - prototype: MSSiteModeEvent; - new(): MSSiteModeEvent; -} - -interface MSStream { - readonly type: string; - msClose(): void; - msDetachStream(): any; -} - -declare var MSStream: { - prototype: MSStream; - new(): MSStream; -} - -interface MSStreamReader extends EventTarget, MSBaseReader { - readonly error: DOMError; - readAsArrayBuffer(stream: MSStream, size?: number): void; - readAsBinaryString(stream: MSStream, size?: number): void; - readAsBlob(stream: MSStream, size?: number): void; - readAsDataURL(stream: MSStream, size?: number): void; - readAsText(stream: MSStream, encoding?: string, size?: number): void; - addEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSStreamReader: { - prototype: MSStreamReader; - new(): MSStreamReader; -} - -interface MSWebViewAsyncOperationEventMap { - "complete": Event; - "error": ErrorEvent; -} - -interface MSWebViewAsyncOperation extends EventTarget { - readonly error: DOMError; - oncomplete: (this: MSWebViewAsyncOperation, ev: Event) => any; - onerror: (this: MSWebViewAsyncOperation, ev: ErrorEvent) => any; - readonly readyState: number; - readonly result: any; - readonly target: MSHTMLWebViewElement; - readonly type: number; - start(): void; - readonly COMPLETED: number; - readonly ERROR: number; - readonly STARTED: number; - readonly TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - readonly TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - readonly TYPE_INVOKE_SCRIPT: number; - addEventListener(type: K, listener: (this: MSWebViewAsyncOperation, ev: MSWebViewAsyncOperationEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSWebViewAsyncOperation: { - prototype: MSWebViewAsyncOperation; - new(): MSWebViewAsyncOperation; - readonly COMPLETED: number; - readonly ERROR: number; - readonly STARTED: number; - readonly TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - readonly TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - readonly TYPE_INVOKE_SCRIPT: number; -} - -interface MSWebViewSettings { - isIndexedDBEnabled: boolean; - isJavaScriptEnabled: boolean; -} - -declare var MSWebViewSettings: { - prototype: MSWebViewSettings; - new(): MSWebViewSettings; -} - -interface MediaDeviceInfo { - readonly deviceId: string; - readonly groupId: string; - readonly kind: string; - readonly label: string; -} - -declare var MediaDeviceInfo: { - prototype: MediaDeviceInfo; - new(): MediaDeviceInfo; -} - -interface MediaDevicesEventMap { - "devicechange": Event; -} - -interface MediaDevices extends EventTarget { - ondevicechange: (this: MediaDevices, ev: Event) => any; - enumerateDevices(): any; - getSupportedConstraints(): MediaTrackSupportedConstraints; - getUserMedia(constraints: MediaStreamConstraints): PromiseLike; - addEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MediaDevices: { - prototype: MediaDevices; - new(): MediaDevices; -} - -interface MediaElementAudioSourceNode extends AudioNode { -} - -declare var MediaElementAudioSourceNode: { - prototype: MediaElementAudioSourceNode; - new(): MediaElementAudioSourceNode; -} - -interface MediaEncryptedEvent extends Event { - readonly initData: ArrayBuffer | null; - readonly initDataType: string; -} - -declare var MediaEncryptedEvent: { - prototype: MediaEncryptedEvent; - new(type: string, eventInitDict?: MediaEncryptedEventInit): MediaEncryptedEvent; -} - -interface MediaError { - readonly code: number; - readonly msExtendedCode: number; - readonly MEDIA_ERR_ABORTED: number; - readonly MEDIA_ERR_DECODE: number; - readonly MEDIA_ERR_NETWORK: number; - readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number; - readonly MS_MEDIA_ERR_ENCRYPTED: number; -} - -declare var MediaError: { - prototype: MediaError; - new(): MediaError; - readonly MEDIA_ERR_ABORTED: number; - readonly MEDIA_ERR_DECODE: number; - readonly MEDIA_ERR_NETWORK: number; - readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number; - readonly MS_MEDIA_ERR_ENCRYPTED: number; -} - -interface MediaKeyMessageEvent extends Event { - readonly message: ArrayBuffer; - readonly messageType: string; -} - -declare var MediaKeyMessageEvent: { - prototype: MediaKeyMessageEvent; - new(type: string, eventInitDict?: MediaKeyMessageEventInit): MediaKeyMessageEvent; -} - -interface MediaKeySession extends EventTarget { - readonly closed: PromiseLike; - readonly expiration: number; - readonly keyStatuses: MediaKeyStatusMap; - readonly sessionId: string; - close(): PromiseLike; - generateRequest(initDataType: string, initData: any): PromiseLike; - load(sessionId: string): PromiseLike; - remove(): PromiseLike; - update(response: any): PromiseLike; -} - -declare var MediaKeySession: { - prototype: MediaKeySession; - new(): MediaKeySession; -} - -interface MediaKeyStatusMap { - readonly size: number; - forEach(callback: ForEachCallback): void; - get(keyId: any): string; - has(keyId: any): boolean; -} - -declare var MediaKeyStatusMap: { - prototype: MediaKeyStatusMap; - new(): MediaKeyStatusMap; -} - -interface MediaKeySystemAccess { - readonly keySystem: string; - createMediaKeys(): PromiseLike; - getConfiguration(): MediaKeySystemConfiguration; -} - -declare var MediaKeySystemAccess: { - prototype: MediaKeySystemAccess; - new(): MediaKeySystemAccess; -} - -interface MediaKeys { - createSession(sessionType?: string): MediaKeySession; - setServerCertificate(serverCertificate: any): PromiseLike; -} - -declare var MediaKeys: { - prototype: MediaKeys; - new(): MediaKeys; -} - -interface MediaList { - readonly length: number; - mediaText: string; - appendMedium(newMedium: string): void; - deleteMedium(oldMedium: string): void; - item(index: number): string; - toString(): string; - [index: number]: string; -} - -declare var MediaList: { - prototype: MediaList; - new(): MediaList; -} - -interface MediaQueryList { - readonly matches: boolean; - readonly media: string; - addListener(listener: MediaQueryListListener): void; - removeListener(listener: MediaQueryListListener): void; -} - -declare var MediaQueryList: { - prototype: MediaQueryList; - new(): MediaQueryList; -} - -interface MediaSource extends EventTarget { - readonly activeSourceBuffers: SourceBufferList; - duration: number; - readonly readyState: string; - readonly sourceBuffers: SourceBufferList; - addSourceBuffer(type: string): SourceBuffer; - endOfStream(error?: number): void; - removeSourceBuffer(sourceBuffer: SourceBuffer): void; -} - -declare var MediaSource: { - prototype: MediaSource; - new(): MediaSource; - isTypeSupported(type: string): boolean; -} - -interface MediaStreamEventMap { - "active": Event; - "addtrack": TrackEvent; - "inactive": Event; - "removetrack": TrackEvent; -} - -interface MediaStream extends EventTarget { - readonly active: boolean; - readonly id: string; - onactive: (this: MediaStream, ev: Event) => any; - onaddtrack: (this: MediaStream, ev: TrackEvent) => any; - oninactive: (this: MediaStream, ev: Event) => any; - onremovetrack: (this: MediaStream, ev: TrackEvent) => any; - addTrack(track: MediaStreamTrack): void; - clone(): MediaStream; - getAudioTracks(): MediaStreamTrack[]; - getTrackById(trackId: string): MediaStreamTrack | null; - getTracks(): MediaStreamTrack[]; - getVideoTracks(): MediaStreamTrack[]; - removeTrack(track: MediaStreamTrack): void; - stop(): void; - addEventListener(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MediaStream: { - prototype: MediaStream; - new(streamOrTracks?: MediaStream | MediaStreamTrack[]): MediaStream; -} - -interface MediaStreamAudioSourceNode extends AudioNode { -} - -declare var MediaStreamAudioSourceNode: { - prototype: MediaStreamAudioSourceNode; - new(): MediaStreamAudioSourceNode; -} - -interface MediaStreamError { - readonly constraintName: string | null; - readonly message: string | null; - readonly name: string; -} - -declare var MediaStreamError: { - prototype: MediaStreamError; - new(): MediaStreamError; -} - -interface MediaStreamErrorEvent extends Event { - readonly error: MediaStreamError | null; -} - -declare var MediaStreamErrorEvent: { - prototype: MediaStreamErrorEvent; - new(type: string, eventInitDict?: MediaStreamErrorEventInit): MediaStreamErrorEvent; -} - -interface MediaStreamTrackEventMap { - "ended": MediaStreamErrorEvent; - "mute": Event; - "overconstrained": MediaStreamErrorEvent; - "unmute": Event; -} - -interface MediaStreamTrack extends EventTarget { - enabled: boolean; - readonly id: string; - readonly kind: string; - readonly label: string; - readonly muted: boolean; - onended: (this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any; - onmute: (this: MediaStreamTrack, ev: Event) => any; - onoverconstrained: (this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any; - onunmute: (this: MediaStreamTrack, ev: Event) => any; - readonly readonly: boolean; - readonly readyState: string; - readonly remote: boolean; - applyConstraints(constraints: MediaTrackConstraints): PromiseLike; - clone(): MediaStreamTrack; - getCapabilities(): MediaTrackCapabilities; - getConstraints(): MediaTrackConstraints; - getSettings(): MediaTrackSettings; - stop(): void; - addEventListener(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MediaStreamTrack: { - prototype: MediaStreamTrack; - new(): MediaStreamTrack; -} - -interface MediaStreamTrackEvent extends Event { - readonly track: MediaStreamTrack; -} - -declare var MediaStreamTrackEvent: { - prototype: MediaStreamTrackEvent; - new(type: string, eventInitDict?: MediaStreamTrackEventInit): MediaStreamTrackEvent; -} - -interface MessageChannel { - readonly port1: MessagePort; - readonly port2: MessagePort; -} - -declare var MessageChannel: { - prototype: MessageChannel; - new(): MessageChannel; -} - -interface MessageEvent extends Event { - readonly data: any; - readonly origin: string; - readonly ports: any; - readonly source: Window; - initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; -} - -declare var MessageEvent: { - prototype: MessageEvent; - new(type: string, eventInitDict?: MessageEventInit): MessageEvent; -} - -interface MessagePortEventMap { - "message": MessageEvent; -} - -interface MessagePort extends EventTarget { - onmessage: (this: MessagePort, ev: MessageEvent) => any; - close(): void; - postMessage(message?: any, ports?: any): void; - start(): void; - addEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MessagePort: { - prototype: MessagePort; - new(): MessagePort; -} - -interface MimeType { - readonly description: string; - readonly enabledPlugin: Plugin; - readonly suffixes: string; - readonly type: string; -} - -declare var MimeType: { - prototype: MimeType; - new(): MimeType; -} - -interface MimeTypeArray { - readonly length: number; - item(index: number): Plugin; - namedItem(type: string): Plugin; - [index: number]: Plugin; -} - -declare var MimeTypeArray: { - prototype: MimeTypeArray; - new(): MimeTypeArray; -} - -interface MouseEvent extends UIEvent { - readonly altKey: boolean; - readonly button: number; - readonly buttons: number; - readonly clientX: number; - readonly clientY: number; - readonly ctrlKey: boolean; - readonly fromElement: Element; - readonly layerX: number; - readonly layerY: number; - readonly metaKey: boolean; - readonly movementX: number; - readonly movementY: number; - readonly offsetX: number; - readonly offsetY: number; - readonly pageX: number; - readonly pageY: number; - readonly relatedTarget: EventTarget; - readonly screenX: number; - readonly screenY: number; - readonly shiftKey: boolean; - readonly toElement: Element; - readonly which: number; - readonly x: number; - readonly y: number; - getModifierState(keyArg: string): boolean; - initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget | null): void; -} - -declare var MouseEvent: { - prototype: MouseEvent; - new(typeArg: string, eventInitDict?: MouseEventInit): MouseEvent; -} - -interface MutationEvent extends Event { - readonly attrChange: number; - readonly attrName: string; - readonly newValue: string; - readonly prevValue: string; - readonly relatedNode: Node; - initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; - readonly ADDITION: number; - readonly MODIFICATION: number; - readonly REMOVAL: number; -} - -declare var MutationEvent: { - prototype: MutationEvent; - new(): MutationEvent; - readonly ADDITION: number; - readonly MODIFICATION: number; - readonly REMOVAL: number; -} - -interface MutationObserver { - disconnect(): void; - observe(target: Node, options: MutationObserverInit): void; - takeRecords(): MutationRecord[]; -} - -declare var MutationObserver: { - prototype: MutationObserver; - new(callback: MutationCallback): MutationObserver; -} - -interface MutationRecord { - readonly addedNodes: NodeList; - readonly attributeName: string | null; - readonly attributeNamespace: string | null; - readonly nextSibling: Node | null; - readonly oldValue: string | null; - readonly previousSibling: Node | null; - readonly removedNodes: NodeList; - readonly target: Node; - readonly type: string; -} - -declare var MutationRecord: { - prototype: MutationRecord; - new(): MutationRecord; -} - -interface NamedNodeMap { - readonly length: number; - getNamedItem(name: string): Attr; - getNamedItemNS(namespaceURI: string | null, localName: string | null): Attr; - item(index: number): Attr; - removeNamedItem(name: string): Attr; - removeNamedItemNS(namespaceURI: string | null, localName: string | null): Attr; - setNamedItem(arg: Attr): Attr; - setNamedItemNS(arg: Attr): Attr; - [index: number]: Attr; -} - -declare var NamedNodeMap: { - prototype: NamedNodeMap; - new(): NamedNodeMap; -} - -interface NavigationCompletedEvent extends NavigationEvent { - readonly isSuccess: boolean; - readonly webErrorStatus: number; -} - -declare var NavigationCompletedEvent: { - prototype: NavigationCompletedEvent; - new(): NavigationCompletedEvent; -} - -interface NavigationEvent extends Event { - readonly uri: string; -} - -declare var NavigationEvent: { - prototype: NavigationEvent; - new(): NavigationEvent; -} - -interface NavigationEventWithReferrer extends NavigationEvent { - readonly referer: string; -} - -declare var NavigationEventWithReferrer: { - prototype: NavigationEventWithReferrer; - new(): NavigationEventWithReferrer; -} - -interface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, NavigatorGeolocation, MSNavigatorDoNotTrack, MSFileSaver, NavigatorUserMedia { - readonly appCodeName: string; - readonly cookieEnabled: boolean; - readonly language: string; - readonly maxTouchPoints: number; - readonly mimeTypes: MimeTypeArray; - readonly msManipulationViewsEnabled: boolean; - readonly msMaxTouchPoints: number; - readonly msPointerEnabled: boolean; - readonly plugins: PluginArray; - readonly pointerEnabled: boolean; - readonly webdriver: boolean; - readonly hardwareConcurrency: number; - getGamepads(): Gamepad[]; - javaEnabled(): boolean; - msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; - requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): PromiseLike; - vibrate(pattern: number | number[]): boolean; -} - -declare var Navigator: { - prototype: Navigator; - new(): Navigator; -} - -interface Node extends EventTarget { - readonly attributes: NamedNodeMap; - readonly baseURI: string | null; - readonly childNodes: NodeList; - readonly firstChild: Node | null; - readonly lastChild: Node | null; - readonly localName: string | null; - readonly namespaceURI: string | null; - readonly nextSibling: Node | null; - readonly nodeName: string; - readonly nodeType: number; - nodeValue: string | null; - readonly ownerDocument: Document; - readonly parentElement: HTMLElement | null; - readonly parentNode: Node | null; - readonly previousSibling: Node | null; - textContent: string | null; - appendChild(newChild: Node): Node; - cloneNode(deep?: boolean): Node; - compareDocumentPosition(other: Node): number; - contains(child: Node): boolean; - hasAttributes(): boolean; - hasChildNodes(): boolean; - insertBefore(newChild: Node, refChild: Node | null): Node; - isDefaultNamespace(namespaceURI: string | null): boolean; - isEqualNode(arg: Node): boolean; - isSameNode(other: Node): boolean; - lookupNamespaceURI(prefix: string | null): string | null; - lookupPrefix(namespaceURI: string | null): string | null; - normalize(): void; - removeChild(oldChild: Node): Node; - replaceChild(newChild: Node, oldChild: Node): Node; - readonly ATTRIBUTE_NODE: number; - readonly CDATA_SECTION_NODE: number; - readonly COMMENT_NODE: number; - readonly DOCUMENT_FRAGMENT_NODE: number; - readonly DOCUMENT_NODE: number; - readonly DOCUMENT_POSITION_CONTAINED_BY: number; - readonly DOCUMENT_POSITION_CONTAINS: number; - readonly DOCUMENT_POSITION_DISCONNECTED: number; - readonly DOCUMENT_POSITION_FOLLOWING: number; - readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - readonly DOCUMENT_POSITION_PRECEDING: number; - readonly DOCUMENT_TYPE_NODE: number; - readonly ELEMENT_NODE: number; - readonly ENTITY_NODE: number; - readonly ENTITY_REFERENCE_NODE: number; - readonly NOTATION_NODE: number; - readonly PROCESSING_INSTRUCTION_NODE: number; - readonly TEXT_NODE: number; -} - -declare var Node: { - prototype: Node; - new(): Node; - readonly ATTRIBUTE_NODE: number; - readonly CDATA_SECTION_NODE: number; - readonly COMMENT_NODE: number; - readonly DOCUMENT_FRAGMENT_NODE: number; - readonly DOCUMENT_NODE: number; - readonly DOCUMENT_POSITION_CONTAINED_BY: number; - readonly DOCUMENT_POSITION_CONTAINS: number; - readonly DOCUMENT_POSITION_DISCONNECTED: number; - readonly DOCUMENT_POSITION_FOLLOWING: number; - readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - readonly DOCUMENT_POSITION_PRECEDING: number; - readonly DOCUMENT_TYPE_NODE: number; - readonly ELEMENT_NODE: number; - readonly ENTITY_NODE: number; - readonly ENTITY_REFERENCE_NODE: number; - readonly NOTATION_NODE: number; - readonly PROCESSING_INSTRUCTION_NODE: number; - readonly TEXT_NODE: number; -} - -interface NodeFilter { - acceptNode(n: Node): number; -} - -declare var NodeFilter: { - readonly FILTER_ACCEPT: number; - readonly FILTER_REJECT: number; - readonly FILTER_SKIP: number; - readonly SHOW_ALL: number; - readonly SHOW_ATTRIBUTE: number; - readonly SHOW_CDATA_SECTION: number; - readonly SHOW_COMMENT: number; - readonly SHOW_DOCUMENT: number; - readonly SHOW_DOCUMENT_FRAGMENT: number; - readonly SHOW_DOCUMENT_TYPE: number; - readonly SHOW_ELEMENT: number; - readonly SHOW_ENTITY: number; - readonly SHOW_ENTITY_REFERENCE: number; - readonly SHOW_NOTATION: number; - readonly SHOW_PROCESSING_INSTRUCTION: number; - readonly SHOW_TEXT: number; -} - -interface NodeIterator { - readonly expandEntityReferences: boolean; - readonly filter: NodeFilter; - readonly root: Node; - readonly whatToShow: number; - detach(): void; - nextNode(): Node; - previousNode(): Node; -} - -declare var NodeIterator: { - prototype: NodeIterator; - new(): NodeIterator; -} - -interface NodeList { - readonly length: number; - item(index: number): Node; - [index: number]: Node; -} - -declare var NodeList: { - prototype: NodeList; - new(): NodeList; -} - -interface OES_element_index_uint { -} - -declare var OES_element_index_uint: { - prototype: OES_element_index_uint; - new(): OES_element_index_uint; -} - -interface OES_standard_derivatives { - readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} - -declare var OES_standard_derivatives: { - prototype: OES_standard_derivatives; - new(): OES_standard_derivatives; - readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} - -interface OES_texture_float { -} - -declare var OES_texture_float: { - prototype: OES_texture_float; - new(): OES_texture_float; -} - -interface OES_texture_float_linear { -} - -declare var OES_texture_float_linear: { - prototype: OES_texture_float_linear; - new(): OES_texture_float_linear; -} - -interface OfflineAudioCompletionEvent extends Event { - readonly renderedBuffer: AudioBuffer; -} - -declare var OfflineAudioCompletionEvent: { - prototype: OfflineAudioCompletionEvent; - new(): OfflineAudioCompletionEvent; -} - -interface OfflineAudioContextEventMap { - "complete": Event; -} - -interface OfflineAudioContext extends AudioContext { - oncomplete: (this: OfflineAudioContext, ev: Event) => any; - startRendering(): PromiseLike; - addEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var OfflineAudioContext: { - prototype: OfflineAudioContext; - new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext; -} - -interface OscillatorNodeEventMap { - "ended": MediaStreamErrorEvent; -} - -interface OscillatorNode extends AudioNode { - readonly detune: AudioParam; - readonly frequency: AudioParam; - onended: (this: OscillatorNode, ev: MediaStreamErrorEvent) => any; - type: string; - setPeriodicWave(periodicWave: PeriodicWave): void; - start(when?: number): void; - stop(when?: number): void; - addEventListener(type: K, listener: (this: OscillatorNode, ev: OscillatorNodeEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var OscillatorNode: { - prototype: OscillatorNode; - new(): OscillatorNode; -} - -interface OverflowEvent extends UIEvent { - readonly horizontalOverflow: boolean; - readonly orient: number; - readonly verticalOverflow: boolean; - readonly BOTH: number; - readonly HORIZONTAL: number; - readonly VERTICAL: number; -} - -declare var OverflowEvent: { - prototype: OverflowEvent; - new(): OverflowEvent; - readonly BOTH: number; - readonly HORIZONTAL: number; - readonly VERTICAL: number; -} - -interface PageTransitionEvent extends Event { - readonly persisted: boolean; -} - -declare var PageTransitionEvent: { - prototype: PageTransitionEvent; - new(): PageTransitionEvent; -} - -interface PannerNode extends AudioNode { - coneInnerAngle: number; - coneOuterAngle: number; - coneOuterGain: number; - distanceModel: string; - maxDistance: number; - panningModel: string; - refDistance: number; - rolloffFactor: number; - setOrientation(x: number, y: number, z: number): void; - setPosition(x: number, y: number, z: number): void; - setVelocity(x: number, y: number, z: number): void; -} - -declare var PannerNode: { - prototype: PannerNode; - new(): PannerNode; -} - -interface PerfWidgetExternal { - readonly activeNetworkRequestCount: number; - readonly averageFrameTime: number; - readonly averagePaintTime: number; - readonly extraInformationEnabled: boolean; - readonly independentRenderingEnabled: boolean; - readonly irDisablingContentString: string; - readonly irStatusAvailable: boolean; - readonly maxCpuSpeed: number; - readonly paintRequestsPerSecond: number; - readonly performanceCounter: number; - readonly performanceCounterFrequency: number; - addEventListener(eventType: string, callback: Function): void; - getMemoryUsage(): number; - getProcessCpuUsage(): number; - getRecentCpuUsage(last: number | null): any; - getRecentFrames(last: number | null): any; - getRecentMemoryUsage(last: number | null): any; - getRecentPaintRequests(last: number | null): any; - removeEventListener(eventType: string, callback: Function): void; - repositionWindow(x: number, y: number): void; - resizeWindow(width: number, height: number): void; -} - -declare var PerfWidgetExternal: { - prototype: PerfWidgetExternal; - new(): PerfWidgetExternal; -} - -interface Performance { - readonly navigation: PerformanceNavigation; - readonly timing: PerformanceTiming; - clearMarks(markName?: string): void; - clearMeasures(measureName?: string): void; - clearResourceTimings(): void; - getEntries(): any; - getEntriesByName(name: string, entryType?: string): any; - getEntriesByType(entryType: string): any; - getMarks(markName?: string): any; - getMeasures(measureName?: string): any; - mark(markName: string): void; - measure(measureName: string, startMarkName?: string, endMarkName?: string): void; - now(): number; - setResourceTimingBufferSize(maxSize: number): void; - toJSON(): any; -} - -declare var Performance: { - prototype: Performance; - new(): Performance; -} - -interface PerformanceEntry { - readonly duration: number; - readonly entryType: string; - readonly name: string; - readonly startTime: number; -} - -declare var PerformanceEntry: { - prototype: PerformanceEntry; - new(): PerformanceEntry; -} - -interface PerformanceMark extends PerformanceEntry { -} - -declare var PerformanceMark: { - prototype: PerformanceMark; - new(): PerformanceMark; -} - -interface PerformanceMeasure extends PerformanceEntry { -} - -declare var PerformanceMeasure: { - prototype: PerformanceMeasure; - new(): PerformanceMeasure; -} - -interface PerformanceNavigation { - readonly redirectCount: number; - readonly type: number; - toJSON(): any; - readonly TYPE_BACK_FORWARD: number; - readonly TYPE_NAVIGATE: number; - readonly TYPE_RELOAD: number; - readonly TYPE_RESERVED: number; -} - -declare var PerformanceNavigation: { - prototype: PerformanceNavigation; - new(): PerformanceNavigation; - readonly TYPE_BACK_FORWARD: number; - readonly TYPE_NAVIGATE: number; - readonly TYPE_RELOAD: number; - readonly TYPE_RESERVED: number; -} - -interface PerformanceNavigationTiming extends PerformanceEntry { - readonly connectEnd: number; - readonly connectStart: number; - readonly domComplete: number; - readonly domContentLoadedEventEnd: number; - readonly domContentLoadedEventStart: number; - readonly domInteractive: number; - readonly domLoading: number; - readonly domainLookupEnd: number; - readonly domainLookupStart: number; - readonly fetchStart: number; - readonly loadEventEnd: number; - readonly loadEventStart: number; - readonly navigationStart: number; - readonly redirectCount: number; - readonly redirectEnd: number; - readonly redirectStart: number; - readonly requestStart: number; - readonly responseEnd: number; - readonly responseStart: number; - readonly type: string; - readonly unloadEventEnd: number; - readonly unloadEventStart: number; -} - -declare var PerformanceNavigationTiming: { - prototype: PerformanceNavigationTiming; - new(): PerformanceNavigationTiming; -} - -interface PerformanceResourceTiming extends PerformanceEntry { - readonly connectEnd: number; - readonly connectStart: number; - readonly domainLookupEnd: number; - readonly domainLookupStart: number; - readonly fetchStart: number; - readonly initiatorType: string; - readonly redirectEnd: number; - readonly redirectStart: number; - readonly requestStart: number; - readonly responseEnd: number; - readonly responseStart: number; -} - -declare var PerformanceResourceTiming: { - prototype: PerformanceResourceTiming; - new(): PerformanceResourceTiming; -} - -interface PerformanceTiming { - readonly connectEnd: number; - readonly connectStart: number; - readonly domComplete: number; - readonly domContentLoadedEventEnd: number; - readonly domContentLoadedEventStart: number; - readonly domInteractive: number; - readonly domLoading: number; - readonly domainLookupEnd: number; - readonly domainLookupStart: number; - readonly fetchStart: number; - readonly loadEventEnd: number; - readonly loadEventStart: number; - readonly msFirstPaint: number; - readonly navigationStart: number; - readonly redirectEnd: number; - readonly redirectStart: number; - readonly requestStart: number; - readonly responseEnd: number; - readonly responseStart: number; - readonly unloadEventEnd: number; - readonly unloadEventStart: number; - readonly secureConnectionStart: number; - toJSON(): any; -} - -declare var PerformanceTiming: { - prototype: PerformanceTiming; - new(): PerformanceTiming; -} - -interface PeriodicWave { -} - -declare var PeriodicWave: { - prototype: PeriodicWave; - new(): PeriodicWave; -} - -interface PermissionRequest extends DeferredPermissionRequest { - readonly state: string; - defer(): void; -} - -declare var PermissionRequest: { - prototype: PermissionRequest; - new(): PermissionRequest; -} - -interface PermissionRequestedEvent extends Event { - readonly permissionRequest: PermissionRequest; -} - -declare var PermissionRequestedEvent: { - prototype: PermissionRequestedEvent; - new(): PermissionRequestedEvent; -} - -interface Plugin { - readonly description: string; - readonly filename: string; - readonly length: number; - readonly name: string; - readonly version: string; - item(index: number): MimeType; - namedItem(type: string): MimeType; - [index: number]: MimeType; -} - -declare var Plugin: { - prototype: Plugin; - new(): Plugin; -} - -interface PluginArray { - readonly length: number; - item(index: number): Plugin; - namedItem(name: string): Plugin; - refresh(reload?: boolean): void; - [index: number]: Plugin; -} - -declare var PluginArray: { - prototype: PluginArray; - new(): PluginArray; -} - -interface PointerEvent extends MouseEvent { - readonly currentPoint: any; - readonly height: number; - readonly hwTimestamp: number; - readonly intermediatePoints: any; - readonly isPrimary: boolean; - readonly pointerId: number; - readonly pointerType: any; - readonly pressure: number; - readonly rotation: number; - readonly tiltX: number; - readonly tiltY: number; - readonly width: number; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; -} - -declare var PointerEvent: { - prototype: PointerEvent; - new(typeArg: string, eventInitDict?: PointerEventInit): PointerEvent; -} - -interface PopStateEvent extends Event { - readonly state: any; - initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void; -} - -declare var PopStateEvent: { - prototype: PopStateEvent; - new(): PopStateEvent; -} - -interface Position { - readonly coords: Coordinates; - readonly timestamp: number; -} - -declare var Position: { - prototype: Position; - new(): Position; -} - -interface PositionError { - readonly code: number; - readonly message: string; - toString(): string; - readonly PERMISSION_DENIED: number; - readonly POSITION_UNAVAILABLE: number; - readonly TIMEOUT: number; -} - -declare var PositionError: { - prototype: PositionError; - new(): PositionError; - readonly PERMISSION_DENIED: number; - readonly POSITION_UNAVAILABLE: number; - readonly TIMEOUT: number; -} - -interface ProcessingInstruction extends CharacterData { - readonly target: string; -} - -declare var ProcessingInstruction: { - prototype: ProcessingInstruction; - new(): ProcessingInstruction; -} - -interface ProgressEvent extends Event { - readonly lengthComputable: boolean; - readonly loaded: number; - readonly total: number; - initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; -} - -declare var ProgressEvent: { - prototype: ProgressEvent; - new(type: string, eventInitDict?: ProgressEventInit): ProgressEvent; -} - -interface RTCDTMFToneChangeEvent extends Event { - readonly tone: string; -} - -declare var RTCDTMFToneChangeEvent: { - prototype: RTCDTMFToneChangeEvent; - new(type: string, eventInitDict: RTCDTMFToneChangeEventInit): RTCDTMFToneChangeEvent; -} - -interface RTCDtlsTransportEventMap { - "dtlsstatechange": RTCDtlsTransportStateChangedEvent; - "error": ErrorEvent; -} - -interface RTCDtlsTransport extends RTCStatsProvider { - ondtlsstatechange: ((this: RTCDtlsTransport, ev: RTCDtlsTransportStateChangedEvent) => any) | null; - onerror: ((this: RTCDtlsTransport, ev: ErrorEvent) => any) | null; - readonly state: string; - readonly transport: RTCIceTransport; - getLocalParameters(): RTCDtlsParameters; - getRemoteCertificates(): ArrayBuffer[]; - getRemoteParameters(): RTCDtlsParameters | null; - start(remoteParameters: RTCDtlsParameters): void; - stop(): void; - addEventListener(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCDtlsTransport: { - prototype: RTCDtlsTransport; - new(transport: RTCIceTransport): RTCDtlsTransport; -} - -interface RTCDtlsTransportStateChangedEvent extends Event { - readonly state: string; -} - -declare var RTCDtlsTransportStateChangedEvent: { - prototype: RTCDtlsTransportStateChangedEvent; - new(): RTCDtlsTransportStateChangedEvent; -} - -interface RTCDtmfSenderEventMap { - "tonechange": RTCDTMFToneChangeEvent; -} - -interface RTCDtmfSender extends EventTarget { - readonly canInsertDTMF: boolean; - readonly duration: number; - readonly interToneGap: number; - ontonechange: (this: RTCDtmfSender, ev: RTCDTMFToneChangeEvent) => any; - readonly sender: RTCRtpSender; - readonly toneBuffer: string; - insertDTMF(tones: string, duration?: number, interToneGap?: number): void; - addEventListener(type: K, listener: (this: RTCDtmfSender, ev: RTCDtmfSenderEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCDtmfSender: { - prototype: RTCDtmfSender; - new(sender: RTCRtpSender): RTCDtmfSender; -} - -interface RTCIceCandidatePairChangedEvent extends Event { - readonly pair: RTCIceCandidatePair; -} - -declare var RTCIceCandidatePairChangedEvent: { - prototype: RTCIceCandidatePairChangedEvent; - new(): RTCIceCandidatePairChangedEvent; -} - -interface RTCIceGathererEventMap { - "error": ErrorEvent; - "localcandidate": RTCIceGathererEvent; -} - -interface RTCIceGatherer extends RTCStatsProvider { - readonly component: string; - onerror: ((this: RTCIceGatherer, ev: ErrorEvent) => any) | null; - onlocalcandidate: ((this: RTCIceGatherer, ev: RTCIceGathererEvent) => any) | null; - createAssociatedGatherer(): RTCIceGatherer; - getLocalCandidates(): RTCIceCandidate[]; - getLocalParameters(): RTCIceParameters; - addEventListener(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCIceGatherer: { - prototype: RTCIceGatherer; - new(options: RTCIceGatherOptions): RTCIceGatherer; -} - -interface RTCIceGathererEvent extends Event { - readonly candidate: RTCIceCandidate | RTCIceCandidateComplete; -} - -declare var RTCIceGathererEvent: { - prototype: RTCIceGathererEvent; - new(): RTCIceGathererEvent; -} - -interface RTCIceTransportEventMap { - "candidatepairchange": RTCIceCandidatePairChangedEvent; - "icestatechange": RTCIceTransportStateChangedEvent; -} - -interface RTCIceTransport extends RTCStatsProvider { - readonly component: string; - readonly iceGatherer: RTCIceGatherer | null; - oncandidatepairchange: ((this: RTCIceTransport, ev: RTCIceCandidatePairChangedEvent) => any) | null; - onicestatechange: ((this: RTCIceTransport, ev: RTCIceTransportStateChangedEvent) => any) | null; - readonly role: string; - readonly state: string; - addRemoteCandidate(remoteCandidate: RTCIceCandidate | RTCIceCandidateComplete): void; - createAssociatedTransport(): RTCIceTransport; - getNominatedCandidatePair(): RTCIceCandidatePair | null; - getRemoteCandidates(): RTCIceCandidate[]; - getRemoteParameters(): RTCIceParameters | null; - setRemoteCandidates(remoteCandidates: RTCIceCandidate[]): void; - start(gatherer: RTCIceGatherer, remoteParameters: RTCIceParameters, role?: string): void; - stop(): void; - addEventListener(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCIceTransport: { - prototype: RTCIceTransport; - new(): RTCIceTransport; -} - -interface RTCIceTransportStateChangedEvent extends Event { - readonly state: string; -} - -declare var RTCIceTransportStateChangedEvent: { - prototype: RTCIceTransportStateChangedEvent; - new(): RTCIceTransportStateChangedEvent; -} - -interface RTCRtpReceiverEventMap { - "error": ErrorEvent; -} - -interface RTCRtpReceiver extends RTCStatsProvider { - onerror: ((this: RTCRtpReceiver, ev: ErrorEvent) => any) | null; - readonly rtcpTransport: RTCDtlsTransport; - readonly track: MediaStreamTrack | null; - readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport; - getContributingSources(): RTCRtpContributingSource[]; - receive(parameters: RTCRtpParameters): void; - requestSendCSRC(csrc: number): void; - setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void; - stop(): void; - addEventListener(type: K, listener: (this: RTCRtpReceiver, ev: RTCRtpReceiverEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCRtpReceiver: { - prototype: RTCRtpReceiver; - new(transport: RTCDtlsTransport | RTCSrtpSdesTransport, kind: string, rtcpTransport?: RTCDtlsTransport): RTCRtpReceiver; - getCapabilities(kind?: string): RTCRtpCapabilities; -} - -interface RTCRtpSenderEventMap { - "error": ErrorEvent; - "ssrcconflict": RTCSsrcConflictEvent; -} - -interface RTCRtpSender extends RTCStatsProvider { - onerror: ((this: RTCRtpSender, ev: ErrorEvent) => any) | null; - onssrcconflict: ((this: RTCRtpSender, ev: RTCSsrcConflictEvent) => any) | null; - readonly rtcpTransport: RTCDtlsTransport; - readonly track: MediaStreamTrack; - readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport; - send(parameters: RTCRtpParameters): void; - setTrack(track: MediaStreamTrack): void; - setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void; - stop(): void; - addEventListener(type: K, listener: (this: RTCRtpSender, ev: RTCRtpSenderEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCRtpSender: { - prototype: RTCRtpSender; - new(track: MediaStreamTrack, transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): RTCRtpSender; - getCapabilities(kind?: string): RTCRtpCapabilities; -} - -interface RTCSrtpSdesTransportEventMap { - "error": ErrorEvent; -} - -interface RTCSrtpSdesTransport extends EventTarget { - onerror: ((this: RTCSrtpSdesTransport, ev: ErrorEvent) => any) | null; - readonly transport: RTCIceTransport; - addEventListener(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var RTCSrtpSdesTransport: { - prototype: RTCSrtpSdesTransport; - new(transport: RTCIceTransport, encryptParameters: RTCSrtpSdesParameters, decryptParameters: RTCSrtpSdesParameters): RTCSrtpSdesTransport; - getLocalParameters(): RTCSrtpSdesParameters[]; -} - -interface RTCSsrcConflictEvent extends Event { - readonly ssrc: number; -} - -declare var RTCSsrcConflictEvent: { - prototype: RTCSsrcConflictEvent; - new(): RTCSsrcConflictEvent; -} - -interface RTCStatsProvider extends EventTarget { - getStats(): PromiseLike; - msGetStats(): PromiseLike; -} - -declare var RTCStatsProvider: { - prototype: RTCStatsProvider; - new(): RTCStatsProvider; -} - -interface Range { - readonly collapsed: boolean; - readonly commonAncestorContainer: Node; - readonly endContainer: Node; - readonly endOffset: number; - readonly startContainer: Node; - readonly startOffset: number; - cloneContents(): DocumentFragment; - cloneRange(): Range; - collapse(toStart: boolean): void; - compareBoundaryPoints(how: number, sourceRange: Range): number; - createContextualFragment(fragment: string): DocumentFragment; - deleteContents(): void; - detach(): void; - expand(Unit: string): boolean; - extractContents(): DocumentFragment; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; - insertNode(newNode: Node): void; - selectNode(refNode: Node): void; - selectNodeContents(refNode: Node): void; - setEnd(refNode: Node, offset: number): void; - setEndAfter(refNode: Node): void; - setEndBefore(refNode: Node): void; - setStart(refNode: Node, offset: number): void; - setStartAfter(refNode: Node): void; - setStartBefore(refNode: Node): void; - surroundContents(newParent: Node): void; - toString(): string; - readonly END_TO_END: number; - readonly END_TO_START: number; - readonly START_TO_END: number; - readonly START_TO_START: number; -} - -declare var Range: { - prototype: Range; - new(): Range; - readonly END_TO_END: number; - readonly END_TO_START: number; - readonly START_TO_END: number; - readonly START_TO_START: number; -} - -interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { - readonly target: SVGAnimatedString; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGAElement: { - prototype: SVGAElement; - new(): SVGAElement; -} - -interface SVGAngle { - readonly unitType: number; - value: number; - valueAsString: string; - valueInSpecifiedUnits: number; - convertToSpecifiedUnits(unitType: number): void; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - readonly SVG_ANGLETYPE_DEG: number; - readonly SVG_ANGLETYPE_GRAD: number; - readonly SVG_ANGLETYPE_RAD: number; - readonly SVG_ANGLETYPE_UNKNOWN: number; - readonly SVG_ANGLETYPE_UNSPECIFIED: number; -} - -declare var SVGAngle: { - prototype: SVGAngle; - new(): SVGAngle; - readonly SVG_ANGLETYPE_DEG: number; - readonly SVG_ANGLETYPE_GRAD: number; - readonly SVG_ANGLETYPE_RAD: number; - readonly SVG_ANGLETYPE_UNKNOWN: number; - readonly SVG_ANGLETYPE_UNSPECIFIED: number; -} - -interface SVGAnimatedAngle { - readonly animVal: SVGAngle; - readonly baseVal: SVGAngle; -} - -declare var SVGAnimatedAngle: { - prototype: SVGAnimatedAngle; - new(): SVGAnimatedAngle; -} - -interface SVGAnimatedBoolean { - readonly animVal: boolean; - baseVal: boolean; -} - -declare var SVGAnimatedBoolean: { - prototype: SVGAnimatedBoolean; - new(): SVGAnimatedBoolean; -} - -interface SVGAnimatedEnumeration { - readonly animVal: number; - baseVal: number; -} - -declare var SVGAnimatedEnumeration: { - prototype: SVGAnimatedEnumeration; - new(): SVGAnimatedEnumeration; -} - -interface SVGAnimatedInteger { - readonly animVal: number; - baseVal: number; -} - -declare var SVGAnimatedInteger: { - prototype: SVGAnimatedInteger; - new(): SVGAnimatedInteger; -} - -interface SVGAnimatedLength { - readonly animVal: SVGLength; - readonly baseVal: SVGLength; -} - -declare var SVGAnimatedLength: { - prototype: SVGAnimatedLength; - new(): SVGAnimatedLength; -} - -interface SVGAnimatedLengthList { - readonly animVal: SVGLengthList; - readonly baseVal: SVGLengthList; -} - -declare var SVGAnimatedLengthList: { - prototype: SVGAnimatedLengthList; - new(): SVGAnimatedLengthList; -} - -interface SVGAnimatedNumber { - readonly animVal: number; - baseVal: number; -} - -declare var SVGAnimatedNumber: { - prototype: SVGAnimatedNumber; - new(): SVGAnimatedNumber; -} - -interface SVGAnimatedNumberList { - readonly animVal: SVGNumberList; - readonly baseVal: SVGNumberList; -} - -declare var SVGAnimatedNumberList: { - prototype: SVGAnimatedNumberList; - new(): SVGAnimatedNumberList; -} - -interface SVGAnimatedPreserveAspectRatio { - readonly animVal: SVGPreserveAspectRatio; - readonly baseVal: SVGPreserveAspectRatio; -} - -declare var SVGAnimatedPreserveAspectRatio: { - prototype: SVGAnimatedPreserveAspectRatio; - new(): SVGAnimatedPreserveAspectRatio; -} - -interface SVGAnimatedRect { - readonly animVal: SVGRect; - readonly baseVal: SVGRect; -} - -declare var SVGAnimatedRect: { - prototype: SVGAnimatedRect; - new(): SVGAnimatedRect; -} - -interface SVGAnimatedString { - readonly animVal: string; - baseVal: string; -} - -declare var SVGAnimatedString: { - prototype: SVGAnimatedString; - new(): SVGAnimatedString; -} - -interface SVGAnimatedTransformList { - readonly animVal: SVGTransformList; - readonly baseVal: SVGTransformList; -} - -declare var SVGAnimatedTransformList: { - prototype: SVGAnimatedTransformList; - new(): SVGAnimatedTransformList; -} - -interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly cx: SVGAnimatedLength; - readonly cy: SVGAnimatedLength; - readonly r: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGCircleElement: { - prototype: SVGCircleElement; - new(): SVGCircleElement; -} - -interface SVGClipPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes { - readonly clipPathUnits: SVGAnimatedEnumeration; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGClipPathElement: { - prototype: SVGClipPathElement; - new(): SVGClipPathElement; -} - -interface SVGComponentTransferFunctionElement extends SVGElement { - readonly amplitude: SVGAnimatedNumber; - readonly exponent: SVGAnimatedNumber; - readonly intercept: SVGAnimatedNumber; - readonly offset: SVGAnimatedNumber; - readonly slope: SVGAnimatedNumber; - readonly tableValues: SVGAnimatedNumberList; - readonly type: SVGAnimatedEnumeration; - readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGComponentTransferFunctionElement: { - prototype: SVGComponentTransferFunctionElement; - new(): SVGComponentTransferFunctionElement; - readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; -} - -interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGDefsElement: { - prototype: SVGDefsElement; - new(): SVGDefsElement; -} - -interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGDescElement: { - prototype: SVGDescElement; - new(): SVGDescElement; -} - -interface SVGElementEventMap extends ElementEventMap { - "click": MouseEvent; - "dblclick": MouseEvent; - "focusin": FocusEvent; - "focusout": FocusEvent; - "load": Event; - "mousedown": MouseEvent; - "mousemove": MouseEvent; - "mouseout": MouseEvent; - "mouseover": MouseEvent; - "mouseup": MouseEvent; -} - -interface SVGElement extends Element { - onclick: (this: SVGElement, ev: MouseEvent) => any; - ondblclick: (this: SVGElement, ev: MouseEvent) => any; - onfocusin: (this: SVGElement, ev: FocusEvent) => any; - onfocusout: (this: SVGElement, ev: FocusEvent) => any; - onload: (this: SVGElement, ev: Event) => any; - onmousedown: (this: SVGElement, ev: MouseEvent) => any; - onmousemove: (this: SVGElement, ev: MouseEvent) => any; - onmouseout: (this: SVGElement, ev: MouseEvent) => any; - onmouseover: (this: SVGElement, ev: MouseEvent) => any; - onmouseup: (this: SVGElement, ev: MouseEvent) => any; - readonly ownerSVGElement: SVGSVGElement; - readonly viewportElement: SVGElement; - xmlbase: string; - className: any; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGElement: { - prototype: SVGElement; - new(): SVGElement; -} - -interface SVGElementInstance extends EventTarget { - readonly childNodes: SVGElementInstanceList; - readonly correspondingElement: SVGElement; - readonly correspondingUseElement: SVGUseElement; - readonly firstChild: SVGElementInstance; - readonly lastChild: SVGElementInstance; - readonly nextSibling: SVGElementInstance; - readonly parentNode: SVGElementInstance; - readonly previousSibling: SVGElementInstance; -} - -declare var SVGElementInstance: { - prototype: SVGElementInstance; - new(): SVGElementInstance; -} - -interface SVGElementInstanceList { - readonly length: number; - item(index: number): SVGElementInstance; -} - -declare var SVGElementInstanceList: { - prototype: SVGElementInstanceList; - new(): SVGElementInstanceList; -} - -interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly cx: SVGAnimatedLength; - readonly cy: SVGAnimatedLength; - readonly rx: SVGAnimatedLength; - readonly ry: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGEllipseElement: { - prototype: SVGEllipseElement; - new(): SVGEllipseElement; -} - -interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly in2: SVGAnimatedString; - readonly mode: SVGAnimatedEnumeration; - readonly SVG_FEBLEND_MODE_COLOR: number; - readonly SVG_FEBLEND_MODE_COLOR_BURN: number; - readonly SVG_FEBLEND_MODE_COLOR_DODGE: number; - readonly SVG_FEBLEND_MODE_DARKEN: number; - readonly SVG_FEBLEND_MODE_DIFFERENCE: number; - readonly SVG_FEBLEND_MODE_EXCLUSION: number; - readonly SVG_FEBLEND_MODE_HARD_LIGHT: number; - readonly SVG_FEBLEND_MODE_HUE: number; - readonly SVG_FEBLEND_MODE_LIGHTEN: number; - readonly SVG_FEBLEND_MODE_LUMINOSITY: number; - readonly SVG_FEBLEND_MODE_MULTIPLY: number; - readonly SVG_FEBLEND_MODE_NORMAL: number; - readonly SVG_FEBLEND_MODE_OVERLAY: number; - readonly SVG_FEBLEND_MODE_SATURATION: number; - readonly SVG_FEBLEND_MODE_SCREEN: number; - readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number; - readonly SVG_FEBLEND_MODE_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEBlendElement: { - prototype: SVGFEBlendElement; - new(): SVGFEBlendElement; - readonly SVG_FEBLEND_MODE_COLOR: number; - readonly SVG_FEBLEND_MODE_COLOR_BURN: number; - readonly SVG_FEBLEND_MODE_COLOR_DODGE: number; - readonly SVG_FEBLEND_MODE_DARKEN: number; - readonly SVG_FEBLEND_MODE_DIFFERENCE: number; - readonly SVG_FEBLEND_MODE_EXCLUSION: number; - readonly SVG_FEBLEND_MODE_HARD_LIGHT: number; - readonly SVG_FEBLEND_MODE_HUE: number; - readonly SVG_FEBLEND_MODE_LIGHTEN: number; - readonly SVG_FEBLEND_MODE_LUMINOSITY: number; - readonly SVG_FEBLEND_MODE_MULTIPLY: number; - readonly SVG_FEBLEND_MODE_NORMAL: number; - readonly SVG_FEBLEND_MODE_OVERLAY: number; - readonly SVG_FEBLEND_MODE_SATURATION: number; - readonly SVG_FEBLEND_MODE_SCREEN: number; - readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number; - readonly SVG_FEBLEND_MODE_UNKNOWN: number; -} - -interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly type: SVGAnimatedEnumeration; - readonly values: SVGAnimatedNumberList; - readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; - readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number; - readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number; - readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEColorMatrixElement: { - prototype: SVGFEColorMatrixElement; - new(): SVGFEColorMatrixElement; - readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; - readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number; - readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number; - readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; -} - -interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEComponentTransferElement: { - prototype: SVGFEComponentTransferElement; - new(): SVGFEComponentTransferElement; -} - -interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly in2: SVGAnimatedString; - readonly k1: SVGAnimatedNumber; - readonly k2: SVGAnimatedNumber; - readonly k3: SVGAnimatedNumber; - readonly k4: SVGAnimatedNumber; - readonly operator: SVGAnimatedEnumeration; - readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number; - readonly SVG_FECOMPOSITE_OPERATOR_IN: number; - readonly SVG_FECOMPOSITE_OPERATOR_OUT: number; - readonly SVG_FECOMPOSITE_OPERATOR_OVER: number; - readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - readonly SVG_FECOMPOSITE_OPERATOR_XOR: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFECompositeElement: { - prototype: SVGFECompositeElement; - new(): SVGFECompositeElement; - readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number; - readonly SVG_FECOMPOSITE_OPERATOR_IN: number; - readonly SVG_FECOMPOSITE_OPERATOR_OUT: number; - readonly SVG_FECOMPOSITE_OPERATOR_OVER: number; - readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - readonly SVG_FECOMPOSITE_OPERATOR_XOR: number; -} - -interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly bias: SVGAnimatedNumber; - readonly divisor: SVGAnimatedNumber; - readonly edgeMode: SVGAnimatedEnumeration; - readonly in1: SVGAnimatedString; - readonly kernelMatrix: SVGAnimatedNumberList; - readonly kernelUnitLengthX: SVGAnimatedNumber; - readonly kernelUnitLengthY: SVGAnimatedNumber; - readonly orderX: SVGAnimatedInteger; - readonly orderY: SVGAnimatedInteger; - readonly preserveAlpha: SVGAnimatedBoolean; - readonly targetX: SVGAnimatedInteger; - readonly targetY: SVGAnimatedInteger; - readonly SVG_EDGEMODE_DUPLICATE: number; - readonly SVG_EDGEMODE_NONE: number; - readonly SVG_EDGEMODE_UNKNOWN: number; - readonly SVG_EDGEMODE_WRAP: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEConvolveMatrixElement: { - prototype: SVGFEConvolveMatrixElement; - new(): SVGFEConvolveMatrixElement; - readonly SVG_EDGEMODE_DUPLICATE: number; - readonly SVG_EDGEMODE_NONE: number; - readonly SVG_EDGEMODE_UNKNOWN: number; - readonly SVG_EDGEMODE_WRAP: number; -} - -interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly diffuseConstant: SVGAnimatedNumber; - readonly in1: SVGAnimatedString; - readonly kernelUnitLengthX: SVGAnimatedNumber; - readonly kernelUnitLengthY: SVGAnimatedNumber; - readonly surfaceScale: SVGAnimatedNumber; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEDiffuseLightingElement: { - prototype: SVGFEDiffuseLightingElement; - new(): SVGFEDiffuseLightingElement; -} - -interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly in2: SVGAnimatedString; - readonly scale: SVGAnimatedNumber; - readonly xChannelSelector: SVGAnimatedEnumeration; - readonly yChannelSelector: SVGAnimatedEnumeration; - readonly SVG_CHANNEL_A: number; - readonly SVG_CHANNEL_B: number; - readonly SVG_CHANNEL_G: number; - readonly SVG_CHANNEL_R: number; - readonly SVG_CHANNEL_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEDisplacementMapElement: { - prototype: SVGFEDisplacementMapElement; - new(): SVGFEDisplacementMapElement; - readonly SVG_CHANNEL_A: number; - readonly SVG_CHANNEL_B: number; - readonly SVG_CHANNEL_G: number; - readonly SVG_CHANNEL_R: number; - readonly SVG_CHANNEL_UNKNOWN: number; -} - -interface SVGFEDistantLightElement extends SVGElement { - readonly azimuth: SVGAnimatedNumber; - readonly elevation: SVGAnimatedNumber; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEDistantLightElement: { - prototype: SVGFEDistantLightElement; - new(): SVGFEDistantLightElement; -} - -interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEFloodElement: { - prototype: SVGFEFloodElement; - new(): SVGFEFloodElement; -} - -interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncAElement: { - prototype: SVGFEFuncAElement; - new(): SVGFEFuncAElement; -} - -interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncBElement: { - prototype: SVGFEFuncBElement; - new(): SVGFEFuncBElement; -} - -interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncGElement: { - prototype: SVGFEFuncGElement; - new(): SVGFEFuncGElement; -} - -interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncRElement: { - prototype: SVGFEFuncRElement; - new(): SVGFEFuncRElement; -} - -interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly stdDeviationX: SVGAnimatedNumber; - readonly stdDeviationY: SVGAnimatedNumber; - setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEGaussianBlurElement: { - prototype: SVGFEGaussianBlurElement; - new(): SVGFEGaussianBlurElement; -} - -interface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { - readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEImageElement: { - prototype: SVGFEImageElement; - new(): SVGFEImageElement; -} - -interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEMergeElement: { - prototype: SVGFEMergeElement; - new(): SVGFEMergeElement; -} - -interface SVGFEMergeNodeElement extends SVGElement { - readonly in1: SVGAnimatedString; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEMergeNodeElement: { - prototype: SVGFEMergeNodeElement; - new(): SVGFEMergeNodeElement; -} - -interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly operator: SVGAnimatedEnumeration; - readonly radiusX: SVGAnimatedNumber; - readonly radiusY: SVGAnimatedNumber; - readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number; - readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number; - readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEMorphologyElement: { - prototype: SVGFEMorphologyElement; - new(): SVGFEMorphologyElement; - readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number; - readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number; - readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; -} - -interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly dx: SVGAnimatedNumber; - readonly dy: SVGAnimatedNumber; - readonly in1: SVGAnimatedString; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEOffsetElement: { - prototype: SVGFEOffsetElement; - new(): SVGFEOffsetElement; -} - -interface SVGFEPointLightElement extends SVGElement { - readonly x: SVGAnimatedNumber; - readonly y: SVGAnimatedNumber; - readonly z: SVGAnimatedNumber; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEPointLightElement: { - prototype: SVGFEPointLightElement; - new(): SVGFEPointLightElement; -} - -interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - readonly kernelUnitLengthX: SVGAnimatedNumber; - readonly kernelUnitLengthY: SVGAnimatedNumber; - readonly specularConstant: SVGAnimatedNumber; - readonly specularExponent: SVGAnimatedNumber; - readonly surfaceScale: SVGAnimatedNumber; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFESpecularLightingElement: { - prototype: SVGFESpecularLightingElement; - new(): SVGFESpecularLightingElement; -} - -interface SVGFESpotLightElement extends SVGElement { - readonly limitingConeAngle: SVGAnimatedNumber; - readonly pointsAtX: SVGAnimatedNumber; - readonly pointsAtY: SVGAnimatedNumber; - readonly pointsAtZ: SVGAnimatedNumber; - readonly specularExponent: SVGAnimatedNumber; - readonly x: SVGAnimatedNumber; - readonly y: SVGAnimatedNumber; - readonly z: SVGAnimatedNumber; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFESpotLightElement: { - prototype: SVGFESpotLightElement; - new(): SVGFESpotLightElement; -} - -interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly in1: SVGAnimatedString; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFETileElement: { - prototype: SVGFETileElement; - new(): SVGFETileElement; -} - -interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - readonly baseFrequencyX: SVGAnimatedNumber; - readonly baseFrequencyY: SVGAnimatedNumber; - readonly numOctaves: SVGAnimatedInteger; - readonly seed: SVGAnimatedNumber; - readonly stitchTiles: SVGAnimatedEnumeration; - readonly type: SVGAnimatedEnumeration; - readonly SVG_STITCHTYPE_NOSTITCH: number; - readonly SVG_STITCHTYPE_STITCH: number; - readonly SVG_STITCHTYPE_UNKNOWN: number; - readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - readonly SVG_TURBULENCE_TYPE_TURBULENCE: number; - readonly SVG_TURBULENCE_TYPE_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFETurbulenceElement: { - prototype: SVGFETurbulenceElement; - new(): SVGFETurbulenceElement; - readonly SVG_STITCHTYPE_NOSTITCH: number; - readonly SVG_STITCHTYPE_STITCH: number; - readonly SVG_STITCHTYPE_UNKNOWN: number; - readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - readonly SVG_TURBULENCE_TYPE_TURBULENCE: number; - readonly SVG_TURBULENCE_TYPE_UNKNOWN: number; -} - -interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { - readonly filterResX: SVGAnimatedInteger; - readonly filterResY: SVGAnimatedInteger; - readonly filterUnits: SVGAnimatedEnumeration; - readonly height: SVGAnimatedLength; - readonly primitiveUnits: SVGAnimatedEnumeration; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - setFilterRes(filterResX: number, filterResY: number): void; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFilterElement: { - prototype: SVGFilterElement; - new(): SVGFilterElement; -} - -interface SVGForeignObjectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly height: SVGAnimatedLength; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGForeignObjectElement: { - prototype: SVGForeignObjectElement; - new(): SVGForeignObjectElement; -} - -interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGGElement: { - prototype: SVGGElement; - new(): SVGGElement; -} - -interface SVGGradientElement extends SVGElement, SVGStylable, SVGExternalResourcesRequired, SVGURIReference, SVGUnitTypes { - readonly gradientTransform: SVGAnimatedTransformList; - readonly gradientUnits: SVGAnimatedEnumeration; - readonly spreadMethod: SVGAnimatedEnumeration; - readonly SVG_SPREADMETHOD_PAD: number; - readonly SVG_SPREADMETHOD_REFLECT: number; - readonly SVG_SPREADMETHOD_REPEAT: number; - readonly SVG_SPREADMETHOD_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGGradientElement: { - prototype: SVGGradientElement; - new(): SVGGradientElement; - readonly SVG_SPREADMETHOD_PAD: number; - readonly SVG_SPREADMETHOD_REFLECT: number; - readonly SVG_SPREADMETHOD_REPEAT: number; - readonly SVG_SPREADMETHOD_UNKNOWN: number; -} - -interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { - readonly height: SVGAnimatedLength; - readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGImageElement: { - prototype: SVGImageElement; - new(): SVGImageElement; -} - -interface SVGLength { - readonly unitType: number; - value: number; - valueAsString: string; - valueInSpecifiedUnits: number; - convertToSpecifiedUnits(unitType: number): void; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - readonly SVG_LENGTHTYPE_CM: number; - readonly SVG_LENGTHTYPE_EMS: number; - readonly SVG_LENGTHTYPE_EXS: number; - readonly SVG_LENGTHTYPE_IN: number; - readonly SVG_LENGTHTYPE_MM: number; - readonly SVG_LENGTHTYPE_NUMBER: number; - readonly SVG_LENGTHTYPE_PC: number; - readonly SVG_LENGTHTYPE_PERCENTAGE: number; - readonly SVG_LENGTHTYPE_PT: number; - readonly SVG_LENGTHTYPE_PX: number; - readonly SVG_LENGTHTYPE_UNKNOWN: number; -} - -declare var SVGLength: { - prototype: SVGLength; - new(): SVGLength; - readonly SVG_LENGTHTYPE_CM: number; - readonly SVG_LENGTHTYPE_EMS: number; - readonly SVG_LENGTHTYPE_EXS: number; - readonly SVG_LENGTHTYPE_IN: number; - readonly SVG_LENGTHTYPE_MM: number; - readonly SVG_LENGTHTYPE_NUMBER: number; - readonly SVG_LENGTHTYPE_PC: number; - readonly SVG_LENGTHTYPE_PERCENTAGE: number; - readonly SVG_LENGTHTYPE_PT: number; - readonly SVG_LENGTHTYPE_PX: number; - readonly SVG_LENGTHTYPE_UNKNOWN: number; -} - -interface SVGLengthList { - readonly numberOfItems: number; - appendItem(newItem: SVGLength): SVGLength; - clear(): void; - getItem(index: number): SVGLength; - initialize(newItem: SVGLength): SVGLength; - insertItemBefore(newItem: SVGLength, index: number): SVGLength; - removeItem(index: number): SVGLength; - replaceItem(newItem: SVGLength, index: number): SVGLength; -} - -declare var SVGLengthList: { - prototype: SVGLengthList; - new(): SVGLengthList; -} - -interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly x1: SVGAnimatedLength; - readonly x2: SVGAnimatedLength; - readonly y1: SVGAnimatedLength; - readonly y2: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGLineElement: { - prototype: SVGLineElement; - new(): SVGLineElement; -} - -interface SVGLinearGradientElement extends SVGGradientElement { - readonly x1: SVGAnimatedLength; - readonly x2: SVGAnimatedLength; - readonly y1: SVGAnimatedLength; - readonly y2: SVGAnimatedLength; -} - -declare var SVGLinearGradientElement: { - prototype: SVGLinearGradientElement; - new(): SVGLinearGradientElement; -} - -interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox { - readonly markerHeight: SVGAnimatedLength; - readonly markerUnits: SVGAnimatedEnumeration; - readonly markerWidth: SVGAnimatedLength; - readonly orientAngle: SVGAnimatedAngle; - readonly orientType: SVGAnimatedEnumeration; - readonly refX: SVGAnimatedLength; - readonly refY: SVGAnimatedLength; - setOrientToAngle(angle: SVGAngle): void; - setOrientToAuto(): void; - readonly SVG_MARKERUNITS_STROKEWIDTH: number; - readonly SVG_MARKERUNITS_UNKNOWN: number; - readonly SVG_MARKERUNITS_USERSPACEONUSE: number; - readonly SVG_MARKER_ORIENT_ANGLE: number; - readonly SVG_MARKER_ORIENT_AUTO: number; - readonly SVG_MARKER_ORIENT_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGMarkerElement: { - prototype: SVGMarkerElement; - new(): SVGMarkerElement; - readonly SVG_MARKERUNITS_STROKEWIDTH: number; - readonly SVG_MARKERUNITS_UNKNOWN: number; - readonly SVG_MARKERUNITS_USERSPACEONUSE: number; - readonly SVG_MARKER_ORIENT_ANGLE: number; - readonly SVG_MARKER_ORIENT_AUTO: number; - readonly SVG_MARKER_ORIENT_UNKNOWN: number; -} - -interface SVGMaskElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes { - readonly height: SVGAnimatedLength; - readonly maskContentUnits: SVGAnimatedEnumeration; - readonly maskUnits: SVGAnimatedEnumeration; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGMaskElement: { - prototype: SVGMaskElement; - new(): SVGMaskElement; -} - -interface SVGMatrix { - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; - flipX(): SVGMatrix; - flipY(): SVGMatrix; - inverse(): SVGMatrix; - multiply(secondMatrix: SVGMatrix): SVGMatrix; - rotate(angle: number): SVGMatrix; - rotateFromVector(x: number, y: number): SVGMatrix; - scale(scaleFactor: number): SVGMatrix; - scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; - skewX(angle: number): SVGMatrix; - skewY(angle: number): SVGMatrix; - translate(x: number, y: number): SVGMatrix; -} - -declare var SVGMatrix: { - prototype: SVGMatrix; - new(): SVGMatrix; -} - -interface SVGMetadataElement extends SVGElement { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGMetadataElement: { - prototype: SVGMetadataElement; - new(): SVGMetadataElement; -} - -interface SVGNumber { - value: number; -} - -declare var SVGNumber: { - prototype: SVGNumber; - new(): SVGNumber; -} - -interface SVGNumberList { - readonly numberOfItems: number; - appendItem(newItem: SVGNumber): SVGNumber; - clear(): void; - getItem(index: number): SVGNumber; - initialize(newItem: SVGNumber): SVGNumber; - insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; - removeItem(index: number): SVGNumber; - replaceItem(newItem: SVGNumber, index: number): SVGNumber; -} - -declare var SVGNumberList: { - prototype: SVGNumberList; - new(): SVGNumberList; -} - -interface SVGPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPathData { - createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; - createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; - createSVGPathSegClosePath(): SVGPathSegClosePath; - createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; - createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; - createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; - createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; - createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; - createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; - createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; - createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; - createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; - createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; - createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; - createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; - createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; - createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; - createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; - createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; - getPathSegAtLength(distance: number): number; - getPointAtLength(distance: number): SVGPoint; - getTotalLength(): number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPathElement: { - prototype: SVGPathElement; - new(): SVGPathElement; -} - -interface SVGPathSeg { - readonly pathSegType: number; - readonly pathSegTypeAsLetter: string; - readonly PATHSEG_ARC_ABS: number; - readonly PATHSEG_ARC_REL: number; - readonly PATHSEG_CLOSEPATH: number; - readonly PATHSEG_CURVETO_CUBIC_ABS: number; - readonly PATHSEG_CURVETO_CUBIC_REL: number; - readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - readonly PATHSEG_CURVETO_QUADRATIC_ABS: number; - readonly PATHSEG_CURVETO_QUADRATIC_REL: number; - readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; - readonly PATHSEG_LINETO_ABS: number; - readonly PATHSEG_LINETO_HORIZONTAL_ABS: number; - readonly PATHSEG_LINETO_HORIZONTAL_REL: number; - readonly PATHSEG_LINETO_REL: number; - readonly PATHSEG_LINETO_VERTICAL_ABS: number; - readonly PATHSEG_LINETO_VERTICAL_REL: number; - readonly PATHSEG_MOVETO_ABS: number; - readonly PATHSEG_MOVETO_REL: number; - readonly PATHSEG_UNKNOWN: number; -} - -declare var SVGPathSeg: { - prototype: SVGPathSeg; - new(): SVGPathSeg; - readonly PATHSEG_ARC_ABS: number; - readonly PATHSEG_ARC_REL: number; - readonly PATHSEG_CLOSEPATH: number; - readonly PATHSEG_CURVETO_CUBIC_ABS: number; - readonly PATHSEG_CURVETO_CUBIC_REL: number; - readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - readonly PATHSEG_CURVETO_QUADRATIC_ABS: number; - readonly PATHSEG_CURVETO_QUADRATIC_REL: number; - readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; - readonly PATHSEG_LINETO_ABS: number; - readonly PATHSEG_LINETO_HORIZONTAL_ABS: number; - readonly PATHSEG_LINETO_HORIZONTAL_REL: number; - readonly PATHSEG_LINETO_REL: number; - readonly PATHSEG_LINETO_VERTICAL_ABS: number; - readonly PATHSEG_LINETO_VERTICAL_REL: number; - readonly PATHSEG_MOVETO_ABS: number; - readonly PATHSEG_MOVETO_REL: number; - readonly PATHSEG_UNKNOWN: number; -} - -interface SVGPathSegArcAbs extends SVGPathSeg { - angle: number; - largeArcFlag: boolean; - r1: number; - r2: number; - sweepFlag: boolean; - x: number; - y: number; -} - -declare var SVGPathSegArcAbs: { - prototype: SVGPathSegArcAbs; - new(): SVGPathSegArcAbs; -} - -interface SVGPathSegArcRel extends SVGPathSeg { - angle: number; - largeArcFlag: boolean; - r1: number; - r2: number; - sweepFlag: boolean; - x: number; - y: number; -} - -declare var SVGPathSegArcRel: { - prototype: SVGPathSegArcRel; - new(): SVGPathSegArcRel; -} - -interface SVGPathSegClosePath extends SVGPathSeg { -} - -declare var SVGPathSegClosePath: { - prototype: SVGPathSegClosePath; - new(): SVGPathSegClosePath; -} - -interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { - x: number; - x1: number; - x2: number; - y: number; - y1: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicAbs: { - prototype: SVGPathSegCurvetoCubicAbs; - new(): SVGPathSegCurvetoCubicAbs; -} - -interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { - x: number; - x1: number; - x2: number; - y: number; - y1: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicRel: { - prototype: SVGPathSegCurvetoCubicRel; - new(): SVGPathSegCurvetoCubicRel; -} - -interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { - x: number; - x2: number; - y: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicSmoothAbs: { - prototype: SVGPathSegCurvetoCubicSmoothAbs; - new(): SVGPathSegCurvetoCubicSmoothAbs; -} - -interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { - x: number; - x2: number; - y: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicSmoothRel: { - prototype: SVGPathSegCurvetoCubicSmoothRel; - new(): SVGPathSegCurvetoCubicSmoothRel; -} - -interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { - x: number; - x1: number; - y: number; - y1: number; -} - -declare var SVGPathSegCurvetoQuadraticAbs: { - prototype: SVGPathSegCurvetoQuadraticAbs; - new(): SVGPathSegCurvetoQuadraticAbs; -} - -interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { - x: number; - x1: number; - y: number; - y1: number; -} - -declare var SVGPathSegCurvetoQuadraticRel: { - prototype: SVGPathSegCurvetoQuadraticRel; - new(): SVGPathSegCurvetoQuadraticRel; -} - -interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegCurvetoQuadraticSmoothAbs: { - prototype: SVGPathSegCurvetoQuadraticSmoothAbs; - new(): SVGPathSegCurvetoQuadraticSmoothAbs; -} - -interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegCurvetoQuadraticSmoothRel: { - prototype: SVGPathSegCurvetoQuadraticSmoothRel; - new(): SVGPathSegCurvetoQuadraticSmoothRel; -} - -interface SVGPathSegLinetoAbs extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegLinetoAbs: { - prototype: SVGPathSegLinetoAbs; - new(): SVGPathSegLinetoAbs; -} - -interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { - x: number; -} - -declare var SVGPathSegLinetoHorizontalAbs: { - prototype: SVGPathSegLinetoHorizontalAbs; - new(): SVGPathSegLinetoHorizontalAbs; -} - -interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { - x: number; -} - -declare var SVGPathSegLinetoHorizontalRel: { - prototype: SVGPathSegLinetoHorizontalRel; - new(): SVGPathSegLinetoHorizontalRel; -} - -interface SVGPathSegLinetoRel extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegLinetoRel: { - prototype: SVGPathSegLinetoRel; - new(): SVGPathSegLinetoRel; -} - -interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { - y: number; -} - -declare var SVGPathSegLinetoVerticalAbs: { - prototype: SVGPathSegLinetoVerticalAbs; - new(): SVGPathSegLinetoVerticalAbs; -} - -interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { - y: number; -} - -declare var SVGPathSegLinetoVerticalRel: { - prototype: SVGPathSegLinetoVerticalRel; - new(): SVGPathSegLinetoVerticalRel; -} - -interface SVGPathSegList { - readonly numberOfItems: number; - appendItem(newItem: SVGPathSeg): SVGPathSeg; - clear(): void; - getItem(index: number): SVGPathSeg; - initialize(newItem: SVGPathSeg): SVGPathSeg; - insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; - removeItem(index: number): SVGPathSeg; - replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; -} - -declare var SVGPathSegList: { - prototype: SVGPathSegList; - new(): SVGPathSegList; -} - -interface SVGPathSegMovetoAbs extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegMovetoAbs: { - prototype: SVGPathSegMovetoAbs; - new(): SVGPathSegMovetoAbs; -} - -interface SVGPathSegMovetoRel extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegMovetoRel: { - prototype: SVGPathSegMovetoRel; - new(): SVGPathSegMovetoRel; -} - -interface SVGPatternElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGURIReference, SVGUnitTypes { - readonly height: SVGAnimatedLength; - readonly patternContentUnits: SVGAnimatedEnumeration; - readonly patternTransform: SVGAnimatedTransformList; - readonly patternUnits: SVGAnimatedEnumeration; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPatternElement: { - prototype: SVGPatternElement; - new(): SVGPatternElement; -} - -interface SVGPoint { - x: number; - y: number; - matrixTransform(matrix: SVGMatrix): SVGPoint; -} - -declare var SVGPoint: { - prototype: SVGPoint; - new(): SVGPoint; -} - -interface SVGPointList { - readonly numberOfItems: number; - appendItem(newItem: SVGPoint): SVGPoint; - clear(): void; - getItem(index: number): SVGPoint; - initialize(newItem: SVGPoint): SVGPoint; - insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; - removeItem(index: number): SVGPoint; - replaceItem(newItem: SVGPoint, index: number): SVGPoint; -} - -declare var SVGPointList: { - prototype: SVGPointList; - new(): SVGPointList; -} - -interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPolygonElement: { - prototype: SVGPolygonElement; - new(): SVGPolygonElement; -} - -interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPolylineElement: { - prototype: SVGPolylineElement; - new(): SVGPolylineElement; -} - -interface SVGPreserveAspectRatio { - align: number; - meetOrSlice: number; - readonly SVG_MEETORSLICE_MEET: number; - readonly SVG_MEETORSLICE_SLICE: number; - readonly SVG_MEETORSLICE_UNKNOWN: number; - readonly SVG_PRESERVEASPECTRATIO_NONE: number; - readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number; -} - -declare var SVGPreserveAspectRatio: { - prototype: SVGPreserveAspectRatio; - new(): SVGPreserveAspectRatio; - readonly SVG_MEETORSLICE_MEET: number; - readonly SVG_MEETORSLICE_SLICE: number; - readonly SVG_MEETORSLICE_UNKNOWN: number; - readonly SVG_PRESERVEASPECTRATIO_NONE: number; - readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number; -} - -interface SVGRadialGradientElement extends SVGGradientElement { - readonly cx: SVGAnimatedLength; - readonly cy: SVGAnimatedLength; - readonly fx: SVGAnimatedLength; - readonly fy: SVGAnimatedLength; - readonly r: SVGAnimatedLength; -} - -declare var SVGRadialGradientElement: { - prototype: SVGRadialGradientElement; - new(): SVGRadialGradientElement; -} - -interface SVGRect { - height: number; - width: number; - x: number; - y: number; -} - -declare var SVGRect: { - prototype: SVGRect; - new(): SVGRect; -} - -interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly height: SVGAnimatedLength; - readonly rx: SVGAnimatedLength; - readonly ry: SVGAnimatedLength; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGRectElement: { - prototype: SVGRectElement; - new(): SVGRectElement; -} - -interface SVGSVGElementEventMap extends SVGElementEventMap { - "SVGAbort": Event; - "SVGError": Event; - "resize": UIEvent; - "scroll": UIEvent; - "SVGUnload": Event; - "SVGZoom": SVGZoomEvent; -} - -interface SVGSVGElement extends SVGElement, DocumentEvent, SVGLocatable, SVGTests, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan { - contentScriptType: string; - contentStyleType: string; - currentScale: number; - readonly currentTranslate: SVGPoint; - readonly height: SVGAnimatedLength; - onabort: (this: SVGSVGElement, ev: Event) => any; - onerror: (this: SVGSVGElement, ev: Event) => any; - onresize: (this: SVGSVGElement, ev: UIEvent) => any; - onscroll: (this: SVGSVGElement, ev: UIEvent) => any; - onunload: (this: SVGSVGElement, ev: Event) => any; - onzoom: (this: SVGSVGElement, ev: SVGZoomEvent) => any; - readonly pixelUnitToMillimeterX: number; - readonly pixelUnitToMillimeterY: number; - readonly screenPixelToMillimeterX: number; - readonly screenPixelToMillimeterY: number; - readonly viewport: SVGRect; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - checkEnclosure(element: SVGElement, rect: SVGRect): boolean; - checkIntersection(element: SVGElement, rect: SVGRect): boolean; - createSVGAngle(): SVGAngle; - createSVGLength(): SVGLength; - createSVGMatrix(): SVGMatrix; - createSVGNumber(): SVGNumber; - createSVGPoint(): SVGPoint; - createSVGRect(): SVGRect; - createSVGTransform(): SVGTransform; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; - deselectAll(): void; - forceRedraw(): void; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - getCurrentTime(): number; - getElementById(elementId: string): Element; - getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeListOf; - getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeListOf; - pauseAnimations(): void; - setCurrentTime(seconds: number): void; - suspendRedraw(maxWaitMilliseconds: number): number; - unpauseAnimations(): void; - unsuspendRedraw(suspendHandleID: number): void; - unsuspendRedrawAll(): void; - addEventListener(type: K, listener: (this: SVGSVGElement, ev: SVGSVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGSVGElement: { - prototype: SVGSVGElement; - new(): SVGSVGElement; -} - -interface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference { - type: string; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGScriptElement: { - prototype: SVGScriptElement; - new(): SVGScriptElement; -} - -interface SVGStopElement extends SVGElement, SVGStylable { - readonly offset: SVGAnimatedNumber; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGStopElement: { - prototype: SVGStopElement; - new(): SVGStopElement; -} - -interface SVGStringList { - readonly numberOfItems: number; - appendItem(newItem: string): string; - clear(): void; - getItem(index: number): string; - initialize(newItem: string): string; - insertItemBefore(newItem: string, index: number): string; - removeItem(index: number): string; - replaceItem(newItem: string, index: number): string; -} - -declare var SVGStringList: { - prototype: SVGStringList; - new(): SVGStringList; -} - -interface SVGStyleElement extends SVGElement, SVGLangSpace { - disabled: boolean; - media: string; - title: string; - type: string; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGStyleElement: { - prototype: SVGStyleElement; - new(): SVGStyleElement; -} - -interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGSwitchElement: { - prototype: SVGSwitchElement; - new(): SVGSwitchElement; -} - -interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGSymbolElement: { - prototype: SVGSymbolElement; - new(): SVGSymbolElement; -} - -interface SVGTSpanElement extends SVGTextPositioningElement { -} - -declare var SVGTSpanElement: { - prototype: SVGTSpanElement; - new(): SVGTSpanElement; -} - -interface SVGTextContentElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - readonly lengthAdjust: SVGAnimatedEnumeration; - readonly textLength: SVGAnimatedLength; - getCharNumAtPosition(point: SVGPoint): number; - getComputedTextLength(): number; - getEndPositionOfChar(charnum: number): SVGPoint; - getExtentOfChar(charnum: number): SVGRect; - getNumberOfChars(): number; - getRotationOfChar(charnum: number): number; - getStartPositionOfChar(charnum: number): SVGPoint; - getSubStringLength(charnum: number, nchars: number): number; - selectSubString(charnum: number, nchars: number): void; - readonly LENGTHADJUST_SPACING: number; - readonly LENGTHADJUST_SPACINGANDGLYPHS: number; - readonly LENGTHADJUST_UNKNOWN: number; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGTextContentElement: { - prototype: SVGTextContentElement; - new(): SVGTextContentElement; - readonly LENGTHADJUST_SPACING: number; - readonly LENGTHADJUST_SPACINGANDGLYPHS: number; - readonly LENGTHADJUST_UNKNOWN: number; -} - -interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable { -} - -declare var SVGTextElement: { - prototype: SVGTextElement; - new(): SVGTextElement; -} - -interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { - readonly method: SVGAnimatedEnumeration; - readonly spacing: SVGAnimatedEnumeration; - readonly startOffset: SVGAnimatedLength; - readonly TEXTPATH_METHODTYPE_ALIGN: number; - readonly TEXTPATH_METHODTYPE_STRETCH: number; - readonly TEXTPATH_METHODTYPE_UNKNOWN: number; - readonly TEXTPATH_SPACINGTYPE_AUTO: number; - readonly TEXTPATH_SPACINGTYPE_EXACT: number; - readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number; -} - -declare var SVGTextPathElement: { - prototype: SVGTextPathElement; - new(): SVGTextPathElement; - readonly TEXTPATH_METHODTYPE_ALIGN: number; - readonly TEXTPATH_METHODTYPE_STRETCH: number; - readonly TEXTPATH_METHODTYPE_UNKNOWN: number; - readonly TEXTPATH_SPACINGTYPE_AUTO: number; - readonly TEXTPATH_SPACINGTYPE_EXACT: number; - readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number; -} - -interface SVGTextPositioningElement extends SVGTextContentElement { - readonly dx: SVGAnimatedLengthList; - readonly dy: SVGAnimatedLengthList; - readonly rotate: SVGAnimatedNumberList; - readonly x: SVGAnimatedLengthList; - readonly y: SVGAnimatedLengthList; -} - -declare var SVGTextPositioningElement: { - prototype: SVGTextPositioningElement; - new(): SVGTextPositioningElement; -} - -interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace { - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGTitleElement: { - prototype: SVGTitleElement; - new(): SVGTitleElement; -} - -interface SVGTransform { - readonly angle: number; - readonly matrix: SVGMatrix; - readonly type: number; - setMatrix(matrix: SVGMatrix): void; - setRotate(angle: number, cx: number, cy: number): void; - setScale(sx: number, sy: number): void; - setSkewX(angle: number): void; - setSkewY(angle: number): void; - setTranslate(tx: number, ty: number): void; - readonly SVG_TRANSFORM_MATRIX: number; - readonly SVG_TRANSFORM_ROTATE: number; - readonly SVG_TRANSFORM_SCALE: number; - readonly SVG_TRANSFORM_SKEWX: number; - readonly SVG_TRANSFORM_SKEWY: number; - readonly SVG_TRANSFORM_TRANSLATE: number; - readonly SVG_TRANSFORM_UNKNOWN: number; -} - -declare var SVGTransform: { - prototype: SVGTransform; - new(): SVGTransform; - readonly SVG_TRANSFORM_MATRIX: number; - readonly SVG_TRANSFORM_ROTATE: number; - readonly SVG_TRANSFORM_SCALE: number; - readonly SVG_TRANSFORM_SKEWX: number; - readonly SVG_TRANSFORM_SKEWY: number; - readonly SVG_TRANSFORM_TRANSLATE: number; - readonly SVG_TRANSFORM_UNKNOWN: number; -} - -interface SVGTransformList { - readonly numberOfItems: number; - appendItem(newItem: SVGTransform): SVGTransform; - clear(): void; - consolidate(): SVGTransform; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; - getItem(index: number): SVGTransform; - initialize(newItem: SVGTransform): SVGTransform; - insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; - removeItem(index: number): SVGTransform; - replaceItem(newItem: SVGTransform, index: number): SVGTransform; -} - -declare var SVGTransformList: { - prototype: SVGTransformList; - new(): SVGTransformList; -} - -interface SVGUnitTypes { - readonly SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; - readonly SVG_UNIT_TYPE_UNKNOWN: number; - readonly SVG_UNIT_TYPE_USERSPACEONUSE: number; -} -declare var SVGUnitTypes: SVGUnitTypes; - -interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { - readonly animatedInstanceRoot: SVGElementInstance; - readonly height: SVGAnimatedLength; - readonly instanceRoot: SVGElementInstance; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGUseElement: { - prototype: SVGUseElement; - new(): SVGUseElement; -} - -interface SVGViewElement extends SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan { - readonly viewTarget: SVGStringList; - addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGViewElement: { - prototype: SVGViewElement; - new(): SVGViewElement; -} - -interface SVGZoomAndPan { - readonly zoomAndPan: number; -} - -declare var SVGZoomAndPan: { - readonly SVG_ZOOMANDPAN_DISABLE: number; - readonly SVG_ZOOMANDPAN_MAGNIFY: number; - readonly SVG_ZOOMANDPAN_UNKNOWN: number; -} - -interface SVGZoomEvent extends UIEvent { - readonly newScale: number; - readonly newTranslate: SVGPoint; - readonly previousScale: number; - readonly previousTranslate: SVGPoint; - readonly zoomRectScreen: SVGRect; -} - -declare var SVGZoomEvent: { - prototype: SVGZoomEvent; - new(): SVGZoomEvent; -} - -interface ScreenEventMap { - "MSOrientationChange": Event; -} - -interface Screen extends EventTarget { - readonly availHeight: number; - readonly availWidth: number; - bufferDepth: number; - readonly colorDepth: number; - readonly deviceXDPI: number; - readonly deviceYDPI: number; - readonly fontSmoothingEnabled: boolean; - readonly height: number; - readonly logicalXDPI: number; - readonly logicalYDPI: number; - readonly msOrientation: string; - onmsorientationchange: (this: Screen, ev: Event) => any; - readonly pixelDepth: number; - readonly systemXDPI: number; - readonly systemYDPI: number; - readonly width: number; - msLockOrientation(orientations: string | string[]): boolean; - msUnlockOrientation(): void; - addEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Screen: { - prototype: Screen; - new(): Screen; -} - -interface ScriptNotifyEvent extends Event { - readonly callingUri: string; - readonly value: string; -} - -declare var ScriptNotifyEvent: { - prototype: ScriptNotifyEvent; - new(): ScriptNotifyEvent; -} - -interface ScriptProcessorNodeEventMap { - "audioprocess": AudioProcessingEvent; -} - -interface ScriptProcessorNode extends AudioNode { - readonly bufferSize: number; - onaudioprocess: (this: ScriptProcessorNode, ev: AudioProcessingEvent) => any; - addEventListener(type: K, listener: (this: ScriptProcessorNode, ev: ScriptProcessorNodeEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var ScriptProcessorNode: { - prototype: ScriptProcessorNode; - new(): ScriptProcessorNode; -} - -interface Selection { - readonly anchorNode: Node; - readonly anchorOffset: number; - readonly focusNode: Node; - readonly focusOffset: number; - readonly isCollapsed: boolean; - readonly rangeCount: number; - readonly type: string; - addRange(range: Range): void; - collapse(parentNode: Node, offset: number): void; - collapseToEnd(): void; - collapseToStart(): void; - containsNode(node: Node, partlyContained: boolean): boolean; - deleteFromDocument(): void; - empty(): void; - extend(newNode: Node, offset: number): void; - getRangeAt(index: number): Range; - removeAllRanges(): void; - removeRange(range: Range): void; - selectAllChildren(parentNode: Node): void; - setBaseAndExtent(baseNode: Node, baseOffset: number, extentNode: Node, extentOffset: number): void; - toString(): string; -} - -declare var Selection: { - prototype: Selection; - new(): Selection; -} - -interface SourceBuffer extends EventTarget { - appendWindowEnd: number; - appendWindowStart: number; - readonly audioTracks: AudioTrackList; - readonly buffered: TimeRanges; - mode: string; - timestampOffset: number; - readonly updating: boolean; - readonly videoTracks: VideoTrackList; - abort(): void; - appendBuffer(data: ArrayBuffer | ArrayBufferView): void; - appendStream(stream: MSStream, maxSize?: number): void; - remove(start: number, end: number): void; -} - -declare var SourceBuffer: { - prototype: SourceBuffer; - new(): SourceBuffer; -} - -interface SourceBufferList extends EventTarget { - readonly length: number; - item(index: number): SourceBuffer; - [index: number]: SourceBuffer; -} - -declare var SourceBufferList: { - prototype: SourceBufferList; - new(): SourceBufferList; -} - -interface StereoPannerNode extends AudioNode { - readonly pan: AudioParam; -} - -declare var StereoPannerNode: { - prototype: StereoPannerNode; - new(): StereoPannerNode; -} - -interface Storage { - readonly length: number; - clear(): void; - getItem(key: string): string | null; - key(index: number): string | null; - removeItem(key: string): void; - setItem(key: string, data: string): void; - [key: string]: any; - [index: number]: string; -} - -declare var Storage: { - prototype: Storage; - new(): Storage; -} - -interface StorageEvent extends Event { - readonly url: string; - key?: string; - oldValue?: string; - newValue?: string; - storageArea?: Storage; -} - -declare var StorageEvent: { - prototype: StorageEvent; - new (type: string, eventInitDict?: StorageEventInit): StorageEvent; -} - -interface StyleMedia { - readonly type: string; - matchMedium(mediaquery: string): boolean; -} - -declare var StyleMedia: { - prototype: StyleMedia; - new(): StyleMedia; -} - -interface StyleSheet { - disabled: boolean; - readonly href: string; - readonly media: MediaList; - readonly ownerNode: Node; - readonly parentStyleSheet: StyleSheet; - readonly title: string; - readonly type: string; -} - -declare var StyleSheet: { - prototype: StyleSheet; - new(): StyleSheet; -} - -interface StyleSheetList { - readonly length: number; - item(index?: number): StyleSheet; - [index: number]: StyleSheet; -} - -declare var StyleSheetList: { - prototype: StyleSheetList; - new(): StyleSheetList; -} - -interface StyleSheetPageList { - readonly length: number; - item(index: number): CSSPageRule; - [index: number]: CSSPageRule; -} - -declare var StyleSheetPageList: { - prototype: StyleSheetPageList; - new(): StyleSheetPageList; -} - -interface SubtleCrypto { - decrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): PromiseLike; - deriveBits(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, length: number): PromiseLike; - deriveKey(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike; - digest(algorithm: AlgorithmIdentifier, data: BufferSource): PromiseLike; - encrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): PromiseLike; - exportKey(format: "jwk", key: CryptoKey): PromiseLike; - exportKey(format: "raw" | "pkcs8" | "spki", key: CryptoKey): PromiseLike; - exportKey(format: string, key: CryptoKey): PromiseLike; - generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): PromiseLike; - generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: string[]): PromiseLike; - generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike; - importKey(format: "jwk", keyData: JsonWebKey, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike; - importKey(format: "raw" | "pkcs8" | "spki", keyData: BufferSource, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike; - importKey(format: string, keyData: JsonWebKey | BufferSource, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike; - sign(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, data: BufferSource): PromiseLike; - unwrapKey(format: string, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: string[]): PromiseLike; - verify(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, signature: BufferSource, data: BufferSource): PromiseLike; - wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier): PromiseLike; -} - -declare var SubtleCrypto: { - prototype: SubtleCrypto; - new(): SubtleCrypto; -} - -interface Text extends CharacterData { - readonly wholeText: string; - readonly assignedSlot: HTMLSlotElement | null; - splitText(offset: number): Text; -} - -declare var Text: { - prototype: Text; - new(): Text; -} - -interface TextEvent extends UIEvent { - readonly data: string; - readonly inputMethod: number; - readonly locale: string; - initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; - readonly DOM_INPUT_METHOD_DROP: number; - readonly DOM_INPUT_METHOD_HANDWRITING: number; - readonly DOM_INPUT_METHOD_IME: number; - readonly DOM_INPUT_METHOD_KEYBOARD: number; - readonly DOM_INPUT_METHOD_MULTIMODAL: number; - readonly DOM_INPUT_METHOD_OPTION: number; - readonly DOM_INPUT_METHOD_PASTE: number; - readonly DOM_INPUT_METHOD_SCRIPT: number; - readonly DOM_INPUT_METHOD_UNKNOWN: number; - readonly DOM_INPUT_METHOD_VOICE: number; -} - -declare var TextEvent: { - prototype: TextEvent; - new(): TextEvent; - readonly DOM_INPUT_METHOD_DROP: number; - readonly DOM_INPUT_METHOD_HANDWRITING: number; - readonly DOM_INPUT_METHOD_IME: number; - readonly DOM_INPUT_METHOD_KEYBOARD: number; - readonly DOM_INPUT_METHOD_MULTIMODAL: number; - readonly DOM_INPUT_METHOD_OPTION: number; - readonly DOM_INPUT_METHOD_PASTE: number; - readonly DOM_INPUT_METHOD_SCRIPT: number; - readonly DOM_INPUT_METHOD_UNKNOWN: number; - readonly DOM_INPUT_METHOD_VOICE: number; -} - -interface TextMetrics { - readonly width: number; -} - -declare var TextMetrics: { - prototype: TextMetrics; - new(): TextMetrics; -} - -interface TextTrackEventMap { - "cuechange": Event; - "error": ErrorEvent; - "load": Event; -} - -interface TextTrack extends EventTarget { - readonly activeCues: TextTrackCueList; - readonly cues: TextTrackCueList; - readonly inBandMetadataTrackDispatchType: string; - readonly kind: string; - readonly label: string; - readonly language: string; - mode: any; - oncuechange: (this: TextTrack, ev: Event) => any; - onerror: (this: TextTrack, ev: ErrorEvent) => any; - onload: (this: TextTrack, ev: Event) => any; - readonly readyState: number; - addCue(cue: TextTrackCue): void; - removeCue(cue: TextTrackCue): void; - readonly DISABLED: number; - readonly ERROR: number; - readonly HIDDEN: number; - readonly LOADED: number; - readonly LOADING: number; - readonly NONE: number; - readonly SHOWING: number; - addEventListener(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var TextTrack: { - prototype: TextTrack; - new(): TextTrack; - readonly DISABLED: number; - readonly ERROR: number; - readonly HIDDEN: number; - readonly LOADED: number; - readonly LOADING: number; - readonly NONE: number; - readonly SHOWING: number; -} - -interface TextTrackCueEventMap { - "enter": Event; - "exit": Event; -} - -interface TextTrackCue extends EventTarget { - endTime: number; - id: string; - onenter: (this: TextTrackCue, ev: Event) => any; - onexit: (this: TextTrackCue, ev: Event) => any; - pauseOnExit: boolean; - startTime: number; - text: string; - readonly track: TextTrack; - getCueAsHTML(): DocumentFragment; - addEventListener(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var TextTrackCue: { - prototype: TextTrackCue; - new(startTime: number, endTime: number, text: string): TextTrackCue; -} - -interface TextTrackCueList { - readonly length: number; - getCueById(id: string): TextTrackCue; - item(index: number): TextTrackCue; - [index: number]: TextTrackCue; -} - -declare var TextTrackCueList: { - prototype: TextTrackCueList; - new(): TextTrackCueList; -} - -interface TextTrackListEventMap { - "addtrack": TrackEvent; -} - -interface TextTrackList extends EventTarget { - readonly length: number; - onaddtrack: ((this: TextTrackList, ev: TrackEvent) => any) | null; - item(index: number): TextTrack; - addEventListener(type: K, listener: (this: TextTrackList, ev: TextTrackListEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [index: number]: TextTrack; -} - -declare var TextTrackList: { - prototype: TextTrackList; - new(): TextTrackList; -} - -interface TimeRanges { - readonly length: number; - end(index: number): number; - start(index: number): number; -} - -declare var TimeRanges: { - prototype: TimeRanges; - new(): TimeRanges; -} - -interface Touch { - readonly clientX: number; - readonly clientY: number; - readonly identifier: number; - readonly pageX: number; - readonly pageY: number; - readonly screenX: number; - readonly screenY: number; - readonly target: EventTarget; -} - -declare var Touch: { - prototype: Touch; - new(): Touch; -} - -interface TouchEvent extends UIEvent { - readonly altKey: boolean; - readonly changedTouches: TouchList; - readonly ctrlKey: boolean; - readonly metaKey: boolean; - readonly shiftKey: boolean; - readonly targetTouches: TouchList; - readonly touches: TouchList; -} - -declare var TouchEvent: { - prototype: TouchEvent; - new(): TouchEvent; -} - -interface TouchList { - readonly length: number; - item(index: number): Touch | null; - [index: number]: Touch; -} - -declare var TouchList: { - prototype: TouchList; - new(): TouchList; -} - -interface TrackEvent extends Event { - readonly track: any; -} - -declare var TrackEvent: { - prototype: TrackEvent; - new(): TrackEvent; -} - -interface TransitionEvent extends Event { - readonly elapsedTime: number; - readonly propertyName: string; - initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; -} - -declare var TransitionEvent: { - prototype: TransitionEvent; - new(): TransitionEvent; -} - -interface TreeWalker { - currentNode: Node; - readonly expandEntityReferences: boolean; - readonly filter: NodeFilter; - readonly root: Node; - readonly whatToShow: number; - firstChild(): Node; - lastChild(): Node; - nextNode(): Node; - nextSibling(): Node; - parentNode(): Node; - previousNode(): Node; - previousSibling(): Node; -} - -declare var TreeWalker: { - prototype: TreeWalker; - new(): TreeWalker; -} - -interface UIEvent extends Event { - readonly detail: number; - readonly view: Window; - initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; -} - -declare var UIEvent: { - prototype: UIEvent; - new(type: string, eventInitDict?: UIEventInit): UIEvent; -} - -interface URL { - hash: string; - host: string; - hostname: string; - href: string; - readonly origin: string; - password: string; - pathname: string; - port: string; - protocol: string; - search: string; - username: string; - toString(): string; -} - -declare var URL: { - prototype: URL; - new(url: string, base?: string): URL; - createObjectURL(object: any, options?: ObjectURLOptions): string; - revokeObjectURL(url: string): void; -} - -interface UnviewableContentIdentifiedEvent extends NavigationEventWithReferrer { - readonly mediaType: string; -} - -declare var UnviewableContentIdentifiedEvent: { - prototype: UnviewableContentIdentifiedEvent; - new(): UnviewableContentIdentifiedEvent; -} - -interface ValidityState { - readonly badInput: boolean; - readonly customError: boolean; - readonly patternMismatch: boolean; - readonly rangeOverflow: boolean; - readonly rangeUnderflow: boolean; - readonly stepMismatch: boolean; - readonly tooLong: boolean; - readonly typeMismatch: boolean; - readonly valid: boolean; - readonly valueMissing: boolean; -} - -declare var ValidityState: { - prototype: ValidityState; - new(): ValidityState; -} - -interface VideoPlaybackQuality { - readonly corruptedVideoFrames: number; - readonly creationTime: number; - readonly droppedVideoFrames: number; - readonly totalFrameDelay: number; - readonly totalVideoFrames: number; -} - -declare var VideoPlaybackQuality: { - prototype: VideoPlaybackQuality; - new(): VideoPlaybackQuality; -} - -interface VideoTrack { - readonly id: string; - kind: string; - readonly label: string; - language: string; - selected: boolean; - readonly sourceBuffer: SourceBuffer; -} - -declare var VideoTrack: { - prototype: VideoTrack; - new(): VideoTrack; -} - -interface VideoTrackListEventMap { - "addtrack": TrackEvent; - "change": Event; - "removetrack": TrackEvent; -} - -interface VideoTrackList extends EventTarget { - readonly length: number; - onaddtrack: (this: VideoTrackList, ev: TrackEvent) => any; - onchange: (this: VideoTrackList, ev: Event) => any; - onremovetrack: (this: VideoTrackList, ev: TrackEvent) => any; - readonly selectedIndex: number; - getTrackById(id: string): VideoTrack | null; - item(index: number): VideoTrack; - addEventListener(type: K, listener: (this: VideoTrackList, ev: VideoTrackListEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [index: number]: VideoTrack; -} - -declare var VideoTrackList: { - prototype: VideoTrackList; - new(): VideoTrackList; -} - -interface WEBGL_compressed_texture_s3tc { - readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} - -declare var WEBGL_compressed_texture_s3tc: { - prototype: WEBGL_compressed_texture_s3tc; - new(): WEBGL_compressed_texture_s3tc; - readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} - -interface WEBGL_debug_renderer_info { - readonly UNMASKED_RENDERER_WEBGL: number; - readonly UNMASKED_VENDOR_WEBGL: number; -} - -declare var WEBGL_debug_renderer_info: { - prototype: WEBGL_debug_renderer_info; - new(): WEBGL_debug_renderer_info; - readonly UNMASKED_RENDERER_WEBGL: number; - readonly UNMASKED_VENDOR_WEBGL: number; -} - -interface WEBGL_depth_texture { - readonly UNSIGNED_INT_24_8_WEBGL: number; -} - -declare var WEBGL_depth_texture: { - prototype: WEBGL_depth_texture; - new(): WEBGL_depth_texture; - readonly UNSIGNED_INT_24_8_WEBGL: number; -} - -interface WaveShaperNode extends AudioNode { - curve: Float32Array | null; - oversample: string; -} - -declare var WaveShaperNode: { - prototype: WaveShaperNode; - new(): WaveShaperNode; -} - -interface WebGLActiveInfo { - readonly name: string; - readonly size: number; - readonly type: number; -} - -declare var WebGLActiveInfo: { - prototype: WebGLActiveInfo; - new(): WebGLActiveInfo; -} - -interface WebGLBuffer extends WebGLObject { -} - -declare var WebGLBuffer: { - prototype: WebGLBuffer; - new(): WebGLBuffer; -} - -interface WebGLContextEvent extends Event { - readonly statusMessage: string; -} - -declare var WebGLContextEvent: { - prototype: WebGLContextEvent; - new(type: string, eventInitDict?: WebGLContextEventInit): WebGLContextEvent; -} - -interface WebGLFramebuffer extends WebGLObject { -} - -declare var WebGLFramebuffer: { - prototype: WebGLFramebuffer; - new(): WebGLFramebuffer; -} - -interface WebGLObject { -} - -declare var WebGLObject: { - prototype: WebGLObject; - new(): WebGLObject; -} - -interface WebGLProgram extends WebGLObject { -} - -declare var WebGLProgram: { - prototype: WebGLProgram; - new(): WebGLProgram; -} - -interface WebGLRenderbuffer extends WebGLObject { -} - -declare var WebGLRenderbuffer: { - prototype: WebGLRenderbuffer; - new(): WebGLRenderbuffer; -} - -interface WebGLRenderingContext { - readonly canvas: HTMLCanvasElement; - readonly drawingBufferHeight: number; - readonly drawingBufferWidth: number; - activeTexture(texture: number): void; - attachShader(program: WebGLProgram | null, shader: WebGLShader | null): void; - bindAttribLocation(program: WebGLProgram | null, index: number, name: string): void; - bindBuffer(target: number, buffer: WebGLBuffer | null): void; - bindFramebuffer(target: number, framebuffer: WebGLFramebuffer | null): void; - bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer | null): void; - bindTexture(target: number, texture: WebGLTexture | null): void; - blendColor(red: number, green: number, blue: number, alpha: number): void; - blendEquation(mode: number): void; - blendEquationSeparate(modeRGB: number, modeAlpha: number): void; - blendFunc(sfactor: number, dfactor: number): void; - blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; - bufferData(target: number, size: number | ArrayBufferView | ArrayBuffer, usage: number): void; - bufferSubData(target: number, offset: number, data: ArrayBufferView | ArrayBuffer): void; - checkFramebufferStatus(target: number): number; - clear(mask: number): void; - clearColor(red: number, green: number, blue: number, alpha: number): void; - clearDepth(depth: number): void; - clearStencil(s: number): void; - colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; - compileShader(shader: WebGLShader | null): void; - compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; - compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; - copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; - copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; - createBuffer(): WebGLBuffer | null; - createFramebuffer(): WebGLFramebuffer | null; - createProgram(): WebGLProgram | null; - createRenderbuffer(): WebGLRenderbuffer | null; - createShader(type: number): WebGLShader | null; - createTexture(): WebGLTexture | null; - cullFace(mode: number): void; - deleteBuffer(buffer: WebGLBuffer | null): void; - deleteFramebuffer(framebuffer: WebGLFramebuffer | null): void; - deleteProgram(program: WebGLProgram | null): void; - deleteRenderbuffer(renderbuffer: WebGLRenderbuffer | null): void; - deleteShader(shader: WebGLShader | null): void; - deleteTexture(texture: WebGLTexture | null): void; - depthFunc(func: number): void; - depthMask(flag: boolean): void; - depthRange(zNear: number, zFar: number): void; - detachShader(program: WebGLProgram | null, shader: WebGLShader | null): void; - disable(cap: number): void; - disableVertexAttribArray(index: number): void; - drawArrays(mode: number, first: number, count: number): void; - drawElements(mode: number, count: number, type: number, offset: number): void; - enable(cap: number): void; - enableVertexAttribArray(index: number): void; - finish(): void; - flush(): void; - framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer | null): void; - framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture | null, level: number): void; - frontFace(mode: number): void; - generateMipmap(target: number): void; - getActiveAttrib(program: WebGLProgram | null, index: number): WebGLActiveInfo | null; - getActiveUniform(program: WebGLProgram | null, index: number): WebGLActiveInfo | null; - getAttachedShaders(program: WebGLProgram | null): WebGLShader[] | null; - getAttribLocation(program: WebGLProgram | null, name: string): number; - getBufferParameter(target: number, pname: number): any; - getContextAttributes(): WebGLContextAttributes; - getError(): number; - getExtension(name: string): any; - getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; - getParameter(pname: number): any; - getProgramInfoLog(program: WebGLProgram | null): string | null; - getProgramParameter(program: WebGLProgram | null, pname: number): any; - getRenderbufferParameter(target: number, pname: number): any; - getShaderInfoLog(shader: WebGLShader | null): string | null; - getShaderParameter(shader: WebGLShader | null, pname: number): any; - getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat | null; - getShaderSource(shader: WebGLShader | null): string | null; - getSupportedExtensions(): string[] | null; - getTexParameter(target: number, pname: number): any; - getUniform(program: WebGLProgram | null, location: WebGLUniformLocation | null): any; - getUniformLocation(program: WebGLProgram | null, name: string): WebGLUniformLocation | null; - getVertexAttrib(index: number, pname: number): any; - getVertexAttribOffset(index: number, pname: number): number; - hint(target: number, mode: number): void; - isBuffer(buffer: WebGLBuffer | null): boolean; - isContextLost(): boolean; - isEnabled(cap: number): boolean; - isFramebuffer(framebuffer: WebGLFramebuffer | null): boolean; - isProgram(program: WebGLProgram | null): boolean; - isRenderbuffer(renderbuffer: WebGLRenderbuffer | null): boolean; - isShader(shader: WebGLShader | null): boolean; - isTexture(texture: WebGLTexture | null): boolean; - lineWidth(width: number): void; - linkProgram(program: WebGLProgram | null): void; - pixelStorei(pname: number, param: number): void; - polygonOffset(factor: number, units: number): void; - readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void; - renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; - sampleCoverage(value: number, invert: boolean): void; - scissor(x: number, y: number, width: number, height: number): void; - shaderSource(shader: WebGLShader | null, source: string): void; - stencilFunc(func: number, ref: number, mask: number): void; - stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; - stencilMask(mask: number): void; - stencilMaskSeparate(face: number, mask: number): void; - stencilOp(fail: number, zfail: number, zpass: number): void; - stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; - texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels?: ArrayBufferView): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels?: ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void; - texParameterf(target: number, pname: number, param: number): void; - texParameteri(target: number, pname: number, param: number): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels?: ArrayBufferView): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels?: ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void; - uniform1f(location: WebGLUniformLocation | null, x: number): void; - uniform1fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; - uniform1i(location: WebGLUniformLocation | null, x: number): void; - uniform1iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniform2f(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; - uniform2i(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniform3f(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; - uniform3i(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniform4f(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; - uniform4i(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - useProgram(program: WebGLProgram | null): void; - validateProgram(program: WebGLProgram | null): void; - vertexAttrib1f(indx: number, x: number): void; - vertexAttrib1fv(indx: number, values: Float32Array | number[]): void; - vertexAttrib2f(indx: number, x: number, y: number): void; - vertexAttrib2fv(indx: number, values: Float32Array | number[]): void; - vertexAttrib3f(indx: number, x: number, y: number, z: number): void; - vertexAttrib3fv(indx: number, values: Float32Array | number[]): void; - vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; - vertexAttrib4fv(indx: number, values: Float32Array | number[]): void; - vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; - viewport(x: number, y: number, width: number, height: number): void; - readonly ACTIVE_ATTRIBUTES: number; - readonly ACTIVE_TEXTURE: number; - readonly ACTIVE_UNIFORMS: number; - readonly ALIASED_LINE_WIDTH_RANGE: number; - readonly ALIASED_POINT_SIZE_RANGE: number; - readonly ALPHA: number; - readonly ALPHA_BITS: number; - readonly ALWAYS: number; - readonly ARRAY_BUFFER: number; - readonly ARRAY_BUFFER_BINDING: number; - readonly ATTACHED_SHADERS: number; - readonly BACK: number; - readonly BLEND: number; - readonly BLEND_COLOR: number; - readonly BLEND_DST_ALPHA: number; - readonly BLEND_DST_RGB: number; - readonly BLEND_EQUATION: number; - readonly BLEND_EQUATION_ALPHA: number; - readonly BLEND_EQUATION_RGB: number; - readonly BLEND_SRC_ALPHA: number; - readonly BLEND_SRC_RGB: number; - readonly BLUE_BITS: number; - readonly BOOL: number; - readonly BOOL_VEC2: number; - readonly BOOL_VEC3: number; - readonly BOOL_VEC4: number; - readonly BROWSER_DEFAULT_WEBGL: number; - readonly BUFFER_SIZE: number; - readonly BUFFER_USAGE: number; - readonly BYTE: number; - readonly CCW: number; - readonly CLAMP_TO_EDGE: number; - readonly COLOR_ATTACHMENT0: number; - readonly COLOR_BUFFER_BIT: number; - readonly COLOR_CLEAR_VALUE: number; - readonly COLOR_WRITEMASK: number; - readonly COMPILE_STATUS: number; - readonly COMPRESSED_TEXTURE_FORMATS: number; - readonly CONSTANT_ALPHA: number; - readonly CONSTANT_COLOR: number; - readonly CONTEXT_LOST_WEBGL: number; - readonly CULL_FACE: number; - readonly CULL_FACE_MODE: number; - readonly CURRENT_PROGRAM: number; - readonly CURRENT_VERTEX_ATTRIB: number; - readonly CW: number; - readonly DECR: number; - readonly DECR_WRAP: number; - readonly DELETE_STATUS: number; - readonly DEPTH_ATTACHMENT: number; - readonly DEPTH_BITS: number; - readonly DEPTH_BUFFER_BIT: number; - readonly DEPTH_CLEAR_VALUE: number; - readonly DEPTH_COMPONENT: number; - readonly DEPTH_COMPONENT16: number; - readonly DEPTH_FUNC: number; - readonly DEPTH_RANGE: number; - readonly DEPTH_STENCIL: number; - readonly DEPTH_STENCIL_ATTACHMENT: number; - readonly DEPTH_TEST: number; - readonly DEPTH_WRITEMASK: number; - readonly DITHER: number; - readonly DONT_CARE: number; - readonly DST_ALPHA: number; - readonly DST_COLOR: number; - readonly DYNAMIC_DRAW: number; - readonly ELEMENT_ARRAY_BUFFER: number; - readonly ELEMENT_ARRAY_BUFFER_BINDING: number; - readonly EQUAL: number; - readonly FASTEST: number; - readonly FLOAT: number; - readonly FLOAT_MAT2: number; - readonly FLOAT_MAT3: number; - readonly FLOAT_MAT4: number; - readonly FLOAT_VEC2: number; - readonly FLOAT_VEC3: number; - readonly FLOAT_VEC4: number; - readonly FRAGMENT_SHADER: number; - readonly FRAMEBUFFER: number; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - readonly FRAMEBUFFER_BINDING: number; - readonly FRAMEBUFFER_COMPLETE: number; - readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - readonly FRAMEBUFFER_UNSUPPORTED: number; - readonly FRONT: number; - readonly FRONT_AND_BACK: number; - readonly FRONT_FACE: number; - readonly FUNC_ADD: number; - readonly FUNC_REVERSE_SUBTRACT: number; - readonly FUNC_SUBTRACT: number; - readonly GENERATE_MIPMAP_HINT: number; - readonly GEQUAL: number; - readonly GREATER: number; - readonly GREEN_BITS: number; - readonly HIGH_FLOAT: number; - readonly HIGH_INT: number; - readonly IMPLEMENTATION_COLOR_READ_FORMAT: number; - readonly IMPLEMENTATION_COLOR_READ_TYPE: number; - readonly INCR: number; - readonly INCR_WRAP: number; - readonly INT: number; - readonly INT_VEC2: number; - readonly INT_VEC3: number; - readonly INT_VEC4: number; - readonly INVALID_ENUM: number; - readonly INVALID_FRAMEBUFFER_OPERATION: number; - readonly INVALID_OPERATION: number; - readonly INVALID_VALUE: number; - readonly INVERT: number; - readonly KEEP: number; - readonly LEQUAL: number; - readonly LESS: number; - readonly LINEAR: number; - readonly LINEAR_MIPMAP_LINEAR: number; - readonly LINEAR_MIPMAP_NEAREST: number; - readonly LINES: number; - readonly LINE_LOOP: number; - readonly LINE_STRIP: number; - readonly LINE_WIDTH: number; - readonly LINK_STATUS: number; - readonly LOW_FLOAT: number; - readonly LOW_INT: number; - readonly LUMINANCE: number; - readonly LUMINANCE_ALPHA: number; - readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - readonly MAX_CUBE_MAP_TEXTURE_SIZE: number; - readonly MAX_FRAGMENT_UNIFORM_VECTORS: number; - readonly MAX_RENDERBUFFER_SIZE: number; - readonly MAX_TEXTURE_IMAGE_UNITS: number; - readonly MAX_TEXTURE_SIZE: number; - readonly MAX_VARYING_VECTORS: number; - readonly MAX_VERTEX_ATTRIBS: number; - readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - readonly MAX_VERTEX_UNIFORM_VECTORS: number; - readonly MAX_VIEWPORT_DIMS: number; - readonly MEDIUM_FLOAT: number; - readonly MEDIUM_INT: number; - readonly MIRRORED_REPEAT: number; - readonly NEAREST: number; - readonly NEAREST_MIPMAP_LINEAR: number; - readonly NEAREST_MIPMAP_NEAREST: number; - readonly NEVER: number; - readonly NICEST: number; - readonly NONE: number; - readonly NOTEQUAL: number; - readonly NO_ERROR: number; - readonly ONE: number; - readonly ONE_MINUS_CONSTANT_ALPHA: number; - readonly ONE_MINUS_CONSTANT_COLOR: number; - readonly ONE_MINUS_DST_ALPHA: number; - readonly ONE_MINUS_DST_COLOR: number; - readonly ONE_MINUS_SRC_ALPHA: number; - readonly ONE_MINUS_SRC_COLOR: number; - readonly OUT_OF_MEMORY: number; - readonly PACK_ALIGNMENT: number; - readonly POINTS: number; - readonly POLYGON_OFFSET_FACTOR: number; - readonly POLYGON_OFFSET_FILL: number; - readonly POLYGON_OFFSET_UNITS: number; - readonly RED_BITS: number; - readonly RENDERBUFFER: number; - readonly RENDERBUFFER_ALPHA_SIZE: number; - readonly RENDERBUFFER_BINDING: number; - readonly RENDERBUFFER_BLUE_SIZE: number; - readonly RENDERBUFFER_DEPTH_SIZE: number; - readonly RENDERBUFFER_GREEN_SIZE: number; - readonly RENDERBUFFER_HEIGHT: number; - readonly RENDERBUFFER_INTERNAL_FORMAT: number; - readonly RENDERBUFFER_RED_SIZE: number; - readonly RENDERBUFFER_STENCIL_SIZE: number; - readonly RENDERBUFFER_WIDTH: number; - readonly RENDERER: number; - readonly REPEAT: number; - readonly REPLACE: number; - readonly RGB: number; - readonly RGB565: number; - readonly RGB5_A1: number; - readonly RGBA: number; - readonly RGBA4: number; - readonly SAMPLER_2D: number; - readonly SAMPLER_CUBE: number; - readonly SAMPLES: number; - readonly SAMPLE_ALPHA_TO_COVERAGE: number; - readonly SAMPLE_BUFFERS: number; - readonly SAMPLE_COVERAGE: number; - readonly SAMPLE_COVERAGE_INVERT: number; - readonly SAMPLE_COVERAGE_VALUE: number; - readonly SCISSOR_BOX: number; - readonly SCISSOR_TEST: number; - readonly SHADER_TYPE: number; - readonly SHADING_LANGUAGE_VERSION: number; - readonly SHORT: number; - readonly SRC_ALPHA: number; - readonly SRC_ALPHA_SATURATE: number; - readonly SRC_COLOR: number; - readonly STATIC_DRAW: number; - readonly STENCIL_ATTACHMENT: number; - readonly STENCIL_BACK_FAIL: number; - readonly STENCIL_BACK_FUNC: number; - readonly STENCIL_BACK_PASS_DEPTH_FAIL: number; - readonly STENCIL_BACK_PASS_DEPTH_PASS: number; - readonly STENCIL_BACK_REF: number; - readonly STENCIL_BACK_VALUE_MASK: number; - readonly STENCIL_BACK_WRITEMASK: number; - readonly STENCIL_BITS: number; - readonly STENCIL_BUFFER_BIT: number; - readonly STENCIL_CLEAR_VALUE: number; - readonly STENCIL_FAIL: number; - readonly STENCIL_FUNC: number; - readonly STENCIL_INDEX: number; - readonly STENCIL_INDEX8: number; - readonly STENCIL_PASS_DEPTH_FAIL: number; - readonly STENCIL_PASS_DEPTH_PASS: number; - readonly STENCIL_REF: number; - readonly STENCIL_TEST: number; - readonly STENCIL_VALUE_MASK: number; - readonly STENCIL_WRITEMASK: number; - readonly STREAM_DRAW: number; - readonly SUBPIXEL_BITS: number; - readonly TEXTURE: number; - readonly TEXTURE0: number; - readonly TEXTURE1: number; - readonly TEXTURE10: number; - readonly TEXTURE11: number; - readonly TEXTURE12: number; - readonly TEXTURE13: number; - readonly TEXTURE14: number; - readonly TEXTURE15: number; - readonly TEXTURE16: number; - readonly TEXTURE17: number; - readonly TEXTURE18: number; - readonly TEXTURE19: number; - readonly TEXTURE2: number; - readonly TEXTURE20: number; - readonly TEXTURE21: number; - readonly TEXTURE22: number; - readonly TEXTURE23: number; - readonly TEXTURE24: number; - readonly TEXTURE25: number; - readonly TEXTURE26: number; - readonly TEXTURE27: number; - readonly TEXTURE28: number; - readonly TEXTURE29: number; - readonly TEXTURE3: number; - readonly TEXTURE30: number; - readonly TEXTURE31: number; - readonly TEXTURE4: number; - readonly TEXTURE5: number; - readonly TEXTURE6: number; - readonly TEXTURE7: number; - readonly TEXTURE8: number; - readonly TEXTURE9: number; - readonly TEXTURE_2D: number; - readonly TEXTURE_BINDING_2D: number; - readonly TEXTURE_BINDING_CUBE_MAP: number; - readonly TEXTURE_CUBE_MAP: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_X: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number; - readonly TEXTURE_MAG_FILTER: number; - readonly TEXTURE_MIN_FILTER: number; - readonly TEXTURE_WRAP_S: number; - readonly TEXTURE_WRAP_T: number; - readonly TRIANGLES: number; - readonly TRIANGLE_FAN: number; - readonly TRIANGLE_STRIP: number; - readonly UNPACK_ALIGNMENT: number; - readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - readonly UNPACK_FLIP_Y_WEBGL: number; - readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - readonly UNSIGNED_BYTE: number; - readonly UNSIGNED_INT: number; - readonly UNSIGNED_SHORT: number; - readonly UNSIGNED_SHORT_4_4_4_4: number; - readonly UNSIGNED_SHORT_5_5_5_1: number; - readonly UNSIGNED_SHORT_5_6_5: number; - readonly VALIDATE_STATUS: number; - readonly VENDOR: number; - readonly VERSION: number; - readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - readonly VERTEX_ATTRIB_ARRAY_ENABLED: number; - readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - readonly VERTEX_ATTRIB_ARRAY_POINTER: number; - readonly VERTEX_ATTRIB_ARRAY_SIZE: number; - readonly VERTEX_ATTRIB_ARRAY_STRIDE: number; - readonly VERTEX_ATTRIB_ARRAY_TYPE: number; - readonly VERTEX_SHADER: number; - readonly VIEWPORT: number; - readonly ZERO: number; -} - -declare var WebGLRenderingContext: { - prototype: WebGLRenderingContext; - new(): WebGLRenderingContext; - readonly ACTIVE_ATTRIBUTES: number; - readonly ACTIVE_TEXTURE: number; - readonly ACTIVE_UNIFORMS: number; - readonly ALIASED_LINE_WIDTH_RANGE: number; - readonly ALIASED_POINT_SIZE_RANGE: number; - readonly ALPHA: number; - readonly ALPHA_BITS: number; - readonly ALWAYS: number; - readonly ARRAY_BUFFER: number; - readonly ARRAY_BUFFER_BINDING: number; - readonly ATTACHED_SHADERS: number; - readonly BACK: number; - readonly BLEND: number; - readonly BLEND_COLOR: number; - readonly BLEND_DST_ALPHA: number; - readonly BLEND_DST_RGB: number; - readonly BLEND_EQUATION: number; - readonly BLEND_EQUATION_ALPHA: number; - readonly BLEND_EQUATION_RGB: number; - readonly BLEND_SRC_ALPHA: number; - readonly BLEND_SRC_RGB: number; - readonly BLUE_BITS: number; - readonly BOOL: number; - readonly BOOL_VEC2: number; - readonly BOOL_VEC3: number; - readonly BOOL_VEC4: number; - readonly BROWSER_DEFAULT_WEBGL: number; - readonly BUFFER_SIZE: number; - readonly BUFFER_USAGE: number; - readonly BYTE: number; - readonly CCW: number; - readonly CLAMP_TO_EDGE: number; - readonly COLOR_ATTACHMENT0: number; - readonly COLOR_BUFFER_BIT: number; - readonly COLOR_CLEAR_VALUE: number; - readonly COLOR_WRITEMASK: number; - readonly COMPILE_STATUS: number; - readonly COMPRESSED_TEXTURE_FORMATS: number; - readonly CONSTANT_ALPHA: number; - readonly CONSTANT_COLOR: number; - readonly CONTEXT_LOST_WEBGL: number; - readonly CULL_FACE: number; - readonly CULL_FACE_MODE: number; - readonly CURRENT_PROGRAM: number; - readonly CURRENT_VERTEX_ATTRIB: number; - readonly CW: number; - readonly DECR: number; - readonly DECR_WRAP: number; - readonly DELETE_STATUS: number; - readonly DEPTH_ATTACHMENT: number; - readonly DEPTH_BITS: number; - readonly DEPTH_BUFFER_BIT: number; - readonly DEPTH_CLEAR_VALUE: number; - readonly DEPTH_COMPONENT: number; - readonly DEPTH_COMPONENT16: number; - readonly DEPTH_FUNC: number; - readonly DEPTH_RANGE: number; - readonly DEPTH_STENCIL: number; - readonly DEPTH_STENCIL_ATTACHMENT: number; - readonly DEPTH_TEST: number; - readonly DEPTH_WRITEMASK: number; - readonly DITHER: number; - readonly DONT_CARE: number; - readonly DST_ALPHA: number; - readonly DST_COLOR: number; - readonly DYNAMIC_DRAW: number; - readonly ELEMENT_ARRAY_BUFFER: number; - readonly ELEMENT_ARRAY_BUFFER_BINDING: number; - readonly EQUAL: number; - readonly FASTEST: number; - readonly FLOAT: number; - readonly FLOAT_MAT2: number; - readonly FLOAT_MAT3: number; - readonly FLOAT_MAT4: number; - readonly FLOAT_VEC2: number; - readonly FLOAT_VEC3: number; - readonly FLOAT_VEC4: number; - readonly FRAGMENT_SHADER: number; - readonly FRAMEBUFFER: number; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - readonly FRAMEBUFFER_BINDING: number; - readonly FRAMEBUFFER_COMPLETE: number; - readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - readonly FRAMEBUFFER_UNSUPPORTED: number; - readonly FRONT: number; - readonly FRONT_AND_BACK: number; - readonly FRONT_FACE: number; - readonly FUNC_ADD: number; - readonly FUNC_REVERSE_SUBTRACT: number; - readonly FUNC_SUBTRACT: number; - readonly GENERATE_MIPMAP_HINT: number; - readonly GEQUAL: number; - readonly GREATER: number; - readonly GREEN_BITS: number; - readonly HIGH_FLOAT: number; - readonly HIGH_INT: number; - readonly IMPLEMENTATION_COLOR_READ_FORMAT: number; - readonly IMPLEMENTATION_COLOR_READ_TYPE: number; - readonly INCR: number; - readonly INCR_WRAP: number; - readonly INT: number; - readonly INT_VEC2: number; - readonly INT_VEC3: number; - readonly INT_VEC4: number; - readonly INVALID_ENUM: number; - readonly INVALID_FRAMEBUFFER_OPERATION: number; - readonly INVALID_OPERATION: number; - readonly INVALID_VALUE: number; - readonly INVERT: number; - readonly KEEP: number; - readonly LEQUAL: number; - readonly LESS: number; - readonly LINEAR: number; - readonly LINEAR_MIPMAP_LINEAR: number; - readonly LINEAR_MIPMAP_NEAREST: number; - readonly LINES: number; - readonly LINE_LOOP: number; - readonly LINE_STRIP: number; - readonly LINE_WIDTH: number; - readonly LINK_STATUS: number; - readonly LOW_FLOAT: number; - readonly LOW_INT: number; - readonly LUMINANCE: number; - readonly LUMINANCE_ALPHA: number; - readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - readonly MAX_CUBE_MAP_TEXTURE_SIZE: number; - readonly MAX_FRAGMENT_UNIFORM_VECTORS: number; - readonly MAX_RENDERBUFFER_SIZE: number; - readonly MAX_TEXTURE_IMAGE_UNITS: number; - readonly MAX_TEXTURE_SIZE: number; - readonly MAX_VARYING_VECTORS: number; - readonly MAX_VERTEX_ATTRIBS: number; - readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - readonly MAX_VERTEX_UNIFORM_VECTORS: number; - readonly MAX_VIEWPORT_DIMS: number; - readonly MEDIUM_FLOAT: number; - readonly MEDIUM_INT: number; - readonly MIRRORED_REPEAT: number; - readonly NEAREST: number; - readonly NEAREST_MIPMAP_LINEAR: number; - readonly NEAREST_MIPMAP_NEAREST: number; - readonly NEVER: number; - readonly NICEST: number; - readonly NONE: number; - readonly NOTEQUAL: number; - readonly NO_ERROR: number; - readonly ONE: number; - readonly ONE_MINUS_CONSTANT_ALPHA: number; - readonly ONE_MINUS_CONSTANT_COLOR: number; - readonly ONE_MINUS_DST_ALPHA: number; - readonly ONE_MINUS_DST_COLOR: number; - readonly ONE_MINUS_SRC_ALPHA: number; - readonly ONE_MINUS_SRC_COLOR: number; - readonly OUT_OF_MEMORY: number; - readonly PACK_ALIGNMENT: number; - readonly POINTS: number; - readonly POLYGON_OFFSET_FACTOR: number; - readonly POLYGON_OFFSET_FILL: number; - readonly POLYGON_OFFSET_UNITS: number; - readonly RED_BITS: number; - readonly RENDERBUFFER: number; - readonly RENDERBUFFER_ALPHA_SIZE: number; - readonly RENDERBUFFER_BINDING: number; - readonly RENDERBUFFER_BLUE_SIZE: number; - readonly RENDERBUFFER_DEPTH_SIZE: number; - readonly RENDERBUFFER_GREEN_SIZE: number; - readonly RENDERBUFFER_HEIGHT: number; - readonly RENDERBUFFER_INTERNAL_FORMAT: number; - readonly RENDERBUFFER_RED_SIZE: number; - readonly RENDERBUFFER_STENCIL_SIZE: number; - readonly RENDERBUFFER_WIDTH: number; - readonly RENDERER: number; - readonly REPEAT: number; - readonly REPLACE: number; - readonly RGB: number; - readonly RGB565: number; - readonly RGB5_A1: number; - readonly RGBA: number; - readonly RGBA4: number; - readonly SAMPLER_2D: number; - readonly SAMPLER_CUBE: number; - readonly SAMPLES: number; - readonly SAMPLE_ALPHA_TO_COVERAGE: number; - readonly SAMPLE_BUFFERS: number; - readonly SAMPLE_COVERAGE: number; - readonly SAMPLE_COVERAGE_INVERT: number; - readonly SAMPLE_COVERAGE_VALUE: number; - readonly SCISSOR_BOX: number; - readonly SCISSOR_TEST: number; - readonly SHADER_TYPE: number; - readonly SHADING_LANGUAGE_VERSION: number; - readonly SHORT: number; - readonly SRC_ALPHA: number; - readonly SRC_ALPHA_SATURATE: number; - readonly SRC_COLOR: number; - readonly STATIC_DRAW: number; - readonly STENCIL_ATTACHMENT: number; - readonly STENCIL_BACK_FAIL: number; - readonly STENCIL_BACK_FUNC: number; - readonly STENCIL_BACK_PASS_DEPTH_FAIL: number; - readonly STENCIL_BACK_PASS_DEPTH_PASS: number; - readonly STENCIL_BACK_REF: number; - readonly STENCIL_BACK_VALUE_MASK: number; - readonly STENCIL_BACK_WRITEMASK: number; - readonly STENCIL_BITS: number; - readonly STENCIL_BUFFER_BIT: number; - readonly STENCIL_CLEAR_VALUE: number; - readonly STENCIL_FAIL: number; - readonly STENCIL_FUNC: number; - readonly STENCIL_INDEX: number; - readonly STENCIL_INDEX8: number; - readonly STENCIL_PASS_DEPTH_FAIL: number; - readonly STENCIL_PASS_DEPTH_PASS: number; - readonly STENCIL_REF: number; - readonly STENCIL_TEST: number; - readonly STENCIL_VALUE_MASK: number; - readonly STENCIL_WRITEMASK: number; - readonly STREAM_DRAW: number; - readonly SUBPIXEL_BITS: number; - readonly TEXTURE: number; - readonly TEXTURE0: number; - readonly TEXTURE1: number; - readonly TEXTURE10: number; - readonly TEXTURE11: number; - readonly TEXTURE12: number; - readonly TEXTURE13: number; - readonly TEXTURE14: number; - readonly TEXTURE15: number; - readonly TEXTURE16: number; - readonly TEXTURE17: number; - readonly TEXTURE18: number; - readonly TEXTURE19: number; - readonly TEXTURE2: number; - readonly TEXTURE20: number; - readonly TEXTURE21: number; - readonly TEXTURE22: number; - readonly TEXTURE23: number; - readonly TEXTURE24: number; - readonly TEXTURE25: number; - readonly TEXTURE26: number; - readonly TEXTURE27: number; - readonly TEXTURE28: number; - readonly TEXTURE29: number; - readonly TEXTURE3: number; - readonly TEXTURE30: number; - readonly TEXTURE31: number; - readonly TEXTURE4: number; - readonly TEXTURE5: number; - readonly TEXTURE6: number; - readonly TEXTURE7: number; - readonly TEXTURE8: number; - readonly TEXTURE9: number; - readonly TEXTURE_2D: number; - readonly TEXTURE_BINDING_2D: number; - readonly TEXTURE_BINDING_CUBE_MAP: number; - readonly TEXTURE_CUBE_MAP: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_X: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number; - readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number; - readonly TEXTURE_MAG_FILTER: number; - readonly TEXTURE_MIN_FILTER: number; - readonly TEXTURE_WRAP_S: number; - readonly TEXTURE_WRAP_T: number; - readonly TRIANGLES: number; - readonly TRIANGLE_FAN: number; - readonly TRIANGLE_STRIP: number; - readonly UNPACK_ALIGNMENT: number; - readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - readonly UNPACK_FLIP_Y_WEBGL: number; - readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - readonly UNSIGNED_BYTE: number; - readonly UNSIGNED_INT: number; - readonly UNSIGNED_SHORT: number; - readonly UNSIGNED_SHORT_4_4_4_4: number; - readonly UNSIGNED_SHORT_5_5_5_1: number; - readonly UNSIGNED_SHORT_5_6_5: number; - readonly VALIDATE_STATUS: number; - readonly VENDOR: number; - readonly VERSION: number; - readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - readonly VERTEX_ATTRIB_ARRAY_ENABLED: number; - readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - readonly VERTEX_ATTRIB_ARRAY_POINTER: number; - readonly VERTEX_ATTRIB_ARRAY_SIZE: number; - readonly VERTEX_ATTRIB_ARRAY_STRIDE: number; - readonly VERTEX_ATTRIB_ARRAY_TYPE: number; - readonly VERTEX_SHADER: number; - readonly VIEWPORT: number; - readonly ZERO: number; -} - -interface WebGLShader extends WebGLObject { -} - -declare var WebGLShader: { - prototype: WebGLShader; - new(): WebGLShader; -} - -interface WebGLShaderPrecisionFormat { - readonly precision: number; - readonly rangeMax: number; - readonly rangeMin: number; -} - -declare var WebGLShaderPrecisionFormat: { - prototype: WebGLShaderPrecisionFormat; - new(): WebGLShaderPrecisionFormat; -} - -interface WebGLTexture extends WebGLObject { -} - -declare var WebGLTexture: { - prototype: WebGLTexture; - new(): WebGLTexture; -} - -interface WebGLUniformLocation { -} - -declare var WebGLUniformLocation: { - prototype: WebGLUniformLocation; - new(): WebGLUniformLocation; -} - -interface WebKitCSSMatrix { - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; - m11: number; - m12: number; - m13: number; - m14: number; - m21: number; - m22: number; - m23: number; - m24: number; - m31: number; - m32: number; - m33: number; - m34: number; - m41: number; - m42: number; - m43: number; - m44: number; - inverse(): WebKitCSSMatrix; - multiply(secondMatrix: WebKitCSSMatrix): WebKitCSSMatrix; - rotate(angleX: number, angleY?: number, angleZ?: number): WebKitCSSMatrix; - rotateAxisAngle(x: number, y: number, z: number, angle: number): WebKitCSSMatrix; - scale(scaleX: number, scaleY?: number, scaleZ?: number): WebKitCSSMatrix; - setMatrixValue(value: string): void; - skewX(angle: number): WebKitCSSMatrix; - skewY(angle: number): WebKitCSSMatrix; - toString(): string; - translate(x: number, y: number, z?: number): WebKitCSSMatrix; -} - -declare var WebKitCSSMatrix: { - prototype: WebKitCSSMatrix; - new(text?: string): WebKitCSSMatrix; -} - -interface WebKitPoint { - x: number; - y: number; -} - -declare var WebKitPoint: { - prototype: WebKitPoint; - new(x?: number, y?: number): WebKitPoint; -} - -interface WebSocketEventMap { - "close": CloseEvent; - "error": ErrorEvent; - "message": MessageEvent; - "open": Event; -} - -interface WebSocket extends EventTarget { - binaryType: string; - readonly bufferedAmount: number; - readonly extensions: string; - onclose: (this: WebSocket, ev: CloseEvent) => any; - onerror: (this: WebSocket, ev: ErrorEvent) => any; - onmessage: (this: WebSocket, ev: MessageEvent) => any; - onopen: (this: WebSocket, ev: Event) => any; - readonly protocol: string; - readonly readyState: number; - readonly url: string; - close(code?: number, reason?: string): void; - send(data: any): void; - readonly CLOSED: number; - readonly CLOSING: number; - readonly CONNECTING: number; - readonly OPEN: number; - addEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var WebSocket: { - prototype: WebSocket; - new(url: string, protocols?: string | string[]): WebSocket; - readonly CLOSED: number; - readonly CLOSING: number; - readonly CONNECTING: number; - readonly OPEN: number; -} - -interface WheelEvent extends MouseEvent { - readonly deltaMode: number; - readonly deltaX: number; - readonly deltaY: number; - readonly deltaZ: number; - readonly wheelDelta: number; - readonly wheelDeltaX: number; - readonly wheelDeltaY: number; - getCurrentPoint(element: Element): void; - initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; - readonly DOM_DELTA_LINE: number; - readonly DOM_DELTA_PAGE: number; - readonly DOM_DELTA_PIXEL: number; -} - -declare var WheelEvent: { - prototype: WheelEvent; - new(typeArg: string, eventInitDict?: WheelEventInit): WheelEvent; - readonly DOM_DELTA_LINE: number; - readonly DOM_DELTA_PAGE: number; - readonly DOM_DELTA_PIXEL: number; -} - -interface WindowEventMap extends GlobalEventHandlersEventMap { - "abort": UIEvent; - "afterprint": Event; - "beforeprint": Event; - "beforeunload": BeforeUnloadEvent; - "blur": FocusEvent; - "canplay": Event; - "canplaythrough": Event; - "change": Event; - "click": MouseEvent; - "compassneedscalibration": Event; - "contextmenu": PointerEvent; - "dblclick": MouseEvent; - "devicelight": DeviceLightEvent; - "devicemotion": DeviceMotionEvent; - "deviceorientation": DeviceOrientationEvent; - "drag": DragEvent; - "dragend": DragEvent; - "dragenter": DragEvent; - "dragleave": DragEvent; - "dragover": DragEvent; - "dragstart": DragEvent; - "drop": DragEvent; - "durationchange": Event; - "emptied": Event; - "ended": MediaStreamErrorEvent; - "focus": FocusEvent; - "hashchange": HashChangeEvent; - "input": Event; - "invalid": Event; - "keydown": KeyboardEvent; - "keypress": KeyboardEvent; - "keyup": KeyboardEvent; - "load": Event; - "loadeddata": Event; - "loadedmetadata": Event; - "loadstart": Event; - "message": MessageEvent; - "mousedown": MouseEvent; - "mouseenter": MouseEvent; - "mouseleave": MouseEvent; - "mousemove": MouseEvent; - "mouseout": MouseEvent; - "mouseover": MouseEvent; - "mouseup": MouseEvent; - "mousewheel": WheelEvent; - "MSGestureChange": MSGestureEvent; - "MSGestureDoubleTap": MSGestureEvent; - "MSGestureEnd": MSGestureEvent; - "MSGestureHold": MSGestureEvent; - "MSGestureStart": MSGestureEvent; - "MSGestureTap": MSGestureEvent; - "MSInertiaStart": MSGestureEvent; - "MSPointerCancel": MSPointerEvent; - "MSPointerDown": MSPointerEvent; - "MSPointerEnter": MSPointerEvent; - "MSPointerLeave": MSPointerEvent; - "MSPointerMove": MSPointerEvent; - "MSPointerOut": MSPointerEvent; - "MSPointerOver": MSPointerEvent; - "MSPointerUp": MSPointerEvent; - "offline": Event; - "online": Event; - "orientationchange": Event; - "pagehide": PageTransitionEvent; - "pageshow": PageTransitionEvent; - "pause": Event; - "play": Event; - "playing": Event; - "popstate": PopStateEvent; - "progress": ProgressEvent; - "ratechange": Event; - "readystatechange": ProgressEvent; - "reset": Event; - "resize": UIEvent; - "scroll": UIEvent; - "seeked": Event; - "seeking": Event; - "select": UIEvent; - "stalled": Event; - "storage": StorageEvent; - "submit": Event; - "suspend": Event; - "timeupdate": Event; - "unload": Event; - "volumechange": Event; - "waiting": Event; -} - -interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64 { - readonly applicationCache: ApplicationCache; - readonly clientInformation: Navigator; - readonly closed: boolean; - readonly crypto: Crypto; - defaultStatus: string; - readonly devicePixelRatio: number; - readonly doNotTrack: string; - readonly document: Document; - event: Event | undefined; - readonly external: External; - readonly frameElement: Element; - readonly frames: Window; - readonly history: History; - readonly innerHeight: number; - readonly innerWidth: number; - readonly length: number; - readonly location: Location; - readonly locationbar: BarProp; - readonly menubar: BarProp; - readonly msCredentials: MSCredentials; - name: string; - readonly navigator: Navigator; - offscreenBuffering: string | boolean; - onabort: (this: Window, ev: UIEvent) => any; - onafterprint: (this: Window, ev: Event) => any; - onbeforeprint: (this: Window, ev: Event) => any; - onbeforeunload: (this: Window, ev: BeforeUnloadEvent) => any; - onblur: (this: Window, ev: FocusEvent) => any; - oncanplay: (this: Window, ev: Event) => any; - oncanplaythrough: (this: Window, ev: Event) => any; - onchange: (this: Window, ev: Event) => any; - onclick: (this: Window, ev: MouseEvent) => any; - oncompassneedscalibration: (this: Window, ev: Event) => any; - oncontextmenu: (this: Window, ev: PointerEvent) => any; - ondblclick: (this: Window, ev: MouseEvent) => any; - ondevicelight: (this: Window, ev: DeviceLightEvent) => any; - ondevicemotion: (this: Window, ev: DeviceMotionEvent) => any; - ondeviceorientation: (this: Window, ev: DeviceOrientationEvent) => any; - ondrag: (this: Window, ev: DragEvent) => any; - ondragend: (this: Window, ev: DragEvent) => any; - ondragenter: (this: Window, ev: DragEvent) => any; - ondragleave: (this: Window, ev: DragEvent) => any; - ondragover: (this: Window, ev: DragEvent) => any; - ondragstart: (this: Window, ev: DragEvent) => any; - ondrop: (this: Window, ev: DragEvent) => any; - ondurationchange: (this: Window, ev: Event) => any; - onemptied: (this: Window, ev: Event) => any; - onended: (this: Window, ev: MediaStreamErrorEvent) => any; - onerror: ErrorEventHandler; - onfocus: (this: Window, ev: FocusEvent) => any; - onhashchange: (this: Window, ev: HashChangeEvent) => any; - oninput: (this: Window, ev: Event) => any; - oninvalid: (this: Window, ev: Event) => any; - onkeydown: (this: Window, ev: KeyboardEvent) => any; - onkeypress: (this: Window, ev: KeyboardEvent) => any; - onkeyup: (this: Window, ev: KeyboardEvent) => any; - onload: (this: Window, ev: Event) => any; - onloadeddata: (this: Window, ev: Event) => any; - onloadedmetadata: (this: Window, ev: Event) => any; - onloadstart: (this: Window, ev: Event) => any; - onmessage: (this: Window, ev: MessageEvent) => any; - onmousedown: (this: Window, ev: MouseEvent) => any; - onmouseenter: (this: Window, ev: MouseEvent) => any; - onmouseleave: (this: Window, ev: MouseEvent) => any; - onmousemove: (this: Window, ev: MouseEvent) => any; - onmouseout: (this: Window, ev: MouseEvent) => any; - onmouseover: (this: Window, ev: MouseEvent) => any; - onmouseup: (this: Window, ev: MouseEvent) => any; - onmousewheel: (this: Window, ev: WheelEvent) => any; - onmsgesturechange: (this: Window, ev: MSGestureEvent) => any; - onmsgesturedoubletap: (this: Window, ev: MSGestureEvent) => any; - onmsgestureend: (this: Window, ev: MSGestureEvent) => any; - onmsgesturehold: (this: Window, ev: MSGestureEvent) => any; - onmsgesturestart: (this: Window, ev: MSGestureEvent) => any; - onmsgesturetap: (this: Window, ev: MSGestureEvent) => any; - onmsinertiastart: (this: Window, ev: MSGestureEvent) => any; - onmspointercancel: (this: Window, ev: MSPointerEvent) => any; - onmspointerdown: (this: Window, ev: MSPointerEvent) => any; - onmspointerenter: (this: Window, ev: MSPointerEvent) => any; - onmspointerleave: (this: Window, ev: MSPointerEvent) => any; - onmspointermove: (this: Window, ev: MSPointerEvent) => any; - onmspointerout: (this: Window, ev: MSPointerEvent) => any; - onmspointerover: (this: Window, ev: MSPointerEvent) => any; - onmspointerup: (this: Window, ev: MSPointerEvent) => any; - onoffline: (this: Window, ev: Event) => any; - ononline: (this: Window, ev: Event) => any; - onorientationchange: (this: Window, ev: Event) => any; - onpagehide: (this: Window, ev: PageTransitionEvent) => any; - onpageshow: (this: Window, ev: PageTransitionEvent) => any; - onpause: (this: Window, ev: Event) => any; - onplay: (this: Window, ev: Event) => any; - onplaying: (this: Window, ev: Event) => any; - onpopstate: (this: Window, ev: PopStateEvent) => any; - onprogress: (this: Window, ev: ProgressEvent) => any; - onratechange: (this: Window, ev: Event) => any; - onreadystatechange: (this: Window, ev: ProgressEvent) => any; - onreset: (this: Window, ev: Event) => any; - onresize: (this: Window, ev: UIEvent) => any; - onscroll: (this: Window, ev: UIEvent) => any; - onseeked: (this: Window, ev: Event) => any; - onseeking: (this: Window, ev: Event) => any; - onselect: (this: Window, ev: UIEvent) => any; - onstalled: (this: Window, ev: Event) => any; - onstorage: (this: Window, ev: StorageEvent) => any; - onsubmit: (this: Window, ev: Event) => any; - onsuspend: (this: Window, ev: Event) => any; - ontimeupdate: (this: Window, ev: Event) => any; - ontouchcancel: (ev: TouchEvent) => any; - ontouchend: (ev: TouchEvent) => any; - ontouchmove: (ev: TouchEvent) => any; - ontouchstart: (ev: TouchEvent) => any; - onunload: (this: Window, ev: Event) => any; - onvolumechange: (this: Window, ev: Event) => any; - onwaiting: (this: Window, ev: Event) => any; - opener: any; - orientation: string | number; - readonly outerHeight: number; - readonly outerWidth: number; - readonly pageXOffset: number; - readonly pageYOffset: number; - readonly parent: Window; - readonly performance: Performance; - readonly personalbar: BarProp; - readonly screen: Screen; - readonly screenLeft: number; - readonly screenTop: number; - readonly screenX: number; - readonly screenY: number; - readonly scrollX: number; - readonly scrollY: number; - readonly scrollbars: BarProp; - readonly self: Window; - status: string; - readonly statusbar: BarProp; - readonly styleMedia: StyleMedia; - readonly toolbar: BarProp; - readonly top: Window; - readonly window: Window; - URL: typeof URL; - Blob: typeof Blob; - alert(message?: any): void; - blur(): void; - cancelAnimationFrame(handle: number): void; - captureEvents(): void; - close(): void; - confirm(message?: string): boolean; - focus(): void; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; - getSelection(): Selection; - matchMedia(mediaQuery: string): MediaQueryList; - moveBy(x?: number, y?: number): void; - moveTo(x?: number, y?: number): void; - msWriteProfilerMark(profilerMarkName: string): void; - open(url?: string, target?: string, features?: string, replace?: boolean): Window; - postMessage(message: any, targetOrigin: string, transfer?: any[]): void; - print(): void; - prompt(message?: string, _default?: string): string | null; - releaseEvents(): void; - requestAnimationFrame(callback: FrameRequestCallback): number; - resizeBy(x?: number, y?: number): void; - resizeTo(x?: number, y?: number): void; - scroll(x?: number, y?: number): void; - scrollBy(x?: number, y?: number): void; - scrollTo(x?: number, y?: number): void; - webkitCancelAnimationFrame(handle: number): void; - webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; - webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; - webkitRequestAnimationFrame(callback: FrameRequestCallback): number; - scroll(options?: ScrollToOptions): void; - scrollTo(options?: ScrollToOptions): void; - scrollBy(options?: ScrollToOptions): void; - addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Window: { - prototype: Window; - new(): Window; -} - -interface WorkerEventMap extends AbstractWorkerEventMap { - "message": MessageEvent; -} - -interface Worker extends EventTarget, AbstractWorker { - onmessage: (this: Worker, ev: MessageEvent) => any; - postMessage(message: any, ports?: any): void; - terminate(): void; - addEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Worker: { - prototype: Worker; - new(stringUrl: string): Worker; -} - -interface XMLDocument extends Document { - addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var XMLDocument: { - prototype: XMLDocument; - new(): XMLDocument; -} - -interface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap { - "readystatechange": Event; -} - -interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { - onreadystatechange: (this: XMLHttpRequest, ev: Event) => any; - readonly readyState: number; - readonly response: any; - readonly responseText: string; - responseType: string; - readonly responseXML: any; - readonly status: number; - readonly statusText: string; - timeout: number; - readonly upload: XMLHttpRequestUpload; - withCredentials: boolean; - msCaching?: string; - readonly responseURL: string; - abort(): void; - getAllResponseHeaders(): string; - getResponseHeader(header: string): string | null; - msCachingEnabled(): boolean; - open(method: string, url: string, async?: boolean, user?: string, password?: string): void; - overrideMimeType(mime: string): void; - send(data?: Document): void; - send(data?: string): void; - send(data?: any): void; - setRequestHeader(header: string, value: string): void; - readonly DONE: number; - readonly HEADERS_RECEIVED: number; - readonly LOADING: number; - readonly OPENED: number; - readonly UNSENT: number; - addEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var XMLHttpRequest: { - prototype: XMLHttpRequest; - new(): XMLHttpRequest; - readonly DONE: number; - readonly HEADERS_RECEIVED: number; - readonly LOADING: number; - readonly OPENED: number; - readonly UNSENT: number; - create(): XMLHttpRequest; -} - -interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget { - addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var XMLHttpRequestUpload: { - prototype: XMLHttpRequestUpload; - new(): XMLHttpRequestUpload; -} - -interface XMLSerializer { - serializeToString(target: Node): string; -} - -declare var XMLSerializer: { - prototype: XMLSerializer; - new(): XMLSerializer; -} - -interface XPathEvaluator { - createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; - createNSResolver(nodeResolver?: Node): XPathNSResolver; - evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult; -} - -declare var XPathEvaluator: { - prototype: XPathEvaluator; - new(): XPathEvaluator; -} - -interface XPathExpression { - evaluate(contextNode: Node, type: number, result: XPathResult | null): XPathResult; -} - -declare var XPathExpression: { - prototype: XPathExpression; - new(): XPathExpression; -} - -interface XPathNSResolver { - lookupNamespaceURI(prefix: string): string; -} - -declare var XPathNSResolver: { - prototype: XPathNSResolver; - new(): XPathNSResolver; -} - -interface XPathResult { - readonly booleanValue: boolean; - readonly invalidIteratorState: boolean; - readonly numberValue: number; - readonly resultType: number; - readonly singleNodeValue: Node; - readonly snapshotLength: number; - readonly stringValue: string; - iterateNext(): Node; - snapshotItem(index: number): Node; - readonly ANY_TYPE: number; - readonly ANY_UNORDERED_NODE_TYPE: number; - readonly BOOLEAN_TYPE: number; - readonly FIRST_ORDERED_NODE_TYPE: number; - readonly NUMBER_TYPE: number; - readonly ORDERED_NODE_ITERATOR_TYPE: number; - readonly ORDERED_NODE_SNAPSHOT_TYPE: number; - readonly STRING_TYPE: number; - readonly UNORDERED_NODE_ITERATOR_TYPE: number; - readonly UNORDERED_NODE_SNAPSHOT_TYPE: number; -} - -declare var XPathResult: { - prototype: XPathResult; - new(): XPathResult; - readonly ANY_TYPE: number; - readonly ANY_UNORDERED_NODE_TYPE: number; - readonly BOOLEAN_TYPE: number; - readonly FIRST_ORDERED_NODE_TYPE: number; - readonly NUMBER_TYPE: number; - readonly ORDERED_NODE_ITERATOR_TYPE: number; - readonly ORDERED_NODE_SNAPSHOT_TYPE: number; - readonly STRING_TYPE: number; - readonly UNORDERED_NODE_ITERATOR_TYPE: number; - readonly UNORDERED_NODE_SNAPSHOT_TYPE: number; -} - -interface XSLTProcessor { - clearParameters(): void; - getParameter(namespaceURI: string, localName: string): any; - importStylesheet(style: Node): void; - removeParameter(namespaceURI: string, localName: string): void; - reset(): void; - setParameter(namespaceURI: string, localName: string, value: any): void; - transformToDocument(source: Node): Document; - transformToFragment(source: Node, document: Document): DocumentFragment; -} - -declare var XSLTProcessor: { - prototype: XSLTProcessor; - new(): XSLTProcessor; -} - -interface AbstractWorkerEventMap { - "error": ErrorEvent; -} - -interface AbstractWorker { - onerror: (this: AbstractWorker, ev: ErrorEvent) => any; - addEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface CanvasPathMethods { - arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; - arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; - bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; - closePath(): void; - ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; - lineTo(x: number, y: number): void; - moveTo(x: number, y: number): void; - quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; - rect(x: number, y: number, w: number, h: number): void; -} - -interface ChildNode { - remove(): void; -} - -interface DOML2DeprecatedColorProperty { - color: string; -} - -interface DOML2DeprecatedSizeProperty { - size: number; -} - -interface DocumentEvent { - createEvent(eventInterface:"AnimationEvent"): AnimationEvent; - createEvent(eventInterface:"AriaRequestEvent"): AriaRequestEvent; - createEvent(eventInterface:"AudioProcessingEvent"): AudioProcessingEvent; - createEvent(eventInterface:"BeforeUnloadEvent"): BeforeUnloadEvent; - createEvent(eventInterface:"ClipboardEvent"): ClipboardEvent; - createEvent(eventInterface:"CloseEvent"): CloseEvent; - createEvent(eventInterface:"CommandEvent"): CommandEvent; - createEvent(eventInterface:"CompositionEvent"): CompositionEvent; - createEvent(eventInterface:"CustomEvent"): CustomEvent; - createEvent(eventInterface:"DeviceLightEvent"): DeviceLightEvent; - createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent; - createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent; - createEvent(eventInterface:"DragEvent"): DragEvent; - createEvent(eventInterface:"ErrorEvent"): ErrorEvent; - createEvent(eventInterface:"Event"): Event; - createEvent(eventInterface:"Events"): Event; - createEvent(eventInterface:"FocusEvent"): FocusEvent; - createEvent(eventInterface:"GamepadEvent"): GamepadEvent; - createEvent(eventInterface:"HashChangeEvent"): HashChangeEvent; - createEvent(eventInterface:"IDBVersionChangeEvent"): IDBVersionChangeEvent; - createEvent(eventInterface:"KeyboardEvent"): KeyboardEvent; - createEvent(eventInterface:"ListeningStateChangedEvent"): ListeningStateChangedEvent; - createEvent(eventInterface:"LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent; - createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; - createEvent(eventInterface:"MSManipulationEvent"): MSManipulationEvent; - createEvent(eventInterface:"MSMediaKeyMessageEvent"): MSMediaKeyMessageEvent; - createEvent(eventInterface:"MSMediaKeyNeededEvent"): MSMediaKeyNeededEvent; - createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; - createEvent(eventInterface:"MSSiteModeEvent"): MSSiteModeEvent; - createEvent(eventInterface:"MediaEncryptedEvent"): MediaEncryptedEvent; - createEvent(eventInterface:"MediaKeyMessageEvent"): MediaKeyMessageEvent; - createEvent(eventInterface:"MediaStreamErrorEvent"): MediaStreamErrorEvent; - createEvent(eventInterface:"MediaStreamTrackEvent"): MediaStreamTrackEvent; - createEvent(eventInterface:"MessageEvent"): MessageEvent; - createEvent(eventInterface:"MouseEvent"): MouseEvent; - createEvent(eventInterface:"MouseEvents"): MouseEvent; - createEvent(eventInterface:"MutationEvent"): MutationEvent; - createEvent(eventInterface:"MutationEvents"): MutationEvent; - createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent; - createEvent(eventInterface:"NavigationEvent"): NavigationEvent; - createEvent(eventInterface:"NavigationEventWithReferrer"): NavigationEventWithReferrer; - createEvent(eventInterface:"OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; - createEvent(eventInterface:"OverflowEvent"): OverflowEvent; - createEvent(eventInterface:"PageTransitionEvent"): PageTransitionEvent; - createEvent(eventInterface:"PermissionRequestedEvent"): PermissionRequestedEvent; - createEvent(eventInterface:"PointerEvent"): PointerEvent; - createEvent(eventInterface:"PopStateEvent"): PopStateEvent; - createEvent(eventInterface:"ProgressEvent"): ProgressEvent; - createEvent(eventInterface:"RTCDTMFToneChangeEvent"): RTCDTMFToneChangeEvent; - createEvent(eventInterface:"RTCDtlsTransportStateChangedEvent"): RTCDtlsTransportStateChangedEvent; - createEvent(eventInterface:"RTCIceCandidatePairChangedEvent"): RTCIceCandidatePairChangedEvent; - createEvent(eventInterface:"RTCIceGathererEvent"): RTCIceGathererEvent; - createEvent(eventInterface:"RTCIceTransportStateChangedEvent"): RTCIceTransportStateChangedEvent; - createEvent(eventInterface:"RTCSsrcConflictEvent"): RTCSsrcConflictEvent; - createEvent(eventInterface:"SVGZoomEvent"): SVGZoomEvent; - createEvent(eventInterface:"SVGZoomEvents"): SVGZoomEvent; - createEvent(eventInterface:"ScriptNotifyEvent"): ScriptNotifyEvent; - createEvent(eventInterface:"StorageEvent"): StorageEvent; - createEvent(eventInterface:"TextEvent"): TextEvent; - createEvent(eventInterface:"TouchEvent"): TouchEvent; - createEvent(eventInterface:"TrackEvent"): TrackEvent; - createEvent(eventInterface:"TransitionEvent"): TransitionEvent; - createEvent(eventInterface:"UIEvent"): UIEvent; - createEvent(eventInterface:"UIEvents"): UIEvent; - createEvent(eventInterface:"UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; - createEvent(eventInterface:"WebGLContextEvent"): WebGLContextEvent; - createEvent(eventInterface:"WheelEvent"): WheelEvent; - createEvent(eventInterface: string): Event; -} - -interface ElementTraversal { - readonly childElementCount: number; - readonly firstElementChild: Element; - readonly lastElementChild: Element; - readonly nextElementSibling: Element; - readonly previousElementSibling: Element; -} - -interface GetSVGDocument { - getSVGDocument(): Document; -} - -interface GlobalEventHandlersEventMap { - "pointercancel": PointerEvent; - "pointerdown": PointerEvent; - "pointerenter": PointerEvent; - "pointerleave": PointerEvent; - "pointermove": PointerEvent; - "pointerout": PointerEvent; - "pointerover": PointerEvent; - "pointerup": PointerEvent; - "wheel": WheelEvent; -} - -interface GlobalEventHandlers { - onpointercancel: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onpointerdown: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onpointerenter: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onpointerleave: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onpointermove: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onpointerout: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onpointerover: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onpointerup: (this: GlobalEventHandlers, ev: PointerEvent) => any; - onwheel: (this: GlobalEventHandlers, ev: WheelEvent) => any; - addEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface HTMLTableAlignment { - /** - * Sets or retrieves a value that you can use to implement your own ch functionality for the object. - */ - ch: string; - /** - * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. - */ - chOff: string; - /** - * Sets or retrieves how text and other content are vertically aligned within the object that contains them. - */ - vAlign: string; -} - -interface IDBEnvironment { - readonly indexedDB: IDBFactory; -} - -interface LinkStyle { - readonly sheet: StyleSheet; -} - -interface MSBaseReaderEventMap { - "abort": Event; - "error": ErrorEvent; - "load": Event; - "loadend": ProgressEvent; - "loadstart": Event; - "progress": ProgressEvent; -} - -interface MSBaseReader { - onabort: (this: MSBaseReader, ev: Event) => any; - onerror: (this: MSBaseReader, ev: ErrorEvent) => any; - onload: (this: MSBaseReader, ev: Event) => any; - onloadend: (this: MSBaseReader, ev: ProgressEvent) => any; - onloadstart: (this: MSBaseReader, ev: Event) => any; - onprogress: (this: MSBaseReader, ev: ProgressEvent) => any; - readonly readyState: number; - readonly result: any; - abort(): void; - readonly DONE: number; - readonly EMPTY: number; - readonly LOADING: number; - addEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface MSFileSaver { - msSaveBlob(blob: any, defaultName?: string): boolean; - msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; -} - -interface MSNavigatorDoNotTrack { - confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; - confirmWebWideTrackingException(args: ExceptionInformation): boolean; - removeSiteSpecificTrackingException(args: ExceptionInformation): void; - removeWebWideTrackingException(args: ExceptionInformation): void; - storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; - storeWebWideTrackingException(args: StoreExceptionsInformation): void; -} - -interface NavigatorContentUtils { -} - -interface NavigatorGeolocation { - readonly geolocation: Geolocation; -} - -interface NavigatorID { - readonly appName: string; - readonly appVersion: string; - readonly platform: string; - readonly product: string; - readonly productSub: string; - readonly userAgent: string; - readonly vendor: string; - readonly vendorSub: string; -} - -interface NavigatorOnLine { - readonly onLine: boolean; -} - -interface NavigatorStorageUtils { -} - -interface NavigatorUserMedia { - readonly mediaDevices: MediaDevices; - getUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback): void; -} - -interface NodeSelector { - querySelector(selectors: K): ElementTagNameMap[K] | null; - querySelector(selectors: string): Element | null; - querySelectorAll(selectors: K): ElementListTagNameMap[K]; - querySelectorAll(selectors: string): NodeListOf; -} - -interface RandomSource { - getRandomValues(array: ArrayBufferView): ArrayBufferView; -} - -interface SVGAnimatedPathData { - readonly pathSegList: SVGPathSegList; -} - -interface SVGAnimatedPoints { - readonly animatedPoints: SVGPointList; - readonly points: SVGPointList; -} - -interface SVGExternalResourcesRequired { - readonly externalResourcesRequired: SVGAnimatedBoolean; -} - -interface SVGFilterPrimitiveStandardAttributes extends SVGStylable { - readonly height: SVGAnimatedLength; - readonly result: SVGAnimatedString; - readonly width: SVGAnimatedLength; - readonly x: SVGAnimatedLength; - readonly y: SVGAnimatedLength; -} - -interface SVGFitToViewBox { - readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - readonly viewBox: SVGAnimatedRect; -} - -interface SVGLangSpace { - xmllang: string; - xmlspace: string; -} - -interface SVGLocatable { - readonly farthestViewportElement: SVGElement; - readonly nearestViewportElement: SVGElement; - getBBox(): SVGRect; - getCTM(): SVGMatrix; - getScreenCTM(): SVGMatrix; - getTransformToElement(element: SVGElement): SVGMatrix; -} - -interface SVGStylable { - className: any; - readonly style: CSSStyleDeclaration; -} - -interface SVGTests { - readonly requiredExtensions: SVGStringList; - readonly requiredFeatures: SVGStringList; - readonly systemLanguage: SVGStringList; - hasExtension(extension: string): boolean; -} - -interface SVGTransformable extends SVGLocatable { - readonly transform: SVGAnimatedTransformList; -} - -interface SVGURIReference { - readonly href: SVGAnimatedString; -} - -interface WindowBase64 { - atob(encodedString: string): string; - btoa(rawString: string): string; -} - -interface WindowConsole { - readonly console: Console; -} - -interface WindowLocalStorage { - readonly localStorage: Storage; -} - -interface WindowSessionStorage { - readonly sessionStorage: Storage; -} - -interface WindowTimers extends Object, WindowTimersExtension { - clearInterval(handle: number): void; - clearTimeout(handle: number): void; - setInterval(handler: (...args: any[]) => void, timeout: number): number; - setInterval(handler: any, timeout?: any, ...args: any[]): number; - setTimeout(handler: (...args: any[]) => void, timeout: number): number; - setTimeout(handler: any, timeout?: any, ...args: any[]): number; -} - -interface WindowTimersExtension { - clearImmediate(handle: number): void; - setImmediate(handler: (...args: any[]) => void): number; - setImmediate(handler: any, ...args: any[]): number; -} - -interface XMLHttpRequestEventTargetEventMap { - "abort": Event; - "error": ErrorEvent; - "load": Event; - "loadend": ProgressEvent; - "loadstart": Event; - "progress": ProgressEvent; - "timeout": ProgressEvent; -} - -interface XMLHttpRequestEventTarget { - onabort: (this: XMLHttpRequestEventTarget, ev: Event) => any; - onerror: (this: XMLHttpRequestEventTarget, ev: ErrorEvent) => any; - onload: (this: XMLHttpRequestEventTarget, ev: Event) => any; - onloadend: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; - onloadstart: (this: XMLHttpRequestEventTarget, ev: Event) => any; - onprogress: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; - ontimeout: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; - addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface StorageEventInit extends EventInit { - key?: string; - oldValue?: string; - newValue?: string; - url: string; - storageArea?: Storage; -} - -interface Canvas2DContextAttributes { - alpha?: boolean; - willReadFrequently?: boolean; - storage?: boolean; - [attribute: string]: boolean | string | undefined; -} - -interface NodeListOf extends NodeList { - length: number; - item(index: number): TNode; - [index: number]: TNode; -} - -interface HTMLCollectionOf extends HTMLCollection { - item(index: number): T; - namedItem(name: string): T; - [index: number]: T; -} - -interface BlobPropertyBag { - type?: string; - endings?: string; -} - -interface FilePropertyBag { - type?: string; - lastModified?: number; -} - -interface EventListenerObject { - handleEvent(evt: Event): void; -} - -interface MessageEventInit extends EventInit { - data?: any; - origin?: string; - lastEventId?: string; - channel?: string; - source?: any; - ports?: MessagePort[]; -} - -interface ProgressEventInit extends EventInit { - lengthComputable?: boolean; - loaded?: number; - total?: number; -} - -interface ScrollOptions { - behavior?: ScrollBehavior; -} - -interface ScrollToOptions extends ScrollOptions { - left?: number; - top?: number; -} - -interface ScrollIntoViewOptions extends ScrollOptions { - block?: ScrollLogicalPosition; - inline?: ScrollLogicalPosition; -} - -interface ClipboardEventInit extends EventInit { - data?: string; - dataType?: string; -} - -interface IDBArrayKey extends Array { -} - -interface RsaKeyGenParams extends Algorithm { - modulusLength: number; - publicExponent: Uint8Array; -} - -interface RsaHashedKeyGenParams extends RsaKeyGenParams { - hash: AlgorithmIdentifier; -} - -interface RsaKeyAlgorithm extends KeyAlgorithm { - modulusLength: number; - publicExponent: Uint8Array; -} - -interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { - hash: AlgorithmIdentifier; -} - -interface RsaHashedImportParams { - hash: AlgorithmIdentifier; -} - -interface RsaPssParams { - saltLength: number; -} - -interface RsaOaepParams extends Algorithm { - label?: BufferSource; -} - -interface EcdsaParams extends Algorithm { - hash: AlgorithmIdentifier; -} - -interface EcKeyGenParams extends Algorithm { - namedCurve: string; -} - -interface EcKeyAlgorithm extends KeyAlgorithm { - typedCurve: string; -} - -interface EcKeyImportParams { - namedCurve: string; -} - -interface EcdhKeyDeriveParams extends Algorithm { - public: CryptoKey; -} - -interface AesCtrParams extends Algorithm { - counter: BufferSource; - length: number; -} - -interface AesKeyAlgorithm extends KeyAlgorithm { - length: number; -} - -interface AesKeyGenParams extends Algorithm { - length: number; -} - -interface AesDerivedKeyParams extends Algorithm { - length: number; -} - -interface AesCbcParams extends Algorithm { - iv: BufferSource; -} - -interface AesCmacParams extends Algorithm { - length: number; -} - -interface AesGcmParams extends Algorithm { - iv: BufferSource; - additionalData?: BufferSource; - tagLength?: number; -} - -interface AesCfbParams extends Algorithm { - iv: BufferSource; -} - -interface HmacImportParams extends Algorithm { - hash?: AlgorithmIdentifier; - length?: number; -} - -interface HmacKeyAlgorithm extends KeyAlgorithm { - hash: AlgorithmIdentifier; - length: number; -} - -interface HmacKeyGenParams extends Algorithm { - hash: AlgorithmIdentifier; - length?: number; -} - -interface DhKeyGenParams extends Algorithm { - prime: Uint8Array; - generator: Uint8Array; -} - -interface DhKeyAlgorithm extends KeyAlgorithm { - prime: Uint8Array; - generator: Uint8Array; -} - -interface DhKeyDeriveParams extends Algorithm { - public: CryptoKey; -} - -interface DhImportKeyParams extends Algorithm { - prime: Uint8Array; - generator: Uint8Array; -} - -interface ConcatParams extends Algorithm { - hash?: AlgorithmIdentifier; - algorithmId: Uint8Array; - partyUInfo: Uint8Array; - partyVInfo: Uint8Array; - publicInfo?: Uint8Array; - privateInfo?: Uint8Array; -} - -interface HkdfCtrParams extends Algorithm { - hash: AlgorithmIdentifier; - label: BufferSource; - context: BufferSource; -} - -interface Pbkdf2Params extends Algorithm { - salt: BufferSource; - iterations: number; - hash: AlgorithmIdentifier; -} - -interface RsaOtherPrimesInfo { - r: string; - d: string; - t: string; -} - -interface JsonWebKey { - kty: string; - use?: string; - key_ops?: string[]; - alg?: string; - kid?: string; - x5u?: string; - x5c?: string; - x5t?: string; - ext?: boolean; - crv?: string; - x?: string; - y?: string; - d?: string; - n?: string; - e?: string; - p?: string; - q?: string; - dp?: string; - dq?: string; - qi?: string; - oth?: RsaOtherPrimesInfo[]; - k?: string; -} - -interface ParentNode { - readonly children: HTMLCollection; - readonly firstElementChild: Element; - readonly lastElementChild: Element; - readonly childElementCount: number; -} - -interface DocumentOrShadowRoot { - readonly activeElement: Element | null; - readonly stylesheets: StyleSheetList; - getSelection(): Selection | null; - elementFromPoint(x: number, y: number): Element | null; - elementsFromPoint(x: number, y: number): Element[]; -} - -interface ShadowRoot extends DocumentOrShadowRoot, DocumentFragment { - readonly host: Element; - innerHTML: string; -} - -interface ShadowRootInit { - mode: 'open'|'closed'; - delegatesFocus?: boolean; -} - -interface HTMLSlotElement extends HTMLElement { - name: string; - assignedNodes(options?: AssignedNodesOptions): Node[]; -} - -interface AssignedNodesOptions { - flatten?: boolean; -} - -declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; - -interface ErrorEventHandler { - (message: string, filename?: string, lineno?: number, colno?: number, error?:Error): void; -} -interface PositionCallback { - (position: Position): void; -} -interface PositionErrorCallback { - (error: PositionError): void; -} -interface MediaQueryListListener { - (mql: MediaQueryList): void; -} -interface MSLaunchUriCallback { - (): void; -} -interface FrameRequestCallback { - (time: number): void; -} -interface MSUnsafeFunctionCallback { - (): any; -} -interface MSExecAtPriorityFunctionCallback { - (...args: any[]): any; -} -interface MutationCallback { - (mutations: MutationRecord[], observer: MutationObserver): void; -} -interface DecodeSuccessCallback { - (decodedData: AudioBuffer): void; -} -interface DecodeErrorCallback { - (error: DOMException): void; -} -interface FunctionStringCallback { - (data: string): void; -} -interface NavigatorUserMediaSuccessCallback { - (stream: MediaStream): void; -} -interface NavigatorUserMediaErrorCallback { - (error: MediaStreamError): void; -} -interface ForEachCallback { - (keyId: any, status: string): void; -} -interface HTMLElementTagNameMap { - "a": HTMLAnchorElement; - "applet": HTMLAppletElement; - "area": HTMLAreaElement; - "audio": HTMLAudioElement; - "base": HTMLBaseElement; - "basefont": HTMLBaseFontElement; - "blockquote": HTMLQuoteElement; - "body": HTMLBodyElement; - "br": HTMLBRElement; - "button": HTMLButtonElement; - "canvas": HTMLCanvasElement; - "caption": HTMLTableCaptionElement; - "col": HTMLTableColElement; - "colgroup": HTMLTableColElement; - "datalist": HTMLDataListElement; - "del": HTMLModElement; - "dir": HTMLDirectoryElement; - "div": HTMLDivElement; - "dl": HTMLDListElement; - "embed": HTMLEmbedElement; - "fieldset": HTMLFieldSetElement; - "font": HTMLFontElement; - "form": HTMLFormElement; - "frame": HTMLFrameElement; - "frameset": HTMLFrameSetElement; - "h1": HTMLHeadingElement; - "h2": HTMLHeadingElement; - "h3": HTMLHeadingElement; - "h4": HTMLHeadingElement; - "h5": HTMLHeadingElement; - "h6": HTMLHeadingElement; - "head": HTMLHeadElement; - "hr": HTMLHRElement; - "html": HTMLHtmlElement; - "iframe": HTMLIFrameElement; - "img": HTMLImageElement; - "input": HTMLInputElement; - "ins": HTMLModElement; - "isindex": HTMLUnknownElement; - "label": HTMLLabelElement; - "legend": HTMLLegendElement; - "li": HTMLLIElement; - "link": HTMLLinkElement; - "listing": HTMLPreElement; - "map": HTMLMapElement; - "marquee": HTMLMarqueeElement; - "menu": HTMLMenuElement; - "meta": HTMLMetaElement; - "meter": HTMLMeterElement; - "nextid": HTMLUnknownElement; - "object": HTMLObjectElement; - "ol": HTMLOListElement; - "optgroup": HTMLOptGroupElement; - "option": HTMLOptionElement; - "p": HTMLParagraphElement; - "param": HTMLParamElement; - "picture": HTMLPictureElement; - "pre": HTMLPreElement; - "progress": HTMLProgressElement; - "q": HTMLQuoteElement; - "script": HTMLScriptElement; - "select": HTMLSelectElement; - "source": HTMLSourceElement; - "span": HTMLSpanElement; - "style": HTMLStyleElement; - "table": HTMLTableElement; - "tbody": HTMLTableSectionElement; - "td": HTMLTableDataCellElement; - "template": HTMLTemplateElement; - "textarea": HTMLTextAreaElement; - "tfoot": HTMLTableSectionElement; - "th": HTMLTableHeaderCellElement; - "thead": HTMLTableSectionElement; - "title": HTMLTitleElement; - "tr": HTMLTableRowElement; - "track": HTMLTrackElement; - "ul": HTMLUListElement; - "video": HTMLVideoElement; - "x-ms-webview": MSHTMLWebViewElement; - "xmp": HTMLPreElement; -} - -interface ElementTagNameMap { - "a": HTMLAnchorElement; - "abbr": HTMLElement; - "acronym": HTMLElement; - "address": HTMLElement; - "applet": HTMLAppletElement; - "area": HTMLAreaElement; - "article": HTMLElement; - "aside": HTMLElement; - "audio": HTMLAudioElement; - "b": HTMLElement; - "base": HTMLBaseElement; - "basefont": HTMLBaseFontElement; - "bdo": HTMLElement; - "big": HTMLElement; - "blockquote": HTMLQuoteElement; - "body": HTMLBodyElement; - "br": HTMLBRElement; - "button": HTMLButtonElement; - "canvas": HTMLCanvasElement; - "caption": HTMLTableCaptionElement; - "center": HTMLElement; - "circle": SVGCircleElement; - "cite": HTMLElement; - "clippath": SVGClipPathElement; - "code": HTMLElement; - "col": HTMLTableColElement; - "colgroup": HTMLTableColElement; - "datalist": HTMLDataListElement; - "dd": HTMLElement; - "defs": SVGDefsElement; - "del": HTMLModElement; - "desc": SVGDescElement; - "dfn": HTMLElement; - "dir": HTMLDirectoryElement; - "div": HTMLDivElement; - "dl": HTMLDListElement; - "dt": HTMLElement; - "ellipse": SVGEllipseElement; - "em": HTMLElement; - "embed": HTMLEmbedElement; - "feblend": SVGFEBlendElement; - "fecolormatrix": SVGFEColorMatrixElement; - "fecomponenttransfer": SVGFEComponentTransferElement; - "fecomposite": SVGFECompositeElement; - "feconvolvematrix": SVGFEConvolveMatrixElement; - "fediffuselighting": SVGFEDiffuseLightingElement; - "fedisplacementmap": SVGFEDisplacementMapElement; - "fedistantlight": SVGFEDistantLightElement; - "feflood": SVGFEFloodElement; - "fefunca": SVGFEFuncAElement; - "fefuncb": SVGFEFuncBElement; - "fefuncg": SVGFEFuncGElement; - "fefuncr": SVGFEFuncRElement; - "fegaussianblur": SVGFEGaussianBlurElement; - "feimage": SVGFEImageElement; - "femerge": SVGFEMergeElement; - "femergenode": SVGFEMergeNodeElement; - "femorphology": SVGFEMorphologyElement; - "feoffset": SVGFEOffsetElement; - "fepointlight": SVGFEPointLightElement; - "fespecularlighting": SVGFESpecularLightingElement; - "fespotlight": SVGFESpotLightElement; - "fetile": SVGFETileElement; - "feturbulence": SVGFETurbulenceElement; - "fieldset": HTMLFieldSetElement; - "figcaption": HTMLElement; - "figure": HTMLElement; - "filter": SVGFilterElement; - "font": HTMLFontElement; - "footer": HTMLElement; - "foreignobject": SVGForeignObjectElement; - "form": HTMLFormElement; - "frame": HTMLFrameElement; - "frameset": HTMLFrameSetElement; - "g": SVGGElement; - "h1": HTMLHeadingElement; - "h2": HTMLHeadingElement; - "h3": HTMLHeadingElement; - "h4": HTMLHeadingElement; - "h5": HTMLHeadingElement; - "h6": HTMLHeadingElement; - "head": HTMLHeadElement; - "header": HTMLElement; - "hgroup": HTMLElement; - "hr": HTMLHRElement; - "html": HTMLHtmlElement; - "i": HTMLElement; - "iframe": HTMLIFrameElement; - "image": SVGImageElement; - "img": HTMLImageElement; - "input": HTMLInputElement; - "ins": HTMLModElement; - "isindex": HTMLUnknownElement; - "kbd": HTMLElement; - "keygen": HTMLElement; - "label": HTMLLabelElement; - "legend": HTMLLegendElement; - "li": HTMLLIElement; - "line": SVGLineElement; - "lineargradient": SVGLinearGradientElement; - "link": HTMLLinkElement; - "listing": HTMLPreElement; - "map": HTMLMapElement; - "mark": HTMLElement; - "marker": SVGMarkerElement; - "marquee": HTMLMarqueeElement; - "mask": SVGMaskElement; - "menu": HTMLMenuElement; - "meta": HTMLMetaElement; - "metadata": SVGMetadataElement; - "meter": HTMLMeterElement; - "nav": HTMLElement; - "nextid": HTMLUnknownElement; - "nobr": HTMLElement; - "noframes": HTMLElement; - "noscript": HTMLElement; - "object": HTMLObjectElement; - "ol": HTMLOListElement; - "optgroup": HTMLOptGroupElement; - "option": HTMLOptionElement; - "p": HTMLParagraphElement; - "param": HTMLParamElement; - "path": SVGPathElement; - "pattern": SVGPatternElement; - "picture": HTMLPictureElement; - "plaintext": HTMLElement; - "polygon": SVGPolygonElement; - "polyline": SVGPolylineElement; - "pre": HTMLPreElement; - "progress": HTMLProgressElement; - "q": HTMLQuoteElement; - "radialgradient": SVGRadialGradientElement; - "rect": SVGRectElement; - "rt": HTMLElement; - "ruby": HTMLElement; - "s": HTMLElement; - "samp": HTMLElement; - "script": HTMLScriptElement; - "section": HTMLElement; - "select": HTMLSelectElement; - "small": HTMLElement; - "source": HTMLSourceElement; - "span": HTMLSpanElement; - "stop": SVGStopElement; - "strike": HTMLElement; - "strong": HTMLElement; - "style": HTMLStyleElement; - "sub": HTMLElement; - "sup": HTMLElement; - "svg": SVGSVGElement; - "switch": SVGSwitchElement; - "symbol": SVGSymbolElement; - "table": HTMLTableElement; - "tbody": HTMLTableSectionElement; - "td": HTMLTableDataCellElement; - "template": HTMLTemplateElement; - "text": SVGTextElement; - "textpath": SVGTextPathElement; - "textarea": HTMLTextAreaElement; - "tfoot": HTMLTableSectionElement; - "th": HTMLTableHeaderCellElement; - "thead": HTMLTableSectionElement; - "title": HTMLTitleElement; - "tr": HTMLTableRowElement; - "track": HTMLTrackElement; - "tspan": SVGTSpanElement; - "tt": HTMLElement; - "u": HTMLElement; - "ul": HTMLUListElement; - "use": SVGUseElement; - "var": HTMLElement; - "video": HTMLVideoElement; - "view": SVGViewElement; - "wbr": HTMLElement; - "x-ms-webview": MSHTMLWebViewElement; - "xmp": HTMLPreElement; -} - -interface ElementListTagNameMap { - "a": NodeListOf; - "abbr": NodeListOf; - "acronym": NodeListOf; - "address": NodeListOf; - "applet": NodeListOf; - "area": NodeListOf; - "article": NodeListOf; - "aside": NodeListOf; - "audio": NodeListOf; - "b": NodeListOf; - "base": NodeListOf; - "basefont": NodeListOf; - "bdo": NodeListOf; - "big": NodeListOf; - "blockquote": NodeListOf; - "body": NodeListOf; - "br": NodeListOf; - "button": NodeListOf; - "canvas": NodeListOf; - "caption": NodeListOf; - "center": NodeListOf; - "circle": NodeListOf; - "cite": NodeListOf; - "clippath": NodeListOf; - "code": NodeListOf; - "col": NodeListOf; - "colgroup": NodeListOf; - "datalist": NodeListOf; - "dd": NodeListOf; - "defs": NodeListOf; - "del": NodeListOf; - "desc": NodeListOf; - "dfn": NodeListOf; - "dir": NodeListOf; - "div": NodeListOf; - "dl": NodeListOf; - "dt": NodeListOf; - "ellipse": NodeListOf; - "em": NodeListOf; - "embed": NodeListOf; - "feblend": NodeListOf; - "fecolormatrix": NodeListOf; - "fecomponenttransfer": NodeListOf; - "fecomposite": NodeListOf; - "feconvolvematrix": NodeListOf; - "fediffuselighting": NodeListOf; - "fedisplacementmap": NodeListOf; - "fedistantlight": NodeListOf; - "feflood": NodeListOf; - "fefunca": NodeListOf; - "fefuncb": NodeListOf; - "fefuncg": NodeListOf; - "fefuncr": NodeListOf; - "fegaussianblur": NodeListOf; - "feimage": NodeListOf; - "femerge": NodeListOf; - "femergenode": NodeListOf; - "femorphology": NodeListOf; - "feoffset": NodeListOf; - "fepointlight": NodeListOf; - "fespecularlighting": NodeListOf; - "fespotlight": NodeListOf; - "fetile": NodeListOf; - "feturbulence": NodeListOf; - "fieldset": NodeListOf; - "figcaption": NodeListOf; - "figure": NodeListOf; - "filter": NodeListOf; - "font": NodeListOf; - "footer": NodeListOf; - "foreignobject": NodeListOf; - "form": NodeListOf; - "frame": NodeListOf; - "frameset": NodeListOf; - "g": NodeListOf; - "h1": NodeListOf; - "h2": NodeListOf; - "h3": NodeListOf; - "h4": NodeListOf; - "h5": NodeListOf; - "h6": NodeListOf; - "head": NodeListOf; - "header": NodeListOf; - "hgroup": NodeListOf; - "hr": NodeListOf; - "html": NodeListOf; - "i": NodeListOf; - "iframe": NodeListOf; - "image": NodeListOf; - "img": NodeListOf; - "input": NodeListOf; - "ins": NodeListOf; - "isindex": NodeListOf; - "kbd": NodeListOf; - "keygen": NodeListOf; - "label": NodeListOf; - "legend": NodeListOf; - "li": NodeListOf; - "line": NodeListOf; - "lineargradient": NodeListOf; - "link": NodeListOf; - "listing": NodeListOf; - "map": NodeListOf; - "mark": NodeListOf; - "marker": NodeListOf; - "marquee": NodeListOf; - "mask": NodeListOf; - "menu": NodeListOf; - "meta": NodeListOf; - "metadata": NodeListOf; - "meter": NodeListOf; - "nav": NodeListOf; - "nextid": NodeListOf; - "nobr": NodeListOf; - "noframes": NodeListOf; - "noscript": NodeListOf; - "object": NodeListOf; - "ol": NodeListOf; - "optgroup": NodeListOf; - "option": NodeListOf; - "p": NodeListOf; - "param": NodeListOf; - "path": NodeListOf; - "pattern": NodeListOf; - "picture": NodeListOf; - "plaintext": NodeListOf; - "polygon": NodeListOf; - "polyline": NodeListOf; - "pre": NodeListOf; - "progress": NodeListOf; - "q": NodeListOf; - "radialgradient": NodeListOf; - "rect": NodeListOf; - "rt": NodeListOf; - "ruby": NodeListOf; - "s": NodeListOf; - "samp": NodeListOf; - "script": NodeListOf; - "section": NodeListOf; - "select": NodeListOf; - "small": NodeListOf; - "source": NodeListOf; - "span": NodeListOf; - "stop": NodeListOf; - "strike": NodeListOf; - "strong": NodeListOf; - "style": NodeListOf; - "sub": NodeListOf; - "sup": NodeListOf; - "svg": NodeListOf; - "switch": NodeListOf; - "symbol": NodeListOf; - "table": NodeListOf; - "tbody": NodeListOf; - "td": NodeListOf; - "template": NodeListOf; - "text": NodeListOf; - "textpath": NodeListOf; - "textarea": NodeListOf; - "tfoot": NodeListOf; - "th": NodeListOf; - "thead": NodeListOf; - "title": NodeListOf; - "tr": NodeListOf; - "track": NodeListOf; - "tspan": NodeListOf; - "tt": NodeListOf; - "u": NodeListOf; - "ul": NodeListOf; - "use": NodeListOf; - "var": NodeListOf; - "video": NodeListOf; - "view": NodeListOf; - "wbr": NodeListOf; - "x-ms-webview": NodeListOf; - "xmp": NodeListOf; -} - -declare var Audio: {new(src?: string): HTMLAudioElement; }; -declare var Image: {new(width?: number, height?: number): HTMLImageElement; }; -declare var Option: {new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; }; -declare var applicationCache: ApplicationCache; -declare var clientInformation: Navigator; -declare var closed: boolean; -declare var crypto: Crypto; -declare var defaultStatus: string; -declare var devicePixelRatio: number; -declare var doNotTrack: string; -declare var document: Document; -declare var event: Event | undefined; -declare var external: External; -declare var frameElement: Element; -declare var frames: Window; -declare var history: History; -declare var innerHeight: number; -declare var innerWidth: number; -declare var length: number; -declare var location: Location; -declare var locationbar: BarProp; -declare var menubar: BarProp; -declare var msCredentials: MSCredentials; -declare const name: never; -declare var navigator: Navigator; -declare var offscreenBuffering: string | boolean; -declare var onabort: (this: Window, ev: UIEvent) => any; -declare var onafterprint: (this: Window, ev: Event) => any; -declare var onbeforeprint: (this: Window, ev: Event) => any; -declare var onbeforeunload: (this: Window, ev: BeforeUnloadEvent) => any; -declare var onblur: (this: Window, ev: FocusEvent) => any; -declare var oncanplay: (this: Window, ev: Event) => any; -declare var oncanplaythrough: (this: Window, ev: Event) => any; -declare var onchange: (this: Window, ev: Event) => any; -declare var onclick: (this: Window, ev: MouseEvent) => any; -declare var oncompassneedscalibration: (this: Window, ev: Event) => any; -declare var oncontextmenu: (this: Window, ev: PointerEvent) => any; -declare var ondblclick: (this: Window, ev: MouseEvent) => any; -declare var ondevicelight: (this: Window, ev: DeviceLightEvent) => any; -declare var ondevicemotion: (this: Window, ev: DeviceMotionEvent) => any; -declare var ondeviceorientation: (this: Window, ev: DeviceOrientationEvent) => any; -declare var ondrag: (this: Window, ev: DragEvent) => any; -declare var ondragend: (this: Window, ev: DragEvent) => any; -declare var ondragenter: (this: Window, ev: DragEvent) => any; -declare var ondragleave: (this: Window, ev: DragEvent) => any; -declare var ondragover: (this: Window, ev: DragEvent) => any; -declare var ondragstart: (this: Window, ev: DragEvent) => any; -declare var ondrop: (this: Window, ev: DragEvent) => any; -declare var ondurationchange: (this: Window, ev: Event) => any; -declare var onemptied: (this: Window, ev: Event) => any; -declare var onended: (this: Window, ev: MediaStreamErrorEvent) => any; -declare var onerror: ErrorEventHandler; -declare var onfocus: (this: Window, ev: FocusEvent) => any; -declare var onhashchange: (this: Window, ev: HashChangeEvent) => any; -declare var oninput: (this: Window, ev: Event) => any; -declare var oninvalid: (this: Window, ev: Event) => any; -declare var onkeydown: (this: Window, ev: KeyboardEvent) => any; -declare var onkeypress: (this: Window, ev: KeyboardEvent) => any; -declare var onkeyup: (this: Window, ev: KeyboardEvent) => any; -declare var onload: (this: Window, ev: Event) => any; -declare var onloadeddata: (this: Window, ev: Event) => any; -declare var onloadedmetadata: (this: Window, ev: Event) => any; -declare var onloadstart: (this: Window, ev: Event) => any; -declare var onmessage: (this: Window, ev: MessageEvent) => any; -declare var onmousedown: (this: Window, ev: MouseEvent) => any; -declare var onmouseenter: (this: Window, ev: MouseEvent) => any; -declare var onmouseleave: (this: Window, ev: MouseEvent) => any; -declare var onmousemove: (this: Window, ev: MouseEvent) => any; -declare var onmouseout: (this: Window, ev: MouseEvent) => any; -declare var onmouseover: (this: Window, ev: MouseEvent) => any; -declare var onmouseup: (this: Window, ev: MouseEvent) => any; -declare var onmousewheel: (this: Window, ev: WheelEvent) => any; -declare var onmsgesturechange: (this: Window, ev: MSGestureEvent) => any; -declare var onmsgesturedoubletap: (this: Window, ev: MSGestureEvent) => any; -declare var onmsgestureend: (this: Window, ev: MSGestureEvent) => any; -declare var onmsgesturehold: (this: Window, ev: MSGestureEvent) => any; -declare var onmsgesturestart: (this: Window, ev: MSGestureEvent) => any; -declare var onmsgesturetap: (this: Window, ev: MSGestureEvent) => any; -declare var onmsinertiastart: (this: Window, ev: MSGestureEvent) => any; -declare var onmspointercancel: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerdown: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerenter: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerleave: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointermove: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerout: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerover: (this: Window, ev: MSPointerEvent) => any; -declare var onmspointerup: (this: Window, ev: MSPointerEvent) => any; -declare var onoffline: (this: Window, ev: Event) => any; -declare var ononline: (this: Window, ev: Event) => any; -declare var onorientationchange: (this: Window, ev: Event) => any; -declare var onpagehide: (this: Window, ev: PageTransitionEvent) => any; -declare var onpageshow: (this: Window, ev: PageTransitionEvent) => any; -declare var onpause: (this: Window, ev: Event) => any; -declare var onplay: (this: Window, ev: Event) => any; -declare var onplaying: (this: Window, ev: Event) => any; -declare var onpopstate: (this: Window, ev: PopStateEvent) => any; -declare var onprogress: (this: Window, ev: ProgressEvent) => any; -declare var onratechange: (this: Window, ev: Event) => any; -declare var onreadystatechange: (this: Window, ev: ProgressEvent) => any; -declare var onreset: (this: Window, ev: Event) => any; -declare var onresize: (this: Window, ev: UIEvent) => any; -declare var onscroll: (this: Window, ev: UIEvent) => any; -declare var onseeked: (this: Window, ev: Event) => any; -declare var onseeking: (this: Window, ev: Event) => any; -declare var onselect: (this: Window, ev: UIEvent) => any; -declare var onstalled: (this: Window, ev: Event) => any; -declare var onstorage: (this: Window, ev: StorageEvent) => any; -declare var onsubmit: (this: Window, ev: Event) => any; -declare var onsuspend: (this: Window, ev: Event) => any; -declare var ontimeupdate: (this: Window, ev: Event) => any; -declare var ontouchcancel: (ev: TouchEvent) => any; -declare var ontouchend: (ev: TouchEvent) => any; -declare var ontouchmove: (ev: TouchEvent) => any; -declare var ontouchstart: (ev: TouchEvent) => any; -declare var onunload: (this: Window, ev: Event) => any; -declare var onvolumechange: (this: Window, ev: Event) => any; -declare var onwaiting: (this: Window, ev: Event) => any; -declare var opener: any; -declare var orientation: string | number; -declare var outerHeight: number; -declare var outerWidth: number; -declare var pageXOffset: number; -declare var pageYOffset: number; -declare var parent: Window; -declare var performance: Performance; -declare var personalbar: BarProp; -declare var screen: Screen; -declare var screenLeft: number; -declare var screenTop: number; -declare var screenX: number; -declare var screenY: number; -declare var scrollX: number; -declare var scrollY: number; -declare var scrollbars: BarProp; -declare var self: Window; -declare var status: string; -declare var statusbar: BarProp; -declare var styleMedia: StyleMedia; -declare var toolbar: BarProp; -declare var top: Window; -declare var window: Window; -declare function alert(message?: any): void; -declare function blur(): void; -declare function cancelAnimationFrame(handle: number): void; -declare function captureEvents(): void; -declare function close(): void; -declare function confirm(message?: string): boolean; -declare function focus(): void; -declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; -declare function getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; -declare function getSelection(): Selection; -declare function matchMedia(mediaQuery: string): MediaQueryList; -declare function moveBy(x?: number, y?: number): void; -declare function moveTo(x?: number, y?: number): void; -declare function msWriteProfilerMark(profilerMarkName: string): void; -declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window; -declare function postMessage(message: any, targetOrigin: string, transfer?: any[]): void; -declare function print(): void; -declare function prompt(message?: string, _default?: string): string | null; -declare function releaseEvents(): void; -declare function requestAnimationFrame(callback: FrameRequestCallback): number; -declare function resizeBy(x?: number, y?: number): void; -declare function resizeTo(x?: number, y?: number): void; -declare function scroll(x?: number, y?: number): void; -declare function scrollBy(x?: number, y?: number): void; -declare function scrollTo(x?: number, y?: number): void; -declare function webkitCancelAnimationFrame(handle: number): void; -declare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; -declare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; -declare function webkitRequestAnimationFrame(callback: FrameRequestCallback): number; -declare function scroll(options?: ScrollToOptions): void; -declare function scrollTo(options?: ScrollToOptions): void; -declare function scrollBy(options?: ScrollToOptions): void; -declare function toString(): string; -declare function dispatchEvent(evt: Event): boolean; -declare function removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void; -declare function clearInterval(handle: number): void; -declare function clearTimeout(handle: number): void; -declare function setInterval(handler: (...args: any[]) => void, timeout: number): number; -declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; -declare function setTimeout(handler: (...args: any[]) => void, timeout: number): number; -declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; -declare function clearImmediate(handle: number): void; -declare function setImmediate(handler: (...args: any[]) => void): number; -declare function setImmediate(handler: any, ...args: any[]): number; -declare var sessionStorage: Storage; -declare var localStorage: Storage; -declare var console: Console; -declare var onpointercancel: (this: Window, ev: PointerEvent) => any; -declare var onpointerdown: (this: Window, ev: PointerEvent) => any; -declare var onpointerenter: (this: Window, ev: PointerEvent) => any; -declare var onpointerleave: (this: Window, ev: PointerEvent) => any; -declare var onpointermove: (this: Window, ev: PointerEvent) => any; -declare var onpointerout: (this: Window, ev: PointerEvent) => any; -declare var onpointerover: (this: Window, ev: PointerEvent) => any; -declare var onpointerup: (this: Window, ev: PointerEvent) => any; -declare var onwheel: (this: Window, ev: WheelEvent) => any; -declare var indexedDB: IDBFactory; -declare function atob(encodedString: string): string; -declare function btoa(rawString: string): string; -declare function addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, useCapture?: boolean): void; -declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -type AAGUID = string; -type AlgorithmIdentifier = string | Algorithm; -type ConstrainBoolean = boolean | ConstrainBooleanParameters; -type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters; -type ConstrainDouble = number | ConstrainDoubleRange; -type ConstrainLong = number | ConstrainLongRange; -type CryptoOperationData = ArrayBufferView; -type GLbitfield = number; -type GLboolean = boolean; -type GLbyte = number; -type GLclampf = number; -type GLenum = number; -type GLfloat = number; -type GLint = number; -type GLintptr = number; -type GLshort = number; -type GLsizei = number; -type GLsizeiptr = number; -type GLubyte = number; -type GLuint = number; -type GLushort = number; -type IDBKeyPath = string; -type KeyFormat = string; -type KeyType = string; -type KeyUsage = string; -type MSInboundPayload = MSVideoRecvPayload | MSAudioRecvPayload; -type MSLocalClientEvent = MSLocalClientEventBase | MSAudioLocalClientEvent; -type MSOutboundPayload = MSVideoSendPayload | MSAudioSendPayload; -type RTCIceGatherCandidate = RTCIceCandidate | RTCIceCandidateComplete; -type RTCTransport = RTCDtlsTransport | RTCSrtpSdesTransport; -type payloadtype = number; -type ScrollBehavior = "auto" | "instant" | "smooth"; -type ScrollLogicalPosition = "start" | "center" | "end" | "nearest"; -type IDBValidKey = number | string | Date | IDBArrayKey; -type BufferSource = ArrayBuffer | ArrayBufferView; -type MouseWheelEvent = WheelEvent; +interface Symbol { + readonly [Symbol.toStringTag]: "Symbol"; +} + +interface Array { + /** + * Returns an object whose properties have the value 'true' + * when they will be absent when used in a 'with' statement. + */ + [Symbol.unscopables](): { + copyWithin: boolean; + entries: boolean; + fill: boolean; + find: boolean; + findIndex: boolean; + keys: boolean; + values: boolean; + }; +} + +interface Date { + /** + * Converts a Date object to a string. + */ + [Symbol.toPrimitive](hint: "default"): string; + /** + * Converts a Date object to a string. + */ + [Symbol.toPrimitive](hint: "string"): string; + /** + * Converts a Date object to a number. + */ + [Symbol.toPrimitive](hint: "number"): number; + /** + * Converts a Date object to a string or number. + * + * @param hint The strings "number", "string", or "default" to specify what primitive to return. + * + * @throws {TypeError} If 'hint' was given something other than "number", "string", or "default". + * @returns A number if 'hint' was "number", a string if 'hint' was "string" or "default". + */ + [Symbol.toPrimitive](hint: string): string | number; +} + +interface Map { + readonly [Symbol.toStringTag]: "Map"; +} + +interface WeakMap{ + readonly [Symbol.toStringTag]: "WeakMap"; +} + +interface Set { + readonly [Symbol.toStringTag]: "Set"; +} + +interface WeakSet { + readonly [Symbol.toStringTag]: "WeakSet"; +} + +interface JSON { + readonly [Symbol.toStringTag]: "JSON"; +} + +interface Function { + /** + * Determines whether the given value inherits from this function if this function was used + * as a constructor function. + * + * A constructor function can control which objects are recognized as its instances by + * 'instanceof' by overriding this method. + */ + [Symbol.hasInstance](value: any): boolean; +} + +interface GeneratorFunction { + readonly [Symbol.toStringTag]: "GeneratorFunction"; +} + +interface Math { + readonly [Symbol.toStringTag]: "Math"; +} + +interface Promise { + readonly [Symbol.toStringTag]: "Promise"; +} + +interface PromiseConstructor { + readonly [Symbol.species]: Function; +} + +interface RegExp { + /** + * Matches a string with this regular expression, and returns an array containing the results of + * that search. + * @param string A string to search within. + */ + [Symbol.match](string: string): RegExpMatchArray | null; + + /** + * Replaces text in a string, using this regular expression. + * @param string A String object or string literal whose contents matching against + * this regular expression will be replaced + * @param replaceValue A String object or string literal containing the text to replace for every + * successful match of this regular expression. + */ + [Symbol.replace](string: string, replaceValue: string): string; + + /** + * Replaces text in a string, using this regular expression. + * @param string A String object or string literal whose contents matching against + * this regular expression will be replaced + * @param replacer A function that returns the replacement text. + */ + [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; + + /** + * Finds the position beginning first substring match in a regular expression search + * using this regular expression. + * + * @param string The string to search within. + */ + [Symbol.search](string: string): number; + + /** + * Returns an array of substrings that were delimited by strings in the original input that + * match against this regular expression. + * + * If the regular expression contains capturing parentheses, then each time this + * regular expression matches, the results (including any undefined results) of the + * capturing parentheses are spliced. + * + * @param string string value to split + * @param limit if not undefined, the output array is truncated so that it contains no more + * than 'limit' elements. + */ + [Symbol.split](string: string, limit?: number): string[]; +} + +interface RegExpConstructor { + [Symbol.species](): RegExpConstructor; +} + +interface String { + /** + * Matches a string an object that supports being matched against, and returns an array containing the results of that search. + * @param matcher An object that supports being matched against. + */ + match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null; + + /** + * Replaces text in a string, using an object that supports replacement within a string. + * @param searchValue A object can search for and replace matches within a string. + * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. + */ + replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string; + + /** + * Replaces text in a string, using an object that supports replacement within a string. + * @param searchValue A object can search for and replace matches within a string. + * @param replacer A function that returns the replacement text. + */ + replace(searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string; + + /** + * Finds the first substring match in a regular expression search. + * @param searcher An object which supports searching within a string. + */ + search(searcher: { [Symbol.search](string: string): number; }): number; + + /** + * Split a string into substrings using the specified separator and return them as an array. + * @param splitter An object that can split a string. + * @param limit A value used to limit the number of elements returned in the array. + */ + split(splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number): string[]; +} + +/** + * Represents a raw buffer of binary data, which is used to store data for the + * different typed arrays. ArrayBuffers cannot be read from or written to directly, + * but can be passed to a typed array or DataView Object to interpret the raw + * buffer as needed. + */ +interface ArrayBuffer { + readonly [Symbol.toStringTag]: "ArrayBuffer"; +} + +interface DataView { + readonly [Symbol.toStringTag]: "DataView"; +} + +/** + * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Int8Array { + readonly [Symbol.toStringTag]: "Int8Array"; +} + +/** + * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8Array { + readonly [Symbol.toStringTag]: "UInt8Array"; +} + +/** + * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. + * If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8ClampedArray { + readonly [Symbol.toStringTag]: "Uint8ClampedArray"; +} + +/** + * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int16Array { + readonly [Symbol.toStringTag]: "Int16Array"; +} + +/** + * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint16Array { + readonly [Symbol.toStringTag]: "Uint16Array"; +} + +/** + * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int32Array { + readonly [Symbol.toStringTag]: "Int32Array"; +} + +/** + * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint32Array { + readonly [Symbol.toStringTag]: "Uint32Array"; +} + +/** + * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number + * of bytes could not be allocated an exception is raised. + */ +interface Float32Array { + readonly [Symbol.toStringTag]: "Float32Array"; +} + +/** + * A typed array of 64-bit float values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Float64Array { + readonly [Symbol.toStringTag]: "Float64Array"; +} + + + +///////////////////////////// +/// IE DOM APIs +///////////////////////////// + +interface Account { + rpDisplayName?: string; + displayName?: string; + id?: string; + name?: string; + imageURL?: string; +} + +interface Algorithm { + name: string; +} + +interface AnimationEventInit extends EventInit { + animationName?: string; + elapsedTime?: number; +} + +interface AssertionOptions { + timeoutSeconds?: number; + rpId?: USVString; + allowList?: ScopedCredentialDescriptor[]; + extensions?: WebAuthnExtensions; +} + +interface CacheQueryOptions { + ignoreSearch?: boolean; + ignoreMethod?: boolean; + ignoreVary?: boolean; + cacheName?: string; +} + +interface ClientData { + challenge?: string; + origin?: string; + rpId?: string; + hashAlg?: string | Algorithm; + tokenBinding?: string; + extensions?: WebAuthnExtensions; +} + +interface CloseEventInit extends EventInit { + wasClean?: boolean; + code?: number; + reason?: string; +} + +interface CompositionEventInit extends UIEventInit { + data?: string; +} + +interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation { + arrayOfDomainStrings?: string[]; +} + +interface ConstrainBooleanParameters { + exact?: boolean; + ideal?: boolean; +} + +interface ConstrainDOMStringParameters { + exact?: string | string[]; + ideal?: string | string[]; +} + +interface ConstrainDoubleRange extends DoubleRange { + exact?: number; + ideal?: number; +} + +interface ConstrainLongRange extends LongRange { + exact?: number; + ideal?: number; +} + +interface ConstrainVideoFacingModeParameters { + exact?: VideoFacingModeEnum | VideoFacingModeEnum[]; + ideal?: VideoFacingModeEnum | VideoFacingModeEnum[]; +} + +interface CustomEventInit extends EventInit { + detail?: any; +} + +interface DOMRectInit { + x?: any; + y?: any; + width?: any; + height?: any; +} + +interface DeviceAccelerationDict { + x?: number; + y?: number; + z?: number; +} + +interface DeviceLightEventInit extends EventInit { + value?: number; +} + +interface DeviceMotionEventInit extends EventInit { + acceleration?: DeviceAccelerationDict; + accelerationIncludingGravity?: DeviceAccelerationDict; + rotationRate?: DeviceRotationRateDict; + interval?: number; +} + +interface DeviceOrientationEventInit extends EventInit { + alpha?: number; + beta?: number; + gamma?: number; + absolute?: boolean; +} + +interface DeviceRotationRateDict { + alpha?: number; + beta?: number; + gamma?: number; +} + +interface DoubleRange { + max?: number; + min?: number; +} + +interface ErrorEventInit extends EventInit { + message?: string; + filename?: string; + lineno?: number; + colno?: number; + error?: any; +} + +interface EventInit { + scoped?: boolean; + bubbles?: boolean; + cancelable?: boolean; +} + +interface EventModifierInit extends UIEventInit { + ctrlKey?: boolean; + shiftKey?: boolean; + altKey?: boolean; + metaKey?: boolean; + modifierAltGraph?: boolean; + modifierCapsLock?: boolean; + modifierFn?: boolean; + modifierFnLock?: boolean; + modifierHyper?: boolean; + modifierNumLock?: boolean; + modifierOS?: boolean; + modifierScrollLock?: boolean; + modifierSuper?: boolean; + modifierSymbol?: boolean; + modifierSymbolLock?: boolean; +} + +interface ExceptionInformation { + domain?: string; +} + +interface FocusEventInit extends UIEventInit { + relatedTarget?: EventTarget; +} + +interface FocusNavigationEventInit extends EventInit { + navigationReason?: string; + originLeft?: number; + originTop?: number; + originWidth?: number; + originHeight?: number; +} + +interface FocusNavigationOrigin { + originLeft?: number; + originTop?: number; + originWidth?: number; + originHeight?: number; +} + +interface GamepadEventInit extends EventInit { + gamepad?: Gamepad; +} + +interface GetNotificationOptions { + tag?: string; +} + +interface HashChangeEventInit extends EventInit { + newURL?: string; + oldURL?: string; +} + +interface IDBIndexParameters { + multiEntry?: boolean; + unique?: boolean; +} + +interface IDBObjectStoreParameters { + autoIncrement?: boolean; + keyPath?: IDBKeyPath; +} + +interface IntersectionObserverEntryInit { + time?: number; + rootBounds?: DOMRectInit; + boundingClientRect?: DOMRectInit; + intersectionRect?: DOMRectInit; + target?: Element; +} + +interface IntersectionObserverInit { + root?: Element; + rootMargin?: string; + threshold?: number | number[]; +} + +interface KeyAlgorithm { + name?: string; +} + +interface KeyboardEventInit extends EventModifierInit { + code?: string; + key?: string; + location?: number; + repeat?: boolean; +} + +interface LongRange { + max?: number; + min?: number; +} + +interface MSAccountInfo { + rpDisplayName?: string; + userDisplayName?: string; + accountName?: string; + userId?: string; + accountImageUri?: string; +} + +interface MSAudioLocalClientEvent extends MSLocalClientEventBase { + networkSendQualityEventRatio?: number; + networkDelayEventRatio?: number; + cpuInsufficientEventRatio?: number; + deviceHalfDuplexAECEventRatio?: number; + deviceRenderNotFunctioningEventRatio?: number; + deviceCaptureNotFunctioningEventRatio?: number; + deviceGlitchesEventRatio?: number; + deviceLowSNREventRatio?: number; + deviceLowSpeechLevelEventRatio?: number; + deviceClippingEventRatio?: number; + deviceEchoEventRatio?: number; + deviceNearEndToEchoRatioEventRatio?: number; + deviceRenderZeroVolumeEventRatio?: number; + deviceRenderMuteEventRatio?: number; + deviceMultipleEndpointsEventCount?: number; + deviceHowlingEventCount?: number; +} + +interface MSAudioRecvPayload extends MSPayloadBase { + samplingRate?: number; + signal?: MSAudioRecvSignal; + packetReorderRatio?: number; + packetReorderDepthAvg?: number; + packetReorderDepthMax?: number; + burstLossLength1?: number; + burstLossLength2?: number; + burstLossLength3?: number; + burstLossLength4?: number; + burstLossLength5?: number; + burstLossLength6?: number; + burstLossLength7?: number; + burstLossLength8OrHigher?: number; + fecRecvDistance1?: number; + fecRecvDistance2?: number; + fecRecvDistance3?: number; + ratioConcealedSamplesAvg?: number; + ratioStretchedSamplesAvg?: number; + ratioCompressedSamplesAvg?: number; +} + +interface MSAudioRecvSignal { + initialSignalLevelRMS?: number; + recvSignalLevelCh1?: number; + recvNoiseLevelCh1?: number; + renderSignalLevel?: number; + renderNoiseLevel?: number; + renderLoopbackSignalLevel?: number; +} + +interface MSAudioSendPayload extends MSPayloadBase { + samplingRate?: number; + signal?: MSAudioSendSignal; + audioFECUsed?: boolean; + sendMutePercent?: number; +} + +interface MSAudioSendSignal { + noiseLevel?: number; + sendSignalLevelCh1?: number; + sendNoiseLevelCh1?: number; +} + +interface MSConnectivity { + iceType?: MSIceType; + iceWarningFlags?: MSIceWarningFlags; + relayAddress?: MSRelayAddress; +} + +interface MSCredentialFilter { + accept?: MSCredentialSpec[]; +} + +interface MSCredentialParameters { + type?: MSCredentialType; +} + +interface MSCredentialSpec { + type?: MSCredentialType; + id?: string; +} + +interface MSDelay { + roundTrip?: number; + roundTripMax?: number; +} + +interface MSDescription extends RTCStats { + connectivity?: MSConnectivity; + transport?: RTCIceProtocol; + networkconnectivity?: MSNetworkConnectivityInfo; + localAddr?: MSIPAddressInfo; + remoteAddr?: MSIPAddressInfo; + deviceDevName?: string; + reflexiveLocalIPAddr?: MSIPAddressInfo; +} + +interface MSFIDOCredentialParameters extends MSCredentialParameters { + algorithm?: string | Algorithm; + authenticators?: AAGUID[]; +} + +interface MSIPAddressInfo { + ipAddr?: string; + port?: number; + manufacturerMacAddrMask?: string; +} + +interface MSIceWarningFlags { + turnTcpTimedOut?: boolean; + turnUdpAllocateFailed?: boolean; + turnUdpSendFailed?: boolean; + turnTcpAllocateFailed?: boolean; + turnTcpSendFailed?: boolean; + udpLocalConnectivityFailed?: boolean; + udpNatConnectivityFailed?: boolean; + udpRelayConnectivityFailed?: boolean; + tcpNatConnectivityFailed?: boolean; + tcpRelayConnectivityFailed?: boolean; + connCheckMessageIntegrityFailed?: boolean; + allocationMessageIntegrityFailed?: boolean; + connCheckOtherError?: boolean; + turnAuthUnknownUsernameError?: boolean; + noRelayServersConfigured?: boolean; + multipleRelayServersAttempted?: boolean; + portRangeExhausted?: boolean; + alternateServerReceived?: boolean; + pseudoTLSFailure?: boolean; + turnTurnTcpConnectivityFailed?: boolean; + useCandidateChecksFailed?: boolean; + fipsAllocationFailure?: boolean; +} + +interface MSJitter { + interArrival?: number; + interArrivalMax?: number; + interArrivalSD?: number; +} + +interface MSLocalClientEventBase extends RTCStats { + networkReceiveQualityEventRatio?: number; + networkBandwidthLowEventRatio?: number; +} + +interface MSNetwork extends RTCStats { + jitter?: MSJitter; + delay?: MSDelay; + packetLoss?: MSPacketLoss; + utilization?: MSUtilization; +} + +interface MSNetworkConnectivityInfo { + vpn?: boolean; + linkspeed?: number; + networkConnectionDetails?: string; +} + +interface MSNetworkInterfaceType { + interfaceTypeEthernet?: boolean; + interfaceTypeWireless?: boolean; + interfaceTypePPP?: boolean; + interfaceTypeTunnel?: boolean; + interfaceTypeWWAN?: boolean; +} + +interface MSOutboundNetwork extends MSNetwork { + appliedBandwidthLimit?: number; +} + +interface MSPacketLoss { + lossRate?: number; + lossRateMax?: number; +} + +interface MSPayloadBase extends RTCStats { + payloadDescription?: string; +} + +interface MSPortRange { + min?: number; + max?: number; +} + +interface MSRelayAddress { + relayAddress?: string; + port?: number; +} + +interface MSSignatureParameters { + userPrompt?: string; +} + +interface MSTransportDiagnosticsStats extends RTCStats { + baseAddress?: string; + localAddress?: string; + localSite?: string; + networkName?: string; + remoteAddress?: string; + remoteSite?: string; + localMR?: string; + remoteMR?: string; + iceWarningFlags?: MSIceWarningFlags; + portRangeMin?: number; + portRangeMax?: number; + localMRTCPPort?: number; + remoteMRTCPPort?: number; + stunVer?: number; + numConsentReqSent?: number; + numConsentReqReceived?: number; + numConsentRespSent?: number; + numConsentRespReceived?: number; + interfaces?: MSNetworkInterfaceType; + baseInterface?: MSNetworkInterfaceType; + protocol?: RTCIceProtocol; + localInterface?: MSNetworkInterfaceType; + localAddrType?: MSIceAddrType; + remoteAddrType?: MSIceAddrType; + iceRole?: RTCIceRole; + rtpRtcpMux?: boolean; + allocationTimeInMs?: number; + msRtcEngineVersion?: string; +} + +interface MSUtilization { + packets?: number; + bandwidthEstimation?: number; + bandwidthEstimationMin?: number; + bandwidthEstimationMax?: number; + bandwidthEstimationStdDev?: number; + bandwidthEstimationAvg?: number; +} + +interface MSVideoPayload extends MSPayloadBase { + resolution?: string; + videoBitRateAvg?: number; + videoBitRateMax?: number; + videoFrameRateAvg?: number; + videoPacketLossRate?: number; + durationSeconds?: number; +} + +interface MSVideoRecvPayload extends MSVideoPayload { + videoFrameLossRate?: number; + recvCodecType?: string; + recvResolutionWidth?: number; + recvResolutionHeight?: number; + videoResolutions?: MSVideoResolutionDistribution; + recvFrameRateAverage?: number; + recvBitRateMaximum?: number; + recvBitRateAverage?: number; + recvVideoStreamsMax?: number; + recvVideoStreamsMin?: number; + recvVideoStreamsMode?: number; + videoPostFECPLR?: number; + lowBitRateCallPercent?: number; + lowFrameRateCallPercent?: number; + reorderBufferTotalPackets?: number; + recvReorderBufferReorderedPackets?: number; + recvReorderBufferPacketsDroppedDueToBufferExhaustion?: number; + recvReorderBufferMaxSuccessfullyOrderedExtent?: number; + recvReorderBufferMaxSuccessfullyOrderedLateTime?: number; + recvReorderBufferPacketsDroppedDueToTimeout?: number; + recvFpsHarmonicAverage?: number; + recvNumResSwitches?: number; +} + +interface MSVideoResolutionDistribution { + cifQuality?: number; + vgaQuality?: number; + h720Quality?: number; + h1080Quality?: number; + h1440Quality?: number; + h2160Quality?: number; +} + +interface MSVideoSendPayload extends MSVideoPayload { + sendFrameRateAverage?: number; + sendBitRateMaximum?: number; + sendBitRateAverage?: number; + sendVideoStreamsMax?: number; + sendResolutionWidth?: number; + sendResolutionHeight?: number; +} + +interface MediaEncryptedEventInit extends EventInit { + initDataType?: string; + initData?: ArrayBuffer; +} + +interface MediaKeyMessageEventInit extends EventInit { + messageType?: MediaKeyMessageType; + message?: ArrayBuffer; +} + +interface MediaKeySystemConfiguration { + initDataTypes?: string[]; + audioCapabilities?: MediaKeySystemMediaCapability[]; + videoCapabilities?: MediaKeySystemMediaCapability[]; + distinctiveIdentifier?: MediaKeysRequirement; + persistentState?: MediaKeysRequirement; +} + +interface MediaKeySystemMediaCapability { + contentType?: string; + robustness?: string; +} + +interface MediaStreamConstraints { + video?: boolean | MediaTrackConstraints; + audio?: boolean | MediaTrackConstraints; +} + +interface MediaStreamErrorEventInit extends EventInit { + error?: MediaStreamError; +} + +interface MediaStreamEventInit extends EventInit { + stream?: MediaStream; +} + +interface MediaStreamTrackEventInit extends EventInit { + track?: MediaStreamTrack; +} + +interface MediaTrackCapabilities { + width?: number | LongRange; + height?: number | LongRange; + aspectRatio?: number | DoubleRange; + frameRate?: number | DoubleRange; + facingMode?: string; + volume?: number | DoubleRange; + sampleRate?: number | LongRange; + sampleSize?: number | LongRange; + echoCancellation?: boolean[]; + deviceId?: string; + groupId?: string; +} + +interface MediaTrackConstraintSet { + width?: number | ConstrainLongRange; + height?: number | ConstrainLongRange; + aspectRatio?: number | ConstrainDoubleRange; + frameRate?: number | ConstrainDoubleRange; + facingMode?: string | string[] | ConstrainDOMStringParameters; + volume?: number | ConstrainDoubleRange; + sampleRate?: number | ConstrainLongRange; + sampleSize?: number | ConstrainLongRange; + echoCancelation?: boolean | ConstrainBooleanParameters; + deviceId?: string | string[] | ConstrainDOMStringParameters; + groupId?: string | string[] | ConstrainDOMStringParameters; +} + +interface MediaTrackConstraints extends MediaTrackConstraintSet { + advanced?: MediaTrackConstraintSet[]; +} + +interface MediaTrackSettings { + width?: number; + height?: number; + aspectRatio?: number; + frameRate?: number; + facingMode?: string; + volume?: number; + sampleRate?: number; + sampleSize?: number; + echoCancellation?: boolean; + deviceId?: string; + groupId?: string; +} + +interface MediaTrackSupportedConstraints { + width?: boolean; + height?: boolean; + aspectRatio?: boolean; + frameRate?: boolean; + facingMode?: boolean; + volume?: boolean; + sampleRate?: boolean; + sampleSize?: boolean; + echoCancellation?: boolean; + deviceId?: boolean; + groupId?: boolean; +} + +interface MessageEventInit extends EventInit { + lastEventId?: string; + channel?: string; + data?: any; + origin?: string; + source?: Window; + ports?: MessagePort[]; +} + +interface MouseEventInit extends EventModifierInit { + screenX?: number; + screenY?: number; + clientX?: number; + clientY?: number; + button?: number; + buttons?: number; + relatedTarget?: EventTarget; +} + +interface MsZoomToOptions { + contentX?: number; + contentY?: number; + viewportX?: string; + viewportY?: string; + scaleFactor?: number; + animate?: string; +} + +interface MutationObserverInit { + childList?: boolean; + attributes?: boolean; + characterData?: boolean; + subtree?: boolean; + attributeOldValue?: boolean; + characterDataOldValue?: boolean; + attributeFilter?: string[]; +} + +interface NotificationOptions { + dir?: NotificationDirection; + lang?: string; + body?: string; + tag?: string; + icon?: string; +} + +interface ObjectURLOptions { + oneTimeOnly?: boolean; +} + +interface PaymentCurrencyAmount { + currency?: string; + value?: string; + currencySystem?: string; +} + +interface PaymentDetails { + total?: PaymentItem; + displayItems?: PaymentItem[]; + shippingOptions?: PaymentShippingOption[]; + modifiers?: PaymentDetailsModifier[]; + error?: string; +} + +interface PaymentDetailsModifier { + supportedMethods?: string[]; + total?: PaymentItem; + additionalDisplayItems?: PaymentItem[]; + data?: any; +} + +interface PaymentItem { + label?: string; + amount?: PaymentCurrencyAmount; + pending?: boolean; +} + +interface PaymentMethodData { + supportedMethods?: string[]; + data?: any; +} + +interface PaymentOptions { + requestPayerName?: boolean; + requestPayerEmail?: boolean; + requestPayerPhone?: boolean; + requestShipping?: boolean; + shippingType?: string; +} + +interface PaymentRequestUpdateEventInit extends EventInit { +} + +interface PaymentShippingOption { + id?: string; + label?: string; + amount?: PaymentCurrencyAmount; + selected?: boolean; +} + +interface PeriodicWaveConstraints { + disableNormalization?: boolean; +} + +interface PointerEventInit extends MouseEventInit { + pointerId?: number; + width?: number; + height?: number; + pressure?: number; + tiltX?: number; + tiltY?: number; + pointerType?: string; + isPrimary?: boolean; +} + +interface PopStateEventInit extends EventInit { + state?: any; +} + +interface PositionOptions { + enableHighAccuracy?: boolean; + timeout?: number; + maximumAge?: number; +} + +interface ProgressEventInit extends EventInit { + lengthComputable?: boolean; + loaded?: number; + total?: number; +} + +interface PushSubscriptionOptionsInit { + userVisibleOnly?: boolean; + applicationServerKey?: any; +} + +interface RTCConfiguration { + iceServers?: RTCIceServer[]; + iceTransportPolicy?: RTCIceTransportPolicy; + bundlePolicy?: RTCBundlePolicy; + peerIdentity?: string; +} + +interface RTCDTMFToneChangeEventInit extends EventInit { + tone?: string; +} + +interface RTCDtlsFingerprint { + algorithm?: string; + value?: string; +} + +interface RTCDtlsParameters { + role?: RTCDtlsRole; + fingerprints?: RTCDtlsFingerprint[]; +} + +interface RTCIceCandidateAttributes extends RTCStats { + ipAddress?: string; + portNumber?: number; + transport?: string; + candidateType?: RTCStatsIceCandidateType; + priority?: number; + addressSourceUrl?: string; +} + +interface RTCIceCandidateComplete { +} + +interface RTCIceCandidateDictionary { + foundation?: string; + priority?: number; + ip?: string; + protocol?: RTCIceProtocol; + port?: number; + type?: RTCIceCandidateType; + tcpType?: RTCIceTcpCandidateType; + relatedAddress?: string; + relatedPort?: number; + msMTurnSessionId?: string; +} + +interface RTCIceCandidateInit { + candidate?: string; + sdpMid?: string; + sdpMLineIndex?: number; +} + +interface RTCIceCandidatePair { + local?: RTCIceCandidateDictionary; + remote?: RTCIceCandidateDictionary; +} + +interface RTCIceCandidatePairStats extends RTCStats { + transportId?: string; + localCandidateId?: string; + remoteCandidateId?: string; + state?: RTCStatsIceCandidatePairState; + priority?: number; + nominated?: boolean; + writable?: boolean; + readable?: boolean; + bytesSent?: number; + bytesReceived?: number; + roundTripTime?: number; + availableOutgoingBitrate?: number; + availableIncomingBitrate?: number; +} + +interface RTCIceGatherOptions { + gatherPolicy?: RTCIceGatherPolicy; + iceservers?: RTCIceServer[]; + portRange?: MSPortRange; +} + +interface RTCIceParameters { + usernameFragment?: string; + password?: string; + iceLite?: boolean; +} + +interface RTCIceServer { + urls?: any; + username?: string; + credential?: string; +} + +interface RTCInboundRTPStreamStats extends RTCRTPStreamStats { + packetsReceived?: number; + bytesReceived?: number; + packetsLost?: number; + jitter?: number; + fractionLost?: number; +} + +interface RTCMediaStreamTrackStats extends RTCStats { + trackIdentifier?: string; + remoteSource?: boolean; + ssrcIds?: string[]; + frameWidth?: number; + frameHeight?: number; + framesPerSecond?: number; + framesSent?: number; + framesReceived?: number; + framesDecoded?: number; + framesDropped?: number; + framesCorrupted?: number; + audioLevel?: number; + echoReturnLoss?: number; + echoReturnLossEnhancement?: number; +} + +interface RTCOfferOptions { + offerToReceiveVideo?: number; + offerToReceiveAudio?: number; + voiceActivityDetection?: boolean; + iceRestart?: boolean; +} + +interface RTCOutboundRTPStreamStats extends RTCRTPStreamStats { + packetsSent?: number; + bytesSent?: number; + targetBitrate?: number; + roundTripTime?: number; +} + +interface RTCPeerConnectionIceEventInit extends EventInit { + candidate?: RTCIceCandidate; +} + +interface RTCRTPStreamStats extends RTCStats { + ssrc?: string; + associateStatsId?: string; + isRemote?: boolean; + mediaTrackId?: string; + transportId?: string; + codecId?: string; + firCount?: number; + pliCount?: number; + nackCount?: number; + sliCount?: number; +} + +interface RTCRtcpFeedback { + type?: string; + parameter?: string; +} + +interface RTCRtcpParameters { + ssrc?: number; + cname?: string; + reducedSize?: boolean; + mux?: boolean; +} + +interface RTCRtpCapabilities { + codecs?: RTCRtpCodecCapability[]; + headerExtensions?: RTCRtpHeaderExtension[]; + fecMechanisms?: string[]; +} + +interface RTCRtpCodecCapability { + name?: string; + kind?: string; + clockRate?: number; + preferredPayloadType?: number; + maxptime?: number; + ptime?: number; + numChannels?: number; + rtcpFeedback?: RTCRtcpFeedback[]; + parameters?: any; + options?: any; + maxTemporalLayers?: number; + maxSpatialLayers?: number; + svcMultiStreamSupport?: boolean; +} + +interface RTCRtpCodecParameters { + name?: string; + payloadType?: any; + clockRate?: number; + maxptime?: number; + ptime?: number; + numChannels?: number; + rtcpFeedback?: RTCRtcpFeedback[]; + parameters?: any; +} + +interface RTCRtpContributingSource { + timestamp?: number; + csrc?: number; + audioLevel?: number; +} + +interface RTCRtpEncodingParameters { + ssrc?: number; + codecPayloadType?: number; + fec?: RTCRtpFecParameters; + rtx?: RTCRtpRtxParameters; + priority?: number; + maxBitrate?: number; + minQuality?: number; + resolutionScale?: number; + framerateScale?: number; + maxFramerate?: number; + active?: boolean; + encodingId?: string; + dependencyEncodingIds?: string[]; + ssrcRange?: RTCSsrcRange; +} + +interface RTCRtpFecParameters { + ssrc?: number; + mechanism?: string; +} + +interface RTCRtpHeaderExtension { + kind?: string; + uri?: string; + preferredId?: number; + preferredEncrypt?: boolean; +} + +interface RTCRtpHeaderExtensionParameters { + uri?: string; + id?: number; + encrypt?: boolean; +} + +interface RTCRtpParameters { + muxId?: string; + codecs?: RTCRtpCodecParameters[]; + headerExtensions?: RTCRtpHeaderExtensionParameters[]; + encodings?: RTCRtpEncodingParameters[]; + rtcp?: RTCRtcpParameters; + degradationPreference?: RTCDegradationPreference; +} + +interface RTCRtpRtxParameters { + ssrc?: number; +} + +interface RTCRtpUnhandled { + ssrc?: number; + payloadType?: number; + muxId?: string; +} + +interface RTCSessionDescriptionInit { + type?: RTCSdpType; + sdp?: string; +} + +interface RTCSrtpKeyParam { + keyMethod?: string; + keySalt?: string; + lifetime?: string; + mkiValue?: number; + mkiLength?: number; +} + +interface RTCSrtpSdesParameters { + tag?: number; + cryptoSuite?: string; + keyParams?: RTCSrtpKeyParam[]; + sessionParams?: string[]; +} + +interface RTCSsrcRange { + min?: number; + max?: number; +} + +interface RTCStats { + timestamp?: number; + type?: RTCStatsType; + id?: string; + msType?: MSStatsType; +} + +interface RTCStatsReport { +} + +interface RTCTransportStats extends RTCStats { + bytesSent?: number; + bytesReceived?: number; + rtcpTransportStatsId?: string; + activeConnection?: boolean; + selectedCandidatePairId?: string; + localCertificateId?: string; + remoteCertificateId?: string; +} + +interface RegistrationOptions { + scope?: string; +} + +interface RequestInit { + method?: string; + headers?: any; + body?: any; + referrer?: string; + referrerPolicy?: ReferrerPolicy; + mode?: RequestMode; + credentials?: RequestCredentials; + cache?: RequestCache; + redirect?: RequestRedirect; + integrity?: string; + keepalive?: boolean; + window?: any; +} + +interface ResponseInit { + status?: number; + statusText?: string; + headers?: any; +} + +interface ScopedCredentialDescriptor { + type?: ScopedCredentialType; + id?: any; + transports?: Transport[]; +} + +interface ScopedCredentialOptions { + timeoutSeconds?: number; + rpId?: USVString; + excludeList?: ScopedCredentialDescriptor[]; + extensions?: WebAuthnExtensions; +} + +interface ScopedCredentialParameters { + type?: ScopedCredentialType; + algorithm?: string | Algorithm; +} + +interface ServiceWorkerMessageEventInit extends EventInit { + data?: any; + origin?: string; + lastEventId?: string; + source?: ServiceWorker | MessagePort; + ports?: MessagePort[]; +} + +interface SpeechSynthesisEventInit extends EventInit { + utterance?: SpeechSynthesisUtterance; + charIndex?: number; + elapsedTime?: number; + name?: string; +} + +interface StoreExceptionsInformation extends ExceptionInformation { + siteName?: string; + explanationString?: string; + detailURI?: string; +} + +interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { + arrayOfDomainStrings?: string[]; +} + +interface TrackEventInit extends EventInit { + track?: VideoTrack | AudioTrack | TextTrack; +} + +interface TransitionEventInit extends EventInit { + propertyName?: string; + elapsedTime?: number; +} + +interface UIEventInit extends EventInit { + view?: Window; + detail?: number; +} + +interface WebAuthnExtensions { +} + +interface WebGLContextAttributes { + failIfMajorPerformanceCaveat?: boolean; + alpha?: boolean; + depth?: boolean; + stencil?: boolean; + antialias?: boolean; + premultipliedAlpha?: boolean; + preserveDrawingBuffer?: boolean; +} + +interface WebGLContextEventInit extends EventInit { + statusMessage?: string; +} + +interface WheelEventInit extends MouseEventInit { + deltaX?: number; + deltaY?: number; + deltaZ?: number; + deltaMode?: number; +} + +interface EventListener { + (evt: Event): void; +} + +interface WebKitEntriesCallback { + (evt: Event): void; +} + +interface WebKitErrorCallback { + (evt: Event): void; +} + +interface WebKitFileCallback { + (evt: Event): void; +} + +interface ANGLE_instanced_arrays { + drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void; + drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void; + vertexAttribDivisorANGLE(index: number, divisor: number): void; + readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; +} + +declare var ANGLE_instanced_arrays: { + prototype: ANGLE_instanced_arrays; + new(): ANGLE_instanced_arrays; + readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; +} + +interface AnalyserNode extends AudioNode { + fftSize: number; + readonly frequencyBinCount: number; + maxDecibels: number; + minDecibels: number; + smoothingTimeConstant: number; + getByteFrequencyData(array: Uint8Array): void; + getByteTimeDomainData(array: Uint8Array): void; + getFloatFrequencyData(array: Float32Array): void; + getFloatTimeDomainData(array: Float32Array): void; +} + +declare var AnalyserNode: { + prototype: AnalyserNode; + new(): AnalyserNode; +} + +interface AnimationEvent extends Event { + readonly animationName: string; + readonly elapsedTime: number; + initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; +} + +declare var AnimationEvent: { + prototype: AnimationEvent; + new(typeArg: string, eventInitDict?: AnimationEventInit): AnimationEvent; +} + +interface ApplicationCacheEventMap { + "cached": Event; + "checking": Event; + "downloading": Event; + "error": Event; + "noupdate": Event; + "obsolete": Event; + "progress": ProgressEvent; + "updateready": Event; +} + +interface ApplicationCache extends EventTarget { + oncached: (this: ApplicationCache, ev: Event) => any; + onchecking: (this: ApplicationCache, ev: Event) => any; + ondownloading: (this: ApplicationCache, ev: Event) => any; + onerror: (this: ApplicationCache, ev: Event) => any; + onnoupdate: (this: ApplicationCache, ev: Event) => any; + onobsolete: (this: ApplicationCache, ev: Event) => any; + onprogress: (this: ApplicationCache, ev: ProgressEvent) => any; + onupdateready: (this: ApplicationCache, ev: Event) => any; + readonly status: number; + abort(): void; + swapCache(): void; + update(): void; + readonly CHECKING: number; + readonly DOWNLOADING: number; + readonly IDLE: number; + readonly OBSOLETE: number; + readonly UNCACHED: number; + readonly UPDATEREADY: number; + addEventListener(type: K, listener: (this: ApplicationCache, ev: ApplicationCacheEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ApplicationCache: { + prototype: ApplicationCache; + new(): ApplicationCache; + readonly CHECKING: number; + readonly DOWNLOADING: number; + readonly IDLE: number; + readonly OBSOLETE: number; + readonly UNCACHED: number; + readonly UPDATEREADY: number; +} + +interface Attr extends Node { + readonly name: string; + readonly ownerElement: Element; + readonly prefix: string | null; + readonly specified: boolean; + value: string; +} + +declare var Attr: { + prototype: Attr; + new(): Attr; +} + +interface AudioBuffer { + readonly duration: number; + readonly length: number; + readonly numberOfChannels: number; + readonly sampleRate: number; + copyFromChannel(destination: Float32Array, channelNumber: number, startInChannel?: number): void; + copyToChannel(source: Float32Array, channelNumber: number, startInChannel?: number): void; + getChannelData(channel: number): Float32Array; +} + +declare var AudioBuffer: { + prototype: AudioBuffer; + new(): AudioBuffer; +} + +interface AudioBufferSourceNodeEventMap { + "ended": MediaStreamErrorEvent; +} + +interface AudioBufferSourceNode extends AudioNode { + buffer: AudioBuffer | null; + readonly detune: AudioParam; + loop: boolean; + loopEnd: number; + loopStart: number; + onended: (this: AudioBufferSourceNode, ev: MediaStreamErrorEvent) => any; + readonly playbackRate: AudioParam; + start(when?: number, offset?: number, duration?: number): void; + stop(when?: number): void; + addEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioBufferSourceNodeEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var AudioBufferSourceNode: { + prototype: AudioBufferSourceNode; + new(): AudioBufferSourceNode; +} + +interface AudioContextEventMap { + "statechange": Event; +} + +interface AudioContextBase extends EventTarget { + readonly currentTime: number; + readonly destination: AudioDestinationNode; + readonly listener: AudioListener; + onstatechange: (this: AudioContext, ev: Event) => any; + readonly sampleRate: number; + readonly state: AudioContextState; + close(): Promise; + createAnalyser(): AnalyserNode; + createBiquadFilter(): BiquadFilterNode; + createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; + createBufferSource(): AudioBufferSourceNode; + createChannelMerger(numberOfInputs?: number): ChannelMergerNode; + createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode; + createConvolver(): ConvolverNode; + createDelay(maxDelayTime?: number): DelayNode; + createDynamicsCompressor(): DynamicsCompressorNode; + createGain(): GainNode; + createIIRFilter(feedforward: number[], feedback: number[]): IIRFilterNode; + createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode; + createMediaStreamSource(mediaStream: MediaStream): MediaStreamAudioSourceNode; + createOscillator(): OscillatorNode; + createPanner(): PannerNode; + createPeriodicWave(real: Float32Array, imag: Float32Array, constraints?: PeriodicWaveConstraints): PeriodicWave; + createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode; + createStereoPanner(): StereoPannerNode; + createWaveShaper(): WaveShaperNode; + decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): Promise; + resume(): Promise; + addEventListener(type: K, listener: (this: AudioContext, ev: AudioContextEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface AudioContext extends AudioContextBase { + suspend(): Promise; +} + +declare var AudioContext: { + prototype: AudioContext; + new(): AudioContext; +} + +interface AudioDestinationNode extends AudioNode { + readonly maxChannelCount: number; +} + +declare var AudioDestinationNode: { + prototype: AudioDestinationNode; + new(): AudioDestinationNode; +} + +interface AudioListener { + dopplerFactor: number; + speedOfSound: number; + setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void; + setPosition(x: number, y: number, z: number): void; + setVelocity(x: number, y: number, z: number): void; +} + +declare var AudioListener: { + prototype: AudioListener; + new(): AudioListener; +} + +interface AudioNode extends EventTarget { + channelCount: number; + channelCountMode: ChannelCountMode; + channelInterpretation: ChannelInterpretation; + readonly context: AudioContext; + readonly numberOfInputs: number; + readonly numberOfOutputs: number; + connect(destination: AudioNode, output?: number, input?: number): AudioNode; + connect(destination: AudioParam, output?: number): void; + disconnect(output?: number): void; + disconnect(destination: AudioNode, output?: number, input?: number): void; + disconnect(destination: AudioParam, output?: number): void; +} + +declare var AudioNode: { + prototype: AudioNode; + new(): AudioNode; +} + +interface AudioParam { + readonly defaultValue: number; + value: number; + cancelScheduledValues(startTime: number): AudioParam; + exponentialRampToValueAtTime(value: number, endTime: number): AudioParam; + linearRampToValueAtTime(value: number, endTime: number): AudioParam; + setTargetAtTime(target: number, startTime: number, timeConstant: number): AudioParam; + setValueAtTime(value: number, startTime: number): AudioParam; + setValueCurveAtTime(values: Float32Array, startTime: number, duration: number): AudioParam; +} + +declare var AudioParam: { + prototype: AudioParam; + new(): AudioParam; +} + +interface AudioProcessingEvent extends Event { + readonly inputBuffer: AudioBuffer; + readonly outputBuffer: AudioBuffer; + readonly playbackTime: number; +} + +declare var AudioProcessingEvent: { + prototype: AudioProcessingEvent; + new(): AudioProcessingEvent; +} + +interface AudioTrack { + enabled: boolean; + readonly id: string; + kind: string; + readonly label: string; + language: string; + readonly sourceBuffer: SourceBuffer; +} + +declare var AudioTrack: { + prototype: AudioTrack; + new(): AudioTrack; +} + +interface AudioTrackListEventMap { + "addtrack": TrackEvent; + "change": Event; + "removetrack": TrackEvent; +} + +interface AudioTrackList extends EventTarget { + readonly length: number; + onaddtrack: (this: AudioTrackList, ev: TrackEvent) => any; + onchange: (this: AudioTrackList, ev: Event) => any; + onremovetrack: (this: AudioTrackList, ev: TrackEvent) => any; + getTrackById(id: string): AudioTrack | null; + item(index: number): AudioTrack; + addEventListener(type: K, listener: (this: AudioTrackList, ev: AudioTrackListEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: AudioTrack; +} + +declare var AudioTrackList: { + prototype: AudioTrackList; + new(): AudioTrackList; +} + +interface BarProp { + readonly visible: boolean; +} + +declare var BarProp: { + prototype: BarProp; + new(): BarProp; +} + +interface BeforeUnloadEvent extends Event { + returnValue: any; +} + +declare var BeforeUnloadEvent: { + prototype: BeforeUnloadEvent; + new(): BeforeUnloadEvent; +} + +interface BiquadFilterNode extends AudioNode { + readonly Q: AudioParam; + readonly detune: AudioParam; + readonly frequency: AudioParam; + readonly gain: AudioParam; + type: BiquadFilterType; + getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void; +} + +declare var BiquadFilterNode: { + prototype: BiquadFilterNode; + new(): BiquadFilterNode; +} + +interface Blob { + readonly size: number; + readonly type: string; + msClose(): void; + msDetachStream(): any; + slice(start?: number, end?: number, contentType?: string): Blob; +} + +declare var Blob: { + prototype: Blob; + new (blobParts?: any[], options?: BlobPropertyBag): Blob; +} + +interface CDATASection extends Text { +} + +declare var CDATASection: { + prototype: CDATASection; + new(): CDATASection; +} + +interface CSS { + supports(property: string, value?: string): boolean; +} +declare var CSS: CSS; + +interface CSSConditionRule extends CSSGroupingRule { + conditionText: string; +} + +declare var CSSConditionRule: { + prototype: CSSConditionRule; + new(): CSSConditionRule; +} + +interface CSSFontFaceRule extends CSSRule { + readonly style: CSSStyleDeclaration; +} + +declare var CSSFontFaceRule: { + prototype: CSSFontFaceRule; + new(): CSSFontFaceRule; +} + +interface CSSGroupingRule extends CSSRule { + readonly cssRules: CSSRuleList; + deleteRule(index: number): void; + insertRule(rule: string, index: number): number; +} + +declare var CSSGroupingRule: { + prototype: CSSGroupingRule; + new(): CSSGroupingRule; +} + +interface CSSImportRule extends CSSRule { + readonly href: string; + readonly media: MediaList; + readonly styleSheet: CSSStyleSheet; +} + +declare var CSSImportRule: { + prototype: CSSImportRule; + new(): CSSImportRule; +} + +interface CSSKeyframeRule extends CSSRule { + keyText: string; + readonly style: CSSStyleDeclaration; +} + +declare var CSSKeyframeRule: { + prototype: CSSKeyframeRule; + new(): CSSKeyframeRule; +} + +interface CSSKeyframesRule extends CSSRule { + readonly cssRules: CSSRuleList; + name: string; + appendRule(rule: string): void; + deleteRule(rule: string): void; + findRule(rule: string): CSSKeyframeRule; +} + +declare var CSSKeyframesRule: { + prototype: CSSKeyframesRule; + new(): CSSKeyframesRule; +} + +interface CSSMediaRule extends CSSConditionRule { + readonly media: MediaList; +} + +declare var CSSMediaRule: { + prototype: CSSMediaRule; + new(): CSSMediaRule; +} + +interface CSSNamespaceRule extends CSSRule { + readonly namespaceURI: string; + readonly prefix: string; +} + +declare var CSSNamespaceRule: { + prototype: CSSNamespaceRule; + new(): CSSNamespaceRule; +} + +interface CSSPageRule extends CSSRule { + readonly pseudoClass: string; + readonly selector: string; + selectorText: string; + readonly style: CSSStyleDeclaration; +} + +declare var CSSPageRule: { + prototype: CSSPageRule; + new(): CSSPageRule; +} + +interface CSSRule { + cssText: string; + readonly parentRule: CSSRule; + readonly parentStyleSheet: CSSStyleSheet; + readonly type: number; + readonly CHARSET_RULE: number; + readonly FONT_FACE_RULE: number; + readonly IMPORT_RULE: number; + readonly KEYFRAMES_RULE: number; + readonly KEYFRAME_RULE: number; + readonly MEDIA_RULE: number; + readonly NAMESPACE_RULE: number; + readonly PAGE_RULE: number; + readonly STYLE_RULE: number; + readonly SUPPORTS_RULE: number; + readonly UNKNOWN_RULE: number; + readonly VIEWPORT_RULE: number; +} + +declare var CSSRule: { + prototype: CSSRule; + new(): CSSRule; + readonly CHARSET_RULE: number; + readonly FONT_FACE_RULE: number; + readonly IMPORT_RULE: number; + readonly KEYFRAMES_RULE: number; + readonly KEYFRAME_RULE: number; + readonly MEDIA_RULE: number; + readonly NAMESPACE_RULE: number; + readonly PAGE_RULE: number; + readonly STYLE_RULE: number; + readonly SUPPORTS_RULE: number; + readonly UNKNOWN_RULE: number; + readonly VIEWPORT_RULE: number; +} + +interface CSSRuleList { + readonly length: number; + item(index: number): CSSRule; + [index: number]: CSSRule; +} + +declare var CSSRuleList: { + prototype: CSSRuleList; + new(): CSSRuleList; +} + +interface CSSStyleDeclaration { + alignContent: string | null; + alignItems: string | null; + alignSelf: string | null; + alignmentBaseline: string | null; + animation: string | null; + animationDelay: string | null; + animationDirection: string | null; + animationDuration: string | null; + animationFillMode: string | null; + animationIterationCount: string | null; + animationName: string | null; + animationPlayState: string | null; + animationTimingFunction: string | null; + backfaceVisibility: string | null; + background: string | null; + backgroundAttachment: string | null; + backgroundClip: string | null; + backgroundColor: string | null; + backgroundImage: string | null; + backgroundOrigin: string | null; + backgroundPosition: string | null; + backgroundPositionX: string | null; + backgroundPositionY: string | null; + backgroundRepeat: string | null; + backgroundSize: string | null; + baselineShift: string | null; + border: string | null; + borderBottom: string | null; + borderBottomColor: string | null; + borderBottomLeftRadius: string | null; + borderBottomRightRadius: string | null; + borderBottomStyle: string | null; + borderBottomWidth: string | null; + borderCollapse: string | null; + borderColor: string | null; + borderImage: string | null; + borderImageOutset: string | null; + borderImageRepeat: string | null; + borderImageSlice: string | null; + borderImageSource: string | null; + borderImageWidth: string | null; + borderLeft: string | null; + borderLeftColor: string | null; + borderLeftStyle: string | null; + borderLeftWidth: string | null; + borderRadius: string | null; + borderRight: string | null; + borderRightColor: string | null; + borderRightStyle: string | null; + borderRightWidth: string | null; + borderSpacing: string | null; + borderStyle: string | null; + borderTop: string | null; + borderTopColor: string | null; + borderTopLeftRadius: string | null; + borderTopRightRadius: string | null; + borderTopStyle: string | null; + borderTopWidth: string | null; + borderWidth: string | null; + bottom: string | null; + boxShadow: string | null; + boxSizing: string | null; + breakAfter: string | null; + breakBefore: string | null; + breakInside: string | null; + captionSide: string | null; + clear: string | null; + clip: string | null; + clipPath: string | null; + clipRule: string | null; + color: string | null; + colorInterpolationFilters: string | null; + columnCount: any; + columnFill: string | null; + columnGap: any; + columnRule: string | null; + columnRuleColor: any; + columnRuleStyle: string | null; + columnRuleWidth: any; + columnSpan: string | null; + columnWidth: any; + columns: string | null; + content: string | null; + counterIncrement: string | null; + counterReset: string | null; + cssFloat: string | null; + cssText: string; + cursor: string | null; + direction: string | null; + display: string | null; + dominantBaseline: string | null; + emptyCells: string | null; + enableBackground: string | null; + fill: string | null; + fillOpacity: string | null; + fillRule: string | null; + filter: string | null; + flex: string | null; + flexBasis: string | null; + flexDirection: string | null; + flexFlow: string | null; + flexGrow: string | null; + flexShrink: string | null; + flexWrap: string | null; + floodColor: string | null; + floodOpacity: string | null; + font: string | null; + fontFamily: string | null; + fontFeatureSettings: string | null; + fontSize: string | null; + fontSizeAdjust: string | null; + fontStretch: string | null; + fontStyle: string | null; + fontVariant: string | null; + fontWeight: string | null; + glyphOrientationHorizontal: string | null; + glyphOrientationVertical: string | null; + height: string | null; + imeMode: string | null; + justifyContent: string | null; + kerning: string | null; + layoutGrid: string | null; + layoutGridChar: string | null; + layoutGridLine: string | null; + layoutGridMode: string | null; + layoutGridType: string | null; + left: string | null; + readonly length: number; + letterSpacing: string | null; + lightingColor: string | null; + lineBreak: string | null; + lineHeight: string | null; + listStyle: string | null; + listStyleImage: string | null; + listStylePosition: string | null; + listStyleType: string | null; + margin: string | null; + marginBottom: string | null; + marginLeft: string | null; + marginRight: string | null; + marginTop: string | null; + marker: string | null; + markerEnd: string | null; + markerMid: string | null; + markerStart: string | null; + mask: string | null; + maxHeight: string | null; + maxWidth: string | null; + minHeight: string | null; + minWidth: string | null; + msContentZoomChaining: string | null; + msContentZoomLimit: string | null; + msContentZoomLimitMax: any; + msContentZoomLimitMin: any; + msContentZoomSnap: string | null; + msContentZoomSnapPoints: string | null; + msContentZoomSnapType: string | null; + msContentZooming: string | null; + msFlowFrom: string | null; + msFlowInto: string | null; + msFontFeatureSettings: string | null; + msGridColumn: any; + msGridColumnAlign: string | null; + msGridColumnSpan: any; + msGridColumns: string | null; + msGridRow: any; + msGridRowAlign: string | null; + msGridRowSpan: any; + msGridRows: string | null; + msHighContrastAdjust: string | null; + msHyphenateLimitChars: string | null; + msHyphenateLimitLines: any; + msHyphenateLimitZone: any; + msHyphens: string | null; + msImeAlign: string | null; + msOverflowStyle: string | null; + msScrollChaining: string | null; + msScrollLimit: string | null; + msScrollLimitXMax: any; + msScrollLimitXMin: any; + msScrollLimitYMax: any; + msScrollLimitYMin: any; + msScrollRails: string | null; + msScrollSnapPointsX: string | null; + msScrollSnapPointsY: string | null; + msScrollSnapType: string | null; + msScrollSnapX: string | null; + msScrollSnapY: string | null; + msScrollTranslation: string | null; + msTextCombineHorizontal: string | null; + msTextSizeAdjust: any; + msTouchAction: string | null; + msTouchSelect: string | null; + msUserSelect: string | null; + msWrapFlow: string; + msWrapMargin: any; + msWrapThrough: string; + opacity: string | null; + order: string | null; + orphans: string | null; + outline: string | null; + outlineColor: string | null; + outlineOffset: string | null; + outlineStyle: string | null; + outlineWidth: string | null; + overflow: string | null; + overflowX: string | null; + overflowY: string | null; + padding: string | null; + paddingBottom: string | null; + paddingLeft: string | null; + paddingRight: string | null; + paddingTop: string | null; + pageBreakAfter: string | null; + pageBreakBefore: string | null; + pageBreakInside: string | null; + readonly parentRule: CSSRule; + perspective: string | null; + perspectiveOrigin: string | null; + pointerEvents: string | null; + position: string | null; + quotes: string | null; + right: string | null; + rotate: string | null; + rubyAlign: string | null; + rubyOverhang: string | null; + rubyPosition: string | null; + scale: string | null; + stopColor: string | null; + stopOpacity: string | null; + stroke: string | null; + strokeDasharray: string | null; + strokeDashoffset: string | null; + strokeLinecap: string | null; + strokeLinejoin: string | null; + strokeMiterlimit: string | null; + strokeOpacity: string | null; + strokeWidth: string | null; + tableLayout: string | null; + textAlign: string | null; + textAlignLast: string | null; + textAnchor: string | null; + textDecoration: string | null; + textIndent: string | null; + textJustify: string | null; + textKashida: string | null; + textKashidaSpace: string | null; + textOverflow: string | null; + textShadow: string | null; + textTransform: string | null; + textUnderlinePosition: string | null; + top: string | null; + touchAction: string | null; + transform: string | null; + transformOrigin: string | null; + transformStyle: string | null; + transition: string | null; + transitionDelay: string | null; + transitionDuration: string | null; + transitionProperty: string | null; + transitionTimingFunction: string | null; + translate: string | null; + unicodeBidi: string | null; + verticalAlign: string | null; + visibility: string | null; + webkitAlignContent: string | null; + webkitAlignItems: string | null; + webkitAlignSelf: string | null; + webkitAnimation: string | null; + webkitAnimationDelay: string | null; + webkitAnimationDirection: string | null; + webkitAnimationDuration: string | null; + webkitAnimationFillMode: string | null; + webkitAnimationIterationCount: string | null; + webkitAnimationName: string | null; + webkitAnimationPlayState: string | null; + webkitAnimationTimingFunction: string | null; + webkitAppearance: string | null; + webkitBackfaceVisibility: string | null; + webkitBackgroundClip: string | null; + webkitBackgroundOrigin: string | null; + webkitBackgroundSize: string | null; + webkitBorderBottomLeftRadius: string | null; + webkitBorderBottomRightRadius: string | null; + webkitBorderImage: string | null; + webkitBorderRadius: string | null; + webkitBorderTopLeftRadius: string | null; + webkitBorderTopRightRadius: string | null; + webkitBoxAlign: string | null; + webkitBoxDirection: string | null; + webkitBoxFlex: string | null; + webkitBoxOrdinalGroup: string | null; + webkitBoxOrient: string | null; + webkitBoxPack: string | null; + webkitBoxSizing: string | null; + webkitColumnBreakAfter: string | null; + webkitColumnBreakBefore: string | null; + webkitColumnBreakInside: string | null; + webkitColumnCount: any; + webkitColumnGap: any; + webkitColumnRule: string | null; + webkitColumnRuleColor: any; + webkitColumnRuleStyle: string | null; + webkitColumnRuleWidth: any; + webkitColumnSpan: string | null; + webkitColumnWidth: any; + webkitColumns: string | null; + webkitFilter: string | null; + webkitFlex: string | null; + webkitFlexBasis: string | null; + webkitFlexDirection: string | null; + webkitFlexFlow: string | null; + webkitFlexGrow: string | null; + webkitFlexShrink: string | null; + webkitFlexWrap: string | null; + webkitJustifyContent: string | null; + webkitOrder: string | null; + webkitPerspective: string | null; + webkitPerspectiveOrigin: string | null; + webkitTapHighlightColor: string | null; + webkitTextFillColor: string | null; + webkitTextSizeAdjust: any; + webkitTextStroke: string | null; + webkitTextStrokeColor: string | null; + webkitTextStrokeWidth: string | null; + webkitTransform: string | null; + webkitTransformOrigin: string | null; + webkitTransformStyle: string | null; + webkitTransition: string | null; + webkitTransitionDelay: string | null; + webkitTransitionDuration: string | null; + webkitTransitionProperty: string | null; + webkitTransitionTimingFunction: string | null; + webkitUserModify: string | null; + webkitUserSelect: string | null; + webkitWritingMode: string | null; + whiteSpace: string | null; + widows: string | null; + width: string | null; + wordBreak: string | null; + wordSpacing: string | null; + wordWrap: string | null; + writingMode: string | null; + zIndex: string | null; + zoom: string | null; + resize: string | null; + userSelect: string | null; + getPropertyPriority(propertyName: string): string; + getPropertyValue(propertyName: string): string; + item(index: number): string; + removeProperty(propertyName: string): string; + setProperty(propertyName: string, value: string | null, priority?: string): void; + [index: number]: string; +} + +declare var CSSStyleDeclaration: { + prototype: CSSStyleDeclaration; + new(): CSSStyleDeclaration; +} + +interface CSSStyleRule extends CSSRule { + readonly readOnly: boolean; + selectorText: string; + readonly style: CSSStyleDeclaration; +} + +declare var CSSStyleRule: { + prototype: CSSStyleRule; + new(): CSSStyleRule; +} + +interface CSSStyleSheet extends StyleSheet { + readonly cssRules: CSSRuleList; + cssText: string; + readonly id: string; + readonly imports: StyleSheetList; + readonly isAlternate: boolean; + readonly isPrefAlternate: boolean; + readonly ownerRule: CSSRule; + readonly owningElement: Element; + readonly pages: StyleSheetPageList; + readonly readOnly: boolean; + readonly rules: CSSRuleList; + addImport(bstrURL: string, lIndex?: number): number; + addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; + addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; + deleteRule(index?: number): void; + insertRule(rule: string, index?: number): number; + removeImport(lIndex: number): void; + removeRule(lIndex: number): void; +} + +declare var CSSStyleSheet: { + prototype: CSSStyleSheet; + new(): CSSStyleSheet; +} + +interface CSSSupportsRule extends CSSConditionRule { +} + +declare var CSSSupportsRule: { + prototype: CSSSupportsRule; + new(): CSSSupportsRule; +} + +interface Cache { + add(request: RequestInfo): Promise; + addAll(requests: RequestInfo[]): Promise; + delete(request: RequestInfo, options?: CacheQueryOptions): Promise; + keys(request?: RequestInfo, options?: CacheQueryOptions): any; + match(request: RequestInfo, options?: CacheQueryOptions): Promise; + matchAll(request?: RequestInfo, options?: CacheQueryOptions): any; + put(request: RequestInfo, response: Response): Promise; +} + +declare var Cache: { + prototype: Cache; + new(): Cache; +} + +interface CacheStorage { + delete(cacheName: string): Promise; + has(cacheName: string): Promise; + keys(): any; + match(request: RequestInfo, options?: CacheQueryOptions): Promise; + open(cacheName: string): Promise; +} + +declare var CacheStorage: { + prototype: CacheStorage; + new(): CacheStorage; +} + +interface CanvasGradient { + addColorStop(offset: number, color: string): void; +} + +declare var CanvasGradient: { + prototype: CanvasGradient; + new(): CanvasGradient; +} + +interface CanvasPattern { + setTransform(matrix: SVGMatrix): void; +} + +declare var CanvasPattern: { + prototype: CanvasPattern; + new(): CanvasPattern; +} + +interface CanvasRenderingContext2D extends Object, CanvasPathMethods { + readonly canvas: HTMLCanvasElement; + fillStyle: string | CanvasGradient | CanvasPattern; + font: string; + globalAlpha: number; + globalCompositeOperation: string; + imageSmoothingEnabled: boolean; + lineCap: string; + lineDashOffset: number; + lineJoin: string; + lineWidth: number; + miterLimit: number; + msFillRule: CanvasFillRule; + shadowBlur: number; + shadowColor: string; + shadowOffsetX: number; + shadowOffsetY: number; + strokeStyle: string | CanvasGradient | CanvasPattern; + textAlign: string; + textBaseline: string; + mozImageSmoothingEnabled: boolean; + webkitImageSmoothingEnabled: boolean; + oImageSmoothingEnabled: boolean; + beginPath(): void; + clearRect(x: number, y: number, w: number, h: number): void; + clip(fillRule?: CanvasFillRule): void; + createImageData(imageDataOrSw: number | ImageData, sh?: number): ImageData; + createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; + createPattern(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, repetition: string): CanvasPattern; + createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; + drawFocusIfNeeded(element: Element): void; + drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, dstX: number, dstY: number): void; + drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, dstX: number, dstY: number, dstW: number, dstH: number): void; + drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, srcX: number, srcY: number, srcW: number, srcH: number, dstX: number, dstY: number, dstW: number, dstH: number): void; + fill(fillRule?: CanvasFillRule): void; + fillRect(x: number, y: number, w: number, h: number): void; + fillText(text: string, x: number, y: number, maxWidth?: number): void; + getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; + getLineDash(): number[]; + isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean; + measureText(text: string): TextMetrics; + putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; + restore(): void; + rotate(angle: number): void; + save(): void; + scale(x: number, y: number): void; + setLineDash(segments: number[]): void; + setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + stroke(path?: Path2D): void; + strokeRect(x: number, y: number, w: number, h: number): void; + strokeText(text: string, x: number, y: number, maxWidth?: number): void; + transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + translate(x: number, y: number): void; +} + +declare var CanvasRenderingContext2D: { + prototype: CanvasRenderingContext2D; + new(): CanvasRenderingContext2D; +} + +interface ChannelMergerNode extends AudioNode { +} + +declare var ChannelMergerNode: { + prototype: ChannelMergerNode; + new(): ChannelMergerNode; +} + +interface ChannelSplitterNode extends AudioNode { +} + +declare var ChannelSplitterNode: { + prototype: ChannelSplitterNode; + new(): ChannelSplitterNode; +} + +interface CharacterData extends Node, ChildNode { + data: string; + readonly length: number; + appendData(arg: string): void; + deleteData(offset: number, count: number): void; + insertData(offset: number, arg: string): void; + replaceData(offset: number, count: number, arg: string): void; + substringData(offset: number, count: number): string; +} + +declare var CharacterData: { + prototype: CharacterData; + new(): CharacterData; +} + +interface ClientRect { + bottom: number; + readonly height: number; + left: number; + right: number; + top: number; + readonly width: number; +} + +declare var ClientRect: { + prototype: ClientRect; + new(): ClientRect; +} + +interface ClientRectList { + readonly length: number; + item(index: number): ClientRect; + [index: number]: ClientRect; +} + +declare var ClientRectList: { + prototype: ClientRectList; + new(): ClientRectList; +} + +interface ClipboardEvent extends Event { + readonly clipboardData: DataTransfer; +} + +declare var ClipboardEvent: { + prototype: ClipboardEvent; + new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent; +} + +interface CloseEvent extends Event { + readonly code: number; + readonly reason: string; + readonly wasClean: boolean; + initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; +} + +declare var CloseEvent: { + prototype: CloseEvent; + new(typeArg: string, eventInitDict?: CloseEventInit): CloseEvent; +} + +interface Comment extends CharacterData { + text: string; +} + +declare var Comment: { + prototype: Comment; + new(): Comment; +} + +interface CompositionEvent extends UIEvent { + readonly data: string; + readonly locale: string; + initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; +} + +declare var CompositionEvent: { + prototype: CompositionEvent; + new(typeArg: string, eventInitDict?: CompositionEventInit): CompositionEvent; +} + +interface Console { + assert(test?: boolean, message?: string, ...optionalParams: any[]): void; + clear(): void; + count(countTitle?: string): void; + debug(message?: any, ...optionalParams: any[]): void; + dir(value?: any, ...optionalParams: any[]): void; + dirxml(value: any): void; + error(message?: any, ...optionalParams: any[]): void; + exception(message?: string, ...optionalParams: any[]): void; + group(groupTitle?: string): void; + groupCollapsed(groupTitle?: string): void; + groupEnd(): void; + info(message?: any, ...optionalParams: any[]): void; + log(message?: any, ...optionalParams: any[]): void; + msIsIndependentlyComposed(element: Element): boolean; + profile(reportName?: string): void; + profileEnd(): void; + select(element: Element): void; + table(...data: any[]): void; + time(timerName?: string): void; + timeEnd(timerName?: string): void; + trace(message?: any, ...optionalParams: any[]): void; + warn(message?: any, ...optionalParams: any[]): void; +} + +declare var Console: { + prototype: Console; + new(): Console; +} + +interface ConvolverNode extends AudioNode { + buffer: AudioBuffer | null; + normalize: boolean; +} + +declare var ConvolverNode: { + prototype: ConvolverNode; + new(): ConvolverNode; +} + +interface Coordinates { + readonly accuracy: number; + readonly altitude: number | null; + readonly altitudeAccuracy: number | null; + readonly heading: number | null; + readonly latitude: number; + readonly longitude: number; + readonly speed: number | null; +} + +declare var Coordinates: { + prototype: Coordinates; + new(): Coordinates; +} + +interface Crypto extends Object, RandomSource { + readonly subtle: SubtleCrypto; +} + +declare var Crypto: { + prototype: Crypto; + new(): Crypto; +} + +interface CryptoKey { + readonly algorithm: KeyAlgorithm; + readonly extractable: boolean; + readonly type: string; + readonly usages: string[]; +} + +declare var CryptoKey: { + prototype: CryptoKey; + new(): CryptoKey; +} + +interface CryptoKeyPair { + privateKey: CryptoKey; + publicKey: CryptoKey; +} + +declare var CryptoKeyPair: { + prototype: CryptoKeyPair; + new(): CryptoKeyPair; +} + +interface CustomEvent extends Event { + readonly detail: any; + initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; +} + +declare var CustomEvent: { + prototype: CustomEvent; + new(typeArg: string, eventInitDict?: CustomEventInit): CustomEvent; +} + +interface DOMError { + readonly name: string; + toString(): string; +} + +declare var DOMError: { + prototype: DOMError; + new(): DOMError; +} + +interface DOMException { + readonly code: number; + readonly message: string; + readonly name: string; + toString(): string; + readonly ABORT_ERR: number; + readonly DATA_CLONE_ERR: number; + readonly DOMSTRING_SIZE_ERR: number; + readonly HIERARCHY_REQUEST_ERR: number; + readonly INDEX_SIZE_ERR: number; + readonly INUSE_ATTRIBUTE_ERR: number; + readonly INVALID_ACCESS_ERR: number; + readonly INVALID_CHARACTER_ERR: number; + readonly INVALID_MODIFICATION_ERR: number; + readonly INVALID_NODE_TYPE_ERR: number; + readonly INVALID_STATE_ERR: number; + readonly NAMESPACE_ERR: number; + readonly NETWORK_ERR: number; + readonly NOT_FOUND_ERR: number; + readonly NOT_SUPPORTED_ERR: number; + readonly NO_DATA_ALLOWED_ERR: number; + readonly NO_MODIFICATION_ALLOWED_ERR: number; + readonly PARSE_ERR: number; + readonly QUOTA_EXCEEDED_ERR: number; + readonly SECURITY_ERR: number; + readonly SERIALIZE_ERR: number; + readonly SYNTAX_ERR: number; + readonly TIMEOUT_ERR: number; + readonly TYPE_MISMATCH_ERR: number; + readonly URL_MISMATCH_ERR: number; + readonly VALIDATION_ERR: number; + readonly WRONG_DOCUMENT_ERR: number; +} + +declare var DOMException: { + prototype: DOMException; + new(): DOMException; + readonly ABORT_ERR: number; + readonly DATA_CLONE_ERR: number; + readonly DOMSTRING_SIZE_ERR: number; + readonly HIERARCHY_REQUEST_ERR: number; + readonly INDEX_SIZE_ERR: number; + readonly INUSE_ATTRIBUTE_ERR: number; + readonly INVALID_ACCESS_ERR: number; + readonly INVALID_CHARACTER_ERR: number; + readonly INVALID_MODIFICATION_ERR: number; + readonly INVALID_NODE_TYPE_ERR: number; + readonly INVALID_STATE_ERR: number; + readonly NAMESPACE_ERR: number; + readonly NETWORK_ERR: number; + readonly NOT_FOUND_ERR: number; + readonly NOT_SUPPORTED_ERR: number; + readonly NO_DATA_ALLOWED_ERR: number; + readonly NO_MODIFICATION_ALLOWED_ERR: number; + readonly PARSE_ERR: number; + readonly QUOTA_EXCEEDED_ERR: number; + readonly SECURITY_ERR: number; + readonly SERIALIZE_ERR: number; + readonly SYNTAX_ERR: number; + readonly TIMEOUT_ERR: number; + readonly TYPE_MISMATCH_ERR: number; + readonly URL_MISMATCH_ERR: number; + readonly VALIDATION_ERR: number; + readonly WRONG_DOCUMENT_ERR: number; +} + +interface DOMImplementation { + createDocument(namespaceURI: string | null, qualifiedName: string | null, doctype: DocumentType | null): Document; + createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; + createHTMLDocument(title: string): Document; + hasFeature(feature: string | null, version: string | null): boolean; +} + +declare var DOMImplementation: { + prototype: DOMImplementation; + new(): DOMImplementation; +} + +interface DOMParser { + parseFromString(source: string, mimeType: string): Document; +} + +declare var DOMParser: { + prototype: DOMParser; + new(): DOMParser; +} + +interface DOMSettableTokenList extends DOMTokenList { + value: string; +} + +declare var DOMSettableTokenList: { + prototype: DOMSettableTokenList; + new(): DOMSettableTokenList; +} + +interface DOMStringList { + readonly length: number; + contains(str: string): boolean; + item(index: number): string | null; + [index: number]: string; +} + +declare var DOMStringList: { + prototype: DOMStringList; + new(): DOMStringList; +} + +interface DOMStringMap { + [name: string]: string | undefined; +} + +declare var DOMStringMap: { + prototype: DOMStringMap; + new(): DOMStringMap; +} + +interface DOMTokenList { + readonly length: number; + add(...token: string[]): void; + contains(token: string): boolean; + item(index: number): string; + remove(...token: string[]): void; + toString(): string; + toggle(token: string, force?: boolean): boolean; + [index: number]: string; +} + +declare var DOMTokenList: { + prototype: DOMTokenList; + new(): DOMTokenList; +} + +interface DataCue extends TextTrackCue { + data: ArrayBuffer; + addEventListener(type: K, listener: (this: DataCue, ev: TextTrackCueEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var DataCue: { + prototype: DataCue; + new(): DataCue; +} + +interface DataTransfer { + dropEffect: string; + effectAllowed: string; + readonly files: FileList; + readonly items: DataTransferItemList; + readonly types: string[]; + clearData(format?: string): boolean; + getData(format: string): string; + setData(format: string, data: string): boolean; + setDragImage(image: Element, x: number, y: number): void; +} + +declare var DataTransfer: { + prototype: DataTransfer; + new(): DataTransfer; +} + +interface DataTransferItem { + readonly kind: string; + readonly type: string; + getAsFile(): File | null; + getAsString(_callback: FunctionStringCallback | null): void; + webkitGetAsEntry(): any; +} + +declare var DataTransferItem: { + prototype: DataTransferItem; + new(): DataTransferItem; +} + +interface DataTransferItemList { + readonly length: number; + add(data: File): DataTransferItem | null; + clear(): void; + item(index: number): DataTransferItem; + remove(index: number): void; + [index: number]: DataTransferItem; +} + +declare var DataTransferItemList: { + prototype: DataTransferItemList; + new(): DataTransferItemList; +} + +interface DeferredPermissionRequest { + readonly id: number; + readonly type: MSWebViewPermissionType; + readonly uri: string; + allow(): void; + deny(): void; +} + +declare var DeferredPermissionRequest: { + prototype: DeferredPermissionRequest; + new(): DeferredPermissionRequest; +} + +interface DelayNode extends AudioNode { + readonly delayTime: AudioParam; +} + +declare var DelayNode: { + prototype: DelayNode; + new(): DelayNode; +} + +interface DeviceAcceleration { + readonly x: number | null; + readonly y: number | null; + readonly z: number | null; +} + +declare var DeviceAcceleration: { + prototype: DeviceAcceleration; + new(): DeviceAcceleration; +} + +interface DeviceLightEvent extends Event { + readonly value: number; +} + +declare var DeviceLightEvent: { + prototype: DeviceLightEvent; + new(typeArg: string, eventInitDict?: DeviceLightEventInit): DeviceLightEvent; +} + +interface DeviceMotionEvent extends Event { + readonly acceleration: DeviceAcceleration | null; + readonly accelerationIncludingGravity: DeviceAcceleration | null; + readonly interval: number | null; + readonly rotationRate: DeviceRotationRate | null; + initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict | null, accelerationIncludingGravity: DeviceAccelerationDict | null, rotationRate: DeviceRotationRateDict | null, interval: number | null): void; +} + +declare var DeviceMotionEvent: { + prototype: DeviceMotionEvent; + new(typeArg: string, eventInitDict?: DeviceMotionEventInit): DeviceMotionEvent; +} + +interface DeviceOrientationEvent extends Event { + readonly absolute: boolean; + readonly alpha: number | null; + readonly beta: number | null; + readonly gamma: number | null; + initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number | null, beta: number | null, gamma: number | null, absolute: boolean): void; +} + +declare var DeviceOrientationEvent: { + prototype: DeviceOrientationEvent; + new(typeArg: string, eventInitDict?: DeviceOrientationEventInit): DeviceOrientationEvent; +} + +interface DeviceRotationRate { + readonly alpha: number | null; + readonly beta: number | null; + readonly gamma: number | null; +} + +declare var DeviceRotationRate: { + prototype: DeviceRotationRate; + new(): DeviceRotationRate; +} + +interface DocumentEventMap extends GlobalEventHandlersEventMap { + "abort": UIEvent; + "activate": UIEvent; + "beforeactivate": UIEvent; + "beforedeactivate": UIEvent; + "blur": FocusEvent; + "canplay": Event; + "canplaythrough": Event; + "change": Event; + "click": MouseEvent; + "contextmenu": PointerEvent; + "dblclick": MouseEvent; + "deactivate": UIEvent; + "drag": DragEvent; + "dragend": DragEvent; + "dragenter": DragEvent; + "dragleave": DragEvent; + "dragover": DragEvent; + "dragstart": DragEvent; + "drop": DragEvent; + "durationchange": Event; + "emptied": Event; + "ended": MediaStreamErrorEvent; + "error": ErrorEvent; + "focus": FocusEvent; + "fullscreenchange": Event; + "fullscreenerror": Event; + "input": Event; + "invalid": Event; + "keydown": KeyboardEvent; + "keypress": KeyboardEvent; + "keyup": KeyboardEvent; + "load": Event; + "loadeddata": Event; + "loadedmetadata": Event; + "loadstart": Event; + "mousedown": MouseEvent; + "mousemove": MouseEvent; + "mouseout": MouseEvent; + "mouseover": MouseEvent; + "mouseup": MouseEvent; + "mousewheel": WheelEvent; + "MSContentZoom": UIEvent; + "MSGestureChange": MSGestureEvent; + "MSGestureDoubleTap": MSGestureEvent; + "MSGestureEnd": MSGestureEvent; + "MSGestureHold": MSGestureEvent; + "MSGestureStart": MSGestureEvent; + "MSGestureTap": MSGestureEvent; + "MSInertiaStart": MSGestureEvent; + "MSManipulationStateChanged": MSManipulationEvent; + "MSPointerCancel": MSPointerEvent; + "MSPointerDown": MSPointerEvent; + "MSPointerEnter": MSPointerEvent; + "MSPointerLeave": MSPointerEvent; + "MSPointerMove": MSPointerEvent; + "MSPointerOut": MSPointerEvent; + "MSPointerOver": MSPointerEvent; + "MSPointerUp": MSPointerEvent; + "mssitemodejumplistitemremoved": MSSiteModeEvent; + "msthumbnailclick": MSSiteModeEvent; + "pause": Event; + "play": Event; + "playing": Event; + "pointerlockchange": Event; + "pointerlockerror": Event; + "progress": ProgressEvent; + "ratechange": Event; + "readystatechange": Event; + "reset": Event; + "scroll": UIEvent; + "seeked": Event; + "seeking": Event; + "select": UIEvent; + "selectionchange": Event; + "selectstart": Event; + "stalled": Event; + "stop": Event; + "submit": Event; + "suspend": Event; + "timeupdate": Event; + "touchcancel": TouchEvent; + "touchend": TouchEvent; + "touchmove": TouchEvent; + "touchstart": TouchEvent; + "volumechange": Event; + "waiting": Event; + "webkitfullscreenchange": Event; + "webkitfullscreenerror": Event; +} + +interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEvent, ParentNode, DocumentOrShadowRoot { + /** + * Sets or gets the URL for the current document. + */ + readonly URL: string; + /** + * Gets the URL for the document, stripped of any character encoding. + */ + readonly URLUnencoded: string; + /** + * Gets the object that has the focus when the parent document has focus. + */ + readonly activeElement: Element; + /** + * Sets or gets the color of all active links in the document. + */ + alinkColor: string; + /** + * Returns a reference to the collection of elements contained by the object. + */ + readonly all: HTMLAllCollection; + /** + * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. + */ + anchors: HTMLCollectionOf; + /** + * Retrieves a collection of all applet objects in the document. + */ + applets: HTMLCollectionOf; + /** + * Deprecated. Sets or retrieves a value that indicates the background color behind the object. + */ + bgColor: string; + /** + * Specifies the beginning and end of the document body. + */ + body: HTMLElement; + readonly characterSet: string; + /** + * Gets or sets the character set used to encode the object. + */ + charset: string; + /** + * Gets a value that indicates whether standards-compliant mode is switched on for the object. + */ + readonly compatMode: string; + cookie: string; + readonly currentScript: HTMLScriptElement | SVGScriptElement; + readonly defaultView: Window; + /** + * Sets or gets a value that indicates whether the document can be edited. + */ + designMode: string; + /** + * Sets or retrieves a value that indicates the reading order of the object. + */ + dir: string; + /** + * Gets an object representing the document type declaration associated with the current document. + */ + readonly doctype: DocumentType; + /** + * Gets a reference to the root node of the document. + */ + documentElement: HTMLElement; + /** + * Sets or gets the security domain of the document. + */ + domain: string; + /** + * Retrieves a collection of all embed objects in the document. + */ + embeds: HTMLCollectionOf; + /** + * Sets or gets the foreground (text) color of the document. + */ + fgColor: string; + /** + * Retrieves a collection, in source order, of all form objects in the document. + */ + forms: HTMLCollectionOf; + readonly fullscreenElement: Element | null; + readonly fullscreenEnabled: boolean; + readonly head: HTMLHeadElement; + readonly hidden: boolean; + /** + * Retrieves a collection, in source order, of img objects in the document. + */ + images: HTMLCollectionOf; + /** + * Gets the implementation object of the current document. + */ + readonly implementation: DOMImplementation; + /** + * Returns the character encoding used to create the webpage that is loaded into the document object. + */ + readonly inputEncoding: string | null; + /** + * Gets the date that the page was last modified, if the page supplies one. + */ + readonly lastModified: string; + /** + * Sets or gets the color of the document links. + */ + linkColor: string; + /** + * Retrieves a collection of all a objects that specify the href property and all area objects in the document. + */ + links: HTMLCollectionOf; + /** + * Contains information about the current URL. + */ + readonly location: Location; + msCSSOMElementFloatMetrics: boolean; + msCapsLockWarningOff: boolean; + /** + * Fires when the user aborts the download. + * @param ev The event. + */ + onabort: (this: Document, ev: UIEvent) => any; + /** + * Fires when the object is set as the active element. + * @param ev The event. + */ + onactivate: (this: Document, ev: UIEvent) => any; + /** + * Fires immediately before the object is set as the active element. + * @param ev The event. + */ + onbeforeactivate: (this: Document, ev: UIEvent) => any; + /** + * Fires immediately before the activeElement is changed from the current object to another object in the parent document. + * @param ev The event. + */ + onbeforedeactivate: (this: Document, ev: UIEvent) => any; + /** + * Fires when the object loses the input focus. + * @param ev The focus event. + */ + onblur: (this: Document, ev: FocusEvent) => any; + /** + * Occurs when playback is possible, but would require further buffering. + * @param ev The event. + */ + oncanplay: (this: Document, ev: Event) => any; + oncanplaythrough: (this: Document, ev: Event) => any; + /** + * Fires when the contents of the object or selection have changed. + * @param ev The event. + */ + onchange: (this: Document, ev: Event) => any; + /** + * Fires when the user clicks the left mouse button on the object + * @param ev The mouse event. + */ + onclick: (this: Document, ev: MouseEvent) => any; + /** + * Fires when the user clicks the right mouse button in the client area, opening the context menu. + * @param ev The mouse event. + */ + oncontextmenu: (this: Document, ev: PointerEvent) => any; + /** + * Fires when the user double-clicks the object. + * @param ev The mouse event. + */ + ondblclick: (this: Document, ev: MouseEvent) => any; + /** + * Fires when the activeElement is changed from the current object to another object in the parent document. + * @param ev The UI Event + */ + ondeactivate: (this: Document, ev: UIEvent) => any; + /** + * Fires on the source object continuously during a drag operation. + * @param ev The event. + */ + ondrag: (this: Document, ev: DragEvent) => any; + /** + * Fires on the source object when the user releases the mouse at the close of a drag operation. + * @param ev The event. + */ + ondragend: (this: Document, ev: DragEvent) => any; + /** + * Fires on the target element when the user drags the object to a valid drop target. + * @param ev The drag event. + */ + ondragenter: (this: Document, ev: DragEvent) => any; + /** + * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. + * @param ev The drag event. + */ + ondragleave: (this: Document, ev: DragEvent) => any; + /** + * Fires on the target element continuously while the user drags the object over a valid drop target. + * @param ev The event. + */ + ondragover: (this: Document, ev: DragEvent) => any; + /** + * Fires on the source object when the user starts to drag a text selection or selected object. + * @param ev The event. + */ + ondragstart: (this: Document, ev: DragEvent) => any; + ondrop: (this: Document, ev: DragEvent) => any; + /** + * Occurs when the duration attribute is updated. + * @param ev The event. + */ + ondurationchange: (this: Document, ev: Event) => any; + /** + * Occurs when the media element is reset to its initial state. + * @param ev The event. + */ + onemptied: (this: Document, ev: Event) => any; + /** + * Occurs when the end of playback is reached. + * @param ev The event + */ + onended: (this: Document, ev: MediaStreamErrorEvent) => any; + /** + * Fires when an error occurs during object loading. + * @param ev The event. + */ + onerror: (this: Document, ev: ErrorEvent) => any; + /** + * Fires when the object receives focus. + * @param ev The event. + */ + onfocus: (this: Document, ev: FocusEvent) => any; + onfullscreenchange: (this: Document, ev: Event) => any; + onfullscreenerror: (this: Document, ev: Event) => any; + oninput: (this: Document, ev: Event) => any; + oninvalid: (this: Document, ev: Event) => any; + /** + * Fires when the user presses a key. + * @param ev The keyboard event + */ + onkeydown: (this: Document, ev: KeyboardEvent) => any; + /** + * Fires when the user presses an alphanumeric key. + * @param ev The event. + */ + onkeypress: (this: Document, ev: KeyboardEvent) => any; + /** + * Fires when the user releases a key. + * @param ev The keyboard event + */ + onkeyup: (this: Document, ev: KeyboardEvent) => any; + /** + * Fires immediately after the browser loads the object. + * @param ev The event. + */ + onload: (this: Document, ev: Event) => any; + /** + * Occurs when media data is loaded at the current playback position. + * @param ev The event. + */ + onloadeddata: (this: Document, ev: Event) => any; + /** + * Occurs when the duration and dimensions of the media have been determined. + * @param ev The event. + */ + onloadedmetadata: (this: Document, ev: Event) => any; + /** + * Occurs when Internet Explorer begins looking for media data. + * @param ev The event. + */ + onloadstart: (this: Document, ev: Event) => any; + /** + * Fires when the user clicks the object with either mouse button. + * @param ev The mouse event. + */ + onmousedown: (this: Document, ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse over the object. + * @param ev The mouse event. + */ + onmousemove: (this: Document, ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse pointer outside the boundaries of the object. + * @param ev The mouse event. + */ + onmouseout: (this: Document, ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse pointer into the object. + * @param ev The mouse event. + */ + onmouseover: (this: Document, ev: MouseEvent) => any; + /** + * Fires when the user releases a mouse button while the mouse is over the object. + * @param ev The mouse event. + */ + onmouseup: (this: Document, ev: MouseEvent) => any; + /** + * Fires when the wheel button is rotated. + * @param ev The mouse event + */ + onmousewheel: (this: Document, ev: WheelEvent) => any; + onmscontentzoom: (this: Document, ev: UIEvent) => any; + onmsgesturechange: (this: Document, ev: MSGestureEvent) => any; + onmsgesturedoubletap: (this: Document, ev: MSGestureEvent) => any; + onmsgestureend: (this: Document, ev: MSGestureEvent) => any; + onmsgesturehold: (this: Document, ev: MSGestureEvent) => any; + onmsgesturestart: (this: Document, ev: MSGestureEvent) => any; + onmsgesturetap: (this: Document, ev: MSGestureEvent) => any; + onmsinertiastart: (this: Document, ev: MSGestureEvent) => any; + onmsmanipulationstatechanged: (this: Document, ev: MSManipulationEvent) => any; + onmspointercancel: (this: Document, ev: MSPointerEvent) => any; + onmspointerdown: (this: Document, ev: MSPointerEvent) => any; + onmspointerenter: (this: Document, ev: MSPointerEvent) => any; + onmspointerleave: (this: Document, ev: MSPointerEvent) => any; + onmspointermove: (this: Document, ev: MSPointerEvent) => any; + onmspointerout: (this: Document, ev: MSPointerEvent) => any; + onmspointerover: (this: Document, ev: MSPointerEvent) => any; + onmspointerup: (this: Document, ev: MSPointerEvent) => any; + /** + * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. + * @param ev The event. + */ + onmssitemodejumplistitemremoved: (this: Document, ev: MSSiteModeEvent) => any; + /** + * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. + * @param ev The event. + */ + onmsthumbnailclick: (this: Document, ev: MSSiteModeEvent) => any; + /** + * Occurs when playback is paused. + * @param ev The event. + */ + onpause: (this: Document, ev: Event) => any; + /** + * Occurs when the play method is requested. + * @param ev The event. + */ + onplay: (this: Document, ev: Event) => any; + /** + * Occurs when the audio or video has started playing. + * @param ev The event. + */ + onplaying: (this: Document, ev: Event) => any; + onpointerlockchange: (this: Document, ev: Event) => any; + onpointerlockerror: (this: Document, ev: Event) => any; + /** + * Occurs to indicate progress while downloading media data. + * @param ev The event. + */ + onprogress: (this: Document, ev: ProgressEvent) => any; + /** + * Occurs when the playback rate is increased or decreased. + * @param ev The event. + */ + onratechange: (this: Document, ev: Event) => any; + /** + * Fires when the state of the object has changed. + * @param ev The event + */ + onreadystatechange: (this: Document, ev: Event) => any; + /** + * Fires when the user resets a form. + * @param ev The event. + */ + onreset: (this: Document, ev: Event) => any; + /** + * Fires when the user repositions the scroll box in the scroll bar on the object. + * @param ev The event. + */ + onscroll: (this: Document, ev: UIEvent) => any; + /** + * Occurs when the seek operation ends. + * @param ev The event. + */ + onseeked: (this: Document, ev: Event) => any; + /** + * Occurs when the current playback position is moved. + * @param ev The event. + */ + onseeking: (this: Document, ev: Event) => any; + /** + * Fires when the current selection changes. + * @param ev The event. + */ + onselect: (this: Document, ev: UIEvent) => any; + /** + * Fires when the selection state of a document changes. + * @param ev The event. + */ + onselectionchange: (this: Document, ev: Event) => any; + onselectstart: (this: Document, ev: Event) => any; + /** + * Occurs when the download has stopped. + * @param ev The event. + */ + onstalled: (this: Document, ev: Event) => any; + /** + * Fires when the user clicks the Stop button or leaves the Web page. + * @param ev The event. + */ + onstop: (this: Document, ev: Event) => any; + onsubmit: (this: Document, ev: Event) => any; + /** + * Occurs if the load operation has been intentionally halted. + * @param ev The event. + */ + onsuspend: (this: Document, ev: Event) => any; + /** + * Occurs to indicate the current playback position. + * @param ev The event. + */ + ontimeupdate: (this: Document, ev: Event) => any; + ontouchcancel: (ev: TouchEvent) => any; + ontouchend: (ev: TouchEvent) => any; + ontouchmove: (ev: TouchEvent) => any; + ontouchstart: (ev: TouchEvent) => any; + /** + * Occurs when the volume is changed, or playback is muted or unmuted. + * @param ev The event. + */ + onvolumechange: (this: Document, ev: Event) => any; + /** + * Occurs when playback stops because the next frame of a video resource is not available. + * @param ev The event. + */ + onwaiting: (this: Document, ev: Event) => any; + onwebkitfullscreenchange: (this: Document, ev: Event) => any; + onwebkitfullscreenerror: (this: Document, ev: Event) => any; + plugins: HTMLCollectionOf; + readonly pointerLockElement: Element; + /** + * Retrieves a value that indicates the current state of the object. + */ + readonly readyState: string; + /** + * Gets the URL of the location that referred the user to the current page. + */ + readonly referrer: string; + /** + * Gets the root svg element in the document hierarchy. + */ + readonly rootElement: SVGSVGElement; + /** + * Retrieves a collection of all script objects in the document. + */ + scripts: HTMLCollectionOf; + readonly scrollingElement: Element | null; + /** + * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. + */ + readonly styleSheets: StyleSheetList; + /** + * Contains the title of the document. + */ + title: string; + readonly visibilityState: VisibilityState; + /** + * Sets or gets the color of the links that the user has visited. + */ + vlinkColor: string; + readonly webkitCurrentFullScreenElement: Element | null; + readonly webkitFullscreenElement: Element | null; + readonly webkitFullscreenEnabled: boolean; + readonly webkitIsFullScreen: boolean; + readonly xmlEncoding: string | null; + xmlStandalone: boolean; + /** + * Gets or sets the version attribute specified in the declaration of an XML document. + */ + xmlVersion: string | null; + adoptNode(source: T): T; + captureEvents(): void; + caretRangeFromPoint(x: number, y: number): Range; + clear(): void; + /** + * Closes an output stream and forces the sent data to display. + */ + close(): void; + /** + * Creates an attribute object with a specified name. + * @param name String that sets the attribute object's name. + */ + createAttribute(name: string): Attr; + createAttributeNS(namespaceURI: string | null, qualifiedName: string): Attr; + createCDATASection(data: string): CDATASection; + /** + * Creates a comment object with the specified data. + * @param data Sets the comment object's data. + */ + createComment(data: string): Comment; + /** + * Creates a new document. + */ + createDocumentFragment(): DocumentFragment; + /** + * Creates an instance of the element for the specified tag. + * @param tagName The name of an element. + */ + createElement(tagName: K): HTMLElementTagNameMap[K]; + createElement(tagName: string): HTMLElement; + createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "a"): SVGAElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "circle"): SVGCircleElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "clipPath"): SVGClipPathElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "componentTransferFunction"): SVGComponentTransferFunctionElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "defs"): SVGDefsElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "desc"): SVGDescElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "ellipse"): SVGEllipseElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feBlend"): SVGFEBlendElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feColorMatrix"): SVGFEColorMatrixElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feComponentTransfer"): SVGFEComponentTransferElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feComposite"): SVGFECompositeElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feConvolveMatrix"): SVGFEConvolveMatrixElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDiffuseLighting"): SVGFEDiffuseLightingElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDisplacementMap"): SVGFEDisplacementMapElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDistantLight"): SVGFEDistantLightElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFlood"): SVGFEFloodElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncA"): SVGFEFuncAElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncB"): SVGFEFuncBElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncG"): SVGFEFuncGElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncR"): SVGFEFuncRElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feGaussianBlur"): SVGFEGaussianBlurElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feImage"): SVGFEImageElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMerge"): SVGFEMergeElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMergeNode"): SVGFEMergeNodeElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMorphology"): SVGFEMorphologyElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feOffset"): SVGFEOffsetElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "fePointLight"): SVGFEPointLightElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feSpecularLighting"): SVGFESpecularLightingElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feSpotLight"): SVGFESpotLightElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feTile"): SVGFETileElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feTurbulence"): SVGFETurbulenceElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "filter"): SVGFilterElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "foreignObject"): SVGForeignObjectElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "g"): SVGGElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "image"): SVGImageElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "gradient"): SVGGradientElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "line"): SVGLineElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "linearGradient"): SVGLinearGradientElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "marker"): SVGMarkerElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "mask"): SVGMaskElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "path"): SVGPathElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "metadata"): SVGMetadataElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "pattern"): SVGPatternElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "polygon"): SVGPolygonElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "polyline"): SVGPolylineElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "radialGradient"): SVGRadialGradientElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "rect"): SVGRectElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "svg"): SVGSVGElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "script"): SVGScriptElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "stop"): SVGStopElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "style"): SVGStyleElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "switch"): SVGSwitchElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "symbol"): SVGSymbolElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "tspan"): SVGTSpanElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textContent"): SVGTextContentElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "text"): SVGTextElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textPath"): SVGTextPathElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textPositioning"): SVGTextPositioningElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "title"): SVGTitleElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "use"): SVGUseElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "view"): SVGViewElement + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement + createElementNS(namespaceURI: string | null, qualifiedName: string): Element; + createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; + createNSResolver(nodeResolver: Node): XPathNSResolver; + /** + * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list + * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. + * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. + */ + createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): NodeIterator; + createProcessingInstruction(target: string, data: string): ProcessingInstruction; + /** + * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. + */ + createRange(): Range; + /** + * Creates a text string from the specified value. + * @param data String that specifies the nodeValue property of the text node. + */ + createTextNode(data: string): Text; + createTouch(view: Window, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch; + createTouchList(...touches: Touch[]): TouchList; + /** + * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. + * @param filter A custom NodeFilter function to use. + * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. + */ + createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker; + /** + * Returns the element for the specified x coordinate and the specified y coordinate. + * @param x The x-offset + * @param y The y-offset + */ + elementFromPoint(x: number, y: number): Element; + evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult; + /** + * Executes a command on the current document, current selection, or the given range. + * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. + * @param showUI Display the user interface, defaults to false. + * @param value Value to assign. + */ + execCommand(commandId: string, showUI?: boolean, value?: any): boolean; + /** + * Displays help information for the given command identifier. + * @param commandId Displays help information for the given command identifier. + */ + execCommandShowHelp(commandId: string): boolean; + exitFullscreen(): void; + exitPointerLock(): void; + /** + * Causes the element to receive the focus and executes the code specified by the onfocus event. + */ + focus(): void; + /** + * Returns a reference to the first object with the specified value of the ID or NAME attribute. + * @param elementId String that specifies the ID value. Case-insensitive. + */ + getElementById(elementId: string): HTMLElement | null; + getElementsByClassName(classNames: string): HTMLCollectionOf; + /** + * Gets a collection of objects based on the value of the NAME or ID attribute. + * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. + */ + getElementsByName(elementName: string): NodeListOf; + /** + * Retrieves a collection of objects based on the specified element name. + * @param name Specifies the name of an element. + */ + getElementsByTagName(tagname: K): ElementListTagNameMap[K]; + getElementsByTagName(tagname: string): NodeListOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf; + /** + * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. + */ + getSelection(): Selection; + /** + * Gets a value indicating whether the object currently has focus. + */ + hasFocus(): boolean; + importNode(importedNode: T, deep: boolean): T; + msElementsFromPoint(x: number, y: number): NodeListOf; + msElementsFromRect(left: number, top: number, width: number, height: number): NodeListOf; + /** + * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. + * @param url Specifies a MIME type for the document. + * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. + * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. + * @param replace Specifies whether the existing entry for the document is replaced in the history list. + */ + open(url?: string, name?: string, features?: string, replace?: boolean): Document; + /** + * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. + * @param commandId Specifies a command identifier. + */ + queryCommandEnabled(commandId: string): boolean; + /** + * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. + * @param commandId String that specifies a command identifier. + */ + queryCommandIndeterm(commandId: string): boolean; + /** + * Returns a Boolean value that indicates the current state of the command. + * @param commandId String that specifies a command identifier. + */ + queryCommandState(commandId: string): boolean; + /** + * Returns a Boolean value that indicates whether the current command is supported on the current range. + * @param commandId Specifies a command identifier. + */ + queryCommandSupported(commandId: string): boolean; + /** + * Retrieves the string associated with a command. + * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. + */ + queryCommandText(commandId: string): string; + /** + * Returns the current value of the document, range, or current selection for the given command. + * @param commandId String that specifies a command identifier. + */ + queryCommandValue(commandId: string): string; + releaseEvents(): void; + /** + * Allows updating the print settings for the page. + */ + updateSettings(): void; + webkitCancelFullScreen(): void; + webkitExitFullscreen(): void; + /** + * Writes one or more HTML expressions to a document in the specified window. + * @param content Specifies the text and HTML tags to write. + */ + write(...content: string[]): void; + /** + * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. + * @param content The text and HTML tags to write. + */ + writeln(...content: string[]): void; + addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Document: { + prototype: Document; + new(): Document; +} + +interface DocumentFragment extends Node, NodeSelector, ParentNode { + getElementById(elementId: string): HTMLElement | null; +} + +declare var DocumentFragment: { + prototype: DocumentFragment; + new(): DocumentFragment; +} + +interface DocumentType extends Node, ChildNode { + readonly entities: NamedNodeMap; + readonly internalSubset: string | null; + readonly name: string; + readonly notations: NamedNodeMap; + readonly publicId: string; + readonly systemId: string; +} + +declare var DocumentType: { + prototype: DocumentType; + new(): DocumentType; +} + +interface DragEvent extends MouseEvent { + readonly dataTransfer: DataTransfer; + initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; + msConvertURL(file: File, targetType: string, targetURL?: string): void; +} + +declare var DragEvent: { + prototype: DragEvent; + new(): DragEvent; +} + +interface DynamicsCompressorNode extends AudioNode { + readonly attack: AudioParam; + readonly knee: AudioParam; + readonly ratio: AudioParam; + readonly reduction: number; + readonly release: AudioParam; + readonly threshold: AudioParam; +} + +declare var DynamicsCompressorNode: { + prototype: DynamicsCompressorNode; + new(): DynamicsCompressorNode; +} + +interface EXT_frag_depth { +} + +declare var EXT_frag_depth: { + prototype: EXT_frag_depth; + new(): EXT_frag_depth; +} + +interface EXT_texture_filter_anisotropic { + readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; + readonly TEXTURE_MAX_ANISOTROPY_EXT: number; +} + +declare var EXT_texture_filter_anisotropic: { + prototype: EXT_texture_filter_anisotropic; + new(): EXT_texture_filter_anisotropic; + readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; + readonly TEXTURE_MAX_ANISOTROPY_EXT: number; +} + +interface ElementEventMap extends GlobalEventHandlersEventMap { + "ariarequest": Event; + "command": Event; + "gotpointercapture": PointerEvent; + "lostpointercapture": PointerEvent; + "MSGestureChange": MSGestureEvent; + "MSGestureDoubleTap": MSGestureEvent; + "MSGestureEnd": MSGestureEvent; + "MSGestureHold": MSGestureEvent; + "MSGestureStart": MSGestureEvent; + "MSGestureTap": MSGestureEvent; + "MSGotPointerCapture": MSPointerEvent; + "MSInertiaStart": MSGestureEvent; + "MSLostPointerCapture": MSPointerEvent; + "MSPointerCancel": MSPointerEvent; + "MSPointerDown": MSPointerEvent; + "MSPointerEnter": MSPointerEvent; + "MSPointerLeave": MSPointerEvent; + "MSPointerMove": MSPointerEvent; + "MSPointerOut": MSPointerEvent; + "MSPointerOver": MSPointerEvent; + "MSPointerUp": MSPointerEvent; + "touchcancel": TouchEvent; + "touchend": TouchEvent; + "touchmove": TouchEvent; + "touchstart": TouchEvent; + "webkitfullscreenchange": Event; + "webkitfullscreenerror": Event; +} + +interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelector, ChildNode, ParentNode { + readonly classList: DOMTokenList; + className: string; + readonly clientHeight: number; + readonly clientLeft: number; + readonly clientTop: number; + readonly clientWidth: number; + id: string; + innerHTML: string; + msContentZoomFactor: number; + readonly msRegionOverflow: string; + onariarequest: (this: Element, ev: Event) => any; + oncommand: (this: Element, ev: Event) => any; + ongotpointercapture: (this: Element, ev: PointerEvent) => any; + onlostpointercapture: (this: Element, ev: PointerEvent) => any; + onmsgesturechange: (this: Element, ev: MSGestureEvent) => any; + onmsgesturedoubletap: (this: Element, ev: MSGestureEvent) => any; + onmsgestureend: (this: Element, ev: MSGestureEvent) => any; + onmsgesturehold: (this: Element, ev: MSGestureEvent) => any; + onmsgesturestart: (this: Element, ev: MSGestureEvent) => any; + onmsgesturetap: (this: Element, ev: MSGestureEvent) => any; + onmsgotpointercapture: (this: Element, ev: MSPointerEvent) => any; + onmsinertiastart: (this: Element, ev: MSGestureEvent) => any; + onmslostpointercapture: (this: Element, ev: MSPointerEvent) => any; + onmspointercancel: (this: Element, ev: MSPointerEvent) => any; + onmspointerdown: (this: Element, ev: MSPointerEvent) => any; + onmspointerenter: (this: Element, ev: MSPointerEvent) => any; + onmspointerleave: (this: Element, ev: MSPointerEvent) => any; + onmspointermove: (this: Element, ev: MSPointerEvent) => any; + onmspointerout: (this: Element, ev: MSPointerEvent) => any; + onmspointerover: (this: Element, ev: MSPointerEvent) => any; + onmspointerup: (this: Element, ev: MSPointerEvent) => any; + ontouchcancel: (ev: TouchEvent) => any; + ontouchend: (ev: TouchEvent) => any; + ontouchmove: (ev: TouchEvent) => any; + ontouchstart: (ev: TouchEvent) => any; + onwebkitfullscreenchange: (this: Element, ev: Event) => any; + onwebkitfullscreenerror: (this: Element, ev: Event) => any; + outerHTML: string; + readonly prefix: string | null; + readonly scrollHeight: number; + scrollLeft: number; + scrollTop: number; + readonly scrollWidth: number; + readonly tagName: string; + readonly assignedSlot: HTMLSlotElement | null; + slot: string; + readonly shadowRoot: ShadowRoot | null; + getAttribute(name: string): string | null; + getAttributeNS(namespaceURI: string, localName: string): string; + getAttributeNode(name: string): Attr; + getAttributeNodeNS(namespaceURI: string, localName: string): Attr; + getBoundingClientRect(): ClientRect; + getClientRects(): ClientRectList; + getElementsByTagName(name: K): ElementListTagNameMap[K]; + getElementsByTagName(name: string): NodeListOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf; + hasAttribute(name: string): boolean; + hasAttributeNS(namespaceURI: string, localName: string): boolean; + msGetRegionContent(): MSRangeCollection; + msGetUntransformedBounds(): ClientRect; + msMatchesSelector(selectors: string): boolean; + msReleasePointerCapture(pointerId: number): void; + msSetPointerCapture(pointerId: number): void; + msZoomTo(args: MsZoomToOptions): void; + releasePointerCapture(pointerId: number): void; + removeAttribute(qualifiedName: string): void; + removeAttributeNS(namespaceURI: string, localName: string): void; + removeAttributeNode(oldAttr: Attr): Attr; + requestFullscreen(): void; + requestPointerLock(): void; + setAttribute(name: string, value: string): void; + setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; + setAttributeNode(newAttr: Attr): Attr; + setAttributeNodeNS(newAttr: Attr): Attr; + setPointerCapture(pointerId: number): void; + webkitMatchesSelector(selectors: string): boolean; + webkitRequestFullScreen(): void; + webkitRequestFullscreen(): void; + getElementsByClassName(classNames: string): NodeListOf; + matches(selector: string): boolean; + closest(selector: string): Element | null; + scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void; + scroll(options?: ScrollToOptions): void; + scroll(x: number, y: number): void; + scrollTo(options?: ScrollToOptions): void; + scrollTo(x: number, y: number): void; + scrollBy(options?: ScrollToOptions): void; + scrollBy(x: number, y: number): void; + insertAdjacentElement(position: string, insertedElement: Element): Element | null; + insertAdjacentHTML(where: string, html: string): void; + insertAdjacentText(where: string, text: string): void; + attachShadow(shadowRootInitDict: ShadowRootInit): ShadowRoot; + addEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Element: { + prototype: Element; + new(): Element; +} + +interface ErrorEvent extends Event { + readonly colno: number; + readonly error: any; + readonly filename: string; + readonly lineno: number; + readonly message: string; + initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; +} + +declare var ErrorEvent: { + prototype: ErrorEvent; + new(type: string, errorEventInitDict?: ErrorEventInit): ErrorEvent; +} + +interface Event { + readonly bubbles: boolean; + cancelBubble: boolean; + readonly cancelable: boolean; + readonly currentTarget: EventTarget; + readonly defaultPrevented: boolean; + readonly eventPhase: number; + readonly isTrusted: boolean; + returnValue: boolean; + readonly srcElement: Element | null; + readonly target: EventTarget; + readonly timeStamp: number; + readonly type: string; + readonly scoped: boolean; + initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; + preventDefault(): void; + stopImmediatePropagation(): void; + stopPropagation(): void; + deepPath(): EventTarget[]; + readonly AT_TARGET: number; + readonly BUBBLING_PHASE: number; + readonly CAPTURING_PHASE: number; +} + +declare var Event: { + prototype: Event; + new(typeArg: string, eventInitDict?: EventInit): Event; + readonly AT_TARGET: number; + readonly BUBBLING_PHASE: number; + readonly CAPTURING_PHASE: number; +} + +interface EventTarget { + addEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + dispatchEvent(evt: Event): boolean; + removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var EventTarget: { + prototype: EventTarget; + new(): EventTarget; +} + +interface ExtensionScriptApis { + extensionIdToShortId(extensionId: string): number; + fireExtensionApiTelemetry(functionName: string, isSucceeded: boolean, isSupported: boolean): void; + genericFunction(routerAddress: any, parameters?: string, callbackId?: number): void; + genericSynchronousFunction(functionId: number, parameters?: string): string; + getExtensionId(): string; + registerGenericFunctionCallbackHandler(callbackHandler: any): void; + registerGenericPersistentCallbackHandler(callbackHandler: any): void; +} + +declare var ExtensionScriptApis: { + prototype: ExtensionScriptApis; + new(): ExtensionScriptApis; +} + +interface External { +} + +declare var External: { + prototype: External; + new(): External; +} + +interface File extends Blob { + readonly lastModifiedDate: any; + readonly name: string; + readonly webkitRelativePath: string; +} + +declare var File: { + prototype: File; + new (parts: (ArrayBuffer | ArrayBufferView | Blob | string)[], filename: string, properties?: FilePropertyBag): File; +} + +interface FileList { + readonly length: number; + item(index: number): File; + [index: number]: File; +} + +declare var FileList: { + prototype: FileList; + new(): FileList; +} + +interface FileReader extends EventTarget, MSBaseReader { + readonly error: DOMError; + readAsArrayBuffer(blob: Blob): void; + readAsBinaryString(blob: Blob): void; + readAsDataURL(blob: Blob): void; + readAsText(blob: Blob, encoding?: string): void; + addEventListener(type: K, listener: (this: FileReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var FileReader: { + prototype: FileReader; + new(): FileReader; +} + +interface FocusEvent extends UIEvent { + readonly relatedTarget: EventTarget; + initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; +} + +declare var FocusEvent: { + prototype: FocusEvent; + new(typeArg: string, eventInitDict?: FocusEventInit): FocusEvent; +} + +interface FocusNavigationEvent extends Event { + readonly navigationReason: NavigationReason; + readonly originHeight: number; + readonly originLeft: number; + readonly originTop: number; + readonly originWidth: number; + requestFocus(): void; +} + +declare var FocusNavigationEvent: { + prototype: FocusNavigationEvent; + new(type: string, eventInitDict?: FocusNavigationEventInit): FocusNavigationEvent; +} + +interface FormData { + append(name: string, value: string | Blob, fileName?: string): void; + delete(name: string): void; + get(name: string): FormDataEntryValue | null; + getAll(name: string): FormDataEntryValue[]; + has(name: string): boolean; + set(name: string, value: string | Blob, fileName?: string): void; +} + +declare var FormData: { + prototype: FormData; + new (form?: HTMLFormElement): FormData; +} + +interface GainNode extends AudioNode { + readonly gain: AudioParam; +} + +declare var GainNode: { + prototype: GainNode; + new(): GainNode; +} + +interface Gamepad { + readonly axes: number[]; + readonly buttons: GamepadButton[]; + readonly connected: boolean; + readonly id: string; + readonly index: number; + readonly mapping: string; + readonly timestamp: number; +} + +declare var Gamepad: { + prototype: Gamepad; + new(): Gamepad; +} + +interface GamepadButton { + readonly pressed: boolean; + readonly value: number; +} + +declare var GamepadButton: { + prototype: GamepadButton; + new(): GamepadButton; +} + +interface GamepadEvent extends Event { + readonly gamepad: Gamepad; +} + +declare var GamepadEvent: { + prototype: GamepadEvent; + new(typeArg: string, eventInitDict?: GamepadEventInit): GamepadEvent; +} + +interface Geolocation { + clearWatch(watchId: number): void; + getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; + watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; +} + +declare var Geolocation: { + prototype: Geolocation; + new(): Geolocation; +} + +interface HTMLAllCollection { + readonly length: number; + item(nameOrIndex?: string): HTMLCollection | Element | null; + namedItem(name: string): HTMLCollection | Element | null; + [index: number]: Element; +} + +declare var HTMLAllCollection: { + prototype: HTMLAllCollection; + new(): HTMLAllCollection; +} + +interface HTMLAnchorElement extends HTMLElement { + Methods: string; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Sets or retrieves the coordinates of the object. + */ + coords: string; + download: string; + /** + * Contains the anchor portion of the URL including the hash sign (#). + */ + hash: string; + /** + * Contains the hostname and port values of the URL. + */ + host: string; + /** + * Contains the hostname of a URL. + */ + hostname: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or retrieves the language code of the object. + */ + hreflang: string; + readonly mimeType: string; + /** + * Sets or retrieves the shape of the object. + */ + name: string; + readonly nameProp: string; + /** + * Contains the pathname of the URL. + */ + pathname: string; + /** + * Sets or retrieves the port number associated with a URL. + */ + port: string; + /** + * Contains the protocol of the URL. + */ + protocol: string; + readonly protocolLong: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rel: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rev: string; + /** + * Sets or retrieves the substring of the href property that follows the question mark. + */ + search: string; + /** + * Sets or retrieves the shape of the object. + */ + shape: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + type: string; + urn: string; + /** + * Returns a string representation of an object. + */ + toString(): string; + addEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLAnchorElement: { + prototype: HTMLAnchorElement; + new(): HTMLAnchorElement; +} + +interface HTMLAppletElement extends HTMLElement { + /** + * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. + */ + readonly BaseHref: string; + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Gets or sets the optional alternative HTML script to execute if the object fails to load. + */ + altHtml: string; + /** + * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. + */ + archive: string; + border: string; + code: string; + /** + * Sets or retrieves the URL of the component. + */ + codeBase: string; + /** + * Sets or retrieves the Internet media type for the code associated with the object. + */ + codeType: string; + /** + * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. + */ + readonly contentDocument: Document; + /** + * Sets or retrieves the URL that references the data of the object. + */ + data: string; + /** + * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. + */ + declare: boolean; + readonly form: HTMLFormElement; + /** + * Sets or retrieves the height of the object. + */ + height: string; + hspace: number; + /** + * Sets or retrieves the shape of the object. + */ + name: string; + object: string | null; + /** + * Sets or retrieves a message to be displayed while an object is loading. + */ + standby: string; + /** + * Returns the content type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + vspace: number; + width: number; + addEventListener(type: K, listener: (this: HTMLAppletElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLAppletElement: { + prototype: HTMLAppletElement; + new(): HTMLAppletElement; +} + +interface HTMLAreaElement extends HTMLElement { + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Sets or retrieves the coordinates of the object. + */ + coords: string; + download: string; + /** + * Sets or retrieves the subsection of the href property that follows the number sign (#). + */ + hash: string; + /** + * Sets or retrieves the hostname and port number of the location or URL. + */ + host: string; + /** + * Sets or retrieves the host name part of the location or URL. + */ + hostname: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or gets whether clicks in this region cause action. + */ + noHref: boolean; + /** + * Sets or retrieves the file name or path specified by the object. + */ + pathname: string; + /** + * Sets or retrieves the port number associated with a URL. + */ + port: string; + /** + * Sets or retrieves the protocol portion of a URL. + */ + protocol: string; + rel: string; + /** + * Sets or retrieves the substring of the href property that follows the question mark. + */ + search: string; + /** + * Sets or retrieves the shape of the object. + */ + shape: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Returns a string representation of an object. + */ + toString(): string; + addEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLAreaElement: { + prototype: HTMLAreaElement; + new(): HTMLAreaElement; +} + +interface HTMLAreasCollection extends HTMLCollectionBase { +} + +declare var HTMLAreasCollection: { + prototype: HTMLAreasCollection; + new(): HTMLAreasCollection; +} + +interface HTMLAudioElement extends HTMLMediaElement { + addEventListener(type: K, listener: (this: HTMLAudioElement, ev: HTMLMediaElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLAudioElement: { + prototype: HTMLAudioElement; + new(): HTMLAudioElement; +} + +interface HTMLBRElement extends HTMLElement { + /** + * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. + */ + clear: string; + addEventListener(type: K, listener: (this: HTMLBRElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLBRElement: { + prototype: HTMLBRElement; + new(): HTMLBRElement; +} + +interface HTMLBaseElement extends HTMLElement { + /** + * Gets or sets the baseline URL on which relative links are based. + */ + href: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + addEventListener(type: K, listener: (this: HTMLBaseElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLBaseElement: { + prototype: HTMLBaseElement; + new(): HTMLBaseElement; +} + +interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { + /** + * Sets or retrieves the current typeface family. + */ + face: string; + /** + * Sets or retrieves the font size of the object. + */ + size: number; + addEventListener(type: K, listener: (this: HTMLBaseFontElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLBaseFontElement: { + prototype: HTMLBaseFontElement; + new(): HTMLBaseFontElement; +} + +interface HTMLBodyElementEventMap extends HTMLElementEventMap { + "afterprint": Event; + "beforeprint": Event; + "beforeunload": BeforeUnloadEvent; + "blur": FocusEvent; + "error": ErrorEvent; + "focus": FocusEvent; + "hashchange": HashChangeEvent; + "load": Event; + "message": MessageEvent; + "offline": Event; + "online": Event; + "orientationchange": Event; + "pagehide": PageTransitionEvent; + "pageshow": PageTransitionEvent; + "popstate": PopStateEvent; + "resize": UIEvent; + "scroll": UIEvent; + "storage": StorageEvent; + "unload": Event; +} + +interface HTMLBodyElement extends HTMLElement { + aLink: any; + background: string; + bgColor: any; + bgProperties: string; + link: any; + noWrap: boolean; + onafterprint: (this: HTMLBodyElement, ev: Event) => any; + onbeforeprint: (this: HTMLBodyElement, ev: Event) => any; + onbeforeunload: (this: HTMLBodyElement, ev: BeforeUnloadEvent) => any; + onblur: (this: HTMLBodyElement, ev: FocusEvent) => any; + onerror: (this: HTMLBodyElement, ev: ErrorEvent) => any; + onfocus: (this: HTMLBodyElement, ev: FocusEvent) => any; + onhashchange: (this: HTMLBodyElement, ev: HashChangeEvent) => any; + onload: (this: HTMLBodyElement, ev: Event) => any; + onmessage: (this: HTMLBodyElement, ev: MessageEvent) => any; + onoffline: (this: HTMLBodyElement, ev: Event) => any; + ononline: (this: HTMLBodyElement, ev: Event) => any; + onorientationchange: (this: HTMLBodyElement, ev: Event) => any; + onpagehide: (this: HTMLBodyElement, ev: PageTransitionEvent) => any; + onpageshow: (this: HTMLBodyElement, ev: PageTransitionEvent) => any; + onpopstate: (this: HTMLBodyElement, ev: PopStateEvent) => any; + onresize: (this: HTMLBodyElement, ev: UIEvent) => any; + onscroll: (this: HTMLBodyElement, ev: UIEvent) => any; + onstorage: (this: HTMLBodyElement, ev: StorageEvent) => any; + onunload: (this: HTMLBodyElement, ev: Event) => any; + text: any; + vLink: any; + addEventListener(type: K, listener: (this: HTMLBodyElement, ev: HTMLBodyElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLBodyElement: { + prototype: HTMLBodyElement; + new(): HTMLBodyElement; +} + +interface HTMLButtonElement extends HTMLElement { + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Overrides the action attribute (where the data on a form is sent) on the parent form element. + */ + formAction: string; + /** + * Used to override the encoding (formEnctype attribute) specified on the form element. + */ + formEnctype: string; + /** + * Overrides the submit method attribute previously specified on a form element. + */ + formMethod: string; + /** + * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + */ + formNoValidate: string; + /** + * Overrides the target attribute on a form element. + */ + formTarget: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + status: any; + /** + * Gets the classification and default behavior of the button. + */ + type: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + readonly validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + readonly validity: ValidityState; + /** + * Sets or retrieves the default or selected value of the control. + */ + value: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + readonly willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + addEventListener(type: K, listener: (this: HTMLButtonElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLButtonElement: { + prototype: HTMLButtonElement; + new(): HTMLButtonElement; +} + +interface HTMLCanvasElement extends HTMLElement { + /** + * Gets or sets the height of a canvas element on a document. + */ + height: number; + /** + * Gets or sets the width of a canvas element on a document. + */ + width: number; + /** + * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. + * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); + */ + getContext(contextId: "2d", contextAttributes?: Canvas2DContextAttributes): CanvasRenderingContext2D | null; + getContext(contextId: "webgl" | "experimental-webgl", contextAttributes?: WebGLContextAttributes): WebGLRenderingContext | null; + getContext(contextId: string, contextAttributes?: {}): CanvasRenderingContext2D | WebGLRenderingContext | null; + /** + * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. + */ + msToBlob(): Blob; + /** + * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. + * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. + */ + toDataURL(type?: string, ...args: any[]): string; + toBlob(callback: (result: Blob | null) => void, type?: string, ...arguments: any[]): void; + addEventListener(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLCanvasElement: { + prototype: HTMLCanvasElement; + new(): HTMLCanvasElement; +} + +interface HTMLCollectionBase { + /** + * Sets or retrieves the number of objects in a collection. + */ + readonly length: number; + /** + * Retrieves an object from various collections. + */ + item(index: number): Element; + [index: number]: Element; +} + +interface HTMLCollection extends HTMLCollectionBase { + /** + * Retrieves a select object or an object from an options collection. + */ + namedItem(name: string): Element | null; +} + +declare var HTMLCollection: { + prototype: HTMLCollection; + new(): HTMLCollection; +} + +interface HTMLDListElement extends HTMLElement { + compact: boolean; + addEventListener(type: K, listener: (this: HTMLDListElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLDListElement: { + prototype: HTMLDListElement; + new(): HTMLDListElement; +} + +interface HTMLDataElement extends HTMLElement { + value: string; + addEventListener(type: K, listener: (this: HTMLDataElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLDataElement: { + prototype: HTMLDataElement; + new(): HTMLDataElement; +} + +interface HTMLDataListElement extends HTMLElement { + options: HTMLCollectionOf; + addEventListener(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLDataListElement: { + prototype: HTMLDataListElement; + new(): HTMLDataListElement; +} + +interface HTMLDirectoryElement extends HTMLElement { + compact: boolean; + addEventListener(type: K, listener: (this: HTMLDirectoryElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLDirectoryElement: { + prototype: HTMLDirectoryElement; + new(): HTMLDirectoryElement; +} + +interface HTMLDivElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; + addEventListener(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLDivElement: { + prototype: HTMLDivElement; + new(): HTMLDivElement; +} + +interface HTMLDocument extends Document { + addEventListener(type: K, listener: (this: HTMLDocument, ev: DocumentEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLDocument: { + prototype: HTMLDocument; + new(): HTMLDocument; +} + +interface HTMLElementEventMap extends ElementEventMap { + "abort": UIEvent; + "activate": UIEvent; + "beforeactivate": UIEvent; + "beforecopy": ClipboardEvent; + "beforecut": ClipboardEvent; + "beforedeactivate": UIEvent; + "beforepaste": ClipboardEvent; + "blur": FocusEvent; + "canplay": Event; + "canplaythrough": Event; + "change": Event; + "click": MouseEvent; + "contextmenu": PointerEvent; + "copy": ClipboardEvent; + "cuechange": Event; + "cut": ClipboardEvent; + "dblclick": MouseEvent; + "deactivate": UIEvent; + "drag": DragEvent; + "dragend": DragEvent; + "dragenter": DragEvent; + "dragleave": DragEvent; + "dragover": DragEvent; + "dragstart": DragEvent; + "drop": DragEvent; + "durationchange": Event; + "emptied": Event; + "ended": MediaStreamErrorEvent; + "error": ErrorEvent; + "focus": FocusEvent; + "input": Event; + "invalid": Event; + "keydown": KeyboardEvent; + "keypress": KeyboardEvent; + "keyup": KeyboardEvent; + "load": Event; + "loadeddata": Event; + "loadedmetadata": Event; + "loadstart": Event; + "mousedown": MouseEvent; + "mouseenter": MouseEvent; + "mouseleave": MouseEvent; + "mousemove": MouseEvent; + "mouseout": MouseEvent; + "mouseover": MouseEvent; + "mouseup": MouseEvent; + "mousewheel": WheelEvent; + "MSContentZoom": UIEvent; + "MSManipulationStateChanged": MSManipulationEvent; + "paste": ClipboardEvent; + "pause": Event; + "play": Event; + "playing": Event; + "progress": ProgressEvent; + "ratechange": Event; + "reset": Event; + "scroll": UIEvent; + "seeked": Event; + "seeking": Event; + "select": UIEvent; + "selectstart": Event; + "stalled": Event; + "submit": Event; + "suspend": Event; + "timeupdate": Event; + "volumechange": Event; + "waiting": Event; +} + +interface HTMLElement extends Element { + accessKey: string; + readonly children: HTMLCollection; + contentEditable: string; + readonly dataset: DOMStringMap; + dir: string; + draggable: boolean; + hidden: boolean; + hideFocus: boolean; + innerText: string; + readonly isContentEditable: boolean; + lang: string; + readonly offsetHeight: number; + readonly offsetLeft: number; + readonly offsetParent: Element; + readonly offsetTop: number; + readonly offsetWidth: number; + onabort: (this: HTMLElement, ev: UIEvent) => any; + onactivate: (this: HTMLElement, ev: UIEvent) => any; + onbeforeactivate: (this: HTMLElement, ev: UIEvent) => any; + onbeforecopy: (this: HTMLElement, ev: ClipboardEvent) => any; + onbeforecut: (this: HTMLElement, ev: ClipboardEvent) => any; + onbeforedeactivate: (this: HTMLElement, ev: UIEvent) => any; + onbeforepaste: (this: HTMLElement, ev: ClipboardEvent) => any; + onblur: (this: HTMLElement, ev: FocusEvent) => any; + oncanplay: (this: HTMLElement, ev: Event) => any; + oncanplaythrough: (this: HTMLElement, ev: Event) => any; + onchange: (this: HTMLElement, ev: Event) => any; + onclick: (this: HTMLElement, ev: MouseEvent) => any; + oncontextmenu: (this: HTMLElement, ev: PointerEvent) => any; + oncopy: (this: HTMLElement, ev: ClipboardEvent) => any; + oncuechange: (this: HTMLElement, ev: Event) => any; + oncut: (this: HTMLElement, ev: ClipboardEvent) => any; + ondblclick: (this: HTMLElement, ev: MouseEvent) => any; + ondeactivate: (this: HTMLElement, ev: UIEvent) => any; + ondrag: (this: HTMLElement, ev: DragEvent) => any; + ondragend: (this: HTMLElement, ev: DragEvent) => any; + ondragenter: (this: HTMLElement, ev: DragEvent) => any; + ondragleave: (this: HTMLElement, ev: DragEvent) => any; + ondragover: (this: HTMLElement, ev: DragEvent) => any; + ondragstart: (this: HTMLElement, ev: DragEvent) => any; + ondrop: (this: HTMLElement, ev: DragEvent) => any; + ondurationchange: (this: HTMLElement, ev: Event) => any; + onemptied: (this: HTMLElement, ev: Event) => any; + onended: (this: HTMLElement, ev: MediaStreamErrorEvent) => any; + onerror: (this: HTMLElement, ev: ErrorEvent) => any; + onfocus: (this: HTMLElement, ev: FocusEvent) => any; + oninput: (this: HTMLElement, ev: Event) => any; + oninvalid: (this: HTMLElement, ev: Event) => any; + onkeydown: (this: HTMLElement, ev: KeyboardEvent) => any; + onkeypress: (this: HTMLElement, ev: KeyboardEvent) => any; + onkeyup: (this: HTMLElement, ev: KeyboardEvent) => any; + onload: (this: HTMLElement, ev: Event) => any; + onloadeddata: (this: HTMLElement, ev: Event) => any; + onloadedmetadata: (this: HTMLElement, ev: Event) => any; + onloadstart: (this: HTMLElement, ev: Event) => any; + onmousedown: (this: HTMLElement, ev: MouseEvent) => any; + onmouseenter: (this: HTMLElement, ev: MouseEvent) => any; + onmouseleave: (this: HTMLElement, ev: MouseEvent) => any; + onmousemove: (this: HTMLElement, ev: MouseEvent) => any; + onmouseout: (this: HTMLElement, ev: MouseEvent) => any; + onmouseover: (this: HTMLElement, ev: MouseEvent) => any; + onmouseup: (this: HTMLElement, ev: MouseEvent) => any; + onmousewheel: (this: HTMLElement, ev: WheelEvent) => any; + onmscontentzoom: (this: HTMLElement, ev: UIEvent) => any; + onmsmanipulationstatechanged: (this: HTMLElement, ev: MSManipulationEvent) => any; + onpaste: (this: HTMLElement, ev: ClipboardEvent) => any; + onpause: (this: HTMLElement, ev: Event) => any; + onplay: (this: HTMLElement, ev: Event) => any; + onplaying: (this: HTMLElement, ev: Event) => any; + onprogress: (this: HTMLElement, ev: ProgressEvent) => any; + onratechange: (this: HTMLElement, ev: Event) => any; + onreset: (this: HTMLElement, ev: Event) => any; + onscroll: (this: HTMLElement, ev: UIEvent) => any; + onseeked: (this: HTMLElement, ev: Event) => any; + onseeking: (this: HTMLElement, ev: Event) => any; + onselect: (this: HTMLElement, ev: UIEvent) => any; + onselectstart: (this: HTMLElement, ev: Event) => any; + onstalled: (this: HTMLElement, ev: Event) => any; + onsubmit: (this: HTMLElement, ev: Event) => any; + onsuspend: (this: HTMLElement, ev: Event) => any; + ontimeupdate: (this: HTMLElement, ev: Event) => any; + onvolumechange: (this: HTMLElement, ev: Event) => any; + onwaiting: (this: HTMLElement, ev: Event) => any; + outerText: string; + spellcheck: boolean; + readonly style: CSSStyleDeclaration; + tabIndex: number; + title: string; + blur(): void; + click(): void; + dragDrop(): boolean; + focus(): void; + msGetInputContext(): MSInputMethodContext; + addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLElement: { + prototype: HTMLElement; + new(): HTMLElement; +} + +interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { + /** + * Sets or retrieves the height of the object. + */ + height: string; + hidden: any; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + readonly msPlayToSource: any; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Retrieves the palette used for the embedded document. + */ + readonly palette: string; + /** + * Retrieves the URL of the plug-in used to view an embedded document. + */ + readonly pluginspage: string; + readonly readyState: string; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the height and width units of the embed object. + */ + units: string; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: K, listener: (this: HTMLEmbedElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLEmbedElement: { + prototype: HTMLEmbedElement; + new(): HTMLEmbedElement; +} + +interface HTMLFieldSetElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + name: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + readonly validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + readonly validity: ValidityState; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + readonly willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + addEventListener(type: K, listener: (this: HTMLFieldSetElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFieldSetElement: { + prototype: HTMLFieldSetElement; + new(): HTMLFieldSetElement; +} + +interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { + /** + * Sets or retrieves the current typeface family. + */ + face: string; + addEventListener(type: K, listener: (this: HTMLFontElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFontElement: { + prototype: HTMLFontElement; + new(): HTMLFontElement; +} + +interface HTMLFormControlsCollection extends HTMLCollectionBase { + namedItem(name: string): HTMLCollection | Element | null; +} + +declare var HTMLFormControlsCollection: { + prototype: HTMLFormControlsCollection; + new(): HTMLFormControlsCollection; +} + +interface HTMLFormElement extends HTMLElement { + /** + * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. + */ + acceptCharset: string; + /** + * Sets or retrieves the URL to which the form content is sent for processing. + */ + action: string; + /** + * Specifies whether autocomplete is applied to an editable text field. + */ + autocomplete: string; + /** + * Retrieves a collection, in source order, of all controls in a given form. + */ + readonly elements: HTMLFormControlsCollection; + /** + * Sets or retrieves the MIME encoding for the form. + */ + encoding: string; + /** + * Sets or retrieves the encoding type for the form. + */ + enctype: string; + /** + * Sets or retrieves the number of objects in a collection. + */ + readonly length: number; + /** + * Sets or retrieves how to send the form data to the server. + */ + method: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Designates a form that is not validated when submitted. + */ + noValidate: boolean; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Retrieves a form object or an object from an elements collection. + * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. + * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. + */ + item(name?: any, index?: any): any; + /** + * Retrieves a form object or an object from an elements collection. + */ + namedItem(name: string): any; + /** + * Fires when the user resets a form. + */ + reset(): void; + /** + * Fires when a FORM is about to be submitted. + */ + submit(): void; + addEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [name: string]: any; +} + +declare var HTMLFormElement: { + prototype: HTMLFormElement; + new(): HTMLFormElement; +} + +interface HTMLFrameElementEventMap extends HTMLElementEventMap { + "load": Event; +} + +interface HTMLFrameElement extends HTMLElement, GetSVGDocument { + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Retrieves the document object of the page or frame. + */ + readonly contentDocument: Document; + /** + * Retrieves the object of the specified. + */ + readonly contentWindow: Window; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Sets or retrieves the height of the object. + */ + height: string | number; + /** + * Sets or retrieves a URI to a long description of the object. + */ + longDesc: string; + /** + * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. + */ + marginHeight: string; + /** + * Sets or retrieves the left and right margin widths before displaying the text in a frame. + */ + marginWidth: string; + /** + * Sets or retrieves the frame name. + */ + name: string; + /** + * Sets or retrieves whether the user can resize the frame. + */ + noResize: boolean; + /** + * Raised when the object has been completely received from the server. + */ + onload: (this: HTMLFrameElement, ev: Event) => any; + /** + * Sets or retrieves whether the frame can be scrolled. + */ + scrolling: string; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the width of the object. + */ + width: string | number; + addEventListener(type: K, listener: (this: HTMLFrameElement, ev: HTMLFrameElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFrameElement: { + prototype: HTMLFrameElement; + new(): HTMLFrameElement; +} + +interface HTMLFrameSetElementEventMap extends HTMLElementEventMap { + "afterprint": Event; + "beforeprint": Event; + "beforeunload": BeforeUnloadEvent; + "blur": FocusEvent; + "error": ErrorEvent; + "focus": FocusEvent; + "hashchange": HashChangeEvent; + "load": Event; + "message": MessageEvent; + "offline": Event; + "online": Event; + "orientationchange": Event; + "pagehide": PageTransitionEvent; + "pageshow": PageTransitionEvent; + "popstate": PopStateEvent; + "resize": UIEvent; + "scroll": UIEvent; + "storage": StorageEvent; + "unload": Event; +} + +interface HTMLFrameSetElement extends HTMLElement { + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Sets or retrieves the frame widths of the object. + */ + cols: string; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + name: string; + onafterprint: (this: HTMLFrameSetElement, ev: Event) => any; + onbeforeprint: (this: HTMLFrameSetElement, ev: Event) => any; + onbeforeunload: (this: HTMLFrameSetElement, ev: BeforeUnloadEvent) => any; + /** + * Fires when the object loses the input focus. + */ + onblur: (this: HTMLFrameSetElement, ev: FocusEvent) => any; + onerror: (this: HTMLFrameSetElement, ev: ErrorEvent) => any; + /** + * Fires when the object receives focus. + */ + onfocus: (this: HTMLFrameSetElement, ev: FocusEvent) => any; + onhashchange: (this: HTMLFrameSetElement, ev: HashChangeEvent) => any; + onload: (this: HTMLFrameSetElement, ev: Event) => any; + onmessage: (this: HTMLFrameSetElement, ev: MessageEvent) => any; + onoffline: (this: HTMLFrameSetElement, ev: Event) => any; + ononline: (this: HTMLFrameSetElement, ev: Event) => any; + onorientationchange: (this: HTMLFrameSetElement, ev: Event) => any; + onpagehide: (this: HTMLFrameSetElement, ev: PageTransitionEvent) => any; + onpageshow: (this: HTMLFrameSetElement, ev: PageTransitionEvent) => any; + onpopstate: (this: HTMLFrameSetElement, ev: PopStateEvent) => any; + onresize: (this: HTMLFrameSetElement, ev: UIEvent) => any; + onscroll: (this: HTMLFrameSetElement, ev: UIEvent) => any; + onstorage: (this: HTMLFrameSetElement, ev: StorageEvent) => any; + onunload: (this: HTMLFrameSetElement, ev: Event) => any; + /** + * Sets or retrieves the frame heights of the object. + */ + rows: string; + addEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFrameSetElement: { + prototype: HTMLFrameSetElement; + new(): HTMLFrameSetElement; +} + +interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. + */ + noShade: boolean; + /** + * Sets or retrieves the width of the object. + */ + width: number; + addEventListener(type: K, listener: (this: HTMLHRElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLHRElement: { + prototype: HTMLHRElement; + new(): HTMLHRElement; +} + +interface HTMLHeadElement extends HTMLElement { + profile: string; + addEventListener(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLHeadElement: { + prototype: HTMLHeadElement; + new(): HTMLHeadElement; +} + +interface HTMLHeadingElement extends HTMLElement { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + addEventListener(type: K, listener: (this: HTMLHeadingElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLHeadingElement: { + prototype: HTMLHeadingElement; + new(): HTMLHeadingElement; +} + +interface HTMLHtmlElement extends HTMLElement { + /** + * Sets or retrieves the DTD version that governs the current document. + */ + version: string; + addEventListener(type: K, listener: (this: HTMLHtmlElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLHtmlElement: { + prototype: HTMLHtmlElement; + new(): HTMLHtmlElement; +} + +interface HTMLIFrameElementEventMap extends HTMLElementEventMap { + "load": Event; +} + +interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + allowFullscreen: boolean; + allowPaymentRequest: boolean; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Retrieves the document object of the page or frame. + */ + readonly contentDocument: Document; + /** + * Retrieves the object of the specified. + */ + readonly contentWindow: Window; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Sets or retrieves the horizontal margin for the object. + */ + hspace: number; + /** + * Sets or retrieves a URI to a long description of the object. + */ + longDesc: string; + /** + * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. + */ + marginHeight: string; + /** + * Sets or retrieves the left and right margin widths before displaying the text in a frame. + */ + marginWidth: string; + /** + * Sets or retrieves the frame name. + */ + name: string; + /** + * Sets or retrieves whether the user can resize the frame. + */ + noResize: boolean; + /** + * Raised when the object has been completely received from the server. + */ + onload: (this: HTMLIFrameElement, ev: Event) => any; + readonly sandbox: DOMSettableTokenList; + /** + * Sets or retrieves whether the frame can be scrolled. + */ + scrolling: string; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLIFrameElement: { + prototype: HTMLIFrameElement; + new(): HTMLIFrameElement; +} + +interface HTMLImageElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Retrieves whether the object is fully loaded. + */ + readonly complete: boolean; + crossOrigin: string | null; + readonly currentSrc: string; + /** + * Sets or retrieves the height of the object. + */ + height: number; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + hspace: number; + /** + * Sets or retrieves whether the image is a server-side image map. + */ + isMap: boolean; + /** + * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. + */ + longDesc: string; + lowsrc: string; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + readonly msPlayToSource: any; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * The original height of the image resource before sizing. + */ + readonly naturalHeight: number; + /** + * The original width of the image resource before sizing. + */ + readonly naturalWidth: number; + sizes: string; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + srcset: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: number; + readonly x: number; + readonly y: number; + msGetAsCastingSource(): any; + addEventListener(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLImageElement: { + prototype: HTMLImageElement; + new(): HTMLImageElement; +} + +interface HTMLInputElement extends HTMLElement { + /** + * Sets or retrieves a comma-separated list of content types. + */ + accept: string; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Specifies whether autocomplete is applied to an editable text field. + */ + autocomplete: string; + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + border: string; + /** + * Sets or retrieves the state of the check box or radio button. + */ + checked: boolean; + /** + * Retrieves whether the object is fully loaded. + */ + readonly complete: boolean; + /** + * Sets or retrieves the state of the check box or radio button. + */ + defaultChecked: boolean; + /** + * Sets or retrieves the initial contents of the object. + */ + defaultValue: string; + disabled: boolean; + /** + * Returns a FileList object on a file type input object. + */ + readonly files: FileList | null; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Overrides the action attribute (where the data on a form is sent) on the parent form element. + */ + formAction: string; + /** + * Used to override the encoding (formEnctype attribute) specified on the form element. + */ + formEnctype: string; + /** + * Overrides the submit method attribute previously specified on a form element. + */ + formMethod: string; + /** + * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + */ + formNoValidate: string; + /** + * Overrides the target attribute on a form element. + */ + formTarget: string; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + hspace: number; + indeterminate: boolean; + /** + * Specifies the ID of a pre-defined datalist of options for an input element. + */ + readonly list: HTMLElement; + /** + * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. + */ + max: string; + /** + * Sets or retrieves the maximum number of characters that the user can enter in a text control. + */ + maxLength: number; + /** + * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. + */ + min: string; + /** + * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. + */ + multiple: boolean; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Gets or sets a string containing a regular expression that the user's input must match. + */ + pattern: string; + /** + * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. + */ + placeholder: string; + readOnly: boolean; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + selectionDirection: string; + /** + * Gets or sets the end position or offset of a text selection. + */ + selectionEnd: number; + /** + * Gets or sets the starting position or offset of a text selection. + */ + selectionStart: number; + size: number; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + status: boolean; + /** + * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. + */ + step: string; + /** + * Returns the content type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + readonly validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + readonly validity: ValidityState; + /** + * Returns the value of the data at the cursor's current position. + */ + value: string; + valueAsDate: Date; + /** + * Returns the input field value as a number. + */ + valueAsNumber: number; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + webkitdirectory: boolean; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + readonly willValidate: boolean; + minLength: number; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Makes the selection equal to the current object. + */ + select(): void; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + /** + * Sets the start and end positions of a selection in a text field. + * @param start The offset into the text field for the start of the selection. + * @param end The offset into the text field for the end of the selection. + */ + setSelectionRange(start?: number, end?: number, direction?: string): void; + /** + * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. + * @param n Value to decrement the value by. + */ + stepDown(n?: number): void; + /** + * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. + * @param n Value to increment the value by. + */ + stepUp(n?: number): void; + addEventListener(type: K, listener: (this: HTMLInputElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLInputElement: { + prototype: HTMLInputElement; + new(): HTMLInputElement; +} + +interface HTMLLIElement extends HTMLElement { + type: string; + /** + * Sets or retrieves the value of a list item. + */ + value: number; + addEventListener(type: K, listener: (this: HTMLLIElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLLIElement: { + prototype: HTMLLIElement; + new(): HTMLLIElement; +} + +interface HTMLLabelElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Sets or retrieves the object to which the given label object is assigned. + */ + htmlFor: string; + addEventListener(type: K, listener: (this: HTMLLabelElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLLabelElement: { + prototype: HTMLLabelElement; + new(): HTMLLabelElement; +} + +interface HTMLLegendElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + align: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + addEventListener(type: K, listener: (this: HTMLLegendElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLLegendElement: { + prototype: HTMLLegendElement; + new(): HTMLLegendElement; +} + +interface HTMLLinkElement extends HTMLElement, LinkStyle { + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + disabled: boolean; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or retrieves the language code of the object. + */ + hreflang: string; + /** + * Sets or retrieves the media type. + */ + media: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rel: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rev: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Sets or retrieves the MIME type of the object. + */ + type: string; + import?: Document; + integrity: string; + addEventListener(type: K, listener: (this: HTMLLinkElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLLinkElement: { + prototype: HTMLLinkElement; + new(): HTMLLinkElement; +} + +interface HTMLMapElement extends HTMLElement { + /** + * Retrieves a collection of the area objects defined for the given map object. + */ + readonly areas: HTMLAreasCollection; + /** + * Sets or retrieves the name of the object. + */ + name: string; + addEventListener(type: K, listener: (this: HTMLMapElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMapElement: { + prototype: HTMLMapElement; + new(): HTMLMapElement; +} + +interface HTMLMarqueeElementEventMap extends HTMLElementEventMap { + "bounce": Event; + "finish": Event; + "start": Event; +} + +interface HTMLMarqueeElement extends HTMLElement { + behavior: string; + bgColor: any; + direction: string; + height: string; + hspace: number; + loop: number; + onbounce: (this: HTMLMarqueeElement, ev: Event) => any; + onfinish: (this: HTMLMarqueeElement, ev: Event) => any; + onstart: (this: HTMLMarqueeElement, ev: Event) => any; + scrollAmount: number; + scrollDelay: number; + trueSpeed: boolean; + vspace: number; + width: string; + start(): void; + stop(): void; + addEventListener(type: K, listener: (this: HTMLMarqueeElement, ev: HTMLMarqueeElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMarqueeElement: { + prototype: HTMLMarqueeElement; + new(): HTMLMarqueeElement; +} + +interface HTMLMediaElementEventMap extends HTMLElementEventMap { + "encrypted": MediaEncryptedEvent; + "msneedkey": MSMediaKeyNeededEvent; +} + +interface HTMLMediaElement extends HTMLElement { + /** + * Returns an AudioTrackList object with the audio tracks for a given video element. + */ + readonly audioTracks: AudioTrackList; + /** + * Gets or sets a value that indicates whether to start playing the media automatically. + */ + autoplay: boolean; + /** + * Gets a collection of buffered time ranges. + */ + readonly buffered: TimeRanges; + /** + * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). + */ + controls: boolean; + crossOrigin: string | null; + /** + * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. + */ + readonly currentSrc: string; + /** + * Gets or sets the current playback position, in seconds. + */ + currentTime: number; + defaultMuted: boolean; + /** + * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. + */ + defaultPlaybackRate: number; + /** + * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. + */ + readonly duration: number; + /** + * Gets information about whether the playback has ended or not. + */ + readonly ended: boolean; + /** + * Returns an object representing the current error state of the audio or video element. + */ + readonly error: MediaError; + /** + * Gets or sets a flag to specify whether playback should restart after it completes. + */ + loop: boolean; + readonly mediaKeys: MediaKeys | null; + /** + * Specifies the purpose of the audio or video media, such as background audio or alerts. + */ + msAudioCategory: string; + /** + * Specifies the output device id that the audio will be sent to. + */ + msAudioDeviceType: string; + readonly msGraphicsTrustStatus: MSGraphicsTrust; + /** + * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. + */ + readonly msKeys: MSMediaKeys; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + readonly msPlayToSource: any; + /** + * Specifies whether or not to enable low-latency playback on the media element. + */ + msRealTime: boolean; + /** + * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. + */ + muted: boolean; + /** + * Gets the current network activity for the element. + */ + readonly networkState: number; + onencrypted: (this: HTMLMediaElement, ev: MediaEncryptedEvent) => any; + onmsneedkey: (this: HTMLMediaElement, ev: MSMediaKeyNeededEvent) => any; + /** + * Gets a flag that specifies whether playback is paused. + */ + readonly paused: boolean; + /** + * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. + */ + playbackRate: number; + /** + * Gets TimeRanges for the current media resource that has been played. + */ + readonly played: TimeRanges; + /** + * Gets or sets the current playback position, in seconds. + */ + preload: string; + readyState: number; + /** + * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. + */ + readonly seekable: TimeRanges; + /** + * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. + */ + readonly seeking: boolean; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + srcObject: MediaStream | null; + readonly textTracks: TextTrackList; + readonly videoTracks: VideoTrackList; + /** + * Gets or sets the volume level for audio portions of the media element. + */ + volume: number; + addTextTrack(kind: string, label?: string, language?: string): TextTrack; + /** + * Returns a string that specifies whether the client can play a given media resource type. + */ + canPlayType(type: string): string; + /** + * Resets the audio or video object and loads a new media resource. + */ + load(): void; + /** + * Clears all effects from the media pipeline. + */ + msClearEffects(): void; + msGetAsCastingSource(): any; + /** + * Inserts the specified audio effect into media pipeline. + */ + msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; + msSetMediaKeys(mediaKeys: MSMediaKeys): void; + /** + * Specifies the media protection manager for a given media pipeline. + */ + msSetMediaProtectionManager(mediaProtectionManager?: any): void; + /** + * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. + */ + pause(): void; + /** + * Loads and starts playback of a media resource. + */ + play(): void; + setMediaKeys(mediaKeys: MediaKeys | null): Promise; + readonly HAVE_CURRENT_DATA: number; + readonly HAVE_ENOUGH_DATA: number; + readonly HAVE_FUTURE_DATA: number; + readonly HAVE_METADATA: number; + readonly HAVE_NOTHING: number; + readonly NETWORK_EMPTY: number; + readonly NETWORK_IDLE: number; + readonly NETWORK_LOADING: number; + readonly NETWORK_NO_SOURCE: number; + addEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMediaElement: { + prototype: HTMLMediaElement; + new(): HTMLMediaElement; + readonly HAVE_CURRENT_DATA: number; + readonly HAVE_ENOUGH_DATA: number; + readonly HAVE_FUTURE_DATA: number; + readonly HAVE_METADATA: number; + readonly HAVE_NOTHING: number; + readonly NETWORK_EMPTY: number; + readonly NETWORK_IDLE: number; + readonly NETWORK_LOADING: number; + readonly NETWORK_NO_SOURCE: number; +} + +interface HTMLMenuElement extends HTMLElement { + compact: boolean; + type: string; + addEventListener(type: K, listener: (this: HTMLMenuElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMenuElement: { + prototype: HTMLMenuElement; + new(): HTMLMenuElement; +} + +interface HTMLMetaElement extends HTMLElement { + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Gets or sets meta-information to associate with httpEquiv or name. + */ + content: string; + /** + * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. + */ + httpEquiv: string; + /** + * Sets or retrieves the value specified in the content attribute of the meta object. + */ + name: string; + /** + * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. + */ + scheme: string; + /** + * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. + */ + url: string; + addEventListener(type: K, listener: (this: HTMLMetaElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMetaElement: { + prototype: HTMLMetaElement; + new(): HTMLMetaElement; +} + +interface HTMLMeterElement extends HTMLElement { + high: number; + low: number; + max: number; + min: number; + optimum: number; + value: number; + addEventListener(type: K, listener: (this: HTMLMeterElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMeterElement: { + prototype: HTMLMeterElement; + new(): HTMLMeterElement; +} + +interface HTMLModElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; + addEventListener(type: K, listener: (this: HTMLModElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLModElement: { + prototype: HTMLModElement; + new(): HTMLModElement; +} + +interface HTMLOListElement extends HTMLElement { + compact: boolean; + /** + * The starting number. + */ + start: number; + type: string; + addEventListener(type: K, listener: (this: HTMLOListElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLOListElement: { + prototype: HTMLOListElement; + new(): HTMLOListElement; +} + +interface HTMLObjectElement extends HTMLElement, GetSVGDocument { + /** + * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. + */ + readonly BaseHref: string; + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Gets or sets the optional alternative HTML script to execute if the object fails to load. + */ + altHtml: string; + /** + * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. + */ + archive: string; + border: string; + /** + * Sets or retrieves the URL of the file containing the compiled Java class. + */ + code: string; + /** + * Sets or retrieves the URL of the component. + */ + codeBase: string; + /** + * Sets or retrieves the Internet media type for the code associated with the object. + */ + codeType: string; + /** + * Retrieves the document object of the page or frame. + */ + readonly contentDocument: Document; + /** + * Sets or retrieves the URL that references the data of the object. + */ + data: string; + declare: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Sets or retrieves the height of the object. + */ + height: string; + hspace: number; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + readonly msPlayToSource: any; + /** + * Sets or retrieves the name of the object. + */ + name: string; + readonly readyState: number; + /** + * Sets or retrieves a message to be displayed while an object is loading. + */ + standby: string; + /** + * Sets or retrieves the MIME type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + readonly validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + readonly validity: ValidityState; + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + readonly willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + addEventListener(type: K, listener: (this: HTMLObjectElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLObjectElement: { + prototype: HTMLObjectElement; + new(): HTMLObjectElement; +} + +interface HTMLOptGroupElement extends HTMLElement { + /** + * Sets or retrieves the status of an option. + */ + defaultSelected: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Sets or retrieves the ordinal position of an option in a list box. + */ + readonly index: number; + /** + * Sets or retrieves a value that you can use to implement your own label functionality for the object. + */ + label: string; + /** + * Sets or retrieves whether the option in the list box is the default item. + */ + selected: boolean; + /** + * Sets or retrieves the text string specified by the option tag. + */ + readonly text: string; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; + addEventListener(type: K, listener: (this: HTMLOptGroupElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLOptGroupElement: { + prototype: HTMLOptGroupElement; + new(): HTMLOptGroupElement; +} + +interface HTMLOptionElement extends HTMLElement { + /** + * Sets or retrieves the status of an option. + */ + defaultSelected: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Sets or retrieves the ordinal position of an option in a list box. + */ + readonly index: number; + /** + * Sets or retrieves a value that you can use to implement your own label functionality for the object. + */ + label: string; + /** + * Sets or retrieves whether the option in the list box is the default item. + */ + selected: boolean; + /** + * Sets or retrieves the text string specified by the option tag. + */ + text: string; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; + addEventListener(type: K, listener: (this: HTMLOptionElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLOptionElement: { + prototype: HTMLOptionElement; + new(): HTMLOptionElement; +} + +interface HTMLOptionsCollection extends HTMLCollectionOf { + length: number; + selectedIndex: number; + add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number): void; + remove(index: number): void; +} + +declare var HTMLOptionsCollection: { + prototype: HTMLOptionsCollection; + new(): HTMLOptionsCollection; +} + +interface HTMLOutputElement extends HTMLElement { + defaultValue: string; + readonly form: HTMLFormElement; + readonly htmlFor: DOMSettableTokenList; + name: string; + readonly type: string; + readonly validationMessage: string; + readonly validity: ValidityState; + value: string; + readonly willValidate: boolean; + checkValidity(): boolean; + reportValidity(): boolean; + setCustomValidity(error: string): void; + addEventListener(type: K, listener: (this: HTMLOutputElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLOutputElement: { + prototype: HTMLOutputElement; + new(): HTMLOutputElement; +} + +interface HTMLParagraphElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + clear: string; + addEventListener(type: K, listener: (this: HTMLParagraphElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLParagraphElement: { + prototype: HTMLParagraphElement; + new(): HTMLParagraphElement; +} + +interface HTMLParamElement extends HTMLElement { + /** + * Sets or retrieves the name of an input parameter for an element. + */ + name: string; + /** + * Sets or retrieves the content type of the resource designated by the value attribute. + */ + type: string; + /** + * Sets or retrieves the value of an input parameter for an element. + */ + value: string; + /** + * Sets or retrieves the data type of the value attribute. + */ + valueType: string; + addEventListener(type: K, listener: (this: HTMLParamElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLParamElement: { + prototype: HTMLParamElement; + new(): HTMLParamElement; +} + +interface HTMLPictureElement extends HTMLElement { + addEventListener(type: K, listener: (this: HTMLPictureElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLPictureElement: { + prototype: HTMLPictureElement; + new(): HTMLPictureElement; +} + +interface HTMLPreElement extends HTMLElement { + /** + * Sets or gets a value that you can use to implement your own width functionality for the object. + */ + width: number; + addEventListener(type: K, listener: (this: HTMLPreElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLPreElement: { + prototype: HTMLPreElement; + new(): HTMLPreElement; +} + +interface HTMLProgressElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Defines the maximum, or "done" value for a progress element. + */ + max: number; + /** + * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). + */ + readonly position: number; + /** + * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. + */ + value: number; + addEventListener(type: K, listener: (this: HTMLProgressElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLProgressElement: { + prototype: HTMLProgressElement; + new(): HTMLProgressElement; +} + +interface HTMLQuoteElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + addEventListener(type: K, listener: (this: HTMLQuoteElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLQuoteElement: { + prototype: HTMLQuoteElement; + new(): HTMLQuoteElement; +} + +interface HTMLScriptElement extends HTMLElement { + async: boolean; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + crossOrigin: string | null; + /** + * Sets or retrieves the status of the script. + */ + defer: boolean; + /** + * Sets or retrieves the event for which the script is written. + */ + event: string; + /** + * Sets or retrieves the object that is bound to the event script. + */ + htmlFor: string; + /** + * Retrieves the URL to an external file that contains the source code or data. + */ + src: string; + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + /** + * Sets or retrieves the MIME type for the associated scripting engine. + */ + type: string; + integrity: string; + addEventListener(type: K, listener: (this: HTMLScriptElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLScriptElement: { + prototype: HTMLScriptElement; + new(): HTMLScriptElement; +} + +interface HTMLSelectElement extends HTMLElement { + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Sets or retrieves the number of objects in a collection. + */ + length: number; + /** + * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. + */ + multiple: boolean; + /** + * Sets or retrieves the name of the object. + */ + name: string; + readonly options: HTMLOptionsCollection; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Sets or retrieves the index of the selected option in a select object. + */ + selectedIndex: number; + selectedOptions: HTMLCollectionOf; + /** + * Sets or retrieves the number of rows in the list box. + */ + size: number; + /** + * Retrieves the type of select control based on the value of the MULTIPLE attribute. + */ + readonly type: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + readonly validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + readonly validity: ValidityState; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + readonly willValidate: boolean; + /** + * Adds an element to the areas, controlRange, or options collection. + * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. + * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection. + */ + add(element: HTMLElement, before?: HTMLElement | number): void; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Retrieves a select object or an object from an options collection. + * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. + * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. + */ + item(name?: any, index?: any): any; + /** + * Retrieves a select object or an object from an options collection. + * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made. + */ + namedItem(name: string): any; + /** + * Removes an element from the collection. + * @param index Number that specifies the zero-based index of the element to remove from the collection. + */ + remove(index?: number): void; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + addEventListener(type: K, listener: (this: HTMLSelectElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [name: string]: any; +} + +declare var HTMLSelectElement: { + prototype: HTMLSelectElement; + new(): HTMLSelectElement; +} + +interface HTMLSourceElement extends HTMLElement { + /** + * Gets or sets the intended media type of the media source. + */ + media: string; + msKeySystem: string; + sizes: string; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + srcset: string; + /** + * Gets or sets the MIME type of a media resource. + */ + type: string; + addEventListener(type: K, listener: (this: HTMLSourceElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLSourceElement: { + prototype: HTMLSourceElement; + new(): HTMLSourceElement; +} + +interface HTMLSpanElement extends HTMLElement { + addEventListener(type: K, listener: (this: HTMLSpanElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLSpanElement: { + prototype: HTMLSpanElement; + new(): HTMLSpanElement; +} + +interface HTMLStyleElement extends HTMLElement, LinkStyle { + disabled: boolean; + /** + * Sets or retrieves the media type. + */ + media: string; + /** + * Retrieves the CSS language in which the style sheet is written. + */ + type: string; + addEventListener(type: K, listener: (this: HTMLStyleElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLStyleElement: { + prototype: HTMLStyleElement; + new(): HTMLStyleElement; +} + +interface HTMLTableCaptionElement extends HTMLElement { + /** + * Sets or retrieves the alignment of the caption or legend. + */ + align: string; + /** + * Sets or retrieves whether the caption appears at the top or bottom of the table. + */ + vAlign: string; + addEventListener(type: K, listener: (this: HTMLTableCaptionElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableCaptionElement: { + prototype: HTMLTableCaptionElement; + new(): HTMLTableCaptionElement; +} + +interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves abbreviated text for the object. + */ + abbr: string; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. + */ + axis: string; + bgColor: any; + /** + * Retrieves the position of the object in the cells collection of a row. + */ + readonly cellIndex: number; + /** + * Sets or retrieves the number columns in the table that the object should span. + */ + colSpan: number; + /** + * Sets or retrieves a list of header cells that provide information for the object. + */ + headers: string; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; + /** + * Sets or retrieves how many rows in a table the cell should span. + */ + rowSpan: number; + /** + * Sets or retrieves the group of cells in a table to which the object's information applies. + */ + scope: string; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: K, listener: (this: HTMLTableCellElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableCellElement: { + prototype: HTMLTableCellElement; + new(): HTMLTableCellElement; +} + +interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves the alignment of the object relative to the display or table. + */ + align: string; + /** + * Sets or retrieves the number of columns in the group. + */ + span: number; + /** + * Sets or retrieves the width of the object. + */ + width: any; + addEventListener(type: K, listener: (this: HTMLTableColElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableColElement: { + prototype: HTMLTableColElement; + new(): HTMLTableColElement; +} + +interface HTMLTableDataCellElement extends HTMLTableCellElement { + addEventListener(type: K, listener: (this: HTMLTableDataCellElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableDataCellElement: { + prototype: HTMLTableDataCellElement; + new(): HTMLTableDataCellElement; +} + +interface HTMLTableElement extends HTMLElement { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + bgColor: any; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Retrieves the caption object of a table. + */ + caption: HTMLTableCaptionElement; + /** + * Sets or retrieves the amount of space between the border of the cell and the content of the cell. + */ + cellPadding: string; + /** + * Sets or retrieves the amount of space between cells in a table. + */ + cellSpacing: string; + /** + * Sets or retrieves the number of columns in the table. + */ + cols: number; + /** + * Sets or retrieves the way the border frame around the table is displayed. + */ + frame: string; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: HTMLCollectionOf; + /** + * Sets or retrieves which dividing lines (inner borders) are displayed. + */ + rules: string; + /** + * Sets or retrieves a description and/or structure of the object. + */ + summary: string; + /** + * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. + */ + tBodies: HTMLCollectionOf; + /** + * Retrieves the tFoot object of the table. + */ + tFoot: HTMLTableSectionElement; + /** + * Retrieves the tHead object of the table. + */ + tHead: HTMLTableSectionElement; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Creates an empty caption element in the table. + */ + createCaption(): HTMLTableCaptionElement; + /** + * Creates an empty tBody element in the table. + */ + createTBody(): HTMLTableSectionElement; + /** + * Creates an empty tFoot element in the table. + */ + createTFoot(): HTMLTableSectionElement; + /** + * Returns the tHead element object if successful, or null otherwise. + */ + createTHead(): HTMLTableSectionElement; + /** + * Deletes the caption element and its contents from the table. + */ + deleteCaption(): void; + /** + * Removes the specified row (tr) from the element and from the rows collection. + * @param index Number that specifies the zero-based position in the rows collection of the row to remove. + */ + deleteRow(index?: number): void; + /** + * Deletes the tFoot element and its contents from the table. + */ + deleteTFoot(): void; + /** + * Deletes the tHead element and its contents from the table. + */ + deleteTHead(): void; + /** + * Creates a new row (tr) in the table, and adds the row to the rows collection. + * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. + */ + insertRow(index?: number): HTMLTableRowElement; + addEventListener(type: K, listener: (this: HTMLTableElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableElement: { + prototype: HTMLTableElement; + new(): HTMLTableElement; +} + +interface HTMLTableHeaderCellElement extends HTMLTableCellElement { + /** + * Sets or retrieves the group of cells in a table to which the object's information applies. + */ + scope: string; + addEventListener(type: K, listener: (this: HTMLTableHeaderCellElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableHeaderCellElement: { + prototype: HTMLTableHeaderCellElement; + new(): HTMLTableHeaderCellElement; +} + +interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + bgColor: any; + /** + * Retrieves a collection of all cells in the table row. + */ + cells: HTMLCollectionOf; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Retrieves the position of the object in the rows collection for the table. + */ + readonly rowIndex: number; + /** + * Retrieves the position of the object in the collection. + */ + readonly sectionRowIndex: number; + /** + * Removes the specified cell from the table row, as well as from the cells collection. + * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted. + */ + deleteCell(index?: number): void; + /** + * Creates a new cell in the table row, and adds the cell to the cells collection. + * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. + */ + insertCell(index?: number): HTMLTableDataCellElement; + addEventListener(type: K, listener: (this: HTMLTableRowElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableRowElement: { + prototype: HTMLTableRowElement; + new(): HTMLTableRowElement; +} + +interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: HTMLCollectionOf; + /** + * Removes the specified row (tr) from the element and from the rows collection. + * @param index Number that specifies the zero-based position in the rows collection of the row to remove. + */ + deleteRow(index?: number): void; + /** + * Creates a new row (tr) in the table, and adds the row to the rows collection. + * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. + */ + insertRow(index?: number): HTMLTableRowElement; + addEventListener(type: K, listener: (this: HTMLTableSectionElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableSectionElement: { + prototype: HTMLTableSectionElement; + new(): HTMLTableSectionElement; +} + +interface HTMLTemplateElement extends HTMLElement { + readonly content: DocumentFragment; + addEventListener(type: K, listener: (this: HTMLTemplateElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTemplateElement: { + prototype: HTMLTemplateElement; + new(): HTMLTemplateElement; +} + +interface HTMLTextAreaElement extends HTMLElement { + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * Sets or retrieves the width of the object. + */ + cols: number; + /** + * Sets or retrieves the initial contents of the object. + */ + defaultValue: string; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + readonly form: HTMLFormElement; + /** + * Sets or retrieves the maximum number of characters that the user can enter in a text control. + */ + maxLength: number; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. + */ + placeholder: string; + /** + * Sets or retrieves the value indicated whether the content of the object is read-only. + */ + readOnly: boolean; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: number; + /** + * Gets or sets the end position or offset of a text selection. + */ + selectionEnd: number; + /** + * Gets or sets the starting position or offset of a text selection. + */ + selectionStart: number; + /** + * Sets or retrieves the value indicating whether the control is selected. + */ + status: any; + /** + * Retrieves the type of control. + */ + readonly type: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + readonly validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + readonly validity: ValidityState; + /** + * Retrieves or sets the text in the entry field of the textArea element. + */ + value: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + readonly willValidate: boolean; + /** + * Sets or retrieves how to handle wordwrapping in the object. + */ + wrap: string; + minLength: number; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Highlights the input area of a form element. + */ + select(): void; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + /** + * Sets the start and end positions of a selection in a text field. + * @param start The offset into the text field for the start of the selection. + * @param end The offset into the text field for the end of the selection. + */ + setSelectionRange(start: number, end: number): void; + addEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTextAreaElement: { + prototype: HTMLTextAreaElement; + new(): HTMLTextAreaElement; +} + +interface HTMLTimeElement extends HTMLElement { + dateTime: string; + addEventListener(type: K, listener: (this: HTMLTimeElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTimeElement: { + prototype: HTMLTimeElement; + new(): HTMLTimeElement; +} + +interface HTMLTitleElement extends HTMLElement { + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + addEventListener(type: K, listener: (this: HTMLTitleElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTitleElement: { + prototype: HTMLTitleElement; + new(): HTMLTitleElement; +} + +interface HTMLTrackElement extends HTMLElement { + default: boolean; + kind: string; + label: string; + readonly readyState: number; + src: string; + srclang: string; + readonly track: TextTrack; + readonly ERROR: number; + readonly LOADED: number; + readonly LOADING: number; + readonly NONE: number; + addEventListener(type: K, listener: (this: HTMLTrackElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTrackElement: { + prototype: HTMLTrackElement; + new(): HTMLTrackElement; + readonly ERROR: number; + readonly LOADED: number; + readonly LOADING: number; + readonly NONE: number; +} + +interface HTMLUListElement extends HTMLElement { + compact: boolean; + type: string; + addEventListener(type: K, listener: (this: HTMLUListElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLUListElement: { + prototype: HTMLUListElement; + new(): HTMLUListElement; +} + +interface HTMLUnknownElement extends HTMLElement { + addEventListener(type: K, listener: (this: HTMLUnknownElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLUnknownElement: { + prototype: HTMLUnknownElement; + new(): HTMLUnknownElement; +} + +interface HTMLVideoElementEventMap extends HTMLMediaElementEventMap { + "MSVideoFormatChanged": Event; + "MSVideoFrameStepCompleted": Event; + "MSVideoOptimalLayoutChanged": Event; +} + +interface HTMLVideoElement extends HTMLMediaElement { + /** + * Gets or sets the height of the video element. + */ + height: number; + msHorizontalMirror: boolean; + readonly msIsLayoutOptimalForPlayback: boolean; + readonly msIsStereo3D: boolean; + msStereo3DPackingMode: string; + msStereo3DRenderMode: string; + msZoom: boolean; + onMSVideoFormatChanged: (this: HTMLVideoElement, ev: Event) => any; + onMSVideoFrameStepCompleted: (this: HTMLVideoElement, ev: Event) => any; + onMSVideoOptimalLayoutChanged: (this: HTMLVideoElement, ev: Event) => any; + /** + * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. + */ + poster: string; + /** + * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. + */ + readonly videoHeight: number; + /** + * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. + */ + readonly videoWidth: number; + readonly webkitDisplayingFullscreen: boolean; + readonly webkitSupportsFullscreen: boolean; + /** + * Gets or sets the width of the video element. + */ + width: number; + getVideoPlaybackQuality(): VideoPlaybackQuality; + msFrameStep(forward: boolean): void; + msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; + msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; + webkitEnterFullScreen(): void; + webkitEnterFullscreen(): void; + webkitExitFullScreen(): void; + webkitExitFullscreen(): void; + addEventListener(type: K, listener: (this: HTMLVideoElement, ev: HTMLVideoElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLVideoElement: { + prototype: HTMLVideoElement; + new(): HTMLVideoElement; +} + +interface HashChangeEvent extends Event { + readonly newURL: string | null; + readonly oldURL: string | null; +} + +declare var HashChangeEvent: { + prototype: HashChangeEvent; + new(typeArg: string, eventInitDict?: HashChangeEventInit): HashChangeEvent; +} + +interface Headers { + append(name: string, value: string): void; + delete(name: string): void; + forEach(callback: ForEachCallback): void; + get(name: string): string | null; + has(name: string): boolean; + set(name: string, value: string): void; +} + +declare var Headers: { + prototype: Headers; + new(init?: any): Headers; +} + +interface History { + readonly length: number; + readonly state: any; + scrollRestoration: ScrollRestoration; + back(): void; + forward(): void; + go(delta?: number): void; + pushState(data: any, title: string, url?: string | null): void; + replaceState(data: any, title: string, url?: string | null): void; +} + +declare var History: { + prototype: History; + new(): History; +} + +interface IDBCursor { + readonly direction: IDBCursorDirection; + key: IDBKeyRange | IDBValidKey; + readonly primaryKey: any; + source: IDBObjectStore | IDBIndex; + advance(count: number): void; + continue(key?: IDBKeyRange | IDBValidKey): void; + delete(): IDBRequest; + update(value: any): IDBRequest; + readonly NEXT: string; + readonly NEXT_NO_DUPLICATE: string; + readonly PREV: string; + readonly PREV_NO_DUPLICATE: string; +} + +declare var IDBCursor: { + prototype: IDBCursor; + new(): IDBCursor; + readonly NEXT: string; + readonly NEXT_NO_DUPLICATE: string; + readonly PREV: string; + readonly PREV_NO_DUPLICATE: string; +} + +interface IDBCursorWithValue extends IDBCursor { + readonly value: any; +} + +declare var IDBCursorWithValue: { + prototype: IDBCursorWithValue; + new(): IDBCursorWithValue; +} + +interface IDBDatabaseEventMap { + "abort": Event; + "error": Event; +} + +interface IDBDatabase extends EventTarget { + readonly name: string; + readonly objectStoreNames: DOMStringList; + onabort: (this: IDBDatabase, ev: Event) => any; + onerror: (this: IDBDatabase, ev: Event) => any; + version: number; + onversionchange: (ev: IDBVersionChangeEvent) => any; + close(): void; + createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore; + deleteObjectStore(name: string): void; + transaction(storeNames: string | string[], mode?: string): IDBTransaction; + addEventListener(type: "versionchange", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBDatabase: { + prototype: IDBDatabase; + new(): IDBDatabase; +} + +interface IDBFactory { + cmp(first: any, second: any): number; + deleteDatabase(name: string): IDBOpenDBRequest; + open(name: string, version?: number): IDBOpenDBRequest; +} + +declare var IDBFactory: { + prototype: IDBFactory; + new(): IDBFactory; +} + +interface IDBIndex { + keyPath: string | string[]; + readonly name: string; + readonly objectStore: IDBObjectStore; + readonly unique: boolean; + multiEntry: boolean; + count(key?: IDBKeyRange | IDBValidKey): IDBRequest; + get(key: IDBKeyRange | IDBValidKey): IDBRequest; + getKey(key: IDBKeyRange | IDBValidKey): IDBRequest; + openCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; + openKeyCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; +} + +declare var IDBIndex: { + prototype: IDBIndex; + new(): IDBIndex; +} + +interface IDBKeyRange { + readonly lower: any; + readonly lowerOpen: boolean; + readonly upper: any; + readonly upperOpen: boolean; +} + +declare var IDBKeyRange: { + prototype: IDBKeyRange; + new(): IDBKeyRange; + bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; + lowerBound(lower: any, open?: boolean): IDBKeyRange; + only(value: any): IDBKeyRange; + upperBound(upper: any, open?: boolean): IDBKeyRange; +} + +interface IDBObjectStore { + readonly indexNames: DOMStringList; + keyPath: string | string[]; + readonly name: string; + readonly transaction: IDBTransaction; + autoIncrement: boolean; + add(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest; + clear(): IDBRequest; + count(key?: IDBKeyRange | IDBValidKey): IDBRequest; + createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex; + delete(key: IDBKeyRange | IDBValidKey): IDBRequest; + deleteIndex(indexName: string): void; + get(key: any): IDBRequest; + index(name: string): IDBIndex; + openCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; + put(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest; +} + +declare var IDBObjectStore: { + prototype: IDBObjectStore; + new(): IDBObjectStore; +} + +interface IDBOpenDBRequestEventMap extends IDBRequestEventMap { + "blocked": Event; + "upgradeneeded": IDBVersionChangeEvent; +} + +interface IDBOpenDBRequest extends IDBRequest { + onblocked: (this: IDBOpenDBRequest, ev: Event) => any; + onupgradeneeded: (this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any; + addEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBOpenDBRequest: { + prototype: IDBOpenDBRequest; + new(): IDBOpenDBRequest; +} + +interface IDBRequestEventMap { + "error": Event; + "success": Event; +} + +interface IDBRequest extends EventTarget { + readonly error: DOMError; + onerror: (this: IDBRequest, ev: Event) => any; + onsuccess: (this: IDBRequest, ev: Event) => any; + readonly readyState: IDBRequestReadyState; + readonly result: any; + source: IDBObjectStore | IDBIndex | IDBCursor; + readonly transaction: IDBTransaction; + addEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBRequest: { + prototype: IDBRequest; + new(): IDBRequest; +} + +interface IDBTransactionEventMap { + "abort": Event; + "complete": Event; + "error": Event; +} + +interface IDBTransaction extends EventTarget { + readonly db: IDBDatabase; + readonly error: DOMError; + readonly mode: IDBTransactionMode; + onabort: (this: IDBTransaction, ev: Event) => any; + oncomplete: (this: IDBTransaction, ev: Event) => any; + onerror: (this: IDBTransaction, ev: Event) => any; + abort(): void; + objectStore(name: string): IDBObjectStore; + readonly READ_ONLY: string; + readonly READ_WRITE: string; + readonly VERSION_CHANGE: string; + addEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBTransaction: { + prototype: IDBTransaction; + new(): IDBTransaction; + readonly READ_ONLY: string; + readonly READ_WRITE: string; + readonly VERSION_CHANGE: string; +} + +interface IDBVersionChangeEvent extends Event { + readonly newVersion: number | null; + readonly oldVersion: number; +} + +declare var IDBVersionChangeEvent: { + prototype: IDBVersionChangeEvent; + new(): IDBVersionChangeEvent; +} + +interface IIRFilterNode extends AudioNode { + getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void; +} + +declare var IIRFilterNode: { + prototype: IIRFilterNode; + new(): IIRFilterNode; +} + +interface ImageData { + data: Uint8ClampedArray; + readonly height: number; + readonly width: number; +} + +declare var ImageData: { + prototype: ImageData; + new(width: number, height: number): ImageData; + new(array: Uint8ClampedArray, width: number, height: number): ImageData; +} + +interface IntersectionObserver { + readonly root: Element | null; + readonly rootMargin: string; + readonly thresholds: number[]; + disconnect(): void; + observe(target: Element): void; + takeRecords(): IntersectionObserverEntry[]; + unobserve(target: Element): void; +} + +declare var IntersectionObserver: { + prototype: IntersectionObserver; + new(callback: IntersectionObserverCallback, options?: IntersectionObserverInit): IntersectionObserver; +} + +interface IntersectionObserverEntry { + readonly boundingClientRect: ClientRect; + readonly intersectionRatio: number; + readonly intersectionRect: ClientRect; + readonly rootBounds: ClientRect; + readonly target: Element; + readonly time: number; +} + +declare var IntersectionObserverEntry: { + prototype: IntersectionObserverEntry; + new(intersectionObserverEntryInit: IntersectionObserverEntryInit): IntersectionObserverEntry; +} + +interface KeyboardEvent extends UIEvent { + readonly altKey: boolean; + readonly char: string | null; + readonly charCode: number; + readonly ctrlKey: boolean; + readonly key: string; + readonly keyCode: number; + readonly locale: string; + readonly location: number; + readonly metaKey: boolean; + readonly repeat: boolean; + readonly shiftKey: boolean; + readonly which: number; + readonly code: string; + getModifierState(keyArg: string): boolean; + initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; + readonly DOM_KEY_LOCATION_JOYSTICK: number; + readonly DOM_KEY_LOCATION_LEFT: number; + readonly DOM_KEY_LOCATION_MOBILE: number; + readonly DOM_KEY_LOCATION_NUMPAD: number; + readonly DOM_KEY_LOCATION_RIGHT: number; + readonly DOM_KEY_LOCATION_STANDARD: number; +} + +declare var KeyboardEvent: { + prototype: KeyboardEvent; + new(typeArg: string, eventInitDict?: KeyboardEventInit): KeyboardEvent; + readonly DOM_KEY_LOCATION_JOYSTICK: number; + readonly DOM_KEY_LOCATION_LEFT: number; + readonly DOM_KEY_LOCATION_MOBILE: number; + readonly DOM_KEY_LOCATION_NUMPAD: number; + readonly DOM_KEY_LOCATION_RIGHT: number; + readonly DOM_KEY_LOCATION_STANDARD: number; +} + +interface ListeningStateChangedEvent extends Event { + readonly label: string; + readonly state: ListeningState; +} + +declare var ListeningStateChangedEvent: { + prototype: ListeningStateChangedEvent; + new(): ListeningStateChangedEvent; +} + +interface Location { + hash: string; + host: string; + hostname: string; + href: string; + readonly origin: string; + pathname: string; + port: string; + protocol: string; + search: string; + assign(url: string): void; + reload(forcedReload?: boolean): void; + replace(url: string): void; + toString(): string; +} + +declare var Location: { + prototype: Location; + new(): Location; +} + +interface LongRunningScriptDetectedEvent extends Event { + readonly executionTime: number; + stopPageScriptExecution: boolean; +} + +declare var LongRunningScriptDetectedEvent: { + prototype: LongRunningScriptDetectedEvent; + new(): LongRunningScriptDetectedEvent; +} + +interface MSApp { + clearTemporaryWebDataAsync(): MSAppAsyncOperation; + createBlobFromRandomAccessStream(type: string, seeker: any): Blob; + createDataPackage(object: any): any; + createDataPackageFromSelection(): any; + createFileFromStorageFile(storageFile: any): File; + createStreamFromInputStream(type: string, inputStream: any): MSStream; + execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; + execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; + getCurrentPriority(): string; + getHtmlPrintDocumentSourceAsync(htmlDoc: any): Promise; + getViewId(view: any): any; + isTaskScheduledAtPriorityOrHigher(priority: string): boolean; + pageHandlesAllApplicationActivations(enabled: boolean): void; + suppressSubdownloadCredentialPrompts(suppress: boolean): void; + terminateApp(exceptionObject: any): void; + readonly CURRENT: string; + readonly HIGH: string; + readonly IDLE: string; + readonly NORMAL: string; +} +declare var MSApp: MSApp; + +interface MSAppAsyncOperationEventMap { + "complete": Event; + "error": Event; +} + +interface MSAppAsyncOperation extends EventTarget { + readonly error: DOMError; + oncomplete: (this: MSAppAsyncOperation, ev: Event) => any; + onerror: (this: MSAppAsyncOperation, ev: Event) => any; + readonly readyState: number; + readonly result: any; + start(): void; + readonly COMPLETED: number; + readonly ERROR: number; + readonly STARTED: number; + addEventListener(type: K, listener: (this: MSAppAsyncOperation, ev: MSAppAsyncOperationEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSAppAsyncOperation: { + prototype: MSAppAsyncOperation; + new(): MSAppAsyncOperation; + readonly COMPLETED: number; + readonly ERROR: number; + readonly STARTED: number; +} + +interface MSAssertion { + readonly id: string; + readonly type: MSCredentialType; +} + +declare var MSAssertion: { + prototype: MSAssertion; + new(): MSAssertion; +} + +interface MSBlobBuilder { + append(data: any, endings?: string): void; + getBlob(contentType?: string): Blob; +} + +declare var MSBlobBuilder: { + prototype: MSBlobBuilder; + new(): MSBlobBuilder; +} + +interface MSCredentials { + getAssertion(challenge: string, filter?: MSCredentialFilter, params?: MSSignatureParameters): Promise; + makeCredential(accountInfo: MSAccountInfo, params: MSCredentialParameters[], challenge?: string): Promise; +} + +declare var MSCredentials: { + prototype: MSCredentials; + new(): MSCredentials; +} + +interface MSFIDOCredentialAssertion extends MSAssertion { + readonly algorithm: string | Algorithm; + readonly attestation: any; + readonly publicKey: string; + readonly transportHints: MSTransportType[]; +} + +declare var MSFIDOCredentialAssertion: { + prototype: MSFIDOCredentialAssertion; + new(): MSFIDOCredentialAssertion; +} + +interface MSFIDOSignature { + readonly authnrData: string; + readonly clientData: string; + readonly signature: string; +} + +declare var MSFIDOSignature: { + prototype: MSFIDOSignature; + new(): MSFIDOSignature; +} + +interface MSFIDOSignatureAssertion extends MSAssertion { + readonly signature: MSFIDOSignature; +} + +declare var MSFIDOSignatureAssertion: { + prototype: MSFIDOSignatureAssertion; + new(): MSFIDOSignatureAssertion; +} + +interface MSGesture { + target: Element; + addPointer(pointerId: number): void; + stop(): void; +} + +declare var MSGesture: { + prototype: MSGesture; + new(): MSGesture; +} + +interface MSGestureEvent extends UIEvent { + readonly clientX: number; + readonly clientY: number; + readonly expansion: number; + readonly gestureObject: any; + readonly hwTimestamp: number; + readonly offsetX: number; + readonly offsetY: number; + readonly rotation: number; + readonly scale: number; + readonly screenX: number; + readonly screenY: number; + readonly translationX: number; + readonly translationY: number; + readonly velocityAngular: number; + readonly velocityExpansion: number; + readonly velocityX: number; + readonly velocityY: number; + initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; + readonly MSGESTURE_FLAG_BEGIN: number; + readonly MSGESTURE_FLAG_CANCEL: number; + readonly MSGESTURE_FLAG_END: number; + readonly MSGESTURE_FLAG_INERTIA: number; + readonly MSGESTURE_FLAG_NONE: number; +} + +declare var MSGestureEvent: { + prototype: MSGestureEvent; + new(): MSGestureEvent; + readonly MSGESTURE_FLAG_BEGIN: number; + readonly MSGESTURE_FLAG_CANCEL: number; + readonly MSGESTURE_FLAG_END: number; + readonly MSGESTURE_FLAG_INERTIA: number; + readonly MSGESTURE_FLAG_NONE: number; +} + +interface MSGraphicsTrust { + readonly constrictionActive: boolean; + readonly status: string; +} + +declare var MSGraphicsTrust: { + prototype: MSGraphicsTrust; + new(): MSGraphicsTrust; +} + +interface MSHTMLWebViewElement extends HTMLElement { + readonly canGoBack: boolean; + readonly canGoForward: boolean; + readonly containsFullScreenElement: boolean; + readonly documentTitle: string; + height: number; + readonly settings: MSWebViewSettings; + src: string; + width: number; + addWebAllowedObject(name: string, applicationObject: any): void; + buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; + capturePreviewToBlobAsync(): MSWebViewAsyncOperation; + captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; + getDeferredPermissionRequestById(id: number): DeferredPermissionRequest; + getDeferredPermissionRequests(): DeferredPermissionRequest[]; + goBack(): void; + goForward(): void; + invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; + navigate(uri: string): void; + navigateFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void; + navigateToLocalStreamUri(source: string, streamResolver: any): void; + navigateToString(contents: string): void; + navigateWithHttpRequestMessage(requestMessage: any): void; + refresh(): void; + stop(): void; + addEventListener(type: K, listener: (this: MSHTMLWebViewElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSHTMLWebViewElement: { + prototype: MSHTMLWebViewElement; + new(): MSHTMLWebViewElement; +} + +interface MSInputMethodContextEventMap { + "MSCandidateWindowHide": Event; + "MSCandidateWindowShow": Event; + "MSCandidateWindowUpdate": Event; +} + +interface MSInputMethodContext extends EventTarget { + readonly compositionEndOffset: number; + readonly compositionStartOffset: number; + oncandidatewindowhide: (this: MSInputMethodContext, ev: Event) => any; + oncandidatewindowshow: (this: MSInputMethodContext, ev: Event) => any; + oncandidatewindowupdate: (this: MSInputMethodContext, ev: Event) => any; + readonly target: HTMLElement; + getCandidateWindowClientRect(): ClientRect; + getCompositionAlternatives(): string[]; + hasComposition(): boolean; + isCandidateWindowVisible(): boolean; + addEventListener(type: K, listener: (this: MSInputMethodContext, ev: MSInputMethodContextEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSInputMethodContext: { + prototype: MSInputMethodContext; + new(): MSInputMethodContext; +} + +interface MSManipulationEvent extends UIEvent { + readonly currentState: number; + readonly inertiaDestinationX: number; + readonly inertiaDestinationY: number; + readonly lastState: number; + initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; + readonly MS_MANIPULATION_STATE_ACTIVE: number; + readonly MS_MANIPULATION_STATE_CANCELLED: number; + readonly MS_MANIPULATION_STATE_COMMITTED: number; + readonly MS_MANIPULATION_STATE_DRAGGING: number; + readonly MS_MANIPULATION_STATE_INERTIA: number; + readonly MS_MANIPULATION_STATE_PRESELECT: number; + readonly MS_MANIPULATION_STATE_SELECTING: number; + readonly MS_MANIPULATION_STATE_STOPPED: number; +} + +declare var MSManipulationEvent: { + prototype: MSManipulationEvent; + new(): MSManipulationEvent; + readonly MS_MANIPULATION_STATE_ACTIVE: number; + readonly MS_MANIPULATION_STATE_CANCELLED: number; + readonly MS_MANIPULATION_STATE_COMMITTED: number; + readonly MS_MANIPULATION_STATE_DRAGGING: number; + readonly MS_MANIPULATION_STATE_INERTIA: number; + readonly MS_MANIPULATION_STATE_PRESELECT: number; + readonly MS_MANIPULATION_STATE_SELECTING: number; + readonly MS_MANIPULATION_STATE_STOPPED: number; +} + +interface MSMediaKeyError { + readonly code: number; + readonly systemCode: number; + readonly MS_MEDIA_KEYERR_CLIENT: number; + readonly MS_MEDIA_KEYERR_DOMAIN: number; + readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number; + readonly MS_MEDIA_KEYERR_OUTPUT: number; + readonly MS_MEDIA_KEYERR_SERVICE: number; + readonly MS_MEDIA_KEYERR_UNKNOWN: number; +} + +declare var MSMediaKeyError: { + prototype: MSMediaKeyError; + new(): MSMediaKeyError; + readonly MS_MEDIA_KEYERR_CLIENT: number; + readonly MS_MEDIA_KEYERR_DOMAIN: number; + readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number; + readonly MS_MEDIA_KEYERR_OUTPUT: number; + readonly MS_MEDIA_KEYERR_SERVICE: number; + readonly MS_MEDIA_KEYERR_UNKNOWN: number; +} + +interface MSMediaKeyMessageEvent extends Event { + readonly destinationURL: string | null; + readonly message: Uint8Array; +} + +declare var MSMediaKeyMessageEvent: { + prototype: MSMediaKeyMessageEvent; + new(): MSMediaKeyMessageEvent; +} + +interface MSMediaKeyNeededEvent extends Event { + readonly initData: Uint8Array | null; +} + +declare var MSMediaKeyNeededEvent: { + prototype: MSMediaKeyNeededEvent; + new(): MSMediaKeyNeededEvent; +} + +interface MSMediaKeySession extends EventTarget { + readonly error: MSMediaKeyError | null; + readonly keySystem: string; + readonly sessionId: string; + close(): void; + update(key: Uint8Array): void; +} + +declare var MSMediaKeySession: { + prototype: MSMediaKeySession; + new(): MSMediaKeySession; +} + +interface MSMediaKeys { + readonly keySystem: string; + createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; +} + +declare var MSMediaKeys: { + prototype: MSMediaKeys; + new(keySystem: string): MSMediaKeys; + isTypeSupported(keySystem: string, type?: string): boolean; + isTypeSupportedWithFeatures(keySystem: string, type?: string): string; +} + +interface MSPointerEvent extends MouseEvent { + readonly currentPoint: any; + readonly height: number; + readonly hwTimestamp: number; + readonly intermediatePoints: any; + readonly isPrimary: boolean; + readonly pointerId: number; + readonly pointerType: any; + readonly pressure: number; + readonly rotation: number; + readonly tiltX: number; + readonly tiltY: number; + readonly width: number; + getCurrentPoint(element: Element): void; + getIntermediatePoints(element: Element): void; + initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; +} + +declare var MSPointerEvent: { + prototype: MSPointerEvent; + new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent; +} + +interface MSRangeCollection { + readonly length: number; + item(index: number): Range; + [index: number]: Range; +} + +declare var MSRangeCollection: { + prototype: MSRangeCollection; + new(): MSRangeCollection; +} + +interface MSSiteModeEvent extends Event { + readonly actionURL: string; + readonly buttonID: number; +} + +declare var MSSiteModeEvent: { + prototype: MSSiteModeEvent; + new(): MSSiteModeEvent; +} + +interface MSStream { + readonly type: string; + msClose(): void; + msDetachStream(): any; +} + +declare var MSStream: { + prototype: MSStream; + new(): MSStream; +} + +interface MSStreamReader extends EventTarget, MSBaseReader { + readonly error: DOMError; + readAsArrayBuffer(stream: MSStream, size?: number): void; + readAsBinaryString(stream: MSStream, size?: number): void; + readAsBlob(stream: MSStream, size?: number): void; + readAsDataURL(stream: MSStream, size?: number): void; + readAsText(stream: MSStream, encoding?: string, size?: number): void; + addEventListener(type: K, listener: (this: MSStreamReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSStreamReader: { + prototype: MSStreamReader; + new(): MSStreamReader; +} + +interface MSWebViewAsyncOperationEventMap { + "complete": Event; + "error": Event; +} + +interface MSWebViewAsyncOperation extends EventTarget { + readonly error: DOMError; + oncomplete: (this: MSWebViewAsyncOperation, ev: Event) => any; + onerror: (this: MSWebViewAsyncOperation, ev: Event) => any; + readonly readyState: number; + readonly result: any; + readonly target: MSHTMLWebViewElement; + readonly type: number; + start(): void; + readonly COMPLETED: number; + readonly ERROR: number; + readonly STARTED: number; + readonly TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; + readonly TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; + readonly TYPE_INVOKE_SCRIPT: number; + addEventListener(type: K, listener: (this: MSWebViewAsyncOperation, ev: MSWebViewAsyncOperationEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSWebViewAsyncOperation: { + prototype: MSWebViewAsyncOperation; + new(): MSWebViewAsyncOperation; + readonly COMPLETED: number; + readonly ERROR: number; + readonly STARTED: number; + readonly TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; + readonly TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; + readonly TYPE_INVOKE_SCRIPT: number; +} + +interface MSWebViewSettings { + isIndexedDBEnabled: boolean; + isJavaScriptEnabled: boolean; +} + +declare var MSWebViewSettings: { + prototype: MSWebViewSettings; + new(): MSWebViewSettings; +} + +interface MediaDeviceInfo { + readonly deviceId: string; + readonly groupId: string; + readonly kind: MediaDeviceKind; + readonly label: string; +} + +declare var MediaDeviceInfo: { + prototype: MediaDeviceInfo; + new(): MediaDeviceInfo; +} + +interface MediaDevicesEventMap { + "devicechange": Event; +} + +interface MediaDevices extends EventTarget { + ondevicechange: (this: MediaDevices, ev: Event) => any; + enumerateDevices(): any; + getSupportedConstraints(): MediaTrackSupportedConstraints; + getUserMedia(constraints: MediaStreamConstraints): Promise; + addEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MediaDevices: { + prototype: MediaDevices; + new(): MediaDevices; +} + +interface MediaElementAudioSourceNode extends AudioNode { +} + +declare var MediaElementAudioSourceNode: { + prototype: MediaElementAudioSourceNode; + new(): MediaElementAudioSourceNode; +} + +interface MediaEncryptedEvent extends Event { + readonly initData: ArrayBuffer | null; + readonly initDataType: string; +} + +declare var MediaEncryptedEvent: { + prototype: MediaEncryptedEvent; + new(type: string, eventInitDict?: MediaEncryptedEventInit): MediaEncryptedEvent; +} + +interface MediaError { + readonly code: number; + readonly msExtendedCode: number; + readonly MEDIA_ERR_ABORTED: number; + readonly MEDIA_ERR_DECODE: number; + readonly MEDIA_ERR_NETWORK: number; + readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number; + readonly MS_MEDIA_ERR_ENCRYPTED: number; +} + +declare var MediaError: { + prototype: MediaError; + new(): MediaError; + readonly MEDIA_ERR_ABORTED: number; + readonly MEDIA_ERR_DECODE: number; + readonly MEDIA_ERR_NETWORK: number; + readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number; + readonly MS_MEDIA_ERR_ENCRYPTED: number; +} + +interface MediaKeyMessageEvent extends Event { + readonly message: ArrayBuffer; + readonly messageType: MediaKeyMessageType; +} + +declare var MediaKeyMessageEvent: { + prototype: MediaKeyMessageEvent; + new(type: string, eventInitDict?: MediaKeyMessageEventInit): MediaKeyMessageEvent; +} + +interface MediaKeySession extends EventTarget { + readonly closed: Promise; + readonly expiration: number; + readonly keyStatuses: MediaKeyStatusMap; + readonly sessionId: string; + close(): Promise; + generateRequest(initDataType: string, initData: any): Promise; + load(sessionId: string): Promise; + remove(): Promise; + update(response: any): Promise; +} + +declare var MediaKeySession: { + prototype: MediaKeySession; + new(): MediaKeySession; +} + +interface MediaKeyStatusMap { + readonly size: number; + forEach(callback: ForEachCallback): void; + get(keyId: any): MediaKeyStatus; + has(keyId: any): boolean; +} + +declare var MediaKeyStatusMap: { + prototype: MediaKeyStatusMap; + new(): MediaKeyStatusMap; +} + +interface MediaKeySystemAccess { + readonly keySystem: string; + createMediaKeys(): Promise; + getConfiguration(): MediaKeySystemConfiguration; +} + +declare var MediaKeySystemAccess: { + prototype: MediaKeySystemAccess; + new(): MediaKeySystemAccess; +} + +interface MediaKeys { + createSession(sessionType?: MediaKeySessionType): MediaKeySession; + setServerCertificate(serverCertificate: any): Promise; +} + +declare var MediaKeys: { + prototype: MediaKeys; + new(): MediaKeys; +} + +interface MediaList { + readonly length: number; + mediaText: string; + appendMedium(newMedium: string): void; + deleteMedium(oldMedium: string): void; + item(index: number): string; + toString(): string; + [index: number]: string; +} + +declare var MediaList: { + prototype: MediaList; + new(): MediaList; +} + +interface MediaQueryList { + readonly matches: boolean; + readonly media: string; + addListener(listener: MediaQueryListListener): void; + removeListener(listener: MediaQueryListListener): void; +} + +declare var MediaQueryList: { + prototype: MediaQueryList; + new(): MediaQueryList; +} + +interface MediaSource extends EventTarget { + readonly activeSourceBuffers: SourceBufferList; + duration: number; + readonly readyState: string; + readonly sourceBuffers: SourceBufferList; + addSourceBuffer(type: string): SourceBuffer; + endOfStream(error?: number): void; + removeSourceBuffer(sourceBuffer: SourceBuffer): void; +} + +declare var MediaSource: { + prototype: MediaSource; + new(): MediaSource; + isTypeSupported(type: string): boolean; +} + +interface MediaStreamEventMap { + "active": Event; + "addtrack": MediaStreamTrackEvent; + "inactive": Event; + "removetrack": MediaStreamTrackEvent; +} + +interface MediaStream extends EventTarget { + readonly active: boolean; + readonly id: string; + onactive: (this: MediaStream, ev: Event) => any; + onaddtrack: (this: MediaStream, ev: MediaStreamTrackEvent) => any; + oninactive: (this: MediaStream, ev: Event) => any; + onremovetrack: (this: MediaStream, ev: MediaStreamTrackEvent) => any; + addTrack(track: MediaStreamTrack): void; + clone(): MediaStream; + getAudioTracks(): MediaStreamTrack[]; + getTrackById(trackId: string): MediaStreamTrack | null; + getTracks(): MediaStreamTrack[]; + getVideoTracks(): MediaStreamTrack[]; + removeTrack(track: MediaStreamTrack): void; + stop(): void; + addEventListener(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MediaStream: { + prototype: MediaStream; + new(streamOrTracks?: MediaStream | MediaStreamTrack[]): MediaStream; +} + +interface MediaStreamAudioSourceNode extends AudioNode { +} + +declare var MediaStreamAudioSourceNode: { + prototype: MediaStreamAudioSourceNode; + new(): MediaStreamAudioSourceNode; +} + +interface MediaStreamError { + readonly constraintName: string | null; + readonly message: string | null; + readonly name: string; +} + +declare var MediaStreamError: { + prototype: MediaStreamError; + new(): MediaStreamError; +} + +interface MediaStreamErrorEvent extends Event { + readonly error: MediaStreamError | null; +} + +declare var MediaStreamErrorEvent: { + prototype: MediaStreamErrorEvent; + new(typeArg: string, eventInitDict?: MediaStreamErrorEventInit): MediaStreamErrorEvent; +} + +interface MediaStreamEvent extends Event { + readonly stream: MediaStream | null; +} + +declare var MediaStreamEvent: { + prototype: MediaStreamEvent; + new(type: string, eventInitDict: MediaStreamEventInit): MediaStreamEvent; +} + +interface MediaStreamTrackEventMap { + "ended": MediaStreamErrorEvent; + "mute": Event; + "overconstrained": MediaStreamErrorEvent; + "unmute": Event; +} + +interface MediaStreamTrack extends EventTarget { + enabled: boolean; + readonly id: string; + readonly kind: string; + readonly label: string; + readonly muted: boolean; + onended: (this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any; + onmute: (this: MediaStreamTrack, ev: Event) => any; + onoverconstrained: (this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any; + onunmute: (this: MediaStreamTrack, ev: Event) => any; + readonly readonly: boolean; + readonly readyState: MediaStreamTrackState; + readonly remote: boolean; + applyConstraints(constraints: MediaTrackConstraints): Promise; + clone(): MediaStreamTrack; + getCapabilities(): MediaTrackCapabilities; + getConstraints(): MediaTrackConstraints; + getSettings(): MediaTrackSettings; + stop(): void; + addEventListener(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MediaStreamTrack: { + prototype: MediaStreamTrack; + new(): MediaStreamTrack; +} + +interface MediaStreamTrackEvent extends Event { + readonly track: MediaStreamTrack; +} + +declare var MediaStreamTrackEvent: { + prototype: MediaStreamTrackEvent; + new(typeArg: string, eventInitDict?: MediaStreamTrackEventInit): MediaStreamTrackEvent; +} + +interface MessageChannel { + readonly port1: MessagePort; + readonly port2: MessagePort; +} + +declare var MessageChannel: { + prototype: MessageChannel; + new(): MessageChannel; +} + +interface MessageEvent extends Event { + readonly data: any; + readonly origin: string; + readonly ports: any; + readonly source: Window; + initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; +} + +declare var MessageEvent: { + prototype: MessageEvent; + new(type: string, eventInitDict?: MessageEventInit): MessageEvent; +} + +interface MessagePortEventMap { + "message": MessageEvent; +} + +interface MessagePort extends EventTarget { + onmessage: (this: MessagePort, ev: MessageEvent) => any; + close(): void; + postMessage(message?: any, transfer?: any[]): void; + start(): void; + addEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MessagePort: { + prototype: MessagePort; + new(): MessagePort; +} + +interface MimeType { + readonly description: string; + readonly enabledPlugin: Plugin; + readonly suffixes: string; + readonly type: string; +} + +declare var MimeType: { + prototype: MimeType; + new(): MimeType; +} + +interface MimeTypeArray { + readonly length: number; + item(index: number): Plugin; + namedItem(type: string): Plugin; + [index: number]: Plugin; +} + +declare var MimeTypeArray: { + prototype: MimeTypeArray; + new(): MimeTypeArray; +} + +interface MouseEvent extends UIEvent { + readonly altKey: boolean; + readonly button: number; + readonly buttons: number; + readonly clientX: number; + readonly clientY: number; + readonly ctrlKey: boolean; + readonly fromElement: Element; + readonly layerX: number; + readonly layerY: number; + readonly metaKey: boolean; + readonly movementX: number; + readonly movementY: number; + readonly offsetX: number; + readonly offsetY: number; + readonly pageX: number; + readonly pageY: number; + readonly relatedTarget: EventTarget; + readonly screenX: number; + readonly screenY: number; + readonly shiftKey: boolean; + readonly toElement: Element; + readonly which: number; + readonly x: number; + readonly y: number; + getModifierState(keyArg: string): boolean; + initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget | null): void; +} + +declare var MouseEvent: { + prototype: MouseEvent; + new(typeArg: string, eventInitDict?: MouseEventInit): MouseEvent; +} + +interface MutationEvent extends Event { + readonly attrChange: number; + readonly attrName: string; + readonly newValue: string; + readonly prevValue: string; + readonly relatedNode: Node; + initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; + readonly ADDITION: number; + readonly MODIFICATION: number; + readonly REMOVAL: number; +} + +declare var MutationEvent: { + prototype: MutationEvent; + new(): MutationEvent; + readonly ADDITION: number; + readonly MODIFICATION: number; + readonly REMOVAL: number; +} + +interface MutationObserver { + disconnect(): void; + observe(target: Node, options: MutationObserverInit): void; + takeRecords(): MutationRecord[]; +} + +declare var MutationObserver: { + prototype: MutationObserver; + new(callback: MutationCallback): MutationObserver; +} + +interface MutationRecord { + readonly addedNodes: NodeList; + readonly attributeName: string | null; + readonly attributeNamespace: string | null; + readonly nextSibling: Node | null; + readonly oldValue: string | null; + readonly previousSibling: Node | null; + readonly removedNodes: NodeList; + readonly target: Node; + readonly type: string; +} + +declare var MutationRecord: { + prototype: MutationRecord; + new(): MutationRecord; +} + +interface NamedNodeMap { + readonly length: number; + getNamedItem(name: string): Attr; + getNamedItemNS(namespaceURI: string | null, localName: string | null): Attr; + item(index: number): Attr; + removeNamedItem(name: string): Attr; + removeNamedItemNS(namespaceURI: string | null, localName: string | null): Attr; + setNamedItem(arg: Attr): Attr; + setNamedItemNS(arg: Attr): Attr; + [index: number]: Attr; +} + +declare var NamedNodeMap: { + prototype: NamedNodeMap; + new(): NamedNodeMap; +} + +interface NavigationCompletedEvent extends NavigationEvent { + readonly isSuccess: boolean; + readonly webErrorStatus: number; +} + +declare var NavigationCompletedEvent: { + prototype: NavigationCompletedEvent; + new(): NavigationCompletedEvent; +} + +interface NavigationEvent extends Event { + readonly uri: string; +} + +declare var NavigationEvent: { + prototype: NavigationEvent; + new(): NavigationEvent; +} + +interface NavigationEventWithReferrer extends NavigationEvent { + readonly referer: string; +} + +declare var NavigationEventWithReferrer: { + prototype: NavigationEventWithReferrer; + new(): NavigationEventWithReferrer; +} + +interface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, NavigatorGeolocation, MSNavigatorDoNotTrack, MSFileSaver, NavigatorBeacon, NavigatorConcurrentHardware, NavigatorUserMedia { + readonly authentication: WebAuthentication; + readonly cookieEnabled: boolean; + gamepadInputEmulation: GamepadInputEmulationType; + readonly language: string; + readonly maxTouchPoints: number; + readonly mimeTypes: MimeTypeArray; + readonly msManipulationViewsEnabled: boolean; + readonly msMaxTouchPoints: number; + readonly msPointerEnabled: boolean; + readonly plugins: PluginArray; + readonly pointerEnabled: boolean; + readonly serviceWorker: ServiceWorkerContainer; + readonly webdriver: boolean; + readonly hardwareConcurrency: number; + getGamepads(): Gamepad[]; + javaEnabled(): boolean; + msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; + requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): Promise; + vibrate(pattern: number | number[]): boolean; +} + +declare var Navigator: { + prototype: Navigator; + new(): Navigator; +} + +interface Node extends EventTarget { + readonly attributes: NamedNodeMap; + readonly baseURI: string | null; + readonly childNodes: NodeList; + readonly firstChild: Node | null; + readonly lastChild: Node | null; + readonly localName: string | null; + readonly namespaceURI: string | null; + readonly nextSibling: Node | null; + readonly nodeName: string; + readonly nodeType: number; + nodeValue: string | null; + readonly ownerDocument: Document; + readonly parentElement: HTMLElement | null; + readonly parentNode: Node | null; + readonly previousSibling: Node | null; + textContent: string | null; + appendChild(newChild: T): T; + cloneNode(deep?: boolean): Node; + compareDocumentPosition(other: Node): number; + contains(child: Node): boolean; + hasAttributes(): boolean; + hasChildNodes(): boolean; + insertBefore(newChild: T, refChild: Node | null): T; + isDefaultNamespace(namespaceURI: string | null): boolean; + isEqualNode(arg: Node): boolean; + isSameNode(other: Node): boolean; + lookupNamespaceURI(prefix: string | null): string | null; + lookupPrefix(namespaceURI: string | null): string | null; + normalize(): void; + removeChild(oldChild: T): T; + replaceChild(newChild: Node, oldChild: T): T; + readonly ATTRIBUTE_NODE: number; + readonly CDATA_SECTION_NODE: number; + readonly COMMENT_NODE: number; + readonly DOCUMENT_FRAGMENT_NODE: number; + readonly DOCUMENT_NODE: number; + readonly DOCUMENT_POSITION_CONTAINED_BY: number; + readonly DOCUMENT_POSITION_CONTAINS: number; + readonly DOCUMENT_POSITION_DISCONNECTED: number; + readonly DOCUMENT_POSITION_FOLLOWING: number; + readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + readonly DOCUMENT_POSITION_PRECEDING: number; + readonly DOCUMENT_TYPE_NODE: number; + readonly ELEMENT_NODE: number; + readonly ENTITY_NODE: number; + readonly ENTITY_REFERENCE_NODE: number; + readonly NOTATION_NODE: number; + readonly PROCESSING_INSTRUCTION_NODE: number; + readonly TEXT_NODE: number; +} + +declare var Node: { + prototype: Node; + new(): Node; + readonly ATTRIBUTE_NODE: number; + readonly CDATA_SECTION_NODE: number; + readonly COMMENT_NODE: number; + readonly DOCUMENT_FRAGMENT_NODE: number; + readonly DOCUMENT_NODE: number; + readonly DOCUMENT_POSITION_CONTAINED_BY: number; + readonly DOCUMENT_POSITION_CONTAINS: number; + readonly DOCUMENT_POSITION_DISCONNECTED: number; + readonly DOCUMENT_POSITION_FOLLOWING: number; + readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + readonly DOCUMENT_POSITION_PRECEDING: number; + readonly DOCUMENT_TYPE_NODE: number; + readonly ELEMENT_NODE: number; + readonly ENTITY_NODE: number; + readonly ENTITY_REFERENCE_NODE: number; + readonly NOTATION_NODE: number; + readonly PROCESSING_INSTRUCTION_NODE: number; + readonly TEXT_NODE: number; +} + +interface NodeFilter { + acceptNode(n: Node): number; +} + +declare var NodeFilter: { + readonly FILTER_ACCEPT: number; + readonly FILTER_REJECT: number; + readonly FILTER_SKIP: number; + readonly SHOW_ALL: number; + readonly SHOW_ATTRIBUTE: number; + readonly SHOW_CDATA_SECTION: number; + readonly SHOW_COMMENT: number; + readonly SHOW_DOCUMENT: number; + readonly SHOW_DOCUMENT_FRAGMENT: number; + readonly SHOW_DOCUMENT_TYPE: number; + readonly SHOW_ELEMENT: number; + readonly SHOW_ENTITY: number; + readonly SHOW_ENTITY_REFERENCE: number; + readonly SHOW_NOTATION: number; + readonly SHOW_PROCESSING_INSTRUCTION: number; + readonly SHOW_TEXT: number; +} + +interface NodeIterator { + readonly expandEntityReferences: boolean; + readonly filter: NodeFilter; + readonly root: Node; + readonly whatToShow: number; + detach(): void; + nextNode(): Node; + previousNode(): Node; +} + +declare var NodeIterator: { + prototype: NodeIterator; + new(): NodeIterator; +} + +interface NodeList { + readonly length: number; + item(index: number): Node; + [index: number]: Node; +} + +declare var NodeList: { + prototype: NodeList; + new(): NodeList; +} + +interface NotificationEventMap { + "click": Event; + "close": Event; + "error": Event; + "show": Event; +} + +interface Notification extends EventTarget { + readonly body: string; + readonly dir: NotificationDirection; + readonly icon: string; + readonly lang: string; + onclick: (this: Notification, ev: Event) => any; + onclose: (this: Notification, ev: Event) => any; + onerror: (this: Notification, ev: Event) => any; + onshow: (this: Notification, ev: Event) => any; + readonly permission: NotificationPermission; + readonly tag: string; + readonly title: string; + close(): void; + addEventListener(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Notification: { + prototype: Notification; + new(title: string, options?: NotificationOptions): Notification; + requestPermission(callback?: NotificationPermissionCallback): Promise; +} + +interface OES_element_index_uint { +} + +declare var OES_element_index_uint: { + prototype: OES_element_index_uint; + new(): OES_element_index_uint; +} + +interface OES_standard_derivatives { + readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} + +declare var OES_standard_derivatives: { + prototype: OES_standard_derivatives; + new(): OES_standard_derivatives; + readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} + +interface OES_texture_float { +} + +declare var OES_texture_float: { + prototype: OES_texture_float; + new(): OES_texture_float; +} + +interface OES_texture_float_linear { +} + +declare var OES_texture_float_linear: { + prototype: OES_texture_float_linear; + new(): OES_texture_float_linear; +} + +interface OES_texture_half_float { + readonly HALF_FLOAT_OES: number; +} + +declare var OES_texture_half_float: { + prototype: OES_texture_half_float; + new(): OES_texture_half_float; + readonly HALF_FLOAT_OES: number; +} + +interface OES_texture_half_float_linear { +} + +declare var OES_texture_half_float_linear: { + prototype: OES_texture_half_float_linear; + new(): OES_texture_half_float_linear; +} + +interface OfflineAudioCompletionEvent extends Event { + readonly renderedBuffer: AudioBuffer; +} + +declare var OfflineAudioCompletionEvent: { + prototype: OfflineAudioCompletionEvent; + new(): OfflineAudioCompletionEvent; +} + +interface OfflineAudioContextEventMap extends AudioContextEventMap { + "complete": OfflineAudioCompletionEvent; +} + +interface OfflineAudioContext extends AudioContextBase { + readonly length: number; + oncomplete: (this: OfflineAudioContext, ev: OfflineAudioCompletionEvent) => any; + startRendering(): Promise; + suspend(suspendTime: number): Promise; + addEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var OfflineAudioContext: { + prototype: OfflineAudioContext; + new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext; +} + +interface OscillatorNodeEventMap { + "ended": MediaStreamErrorEvent; +} + +interface OscillatorNode extends AudioNode { + readonly detune: AudioParam; + readonly frequency: AudioParam; + onended: (this: OscillatorNode, ev: MediaStreamErrorEvent) => any; + type: OscillatorType; + setPeriodicWave(periodicWave: PeriodicWave): void; + start(when?: number): void; + stop(when?: number): void; + addEventListener(type: K, listener: (this: OscillatorNode, ev: OscillatorNodeEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var OscillatorNode: { + prototype: OscillatorNode; + new(): OscillatorNode; +} + +interface OverflowEvent extends UIEvent { + readonly horizontalOverflow: boolean; + readonly orient: number; + readonly verticalOverflow: boolean; + readonly BOTH: number; + readonly HORIZONTAL: number; + readonly VERTICAL: number; +} + +declare var OverflowEvent: { + prototype: OverflowEvent; + new(): OverflowEvent; + readonly BOTH: number; + readonly HORIZONTAL: number; + readonly VERTICAL: number; +} + +interface PageTransitionEvent extends Event { + readonly persisted: boolean; +} + +declare var PageTransitionEvent: { + prototype: PageTransitionEvent; + new(): PageTransitionEvent; +} + +interface PannerNode extends AudioNode { + coneInnerAngle: number; + coneOuterAngle: number; + coneOuterGain: number; + distanceModel: DistanceModelType; + maxDistance: number; + panningModel: PanningModelType; + refDistance: number; + rolloffFactor: number; + setOrientation(x: number, y: number, z: number): void; + setPosition(x: number, y: number, z: number): void; + setVelocity(x: number, y: number, z: number): void; +} + +declare var PannerNode: { + prototype: PannerNode; + new(): PannerNode; +} + +interface Path2D extends Object, CanvasPathMethods { +} + +declare var Path2D: { + prototype: Path2D; + new(path?: Path2D): Path2D; +} + +interface PaymentAddress { + readonly addressLine: string[]; + readonly city: string; + readonly country: string; + readonly dependentLocality: string; + readonly languageCode: string; + readonly organization: string; + readonly phone: string; + readonly postalCode: string; + readonly recipient: string; + readonly region: string; + readonly sortingCode: string; + toJSON(): any; +} + +declare var PaymentAddress: { + prototype: PaymentAddress; + new(): PaymentAddress; +} + +interface PaymentRequestEventMap { + "shippingaddresschange": Event; + "shippingoptionchange": Event; +} + +interface PaymentRequest extends EventTarget { + onshippingaddresschange: (this: PaymentRequest, ev: Event) => any; + onshippingoptionchange: (this: PaymentRequest, ev: Event) => any; + readonly shippingAddress: PaymentAddress | null; + readonly shippingOption: string | null; + readonly shippingType: PaymentShippingType | null; + abort(): Promise; + show(): Promise; + addEventListener(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var PaymentRequest: { + prototype: PaymentRequest; + new(methodData: PaymentMethodData[], details: PaymentDetails, options?: PaymentOptions): PaymentRequest; +} + +interface PaymentRequestUpdateEvent extends Event { + updateWith(d: Promise): void; +} + +declare var PaymentRequestUpdateEvent: { + prototype: PaymentRequestUpdateEvent; + new(type: string, eventInitDict?: PaymentRequestUpdateEventInit): PaymentRequestUpdateEvent; +} + +interface PaymentResponse { + readonly details: any; + readonly methodName: string; + readonly payerEmail: string | null; + readonly payerName: string | null; + readonly payerPhone: string | null; + readonly shippingAddress: PaymentAddress | null; + readonly shippingOption: string | null; + complete(result?: PaymentComplete): Promise; + toJSON(): any; +} + +declare var PaymentResponse: { + prototype: PaymentResponse; + new(): PaymentResponse; +} + +interface PerfWidgetExternal { + readonly activeNetworkRequestCount: number; + readonly averageFrameTime: number; + readonly averagePaintTime: number; + readonly extraInformationEnabled: boolean; + readonly independentRenderingEnabled: boolean; + readonly irDisablingContentString: string; + readonly irStatusAvailable: boolean; + readonly maxCpuSpeed: number; + readonly paintRequestsPerSecond: number; + readonly performanceCounter: number; + readonly performanceCounterFrequency: number; + addEventListener(eventType: string, callback: Function): void; + getMemoryUsage(): number; + getProcessCpuUsage(): number; + getRecentCpuUsage(last: number | null): any; + getRecentFrames(last: number | null): any; + getRecentMemoryUsage(last: number | null): any; + getRecentPaintRequests(last: number | null): any; + removeEventListener(eventType: string, callback: Function): void; + repositionWindow(x: number, y: number): void; + resizeWindow(width: number, height: number): void; +} + +declare var PerfWidgetExternal: { + prototype: PerfWidgetExternal; + new(): PerfWidgetExternal; +} + +interface Performance { + readonly navigation: PerformanceNavigation; + readonly timing: PerformanceTiming; + clearMarks(markName?: string): void; + clearMeasures(measureName?: string): void; + clearResourceTimings(): void; + getEntries(): any; + getEntriesByName(name: string, entryType?: string): any; + getEntriesByType(entryType: string): any; + getMarks(markName?: string): any; + getMeasures(measureName?: string): any; + mark(markName: string): void; + measure(measureName: string, startMarkName?: string, endMarkName?: string): void; + now(): number; + setResourceTimingBufferSize(maxSize: number): void; + toJSON(): any; +} + +declare var Performance: { + prototype: Performance; + new(): Performance; +} + +interface PerformanceEntry { + readonly duration: number; + readonly entryType: string; + readonly name: string; + readonly startTime: number; +} + +declare var PerformanceEntry: { + prototype: PerformanceEntry; + new(): PerformanceEntry; +} + +interface PerformanceMark extends PerformanceEntry { +} + +declare var PerformanceMark: { + prototype: PerformanceMark; + new(): PerformanceMark; +} + +interface PerformanceMeasure extends PerformanceEntry { +} + +declare var PerformanceMeasure: { + prototype: PerformanceMeasure; + new(): PerformanceMeasure; +} + +interface PerformanceNavigation { + readonly redirectCount: number; + readonly type: number; + toJSON(): any; + readonly TYPE_BACK_FORWARD: number; + readonly TYPE_NAVIGATE: number; + readonly TYPE_RELOAD: number; + readonly TYPE_RESERVED: number; +} + +declare var PerformanceNavigation: { + prototype: PerformanceNavigation; + new(): PerformanceNavigation; + readonly TYPE_BACK_FORWARD: number; + readonly TYPE_NAVIGATE: number; + readonly TYPE_RELOAD: number; + readonly TYPE_RESERVED: number; +} + +interface PerformanceNavigationTiming extends PerformanceEntry { + readonly connectEnd: number; + readonly connectStart: number; + readonly domComplete: number; + readonly domContentLoadedEventEnd: number; + readonly domContentLoadedEventStart: number; + readonly domInteractive: number; + readonly domLoading: number; + readonly domainLookupEnd: number; + readonly domainLookupStart: number; + readonly fetchStart: number; + readonly loadEventEnd: number; + readonly loadEventStart: number; + readonly navigationStart: number; + readonly redirectCount: number; + readonly redirectEnd: number; + readonly redirectStart: number; + readonly requestStart: number; + readonly responseEnd: number; + readonly responseStart: number; + readonly type: NavigationType; + readonly unloadEventEnd: number; + readonly unloadEventStart: number; +} + +declare var PerformanceNavigationTiming: { + prototype: PerformanceNavigationTiming; + new(): PerformanceNavigationTiming; +} + +interface PerformanceResourceTiming extends PerformanceEntry { + readonly connectEnd: number; + readonly connectStart: number; + readonly domainLookupEnd: number; + readonly domainLookupStart: number; + readonly fetchStart: number; + readonly initiatorType: string; + readonly redirectEnd: number; + readonly redirectStart: number; + readonly requestStart: number; + readonly responseEnd: number; + readonly responseStart: number; +} + +declare var PerformanceResourceTiming: { + prototype: PerformanceResourceTiming; + new(): PerformanceResourceTiming; +} + +interface PerformanceTiming { + readonly connectEnd: number; + readonly connectStart: number; + readonly domComplete: number; + readonly domContentLoadedEventEnd: number; + readonly domContentLoadedEventStart: number; + readonly domInteractive: number; + readonly domLoading: number; + readonly domainLookupEnd: number; + readonly domainLookupStart: number; + readonly fetchStart: number; + readonly loadEventEnd: number; + readonly loadEventStart: number; + readonly msFirstPaint: number; + readonly navigationStart: number; + readonly redirectEnd: number; + readonly redirectStart: number; + readonly requestStart: number; + readonly responseEnd: number; + readonly responseStart: number; + readonly unloadEventEnd: number; + readonly unloadEventStart: number; + readonly secureConnectionStart: number; + toJSON(): any; +} + +declare var PerformanceTiming: { + prototype: PerformanceTiming; + new(): PerformanceTiming; +} + +interface PeriodicWave { +} + +declare var PeriodicWave: { + prototype: PeriodicWave; + new(): PeriodicWave; +} + +interface PermissionRequest extends DeferredPermissionRequest { + readonly state: MSWebViewPermissionState; + defer(): void; +} + +declare var PermissionRequest: { + prototype: PermissionRequest; + new(): PermissionRequest; +} + +interface PermissionRequestedEvent extends Event { + readonly permissionRequest: PermissionRequest; +} + +declare var PermissionRequestedEvent: { + prototype: PermissionRequestedEvent; + new(): PermissionRequestedEvent; +} + +interface Plugin { + readonly description: string; + readonly filename: string; + readonly length: number; + readonly name: string; + readonly version: string; + item(index: number): MimeType; + namedItem(type: string): MimeType; + [index: number]: MimeType; +} + +declare var Plugin: { + prototype: Plugin; + new(): Plugin; +} + +interface PluginArray { + readonly length: number; + item(index: number): Plugin; + namedItem(name: string): Plugin; + refresh(reload?: boolean): void; + [index: number]: Plugin; +} + +declare var PluginArray: { + prototype: PluginArray; + new(): PluginArray; +} + +interface PointerEvent extends MouseEvent { + readonly currentPoint: any; + readonly height: number; + readonly hwTimestamp: number; + readonly intermediatePoints: any; + readonly isPrimary: boolean; + readonly pointerId: number; + readonly pointerType: any; + readonly pressure: number; + readonly rotation: number; + readonly tiltX: number; + readonly tiltY: number; + readonly width: number; + getCurrentPoint(element: Element): void; + getIntermediatePoints(element: Element): void; + initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; +} + +declare var PointerEvent: { + prototype: PointerEvent; + new(typeArg: string, eventInitDict?: PointerEventInit): PointerEvent; +} + +interface PopStateEvent extends Event { + readonly state: any; + initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void; +} + +declare var PopStateEvent: { + prototype: PopStateEvent; + new(typeArg: string, eventInitDict?: PopStateEventInit): PopStateEvent; +} + +interface Position { + readonly coords: Coordinates; + readonly timestamp: number; +} + +declare var Position: { + prototype: Position; + new(): Position; +} + +interface PositionError { + readonly code: number; + readonly message: string; + toString(): string; + readonly PERMISSION_DENIED: number; + readonly POSITION_UNAVAILABLE: number; + readonly TIMEOUT: number; +} + +declare var PositionError: { + prototype: PositionError; + new(): PositionError; + readonly PERMISSION_DENIED: number; + readonly POSITION_UNAVAILABLE: number; + readonly TIMEOUT: number; +} + +interface ProcessingInstruction extends CharacterData { + readonly target: string; +} + +declare var ProcessingInstruction: { + prototype: ProcessingInstruction; + new(): ProcessingInstruction; +} + +interface ProgressEvent extends Event { + readonly lengthComputable: boolean; + readonly loaded: number; + readonly total: number; + initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; +} + +declare var ProgressEvent: { + prototype: ProgressEvent; + new(type: string, eventInitDict?: ProgressEventInit): ProgressEvent; +} + +interface PushManager { + getSubscription(): Promise; + permissionState(options?: PushSubscriptionOptionsInit): Promise; + subscribe(options?: PushSubscriptionOptionsInit): Promise; +} + +declare var PushManager: { + prototype: PushManager; + new(): PushManager; +} + +interface PushSubscription { + readonly endpoint: USVString; + readonly options: PushSubscriptionOptions; + getKey(name: PushEncryptionKeyName): ArrayBuffer | null; + toJSON(): any; + unsubscribe(): Promise; +} + +declare var PushSubscription: { + prototype: PushSubscription; + new(): PushSubscription; +} + +interface PushSubscriptionOptions { + readonly applicationServerKey: ArrayBuffer | null; + readonly userVisibleOnly: boolean; +} + +declare var PushSubscriptionOptions: { + prototype: PushSubscriptionOptions; + new(): PushSubscriptionOptions; +} + +interface RTCDTMFToneChangeEvent extends Event { + readonly tone: string; +} + +declare var RTCDTMFToneChangeEvent: { + prototype: RTCDTMFToneChangeEvent; + new(typeArg: string, eventInitDict: RTCDTMFToneChangeEventInit): RTCDTMFToneChangeEvent; +} + +interface RTCDtlsTransportEventMap { + "dtlsstatechange": RTCDtlsTransportStateChangedEvent; + "error": Event; +} + +interface RTCDtlsTransport extends RTCStatsProvider { + ondtlsstatechange: ((this: RTCDtlsTransport, ev: RTCDtlsTransportStateChangedEvent) => any) | null; + onerror: ((this: RTCDtlsTransport, ev: Event) => any) | null; + readonly state: RTCDtlsTransportState; + readonly transport: RTCIceTransport; + getLocalParameters(): RTCDtlsParameters; + getRemoteCertificates(): ArrayBuffer[]; + getRemoteParameters(): RTCDtlsParameters | null; + start(remoteParameters: RTCDtlsParameters): void; + stop(): void; + addEventListener(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCDtlsTransport: { + prototype: RTCDtlsTransport; + new(transport: RTCIceTransport): RTCDtlsTransport; +} + +interface RTCDtlsTransportStateChangedEvent extends Event { + readonly state: RTCDtlsTransportState; +} + +declare var RTCDtlsTransportStateChangedEvent: { + prototype: RTCDtlsTransportStateChangedEvent; + new(): RTCDtlsTransportStateChangedEvent; +} + +interface RTCDtmfSenderEventMap { + "tonechange": RTCDTMFToneChangeEvent; +} + +interface RTCDtmfSender extends EventTarget { + readonly canInsertDTMF: boolean; + readonly duration: number; + readonly interToneGap: number; + ontonechange: (this: RTCDtmfSender, ev: RTCDTMFToneChangeEvent) => any; + readonly sender: RTCRtpSender; + readonly toneBuffer: string; + insertDTMF(tones: string, duration?: number, interToneGap?: number): void; + addEventListener(type: K, listener: (this: RTCDtmfSender, ev: RTCDtmfSenderEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCDtmfSender: { + prototype: RTCDtmfSender; + new(sender: RTCRtpSender): RTCDtmfSender; +} + +interface RTCIceCandidate { + candidate: string | null; + sdpMLineIndex: number | null; + sdpMid: string | null; + toJSON(): any; +} + +declare var RTCIceCandidate: { + prototype: RTCIceCandidate; + new(candidateInitDict?: RTCIceCandidateInit): RTCIceCandidate; +} + +interface RTCIceCandidatePairChangedEvent extends Event { + readonly pair: RTCIceCandidatePair; +} + +declare var RTCIceCandidatePairChangedEvent: { + prototype: RTCIceCandidatePairChangedEvent; + new(): RTCIceCandidatePairChangedEvent; +} + +interface RTCIceGathererEventMap { + "error": Event; + "localcandidate": RTCIceGathererEvent; +} + +interface RTCIceGatherer extends RTCStatsProvider { + readonly component: RTCIceComponent; + onerror: ((this: RTCIceGatherer, ev: Event) => any) | null; + onlocalcandidate: ((this: RTCIceGatherer, ev: RTCIceGathererEvent) => any) | null; + createAssociatedGatherer(): RTCIceGatherer; + getLocalCandidates(): RTCIceCandidateDictionary[]; + getLocalParameters(): RTCIceParameters; + addEventListener(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCIceGatherer: { + prototype: RTCIceGatherer; + new(options: RTCIceGatherOptions): RTCIceGatherer; +} + +interface RTCIceGathererEvent extends Event { + readonly candidate: RTCIceCandidateDictionary | RTCIceCandidateComplete; +} + +declare var RTCIceGathererEvent: { + prototype: RTCIceGathererEvent; + new(): RTCIceGathererEvent; +} + +interface RTCIceTransportEventMap { + "candidatepairchange": RTCIceCandidatePairChangedEvent; + "icestatechange": RTCIceTransportStateChangedEvent; +} + +interface RTCIceTransport extends RTCStatsProvider { + readonly component: RTCIceComponent; + readonly iceGatherer: RTCIceGatherer | null; + oncandidatepairchange: ((this: RTCIceTransport, ev: RTCIceCandidatePairChangedEvent) => any) | null; + onicestatechange: ((this: RTCIceTransport, ev: RTCIceTransportStateChangedEvent) => any) | null; + readonly role: RTCIceRole; + readonly state: RTCIceTransportState; + addRemoteCandidate(remoteCandidate: RTCIceCandidateDictionary | RTCIceCandidateComplete): void; + createAssociatedTransport(): RTCIceTransport; + getNominatedCandidatePair(): RTCIceCandidatePair | null; + getRemoteCandidates(): RTCIceCandidateDictionary[]; + getRemoteParameters(): RTCIceParameters | null; + setRemoteCandidates(remoteCandidates: RTCIceCandidateDictionary[]): void; + start(gatherer: RTCIceGatherer, remoteParameters: RTCIceParameters, role?: RTCIceRole): void; + stop(): void; + addEventListener(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCIceTransport: { + prototype: RTCIceTransport; + new(): RTCIceTransport; +} + +interface RTCIceTransportStateChangedEvent extends Event { + readonly state: RTCIceTransportState; +} + +declare var RTCIceTransportStateChangedEvent: { + prototype: RTCIceTransportStateChangedEvent; + new(): RTCIceTransportStateChangedEvent; +} + +interface RTCPeerConnectionEventMap { + "addstream": MediaStreamEvent; + "icecandidate": RTCPeerConnectionIceEvent; + "iceconnectionstatechange": Event; + "icegatheringstatechange": Event; + "negotiationneeded": Event; + "removestream": MediaStreamEvent; + "signalingstatechange": Event; +} + +interface RTCPeerConnection extends EventTarget { + readonly canTrickleIceCandidates: boolean | null; + readonly iceConnectionState: RTCIceConnectionState; + readonly iceGatheringState: RTCIceGatheringState; + readonly localDescription: RTCSessionDescription | null; + onaddstream: (this: RTCPeerConnection, ev: MediaStreamEvent) => any; + onicecandidate: (this: RTCPeerConnection, ev: RTCPeerConnectionIceEvent) => any; + oniceconnectionstatechange: (this: RTCPeerConnection, ev: Event) => any; + onicegatheringstatechange: (this: RTCPeerConnection, ev: Event) => any; + onnegotiationneeded: (this: RTCPeerConnection, ev: Event) => any; + onremovestream: (this: RTCPeerConnection, ev: MediaStreamEvent) => any; + onsignalingstatechange: (this: RTCPeerConnection, ev: Event) => any; + readonly remoteDescription: RTCSessionDescription | null; + readonly signalingState: RTCSignalingState; + addIceCandidate(candidate: RTCIceCandidate, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise; + addStream(stream: MediaStream): void; + close(): void; + createAnswer(successCallback?: RTCSessionDescriptionCallback, failureCallback?: RTCPeerConnectionErrorCallback): Promise; + createOffer(successCallback?: RTCSessionDescriptionCallback, failureCallback?: RTCPeerConnectionErrorCallback, options?: RTCOfferOptions): Promise; + getConfiguration(): RTCConfiguration; + getLocalStreams(): MediaStream[]; + getRemoteStreams(): MediaStream[]; + getStats(selector: MediaStreamTrack | null, successCallback?: RTCStatsCallback, failureCallback?: RTCPeerConnectionErrorCallback): Promise; + getStreamById(streamId: string): MediaStream | null; + removeStream(stream: MediaStream): void; + setLocalDescription(description: RTCSessionDescription, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise; + setRemoteDescription(description: RTCSessionDescription, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise; + addEventListener(type: K, listener: (this: RTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCPeerConnection: { + prototype: RTCPeerConnection; + new(configuration: RTCConfiguration): RTCPeerConnection; +} + +interface RTCPeerConnectionIceEvent extends Event { + readonly candidate: RTCIceCandidate; +} + +declare var RTCPeerConnectionIceEvent: { + prototype: RTCPeerConnectionIceEvent; + new(type: string, eventInitDict: RTCPeerConnectionIceEventInit): RTCPeerConnectionIceEvent; +} + +interface RTCRtpReceiverEventMap { + "error": Event; +} + +interface RTCRtpReceiver extends RTCStatsProvider { + onerror: ((this: RTCRtpReceiver, ev: Event) => any) | null; + readonly rtcpTransport: RTCDtlsTransport; + readonly track: MediaStreamTrack | null; + readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport; + getContributingSources(): RTCRtpContributingSource[]; + receive(parameters: RTCRtpParameters): void; + requestSendCSRC(csrc: number): void; + setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void; + stop(): void; + addEventListener(type: K, listener: (this: RTCRtpReceiver, ev: RTCRtpReceiverEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCRtpReceiver: { + prototype: RTCRtpReceiver; + new(transport: RTCDtlsTransport | RTCSrtpSdesTransport, kind: string, rtcpTransport?: RTCDtlsTransport): RTCRtpReceiver; + getCapabilities(kind?: string): RTCRtpCapabilities; +} + +interface RTCRtpSenderEventMap { + "error": Event; + "ssrcconflict": RTCSsrcConflictEvent; +} + +interface RTCRtpSender extends RTCStatsProvider { + onerror: ((this: RTCRtpSender, ev: Event) => any) | null; + onssrcconflict: ((this: RTCRtpSender, ev: RTCSsrcConflictEvent) => any) | null; + readonly rtcpTransport: RTCDtlsTransport; + readonly track: MediaStreamTrack; + readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport; + send(parameters: RTCRtpParameters): void; + setTrack(track: MediaStreamTrack): void; + setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void; + stop(): void; + addEventListener(type: K, listener: (this: RTCRtpSender, ev: RTCRtpSenderEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCRtpSender: { + prototype: RTCRtpSender; + new(track: MediaStreamTrack, transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): RTCRtpSender; + getCapabilities(kind?: string): RTCRtpCapabilities; +} + +interface RTCSessionDescription { + sdp: string | null; + type: RTCSdpType | null; + toJSON(): any; +} + +declare var RTCSessionDescription: { + prototype: RTCSessionDescription; + new(descriptionInitDict?: RTCSessionDescriptionInit): RTCSessionDescription; +} + +interface RTCSrtpSdesTransportEventMap { + "error": Event; +} + +interface RTCSrtpSdesTransport extends EventTarget { + onerror: ((this: RTCSrtpSdesTransport, ev: Event) => any) | null; + readonly transport: RTCIceTransport; + addEventListener(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var RTCSrtpSdesTransport: { + prototype: RTCSrtpSdesTransport; + new(transport: RTCIceTransport, encryptParameters: RTCSrtpSdesParameters, decryptParameters: RTCSrtpSdesParameters): RTCSrtpSdesTransport; + getLocalParameters(): RTCSrtpSdesParameters[]; +} + +interface RTCSsrcConflictEvent extends Event { + readonly ssrc: number; +} + +declare var RTCSsrcConflictEvent: { + prototype: RTCSsrcConflictEvent; + new(): RTCSsrcConflictEvent; +} + +interface RTCStatsProvider extends EventTarget { + getStats(): Promise; + msGetStats(): Promise; +} + +declare var RTCStatsProvider: { + prototype: RTCStatsProvider; + new(): RTCStatsProvider; +} + +interface Range { + readonly collapsed: boolean; + readonly commonAncestorContainer: Node; + readonly endContainer: Node; + readonly endOffset: number; + readonly startContainer: Node; + readonly startOffset: number; + cloneContents(): DocumentFragment; + cloneRange(): Range; + collapse(toStart: boolean): void; + compareBoundaryPoints(how: number, sourceRange: Range): number; + createContextualFragment(fragment: string): DocumentFragment; + deleteContents(): void; + detach(): void; + expand(Unit: ExpandGranularity): boolean; + extractContents(): DocumentFragment; + getBoundingClientRect(): ClientRect; + getClientRects(): ClientRectList; + insertNode(newNode: Node): void; + selectNode(refNode: Node): void; + selectNodeContents(refNode: Node): void; + setEnd(refNode: Node, offset: number): void; + setEndAfter(refNode: Node): void; + setEndBefore(refNode: Node): void; + setStart(refNode: Node, offset: number): void; + setStartAfter(refNode: Node): void; + setStartBefore(refNode: Node): void; + surroundContents(newParent: Node): void; + toString(): string; + readonly END_TO_END: number; + readonly END_TO_START: number; + readonly START_TO_END: number; + readonly START_TO_START: number; +} + +declare var Range: { + prototype: Range; + new(): Range; + readonly END_TO_END: number; + readonly END_TO_START: number; + readonly START_TO_END: number; + readonly START_TO_START: number; +} + +interface ReadableStream { + readonly locked: boolean; + cancel(): Promise; + getReader(): ReadableStreamReader; +} + +declare var ReadableStream: { + prototype: ReadableStream; + new(): ReadableStream; +} + +interface ReadableStreamReader { + cancel(): Promise; + read(): Promise; + releaseLock(): void; +} + +declare var ReadableStreamReader: { + prototype: ReadableStreamReader; + new(): ReadableStreamReader; +} + +interface Request extends Object, Body { + readonly cache: RequestCache; + readonly credentials: RequestCredentials; + readonly destination: RequestDestination; + readonly headers: Headers; + readonly integrity: string; + readonly keepalive: boolean; + readonly method: string; + readonly mode: RequestMode; + readonly redirect: RequestRedirect; + readonly referrer: string; + readonly referrerPolicy: ReferrerPolicy; + readonly type: RequestType; + readonly url: string; + clone(): Request; +} + +declare var Request: { + prototype: Request; + new(input: Request | string, init?: RequestInit): Request; +} + +interface Response extends Object, Body { + readonly body: ReadableStream | null; + readonly headers: Headers; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly type: ResponseType; + readonly url: string; + clone(): Response; +} + +declare var Response: { + prototype: Response; + new(body?: any, init?: ResponseInit): Response; +} + +interface SVGAElement extends SVGGraphicsElement, SVGURIReference { + readonly target: SVGAnimatedString; + addEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGAElement: { + prototype: SVGAElement; + new(): SVGAElement; +} + +interface SVGAngle { + readonly unitType: number; + value: number; + valueAsString: string; + valueInSpecifiedUnits: number; + convertToSpecifiedUnits(unitType: number): void; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + readonly SVG_ANGLETYPE_DEG: number; + readonly SVG_ANGLETYPE_GRAD: number; + readonly SVG_ANGLETYPE_RAD: number; + readonly SVG_ANGLETYPE_UNKNOWN: number; + readonly SVG_ANGLETYPE_UNSPECIFIED: number; +} + +declare var SVGAngle: { + prototype: SVGAngle; + new(): SVGAngle; + readonly SVG_ANGLETYPE_DEG: number; + readonly SVG_ANGLETYPE_GRAD: number; + readonly SVG_ANGLETYPE_RAD: number; + readonly SVG_ANGLETYPE_UNKNOWN: number; + readonly SVG_ANGLETYPE_UNSPECIFIED: number; +} + +interface SVGAnimatedAngle { + readonly animVal: SVGAngle; + readonly baseVal: SVGAngle; +} + +declare var SVGAnimatedAngle: { + prototype: SVGAnimatedAngle; + new(): SVGAnimatedAngle; +} + +interface SVGAnimatedBoolean { + readonly animVal: boolean; + baseVal: boolean; +} + +declare var SVGAnimatedBoolean: { + prototype: SVGAnimatedBoolean; + new(): SVGAnimatedBoolean; +} + +interface SVGAnimatedEnumeration { + readonly animVal: number; + baseVal: number; +} + +declare var SVGAnimatedEnumeration: { + prototype: SVGAnimatedEnumeration; + new(): SVGAnimatedEnumeration; +} + +interface SVGAnimatedInteger { + readonly animVal: number; + baseVal: number; +} + +declare var SVGAnimatedInteger: { + prototype: SVGAnimatedInteger; + new(): SVGAnimatedInteger; +} + +interface SVGAnimatedLength { + readonly animVal: SVGLength; + readonly baseVal: SVGLength; +} + +declare var SVGAnimatedLength: { + prototype: SVGAnimatedLength; + new(): SVGAnimatedLength; +} + +interface SVGAnimatedLengthList { + readonly animVal: SVGLengthList; + readonly baseVal: SVGLengthList; +} + +declare var SVGAnimatedLengthList: { + prototype: SVGAnimatedLengthList; + new(): SVGAnimatedLengthList; +} + +interface SVGAnimatedNumber { + readonly animVal: number; + baseVal: number; +} + +declare var SVGAnimatedNumber: { + prototype: SVGAnimatedNumber; + new(): SVGAnimatedNumber; +} + +interface SVGAnimatedNumberList { + readonly animVal: SVGNumberList; + readonly baseVal: SVGNumberList; +} + +declare var SVGAnimatedNumberList: { + prototype: SVGAnimatedNumberList; + new(): SVGAnimatedNumberList; +} + +interface SVGAnimatedPreserveAspectRatio { + readonly animVal: SVGPreserveAspectRatio; + readonly baseVal: SVGPreserveAspectRatio; +} + +declare var SVGAnimatedPreserveAspectRatio: { + prototype: SVGAnimatedPreserveAspectRatio; + new(): SVGAnimatedPreserveAspectRatio; +} + +interface SVGAnimatedRect { + readonly animVal: SVGRect; + readonly baseVal: SVGRect; +} + +declare var SVGAnimatedRect: { + prototype: SVGAnimatedRect; + new(): SVGAnimatedRect; +} + +interface SVGAnimatedString { + readonly animVal: string; + baseVal: string; +} + +declare var SVGAnimatedString: { + prototype: SVGAnimatedString; + new(): SVGAnimatedString; +} + +interface SVGAnimatedTransformList { + readonly animVal: SVGTransformList; + readonly baseVal: SVGTransformList; +} + +declare var SVGAnimatedTransformList: { + prototype: SVGAnimatedTransformList; + new(): SVGAnimatedTransformList; +} + +interface SVGCircleElement extends SVGGraphicsElement { + readonly cx: SVGAnimatedLength; + readonly cy: SVGAnimatedLength; + readonly r: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGCircleElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGCircleElement: { + prototype: SVGCircleElement; + new(): SVGCircleElement; +} + +interface SVGClipPathElement extends SVGGraphicsElement, SVGUnitTypes { + readonly clipPathUnits: SVGAnimatedEnumeration; + addEventListener(type: K, listener: (this: SVGClipPathElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGClipPathElement: { + prototype: SVGClipPathElement; + new(): SVGClipPathElement; +} + +interface SVGComponentTransferFunctionElement extends SVGElement { + readonly amplitude: SVGAnimatedNumber; + readonly exponent: SVGAnimatedNumber; + readonly intercept: SVGAnimatedNumber; + readonly offset: SVGAnimatedNumber; + readonly slope: SVGAnimatedNumber; + readonly tableValues: SVGAnimatedNumberList; + readonly type: SVGAnimatedEnumeration; + readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGComponentTransferFunctionElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGComponentTransferFunctionElement: { + prototype: SVGComponentTransferFunctionElement; + new(): SVGComponentTransferFunctionElement; + readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; +} + +interface SVGDefsElement extends SVGGraphicsElement { + addEventListener(type: K, listener: (this: SVGDefsElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGDefsElement: { + prototype: SVGDefsElement; + new(): SVGDefsElement; +} + +interface SVGDescElement extends SVGElement { + addEventListener(type: K, listener: (this: SVGDescElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGDescElement: { + prototype: SVGDescElement; + new(): SVGDescElement; +} + +interface SVGElementEventMap extends ElementEventMap { + "click": MouseEvent; + "dblclick": MouseEvent; + "focusin": FocusEvent; + "focusout": FocusEvent; + "load": Event; + "mousedown": MouseEvent; + "mousemove": MouseEvent; + "mouseout": MouseEvent; + "mouseover": MouseEvent; + "mouseup": MouseEvent; +} + +interface SVGElement extends Element { + className: any; + onclick: (this: SVGElement, ev: MouseEvent) => any; + ondblclick: (this: SVGElement, ev: MouseEvent) => any; + onfocusin: (this: SVGElement, ev: FocusEvent) => any; + onfocusout: (this: SVGElement, ev: FocusEvent) => any; + onload: (this: SVGElement, ev: Event) => any; + onmousedown: (this: SVGElement, ev: MouseEvent) => any; + onmousemove: (this: SVGElement, ev: MouseEvent) => any; + onmouseout: (this: SVGElement, ev: MouseEvent) => any; + onmouseover: (this: SVGElement, ev: MouseEvent) => any; + onmouseup: (this: SVGElement, ev: MouseEvent) => any; + readonly ownerSVGElement: SVGSVGElement; + readonly style: CSSStyleDeclaration; + readonly viewportElement: SVGElement; + xmlbase: string; + addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGElement: { + prototype: SVGElement; + new(): SVGElement; +} + +interface SVGElementInstance extends EventTarget { + readonly childNodes: SVGElementInstanceList; + readonly correspondingElement: SVGElement; + readonly correspondingUseElement: SVGUseElement; + readonly firstChild: SVGElementInstance; + readonly lastChild: SVGElementInstance; + readonly nextSibling: SVGElementInstance; + readonly parentNode: SVGElementInstance; + readonly previousSibling: SVGElementInstance; +} + +declare var SVGElementInstance: { + prototype: SVGElementInstance; + new(): SVGElementInstance; +} + +interface SVGElementInstanceList { + readonly length: number; + item(index: number): SVGElementInstance; +} + +declare var SVGElementInstanceList: { + prototype: SVGElementInstanceList; + new(): SVGElementInstanceList; +} + +interface SVGEllipseElement extends SVGGraphicsElement { + readonly cx: SVGAnimatedLength; + readonly cy: SVGAnimatedLength; + readonly rx: SVGAnimatedLength; + readonly ry: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGEllipseElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGEllipseElement: { + prototype: SVGEllipseElement; + new(): SVGEllipseElement; +} + +interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + readonly in2: SVGAnimatedString; + readonly mode: SVGAnimatedEnumeration; + readonly SVG_FEBLEND_MODE_COLOR: number; + readonly SVG_FEBLEND_MODE_COLOR_BURN: number; + readonly SVG_FEBLEND_MODE_COLOR_DODGE: number; + readonly SVG_FEBLEND_MODE_DARKEN: number; + readonly SVG_FEBLEND_MODE_DIFFERENCE: number; + readonly SVG_FEBLEND_MODE_EXCLUSION: number; + readonly SVG_FEBLEND_MODE_HARD_LIGHT: number; + readonly SVG_FEBLEND_MODE_HUE: number; + readonly SVG_FEBLEND_MODE_LIGHTEN: number; + readonly SVG_FEBLEND_MODE_LUMINOSITY: number; + readonly SVG_FEBLEND_MODE_MULTIPLY: number; + readonly SVG_FEBLEND_MODE_NORMAL: number; + readonly SVG_FEBLEND_MODE_OVERLAY: number; + readonly SVG_FEBLEND_MODE_SATURATION: number; + readonly SVG_FEBLEND_MODE_SCREEN: number; + readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number; + readonly SVG_FEBLEND_MODE_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGFEBlendElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEBlendElement: { + prototype: SVGFEBlendElement; + new(): SVGFEBlendElement; + readonly SVG_FEBLEND_MODE_COLOR: number; + readonly SVG_FEBLEND_MODE_COLOR_BURN: number; + readonly SVG_FEBLEND_MODE_COLOR_DODGE: number; + readonly SVG_FEBLEND_MODE_DARKEN: number; + readonly SVG_FEBLEND_MODE_DIFFERENCE: number; + readonly SVG_FEBLEND_MODE_EXCLUSION: number; + readonly SVG_FEBLEND_MODE_HARD_LIGHT: number; + readonly SVG_FEBLEND_MODE_HUE: number; + readonly SVG_FEBLEND_MODE_LIGHTEN: number; + readonly SVG_FEBLEND_MODE_LUMINOSITY: number; + readonly SVG_FEBLEND_MODE_MULTIPLY: number; + readonly SVG_FEBLEND_MODE_NORMAL: number; + readonly SVG_FEBLEND_MODE_OVERLAY: number; + readonly SVG_FEBLEND_MODE_SATURATION: number; + readonly SVG_FEBLEND_MODE_SCREEN: number; + readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number; + readonly SVG_FEBLEND_MODE_UNKNOWN: number; +} + +interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + readonly type: SVGAnimatedEnumeration; + readonly values: SVGAnimatedNumberList; + readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; + readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number; + readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number; + readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGFEColorMatrixElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEColorMatrixElement: { + prototype: SVGFEColorMatrixElement; + new(): SVGFEColorMatrixElement; + readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; + readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number; + readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number; + readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; +} + +interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + addEventListener(type: K, listener: (this: SVGFEComponentTransferElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEComponentTransferElement: { + prototype: SVGFEComponentTransferElement; + new(): SVGFEComponentTransferElement; +} + +interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + readonly in2: SVGAnimatedString; + readonly k1: SVGAnimatedNumber; + readonly k2: SVGAnimatedNumber; + readonly k3: SVGAnimatedNumber; + readonly k4: SVGAnimatedNumber; + readonly operator: SVGAnimatedEnumeration; + readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number; + readonly SVG_FECOMPOSITE_OPERATOR_IN: number; + readonly SVG_FECOMPOSITE_OPERATOR_OUT: number; + readonly SVG_FECOMPOSITE_OPERATOR_OVER: number; + readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + readonly SVG_FECOMPOSITE_OPERATOR_XOR: number; + addEventListener(type: K, listener: (this: SVGFECompositeElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFECompositeElement: { + prototype: SVGFECompositeElement; + new(): SVGFECompositeElement; + readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number; + readonly SVG_FECOMPOSITE_OPERATOR_IN: number; + readonly SVG_FECOMPOSITE_OPERATOR_OUT: number; + readonly SVG_FECOMPOSITE_OPERATOR_OVER: number; + readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + readonly SVG_FECOMPOSITE_OPERATOR_XOR: number; +} + +interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly bias: SVGAnimatedNumber; + readonly divisor: SVGAnimatedNumber; + readonly edgeMode: SVGAnimatedEnumeration; + readonly in1: SVGAnimatedString; + readonly kernelMatrix: SVGAnimatedNumberList; + readonly kernelUnitLengthX: SVGAnimatedNumber; + readonly kernelUnitLengthY: SVGAnimatedNumber; + readonly orderX: SVGAnimatedInteger; + readonly orderY: SVGAnimatedInteger; + readonly preserveAlpha: SVGAnimatedBoolean; + readonly targetX: SVGAnimatedInteger; + readonly targetY: SVGAnimatedInteger; + readonly SVG_EDGEMODE_DUPLICATE: number; + readonly SVG_EDGEMODE_NONE: number; + readonly SVG_EDGEMODE_UNKNOWN: number; + readonly SVG_EDGEMODE_WRAP: number; + addEventListener(type: K, listener: (this: SVGFEConvolveMatrixElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEConvolveMatrixElement: { + prototype: SVGFEConvolveMatrixElement; + new(): SVGFEConvolveMatrixElement; + readonly SVG_EDGEMODE_DUPLICATE: number; + readonly SVG_EDGEMODE_NONE: number; + readonly SVG_EDGEMODE_UNKNOWN: number; + readonly SVG_EDGEMODE_WRAP: number; +} + +interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly diffuseConstant: SVGAnimatedNumber; + readonly in1: SVGAnimatedString; + readonly kernelUnitLengthX: SVGAnimatedNumber; + readonly kernelUnitLengthY: SVGAnimatedNumber; + readonly surfaceScale: SVGAnimatedNumber; + addEventListener(type: K, listener: (this: SVGFEDiffuseLightingElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEDiffuseLightingElement: { + prototype: SVGFEDiffuseLightingElement; + new(): SVGFEDiffuseLightingElement; +} + +interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + readonly in2: SVGAnimatedString; + readonly scale: SVGAnimatedNumber; + readonly xChannelSelector: SVGAnimatedEnumeration; + readonly yChannelSelector: SVGAnimatedEnumeration; + readonly SVG_CHANNEL_A: number; + readonly SVG_CHANNEL_B: number; + readonly SVG_CHANNEL_G: number; + readonly SVG_CHANNEL_R: number; + readonly SVG_CHANNEL_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGFEDisplacementMapElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEDisplacementMapElement: { + prototype: SVGFEDisplacementMapElement; + new(): SVGFEDisplacementMapElement; + readonly SVG_CHANNEL_A: number; + readonly SVG_CHANNEL_B: number; + readonly SVG_CHANNEL_G: number; + readonly SVG_CHANNEL_R: number; + readonly SVG_CHANNEL_UNKNOWN: number; +} + +interface SVGFEDistantLightElement extends SVGElement { + readonly azimuth: SVGAnimatedNumber; + readonly elevation: SVGAnimatedNumber; + addEventListener(type: K, listener: (this: SVGFEDistantLightElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEDistantLightElement: { + prototype: SVGFEDistantLightElement; + new(): SVGFEDistantLightElement; +} + +interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + addEventListener(type: K, listener: (this: SVGFEFloodElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEFloodElement: { + prototype: SVGFEFloodElement; + new(): SVGFEFloodElement; +} + +interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { + addEventListener(type: K, listener: (this: SVGFEFuncAElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEFuncAElement: { + prototype: SVGFEFuncAElement; + new(): SVGFEFuncAElement; +} + +interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { + addEventListener(type: K, listener: (this: SVGFEFuncBElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEFuncBElement: { + prototype: SVGFEFuncBElement; + new(): SVGFEFuncBElement; +} + +interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { + addEventListener(type: K, listener: (this: SVGFEFuncGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEFuncGElement: { + prototype: SVGFEFuncGElement; + new(): SVGFEFuncGElement; +} + +interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { + addEventListener(type: K, listener: (this: SVGFEFuncRElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEFuncRElement: { + prototype: SVGFEFuncRElement; + new(): SVGFEFuncRElement; +} + +interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + readonly stdDeviationX: SVGAnimatedNumber; + readonly stdDeviationY: SVGAnimatedNumber; + setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; + addEventListener(type: K, listener: (this: SVGFEGaussianBlurElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEGaussianBlurElement: { + prototype: SVGFEGaussianBlurElement; + new(): SVGFEGaussianBlurElement; +} + +interface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGURIReference { + readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + addEventListener(type: K, listener: (this: SVGFEImageElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEImageElement: { + prototype: SVGFEImageElement; + new(): SVGFEImageElement; +} + +interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + addEventListener(type: K, listener: (this: SVGFEMergeElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEMergeElement: { + prototype: SVGFEMergeElement; + new(): SVGFEMergeElement; +} + +interface SVGFEMergeNodeElement extends SVGElement { + readonly in1: SVGAnimatedString; + addEventListener(type: K, listener: (this: SVGFEMergeNodeElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEMergeNodeElement: { + prototype: SVGFEMergeNodeElement; + new(): SVGFEMergeNodeElement; +} + +interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + readonly operator: SVGAnimatedEnumeration; + readonly radiusX: SVGAnimatedNumber; + readonly radiusY: SVGAnimatedNumber; + readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number; + readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number; + readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGFEMorphologyElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEMorphologyElement: { + prototype: SVGFEMorphologyElement; + new(): SVGFEMorphologyElement; + readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number; + readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number; + readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; +} + +interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly dx: SVGAnimatedNumber; + readonly dy: SVGAnimatedNumber; + readonly in1: SVGAnimatedString; + addEventListener(type: K, listener: (this: SVGFEOffsetElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEOffsetElement: { + prototype: SVGFEOffsetElement; + new(): SVGFEOffsetElement; +} + +interface SVGFEPointLightElement extends SVGElement { + readonly x: SVGAnimatedNumber; + readonly y: SVGAnimatedNumber; + readonly z: SVGAnimatedNumber; + addEventListener(type: K, listener: (this: SVGFEPointLightElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEPointLightElement: { + prototype: SVGFEPointLightElement; + new(): SVGFEPointLightElement; +} + +interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + readonly kernelUnitLengthX: SVGAnimatedNumber; + readonly kernelUnitLengthY: SVGAnimatedNumber; + readonly specularConstant: SVGAnimatedNumber; + readonly specularExponent: SVGAnimatedNumber; + readonly surfaceScale: SVGAnimatedNumber; + addEventListener(type: K, listener: (this: SVGFESpecularLightingElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFESpecularLightingElement: { + prototype: SVGFESpecularLightingElement; + new(): SVGFESpecularLightingElement; +} + +interface SVGFESpotLightElement extends SVGElement { + readonly limitingConeAngle: SVGAnimatedNumber; + readonly pointsAtX: SVGAnimatedNumber; + readonly pointsAtY: SVGAnimatedNumber; + readonly pointsAtZ: SVGAnimatedNumber; + readonly specularExponent: SVGAnimatedNumber; + readonly x: SVGAnimatedNumber; + readonly y: SVGAnimatedNumber; + readonly z: SVGAnimatedNumber; + addEventListener(type: K, listener: (this: SVGFESpotLightElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFESpotLightElement: { + prototype: SVGFESpotLightElement; + new(): SVGFESpotLightElement; +} + +interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly in1: SVGAnimatedString; + addEventListener(type: K, listener: (this: SVGFETileElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFETileElement: { + prototype: SVGFETileElement; + new(): SVGFETileElement; +} + +interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + readonly baseFrequencyX: SVGAnimatedNumber; + readonly baseFrequencyY: SVGAnimatedNumber; + readonly numOctaves: SVGAnimatedInteger; + readonly seed: SVGAnimatedNumber; + readonly stitchTiles: SVGAnimatedEnumeration; + readonly type: SVGAnimatedEnumeration; + readonly SVG_STITCHTYPE_NOSTITCH: number; + readonly SVG_STITCHTYPE_STITCH: number; + readonly SVG_STITCHTYPE_UNKNOWN: number; + readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + readonly SVG_TURBULENCE_TYPE_TURBULENCE: number; + readonly SVG_TURBULENCE_TYPE_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGFETurbulenceElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFETurbulenceElement: { + prototype: SVGFETurbulenceElement; + new(): SVGFETurbulenceElement; + readonly SVG_STITCHTYPE_NOSTITCH: number; + readonly SVG_STITCHTYPE_STITCH: number; + readonly SVG_STITCHTYPE_UNKNOWN: number; + readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + readonly SVG_TURBULENCE_TYPE_TURBULENCE: number; + readonly SVG_TURBULENCE_TYPE_UNKNOWN: number; +} + +interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGURIReference { + readonly filterResX: SVGAnimatedInteger; + readonly filterResY: SVGAnimatedInteger; + readonly filterUnits: SVGAnimatedEnumeration; + readonly height: SVGAnimatedLength; + readonly primitiveUnits: SVGAnimatedEnumeration; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + setFilterRes(filterResX: number, filterResY: number): void; + addEventListener(type: K, listener: (this: SVGFilterElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFilterElement: { + prototype: SVGFilterElement; + new(): SVGFilterElement; +} + +interface SVGForeignObjectElement extends SVGGraphicsElement { + readonly height: SVGAnimatedLength; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGForeignObjectElement: { + prototype: SVGForeignObjectElement; + new(): SVGForeignObjectElement; +} + +interface SVGGElement extends SVGGraphicsElement { + addEventListener(type: K, listener: (this: SVGGElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGGElement: { + prototype: SVGGElement; + new(): SVGGElement; +} + +interface SVGGradientElement extends SVGElement, SVGUnitTypes, SVGURIReference { + readonly gradientTransform: SVGAnimatedTransformList; + readonly gradientUnits: SVGAnimatedEnumeration; + readonly spreadMethod: SVGAnimatedEnumeration; + readonly SVG_SPREADMETHOD_PAD: number; + readonly SVG_SPREADMETHOD_REFLECT: number; + readonly SVG_SPREADMETHOD_REPEAT: number; + readonly SVG_SPREADMETHOD_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGGradientElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGGradientElement: { + prototype: SVGGradientElement; + new(): SVGGradientElement; + readonly SVG_SPREADMETHOD_PAD: number; + readonly SVG_SPREADMETHOD_REFLECT: number; + readonly SVG_SPREADMETHOD_REPEAT: number; + readonly SVG_SPREADMETHOD_UNKNOWN: number; +} + +interface SVGGraphicsElement extends SVGElement, SVGTests { + readonly farthestViewportElement: SVGElement; + readonly nearestViewportElement: SVGElement; + readonly transform: SVGAnimatedTransformList; + getBBox(): SVGRect; + getCTM(): SVGMatrix; + getScreenCTM(): SVGMatrix; + getTransformToElement(element: SVGElement): SVGMatrix; + addEventListener(type: K, listener: (this: SVGGraphicsElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGGraphicsElement: { + prototype: SVGGraphicsElement; + new(): SVGGraphicsElement; +} + +interface SVGImageElement extends SVGGraphicsElement, SVGURIReference { + readonly height: SVGAnimatedLength; + readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGImageElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGImageElement: { + prototype: SVGImageElement; + new(): SVGImageElement; +} + +interface SVGLength { + readonly unitType: number; + value: number; + valueAsString: string; + valueInSpecifiedUnits: number; + convertToSpecifiedUnits(unitType: number): void; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + readonly SVG_LENGTHTYPE_CM: number; + readonly SVG_LENGTHTYPE_EMS: number; + readonly SVG_LENGTHTYPE_EXS: number; + readonly SVG_LENGTHTYPE_IN: number; + readonly SVG_LENGTHTYPE_MM: number; + readonly SVG_LENGTHTYPE_NUMBER: number; + readonly SVG_LENGTHTYPE_PC: number; + readonly SVG_LENGTHTYPE_PERCENTAGE: number; + readonly SVG_LENGTHTYPE_PT: number; + readonly SVG_LENGTHTYPE_PX: number; + readonly SVG_LENGTHTYPE_UNKNOWN: number; +} + +declare var SVGLength: { + prototype: SVGLength; + new(): SVGLength; + readonly SVG_LENGTHTYPE_CM: number; + readonly SVG_LENGTHTYPE_EMS: number; + readonly SVG_LENGTHTYPE_EXS: number; + readonly SVG_LENGTHTYPE_IN: number; + readonly SVG_LENGTHTYPE_MM: number; + readonly SVG_LENGTHTYPE_NUMBER: number; + readonly SVG_LENGTHTYPE_PC: number; + readonly SVG_LENGTHTYPE_PERCENTAGE: number; + readonly SVG_LENGTHTYPE_PT: number; + readonly SVG_LENGTHTYPE_PX: number; + readonly SVG_LENGTHTYPE_UNKNOWN: number; +} + +interface SVGLengthList { + readonly numberOfItems: number; + appendItem(newItem: SVGLength): SVGLength; + clear(): void; + getItem(index: number): SVGLength; + initialize(newItem: SVGLength): SVGLength; + insertItemBefore(newItem: SVGLength, index: number): SVGLength; + removeItem(index: number): SVGLength; + replaceItem(newItem: SVGLength, index: number): SVGLength; +} + +declare var SVGLengthList: { + prototype: SVGLengthList; + new(): SVGLengthList; +} + +interface SVGLineElement extends SVGGraphicsElement { + readonly x1: SVGAnimatedLength; + readonly x2: SVGAnimatedLength; + readonly y1: SVGAnimatedLength; + readonly y2: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGLineElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGLineElement: { + prototype: SVGLineElement; + new(): SVGLineElement; +} + +interface SVGLinearGradientElement extends SVGGradientElement { + readonly x1: SVGAnimatedLength; + readonly x2: SVGAnimatedLength; + readonly y1: SVGAnimatedLength; + readonly y2: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGLinearGradientElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGLinearGradientElement: { + prototype: SVGLinearGradientElement; + new(): SVGLinearGradientElement; +} + +interface SVGMarkerElement extends SVGElement, SVGFitToViewBox { + readonly markerHeight: SVGAnimatedLength; + readonly markerUnits: SVGAnimatedEnumeration; + readonly markerWidth: SVGAnimatedLength; + readonly orientAngle: SVGAnimatedAngle; + readonly orientType: SVGAnimatedEnumeration; + readonly refX: SVGAnimatedLength; + readonly refY: SVGAnimatedLength; + setOrientToAngle(angle: SVGAngle): void; + setOrientToAuto(): void; + readonly SVG_MARKERUNITS_STROKEWIDTH: number; + readonly SVG_MARKERUNITS_UNKNOWN: number; + readonly SVG_MARKERUNITS_USERSPACEONUSE: number; + readonly SVG_MARKER_ORIENT_ANGLE: number; + readonly SVG_MARKER_ORIENT_AUTO: number; + readonly SVG_MARKER_ORIENT_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGMarkerElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGMarkerElement: { + prototype: SVGMarkerElement; + new(): SVGMarkerElement; + readonly SVG_MARKERUNITS_STROKEWIDTH: number; + readonly SVG_MARKERUNITS_UNKNOWN: number; + readonly SVG_MARKERUNITS_USERSPACEONUSE: number; + readonly SVG_MARKER_ORIENT_ANGLE: number; + readonly SVG_MARKER_ORIENT_AUTO: number; + readonly SVG_MARKER_ORIENT_UNKNOWN: number; +} + +interface SVGMaskElement extends SVGElement, SVGTests, SVGUnitTypes { + readonly height: SVGAnimatedLength; + readonly maskContentUnits: SVGAnimatedEnumeration; + readonly maskUnits: SVGAnimatedEnumeration; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGMaskElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGMaskElement: { + prototype: SVGMaskElement; + new(): SVGMaskElement; +} + +interface SVGMatrix { + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + flipX(): SVGMatrix; + flipY(): SVGMatrix; + inverse(): SVGMatrix; + multiply(secondMatrix: SVGMatrix): SVGMatrix; + rotate(angle: number): SVGMatrix; + rotateFromVector(x: number, y: number): SVGMatrix; + scale(scaleFactor: number): SVGMatrix; + scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; + skewX(angle: number): SVGMatrix; + skewY(angle: number): SVGMatrix; + translate(x: number, y: number): SVGMatrix; +} + +declare var SVGMatrix: { + prototype: SVGMatrix; + new(): SVGMatrix; +} + +interface SVGMetadataElement extends SVGElement { + addEventListener(type: K, listener: (this: SVGMetadataElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGMetadataElement: { + prototype: SVGMetadataElement; + new(): SVGMetadataElement; +} + +interface SVGNumber { + value: number; +} + +declare var SVGNumber: { + prototype: SVGNumber; + new(): SVGNumber; +} + +interface SVGNumberList { + readonly numberOfItems: number; + appendItem(newItem: SVGNumber): SVGNumber; + clear(): void; + getItem(index: number): SVGNumber; + initialize(newItem: SVGNumber): SVGNumber; + insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; + removeItem(index: number): SVGNumber; + replaceItem(newItem: SVGNumber, index: number): SVGNumber; +} + +declare var SVGNumberList: { + prototype: SVGNumberList; + new(): SVGNumberList; +} + +interface SVGPathElement extends SVGGraphicsElement { + readonly pathSegList: SVGPathSegList; + createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; + createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; + createSVGPathSegClosePath(): SVGPathSegClosePath; + createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; + createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; + createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; + createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; + createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; + createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; + createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; + createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; + createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; + createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; + createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; + createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; + createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; + createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; + createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; + createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; + getPathSegAtLength(distance: number): number; + getPointAtLength(distance: number): SVGPoint; + getTotalLength(): number; + addEventListener(type: K, listener: (this: SVGPathElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPathElement: { + prototype: SVGPathElement; + new(): SVGPathElement; +} + +interface SVGPathSeg { + readonly pathSegType: number; + readonly pathSegTypeAsLetter: string; + readonly PATHSEG_ARC_ABS: number; + readonly PATHSEG_ARC_REL: number; + readonly PATHSEG_CLOSEPATH: number; + readonly PATHSEG_CURVETO_CUBIC_ABS: number; + readonly PATHSEG_CURVETO_CUBIC_REL: number; + readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + readonly PATHSEG_CURVETO_QUADRATIC_ABS: number; + readonly PATHSEG_CURVETO_QUADRATIC_REL: number; + readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; + readonly PATHSEG_LINETO_ABS: number; + readonly PATHSEG_LINETO_HORIZONTAL_ABS: number; + readonly PATHSEG_LINETO_HORIZONTAL_REL: number; + readonly PATHSEG_LINETO_REL: number; + readonly PATHSEG_LINETO_VERTICAL_ABS: number; + readonly PATHSEG_LINETO_VERTICAL_REL: number; + readonly PATHSEG_MOVETO_ABS: number; + readonly PATHSEG_MOVETO_REL: number; + readonly PATHSEG_UNKNOWN: number; +} + +declare var SVGPathSeg: { + prototype: SVGPathSeg; + new(): SVGPathSeg; + readonly PATHSEG_ARC_ABS: number; + readonly PATHSEG_ARC_REL: number; + readonly PATHSEG_CLOSEPATH: number; + readonly PATHSEG_CURVETO_CUBIC_ABS: number; + readonly PATHSEG_CURVETO_CUBIC_REL: number; + readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + readonly PATHSEG_CURVETO_QUADRATIC_ABS: number; + readonly PATHSEG_CURVETO_QUADRATIC_REL: number; + readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; + readonly PATHSEG_LINETO_ABS: number; + readonly PATHSEG_LINETO_HORIZONTAL_ABS: number; + readonly PATHSEG_LINETO_HORIZONTAL_REL: number; + readonly PATHSEG_LINETO_REL: number; + readonly PATHSEG_LINETO_VERTICAL_ABS: number; + readonly PATHSEG_LINETO_VERTICAL_REL: number; + readonly PATHSEG_MOVETO_ABS: number; + readonly PATHSEG_MOVETO_REL: number; + readonly PATHSEG_UNKNOWN: number; +} + +interface SVGPathSegArcAbs extends SVGPathSeg { + angle: number; + largeArcFlag: boolean; + r1: number; + r2: number; + sweepFlag: boolean; + x: number; + y: number; +} + +declare var SVGPathSegArcAbs: { + prototype: SVGPathSegArcAbs; + new(): SVGPathSegArcAbs; +} + +interface SVGPathSegArcRel extends SVGPathSeg { + angle: number; + largeArcFlag: boolean; + r1: number; + r2: number; + sweepFlag: boolean; + x: number; + y: number; +} + +declare var SVGPathSegArcRel: { + prototype: SVGPathSegArcRel; + new(): SVGPathSegArcRel; +} + +interface SVGPathSegClosePath extends SVGPathSeg { +} + +declare var SVGPathSegClosePath: { + prototype: SVGPathSegClosePath; + new(): SVGPathSegClosePath; +} + +interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { + x: number; + x1: number; + x2: number; + y: number; + y1: number; + y2: number; +} + +declare var SVGPathSegCurvetoCubicAbs: { + prototype: SVGPathSegCurvetoCubicAbs; + new(): SVGPathSegCurvetoCubicAbs; +} + +interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { + x: number; + x1: number; + x2: number; + y: number; + y1: number; + y2: number; +} + +declare var SVGPathSegCurvetoCubicRel: { + prototype: SVGPathSegCurvetoCubicRel; + new(): SVGPathSegCurvetoCubicRel; +} + +interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { + x: number; + x2: number; + y: number; + y2: number; +} + +declare var SVGPathSegCurvetoCubicSmoothAbs: { + prototype: SVGPathSegCurvetoCubicSmoothAbs; + new(): SVGPathSegCurvetoCubicSmoothAbs; +} + +interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { + x: number; + x2: number; + y: number; + y2: number; +} + +declare var SVGPathSegCurvetoCubicSmoothRel: { + prototype: SVGPathSegCurvetoCubicSmoothRel; + new(): SVGPathSegCurvetoCubicSmoothRel; +} + +interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { + x: number; + x1: number; + y: number; + y1: number; +} + +declare var SVGPathSegCurvetoQuadraticAbs: { + prototype: SVGPathSegCurvetoQuadraticAbs; + new(): SVGPathSegCurvetoQuadraticAbs; +} + +interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { + x: number; + x1: number; + y: number; + y1: number; +} + +declare var SVGPathSegCurvetoQuadraticRel: { + prototype: SVGPathSegCurvetoQuadraticRel; + new(): SVGPathSegCurvetoQuadraticRel; +} + +interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegCurvetoQuadraticSmoothAbs: { + prototype: SVGPathSegCurvetoQuadraticSmoothAbs; + new(): SVGPathSegCurvetoQuadraticSmoothAbs; +} + +interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegCurvetoQuadraticSmoothRel: { + prototype: SVGPathSegCurvetoQuadraticSmoothRel; + new(): SVGPathSegCurvetoQuadraticSmoothRel; +} + +interface SVGPathSegLinetoAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegLinetoAbs: { + prototype: SVGPathSegLinetoAbs; + new(): SVGPathSegLinetoAbs; +} + +interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { + x: number; +} + +declare var SVGPathSegLinetoHorizontalAbs: { + prototype: SVGPathSegLinetoHorizontalAbs; + new(): SVGPathSegLinetoHorizontalAbs; +} + +interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { + x: number; +} + +declare var SVGPathSegLinetoHorizontalRel: { + prototype: SVGPathSegLinetoHorizontalRel; + new(): SVGPathSegLinetoHorizontalRel; +} + +interface SVGPathSegLinetoRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegLinetoRel: { + prototype: SVGPathSegLinetoRel; + new(): SVGPathSegLinetoRel; +} + +interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { + y: number; +} + +declare var SVGPathSegLinetoVerticalAbs: { + prototype: SVGPathSegLinetoVerticalAbs; + new(): SVGPathSegLinetoVerticalAbs; +} + +interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { + y: number; +} + +declare var SVGPathSegLinetoVerticalRel: { + prototype: SVGPathSegLinetoVerticalRel; + new(): SVGPathSegLinetoVerticalRel; +} + +interface SVGPathSegList { + readonly numberOfItems: number; + appendItem(newItem: SVGPathSeg): SVGPathSeg; + clear(): void; + getItem(index: number): SVGPathSeg; + initialize(newItem: SVGPathSeg): SVGPathSeg; + insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; + removeItem(index: number): SVGPathSeg; + replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; +} + +declare var SVGPathSegList: { + prototype: SVGPathSegList; + new(): SVGPathSegList; +} + +interface SVGPathSegMovetoAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegMovetoAbs: { + prototype: SVGPathSegMovetoAbs; + new(): SVGPathSegMovetoAbs; +} + +interface SVGPathSegMovetoRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegMovetoRel: { + prototype: SVGPathSegMovetoRel; + new(): SVGPathSegMovetoRel; +} + +interface SVGPatternElement extends SVGElement, SVGTests, SVGUnitTypes, SVGFitToViewBox, SVGURIReference { + readonly height: SVGAnimatedLength; + readonly patternContentUnits: SVGAnimatedEnumeration; + readonly patternTransform: SVGAnimatedTransformList; + readonly patternUnits: SVGAnimatedEnumeration; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGPatternElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPatternElement: { + prototype: SVGPatternElement; + new(): SVGPatternElement; +} + +interface SVGPoint { + x: number; + y: number; + matrixTransform(matrix: SVGMatrix): SVGPoint; +} + +declare var SVGPoint: { + prototype: SVGPoint; + new(): SVGPoint; +} + +interface SVGPointList { + readonly numberOfItems: number; + appendItem(newItem: SVGPoint): SVGPoint; + clear(): void; + getItem(index: number): SVGPoint; + initialize(newItem: SVGPoint): SVGPoint; + insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; + removeItem(index: number): SVGPoint; + replaceItem(newItem: SVGPoint, index: number): SVGPoint; +} + +declare var SVGPointList: { + prototype: SVGPointList; + new(): SVGPointList; +} + +interface SVGPolygonElement extends SVGGraphicsElement, SVGAnimatedPoints { + addEventListener(type: K, listener: (this: SVGPolygonElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPolygonElement: { + prototype: SVGPolygonElement; + new(): SVGPolygonElement; +} + +interface SVGPolylineElement extends SVGGraphicsElement, SVGAnimatedPoints { + addEventListener(type: K, listener: (this: SVGPolylineElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPolylineElement: { + prototype: SVGPolylineElement; + new(): SVGPolylineElement; +} + +interface SVGPreserveAspectRatio { + align: number; + meetOrSlice: number; + readonly SVG_MEETORSLICE_MEET: number; + readonly SVG_MEETORSLICE_SLICE: number; + readonly SVG_MEETORSLICE_UNKNOWN: number; + readonly SVG_PRESERVEASPECTRATIO_NONE: number; + readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number; + readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number; +} + +declare var SVGPreserveAspectRatio: { + prototype: SVGPreserveAspectRatio; + new(): SVGPreserveAspectRatio; + readonly SVG_MEETORSLICE_MEET: number; + readonly SVG_MEETORSLICE_SLICE: number; + readonly SVG_MEETORSLICE_UNKNOWN: number; + readonly SVG_PRESERVEASPECTRATIO_NONE: number; + readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number; + readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number; +} + +interface SVGRadialGradientElement extends SVGGradientElement { + readonly cx: SVGAnimatedLength; + readonly cy: SVGAnimatedLength; + readonly fx: SVGAnimatedLength; + readonly fy: SVGAnimatedLength; + readonly r: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGRadialGradientElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGRadialGradientElement: { + prototype: SVGRadialGradientElement; + new(): SVGRadialGradientElement; +} + +interface SVGRect { + height: number; + width: number; + x: number; + y: number; +} + +declare var SVGRect: { + prototype: SVGRect; + new(): SVGRect; +} + +interface SVGRectElement extends SVGGraphicsElement { + readonly height: SVGAnimatedLength; + readonly rx: SVGAnimatedLength; + readonly ry: SVGAnimatedLength; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGRectElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGRectElement: { + prototype: SVGRectElement; + new(): SVGRectElement; +} + +interface SVGSVGElementEventMap extends SVGElementEventMap { + "SVGAbort": Event; + "SVGError": Event; + "resize": UIEvent; + "scroll": UIEvent; + "SVGUnload": Event; + "SVGZoom": SVGZoomEvent; +} + +interface SVGSVGElement extends SVGGraphicsElement, DocumentEvent, SVGFitToViewBox, SVGZoomAndPan { + contentScriptType: string; + contentStyleType: string; + currentScale: number; + readonly currentTranslate: SVGPoint; + readonly height: SVGAnimatedLength; + onabort: (this: SVGSVGElement, ev: Event) => any; + onerror: (this: SVGSVGElement, ev: Event) => any; + onresize: (this: SVGSVGElement, ev: UIEvent) => any; + onscroll: (this: SVGSVGElement, ev: UIEvent) => any; + onunload: (this: SVGSVGElement, ev: Event) => any; + onzoom: (this: SVGSVGElement, ev: SVGZoomEvent) => any; + readonly pixelUnitToMillimeterX: number; + readonly pixelUnitToMillimeterY: number; + readonly screenPixelToMillimeterX: number; + readonly screenPixelToMillimeterY: number; + readonly viewport: SVGRect; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + checkEnclosure(element: SVGElement, rect: SVGRect): boolean; + checkIntersection(element: SVGElement, rect: SVGRect): boolean; + createSVGAngle(): SVGAngle; + createSVGLength(): SVGLength; + createSVGMatrix(): SVGMatrix; + createSVGNumber(): SVGNumber; + createSVGPoint(): SVGPoint; + createSVGRect(): SVGRect; + createSVGTransform(): SVGTransform; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; + deselectAll(): void; + forceRedraw(): void; + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; + getCurrentTime(): number; + getElementById(elementId: string): Element; + getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeListOf; + getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeListOf; + pauseAnimations(): void; + setCurrentTime(seconds: number): void; + suspendRedraw(maxWaitMilliseconds: number): number; + unpauseAnimations(): void; + unsuspendRedraw(suspendHandleID: number): void; + unsuspendRedrawAll(): void; + addEventListener(type: K, listener: (this: SVGSVGElement, ev: SVGSVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSVGElement: { + prototype: SVGSVGElement; + new(): SVGSVGElement; +} + +interface SVGScriptElement extends SVGElement, SVGURIReference { + type: string; + addEventListener(type: K, listener: (this: SVGScriptElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGScriptElement: { + prototype: SVGScriptElement; + new(): SVGScriptElement; +} + +interface SVGStopElement extends SVGElement { + readonly offset: SVGAnimatedNumber; + addEventListener(type: K, listener: (this: SVGStopElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGStopElement: { + prototype: SVGStopElement; + new(): SVGStopElement; +} + +interface SVGStringList { + readonly numberOfItems: number; + appendItem(newItem: string): string; + clear(): void; + getItem(index: number): string; + initialize(newItem: string): string; + insertItemBefore(newItem: string, index: number): string; + removeItem(index: number): string; + replaceItem(newItem: string, index: number): string; +} + +declare var SVGStringList: { + prototype: SVGStringList; + new(): SVGStringList; +} + +interface SVGStyleElement extends SVGElement { + disabled: boolean; + media: string; + title: string; + type: string; + addEventListener(type: K, listener: (this: SVGStyleElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGStyleElement: { + prototype: SVGStyleElement; + new(): SVGStyleElement; +} + +interface SVGSwitchElement extends SVGGraphicsElement { + addEventListener(type: K, listener: (this: SVGSwitchElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSwitchElement: { + prototype: SVGSwitchElement; + new(): SVGSwitchElement; +} + +interface SVGSymbolElement extends SVGElement, SVGFitToViewBox { + addEventListener(type: K, listener: (this: SVGSymbolElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSymbolElement: { + prototype: SVGSymbolElement; + new(): SVGSymbolElement; +} + +interface SVGTSpanElement extends SVGTextPositioningElement { + addEventListener(type: K, listener: (this: SVGTSpanElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTSpanElement: { + prototype: SVGTSpanElement; + new(): SVGTSpanElement; +} + +interface SVGTextContentElement extends SVGGraphicsElement { + readonly lengthAdjust: SVGAnimatedEnumeration; + readonly textLength: SVGAnimatedLength; + getCharNumAtPosition(point: SVGPoint): number; + getComputedTextLength(): number; + getEndPositionOfChar(charnum: number): SVGPoint; + getExtentOfChar(charnum: number): SVGRect; + getNumberOfChars(): number; + getRotationOfChar(charnum: number): number; + getStartPositionOfChar(charnum: number): SVGPoint; + getSubStringLength(charnum: number, nchars: number): number; + selectSubString(charnum: number, nchars: number): void; + readonly LENGTHADJUST_SPACING: number; + readonly LENGTHADJUST_SPACINGANDGLYPHS: number; + readonly LENGTHADJUST_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGTextContentElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextContentElement: { + prototype: SVGTextContentElement; + new(): SVGTextContentElement; + readonly LENGTHADJUST_SPACING: number; + readonly LENGTHADJUST_SPACINGANDGLYPHS: number; + readonly LENGTHADJUST_UNKNOWN: number; +} + +interface SVGTextElement extends SVGTextPositioningElement { + addEventListener(type: K, listener: (this: SVGTextElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextElement: { + prototype: SVGTextElement; + new(): SVGTextElement; +} + +interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { + readonly method: SVGAnimatedEnumeration; + readonly spacing: SVGAnimatedEnumeration; + readonly startOffset: SVGAnimatedLength; + readonly TEXTPATH_METHODTYPE_ALIGN: number; + readonly TEXTPATH_METHODTYPE_STRETCH: number; + readonly TEXTPATH_METHODTYPE_UNKNOWN: number; + readonly TEXTPATH_SPACINGTYPE_AUTO: number; + readonly TEXTPATH_SPACINGTYPE_EXACT: number; + readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number; + addEventListener(type: K, listener: (this: SVGTextPathElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextPathElement: { + prototype: SVGTextPathElement; + new(): SVGTextPathElement; + readonly TEXTPATH_METHODTYPE_ALIGN: number; + readonly TEXTPATH_METHODTYPE_STRETCH: number; + readonly TEXTPATH_METHODTYPE_UNKNOWN: number; + readonly TEXTPATH_SPACINGTYPE_AUTO: number; + readonly TEXTPATH_SPACINGTYPE_EXACT: number; + readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number; +} + +interface SVGTextPositioningElement extends SVGTextContentElement { + readonly dx: SVGAnimatedLengthList; + readonly dy: SVGAnimatedLengthList; + readonly rotate: SVGAnimatedNumberList; + readonly x: SVGAnimatedLengthList; + readonly y: SVGAnimatedLengthList; + addEventListener(type: K, listener: (this: SVGTextPositioningElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextPositioningElement: { + prototype: SVGTextPositioningElement; + new(): SVGTextPositioningElement; +} + +interface SVGTitleElement extends SVGElement { + addEventListener(type: K, listener: (this: SVGTitleElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTitleElement: { + prototype: SVGTitleElement; + new(): SVGTitleElement; +} + +interface SVGTransform { + readonly angle: number; + readonly matrix: SVGMatrix; + readonly type: number; + setMatrix(matrix: SVGMatrix): void; + setRotate(angle: number, cx: number, cy: number): void; + setScale(sx: number, sy: number): void; + setSkewX(angle: number): void; + setSkewY(angle: number): void; + setTranslate(tx: number, ty: number): void; + readonly SVG_TRANSFORM_MATRIX: number; + readonly SVG_TRANSFORM_ROTATE: number; + readonly SVG_TRANSFORM_SCALE: number; + readonly SVG_TRANSFORM_SKEWX: number; + readonly SVG_TRANSFORM_SKEWY: number; + readonly SVG_TRANSFORM_TRANSLATE: number; + readonly SVG_TRANSFORM_UNKNOWN: number; +} + +declare var SVGTransform: { + prototype: SVGTransform; + new(): SVGTransform; + readonly SVG_TRANSFORM_MATRIX: number; + readonly SVG_TRANSFORM_ROTATE: number; + readonly SVG_TRANSFORM_SCALE: number; + readonly SVG_TRANSFORM_SKEWX: number; + readonly SVG_TRANSFORM_SKEWY: number; + readonly SVG_TRANSFORM_TRANSLATE: number; + readonly SVG_TRANSFORM_UNKNOWN: number; +} + +interface SVGTransformList { + readonly numberOfItems: number; + appendItem(newItem: SVGTransform): SVGTransform; + clear(): void; + consolidate(): SVGTransform; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; + getItem(index: number): SVGTransform; + initialize(newItem: SVGTransform): SVGTransform; + insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; + removeItem(index: number): SVGTransform; + replaceItem(newItem: SVGTransform, index: number): SVGTransform; +} + +declare var SVGTransformList: { + prototype: SVGTransformList; + new(): SVGTransformList; +} + +interface SVGUnitTypes { + readonly SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; + readonly SVG_UNIT_TYPE_UNKNOWN: number; + readonly SVG_UNIT_TYPE_USERSPACEONUSE: number; +} +declare var SVGUnitTypes: SVGUnitTypes; + +interface SVGUseElement extends SVGGraphicsElement, SVGURIReference { + readonly animatedInstanceRoot: SVGElementInstance; + readonly height: SVGAnimatedLength; + readonly instanceRoot: SVGElementInstance; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; + addEventListener(type: K, listener: (this: SVGUseElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGUseElement: { + prototype: SVGUseElement; + new(): SVGUseElement; +} + +interface SVGViewElement extends SVGElement, SVGZoomAndPan, SVGFitToViewBox { + readonly viewTarget: SVGStringList; + addEventListener(type: K, listener: (this: SVGViewElement, ev: SVGElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGViewElement: { + prototype: SVGViewElement; + new(): SVGViewElement; +} + +interface SVGZoomAndPan { + readonly zoomAndPan: number; +} + +declare var SVGZoomAndPan: { + readonly SVG_ZOOMANDPAN_DISABLE: number; + readonly SVG_ZOOMANDPAN_MAGNIFY: number; + readonly SVG_ZOOMANDPAN_UNKNOWN: number; +} + +interface SVGZoomEvent extends UIEvent { + readonly newScale: number; + readonly newTranslate: SVGPoint; + readonly previousScale: number; + readonly previousTranslate: SVGPoint; + readonly zoomRectScreen: SVGRect; +} + +declare var SVGZoomEvent: { + prototype: SVGZoomEvent; + new(): SVGZoomEvent; +} + +interface ScopedCredential { + readonly id: ArrayBuffer; + readonly type: ScopedCredentialType; +} + +declare var ScopedCredential: { + prototype: ScopedCredential; + new(): ScopedCredential; +} + +interface ScopedCredentialInfo { + readonly credential: ScopedCredential; + readonly publicKey: CryptoKey; +} + +declare var ScopedCredentialInfo: { + prototype: ScopedCredentialInfo; + new(): ScopedCredentialInfo; +} + +interface ScreenEventMap { + "MSOrientationChange": Event; +} + +interface Screen extends EventTarget { + readonly availHeight: number; + readonly availWidth: number; + bufferDepth: number; + readonly colorDepth: number; + readonly deviceXDPI: number; + readonly deviceYDPI: number; + readonly fontSmoothingEnabled: boolean; + readonly height: number; + readonly logicalXDPI: number; + readonly logicalYDPI: number; + readonly msOrientation: string; + onmsorientationchange: (this: Screen, ev: Event) => any; + readonly pixelDepth: number; + readonly systemXDPI: number; + readonly systemYDPI: number; + readonly width: number; + msLockOrientation(orientations: string | string[]): boolean; + msUnlockOrientation(): void; + addEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Screen: { + prototype: Screen; + new(): Screen; +} + +interface ScriptNotifyEvent extends Event { + readonly callingUri: string; + readonly value: string; +} + +declare var ScriptNotifyEvent: { + prototype: ScriptNotifyEvent; + new(): ScriptNotifyEvent; +} + +interface ScriptProcessorNodeEventMap { + "audioprocess": AudioProcessingEvent; +} + +interface ScriptProcessorNode extends AudioNode { + readonly bufferSize: number; + onaudioprocess: (this: ScriptProcessorNode, ev: AudioProcessingEvent) => any; + addEventListener(type: K, listener: (this: ScriptProcessorNode, ev: ScriptProcessorNodeEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ScriptProcessorNode: { + prototype: ScriptProcessorNode; + new(): ScriptProcessorNode; +} + +interface Selection { + readonly anchorNode: Node; + readonly anchorOffset: number; + readonly baseNode: Node; + readonly baseOffset: number; + readonly extentNode: Node; + readonly extentOffset: number; + readonly focusNode: Node; + readonly focusOffset: number; + readonly isCollapsed: boolean; + readonly rangeCount: number; + readonly type: string; + addRange(range: Range): void; + collapse(parentNode: Node, offset: number): void; + collapseToEnd(): void; + collapseToStart(): void; + containsNode(node: Node, partlyContained: boolean): boolean; + deleteFromDocument(): void; + empty(): void; + extend(newNode: Node, offset: number): void; + getRangeAt(index: number): Range; + removeAllRanges(): void; + removeRange(range: Range): void; + selectAllChildren(parentNode: Node): void; + setBaseAndExtent(baseNode: Node, baseOffset: number, extentNode: Node, extentOffset: number): void; + setPosition(parentNode: Node, offset: number): void; + toString(): string; +} + +declare var Selection: { + prototype: Selection; + new(): Selection; +} + +interface ServiceWorkerEventMap extends AbstractWorkerEventMap { + "statechange": Event; +} + +interface ServiceWorker extends EventTarget, AbstractWorker { + onstatechange: (this: ServiceWorker, ev: Event) => any; + readonly scriptURL: USVString; + readonly state: ServiceWorkerState; + postMessage(message: any, transfer?: any[]): void; + addEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ServiceWorker: { + prototype: ServiceWorker; + new(): ServiceWorker; +} + +interface ServiceWorkerContainerEventMap { + "controllerchange": Event; + "message": ServiceWorkerMessageEvent; +} + +interface ServiceWorkerContainer extends EventTarget { + readonly controller: ServiceWorker | null; + oncontrollerchange: (this: ServiceWorkerContainer, ev: Event) => any; + onmessage: (this: ServiceWorkerContainer, ev: ServiceWorkerMessageEvent) => any; + readonly ready: Promise; + getRegistration(clientURL?: USVString): Promise; + getRegistrations(): any; + register(scriptURL: USVString, options?: RegistrationOptions): Promise; + addEventListener(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ServiceWorkerContainer: { + prototype: ServiceWorkerContainer; + new(): ServiceWorkerContainer; +} + +interface ServiceWorkerMessageEvent extends Event { + readonly data: any; + readonly lastEventId: string; + readonly origin: string; + readonly ports: MessagePort[] | null; + readonly source: ServiceWorker | MessagePort | null; +} + +declare var ServiceWorkerMessageEvent: { + prototype: ServiceWorkerMessageEvent; + new(type: string, eventInitDict?: ServiceWorkerMessageEventInit): ServiceWorkerMessageEvent; +} + +interface ServiceWorkerRegistrationEventMap { + "updatefound": Event; +} + +interface ServiceWorkerRegistration extends EventTarget { + readonly active: ServiceWorker | null; + readonly installing: ServiceWorker | null; + onupdatefound: (this: ServiceWorkerRegistration, ev: Event) => any; + readonly pushManager: PushManager; + readonly scope: USVString; + readonly sync: SyncManager; + readonly waiting: ServiceWorker | null; + getNotifications(filter?: GetNotificationOptions): any; + showNotification(title: string, options?: NotificationOptions): Promise; + unregister(): Promise; + update(): Promise; + addEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ServiceWorkerRegistration: { + prototype: ServiceWorkerRegistration; + new(): ServiceWorkerRegistration; +} + +interface SourceBuffer extends EventTarget { + appendWindowEnd: number; + appendWindowStart: number; + readonly audioTracks: AudioTrackList; + readonly buffered: TimeRanges; + mode: AppendMode; + timestampOffset: number; + readonly updating: boolean; + readonly videoTracks: VideoTrackList; + abort(): void; + appendBuffer(data: ArrayBuffer | ArrayBufferView): void; + appendStream(stream: MSStream, maxSize?: number): void; + remove(start: number, end: number): void; +} + +declare var SourceBuffer: { + prototype: SourceBuffer; + new(): SourceBuffer; +} + +interface SourceBufferList extends EventTarget { + readonly length: number; + item(index: number): SourceBuffer; + [index: number]: SourceBuffer; +} + +declare var SourceBufferList: { + prototype: SourceBufferList; + new(): SourceBufferList; +} + +interface SpeechSynthesisEventMap { + "voiceschanged": Event; +} + +interface SpeechSynthesis extends EventTarget { + onvoiceschanged: (this: SpeechSynthesis, ev: Event) => any; + readonly paused: boolean; + readonly pending: boolean; + readonly speaking: boolean; + cancel(): void; + getVoices(): SpeechSynthesisVoice[]; + pause(): void; + resume(): void; + speak(utterance: SpeechSynthesisUtterance): void; + addEventListener(type: K, listener: (this: SpeechSynthesis, ev: SpeechSynthesisEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SpeechSynthesis: { + prototype: SpeechSynthesis; + new(): SpeechSynthesis; +} + +interface SpeechSynthesisEvent extends Event { + readonly charIndex: number; + readonly elapsedTime: number; + readonly name: string; + readonly utterance: SpeechSynthesisUtterance | null; +} + +declare var SpeechSynthesisEvent: { + prototype: SpeechSynthesisEvent; + new(type: string, eventInitDict?: SpeechSynthesisEventInit): SpeechSynthesisEvent; +} + +interface SpeechSynthesisUtteranceEventMap { + "boundary": Event; + "end": Event; + "error": Event; + "mark": Event; + "pause": Event; + "resume": Event; + "start": Event; +} + +interface SpeechSynthesisUtterance extends EventTarget { + lang: string; + onboundary: (this: SpeechSynthesisUtterance, ev: Event) => any; + onend: (this: SpeechSynthesisUtterance, ev: Event) => any; + onerror: (this: SpeechSynthesisUtterance, ev: Event) => any; + onmark: (this: SpeechSynthesisUtterance, ev: Event) => any; + onpause: (this: SpeechSynthesisUtterance, ev: Event) => any; + onresume: (this: SpeechSynthesisUtterance, ev: Event) => any; + onstart: (this: SpeechSynthesisUtterance, ev: Event) => any; + pitch: number; + rate: number; + text: string; + voice: SpeechSynthesisVoice; + volume: number; + addEventListener(type: K, listener: (this: SpeechSynthesisUtterance, ev: SpeechSynthesisUtteranceEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SpeechSynthesisUtterance: { + prototype: SpeechSynthesisUtterance; + new(text?: string): SpeechSynthesisUtterance; +} + +interface SpeechSynthesisVoice { + readonly default: boolean; + readonly lang: string; + readonly localService: boolean; + readonly name: string; + readonly voiceURI: string; +} + +declare var SpeechSynthesisVoice: { + prototype: SpeechSynthesisVoice; + new(): SpeechSynthesisVoice; +} + +interface StereoPannerNode extends AudioNode { + readonly pan: AudioParam; +} + +declare var StereoPannerNode: { + prototype: StereoPannerNode; + new(): StereoPannerNode; +} + +interface Storage { + readonly length: number; + clear(): void; + getItem(key: string): string | null; + key(index: number): string | null; + removeItem(key: string): void; + setItem(key: string, data: string): void; + [key: string]: any; + [index: number]: string; +} + +declare var Storage: { + prototype: Storage; + new(): Storage; +} + +interface StorageEvent extends Event { + readonly url: string; + key?: string; + oldValue?: string; + newValue?: string; + storageArea?: Storage; +} + +declare var StorageEvent: { + prototype: StorageEvent; + new (type: string, eventInitDict?: StorageEventInit): StorageEvent; +} + +interface StyleMedia { + readonly type: string; + matchMedium(mediaquery: string): boolean; +} + +declare var StyleMedia: { + prototype: StyleMedia; + new(): StyleMedia; +} + +interface StyleSheet { + disabled: boolean; + readonly href: string; + readonly media: MediaList; + readonly ownerNode: Node; + readonly parentStyleSheet: StyleSheet; + readonly title: string; + readonly type: string; +} + +declare var StyleSheet: { + prototype: StyleSheet; + new(): StyleSheet; +} + +interface StyleSheetList { + readonly length: number; + item(index?: number): StyleSheet; + [index: number]: StyleSheet; +} + +declare var StyleSheetList: { + prototype: StyleSheetList; + new(): StyleSheetList; +} + +interface StyleSheetPageList { + readonly length: number; + item(index: number): CSSPageRule; + [index: number]: CSSPageRule; +} + +declare var StyleSheetPageList: { + prototype: StyleSheetPageList; + new(): StyleSheetPageList; +} + +interface SubtleCrypto { + decrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): PromiseLike; + deriveBits(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, length: number): PromiseLike; + deriveKey(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike; + digest(algorithm: AlgorithmIdentifier, data: BufferSource): PromiseLike; + encrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): PromiseLike; + exportKey(format: "jwk", key: CryptoKey): PromiseLike; + exportKey(format: "raw" | "pkcs8" | "spki", key: CryptoKey): PromiseLike; + exportKey(format: string, key: CryptoKey): PromiseLike; + generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): PromiseLike; + generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: string[]): PromiseLike; + generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike; + importKey(format: "jwk", keyData: JsonWebKey, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike; + importKey(format: "raw" | "pkcs8" | "spki", keyData: BufferSource, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike; + importKey(format: string, keyData: JsonWebKey | BufferSource, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike; + sign(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, data: BufferSource): PromiseLike; + unwrapKey(format: string, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: string[]): PromiseLike; + verify(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, signature: BufferSource, data: BufferSource): PromiseLike; + wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier): PromiseLike; +} + +declare var SubtleCrypto: { + prototype: SubtleCrypto; + new(): SubtleCrypto; +} + +interface SyncManager { + getTags(): any; + register(tag: string): Promise; +} + +declare var SyncManager: { + prototype: SyncManager; + new(): SyncManager; +} + +interface Text extends CharacterData { + readonly wholeText: string; + readonly assignedSlot: HTMLSlotElement | null; + splitText(offset: number): Text; +} + +declare var Text: { + prototype: Text; + new(data?: string): Text; +} + +interface TextEvent extends UIEvent { + readonly data: string; + readonly inputMethod: number; + readonly locale: string; + initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; + readonly DOM_INPUT_METHOD_DROP: number; + readonly DOM_INPUT_METHOD_HANDWRITING: number; + readonly DOM_INPUT_METHOD_IME: number; + readonly DOM_INPUT_METHOD_KEYBOARD: number; + readonly DOM_INPUT_METHOD_MULTIMODAL: number; + readonly DOM_INPUT_METHOD_OPTION: number; + readonly DOM_INPUT_METHOD_PASTE: number; + readonly DOM_INPUT_METHOD_SCRIPT: number; + readonly DOM_INPUT_METHOD_UNKNOWN: number; + readonly DOM_INPUT_METHOD_VOICE: number; +} + +declare var TextEvent: { + prototype: TextEvent; + new(): TextEvent; + readonly DOM_INPUT_METHOD_DROP: number; + readonly DOM_INPUT_METHOD_HANDWRITING: number; + readonly DOM_INPUT_METHOD_IME: number; + readonly DOM_INPUT_METHOD_KEYBOARD: number; + readonly DOM_INPUT_METHOD_MULTIMODAL: number; + readonly DOM_INPUT_METHOD_OPTION: number; + readonly DOM_INPUT_METHOD_PASTE: number; + readonly DOM_INPUT_METHOD_SCRIPT: number; + readonly DOM_INPUT_METHOD_UNKNOWN: number; + readonly DOM_INPUT_METHOD_VOICE: number; +} + +interface TextMetrics { + readonly width: number; +} + +declare var TextMetrics: { + prototype: TextMetrics; + new(): TextMetrics; +} + +interface TextTrackEventMap { + "cuechange": Event; + "error": Event; + "load": Event; +} + +interface TextTrack extends EventTarget { + readonly activeCues: TextTrackCueList; + readonly cues: TextTrackCueList; + readonly inBandMetadataTrackDispatchType: string; + readonly kind: string; + readonly label: string; + readonly language: string; + mode: any; + oncuechange: (this: TextTrack, ev: Event) => any; + onerror: (this: TextTrack, ev: Event) => any; + onload: (this: TextTrack, ev: Event) => any; + readonly readyState: number; + addCue(cue: TextTrackCue): void; + removeCue(cue: TextTrackCue): void; + readonly DISABLED: number; + readonly ERROR: number; + readonly HIDDEN: number; + readonly LOADED: number; + readonly LOADING: number; + readonly NONE: number; + readonly SHOWING: number; + addEventListener(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var TextTrack: { + prototype: TextTrack; + new(): TextTrack; + readonly DISABLED: number; + readonly ERROR: number; + readonly HIDDEN: number; + readonly LOADED: number; + readonly LOADING: number; + readonly NONE: number; + readonly SHOWING: number; +} + +interface TextTrackCueEventMap { + "enter": Event; + "exit": Event; +} + +interface TextTrackCue extends EventTarget { + endTime: number; + id: string; + onenter: (this: TextTrackCue, ev: Event) => any; + onexit: (this: TextTrackCue, ev: Event) => any; + pauseOnExit: boolean; + startTime: number; + text: string; + readonly track: TextTrack; + getCueAsHTML(): DocumentFragment; + addEventListener(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var TextTrackCue: { + prototype: TextTrackCue; + new(startTime: number, endTime: number, text: string): TextTrackCue; +} + +interface TextTrackCueList { + readonly length: number; + getCueById(id: string): TextTrackCue; + item(index: number): TextTrackCue; + [index: number]: TextTrackCue; +} + +declare var TextTrackCueList: { + prototype: TextTrackCueList; + new(): TextTrackCueList; +} + +interface TextTrackListEventMap { + "addtrack": TrackEvent; +} + +interface TextTrackList extends EventTarget { + readonly length: number; + onaddtrack: ((this: TextTrackList, ev: TrackEvent) => any) | null; + item(index: number): TextTrack; + addEventListener(type: K, listener: (this: TextTrackList, ev: TextTrackListEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: TextTrack; +} + +declare var TextTrackList: { + prototype: TextTrackList; + new(): TextTrackList; +} + +interface TimeRanges { + readonly length: number; + end(index: number): number; + start(index: number): number; +} + +declare var TimeRanges: { + prototype: TimeRanges; + new(): TimeRanges; +} + +interface Touch { + readonly clientX: number; + readonly clientY: number; + readonly identifier: number; + readonly pageX: number; + readonly pageY: number; + readonly screenX: number; + readonly screenY: number; + readonly target: EventTarget; +} + +declare var Touch: { + prototype: Touch; + new(): Touch; +} + +interface TouchEvent extends UIEvent { + readonly altKey: boolean; + readonly changedTouches: TouchList; + readonly charCode: number; + readonly ctrlKey: boolean; + readonly keyCode: number; + readonly metaKey: boolean; + readonly shiftKey: boolean; + readonly targetTouches: TouchList; + readonly touches: TouchList; + readonly which: number; +} + +declare var TouchEvent: { + prototype: TouchEvent; + new(type: string, touchEventInit?: TouchEventInit): TouchEvent; +} + +interface TouchList { + readonly length: number; + item(index: number): Touch | null; + [index: number]: Touch; +} + +declare var TouchList: { + prototype: TouchList; + new(): TouchList; +} + +interface TrackEvent extends Event { + readonly track: VideoTrack | AudioTrack | TextTrack | null; +} + +declare var TrackEvent: { + prototype: TrackEvent; + new(typeArg: string, eventInitDict?: TrackEventInit): TrackEvent; +} + +interface TransitionEvent extends Event { + readonly elapsedTime: number; + readonly propertyName: string; + initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; +} + +declare var TransitionEvent: { + prototype: TransitionEvent; + new(typeArg: string, eventInitDict?: TransitionEventInit): TransitionEvent; +} + +interface TreeWalker { + currentNode: Node; + readonly expandEntityReferences: boolean; + readonly filter: NodeFilter; + readonly root: Node; + readonly whatToShow: number; + firstChild(): Node; + lastChild(): Node; + nextNode(): Node; + nextSibling(): Node; + parentNode(): Node; + previousNode(): Node; + previousSibling(): Node; +} + +declare var TreeWalker: { + prototype: TreeWalker; + new(): TreeWalker; +} + +interface UIEvent extends Event { + readonly detail: number; + readonly view: Window; + initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; +} + +declare var UIEvent: { + prototype: UIEvent; + new(typeArg: string, eventInitDict?: UIEventInit): UIEvent; +} + +interface URL { + hash: string; + host: string; + hostname: string; + href: string; + readonly origin: string; + password: string; + pathname: string; + port: string; + protocol: string; + search: string; + username: string; + readonly searchParams: URLSearchParams; + toString(): string; +} + +declare var URL: { + prototype: URL; + new(url: string, base?: string): URL; + createObjectURL(object: any, options?: ObjectURLOptions): string; + revokeObjectURL(url: string): void; +} + +interface UnviewableContentIdentifiedEvent extends NavigationEventWithReferrer { + readonly mediaType: string; +} + +declare var UnviewableContentIdentifiedEvent: { + prototype: UnviewableContentIdentifiedEvent; + new(): UnviewableContentIdentifiedEvent; +} + +interface ValidityState { + readonly badInput: boolean; + readonly customError: boolean; + readonly patternMismatch: boolean; + readonly rangeOverflow: boolean; + readonly rangeUnderflow: boolean; + readonly stepMismatch: boolean; + readonly tooLong: boolean; + readonly typeMismatch: boolean; + readonly valid: boolean; + readonly valueMissing: boolean; +} + +declare var ValidityState: { + prototype: ValidityState; + new(): ValidityState; +} + +interface VideoPlaybackQuality { + readonly corruptedVideoFrames: number; + readonly creationTime: number; + readonly droppedVideoFrames: number; + readonly totalFrameDelay: number; + readonly totalVideoFrames: number; +} + +declare var VideoPlaybackQuality: { + prototype: VideoPlaybackQuality; + new(): VideoPlaybackQuality; +} + +interface VideoTrack { + readonly id: string; + kind: string; + readonly label: string; + language: string; + selected: boolean; + readonly sourceBuffer: SourceBuffer; +} + +declare var VideoTrack: { + prototype: VideoTrack; + new(): VideoTrack; +} + +interface VideoTrackListEventMap { + "addtrack": TrackEvent; + "change": Event; + "removetrack": TrackEvent; +} + +interface VideoTrackList extends EventTarget { + readonly length: number; + onaddtrack: (this: VideoTrackList, ev: TrackEvent) => any; + onchange: (this: VideoTrackList, ev: Event) => any; + onremovetrack: (this: VideoTrackList, ev: TrackEvent) => any; + readonly selectedIndex: number; + getTrackById(id: string): VideoTrack | null; + item(index: number): VideoTrack; + addEventListener(type: K, listener: (this: VideoTrackList, ev: VideoTrackListEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: VideoTrack; +} + +declare var VideoTrackList: { + prototype: VideoTrackList; + new(): VideoTrackList; +} + +interface WEBGL_compressed_texture_s3tc { + readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number; + readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number; +} + +declare var WEBGL_compressed_texture_s3tc: { + prototype: WEBGL_compressed_texture_s3tc; + new(): WEBGL_compressed_texture_s3tc; + readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number; + readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number; +} + +interface WEBGL_debug_renderer_info { + readonly UNMASKED_RENDERER_WEBGL: number; + readonly UNMASKED_VENDOR_WEBGL: number; +} + +declare var WEBGL_debug_renderer_info: { + prototype: WEBGL_debug_renderer_info; + new(): WEBGL_debug_renderer_info; + readonly UNMASKED_RENDERER_WEBGL: number; + readonly UNMASKED_VENDOR_WEBGL: number; +} + +interface WEBGL_depth_texture { + readonly UNSIGNED_INT_24_8_WEBGL: number; +} + +declare var WEBGL_depth_texture: { + prototype: WEBGL_depth_texture; + new(): WEBGL_depth_texture; + readonly UNSIGNED_INT_24_8_WEBGL: number; +} + +interface WaveShaperNode extends AudioNode { + curve: Float32Array | null; + oversample: OverSampleType; +} + +declare var WaveShaperNode: { + prototype: WaveShaperNode; + new(): WaveShaperNode; +} + +interface WebAuthentication { + getAssertion(assertionChallenge: any, options?: AssertionOptions): Promise; + makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: any, options?: ScopedCredentialOptions): Promise; +} + +declare var WebAuthentication: { + prototype: WebAuthentication; + new(): WebAuthentication; +} + +interface WebAuthnAssertion { + readonly authenticatorData: ArrayBuffer; + readonly clientData: ArrayBuffer; + readonly credential: ScopedCredential; + readonly signature: ArrayBuffer; +} + +declare var WebAuthnAssertion: { + prototype: WebAuthnAssertion; + new(): WebAuthnAssertion; +} + +interface WebGLActiveInfo { + readonly name: string; + readonly size: number; + readonly type: number; +} + +declare var WebGLActiveInfo: { + prototype: WebGLActiveInfo; + new(): WebGLActiveInfo; +} + +interface WebGLBuffer extends WebGLObject { +} + +declare var WebGLBuffer: { + prototype: WebGLBuffer; + new(): WebGLBuffer; +} + +interface WebGLContextEvent extends Event { + readonly statusMessage: string; +} + +declare var WebGLContextEvent: { + prototype: WebGLContextEvent; + new(typeArg: string, eventInitDict?: WebGLContextEventInit): WebGLContextEvent; +} + +interface WebGLFramebuffer extends WebGLObject { +} + +declare var WebGLFramebuffer: { + prototype: WebGLFramebuffer; + new(): WebGLFramebuffer; +} + +interface WebGLObject { +} + +declare var WebGLObject: { + prototype: WebGLObject; + new(): WebGLObject; +} + +interface WebGLProgram extends WebGLObject { +} + +declare var WebGLProgram: { + prototype: WebGLProgram; + new(): WebGLProgram; +} + +interface WebGLRenderbuffer extends WebGLObject { +} + +declare var WebGLRenderbuffer: { + prototype: WebGLRenderbuffer; + new(): WebGLRenderbuffer; +} + +interface WebGLRenderingContext { + readonly canvas: HTMLCanvasElement; + readonly drawingBufferHeight: number; + readonly drawingBufferWidth: number; + activeTexture(texture: number): void; + attachShader(program: WebGLProgram | null, shader: WebGLShader | null): void; + bindAttribLocation(program: WebGLProgram | null, index: number, name: string): void; + bindBuffer(target: number, buffer: WebGLBuffer | null): void; + bindFramebuffer(target: number, framebuffer: WebGLFramebuffer | null): void; + bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer | null): void; + bindTexture(target: number, texture: WebGLTexture | null): void; + blendColor(red: number, green: number, blue: number, alpha: number): void; + blendEquation(mode: number): void; + blendEquationSeparate(modeRGB: number, modeAlpha: number): void; + blendFunc(sfactor: number, dfactor: number): void; + blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; + bufferData(target: number, size: number | ArrayBufferView | ArrayBuffer, usage: number): void; + bufferSubData(target: number, offset: number, data: ArrayBufferView | ArrayBuffer): void; + checkFramebufferStatus(target: number): number; + clear(mask: number): void; + clearColor(red: number, green: number, blue: number, alpha: number): void; + clearDepth(depth: number): void; + clearStencil(s: number): void; + colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; + compileShader(shader: WebGLShader | null): void; + compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; + compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; + copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; + copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; + createBuffer(): WebGLBuffer | null; + createFramebuffer(): WebGLFramebuffer | null; + createProgram(): WebGLProgram | null; + createRenderbuffer(): WebGLRenderbuffer | null; + createShader(type: number): WebGLShader | null; + createTexture(): WebGLTexture | null; + cullFace(mode: number): void; + deleteBuffer(buffer: WebGLBuffer | null): void; + deleteFramebuffer(framebuffer: WebGLFramebuffer | null): void; + deleteProgram(program: WebGLProgram | null): void; + deleteRenderbuffer(renderbuffer: WebGLRenderbuffer | null): void; + deleteShader(shader: WebGLShader | null): void; + deleteTexture(texture: WebGLTexture | null): void; + depthFunc(func: number): void; + depthMask(flag: boolean): void; + depthRange(zNear: number, zFar: number): void; + detachShader(program: WebGLProgram | null, shader: WebGLShader | null): void; + disable(cap: number): void; + disableVertexAttribArray(index: number): void; + drawArrays(mode: number, first: number, count: number): void; + drawElements(mode: number, count: number, type: number, offset: number): void; + enable(cap: number): void; + enableVertexAttribArray(index: number): void; + finish(): void; + flush(): void; + framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer | null): void; + framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture | null, level: number): void; + frontFace(mode: number): void; + generateMipmap(target: number): void; + getActiveAttrib(program: WebGLProgram | null, index: number): WebGLActiveInfo | null; + getActiveUniform(program: WebGLProgram | null, index: number): WebGLActiveInfo | null; + getAttachedShaders(program: WebGLProgram | null): WebGLShader[] | null; + getAttribLocation(program: WebGLProgram | null, name: string): number; + getBufferParameter(target: number, pname: number): any; + getContextAttributes(): WebGLContextAttributes; + getError(): number; + getExtension(name: string): any; + getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; + getParameter(pname: number): any; + getProgramInfoLog(program: WebGLProgram | null): string | null; + getProgramParameter(program: WebGLProgram | null, pname: number): any; + getRenderbufferParameter(target: number, pname: number): any; + getShaderInfoLog(shader: WebGLShader | null): string | null; + getShaderParameter(shader: WebGLShader | null, pname: number): any; + getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat | null; + getShaderSource(shader: WebGLShader | null): string | null; + getSupportedExtensions(): string[] | null; + getTexParameter(target: number, pname: number): any; + getUniform(program: WebGLProgram | null, location: WebGLUniformLocation | null): any; + getUniformLocation(program: WebGLProgram | null, name: string): WebGLUniformLocation | null; + getVertexAttrib(index: number, pname: number): any; + getVertexAttribOffset(index: number, pname: number): number; + hint(target: number, mode: number): void; + isBuffer(buffer: WebGLBuffer | null): boolean; + isContextLost(): boolean; + isEnabled(cap: number): boolean; + isFramebuffer(framebuffer: WebGLFramebuffer | null): boolean; + isProgram(program: WebGLProgram | null): boolean; + isRenderbuffer(renderbuffer: WebGLRenderbuffer | null): boolean; + isShader(shader: WebGLShader | null): boolean; + isTexture(texture: WebGLTexture | null): boolean; + lineWidth(width: number): void; + linkProgram(program: WebGLProgram | null): void; + pixelStorei(pname: number, param: number | boolean): void; + polygonOffset(factor: number, units: number): void; + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void; + renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; + sampleCoverage(value: number, invert: boolean): void; + scissor(x: number, y: number, width: number, height: number): void; + shaderSource(shader: WebGLShader | null, source: string): void; + stencilFunc(func: number, ref: number, mask: number): void; + stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; + stencilMask(mask: number): void; + stencilMaskSeparate(face: number, mask: number): void; + stencilOp(fail: number, zfail: number, zpass: number): void; + stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; + texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView | null): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void; + texParameterf(target: number, pname: number, param: number): void; + texParameteri(target: number, pname: number, param: number): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void; + uniform1f(location: WebGLUniformLocation | null, x: number): void; + uniform1fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform1i(location: WebGLUniformLocation | null, x: number): void; + uniform1iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform2f(location: WebGLUniformLocation | null, x: number, y: number): void; + uniform2fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform2i(location: WebGLUniformLocation | null, x: number, y: number): void; + uniform2iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform3f(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; + uniform3fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform3i(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; + uniform3iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform4f(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; + uniform4fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform4i(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; + uniform4iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; + uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; + uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; + useProgram(program: WebGLProgram | null): void; + validateProgram(program: WebGLProgram | null): void; + vertexAttrib1f(indx: number, x: number): void; + vertexAttrib1fv(indx: number, values: Float32Array | number[]): void; + vertexAttrib2f(indx: number, x: number, y: number): void; + vertexAttrib2fv(indx: number, values: Float32Array | number[]): void; + vertexAttrib3f(indx: number, x: number, y: number, z: number): void; + vertexAttrib3fv(indx: number, values: Float32Array | number[]): void; + vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; + vertexAttrib4fv(indx: number, values: Float32Array | number[]): void; + vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; + viewport(x: number, y: number, width: number, height: number): void; + readonly ACTIVE_ATTRIBUTES: number; + readonly ACTIVE_TEXTURE: number; + readonly ACTIVE_UNIFORMS: number; + readonly ALIASED_LINE_WIDTH_RANGE: number; + readonly ALIASED_POINT_SIZE_RANGE: number; + readonly ALPHA: number; + readonly ALPHA_BITS: number; + readonly ALWAYS: number; + readonly ARRAY_BUFFER: number; + readonly ARRAY_BUFFER_BINDING: number; + readonly ATTACHED_SHADERS: number; + readonly BACK: number; + readonly BLEND: number; + readonly BLEND_COLOR: number; + readonly BLEND_DST_ALPHA: number; + readonly BLEND_DST_RGB: number; + readonly BLEND_EQUATION: number; + readonly BLEND_EQUATION_ALPHA: number; + readonly BLEND_EQUATION_RGB: number; + readonly BLEND_SRC_ALPHA: number; + readonly BLEND_SRC_RGB: number; + readonly BLUE_BITS: number; + readonly BOOL: number; + readonly BOOL_VEC2: number; + readonly BOOL_VEC3: number; + readonly BOOL_VEC4: number; + readonly BROWSER_DEFAULT_WEBGL: number; + readonly BUFFER_SIZE: number; + readonly BUFFER_USAGE: number; + readonly BYTE: number; + readonly CCW: number; + readonly CLAMP_TO_EDGE: number; + readonly COLOR_ATTACHMENT0: number; + readonly COLOR_BUFFER_BIT: number; + readonly COLOR_CLEAR_VALUE: number; + readonly COLOR_WRITEMASK: number; + readonly COMPILE_STATUS: number; + readonly COMPRESSED_TEXTURE_FORMATS: number; + readonly CONSTANT_ALPHA: number; + readonly CONSTANT_COLOR: number; + readonly CONTEXT_LOST_WEBGL: number; + readonly CULL_FACE: number; + readonly CULL_FACE_MODE: number; + readonly CURRENT_PROGRAM: number; + readonly CURRENT_VERTEX_ATTRIB: number; + readonly CW: number; + readonly DECR: number; + readonly DECR_WRAP: number; + readonly DELETE_STATUS: number; + readonly DEPTH_ATTACHMENT: number; + readonly DEPTH_BITS: number; + readonly DEPTH_BUFFER_BIT: number; + readonly DEPTH_CLEAR_VALUE: number; + readonly DEPTH_COMPONENT: number; + readonly DEPTH_COMPONENT16: number; + readonly DEPTH_FUNC: number; + readonly DEPTH_RANGE: number; + readonly DEPTH_STENCIL: number; + readonly DEPTH_STENCIL_ATTACHMENT: number; + readonly DEPTH_TEST: number; + readonly DEPTH_WRITEMASK: number; + readonly DITHER: number; + readonly DONT_CARE: number; + readonly DST_ALPHA: number; + readonly DST_COLOR: number; + readonly DYNAMIC_DRAW: number; + readonly ELEMENT_ARRAY_BUFFER: number; + readonly ELEMENT_ARRAY_BUFFER_BINDING: number; + readonly EQUAL: number; + readonly FASTEST: number; + readonly FLOAT: number; + readonly FLOAT_MAT2: number; + readonly FLOAT_MAT3: number; + readonly FLOAT_MAT4: number; + readonly FLOAT_VEC2: number; + readonly FLOAT_VEC3: number; + readonly FLOAT_VEC4: number; + readonly FRAGMENT_SHADER: number; + readonly FRAMEBUFFER: number; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + readonly FRAMEBUFFER_BINDING: number; + readonly FRAMEBUFFER_COMPLETE: number; + readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + readonly FRAMEBUFFER_UNSUPPORTED: number; + readonly FRONT: number; + readonly FRONT_AND_BACK: number; + readonly FRONT_FACE: number; + readonly FUNC_ADD: number; + readonly FUNC_REVERSE_SUBTRACT: number; + readonly FUNC_SUBTRACT: number; + readonly GENERATE_MIPMAP_HINT: number; + readonly GEQUAL: number; + readonly GREATER: number; + readonly GREEN_BITS: number; + readonly HIGH_FLOAT: number; + readonly HIGH_INT: number; + readonly IMPLEMENTATION_COLOR_READ_FORMAT: number; + readonly IMPLEMENTATION_COLOR_READ_TYPE: number; + readonly INCR: number; + readonly INCR_WRAP: number; + readonly INT: number; + readonly INT_VEC2: number; + readonly INT_VEC3: number; + readonly INT_VEC4: number; + readonly INVALID_ENUM: number; + readonly INVALID_FRAMEBUFFER_OPERATION: number; + readonly INVALID_OPERATION: number; + readonly INVALID_VALUE: number; + readonly INVERT: number; + readonly KEEP: number; + readonly LEQUAL: number; + readonly LESS: number; + readonly LINEAR: number; + readonly LINEAR_MIPMAP_LINEAR: number; + readonly LINEAR_MIPMAP_NEAREST: number; + readonly LINES: number; + readonly LINE_LOOP: number; + readonly LINE_STRIP: number; + readonly LINE_WIDTH: number; + readonly LINK_STATUS: number; + readonly LOW_FLOAT: number; + readonly LOW_INT: number; + readonly LUMINANCE: number; + readonly LUMINANCE_ALPHA: number; + readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + readonly MAX_CUBE_MAP_TEXTURE_SIZE: number; + readonly MAX_FRAGMENT_UNIFORM_VECTORS: number; + readonly MAX_RENDERBUFFER_SIZE: number; + readonly MAX_TEXTURE_IMAGE_UNITS: number; + readonly MAX_TEXTURE_SIZE: number; + readonly MAX_VARYING_VECTORS: number; + readonly MAX_VERTEX_ATTRIBS: number; + readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + readonly MAX_VERTEX_UNIFORM_VECTORS: number; + readonly MAX_VIEWPORT_DIMS: number; + readonly MEDIUM_FLOAT: number; + readonly MEDIUM_INT: number; + readonly MIRRORED_REPEAT: number; + readonly NEAREST: number; + readonly NEAREST_MIPMAP_LINEAR: number; + readonly NEAREST_MIPMAP_NEAREST: number; + readonly NEVER: number; + readonly NICEST: number; + readonly NONE: number; + readonly NOTEQUAL: number; + readonly NO_ERROR: number; + readonly ONE: number; + readonly ONE_MINUS_CONSTANT_ALPHA: number; + readonly ONE_MINUS_CONSTANT_COLOR: number; + readonly ONE_MINUS_DST_ALPHA: number; + readonly ONE_MINUS_DST_COLOR: number; + readonly ONE_MINUS_SRC_ALPHA: number; + readonly ONE_MINUS_SRC_COLOR: number; + readonly OUT_OF_MEMORY: number; + readonly PACK_ALIGNMENT: number; + readonly POINTS: number; + readonly POLYGON_OFFSET_FACTOR: number; + readonly POLYGON_OFFSET_FILL: number; + readonly POLYGON_OFFSET_UNITS: number; + readonly RED_BITS: number; + readonly RENDERBUFFER: number; + readonly RENDERBUFFER_ALPHA_SIZE: number; + readonly RENDERBUFFER_BINDING: number; + readonly RENDERBUFFER_BLUE_SIZE: number; + readonly RENDERBUFFER_DEPTH_SIZE: number; + readonly RENDERBUFFER_GREEN_SIZE: number; + readonly RENDERBUFFER_HEIGHT: number; + readonly RENDERBUFFER_INTERNAL_FORMAT: number; + readonly RENDERBUFFER_RED_SIZE: number; + readonly RENDERBUFFER_STENCIL_SIZE: number; + readonly RENDERBUFFER_WIDTH: number; + readonly RENDERER: number; + readonly REPEAT: number; + readonly REPLACE: number; + readonly RGB: number; + readonly RGB565: number; + readonly RGB5_A1: number; + readonly RGBA: number; + readonly RGBA4: number; + readonly SAMPLER_2D: number; + readonly SAMPLER_CUBE: number; + readonly SAMPLES: number; + readonly SAMPLE_ALPHA_TO_COVERAGE: number; + readonly SAMPLE_BUFFERS: number; + readonly SAMPLE_COVERAGE: number; + readonly SAMPLE_COVERAGE_INVERT: number; + readonly SAMPLE_COVERAGE_VALUE: number; + readonly SCISSOR_BOX: number; + readonly SCISSOR_TEST: number; + readonly SHADER_TYPE: number; + readonly SHADING_LANGUAGE_VERSION: number; + readonly SHORT: number; + readonly SRC_ALPHA: number; + readonly SRC_ALPHA_SATURATE: number; + readonly SRC_COLOR: number; + readonly STATIC_DRAW: number; + readonly STENCIL_ATTACHMENT: number; + readonly STENCIL_BACK_FAIL: number; + readonly STENCIL_BACK_FUNC: number; + readonly STENCIL_BACK_PASS_DEPTH_FAIL: number; + readonly STENCIL_BACK_PASS_DEPTH_PASS: number; + readonly STENCIL_BACK_REF: number; + readonly STENCIL_BACK_VALUE_MASK: number; + readonly STENCIL_BACK_WRITEMASK: number; + readonly STENCIL_BITS: number; + readonly STENCIL_BUFFER_BIT: number; + readonly STENCIL_CLEAR_VALUE: number; + readonly STENCIL_FAIL: number; + readonly STENCIL_FUNC: number; + readonly STENCIL_INDEX: number; + readonly STENCIL_INDEX8: number; + readonly STENCIL_PASS_DEPTH_FAIL: number; + readonly STENCIL_PASS_DEPTH_PASS: number; + readonly STENCIL_REF: number; + readonly STENCIL_TEST: number; + readonly STENCIL_VALUE_MASK: number; + readonly STENCIL_WRITEMASK: number; + readonly STREAM_DRAW: number; + readonly SUBPIXEL_BITS: number; + readonly TEXTURE: number; + readonly TEXTURE0: number; + readonly TEXTURE1: number; + readonly TEXTURE10: number; + readonly TEXTURE11: number; + readonly TEXTURE12: number; + readonly TEXTURE13: number; + readonly TEXTURE14: number; + readonly TEXTURE15: number; + readonly TEXTURE16: number; + readonly TEXTURE17: number; + readonly TEXTURE18: number; + readonly TEXTURE19: number; + readonly TEXTURE2: number; + readonly TEXTURE20: number; + readonly TEXTURE21: number; + readonly TEXTURE22: number; + readonly TEXTURE23: number; + readonly TEXTURE24: number; + readonly TEXTURE25: number; + readonly TEXTURE26: number; + readonly TEXTURE27: number; + readonly TEXTURE28: number; + readonly TEXTURE29: number; + readonly TEXTURE3: number; + readonly TEXTURE30: number; + readonly TEXTURE31: number; + readonly TEXTURE4: number; + readonly TEXTURE5: number; + readonly TEXTURE6: number; + readonly TEXTURE7: number; + readonly TEXTURE8: number; + readonly TEXTURE9: number; + readonly TEXTURE_2D: number; + readonly TEXTURE_BINDING_2D: number; + readonly TEXTURE_BINDING_CUBE_MAP: number; + readonly TEXTURE_CUBE_MAP: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_X: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number; + readonly TEXTURE_MAG_FILTER: number; + readonly TEXTURE_MIN_FILTER: number; + readonly TEXTURE_WRAP_S: number; + readonly TEXTURE_WRAP_T: number; + readonly TRIANGLES: number; + readonly TRIANGLE_FAN: number; + readonly TRIANGLE_STRIP: number; + readonly UNPACK_ALIGNMENT: number; + readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + readonly UNPACK_FLIP_Y_WEBGL: number; + readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + readonly UNSIGNED_BYTE: number; + readonly UNSIGNED_INT: number; + readonly UNSIGNED_SHORT: number; + readonly UNSIGNED_SHORT_4_4_4_4: number; + readonly UNSIGNED_SHORT_5_5_5_1: number; + readonly UNSIGNED_SHORT_5_6_5: number; + readonly VALIDATE_STATUS: number; + readonly VENDOR: number; + readonly VERSION: number; + readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + readonly VERTEX_ATTRIB_ARRAY_ENABLED: number; + readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + readonly VERTEX_ATTRIB_ARRAY_POINTER: number; + readonly VERTEX_ATTRIB_ARRAY_SIZE: number; + readonly VERTEX_ATTRIB_ARRAY_STRIDE: number; + readonly VERTEX_ATTRIB_ARRAY_TYPE: number; + readonly VERTEX_SHADER: number; + readonly VIEWPORT: number; + readonly ZERO: number; +} + +declare var WebGLRenderingContext: { + prototype: WebGLRenderingContext; + new(): WebGLRenderingContext; + readonly ACTIVE_ATTRIBUTES: number; + readonly ACTIVE_TEXTURE: number; + readonly ACTIVE_UNIFORMS: number; + readonly ALIASED_LINE_WIDTH_RANGE: number; + readonly ALIASED_POINT_SIZE_RANGE: number; + readonly ALPHA: number; + readonly ALPHA_BITS: number; + readonly ALWAYS: number; + readonly ARRAY_BUFFER: number; + readonly ARRAY_BUFFER_BINDING: number; + readonly ATTACHED_SHADERS: number; + readonly BACK: number; + readonly BLEND: number; + readonly BLEND_COLOR: number; + readonly BLEND_DST_ALPHA: number; + readonly BLEND_DST_RGB: number; + readonly BLEND_EQUATION: number; + readonly BLEND_EQUATION_ALPHA: number; + readonly BLEND_EQUATION_RGB: number; + readonly BLEND_SRC_ALPHA: number; + readonly BLEND_SRC_RGB: number; + readonly BLUE_BITS: number; + readonly BOOL: number; + readonly BOOL_VEC2: number; + readonly BOOL_VEC3: number; + readonly BOOL_VEC4: number; + readonly BROWSER_DEFAULT_WEBGL: number; + readonly BUFFER_SIZE: number; + readonly BUFFER_USAGE: number; + readonly BYTE: number; + readonly CCW: number; + readonly CLAMP_TO_EDGE: number; + readonly COLOR_ATTACHMENT0: number; + readonly COLOR_BUFFER_BIT: number; + readonly COLOR_CLEAR_VALUE: number; + readonly COLOR_WRITEMASK: number; + readonly COMPILE_STATUS: number; + readonly COMPRESSED_TEXTURE_FORMATS: number; + readonly CONSTANT_ALPHA: number; + readonly CONSTANT_COLOR: number; + readonly CONTEXT_LOST_WEBGL: number; + readonly CULL_FACE: number; + readonly CULL_FACE_MODE: number; + readonly CURRENT_PROGRAM: number; + readonly CURRENT_VERTEX_ATTRIB: number; + readonly CW: number; + readonly DECR: number; + readonly DECR_WRAP: number; + readonly DELETE_STATUS: number; + readonly DEPTH_ATTACHMENT: number; + readonly DEPTH_BITS: number; + readonly DEPTH_BUFFER_BIT: number; + readonly DEPTH_CLEAR_VALUE: number; + readonly DEPTH_COMPONENT: number; + readonly DEPTH_COMPONENT16: number; + readonly DEPTH_FUNC: number; + readonly DEPTH_RANGE: number; + readonly DEPTH_STENCIL: number; + readonly DEPTH_STENCIL_ATTACHMENT: number; + readonly DEPTH_TEST: number; + readonly DEPTH_WRITEMASK: number; + readonly DITHER: number; + readonly DONT_CARE: number; + readonly DST_ALPHA: number; + readonly DST_COLOR: number; + readonly DYNAMIC_DRAW: number; + readonly ELEMENT_ARRAY_BUFFER: number; + readonly ELEMENT_ARRAY_BUFFER_BINDING: number; + readonly EQUAL: number; + readonly FASTEST: number; + readonly FLOAT: number; + readonly FLOAT_MAT2: number; + readonly FLOAT_MAT3: number; + readonly FLOAT_MAT4: number; + readonly FLOAT_VEC2: number; + readonly FLOAT_VEC3: number; + readonly FLOAT_VEC4: number; + readonly FRAGMENT_SHADER: number; + readonly FRAMEBUFFER: number; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + readonly FRAMEBUFFER_BINDING: number; + readonly FRAMEBUFFER_COMPLETE: number; + readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + readonly FRAMEBUFFER_UNSUPPORTED: number; + readonly FRONT: number; + readonly FRONT_AND_BACK: number; + readonly FRONT_FACE: number; + readonly FUNC_ADD: number; + readonly FUNC_REVERSE_SUBTRACT: number; + readonly FUNC_SUBTRACT: number; + readonly GENERATE_MIPMAP_HINT: number; + readonly GEQUAL: number; + readonly GREATER: number; + readonly GREEN_BITS: number; + readonly HIGH_FLOAT: number; + readonly HIGH_INT: number; + readonly IMPLEMENTATION_COLOR_READ_FORMAT: number; + readonly IMPLEMENTATION_COLOR_READ_TYPE: number; + readonly INCR: number; + readonly INCR_WRAP: number; + readonly INT: number; + readonly INT_VEC2: number; + readonly INT_VEC3: number; + readonly INT_VEC4: number; + readonly INVALID_ENUM: number; + readonly INVALID_FRAMEBUFFER_OPERATION: number; + readonly INVALID_OPERATION: number; + readonly INVALID_VALUE: number; + readonly INVERT: number; + readonly KEEP: number; + readonly LEQUAL: number; + readonly LESS: number; + readonly LINEAR: number; + readonly LINEAR_MIPMAP_LINEAR: number; + readonly LINEAR_MIPMAP_NEAREST: number; + readonly LINES: number; + readonly LINE_LOOP: number; + readonly LINE_STRIP: number; + readonly LINE_WIDTH: number; + readonly LINK_STATUS: number; + readonly LOW_FLOAT: number; + readonly LOW_INT: number; + readonly LUMINANCE: number; + readonly LUMINANCE_ALPHA: number; + readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + readonly MAX_CUBE_MAP_TEXTURE_SIZE: number; + readonly MAX_FRAGMENT_UNIFORM_VECTORS: number; + readonly MAX_RENDERBUFFER_SIZE: number; + readonly MAX_TEXTURE_IMAGE_UNITS: number; + readonly MAX_TEXTURE_SIZE: number; + readonly MAX_VARYING_VECTORS: number; + readonly MAX_VERTEX_ATTRIBS: number; + readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + readonly MAX_VERTEX_UNIFORM_VECTORS: number; + readonly MAX_VIEWPORT_DIMS: number; + readonly MEDIUM_FLOAT: number; + readonly MEDIUM_INT: number; + readonly MIRRORED_REPEAT: number; + readonly NEAREST: number; + readonly NEAREST_MIPMAP_LINEAR: number; + readonly NEAREST_MIPMAP_NEAREST: number; + readonly NEVER: number; + readonly NICEST: number; + readonly NONE: number; + readonly NOTEQUAL: number; + readonly NO_ERROR: number; + readonly ONE: number; + readonly ONE_MINUS_CONSTANT_ALPHA: number; + readonly ONE_MINUS_CONSTANT_COLOR: number; + readonly ONE_MINUS_DST_ALPHA: number; + readonly ONE_MINUS_DST_COLOR: number; + readonly ONE_MINUS_SRC_ALPHA: number; + readonly ONE_MINUS_SRC_COLOR: number; + readonly OUT_OF_MEMORY: number; + readonly PACK_ALIGNMENT: number; + readonly POINTS: number; + readonly POLYGON_OFFSET_FACTOR: number; + readonly POLYGON_OFFSET_FILL: number; + readonly POLYGON_OFFSET_UNITS: number; + readonly RED_BITS: number; + readonly RENDERBUFFER: number; + readonly RENDERBUFFER_ALPHA_SIZE: number; + readonly RENDERBUFFER_BINDING: number; + readonly RENDERBUFFER_BLUE_SIZE: number; + readonly RENDERBUFFER_DEPTH_SIZE: number; + readonly RENDERBUFFER_GREEN_SIZE: number; + readonly RENDERBUFFER_HEIGHT: number; + readonly RENDERBUFFER_INTERNAL_FORMAT: number; + readonly RENDERBUFFER_RED_SIZE: number; + readonly RENDERBUFFER_STENCIL_SIZE: number; + readonly RENDERBUFFER_WIDTH: number; + readonly RENDERER: number; + readonly REPEAT: number; + readonly REPLACE: number; + readonly RGB: number; + readonly RGB565: number; + readonly RGB5_A1: number; + readonly RGBA: number; + readonly RGBA4: number; + readonly SAMPLER_2D: number; + readonly SAMPLER_CUBE: number; + readonly SAMPLES: number; + readonly SAMPLE_ALPHA_TO_COVERAGE: number; + readonly SAMPLE_BUFFERS: number; + readonly SAMPLE_COVERAGE: number; + readonly SAMPLE_COVERAGE_INVERT: number; + readonly SAMPLE_COVERAGE_VALUE: number; + readonly SCISSOR_BOX: number; + readonly SCISSOR_TEST: number; + readonly SHADER_TYPE: number; + readonly SHADING_LANGUAGE_VERSION: number; + readonly SHORT: number; + readonly SRC_ALPHA: number; + readonly SRC_ALPHA_SATURATE: number; + readonly SRC_COLOR: number; + readonly STATIC_DRAW: number; + readonly STENCIL_ATTACHMENT: number; + readonly STENCIL_BACK_FAIL: number; + readonly STENCIL_BACK_FUNC: number; + readonly STENCIL_BACK_PASS_DEPTH_FAIL: number; + readonly STENCIL_BACK_PASS_DEPTH_PASS: number; + readonly STENCIL_BACK_REF: number; + readonly STENCIL_BACK_VALUE_MASK: number; + readonly STENCIL_BACK_WRITEMASK: number; + readonly STENCIL_BITS: number; + readonly STENCIL_BUFFER_BIT: number; + readonly STENCIL_CLEAR_VALUE: number; + readonly STENCIL_FAIL: number; + readonly STENCIL_FUNC: number; + readonly STENCIL_INDEX: number; + readonly STENCIL_INDEX8: number; + readonly STENCIL_PASS_DEPTH_FAIL: number; + readonly STENCIL_PASS_DEPTH_PASS: number; + readonly STENCIL_REF: number; + readonly STENCIL_TEST: number; + readonly STENCIL_VALUE_MASK: number; + readonly STENCIL_WRITEMASK: number; + readonly STREAM_DRAW: number; + readonly SUBPIXEL_BITS: number; + readonly TEXTURE: number; + readonly TEXTURE0: number; + readonly TEXTURE1: number; + readonly TEXTURE10: number; + readonly TEXTURE11: number; + readonly TEXTURE12: number; + readonly TEXTURE13: number; + readonly TEXTURE14: number; + readonly TEXTURE15: number; + readonly TEXTURE16: number; + readonly TEXTURE17: number; + readonly TEXTURE18: number; + readonly TEXTURE19: number; + readonly TEXTURE2: number; + readonly TEXTURE20: number; + readonly TEXTURE21: number; + readonly TEXTURE22: number; + readonly TEXTURE23: number; + readonly TEXTURE24: number; + readonly TEXTURE25: number; + readonly TEXTURE26: number; + readonly TEXTURE27: number; + readonly TEXTURE28: number; + readonly TEXTURE29: number; + readonly TEXTURE3: number; + readonly TEXTURE30: number; + readonly TEXTURE31: number; + readonly TEXTURE4: number; + readonly TEXTURE5: number; + readonly TEXTURE6: number; + readonly TEXTURE7: number; + readonly TEXTURE8: number; + readonly TEXTURE9: number; + readonly TEXTURE_2D: number; + readonly TEXTURE_BINDING_2D: number; + readonly TEXTURE_BINDING_CUBE_MAP: number; + readonly TEXTURE_CUBE_MAP: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_X: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number; + readonly TEXTURE_MAG_FILTER: number; + readonly TEXTURE_MIN_FILTER: number; + readonly TEXTURE_WRAP_S: number; + readonly TEXTURE_WRAP_T: number; + readonly TRIANGLES: number; + readonly TRIANGLE_FAN: number; + readonly TRIANGLE_STRIP: number; + readonly UNPACK_ALIGNMENT: number; + readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + readonly UNPACK_FLIP_Y_WEBGL: number; + readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + readonly UNSIGNED_BYTE: number; + readonly UNSIGNED_INT: number; + readonly UNSIGNED_SHORT: number; + readonly UNSIGNED_SHORT_4_4_4_4: number; + readonly UNSIGNED_SHORT_5_5_5_1: number; + readonly UNSIGNED_SHORT_5_6_5: number; + readonly VALIDATE_STATUS: number; + readonly VENDOR: number; + readonly VERSION: number; + readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + readonly VERTEX_ATTRIB_ARRAY_ENABLED: number; + readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + readonly VERTEX_ATTRIB_ARRAY_POINTER: number; + readonly VERTEX_ATTRIB_ARRAY_SIZE: number; + readonly VERTEX_ATTRIB_ARRAY_STRIDE: number; + readonly VERTEX_ATTRIB_ARRAY_TYPE: number; + readonly VERTEX_SHADER: number; + readonly VIEWPORT: number; + readonly ZERO: number; +} + +interface WebGLShader extends WebGLObject { +} + +declare var WebGLShader: { + prototype: WebGLShader; + new(): WebGLShader; +} + +interface WebGLShaderPrecisionFormat { + readonly precision: number; + readonly rangeMax: number; + readonly rangeMin: number; +} + +declare var WebGLShaderPrecisionFormat: { + prototype: WebGLShaderPrecisionFormat; + new(): WebGLShaderPrecisionFormat; +} + +interface WebGLTexture extends WebGLObject { +} + +declare var WebGLTexture: { + prototype: WebGLTexture; + new(): WebGLTexture; +} + +interface WebGLUniformLocation { +} + +declare var WebGLUniformLocation: { + prototype: WebGLUniformLocation; + new(): WebGLUniformLocation; +} + +interface WebKitCSSMatrix { + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + m11: number; + m12: number; + m13: number; + m14: number; + m21: number; + m22: number; + m23: number; + m24: number; + m31: number; + m32: number; + m33: number; + m34: number; + m41: number; + m42: number; + m43: number; + m44: number; + inverse(): WebKitCSSMatrix; + multiply(secondMatrix: WebKitCSSMatrix): WebKitCSSMatrix; + rotate(angleX: number, angleY?: number, angleZ?: number): WebKitCSSMatrix; + rotateAxisAngle(x: number, y: number, z: number, angle: number): WebKitCSSMatrix; + scale(scaleX: number, scaleY?: number, scaleZ?: number): WebKitCSSMatrix; + setMatrixValue(value: string): void; + skewX(angle: number): WebKitCSSMatrix; + skewY(angle: number): WebKitCSSMatrix; + toString(): string; + translate(x: number, y: number, z?: number): WebKitCSSMatrix; +} + +declare var WebKitCSSMatrix: { + prototype: WebKitCSSMatrix; + new(text?: string): WebKitCSSMatrix; +} + +interface WebKitDirectoryEntry extends WebKitEntry { + createReader(): WebKitDirectoryReader; +} + +declare var WebKitDirectoryEntry: { + prototype: WebKitDirectoryEntry; + new(): WebKitDirectoryEntry; +} + +interface WebKitDirectoryReader { + readEntries(successCallback: WebKitEntriesCallback, errorCallback?: WebKitErrorCallback): void; +} + +declare var WebKitDirectoryReader: { + prototype: WebKitDirectoryReader; + new(): WebKitDirectoryReader; +} + +interface WebKitEntry { + readonly filesystem: WebKitFileSystem; + readonly fullPath: string; + readonly isDirectory: boolean; + readonly isFile: boolean; + readonly name: string; +} + +declare var WebKitEntry: { + prototype: WebKitEntry; + new(): WebKitEntry; +} + +interface WebKitFileEntry extends WebKitEntry { + file(successCallback: WebKitFileCallback, errorCallback?: WebKitErrorCallback): void; +} + +declare var WebKitFileEntry: { + prototype: WebKitFileEntry; + new(): WebKitFileEntry; +} + +interface WebKitFileSystem { + readonly name: string; + readonly root: WebKitDirectoryEntry; +} + +declare var WebKitFileSystem: { + prototype: WebKitFileSystem; + new(): WebKitFileSystem; +} + +interface WebKitPoint { + x: number; + y: number; +} + +declare var WebKitPoint: { + prototype: WebKitPoint; + new(x?: number, y?: number): WebKitPoint; +} + +interface WebSocketEventMap { + "close": CloseEvent; + "error": Event; + "message": MessageEvent; + "open": Event; +} + +interface WebSocket extends EventTarget { + binaryType: string; + readonly bufferedAmount: number; + readonly extensions: string; + onclose: (this: WebSocket, ev: CloseEvent) => any; + onerror: (this: WebSocket, ev: Event) => any; + onmessage: (this: WebSocket, ev: MessageEvent) => any; + onopen: (this: WebSocket, ev: Event) => any; + readonly protocol: string; + readonly readyState: number; + readonly url: string; + close(code?: number, reason?: string): void; + send(data: any): void; + readonly CLOSED: number; + readonly CLOSING: number; + readonly CONNECTING: number; + readonly OPEN: number; + addEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var WebSocket: { + prototype: WebSocket; + new(url: string, protocols?: string | string[]): WebSocket; + readonly CLOSED: number; + readonly CLOSING: number; + readonly CONNECTING: number; + readonly OPEN: number; +} + +interface WheelEvent extends MouseEvent { + readonly deltaMode: number; + readonly deltaX: number; + readonly deltaY: number; + readonly deltaZ: number; + readonly wheelDelta: number; + readonly wheelDeltaX: number; + readonly wheelDeltaY: number; + getCurrentPoint(element: Element): void; + initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; + readonly DOM_DELTA_LINE: number; + readonly DOM_DELTA_PAGE: number; + readonly DOM_DELTA_PIXEL: number; +} + +declare var WheelEvent: { + prototype: WheelEvent; + new(typeArg: string, eventInitDict?: WheelEventInit): WheelEvent; + readonly DOM_DELTA_LINE: number; + readonly DOM_DELTA_PAGE: number; + readonly DOM_DELTA_PIXEL: number; +} + +interface WindowEventMap extends GlobalEventHandlersEventMap { + "abort": UIEvent; + "afterprint": Event; + "beforeprint": Event; + "beforeunload": BeforeUnloadEvent; + "blur": FocusEvent; + "canplay": Event; + "canplaythrough": Event; + "change": Event; + "click": MouseEvent; + "compassneedscalibration": Event; + "contextmenu": PointerEvent; + "dblclick": MouseEvent; + "devicelight": DeviceLightEvent; + "devicemotion": DeviceMotionEvent; + "deviceorientation": DeviceOrientationEvent; + "drag": DragEvent; + "dragend": DragEvent; + "dragenter": DragEvent; + "dragleave": DragEvent; + "dragover": DragEvent; + "dragstart": DragEvent; + "drop": DragEvent; + "durationchange": Event; + "emptied": Event; + "ended": MediaStreamErrorEvent; + "focus": FocusEvent; + "hashchange": HashChangeEvent; + "input": Event; + "invalid": Event; + "keydown": KeyboardEvent; + "keypress": KeyboardEvent; + "keyup": KeyboardEvent; + "load": Event; + "loadeddata": Event; + "loadedmetadata": Event; + "loadstart": Event; + "message": MessageEvent; + "mousedown": MouseEvent; + "mouseenter": MouseEvent; + "mouseleave": MouseEvent; + "mousemove": MouseEvent; + "mouseout": MouseEvent; + "mouseover": MouseEvent; + "mouseup": MouseEvent; + "mousewheel": WheelEvent; + "MSGestureChange": MSGestureEvent; + "MSGestureDoubleTap": MSGestureEvent; + "MSGestureEnd": MSGestureEvent; + "MSGestureHold": MSGestureEvent; + "MSGestureStart": MSGestureEvent; + "MSGestureTap": MSGestureEvent; + "MSInertiaStart": MSGestureEvent; + "MSPointerCancel": MSPointerEvent; + "MSPointerDown": MSPointerEvent; + "MSPointerEnter": MSPointerEvent; + "MSPointerLeave": MSPointerEvent; + "MSPointerMove": MSPointerEvent; + "MSPointerOut": MSPointerEvent; + "MSPointerOver": MSPointerEvent; + "MSPointerUp": MSPointerEvent; + "offline": Event; + "online": Event; + "orientationchange": Event; + "pagehide": PageTransitionEvent; + "pageshow": PageTransitionEvent; + "pause": Event; + "play": Event; + "playing": Event; + "popstate": PopStateEvent; + "progress": ProgressEvent; + "ratechange": Event; + "readystatechange": ProgressEvent; + "reset": Event; + "resize": UIEvent; + "scroll": UIEvent; + "seeked": Event; + "seeking": Event; + "select": UIEvent; + "stalled": Event; + "storage": StorageEvent; + "submit": Event; + "suspend": Event; + "timeupdate": Event; + "unload": Event; + "volumechange": Event; + "waiting": Event; +} + +interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64, GlobalFetch { + readonly applicationCache: ApplicationCache; + readonly caches: CacheStorage; + readonly clientInformation: Navigator; + readonly closed: boolean; + readonly crypto: Crypto; + defaultStatus: string; + readonly devicePixelRatio: number; + readonly doNotTrack: string; + readonly document: Document; + event: Event | undefined; + readonly external: External; + readonly frameElement: Element; + readonly frames: Window; + readonly history: History; + readonly innerHeight: number; + readonly innerWidth: number; + readonly isSecureContext: boolean; + readonly length: number; + readonly location: Location; + readonly locationbar: BarProp; + readonly menubar: BarProp; + readonly msContentScript: ExtensionScriptApis; + readonly msCredentials: MSCredentials; + name: string; + readonly navigator: Navigator; + offscreenBuffering: string | boolean; + onabort: (this: Window, ev: UIEvent) => any; + onafterprint: (this: Window, ev: Event) => any; + onbeforeprint: (this: Window, ev: Event) => any; + onbeforeunload: (this: Window, ev: BeforeUnloadEvent) => any; + onblur: (this: Window, ev: FocusEvent) => any; + oncanplay: (this: Window, ev: Event) => any; + oncanplaythrough: (this: Window, ev: Event) => any; + onchange: (this: Window, ev: Event) => any; + onclick: (this: Window, ev: MouseEvent) => any; + oncompassneedscalibration: (this: Window, ev: Event) => any; + oncontextmenu: (this: Window, ev: PointerEvent) => any; + ondblclick: (this: Window, ev: MouseEvent) => any; + ondevicelight: (this: Window, ev: DeviceLightEvent) => any; + ondevicemotion: (this: Window, ev: DeviceMotionEvent) => any; + ondeviceorientation: (this: Window, ev: DeviceOrientationEvent) => any; + ondrag: (this: Window, ev: DragEvent) => any; + ondragend: (this: Window, ev: DragEvent) => any; + ondragenter: (this: Window, ev: DragEvent) => any; + ondragleave: (this: Window, ev: DragEvent) => any; + ondragover: (this: Window, ev: DragEvent) => any; + ondragstart: (this: Window, ev: DragEvent) => any; + ondrop: (this: Window, ev: DragEvent) => any; + ondurationchange: (this: Window, ev: Event) => any; + onemptied: (this: Window, ev: Event) => any; + onended: (this: Window, ev: MediaStreamErrorEvent) => any; + onerror: ErrorEventHandler; + onfocus: (this: Window, ev: FocusEvent) => any; + onhashchange: (this: Window, ev: HashChangeEvent) => any; + oninput: (this: Window, ev: Event) => any; + oninvalid: (this: Window, ev: Event) => any; + onkeydown: (this: Window, ev: KeyboardEvent) => any; + onkeypress: (this: Window, ev: KeyboardEvent) => any; + onkeyup: (this: Window, ev: KeyboardEvent) => any; + onload: (this: Window, ev: Event) => any; + onloadeddata: (this: Window, ev: Event) => any; + onloadedmetadata: (this: Window, ev: Event) => any; + onloadstart: (this: Window, ev: Event) => any; + onmessage: (this: Window, ev: MessageEvent) => any; + onmousedown: (this: Window, ev: MouseEvent) => any; + onmouseenter: (this: Window, ev: MouseEvent) => any; + onmouseleave: (this: Window, ev: MouseEvent) => any; + onmousemove: (this: Window, ev: MouseEvent) => any; + onmouseout: (this: Window, ev: MouseEvent) => any; + onmouseover: (this: Window, ev: MouseEvent) => any; + onmouseup: (this: Window, ev: MouseEvent) => any; + onmousewheel: (this: Window, ev: WheelEvent) => any; + onmsgesturechange: (this: Window, ev: MSGestureEvent) => any; + onmsgesturedoubletap: (this: Window, ev: MSGestureEvent) => any; + onmsgestureend: (this: Window, ev: MSGestureEvent) => any; + onmsgesturehold: (this: Window, ev: MSGestureEvent) => any; + onmsgesturestart: (this: Window, ev: MSGestureEvent) => any; + onmsgesturetap: (this: Window, ev: MSGestureEvent) => any; + onmsinertiastart: (this: Window, ev: MSGestureEvent) => any; + onmspointercancel: (this: Window, ev: MSPointerEvent) => any; + onmspointerdown: (this: Window, ev: MSPointerEvent) => any; + onmspointerenter: (this: Window, ev: MSPointerEvent) => any; + onmspointerleave: (this: Window, ev: MSPointerEvent) => any; + onmspointermove: (this: Window, ev: MSPointerEvent) => any; + onmspointerout: (this: Window, ev: MSPointerEvent) => any; + onmspointerover: (this: Window, ev: MSPointerEvent) => any; + onmspointerup: (this: Window, ev: MSPointerEvent) => any; + onoffline: (this: Window, ev: Event) => any; + ononline: (this: Window, ev: Event) => any; + onorientationchange: (this: Window, ev: Event) => any; + onpagehide: (this: Window, ev: PageTransitionEvent) => any; + onpageshow: (this: Window, ev: PageTransitionEvent) => any; + onpause: (this: Window, ev: Event) => any; + onplay: (this: Window, ev: Event) => any; + onplaying: (this: Window, ev: Event) => any; + onpopstate: (this: Window, ev: PopStateEvent) => any; + onprogress: (this: Window, ev: ProgressEvent) => any; + onratechange: (this: Window, ev: Event) => any; + onreadystatechange: (this: Window, ev: ProgressEvent) => any; + onreset: (this: Window, ev: Event) => any; + onresize: (this: Window, ev: UIEvent) => any; + onscroll: (this: Window, ev: UIEvent) => any; + onseeked: (this: Window, ev: Event) => any; + onseeking: (this: Window, ev: Event) => any; + onselect: (this: Window, ev: UIEvent) => any; + onstalled: (this: Window, ev: Event) => any; + onstorage: (this: Window, ev: StorageEvent) => any; + onsubmit: (this: Window, ev: Event) => any; + onsuspend: (this: Window, ev: Event) => any; + ontimeupdate: (this: Window, ev: Event) => any; + ontouchcancel: (ev: TouchEvent) => any; + ontouchend: (ev: TouchEvent) => any; + ontouchmove: (ev: TouchEvent) => any; + ontouchstart: (ev: TouchEvent) => any; + onunload: (this: Window, ev: Event) => any; + onvolumechange: (this: Window, ev: Event) => any; + onwaiting: (this: Window, ev: Event) => any; + opener: any; + orientation: string | number; + readonly outerHeight: number; + readonly outerWidth: number; + readonly pageXOffset: number; + readonly pageYOffset: number; + readonly parent: Window; + readonly performance: Performance; + readonly personalbar: BarProp; + readonly screen: Screen; + readonly screenLeft: number; + readonly screenTop: number; + readonly screenX: number; + readonly screenY: number; + readonly scrollX: number; + readonly scrollY: number; + readonly scrollbars: BarProp; + readonly self: Window; + readonly speechSynthesis: SpeechSynthesis; + status: string; + readonly statusbar: BarProp; + readonly styleMedia: StyleMedia; + readonly toolbar: BarProp; + readonly top: Window; + readonly window: Window; + URL: typeof URL; + URLSearchParams: typeof URLSearchParams; + Blob: typeof Blob; + customElements: CustomElementRegistry; + alert(message?: any): void; + blur(): void; + cancelAnimationFrame(handle: number): void; + captureEvents(): void; + close(): void; + confirm(message?: string): boolean; + departFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void; + focus(): void; + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; + getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; + getSelection(): Selection; + matchMedia(mediaQuery: string): MediaQueryList; + moveBy(x?: number, y?: number): void; + moveTo(x?: number, y?: number): void; + msWriteProfilerMark(profilerMarkName: string): void; + open(url?: string, target?: string, features?: string, replace?: boolean): Window; + postMessage(message: any, targetOrigin: string, transfer?: any[]): void; + print(): void; + prompt(message?: string, _default?: string): string | null; + releaseEvents(): void; + requestAnimationFrame(callback: FrameRequestCallback): number; + resizeBy(x?: number, y?: number): void; + resizeTo(x?: number, y?: number): void; + scroll(x?: number, y?: number): void; + scrollBy(x?: number, y?: number): void; + scrollTo(x?: number, y?: number): void; + stop(): void; + webkitCancelAnimationFrame(handle: number): void; + webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; + webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; + webkitRequestAnimationFrame(callback: FrameRequestCallback): number; + createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise; + createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise; + scroll(options?: ScrollToOptions): void; + scrollTo(options?: ScrollToOptions): void; + scrollBy(options?: ScrollToOptions): void; + addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Window: { + prototype: Window; + new(): Window; +} + +interface WorkerEventMap extends AbstractWorkerEventMap { + "message": MessageEvent; +} + +interface Worker extends EventTarget, AbstractWorker { + onmessage: (this: Worker, ev: MessageEvent) => any; + postMessage(message: any, transfer?: any[]): void; + terminate(): void; + addEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Worker: { + prototype: Worker; + new(stringUrl: string): Worker; +} + +interface XMLDocument extends Document { + addEventListener(type: K, listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var XMLDocument: { + prototype: XMLDocument; + new(): XMLDocument; +} + +interface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap { + "readystatechange": Event; +} + +interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { + onreadystatechange: (this: XMLHttpRequest, ev: Event) => any; + readonly readyState: number; + readonly response: any; + readonly responseText: string; + responseType: XMLHttpRequestResponseType; + readonly responseURL: string; + readonly responseXML: Document | null; + readonly status: number; + readonly statusText: string; + timeout: number; + readonly upload: XMLHttpRequestUpload; + withCredentials: boolean; + msCaching?: string; + abort(): void; + getAllResponseHeaders(): string; + getResponseHeader(header: string): string | null; + msCachingEnabled(): boolean; + open(method: string, url: string, async?: boolean, user?: string, password?: string): void; + overrideMimeType(mime: string): void; + send(data?: Document): void; + send(data?: string): void; + send(data?: any): void; + setRequestHeader(header: string, value: string): void; + readonly DONE: number; + readonly HEADERS_RECEIVED: number; + readonly LOADING: number; + readonly OPENED: number; + readonly UNSENT: number; + addEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var XMLHttpRequest: { + prototype: XMLHttpRequest; + new(): XMLHttpRequest; + readonly DONE: number; + readonly HEADERS_RECEIVED: number; + readonly LOADING: number; + readonly OPENED: number; + readonly UNSENT: number; +} + +interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget { + addEventListener(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var XMLHttpRequestUpload: { + prototype: XMLHttpRequestUpload; + new(): XMLHttpRequestUpload; +} + +interface XMLSerializer { + serializeToString(target: Node): string; +} + +declare var XMLSerializer: { + prototype: XMLSerializer; + new(): XMLSerializer; +} + +interface XPathEvaluator { + createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; + createNSResolver(nodeResolver?: Node): XPathNSResolver; + evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult; +} + +declare var XPathEvaluator: { + prototype: XPathEvaluator; + new(): XPathEvaluator; +} + +interface XPathExpression { + evaluate(contextNode: Node, type: number, result: XPathResult | null): XPathResult; +} + +declare var XPathExpression: { + prototype: XPathExpression; + new(): XPathExpression; +} + +interface XPathNSResolver { + lookupNamespaceURI(prefix: string): string; +} + +declare var XPathNSResolver: { + prototype: XPathNSResolver; + new(): XPathNSResolver; +} + +interface XPathResult { + readonly booleanValue: boolean; + readonly invalidIteratorState: boolean; + readonly numberValue: number; + readonly resultType: number; + readonly singleNodeValue: Node; + readonly snapshotLength: number; + readonly stringValue: string; + iterateNext(): Node; + snapshotItem(index: number): Node; + readonly ANY_TYPE: number; + readonly ANY_UNORDERED_NODE_TYPE: number; + readonly BOOLEAN_TYPE: number; + readonly FIRST_ORDERED_NODE_TYPE: number; + readonly NUMBER_TYPE: number; + readonly ORDERED_NODE_ITERATOR_TYPE: number; + readonly ORDERED_NODE_SNAPSHOT_TYPE: number; + readonly STRING_TYPE: number; + readonly UNORDERED_NODE_ITERATOR_TYPE: number; + readonly UNORDERED_NODE_SNAPSHOT_TYPE: number; +} + +declare var XPathResult: { + prototype: XPathResult; + new(): XPathResult; + readonly ANY_TYPE: number; + readonly ANY_UNORDERED_NODE_TYPE: number; + readonly BOOLEAN_TYPE: number; + readonly FIRST_ORDERED_NODE_TYPE: number; + readonly NUMBER_TYPE: number; + readonly ORDERED_NODE_ITERATOR_TYPE: number; + readonly ORDERED_NODE_SNAPSHOT_TYPE: number; + readonly STRING_TYPE: number; + readonly UNORDERED_NODE_ITERATOR_TYPE: number; + readonly UNORDERED_NODE_SNAPSHOT_TYPE: number; +} + +interface XSLTProcessor { + clearParameters(): void; + getParameter(namespaceURI: string, localName: string): any; + importStylesheet(style: Node): void; + removeParameter(namespaceURI: string, localName: string): void; + reset(): void; + setParameter(namespaceURI: string, localName: string, value: any): void; + transformToDocument(source: Node): Document; + transformToFragment(source: Node, document: Document): DocumentFragment; +} + +declare var XSLTProcessor: { + prototype: XSLTProcessor; + new(): XSLTProcessor; +} + +interface webkitRTCPeerConnection extends RTCPeerConnection { + addEventListener(type: K, listener: (this: webkitRTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var webkitRTCPeerConnection: { + prototype: webkitRTCPeerConnection; + new(configuration: RTCConfiguration): webkitRTCPeerConnection; +} + +interface AbstractWorkerEventMap { + "error": ErrorEvent; +} + +interface AbstractWorker { + onerror: (this: AbstractWorker, ev: ErrorEvent) => any; + addEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface Body { + readonly bodyUsed: boolean; + arrayBuffer(): Promise; + blob(): Promise; + json(): Promise; + text(): Promise; + formData(): Promise; +} + +interface CanvasPathMethods { + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + closePath(): void; + ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + lineTo(x: number, y: number): void; + moveTo(x: number, y: number): void; + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + rect(x: number, y: number, w: number, h: number): void; +} + +interface ChildNode { + remove(): void; +} + +interface DOML2DeprecatedColorProperty { + color: string; +} + +interface DOML2DeprecatedSizeProperty { + size: number; +} + +interface DocumentEvent { + createEvent(eventInterface:"AnimationEvent"): AnimationEvent; + createEvent(eventInterface:"AudioProcessingEvent"): AudioProcessingEvent; + createEvent(eventInterface:"BeforeUnloadEvent"): BeforeUnloadEvent; + createEvent(eventInterface:"ClipboardEvent"): ClipboardEvent; + createEvent(eventInterface:"CloseEvent"): CloseEvent; + createEvent(eventInterface:"CompositionEvent"): CompositionEvent; + createEvent(eventInterface:"CustomEvent"): CustomEvent; + createEvent(eventInterface:"DeviceLightEvent"): DeviceLightEvent; + createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent; + createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent; + createEvent(eventInterface:"DragEvent"): DragEvent; + createEvent(eventInterface:"ErrorEvent"): ErrorEvent; + createEvent(eventInterface:"Event"): Event; + createEvent(eventInterface:"Events"): Event; + createEvent(eventInterface:"FocusEvent"): FocusEvent; + createEvent(eventInterface:"FocusNavigationEvent"): FocusNavigationEvent; + createEvent(eventInterface:"GamepadEvent"): GamepadEvent; + createEvent(eventInterface:"HashChangeEvent"): HashChangeEvent; + createEvent(eventInterface:"IDBVersionChangeEvent"): IDBVersionChangeEvent; + createEvent(eventInterface:"KeyboardEvent"): KeyboardEvent; + createEvent(eventInterface:"ListeningStateChangedEvent"): ListeningStateChangedEvent; + createEvent(eventInterface:"LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent; + createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; + createEvent(eventInterface:"MSManipulationEvent"): MSManipulationEvent; + createEvent(eventInterface:"MSMediaKeyMessageEvent"): MSMediaKeyMessageEvent; + createEvent(eventInterface:"MSMediaKeyNeededEvent"): MSMediaKeyNeededEvent; + createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; + createEvent(eventInterface:"MSSiteModeEvent"): MSSiteModeEvent; + createEvent(eventInterface:"MediaEncryptedEvent"): MediaEncryptedEvent; + createEvent(eventInterface:"MediaKeyMessageEvent"): MediaKeyMessageEvent; + createEvent(eventInterface:"MediaStreamErrorEvent"): MediaStreamErrorEvent; + createEvent(eventInterface:"MediaStreamEvent"): MediaStreamEvent; + createEvent(eventInterface:"MediaStreamTrackEvent"): MediaStreamTrackEvent; + createEvent(eventInterface:"MessageEvent"): MessageEvent; + createEvent(eventInterface:"MouseEvent"): MouseEvent; + createEvent(eventInterface:"MouseEvents"): MouseEvent; + createEvent(eventInterface:"MutationEvent"): MutationEvent; + createEvent(eventInterface:"MutationEvents"): MutationEvent; + createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent; + createEvent(eventInterface:"NavigationEvent"): NavigationEvent; + createEvent(eventInterface:"NavigationEventWithReferrer"): NavigationEventWithReferrer; + createEvent(eventInterface:"OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; + createEvent(eventInterface:"OverflowEvent"): OverflowEvent; + createEvent(eventInterface:"PageTransitionEvent"): PageTransitionEvent; + createEvent(eventInterface:"PaymentRequestUpdateEvent"): PaymentRequestUpdateEvent; + createEvent(eventInterface:"PermissionRequestedEvent"): PermissionRequestedEvent; + createEvent(eventInterface:"PointerEvent"): PointerEvent; + createEvent(eventInterface:"PopStateEvent"): PopStateEvent; + createEvent(eventInterface:"ProgressEvent"): ProgressEvent; + createEvent(eventInterface:"RTCDTMFToneChangeEvent"): RTCDTMFToneChangeEvent; + createEvent(eventInterface:"RTCDtlsTransportStateChangedEvent"): RTCDtlsTransportStateChangedEvent; + createEvent(eventInterface:"RTCIceCandidatePairChangedEvent"): RTCIceCandidatePairChangedEvent; + createEvent(eventInterface:"RTCIceGathererEvent"): RTCIceGathererEvent; + createEvent(eventInterface:"RTCIceTransportStateChangedEvent"): RTCIceTransportStateChangedEvent; + createEvent(eventInterface:"RTCPeerConnectionIceEvent"): RTCPeerConnectionIceEvent; + createEvent(eventInterface:"RTCSsrcConflictEvent"): RTCSsrcConflictEvent; + createEvent(eventInterface:"SVGZoomEvent"): SVGZoomEvent; + createEvent(eventInterface:"SVGZoomEvents"): SVGZoomEvent; + createEvent(eventInterface:"ScriptNotifyEvent"): ScriptNotifyEvent; + createEvent(eventInterface:"ServiceWorkerMessageEvent"): ServiceWorkerMessageEvent; + createEvent(eventInterface:"SpeechSynthesisEvent"): SpeechSynthesisEvent; + createEvent(eventInterface:"StorageEvent"): StorageEvent; + createEvent(eventInterface:"TextEvent"): TextEvent; + createEvent(eventInterface:"TouchEvent"): TouchEvent; + createEvent(eventInterface:"TrackEvent"): TrackEvent; + createEvent(eventInterface:"TransitionEvent"): TransitionEvent; + createEvent(eventInterface:"UIEvent"): UIEvent; + createEvent(eventInterface:"UIEvents"): UIEvent; + createEvent(eventInterface:"UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; + createEvent(eventInterface:"WebGLContextEvent"): WebGLContextEvent; + createEvent(eventInterface:"WheelEvent"): WheelEvent; + createEvent(eventInterface: string): Event; +} + +interface ElementTraversal { + readonly childElementCount: number; + readonly firstElementChild: Element | null; + readonly lastElementChild: Element | null; + readonly nextElementSibling: Element | null; + readonly previousElementSibling: Element | null; +} + +interface GetSVGDocument { + getSVGDocument(): Document; +} + +interface GlobalEventHandlersEventMap { + "pointercancel": PointerEvent; + "pointerdown": PointerEvent; + "pointerenter": PointerEvent; + "pointerleave": PointerEvent; + "pointermove": PointerEvent; + "pointerout": PointerEvent; + "pointerover": PointerEvent; + "pointerup": PointerEvent; + "wheel": WheelEvent; +} + +interface GlobalEventHandlers { + onpointercancel: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onpointerdown: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onpointerenter: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onpointerleave: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onpointermove: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onpointerout: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onpointerover: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onpointerup: (this: GlobalEventHandlers, ev: PointerEvent) => any; + onwheel: (this: GlobalEventHandlers, ev: WheelEvent) => any; + addEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface GlobalFetch { + fetch(input: RequestInfo, init?: RequestInit): Promise; +} + +interface HTMLTableAlignment { + /** + * Sets or retrieves a value that you can use to implement your own ch functionality for the object. + */ + ch: string; + /** + * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. + */ + chOff: string; + /** + * Sets or retrieves how text and other content are vertically aligned within the object that contains them. + */ + vAlign: string; +} + +interface IDBEnvironment { + readonly indexedDB: IDBFactory; +} + +interface LinkStyle { + readonly sheet: StyleSheet; +} + +interface MSBaseReaderEventMap { + "abort": Event; + "error": ErrorEvent; + "load": Event; + "loadend": ProgressEvent; + "loadstart": Event; + "progress": ProgressEvent; +} + +interface MSBaseReader { + onabort: (this: MSBaseReader, ev: Event) => any; + onerror: (this: MSBaseReader, ev: ErrorEvent) => any; + onload: (this: MSBaseReader, ev: Event) => any; + onloadend: (this: MSBaseReader, ev: ProgressEvent) => any; + onloadstart: (this: MSBaseReader, ev: Event) => any; + onprogress: (this: MSBaseReader, ev: ProgressEvent) => any; + readonly readyState: number; + readonly result: any; + abort(): void; + readonly DONE: number; + readonly EMPTY: number; + readonly LOADING: number; + addEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface MSFileSaver { + msSaveBlob(blob: any, defaultName?: string): boolean; + msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; +} + +interface MSNavigatorDoNotTrack { + confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; + confirmWebWideTrackingException(args: ExceptionInformation): boolean; + removeSiteSpecificTrackingException(args: ExceptionInformation): void; + removeWebWideTrackingException(args: ExceptionInformation): void; + storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; + storeWebWideTrackingException(args: StoreExceptionsInformation): void; +} + +interface NavigatorBeacon { + sendBeacon(url: USVString, data?: BodyInit): boolean; +} + +interface NavigatorConcurrentHardware { + readonly hardwareConcurrency: number; +} + +interface NavigatorContentUtils { +} + +interface NavigatorGeolocation { + readonly geolocation: Geolocation; +} + +interface NavigatorID { + readonly appCodeName: string; + readonly appName: string; + readonly appVersion: string; + readonly platform: string; + readonly product: string; + readonly productSub: string; + readonly userAgent: string; + readonly vendor: string; + readonly vendorSub: string; +} + +interface NavigatorOnLine { + readonly onLine: boolean; +} + +interface NavigatorStorageUtils { +} + +interface NavigatorUserMedia { + readonly mediaDevices: MediaDevices; + getUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback): void; +} + +interface NodeSelector { + querySelector(selectors: K): ElementTagNameMap[K] | null; + querySelector(selectors: string): Element | null; + querySelectorAll(selectors: K): ElementListTagNameMap[K]; + querySelectorAll(selectors: string): NodeListOf; +} + +interface RandomSource { + getRandomValues(array: ArrayBufferView): ArrayBufferView; +} + +interface SVGAnimatedPoints { + readonly animatedPoints: SVGPointList; + readonly points: SVGPointList; +} + +interface SVGFilterPrimitiveStandardAttributes { + readonly height: SVGAnimatedLength; + readonly result: SVGAnimatedString; + readonly width: SVGAnimatedLength; + readonly x: SVGAnimatedLength; + readonly y: SVGAnimatedLength; +} + +interface SVGFitToViewBox { + readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + readonly viewBox: SVGAnimatedRect; +} + +interface SVGTests { + readonly requiredExtensions: SVGStringList; + readonly requiredFeatures: SVGStringList; + readonly systemLanguage: SVGStringList; + hasExtension(extension: string): boolean; +} + +interface SVGURIReference { + readonly href: SVGAnimatedString; +} + +interface WindowBase64 { + atob(encodedString: string): string; + btoa(rawString: string): string; +} + +interface WindowConsole { + readonly console: Console; +} + +interface WindowLocalStorage { + readonly localStorage: Storage; +} + +interface WindowSessionStorage { + readonly sessionStorage: Storage; +} + +interface WindowTimers extends Object, WindowTimersExtension { + clearInterval(handle: number): void; + clearTimeout(handle: number): void; + setInterval(handler: (...args: any[]) => void, timeout: number): number; + setInterval(handler: any, timeout?: any, ...args: any[]): number; + setTimeout(handler: (...args: any[]) => void, timeout: number): number; + setTimeout(handler: any, timeout?: any, ...args: any[]): number; +} + +interface WindowTimersExtension { + clearImmediate(handle: number): void; + setImmediate(handler: (...args: any[]) => void): number; + setImmediate(handler: any, ...args: any[]): number; +} + +interface XMLHttpRequestEventTargetEventMap { + "abort": Event; + "error": ErrorEvent; + "load": Event; + "loadend": ProgressEvent; + "loadstart": Event; + "progress": ProgressEvent; + "timeout": ProgressEvent; +} + +interface XMLHttpRequestEventTarget { + onabort: (this: XMLHttpRequestEventTarget, ev: Event) => any; + onerror: (this: XMLHttpRequestEventTarget, ev: ErrorEvent) => any; + onload: (this: XMLHttpRequestEventTarget, ev: Event) => any; + onloadend: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; + onloadstart: (this: XMLHttpRequestEventTarget, ev: Event) => any; + onprogress: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; + ontimeout: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; + addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface ErrorEventInit { + message?: string; + filename?: string; + lineno?: number; + conlno?: number; + error?: any; +} + +interface StorageEventInit extends EventInit { + key?: string; + oldValue?: string; + newValue?: string; + url: string; + storageArea?: Storage; +} + +interface Canvas2DContextAttributes { + alpha?: boolean; + willReadFrequently?: boolean; + storage?: boolean; + [attribute: string]: boolean | string | undefined; +} + +interface ImageBitmapOptions { + imageOrientation?: "none" | "flipY"; + premultiplyAlpha?: "none" | "premultiply" | "default"; + colorSpaceConversion?: "none" | "default"; + resizeWidth?: number; + resizeHeight?: number; + resizeQuality?: "pixelated" | "low" | "medium" | "high"; +} + +interface ImageBitmap { + readonly width: number; + readonly height: number; + close(): void; +} + +interface URLSearchParams { + /** + * Appends a specified key/value pair as a new search parameter. + */ + append(name: string, value: string): void; + /** + * Deletes the given search parameter, and its associated value, from the list of all search parameters. + */ + delete(name: string): void; + /** + * Returns the first value associated to the given search parameter. + */ + get(name: string): string | null; + /** + * Returns all the values association with a given search parameter. + */ + getAll(name: string): string[]; + /** + * Returns a Boolean indicating if such a search parameter exists. + */ + has(name: string): boolean; + /** + * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others. + */ + set(name: string, value: string): void; +} + +declare var URLSearchParams: { + prototype: URLSearchParams; + /** + * Constructor returning a URLSearchParams object. + */ + new (init?: string | URLSearchParams): URLSearchParams; +} + +interface NodeListOf extends NodeList { + length: number; + item(index: number): TNode; + [index: number]: TNode; +} + +interface HTMLCollectionOf extends HTMLCollection { + item(index: number): T; + namedItem(name: string): T; + [index: number]: T; +} + +interface BlobPropertyBag { + type?: string; + endings?: string; +} + +interface FilePropertyBag { + type?: string; + lastModified?: number; +} + +interface EventListenerObject { + handleEvent(evt: Event): void; +} + +interface ProgressEventInit extends EventInit { + lengthComputable?: boolean; + loaded?: number; + total?: number; +} + +interface ScrollOptions { + behavior?: ScrollBehavior; +} + +interface ScrollToOptions extends ScrollOptions { + left?: number; + top?: number; +} + +interface ScrollIntoViewOptions extends ScrollOptions { + block?: ScrollLogicalPosition; + inline?: ScrollLogicalPosition; +} + +interface ClipboardEventInit extends EventInit { + data?: string; + dataType?: string; +} + +interface IDBArrayKey extends Array { +} + +interface RsaKeyGenParams extends Algorithm { + modulusLength: number; + publicExponent: Uint8Array; +} + +interface RsaHashedKeyGenParams extends RsaKeyGenParams { + hash: AlgorithmIdentifier; +} + +interface RsaKeyAlgorithm extends KeyAlgorithm { + modulusLength: number; + publicExponent: Uint8Array; +} + +interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { + hash: AlgorithmIdentifier; +} + +interface RsaHashedImportParams { + hash: AlgorithmIdentifier; +} + +interface RsaPssParams { + saltLength: number; +} + +interface RsaOaepParams extends Algorithm { + label?: BufferSource; +} + +interface EcdsaParams extends Algorithm { + hash: AlgorithmIdentifier; +} + +interface EcKeyGenParams extends Algorithm { + namedCurve: string; +} + +interface EcKeyAlgorithm extends KeyAlgorithm { + typedCurve: string; +} + +interface EcKeyImportParams { + namedCurve: string; +} + +interface EcdhKeyDeriveParams extends Algorithm { + public: CryptoKey; +} + +interface AesCtrParams extends Algorithm { + counter: BufferSource; + length: number; +} + +interface AesKeyAlgorithm extends KeyAlgorithm { + length: number; +} + +interface AesKeyGenParams extends Algorithm { + length: number; +} + +interface AesDerivedKeyParams extends Algorithm { + length: number; +} + +interface AesCbcParams extends Algorithm { + iv: BufferSource; +} + +interface AesCmacParams extends Algorithm { + length: number; +} + +interface AesGcmParams extends Algorithm { + iv: BufferSource; + additionalData?: BufferSource; + tagLength?: number; +} + +interface AesCfbParams extends Algorithm { + iv: BufferSource; +} + +interface HmacImportParams extends Algorithm { + hash?: AlgorithmIdentifier; + length?: number; +} + +interface HmacKeyAlgorithm extends KeyAlgorithm { + hash: AlgorithmIdentifier; + length: number; +} + +interface HmacKeyGenParams extends Algorithm { + hash: AlgorithmIdentifier; + length?: number; +} + +interface DhKeyGenParams extends Algorithm { + prime: Uint8Array; + generator: Uint8Array; +} + +interface DhKeyAlgorithm extends KeyAlgorithm { + prime: Uint8Array; + generator: Uint8Array; +} + +interface DhKeyDeriveParams extends Algorithm { + public: CryptoKey; +} + +interface DhImportKeyParams extends Algorithm { + prime: Uint8Array; + generator: Uint8Array; +} + +interface ConcatParams extends Algorithm { + hash?: AlgorithmIdentifier; + algorithmId: Uint8Array; + partyUInfo: Uint8Array; + partyVInfo: Uint8Array; + publicInfo?: Uint8Array; + privateInfo?: Uint8Array; +} + +interface HkdfCtrParams extends Algorithm { + hash: AlgorithmIdentifier; + label: BufferSource; + context: BufferSource; +} + +interface Pbkdf2Params extends Algorithm { + salt: BufferSource; + iterations: number; + hash: AlgorithmIdentifier; +} + +interface RsaOtherPrimesInfo { + r: string; + d: string; + t: string; +} + +interface JsonWebKey { + kty: string; + use?: string; + key_ops?: string[]; + alg?: string; + kid?: string; + x5u?: string; + x5c?: string; + x5t?: string; + ext?: boolean; + crv?: string; + x?: string; + y?: string; + d?: string; + n?: string; + e?: string; + p?: string; + q?: string; + dp?: string; + dq?: string; + qi?: string; + oth?: RsaOtherPrimesInfo[]; + k?: string; +} + +interface ParentNode { + readonly children: HTMLCollection; + readonly firstElementChild: Element | null; + readonly lastElementChild: Element | null; + readonly childElementCount: number; +} + +interface DocumentOrShadowRoot { + readonly activeElement: Element | null; + readonly stylesheets: StyleSheetList; + getSelection(): Selection | null; + elementFromPoint(x: number, y: number): Element | null; + elementsFromPoint(x: number, y: number): Element[]; +} + +interface ShadowRoot extends DocumentOrShadowRoot, DocumentFragment { + readonly host: Element; + innerHTML: string; +} + +interface ShadowRootInit { + mode: 'open'|'closed'; + delegatesFocus?: boolean; +} + +interface HTMLSlotElement extends HTMLElement { + name: string; + assignedNodes(options?: AssignedNodesOptions): Node[]; +} + +interface AssignedNodesOptions { + flatten?: boolean; +} + +interface ElementDefinitionOptions { + extends: string; +} + +interface CustomElementRegistry { + define(name: string, constructor: Function, options?: ElementDefinitionOptions): void; + get(name: string): any; + whenDefined(name: string): PromiseLike; +} + +interface PromiseRejectionEvent extends Event { + readonly promise: PromiseLike; + readonly reason: any; +} + +interface PromiseRejectionEventInit extends EventInit { + promise: PromiseLike; + reason?: any; +} + +interface EventListenerOptions { + capture?: boolean; +} + +interface AddEventListenerOptions extends EventListenerOptions { + passive?: boolean; + once?: boolean; +} + +interface TouchEventInit extends EventModifierInit { + touches?: Touch[]; + targetTouches?: Touch[]; + changedTouches?: Touch[]; +} + +declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; + +interface ErrorEventHandler { + (message: string, filename?: string, lineno?: number, colno?: number, error?:Error): void; +} +interface PositionCallback { + (position: Position): void; +} +interface PositionErrorCallback { + (error: PositionError): void; +} +interface MediaQueryListListener { + (mql: MediaQueryList): void; +} +interface MSLaunchUriCallback { + (): void; +} +interface FrameRequestCallback { + (time: number): void; +} +interface MSUnsafeFunctionCallback { + (): any; +} +interface MSExecAtPriorityFunctionCallback { + (...args: any[]): any; +} +interface MutationCallback { + (mutations: MutationRecord[], observer: MutationObserver): void; +} +interface DecodeSuccessCallback { + (decodedData: AudioBuffer): void; +} +interface DecodeErrorCallback { + (error: DOMException): void; +} +interface VoidFunction { + (): void; +} +interface RTCSessionDescriptionCallback { + (sdp: RTCSessionDescription): void; +} +interface RTCPeerConnectionErrorCallback { + (error: DOMError): void; +} +interface RTCStatsCallback { + (report: RTCStatsReport): void; +} +interface FunctionStringCallback { + (data: string): void; +} +interface NavigatorUserMediaSuccessCallback { + (stream: MediaStream): void; +} +interface NavigatorUserMediaErrorCallback { + (error: MediaStreamError): void; +} +interface ForEachCallback { + (keyId: any, status: MediaKeyStatus): void; +} +interface NotificationPermissionCallback { + (permission: NotificationPermission): void; +} +interface IntersectionObserverCallback { + (entries: IntersectionObserverEntry[], observer: IntersectionObserver): void; +} +interface HTMLElementTagNameMap { + "a": HTMLAnchorElement; + "applet": HTMLAppletElement; + "area": HTMLAreaElement; + "audio": HTMLAudioElement; + "base": HTMLBaseElement; + "basefont": HTMLBaseFontElement; + "blockquote": HTMLQuoteElement; + "body": HTMLBodyElement; + "br": HTMLBRElement; + "button": HTMLButtonElement; + "canvas": HTMLCanvasElement; + "caption": HTMLTableCaptionElement; + "col": HTMLTableColElement; + "colgroup": HTMLTableColElement; + "data": HTMLDataElement; + "datalist": HTMLDataListElement; + "del": HTMLModElement; + "dir": HTMLDirectoryElement; + "div": HTMLDivElement; + "dl": HTMLDListElement; + "embed": HTMLEmbedElement; + "fieldset": HTMLFieldSetElement; + "font": HTMLFontElement; + "form": HTMLFormElement; + "frame": HTMLFrameElement; + "frameset": HTMLFrameSetElement; + "h1": HTMLHeadingElement; + "h2": HTMLHeadingElement; + "h3": HTMLHeadingElement; + "h4": HTMLHeadingElement; + "h5": HTMLHeadingElement; + "h6": HTMLHeadingElement; + "head": HTMLHeadElement; + "hr": HTMLHRElement; + "html": HTMLHtmlElement; + "iframe": HTMLIFrameElement; + "img": HTMLImageElement; + "input": HTMLInputElement; + "ins": HTMLModElement; + "isindex": HTMLUnknownElement; + "label": HTMLLabelElement; + "legend": HTMLLegendElement; + "li": HTMLLIElement; + "link": HTMLLinkElement; + "listing": HTMLPreElement; + "map": HTMLMapElement; + "marquee": HTMLMarqueeElement; + "menu": HTMLMenuElement; + "meta": HTMLMetaElement; + "meter": HTMLMeterElement; + "nextid": HTMLUnknownElement; + "object": HTMLObjectElement; + "ol": HTMLOListElement; + "optgroup": HTMLOptGroupElement; + "option": HTMLOptionElement; + "output": HTMLOutputElement; + "p": HTMLParagraphElement; + "param": HTMLParamElement; + "picture": HTMLPictureElement; + "pre": HTMLPreElement; + "progress": HTMLProgressElement; + "q": HTMLQuoteElement; + "script": HTMLScriptElement; + "select": HTMLSelectElement; + "source": HTMLSourceElement; + "span": HTMLSpanElement; + "style": HTMLStyleElement; + "table": HTMLTableElement; + "tbody": HTMLTableSectionElement; + "td": HTMLTableDataCellElement; + "template": HTMLTemplateElement; + "textarea": HTMLTextAreaElement; + "tfoot": HTMLTableSectionElement; + "th": HTMLTableHeaderCellElement; + "thead": HTMLTableSectionElement; + "time": HTMLTimeElement; + "title": HTMLTitleElement; + "tr": HTMLTableRowElement; + "track": HTMLTrackElement; + "ul": HTMLUListElement; + "video": HTMLVideoElement; + "x-ms-webview": MSHTMLWebViewElement; + "xmp": HTMLPreElement; +} + +interface ElementTagNameMap { + "a": HTMLAnchorElement; + "abbr": HTMLElement; + "acronym": HTMLElement; + "address": HTMLElement; + "applet": HTMLAppletElement; + "area": HTMLAreaElement; + "article": HTMLElement; + "aside": HTMLElement; + "audio": HTMLAudioElement; + "b": HTMLElement; + "base": HTMLBaseElement; + "basefont": HTMLBaseFontElement; + "bdo": HTMLElement; + "big": HTMLElement; + "blockquote": HTMLQuoteElement; + "body": HTMLBodyElement; + "br": HTMLBRElement; + "button": HTMLButtonElement; + "canvas": HTMLCanvasElement; + "caption": HTMLTableCaptionElement; + "center": HTMLElement; + "circle": SVGCircleElement; + "cite": HTMLElement; + "clippath": SVGClipPathElement; + "code": HTMLElement; + "col": HTMLTableColElement; + "colgroup": HTMLTableColElement; + "data": HTMLDataElement; + "datalist": HTMLDataListElement; + "dd": HTMLElement; + "defs": SVGDefsElement; + "del": HTMLModElement; + "desc": SVGDescElement; + "dfn": HTMLElement; + "dir": HTMLDirectoryElement; + "div": HTMLDivElement; + "dl": HTMLDListElement; + "dt": HTMLElement; + "ellipse": SVGEllipseElement; + "em": HTMLElement; + "embed": HTMLEmbedElement; + "feblend": SVGFEBlendElement; + "fecolormatrix": SVGFEColorMatrixElement; + "fecomponenttransfer": SVGFEComponentTransferElement; + "fecomposite": SVGFECompositeElement; + "feconvolvematrix": SVGFEConvolveMatrixElement; + "fediffuselighting": SVGFEDiffuseLightingElement; + "fedisplacementmap": SVGFEDisplacementMapElement; + "fedistantlight": SVGFEDistantLightElement; + "feflood": SVGFEFloodElement; + "fefunca": SVGFEFuncAElement; + "fefuncb": SVGFEFuncBElement; + "fefuncg": SVGFEFuncGElement; + "fefuncr": SVGFEFuncRElement; + "fegaussianblur": SVGFEGaussianBlurElement; + "feimage": SVGFEImageElement; + "femerge": SVGFEMergeElement; + "femergenode": SVGFEMergeNodeElement; + "femorphology": SVGFEMorphologyElement; + "feoffset": SVGFEOffsetElement; + "fepointlight": SVGFEPointLightElement; + "fespecularlighting": SVGFESpecularLightingElement; + "fespotlight": SVGFESpotLightElement; + "fetile": SVGFETileElement; + "feturbulence": SVGFETurbulenceElement; + "fieldset": HTMLFieldSetElement; + "figcaption": HTMLElement; + "figure": HTMLElement; + "filter": SVGFilterElement; + "font": HTMLFontElement; + "footer": HTMLElement; + "foreignobject": SVGForeignObjectElement; + "form": HTMLFormElement; + "frame": HTMLFrameElement; + "frameset": HTMLFrameSetElement; + "g": SVGGElement; + "h1": HTMLHeadingElement; + "h2": HTMLHeadingElement; + "h3": HTMLHeadingElement; + "h4": HTMLHeadingElement; + "h5": HTMLHeadingElement; + "h6": HTMLHeadingElement; + "head": HTMLHeadElement; + "header": HTMLElement; + "hgroup": HTMLElement; + "hr": HTMLHRElement; + "html": HTMLHtmlElement; + "i": HTMLElement; + "iframe": HTMLIFrameElement; + "image": SVGImageElement; + "img": HTMLImageElement; + "input": HTMLInputElement; + "ins": HTMLModElement; + "isindex": HTMLUnknownElement; + "kbd": HTMLElement; + "keygen": HTMLElement; + "label": HTMLLabelElement; + "legend": HTMLLegendElement; + "li": HTMLLIElement; + "line": SVGLineElement; + "lineargradient": SVGLinearGradientElement; + "link": HTMLLinkElement; + "listing": HTMLPreElement; + "map": HTMLMapElement; + "mark": HTMLElement; + "marker": SVGMarkerElement; + "marquee": HTMLMarqueeElement; + "mask": SVGMaskElement; + "menu": HTMLMenuElement; + "meta": HTMLMetaElement; + "metadata": SVGMetadataElement; + "meter": HTMLMeterElement; + "nav": HTMLElement; + "nextid": HTMLUnknownElement; + "nobr": HTMLElement; + "noframes": HTMLElement; + "noscript": HTMLElement; + "object": HTMLObjectElement; + "ol": HTMLOListElement; + "optgroup": HTMLOptGroupElement; + "option": HTMLOptionElement; + "output": HTMLOutputElement; + "p": HTMLParagraphElement; + "param": HTMLParamElement; + "path": SVGPathElement; + "pattern": SVGPatternElement; + "picture": HTMLPictureElement; + "plaintext": HTMLElement; + "polygon": SVGPolygonElement; + "polyline": SVGPolylineElement; + "pre": HTMLPreElement; + "progress": HTMLProgressElement; + "q": HTMLQuoteElement; + "radialgradient": SVGRadialGradientElement; + "rect": SVGRectElement; + "rt": HTMLElement; + "ruby": HTMLElement; + "s": HTMLElement; + "samp": HTMLElement; + "script": HTMLScriptElement; + "section": HTMLElement; + "select": HTMLSelectElement; + "small": HTMLElement; + "source": HTMLSourceElement; + "span": HTMLSpanElement; + "stop": SVGStopElement; + "strike": HTMLElement; + "strong": HTMLElement; + "style": HTMLStyleElement; + "sub": HTMLElement; + "sup": HTMLElement; + "svg": SVGSVGElement; + "switch": SVGSwitchElement; + "symbol": SVGSymbolElement; + "table": HTMLTableElement; + "tbody": HTMLTableSectionElement; + "td": HTMLTableDataCellElement; + "template": HTMLTemplateElement; + "text": SVGTextElement; + "textpath": SVGTextPathElement; + "textarea": HTMLTextAreaElement; + "tfoot": HTMLTableSectionElement; + "th": HTMLTableHeaderCellElement; + "thead": HTMLTableSectionElement; + "time": HTMLTimeElement; + "title": HTMLTitleElement; + "tr": HTMLTableRowElement; + "track": HTMLTrackElement; + "tspan": SVGTSpanElement; + "tt": HTMLElement; + "u": HTMLElement; + "ul": HTMLUListElement; + "use": SVGUseElement; + "var": HTMLElement; + "video": HTMLVideoElement; + "view": SVGViewElement; + "wbr": HTMLElement; + "x-ms-webview": MSHTMLWebViewElement; + "xmp": HTMLPreElement; +} + +interface ElementListTagNameMap { + "a": NodeListOf; + "abbr": NodeListOf; + "acronym": NodeListOf; + "address": NodeListOf; + "applet": NodeListOf; + "area": NodeListOf; + "article": NodeListOf; + "aside": NodeListOf; + "audio": NodeListOf; + "b": NodeListOf; + "base": NodeListOf; + "basefont": NodeListOf; + "bdo": NodeListOf; + "big": NodeListOf; + "blockquote": NodeListOf; + "body": NodeListOf; + "br": NodeListOf; + "button": NodeListOf; + "canvas": NodeListOf; + "caption": NodeListOf; + "center": NodeListOf; + "circle": NodeListOf; + "cite": NodeListOf; + "clippath": NodeListOf; + "code": NodeListOf; + "col": NodeListOf; + "colgroup": NodeListOf; + "data": NodeListOf; + "datalist": NodeListOf; + "dd": NodeListOf; + "defs": NodeListOf; + "del": NodeListOf; + "desc": NodeListOf; + "dfn": NodeListOf; + "dir": NodeListOf; + "div": NodeListOf; + "dl": NodeListOf; + "dt": NodeListOf; + "ellipse": NodeListOf; + "em": NodeListOf; + "embed": NodeListOf; + "feblend": NodeListOf; + "fecolormatrix": NodeListOf; + "fecomponenttransfer": NodeListOf; + "fecomposite": NodeListOf; + "feconvolvematrix": NodeListOf; + "fediffuselighting": NodeListOf; + "fedisplacementmap": NodeListOf; + "fedistantlight": NodeListOf; + "feflood": NodeListOf; + "fefunca": NodeListOf; + "fefuncb": NodeListOf; + "fefuncg": NodeListOf; + "fefuncr": NodeListOf; + "fegaussianblur": NodeListOf; + "feimage": NodeListOf; + "femerge": NodeListOf; + "femergenode": NodeListOf; + "femorphology": NodeListOf; + "feoffset": NodeListOf; + "fepointlight": NodeListOf; + "fespecularlighting": NodeListOf; + "fespotlight": NodeListOf; + "fetile": NodeListOf; + "feturbulence": NodeListOf; + "fieldset": NodeListOf; + "figcaption": NodeListOf; + "figure": NodeListOf; + "filter": NodeListOf; + "font": NodeListOf; + "footer": NodeListOf; + "foreignobject": NodeListOf; + "form": NodeListOf; + "frame": NodeListOf; + "frameset": NodeListOf; + "g": NodeListOf; + "h1": NodeListOf; + "h2": NodeListOf; + "h3": NodeListOf; + "h4": NodeListOf; + "h5": NodeListOf; + "h6": NodeListOf; + "head": NodeListOf; + "header": NodeListOf; + "hgroup": NodeListOf; + "hr": NodeListOf; + "html": NodeListOf; + "i": NodeListOf; + "iframe": NodeListOf; + "image": NodeListOf; + "img": NodeListOf; + "input": NodeListOf; + "ins": NodeListOf; + "isindex": NodeListOf; + "kbd": NodeListOf; + "keygen": NodeListOf; + "label": NodeListOf; + "legend": NodeListOf; + "li": NodeListOf; + "line": NodeListOf; + "lineargradient": NodeListOf; + "link": NodeListOf; + "listing": NodeListOf; + "map": NodeListOf; + "mark": NodeListOf; + "marker": NodeListOf; + "marquee": NodeListOf; + "mask": NodeListOf; + "menu": NodeListOf; + "meta": NodeListOf; + "metadata": NodeListOf; + "meter": NodeListOf; + "nav": NodeListOf; + "nextid": NodeListOf; + "nobr": NodeListOf; + "noframes": NodeListOf; + "noscript": NodeListOf; + "object": NodeListOf; + "ol": NodeListOf; + "optgroup": NodeListOf; + "option": NodeListOf; + "output": NodeListOf; + "p": NodeListOf; + "param": NodeListOf; + "path": NodeListOf; + "pattern": NodeListOf; + "picture": NodeListOf; + "plaintext": NodeListOf; + "polygon": NodeListOf; + "polyline": NodeListOf; + "pre": NodeListOf; + "progress": NodeListOf; + "q": NodeListOf; + "radialgradient": NodeListOf; + "rect": NodeListOf; + "rt": NodeListOf; + "ruby": NodeListOf; + "s": NodeListOf; + "samp": NodeListOf; + "script": NodeListOf; + "section": NodeListOf; + "select": NodeListOf; + "small": NodeListOf; + "source": NodeListOf; + "span": NodeListOf; + "stop": NodeListOf; + "strike": NodeListOf; + "strong": NodeListOf; + "style": NodeListOf; + "sub": NodeListOf; + "sup": NodeListOf; + "svg": NodeListOf; + "switch": NodeListOf; + "symbol": NodeListOf; + "table": NodeListOf; + "tbody": NodeListOf; + "td": NodeListOf; + "template": NodeListOf; + "text": NodeListOf; + "textpath": NodeListOf; + "textarea": NodeListOf; + "tfoot": NodeListOf; + "th": NodeListOf; + "thead": NodeListOf; + "time": NodeListOf; + "title": NodeListOf; + "tr": NodeListOf; + "track": NodeListOf; + "tspan": NodeListOf; + "tt": NodeListOf; + "u": NodeListOf; + "ul": NodeListOf; + "use": NodeListOf; + "var": NodeListOf; + "video": NodeListOf; + "view": NodeListOf; + "wbr": NodeListOf; + "x-ms-webview": NodeListOf; + "xmp": NodeListOf; +} + +declare var Audio: {new(src?: string): HTMLAudioElement; }; +declare var Image: {new(width?: number, height?: number): HTMLImageElement; }; +declare var Option: {new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; }; +declare var applicationCache: ApplicationCache; +declare var caches: CacheStorage; +declare var clientInformation: Navigator; +declare var closed: boolean; +declare var crypto: Crypto; +declare var defaultStatus: string; +declare var devicePixelRatio: number; +declare var doNotTrack: string; +declare var document: Document; +declare var event: Event | undefined; +declare var external: External; +declare var frameElement: Element; +declare var frames: Window; +declare var history: History; +declare var innerHeight: number; +declare var innerWidth: number; +declare var isSecureContext: boolean; +declare var length: number; +declare var location: Location; +declare var locationbar: BarProp; +declare var menubar: BarProp; +declare var msContentScript: ExtensionScriptApis; +declare var msCredentials: MSCredentials; +declare const name: never; +declare var navigator: Navigator; +declare var offscreenBuffering: string | boolean; +declare var onabort: (this: Window, ev: UIEvent) => any; +declare var onafterprint: (this: Window, ev: Event) => any; +declare var onbeforeprint: (this: Window, ev: Event) => any; +declare var onbeforeunload: (this: Window, ev: BeforeUnloadEvent) => any; +declare var onblur: (this: Window, ev: FocusEvent) => any; +declare var oncanplay: (this: Window, ev: Event) => any; +declare var oncanplaythrough: (this: Window, ev: Event) => any; +declare var onchange: (this: Window, ev: Event) => any; +declare var onclick: (this: Window, ev: MouseEvent) => any; +declare var oncompassneedscalibration: (this: Window, ev: Event) => any; +declare var oncontextmenu: (this: Window, ev: PointerEvent) => any; +declare var ondblclick: (this: Window, ev: MouseEvent) => any; +declare var ondevicelight: (this: Window, ev: DeviceLightEvent) => any; +declare var ondevicemotion: (this: Window, ev: DeviceMotionEvent) => any; +declare var ondeviceorientation: (this: Window, ev: DeviceOrientationEvent) => any; +declare var ondrag: (this: Window, ev: DragEvent) => any; +declare var ondragend: (this: Window, ev: DragEvent) => any; +declare var ondragenter: (this: Window, ev: DragEvent) => any; +declare var ondragleave: (this: Window, ev: DragEvent) => any; +declare var ondragover: (this: Window, ev: DragEvent) => any; +declare var ondragstart: (this: Window, ev: DragEvent) => any; +declare var ondrop: (this: Window, ev: DragEvent) => any; +declare var ondurationchange: (this: Window, ev: Event) => any; +declare var onemptied: (this: Window, ev: Event) => any; +declare var onended: (this: Window, ev: MediaStreamErrorEvent) => any; +declare var onerror: ErrorEventHandler; +declare var onfocus: (this: Window, ev: FocusEvent) => any; +declare var onhashchange: (this: Window, ev: HashChangeEvent) => any; +declare var oninput: (this: Window, ev: Event) => any; +declare var oninvalid: (this: Window, ev: Event) => any; +declare var onkeydown: (this: Window, ev: KeyboardEvent) => any; +declare var onkeypress: (this: Window, ev: KeyboardEvent) => any; +declare var onkeyup: (this: Window, ev: KeyboardEvent) => any; +declare var onload: (this: Window, ev: Event) => any; +declare var onloadeddata: (this: Window, ev: Event) => any; +declare var onloadedmetadata: (this: Window, ev: Event) => any; +declare var onloadstart: (this: Window, ev: Event) => any; +declare var onmessage: (this: Window, ev: MessageEvent) => any; +declare var onmousedown: (this: Window, ev: MouseEvent) => any; +declare var onmouseenter: (this: Window, ev: MouseEvent) => any; +declare var onmouseleave: (this: Window, ev: MouseEvent) => any; +declare var onmousemove: (this: Window, ev: MouseEvent) => any; +declare var onmouseout: (this: Window, ev: MouseEvent) => any; +declare var onmouseover: (this: Window, ev: MouseEvent) => any; +declare var onmouseup: (this: Window, ev: MouseEvent) => any; +declare var onmousewheel: (this: Window, ev: WheelEvent) => any; +declare var onmsgesturechange: (this: Window, ev: MSGestureEvent) => any; +declare var onmsgesturedoubletap: (this: Window, ev: MSGestureEvent) => any; +declare var onmsgestureend: (this: Window, ev: MSGestureEvent) => any; +declare var onmsgesturehold: (this: Window, ev: MSGestureEvent) => any; +declare var onmsgesturestart: (this: Window, ev: MSGestureEvent) => any; +declare var onmsgesturetap: (this: Window, ev: MSGestureEvent) => any; +declare var onmsinertiastart: (this: Window, ev: MSGestureEvent) => any; +declare var onmspointercancel: (this: Window, ev: MSPointerEvent) => any; +declare var onmspointerdown: (this: Window, ev: MSPointerEvent) => any; +declare var onmspointerenter: (this: Window, ev: MSPointerEvent) => any; +declare var onmspointerleave: (this: Window, ev: MSPointerEvent) => any; +declare var onmspointermove: (this: Window, ev: MSPointerEvent) => any; +declare var onmspointerout: (this: Window, ev: MSPointerEvent) => any; +declare var onmspointerover: (this: Window, ev: MSPointerEvent) => any; +declare var onmspointerup: (this: Window, ev: MSPointerEvent) => any; +declare var onoffline: (this: Window, ev: Event) => any; +declare var ononline: (this: Window, ev: Event) => any; +declare var onorientationchange: (this: Window, ev: Event) => any; +declare var onpagehide: (this: Window, ev: PageTransitionEvent) => any; +declare var onpageshow: (this: Window, ev: PageTransitionEvent) => any; +declare var onpause: (this: Window, ev: Event) => any; +declare var onplay: (this: Window, ev: Event) => any; +declare var onplaying: (this: Window, ev: Event) => any; +declare var onpopstate: (this: Window, ev: PopStateEvent) => any; +declare var onprogress: (this: Window, ev: ProgressEvent) => any; +declare var onratechange: (this: Window, ev: Event) => any; +declare var onreadystatechange: (this: Window, ev: ProgressEvent) => any; +declare var onreset: (this: Window, ev: Event) => any; +declare var onresize: (this: Window, ev: UIEvent) => any; +declare var onscroll: (this: Window, ev: UIEvent) => any; +declare var onseeked: (this: Window, ev: Event) => any; +declare var onseeking: (this: Window, ev: Event) => any; +declare var onselect: (this: Window, ev: UIEvent) => any; +declare var onstalled: (this: Window, ev: Event) => any; +declare var onstorage: (this: Window, ev: StorageEvent) => any; +declare var onsubmit: (this: Window, ev: Event) => any; +declare var onsuspend: (this: Window, ev: Event) => any; +declare var ontimeupdate: (this: Window, ev: Event) => any; +declare var ontouchcancel: (ev: TouchEvent) => any; +declare var ontouchend: (ev: TouchEvent) => any; +declare var ontouchmove: (ev: TouchEvent) => any; +declare var ontouchstart: (ev: TouchEvent) => any; +declare var onunload: (this: Window, ev: Event) => any; +declare var onvolumechange: (this: Window, ev: Event) => any; +declare var onwaiting: (this: Window, ev: Event) => any; +declare var opener: any; +declare var orientation: string | number; +declare var outerHeight: number; +declare var outerWidth: number; +declare var pageXOffset: number; +declare var pageYOffset: number; +declare var parent: Window; +declare var performance: Performance; +declare var personalbar: BarProp; +declare var screen: Screen; +declare var screenLeft: number; +declare var screenTop: number; +declare var screenX: number; +declare var screenY: number; +declare var scrollX: number; +declare var scrollY: number; +declare var scrollbars: BarProp; +declare var self: Window; +declare var speechSynthesis: SpeechSynthesis; +declare var status: string; +declare var statusbar: BarProp; +declare var styleMedia: StyleMedia; +declare var toolbar: BarProp; +declare var top: Window; +declare var window: Window; +declare var customElements: CustomElementRegistry; +declare function alert(message?: any): void; +declare function blur(): void; +declare function cancelAnimationFrame(handle: number): void; +declare function captureEvents(): void; +declare function close(): void; +declare function confirm(message?: string): boolean; +declare function departFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void; +declare function focus(): void; +declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; +declare function getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; +declare function getSelection(): Selection; +declare function matchMedia(mediaQuery: string): MediaQueryList; +declare function moveBy(x?: number, y?: number): void; +declare function moveTo(x?: number, y?: number): void; +declare function msWriteProfilerMark(profilerMarkName: string): void; +declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window; +declare function postMessage(message: any, targetOrigin: string, transfer?: any[]): void; +declare function print(): void; +declare function prompt(message?: string, _default?: string): string | null; +declare function releaseEvents(): void; +declare function requestAnimationFrame(callback: FrameRequestCallback): number; +declare function resizeBy(x?: number, y?: number): void; +declare function resizeTo(x?: number, y?: number): void; +declare function scroll(x?: number, y?: number): void; +declare function scrollBy(x?: number, y?: number): void; +declare function scrollTo(x?: number, y?: number): void; +declare function stop(): void; +declare function webkitCancelAnimationFrame(handle: number): void; +declare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; +declare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; +declare function webkitRequestAnimationFrame(callback: FrameRequestCallback): number; +declare function createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise; +declare function createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise; +declare function scroll(options?: ScrollToOptions): void; +declare function scrollTo(options?: ScrollToOptions): void; +declare function scrollBy(options?: ScrollToOptions): void; +declare function toString(): string; +declare function dispatchEvent(evt: Event): boolean; +declare function removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +declare function clearInterval(handle: number): void; +declare function clearTimeout(handle: number): void; +declare function setInterval(handler: (...args: any[]) => void, timeout: number): number; +declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; +declare function setTimeout(handler: (...args: any[]) => void, timeout: number): number; +declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; +declare function clearImmediate(handle: number): void; +declare function setImmediate(handler: (...args: any[]) => void): number; +declare function setImmediate(handler: any, ...args: any[]): number; +declare var sessionStorage: Storage; +declare var localStorage: Storage; +declare var console: Console; +declare var onpointercancel: (this: Window, ev: PointerEvent) => any; +declare var onpointerdown: (this: Window, ev: PointerEvent) => any; +declare var onpointerenter: (this: Window, ev: PointerEvent) => any; +declare var onpointerleave: (this: Window, ev: PointerEvent) => any; +declare var onpointermove: (this: Window, ev: PointerEvent) => any; +declare var onpointerout: (this: Window, ev: PointerEvent) => any; +declare var onpointerover: (this: Window, ev: PointerEvent) => any; +declare var onpointerup: (this: Window, ev: PointerEvent) => any; +declare var onwheel: (this: Window, ev: WheelEvent) => any; +declare var indexedDB: IDBFactory; +declare function atob(encodedString: string): string; +declare function btoa(rawString: string): string; +declare function fetch(input: RequestInfo, init?: RequestInit): Promise; +declare function addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, useCapture?: boolean): void; +declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +type AAGUID = string; +type AlgorithmIdentifier = string | Algorithm; +type BodyInit = any; +type ByteString = string; +type ConstrainBoolean = boolean | ConstrainBooleanParameters; +type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters; +type ConstrainDouble = number | ConstrainDoubleRange; +type ConstrainLong = number | ConstrainLongRange; +type CryptoOperationData = ArrayBufferView; +type GLbitfield = number; +type GLboolean = boolean; +type GLbyte = number; +type GLclampf = number; +type GLenum = number; +type GLfloat = number; +type GLint = number; +type GLintptr = number; +type GLshort = number; +type GLsizei = number; +type GLsizeiptr = number; +type GLubyte = number; +type GLuint = number; +type GLushort = number; +type HeadersInit = any; +type IDBKeyPath = string; +type KeyFormat = string; +type KeyType = string; +type KeyUsage = string; +type MSInboundPayload = MSVideoRecvPayload | MSAudioRecvPayload; +type MSLocalClientEvent = MSLocalClientEventBase | MSAudioLocalClientEvent; +type MSOutboundPayload = MSVideoSendPayload | MSAudioSendPayload; +type RTCIceGatherCandidate = RTCIceCandidateDictionary | RTCIceCandidateComplete; +type RTCTransport = RTCDtlsTransport | RTCSrtpSdesTransport; +type RequestInfo = Request | string; +type USVString = string; +type payloadtype = number; +type ScrollBehavior = "auto" | "instant" | "smooth"; +type ScrollLogicalPosition = "start" | "center" | "end" | "nearest"; +type IDBValidKey = number | string | Date | IDBArrayKey; +type BufferSource = ArrayBuffer | ArrayBufferView; +type MouseWheelEvent = WheelEvent; type ScrollRestoration = "auto" | "manual"; - - -///////////////////////////// -/// WorkerGlobalScope APIs -///////////////////////////// -// These are only available in a Web Worker -declare function importScripts(...urls: string[]): void; +type FormDataEntryValue = string | File; +type AppendMode = "segments" | "sequence"; +type AudioContextState = "suspended" | "running" | "closed"; +type BiquadFilterType = "lowpass" | "highpass" | "bandpass" | "lowshelf" | "highshelf" | "peaking" | "notch" | "allpass"; +type CanvasFillRule = "nonzero" | "evenodd"; +type ChannelCountMode = "max" | "clamped-max" | "explicit"; +type ChannelInterpretation = "speakers" | "discrete"; +type DistanceModelType = "linear" | "inverse" | "exponential"; +type ExpandGranularity = "character" | "word" | "sentence" | "textedit"; +type GamepadInputEmulationType = "mouse" | "keyboard" | "gamepad"; +type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique"; +type IDBRequestReadyState = "pending" | "done"; +type IDBTransactionMode = "readonly" | "readwrite" | "versionchange"; +type ListeningState = "inactive" | "active" | "disambiguation"; +type MSCredentialType = "FIDO_2_0"; +type MSIceAddrType = "os" | "stun" | "turn" | "peer-derived"; +type MSIceType = "failed" | "direct" | "relay"; +type MSStatsType = "description" | "localclientevent" | "inbound-network" | "outbound-network" | "inbound-payload" | "outbound-payload" | "transportdiagnostics"; +type MSTransportType = "Embedded" | "USB" | "NFC" | "BT"; +type MSWebViewPermissionState = "unknown" | "defer" | "allow" | "deny"; +type MSWebViewPermissionType = "geolocation" | "unlimitedIndexedDBQuota" | "media" | "pointerlock" | "webnotifications"; +type MediaDeviceKind = "audioinput" | "audiooutput" | "videoinput"; +type MediaKeyMessageType = "license-request" | "license-renewal" | "license-release" | "individualization-request"; +type MediaKeySessionType = "temporary" | "persistent-license" | "persistent-release-message"; +type MediaKeyStatus = "usable" | "expired" | "output-downscaled" | "output-not-allowed" | "status-pending" | "internal-error"; +type MediaKeysRequirement = "required" | "optional" | "not-allowed"; +type MediaStreamTrackState = "live" | "ended"; +type NavigationReason = "up" | "down" | "left" | "right"; +type NavigationType = "navigate" | "reload" | "back_forward" | "prerender"; +type NotificationDirection = "auto" | "ltr" | "rtl"; +type NotificationPermission = "default" | "denied" | "granted"; +type OscillatorType = "sine" | "square" | "sawtooth" | "triangle" | "custom"; +type OverSampleType = "none" | "2x" | "4x"; +type PanningModelType = "equalpower"; +type PaymentComplete = "success" | "fail" | ""; +type PaymentShippingType = "shipping" | "delivery" | "pickup"; +type PushEncryptionKeyName = "p256dh" | "auth"; +type PushPermissionState = "granted" | "denied" | "prompt"; +type RTCBundlePolicy = "balanced" | "max-compat" | "max-bundle"; +type RTCDegradationPreference = "maintain-framerate" | "maintain-resolution" | "balanced"; +type RTCDtlsRole = "auto" | "client" | "server"; +type RTCDtlsTransportState = "new" | "connecting" | "connected" | "closed"; +type RTCIceCandidateType = "host" | "srflx" | "prflx" | "relay"; +type RTCIceComponent = "RTP" | "RTCP"; +type RTCIceConnectionState = "new" | "checking" | "connected" | "completed" | "failed" | "disconnected" | "closed"; +type RTCIceGatherPolicy = "all" | "nohost" | "relay"; +type RTCIceGathererState = "new" | "gathering" | "complete"; +type RTCIceGatheringState = "new" | "gathering" | "complete"; +type RTCIceProtocol = "udp" | "tcp"; +type RTCIceRole = "controlling" | "controlled"; +type RTCIceTcpCandidateType = "active" | "passive" | "so"; +type RTCIceTransportPolicy = "none" | "relay" | "all"; +type RTCIceTransportState = "new" | "checking" | "connected" | "completed" | "disconnected" | "closed"; +type RTCSdpType = "offer" | "pranswer" | "answer"; +type RTCSignalingState = "stable" | "have-local-offer" | "have-remote-offer" | "have-local-pranswer" | "have-remote-pranswer" | "closed"; +type RTCStatsIceCandidatePairState = "frozen" | "waiting" | "inprogress" | "failed" | "succeeded" | "cancelled"; +type RTCStatsIceCandidateType = "host" | "serverreflexive" | "peerreflexive" | "relayed"; +type RTCStatsType = "inboundrtp" | "outboundrtp" | "session" | "datachannel" | "track" | "transport" | "candidatepair" | "localcandidate" | "remotecandidate"; +type ReferrerPolicy = "" | "no-referrer" | "no-referrer-when-downgrade" | "origin-only" | "origin-when-cross-origin" | "unsafe-url"; +type RequestCache = "default" | "no-store" | "reload" | "no-cache" | "force-cache"; +type RequestCredentials = "omit" | "same-origin" | "include"; +type RequestDestination = "" | "document" | "sharedworker" | "subresource" | "unknown" | "worker"; +type RequestMode = "navigate" | "same-origin" | "no-cors" | "cors"; +type RequestRedirect = "follow" | "error" | "manual"; +type RequestType = "" | "audio" | "font" | "image" | "script" | "style" | "track" | "video"; +type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect"; +type ScopedCredentialType = "ScopedCred"; +type ServiceWorkerState = "installing" | "installed" | "activating" | "activated" | "redundant"; +type Transport = "usb" | "nfc" | "ble"; +type VideoFacingModeEnum = "user" | "environment" | "left" | "right"; +type VisibilityState = "hidden" | "visible" | "prerender" | "unloaded"; +type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text"; - - -///////////////////////////// -/// Windows Script Host APIS -///////////////////////////// - - -interface ActiveXObject { - new (s: string): any; -} -declare var ActiveXObject: ActiveXObject; - -interface ITextWriter { - Write(s: string): void; - WriteLine(s: string): void; - Close(): void; -} - -interface TextStreamBase { - /** - * The column number of the current character position in an input stream. - */ - Column: number; - - /** - * The current line number in an input stream. - */ - Line: number; - - /** - * Closes a text stream. - * It is not necessary to close standard streams; they close automatically when the process ends. If - * you close a standard stream, be aware that any other pointers to that standard stream become invalid. - */ - Close(): void; -} - -interface TextStreamWriter extends TextStreamBase { - /** - * Sends a string to an output stream. - */ - Write(s: string): void; - - /** - * Sends a specified number of blank lines (newline characters) to an output stream. - */ - WriteBlankLines(intLines: number): void; - - /** - * Sends a string followed by a newline character to an output stream. - */ - WriteLine(s: string): void; -} - -interface TextStreamReader extends TextStreamBase { - /** - * Returns a specified number of characters from an input stream, starting at the current pointer position. - * Does not return until the ENTER key is pressed. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - */ - Read(characters: number): string; - - /** - * Returns all characters from an input stream. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - */ - ReadAll(): string; - - /** - * Returns an entire line from an input stream. - * Although this method extracts the newline character, it does not add it to the returned string. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - */ - ReadLine(): string; - - /** - * Skips a specified number of characters when reading from an input text stream. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.) - */ - Skip(characters: number): void; - - /** - * Skips the next line when reading from an input text stream. - * Can only be used on a stream in reading mode, not writing or appending mode. - */ - SkipLine(): void; - - /** - * Indicates whether the stream pointer position is at the end of a line. - */ - AtEndOfLine: boolean; - - /** - * Indicates whether the stream pointer position is at the end of a stream. - */ - AtEndOfStream: boolean; -} - -declare var WScript: { - /** - * Outputs text to either a message box (under WScript.exe) or the command console window followed by - * a newline (under CScript.exe). - */ - Echo(s: any): void; - - /** - * Exposes the write-only error output stream for the current script. - * Can be accessed only while using CScript.exe. - */ - StdErr: TextStreamWriter; - - /** - * Exposes the write-only output stream for the current script. - * Can be accessed only while using CScript.exe. - */ - StdOut: TextStreamWriter; - Arguments: { length: number; Item(n: number): string; }; - - /** - * The full path of the currently running script. - */ - ScriptFullName: string; - - /** - * Forces the script to stop immediately, with an optional exit code. - */ - Quit(exitCode?: number): number; - - /** - * The Windows Script Host build version number. - */ - BuildVersion: number; - - /** - * Fully qualified path of the host executable. - */ - FullName: string; - - /** - * Gets/sets the script mode - interactive(true) or batch(false). - */ - Interactive: boolean; - - /** - * The name of the host executable (WScript.exe or CScript.exe). - */ - Name: string; - - /** - * Path of the directory containing the host executable. - */ - Path: string; - - /** - * The filename of the currently running script. - */ - ScriptName: string; - - /** - * Exposes the read-only input stream for the current script. - * Can be accessed only while using CScript.exe. - */ - StdIn: TextStreamReader; - - /** - * Windows Script Host version - */ - Version: string; - - /** - * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event. - */ - ConnectObject(objEventSource: any, strPrefix: string): void; - - /** - * Creates a COM object. - * @param strProgiID - * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. - */ - CreateObject(strProgID: string, strPrefix?: string): any; - - /** - * Disconnects a COM object from its event sources. - */ - DisconnectObject(obj: any): void; - - /** - * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file. - * @param strPathname Fully qualified path to the file containing the object persisted to disk. - * For objects in memory, pass a zero-length string. - * @param strProgID - * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. - */ - GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; - - /** - * Suspends script execution for a specified length of time, then continues execution. - * @param intTime Interval (in milliseconds) to suspend script execution. - */ - Sleep(intTime: number): void; -}; - -/** - * Allows enumerating over a COM collection, which may not have indexed item access. - */ -interface Enumerator { - /** - * Returns true if the current item is the last one in the collection, or the collection is empty, - * or the current item is undefined. - */ - atEnd(): boolean; - - /** - * Returns the current item in the collection - */ - item(): T; - - /** - * Resets the current item in the collection to the first item. If there are no items in the collection, - * the current item is set to undefined. - */ - moveFirst(): void; - - /** - * Moves the current item to the next item in the collection. If the enumerator is at the end of - * the collection or the collection is empty, the current item is set to undefined. - */ - moveNext(): void; -} - -interface EnumeratorConstructor { - new (collection: any): Enumerator; - new (collection: any): Enumerator; -} - -declare var Enumerator: EnumeratorConstructor; - -/** - * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions. - */ -interface VBArray { - /** - * Returns the number of dimensions (1-based). - */ - dimensions(): number; - - /** - * Takes an index for each dimension in the array, and returns the item at the corresponding location. - */ - getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T; - - /** - * Returns the smallest available index for a given dimension. - * @param dimension 1-based dimension (defaults to 1) - */ - lbound(dimension?: number): number; - - /** - * Returns the largest available index for a given dimension. - * @param dimension 1-based dimension (defaults to 1) - */ - ubound(dimension?: number): number; - - /** - * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions, - * each successive dimension is appended to the end of the array. - * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6] - */ - toArray(): T[]; -} - -interface VBArrayConstructor { - new (safeArray: any): VBArray; - new (safeArray: any): VBArray; -} - -declare var VBArray: VBArrayConstructor; - -/** - * Automation date (VT_DATE) - */ -interface VarDate { } - -interface DateConstructor { - new (vd: VarDate): Date; -} - -interface Date { - getVarDate: () => VarDate; -} +///////////////////////////// +/// WorkerGlobalScope APIs +///////////////////////////// +// These are only available in a Web Worker +declare function importScripts(...urls: string[]): void; -/// - -interface DOMTokenList { - [Symbol.iterator](): IterableIterator; -} - -interface NodeList { - [Symbol.iterator](): IterableIterator -} - -interface NodeListOf { - [Symbol.iterator](): IterableIterator -} + + +///////////////////////////// +/// Windows Script Host APIS +///////////////////////////// + + +interface ActiveXObject { + new (s: string): any; +} +declare var ActiveXObject: ActiveXObject; + +interface ITextWriter { + Write(s: string): void; + WriteLine(s: string): void; + Close(): void; +} + +interface TextStreamBase { + /** + * The column number of the current character position in an input stream. + */ + Column: number; + + /** + * The current line number in an input stream. + */ + Line: number; + + /** + * Closes a text stream. + * It is not necessary to close standard streams; they close automatically when the process ends. If + * you close a standard stream, be aware that any other pointers to that standard stream become invalid. + */ + Close(): void; +} + +interface TextStreamWriter extends TextStreamBase { + /** + * Sends a string to an output stream. + */ + Write(s: string): void; + + /** + * Sends a specified number of blank lines (newline characters) to an output stream. + */ + WriteBlankLines(intLines: number): void; + + /** + * Sends a string followed by a newline character to an output stream. + */ + WriteLine(s: string): void; +} + +interface TextStreamReader extends TextStreamBase { + /** + * Returns a specified number of characters from an input stream, starting at the current pointer position. + * Does not return until the ENTER key is pressed. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + Read(characters: number): string; + + /** + * Returns all characters from an input stream. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + ReadAll(): string; + + /** + * Returns an entire line from an input stream. + * Although this method extracts the newline character, it does not add it to the returned string. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + ReadLine(): string; + + /** + * Skips a specified number of characters when reading from an input text stream. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.) + */ + Skip(characters: number): void; + + /** + * Skips the next line when reading from an input text stream. + * Can only be used on a stream in reading mode, not writing or appending mode. + */ + SkipLine(): void; + + /** + * Indicates whether the stream pointer position is at the end of a line. + */ + AtEndOfLine: boolean; + + /** + * Indicates whether the stream pointer position is at the end of a stream. + */ + AtEndOfStream: boolean; +} + +declare var WScript: { + /** + * Outputs text to either a message box (under WScript.exe) or the command console window followed by + * a newline (under CScript.exe). + */ + Echo(s: any): void; + + /** + * Exposes the write-only error output stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdErr: TextStreamWriter; + + /** + * Exposes the write-only output stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdOut: TextStreamWriter; + Arguments: { length: number; Item(n: number): string; }; + + /** + * The full path of the currently running script. + */ + ScriptFullName: string; + + /** + * Forces the script to stop immediately, with an optional exit code. + */ + Quit(exitCode?: number): number; + + /** + * The Windows Script Host build version number. + */ + BuildVersion: number; + + /** + * Fully qualified path of the host executable. + */ + FullName: string; + + /** + * Gets/sets the script mode - interactive(true) or batch(false). + */ + Interactive: boolean; + + /** + * The name of the host executable (WScript.exe or CScript.exe). + */ + Name: string; + + /** + * Path of the directory containing the host executable. + */ + Path: string; + + /** + * The filename of the currently running script. + */ + ScriptName: string; + + /** + * Exposes the read-only input stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdIn: TextStreamReader; + + /** + * Windows Script Host version + */ + Version: string; + + /** + * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event. + */ + ConnectObject(objEventSource: any, strPrefix: string): void; + + /** + * Creates a COM object. + * @param strProgiID + * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. + */ + CreateObject(strProgID: string, strPrefix?: string): any; + + /** + * Disconnects a COM object from its event sources. + */ + DisconnectObject(obj: any): void; + + /** + * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file. + * @param strPathname Fully qualified path to the file containing the object persisted to disk. + * For objects in memory, pass a zero-length string. + * @param strProgID + * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. + */ + GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; + + /** + * Suspends script execution for a specified length of time, then continues execution. + * @param intTime Interval (in milliseconds) to suspend script execution. + */ + Sleep(intTime: number): void; +}; + +/** + * Allows enumerating over a COM collection, which may not have indexed item access. + */ +interface Enumerator { + /** + * Returns true if the current item is the last one in the collection, or the collection is empty, + * or the current item is undefined. + */ + atEnd(): boolean; + + /** + * Returns the current item in the collection + */ + item(): T; + + /** + * Resets the current item in the collection to the first item. If there are no items in the collection, + * the current item is set to undefined. + */ + moveFirst(): void; + + /** + * Moves the current item to the next item in the collection. If the enumerator is at the end of + * the collection or the collection is empty, the current item is set to undefined. + */ + moveNext(): void; +} + +interface EnumeratorConstructor { + new (collection: any): Enumerator; + new (collection: any): Enumerator; +} + +declare var Enumerator: EnumeratorConstructor; + +/** + * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions. + */ +interface VBArray { + /** + * Returns the number of dimensions (1-based). + */ + dimensions(): number; + + /** + * Takes an index for each dimension in the array, and returns the item at the corresponding location. + */ + getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T; + + /** + * Returns the smallest available index for a given dimension. + * @param dimension 1-based dimension (defaults to 1) + */ + lbound(dimension?: number): number; + + /** + * Returns the largest available index for a given dimension. + * @param dimension 1-based dimension (defaults to 1) + */ + ubound(dimension?: number): number; + + /** + * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions, + * each successive dimension is appended to the end of the array. + * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6] + */ + toArray(): T[]; +} + +interface VBArrayConstructor { + new (safeArray: any): VBArray; + new (safeArray: any): VBArray; +} + +declare var VBArray: VBArrayConstructor; + +/** + * Automation date (VT_DATE) + */ +interface VarDate { } + +interface DateConstructor { + new (vd: VarDate): Date; +} + +interface Date { + getVarDate: () => VarDate; +} + + +/// + +interface DOMTokenList { + [Symbol.iterator](): IterableIterator; +} + +interface FormData { + /** + * Returns an array of key, value pairs for every entry in the list + */ + entries(): IterableIterator<[string, string | File]>; + /** + * Returns a list of keys in the list + */ + keys(): IterableIterator; + /** + * Returns a list of values in the list + */ + values(): IterableIterator; + + [Symbol.iterator](): IterableIterator; +} + +interface NodeList { + /** + * Returns an array of key, value pairs for every entry in the list + */ + entries(): IterableIterator<[number, Node]>; + /** + * Performs the specified action for each node in an list. + * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: Node, index: number, listObj: NodeList) => void, thisArg?: any): void; + /** + * Returns an list of keys in the list + */ + keys(): IterableIterator; + + /** + * Returns an list of values in the list + */ + values(): IterableIterator; + + + [Symbol.iterator](): IterableIterator; +} + +interface NodeListOf { + + /** + * Returns an array of key, value pairs for every entry in the list + */ + entries(): IterableIterator<[number, TNode]>; + + /** + * Performs the specified action for each node in an list. + * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: TNode, index: number, listObj: NodeListOf) => void, thisArg?: any): void; + /** + * Returns an list of keys in the list + */ + keys(): IterableIterator; + /** + * Returns an list of values in the list + */ + values(): IterableIterator; + + [Symbol.iterator](): IterableIterator; +} diff --git a/node_modules/typescript/lib/lib.scripthost.d.ts b/node_modules/typescript/lib/lib.scripthost.d.ts index 2d2f4df3b..47cfaa7fb 100644 --- a/node_modules/typescript/lib/lib.scripthost.d.ts +++ b/node_modules/typescript/lib/lib.scripthost.d.ts @@ -1,311 +1,311 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ -/// + +/// - - -///////////////////////////// -/// Windows Script Host APIS -///////////////////////////// - - -interface ActiveXObject { - new (s: string): any; -} -declare var ActiveXObject: ActiveXObject; - -interface ITextWriter { - Write(s: string): void; - WriteLine(s: string): void; - Close(): void; -} - -interface TextStreamBase { - /** - * The column number of the current character position in an input stream. - */ - Column: number; - - /** - * The current line number in an input stream. - */ - Line: number; - - /** - * Closes a text stream. - * It is not necessary to close standard streams; they close automatically when the process ends. If - * you close a standard stream, be aware that any other pointers to that standard stream become invalid. - */ - Close(): void; -} - -interface TextStreamWriter extends TextStreamBase { - /** - * Sends a string to an output stream. - */ - Write(s: string): void; - - /** - * Sends a specified number of blank lines (newline characters) to an output stream. - */ - WriteBlankLines(intLines: number): void; - - /** - * Sends a string followed by a newline character to an output stream. - */ - WriteLine(s: string): void; -} - -interface TextStreamReader extends TextStreamBase { - /** - * Returns a specified number of characters from an input stream, starting at the current pointer position. - * Does not return until the ENTER key is pressed. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - */ - Read(characters: number): string; - - /** - * Returns all characters from an input stream. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - */ - ReadAll(): string; - - /** - * Returns an entire line from an input stream. - * Although this method extracts the newline character, it does not add it to the returned string. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - */ - ReadLine(): string; - - /** - * Skips a specified number of characters when reading from an input text stream. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.) - */ - Skip(characters: number): void; - - /** - * Skips the next line when reading from an input text stream. - * Can only be used on a stream in reading mode, not writing or appending mode. - */ - SkipLine(): void; - - /** - * Indicates whether the stream pointer position is at the end of a line. - */ - AtEndOfLine: boolean; - - /** - * Indicates whether the stream pointer position is at the end of a stream. - */ - AtEndOfStream: boolean; -} - -declare var WScript: { - /** - * Outputs text to either a message box (under WScript.exe) or the command console window followed by - * a newline (under CScript.exe). - */ - Echo(s: any): void; - - /** - * Exposes the write-only error output stream for the current script. - * Can be accessed only while using CScript.exe. - */ - StdErr: TextStreamWriter; - - /** - * Exposes the write-only output stream for the current script. - * Can be accessed only while using CScript.exe. - */ - StdOut: TextStreamWriter; - Arguments: { length: number; Item(n: number): string; }; - - /** - * The full path of the currently running script. - */ - ScriptFullName: string; - - /** - * Forces the script to stop immediately, with an optional exit code. - */ - Quit(exitCode?: number): number; - - /** - * The Windows Script Host build version number. - */ - BuildVersion: number; - - /** - * Fully qualified path of the host executable. - */ - FullName: string; - - /** - * Gets/sets the script mode - interactive(true) or batch(false). - */ - Interactive: boolean; - - /** - * The name of the host executable (WScript.exe or CScript.exe). - */ - Name: string; - - /** - * Path of the directory containing the host executable. - */ - Path: string; - - /** - * The filename of the currently running script. - */ - ScriptName: string; - - /** - * Exposes the read-only input stream for the current script. - * Can be accessed only while using CScript.exe. - */ - StdIn: TextStreamReader; - - /** - * Windows Script Host version - */ - Version: string; - - /** - * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event. - */ - ConnectObject(objEventSource: any, strPrefix: string): void; - - /** - * Creates a COM object. - * @param strProgiID - * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. - */ - CreateObject(strProgID: string, strPrefix?: string): any; - - /** - * Disconnects a COM object from its event sources. - */ - DisconnectObject(obj: any): void; - - /** - * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file. - * @param strPathname Fully qualified path to the file containing the object persisted to disk. - * For objects in memory, pass a zero-length string. - * @param strProgID - * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. - */ - GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; - - /** - * Suspends script execution for a specified length of time, then continues execution. - * @param intTime Interval (in milliseconds) to suspend script execution. - */ - Sleep(intTime: number): void; -}; - -/** - * Allows enumerating over a COM collection, which may not have indexed item access. - */ -interface Enumerator { - /** - * Returns true if the current item is the last one in the collection, or the collection is empty, - * or the current item is undefined. - */ - atEnd(): boolean; - - /** - * Returns the current item in the collection - */ - item(): T; - - /** - * Resets the current item in the collection to the first item. If there are no items in the collection, - * the current item is set to undefined. - */ - moveFirst(): void; - - /** - * Moves the current item to the next item in the collection. If the enumerator is at the end of - * the collection or the collection is empty, the current item is set to undefined. - */ - moveNext(): void; -} - -interface EnumeratorConstructor { - new (collection: any): Enumerator; - new (collection: any): Enumerator; -} - -declare var Enumerator: EnumeratorConstructor; - -/** - * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions. - */ -interface VBArray { - /** - * Returns the number of dimensions (1-based). - */ - dimensions(): number; - - /** - * Takes an index for each dimension in the array, and returns the item at the corresponding location. - */ - getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T; - - /** - * Returns the smallest available index for a given dimension. - * @param dimension 1-based dimension (defaults to 1) - */ - lbound(dimension?: number): number; - - /** - * Returns the largest available index for a given dimension. - * @param dimension 1-based dimension (defaults to 1) - */ - ubound(dimension?: number): number; - - /** - * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions, - * each successive dimension is appended to the end of the array. - * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6] - */ - toArray(): T[]; -} - -interface VBArrayConstructor { - new (safeArray: any): VBArray; - new (safeArray: any): VBArray; -} - -declare var VBArray: VBArrayConstructor; - -/** - * Automation date (VT_DATE) - */ -interface VarDate { } - -interface DateConstructor { - new (vd: VarDate): Date; -} - -interface Date { - getVarDate: () => VarDate; -} + + +///////////////////////////// +/// Windows Script Host APIS +///////////////////////////// + + +interface ActiveXObject { + new (s: string): any; +} +declare var ActiveXObject: ActiveXObject; + +interface ITextWriter { + Write(s: string): void; + WriteLine(s: string): void; + Close(): void; +} + +interface TextStreamBase { + /** + * The column number of the current character position in an input stream. + */ + Column: number; + + /** + * The current line number in an input stream. + */ + Line: number; + + /** + * Closes a text stream. + * It is not necessary to close standard streams; they close automatically when the process ends. If + * you close a standard stream, be aware that any other pointers to that standard stream become invalid. + */ + Close(): void; +} + +interface TextStreamWriter extends TextStreamBase { + /** + * Sends a string to an output stream. + */ + Write(s: string): void; + + /** + * Sends a specified number of blank lines (newline characters) to an output stream. + */ + WriteBlankLines(intLines: number): void; + + /** + * Sends a string followed by a newline character to an output stream. + */ + WriteLine(s: string): void; +} + +interface TextStreamReader extends TextStreamBase { + /** + * Returns a specified number of characters from an input stream, starting at the current pointer position. + * Does not return until the ENTER key is pressed. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + Read(characters: number): string; + + /** + * Returns all characters from an input stream. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + ReadAll(): string; + + /** + * Returns an entire line from an input stream. + * Although this method extracts the newline character, it does not add it to the returned string. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + ReadLine(): string; + + /** + * Skips a specified number of characters when reading from an input text stream. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.) + */ + Skip(characters: number): void; + + /** + * Skips the next line when reading from an input text stream. + * Can only be used on a stream in reading mode, not writing or appending mode. + */ + SkipLine(): void; + + /** + * Indicates whether the stream pointer position is at the end of a line. + */ + AtEndOfLine: boolean; + + /** + * Indicates whether the stream pointer position is at the end of a stream. + */ + AtEndOfStream: boolean; +} + +declare var WScript: { + /** + * Outputs text to either a message box (under WScript.exe) or the command console window followed by + * a newline (under CScript.exe). + */ + Echo(s: any): void; + + /** + * Exposes the write-only error output stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdErr: TextStreamWriter; + + /** + * Exposes the write-only output stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdOut: TextStreamWriter; + Arguments: { length: number; Item(n: number): string; }; + + /** + * The full path of the currently running script. + */ + ScriptFullName: string; + + /** + * Forces the script to stop immediately, with an optional exit code. + */ + Quit(exitCode?: number): number; + + /** + * The Windows Script Host build version number. + */ + BuildVersion: number; + + /** + * Fully qualified path of the host executable. + */ + FullName: string; + + /** + * Gets/sets the script mode - interactive(true) or batch(false). + */ + Interactive: boolean; + + /** + * The name of the host executable (WScript.exe or CScript.exe). + */ + Name: string; + + /** + * Path of the directory containing the host executable. + */ + Path: string; + + /** + * The filename of the currently running script. + */ + ScriptName: string; + + /** + * Exposes the read-only input stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdIn: TextStreamReader; + + /** + * Windows Script Host version + */ + Version: string; + + /** + * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event. + */ + ConnectObject(objEventSource: any, strPrefix: string): void; + + /** + * Creates a COM object. + * @param strProgiID + * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. + */ + CreateObject(strProgID: string, strPrefix?: string): any; + + /** + * Disconnects a COM object from its event sources. + */ + DisconnectObject(obj: any): void; + + /** + * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file. + * @param strPathname Fully qualified path to the file containing the object persisted to disk. + * For objects in memory, pass a zero-length string. + * @param strProgID + * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. + */ + GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; + + /** + * Suspends script execution for a specified length of time, then continues execution. + * @param intTime Interval (in milliseconds) to suspend script execution. + */ + Sleep(intTime: number): void; +}; + +/** + * Allows enumerating over a COM collection, which may not have indexed item access. + */ +interface Enumerator { + /** + * Returns true if the current item is the last one in the collection, or the collection is empty, + * or the current item is undefined. + */ + atEnd(): boolean; + + /** + * Returns the current item in the collection + */ + item(): T; + + /** + * Resets the current item in the collection to the first item. If there are no items in the collection, + * the current item is set to undefined. + */ + moveFirst(): void; + + /** + * Moves the current item to the next item in the collection. If the enumerator is at the end of + * the collection or the collection is empty, the current item is set to undefined. + */ + moveNext(): void; +} + +interface EnumeratorConstructor { + new (collection: any): Enumerator; + new (collection: any): Enumerator; +} + +declare var Enumerator: EnumeratorConstructor; + +/** + * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions. + */ +interface VBArray { + /** + * Returns the number of dimensions (1-based). + */ + dimensions(): number; + + /** + * Takes an index for each dimension in the array, and returns the item at the corresponding location. + */ + getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T; + + /** + * Returns the smallest available index for a given dimension. + * @param dimension 1-based dimension (defaults to 1) + */ + lbound(dimension?: number): number; + + /** + * Returns the largest available index for a given dimension. + * @param dimension 1-based dimension (defaults to 1) + */ + ubound(dimension?: number): number; + + /** + * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions, + * each successive dimension is appended to the end of the array. + * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6] + */ + toArray(): T[]; +} + +interface VBArrayConstructor { + new (safeArray: any): VBArray; + new (safeArray: any): VBArray; +} + +declare var VBArray: VBArrayConstructor; + +/** + * Automation date (VT_DATE) + */ +interface VarDate { } + +interface DateConstructor { + new (vd: VarDate): Date; +} + +interface Date { + getVarDate: () => VarDate; +} diff --git a/node_modules/typescript/lib/lib.webworker.d.ts b/node_modules/typescript/lib/lib.webworker.d.ts index 97eb9814e..4e7672f79 100644 --- a/node_modules/typescript/lib/lib.webworker.d.ts +++ b/node_modules/typescript/lib/lib.webworker.d.ts @@ -1,1274 +1,1861 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ -/// + +/// - -///////////////////////////// -/// IE Worker APIs -///////////////////////////// - -interface Algorithm { - name: string; -} - -interface EventInit { - scoped?: boolean; - bubbles?: boolean; - cancelable?: boolean; -} - -interface IDBIndexParameters { - multiEntry?: boolean; - unique?: boolean; -} - -interface IDBObjectStoreParameters { - autoIncrement?: boolean; - keyPath?: IDBKeyPath; -} - -interface KeyAlgorithm { - name?: string; -} - -interface EventListener { - (evt: Event): void; -} - -interface AudioBuffer { - readonly duration: number; - readonly length: number; - readonly numberOfChannels: number; - readonly sampleRate: number; - copyFromChannel(destination: Float32Array, channelNumber: number, startInChannel?: number): void; - copyToChannel(source: Float32Array, channelNumber: number, startInChannel?: number): void; - getChannelData(channel: number): Float32Array; -} - -declare var AudioBuffer: { - prototype: AudioBuffer; - new(): AudioBuffer; -} - -interface Blob { - readonly size: number; - readonly type: string; - msClose(): void; - msDetachStream(): any; - slice(start?: number, end?: number, contentType?: string): Blob; -} - -declare var Blob: { - prototype: Blob; - new (blobParts?: any[], options?: BlobPropertyBag): Blob; -} - -interface CloseEvent extends Event { - readonly code: number; - readonly reason: string; - readonly wasClean: boolean; - initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; -} - -declare var CloseEvent: { - prototype: CloseEvent; - new(): CloseEvent; -} - -interface Console { - assert(test?: boolean, message?: string, ...optionalParams: any[]): void; - clear(): void; - count(countTitle?: string): void; - debug(message?: string, ...optionalParams: any[]): void; - dir(value?: any, ...optionalParams: any[]): void; - dirxml(value: any): void; - error(message?: any, ...optionalParams: any[]): void; - exception(message?: string, ...optionalParams: any[]): void; - group(groupTitle?: string): void; - groupCollapsed(groupTitle?: string): void; - groupEnd(): void; - info(message?: any, ...optionalParams: any[]): void; - log(message?: any, ...optionalParams: any[]): void; - msIsIndependentlyComposed(element: any): boolean; - profile(reportName?: string): void; - profileEnd(): void; - select(element: any): void; - table(...data: any[]): void; - time(timerName?: string): void; - timeEnd(timerName?: string): void; - trace(message?: any, ...optionalParams: any[]): void; - warn(message?: any, ...optionalParams: any[]): void; -} - -declare var Console: { - prototype: Console; - new(): Console; -} - -interface Coordinates { - readonly accuracy: number; - readonly altitude: number | null; - readonly altitudeAccuracy: number | null; - readonly heading: number | null; - readonly latitude: number; - readonly longitude: number; - readonly speed: number | null; -} - -declare var Coordinates: { - prototype: Coordinates; - new(): Coordinates; -} - -interface CryptoKey { - readonly algorithm: KeyAlgorithm; - readonly extractable: boolean; - readonly type: string; - readonly usages: string[]; -} - -declare var CryptoKey: { - prototype: CryptoKey; - new(): CryptoKey; -} - -interface DOMError { - readonly name: string; - toString(): string; -} - -declare var DOMError: { - prototype: DOMError; - new(): DOMError; -} - -interface DOMException { - readonly code: number; - readonly message: string; - readonly name: string; - toString(): string; - readonly ABORT_ERR: number; - readonly DATA_CLONE_ERR: number; - readonly DOMSTRING_SIZE_ERR: number; - readonly HIERARCHY_REQUEST_ERR: number; - readonly INDEX_SIZE_ERR: number; - readonly INUSE_ATTRIBUTE_ERR: number; - readonly INVALID_ACCESS_ERR: number; - readonly INVALID_CHARACTER_ERR: number; - readonly INVALID_MODIFICATION_ERR: number; - readonly INVALID_NODE_TYPE_ERR: number; - readonly INVALID_STATE_ERR: number; - readonly NAMESPACE_ERR: number; - readonly NETWORK_ERR: number; - readonly NOT_FOUND_ERR: number; - readonly NOT_SUPPORTED_ERR: number; - readonly NO_DATA_ALLOWED_ERR: number; - readonly NO_MODIFICATION_ALLOWED_ERR: number; - readonly PARSE_ERR: number; - readonly QUOTA_EXCEEDED_ERR: number; - readonly SECURITY_ERR: number; - readonly SERIALIZE_ERR: number; - readonly SYNTAX_ERR: number; - readonly TIMEOUT_ERR: number; - readonly TYPE_MISMATCH_ERR: number; - readonly URL_MISMATCH_ERR: number; - readonly VALIDATION_ERR: number; - readonly WRONG_DOCUMENT_ERR: number; -} - -declare var DOMException: { - prototype: DOMException; - new(): DOMException; - readonly ABORT_ERR: number; - readonly DATA_CLONE_ERR: number; - readonly DOMSTRING_SIZE_ERR: number; - readonly HIERARCHY_REQUEST_ERR: number; - readonly INDEX_SIZE_ERR: number; - readonly INUSE_ATTRIBUTE_ERR: number; - readonly INVALID_ACCESS_ERR: number; - readonly INVALID_CHARACTER_ERR: number; - readonly INVALID_MODIFICATION_ERR: number; - readonly INVALID_NODE_TYPE_ERR: number; - readonly INVALID_STATE_ERR: number; - readonly NAMESPACE_ERR: number; - readonly NETWORK_ERR: number; - readonly NOT_FOUND_ERR: number; - readonly NOT_SUPPORTED_ERR: number; - readonly NO_DATA_ALLOWED_ERR: number; - readonly NO_MODIFICATION_ALLOWED_ERR: number; - readonly PARSE_ERR: number; - readonly QUOTA_EXCEEDED_ERR: number; - readonly SECURITY_ERR: number; - readonly SERIALIZE_ERR: number; - readonly SYNTAX_ERR: number; - readonly TIMEOUT_ERR: number; - readonly TYPE_MISMATCH_ERR: number; - readonly URL_MISMATCH_ERR: number; - readonly VALIDATION_ERR: number; - readonly WRONG_DOCUMENT_ERR: number; -} - -interface DOMStringList { - readonly length: number; - contains(str: string): boolean; - item(index: number): string | null; - [index: number]: string; -} - -declare var DOMStringList: { - prototype: DOMStringList; - new(): DOMStringList; -} - -interface ErrorEvent extends Event { - readonly colno: number; - readonly error: any; - readonly filename: string; - readonly lineno: number; - readonly message: string; - initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; -} - -declare var ErrorEvent: { - prototype: ErrorEvent; - new(): ErrorEvent; -} - -interface Event { - readonly bubbles: boolean; - cancelBubble: boolean; - readonly cancelable: boolean; - readonly currentTarget: EventTarget; - readonly defaultPrevented: boolean; - readonly eventPhase: number; - readonly isTrusted: boolean; - returnValue: boolean; - readonly srcElement: any; - readonly target: EventTarget; - readonly timeStamp: number; - readonly type: string; - readonly scoped: boolean; - initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; - preventDefault(): void; - stopImmediatePropagation(): void; - stopPropagation(): void; - deepPath(): EventTarget[]; - readonly AT_TARGET: number; - readonly BUBBLING_PHASE: number; - readonly CAPTURING_PHASE: number; -} - -declare var Event: { - prototype: Event; - new(type: string, eventInitDict?: EventInit): Event; - readonly AT_TARGET: number; - readonly BUBBLING_PHASE: number; - readonly CAPTURING_PHASE: number; -} - -interface EventTarget { - addEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void; - dispatchEvent(evt: Event): boolean; - removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var EventTarget: { - prototype: EventTarget; - new(): EventTarget; -} - -interface File extends Blob { - readonly lastModifiedDate: any; - readonly name: string; - readonly webkitRelativePath: string; -} - -declare var File: { - prototype: File; - new (parts: (ArrayBuffer | ArrayBufferView | Blob | string)[], filename: string, properties?: FilePropertyBag): File; -} - -interface FileList { - readonly length: number; - item(index: number): File; - [index: number]: File; -} - -declare var FileList: { - prototype: FileList; - new(): FileList; -} - -interface FileReader extends EventTarget, MSBaseReader { - readonly error: DOMError; - readAsArrayBuffer(blob: Blob): void; - readAsBinaryString(blob: Blob): void; - readAsDataURL(blob: Blob): void; - readAsText(blob: Blob, encoding?: string): void; - addEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var FileReader: { - prototype: FileReader; - new(): FileReader; -} - -interface IDBCursor { - readonly direction: string; - key: IDBKeyRange | IDBValidKey; - readonly primaryKey: any; - source: IDBObjectStore | IDBIndex; - advance(count: number): void; - continue(key?: IDBKeyRange | IDBValidKey): void; - delete(): IDBRequest; - update(value: any): IDBRequest; - readonly NEXT: string; - readonly NEXT_NO_DUPLICATE: string; - readonly PREV: string; - readonly PREV_NO_DUPLICATE: string; -} - -declare var IDBCursor: { - prototype: IDBCursor; - new(): IDBCursor; - readonly NEXT: string; - readonly NEXT_NO_DUPLICATE: string; - readonly PREV: string; - readonly PREV_NO_DUPLICATE: string; -} - -interface IDBCursorWithValue extends IDBCursor { - readonly value: any; -} - -declare var IDBCursorWithValue: { - prototype: IDBCursorWithValue; - new(): IDBCursorWithValue; -} - -interface IDBDatabaseEventMap { - "abort": Event; - "error": ErrorEvent; -} - -interface IDBDatabase extends EventTarget { - readonly name: string; - readonly objectStoreNames: DOMStringList; - onabort: (this: IDBDatabase, ev: Event) => any; - onerror: (this: IDBDatabase, ev: ErrorEvent) => any; - version: number; - onversionchange: (ev: IDBVersionChangeEvent) => any; - close(): void; - createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore; - deleteObjectStore(name: string): void; - transaction(storeNames: string | string[], mode?: string): IDBTransaction; - addEventListener(type: "versionchange", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBDatabase: { - prototype: IDBDatabase; - new(): IDBDatabase; -} - -interface IDBFactory { - cmp(first: any, second: any): number; - deleteDatabase(name: string): IDBOpenDBRequest; - open(name: string, version?: number): IDBOpenDBRequest; -} - -declare var IDBFactory: { - prototype: IDBFactory; - new(): IDBFactory; -} - -interface IDBIndex { - keyPath: string | string[]; - readonly name: string; - readonly objectStore: IDBObjectStore; - readonly unique: boolean; - multiEntry: boolean; - count(key?: IDBKeyRange | IDBValidKey): IDBRequest; - get(key: IDBKeyRange | IDBValidKey): IDBRequest; - getKey(key: IDBKeyRange | IDBValidKey): IDBRequest; - openCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; - openKeyCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; -} - -declare var IDBIndex: { - prototype: IDBIndex; - new(): IDBIndex; -} - -interface IDBKeyRange { - readonly lower: any; - readonly lowerOpen: boolean; - readonly upper: any; - readonly upperOpen: boolean; -} - -declare var IDBKeyRange: { - prototype: IDBKeyRange; - new(): IDBKeyRange; - bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; - lowerBound(lower: any, open?: boolean): IDBKeyRange; - only(value: any): IDBKeyRange; - upperBound(upper: any, open?: boolean): IDBKeyRange; -} - -interface IDBObjectStore { - readonly indexNames: DOMStringList; - keyPath: string | string[]; - readonly name: string; - readonly transaction: IDBTransaction; - autoIncrement: boolean; - add(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest; - clear(): IDBRequest; - count(key?: IDBKeyRange | IDBValidKey): IDBRequest; - createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex; - delete(key: IDBKeyRange | IDBValidKey): IDBRequest; - deleteIndex(indexName: string): void; - get(key: any): IDBRequest; - index(name: string): IDBIndex; - openCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; - put(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest; -} - -declare var IDBObjectStore: { - prototype: IDBObjectStore; - new(): IDBObjectStore; -} - -interface IDBOpenDBRequestEventMap extends IDBRequestEventMap { - "blocked": Event; - "upgradeneeded": IDBVersionChangeEvent; -} - -interface IDBOpenDBRequest extends IDBRequest { - onblocked: (this: IDBOpenDBRequest, ev: Event) => any; - onupgradeneeded: (this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any; - addEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBOpenDBRequest: { - prototype: IDBOpenDBRequest; - new(): IDBOpenDBRequest; -} - -interface IDBRequestEventMap { - "error": ErrorEvent; - "success": Event; -} - -interface IDBRequest extends EventTarget { - readonly error: DOMError; - onerror: (this: IDBRequest, ev: ErrorEvent) => any; - onsuccess: (this: IDBRequest, ev: Event) => any; - readonly readyState: string; - readonly result: any; - source: IDBObjectStore | IDBIndex | IDBCursor; - readonly transaction: IDBTransaction; - addEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBRequest: { - prototype: IDBRequest; - new(): IDBRequest; -} - -interface IDBTransactionEventMap { - "abort": Event; - "complete": Event; - "error": ErrorEvent; -} - -interface IDBTransaction extends EventTarget { - readonly db: IDBDatabase; - readonly error: DOMError; - readonly mode: string; - onabort: (this: IDBTransaction, ev: Event) => any; - oncomplete: (this: IDBTransaction, ev: Event) => any; - onerror: (this: IDBTransaction, ev: ErrorEvent) => any; - abort(): void; - objectStore(name: string): IDBObjectStore; - readonly READ_ONLY: string; - readonly READ_WRITE: string; - readonly VERSION_CHANGE: string; - addEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBTransaction: { - prototype: IDBTransaction; - new(): IDBTransaction; - readonly READ_ONLY: string; - readonly READ_WRITE: string; - readonly VERSION_CHANGE: string; -} - -interface IDBVersionChangeEvent extends Event { - readonly newVersion: number | null; - readonly oldVersion: number; -} - -declare var IDBVersionChangeEvent: { - prototype: IDBVersionChangeEvent; - new(): IDBVersionChangeEvent; -} - -interface ImageData { - data: Uint8ClampedArray; - readonly height: number; - readonly width: number; -} - -declare var ImageData: { - prototype: ImageData; - new(width: number, height: number): ImageData; - new(array: Uint8ClampedArray, width: number, height: number): ImageData; -} - -interface MSApp { - clearTemporaryWebDataAsync(): MSAppAsyncOperation; - createBlobFromRandomAccessStream(type: string, seeker: any): Blob; - createDataPackage(object: any): any; - createDataPackageFromSelection(): any; - createFileFromStorageFile(storageFile: any): File; - createStreamFromInputStream(type: string, inputStream: any): MSStream; - execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; - execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; - getCurrentPriority(): string; - getHtmlPrintDocumentSourceAsync(htmlDoc: any): PromiseLike; - getViewId(view: any): any; - isTaskScheduledAtPriorityOrHigher(priority: string): boolean; - pageHandlesAllApplicationActivations(enabled: boolean): void; - suppressSubdownloadCredentialPrompts(suppress: boolean): void; - terminateApp(exceptionObject: any): void; - readonly CURRENT: string; - readonly HIGH: string; - readonly IDLE: string; - readonly NORMAL: string; -} -declare var MSApp: MSApp; - -interface MSAppAsyncOperationEventMap { - "complete": Event; - "error": ErrorEvent; -} - -interface MSAppAsyncOperation extends EventTarget { - readonly error: DOMError; - oncomplete: (this: MSAppAsyncOperation, ev: Event) => any; - onerror: (this: MSAppAsyncOperation, ev: ErrorEvent) => any; - readonly readyState: number; - readonly result: any; - start(): void; - readonly COMPLETED: number; - readonly ERROR: number; - readonly STARTED: number; - addEventListener(type: K, listener: (this: MSAppAsyncOperation, ev: MSAppAsyncOperationEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSAppAsyncOperation: { - prototype: MSAppAsyncOperation; - new(): MSAppAsyncOperation; - readonly COMPLETED: number; - readonly ERROR: number; - readonly STARTED: number; -} - -interface MSBlobBuilder { - append(data: any, endings?: string): void; - getBlob(contentType?: string): Blob; -} - -declare var MSBlobBuilder: { - prototype: MSBlobBuilder; - new(): MSBlobBuilder; -} - -interface MSStream { - readonly type: string; - msClose(): void; - msDetachStream(): any; -} - -declare var MSStream: { - prototype: MSStream; - new(): MSStream; -} - -interface MSStreamReader extends EventTarget, MSBaseReader { - readonly error: DOMError; - readAsArrayBuffer(stream: MSStream, size?: number): void; - readAsBinaryString(stream: MSStream, size?: number): void; - readAsBlob(stream: MSStream, size?: number): void; - readAsDataURL(stream: MSStream, size?: number): void; - readAsText(stream: MSStream, encoding?: string, size?: number): void; - addEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSStreamReader: { - prototype: MSStreamReader; - new(): MSStreamReader; -} - -interface MediaQueryList { - readonly matches: boolean; - readonly media: string; - addListener(listener: MediaQueryListListener): void; - removeListener(listener: MediaQueryListListener): void; -} - -declare var MediaQueryList: { - prototype: MediaQueryList; - new(): MediaQueryList; -} - -interface MessageChannel { - readonly port1: MessagePort; - readonly port2: MessagePort; -} - -declare var MessageChannel: { - prototype: MessageChannel; - new(): MessageChannel; -} - -interface MessageEvent extends Event { - readonly data: any; - readonly origin: string; - readonly ports: any; - readonly source: any; - initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: any): void; -} - -declare var MessageEvent: { - prototype: MessageEvent; - new(type: string, eventInitDict?: MessageEventInit): MessageEvent; -} - -interface MessagePortEventMap { - "message": MessageEvent; -} - -interface MessagePort extends EventTarget { - onmessage: (this: MessagePort, ev: MessageEvent) => any; - close(): void; - postMessage(message?: any, ports?: any): void; - start(): void; - addEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MessagePort: { - prototype: MessagePort; - new(): MessagePort; -} - -interface Position { - readonly coords: Coordinates; - readonly timestamp: number; -} - -declare var Position: { - prototype: Position; - new(): Position; -} - -interface PositionError { - readonly code: number; - readonly message: string; - toString(): string; - readonly PERMISSION_DENIED: number; - readonly POSITION_UNAVAILABLE: number; - readonly TIMEOUT: number; -} - -declare var PositionError: { - prototype: PositionError; - new(): PositionError; - readonly PERMISSION_DENIED: number; - readonly POSITION_UNAVAILABLE: number; - readonly TIMEOUT: number; -} - -interface ProgressEvent extends Event { - readonly lengthComputable: boolean; - readonly loaded: number; - readonly total: number; - initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; -} - -declare var ProgressEvent: { - prototype: ProgressEvent; - new(type: string, eventInitDict?: ProgressEventInit): ProgressEvent; -} - -interface WebSocketEventMap { - "close": CloseEvent; - "error": ErrorEvent; - "message": MessageEvent; - "open": Event; -} - -interface WebSocket extends EventTarget { - binaryType: string; - readonly bufferedAmount: number; - readonly extensions: string; - onclose: (this: WebSocket, ev: CloseEvent) => any; - onerror: (this: WebSocket, ev: ErrorEvent) => any; - onmessage: (this: WebSocket, ev: MessageEvent) => any; - onopen: (this: WebSocket, ev: Event) => any; - readonly protocol: string; - readonly readyState: number; - readonly url: string; - close(code?: number, reason?: string): void; - send(data: any): void; - readonly CLOSED: number; - readonly CLOSING: number; - readonly CONNECTING: number; - readonly OPEN: number; - addEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var WebSocket: { - prototype: WebSocket; - new(url: string, protocols?: string | string[]): WebSocket; - readonly CLOSED: number; - readonly CLOSING: number; - readonly CONNECTING: number; - readonly OPEN: number; -} - -interface WorkerEventMap extends AbstractWorkerEventMap { - "message": MessageEvent; -} - -interface Worker extends EventTarget, AbstractWorker { - onmessage: (this: Worker, ev: MessageEvent) => any; - postMessage(message: any, ports?: any): void; - terminate(): void; - addEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Worker: { - prototype: Worker; - new(stringUrl: string): Worker; -} - -interface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap { - "readystatechange": Event; -} - -interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { - onreadystatechange: (this: XMLHttpRequest, ev: Event) => any; - readonly readyState: number; - readonly response: any; - readonly responseText: string; - responseType: string; - readonly responseXML: any; - readonly status: number; - readonly statusText: string; - timeout: number; - readonly upload: XMLHttpRequestUpload; - withCredentials: boolean; - msCaching?: string; - readonly responseURL: string; - abort(): void; - getAllResponseHeaders(): string; - getResponseHeader(header: string): string | null; - msCachingEnabled(): boolean; - open(method: string, url: string, async?: boolean, user?: string, password?: string): void; - overrideMimeType(mime: string): void; - send(data?: string): void; - send(data?: any): void; - setRequestHeader(header: string, value: string): void; - readonly DONE: number; - readonly HEADERS_RECEIVED: number; - readonly LOADING: number; - readonly OPENED: number; - readonly UNSENT: number; - addEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var XMLHttpRequest: { - prototype: XMLHttpRequest; - new(): XMLHttpRequest; - readonly DONE: number; - readonly HEADERS_RECEIVED: number; - readonly LOADING: number; - readonly OPENED: number; - readonly UNSENT: number; - create(): XMLHttpRequest; -} - -interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget { - addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var XMLHttpRequestUpload: { - prototype: XMLHttpRequestUpload; - new(): XMLHttpRequestUpload; -} - -interface AbstractWorkerEventMap { - "error": ErrorEvent; -} - -interface AbstractWorker { - onerror: (this: AbstractWorker, ev: ErrorEvent) => any; - addEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface MSBaseReaderEventMap { - "abort": Event; - "error": ErrorEvent; - "load": Event; - "loadend": ProgressEvent; - "loadstart": Event; - "progress": ProgressEvent; -} - -interface MSBaseReader { - onabort: (this: MSBaseReader, ev: Event) => any; - onerror: (this: MSBaseReader, ev: ErrorEvent) => any; - onload: (this: MSBaseReader, ev: Event) => any; - onloadend: (this: MSBaseReader, ev: ProgressEvent) => any; - onloadstart: (this: MSBaseReader, ev: Event) => any; - onprogress: (this: MSBaseReader, ev: ProgressEvent) => any; - readonly readyState: number; - readonly result: any; - abort(): void; - readonly DONE: number; - readonly EMPTY: number; - readonly LOADING: number; - addEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface NavigatorID { - readonly appName: string; - readonly appVersion: string; - readonly platform: string; - readonly product: string; - readonly productSub: string; - readonly userAgent: string; - readonly vendor: string; - readonly vendorSub: string; -} - -interface NavigatorOnLine { - readonly onLine: boolean; -} - -interface WindowBase64 { - atob(encodedString: string): string; - btoa(rawString: string): string; -} - -interface WindowConsole { - readonly console: Console; -} - -interface XMLHttpRequestEventTargetEventMap { - "abort": Event; - "error": ErrorEvent; - "load": Event; - "loadend": ProgressEvent; - "loadstart": Event; - "progress": ProgressEvent; - "timeout": ProgressEvent; -} - -interface XMLHttpRequestEventTarget { - onabort: (this: XMLHttpRequestEventTarget, ev: Event) => any; - onerror: (this: XMLHttpRequestEventTarget, ev: ErrorEvent) => any; - onload: (this: XMLHttpRequestEventTarget, ev: Event) => any; - onloadend: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; - onloadstart: (this: XMLHttpRequestEventTarget, ev: Event) => any; - onprogress: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; - ontimeout: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; - addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface FileReaderSync { - readAsArrayBuffer(blob: Blob): any; - readAsBinaryString(blob: Blob): void; - readAsDataURL(blob: Blob): string; - readAsText(blob: Blob, encoding?: string): string; -} - -declare var FileReaderSync: { - prototype: FileReaderSync; - new(): FileReaderSync; -} - -interface WorkerGlobalScopeEventMap extends DedicatedWorkerGlobalScopeEventMap { - "error": ErrorEvent; -} - -interface WorkerGlobalScope extends EventTarget, WorkerUtils, DedicatedWorkerGlobalScope, WindowConsole { - readonly location: WorkerLocation; - onerror: (this: WorkerGlobalScope, ev: ErrorEvent) => any; - readonly self: WorkerGlobalScope; - close(): void; - msWriteProfilerMark(profilerMarkName: string): void; - toString(): string; - addEventListener(type: K, listener: (this: WorkerGlobalScope, ev: WorkerGlobalScopeEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var WorkerGlobalScope: { - prototype: WorkerGlobalScope; - new(): WorkerGlobalScope; -} - -interface WorkerLocation { - readonly hash: string; - readonly host: string; - readonly hostname: string; - readonly href: string; - readonly pathname: string; - readonly port: string; - readonly protocol: string; - readonly search: string; - toString(): string; -} - -declare var WorkerLocation: { - prototype: WorkerLocation; - new(): WorkerLocation; -} - -interface WorkerNavigator extends Object, NavigatorID, NavigatorOnLine { - readonly hardwareConcurrency: number; -} - -declare var WorkerNavigator: { - prototype: WorkerNavigator; - new(): WorkerNavigator; -} - -interface DedicatedWorkerGlobalScopeEventMap { - "message": MessageEvent; -} - -interface DedicatedWorkerGlobalScope { - onmessage: (this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any; - postMessage(data: any): void; - addEventListener(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface WorkerUtils extends Object, WindowBase64 { - readonly indexedDB: IDBFactory; - readonly msIndexedDB: IDBFactory; - readonly navigator: WorkerNavigator; - clearImmediate(handle: number): void; - clearInterval(handle: number): void; - clearTimeout(handle: number): void; - importScripts(...urls: string[]): void; - setImmediate(handler: (...args: any[]) => void): number; - setImmediate(handler: any, ...args: any[]): number; - setInterval(handler: (...args: any[]) => void, timeout: number): number; - setInterval(handler: any, timeout?: any, ...args: any[]): number; - setTimeout(handler: (...args: any[]) => void, timeout: number): number; - setTimeout(handler: any, timeout?: any, ...args: any[]): number; -} - -interface BlobPropertyBag { - type?: string; - endings?: string; -} - -interface FilePropertyBag { - type?: string; - lastModified?: number; -} - -interface EventListenerObject { - handleEvent(evt: Event): void; -} - -interface MessageEventInit extends EventInit { - data?: any; - origin?: string; - lastEventId?: string; - channel?: string; - source?: any; - ports?: MessagePort[]; -} - -interface ProgressEventInit extends EventInit { - lengthComputable?: boolean; - loaded?: number; - total?: number; -} - -interface IDBArrayKey extends Array { -} - -interface RsaKeyGenParams extends Algorithm { - modulusLength: number; - publicExponent: Uint8Array; -} - -interface RsaHashedKeyGenParams extends RsaKeyGenParams { - hash: AlgorithmIdentifier; -} - -interface RsaKeyAlgorithm extends KeyAlgorithm { - modulusLength: number; - publicExponent: Uint8Array; -} - -interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { - hash: AlgorithmIdentifier; -} - -interface RsaHashedImportParams { - hash: AlgorithmIdentifier; -} - -interface RsaPssParams { - saltLength: number; -} - -interface RsaOaepParams extends Algorithm { - label?: BufferSource; -} - -interface EcdsaParams extends Algorithm { - hash: AlgorithmIdentifier; -} - -interface EcKeyGenParams extends Algorithm { - namedCurve: string; -} - -interface EcKeyAlgorithm extends KeyAlgorithm { - typedCurve: string; -} - -interface EcKeyImportParams { - namedCurve: string; -} - -interface EcdhKeyDeriveParams extends Algorithm { - public: CryptoKey; -} - -interface AesCtrParams extends Algorithm { - counter: BufferSource; - length: number; -} - -interface AesKeyAlgorithm extends KeyAlgorithm { - length: number; -} - -interface AesKeyGenParams extends Algorithm { - length: number; -} - -interface AesDerivedKeyParams extends Algorithm { - length: number; -} - -interface AesCbcParams extends Algorithm { - iv: BufferSource; -} - -interface AesCmacParams extends Algorithm { - length: number; -} - -interface AesGcmParams extends Algorithm { - iv: BufferSource; - additionalData?: BufferSource; - tagLength?: number; -} - -interface AesCfbParams extends Algorithm { - iv: BufferSource; -} - -interface HmacImportParams extends Algorithm { - hash?: AlgorithmIdentifier; - length?: number; -} - -interface HmacKeyAlgorithm extends KeyAlgorithm { - hash: AlgorithmIdentifier; - length: number; -} - -interface HmacKeyGenParams extends Algorithm { - hash: AlgorithmIdentifier; - length?: number; -} - -interface DhKeyGenParams extends Algorithm { - prime: Uint8Array; - generator: Uint8Array; -} - -interface DhKeyAlgorithm extends KeyAlgorithm { - prime: Uint8Array; - generator: Uint8Array; -} - -interface DhKeyDeriveParams extends Algorithm { - public: CryptoKey; -} - -interface DhImportKeyParams extends Algorithm { - prime: Uint8Array; - generator: Uint8Array; -} - -interface ConcatParams extends Algorithm { - hash?: AlgorithmIdentifier; - algorithmId: Uint8Array; - partyUInfo: Uint8Array; - partyVInfo: Uint8Array; - publicInfo?: Uint8Array; - privateInfo?: Uint8Array; -} - -interface HkdfCtrParams extends Algorithm { - hash: AlgorithmIdentifier; - label: BufferSource; - context: BufferSource; -} - -interface Pbkdf2Params extends Algorithm { - salt: BufferSource; - iterations: number; - hash: AlgorithmIdentifier; -} - -interface RsaOtherPrimesInfo { - r: string; - d: string; - t: string; -} - -interface JsonWebKey { - kty: string; - use?: string; - key_ops?: string[]; - alg?: string; - kid?: string; - x5u?: string; - x5c?: string; - x5t?: string; - ext?: boolean; - crv?: string; - x?: string; - y?: string; - d?: string; - n?: string; - e?: string; - p?: string; - q?: string; - dp?: string; - dq?: string; - qi?: string; - oth?: RsaOtherPrimesInfo[]; - k?: string; -} - -declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; - -interface ErrorEventHandler { - (message: string, filename?: string, lineno?: number, colno?: number, error?:Error): void; -} -interface PositionCallback { - (position: Position): void; -} -interface PositionErrorCallback { - (error: PositionError): void; -} -interface MediaQueryListListener { - (mql: MediaQueryList): void; -} -interface MSLaunchUriCallback { - (): void; -} -interface MSUnsafeFunctionCallback { - (): any; -} -interface MSExecAtPriorityFunctionCallback { - (...args: any[]): any; -} -interface DecodeSuccessCallback { - (decodedData: AudioBuffer): void; -} -interface DecodeErrorCallback { - (error: DOMException): void; -} -interface FunctionStringCallback { - (data: string): void; -} -declare var location: WorkerLocation; -declare var onerror: (this: WorkerGlobalScope, ev: ErrorEvent) => any; -declare var self: WorkerGlobalScope; -declare function close(): void; -declare function msWriteProfilerMark(profilerMarkName: string): void; -declare function toString(): string; -declare function dispatchEvent(evt: Event): boolean; -declare function removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void; -declare var indexedDB: IDBFactory; -declare var msIndexedDB: IDBFactory; -declare var navigator: WorkerNavigator; -declare function clearImmediate(handle: number): void; -declare function clearInterval(handle: number): void; -declare function clearTimeout(handle: number): void; -declare function importScripts(...urls: string[]): void; -declare function setImmediate(handler: (...args: any[]) => void): number; -declare function setImmediate(handler: any, ...args: any[]): number; -declare function setInterval(handler: (...args: any[]) => void, timeout: number): number; -declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; -declare function setTimeout(handler: (...args: any[]) => void, timeout: number): number; -declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; -declare function atob(encodedString: string): string; -declare function btoa(rawString: string): string; -declare var onmessage: (this: WorkerGlobalScope, ev: MessageEvent) => any; -declare function postMessage(data: any): void; -declare var console: Console; -declare function addEventListener(type: K, listener: (this: WorkerGlobalScope, ev: WorkerGlobalScopeEventMap[K]) => any, useCapture?: boolean): void; -declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -type AlgorithmIdentifier = string | Algorithm; -type IDBKeyPath = string; -type IDBValidKey = number | string | Date | IDBArrayKey; -type BufferSource = ArrayBuffer | ArrayBufferView; \ No newline at end of file + +///////////////////////////// +/// IE Worker APIs +///////////////////////////// + +interface Algorithm { + name: string; +} + +interface CacheQueryOptions { + ignoreSearch?: boolean; + ignoreMethod?: boolean; + ignoreVary?: boolean; + cacheName?: string; +} + +interface CloseEventInit extends EventInit { + wasClean?: boolean; + code?: number; + reason?: string; +} + +interface EventInit { + scoped?: boolean; + bubbles?: boolean; + cancelable?: boolean; +} + +interface GetNotificationOptions { + tag?: string; +} + +interface IDBIndexParameters { + multiEntry?: boolean; + unique?: boolean; +} + +interface IDBObjectStoreParameters { + autoIncrement?: boolean; + keyPath?: IDBKeyPath; +} + +interface KeyAlgorithm { + name?: string; +} + +interface MessageEventInit extends EventInit { + lastEventId?: string; + channel?: string; + data?: any; + origin?: string; + source?: any; + ports?: MessagePort[]; +} + +interface NotificationOptions { + dir?: NotificationDirection; + lang?: string; + body?: string; + tag?: string; + icon?: string; +} + +interface ObjectURLOptions { + oneTimeOnly?: boolean; +} + +interface PushSubscriptionOptionsInit { + userVisibleOnly?: boolean; + applicationServerKey?: any; +} + +interface RequestInit { + method?: string; + headers?: any; + body?: any; + referrer?: string; + referrerPolicy?: ReferrerPolicy; + mode?: RequestMode; + credentials?: RequestCredentials; + cache?: RequestCache; + redirect?: RequestRedirect; + integrity?: string; + keepalive?: boolean; + window?: any; +} + +interface ResponseInit { + status?: number; + statusText?: string; + headers?: any; +} + +interface ClientQueryOptions { + includeUncontrolled?: boolean; + type?: ClientType; +} + +interface ExtendableEventInit extends EventInit { +} + +interface ExtendableMessageEventInit extends ExtendableEventInit { + data?: any; + origin?: string; + lastEventId?: string; + source?: Client | ServiceWorker | MessagePort; + ports?: MessagePort[]; +} + +interface FetchEventInit extends ExtendableEventInit { + request?: Request; + clientId?: string; + isReload?: boolean; +} + +interface NotificationEventInit extends ExtendableEventInit { + notification?: Notification; + action?: string; +} + +interface PushEventInit extends ExtendableEventInit { + data?: any; +} + +interface SyncEventInit extends ExtendableEventInit { + tag?: string; + lastChance?: boolean; +} + +interface EventListener { + (evt: Event): void; +} + +interface WebKitEntriesCallback { + (evt: Event): void; +} + +interface WebKitErrorCallback { + (evt: Event): void; +} + +interface WebKitFileCallback { + (evt: Event): void; +} + +interface AudioBuffer { + readonly duration: number; + readonly length: number; + readonly numberOfChannels: number; + readonly sampleRate: number; + copyFromChannel(destination: Float32Array, channelNumber: number, startInChannel?: number): void; + copyToChannel(source: Float32Array, channelNumber: number, startInChannel?: number): void; + getChannelData(channel: number): Float32Array; +} + +declare var AudioBuffer: { + prototype: AudioBuffer; + new(): AudioBuffer; +} + +interface Blob { + readonly size: number; + readonly type: string; + msClose(): void; + msDetachStream(): any; + slice(start?: number, end?: number, contentType?: string): Blob; +} + +declare var Blob: { + prototype: Blob; + new (blobParts?: any[], options?: BlobPropertyBag): Blob; +} + +interface Cache { + add(request: RequestInfo): Promise; + addAll(requests: RequestInfo[]): Promise; + delete(request: RequestInfo, options?: CacheQueryOptions): Promise; + keys(request?: RequestInfo, options?: CacheQueryOptions): any; + match(request: RequestInfo, options?: CacheQueryOptions): Promise; + matchAll(request?: RequestInfo, options?: CacheQueryOptions): any; + put(request: RequestInfo, response: Response): Promise; +} + +declare var Cache: { + prototype: Cache; + new(): Cache; +} + +interface CacheStorage { + delete(cacheName: string): Promise; + has(cacheName: string): Promise; + keys(): any; + match(request: RequestInfo, options?: CacheQueryOptions): Promise; + open(cacheName: string): Promise; +} + +declare var CacheStorage: { + prototype: CacheStorage; + new(): CacheStorage; +} + +interface CloseEvent extends Event { + readonly code: number; + readonly reason: string; + readonly wasClean: boolean; + initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; +} + +declare var CloseEvent: { + prototype: CloseEvent; + new(typeArg: string, eventInitDict?: CloseEventInit): CloseEvent; +} + +interface Console { + assert(test?: boolean, message?: string, ...optionalParams: any[]): void; + clear(): void; + count(countTitle?: string): void; + debug(message?: any, ...optionalParams: any[]): void; + dir(value?: any, ...optionalParams: any[]): void; + dirxml(value: any): void; + error(message?: any, ...optionalParams: any[]): void; + exception(message?: string, ...optionalParams: any[]): void; + group(groupTitle?: string): void; + groupCollapsed(groupTitle?: string): void; + groupEnd(): void; + info(message?: any, ...optionalParams: any[]): void; + log(message?: any, ...optionalParams: any[]): void; + msIsIndependentlyComposed(element: any): boolean; + profile(reportName?: string): void; + profileEnd(): void; + select(element: any): void; + table(...data: any[]): void; + time(timerName?: string): void; + timeEnd(timerName?: string): void; + trace(message?: any, ...optionalParams: any[]): void; + warn(message?: any, ...optionalParams: any[]): void; +} + +declare var Console: { + prototype: Console; + new(): Console; +} + +interface Coordinates { + readonly accuracy: number; + readonly altitude: number | null; + readonly altitudeAccuracy: number | null; + readonly heading: number | null; + readonly latitude: number; + readonly longitude: number; + readonly speed: number | null; +} + +declare var Coordinates: { + prototype: Coordinates; + new(): Coordinates; +} + +interface CryptoKey { + readonly algorithm: KeyAlgorithm; + readonly extractable: boolean; + readonly type: string; + readonly usages: string[]; +} + +declare var CryptoKey: { + prototype: CryptoKey; + new(): CryptoKey; +} + +interface DOMError { + readonly name: string; + toString(): string; +} + +declare var DOMError: { + prototype: DOMError; + new(): DOMError; +} + +interface DOMException { + readonly code: number; + readonly message: string; + readonly name: string; + toString(): string; + readonly ABORT_ERR: number; + readonly DATA_CLONE_ERR: number; + readonly DOMSTRING_SIZE_ERR: number; + readonly HIERARCHY_REQUEST_ERR: number; + readonly INDEX_SIZE_ERR: number; + readonly INUSE_ATTRIBUTE_ERR: number; + readonly INVALID_ACCESS_ERR: number; + readonly INVALID_CHARACTER_ERR: number; + readonly INVALID_MODIFICATION_ERR: number; + readonly INVALID_NODE_TYPE_ERR: number; + readonly INVALID_STATE_ERR: number; + readonly NAMESPACE_ERR: number; + readonly NETWORK_ERR: number; + readonly NOT_FOUND_ERR: number; + readonly NOT_SUPPORTED_ERR: number; + readonly NO_DATA_ALLOWED_ERR: number; + readonly NO_MODIFICATION_ALLOWED_ERR: number; + readonly PARSE_ERR: number; + readonly QUOTA_EXCEEDED_ERR: number; + readonly SECURITY_ERR: number; + readonly SERIALIZE_ERR: number; + readonly SYNTAX_ERR: number; + readonly TIMEOUT_ERR: number; + readonly TYPE_MISMATCH_ERR: number; + readonly URL_MISMATCH_ERR: number; + readonly VALIDATION_ERR: number; + readonly WRONG_DOCUMENT_ERR: number; +} + +declare var DOMException: { + prototype: DOMException; + new(): DOMException; + readonly ABORT_ERR: number; + readonly DATA_CLONE_ERR: number; + readonly DOMSTRING_SIZE_ERR: number; + readonly HIERARCHY_REQUEST_ERR: number; + readonly INDEX_SIZE_ERR: number; + readonly INUSE_ATTRIBUTE_ERR: number; + readonly INVALID_ACCESS_ERR: number; + readonly INVALID_CHARACTER_ERR: number; + readonly INVALID_MODIFICATION_ERR: number; + readonly INVALID_NODE_TYPE_ERR: number; + readonly INVALID_STATE_ERR: number; + readonly NAMESPACE_ERR: number; + readonly NETWORK_ERR: number; + readonly NOT_FOUND_ERR: number; + readonly NOT_SUPPORTED_ERR: number; + readonly NO_DATA_ALLOWED_ERR: number; + readonly NO_MODIFICATION_ALLOWED_ERR: number; + readonly PARSE_ERR: number; + readonly QUOTA_EXCEEDED_ERR: number; + readonly SECURITY_ERR: number; + readonly SERIALIZE_ERR: number; + readonly SYNTAX_ERR: number; + readonly TIMEOUT_ERR: number; + readonly TYPE_MISMATCH_ERR: number; + readonly URL_MISMATCH_ERR: number; + readonly VALIDATION_ERR: number; + readonly WRONG_DOCUMENT_ERR: number; +} + +interface DOMStringList { + readonly length: number; + contains(str: string): boolean; + item(index: number): string | null; + [index: number]: string; +} + +declare var DOMStringList: { + prototype: DOMStringList; + new(): DOMStringList; +} + +interface ErrorEvent extends Event { + readonly colno: number; + readonly error: any; + readonly filename: string; + readonly lineno: number; + readonly message: string; + initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; +} + +declare var ErrorEvent: { + prototype: ErrorEvent; + new(type: string, errorEventInitDict?: ErrorEventInit): ErrorEvent; +} + +interface Event { + readonly bubbles: boolean; + cancelBubble: boolean; + readonly cancelable: boolean; + readonly currentTarget: EventTarget; + readonly defaultPrevented: boolean; + readonly eventPhase: number; + readonly isTrusted: boolean; + returnValue: boolean; + readonly srcElement: any; + readonly target: EventTarget; + readonly timeStamp: number; + readonly type: string; + readonly scoped: boolean; + initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; + preventDefault(): void; + stopImmediatePropagation(): void; + stopPropagation(): void; + deepPath(): EventTarget[]; + readonly AT_TARGET: number; + readonly BUBBLING_PHASE: number; + readonly CAPTURING_PHASE: number; +} + +declare var Event: { + prototype: Event; + new(typeArg: string, eventInitDict?: EventInit): Event; + readonly AT_TARGET: number; + readonly BUBBLING_PHASE: number; + readonly CAPTURING_PHASE: number; +} + +interface EventTarget { + addEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + dispatchEvent(evt: Event): boolean; + removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var EventTarget: { + prototype: EventTarget; + new(): EventTarget; +} + +interface File extends Blob { + readonly lastModifiedDate: any; + readonly name: string; + readonly webkitRelativePath: string; +} + +declare var File: { + prototype: File; + new (parts: (ArrayBuffer | ArrayBufferView | Blob | string)[], filename: string, properties?: FilePropertyBag): File; +} + +interface FileList { + readonly length: number; + item(index: number): File; + [index: number]: File; +} + +declare var FileList: { + prototype: FileList; + new(): FileList; +} + +interface FileReader extends EventTarget, MSBaseReader { + readonly error: DOMError; + readAsArrayBuffer(blob: Blob): void; + readAsBinaryString(blob: Blob): void; + readAsDataURL(blob: Blob): void; + readAsText(blob: Blob, encoding?: string): void; + addEventListener(type: K, listener: (this: FileReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var FileReader: { + prototype: FileReader; + new(): FileReader; +} + +interface Headers { + append(name: string, value: string): void; + delete(name: string): void; + forEach(callback: ForEachCallback): void; + get(name: string): string | null; + has(name: string): boolean; + set(name: string, value: string): void; +} + +declare var Headers: { + prototype: Headers; + new(init?: any): Headers; +} + +interface IDBCursor { + readonly direction: IDBCursorDirection; + key: IDBKeyRange | IDBValidKey; + readonly primaryKey: any; + source: IDBObjectStore | IDBIndex; + advance(count: number): void; + continue(key?: IDBKeyRange | IDBValidKey): void; + delete(): IDBRequest; + update(value: any): IDBRequest; + readonly NEXT: string; + readonly NEXT_NO_DUPLICATE: string; + readonly PREV: string; + readonly PREV_NO_DUPLICATE: string; +} + +declare var IDBCursor: { + prototype: IDBCursor; + new(): IDBCursor; + readonly NEXT: string; + readonly NEXT_NO_DUPLICATE: string; + readonly PREV: string; + readonly PREV_NO_DUPLICATE: string; +} + +interface IDBCursorWithValue extends IDBCursor { + readonly value: any; +} + +declare var IDBCursorWithValue: { + prototype: IDBCursorWithValue; + new(): IDBCursorWithValue; +} + +interface IDBDatabaseEventMap { + "abort": Event; + "error": Event; +} + +interface IDBDatabase extends EventTarget { + readonly name: string; + readonly objectStoreNames: DOMStringList; + onabort: (this: IDBDatabase, ev: Event) => any; + onerror: (this: IDBDatabase, ev: Event) => any; + version: number; + onversionchange: (ev: IDBVersionChangeEvent) => any; + close(): void; + createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore; + deleteObjectStore(name: string): void; + transaction(storeNames: string | string[], mode?: string): IDBTransaction; + addEventListener(type: "versionchange", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBDatabase: { + prototype: IDBDatabase; + new(): IDBDatabase; +} + +interface IDBFactory { + cmp(first: any, second: any): number; + deleteDatabase(name: string): IDBOpenDBRequest; + open(name: string, version?: number): IDBOpenDBRequest; +} + +declare var IDBFactory: { + prototype: IDBFactory; + new(): IDBFactory; +} + +interface IDBIndex { + keyPath: string | string[]; + readonly name: string; + readonly objectStore: IDBObjectStore; + readonly unique: boolean; + multiEntry: boolean; + count(key?: IDBKeyRange | IDBValidKey): IDBRequest; + get(key: IDBKeyRange | IDBValidKey): IDBRequest; + getKey(key: IDBKeyRange | IDBValidKey): IDBRequest; + openCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; + openKeyCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; +} + +declare var IDBIndex: { + prototype: IDBIndex; + new(): IDBIndex; +} + +interface IDBKeyRange { + readonly lower: any; + readonly lowerOpen: boolean; + readonly upper: any; + readonly upperOpen: boolean; +} + +declare var IDBKeyRange: { + prototype: IDBKeyRange; + new(): IDBKeyRange; + bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; + lowerBound(lower: any, open?: boolean): IDBKeyRange; + only(value: any): IDBKeyRange; + upperBound(upper: any, open?: boolean): IDBKeyRange; +} + +interface IDBObjectStore { + readonly indexNames: DOMStringList; + keyPath: string | string[]; + readonly name: string; + readonly transaction: IDBTransaction; + autoIncrement: boolean; + add(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest; + clear(): IDBRequest; + count(key?: IDBKeyRange | IDBValidKey): IDBRequest; + createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex; + delete(key: IDBKeyRange | IDBValidKey): IDBRequest; + deleteIndex(indexName: string): void; + get(key: any): IDBRequest; + index(name: string): IDBIndex; + openCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest; + put(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest; +} + +declare var IDBObjectStore: { + prototype: IDBObjectStore; + new(): IDBObjectStore; +} + +interface IDBOpenDBRequestEventMap extends IDBRequestEventMap { + "blocked": Event; + "upgradeneeded": IDBVersionChangeEvent; +} + +interface IDBOpenDBRequest extends IDBRequest { + onblocked: (this: IDBOpenDBRequest, ev: Event) => any; + onupgradeneeded: (this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any; + addEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBOpenDBRequest: { + prototype: IDBOpenDBRequest; + new(): IDBOpenDBRequest; +} + +interface IDBRequestEventMap { + "error": Event; + "success": Event; +} + +interface IDBRequest extends EventTarget { + readonly error: DOMError; + onerror: (this: IDBRequest, ev: Event) => any; + onsuccess: (this: IDBRequest, ev: Event) => any; + readonly readyState: IDBRequestReadyState; + readonly result: any; + source: IDBObjectStore | IDBIndex | IDBCursor; + readonly transaction: IDBTransaction; + addEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBRequest: { + prototype: IDBRequest; + new(): IDBRequest; +} + +interface IDBTransactionEventMap { + "abort": Event; + "complete": Event; + "error": Event; +} + +interface IDBTransaction extends EventTarget { + readonly db: IDBDatabase; + readonly error: DOMError; + readonly mode: IDBTransactionMode; + onabort: (this: IDBTransaction, ev: Event) => any; + oncomplete: (this: IDBTransaction, ev: Event) => any; + onerror: (this: IDBTransaction, ev: Event) => any; + abort(): void; + objectStore(name: string): IDBObjectStore; + readonly READ_ONLY: string; + readonly READ_WRITE: string; + readonly VERSION_CHANGE: string; + addEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBTransaction: { + prototype: IDBTransaction; + new(): IDBTransaction; + readonly READ_ONLY: string; + readonly READ_WRITE: string; + readonly VERSION_CHANGE: string; +} + +interface IDBVersionChangeEvent extends Event { + readonly newVersion: number | null; + readonly oldVersion: number; +} + +declare var IDBVersionChangeEvent: { + prototype: IDBVersionChangeEvent; + new(): IDBVersionChangeEvent; +} + +interface ImageData { + data: Uint8ClampedArray; + readonly height: number; + readonly width: number; +} + +declare var ImageData: { + prototype: ImageData; + new(width: number, height: number): ImageData; + new(array: Uint8ClampedArray, width: number, height: number): ImageData; +} + +interface MessageChannel { + readonly port1: MessagePort; + readonly port2: MessagePort; +} + +declare var MessageChannel: { + prototype: MessageChannel; + new(): MessageChannel; +} + +interface MessageEvent extends Event { + readonly data: any; + readonly origin: string; + readonly ports: any; + readonly source: any; + initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: any): void; +} + +declare var MessageEvent: { + prototype: MessageEvent; + new(type: string, eventInitDict?: MessageEventInit): MessageEvent; +} + +interface MessagePortEventMap { + "message": MessageEvent; +} + +interface MessagePort extends EventTarget { + onmessage: (this: MessagePort, ev: MessageEvent) => any; + close(): void; + postMessage(message?: any, transfer?: any[]): void; + start(): void; + addEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MessagePort: { + prototype: MessagePort; + new(): MessagePort; +} + +interface NotificationEventMap { + "click": Event; + "close": Event; + "error": Event; + "show": Event; +} + +interface Notification extends EventTarget { + readonly body: string; + readonly dir: NotificationDirection; + readonly icon: string; + readonly lang: string; + onclick: (this: Notification, ev: Event) => any; + onclose: (this: Notification, ev: Event) => any; + onerror: (this: Notification, ev: Event) => any; + onshow: (this: Notification, ev: Event) => any; + readonly permission: NotificationPermission; + readonly tag: string; + readonly title: string; + close(): void; + addEventListener(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Notification: { + prototype: Notification; + new(title: string, options?: NotificationOptions): Notification; + requestPermission(callback?: NotificationPermissionCallback): Promise; +} + +interface Performance { + readonly navigation: PerformanceNavigation; + readonly timing: PerformanceTiming; + clearMarks(markName?: string): void; + clearMeasures(measureName?: string): void; + clearResourceTimings(): void; + getEntries(): any; + getEntriesByName(name: string, entryType?: string): any; + getEntriesByType(entryType: string): any; + getMarks(markName?: string): any; + getMeasures(measureName?: string): any; + mark(markName: string): void; + measure(measureName: string, startMarkName?: string, endMarkName?: string): void; + now(): number; + setResourceTimingBufferSize(maxSize: number): void; + toJSON(): any; +} + +declare var Performance: { + prototype: Performance; + new(): Performance; +} + +interface PerformanceNavigation { + readonly redirectCount: number; + readonly type: number; + toJSON(): any; + readonly TYPE_BACK_FORWARD: number; + readonly TYPE_NAVIGATE: number; + readonly TYPE_RELOAD: number; + readonly TYPE_RESERVED: number; +} + +declare var PerformanceNavigation: { + prototype: PerformanceNavigation; + new(): PerformanceNavigation; + readonly TYPE_BACK_FORWARD: number; + readonly TYPE_NAVIGATE: number; + readonly TYPE_RELOAD: number; + readonly TYPE_RESERVED: number; +} + +interface PerformanceTiming { + readonly connectEnd: number; + readonly connectStart: number; + readonly domComplete: number; + readonly domContentLoadedEventEnd: number; + readonly domContentLoadedEventStart: number; + readonly domInteractive: number; + readonly domLoading: number; + readonly domainLookupEnd: number; + readonly domainLookupStart: number; + readonly fetchStart: number; + readonly loadEventEnd: number; + readonly loadEventStart: number; + readonly msFirstPaint: number; + readonly navigationStart: number; + readonly redirectEnd: number; + readonly redirectStart: number; + readonly requestStart: number; + readonly responseEnd: number; + readonly responseStart: number; + readonly unloadEventEnd: number; + readonly unloadEventStart: number; + readonly secureConnectionStart: number; + toJSON(): any; +} + +declare var PerformanceTiming: { + prototype: PerformanceTiming; + new(): PerformanceTiming; +} + +interface Position { + readonly coords: Coordinates; + readonly timestamp: number; +} + +declare var Position: { + prototype: Position; + new(): Position; +} + +interface PositionError { + readonly code: number; + readonly message: string; + toString(): string; + readonly PERMISSION_DENIED: number; + readonly POSITION_UNAVAILABLE: number; + readonly TIMEOUT: number; +} + +declare var PositionError: { + prototype: PositionError; + new(): PositionError; + readonly PERMISSION_DENIED: number; + readonly POSITION_UNAVAILABLE: number; + readonly TIMEOUT: number; +} + +interface ProgressEvent extends Event { + readonly lengthComputable: boolean; + readonly loaded: number; + readonly total: number; + initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; +} + +declare var ProgressEvent: { + prototype: ProgressEvent; + new(type: string, eventInitDict?: ProgressEventInit): ProgressEvent; +} + +interface PushManager { + getSubscription(): Promise; + permissionState(options?: PushSubscriptionOptionsInit): Promise; + subscribe(options?: PushSubscriptionOptionsInit): Promise; +} + +declare var PushManager: { + prototype: PushManager; + new(): PushManager; +} + +interface PushSubscription { + readonly endpoint: USVString; + readonly options: PushSubscriptionOptions; + getKey(name: PushEncryptionKeyName): ArrayBuffer | null; + toJSON(): any; + unsubscribe(): Promise; +} + +declare var PushSubscription: { + prototype: PushSubscription; + new(): PushSubscription; +} + +interface PushSubscriptionOptions { + readonly applicationServerKey: ArrayBuffer | null; + readonly userVisibleOnly: boolean; +} + +declare var PushSubscriptionOptions: { + prototype: PushSubscriptionOptions; + new(): PushSubscriptionOptions; +} + +interface ReadableStream { + readonly locked: boolean; + cancel(): Promise; + getReader(): ReadableStreamReader; +} + +declare var ReadableStream: { + prototype: ReadableStream; + new(): ReadableStream; +} + +interface ReadableStreamReader { + cancel(): Promise; + read(): Promise; + releaseLock(): void; +} + +declare var ReadableStreamReader: { + prototype: ReadableStreamReader; + new(): ReadableStreamReader; +} + +interface Request extends Object, Body { + readonly cache: RequestCache; + readonly credentials: RequestCredentials; + readonly destination: RequestDestination; + readonly headers: Headers; + readonly integrity: string; + readonly keepalive: boolean; + readonly method: string; + readonly mode: RequestMode; + readonly redirect: RequestRedirect; + readonly referrer: string; + readonly referrerPolicy: ReferrerPolicy; + readonly type: RequestType; + readonly url: string; + clone(): Request; +} + +declare var Request: { + prototype: Request; + new(input: Request | string, init?: RequestInit): Request; +} + +interface Response extends Object, Body { + readonly body: ReadableStream | null; + readonly headers: Headers; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly type: ResponseType; + readonly url: string; + clone(): Response; +} + +declare var Response: { + prototype: Response; + new(body?: any, init?: ResponseInit): Response; +} + +interface ServiceWorkerEventMap extends AbstractWorkerEventMap { + "statechange": Event; +} + +interface ServiceWorker extends EventTarget, AbstractWorker { + onstatechange: (this: ServiceWorker, ev: Event) => any; + readonly scriptURL: USVString; + readonly state: ServiceWorkerState; + postMessage(message: any, transfer?: any[]): void; + addEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ServiceWorker: { + prototype: ServiceWorker; + new(): ServiceWorker; +} + +interface ServiceWorkerRegistrationEventMap { + "updatefound": Event; +} + +interface ServiceWorkerRegistration extends EventTarget { + readonly active: ServiceWorker | null; + readonly installing: ServiceWorker | null; + onupdatefound: (this: ServiceWorkerRegistration, ev: Event) => any; + readonly pushManager: PushManager; + readonly scope: USVString; + readonly sync: SyncManager; + readonly waiting: ServiceWorker | null; + getNotifications(filter?: GetNotificationOptions): any; + showNotification(title: string, options?: NotificationOptions): Promise; + unregister(): Promise; + update(): Promise; + addEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ServiceWorkerRegistration: { + prototype: ServiceWorkerRegistration; + new(): ServiceWorkerRegistration; +} + +interface SyncManager { + getTags(): any; + register(tag: string): Promise; +} + +declare var SyncManager: { + prototype: SyncManager; + new(): SyncManager; +} + +interface URL { + hash: string; + host: string; + hostname: string; + href: string; + readonly origin: string; + password: string; + pathname: string; + port: string; + protocol: string; + search: string; + username: string; + readonly searchParams: URLSearchParams; + toString(): string; +} + +declare var URL: { + prototype: URL; + new(url: string, base?: string): URL; + createObjectURL(object: any, options?: ObjectURLOptions): string; + revokeObjectURL(url: string): void; +} + +interface WebSocketEventMap { + "close": CloseEvent; + "error": Event; + "message": MessageEvent; + "open": Event; +} + +interface WebSocket extends EventTarget { + binaryType: string; + readonly bufferedAmount: number; + readonly extensions: string; + onclose: (this: WebSocket, ev: CloseEvent) => any; + onerror: (this: WebSocket, ev: Event) => any; + onmessage: (this: WebSocket, ev: MessageEvent) => any; + onopen: (this: WebSocket, ev: Event) => any; + readonly protocol: string; + readonly readyState: number; + readonly url: string; + close(code?: number, reason?: string): void; + send(data: any): void; + readonly CLOSED: number; + readonly CLOSING: number; + readonly CONNECTING: number; + readonly OPEN: number; + addEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var WebSocket: { + prototype: WebSocket; + new(url: string, protocols?: string | string[]): WebSocket; + readonly CLOSED: number; + readonly CLOSING: number; + readonly CONNECTING: number; + readonly OPEN: number; +} + +interface WorkerEventMap extends AbstractWorkerEventMap { + "message": MessageEvent; +} + +interface Worker extends EventTarget, AbstractWorker { + onmessage: (this: Worker, ev: MessageEvent) => any; + postMessage(message: any, transfer?: any[]): void; + terminate(): void; + addEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Worker: { + prototype: Worker; + new(stringUrl: string): Worker; +} + +interface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap { + "readystatechange": Event; +} + +interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { + onreadystatechange: (this: XMLHttpRequest, ev: Event) => any; + readonly readyState: number; + readonly response: any; + readonly responseText: string; + responseType: XMLHttpRequestResponseType; + readonly responseURL: string; + readonly responseXML: any; + readonly status: number; + readonly statusText: string; + timeout: number; + readonly upload: XMLHttpRequestUpload; + withCredentials: boolean; + msCaching?: string; + abort(): void; + getAllResponseHeaders(): string; + getResponseHeader(header: string): string | null; + msCachingEnabled(): boolean; + open(method: string, url: string, async?: boolean, user?: string, password?: string): void; + overrideMimeType(mime: string): void; + send(data?: string): void; + send(data?: any): void; + setRequestHeader(header: string, value: string): void; + readonly DONE: number; + readonly HEADERS_RECEIVED: number; + readonly LOADING: number; + readonly OPENED: number; + readonly UNSENT: number; + addEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var XMLHttpRequest: { + prototype: XMLHttpRequest; + new(): XMLHttpRequest; + readonly DONE: number; + readonly HEADERS_RECEIVED: number; + readonly LOADING: number; + readonly OPENED: number; + readonly UNSENT: number; +} + +interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget { + addEventListener(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var XMLHttpRequestUpload: { + prototype: XMLHttpRequestUpload; + new(): XMLHttpRequestUpload; +} + +interface AbstractWorkerEventMap { + "error": ErrorEvent; +} + +interface AbstractWorker { + onerror: (this: AbstractWorker, ev: ErrorEvent) => any; + addEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface Body { + readonly bodyUsed: boolean; + arrayBuffer(): Promise; + blob(): Promise; + json(): Promise; + text(): Promise; +} + +interface GlobalFetch { + fetch(input: RequestInfo, init?: RequestInit): Promise; +} + +interface MSBaseReaderEventMap { + "abort": Event; + "error": ErrorEvent; + "load": Event; + "loadend": ProgressEvent; + "loadstart": Event; + "progress": ProgressEvent; +} + +interface MSBaseReader { + onabort: (this: MSBaseReader, ev: Event) => any; + onerror: (this: MSBaseReader, ev: ErrorEvent) => any; + onload: (this: MSBaseReader, ev: Event) => any; + onloadend: (this: MSBaseReader, ev: ProgressEvent) => any; + onloadstart: (this: MSBaseReader, ev: Event) => any; + onprogress: (this: MSBaseReader, ev: ProgressEvent) => any; + readonly readyState: number; + readonly result: any; + abort(): void; + readonly DONE: number; + readonly EMPTY: number; + readonly LOADING: number; + addEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface NavigatorBeacon { + sendBeacon(url: USVString, data?: BodyInit): boolean; +} + +interface NavigatorConcurrentHardware { + readonly hardwareConcurrency: number; +} + +interface NavigatorID { + readonly appCodeName: string; + readonly appName: string; + readonly appVersion: string; + readonly platform: string; + readonly product: string; + readonly productSub: string; + readonly userAgent: string; + readonly vendor: string; + readonly vendorSub: string; +} + +interface NavigatorOnLine { + readonly onLine: boolean; +} + +interface WindowBase64 { + atob(encodedString: string): string; + btoa(rawString: string): string; +} + +interface WindowConsole { + readonly console: Console; +} + +interface XMLHttpRequestEventTargetEventMap { + "abort": Event; + "error": ErrorEvent; + "load": Event; + "loadend": ProgressEvent; + "loadstart": Event; + "progress": ProgressEvent; + "timeout": ProgressEvent; +} + +interface XMLHttpRequestEventTarget { + onabort: (this: XMLHttpRequestEventTarget, ev: Event) => any; + onerror: (this: XMLHttpRequestEventTarget, ev: ErrorEvent) => any; + onload: (this: XMLHttpRequestEventTarget, ev: Event) => any; + onloadend: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; + onloadstart: (this: XMLHttpRequestEventTarget, ev: Event) => any; + onprogress: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; + ontimeout: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; + addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface Client { + readonly frameType: FrameType; + readonly id: string; + readonly url: USVString; + postMessage(message: any, transfer?: any[]): void; +} + +declare var Client: { + prototype: Client; + new(): Client; +} + +interface Clients { + claim(): Promise; + get(id: string): Promise; + matchAll(options?: ClientQueryOptions): any; + openWindow(url: USVString): Promise; +} + +declare var Clients: { + prototype: Clients; + new(): Clients; +} + +interface DedicatedWorkerGlobalScopeEventMap extends WorkerGlobalScopeEventMap { + "message": MessageEvent; +} + +interface DedicatedWorkerGlobalScope extends WorkerGlobalScope { + onmessage: (this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any; + close(): void; + postMessage(message: any, transfer?: any[]): void; + addEventListener(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var DedicatedWorkerGlobalScope: { + prototype: DedicatedWorkerGlobalScope; + new(): DedicatedWorkerGlobalScope; +} + +interface ExtendableEvent extends Event { + waitUntil(f: Promise): void; +} + +declare var ExtendableEvent: { + prototype: ExtendableEvent; + new(type: string, eventInitDict?: ExtendableEventInit): ExtendableEvent; +} + +interface ExtendableMessageEvent extends ExtendableEvent { + readonly data: any; + readonly lastEventId: string; + readonly origin: string; + readonly ports: MessagePort[] | null; + readonly source: Client | ServiceWorker | MessagePort | null; +} + +declare var ExtendableMessageEvent: { + prototype: ExtendableMessageEvent; + new(type: string, eventInitDict?: ExtendableMessageEventInit): ExtendableMessageEvent; +} + +interface FetchEvent extends ExtendableEvent { + readonly clientId: string | null; + readonly isReload: boolean; + readonly request: Request; + respondWith(r: Promise): void; +} + +declare var FetchEvent: { + prototype: FetchEvent; + new(type: string, eventInitDict: FetchEventInit): FetchEvent; +} + +interface FileReaderSync { + readAsArrayBuffer(blob: Blob): any; + readAsBinaryString(blob: Blob): void; + readAsDataURL(blob: Blob): string; + readAsText(blob: Blob, encoding?: string): string; +} + +declare var FileReaderSync: { + prototype: FileReaderSync; + new(): FileReaderSync; +} + +interface NotificationEvent extends ExtendableEvent { + readonly action: string; + readonly notification: Notification; +} + +declare var NotificationEvent: { + prototype: NotificationEvent; + new(type: string, eventInitDict: NotificationEventInit): NotificationEvent; +} + +interface PushEvent extends ExtendableEvent { + readonly data: PushMessageData | null; +} + +declare var PushEvent: { + prototype: PushEvent; + new(type: string, eventInitDict?: PushEventInit): PushEvent; +} + +interface PushMessageData { + arrayBuffer(): ArrayBuffer; + blob(): Blob; + json(): JSON; + text(): USVString; +} + +declare var PushMessageData: { + prototype: PushMessageData; + new(): PushMessageData; +} + +interface ServiceWorkerGlobalScopeEventMap extends WorkerGlobalScopeEventMap { + "activate": ExtendableEvent; + "fetch": FetchEvent; + "install": ExtendableEvent; + "message": ExtendableMessageEvent; + "notificationclick": NotificationEvent; + "notificationclose": NotificationEvent; + "push": PushEvent; + "pushsubscriptionchange": ExtendableEvent; + "sync": SyncEvent; +} + +interface ServiceWorkerGlobalScope extends WorkerGlobalScope { + readonly clients: Clients; + onactivate: (this: ServiceWorkerGlobalScope, ev: ExtendableEvent) => any; + onfetch: (this: ServiceWorkerGlobalScope, ev: FetchEvent) => any; + oninstall: (this: ServiceWorkerGlobalScope, ev: ExtendableEvent) => any; + onmessage: (this: ServiceWorkerGlobalScope, ev: ExtendableMessageEvent) => any; + onnotificationclick: (this: ServiceWorkerGlobalScope, ev: NotificationEvent) => any; + onnotificationclose: (this: ServiceWorkerGlobalScope, ev: NotificationEvent) => any; + onpush: (this: ServiceWorkerGlobalScope, ev: PushEvent) => any; + onpushsubscriptionchange: (this: ServiceWorkerGlobalScope, ev: ExtendableEvent) => any; + onsync: (this: ServiceWorkerGlobalScope, ev: SyncEvent) => any; + readonly registration: ServiceWorkerRegistration; + skipWaiting(): Promise; + addEventListener(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ServiceWorkerGlobalScope: { + prototype: ServiceWorkerGlobalScope; + new(): ServiceWorkerGlobalScope; +} + +interface SyncEvent extends ExtendableEvent { + readonly lastChance: boolean; + readonly tag: string; +} + +declare var SyncEvent: { + prototype: SyncEvent; + new(type: string, init: SyncEventInit): SyncEvent; +} + +interface WindowClient extends Client { + readonly focused: boolean; + readonly visibilityState: VisibilityState; + focus(): Promise; + navigate(url: USVString): Promise; +} + +declare var WindowClient: { + prototype: WindowClient; + new(): WindowClient; +} + +interface WorkerGlobalScopeEventMap { + "error": ErrorEvent; +} + +interface WorkerGlobalScope extends EventTarget, WorkerUtils, WindowConsole, GlobalFetch { + readonly caches: CacheStorage; + readonly isSecureContext: boolean; + readonly location: WorkerLocation; + onerror: (this: WorkerGlobalScope, ev: ErrorEvent) => any; + readonly performance: Performance; + readonly self: WorkerGlobalScope; + msWriteProfilerMark(profilerMarkName: string): void; + createImageBitmap(image: ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise; + createImageBitmap(image: ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise; + addEventListener(type: K, listener: (this: WorkerGlobalScope, ev: WorkerGlobalScopeEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var WorkerGlobalScope: { + prototype: WorkerGlobalScope; + new(): WorkerGlobalScope; +} + +interface WorkerLocation { + readonly hash: string; + readonly host: string; + readonly hostname: string; + readonly href: string; + readonly origin: string; + readonly pathname: string; + readonly port: string; + readonly protocol: string; + readonly search: string; + toString(): string; +} + +declare var WorkerLocation: { + prototype: WorkerLocation; + new(): WorkerLocation; +} + +interface WorkerNavigator extends Object, NavigatorID, NavigatorOnLine, NavigatorBeacon, NavigatorConcurrentHardware { + readonly hardwareConcurrency: number; +} + +declare var WorkerNavigator: { + prototype: WorkerNavigator; + new(): WorkerNavigator; +} + +interface WorkerUtils extends Object, WindowBase64 { + readonly indexedDB: IDBFactory; + readonly msIndexedDB: IDBFactory; + readonly navigator: WorkerNavigator; + clearImmediate(handle: number): void; + clearInterval(handle: number): void; + clearTimeout(handle: number): void; + importScripts(...urls: string[]): void; + setImmediate(handler: (...args: any[]) => void): number; + setImmediate(handler: any, ...args: any[]): number; + setInterval(handler: (...args: any[]) => void, timeout: number): number; + setInterval(handler: any, timeout?: any, ...args: any[]): number; + setTimeout(handler: (...args: any[]) => void, timeout: number): number; + setTimeout(handler: any, timeout?: any, ...args: any[]): number; +} + +interface ErrorEventInit { + message?: string; + filename?: string; + lineno?: number; + conlno?: number; + error?: any; +} + +interface ImageBitmapOptions { + imageOrientation?: "none" | "flipY"; + premultiplyAlpha?: "none" | "premultiply" | "default"; + colorSpaceConversion?: "none" | "default"; + resizeWidth?: number; + resizeHeight?: number; + resizeQuality?: "pixelated" | "low" | "medium" | "high"; +} + +interface ImageBitmap { + readonly width: number; + readonly height: number; + close(): void; +} + +interface URLSearchParams { + /** + * Appends a specified key/value pair as a new search parameter. + */ + append(name: string, value: string): void; + /** + * Deletes the given search parameter, and its associated value, from the list of all search parameters. + */ + delete(name: string): void; + /** + * Returns the first value associated to the given search parameter. + */ + get(name: string): string | null; + /** + * Returns all the values association with a given search parameter. + */ + getAll(name: string): string[]; + /** + * Returns a Boolean indicating if such a search parameter exists. + */ + has(name: string): boolean; + /** + * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others. + */ + set(name: string, value: string): void; +} + +declare var URLSearchParams: { + prototype: URLSearchParams; + /** + * Constructor returning a URLSearchParams object. + */ + new (init?: string | URLSearchParams): URLSearchParams; +} + +interface BlobPropertyBag { + type?: string; + endings?: string; +} + +interface FilePropertyBag { + type?: string; + lastModified?: number; +} + +interface EventListenerObject { + handleEvent(evt: Event): void; +} + +interface ProgressEventInit extends EventInit { + lengthComputable?: boolean; + loaded?: number; + total?: number; +} + +interface IDBArrayKey extends Array { +} + +interface RsaKeyGenParams extends Algorithm { + modulusLength: number; + publicExponent: Uint8Array; +} + +interface RsaHashedKeyGenParams extends RsaKeyGenParams { + hash: AlgorithmIdentifier; +} + +interface RsaKeyAlgorithm extends KeyAlgorithm { + modulusLength: number; + publicExponent: Uint8Array; +} + +interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { + hash: AlgorithmIdentifier; +} + +interface RsaHashedImportParams { + hash: AlgorithmIdentifier; +} + +interface RsaPssParams { + saltLength: number; +} + +interface RsaOaepParams extends Algorithm { + label?: BufferSource; +} + +interface EcdsaParams extends Algorithm { + hash: AlgorithmIdentifier; +} + +interface EcKeyGenParams extends Algorithm { + namedCurve: string; +} + +interface EcKeyAlgorithm extends KeyAlgorithm { + typedCurve: string; +} + +interface EcKeyImportParams { + namedCurve: string; +} + +interface EcdhKeyDeriveParams extends Algorithm { + public: CryptoKey; +} + +interface AesCtrParams extends Algorithm { + counter: BufferSource; + length: number; +} + +interface AesKeyAlgorithm extends KeyAlgorithm { + length: number; +} + +interface AesKeyGenParams extends Algorithm { + length: number; +} + +interface AesDerivedKeyParams extends Algorithm { + length: number; +} + +interface AesCbcParams extends Algorithm { + iv: BufferSource; +} + +interface AesCmacParams extends Algorithm { + length: number; +} + +interface AesGcmParams extends Algorithm { + iv: BufferSource; + additionalData?: BufferSource; + tagLength?: number; +} + +interface AesCfbParams extends Algorithm { + iv: BufferSource; +} + +interface HmacImportParams extends Algorithm { + hash?: AlgorithmIdentifier; + length?: number; +} + +interface HmacKeyAlgorithm extends KeyAlgorithm { + hash: AlgorithmIdentifier; + length: number; +} + +interface HmacKeyGenParams extends Algorithm { + hash: AlgorithmIdentifier; + length?: number; +} + +interface DhKeyGenParams extends Algorithm { + prime: Uint8Array; + generator: Uint8Array; +} + +interface DhKeyAlgorithm extends KeyAlgorithm { + prime: Uint8Array; + generator: Uint8Array; +} + +interface DhKeyDeriveParams extends Algorithm { + public: CryptoKey; +} + +interface DhImportKeyParams extends Algorithm { + prime: Uint8Array; + generator: Uint8Array; +} + +interface ConcatParams extends Algorithm { + hash?: AlgorithmIdentifier; + algorithmId: Uint8Array; + partyUInfo: Uint8Array; + partyVInfo: Uint8Array; + publicInfo?: Uint8Array; + privateInfo?: Uint8Array; +} + +interface HkdfCtrParams extends Algorithm { + hash: AlgorithmIdentifier; + label: BufferSource; + context: BufferSource; +} + +interface Pbkdf2Params extends Algorithm { + salt: BufferSource; + iterations: number; + hash: AlgorithmIdentifier; +} + +interface RsaOtherPrimesInfo { + r: string; + d: string; + t: string; +} + +interface JsonWebKey { + kty: string; + use?: string; + key_ops?: string[]; + alg?: string; + kid?: string; + x5u?: string; + x5c?: string; + x5t?: string; + ext?: boolean; + crv?: string; + x?: string; + y?: string; + d?: string; + n?: string; + e?: string; + p?: string; + q?: string; + dp?: string; + dq?: string; + qi?: string; + oth?: RsaOtherPrimesInfo[]; + k?: string; +} + +interface EventListenerOptions { + capture?: boolean; +} + +interface AddEventListenerOptions extends EventListenerOptions { + passive?: boolean; + once?: boolean; +} + +declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; + +interface ErrorEventHandler { + (message: string, filename?: string, lineno?: number, colno?: number, error?:Error): void; +} +interface PositionCallback { + (position: Position): void; +} +interface PositionErrorCallback { + (error: PositionError): void; +} +interface DecodeSuccessCallback { + (decodedData: AudioBuffer): void; +} +interface DecodeErrorCallback { + (error: DOMException): void; +} +interface FunctionStringCallback { + (data: string): void; +} +interface ForEachCallback { + (keyId: any, status: MediaKeyStatus): void; +} +interface NotificationPermissionCallback { + (permission: NotificationPermission): void; +} +declare var onmessage: (this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any; +declare function close(): void; +declare function postMessage(message: any, transfer?: any[]): void; +declare var caches: CacheStorage; +declare var isSecureContext: boolean; +declare var location: WorkerLocation; +declare var onerror: (this: DedicatedWorkerGlobalScope, ev: ErrorEvent) => any; +declare var performance: Performance; +declare var self: WorkerGlobalScope; +declare function msWriteProfilerMark(profilerMarkName: string): void; +declare function createImageBitmap(image: ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise; +declare function createImageBitmap(image: ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise; +declare function dispatchEvent(evt: Event): boolean; +declare function removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +declare var indexedDB: IDBFactory; +declare var msIndexedDB: IDBFactory; +declare var navigator: WorkerNavigator; +declare function clearImmediate(handle: number): void; +declare function clearInterval(handle: number): void; +declare function clearTimeout(handle: number): void; +declare function importScripts(...urls: string[]): void; +declare function setImmediate(handler: (...args: any[]) => void): number; +declare function setImmediate(handler: any, ...args: any[]): number; +declare function setInterval(handler: (...args: any[]) => void, timeout: number): number; +declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; +declare function setTimeout(handler: (...args: any[]) => void, timeout: number): number; +declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; +declare function atob(encodedString: string): string; +declare function btoa(rawString: string): string; +declare var console: Console; +declare function fetch(input: RequestInfo, init?: RequestInit): Promise; +declare function dispatchEvent(evt: Event): boolean; +declare function removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +declare function addEventListener(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, useCapture?: boolean): void; +declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +type AlgorithmIdentifier = string | Algorithm; +type BodyInit = any; +type IDBKeyPath = string; +type RequestInfo = Request | string; +type USVString = string; +type IDBValidKey = number | string | Date | IDBArrayKey; +type BufferSource = ArrayBuffer | ArrayBufferView; +type FormDataEntryValue = string | File; +type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique"; +type IDBRequestReadyState = "pending" | "done"; +type IDBTransactionMode = "readonly" | "readwrite" | "versionchange"; +type MediaKeyStatus = "usable" | "expired" | "output-downscaled" | "output-not-allowed" | "status-pending" | "internal-error"; +type NotificationDirection = "auto" | "ltr" | "rtl"; +type NotificationPermission = "default" | "denied" | "granted"; +type PushEncryptionKeyName = "p256dh" | "auth"; +type PushPermissionState = "granted" | "denied" | "prompt"; +type ReferrerPolicy = "" | "no-referrer" | "no-referrer-when-downgrade" | "origin-only" | "origin-when-cross-origin" | "unsafe-url"; +type RequestCache = "default" | "no-store" | "reload" | "no-cache" | "force-cache"; +type RequestCredentials = "omit" | "same-origin" | "include"; +type RequestDestination = "" | "document" | "sharedworker" | "subresource" | "unknown" | "worker"; +type RequestMode = "navigate" | "same-origin" | "no-cors" | "cors"; +type RequestRedirect = "follow" | "error" | "manual"; +type RequestType = "" | "audio" | "font" | "image" | "script" | "style" | "track" | "video"; +type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect"; +type ServiceWorkerState = "installing" | "installed" | "activating" | "activated" | "redundant"; +type VisibilityState = "hidden" | "visible" | "prerender" | "unloaded"; +type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text"; +type ClientType = "window" | "worker" | "sharedworker" | "all"; +type FrameType = "auxiliary" | "top-level" | "nested" | "none"; \ No newline at end of file diff --git a/node_modules/typescript/lib/protocol.d.ts b/node_modules/typescript/lib/protocol.d.ts index c2577c247..0afebe0bc 100644 --- a/node_modules/typescript/lib/protocol.d.ts +++ b/node_modules/typescript/lib/protocol.d.ts @@ -1,6 +1,6 @@ /** - * Declaration module describing the TypeScript Server protocol - */ + * Declaration module describing the TypeScript Server protocol + */ declare namespace ts.server.protocol { namespace CommandTypes { type Brace = "brace"; @@ -49,82 +49,82 @@ declare namespace ts.server.protocol { type GetSupportedCodeFixes = "getSupportedCodeFixes"; } /** - * A TypeScript Server message - */ + * A TypeScript Server message + */ interface Message { /** - * Sequence number of the message - */ + * Sequence number of the message + */ seq: number; /** - * One of "request", "response", or "event" - */ + * One of "request", "response", or "event" + */ type: "request" | "response" | "event"; } /** - * Client-initiated request message - */ + * Client-initiated request message + */ interface Request extends Message { /** - * The command to execute - */ + * The command to execute + */ command: string; /** - * Object containing arguments for the command - */ + * Object containing arguments for the command + */ arguments?: any; } /** - * Request to reload the project structure for all the opened files - */ + * Request to reload the project structure for all the opened files + */ interface ReloadProjectsRequest extends Message { command: CommandTypes.ReloadProjects; } /** - * Server-initiated event message - */ + * Server-initiated event message + */ interface Event extends Message { /** - * Name of event - */ + * Name of event + */ event: string; /** - * Event-specific information - */ + * Event-specific information + */ body?: any; } /** - * Response by server to client request message. - */ + * Response by server to client request message. + */ interface Response extends Message { /** - * Sequence number of the request message. - */ + * Sequence number of the request message. + */ request_seq: number; /** - * Outcome of the request. - */ + * Outcome of the request. + */ success: boolean; /** - * The command requested. - */ + * The command requested. + */ command: string; /** - * Contains error message if success === false. - */ + * Contains error message if success === false. + */ message?: string; /** - * Contains message body if success === true. - */ + * Contains message body if success === true. + */ body?: any; } /** - * Arguments for FileRequest messages. - */ + * Arguments for FileRequest messages. + */ interface FileRequestArgs { /** - * The file for the request (absolute pathname required). - */ + * The file for the request (absolute pathname required). + */ file: string; projectFileName?: string; } @@ -199,17 +199,17 @@ declare namespace ts.server.protocol { options?: EditorSettings; } /** - * Arguments for ProjectInfoRequest request. - */ + * Arguments for ProjectInfoRequest request. + */ interface ProjectInfoRequestArgs extends FileRequestArgs { /** - * Indicate if the file name list of the project is needed - */ + * Indicate if the file name list of the project is needed + */ needFileNameList: boolean; } /** - * A request to get the project information of the current file. - */ + * A request to get the project information of the current file. + */ interface ProjectInfoRequest extends Request { command: CommandTypes.ProjectInfo; arguments: ProjectInfoRequestArgs; @@ -230,21 +230,21 @@ declare namespace ts.server.protocol { projectFileName: string; } /** - * Response message body for "projectInfo" request - */ + * Response message body for "projectInfo" request + */ interface ProjectInfo { /** - * For configured project, this is the normalized path of the 'tsconfig.json' file - * For inferred project, this is undefined - */ + * For configured project, this is the normalized path of the 'tsconfig.json' file + * For inferred project, this is undefined + */ configFileName: string; /** - * The list of normalized file name in the project, including 'lib.d.ts' - */ + * The list of normalized file name in the project, including 'lib.d.ts' + */ fileNames?: string[]; /** - * Indicates if the project has a active language service instance - */ + * Indicates if the project has a active language service instance + */ languageServiceDisabled?: boolean; } /** @@ -262,61 +262,61 @@ declare namespace ts.server.protocol { code: number; } /** - * Response message for "projectInfo" request - */ + * Response message for "projectInfo" request + */ interface ProjectInfoResponse extends Response { body?: ProjectInfo; } /** - * Request whose sole parameter is a file name. - */ + * Request whose sole parameter is a file name. + */ interface FileRequest extends Request { arguments: FileRequestArgs; } /** - * Instances of this interface specify a location in a source file: - * (file, line, character offset), where line and character offset are 1-based. - */ + * Instances of this interface specify a location in a source file: + * (file, line, character offset), where line and character offset are 1-based. + */ interface FileLocationRequestArgs extends FileRequestArgs { /** - * The line number for the request (1-based). - */ + * The line number for the request (1-based). + */ line: number; /** - * The character offset (on the line) for the request (1-based). - */ + * The character offset (on the line) for the request (1-based). + */ offset: number; } /** - * Request for the available codefixes at a specific position. - */ + * Request for the available codefixes at a specific position. + */ interface CodeFixRequest extends Request { command: CommandTypes.GetCodeFixes; arguments: CodeFixRequestArgs; } /** - * Instances of this interface specify errorcodes on a specific location in a sourcefile. - */ + * Instances of this interface specify errorcodes on a specific location in a sourcefile. + */ interface CodeFixRequestArgs extends FileRequestArgs { /** - * The line number for the request (1-based). - */ + * The line number for the request (1-based). + */ startLine: number; /** - * The character offset (on the line) for the request (1-based). - */ + * The character offset (on the line) for the request (1-based). + */ startOffset: number; /** - * The line number for the request (1-based). - */ + * The line number for the request (1-based). + */ endLine: number; /** - * The character offset (on the line) for the request (1-based). - */ + * The character offset (on the line) for the request (1-based). + */ endOffset: number; /** - * Errorcodes we want to get the fixes for. - */ + * Errorcodes we want to get the fixes for. + */ errorCodes?: number[]; } /** @@ -326,8 +326,8 @@ declare namespace ts.server.protocol { body?: CodeAction[]; } /** - * A request whose arguments specify a file location (file, line, col). - */ + * A request whose arguments specify a file location (file, line, col). + */ interface FileLocationRequest extends FileRequest { arguments: FileLocationRequestArgs; } @@ -360,9 +360,9 @@ declare namespace ts.server.protocol { length: number; } /** - * Arguments in document highlight request; include: filesToSearch, file, - * line, offset. - */ + * Arguments in document highlight request; include: filesToSearch, file, + * line, offset. + */ interface DocumentHighlightsRequestArgs extends FileLocationRequestArgs { /** * List of files to search for document highlights. @@ -370,73 +370,73 @@ declare namespace ts.server.protocol { filesToSearch: string[]; } /** - * Go to definition request; value of command field is - * "definition". Return response giving the file locations that - * define the symbol found in file at location line, col. - */ + * Go to definition request; value of command field is + * "definition". Return response giving the file locations that + * define the symbol found in file at location line, col. + */ interface DefinitionRequest extends FileLocationRequest { command: CommandTypes.Definition; } /** - * Go to type request; value of command field is - * "typeDefinition". Return response giving the file locations that - * define the type for the symbol found in file at location line, col. - */ + * Go to type request; value of command field is + * "typeDefinition". Return response giving the file locations that + * define the type for the symbol found in file at location line, col. + */ interface TypeDefinitionRequest extends FileLocationRequest { command: CommandTypes.TypeDefinition; } /** - * Go to implementation request; value of command field is - * "implementation". Return response giving the file locations that - * implement the symbol found in file at location line, col. - */ + * Go to implementation request; value of command field is + * "implementation". Return response giving the file locations that + * implement the symbol found in file at location line, col. + */ interface ImplementationRequest extends FileLocationRequest { command: CommandTypes.Implementation; } /** - * Location in source code expressed as (one-based) line and character offset. - */ + * Location in source code expressed as (one-based) line and character offset. + */ interface Location { line: number; offset: number; } /** - * Object found in response messages defining a span of text in source code. - */ + * Object found in response messages defining a span of text in source code. + */ interface TextSpan { /** - * First character of the definition. - */ + * First character of the definition. + */ start: Location; /** - * One character past last character of the definition. - */ + * One character past last character of the definition. + */ end: Location; } /** - * Object found in response messages defining a span of text in a specific source file. - */ + * Object found in response messages defining a span of text in a specific source file. + */ interface FileSpan extends TextSpan { /** - * File containing text span. - */ + * File containing text span. + */ file: string; } /** - * Definition response message. Gives text range for definition. - */ + * Definition response message. Gives text range for definition. + */ interface DefinitionResponse extends Response { body?: FileSpan[]; } /** - * Definition response message. Gives text range for definition. - */ + * Definition response message. Gives text range for definition. + */ interface TypeDefinitionResponse extends Response { body?: FileSpan[]; } /** - * Implementation response message. Gives text range for implementations. - */ + * Implementation response message. Gives text range for implementations. + */ interface ImplementationResponse extends Response { body?: FileSpan[]; } @@ -457,27 +457,31 @@ declare namespace ts.server.protocol { openingBrace: string; } /** - * Get occurrences request; value of command field is - * "occurrences". Return response giving spans that are relevant - * in the file at a given line and column. - */ + * Get occurrences request; value of command field is + * "occurrences". Return response giving spans that are relevant + * in the file at a given line and column. + */ interface OccurrencesRequest extends FileLocationRequest { command: CommandTypes.Occurrences; } interface OccurrencesResponseItem extends FileSpan { /** - * True if the occurrence is a write location, false otherwise. - */ + * True if the occurrence is a write location, false otherwise. + */ isWriteAccess: boolean; + /** + * True if the occurrence is in a string, undefined otherwise; + */ + isInString?: true; } interface OccurrencesResponse extends Response { body?: OccurrencesResponseItem[]; } /** - * Get document highlights request; value of command field is - * "documentHighlights". Return response giving spans that are relevant - * in the file at a given line and column. - */ + * Get document highlights request; value of command field is + * "documentHighlights". Return response giving spans that are relevant + * in the file at a given line and column. + */ interface DocumentHighlightsRequest extends FileLocationRequest { command: CommandTypes.DocumentHighlights; arguments: DocumentHighlightsRequestArgs; @@ -494,12 +498,12 @@ declare namespace ts.server.protocol { */ interface DocumentHighlightsItem { /** - * File containing highlight spans. - */ + * File containing highlight spans. + */ file: string; /** - * Spans to highlight in file. - */ + * Spans to highlight in file. + */ highlightSpans: HighlightSpan[]; } /** @@ -509,23 +513,23 @@ declare namespace ts.server.protocol { body?: DocumentHighlightsItem[]; } /** - * Find references request; value of command field is - * "references". Return response giving the file locations that - * reference the symbol found in file at location line, col. - */ + * Find references request; value of command field is + * "references". Return response giving the file locations that + * reference the symbol found in file at location line, col. + */ interface ReferencesRequest extends FileLocationRequest { command: CommandTypes.References; } interface ReferencesResponseItem extends FileSpan { /** Text of line containing the reference. Including this - * with the response avoids latency of editor loading files - * to show text of reference line (the server already has - * loaded the referencing files). - */ + * with the response avoids latency of editor loading files + * to show text of reference line (the server already has + * loaded the referencing files). + */ lineText: string; /** - * True if reference is a write location, false otherwise. - */ + * True if reference is a write location, false otherwise. + */ isWriteAccess: boolean; /** * True if reference is a definition, false otherwise. @@ -533,29 +537,29 @@ declare namespace ts.server.protocol { isDefinition: boolean; } /** - * The body of a "references" response message. - */ + * The body of a "references" response message. + */ interface ReferencesResponseBody { /** - * The file locations referencing the symbol. - */ + * The file locations referencing the symbol. + */ refs: ReferencesResponseItem[]; /** - * The name of the symbol. - */ + * The name of the symbol. + */ symbolName: string; /** - * The start character offset of the symbol (on the line provided by the references request). - */ + * The start character offset of the symbol (on the line provided by the references request). + */ symbolStartOffset: number; /** - * The full display name of the symbol. - */ + * The full display name of the symbol. + */ symbolDisplayString: string; } /** - * Response to "references" request. - */ + * Response to "references" request. + */ interface ReferencesResponse extends Response { body?: ReferencesResponseBody; } @@ -573,42 +577,42 @@ declare namespace ts.server.protocol { findInStrings?: boolean; } /** - * Rename request; value of command field is "rename". Return - * response giving the file locations that reference the symbol - * found in file at location line, col. Also return full display - * name of the symbol so that client can print it unambiguously. - */ + * Rename request; value of command field is "rename". Return + * response giving the file locations that reference the symbol + * found in file at location line, col. Also return full display + * name of the symbol so that client can print it unambiguously. + */ interface RenameRequest extends FileLocationRequest { command: CommandTypes.Rename; arguments: RenameRequestArgs; } /** - * Information about the item to be renamed. - */ + * Information about the item to be renamed. + */ interface RenameInfo { /** - * True if item can be renamed. - */ + * True if item can be renamed. + */ canRename: boolean; /** - * Error message if item can not be renamed. - */ + * Error message if item can not be renamed. + */ localizedErrorMessage?: string; /** - * Display name of the item to be renamed. - */ + * Display name of the item to be renamed. + */ displayName: string; /** - * Full display name of item to be renamed. - */ + * Full display name of item to be renamed. + */ fullDisplayName: string; /** - * The items's kind (such as 'className' or 'parameterName' or plain 'text'). - */ + * The items's kind (such as 'className' or 'parameterName' or plain 'text'). + */ kind: string; /** - * Optional modifiers for the kind (such as 'public'). - */ + * Optional modifiers for the kind (such as 'public'). + */ kindModifiers: string; } /** @@ -631,8 +635,8 @@ declare namespace ts.server.protocol { locs: SpanGroup[]; } /** - * Rename response message. - */ + * Rename response message. + */ interface RenameResponse extends Response { body?: RenameResponseBody; } @@ -640,7 +644,7 @@ declare namespace ts.server.protocol { * Represents a file in external project. * External project is project whose set of files, compilation options and open\close state * is maintained by the client (i.e. if all this data come from .csproj file in Visual Studio). - * External project will exist even if all files in it are closed and should be closed explicity. + * External project will exist even if all files in it are closed and should be closed explicitly. * If external project includes one or more tsconfig.json/jsconfig.json files then tsserver will * create configured project for every config file but will maintain a link that these projects were created * as a result of opening external project so they should be removed once external project is closed. @@ -711,42 +715,50 @@ declare namespace ts.server.protocol { * List of removed files */ removed: string[]; + /** + * List of updated files + */ + updated: string[]; } /** - * Information found in a configure request. - */ + * Information found in a configure request. + */ interface ConfigureRequestArguments { /** - * Information about the host, for example 'Emacs 24.4' or - * 'Sublime Text version 3075' - */ + * Information about the host, for example 'Emacs 24.4' or + * 'Sublime Text version 3075' + */ hostInfo?: string; /** - * If present, tab settings apply only to this file. - */ + * If present, tab settings apply only to this file. + */ file?: string; /** * The format options to use during formatting and other code editing features. */ formatOptions?: FormatCodeSettings; + /** + * The host's additional supported .js file extensions + */ + extraFileExtensions?: JsFileExtensionInfo[]; } /** - * Configure request; value of command field is "configure". Specifies - * host information, such as host type, tab size, and indent size. - */ + * Configure request; value of command field is "configure". Specifies + * host information, such as host type, tab size, and indent size. + */ interface ConfigureRequest extends Request { command: CommandTypes.Configure; arguments: ConfigureRequestArguments; } /** - * Response to "configure" request. This is just an acknowledgement, so - * no body field is required. - */ + * Response to "configure" request. This is just an acknowledgement, so + * no body field is required. + */ interface ConfigureResponse extends Response { } /** - * Information found in an "open" request. - */ + * Information found in an "open" request. + */ interface OpenRequestArgs extends FileRequestArgs { /** * Used when a version of the file content is known to be more up to date than the one on disk. @@ -761,13 +773,13 @@ declare namespace ts.server.protocol { } type ScriptKindName = "TS" | "JS" | "TSX" | "JSX"; /** - * Open request; value of command field is "open". Notify the - * server that the client has file open. The server will not - * monitor the filesystem for changes in this file and will assume - * that the client is updating the server (using the change and/or - * reload messages) when the file changes. Server does not currently - * send a response to an open request. - */ + * Open request; value of command field is "open". Notify the + * server that the client has file open. The server will not + * monitor the filesystem for changes in this file and will assume + * that the client is updating the server (using the change and/or + * reload messages) when the file changes. Server does not currently + * send a response to an open request. + */ interface OpenRequest extends Request { command: CommandTypes.Open; arguments: OpenRequestArgs; @@ -856,25 +868,25 @@ declare namespace ts.server.protocol { options: ExternalProjectCompilerOptions; } /** - * Response to SetCompilerOptionsForInferredProjectsResponse request. This is just an acknowledgement, so - * no body field is required. - */ + * Response to SetCompilerOptionsForInferredProjectsResponse request. This is just an acknowledgement, so + * no body field is required. + */ interface SetCompilerOptionsForInferredProjectsResponse extends Response { } /** - * Exit request; value of command field is "exit". Ask the server process - * to exit. - */ + * Exit request; value of command field is "exit". Ask the server process + * to exit. + */ interface ExitRequest extends Request { command: CommandTypes.Exit; } /** - * Close request; value of command field is "close". Notify the - * server that the client has closed a previously open file. If - * file is still referenced by open files, the server will resume - * monitoring the filesystem for changes to file. Server does not - * currently send a response to a close request. - */ + * Close request; value of command field is "close". Notify the + * server that the client has closed a previously open file. If + * file is still referenced by open files, the server will resume + * monitoring the filesystem for changes to file. Server does not + * currently send a response to a close request. + */ interface CloseRequest extends FileRequest { command: CommandTypes.Close; } @@ -897,6 +909,10 @@ declare namespace ts.server.protocol { * List of files names that should be recompiled */ fileNames: string[]; + /** + * true if project uses outFile or out compiler option + */ + projectUsesOutFile: boolean; } /** * Response for CompileOnSaveAffectedFileListRequest request; @@ -921,60 +937,64 @@ declare namespace ts.server.protocol { forced?: boolean; } /** - * Quickinfo request; value of command field is - * "quickinfo". Return response giving a quick type and - * documentation string for the symbol found in file at location - * line, col. - */ + * Quickinfo request; value of command field is + * "quickinfo". Return response giving a quick type and + * documentation string for the symbol found in file at location + * line, col. + */ interface QuickInfoRequest extends FileLocationRequest { command: CommandTypes.Quickinfo; } /** - * Body of QuickInfoResponse. - */ + * Body of QuickInfoResponse. + */ interface QuickInfoResponseBody { /** - * The symbol's kind (such as 'className' or 'parameterName' or plain 'text'). - */ + * The symbol's kind (such as 'className' or 'parameterName' or plain 'text'). + */ kind: string; /** - * Optional modifiers for the kind (such as 'public'). - */ + * Optional modifiers for the kind (such as 'public'). + */ kindModifiers: string; /** - * Starting file location of symbol. - */ + * Starting file location of symbol. + */ start: Location; /** - * One past last character of symbol. - */ + * One past last character of symbol. + */ end: Location; /** - * Type and kind of symbol. - */ + * Type and kind of symbol. + */ displayString: string; /** - * Documentation associated with symbol. - */ + * Documentation associated with symbol. + */ documentation: string; + /** + * JSDoc tags associated with symbol. + */ + tags: JSDocTagInfo[]; } /** - * Quickinfo response message. - */ + * Quickinfo response message. + */ interface QuickInfoResponse extends Response { body?: QuickInfoResponseBody; } /** - * Arguments for format messages. - */ + * Arguments for format messages. + */ interface FormatRequestArgs extends FileLocationRequestArgs { /** - * Last line of range for which to format text in file. - */ + * Last line of range for which to format text in file. + */ endLine: number; /** - * Character offset on last line of range for which to format text in file. - */ + * Character offset on last line of range for which to format text in file. + */ endOffset: number; /** * Format options to be used. @@ -982,36 +1002,36 @@ declare namespace ts.server.protocol { options?: FormatCodeSettings; } /** - * Format request; value of command field is "format". Return - * response giving zero or more edit instructions. The edit - * instructions will be sorted in file order. Applying the edit - * instructions in reverse to file will result in correctly - * reformatted text. - */ + * Format request; value of command field is "format". Return + * response giving zero or more edit instructions. The edit + * instructions will be sorted in file order. Applying the edit + * instructions in reverse to file will result in correctly + * reformatted text. + */ interface FormatRequest extends FileLocationRequest { command: CommandTypes.Format; arguments: FormatRequestArgs; } /** - * Object found in response messages defining an editing - * instruction for a span of text in source code. The effect of - * this instruction is to replace the text starting at start and - * ending one character before end with newText. For an insertion, - * the text span is empty. For a deletion, newText is empty. - */ + * Object found in response messages defining an editing + * instruction for a span of text in source code. The effect of + * this instruction is to replace the text starting at start and + * ending one character before end with newText. For an insertion, + * the text span is empty. For a deletion, newText is empty. + */ interface CodeEdit { /** - * First character of the text span to edit. - */ + * First character of the text span to edit. + */ start: Location; /** - * One character past last character of the text span to edit. - */ + * One character past last character of the text span to edit. + */ end: Location; /** - * Replace the span defined above with this string (may be - * the empty string). - */ + * Replace the span defined above with this string (may be + * the empty string). + */ newText: string; } interface FileCodeEdits { @@ -1029,99 +1049,99 @@ declare namespace ts.server.protocol { changes: FileCodeEdits[]; } /** - * Format and format on key response message. - */ + * Format and format on key response message. + */ interface FormatResponse extends Response { body?: CodeEdit[]; } /** - * Arguments for format on key messages. - */ + * Arguments for format on key messages. + */ interface FormatOnKeyRequestArgs extends FileLocationRequestArgs { /** - * Key pressed (';', '\n', or '}'). - */ + * Key pressed (';', '\n', or '}'). + */ key: string; options?: FormatCodeSettings; } /** - * Format on key request; value of command field is - * "formatonkey". Given file location and key typed (as string), - * return response giving zero or more edit instructions. The - * edit instructions will be sorted in file order. Applying the - * edit instructions in reverse to file will result in correctly - * reformatted text. - */ + * Format on key request; value of command field is + * "formatonkey". Given file location and key typed (as string), + * return response giving zero or more edit instructions. The + * edit instructions will be sorted in file order. Applying the + * edit instructions in reverse to file will result in correctly + * reformatted text. + */ interface FormatOnKeyRequest extends FileLocationRequest { command: CommandTypes.Formatonkey; arguments: FormatOnKeyRequestArgs; } /** - * Arguments for completions messages. - */ + * Arguments for completions messages. + */ interface CompletionsRequestArgs extends FileLocationRequestArgs { /** - * Optional prefix to apply to possible completions. - */ + * Optional prefix to apply to possible completions. + */ prefix?: string; } /** - * Completions request; value of command field is "completions". - * Given a file location (file, line, col) and a prefix (which may - * be the empty string), return the possible completions that - * begin with prefix. - */ + * Completions request; value of command field is "completions". + * Given a file location (file, line, col) and a prefix (which may + * be the empty string), return the possible completions that + * begin with prefix. + */ interface CompletionsRequest extends FileLocationRequest { command: CommandTypes.Completions; arguments: CompletionsRequestArgs; } /** - * Arguments for completion details request. - */ + * Arguments for completion details request. + */ interface CompletionDetailsRequestArgs extends FileLocationRequestArgs { /** - * Names of one or more entries for which to obtain details. - */ + * Names of one or more entries for which to obtain details. + */ entryNames: string[]; } /** - * Completion entry details request; value of command field is - * "completionEntryDetails". Given a file location (file, line, - * col) and an array of completion entry names return more - * detailed information for each completion entry. - */ + * Completion entry details request; value of command field is + * "completionEntryDetails". Given a file location (file, line, + * col) and an array of completion entry names return more + * detailed information for each completion entry. + */ interface CompletionDetailsRequest extends FileLocationRequest { command: CommandTypes.CompletionDetails; arguments: CompletionDetailsRequestArgs; } /** - * Part of a symbol description. - */ + * Part of a symbol description. + */ interface SymbolDisplayPart { /** - * Text of an item describing the symbol. - */ + * Text of an item describing the symbol. + */ text: string; /** - * The symbol's kind (such as 'className' or 'parameterName' or plain 'text'). - */ + * The symbol's kind (such as 'className' or 'parameterName' or plain 'text'). + */ kind: string; } /** - * An item found in a completion response. - */ + * An item found in a completion response. + */ interface CompletionEntry { /** - * The symbol's name. - */ + * The symbol's name. + */ name: string; /** - * The symbol's kind (such as 'className' or 'parameterName'). - */ + * The symbol's kind (such as 'className' or 'parameterName'). + */ kind: string; /** - * Optional modifiers for the kind (such as 'public'). - */ + * Optional modifiers for the kind (such as 'public'). + */ kindModifiers: string; /** * A string that is used for comparing completion items so that they can be ordered. This @@ -1135,29 +1155,33 @@ declare namespace ts.server.protocol { replacementSpan?: TextSpan; } /** - * Additional completion entry details, available on demand - */ + * Additional completion entry details, available on demand + */ interface CompletionEntryDetails { /** - * The symbol's name. - */ + * The symbol's name. + */ name: string; /** - * The symbol's kind (such as 'className' or 'parameterName'). - */ + * The symbol's kind (such as 'className' or 'parameterName'). + */ kind: string; /** - * Optional modifiers for the kind (such as 'public'). - */ + * Optional modifiers for the kind (such as 'public'). + */ kindModifiers: string; /** - * Display parts of the symbol (similar to quick info). - */ + * Display parts of the symbol (similar to quick info). + */ displayParts: SymbolDisplayPart[]; /** - * Documentation strings for the symbol. - */ + * Documentation strings for the symbol. + */ documentation: SymbolDisplayPart[]; + /** + * JSDoc tags for the symbol. + */ + tags: JSDocTagInfo[]; } interface CompletionsResponse extends Response { body?: CompletionEntry[]; @@ -1174,12 +1198,12 @@ declare namespace ts.server.protocol { */ name: string; /** - * Documentation of the parameter. - */ + * Documentation of the parameter. + */ documentation: SymbolDisplayPart[]; /** - * Display parts of the parameter. - */ + * Display parts of the parameter. + */ displayParts: SymbolDisplayPart[]; /** * Whether the parameter is optional or not. @@ -1214,6 +1238,10 @@ declare namespace ts.server.protocol { * The signature's documentation */ documentation: SymbolDisplayPart[]; + /** + * The signature's JSDoc tags + */ + tags: JSDocTagInfo[]; } /** * Signature help items found in the response of a signature help request. @@ -1246,10 +1274,10 @@ declare namespace ts.server.protocol { interface SignatureHelpRequestArgs extends FileLocationRequestArgs { } /** - * Signature help request; value of command field is "signatureHelp". - * Given a file location (file, line, col), return the signature - * help. - */ + * Signature help request; value of command field is "signatureHelp". + * Given a file location (file, line, col), return the signature + * help. + */ interface SignatureHelpRequest extends FileLocationRequest { command: CommandTypes.SignatureHelp; arguments: SignatureHelpRequestArgs; @@ -1261,8 +1289,8 @@ declare namespace ts.server.protocol { body?: SignatureHelpItems; } /** - * Synchronous request for semantic diagnostics of one file. - */ + * Synchronous request for semantic diagnostics of one file. + */ interface SemanticDiagnosticsSyncRequest extends FileRequest { command: CommandTypes.SemanticDiagnosticsSync; arguments: SemanticDiagnosticsSyncRequestArgs; @@ -1271,14 +1299,14 @@ declare namespace ts.server.protocol { includeLinePosition?: boolean; } /** - * Response object for synchronous sematic diagnostics request. - */ + * Response object for synchronous sematic diagnostics request. + */ interface SemanticDiagnosticsSyncResponse extends Response { body?: Diagnostic[] | DiagnosticWithLinePosition[]; } /** - * Synchronous request for syntactic diagnostics of one file. - */ + * Synchronous request for syntactic diagnostics of one file. + */ interface SyntacticDiagnosticsSyncRequest extends FileRequest { command: CommandTypes.SyntacticDiagnosticsSync; arguments: SyntacticDiagnosticsSyncRequestArgs; @@ -1287,98 +1315,109 @@ declare namespace ts.server.protocol { includeLinePosition?: boolean; } /** - * Response object for synchronous syntactic diagnostics request. - */ + * Response object for synchronous syntactic diagnostics request. + */ interface SyntacticDiagnosticsSyncResponse extends Response { body?: Diagnostic[] | DiagnosticWithLinePosition[]; } /** - * Arguments for GeterrForProject request. - */ + * Arguments for GeterrForProject request. + */ interface GeterrForProjectRequestArgs { /** - * the file requesting project error list - */ + * the file requesting project error list + */ file: string; /** - * Delay in milliseconds to wait before starting to compute - * errors for the files in the file list - */ + * Delay in milliseconds to wait before starting to compute + * errors for the files in the file list + */ delay: number; } /** - * GeterrForProjectRequest request; value of command field is - * "geterrForProject". It works similarly with 'Geterr', only - * it request for every file in this project. - */ + * GeterrForProjectRequest request; value of command field is + * "geterrForProject". It works similarly with 'Geterr', only + * it request for every file in this project. + */ interface GeterrForProjectRequest extends Request { command: CommandTypes.GeterrForProject; arguments: GeterrForProjectRequestArgs; } /** - * Arguments for geterr messages. - */ + * Arguments for geterr messages. + */ interface GeterrRequestArgs { /** - * List of file names for which to compute compiler errors. - * The files will be checked in list order. - */ + * List of file names for which to compute compiler errors. + * The files will be checked in list order. + */ files: string[]; /** - * Delay in milliseconds to wait before starting to compute - * errors for the files in the file list - */ + * Delay in milliseconds to wait before starting to compute + * errors for the files in the file list + */ delay: number; } /** - * Geterr request; value of command field is "geterr". Wait for - * delay milliseconds and then, if during the wait no change or - * reload messages have arrived for the first file in the files - * list, get the syntactic errors for the file, field requests, - * and then get the semantic errors for the file. Repeat with a - * smaller delay for each subsequent file on the files list. Best - * practice for an editor is to send a file list containing each - * file that is currently visible, in most-recently-used order. - */ + * Geterr request; value of command field is "geterr". Wait for + * delay milliseconds and then, if during the wait no change or + * reload messages have arrived for the first file in the files + * list, get the syntactic errors for the file, field requests, + * and then get the semantic errors for the file. Repeat with a + * smaller delay for each subsequent file on the files list. Best + * practice for an editor is to send a file list containing each + * file that is currently visible, in most-recently-used order. + */ interface GeterrRequest extends Request { command: CommandTypes.Geterr; arguments: GeterrRequestArgs; } + type RequestCompletedEventName = "requestCompleted"; /** - * Item of diagnostic information found in a DiagnosticEvent message. - */ + * Event that is sent when server have finished processing request with specified id. + */ + interface RequestCompletedEvent extends Event { + event: RequestCompletedEventName; + body: RequestCompletedEventBody; + } + interface RequestCompletedEventBody { + request_seq: number; + } + /** + * Item of diagnostic information found in a DiagnosticEvent message. + */ interface Diagnostic { /** - * Starting file location at which text applies. - */ + * Starting file location at which text applies. + */ start: Location; /** - * The last file location at which the text applies. - */ + * The last file location at which the text applies. + */ end: Location; /** - * Text of diagnostic message. - */ + * Text of diagnostic message. + */ text: string; /** - * The error code of the diagnostic message. - */ + * The error code of the diagnostic message. + */ code?: number; } interface DiagnosticEventBody { /** - * The file for which diagnostic information is reported. - */ + * The file for which diagnostic information is reported. + */ file: string; /** - * An array of diagnostic information items. - */ + * An array of diagnostic information items. + */ diagnostics: Diagnostic[]; } /** - * Event message for "syntaxDiag" and "semanticDiag" event types. - * These events provide syntactic and semantic errors for a file. - */ + * Event message for "syntaxDiag" and "semanticDiag" event types. + * These events provide syntactic and semantic errors for a file. + */ interface DiagnosticEvent extends Event { body?: DiagnosticEventBody; } @@ -1424,172 +1463,172 @@ declare namespace ts.server.protocol { languageServiceEnabled: boolean; } /** - * Arguments for reload request. - */ + * Arguments for reload request. + */ interface ReloadRequestArgs extends FileRequestArgs { /** - * Name of temporary file from which to reload file - * contents. May be same as file. - */ + * Name of temporary file from which to reload file + * contents. May be same as file. + */ tmpfile: string; } /** - * Reload request message; value of command field is "reload". - * Reload contents of file with name given by the 'file' argument - * from temporary file with name given by the 'tmpfile' argument. - * The two names can be identical. - */ + * Reload request message; value of command field is "reload". + * Reload contents of file with name given by the 'file' argument + * from temporary file with name given by the 'tmpfile' argument. + * The two names can be identical. + */ interface ReloadRequest extends FileRequest { command: CommandTypes.Reload; arguments: ReloadRequestArgs; } /** - * Response to "reload" request. This is just an acknowledgement, so - * no body field is required. - */ + * Response to "reload" request. This is just an acknowledgement, so + * no body field is required. + */ interface ReloadResponse extends Response { } /** - * Arguments for saveto request. - */ + * Arguments for saveto request. + */ interface SavetoRequestArgs extends FileRequestArgs { /** - * Name of temporary file into which to save server's view of - * file contents. - */ + * Name of temporary file into which to save server's view of + * file contents. + */ tmpfile: string; } /** - * Saveto request message; value of command field is "saveto". - * For debugging purposes, save to a temporaryfile (named by - * argument 'tmpfile') the contents of file named by argument - * 'file'. The server does not currently send a response to a - * "saveto" request. - */ + * Saveto request message; value of command field is "saveto". + * For debugging purposes, save to a temporaryfile (named by + * argument 'tmpfile') the contents of file named by argument + * 'file'. The server does not currently send a response to a + * "saveto" request. + */ interface SavetoRequest extends FileRequest { command: CommandTypes.Saveto; arguments: SavetoRequestArgs; } /** - * Arguments for navto request message. - */ + * Arguments for navto request message. + */ interface NavtoRequestArgs extends FileRequestArgs { /** - * Search term to navigate to from current location; term can - * be '.*' or an identifier prefix. - */ + * Search term to navigate to from current location; term can + * be '.*' or an identifier prefix. + */ searchValue: string; /** - * Optional limit on the number of items to return. - */ + * Optional limit on the number of items to return. + */ maxResultCount?: number; /** - * Optional flag to indicate we want results for just the current file - * or the entire project. - */ + * Optional flag to indicate we want results for just the current file + * or the entire project. + */ currentFileOnly?: boolean; projectFileName?: string; } /** - * Navto request message; value of command field is "navto". - * Return list of objects giving file locations and symbols that - * match the search term given in argument 'searchTerm'. The - * context for the search is given by the named file. - */ + * Navto request message; value of command field is "navto". + * Return list of objects giving file locations and symbols that + * match the search term given in argument 'searchTerm'. The + * context for the search is given by the named file. + */ interface NavtoRequest extends FileRequest { command: CommandTypes.Navto; arguments: NavtoRequestArgs; } /** - * An item found in a navto response. - */ + * An item found in a navto response. + */ interface NavtoItem { /** - * The symbol's name. - */ + * The symbol's name. + */ name: string; /** - * The symbol's kind (such as 'className' or 'parameterName'). - */ + * The symbol's kind (such as 'className' or 'parameterName'). + */ kind: string; /** - * exact, substring, or prefix. - */ + * exact, substring, or prefix. + */ matchKind?: string; /** - * If this was a case sensitive or insensitive match. - */ + * If this was a case sensitive or insensitive match. + */ isCaseSensitive?: boolean; /** - * Optional modifiers for the kind (such as 'public'). - */ + * Optional modifiers for the kind (such as 'public'). + */ kindModifiers?: string; /** - * The file in which the symbol is found. - */ + * The file in which the symbol is found. + */ file: string; /** - * The location within file at which the symbol is found. - */ + * The location within file at which the symbol is found. + */ start: Location; /** - * One past the last character of the symbol. - */ + * One past the last character of the symbol. + */ end: Location; /** - * Name of symbol's container symbol (if any); for example, - * the class name if symbol is a class member. - */ + * Name of symbol's container symbol (if any); for example, + * the class name if symbol is a class member. + */ containerName?: string; /** - * Kind of symbol's container symbol (if any). - */ + * Kind of symbol's container symbol (if any). + */ containerKind?: string; } /** - * Navto response message. Body is an array of navto items. Each - * item gives a symbol that matched the search term. - */ + * Navto response message. Body is an array of navto items. Each + * item gives a symbol that matched the search term. + */ interface NavtoResponse extends Response { body?: NavtoItem[]; } /** - * Arguments for change request message. - */ + * Arguments for change request message. + */ interface ChangeRequestArgs extends FormatRequestArgs { /** - * Optional string to insert at location (file, line, offset). - */ + * Optional string to insert at location (file, line, offset). + */ insertString?: string; } /** - * Change request message; value of command field is "change". - * Update the server's view of the file named by argument 'file'. - * Server does not currently send a response to a change request. - */ + * Change request message; value of command field is "change". + * Update the server's view of the file named by argument 'file'. + * Server does not currently send a response to a change request. + */ interface ChangeRequest extends FileLocationRequest { command: CommandTypes.Change; arguments: ChangeRequestArgs; } /** - * Response to "brace" request. - */ + * Response to "brace" request. + */ interface BraceResponse extends Response { body?: TextSpan[]; } /** - * Brace matching request; value of command field is "brace". - * Return response giving the file locations of matching braces - * found in file at location line, offset. - */ + * Brace matching request; value of command field is "brace". + * Return response giving the file locations of matching braces + * found in file at location line, offset. + */ interface BraceRequest extends FileLocationRequest { command: CommandTypes.Brace; } /** - * NavBar items request; value of command field is "navbar". - * Return response giving the list of navigation bar entries - * extracted from the requested file. - */ + * NavBar items request; value of command field is "navbar". + * Return response giving the list of navigation bar entries + * extracted from the requested file. + */ interface NavBarRequest extends FileRequest { command: CommandTypes.NavBar; } @@ -1602,28 +1641,28 @@ declare namespace ts.server.protocol { } interface NavigationBarItem { /** - * The item's display text. - */ + * The item's display text. + */ text: string; /** - * The symbol's kind (such as 'className' or 'parameterName'). - */ + * The symbol's kind (such as 'className' or 'parameterName'). + */ kind: string; /** - * Optional modifiers for the kind (such as 'public'). - */ + * Optional modifiers for the kind (such as 'public'). + */ kindModifiers?: string; /** - * The definition locations of the item. - */ + * The definition locations of the item. + */ spans: TextSpan[]; /** - * Optional children. - */ + * Optional children. + */ childItems?: NavigationBarItem[]; /** - * Number of levels deep this item should appear. - */ + * Number of levels deep this item should appear. + */ indent: number; } /** protocol.NavigationTree is identical to ts.NavigationTree, except using protocol.TextSpan instead of ts.TextSpan */ @@ -1643,6 +1682,14 @@ declare namespace ts.server.protocol { telemetryEventName: string; payload: any; } + type TypesInstallerInitializationFailedEventName = "typesInstallerInitializationFailed"; + interface TypesInstallerInitializationFailedEvent extends Event { + event: TypesInstallerInitializationFailedEventName; + body: TypesInstallerInitializationFailedEventBody; + } + interface TypesInstallerInitializationFailedEventBody { + message: string; + } type TypingsInstalledTelemetryEventName = "typingsInstalled"; interface TypingsInstalledTelemetryEventBody extends TelemetryEventBody { telemetryEventName: TypingsInstalledTelemetryEventName; @@ -1662,6 +1709,34 @@ declare namespace ts.server.protocol { */ typingsInstallerVersion: string; } + type BeginInstallTypesEventName = "beginInstallTypes"; + type EndInstallTypesEventName = "endInstallTypes"; + interface BeginInstallTypesEvent extends Event { + event: BeginInstallTypesEventName; + body: BeginInstallTypesEventBody; + } + interface EndInstallTypesEvent extends Event { + event: EndInstallTypesEventName; + body: EndInstallTypesEventBody; + } + interface InstallTypesEventBody { + /** + * correlation id to match begin and end events + */ + eventId: number; + /** + * list of packages to install + */ + packages: ReadonlyArray; + } + interface BeginInstallTypesEventBody extends InstallTypesEventBody { + } + interface EndInstallTypesEventBody extends InstallTypesEventBody { + /** + * true if installation succeeded, otherwise false + */ + success: boolean; + } interface NavBarResponse extends Response { body?: NavigationBarItem[]; } @@ -1686,12 +1761,15 @@ declare namespace ts.server.protocol { insertSpaceAfterCommaDelimiter?: boolean; insertSpaceAfterSemicolonInForStatements?: boolean; insertSpaceBeforeAndAfterBinaryOperators?: boolean; + insertSpaceAfterConstructor?: boolean; insertSpaceAfterKeywordsInControlFlowStatements?: boolean; insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean; insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean; insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean; + insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean; insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean; insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean; + insertSpaceBeforeFunctionParenthesis?: boolean; placeOpenBraceOnNewLineForFunctions?: boolean; placeOpenBraceOnNewLineForControlBlocks?: boolean; } @@ -1737,6 +1815,7 @@ declare namespace ts.server.protocol { outDir?: string; outFile?: string; paths?: MapLike; + plugins?: PluginImport[]; preserveConstEnums?: boolean; project?: string; reactNamespace?: string; @@ -1760,9 +1839,10 @@ declare namespace ts.server.protocol { namespace JsxEmit { type None = "None"; type Preserve = "Preserve"; + type ReactNative = "ReactNative"; type React = "React"; } - type JsxEmit = JsxEmit.None | JsxEmit.Preserve | JsxEmit.React; + type JsxEmit = JsxEmit.None | JsxEmit.Preserve | JsxEmit.React | JsxEmit.ReactNative; namespace ModuleKind { type None = "None"; type CommonJS = "CommonJS"; @@ -1818,11 +1898,30 @@ declare namespace ts.server.protocol { [option: string]: string[] | boolean | undefined; } + interface JsFileExtensionInfo { + extension: string; + isMixedContent: boolean; + } + + interface JSDocTagInfo { + name: string; + text?: string; + } + + /** + * Type of objects whose values are all of the same type. + * The `in` and `for-in` operators can *not* be safely used, + * since `Object.prototype` may be modified by outside code. + */ interface MapLike { [index: string]: T; } - type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike; + interface PluginImport { + name: string; + } + + type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike | PluginImport[]; } declare namespace ts { // these types are empty stubs for types from services and should not be used directly diff --git a/node_modules/typescript/lib/tsc.js b/node_modules/typescript/lib/tsc.js index e08661bd1..a690d219d 100644 --- a/node_modules/typescript/lib/tsc.js +++ b/node_modules/typescript/lib/tsc.js @@ -27,6 +27,16 @@ var ts; ExitStatus[ExitStatus["DiagnosticsPresent_OutputsSkipped"] = 1] = "DiagnosticsPresent_OutputsSkipped"; ExitStatus[ExitStatus["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated"; })(ExitStatus = ts.ExitStatus || (ts.ExitStatus = {})); + var NodeBuilderFlags; + (function (NodeBuilderFlags) { + NodeBuilderFlags[NodeBuilderFlags["None"] = 0] = "None"; + NodeBuilderFlags[NodeBuilderFlags["allowThisInObjectLiteral"] = 1] = "allowThisInObjectLiteral"; + NodeBuilderFlags[NodeBuilderFlags["allowQualifedNameInPlaceOfIdentifier"] = 2] = "allowQualifedNameInPlaceOfIdentifier"; + NodeBuilderFlags[NodeBuilderFlags["allowTypeParameterInQualifiedName"] = 4] = "allowTypeParameterInQualifiedName"; + NodeBuilderFlags[NodeBuilderFlags["allowAnonymousIdentifier"] = 8] = "allowAnonymousIdentifier"; + NodeBuilderFlags[NodeBuilderFlags["allowEmptyUnionOrIntersection"] = 16] = "allowEmptyUnionOrIntersection"; + NodeBuilderFlags[NodeBuilderFlags["allowEmptyTuple"] = 32] = "allowEmptyTuple"; + })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {})); var TypeReferenceSerializationKind; (function (TypeReferenceSerializationKind) { TypeReferenceSerializationKind[TypeReferenceSerializationKind["Unknown"] = 0] = "Unknown"; @@ -88,32 +98,32 @@ var ts; var measures; function mark(markName) { if (enabled) { - marks[markName] = ts.timestamp(); - counts[markName] = (counts[markName] || 0) + 1; + marks.set(markName, ts.timestamp()); + counts.set(markName, (counts.get(markName) || 0) + 1); profilerEvent(markName); } } performance.mark = mark; function measure(measureName, startMarkName, endMarkName) { if (enabled) { - var end = endMarkName && marks[endMarkName] || ts.timestamp(); - var start = startMarkName && marks[startMarkName] || profilerStart; - measures[measureName] = (measures[measureName] || 0) + (end - start); + var end = endMarkName && marks.get(endMarkName) || ts.timestamp(); + var start = startMarkName && marks.get(startMarkName) || profilerStart; + measures.set(measureName, (measures.get(measureName) || 0) + (end - start)); } } performance.measure = measure; function getCount(markName) { - return counts && counts[markName] || 0; + return counts && counts.get(markName) || 0; } performance.getCount = getCount; function getDuration(measureName) { - return measures && measures[measureName] || 0; + return measures && measures.get(measureName) || 0; } performance.getDuration = getDuration; function forEachMeasure(cb) { - for (var key in measures) { - cb(key, measures[key]); - } + measures.forEach(function (measure, key) { + cb(key, measure); + }); } performance.forEachMeasure = forEachMeasure; function enable() { @@ -132,22 +142,96 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - ts.version = "2.2.0-dev.20161127"; + ts.version = "2.3.0-dev.20170419"; })(ts || (ts = {})); (function (ts) { - var createObject = Object.create; - ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined; - function createMap(template) { - var map = createObject(null); + ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator(undefined, { usage: "sort", sensitivity: "accent" }) : undefined; + ts.localeCompareIsCorrect = ts.collator && ts.collator.compare("a", "B") < 0; + function createDictionaryObject() { + var map = Object.create(null); map["__"] = undefined; delete map["__"]; + return map; + } + function createMap() { + return new MapCtr(); + } + ts.createMap = createMap; + function createMapFromTemplate(template) { + var map = new MapCtr(); for (var key in template) if (hasOwnProperty.call(template, key)) { - map[key] = template[key]; + map.set(key, template[key]); } return map; } - ts.createMap = createMap; + ts.createMapFromTemplate = createMapFromTemplate; + var MapCtr = typeof Map !== "undefined" && "entries" in Map.prototype ? Map : shimMap(); + function shimMap() { + var MapIterator = (function () { + function MapIterator(data, selector) { + this.index = 0; + this.data = data; + this.selector = selector; + this.keys = Object.keys(data); + } + MapIterator.prototype.next = function () { + var index = this.index; + if (index < this.keys.length) { + this.index++; + return { value: this.selector(this.data, this.keys[index]), done: false }; + } + return { value: undefined, done: true }; + }; + return MapIterator; + }()); + return (function () { + function class_1() { + this.data = createDictionaryObject(); + this.size = 0; + } + class_1.prototype.get = function (key) { + return this.data[key]; + }; + class_1.prototype.set = function (key, value) { + if (!this.has(key)) { + this.size++; + } + this.data[key] = value; + return this; + }; + class_1.prototype.has = function (key) { + return key in this.data; + }; + class_1.prototype.delete = function (key) { + if (this.has(key)) { + this.size--; + delete this.data[key]; + return true; + } + return false; + }; + class_1.prototype.clear = function () { + this.data = createDictionaryObject(); + this.size = 0; + }; + class_1.prototype.keys = function () { + return new MapIterator(this.data, function (_data, key) { return key; }); + }; + class_1.prototype.values = function () { + return new MapIterator(this.data, function (data, key) { return data[key]; }); + }; + class_1.prototype.entries = function () { + return new MapIterator(this.data, function (data, key) { return [key, data[key]]; }); + }; + class_1.prototype.forEach = function (action) { + for (var key in this.data) { + action(this.data[key], key); + } + }; + return class_1; + }()); + } function createFileMap(keyMapper) { var files = createMap(); return { @@ -160,32 +244,27 @@ var ts; clear: clear, }; function forEachValueInMap(f) { - for (var key in files) { - f(key, files[key]); - } + files.forEach(function (file, key) { + f(key, file); + }); } function getKeys() { - var keys = []; - for (var key in files) { - keys.push(key); - } - return keys; + return arrayFrom(files.keys()); } function get(path) { - return files[toKey(path)]; + return files.get(toKey(path)); } function set(path, value) { - files[toKey(path)] = value; + files.set(toKey(path), value); } function contains(path) { - return toKey(path) in files; + return files.has(toKey(path)); } function remove(path) { - var key = toKey(path); - delete files[key]; + files.delete(toKey(path)); } function clear() { - files = createMap(); + files.clear(); } function toKey(path) { return keyMapper ? keyMapper(path) : path; @@ -199,9 +278,13 @@ var ts; return getCanonicalFileName(nonCanonicalizedPath); } ts.toPath = toPath; + function length(array) { + return array ? array.length : 0; + } + ts.length = length; function forEach(array, callback) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { var result = callback(array[i], i); if (result) { return result; @@ -211,6 +294,20 @@ var ts; return undefined; } ts.forEach = forEach; + function findAncestor(node, callback) { + while (node) { + var result = callback(node); + if (result === "quit") { + return undefined; + } + else if (result) { + return node; + } + node = node.parent; + } + return undefined; + } + ts.findAncestor = findAncestor; function zipWith(arrayA, arrayB, callback) { Debug.assert(arrayA.length === arrayB.length); for (var i = 0; i < arrayA.length; i++) { @@ -220,7 +317,7 @@ var ts; ts.zipWith = zipWith; function every(array, callback) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { if (!callback(array[i], i)) { return false; } @@ -230,7 +327,7 @@ var ts; } ts.every = every; function find(array, predicate) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { var value = array[i]; if (predicate(value, i)) { return value; @@ -239,8 +336,17 @@ var ts; return undefined; } ts.find = find; + function findIndex(array, predicate) { + for (var i = 0; i < array.length; i++) { + if (predicate(array[i], i)) { + return i; + } + } + return -1; + } + ts.findIndex = findIndex; function findMap(array, callback) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { var result = callback(array[i], i); if (result) { return result; @@ -263,7 +369,7 @@ var ts; ts.contains = contains; function indexOf(array, value) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { if (array[i] === value) { return i; } @@ -273,7 +379,7 @@ var ts; } ts.indexOf = indexOf; function indexOfAnyCharCode(text, charCodes, start) { - for (var i = start || 0, len = text.length; i < len; i++) { + for (var i = start || 0; i < text.length; i++) { if (contains(charCodes, text.charCodeAt(i))) { return i; } @@ -460,21 +566,18 @@ var ts; return result; } ts.spanMap = spanMap; - function mapObject(object, f) { - var result; - if (object) { - result = {}; - for (var _i = 0, _a = getOwnKeys(object); _i < _a.length; _i++) { - var v = _a[_i]; - var _b = f(v, object[v]) || [undefined, undefined], key = _b[0], value = _b[1]; - if (key !== undefined) { - result[key] = value; - } - } + function mapEntries(map, f) { + if (!map) { + return undefined; } + var result = createMap(); + map.forEach(function (value, key) { + var _a = f(key, value), newKey = _a[0], newValue = _a[1]; + result.set(newKey, newValue); + }); return result; } - ts.mapObject = mapObject; + ts.mapEntries = mapEntries; function some(array, predicate) { if (array) { if (predicate) { @@ -758,38 +861,55 @@ var ts; return keys; } ts.getOwnKeys = getOwnKeys; - function forEachProperty(map, callback) { - var result; - for (var key in map) { - if (result = callback(map[key], key)) - break; + function arrayFrom(iterator, map) { + var result = []; + for (var _a = iterator.next(), value = _a.value, done = _a.done; !done; _b = iterator.next(), value = _b.value, done = _b.done, _b) { + result.push(map ? map(value) : value); } return result; + var _b; } - ts.forEachProperty = forEachProperty; - function someProperties(map, predicate) { - for (var key in map) { - if (!predicate || predicate(map[key], key)) - return true; + ts.arrayFrom = arrayFrom; + function convertToArray(iterator, f) { + var result = []; + for (var _a = iterator.next(), value = _a.value, done = _a.done; !done; _b = iterator.next(), value = _b.value, done = _b.done, _b) { + result.push(f(value)); } - return false; + return result; + var _b; } - ts.someProperties = someProperties; - function copyProperties(source, target) { - for (var key in source) { - target[key] = source[key]; + ts.convertToArray = convertToArray; + function forEachEntry(map, callback) { + var iterator = map.entries(); + for (var _a = iterator.next(), pair = _a.value, done = _a.done; !done; _b = iterator.next(), pair = _b.value, done = _b.done, _b) { + var key = pair[0], value = pair[1]; + var result = callback(value, key); + if (result) { + return result; + } } + return undefined; + var _b; } - ts.copyProperties = copyProperties; - function appendProperty(map, key, value) { - if (key === undefined || value === undefined) - return map; - if (map === undefined) - map = createMap(); - map[key] = value; - return map; + ts.forEachEntry = forEachEntry; + function forEachKey(map, callback) { + var iterator = map.keys(); + for (var _a = iterator.next(), key = _a.value, done = _a.done; !done; _b = iterator.next(), key = _b.value, done = _b.done, _b) { + var result = callback(key); + if (result) { + return result; + } + } + return undefined; + var _b; } - ts.appendProperty = appendProperty; + ts.forEachKey = forEachKey; + function copyEntries(source, target) { + source.forEach(function (value, key) { + target.set(key, value); + }); + } + ts.copyEntries = copyEntries; function assign(t) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { @@ -797,31 +917,14 @@ var ts; } for (var _a = 0, args_1 = args; _a < args_1.length; _a++) { var arg = args_1[_a]; - for (var _b = 0, _c = getOwnKeys(arg); _b < _c.length; _b++) { - var p = _c[_b]; - t[p] = arg[p]; - } + for (var p in arg) + if (hasProperty(arg, p)) { + t[p] = arg[p]; + } } return t; } ts.assign = assign; - function reduceProperties(map, callback, initial) { - var result = initial; - for (var key in map) { - result = callback(result, map[key], String(key)); - } - return result; - } - ts.reduceProperties = reduceProperties; - function reduceOwnProperties(map, callback, initial) { - var result = initial; - for (var key in map) - if (hasOwnProperty.call(map, key)) { - result = callback(result, map[key], String(key)); - } - return result; - } - ts.reduceOwnProperties = reduceOwnProperties; function equalOwnProperties(left, right, equalityComparer) { if (left === right) return true; @@ -846,23 +949,14 @@ var ts; var result = createMap(); for (var _i = 0, array_8 = array; _i < array_8.length; _i++) { var value = array_8[_i]; - result[makeKey(value)] = makeValue ? makeValue(value) : value; + result.set(makeKey(value), makeValue ? makeValue(value) : value); } return result; } ts.arrayToMap = arrayToMap; - function isEmpty(map) { - for (var id in map) { - if (hasProperty(map, id)) { - return false; - } - } - return true; - } - ts.isEmpty = isEmpty; function cloneMap(map) { var clone = createMap(); - copyProperties(map, clone); + copyEntries(map, clone); return clone; } ts.cloneMap = cloneMap; @@ -889,27 +983,32 @@ var ts; return result; } ts.extend = extend; - function multiMapAdd(map, key, value) { - var values = map[key]; + function createMultiMap() { + var map = createMap(); + map.add = multiMapAdd; + map.remove = multiMapRemove; + return map; + } + ts.createMultiMap = createMultiMap; + function multiMapAdd(key, value) { + var values = this.get(key); if (values) { values.push(value); - return values; } else { - return map[key] = [value]; + this.set(key, values = [value]); } + return values; } - ts.multiMapAdd = multiMapAdd; - function multiMapRemove(map, key, value) { - var values = map[key]; + function multiMapRemove(key, value) { + var values = this.get(key); if (values) { unorderedRemoveItem(values, value); if (!values.length) { - delete map[key]; + this.delete(key); } } } - ts.multiMapRemove = multiMapRemove; function isArray(value) { return Array.isArray ? Array.isArray(value) : value instanceof Array; } @@ -985,6 +1084,7 @@ var ts; baseIndex = baseIndex || 0; return text.replace(/{(\d+)}/g, function (_match, index) { return args[+index + baseIndex]; }); } + ts.formatStringFromArgs = formatStringFromArgs; ts.localizedDiagnosticMessages = undefined; function getLocaleSpecificMessage(message) { return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message.key] || message.message; @@ -1086,8 +1186,10 @@ var ts; if (b === undefined) return 1; if (ignoreCase) { - if (ts.collator && String.prototype.localeCompare) { - var result = a.localeCompare(b, undefined, { usage: "sort", sensitivity: "accent" }); + if (ts.collator) { + var result = ts.localeCompareIsCorrect ? + ts.collator.compare(a, b) : + a.localeCompare(b, undefined, { usage: "sort", sensitivity: "accent" }); return result < 0 ? -1 : result > 0 ? 1 : 0; } a = a.toUpperCase(); @@ -1469,36 +1571,26 @@ var ts; var singleAsteriskRegexFragmentFiles = "([^./]|(\\.(?!min\\.js$))?)*"; var singleAsteriskRegexFragmentOther = "[^/]*"; function getRegularExpressionForWildcard(specs, basePath, usage) { + var patterns = getRegularExpressionsForWildcards(specs, basePath, usage); + if (!patterns || !patterns.length) { + return undefined; + } + var pattern = patterns.map(function (pattern) { return "(" + pattern + ")"; }).join("|"); + var terminator = usage === "exclude" ? "($|/)" : "$"; + return "^(" + pattern + ")" + terminator; + } + ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard; + function getRegularExpressionsForWildcards(specs, basePath, usage) { if (specs === undefined || specs.length === 0) { return undefined; } var replaceWildcardCharacter = usage === "files" ? replaceWildCardCharacterFiles : replaceWildCardCharacterOther; var singleAsteriskRegexFragment = usage === "files" ? singleAsteriskRegexFragmentFiles : singleAsteriskRegexFragmentOther; var doubleAsteriskRegexFragment = usage === "exclude" ? "(/.+?)?" : "(/[^/.][^/]*)*?"; - var pattern = ""; - var hasWrittenSubpattern = false; - for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) { - var spec = specs_1[_i]; - if (!spec) { - continue; - } - var subPattern = getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter); - if (subPattern === undefined) { - continue; - } - if (hasWrittenSubpattern) { - pattern += "|"; - } - pattern += "(" + subPattern + ")"; - hasWrittenSubpattern = true; - } - if (!pattern) { - return undefined; - } - var terminator = usage === "exclude" ? "($|/)" : "$"; - return "^(" + pattern + ")" + terminator; + return flatMap(specs, function (spec) { + return spec && getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter); + }); } - ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard; function isImplicitGlob(lastPathComponent) { return !/[.*?]/.test(lastPathComponent); } @@ -1568,6 +1660,7 @@ var ts; currentDirectory = normalizePath(currentDirectory); var absolutePath = combinePaths(currentDirectory, path); return { + includeFilePatterns: map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^" + pattern + "$"; }), includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"), includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"), excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"), @@ -1580,34 +1673,48 @@ var ts; currentDirectory = normalizePath(currentDirectory); var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory); var regexFlag = useCaseSensitiveFileNames ? "" : "i"; - var includeFileRegex = patterns.includeFilePattern && new RegExp(patterns.includeFilePattern, regexFlag); + var includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map(function (pattern) { return new RegExp(pattern, regexFlag); }); var includeDirectoryRegex = patterns.includeDirectoryPattern && new RegExp(patterns.includeDirectoryPattern, regexFlag); var excludeRegex = patterns.excludePattern && new RegExp(patterns.excludePattern, regexFlag); - var result = []; + var results = includeFileRegexes ? includeFileRegexes.map(function () { return []; }) : [[]]; + var comparer = useCaseSensitiveFileNames ? compareStrings : compareStringsCaseInsensitive; for (var _i = 0, _a = patterns.basePaths; _i < _a.length; _i++) { var basePath = _a[_i]; visitDirectory(basePath, combinePaths(currentDirectory, basePath)); } - return result; + return flatten(results); function visitDirectory(path, absolutePath) { var _a = getFileSystemEntries(path), files = _a.files, directories = _a.directories; + files = files.slice().sort(comparer); + directories = directories.slice().sort(comparer); + var _loop_1 = function (current) { + var name = combinePaths(path, current); + var absoluteName = combinePaths(absolutePath, current); + if (extensions && !fileExtensionIsAny(name, extensions)) + return "continue"; + if (excludeRegex && excludeRegex.test(absoluteName)) + return "continue"; + if (!includeFileRegexes) { + results[0].push(name); + } + else { + var includeIndex = findIndex(includeFileRegexes, function (re) { return re.test(absoluteName); }); + if (includeIndex !== -1) { + results[includeIndex].push(name); + } + } + }; for (var _i = 0, files_1 = files; _i < files_1.length; _i++) { var current = files_1[_i]; - var name_1 = combinePaths(path, current); - var absoluteName = combinePaths(absolutePath, current); - if ((!extensions || fileExtensionIsAny(name_1, extensions)) && - (!includeFileRegex || includeFileRegex.test(absoluteName)) && - (!excludeRegex || !excludeRegex.test(absoluteName))) { - result.push(name_1); - } + _loop_1(current); } for (var _b = 0, directories_1 = directories; _b < directories_1.length; _b++) { var current = directories_1[_b]; - var name_2 = combinePaths(path, current); + var name = combinePaths(path, current); var absoluteName = combinePaths(absolutePath, current); if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) && (!excludeRegex || !excludeRegex.test(absoluteName))) { - visitDirectory(name_2, absoluteName); + visitDirectory(name, absoluteName); } } } @@ -1623,14 +1730,14 @@ var ts; includeBasePaths.push(getIncludeBasePath(absolute)); } includeBasePaths.sort(useCaseSensitiveFileNames ? compareStrings : compareStringsCaseInsensitive); - var _loop_1 = function (includeBasePath) { + var _loop_2 = function (includeBasePath) { if (ts.every(basePaths, function (basePath) { return !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames); })) { basePaths.push(includeBasePath); } }; for (var _a = 0, includeBasePaths_1 = includeBasePaths; _a < includeBasePaths_1.length; _a++) { var includeBasePath = includeBasePaths_1[_a]; - _loop_1(includeBasePath); + _loop_2(includeBasePath); } } return basePaths; @@ -1668,8 +1775,19 @@ var ts; ts.supportedTypescriptExtensionsForExtractExtension = [".d.ts", ".ts", ".tsx"]; ts.supportedJavascriptExtensions = [".js", ".jsx"]; var allSupportedExtensions = ts.supportedTypeScriptExtensions.concat(ts.supportedJavascriptExtensions); - function getSupportedExtensions(options) { - return options && options.allowJs ? allSupportedExtensions : ts.supportedTypeScriptExtensions; + function getSupportedExtensions(options, extraFileExtensions) { + var needAllExtensions = options && options.allowJs; + if (!extraFileExtensions || extraFileExtensions.length === 0 || !needAllExtensions) { + return needAllExtensions ? allSupportedExtensions : ts.supportedTypeScriptExtensions; + } + var extensions = allSupportedExtensions.slice(0); + for (var _i = 0, extraFileExtensions_1 = extraFileExtensions; _i < extraFileExtensions_1.length; _i++) { + var extInfo = extraFileExtensions_1[_i]; + if (extensions.indexOf(extInfo.extension) === -1) { + extensions.push(extInfo.extension); + } + } + return extensions; } ts.getSupportedExtensions = getSupportedExtensions; function hasJavaScriptFileExtension(fileName) { @@ -1680,11 +1798,11 @@ var ts; return forEach(ts.supportedTypeScriptExtensions, function (extension) { return fileExtensionIs(fileName, extension); }); } ts.hasTypeScriptFileExtension = hasTypeScriptFileExtension; - function isSupportedSourceFileName(fileName, compilerOptions) { + function isSupportedSourceFileName(fileName, compilerOptions, extraFileExtensions) { if (!fileName) { return false; } - for (var _i = 0, _a = getSupportedExtensions(compilerOptions); _i < _a.length; _i++) { + for (var _i = 0, _a = getSupportedExtensions(compilerOptions, extraFileExtensions); _i < _a.length; _i++) { var extension = _a[_i]; if (fileExtensionIs(fileName, extension)) { return true; @@ -1696,30 +1814,30 @@ var ts; function getExtensionPriority(path, supportedExtensions) { for (var i = supportedExtensions.length - 1; i >= 0; i--) { if (fileExtensionIs(path, supportedExtensions[i])) { - return adjustExtensionPriority(i); + return adjustExtensionPriority(i, supportedExtensions); } } return 0; } ts.getExtensionPriority = getExtensionPriority; - function adjustExtensionPriority(extensionPriority) { + function adjustExtensionPriority(extensionPriority, supportedExtensions) { if (extensionPriority < 2) { return 0; } - else if (extensionPriority < 5) { + else if (extensionPriority < supportedExtensions.length) { return 2; } else { - return 5; + return supportedExtensions.length; } } ts.adjustExtensionPriority = adjustExtensionPriority; - function getNextLowestExtensionPriority(extensionPriority) { + function getNextLowestExtensionPriority(extensionPriority, supportedExtensions) { if (extensionPriority < 2) { return 2; } else { - return 5; + return supportedExtensions.length; } } ts.getNextLowestExtensionPriority = getNextLowestExtensionPriority; @@ -1928,136 +2046,29 @@ var ts; } } ts.tryGetExtensionFromPath = tryGetExtensionFromPath; + function isCheckJsEnabledForFile(sourceFile, compilerOptions) { + return sourceFile.checkJsDirective ? sourceFile.checkJsDirective.enabled : compilerOptions.checkJs; + } + ts.isCheckJsEnabledForFile = isCheckJsEnabledForFile; })(ts || (ts = {})); var ts; (function (ts) { - ts.sys = (function () { - function getWScriptSystem() { - var fso = new ActiveXObject("Scripting.FileSystemObject"); - var shell = new ActiveXObject("WScript.Shell"); - var fileStream = new ActiveXObject("ADODB.Stream"); - fileStream.Type = 2; - var binaryStream = new ActiveXObject("ADODB.Stream"); - binaryStream.Type = 1; - var args = []; - for (var i = 0; i < WScript.Arguments.length; i++) { - args[i] = WScript.Arguments.Item(i); - } - function readFile(fileName, encoding) { - if (!fso.FileExists(fileName)) { - return undefined; - } - fileStream.Open(); - try { - if (encoding) { - fileStream.Charset = encoding; - fileStream.LoadFromFile(fileName); - } - else { - fileStream.Charset = "x-ansi"; - fileStream.LoadFromFile(fileName); - var bom = fileStream.ReadText(2) || ""; - fileStream.Position = 0; - fileStream.Charset = bom.length >= 2 && (bom.charCodeAt(0) === 0xFF && bom.charCodeAt(1) === 0xFE || bom.charCodeAt(0) === 0xFE && bom.charCodeAt(1) === 0xFF) ? "unicode" : "utf-8"; - } - return fileStream.ReadText(); - } - catch (e) { - throw e; - } - finally { - fileStream.Close(); - } - } - function writeFile(fileName, data, writeByteOrderMark) { - fileStream.Open(); - binaryStream.Open(); - try { - fileStream.Charset = "utf-8"; - fileStream.WriteText(data); - if (writeByteOrderMark) { - fileStream.Position = 0; - } - else { - fileStream.Position = 3; - } - fileStream.CopyTo(binaryStream); - binaryStream.SaveToFile(fileName, 2); - } - finally { - binaryStream.Close(); - fileStream.Close(); - } - } - function getNames(collection) { - var result = []; - for (var e = new Enumerator(collection); !e.atEnd(); e.moveNext()) { - result.push(e.item().Name); - } - return result.sort(); - } - function getDirectories(path) { - var folder = fso.GetFolder(path); - return getNames(folder.subfolders); - } - function getAccessibleFileSystemEntries(path) { - try { - var folder = fso.GetFolder(path || "."); - var files = getNames(folder.files); - var directories = getNames(folder.subfolders); - return { files: files, directories: directories }; - } - catch (e) { - return { files: [], directories: [] }; - } - } - function readDirectory(path, extensions, excludes, includes) { - return ts.matchFiles(path, extensions, excludes, includes, false, shell.CurrentDirectory, getAccessibleFileSystemEntries); - } - var wscriptSystem = { - args: args, - newLine: "\r\n", - useCaseSensitiveFileNames: false, - write: function (s) { - WScript.StdOut.Write(s); - }, - readFile: readFile, - writeFile: writeFile, - resolvePath: function (path) { - return fso.GetAbsolutePathName(path); - }, - fileExists: function (path) { - return fso.FileExists(path); - }, - directoryExists: function (path) { - return fso.FolderExists(path); - }, - createDirectory: function (directoryName) { - if (!wscriptSystem.directoryExists(directoryName)) { - fso.CreateFolder(directoryName); - } - }, - getExecutingFilePath: function () { - return WScript.ScriptFullName; - }, - getCurrentDirectory: function () { - return shell.CurrentDirectory; - }, - getDirectories: getDirectories, - getEnvironmentVariable: function (name) { - return new ActiveXObject("WScript.Shell").ExpandEnvironmentStrings("%" + name + "%"); - }, - readDirectory: readDirectory, - exit: function (exitCode) { - try { - WScript.Quit(exitCode); - } - catch (e) { - } - } - }; - return wscriptSystem; + function getNodeMajorVersion() { + if (typeof process === "undefined") { + return undefined; } + var version = process.version; + if (!version) { + return undefined; + } + var dot = version.indexOf("."); + if (dot === -1) { + return undefined; + } + return parseInt(version.substring(1, dot)); + } + ts.getNodeMajorVersion = getNodeMajorVersion; + ts.sys = (function () { function getNodeSystem() { var _fs = require("fs"); var _path = require("path"); @@ -2066,32 +2077,32 @@ var ts; var useNonPollingWatchers = process.env["TSC_NONPOLLING_WATCHER"]; function createWatchedFileSet() { var dirWatchers = ts.createMap(); - var fileWatcherCallbacks = ts.createMap(); + var fileWatcherCallbacks = ts.createMultiMap(); return { addFile: addFile, removeFile: removeFile }; function reduceDirWatcherRefCountForFile(fileName) { var dirName = ts.getDirectoryPath(fileName); - var watcher = dirWatchers[dirName]; + var watcher = dirWatchers.get(dirName); if (watcher) { watcher.referenceCount -= 1; if (watcher.referenceCount <= 0) { watcher.close(); - delete dirWatchers[dirName]; + dirWatchers.delete(dirName); } } } function addDirWatcher(dirPath) { - var watcher = dirWatchers[dirPath]; + var watcher = dirWatchers.get(dirPath); if (watcher) { watcher.referenceCount += 1; return; } watcher = _fs.watch(dirPath, { persistent: true }, function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); watcher.referenceCount = 1; - dirWatchers[dirPath] = watcher; + dirWatchers.set(dirPath, watcher); return; } function addFileWatcherCallback(filePath, callback) { - ts.multiMapAdd(fileWatcherCallbacks, filePath, callback); + fileWatcherCallbacks.add(filePath, callback); } function addFile(fileName, callback) { addFileWatcherCallback(fileName, callback); @@ -2103,24 +2114,26 @@ var ts; reduceDirWatcherRefCountForFile(watchedFile.fileName); } function removeFileWatcherCallback(filePath, callback) { - ts.multiMapRemove(fileWatcherCallbacks, filePath, callback); + fileWatcherCallbacks.remove(filePath, callback); } function fileEventHandler(eventName, relativeFileName, baseDirPath) { var fileName = typeof relativeFileName !== "string" ? undefined : ts.getNormalizedAbsolutePath(relativeFileName, baseDirPath); - if ((eventName === "change" || eventName === "rename") && fileWatcherCallbacks[fileName]) { - for (var _i = 0, _a = fileWatcherCallbacks[fileName]; _i < _a.length; _i++) { - var fileCallback = _a[_i]; - fileCallback(fileName); + if ((eventName === "change" || eventName === "rename")) { + var callbacks = fileWatcherCallbacks.get(fileName); + if (callbacks) { + for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) { + var fileCallback = callbacks_1[_i]; + fileCallback(fileName); + } } } } } var watchedFileSet = createWatchedFileSet(); - function isNode4OrLater() { - return parseInt(process.version.charAt(1)) >= 4; - } + var nodeVersion = getNodeMajorVersion(); + var isNode4OrLater = nodeVersion >= 4; function isFileSystemCaseSensitive() { if (platform === "win32" || platform === "win64") { return false; @@ -2177,10 +2190,10 @@ var ts; if (entry === "." || entry === "..") { continue; } - var name_3 = ts.combinePaths(path, entry); + var name = ts.combinePaths(path, entry); var stat = void 0; try { - stat = _fs.statSync(name_3); + stat = _fs.statSync(name); } catch (e) { continue; @@ -2257,7 +2270,7 @@ var ts; if (!directoryExists(directoryName)) { return noOpFileWatcher; } - if (isNode4OrLater() && (process.platform === "win32" || process.platform === "darwin")) { + if (isNode4OrLater && (process.platform === "win32" || process.platform === "darwin")) { options = { persistent: true, recursive: !!recursive }; } else { @@ -2267,7 +2280,6 @@ var ts; if (eventName === "rename") { callback(!relativeFileName ? relativeFileName : ts.normalizePath(ts.combinePaths(directoryName, relativeFileName))); } - ; }); }, resolvePath: function (path) { @@ -2384,9 +2396,6 @@ var ts; if (typeof ChakraHost !== "undefined") { sys = getChakraSystem(); } - else if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { - sys = getWScriptSystem(); - } else if (typeof process !== "undefined" && process.nextTick && !process.browser && typeof require !== "undefined") { sys = getNodeSystem(); } @@ -2455,11 +2464,11 @@ var ts; Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value: { code: 1055, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055", message: "Type '{0}' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value." }, Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: ts.DiagnosticCategory.Error, key: "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056", message: "Accessors are only available when targeting ECMAScript 5 and higher." }, An_async_function_or_method_must_have_a_valid_awaitable_return_type: { code: 1057, category: ts.DiagnosticCategory.Error, key: "An_async_function_or_method_must_have_a_valid_awaitable_return_type_1057", message: "An async function or method must have a valid awaitable return type." }, - Operand_for_await_does_not_have_a_valid_callable_then_member: { code: 1058, category: ts.DiagnosticCategory.Error, key: "Operand_for_await_does_not_have_a_valid_callable_then_member_1058", message: "Operand for 'await' does not have a valid callable 'then' member." }, - Return_expression_in_async_function_does_not_have_a_valid_callable_then_member: { code: 1059, category: ts.DiagnosticCategory.Error, key: "Return_expression_in_async_function_does_not_have_a_valid_callable_then_member_1059", message: "Return expression in async function does not have a valid callable 'then' member." }, - Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member: { code: 1060, category: ts.DiagnosticCategory.Error, key: "Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member_1060", message: "Expression body for async arrow function does not have a valid callable 'then' member." }, + The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1058, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058", message: "The return type of an async function must either be a valid promise or must not contain a callable 'then' member." }, + A_promise_must_have_a_then_method: { code: 1059, category: ts.DiagnosticCategory.Error, key: "A_promise_must_have_a_then_method_1059", message: "A promise must have a 'then' method." }, + The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback: { code: 1060, category: ts.DiagnosticCategory.Error, key: "The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060", message: "The first parameter of the 'then' method of a promise must be a callback." }, Enum_member_must_have_initializer: { code: 1061, category: ts.DiagnosticCategory.Error, key: "Enum_member_must_have_initializer_1061", message: "Enum member must have initializer." }, - _0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: { code: 1062, category: ts.DiagnosticCategory.Error, key: "_0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062", message: "{0} is referenced directly or indirectly in the fulfillment callback of its own 'then' method." }, + Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: { code: 1062, category: ts.DiagnosticCategory.Error, key: "Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062", message: "Type is referenced directly or indirectly in the fulfillment callback of its own 'then' method." }, An_export_assignment_cannot_be_used_in_a_namespace: { code: 1063, category: ts.DiagnosticCategory.Error, key: "An_export_assignment_cannot_be_used_in_a_namespace_1063", message: "An export assignment cannot be used in a namespace." }, The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type: { code: 1064, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1064", message: "The return type of an async function or method must be the global Promise type." }, In_ambient_enum_declarations_member_initializer_must_be_constant_expression: { code: 1066, category: ts.DiagnosticCategory.Error, key: "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066", message: "In ambient enum declarations member initializer must be constant expression." }, @@ -2468,7 +2477,7 @@ var ts; _0_modifier_cannot_appear_on_an_index_signature: { code: 1071, category: ts.DiagnosticCategory.Error, key: "_0_modifier_cannot_appear_on_an_index_signature_1071", message: "'{0}' modifier cannot appear on an index signature." }, A_0_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: ts.DiagnosticCategory.Error, key: "A_0_modifier_cannot_be_used_with_an_import_declaration_1079", message: "A '{0}' modifier cannot be used with an import declaration." }, Invalid_reference_directive_syntax: { code: 1084, category: ts.DiagnosticCategory.Error, key: "Invalid_reference_directive_syntax_1084", message: "Invalid 'reference' directive syntax." }, - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: ts.DiagnosticCategory.Error, key: "Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_1085", message: "Octal literals are not available when targeting ECMAScript 5 and higher." }, + Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0: { code: 1085, category: ts.DiagnosticCategory.Error, key: "Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0_1085", message: "Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '{0}'." }, An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: ts.DiagnosticCategory.Error, key: "An_accessor_cannot_be_declared_in_an_ambient_context_1086", message: "An accessor cannot be declared in an ambient context." }, _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: ts.DiagnosticCategory.Error, key: "_0_modifier_cannot_appear_on_a_constructor_declaration_1089", message: "'{0}' modifier cannot appear on a constructor declaration." }, _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: ts.DiagnosticCategory.Error, key: "_0_modifier_cannot_appear_on_a_parameter_1090", message: "'{0}' modifier cannot appear on a parameter." }, @@ -2484,6 +2493,7 @@ var ts; Invalid_use_of_0_in_strict_mode: { code: 1100, category: ts.DiagnosticCategory.Error, key: "Invalid_use_of_0_in_strict_mode_1100", message: "Invalid use of '{0}' in strict mode." }, with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: ts.DiagnosticCategory.Error, key: "with_statements_are_not_allowed_in_strict_mode_1101", message: "'with' statements are not allowed in strict mode." }, delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: ts.DiagnosticCategory.Error, key: "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102", message: "'delete' cannot be called on an identifier in strict mode." }, + A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator: { code: 1103, category: ts.DiagnosticCategory.Error, key: "A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator_1103", message: "A 'for-await-of' statement is only allowed within an async function or async generator." }, A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: ts.DiagnosticCategory.Error, key: "A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104", message: "A 'continue' statement can only be used within an enclosing iteration statement." }, A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: ts.DiagnosticCategory.Error, key: "A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105", message: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, Jump_target_cannot_cross_function_boundary: { code: 1107, category: ts.DiagnosticCategory.Error, key: "Jump_target_cannot_cross_function_boundary_1107", message: "Jump target cannot cross function boundary." }, @@ -2491,7 +2501,7 @@ var ts; Expression_expected: { code: 1109, category: ts.DiagnosticCategory.Error, key: "Expression_expected_1109", message: "Expression expected." }, Type_expected: { code: 1110, category: ts.DiagnosticCategory.Error, key: "Type_expected_1110", message: "Type expected." }, A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: ts.DiagnosticCategory.Error, key: "A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113", message: "A 'default' clause cannot appear more than once in a 'switch' statement." }, - Duplicate_label_0: { code: 1114, category: ts.DiagnosticCategory.Error, key: "Duplicate_label_0_1114", message: "Duplicate label '{0}'" }, + Duplicate_label_0: { code: 1114, category: ts.DiagnosticCategory.Error, key: "Duplicate_label_0_1114", message: "Duplicate label '{0}'." }, A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: ts.DiagnosticCategory.Error, key: "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", message: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: ts.DiagnosticCategory.Error, key: "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", message: "A 'break' statement can only jump to a label of an enclosing statement." }, An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: ts.DiagnosticCategory.Error, key: "An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode_1117", message: "An object literal cannot have multiple properties with the same name in strict mode." }, @@ -2523,9 +2533,9 @@ var ts; Declaration_expected: { code: 1146, category: ts.DiagnosticCategory.Error, key: "Declaration_expected_1146", message: "Declaration expected." }, Import_declarations_in_a_namespace_cannot_reference_a_module: { code: 1147, category: ts.DiagnosticCategory.Error, key: "Import_declarations_in_a_namespace_cannot_reference_a_module_1147", message: "Import declarations in a namespace cannot reference a module." }, Cannot_use_imports_exports_or_module_augmentations_when_module_is_none: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148", message: "Cannot use imports, exports, or module augmentations when '--module' is 'none'." }, - File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", message: "File name '{0}' differs from already included file name '{1}' only in casing" }, + File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", message: "File name '{0}' differs from already included file name '{1}' only in casing." }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: ts.DiagnosticCategory.Error, key: "new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead_1150", message: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "const_declarations_must_be_initialized_1155", message: "'const' declarations must be initialized" }, + const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "const_declarations_must_be_initialized_1155", message: "'const' declarations must be initialized." }, const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: ts.DiagnosticCategory.Error, key: "const_declarations_can_only_be_declared_inside_a_block_1156", message: "'const' declarations can only be declared inside a block." }, let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: ts.DiagnosticCategory.Error, key: "let_declarations_can_only_be_declared_inside_a_block_1157", message: "'let' declarations can only be declared inside a block." }, Unterminated_template_literal: { code: 1160, category: ts.DiagnosticCategory.Error, key: "Unterminated_template_literal_1160", message: "Unterminated template literal." }, @@ -2574,11 +2584,12 @@ var ts; Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided_1208", message: "Cannot compile namespaces when the '--isolatedModules' flag is provided." }, Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided_1209", message: "Ambient const enums are not allowed when the '--isolatedModules' flag is provided." }, Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode_1210", message: "Invalid use of '{0}'. Class definitions are automatically in strict mode." }, - A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", message: "A class declaration without the 'default' modifier must have a name" }, - Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", message: "Identifier expected. '{0}' is a reserved word in strict mode" }, + A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", message: "A class declaration without the 'default' modifier must have a name." }, + Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", message: "Identifier expected. '{0}' is a reserved word in strict mode." }, Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213", message: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode: { code: 1214, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214", message: "Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode." }, Invalid_use_of_0_Modules_are_automatically_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215", message: "Invalid use of '{0}'. Modules are automatically in strict mode." }, + Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216", message: "Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules." }, Export_assignment_is_not_supported_when_module_flag_is_system: { code: 1218, category: ts.DiagnosticCategory.Error, key: "Export_assignment_is_not_supported_when_module_flag_is_system_1218", message: "Export assignment is not supported when '--module' flag is 'system'." }, Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning: { code: 1219, category: ts.DiagnosticCategory.Error, key: "Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219", message: "Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning." }, Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher: { code: 1220, category: ts.DiagnosticCategory.Error, key: "Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher_1220", message: "Generators are only available when targeting ECMAScript 2015 or higher." }, @@ -2624,6 +2635,11 @@ var ts; Global_module_exports_may_only_appear_in_declaration_files: { code: 1315, category: ts.DiagnosticCategory.Error, key: "Global_module_exports_may_only_appear_in_declaration_files_1315", message: "Global module exports may only appear in declaration files." }, Global_module_exports_may_only_appear_at_top_level: { code: 1316, category: ts.DiagnosticCategory.Error, key: "Global_module_exports_may_only_appear_at_top_level_1316", message: "Global module exports may only appear at top level." }, A_parameter_property_cannot_be_declared_using_a_rest_parameter: { code: 1317, category: ts.DiagnosticCategory.Error, key: "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317", message: "A parameter property cannot be declared using a rest parameter." }, + An_abstract_accessor_cannot_have_an_implementation: { code: 1318, category: ts.DiagnosticCategory.Error, key: "An_abstract_accessor_cannot_have_an_implementation_1318", message: "An abstract accessor cannot have an implementation." }, + A_default_export_can_only_be_used_in_an_ECMAScript_style_module: { code: 1319, category: ts.DiagnosticCategory.Error, key: "A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319", message: "A default export can only be used in an ECMAScript-style module." }, + Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1320, category: ts.DiagnosticCategory.Error, key: "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320", message: "Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member." }, + Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1321, category: ts.DiagnosticCategory.Error, key: "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321", message: "Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member." }, + Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1322, category: ts.DiagnosticCategory.Error, key: "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322", message: "Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member." }, Duplicate_identifier_0: { code: 2300, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_2300", message: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: ts.DiagnosticCategory.Error, key: "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", message: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: ts.DiagnosticCategory.Error, key: "Static_members_cannot_reference_class_type_parameters_2302", message: "Static members cannot reference class type parameters." }, @@ -2667,6 +2683,7 @@ var ts; Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: ts.DiagnosticCategory.Error, key: "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340", message: "Only public and protected methods of the base class are accessible via the 'super' keyword." }, Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: ts.DiagnosticCategory.Error, key: "Property_0_is_private_and_only_accessible_within_class_1_2341", message: "Property '{0}' is private and only accessible within class '{1}'." }, An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { code: 2342, category: ts.DiagnosticCategory.Error, key: "An_index_expression_argument_must_be_of_type_string_number_symbol_or_any_2342", message: "An index expression argument must be of type 'string', 'number', 'symbol', or 'any'." }, + This_syntax_requires_an_imported_helper_named_1_but_module_0_has_no_exported_member_1: { code: 2343, category: ts.DiagnosticCategory.Error, key: "This_syntax_requires_an_imported_helper_named_1_but_module_0_has_no_exported_member_1_2343", message: "This syntax requires an imported helper named '{1}', but module '{0}' has no exported member '{1}'." }, Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: ts.DiagnosticCategory.Error, key: "Type_0_does_not_satisfy_the_constraint_1_2344", message: "Type '{0}' does not satisfy the constraint '{1}'." }, Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: ts.DiagnosticCategory.Error, key: "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345", message: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: ts.DiagnosticCategory.Error, key: "Supplied_parameters_do_not_match_any_signature_of_call_target_2346", message: "Supplied parameters do not match any signature of call target." }, @@ -2677,19 +2694,20 @@ var ts; Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: ts.DiagnosticCategory.Error, key: "Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature_2351", message: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, Type_0_cannot_be_converted_to_type_1: { code: 2352, category: ts.DiagnosticCategory.Error, key: "Type_0_cannot_be_converted_to_type_1_2352", message: "Type '{0}' cannot be converted to type '{1}'." }, Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1: { code: 2353, category: ts.DiagnosticCategory.Error, key: "Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353", message: "Object literal may only specify known properties, and '{0}' does not exist in type '{1}'." }, + This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found: { code: 2354, category: ts.DiagnosticCategory.Error, key: "This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354", message: "This syntax requires an imported helper but module '{0}' cannot be found." }, A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value: { code: 2355, category: ts.DiagnosticCategory.Error, key: "A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_2355", message: "A function whose declared type is neither 'void' nor 'any' must return a value." }, An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: ts.DiagnosticCategory.Error, key: "An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type_2356", message: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access: { code: 2357, category: ts.DiagnosticCategory.Error, key: "The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357", message: "The operand of an increment or decrement operator must be a variable or a property access." }, The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358", message: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359", message: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { code: 2360, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol_2360", message: "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'." }, - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter_2361", message: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter_2361", message: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter." }, The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2362", message: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2363", message: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access: { code: 2364, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364", message: "The left-hand side of an assignment expression must be a variable or a property access." }, Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: ts.DiagnosticCategory.Error, key: "Operator_0_cannot_be_applied_to_types_1_and_2_2365", message: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined: { code: 2366, category: ts.DiagnosticCategory.Error, key: "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366", message: "Function lacks ending return statement and return type does not include 'undefined'." }, - Type_parameter_name_cannot_be_0: { code: 2368, category: ts.DiagnosticCategory.Error, key: "Type_parameter_name_cannot_be_0_2368", message: "Type parameter name cannot be '{0}'" }, + Type_parameter_name_cannot_be_0: { code: 2368, category: ts.DiagnosticCategory.Error, key: "Type_parameter_name_cannot_be_0_2368", message: "Type parameter name cannot be '{0}'." }, A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: ts.DiagnosticCategory.Error, key: "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369", message: "A parameter property is only allowed in a constructor implementation." }, A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: ts.DiagnosticCategory.Error, key: "A_rest_parameter_must_be_of_an_array_type_2370", message: "A rest parameter must be of an array type." }, A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: ts.DiagnosticCategory.Error, key: "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371", message: "A parameter initializer is only allowed in a function or constructor implementation." }, @@ -2729,12 +2747,12 @@ var ts; The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access: { code: 2406, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406", message: "The left-hand side of a 'for...in' statement must be a variable or a property access." }, The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_2407", message: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, Setters_cannot_return_a_value: { code: 2408, category: ts.DiagnosticCategory.Error, key: "Setters_cannot_return_a_value_2408", message: "Setters cannot return a value." }, - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: ts.DiagnosticCategory.Error, key: "Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409", message: "Return type of constructor signature must be assignable to the instance type of the class" }, + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: ts.DiagnosticCategory.Error, key: "Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409", message: "Return type of constructor signature must be assignable to the instance type of the class." }, The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any: { code: 2410, category: ts.DiagnosticCategory.Error, key: "The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410", message: "The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'." }, Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: ts.DiagnosticCategory.Error, key: "Property_0_of_type_1_is_not_assignable_to_string_index_type_2_2411", message: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: ts.DiagnosticCategory.Error, key: "Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2_2412", message: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: ts.DiagnosticCategory.Error, key: "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413", message: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, - Class_name_cannot_be_0: { code: 2414, category: ts.DiagnosticCategory.Error, key: "Class_name_cannot_be_0_2414", message: "Class name cannot be '{0}'" }, + Class_name_cannot_be_0: { code: 2414, category: ts.DiagnosticCategory.Error, key: "Class_name_cannot_be_0_2414", message: "Class name cannot be '{0}'." }, Class_0_incorrectly_extends_base_class_1: { code: 2415, category: ts.DiagnosticCategory.Error, key: "Class_0_incorrectly_extends_base_class_1_2415", message: "Class '{0}' incorrectly extends base class '{1}'." }, Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: ts.DiagnosticCategory.Error, key: "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", message: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, Class_0_incorrectly_implements_interface_1: { code: 2420, category: ts.DiagnosticCategory.Error, key: "Class_0_incorrectly_implements_interface_1_2420", message: "Class '{0}' incorrectly implements interface '{1}'." }, @@ -2743,19 +2761,19 @@ var ts; Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: ts.DiagnosticCategory.Error, key: "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424", message: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: ts.DiagnosticCategory.Error, key: "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425", message: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: ts.DiagnosticCategory.Error, key: "Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426", message: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Interface_name_cannot_be_0: { code: 2427, category: ts.DiagnosticCategory.Error, key: "Interface_name_cannot_be_0_2427", message: "Interface name cannot be '{0}'" }, + Interface_name_cannot_be_0: { code: 2427, category: ts.DiagnosticCategory.Error, key: "Interface_name_cannot_be_0_2427", message: "Interface name cannot be '{0}'." }, All_declarations_of_0_must_have_identical_type_parameters: { code: 2428, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_0_must_have_identical_type_parameters_2428", message: "All declarations of '{0}' must have identical type parameters." }, Interface_0_incorrectly_extends_interface_1: { code: 2430, category: ts.DiagnosticCategory.Error, key: "Interface_0_incorrectly_extends_interface_1_2430", message: "Interface '{0}' incorrectly extends interface '{1}'." }, - Enum_name_cannot_be_0: { code: 2431, category: ts.DiagnosticCategory.Error, key: "Enum_name_cannot_be_0_2431", message: "Enum name cannot be '{0}'" }, + Enum_name_cannot_be_0: { code: 2431, category: ts.DiagnosticCategory.Error, key: "Enum_name_cannot_be_0_2431", message: "Enum name cannot be '{0}'." }, In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: ts.DiagnosticCategory.Error, key: "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432", message: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433", message: "A namespace declaration cannot be in a different file from a class or function with which it is merged" }, - A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434", message: "A namespace declaration cannot be located prior to a class or function with which it is merged" }, + A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433", message: "A namespace declaration cannot be in a different file from a class or function with which it is merged." }, + A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434", message: "A namespace declaration cannot be located prior to a class or function with which it is merged." }, Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces: { code: 2435, category: ts.DiagnosticCategory.Error, key: "Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435", message: "Ambient modules cannot be nested in other modules or namespaces." }, Ambient_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: ts.DiagnosticCategory.Error, key: "Ambient_module_declaration_cannot_specify_relative_module_name_2436", message: "Ambient module declaration cannot specify relative module name." }, - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: ts.DiagnosticCategory.Error, key: "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437", message: "Module '{0}' is hidden by a local declaration with the same name" }, - Import_name_cannot_be_0: { code: 2438, category: ts.DiagnosticCategory.Error, key: "Import_name_cannot_be_0_2438", message: "Import name cannot be '{0}'" }, + Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: ts.DiagnosticCategory.Error, key: "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437", message: "Module '{0}' is hidden by a local declaration with the same name." }, + Import_name_cannot_be_0: { code: 2438, category: ts.DiagnosticCategory.Error, key: "Import_name_cannot_be_0_2438", message: "Import name cannot be '{0}'." }, Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name: { code: 2439, category: ts.DiagnosticCategory.Error, key: "Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439", message: "Import or export declaration in an ambient module declaration cannot reference module through relative module name." }, - Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: ts.DiagnosticCategory.Error, key: "Import_declaration_conflicts_with_local_declaration_of_0_2440", message: "Import declaration conflicts with local declaration of '{0}'" }, + Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: ts.DiagnosticCategory.Error, key: "Import_declaration_conflicts_with_local_declaration_of_0_2440", message: "Import declaration conflicts with local declaration of '{0}'." }, Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module: { code: 2441, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441", message: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module." }, Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: ts.DiagnosticCategory.Error, key: "Types_have_separate_declarations_of_a_private_property_0_2442", message: "Types have separate declarations of a private property '{0}'." }, Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: ts.DiagnosticCategory.Error, key: "Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443", message: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, @@ -2764,18 +2782,20 @@ var ts; Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: ts.DiagnosticCategory.Error, key: "Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_2446", message: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: ts.DiagnosticCategory.Error, key: "The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447", message: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: ts.DiagnosticCategory.Error, key: "Block_scoped_variable_0_used_before_its_declaration_2448", message: "Block-scoped variable '{0}' used before its declaration." }, + Class_0_used_before_its_declaration: { code: 2449, category: ts.DiagnosticCategory.Error, key: "Class_0_used_before_its_declaration_2449", message: "Class '{0}' used before its declaration." }, + Enum_0_used_before_its_declaration: { code: 2450, category: ts.DiagnosticCategory.Error, key: "Enum_0_used_before_its_declaration_2450", message: "Enum '{0}' used before its declaration." }, Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_block_scoped_variable_0_2451", message: "Cannot redeclare block-scoped variable '{0}'." }, An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: ts.DiagnosticCategory.Error, key: "An_enum_member_cannot_have_a_numeric_name_2452", message: "An enum member cannot have a numeric name." }, The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: ts.DiagnosticCategory.Error, key: "The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_typ_2453", message: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, Variable_0_is_used_before_being_assigned: { code: 2454, category: ts.DiagnosticCategory.Error, key: "Variable_0_is_used_before_being_assigned_2454", message: "Variable '{0}' is used before being assigned." }, Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: ts.DiagnosticCategory.Error, key: "Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0_2455", message: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, Type_alias_0_circularly_references_itself: { code: 2456, category: ts.DiagnosticCategory.Error, key: "Type_alias_0_circularly_references_itself_2456", message: "Type alias '{0}' circularly references itself." }, - Type_alias_name_cannot_be_0: { code: 2457, category: ts.DiagnosticCategory.Error, key: "Type_alias_name_cannot_be_0_2457", message: "Type alias name cannot be '{0}'" }, + Type_alias_name_cannot_be_0: { code: 2457, category: ts.DiagnosticCategory.Error, key: "Type_alias_name_cannot_be_0_2457", message: "Type alias name cannot be '{0}'." }, An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: ts.DiagnosticCategory.Error, key: "An_AMD_module_cannot_have_multiple_name_assignments_2458", message: "An AMD module cannot have multiple name assignments." }, Type_0_has_no_property_1_and_no_string_index_signature: { code: 2459, category: ts.DiagnosticCategory.Error, key: "Type_0_has_no_property_1_and_no_string_index_signature_2459", message: "Type '{0}' has no property '{1}' and no string index signature." }, Type_0_has_no_property_1: { code: 2460, category: ts.DiagnosticCategory.Error, key: "Type_0_has_no_property_1_2460", message: "Type '{0}' has no property '{1}'." }, Type_0_is_not_an_array_type: { code: 2461, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_2461", message: "Type '{0}' is not an array type." }, - A_rest_element_must_be_last_in_a_destructuring_pattern: { code: 2462, category: ts.DiagnosticCategory.Error, key: "A_rest_element_must_be_last_in_a_destructuring_pattern_2462", message: "A rest element must be last in a destructuring pattern" }, + A_rest_element_must_be_last_in_a_destructuring_pattern: { code: 2462, category: ts.DiagnosticCategory.Error, key: "A_rest_element_must_be_last_in_a_destructuring_pattern_2462", message: "A rest element must be last in a destructuring pattern." }, A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { code: 2463, category: ts.DiagnosticCategory.Error, key: "A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463", message: "A binding pattern parameter cannot be optional in an implementation signature." }, A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { code: 2464, category: ts.DiagnosticCategory.Error, key: "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464", message: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." }, this_cannot_be_referenced_in_a_computed_property_name: { code: 2465, category: ts.DiagnosticCategory.Error, key: "this_cannot_be_referenced_in_a_computed_property_name_2465", message: "'this' cannot be referenced in a computed property name." }, @@ -2796,13 +2816,13 @@ var ts; let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2480, category: ts.DiagnosticCategory.Error, key: "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480", message: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2481, category: ts.DiagnosticCategory.Error, key: "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481", message: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." }, The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { code: 2483, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483", message: "The left-hand side of a 'for...of' statement cannot use a type annotation." }, - Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: ts.DiagnosticCategory.Error, key: "Export_declaration_conflicts_with_exported_declaration_of_0_2484", message: "Export declaration conflicts with exported declaration of '{0}'" }, + Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: ts.DiagnosticCategory.Error, key: "Export_declaration_conflicts_with_exported_declaration_of_0_2484", message: "Export declaration conflicts with exported declaration of '{0}'." }, The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access: { code: 2487, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487", message: "The left-hand side of a 'for...of' statement must be a variable or a property access." }, Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: ts.DiagnosticCategory.Error, key: "Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488", message: "Type must have a '[Symbol.iterator]()' method that returns an iterator." }, An_iterator_must_have_a_next_method: { code: 2489, category: ts.DiagnosticCategory.Error, key: "An_iterator_must_have_a_next_method_2489", message: "An iterator must have a 'next()' method." }, The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { code: 2490, category: ts.DiagnosticCategory.Error, key: "The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property_2490", message: "The type returned by the 'next()' method of an iterator must have a 'value' property." }, The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { code: 2491, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491", message: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." }, - Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_identifier_0_in_catch_clause_2492", message: "Cannot redeclare identifier '{0}' in catch clause" }, + Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_identifier_0_in_catch_clause_2492", message: "Cannot redeclare identifier '{0}' in catch clause." }, Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { code: 2493, category: ts.DiagnosticCategory.Error, key: "Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2_2493", message: "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'." }, Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { code: 2494, category: ts.DiagnosticCategory.Error, key: "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494", message: "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher." }, Type_0_is_not_an_array_type_or_a_string_type: { code: 2495, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_or_a_string_type_2495", message: "Type '{0}' is not an array type or a string type." }, @@ -2814,6 +2834,7 @@ var ts; A_rest_element_cannot_contain_a_binding_pattern: { code: 2501, category: ts.DiagnosticCategory.Error, key: "A_rest_element_cannot_contain_a_binding_pattern_2501", message: "A rest element cannot contain a binding pattern." }, _0_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 2502, category: ts.DiagnosticCategory.Error, key: "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502", message: "'{0}' is referenced directly or indirectly in its own type annotation." }, Cannot_find_namespace_0: { code: 2503, category: ts.DiagnosticCategory.Error, key: "Cannot_find_namespace_0_2503", message: "Cannot find namespace '{0}'." }, + Type_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator: { code: 2504, category: ts.DiagnosticCategory.Error, key: "Type_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504", message: "Type must have a '[Symbol.asyncIterator]()' method that returns an async iterator." }, A_generator_cannot_have_a_void_type_annotation: { code: 2505, category: ts.DiagnosticCategory.Error, key: "A_generator_cannot_have_a_void_type_annotation_2505", message: "A generator cannot have a 'void' type annotation." }, _0_is_referenced_directly_or_indirectly_in_its_own_base_expression: { code: 2506, category: ts.DiagnosticCategory.Error, key: "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506", message: "'{0}' is referenced directly or indirectly in its own base expression." }, Type_0_is_not_a_constructor_function_type: { code: 2507, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_a_constructor_function_type_2507", message: "Type '{0}' is not a constructor function type." }, @@ -2828,6 +2849,7 @@ var ts; All_declarations_of_an_abstract_method_must_be_consecutive: { code: 2516, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_an_abstract_method_must_be_consecutive_2516", message: "All declarations of an abstract method must be consecutive." }, Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: { code: 2517, category: ts.DiagnosticCategory.Error, key: "Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517", message: "Cannot assign an abstract constructor type to a non-abstract constructor type." }, A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: { code: 2518, category: ts.DiagnosticCategory.Error, key: "A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518", message: "A 'this'-based type guard is not compatible with a parameter-based type guard." }, + An_async_iterator_must_have_a_next_method: { code: 2519, category: ts.DiagnosticCategory.Error, key: "An_async_iterator_must_have_a_next_method_2519", message: "An async iterator must have a 'next()' method." }, Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: { code: 2520, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520", message: "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions." }, Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: { code: 2521, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions_2521", message: "Expression resolves to variable declaration '{0}' that compiler uses to support async functions." }, The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method: { code: 2522, category: ts.DiagnosticCategory.Error, key: "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522", message: "The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method." }, @@ -2851,23 +2873,33 @@ var ts; Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property: { code: 2540, category: ts.DiagnosticCategory.Error, key: "Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property_2540", message: "Cannot assign to '{0}' because it is a constant or a read-only property." }, The_target_of_an_assignment_must_be_a_variable_or_a_property_access: { code: 2541, category: ts.DiagnosticCategory.Error, key: "The_target_of_an_assignment_must_be_a_variable_or_a_property_access_2541", message: "The target of an assignment must be a variable or a property access." }, Index_signature_in_type_0_only_permits_reading: { code: 2542, category: ts.DiagnosticCategory.Error, key: "Index_signature_in_type_0_only_permits_reading_2542", message: "Index signature in type '{0}' only permits reading." }, + Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference: { code: 2543, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543", message: "Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference." }, + Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference: { code: 2544, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544", message: "Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference." }, + A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any: { code: 2545, category: ts.DiagnosticCategory.Error, key: "A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545", message: "A mixin class must have a constructor with a single rest parameter of type 'any[]'." }, + Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1: { code: 2546, category: ts.DiagnosticCategory.Error, key: "Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1_2546", message: "Property '{0}' has conflicting declarations and is inaccessible in type '{1}'." }, + The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property: { code: 2547, category: ts.DiagnosticCategory.Error, key: "The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value__2547", message: "The type returned by the 'next()' method of an async iterator must be a promise for a type with a 'value' property." }, + Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2548, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548", message: "Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator." }, + Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2549, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549", message: "Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator." }, + Generic_type_instantiation_is_excessively_deep_and_possibly_infinite: { code: 2550, category: ts.DiagnosticCategory.Error, key: "Generic_type_instantiation_is_excessively_deep_and_possibly_infinite_2550", message: "Generic type instantiation is excessively deep and possibly infinite." }, JSX_element_attributes_type_0_may_not_be_a_union_type: { code: 2600, category: ts.DiagnosticCategory.Error, key: "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", message: "JSX element attributes type '{0}' may not be a union type." }, The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: { code: 2601, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", message: "The return type of a JSX element constructor must return an object type." }, JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: { code: 2602, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", message: "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist." }, - Property_0_in_type_1_is_not_assignable_to_type_2: { code: 2603, category: ts.DiagnosticCategory.Error, key: "Property_0_in_type_1_is_not_assignable_to_type_2_2603", message: "Property '{0}' in type '{1}' is not assignable to type '{2}'" }, + Property_0_in_type_1_is_not_assignable_to_type_2: { code: 2603, category: ts.DiagnosticCategory.Error, key: "Property_0_in_type_1_is_not_assignable_to_type_2_2603", message: "Property '{0}' in type '{1}' is not assignable to type '{2}'." }, JSX_element_type_0_does_not_have_any_construct_or_call_signatures: { code: 2604, category: ts.DiagnosticCategory.Error, key: "JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604", message: "JSX element type '{0}' does not have any construct or call signatures." }, JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements: { code: 2605, category: ts.DiagnosticCategory.Error, key: "JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements_2605", message: "JSX element type '{0}' is not a constructor function for JSX elements." }, Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property: { code: 2606, category: ts.DiagnosticCategory.Error, key: "Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606", message: "Property '{0}' of JSX spread attribute is not assignable to target property." }, - JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property: { code: 2607, category: ts.DiagnosticCategory.Error, key: "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607", message: "JSX element class does not support attributes because it does not have a '{0}' property" }, - The_global_type_JSX_0_may_not_have_more_than_one_property: { code: 2608, category: ts.DiagnosticCategory.Error, key: "The_global_type_JSX_0_may_not_have_more_than_one_property_2608", message: "The global type 'JSX.{0}' may not have more than one property" }, - Cannot_emit_namespaced_JSX_elements_in_React: { code: 2650, category: ts.DiagnosticCategory.Error, key: "Cannot_emit_namespaced_JSX_elements_in_React_2650", message: "Cannot emit namespaced JSX elements in React" }, + JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property: { code: 2607, category: ts.DiagnosticCategory.Error, key: "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607", message: "JSX element class does not support attributes because it does not have a '{0}' property." }, + The_global_type_JSX_0_may_not_have_more_than_one_property: { code: 2608, category: ts.DiagnosticCategory.Error, key: "The_global_type_JSX_0_may_not_have_more_than_one_property_2608", message: "The global type 'JSX.{0}' may not have more than one property." }, + JSX_spread_child_must_be_an_array_type: { code: 2609, category: ts.DiagnosticCategory.Error, key: "JSX_spread_child_must_be_an_array_type_2609", message: "JSX spread child must be an array type." }, + Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: { code: 2649, category: ts.DiagnosticCategory.Error, key: "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", message: "Cannot augment module '{0}' with value exports because it resolves to a non-module entity." }, + Cannot_emit_namespaced_JSX_elements_in_React: { code: 2650, category: ts.DiagnosticCategory.Error, key: "Cannot_emit_namespaced_JSX_elements_in_React_2650", message: "Cannot emit namespaced JSX elements in React." }, A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: { code: 2651, category: ts.DiagnosticCategory.Error, key: "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", message: "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums." }, Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: { code: 2652, category: ts.DiagnosticCategory.Error, key: "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", message: "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead." }, Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1: { code: 2653, category: ts.DiagnosticCategory.Error, key: "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653", message: "Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'." }, Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_package_author_to_update_the_package_definition: { code: 2654, category: ts.DiagnosticCategory.Error, key: "Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_pack_2654", message: "Exported external package typings file cannot contain tripleslash references. Please contact the package author to update the package definition." }, Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition: { code: 2656, category: ts.DiagnosticCategory.Error, key: "Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_2656", message: "Exported external package typings file '{0}' is not a module. Please contact the package author to update the package definition." }, - JSX_expressions_must_have_one_parent_element: { code: 2657, category: ts.DiagnosticCategory.Error, key: "JSX_expressions_must_have_one_parent_element_2657", message: "JSX expressions must have one parent element" }, - Type_0_provides_no_match_for_the_signature_1: { code: 2658, category: ts.DiagnosticCategory.Error, key: "Type_0_provides_no_match_for_the_signature_1_2658", message: "Type '{0}' provides no match for the signature '{1}'" }, + JSX_expressions_must_have_one_parent_element: { code: 2657, category: ts.DiagnosticCategory.Error, key: "JSX_expressions_must_have_one_parent_element_2657", message: "JSX expressions must have one parent element." }, + Type_0_provides_no_match_for_the_signature_1: { code: 2658, category: ts.DiagnosticCategory.Error, key: "Type_0_provides_no_match_for_the_signature_1_2658", message: "Type '{0}' provides no match for the signature '{1}'." }, super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: { code: 2659, category: ts.DiagnosticCategory.Error, key: "super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659", message: "'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher." }, super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: { code: 2660, category: ts.DiagnosticCategory.Error, key: "super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660", message: "'super' can only be referenced in members of derived classes or object literal expressions." }, Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module: { code: 2661, category: ts.DiagnosticCategory.Error, key: "Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661", message: "Cannot export '{0}'. Only local declarations can be exported from a module." }, @@ -2899,7 +2931,6 @@ var ts; All_declarations_of_0_must_have_identical_modifiers: { code: 2687, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_0_must_have_identical_modifiers_2687", message: "All declarations of '{0}' must have identical modifiers." }, Cannot_find_type_definition_file_for_0: { code: 2688, category: ts.DiagnosticCategory.Error, key: "Cannot_find_type_definition_file_for_0_2688", message: "Cannot find type definition file for '{0}'." }, Cannot_extend_an_interface_0_Did_you_mean_implements: { code: 2689, category: ts.DiagnosticCategory.Error, key: "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", message: "Cannot extend an interface '{0}'. Did you mean 'implements'?" }, - A_class_must_be_declared_after_its_base_class: { code: 2690, category: ts.DiagnosticCategory.Error, key: "A_class_must_be_declared_after_its_base_class_2690", message: "A class must be declared after its base class." }, An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: { code: 2691, category: ts.DiagnosticCategory.Error, key: "An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691", message: "An import path cannot end with a '{0}' extension. Consider importing '{1}' instead." }, _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: { code: 2692, category: ts.DiagnosticCategory.Error, key: "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", message: "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible." }, _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: { code: 2693, category: ts.DiagnosticCategory.Error, key: "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", message: "'{0}' only refers to a type, but is being used as a value here." }, @@ -2908,9 +2939,17 @@ var ts; The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead: { code: 2696, category: ts.DiagnosticCategory.Error, key: "The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696", message: "The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?" }, An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: { code: 2697, category: ts.DiagnosticCategory.Error, key: "An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697", message: "An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your `--lib` option." }, Spread_types_may_only_be_created_from_object_types: { code: 2698, category: ts.DiagnosticCategory.Error, key: "Spread_types_may_only_be_created_from_object_types_2698", message: "Spread types may only be created from object types." }, + Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1: { code: 2699, category: ts.DiagnosticCategory.Error, key: "Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699", message: "Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'." }, Rest_types_may_only_be_created_from_object_types: { code: 2700, category: ts.DiagnosticCategory.Error, key: "Rest_types_may_only_be_created_from_object_types_2700", message: "Rest types may only be created from object types." }, The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access: { code: 2701, category: ts.DiagnosticCategory.Error, key: "The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701", message: "The target of an object rest assignment must be a variable or a property access." }, _0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here: { code: 2702, category: ts.DiagnosticCategory.Error, key: "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702", message: "'{0}' only refers to a type, but is being used as a namespace here." }, + The_operand_of_a_delete_operator_must_be_a_property_reference: { code: 2703, category: ts.DiagnosticCategory.Error, key: "The_operand_of_a_delete_operator_must_be_a_property_reference_2703", message: "The operand of a delete operator must be a property reference." }, + The_operand_of_a_delete_operator_cannot_be_a_read_only_property: { code: 2704, category: ts.DiagnosticCategory.Error, key: "The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704", message: "The operand of a delete operator cannot be a read-only property." }, + An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: { code: 2705, category: ts.DiagnosticCategory.Error, key: "An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705", message: "An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option." }, + Required_type_parameters_may_not_follow_optional_type_parameters: { code: 2706, category: ts.DiagnosticCategory.Error, key: "Required_type_parameters_may_not_follow_optional_type_parameters_2706", message: "Required type parameters may not follow optional type parameters." }, + Generic_type_0_requires_between_1_and_2_type_arguments: { code: 2707, category: ts.DiagnosticCategory.Error, key: "Generic_type_0_requires_between_1_and_2_type_arguments_2707", message: "Generic type '{0}' requires between {1} and {2} type arguments." }, + Cannot_use_namespace_0_as_a_value: { code: 2708, category: ts.DiagnosticCategory.Error, key: "Cannot_use_namespace_0_as_a_value_2708", message: "Cannot use namespace '{0}' as a value." }, + Cannot_use_namespace_0_as_a_type: { code: 2709, category: ts.DiagnosticCategory.Error, key: "Cannot_use_namespace_0_as_a_type_2709", message: "Cannot use namespace '{0}' as a type." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "Import_declaration_0_is_using_private_name_1_4000", message: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", message: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", message: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, @@ -2921,8 +2960,8 @@ var ts; Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014", message: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016", message: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: ts.DiagnosticCategory.Error, key: "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019", message: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: ts.DiagnosticCategory.Error, key: "Extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020", message: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: ts.DiagnosticCategory.Error, key: "Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022", message: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, + extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: ts.DiagnosticCategory.Error, key: "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020", message: "'extends' clause of exported class '{0}' has or is using private name '{1}'." }, + extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: ts.DiagnosticCategory.Error, key: "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022", message: "'extends' clause of exported interface '{0}' has or is using private name '{1}'." }, Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: ts.DiagnosticCategory.Error, key: "Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023", message: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: ts.DiagnosticCategory.Error, key: "Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024", message: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: ts.DiagnosticCategory.Error, key: "Exported_variable_0_has_or_is_using_private_name_1_4025", message: "Exported variable '{0}' has or is using private name '{1}'." }, @@ -2983,16 +3022,18 @@ var ts; Default_export_of_the_module_has_or_is_using_private_name_0: { code: 4082, category: ts.DiagnosticCategory.Error, key: "Default_export_of_the_module_has_or_is_using_private_name_0_4082", message: "Default export of the module has or is using private name '{0}'." }, Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: { code: 4083, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", message: "Type parameter '{0}' of exported type alias has or is using private name '{1}'." }, Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: { code: 4090, category: ts.DiagnosticCategory.Message, key: "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", message: "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict." }, + Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4091, category: ts.DiagnosticCategory.Error, key: "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", message: "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4092, category: ts.DiagnosticCategory.Error, key: "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", message: "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'." }, + extends_clause_of_exported_class_0_refers_to_a_type_whose_name_cannot_be_referenced: { code: 4093, category: ts.DiagnosticCategory.Error, key: "extends_clause_of_exported_class_0_refers_to_a_type_whose_name_cannot_be_referenced_4093", message: "'extends' clause of exported class '{0}' refers to a type whose name cannot be referenced." }, The_current_host_does_not_support_the_0_option: { code: 5001, category: ts.DiagnosticCategory.Error, key: "The_current_host_does_not_support_the_0_option_5001", message: "The current host does not support the '{0}' option." }, Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: ts.DiagnosticCategory.Error, key: "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", message: "Cannot find the common subdirectory path for the input files." }, File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: { code: 5010, category: ts.DiagnosticCategory.Error, key: "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", message: "File specification cannot end in a recursive directory wildcard ('**'): '{0}'." }, File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0: { code: 5011, category: ts.DiagnosticCategory.Error, key: "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011", message: "File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'." }, - Cannot_read_file_0_Colon_1: { code: 5012, category: ts.DiagnosticCategory.Error, key: "Cannot_read_file_0_Colon_1_5012", message: "Cannot read file '{0}': {1}" }, - Unsupported_file_encoding: { code: 5013, category: ts.DiagnosticCategory.Error, key: "Unsupported_file_encoding_5013", message: "Unsupported file encoding." }, + Cannot_read_file_0_Colon_1: { code: 5012, category: ts.DiagnosticCategory.Error, key: "Cannot_read_file_0_Colon_1_5012", message: "Cannot read file '{0}': {1}." }, Failed_to_parse_file_0_Colon_1: { code: 5014, category: ts.DiagnosticCategory.Error, key: "Failed_to_parse_file_0_Colon_1_5014", message: "Failed to parse file '{0}': {1}." }, Unknown_compiler_option_0: { code: 5023, category: ts.DiagnosticCategory.Error, key: "Unknown_compiler_option_0_5023", message: "Unknown compiler option '{0}'." }, Compiler_option_0_requires_a_value_of_type_1: { code: 5024, category: ts.DiagnosticCategory.Error, key: "Compiler_option_0_requires_a_value_of_type_1_5024", message: "Compiler option '{0}' requires a value of type {1}." }, - Could_not_write_file_0_Colon_1: { code: 5033, category: ts.DiagnosticCategory.Error, key: "Could_not_write_file_0_Colon_1_5033", message: "Could not write file '{0}': {1}" }, + Could_not_write_file_0_Colon_1: { code: 5033, category: ts.DiagnosticCategory.Error, key: "Could_not_write_file_0_Colon_1_5033", message: "Could not write file '{0}': {1}." }, Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: ts.DiagnosticCategory.Error, key: "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042", message: "Option 'project' cannot be mixed with source files on a command line." }, Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher: { code: 5047, category: ts.DiagnosticCategory.Error, key: "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047", message: "Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher." }, Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: { code: 5051, category: ts.DiagnosticCategory.Error, key: "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051", message: "Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided." }, @@ -3001,12 +3042,12 @@ var ts; A_tsconfig_json_file_is_already_defined_at_Colon_0: { code: 5054, category: ts.DiagnosticCategory.Error, key: "A_tsconfig_json_file_is_already_defined_at_Colon_0_5054", message: "A 'tsconfig.json' file is already defined at: '{0}'." }, Cannot_write_file_0_because_it_would_overwrite_input_file: { code: 5055, category: ts.DiagnosticCategory.Error, key: "Cannot_write_file_0_because_it_would_overwrite_input_file_5055", message: "Cannot write file '{0}' because it would overwrite input file." }, Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files: { code: 5056, category: ts.DiagnosticCategory.Error, key: "Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056", message: "Cannot write file '{0}' because it would be overwritten by multiple input files." }, - Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: { code: 5057, category: ts.DiagnosticCategory.Error, key: "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", message: "Cannot find a tsconfig.json file at the specified directory: '{0}'" }, - The_specified_path_does_not_exist_Colon_0: { code: 5058, category: ts.DiagnosticCategory.Error, key: "The_specified_path_does_not_exist_Colon_0_5058", message: "The specified path does not exist: '{0}'" }, + Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: { code: 5057, category: ts.DiagnosticCategory.Error, key: "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", message: "Cannot find a tsconfig.json file at the specified directory: '{0}'." }, + The_specified_path_does_not_exist_Colon_0: { code: 5058, category: ts.DiagnosticCategory.Error, key: "The_specified_path_does_not_exist_Colon_0_5058", message: "The specified path does not exist: '{0}'." }, Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: { code: 5059, category: ts.DiagnosticCategory.Error, key: "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", message: "Invalid value for '--reactNamespace'. '{0}' is not a valid identifier." }, Option_paths_cannot_be_used_without_specifying_baseUrl_option: { code: 5060, category: ts.DiagnosticCategory.Error, key: "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060", message: "Option 'paths' cannot be used without specifying '--baseUrl' option." }, - Pattern_0_can_have_at_most_one_Asterisk_character: { code: 5061, category: ts.DiagnosticCategory.Error, key: "Pattern_0_can_have_at_most_one_Asterisk_character_5061", message: "Pattern '{0}' can have at most one '*' character" }, - Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character: { code: 5062, category: ts.DiagnosticCategory.Error, key: "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062", message: "Substitution '{0}' in pattern '{1}' in can have at most one '*' character" }, + Pattern_0_can_have_at_most_one_Asterisk_character: { code: 5061, category: ts.DiagnosticCategory.Error, key: "Pattern_0_can_have_at_most_one_Asterisk_character_5061", message: "Pattern '{0}' can have at most one '*' character." }, + Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character: { code: 5062, category: ts.DiagnosticCategory.Error, key: "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062", message: "Substitution '{0}' in pattern '{1}' in can have at most one '*' character." }, Substitutions_for_pattern_0_should_be_an_array: { code: 5063, category: ts.DiagnosticCategory.Error, key: "Substitutions_for_pattern_0_should_be_an_array_5063", message: "Substitutions for pattern '{0}' should be an array." }, Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2: { code: 5064, category: ts.DiagnosticCategory.Error, key: "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064", message: "Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'." }, File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: { code: 5065, category: ts.DiagnosticCategory.Error, key: "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065", message: "File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'." }, @@ -3024,11 +3065,11 @@ var ts; Do_not_emit_outputs: { code: 6010, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_outputs_6010", message: "Do not emit outputs." }, Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: { code: 6011, category: ts.DiagnosticCategory.Message, key: "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", message: "Allow default imports from modules with no default export. This does not affect code emit, just typechecking." }, Skip_type_checking_of_declaration_files: { code: 6012, category: ts.DiagnosticCategory.Message, key: "Skip_type_checking_of_declaration_files_6012", message: "Skip type checking of declaration files." }, - Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015_6015", message: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES2015'" }, - Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015_6016", message: "Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'" }, + Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015", message: "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'." }, + Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015_6016", message: "Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'." }, Print_this_message: { code: 6017, category: ts.DiagnosticCategory.Message, key: "Print_this_message_6017", message: "Print this message." }, Print_the_compiler_s_version: { code: 6019, category: ts.DiagnosticCategory.Message, key: "Print_the_compiler_s_version_6019", message: "Print the compiler's version." }, - Compile_the_project_in_the_given_directory: { code: 6020, category: ts.DiagnosticCategory.Message, key: "Compile_the_project_in_the_given_directory_6020", message: "Compile the project in the given directory." }, + Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json: { code: 6020, category: ts.DiagnosticCategory.Message, key: "Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020", message: "Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'." }, Syntax_Colon_0: { code: 6023, category: ts.DiagnosticCategory.Message, key: "Syntax_Colon_0_6023", message: "Syntax: {0}" }, options: { code: 6024, category: ts.DiagnosticCategory.Message, key: "options_6024", message: "options" }, file: { code: 6025, category: ts.DiagnosticCategory.Message, key: "file_6025", message: "file" }, @@ -3043,11 +3084,12 @@ var ts; LOCATION: { code: 6037, category: ts.DiagnosticCategory.Message, key: "LOCATION_6037", message: "LOCATION" }, DIRECTORY: { code: 6038, category: ts.DiagnosticCategory.Message, key: "DIRECTORY_6038", message: "DIRECTORY" }, STRATEGY: { code: 6039, category: ts.DiagnosticCategory.Message, key: "STRATEGY_6039", message: "STRATEGY" }, + FILE_OR_DIRECTORY: { code: 6040, category: ts.DiagnosticCategory.Message, key: "FILE_OR_DIRECTORY_6040", message: "FILE OR DIRECTORY" }, Compilation_complete_Watching_for_file_changes: { code: 6042, category: ts.DiagnosticCategory.Message, key: "Compilation_complete_Watching_for_file_changes_6042", message: "Compilation complete. Watching for file changes." }, Generates_corresponding_map_file: { code: 6043, category: ts.DiagnosticCategory.Message, key: "Generates_corresponding_map_file_6043", message: "Generates corresponding '.map' file." }, Compiler_option_0_expects_an_argument: { code: 6044, category: ts.DiagnosticCategory.Error, key: "Compiler_option_0_expects_an_argument_6044", message: "Compiler option '{0}' expects an argument." }, Unterminated_quoted_string_in_response_file_0: { code: 6045, category: ts.DiagnosticCategory.Error, key: "Unterminated_quoted_string_in_response_file_0_6045", message: "Unterminated quoted string in response file '{0}'." }, - Argument_for_0_option_must_be_Colon_1: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument_for_0_option_must_be_Colon_1_6046", message: "Argument for '{0}' option must be: {1}" }, + Argument_for_0_option_must_be_Colon_1: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument_for_0_option_must_be_Colon_1_6046", message: "Argument for '{0}' option must be: {1}." }, Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: ts.DiagnosticCategory.Error, key: "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048", message: "Locale must be of the form or -. For example '{0}' or '{1}'." }, Unsupported_locale_0: { code: 6049, category: ts.DiagnosticCategory.Error, key: "Unsupported_locale_0_6049", message: "Unsupported locale '{0}'." }, Unable_to_open_file_0: { code: 6050, category: ts.DiagnosticCategory.Error, key: "Unable_to_open_file_0_6050", message: "Unable to open file '{0}'." }, @@ -3069,17 +3111,18 @@ var ts; Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file: { code: 6070, category: ts.DiagnosticCategory.Message, key: "Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070", message: "Initializes a TypeScript project and creates a tsconfig.json file." }, Successfully_created_a_tsconfig_json_file: { code: 6071, category: ts.DiagnosticCategory.Message, key: "Successfully_created_a_tsconfig_json_file_6071", message: "Successfully created a tsconfig.json file." }, Suppress_excess_property_checks_for_object_literals: { code: 6072, category: ts.DiagnosticCategory.Message, key: "Suppress_excess_property_checks_for_object_literals_6072", message: "Suppress excess property checks for object literals." }, - Stylize_errors_and_messages_using_color_and_context_experimental: { code: 6073, category: ts.DiagnosticCategory.Message, key: "Stylize_errors_and_messages_using_color_and_context_experimental_6073", message: "Stylize errors and messages using color and context. (experimental)" }, + Stylize_errors_and_messages_using_color_and_context_experimental: { code: 6073, category: ts.DiagnosticCategory.Message, key: "Stylize_errors_and_messages_using_color_and_context_experimental_6073", message: "Stylize errors and messages using color and context (experimental)." }, Do_not_report_errors_on_unused_labels: { code: 6074, category: ts.DiagnosticCategory.Message, key: "Do_not_report_errors_on_unused_labels_6074", message: "Do not report errors on unused labels." }, Report_error_when_not_all_code_paths_in_function_return_a_value: { code: 6075, category: ts.DiagnosticCategory.Message, key: "Report_error_when_not_all_code_paths_in_function_return_a_value_6075", message: "Report error when not all code paths in function return a value." }, Report_errors_for_fallthrough_cases_in_switch_statement: { code: 6076, category: ts.DiagnosticCategory.Message, key: "Report_errors_for_fallthrough_cases_in_switch_statement_6076", message: "Report errors for fallthrough cases in switch statement." }, Do_not_report_errors_on_unreachable_code: { code: 6077, category: ts.DiagnosticCategory.Message, key: "Do_not_report_errors_on_unreachable_code_6077", message: "Do not report errors on unreachable code." }, Disallow_inconsistently_cased_references_to_the_same_file: { code: 6078, category: ts.DiagnosticCategory.Message, key: "Disallow_inconsistently_cased_references_to_the_same_file_6078", message: "Disallow inconsistently-cased references to the same file." }, Specify_library_files_to_be_included_in_the_compilation_Colon: { code: 6079, category: ts.DiagnosticCategory.Message, key: "Specify_library_files_to_be_included_in_the_compilation_Colon_6079", message: "Specify library files to be included in the compilation: " }, - Specify_JSX_code_generation_Colon_preserve_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify_JSX_code_generation_Colon_preserve_or_react_6080", message: "Specify JSX code generation: 'preserve' or 'react'" }, + Specify_JSX_code_generation_Colon_preserve_react_native_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080", message: "Specify JSX code generation: 'preserve', 'react-native', or 'react'." }, + File_0_has_an_unsupported_extension_so_skipping_it: { code: 6081, category: ts.DiagnosticCategory.Message, key: "File_0_has_an_unsupported_extension_so_skipping_it_6081", message: "File '{0}' has an unsupported extension, so skipping it." }, Only_amd_and_system_modules_are_supported_alongside_0: { code: 6082, category: ts.DiagnosticCategory.Error, key: "Only_amd_and_system_modules_are_supported_alongside_0_6082", message: "Only 'amd' and 'system' modules are supported alongside --{0}." }, Base_directory_to_resolve_non_absolute_module_names: { code: 6083, category: ts.DiagnosticCategory.Message, key: "Base_directory_to_resolve_non_absolute_module_names_6083", message: "Base directory to resolve non-absolute module names." }, - Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit: { code: 6084, category: ts.DiagnosticCategory.Message, key: "Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit_6084", message: "Specify the object invoked for createElement and __spread when targeting 'react' JSX emit" }, + Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit: { code: 6084, category: ts.DiagnosticCategory.Message, key: "Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084", message: "[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit" }, Enable_tracing_of_the_name_resolution_process: { code: 6085, category: ts.DiagnosticCategory.Message, key: "Enable_tracing_of_the_name_resolution_process_6085", message: "Enable tracing of the name resolution process." }, Resolving_module_0_from_1: { code: 6086, category: ts.DiagnosticCategory.Message, key: "Resolving_module_0_from_1_6086", message: "======== Resolving module '{0}' from '{1}'. ========" }, Explicitly_specified_module_resolution_kind_Colon_0: { code: 6087, category: ts.DiagnosticCategory.Message, key: "Explicitly_specified_module_resolution_kind_Colon_0_6087", message: "Explicitly specified module resolution kind: '{0}'." }, @@ -3090,23 +3133,23 @@ var ts; Module_name_0_matched_pattern_1: { code: 6092, category: ts.DiagnosticCategory.Message, key: "Module_name_0_matched_pattern_1_6092", message: "Module name '{0}', matched pattern '{1}'." }, Trying_substitution_0_candidate_module_location_Colon_1: { code: 6093, category: ts.DiagnosticCategory.Message, key: "Trying_substitution_0_candidate_module_location_Colon_1_6093", message: "Trying substitution '{0}', candidate module location: '{1}'." }, Resolving_module_name_0_relative_to_base_url_1_2: { code: 6094, category: ts.DiagnosticCategory.Message, key: "Resolving_module_name_0_relative_to_base_url_1_2_6094", message: "Resolving module name '{0}' relative to base url '{1}' - '{2}'." }, - Loading_module_as_file_Slash_folder_candidate_module_location_0: { code: 6095, category: ts.DiagnosticCategory.Message, key: "Loading_module_as_file_Slash_folder_candidate_module_location_0_6095", message: "Loading module as file / folder, candidate module location '{0}'." }, + Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1: { code: 6095, category: ts.DiagnosticCategory.Message, key: "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1_6095", message: "Loading module as file / folder, candidate module location '{0}', target file type '{1}'." }, File_0_does_not_exist: { code: 6096, category: ts.DiagnosticCategory.Message, key: "File_0_does_not_exist_6096", message: "File '{0}' does not exist." }, File_0_exist_use_it_as_a_name_resolution_result: { code: 6097, category: ts.DiagnosticCategory.Message, key: "File_0_exist_use_it_as_a_name_resolution_result_6097", message: "File '{0}' exist - use it as a name resolution result." }, - Loading_module_0_from_node_modules_folder: { code: 6098, category: ts.DiagnosticCategory.Message, key: "Loading_module_0_from_node_modules_folder_6098", message: "Loading module '{0}' from 'node_modules' folder." }, + Loading_module_0_from_node_modules_folder_target_file_type_1: { code: 6098, category: ts.DiagnosticCategory.Message, key: "Loading_module_0_from_node_modules_folder_target_file_type_1_6098", message: "Loading module '{0}' from 'node_modules' folder, target file type '{1}'." }, Found_package_json_at_0: { code: 6099, category: ts.DiagnosticCategory.Message, key: "Found_package_json_at_0_6099", message: "Found 'package.json' at '{0}'." }, - package_json_does_not_have_a_types_or_main_field: { code: 6100, category: ts.DiagnosticCategory.Message, key: "package_json_does_not_have_a_types_or_main_field_6100", message: "'package.json' does not have a 'types' or 'main' field." }, + package_json_does_not_have_a_0_field: { code: 6100, category: ts.DiagnosticCategory.Message, key: "package_json_does_not_have_a_0_field_6100", message: "'package.json' does not have a '{0}' field." }, package_json_has_0_field_1_that_references_2: { code: 6101, category: ts.DiagnosticCategory.Message, key: "package_json_has_0_field_1_that_references_2_6101", message: "'package.json' has '{0}' field '{1}' that references '{2}'." }, Allow_javascript_files_to_be_compiled: { code: 6102, category: ts.DiagnosticCategory.Message, key: "Allow_javascript_files_to_be_compiled_6102", message: "Allow javascript files to be compiled." }, Option_0_should_have_array_of_strings_as_a_value: { code: 6103, category: ts.DiagnosticCategory.Error, key: "Option_0_should_have_array_of_strings_as_a_value_6103", message: "Option '{0}' should have array of strings as a value." }, Checking_if_0_is_the_longest_matching_prefix_for_1_2: { code: 6104, category: ts.DiagnosticCategory.Message, key: "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104", message: "Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'." }, Expected_type_of_0_field_in_package_json_to_be_string_got_1: { code: 6105, category: ts.DiagnosticCategory.Message, key: "Expected_type_of_0_field_in_package_json_to_be_string_got_1_6105", message: "Expected type of '{0}' field in 'package.json' to be 'string', got '{1}'." }, - baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1: { code: 6106, category: ts.DiagnosticCategory.Message, key: "baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106", message: "'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'" }, - rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0: { code: 6107, category: ts.DiagnosticCategory.Message, key: "rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107", message: "'rootDirs' option is set, using it to resolve relative module name '{0}'" }, - Longest_matching_prefix_for_0_is_1: { code: 6108, category: ts.DiagnosticCategory.Message, key: "Longest_matching_prefix_for_0_is_1_6108", message: "Longest matching prefix for '{0}' is '{1}'" }, - Loading_0_from_the_root_dir_1_candidate_location_2: { code: 6109, category: ts.DiagnosticCategory.Message, key: "Loading_0_from_the_root_dir_1_candidate_location_2_6109", message: "Loading '{0}' from the root dir '{1}', candidate location '{2}'" }, - Trying_other_entries_in_rootDirs: { code: 6110, category: ts.DiagnosticCategory.Message, key: "Trying_other_entries_in_rootDirs_6110", message: "Trying other entries in 'rootDirs'" }, - Module_resolution_using_rootDirs_has_failed: { code: 6111, category: ts.DiagnosticCategory.Message, key: "Module_resolution_using_rootDirs_has_failed_6111", message: "Module resolution using 'rootDirs' has failed" }, + baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1: { code: 6106, category: ts.DiagnosticCategory.Message, key: "baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106", message: "'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'." }, + rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0: { code: 6107, category: ts.DiagnosticCategory.Message, key: "rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107", message: "'rootDirs' option is set, using it to resolve relative module name '{0}'." }, + Longest_matching_prefix_for_0_is_1: { code: 6108, category: ts.DiagnosticCategory.Message, key: "Longest_matching_prefix_for_0_is_1_6108", message: "Longest matching prefix for '{0}' is '{1}'." }, + Loading_0_from_the_root_dir_1_candidate_location_2: { code: 6109, category: ts.DiagnosticCategory.Message, key: "Loading_0_from_the_root_dir_1_candidate_location_2_6109", message: "Loading '{0}' from the root dir '{1}', candidate location '{2}'." }, + Trying_other_entries_in_rootDirs: { code: 6110, category: ts.DiagnosticCategory.Message, key: "Trying_other_entries_in_rootDirs_6110", message: "Trying other entries in 'rootDirs'." }, + Module_resolution_using_rootDirs_has_failed: { code: 6111, category: ts.DiagnosticCategory.Message, key: "Module_resolution_using_rootDirs_has_failed_6111", message: "Module resolution using 'rootDirs' has failed." }, Do_not_emit_use_strict_directives_in_module_output: { code: 6112, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_use_strict_directives_in_module_output_6112", message: "Do not emit 'use strict' directives in module output." }, Enable_strict_null_checks: { code: 6113, category: ts.DiagnosticCategory.Message, key: "Enable_strict_null_checks_6113", message: "Enable strict null checks." }, Unknown_option_excludes_Did_you_mean_exclude: { code: 6114, category: ts.DiagnosticCategory.Error, key: "Unknown_option_excludes_Did_you_mean_exclude_6114", message: "Unknown option 'excludes'. Did you mean 'exclude'?" }, @@ -3116,32 +3159,67 @@ var ts; Resolving_from_node_modules_folder: { code: 6118, category: ts.DiagnosticCategory.Message, key: "Resolving_from_node_modules_folder_6118", message: "Resolving from node_modules folder..." }, Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2: { code: 6119, category: ts.DiagnosticCategory.Message, key: "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119", message: "======== Type reference directive '{0}' was successfully resolved to '{1}', primary: {2}. ========" }, Type_reference_directive_0_was_not_resolved: { code: 6120, category: ts.DiagnosticCategory.Message, key: "Type_reference_directive_0_was_not_resolved_6120", message: "======== Type reference directive '{0}' was not resolved. ========" }, - Resolving_with_primary_search_path_0: { code: 6121, category: ts.DiagnosticCategory.Message, key: "Resolving_with_primary_search_path_0_6121", message: "Resolving with primary search path '{0}'" }, + Resolving_with_primary_search_path_0: { code: 6121, category: ts.DiagnosticCategory.Message, key: "Resolving_with_primary_search_path_0_6121", message: "Resolving with primary search path '{0}'." }, Root_directory_cannot_be_determined_skipping_primary_search_paths: { code: 6122, category: ts.DiagnosticCategory.Message, key: "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122", message: "Root directory cannot be determined, skipping primary search paths." }, Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set: { code: 6123, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123", message: "======== Resolving type reference directive '{0}', containing file '{1}', root directory not set. ========" }, Type_declaration_files_to_be_included_in_compilation: { code: 6124, category: ts.DiagnosticCategory.Message, key: "Type_declaration_files_to_be_included_in_compilation_6124", message: "Type declaration files to be included in compilation." }, - Looking_up_in_node_modules_folder_initial_location_0: { code: 6125, category: ts.DiagnosticCategory.Message, key: "Looking_up_in_node_modules_folder_initial_location_0_6125", message: "Looking up in 'node_modules' folder, initial location '{0}'" }, + Looking_up_in_node_modules_folder_initial_location_0: { code: 6125, category: ts.DiagnosticCategory.Message, key: "Looking_up_in_node_modules_folder_initial_location_0_6125", message: "Looking up in 'node_modules' folder, initial location '{0}'." }, Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder: { code: 6126, category: ts.DiagnosticCategory.Message, key: "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126", message: "Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder." }, Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1: { code: 6127, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127", message: "======== Resolving type reference directive '{0}', containing file not set, root directory '{1}'. ========" }, Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set: { code: 6128, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128", message: "======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========" }, The_config_file_0_found_doesn_t_contain_any_source_files: { code: 6129, category: ts.DiagnosticCategory.Error, key: "The_config_file_0_found_doesn_t_contain_any_source_files_6129", message: "The config file '{0}' found doesn't contain any source files." }, - Resolving_real_path_for_0_result_1: { code: 6130, category: ts.DiagnosticCategory.Message, key: "Resolving_real_path_for_0_result_1_6130", message: "Resolving real path for '{0}', result '{1}'" }, + Resolving_real_path_for_0_result_1: { code: 6130, category: ts.DiagnosticCategory.Message, key: "Resolving_real_path_for_0_result_1_6130", message: "Resolving real path for '{0}', result '{1}'." }, Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system: { code: 6131, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131", message: "Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'." }, - File_name_0_has_a_1_extension_stripping_it: { code: 6132, category: ts.DiagnosticCategory.Message, key: "File_name_0_has_a_1_extension_stripping_it_6132", message: "File name '{0}' has a '{1}' extension - stripping it" }, + File_name_0_has_a_1_extension_stripping_it: { code: 6132, category: ts.DiagnosticCategory.Message, key: "File_name_0_has_a_1_extension_stripping_it_6132", message: "File name '{0}' has a '{1}' extension - stripping it." }, _0_is_declared_but_never_used: { code: 6133, category: ts.DiagnosticCategory.Error, key: "_0_is_declared_but_never_used_6133", message: "'{0}' is declared but never used." }, Report_errors_on_unused_locals: { code: 6134, category: ts.DiagnosticCategory.Message, key: "Report_errors_on_unused_locals_6134", message: "Report errors on unused locals." }, Report_errors_on_unused_parameters: { code: 6135, category: ts.DiagnosticCategory.Message, key: "Report_errors_on_unused_parameters_6135", message: "Report errors on unused parameters." }, - The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files: { code: 6136, category: ts.DiagnosticCategory.Message, key: "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136", message: "The maximum dependency depth to search under node_modules and load JavaScript files" }, - No_types_specified_in_package_json_so_returning_main_value_of_0: { code: 6137, category: ts.DiagnosticCategory.Message, key: "No_types_specified_in_package_json_so_returning_main_value_of_0_6137", message: "No types specified in 'package.json', so returning 'main' value of '{0}'" }, + The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files: { code: 6136, category: ts.DiagnosticCategory.Message, key: "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136", message: "The maximum dependency depth to search under node_modules and load JavaScript files." }, Property_0_is_declared_but_never_used: { code: 6138, category: ts.DiagnosticCategory.Error, key: "Property_0_is_declared_but_never_used_6138", message: "Property '{0}' is declared but never used." }, Import_emit_helpers_from_tslib: { code: 6139, category: ts.DiagnosticCategory.Message, key: "Import_emit_helpers_from_tslib_6139", message: "Import emit helpers from 'tslib'." }, Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2: { code: 6140, category: ts.DiagnosticCategory.Error, key: "Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140", message: "Auto discovery for typings is enabled in project '{0}'. Running extra resolution pass for module '{1}' using cache location '{2}'." }, - Parse_in_strict_mode_and_emit_use_strict_for_each_source_file: { code: 6141, category: ts.DiagnosticCategory.Message, key: "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141", message: "Parse in strict mode and emit \"use strict\" for each source file" }, + Parse_in_strict_mode_and_emit_use_strict_for_each_source_file: { code: 6141, category: ts.DiagnosticCategory.Message, key: "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141", message: "Parse in strict mode and emit \"use strict\" for each source file." }, Module_0_was_resolved_to_1_but_jsx_is_not_set: { code: 6142, category: ts.DiagnosticCategory.Error, key: "Module_0_was_resolved_to_1_but_jsx_is_not_set_6142", message: "Module '{0}' was resolved to '{1}', but '--jsx' is not set." }, Module_0_was_resolved_to_1_but_allowJs_is_not_set: { code: 6143, category: ts.DiagnosticCategory.Error, key: "Module_0_was_resolved_to_1_but_allowJs_is_not_set_6143", message: "Module '{0}' was resolved to '{1}', but '--allowJs' is not set." }, Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1: { code: 6144, category: ts.DiagnosticCategory.Message, key: "Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144", message: "Module '{0}' was resolved as locally declared ambient module in file '{1}'." }, Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified: { code: 6145, category: ts.DiagnosticCategory.Message, key: "Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified_6145", message: "Module '{0}' was resolved as ambient module declared in '{1}' since this file was not modified." }, Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h: { code: 6146, category: ts.DiagnosticCategory.Message, key: "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146", message: "Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'." }, + Resolution_for_module_0_was_found_in_cache: { code: 6147, category: ts.DiagnosticCategory.Message, key: "Resolution_for_module_0_was_found_in_cache_6147", message: "Resolution for module '{0}' was found in cache." }, + Directory_0_does_not_exist_skipping_all_lookups_in_it: { code: 6148, category: ts.DiagnosticCategory.Message, key: "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148", message: "Directory '{0}' does not exist, skipping all lookups in it." }, + Show_diagnostic_information: { code: 6149, category: ts.DiagnosticCategory.Message, key: "Show_diagnostic_information_6149", message: "Show diagnostic information." }, + Show_verbose_diagnostic_information: { code: 6150, category: ts.DiagnosticCategory.Message, key: "Show_verbose_diagnostic_information_6150", message: "Show verbose diagnostic information." }, + Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file: { code: 6151, category: ts.DiagnosticCategory.Message, key: "Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151", message: "Emit a single file with source maps instead of having a separate file." }, + Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set: { code: 6152, category: ts.DiagnosticCategory.Message, key: "Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152", message: "Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set." }, + Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule: { code: 6153, category: ts.DiagnosticCategory.Message, key: "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153", message: "Transpile each file as a separate module (similar to 'ts.transpileModule')." }, + Print_names_of_generated_files_part_of_the_compilation: { code: 6154, category: ts.DiagnosticCategory.Message, key: "Print_names_of_generated_files_part_of_the_compilation_6154", message: "Print names of generated files part of the compilation." }, + Print_names_of_files_part_of_the_compilation: { code: 6155, category: ts.DiagnosticCategory.Message, key: "Print_names_of_files_part_of_the_compilation_6155", message: "Print names of files part of the compilation." }, + The_locale_used_when_displaying_messages_to_the_user_e_g_en_us: { code: 6156, category: ts.DiagnosticCategory.Message, key: "The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156", message: "The locale used when displaying messages to the user (e.g. 'en-us')" }, + Do_not_generate_custom_helper_functions_like_extends_in_compiled_output: { code: 6157, category: ts.DiagnosticCategory.Message, key: "Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157", message: "Do not generate custom helper functions like '__extends' in compiled output." }, + Do_not_include_the_default_library_file_lib_d_ts: { code: 6158, category: ts.DiagnosticCategory.Message, key: "Do_not_include_the_default_library_file_lib_d_ts_6158", message: "Do not include the default library file (lib.d.ts)." }, + Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files: { code: 6159, category: ts.DiagnosticCategory.Message, key: "Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159", message: "Do not add triple-slash references or imported modules to the list of compiled files." }, + Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files: { code: 6160, category: ts.DiagnosticCategory.Message, key: "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160", message: "[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files." }, + List_of_folders_to_include_type_definitions_from: { code: 6161, category: ts.DiagnosticCategory.Message, key: "List_of_folders_to_include_type_definitions_from_6161", message: "List of folders to include type definitions from." }, + Disable_size_limitations_on_JavaScript_projects: { code: 6162, category: ts.DiagnosticCategory.Message, key: "Disable_size_limitations_on_JavaScript_projects_6162", message: "Disable size limitations on JavaScript projects." }, + The_character_set_of_the_input_files: { code: 6163, category: ts.DiagnosticCategory.Message, key: "The_character_set_of_the_input_files_6163", message: "The character set of the input files." }, + Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files: { code: 6164, category: ts.DiagnosticCategory.Message, key: "Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6164", message: "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files." }, + Do_not_truncate_error_messages: { code: 6165, category: ts.DiagnosticCategory.Message, key: "Do_not_truncate_error_messages_6165", message: "Do not truncate error messages." }, + Output_directory_for_generated_declaration_files: { code: 6166, category: ts.DiagnosticCategory.Message, key: "Output_directory_for_generated_declaration_files_6166", message: "Output directory for generated declaration files." }, + A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl: { code: 6167, category: ts.DiagnosticCategory.Message, key: "A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167", message: "A series of entries which re-map imports to lookup locations relative to the 'baseUrl'." }, + List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime: { code: 6168, category: ts.DiagnosticCategory.Message, key: "List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168", message: "List of root folders whose combined content represents the structure of the project at runtime." }, + Show_all_compiler_options: { code: 6169, category: ts.DiagnosticCategory.Message, key: "Show_all_compiler_options_6169", message: "Show all compiler options." }, + Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file: { code: 6170, category: ts.DiagnosticCategory.Message, key: "Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170", message: "[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file" }, + Command_line_Options: { code: 6171, category: ts.DiagnosticCategory.Message, key: "Command_line_Options_6171", message: "Command-line Options" }, + Basic_Options: { code: 6172, category: ts.DiagnosticCategory.Message, key: "Basic_Options_6172", message: "Basic Options" }, + Strict_Type_Checking_Options: { code: 6173, category: ts.DiagnosticCategory.Message, key: "Strict_Type_Checking_Options_6173", message: "Strict Type-Checking Options" }, + Module_Resolution_Options: { code: 6174, category: ts.DiagnosticCategory.Message, key: "Module_Resolution_Options_6174", message: "Module Resolution Options" }, + Source_Map_Options: { code: 6175, category: ts.DiagnosticCategory.Message, key: "Source_Map_Options_6175", message: "Source Map Options" }, + Additional_Checks: { code: 6176, category: ts.DiagnosticCategory.Message, key: "Additional_Checks_6176", message: "Additional Checks" }, + Experimental_Options: { code: 6177, category: ts.DiagnosticCategory.Message, key: "Experimental_Options_6177", message: "Experimental Options" }, + Advanced_Options: { code: 6178, category: ts.DiagnosticCategory.Message, key: "Advanced_Options_6178", message: "Advanced Options" }, + Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3: { code: 6179, category: ts.DiagnosticCategory.Message, key: "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179", message: "Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'." }, + Enable_all_strict_type_checking_options: { code: 6180, category: ts.DiagnosticCategory.Message, key: "Enable_all_strict_type_checking_options_6180", message: "Enable all strict type-checking options." }, + List_of_language_service_plugins: { code: 6181, category: ts.DiagnosticCategory.Message, key: "List_of_language_service_plugins_6181", message: "List of language service plugins." }, + Scoped_package_detected_looking_in_0: { code: 6182, category: ts.DiagnosticCategory.Message, key: "Scoped_package_detected_looking_in_0_6182", message: "Scoped package detected, looking in '{0}'" }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_an_1_type_7005", message: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter_0_implicitly_has_an_1_type_7006", message: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member_0_implicitly_has_an_1_type_7008", message: "Member '{0}' implicitly has an '{1}' type." }, @@ -3159,7 +3237,7 @@ var ts; _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7023, category: ts.DiagnosticCategory.Error, key: "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023", message: "'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7024, category: ts.DiagnosticCategory.Error, key: "Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024", message: "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type: { code: 7025, category: ts.DiagnosticCategory.Error, key: "Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_typ_7025", message: "Generator implicitly has type '{0}' because it does not yield any values. Consider supplying a return type." }, - JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: { code: 7026, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026", message: "JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists" }, + JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: { code: 7026, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026", message: "JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists." }, Unreachable_code_detected: { code: 7027, category: ts.DiagnosticCategory.Error, key: "Unreachable_code_detected_7027", message: "Unreachable code detected." }, Unused_label: { code: 7028, category: ts.DiagnosticCategory.Error, key: "Unused_label_7028", message: "Unused label." }, Fallthrough_case_in_switch: { code: 7029, category: ts.DiagnosticCategory.Error, key: "Fallthrough_case_in_switch_7029", message: "Fallthrough case in switch." }, @@ -3183,7 +3261,7 @@ var ts; parameter_modifiers_can_only_be_used_in_a_ts_file: { code: 8012, category: ts.DiagnosticCategory.Error, key: "parameter_modifiers_can_only_be_used_in_a_ts_file_8012", message: "'parameter modifiers' can only be used in a .ts file." }, enum_declarations_can_only_be_used_in_a_ts_file: { code: 8015, category: ts.DiagnosticCategory.Error, key: "enum_declarations_can_only_be_used_in_a_ts_file_8015", message: "'enum declarations' can only be used in a .ts file." }, type_assertion_expressions_can_only_be_used_in_a_ts_file: { code: 8016, category: ts.DiagnosticCategory.Error, key: "type_assertion_expressions_can_only_be_used_in_a_ts_file_8016", message: "'type assertion expressions' can only be used in a .ts file." }, - Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses: { code: 9002, category: ts.DiagnosticCategory.Error, key: "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002", message: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses." }, + Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clause: { code: 9002, category: ts.DiagnosticCategory.Error, key: "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002", message: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clause." }, class_expressions_are_not_currently_supported: { code: 9003, category: ts.DiagnosticCategory.Error, key: "class_expressions_are_not_currently_supported_9003", message: "'class' expressions are not currently supported." }, Language_service_is_disabled: { code: 9004, category: ts.DiagnosticCategory.Error, key: "Language_service_is_disabled_9004", message: "Language service is disabled." }, JSX_attributes_must_only_be_assigned_a_non_empty_expression: { code: 17000, category: ts.DiagnosticCategory.Error, key: "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", message: "JSX attributes must only be assigned a non-empty 'expression'." }, @@ -3191,28 +3269,40 @@ var ts; Expected_corresponding_JSX_closing_tag_for_0: { code: 17002, category: ts.DiagnosticCategory.Error, key: "Expected_corresponding_JSX_closing_tag_for_0_17002", message: "Expected corresponding JSX closing tag for '{0}'." }, JSX_attribute_expected: { code: 17003, category: ts.DiagnosticCategory.Error, key: "JSX_attribute_expected_17003", message: "JSX attribute expected." }, Cannot_use_JSX_unless_the_jsx_flag_is_provided: { code: 17004, category: ts.DiagnosticCategory.Error, key: "Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004", message: "Cannot use JSX unless the '--jsx' flag is provided." }, - A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: ts.DiagnosticCategory.Error, key: "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005", message: "A constructor cannot contain a 'super' call when its class extends 'null'" }, + A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: ts.DiagnosticCategory.Error, key: "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005", message: "A constructor cannot contain a 'super' call when its class extends 'null'." }, An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17006, category: ts.DiagnosticCategory.Error, key: "An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006", message: "An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17007, category: ts.DiagnosticCategory.Error, key: "A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007", message: "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, JSX_element_0_has_no_corresponding_closing_tag: { code: 17008, category: ts.DiagnosticCategory.Error, key: "JSX_element_0_has_no_corresponding_closing_tag_17008", message: "JSX element '{0}' has no corresponding closing tag." }, super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class: { code: 17009, category: ts.DiagnosticCategory.Error, key: "super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009", message: "'super' must be called before accessing 'this' in the constructor of a derived class." }, Unknown_type_acquisition_option_0: { code: 17010, category: ts.DiagnosticCategory.Error, key: "Unknown_type_acquisition_option_0_17010", message: "Unknown type acquisition option '{0}'." }, + super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class: { code: 17011, category: ts.DiagnosticCategory.Error, key: "super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011", message: "'super' must be called before accessing a property of 'super' in the constructor of a derived class." }, + _0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2: { code: 17012, category: ts.DiagnosticCategory.Error, key: "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012", message: "'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?" }, + Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor: { code: 17013, category: ts.DiagnosticCategory.Error, key: "Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013", message: "Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor." }, Circularity_detected_while_resolving_configuration_Colon_0: { code: 18000, category: ts.DiagnosticCategory.Error, key: "Circularity_detected_while_resolving_configuration_Colon_0_18000", message: "Circularity detected while resolving configuration: {0}" }, A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not: { code: 18001, category: ts.DiagnosticCategory.Error, key: "A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not_18001", message: "A path in an 'extends' option must be relative or rooted, but '{0}' is not." }, The_files_list_in_config_file_0_is_empty: { code: 18002, category: ts.DiagnosticCategory.Error, key: "The_files_list_in_config_file_0_is_empty_18002", message: "The 'files' list in config file '{0}' is empty." }, No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2: { code: 18003, category: ts.DiagnosticCategory.Error, key: "No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003", message: "No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'." }, Add_missing_super_call: { code: 90001, category: ts.DiagnosticCategory.Message, key: "Add_missing_super_call_90001", message: "Add missing 'super()' call." }, Make_super_call_the_first_statement_in_the_constructor: { code: 90002, category: ts.DiagnosticCategory.Message, key: "Make_super_call_the_first_statement_in_the_constructor_90002", message: "Make 'super()' call the first statement in the constructor." }, - Change_extends_to_implements: { code: 90003, category: ts.DiagnosticCategory.Message, key: "Change_extends_to_implements_90003", message: "Change 'extends' to 'implements'" }, - Remove_unused_identifiers: { code: 90004, category: ts.DiagnosticCategory.Message, key: "Remove_unused_identifiers_90004", message: "Remove unused identifiers" }, - Implement_interface_on_reference: { code: 90005, category: ts.DiagnosticCategory.Message, key: "Implement_interface_on_reference_90005", message: "Implement interface on reference" }, - Implement_interface_on_class: { code: 90006, category: ts.DiagnosticCategory.Message, key: "Implement_interface_on_class_90006", message: "Implement interface on class" }, - Implement_inherited_abstract_class: { code: 90007, category: ts.DiagnosticCategory.Message, key: "Implement_inherited_abstract_class_90007", message: "Implement inherited abstract class" }, - Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: { code: 90009, category: ts.DiagnosticCategory.Error, key: "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009", message: "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig" }, + Change_extends_to_implements: { code: 90003, category: ts.DiagnosticCategory.Message, key: "Change_extends_to_implements_90003", message: "Change 'extends' to 'implements'." }, + Remove_declaration_for_Colon_0: { code: 90004, category: ts.DiagnosticCategory.Message, key: "Remove_declaration_for_Colon_0_90004", message: "Remove declaration for: '{0}'." }, + Implement_interface_0: { code: 90006, category: ts.DiagnosticCategory.Message, key: "Implement_interface_0_90006", message: "Implement interface '{0}'." }, + Implement_inherited_abstract_class: { code: 90007, category: ts.DiagnosticCategory.Message, key: "Implement_inherited_abstract_class_90007", message: "Implement inherited abstract class." }, + Add_this_to_unresolved_variable: { code: 90008, category: ts.DiagnosticCategory.Message, key: "Add_this_to_unresolved_variable_90008", message: "Add 'this.' to unresolved variable." }, + Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: { code: 90009, category: ts.DiagnosticCategory.Error, key: "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009", message: "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig." }, Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: { code: 90010, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010", message: "Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated." }, - Import_0_from_1: { code: 90013, category: ts.DiagnosticCategory.Message, key: "Import_0_from_1_90013", message: "Import {0} from {1}" }, - Change_0_to_1: { code: 90014, category: ts.DiagnosticCategory.Message, key: "Change_0_to_1_90014", message: "Change {0} to {1}" }, - Add_0_to_existing_import_declaration_from_1: { code: 90015, category: ts.DiagnosticCategory.Message, key: "Add_0_to_existing_import_declaration_from_1_90015", message: "Add {0} to existing import declaration from {1}" }, + Import_0_from_1: { code: 90013, category: ts.DiagnosticCategory.Message, key: "Import_0_from_1_90013", message: "Import {0} from {1}." }, + Change_0_to_1: { code: 90014, category: ts.DiagnosticCategory.Message, key: "Change_0_to_1_90014", message: "Change {0} to {1}." }, + Add_0_to_existing_import_declaration_from_1: { code: 90015, category: ts.DiagnosticCategory.Message, key: "Add_0_to_existing_import_declaration_from_1_90015", message: "Add {0} to existing import declaration from {1}." }, + Add_declaration_for_missing_property_0: { code: 90016, category: ts.DiagnosticCategory.Message, key: "Add_declaration_for_missing_property_0_90016", message: "Add declaration for missing property '{0}'." }, + Add_index_signature_for_missing_property_0: { code: 90017, category: ts.DiagnosticCategory.Message, key: "Add_index_signature_for_missing_property_0_90017", message: "Add index signature for missing property '{0}'." }, + Disable_checking_for_this_file: { code: 90018, category: ts.DiagnosticCategory.Message, key: "Disable_checking_for_this_file_90018", message: "Disable checking for this file." }, + Ignore_this_error_message: { code: 90019, category: ts.DiagnosticCategory.Message, key: "Ignore_this_error_message_90019", message: "Ignore this error message." }, + Initialize_property_0_in_the_constructor: { code: 90020, category: ts.DiagnosticCategory.Message, key: "Initialize_property_0_in_the_constructor_90020", message: "Initialize property '{0}' in the constructor." }, + Initialize_static_property_0: { code: 90021, category: ts.DiagnosticCategory.Message, key: "Initialize_static_property_0_90021", message: "Initialize static property '{0}'." }, + Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0: { code: 8017, category: ts.DiagnosticCategory.Error, key: "Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0_8017", message: "Octal literal types must use ES2015 syntax. Use the syntax '{0}'." }, + Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0: { code: 8018, category: ts.DiagnosticCategory.Error, key: "Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0_8018", message: "Octal literals are not allowed in enums members initializer. Use the syntax '{0}'." }, + Report_errors_in_js_files: { code: 8019, category: ts.DiagnosticCategory.Message, key: "Report_errors_in_js_files_8019", message: "Report errors in .js files." }, }; })(ts || (ts = {})); var ts; @@ -3221,7 +3311,7 @@ var ts; return token >= 70; } ts.tokenIsIdentifierOrKeyword = tokenIsIdentifierOrKeyword; - var textToToken = ts.createMap({ + var textToToken = ts.createMapFromTemplate({ "abstract": 116, "any": 118, "as": 117, @@ -3245,7 +3335,7 @@ var ts; "false": 85, "finally": 86, "for": 87, - "from": 138, + "from": 139, "function": 88, "get": 124, "if": 89, @@ -3263,27 +3353,28 @@ var ts; "new": 93, "null": 94, "number": 132, + "object": 133, "package": 110, "private": 111, "protected": 112, "public": 113, "readonly": 130, "require": 131, - "global": 139, + "global": 140, "return": 95, - "set": 133, + "set": 134, "static": 114, - "string": 134, + "string": 135, "super": 96, "switch": 97, - "symbol": 135, + "symbol": 136, "this": 98, "throw": 99, "true": 100, "try": 101, - "type": 136, + "type": 137, "typeof": 102, - "undefined": 137, + "undefined": 138, "var": 103, "void": 104, "while": 105, @@ -3291,7 +3382,7 @@ var ts; "yield": 115, "async": 119, "await": 120, - "of": 140, + "of": 141, "{": 16, "}": 17, "(": 18, @@ -3386,9 +3477,9 @@ var ts; } function makeReverseMap(source) { var result = []; - for (var name_4 in source) { - result[source[name_4]] = name_4; - } + source.forEach(function (value, name) { + result[value] = name; + }); return result; } var tokenStrings = makeReverseMap(textToToken); @@ -3397,7 +3488,7 @@ var ts; } ts.tokenToString = tokenToString; function stringToToken(s) { - return textToToken[s]; + return textToToken.get(s); } ts.stringToToken = stringToToken; function computeLineStarts(text) { @@ -3457,7 +3548,6 @@ var ts; return computeLineAndCharacterOfPosition(getLineStarts(sourceFile), position); } ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; - var hasOwnProperty = Object.prototype.hasOwnProperty; function isWhiteSpace(ch) { return isWhiteSpaceSingleLine(ch) || isLineBreak(ch); } @@ -3593,7 +3683,7 @@ var ts; if (pos === 0 || isLineBreak(text.charCodeAt(pos - 1))) { var ch = text.charCodeAt(pos); if ((pos + mergeConflictMarkerLength) < text.length) { - for (var i = 0, n = mergeConflictMarkerLength; i < n; i++) { + for (var i = 0; i < mergeConflictMarkerLength; i++) { if (text.charCodeAt(pos + i) !== ch) { return false; } @@ -3746,7 +3836,7 @@ var ts; if (!comments) { comments = []; } - comments.push({ pos: pos, end: end, hasTrailingNewLine: hasTrailingNewLine, kind: kind }); + comments.push({ kind: kind, pos: pos, end: end, hasTrailingNewLine: hasTrailingNewLine }); return comments; } function getLeadingCommentRanges(text, pos) { @@ -3779,7 +3869,7 @@ var ts; if (!isIdentifierStart(name.charCodeAt(0), languageVersion)) { return false; } - for (var i = 1, n = name.length; i < n; i++) { + for (var i = 1; i < name.length; i++) { if (!isIdentifierPart(name.charCodeAt(i), languageVersion)) { return false; } @@ -3798,6 +3888,7 @@ var ts; var precedingLineBreak; var hasExtendedUnicodeEscape; var tokenIsUnterminated; + var numericLiteralFlags; setText(text, start, length); return { getStartPos: function () { return startPos; }, @@ -3811,6 +3902,7 @@ var ts; isIdentifier: function () { return token === 70 || token > 106; }, isReservedWord: function () { return token >= 71 && token <= 106; }, isUnterminated: function () { return tokenIsUnterminated; }, + getNumericLiteralFlags: function () { return numericLiteralFlags; }, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, reScanTemplateToken: reScanTemplateToken, @@ -3847,6 +3939,7 @@ var ts; var end = pos; if (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101) { pos++; + numericLiteralFlags = 2; if (text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) pos++; if (isDigit(text.charCodeAt(pos))) { @@ -4116,8 +4209,11 @@ var ts; var len = tokenValue.length; if (len >= 2 && len <= 11) { var ch = tokenValue.charCodeAt(0); - if (ch >= 97 && ch <= 122 && hasOwnProperty.call(textToToken, tokenValue)) { - return token = textToToken[tokenValue]; + if (ch >= 97 && ch <= 122) { + token = textToToken.get(tokenValue); + if (token !== undefined) { + return token; + } } } return token = 70; @@ -4146,6 +4242,7 @@ var ts; hasExtendedUnicodeEscape = false; precedingLineBreak = false; tokenIsUnterminated = false; + numericLiteralFlags = 0; while (true) { tokenPos = pos; if (pos >= end) { @@ -4327,6 +4424,7 @@ var ts; value = 0; } tokenValue = "" + value; + numericLiteralFlags = 8; return token = 8; } else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) { @@ -4337,6 +4435,7 @@ var ts; value = 0; } tokenValue = "" + value; + numericLiteralFlags = 16; return token = 8; } else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) { @@ -4347,10 +4446,12 @@ var ts; value = 0; } tokenValue = "" + value; + numericLiteralFlags = 32; return token = 8; } if (pos + 1 < end && isOctalDigit(text.charCodeAt(pos + 1))) { tokenValue = "" + scanOctalDigits(); + numericLiteralFlags = 4; return token = 8; } case 49: @@ -4597,7 +4698,14 @@ var ts; while (pos < end) { pos++; char = text.charCodeAt(pos); - if ((char === 123) || (char === 60)) { + if (char === 123) { + break; + } + if (char === 60) { + if (isConflictMarkerTrivia(text, pos)) { + pos = scanConflictMarkerTrivia(text, pos, error); + return token = 7; + } break; } } @@ -4783,6 +4891,19 @@ var ts; return undefined; } ts.getDeclarationOfKind = getDeclarationOfKind; + function findDeclaration(symbol, predicate) { + var declarations = symbol.declarations; + if (declarations) { + for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { + var declaration = declarations_2[_i]; + if (predicate(declaration)) { + return declaration; + } + } + } + return undefined; + } + ts.findDeclaration = findDeclaration; var stringWriters = []; function getSingleLineStringWriter() { if (stringWriters.length === 0) { @@ -4796,13 +4917,15 @@ var ts; writeSpace: writeText, writeStringLiteral: writeText, writeParameter: writeText, + writeProperty: writeText, writeSymbol: writeText, writeLine: function () { return str_1 += " "; }, increaseIndent: ts.noop, decreaseIndent: ts.noop, clear: function () { return str_1 = ""; }, trackSymbol: ts.noop, - reportInaccessibleThisError: ts.noop + reportInaccessibleThisError: ts.noop, + reportIllegalExtends: ts.noop }; } return stringWriters.pop(); @@ -4818,25 +4941,25 @@ var ts; } ts.getFullWidth = getFullWidth; function hasResolvedModule(sourceFile, moduleNameText) { - return !!(sourceFile && sourceFile.resolvedModules && sourceFile.resolvedModules[moduleNameText]); + return !!(sourceFile && sourceFile.resolvedModules && sourceFile.resolvedModules.get(moduleNameText)); } ts.hasResolvedModule = hasResolvedModule; function getResolvedModule(sourceFile, moduleNameText) { - return hasResolvedModule(sourceFile, moduleNameText) ? sourceFile.resolvedModules[moduleNameText] : undefined; + return hasResolvedModule(sourceFile, moduleNameText) ? sourceFile.resolvedModules.get(moduleNameText) : undefined; } ts.getResolvedModule = getResolvedModule; function setResolvedModule(sourceFile, moduleNameText, resolvedModule) { if (!sourceFile.resolvedModules) { sourceFile.resolvedModules = ts.createMap(); } - sourceFile.resolvedModules[moduleNameText] = resolvedModule; + sourceFile.resolvedModules.set(moduleNameText, resolvedModule); } ts.setResolvedModule = setResolvedModule; function setResolvedTypeReferenceDirective(sourceFile, typeReferenceDirectiveName, resolvedTypeReferenceDirective) { if (!sourceFile.resolvedTypeReferenceDirectiveNames) { sourceFile.resolvedTypeReferenceDirectiveNames = ts.createMap(); } - sourceFile.resolvedTypeReferenceDirectiveNames[typeReferenceDirectiveName] = resolvedTypeReferenceDirective; + sourceFile.resolvedTypeReferenceDirectiveNames.set(typeReferenceDirectiveName, resolvedTypeReferenceDirective); } ts.setResolvedTypeReferenceDirective = setResolvedTypeReferenceDirective; function moduleResolutionIsEqualTo(oldResolution, newResolution) { @@ -4855,7 +4978,7 @@ var ts; } for (var i = 0; i < names.length; i++) { var newResolution = newResolutions[i]; - var oldResolution = oldResolutions && oldResolutions[names[i]]; + var oldResolution = oldResolutions && oldResolutions.get(names[i]); var changed = oldResolution ? !newResolution || !comparer(oldResolution, newResolution) : newResolution; @@ -4868,21 +4991,21 @@ var ts; ts.hasChangesInResolutions = hasChangesInResolutions; function containsParseError(node) { aggregateChildData(node); - return (node.flags & 4194304) !== 0; + return (node.flags & 131072) !== 0; } ts.containsParseError = containsParseError; function aggregateChildData(node) { - if (!(node.flags & 8388608)) { - var thisNodeOrAnySubNodesHasError = ((node.flags & 1048576) !== 0) || + if (!(node.flags & 262144)) { + var thisNodeOrAnySubNodesHasError = ((node.flags & 32768) !== 0) || ts.forEachChild(node, containsParseError); if (thisNodeOrAnySubNodesHasError) { - node.flags |= 4194304; + node.flags |= 131072; } - node.flags |= 8388608; + node.flags |= 262144; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 261) { + while (node && node.kind !== 264) { node = node.parent; } return node; @@ -4890,11 +5013,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 204: - case 232: - case 211: - case 212: + case 206: + case 234: case 213: + case 214: + case 215: return true; } return false; @@ -4949,6 +5072,10 @@ var ts; return !nodeIsMissing(node); } ts.nodeIsPresent = nodeIsPresent; + function isToken(n) { + return n.kind >= 0 && n.kind <= 141; + } + ts.isToken = isToken; function getTokenPosOfNode(node, sourceFile, includeJsDoc) { if (nodeIsMissing(node)) { return node.pos; @@ -4959,18 +5086,18 @@ var ts; if (includeJsDoc && node.jsDoc && node.jsDoc.length > 0) { return getTokenPosOfNode(node.jsDoc[0]); } - if (node.kind === 292 && node._children.length > 0) { + if (node.kind === 293 && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); } ts.getTokenPosOfNode = getTokenPosOfNode; function isJSDocNode(node) { - return node.kind >= 262 && node.kind <= 288; + return node.kind >= 266 && node.kind <= 292; } ts.isJSDocNode = isJSDocNode; function isJSDocTag(node) { - return node.kind >= 278 && node.kind <= 291; + return node.kind >= 282 && node.kind <= 292; } ts.isJSDocTag = isJSDocTag; function getNonDecoratorTokenPosOfNode(node, sourceFile) { @@ -5001,16 +5128,9 @@ var ts; return getSourceTextOfNodeFromSourceFile(getSourceFileOfNode(node), node, includeTrivia); } ts.getTextOfNode = getTextOfNode; - function getLiteralText(node, sourceFile, languageVersion) { - if (languageVersion < 2 && (isTemplateLiteralKind(node.kind) || node.hasExtendedUnicodeEscape)) { - return getQuotedEscapedLiteralText('"', node.text, '"'); - } + function getLiteralText(node, sourceFile) { if (!nodeIsSynthesized(node) && node.parent) { - var text = getSourceTextOfNodeFromSourceFile(sourceFile, node); - if (languageVersion < 2 && isBinaryOrOctalIntegerLiteral(node, text)) { - return node.text; - } - return text; + return getSourceTextOfNodeFromSourceFile(sourceFile, node); } switch (node.kind) { case 9: @@ -5029,19 +5149,6 @@ var ts; ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for."); } ts.getLiteralText = getLiteralText; - function isBinaryOrOctalIntegerLiteral(node, text) { - if (node.kind === 8 && text.length > 1) { - switch (text.charCodeAt(1)) { - case 98: - case 66: - case 111: - case 79: - return true; - } - } - return false; - } - ts.isBinaryOrOctalIntegerLiteral = isBinaryOrOctalIntegerLiteral; function getQuotedEscapedLiteralText(leftQuote, text, rightQuote) { return leftQuote + escapeNonAsciiCharacters(escapeString(text)) + rightQuote; } @@ -5049,10 +5156,6 @@ var ts; return identifier.length >= 2 && identifier.charCodeAt(0) === 95 && identifier.charCodeAt(1) === 95 ? "_" + identifier : identifier; } ts.escapeIdentifier = escapeIdentifier; - function unescapeIdentifier(identifier) { - return identifier.length >= 3 && identifier.charCodeAt(0) === 95 && identifier.charCodeAt(1) === 95 && identifier.charCodeAt(2) === 95 ? identifier.substr(1) : identifier; - } - ts.unescapeIdentifier = unescapeIdentifier; function makeIdentifierFromModuleName(moduleName) { return ts.getBaseFileName(moduleName).replace(/^(\d)/, "_$1").replace(/\W/g, "_"); } @@ -5064,11 +5167,11 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 223 && node.parent.kind === 256; + return node.kind === 225 && node.parent.kind === 259; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { - return node && node.kind === 230 && + return node && node.kind === 232 && (node.name.kind === 9 || isGlobalScopeAugmentation(node)); } ts.isAmbientModule = isAmbientModule; @@ -5077,11 +5180,11 @@ var ts; } ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { - return node.kind === 230 && (!node.body); + return node && node.kind === 232 && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 261 || - node.kind === 230 || + return node.kind === 264 || + node.kind === 232 || isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -5094,32 +5197,36 @@ var ts; return false; } switch (node.parent.kind) { - case 261: + case 264: return ts.isExternalModule(node.parent); - case 231: + case 233: return isAmbientModule(node.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; } ts.isExternalModuleAugmentation = isExternalModuleAugmentation; + function isEffectiveExternalModule(node, compilerOptions) { + return ts.isExternalModule(node) || compilerOptions.isolatedModules; + } + ts.isEffectiveExternalModule = isEffectiveExternalModule; function isBlockScope(node, parentNode) { switch (node.kind) { - case 261: + case 264: + case 234: + case 259: case 232: - case 256: - case 230: - case 211: - case 212: case 213: - case 150: - case 149: + case 214: + case 215: case 151: + case 150: case 152: - case 225: - case 184: + case 153: + case 227: case 185: + case 186: return true; - case 204: + case 206: return parentNode && !isFunctionLike(parentNode); } return false; @@ -5139,6 +5246,10 @@ var ts; return getFullWidth(name) === 0 ? "(Missing)" : getTextOfNode(name); } ts.declarationNameToString = declarationNameToString; + function getNameFromIndexInfo(info) { + return info.declaration ? declarationNameToString(info.declaration.parameters[0].name) : undefined; + } + ts.getNameFromIndexInfo = getNameFromIndexInfo; function getTextOfPropertyName(name) { switch (name.kind) { case 70: @@ -5146,7 +5257,7 @@ var ts; case 9: case 8: return name.text; - case 142: + case 143: if (isStringOrNumericLiteral(name.expression)) { return name.expression.text; } @@ -5157,10 +5268,10 @@ var ts; function entityNameToString(name) { switch (name.kind) { case 70: - return getFullWidth(name) === 0 ? unescapeIdentifier(name.text) : getTextOfNode(name); - case 141: + return getFullWidth(name) === 0 ? ts.unescapeIdentifier(name.text) : getTextOfNode(name); + case 142: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 177: + case 178: return entityNameToString(name.expression) + "." + entityNameToString(name.name); } } @@ -5197,7 +5308,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 204) { + if (node.body && node.body.kind === 206) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -5209,29 +5320,29 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 261: + case 264: var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); if (pos_1 === sourceFile.text.length) { return ts.createTextSpan(0, 0); } return getSpanOfTokenAtPosition(sourceFile, pos_1); - case 223: - case 174: - case 226: - case 197: - case 227: - case 230: - case 229: - case 260: case 225: - case 184: - case 149: - case 151: - case 152: + case 175: case 228: + case 198: + case 229: + case 232: + case 231: + case 263: + case 227: + case 185: + case 150: + case 152: + case 153: + case 230: errorNode = node.name; break; - case 185: + case 186: return getErrorSpanForArrowFunction(sourceFile, node); } if (errorNode === undefined) { @@ -5252,7 +5363,7 @@ var ts; } ts.isDeclarationFile = isDeclarationFile; function isConstEnumDeclaration(node) { - return node.kind === 229 && isConst(node); + return node.kind === 231 && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function isConst(node) { @@ -5265,11 +5376,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 179 && n.expression.kind === 96; + return n.kind === 180 && n.expression.kind === 96; } ts.isSuperCall = isSuperCall; function isPrologueDirective(node) { - return node.kind === 207 + return node.kind === 209 && node.expression.kind === 9; } ts.isPrologueDirective = isPrologueDirective; @@ -5282,10 +5393,10 @@ var ts; } ts.getLeadingCommentRangesOfNodeFromText = getLeadingCommentRangesOfNodeFromText; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 144 || - node.kind === 143 || - node.kind === 184 || - node.kind === 185) ? + var commentRanges = (node.kind === 145 || + node.kind === 144 || + node.kind === 185 || + node.kind === 186) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRangesOfNodeFromText(node, text); return ts.filter(commentRanges, function (comment) { @@ -5299,96 +5410,110 @@ var ts; ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (156 <= node.kind && node.kind <= 171) { + if (157 <= node.kind && node.kind <= 172) { return true; } switch (node.kind) { case 118: case 132: - case 134: - case 121: case 135: - case 137: + case 121: + case 136: + case 138: case 129: return true; case 104: - return node.parent.kind !== 188; - case 199: + return node.parent.kind !== 189; + case 200: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); case 70: - if (node.parent.kind === 141 && node.parent.right === node) { + if (node.parent.kind === 142 && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 177 && node.parent.name === node) { + else if (node.parent.kind === 178 && node.parent.name === node) { node = node.parent; } - ts.Debug.assert(node.kind === 70 || node.kind === 141 || node.kind === 177, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); - case 141: - case 177: + ts.Debug.assert(node.kind === 70 || node.kind === 142 || node.kind === 178, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + case 142: + case 178: case 98: - var parent_1 = node.parent; - if (parent_1.kind === 160) { + var parent = node.parent; + if (parent.kind === 161) { return false; } - if (156 <= parent_1.kind && parent_1.kind <= 171) { + if (157 <= parent.kind && parent.kind <= 172) { return true; } - switch (parent_1.kind) { - case 199: - return !isExpressionWithTypeArgumentsInClassExtendsClause(parent_1); - case 143: - return node === parent_1.constraint; - case 147: - case 146: + switch (parent.kind) { + case 200: + return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); case 144: - case 223: - return node === parent_1.type; + return node === parent.constraint; + case 148: + case 147: + case 145: case 225: - case 184: + return node === parent.type; + case 227: case 185: + case 186: + case 151: case 150: case 149: - case 148: - case 151: case 152: - return node === parent_1.type; case 153: + return node === parent.type; case 154: case 155: - return node === parent_1.type; - case 182: - return node === parent_1.type; - case 179: + case 156: + return node === parent.type; + case 183: + return node === parent.type; case 180: - return parent_1.typeArguments && ts.indexOf(parent_1.typeArguments, node) >= 0; case 181: + return parent.typeArguments && ts.indexOf(parent.typeArguments, node) >= 0; + case 182: return false; } } return false; } ts.isPartOfTypeNode = isPartOfTypeNode; + function isChildOfNodeWithKind(node, kind) { + while (node) { + if (node.kind === kind) { + return true; + } + node = node.parent; + } + return false; + } + ts.isChildOfNodeWithKind = isChildOfNodeWithKind; + function isPrefixUnaryExpression(node) { + return node.kind === 191; + } + ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function forEachReturnStatement(body, visitor) { return traverse(body); function traverse(node) { switch (node.kind) { - case 216: + case 218: return visitor(node); - case 232: - case 204: - case 208: - case 209: + case 234: + case 206: case 210: case 211: case 212: case 213: - case 217: - case 218: - case 253: - case 254: + case 214: + case 215: case 219: - case 221: + case 220: case 256: + case 257: + case 221: + case 223: + case 259: return ts.forEachChild(node, traverse); } } @@ -5398,24 +5523,25 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 195: + case 196: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } + return; + case 231: case 229: - case 227: + case 232: case 230: case 228: - case 226: - case 197: + case 198: return; default: if (isFunctionLike(node)) { - var name_5 = node.name; - if (name_5 && name_5.kind === 142) { - traverse(name_5.expression); + var name = node.name; + if (name && name.kind === 143) { + traverse(name.expression); return; } } @@ -5426,17 +5552,29 @@ var ts; } } ts.forEachYieldExpression = forEachYieldExpression; + function getRestParameterElementType(node) { + if (node && node.kind === 163) { + return node.elementType; + } + else if (node && node.kind === 158) { + return ts.singleOrUndefined(node.typeArguments); + } + else { + return undefined; + } + } + ts.getRestParameterElementType = getRestParameterElementType; function isVariableLike(node) { if (node) { switch (node.kind) { - case 174: + case 175: + case 263: + case 145: case 260: - case 144: - case 257: + case 148: case 147: - case 146: - case 258: - case 223: + case 261: + case 225: return true; } } @@ -5444,11 +5582,11 @@ var ts; } ts.isVariableLike = isVariableLike; function isAccessor(node) { - return node && (node.kind === 151 || node.kind === 152); + return node && (node.kind === 152 || node.kind === 153); } ts.isAccessor = isAccessor; function isClassLike(node) { - return node && (node.kind === 226 || node.kind === 197); + return node && (node.kind === 228 || node.kind === 198); } ts.isClassLike = isClassLike; function isFunctionLike(node) { @@ -5457,19 +5595,19 @@ var ts; ts.isFunctionLike = isFunctionLike; function isFunctionLikeKind(kind) { switch (kind) { - case 150: - case 184: - case 225: - case 185: - case 149: - case 148: case 151: + case 185: + case 227: + case 186: + case 150: + case 149: case 152: case 153: case 154: case 155: - case 158: + case 156: case 159: + case 160: return true; } return false; @@ -5477,13 +5615,13 @@ var ts; ts.isFunctionLikeKind = isFunctionLikeKind; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 149: - case 148: case 150: + case 149: case 151: case 152: - case 225: - case 184: + case 153: + case 227: + case 185: return true; } return false; @@ -5491,30 +5629,42 @@ var ts; ts.introducesArgumentsExoticObject = introducesArgumentsExoticObject; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { + case 213: + case 214: + case 215: case 211: case 212: - case 213: - case 209: - case 210: return true; - case 219: + case 221: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; } ts.isIterationStatement = isIterationStatement; + function unwrapInnermostStatementOfLabel(node, beforeUnwrapLabelCallback) { + while (true) { + if (beforeUnwrapLabelCallback) { + beforeUnwrapLabelCallback(node); + } + if (node.statement.kind !== 221) { + return node.statement; + } + node = node.statement; + } + } + ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 204 && isFunctionLike(node.parent); + return node && node.kind === 206 && isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 149 && node.parent.kind === 176; + return node && node.kind === 150 && node.parent.kind === 177; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 149 && - (node.parent.kind === 176 || - node.parent.kind === 197); + return node.kind === 150 && + (node.parent.kind === 177 || + node.parent.kind === 198); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -5550,44 +5700,57 @@ var ts; return undefined; } switch (node.kind) { - case 142: + case 143: if (isClassLike(node.parent.parent)) { return node; } node = node.parent; break; - case 145: - if (node.parent.kind === 144 && isClassElement(node.parent.parent)) { + case 146: + if (node.parent.kind === 145 && isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (isClassElement(node.parent)) { node = node.parent; } break; - case 185: + case 186: if (!includeArrowFunctions) { continue; } - case 225: - case 184: - case 230: - case 147: - case 146: - case 149: + case 227: + case 185: + case 232: case 148: + case 147: case 150: + case 149: case 151: case 152: case 153: case 154: case 155: - case 229: - case 261: + case 156: + case 231: + case 264: return node; } } } ts.getThisContainer = getThisContainer; + function getNewTargetContainer(node) { + var container = getThisContainer(node, false); + if (container) { + switch (container.kind) { + case 151: + case 227: + case 185: + return container; + } + } + return undefined; + } + ts.getNewTargetContainer = getNewTargetContainer; function getSuperContainer(node, stopOnFunctions) { while (true) { node = node.parent; @@ -5595,25 +5758,25 @@ var ts; return node; } switch (node.kind) { - case 142: + case 143: node = node.parent; break; - case 225: - case 184: + case 227: case 185: + case 186: if (!stopOnFunctions) { continue; } - case 147: - case 146: - case 149: case 148: + case 147: case 150: + case 149: case 151: case 152: + case 153: return node; - case 145: - if (node.parent.kind === 144 && isClassElement(node.parent.parent)) { + case 146: + if (node.parent.kind === 145 && isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (isClassElement(node.parent)) { @@ -5625,36 +5788,36 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 184 || func.kind === 185) { + if (func.kind === 185 || func.kind === 186) { var prev = func; - var parent_2 = func.parent; - while (parent_2.kind === 183) { - prev = parent_2; - parent_2 = parent_2.parent; + var parent = func.parent; + while (parent.kind === 184) { + prev = parent; + parent = parent.parent; } - if (parent_2.kind === 179 && parent_2.expression === prev) { - return parent_2; + if (parent.kind === 180 && parent.expression === prev) { + return parent; } } } ts.getImmediatelyInvokedFunctionExpression = getImmediatelyInvokedFunctionExpression; function isSuperProperty(node) { var kind = node.kind; - return (kind === 177 || kind === 178) + return (kind === 178 || kind === 179) && node.expression.kind === 96; } ts.isSuperProperty = isSuperProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 157: - case 272: + case 158: + case 276: return node.typeName; - case 199: + case 200: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 70: - case 141: + case 142: return node; } return undefined; @@ -5662,10 +5825,12 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function isCallLikeExpression(node) { switch (node.kind) { - case 179: + case 250: + case 249: case 180: case 181: - case 145: + case 182: + case 146: return true; default: return false; @@ -5673,29 +5838,32 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function getInvokedExpression(node) { - if (node.kind === 181) { + if (node.kind === 182) { return node.tag; } + else if (isJsxOpeningLikeElement(node)) { + return node.tagName; + } return node.expression; } ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node) { switch (node.kind) { - case 226: + case 228: return true; - case 147: - return node.parent.kind === 226; - case 151: + case 148: + return node.parent.kind === 228; case 152: - case 149: + case 153: + case 150: return node.body !== undefined - && node.parent.kind === 226; - case 144: + && node.parent.kind === 228; + case 145: return node.parent.body !== undefined - && (node.parent.kind === 150 - || node.parent.kind === 149 - || node.parent.kind === 152) - && node.parent.parent.kind === 226; + && (node.parent.kind === 151 + || node.parent.kind === 150 + || node.parent.kind === 153) + && node.parent.parent.kind === 228; } return false; } @@ -5711,19 +5879,19 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node) { switch (node.kind) { - case 226: + case 228: return ts.forEach(node.members, nodeOrChildIsDecorated); - case 149: - case 152: + case 150: + case 153: return ts.forEach(node.parameters, nodeIsDecorated); } } ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 248 || - parent.kind === 247 || - parent.kind === 249) { + if (parent.kind === 250 || + parent.kind === 249 || + parent.kind === 251) { return parent.tagName === node; } return false; @@ -5737,95 +5905,96 @@ var ts; case 100: case 85: case 11: - case 175: case 176: case 177: case 178: case 179: case 180: case 181: - case 200: case 182: case 201: case 183: + case 202: case 184: - case 197: case 185: - case 188: + case 198: case 186: + case 189: case 187: - case 190: + case 188: case 191: case 192: case 193: - case 196: case 194: - case 12: - case 198: - case 246: - case 247: + case 197: case 195: - case 189: + case 12: + case 199: + case 248: + case 249: + case 196: + case 190: + case 203: return true; - case 141: - while (node.parent.kind === 141) { + case 142: + while (node.parent.kind === 142) { node = node.parent; } - return node.parent.kind === 160 || isJSXTagName(node); + return node.parent.kind === 161 || isJSXTagName(node); case 70: - if (node.parent.kind === 160 || isJSXTagName(node)) { + if (node.parent.kind === 161 || isJSXTagName(node)) { return true; } case 8: case 9: case 98: - var parent_3 = node.parent; - switch (parent_3.kind) { - case 223: - case 144: + var parent = node.parent; + switch (parent.kind) { + case 225: + case 145: + case 148: case 147: - case 146: + case 263: case 260: - case 257: - case 174: - return parent_3.initializer === node; - case 207: - case 208: + case 175: + return parent.initializer === node; case 209: case 210: - case 216: - case 217: - case 218: - case 253: - case 220: - case 218: - return parent_3.expression === node; case 211: - var forStatement = parent_3; - return (forStatement.initializer === node && forStatement.initializer.kind !== 224) || + case 212: + case 218: + case 219: + case 220: + case 256: + case 222: + case 220: + return parent.expression === node; + case 213: + var forStatement = parent; + return (forStatement.initializer === node && forStatement.initializer.kind !== 226) || forStatement.condition === node || forStatement.incrementor === node; - case 212: - case 213: - var forInStatement = parent_3; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 224) || + case 214: + case 215: + var forInStatement = parent; + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 226) || forInStatement.expression === node; - case 182: - case 200: - return node === parent_3.expression; - case 202: - return node === parent_3.expression; - case 142: - return node === parent_3.expression; - case 145: - case 252: - case 251: - case 259: + case 183: + case 201: + return node === parent.expression; + case 204: + return node === parent.expression; + case 143: + return node === parent.expression; + case 146: + case 255: + case 254: + case 262: return true; - case 199: - return parent_3.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent_3); + case 200: + return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); default: - if (isPartOfExpression(parent_3)) { + if (isPartOfExpression(parent)) { return true; } } @@ -5840,7 +6009,7 @@ var ts; } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 234 && node.moduleReference.kind === 245; + return node.kind === 236 && node.moduleReference.kind === 247; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -5849,7 +6018,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 234 && node.moduleReference.kind !== 245; + return node.kind === 236 && node.moduleReference.kind !== 247; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJavaScript(file) { @@ -5857,38 +6026,57 @@ var ts; } ts.isSourceFileJavaScript = isSourceFileJavaScript; function isInJavaScriptFile(node) { - return node && !!(node.flags & 2097152); + return node && !!(node.flags & 65536); } ts.isInJavaScriptFile = isInJavaScriptFile; - function isRequireCall(expression, checkArgumentIsStringLiteral) { - var isRequire = expression.kind === 179 && - expression.expression.kind === 70 && - expression.expression.text === "require" && - expression.arguments.length === 1; - return isRequire && (!checkArgumentIsStringLiteral || expression.arguments[0].kind === 9); + function isRequireCall(callExpression, checkArgumentIsStringLiteral) { + if (callExpression.kind !== 180) { + return false; + } + var _a = callExpression, expression = _a.expression, args = _a.arguments; + if (expression.kind !== 70 || expression.text !== "require") { + return false; + } + if (args.length !== 1) { + return false; + } + var arg = args[0]; + return !checkArgumentIsStringLiteral || arg.kind === 9 || arg.kind === 12; } ts.isRequireCall = isRequireCall; function isSingleOrDoubleQuote(charCode) { return charCode === 39 || charCode === 34; } ts.isSingleOrDoubleQuote = isSingleOrDoubleQuote; - function isDeclarationOfFunctionExpression(s) { - if (s.valueDeclaration && s.valueDeclaration.kind === 223) { + function isDeclarationOfFunctionOrClassExpression(s) { + if (s.valueDeclaration && s.valueDeclaration.kind === 225) { var declaration = s.valueDeclaration; - return declaration.initializer && declaration.initializer.kind === 184; + return declaration.initializer && (declaration.initializer.kind === 185 || declaration.initializer.kind === 198); } return false; } - ts.isDeclarationOfFunctionExpression = isDeclarationOfFunctionExpression; + ts.isDeclarationOfFunctionOrClassExpression = isDeclarationOfFunctionOrClassExpression; + function getRightMostAssignedExpression(node) { + while (isAssignmentExpression(node, true)) { + node = node.right; + } + return node; + } + ts.getRightMostAssignedExpression = getRightMostAssignedExpression; + function isExportsIdentifier(node) { + return isIdentifier(node) && node.text === "exports"; + } + ts.isExportsIdentifier = isExportsIdentifier; + function isModuleExportsPropertyAccessExpression(node) { + return isPropertyAccessExpression(node) && isIdentifier(node.expression) && node.expression.text === "module" && node.name.text === "exports"; + } + ts.isModuleExportsPropertyAccessExpression = isModuleExportsPropertyAccessExpression; function getSpecialPropertyAssignmentKind(expression) { if (!isInJavaScriptFile(expression)) { return 0; } - if (expression.kind !== 192) { - return 0; - } var expr = expression; - if (expr.operatorToken.kind !== 57 || expr.left.kind !== 177) { + if (expr.operatorToken.kind !== 57 || expr.left.kind !== 178) { return 0; } var lhs = expr.left; @@ -5900,11 +6088,14 @@ var ts; else if (lhsId.text === "module" && lhs.name.text === "exports") { return 2; } + else { + return 5; + } } else if (lhs.expression.kind === 98) { return 4; } - else if (lhs.expression.kind === 177) { + else if (lhs.expression.kind === 178) { var innerPropertyAccess = lhs.expression; if (innerPropertyAccess.expression.kind === 70) { var innerPropertyAccessIdentifier = innerPropertyAccess.expression; @@ -5920,35 +6111,35 @@ var ts; } ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind; function getExternalModuleName(node) { - if (node.kind === 235) { + if (node.kind === 237) { return node.moduleSpecifier; } - if (node.kind === 234) { + if (node.kind === 236) { var reference = node.moduleReference; - if (reference.kind === 245) { + if (reference.kind === 247) { return reference.expression; } } - if (node.kind === 241) { + if (node.kind === 243) { return node.moduleSpecifier; } - if (node.kind === 230 && node.name.kind === 9) { + if (node.kind === 232 && node.name.kind === 9) { return node.name; } } ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { - if (node.kind === 234) { + if (node.kind === 236) { return node; } var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 237) { + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 239) { return importClause.namedBindings; } } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 235 + return node.kind === 237 && node.importClause && !!node.importClause.name; } @@ -5956,13 +6147,13 @@ var ts; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 144: + case 145: + case 150: case 149: + case 261: + case 260: case 148: - case 258: - case 257: case 147: - case 146: return node.questionToken !== undefined; } } @@ -5970,28 +6161,36 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function isJSDocConstructSignature(node) { - return node.kind === 274 && + return node.kind === 278 && node.parameters.length > 0 && - node.parameters[0].type.kind === 276; + node.parameters[0].type.kind === 280; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function getCommentsFromJSDoc(node) { return ts.map(getJSDocs(node), function (doc) { return doc.comment; }); } ts.getCommentsFromJSDoc = getCommentsFromJSDoc; + function hasJSDocParameterTags(node) { + var parameterTags = getJSDocTags(node, 285); + return parameterTags && parameterTags.length > 0; + } + ts.hasJSDocParameterTags = hasJSDocParameterTags; function getJSDocTags(node, kind) { var docs = getJSDocs(node); if (docs) { var result = []; for (var _i = 0, docs_1 = docs; _i < docs_1.length; _i++) { var doc = docs_1[_i]; - if (doc.kind === 281) { + if (doc.kind === 285) { if (doc.kind === kind) { result.push(doc); } } else { - result.push.apply(result, ts.filter(doc.tags, function (tag) { return tag.kind === kind; })); + var tags = doc.tags; + if (tags) { + result.push.apply(result, ts.filter(tags, function (tag) { return tag.kind === kind; })); + } } } return result; @@ -6011,9 +6210,9 @@ var ts; var parent = node.parent; var isInitializerOfVariableDeclarationInStatement = isVariableLike(parent) && parent.initializer === node && - parent.parent.parent.kind === 205; + parent.parent.parent.kind === 207; var isVariableOfVariableDeclarationStatement = isVariableLike(node) && - parent.parent.kind === 205; + parent.parent.kind === 207; var variableStatementNode = isInitializerOfVariableDeclarationInStatement ? parent.parent.parent : isVariableOfVariableDeclarationStatement ? parent.parent : undefined; @@ -6021,19 +6220,19 @@ var ts; getJSDocsWorker(variableStatementNode); } var isSourceOfAssignmentExpressionStatement = parent && parent.parent && - parent.kind === 192 && + parent.kind === 193 && parent.operatorToken.kind === 57 && - parent.parent.kind === 207; + parent.parent.kind === 209; if (isSourceOfAssignmentExpressionStatement) { getJSDocsWorker(parent.parent); } - var isModuleDeclaration = node.kind === 230 && - parent && parent.kind === 230; - var isPropertyAssignmentExpression = parent && parent.kind === 257; + var isModuleDeclaration = node.kind === 232 && + parent && parent.kind === 232; + var isPropertyAssignmentExpression = parent && parent.kind === 260; if (isModuleDeclaration || isPropertyAssignmentExpression) { getJSDocsWorker(parent); } - if (node.kind === 144) { + if (node.kind === 145) { cache = ts.concatenate(cache, getJSDocParameterTags(node)); } if (isVariableLike(node) && node.initializer) { @@ -6042,22 +6241,23 @@ var ts; cache = ts.concatenate(cache, node.jsDoc); } } + ts.getJSDocs = getJSDocs; function getJSDocParameterTags(param) { if (!isParameter(param)) { return undefined; } var func = param.parent; - var tags = getJSDocTags(func, 281); + var tags = getJSDocTags(func, 285); if (!param.name) { var i = func.parameters.indexOf(param); - var paramTags = ts.filter(tags, function (tag) { return tag.kind === 281; }); + var paramTags = ts.filter(tags, function (tag) { return tag.kind === 285; }); if (paramTags && 0 <= i && i < paramTags.length) { return [paramTags[i]]; } } else if (param.name.kind === 70) { - var name_6 = param.name.text; - return ts.filter(tags, function (tag) { return tag.kind === 281 && tag.parameterName.text === name_6; }); + var name_1 = param.name.text; + return ts.filter(tags, function (tag) { return tag.kind === 285 && tag.parameterName.text === name_1; }); } else { return undefined; @@ -6065,8 +6265,8 @@ var ts; } ts.getJSDocParameterTags = getJSDocParameterTags; function getJSDocType(node) { - var tag = getFirstJSDocTag(node, 283); - if (!tag && node.kind === 144) { + var tag = getFirstJSDocTag(node, 287); + if (!tag && node.kind === 145) { var paramTags = getJSDocParameterTags(node); if (paramTags) { tag = ts.find(paramTags, function (tag) { return !!tag.typeExpression; }); @@ -6076,15 +6276,15 @@ var ts; } ts.getJSDocType = getJSDocType; function getJSDocAugmentsTag(node) { - return getFirstJSDocTag(node, 280); + return getFirstJSDocTag(node, 284); } ts.getJSDocAugmentsTag = getJSDocAugmentsTag; function getJSDocReturnTag(node) { - return getFirstJSDocTag(node, 282); + return getFirstJSDocTag(node, 286); } ts.getJSDocReturnTag = getJSDocReturnTag; function getJSDocTemplateTag(node) { - return getFirstJSDocTag(node, 284); + return getFirstJSDocTag(node, 288); } ts.getJSDocTemplateTag = getJSDocTemplateTag; function hasRestParameter(s) { @@ -6096,9 +6296,9 @@ var ts; } ts.hasDeclaredRestParameter = hasDeclaredRestParameter; function isRestParameter(node) { - if (node && (node.flags & 2097152)) { - if (node.type && node.type.kind === 275 || - ts.forEach(getJSDocParameterTags(node), function (t) { return t.typeExpression && t.typeExpression.type.kind === 275; })) { + if (node && (node.flags & 65536)) { + if (node.type && node.type.kind === 279 || + ts.forEach(getJSDocParameterTags(node), function (t) { return t.typeExpression && t.typeExpression.type.kind === 279; })) { return true; } } @@ -6113,28 +6313,33 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 192: + case 193: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 57 ? 1 : 2 : 0; - case 190: case 191: + case 192: var unaryOperator = parent.operator; return unaryOperator === 42 || unaryOperator === 43 ? 2 : 0; - case 212: - case 213: + case 214: + case 215: return parent.initializer === node ? 1 : 0; - case 183: - case 175: - case 196: + case 184: + case 176: + case 197: node = parent; break; - case 258: + case 261: if (parent.name !== node) { return 0; } - case 257: + node = parent.parent; + break; + case 260: + if (parent.name === node) { + return 0; + } node = parent.parent; break; default: @@ -6148,6 +6353,17 @@ var ts; return getAssignmentTargetKind(node) !== 0; } ts.isAssignmentTarget = isAssignmentTarget; + function isDeleteTarget(node) { + if (node.kind !== 178 && node.kind !== 179) { + return false; + } + node = node.parent; + while (node && node.kind === 184) { + node = node.parent; + } + return node && node.kind === 187; + } + ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { while (node) { if (node === ancestor) @@ -6159,7 +6375,7 @@ var ts; ts.isNodeDescendantOf = isNodeDescendantOf; function isInAmbientContext(node) { while (node) { - if (hasModifier(node, 2) || (node.kind === 261 && node.isDeclarationFile)) { + if (hasModifier(node, 2) || (node.kind === 264 && node.isDeclarationFile)) { return true; } node = node.parent; @@ -6172,7 +6388,7 @@ var ts; return false; } var parent = name.parent; - if (parent.kind === 239 || parent.kind === 243) { + if (parent.kind === 241 || parent.kind === 245) { if (parent.propertyName) { return true; } @@ -6185,48 +6401,48 @@ var ts; ts.isDeclarationName = isDeclarationName; function isLiteralComputedPropertyDeclarationName(node) { return (node.kind === 9 || node.kind === 8) && - node.parent.kind === 142 && + node.parent.kind === 143 && isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 147: - case 146: - case 149: case 148: - case 151: + case 147: + case 150: + case 149: case 152: + case 153: + case 263: case 260: - case 257: - case 177: + case 178: return parent.name === node; - case 141: + case 142: if (parent.right === node) { - while (parent.kind === 141) { + while (parent.kind === 142) { parent = parent.parent; } - return parent.kind === 160; + return parent.kind === 161; } return false; - case 174: - case 239: + case 175: + case 241: return parent.propertyName === node; - case 243: + case 245: return true; } return false; } ts.isIdentifierName = isIdentifierName; function isAliasSymbolDeclaration(node) { - return node.kind === 234 || - node.kind === 233 || - node.kind === 236 && !!node.name || - node.kind === 237 || + return node.kind === 236 || + node.kind === 235 || + node.kind === 238 && !!node.name || node.kind === 239 || - node.kind === 243 || - node.kind === 240 && exportAssignmentIsAlias(node); + node.kind === 241 || + node.kind === 245 || + node.kind === 242 && exportAssignmentIsAlias(node); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function exportAssignmentIsAlias(node) { @@ -6312,17 +6528,51 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 71 <= token && token <= 140; + return 71 <= token && token <= 141; } ts.isKeyword = isKeyword; function isTrivia(token) { return 2 <= token && token <= 7; } ts.isTrivia = isTrivia; - function isAsyncFunctionLike(node) { - return isFunctionLike(node) && hasModifier(node, 256) && !isAccessor(node); + function getFunctionFlags(node) { + var flags = 0; + switch (node.kind) { + case 227: + case 185: + case 150: + if (node.asteriskToken) { + flags |= 1; + } + case 186: + if (hasModifier(node, 256)) { + flags |= 2; + } + break; + } + if (!node.body) { + flags |= 4; + } + return flags; } - ts.isAsyncFunctionLike = isAsyncFunctionLike; + ts.getFunctionFlags = getFunctionFlags; + function isAsyncFunction(node) { + switch (node.kind) { + case 227: + case 185: + case 186: + case 150: + return node.body !== undefined + && node.asteriskToken === undefined + && hasModifier(node, 256); + } + return false; + } + ts.isAsyncFunction = isAsyncFunction; + function isNumericLiteral(node) { + return node.kind === 8; + } + ts.isNumericLiteral = isNumericLiteral; function isStringOrNumericLiteral(node) { var kind = node.kind; return kind === 9 @@ -6334,7 +6584,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - return name.kind === 142 && + return name.kind === 143 && !isStringOrNumericLiteral(name.expression) && !isWellKnownSymbolSyntactically(name.expression); } @@ -6344,10 +6594,10 @@ var ts; } ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically; function getPropertyNameForPropertyNameNode(name) { - if (name.kind === 70 || name.kind === 9 || name.kind === 8 || name.kind === 144) { + if (name.kind === 70 || name.kind === 9 || name.kind === 8 || name.kind === 145) { return name.text; } - if (name.kind === 142) { + if (name.kind === 143) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { var rightHandSideName = nameExpression.name.text; @@ -6392,11 +6642,11 @@ var ts; ts.isModifierKind = isModifierKind; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 144; + return root.kind === 145; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 174) { + while (node.kind === 175) { node = node.parent.parent; } return node; @@ -6404,15 +6654,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 150 - || kind === 184 - || kind === 225 + return kind === 151 || kind === 185 - || kind === 149 - || kind === 151 + || kind === 227 + || kind === 186 + || kind === 150 || kind === 152 - || kind === 230 - || kind === 261; + || kind === 153 + || kind === 232 + || kind === 264; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(node) { @@ -6420,66 +6670,44 @@ var ts; || ts.positionIsSynthesized(node.end); } ts.nodeIsSynthesized = nodeIsSynthesized; - function getOriginalNode(node, nodeTest) { - if (node) { - while (node.original !== undefined) { - node = node.original; - } + function getOriginalSourceFileOrBundle(sourceFileOrBundle) { + if (sourceFileOrBundle.kind === 265) { + return ts.updateBundle(sourceFileOrBundle, ts.sameMap(sourceFileOrBundle.sourceFiles, getOriginalSourceFile)); } - return !nodeTest || nodeTest(node) ? node : undefined; + return getOriginalSourceFile(sourceFileOrBundle); } - ts.getOriginalNode = getOriginalNode; - function isParseTreeNode(node) { - return (node.flags & 8) === 0; + ts.getOriginalSourceFileOrBundle = getOriginalSourceFileOrBundle; + function getOriginalSourceFile(sourceFile) { + return ts.getParseTreeNode(sourceFile, isSourceFile) || sourceFile; } - ts.isParseTreeNode = isParseTreeNode; - function getParseTreeNode(node, nodeTest) { - if (isParseTreeNode(node)) { - return node; - } - node = getOriginalNode(node); - if (isParseTreeNode(node) && (!nodeTest || nodeTest(node))) { - return node; - } - return undefined; - } - ts.getParseTreeNode = getParseTreeNode; function getOriginalSourceFiles(sourceFiles) { - var originalSourceFiles = []; - for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { - var sourceFile = sourceFiles_1[_i]; - var originalSourceFile = getParseTreeNode(sourceFile, isSourceFile); - if (originalSourceFile) { - originalSourceFiles.push(originalSourceFile); - } - } - return originalSourceFiles; + return ts.sameMap(sourceFiles, getOriginalSourceFile); } ts.getOriginalSourceFiles = getOriginalSourceFiles; function getOriginalNodeId(node) { - node = getOriginalNode(node); + node = ts.getOriginalNode(node); return node ? ts.getNodeId(node) : 0; } ts.getOriginalNodeId = getOriginalNodeId; function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 180 && expression.arguments !== undefined; + var hasArguments = expression.kind === 181 && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 180: + case 181: return hasArguments ? 0 : 1; - case 190: - case 187: + case 191: case 188: - case 186: case 189: - case 193: - case 195: + case 187: + case 190: + case 194: + case 196: return 1; - case 192: + case 193: switch (operator) { case 39: case 57: @@ -6503,15 +6731,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 180 && expression.arguments !== undefined; + var hasArguments = expression.kind === 181 && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 192) { + if (expression.kind === 193) { return expression.operatorToken.kind; } - else if (expression.kind === 190 || expression.kind === 191) { + else if (expression.kind === 191 || expression.kind === 192) { return expression.operator; } else { @@ -6529,37 +6757,36 @@ var ts; case 85: case 8: case 9: - case 175: case 176: - case 184: + case 177: case 185: - case 197: - case 246: - case 247: + case 186: + case 198: + case 248: + case 249: case 11: case 12: - case 194: - case 183: - case 198: - case 297: + case 195: + case 184: + case 199: return 19; - case 181: - case 177: + case 182: case 178: - return 18; - case 180: - return hasArguments ? 18 : 17; case 179: + return 18; + case 181: + return hasArguments ? 18 : 17; + case 180: return 17; - case 191: - return 16; - case 190: - case 187: - case 188: - case 186: - case 189: - return 15; case 192: + return 16; + case 191: + case 188: + case 189: + case 187: + case 190: + return 15; + case 193: switch (operatorKind) { case 50: case 51: @@ -6617,11 +6844,11 @@ var ts; default: return -1; } - case 193: + case 194: return 4; - case 195: - return 2; case 196: + return 2; + case 197: return 1; default: return -1; @@ -6644,21 +6871,15 @@ var ts; return modificationCount; } function reattachFileDiagnostics(newFile) { - if (!ts.hasProperty(fileDiagnostics, newFile.fileName)) { - return; - } - for (var _i = 0, _a = fileDiagnostics[newFile.fileName]; _i < _a.length; _i++) { - var diagnostic = _a[_i]; - diagnostic.file = newFile; - } + ts.forEach(fileDiagnostics.get(newFile.fileName), function (diagnostic) { return diagnostic.file = newFile; }); } function add(diagnostic) { var diagnostics; if (diagnostic.file) { - diagnostics = fileDiagnostics[diagnostic.file.fileName]; + diagnostics = fileDiagnostics.get(diagnostic.file.fileName); if (!diagnostics) { diagnostics = []; - fileDiagnostics[diagnostic.file.fileName] = diagnostics; + fileDiagnostics.set(diagnostic.file.fileName, diagnostics); } } else { @@ -6675,16 +6896,16 @@ var ts; function getDiagnostics(fileName) { sortAndDeduplicate(); if (fileName) { - return fileDiagnostics[fileName] || []; + return fileDiagnostics.get(fileName) || []; } var allDiagnostics = []; function pushDiagnostic(d) { allDiagnostics.push(d); } ts.forEach(nonFileDiagnostics, pushDiagnostic); - for (var key in fileDiagnostics) { - ts.forEach(fileDiagnostics[key], pushDiagnostic); - } + fileDiagnostics.forEach(function (diagnostics) { + ts.forEach(diagnostics, pushDiagnostic); + }); return ts.sortAndDeduplicateDiagnostics(allDiagnostics); } function sortAndDeduplicate() { @@ -6693,14 +6914,14 @@ var ts; } diagnosticsModified = false; nonFileDiagnostics = ts.sortAndDeduplicateDiagnostics(nonFileDiagnostics); - for (var key in fileDiagnostics) { - fileDiagnostics[key] = ts.sortAndDeduplicateDiagnostics(fileDiagnostics[key]); - } + fileDiagnostics.forEach(function (diagnostics, key) { + fileDiagnostics.set(key, ts.sortAndDeduplicateDiagnostics(diagnostics)); + }); } } ts.createDiagnosticCollection = createDiagnosticCollection; var escapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; - var escapedCharsMap = ts.createMap({ + var escapedCharsMap = ts.createMapFromTemplate({ "\0": "\\0", "\t": "\\t", "\v": "\\v", @@ -6715,13 +6936,12 @@ var ts; "\u0085": "\\u0085" }); function escapeString(s) { - s = escapedCharsRegExp.test(s) ? s.replace(escapedCharsRegExp, getReplacement) : s; - return s; - function getReplacement(c) { - return escapedCharsMap[c] || get16BitUnicodeEscapeSequence(c.charCodeAt(0)); - } + return s.replace(escapedCharsRegExp, getReplacement); } ts.escapeString = escapeString; + function getReplacement(c) { + return escapedCharsMap.get(c) || get16BitUnicodeEscapeSequence(c.charCodeAt(0)); + } function isIntrinsicJsxName(name) { var ch = name.substr(0, 1); return ch.toLowerCase() === ch; @@ -6864,129 +7084,62 @@ var ts; ts.getDeclarationEmitOutputFilePath = getDeclarationEmitOutputFilePath; function getSourceFilesToEmit(host, targetSourceFile) { var options = host.getCompilerOptions(); + var isSourceFileFromExternalLibrary = function (file) { return host.isSourceFileFromExternalLibrary(file); }; if (options.outFile || options.out) { var moduleKind = ts.getEmitModuleKind(options); - var moduleEmitEnabled = moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System; - var sourceFiles = getAllEmittableSourceFiles(); - return ts.filter(sourceFiles, moduleEmitEnabled ? isNonDeclarationFile : isBundleEmitNonExternalModule); + var moduleEmitEnabled_1 = moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System; + return ts.filter(host.getSourceFiles(), function (sourceFile) { + return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) && sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary); + }); } else { - var sourceFiles = targetSourceFile === undefined ? getAllEmittableSourceFiles() : [targetSourceFile]; - return filterSourceFilesInDirectory(sourceFiles, function (file) { return host.isSourceFileFromExternalLibrary(file); }); - } - function getAllEmittableSourceFiles() { - return options.noEmitForJsFiles ? ts.filter(host.getSourceFiles(), function (sourceFile) { return !isSourceFileJavaScript(sourceFile); }) : host.getSourceFiles(); + var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile]; + return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary); }); } } ts.getSourceFilesToEmit = getSourceFilesToEmit; - function filterSourceFilesInDirectory(sourceFiles, isSourceFileFromExternalLibrary) { - return ts.filter(sourceFiles, function (file) { return shouldEmitInDirectory(file, isSourceFileFromExternalLibrary); }); + function sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary) { + return !(options.noEmitForJsFiles && isSourceFileJavaScript(sourceFile)) && !isDeclarationFile(sourceFile) && !isSourceFileFromExternalLibrary(sourceFile); } - ts.filterSourceFilesInDirectory = filterSourceFilesInDirectory; - function isNonDeclarationFile(sourceFile) { - return !isDeclarationFile(sourceFile); - } - function shouldEmitInDirectory(sourceFile, isSourceFileFromExternalLibrary) { - return isNonDeclarationFile(sourceFile) && !isSourceFileFromExternalLibrary(sourceFile); - } - function isBundleEmitNonExternalModule(sourceFile) { - return isNonDeclarationFile(sourceFile) && !ts.isExternalModule(sourceFile); - } - function forEachTransformedEmitFile(host, sourceFiles, action, emitOnlyDtsFiles) { + ts.sourceFileMayBeEmitted = sourceFileMayBeEmitted; + function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, emitOnlyDtsFiles) { + var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile); var options = host.getCompilerOptions(); if (options.outFile || options.out) { - onBundledEmit(sourceFiles); - } - else { - for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) { - var sourceFile = sourceFiles_2[_i]; - if (!isDeclarationFile(sourceFile) && !host.isSourceFileFromExternalLibrary(sourceFile)) { - onSingleFileEmit(host, sourceFile); - } - } - } - function onSingleFileEmit(host, sourceFile) { - var extension = ".js"; - if (options.jsx === 1) { - if (isSourceFileJavaScript(sourceFile)) { - if (ts.fileExtensionIs(sourceFile.fileName, ".jsx")) { - extension = ".jsx"; - } - } - else if (sourceFile.languageVariant === 1) { - extension = ".jsx"; - } - } - var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, extension); - var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); - var declarationFilePath = !isSourceFileJavaScript(sourceFile) && (options.declaration || emitOnlyDtsFiles) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; - action(jsFilePath, sourceMapFilePath, declarationFilePath, [sourceFile], false); - } - function onBundledEmit(sourceFiles) { if (sourceFiles.length) { var jsFilePath = options.outFile || options.out; var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); - var declarationFilePath = options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : undefined; - action(jsFilePath, sourceMapFilePath, declarationFilePath, sourceFiles, true); + var declarationFilePath = options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : ""; + action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, ts.createBundle(sourceFiles), emitOnlyDtsFiles); + } + } + else { + for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { + var sourceFile = sourceFiles_1[_i]; + var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, getOutputExtension(sourceFile, options)); + var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); + var declarationFilePath = !isSourceFileJavaScript(sourceFile) && (emitOnlyDtsFiles || options.declaration) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; + action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, sourceFile, emitOnlyDtsFiles); } } } - ts.forEachTransformedEmitFile = forEachTransformedEmitFile; + ts.forEachEmittedFile = forEachEmittedFile; function getSourceMapFilePath(jsFilePath, options) { return options.sourceMap ? jsFilePath + ".map" : undefined; } - function forEachExpectedEmitFile(host, action, targetSourceFile, emitOnlyDtsFiles) { - var options = host.getCompilerOptions(); - if (options.outFile || options.out) { - onBundledEmit(host); - } - else { - var sourceFiles = targetSourceFile === undefined ? getSourceFilesToEmit(host) : [targetSourceFile]; - for (var _i = 0, sourceFiles_3 = sourceFiles; _i < sourceFiles_3.length; _i++) { - var sourceFile = sourceFiles_3[_i]; - if (shouldEmitInDirectory(sourceFile, function (file) { return host.isSourceFileFromExternalLibrary(file); })) { - onSingleFileEmit(host, sourceFile); + function getOutputExtension(sourceFile, options) { + if (options.jsx === 1) { + if (isSourceFileJavaScript(sourceFile)) { + if (ts.fileExtensionIs(sourceFile.fileName, ".jsx")) { + return ".jsx"; } } - } - function onSingleFileEmit(host, sourceFile) { - var extension = ".js"; - if (options.jsx === 1) { - if (isSourceFileJavaScript(sourceFile)) { - if (ts.fileExtensionIs(sourceFile.fileName, ".jsx")) { - extension = ".jsx"; - } - } - else if (sourceFile.languageVariant === 1) { - extension = ".jsx"; - } - } - var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, extension); - var declarationFilePath = !isSourceFileJavaScript(sourceFile) && (emitOnlyDtsFiles || options.declaration) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; - var emitFileNames = { - jsFilePath: jsFilePath, - sourceMapFilePath: getSourceMapFilePath(jsFilePath, options), - declarationFilePath: declarationFilePath - }; - action(emitFileNames, [sourceFile], false, emitOnlyDtsFiles); - } - function onBundledEmit(host) { - var bundledSources = ts.filter(getSourceFilesToEmit(host), function (sourceFile) { return !isDeclarationFile(sourceFile) && - !host.isSourceFileFromExternalLibrary(sourceFile) && - (!ts.isExternalModule(sourceFile) || - !!ts.getEmitModuleKind(options)); }); - if (bundledSources.length) { - var jsFilePath = options.outFile || options.out; - var emitFileNames = { - jsFilePath: jsFilePath, - sourceMapFilePath: getSourceMapFilePath(jsFilePath, options), - declarationFilePath: options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : undefined - }; - action(emitFileNames, bundledSources, true, emitOnlyDtsFiles); + else if (sourceFile.languageVariant === 1) { + return ".jsx"; } } + return ".js"; } - ts.forEachExpectedEmitFile = forEachExpectedEmitFile; function getSourceFilePathInNewDir(sourceFile, host, newDirPath) { var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory()); var commonSourceDirectory = host.getCommonSourceDirectory(); @@ -7011,7 +7164,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 150 && nodeIsPresent(member.body)) { + if (member.kind === 151 && nodeIsPresent(member.body)) { return member; } }); @@ -7052,10 +7205,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 151) { + if (accessor.kind === 152) { getAccessor = accessor; } - else if (accessor.kind === 152) { + else if (accessor.kind === 153) { setAccessor = accessor; } else { @@ -7064,7 +7217,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 151 || member.kind === 152) + if ((member.kind === 152 || member.kind === 153) && hasModifier(member, 32) === hasModifier(accessor, 32)) { var memberName = getPropertyNameForPropertyNameNode(member.name); var accessorName = getPropertyNameForPropertyNameNode(accessor.name); @@ -7075,10 +7228,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 151 && !getAccessor) { + if (member.kind === 152 && !getAccessor) { getAccessor = member; } - if (member.kind === 152 && !setAccessor) { + if (member.kind === 153 && !setAccessor) { setAccessor = member; } } @@ -7296,7 +7449,7 @@ var ts; } ts.isAssignmentOperator = isAssignmentOperator; function tryGetClassExtendingExpressionWithTypeArguments(node) { - if (node.kind === 199 && + if (node.kind === 200 && node.parent.token === 84 && isClassLike(node.parent.parent)) { return node.parent.parent; @@ -7314,8 +7467,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, true)) { var kind = node.left.kind; - return kind === 176 - || kind === 175; + return kind === 177 + || kind === 176; } return false; } @@ -7339,31 +7492,42 @@ var ts; return tryGetClassExtendingExpressionWithTypeArguments(node) !== undefined; } ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause; + function isExpressionWithTypeArgumentsInClassImplementsClause(node) { + return node.kind === 200 + && isEntityNameExpression(node.expression) + && node.parent + && node.parent.token === 107 + && node.parent.parent + && isClassLike(node.parent.parent); + } + ts.isExpressionWithTypeArgumentsInClassImplementsClause = isExpressionWithTypeArgumentsInClassImplementsClause; function isEntityNameExpression(node) { return node.kind === 70 || - node.kind === 177 && isEntityNameExpression(node.expression); + node.kind === 178 && isEntityNameExpression(node.expression); } ts.isEntityNameExpression = isEntityNameExpression; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 141 && node.parent.right === node) || - (node.parent.kind === 177 && node.parent.name === node); + return (node.parent.kind === 142 && node.parent.right === node) || + (node.parent.kind === 178 && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; - function isEmptyObjectLiteralOrArrayLiteral(expression) { - var kind = expression.kind; - if (kind === 176) { - return expression.properties.length === 0; - } - if (kind === 175) { - return expression.elements.length === 0; - } - return false; + function isEmptyObjectLiteral(expression) { + return expression.kind === 177 && + expression.properties.length === 0; } - ts.isEmptyObjectLiteralOrArrayLiteral = isEmptyObjectLiteralOrArrayLiteral; + ts.isEmptyObjectLiteral = isEmptyObjectLiteral; + function isEmptyArrayLiteral(expression) { + return expression.kind === 176 && + expression.elements.length === 0; + } + ts.isEmptyArrayLiteral = isEmptyArrayLiteral; function getLocalSymbolForExportDefault(symbol) { - return symbol && symbol.valueDeclaration && hasModifier(symbol.valueDeclaration, 512) ? symbol.valueDeclaration.localSymbol : undefined; + return isExportDefaultSymbol(symbol) ? symbol.valueDeclaration.localSymbol : undefined; } ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; + function isExportDefaultSymbol(symbol) { + return symbol && symbol.valueDeclaration && hasModifier(symbol.valueDeclaration, 512); + } function tryExtractTypeScriptExtension(fileName) { return ts.find(ts.supportedTypescriptExtensionsForExtractExtension, function (extension) { return ts.fileExtensionIs(fileName, extension); }); } @@ -7397,39 +7561,6 @@ var ts; } return output; } - ts.stringify = typeof JSON !== "undefined" && JSON.stringify - ? JSON.stringify - : stringifyFallback; - function stringifyFallback(value) { - return value === undefined ? undefined : stringifyValue(value); - } - function stringifyValue(value) { - return typeof value === "string" ? "\"" + escapeString(value) + "\"" - : typeof value === "number" ? isFinite(value) ? String(value) : "null" - : typeof value === "boolean" ? value ? "true" : "false" - : typeof value === "object" && value ? ts.isArray(value) ? cycleCheck(stringifyArray, value) : cycleCheck(stringifyObject, value) - : "null"; - } - function cycleCheck(cb, value) { - ts.Debug.assert(!value.hasOwnProperty("__cycle"), "Converting circular structure to JSON"); - value.__cycle = true; - var result = cb(value); - delete value.__cycle; - return result; - } - function stringifyArray(value) { - return "[" + ts.reduceLeft(value, stringifyElement, "") + "]"; - } - function stringifyElement(memo, value) { - return (memo ? memo + "," : memo) + stringifyValue(value); - } - function stringifyObject(value) { - return "{" + ts.reduceOwnProperties(value, stringifyProperty, "") + "}"; - } - function stringifyProperty(memo, value, key) { - return value === undefined || typeof value === "function" || key === "__cycle" ? memo - : (memo ? memo + "," : memo) + ("\"" + escapeString(key) + "\":" + stringifyValue(value)); - } var base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; function convertToBase64(input) { var result = ""; @@ -7488,39 +7619,39 @@ var ts; || kind === 94) { return true; } - else if (kind === 177) { + else if (kind === 178) { return isSimpleExpressionWorker(node.expression, depth + 1); } - else if (kind === 178) { + else if (kind === 179) { return isSimpleExpressionWorker(node.expression, depth + 1) && isSimpleExpressionWorker(node.argumentExpression, depth + 1); } - else if (kind === 190 - || kind === 191) { + else if (kind === 191 + || kind === 192) { return isSimpleExpressionWorker(node.operand, depth + 1); } - else if (kind === 192) { + else if (kind === 193) { return node.operatorToken.kind !== 39 && isSimpleExpressionWorker(node.left, depth + 1) && isSimpleExpressionWorker(node.right, depth + 1); } - else if (kind === 193) { + else if (kind === 194) { return isSimpleExpressionWorker(node.condition, depth + 1) && isSimpleExpressionWorker(node.whenTrue, depth + 1) && isSimpleExpressionWorker(node.whenFalse, depth + 1); } - else if (kind === 188 - || kind === 187 - || kind === 186) { + else if (kind === 189 + || kind === 188 + || kind === 187) { return isSimpleExpressionWorker(node.expression, depth + 1); } - else if (kind === 175) { + else if (kind === 176) { return node.elements.length === 0; } - else if (kind === 176) { + else if (kind === 177) { return node.properties.length === 0; } - else if (kind === 179) { + else if (kind === 180) { if (!isSimpleExpressionWorker(node.expression, depth + 1)) { return false; } @@ -7535,16 +7666,19 @@ var ts; } return false; } - var syntaxKindCache = ts.createMap(); + var syntaxKindCache = []; function formatSyntaxKind(kind) { var syntaxKindEnum = ts.SyntaxKind; if (syntaxKindEnum) { - if (syntaxKindCache[kind]) { - return syntaxKindCache[kind]; + var cached = syntaxKindCache[kind]; + if (cached !== undefined) { + return cached; } - for (var name_7 in syntaxKindEnum) { - if (syntaxKindEnum[name_7] === kind) { - return syntaxKindCache[kind] = kind.toString() + " (" + name_7 + ")"; + for (var name in syntaxKindEnum) { + if (syntaxKindEnum[name] === kind) { + var result = kind + " (" + name + ")"; + syntaxKindCache[kind] = result; + return result; } } } @@ -7553,6 +7687,14 @@ var ts; } } ts.formatSyntaxKind = formatSyntaxKind; + function getRangePos(range) { + return range ? range.pos : -1; + } + ts.getRangePos = getRangePos; + function getRangeEnd(range) { + return range ? range.end : -1; + } + ts.getRangeEnd = getRangeEnd; function movePos(pos, value) { return ts.positionIsSynthesized(pos) ? -1 : pos + value; } @@ -7627,11 +7769,11 @@ var ts; } ts.getStartPositionOfRange = getStartPositionOfRange; function isDeclarationNameOfEnumOrNamespace(node) { - var parseNode = getParseTreeNode(node); + var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 229: - case 230: + case 231: + case 232: return parseNode === parseNode.parent.name; } } @@ -7649,7 +7791,7 @@ var ts; if (node.symbol) { for (var _i = 0, _a = node.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 226 && declaration !== node) { + if (declaration.kind === 228 && declaration !== node) { return true; } } @@ -7700,6 +7842,10 @@ var ts; return node.kind === 70; } ts.isIdentifier = isIdentifier; + function isVoidExpression(node) { + return node.kind === 189; + } + ts.isVoidExpression = isVoidExpression; function isGeneratedIdentifier(node) { return isIdentifier(node) && node.autoGenerateKind > 0; } @@ -7709,16 +7855,16 @@ var ts; } ts.isModifier = isModifier; function isQualifiedName(node) { - return node.kind === 141; + return node.kind === 142; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 142; + return node.kind === 143; } ts.isComputedPropertyName = isComputedPropertyName; function isEntityName(node) { var kind = node.kind; - return kind === 141 + return kind === 142 || kind === 70; } ts.isEntityName = isEntityName; @@ -7727,7 +7873,7 @@ var ts; return kind === 70 || kind === 9 || kind === 8 - || kind === 142; + || kind === 143; } ts.isPropertyName = isPropertyName; function isModuleName(node) { @@ -7739,101 +7885,105 @@ var ts; function isBindingName(node) { var kind = node.kind; return kind === 70 - || kind === 172 - || kind === 173; + || kind === 173 + || kind === 174; } ts.isBindingName = isBindingName; function isTypeParameter(node) { - return node.kind === 143; + return node.kind === 144; } ts.isTypeParameter = isTypeParameter; function isParameter(node) { - return node.kind === 144; + return node.kind === 145; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 145; + return node.kind === 146; } ts.isDecorator = isDecorator; function isMethodDeclaration(node) { - return node.kind === 149; + return node.kind === 150; } ts.isMethodDeclaration = isMethodDeclaration; function isClassElement(node) { var kind = node.kind; - return kind === 150 - || kind === 147 - || kind === 149 - || kind === 151 + return kind === 151 + || kind === 148 + || kind === 150 || kind === 152 - || kind === 155 - || kind === 203; + || kind === 153 + || kind === 156 + || kind === 205; } ts.isClassElement = isClassElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 257 - || kind === 258 - || kind === 259 - || kind === 149 - || kind === 151 + return kind === 260 + || kind === 261 + || kind === 262 + || kind === 150 || kind === 152 - || kind === 244; + || kind === 153 + || kind === 246; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; function isTypeNodeKind(kind) { - return (kind >= 156 && kind <= 171) + return (kind >= 157 && kind <= 172) || kind === 118 || kind === 132 + || kind === 133 || kind === 121 - || kind === 134 || kind === 135 + || kind === 136 + || kind === 98 || kind === 104 + || kind === 138 + || kind === 94 || kind === 129 - || kind === 199; + || kind === 200; } function isTypeNode(node) { return isTypeNodeKind(node.kind); } ts.isTypeNode = isTypeNode; function isArrayBindingPattern(node) { - return node.kind === 173; + return node.kind === 174; } ts.isArrayBindingPattern = isArrayBindingPattern; function isObjectBindingPattern(node) { - return node.kind === 172; + return node.kind === 173; } ts.isObjectBindingPattern = isObjectBindingPattern; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 173 - || kind === 172; + return kind === 174 + || kind === 173; } return false; } ts.isBindingPattern = isBindingPattern; function isAssignmentPattern(node) { var kind = node.kind; - return kind === 175 - || kind === 176; + return kind === 176 + || kind === 177; } ts.isAssignmentPattern = isAssignmentPattern; function isBindingElement(node) { - return node.kind === 174; + return node.kind === 175; } ts.isBindingElement = isBindingElement; function isArrayBindingElement(node) { var kind = node.kind; - return kind === 174 - || kind === 198; + return kind === 175 + || kind === 199; } ts.isArrayBindingElement = isArrayBindingElement; function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 223: - case 144: - case 174: + case 225: + case 145: + case 175: return true; } return false; @@ -7846,8 +7996,8 @@ var ts; ts.isBindingOrAssignmentPattern = isBindingOrAssignmentPattern; function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 172: - case 176: + case 173: + case 177: return true; } return false; @@ -7855,94 +8005,100 @@ var ts; ts.isObjectBindingOrAssignmentPattern = isObjectBindingOrAssignmentPattern; function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 173: - case 175: + case 174: + case 176: return true; } return false; } ts.isArrayBindingOrAssignmentPattern = isArrayBindingOrAssignmentPattern; function isArrayLiteralExpression(node) { - return node.kind === 175; + return node.kind === 176; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 176; + return node.kind === 177; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 177; + return node.kind === 178; } ts.isPropertyAccessExpression = isPropertyAccessExpression; + function isPropertyAccessOrQualifiedName(node) { + var kind = node.kind; + return kind === 178 + || kind === 142; + } + ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isElementAccessExpression(node) { - return node.kind === 178; + return node.kind === 179; } ts.isElementAccessExpression = isElementAccessExpression; function isBinaryExpression(node) { - return node.kind === 192; + return node.kind === 193; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 193; + return node.kind === 194; } ts.isConditionalExpression = isConditionalExpression; function isCallExpression(node) { - return node.kind === 179; + return node.kind === 180; } ts.isCallExpression = isCallExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 194 + return kind === 195 || kind === 12; } ts.isTemplateLiteral = isTemplateLiteral; function isSpreadExpression(node) { - return node.kind === 196; + return node.kind === 197; } ts.isSpreadExpression = isSpreadExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 199; + return node.kind === 200; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isLeftHandSideExpressionKind(kind) { - return kind === 177 - || kind === 178 - || kind === 180 + return kind === 178 || kind === 179 - || kind === 246 - || kind === 247 || kind === 181 - || kind === 175 - || kind === 183 + || kind === 180 + || kind === 248 + || kind === 249 + || kind === 182 || kind === 176 - || kind === 197 || kind === 184 + || kind === 177 + || kind === 198 + || kind === 185 || kind === 70 || kind === 11 || kind === 8 || kind === 9 || kind === 12 - || kind === 194 + || kind === 195 || kind === 85 || kind === 94 || kind === 98 || kind === 100 || kind === 96 - || kind === 201 - || kind === 297; + || kind === 202 + || kind === 203; } function isLeftHandSideExpression(node) { return isLeftHandSideExpressionKind(ts.skipPartiallyEmittedExpressions(node).kind); } ts.isLeftHandSideExpression = isLeftHandSideExpression; function isUnaryExpressionKind(kind) { - return kind === 190 - || kind === 191 - || kind === 186 + return kind === 191 + || kind === 192 || kind === 187 || kind === 188 || kind === 189 - || kind === 182 + || kind === 190 + || kind === 183 || isLeftHandSideExpressionKind(kind); } function isUnaryExpression(node) { @@ -7950,14 +8106,13 @@ var ts; } ts.isUnaryExpression = isUnaryExpression; function isExpressionKind(kind) { - return kind === 193 - || kind === 195 - || kind === 185 - || kind === 192 + return kind === 194 || kind === 196 - || kind === 200 - || kind === 198 - || kind === 297 + || kind === 186 + || kind === 193 + || kind === 197 + || kind === 201 + || kind === 199 || isUnaryExpressionKind(kind); } function isExpression(node) { @@ -7966,16 +8121,16 @@ var ts; ts.isExpression = isExpression; function isAssertionExpression(node) { var kind = node.kind; - return kind === 182 - || kind === 200; + return kind === 183 + || kind === 201; } ts.isAssertionExpression = isAssertionExpression; function isPartiallyEmittedExpression(node) { - return node.kind === 294; + return node.kind === 295; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; function isNotEmittedStatement(node) { - return node.kind === 293; + return node.kind === 294; } ts.isNotEmittedStatement = isNotEmittedStatement; function isNotEmittedOrPartiallyEmittedNode(node) { @@ -7984,15 +8139,15 @@ var ts; } ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isOmittedExpression(node) { - return node.kind === 198; + return node.kind === 199; } ts.isOmittedExpression = isOmittedExpression; function isTemplateSpan(node) { - return node.kind === 202; + return node.kind === 204; } ts.isTemplateSpan = isTemplateSpan; function isBlock(node) { - return node.kind === 204; + return node.kind === 206; } ts.isBlock = isBlock; function isConciseBody(node) { @@ -8010,121 +8165,135 @@ var ts; } ts.isForInitializer = isForInitializer; function isVariableDeclaration(node) { - return node.kind === 223; + return node.kind === 225; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 224; + return node.kind === 226; } ts.isVariableDeclarationList = isVariableDeclarationList; function isCaseBlock(node) { - return node.kind === 232; + return node.kind === 234; } ts.isCaseBlock = isCaseBlock; function isModuleBody(node) { var kind = node.kind; - return kind === 231 - || kind === 230; + return kind === 233 + || kind === 232 + || kind === 70; } ts.isModuleBody = isModuleBody; + function isNamespaceBody(node) { + var kind = node.kind; + return kind === 233 + || kind === 232; + } + ts.isNamespaceBody = isNamespaceBody; + function isJSDocNamespaceBody(node) { + var kind = node.kind; + return kind === 70 + || kind === 232; + } + ts.isJSDocNamespaceBody = isJSDocNamespaceBody; function isImportEqualsDeclaration(node) { - return node.kind === 234; + return node.kind === 236; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportClause(node) { - return node.kind === 236; + return node.kind === 238; } ts.isImportClause = isImportClause; function isNamedImportBindings(node) { var kind = node.kind; - return kind === 238 - || kind === 237; + return kind === 240 + || kind === 239; } ts.isNamedImportBindings = isNamedImportBindings; function isImportSpecifier(node) { - return node.kind === 239; + return node.kind === 241; } ts.isImportSpecifier = isImportSpecifier; function isNamedExports(node) { - return node.kind === 242; + return node.kind === 244; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 243; + return node.kind === 245; } ts.isExportSpecifier = isExportSpecifier; function isModuleOrEnumDeclaration(node) { - return node.kind === 230 || node.kind === 229; + return node.kind === 232 || node.kind === 231; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 185 - || kind === 174 - || kind === 226 - || kind === 197 - || kind === 150 - || kind === 229 - || kind === 260 - || kind === 243 - || kind === 225 - || kind === 184 - || kind === 151 - || kind === 236 - || kind === 234 - || kind === 239 - || kind === 227 - || kind === 149 - || kind === 148 - || kind === 230 - || kind === 233 - || kind === 237 - || kind === 144 - || kind === 257 - || kind === 147 - || kind === 146 - || kind === 152 - || kind === 258 + return kind === 186 + || kind === 175 || kind === 228 - || kind === 143 - || kind === 223 - || kind === 285; + || kind === 198 + || kind === 151 + || kind === 231 + || kind === 263 + || kind === 245 + || kind === 227 + || kind === 185 + || kind === 152 + || kind === 238 + || kind === 236 + || kind === 241 + || kind === 229 + || kind === 252 + || kind === 150 + || kind === 149 + || kind === 232 + || kind === 235 + || kind === 239 + || kind === 145 + || kind === 260 + || kind === 148 + || kind === 147 + || kind === 153 + || kind === 261 + || kind === 230 + || kind === 144 + || kind === 225 + || kind === 289; } function isDeclarationStatementKind(kind) { - return kind === 225 - || kind === 244 - || kind === 226 - || kind === 227 + return kind === 227 + || kind === 246 || kind === 228 || kind === 229 || kind === 230 - || kind === 235 - || kind === 234 - || kind === 241 - || kind === 240 - || kind === 233; + || kind === 231 + || kind === 232 + || kind === 237 + || kind === 236 + || kind === 243 + || kind === 242 + || kind === 235; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 215 - || kind === 214 - || kind === 222 - || kind === 209 - || kind === 207 - || kind === 206 - || kind === 212 - || kind === 213 - || kind === 211 - || kind === 208 - || kind === 219 + return kind === 217 || kind === 216 + || kind === 224 + || kind === 211 + || kind === 209 + || kind === 208 + || kind === 214 + || kind === 215 + || kind === 213 + || kind === 210 + || kind === 221 || kind === 218 || kind === 220 - || kind === 221 - || kind === 205 - || kind === 210 - || kind === 217 - || kind === 293 - || kind === 296 - || kind === 295; + || kind === 222 + || kind === 223 + || kind === 207 + || kind === 212 + || kind === 219 + || kind === 294 + || kind === 297 + || kind === 296; } function isDeclaration(node) { return isDeclarationKind(node.kind); @@ -8142,87 +8311,98 @@ var ts; var kind = node.kind; return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) - || kind === 204; + || kind === 206; } ts.isStatement = isStatement; function isModuleReference(node) { var kind = node.kind; - return kind === 245 - || kind === 141 + return kind === 247 + || kind === 142 || kind === 70; } ts.isModuleReference = isModuleReference; function isJsxOpeningElement(node) { - return node.kind === 248; + return node.kind === 250; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 249; + return node.kind === 251; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxTagNameExpression(node) { var kind = node.kind; return kind === 98 || kind === 70 - || kind === 177; + || kind === 178; } ts.isJsxTagNameExpression = isJsxTagNameExpression; function isJsxChild(node) { var kind = node.kind; - return kind === 246 - || kind === 252 - || kind === 247 + return kind === 248 + || kind === 255 + || kind === 249 || kind === 10; } ts.isJsxChild = isJsxChild; + function isJsxAttributes(node) { + var kind = node.kind; + return kind === 253; + } + ts.isJsxAttributes = isJsxAttributes; function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 250 - || kind === 251; + return kind === 252 + || kind === 254; } ts.isJsxAttributeLike = isJsxAttributeLike; function isJsxSpreadAttribute(node) { - return node.kind === 251; + return node.kind === 254; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxAttribute(node) { - return node.kind === 250; + return node.kind === 252; } ts.isJsxAttribute = isJsxAttribute; function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 9 - || kind === 252; + || kind === 255; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; + function isJsxOpeningLikeElement(node) { + var kind = node.kind; + return kind === 250 + || kind === 249; + } + ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 253 - || kind === 254; + return kind === 256 + || kind === 257; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; function isHeritageClause(node) { - return node.kind === 255; + return node.kind === 258; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 256; + return node.kind === 259; } ts.isCatchClause = isCatchClause; function isPropertyAssignment(node) { - return node.kind === 257; + return node.kind === 260; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 258; + return node.kind === 261; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isEnumMember(node) { - return node.kind === 260; + return node.kind === 263; } ts.isEnumMember = isEnumMember; function isSourceFile(node) { - return node.kind === 261; + return node.kind === 264; } ts.isSourceFile = isSourceFile; function isWatchSet(options) { @@ -8234,10 +8414,11 @@ var ts; function getDefaultLibFileName(options) { switch (options.target) { case 5: + return "lib.esnext.full.d.ts"; case 4: - return "lib.es2017.d.ts"; + return "lib.es2017.full.d.ts"; case 3: - return "lib.es2016.d.ts"; + return "lib.es2016.full.d.ts"; case 2: return "lib.es6.d.ts"; default: @@ -8361,9 +8542,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 143) { + if (d && d.kind === 144) { for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 227) { + if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 229) { return current; } } @@ -8371,11 +8552,11 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node) { - return ts.hasModifier(node, 92) && node.parent.kind === 150 && ts.isClassLike(node.parent.parent); + return ts.hasModifier(node, 92) && node.parent.kind === 151 && ts.isClassLike(node.parent.parent); } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 174 || ts.isBindingPattern(node))) { + while (node && (node.kind === 175 || ts.isBindingPattern(node))) { node = node.parent; } return node; @@ -8383,14 +8564,14 @@ var ts; function getCombinedModifierFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = ts.getModifierFlags(node); - if (node.kind === 223) { + if (node.kind === 225) { node = node.parent; } - if (node && node.kind === 224) { + if (node && node.kind === 226) { flags |= ts.getModifierFlags(node); node = node.parent; } - if (node && node.kind === 205) { + if (node && node.kind === 207) { flags |= ts.getModifierFlags(node); } return flags; @@ -8399,14 +8580,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 223) { + if (node.kind === 225) { node = node.parent; } - if (node && node.kind === 224) { + if (node && node.kind === 226) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 205) { + if (node && node.kind === 207) { flags |= node.flags; } return flags; @@ -8459,24 +8640,46 @@ var ts; } } ts.validateLocaleAndSetLanguage = validateLocaleAndSetLanguage; + function getOriginalNode(node, nodeTest) { + if (node) { + while (node.original !== undefined) { + node = node.original; + } + } + return !nodeTest || nodeTest(node) ? node : undefined; + } + ts.getOriginalNode = getOriginalNode; + function isParseTreeNode(node) { + return (node.flags & 8) === 0; + } + ts.isParseTreeNode = isParseTreeNode; + function getParseTreeNode(node, nodeTest) { + if (node === undefined || isParseTreeNode(node)) { + return node; + } + node = getOriginalNode(node); + if (isParseTreeNode(node) && (!nodeTest || nodeTest(node))) { + return node; + } + return undefined; + } + ts.getParseTreeNode = getParseTreeNode; + function unescapeIdentifier(identifier) { + return identifier.length >= 3 && identifier.charCodeAt(0) === 95 && identifier.charCodeAt(1) === 95 && identifier.charCodeAt(2) === 95 ? identifier.substr(1) : identifier; + } + ts.unescapeIdentifier = unescapeIdentifier; })(ts || (ts = {})); var ts; (function (ts) { - var NodeConstructor; - var SourceFileConstructor; - function createNode(kind, location, flags) { - var ConstructorForKind = kind === 261 - ? (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor())) - : (NodeConstructor || (NodeConstructor = ts.objectAllocator.getNodeConstructor())); - var node = location - ? new ConstructorForKind(kind, location.pos, location.end) - : new ConstructorForKind(kind, -1, -1); - node.flags = flags | 8; + function createSynthesizedNode(kind) { + var node = ts.createNode(kind, -1, -1); + node.flags |= 8; return node; } function updateNode(updated, original) { if (updated !== original) { setOriginalNode(updated, original); + setTextRange(updated, original); if (original.startsOnNewLine) { updated.startsOnNewLine = true; } @@ -8485,7 +8688,7 @@ var ts; return updated; } ts.updateNode = updateNode; - function createNodeArray(elements, location, hasTrailingComma) { + function createNodeArray(elements, hasTrailingComma) { if (elements) { if (ts.isNodeArray(elements)) { return elements; @@ -8495,32 +8698,15 @@ var ts; elements = []; } var array = elements; - if (location) { - array.pos = location.pos; - array.end = location.end; - } - else { - array.pos = -1; - array.end = -1; - } - if (hasTrailingComma) { - array.hasTrailingComma = true; - } + array.pos = -1; + array.end = -1; + array.hasTrailingComma = hasTrailingComma; return array; } ts.createNodeArray = createNodeArray; - function createSynthesizedNode(kind, startsOnNewLine) { - var node = createNode(kind, undefined); - node.startsOnNewLine = startsOnNewLine; - return node; - } - ts.createSynthesizedNode = createSynthesizedNode; - function createSynthesizedNodeArray(elements) { - return createNodeArray(elements, undefined); - } - ts.createSynthesizedNodeArray = createSynthesizedNodeArray; function getSynthesizedClone(node) { - var clone = createNode(node.kind, undefined, node.flags); + var clone = createSynthesizedNode(node.kind); + clone.flags |= node.flags; setOriginalNode(clone, node); for (var key in node) { if (clone.hasOwnProperty(key) || !node.hasOwnProperty(key)) { @@ -8531,50 +8717,48 @@ var ts; return clone; } ts.getSynthesizedClone = getSynthesizedClone; - function getMutableClone(node) { - var clone = getSynthesizedClone(node); - clone.pos = node.pos; - clone.end = node.end; - clone.parent = node.parent; - return clone; - } - ts.getMutableClone = getMutableClone; - function createLiteral(value, location) { + function createLiteral(value) { if (typeof value === "number") { - var node = createNode(8, location, undefined); - node.text = value.toString(); - return node; + return createNumericLiteral(value + ""); } - else if (typeof value === "boolean") { - return createNode(value ? 100 : 85, location, undefined); + if (typeof value === "boolean") { + return value ? createTrue() : createFalse(); } - else if (typeof value === "string") { - var node = createNode(9, location, undefined); - node.text = value; - return node; - } - else if (value) { - var node = createNode(9, location, undefined); - node.textSourceNode = value; - node.text = value.text; - return node; + if (typeof value === "string") { + return createStringLiteral(value); } + return createLiteralFromNode(value); } ts.createLiteral = createLiteral; - var nextAutoGenerateId = 0; - function createIdentifier(text, location) { - var node = createNode(70, location); + function createNumericLiteral(value) { + var node = createSynthesizedNode(8); + node.text = value; + node.numericLiteralFlags = 0; + return node; + } + ts.createNumericLiteral = createNumericLiteral; + function createStringLiteral(text) { + var node = createSynthesizedNode(9); + node.text = text; + return node; + } + function createLiteralFromNode(sourceNode) { + var node = createStringLiteral(sourceNode.text); + node.textSourceNode = sourceNode; + return node; + } + function createIdentifier(text) { + var node = createSynthesizedNode(70); node.text = ts.escapeIdentifier(text); - node.originalKeywordKind = ts.stringToToken(text); + node.originalKeywordKind = text ? ts.stringToToken(text) : 0; node.autoGenerateKind = 0; node.autoGenerateId = 0; return node; } ts.createIdentifier = createIdentifier; - function createTempVariable(recordTempVariable, location) { - var name = createNode(70, location); - name.text = ""; - name.originalKeywordKind = 0; + var nextAutoGenerateId = 0; + function createTempVariable(recordTempVariable) { + var name = createIdentifier(""); name.autoGenerateKind = 1; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; @@ -8584,93 +8768,387 @@ var ts; return name; } ts.createTempVariable = createTempVariable; - function createLoopVariable(location) { - var name = createNode(70, location); - name.text = ""; - name.originalKeywordKind = 0; + function createLoopVariable() { + var name = createIdentifier(""); name.autoGenerateKind = 2; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; return name; } ts.createLoopVariable = createLoopVariable; - function createUniqueName(text, location) { - var name = createNode(70, location); - name.text = text; - name.originalKeywordKind = 0; + function createUniqueName(text) { + var name = createIdentifier(text); name.autoGenerateKind = 3; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; return name; } ts.createUniqueName = createUniqueName; - function getGeneratedNameForNode(node, location) { - var name = createNode(70, location); - name.original = node; - name.text = ""; - name.originalKeywordKind = 0; + function getGeneratedNameForNode(node) { + var name = createIdentifier(""); name.autoGenerateKind = 4; name.autoGenerateId = nextAutoGenerateId; + name.original = node; nextAutoGenerateId++; return name; } ts.getGeneratedNameForNode = getGeneratedNameForNode; function createToken(token) { - return createNode(token); + return createSynthesizedNode(token); } ts.createToken = createToken; function createSuper() { - var node = createNode(96); - return node; + return createSynthesizedNode(96); } ts.createSuper = createSuper; - function createThis(location) { - var node = createNode(98, location); - return node; + function createThis() { + return createSynthesizedNode(98); } ts.createThis = createThis; function createNull() { - var node = createNode(94); - return node; + return createSynthesizedNode(94); } ts.createNull = createNull; - function createComputedPropertyName(expression, location) { - var node = createNode(142, location); + function createTrue() { + return createSynthesizedNode(100); + } + ts.createTrue = createTrue; + function createFalse() { + return createSynthesizedNode(85); + } + ts.createFalse = createFalse; + function createQualifiedName(left, right) { + var node = createSynthesizedNode(142); + node.left = left; + node.right = asName(right); + return node; + } + ts.createQualifiedName = createQualifiedName; + function updateQualifiedName(node, left, right) { + return node.left !== left + || node.right !== right + ? updateNode(createQualifiedName(left, right), node) + : node; + } + ts.updateQualifiedName = updateQualifiedName; + function createComputedPropertyName(expression) { + var node = createSynthesizedNode(143); node.expression = expression; return node; } ts.createComputedPropertyName = createComputedPropertyName; function updateComputedPropertyName(node, expression) { - if (node.expression !== expression) { - return updateNode(createComputedPropertyName(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createComputedPropertyName(expression), node) + : node; } ts.updateComputedPropertyName = updateComputedPropertyName; - function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer, location, flags) { - var node = createNode(144, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createSignatureDeclaration(kind, typeParameters, parameters, type) { + var signatureDeclaration = createSynthesizedNode(kind); + signatureDeclaration.typeParameters = asNodeArray(typeParameters); + signatureDeclaration.parameters = asNodeArray(parameters); + signatureDeclaration.type = type; + return signatureDeclaration; + } + ts.createSignatureDeclaration = createSignatureDeclaration; + function updateSignatureDeclaration(node, typeParameters, parameters, type) { + return node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + ? updateNode(createSignatureDeclaration(node.kind, typeParameters, parameters, type), node) + : node; + } + function createFunctionTypeNode(typeParameters, parameters, type) { + return createSignatureDeclaration(159, typeParameters, parameters, type); + } + ts.createFunctionTypeNode = createFunctionTypeNode; + function updateFunctionTypeNode(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateFunctionTypeNode = updateFunctionTypeNode; + function createConstructorTypeNode(typeParameters, parameters, type) { + return createSignatureDeclaration(160, typeParameters, parameters, type); + } + ts.createConstructorTypeNode = createConstructorTypeNode; + function updateConstructorTypeNode(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateConstructorTypeNode = updateConstructorTypeNode; + function createCallSignatureDeclaration(typeParameters, parameters, type) { + return createSignatureDeclaration(154, typeParameters, parameters, type); + } + ts.createCallSignatureDeclaration = createCallSignatureDeclaration; + function updateCallSignatureDeclaration(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateCallSignatureDeclaration = updateCallSignatureDeclaration; + function createConstructSignatureDeclaration(typeParameters, parameters, type) { + return createSignatureDeclaration(155, typeParameters, parameters, type); + } + ts.createConstructSignatureDeclaration = createConstructSignatureDeclaration; + function updateConstructSignatureDeclaration(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateConstructSignatureDeclaration = updateConstructSignatureDeclaration; + function createMethodSignature(typeParameters, parameters, type, name, questionToken) { + var methodSignature = createSignatureDeclaration(149, typeParameters, parameters, type); + methodSignature.name = asName(name); + methodSignature.questionToken = questionToken; + return methodSignature; + } + ts.createMethodSignature = createMethodSignature; + function updateMethodSignature(node, typeParameters, parameters, type, name, questionToken) { + return node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.name !== name + || node.questionToken !== questionToken + ? updateNode(createMethodSignature(typeParameters, parameters, type, name, questionToken), node) + : node; + } + ts.updateMethodSignature = updateMethodSignature; + function createKeywordTypeNode(kind) { + return createSynthesizedNode(kind); + } + ts.createKeywordTypeNode = createKeywordTypeNode; + function createThisTypeNode() { + return createSynthesizedNode(168); + } + ts.createThisTypeNode = createThisTypeNode; + function createLiteralTypeNode(literal) { + var literalTypeNode = createSynthesizedNode(172); + literalTypeNode.literal = literal; + return literalTypeNode; + } + ts.createLiteralTypeNode = createLiteralTypeNode; + function updateLiteralTypeNode(node, literal) { + return node.literal !== literal + ? updateNode(createLiteralTypeNode(literal), node) + : node; + } + ts.updateLiteralTypeNode = updateLiteralTypeNode; + function createTypeReferenceNode(typeName, typeArguments) { + var typeReference = createSynthesizedNode(158); + typeReference.typeName = asName(typeName); + typeReference.typeArguments = asNodeArray(typeArguments); + return typeReference; + } + ts.createTypeReferenceNode = createTypeReferenceNode; + function updateTypeReferenceNode(node, typeName, typeArguments) { + return node.typeName !== typeName + || node.typeArguments !== typeArguments + ? updateNode(createTypeReferenceNode(typeName, typeArguments), node) + : node; + } + ts.updateTypeReferenceNode = updateTypeReferenceNode; + function createTypePredicateNode(parameterName, type) { + var typePredicateNode = createSynthesizedNode(157); + typePredicateNode.parameterName = asName(parameterName); + typePredicateNode.type = type; + return typePredicateNode; + } + ts.createTypePredicateNode = createTypePredicateNode; + function updateTypePredicateNode(node, parameterName, type) { + return node.parameterName !== parameterName + || node.type !== type + ? updateNode(createTypePredicateNode(parameterName, type), node) + : node; + } + ts.updateTypePredicateNode = updateTypePredicateNode; + function createTypeQueryNode(exprName) { + var typeQueryNode = createSynthesizedNode(161); + typeQueryNode.exprName = exprName; + return typeQueryNode; + } + ts.createTypeQueryNode = createTypeQueryNode; + function updateTypeQueryNode(node, exprName) { + return node.exprName !== exprName ? updateNode(createTypeQueryNode(exprName), node) : node; + } + ts.updateTypeQueryNode = updateTypeQueryNode; + function createArrayTypeNode(elementType) { + var arrayTypeNode = createSynthesizedNode(163); + arrayTypeNode.elementType = elementType; + return arrayTypeNode; + } + ts.createArrayTypeNode = createArrayTypeNode; + function updateArrayTypeNode(node, elementType) { + return node.elementType !== elementType + ? updateNode(createArrayTypeNode(elementType), node) + : node; + } + ts.updateArrayTypeNode = updateArrayTypeNode; + function createUnionOrIntersectionTypeNode(kind, types) { + var unionTypeNode = createSynthesizedNode(kind); + unionTypeNode.types = createNodeArray(types); + return unionTypeNode; + } + ts.createUnionOrIntersectionTypeNode = createUnionOrIntersectionTypeNode; + function updateUnionOrIntersectionTypeNode(node, types) { + return node.types !== types + ? updateNode(createUnionOrIntersectionTypeNode(node.kind, types), node) + : node; + } + ts.updateUnionOrIntersectionTypeNode = updateUnionOrIntersectionTypeNode; + function createTypeLiteralNode(members) { + var typeLiteralNode = createSynthesizedNode(162); + typeLiteralNode.members = createNodeArray(members); + return typeLiteralNode; + } + ts.createTypeLiteralNode = createTypeLiteralNode; + function updateTypeLiteralNode(node, members) { + return node.members !== members + ? updateNode(createTypeLiteralNode(members), node) + : node; + } + ts.updateTypeLiteralNode = updateTypeLiteralNode; + function createTupleTypeNode(elementTypes) { + var tupleTypeNode = createSynthesizedNode(164); + tupleTypeNode.elementTypes = createNodeArray(elementTypes); + return tupleTypeNode; + } + ts.createTupleTypeNode = createTupleTypeNode; + function updateTypleTypeNode(node, elementTypes) { + return node.elementTypes !== elementTypes + ? updateNode(createTupleTypeNode(elementTypes), node) + : node; + } + ts.updateTypleTypeNode = updateTypleTypeNode; + function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { + var mappedTypeNode = createSynthesizedNode(171); + mappedTypeNode.readonlyToken = readonlyToken; + mappedTypeNode.typeParameter = typeParameter; + mappedTypeNode.questionToken = questionToken; + mappedTypeNode.type = type; + return mappedTypeNode; + } + ts.createMappedTypeNode = createMappedTypeNode; + function updateMappedTypeNode(node, readonlyToken, typeParameter, questionToken, type) { + return node.readonlyToken !== readonlyToken + || node.typeParameter !== typeParameter + || node.questionToken !== questionToken + || node.type !== type + ? updateNode(createMappedTypeNode(readonlyToken, typeParameter, questionToken, type), node) + : node; + } + ts.updateMappedTypeNode = updateMappedTypeNode; + function createTypeOperatorNode(type) { + var typeOperatorNode = createSynthesizedNode(169); + typeOperatorNode.operator = 126; + typeOperatorNode.type = type; + return typeOperatorNode; + } + ts.createTypeOperatorNode = createTypeOperatorNode; + function updateTypeOperatorNode(node, type) { + return node.type !== type ? updateNode(createTypeOperatorNode(type), node) : node; + } + ts.updateTypeOperatorNode = updateTypeOperatorNode; + function createIndexedAccessTypeNode(objectType, indexType) { + var indexedAccessTypeNode = createSynthesizedNode(170); + indexedAccessTypeNode.objectType = objectType; + indexedAccessTypeNode.indexType = indexType; + return indexedAccessTypeNode; + } + ts.createIndexedAccessTypeNode = createIndexedAccessTypeNode; + function updateIndexedAccessTypeNode(node, objectType, indexType) { + return node.objectType !== objectType + || node.indexType !== indexType + ? updateNode(createIndexedAccessTypeNode(objectType, indexType), node) + : node; + } + ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; + function createTypeParameterDeclaration(name, constraint, defaultType) { + var typeParameter = createSynthesizedNode(144); + typeParameter.name = asName(name); + typeParameter.constraint = constraint; + typeParameter.default = defaultType; + return typeParameter; + } + ts.createTypeParameterDeclaration = createTypeParameterDeclaration; + function updateTypeParameterDeclaration(node, name, constraint, defaultType) { + return node.name !== name + || node.constraint !== constraint + || node.default !== defaultType + ? updateNode(createTypeParameterDeclaration(name, constraint, defaultType), node) + : node; + } + ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; + function createPropertySignature(name, questionToken, type, initializer) { + var propertySignature = createSynthesizedNode(147); + propertySignature.name = asName(name); + propertySignature.questionToken = questionToken; + propertySignature.type = type; + propertySignature.initializer = initializer; + return propertySignature; + } + ts.createPropertySignature = createPropertySignature; + function updatePropertySignature(node, name, questionToken, type, initializer) { + return node.name !== name + || node.questionToken !== questionToken + || node.type !== type + || node.initializer !== initializer + ? updateNode(createPropertySignature(name, questionToken, type, initializer), node) + : node; + } + ts.updatePropertySignature = updatePropertySignature; + function createIndexSignatureDeclaration(decorators, modifiers, parameters, type) { + var indexSignature = createSynthesizedNode(156); + indexSignature.decorators = asNodeArray(decorators); + indexSignature.modifiers = asNodeArray(modifiers); + indexSignature.parameters = createNodeArray(parameters); + indexSignature.type = type; + return indexSignature; + } + ts.createIndexSignatureDeclaration = createIndexSignatureDeclaration; + function updateIndexSignatureDeclaration(node, decorators, modifiers, parameters, type) { + return node.parameters !== parameters + || node.type !== type + || node.decorators !== decorators + || node.modifiers !== modifiers + ? updateNode(createIndexSignatureDeclaration(decorators, modifiers, parameters, type), node) + : node; + } + ts.updateIndexSignatureDeclaration = updateIndexSignatureDeclaration; + function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { + var node = createSynthesizedNode(145); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; + node.name = asName(name); node.questionToken = questionToken; node.type = type; - node.initializer = initializer ? parenthesizeExpressionForList(initializer) : undefined; + node.initializer = initializer ? ts.parenthesizeExpressionForList(initializer) : undefined; return node; } ts.createParameter = createParameter; - function updateParameter(node, decorators, modifiers, dotDotDotToken, name, type, initializer) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.type !== type || node.initializer !== initializer) { - return updateNode(createParameter(decorators, modifiers, dotDotDotToken, name, node.questionToken, type, initializer, node, node.flags), node); - } - return node; + function updateParameter(node, decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.dotDotDotToken !== dotDotDotToken + || node.name !== name + || node.questionToken !== questionToken + || node.type !== type + || node.initializer !== initializer + ? updateNode(createParameter(decorators, modifiers, dotDotDotToken, name, node.questionToken, type, initializer), node) + : node; } ts.updateParameter = updateParameter; - function createProperty(decorators, modifiers, name, questionToken, type, initializer, location) { - var node = createNode(147, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createDecorator(expression) { + var node = createSynthesizedNode(146); + node.expression = ts.parenthesizeForAccess(expression); + return node; + } + ts.createDecorator = createDecorator; + function updateDecorator(node, expression) { + return node.expression !== expression + ? updateNode(createDecorator(expression), node) + : node; + } + ts.updateDecorator = updateDecorator; + function createProperty(decorators, modifiers, name, questionToken, type, initializer) { + var node = createSynthesizedNode(148); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); node.questionToken = questionToken; node.type = type; node.initializer = initializer; @@ -8678,36 +9156,46 @@ var ts; } ts.createProperty = createProperty; function updateProperty(node, decorators, modifiers, name, type, initializer) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.type !== type || node.initializer !== initializer) { - return updateNode(createProperty(decorators, modifiers, name, node.questionToken, type, initializer, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.type !== type + || node.initializer !== initializer + ? updateNode(createProperty(decorators, modifiers, name, node.questionToken, type, initializer), node) + : node; } ts.updateProperty = updateProperty; - function createMethod(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) { - var node = createNode(149, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createMethodDeclaration(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { + var node = createSynthesizedNode(150); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + node.name = asName(name); + node.questionToken = questionToken; + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.body = body; return node; } - ts.createMethod = createMethod; - function updateMethod(node, decorators, modifiers, name, typeParameters, parameters, type, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createMethod(decorators, modifiers, node.asteriskToken, name, typeParameters, parameters, type, body, node, node.flags), node); - } - return node; + ts.createMethodDeclaration = createMethodDeclaration; + function updateMethod(node, decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.asteriskToken !== asteriskToken + || node.name !== name + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createMethodDeclaration(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body), node) + : node; } ts.updateMethod = updateMethod; - function createConstructor(decorators, modifiers, parameters, body, location, flags) { - var node = createNode(150, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createConstructor(decorators, modifiers, parameters, body) { + var node = createSynthesizedNode(151); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; node.parameters = createNodeArray(parameters); node.type = undefined; @@ -8716,17 +9204,19 @@ var ts; } ts.createConstructor = createConstructor; function updateConstructor(node, decorators, modifiers, parameters, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.parameters !== parameters || node.body !== body) { - return updateNode(createConstructor(decorators, modifiers, parameters, body, node, node.flags), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.parameters !== parameters + || node.body !== body + ? updateNode(createConstructor(decorators, modifiers, parameters, body), node) + : node; } ts.updateConstructor = updateConstructor; - function createGetAccessor(decorators, modifiers, name, parameters, type, body, location, flags) { - var node = createNode(151, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createGetAccessor(decorators, modifiers, name, parameters, type, body) { + var node = createSynthesizedNode(152); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); node.typeParameters = undefined; node.parameters = createNodeArray(parameters); node.type = type; @@ -8735,17 +9225,21 @@ var ts; } ts.createGetAccessor = createGetAccessor; function updateGetAccessor(node, decorators, modifiers, name, parameters, type, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createGetAccessor(decorators, modifiers, name, parameters, type, body, node, node.flags), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createGetAccessor(decorators, modifiers, name, parameters, type, body), node) + : node; } ts.updateGetAccessor = updateGetAccessor; - function createSetAccessor(decorators, modifiers, name, parameters, body, location, flags) { - var node = createNode(152, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createSetAccessor(decorators, modifiers, name, parameters, body) { + var node = createSynthesizedNode(153); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); node.typeParameters = undefined; node.parameters = createNodeArray(parameters); node.body = body; @@ -8753,57 +9247,60 @@ var ts; } ts.createSetAccessor = createSetAccessor; function updateSetAccessor(node, decorators, modifiers, name, parameters, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.parameters !== parameters || node.body !== body) { - return updateNode(createSetAccessor(decorators, modifiers, name, parameters, body, node, node.flags), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.parameters !== parameters + || node.body !== body + ? updateNode(createSetAccessor(decorators, modifiers, name, parameters, body), node) + : node; } ts.updateSetAccessor = updateSetAccessor; - function createObjectBindingPattern(elements, location) { - var node = createNode(172, location); + function createObjectBindingPattern(elements) { + var node = createSynthesizedNode(173); node.elements = createNodeArray(elements); return node; } ts.createObjectBindingPattern = createObjectBindingPattern; function updateObjectBindingPattern(node, elements) { - if (node.elements !== elements) { - return updateNode(createObjectBindingPattern(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createObjectBindingPattern(elements), node) + : node; } ts.updateObjectBindingPattern = updateObjectBindingPattern; - function createArrayBindingPattern(elements, location) { - var node = createNode(173, location); + function createArrayBindingPattern(elements) { + var node = createSynthesizedNode(174); node.elements = createNodeArray(elements); return node; } ts.createArrayBindingPattern = createArrayBindingPattern; function updateArrayBindingPattern(node, elements) { - if (node.elements !== elements) { - return updateNode(createArrayBindingPattern(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createArrayBindingPattern(elements), node) + : node; } ts.updateArrayBindingPattern = updateArrayBindingPattern; - function createBindingElement(propertyName, dotDotDotToken, name, initializer, location) { - var node = createNode(174, location); - node.propertyName = typeof propertyName === "string" ? createIdentifier(propertyName) : propertyName; + function createBindingElement(dotDotDotToken, propertyName, name, initializer) { + var node = createSynthesizedNode(175); node.dotDotDotToken = dotDotDotToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; + node.propertyName = asName(propertyName); + node.name = asName(name); node.initializer = initializer; return node; } ts.createBindingElement = createBindingElement; function updateBindingElement(node, dotDotDotToken, propertyName, name, initializer) { - if (node.propertyName !== propertyName || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.initializer !== initializer) { - return updateNode(createBindingElement(propertyName, dotDotDotToken, name, initializer, node), node); - } - return node; + return node.propertyName !== propertyName + || node.dotDotDotToken !== dotDotDotToken + || node.name !== name + || node.initializer !== initializer + ? updateNode(createBindingElement(dotDotDotToken, propertyName, name, initializer), node) + : node; } ts.updateBindingElement = updateBindingElement; - function createArrayLiteral(elements, location, multiLine) { - var node = createNode(175, location); - node.elements = parenthesizeListElements(createNodeArray(elements)); + function createArrayLiteral(elements, multiLine) { + var node = createSynthesizedNode(176); + node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) { node.multiLine = true; } @@ -8811,14 +9308,13 @@ var ts; } ts.createArrayLiteral = createArrayLiteral; function updateArrayLiteral(node, elements) { - if (node.elements !== elements) { - return updateNode(createArrayLiteral(elements, node, node.multiLine), node); - } - return node; + return node.elements !== elements + ? updateNode(createArrayLiteral(elements, node.multiLine), node) + : node; } ts.updateArrayLiteral = updateArrayLiteral; - function createObjectLiteral(properties, location, multiLine) { - var node = createNode(176, location); + function createObjectLiteral(properties, multiLine) { + var node = createSynthesizedNode(177); node.properties = createNodeArray(properties); if (multiLine) { node.multiLine = true; @@ -8827,431 +9323,461 @@ var ts; } ts.createObjectLiteral = createObjectLiteral; function updateObjectLiteral(node, properties) { - if (node.properties !== properties) { - return updateNode(createObjectLiteral(properties, node, node.multiLine), node); - } - return node; + return node.properties !== properties + ? updateNode(createObjectLiteral(properties, node.multiLine), node) + : node; } ts.updateObjectLiteral = updateObjectLiteral; - function createPropertyAccess(expression, name, location, flags) { - var node = createNode(177, location, flags); - node.expression = parenthesizeForAccess(expression); - (node.emitNode || (node.emitNode = {})).flags |= 65536; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createPropertyAccess(expression, name) { + var node = createSynthesizedNode(178); + node.expression = ts.parenthesizeForAccess(expression); + node.name = asName(name); + setEmitFlags(node, 65536); return node; } ts.createPropertyAccess = createPropertyAccess; function updatePropertyAccess(node, expression, name) { - if (node.expression !== expression || node.name !== name) { - var propertyAccess = createPropertyAccess(expression, name, node, node.flags); - (propertyAccess.emitNode || (propertyAccess.emitNode = {})).flags = getEmitFlags(node); - return updateNode(propertyAccess, node); - } - return node; + return node.expression !== expression + || node.name !== name + ? updateNode(setEmitFlags(createPropertyAccess(expression, name), getEmitFlags(node)), node) + : node; } ts.updatePropertyAccess = updatePropertyAccess; - function createElementAccess(expression, index, location) { - var node = createNode(178, location); - node.expression = parenthesizeForAccess(expression); - node.argumentExpression = typeof index === "number" ? createLiteral(index) : index; + function createElementAccess(expression, index) { + var node = createSynthesizedNode(179); + node.expression = ts.parenthesizeForAccess(expression); + node.argumentExpression = asExpression(index); return node; } ts.createElementAccess = createElementAccess; function updateElementAccess(node, expression, argumentExpression) { - if (node.expression !== expression || node.argumentExpression !== argumentExpression) { - return updateNode(createElementAccess(expression, argumentExpression, node), node); - } - return node; + return node.expression !== expression + || node.argumentExpression !== argumentExpression + ? updateNode(createElementAccess(expression, argumentExpression), node) + : node; } ts.updateElementAccess = updateElementAccess; - function createCall(expression, typeArguments, argumentsArray, location, flags) { - var node = createNode(179, location, flags); - node.expression = parenthesizeForAccess(expression); - if (typeArguments) { - node.typeArguments = createNodeArray(typeArguments); - } - node.arguments = parenthesizeListElements(createNodeArray(argumentsArray)); + function createCall(expression, typeArguments, argumentsArray) { + var node = createSynthesizedNode(180); + node.expression = ts.parenthesizeForAccess(expression); + node.typeArguments = asNodeArray(typeArguments); + node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); return node; } ts.createCall = createCall; function updateCall(node, expression, typeArguments, argumentsArray) { - if (expression !== node.expression || typeArguments !== node.typeArguments || argumentsArray !== node.arguments) { - return updateNode(createCall(expression, typeArguments, argumentsArray, node, node.flags), node); - } - return node; + return expression !== node.expression + || typeArguments !== node.typeArguments + || argumentsArray !== node.arguments + ? updateNode(createCall(expression, typeArguments, argumentsArray), node) + : node; } ts.updateCall = updateCall; - function createNew(expression, typeArguments, argumentsArray, location, flags) { - var node = createNode(180, location, flags); - node.expression = parenthesizeForNew(expression); - node.typeArguments = typeArguments ? createNodeArray(typeArguments) : undefined; - node.arguments = argumentsArray ? parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; + function createNew(expression, typeArguments, argumentsArray) { + var node = createSynthesizedNode(181); + node.expression = ts.parenthesizeForNew(expression); + node.typeArguments = asNodeArray(typeArguments); + node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; return node; } ts.createNew = createNew; function updateNew(node, expression, typeArguments, argumentsArray) { - if (node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray) { - return updateNode(createNew(expression, typeArguments, argumentsArray, node, node.flags), node); - } - return node; + return node.expression !== expression + || node.typeArguments !== typeArguments + || node.arguments !== argumentsArray + ? updateNode(createNew(expression, typeArguments, argumentsArray), node) + : node; } ts.updateNew = updateNew; - function createTaggedTemplate(tag, template, location) { - var node = createNode(181, location); - node.tag = parenthesizeForAccess(tag); + function createTaggedTemplate(tag, template) { + var node = createSynthesizedNode(182); + node.tag = ts.parenthesizeForAccess(tag); node.template = template; return node; } ts.createTaggedTemplate = createTaggedTemplate; function updateTaggedTemplate(node, tag, template) { - if (node.tag !== tag || node.template !== template) { - return updateNode(createTaggedTemplate(tag, template, node), node); - } - return node; + return node.tag !== tag + || node.template !== template + ? updateNode(createTaggedTemplate(tag, template), node) + : node; } ts.updateTaggedTemplate = updateTaggedTemplate; - function createParen(expression, location) { - var node = createNode(183, location); + function createTypeAssertion(type, expression) { + var node = createSynthesizedNode(183); + node.type = type; + node.expression = ts.parenthesizePrefixOperand(expression); + return node; + } + ts.createTypeAssertion = createTypeAssertion; + function updateTypeAssertion(node, type, expression) { + return node.type !== type + || node.expression !== expression + ? updateNode(createTypeAssertion(type, expression), node) + : node; + } + ts.updateTypeAssertion = updateTypeAssertion; + function createParen(expression) { + var node = createSynthesizedNode(184); node.expression = expression; return node; } ts.createParen = createParen; function updateParen(node, expression) { - if (node.expression !== expression) { - return updateNode(createParen(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createParen(expression), node) + : node; } ts.updateParen = updateParen; - function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) { - var node = createNode(184, location, flags); - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + var node = createSynthesizedNode(185); + node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.body = body; return node; } ts.createFunctionExpression = createFunctionExpression; - function updateFunctionExpression(node, modifiers, name, typeParameters, parameters, type, body) { - if (node.name !== name || node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createFunctionExpression(modifiers, node.asteriskToken, name, typeParameters, parameters, type, body, node, node.flags), node); - } - return node; + function updateFunctionExpression(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + return node.name !== name + || node.modifiers !== modifiers + || node.asteriskToken !== asteriskToken + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) + : node; } ts.updateFunctionExpression = updateFunctionExpression; - function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body, location, flags) { - var node = createNode(185, location, flags); - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { + var node = createSynthesizedNode(186); + node.modifiers = asNodeArray(modifiers); + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.equalsGreaterThanToken = equalsGreaterThanToken || createToken(35); - node.body = parenthesizeConciseBody(body); + node.body = ts.parenthesizeConciseBody(body); return node; } ts.createArrowFunction = createArrowFunction; function updateArrowFunction(node, modifiers, typeParameters, parameters, type, body) { - if (node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createArrowFunction(modifiers, typeParameters, parameters, type, node.equalsGreaterThanToken, body, node, node.flags), node); - } - return node; + return node.modifiers !== modifiers + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createArrowFunction(modifiers, typeParameters, parameters, type, node.equalsGreaterThanToken, body), node) + : node; } ts.updateArrowFunction = updateArrowFunction; - function createDelete(expression, location) { - var node = createNode(186, location); - node.expression = parenthesizePrefixOperand(expression); + function createDelete(expression) { + var node = createSynthesizedNode(187); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createDelete = createDelete; function updateDelete(node, expression) { - if (node.expression !== expression) { - return updateNode(createDelete(expression, node), expression); - } - return node; + return node.expression !== expression + ? updateNode(createDelete(expression), node) + : node; } ts.updateDelete = updateDelete; - function createTypeOf(expression, location) { - var node = createNode(187, location); - node.expression = parenthesizePrefixOperand(expression); + function createTypeOf(expression) { + var node = createSynthesizedNode(188); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createTypeOf = createTypeOf; function updateTypeOf(node, expression) { - if (node.expression !== expression) { - return updateNode(createTypeOf(expression, node), expression); - } - return node; + return node.expression !== expression + ? updateNode(createTypeOf(expression), node) + : node; } ts.updateTypeOf = updateTypeOf; - function createVoid(expression, location) { - var node = createNode(188, location); - node.expression = parenthesizePrefixOperand(expression); + function createVoid(expression) { + var node = createSynthesizedNode(189); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createVoid = createVoid; function updateVoid(node, expression) { - if (node.expression !== expression) { - return updateNode(createVoid(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createVoid(expression), node) + : node; } ts.updateVoid = updateVoid; - function createAwait(expression, location) { - var node = createNode(189, location); - node.expression = parenthesizePrefixOperand(expression); + function createAwait(expression) { + var node = createSynthesizedNode(190); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createAwait = createAwait; function updateAwait(node, expression) { - if (node.expression !== expression) { - return updateNode(createAwait(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createAwait(expression), node) + : node; } ts.updateAwait = updateAwait; - function createPrefix(operator, operand, location) { - var node = createNode(190, location); + function createPrefix(operator, operand) { + var node = createSynthesizedNode(191); node.operator = operator; - node.operand = parenthesizePrefixOperand(operand); + node.operand = ts.parenthesizePrefixOperand(operand); return node; } ts.createPrefix = createPrefix; function updatePrefix(node, operand) { - if (node.operand !== operand) { - return updateNode(createPrefix(node.operator, operand, node), node); - } - return node; + return node.operand !== operand + ? updateNode(createPrefix(node.operator, operand), node) + : node; } ts.updatePrefix = updatePrefix; - function createPostfix(operand, operator, location) { - var node = createNode(191, location); - node.operand = parenthesizePostfixOperand(operand); + function createPostfix(operand, operator) { + var node = createSynthesizedNode(192); + node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; } ts.createPostfix = createPostfix; function updatePostfix(node, operand) { - if (node.operand !== operand) { - return updateNode(createPostfix(operand, node.operator, node), node); - } - return node; + return node.operand !== operand + ? updateNode(createPostfix(operand, node.operator), node) + : node; } ts.updatePostfix = updatePostfix; - function createBinary(left, operator, right, location) { - var operatorToken = typeof operator === "number" ? createToken(operator) : operator; + function createBinary(left, operator, right) { + var node = createSynthesizedNode(193); + var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; - var node = createNode(192, location); - node.left = parenthesizeBinaryOperand(operatorKind, left, true, undefined); + node.left = ts.parenthesizeBinaryOperand(operatorKind, left, true, undefined); node.operatorToken = operatorToken; - node.right = parenthesizeBinaryOperand(operatorKind, right, false, node.left); + node.right = ts.parenthesizeBinaryOperand(operatorKind, right, false, node.left); return node; } ts.createBinary = createBinary; function updateBinary(node, left, right) { - if (node.left !== left || node.right !== right) { - return updateNode(createBinary(left, node.operatorToken, right, node), node); - } - return node; + return node.left !== left + || node.right !== right + ? updateNode(createBinary(left, node.operatorToken, right), node) + : node; } ts.updateBinary = updateBinary; - function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonTokenOrLocation, whenFalse, location) { - var node = createNode(193, whenFalse ? location : colonTokenOrLocation); - node.condition = parenthesizeForConditionalHead(condition); - if (whenFalse) { - node.questionToken = questionTokenOrWhenTrue; - node.whenTrue = parenthesizeSubexpressionOfConditionalExpression(whenTrueOrWhenFalse); - node.colonToken = colonTokenOrLocation; - node.whenFalse = parenthesizeSubexpressionOfConditionalExpression(whenFalse); - } - else { - node.questionToken = createToken(54); - node.whenTrue = parenthesizeSubexpressionOfConditionalExpression(questionTokenOrWhenTrue); - node.colonToken = createToken(55); - node.whenFalse = parenthesizeSubexpressionOfConditionalExpression(whenTrueOrWhenFalse); - } + function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { + var node = createSynthesizedNode(194); + node.condition = ts.parenthesizeForConditionalHead(condition); + node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(54); + node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); + node.colonToken = whenFalse ? colonToken : createToken(55); + node.whenFalse = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenFalse : whenTrueOrWhenFalse); return node; } ts.createConditional = createConditional; function updateConditional(node, condition, whenTrue, whenFalse) { - if (node.condition !== condition || node.whenTrue !== whenTrue || node.whenFalse !== whenFalse) { - return updateNode(createConditional(condition, node.questionToken, whenTrue, node.colonToken, whenFalse, node), node); - } - return node; + return node.condition !== condition + || node.whenTrue !== whenTrue + || node.whenFalse !== whenFalse + ? updateNode(createConditional(condition, node.questionToken, whenTrue, node.colonToken, whenFalse), node) + : node; } ts.updateConditional = updateConditional; - function createTemplateExpression(head, templateSpans, location) { - var node = createNode(194, location); + function createTemplateExpression(head, templateSpans) { + var node = createSynthesizedNode(195); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; } ts.createTemplateExpression = createTemplateExpression; function updateTemplateExpression(node, head, templateSpans) { - if (node.head !== head || node.templateSpans !== templateSpans) { - return updateNode(createTemplateExpression(head, templateSpans, node), node); - } - return node; + return node.head !== head + || node.templateSpans !== templateSpans + ? updateNode(createTemplateExpression(head, templateSpans), node) + : node; } ts.updateTemplateExpression = updateTemplateExpression; - function createYield(asteriskToken, expression, location) { - var node = createNode(195, location); - node.asteriskToken = asteriskToken; - node.expression = expression; + function createYield(asteriskTokenOrExpression, expression) { + var node = createSynthesizedNode(196); + node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 38 ? asteriskTokenOrExpression : undefined; + node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 38 ? asteriskTokenOrExpression : expression; return node; } ts.createYield = createYield; - function updateYield(node, expression) { - if (node.expression !== expression) { - return updateNode(createYield(node.asteriskToken, expression, node), node); - } - return node; + function updateYield(node, asteriskToken, expression) { + return node.expression !== expression + || node.asteriskToken !== asteriskToken + ? updateNode(createYield(asteriskToken, expression), node) + : node; } ts.updateYield = updateYield; - function createSpread(expression, location) { - var node = createNode(196, location); - node.expression = parenthesizeExpressionForList(expression); + function createSpread(expression) { + var node = createSynthesizedNode(197); + node.expression = ts.parenthesizeExpressionForList(expression); return node; } ts.createSpread = createSpread; function updateSpread(node, expression) { - if (node.expression !== expression) { - return updateNode(createSpread(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createSpread(expression), node) + : node; } ts.updateSpread = updateSpread; - function createClassExpression(modifiers, name, typeParameters, heritageClauses, members, location) { - var node = createNode(197, location); + function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { + var node = createSynthesizedNode(198); node.decorators = undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; - node.heritageClauses = createNodeArray(heritageClauses); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); + node.heritageClauses = asNodeArray(heritageClauses); node.members = createNodeArray(members); return node; } ts.createClassExpression = createClassExpression; function updateClassExpression(node, modifiers, name, typeParameters, heritageClauses, members) { - if (node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members) { - return updateNode(createClassExpression(modifiers, name, typeParameters, heritageClauses, members, node), node); - } - return node; + return node.modifiers !== modifiers + || node.name !== name + || node.typeParameters !== typeParameters + || node.heritageClauses !== heritageClauses + || node.members !== members + ? updateNode(createClassExpression(modifiers, name, typeParameters, heritageClauses, members), node) + : node; } ts.updateClassExpression = updateClassExpression; - function createOmittedExpression(location) { - var node = createNode(198, location); - return node; + function createOmittedExpression() { + return createSynthesizedNode(199); } ts.createOmittedExpression = createOmittedExpression; - function createExpressionWithTypeArguments(typeArguments, expression, location) { - var node = createNode(199, location); - node.typeArguments = typeArguments ? createNodeArray(typeArguments) : undefined; - node.expression = parenthesizeForAccess(expression); + function createExpressionWithTypeArguments(typeArguments, expression) { + var node = createSynthesizedNode(200); + node.expression = ts.parenthesizeForAccess(expression); + node.typeArguments = asNodeArray(typeArguments); return node; } ts.createExpressionWithTypeArguments = createExpressionWithTypeArguments; function updateExpressionWithTypeArguments(node, typeArguments, expression) { - if (node.typeArguments !== typeArguments || node.expression !== expression) { - return updateNode(createExpressionWithTypeArguments(typeArguments, expression, node), node); - } - return node; + return node.typeArguments !== typeArguments + || node.expression !== expression + ? updateNode(createExpressionWithTypeArguments(typeArguments, expression), node) + : node; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; - function createTemplateSpan(expression, literal, location) { - var node = createNode(202, location); + function createAsExpression(expression, type) { + var node = createSynthesizedNode(201); + node.expression = expression; + node.type = type; + return node; + } + ts.createAsExpression = createAsExpression; + function updateAsExpression(node, expression, type) { + return node.expression !== expression + || node.type !== type + ? updateNode(createAsExpression(expression, type), node) + : node; + } + ts.updateAsExpression = updateAsExpression; + function createNonNullExpression(expression) { + var node = createSynthesizedNode(202); + node.expression = ts.parenthesizeForAccess(expression); + return node; + } + ts.createNonNullExpression = createNonNullExpression; + function updateNonNullExpression(node, expression) { + return node.expression !== expression + ? updateNode(createNonNullExpression(expression), node) + : node; + } + ts.updateNonNullExpression = updateNonNullExpression; + function createTemplateSpan(expression, literal) { + var node = createSynthesizedNode(204); node.expression = expression; node.literal = literal; return node; } ts.createTemplateSpan = createTemplateSpan; function updateTemplateSpan(node, expression, literal) { - if (node.expression !== expression || node.literal !== literal) { - return updateNode(createTemplateSpan(expression, literal, node), node); - } - return node; + return node.expression !== expression + || node.literal !== literal + ? updateNode(createTemplateSpan(expression, literal), node) + : node; } ts.updateTemplateSpan = updateTemplateSpan; - function createBlock(statements, location, multiLine, flags) { - var block = createNode(204, location, flags); + function createBlock(statements, multiLine) { + var block = createSynthesizedNode(206); block.statements = createNodeArray(statements); - if (multiLine) { - block.multiLine = true; - } + if (multiLine) + block.multiLine = multiLine; return block; } ts.createBlock = createBlock; function updateBlock(node, statements) { - if (statements !== node.statements) { - return updateNode(createBlock(statements, node, node.multiLine, node.flags), node); - } - return node; + return statements !== node.statements + ? updateNode(createBlock(statements, node.multiLine), node) + : node; } ts.updateBlock = updateBlock; - function createVariableStatement(modifiers, declarationList, location, flags) { - var node = createNode(205, location, flags); + function createVariableStatement(modifiers, declarationList) { + var node = createSynthesizedNode(207); node.decorators = undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; return node; } ts.createVariableStatement = createVariableStatement; function updateVariableStatement(node, modifiers, declarationList) { - if (node.modifiers !== modifiers || node.declarationList !== declarationList) { - return updateNode(createVariableStatement(modifiers, declarationList, node, node.flags), node); - } - return node; + return node.modifiers !== modifiers + || node.declarationList !== declarationList + ? updateNode(createVariableStatement(modifiers, declarationList), node) + : node; } ts.updateVariableStatement = updateVariableStatement; - function createVariableDeclarationList(declarations, location, flags) { - var node = createNode(224, location, flags); + function createVariableDeclarationList(declarations, flags) { + var node = createSynthesizedNode(226); + node.flags |= flags; node.declarations = createNodeArray(declarations); return node; } ts.createVariableDeclarationList = createVariableDeclarationList; function updateVariableDeclarationList(node, declarations) { - if (node.declarations !== declarations) { - return updateNode(createVariableDeclarationList(declarations, node, node.flags), node); - } - return node; + return node.declarations !== declarations + ? updateNode(createVariableDeclarationList(declarations, node.flags), node) + : node; } ts.updateVariableDeclarationList = updateVariableDeclarationList; - function createVariableDeclaration(name, type, initializer, location, flags) { - var node = createNode(223, location, flags); - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createVariableDeclaration(name, type, initializer) { + var node = createSynthesizedNode(225); + node.name = asName(name); node.type = type; - node.initializer = initializer !== undefined ? parenthesizeExpressionForList(initializer) : undefined; + node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; return node; } ts.createVariableDeclaration = createVariableDeclaration; function updateVariableDeclaration(node, name, type, initializer) { - if (node.name !== name || node.type !== type || node.initializer !== initializer) { - return updateNode(createVariableDeclaration(name, type, initializer, node, node.flags), node); - } - return node; + return node.name !== name + || node.type !== type + || node.initializer !== initializer + ? updateNode(createVariableDeclaration(name, type, initializer), node) + : node; } ts.updateVariableDeclaration = updateVariableDeclaration; - function createEmptyStatement(location) { - return createNode(206, location); + function createEmptyStatement() { + return createSynthesizedNode(208); } ts.createEmptyStatement = createEmptyStatement; - function createStatement(expression, location, flags) { - var node = createNode(207, location, flags); - node.expression = parenthesizeExpressionForExpressionStatement(expression); + function createStatement(expression) { + var node = createSynthesizedNode(209); + node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } ts.createStatement = createStatement; function updateStatement(node, expression) { - if (node.expression !== expression) { - return updateNode(createStatement(expression, node, node.flags), node); - } - return node; + return node.expression !== expression + ? updateNode(createStatement(expression), node) + : node; } ts.updateStatement = updateStatement; - function createIf(expression, thenStatement, elseStatement, location) { - var node = createNode(208, location); + function createIf(expression, thenStatement, elseStatement) { + var node = createSynthesizedNode(210); node.expression = expression; node.thenStatement = thenStatement; node.elseStatement = elseStatement; @@ -9259,42 +9785,43 @@ var ts; } ts.createIf = createIf; function updateIf(node, expression, thenStatement, elseStatement) { - if (node.expression !== expression || node.thenStatement !== thenStatement || node.elseStatement !== elseStatement) { - return updateNode(createIf(expression, thenStatement, elseStatement, node), node); - } - return node; + return node.expression !== expression + || node.thenStatement !== thenStatement + || node.elseStatement !== elseStatement + ? updateNode(createIf(expression, thenStatement, elseStatement), node) + : node; } ts.updateIf = updateIf; - function createDo(statement, expression, location) { - var node = createNode(209, location); + function createDo(statement, expression) { + var node = createSynthesizedNode(211); node.statement = statement; node.expression = expression; return node; } ts.createDo = createDo; function updateDo(node, statement, expression) { - if (node.statement !== statement || node.expression !== expression) { - return updateNode(createDo(statement, expression, node), node); - } - return node; + return node.statement !== statement + || node.expression !== expression + ? updateNode(createDo(statement, expression), node) + : node; } ts.updateDo = updateDo; - function createWhile(expression, statement, location) { - var node = createNode(210, location); + function createWhile(expression, statement) { + var node = createSynthesizedNode(212); node.expression = expression; node.statement = statement; return node; } ts.createWhile = createWhile; function updateWhile(node, expression, statement) { - if (node.expression !== expression || node.statement !== statement) { - return updateNode(createWhile(expression, statement, node), node); - } - return node; + return node.expression !== expression + || node.statement !== statement + ? updateNode(createWhile(expression, statement), node) + : node; } ts.updateWhile = updateWhile; - function createFor(initializer, condition, incrementor, statement, location) { - var node = createNode(211, location, undefined); + function createFor(initializer, condition, incrementor, statement) { + var node = createSynthesizedNode(213); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -9303,14 +9830,16 @@ var ts; } ts.createFor = createFor; function updateFor(node, initializer, condition, incrementor, statement) { - if (node.initializer !== initializer || node.condition !== condition || node.incrementor !== incrementor || node.statement !== statement) { - return updateNode(createFor(initializer, condition, incrementor, statement, node), node); - } - return node; + return node.initializer !== initializer + || node.condition !== condition + || node.incrementor !== incrementor + || node.statement !== statement + ? updateNode(createFor(initializer, condition, incrementor, statement), node) + : node; } ts.updateFor = updateFor; - function createForIn(initializer, expression, statement, location) { - var node = createNode(212, location); + function createForIn(initializer, expression, statement) { + var node = createSynthesizedNode(214); node.initializer = initializer; node.expression = expression; node.statement = statement; @@ -9318,127 +9847,123 @@ var ts; } ts.createForIn = createForIn; function updateForIn(node, initializer, expression, statement) { - if (node.initializer !== initializer || node.expression !== expression || node.statement !== statement) { - return updateNode(createForIn(initializer, expression, statement, node), node); - } - return node; + return node.initializer !== initializer + || node.expression !== expression + || node.statement !== statement + ? updateNode(createForIn(initializer, expression, statement), node) + : node; } ts.updateForIn = updateForIn; - function createForOf(initializer, expression, statement, location) { - var node = createNode(213, location); + function createForOf(awaitModifier, initializer, expression, statement) { + var node = createSynthesizedNode(215); + node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = expression; node.statement = statement; return node; } ts.createForOf = createForOf; - function updateForOf(node, initializer, expression, statement) { - if (node.initializer !== initializer || node.expression !== expression || node.statement !== statement) { - return updateNode(createForOf(initializer, expression, statement, node), node); - } - return node; + function updateForOf(node, awaitModifier, initializer, expression, statement) { + return node.awaitModifier !== awaitModifier + || node.initializer !== initializer + || node.expression !== expression + || node.statement !== statement + ? updateNode(createForOf(awaitModifier, initializer, expression, statement), node) + : node; } ts.updateForOf = updateForOf; - function createContinue(label, location) { - var node = createNode(214, location); - if (label) { - node.label = label; - } + function createContinue(label) { + var node = createSynthesizedNode(216); + node.label = asName(label); return node; } ts.createContinue = createContinue; function updateContinue(node, label) { - if (node.label !== label) { - return updateNode(createContinue(label, node), node); - } - return node; + return node.label !== label + ? updateNode(createContinue(label), node) + : node; } ts.updateContinue = updateContinue; - function createBreak(label, location) { - var node = createNode(215, location); - if (label) { - node.label = label; - } + function createBreak(label) { + var node = createSynthesizedNode(217); + node.label = asName(label); return node; } ts.createBreak = createBreak; function updateBreak(node, label) { - if (node.label !== label) { - return updateNode(createBreak(label, node), node); - } - return node; + return node.label !== label + ? updateNode(createBreak(label), node) + : node; } ts.updateBreak = updateBreak; - function createReturn(expression, location) { - var node = createNode(216, location); + function createReturn(expression) { + var node = createSynthesizedNode(218); node.expression = expression; return node; } ts.createReturn = createReturn; function updateReturn(node, expression) { - if (node.expression !== expression) { - return updateNode(createReturn(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createReturn(expression), node) + : node; } ts.updateReturn = updateReturn; - function createWith(expression, statement, location) { - var node = createNode(217, location); + function createWith(expression, statement) { + var node = createSynthesizedNode(219); node.expression = expression; node.statement = statement; return node; } ts.createWith = createWith; function updateWith(node, expression, statement) { - if (node.expression !== expression || node.statement !== statement) { - return updateNode(createWith(expression, statement, node), node); - } - return node; + return node.expression !== expression + || node.statement !== statement + ? updateNode(createWith(expression, statement), node) + : node; } ts.updateWith = updateWith; - function createSwitch(expression, caseBlock, location) { - var node = createNode(218, location); - node.expression = parenthesizeExpressionForList(expression); + function createSwitch(expression, caseBlock) { + var node = createSynthesizedNode(220); + node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; } ts.createSwitch = createSwitch; function updateSwitch(node, expression, caseBlock) { - if (node.expression !== expression || node.caseBlock !== caseBlock) { - return updateNode(createSwitch(expression, caseBlock, node), node); - } - return node; + return node.expression !== expression + || node.caseBlock !== caseBlock + ? updateNode(createSwitch(expression, caseBlock), node) + : node; } ts.updateSwitch = updateSwitch; - function createLabel(label, statement, location) { - var node = createNode(219, location); - node.label = typeof label === "string" ? createIdentifier(label) : label; + function createLabel(label, statement) { + var node = createSynthesizedNode(221); + node.label = asName(label); node.statement = statement; return node; } ts.createLabel = createLabel; function updateLabel(node, label, statement) { - if (node.label !== label || node.statement !== statement) { - return updateNode(createLabel(label, statement, node), node); - } - return node; + return node.label !== label + || node.statement !== statement + ? updateNode(createLabel(label, statement), node) + : node; } ts.updateLabel = updateLabel; - function createThrow(expression, location) { - var node = createNode(220, location); + function createThrow(expression) { + var node = createSynthesizedNode(222); node.expression = expression; return node; } ts.createThrow = createThrow; function updateThrow(node, expression) { - if (node.expression !== expression) { - return updateNode(createThrow(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createThrow(expression), node) + : node; } ts.updateThrow = updateThrow; - function createTry(tryBlock, catchClause, finallyBlock, location) { - var node = createNode(221, location); + function createTry(tryBlock, catchClause, finallyBlock) { + var node = createSynthesizedNode(223); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -9446,194 +9971,284 @@ var ts; } ts.createTry = createTry; function updateTry(node, tryBlock, catchClause, finallyBlock) { - if (node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock) { - return updateNode(createTry(tryBlock, catchClause, finallyBlock, node), node); - } - return node; + return node.tryBlock !== tryBlock + || node.catchClause !== catchClause + || node.finallyBlock !== finallyBlock + ? updateNode(createTry(tryBlock, catchClause, finallyBlock), node) + : node; } ts.updateTry = updateTry; - function createCaseBlock(clauses, location) { - var node = createNode(232, location); - node.clauses = createNodeArray(clauses); - return node; - } - ts.createCaseBlock = createCaseBlock; - function updateCaseBlock(node, clauses) { - if (node.clauses !== clauses) { - return updateNode(createCaseBlock(clauses, node), node); - } - return node; - } - ts.updateCaseBlock = updateCaseBlock; - function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) { - var node = createNode(225, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + var node = createSynthesizedNode(227); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.body = body; return node; } ts.createFunctionDeclaration = createFunctionDeclaration; - function updateFunctionDeclaration(node, decorators, modifiers, name, typeParameters, parameters, type, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createFunctionDeclaration(decorators, modifiers, node.asteriskToken, name, typeParameters, parameters, type, body, node, node.flags), node); - } - return node; + function updateFunctionDeclaration(node, decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.asteriskToken !== asteriskToken + || node.name !== name + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) + : node; } ts.updateFunctionDeclaration = updateFunctionDeclaration; - function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members, location) { - var node = createNode(226, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; - node.heritageClauses = createNodeArray(heritageClauses); + function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { + var node = createSynthesizedNode(228); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); + node.heritageClauses = asNodeArray(heritageClauses); node.members = createNodeArray(members); return node; } ts.createClassDeclaration = createClassDeclaration; function updateClassDeclaration(node, decorators, modifiers, name, typeParameters, heritageClauses, members) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members) { - return updateNode(createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.typeParameters !== typeParameters + || node.heritageClauses !== heritageClauses + || node.members !== members + ? updateNode(createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members), node) + : node; } ts.updateClassDeclaration = updateClassDeclaration; - function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier, location) { - var node = createNode(235, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createEnumDeclaration(decorators, modifiers, name, members) { + var node = createSynthesizedNode(231); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.members = createNodeArray(members); + return node; + } + ts.createEnumDeclaration = createEnumDeclaration; + function updateEnumDeclaration(node, decorators, modifiers, name, members) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.members !== members + ? updateNode(createEnumDeclaration(decorators, modifiers, name, members), node) + : node; + } + ts.updateEnumDeclaration = updateEnumDeclaration; + function createModuleDeclaration(decorators, modifiers, name, body, flags) { + var node = createSynthesizedNode(232); + node.flags |= flags; + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = name; + node.body = body; + return node; + } + ts.createModuleDeclaration = createModuleDeclaration; + function updateModuleDeclaration(node, decorators, modifiers, name, body) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.body !== body + ? updateNode(createModuleDeclaration(decorators, modifiers, name, body, node.flags), node) + : node; + } + ts.updateModuleDeclaration = updateModuleDeclaration; + function createModuleBlock(statements) { + var node = createSynthesizedNode(233); + node.statements = createNodeArray(statements); + return node; + } + ts.createModuleBlock = createModuleBlock; + function updateModuleBlock(node, statements) { + return node.statements !== statements + ? updateNode(createModuleBlock(statements), node) + : node; + } + ts.updateModuleBlock = updateModuleBlock; + function createCaseBlock(clauses) { + var node = createSynthesizedNode(234); + node.clauses = createNodeArray(clauses); + return node; + } + ts.createCaseBlock = createCaseBlock; + function updateCaseBlock(node, clauses) { + return node.clauses !== clauses + ? updateNode(createCaseBlock(clauses), node) + : node; + } + ts.updateCaseBlock = updateCaseBlock; + function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { + var node = createSynthesizedNode(236); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.moduleReference = moduleReference; + return node; + } + ts.createImportEqualsDeclaration = createImportEqualsDeclaration; + function updateImportEqualsDeclaration(node, decorators, modifiers, name, moduleReference) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.moduleReference !== moduleReference + ? updateNode(createImportEqualsDeclaration(decorators, modifiers, name, moduleReference), node) + : node; + } + ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; + function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { + var node = createSynthesizedNode(237); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.importClause = importClause; node.moduleSpecifier = moduleSpecifier; return node; } ts.createImportDeclaration = createImportDeclaration; function updateImportDeclaration(node, decorators, modifiers, importClause, moduleSpecifier) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier) { - return updateNode(createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier + ? updateNode(createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier), node) + : node; } ts.updateImportDeclaration = updateImportDeclaration; - function createImportClause(name, namedBindings, location) { - var node = createNode(236, location); + function createImportClause(name, namedBindings) { + var node = createSynthesizedNode(238); node.name = name; node.namedBindings = namedBindings; return node; } ts.createImportClause = createImportClause; function updateImportClause(node, name, namedBindings) { - if (node.name !== name || node.namedBindings !== namedBindings) { - return updateNode(createImportClause(name, namedBindings, node), node); - } - return node; + return node.name !== name + || node.namedBindings !== namedBindings + ? updateNode(createImportClause(name, namedBindings), node) + : node; } ts.updateImportClause = updateImportClause; - function createNamespaceImport(name, location) { - var node = createNode(237, location); + function createNamespaceImport(name) { + var node = createSynthesizedNode(239); node.name = name; return node; } ts.createNamespaceImport = createNamespaceImport; function updateNamespaceImport(node, name) { - if (node.name !== name) { - return updateNode(createNamespaceImport(name, node), node); - } - return node; + return node.name !== name + ? updateNode(createNamespaceImport(name), node) + : node; } ts.updateNamespaceImport = updateNamespaceImport; - function createNamedImports(elements, location) { - var node = createNode(238, location); + function createNamedImports(elements) { + var node = createSynthesizedNode(240); node.elements = createNodeArray(elements); return node; } ts.createNamedImports = createNamedImports; function updateNamedImports(node, elements) { - if (node.elements !== elements) { - return updateNode(createNamedImports(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createNamedImports(elements), node) + : node; } ts.updateNamedImports = updateNamedImports; - function createImportSpecifier(propertyName, name, location) { - var node = createNode(239, location); + function createImportSpecifier(propertyName, name) { + var node = createSynthesizedNode(241); node.propertyName = propertyName; node.name = name; return node; } ts.createImportSpecifier = createImportSpecifier; function updateImportSpecifier(node, propertyName, name) { - if (node.propertyName !== propertyName || node.name !== name) { - return updateNode(createImportSpecifier(propertyName, name, node), node); - } - return node; + return node.propertyName !== propertyName + || node.name !== name + ? updateNode(createImportSpecifier(propertyName, name), node) + : node; } ts.updateImportSpecifier = updateImportSpecifier; - function createExportAssignment(decorators, modifiers, isExportEquals, expression, location) { - var node = createNode(240, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createExportAssignment(decorators, modifiers, isExportEquals, expression) { + var node = createSynthesizedNode(242); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; node.expression = expression; return node; } ts.createExportAssignment = createExportAssignment; function updateExportAssignment(node, decorators, modifiers, expression) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.expression !== expression) { - return updateNode(createExportAssignment(decorators, modifiers, node.isExportEquals, expression, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.expression !== expression + ? updateNode(createExportAssignment(decorators, modifiers, node.isExportEquals, expression), node) + : node; } ts.updateExportAssignment = updateExportAssignment; - function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, location) { - var node = createNode(241, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier) { + var node = createSynthesizedNode(243); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.exportClause = exportClause; node.moduleSpecifier = moduleSpecifier; return node; } ts.createExportDeclaration = createExportDeclaration; function updateExportDeclaration(node, decorators, modifiers, exportClause, moduleSpecifier) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier) { - return updateNode(createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.exportClause !== exportClause + || node.moduleSpecifier !== moduleSpecifier + ? updateNode(createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier), node) + : node; } ts.updateExportDeclaration = updateExportDeclaration; - function createNamedExports(elements, location) { - var node = createNode(242, location); + function createNamedExports(elements) { + var node = createSynthesizedNode(244); node.elements = createNodeArray(elements); return node; } ts.createNamedExports = createNamedExports; function updateNamedExports(node, elements) { - if (node.elements !== elements) { - return updateNode(createNamedExports(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createNamedExports(elements), node) + : node; } ts.updateNamedExports = updateNamedExports; - function createExportSpecifier(name, propertyName, location) { - var node = createNode(243, location); - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.propertyName = typeof propertyName === "string" ? createIdentifier(propertyName) : propertyName; + function createExportSpecifier(propertyName, name) { + var node = createSynthesizedNode(245); + node.propertyName = asName(propertyName); + node.name = asName(name); return node; } ts.createExportSpecifier = createExportSpecifier; - function updateExportSpecifier(node, name, propertyName) { - if (node.name !== name || node.propertyName !== propertyName) { - return updateNode(createExportSpecifier(name, propertyName, node), node); - } - return node; + function updateExportSpecifier(node, propertyName, name) { + return node.propertyName !== propertyName + || node.name !== name + ? updateNode(createExportSpecifier(propertyName, name), node) + : node; } ts.updateExportSpecifier = updateExportSpecifier; - function createJsxElement(openingElement, children, closingElement, location) { - var node = createNode(246, location); + function createExternalModuleReference(expression) { + var node = createSynthesizedNode(247); + node.expression = expression; + return node; + } + ts.createExternalModuleReference = createExternalModuleReference; + function updateExternalModuleReference(node, expression) { + return node.expression !== expression + ? updateNode(createExternalModuleReference(expression), node) + : node; + } + ts.updateExternalModuleReference = updateExternalModuleReference; + function createJsxElement(openingElement, children, closingElement) { + var node = createSynthesizedNode(248); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -9641,95 +10256,107 @@ var ts; } ts.createJsxElement = createJsxElement; function updateJsxElement(node, openingElement, children, closingElement) { - if (node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement) { - return updateNode(createJsxElement(openingElement, children, closingElement, node), node); - } - return node; + return node.openingElement !== openingElement + || node.children !== children + || node.closingElement !== closingElement + ? updateNode(createJsxElement(openingElement, children, closingElement), node) + : node; } ts.updateJsxElement = updateJsxElement; - function createJsxSelfClosingElement(tagName, attributes, location) { - var node = createNode(247, location); + function createJsxSelfClosingElement(tagName, attributes) { + var node = createSynthesizedNode(249); node.tagName = tagName; - node.attributes = createNodeArray(attributes); + node.attributes = attributes; return node; } ts.createJsxSelfClosingElement = createJsxSelfClosingElement; function updateJsxSelfClosingElement(node, tagName, attributes) { - if (node.tagName !== tagName || node.attributes !== attributes) { - return updateNode(createJsxSelfClosingElement(tagName, attributes, node), node); - } - return node; + return node.tagName !== tagName + || node.attributes !== attributes + ? updateNode(createJsxSelfClosingElement(tagName, attributes), node) + : node; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; - function createJsxOpeningElement(tagName, attributes, location) { - var node = createNode(248, location); + function createJsxOpeningElement(tagName, attributes) { + var node = createSynthesizedNode(250); node.tagName = tagName; - node.attributes = createNodeArray(attributes); + node.attributes = attributes; return node; } ts.createJsxOpeningElement = createJsxOpeningElement; function updateJsxOpeningElement(node, tagName, attributes) { - if (node.tagName !== tagName || node.attributes !== attributes) { - return updateNode(createJsxOpeningElement(tagName, attributes, node), node); - } - return node; + return node.tagName !== tagName + || node.attributes !== attributes + ? updateNode(createJsxOpeningElement(tagName, attributes), node) + : node; } ts.updateJsxOpeningElement = updateJsxOpeningElement; - function createJsxClosingElement(tagName, location) { - var node = createNode(249, location); + function createJsxClosingElement(tagName) { + var node = createSynthesizedNode(251); node.tagName = tagName; return node; } ts.createJsxClosingElement = createJsxClosingElement; function updateJsxClosingElement(node, tagName) { - if (node.tagName !== tagName) { - return updateNode(createJsxClosingElement(tagName, node), node); - } - return node; + return node.tagName !== tagName + ? updateNode(createJsxClosingElement(tagName), node) + : node; } ts.updateJsxClosingElement = updateJsxClosingElement; - function createJsxAttribute(name, initializer, location) { - var node = createNode(250, location); + function createJsxAttributes(properties) { + var jsxAttributes = createSynthesizedNode(253); + jsxAttributes.properties = createNodeArray(properties); + return jsxAttributes; + } + ts.createJsxAttributes = createJsxAttributes; + function updateJsxAttributes(jsxAttributes, properties) { + if (jsxAttributes.properties !== properties) { + return updateNode(createJsxAttributes(properties), jsxAttributes); + } + return jsxAttributes; + } + ts.updateJsxAttributes = updateJsxAttributes; + function createJsxAttribute(name, initializer) { + var node = createSynthesizedNode(252); node.name = name; node.initializer = initializer; return node; } ts.createJsxAttribute = createJsxAttribute; function updateJsxAttribute(node, name, initializer) { - if (node.name !== name || node.initializer !== initializer) { - return updateNode(createJsxAttribute(name, initializer, node), node); - } - return node; + return node.name !== name + || node.initializer !== initializer + ? updateNode(createJsxAttribute(name, initializer), node) + : node; } ts.updateJsxAttribute = updateJsxAttribute; - function createJsxSpreadAttribute(expression, location) { - var node = createNode(251, location); + function createJsxSpreadAttribute(expression) { + var node = createSynthesizedNode(254); node.expression = expression; return node; } ts.createJsxSpreadAttribute = createJsxSpreadAttribute; function updateJsxSpreadAttribute(node, expression) { - if (node.expression !== expression) { - return updateNode(createJsxSpreadAttribute(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createJsxSpreadAttribute(expression), node) + : node; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; - function createJsxExpression(expression, location) { - var node = createNode(252, location); + function createJsxExpression(dotDotDotToken, expression) { + var node = createSynthesizedNode(255); + node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; } ts.createJsxExpression = createJsxExpression; function updateJsxExpression(node, expression) { - if (node.expression !== expression) { - return updateNode(createJsxExpression(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createJsxExpression(node.dotDotDotToken, expression), node) + : node; } ts.updateJsxExpression = updateJsxExpression; - function createHeritageClause(token, types, location) { - var node = createNode(255, location); + function createHeritageClause(token, types) { + var node = createSynthesizedNode(258); node.token = token; node.types = createNodeArray(types); return node; @@ -9737,40 +10364,40 @@ var ts; ts.createHeritageClause = createHeritageClause; function updateHeritageClause(node, types) { if (node.types !== types) { - return updateNode(createHeritageClause(node.token, types, node), node); + return updateNode(createHeritageClause(node.token, types), node); } return node; } ts.updateHeritageClause = updateHeritageClause; - function createCaseClause(expression, statements, location) { - var node = createNode(253, location); - node.expression = parenthesizeExpressionForList(expression); + function createCaseClause(expression, statements) { + var node = createSynthesizedNode(256); + node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; } ts.createCaseClause = createCaseClause; function updateCaseClause(node, expression, statements) { if (node.expression !== expression || node.statements !== statements) { - return updateNode(createCaseClause(expression, statements, node), node); + return updateNode(createCaseClause(expression, statements), node); } return node; } ts.updateCaseClause = updateCaseClause; - function createDefaultClause(statements, location) { - var node = createNode(254, location); + function createDefaultClause(statements) { + var node = createSynthesizedNode(257); node.statements = createNodeArray(statements); return node; } ts.createDefaultClause = createDefaultClause; function updateDefaultClause(node, statements) { if (node.statements !== statements) { - return updateNode(createDefaultClause(statements, node), node); + return updateNode(createDefaultClause(statements), node); } return node; } ts.updateDefaultClause = updateDefaultClause; - function createCatchClause(variableDeclaration, block, location) { - var node = createNode(256, location); + function createCatchClause(variableDeclaration, block) { + var node = createSynthesizedNode(259); node.variableDeclaration = typeof variableDeclaration === "string" ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -9778,56 +10405,71 @@ var ts; ts.createCatchClause = createCatchClause; function updateCatchClause(node, variableDeclaration, block) { if (node.variableDeclaration !== variableDeclaration || node.block !== block) { - return updateNode(createCatchClause(variableDeclaration, block, node), node); + return updateNode(createCatchClause(variableDeclaration, block), node); } return node; } ts.updateCatchClause = updateCatchClause; - function createPropertyAssignment(name, initializer, location) { - var node = createNode(257, location); - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createPropertyAssignment(name, initializer) { + var node = createSynthesizedNode(260); + node.name = asName(name); node.questionToken = undefined; - node.initializer = initializer !== undefined ? parenthesizeExpressionForList(initializer) : undefined; + node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; return node; } ts.createPropertyAssignment = createPropertyAssignment; function updatePropertyAssignment(node, name, initializer) { if (node.name !== name || node.initializer !== initializer) { - return updateNode(createPropertyAssignment(name, initializer, node), node); + return updateNode(createPropertyAssignment(name, initializer), node); } return node; } ts.updatePropertyAssignment = updatePropertyAssignment; - function createShorthandPropertyAssignment(name, objectAssignmentInitializer, location) { - var node = createNode(258, location); - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; + function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { + var node = createSynthesizedNode(261); + node.name = asName(name); + node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; } ts.createShorthandPropertyAssignment = createShorthandPropertyAssignment; - function createSpreadAssignment(expression, location) { - var node = createNode(259, location); - node.expression = expression !== undefined ? parenthesizeExpressionForList(expression) : undefined; - return node; - } - ts.createSpreadAssignment = createSpreadAssignment; function updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer) { if (node.name !== name || node.objectAssignmentInitializer !== objectAssignmentInitializer) { - return updateNode(createShorthandPropertyAssignment(name, objectAssignmentInitializer, node), node); + return updateNode(createShorthandPropertyAssignment(name, objectAssignmentInitializer), node); } return node; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; + function createSpreadAssignment(expression) { + var node = createSynthesizedNode(262); + node.expression = expression !== undefined ? ts.parenthesizeExpressionForList(expression) : undefined; + return node; + } + ts.createSpreadAssignment = createSpreadAssignment; function updateSpreadAssignment(node, expression) { if (node.expression !== expression) { - return updateNode(createSpreadAssignment(expression, node), node); + return updateNode(createSpreadAssignment(expression), node); } return node; } ts.updateSpreadAssignment = updateSpreadAssignment; + function createEnumMember(name, initializer) { + var node = createSynthesizedNode(263); + node.name = asName(name); + node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); + return node; + } + ts.createEnumMember = createEnumMember; + function updateEnumMember(node, name, initializer) { + return node.name !== name + || node.initializer !== initializer + ? updateNode(createEnumMember(name, initializer), node) + : node; + } + ts.updateEnumMember = updateEnumMember; function updateSourceFileNode(node, statements) { if (node.statements !== statements) { - var updated = createNode(261, node, node.flags); + var updated = createSynthesizedNode(264); + updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; updated.fileName = node.fileName; @@ -9886,56 +10528,73 @@ var ts; return node; } ts.updateSourceFileNode = updateSourceFileNode; + function getMutableClone(node) { + var clone = getSynthesizedClone(node); + clone.pos = node.pos; + clone.end = node.end; + clone.parent = node.parent; + return clone; + } + ts.getMutableClone = getMutableClone; function createNotEmittedStatement(original) { - var node = createNode(293, original); + var node = createSynthesizedNode(294); node.original = original; + setTextRange(node, original); return node; } ts.createNotEmittedStatement = createNotEmittedStatement; function createEndOfDeclarationMarker(original) { - var node = createNode(296); + var node = createSynthesizedNode(297); node.emitNode = {}; node.original = original; return node; } ts.createEndOfDeclarationMarker = createEndOfDeclarationMarker; function createMergeDeclarationMarker(original) { - var node = createNode(295); + var node = createSynthesizedNode(296); node.emitNode = {}; node.original = original; return node; } ts.createMergeDeclarationMarker = createMergeDeclarationMarker; - function createPartiallyEmittedExpression(expression, original, location) { - var node = createNode(294, location || original); + function createPartiallyEmittedExpression(expression, original) { + var node = createSynthesizedNode(295); node.expression = expression; node.original = original; + setTextRange(node, original); return node; } ts.createPartiallyEmittedExpression = createPartiallyEmittedExpression; function updatePartiallyEmittedExpression(node, expression) { if (node.expression !== expression) { - return updateNode(createPartiallyEmittedExpression(expression, node.original, node), node); + return updateNode(createPartiallyEmittedExpression(expression, node.original), node); } return node; } ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; - function createRawExpression(text) { - var node = createNode(297); - node.text = text; + function createBundle(sourceFiles) { + var node = ts.createNode(265); + node.sourceFiles = sourceFiles; return node; } - ts.createRawExpression = createRawExpression; + ts.createBundle = createBundle; + function updateBundle(node, sourceFiles) { + if (node.sourceFiles !== sourceFiles) { + return createBundle(sourceFiles); + } + return node; + } + ts.updateBundle = updateBundle; function createComma(left, right) { return createBinary(left, 25, right); } ts.createComma = createComma; - function createLessThan(left, right, location) { - return createBinary(left, 26, right, location); + function createLessThan(left, right) { + return createBinary(left, 26, right); } ts.createLessThan = createLessThan; - function createAssignment(left, right, location) { - return createBinary(left, 57, right, location); + function createAssignment(left, right) { + return createBinary(left, 57, right); } ts.createAssignment = createAssignment; function createStrictEquality(left, right) { @@ -9954,8 +10613,8 @@ var ts; return createBinary(left, 37, right); } ts.createSubtract = createSubtract; - function createPostfixIncrement(operand, location) { - return createPostfix(operand, 42, location); + function createPostfixIncrement(operand) { + return createPostfix(operand, 42); } ts.createPostfixIncrement = createPostfixIncrement; function createLogicalAnd(left, right) { @@ -9974,672 +10633,25 @@ var ts; return createVoid(createLiteral(0)); } ts.createVoidZero = createVoidZero; - function createTypeCheck(value, tag) { - return tag === "undefined" - ? createStrictEquality(value, createVoidZero()) - : createStrictEquality(createTypeOf(value), createLiteral(tag)); - } - ts.createTypeCheck = createTypeCheck; - function createMemberAccessForPropertyName(target, memberName, location) { - if (ts.isComputedPropertyName(memberName)) { - return createElementAccess(target, memberName.expression, location); - } - else { - var expression = ts.isIdentifier(memberName) ? createPropertyAccess(target, memberName, location) : createElementAccess(target, memberName, location); - (expression.emitNode || (expression.emitNode = {})).flags |= 64; - return expression; - } - } - ts.createMemberAccessForPropertyName = createMemberAccessForPropertyName; - function createFunctionCall(func, thisArg, argumentsList, location) { - return createCall(createPropertyAccess(func, "call"), undefined, [ - thisArg - ].concat(argumentsList), location); - } - ts.createFunctionCall = createFunctionCall; - function createFunctionApply(func, thisArg, argumentsExpression, location) { - return createCall(createPropertyAccess(func, "apply"), undefined, [ - thisArg, - argumentsExpression - ], location); - } - ts.createFunctionApply = createFunctionApply; - function createArraySlice(array, start) { - var argumentsList = []; - if (start !== undefined) { - argumentsList.push(typeof start === "number" ? createLiteral(start) : start); - } - return createCall(createPropertyAccess(array, "slice"), undefined, argumentsList); - } - ts.createArraySlice = createArraySlice; - function createArrayConcat(array, values) { - return createCall(createPropertyAccess(array, "concat"), undefined, values); - } - ts.createArrayConcat = createArrayConcat; - function createMathPow(left, right, location) { - return createCall(createPropertyAccess(createIdentifier("Math"), "pow"), undefined, [left, right], location); - } - ts.createMathPow = createMathPow; - function createReactNamespace(reactNamespace, parent) { - var react = createIdentifier(reactNamespace || "React"); - react.flags &= ~8; - react.parent = ts.getParseTreeNode(parent); - return react; - } - function createJsxFactoryExpressionFromEntityName(jsxFactory, parent) { - if (ts.isQualifiedName(jsxFactory)) { - var left = createJsxFactoryExpressionFromEntityName(jsxFactory.left, parent); - var right = createSynthesizedNode(70); - right.text = jsxFactory.right.text; - return createPropertyAccess(left, right); - } - else { - return createReactNamespace(jsxFactory.text, parent); - } - } - function createJsxFactoryExpression(jsxFactoryEntity, reactNamespace, parent) { - return jsxFactoryEntity ? - createJsxFactoryExpressionFromEntityName(jsxFactoryEntity, parent) : - createPropertyAccess(createReactNamespace(reactNamespace, parent), "createElement"); - } - function createExpressionForJsxElement(jsxFactoryEntity, reactNamespace, tagName, props, children, parentElement, location) { - var argumentsList = [tagName]; - if (props) { - argumentsList.push(props); - } - if (children && children.length > 0) { - if (!props) { - argumentsList.push(createNull()); - } - if (children.length > 1) { - for (var _i = 0, children_1 = children; _i < children_1.length; _i++) { - var child = children_1[_i]; - child.startsOnNewLine = true; - argumentsList.push(child); - } - } - else { - argumentsList.push(children[0]); - } - } - return createCall(createJsxFactoryExpression(jsxFactoryEntity, reactNamespace, parentElement), undefined, argumentsList, location); - } - ts.createExpressionForJsxElement = createExpressionForJsxElement; function createExportDefault(expression) { return createExportAssignment(undefined, undefined, false, expression); } ts.createExportDefault = createExportDefault; function createExternalModuleExport(exportName) { - return createExportDeclaration(undefined, undefined, createNamedExports([createExportSpecifier(exportName)])); + return createExportDeclaration(undefined, undefined, createNamedExports([createExportSpecifier(undefined, exportName)])); } ts.createExternalModuleExport = createExternalModuleExport; - function createLetStatement(name, initializer, location) { - return createVariableStatement(undefined, createLetDeclarationList([createVariableDeclaration(name, undefined, initializer)]), location); + function asName(name) { + return typeof name === "string" ? createIdentifier(name) : name; } - ts.createLetStatement = createLetStatement; - function createLetDeclarationList(declarations, location) { - return createVariableDeclarationList(declarations, location, 1); + function asExpression(value) { + return typeof value === "string" || typeof value === "number" ? createLiteral(value) : value; } - ts.createLetDeclarationList = createLetDeclarationList; - function createConstDeclarationList(declarations, location) { - return createVariableDeclarationList(declarations, location, 2); + function asNodeArray(array) { + return array ? createNodeArray(array) : undefined; } - ts.createConstDeclarationList = createConstDeclarationList; - function getHelperName(name) { - return setEmitFlags(createIdentifier(name), 4096 | 2); - } - ts.getHelperName = getHelperName; - function shouldBeCapturedInTempVariable(node, cacheIdentifiers) { - var target = skipParentheses(node); - switch (target.kind) { - case 70: - return cacheIdentifiers; - case 98: - case 8: - case 9: - return false; - case 175: - var elements = target.elements; - if (elements.length === 0) { - return false; - } - return true; - case 176: - return target.properties.length > 0; - default: - return true; - } - } - function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers) { - var callee = skipOuterExpressions(expression, 7); - var thisArg; - var target; - if (ts.isSuperProperty(callee)) { - thisArg = createThis(); - target = callee; - } - else if (callee.kind === 96) { - thisArg = createThis(); - target = languageVersion < 2 ? createIdentifier("_super", callee) : callee; - } - else { - switch (callee.kind) { - case 177: { - if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { - thisArg = createTempVariable(recordTempVariable); - target = createPropertyAccess(createAssignment(thisArg, callee.expression, callee.expression), callee.name, callee); - } - else { - thisArg = callee.expression; - target = callee; - } - break; - } - case 178: { - if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { - thisArg = createTempVariable(recordTempVariable); - target = createElementAccess(createAssignment(thisArg, callee.expression, callee.expression), callee.argumentExpression, callee); - } - else { - thisArg = callee.expression; - target = callee; - } - break; - } - default: { - thisArg = createVoidZero(); - target = parenthesizeForAccess(expression); - break; - } - } - } - return { target: target, thisArg: thisArg }; - } - ts.createCallBinding = createCallBinding; - function inlineExpressions(expressions) { - return ts.reduceLeft(expressions, createComma); - } - ts.inlineExpressions = inlineExpressions; - function createExpressionFromEntityName(node) { - if (ts.isQualifiedName(node)) { - var left = createExpressionFromEntityName(node.left); - var right = getMutableClone(node.right); - return createPropertyAccess(left, right, node); - } - else { - return getMutableClone(node); - } - } - ts.createExpressionFromEntityName = createExpressionFromEntityName; - function createExpressionForPropertyName(memberName) { - if (ts.isIdentifier(memberName)) { - return createLiteral(memberName, undefined); - } - else if (ts.isComputedPropertyName(memberName)) { - return getMutableClone(memberName.expression); - } - else { - return getMutableClone(memberName); - } - } - ts.createExpressionForPropertyName = createExpressionForPropertyName; - function createExpressionForObjectLiteralElementLike(node, property, receiver) { - switch (property.kind) { - case 151: - case 152: - return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine); - case 257: - return createExpressionForPropertyAssignment(property, receiver); - case 258: - return createExpressionForShorthandPropertyAssignment(property, receiver); - case 149: - return createExpressionForMethodDeclaration(property, receiver); - } - } - ts.createExpressionForObjectLiteralElementLike = createExpressionForObjectLiteralElementLike; - function createExpressionForAccessorDeclaration(properties, property, receiver, multiLine) { - var _a = ts.getAllAccessorDeclarations(properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; - if (property === firstAccessor) { - var properties_1 = []; - if (getAccessor) { - var getterFunction = createFunctionExpression(getAccessor.modifiers, undefined, undefined, undefined, getAccessor.parameters, undefined, getAccessor.body, getAccessor); - setOriginalNode(getterFunction, getAccessor); - var getter = createPropertyAssignment("get", getterFunction); - properties_1.push(getter); - } - if (setAccessor) { - var setterFunction = createFunctionExpression(setAccessor.modifiers, undefined, undefined, undefined, setAccessor.parameters, undefined, setAccessor.body, setAccessor); - setOriginalNode(setterFunction, setAccessor); - var setter = createPropertyAssignment("set", setterFunction); - properties_1.push(setter); - } - properties_1.push(createPropertyAssignment("enumerable", createLiteral(true))); - properties_1.push(createPropertyAssignment("configurable", createLiteral(true))); - var expression = createCall(createPropertyAccess(createIdentifier("Object"), "defineProperty"), undefined, [ - receiver, - createExpressionForPropertyName(property.name), - createObjectLiteral(properties_1, undefined, multiLine) - ], firstAccessor); - return ts.aggregateTransformFlags(expression); - } - return undefined; - } - function createExpressionForPropertyAssignment(property, receiver) { - return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, property.name, property.name), property.initializer, property), property)); - } - function createExpressionForShorthandPropertyAssignment(property, receiver) { - return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, property.name, property.name), getSynthesizedClone(property.name), property), property)); - } - function createExpressionForMethodDeclaration(method, receiver) { - return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, method.name, method.name), setOriginalNode(createFunctionExpression(method.modifiers, method.asteriskToken, undefined, undefined, method.parameters, undefined, method.body, method), method), method), method)); - } - function getLocalName(node, allowComments, allowSourceMaps) { - return getName(node, allowComments, allowSourceMaps, 16384); - } - ts.getLocalName = getLocalName; - function isLocalName(node) { - return (getEmitFlags(node) & 16384) !== 0; - } - ts.isLocalName = isLocalName; - function getExportName(node, allowComments, allowSourceMaps) { - return getName(node, allowComments, allowSourceMaps, 8192); - } - ts.getExportName = getExportName; - function isExportName(node) { - return (getEmitFlags(node) & 8192) !== 0; - } - ts.isExportName = isExportName; - function getDeclarationName(node, allowComments, allowSourceMaps) { - return getName(node, allowComments, allowSourceMaps); - } - ts.getDeclarationName = getDeclarationName; - function getName(node, allowComments, allowSourceMaps, emitFlags) { - if (node.name && ts.isIdentifier(node.name) && !ts.isGeneratedIdentifier(node.name)) { - var name_8 = getMutableClone(node.name); - emitFlags |= getEmitFlags(node.name); - if (!allowSourceMaps) - emitFlags |= 48; - if (!allowComments) - emitFlags |= 1536; - if (emitFlags) - setEmitFlags(name_8, emitFlags); - return name_8; - } - return getGeneratedNameForNode(node); - } - function getExternalModuleOrNamespaceExportName(ns, node, allowComments, allowSourceMaps) { - if (ns && ts.hasModifier(node, 1)) { - return getNamespaceMemberName(ns, getName(node), allowComments, allowSourceMaps); - } - return getExportName(node, allowComments, allowSourceMaps); - } - ts.getExternalModuleOrNamespaceExportName = getExternalModuleOrNamespaceExportName; - function getNamespaceMemberName(ns, name, allowComments, allowSourceMaps) { - var qualifiedName = createPropertyAccess(ns, ts.nodeIsSynthesized(name) ? name : getSynthesizedClone(name), name); - var emitFlags; - if (!allowSourceMaps) - emitFlags |= 48; - if (!allowComments) - emitFlags |= 1536; - if (emitFlags) - setEmitFlags(qualifiedName, emitFlags); - return qualifiedName; - } - ts.getNamespaceMemberName = getNamespaceMemberName; - function convertToFunctionBody(node, multiLine) { - return ts.isBlock(node) ? node : createBlock([createReturn(node, node)], node, multiLine); - } - ts.convertToFunctionBody = convertToFunctionBody; - function isUseStrictPrologue(node) { - return node.expression.text === "use strict"; - } - function addPrologueDirectives(target, source, ensureUseStrict, visitor) { - ts.Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array"); - var foundUseStrict = false; - var statementOffset = 0; - var numStatements = source.length; - while (statementOffset < numStatements) { - var statement = source[statementOffset]; - if (ts.isPrologueDirective(statement)) { - if (isUseStrictPrologue(statement)) { - foundUseStrict = true; - } - target.push(statement); - } - else { - break; - } - statementOffset++; - } - if (ensureUseStrict && !foundUseStrict) { - target.push(startOnNewLine(createStatement(createLiteral("use strict")))); - } - while (statementOffset < numStatements) { - var statement = source[statementOffset]; - if (getEmitFlags(statement) & 524288) { - target.push(visitor ? ts.visitNode(statement, visitor, ts.isStatement) : statement); - } - else { - break; - } - statementOffset++; - } - return statementOffset; - } - ts.addPrologueDirectives = addPrologueDirectives; - function startsWithUseStrict(statements) { - var firstStatement = ts.firstOrUndefined(statements); - return firstStatement !== undefined - && ts.isPrologueDirective(firstStatement) - && isUseStrictPrologue(firstStatement); - } - ts.startsWithUseStrict = startsWithUseStrict; - function ensureUseStrict(statements) { - var foundUseStrict = false; - for (var _i = 0, statements_1 = statements; _i < statements_1.length; _i++) { - var statement = statements_1[_i]; - if (ts.isPrologueDirective(statement)) { - if (isUseStrictPrologue(statement)) { - foundUseStrict = true; - break; - } - } - else { - break; - } - } - if (!foundUseStrict) { - return createNodeArray([ - startOnNewLine(createStatement(createLiteral("use strict"))) - ].concat(statements), statements); - } - return statements; - } - ts.ensureUseStrict = ensureUseStrict; - function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { - var skipped = skipPartiallyEmittedExpressions(operand); - if (skipped.kind === 183) { - return operand; - } - return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) - ? createParen(operand) - : operand; - } - ts.parenthesizeBinaryOperand = parenthesizeBinaryOperand; - function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { - var binaryOperatorPrecedence = ts.getOperatorPrecedence(192, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(192, binaryOperator); - var emittedOperand = skipPartiallyEmittedExpressions(operand); - var operandPrecedence = ts.getExpressionPrecedence(emittedOperand); - switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) { - case -1: - if (!isLeftSideOfBinary - && binaryOperatorAssociativity === 1 - && operand.kind === 195) { - return false; - } - return true; - case 1: - return false; - case 0: - if (isLeftSideOfBinary) { - return binaryOperatorAssociativity === 1; - } - else { - if (ts.isBinaryExpression(emittedOperand) - && emittedOperand.operatorToken.kind === binaryOperator) { - if (operatorHasAssociativeProperty(binaryOperator)) { - return false; - } - if (binaryOperator === 36) { - var leftKind = leftOperand ? getLiteralKindOfBinaryPlusOperand(leftOperand) : 0; - if (ts.isLiteralKind(leftKind) && leftKind === getLiteralKindOfBinaryPlusOperand(emittedOperand)) { - return false; - } - } - } - var operandAssociativity = ts.getExpressionAssociativity(emittedOperand); - return operandAssociativity === 0; - } - } - } - function operatorHasAssociativeProperty(binaryOperator) { - return binaryOperator === 38 - || binaryOperator === 48 - || binaryOperator === 47 - || binaryOperator === 49; - } - function getLiteralKindOfBinaryPlusOperand(node) { - node = skipPartiallyEmittedExpressions(node); - if (ts.isLiteralKind(node.kind)) { - return node.kind; - } - if (node.kind === 192 && node.operatorToken.kind === 36) { - if (node.cachedLiteralKind !== undefined) { - return node.cachedLiteralKind; - } - var leftKind = getLiteralKindOfBinaryPlusOperand(node.left); - var literalKind = ts.isLiteralKind(leftKind) - && leftKind === getLiteralKindOfBinaryPlusOperand(node.right) - ? leftKind - : 0; - node.cachedLiteralKind = literalKind; - return literalKind; - } - return 0; - } - function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(193, 54); - var emittedCondition = skipPartiallyEmittedExpressions(condition); - var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); - if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1) { - return createParen(condition); - } - return condition; - } - ts.parenthesizeForConditionalHead = parenthesizeForConditionalHead; - function parenthesizeSubexpressionOfConditionalExpression(e) { - return e.kind === 192 && e.operatorToken.kind === 25 - ? createParen(e) - : e; - } - function parenthesizeForNew(expression) { - var emittedExpression = skipPartiallyEmittedExpressions(expression); - switch (emittedExpression.kind) { - case 179: - return createParen(expression); - case 180: - return emittedExpression.arguments - ? expression - : createParen(expression); - } - return parenthesizeForAccess(expression); - } - ts.parenthesizeForNew = parenthesizeForNew; - function parenthesizeForAccess(expression) { - var emittedExpression = skipPartiallyEmittedExpressions(expression); - if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 180 || emittedExpression.arguments) - && emittedExpression.kind !== 8) { - return expression; - } - return createParen(expression, expression); - } - ts.parenthesizeForAccess = parenthesizeForAccess; - function parenthesizePostfixOperand(operand) { - return ts.isLeftHandSideExpression(operand) - ? operand - : createParen(operand, operand); - } - ts.parenthesizePostfixOperand = parenthesizePostfixOperand; - function parenthesizePrefixOperand(operand) { - return ts.isUnaryExpression(operand) - ? operand - : createParen(operand, operand); - } - ts.parenthesizePrefixOperand = parenthesizePrefixOperand; - function parenthesizeListElements(elements) { - var result; - for (var i = 0; i < elements.length; i++) { - var element = parenthesizeExpressionForList(elements[i]); - if (result !== undefined || element !== elements[i]) { - if (result === undefined) { - result = elements.slice(0, i); - } - result.push(element); - } - } - if (result !== undefined) { - return createNodeArray(result, elements, elements.hasTrailingComma); - } - return elements; - } - function parenthesizeExpressionForList(expression) { - var emittedExpression = skipPartiallyEmittedExpressions(expression); - var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(192, 25); - return expressionPrecedence > commaPrecedence - ? expression - : createParen(expression, expression); - } - ts.parenthesizeExpressionForList = parenthesizeExpressionForList; - function parenthesizeExpressionForExpressionStatement(expression) { - var emittedExpression = skipPartiallyEmittedExpressions(expression); - if (ts.isCallExpression(emittedExpression)) { - var callee = emittedExpression.expression; - var kind = skipPartiallyEmittedExpressions(callee).kind; - if (kind === 184 || kind === 185) { - var mutableCall = getMutableClone(emittedExpression); - mutableCall.expression = createParen(callee, callee); - return recreatePartiallyEmittedExpressions(expression, mutableCall); - } - } - else { - var leftmostExpressionKind = getLeftmostExpression(emittedExpression).kind; - if (leftmostExpressionKind === 176 || leftmostExpressionKind === 184) { - return createParen(expression, expression); - } - } - return expression; - } - ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; - function recreatePartiallyEmittedExpressions(originalOuterExpression, newInnerExpression) { - if (ts.isPartiallyEmittedExpression(originalOuterExpression)) { - var clone_1 = getMutableClone(originalOuterExpression); - clone_1.expression = recreatePartiallyEmittedExpressions(clone_1.expression, newInnerExpression); - return clone_1; - } - return newInnerExpression; - } - function getLeftmostExpression(node) { - while (true) { - switch (node.kind) { - case 191: - node = node.operand; - continue; - case 192: - node = node.left; - continue; - case 193: - node = node.condition; - continue; - case 179: - case 178: - case 177: - node = node.expression; - continue; - case 294: - node = node.expression; - continue; - } - return node; - } - } - function parenthesizeConciseBody(body) { - var emittedBody = skipPartiallyEmittedExpressions(body); - if (emittedBody.kind === 176) { - return createParen(body, body); - } - return body; - } - ts.parenthesizeConciseBody = parenthesizeConciseBody; - function skipOuterExpressions(node, kinds) { - if (kinds === void 0) { kinds = 7; } - var previousNode; - do { - previousNode = node; - if (kinds & 1) { - node = skipParentheses(node); - } - if (kinds & 2) { - node = skipAssertions(node); - } - if (kinds & 4) { - node = skipPartiallyEmittedExpressions(node); - } - } while (previousNode !== node); - return node; - } - ts.skipOuterExpressions = skipOuterExpressions; - function skipParentheses(node) { - while (node.kind === 183) { - node = node.expression; - } - return node; - } - ts.skipParentheses = skipParentheses; - function skipAssertions(node) { - while (ts.isAssertionExpression(node)) { - node = node.expression; - } - return node; - } - ts.skipAssertions = skipAssertions; - function skipPartiallyEmittedExpressions(node) { - while (node.kind === 294) { - node = node.expression; - } - return node; - } - ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; - function startOnNewLine(node) { - node.startsOnNewLine = true; - return node; - } - ts.startOnNewLine = startOnNewLine; - function setOriginalNode(node, original) { - node.original = original; - if (original) { - var emitNode = original.emitNode; - if (emitNode) - node.emitNode = mergeEmitNode(emitNode, node.emitNode); - } - return node; - } - ts.setOriginalNode = setOriginalNode; - function mergeEmitNode(sourceEmitNode, destEmitNode) { - var flags = sourceEmitNode.flags, commentRange = sourceEmitNode.commentRange, sourceMapRange = sourceEmitNode.sourceMapRange, tokenSourceMapRanges = sourceEmitNode.tokenSourceMapRanges, constantValue = sourceEmitNode.constantValue, helpers = sourceEmitNode.helpers; - if (!destEmitNode) - destEmitNode = {}; - if (flags) - destEmitNode.flags = flags; - if (commentRange) - destEmitNode.commentRange = commentRange; - if (sourceMapRange) - destEmitNode.sourceMapRange = sourceMapRange; - if (tokenSourceMapRanges) - destEmitNode.tokenSourceMapRanges = mergeTokenSourceMapRanges(tokenSourceMapRanges, destEmitNode.tokenSourceMapRanges); - if (constantValue !== undefined) - destEmitNode.constantValue = constantValue; - if (helpers) - destEmitNode.helpers = ts.addRange(destEmitNode.helpers, helpers); - return destEmitNode; - } - function mergeTokenSourceMapRanges(sourceRanges, destRanges) { - if (!destRanges) - destRanges = ts.createMap(); - ts.copyProperties(sourceRanges, destRanges); - return destRanges; + function asToken(value) { + return typeof value === "number" ? createToken(value) : value; } function disposeEmitNodes(sourceFile) { sourceFile = ts.getSourceFileOfNode(ts.getParseTreeNode(sourceFile)); @@ -10656,7 +10668,7 @@ var ts; function getOrCreateEmitNode(node) { if (!node.emitNode) { if (ts.isParseTreeNode(node)) { - if (node.kind === 261) { + if (node.kind === 264) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(node); @@ -10667,6 +10679,14 @@ var ts; return node.emitNode; } ts.getOrCreateEmitNode = getOrCreateEmitNode; + function setTextRange(range, location) { + if (location) { + range.pos = location.pos; + range.end = location.end; + } + return range; + } + ts.setTextRange = setTextRange; function getEmitFlags(node) { var emitNode = node.emitNode; return emitNode && emitNode.flags; @@ -10695,7 +10715,7 @@ var ts; ts.getTokenSourceMapRange = getTokenSourceMapRange; function setTokenSourceMapRange(node, token, range) { var emitNode = getOrCreateEmitNode(node); - var tokenSourceMapRanges = emitNode.tokenSourceMapRanges || (emitNode.tokenSourceMapRanges = ts.createMap()); + var tokenSourceMapRanges = emitNode.tokenSourceMapRanges || (emitNode.tokenSourceMapRanges = []); tokenSourceMapRanges[token] = range; return node; } @@ -10710,6 +10730,34 @@ var ts; return node; } ts.setCommentRange = setCommentRange; + function getSyntheticLeadingComments(node) { + var emitNode = node.emitNode; + return emitNode && emitNode.leadingComments; + } + ts.getSyntheticLeadingComments = getSyntheticLeadingComments; + function setSyntheticLeadingComments(node, comments) { + getOrCreateEmitNode(node).leadingComments = comments; + return node; + } + ts.setSyntheticLeadingComments = setSyntheticLeadingComments; + function addSyntheticLeadingComment(node, kind, text, hasTrailingNewLine) { + return setSyntheticLeadingComments(node, ts.append(getSyntheticLeadingComments(node), { kind: kind, pos: -1, end: -1, hasTrailingNewLine: hasTrailingNewLine, text: text })); + } + ts.addSyntheticLeadingComment = addSyntheticLeadingComment; + function getSyntheticTrailingComments(node) { + var emitNode = node.emitNode; + return emitNode && emitNode.trailingComments; + } + ts.getSyntheticTrailingComments = getSyntheticTrailingComments; + function setSyntheticTrailingComments(node, comments) { + getOrCreateEmitNode(node).trailingComments = comments; + return node; + } + ts.setSyntheticTrailingComments = setSyntheticTrailingComments; + function addSyntheticTrailingComment(node, kind, text, hasTrailingNewLine) { + return setSyntheticTrailingComments(node, ts.append(getSyntheticTrailingComments(node), { kind: kind, pos: -1, end: -1, hasTrailingNewLine: hasTrailingNewLine, text: text })); + } + ts.addSyntheticTrailingComment = addSyntheticTrailingComment; function getConstantValue(node) { var emitNode = node.emitNode; return emitNode && emitNode.constantValue; @@ -10721,32 +10769,6 @@ var ts; return node; } ts.setConstantValue = setConstantValue; - function getExternalHelpersModuleName(node) { - var parseNode = ts.getOriginalNode(node, ts.isSourceFile); - var emitNode = parseNode && parseNode.emitNode; - return emitNode && emitNode.externalHelpersModuleName; - } - ts.getExternalHelpersModuleName = getExternalHelpersModuleName; - function getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions) { - if (compilerOptions.importHelpers && (ts.isExternalModule(node) || compilerOptions.isolatedModules)) { - var externalHelpersModuleName = getExternalHelpersModuleName(node); - if (externalHelpersModuleName) { - return externalHelpersModuleName; - } - var helpers = getEmitHelpers(node); - if (helpers) { - for (var _i = 0, helpers_1 = helpers; _i < helpers_1.length; _i++) { - var helper = helpers_1[_i]; - if (!helper.scoped) { - var parseNode = ts.getOriginalNode(node, ts.isSourceFile); - var emitNode = getOrCreateEmitNode(parseNode); - return emitNode.externalHelpersModuleName || (emitNode.externalHelpersModuleName = createUniqueName(ts.externalHelpersModuleNameText)); - } - } - } - } - } - ts.getOrCreateExternalHelpersModuleNameIfNeeded = getOrCreateExternalHelpersModuleNameIfNeeded; function addEmitHelper(node, helper) { var emitNode = getOrCreateEmitNode(node); emitNode.helpers = ts.append(emitNode.helpers, helper); @@ -10756,8 +10778,8 @@ var ts; function addEmitHelpers(node, helpers) { if (ts.some(helpers)) { var emitNode = getOrCreateEmitNode(node); - for (var _i = 0, helpers_2 = helpers; _i < helpers_2.length; _i++) { - var helper = helpers_2[_i]; + for (var _i = 0, helpers_1 = helpers; _i < helpers_1.length; _i++) { + var helper = helpers_1[_i]; if (!ts.contains(emitNode.helpers, helper)) { emitNode.helpers = ts.append(emitNode.helpers, helper); } @@ -10818,40 +10840,798 @@ var ts; return ts.compareValues(x.priority, y.priority); } ts.compareEmitHelpers = compareEmitHelpers; - function setTextRange(node, location) { - if (location) { - node.pos = location.pos; - node.end = location.end; + function setOriginalNode(node, original) { + node.original = original; + if (original) { + var emitNode = original.emitNode; + if (emitNode) + node.emitNode = mergeEmitNode(emitNode, node.emitNode); } return node; } - ts.setTextRange = setTextRange; - function setNodeFlags(node, flags) { - node.flags = flags; + ts.setOriginalNode = setOriginalNode; + function mergeEmitNode(sourceEmitNode, destEmitNode) { + var flags = sourceEmitNode.flags, leadingComments = sourceEmitNode.leadingComments, trailingComments = sourceEmitNode.trailingComments, commentRange = sourceEmitNode.commentRange, sourceMapRange = sourceEmitNode.sourceMapRange, tokenSourceMapRanges = sourceEmitNode.tokenSourceMapRanges, constantValue = sourceEmitNode.constantValue, helpers = sourceEmitNode.helpers; + if (!destEmitNode) + destEmitNode = {}; + if (leadingComments) + destEmitNode.leadingComments = ts.addRange(leadingComments.slice(), destEmitNode.leadingComments); + if (trailingComments) + destEmitNode.trailingComments = ts.addRange(trailingComments.slice(), destEmitNode.trailingComments); + if (flags) + destEmitNode.flags = flags; + if (commentRange) + destEmitNode.commentRange = commentRange; + if (sourceMapRange) + destEmitNode.sourceMapRange = sourceMapRange; + if (tokenSourceMapRanges) + destEmitNode.tokenSourceMapRanges = mergeTokenSourceMapRanges(tokenSourceMapRanges, destEmitNode.tokenSourceMapRanges); + if (constantValue !== undefined) + destEmitNode.constantValue = constantValue; + if (helpers) + destEmitNode.helpers = ts.addRange(destEmitNode.helpers, helpers); + return destEmitNode; + } + function mergeTokenSourceMapRanges(sourceRanges, destRanges) { + if (!destRanges) + destRanges = []; + for (var key in sourceRanges) { + destRanges[key] = sourceRanges[key]; + } + return destRanges; + } +})(ts || (ts = {})); +(function (ts) { + function createTypeCheck(value, tag) { + return tag === "undefined" + ? ts.createStrictEquality(value, ts.createVoidZero()) + : ts.createStrictEquality(ts.createTypeOf(value), ts.createLiteral(tag)); + } + ts.createTypeCheck = createTypeCheck; + function createMemberAccessForPropertyName(target, memberName, location) { + if (ts.isComputedPropertyName(memberName)) { + return ts.setTextRange(ts.createElementAccess(target, memberName.expression), location); + } + else { + var expression = ts.setTextRange(ts.isIdentifier(memberName) + ? ts.createPropertyAccess(target, memberName) + : ts.createElementAccess(target, memberName), memberName); + ts.getOrCreateEmitNode(expression).flags |= 64; + return expression; + } + } + ts.createMemberAccessForPropertyName = createMemberAccessForPropertyName; + function createFunctionCall(func, thisArg, argumentsList, location) { + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(func, "call"), undefined, [ + thisArg + ].concat(argumentsList)), location); + } + ts.createFunctionCall = createFunctionCall; + function createFunctionApply(func, thisArg, argumentsExpression, location) { + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(func, "apply"), undefined, [ + thisArg, + argumentsExpression + ]), location); + } + ts.createFunctionApply = createFunctionApply; + function createArraySlice(array, start) { + var argumentsList = []; + if (start !== undefined) { + argumentsList.push(typeof start === "number" ? ts.createLiteral(start) : start); + } + return ts.createCall(ts.createPropertyAccess(array, "slice"), undefined, argumentsList); + } + ts.createArraySlice = createArraySlice; + function createArrayConcat(array, values) { + return ts.createCall(ts.createPropertyAccess(array, "concat"), undefined, values); + } + ts.createArrayConcat = createArrayConcat; + function createMathPow(left, right, location) { + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Math"), "pow"), undefined, [left, right]), location); + } + ts.createMathPow = createMathPow; + function createReactNamespace(reactNamespace, parent) { + var react = ts.createIdentifier(reactNamespace || "React"); + react.flags &= ~8; + react.parent = ts.getParseTreeNode(parent); + return react; + } + function createJsxFactoryExpressionFromEntityName(jsxFactory, parent) { + if (ts.isQualifiedName(jsxFactory)) { + var left = createJsxFactoryExpressionFromEntityName(jsxFactory.left, parent); + var right = ts.createIdentifier(jsxFactory.right.text); + right.text = jsxFactory.right.text; + return ts.createPropertyAccess(left, right); + } + else { + return createReactNamespace(jsxFactory.text, parent); + } + } + function createJsxFactoryExpression(jsxFactoryEntity, reactNamespace, parent) { + return jsxFactoryEntity ? + createJsxFactoryExpressionFromEntityName(jsxFactoryEntity, parent) : + ts.createPropertyAccess(createReactNamespace(reactNamespace, parent), "createElement"); + } + function createExpressionForJsxElement(jsxFactoryEntity, reactNamespace, tagName, props, children, parentElement, location) { + var argumentsList = [tagName]; + if (props) { + argumentsList.push(props); + } + if (children && children.length > 0) { + if (!props) { + argumentsList.push(ts.createNull()); + } + if (children.length > 1) { + for (var _i = 0, children_1 = children; _i < children_1.length; _i++) { + var child = children_1[_i]; + child.startsOnNewLine = true; + argumentsList.push(child); + } + } + else { + argumentsList.push(children[0]); + } + } + return ts.setTextRange(ts.createCall(createJsxFactoryExpression(jsxFactoryEntity, reactNamespace, parentElement), undefined, argumentsList), location); + } + ts.createExpressionForJsxElement = createExpressionForJsxElement; + function getHelperName(name) { + return ts.setEmitFlags(ts.createIdentifier(name), 4096 | 2); + } + ts.getHelperName = getHelperName; + var valuesHelper = { + name: "typescript:values", + scoped: false, + text: "\n var __values = (this && this.__values) || function (o) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\n if (m) return m.call(o);\n return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n };\n " + }; + function createValuesHelper(context, expression, location) { + context.requestEmitHelper(valuesHelper); + return ts.setTextRange(ts.createCall(getHelperName("__values"), undefined, [expression]), location); + } + ts.createValuesHelper = createValuesHelper; + var readHelper = { + name: "typescript:read", + scoped: false, + text: "\n var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n };\n " + }; + function createReadHelper(context, iteratorRecord, count, location) { + context.requestEmitHelper(readHelper); + return ts.setTextRange(ts.createCall(getHelperName("__read"), undefined, count !== undefined + ? [iteratorRecord, ts.createLiteral(count)] + : [iteratorRecord]), location); + } + ts.createReadHelper = createReadHelper; + var spreadHelper = { + name: "typescript:spread", + scoped: false, + text: "\n var __spread = (this && this.__spread) || function () {\n for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));\n return ar;\n };" + }; + function createSpreadHelper(context, argumentList, location) { + context.requestEmitHelper(readHelper); + context.requestEmitHelper(spreadHelper); + return ts.setTextRange(ts.createCall(getHelperName("__spread"), undefined, argumentList), location); + } + ts.createSpreadHelper = createSpreadHelper; + function createForOfBindingStatement(node, boundValue) { + if (ts.isVariableDeclarationList(node)) { + var firstDeclaration = ts.firstOrUndefined(node.declarations); + var updatedDeclaration = ts.updateVariableDeclaration(firstDeclaration, firstDeclaration.name, undefined, boundValue); + return ts.setTextRange(ts.createVariableStatement(undefined, ts.updateVariableDeclarationList(node, [updatedDeclaration])), node); + } + else { + var updatedExpression = ts.setTextRange(ts.createAssignment(node, boundValue), node); + return ts.setTextRange(ts.createStatement(updatedExpression), node); + } + } + ts.createForOfBindingStatement = createForOfBindingStatement; + function insertLeadingStatement(dest, source) { + if (ts.isBlock(dest)) { + return ts.updateBlock(dest, ts.setTextRange(ts.createNodeArray([source].concat(dest.statements)), dest.statements)); + } + else { + return ts.createBlock(ts.createNodeArray([dest, source]), true); + } + } + ts.insertLeadingStatement = insertLeadingStatement; + function restoreEnclosingLabel(node, outermostLabeledStatement, afterRestoreLabelCallback) { + if (!outermostLabeledStatement) { + return node; + } + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 221 + ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) + : node); + if (afterRestoreLabelCallback) { + afterRestoreLabelCallback(outermostLabeledStatement); + } + return updated; + } + ts.restoreEnclosingLabel = restoreEnclosingLabel; + function shouldBeCapturedInTempVariable(node, cacheIdentifiers) { + var target = skipParentheses(node); + switch (target.kind) { + case 70: + return cacheIdentifiers; + case 98: + case 8: + case 9: + return false; + case 176: + var elements = target.elements; + if (elements.length === 0) { + return false; + } + return true; + case 177: + return target.properties.length > 0; + default: + return true; + } + } + function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers) { + var callee = skipOuterExpressions(expression, 7); + var thisArg; + var target; + if (ts.isSuperProperty(callee)) { + thisArg = ts.createThis(); + target = callee; + } + else if (callee.kind === 96) { + thisArg = ts.createThis(); + target = languageVersion < 2 + ? ts.setTextRange(ts.createIdentifier("_super"), callee) + : callee; + } + else if (ts.getEmitFlags(callee) & 4096) { + thisArg = ts.createVoidZero(); + target = parenthesizeForAccess(callee); + } + else { + switch (callee.kind) { + case 178: { + if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { + thisArg = ts.createTempVariable(recordTempVariable); + target = ts.createPropertyAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.name); + ts.setTextRange(target, callee); + } + else { + thisArg = callee.expression; + target = callee; + } + break; + } + case 179: { + if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { + thisArg = ts.createTempVariable(recordTempVariable); + target = ts.createElementAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.argumentExpression); + ts.setTextRange(target, callee); + } + else { + thisArg = callee.expression; + target = callee; + } + break; + } + default: { + thisArg = ts.createVoidZero(); + target = parenthesizeForAccess(expression); + break; + } + } + } + return { target: target, thisArg: thisArg }; + } + ts.createCallBinding = createCallBinding; + function inlineExpressions(expressions) { + return ts.reduceLeft(expressions, ts.createComma); + } + ts.inlineExpressions = inlineExpressions; + function createExpressionFromEntityName(node) { + if (ts.isQualifiedName(node)) { + var left = createExpressionFromEntityName(node.left); + var right = ts.getMutableClone(node.right); + return ts.setTextRange(ts.createPropertyAccess(left, right), node); + } + else { + return ts.getMutableClone(node); + } + } + ts.createExpressionFromEntityName = createExpressionFromEntityName; + function createExpressionForPropertyName(memberName) { + if (ts.isIdentifier(memberName)) { + return ts.createLiteral(memberName); + } + else if (ts.isComputedPropertyName(memberName)) { + return ts.getMutableClone(memberName.expression); + } + else { + return ts.getMutableClone(memberName); + } + } + ts.createExpressionForPropertyName = createExpressionForPropertyName; + function createExpressionForObjectLiteralElementLike(node, property, receiver) { + switch (property.kind) { + case 152: + case 153: + return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine); + case 260: + return createExpressionForPropertyAssignment(property, receiver); + case 261: + return createExpressionForShorthandPropertyAssignment(property, receiver); + case 150: + return createExpressionForMethodDeclaration(property, receiver); + } + } + ts.createExpressionForObjectLiteralElementLike = createExpressionForObjectLiteralElementLike; + function createExpressionForAccessorDeclaration(properties, property, receiver, multiLine) { + var _a = ts.getAllAccessorDeclarations(properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; + if (property === firstAccessor) { + var properties_1 = []; + if (getAccessor) { + var getterFunction = ts.createFunctionExpression(getAccessor.modifiers, undefined, undefined, undefined, getAccessor.parameters, undefined, getAccessor.body); + ts.setTextRange(getterFunction, getAccessor); + ts.setOriginalNode(getterFunction, getAccessor); + var getter = ts.createPropertyAssignment("get", getterFunction); + properties_1.push(getter); + } + if (setAccessor) { + var setterFunction = ts.createFunctionExpression(setAccessor.modifiers, undefined, undefined, undefined, setAccessor.parameters, undefined, setAccessor.body); + ts.setTextRange(setterFunction, setAccessor); + ts.setOriginalNode(setterFunction, setAccessor); + var setter = ts.createPropertyAssignment("set", setterFunction); + properties_1.push(setter); + } + properties_1.push(ts.createPropertyAssignment("enumerable", ts.createTrue())); + properties_1.push(ts.createPropertyAssignment("configurable", ts.createTrue())); + var expression = ts.setTextRange(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), undefined, [ + receiver, + createExpressionForPropertyName(property.name), + ts.createObjectLiteral(properties_1, multiLine) + ]), firstAccessor); + return ts.aggregateTransformFlags(expression); + } + return undefined; + } + function createExpressionForPropertyAssignment(property, receiver) { + return ts.aggregateTransformFlags(ts.setOriginalNode(ts.setTextRange(ts.createAssignment(createMemberAccessForPropertyName(receiver, property.name, property.name), property.initializer), property), property)); + } + function createExpressionForShorthandPropertyAssignment(property, receiver) { + return ts.aggregateTransformFlags(ts.setOriginalNode(ts.setTextRange(ts.createAssignment(createMemberAccessForPropertyName(receiver, property.name, property.name), ts.getSynthesizedClone(property.name)), property), property)); + } + function createExpressionForMethodDeclaration(method, receiver) { + return ts.aggregateTransformFlags(ts.setOriginalNode(ts.setTextRange(ts.createAssignment(createMemberAccessForPropertyName(receiver, method.name, method.name), ts.setOriginalNode(ts.setTextRange(ts.createFunctionExpression(method.modifiers, method.asteriskToken, undefined, undefined, method.parameters, undefined, method.body), method), method)), method), method)); + } + function getLocalName(node, allowComments, allowSourceMaps) { + return getName(node, allowComments, allowSourceMaps, 16384); + } + ts.getLocalName = getLocalName; + function isLocalName(node) { + return (ts.getEmitFlags(node) & 16384) !== 0; + } + ts.isLocalName = isLocalName; + function getExportName(node, allowComments, allowSourceMaps) { + return getName(node, allowComments, allowSourceMaps, 8192); + } + ts.getExportName = getExportName; + function isExportName(node) { + return (ts.getEmitFlags(node) & 8192) !== 0; + } + ts.isExportName = isExportName; + function getDeclarationName(node, allowComments, allowSourceMaps) { + return getName(node, allowComments, allowSourceMaps); + } + ts.getDeclarationName = getDeclarationName; + function getName(node, allowComments, allowSourceMaps, emitFlags) { + if (node.name && ts.isIdentifier(node.name) && !ts.isGeneratedIdentifier(node.name)) { + var name = ts.getMutableClone(node.name); + emitFlags |= ts.getEmitFlags(node.name); + if (!allowSourceMaps) + emitFlags |= 48; + if (!allowComments) + emitFlags |= 1536; + if (emitFlags) + ts.setEmitFlags(name, emitFlags); + return name; + } + return ts.getGeneratedNameForNode(node); + } + function getExternalModuleOrNamespaceExportName(ns, node, allowComments, allowSourceMaps) { + if (ns && ts.hasModifier(node, 1)) { + return getNamespaceMemberName(ns, getName(node), allowComments, allowSourceMaps); + } + return getExportName(node, allowComments, allowSourceMaps); + } + ts.getExternalModuleOrNamespaceExportName = getExternalModuleOrNamespaceExportName; + function getNamespaceMemberName(ns, name, allowComments, allowSourceMaps) { + var qualifiedName = ts.createPropertyAccess(ns, ts.nodeIsSynthesized(name) ? name : ts.getSynthesizedClone(name)); + ts.setTextRange(qualifiedName, name); + var emitFlags; + if (!allowSourceMaps) + emitFlags |= 48; + if (!allowComments) + emitFlags |= 1536; + if (emitFlags) + ts.setEmitFlags(qualifiedName, emitFlags); + return qualifiedName; + } + ts.getNamespaceMemberName = getNamespaceMemberName; + function convertToFunctionBody(node, multiLine) { + return ts.isBlock(node) ? node : ts.setTextRange(ts.createBlock([ts.setTextRange(ts.createReturn(node), node)], multiLine), node); + } + ts.convertToFunctionBody = convertToFunctionBody; + function isUseStrictPrologue(node) { + return node.expression.text === "use strict"; + } + function addPrologue(target, source, ensureUseStrict, visitor) { + var offset = addStandardPrologue(target, source, ensureUseStrict); + return addCustomPrologue(target, source, offset, visitor); + } + ts.addPrologue = addPrologue; + function addStandardPrologue(target, source, ensureUseStrict) { + ts.Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array"); + var foundUseStrict = false; + var statementOffset = 0; + var numStatements = source.length; + while (statementOffset < numStatements) { + var statement = source[statementOffset]; + if (ts.isPrologueDirective(statement)) { + if (isUseStrictPrologue(statement)) { + foundUseStrict = true; + } + target.push(statement); + } + else { + break; + } + statementOffset++; + } + if (ensureUseStrict && !foundUseStrict) { + target.push(startOnNewLine(ts.createStatement(ts.createLiteral("use strict")))); + } + return statementOffset; + } + ts.addStandardPrologue = addStandardPrologue; + function addCustomPrologue(target, source, statementOffset, visitor) { + var numStatements = source.length; + while (statementOffset < numStatements) { + var statement = source[statementOffset]; + if (ts.getEmitFlags(statement) & 524288) { + target.push(visitor ? ts.visitNode(statement, visitor, ts.isStatement) : statement); + } + else { + break; + } + statementOffset++; + } + return statementOffset; + } + ts.addCustomPrologue = addCustomPrologue; + function startsWithUseStrict(statements) { + var firstStatement = ts.firstOrUndefined(statements); + return firstStatement !== undefined + && ts.isPrologueDirective(firstStatement) + && isUseStrictPrologue(firstStatement); + } + ts.startsWithUseStrict = startsWithUseStrict; + function ensureUseStrict(statements) { + var foundUseStrict = false; + for (var _i = 0, statements_1 = statements; _i < statements_1.length; _i++) { + var statement = statements_1[_i]; + if (ts.isPrologueDirective(statement)) { + if (isUseStrictPrologue(statement)) { + foundUseStrict = true; + break; + } + } + else { + break; + } + } + if (!foundUseStrict) { + return ts.setTextRange(ts.createNodeArray([ + startOnNewLine(ts.createStatement(ts.createLiteral("use strict"))) + ].concat(statements)), statements); + } + return statements; + } + ts.ensureUseStrict = ensureUseStrict; + function parenthesizeConditionalHead(condition) { + var conditionalPrecedence = ts.getOperatorPrecedence(194, 54); + var emittedCondition = skipPartiallyEmittedExpressions(condition); + var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); + if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1) { + return ts.createParen(condition); + } + return condition; + } + ts.parenthesizeConditionalHead = parenthesizeConditionalHead; + function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { + var skipped = skipPartiallyEmittedExpressions(operand); + if (skipped.kind === 184) { + return operand; + } + return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) + ? ts.createParen(operand) + : operand; + } + ts.parenthesizeBinaryOperand = parenthesizeBinaryOperand; + function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { + var binaryOperatorPrecedence = ts.getOperatorPrecedence(193, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(193, binaryOperator); + var emittedOperand = skipPartiallyEmittedExpressions(operand); + var operandPrecedence = ts.getExpressionPrecedence(emittedOperand); + switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) { + case -1: + if (!isLeftSideOfBinary + && binaryOperatorAssociativity === 1 + && operand.kind === 196) { + return false; + } + return true; + case 1: + return false; + case 0: + if (isLeftSideOfBinary) { + return binaryOperatorAssociativity === 1; + } + else { + if (ts.isBinaryExpression(emittedOperand) + && emittedOperand.operatorToken.kind === binaryOperator) { + if (operatorHasAssociativeProperty(binaryOperator)) { + return false; + } + if (binaryOperator === 36) { + var leftKind = leftOperand ? getLiteralKindOfBinaryPlusOperand(leftOperand) : 0; + if (ts.isLiteralKind(leftKind) && leftKind === getLiteralKindOfBinaryPlusOperand(emittedOperand)) { + return false; + } + } + } + var operandAssociativity = ts.getExpressionAssociativity(emittedOperand); + return operandAssociativity === 0; + } + } + } + function operatorHasAssociativeProperty(binaryOperator) { + return binaryOperator === 38 + || binaryOperator === 48 + || binaryOperator === 47 + || binaryOperator === 49; + } + function getLiteralKindOfBinaryPlusOperand(node) { + node = skipPartiallyEmittedExpressions(node); + if (ts.isLiteralKind(node.kind)) { + return node.kind; + } + if (node.kind === 193 && node.operatorToken.kind === 36) { + if (node.cachedLiteralKind !== undefined) { + return node.cachedLiteralKind; + } + var leftKind = getLiteralKindOfBinaryPlusOperand(node.left); + var literalKind = ts.isLiteralKind(leftKind) + && leftKind === getLiteralKindOfBinaryPlusOperand(node.right) + ? leftKind + : 0; + node.cachedLiteralKind = literalKind; + return literalKind; + } + return 0; + } + function parenthesizeForConditionalHead(condition) { + var conditionalPrecedence = ts.getOperatorPrecedence(194, 54); + var emittedCondition = skipPartiallyEmittedExpressions(condition); + var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); + if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1) { + return ts.createParen(condition); + } + return condition; + } + ts.parenthesizeForConditionalHead = parenthesizeForConditionalHead; + function parenthesizeSubexpressionOfConditionalExpression(e) { + return e.kind === 193 && e.operatorToken.kind === 25 + ? ts.createParen(e) + : e; + } + ts.parenthesizeSubexpressionOfConditionalExpression = parenthesizeSubexpressionOfConditionalExpression; + function parenthesizeForNew(expression) { + var emittedExpression = skipPartiallyEmittedExpressions(expression); + switch (emittedExpression.kind) { + case 180: + return ts.createParen(expression); + case 181: + return emittedExpression.arguments + ? expression + : ts.createParen(expression); + } + return parenthesizeForAccess(expression); + } + ts.parenthesizeForNew = parenthesizeForNew; + function parenthesizeForAccess(expression) { + var emittedExpression = skipPartiallyEmittedExpressions(expression); + if (ts.isLeftHandSideExpression(emittedExpression) + && (emittedExpression.kind !== 181 || emittedExpression.arguments)) { + return expression; + } + return ts.setTextRange(ts.createParen(expression), expression); + } + ts.parenthesizeForAccess = parenthesizeForAccess; + function parenthesizePostfixOperand(operand) { + return ts.isLeftHandSideExpression(operand) + ? operand + : ts.setTextRange(ts.createParen(operand), operand); + } + ts.parenthesizePostfixOperand = parenthesizePostfixOperand; + function parenthesizePrefixOperand(operand) { + return ts.isUnaryExpression(operand) + ? operand + : ts.setTextRange(ts.createParen(operand), operand); + } + ts.parenthesizePrefixOperand = parenthesizePrefixOperand; + function parenthesizeListElements(elements) { + var result; + for (var i = 0; i < elements.length; i++) { + var element = parenthesizeExpressionForList(elements[i]); + if (result !== undefined || element !== elements[i]) { + if (result === undefined) { + result = elements.slice(0, i); + } + result.push(element); + } + } + if (result !== undefined) { + return ts.setTextRange(ts.createNodeArray(result, elements.hasTrailingComma), elements); + } + return elements; + } + ts.parenthesizeListElements = parenthesizeListElements; + function parenthesizeExpressionForList(expression) { + var emittedExpression = skipPartiallyEmittedExpressions(expression); + var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); + var commaPrecedence = ts.getOperatorPrecedence(193, 25); + return expressionPrecedence > commaPrecedence + ? expression + : ts.setTextRange(ts.createParen(expression), expression); + } + ts.parenthesizeExpressionForList = parenthesizeExpressionForList; + function parenthesizeExpressionForExpressionStatement(expression) { + var emittedExpression = skipPartiallyEmittedExpressions(expression); + if (ts.isCallExpression(emittedExpression)) { + var callee = emittedExpression.expression; + var kind = skipPartiallyEmittedExpressions(callee).kind; + if (kind === 185 || kind === 186) { + var mutableCall = ts.getMutableClone(emittedExpression); + mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); + return recreatePartiallyEmittedExpressions(expression, mutableCall); + } + } + else { + var leftmostExpressionKind = getLeftmostExpression(emittedExpression).kind; + if (leftmostExpressionKind === 177 || leftmostExpressionKind === 185) { + return ts.setTextRange(ts.createParen(expression), expression); + } + } + return expression; + } + ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; + function recreatePartiallyEmittedExpressions(originalOuterExpression, newInnerExpression) { + if (ts.isPartiallyEmittedExpression(originalOuterExpression)) { + var clone_1 = ts.getMutableClone(originalOuterExpression); + clone_1.expression = recreatePartiallyEmittedExpressions(clone_1.expression, newInnerExpression); + return clone_1; + } + return newInnerExpression; + } + function getLeftmostExpression(node) { + while (true) { + switch (node.kind) { + case 192: + node = node.operand; + continue; + case 193: + node = node.left; + continue; + case 194: + node = node.condition; + continue; + case 180: + case 179: + case 178: + node = node.expression; + continue; + case 295: + node = node.expression; + continue; + } + return node; + } + } + function parenthesizeConciseBody(body) { + if (!ts.isBlock(body) && getLeftmostExpression(body).kind === 177) { + return ts.setTextRange(ts.createParen(body), body); + } + return body; + } + ts.parenthesizeConciseBody = parenthesizeConciseBody; + function skipOuterExpressions(node, kinds) { + if (kinds === void 0) { kinds = 7; } + var previousNode; + do { + previousNode = node; + if (kinds & 1) { + node = skipParentheses(node); + } + if (kinds & 2) { + node = skipAssertions(node); + } + if (kinds & 4) { + node = skipPartiallyEmittedExpressions(node); + } + } while (previousNode !== node); return node; } - ts.setNodeFlags = setNodeFlags; - function setMultiLine(node, multiLine) { - node.multiLine = multiLine; + ts.skipOuterExpressions = skipOuterExpressions; + function skipParentheses(node) { + while (node.kind === 184) { + node = node.expression; + } return node; } - ts.setMultiLine = setMultiLine; - function setHasTrailingComma(nodes, hasTrailingComma) { - nodes.hasTrailingComma = hasTrailingComma; - return nodes; + ts.skipParentheses = skipParentheses; + function skipAssertions(node) { + while (ts.isAssertionExpression(node)) { + node = node.expression; + } + return node; } - ts.setHasTrailingComma = setHasTrailingComma; + ts.skipAssertions = skipAssertions; + function skipPartiallyEmittedExpressions(node) { + while (node.kind === 295) { + node = node.expression; + } + return node; + } + ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; + function startOnNewLine(node) { + node.startsOnNewLine = true; + return node; + } + ts.startOnNewLine = startOnNewLine; + function getExternalHelpersModuleName(node) { + var parseNode = ts.getOriginalNode(node, ts.isSourceFile); + var emitNode = parseNode && parseNode.emitNode; + return emitNode && emitNode.externalHelpersModuleName; + } + ts.getExternalHelpersModuleName = getExternalHelpersModuleName; + function getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions) { + if (compilerOptions.importHelpers && (ts.isExternalModule(node) || compilerOptions.isolatedModules)) { + var externalHelpersModuleName = getExternalHelpersModuleName(node); + if (externalHelpersModuleName) { + return externalHelpersModuleName; + } + var helpers = ts.getEmitHelpers(node); + if (helpers) { + for (var _i = 0, helpers_2 = helpers; _i < helpers_2.length; _i++) { + var helper = helpers_2[_i]; + if (!helper.scoped) { + var parseNode = ts.getOriginalNode(node, ts.isSourceFile); + var emitNode = ts.getOrCreateEmitNode(parseNode); + return emitNode.externalHelpersModuleName || (emitNode.externalHelpersModuleName = ts.createUniqueName(ts.externalHelpersModuleNameText)); + } + } + } + } + } + ts.getOrCreateExternalHelpersModuleNameIfNeeded = getOrCreateExternalHelpersModuleNameIfNeeded; function getLocalNameForExternalImport(node, sourceFile) { var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); if (namespaceDeclaration && !ts.isDefaultImport(node)) { - var name_9 = namespaceDeclaration.name; - return ts.isGeneratedIdentifier(name_9) ? name_9 : createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, namespaceDeclaration.name)); + var name = namespaceDeclaration.name; + return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, namespaceDeclaration.name)); } - if (node.kind === 235 && node.importClause) { - return getGeneratedNameForNode(node); + if (node.kind === 237 && node.importClause) { + return ts.getGeneratedNameForNode(node); } - if (node.kind === 241 && node.moduleSpecifier) { - return getGeneratedNameForNode(node); + if (node.kind === 243 && node.moduleSpecifier) { + return ts.getGeneratedNameForNode(node); } return undefined; } @@ -10861,26 +11641,24 @@ var ts; if (moduleName.kind === 9) { return tryGetModuleNameFromDeclaration(importNode, host, resolver, compilerOptions) || tryRenameExternalModule(moduleName, sourceFile) - || getSynthesizedClone(moduleName); + || ts.getSynthesizedClone(moduleName); } return undefined; } ts.getExternalModuleNameLiteral = getExternalModuleNameLiteral; function tryRenameExternalModule(moduleName, sourceFile) { - if (sourceFile.renamedDependencies && ts.hasProperty(sourceFile.renamedDependencies, moduleName.text)) { - return createLiteral(sourceFile.renamedDependencies[moduleName.text]); - } - return undefined; + var rename = sourceFile.renamedDependencies && sourceFile.renamedDependencies.get(moduleName.text); + return rename && ts.createLiteral(rename); } function tryGetModuleNameFromFile(file, host, options) { if (!file) { return undefined; } if (file.moduleName) { - return createLiteral(file.moduleName); + return ts.createLiteral(file.moduleName); } if (!ts.isDeclarationFile(file) && (options.out || options.outFile)) { - return createLiteral(ts.getExternalModuleNameFromPath(host, file.fileName)); + return ts.createLiteral(ts.getExternalModuleNameFromPath(host, file.fileName)); } return undefined; } @@ -10914,11 +11692,11 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 257: + case 260: return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 258: + case 261: return bindingElement.name; - case 259: + case 262: return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } return undefined; @@ -10934,11 +11712,11 @@ var ts; ts.getTargetOfBindingOrAssignmentElement = getTargetOfBindingOrAssignmentElement; function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 144: - case 174: + case 145: + case 175: return bindingElement.dotDotDotToken; - case 196: - case 259: + case 197: + case 262: return bindingElement; } return undefined; @@ -10946,7 +11724,7 @@ var ts; ts.getRestIndicatorOfBindingOrAssignmentElement = getRestIndicatorOfBindingOrAssignmentElement; function getPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 174: + case 175: if (bindingElement.propertyName) { var propertyName = bindingElement.propertyName; return ts.isComputedPropertyName(propertyName) && ts.isStringOrNumericLiteral(propertyName.expression) @@ -10954,7 +11732,7 @@ var ts; : propertyName; } break; - case 257: + case 260: if (bindingElement.name) { var propertyName = bindingElement.name; return ts.isComputedPropertyName(propertyName) && ts.isStringOrNumericLiteral(propertyName.expression) @@ -10962,7 +11740,7 @@ var ts; : propertyName; } break; - case 259: + case 262: return bindingElement.name; } var target = getTargetOfBindingOrAssignmentElement(bindingElement); @@ -10976,11 +11754,11 @@ var ts; ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 172: case 173: - case 175: - return name.elements; + case 174: case 176: + return name.elements; + case 177: return name.properties; } } @@ -10989,10 +11767,12 @@ var ts; if (ts.isBindingElement(element)) { if (element.dotDotDotToken) { ts.Debug.assertNode(element.name, ts.isIdentifier); - return setOriginalNode(createSpread(element.name, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createSpread(element.name), element), element); } var expression = convertToAssignmentElementTarget(element.name); - return element.initializer ? setOriginalNode(createAssignment(expression, element.initializer, element), element) : expression; + return element.initializer + ? ts.setOriginalNode(ts.setTextRange(ts.createAssignment(expression, element.initializer), element), element) + : expression; } ts.Debug.assertNode(element, ts.isExpression); return element; @@ -11002,14 +11782,14 @@ var ts; if (ts.isBindingElement(element)) { if (element.dotDotDotToken) { ts.Debug.assertNode(element.name, ts.isIdentifier); - return setOriginalNode(createSpreadAssignment(element.name, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createSpreadAssignment(element.name), element), element); } if (element.propertyName) { var expression = convertToAssignmentElementTarget(element.name); - return setOriginalNode(createPropertyAssignment(element.propertyName, element.initializer ? createAssignment(expression, element.initializer) : expression, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createPropertyAssignment(element.propertyName, element.initializer ? ts.createAssignment(expression, element.initializer) : expression), element), element); } ts.Debug.assertNode(element.name, ts.isIdentifier); - return setOriginalNode(createShorthandPropertyAssignment(element.name, element.initializer, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createShorthandPropertyAssignment(element.name, element.initializer), element), element); } ts.Debug.assertNode(element, ts.isObjectLiteralElementLike); return element; @@ -11017,18 +11797,18 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 173: - case 175: - return convertToArrayAssignmentPattern(node); - case 172: + case 174: case 176: + return convertToArrayAssignmentPattern(node); + case 173: + case 177: return convertToObjectAssignmentPattern(node); } } ts.convertToAssignmentPattern = convertToAssignmentPattern; function convertToObjectAssignmentPattern(node) { if (ts.isObjectBindingPattern(node)) { - return setOriginalNode(createObjectLiteral(ts.map(node.elements, convertToObjectAssignmentElement), node), node); + return ts.setOriginalNode(ts.setTextRange(ts.createObjectLiteral(ts.map(node.elements, convertToObjectAssignmentElement)), node), node); } ts.Debug.assertNode(node, ts.isObjectLiteralExpression); return node; @@ -11036,7 +11816,7 @@ var ts; ts.convertToObjectAssignmentPattern = convertToObjectAssignmentPattern; function convertToArrayAssignmentPattern(node) { if (ts.isArrayBindingPattern(node)) { - return setOriginalNode(createArrayLiteral(ts.map(node.elements, convertToArrayAssignmentElement), node), node); + return ts.setOriginalNode(ts.setTextRange(ts.createArrayLiteral(ts.map(node.elements, convertToArrayAssignmentElement)), node), node); } ts.Debug.assertNode(node, ts.isArrayLiteralExpression); return node; @@ -11052,30 +11832,30 @@ var ts; ts.convertToAssignmentElementTarget = convertToAssignmentElementTarget; function collectExternalModuleInfo(sourceFile, resolver, compilerOptions) { var externalImports = []; - var exportSpecifiers = ts.createMap(); - var exportedBindings = ts.createMap(); + var exportSpecifiers = ts.createMultiMap(); + var exportedBindings = []; var uniqueExports = ts.createMap(); var exportedNames; var hasExportDefault = false; var exportEquals = undefined; var hasExportStarsToExportValues = false; var externalHelpersModuleName = getOrCreateExternalHelpersModuleNameIfNeeded(sourceFile, compilerOptions); - var externalHelpersImportDeclaration = externalHelpersModuleName && createImportDeclaration(undefined, undefined, createImportClause(undefined, createNamespaceImport(externalHelpersModuleName)), createLiteral(ts.externalHelpersModuleNameText)); + var externalHelpersImportDeclaration = externalHelpersModuleName && ts.createImportDeclaration(undefined, undefined, ts.createImportClause(undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText)); if (externalHelpersImportDeclaration) { externalImports.push(externalHelpersImportDeclaration); } for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 235: + case 237: externalImports.push(node); break; - case 234: - if (node.moduleReference.kind === 245) { + case 236: + if (node.moduleReference.kind === 247) { externalImports.push(node); } break; - case 241: + case 243: if (node.moduleSpecifier) { if (!node.exportClause) { externalImports.push(node); @@ -11088,26 +11868,26 @@ var ts; else { for (var _b = 0, _c = node.exportClause.elements; _b < _c.length; _b++) { var specifier = _c[_b]; - if (!uniqueExports[specifier.name.text]) { - var name_10 = specifier.propertyName || specifier.name; - ts.multiMapAdd(exportSpecifiers, name_10.text, specifier); - var decl = resolver.getReferencedImportDeclaration(name_10) - || resolver.getReferencedValueDeclaration(name_10); + if (!uniqueExports.get(specifier.name.text)) { + var name = specifier.propertyName || specifier.name; + exportSpecifiers.add(name.text, specifier); + var decl = resolver.getReferencedImportDeclaration(name) + || resolver.getReferencedValueDeclaration(name); if (decl) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(decl), specifier.name); + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(decl), specifier.name); } - uniqueExports[specifier.name.text] = true; + uniqueExports.set(specifier.name.text, true); exportedNames = ts.append(exportedNames, specifier.name); } } } break; - case 240: + case 242: if (node.isExportEquals && !exportEquals) { exportEquals = node; } break; - case 205: + case 207: if (ts.hasModifier(node, 1)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -11115,38 +11895,38 @@ var ts; } } break; - case 225: + case 227: if (ts.hasModifier(node, 1)) { if (ts.hasModifier(node, 512)) { if (!hasExportDefault) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); hasExportDefault = true; } } else { - var name_11 = node.name; - if (!uniqueExports[name_11.text]) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), name_11); - uniqueExports[name_11.text] = true; - exportedNames = ts.append(exportedNames, name_11); + var name = node.name; + if (!uniqueExports.get(name.text)) { + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), name); + uniqueExports.set(name.text, true); + exportedNames = ts.append(exportedNames, name); } } } break; - case 226: + case 228: if (ts.hasModifier(node, 1)) { if (ts.hasModifier(node, 512)) { if (!hasExportDefault) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); hasExportDefault = true; } } else { - var name_12 = node.name; - if (!uniqueExports[name_12.text]) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), name_12); - uniqueExports[name_12.text] = true; - exportedNames = ts.append(exportedNames, name_12); + var name = node.name; + if (!uniqueExports.get(name.text)) { + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), name); + uniqueExports.set(name.text, true); + exportedNames = ts.append(exportedNames, name); } } } @@ -11166,13 +11946,23 @@ var ts; } } else if (!ts.isGeneratedIdentifier(decl.name)) { - if (!uniqueExports[decl.name.text]) { - uniqueExports[decl.name.text] = true; + if (!uniqueExports.get(decl.name.text)) { + uniqueExports.set(decl.name.text, true); exportedNames = ts.append(exportedNames, decl.name); } } return exportedNames; } + function multiMapSparseArrayAdd(map, key, value) { + var values = map[key]; + if (values) { + values.push(value); + } + else { + map[key] = values = [value]; + } + return values; + } })(ts || (ts = {})); var ts; (function (ts) { @@ -11181,13 +11971,13 @@ var ts; var IdentifierConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 261) { + if (kind === 264) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 70) { return new (IdentifierConstructor || (IdentifierConstructor = ts.objectAllocator.getIdentifierConstructor()))(kind, pos, end); } - else if (kind < 141) { + else if (kind < 142) { return new (TokenConstructor || (TokenConstructor = ts.objectAllocator.getTokenConstructor()))(kind, pos, end); } else { @@ -11223,28 +12013,29 @@ var ts; var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode; var cbNodes = cbNodeArray || cbNode; switch (node.kind) { - case 141: + case 142: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 143: + case 144: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || + visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 258: + case 261: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 259: + case 262: return visitNode(cbNode, node.expression); - case 144: + case 145: + case 148: case 147: - case 146: - case 257: - case 223: - case 174: + case 260: + case 225: + case 175: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || @@ -11253,24 +12044,24 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 158: case 159: - case 153: + case 160: case 154: case 155: + case 156: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 149: - case 148: case 150: + case 149: case 151: case 152: - case 184: - case 225: + case 153: case 185: + case 227: + case 186: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -11281,320 +12072,326 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 157: + case 158: return visitNode(cbNode, node.typeName) || visitNodes(cbNodes, node.typeArguments); - case 156: + case 157: return visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 160: - return visitNode(cbNode, node.exprName); case 161: - return visitNodes(cbNodes, node.members); + return visitNode(cbNode, node.exprName); case 162: - return visitNode(cbNode, node.elementType); + return visitNodes(cbNodes, node.members); case 163: - return visitNodes(cbNodes, node.elementTypes); + return visitNode(cbNode, node.elementType); case 164: + return visitNodes(cbNodes, node.elementTypes); case 165: - return visitNodes(cbNodes, node.types); case 166: - case 168: - return visitNode(cbNode, node.type); + return visitNodes(cbNodes, node.types); + case 167: case 169: + return visitNode(cbNode, node.type); + case 170: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 170: + case 171: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 171: - return visitNode(cbNode, node.literal); case 172: + return visitNode(cbNode, node.literal); case 173: - return visitNodes(cbNodes, node.elements); - case 175: + case 174: return visitNodes(cbNodes, node.elements); case 176: - return visitNodes(cbNodes, node.properties); + return visitNodes(cbNodes, node.elements); case 177: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.name); + return visitNodes(cbNodes, node.properties); case 178: return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.argumentExpression); + visitNode(cbNode, node.name); case 179: + return visitNode(cbNode, node.expression) || + visitNode(cbNode, node.argumentExpression); case 180: + case 181: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); - case 181: + case 182: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 182: + case 183: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 183: - return visitNode(cbNode, node.expression); - case 186: + case 184: return visitNode(cbNode, node.expression); case 187: return visitNode(cbNode, node.expression); case 188: return visitNode(cbNode, node.expression); - case 190: - return visitNode(cbNode, node.operand); - case 195: - return visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.expression); case 189: return visitNode(cbNode, node.expression); case 191: return visitNode(cbNode, node.operand); + case 196: + return visitNode(cbNode, node.asteriskToken) || + visitNode(cbNode, node.expression); + case 190: + return visitNode(cbNode, node.expression); case 192: + return visitNode(cbNode, node.operand); + case 193: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 200: + case 201: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 201: + case 202: return visitNode(cbNode, node.expression); - case 193: + case 203: + return visitNode(cbNode, node.name); + case 194: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 196: + case 197: return visitNode(cbNode, node.expression); - case 204: - case 231: + case 206: + case 233: return visitNodes(cbNodes, node.statements); - case 261: + case 264: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 205: + case 207: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 224: + case 226: return visitNodes(cbNodes, node.declarations); - case 207: + case 209: return visitNode(cbNode, node.expression); - case 208: + case 210: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 209: + case 211: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 210: + case 212: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 211: + case 213: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 212: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); - case 213: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); case 214: - case 215: - return visitNode(cbNode, node.label); - case 216: - return visitNode(cbNode, node.expression); - case 217: - return visitNode(cbNode, node.expression) || + return visitNode(cbNode, node.initializer) || + visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); + case 215: + return visitNode(cbNode, node.awaitModifier) || + visitNode(cbNode, node.initializer) || + visitNode(cbNode, node.expression) || + visitNode(cbNode, node.statement); + case 216: + case 217: + return visitNode(cbNode, node.label); case 218: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.caseBlock); - case 232: - return visitNodes(cbNodes, node.clauses); - case 253: - return visitNode(cbNode, node.expression) || - visitNodes(cbNodes, node.statements); - case 254: - return visitNodes(cbNodes, node.statements); + return visitNode(cbNode, node.expression); case 219: - return visitNode(cbNode, node.label) || + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 220: - return visitNode(cbNode, node.expression); + return visitNode(cbNode, node.expression) || + visitNode(cbNode, node.caseBlock); + case 234: + return visitNodes(cbNodes, node.clauses); + case 256: + return visitNode(cbNode, node.expression) || + visitNodes(cbNodes, node.statements); + case 257: + return visitNodes(cbNodes, node.statements); case 221: + return visitNode(cbNode, node.label) || + visitNode(cbNode, node.statement); + case 222: + return visitNode(cbNode, node.expression); + case 223: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 256: + case 259: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 145: + case 146: return visitNode(cbNode, node.expression); - case 226: - case 197: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.heritageClauses) || - visitNodes(cbNodes, node.members); - case 227: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.heritageClauses) || - visitNodes(cbNodes, node.members); case 228: + case 198: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || - visitNode(cbNode, node.type); + visitNodes(cbNodes, node.heritageClauses) || + visitNodes(cbNodes, node.members); case 229: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.typeParameters) || + visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); - case 260: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.initializer); case 230: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.typeParameters) || + visitNode(cbNode, node.type); + case 231: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.members); + case 263: + return visitNode(cbNode, node.name) || + visitNode(cbNode, node.initializer); + case 232: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 234: + case 236: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 235: + case 237: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 236: + case 238: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 233: + case 235: return visitNode(cbNode, node.name); - case 237: + case 239: return visitNode(cbNode, node.name); - case 238: - case 242: + case 240: + case 244: return visitNodes(cbNodes, node.elements); - case 241: + case 243: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 239: - case 243: + case 241: + case 245: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 240: + case 242: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 194: + case 195: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 202: + case 204: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 142: + case 143: return visitNode(cbNode, node.expression); - case 255: + case 258: return visitNodes(cbNodes, node.types); - case 199: + case 200: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments); - case 245: + case 247: return visitNode(cbNode, node.expression); - case 244: - return visitNodes(cbNodes, node.decorators); case 246: + return visitNodes(cbNodes, node.decorators); + case 248: return visitNode(cbNode, node.openingElement) || visitNodes(cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 247: - case 248: - return visitNode(cbNode, node.tagName) || - visitNodes(cbNodes, node.attributes); + case 249: case 250: + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.attributes); + case 253: + return visitNodes(cbNodes, node.properties); + case 252: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); + case 254: + return visitNode(cbNode, node.expression); + case 255: + return visitNode(cbNode, node.dotDotDotToken) || + visitNode(cbNode, node.expression); case 251: - return visitNode(cbNode, node.expression); - case 252: - return visitNode(cbNode, node.expression); - case 249: return visitNode(cbNode, node.tagName); - case 262: - return visitNode(cbNode, node.type); case 266: - return visitNodes(cbNodes, node.types); - case 267: - return visitNodes(cbNodes, node.types); - case 265: - return visitNode(cbNode, node.elementType); - case 269: - return visitNode(cbNode, node.type); - case 268: return visitNode(cbNode, node.type); case 270: - return visitNode(cbNode, node.literal); - case 272: - return visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeArguments); + return visitNodes(cbNodes, node.types); + case 271: + return visitNodes(cbNodes, node.types); + case 269: + return visitNode(cbNode, node.elementType); case 273: return visitNode(cbNode, node.type); + case 272: + return visitNode(cbNode, node.type); case 274: - return visitNodes(cbNodes, node.parameters) || - visitNode(cbNode, node.type); - case 275: - return visitNode(cbNode, node.type); + return visitNode(cbNode, node.literal); case 276: - return visitNode(cbNode, node.type); + return visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.typeArguments); case 277: return visitNode(cbNode, node.type); - case 271: + case 278: + return visitNodes(cbNodes, node.parameters) || + visitNode(cbNode, node.type); + case 279: + return visitNode(cbNode, node.type); + case 280: + return visitNode(cbNode, node.type); + case 281: + return visitNode(cbNode, node.type); + case 275: return visitNode(cbNode, node.name) || visitNode(cbNode, node.type); - case 278: + case 282: return visitNodes(cbNodes, node.tags); - case 281: + case 285: return visitNode(cbNode, node.preParameterName) || visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.postParameterName); - case 282: + case 286: return visitNode(cbNode, node.typeExpression); - case 283: - return visitNode(cbNode, node.typeExpression); - case 280: + case 287: return visitNode(cbNode, node.typeExpression); case 284: + return visitNode(cbNode, node.typeExpression); + case 288: return visitNodes(cbNodes, node.typeParameters); - case 285: + case 289: return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.jsDocTypeLiteral); - case 287: + case 291: return visitNodes(cbNodes, node.jsDocPropertyTags); - case 286: + case 290: return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name); - case 294: + case 295: return visitNode(cbNode, node.expression); - case 288: + case 292: return visitNode(cbNode, node.literal); } } @@ -11635,7 +12432,7 @@ var ts; var Parser; (function (Parser) { var scanner = ts.createScanner(5, true); - var disallowInAndDecoratorContext = 65536 | 262144; + var disallowInAndDecoratorContext = 2048 | 8192; var NodeConstructor; var TokenConstructor; var IdentifierConstructor; @@ -11683,7 +12480,7 @@ var ts; identifiers = ts.createMap(); identifierCount = 0; nodeCount = 0; - contextFlags = scriptKind === 1 || scriptKind === 2 ? 2097152 : 0; + contextFlags = scriptKind === 1 || scriptKind === 2 ? 65536 : 0; parseErrorBeforeNextFinishedNode = false; scanner.setText(sourceText); scanner.setOnError(scanError); @@ -11758,7 +12555,7 @@ var ts; } Parser.fixupParentReferences = fixupParentReferences; function createSourceFile(fileName, languageVersion, scriptKind) { - var sourceFile = new SourceFileConstructor(261, 0, sourceText.length); + var sourceFile = new SourceFileConstructor(264, 0, sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -11778,16 +12575,16 @@ var ts; } } function setDisallowInContext(val) { - setContextFlag(val, 65536); + setContextFlag(val, 2048); } function setYieldContext(val) { - setContextFlag(val, 131072); + setContextFlag(val, 4096); } function setDecoratorContext(val) { - setContextFlag(val, 262144); + setContextFlag(val, 8192); } function setAwaitContext(val) { - setContextFlag(val, 524288); + setContextFlag(val, 16384); } function doOutsideOfContext(context, func) { var contextFlagsToClear = context & contextFlags; @@ -11810,40 +12607,40 @@ var ts; return func(); } function allowInAnd(func) { - return doOutsideOfContext(65536, func); + return doOutsideOfContext(2048, func); } function disallowInAnd(func) { - return doInsideOfContext(65536, func); + return doInsideOfContext(2048, func); } function doInYieldContext(func) { - return doInsideOfContext(131072, func); + return doInsideOfContext(4096, func); } function doInDecoratorContext(func) { - return doInsideOfContext(262144, func); + return doInsideOfContext(8192, func); } function doInAwaitContext(func) { - return doInsideOfContext(524288, func); + return doInsideOfContext(16384, func); } function doOutsideOfAwaitContext(func) { - return doOutsideOfContext(524288, func); + return doOutsideOfContext(16384, func); } function doInYieldAndAwaitContext(func) { - return doInsideOfContext(131072 | 524288, func); + return doInsideOfContext(4096 | 16384, func); } function inContext(flags) { return (contextFlags & flags) !== 0; } function inYieldContext() { - return inContext(131072); + return inContext(4096); } function inDisallowInContext() { - return inContext(65536); + return inContext(2048); } function inDecoratorContext() { - return inContext(262144); + return inContext(8192); } function inAwaitContext() { - return inContext(524288); + return inContext(16384); } function parseErrorAtCurrentToken(message, arg0) { var start = scanner.getTokenPos(); @@ -11985,7 +12782,7 @@ var ts; if (!(pos >= 0)) { pos = scanner.getStartPos(); } - return kind >= 141 ? new NodeConstructor(kind, pos, pos) : + return kind >= 142 ? new NodeConstructor(kind, pos, pos) : kind === 70 ? new IdentifierConstructor(kind, pos, pos) : new TokenConstructor(kind, pos, pos); } @@ -12005,7 +12802,7 @@ var ts; } if (parseErrorBeforeNextFinishedNode) { parseErrorBeforeNextFinishedNode = false; - node.flags |= 1048576; + node.flags |= 32768; } return node; } @@ -12022,7 +12819,11 @@ var ts; } function internIdentifier(text) { text = ts.escapeIdentifier(text); - return identifiers[text] || (identifiers[text] = text); + var identifier = identifiers.get(text); + if (identifier === undefined) { + identifiers.set(text, identifier = text); + } + return identifier; } function createIdentifier(isIdentifier, diagnosticMessage) { identifierCount++; @@ -12067,7 +12868,7 @@ var ts; return token() === 9 || token() === 8 || ts.tokenIsIdentifierOrKeyword(token()); } function parseComputedPropertyName() { - var node = createNode(142); + var node = createNode(143); parseExpected(20); node.expression = allowInAnd(parseExpression); parseExpected(21); @@ -12116,6 +12917,7 @@ var ts; function nextTokenIsClassOrFunctionOrAsync() { nextToken(); return token() === 74 || token() === 88 || + (token() === 116 && lookAhead(nextTokenIsClassKeywordOnSameLine)) || (token() === 119 && lookAhead(nextTokenIsFunctionKeywordOnSameLine)); } function isListElement(parsingContext, inErrorRecovery) { @@ -12323,7 +13125,7 @@ var ts; if (ts.containsParseError(node)) { return undefined; } - var nodeContextFlags = node.flags & 3080192; + var nodeContextFlags = node.flags & 96256; if (nodeContextFlags !== contextFlags) { return undefined; } @@ -12372,14 +13174,14 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 150: - case 155: case 151: + case 156: case 152: - case 147: - case 203: + case 153: + case 148: + case 205: return true; - case 149: + case 150: var methodDeclaration = node; var nameIsConstructor = methodDeclaration.name.kind === 70 && methodDeclaration.name.originalKeywordKind === 122; @@ -12391,8 +13193,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 253: - case 254: + case 256: + case 257: return true; } } @@ -12401,65 +13203,65 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 225: - case 205: - case 204: - case 208: + case 227: case 207: - case 220: - case 216: - case 218: - case 215: - case 214: - case 212: - case 213: - case 211: - case 210: - case 217: case 206: - case 221: - case 219: + case 210: case 209: case 222: - case 235: - case 234: - case 241: - case 240: - case 230: - case 226: - case 227: - case 229: + case 218: + case 220: + case 217: + case 216: + case 214: + case 215: + case 213: + case 212: + case 219: + case 208: + case 223: + case 221: + case 211: + case 224: + case 237: + case 236: + case 243: + case 242: + case 232: case 228: + case 229: + case 231: + case 230: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 260; + return node.kind === 263; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 154: - case 148: case 155: - case 146: - case 153: + case 149: + case 156: + case 147: + case 154: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 223) { + if (node.kind !== 225) { return false; } var variableDeclarator = node; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 144) { + if (node.kind !== 145) { return false; } var parameter = node; @@ -12504,7 +13306,6 @@ var ts; case 25: return ts.Diagnostics.Property_assignment_expected; } } - ; function parseDelimitedList(kind, parseElement, considerSemicolonAsDelimiter) { var saveParsingContext = parsingContext; parsingContext |= 1 << kind; @@ -12555,7 +13356,7 @@ var ts; function parseEntityName(allowReservedWords, diagnosticMessage) { var entity = parseIdentifier(diagnosticMessage); while (parseOptional(22)) { - var node = createNode(141, entity.pos); + var node = createNode(142, entity.pos); node.left = entity; node.right = parseRightSideOfDot(allowReservedWords); entity = finishNode(node); @@ -12572,7 +13373,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(194); + var template = createNode(195); template.head = parseTemplateHead(); ts.Debug.assert(template.head.kind === 13, "Template head has wrong token kind"); var templateSpans = createNodeArray(); @@ -12584,7 +13385,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(202); + var span = createNode(204); span.expression = allowInAnd(parseExpression); var literal; if (token() === 17) { @@ -12620,20 +13421,16 @@ var ts; if (scanner.isUnterminated()) { node.isUnterminated = true; } - var tokenPos = scanner.getTokenPos(); + if (node.kind === 8) { + node.numericLiteralFlags = scanner.getNumericLiteralFlags(); + } nextToken(); finishNode(node); - if (node.kind === 8 - && sourceText.charCodeAt(tokenPos) === 48 - && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { - node.isOctalLiteral = true; - } return node; } function parseTypeReference() { - var typeName = parseEntityName(false, ts.Diagnostics.Type_expected); - var node = createNode(157, typeName.pos); - node.typeName = typeName; + var node = createNode(158); + node.typeName = parseEntityName(false, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && token() === 26) { node.typeArguments = parseBracketedList(19, parseType, 26, 28); } @@ -12641,24 +13438,24 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(156, lhs.pos); + var node = createNode(157, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(167); + var node = createNode(168); nextToken(); return finishNode(node); } function parseTypeQuery() { - var node = createNode(160); + var node = createNode(161); parseExpected(102); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(143); + var node = createNode(144); node.name = parseIdentifier(); if (parseOptional(84)) { if (isStartOfType() || !isStartOfExpression()) { @@ -12668,6 +13465,9 @@ var ts; node.expression = parseUnaryExpressionOrHigher(); } } + if (parseOptional(57)) { + node.default = parseType(); + } return finishNode(node); } function parseTypeParameters() { @@ -12685,9 +13485,9 @@ var ts; return token() === 23 || isIdentifierOrPattern() || ts.isModifierKind(token()) || token() === 56 || token() === 98; } function parseParameter() { - var node = createNode(144); + var node = createNode(145); if (token() === 98) { - node.name = createIdentifier(true, undefined); + node.name = createIdentifier(true); node.type = parseParameterType(); return finishNode(node); } @@ -12745,7 +13545,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNode(kind); - if (kind === 154) { + if (kind === 155) { parseExpected(93); } fillSignature(55, false, false, false, node); @@ -12785,7 +13585,7 @@ var ts; return token() === 55 || token() === 25 || token() === 21; } function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) { - var node = createNode(155, fullStart); + var node = createNode(156, fullStart); node.decorators = decorators; node.modifiers = modifiers; node.parameters = parseBracketedList(16, parseParameter, 20, 21); @@ -12797,7 +13597,7 @@ var ts; var name = parsePropertyName(); var questionToken = parseOptionalToken(54); if (token() === 18 || token() === 26) { - var method = createNode(148, fullStart); + var method = createNode(149, fullStart); method.modifiers = modifiers; method.name = name; method.questionToken = questionToken; @@ -12806,7 +13606,7 @@ var ts; return addJSDocComment(finishNode(method)); } else { - var property = createNode(146, fullStart); + var property = createNode(147, fullStart); property.modifiers = modifiers; property.name = name; property.questionToken = questionToken; @@ -12819,19 +13619,19 @@ var ts; } } function isTypeMemberStart() { - var idToken; if (token() === 18 || token() === 26) { return true; } + var idToken; while (ts.isModifierKind(token())) { - idToken = token(); + idToken = true; nextToken(); } if (token() === 20) { return true; } if (isLiteralPropertyName()) { - idToken = token(); + idToken = true; nextToken(); } if (idToken) { @@ -12846,10 +13646,10 @@ var ts; } function parseTypeMember() { if (token() === 18 || token() === 26) { - return parseSignatureMember(153); + return parseSignatureMember(154); } if (token() === 93 && lookAhead(isStartOfConstructSignature)) { - return parseSignatureMember(154); + return parseSignatureMember(155); } var fullStart = getNodePos(); var modifiers = parseModifiers(); @@ -12863,7 +13663,7 @@ var ts; return token() === 18 || token() === 26; } function parseTypeLiteral() { - var node = createNode(161); + var node = createNode(162); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -12886,14 +13686,14 @@ var ts; return token() === 20 && nextTokenIsIdentifier() && nextToken() === 91; } function parseMappedTypeParameter() { - var node = createNode(143); + var node = createNode(144); node.name = parseIdentifier(); parseExpected(91); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(170); + var node = createNode(171); parseExpected(16); node.readonlyToken = parseOptionalToken(130); parseExpected(20); @@ -12906,12 +13706,12 @@ var ts; return finishNode(node); } function parseTupleType() { - var node = createNode(163); + var node = createNode(164); node.elementTypes = parseBracketedList(20, parseType, 20, 21); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(166); + var node = createNode(167); parseExpected(18); node.type = parseType(); parseExpected(19); @@ -12919,7 +13719,7 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNode(kind); - if (kind === 159) { + if (kind === 160) { parseExpected(93); } fillSignature(35, false, false, false, node); @@ -12930,7 +13730,7 @@ var ts; return token() === 22 ? undefined : node; } function parseLiteralTypeNode() { - var node = createNode(171); + var node = createNode(172); node.literal = parseSimpleUnaryExpression(); finishNode(node); return node; @@ -12941,12 +13741,13 @@ var ts; function parseNonArrayType() { switch (token()) { case 118: - case 134: + case 135: case 132: case 121: - case 135: - case 137: + case 136: + case 138: case 129: + case 133: var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReference(); case 9: @@ -12983,12 +13784,12 @@ var ts; function isStartOfType() { switch (token()) { case 118: - case 134: + case 135: case 132: case 121: - case 135: + case 136: case 104: - case 137: + case 138: case 94: case 98: case 102: @@ -12996,11 +13797,14 @@ var ts; case 16: case 20: case 26: + case 48: + case 47: case 93: case 9: case 8: case 100: case 85: + case 133: return true; case 37: return lookAhead(nextTokenIsNumericLiteral); @@ -13018,14 +13822,14 @@ var ts; var type = parseNonArrayType(); while (!scanner.hasPrecedingLineBreak() && parseOptional(20)) { if (isStartOfType()) { - var node = createNode(169, type.pos); + var node = createNode(170, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(21); type = finishNode(node); } else { - var node = createNode(162, type.pos); + var node = createNode(163, type.pos); node.elementType = type; parseExpected(21); type = finishNode(node); @@ -13034,7 +13838,7 @@ var ts; return type; } function parseTypeOperator(operator) { - var node = createNode(168); + var node = createNode(169); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); @@ -13048,6 +13852,7 @@ var ts; return parseArrayTypeOrHigher(); } function parseUnionOrIntersectionType(kind, parseConstituentType, operator) { + parseOptional(operator); var type = parseConstituentType(); if (token() === operator) { var types = createNodeArray([type], type.pos); @@ -13062,10 +13867,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(165, parseTypeOperatorOrHigher, 47); + return parseUnionOrIntersectionType(166, parseTypeOperatorOrHigher, 47); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(164, parseIntersectionTypeOrHigher, 48); + return parseUnionOrIntersectionType(165, parseIntersectionTypeOrHigher, 48); } function isStartOfFunctionType() { if (token() === 26) { @@ -13111,7 +13916,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(156, typePredicateVariable.pos); + var node = createNode(157, typePredicateVariable.pos); node.parameterName = typePredicateVariable; node.type = type; return finishNode(node); @@ -13128,14 +13933,14 @@ var ts; } } function parseType() { - return doOutsideOfContext(655360, parseTypeWorker); + return doOutsideOfContext(20480, parseTypeWorker); } function parseTypeWorker() { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(158); + return parseFunctionOrConstructorType(159); } if (token() === 93) { - return parseFunctionOrConstructorType(159); + return parseFunctionOrConstructorType(160); } return parseUnionTypeOrHigher(); } @@ -13254,7 +14059,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(195); + var node = createNode(196); nextToken(); if (!scanner.hasPrecedingLineBreak() && (token() === 38 || isStartOfExpression())) { @@ -13270,13 +14075,13 @@ var ts; ts.Debug.assert(token() === 35, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(185, asyncModifier.pos); + node = createNode(186, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(185, identifier.pos); + node = createNode(186, identifier.pos); } - var parameter = createNode(144, identifier.pos); + var parameter = createNode(145, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos); @@ -13410,7 +14215,7 @@ var ts; return 0; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(185); + var node = createNode(186); node.modifiers = parseModifiersForArrowFunction(); var isAsync = !!(ts.getModifierFlags(node) & 256); fillSignature(55, false, isAsync, !allowAmbiguity, node); @@ -13442,7 +14247,7 @@ var ts; if (!questionToken) { return leftOperand; } - var node = createNode(193, leftOperand.pos); + var node = createNode(194, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -13455,7 +14260,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 91 || t === 140; + return t === 91 || t === 141; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -13533,43 +14338,43 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(192, left.pos); + var node = createNode(193, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(200, left.pos); + var node = createNode(201, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(190); + var node = createNode(191); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(186); - nextToken(); - node.expression = parseSimpleUnaryExpression(); - return finishNode(node); - } - function parseTypeOfExpression() { var node = createNode(187); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } - function parseVoidExpression() { + function parseTypeOfExpression() { var node = createNode(188); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } + function parseVoidExpression() { + var node = createNode(189); + nextToken(); + node.expression = parseSimpleUnaryExpression(); + return finishNode(node); + } function isAwaitExpression() { if (token() === 120) { if (inAwaitContext()) { @@ -13580,7 +14385,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(189); + var node = createNode(190); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -13596,7 +14401,7 @@ var ts; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token() === 39) { var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); - if (simpleUnaryExpression.kind === 182) { + if (simpleUnaryExpression.kind === 183) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -13649,7 +14454,7 @@ var ts; } function parseIncrementExpression() { if (token() === 42 || token() === 43) { - var node = createNode(190); + var node = createNode(191); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -13661,7 +14466,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 42 || token() === 43) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(191, expression.pos); + var node = createNode(192, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -13684,7 +14489,7 @@ var ts; if (token() === 18 || token() === 22 || token() === 20) { return expression; } - var node = createNode(177, expression.pos); + var node = createNode(178, expression.pos); node.expression = expression; parseExpectedToken(22, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(true); @@ -13706,8 +14511,8 @@ var ts; function parseJsxElementOrSelfClosingElement(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElement(inExpressionContext); var result; - if (opening.kind === 248) { - var node = createNode(246, opening.pos); + if (opening.kind === 250) { + var node = createNode(248, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement.tagName); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -13717,14 +14522,14 @@ var ts; result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 247); + ts.Debug.assert(opening.kind === 249); result = opening; } if (inExpressionContext && token() === 26) { var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElement(true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(192, result.pos); + var badNode = createNode(193, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -13764,20 +14569,28 @@ var ts; parseErrorAtPosition(openingTagName.pos, openingTagName.end - openingTagName.pos, ts.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, ts.getTextOfNodeFromSourceText(sourceText, openingTagName)); break; } + else if (token() === 7) { + break; + } result.push(parseJsxChild()); } result.end = scanner.getTokenPos(); parsingContext = saveParsingContext; return result; } + function parseJsxAttributes() { + var jsxAttributes = createNode(253); + jsxAttributes.properties = parseList(13, parseJsxAttribute); + return finishNode(jsxAttributes); + } function parseJsxOpeningOrSelfClosingElement(inExpressionContext) { var fullStart = scanner.getStartPos(); parseExpected(26); var tagName = parseJsxElementName(); - var attributes = parseList(13, parseJsxAttribute); + var attributes = parseJsxAttributes(); var node; if (token() === 28) { - node = createNode(248, fullStart); + node = createNode(250, fullStart); scanJsxText(); } else { @@ -13789,7 +14602,7 @@ var ts; parseExpected(28, undefined, false); scanJsxText(); } - node = createNode(247, fullStart); + node = createNode(249, fullStart); } node.tagName = tagName; node.attributes = attributes; @@ -13800,7 +14613,7 @@ var ts; var expression = token() === 98 ? parseTokenNode() : parseIdentifierName(); while (parseOptional(22)) { - var propertyAccess = createNode(177, expression.pos); + var propertyAccess = createNode(178, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(true); expression = finishNode(propertyAccess); @@ -13808,9 +14621,10 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(252); + var node = createNode(255); parseExpected(16); if (token() !== 17) { + node.dotDotDotToken = parseOptionalToken(23); node.expression = parseAssignmentExpressionOrHigher(); } if (inExpressionContext) { @@ -13827,7 +14641,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(250); + var node = createNode(252); node.name = parseIdentifierName(); if (token() === 57) { switch (scanJsxAttributeValue()) { @@ -13842,7 +14656,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(251); + var node = createNode(254); parseExpected(16); parseExpected(23); node.expression = parseExpression(); @@ -13850,7 +14664,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(249); + var node = createNode(251); parseExpected(27); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -13863,7 +14677,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(182); + var node = createNode(183); parseExpected(26); node.type = parseType(); parseExpected(28); @@ -13874,7 +14688,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(22); if (dotToken) { - var propertyAccess = createNode(177, expression.pos); + var propertyAccess = createNode(178, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(true); expression = finishNode(propertyAccess); @@ -13882,13 +14696,13 @@ var ts; } if (token() === 50 && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(201, expression.pos); + var nonNullExpression = createNode(202, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; } if (!inDecoratorContext() && parseOptional(20)) { - var indexedAccess = createNode(178, expression.pos); + var indexedAccess = createNode(179, expression.pos); indexedAccess.expression = expression; if (token() !== 21) { indexedAccess.argumentExpression = allowInAnd(parseExpression); @@ -13902,7 +14716,7 @@ var ts; continue; } if (token() === 12 || token() === 13) { - var tagExpression = createNode(181, expression.pos); + var tagExpression = createNode(182, expression.pos); tagExpression.tag = expression; tagExpression.template = token() === 12 ? parseLiteralNode() @@ -13921,7 +14735,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(179, expression.pos); + var callExpr = createNode(180, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -13929,7 +14743,7 @@ var ts; continue; } else if (token() === 18) { - var callExpr = createNode(179, expression.pos); + var callExpr = createNode(180, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -14024,28 +14838,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(183); + var node = createNode(184); parseExpected(18); node.expression = allowInAnd(parseExpression); parseExpected(19); return finishNode(node); } function parseSpreadElement() { - var node = createNode(196); + var node = createNode(197); parseExpected(23); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 23 ? parseSpreadElement() : - token() === 25 ? createNode(198) : + token() === 25 ? createNode(199) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(175); + var node = createNode(176); parseExpected(20); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -14056,18 +14870,18 @@ var ts; } function tryParseAccessorDeclaration(fullStart, decorators, modifiers) { if (parseContextualModifier(124)) { - return parseAccessorDeclaration(151, fullStart, decorators, modifiers); - } - else if (parseContextualModifier(133)) { return parseAccessorDeclaration(152, fullStart, decorators, modifiers); } + else if (parseContextualModifier(134)) { + return parseAccessorDeclaration(153, fullStart, decorators, modifiers); + } return undefined; } function parseObjectLiteralElement() { var fullStart = scanner.getStartPos(); var dotDotDotToken = parseOptionalToken(23); if (dotDotDotToken) { - var spreadElement = createNode(259, fullStart); + var spreadElement = createNode(262, fullStart); spreadElement.expression = parseAssignmentExpressionOrHigher(); return addJSDocComment(finishNode(spreadElement)); } @@ -14086,7 +14900,7 @@ var ts; } var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 25 || token() === 17 || token() === 57); if (isShorthandPropertyAssignment) { - var shorthandDeclaration = createNode(258, fullStart); + var shorthandDeclaration = createNode(261, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; var equalsToken = parseOptionalToken(57); @@ -14097,7 +14911,7 @@ var ts; return addJSDocComment(finishNode(shorthandDeclaration)); } else { - var propertyAssignment = createNode(257, fullStart); + var propertyAssignment = createNode(260, fullStart); propertyAssignment.modifiers = modifiers; propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; @@ -14107,7 +14921,7 @@ var ts; } } function parseObjectLiteralExpression() { - var node = createNode(176); + var node = createNode(177); parseExpected(16); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -14121,7 +14935,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(false); } - var node = createNode(184); + var node = createNode(185); node.modifiers = parseModifiers(); parseExpected(88); node.asteriskToken = parseOptionalToken(38); @@ -14143,8 +14957,15 @@ var ts; return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(180); + var fullStart = scanner.getStartPos(); parseExpected(93); + if (parseOptional(22)) { + var node_1 = createNode(203, fullStart); + node_1.keywordToken = 93; + node_1.name = parseIdentifierName(); + return finishNode(node_1); + } + var node = createNode(181, fullStart); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); if (node.typeArguments || token() === 18) { @@ -14153,7 +14974,7 @@ var ts; return finishNode(node); } function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(204); + var node = createNode(206); if (parseExpected(16, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -14184,12 +15005,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(206); + var node = createNode(208); parseExpected(24); return finishNode(node); } function parseIfStatement() { - var node = createNode(208); + var node = createNode(210); parseExpected(89); parseExpected(18); node.expression = allowInAnd(parseExpression); @@ -14199,7 +15020,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(209); + var node = createNode(211); parseExpected(80); node.statement = parseStatement(); parseExpected(105); @@ -14210,7 +15031,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(210); + var node = createNode(212); parseExpected(105); parseExpected(18); node.expression = allowInAnd(parseExpression); @@ -14221,6 +15042,7 @@ var ts; function parseForOrForInOrForOfStatement() { var pos = getNodePos(); parseExpected(87); + var awaitToken = parseOptionalToken(120); parseExpected(18); var initializer = undefined; if (token() !== 24) { @@ -14232,22 +15054,23 @@ var ts; } } var forOrForInOrForOfStatement; - if (parseOptional(91)) { - var forInStatement = createNode(212, pos); - forInStatement.initializer = initializer; - forInStatement.expression = allowInAnd(parseExpression); - parseExpected(19); - forOrForInOrForOfStatement = forInStatement; - } - else if (parseOptional(140)) { - var forOfStatement = createNode(213, pos); + if (awaitToken ? parseExpected(141) : parseOptional(141)) { + var forOfStatement = createNode(215, pos); + forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(19); forOrForInOrForOfStatement = forOfStatement; } + else if (parseOptional(91)) { + var forInStatement = createNode(214, pos); + forInStatement.initializer = initializer; + forInStatement.expression = allowInAnd(parseExpression); + parseExpected(19); + forOrForInOrForOfStatement = forInStatement; + } else { - var forStatement = createNode(211, pos); + var forStatement = createNode(213, pos); forStatement.initializer = initializer; parseExpected(24); if (token() !== 24 && token() !== 19) { @@ -14265,7 +15088,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 215 ? 71 : 76); + parseExpected(kind === 217 ? 71 : 76); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -14273,7 +15096,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(216); + var node = createNode(218); parseExpected(95); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -14282,7 +15105,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(217); + var node = createNode(219); parseExpected(106); parseExpected(18); node.expression = allowInAnd(parseExpression); @@ -14291,7 +15114,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(253); + var node = createNode(256); parseExpected(72); node.expression = allowInAnd(parseExpression); parseExpected(55); @@ -14299,7 +15122,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(254); + var node = createNode(257); parseExpected(78); parseExpected(55); node.statements = parseList(3, parseStatement); @@ -14309,12 +15132,12 @@ var ts; return token() === 72 ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(218); + var node = createNode(220); parseExpected(97); parseExpected(18); node.expression = allowInAnd(parseExpression); parseExpected(19); - var caseBlock = createNode(232, scanner.getStartPos()); + var caseBlock = createNode(234, scanner.getStartPos()); parseExpected(16); caseBlock.clauses = parseList(2, parseCaseOrDefaultClause); parseExpected(17); @@ -14322,14 +15145,14 @@ var ts; return finishNode(node); } function parseThrowStatement() { - var node = createNode(220); + var node = createNode(222); parseExpected(99); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } function parseTryStatement() { - var node = createNode(221); + var node = createNode(223); parseExpected(101); node.tryBlock = parseBlock(false); node.catchClause = token() === 73 ? parseCatchClause() : undefined; @@ -14340,7 +15163,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(256); + var result = createNode(259); parseExpected(73); if (parseExpected(18)) { result.variableDeclaration = parseVariableDeclaration(); @@ -14350,7 +15173,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(222); + var node = createNode(224); parseExpected(77); parseSemicolon(); return finishNode(node); @@ -14359,13 +15182,13 @@ var ts; var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); if (expression.kind === 70 && parseOptional(55)) { - var labeledStatement = createNode(219, fullStart); + var labeledStatement = createNode(221, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return addJSDocComment(finishNode(labeledStatement)); } else { - var expressionStatement = createNode(207, fullStart); + var expressionStatement = createNode(209, fullStart); expressionStatement.expression = expression; parseSemicolon(); return addJSDocComment(finishNode(expressionStatement)); @@ -14375,6 +15198,10 @@ var ts; nextToken(); return ts.tokenIsIdentifierOrKeyword(token()) && !scanner.hasPrecedingLineBreak(); } + function nextTokenIsClassKeywordOnSameLine() { + nextToken(); + return token() === 74 && !scanner.hasPrecedingLineBreak(); + } function nextTokenIsFunctionKeywordOnSameLine() { nextToken(); return token() === 88 && !scanner.hasPrecedingLineBreak(); @@ -14394,7 +15221,7 @@ var ts; case 82: return true; case 108: - case 136: + case 137: return nextTokenIsIdentifierOnSameLine(); case 127: case 128: @@ -14411,7 +15238,7 @@ var ts; return false; } continue; - case 139: + case 140: nextToken(); return token() === 16 || token() === 70 || token() === 83; case 90: @@ -14471,8 +15298,8 @@ var ts; case 108: case 127: case 128: - case 136: - case 139: + case 137: + case 140: return true; case 113: case 111: @@ -14517,9 +15344,9 @@ var ts; case 87: return parseForOrForInOrForOfStatement(); case 76: - return parseBreakOrContinueStatement(214); + return parseBreakOrContinueStatement(216); case 71: - return parseBreakOrContinueStatement(215); + return parseBreakOrContinueStatement(217); case 95: return parseReturnStatement(); case 106: @@ -14538,7 +15365,7 @@ var ts; return parseDeclaration(); case 119: case 108: - case 136: + case 137: case 127: case 128: case 123: @@ -14552,7 +15379,7 @@ var ts; case 116: case 114: case 130: - case 139: + case 140: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -14575,11 +15402,11 @@ var ts; return parseClassDeclaration(fullStart, decorators, modifiers); case 108: return parseInterfaceDeclaration(fullStart, decorators, modifiers); - case 136: + case 137: return parseTypeAliasDeclaration(fullStart, decorators, modifiers); case 82: return parseEnumDeclaration(fullStart, decorators, modifiers); - case 139: + case 140: case 127: case 128: return parseModuleDeclaration(fullStart, decorators, modifiers); @@ -14598,7 +15425,7 @@ var ts; } default: if (decorators || modifiers) { - var node = createMissingNode(244, true, ts.Diagnostics.Declaration_expected); + var node = createMissingNode(246, true, ts.Diagnostics.Declaration_expected); node.pos = fullStart; node.decorators = decorators; node.modifiers = modifiers; @@ -14619,16 +15446,16 @@ var ts; } function parseArrayBindingElement() { if (token() === 25) { - return createNode(198); + return createNode(199); } - var node = createNode(174); + var node = createNode(175); node.dotDotDotToken = parseOptionalToken(23); node.name = parseIdentifierOrPattern(); node.initializer = parseBindingElementInitializer(false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(174); + var node = createNode(175); node.dotDotDotToken = parseOptionalToken(23); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -14644,14 +15471,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(172); + var node = createNode(173); parseExpected(16); node.elements = parseDelimitedList(9, parseObjectBindingElement); parseExpected(17); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(173); + var node = createNode(174); parseExpected(20); node.elements = parseDelimitedList(10, parseArrayBindingElement); parseExpected(21); @@ -14670,7 +15497,7 @@ var ts; return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(223); + var node = createNode(225); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token())) { @@ -14679,7 +15506,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(224); + var node = createNode(226); switch (token()) { case 103: break; @@ -14693,7 +15520,7 @@ var ts; ts.Debug.fail(); } nextToken(); - if (token() === 140 && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 141 && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -14708,7 +15535,7 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 19; } function parseVariableStatement(fullStart, decorators, modifiers) { - var node = createNode(205, fullStart); + var node = createNode(207, fullStart); node.decorators = decorators; node.modifiers = modifiers; node.declarationList = parseVariableDeclarationList(false); @@ -14716,7 +15543,7 @@ var ts; return addJSDocComment(finishNode(node)); } function parseFunctionDeclaration(fullStart, decorators, modifiers) { - var node = createNode(225, fullStart); + var node = createNode(227, fullStart); node.decorators = decorators; node.modifiers = modifiers; parseExpected(88); @@ -14729,7 +15556,7 @@ var ts; return addJSDocComment(finishNode(node)); } function parseConstructorDeclaration(pos, decorators, modifiers) { - var node = createNode(150, pos); + var node = createNode(151, pos); node.decorators = decorators; node.modifiers = modifiers; parseExpected(122); @@ -14738,7 +15565,7 @@ var ts; return addJSDocComment(finishNode(node)); } function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { - var method = createNode(149, fullStart); + var method = createNode(150, fullStart); method.decorators = decorators; method.modifiers = modifiers; method.asteriskToken = asteriskToken; @@ -14751,7 +15578,7 @@ var ts; return addJSDocComment(finishNode(method)); } function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) { - var property = createNode(147, fullStart); + var property = createNode(148, fullStart); property.decorators = decorators; property.modifiers = modifiers; property.name = name; @@ -14759,7 +15586,7 @@ var ts; property.type = parseTypeAnnotation(); property.initializer = ts.hasModifier(property, 32) ? allowInAnd(parseNonParameterInitializer) - : doOutsideOfContext(131072 | 65536, parseNonParameterInitializer); + : doOutsideOfContext(4096 | 2048, parseNonParameterInitializer); parseSemicolon(); return addJSDocComment(finishNode(property)); } @@ -14821,7 +15648,7 @@ var ts; return true; } if (idToken !== undefined) { - if (!ts.isKeyword(idToken) || idToken === 133 || idToken === 124) { + if (!ts.isKeyword(idToken) || idToken === 134 || idToken === 124) { return true; } switch (token()) { @@ -14844,7 +15671,7 @@ var ts; if (!parseOptional(56)) { break; } - var decorator = createNode(145, decoratorStart); + var decorator = createNode(146, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); if (!decorators) { @@ -14901,7 +15728,7 @@ var ts; } function parseClassElement() { if (token() === 24) { - var result = createNode(203); + var result = createNode(205); nextToken(); return finishNode(result); } @@ -14926,16 +15753,16 @@ var ts; return parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers); } if (decorators || modifiers) { - var name_13 = createMissingNode(70, true, ts.Diagnostics.Declaration_expected); - return parsePropertyDeclaration(fullStart, decorators, modifiers, name_13, undefined); + var name = createMissingNode(70, true, ts.Diagnostics.Declaration_expected); + return parsePropertyDeclaration(fullStart, decorators, modifiers, name, undefined); } ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 197); + return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 198); } function parseClassDeclaration(fullStart, decorators, modifiers) { - return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 226); + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 228); } function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { var node = createNode(kind, fullStart); @@ -14969,9 +15796,10 @@ var ts; return undefined; } function parseHeritageClause() { - if (token() === 84 || token() === 107) { - var node = createNode(255); - node.token = token(); + var tok = token(); + if (tok === 84 || tok === 107) { + var node = createNode(258); + node.token = tok; nextToken(); node.types = parseDelimitedList(7, parseExpressionWithTypeArguments); return finishNode(node); @@ -14979,7 +15807,7 @@ var ts; return undefined; } function parseExpressionWithTypeArguments() { - var node = createNode(199); + var node = createNode(200); node.expression = parseLeftHandSideExpressionOrHigher(); if (token() === 26) { node.typeArguments = parseBracketedList(19, parseType, 26, 28); @@ -14993,7 +15821,7 @@ var ts; return parseList(5, parseClassElement); } function parseInterfaceDeclaration(fullStart, decorators, modifiers) { - var node = createNode(227, fullStart); + var node = createNode(229, fullStart); node.decorators = decorators; node.modifiers = modifiers; parseExpected(108); @@ -15004,10 +15832,10 @@ var ts; return addJSDocComment(finishNode(node)); } function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { - var node = createNode(228, fullStart); + var node = createNode(230, fullStart); node.decorators = decorators; node.modifiers = modifiers; - parseExpected(136); + parseExpected(137); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(57); @@ -15016,13 +15844,13 @@ var ts; return addJSDocComment(finishNode(node)); } function parseEnumMember() { - var node = createNode(260, scanner.getStartPos()); + var node = createNode(263, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return addJSDocComment(finishNode(node)); } function parseEnumDeclaration(fullStart, decorators, modifiers) { - var node = createNode(229, fullStart); + var node = createNode(231, fullStart); node.decorators = decorators; node.modifiers = modifiers; parseExpected(82); @@ -15037,7 +15865,7 @@ var ts; return addJSDocComment(finishNode(node)); } function parseModuleBlock() { - var node = createNode(231, scanner.getStartPos()); + var node = createNode(233, scanner.getStartPos()); if (parseExpected(16)) { node.statements = parseList(1, parseStatement); parseExpected(17); @@ -15048,7 +15876,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags) { - var node = createNode(230, fullStart); + var node = createNode(232, fullStart); var namespaceFlag = flags & 16; node.decorators = decorators; node.modifiers = modifiers; @@ -15060,10 +15888,10 @@ var ts; return addJSDocComment(finishNode(node)); } function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { - var node = createNode(230, fullStart); + var node = createNode(232, fullStart); node.decorators = decorators; node.modifiers = modifiers; - if (token() === 139) { + if (token() === 140) { node.name = parseIdentifier(); node.flags |= 512; } @@ -15080,7 +15908,7 @@ var ts; } function parseModuleDeclaration(fullStart, decorators, modifiers) { var flags = 0; - if (token() === 139) { + if (token() === 140) { return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers); } else if (parseOptional(128)) { @@ -15105,7 +15933,7 @@ var ts; return nextToken() === 40; } function parseNamespaceExportDeclaration(fullStart, decorators, modifiers) { - var exportDeclaration = createNode(233, fullStart); + var exportDeclaration = createNode(235, fullStart); exportDeclaration.decorators = decorators; exportDeclaration.modifiers = modifiers; parseExpected(117); @@ -15120,38 +15948,41 @@ var ts; var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token() !== 25 && token() !== 138) { - var importEqualsDeclaration = createNode(234, fullStart); - importEqualsDeclaration.decorators = decorators; - importEqualsDeclaration.modifiers = modifiers; - importEqualsDeclaration.name = identifier; - parseExpected(57); - importEqualsDeclaration.moduleReference = parseModuleReference(); - parseSemicolon(); - return addJSDocComment(finishNode(importEqualsDeclaration)); + if (token() !== 25 && token() !== 139) { + return parseImportEqualsDeclaration(fullStart, decorators, modifiers, identifier); } } - var importDeclaration = createNode(235, fullStart); + var importDeclaration = createNode(237, fullStart); importDeclaration.decorators = decorators; importDeclaration.modifiers = modifiers; if (identifier || token() === 38 || token() === 16) { importDeclaration.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(138); + parseExpected(139); } importDeclaration.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); return finishNode(importDeclaration); } + function parseImportEqualsDeclaration(fullStart, decorators, modifiers, identifier) { + var importEqualsDeclaration = createNode(236, fullStart); + importEqualsDeclaration.decorators = decorators; + importEqualsDeclaration.modifiers = modifiers; + importEqualsDeclaration.name = identifier; + parseExpected(57); + importEqualsDeclaration.moduleReference = parseModuleReference(); + parseSemicolon(); + return addJSDocComment(finishNode(importEqualsDeclaration)); + } function parseImportClause(identifier, fullStart) { - var importClause = createNode(236, fullStart); + var importClause = createNode(238, fullStart); if (identifier) { importClause.name = identifier; } if (!importClause.name || parseOptional(25)) { - importClause.namedBindings = token() === 38 ? parseNamespaceImport() : parseNamedImportsOrExports(238); + importClause.namedBindings = token() === 38 ? parseNamespaceImport() : parseNamedImportsOrExports(240); } return finishNode(importClause); } @@ -15161,7 +15992,7 @@ var ts; : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(245); + var node = createNode(247); parseExpected(131); parseExpected(18); node.expression = parseModuleSpecifier(); @@ -15179,7 +16010,7 @@ var ts; } } function parseNamespaceImport() { - var namespaceImport = createNode(237); + var namespaceImport = createNode(239); parseExpected(38); parseExpected(117); namespaceImport.name = parseIdentifier(); @@ -15187,14 +16018,14 @@ var ts; } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(22, kind === 238 ? parseImportSpecifier : parseExportSpecifier, 16, 17); + node.elements = parseBracketedList(22, kind === 240 ? parseImportSpecifier : parseExportSpecifier, 16, 17); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(243); + return parseImportOrExportSpecifier(245); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(239); + return parseImportOrExportSpecifier(241); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -15213,23 +16044,23 @@ var ts; else { node.name = identifierName; } - if (kind === 239 && checkIdentifierIsKeyword) { + if (kind === 241 && checkIdentifierIsKeyword) { parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(fullStart, decorators, modifiers) { - var node = createNode(241, fullStart); + var node = createNode(243, fullStart); node.decorators = decorators; node.modifiers = modifiers; if (parseOptional(38)) { - parseExpected(138); + parseExpected(139); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(242); - if (token() === 138 || (token() === 9 && !scanner.hasPrecedingLineBreak())) { - parseExpected(138); + node.exportClause = parseNamedImportsOrExports(244); + if (token() === 139 || (token() === 9 && !scanner.hasPrecedingLineBreak())) { + parseExpected(139); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -15237,7 +16068,7 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, decorators, modifiers) { - var node = createNode(240, fullStart); + var node = createNode(242, fullStart); node.decorators = decorators; node.modifiers = modifiers; if (parseOptional(57)) { @@ -15256,6 +16087,7 @@ var ts; var typeReferenceDirectives = []; var amdDependencies = []; var amdModuleName; + var checkJsDirective = undefined; while (true) { var kind = triviaScanner.scan(); if (kind !== 2) { @@ -15266,7 +16098,11 @@ var ts; break; } } - var range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos(), kind: triviaScanner.getToken() }; + var range = { + kind: triviaScanner.getToken(), + pos: triviaScanner.getTokenPos(), + end: triviaScanner.getTextPos(), + }; var comment = sourceText.substring(range.pos, range.end); var referencePathMatchResult = ts.getFileReferenceFromReferencePath(comment, range); if (referencePathMatchResult) { @@ -15306,20 +16142,30 @@ var ts; amdDependencies.push(amdDependency); } } + var checkJsDirectiveRegEx = /^\/\/\/?\s*(@ts-check|@ts-nocheck)\s*$/gim; + var checkJsDirectiveMatchResult = checkJsDirectiveRegEx.exec(comment); + if (checkJsDirectiveMatchResult) { + checkJsDirective = { + enabled: ts.compareStrings(checkJsDirectiveMatchResult[1], "@ts-check", true) === 0, + end: range.end, + pos: range.pos + }; + } } } sourceFile.referencedFiles = referencedFiles; sourceFile.typeReferenceDirectives = typeReferenceDirectives; sourceFile.amdDependencies = amdDependencies; sourceFile.moduleName = amdModuleName; + sourceFile.checkJsDirective = checkJsDirective; } function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return ts.hasModifier(node, 1) - || node.kind === 234 && node.moduleReference.kind === 245 - || node.kind === 235 - || node.kind === 240 - || node.kind === 241 + || node.kind === 236 && node.moduleReference.kind === 247 + || node.kind === 237 + || node.kind === 242 + || node.kind === 243 ? node : undefined; }); @@ -15355,7 +16201,7 @@ var ts; } JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; function parseJSDocTypeExpression() { - var result = createNode(262, scanner.getTokenPos()); + var result = createNode(266, scanner.getTokenPos()); parseExpected(16); result.type = parseJSDocTopLevelType(); parseExpected(17); @@ -15366,12 +16212,12 @@ var ts; function parseJSDocTopLevelType() { var type = parseJSDocType(); if (token() === 48) { - var unionType = createNode(266, type.pos); + var unionType = createNode(270, type.pos); unionType.types = parseJSDocTypeList(type); type = finishNode(unionType); } if (token() === 57) { - var optionalType = createNode(273, type.pos); + var optionalType = createNode(277, type.pos); nextToken(); optionalType.type = type; type = finishNode(optionalType); @@ -15382,20 +16228,20 @@ var ts; var type = parseBasicTypeExpression(); while (true) { if (token() === 20) { - var arrayType = createNode(265, type.pos); + var arrayType = createNode(269, type.pos); arrayType.elementType = type; nextToken(); parseExpected(21); type = finishNode(arrayType); } else if (token() === 54) { - var nullableType = createNode(268, type.pos); + var nullableType = createNode(272, type.pos); nullableType.type = type; nextToken(); type = finishNode(nullableType); } else if (token() === 50) { - var nonNullableType = createNode(269, type.pos); + var nonNullableType = createNode(273, type.pos); nonNullableType.type = type; nextToken(); type = finishNode(nonNullableType); @@ -15429,14 +16275,15 @@ var ts; case 98: return parseJSDocThisType(); case 118: - case 134: + case 135: case 132: case 121: - case 135: + case 136: case 104: case 94: - case 137: + case 138: case 129: + case 133: return parseTokenNode(); case 9: case 8: @@ -15447,27 +16294,27 @@ var ts; return parseJSDocTypeReference(); } function parseJSDocThisType() { - var result = createNode(277); + var result = createNode(281); nextToken(); parseExpected(55); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocConstructorType() { - var result = createNode(276); + var result = createNode(280); nextToken(); parseExpected(55); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocVariadicType() { - var result = createNode(275); + var result = createNode(279); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocFunctionType() { - var result = createNode(274); + var result = createNode(278); nextToken(); parseExpected(18); result.parameters = parseDelimitedList(23, parseJSDocParameter); @@ -15480,7 +16327,7 @@ var ts; return finishNode(result); } function parseJSDocParameter() { - var parameter = createNode(144); + var parameter = createNode(145); parameter.type = parseJSDocType(); if (parseOptional(57)) { parameter.questionToken = createNode(57); @@ -15488,7 +16335,7 @@ var ts; return finishNode(parameter); } function parseJSDocTypeReference() { - var result = createNode(272); + var result = createNode(276); result.name = parseSimplePropertyName(); if (token() === 26) { result.typeArguments = parseTypeArguments(); @@ -15522,24 +16369,24 @@ var ts; } } function parseQualifiedName(left) { - var result = createNode(141, left.pos); + var result = createNode(142, left.pos); result.left = left; result.right = parseIdentifierName(); return finishNode(result); } function parseJSDocRecordType() { - var result = createNode(270); + var result = createNode(274); result.literal = parseTypeLiteral(); return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(269); + var result = createNode(273); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocTupleType() { - var result = createNode(267); + var result = createNode(271); nextToken(); result.types = parseDelimitedList(26, parseJSDocType); checkForTrailingComma(result.types); @@ -15553,7 +16400,7 @@ var ts; } } function parseJSDocUnionType() { - var result = createNode(266); + var result = createNode(270); nextToken(); result.types = parseJSDocTypeList(parseJSDocType()); parseExpected(19); @@ -15569,12 +16416,12 @@ var ts; return types; } function parseJSDocAllType() { - var result = createNode(263); + var result = createNode(267); nextToken(); return finishNode(result); } function parseJSDocLiteralType() { - var result = createNode(288); + var result = createNode(292); result.literal = parseLiteralTypeNode(); return finishNode(result); } @@ -15587,11 +16434,11 @@ var ts; token() === 28 || token() === 57 || token() === 48) { - var result = createNode(264, pos); + var result = createNode(268, pos); return finishNode(result); } else { - var result = createNode(268, pos); + var result = createNode(272, pos); result.type = parseJSDocType(); return finishNode(result); } @@ -15676,7 +16523,7 @@ var ts; break; case 38: var asterisk = scanner.getTokenText(); - if (state === 1) { + if (state === 1 || state === 2) { state = 2; pushComment(asterisk); } @@ -15691,7 +16538,10 @@ var ts; break; case 5: var whitespace = scanner.getTokenText(); - if (state === 2 || margin !== undefined && indent + whitespace.length > margin) { + if (state === 2) { + comments.push(whitespace); + } + else if (margin !== undefined && indent + whitespace.length > margin) { comments.push(whitespace.slice(margin - indent - 1)); } indent += whitespace.length; @@ -15699,6 +16549,7 @@ var ts; case 1: break; default: + state = 2; pushComment(scanner.getTokenText()); break; } @@ -15731,7 +16582,7 @@ var ts; content.charCodeAt(start + 3) !== 42; } function createJSDocComment() { - var result = createNode(278, start); + var result = createNode(282, start); result.tags = tags; result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -15788,7 +16639,7 @@ var ts; } function parseTagComments(indent) { var comments = []; - var state = 1; + var state = 0; var margin; function pushComment(text) { if (!margin) { @@ -15841,7 +16692,7 @@ var ts; return comments; } function parseUnknownTag(atToken, tagName) { - var result = createNode(279, atToken.pos); + var result = createNode(283, atToken.pos); result.atToken = atToken; result.tagName = tagName; return finishNode(result); @@ -15896,7 +16747,7 @@ var ts; if (!typeExpression) { typeExpression = tryParseTypeExpression(); } - var result = createNode(281, atToken.pos); + var result = createNode(285, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.preParameterName = preName; @@ -15907,20 +16758,20 @@ var ts; return finishNode(result); } function parseReturnTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 282; })) { + if (ts.forEach(tags, function (t) { return t.kind === 286; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(282, atToken.pos); + var result = createNode(286, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); } function parseTypeTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 283; })) { + if (ts.forEach(tags, function (t) { return t.kind === 287; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(283, atToken.pos); + var result = createNode(287, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); @@ -15935,7 +16786,7 @@ var ts; parseErrorAtPosition(scanner.getStartPos(), 0, ts.Diagnostics.Identifier_expected); return undefined; } - var result = createNode(286, atToken.pos); + var result = createNode(290, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.name = name; @@ -15944,7 +16795,7 @@ var ts; } function parseAugmentsTag(atToken, tagName) { var typeExpression = tryParseTypeExpression(); - var result = createNode(280, atToken.pos); + var result = createNode(284, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = typeExpression; @@ -15953,25 +16804,28 @@ var ts; function parseTypedefTag(atToken, tagName) { var typeExpression = tryParseTypeExpression(); skipWhitespace(); - var typedefTag = createNode(285, atToken.pos); + var typedefTag = createNode(289, atToken.pos); typedefTag.atToken = atToken; typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(0); if (typedefTag.fullName) { var rightNode = typedefTag.fullName; - while (rightNode.kind !== 70) { + while (true) { + if (rightNode.kind === 70 || !rightNode.body) { + typedefTag.name = rightNode.kind === 70 ? rightNode : rightNode.name; + break; + } rightNode = rightNode.body; } - typedefTag.name = rightNode; } typedefTag.typeExpression = typeExpression; skipWhitespace(); if (typeExpression) { - if (typeExpression.type.kind === 272) { + if (typeExpression.type.kind === 276) { var jsDocTypeReference = typeExpression.type; if (jsDocTypeReference.name.kind === 70) { - var name_14 = jsDocTypeReference.name; - if (name_14.text === "Object") { + var name = jsDocTypeReference.name; + if (name.text === "Object") { typedefTag.jsDocTypeLiteral = scanChildTags(); } } @@ -15985,7 +16839,7 @@ var ts; } return finishNode(typedefTag); function scanChildTags() { - var jsDocTypeLiteral = createNode(287, scanner.getStartPos()); + var jsDocTypeLiteral = createNode(291, scanner.getStartPos()); var resumePos = scanner.getStartPos(); var canParseTag = true; var seenAsterisk = false; @@ -16015,6 +16869,7 @@ var ts; break; case 70: canParseTag = false; + break; case 1: break; } @@ -16026,7 +16881,7 @@ var ts; var pos = scanner.getTokenPos(); var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (typeNameOrNamespaceName && parseOptional(22)) { - var jsDocNamespaceNode = createNode(230, pos); + var jsDocNamespaceNode = createNode(232, pos); jsDocNamespaceNode.flags |= flags; jsDocNamespaceNode.name = typeNameOrNamespaceName; jsDocNamespaceNode.body = parseJSDocTypeNameWithNamespace(4); @@ -16070,19 +16925,19 @@ var ts; return false; } function parseTemplateTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 284; })) { + if (ts.forEach(tags, function (t) { return t.kind === 288; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } var typeParameters = createNodeArray(); while (true) { - var name_15 = parseJSDocIdentifierName(); + var name = parseJSDocIdentifierName(); skipWhitespace(); - if (!name_15) { + if (!name) { parseErrorAtPosition(scanner.getStartPos(), 0, ts.Diagnostics.Identifier_expected); return undefined; } - var typeParameter = createNode(143, name_15.pos); - typeParameter.name = name_15; + var typeParameter = createNode(144, name.pos); + typeParameter.name = name; finishNode(typeParameter); typeParameters.push(typeParameter); if (token() === 25) { @@ -16093,7 +16948,7 @@ var ts; break; } } - var result = createNode(284, atToken.pos); + var result = createNode(288, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeParameters = typeParameters; @@ -16385,7 +17240,7 @@ var ts; } function visitArray(array) { if (position >= array.pos && position < array.end) { - for (var i = 0, n = array.length; i < n; i++) { + for (var i = 0; i < array.length; i++) { var child = array[i]; if (child) { if (child.pos === position) { @@ -16412,16 +17267,16 @@ var ts; var ts; (function (ts) { function getModuleInstanceState(node) { - if (node.kind === 227 || node.kind === 228) { + if (node.kind === 229 || node.kind === 230) { return 0; } else if (ts.isConstEnumDeclaration(node)) { return 2; } - else if ((node.kind === 235 || node.kind === 234) && !(ts.hasModifier(node, 1))) { + else if ((node.kind === 237 || node.kind === 236) && !(ts.hasModifier(node, 1))) { return 0; } - else if (node.kind === 231) { + else if (node.kind === 233) { var state_1 = 0; ts.forEachChild(node, function (n) { switch (getModuleInstanceState(n)) { @@ -16437,7 +17292,7 @@ var ts; }); return state_1; } - else if (node.kind === 230) { + else if (node.kind === 232) { var body = node.body; return body ? getModuleInstanceState(body) : 1; } @@ -16519,7 +17374,7 @@ var ts; } return bindSourceFile; function bindInStrictMode(file, opts) { - if (opts.alwaysStrict && !ts.isDeclarationFile(file)) { + if ((opts.alwaysStrict === undefined ? opts.strict : opts.alwaysStrict) && !ts.isDeclarationFile(file)) { return true; } else { @@ -16546,7 +17401,7 @@ var ts; if (symbolFlags & 107455) { var valueDeclaration = symbol.valueDeclaration; if (!valueDeclaration || - (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 230)) { + (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 232)) { symbol.valueDeclaration = node; } } @@ -16556,7 +17411,7 @@ var ts; if (ts.isAmbientModule(node)) { return ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + node.name.text + "\""; } - if (node.name.kind === 142) { + if (node.name.kind === 143) { var nameExpression = node.name.expression; if (ts.isStringOrNumericLiteral(nameExpression)) { return nameExpression.text; @@ -16567,46 +17422,47 @@ var ts; return node.name.text; } switch (node.kind) { - case 150: + case 151: return "__constructor"; - case 158: - case 153: - return "__call"; case 159: case 154: - return "__new"; + return "__call"; + case 160: case 155: + return "__new"; + case 156: return "__index"; - case 241: + case 243: return "__export"; - case 240: + case 242: return node.isExportEquals ? "export=" : "default"; - case 192: + case 193: switch (ts.getSpecialPropertyAssignmentKind(node)) { case 2: return "export="; case 1: case 4: + case 5: return node.left.name.text; case 3: return node.left.expression.name.text; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 225: - case 226: + case 227: + case 228: return ts.hasModifier(node, 512) ? "default" : undefined; - case 274: + case 278: return ts.isJSDocConstructSignature(node) ? "__new" : "__call"; - case 144: - ts.Debug.assert(node.parent.kind === 274); + case 145: + ts.Debug.assert(node.parent.kind === 278); var functionType = node.parent; var index = ts.indexOf(functionType.parameters, node); return "arg" + index; - case 285: + case 289: var parentNode = node.parent && node.parent.parent; var nameFromParentNode = void 0; - if (parentNode && parentNode.kind === 205) { + if (parentNode && parentNode.kind === 207) { if (parentNode.declarationList.declarations.length > 0) { var nameIdentifier = parentNode.declarationList.declarations[0].name; if (nameIdentifier.kind === 70) { @@ -16629,13 +17485,16 @@ var ts; symbol = createSymbol(0, "__missing"); } else { - symbol = symbolTable[name] || (symbolTable[name] = createSymbol(0, name)); + symbol = symbolTable.get(name); + if (!symbol) { + symbolTable.set(name, symbol = createSymbol(0, name)); + } if (name && (includes & 788448)) { - classifiableNames[name] = name; + classifiableNames.set(name, name); } if (symbol.flags & excludes) { if (symbol.isReplaceableByMethod) { - symbol = symbolTable[name] = createSymbol(0, name); + symbolTable.set(name, symbol = createSymbol(0, name)); } else { if (node.name) { @@ -16650,7 +17509,7 @@ var ts; } else { if (symbol.declarations && symbol.declarations.length && - (isDefaultExport || (node.kind === 240 && !node.isExportEquals))) { + (isDefaultExport || (node.kind === 242 && !node.isExportEquals))) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; } } @@ -16670,7 +17529,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1; if (symbolFlags & 8388608) { - if (node.kind === 243 || (node.kind === 234 && hasExportModifier)) { + if (node.kind === 245 || (node.kind === 236 && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -16678,7 +17537,7 @@ var ts; } } else { - var isJSDocTypedefInJSDocNamespace = node.kind === 285 && + var isJSDocTypedefInJSDocNamespace = node.kind === 289 && node.name && node.name.kind === 70 && node.name.isInJSDocNamespace; @@ -16733,13 +17592,13 @@ var ts; activeLabels = undefined; hasExplicitReturn = false; bindChildren(node); - node.flags &= ~64896; + node.flags &= ~1408; if (!(currentFlow.flags & 1) && containerFlags & 8 && ts.nodeIsPresent(node.body)) { node.flags |= 128; if (hasExplicitReturn) node.flags |= 256; } - if (node.kind === 261) { + if (node.kind === 264) { node.flags |= emitFlags; } if (isIIFE) { @@ -16815,66 +17674,72 @@ var ts; return; } switch (node.kind) { - case 210: + case 212: bindWhileStatement(node); break; - case 209: + case 211: bindDoStatement(node); break; - case 211: + case 213: bindForStatement(node); break; - case 212: - case 213: + case 214: + case 215: bindForInOrForOfStatement(node); break; - case 208: + case 210: bindIfStatement(node); break; - case 216: - case 220: + case 218: + case 222: bindReturnOrThrow(node); break; - case 215: - case 214: + case 217: + case 216: bindBreakOrContinueStatement(node); break; - case 221: + case 223: bindTryStatement(node); break; - case 218: + case 220: bindSwitchStatement(node); break; - case 232: + case 234: bindCaseBlock(node); break; - case 253: + case 256: bindCaseClause(node); break; - case 219: + case 221: bindLabeledStatement(node); break; - case 190: + case 191: bindPrefixUnaryExpressionFlow(node); break; - case 191: + case 192: bindPostfixUnaryExpressionFlow(node); break; - case 192: + case 193: bindBinaryExpressionFlow(node); break; - case 186: + case 187: bindDeleteExpressionFlow(node); break; - case 193: + case 194: bindConditionalExpressionFlow(node); break; - case 223: + case 225: bindVariableDeclarationFlow(node); break; - case 179: + case 180: bindCallExpressionFlow(node); break; + case 282: + bindJSDocComment(node); + break; + case 289: + bindJSDocTypedefTag(node); + break; default: bindEachChild(node); break; @@ -16884,15 +17749,15 @@ var ts; switch (expr.kind) { case 70: case 98: - case 177: + case 178: return isNarrowableReference(expr); - case 179: + case 180: return hasNarrowableArgument(expr); - case 183: + case 184: return isNarrowingExpression(expr.expression); - case 192: + case 193: return isNarrowingBinaryExpression(expr); - case 190: + case 191: return expr.operator === 50 && isNarrowingExpression(expr.operand); } return false; @@ -16900,7 +17765,8 @@ var ts; function isNarrowableReference(expr) { return expr.kind === 70 || expr.kind === 98 || - expr.kind === 177 && isNarrowableReference(expr.expression); + expr.kind === 96 || + expr.kind === 178 && isNarrowableReference(expr.expression); } function hasNarrowableArgument(expr) { if (expr.arguments) { @@ -16911,14 +17777,14 @@ var ts; } } } - if (expr.expression.kind === 177 && + if (expr.expression.kind === 178 && isNarrowableReference(expr.expression.expression)) { return true; } return false; } function isNarrowingTypeofOperands(expr1, expr2) { - return expr1.kind === 187 && isNarrowableOperand(expr1.expression) && expr2.kind === 9; + return expr1.kind === 188 && isNarrowableOperand(expr1.expression) && expr2.kind === 9; } function isNarrowingBinaryExpression(expr) { switch (expr.operatorToken.kind) { @@ -16939,9 +17805,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 183: + case 184: return isNarrowableOperand(expr.expression); - case 192: + case 193: switch (expr.operatorToken.kind) { case 57: return isNarrowableOperand(expr.left); @@ -17035,33 +17901,33 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 208: case 210: - case 209: - return parent.expression === node; + case 212: case 211: - case 193: + return parent.expression === node; + case 213: + case 194: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 183) { + if (node.kind === 184) { node = node.expression; } - else if (node.kind === 190 && node.operator === 50) { + else if (node.kind === 191 && node.operator === 50) { node = node.operand; } else { - return node.kind === 192 && (node.operatorToken.kind === 52 || + return node.kind === 193 && (node.operatorToken.kind === 52 || node.operatorToken.kind === 53); } } } function isTopLevelLogicalExpression(node) { - while (node.parent.kind === 183 || - node.parent.kind === 190 && + while (node.parent.kind === 184 || + node.parent.kind === 191 && node.parent.operator === 50) { node = node.parent; } @@ -17103,7 +17969,7 @@ var ts; } function bindDoStatement(node) { var preDoLabel = createLoopLabel(); - var enclosingLabeledStatement = node.parent.kind === 219 + var enclosingLabeledStatement = node.parent.kind === 221 ? ts.lastOrUndefined(activeLabels) : undefined; var preConditionLabel = enclosingLabeledStatement ? enclosingLabeledStatement.continueTarget : createBranchLabel(); @@ -17135,10 +18001,13 @@ var ts; var postLoopLabel = createBranchLabel(); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; + if (node.kind === 215) { + bind(node.awaitModifier); + } bind(node.expression); addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 224) { + if (node.initializer.kind !== 226) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -17160,7 +18029,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 216) { + if (node.kind === 218) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -17180,7 +18049,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 215 ? breakTarget : continueTarget; + var flowLabel = node.kind === 217 ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -17213,7 +18082,8 @@ var ts; flowAfterCatch = currentFlow; } if (node.finallyBlock) { - addAntecedent(preFinallyLabel, preTryFlow); + var preFinallyFlow = { flags: 2048, antecedent: preTryFlow, lock: {} }; + addAntecedent(preFinallyLabel, preFinallyFlow); currentFlow = finishFlowLabel(preFinallyLabel); bind(node.finallyBlock); if (!(currentFlow.flags & 1)) { @@ -17223,6 +18093,11 @@ var ts; : unreachableFlow; } } + if (!(currentFlow.flags & 1)) { + var afterFinallyFlow = { flags: 4096, antecedent: currentFlow }; + preFinallyFlow.lock = afterFinallyFlow; + currentFlow = afterFinallyFlow; + } } else { currentFlow = finishFlowLabel(preFinallyLabel); @@ -17237,7 +18112,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 254; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 257; }); node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents; if (!hasDefault) { addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0)); @@ -17302,13 +18177,13 @@ var ts; if (!activeLabel.referenced && !options.allowUnusedLabels) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node.label, ts.Diagnostics.Unused_label)); } - if (!node.statement || node.statement.kind !== 209) { + if (!node.statement || node.statement.kind !== 211) { addAntecedent(postStatementLabel, currentFlow); currentFlow = finishFlowLabel(postStatementLabel); } } function bindDestructuringTargetFlow(node) { - if (node.kind === 192 && node.operatorToken.kind === 57) { + if (node.kind === 193 && node.operatorToken.kind === 57) { bindAssignmentTargetFlow(node.left); } else { @@ -17319,10 +18194,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowAssignment(currentFlow, node); } - else if (node.kind === 175) { + else if (node.kind === 176) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 196) { + if (e.kind === 197) { bindAssignmentTargetFlow(e.expression); } else { @@ -17330,16 +18205,16 @@ var ts; } } } - else if (node.kind === 176) { + else if (node.kind === 177) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 257) { + if (p.kind === 260) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 258) { + else if (p.kind === 261) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 259) { + else if (p.kind === 262) { bindAssignmentTargetFlow(p.expression); } } @@ -17395,7 +18270,7 @@ var ts; bindEachChild(node); if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 57 && node.left.kind === 178) { + if (operator === 57 && node.left.kind === 179) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -17406,7 +18281,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 177) { + if (node.expression.kind === 178) { bindAssignmentTargetFlow(node.expression); } } @@ -17439,16 +18314,31 @@ var ts; } function bindVariableDeclarationFlow(node) { bindEachChild(node); - if (node.initializer || node.parent.parent.kind === 212 || node.parent.parent.kind === 213) { + if (node.initializer || node.parent.parent.kind === 214 || node.parent.parent.kind === 215) { bindInitializedVariableFlow(node); } } + function bindJSDocComment(node) { + ts.forEachChild(node, function (n) { + if (n.kind !== 289) { + bind(n); + } + }); + } + function bindJSDocTypedefTag(node) { + ts.forEachChild(node, function (n) { + if (node.fullName && n === node.name && node.fullName.kind !== 70) { + return; + } + bind(n); + }); + } function bindCallExpressionFlow(node) { var expr = node.expression; - while (expr.kind === 183) { + while (expr.kind === 184) { expr = expr.expression; } - if (expr.kind === 184 || expr.kind === 185) { + if (expr.kind === 185 || expr.kind === 186) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -17456,7 +18346,7 @@ var ts; else { bindEachChild(node); } - if (node.expression.kind === 177) { + if (node.expression.kind === 178) { var propertyAccess = node.expression; if (isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -17465,52 +18355,53 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 197: - case 226: - case 229: - case 176: - case 161: - case 287: - case 270: - return 1; - case 227: - return 1 | 64; - case 274: - case 230: + case 198: case 228: - case 170: + case 231: + case 177: + case 162: + case 291: + case 274: + case 253: + return 1; + case 229: + return 1 | 64; + case 278: + case 232: + case 230: + case 171: return 1 | 32; - case 261: + case 264: return 1 | 4 | 32; - case 149: + case 150: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 | 4 | 32 | 8 | 128; } - case 150: - case 225: - case 148: case 151: + case 227: + case 149: case 152: case 153: case 154: case 155: - case 158: + case 156: case 159: + case 160: return 1 | 4 | 32 | 8; - case 184: case 185: + case 186: return 1 | 4 | 32 | 8 | 16; - case 231: + case 233: return 4; - case 147: + case 148: return node.initializer ? 4 : 0; - case 256: - case 211: - case 212: + case 259: case 213: - case 232: + case 214: + case 215: + case 234: return 2; - case 204: + case 206: return ts.isFunctionLike(node.parent) ? 0 : 2; } return 0; @@ -17526,37 +18417,38 @@ var ts; } function declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes) { switch (container.kind) { - case 230: + case 232: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 261: + case 264: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 197: - case 226: + case 198: + case 228: return declareClassMember(node, symbolFlags, symbolExcludes); - case 229: + case 231: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 161: - case 176: - case 227: - case 270: - case 287: + case 162: + case 177: + case 229: + case 274: + case 291: + case 253: return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 158: case 159: - case 153: + case 160: case 154: case 155: - case 149: - case 148: + case 156: case 150: + case 149: case 151: case 152: - case 225: - case 184: + case 153: + case 227: case 185: - case 274: - case 228: - case 170: + case 186: + case 278: + case 230: + case 171: return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); } } @@ -17571,11 +18463,11 @@ var ts; : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); } function hasExportDeclarations(node) { - var body = node.kind === 261 ? node : node.body; - if (body && (body.kind === 261 || body.kind === 231)) { + var body = node.kind === 264 ? node : node.body; + if (body && (body.kind === 264 || body.kind === 233)) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 241 || stat.kind === 240) { + if (stat.kind === 243 || stat.kind === 242) { return true; } } @@ -17597,7 +18489,7 @@ var ts; errorOnFirstToken(node, ts.Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible); } if (ts.isExternalModuleAugmentation(node)) { - declareSymbolAndAddToSymbolTable(node, 1024, 0); + declareModuleSymbol(node); } else { var pattern = void 0; @@ -17617,12 +18509,8 @@ var ts; } } else { - var state = getModuleInstanceState(node); - if (state === 0) { - declareSymbolAndAddToSymbolTable(node, 1024, 0); - } - else { - declareSymbolAndAddToSymbolTable(node, 512, 106639); + var state = declareModuleSymbol(node); + if (state !== 0) { if (node.symbol.flags & (16 | 32 | 256)) { node.symbol.constEnumOnlyModule = false; } @@ -17638,29 +18526,35 @@ var ts; } } } + function declareModuleSymbol(node) { + var state = getModuleInstanceState(node); + var instantiated = state !== 0; + declareSymbolAndAddToSymbolTable(node, instantiated ? 512 : 1024, instantiated ? 106639 : 0); + return state; + } function bindFunctionOrConstructorType(node) { var symbol = createSymbol(131072, getDeclarationName(node)); addDeclarationToSymbol(symbol, node, 131072); var typeLiteralSymbol = createSymbol(2048, "__type"); addDeclarationToSymbol(typeLiteralSymbol, node, 2048); typeLiteralSymbol.members = ts.createMap(); - typeLiteralSymbol.members[symbol.name] = symbol; + typeLiteralSymbol.members.set(symbol.name, symbol); } function bindObjectLiteralExpression(node) { if (inStrictMode) { var seen = ts.createMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 259 || prop.name.kind !== 70) { + if (prop.kind === 262 || prop.name.kind !== 70) { continue; } var identifier = prop.name; - var currentKind = prop.kind === 257 || prop.kind === 258 || prop.kind === 149 + var currentKind = prop.kind === 260 || prop.kind === 261 || prop.kind === 150 ? 1 : 2; - var existingKind = seen[identifier.text]; + var existingKind = seen.get(identifier.text); if (!existingKind) { - seen[identifier.text] = currentKind; + seen.set(identifier.text, currentKind); continue; } if (currentKind === 1 && existingKind === 1) { @@ -17671,16 +18565,22 @@ var ts; } return bindAnonymousDeclaration(node, 4096, "__object"); } + function bindJsxAttributes(node) { + return bindAnonymousDeclaration(node, 4096, "__jsxAttributes"); + } + function bindJsxAttribute(node, symbolFlags, symbolExcludes) { + return declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); + } function bindAnonymousDeclaration(node, symbolFlags, name) { var symbol = createSymbol(symbolFlags, name); addDeclarationToSymbol(symbol, node, symbolFlags); } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 230: + case 232: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 261: + case 264: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -17770,8 +18670,8 @@ var ts; } function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2) { - if (blockScopeContainer.kind !== 261 && - blockScopeContainer.kind !== 230 && + if (blockScopeContainer.kind !== 264 && + blockScopeContainer.kind !== 232 && !ts.isFunctionLike(blockScopeContainer)) { var errorSpan = ts.getErrorSpanForNode(file, node); file.bindDiagnostics.push(ts.createFileDiagnostic(file, errorSpan.start, errorSpan.length, getStrictModeBlockScopeFunctionDeclarationMessage(node))); @@ -17779,7 +18679,7 @@ var ts; } } function checkStrictModeNumericLiteral(node) { - if (inStrictMode && node.isOctalLiteral) { + if (inStrictMode && node.numericLiteralFlags & 4) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode)); } } @@ -17813,8 +18713,11 @@ var ts; } node.parent = parent; var saveInStrictMode = inStrictMode; + if (ts.isInJavaScriptFile(node)) { + bindJSDocTypedefTagIfAny(node); + } bindWorker(node); - if (node.kind > 140) { + if (node.kind > 141) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -17831,6 +18734,26 @@ var ts; } inStrictMode = saveInStrictMode; } + function bindJSDocTypedefTagIfAny(node) { + if (!node.jsDoc) { + return; + } + for (var _i = 0, _a = node.jsDoc; _i < _a.length; _i++) { + var jsDoc = _a[_i]; + if (!jsDoc.tags) { + continue; + } + for (var _b = 0, _c = jsDoc.tags; _b < _c.length; _b++) { + var tag = _c[_b]; + if (tag.kind === 289) { + var savedParent = parent; + parent = jsDoc; + bind(tag); + parent = savedParent; + } + } + } + } function updateStrictModeStatementList(statements) { if (!inStrictMode) { for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) { @@ -17854,90 +18777,88 @@ var ts; case 70: if (node.isInJSDocNamespace) { var parentNode = node.parent; - while (parentNode && parentNode.kind !== 285) { + while (parentNode && parentNode.kind !== 289) { parentNode = parentNode.parent; } bindBlockScopedDeclaration(parentNode, 524288, 793064); break; } case 98: - if (currentFlow && (ts.isExpression(node) || parent.kind === 258)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 261)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); - case 177: + case 178: if (currentFlow && isNarrowableReference(node)) { node.flowNode = currentFlow; } break; - case 192: - if (ts.isInJavaScriptFile(node)) { - var specialKind = ts.getSpecialPropertyAssignmentKind(node); - switch (specialKind) { - case 1: - bindExportsPropertyAssignment(node); - break; - case 2: - bindModuleExportsAssignment(node); - break; - case 3: - bindPrototypePropertyAssignment(node); - break; - case 4: - bindThisPropertyAssignment(node); - break; - case 0: - break; - default: - ts.Debug.fail("Unknown special property assignment kind"); - } + case 193: + var specialKind = ts.getSpecialPropertyAssignmentKind(node); + switch (specialKind) { + case 1: + bindExportsPropertyAssignment(node); + break; + case 2: + bindModuleExportsAssignment(node); + break; + case 3: + bindPrototypePropertyAssignment(node); + break; + case 4: + bindThisPropertyAssignment(node); + break; + case 5: + bindStaticPropertyAssignment(node); + break; + case 0: + break; + default: + ts.Debug.fail("Unknown special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 256: + case 259: return checkStrictModeCatchClause(node); - case 186: + case 187: return checkStrictModeDeleteExpression(node); case 8: return checkStrictModeNumericLiteral(node); - case 191: + case 192: return checkStrictModePostfixUnaryExpression(node); - case 190: + case 191: return checkStrictModePrefixUnaryExpression(node); - case 217: + case 219: return checkStrictModeWithStatement(node); - case 167: + case 168: seenThisKeyword = true; return; - case 156: + case 157: return checkTypePredicate(node); - case 143: - return declareSymbolAndAddToSymbolTable(node, 262144, 530920); case 144: + return declareSymbolAndAddToSymbolTable(node, 262144, 530920); + case 145: return bindParameter(node); - case 223: - case 174: - if (node.dotDotDotToken && node.parent.kind === 172) { - emitFlags |= 32768; - } + case 225: + case 175: return bindVariableDeclarationOrBindingElement(node); + case 148: case 147: - case 146: - case 271: - return bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 0); - case 286: + case 275: + return bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 67108864 : 0), 0); + case 290: return bindJSDocProperty(node); - case 257: - case 258: - return bindPropertyOrMethodOrAccessor(node, 4, 0); case 260: + case 261: + return bindPropertyOrMethodOrAccessor(node, 4, 0); + case 263: return bindPropertyOrMethodOrAccessor(node, 8, 900095); - case 259: - case 251: + case 262: + case 254: var root = container; var hasRest = false; while (root.parent) { - if (root.kind === 176 && - root.parent.kind === 192 && + if (root.kind === 177 && + root.parent.kind === 193 && root.parent.operatorToken.kind === 57 && root.parent.left === root) { hasRest = true; @@ -17945,80 +18866,83 @@ var ts; } root = root.parent; } - emitFlags |= hasRest ? 32768 : 16384; return; - case 153: case 154: case 155: + case 156: return declareSymbolAndAddToSymbolTable(node, 131072, 0); - case 149: - case 148: - return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 0 : 99263); - case 225: - return bindFunctionDeclaration(node); case 150: - return declareSymbolAndAddToSymbolTable(node, 16384, 0); + case 149: + return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 67108864 : 0), ts.isObjectLiteralMethod(node) ? 0 : 99263); + case 227: + return bindFunctionDeclaration(node); case 151: - return bindPropertyOrMethodOrAccessor(node, 32768, 41919); + return declareSymbolAndAddToSymbolTable(node, 16384, 0); case 152: + return bindPropertyOrMethodOrAccessor(node, 32768, 41919); + case 153: return bindPropertyOrMethodOrAccessor(node, 65536, 74687); - case 158: case 159: - case 274: + case 160: + case 278: return bindFunctionOrConstructorType(node); - case 161: - case 170: - case 287: - case 270: + case 162: + case 171: + case 291: + case 274: return bindAnonymousDeclaration(node, 2048, "__type"); - case 176: + case 177: return bindObjectLiteralExpression(node); - case 184: case 185: + case 186: return bindFunctionExpression(node); - case 179: + case 180: if (ts.isInJavaScriptFile(node)) { bindCallExpression(node); } break; - case 197: - case 226: + case 198: + case 228: inStrictMode = true; return bindClassLikeDeclaration(node); - case 227: + case 229: return bindBlockScopedDeclaration(node, 64, 792968); - case 285: + case 289: if (!node.fullName || node.fullName.kind === 70) { return bindBlockScopedDeclaration(node, 524288, 793064); } break; - case 228: - return bindBlockScopedDeclaration(node, 524288, 793064); - case 229: - return bindEnumDeclaration(node); case 230: + return bindBlockScopedDeclaration(node, 524288, 793064); + case 231: + return bindEnumDeclaration(node); + case 232: return bindModuleDeclaration(node); - case 234: - case 237: - case 239: - case 243: - return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608); - case 233: - return bindNamespaceExportDeclaration(node); + case 253: + return bindJsxAttributes(node); + case 252: + return bindJsxAttribute(node, 4, 0); case 236: - return bindImportClause(node); + case 239: case 241: + case 245: + return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608); + case 235: + return bindNamespaceExportDeclaration(node); + case 238: + return bindImportClause(node); + case 243: return bindExportDeclaration(node); - case 240: + case 242: return bindExportAssignment(node); - case 261: + case 264: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 204: + case 206: if (!ts.isFunctionLike(node.parent)) { return; } - case 231: + case 233: return updateStrictModeStatementList(node.statements); } } @@ -18027,7 +18951,7 @@ var ts; if (parameterName && parameterName.kind === 70) { checkStrictModeIdentifier(parameterName); } - if (parameterName && parameterName.kind === 167) { + if (parameterName && parameterName.kind === 168) { seenThisKeyword = true; } bind(type); @@ -18046,7 +18970,7 @@ var ts; bindAnonymousDeclaration(node, 8388608, getDeclarationName(node)); } else { - var flags = node.kind === 240 && ts.exportAssignmentIsAlias(node) + var flags = node.kind === 242 && ts.exportAssignmentIsAlias(node) ? 8388608 : 4; declareSymbol(container.symbol.exports, container.symbol, node, flags, 4 | 8388608 | 32 | 16); @@ -18056,17 +18980,17 @@ var ts; if (node.modifiers && node.modifiers.length) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Modifiers_cannot_appear_here)); } - if (node.parent.kind !== 261) { + if (node.parent.kind !== 264) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_at_top_level)); return; } else { - var parent_4 = node.parent; - if (!ts.isExternalModule(parent_4)) { + var parent_1 = node.parent; + if (!ts.isExternalModule(parent_1)) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_in_module_files)); return; } - if (!parent_4.isDeclarationFile) { + if (!parent_1.isDeclarationFile) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_in_declaration_files)); return; } @@ -18076,10 +19000,10 @@ var ts; } function bindExportDeclaration(node) { if (!container.symbol || !container.symbol.exports) { - bindAnonymousDeclaration(node, 1073741824, getDeclarationName(node)); + bindAnonymousDeclaration(node, 33554432, getDeclarationName(node)); } else if (!node.exportClause) { - declareSymbol(container.symbol.exports, container.symbol, node, 1073741824, 0); + declareSymbol(container.symbol.exports, container.symbol, node, 33554432, 0); } } function bindImportClause(node) { @@ -18099,24 +19023,56 @@ var ts; setCommonJsModuleIndicator(node); declareSymbol(file.symbol.exports, file.symbol, node.left, 4 | 7340032, 0); } + function isExportsOrModuleExportsOrAlias(node) { + return ts.isExportsIdentifier(node) || + ts.isModuleExportsPropertyAccessExpression(node) || + isNameOfExportsOrModuleExportsAliasDeclaration(node); + } + function isNameOfExportsOrModuleExportsAliasDeclaration(node) { + if (node.kind === 70) { + var symbol = lookupSymbolForName(node.text); + if (symbol && symbol.valueDeclaration && symbol.valueDeclaration.kind === 225) { + var declaration = symbol.valueDeclaration; + if (declaration.initializer) { + return isExportsOrModuleExportsOrAliasOrAssignemnt(declaration.initializer); + } + } + } + return false; + } + function isExportsOrModuleExportsOrAliasOrAssignemnt(node) { + return isExportsOrModuleExportsOrAlias(node) || + (ts.isAssignmentExpression(node, true) && (isExportsOrModuleExportsOrAliasOrAssignemnt(node.left) || isExportsOrModuleExportsOrAliasOrAssignemnt(node.right))); + } function bindModuleExportsAssignment(node) { + var assignedExpression = ts.getRightMostAssignedExpression(node.right); + if (ts.isEmptyObjectLiteral(assignedExpression) || isExportsOrModuleExportsOrAlias(assignedExpression)) { + setCommonJsModuleIndicator(node); + return; + } setCommonJsModuleIndicator(node); declareSymbol(file.symbol.exports, file.symbol, node, 4 | 7340032 | 512, 0); } function bindThisPropertyAssignment(node) { ts.Debug.assert(ts.isInJavaScriptFile(node)); - if (container.kind === 225 || container.kind === 184) { - container.symbol.members = container.symbol.members || ts.createMap(); - declareSymbol(container.symbol.members, container.symbol, node, 4, 0 & ~4); - } - else if (container.kind === 150) { - var saveContainer = container; - container = container.parent; - var symbol = bindPropertyOrMethodOrAccessor(node, 4, 0); - if (symbol) { - symbol.isReplaceableByMethod = true; - } - container = saveContainer; + var container = ts.getThisContainer(node, false); + switch (container.kind) { + case 227: + case 185: + container.symbol.members = container.symbol.members || ts.createMap(); + declareSymbol(container.symbol.members, container.symbol, node, 4, 0 & ~4); + break; + case 151: + case 148: + case 150: + case 152: + case 153: + var containingClass = container.parent; + var symbol = declareSymbol(ts.hasModifier(container, 32) ? containingClass.symbol.exports : containingClass.symbol.members, containingClass.symbol, node, 4, 0); + if (symbol) { + symbol.isReplaceableByMethod = true; + } + break; } } function bindPrototypePropertyAssignment(node) { @@ -18126,14 +19082,35 @@ var ts; leftSideOfAssignment.parent = node; constructorFunction.parent = classPrototype; classPrototype.parent = leftSideOfAssignment; - var funcSymbol = container.locals[constructorFunction.text]; - if (!funcSymbol || !(funcSymbol.flags & 16 || ts.isDeclarationOfFunctionExpression(funcSymbol))) { + bindPropertyAssignment(constructorFunction.text, leftSideOfAssignment, true); + } + function bindStaticPropertyAssignment(node) { + var leftSideOfAssignment = node.left; + var target = leftSideOfAssignment.expression; + leftSideOfAssignment.parent = node; + target.parent = leftSideOfAssignment; + if (isNameOfExportsOrModuleExportsAliasDeclaration(target)) { + bindExportsPropertyAssignment(node); + } + else { + bindPropertyAssignment(target.text, leftSideOfAssignment, false); + } + } + function lookupSymbolForName(name) { + return (container.symbol && container.symbol.exports && container.symbol.exports.get(name)) || (container.locals && container.locals.get(name)); + } + function bindPropertyAssignment(functionName, propertyAccessExpression, isPrototypeProperty) { + var targetSymbol = lookupSymbolForName(functionName); + if (targetSymbol && ts.isDeclarationOfFunctionOrClassExpression(targetSymbol)) { + targetSymbol = targetSymbol.valueDeclaration.initializer.symbol; + } + if (!targetSymbol || !(targetSymbol.flags & (16 | 32))) { return; } - if (!funcSymbol.members) { - funcSymbol.members = ts.createMap(); - } - declareSymbol(funcSymbol.members, funcSymbol, leftSideOfAssignment, 4, 0); + var symbolTable = isPrototypeProperty ? + (targetSymbol.members || (targetSymbol.members = ts.createMap())) : + (targetSymbol.exports || (targetSymbol.exports = ts.createMap())); + declareSymbol(symbolTable, targetSymbol, propertyAccessExpression, 4, 0); } function bindCallExpression(node) { if (!file.commonJsModuleIndicator && ts.isRequireCall(node, false)) { @@ -18141,33 +19118,26 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { - if (ts.getClassExtendsHeritageClauseElement(node) !== undefined) { - emitFlags |= 1024; - } - if (ts.nodeIsDecorated(node)) { - emitFlags |= 2048; - } - } - if (node.kind === 226) { + if (node.kind === 228) { bindBlockScopedDeclaration(node, 32, 899519); } else { var bindingName = node.name ? node.name.text : "__class"; bindAnonymousDeclaration(node, 32, bindingName); if (node.name) { - classifiableNames[node.name.text] = node.name.text; + classifiableNames.set(node.name.text, node.name.text); } } var symbol = node.symbol; - var prototypeSymbol = createSymbol(4 | 134217728, "prototype"); - if (symbol.exports[prototypeSymbol.name]) { + var prototypeSymbol = createSymbol(4 | 16777216, "prototype"); + var symbolExport = symbol.exports.get(prototypeSymbol.name); + if (symbolExport) { if (node.name) { node.name.parent = node; } - file.bindDiagnostics.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); + file.bindDiagnostics.push(ts.createDiagnosticForNode(symbolExport.declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); } - symbol.exports[prototypeSymbol.name] = prototypeSymbol; + symbol.exports.set(prototypeSymbol.name, prototypeSymbol); prototypeSymbol.parent = symbol; } function bindEnumDeclaration(node) { @@ -18192,11 +19162,6 @@ var ts; } } function bindParameter(node) { - if (!ts.isDeclarationFile(file) && - !ts.isInAmbientContext(node) && - ts.nodeIsDecorated(node)) { - emitFlags |= (2048 | 4096); - } if (inStrictMode) { checkStrictModeEvalOrArguments(node, node.name); } @@ -18208,13 +19173,13 @@ var ts; } if (ts.isParameterPropertyDeclaration(node)) { var classDeclaration = node.parent.parent; - declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 | (node.questionToken ? 536870912 : 0), 0); + declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 | (node.questionToken ? 67108864 : 0), 0); } } function bindFunctionDeclaration(node) { if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { - if (ts.isAsyncFunctionLike(node)) { - emitFlags |= 8192; + if (ts.isAsyncFunction(node)) { + emitFlags |= 1024; } } checkStrictModeFunctionName(node); @@ -18228,8 +19193,8 @@ var ts; } function bindFunctionExpression(node) { if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { - if (ts.isAsyncFunctionLike(node)) { - emitFlags |= 8192; + if (ts.isAsyncFunction(node)) { + emitFlags |= 1024; } } if (currentFlow) { @@ -18241,11 +19206,8 @@ var ts; } function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) { if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { - if (ts.isAsyncFunctionLike(node)) { - emitFlags |= 8192; - } - if (ts.nodeIsDecorated(node)) { - emitFlags |= 2048; + if (ts.isAsyncFunction(node)) { + emitFlags |= 1024; } } if (currentFlow && ts.isObjectLiteralOrClassExpressionMethod(node)) { @@ -18267,15 +19229,15 @@ var ts; return false; } if (currentFlow === unreachableFlow) { - var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 206) || - node.kind === 226 || - (node.kind === 230 && shouldReportErrorOnModuleDeclaration(node)) || - (node.kind === 229 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 208) || + node.kind === 228 || + (node.kind === 232 && shouldReportErrorOnModuleDeclaration(node)) || + (node.kind === 231 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); if (reportError) { currentFlow = reportedUnreachableFlow; var reportUnreachableCode = !options.allowUnreachableCode && !ts.isInAmbientContext(node) && - (node.kind !== 205 || + (node.kind !== 207 || ts.getCombinedNodeFlags(node.declarationList) & 3 || ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); if (reportUnreachableCode) { @@ -18289,56 +19251,56 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 179: - return computeCallExpression(node, subtreeFlags); case 180: + return computeCallExpression(node, subtreeFlags); + case 181: return computeNewExpression(node, subtreeFlags); - case 230: + case 232: return computeModuleDeclaration(node, subtreeFlags); - case 183: - return computeParenthesizedExpression(node, subtreeFlags); - case 192: - return computeBinaryExpression(node, subtreeFlags); - case 207: - return computeExpressionStatement(node, subtreeFlags); - case 144: - return computeParameter(node, subtreeFlags); - case 185: - return computeArrowFunction(node, subtreeFlags); case 184: + return computeParenthesizedExpression(node, subtreeFlags); + case 193: + return computeBinaryExpression(node, subtreeFlags); + case 209: + return computeExpressionStatement(node, subtreeFlags); + case 145: + return computeParameter(node, subtreeFlags); + case 186: + return computeArrowFunction(node, subtreeFlags); + case 185: return computeFunctionExpression(node, subtreeFlags); - case 225: + case 227: return computeFunctionDeclaration(node, subtreeFlags); - case 223: + case 225: return computeVariableDeclaration(node, subtreeFlags); - case 224: - return computeVariableDeclarationList(node, subtreeFlags); - case 205: - return computeVariableStatement(node, subtreeFlags); - case 219: - return computeLabeledStatement(node, subtreeFlags); case 226: + return computeVariableDeclarationList(node, subtreeFlags); + case 207: + return computeVariableStatement(node, subtreeFlags); + case 221: + return computeLabeledStatement(node, subtreeFlags); + case 228: return computeClassDeclaration(node, subtreeFlags); - case 197: + case 198: return computeClassExpression(node, subtreeFlags); - case 255: + case 258: return computeHeritageClause(node, subtreeFlags); - case 256: + case 259: return computeCatchClause(node, subtreeFlags); - case 199: + case 200: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 150: - return computeConstructor(node, subtreeFlags); - case 147: - return computePropertyDeclaration(node, subtreeFlags); - case 149: - return computeMethod(node, subtreeFlags); case 151: + return computeConstructor(node, subtreeFlags); + case 148: + return computePropertyDeclaration(node, subtreeFlags); + case 150: + return computeMethod(node, subtreeFlags); case 152: + case 153: return computeAccessor(node, subtreeFlags); - case 234: + case 236: return computeImportEquals(node, subtreeFlags); - case 177: + case 178: return computePropertyAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); @@ -18363,8 +19325,8 @@ var ts; switch (kind) { case 96: return true; - case 177: case 178: + case 179: var expression = node.expression; var expressionKind = expression.kind; return expressionKind === 96; @@ -18386,10 +19348,10 @@ var ts; var transformFlags = subtreeFlags; var operatorTokenKind = node.operatorToken.kind; var leftKind = node.left.kind; - if (operatorTokenKind === 57 && leftKind === 176) { + if (operatorTokenKind === 57 && leftKind === 177) { transformFlags |= 8 | 192 | 3072; } - else if (operatorTokenKind === 57 && leftKind === 175) { + else if (operatorTokenKind === 57 && leftKind === 176) { transformFlags |= 192 | 3072; } else if (operatorTokenKind === 39 @@ -18428,8 +19390,8 @@ var ts; var expression = node.expression; var expressionKind = expression.kind; var expressionTransformFlags = expression.transformFlags; - if (expressionKind === 200 - || expressionKind === 182) { + if (expressionKind === 201 + || expressionKind === 183) { transformFlags |= 3; } if (expressionTransformFlags & 1024) { @@ -18526,9 +19488,9 @@ var ts; transformFlags |= 8; } if (ts.hasModifier(node, 256)) { - transformFlags |= 16; + transformFlags |= node.asteriskToken ? 8 : 16; } - if (node.asteriskToken && ts.getEmitFlags(node) & 131072) { + if (node.asteriskToken) { transformFlags |= 768; } node.transformFlags = transformFlags | 536870912; @@ -18571,7 +19533,7 @@ var ts; transformFlags |= 3; } if (modifierFlags & 256) { - transformFlags |= 16; + transformFlags |= node.asteriskToken ? 8 : 16; } if (subtreeFlags & 1048576) { transformFlags |= 8; @@ -18579,7 +19541,7 @@ var ts; if (subtreeFlags & 163840) { transformFlags |= 192; } - if (node.asteriskToken && ts.getEmitFlags(node) & 131072) { + if (node.asteriskToken) { transformFlags |= 768; } } @@ -18594,7 +19556,7 @@ var ts; transformFlags |= 3; } if (ts.hasModifier(node, 256)) { - transformFlags |= 16; + transformFlags |= node.asteriskToken ? 8 : 16; } if (subtreeFlags & 1048576) { transformFlags |= 8; @@ -18602,7 +19564,7 @@ var ts; if (subtreeFlags & 163840) { transformFlags |= 192; } - if (node.asteriskToken && ts.getEmitFlags(node) & 131072) { + if (node.asteriskToken) { transformFlags |= 768; } node.transformFlags = transformFlags | 536870912; @@ -18715,8 +19677,8 @@ var ts; var excludeFlags = 536872257; switch (kind) { case 119: - case 189: - transformFlags |= 16; + case 190: + transformFlags |= 8 | 16; break; case 113: case 111: @@ -18724,50 +19686,66 @@ var ts; case 116: case 123: case 75: - case 229: - case 260: - case 182: - case 200: + case 231: + case 263: + case 183: case 201: + case 202: case 130: transformFlags |= 3; break; - case 246: - case 247: case 248: - case 10: case 249: case 250: + case 10: case 251: case 252: + case 253: + case 254: + case 255: transformFlags |= 4; break; - case 213: - transformFlags |= 8; case 12: case 13: case 14: case 15: - case 194: - case 181: - case 258: + case 195: + case 182: + case 261: case 114: + case 203: transformFlags |= 192; break; - case 195: - transformFlags |= 192 | 16777216; + case 9: + if (node.hasExtendedUnicodeEscape) { + transformFlags |= 192; + } + break; + case 8: + if (node.numericLiteralFlags & 48) { + transformFlags |= 192; + } + break; + case 215: + if (node.awaitModifier) { + transformFlags |= 8; + } + transformFlags |= 192; + break; + case 196: + transformFlags |= 8 | 192 | 16777216; break; case 118: case 132: case 129: - case 134: - case 121: + case 133: case 135: + case 121: + case 136: case 104: - case 143: - case 146: - case 148: - case 153: + case 144: + case 147: + case 149: case 154: case 155: case 156: @@ -18781,26 +19759,27 @@ var ts; case 164: case 165: case 166: - case 227: - case 228: case 167: + case 229: + case 230: case 168: case 169: case 170: case 171: + case 172: transformFlags = 3; excludeFlags = -3; break; - case 142: + case 143: transformFlags |= 2097152; if (subtreeFlags & 16384) { transformFlags |= 65536; } break; - case 196: + case 197: transformFlags |= 192 | 524288; break; - case 259: + case 262: transformFlags |= 8 | 1048576; break; case 96: @@ -18809,27 +19788,27 @@ var ts; case 98: transformFlags |= 16384; break; - case 172: + case 173: transformFlags |= 192 | 8388608; if (subtreeFlags & 524288) { transformFlags |= 8 | 1048576; } excludeFlags = 537396545; break; - case 173: + case 174: transformFlags |= 192 | 8388608; excludeFlags = 537396545; break; - case 174: + case 175: transformFlags |= 192; if (node.dotDotDotToken) { transformFlags |= 524288; } break; - case 145: + case 146: transformFlags |= 3 | 4096; break; - case 176: + case 177: excludeFlags = 540087617; if (subtreeFlags & 2097152) { transformFlags |= 192; @@ -18841,29 +19820,29 @@ var ts; transformFlags |= 8; } break; - case 175: - case 180: + case 176: + case 181: excludeFlags = 537396545; if (subtreeFlags & 524288) { transformFlags |= 192; } break; - case 209: - case 210: case 211: case 212: + case 213: + case 214: if (subtreeFlags & 4194304) { transformFlags |= 192; } break; - case 261: + case 264: if (subtreeFlags & 32768) { transformFlags |= 192; } break; + case 218: case 216: - case 214: - case 215: + case 217: transformFlags |= 33554432; break; } @@ -18871,56 +19850,57 @@ var ts; return transformFlags & ~excludeFlags; } function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 156 && kind <= 171) { + if (kind >= 157 && kind <= 172) { return -3; } switch (kind) { - case 179: case 180: - case 175: + case 181: + case 176: return 537396545; - case 230: + case 232: return 574674241; - case 144: + case 145: return 536872257; - case 185: + case 186: return 601249089; - case 184: - case 225: + case 185: + case 227: return 601281857; - case 224: - return 546309441; case 226: - case 197: + return 546309441; + case 228: + case 198: return 539358529; - case 150: - return 601015617; - case 149: case 151: + return 601015617; + case 150: case 152: + case 153: return 601015617; case 118: case 132: case 129: - case 134: - case 121: case 135: + case 133: + case 121: + case 136: case 104: - case 143: - case 146: - case 148: - case 153: + case 144: + case 147: + case 149: case 154: case 155: - case 227: - case 228: + case 156: + case 229: + case 230: return -3; - case 176: + case 177: return 540087617; - case 256: + case 259: return 537920833; - case 172: case 173: + case 174: return 537396545; default: return 536872257; @@ -18938,6 +19918,12 @@ var ts; return compilerOptions.traceResolution && host.trace !== undefined; } ts.isTraceEnabled = isTraceEnabled; + var Extensions; + (function (Extensions) { + Extensions[Extensions["TypeScript"] = 0] = "TypeScript"; + Extensions[Extensions["JavaScript"] = 1] = "JavaScript"; + Extensions[Extensions["DtsOnly"] = 2] = "DtsOnly"; + })(Extensions || (Extensions = {})); function resolvedTypeScriptOnly(resolved) { if (!resolved) { return undefined; @@ -18945,9 +19931,6 @@ var ts; ts.Debug.assert(ts.extensionIsTypeScript(resolved.extension)); return resolved.path; } - function resolvedFromAnyFile(path) { - return { path: path, extension: ts.extensionFromPath(path) }; - } function resolvedModuleFromResolved(_a, isExternalLibraryImport) { var path = _a.path, extension = _a.extension; return { resolvedFileName: path, extension: extension, isExternalLibraryImport: isExternalLibraryImport }; @@ -18959,37 +19942,28 @@ var ts; return !(ts.isRootedDiskPath(moduleName) || ts.isExternalModuleNameRelative(moduleName)); } ts.moduleHasNonRelativeName = moduleHasNonRelativeName; - function tryReadTypesSection(extensions, packageJsonPath, baseDirectory, state) { + function tryReadPackageJsonFields(readTypes, packageJsonPath, baseDirectory, state) { var jsonContent = readJson(packageJsonPath, state.host); - switch (extensions) { - case 2: - case 0: - return tryReadFromField("typings") || tryReadFromField("types"); - case 1: - if (typeof jsonContent.main === "string") { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.No_types_specified_in_package_json_so_returning_main_value_of_0, jsonContent.main); - } - return ts.normalizePath(ts.combinePaths(baseDirectory, jsonContent.main)); - } - return undefined; - } + return readTypes ? tryReadFromField("typings") || tryReadFromField("types") : tryReadFromField("main"); function tryReadFromField(fieldName) { - if (ts.hasProperty(jsonContent, fieldName)) { - var typesFile = jsonContent[fieldName]; - if (typeof typesFile === "string") { - var typesFilePath = ts.normalizePath(ts.combinePaths(baseDirectory, typesFile)); - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.package_json_has_0_field_1_that_references_2, fieldName, typesFile, typesFilePath); - } - return typesFilePath; - } - else { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_string_got_1, fieldName, typeof typesFile); - } + if (!ts.hasProperty(jsonContent, fieldName)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.package_json_does_not_have_a_0_field, fieldName); } + return; } + var fileName = jsonContent[fieldName]; + if (typeof fileName !== "string") { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_string_got_1, fieldName, typeof fileName); + } + return; + } + var path = ts.normalizePath(ts.combinePaths(baseDirectory, fileName)); + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.package_json_has_0_field_1_that_references_2, fieldName, fileName, path); + } + return path; } } function readJson(path, host) { @@ -19022,11 +19996,12 @@ var ts; return [ts.combinePaths(currentDirectory, nodeModulesAtTypes)]; } var typeRoots; - forEachAncestorDirectory(currentDirectory, function (directory) { + forEachAncestorDirectory(ts.normalizePath(currentDirectory), function (directory) { var atTypes = ts.combinePaths(directory, nodeModulesAtTypes); if (host.directoryExists(atTypes)) { (typeRoots || (typeRoots = [])).push(atTypes); } + return undefined; }); return typeRoots; } @@ -19081,7 +20056,11 @@ var ts; return ts.forEach(typeRoots, function (typeRoot) { var candidate = ts.combinePaths(typeRoot, typeReferenceDirectiveName); var candidateDirectory = ts.getDirectoryPath(candidate); - return resolvedTypeScriptOnly(loadNodeModuleFromDirectory(2, candidate, failedLookupLocations, !directoryProbablyExists(candidateDirectory, host), moduleResolutionState)); + var directoryExists = directoryProbablyExists(candidateDirectory, host); + if (!directoryExists && traceEnabled) { + trace(host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, candidateDirectory); + } + return resolvedTypeScriptOnly(loadNodeModuleFromDirectory(Extensions.DtsOnly, candidate, failedLookupLocations, !directoryExists, moduleResolutionState)); }); } else { @@ -19097,7 +20076,8 @@ var ts; if (traceEnabled) { trace(host, ts.Diagnostics.Looking_up_in_node_modules_folder_initial_location_0, initialLocationForSecondaryLookup); } - resolvedFile = resolvedTypeScriptOnly(loadModuleFromNodeModules(2, typeReferenceDirectiveName, initialLocationForSecondaryLookup, failedLookupLocations, moduleResolutionState)); + var result = loadModuleFromNodeModules(Extensions.DtsOnly, typeReferenceDirectiveName, initialLocationForSecondaryLookup, failedLookupLocations, moduleResolutionState, undefined); + resolvedFile = resolvedTypeScriptOnly(result && result.value); if (!resolvedFile && traceEnabled) { trace(host, ts.Diagnostics.Type_reference_directive_0_was_not_resolved, typeReferenceDirectiveName); } @@ -19138,31 +20118,116 @@ var ts; return result; } ts.getAutomaticTypeDirectiveNames = getAutomaticTypeDirectiveNames; - function resolveModuleName(moduleName, containingFile, compilerOptions, host) { + function createModuleResolutionCache(currentDirectory, getCanonicalFileName) { + var directoryToModuleNameMap = ts.createFileMap(); + var moduleNameToDirectoryMap = ts.createMap(); + return { getOrCreateCacheForDirectory: getOrCreateCacheForDirectory, getOrCreateCacheForModuleName: getOrCreateCacheForModuleName }; + function getOrCreateCacheForDirectory(directoryName) { + var path = ts.toPath(directoryName, currentDirectory, getCanonicalFileName); + var perFolderCache = directoryToModuleNameMap.get(path); + if (!perFolderCache) { + perFolderCache = ts.createMap(); + directoryToModuleNameMap.set(path, perFolderCache); + } + return perFolderCache; + } + function getOrCreateCacheForModuleName(nonRelativeModuleName) { + if (!moduleHasNonRelativeName(nonRelativeModuleName)) { + return undefined; + } + var perModuleNameCache = moduleNameToDirectoryMap.get(nonRelativeModuleName); + if (!perModuleNameCache) { + perModuleNameCache = createPerModuleNameCache(); + moduleNameToDirectoryMap.set(nonRelativeModuleName, perModuleNameCache); + } + return perModuleNameCache; + } + function createPerModuleNameCache() { + var directoryPathMap = ts.createFileMap(); + return { get: get, set: set }; + function get(directory) { + return directoryPathMap.get(ts.toPath(directory, currentDirectory, getCanonicalFileName)); + } + function set(directory, result) { + var path = ts.toPath(directory, currentDirectory, getCanonicalFileName); + if (directoryPathMap.contains(path)) { + return; + } + directoryPathMap.set(path, result); + var resolvedFileName = result.resolvedModule && result.resolvedModule.resolvedFileName; + var commonPrefix = getCommonPrefix(path, resolvedFileName); + var current = path; + while (true) { + var parent = ts.getDirectoryPath(current); + if (parent === current || directoryPathMap.contains(parent)) { + break; + } + directoryPathMap.set(parent, result); + current = parent; + if (current === commonPrefix) { + break; + } + } + } + function getCommonPrefix(directory, resolution) { + if (resolution === undefined) { + return undefined; + } + var resolutionDirectory = ts.toPath(ts.getDirectoryPath(resolution), currentDirectory, getCanonicalFileName); + var i = 0; + while (i < Math.min(directory.length, resolutionDirectory.length) && directory.charCodeAt(i) === resolutionDirectory.charCodeAt(i)) { + i++; + } + var sep = directory.lastIndexOf(ts.directorySeparator, i); + if (sep < 0) { + return undefined; + } + return directory.substr(0, sep); + } + } + } + ts.createModuleResolutionCache = createModuleResolutionCache; + function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache) { var traceEnabled = isTraceEnabled(compilerOptions, host); if (traceEnabled) { trace(host, ts.Diagnostics.Resolving_module_0_from_1, moduleName, containingFile); } - var moduleResolution = compilerOptions.moduleResolution; - if (moduleResolution === undefined) { - moduleResolution = ts.getEmitModuleKind(compilerOptions) === ts.ModuleKind.CommonJS ? ts.ModuleResolutionKind.NodeJs : ts.ModuleResolutionKind.Classic; + var containingDirectory = ts.getDirectoryPath(containingFile); + var perFolderCache = cache && cache.getOrCreateCacheForDirectory(containingDirectory); + var result = perFolderCache && perFolderCache.get(moduleName); + if (result) { if (traceEnabled) { - trace(host, ts.Diagnostics.Module_resolution_kind_is_not_specified_using_0, ts.ModuleResolutionKind[moduleResolution]); + trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); } } else { - if (traceEnabled) { - trace(host, ts.Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0, ts.ModuleResolutionKind[moduleResolution]); + var moduleResolution = compilerOptions.moduleResolution; + if (moduleResolution === undefined) { + moduleResolution = ts.getEmitModuleKind(compilerOptions) === ts.ModuleKind.CommonJS ? ts.ModuleResolutionKind.NodeJs : ts.ModuleResolutionKind.Classic; + if (traceEnabled) { + trace(host, ts.Diagnostics.Module_resolution_kind_is_not_specified_using_0, ts.ModuleResolutionKind[moduleResolution]); + } + } + else { + if (traceEnabled) { + trace(host, ts.Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0, ts.ModuleResolutionKind[moduleResolution]); + } + } + switch (moduleResolution) { + case ts.ModuleResolutionKind.NodeJs: + result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache); + break; + case ts.ModuleResolutionKind.Classic: + result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache); + break; + } + if (perFolderCache) { + perFolderCache.set(moduleName, result); + var perModuleNameCache = cache.getOrCreateCacheForModuleName(moduleName); + if (perModuleNameCache) { + perModuleNameCache.set(containingDirectory, result); + } } - } - var result; - switch (moduleResolution) { - case ts.ModuleResolutionKind.NodeJs: - result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host); - break; - case ts.ModuleResolutionKind.Classic: - result = classicNameResolver(moduleName, containingFile, compilerOptions, host); - break; } if (traceEnabled) { if (result.resolvedModule) { @@ -19287,37 +20352,43 @@ var ts; return loader(extensions, candidate, failedLookupLocations, !directoryProbablyExists(ts.getDirectoryPath(candidate), state.host), state); } } - function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host) { + function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache) { + return nodeModuleNameResolverWorker(moduleName, containingFile, compilerOptions, host, cache, false); + } + ts.nodeModuleNameResolver = nodeModuleNameResolver; + function nodeModuleNameResolverWorker(moduleName, containingFile, compilerOptions, host, cache, jsOnly) { + if (jsOnly === void 0) { jsOnly = false; } var containingDirectory = ts.getDirectoryPath(containingFile); var traceEnabled = isTraceEnabled(compilerOptions, host); var failedLookupLocations = []; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; - var result = tryResolve(0) || tryResolve(1); - if (result) { - var resolved = result.resolved, isExternalLibraryImport = result.isExternalLibraryImport; + var result = jsOnly ? tryResolve(Extensions.JavaScript) : (tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript)); + if (result && result.value) { + var _a = result.value, resolved = _a.resolved, isExternalLibraryImport = _a.isExternalLibraryImport; return createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations); } return { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; function tryResolve(extensions) { - var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, nodeLoadModuleByRelativeName, failedLookupLocations, state); + var loader = function (extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { return nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, true); }; + var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, failedLookupLocations, state); if (resolved) { - return { resolved: resolved, isExternalLibraryImport: false }; + return toSearchResult({ resolved: resolved, isExternalLibraryImport: false }); } if (moduleHasNonRelativeName(moduleName)) { if (traceEnabled) { - trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder, moduleName); + trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1, moduleName, Extensions[extensions]); } - var resolved_1 = loadModuleFromNodeModules(extensions, moduleName, containingDirectory, failedLookupLocations, state); - return resolved_1 && { resolved: { path: realpath(resolved_1.path, host, traceEnabled), extension: resolved_1.extension }, isExternalLibraryImport: true }; + var resolved_1 = loadModuleFromNodeModules(extensions, moduleName, containingDirectory, failedLookupLocations, state, cache); + return resolved_1 && { value: resolved_1.value && { resolved: { path: realpath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }, isExternalLibraryImport: true } }; } else { var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, false, state); - return resolved_2 && { resolved: resolved_2, isExternalLibraryImport: false }; + var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, false, state, true); + return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: false }); } } } - ts.nodeModuleNameResolver = nodeModuleNameResolver; + ts.nodeModuleNameResolverWorker = nodeModuleNameResolverWorker; function realpath(path, host, traceEnabled) { if (!host.realpath) { return path; @@ -19328,12 +20399,35 @@ var ts; } return real; } - function nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { + function nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson) { if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0, candidate); + trace(state.host, ts.Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1, candidate, Extensions[extensions]); } - var resolvedFromFile = !ts.pathEndsWithDirectorySeparator(candidate) && loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); - return resolvedFromFile || loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); + if (!ts.pathEndsWithDirectorySeparator(candidate)) { + if (!onlyRecordFailures) { + var parentOfCandidate = ts.getDirectoryPath(candidate); + if (!directoryProbablyExists(parentOfCandidate, state.host)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, parentOfCandidate); + } + onlyRecordFailures = true; + } + } + var resolvedFromFile = loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); + if (resolvedFromFile) { + return resolvedFromFile; + } + } + if (!onlyRecordFailures) { + var candidateExists = directoryProbablyExists(candidate, state.host); + if (!candidateExists) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, candidate); + } + onlyRecordFailures = true; + } + } + return loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson); } function directoryProbablyExists(directoryName, host) { return !host.directoryExists || host.directoryExists(directoryName); @@ -19361,11 +20455,11 @@ var ts; } } switch (extensions) { - case 2: + case Extensions.DtsOnly: return tryExtension(".d.ts", ts.Extension.Dts); - case 0: + case Extensions.TypeScript: return tryExtension(".ts", ts.Extension.Ts) || tryExtension(".tsx", ts.Extension.Tsx) || tryExtension(".d.ts", ts.Extension.Dts); - case 1: + case Extensions.JavaScript: return tryExtension(".js", ts.Extension.Js) || tryExtension(".jsx", ts.Extension.Jsx); } function tryExtension(ext, extension) { @@ -19374,113 +20468,181 @@ var ts; } } function tryFile(fileName, failedLookupLocations, onlyRecordFailures, state) { - if (!onlyRecordFailures && state.host.fileExists(fileName)) { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName); - } - return fileName; - } - else { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.File_0_does_not_exist, fileName); - } - failedLookupLocations.push(fileName); - return undefined; - } - } - function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { - var packageJsonPath = pathToPackageJson(candidate); - var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); - if (directoryExists && state.host.fileExists(packageJsonPath)) { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); - } - var typesFile = tryReadTypesSection(extensions, packageJsonPath, candidate, state); - if (typesFile) { - var onlyRecordFailures_1 = !directoryProbablyExists(ts.getDirectoryPath(typesFile), state.host); - var fromFile = tryFile(typesFile, failedLookupLocations, onlyRecordFailures_1, state); - if (fromFile) { - return resolvedFromAnyFile(fromFile); - } - var x = tryAddingExtensions(typesFile, 0, failedLookupLocations, onlyRecordFailures_1, state); - if (x) { - return x; + if (!onlyRecordFailures) { + if (state.host.fileExists(fileName)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName); } + return fileName; } else { if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.package_json_does_not_have_a_types_or_main_field); + trace(state.host, ts.Diagnostics.File_0_does_not_exist, fileName); } } } - else { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.File_0_does_not_exist, packageJsonPath); + failedLookupLocations.push(fileName); + return undefined; + } + function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson) { + if (considerPackageJson === void 0) { considerPackageJson = true; } + var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); + if (considerPackageJson) { + var packageJsonPath = pathToPackageJson(candidate); + if (directoryExists && state.host.fileExists(packageJsonPath)) { + var fromPackageJson = loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state); + if (fromPackageJson) { + return fromPackageJson; + } + } + else { + if (directoryExists && state.traceEnabled) { + trace(state.host, ts.Diagnostics.File_0_does_not_exist, packageJsonPath); + } + failedLookupLocations.push(packageJsonPath); } - failedLookupLocations.push(packageJsonPath); } return loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state); } + function loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); + } + var file = tryReadPackageJsonFields(extensions !== Extensions.JavaScript, packageJsonPath, candidate, state); + if (!file) { + return undefined; + } + var onlyRecordFailures = !directoryProbablyExists(ts.getDirectoryPath(file), state.host); + var fromFile = tryFile(file, failedLookupLocations, onlyRecordFailures, state); + if (fromFile) { + var resolved = fromFile && resolvedIfExtensionMatches(extensions, fromFile); + if (resolved) { + return resolved; + } + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromFile); + } + } + var nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions; + return nodeLoadModuleByRelativeName(nextExtensions, file, failedLookupLocations, onlyRecordFailures, state, false); + } + function resolvedIfExtensionMatches(extensions, path) { + var extension = ts.tryGetExtensionFromPath(path); + return extension !== undefined && extensionIsOk(extensions, extension) ? { path: path, extension: extension } : undefined; + } + function extensionIsOk(extensions, extension) { + switch (extensions) { + case Extensions.JavaScript: + return extension === ts.Extension.Js || extension === ts.Extension.Jsx; + case Extensions.TypeScript: + return extension === ts.Extension.Ts || extension === ts.Extension.Tsx || extension === ts.Extension.Dts; + case Extensions.DtsOnly: + return extension === ts.Extension.Dts; + } + } function pathToPackageJson(directory) { return ts.combinePaths(directory, "package.json"); } - function loadModuleFromNodeModulesFolder(extensions, moduleName, directory, failedLookupLocations, state) { - var nodeModulesFolder = ts.combinePaths(directory, "node_modules"); - var nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, state.host); + function loadModuleFromNodeModulesFolder(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, failedLookupLocations, state) { var candidate = ts.normalizePath(ts.combinePaths(nodeModulesFolder, moduleName)); return loadModuleFromFile(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state) || loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state); } - function loadModuleFromNodeModules(extensions, moduleName, directory, failedLookupLocations, state) { - return loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, false); + function loadModuleFromNodeModules(extensions, moduleName, directory, failedLookupLocations, state, cache) { + return loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, false, cache); } function loadModuleFromNodeModulesAtTypes(moduleName, directory, failedLookupLocations, state) { - return loadModuleFromNodeModulesWorker(2, moduleName, directory, failedLookupLocations, state, true); + return loadModuleFromNodeModulesWorker(Extensions.DtsOnly, moduleName, directory, failedLookupLocations, state, true, undefined); } - function loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, typesOnly) { + function loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, typesOnly, cache) { + var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName); return forEachAncestorDirectory(ts.normalizeSlashes(directory), function (ancestorDirectory) { if (ts.getBaseFileName(ancestorDirectory) !== "node_modules") { - return loadModuleFromNodeModulesOneLevel(extensions, moduleName, ancestorDirectory, failedLookupLocations, state, typesOnly); + var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, ancestorDirectory, state.traceEnabled, state.host); + if (resolutionFromCache) { + return resolutionFromCache; + } + return toSearchResult(loadModuleFromNodeModulesOneLevel(extensions, moduleName, ancestorDirectory, failedLookupLocations, state, typesOnly)); } }); } function loadModuleFromNodeModulesOneLevel(extensions, moduleName, directory, failedLookupLocations, state, typesOnly) { if (typesOnly === void 0) { typesOnly = false; } - var packageResult = typesOnly ? undefined : loadModuleFromNodeModulesFolder(extensions, moduleName, directory, failedLookupLocations, state); + var nodeModulesFolder = ts.combinePaths(directory, "node_modules"); + var nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, state.host); + if (!nodeModulesFolderExists && state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesFolder); + } + var packageResult = typesOnly ? undefined : loadModuleFromNodeModulesFolder(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, failedLookupLocations, state); if (packageResult) { return packageResult; } - if (extensions !== 1) { - return loadModuleFromNodeModulesFolder(2, ts.combinePaths("@types", moduleName), directory, failedLookupLocations, state); + if (extensions !== Extensions.JavaScript) { + var nodeModulesAtTypes_1 = ts.combinePaths(nodeModulesFolder, "@types"); + var nodeModulesAtTypesExists = nodeModulesFolderExists; + if (nodeModulesFolderExists && !directoryProbablyExists(nodeModulesAtTypes_1, state.host)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesAtTypes_1); + } + nodeModulesAtTypesExists = false; + } + return loadModuleFromNodeModulesFolder(Extensions.DtsOnly, mangleScopedPackage(moduleName, state), nodeModulesAtTypes_1, nodeModulesAtTypesExists, failedLookupLocations, state); } } - function classicNameResolver(moduleName, containingFile, compilerOptions, host) { + function mangleScopedPackage(moduleName, state) { + if (ts.startsWith(moduleName, "@")) { + var replaceSlash = moduleName.replace(ts.directorySeparator, "__"); + if (replaceSlash !== moduleName) { + var mangled = replaceSlash.slice(1); + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Scoped_package_detected_looking_in_0, mangled); + } + return mangled; + } + } + return moduleName; + } + function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, traceEnabled, host) { + var result = cache && cache.get(containingDirectory); + if (result) { + if (traceEnabled) { + trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); + } + return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension } }; + } + } + function classicNameResolver(moduleName, containingFile, compilerOptions, host, cache) { var traceEnabled = isTraceEnabled(compilerOptions, host); var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var failedLookupLocations = []; var containingDirectory = ts.getDirectoryPath(containingFile); - var resolved = tryResolve(0) || tryResolve(1); - return createResolvedModuleWithFailedLookupLocations(resolved, false, failedLookupLocations); + var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); + return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, false, failedLookupLocations); function tryResolve(extensions) { var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFile, failedLookupLocations, state); if (resolvedUsingSettings) { - return resolvedUsingSettings; + return { value: resolvedUsingSettings }; } + var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName); if (moduleHasNonRelativeName(moduleName)) { var resolved_3 = forEachAncestorDirectory(containingDirectory, function (directory) { + var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, directory, traceEnabled, host); + if (resolutionFromCache) { + return resolutionFromCache; + } var searchName = ts.normalizePath(ts.combinePaths(directory, moduleName)); - return loadModuleFromFile(extensions, searchName, failedLookupLocations, false, state); + return toSearchResult(loadModuleFromFile(extensions, searchName, failedLookupLocations, false, state)); }); if (resolved_3) { return resolved_3; } - if (extensions === 0) { + if (extensions === Extensions.TypeScript) { return loadModuleFromNodeModulesAtTypes(moduleName, containingDirectory, failedLookupLocations, state); } } else { var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - return loadModuleFromFile(extensions, candidate, failedLookupLocations, false, state); + return toSearchResult(loadModuleFromFile(extensions, candidate, failedLookupLocations, false, state)); } } } @@ -19492,10 +20654,13 @@ var ts; } var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var failedLookupLocations = []; - var resolved = loadModuleFromNodeModulesOneLevel(2, moduleName, globalCache, failedLookupLocations, state); + var resolved = loadModuleFromNodeModulesOneLevel(Extensions.DtsOnly, moduleName, globalCache, failedLookupLocations, state); return createResolvedModuleWithFailedLookupLocations(resolved, true, failedLookupLocations); } ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache; + function toSearchResult(value) { + return value !== undefined ? { value: value } : undefined; + } function forEachAncestorDirectory(directory, callback) { while (true) { var result = callback(directory); @@ -19535,23 +20700,29 @@ var ts; ts.getSymbolId = getSymbolId; function createTypeChecker(host, produceDiagnostics) { var cancellationToken; + var requestedExternalEmitHelpers; + var externalHelpersModule; var Symbol = ts.objectAllocator.getSymbolConstructor(); var Type = ts.objectAllocator.getTypeConstructor(); var Signature = ts.objectAllocator.getSignatureConstructor(); var typeCount = 0; var symbolCount = 0; + var symbolInstantiationDepth = 0; var emptyArray = []; var emptySymbols = ts.createMap(); var compilerOptions = host.getCompilerOptions(); - var languageVersion = compilerOptions.target || 0; + var languageVersion = ts.getEmitScriptTarget(compilerOptions); var modulekind = ts.getEmitModuleKind(compilerOptions); var noUnusedIdentifiers = !!compilerOptions.noUnusedLocals || !!compilerOptions.noUnusedParameters; var allowSyntheticDefaultImports = typeof compilerOptions.allowSyntheticDefaultImports !== "undefined" ? compilerOptions.allowSyntheticDefaultImports : modulekind === ts.ModuleKind.System; - var strictNullChecks = compilerOptions.strictNullChecks; + var strictNullChecks = compilerOptions.strictNullChecks === undefined ? compilerOptions.strict : compilerOptions.strictNullChecks; + var noImplicitAny = compilerOptions.noImplicitAny === undefined ? compilerOptions.strict : compilerOptions.noImplicitAny; + var noImplicitThis = compilerOptions.noImplicitThis === undefined ? compilerOptions.strict : compilerOptions.noImplicitThis; var emitResolver = createResolver(); - var undefinedSymbol = createSymbol(4 | 67108864, "undefined"); + var nodeBuilder = createNodeBuilder(); + var undefinedSymbol = createSymbol(4, "undefined"); undefinedSymbol.declarations = []; - var argumentsSymbol = createSymbol(4 | 67108864, "arguments"); + var argumentsSymbol = createSymbol(4, "arguments"); var checker = { getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), "identifierCount"); }, @@ -19560,47 +20731,127 @@ var ts; isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, isUnknownSymbol: function (symbol) { return symbol === unknownSymbol; }, + getMergedSymbol: getMergedSymbol, getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, - getTypeOfSymbolAtLocation: getTypeOfSymbolAtLocation, - getSymbolsOfParameterPropertyDeclaration: getSymbolsOfParameterPropertyDeclaration, + getTypeOfSymbolAtLocation: function (symbol, location) { + location = ts.getParseTreeNode(location); + return location ? getTypeOfSymbolAtLocation(symbol, location) : unknownType; + }, + getSymbolsOfParameterPropertyDeclaration: function (parameter, parameterName) { + parameter = ts.getParseTreeNode(parameter, ts.isParameter); + ts.Debug.assert(parameter !== undefined, "Cannot get symbols of a synthetic parameter that cannot be resolved to a parse-tree node."); + return getSymbolsOfParameterPropertyDeclaration(parameter, parameterName); + }, getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, getPropertiesOfType: getPropertiesOfType, getPropertyOfType: getPropertyOfType, + getIndexInfoOfType: getIndexInfoOfType, getSignaturesOfType: getSignaturesOfType, getIndexTypeOfType: getIndexTypeOfType, getBaseTypes: getBaseTypes, + getBaseTypeOfLiteralType: getBaseTypeOfLiteralType, + getWidenedType: getWidenedType, + getTypeFromTypeNode: function (node) { + node = ts.getParseTreeNode(node, ts.isTypeNode); + return node ? getTypeFromTypeNode(node) : unknownType; + }, + getParameterType: getTypeAtPosition, getReturnTypeOfSignature: getReturnTypeOfSignature, getNonNullableType: getNonNullableType, - getSymbolsInScope: getSymbolsInScope, - getSymbolAtLocation: getSymbolAtLocation, - getShorthandAssignmentValueSymbol: getShorthandAssignmentValueSymbol, - getExportSpecifierLocalTargetSymbol: getExportSpecifierLocalTargetSymbol, - getTypeAtLocation: getTypeOfNode, - getPropertySymbolOfDestructuringAssignment: getPropertySymbolOfDestructuringAssignment, - typeToString: typeToString, + typeToTypeNode: nodeBuilder.typeToTypeNode, + indexInfoToIndexSignatureDeclaration: nodeBuilder.indexInfoToIndexSignatureDeclaration, + signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration, + getSymbolsInScope: function (location, meaning) { + location = ts.getParseTreeNode(location); + return location ? getSymbolsInScope(location, meaning) : []; + }, + getSymbolAtLocation: function (node) { + node = ts.getParseTreeNode(node); + return node ? getSymbolAtLocation(node) : undefined; + }, + getShorthandAssignmentValueSymbol: function (node) { + node = ts.getParseTreeNode(node); + return node ? getShorthandAssignmentValueSymbol(node) : undefined; + }, + getExportSpecifierLocalTargetSymbol: function (node) { + node = ts.getParseTreeNode(node, ts.isExportSpecifier); + return node ? getExportSpecifierLocalTargetSymbol(node) : undefined; + }, + getTypeAtLocation: function (node) { + node = ts.getParseTreeNode(node); + return node ? getTypeOfNode(node) : unknownType; + }, + getPropertySymbolOfDestructuringAssignment: function (location) { + location = ts.getParseTreeNode(location, ts.isIdentifier); + return location ? getPropertySymbolOfDestructuringAssignment(location) : undefined; + }, + signatureToString: function (signature, enclosingDeclaration, flags, kind) { + return signatureToString(signature, ts.getParseTreeNode(enclosingDeclaration), flags, kind); + }, + typeToString: function (type, enclosingDeclaration, flags) { + return typeToString(type, ts.getParseTreeNode(enclosingDeclaration), flags); + }, getSymbolDisplayBuilder: getSymbolDisplayBuilder, - symbolToString: symbolToString, + symbolToString: function (symbol, enclosingDeclaration, meaning) { + return symbolToString(symbol, ts.getParseTreeNode(enclosingDeclaration), meaning); + }, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, - getContextualType: getContextualType, + getContextualType: function (node) { + node = ts.getParseTreeNode(node, ts.isExpression); + return node ? getContextualType(node) : undefined; + }, getFullyQualifiedName: getFullyQualifiedName, - getResolvedSignature: getResolvedSignature, - getConstantValue: getConstantValue, - isValidPropertyAccess: isValidPropertyAccess, - getSignatureFromDeclaration: getSignatureFromDeclaration, - isImplementationOfOverload: isImplementationOfOverload, + getResolvedSignature: function (node, candidatesOutArray) { + node = ts.getParseTreeNode(node, ts.isCallLikeExpression); + return node ? getResolvedSignature(node, candidatesOutArray) : undefined; + }, + getConstantValue: function (node) { + node = ts.getParseTreeNode(node, canHaveConstantValue); + return node ? getConstantValue(node) : undefined; + }, + isValidPropertyAccess: function (node, propertyName) { + node = ts.getParseTreeNode(node, ts.isPropertyAccessOrQualifiedName); + return node ? isValidPropertyAccess(node, propertyName) : false; + }, + getSignatureFromDeclaration: function (declaration) { + declaration = ts.getParseTreeNode(declaration, ts.isFunctionLike); + return declaration ? getSignatureFromDeclaration(declaration) : undefined; + }, + isImplementationOfOverload: function (node) { + node = ts.getParseTreeNode(node, ts.isFunctionLike); + return node ? isImplementationOfOverload(node) : undefined; + }, + getImmediateAliasedSymbol: function (symbol) { + ts.Debug.assert((symbol.flags & 8388608) !== 0, "Should only get Alias here."); + var links = getSymbolLinks(symbol); + if (!links.immediateTarget) { + var node = getDeclarationOfAliasSymbol(symbol); + ts.Debug.assert(!!node); + links.immediateTarget = getTargetOfAliasDeclaration(node, true); + } + return links.immediateTarget; + }, getAliasedSymbol: resolveAlias, getEmitResolver: getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, + getExportsAndPropertiesOfModule: getExportsAndPropertiesOfModule, getAmbientModules: getAmbientModules, - getJsxElementAttributesType: getJsxElementAttributesType, + getAllAttributesTypeFromJsxOpeningLikeElement: function (node) { + node = ts.getParseTreeNode(node, ts.isJsxOpeningLikeElement); + return node ? getAllAttributesTypeFromJsxOpeningLikeElement(node) : undefined; + }, getJsxIntrinsicTagNames: getJsxIntrinsicTagNames, - isOptionalParameter: isOptionalParameter, + isOptionalParameter: function (node) { + node = ts.getParseTreeNode(node, ts.isParameter); + return node ? isOptionalParameter(node) : false; + }, tryGetMemberInModuleExports: tryGetMemberInModuleExports, tryFindAmbientModuleWithoutAugmentations: function (moduleName) { return tryFindAmbientModule(moduleName, false); - } + }, + getApparentType: getApparentType }; var tupleTypes = []; var unionTypes = ts.createMap(); @@ -19609,8 +20860,8 @@ var ts; var numericLiteralTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); var evolvingArrayTypes = []; - var unknownSymbol = createSymbol(4 | 67108864, "unknown"); - var resolvingSymbol = createSymbol(67108864, "__resolving__"); + var unknownSymbol = createSymbol(4, "unknown"); + var resolvingSymbol = createSymbol(0, "__resolving__"); var anyType = createIntrinsicType(1, "any"); var autoType = createIntrinsicType(1, "any"); var unknownType = createIntrinsicType(1, "unknown"); @@ -19627,8 +20878,9 @@ var ts; var voidType = createIntrinsicType(1024, "void"); var neverType = createIntrinsicType(8192, "never"); var silentNeverType = createIntrinsicType(8192, "never"); + var nonPrimitiveType = createIntrinsicType(16777216, "object"); var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); - var emptyTypeLiteralSymbol = createSymbol(2048 | 67108864, "__type"); + var emptyTypeLiteralSymbol = createSymbol(2048, "__type"); emptyTypeLiteralSymbol.members = ts.createMap(); var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, undefined, undefined); var emptyGenericType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); @@ -19636,16 +20888,15 @@ var ts; var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); anyFunctionType.flags |= 8388608; var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var circularConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anySignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, undefined, 0, false, false); var unknownSignature = createSignature(undefined, undefined, undefined, emptyArray, unknownType, undefined, 0, false, false); var resolvingSignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, undefined, 0, false, false); var silentNeverSignature = createSignature(undefined, undefined, undefined, emptyArray, silentNeverType, undefined, 0, false, false); var enumNumberIndexInfo = createIndexInfo(stringType, true); + var jsObjectLiteralIndexInfo = createIndexInfo(anyType, false); var globals = ts.createMap(); var patternAmbientModules; - var getGlobalESSymbolConstructorSymbol; - var getGlobalPromiseConstructorSymbol; - var tryGetGlobalPromiseConstructorSymbol; var globalObjectType; var globalFunctionType; var globalArrayType; @@ -19654,26 +20905,26 @@ var ts; var globalNumberType; var globalBooleanType; var globalRegExpType; + var globalThisType; var anyArrayType; var autoArrayType; var anyReadonlyArrayType; - var getGlobalTemplateStringsArrayType; - var getGlobalESSymbolType; - var getGlobalIterableType; - var getGlobalIteratorType; - var getGlobalIterableIteratorType; - var getGlobalClassDecoratorType; - var getGlobalParameterDecoratorType; - var getGlobalPropertyDecoratorType; - var getGlobalMethodDecoratorType; - var getGlobalTypedPropertyDescriptorType; - var getGlobalPromiseType; - var tryGetGlobalPromiseType; - var getGlobalPromiseLikeType; - var getInstantiatedGlobalPromiseLikeType; - var getGlobalPromiseConstructorLikeType; - var getGlobalThenableType; - var jsxElementClassType; + var deferredGlobalESSymbolConstructorSymbol; + var deferredGlobalESSymbolType; + var deferredGlobalTypedPropertyDescriptorType; + var deferredGlobalPromiseType; + var deferredGlobalPromiseConstructorSymbol; + var deferredGlobalPromiseConstructorLikeType; + var deferredGlobalIterableType; + var deferredGlobalIteratorType; + var deferredGlobalIterableIteratorType; + var deferredGlobalAsyncIterableType; + var deferredGlobalAsyncIteratorType; + var deferredGlobalAsyncIterableIteratorType; + var deferredGlobalTemplateStringsArrayType; + var deferredJsxElementClassType; + var deferredJsxElementType; + var deferredJsxStatelessElementType; var deferredNodes; var deferredUnusedIdentifierNodes; var flowLoopStart = 0; @@ -19694,9 +20945,10 @@ var ts; var visitedFlowNodes = []; var visitedFlowTypes = []; var potentialThisCollisions = []; + var potentialNewTargetCollisions = []; var awaitedTypeStack = []; var diagnostics = ts.createDiagnosticCollection(); - var typeofEQFacts = ts.createMap({ + var typeofEQFacts = ts.createMapFromTemplate({ "string": 1, "number": 2, "boolean": 4, @@ -19705,7 +20957,7 @@ var ts; "object": 16, "function": 32 }); - var typeofNEFacts = ts.createMap({ + var typeofNEFacts = ts.createMapFromTemplate({ "string": 128, "number": 256, "boolean": 512, @@ -19714,14 +20966,14 @@ var ts; "object": 2048, "function": 4096 }); - var typeofTypesByName = ts.createMap({ + var typeofTypesByName = ts.createMapFromTemplate({ "string": stringType, "number": numberType, "boolean": booleanType, "symbol": esSymbolType, "undefined": undefinedType }); - var jsxElementType; + var typeofType = createTypeofType(); var _jsxNamespace; var _jsxFactoryEntity; var jsxTypes = ts.createMap(); @@ -19741,7 +20993,7 @@ var ts; var enumRelation = ts.createMap(); var _displayBuilder; var builtinGlobals = ts.createMap(); - builtinGlobals[undefinedSymbol.name] = undefinedSymbol; + builtinGlobals.set(undefinedSymbol.name, undefinedSymbol); initializeTypeChecker(); return checker; function getJsxNamespace() { @@ -19771,7 +21023,12 @@ var ts; } function createSymbol(flags, name) { symbolCount++; - return new Symbol(flags, name); + var symbol = (new Symbol(flags | 134217728, name)); + symbol.checkFlags = 0; + return symbol; + } + function isTransientSymbol(symbol) { + return (symbol.flags & 134217728) !== 0; } function getExcludedSymbolFlags(flags) { var result = 0; @@ -19817,7 +21074,7 @@ var ts; mergedSymbols[source.mergeId] = target; } function cloneSymbol(symbol) { - var result = createSymbol(symbol.flags | 33554432, symbol.name); + var result = createSymbol(symbol.flags, symbol.name); result.declarations = symbol.declarations.slice(0); result.parent = symbol.parent; if (symbol.valueDeclaration) @@ -19839,12 +21096,10 @@ var ts; target.flags |= source.flags; if (source.valueDeclaration && (!target.valueDeclaration || - (target.valueDeclaration.kind === 230 && source.valueDeclaration.kind !== 230))) { + (target.valueDeclaration.kind === 232 && source.valueDeclaration.kind !== 232))) { target.valueDeclaration = source.valueDeclaration; } - ts.forEach(source.declarations, function (node) { - target.declarations.push(node); - }); + ts.addRange(target.declarations, source.declarations); if (source.members) { if (!target.members) target.members = ts.createMap(); @@ -19857,6 +21112,9 @@ var ts; } recordMergedSymbol(target, source); } + else if (target.flags & 1024) { + error(source.valueDeclaration.name, ts.Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target)); + } else { var message_2 = target.flags & 2 || source.flags & 2 ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; @@ -19869,18 +21127,19 @@ var ts; } } function mergeSymbolTable(target, source) { - for (var id in source) { - var targetSymbol = target[id]; + source.forEach(function (sourceSymbol, id) { + var targetSymbol = target.get(id); if (!targetSymbol) { - target[id] = source[id]; + target.set(id, sourceSymbol); } else { - if (!(targetSymbol.flags & 33554432)) { - target[id] = targetSymbol = cloneSymbol(targetSymbol); + if (!(targetSymbol.flags & 134217728)) { + targetSymbol = cloneSymbol(targetSymbol); + target.set(id, targetSymbol); } - mergeSymbol(targetSymbol, source[id]); + mergeSymbol(targetSymbol, sourceSymbol); } - } + }); } function mergeModuleAugmentation(moduleName) { var moduleAugmentation = moduleName.parent; @@ -19901,7 +21160,7 @@ var ts; } mainModule = resolveExternalModuleSymbol(mainModule); if (mainModule.flags & 1920) { - mainModule = mainModule.flags & 33554432 ? mainModule : cloneSymbol(mainModule); + mainModule = mainModule.flags & 134217728 ? mainModule : cloneSymbol(mainModule); mergeSymbol(mainModule, moduleAugmentation.symbol); } else { @@ -19910,20 +21169,21 @@ var ts; } } function addToSymbolTable(target, source, message) { - for (var id in source) { - if (target[id]) { - ts.forEach(target[id].declarations, addDeclarationDiagnostic(id, message)); + source.forEach(function (sourceSymbol, id) { + var targetSymbol = target.get(id); + if (targetSymbol) { + ts.forEach(targetSymbol.declarations, addDeclarationDiagnostic(id, message)); } else { - target[id] = source[id]; + target.set(id, sourceSymbol); } - } + }); function addDeclarationDiagnostic(id, message) { return function (declaration) { return diagnostics.add(ts.createDiagnosticForNode(declaration, message, id)); }; } } function getSymbolLinks(symbol) { - if (symbol.flags & 67108864) + if (symbol.flags & 134217728) return symbol; var id = getSymbolId(symbol); return symbolLinks[id] || (symbolLinks[id] = {}); @@ -19935,14 +21195,17 @@ var ts; function getObjectFlags(type) { return type.flags & 32768 ? type.objectFlags : 0; } + function getCheckFlags(symbol) { + return symbol.flags & 134217728 ? symbol.checkFlags : 0; + } function isGlobalSourceFile(node) { - return node.kind === 261 && !ts.isExternalOrCommonJsModule(node); + return node.kind === 264 && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { - var symbol = symbols[name]; + var symbol = symbols.get(name); if (symbol) { - ts.Debug.assert((symbol.flags & 16777216) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((getCheckFlags(symbol) & 1) === 0, "Should never get an instantiated symbol here."); if (symbol.flags & meaning) { return symbol; } @@ -19973,57 +21236,76 @@ var ts; (!compilerOptions.outFile && !compilerOptions.out)) { return true; } - if (isUsedInFunctionOrNonStaticProperty(usage)) { + if (isUsedInFunctionOrInstanceProperty(usage, declaration)) { return true; } var sourceFiles = host.getSourceFiles(); return ts.indexOf(sourceFiles, declarationFile) <= ts.indexOf(sourceFiles, useFile); } if (declaration.pos <= usage.pos) { - return declaration.kind !== 223 || - !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); + if (declaration.kind === 175) { + var errorBindingElement = ts.getAncestor(usage, 175); + if (errorBindingElement) { + return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || + declaration.pos < errorBindingElement.pos; + } + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 225), usage); + } + else if (declaration.kind === 225) { + return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); + } + return true; + } + if (usage.parent.kind === 245) { + return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); - return isUsedInFunctionOrNonStaticProperty(usage, container); + return isInTypeQuery(usage) || isUsedInFunctionOrInstanceProperty(usage, declaration, container); function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 205: - case 211: + case 207: case 213: + case 215: if (isSameScopeDescendentOf(usage, declaration, container)) { return true; } break; } switch (declaration.parent.parent.kind) { - case 212: - case 213: + case 214: + case 215: if (isSameScopeDescendentOf(usage, declaration.parent.parent.expression, container)) { return true; } } return false; } - function isUsedInFunctionOrNonStaticProperty(usage, container) { - var current = usage; - while (current) { + function isUsedInFunctionOrInstanceProperty(usage, declaration, container) { + return !!ts.findAncestor(usage, function (current) { if (current === container) { - return false; + return "quit"; } if (ts.isFunctionLike(current)) { return true; } - var initializerOfNonStaticProperty = current.parent && - current.parent.kind === 147 && - (ts.getModifierFlags(current.parent) & 32) === 0 && + var initializerOfProperty = current.parent && + current.parent.kind === 148 && current.parent.initializer === current; - if (initializerOfNonStaticProperty) { - return true; + if (initializerOfProperty) { + if (ts.getModifierFlags(current.parent) & 32) { + if (declaration.kind === 150) { + return true; + } + } + else { + var isDeclarationInstanceProperty = declaration.kind === 148 && !(ts.getModifierFlags(declaration) & 32); + if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { + return true; + } + } } - current = current.parent; - } - return false; + }); } } function resolveName(location, name, meaning, nameNotFoundMessage, nameArg) { @@ -20038,18 +21320,18 @@ var ts; if (result = getSymbol(location.locals, name, meaning)) { var useResult = true; if (ts.isFunctionLike(location) && lastLocation && lastLocation !== location.body) { - if (meaning & result.flags & 793064 && lastLocation.kind !== 278) { + if (meaning & result.flags & 793064 && lastLocation.kind !== 282) { useResult = result.flags & 262144 ? lastLocation === location.type || - lastLocation.kind === 144 || - lastLocation.kind === 143 + lastLocation.kind === 145 || + lastLocation.kind === 144 : false; } if (meaning & 107455 && result.flags & 1) { useResult = - lastLocation.kind === 144 || + lastLocation.kind === 145 || (lastLocation === location.type && - result.valueDeclaration.kind === 144); + result.valueDeclaration.kind === 145); } } if (useResult) { @@ -20061,23 +21343,24 @@ var ts; } } switch (location.kind) { - case 261: + case 264: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; - case 230: + case 232: var moduleExports = getSymbolOfNode(location).exports; - if (location.kind === 261 || ts.isAmbientModule(location)) { - if (result = moduleExports["default"]) { + if (location.kind === 264 || ts.isAmbientModule(location)) { + if (result = moduleExports.get("default")) { var localSymbol = ts.getLocalSymbolForExportDefault(result); if (localSymbol && (result.flags & meaning) && localSymbol.name === name) { break loop; } result = undefined; } - if (moduleExports[name] && - moduleExports[name].flags === 8388608 && - ts.getDeclarationOfKind(moduleExports[name], 243)) { + var moduleExport = moduleExports.get(name); + if (moduleExport && + moduleExport.flags === 8388608 && + ts.getDeclarationOfKind(moduleExport, 245)) { break; } } @@ -20085,13 +21368,13 @@ var ts; break loop; } break; - case 229: + case 231: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8)) { break loop; } break; + case 148: case 147: - case 146: if (ts.isClassLike(location.parent) && !(ts.getModifierFlags(location) & 32)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { @@ -20101,17 +21384,21 @@ var ts; } } break; - case 226: - case 197: - case 227: + case 228: + case 198: + case 229: if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793064)) { + if (!isTypeParameterSymbolDeclaredInContainer(result, location)) { + result = undefined; + break; + } if (lastLocation && ts.getModifierFlags(lastLocation) & 32) { error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); return undefined; } break loop; } - if (location.kind === 197 && meaning & 32) { + if (location.kind === 198 && meaning & 32) { var className = location.name; if (className && name === className.text) { result = location.symbol; @@ -20119,28 +21406,28 @@ var ts; } } break; - case 142: + case 143: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 227) { + if (ts.isClassLike(grandparent) || grandparent.kind === 229) { if (result = getSymbol(getSymbolOfNode(grandparent).members, name, meaning & 793064)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); return undefined; } } break; - case 149: - case 148: case 150: + case 149: case 151: case 152: - case 225: - case 185: + case 153: + case 227: + case 186: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 184: + case 185: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; @@ -20153,8 +21440,8 @@ var ts; } } break; - case 145: - if (location.parent && location.parent.kind === 144) { + case 146: + if (location.parent && location.parent.kind === 145) { location = location.parent; } if (location.parent && ts.isClassElement(location.parent)) { @@ -20177,7 +21464,8 @@ var ts; !checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && !checkAndReportErrorForExtendingInterface(errorLocation) && !checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) && - !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning)) { + !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) && + !checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning)) { error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); } } @@ -20189,21 +21477,31 @@ var ts; error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.declarationNameToString(propertyName), typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); return undefined; } - if (meaning & 2) { + if (meaning & 2 || + ((meaning & 32 || meaning & 384) && (meaning & 107455) === 107455)) { var exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result); - if (exportOrLocalSymbol.flags & 2) { + if (exportOrLocalSymbol.flags & 2 || exportOrLocalSymbol.flags & 32 || exportOrLocalSymbol.flags & 384) { checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation); } } if (result && isInExternalModule && (meaning & 107455) === 107455) { var decls = result.declarations; - if (decls && decls.length === 1 && decls[0].kind === 233) { + if (decls && decls.length === 1 && decls[0].kind === 235) { error(errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, name); } } } return result; } + function isTypeParameterSymbolDeclaredInContainer(symbol, container) { + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + if (decl.kind === 144 && decl.parent === container) { + return true; + } + } + return false; + } function checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) { if ((errorLocation.kind === 70 && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) { return false; @@ -20244,9 +21542,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 70: - case 177: + case 178: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 199: + case 200: ts.Debug.assert(ts.isEntityNameExpression(node.expression)); return node.expression; default: @@ -20273,65 +21571,84 @@ var ts; } return false; } - function checkResolvedBlockScopedVariable(result, errorLocation) { - ts.Debug.assert((result.flags & 2) !== 0); - var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; }); - ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); - if (!ts.isInAmbientContext(declaration) && !isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 223), errorLocation)) { - error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + function checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) { + if (meaning & (107455 & ~1024 & ~793064)) { + var symbol = resolveSymbol(resolveName(errorLocation, name, 1024 & ~107455, undefined, undefined)); + if (symbol) { + error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_value, name); + return true; + } } - } - function isSameScopeDescendentOf(initial, parent, stopAt) { - if (!parent) { - return false; - } - for (var current = initial; current && current !== stopAt && !ts.isFunctionLike(current); current = current.parent) { - if (current === parent) { + else if (meaning & (793064 & ~1024 & ~107455)) { + var symbol = resolveSymbol(resolveName(errorLocation, name, 1024 & ~793064, undefined, undefined)); + if (symbol) { + error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_type, name); return true; } } return false; } + function checkResolvedBlockScopedVariable(result, errorLocation) { + ts.Debug.assert(!!(result.flags & 2 || result.flags & 32 || result.flags & 384)); + var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 231) ? d : undefined; }); + ts.Debug.assert(declaration !== undefined, "Declaration to checkResolvedBlockScopedVariable is undefined"); + if (!ts.isInAmbientContext(declaration) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { + if (result.flags & 2) { + error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + } + else if (result.flags & 32) { + error(errorLocation, ts.Diagnostics.Class_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + } + else if (result.flags & 384) { + error(errorLocation, ts.Diagnostics.Enum_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + } + } + } + function isSameScopeDescendentOf(initial, parent, stopAt) { + return parent && !!ts.findAncestor(initial, function (n) { return n === stopAt || ts.isFunctionLike(n) ? "quit" : n === parent; }); + } function getAnyImportSyntax(node) { if (ts.isAliasSymbolDeclaration(node)) { - if (node.kind === 234) { + if (node.kind === 236) { return node; } - while (node && node.kind !== 235) { - node = node.parent; - } - return node; + return ts.findAncestor(node, function (n) { return n.kind === 237; }); } } function getDeclarationOfAliasSymbol(symbol) { - return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); + return ts.find(symbol.declarations, ts.isAliasSymbolDeclaration); } - function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 245) { + function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { + if (node.moduleReference.kind === 247) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } - return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference); + return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias); } - function getTargetOfImportClause(node) { + function getTargetOfImportClause(node, dontResolveAlias) { var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { - var exportDefaultSymbol = ts.isShorthandAmbientModuleSymbol(moduleSymbol) ? - moduleSymbol : - moduleSymbol.exports["export="] ? - getPropertyOfType(getTypeOfSymbol(moduleSymbol.exports["export="]), "default") : - resolveSymbol(moduleSymbol.exports["default"]); + var exportDefaultSymbol = void 0; + if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { + exportDefaultSymbol = moduleSymbol; + } + else { + var exportValue = moduleSymbol.exports.get("export="); + exportDefaultSymbol = exportValue + ? getPropertyOfType(getTypeOfSymbol(exportValue), "default") + : resolveSymbol(moduleSymbol.exports.get("default"), dontResolveAlias); + } if (!exportDefaultSymbol && !allowSyntheticDefaultImports) { error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); } else if (!exportDefaultSymbol && allowSyntheticDefaultImports) { - return resolveExternalModuleSymbol(moduleSymbol) || resolveSymbol(moduleSymbol); + return resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); } return exportDefaultSymbol; } } - function getTargetOfNamespaceImport(node) { + function getTargetOfNamespaceImport(node, dontResolveAlias) { var moduleSpecifier = node.parent.parent.moduleSpecifier; - return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier); + return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier, dontResolveAlias); } function combineValueAndTypeSymbols(valueSymbol, typeSymbol) { if (valueSymbol.flags & (793064 | 1920)) { @@ -20348,12 +21665,9 @@ var ts; result.exports = valueSymbol.exports; return result; } - function getExportOfModule(symbol, name) { + function getExportOfModule(symbol, name, dontResolveAlias) { if (symbol.flags & 1536) { - var exportedSymbol = getExportsOfSymbol(symbol)[name]; - if (exportedSymbol) { - return resolveSymbol(exportedSymbol); - } + return resolveSymbol(getExportsOfSymbol(symbol).get(name), dontResolveAlias); } } function getPropertyOfVariable(symbol, name) { @@ -20364,71 +21678,72 @@ var ts; } } } - function getExternalModuleMember(node, specifier) { + function getExternalModuleMember(node, specifier, dontResolveAlias) { var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); - var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier); + var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier, dontResolveAlias); if (targetSymbol) { - var name_16 = specifier.propertyName || specifier.name; - if (name_16.text) { + var name = specifier.propertyName || specifier.name; + if (name.text) { if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { return moduleSymbol; } var symbolFromVariable = void 0; - if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports["export="]) { - symbolFromVariable = getPropertyOfType(getTypeOfSymbol(targetSymbol), name_16.text); + if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports.get("export=")) { + symbolFromVariable = getPropertyOfType(getTypeOfSymbol(targetSymbol), name.text); } else { - symbolFromVariable = getPropertyOfVariable(targetSymbol, name_16.text); + symbolFromVariable = getPropertyOfVariable(targetSymbol, name.text); } - symbolFromVariable = resolveSymbol(symbolFromVariable); - var symbolFromModule = getExportOfModule(targetSymbol, name_16.text); - if (!symbolFromModule && allowSyntheticDefaultImports && name_16.text === "default") { - symbolFromModule = resolveExternalModuleSymbol(moduleSymbol) || resolveSymbol(moduleSymbol); + symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias); + var symbolFromModule = getExportOfModule(targetSymbol, name.text, dontResolveAlias); + if (!symbolFromModule && allowSyntheticDefaultImports && name.text === "default") { + symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); } var symbol = symbolFromModule && symbolFromVariable ? combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) : symbolFromModule || symbolFromVariable; if (!symbol) { - error(name_16, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name_16)); + error(name, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name)); } return symbol; } } } - function getTargetOfImportSpecifier(node) { - return getExternalModuleMember(node.parent.parent.parent, node); + function getTargetOfImportSpecifier(node, dontResolveAlias) { + return getExternalModuleMember(node.parent.parent.parent, node, dontResolveAlias); } - function getTargetOfNamespaceExportDeclaration(node) { - return resolveExternalModuleSymbol(node.parent.symbol); + function getTargetOfNamespaceExportDeclaration(node, dontResolveAlias) { + return resolveExternalModuleSymbol(node.parent.symbol, dontResolveAlias); } - function getTargetOfExportSpecifier(node) { + function getTargetOfExportSpecifier(node, dontResolveAlias) { return node.parent.parent.moduleSpecifier ? - getExternalModuleMember(node.parent.parent, node) : - resolveEntityName(node.propertyName || node.name, 107455 | 793064 | 1920); + getExternalModuleMember(node.parent.parent, node, dontResolveAlias) : + resolveEntityName(node.propertyName || node.name, 107455 | 793064 | 1920, false, dontResolveAlias); } - function getTargetOfExportAssignment(node) { - return resolveEntityName(node.expression, 107455 | 793064 | 1920); + function getTargetOfExportAssignment(node, dontResolveAlias) { + return resolveEntityName(node.expression, 107455 | 793064 | 1920, false, dontResolveAlias); } - function getTargetOfAliasDeclaration(node) { + function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { switch (node.kind) { - case 234: - return getTargetOfImportEqualsDeclaration(node); case 236: - return getTargetOfImportClause(node); - case 237: - return getTargetOfNamespaceImport(node); + return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); + case 238: + return getTargetOfImportClause(node, dontRecursivelyResolve); case 239: - return getTargetOfImportSpecifier(node); - case 243: - return getTargetOfExportSpecifier(node); - case 240: - return getTargetOfExportAssignment(node); - case 233: - return getTargetOfNamespaceExportDeclaration(node); + return getTargetOfNamespaceImport(node, dontRecursivelyResolve); + case 241: + return getTargetOfImportSpecifier(node, dontRecursivelyResolve); + case 245: + return getTargetOfExportSpecifier(node, dontRecursivelyResolve); + case 242: + return getTargetOfExportAssignment(node, dontRecursivelyResolve); + case 235: + return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); } } - function resolveSymbol(symbol) { - return symbol && symbol.flags & 8388608 && !(symbol.flags & (107455 | 793064 | 1920)) ? resolveAlias(symbol) : symbol; + function resolveSymbol(symbol, dontResolveAlias) { + var shouldResolve = !dontResolveAlias && symbol && symbol.flags & 8388608 && !(symbol.flags & (107455 | 793064 | 1920)); + return shouldResolve ? resolveAlias(symbol) : symbol; } function resolveAlias(symbol) { ts.Debug.assert((symbol.flags & 8388608) !== 0, "Should only get Alias here."); @@ -20467,10 +21782,10 @@ var ts; links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); ts.Debug.assert(!!node); - if (node.kind === 240) { + if (node.kind === 242) { checkExpressionCached(node.expression); } - else if (node.kind === 243) { + else if (node.kind === 245) { checkExpressionCached(node.propertyName || node.name); } else if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -20482,11 +21797,11 @@ var ts; if (entityName.kind === 70 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 70 || entityName.parent.kind === 141) { + if (entityName.kind === 70 || entityName.parent.kind === 142) { return resolveEntityName(entityName, 1920, false, dontResolveAlias); } else { - ts.Debug.assert(entityName.parent.kind === 234); + ts.Debug.assert(entityName.parent.kind === 236); return resolveEntityName(entityName, 107455 | 793064 | 1920, false, dontResolveAlias); } } @@ -20505,9 +21820,19 @@ var ts; return undefined; } } - else if (name.kind === 141 || name.kind === 177) { - var left = name.kind === 141 ? name.left : name.expression; - var right = name.kind === 141 ? name.right : name.name; + else if (name.kind === 142 || name.kind === 178) { + var left = void 0; + if (name.kind === 142) { + left = name.left; + } + else if (name.kind === 178 && + (name.expression.kind === 184 || ts.isEntityNameExpression(name.expression))) { + left = name.expression; + } + else { + return undefined; + } + var right = name.kind === 142 ? name.right : name.name; var namespace = resolveEntityName(left, 1920, ignoreErrors, false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -20523,10 +21848,15 @@ var ts; return undefined; } } + else if (name.kind === 184) { + return ts.isEntityNameExpression(name.expression) ? + resolveEntityName(name.expression, meaning, ignoreErrors, dontResolveAlias, location) : + undefined; + } else { ts.Debug.fail("Unknown entity name kind."); } - ts.Debug.assert((symbol.flags & 16777216) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((getCheckFlags(symbol) & 1) === 0, "Should never get an instantiated symbol here."); return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); } function resolveExternalModuleName(location, moduleReferenceExpression) { @@ -20534,7 +21864,7 @@ var ts; } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } - if (moduleReferenceExpression.kind !== 9) { + if (moduleReferenceExpression.kind !== 9 && moduleReferenceExpression.kind !== 12) { return; } var moduleReferenceLiteral = moduleReferenceExpression; @@ -20571,11 +21901,10 @@ var ts; } if (!isRelative && resolvedModule && !ts.extensionIsTypeScript(resolvedModule.extension)) { if (isForAugmentation) { - ts.Debug.assert(!!moduleNotFoundError); var diag = ts.Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented; - error(errorNode, diag, moduleName, resolvedModule.resolvedFileName); + error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName); } - else if (compilerOptions.noImplicitAny && moduleNotFoundError) { + else if (noImplicitAny && moduleNotFoundError) { error(errorNode, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedModule.resolvedFileName); } return undefined; @@ -20597,27 +21926,35 @@ var ts; } return undefined; } - function resolveExternalModuleSymbol(moduleSymbol) { - return moduleSymbol && getMergedSymbol(resolveSymbol(moduleSymbol.exports["export="])) || moduleSymbol; + function resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) { + return moduleSymbol && getMergedSymbol(resolveSymbol(moduleSymbol.exports.get("export="), dontResolveAlias)) || moduleSymbol; } - function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression) { - var symbol = resolveExternalModuleSymbol(moduleSymbol); - if (symbol && !(symbol.flags & (1536 | 3))) { + function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression, dontResolveAlias) { + var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); + if (!dontResolveAlias && symbol && !(symbol.flags & (1536 | 3))) { error(moduleReferenceExpression, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); symbol = undefined; } return symbol; } function hasExportAssignmentSymbol(moduleSymbol) { - return moduleSymbol.exports["export="] !== undefined; + return moduleSymbol.exports.get("export=") !== undefined; } function getExportsOfModuleAsArray(moduleSymbol) { return symbolsToArray(getExportsOfModule(moduleSymbol)); } + function getExportsAndPropertiesOfModule(moduleSymbol) { + var exports = getExportsOfModuleAsArray(moduleSymbol); + var exportEquals = resolveExternalModuleSymbol(moduleSymbol); + if (exportEquals !== moduleSymbol) { + ts.addRange(exports, getPropertiesOfType(getTypeOfSymbol(exportEquals))); + } + return exports; + } function tryGetMemberInModuleExports(memberName, moduleSymbol) { var symbolTable = getExportsOfModule(moduleSymbol); if (symbolTable) { - return symbolTable[memberName]; + return symbolTable.get(memberName); } } function getExportsOfSymbol(symbol) { @@ -20628,24 +21965,28 @@ var ts; return links.resolvedExports || (links.resolvedExports = getExportsForModule(moduleSymbol)); } function extendExportSymbols(target, source, lookupTable, exportNode) { - for (var id in source) { - if (id !== "default" && !target[id]) { - target[id] = source[id]; + source && source.forEach(function (sourceSymbol, id) { + if (id === "default") + return; + var targetSymbol = target.get(id); + if (!targetSymbol) { + target.set(id, sourceSymbol); if (lookupTable && exportNode) { - lookupTable[id] = { + lookupTable.set(id, { specifierText: ts.getTextOfNode(exportNode.moduleSpecifier) - }; + }); } } - else if (lookupTable && exportNode && id !== "default" && target[id] && resolveSymbol(target[id]) !== resolveSymbol(source[id])) { - if (!lookupTable[id].exportsWithDuplicate) { - lookupTable[id].exportsWithDuplicate = [exportNode]; + else if (lookupTable && exportNode && targetSymbol && resolveSymbol(targetSymbol) !== resolveSymbol(sourceSymbol)) { + var collisionTracker = lookupTable.get(id); + if (!collisionTracker.exportsWithDuplicate) { + collisionTracker.exportsWithDuplicate = [exportNode]; } else { - lookupTable[id].exportsWithDuplicate.push(exportNode); + collisionTracker.exportsWithDuplicate.push(exportNode); } } - } + }); } function getExportsForModule(moduleSymbol) { var visitedSymbols = []; @@ -20657,26 +21998,26 @@ var ts; } visitedSymbols.push(symbol); var symbols = ts.cloneMap(symbol.exports); - var exportStars = symbol.exports["__export"]; + var exportStars = symbol.exports.get("__export"); if (exportStars) { var nestedSymbols = ts.createMap(); - var lookupTable = ts.createMap(); + var lookupTable_1 = ts.createMap(); for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) { var node = _a[_i]; var resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier); var exportedSymbols = visit(resolvedModule); - extendExportSymbols(nestedSymbols, exportedSymbols, lookupTable, node); + extendExportSymbols(nestedSymbols, exportedSymbols, lookupTable_1, node); } - for (var id in lookupTable) { - var exportsWithDuplicate = lookupTable[id].exportsWithDuplicate; - if (id === "export=" || !(exportsWithDuplicate && exportsWithDuplicate.length) || symbols[id]) { - continue; + lookupTable_1.forEach(function (_a, id) { + var exportsWithDuplicate = _a.exportsWithDuplicate; + if (id === "export=" || !(exportsWithDuplicate && exportsWithDuplicate.length) || symbols.has(id)) { + return; } - for (var _b = 0, exportsWithDuplicate_1 = exportsWithDuplicate; _b < exportsWithDuplicate_1.length; _b++) { - var node = exportsWithDuplicate_1[_b]; - diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity, lookupTable[id].specifierText, id)); + for (var _i = 0, exportsWithDuplicate_1 = exportsWithDuplicate; _i < exportsWithDuplicate_1.length; _i++) { + var node = exportsWithDuplicate_1[_i]; + diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity, lookupTable_1.get(id).specifierText, id)); } - } + }); extendExportSymbols(symbols, nestedSymbols); } return symbols; @@ -20698,22 +22039,13 @@ var ts; : symbol; } function symbolIsValue(symbol) { - if (symbol.flags & 16777216) { - return symbolIsValue(getSymbolLinks(symbol).target); - } - if (symbol.flags & 107455) { - return true; - } - if (symbol.flags & 8388608) { - return (resolveAlias(symbol).flags & 107455) !== 0; - } - return false; + return !!(symbol.flags & 107455 || symbol.flags & 8388608 && resolveAlias(symbol).flags & 107455); } function findConstructorDeclaration(node) { var members = node.members; for (var _i = 0, members_1 = members; _i < members_1.length; _i++) { var member = members_1[_i]; - if (member.kind === 150 && ts.nodeIsPresent(member.body)) { + if (member.kind === 151 && ts.nodeIsPresent(member.body)) { return member; } } @@ -20741,6 +22073,9 @@ var ts; type.symbol = symbol; return type; } + function createTypeofType() { + return getUnionType(ts.convertToArray(typeofEQFacts.keys(), function (s) { return getLiteralTypeForText(32, s); })); + } function isReservedMemberName(name) { return name.charCodeAt(0) === 95 && name.charCodeAt(1) === 95 && @@ -20749,16 +22084,15 @@ var ts; } function getNamedMembers(members) { var result; - for (var id in members) { + members.forEach(function (symbol, id) { if (!isReservedMemberName(id)) { if (!result) result = []; - var symbol = members[id]; if (symbolIsValue(symbol)) { result.push(symbol); } } - } + }); return result || emptyArray; } function setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) { @@ -20777,19 +22111,19 @@ var ts; } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; - for (var location_1 = enclosingDeclaration; location_1; location_1 = location_1.parent) { - if (location_1.locals && !isGlobalSourceFile(location_1)) { - if (result = callback(location_1.locals)) { + for (var location = enclosingDeclaration; location; location = location.parent) { + if (location.locals && !isGlobalSourceFile(location)) { + if (result = callback(location.locals)) { return result; } } - switch (location_1.kind) { - case 261: - if (!ts.isExternalOrCommonJsModule(location_1)) { + switch (location.kind) { + case 264: + if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 230: - if (result = callback(getSymbolOfNode(location_1).exports)) { + case 232: + if (result = callback(getSymbolOfNode(location).exports)) { return result; } break; @@ -20802,6 +22136,16 @@ var ts; } function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing) { function getAccessibleSymbolChainFromSymbolTable(symbols) { + return getAccessibleSymbolChainFromSymbolTableWorker(symbols, []); + } + function getAccessibleSymbolChainFromSymbolTableWorker(symbols, visitedSymbolTables) { + if (ts.contains(visitedSymbolTables, symbols)) { + return undefined; + } + visitedSymbolTables.push(symbols); + var result = trySymbolTable(symbols); + visitedSymbolTables.pop(); + return result; function canQualifySymbol(symbolFromSymbolTable, meaning) { if (!needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning)) { return true; @@ -20815,26 +22159,28 @@ var ts; canQualifySymbol(symbolFromSymbolTable, meaning); } } - if (isAccessible(symbols[symbol.name])) { - return [symbol]; - } - return ts.forEachProperty(symbols, function (symbolFromSymbolTable) { - if (symbolFromSymbolTable.flags & 8388608 - && symbolFromSymbolTable.name !== "export=" - && !ts.getDeclarationOfKind(symbolFromSymbolTable, 243)) { - if (!useOnlyExternalAliasing || - ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { - var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); - if (isAccessible(symbolFromSymbolTable, resolveAlias(symbolFromSymbolTable))) { - return [symbolFromSymbolTable]; - } - var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; - if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { - return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); + function trySymbolTable(symbols) { + if (isAccessible(symbols.get(symbol.name))) { + return [symbol]; + } + return ts.forEachEntry(symbols, function (symbolFromSymbolTable) { + if (symbolFromSymbolTable.flags & 8388608 + && symbolFromSymbolTable.name !== "export=" + && !ts.getDeclarationOfKind(symbolFromSymbolTable, 245)) { + if (!useOnlyExternalAliasing || + ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { + var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); + if (isAccessible(symbolFromSymbolTable, resolveAlias(symbolFromSymbolTable))) { + return [symbolFromSymbolTable]; + } + var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTableWorker(resolvedImportedSymbol.exports, visitedSymbolTables) : undefined; + if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { + return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); + } } } - } - }); + }); + } } if (symbol) { if (!(isPropertyOrMethodDeclarationSymbol(symbol))) { @@ -20845,14 +22191,14 @@ var ts; function needsQualification(symbol, enclosingDeclaration, meaning) { var qualify = false; forEachSymbolTableInScope(enclosingDeclaration, function (symbolTable) { - var symbolFromSymbolTable = symbolTable[symbol.name]; + var symbolFromSymbolTable = symbolTable.get(symbol.name); if (!symbolFromSymbolTable) { return false; } if (symbolFromSymbolTable === symbol) { return true; } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 243)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 245)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -20866,10 +22212,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 147: - case 149: - case 151: + case 148: + case 150: case 152: + case 153: continue; default: return false; @@ -20917,15 +22263,12 @@ var ts; } return { accessibility: 0 }; function getExternalModuleContainer(declaration) { - for (; declaration; declaration = declaration.parent) { - if (hasExternalModuleSymbol(declaration)) { - return getSymbolOfNode(declaration); - } - } + var node = ts.findAncestor(declaration, hasExternalModuleSymbol); + return node && getSymbolOfNode(node); } } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 261 && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 264 && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -20959,11 +22302,11 @@ var ts; } function isEntityNameVisible(entityName, enclosingDeclaration) { var meaning; - if (entityName.parent.kind === 160 || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { + if (entityName.parent.kind === 161 || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { meaning = 107455 | 1048576; } - else if (entityName.kind === 141 || entityName.kind === 177 || - entityName.parent.kind === 234) { + else if (entityName.kind === 142 || entityName.kind === 178 || + entityName.parent.kind === 236) { meaning = 1920; } else { @@ -21011,6 +22354,483 @@ var ts; } return result; } + function createNodeBuilder() { + var context; + return { + typeToTypeNode: function (type, enclosingDeclaration, flags) { + context = createNodeBuilderContext(enclosingDeclaration, flags); + var resultingNode = typeToTypeNodeHelper(type); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + indexInfoToIndexSignatureDeclaration: function (indexInfo, kind, enclosingDeclaration, flags) { + context = createNodeBuilderContext(enclosingDeclaration, flags); + var resultingNode = indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + signatureToSignatureDeclaration: function (signature, kind, enclosingDeclaration, flags) { + context = createNodeBuilderContext(enclosingDeclaration, flags); + var resultingNode = signatureToSignatureDeclarationHelper(signature, kind); + var result = context.encounteredError ? undefined : resultingNode; + return result; + } + }; + function createNodeBuilderContext(enclosingDeclaration, flags) { + return { + enclosingDeclaration: enclosingDeclaration, + flags: flags, + encounteredError: false, + inObjectTypeLiteral: false, + checkAlias: true, + symbolStack: undefined + }; + } + function typeToTypeNodeHelper(type) { + if (!type) { + context.encounteredError = true; + return undefined; + } + if (type.flags & 1) { + return ts.createKeywordTypeNode(118); + } + if (type.flags & 2) { + return ts.createKeywordTypeNode(135); + } + if (type.flags & 4) { + return ts.createKeywordTypeNode(132); + } + if (type.flags & 8) { + return ts.createKeywordTypeNode(121); + } + if (type.flags & 16) { + var name = symbolToName(type.symbol, false); + return ts.createTypeReferenceNode(name, undefined); + } + if (type.flags & (32)) { + return ts.createLiteralTypeNode((ts.createLiteral(type.text))); + } + if (type.flags & (64)) { + return ts.createLiteralTypeNode((ts.createNumericLiteral(type.text))); + } + if (type.flags & 128) { + return type.intrinsicName === "true" ? ts.createTrue() : ts.createFalse(); + } + if (type.flags & 256) { + var name = symbolToName(type.symbol, false); + return ts.createTypeReferenceNode(name, undefined); + } + if (type.flags & 1024) { + return ts.createKeywordTypeNode(104); + } + if (type.flags & 2048) { + return ts.createKeywordTypeNode(138); + } + if (type.flags & 4096) { + return ts.createKeywordTypeNode(94); + } + if (type.flags & 8192) { + return ts.createKeywordTypeNode(129); + } + if (type.flags & 512) { + return ts.createKeywordTypeNode(136); + } + if (type.flags & 16777216) { + return ts.createKeywordTypeNode(133); + } + if (type.flags & 16384 && type.isThisType) { + if (context.inObjectTypeLiteral) { + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowThisInObjectLiteral)) { + context.encounteredError = true; + } + } + return ts.createThis(); + } + var objectFlags = getObjectFlags(type); + if (objectFlags & 4) { + ts.Debug.assert(!!(type.flags & 32768)); + return typeReferenceToTypeNode(type); + } + if (objectFlags & 3) { + ts.Debug.assert(!!(type.flags & 32768)); + var name = symbolToName(type.symbol, false); + return ts.createTypeReferenceNode(name, undefined); + } + if (type.flags & 16384) { + var name = symbolToName(type.symbol, false); + return ts.createTypeReferenceNode(name, undefined); + } + if (context.checkAlias && type.aliasSymbol) { + var name = symbolToName(type.aliasSymbol, false); + var typeArgumentNodes = type.aliasTypeArguments && mapToTypeNodeArray(type.aliasTypeArguments); + return ts.createTypeReferenceNode(name, typeArgumentNodes); + } + context.checkAlias = false; + if (type.flags & 65536) { + var formattedUnionTypes = formatUnionTypes(type.types); + var unionTypeNodes = formattedUnionTypes && mapToTypeNodeArray(formattedUnionTypes); + if (unionTypeNodes && unionTypeNodes.length > 0) { + return ts.createUnionOrIntersectionTypeNode(165, unionTypeNodes); + } + else { + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowEmptyUnionOrIntersection)) { + context.encounteredError = true; + } + return undefined; + } + } + if (type.flags & 131072) { + return ts.createUnionOrIntersectionTypeNode(166, mapToTypeNodeArray(type.types)); + } + if (objectFlags & (16 | 32)) { + ts.Debug.assert(!!(type.flags & 32768)); + return createAnonymousTypeNode(type); + } + if (type.flags & 262144) { + var indexedType = type.type; + var indexTypeNode = typeToTypeNodeHelper(indexedType); + return ts.createTypeOperatorNode(indexTypeNode); + } + if (type.flags & 524288) { + var objectTypeNode = typeToTypeNodeHelper(type.objectType); + var indexTypeNode = typeToTypeNodeHelper(type.indexType); + return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); + } + ts.Debug.fail("Should be unreachable."); + function mapToTypeNodeArray(types) { + var result = []; + for (var _i = 0, types_1 = types; _i < types_1.length; _i++) { + var type_1 = types_1[_i]; + var typeNode = typeToTypeNodeHelper(type_1); + if (typeNode) { + result.push(typeNode); + } + } + return result; + } + function createMappedTypeNodeFromType(type) { + ts.Debug.assert(!!(type.flags & 32768)); + var typeParameter = getTypeParameterFromMappedType(type); + var typeParameterNode = typeParameterToDeclaration(typeParameter); + var templateType = getTemplateTypeFromMappedType(type); + var templateTypeNode = typeToTypeNodeHelper(templateType); + var readonlyToken = type.declaration && type.declaration.readonlyToken ? ts.createToken(130) : undefined; + var questionToken = type.declaration && type.declaration.questionToken ? ts.createToken(54) : undefined; + return ts.createMappedTypeNode(readonlyToken, typeParameterNode, questionToken, templateTypeNode); + } + function createAnonymousTypeNode(type) { + var symbol = type.symbol; + if (symbol) { + if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) || + symbol.flags & (384 | 512) || + shouldWriteTypeOfFunctionSymbol()) { + return createTypeQueryNodeFromSymbol(symbol); + } + else if (ts.contains(context.symbolStack, symbol)) { + var typeAlias = getTypeAliasForTypeLiteral(type); + if (typeAlias) { + var entityName = symbolToName(typeAlias, false); + return ts.createTypeReferenceNode(entityName, undefined); + } + else { + return ts.createKeywordTypeNode(118); + } + } + else { + if (!context.symbolStack) { + context.symbolStack = []; + } + context.symbolStack.push(symbol); + var result = createTypeNodeFromObjectType(type); + context.symbolStack.pop(); + return result; + } + } + else { + return createTypeNodeFromObjectType(type); + } + function shouldWriteTypeOfFunctionSymbol() { + var isStaticMethodSymbol = !!(symbol.flags & 8192 && + ts.forEach(symbol.declarations, function (declaration) { return ts.getModifierFlags(declaration) & 32; })); + var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && + (symbol.parent || + ts.forEach(symbol.declarations, function (declaration) { + return declaration.parent.kind === 264 || declaration.parent.kind === 233; + })); + if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { + return ts.contains(context.symbolStack, symbol); + } + } + } + function createTypeNodeFromObjectType(type) { + if (type.objectFlags & 32) { + if (getConstraintTypeFromMappedType(type).flags & (16384 | 262144)) { + return createMappedTypeNodeFromType(type); + } + } + var resolved = resolveStructuredTypeMembers(type); + if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { + if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { + return ts.createTypeLiteralNode(undefined); + } + if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { + var signature = resolved.callSignatures[0]; + return signatureToSignatureDeclarationHelper(signature, 159); + } + if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { + var signature = resolved.constructSignatures[0]; + return signatureToSignatureDeclarationHelper(signature, 160); + } + } + var saveInObjectTypeLiteral = context.inObjectTypeLiteral; + context.inObjectTypeLiteral = true; + var members = createTypeNodesFromResolvedType(resolved); + context.inObjectTypeLiteral = saveInObjectTypeLiteral; + return ts.createTypeLiteralNode(members); + } + function createTypeQueryNodeFromSymbol(symbol) { + var entityName = symbolToName(symbol, false); + return ts.createTypeQueryNode(entityName); + } + function typeReferenceToTypeNode(type) { + var typeArguments = type.typeArguments || emptyArray; + if (type.target === globalArrayType) { + var elementType = typeToTypeNodeHelper(typeArguments[0]); + return ts.createArrayTypeNode(elementType); + } + else if (type.target.objectFlags & 8) { + if (typeArguments.length > 0) { + var tupleConstituentNodes = mapToTypeNodeArray(typeArguments.slice(0, getTypeReferenceArity(type))); + if (tupleConstituentNodes && tupleConstituentNodes.length > 0) { + return ts.createTupleTypeNode(tupleConstituentNodes); + } + } + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowEmptyTuple)) { + context.encounteredError = true; + } + return undefined; + } + else { + var outerTypeParameters = type.target.outerTypeParameters; + var i = 0; + var qualifiedName = undefined; + if (outerTypeParameters) { + var length_1 = outerTypeParameters.length; + while (i < length_1) { + var start = i; + var parent = getParentSymbolOfTypeParameter(outerTypeParameters[i]); + do { + i++; + } while (i < length_1 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent); + if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { + var qualifiedNamePart = symbolToName(parent, true); + if (!qualifiedName) { + qualifiedName = ts.createQualifiedName(qualifiedNamePart, undefined); + } + else { + ts.Debug.assert(!qualifiedName.right); + qualifiedName.right = qualifiedNamePart; + qualifiedName = ts.createQualifiedName(qualifiedName, undefined); + } + } + } + } + var entityName = undefined; + var nameIdentifier = symbolToName(type.symbol, true); + if (qualifiedName) { + ts.Debug.assert(!qualifiedName.right); + qualifiedName.right = nameIdentifier; + entityName = qualifiedName; + } + else { + entityName = nameIdentifier; + } + var typeParameterCount = (type.target.typeParameters || emptyArray).length; + var typeArgumentNodes = ts.some(typeArguments) ? mapToTypeNodeArray(typeArguments.slice(i, typeParameterCount - i)) : undefined; + return ts.createTypeReferenceNode(entityName, typeArgumentNodes); + } + } + function createTypeNodesFromResolvedType(resolvedType) { + var typeElements = []; + for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { + var signature = _a[_i]; + typeElements.push(signatureToSignatureDeclarationHelper(signature, 154)); + } + for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { + var signature = _c[_b]; + typeElements.push(signatureToSignatureDeclarationHelper(signature, 155)); + } + if (resolvedType.stringIndexInfo) { + typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.stringIndexInfo, 0)); + } + if (resolvedType.numberIndexInfo) { + typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.numberIndexInfo, 1)); + } + var properties = resolvedType.properties; + if (!properties) { + return typeElements; + } + for (var _d = 0, properties_2 = properties; _d < properties_2.length; _d++) { + var propertySymbol = properties_2[_d]; + var propertyType = getTypeOfSymbol(propertySymbol); + var oldDeclaration = propertySymbol.declarations && propertySymbol.declarations[0]; + if (!oldDeclaration) { + return; + } + var propertyName = oldDeclaration.name; + var optionalToken = propertySymbol.flags & 67108864 ? ts.createToken(54) : undefined; + if (propertySymbol.flags & (16 | 8192) && !getPropertiesOfObjectType(propertyType).length) { + var signatures = getSignaturesOfType(propertyType, 0); + for (var _e = 0, signatures_1 = signatures; _e < signatures_1.length; _e++) { + var signature = signatures_1[_e]; + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 149); + methodDeclaration.name = propertyName; + methodDeclaration.questionToken = optionalToken; + typeElements.push(methodDeclaration); + } + } + else { + var propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType) : ts.createKeywordTypeNode(118); + typeElements.push(ts.createPropertySignature(propertyName, optionalToken, propertyTypeNode, undefined)); + } + } + return typeElements.length ? typeElements : undefined; + } + } + function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind) { + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 ? 135 : 132); + var name = ts.getNameFromIndexInfo(indexInfo); + var indexingParameter = ts.createParameter(undefined, undefined, undefined, name, undefined, indexerTypeNode, undefined); + var typeNode = typeToTypeNodeHelper(indexInfo.type); + return ts.createIndexSignatureDeclaration(undefined, indexInfo.isReadonly ? [ts.createToken(130)] : undefined, [indexingParameter], typeNode); + } + function signatureToSignatureDeclarationHelper(signature, kind) { + var typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter); }); + var parameters = signature.parameters.map(function (parameter) { return symbolToParameterDeclaration(parameter); }); + var returnTypeNode; + if (signature.typePredicate) { + var typePredicate = signature.typePredicate; + var parameterName = typePredicate.kind === 1 ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(); + var typeNode = typeToTypeNodeHelper(typePredicate.type); + returnTypeNode = ts.createTypePredicateNode(parameterName, typeNode); + } + else { + var returnType = getReturnTypeOfSignature(signature); + returnTypeNode = returnType && typeToTypeNodeHelper(returnType); + } + var returnTypeNodeExceptAny = returnTypeNode && returnTypeNode.kind !== 118 ? returnTypeNode : undefined; + return ts.createSignatureDeclaration(kind, typeParameters, parameters, returnTypeNodeExceptAny); + } + function typeParameterToDeclaration(type) { + var constraint = getConstraintFromTypeParameter(type); + var constraintNode = constraint && typeToTypeNodeHelper(constraint); + var defaultParameter = getDefaultFromTypeParameter(type); + var defaultParameterNode = defaultParameter && typeToTypeNodeHelper(defaultParameter); + var name = symbolToName(type.symbol, true); + return ts.createTypeParameterDeclaration(name, constraintNode, defaultParameterNode); + } + function symbolToParameterDeclaration(parameterSymbol) { + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 145); + var parameterType = getTypeOfSymbol(parameterSymbol); + var parameterTypeNode = typeToTypeNodeHelper(parameterType); + var parameterNode = ts.createParameter(parameterDeclaration.decorators, parameterDeclaration.modifiers, parameterDeclaration.dotDotDotToken && ts.createToken(23), ts.getSynthesizedClone(parameterDeclaration.name), parameterDeclaration.questionToken && ts.createToken(54), parameterTypeNode, parameterDeclaration.initializer); + return parameterNode; + } + function symbolToName(symbol, expectsIdentifier) { + var chain; + var isTypeParameter = symbol.flags & 262144; + if (!isTypeParameter && context.enclosingDeclaration) { + chain = getSymbolChain(symbol, 0, true); + ts.Debug.assert(chain && chain.length > 0); + } + else { + chain = [symbol]; + } + if (expectsIdentifier && chain.length !== 1 + && !context.encounteredError + && !(context.flags & ts.NodeBuilderFlags.allowQualifedNameInPlaceOfIdentifier)) { + context.encounteredError = true; + } + return createEntityNameFromSymbolChain(chain, chain.length - 1); + function createEntityNameFromSymbolChain(chain, index) { + ts.Debug.assert(chain && 0 <= index && index < chain.length); + var symbol = chain[index]; + var typeParameterString = ""; + if (index > 0) { + var parentSymbol = chain[index - 1]; + var typeParameters = void 0; + if (getCheckFlags(symbol) & 1) { + typeParameters = getTypeParametersOfClassOrInterface(parentSymbol); + } + else { + var targetSymbol = getTargetSymbol(parentSymbol); + if (targetSymbol.flags & (32 | 64 | 524288)) { + typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); + } + } + if (typeParameters && typeParameters.length > 0) { + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowTypeParameterInQualifiedName)) { + context.encounteredError = true; + } + var writer = ts.getSingleLineStringWriter(); + var displayBuilder = getSymbolDisplayBuilder(); + displayBuilder.buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, context.enclosingDeclaration, 0); + typeParameterString = writer.string(); + ts.releaseStringWriter(writer); + } + } + var symbolName = getNameOfSymbol(symbol); + var symbolNameWithTypeParameters = typeParameterString.length > 0 ? symbolName + "<" + typeParameterString + ">" : symbolName; + var identifier = ts.createIdentifier(symbolNameWithTypeParameters); + return index > 0 ? ts.createQualifiedName(createEntityNameFromSymbolChain(chain, index - 1), identifier) : identifier; + } + function getSymbolChain(symbol, meaning, endOfChain) { + var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, false); + var parentSymbol; + if (!accessibleSymbolChain || + needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { + var parent = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); + if (parent) { + var parentChain = getSymbolChain(parent, getQualifiedLeftMeaning(meaning), false); + if (parentChain) { + parentSymbol = parent; + accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [symbol]); + } + } + } + if (accessibleSymbolChain) { + return accessibleSymbolChain; + } + if (endOfChain || + !(!parentSymbol && ts.forEach(symbol.declarations, hasExternalModuleSymbol)) && + !(symbol.flags & (2048 | 4096))) { + return [symbol]; + } + } + function getNameOfSymbol(symbol) { + var declaration = ts.firstOrUndefined(symbol.declarations); + if (declaration) { + if (declaration.name) { + return ts.declarationNameToString(declaration.name); + } + if (declaration.parent && declaration.parent.kind === 225) { + return ts.declarationNameToString(declaration.parent.name); + } + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowAnonymousIdentifier)) { + context.encounteredError = true; + } + switch (declaration.kind) { + case 198: + return "(Anonymous class)"; + case 185: + case 186: + return "(Anonymous function)"; + } + } + return symbol.name; + } + } + } function typePredicateToString(typePredicate, enclosingDeclaration, flags) { var writer = ts.getSingleLineStringWriter(); getSymbolDisplayBuilder().buildTypePredicateDisplay(typePredicate, writer, enclosingDeclaration, flags); @@ -21054,11 +22874,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048) { - var node = type.symbol.declarations[0].parent; - while (node.kind === 166) { - node = node.parent; - } - if (node.kind === 228) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 167; }); + if (node.kind === 230) { return getSymbolOfNode(node); } } @@ -21066,29 +22883,32 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 231 && + node.parent.kind === 233 && ts.isExternalModuleAugmentation(node.parent.parent); } function literalTypeToString(type) { return type.flags & 32 ? "\"" + ts.escapeString(type.text) + "\"" : type.text; } - function getSymbolDisplayBuilder() { - function getNameOfSymbol(symbol) { - if (symbol.declarations && symbol.declarations.length) { - var declaration = symbol.declarations[0]; - if (declaration.name) { - return ts.declarationNameToString(declaration.name); - } - switch (declaration.kind) { - case 197: - return "(Anonymous class)"; - case 184: - case 185: - return "(Anonymous function)"; - } + function getNameOfSymbol(symbol) { + if (symbol.declarations && symbol.declarations.length) { + var declaration = symbol.declarations[0]; + if (declaration.name) { + return ts.declarationNameToString(declaration.name); + } + if (declaration.parent && declaration.parent.kind === 225) { + return ts.declarationNameToString(declaration.parent.name); + } + switch (declaration.kind) { + case 198: + return "(Anonymous class)"; + case 185: + case 186: + return "(Anonymous function)"; } - return symbol.name; } + return symbol.name; + } + function getSymbolDisplayBuilder() { function appendSymbolNameOnly(symbol, writer) { writer.writeSymbol(getNameOfSymbol(symbol), symbol); } @@ -21116,7 +22936,7 @@ var ts; function appendParentTypeArgumentsAndSymbolName(symbol) { if (parentSymbol) { if (flags & 1) { - if (symbol.flags & 16777216) { + if (getCheckFlags(symbol) & 1) { buildDisplayForTypeArgumentsAndDelimiters(getTypeParametersOfClassOrInterface(parentSymbol), symbol.mapper, writer, enclosingDeclaration); } else { @@ -21135,9 +22955,9 @@ var ts; var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & 2)); if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { - var parent_5 = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); - if (parent_5) { - walkSymbol(parent_5, getQualifiedLeftMeaning(meaning), false); + var parent = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); + if (parent) { + walkSymbol(parent, getQualifiedLeftMeaning(meaning), false); } } if (accessibleSymbolChain) { @@ -21167,7 +22987,7 @@ var ts; return writeType(type, globalFlags); function writeType(type, flags) { var nextFlags = flags & ~512; - if (type.flags & 16015) { + if (type.flags & 16793231) { writer.writeKeyword(!(globalFlags & 16) && isTypeAny(type) ? "any" : type.intrinsicName); @@ -21192,7 +23012,7 @@ var ts; else if (!(flags & 512) && type.aliasSymbol && isSymbolAccessible(type.aliasSymbol, enclosingDeclaration, 793064, false).accessibility === 0) { var typeArguments = type.aliasTypeArguments; - writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, typeArguments ? typeArguments.length : 0, nextFlags); + writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, ts.length(typeArguments), nextFlags); } else if (type.flags & 196608) { writeUnionOrIntersectionType(type, nextFlags); @@ -21267,15 +23087,15 @@ var ts; var outerTypeParameters = type.target.outerTypeParameters; var i = 0; if (outerTypeParameters) { - var length_1 = outerTypeParameters.length; - while (i < length_1) { + var length_2 = outerTypeParameters.length; + while (i < length_2) { var start = i; - var parent_6 = getParentSymbolOfTypeParameter(outerTypeParameters[i]); + var parent = getParentSymbolOfTypeParameter(outerTypeParameters[i]); do { i++; - } while (i < length_1 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent_6); + } while (i < length_2 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent); if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { - writeSymbolTypeReference(parent_6, typeArguments, start, i, flags); + writeSymbolTypeReference(parent, typeArguments, start, i, flags); writePunctuation(writer, 22); } } @@ -21301,7 +23121,8 @@ var ts; function writeAnonymousType(type, flags) { var symbol = type.symbol; if (symbol) { - if (symbol.flags & (32 | 384 | 512)) { + if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) || + symbol.flags & (384 | 512)) { writeTypeOfSymbol(type, flags); } else if (shouldWriteTypeOfFunctionSymbol()) { @@ -21334,7 +23155,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && (symbol.parent || ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 261 || declaration.parent.kind === 231; + return declaration.parent.kind === 264 || declaration.parent.kind === 233; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 2) || @@ -21347,32 +23168,13 @@ var ts; writeSpace(writer); buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455, 0, typeFormatFlags); } - function writeIndexSignature(info, keyword) { - if (info) { - if (info.isReadonly) { - writeKeyword(writer, 130); - writeSpace(writer); - } - writePunctuation(writer, 20); - writer.writeParameter(info.declaration ? ts.declarationNameToString(info.declaration.parameters[0].name) : "x"); - writePunctuation(writer, 55); - writeSpace(writer); - writeKeyword(writer, keyword); - writePunctuation(writer, 21); - writePunctuation(writer, 55); - writeSpace(writer); - writeType(info.type, 0); - writePunctuation(writer, 24); - writer.writeLine(); - } - } function writePropertyWithModifiers(prop) { if (isReadonlySymbol(prop)) { writeKeyword(writer, 130); writeSpace(writer); } buildSymbolDisplay(prop, writer); - if (prop.flags & 536870912) { + if (prop.flags & 67108864) { writePunctuation(writer, 54); } } @@ -21448,15 +23250,15 @@ var ts; writePunctuation(writer, 24); writer.writeLine(); } - writeIndexSignature(resolved.stringIndexInfo, 134); - writeIndexSignature(resolved.numberIndexInfo, 132); + buildIndexSignatureDisplay(resolved.stringIndexInfo, writer, 0, enclosingDeclaration, globalFlags, symbolStack); + buildIndexSignatureDisplay(resolved.numberIndexInfo, writer, 1, enclosingDeclaration, globalFlags, symbolStack); for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) { var p = _e[_d]; var t = getTypeOfSymbol(p); if (p.flags & (16 | 8192) && !getPropertiesOfObjectType(t).length) { var signatures = getSignaturesOfType(t, 0); - for (var _f = 0, signatures_1 = signatures; _f < signatures_1.length; _f++) { - var signature = signatures_1[_f]; + for (var _f = 0, signatures_2 = signatures; _f < signatures_2.length; _f++) { + var signature = signatures_2[_f]; writePropertyWithModifiers(p); buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, undefined, symbolStack); writePunctuation(writer, 24); @@ -21515,32 +23317,43 @@ var ts; writeSpace(writer); buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, symbolStack); } + var defaultType = getDefaultFromTypeParameter(tp); + if (defaultType) { + writeSpace(writer); + writePunctuation(writer, 57); + writeSpace(writer); + buildTypeDisplay(defaultType, writer, enclosingDeclaration, flags, symbolStack); + } } function buildParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack) { var parameterNode = p.valueDeclaration; - if (ts.isRestParameter(parameterNode)) { + if (parameterNode ? ts.isRestParameter(parameterNode) : isTransientSymbol(p) && p.isRestParameter) { writePunctuation(writer, 23); } - if (ts.isBindingPattern(parameterNode.name)) { + if (parameterNode && ts.isBindingPattern(parameterNode.name)) { buildBindingPatternDisplay(parameterNode.name, writer, enclosingDeclaration, flags, symbolStack); } else { appendSymbolNameOnly(p, writer); } - if (isOptionalParameter(parameterNode)) { + if (parameterNode && isOptionalParameter(parameterNode)) { writePunctuation(writer, 54); } writePunctuation(writer, 55); writeSpace(writer); - buildTypeDisplay(getTypeOfSymbol(p), writer, enclosingDeclaration, flags, symbolStack); + var type = getTypeOfSymbol(p); + if (parameterNode && isRequiredInitializedParameter(parameterNode)) { + type = includeFalsyTypes(type, 2048); + } + buildTypeDisplay(type, writer, enclosingDeclaration, flags, symbolStack); } function buildBindingPatternDisplay(bindingPattern, writer, enclosingDeclaration, flags, symbolStack) { - if (bindingPattern.kind === 172) { + if (bindingPattern.kind === 173) { writePunctuation(writer, 16); buildDisplayForCommaSeparatedList(bindingPattern.elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); }); writePunctuation(writer, 17); } - else if (bindingPattern.kind === 173) { + else if (bindingPattern.kind === 174) { writePunctuation(writer, 20); var elements = bindingPattern.elements; buildDisplayForCommaSeparatedList(elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); }); @@ -21554,9 +23367,9 @@ var ts; if (ts.isOmittedExpression(bindingElement)) { return; } - ts.Debug.assert(bindingElement.kind === 174); + ts.Debug.assert(bindingElement.kind === 175); if (bindingElement.propertyName) { - writer.writeSymbol(ts.getTextOfNode(bindingElement.propertyName), bindingElement.symbol); + writer.writeProperty(ts.getTextOfNode(bindingElement.propertyName)); writePunctuation(writer, 55); writeSpace(writer); } @@ -21628,6 +23441,10 @@ var ts; buildTypeDisplay(predicate.type, writer, enclosingDeclaration, flags, symbolStack); } function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) { + var returnType = getReturnTypeOfSignature(signature); + if (flags & 2048 && isTypeAny(returnType)) { + return; + } if (flags & 8) { writeSpace(writer); writePunctuation(writer, 35); @@ -21640,7 +23457,6 @@ var ts; buildTypePredicateDisplay(signature.typePredicate, writer, enclosingDeclaration, flags, symbolStack); } else { - var returnType = getReturnTypeOfSignature(signature); buildTypeDisplay(returnType, writer, enclosingDeclaration, flags, symbolStack); } } @@ -21658,6 +23474,32 @@ var ts; buildDisplayForParametersAndDelimiters(signature.thisParameter, signature.parameters, writer, enclosingDeclaration, flags, symbolStack); buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack); } + function buildIndexSignatureDisplay(info, writer, kind, enclosingDeclaration, globalFlags, symbolStack) { + if (info) { + if (info.isReadonly) { + writeKeyword(writer, 130); + writeSpace(writer); + } + writePunctuation(writer, 20); + writer.writeParameter(info.declaration ? ts.declarationNameToString(info.declaration.parameters[0].name) : "x"); + writePunctuation(writer, 55); + writeSpace(writer); + switch (kind) { + case 1: + writeKeyword(writer, 132); + break; + case 0: + writeKeyword(writer, 135); + break; + } + writePunctuation(writer, 21); + writePunctuation(writer, 55); + writeSpace(writer); + buildTypeDisplay(info.type, writer, enclosingDeclaration, globalFlags, symbolStack); + writePunctuation(writer, 24); + writer.writeLine(); + } + } return _displayBuilder || (_displayBuilder = { buildSymbolDisplay: buildSymbolDisplay, buildTypeDisplay: buildTypeDisplay, @@ -21668,6 +23510,7 @@ var ts; buildDisplayForTypeParametersAndDelimiters: buildDisplayForTypeParametersAndDelimiters, buildTypeParameterDisplayFromSymbol: buildTypeParameterDisplayFromSymbol, buildSignatureDisplay: buildSignatureDisplay, + buildIndexSignatureDisplay: buildIndexSignatureDisplay, buildReturnTypeDisplay: buildReturnTypeDisplay }); } @@ -21682,63 +23525,63 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 174: + case 175: return isDeclarationVisible(node.parent.parent); - case 223: + case 225: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { return false; } - case 230: - case 226: - case 227: + case 232: case 228: - case 225: case 229: - case 234: + case 230: + case 227: + case 231: + case 236: if (ts.isExternalModuleAugmentation(node)) { return true; } - var parent_7 = getDeclarationContainer(node); + var parent = getDeclarationContainer(node); if (!(ts.getCombinedModifierFlags(node) & 1) && - !(node.kind !== 234 && parent_7.kind !== 261 && ts.isInAmbientContext(parent_7))) { - return isGlobalSourceFile(parent_7); + !(node.kind !== 236 && parent.kind !== 264 && ts.isInAmbientContext(parent))) { + return isGlobalSourceFile(parent); } - return isDeclarationVisible(parent_7); - case 147: - case 146: - case 151: - case 152: - case 149: + return isDeclarationVisible(parent); case 148: + case 147: + case 152: + case 153: + case 150: + case 149: if (ts.getModifierFlags(node) & (8 | 16)) { return false; } - case 150: - case 154: - case 153: + case 151: case 155: - case 144: - case 231: - case 158: + case 154: + case 156: + case 145: + case 233: case 159: - case 161: - case 157: + case 160: case 162: + case 158: case 163: case 164: case 165: case 166: + case 167: return isDeclarationVisible(node.parent); - case 236: - case 237: + case 238: case 239: + case 241: return false; - case 143: - case 261: - case 233: + case 144: + case 264: + case 235: return true; - case 240: + case 242: return false; default: return false; @@ -21747,10 +23590,10 @@ var ts; } function collectLinkedAliases(node) { var exportSymbol; - if (node.parent && node.parent.kind === 240) { + if (node.parent && node.parent.kind === 242) { exportSymbol = resolveName(node.parent, node.text, 107455 | 793064 | 1920 | 8388608, ts.Diagnostics.Cannot_find_name_0, node); } - else if (node.parent.kind === 243) { + else if (node.parent.kind === 245) { var exportSpecifier = node.parent; exportSymbol = exportSpecifier.parent.parent.moduleSpecifier ? getExternalModuleMember(exportSpecifier.parent.parent, exportSpecifier) : @@ -21782,8 +23625,8 @@ var ts; function pushTypeResolution(target, propertyName) { var resolutionCycleStartIndex = findResolutionCycleStartIndex(target, propertyName); if (resolutionCycleStartIndex >= 0) { - var length_2 = resolutionTargets.length; - for (var i = resolutionCycleStartIndex; i < length_2; i++) { + var length_3 = resolutionTargets.length; + for (var i = resolutionCycleStartIndex; i < length_3; i++) { resolutionResults[i] = false; } return false; @@ -21825,21 +23668,20 @@ var ts; return resolutionResults.pop(); } function getDeclarationContainer(node) { - node = ts.getRootDeclaration(node); - while (node) { + node = ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 223: - case 224: + case 225: + case 226: + case 241: + case 240: case 239: case 238: - case 237: - case 236: - node = node.parent; - break; + return false; default: - return node.parent; + return true; } - } + }); + return node && node.parent; } function getTypeOfPrototypeProperty(prototype) { var classType = getDeclaredTypeOfSymbol(getParentOfSymbol(prototype)); @@ -21852,32 +23694,34 @@ var ts; function isTypeAny(type) { return type && (type.flags & 1) !== 0; } - function isTypeNever(type) { - return type && (type.flags & 8192) !== 0; - } function getTypeForBindingElementParent(node) { var symbol = getSymbolOfNode(node); return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, false); } function isComputedNonLiteralName(name) { - return name.kind === 142 && !ts.isStringOrNumericLiteral(name.expression); + return name.kind === 143 && !ts.isStringOrNumericLiteral(name.expression); } function getRestType(source, properties, symbol) { - ts.Debug.assert(!!(source.flags & 32768), "Rest types only support object types right now."); + source = filterType(source, function (t) { return !(t.flags & 6144); }); + if (source.flags & 8192) { + return emptyObjectType; + } + if (source.flags & 65536) { + return mapType(source, function (t) { return getRestType(t, properties, symbol); }); + } var members = ts.createMap(); var names = ts.createMap(); - for (var _i = 0, properties_2 = properties; _i < properties_2.length; _i++) { - var name_17 = properties_2[_i]; - names[ts.getTextOfPropertyName(name_17)] = true; + for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { + var name = properties_3[_i]; + names.set(ts.getTextOfPropertyName(name), true); } for (var _a = 0, _b = getPropertiesOfType(source); _a < _b.length; _a++) { var prop = _b[_a]; - var inNamesToRemove = prop.name in names; + var inNamesToRemove = names.has(prop.name); var isPrivate = getDeclarationModifierFlagsFromSymbol(prop) & (8 | 16); - var isMethod = prop.flags & 8192; var isSetOnlyAccessor = prop.flags & 65536 && !(prop.flags & 32768); - if (!inNamesToRemove && !isPrivate && !isMethod && !isSetOnlyAccessor) { - members[prop.name] = prop; + if (!inNamesToRemove && !isPrivate && !isClassMethod(prop) && !isSetOnlyAccessor) { + members.set(prop.name, prop); } } var stringIndexInfo = getIndexInfoOfType(source, 0); @@ -21897,9 +23741,9 @@ var ts; return parentType; } var type; - if (pattern.kind === 172) { + if (pattern.kind === 173) { if (declaration.dotDotDotToken) { - if (!(parentType.flags & 32768)) { + if (!isValidSpreadType(parentType)) { error(declaration, ts.Diagnostics.Rest_types_may_only_be_created_from_object_types); return unknownType; } @@ -21913,25 +23757,25 @@ var ts; type = getRestType(parentType, literalMembers, declaration.symbol); } else { - var name_18 = declaration.propertyName || declaration.name; - if (isComputedNonLiteralName(name_18)) { + var name = declaration.propertyName || declaration.name; + if (isComputedNonLiteralName(name)) { return anyType; } if (declaration.initializer) { getContextualType(declaration.initializer); } - var text = ts.getTextOfPropertyName(name_18); + var text = ts.getTextOfPropertyName(name); type = getTypeOfPropertyOfType(parentType, text) || isNumericLiteralName(text) && getIndexTypeOfType(parentType, 1) || getIndexTypeOfType(parentType, 0); if (!type) { - error(name_18, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_18)); + error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name)); return unknownType; } } } else { - var elementType = checkIteratedTypeOrElementType(parentType, pattern, false); + var elementType = checkIteratedTypeOrElementType(parentType, pattern, false, false); if (declaration.dotDotDotToken) { type = createArrayType(elementType); } @@ -21958,7 +23802,7 @@ var ts; getUnionType([type, checkExpressionCached(declaration.initializer)], true) : type; } - function getTypeForVariableLikeDeclarationFromJSDocComment(declaration) { + function getTypeForDeclarationFromJSDocComment(declaration) { var jsdocType = ts.getJSDocType(declaration); if (jsdocType) { return getTypeFromTypeNode(jsdocType); @@ -21971,33 +23815,35 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 175 && expr.elements.length === 0; + return expr.kind === 176 && expr.elements.length === 0; } function addOptionality(type, optional) { return strictNullChecks && optional ? includeFalsyTypes(type, 2048) : type; } function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { - if (declaration.flags & 2097152) { - var type = getTypeForVariableLikeDeclarationFromJSDocComment(declaration); + if (declaration.flags & 65536) { + var type = getTypeForDeclarationFromJSDocComment(declaration); if (type && type !== unknownType) { return type; } } - if (declaration.parent.parent.kind === 212) { + if (declaration.parent.parent.kind === 214) { var indexType = getIndexType(checkNonNullExpression(declaration.parent.parent.expression)); return indexType.flags & (16384 | 262144) ? indexType : stringType; } - if (declaration.parent.parent.kind === 213) { - return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType; + if (declaration.parent.parent.kind === 215) { + var forOfStatement = declaration.parent.parent; + return checkRightHandSideOfForOf(forOfStatement.expression, forOfStatement.awaitModifier) || anyType; } if (ts.isBindingPattern(declaration.parent)) { return getTypeForBindingElement(declaration); } if (declaration.type) { - return addOptionality(getTypeFromTypeNode(declaration.type), declaration.questionToken && includeOptionality); + var declaredType = getTypeFromTypeNode(declaration.type); + return addOptionality(declaredType, declaration.questionToken && includeOptionality); } - if ((compilerOptions.noImplicitAny || declaration.flags & 2097152) && - declaration.kind === 223 && !ts.isBindingPattern(declaration.name) && + if ((noImplicitAny || declaration.flags & 65536) && + declaration.kind === 225 && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1) && !ts.isInAmbientContext(declaration)) { if (!(ts.getCombinedNodeFlags(declaration) & 2) && (!declaration.initializer || isNullOrUndefined(declaration.initializer))) { return autoType; @@ -22006,10 +23852,10 @@ var ts; return autoArrayType; } } - if (declaration.kind === 144) { + if (declaration.kind === 145) { var func = declaration.parent; - if (func.kind === 152 && !ts.hasDynamicName(func)) { - var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 151); + if (func.kind === 153 && !ts.hasDynamicName(func)) { + var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 152); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -22035,7 +23881,10 @@ var ts; var type = checkDeclarationInitializer(declaration); return addOptionality(type, declaration.questionToken && includeOptionality); } - if (declaration.kind === 258) { + if (ts.isJsxAttribute(declaration)) { + return trueType; + } + if (declaration.kind === 261) { return checkIdentifier(declaration.name); } if (ts.isBindingPattern(declaration.name)) { @@ -22043,6 +23892,37 @@ var ts; } return undefined; } + function getWidenedTypeFromJSSpecialPropertyDeclarations(symbol) { + var types = []; + var definedInConstructor = false; + var definedInMethod = false; + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + var expression = declaration.kind === 193 ? declaration : + declaration.kind === 178 ? ts.getAncestor(declaration, 193) : + undefined; + if (!expression) { + return unknownType; + } + if (ts.isPropertyAccessExpression(expression.left) && expression.left.expression.kind === 98) { + if (ts.getThisContainer(expression, false).kind === 151) { + definedInConstructor = true; + } + else { + definedInMethod = true; + } + } + if (expression.flags & 65536) { + var type = getTypeForDeclarationFromJSDocComment(expression.parent); + if (type && type !== unknownType) { + types.push(getWidenedType(type)); + continue; + } + } + types.push(getWidenedLiteralType(checkExpressionCached(expression.right))); + } + return getWidenedType(addOptionality(getUnionType(types, true), definedInMethod && !definedInConstructor)); + } function getTypeFromBindingElement(element, includePatternInType, reportErrors) { if (element.initializer) { return checkDeclarationInitializer(element); @@ -22050,28 +23930,33 @@ var ts; if (ts.isBindingPattern(element.name)) { return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors); } - if (reportErrors && compilerOptions.noImplicitAny && !declarationBelongsToPrivateAmbientMember(element)) { + if (reportErrors && noImplicitAny && !declarationBelongsToPrivateAmbientMember(element)) { reportImplicitAnyError(element, anyType); } return anyType; } function getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) { var members = ts.createMap(); + var stringIndexInfo; var hasComputedProperties = false; ts.forEach(pattern.elements, function (e) { var name = e.propertyName || e.name; - if (isComputedNonLiteralName(name) || e.dotDotDotToken) { + if (isComputedNonLiteralName(name)) { hasComputedProperties = true; return; } + if (e.dotDotDotToken) { + stringIndexInfo = createIndexInfo(anyType, false); + return; + } var text = ts.getTextOfPropertyName(name); - var flags = 4 | 67108864 | (e.initializer ? 536870912 : 0); + var flags = 4 | (e.initializer ? 67108864 : 0); var symbol = createSymbol(flags, text); symbol.type = getTypeFromBindingElement(e, includePatternInType, reportErrors); symbol.bindingElement = e; - members[symbol.name] = symbol; + members.set(symbol.name, symbol); }); - var result = createAnonymousType(undefined, members, emptyArray, emptyArray, undefined, undefined); + var result = createAnonymousType(undefined, members, emptyArray, emptyArray, stringIndexInfo, undefined); if (includePatternInType) { result.pattern = pattern; } @@ -22095,7 +23980,7 @@ var ts; return result; } function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { - return pattern.kind === 172 + return pattern.kind === 173 ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -22105,13 +23990,13 @@ var ts; if (reportErrors) { reportErrorsFromWidening(declaration, type); } - if (declaration.kind === 257) { + if (declaration.kind === 260) { return type; } return getWidenedType(type); } type = declaration.dotDotDotToken ? anyArrayType : anyType; - if (reportErrors && compilerOptions.noImplicitAny) { + if (reportErrors && noImplicitAny) { if (!declarationBelongsToPrivateAmbientMember(declaration)) { reportImplicitAnyError(declaration, type); } @@ -22120,56 +24005,38 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 144 ? root.parent : root; + var memberDeclaration = root.kind === 145 ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function getTypeOfVariableOrParameterOrProperty(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - if (symbol.flags & 134217728) { + if (symbol.flags & 16777216) { return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; if (ts.isCatchClauseVariableDeclarationOrBindingElement(declaration)) { return links.type = anyType; } - if (declaration.kind === 240) { + if (declaration.kind === 242) { return links.type = checkExpression(declaration.expression); } - if (declaration.flags & 2097152 && declaration.kind === 286 && declaration.typeExpression) { + if (declaration.flags & 65536 && declaration.kind === 290 && declaration.typeExpression) { return links.type = getTypeFromTypeNode(declaration.typeExpression.type); } if (!pushTypeResolution(symbol, 0)) { return unknownType; } var type = void 0; - if (declaration.kind === 192 || - declaration.kind === 177 && declaration.parent.kind === 192) { - if (declaration.flags & 2097152) { - var jsdocType = ts.getJSDocType(declaration.parent); - if (jsdocType) { - return links.type = getTypeFromTypeNode(jsdocType); - } - } - var declaredTypes = ts.map(symbol.declarations, function (decl) { return decl.kind === 192 ? - checkExpressionCached(decl.right) : - checkExpressionCached(decl.parent.right); }); - type = getUnionType(declaredTypes, true); + if (declaration.kind === 193 || + declaration.kind === 178 && declaration.parent.kind === 193) { + type = getWidenedTypeFromJSSpecialPropertyDeclarations(symbol); } else { type = getWidenedTypeForVariableLikeDeclaration(declaration, true); } if (!popTypeResolution()) { - if (symbol.valueDeclaration.type) { - type = unknownType; - error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); - } - else { - type = anyType; - if (compilerOptions.noImplicitAny) { - error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); - } - } + type = reportCircularityError(symbol); } links.type = type; } @@ -22177,7 +24044,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 151) { + if (accessor.kind === 152) { return accessor.type && getTypeFromTypeNode(accessor.type); } else { @@ -22197,10 +24064,10 @@ var ts; function getTypeOfAccessors(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - var getter = ts.getDeclarationOfKind(symbol, 151); - var setter = ts.getDeclarationOfKind(symbol, 152); - if (getter && getter.flags & 2097152) { - var jsDocType = getTypeForVariableLikeDeclarationFromJSDocComment(getter); + var getter = ts.getDeclarationOfKind(symbol, 152); + var setter = ts.getDeclarationOfKind(symbol, 153); + if (getter && getter.flags & 65536) { + var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { return links.type = jsDocType; } @@ -22223,7 +24090,7 @@ var ts; type = getReturnTypeFromBody(getter); } else { - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { if (setter) { error(setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation, symbolToString(symbol)); } @@ -22238,8 +24105,8 @@ var ts; } if (!popTypeResolution()) { type = anyType; - if (compilerOptions.noImplicitAny) { - var getter_1 = ts.getDeclarationOfKind(symbol, 151); + if (noImplicitAny) { + var getter_1 = ts.getDeclarationOfKind(symbol, 152); error(getter_1, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -22247,6 +24114,10 @@ var ts; } return links.type; } + function getBaseTypeVariableOfClass(symbol) { + var baseConstructorType = getBaseConstructorTypeOfClass(getDeclaredTypeOfClassOrInterface(symbol)); + return baseConstructorType.flags & 540672 ? baseConstructorType : undefined; + } function getTypeOfFuncClassEnumModule(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { @@ -22255,8 +24126,13 @@ var ts; } else { var type = createObjectType(16, symbol); - links.type = strictNullChecks && symbol.flags & 536870912 ? - includeFalsyTypes(type, 2048) : type; + if (symbol.flags & 32) { + var baseTypeVariable = getBaseTypeVariableOfClass(symbol); + links.type = baseTypeVariable ? getIntersectionType([type, baseTypeVariable]) : type; + } + else { + links.type = strictNullChecks && symbol.flags & 67108864 ? includeFalsyTypes(type, 2048) : type; + } } } return links.type; @@ -22281,12 +24157,37 @@ var ts; function getTypeOfInstantiatedSymbol(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - links.type = instantiateType(getTypeOfSymbol(links.target), links.mapper); + if (symbolInstantiationDepth === 100) { + error(symbol.valueDeclaration, ts.Diagnostics.Generic_type_instantiation_is_excessively_deep_and_possibly_infinite); + links.type = unknownType; + } + else { + if (!pushTypeResolution(symbol, 0)) { + return unknownType; + } + symbolInstantiationDepth++; + var type = instantiateType(getTypeOfSymbol(links.target), links.mapper); + symbolInstantiationDepth--; + if (!popTypeResolution()) { + type = reportCircularityError(symbol); + } + links.type = type; + } } return links.type; } + function reportCircularityError(symbol) { + if (symbol.valueDeclaration.type) { + error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); + return unknownType; + } + if (noImplicitAny) { + error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); + } + return anyType; + } function getTypeOfSymbol(symbol) { - if (symbol.flags & 16777216) { + if (getCheckFlags(symbol) & 1) { return getTypeOfInstantiatedSymbol(symbol); } if (symbol.flags & (3 | 4)) { @@ -22306,19 +24207,30 @@ var ts; } return unknownType; } + function isReferenceToType(type, target) { + return type !== undefined + && target !== undefined + && (getObjectFlags(type) & 4) !== 0 + && type.target === target; + } function getTargetType(type) { return getObjectFlags(type) & 4 ? type.target : type; } function hasBaseType(type, checkBase) { return check(type); function check(type) { - var target = getTargetType(type); - return target === checkBase || ts.forEach(getBaseTypes(target), check); + if (getObjectFlags(type) & (3 | 4)) { + var target = getTargetType(type); + return target === checkBase || ts.forEach(getBaseTypes(target), check); + } + else if (type.flags & 131072) { + return ts.forEach(type.types, check); + } } } function appendTypeParameters(typeParameters, declarations) { - for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { - var declaration = declarations_2[_i]; + for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { + var declaration = declarations_3[_i]; var tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(declaration)); if (!typeParameters) { typeParameters = [tp]; @@ -22335,9 +24247,9 @@ var ts; if (!node) { return typeParameters; } - if (node.kind === 226 || node.kind === 197 || - node.kind === 225 || node.kind === 184 || - node.kind === 149 || node.kind === 185) { + if (node.kind === 228 || node.kind === 198 || + node.kind === 227 || node.kind === 185 || + node.kind === 150 || node.kind === 186) { var declarations = node.typeParameters; if (declarations) { return appendTypeParameters(appendOuterTypeParameters(typeParameters, node), declarations); @@ -22346,15 +24258,15 @@ var ts; } } function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 227); + var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 229); return appendOuterTypeParameters(undefined, declaration); } function getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) { var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 227 || node.kind === 226 || - node.kind === 197 || node.kind === 228) { + if (node.kind === 229 || node.kind === 228 || + node.kind === 198 || node.kind === 230) { var declaration = node; if (declaration.typeParameters) { result = appendTypeParameters(result, declaration.typeParameters); @@ -22366,18 +24278,34 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { return ts.concatenate(getOuterTypeParametersOfClassOrInterface(symbol), getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol)); } + function isMixinConstructorType(type) { + var signatures = getSignaturesOfType(type, 1); + if (signatures.length === 1) { + var s = signatures[0]; + return !s.typeParameters && s.parameters.length === 1 && s.hasRestParameter && getTypeOfParameter(s.parameters[0]) === anyArrayType; + } + return false; + } function isConstructorType(type) { - return type.flags & 32768 && getSignaturesOfType(type, 1).length > 0; + if (isValidBaseType(type) && getSignaturesOfType(type, 1).length > 0) { + return true; + } + if (type.flags & 540672) { + var constraint = getBaseConstraintOfType(type); + return constraint && isValidBaseType(constraint) && isMixinConstructorType(constraint); + } + return false; } function getBaseTypeNodeOfClass(type) { return ts.getClassExtendsHeritageClauseElement(type.symbol.valueDeclaration); } - function getConstructorsForTypeArguments(type, typeArgumentNodes) { - var typeArgCount = typeArgumentNodes ? typeArgumentNodes.length : 0; - return ts.filter(getSignaturesOfType(type, 1), function (sig) { return (sig.typeParameters ? sig.typeParameters.length : 0) === typeArgCount; }); + function getConstructorsForTypeArguments(type, typeArgumentNodes, location) { + var typeArgCount = ts.length(typeArgumentNodes); + var isJavaScript = ts.isInJavaScriptFile(location); + return ts.filter(getSignaturesOfType(type, 1), function (sig) { return (isJavaScript || typeArgCount >= getMinTypeArgumentCount(sig.typeParameters)) && typeArgCount <= ts.length(sig.typeParameters); }); } - function getInstantiatedConstructorsForTypeArguments(type, typeArgumentNodes) { - var signatures = getConstructorsForTypeArguments(type, typeArgumentNodes); + function getInstantiatedConstructorsForTypeArguments(type, typeArgumentNodes, location) { + var signatures = getConstructorsForTypeArguments(type, typeArgumentNodes, location); if (typeArgumentNodes) { var typeArguments_1 = ts.map(typeArgumentNodes, getTypeFromTypeNode); signatures = ts.map(signatures, function (sig) { return getSignatureInstantiation(sig, typeArguments_1); }); @@ -22394,14 +24322,14 @@ var ts; return unknownType; } var baseConstructorType = checkExpression(baseTypeNode.expression); - if (baseConstructorType.flags & 32768) { + if (baseConstructorType.flags & (32768 | 131072)) { resolveStructuredTypeMembers(baseConstructorType); } if (!popTypeResolution()) { error(type.symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_base_expression, symbolToString(type.symbol)); return type.resolvedBaseConstructorType = unknownType; } - if (baseConstructorType !== unknownType && baseConstructorType !== nullWideningType && !isConstructorType(baseConstructorType)) { + if (!(baseConstructorType.flags & 1) && baseConstructorType !== nullWideningType && !isConstructorType(baseConstructorType)) { error(baseTypeNode.expression, ts.Diagnostics.Type_0_is_not_a_constructor_function_type, typeToString(baseConstructorType)); return type.resolvedBaseConstructorType = unknownType; } @@ -22430,8 +24358,8 @@ var ts; } function resolveBaseTypesOfClass(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; - var baseConstructorType = getBaseConstructorTypeOfClass(type); - if (!(baseConstructorType.flags & 32768)) { + var baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type)); + if (!(baseConstructorType.flags & (32768 | 131072 | 1))) { return; } var baseTypeNode = getBaseTypeNodeOfClass(type); @@ -22441,8 +24369,11 @@ var ts; areAllOuterTypeParametersApplied(originalBaseType)) { baseType = getTypeFromClassOrInterfaceReference(baseTypeNode, baseConstructorType.symbol); } + else if (baseConstructorType.flags & 1) { + baseType = baseConstructorType; + } else { - var constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments); + var constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments, baseTypeNode); if (!constructors.length) { error(baseTypeNode.expression, ts.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments); return; @@ -22459,7 +24390,7 @@ var ts; if (baseType === unknownType) { return; } - if (!(getObjectFlags(getTargetType(baseType)) & 3)) { + if (!isValidBaseType(baseType)) { error(baseTypeNode.expression, ts.Diagnostics.Base_constructor_return_type_0_is_not_a_class_or_interface_type, typeToString(baseType)); return; } @@ -22483,16 +24414,20 @@ var ts; } return true; } + function isValidBaseType(type) { + return type.flags & (32768 | 16777216 | 1) && !isGenericMappedType(type) || + type.flags & 131072 && !ts.forEach(type.types, function (t) { return !isValidBaseType(t); }); + } function resolveBaseTypesOfInterface(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 227 && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 229 && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getTypeFromTypeNode(node); if (baseType !== unknownType) { - if (getObjectFlags(getTargetType(baseType)) & 3) { + if (isValidBaseType(baseType)) { if (type !== baseType && !hasBaseType(baseType, type)) { if (type.resolvedBaseTypes === emptyArray) { type.resolvedBaseTypes = [baseType]; @@ -22516,7 +24451,7 @@ var ts; function isIndependentInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 227) { + if (declaration.kind === 229) { if (declaration.flags & 64) { return false; } @@ -22549,7 +24484,7 @@ var ts; type.outerTypeParameters = outerTypeParameters; type.localTypeParameters = localTypeParameters; type.instantiations = ts.createMap(); - type.instantiations[getTypeListId(type.typeParameters)] = type; + type.instantiations.set(getTypeListId(type.typeParameters), type); type.target = type; type.typeArguments = type.typeParameters; type.thisType = createType(16384); @@ -22566,7 +24501,7 @@ var ts; if (!pushTypeResolution(symbol, 2)) { return unknownType; } - var declaration = ts.getDeclarationOfKind(symbol, 285); + var declaration = ts.getDeclarationOfKind(symbol, 289); var type = void 0; if (declaration) { if (declaration.jsDocTypeLiteral) { @@ -22577,7 +24512,7 @@ var ts; } } else { - declaration = ts.getDeclarationOfKind(symbol, 228); + declaration = ts.getDeclarationOfKind(symbol, 230); type = getTypeFromTypeNode(declaration.type); } if (popTypeResolution()) { @@ -22585,7 +24520,7 @@ var ts; if (typeParameters) { links.typeParameters = typeParameters; links.instantiations = ts.createMap(); - links.instantiations[getTypeListId(typeParameters)] = type; + links.instantiations.set(getTypeListId(typeParameters), type); } } else { @@ -22602,14 +24537,14 @@ var ts; return !ts.isInAmbientContext(member); } return expr.kind === 8 || - expr.kind === 190 && expr.operator === 37 && + expr.kind === 191 && expr.operator === 37 && expr.operand.kind === 8 || - expr.kind === 70 && !!symbol.exports[expr.text]; + expr.kind === 70 && !!symbol.exports.get(expr.text); } function enumHasLiteralMembers(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 229) { + if (declaration.kind === 231) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (!isLiteralEnumMember(symbol, member)) { @@ -22634,10 +24569,10 @@ var ts; enumType.symbol = symbol; if (enumHasLiteralMembers(symbol)) { var memberTypeList = []; - var memberTypes = ts.createMap(); + var memberTypes = []; for (var _i = 0, _a = enumType.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 229) { + if (declaration.kind === 231) { computeEnumMemberValues(declaration); for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; @@ -22654,7 +24589,7 @@ var ts; if (memberTypeList.length > 1) { enumType.flags |= 65536; enumType.types = memberTypeList; - unionTypes[getTypeListId(memberTypeList)] = enumType; + unionTypes.set(getTypeListId(memberTypeList), enumType); } } } @@ -22675,9 +24610,6 @@ var ts; if (!links.declaredType) { var type = createType(16384); type.symbol = symbol; - if (!ts.getDeclarationOfKind(symbol, 143).constraint) { - type.constraint = noConstraintType; - } links.declaredType = type; } return links.declaredType; @@ -22690,7 +24622,6 @@ var ts; return links.declaredType; } function getDeclaredTypeOfSymbol(symbol) { - ts.Debug.assert((symbol.flags & 16777216) === 0); if (symbol.flags & (32 | 64)) { return getDeclaredTypeOfClassOrInterface(symbol); } @@ -22725,19 +24656,20 @@ var ts; function isIndependentType(node) { switch (node.kind) { case 118: - case 134: + case 135: case 132: case 121: - case 135: + case 136: + case 133: case 104: - case 137: + case 138: case 94: case 129: - case 171: + case 172: return true; - case 162: + case 163: return isIndependentType(node.elementType); - case 157: + case 158: return isIndependentTypeReference(node); } return false; @@ -22746,7 +24678,7 @@ var ts; return node.type && isIndependentType(node.type) || !node.type && !node.initializer; } function isIndependentFunctionLikeDeclaration(node) { - if (node.kind !== 150 && (!node.type || !isIndependentType(node.type))) { + if (node.kind !== 151 && (!node.type || !isIndependentType(node.type))) { return false; } for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { @@ -22762,12 +24694,12 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 147: - case 146: - return isIndependentVariableLikeDeclaration(declaration); - case 149: case 148: + case 147: + return isIndependentVariableLikeDeclaration(declaration); case 150: + case 149: + case 151: return isIndependentFunctionLikeDeclaration(declaration); } } @@ -22778,7 +24710,7 @@ var ts; var result = ts.createMap(); for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) { var symbol = symbols_1[_i]; - result[symbol.name] = symbol; + result.set(symbol.name, symbol); } return result; } @@ -22786,15 +24718,15 @@ var ts; var result = ts.createMap(); for (var _i = 0, symbols_2 = symbols; _i < symbols_2.length; _i++) { var symbol = symbols_2[_i]; - result[symbol.name] = mappingThisOnly && isIndependentMember(symbol) ? symbol : instantiateSymbol(symbol, mapper); + result.set(symbol.name, mappingThisOnly && isIndependentMember(symbol) ? symbol : instantiateSymbol(symbol, mapper)); } return result; } function addInheritedMembers(symbols, baseSymbols) { for (var _i = 0, baseSymbols_1 = baseSymbols; _i < baseSymbols_1.length; _i++) { var s = baseSymbols_1[_i]; - if (!symbols[s.name]) { - symbols[s.name] = s; + if (!symbols.has(s.name)) { + symbols.set(s.name, s); } } } @@ -22802,8 +24734,8 @@ var ts; if (!type.declaredProperties) { var symbol = type.symbol; type.declaredProperties = getNamedMembers(symbol.members); - type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); - type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); + type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members.get("__call")); + type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members.get("__new")); type.declaredStringIndexInfo = getIndexInfoOfSymbol(symbol, 0); type.declaredNumberIndexInfo = getIndexInfoOfSymbol(symbol, 1); } @@ -22811,7 +24743,14 @@ var ts; } function getTypeWithThisArgument(type, thisArgument) { if (getObjectFlags(type) & 4) { - return createTypeReference(type.target, ts.concatenate(type.typeArguments, [thisArgument || type.target.thisType])); + var target = type.target; + var typeArguments = type.typeArguments; + if (ts.length(target.typeParameters) === ts.length(typeArguments)) { + return createTypeReference(target, ts.concatenate(typeArguments, [thisArgument || target.thisType])); + } + } + else if (type.flags & 131072) { + return getIntersectionType(ts.map(type.types, function (t) { return getTypeWithThisArgument(t, thisArgument); })); } return type; } @@ -22847,10 +24786,14 @@ var ts; for (var _i = 0, baseTypes_1 = baseTypes; _i < baseTypes_1.length; _i++) { var baseType = baseTypes_1[_i]; var instantiatedBaseType = thisArgument ? getTypeWithThisArgument(instantiateType(baseType, mapper), thisArgument) : baseType; - addInheritedMembers(members, getPropertiesOfObjectType(instantiatedBaseType)); + addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType)); callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0)); constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1)); - stringIndexInfo = stringIndexInfo || getIndexInfoOfType(instantiatedBaseType, 0); + if (!stringIndexInfo) { + stringIndexInfo = instantiatedBaseType === anyType ? + createIndexInfo(anyType, false) : + getIndexInfoOfType(instantiatedBaseType, 0); + } numberIndexInfo = numberIndexInfo || getIndexInfoOfType(instantiatedBaseType, 1); } } @@ -22889,14 +24832,16 @@ var ts; return [createSignature(undefined, classType.localTypeParameters, undefined, emptyArray, classType, undefined, 0, false, false)]; } var baseTypeNode = getBaseTypeNodeOfClass(classType); + var isJavaScript = ts.isInJavaScriptFile(baseTypeNode); var typeArguments = ts.map(baseTypeNode.typeArguments, getTypeFromTypeNode); - var typeArgCount = typeArguments ? typeArguments.length : 0; + var typeArgCount = ts.length(typeArguments); var result = []; for (var _i = 0, baseSignatures_1 = baseSignatures; _i < baseSignatures_1.length; _i++) { var baseSig = baseSignatures_1[_i]; - var typeParamCount = baseSig.typeParameters ? baseSig.typeParameters.length : 0; - if (typeParamCount === typeArgCount) { - var sig = typeParamCount ? createSignatureInstantiation(baseSig, typeArguments) : cloneSignature(baseSig); + var minTypeArgumentCount = getMinTypeArgumentCount(baseSig.typeParameters); + var typeParamCount = ts.length(baseSig.typeParameters); + if ((isJavaScript || typeArgCount >= minTypeArgumentCount) && typeArgCount <= typeParamCount) { + var sig = typeParamCount ? createSignatureInstantiation(baseSig, fillMissingTypeArguments(typeArguments, baseSig.typeParameters, minTypeArgumentCount, baseTypeNode)) : cloneSignature(baseSig); sig.typeParameters = classType.localTypeParameters; sig.resolvedReturnType = classType; result.push(sig); @@ -22950,7 +24895,7 @@ var ts; s = cloneSignature(signature); if (ts.forEach(unionSignatures, function (sig) { return sig.thisParameter; })) { var thisType = getUnionType(ts.map(unionSignatures, function (sig) { return getTypeOfSymbol(sig.thisParameter) || anyType; }), true); - s.thisParameter = createTransientSymbol(signature.thisParameter, thisType); + s.thisParameter = createSymbolWithType(signature.thisParameter, thisType); } s.resolvedReturnType = undefined; s.unionSignatures = unionSignatures; @@ -22965,8 +24910,8 @@ var ts; function getUnionIndexInfo(types, kind) { var indexTypes = []; var isAnyReadonly = false; - for (var _i = 0, types_1 = types; _i < types_1.length; _i++) { - var type = types_1[_i]; + for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { + var type = types_2[_i]; var indexInfo = getIndexInfoOfType(type, kind); if (!indexInfo) { return undefined; @@ -22992,17 +24937,44 @@ var ts; function unionSpreadIndexInfos(info1, info2) { return info1 && info2 && createIndexInfo(getUnionType([info1.type, info2.type]), info1.isReadonly || info2.isReadonly); } + function includeMixinType(type, types, index) { + var mixedTypes = []; + for (var i = 0; i < types.length; i++) { + if (i === index) { + mixedTypes.push(type); + } + else if (isMixinConstructorType(types[i])) { + mixedTypes.push(getReturnTypeOfSignature(getSignaturesOfType(types[i], 1)[0])); + } + } + return getIntersectionType(mixedTypes); + } function resolveIntersectionTypeMembers(type) { var callSignatures = emptyArray; var constructSignatures = emptyArray; - var stringIndexInfo = undefined; - var numberIndexInfo = undefined; - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var t = _a[_i]; + var stringIndexInfo; + var numberIndexInfo; + var types = type.types; + var mixinCount = ts.countWhere(types, isMixinConstructorType); + var _loop_3 = function (i) { + var t = type.types[i]; + if (mixinCount === 0 || mixinCount === types.length && i === 0 || !isMixinConstructorType(t)) { + var signatures = getSignaturesOfType(t, 1); + if (signatures.length && mixinCount > 0) { + signatures = ts.map(signatures, function (s) { + var clone = cloneSignature(s); + clone.resolvedReturnType = includeMixinType(getReturnTypeOfSignature(s), types, i); + return clone; + }); + } + constructSignatures = ts.concatenate(constructSignatures, signatures); + } callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(t, 0)); - constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(t, 1)); stringIndexInfo = intersectIndexInfos(stringIndexInfo, getIndexInfoOfType(t, 0)); numberIndexInfo = intersectIndexInfos(numberIndexInfo, getIndexInfoOfType(t, 1)); + }; + for (var i = 0; i < types.length; i++) { + _loop_3(i); } setStructuredTypeMembers(type, emptySymbols, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo); } @@ -23018,8 +24990,8 @@ var ts; } else if (symbol.flags & 2048) { var members = symbol.members; - var callSignatures = getSignaturesOfSymbol(members["__call"]); - var constructSignatures = getSignaturesOfSymbol(members["__new"]); + var callSignatures = getSignaturesOfSymbol(members.get("__call")); + var constructSignatures = getSignaturesOfSymbol(members.get("__new")); var stringIndexInfo = getIndexInfoOfSymbol(symbol, 0); var numberIndexInfo = getIndexInfoOfSymbol(symbol, 1); setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo); @@ -23027,23 +24999,27 @@ var ts; else { var members = emptySymbols; var constructSignatures = emptyArray; - if (symbol.flags & 1952) { + var stringIndexInfo = undefined; + if (symbol.exports) { members = getExportsOfSymbol(symbol); } if (symbol.flags & 32) { var classType = getDeclaredTypeOfClassOrInterface(symbol); - constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); + constructSignatures = getSignaturesOfSymbol(symbol.members.get("__constructor")); if (!constructSignatures.length) { constructSignatures = getDefaultConstructSignatures(classType); } var baseConstructorType = getBaseConstructorTypeOfClass(classType); - if (baseConstructorType.flags & 32768) { + if (baseConstructorType.flags & (32768 | 131072 | 540672)) { members = createSymbolTable(getNamedMembers(members)); - addInheritedMembers(members, getPropertiesOfObjectType(baseConstructorType)); + addInheritedMembers(members, getPropertiesOfType(baseConstructorType)); + } + else if (baseConstructorType === anyType) { + stringIndexInfo = createIndexInfo(anyType, false); } } var numberIndexInfo = symbol.flags & 384 ? enumNumberIndexInfo : undefined; - setStructuredTypeMembers(type, members, emptyArray, constructSignatures, undefined, numberIndexInfo); + setStructuredTypeMembers(type, members, emptyArray, constructSignatures, stringIndexInfo, numberIndexInfo); if (symbol.flags & (16 | 8192)) { type.callSignatures = getSignaturesOfSymbol(symbol); } @@ -23052,37 +25028,48 @@ var ts; function resolveMappedTypeMembers(type) { var members = ts.createMap(); var stringIndexInfo; - var numberIndexInfo; setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, undefined, undefined); var typeParameter = getTypeParameterFromMappedType(type); var constraintType = getConstraintTypeFromMappedType(type); var templateType = getTemplateTypeFromMappedType(type); - var isReadonly = !!type.declaration.readonlyToken; - var isOptional = !!type.declaration.questionToken; - var keyType = constraintType.flags & 16384 ? getApparentType(constraintType) : constraintType; - var iterationType = keyType.flags & 262144 ? getIndexType(getApparentType(keyType.type)) : keyType; - forEachType(iterationType, function (t) { - var iterationMapper = createUnaryTypeMapper(typeParameter, t); + var modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); + var templateReadonly = !!type.declaration.readonlyToken; + var templateOptional = !!type.declaration.questionToken; + if (type.declaration.typeParameter.constraint.kind === 169) { + for (var _i = 0, _a = getPropertiesOfType(modifiersType); _i < _a.length; _i++) { + var propertySymbol = _a[_i]; + addMemberForKeyType(getLiteralTypeFromPropertyName(propertySymbol), propertySymbol); + } + if (getIndexInfoOfType(modifiersType, 0)) { + addMemberForKeyType(stringType); + } + } + else { + var keyType = constraintType.flags & 540672 ? getApparentType(constraintType) : constraintType; + var iterationType = keyType.flags & 262144 ? getIndexType(getApparentType(keyType.type)) : keyType; + forEachType(iterationType, addMemberForKeyType); + } + setStructuredTypeMembers(type, members, emptyArray, emptyArray, stringIndexInfo, undefined); + function addMemberForKeyType(t, propertySymbol) { + var iterationMapper = createTypeMapper([typeParameter], [t]); var templateMapper = type.mapper ? combineTypeMappers(type.mapper, iterationMapper) : iterationMapper; var propType = instantiateType(templateType, templateMapper); - if (t.flags & (32 | 64 | 256)) { + if (t.flags & 32) { var propName = t.text; - var prop = createSymbol(4 | 67108864 | (isOptional ? 536870912 : 0), propName); - prop.type = addOptionality(propType, isOptional); - prop.isReadonly = isReadonly; - members[propName] = prop; + var modifiersProp = getPropertyOfType(modifiersType, propName); + var isOptional = templateOptional || !!(modifiersProp && modifiersProp.flags & 67108864); + var prop = createSymbol(4 | (isOptional ? 67108864 : 0), propName); + prop.checkFlags = templateReadonly || modifiersProp && isReadonlySymbol(modifiersProp) ? 8 : 0; + prop.type = propType; + if (propertySymbol) { + prop.syntheticOrigin = propertySymbol; + } + members.set(propName, prop); } else if (t.flags & 2) { - stringIndexInfo = createIndexInfo(propType, isReadonly); + stringIndexInfo = createIndexInfo(propType, templateReadonly); } - else if (t.flags & 4) { - numberIndexInfo = createIndexInfo(propType, isReadonly); - } - }); - if (stringIndexInfo && numberIndexInfo && isTypeIdenticalTo(stringIndexInfo.type, numberIndexInfo.type)) { - numberIndexInfo = undefined; } - setStructuredTypeMembers(type, members, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo); } function getTypeParameterFromMappedType(type) { return type.typeParameter || @@ -23095,16 +25082,28 @@ var ts; function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? - instantiateType(getTypeFromTypeNode(type.declaration.type), type.mapper || identityMapper) : + instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!type.declaration.questionToken), type.mapper || identityMapper) : unknownType); } - function getErasedTemplateTypeFromMappedType(type) { - return instantiateType(getTemplateTypeFromMappedType(type), createUnaryTypeMapper(getTypeParameterFromMappedType(type), anyType)); + function getModifiersTypeFromMappedType(type) { + if (!type.modifiersType) { + var constraintDeclaration = type.declaration.typeParameter.constraint; + if (constraintDeclaration.kind === 169) { + type.modifiersType = instantiateType(getTypeFromTypeNode(constraintDeclaration.type), type.mapper || identityMapper); + } + else { + var declaredType = getTypeFromMappedTypeNode(type.declaration); + var constraint = getConstraintTypeFromMappedType(declaredType); + var extendedConstraint = constraint && constraint.flags & 16384 ? getConstraintOfTypeParameter(constraint) : constraint; + type.modifiersType = extendedConstraint && extendedConstraint.flags & 262144 ? instantiateType(extendedConstraint.type, type.mapper || identityMapper) : emptyObjectType; + } + } + return type.modifiersType; } function isGenericMappedType(type) { if (getObjectFlags(type) & 32) { var constraintType = getConstraintTypeFromMappedType(type); - return !!(constraintType.flags & (16384 | 262144)); + return maybeTypeOfKind(constraintType, 540672 | 262144); } return false; } @@ -23142,35 +25141,33 @@ var ts; function getPropertyOfObjectType(type, name) { if (type.flags & 32768) { var resolved = resolveStructuredTypeMembers(type); - var symbol = resolved.members[name]; + var symbol = resolved.members.get(name); if (symbol && symbolIsValue(symbol)) { return symbol; } } } function getPropertiesOfUnionOrIntersectionType(type) { - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var current = _a[_i]; - for (var _b = 0, _c = getPropertiesOfType(current); _b < _c.length; _b++) { - var prop = _c[_b]; - getUnionOrIntersectionProperty(type, prop.name); - } - if (type.flags & 65536) { - break; - } - } - var props = type.resolvedProperties; - if (props) { - var result = []; - for (var key in props) { - var prop = props[key]; - if (!(prop.flags & 268435456 && prop.isPartial)) { - result.push(prop); + if (!type.resolvedProperties) { + var members = ts.createMap(); + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var current = _a[_i]; + for (var _b = 0, _c = getPropertiesOfType(current); _b < _c.length; _b++) { + var prop = _c[_b]; + if (!members.has(prop.name)) { + var combinedProp = getPropertyOfUnionOrIntersectionType(type, prop.name); + if (combinedProp) { + members.set(prop.name, combinedProp); + } + } + } + if (type.flags & 65536) { + break; } } - return result; + type.resolvedProperties = getNamedMembers(members); } - return emptyArray; + return type.resolvedProperties; } function getPropertiesOfType(type) { type = getApparentType(type); @@ -23178,41 +25175,126 @@ var ts; getPropertiesOfUnionOrIntersectionType(type) : getPropertiesOfObjectType(type); } - function getApparentTypeOfTypeParameter(type) { - if (!type.resolvedApparentType) { - var constraintType = getConstraintOfTypeParameter(type); - while (constraintType && constraintType.flags & 16384) { - constraintType = getConstraintOfTypeParameter(constraintType); - } - type.resolvedApparentType = getTypeWithThisArgument(constraintType || emptyObjectType, type); - } - return type.resolvedApparentType; + function getConstraintOfType(type) { + return type.flags & 16384 ? getConstraintOfTypeParameter(type) : + type.flags & 524288 ? getConstraintOfIndexedAccess(type) : + getBaseConstraintOfType(type); } - function getApparentTypeOfIndexedAccess(type) { - return getIndexTypeOfType(getApparentType(type.objectType), 0) || type; + function getConstraintOfTypeParameter(typeParameter) { + return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : undefined; + } + function getConstraintOfIndexedAccess(type) { + var baseObjectType = getBaseConstraintOfType(type.objectType); + var baseIndexType = getBaseConstraintOfType(type.indexType); + return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined; + } + function getBaseConstraintOfType(type) { + if (type.flags & (540672 | 196608)) { + var constraint = getResolvedBaseConstraint(type); + if (constraint !== noConstraintType && constraint !== circularConstraintType) { + return constraint; + } + } + else if (type.flags & 262144) { + return stringType; + } + return undefined; + } + function hasNonCircularBaseConstraint(type) { + return getResolvedBaseConstraint(type) !== circularConstraintType; + } + function getResolvedBaseConstraint(type) { + var typeStack; + var circular; + if (!type.resolvedBaseConstraint) { + typeStack = []; + var constraint = getBaseConstraint(type); + type.resolvedBaseConstraint = circular ? circularConstraintType : getTypeWithThisArgument(constraint || noConstraintType, type); + } + return type.resolvedBaseConstraint; + function getBaseConstraint(t) { + if (ts.contains(typeStack, t)) { + circular = true; + return undefined; + } + typeStack.push(t); + var result = computeBaseConstraint(t); + typeStack.pop(); + return result; + } + function computeBaseConstraint(t) { + if (t.flags & 16384) { + var constraint = getConstraintFromTypeParameter(t); + return t.isThisType ? constraint : + constraint ? getBaseConstraint(constraint) : undefined; + } + if (t.flags & 196608) { + var types = t.types; + var baseTypes = []; + for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { + var type_2 = types_3[_i]; + var baseType = getBaseConstraint(type_2); + if (baseType) { + baseTypes.push(baseType); + } + } + return t.flags & 65536 && baseTypes.length === types.length ? getUnionType(baseTypes) : + t.flags & 131072 && baseTypes.length ? getIntersectionType(baseTypes) : + undefined; + } + if (t.flags & 262144) { + return stringType; + } + if (t.flags & 524288) { + var baseObjectType = getBaseConstraint(t.objectType); + var baseIndexType = getBaseConstraint(t.indexType); + var baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined; + return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined; + } + return t; + } + } + function getApparentTypeOfIntersectionType(type) { + return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument(type, type)); + } + function getDefaultFromTypeParameter(typeParameter) { + if (!typeParameter.default) { + if (typeParameter.target) { + var targetDefault = getDefaultFromTypeParameter(typeParameter.target); + typeParameter.default = targetDefault ? instantiateType(targetDefault, typeParameter.mapper) : noConstraintType; + } + else { + var defaultDeclaration = typeParameter.symbol && ts.forEach(typeParameter.symbol.declarations, function (decl) { return ts.isTypeParameter(decl) && decl.default; }); + typeParameter.default = defaultDeclaration ? getTypeFromTypeNode(defaultDeclaration) : noConstraintType; + } + } + return typeParameter.default === noConstraintType ? undefined : typeParameter.default; } function getApparentType(type) { - var t = type.flags & 16384 ? getApparentTypeOfTypeParameter(type) : - type.flags & 524288 ? getApparentTypeOfIndexedAccess(type) : - type; - return t.flags & 262178 ? globalStringType : - t.flags & 340 ? globalNumberType : - t.flags & 136 ? globalBooleanType : - t.flags & 512 ? getGlobalESSymbolType() : - t; + var t = type.flags & 540672 ? getBaseConstraintOfType(type) || emptyObjectType : type; + return t.flags & 131072 ? getApparentTypeOfIntersectionType(t) : + t.flags & 262178 ? globalStringType : + t.flags & 340 ? globalNumberType : + t.flags & 136 ? globalBooleanType : + t.flags & 512 ? getGlobalESSymbolType(languageVersion >= 2) : + t.flags & 16777216 ? emptyObjectType : + t; } function createUnionOrIntersectionProperty(containingType, name) { - var types = containingType.types; var props; - var commonFlags = (containingType.flags & 131072) ? 536870912 : 0; - var isReadonly = false; - var isPartial = false; - for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { - var current = types_2[_i]; + var types = containingType.types; + var isUnion = containingType.flags & 65536; + var excludeModifiers = isUnion ? 24 : 0; + var commonFlags = isUnion ? 0 : 67108864; + var syntheticFlag = 4; + var checkFlags = 0; + for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { + var current = types_4[_i]; var type = getApparentType(current); if (type !== unknownType) { var prop = getPropertyOfType(type, name); - if (prop && !(getDeclarationModifierFlagsFromSymbol(prop) & (8 | 16))) { + var modifiers = prop ? getDeclarationModifierFlagsFromSymbol(prop) : 0; + if (prop && !(modifiers & excludeModifiers)) { commonFlags &= prop.flags; if (!props) { props = [prop]; @@ -23220,25 +25302,29 @@ var ts; else if (!ts.contains(props, prop)) { props.push(prop); } - if (isReadonlySymbol(prop)) { - isReadonly = true; + checkFlags |= (isReadonlySymbol(prop) ? 8 : 0) | + (!(modifiers & 24) ? 64 : 0) | + (modifiers & 16 ? 128 : 0) | + (modifiers & 8 ? 256 : 0) | + (modifiers & 32 ? 512 : 0); + if (!isMethodLike(prop)) { + syntheticFlag = 2; } } - else if (containingType.flags & 65536) { - isPartial = true; + else if (isUnion) { + checkFlags |= 16; } } } if (!props) { return undefined; } - if (props.length === 1 && !isPartial) { + if (props.length === 1 && !(checkFlags & 16)) { return props[0]; } var propTypes = []; var declarations = []; var commonType = undefined; - var hasNonUniformType = false; for (var _a = 0, props_1 = props; _a < props_1.length; _a++) { var prop = props_1[_a]; if (prop.declarations) { @@ -23249,39 +25335,37 @@ var ts; commonType = type; } else if (type !== commonType) { - hasNonUniformType = true; + checkFlags |= 32; } propTypes.push(type); } - var result = createSymbol(4 | 67108864 | 268435456 | commonFlags, name); + var result = createSymbol(4 | commonFlags, name); + result.checkFlags = syntheticFlag | checkFlags; result.containingType = containingType; - result.hasNonUniformType = hasNonUniformType; - result.isPartial = isPartial; result.declarations = declarations; - result.isReadonly = isReadonly; - result.type = containingType.flags & 65536 ? getUnionType(propTypes) : getIntersectionType(propTypes); + result.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes); return result; } function getUnionOrIntersectionProperty(type, name) { - var properties = type.resolvedProperties || (type.resolvedProperties = ts.createMap()); - var property = properties[name]; + var properties = type.propertyCache || (type.propertyCache = ts.createMap()); + var property = properties.get(name); if (!property) { property = createUnionOrIntersectionProperty(type, name); if (property) { - properties[name] = property; + properties.set(name, property); } } return property; } function getPropertyOfUnionOrIntersectionType(type, name) { var property = getUnionOrIntersectionProperty(type, name); - return property && !(property.flags & 268435456 && property.isPartial) ? property : undefined; + return property && !(getCheckFlags(property) & 16) ? property : undefined; } function getPropertyOfType(type, name) { type = getApparentType(type); if (type.flags & 32768) { var resolved = resolveStructuredTypeMembers(type); - var symbol = resolved.members[name]; + var symbol = resolved.members.get(name); if (symbol && symbolIsValue(symbol)) { return symbol; } @@ -23340,7 +25424,7 @@ var ts; return undefined; } function getTypeParametersFromJSDocTemplate(declaration) { - if (declaration.flags & 2097152) { + if (declaration.flags & 65536) { var templateTag = ts.getJSDocTemplateTag(declaration); if (templateTag) { return getTypeParametersFromDeclaration(templateTag.typeParameters); @@ -23360,16 +25444,16 @@ var ts; } function symbolsToArray(symbols) { var result = []; - for (var id in symbols) { + symbols.forEach(function (symbol, id) { if (!isReservedMemberName(id)) { - result.push(symbols[id]); + result.push(symbol); } - } + }); return result; } function isJSDocOptionalParameter(node) { - if (node.flags & 2097152) { - if (node.type && node.type.kind === 273) { + if (node.flags & 65536) { + if (node.type && node.type.kind === 277) { return true; } var paramTags = ts.getJSDocParameterTags(node); @@ -23380,7 +25464,7 @@ var ts; return true; } if (paramTag.typeExpression) { - return paramTag.typeExpression.type.kind === 273; + return paramTag.typeExpression.type.kind === 277; } } } @@ -23404,6 +25488,12 @@ var ts; ts.Debug.assert(parameterIndex >= 0); return parameterIndex >= signature.minArgumentCount; } + var iife = ts.getImmediatelyInvokedFunctionExpression(node.parent); + if (iife) { + return !node.type && + !node.dotDotDotToken && + ts.indexOf(node.parent.parameters, node) >= iife.arguments.length; + } return false; } function createTypePredicateFromTypePredicateNode(node) { @@ -23423,16 +25513,50 @@ var ts; }; } } + function getMinTypeArgumentCount(typeParameters) { + var minTypeArgumentCount = 0; + if (typeParameters) { + for (var i = 0; i < typeParameters.length; i++) { + if (!getDefaultFromTypeParameter(typeParameters[i])) { + minTypeArgumentCount = i + 1; + } + } + } + return minTypeArgumentCount; + } + function fillMissingTypeArguments(typeArguments, typeParameters, minTypeArgumentCount, location) { + var numTypeParameters = ts.length(typeParameters); + if (numTypeParameters) { + var numTypeArguments = ts.length(typeArguments); + var isJavaScript = ts.isInJavaScriptFile(location); + if ((isJavaScript || numTypeArguments >= minTypeArgumentCount) && numTypeArguments <= numTypeParameters) { + if (!typeArguments) { + typeArguments = []; + } + for (var i = numTypeArguments; i < numTypeParameters; i++) { + typeArguments[i] = isJavaScript ? anyType : emptyObjectType; + } + for (var i = numTypeArguments; i < numTypeParameters; i++) { + var mapper = createTypeMapper(typeParameters, typeArguments); + var defaultType = getDefaultFromTypeParameter(typeParameters[i]); + typeArguments[i] = defaultType ? instantiateType(defaultType, mapper) : isJavaScript ? anyType : emptyObjectType; + } + } + } + return typeArguments; + } function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { var parameters = []; var hasLiteralTypes = false; - var minArgumentCount = -1; + var minArgumentCount = 0; var thisParameter = undefined; var hasThisParameter = void 0; + var iife = ts.getImmediatelyInvokedFunctionExpression(declaration); var isJSConstructSignature = ts.isJSDocConstructSignature(declaration); - for (var i = isJSConstructSignature ? 1 : 0, n = declaration.parameters.length; i < n; i++) { + var isUntypedSignatureInJSFile = !iife && !isJSConstructSignature && ts.isInJavaScriptFile(declaration) && !ts.hasJSDocParameterTags(declaration); + for (var i = isJSConstructSignature ? 1 : 0; i < declaration.parameters.length; i++) { var param = declaration.parameters[i]; var paramSymbol = param.symbol; if (paramSymbol && !!(paramSymbol.flags & 4) && !ts.isBindingPattern(param.name)) { @@ -23446,41 +25570,34 @@ var ts; else { parameters.push(paramSymbol); } - if (param.type && param.type.kind === 171) { + if (param.type && param.type.kind === 172) { hasLiteralTypes = true; } - if (param.initializer || param.questionToken || param.dotDotDotToken || isJSDocOptionalParameter(param)) { - if (minArgumentCount < 0) { - minArgumentCount = i - (hasThisParameter ? 1 : 0); - } - } - else { - minArgumentCount = -1; + var isOptionalParameter_1 = param.initializer || param.questionToken || param.dotDotDotToken || + iife && parameters.length > iife.arguments.length && !param.type || + isJSDocOptionalParameter(param) || + isUntypedSignatureInJSFile; + if (!isOptionalParameter_1) { + minArgumentCount = parameters.length; } } - if ((declaration.kind === 151 || declaration.kind === 152) && + if ((declaration.kind === 152 || declaration.kind === 153) && !ts.hasDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 151 ? 152 : 151; + var otherKind = declaration.kind === 152 ? 153 : 152; var other = ts.getDeclarationOfKind(declaration.symbol, otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - if (minArgumentCount < 0) { - minArgumentCount = declaration.parameters.length - (hasThisParameter ? 1 : 0); - } - if (isJSConstructSignature) { - minArgumentCount--; - } - var classType = declaration.kind === 150 ? + var classType = declaration.kind === 151 ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : getTypeParametersFromJSDocTemplate(declaration); var returnType = getSignatureReturnTypeFromDeclaration(declaration, isJSConstructSignature, classType); - var typePredicate = declaration.type && declaration.type.kind === 156 ? + var typePredicate = declaration.type && declaration.type.kind === 157 ? createTypePredicateFromTypePredicateNode(declaration.type) : undefined; links.resolvedSignature = createSignature(declaration, typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, ts.hasRestParameter(declaration), hasLiteralTypes); @@ -23497,41 +25614,69 @@ var ts; else if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.flags & 2097152) { + if (declaration.flags & 65536) { var type = getReturnTypeFromJSDocComment(declaration); if (type && type !== unknownType) { return type; } } - if (declaration.kind === 151 && !ts.hasDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(declaration.symbol, 152); + if (declaration.kind === 152 && !ts.hasDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(declaration.symbol, 153); return getAnnotatedAccessorType(setter); } if (ts.nodeIsMissing(declaration.body)) { return anyType; } } + function containsArgumentsReference(declaration) { + var links = getNodeLinks(declaration); + if (links.containsArgumentsReference === undefined) { + if (links.flags & 8192) { + links.containsArgumentsReference = true; + } + else { + links.containsArgumentsReference = traverse(declaration.body); + } + } + return links.containsArgumentsReference; + function traverse(node) { + if (!node) + return false; + switch (node.kind) { + case 70: + return node.text === "arguments" && ts.isPartOfExpression(node); + case 148: + case 150: + case 152: + case 153: + return node.name.kind === 143 + && traverse(node.name); + default: + return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && ts.forEachChild(node, traverse); + } + } + } function getSignaturesOfSymbol(symbol) { if (!symbol) return emptyArray; var result = []; - for (var i = 0, len = symbol.declarations.length; i < len; i++) { + for (var i = 0; i < symbol.declarations.length; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 158: case 159: - case 225: - case 149: - case 148: + case 160: + case 227: case 150: - case 153: + case 149: + case 151: case 154: case 155: - case 151: + case 156: case 152: - case 184: + case 153: case 185: - case 274: + case 186: + case 278: if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -23575,7 +25720,7 @@ var ts; } if (!popTypeResolution()) { type = anyType; - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { var declaration = signature.declaration; if (declaration.name) { error(declaration.name, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, ts.declarationNameToString(declaration.name)); @@ -23599,9 +25744,14 @@ var ts; return anyType; } function getSignatureInstantiation(signature, typeArguments) { + typeArguments = fillMissingTypeArguments(typeArguments, signature.typeParameters, getMinTypeArgumentCount(signature.typeParameters)); var instantiations = signature.instantiations || (signature.instantiations = ts.createMap()); var id = getTypeListId(typeArguments); - return instantiations[id] || (instantiations[id] = createSignatureInstantiation(signature, typeArguments)); + var instantiation = instantiations.get(id); + if (!instantiation) { + instantiations.set(id, instantiation = createSignatureInstantiation(signature, typeArguments)); + } + return instantiation; } function createSignatureInstantiation(signature, typeArguments) { return instantiateSignature(signature, createTypeMapper(signature.typeParameters, typeArguments), true); @@ -23616,7 +25766,7 @@ var ts; } function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 150 || signature.declaration.kind === 154; + var isConstructor = signature.declaration.kind === 151 || signature.declaration.kind === 155; var type = createObjectType(16); type.members = emptySymbols; type.properties = emptyArray; @@ -23627,10 +25777,10 @@ var ts; return signature.isolatedSignatureType; } function getIndexSymbol(symbol) { - return symbol.members["__index"]; + return symbol.members.get("__index"); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 ? 132 : 134; + var syntaxKind = kind === 1 ? 132 : 135; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -23657,21 +25807,9 @@ var ts; return undefined; } function getConstraintDeclaration(type) { - return ts.getDeclarationOfKind(type.symbol, 143).constraint; + return ts.getDeclarationOfKind(type.symbol, 144).constraint; } - function hasConstraintReferenceTo(type, target) { - var checked; - while (type && type.flags & 16384 && !(type.isThisType) && !ts.contains(checked, type)) { - if (type === target) { - return true; - } - (checked || (checked = [])).push(type); - var constraintDeclaration = getConstraintDeclaration(type); - type = constraintDeclaration && getTypeFromTypeNode(constraintDeclaration); - } - return false; - } - function getConstraintOfTypeParameter(typeParameter) { + function getConstraintFromTypeParameter(typeParameter) { if (!typeParameter.constraint) { if (typeParameter.target) { var targetConstraint = getConstraintOfTypeParameter(typeParameter.target); @@ -23679,28 +25817,23 @@ var ts; } else { var constraintDeclaration = getConstraintDeclaration(typeParameter); - var constraint = getTypeFromTypeNode(constraintDeclaration); - if (hasConstraintReferenceTo(constraint, typeParameter)) { - error(constraintDeclaration, ts.Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(typeParameter)); - constraint = unknownType; - } - typeParameter.constraint = constraint; + typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : noConstraintType; } } return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 143).parent); + return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 144).parent); } function getTypeListId(types) { var result = ""; if (types) { - var length_3 = types.length; + var length_4 = types.length; var i = 0; - while (i < length_3) { + while (i < length_4) { var startId = types[i].id; var count = 1; - while (i + count < length_3 && types[i + count].id === startId + count) { + while (i + count < length_4 && types[i + count].id === startId + count) { count++; } if (result.length) { @@ -23717,8 +25850,8 @@ var ts; } function getPropagatingFlagsOfTypes(types, excludeKinds) { var result = 0; - for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { - var type = types_3[_i]; + for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { + var type = types_5[_i]; if (!(type.flags & excludeKinds)) { result |= type.flags; } @@ -23727,9 +25860,10 @@ var ts; } function createTypeReference(target, typeArguments) { var id = getTypeListId(typeArguments); - var type = target.instantiations[id]; + var type = target.instantiations.get(id); if (!type) { - type = target.instantiations[id] = createObjectType(4, target.symbol); + type = createObjectType(4, target.symbol); + target.instantiations.set(id, type); type.flags |= typeArguments ? getPropagatingFlagsOfTypes(typeArguments, 0) : 0; type.target = target; type.typeArguments = typeArguments; @@ -23745,17 +25879,22 @@ var ts; return type; } function getTypeReferenceArity(type) { - return type.target.typeParameters ? type.target.typeParameters.length : 0; + return ts.length(type.target.typeParameters); } function getTypeFromClassOrInterfaceReference(node, symbol) { var type = getDeclaredTypeOfSymbol(getMergedSymbol(symbol)); var typeParameters = type.localTypeParameters; if (typeParameters) { - if (!node.typeArguments || node.typeArguments.length !== typeParameters.length) { - error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, undefined, 1), typeParameters.length); + var numTypeArguments = ts.length(node.typeArguments); + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + if (!ts.isInJavaScriptFile(node) && (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length)) { + error(node, minTypeArgumentCount === typeParameters.length + ? ts.Diagnostics.Generic_type_0_requires_1_type_argument_s + : ts.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments, typeToString(type, undefined, 1), minTypeArgumentCount, typeParameters.length); return unknownType; } - return createTypeReference(type, ts.concatenate(type.outerTypeParameters, ts.map(node.typeArguments, getTypeFromTypeNode))); + var typeArguments = ts.concatenate(type.outerTypeParameters, fillMissingTypeArguments(ts.map(node.typeArguments, getTypeFromTypeNode), typeParameters, minTypeArgumentCount, node)); + return createTypeReference(type, typeArguments); } if (node.typeArguments) { error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); @@ -23768,14 +25907,22 @@ var ts; var links = getSymbolLinks(symbol); var typeParameters = links.typeParameters; var id = getTypeListId(typeArguments); - return links.instantiations[id] || (links.instantiations[id] = instantiateTypeNoAlias(type, createTypeMapper(typeParameters, typeArguments))); + var instantiation = links.instantiations.get(id); + if (!instantiation) { + links.instantiations.set(id, instantiation = instantiateTypeNoAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters))))); + } + return instantiation; } function getTypeFromTypeAliasReference(node, symbol) { var type = getDeclaredTypeOfSymbol(symbol); var typeParameters = getSymbolLinks(symbol).typeParameters; if (typeParameters) { - if (!node.typeArguments || node.typeArguments.length !== typeParameters.length) { - error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, symbolToString(symbol), typeParameters.length); + var numTypeArguments = ts.length(node.typeArguments); + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + if (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length) { + error(node, minTypeArgumentCount === typeParameters.length + ? ts.Diagnostics.Generic_type_0_requires_1_type_argument_s + : ts.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments, symbolToString(symbol), minTypeArgumentCount, typeParameters.length); return unknownType; } var typeArguments = ts.map(node.typeArguments, getTypeFromTypeNode); @@ -23796,11 +25943,11 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 157: + case 158: return node.typeName; - case 272: + case 276: return node.name; - case 199: + case 200: var expr = node.expression; if (ts.isEntityNameExpression(expr)) { return expr; @@ -23824,23 +25971,58 @@ var ts; if (symbol.flags & 524288) { return getTypeFromTypeAliasReference(node, symbol); } - if (symbol.flags & 107455 && node.kind === 272) { + if (symbol.flags & 107455 && node.kind === 276) { return getTypeOfSymbol(symbol); } return getTypeFromNonGenericTypeReference(node, symbol); } + function getPrimitiveTypeFromJSDocTypeReference(node) { + if (ts.isIdentifier(node.name)) { + switch (node.name.text) { + case "String": + return stringType; + case "Number": + return numberType; + case "Boolean": + return booleanType; + case "Void": + return voidType; + case "Undefined": + return undefinedType; + case "Null": + return nullType; + case "Object": + return anyType; + case "Function": + return anyFunctionType; + case "Array": + case "array": + return !node.typeArguments || !node.typeArguments.length ? createArrayType(anyType) : undefined; + case "Promise": + case "promise": + return !node.typeArguments || !node.typeArguments.length ? createPromiseType(anyType) : undefined; + } + } + } + function getTypeFromJSDocNullableTypeNode(node) { + var type = getTypeFromTypeNode(node.type); + return strictNullChecks ? getUnionType([type, nullType]) : type; + } function getTypeFromTypeReference(node) { var links = getNodeLinks(node); if (!links.resolvedType) { var symbol = void 0; var type = void 0; - if (node.kind === 272) { - var typeReferenceName = getTypeReferenceName(node); - symbol = resolveTypeReferenceName(typeReferenceName); - type = getTypeReferenceType(node, symbol); + if (node.kind === 276) { + type = getPrimitiveTypeFromJSDocTypeReference(node); + if (!type) { + var typeReferenceName = getTypeReferenceName(node); + symbol = resolveTypeReferenceName(typeReferenceName); + type = getTypeReferenceType(node, symbol); + } } else { - var typeNameOrExpression = node.kind === 157 + var typeNameOrExpression = node.kind === 158 ? node.typeName : ts.isEntityNameExpression(node.expression) ? node.expression @@ -23866,12 +26048,12 @@ var ts; function getTypeOfGlobalSymbol(symbol, arity) { function getTypeDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { - var declaration = declarations_3[_i]; + for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { + var declaration = declarations_4[_i]; switch (declaration.kind) { - case 226: - case 227: + case 228: case 229: + case 231: return declaration; } } @@ -23884,44 +26066,91 @@ var ts; error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbol.name); return arity ? emptyGenericType : emptyObjectType; } - if ((type.typeParameters ? type.typeParameters.length : 0) !== arity) { + if (ts.length(type.typeParameters) !== arity) { error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_have_1_type_parameter_s, symbol.name, arity); return arity ? emptyGenericType : emptyObjectType; } return type; } - function getGlobalValueSymbol(name) { - return getGlobalSymbol(name, 107455, ts.Diagnostics.Cannot_find_global_value_0); + function getGlobalValueSymbol(name, reportErrors) { + return getGlobalSymbol(name, 107455, reportErrors ? ts.Diagnostics.Cannot_find_global_value_0 : undefined); } - function getGlobalTypeSymbol(name) { - return getGlobalSymbol(name, 793064, ts.Diagnostics.Cannot_find_global_type_0); + function getGlobalTypeSymbol(name, reportErrors) { + return getGlobalSymbol(name, 793064, reportErrors ? ts.Diagnostics.Cannot_find_global_type_0 : undefined); } function getGlobalSymbol(name, meaning, diagnostic) { return resolveName(undefined, name, meaning, diagnostic, name); } - function getGlobalType(name, arity) { + function getGlobalType(name, arity, reportErrors) { + var symbol = getGlobalTypeSymbol(name, reportErrors); + return symbol || reportErrors ? getTypeOfGlobalSymbol(symbol, arity) : undefined; + } + function getGlobalTypedPropertyDescriptorType() { + return deferredGlobalTypedPropertyDescriptorType || (deferredGlobalTypedPropertyDescriptorType = getGlobalType("TypedPropertyDescriptor", 1, true)) || emptyGenericType; + } + function getGlobalTemplateStringsArrayType() { + return deferredGlobalTemplateStringsArrayType || (deferredGlobalTemplateStringsArrayType = getGlobalType("TemplateStringsArray", 0, true)) || emptyObjectType; + } + function getGlobalESSymbolConstructorSymbol(reportErrors) { + return deferredGlobalESSymbolConstructorSymbol || (deferredGlobalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol", reportErrors)); + } + function getGlobalESSymbolType(reportErrors) { + return deferredGlobalESSymbolType || (deferredGlobalESSymbolType = getGlobalType("Symbol", 0, reportErrors)) || emptyObjectType; + } + function getGlobalPromiseType(reportErrors) { + return deferredGlobalPromiseType || (deferredGlobalPromiseType = getGlobalType("Promise", 1, reportErrors)) || emptyGenericType; + } + function getGlobalPromiseConstructorSymbol(reportErrors) { + return deferredGlobalPromiseConstructorSymbol || (deferredGlobalPromiseConstructorSymbol = getGlobalValueSymbol("Promise", reportErrors)); + } + function getGlobalPromiseConstructorLikeType(reportErrors) { + return deferredGlobalPromiseConstructorLikeType || (deferredGlobalPromiseConstructorLikeType = getGlobalType("PromiseConstructorLike", 0, reportErrors)) || emptyObjectType; + } + function getGlobalAsyncIterableType(reportErrors) { + return deferredGlobalAsyncIterableType || (deferredGlobalAsyncIterableType = getGlobalType("AsyncIterable", 1, reportErrors)) || emptyGenericType; + } + function getGlobalAsyncIteratorType(reportErrors) { + return deferredGlobalAsyncIteratorType || (deferredGlobalAsyncIteratorType = getGlobalType("AsyncIterator", 1, reportErrors)) || emptyGenericType; + } + function getGlobalAsyncIterableIteratorType(reportErrors) { + return deferredGlobalAsyncIterableIteratorType || (deferredGlobalAsyncIterableIteratorType = getGlobalType("AsyncIterableIterator", 1, reportErrors)) || emptyGenericType; + } + function getGlobalIterableType(reportErrors) { + return deferredGlobalIterableType || (deferredGlobalIterableType = getGlobalType("Iterable", 1, reportErrors)) || emptyGenericType; + } + function getGlobalIteratorType(reportErrors) { + return deferredGlobalIteratorType || (deferredGlobalIteratorType = getGlobalType("Iterator", 1, reportErrors)) || emptyGenericType; + } + function getGlobalIterableIteratorType(reportErrors) { + return deferredGlobalIterableIteratorType || (deferredGlobalIterableIteratorType = getGlobalType("IterableIterator", 1, reportErrors)) || emptyGenericType; + } + function getGlobalTypeOrUndefined(name, arity) { if (arity === void 0) { arity = 0; } - return getTypeOfGlobalSymbol(getGlobalTypeSymbol(name), arity); + var symbol = getGlobalSymbol(name, 793064, undefined); + return symbol && getTypeOfGlobalSymbol(symbol, arity); } function getExportedTypeFromNamespace(namespace, name) { var namespaceSymbol = getGlobalSymbol(namespace, 1920, undefined); var typeSymbol = namespaceSymbol && getSymbol(namespaceSymbol.exports, name, 793064); return typeSymbol && getDeclaredTypeOfSymbol(typeSymbol); } - function createTypedPropertyDescriptorType(propertyType) { - var globalTypedPropertyDescriptorType = getGlobalTypedPropertyDescriptorType(); - return globalTypedPropertyDescriptorType !== emptyGenericType - ? createTypeReference(globalTypedPropertyDescriptorType, [propertyType]) - : emptyObjectType; - } function createTypeFromGenericGlobalType(genericGlobalType, typeArguments) { return genericGlobalType !== emptyGenericType ? createTypeReference(genericGlobalType, typeArguments) : emptyObjectType; } - function createIterableType(elementType) { - return createTypeFromGenericGlobalType(getGlobalIterableType(), [elementType]); + function createTypedPropertyDescriptorType(propertyType) { + return createTypeFromGenericGlobalType(getGlobalTypedPropertyDescriptorType(), [propertyType]); } - function createIterableIteratorType(elementType) { - return createTypeFromGenericGlobalType(getGlobalIterableIteratorType(), [elementType]); + function createAsyncIterableType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalAsyncIterableType(true), [iteratedType]); + } + function createAsyncIterableIteratorType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalAsyncIterableIteratorType(true), [iteratedType]); + } + function createIterableType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalIterableType(true), [iteratedType]); + } + function createIterableIteratorType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalIterableIteratorType(true), [iteratedType]); } function createArrayType(elementType) { return createTypeFromGenericGlobalType(globalArrayType, [elementType]); @@ -23939,7 +26168,7 @@ var ts; for (var i = 0; i < arity; i++) { var typeParameter = createType(16384); typeParameters.push(typeParameter); - var property = createSymbol(4 | 67108864, "" + i); + var property = createSymbol(4, "" + i); property.type = typeParameter; properties.push(property); } @@ -23948,7 +26177,7 @@ var ts; type.outerTypeParameters = undefined; type.localTypeParameters = typeParameters; type.instantiations = ts.createMap(); - type.instantiations[getTypeListId(type.typeParameters)] = type; + type.instantiations.set(getTypeListId(type.typeParameters), type); type.target = type; type.typeArguments = type.typeParameters; type.thisType = createType(16384); @@ -24030,14 +26259,14 @@ var ts; } } function addTypesToUnion(typeSet, types) { - for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { - var type = types_4[_i]; + for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { + var type = types_6[_i]; addTypeToUnion(typeSet, type); } } function containsIdenticalType(types, type) { - for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { - var t = types_5[_i]; + for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { + var t = types_7[_i]; if (isTypeIdenticalTo(t, type)) { return true; } @@ -24045,8 +26274,9 @@ var ts; return false; } function isSubtypeOfAny(candidate, types) { - for (var i = 0, len = types.length; i < len; i++) { - if (candidate !== types[i] && isTypeSubtypeOf(candidate, types[i])) { + for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { + var type = types_8[_i]; + if (candidate !== type && isTypeSubtypeOf(candidate, type)) { return true; } } @@ -24124,10 +26354,11 @@ var ts; return types[0]; } var id = getTypeListId(types); - var type = unionTypes[id]; + var type = unionTypes.get(id); if (!type) { var propagatedFlags = getPropagatingFlagsOfTypes(types, 6144); - type = unionTypes[id] = createType(65536 | propagatedFlags); + type = createType(65536 | propagatedFlags); + unionTypes.set(id, type); type.types = types; type.aliasSymbol = aliasSymbol; type.aliasTypeArguments = aliasTypeArguments; @@ -24148,13 +26379,25 @@ var ts; else if (type.flags & 1) { typeSet.containsAny = true; } + else if (getObjectFlags(type) & 16 && isEmptyObjectType(type)) { + typeSet.containsEmptyObject = true; + } else if (!(type.flags & 8192) && (strictNullChecks || !(type.flags & 6144)) && !ts.contains(typeSet, type)) { - typeSet.push(type); + if (type.flags & 32768) { + typeSet.containsObjectType = true; + } + if (type.flags & 65536 && typeSet.unionIndex === undefined) { + typeSet.unionIndex = typeSet.length; + } + if (!(type.flags & 32768 && type.objectFlags & 16 && + type.symbol && type.symbol.flags & (16 | 8192) && containsIdenticalType(typeSet, type))) { + typeSet.push(type); + } } } function addTypesToIntersection(typeSet, types) { - for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { - var type = types_6[_i]; + for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { + var type = types_9[_i]; addTypeToIntersection(typeSet, type); } } @@ -24162,30 +26405,28 @@ var ts; if (types.length === 0) { return emptyObjectType; } - var _loop_2 = function (i) { - var type_1 = types[i]; - if (type_1.flags & 65536) { - return { value: getUnionType(ts.map(type_1.types, function (t) { return getIntersectionType(ts.replaceElement(types, i, t)); }), false, aliasSymbol, aliasTypeArguments) }; - } - }; - for (var i = 0; i < types.length; i++) { - var state_2 = _loop_2(i); - if (typeof state_2 === "object") - return state_2.value; - } var typeSet = []; addTypesToIntersection(typeSet, types); if (typeSet.containsAny) { return anyType; } + if (typeSet.containsEmptyObject && !typeSet.containsObjectType) { + typeSet.push(emptyObjectType); + } if (typeSet.length === 1) { return typeSet[0]; } + var unionIndex = typeSet.unionIndex; + if (unionIndex !== undefined) { + var unionType = typeSet[unionIndex]; + return getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex, t)); }), false, aliasSymbol, aliasTypeArguments); + } var id = getTypeListId(typeSet); - var type = intersectionTypes[id]; + var type = intersectionTypes.get(id); if (!type) { var propagatedFlags = getPropagatingFlagsOfTypes(typeSet, 6144); - type = intersectionTypes[id] = createType(131072 | propagatedFlags); + type = createType(131072 | propagatedFlags); + intersectionTypes.set(id, type); type.types = typeSet; type.aliasSymbol = aliasSymbol; type.aliasTypeArguments = aliasTypeArguments; @@ -24199,7 +26440,7 @@ var ts; } return links.resolvedType; } - function getIndexTypeForTypeParameter(type) { + function getIndexTypeForGenericType(type) { if (!type.resolvedIndexType) { type.resolvedIndexType = createType(262144); type.resolvedIndexType.type = type; @@ -24215,7 +26456,7 @@ var ts; return getUnionType(ts.map(getPropertiesOfType(type), getLiteralTypeFromPropertyName)); } function getIndexType(type) { - return type.flags & 16384 ? getIndexTypeForTypeParameter(type) : + return maybeTypeOfKind(type, 540672) ? getIndexTypeForGenericType(type) : getObjectFlags(type) & 32 ? getConstraintTypeFromMappedType(type) : type.flags & 1 || getIndexInfoOfType(type, 0) ? stringType : getLiteralTypeFromPropertyNames(type); @@ -24238,7 +26479,7 @@ var ts; return type; } function getPropertyTypeForIndexType(objectType, indexType, accessNode, cacheSymbol) { - var accessExpression = accessNode && accessNode.kind === 178 ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 179 ? accessNode : undefined; var propName = indexType.flags & (32 | 64 | 256) ? indexType.text : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, false) ? @@ -24267,14 +26508,14 @@ var ts; getIndexInfoOfType(objectType, 0) || undefined; if (indexInfo) { - if (accessExpression && ts.isAssignmentTarget(accessExpression) && indexInfo.isReadonly) { + if (accessExpression && indexInfo.isReadonly && (ts.isAssignmentTarget(accessExpression) || ts.isDeleteTarget(accessExpression))) { error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); return unknownType; } return indexInfo.type; } if (accessExpression && !isConstEnumObjectType(objectType)) { - if (compilerOptions.noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors) { + if (noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors) { if (getIndexTypeOfType(objectType, 1)) { error(accessExpression.argumentExpression, ts.Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number); } @@ -24286,7 +26527,7 @@ var ts; } } if (accessNode) { - var indexNode = accessNode.kind === 178 ? accessNode.argumentExpression : accessNode.indexType; + var indexNode = accessNode.kind === 179 ? accessNode.argumentExpression : accessNode.indexType; if (indexType.flags & (32 | 64)) { error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, indexType.text, typeToString(objectType)); } @@ -24296,34 +26537,36 @@ var ts; else { error(indexNode, ts.Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType)); } + return unknownType; } - return unknownType; + return anyType; } function getIndexedAccessForMappedType(type, indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 178 ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 179 ? accessNode : undefined; if (accessExpression && ts.isAssignmentTarget(accessExpression) && type.declaration.readonlyToken) { error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(type)); return unknownType; } - var mapper = createUnaryTypeMapper(getTypeParameterFromMappedType(type), indexType); + var mapper = createTypeMapper([getTypeParameterFromMappedType(type)], [indexType]); var templateMapper = type.mapper ? combineTypeMappers(type.mapper, mapper) : mapper; - return addOptionality(instantiateType(getTemplateTypeFromMappedType(type), templateMapper), !!type.declaration.questionToken); + return instantiateType(getTemplateTypeFromMappedType(type), templateMapper); } function getIndexedAccessType(objectType, indexType, accessNode) { - if (indexType.flags & 16384 || - objectType.flags & 16384 && indexType.flags & 262144 || + if (maybeTypeOfKind(indexType, 540672 | 262144) || + maybeTypeOfKind(objectType, 540672) && !(accessNode && accessNode.kind === 179) || isGenericMappedType(objectType)) { - if (accessNode) { - if (!isTypeAssignableTo(indexType, getIndexType(objectType))) { - error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); - return unknownType; - } + if (objectType.flags & 1) { + return objectType; } if (isGenericMappedType(objectType)) { return getIndexedAccessForMappedType(objectType, indexType, accessNode); } var id = objectType.id + "," + indexType.id; - return indexedAccessTypes[id] || (indexedAccessTypes[id] = createIndexedAccessType(objectType, indexType)); + var type = indexedAccessTypes.get(id); + if (!type) { + indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType)); + } + return type; } var apparentObjectType = getApparentType(objectType); if (indexType.flags & 65536 && !(indexType.flags & 8190)) { @@ -24363,7 +26606,7 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { var aliasSymbol = getAliasSymbolForTypeNode(node); - if (ts.isEmpty(node.symbol.members) && !aliasSymbol) { + if (node.symbol.members.size === 0 && !aliasSymbol) { links.resolvedType = emptyTypeLiteralType; } else { @@ -24376,17 +26619,33 @@ var ts; return links.resolvedType; } function getAliasSymbolForTypeNode(node) { - return node.parent.kind === 228 ? getSymbolOfNode(node.parent) : undefined; + return node.parent.kind === 230 ? getSymbolOfNode(node.parent) : undefined; } function getAliasTypeArgumentsForTypeNode(node) { var symbol = getAliasSymbolForTypeNode(node); return symbol ? getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) : undefined; } - function getSpreadType(left, right, isFromObjectLiteral) { - ts.Debug.assert(!!(left.flags & (32768 | 1)) && !!(right.flags & (32768 | 1)), "Only object types may be spread."); + function getSpreadType(left, right) { if (left.flags & 1 || right.flags & 1) { return anyType; } + left = filterType(left, function (t) { return !(t.flags & 6144); }); + if (left.flags & 8192) { + return right; + } + right = filterType(right, function (t) { return !(t.flags & 6144); }); + if (right.flags & 8192) { + return left; + } + if (left.flags & 65536) { + return mapType(left, function (t) { return getSpreadType(t, right); }); + } + if (right.flags & 65536) { + return mapType(right, function (t) { return getSpreadType(left, t); }); + } + if (right.flags & 16777216) { + return emptyObjectType; + } var members = ts.createMap(); var skippedPrivateMembers = ts.createMap(); var stringIndexInfo; @@ -24401,42 +26660,55 @@ var ts; } for (var _i = 0, _a = getPropertiesOfType(right); _i < _a.length; _i++) { var rightProp = _a[_i]; - var isOwnProperty = !(rightProp.flags & 8192) || isFromObjectLiteral; var isSetterWithoutGetter = rightProp.flags & 65536 && !(rightProp.flags & 32768); if (getDeclarationModifierFlagsFromSymbol(rightProp) & (8 | 16)) { - skippedPrivateMembers[rightProp.name] = true; + skippedPrivateMembers.set(rightProp.name, true); } - else if (isOwnProperty && !isSetterWithoutGetter) { - members[rightProp.name] = rightProp; + else if (!isClassMethod(rightProp) && !isSetterWithoutGetter) { + members.set(rightProp.name, getNonReadonlySymbol(rightProp)); } } for (var _b = 0, _c = getPropertiesOfType(left); _b < _c.length; _b++) { var leftProp = _c[_b]; if (leftProp.flags & 65536 && !(leftProp.flags & 32768) - || leftProp.name in skippedPrivateMembers) { + || skippedPrivateMembers.has(leftProp.name) + || isClassMethod(leftProp)) { continue; } - if (leftProp.name in members) { - var rightProp = members[leftProp.name]; + if (members.has(leftProp.name)) { + var rightProp = members.get(leftProp.name); var rightType = getTypeOfSymbol(rightProp); - if (maybeTypeOfKind(rightType, 2048) || rightProp.flags & 536870912) { + if (maybeTypeOfKind(rightType, 2048) || rightProp.flags & 67108864) { var declarations = ts.concatenate(leftProp.declarations, rightProp.declarations); - var flags = 4 | 67108864 | (leftProp.flags & 536870912); + var flags = 4 | (leftProp.flags & 67108864); var result = createSymbol(flags, leftProp.name); result.type = getUnionType([getTypeOfSymbol(leftProp), getTypeWithFacts(rightType, 131072)]); result.leftSpread = leftProp; result.rightSpread = rightProp; result.declarations = declarations; - result.isReadonly = isReadonlySymbol(leftProp) || isReadonlySymbol(rightProp); - members[leftProp.name] = result; + members.set(leftProp.name, result); } } else { - members[leftProp.name] = leftProp; + members.set(leftProp.name, getNonReadonlySymbol(leftProp)); } } return createAnonymousType(undefined, members, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo); } + function getNonReadonlySymbol(prop) { + if (!isReadonlySymbol(prop)) { + return prop; + } + var flags = 4 | (prop.flags & 67108864); + var result = createSymbol(flags, prop.name); + result.type = getTypeOfSymbol(prop); + result.declarations = prop.declarations; + result.syntheticOrigin = prop; + return result; + } + function isClassMethod(prop) { + return prop.flags & 8192 && ts.find(prop.declarations, function (decl) { return ts.isClassLike(decl.parent); }); + } function createLiteralType(flags, text) { var type = createType(flags); type.text = text; @@ -24458,7 +26730,11 @@ var ts; } function getLiteralTypeForText(flags, text) { var map = flags & 32 ? stringLiteralTypes : numericLiteralTypes; - return map[text] || (map[text] = createLiteralType(flags, text)); + var type = map.get(text); + if (!type) { + map.set(text, type = createLiteralType(flags, text)); + } + return type; } function getTypeFromLiteralTypeNode(node) { var links = getNodeLinks(node); @@ -24486,9 +26762,9 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 227)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 229)) { if (!(ts.getModifierFlags(container) & 32) && - (container.kind !== 150 || ts.isNodeDescendantOf(node, container.body))) { + (container.kind !== 151 || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } } @@ -24505,85 +26781,82 @@ var ts; function getTypeFromTypeNode(node) { switch (node.kind) { case 118: - case 263: - case 264: + case 267: + case 268: return anyType; - case 134: + case 135: return stringType; case 132: return numberType; case 121: return booleanType; - case 135: + case 136: return esSymbolType; case 104: return voidType; - case 137: + case 138: return undefinedType; case 94: return nullType; case 129: return neverType; - case 289: - return nullType; - case 290: - return undefinedType; - case 291: - return neverType; - case 167: + case 133: + return nonPrimitiveType; + case 168: case 98: return getTypeFromThisTypeNode(node); - case 171: + case 172: return getTypeFromLiteralTypeNode(node); - case 288: + case 292: return getTypeFromLiteralTypeNode(node.literal); - case 157: - case 272: - return getTypeFromTypeReference(node); - case 156: - return booleanType; - case 199: - return getTypeFromTypeReference(node); - case 160: - return getTypeFromTypeQueryNode(node); - case 162: - case 265: - return getTypeFromArrayTypeNode(node); - case 163: - return getTypeFromTupleTypeNode(node); - case 164: - case 266: - return getTypeFromUnionTypeNode(node); - case 165: - return getTypeFromIntersectionTypeNode(node); - case 166: - case 268: - case 269: - case 276: - case 277: - case 273: - return getTypeFromTypeNode(node.type); - case 270: - return getTypeFromTypeNode(node.literal); case 158: - case 159: + case 276: + return getTypeFromTypeReference(node); + case 157: + return booleanType; + case 200: + return getTypeFromTypeReference(node); case 161: - case 287: + return getTypeFromTypeQueryNode(node); + case 163: + case 269: + return getTypeFromArrayTypeNode(node); + case 164: + return getTypeFromTupleTypeNode(node); + case 165: + case 270: + return getTypeFromUnionTypeNode(node); + case 166: + return getTypeFromIntersectionTypeNode(node); + case 272: + return getTypeFromJSDocNullableTypeNode(node); + case 167: + case 273: + case 280: + case 281: + case 277: + return getTypeFromTypeNode(node.type); case 274: + return getTypeFromTypeNode(node.literal); + case 159: + case 160: + case 162: + case 291: + case 278: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 168: - return getTypeFromTypeOperatorNode(node); case 169: - return getTypeFromIndexedAccessTypeNode(node); + return getTypeFromTypeOperatorNode(node); case 170: + return getTypeFromIndexedAccessTypeNode(node); + case 171: return getTypeFromMappedTypeNode(node); case 70: - case 141: + case 142: var symbol = getSymbolAtLocation(node); return symbol && getDeclaredTypeOfSymbol(symbol); - case 267: + case 271: return getTypeFromJSDocTupleType(node); - case 275: + case 279: return getTypeFromJSDocVariadicType(node); default: return unknownType; @@ -24610,13 +26883,13 @@ var ts; var instantiations = mapper.instantiations || (mapper.instantiations = []); return instantiations[type.id] || (instantiations[type.id] = instantiator(type, mapper)); } - function createUnaryTypeMapper(source, target) { + function makeUnaryTypeMapper(source, target) { return function (t) { return t === source ? target : t; }; } - function createBinaryTypeMapper(source1, target1, source2, target2) { + function makeBinaryTypeMapper(source1, target1, source2, target2) { return function (t) { return t === source1 ? target1 : t === source2 ? target2 : t; }; } - function createArrayTypeMapper(sources, targets) { + function makeArrayTypeMapper(sources, targets) { return function (t) { for (var i = 0; i < sources.length; i++) { if (t === sources[i]) { @@ -24627,16 +26900,20 @@ var ts; }; } function createTypeMapper(sources, targets) { - var count = sources.length; - var mapper = count == 1 ? createUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : - count == 2 ? createBinaryTypeMapper(sources[0], targets ? targets[0] : anyType, sources[1], targets ? targets[1] : anyType) : - createArrayTypeMapper(sources, targets); + var mapper = sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : + sources.length === 2 ? makeBinaryTypeMapper(sources[0], targets ? targets[0] : anyType, sources[1], targets ? targets[1] : anyType) : + makeArrayTypeMapper(sources, targets); mapper.mappedTypes = sources; return mapper; } function createTypeEraser(sources) { return createTypeMapper(sources, undefined); } + function createBackreferenceMapper(typeParameters, index) { + var mapper = function (t) { return ts.indexOf(typeParameters, t) >= index ? emptyObjectType : t; }; + mapper.mappedTypes = typeParameters; + return mapper; + } function getInferenceMapper(context) { if (!context.mapper) { var mapper = function (t) { @@ -24660,7 +26937,12 @@ var ts; } function combineTypeMappers(mapper1, mapper2) { var mapper = function (t) { return instantiateType(mapper1(t), mapper2); }; - mapper.mappedTypes = mapper1.mappedTypes; + mapper.mappedTypes = ts.concatenate(mapper1.mappedTypes, mapper2.mappedTypes); + return mapper; + } + function createReplacementMapper(source, target, baseMapper) { + var mapper = function (t) { return t === source ? target : baseMapper(t); }; + mapper.mappedTypes = baseMapper.mappedTypes; return mapper; } function cloneTypeParameter(typeParameter) { @@ -24705,12 +26987,13 @@ var ts; return result; } function instantiateSymbol(symbol, mapper) { - if (symbol.flags & 16777216) { + if (getCheckFlags(symbol) & 1) { var links = getSymbolLinks(symbol); symbol = links.target; mapper = combineTypeMappers(links.mapper, mapper); } - var result = createSymbol(16777216 | 67108864 | symbol.flags, symbol.name); + var result = createSymbol(symbol.flags, symbol.name); + result.checkFlags = 1; result.declarations = symbol.declarations; result.parent = symbol.parent; result.target = symbol; @@ -24731,18 +27014,17 @@ var ts; function instantiateMappedType(type, mapper) { var constraintType = getConstraintTypeFromMappedType(type); if (constraintType.flags & 262144) { - var typeParameter_1 = constraintType.type; - var mappedTypeParameter = mapper(typeParameter_1); - if (typeParameter_1 !== mappedTypeParameter) { - return mapType(mappedTypeParameter, function (t) { - if (isMappableType(t)) { - var replacementMapper = createUnaryTypeMapper(typeParameter_1, t); - var combinedMapper = mapper.mappedTypes && mapper.mappedTypes.length === 1 ? replacementMapper : combineTypeMappers(replacementMapper, mapper); - combinedMapper.mappedTypes = mapper.mappedTypes; - return instantiateMappedObjectType(type, combinedMapper); - } - return t; - }); + var typeVariable_1 = constraintType.type; + if (typeVariable_1.flags & 16384) { + var mappedTypeVariable = instantiateType(typeVariable_1, mapper); + if (typeVariable_1 !== mappedTypeVariable) { + return mapType(mappedTypeVariable, function (t) { + if (isMappableType(t)) { + return instantiateMappedObjectType(type, createReplacementMapper(typeVariable_1, t, mapper)); + } + return t; + }); + } } } return instantiateMappedObjectType(type, mapper); @@ -24763,26 +27045,28 @@ var ts; return false; } var mappedTypes = mapper.mappedTypes; - var node = symbol.declarations[0].parent; - while (node) { + return !!ts.findAncestor(symbol.declarations[0], function (node) { + if (node.kind === 232 || node.kind === 264) { + return "quit"; + } switch (node.kind) { - case 158: case 159: - case 225: - case 149: - case 148: + case 160: + case 227: case 150: - case 153: + case 149: + case 151: case 154: case 155: - case 151: + case 156: case 152: - case 184: + case 153: case 185: - case 226: - case 197: - case 227: + case 186: case 228: + case 198: + case 229: + case 230: var declaration = node; if (declaration.typeParameters) { for (var _i = 0, _a = declaration.typeParameters; _i < _a.length; _i++) { @@ -24792,25 +27076,34 @@ var ts; } } } - if (ts.isClassLike(node) || node.kind === 227) { + if (ts.isClassLike(node) || node.kind === 229) { var thisType = getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; if (thisType && ts.contains(mappedTypes, thisType)) { return true; } } break; - case 230: - case 261: - return false; + case 171: + if (ts.contains(mappedTypes, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter)))) { + return true; + } + break; + case 278: + var func = node; + for (var _b = 0, _c = func.parameters; _b < _c.length; _b++) { + var p = _c[_b]; + if (ts.contains(mappedTypes, getTypeOfNode(p))) { + return true; + } + } + break; } - node = node.parent; - } - return false; + }); } function isTopLevelTypeAlias(symbol) { if (symbol.declarations && symbol.declarations.length) { var parentKind = symbol.declarations[0].parent.kind; - return parentKind === 261 || parentKind === 231; + return parentKind === 264 || parentKind === 233; } return false; } @@ -24862,28 +27155,34 @@ var ts; return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration); } function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 149 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 150 || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 184: case 185: + case 186: return isContextSensitiveFunctionLikeDeclaration(node); - case 176: + case 177: return ts.forEach(node.properties, isContextSensitive); - case 175: + case 176: return ts.forEach(node.elements, isContextSensitive); - case 193: + case 194: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 192: + case 193: return node.operatorToken.kind === 53 && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 257: + case 260: return isContextSensitive(node.initializer); + case 150: case 149: - case 148: return isContextSensitiveFunctionLikeDeclaration(node); - case 183: + case 184: return isContextSensitive(node.expression); + case 253: + return ts.forEach(node.properties, isContextSensitive); + case 252: + return node.initializer && isContextSensitive(node.initializer); + case 255: + return node.expression && isContextSensitive(node.expression); } return false; } @@ -24894,7 +27193,7 @@ var ts; if (ts.forEach(node.parameters, function (p) { return !p.type; })) { return true; } - if (node.kind === 185) { + if (node.kind === 186) { return false; } var parameter = ts.firstOrUndefined(node.parameters); @@ -24912,9 +27211,12 @@ var ts; result.properties = resolved.properties; result.callSignatures = emptyArray; result.constructSignatures = emptyArray; - type = result; + return result; } } + else if (type.flags & 131072) { + return getIntersectionType(ts.map(type.types, getTypeWithoutSignatures)); + } return type; } function isTypeIdenticalTo(source, target) { @@ -24933,7 +27235,7 @@ var ts; return isTypeRelatedTo(source, target, assignableRelation); } function isTypeInstanceOf(source, target) { - return source === target || isTypeSubtypeOf(source, target) && !isTypeIdenticalTo(source, target); + return getTargetType(source) === getTargetType(target) || isTypeSubtypeOf(source, target) && !isTypeIdenticalTo(source, target); } function isTypeComparableTo(source, target) { return isTypeRelatedTo(source, target, comparableRelation); @@ -24951,9 +27253,9 @@ var ts; return checkTypeRelatedTo(source, target, comparableRelation, errorNode, headMessage, containingMessageChain); } function isSignatureAssignableTo(source, target, ignoreReturnTypes) { - return compareSignaturesRelated(source, target, ignoreReturnTypes, false, undefined, compareTypesAssignable) !== 0; + return compareSignaturesRelated(source, target, false, ignoreReturnTypes, false, undefined, compareTypesAssignable) !== 0; } - function compareSignaturesRelated(source, target, ignoreReturnTypes, reportErrors, errorReporter, compareTypes) { + function compareSignaturesRelated(source, target, checkAsCallback, ignoreReturnTypes, reportErrors, errorReporter, compareTypes) { if (source === target) { return -1; } @@ -24984,9 +27286,15 @@ var ts; var sourceParams = source.parameters; var targetParams = target.parameters; for (var i = 0; i < checkCount; i++) { - var s = i < sourceMax ? getTypeOfParameter(sourceParams[i]) : getRestTypeOfSignature(source); - var t = i < targetMax ? getTypeOfParameter(targetParams[i]) : getRestTypeOfSignature(target); - var related = compareTypes(s, t, false) || compareTypes(t, s, reportErrors); + var sourceType = i < sourceMax ? getTypeOfParameter(sourceParams[i]) : getRestTypeOfSignature(source); + var targetType = i < targetMax ? getTypeOfParameter(targetParams[i]) : getRestTypeOfSignature(target); + var sourceSig = getSingleCallSignature(getNonNullableType(sourceType)); + var targetSig = getSingleCallSignature(getNonNullableType(targetType)); + var callbacks = sourceSig && targetSig && !sourceSig.typePredicate && !targetSig.typePredicate && + (getFalsyFlags(sourceType) & 6144) === (getFalsyFlags(targetType) & 6144); + var related = callbacks ? + compareSignaturesRelated(targetSig, sourceSig, true, false, reportErrors, errorReporter, compareTypes) : + !checkAsCallback && compareTypes(sourceType, targetType, false) || compareTypes(targetType, sourceType, reportErrors); if (!related) { if (reportErrors) { errorReporter(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, sourceParams[i < sourceMax ? i : sourceMax].name, targetParams[i < targetMax ? i : targetMax].name); @@ -25013,7 +27321,8 @@ var ts; } } else { - result &= compareTypes(sourceReturnType, targetReturnType, reportErrors); + result &= checkAsCallback && compareTypes(targetReturnType, sourceReturnType, false) || + compareTypes(sourceReturnType, targetReturnType, reportErrors); } } return result; @@ -25076,18 +27385,33 @@ var ts; sourceNonRestParamCount; } } + function isEmptyResolvedType(t) { + return t.properties.length === 0 && + t.callSignatures.length === 0 && + t.constructSignatures.length === 0 && + !t.stringIndexInfo && + !t.numberIndexInfo; + } + function isEmptyObjectType(type) { + return type.flags & 32768 ? isEmptyResolvedType(resolveStructuredTypeMembers(type)) : + type.flags & 65536 ? ts.forEach(type.types, isEmptyObjectType) : + type.flags & 131072 ? !ts.forEach(type.types, function (t) { return !isEmptyObjectType(t); }) : + false; + } function isEnumTypeRelatedTo(source, target, errorReporter) { if (source === target) { return true; } var id = source.id + "," + target.id; - if (enumRelation[id] !== undefined) { - return enumRelation[id]; + var relation = enumRelation.get(id); + if (relation !== undefined) { + return relation; } if (source.symbol.name !== target.symbol.name || !(source.symbol.flags & 256) || !(target.symbol.flags & 256) || (source.flags & 65536) !== (target.flags & 65536)) { - return enumRelation[id] = false; + enumRelation.set(id, false); + return false; } var targetEnumType = getTypeOfSymbol(target.symbol); for (var _i = 0, _a = getPropertiesOfType(getTypeOfSymbol(source.symbol)); _i < _a.length; _i++) { @@ -25098,11 +27422,13 @@ var ts; if (errorReporter) { errorReporter(ts.Diagnostics.Property_0_is_missing_in_type_1, property.name, typeToString(target, undefined, 128)); } - return enumRelation[id] = false; + enumRelation.set(id, false); + return false; } } } - return enumRelation[id] = true; + enumRelation.set(id, true); + return true; } function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { if (target.flags & 8192) @@ -25123,6 +27449,8 @@ var ts; return true; if (source.flags & 4096 && (!strictNullChecks || target.flags & 4096)) return true; + if (source.flags & 32768 && target.flags & 16777216) + return true; if (relation === assignableRelation || relation === comparableRelation) { if (source.flags & 1) return true; @@ -25154,13 +27482,13 @@ var ts; } if (source.flags & 32768 && target.flags & 32768) { var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; - var related = relation[id]; + var related = relation.get(id); if (related !== undefined) { return related === 1; } } - if (source.flags & 507904 || target.flags & 507904) { - return checkTypeRelatedTo(source, target, relation, undefined, undefined, undefined); + if (source.flags & 1032192 || target.flags & 1032192) { + return checkTypeRelatedTo(source, target, relation, undefined); } return false; } @@ -25214,10 +27542,27 @@ var ts; if ((globalStringType === source && stringType === target) || (globalNumberType === source && numberType === target) || (globalBooleanType === source && booleanType === target) || - (getGlobalESSymbolType() === source && esSymbolType === target)) { + (getGlobalESSymbolType(false) === source && esSymbolType === target)) { reportError(ts.Diagnostics._0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible, targetType, sourceType); } } + function isUnionOrIntersectionTypeWithoutNullableConstituents(type) { + if (!(type.flags & 196608)) { + return false; + } + var seenNonNullable = false; + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (t.flags & 6144) { + continue; + } + if (seenNonNullable) { + return true; + } + seenNonNullable = true; + } + return false; + } function isRelatedTo(source, target, reportErrors, headMessage) { var result; if (source.flags & 96 && source.flags & 1048576) { @@ -25240,7 +27585,7 @@ var ts; } return 0; } - if (target.flags & 196608) { + if (isUnionOrIntersectionTypeWithoutNullableConstituents(target)) { source = getRegularTypeOfObjectLiteral(source); } } @@ -25256,91 +27601,24 @@ var ts; return result; } } - else if (target.flags & 65536) { - if (result = typeRelatedToSomeType(source, target, reportErrors && !(source.flags & 8190) && !(target.flags & 8190))) { - return result; - } - } - else if (target.flags & 131072) { - if (result = typeRelatedToEachType(source, target, reportErrors)) { - return result; - } - } - else if (source.flags & 131072) { - if (result = someTypeRelatedToType(source, target, false)) { - return result; - } - } - if (target.flags & 16384) { - if (getObjectFlags(source) & 32 && getConstraintTypeFromMappedType(source) === getIndexType(target)) { - if (!source.declaration.questionToken) { - var templateType = getTemplateTypeFromMappedType(source); - var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); - if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) { - return result; - } - } - } - else { - var constraint = getConstraintOfTypeParameter(target); - if (constraint && constraint.flags & 262144) { - if (result = isRelatedTo(source, constraint, reportErrors)) { - return result; - } - } - } - } - else if (target.flags & 262144) { - if (source.flags & 262144) { - if (result = isRelatedTo(target.type, source.type, false)) { - return result; - } - } - var constraint = getConstraintOfTypeParameter(target.type); - if (constraint) { - if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) { - return result; - } - } - } - else if (target.flags & 524288) { - if (source.flags & 524288 && source.indexType === target.indexType) { - if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) { - return result; - } - } - } - if (source.flags & 16384) { - if (getObjectFlags(target) & 32 && getConstraintTypeFromMappedType(target) === getIndexType(source)) { - var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); - var templateType = getTemplateTypeFromMappedType(target); - if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { - return result; - } - } - else { - var constraint = getConstraintOfTypeParameter(source); - if (!constraint || constraint.flags & 1) { - constraint = emptyObjectType; - } - constraint = getTypeWithThisArgument(constraint, source); - var reportConstraintErrors = reportErrors && constraint !== emptyObjectType; - if (result = isRelatedTo(constraint, target, reportConstraintErrors)) { - errorInfo = saveErrorInfo; - return result; - } - } - } else { - if (getObjectFlags(source) & 4 && getObjectFlags(target) & 4 && source.target === target.target) { - if (result = typeArgumentsRelatedTo(source, target, reportErrors)) { + if (target.flags & 65536) { + if (result = typeRelatedToSomeType(source, target, reportErrors && !(source.flags & 8190) && !(target.flags & 8190))) { return result; } } - var apparentSource = getApparentType(source); - if (apparentSource.flags & (32768 | 131072) && target.flags & 32768) { - var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !(source.flags & 8190); - if (result = objectTypeRelatedTo(apparentSource, source, target, reportStructuralErrors)) { + else if (target.flags & 131072) { + if (result = typeRelatedToEachType(source, target, reportErrors)) { + return result; + } + } + else if (source.flags & 131072) { + if (result = someTypeRelatedToType(source, target, false)) { + return result; + } + } + if (source.flags & 1032192 || target.flags & 1032192) { + if (result = recursiveTypeRelatedTo(source, target, reportErrors)) { errorInfo = saveErrorInfo; return result; } @@ -25360,12 +27638,7 @@ var ts; function isIdenticalTo(source, target) { var result; if (source.flags & 32768 && target.flags & 32768) { - if (getObjectFlags(source) & 4 && getObjectFlags(target) & 4 && source.target === target.target) { - if (result = typeArgumentsRelatedTo(source, target, false)) { - return result; - } - } - return objectTypeRelatedTo(source, source, target, false); + return recursiveTypeRelatedTo(source, target, false); } if (source.flags & 65536 && target.flags & 65536 || source.flags & 131072 && target.flags & 131072) { @@ -25377,42 +27650,43 @@ var ts; } return 0; } - function isKnownProperty(type, name) { + function isKnownProperty(type, name, isComparingJsxAttributes) { if (type.flags & 32768) { var resolved = resolveStructuredTypeMembers(type); - if ((relation === assignableRelation || relation === comparableRelation) && (type === globalObjectType || isEmptyObjectType(resolved)) || - resolved.stringIndexInfo || - (resolved.numberIndexInfo && isNumericLiteralName(name)) || - getPropertyOfType(type, name)) { + if (resolved.stringIndexInfo || resolved.numberIndexInfo && isNumericLiteralName(name) || + getPropertyOfType(type, name) || isComparingJsxAttributes && !isUnhyphenatedJsxName(name)) { return true; } } else if (type.flags & 196608) { for (var _i = 0, _a = type.types; _i < _a.length; _i++) { var t = _a[_i]; - if (isKnownProperty(t, name)) { + if (isKnownProperty(t, name, isComparingJsxAttributes)) { return true; } } } return false; } - function isEmptyObjectType(t) { - return t.properties.length === 0 && - t.callSignatures.length === 0 && - t.constructSignatures.length === 0 && - !t.stringIndexInfo && - !t.numberIndexInfo; - } function hasExcessProperties(source, target, reportErrors) { if (maybeTypeOfKind(target, 32768) && !(getObjectFlags(target) & 512)) { + var isComparingJsxAttributes = !!(source.flags & 33554432); + if ((relation === assignableRelation || relation === comparableRelation) && + (isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) { + return false; + } for (var _i = 0, _a = getPropertiesOfObjectType(source); _i < _a.length; _i++) { var prop = _a[_i]; - if (!isKnownProperty(target, prop.name)) { + if (!isKnownProperty(target, prop.name, isComparingJsxAttributes)) { if (reportErrors) { ts.Debug.assert(!!errorNode); - errorNode = prop.valueDeclaration; - reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target)); + if (ts.isJsxAttributes(errorNode)) { + reportError(ts.Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(target)); + } + else { + errorNode = prop.valueDeclaration; + reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target)); + } } return true; } @@ -25438,20 +27712,42 @@ var ts; if (target.flags & 65536 && containsType(targetTypes, source)) { return -1; } - var len = targetTypes.length; - for (var i = 0; i < len; i++) { - var related = isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1); + for (var _i = 0, targetTypes_1 = targetTypes; _i < targetTypes_1.length; _i++) { + var type = targetTypes_1[_i]; + var related = isRelatedTo(source, type, false); if (related) { return related; } } + if (reportErrors) { + var discriminantType = findMatchingDiscriminantType(source, target); + isRelatedTo(source, discriminantType || targetTypes[targetTypes.length - 1], true); + } return 0; } + function findMatchingDiscriminantType(source, target) { + var sourceProperties = getPropertiesOfObjectType(source); + if (sourceProperties) { + for (var _i = 0, sourceProperties_1 = sourceProperties; _i < sourceProperties_1.length; _i++) { + var sourceProperty = sourceProperties_1[_i]; + if (isDiscriminantProperty(target, sourceProperty.name)) { + var sourceType = getTypeOfSymbol(sourceProperty); + for (var _a = 0, _b = target.types; _a < _b.length; _a++) { + var type = _b[_a]; + var targetType = getTypeOfPropertyOfType(type, sourceProperty.name); + if (targetType && isRelatedTo(sourceType, targetType)) { + return type; + } + } + } + } + } + } function typeRelatedToEachType(source, target, reportErrors) { var result = -1; var targetTypes = target.types; - for (var _i = 0, targetTypes_1 = targetTypes; _i < targetTypes_1.length; _i++) { - var targetType = targetTypes_1[_i]; + for (var _i = 0, targetTypes_2 = targetTypes; _i < targetTypes_2.length; _i++) { + var targetType = targetTypes_2[_i]; var related = isRelatedTo(source, targetType, reportErrors); if (!related) { return 0; @@ -25504,15 +27800,15 @@ var ts; } return result; } - function objectTypeRelatedTo(source, originalSource, target, reportErrors) { + function recursiveTypeRelatedTo(source, target, reportErrors) { if (overflow) { return 0; } var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; - var related = relation[id]; + var related = relation.get(id); if (related !== undefined) { if (reportErrors && related === 2) { - relation[id] = 3; + relation.set(id, 3); } else { return related === 1 ? -1 : 0; @@ -25520,7 +27816,7 @@ var ts; } if (depth > 0) { for (var i = 0; i < depth; i++) { - if (maybeStack[i][id]) { + if (maybeStack[i].get(id)) { return 1; } } @@ -25538,71 +27834,165 @@ var ts; sourceStack[depth] = source; targetStack[depth] = target; maybeStack[depth] = ts.createMap(); - maybeStack[depth][id] = 1; + maybeStack[depth].set(id, 1); depth++; var saveExpandingFlags = expandingFlags; - if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack, depth)) + if (!(expandingFlags & 1) && isDeeplyNestedType(source, sourceStack, depth)) expandingFlags |= 1; - if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack, depth)) + if (!(expandingFlags & 2) && isDeeplyNestedType(target, targetStack, depth)) expandingFlags |= 2; - var result; - if (expandingFlags === 3) { - result = 1; - } - else if (isGenericMappedType(source) || isGenericMappedType(target)) { - result = mappedTypeRelatedTo(source, target, reportErrors); - } - else { - result = propertiesRelatedTo(source, target, reportErrors); - if (result) { - result &= signaturesRelatedTo(source, target, 0, reportErrors); - if (result) { - result &= signaturesRelatedTo(source, target, 1, reportErrors); - if (result) { - result &= indexTypesRelatedTo(source, originalSource, target, 0, reportErrors); - if (result) { - result &= indexTypesRelatedTo(source, originalSource, target, 1, reportErrors); - } - } - } - } - } + var result = expandingFlags !== 3 ? structuredTypeRelatedTo(source, target, reportErrors) : 1; expandingFlags = saveExpandingFlags; depth--; if (result) { var maybeCache = maybeStack[depth]; var destinationCache = (result === -1 || depth === 0) ? relation : maybeStack[depth - 1]; - ts.copyProperties(maybeCache, destinationCache); + ts.copyEntries(maybeCache, destinationCache); } else { - relation[id] = reportErrors ? 3 : 2; + relation.set(id, reportErrors ? 3 : 2); } return result; } - function mappedTypeRelatedTo(source, target, reportErrors) { - if (isGenericMappedType(target)) { - if (isGenericMappedType(source)) { - var result_2; - if (relation === identityRelation) { - var readonlyMatches = !source.declaration.readonlyToken === !target.declaration.readonlyToken; - var optionalMatches = !source.declaration.questionToken === !target.declaration.questionToken; - if (readonlyMatches && optionalMatches) { - if (result_2 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { - return result_2 & isRelatedTo(getErasedTemplateTypeFromMappedType(source), getErasedTemplateTypeFromMappedType(target), reportErrors); - } - } - } - else { - if (relation === comparableRelation || !source.declaration.questionToken || target.declaration.questionToken) { - if (result_2 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { - return result_2 & isRelatedTo(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target), reportErrors); - } + function structuredTypeRelatedTo(source, target, reportErrors) { + var result; + var saveErrorInfo = errorInfo; + if (target.flags & 16384) { + if (getObjectFlags(source) & 32 && getConstraintTypeFromMappedType(source) === getIndexType(target)) { + if (!source.declaration.questionToken) { + var templateType = getTemplateTypeFromMappedType(source); + var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); + if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) { + return result; } } } } - else if (relation !== identityRelation && isEmptyObjectType(resolveStructuredTypeMembers(target))) { - return -1; + else if (target.flags & 262144) { + if (source.flags & 262144) { + if (result = isRelatedTo(target.type, source.type, false)) { + return result; + } + } + var constraint = getConstraintOfType(target.type); + if (constraint) { + if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) { + return result; + } + } + } + else if (target.flags & 524288) { + var constraint = getConstraintOfType(target); + if (constraint) { + if (result = isRelatedTo(source, constraint, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + } + if (source.flags & 16384) { + if (getObjectFlags(target) & 32 && getConstraintTypeFromMappedType(target) === getIndexType(source)) { + var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); + var templateType = getTemplateTypeFromMappedType(target); + if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + else { + var constraint = getConstraintOfTypeParameter(source); + if (constraint || !(target.flags & 16777216)) { + if (!constraint || constraint.flags & 1) { + constraint = emptyObjectType; + } + constraint = getTypeWithThisArgument(constraint, source); + var reportConstraintErrors = reportErrors && constraint !== emptyObjectType; + if (result = isRelatedTo(constraint, target, reportConstraintErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + } + } + else if (source.flags & 524288) { + var constraint = getConstraintOfType(source); + if (constraint) { + if (result = isRelatedTo(constraint, target, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + else if (target.flags & 524288 && source.indexType === target.indexType) { + if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) { + return result; + } + } + } + else { + if (getObjectFlags(source) & 4 && getObjectFlags(target) & 4 && source.target === target.target) { + if (result = typeArgumentsRelatedTo(source, target, reportErrors)) { + return result; + } + } + var sourceIsPrimitive = !!(source.flags & 8190); + if (relation !== identityRelation) { + source = getApparentType(source); + } + if (source.flags & (32768 | 131072) && target.flags & 32768) { + var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !sourceIsPrimitive; + if (isGenericMappedType(source) || isGenericMappedType(target)) { + result = mappedTypeRelatedTo(source, target, reportStructuralErrors); + } + else { + result = propertiesRelatedTo(source, target, reportStructuralErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 0, reportStructuralErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 1, reportStructuralErrors); + if (result) { + result &= indexTypesRelatedTo(source, target, 0, sourceIsPrimitive, reportStructuralErrors); + if (result) { + result &= indexTypesRelatedTo(source, target, 1, sourceIsPrimitive, reportStructuralErrors); + } + } + } + } + } + if (result) { + errorInfo = saveErrorInfo; + return result; + } + } + } + return 0; + } + function mappedTypeRelatedTo(source, target, reportErrors) { + if (isGenericMappedType(target)) { + if (isGenericMappedType(source)) { + var sourceReadonly = !!source.declaration.readonlyToken; + var sourceOptional = !!source.declaration.questionToken; + var targetReadonly = !!target.declaration.readonlyToken; + var targetOptional = !!target.declaration.questionToken; + var modifiersRelated = relation === identityRelation ? + sourceReadonly === targetReadonly && sourceOptional === targetOptional : + relation === comparableRelation || !sourceOptional || targetOptional; + if (modifiersRelated) { + var result_2; + if (result_2 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { + var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); + return result_2 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); + } + } + } + else if (target.declaration.questionToken && isEmptyObjectType(source)) { + return -1; + } + } + else if (relation !== identityRelation) { + var resolved = resolveStructuredTypeMembers(target); + if (isEmptyResolvedType(resolved) || resolved.stringIndexInfo && resolved.stringIndexInfo.type.flags & 1) { + return -1; + } } return 0; } @@ -25613,22 +28003,28 @@ var ts; var result = -1; var properties = getPropertiesOfObjectType(target); var requireOptionalProperties = relation === subtypeRelation && !(getObjectFlags(source) & 128); - for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { - var targetProp = properties_3[_i]; + for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) { + var targetProp = properties_4[_i]; var sourceProp = getPropertyOfType(source, targetProp.name); if (sourceProp !== targetProp) { if (!sourceProp) { - if (!(targetProp.flags & 536870912) || requireOptionalProperties) { + if (!(targetProp.flags & 67108864) || requireOptionalProperties) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source)); } return 0; } } - else if (!(targetProp.flags & 134217728)) { + else if (!(targetProp.flags & 16777216)) { var sourcePropFlags = getDeclarationModifierFlagsFromSymbol(sourceProp); var targetPropFlags = getDeclarationModifierFlagsFromSymbol(targetProp); if (sourcePropFlags & 8 || targetPropFlags & 8) { + if (getCheckFlags(sourceProp) & 256) { + if (reportErrors) { + reportError(ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(sourceProp), typeToString(source)); + } + return 0; + } if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) { if (reportErrors) { if (sourcePropFlags & 8 && targetPropFlags & 8) { @@ -25642,12 +28038,9 @@ var ts; } } else if (targetPropFlags & 16) { - var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 32; - var sourceClass = sourceDeclaredInClass ? getDeclaredTypeOfSymbol(getParentOfSymbol(sourceProp)) : undefined; - var targetClass = getDeclaredTypeOfSymbol(getParentOfSymbol(targetProp)); - if (!sourceClass || !hasBaseType(sourceClass, targetClass)) { + if (!isValidOverrideOf(sourceProp, targetProp)) { if (reportErrors) { - reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(sourceClass || source), typeToString(targetClass)); + reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(getDeclaringClass(sourceProp) || source), typeToString(getDeclaringClass(targetProp) || target)); } return 0; } @@ -25666,7 +28059,7 @@ var ts; return 0; } result &= related; - if (relation !== comparableRelation && sourceProp.flags & 536870912 && !(targetProp.flags & 536870912)) { + if (relation !== comparableRelation && sourceProp.flags & 67108864 && !(targetProp.flags & 67108864)) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); } @@ -25687,8 +28080,8 @@ var ts; return 0; } var result = -1; - for (var _i = 0, sourceProperties_1 = sourceProperties; _i < sourceProperties_1.length; _i++) { - var sourceProp = sourceProperties_1[_i]; + for (var _i = 0, sourceProperties_2 = sourceProperties; _i < sourceProperties_2.length; _i++) { + var sourceProp = sourceProperties_2[_i]; var targetProp = getPropertyOfObjectType(target, sourceProp.name); if (!targetProp) { return 0; @@ -25744,7 +28137,7 @@ var ts; return result; } function signatureRelatedTo(source, target, reportErrors) { - return compareSignaturesRelated(source, target, false, reportErrors, reportError, isRelatedTo); + return compareSignaturesRelated(source, target, false, false, reportErrors, reportError, isRelatedTo); } function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); @@ -25753,7 +28146,7 @@ var ts; return 0; } var result = -1; - for (var i = 0, len = sourceSignatures.length; i < len; i++) { + for (var i = 0; i < sourceSignatures.length; i++) { var related = compareSignaturesIdentical(sourceSignatures[i], targetSignatures[i], false, false, false, isRelatedTo); if (!related) { return 0; @@ -25786,12 +28179,12 @@ var ts; } return related; } - function indexTypesRelatedTo(source, originalSource, target, kind, reportErrors) { + function indexTypesRelatedTo(source, target, kind, sourceIsPrimitive, reportErrors) { if (relation === identityRelation) { return indexTypesIdenticalTo(source, target, kind); } var targetInfo = getIndexInfoOfType(target, kind); - if (!targetInfo || ((targetInfo.type.flags & 1) && !(originalSource.flags & 8190))) { + if (!targetInfo || targetInfo.type.flags & 1 && !sourceIsPrimitive) { return -1; } var sourceInfo = getIndexInfoOfType(source, kind) || @@ -25849,6 +28242,37 @@ var ts; return false; } } + function forEachProperty(prop, callback) { + if (getCheckFlags(prop) & 6) { + for (var _i = 0, _a = prop.containingType.types; _i < _a.length; _i++) { + var t = _a[_i]; + var p = getPropertyOfType(t, prop.name); + var result = p && forEachProperty(p, callback); + if (result) { + return result; + } + } + return undefined; + } + return callback(prop); + } + function getDeclaringClass(prop) { + return prop.parent && prop.parent.flags & 32 ? getDeclaredTypeOfSymbol(getParentOfSymbol(prop)) : undefined; + } + function isPropertyInClassDerivedFrom(prop, baseClass) { + return forEachProperty(prop, function (sp) { + var sourceClass = getDeclaringClass(sp); + return sourceClass ? hasBaseType(sourceClass, baseClass) : false; + }); + } + function isValidOverrideOf(sourceProp, targetProp) { + return !forEachProperty(targetProp, function (tp) { return getDeclarationModifierFlagsFromSymbol(tp) & 16 ? + !isPropertyInClassDerivedFrom(sourceProp, getDeclaringClass(tp)) : false; }); + } + function isClassDerivedFromDeclaringClasses(checkClass, prop) { + return forEachProperty(prop, function (p) { return getDeclarationModifierFlagsFromSymbol(p) & 16 ? + !hasBaseType(checkClass, getDeclaringClass(p)) : false; }) ? undefined : checkClass; + } function isAbstractConstructorType(type) { if (getObjectFlags(type) & 16) { var symbol = type.symbol; @@ -25861,16 +28285,18 @@ var ts; } return false; } - function isDeeplyNestedGeneric(type, stack, depth) { - if (getObjectFlags(type) & (4 | 64) && depth >= 5) { + function isDeeplyNestedType(type, stack, depth) { + if (depth >= 5 && type.flags & 32768) { var symbol = type.symbol; - var count = 0; - for (var i = 0; i < depth; i++) { - var t = stack[i]; - if (getObjectFlags(t) & (4 | 64) && t.symbol === symbol) { - count++; - if (count >= 5) - return true; + if (symbol) { + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (t.flags & 32768 && t.symbol === symbol) { + count++; + if (count >= 5) + return true; + } } } } @@ -25894,7 +28320,7 @@ var ts; } } else { - if ((sourceProp.flags & 536870912) !== (targetProp.flags & 536870912)) { + if ((sourceProp.flags & 67108864) !== (targetProp.flags & 67108864)) { return 0; } } @@ -25924,7 +28350,7 @@ var ts; if (!(isMatchingSignature(source, target, partialMatch))) { return 0; } - if ((source.typeParameters ? source.typeParameters.length : 0) !== (target.typeParameters ? target.typeParameters.length : 0)) { + if (ts.length(source.typeParameters) !== ts.length(target.typeParameters)) { return 0; } source = getErasedSignature(source); @@ -25962,8 +28388,8 @@ var ts; return signature.hasRestParameter && parameterIndex >= signature.parameters.length - 1; } function isSupertypeOfEach(candidate, types) { - for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { - var t = types_7[_i]; + for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { + var t = types_10[_i]; if (candidate !== t && !isTypeSubtypeOf(t, candidate)) return false; } @@ -25971,8 +28397,8 @@ var ts; } function literalTypesWithSameBaseType(types) { var commonBaseType; - for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { - var t = types_8[_i]; + for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { + var t = types_11[_i]; var baseType = getBaseTypeOfLiteralType(t); if (!commonBaseType) { commonBaseType = baseType; @@ -26063,8 +28489,8 @@ var ts; } function getFalsyFlagsOfTypes(types) { var result = 0; - for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { - var t = types_9[_i]; + for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { + var t = types_12[_i]; result |= getFalsyFlags(t); } return result; @@ -26093,7 +28519,7 @@ var ts; types.push(undefinedType); if (flags & 4096) types.push(nullType); - return getUnionType(types, true); + return getUnionType(types); } function removeDefinitelyFalsyTypes(type) { return getFalsyFlags(type) & 7392 ? @@ -26108,8 +28534,8 @@ var ts; getSignaturesOfType(type, 0).length === 0 && getSignaturesOfType(type, 1).length === 0; } - function createTransientSymbol(source, type) { - var symbol = createSymbol(source.flags | 67108864, source.name); + function createSymbolWithType(source, type) { + var symbol = createSymbol(source.flags, source.name); symbol.declarations = source.declarations; symbol.parent = source.parent; symbol.type = type; @@ -26125,9 +28551,8 @@ var ts; var property = _a[_i]; var original = getTypeOfSymbol(property); var updated = f(original); - members[property.name] = updated === original ? property : createTransientSymbol(property, updated); + members.set(property.name, updated === original ? property : createSymbolWithType(property, updated)); } - ; return members; } function getRegularTypeOfObjectLiteral(type) { @@ -26146,11 +28571,17 @@ var ts; type.regularType = regularNew; return regularNew; } + function getWidenedProperty(prop) { + var original = getTypeOfSymbol(prop); + var widened = getWidenedType(original); + return widened === original ? prop : createSymbolWithType(prop, widened); + } function getWidenedTypeOfObjectLiteral(type) { - var members = transformTypeOfMembers(type, function (prop) { - var widened = getWidenedType(prop); - return prop === widened ? prop : widened; - }); + var members = ts.createMap(); + for (var _i = 0, _a = getPropertiesOfObjectType(type); _i < _a.length; _i++) { + var prop = _a[_i]; + members.set(prop.name, prop.flags & 4 ? getWidenedProperty(prop) : prop); + } var stringIndexInfo = getIndexInfoOfType(type, 0); var numberIndexInfo = getIndexInfoOfType(type, 1); return createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexInfo && createIndexInfo(getWidenedType(stringIndexInfo.type), stringIndexInfo.isReadonly), numberIndexInfo && createIndexInfo(getWidenedType(numberIndexInfo.type), numberIndexInfo.isReadonly)); @@ -26211,25 +28642,25 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { + case 148: case 147: - case 146: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 144: + case 145: diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 174: + case 175: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; break; - case 225: + case 227: + case 150: case 149: - case 148: - case 151: case 152: - case 184: + case 153: case 185: + case 186: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -26242,7 +28673,7 @@ var ts; error(declaration, diagnostic, ts.declarationNameToString(declaration.name), typeAsString); } function reportErrorsFromWidening(declaration, type) { - if (produceDiagnostics && compilerOptions.noImplicitAny && type.flags & 2097152) { + if (produceDiagnostics && noImplicitAny && type.flags & 2097152) { if (!reportWideningErrorsInType(type)) { reportImplicitAnyError(declaration, type); } @@ -26268,13 +28699,14 @@ var ts; callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i)); } } - function createInferenceContext(signature, inferUnionTypes) { + function createInferenceContext(signature, inferUnionTypes, useAnyForNoInferences) { var inferences = ts.map(signature.typeParameters, createTypeInferencesObject); return { signature: signature, inferUnionTypes: inferUnionTypes, inferences: inferences, inferredTypes: new Array(signature.typeParameters.length), + useAnyForNoInferences: useAnyForNoInferences }; } function createTypeInferencesObject() { @@ -26285,25 +28717,69 @@ var ts; isFixed: false, }; } - function couldContainTypeParameters(type) { + function couldContainTypeVariables(type) { var objectFlags = getObjectFlags(type); - return !!(type.flags & 16384 || - objectFlags & 4 && ts.forEach(type.typeArguments, couldContainTypeParameters) || + return !!(type.flags & 540672 || + objectFlags & 4 && ts.forEach(type.typeArguments, couldContainTypeVariables) || objectFlags & 16 && type.symbol && type.symbol.flags & (8192 | 2048 | 32) || objectFlags & 32 || - type.flags & 196608 && couldUnionOrIntersectionContainTypeParameters(type)); + type.flags & 196608 && couldUnionOrIntersectionContainTypeVariables(type)); } - function couldUnionOrIntersectionContainTypeParameters(type) { - if (type.couldContainTypeParameters === undefined) { - type.couldContainTypeParameters = ts.forEach(type.types, couldContainTypeParameters); + function couldUnionOrIntersectionContainTypeVariables(type) { + if (type.couldContainTypeVariables === undefined) { + type.couldContainTypeVariables = ts.forEach(type.types, couldContainTypeVariables); } - return type.couldContainTypeParameters; + return type.couldContainTypeVariables; } function isTypeParameterAtTopLevel(type, typeParameter) { return type === typeParameter || type.flags & 196608 && ts.forEach(type.types, function (t) { return isTypeParameterAtTopLevel(t, typeParameter); }); } - function inferTypes(context, originalSource, originalTarget) { - var typeParameters = context.signature.typeParameters; + function inferTypeForHomomorphicMappedType(source, target) { + var properties = getPropertiesOfType(source); + var indexInfo = getIndexInfoOfType(source, 0); + if (properties.length === 0 && !indexInfo) { + return undefined; + } + var typeVariable = getIndexedAccessType(getConstraintTypeFromMappedType(target).type, getTypeParameterFromMappedType(target)); + var typeVariableArray = [typeVariable]; + var typeInferences = createTypeInferencesObject(); + var typeInferencesArray = [typeInferences]; + var templateType = getTemplateTypeFromMappedType(target); + var readonlyMask = target.declaration.readonlyToken ? false : true; + var optionalMask = target.declaration.questionToken ? 0 : 67108864; + var members = createSymbolTable(properties); + for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) { + var prop = properties_5[_i]; + var inferredPropType = inferTargetType(getTypeOfSymbol(prop)); + if (!inferredPropType) { + return undefined; + } + var inferredProp = createSymbol(4 | prop.flags & optionalMask, prop.name); + inferredProp.checkFlags = readonlyMask && isReadonlySymbol(prop) ? 8 : 0; + inferredProp.declarations = prop.declarations; + inferredProp.type = inferredPropType; + members.set(prop.name, inferredProp); + } + if (indexInfo) { + var inferredIndexType = inferTargetType(indexInfo.type); + if (!inferredIndexType) { + return undefined; + } + indexInfo = createIndexInfo(inferredIndexType, readonlyMask && indexInfo.isReadonly); + } + return createAnonymousType(undefined, members, emptyArray, emptyArray, indexInfo, undefined); + function inferTargetType(sourceType) { + typeInferences.primary = undefined; + typeInferences.secondary = undefined; + inferTypes(typeVariableArray, typeInferencesArray, sourceType, templateType); + var inferences = typeInferences.primary || typeInferences.secondary; + return inferences && getUnionType(inferences, true); + } + } + function inferTypesWithContext(context, originalSource, originalTarget) { + inferTypes(context.signature.typeParameters, context.inferences, originalSource, originalTarget); + } + function inferTypes(typeVariables, typeInferences, originalSource, originalTarget) { var sourceStack; var targetStack; var depth = 0; @@ -26319,7 +28795,7 @@ var ts; return false; } function inferFromTypes(source, target) { - if (!couldContainTypeParameters(target)) { + if (!couldContainTypeVariables(target)) { return; } if (source.aliasSymbol && source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol) { @@ -26358,13 +28834,13 @@ var ts; target = removeTypesFromUnionOrIntersection(target, matchingTypes); } } - if (target.flags & 16384) { + if (target.flags & 540672) { if (source.flags & 8388608) { return; } - for (var i = 0; i < typeParameters.length; i++) { - if (target === typeParameters[i]) { - var inferences = context.inferences[i]; + for (var i = 0; i < typeVariables.length; i++) { + if (target === typeVariables[i]) { + var inferences = typeInferences[i]; if (!inferences.isFixed) { var candidates = inferiority ? inferences.secondary || (inferences.secondary = []) : @@ -26372,7 +28848,7 @@ var ts; if (!ts.contains(candidates, source)) { candidates.push(source); } - if (!isTypeParameterAtTopLevel(originalTarget, target)) { + if (target.flags & 16384 && !isTypeParameterAtTopLevel(originalTarget, target)) { inferences.topLevel = false; } } @@ -26390,21 +28866,21 @@ var ts; } else if (target.flags & 196608) { var targetTypes = target.types; - var typeParameterCount = 0; - var typeParameter = void 0; - for (var _d = 0, targetTypes_2 = targetTypes; _d < targetTypes_2.length; _d++) { - var t = targetTypes_2[_d]; - if (t.flags & 16384 && ts.contains(typeParameters, t)) { - typeParameter = t; - typeParameterCount++; + var typeVariableCount = 0; + var typeVariable = void 0; + for (var _d = 0, targetTypes_3 = targetTypes; _d < targetTypes_3.length; _d++) { + var t = targetTypes_3[_d]; + if (t.flags & 540672 && ts.contains(typeVariables, t)) { + typeVariable = t; + typeVariableCount++; } else { inferFromTypes(source, t); } } - if (typeParameterCount === 1) { + if (typeVariableCount === 1) { inferiority++; - inferFromTypes(source, typeParameter); + inferFromTypes(source, typeVariable); inferiority--; } } @@ -26421,14 +28897,14 @@ var ts; if (isInProcess(source, target)) { return; } - if (isDeeplyNestedGeneric(source, sourceStack, depth) && isDeeplyNestedGeneric(target, targetStack, depth)) { + if (isDeeplyNestedType(source, sourceStack, depth) && isDeeplyNestedType(target, targetStack, depth)) { return; } var key = source.id + "," + target.id; - if (visited[key]) { + if (visited.get(key)) { return; } - visited[key] = true; + visited.set(key, true); if (depth === 0) { sourceStack = []; targetStack = []; @@ -26444,9 +28920,16 @@ var ts; function inferFromObjectTypes(source, target) { if (getObjectFlags(target) & 32) { var constraintType = getConstraintTypeFromMappedType(target); - if (getObjectFlags(source) & 32) { - inferFromTypes(getConstraintTypeFromMappedType(source), constraintType); - inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target)); + if (constraintType.flags & 262144) { + var index = ts.indexOf(typeVariables, constraintType.type); + if (index >= 0 && !typeInferences[index].isFixed) { + var inferredType = inferTypeForHomomorphicMappedType(source, target); + if (inferredType) { + inferiority++; + inferFromTypes(inferredType, typeVariables[index]); + inferiority--; + } + } return; } if (constraintType.flags & 16384) { @@ -26462,8 +28945,8 @@ var ts; } function inferFromProperties(source, target) { var properties = getPropertiesOfObjectType(target); - for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) { - var targetProp = properties_4[_i]; + for (var _i = 0, properties_6 = properties; _i < properties_6.length; _i++) { + var targetProp = properties_6[_i]; var sourceProp = getPropertyOfObjectType(source, targetProp.name); if (sourceProp) { inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); @@ -26513,8 +28996,8 @@ var ts; } } function typeIdenticalToSomeType(type, types) { - for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { - var t = types_10[_i]; + for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { + var t = types_13[_i]; if (isTypeIdenticalTo(t, type)) { return true; } @@ -26555,7 +29038,13 @@ var ts; inferenceSucceeded = !!unionOrSuperType; } else { - inferredType = emptyObjectType; + var defaultType = getDefaultFromTypeParameter(context.signature.typeParameters[index]); + if (defaultType) { + inferredType = instantiateType(defaultType, combineTypeMappers(createBackreferenceMapper(context.signature.typeParameters, index), getInferenceMapper(context))); + } + else { + inferredType = context.useAnyForNoInferences ? anyType : emptyObjectType; + } inferenceSucceeded = true; } context.inferredTypes[index] = inferredType; @@ -26588,19 +29077,7 @@ var ts; return links.resolvedSymbol; } function isInTypeQuery(node) { - while (node) { - switch (node.kind) { - case 160: - return true; - case 70: - case 141: - node = node.parent; - continue; - default: - return false; - } - } - ts.Debug.fail("should not get here"); + return !!ts.findAncestor(node, function (n) { return n.kind === 161 ? true : n.kind === 70 || n.kind === 142 ? false : "quit"; }); } function getFlowCacheKey(node) { if (node.kind === 70) { @@ -26610,7 +29087,7 @@ var ts; if (node.kind === 98) { return "0"; } - if (node.kind === 177) { + if (node.kind === 178) { var key = getFlowCacheKey(node.expression); return key && key + "." + node.name.text; } @@ -26621,7 +29098,7 @@ var ts; case 70: case 98: return node; - case 177: + case 178: return getLeftmostIdentifierOrThis(node.expression); } return undefined; @@ -26630,19 +29107,21 @@ var ts; switch (source.kind) { case 70: return target.kind === 70 && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 223 || target.kind === 174) && + (target.kind === 225 || target.kind === 175) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 98: return target.kind === 98; - case 177: - return target.kind === 177 && + case 96: + return target.kind === 96; + case 178: + return target.kind === 178 && source.name.text === target.name.text && isMatchingReference(source.expression, target.expression); } return false; } function containsMatchingReference(source, target) { - while (source.kind === 177) { + while (source.kind === 178) { source = source.expression; if (isMatchingReference(source, target)) { return true; @@ -26651,7 +29130,7 @@ var ts; return false; } function containsMatchingReferenceDiscriminant(source, target) { - return target.kind === 177 && + return target.kind === 178 && containsMatchingReference(source, target.expression) && isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.text); } @@ -26659,7 +29138,7 @@ var ts; if (expr.kind === 70) { return getTypeOfSymbol(getResolvedSymbol(expr)); } - if (expr.kind === 177) { + if (expr.kind === 178) { var type = getDeclaredTypeOfReference(expr.expression); return type && getTypeOfPropertyOfType(type, expr.name.text); } @@ -26668,9 +29147,9 @@ var ts; function isDiscriminantProperty(type, name) { if (type && type.flags & 65536) { var prop = getUnionOrIntersectionProperty(type, name); - if (prop && prop.flags & 268435456) { + if (prop && getCheckFlags(prop) & 2) { if (prop.isDiscriminantProperty === undefined) { - prop.isDiscriminantProperty = prop.hasNonUniformType && isLiteralType(getTypeOfSymbol(prop)); + prop.isDiscriminantProperty = prop.checkFlags & 32 && isLiteralType(getTypeOfSymbol(prop)); } return prop.isDiscriminantProperty; } @@ -26689,7 +29168,7 @@ var ts; } } } - if (callExpression.expression.kind === 177 && + if (callExpression.expression.kind === 178 && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -26728,8 +29207,8 @@ var ts; } function getTypeFactsOfTypes(types) { var result = 0; - for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { - var t = types_11[_i]; + for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { + var t = types_14[_i]; result |= getTypeFacts(t); } return result; @@ -26737,7 +29216,7 @@ var ts; function isFunctionObjectType(type) { var resolved = resolveStructuredTypeMembers(type); return !!(resolved.callSignatures.length || resolved.constructSignatures.length || - resolved.members["bind"] && isTypeSubtypeOf(type, globalFunctionType)); + resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType)); } function getTypeFacts(type) { var flags = type.flags; @@ -26780,9 +29259,11 @@ var ts; if (flags & 512) { return strictNullChecks ? 1981320 : 4193160; } - if (flags & 16384) { - var constraint = getConstraintOfTypeParameter(type); - return getTypeFacts(constraint || emptyObjectType); + if (flags & 16777216) { + return strictNullChecks ? 6166480 : 8378320; + } + if (flags & 540672) { + return getTypeFacts(getBaseConstraintOfType(type) || emptyObjectType); } if (flags & 196608) { return getTypeFactsOfTypes(type.types); @@ -26808,17 +29289,23 @@ var ts; } function getTypeOfDestructuredArrayElement(type, index) { return isTupleLikeType(type) && getTypeOfPropertyOfType(type, "" + index) || - checkIteratedTypeOrElementType(type, undefined, false) || + checkIteratedTypeOrElementType(type, undefined, false, false) || unknownType; } function getTypeOfDestructuredSpreadExpression(type) { - return createArrayType(checkIteratedTypeOrElementType(type, undefined, false) || unknownType); + return createArrayType(checkIteratedTypeOrElementType(type, undefined, false, false) || unknownType); } function getAssignedTypeOfBinaryExpression(node) { - return node.parent.kind === 175 || node.parent.kind === 257 ? + var isDestructuringDefaultAssignment = node.parent.kind === 176 && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 260 && isDestructuringAssignmentTarget(node.parent.parent); + return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } + function isDestructuringAssignmentTarget(parent) { + return parent.parent.kind === 193 && parent.parent.left === parent || + parent.parent.kind === 215 && parent.parent.initializer === parent; + } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), ts.indexOf(node.elements, element)); } @@ -26834,21 +29321,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 212: + case 214: return stringType; - case 213: - return checkRightHandSideOfForOf(parent.expression) || unknownType; - case 192: + case 215: + return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || unknownType; + case 193: return getAssignedTypeOfBinaryExpression(parent); - case 186: + case 187: return undefinedType; - case 175: + case 176: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 196: + case 197: return getAssignedTypeOfSpreadExpression(parent); - case 257: + case 260: return getAssignedTypeOfPropertyAssignment(parent); - case 258: + case 261: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return unknownType; @@ -26856,7 +29343,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 172 ? + var type = pattern.kind === 173 ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, ts.indexOf(pattern.elements, node)) : @@ -26871,35 +29358,35 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 212) { + if (node.parent.parent.kind === 214) { return stringType; } - if (node.parent.parent.kind === 213) { - return checkRightHandSideOfForOf(node.parent.parent.expression) || unknownType; + if (node.parent.parent.kind === 215) { + return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || unknownType; } return unknownType; } function getInitialType(node) { - return node.kind === 223 ? + return node.kind === 225 ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function getInitialOrAssignedType(node) { - return node.kind === 223 || node.kind === 174 ? + return node.kind === 225 || node.kind === 175 ? getInitialType(node) : getAssignedType(node); } function isEmptyArrayAssignment(node) { - return node.kind === 223 && node.initializer && + return node.kind === 225 && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 174 && node.parent.kind === 192 && + node.kind !== 175 && node.parent.kind === 193 && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 183: + case 184: return getReferenceCandidate(node.expression); - case 192: + case 193: switch (node.operatorToken.kind) { case 57: return getReferenceCandidate(node.left); @@ -26911,13 +29398,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 183 || - parent.kind === 192 && parent.operatorToken.kind === 57 && parent.left === node || - parent.kind === 192 && parent.operatorToken.kind === 25 && parent.right === node ? + return parent.kind === 184 || + parent.kind === 193 && parent.operatorToken.kind === 57 && parent.left === node || + parent.kind === 193 && parent.operatorToken.kind === 25 && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 253) { + if (clause.kind === 256) { var caseType = getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); return isUnitType(caseType) ? caseType : undefined; } @@ -26963,8 +29450,29 @@ var ts; } return f(type) ? type : neverType; } - function mapType(type, f) { - return type.flags & 65536 ? getUnionType(ts.map(type.types, f)) : f(type); + function mapType(type, mapper) { + if (!(type.flags & 65536)) { + return mapper(type); + } + var types = type.types; + var mappedType; + var mappedTypes; + for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { + var current = types_15[_i]; + var t = mapper(current); + if (t) { + if (!mappedType) { + mappedType = t; + } + else if (!mappedTypes) { + mappedTypes = [mappedType, t]; + } + else { + mappedTypes.push(t); + } + } + } + return mappedTypes ? getUnionType(mappedTypes) : mappedType; } function extractTypesOfKind(type, kind) { return filterType(type, function (t) { return (t.flags & kind) !== 0; }); @@ -26998,7 +29506,7 @@ var ts; return evolvingArrayTypes[elementType.id] || (evolvingArrayTypes[elementType.id] = createEvolvingArrayType(elementType)); } function addEvolvingArrayElementType(evolvingArrayType, node) { - var elementType = getBaseTypeOfLiteralType(getTypeOfExpression(node)); + var elementType = getBaseTypeOfLiteralType(getContextFreeTypeOfExpression(node)); return isTypeSubsetOf(elementType, evolvingArrayType.elementType) ? evolvingArrayType : getEvolvingArrayType(getUnionType([evolvingArrayType.elementType, elementType])); } function createFinalArrayType(elementType) { @@ -27019,8 +29527,8 @@ var ts; } function isEvolvingArrayTypeList(types) { var hasEvolvingArrayType = false; - for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { - var t = types_12[_i]; + for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { + var t = types_16[_i]; if (!(t.flags & 8192)) { if (!(getObjectFlags(t) & 256)) { return false; @@ -27038,11 +29546,11 @@ var ts; function isEvolvingArrayOperationTarget(node) { var root = getReferenceRoot(node); var parent = root.parent; - var isLengthPushOrUnshift = parent.kind === 177 && (parent.name.text === "length" || - parent.parent.kind === 179 && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 178 && + var isLengthPushOrUnshift = parent.kind === 178 && (parent.name.text === "length" || + parent.parent.kind === 180 && ts.isPushOrUnshiftIdentifier(parent.name)); + var isElementAssignment = parent.kind === 179 && parent.expression === root && - parent.parent.kind === 192 && + parent.parent.kind === 193 && parent.parent.operatorToken.kind === 57 && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -27069,19 +29577,17 @@ var ts; } return false; } - function getFlowTypeOfReference(reference, declaredType, assumeInitialized, flowContainer) { + function getFlowTypeOfReference(reference, declaredType, initialType, flowContainer, couldBeUninitialized) { + if (initialType === void 0) { initialType = declaredType; } var key; - if (!reference.flowNode || assumeInitialized && !(declaredType.flags & 1033215)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 17810431)) { return declaredType; } - var initialType = assumeInitialized ? declaredType : - declaredType === autoType || declaredType === autoArrayType ? undefinedType : - includeFalsyTypes(declaredType, 2048); var visitedFlowStart = visitedFlowCount; var evolvedType = getTypeFromFlowType(getTypeAtFlowNode(reference.flowNode)); visitedFlowCount = visitedFlowStart; var resultType = getObjectFlags(evolvedType) & 256 && isEvolvingArrayOperationTarget(reference) ? anyArrayType : finalizeEvolvingArrayType(evolvedType); - if (reference.parent.kind === 201 && getTypeWithFacts(resultType, 524288).flags & 8192) { + if (reference.parent.kind === 202 && getTypeWithFacts(resultType, 524288).flags & 8192) { return declaredType; } return resultType; @@ -27095,7 +29601,16 @@ var ts; } } var type = void 0; - if (flow.flags & 16) { + if (flow.flags & 4096) { + flow.locked = true; + type = getTypeAtFlowNode(flow.antecedent); + flow.locked = false; + } + else if (flow.flags & 2048) { + flow = flow.antecedent; + continue; + } + else if (flow.flags & 16) { type = getTypeAtFlowAssignment(flow); if (!type) { flow = flow.antecedent; @@ -27126,7 +29641,7 @@ var ts; } else if (flow.flags & 2) { var container = flow.container; - if (container && container !== flowContainer && reference.kind !== 177) { + if (container && container !== flowContainer && reference.kind !== 178 && reference.kind !== 98) { flow = container.flowNode; continue; } @@ -27169,7 +29684,7 @@ var ts; } function getTypeAtFlowArrayMutation(flow) { var node = flow.node; - var expr = node.kind === 179 ? + var expr = node.kind === 180 ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -27177,7 +29692,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (getObjectFlags(type) & 256) { var evolvedType_1 = type; - if (node.kind === 179) { + if (node.kind === 180) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -27229,6 +29744,9 @@ var ts; var seenIncomplete = false; for (var _i = 0, _a = flow.antecedents; _i < _a.length; _i++) { var antecedent = _a[_i]; + if (antecedent.flags & 2048 && antecedent.lock.locked) { + continue; + } var flowType = getTypeAtFlowNode(antecedent); var type = getTypeFromFlowType(flowType); if (type === declaredType && declaredType === initialType) { @@ -27252,8 +29770,9 @@ var ts; if (!key) { key = getFlowCacheKey(reference); } - if (cache[key]) { - return cache[key]; + var cached = cache.get(key); + if (cached) { + return cached; } for (var i = flowLoopStart; i < flowLoopCount; i++) { if (flowLoopNodes[i] === flow && flowLoopKeys[i] === key && flowLoopTypes[i].length) { @@ -27275,8 +29794,9 @@ var ts; firstAntecedentType = flowType; } var type = getTypeFromFlowType(flowType); - if (cache[key]) { - return cache[key]; + var cached_1 = cache.get(key); + if (cached_1) { + return cached_1; } if (!ts.contains(antecedentTypes, type)) { antecedentTypes.push(type); @@ -27292,10 +29812,11 @@ var ts; if (isIncomplete(firstAntecedentType)) { return createFlowType(result, true); } - return cache[key] = result; + cache.set(key, result); + return result; } function isMatchingReferenceDiscriminant(expr) { - return expr.kind === 177 && + return expr.kind === 178 && declaredType.flags & 65536 && isMatchingReference(reference, expr.expression) && isDiscriminantProperty(declaredType, expr.name.text); @@ -27329,10 +29850,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 187 && right_1.kind === 9) { + if (left_1.kind === 188 && right_1.kind === 9) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 187 && left_1.kind === 9) { + if (right_1.kind === 188 && left_1.kind === 9) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (isMatchingReference(reference, left_1)) { @@ -27378,7 +29899,7 @@ var ts; assumeTrue ? 16384 : 131072; return getTypeWithFacts(type, facts); } - if (type.flags & 33281) { + if (type.flags & 16810497) { return type; } if (assumeTrue) { @@ -27403,14 +29924,22 @@ var ts; assumeTrue = !assumeTrue; } if (assumeTrue && !(type.flags & 65536)) { - var targetType = typeofTypesByName[literal.text]; - if (targetType && isTypeSubtypeOf(targetType, type)) { - return targetType; + var targetType = typeofTypesByName.get(literal.text); + if (targetType) { + if (isTypeSubtypeOf(targetType, type)) { + return targetType; + } + if (type.flags & 540672) { + var constraint = getBaseConstraintOfType(type) || anyType; + if (isTypeSubtypeOf(targetType, constraint)) { + return getIntersectionType([type, targetType]); + } + } } } var facts = assumeTrue ? - typeofEQFacts[literal.text] || 64 : - typeofNEFacts[literal.text] || 8192; + typeofEQFacts.get(literal.text) || 64 : + typeofNEFacts.get(literal.text) || 8192; return getTypeWithFacts(type, facts); } function narrowTypeBySwitchOnDiscriminant(type, switchStatement, clauseStart, clauseEnd) { @@ -27479,10 +30008,9 @@ var ts; return assignableType; } } - var targetType = type.flags & 16384 ? getApparentType(type) : type; return isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : - isTypeAssignableTo(candidate, targetType) ? candidate : + isTypeAssignableTo(candidate, type) ? candidate : getIntersectionType([type, candidate]); } function narrowTypeByTypePredicate(type, callExpression, assumeTrue) { @@ -27510,7 +30038,7 @@ var ts; } else { var invokedExpression = ts.skipParentheses(callExpression.expression); - if (invokedExpression.kind === 178 || invokedExpression.kind === 177) { + if (invokedExpression.kind === 179 || invokedExpression.kind === 178) { var accessExpression = invokedExpression; var possibleReference = ts.skipParentheses(accessExpression.expression); if (isMatchingReference(reference, possibleReference)) { @@ -27527,15 +30055,16 @@ var ts; switch (expr.kind) { case 70: case 98: - case 177: + case 96: + case 178: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 179: + case 180: return narrowTypeByTypePredicate(type, expr, assumeTrue); - case 183: + case 184: return narrowType(type, expr.expression, assumeTrue); - case 192: + case 193: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 190: + case 191: if (expr.operator === 50) { return narrowType(type, expr.operand, !assumeTrue); } @@ -27559,15 +30088,12 @@ var ts; return getTypeOfSymbol(symbol); } function getControlFlowContainer(node) { - while (true) { - node = node.parent; - if (ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 231 || - node.kind === 261 || - node.kind === 147) { - return node; - } - } + return ts.findAncestor(node.parent, function (node) { + return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || + node.kind === 233 || + node.kind === 264 || + node.kind === 148; + }); } function isParameterAssigned(symbol) { var func = ts.getRootDeclaration(symbol.valueDeclaration).parent; @@ -27581,21 +30107,13 @@ var ts; return symbol.isAssigned || false; } function hasParentWithAssignmentsMarked(node) { - while (true) { - node = node.parent; - if (!node) { - return false; - } - if (ts.isFunctionLike(node) && getNodeLinks(node).flags & 4194304) { - return true; - } - } + return !!ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !!(getNodeLinks(node).flags & 4194304); }); } function markParameterAssignments(node) { if (node.kind === 70) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 144) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 145) { symbol.isAssigned = true; } } @@ -27607,6 +30125,14 @@ var ts; function isConstVariable(symbol) { return symbol.flags & 3 && (getDeclarationNodeFlagsFromSymbol(symbol) & 2) !== 0 && getTypeOfSymbol(symbol) !== autoArrayType; } + function removeOptionalityFromDeclaredType(declaredType, declaration) { + var annotationIncludesUndefined = strictNullChecks && + declaration.kind === 145 && + declaration.initializer && + getFalsyFlags(declaredType) & 2048 && + !(getFalsyFlags(checkExpression(declaration.initializer)) & 2048); + return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 131072) : declaredType; + } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); if (symbol === unknownSymbol) { @@ -27615,16 +30141,14 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2) { - if (container.kind === 185) { + if (container.kind === 186) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasModifier(container, 256)) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method); } } - if (node.flags & 524288) { - getNodeLinks(container).flags |= 8192; - } + getNodeLinks(container).flags |= 8192; return getTypeOfSymbol(symbol); } if (symbol.flags & 8388608 && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { @@ -27633,7 +30157,7 @@ var ts; var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); if (localOrExportSymbol.flags & 32) { var declaration_1 = localOrExportSymbol.valueDeclaration; - if (declaration_1.kind === 226 + if (declaration_1.kind === 228 && ts.nodeIsDecorated(declaration_1)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -27645,11 +30169,11 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration_1.kind === 197) { + else if (declaration_1.kind === 198) { var container = ts.getThisContainer(node, false); while (container !== undefined) { if (container.parent === declaration_1) { - if (container.kind === 147 && ts.hasModifier(container, 32)) { + if (container.kind === 148 && ts.hasModifier(container, 32)) { getNodeLinks(declaration_1).flags |= 8388608; getNodeLinks(node).flags |= 16777216; } @@ -27661,6 +30185,7 @@ var ts; } checkCollisionWithCapturedSuperVariable(node, node); checkCollisionWithCapturedThisVariable(node, node); + checkCollisionWithCapturedNewTargetVariable(node, node); checkNestedBlockScopedBinding(node, symbol); var type = getTypeOfSymbol(localOrExportSymbol); var declaration = localOrExportSymbol.valueDeclaration; @@ -27678,22 +30203,25 @@ var ts; if (!(localOrExportSymbol.flags & 3) || assignmentKind === 1 || !declaration) { return type; } - var isParameter = ts.getRootDeclaration(declaration).kind === 144; + var isParameter = ts.getRootDeclaration(declaration).kind === 145; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; - while (flowContainer !== declarationContainer && (flowContainer.kind === 184 || - flowContainer.kind === 185 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 185 || + flowContainer.kind === 186 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } var assumeInitialized = isParameter || isOuterVariable || - type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1) !== 0) || + type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1) !== 0 || isInTypeQuery(node)) || ts.isInAmbientContext(declaration); - var flowType = getFlowTypeOfReference(node, type, assumeInitialized, flowContainer); + var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, ts.getRootDeclaration(declaration)) : type) : + type === autoType || type === autoArrayType ? undefinedType : + includeFalsyTypes(type, 2048); + var flowType = getFlowTypeOfReference(node, type, initialType, flowContainer, !assumeInitialized); if (type === autoType || type === autoArrayType) { if (flowType === autoType || flowType === autoArrayType) { - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { error(declaration.name, ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined, symbolToString(symbol), typeToString(flowType)); error(node, ts.Diagnostics.Variable_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType)); } @@ -27707,19 +30235,12 @@ var ts; return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType; } function isInsideFunction(node, threshold) { - var current = node; - while (current && current !== threshold) { - if (ts.isFunctionLike(current)) { - return true; - } - current = current.parent; - } - return false; + return !!ts.findAncestor(node, function (n) { return n === threshold ? "quit" : ts.isFunctionLike(n); }); } function checkNestedBlockScopedBinding(node, symbol) { if (languageVersion >= 2 || (symbol.flags & (2 | 32)) === 0 || - symbol.valueDeclaration.parent.kind === 256) { + symbol.valueDeclaration.parent.kind === 259) { return; } var container = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); @@ -27737,8 +30258,8 @@ var ts; if (usedInFunction) { getNodeLinks(current).flags |= 65536; } - if (container.kind === 211 && - ts.getAncestor(symbol.valueDeclaration, 224).parent === container && + if (container.kind === 213 && + ts.getAncestor(symbol.valueDeclaration, 226).parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 2097152; } @@ -27750,33 +30271,25 @@ var ts; } function isAssignedInBodyOfForStatement(node, container) { var current = node; - while (current.parent.kind === 183) { + while (current.parent.kind === 184) { current = current.parent; } var isAssigned = false; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 190 || current.parent.kind === 191)) { + else if ((current.parent.kind === 191 || current.parent.kind === 192)) { var expr = current.parent; isAssigned = expr.operator === 42 || expr.operator === 43; } if (!isAssigned) { return false; } - while (current !== container) { - if (current === container.statement) { - return true; - } - else { - current = current.parent; - } - } - return false; + return !!ts.findAncestor(current, function (n) { return n === container ? "quit" : n === container.statement; }); } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2; - if (container.kind === 147 || container.kind === 150) { + if (container.kind === 148 || container.kind === 151) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4; } @@ -27807,42 +30320,45 @@ var ts; var baseConstructorType = getBaseConstructorTypeOfClass(classInstanceType); return baseConstructorType === nullWideningType; } + function checkThisBeforeSuper(node, container, diagnosticMessage) { + var containingClassDecl = container.parent; + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(containingClassDecl); + if (baseTypeNode && !classDeclarationExtendsNull(containingClassDecl)) { + var superCall = getSuperCallInConstructor(container); + if (!superCall || superCall.end > node.pos) { + error(node, diagnosticMessage); + } + } + } function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 150) { - var containingClassDecl = container.parent; - var baseTypeNode = ts.getClassExtendsHeritageClauseElement(containingClassDecl); - if (baseTypeNode && !classDeclarationExtendsNull(containingClassDecl)) { - var superCall = getSuperCallInConstructor(container); - if (!superCall || superCall.end > node.pos) { - error(node, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); - } - } + if (container.kind === 151) { + checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } - if (container.kind === 185) { + if (container.kind === 186) { container = ts.getThisContainer(container, false); needToCaptureLexicalThis = (languageVersion < 2); } switch (container.kind) { - case 230: + case 232: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); break; - case 229: + case 231: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 150: + case 151: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; + case 148: case 147: - case 146: if (ts.getModifierFlags(container) & 32) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; - case 142: + case 143: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -27851,8 +30367,8 @@ var ts; } if (ts.isFunctionLike(container) && (!isInParameterInitializerBeforeContainingFunction(node) || ts.getThisParameter(container))) { - if (container.kind === 184 && - ts.isInJavaScriptFile(container.parent) && + if (container.kind === 185 && + container.parent.kind === 193 && ts.getSpecialPropertyAssignmentKind(container.parent) === 3) { var className = container.parent .left @@ -27871,7 +30387,7 @@ var ts; if (ts.isClassLike(container.parent)) { var symbol = getSymbolOfNode(container.parent); var type = ts.hasModifier(container, 32) ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType; - return getFlowTypeOfReference(node, type, true, undefined); + return getFlowTypeOfReference(node, type); } if (ts.isInJavaScriptFile(node)) { var type = getTypeForThisExpressionFromJSDoc(container); @@ -27879,34 +30395,29 @@ var ts; return type; } } - if (compilerOptions.noImplicitThis) { + if (noImplicitThis) { error(node, ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation); } return anyType; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 274) { + if (jsdocType && jsdocType.kind === 278) { var jsDocFunctionType = jsdocType; - if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].type.kind === 277) { + if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].type.kind === 281) { return getTypeFromTypeNode(jsDocFunctionType.parameters[0].type); } } } function isInConstructorArgumentInitializer(node, constructorDecl) { - for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 144) { - return true; - } - } - return false; + return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 145; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 179 && node.parent.expression === node; + var isCallExpression = node.parent.kind === 180 && node.parent.expression === node; var container = ts.getSuperContainer(node, true); var needToCaptureLexicalThis = false; if (!isCallExpression) { - while (container && container.kind === 185) { + while (container && container.kind === 186) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = languageVersion < 2; } @@ -27914,17 +30425,14 @@ var ts; var canUseSuperExpression = isLegalUsageOfSuperExpression(container); var nodeCheckFlag = 0; if (!canUseSuperExpression) { - var current = node; - while (current && current !== container && current.kind !== 142) { - current = current.parent; - } - if (current && current.kind === 142) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 143; }); + if (current && current.kind === 143) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 176)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 177)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -27932,6 +30440,9 @@ var ts; } return unknownType; } + if (!isCallExpression && container.kind === 151) { + checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); + } if ((ts.getModifierFlags(container) & 32) || isCallExpression) { nodeCheckFlag = 512; } @@ -27939,7 +30450,7 @@ var ts; nodeCheckFlag = 256; } getNodeLinks(node).flags |= nodeCheckFlag; - if (container.kind === 149 && ts.getModifierFlags(container) & 256) { + if (container.kind === 150 && ts.getModifierFlags(container) & 256) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096; } @@ -27950,7 +30461,7 @@ var ts; if (needToCaptureLexicalThis) { captureLexicalThis(node.parent, container); } - if (container.parent.kind === 176) { + if (container.parent.kind === 177) { if (languageVersion < 2) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return unknownType; @@ -27968,7 +30479,7 @@ var ts; } return unknownType; } - if (container.kind === 150 && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 151 && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return unknownType; } @@ -27980,32 +30491,50 @@ var ts; return false; } if (isCallExpression) { - return container.kind === 150; + return container.kind === 151; } else { - if (ts.isClassLike(container.parent) || container.parent.kind === 176) { + if (ts.isClassLike(container.parent) || container.parent.kind === 177) { if (ts.getModifierFlags(container) & 32) { - return container.kind === 149 || - container.kind === 148 || - container.kind === 151 || - container.kind === 152; + return container.kind === 150 || + container.kind === 149 || + container.kind === 152 || + container.kind === 153; } else { - return container.kind === 149 || - container.kind === 148 || - container.kind === 151 || + return container.kind === 150 || + container.kind === 149 || container.kind === 152 || + container.kind === 153 || + container.kind === 148 || container.kind === 147 || - container.kind === 146 || - container.kind === 150; + container.kind === 151; } } } return false; } } + function getContainingObjectLiteral(func) { + return (func.kind === 150 || + func.kind === 152 || + func.kind === 153) && func.parent.kind === 177 ? func.parent : + func.kind === 185 && func.parent.kind === 260 ? func.parent.parent : + undefined; + } + function getThisTypeArgument(type) { + return getObjectFlags(type) & 4 && type.target === globalThisType ? type.typeArguments[0] : undefined; + } + function getThisTypeFromContextualType(type) { + return mapType(type, function (t) { + return t.flags & 131072 ? ts.forEach(t.types, getThisTypeArgument) : getThisTypeArgument(t); + }); + } function getContextualThisParameterType(func) { - if (isContextSensitiveFunctionOrObjectLiteralMethod(func) && func.kind !== 185) { + if (func.kind === 186) { + return undefined; + } + if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { var contextualSignature = getContextualSignature(func); if (contextualSignature) { var thisParameter = contextualSignature.thisParameter; @@ -28014,29 +30543,55 @@ var ts; } } } + if (noImplicitThis) { + var containingLiteral = getContainingObjectLiteral(func); + if (containingLiteral) { + var contextualType = getApparentTypeOfContextualType(containingLiteral); + var literal = containingLiteral; + var type = contextualType; + while (type) { + var thisType = getThisTypeFromContextualType(type); + if (thisType) { + return instantiateType(thisType, getContextualMapper(containingLiteral)); + } + if (literal.parent.kind !== 260) { + break; + } + literal = literal.parent.parent; + type = getApparentTypeOfContextualType(literal); + } + return contextualType ? getNonNullableType(contextualType) : checkExpressionCached(containingLiteral); + } + if (func.parent.kind === 193 && func.parent.operatorToken.kind === 57) { + var target = func.parent.left; + if (target.kind === 178 || target.kind === 179) { + return checkExpressionCached(target.expression); + } + } + } return undefined; } function getContextuallyTypedParameterType(parameter) { var func = parameter.parent; if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { var iife = ts.getImmediatelyInvokedFunctionExpression(func); - if (iife) { + if (iife && iife.arguments) { var indexOfParameter = ts.indexOf(func.parameters, parameter); - if (iife.arguments && indexOfParameter < iife.arguments.length) { - if (parameter.dotDotDotToken) { - var restTypes = []; - for (var i = indexOfParameter; i < iife.arguments.length; i++) { - restTypes.push(getWidenedLiteralType(checkExpression(iife.arguments[i]))); - } - return createArrayType(getUnionType(restTypes)); + if (parameter.dotDotDotToken) { + var restTypes = []; + for (var i = indexOfParameter; i < iife.arguments.length; i++) { + restTypes.push(getWidenedLiteralType(checkExpression(iife.arguments[i]))); } - var links = getNodeLinks(iife); - var cached = links.resolvedSignature; - links.resolvedSignature = anySignature; - var type = getWidenedLiteralType(checkExpression(iife.arguments[indexOfParameter])); - links.resolvedSignature = cached; - return type; + return restTypes.length ? createArrayType(getUnionType(restTypes)) : undefined; } + var links = getNodeLinks(iife); + var cached = links.resolvedSignature; + links.resolvedSignature = anySignature; + var type = indexOfParameter < iife.arguments.length ? + getWidenedLiteralType(checkExpression(iife.arguments[indexOfParameter])) : + parameter.initializer ? undefined : undefinedWideningType; + links.resolvedSignature = cached; + return type; } var contextualSignature = getContextualSignature(func); if (contextualSignature) { @@ -28061,7 +30616,7 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 144) { + if (declaration.kind === 145) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -28072,11 +30627,11 @@ var ts; } if (ts.isBindingPattern(declaration.parent)) { var parentDeclaration = declaration.parent.parent; - var name_19 = declaration.propertyName || declaration.name; - if (ts.isVariableLike(parentDeclaration) && + var name = declaration.propertyName || declaration.name; + if (parentDeclaration.kind !== 175 && parentDeclaration.type && - !ts.isBindingPattern(name_19)) { - var text = ts.getTextOfPropertyName(name_19); + !ts.isBindingPattern(name)) { + var text = ts.getTextOfPropertyName(name); if (text) { return getTypeOfPropertyOfType(getTypeFromTypeNode(parentDeclaration.type), text); } @@ -28087,33 +30642,34 @@ var ts; } function getContextualTypeForReturnExpression(node) { var func = ts.getContainingFunction(node); - if (ts.isAsyncFunctionLike(func)) { - var contextualReturnType = getContextualReturnType(func); - if (contextualReturnType) { - return getPromisedType(contextualReturnType); + if (func) { + var functionFlags = ts.getFunctionFlags(func); + if (functionFlags & 1) { + return undefined; } - return undefined; - } - if (func && !func.asteriskToken) { - return getContextualReturnType(func); + var contextualReturnType = getContextualReturnType(func); + return functionFlags & 2 + ? contextualReturnType && getAwaitedTypeOfPromise(contextualReturnType) + : contextualReturnType; } return undefined; } function getContextualTypeForYieldOperand(node) { var func = ts.getContainingFunction(node); if (func) { + var functionFlags = ts.getFunctionFlags(func); var contextualReturnType = getContextualReturnType(func); if (contextualReturnType) { return node.asteriskToken ? contextualReturnType - : getElementTypeOfIterableIterator(contextualReturnType); + : getIteratedTypeOfGenerator(contextualReturnType, (functionFlags & 2) !== 0); } } return undefined; } function isInParameterInitializerBeforeContainingFunction(node) { while (node.parent && !ts.isFunctionLike(node.parent)) { - if (node.parent.kind === 144 && node.parent.initializer === node) { + if (node.parent.kind === 145 && node.parent.initializer === node) { return true; } node = node.parent; @@ -28122,8 +30678,8 @@ var ts; } function getContextualReturnType(functionDecl) { if (functionDecl.type || - functionDecl.kind === 150 || - functionDecl.kind === 151 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 152))) { + functionDecl.kind === 151 || + functionDecl.kind === 152 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 153))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl)); } var signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl); @@ -28142,7 +30698,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 181) { + if (template.parent.kind === 182) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -28172,38 +30728,14 @@ var ts; } return undefined; } - function applyToContextualType(type, mapper) { - if (!(type.flags & 65536)) { - return mapper(type); - } - var types = type.types; - var mappedType; - var mappedTypes; - for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { - var current = types_13[_i]; - var t = mapper(current); - if (t) { - if (!mappedType) { - mappedType = t; - } - else if (!mappedTypes) { - mappedTypes = [mappedType, t]; - } - else { - mappedTypes.push(t); - } - } - } - return mappedTypes ? getUnionType(mappedTypes) : mappedType; - } function getTypeOfPropertyOfContextualType(type, name) { - return applyToContextualType(type, function (t) { + return mapType(type, function (t) { var prop = t.flags & 229376 ? getPropertyOfType(t, name) : undefined; return prop ? getTypeOfSymbol(prop) : undefined; }); } function getIndexTypeOfContextualType(type, kind) { - return applyToContextualType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }); + return mapType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }); } function contextualTypeIsTupleLikeType(type) { return !!(type.flags & 65536 ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type)); @@ -28238,7 +30770,7 @@ var ts; var index = ts.indexOf(arrayLiteral.elements, node); return getTypeOfPropertyOfContextualType(type, "" + index) || getIndexTypeOfContextualType(type, 1) - || (languageVersion >= 2 ? getElementTypeOfIterable(type, undefined) : undefined); + || getIteratedTypeOrElementType(type, undefined, false, false, false); } return undefined; } @@ -28247,19 +30779,16 @@ var ts; return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; } function getContextualTypeForJsxAttribute(attribute) { - var kind = attribute.kind; - var jsxElement = attribute.parent; - var attrsType = getJsxElementAttributesType(jsxElement); - if (attribute.kind === 250) { - if (!attrsType || isTypeAny(attrsType)) { + var attributesType = getContextualType(attribute.parent); + if (ts.isJsxAttribute(attribute)) { + if (!attributesType || isTypeAny(attributesType)) { return undefined; } - return getTypeOfPropertyOfType(attrsType, attribute.name.text); + return getTypeOfPropertyOfType(attributesType, attribute.name.text); } - else if (attribute.kind === 251) { - return attrsType; + else { + return attributesType; } - ts.Debug.fail("Expected JsxAttribute or JsxSpreadAttribute, got ts.SyntaxKind[" + kind + "]"); } function getApparentTypeOfContextualType(node) { var type = getContextualType(node); @@ -28274,45 +30803,52 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 223: - case 144: + case 225: + case 145: + case 148: case 147: - case 146: - case 174: - return getContextualTypeForInitializerExpression(node); - case 185: - case 216: - return getContextualTypeForReturnExpression(node); - case 195: - return getContextualTypeForYieldOperand(parent); - case 179: - case 180: - return getContextualTypeForArgument(parent, node); - case 182: - case 200: - return getTypeFromTypeNode(parent.type); - case 192: - return getContextualTypeForBinaryOperand(node); - case 257: - case 258: - return getContextualTypeForObjectLiteralElement(parent); case 175: - return getContextualTypeForElementExpression(node); - case 193: - return getContextualTypeForConditionalOperand(node); - case 202: - ts.Debug.assert(parent.parent.kind === 194); - return getContextualTypeForSubstitutionExpression(parent.parent, node); + return getContextualTypeForInitializerExpression(node); + case 186: + case 218: + return getContextualTypeForReturnExpression(node); + case 196: + return getContextualTypeForYieldOperand(parent); + case 180: + case 181: + return getContextualTypeForArgument(parent, node); case 183: + case 201: + return getTypeFromTypeNode(parent.type); + case 193: + return getContextualTypeForBinaryOperand(node); + case 260: + case 261: + return getContextualTypeForObjectLiteralElement(parent); + case 176: + return getContextualTypeForElementExpression(node); + case 194: + return getContextualTypeForConditionalOperand(node); + case 204: + ts.Debug.assert(parent.parent.kind === 195); + return getContextualTypeForSubstitutionExpression(parent.parent, node); + case 184: + return getContextualType(parent); + case 255: return getContextualType(parent); case 252: - return getContextualType(parent); - case 250: - case 251: + case 254: return getContextualTypeForJsxAttribute(parent); + case 250: + case 249: + return getAttributesTypeFromJsxOpeningLikeElement(parent); } return undefined; } + function getContextualMapper(node) { + node = ts.findAncestor(node, function (n) { return !!n.contextualMapper; }); + return node ? node.contextualMapper : identityMapper; + } function getNonGenericSignature(type, node) { var signatures = getSignaturesOfStructuredType(type, 0); if (signatures.length === 1) { @@ -28337,7 +30873,7 @@ var ts; return sourceLength < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 184 || node.kind === 185; + return node.kind === 185 || node.kind === 186; } function getContextualSignatureForFunctionLikeDeclaration(node) { return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node) @@ -28350,7 +30886,7 @@ var ts; getApparentTypeOfContextualType(node); } function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 149 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 150 || ts.isObjectLiteralMethod(node)); var type = getContextualTypeForFunctionLikeDeclaration(node); if (!type) { return undefined; @@ -28360,8 +30896,8 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { - var current = types_14[_i]; + for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { + var current = types_17[_i]; var signature = getNonGenericSignature(current, node); if (signature) { if (!signatureList) { @@ -28383,37 +30919,37 @@ var ts; } return result; } - function isInferentialContext(mapper) { - return mapper && mapper.context; - } - function checkSpreadExpression(node, contextualMapper) { - var arrayOrIterableType = checkExpressionCached(node.expression, contextualMapper); - return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, false); + function checkSpreadExpression(node, checkMode) { + if (languageVersion < 2 && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 1536); + } + var arrayOrIterableType = checkExpression(node.expression, checkMode); + return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, false, false); } function hasDefaultValue(node) { - return (node.kind === 174 && !!node.initializer) || - (node.kind === 192 && node.operatorToken.kind === 57); + return (node.kind === 175 && !!node.initializer) || + (node.kind === 193 && node.operatorToken.kind === 57); } - function checkArrayLiteral(node, contextualMapper) { + function checkArrayLiteral(node, checkMode) { var elements = node.elements; var hasSpreadElement = false; var elementTypes = []; var inDestructuringPattern = ts.isAssignmentTarget(node); for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) { var e = elements_1[_i]; - if (inDestructuringPattern && e.kind === 196) { - var restArrayType = checkExpression(e.expression, contextualMapper); + if (inDestructuringPattern && e.kind === 197) { + var restArrayType = checkExpression(e.expression, checkMode); var restElementType = getIndexTypeOfType(restArrayType, 1) || - (languageVersion >= 2 ? getElementTypeOfIterable(restArrayType, undefined) : undefined); + getIteratedTypeOrElementType(restArrayType, undefined, false, false, false); if (restElementType) { elementTypes.push(restElementType); } } else { - var type = checkExpressionForMutableLocation(e, contextualMapper); + var type = checkExpressionForMutableLocation(e, checkMode); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 196; + hasSpreadElement = hasSpreadElement || e.kind === 197; } if (!hasSpreadElement) { if (inDestructuringPattern && elementTypes.length) { @@ -28424,7 +30960,7 @@ var ts; var contextualType = getApparentTypeOfContextualType(node); if (contextualType && contextualTypeIsTupleLikeType(contextualType)) { var pattern = contextualType.pattern; - if (pattern && (pattern.kind === 173 || pattern.kind === 175)) { + if (pattern && (pattern.kind === 174 || pattern.kind === 176)) { var patternElements = pattern.elements; for (var i = elementTypes.length; i < patternElements.length; i++) { var patternElement = patternElements[i]; @@ -28432,7 +30968,7 @@ var ts; elementTypes.push(contextualType.typeArguments[i]); } else { - if (patternElement.kind !== 198) { + if (patternElement.kind !== 199) { error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } elementTypes.push(unknownType); @@ -28449,7 +30985,7 @@ var ts; strictNullChecks ? neverType : undefinedWideningType); } function isNumericName(name) { - return name.kind === 142 ? isNumericComputedName(name) : isNumericLiteralName(name.text); + return name.kind === 143 ? isNumericComputedName(name) : isNumericLiteralName(name.text); } function isNumericComputedName(name) { return isTypeAnyOrAllConstituentTypesHaveKind(checkComputedPropertyName(name), 340); @@ -28486,7 +31022,7 @@ var ts; var unionType = propTypes.length ? getUnionType(propTypes, true) : undefinedType; return createIndexInfo(unionType, false); } - function checkObjectLiteral(node, contextualMapper) { + function checkObjectLiteral(node, checkMode) { var inDestructuringPattern = ts.isAssignmentTarget(node); checkGrammarObjectLiteralExpression(node, inDestructuringPattern); var propertiesTable = ts.createMap(); @@ -28495,7 +31031,8 @@ var ts; var propagatedFlags = 0; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 172 || contextualType.pattern.kind === 176); + (contextualType.pattern.kind === 173 || contextualType.pattern.kind === 177); + var isJSObjectLiteral = !contextualType && ts.isInJavaScriptFile(node); var typeFlags = 0; var patternWithComputedProperties = false; var hasComputedStringProperty = false; @@ -28504,27 +31041,27 @@ var ts; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = memberDecl.symbol; - if (memberDecl.kind === 257 || - memberDecl.kind === 258 || + if (memberDecl.kind === 260 || + memberDecl.kind === 261 || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 257) { - type = checkPropertyAssignment(memberDecl, contextualMapper); + if (memberDecl.kind === 260) { + type = checkPropertyAssignment(memberDecl, checkMode); } - else if (memberDecl.kind === 149) { - type = checkObjectLiteralMethod(memberDecl, contextualMapper); + else if (memberDecl.kind === 150) { + type = checkObjectLiteralMethod(memberDecl, checkMode); } else { - ts.Debug.assert(memberDecl.kind === 258); - type = checkExpressionForMutableLocation(memberDecl.name, contextualMapper); + ts.Debug.assert(memberDecl.kind === 261); + type = checkExpressionForMutableLocation(memberDecl.name, checkMode); } typeFlags |= type.flags; - var prop = createSymbol(4 | 67108864 | member.flags, member.name); + var prop = createSymbol(4 | member.flags, member.name); if (inDestructuringPattern) { - var isOptional = (memberDecl.kind === 257 && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 258 && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 260 && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 261 && memberDecl.objectAssignmentInitializer); if (isOptional) { - prop.flags |= 536870912; + prop.flags |= 67108864; } if (ts.hasDynamicName(memberDecl)) { patternWithComputedProperties = true; @@ -28533,9 +31070,9 @@ var ts; else if (contextualTypeHasPattern && !(getObjectFlags(contextualType) & 512)) { var impliedProp = getPropertyOfType(contextualType, member.name); if (impliedProp) { - prop.flags |= impliedProp.flags & 536870912; + prop.flags |= impliedProp.flags & 67108864; } - else if (!compilerOptions.suppressExcessPropertyErrors) { + else if (!compilerOptions.suppressExcessPropertyErrors && !getIndexInfoOfType(contextualType, 0)) { error(memberDecl.name, ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(member), typeToString(contextualType)); } } @@ -28548,9 +31085,12 @@ var ts; prop.target = member; member = prop; } - else if (memberDecl.kind === 259) { + else if (memberDecl.kind === 262) { + if (languageVersion < 2) { + checkExternalEmitHelpers(memberDecl, 2); + } if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), true); + spread = getSpreadType(spread, createObjectLiteralType()); propertiesArray = []; propertiesTable = ts.createMap(); hasComputedStringProperty = false; @@ -28558,17 +31098,17 @@ var ts; typeFlags = 0; } var type = checkExpression(memberDecl.expression); - if (!(type.flags & (32768 | 1))) { + if (!isValidSpreadType(type)) { error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); return unknownType; } - spread = getSpreadType(spread, type, false); + spread = getSpreadType(spread, type); offset = i + 1; continue; } else { - ts.Debug.assert(memberDecl.kind === 151 || memberDecl.kind === 152); - checkAccessorDeclaration(memberDecl); + ts.Debug.assert(memberDecl.kind === 152 || memberDecl.kind === 153); + checkNodeDeferred(memberDecl); } if (ts.hasDynamicName(memberDecl)) { if (isNumericName(memberDecl.name)) { @@ -28579,34 +31119,36 @@ var ts; } } else { - propertiesTable[member.name] = member; + propertiesTable.set(member.name, member); } propertiesArray.push(member); } if (contextualTypeHasPattern) { for (var _i = 0, _a = getPropertiesOfType(contextualType); _i < _a.length; _i++) { var prop = _a[_i]; - if (!propertiesTable[prop.name]) { - if (!(prop.flags & 536870912)) { + if (!propertiesTable.get(prop.name)) { + if (!(prop.flags & 67108864)) { error(prop.valueDeclaration || prop.bindingElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } - propertiesTable[prop.name] = prop; + propertiesTable.set(prop.name, prop); propertiesArray.push(prop); } } } if (spread !== emptyObjectType) { if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), true); + spread = getSpreadType(spread, createObjectLiteralType()); + } + if (spread.flags & 32768) { + spread.flags |= propagatedFlags; + spread.symbol = node.symbol; } - spread.flags |= propagatedFlags; - spread.symbol = node.symbol; return spread; } return createObjectLiteralType(); function createObjectLiteralType() { - var stringIndexInfo = hasComputedStringProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 0) : undefined; - var numberIndexInfo = hasComputedNumberProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 1) : undefined; + var stringIndexInfo = isJSObjectLiteral ? jsObjectLiteralIndexInfo : hasComputedStringProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 0) : undefined; + var numberIndexInfo = hasComputedNumberProperty && !isJSObjectLiteral ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 1) : undefined; var result = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo); var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 1048576; result.flags |= 4194304 | freshObjectLiteralFlag | (typeFlags & 14680064); @@ -28623,9 +31165,14 @@ var ts; return result; } } + function isValidSpreadType(type) { + return !!(type.flags & (1 | 4096 | 2048 | 16777216) || + type.flags & 32768 && !isGenericMappedType(type) || + type.flags & 196608 && !ts.forEach(type.types, function (t) { return !isValidSpreadType(t); })); + } function checkJsxSelfClosingElement(node) { checkJsxOpeningLikeElement(node); - return jsxElementType || anyType; + return getJsxGlobalElementType() || anyType; } function checkJsxElement(node) { checkJsxOpeningLikeElement(node.openingElement); @@ -28638,85 +31185,105 @@ var ts; for (var _i = 0, _a = node.children; _i < _a.length; _i++) { var child = _a[_i]; switch (child.kind) { - case 252: + case 255: checkJsxExpression(child); break; - case 246: + case 248: checkJsxElement(child); break; - case 247: + case 249: checkJsxSelfClosingElement(child); break; } } - return jsxElementType || anyType; + return getJsxGlobalElementType() || anyType; } function isUnhyphenatedJsxName(name) { return name.indexOf("-") < 0; } function isJsxIntrinsicIdentifier(tagName) { - if (tagName.kind === 177 || tagName.kind === 98) { + if (tagName.kind === 178 || tagName.kind === 98) { return false; } else { return ts.isIntrinsicJsxName(tagName.text); } } - function checkJsxAttribute(node, elementAttributesType, nameTable) { - var correspondingPropType = undefined; - if (elementAttributesType === emptyObjectType && isUnhyphenatedJsxName(node.name.text)) { - error(node.parent, ts.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, getJsxElementPropertiesName()); - } - else if (elementAttributesType && !isTypeAny(elementAttributesType)) { - var correspondingPropSymbol = getPropertyOfType(elementAttributesType, node.name.text); - correspondingPropType = correspondingPropSymbol && getTypeOfSymbol(correspondingPropSymbol); - if (isUnhyphenatedJsxName(node.name.text)) { - var attributeType = getTypeOfPropertyOfType(elementAttributesType, ts.getTextOfPropertyName(node.name)) || getIndexTypeOfType(elementAttributesType, 0); - if (attributeType) { - correspondingPropType = attributeType; + function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, filter, checkMode) { + var attributes = openingLikeElement.attributes; + var attributesTable = ts.createMap(); + var spread = emptyObjectType; + var attributesArray = []; + for (var _i = 0, _a = attributes.properties; _i < _a.length; _i++) { + var attributeDecl = _a[_i]; + var member = attributeDecl.symbol; + if (ts.isJsxAttribute(attributeDecl)) { + var exprType = attributeDecl.initializer ? + checkExpression(attributeDecl.initializer, checkMode) : + trueType; + var attributeSymbol = createSymbol(4 | 134217728 | member.flags, member.name); + attributeSymbol.declarations = member.declarations; + attributeSymbol.parent = member.parent; + if (member.valueDeclaration) { + attributeSymbol.valueDeclaration = member.valueDeclaration; } - else { - if (!correspondingPropType) { - error(node.name, ts.Diagnostics.Property_0_does_not_exist_on_type_1, node.name.text, typeToString(elementAttributesType)); - return unknownType; - } + attributeSymbol.type = exprType; + attributeSymbol.target = member; + attributesTable.set(attributeSymbol.name, attributeSymbol); + attributesArray.push(attributeSymbol); + } + else { + ts.Debug.assert(attributeDecl.kind === 254); + if (attributesArray.length > 0) { + spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable)); + attributesArray = []; + attributesTable = ts.createMap(); } + var exprType = checkExpression(attributeDecl.expression); + if (!isValidSpreadType(exprType)) { + error(attributeDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); + return anyType; + } + if (isTypeAny(exprType)) { + return anyType; + } + spread = getSpreadType(spread, exprType); } } - var exprType; - if (node.initializer) { - exprType = checkExpression(node.initializer); + if (spread !== emptyObjectType) { + if (attributesArray.length > 0) { + spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable)); + attributesArray = []; + attributesTable = ts.createMap(); + } + attributesArray = getPropertiesOfType(spread); } - else { - exprType = booleanType; + attributesTable = ts.createMap(); + if (attributesArray) { + ts.forEach(attributesArray, function (attr) { + if (!filter || filter(attr)) { + attributesTable.set(attr.name, attr); + } + }); } - if (correspondingPropType) { - checkTypeAssignableTo(exprType, correspondingPropType, node); + return createJsxAttributesType(attributes.symbol, attributesTable); + function createJsxAttributesType(symbol, attributesTable) { + var result = createAnonymousType(symbol, attributesTable, emptyArray, emptyArray, undefined, undefined); + var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 1048576; + result.flags |= 33554432 | 4194304 | freshObjectLiteralFlag; + result.objectFlags |= 128; + return result; } - nameTable[node.name.text] = true; - return exprType; } - function checkJsxSpreadAttribute(node, elementAttributesType, nameTable) { - var type = checkExpression(node.expression); - var props = getPropertiesOfType(type); - for (var _i = 0, props_2 = props; _i < props_2.length; _i++) { - var prop = props_2[_i]; - if (!nameTable[prop.name]) { - var targetPropSym = getPropertyOfType(elementAttributesType, prop.name); - if (targetPropSym) { - var msg = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property, prop.name); - checkTypeAssignableTo(getTypeOfSymbol(prop), getTypeOfSymbol(targetPropSym), node, undefined, msg); - } - nameTable[prop.name] = true; - } - } - return type; + function checkJsxAttributes(node, checkMode) { + return createJsxAttributesTypeFromAttributesProperty(node.parent, undefined, checkMode); } function getJsxType(name) { - if (jsxTypes[name] === undefined) { - return jsxTypes[name] = getExportedTypeFromNamespace(JsxNames.JSX, name) || unknownType; + var jsxType = jsxTypes.get(name); + if (jsxType === undefined) { + jsxTypes.set(name, jsxType = getExportedTypeFromNamespace(JsxNames.JSX, name) || unknownType); } - return jsxTypes[name]; + return jsxType; } function getIntrinsicTagSymbol(node) { var links = getNodeLinks(node); @@ -28737,7 +31304,7 @@ var ts; return links.resolvedSymbol = unknownSymbol; } else { - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { error(node, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists, JsxNames.IntrinsicElements); } return links.resolvedSymbol = unknownSymbol; @@ -28781,23 +31348,86 @@ var ts; return undefined; } } - function getResolvedJsxType(node, elemType, elemClassType) { - if (!elemType) { - elemType = checkExpression(node.tagName); + function defaultTryGetJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) { + ts.Debug.assert(!(elementType.flags & 65536)); + if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) { + var jsxStatelessElementType = getJsxGlobalStatelessElementType(); + if (jsxStatelessElementType) { + var callSignature = getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, undefined); + if (callSignature !== unknownSignature) { + var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); + var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); + if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) { + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttributes !== unknownType) { + paramType = intersectTypes(intrinsicAttributes, paramType); + } + return paramType; + } + } + } } - if (elemType.flags & 65536) { - var types = elemType.types; - return getUnionType(ts.map(types, function (type) { - return getResolvedJsxType(node, type, elemClassType); + return undefined; + } + function tryGetAllJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) { + ts.Debug.assert(!(elementType.flags & 65536)); + if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) { + var jsxStatelessElementType = getJsxGlobalStatelessElementType(); + if (jsxStatelessElementType) { + var candidatesOutArray = []; + getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, candidatesOutArray); + var result = void 0; + var allMatchingAttributesType = void 0; + for (var _i = 0, candidatesOutArray_1 = candidatesOutArray; _i < candidatesOutArray_1.length; _i++) { + var candidate = candidatesOutArray_1[_i]; + var callReturnType = getReturnTypeOfSignature(candidate); + var paramType = callReturnType && (candidate.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(candidate.parameters[0])); + if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) { + var shouldBeCandidate = true; + for (var _a = 0, _b = openingLikeElement.attributes.properties; _a < _b.length; _a++) { + var attribute = _b[_a]; + if (ts.isJsxAttribute(attribute) && + isUnhyphenatedJsxName(attribute.name.text) && + !getPropertyOfType(paramType, attribute.name.text)) { + shouldBeCandidate = false; + break; + } + } + if (shouldBeCandidate) { + result = intersectTypes(result, paramType); + } + allMatchingAttributesType = intersectTypes(allMatchingAttributesType, paramType); + } + } + if (!result) { + result = allMatchingAttributesType; + } + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttributes !== unknownType) { + result = intersectTypes(intrinsicAttributes, result); + } + return result; + } + } + return undefined; + } + function resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, elementType, elementClassType) { + if (!elementType) { + elementType = checkExpression(openingLikeElement.tagName); + } + if (elementType.flags & 65536) { + var types = elementType.types; + return getUnionType(types.map(function (type) { + return resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, type, elementClassType); }), true); } - if (elemType.flags & 2) { + if (elementType.flags & 2) { return anyType; } - else if (elemType.flags & 32) { + else if (elementType.flags & 32) { var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); if (intrinsicElementsType !== unknownType) { - var stringLiteralTypeName = elemType.text; + var stringLiteralTypeName = elementType.text; var intrinsicProp = getPropertyOfType(intrinsicElementsType, stringLiteralTypeName); if (intrinsicProp) { return getTypeOfSymbol(intrinsicProp); @@ -28806,28 +31436,19 @@ var ts; if (indexSignatureType) { return indexSignatureType; } - error(node, ts.Diagnostics.Property_0_does_not_exist_on_type_1, stringLiteralTypeName, "JSX." + JsxNames.IntrinsicElements); + error(openingLikeElement, ts.Diagnostics.Property_0_does_not_exist_on_type_1, stringLiteralTypeName, "JSX." + JsxNames.IntrinsicElements); } return anyType; } - var elemInstanceType = getJsxElementInstanceType(node, elemType); - if (!elemClassType || !isTypeAssignableTo(elemInstanceType, elemClassType)) { - if (jsxElementType) { - var callSignatures = elemType && getSignaturesOfType(elemType, 0); - var callSignature = callSignatures && callSignatures.length > 0 && callSignatures[0]; - var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); - var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); - if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType)) { - var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); - if (intrinsicAttributes !== unknownType) { - paramType = intersectTypes(intrinsicAttributes, paramType); - } - return paramType; - } - } + var elemInstanceType = getJsxElementInstanceType(openingLikeElement, elementType); + var statelessAttributesType = shouldIncludeAllStatelessAttributesType ? + tryGetAllJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) : + defaultTryGetJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType); + if (statelessAttributesType) { + return statelessAttributesType; } - if (elemClassType) { - checkTypeRelatedTo(elemInstanceType, elemClassType, assignableRelation, node, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); + if (elementClassType) { + checkTypeRelatedTo(elemInstanceType, elementClassType, assignableRelation, openingLikeElement, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); } if (isTypeAny(elemInstanceType)) { return elemInstanceType; @@ -28847,10 +31468,6 @@ var ts; else if (isTypeAny(attributesType) || (attributesType === unknownType)) { return attributesType; } - else if (attributesType.flags & 65536) { - error(node.tagName, ts.Diagnostics.JSX_element_attributes_type_0_may_not_be_a_union_type, typeToString(attributesType)); - return anyType; - } else { var apparentAttributesType = attributesType; var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes); @@ -28873,38 +31490,72 @@ var ts; } } } - function getJsxElementAttributesType(node) { + function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) { + ts.Debug.assert(isJsxIntrinsicIdentifier(node.tagName)); var links = getNodeLinks(node); - if (!links.resolvedJsxType) { - if (isJsxIntrinsicIdentifier(node.tagName)) { - var symbol = getIntrinsicTagSymbol(node); - if (links.jsxFlags & 1) { - return links.resolvedJsxType = getTypeOfSymbol(symbol); - } - else if (links.jsxFlags & 2) { - return links.resolvedJsxType = getIndexInfoOfSymbol(symbol, 0).type; - } - else { - return links.resolvedJsxType = unknownType; - } + if (!links.resolvedJsxElementAttributesType) { + var symbol = getIntrinsicTagSymbol(node); + if (links.jsxFlags & 1) { + return links.resolvedJsxElementAttributesType = getTypeOfSymbol(symbol); + } + else if (links.jsxFlags & 2) { + return links.resolvedJsxElementAttributesType = getIndexInfoOfSymbol(symbol, 0).type; } else { - var elemClassType = getJsxGlobalElementClassType(); - return links.resolvedJsxType = getResolvedJsxType(node, undefined, elemClassType); + return links.resolvedJsxElementAttributesType = unknownType; } } - return links.resolvedJsxType; + return links.resolvedJsxElementAttributesType; + } + function getCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType) { + var links = getNodeLinks(node); + if (!links.resolvedJsxElementAttributesType) { + var elemClassType = getJsxGlobalElementClassType(); + return links.resolvedJsxElementAttributesType = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, undefined, elemClassType); + } + return links.resolvedJsxElementAttributesType; + } + function getAllAttributesTypeFromJsxOpeningLikeElement(node) { + if (isJsxIntrinsicIdentifier(node.tagName)) { + return getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); + } + else { + return getCustomJsxElementAttributesType(node, true); + } + } + function getAttributesTypeFromJsxOpeningLikeElement(node) { + if (isJsxIntrinsicIdentifier(node.tagName)) { + return getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); + } + else { + return getCustomJsxElementAttributesType(node, false); + } } function getJsxAttributePropertySymbol(attrib) { - var attributesType = getJsxElementAttributesType(attrib.parent); + var attributesType = getAttributesTypeFromJsxOpeningLikeElement(attrib.parent.parent); var prop = getPropertyOfType(attributesType, attrib.name.text); return prop || unknownSymbol; } function getJsxGlobalElementClassType() { - if (!jsxElementClassType) { - jsxElementClassType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.ElementClass); + if (!deferredJsxElementClassType) { + deferredJsxElementClassType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.ElementClass); } - return jsxElementClassType; + return deferredJsxElementClassType; + } + function getJsxGlobalElementType() { + if (!deferredJsxElementType) { + deferredJsxElementType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.Element); + } + return deferredJsxElementType; + } + function getJsxGlobalStatelessElementType() { + if (!deferredJsxStatelessElementType) { + var jsxElementType = getJsxGlobalElementType(); + if (jsxElementType) { + deferredJsxStatelessElementType = getUnionType([jsxElementType, nullType]); + } + } + return deferredJsxStatelessElementType; } function getJsxIntrinsicTagNames() { var intrinsics = getJsxType(JsxNames.IntrinsicElements); @@ -28914,8 +31565,8 @@ var ts; if ((compilerOptions.jsx || 0) === 0) { error(errorNode, ts.Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided); } - if (jsxElementType === undefined) { - if (compilerOptions.noImplicitAny) { + if (getJsxGlobalElementType() === undefined) { + if (noImplicitAny) { error(errorNode, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist); } } @@ -28932,61 +31583,83 @@ var ts; markAliasSymbolAsReferenced(reactSym); } } - var targetAttributesType = getJsxElementAttributesType(node); - var nameTable = ts.createMap(); - var sawSpreadedAny = false; - for (var i = node.attributes.length - 1; i >= 0; i--) { - if (node.attributes[i].kind === 250) { - checkJsxAttribute((node.attributes[i]), targetAttributesType, nameTable); - } - else { - ts.Debug.assert(node.attributes[i].kind === 251); - var spreadType = checkJsxSpreadAttribute((node.attributes[i]), targetAttributesType, nameTable); - if (isTypeAny(spreadType)) { - sawSpreadedAny = true; - } - } + checkJsxAttributesAssignableToTagNameAttributes(node); + } + function checkJsxAttributesAssignableToTagNameAttributes(openingLikeElement) { + var targetAttributesType = isJsxIntrinsicIdentifier(openingLikeElement.tagName) ? + getIntrinsicAttributesTypeFromJsxOpeningLikeElement(openingLikeElement) : + getCustomJsxElementAttributesType(openingLikeElement, false); + var sourceAttributesType = createJsxAttributesTypeFromAttributesProperty(openingLikeElement, function (attribute) { + return isUnhyphenatedJsxName(attribute.name) || !!(getPropertyOfType(targetAttributesType, attribute.name)); + }); + if (targetAttributesType === emptyObjectType && (isTypeAny(sourceAttributesType) || sourceAttributesType.properties.length > 0)) { + error(openingLikeElement, ts.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, getJsxElementPropertiesName()); } - if (targetAttributesType && !sawSpreadedAny) { - var targetProperties = getPropertiesOfType(targetAttributesType); - for (var i = 0; i < targetProperties.length; i++) { - if (!(targetProperties[i].flags & 536870912) && - !nameTable[targetProperties[i].name]) { - error(node, ts.Diagnostics.Property_0_is_missing_in_type_1, targetProperties[i].name, typeToString(targetAttributesType)); - } - } + else { + checkTypeAssignableTo(sourceAttributesType, targetAttributesType, openingLikeElement.attributes.properties.length > 0 ? openingLikeElement.attributes : openingLikeElement); } } - function checkJsxExpression(node) { + function checkJsxExpression(node, checkMode) { if (node.expression) { - return checkExpression(node.expression); + var type = checkExpression(node.expression, checkMode); + if (node.dotDotDotToken && type !== anyType && !isArrayType(type)) { + error(node, ts.Diagnostics.JSX_spread_child_must_be_an_array_type, node.toString(), typeToString(type)); + } + return type; } else { return unknownType; } } function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 147; + return s.valueDeclaration ? s.valueDeclaration.kind : 148; } function getDeclarationModifierFlagsFromSymbol(s) { - return s.valueDeclaration ? ts.getCombinedModifierFlags(s.valueDeclaration) : s.flags & 134217728 ? 4 | 32 : 0; + if (s.valueDeclaration) { + var flags = ts.getCombinedModifierFlags(s.valueDeclaration); + return s.parent && s.parent.flags & 32 ? flags : flags & ~28; + } + if (getCheckFlags(s) & 6) { + var checkFlags = s.checkFlags; + var accessModifier = checkFlags & 256 ? 8 : + checkFlags & 64 ? 4 : + 16; + var staticModifier = checkFlags & 512 ? 32 : 0; + return accessModifier | staticModifier; + } + if (s.flags & 16777216) { + return 4 | 32; + } + return 0; } function getDeclarationNodeFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : 0; } - function checkClassPropertyAccess(node, left, type, prop) { + function isMethodLike(symbol) { + return !!(symbol.flags & 8192 || getCheckFlags(symbol) & 4); + } + function checkPropertyAccessibility(node, left, type, prop) { var flags = getDeclarationModifierFlagsFromSymbol(prop); - var declaringClass = getDeclaredTypeOfSymbol(getParentOfSymbol(prop)); - var errorNode = node.kind === 177 || node.kind === 223 ? + var errorNode = node.kind === 178 || node.kind === 225 ? node.name : node.right; + if (getCheckFlags(prop) & 256) { + error(errorNode, ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(prop), typeToString(type)); + return false; + } if (left.kind === 96) { - if (languageVersion < 2 && getDeclarationKindFromSymbol(prop) !== 149) { - error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); - return false; + if (languageVersion < 2) { + var hasNonMethodDeclaration = forEachProperty(prop, function (p) { + var propKind = getDeclarationKindFromSymbol(p); + return propKind !== 150 && propKind !== 149; + }); + if (hasNonMethodDeclaration) { + error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); + return false; + } } if (flags & 128) { - error(errorNode, ts.Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString(prop), typeToString(declaringClass)); + error(errorNode, ts.Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString(prop), typeToString(getDeclaringClass(prop))); return false; } } @@ -28996,7 +31669,7 @@ var ts; if (flags & 8) { var declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop)); if (!isNodeWithinClass(node, declaringClassDeclaration)) { - error(errorNode, ts.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(declaringClass)); + error(errorNode, ts.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(getDeclaringClass(prop))); return false; } return true; @@ -29006,10 +31679,10 @@ var ts; } var enclosingClass = forEachEnclosingClass(node, function (enclosingDeclaration) { var enclosingClass = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingDeclaration)); - return hasBaseType(enclosingClass, declaringClass) ? enclosingClass : undefined; + return isClassDerivedFromDeclaringClasses(enclosingClass, prop) ? enclosingClass : undefined; }); if (!enclosingClass) { - error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(declaringClass)); + error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(getDeclaringClass(prop) || type)); return false; } if (flags & 32) { @@ -29025,16 +31698,17 @@ var ts; return true; } function checkNonNullExpression(node) { - var type = checkExpression(node); - if (strictNullChecks) { - var kind = getFalsyFlags(type) & 6144; - if (kind) { - error(node, kind & 2048 ? kind & 4096 ? - ts.Diagnostics.Object_is_possibly_null_or_undefined : - ts.Diagnostics.Object_is_possibly_undefined : - ts.Diagnostics.Object_is_possibly_null); - } - return getNonNullableType(type); + return checkNonNullType(checkExpression(node), node); + } + function checkNonNullType(type, errorNode) { + var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 6144; + if (kind) { + error(errorNode, kind & 2048 ? kind & 4096 ? + ts.Diagnostics.Object_is_possibly_null_or_undefined : + ts.Diagnostics.Object_is_possibly_undefined : + ts.Diagnostics.Object_is_possibly_null); + var t = getNonNullableType(type); + return t.flags & (6144 | 8192) ? unknownType : t; } return type; } @@ -29063,7 +31737,7 @@ var ts; noUnusedIdentifiers && (prop.flags & 106500) && prop.valueDeclaration && (ts.getModifierFlags(prop.valueDeclaration) & 8)) { - if (prop.flags & 16777216) { + if (getCheckFlags(prop) & 1) { getSymbolLinks(prop).target.isReferenced = true; } else { @@ -29071,6 +31745,15 @@ var ts; } } } + function isInPropertyInitializer(node) { + while (node) { + if (node.parent && node.parent.kind === 148 && node.parent.initializer === node) { + return true; + } + node = node.parent; + } + return false; + } function checkPropertyAccessExpressionOrQualifiedName(node, left, right) { var type = checkNonNullExpression(left); if (isTypeAny(type) || type === silentNeverType) { @@ -29082,16 +31765,30 @@ var ts; } var prop = getPropertyOfType(apparentType, right.text); if (!prop) { + var stringIndexType = getIndexTypeOfType(apparentType, 0); + if (stringIndexType) { + return stringIndexType; + } if (right.text && !checkAndReportErrorForExtendingInterface(node)) { reportNonexistentProperty(right, type.flags & 16384 && type.isThisType ? apparentType : type); } return unknownType; } + if (prop.valueDeclaration) { + if (isInPropertyInitializer(node) && + !isBlockScopedNameDeclaredBeforeUse(prop.valueDeclaration, right)) { + error(right, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, right.text); + } + if (prop.valueDeclaration.kind === 228 && + node.parent && node.parent.kind !== 158 && + !ts.isInAmbientContext(prop.valueDeclaration) && + !isBlockScopedNameDeclaredBeforeUse(prop.valueDeclaration, right)) { + error(right, ts.Diagnostics.Class_0_used_before_its_declaration, right.text); + } + } markPropertyAsReferenced(prop); getNodeLinks(node).resolvedSymbol = prop; - if (prop.parent && prop.parent.flags & 32) { - checkClassPropertyAccess(node, left, apparentType, prop); - } + checkPropertyAccessibility(node, left, apparentType, prop); var propType = getTypeOfSymbol(prop); var assignmentKind = ts.getAssignmentTargetKind(node); if (assignmentKind) { @@ -29100,30 +31797,30 @@ var ts; return unknownType; } } - if (node.kind !== 177 || assignmentKind === 1 || + if (node.kind !== 178 || assignmentKind === 1 || !(prop.flags & (3 | 4 | 98304)) && !(prop.flags & 8192 && propType.flags & 65536)) { return propType; } - var flowType = getFlowTypeOfReference(node, propType, true, undefined); + var flowType = getFlowTypeOfReference(node, propType); return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 177 + var left = node.kind === 178 ? node.expression : node.left; var type = checkExpression(left); if (type !== unknownType && !isTypeAny(type)) { var prop = getPropertyOfType(getWidenedType(type), propertyName); - if (prop && prop.parent && prop.parent.flags & 32) { - return checkClassPropertyAccess(node, left, type, prop); + if (prop) { + return checkPropertyAccessibility(node, left, type, prop); } } return true; } function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 224) { + if (initializer.kind === 226) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -29145,7 +31842,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 212 && + if (node.kind === 214 && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -29163,7 +31860,7 @@ var ts; var indexExpression = node.argumentExpression; if (!indexExpression) { var sourceFile = ts.getSourceFileOfNode(node); - if (node.parent.kind === 180 && node.parent.expression === node) { + if (node.parent.kind === 181 && node.parent.expression === node) { var start = ts.skipTrivia(sourceFile.text, node.expression.end); var end = node.end; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); @@ -29183,7 +31880,7 @@ var ts; error(indexExpression, ts.Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal); return unknownType; } - return getIndexedAccessType(objectType, indexType, node); + return checkIndexedAccessIndexType(getIndexedAccessType(objectType, indexType, node), node); } function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) { if (expressionType === unknownType) { @@ -29203,7 +31900,7 @@ var ts; if (!leftHandSideSymbol) { return false; } - var globalESSymbol = getGlobalESSymbolConstructorSymbol(); + var globalESSymbol = getGlobalESSymbolConstructorSymbol(true); if (!globalESSymbol) { return false; } @@ -29216,10 +31913,10 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 181) { + if (node.kind === 182) { checkExpression(node.template); } - else if (node.kind !== 145) { + else if (node.kind !== 146) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -29238,22 +31935,22 @@ var ts; var specializedIndex = -1; var spliceIndex; ts.Debug.assert(!result.length); - for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { - var signature = signatures_2[_i]; + for (var _i = 0, signatures_3 = signatures; _i < signatures_3.length; _i++) { + var signature = signatures_3[_i]; var symbol = signature.declaration && getSymbolOfNode(signature.declaration); - var parent_8 = signature.declaration && signature.declaration.parent; + var parent = signature.declaration && signature.declaration.parent; if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && parent_8 === lastParent) { + if (lastParent && parent === lastParent) { index++; } else { - lastParent = parent_8; + lastParent = parent; index = cutoffIndex; } } else { index = cutoffIndex = result.length; - lastParent = parent_8; + lastParent = parent; } lastSymbol = symbol; if (signature.hasLiteralTypes) { @@ -29270,7 +31967,7 @@ var ts; function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg && arg.kind === 196) { + if (arg && arg.kind === 197) { return i; } } @@ -29283,11 +31980,14 @@ var ts; var callIsIncomplete; var isDecorator; var spreadArgIndex = -1; - if (node.kind === 181) { + if (ts.isJsxOpeningLikeElement(node)) { + return true; + } + if (node.kind === 182) { var tagExpression = node; argCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 194) { + if (tagExpression.template.kind === 195) { var templateExpression = tagExpression.template; var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); ts.Debug.assert(lastSpan !== undefined); @@ -29299,7 +31999,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 145) { + else if (node.kind === 146) { isDecorator = true; typeArguments = undefined; argCount = getEffectiveArgumentCount(node, undefined, signature); @@ -29307,7 +32007,7 @@ var ts; else { var callExpression = node; if (!callExpression.arguments) { - ts.Debug.assert(callExpression.kind === 180); + ts.Debug.assert(callExpression.kind === 181); return signature.minArgumentCount === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; @@ -29315,8 +32015,10 @@ var ts; typeArguments = callExpression.typeArguments; spreadArgIndex = getSpreadArgumentIndex(args); } + var numTypeParameters = ts.length(signature.typeParameters); + var minTypeArgumentCount = getMinTypeArgumentCount(signature.typeParameters); var hasRightNumberOfTypeArgs = !typeArguments || - (signature.typeParameters && typeArguments.length === signature.typeParameters.length); + (typeArguments.length >= minTypeArgumentCount && typeArguments.length <= numTypeParameters); if (!hasRightNumberOfTypeArgs) { return false; } @@ -29340,9 +32042,9 @@ var ts; return undefined; } function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper) { - var context = createInferenceContext(signature, true); + var context = createInferenceContext(signature, true, false); forEachMatchingParameterType(contextualSignature, signature, function (source, target) { - inferTypes(context, instantiateType(source, contextualMapper), target); + inferTypesWithContext(context, instantiateType(source, contextualMapper), target); }); return getSignatureInstantiation(signature, getInferredTypes(context)); } @@ -29361,19 +32063,19 @@ var ts; if (thisType) { var thisArgumentNode = getThisArgumentOfCall(node); var thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType; - inferTypes(context, thisArgumentType, thisType); + inferTypesWithContext(context, thisArgumentType, thisType); } var argCount = getEffectiveArgumentCount(node, args, signature); for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); - if (arg === undefined || arg.kind !== 198) { + if (arg === undefined || arg.kind !== 199) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i); if (argType === undefined) { var mapper = excludeArgument && excludeArgument[i] !== undefined ? identityMapper : inferenceMapper; argType = checkExpressionWithContextualType(arg, paramType, mapper); } - inferTypes(context, argType, paramType); + inferTypesWithContext(context, argType, paramType); } } if (excludeArgument) { @@ -29381,7 +32083,7 @@ var ts; if (excludeArgument[i] === false) { var arg = args[i]; var paramType = getTypeAtPosition(signature, i); - inferTypes(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); + inferTypesWithContext(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); } } } @@ -29391,7 +32093,7 @@ var ts; var typeParameters = signature.typeParameters; var typeArgumentsAreAssignable = true; var mapper; - for (var i = 0; i < typeParameters.length; i++) { + for (var i = 0; i < typeArgumentNodes.length; i++) { if (typeArgumentsAreAssignable) { var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { @@ -29411,9 +32113,29 @@ var ts; } return typeArgumentsAreAssignable; } + function checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation) { + var callIsIncomplete = node.attributes.end === node.end; + if (callIsIncomplete) { + return true; + } + var headMessage = ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1; + var paramType = getTypeAtPosition(signature, 0); + var attributesType = checkExpressionWithContextualType(node.attributes, paramType, undefined); + var argProperties = getPropertiesOfType(attributesType); + for (var _i = 0, argProperties_1 = argProperties; _i < argProperties_1.length; _i++) { + var arg = argProperties_1[_i]; + if (!getPropertyOfType(paramType, arg.name) && isUnhyphenatedJsxName(arg.name)) { + return false; + } + } + return checkTypeRelatedTo(attributesType, paramType, relation, undefined, headMessage); + } function checkApplicableSignature(node, args, signature, relation, excludeArgument, reportErrors) { + if (ts.isJsxOpeningLikeElement(node)) { + return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation); + } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 180) { + if (thisType && thisType !== voidType && node.kind !== 181) { var thisArgumentNode = getThisArgumentOfCall(node); var thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType; var errorNode = reportErrors ? (thisArgumentNode || node) : undefined; @@ -29426,7 +32148,7 @@ var ts; var argCount = getEffectiveArgumentCount(node, args, signature); for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); - if (arg === undefined || arg.kind !== 198) { + if (arg === undefined || arg.kind !== 199) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i); if (argType === undefined) { @@ -29441,51 +32163,54 @@ var ts; return true; } function getThisArgumentOfCall(node) { - if (node.kind === 179) { + if (node.kind === 180) { var callee = node.expression; - if (callee.kind === 177) { + if (callee.kind === 178) { return callee.expression; } - else if (callee.kind === 178) { + else if (callee.kind === 179) { return callee.expression; } } } function getEffectiveCallArguments(node) { var args; - if (node.kind === 181) { + if (node.kind === 182) { var template = node.template; args = [undefined]; - if (template.kind === 194) { + if (template.kind === 195) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); } } - else if (node.kind === 145) { + else if (node.kind === 146) { return undefined; } + else if (ts.isJsxOpeningLikeElement(node)) { + args = node.attributes.properties.length > 0 ? [node.attributes] : emptyArray; + } else { args = node.arguments || emptyArray; } return args; } function getEffectiveArgumentCount(node, args, signature) { - if (node.kind === 145) { + if (node.kind === 146) { switch (node.parent.kind) { - case 226: - case 197: + case 228: + case 198: return 1; - case 147: + case 148: return 2; - case 149: - case 151: + case 150: case 152: + case 153: if (languageVersion === 0) { return 2; } return signature.parameters.length >= 3 ? 3 : 2; - case 144: + case 145: return 3; } } @@ -29494,48 +32219,48 @@ var ts; } } function getEffectiveDecoratorFirstArgumentType(node) { - if (node.kind === 226) { + if (node.kind === 228) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } - if (node.kind === 144) { + if (node.kind === 145) { node = node.parent; - if (node.kind === 150) { + if (node.kind === 151) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } } - if (node.kind === 147 || - node.kind === 149 || - node.kind === 151 || - node.kind === 152) { + if (node.kind === 148 || + node.kind === 150 || + node.kind === 152 || + node.kind === 153) { return getParentTypeOfClassElement(node); } ts.Debug.fail("Unsupported decorator target."); return unknownType; } function getEffectiveDecoratorSecondArgumentType(node) { - if (node.kind === 226) { + if (node.kind === 228) { ts.Debug.fail("Class decorators should not have a second synthetic argument."); return unknownType; } - if (node.kind === 144) { + if (node.kind === 145) { node = node.parent; - if (node.kind === 150) { + if (node.kind === 151) { return anyType; } } - if (node.kind === 147 || - node.kind === 149 || - node.kind === 151 || - node.kind === 152) { + if (node.kind === 148 || + node.kind === 150 || + node.kind === 152 || + node.kind === 153) { var element = node; switch (element.name.kind) { case 70: case 8: case 9: return getLiteralTypeForText(32, element.name.text); - case 142: + case 143: var nameType = checkComputedPropertyName(element.name); if (isTypeOfKind(nameType, 512)) { return nameType; @@ -29552,20 +32277,20 @@ var ts; return unknownType; } function getEffectiveDecoratorThirdArgumentType(node) { - if (node.kind === 226) { + if (node.kind === 228) { ts.Debug.fail("Class decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 144) { + if (node.kind === 145) { return numberType; } - if (node.kind === 147) { + if (node.kind === 148) { ts.Debug.fail("Property decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 149 || - node.kind === 151 || - node.kind === 152) { + if (node.kind === 150 || + node.kind === 152 || + node.kind === 153) { var propertyType = getTypeOfNode(node); return createTypedPropertyDescriptorType(propertyType); } @@ -29586,26 +32311,26 @@ var ts; return unknownType; } function getEffectiveArgumentType(node, argIndex) { - if (node.kind === 145) { + if (node.kind === 146) { return getEffectiveDecoratorArgumentType(node, argIndex); } - else if (argIndex === 0 && node.kind === 181) { + else if (argIndex === 0 && node.kind === 182) { return getGlobalTemplateStringsArrayType(); } return undefined; } function getEffectiveArgument(node, args, argIndex) { - if (node.kind === 145 || - (argIndex === 0 && node.kind === 181)) { + if (node.kind === 146 || + (argIndex === 0 && node.kind === 182)) { return undefined; } return args[argIndex]; } function getEffectiveArgumentErrorNode(node, argIndex, arg) { - if (node.kind === 145) { + if (node.kind === 146) { return node.expression; } - else if (argIndex === 0 && node.kind === 181) { + else if (argIndex === 0 && node.kind === 182) { return node.template; } else { @@ -29613,15 +32338,30 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray, headMessage) { - var isTaggedTemplate = node.kind === 181; - var isDecorator = node.kind === 145; + var isTaggedTemplate = node.kind === 182; + var isDecorator = node.kind === 146; + var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var typeArguments; - if (!isTaggedTemplate && !isDecorator) { + if (!isTaggedTemplate && !isDecorator && !isJsxOpeningOrSelfClosingElement) { typeArguments = node.typeArguments; if (node.expression.kind !== 96) { ts.forEach(typeArguments, checkSourceElement); } } + if (signatures.length === 1) { + var declaration = signatures[0].declaration; + if (declaration && ts.isInJavaScriptFile(declaration) && !ts.hasJSDocParameterTags(declaration)) { + if (containsArgumentsReference(declaration)) { + var signatureWithRest = cloneSignature(signatures[0]); + var syntheticArgsSymbol = createSymbol(3, "args"); + syntheticArgsSymbol.type = anyArrayType; + syntheticArgsSymbol.isRestParameter = true; + signatureWithRest.parameters = ts.concatenate(signatureWithRest.parameters, [syntheticArgsSymbol]); + signatureWithRest.hasRestParameter = true; + signatures = [signatureWithRest]; + } + } + } var candidates = candidatesOutArray || []; reorderCandidates(signatures, candidates); if (!candidates.length) { @@ -29644,7 +32384,7 @@ var ts; var candidateForTypeArgumentError; var resultOfFailedInference; var result; - var signatureHelpTrailingComma = candidatesOutArray && node.kind === 179 && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = candidatesOutArray && node.kind === 180 && node.arguments.hasTrailingComma; if (candidates.length > 1) { result = chooseOverload(candidates, subtypeRelation, signatureHelpTrailingComma); } @@ -29658,6 +32398,9 @@ var ts; return result; } if (candidateForArgumentError) { + if (isJsxOpeningOrSelfClosingElement) { + return candidateForArgumentError; + } checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, undefined, true); } else if (candidateForTypeArgumentError) { @@ -29673,7 +32416,7 @@ var ts; if (headMessage) { diagnosticChainHead = ts.chainDiagnosticMessages(diagnosticChainHead, headMessage); } - reportNoCommonSupertypeError(inferenceCandidates, node.expression || node.tag, diagnosticChainHead); + reportNoCommonSupertypeError(inferenceCandidates, node.tagName || node.expression || node.tag, diagnosticChainHead); } } else { @@ -29709,20 +32452,20 @@ var ts; var candidate = void 0; var typeArgumentsAreValid = void 0; var inferenceContext = originalCandidate.typeParameters - ? createInferenceContext(originalCandidate, false) + ? createInferenceContext(originalCandidate, false, ts.isInJavaScriptFile(node)) : undefined; while (true) { candidate = originalCandidate; if (candidate.typeParameters) { var typeArgumentTypes = void 0; if (typeArguments) { - typeArgumentTypes = ts.map(typeArguments, getTypeFromTypeNode); + typeArgumentTypes = fillMissingTypeArguments(ts.map(typeArguments, getTypeFromTypeNode), candidate.typeParameters, getMinTypeArgumentCount(candidate.typeParameters)); typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, false); } else { inferTypeArguments(node, candidate, args, excludeArgument, inferenceContext); - typeArgumentsAreValid = inferenceContext.failedTypeParameterIndex === undefined; typeArgumentTypes = inferenceContext.inferredTypes; + typeArgumentsAreValid = inferenceContext.failedTypeParameterIndex === undefined; } if (!typeArgumentsAreValid) { break; @@ -29764,7 +32507,7 @@ var ts; if (superType !== unknownType) { var baseTypeNode = ts.getClassExtendsHeritageClauseElement(ts.getContainingClass(node)); if (baseTypeNode) { - var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments); + var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments, baseTypeNode); return resolveCall(node, baseConstructors, candidatesOutArray); } } @@ -29875,12 +32618,13 @@ var ts; if (containingClass) { var containingType = getTypeOfNode(containingClass); var baseTypes = getBaseTypes(containingType); - if (baseTypes.length) { + while (baseTypes.length) { var baseType = baseTypes[0]; if (modifiers & 16 && baseType.symbol === declaration.parent.symbol) { return true; } + baseTypes = getBaseTypes(baseType); } } if (modifiers & 8) { @@ -29912,16 +32656,16 @@ var ts; } function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 226: - case 197: + case 228: + case 198: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 144: + case 145: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 147: + case 148: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 149: - case 151: + case 150: case 152: + case 153: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; } } @@ -29946,16 +32690,42 @@ var ts; } return resolveCall(node, callSignatures, candidatesOutArray, headMessage); } + function getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, candidatesOutArray) { + ts.Debug.assert(!(elementType.flags & 65536)); + var callSignature = resolveStatelessJsxOpeningLikeElement(openingLikeElement, elementType, candidatesOutArray); + return callSignature; + } + function resolveStatelessJsxOpeningLikeElement(openingLikeElement, elementType, candidatesOutArray) { + if (elementType.flags & 65536) { + var types = elementType.types; + var result = void 0; + for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { + var type = types_18[_i]; + result = result || resolveStatelessJsxOpeningLikeElement(openingLikeElement, type, candidatesOutArray); + } + return result; + } + var callSignatures = elementType && getSignaturesOfType(elementType, 0); + if (callSignatures && callSignatures.length > 0) { + var callSignature = void 0; + callSignature = resolveCall(openingLikeElement, callSignatures, candidatesOutArray); + return callSignature; + } + return undefined; + } function resolveSignature(node, candidatesOutArray) { switch (node.kind) { - case 179: - return resolveCallExpression(node, candidatesOutArray); case 180: - return resolveNewExpression(node, candidatesOutArray); + return resolveCallExpression(node, candidatesOutArray); case 181: + return resolveNewExpression(node, candidatesOutArray); + case 182: return resolveTaggedTemplateExpression(node, candidatesOutArray); - case 145: + case 146: return resolveDecorator(node, candidatesOutArray); + case 250: + case 249: + return resolveStatelessJsxOpeningLikeElement(node, checkExpression(node.tagName), candidatesOutArray); } ts.Debug.fail("Branch in 'resolveSignature' should be unreachable."); } @@ -29986,20 +32756,23 @@ var ts; if (node.expression.kind === 96) { return voidType; } - if (node.kind === 180) { + if (node.kind === 181) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 150 && - declaration.kind !== 154 && - declaration.kind !== 159 && + declaration.kind !== 151 && + declaration.kind !== 155 && + declaration.kind !== 160 && !ts.isJSDocConstructSignature(declaration)) { var funcSymbol = node.expression.kind === 70 ? getResolvedSymbol(node.expression) : checkExpression(node.expression).symbol; - if (funcSymbol && funcSymbol.members && (funcSymbol.flags & 16 || ts.isDeclarationOfFunctionExpression(funcSymbol))) { + if (funcSymbol && ts.isDeclarationOfFunctionOrClassExpression(funcSymbol)) { + funcSymbol = getSymbolOfNode(funcSymbol.valueDeclaration.initializer); + } + if (funcSymbol && funcSymbol.members && funcSymbol.flags & 16) { return getInferredClassType(funcSymbol); } - else if (compilerOptions.noImplicitAny) { + else if (noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } return anyType; @@ -30022,9 +32795,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 - ? 225 + ? 227 : resolvedRequire.flags & 3 - ? 223 + ? 225 : 0; if (targetDeclarationKind !== 0) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -30050,6 +32823,22 @@ var ts; function checkNonNullAssertion(node) { return getNonNullableType(checkExpression(node.expression)); } + function checkMetaProperty(node) { + checkGrammarMetaProperty(node); + var container = ts.getNewTargetContainer(node); + if (!container) { + error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); + return unknownType; + } + else if (container.kind === 151) { + var symbol = getSymbolOfNode(container.parent); + return getTypeOfSymbol(symbol); + } + else { + var symbol = getSymbolOfNode(container); + return getTypeOfSymbol(symbol); + } + } function getTypeOfParameter(symbol) { var type = getTypeOfSymbol(symbol); if (strictNullChecks) { @@ -30065,13 +32854,16 @@ var ts; pos < signature.parameters.length - 1 ? getTypeOfParameter(signature.parameters[pos]) : getRestTypeOfSignature(signature) : pos < signature.parameters.length ? getTypeOfParameter(signature.parameters[pos]) : anyType; } - function assignContextualParameterTypes(signature, context, mapper) { + function getTypeOfFirstParameterOfSignature(signature) { + return signature.parameters.length > 0 ? getTypeAtPosition(signature, 0) : neverType; + } + function assignContextualParameterTypes(signature, context, mapper, checkMode) { var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0); - if (isInferentialContext(mapper)) { + if (checkMode === 2) { for (var i = 0; i < len; i++) { var declaration = signature.parameters[i].valueDeclaration; if (declaration.type) { - inferTypes(mapper.context, getTypeFromTypeNode(declaration.type), getTypeAtPosition(context, i)); + inferTypesWithContext(mapper.context, getTypeFromTypeNode(declaration.type), getTypeAtPosition(context, i)); } } } @@ -30079,23 +32871,23 @@ var ts; var parameter = signature.thisParameter; if (!parameter || parameter.valueDeclaration && !parameter.valueDeclaration.type) { if (!parameter) { - signature.thisParameter = createTransientSymbol(context.thisParameter, undefined); + signature.thisParameter = createSymbolWithType(context.thisParameter, undefined); } - assignTypeToParameterAndFixTypeParameters(signature.thisParameter, getTypeOfSymbol(context.thisParameter), mapper); + assignTypeToParameterAndFixTypeParameters(signature.thisParameter, getTypeOfSymbol(context.thisParameter), mapper, checkMode); } } for (var i = 0; i < len; i++) { var parameter = signature.parameters[i]; if (!parameter.valueDeclaration.type) { var contextualParameterType = getTypeAtPosition(context, i); - assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper); + assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper, checkMode); } } if (signature.hasRestParameter && isRestParameterIndex(context, signature.parameters.length - 1)) { var parameter = ts.lastOrUndefined(signature.parameters); if (!parameter.valueDeclaration.type) { var contextualParameterType = getTypeOfSymbol(ts.lastOrUndefined(context.parameters)); - assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper); + assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper, checkMode); } } } @@ -30112,19 +32904,19 @@ var ts; } } } - function assignTypeToParameterAndFixTypeParameters(parameter, contextualType, mapper) { + function assignTypeToParameterAndFixTypeParameters(parameter, contextualType, mapper, checkMode) { var links = getSymbolLinks(parameter); if (!links.type) { links.type = instantiateType(contextualType, mapper); if (links.type === emptyObjectType && - (parameter.valueDeclaration.name.kind === 172 || - parameter.valueDeclaration.name.kind === 173)) { + (parameter.valueDeclaration.name.kind === 173 || + parameter.valueDeclaration.name.kind === 174)) { links.type = getTypeFromBindingPattern(parameter.valueDeclaration.name); } assignBindingElementTypes(parameter.valueDeclaration); } - else if (isInferentialContext(mapper)) { - inferTypes(mapper.context, links.type, instantiateType(contextualType, mapper)); + else if (checkMode === 2) { + inferTypesWithContext(mapper.context, links.type, instantiateType(contextualType, mapper)); } } function getReturnTypeFromJSDocComment(func) { @@ -30135,9 +32927,9 @@ var ts; return undefined; } function createPromiseType(promisedType) { - var globalPromiseType = getGlobalPromiseType(); + var globalPromiseType = getGlobalPromiseType(true); if (globalPromiseType !== emptyGenericType) { - promisedType = getAwaitedType(promisedType); + promisedType = getAwaitedType(promisedType) || emptyObjectType; return createTypeReference(globalPromiseType, [promisedType]); } return emptyObjectType; @@ -30148,46 +32940,56 @@ var ts; error(func, ts.Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option); return unknownType; } + else if (!getGlobalPromiseConstructorSymbol(true)) { + error(func, ts.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option); + } return promiseType; } - function getReturnTypeFromBody(func, contextualMapper) { + function getReturnTypeFromBody(func, checkMode) { var contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func); if (!func.body) { return unknownType; } - var isAsync = ts.isAsyncFunctionLike(func); + var functionFlags = ts.getFunctionFlags(func); var type; - if (func.body.kind !== 204) { - type = checkExpressionCached(func.body, contextualMapper); - if (isAsync) { - type = checkAwaitedType(type, func, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); + if (func.body.kind !== 206) { + type = checkExpressionCached(func.body, checkMode); + if (functionFlags & 2) { + type = checkAwaitedType(type, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } } else { var types = void 0; - var funcIsGenerator = !!func.asteriskToken; - if (funcIsGenerator) { - types = checkAndAggregateYieldOperandTypes(func, contextualMapper); - if (types.length === 0) { - var iterableIteratorAny = createIterableIteratorType(anyType); - if (compilerOptions.noImplicitAny) { + if (functionFlags & 1) { + types = ts.concatenate(checkAndAggregateYieldOperandTypes(func, checkMode), checkAndAggregateReturnExpressionTypes(func, checkMode)); + if (!types || types.length === 0) { + var iterableIteratorAny = functionFlags & 2 + ? createAsyncIterableIteratorType(anyType) + : createIterableIteratorType(anyType); + if (noImplicitAny) { error(func.asteriskToken, ts.Diagnostics.Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type, typeToString(iterableIteratorAny)); } return iterableIteratorAny; } } else { - types = checkAndAggregateReturnExpressionTypes(func, contextualMapper); + types = checkAndAggregateReturnExpressionTypes(func, checkMode); if (!types) { - return isAsync ? createPromiseReturnType(func, neverType) : neverType; + return functionFlags & 2 + ? createPromiseReturnType(func, neverType) + : neverType; } if (types.length === 0) { - return isAsync ? createPromiseReturnType(func, voidType) : voidType; + return functionFlags & 2 + ? createPromiseReturnType(func, voidType) + : voidType; } } type = getUnionType(types, true); - if (funcIsGenerator) { - type = createIterableIteratorType(type); + if (functionFlags & 1) { + type = functionFlags & 2 + ? createAsyncIterableIteratorType(type) + : createIterableIteratorType(type); } } if (!contextualSignature) { @@ -30199,16 +33001,24 @@ var ts; type = getWidenedLiteralType(type); } var widenedType = getWidenedType(type); - return isAsync ? createPromiseReturnType(func, widenedType) : widenedType; + return (functionFlags & 3) === 2 + ? createPromiseReturnType(func, widenedType) + : widenedType; } - function checkAndAggregateYieldOperandTypes(func, contextualMapper) { + function checkAndAggregateYieldOperandTypes(func, checkMode) { var aggregatedTypes = []; + var functionFlags = ts.getFunctionFlags(func); ts.forEachYieldExpression(func.body, function (yieldExpression) { var expr = yieldExpression.expression; if (expr) { - var type = checkExpressionCached(expr, contextualMapper); + var type = checkExpressionCached(expr, checkMode); if (yieldExpression.asteriskToken) { - type = checkElementTypeOfIterable(type, yieldExpression.expression); + type = checkIteratedTypeOrElementType(type, yieldExpression.expression, false, (functionFlags & 2) !== 0); + } + if (functionFlags & 2) { + type = checkAwaitedType(type, expr, yieldExpression.asteriskToken + ? ts.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + : ts.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } if (!ts.contains(aggregatedTypes, type)) { aggregatedTypes.push(type); @@ -30229,29 +33039,29 @@ var ts; if (!switchTypes.length) { return false; } - return eachTypeContainedIn(type, switchTypes); + return eachTypeContainedIn(mapType(type, getRegularTypeOfLiteralType), switchTypes); } function functionHasImplicitReturn(func) { if (!(func.flags & 128)) { return false; } var lastStatement = ts.lastOrUndefined(func.body.statements); - if (lastStatement && lastStatement.kind === 218 && isExhaustiveSwitchStatement(lastStatement)) { + if (lastStatement && lastStatement.kind === 220 && isExhaustiveSwitchStatement(lastStatement)) { return false; } return true; } - function checkAndAggregateReturnExpressionTypes(func, contextualMapper) { - var isAsync = ts.isAsyncFunctionLike(func); + function checkAndAggregateReturnExpressionTypes(func, checkMode) { + var functionFlags = ts.getFunctionFlags(func); var aggregatedTypes = []; var hasReturnWithNoExpression = functionHasImplicitReturn(func); var hasReturnOfTypeNever = false; ts.forEachReturnStatement(func.body, function (returnStatement) { var expr = returnStatement.expression; if (expr) { - var type = checkExpressionCached(expr, contextualMapper); - if (isAsync) { - type = checkAwaitedType(type, func, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); + var type = checkExpressionCached(expr, checkMode); + if (functionFlags & 2) { + type = checkAwaitedType(type, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } if (type.flags & 8192) { hasReturnOfTypeNever = true; @@ -30265,7 +33075,7 @@ var ts; } }); if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever || - func.kind === 184 || func.kind === 185)) { + func.kind === 185 || func.kind === 186)) { return undefined; } if (strictNullChecks && aggregatedTypes.length && hasReturnWithNoExpression) { @@ -30282,7 +33092,7 @@ var ts; if (returnType && maybeTypeOfKind(returnType, 1 | 1024)) { return; } - if (ts.nodeIsMissing(func.body) || func.body.kind !== 204 || !functionHasImplicitReturn(func)) { + if (ts.nodeIsMissing(func.body) || func.body.kind !== 206 || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 256; @@ -30308,20 +33118,20 @@ var ts; error(func.type || func, ts.Diagnostics.Not_all_code_paths_return_a_value); } } - function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) { - ts.Debug.assert(node.kind !== 149 || ts.isObjectLiteralMethod(node)); + function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { + ts.Debug.assert(node.kind !== 150 || ts.isObjectLiteralMethod(node)); var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 184) { + if (!hasGrammarError && node.kind === 185) { checkGrammarForGenerator(node); } - if (contextualMapper === identityMapper && isContextSensitive(node)) { + if (checkMode === 1 && isContextSensitive(node)) { checkNodeDeferred(node); return anyFunctionType; } var links = getNodeLinks(node); var type = getTypeOfSymbol(node.symbol); var contextSensitive = isContextSensitive(node); - var mightFixTypeParameters = contextSensitive && isInferentialContext(contextualMapper); + var mightFixTypeParameters = contextSensitive && checkMode === 2; if (mightFixTypeParameters || !(links.flags & 1024)) { var contextualSignature = getContextualSignature(node); var contextChecked = !!(links.flags & 1024); @@ -30330,10 +33140,10 @@ var ts; if (contextualSignature) { var signature = getSignaturesOfType(type, 0)[0]; if (contextSensitive) { - assignContextualParameterTypes(signature, contextualSignature, contextualMapper || identityMapper); + assignContextualParameterTypes(signature, contextualSignature, getContextualMapper(node), checkMode); } if (mightFixTypeParameters || !node.type && !signature.resolvedReturnType) { - var returnType = getReturnTypeFromBody(node, contextualMapper); + var returnType = getReturnTypeFromBody(node, checkMode); if (!signature.resolvedReturnType) { signature.resolvedReturnType = returnType; } @@ -30345,31 +33155,35 @@ var ts; } } } - if (produceDiagnostics && node.kind !== 149) { + if (produceDiagnostics && node.kind !== 150) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); } return type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 149 || ts.isObjectLiteralMethod(node)); - var isAsync = ts.isAsyncFunctionLike(node); - var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); - if (!node.asteriskToken) { + ts.Debug.assert(node.kind !== 150 || ts.isObjectLiteralMethod(node)); + var functionFlags = ts.getFunctionFlags(node); + var returnOrPromisedType = node.type && + ((functionFlags & 3) === 2 ? + checkAsyncFunctionReturnType(node) : + getTypeFromTypeNode(node.type)); + if ((functionFlags & 1) === 0) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } if (node.body) { if (!node.type) { getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 204) { + if (node.body.kind === 206) { checkSourceElement(node.body); } else { var exprType = checkExpression(node.body); if (returnOrPromisedType) { - if (isAsync) { - var awaitedType = checkAwaitedType(exprType, node.body, ts.Diagnostics.Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member); + if ((functionFlags & 3) === 2) { + var awaitedType = checkAwaitedType(exprType, node.body, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); checkTypeAssignableTo(awaitedType, returnOrPromisedType, node.body); } else { @@ -30388,19 +33202,19 @@ var ts; return true; } function isReadonlySymbol(symbol) { - return symbol.isReadonly || - symbol.flags & 4 && (getDeclarationModifierFlagsFromSymbol(symbol) & 64) !== 0 || - symbol.flags & 3 && (getDeclarationNodeFlagsFromSymbol(symbol) & 2) !== 0 || + return !!(getCheckFlags(symbol) & 8 || + symbol.flags & 4 && getDeclarationModifierFlagsFromSymbol(symbol) & 64 || + symbol.flags & 3 && getDeclarationNodeFlagsFromSymbol(symbol) & 2 || symbol.flags & 98304 && !(symbol.flags & 65536) || - (symbol.flags & 8) !== 0; + symbol.flags & 8); } function isReferenceToReadonlyEntity(expr, symbol) { if (isReadonlySymbol(symbol)) { if (symbol.flags & 4 && - (expr.kind === 177 || expr.kind === 178) && + (expr.kind === 178 || expr.kind === 179) && expr.expression.kind === 98) { var func = ts.getContainingFunction(expr); - if (!(func && func.kind === 150)) + if (!(func && func.kind === 151)) return true; return !(func.parent === symbol.valueDeclaration.parent || func === symbol.valueDeclaration.parent); } @@ -30409,13 +33223,13 @@ var ts; return false; } function isReferenceThroughNamespaceImport(expr) { - if (expr.kind === 177 || expr.kind === 178) { + if (expr.kind === 178 || expr.kind === 179) { var node = ts.skipParentheses(expr.expression); if (node.kind === 70) { var symbol = getNodeLinks(node).resolvedSymbol; if (symbol.flags & 8388608) { var declaration = getDeclarationOfAliasSymbol(symbol); - return declaration && declaration.kind === 237; + return declaration && declaration.kind === 239; } } } @@ -30423,7 +33237,7 @@ var ts; } function checkReferenceExpression(expr, invalidReferenceMessage) { var node = ts.skipParentheses(expr); - if (node.kind !== 70 && node.kind !== 177 && node.kind !== 178) { + if (node.kind !== 70 && node.kind !== 178 && node.kind !== 179) { error(expr, invalidReferenceMessage); return false; } @@ -30431,11 +33245,21 @@ var ts; } function checkDeleteExpression(node) { checkExpression(node.expression); + var expr = ts.skipParentheses(node.expression); + if (expr.kind !== 178 && expr.kind !== 179) { + error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); + return booleanType; + } + var links = getNodeLinks(expr); + var symbol = getExportSymbolOfValueSymbolIfExported(links.resolvedSymbol); + if (symbol && isReadonlySymbol(symbol)) { + error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_read_only_property); + } return booleanType; } function checkTypeOfExpression(node) { checkExpression(node.expression); - return stringType; + return typeofType; } function checkVoidExpression(node) { checkExpression(node.expression); @@ -30443,7 +33267,7 @@ var ts; } function checkAwaitExpression(node) { if (produceDiagnostics) { - if (!(node.flags & 524288)) { + if (!(node.flags & 16384)) { grammarErrorOnFirstToken(node, ts.Diagnostics.await_expression_is_only_allowed_within_an_async_function); } if (isInParameterInitializerBeforeContainingFunction(node)) { @@ -30451,7 +33275,7 @@ var ts; } } var operandType = checkExpression(node.expression); - return checkAwaitedType(operandType, node); + return checkAwaitedType(operandType, node, ts.Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } function checkPrefixUnaryExpression(node) { var operandType = checkExpression(node.operand); @@ -30465,6 +33289,7 @@ var ts; case 36: case 37: case 51: + checkNonNullType(operandType, node.operand); if (maybeTypeOfKind(operandType, 512)) { error(node.operand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(node.operator)); } @@ -30476,7 +33301,7 @@ var ts; booleanType; case 42: case 43: - var ok = checkArithmeticOperandType(node.operand, getNonNullableType(operandType), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); + var ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access); } @@ -30489,7 +33314,7 @@ var ts; if (operandType === silentNeverType) { return silentNeverType; } - var ok = checkArithmeticOperandType(node.operand, getNonNullableType(operandType), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); + var ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access); } @@ -30501,8 +33326,8 @@ var ts; } if (type.flags & 196608) { var types = type.types; - for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { - var t = types_15[_i]; + for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { + var t = types_19[_i]; if (maybeTypeOfKind(t, kind)) { return true; } @@ -30516,8 +33341,8 @@ var ts; } if (type.flags & 65536) { var types = type.types; - for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { - var t = types_16[_i]; + for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { + var t = types_20[_i]; if (!isTypeOfKind(t, kind)) { return false; } @@ -30526,8 +33351,8 @@ var ts; } if (type.flags & 131072) { var types = type.types; - for (var _a = 0, types_17 = types; _a < types_17.length; _a++) { - var t = types_17[_a]; + for (var _a = 0, types_21 = types; _a < types_21.length; _a++) { + var t = types_21[_a]; if (isTypeOfKind(t, kind)) { return true; } @@ -30548,7 +33373,10 @@ var ts; if (isTypeOfKind(leftType, 8190)) { error(left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } - if (!(isTypeAny(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) { + if (!(isTypeAny(rightType) || + getSignaturesOfType(rightType, 0).length || + getSignaturesOfType(rightType, 1).length || + isTypeSubtypeOf(rightType, globalFunctionType))) { error(right, ts.Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); } return booleanType; @@ -30557,39 +33385,41 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } + leftType = checkNonNullType(leftType, left); + rightType = checkNonNullType(rightType, right); if (!(isTypeComparableTo(leftType, stringType) || isTypeOfKind(leftType, 340 | 512))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 | 16384 | 524288)) { + if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 | 540672 | 16777216)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; } function checkObjectLiteralAssignment(node, sourceType) { var properties = node.properties; - for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) { - var p = properties_5[_i]; + for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) { + var p = properties_7[_i]; checkObjectLiteralDestructuringPropertyAssignment(sourceType, p, properties); } return sourceType; } function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property, allProperties) { - if (property.kind === 257 || property.kind === 258) { - var name_20 = property.name; - if (name_20.kind === 142) { - checkComputedPropertyName(name_20); + if (property.kind === 260 || property.kind === 261) { + var name = property.name; + if (name.kind === 143) { + checkComputedPropertyName(name); } - if (isComputedNonLiteralName(name_20)) { + if (isComputedNonLiteralName(name)) { return undefined; } - var text = ts.getTextOfPropertyName(name_20); + var text = ts.getTextOfPropertyName(name); var type = isTypeAny(objectLiteralType) ? objectLiteralType : getTypeOfPropertyOfType(objectLiteralType, text) || isNumericLiteralName(text) && getIndexTypeOfType(objectLiteralType, 1) || getIndexTypeOfType(objectLiteralType, 0); if (type) { - if (property.kind === 258) { + if (property.kind === 261) { return checkDestructuringAssignment(property, type); } else { @@ -30597,10 +33427,13 @@ var ts; } } else { - error(name_20, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name_20)); + error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name)); } } - else if (property.kind === 259) { + else if (property.kind === 262) { + if (languageVersion < 5) { + checkExternalEmitHelpers(property, 4); + } var nonRestNames = []; if (allProperties) { for (var i = 0; i < allProperties.length - 1; i++) { @@ -30614,19 +33447,22 @@ var ts; error(property, ts.Diagnostics.Property_assignment_expected); } } - function checkArrayLiteralAssignment(node, sourceType, contextualMapper) { - var elementType = checkIteratedTypeOrElementType(sourceType, node, false) || unknownType; + function checkArrayLiteralAssignment(node, sourceType, checkMode) { + if (languageVersion < 2 && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 512); + } + var elementType = checkIteratedTypeOrElementType(sourceType, node, false, false) || unknownType; var elements = node.elements; for (var i = 0; i < elements.length; i++) { - checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, elementType, contextualMapper); + checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, elementType, checkMode); } return sourceType; } - function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, contextualMapper) { + function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 198) { - if (element.kind !== 196) { + if (element.kind !== 199) { + if (element.kind !== 197) { var propName = "" + elementIndex; var type = isTypeAny(sourceType) ? sourceType @@ -30634,7 +33470,7 @@ var ts; ? getTypeOfPropertyOfType(sourceType, propName) : elementType; if (type) { - return checkDestructuringAssignment(element, type, contextualMapper); + return checkDestructuringAssignment(element, type, checkMode); } else { checkExpression(element); @@ -30652,48 +33488,48 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 192 && restExpression.operatorToken.kind === 57) { + if (restExpression.kind === 193 && restExpression.operatorToken.kind === 57) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { - return checkDestructuringAssignment(restExpression, createArrayType(elementType), contextualMapper); + return checkDestructuringAssignment(restExpression, createArrayType(elementType), checkMode); } } } } return undefined; } - function checkDestructuringAssignment(exprOrAssignment, sourceType, contextualMapper) { + function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode) { var target; - if (exprOrAssignment.kind === 258) { + if (exprOrAssignment.kind === 261) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { if (strictNullChecks && !(getFalsyFlags(checkExpression(prop.objectAssignmentInitializer)) & 2048)) { sourceType = getTypeWithFacts(sourceType, 131072); } - checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, contextualMapper); + checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode); } target = exprOrAssignment.name; } else { target = exprOrAssignment; } - if (target.kind === 192 && target.operatorToken.kind === 57) { - checkBinaryExpression(target, contextualMapper); + if (target.kind === 193 && target.operatorToken.kind === 57) { + checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 176) { + if (target.kind === 177) { return checkObjectLiteralAssignment(target, sourceType); } - if (target.kind === 175) { - return checkArrayLiteralAssignment(target, sourceType, contextualMapper); + if (target.kind === 176) { + return checkArrayLiteralAssignment(target, sourceType, checkMode); } - return checkReferenceAssignment(target, sourceType, contextualMapper); + return checkReferenceAssignment(target, sourceType, checkMode); } - function checkReferenceAssignment(target, sourceType, contextualMapper) { - var targetType = checkExpression(target, contextualMapper); - var error = target.parent.kind === 259 ? + function checkReferenceAssignment(target, sourceType, checkMode) { + var targetType = checkExpression(target, checkMode); + var error = target.parent.kind === 262 ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; if (checkReferenceExpression(target, error)) { @@ -30707,35 +33543,35 @@ var ts; case 70: case 9: case 11: - case 181: - case 194: + case 182: + case 195: case 12: case 8: case 100: case 85: case 94: - case 137: - case 184: - case 197: + case 138: case 185: - case 175: + case 198: + case 186: case 176: - case 187: - case 201: - case 247: - case 246: + case 177: + case 188: + case 202: + case 249: + case 248: return true; - case 193: + case 194: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 192: + case 193: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 190: case 191: + case 192: switch (node.operator) { case 50: case 36: @@ -30744,9 +33580,9 @@ var ts; return true; } return false; - case 188: - case 182: - case 200: + case 189: + case 183: + case 201: default: return false; } @@ -30761,16 +33597,16 @@ var ts; firstAssignableToSecond && !secondAssignableToFirst ? type2 : getUnionType([type1, type2], true); } - function checkBinaryExpression(node, contextualMapper) { - return checkBinaryLikeExpression(node.left, node.operatorToken, node.right, contextualMapper, node); + function checkBinaryExpression(node, checkMode) { + return checkBinaryLikeExpression(node.left, node.operatorToken, node.right, checkMode, node); } - function checkBinaryLikeExpression(left, operatorToken, right, contextualMapper, errorNode) { + function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 57 && (left.kind === 176 || left.kind === 175)) { - return checkDestructuringAssignment(left, checkExpression(right, contextualMapper), contextualMapper); + if (operator === 57 && (left.kind === 177 || left.kind === 176)) { + return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode); } - var leftType = checkExpression(left, contextualMapper); - var rightType = checkExpression(right, contextualMapper); + var leftType = checkExpression(left, checkMode); + var rightType = checkExpression(right, checkMode); switch (operator) { case 38: case 39: @@ -30797,12 +33633,8 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (leftType.flags & 6144) - leftType = rightType; - if (rightType.flags & 6144) - rightType = leftType; - leftType = getNonNullableType(leftType); - rightType = getNonNullableType(rightType); + leftType = checkNonNullType(leftType, left); + rightType = checkNonNullType(rightType, right); var suggestedOperator = void 0; if ((leftType.flags & 136) && (rightType.flags & 136) && @@ -30822,12 +33654,10 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (leftType.flags & 6144) - leftType = rightType; - if (rightType.flags & 6144) - rightType = leftType; - leftType = getNonNullableType(leftType); - rightType = getNonNullableType(rightType); + if (!isTypeOfKind(leftType, 1 | 262178) && !isTypeOfKind(rightType, 1 | 262178)) { + leftType = checkNonNullType(leftType, left); + rightType = checkNonNullType(rightType, right); + } var resultType = void 0; if (isTypeOfKind(leftType, 340) && isTypeOfKind(rightType, 340)) { resultType = numberType; @@ -30856,8 +33686,8 @@ var ts; case 29: case 30: if (checkForDisallowedESSymbolOperand(operator)) { - leftType = getBaseTypeOfLiteralType(leftType); - rightType = getBaseTypeOfLiteralType(rightType); + leftType = getBaseTypeOfLiteralType(checkNonNullType(leftType, left)); + rightType = getBaseTypeOfLiteralType(checkNonNullType(rightType, right)); if (!isTypeComparableTo(leftType, rightType) && !isTypeComparableTo(rightType, leftType)) { reportOperatorError(); } @@ -30893,11 +33723,14 @@ var ts; checkAssignmentOperator(rightType); return getRegularTypeOfObjectLiteral(rightType); case 25: - if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left)) { + if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isEvalNode(right)) { error(left, ts.Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects); } return rightType; } + function isEvalNode(node) { + return node.kind === 70 && node.text === "eval"; + } function checkForDisallowedESSymbolOperand(operator) { var offendingSymbolOperand = maybeTypeOfKind(leftType, 512) ? left : maybeTypeOfKind(rightType, 512) ? right : @@ -30951,7 +33784,7 @@ var ts; } function checkYieldExpression(node) { if (produceDiagnostics) { - if (!(node.flags & 131072) || isYieldExpressionInClass(node)) { + if (!(node.flags & 4096) || isYieldExpressionInClass(node)) { grammarErrorOnFirstToken(node, ts.Diagnostics.A_yield_expression_is_only_allowed_in_a_generator_body); } if (isInParameterInitializerBeforeContainingFunction(node)) { @@ -30960,30 +33793,45 @@ var ts; } if (node.expression) { var func = ts.getContainingFunction(node); - if (func && func.asteriskToken) { + var functionFlags = func && ts.getFunctionFlags(func); + if (node.asteriskToken) { + if (functionFlags & 2) { + if (languageVersion < 4) { + checkExternalEmitHelpers(node, 4096); + } + } + else if (languageVersion < 2 && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 256); + } + } + if (functionFlags & 1) { var expressionType = checkExpressionCached(node.expression, undefined); var expressionElementType = void 0; var nodeIsYieldStar = !!node.asteriskToken; if (nodeIsYieldStar) { - expressionElementType = checkElementTypeOfIterable(expressionType, node.expression); + expressionElementType = checkIteratedTypeOrElementType(expressionType, node.expression, false, (functionFlags & 2) !== 0); } if (func.type) { - var signatureElementType = getElementTypeOfIterableIterator(getTypeFromTypeNode(func.type)) || anyType; + var signatureElementType = getIteratedTypeOfGenerator(getTypeFromTypeNode(func.type), (functionFlags & 2) !== 0) || anyType; if (nodeIsYieldStar) { - checkTypeAssignableTo(expressionElementType, signatureElementType, node.expression, undefined); + checkTypeAssignableTo(functionFlags & 2 + ? getAwaitedType(expressionElementType, node.expression, ts.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) + : expressionElementType, signatureElementType, node.expression, undefined); } else { - checkTypeAssignableTo(expressionType, signatureElementType, node.expression, undefined); + checkTypeAssignableTo(functionFlags & 2 + ? getAwaitedType(expressionType, node.expression, ts.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) + : expressionType, signatureElementType, node.expression, undefined); } } } } return anyType; } - function checkConditionalExpression(node, contextualMapper) { + function checkConditionalExpression(node, checkMode) { checkExpression(node.condition); - var type1 = checkExpression(node.whenTrue, contextualMapper); - var type2 = checkExpression(node.whenFalse, contextualMapper); + var type1 = checkExpression(node.whenTrue, checkMode); + var type2 = checkExpression(node.whenFalse, checkMode); return getBestChoiceType(type1, type2); } function checkLiteralExpression(node) { @@ -31009,107 +33857,119 @@ var ts; } function checkExpressionWithContextualType(node, contextualType, contextualMapper) { var saveContextualType = node.contextualType; + var saveContextualMapper = node.contextualMapper; node.contextualType = contextualType; - var result = checkExpression(node, contextualMapper); + node.contextualMapper = contextualMapper; + var checkMode = contextualMapper === identityMapper ? 1 : + contextualMapper ? 2 : 0; + var result = checkExpression(node, checkMode); node.contextualType = saveContextualType; + node.contextualMapper = saveContextualMapper; return result; } - function checkExpressionCached(node, contextualMapper) { + function checkExpressionCached(node, checkMode) { var links = getNodeLinks(node); if (!links.resolvedType) { var saveFlowLoopStart = flowLoopStart; flowLoopStart = flowLoopCount; - links.resolvedType = checkExpression(node, contextualMapper); + links.resolvedType = checkExpression(node, checkMode); flowLoopStart = saveFlowLoopStart; } return links.resolvedType; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 182 || node.kind === 200; + return node.kind === 183 || node.kind === 201; } function checkDeclarationInitializer(declaration) { - var type = checkExpressionCached(declaration.initializer); + var type = getTypeOfExpression(declaration.initializer, true); return ts.getCombinedNodeFlags(declaration) & 2 || ts.getCombinedModifierFlags(declaration) & 64 && !ts.isParameterPropertyDeclaration(declaration) || isTypeAssertion(declaration.initializer) ? type : getWidenedLiteralType(type); } function isLiteralContextualType(contextualType) { if (contextualType) { - if (contextualType.flags & 16384) { - var apparentType = getApparentTypeOfTypeParameter(contextualType); - if (apparentType.flags & (2 | 4 | 8 | 16)) { + if (contextualType.flags & 540672) { + var constraint = getBaseConstraintOfType(contextualType) || emptyObjectType; + if (constraint.flags & (2 | 4 | 8 | 16)) { return true; } - contextualType = apparentType; + contextualType = constraint; } return maybeTypeOfKind(contextualType, (480 | 262144)); } return false; } - function checkExpressionForMutableLocation(node, contextualMapper) { - var type = checkExpression(node, contextualMapper); + function checkExpressionForMutableLocation(node, checkMode) { + var type = checkExpression(node, checkMode); return isTypeAssertion(node) || isLiteralContextualType(getContextualType(node)) ? type : getWidenedLiteralType(type); } - function checkPropertyAssignment(node, contextualMapper) { - if (node.name.kind === 142) { + function checkPropertyAssignment(node, checkMode) { + if (node.name.kind === 143) { checkComputedPropertyName(node.name); } - return checkExpressionForMutableLocation(node.initializer, contextualMapper); + return checkExpressionForMutableLocation(node.initializer, checkMode); } - function checkObjectLiteralMethod(node, contextualMapper) { + function checkObjectLiteralMethod(node, checkMode) { checkGrammarMethod(node); - if (node.name.kind === 142) { + if (node.name.kind === 143) { checkComputedPropertyName(node.name); } - var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - return instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); + var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); + return instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode); } - function instantiateTypeWithSingleGenericCallSignature(node, type, contextualMapper) { - if (isInferentialContext(contextualMapper)) { + function instantiateTypeWithSingleGenericCallSignature(node, type, checkMode) { + if (checkMode === 2) { var signature = getSingleCallSignature(type); if (signature && signature.typeParameters) { var contextualType = getApparentTypeOfContextualType(node); if (contextualType) { var contextualSignature = getSingleCallSignature(contextualType); if (contextualSignature && !contextualSignature.typeParameters) { - return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper)); + return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, getContextualMapper(node))); } } } } return type; } - function getTypeOfExpression(node) { - if (node.kind === 179 && node.expression.kind !== 96) { + function getTypeOfExpression(node, cache) { + if (node.kind === 180 && node.expression.kind !== 96 && !ts.isRequireCall(node, true)) { var funcType = checkNonNullExpression(node.expression); var signature = getSingleCallSignature(funcType); if (signature && !signature.typeParameters) { return getReturnTypeOfSignature(signature); } } - return checkExpression(node); + return cache ? checkExpressionCached(node) : checkExpression(node); } - function checkExpression(node, contextualMapper) { + function getContextFreeTypeOfExpression(node) { + var saveContextualType = node.contextualType; + node.contextualType = anyType; + var type = getTypeOfExpression(node); + node.contextualType = saveContextualType; + return type; + } + function checkExpression(node, checkMode) { var type; - if (node.kind === 141) { + if (node.kind === 142) { type = checkQualifiedName(node); } else { - var uninstantiatedType = checkExpressionWorker(node, contextualMapper); - type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); + var uninstantiatedType = checkExpressionWorker(node, checkMode); + type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode); } if (isConstEnumObjectType(type)) { - var ok = (node.parent.kind === 177 && node.parent.expression === node) || - (node.parent.kind === 178 && node.parent.expression === node) || - ((node.kind === 70 || node.kind === 141) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 178 && node.parent.expression === node) || + (node.parent.kind === 179 && node.parent.expression === node) || + ((node.kind === 70 || node.kind === 142) && isInRightSideOfImportOrExportAssignment(node)); if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); } } return type; } - function checkExpressionWorker(node, contextualMapper) { + function checkExpressionWorker(node, checkMode) { switch (node.kind) { case 70: return checkIdentifier(node); @@ -31124,66 +33984,70 @@ var ts; case 100: case 85: return checkLiteralExpression(node); - case 194: + case 195: return checkTemplateExpression(node); case 12: return stringType; case 11: return globalRegExpType; - case 175: - return checkArrayLiteral(node, contextualMapper); case 176: - return checkObjectLiteral(node, contextualMapper); + return checkArrayLiteral(node, checkMode); case 177: - return checkPropertyAccessExpression(node); + return checkObjectLiteral(node, checkMode); case 178: - return checkIndexedAccess(node); + return checkPropertyAccessExpression(node); case 179: + return checkIndexedAccess(node); case 180: - return checkCallExpression(node); case 181: - return checkTaggedTemplateExpression(node); - case 183: - return checkExpression(node.expression, contextualMapper); - case 197: - return checkClassExpression(node); - case 184: - case 185: - return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 187: - return checkTypeOfExpression(node); + return checkCallExpression(node); case 182: - case 200: - return checkAssertion(node); - case 201: - return checkNonNullAssertion(node); - case 186: - return checkDeleteExpression(node); - case 188: - return checkVoidExpression(node); - case 189: - return checkAwaitExpression(node); - case 190: - return checkPrefixUnaryExpression(node); - case 191: - return checkPostfixUnaryExpression(node); - case 192: - return checkBinaryExpression(node, contextualMapper); - case 193: - return checkConditionalExpression(node, contextualMapper); - case 196: - return checkSpreadExpression(node, contextualMapper); + return checkTaggedTemplateExpression(node); + case 184: + return checkExpression(node.expression, checkMode); case 198: + return checkClassExpression(node); + case 185: + case 186: + return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); + case 188: + return checkTypeOfExpression(node); + case 183: + case 201: + return checkAssertion(node); + case 202: + return checkNonNullAssertion(node); + case 203: + return checkMetaProperty(node); + case 187: + return checkDeleteExpression(node); + case 189: + return checkVoidExpression(node); + case 190: + return checkAwaitExpression(node); + case 191: + return checkPrefixUnaryExpression(node); + case 192: + return checkPostfixUnaryExpression(node); + case 193: + return checkBinaryExpression(node, checkMode); + case 194: + return checkConditionalExpression(node, checkMode); + case 197: + return checkSpreadExpression(node, checkMode); + case 199: return undefinedWideningType; - case 195: + case 196: return checkYieldExpression(node); - case 252: - return checkJsxExpression(node); - case 246: - return checkJsxElement(node); - case 247: - return checkJsxSelfClosingElement(node); + case 255: + return checkJsxExpression(node, checkMode); case 248: + return checkJsxElement(node); + case 249: + return checkJsxSelfClosingElement(node); + case 253: + return checkJsxAttributes(node, checkMode); + case 250: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return unknownType; @@ -31193,7 +34057,16 @@ var ts; grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected); } checkSourceElement(node.constraint); - getConstraintOfTypeParameter(getDeclaredTypeOfTypeParameter(getSymbolOfNode(node))); + checkSourceElement(node.default); + var typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node)); + if (!hasNonCircularBaseConstraint(typeParameter)) { + error(node.constraint, ts.Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(typeParameter)); + } + var constraintType = getConstraintOfTypeParameter(typeParameter); + var defaultType = getDefaultFromTypeParameter(typeParameter); + if (constraintType && defaultType) { + checkTypeAssignableTo(defaultType, getTypeWithThisArgument(constraintType, defaultType), node.default, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + } if (produceDiagnostics) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); } @@ -31204,7 +34077,7 @@ var ts; var func = ts.getContainingFunction(node); if (ts.getModifierFlags(node) & 92) { func = ts.getContainingFunction(node); - if (!(func.kind === 150 && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 151 && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -31215,7 +34088,7 @@ var ts; if (ts.indexOf(func.parameters, node) !== 0) { error(node, ts.Diagnostics.A_this_parameter_must_be_the_first_parameter); } - if (func.kind === 150 || func.kind === 154 || func.kind === 159) { + if (func.kind === 151 || func.kind === 155 || func.kind === 160) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } } @@ -31223,14 +34096,6 @@ var ts; error(node, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); } } - function isSyntacticallyValidGenerator(node) { - if (!node.asteriskToken || !node.body) { - return false; - } - return node.kind === 149 || - node.kind === 225 || - node.kind === 184; - } function getTypePredicateParameterIndex(parameterList, parameter) { if (parameterList) { for (var i = 0; i < parameterList.length; i++) { @@ -31270,9 +34135,9 @@ var ts; else if (parameterName) { var hasReportedError = false; for (var _i = 0, _a = parent.parameters; _i < _a.length; _i++) { - var name_21 = _a[_i].name; - if (ts.isBindingPattern(name_21) && - checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_21, parameterName, typePredicate.parameterName)) { + var name = _a[_i].name; + if (ts.isBindingPattern(name) && + checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, parameterName, typePredicate.parameterName)) { hasReportedError = true; break; } @@ -31285,16 +34150,16 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { + case 186: + case 154: + case 227: case 185: - case 153: - case 225: - case 184: - case 158: + case 159: + case 150: case 149: - case 148: - var parent_9 = node.parent; - if (node === parent_9.type) { - return parent_9; + var parent = node.parent; + if (node === parent.type) { + return parent; } } } @@ -31304,29 +34169,44 @@ var ts; if (ts.isOmittedExpression(element)) { continue; } - var name_22 = element.name; - if (name_22.kind === 70 && - name_22.text === predicateVariableName) { + var name = element.name; + if (name.kind === 70 && + name.text === predicateVariableName) { error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name_22.kind === 173 || - name_22.kind === 172) { - if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_22, predicateVariableNode, predicateVariableName)) { + else if (name.kind === 174 || + name.kind === 173) { + if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } } } } function checkSignatureDeclaration(node) { - if (node.kind === 155) { + if (node.kind === 156) { checkGrammarIndexSignature(node); } - else if (node.kind === 158 || node.kind === 225 || node.kind === 159 || - node.kind === 153 || node.kind === 150 || - node.kind === 154) { + else if (node.kind === 159 || node.kind === 227 || node.kind === 160 || + node.kind === 154 || node.kind === 151 || + node.kind === 155) { checkGrammarFunctionLikeDeclaration(node); } + var functionFlags = ts.getFunctionFlags(node); + if ((functionFlags & 7) === 2 && languageVersion < 4) { + checkExternalEmitHelpers(node, 64); + if (languageVersion < 2) { + checkExternalEmitHelpers(node, 128); + } + } + if ((functionFlags & 5) === 1) { + if (functionFlags & 2 && languageVersion < 4) { + checkExternalEmitHelpers(node, 2048); + } + else if (languageVersion < 2) { + checkExternalEmitHelpers(node, 128); + } + } checkTypeParameters(node.typeParameters); ts.forEach(node.parameters, checkParameter); if (node.type) { @@ -31334,29 +34214,32 @@ var ts; } if (produceDiagnostics) { checkCollisionWithArgumentsInGeneratedCode(node); - if (compilerOptions.noImplicitAny && !node.type) { + if (noImplicitAny && !node.type) { switch (node.kind) { - case 154: + case 155: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 153: + case 154: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } } if (node.type) { - if (languageVersion >= 2 && isSyntacticallyValidGenerator(node)) { + var functionFlags_1 = ts.getFunctionFlags(node); + if ((functionFlags_1 & 5) === 1) { var returnType = getTypeFromTypeNode(node.type); if (returnType === voidType) { error(node.type, ts.Diagnostics.A_generator_cannot_have_a_void_type_annotation); } else { - var generatorElementType = getElementTypeOfIterableIterator(returnType) || anyType; - var iterableIteratorInstantiation = createIterableIteratorType(generatorElementType); + var generatorElementType = getIteratedTypeOfGenerator(returnType, (functionFlags_1 & 2) !== 0) || anyType; + var iterableIteratorInstantiation = functionFlags_1 & 2 + ? createAsyncIterableIteratorType(generatorElementType) + : createIterableIteratorType(generatorElementType); checkTypeAssignableTo(iterableIteratorInstantiation, returnType, node.type); } } - else if (ts.isAsyncFunctionLike(node)) { + else if ((functionFlags_1 & 3) === 2) { checkAsyncFunctionReturnType(node); } } @@ -31370,7 +34253,7 @@ var ts; var staticNames = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 150) { + if (member.kind === 151) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param)) { @@ -31379,36 +34262,65 @@ var ts; } } else { - var isStatic = ts.forEach(member.modifiers, function (m) { return m.kind === 114; }); + var isStatic = ts.getModifierFlags(member) & 32; var names = isStatic ? staticNames : instanceNames; var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name); if (memberName) { switch (member.kind) { - case 151: + case 152: addName(names, member.name, memberName, 1); break; - case 152: + case 153: addName(names, member.name, memberName, 2); break; - case 147: + case 148: addName(names, member.name, memberName, 3); break; + case 150: + addName(names, member.name, memberName, 4); + break; } } } } function addName(names, location, name, meaning) { - var prev = names[name]; + var prev = names.get(name); if (prev) { - if (prev & meaning) { + if (prev & 4) { + if (meaning !== 4) { + error(location, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(location)); + } + } + else if (prev & meaning) { error(location, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(location)); } else { - names[name] = prev | meaning; + names.set(name, prev | meaning); } } else { - names[name] = meaning; + names.set(name, meaning); + } + } + } + function checkClassForStaticPropertyNameConflicts(node) { + for (var _i = 0, _a = node.members; _i < _a.length; _i++) { + var member = _a[_i]; + var memberNameNode = member.name; + var isStatic = ts.getModifierFlags(member) & 32; + if (isStatic && memberNameNode) { + var memberName = ts.getPropertyNameForPropertyNameNode(memberNameNode); + switch (memberName) { + case "name": + case "length": + case "caller": + case "arguments": + case "prototype": + var message = ts.Diagnostics.Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1; + var className = getNameOfSymbol(getSymbolOfNode(node)); + error(memberNameNode, message, memberName, className); + break; + } } } } @@ -31416,7 +34328,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind == 146) { + if (member.kind === 147) { var memberName = void 0; switch (member.name.kind) { case 9: @@ -31427,18 +34339,18 @@ var ts; default: continue; } - if (names[memberName]) { + if (names.get(memberName)) { error(member.symbol.valueDeclaration.name, ts.Diagnostics.Duplicate_identifier_0, memberName); error(member.name, ts.Diagnostics.Duplicate_identifier_0, memberName); } else { - names[memberName] = true; + names.set(memberName, true); } } } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 227) { + if (node.kind === 229) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -31453,7 +34365,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 134: + case 135: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -31520,12 +34432,12 @@ var ts; if (n.kind === 98) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 184 && n.kind !== 225) { + else if (n.kind !== 185 && n.kind !== 227) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 147 && + return n.kind === 148 && !(ts.getModifierFlags(n) & 32) && !!n.initializer; } @@ -31545,7 +34457,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_3 = statements; _i < statements_3.length; _i++) { var statement = statements_3[_i]; - if (statement.kind === 207 && ts.isSuperCall(statement.expression)) { + if (statement.kind === 209 && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -31568,18 +34480,18 @@ var ts; checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 151) { + if (node.kind === 152) { if (!ts.isInAmbientContext(node) && ts.nodeIsPresent(node.body) && (node.flags & 128)) { if (!(node.flags & 256)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); } } } - if (node.name.kind === 142) { + if (node.name.kind === 143) { checkComputedPropertyName(node.name); } if (!ts.hasDynamicName(node)) { - var otherKind = node.kind === 151 ? 152 : 151; + var otherKind = node.kind === 152 ? 153 : 152; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { if ((ts.getModifierFlags(node) & 28) !== (ts.getModifierFlags(otherAccessor) & 28)) { @@ -31593,17 +34505,12 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 151) { + if (node.kind === 152) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } - if (node.parent.kind !== 176) { - checkSourceElement(node.body); - registerForUnusedIdentifiersCheck(node); - } - else { - checkNodeDeferred(node); - } + checkSourceElement(node.body); + registerForUnusedIdentifiersCheck(node); } function checkAccessorDeclarationTypesIdentical(first, second, getAnnotatedType, message) { var firstType = getAnnotatedType(first); @@ -31612,14 +34519,11 @@ var ts; error(first, message); } } - function checkAccessorDeferred(node) { - checkSourceElement(node.body); - registerForUnusedIdentifiersCheck(node); - } function checkMissingDeclaration(node) { checkDecorators(node); } function checkTypeArgumentConstraints(typeParameters, typeArgumentNodes) { + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); var typeArguments; var mapper; var result = true; @@ -31627,7 +34531,7 @@ var ts; var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { if (!typeArguments) { - typeArguments = ts.map(typeArgumentNodes, getTypeFromTypeNode); + typeArguments = fillMissingTypeArguments(ts.map(typeArgumentNodes, getTypeFromTypeNode), typeParameters, minTypeArgumentCount); mapper = createTypeMapper(typeParameters, typeArguments); } var typeArgument = typeArguments[i]; @@ -31678,25 +34582,42 @@ var ts; function checkUnionOrIntersectionType(node) { ts.forEach(node.types, checkSourceElement); } + function checkIndexedAccessIndexType(type, accessNode) { + if (!(type.flags & 524288)) { + return type; + } + var objectType = type.objectType; + var indexType = type.indexType; + if (isTypeAssignableTo(indexType, getIndexType(objectType))) { + return type; + } + if (maybeTypeOfKind(objectType, 540672) && isTypeOfKind(indexType, 340)) { + var constraint = getBaseConstraintOfType(objectType); + if (constraint && getIndexInfoOfType(constraint, 1)) { + return type; + } + } + error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); + return type; + } function checkIndexedAccessType(node) { - getTypeFromIndexedAccessTypeNode(node); + checkIndexedAccessIndexType(getTypeFromIndexedAccessTypeNode(node), node); } function checkMappedType(node) { checkSourceElement(node.typeParameter); checkSourceElement(node.type); var type = getTypeFromMappedTypeNode(node); var constraintType = getConstraintTypeFromMappedType(type); - var keyType = constraintType.flags & 16384 ? getApparentTypeOfTypeParameter(constraintType) : constraintType; - checkTypeAssignableTo(keyType, stringType, node.typeParameter.constraint); + checkTypeAssignableTo(constraintType, stringType, node.typeParameter.constraint); } function isPrivateWithinAmbient(node) { return (ts.getModifierFlags(node) & 8) && ts.isInAmbientContext(node); } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedModifierFlags(n); - if (n.parent.kind !== 227 && - n.parent.kind !== 226 && - n.parent.kind !== 197 && + if (n.parent.kind !== 229 && + n.parent.kind !== 228 && + n.parent.kind !== 198 && ts.isInAmbientContext(n)) { if (!(flags & 2)) { flags |= 1; @@ -31773,7 +34694,7 @@ var ts; if (subsequentNode.kind === node.kind) { var errorNode_1 = subsequentNode.name || subsequentNode; if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - var reportError = (node.kind === 149 || node.kind === 148) && + var reportError = (node.kind === 150 || node.kind === 149) && (ts.getModifierFlags(node) & 32) !== (ts.getModifierFlags(subsequentNode) & 32); if (reportError) { var diagnostic = ts.getModifierFlags(node) & 32 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; @@ -31802,15 +34723,15 @@ var ts; } var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; - for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { - var current = declarations_4[_i]; + for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { + var current = declarations_5[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 227 || node.parent.kind === 161 || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 229 || node.parent.kind === 162 || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 225 || node.kind === 149 || node.kind === 148 || node.kind === 150) { + if (node.kind === 227 || node.kind === 150 || node.kind === 149 || node.kind === 151) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -31861,8 +34782,8 @@ var ts; if (bodyDeclaration) { var signatures = getSignaturesOfSymbol(symbol); var bodySignature = getSignatureFromDeclaration(bodyDeclaration); - for (var _a = 0, signatures_3 = signatures; _a < signatures_3.length; _a++) { - var signature = signatures_3[_a]; + for (var _a = 0, signatures_4 = signatures; _a < signatures_4.length; _a++) { + var signature = signatures_4[_a]; if (!isImplementationCompatibleWithOverload(bodySignature, signature)) { error(signature.declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); break; @@ -31921,16 +34842,16 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 227: + case 229: return 2097152; - case 230: + case 232: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 ? 4194304 | 1048576 : 4194304; - case 226: - case 229: + case 228: + case 231: return 2097152 | 1048576; - case 234: + case 236: var result_3 = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_3 |= getDeclarationSpaces(d); }); @@ -31940,87 +34861,92 @@ var ts; } } } - function checkNonThenableType(type, location, message) { - type = getWidenedType(type); - if (!isTypeAny(type) && !isTypeNever(type) && isTypeAssignableTo(type, getGlobalThenableType())) { - if (location) { - if (!message) { - message = ts.Diagnostics.Operand_for_await_does_not_have_a_valid_callable_then_member; - } - error(location, message); - } - return unknownType; - } - return type; + function getAwaitedTypeOfPromise(type, errorNode, diagnosticMessage) { + var promisedType = getPromisedTypeOfPromise(type, errorNode); + return promisedType && getAwaitedType(promisedType, errorNode, diagnosticMessage); } - function getPromisedType(promise) { + function getPromisedTypeOfPromise(promise, errorNode) { if (isTypeAny(promise)) { return undefined; } - if (getObjectFlags(promise) & 4) { - if (promise.target === tryGetGlobalPromiseType() - || promise.target === getGlobalPromiseLikeType()) { - return promise.typeArguments[0]; - } + var typeAsPromise = promise; + if (typeAsPromise.promisedTypeOfPromise) { + return typeAsPromise.promisedTypeOfPromise; } - var globalPromiseLikeType = getInstantiatedGlobalPromiseLikeType(); - if (globalPromiseLikeType === emptyObjectType || !isTypeAssignableTo(promise, globalPromiseLikeType)) { - return undefined; + if (isReferenceToType(promise, getGlobalPromiseType(false))) { + return typeAsPromise.promisedTypeOfPromise = promise.typeArguments[0]; } var thenFunction = getTypeOfPropertyOfType(promise, "then"); - if (!thenFunction || isTypeAny(thenFunction)) { + if (isTypeAny(thenFunction)) { return undefined; } - var thenSignatures = getSignaturesOfType(thenFunction, 0); + var thenSignatures = thenFunction ? getSignaturesOfType(thenFunction, 0) : emptyArray; if (thenSignatures.length === 0) { + if (errorNode) { + error(errorNode, ts.Diagnostics.A_promise_must_have_a_then_method); + } return undefined; } - var onfulfilledParameterType = getTypeWithFacts(getUnionType(ts.map(thenSignatures, getTypeOfFirstParameterOfSignature)), 131072); + var onfulfilledParameterType = getTypeWithFacts(getUnionType(ts.map(thenSignatures, getTypeOfFirstParameterOfSignature)), 524288); if (isTypeAny(onfulfilledParameterType)) { return undefined; } var onfulfilledParameterSignatures = getSignaturesOfType(onfulfilledParameterType, 0); if (onfulfilledParameterSignatures.length === 0) { + if (errorNode) { + error(errorNode, ts.Diagnostics.The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback); + } return undefined; } - return getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), true); + return typeAsPromise.promisedTypeOfPromise = getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), true); } - function getTypeOfFirstParameterOfSignature(signature) { - return signature.parameters.length > 0 ? getTypeAtPosition(signature, 0) : neverType; + function checkAwaitedType(type, errorNode, diagnosticMessage) { + return getAwaitedType(type, errorNode, diagnosticMessage) || unknownType; } - function getAwaitedType(type) { - return checkAwaitedType(type, undefined, undefined); - } - function checkAwaitedType(type, location, message) { - return checkAwaitedTypeWorker(type); - function checkAwaitedTypeWorker(type) { - if (type.flags & 65536) { - var types = []; - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var constituentType = _a[_i]; - types.push(checkAwaitedTypeWorker(constituentType)); - } - return getUnionType(types, true); - } - else { - var promisedType = getPromisedType(type); - if (promisedType === undefined) { - return checkNonThenableType(type, location, message); - } - else { - if (type.id === promisedType.id || ts.indexOf(awaitedTypeStack, promisedType.id) >= 0) { - if (location) { - error(location, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method, symbolToString(type.symbol)); - } - return unknownType; - } - awaitedTypeStack.push(type.id); - var awaitedType = checkAwaitedTypeWorker(promisedType); - awaitedTypeStack.pop(); - return awaitedType; - } - } + function getAwaitedType(type, errorNode, diagnosticMessage) { + var typeAsAwaitable = type; + if (typeAsAwaitable.awaitedTypeOfType) { + return typeAsAwaitable.awaitedTypeOfType; } + if (isTypeAny(type)) { + return typeAsAwaitable.awaitedTypeOfType = type; + } + if (type.flags & 65536) { + var types = void 0; + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var constituentType = _a[_i]; + types = ts.append(types, getAwaitedType(constituentType, errorNode, diagnosticMessage)); + } + if (!types) { + return undefined; + } + return typeAsAwaitable.awaitedTypeOfType = getUnionType(types, true); + } + var promisedType = getPromisedTypeOfPromise(type); + if (promisedType) { + if (type.id === promisedType.id || ts.indexOf(awaitedTypeStack, promisedType.id) >= 0) { + if (errorNode) { + error(errorNode, ts.Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method); + } + return undefined; + } + awaitedTypeStack.push(type.id); + var awaitedType = getAwaitedType(promisedType, errorNode, diagnosticMessage); + awaitedTypeStack.pop(); + if (!awaitedType) { + return undefined; + } + return typeAsAwaitable.awaitedTypeOfType = awaitedType; + } + var thenFunction = getTypeOfPropertyOfType(type, "then"); + if (thenFunction && getSignaturesOfType(thenFunction, 0).length > 0) { + if (errorNode) { + ts.Debug.assert(!!diagnosticMessage); + error(errorNode, diagnosticMessage); + } + return undefined; + } + return typeAsAwaitable.awaitedTypeOfType = type; } function checkAsyncFunctionReturnType(node) { var returnType = getTypeFromTypeNode(node.type); @@ -32028,8 +34954,8 @@ var ts; if (returnType === unknownType) { return unknownType; } - var globalPromiseType = getGlobalPromiseType(); - if (globalPromiseType !== emptyGenericType && globalPromiseType !== getTargetType(returnType)) { + var globalPromiseType = getGlobalPromiseType(true); + if (globalPromiseType !== emptyGenericType && !isReferenceToType(returnType, globalPromiseType)) { error(node.type, ts.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type); return unknownType; } @@ -32047,10 +34973,15 @@ var ts; var promiseConstructorSymbol = resolveEntityName(promiseConstructorName, 107455, true); var promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : unknownType; if (promiseConstructorType === unknownType) { - error(node.type, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, ts.entityNameToString(promiseConstructorName)); + if (promiseConstructorName.kind === 70 && promiseConstructorName.text === "Promise" && getTargetType(returnType) === getGlobalPromiseType(false)) { + error(node.type, ts.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option); + } + else { + error(node.type, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, ts.entityNameToString(promiseConstructorName)); + } return unknownType; } - var globalPromiseConstructorLikeType = getGlobalPromiseConstructorLikeType(); + var globalPromiseConstructorLikeType = getGlobalPromiseConstructorLikeType(true); if (globalPromiseConstructorLikeType === emptyObjectType) { error(node.type, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, ts.entityNameToString(promiseConstructorName)); return unknownType; @@ -32065,7 +34996,7 @@ var ts; return unknownType; } } - return checkAwaitedType(returnType, node, ts.Diagnostics.An_async_function_or_method_must_have_a_valid_awaitable_return_type); + return checkAwaitedType(returnType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } function checkDecorator(node) { var signature = getResolvedSignature(node); @@ -32077,22 +35008,22 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 226: + case 228: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 144: + case 145: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 147: + case 148: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 149: - case 151: + case 150: case 152: + case 153: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -32111,6 +35042,9 @@ var ts; markAliasSymbolAsReferenced(rootSymbol); } } + function getParameterTypeNodeForDecoratorCheck(node) { + return node.dotDotDotToken ? ts.getRestParameterElementType(node.type) : node.type; + } function checkDecorators(node) { if (!node.decorators) { return; @@ -32121,28 +35055,36 @@ var ts; if (!compilerOptions.experimentalDecorators) { error(node, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning); } + var firstDecorator = node.decorators[0]; + checkExternalEmitHelpers(firstDecorator, 8); + if (node.kind === 145) { + checkExternalEmitHelpers(firstDecorator, 32); + } if (compilerOptions.emitDecoratorMetadata) { + checkExternalEmitHelpers(firstDecorator, 16); switch (node.kind) { - case 226: + case 228: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { var parameter = _a[_i]; - markTypeNodeAsReferenced(parameter.type); + markTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } } break; - case 149: - case 151: + case 150: case 152: + case 153: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; - markTypeNodeAsReferenced(parameter.type); + markTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markTypeNodeAsReferenced(node.type); break; - case 147: - case 144: + case 148: + markTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); + break; + case 145: markTypeNodeAsReferenced(node.type); break; } @@ -32154,6 +35096,7 @@ var ts; checkFunctionOrMethodDeclaration(node) || checkGrammarForGenerator(node); checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); } @@ -32161,8 +35104,8 @@ var ts; function checkFunctionOrMethodDeclaration(node) { checkDecorators(node); checkSignatureDeclaration(node); - var isAsync = ts.isAsyncFunctionLike(node); - if (node.name && node.name.kind === 142) { + var functionFlags = ts.getFunctionFlags(node); + if (node.name && node.name.kind === 143) { checkComputedPropertyName(node.name); } if (!ts.hasDynamicName(node)) { @@ -32180,15 +35123,17 @@ var ts; } } checkSourceElement(node.body); - if (!node.asteriskToken) { - var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); + if ((functionFlags & 1) === 0) { + var returnOrPromisedType = node.type && (functionFlags & 2 + ? checkAsyncFunctionReturnType(node) + : getTypeFromTypeNode(node.type)); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } if (produceDiagnostics && !node.type) { - if (compilerOptions.noImplicitAny && ts.nodeIsMissing(node.body) && !isPrivateWithinAmbient(node)) { + if (noImplicitAny && ts.nodeIsMissing(node.body) && !isPrivateWithinAmbient(node)) { reportImplicitAnyError(node, anyType); } - if (node.asteriskToken && ts.nodeIsPresent(node.body)) { + if (functionFlags & 1 && ts.nodeIsPresent(node.body)) { getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } } @@ -32204,56 +35149,54 @@ var ts; for (var _i = 0, deferredUnusedIdentifierNodes_1 = deferredUnusedIdentifierNodes; _i < deferredUnusedIdentifierNodes_1.length; _i++) { var node = deferredUnusedIdentifierNodes_1[_i]; switch (node.kind) { - case 261: - case 230: + case 264: + case 232: checkUnusedModuleMembers(node); break; - case 226: - case 197: + case 228: + case 198: checkUnusedClassMembers(node); checkUnusedTypeParameters(node); break; - case 227: + case 229: checkUnusedTypeParameters(node); break; - case 204: - case 232: - case 211: - case 212: + case 206: + case 234: case 213: + case 214: + case 215: checkUnusedLocalsAndParameters(node); break; - case 150: - case 184: - case 225: - case 185: - case 149: case 151: + case 185: + case 227: + case 186: + case 150: case 152: + case 153: if (node.body) { checkUnusedLocalsAndParameters(node); } checkUnusedTypeParameters(node); break; - case 148: - case 153: + case 149: case 154: case 155: - case 158: + case 156: case 159: + case 160: checkUnusedTypeParameters(node); break; } - ; } } } function checkUnusedLocalsAndParameters(node) { - if (node.parent.kind !== 227 && noUnusedIdentifiers && !ts.isInAmbientContext(node)) { - var _loop_3 = function (key) { - var local = node.locals[key]; + if (node.parent.kind !== 229 && noUnusedIdentifiers && !ts.isInAmbientContext(node)) { + node.locals.forEach(function (local) { if (!local.isReferenced) { - if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 144) { + if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 145) { var parameter = ts.getRootDeclaration(local.valueDeclaration); if (compilerOptions.noUnusedParameters && !ts.isParameterPropertyDeclaration(parameter) && @@ -32266,22 +35209,28 @@ var ts; ts.forEach(local.declarations, function (d) { return errorUnusedLocal(d.name || d, local.name); }); } } - }; - for (var key in node.locals) { - _loop_3(key); - } + }); } } + function isRemovedPropertyFromObjectSpread(node) { + if (ts.isBindingElement(node) && ts.isObjectBindingPattern(node.parent)) { + var lastElement = ts.lastOrUndefined(node.parent.elements); + return lastElement !== node && !!lastElement.dotDotDotToken; + } + return false; + } function errorUnusedLocal(node, name) { if (isIdentifierThatStartsWithUnderScore(node)) { var declaration = ts.getRootDeclaration(node.parent); - if (declaration.kind === 223 && - (declaration.parent.parent.kind === 212 || - declaration.parent.parent.kind === 213)) { + if (declaration.kind === 225 && + (declaration.parent.parent.kind === 214 || + declaration.parent.parent.kind === 215)) { return; } } - error(node, ts.Diagnostics._0_is_declared_but_never_used, name); + if (!isRemovedPropertyFromObjectSpread(node.kind === 70 ? node.parent : node)) { + error(node, ts.Diagnostics._0_is_declared_but_never_used, name); + } } function parameterNameStartsWithUnderscore(parameterName) { return parameterName && isIdentifierThatStartsWithUnderScore(parameterName); @@ -32294,12 +35243,12 @@ var ts; if (node.members) { for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 149 || member.kind === 147) { + if (member.kind === 150 || member.kind === 148) { if (!member.symbol.isReferenced && ts.getModifierFlags(member) & 8) { error(member.name, ts.Diagnostics._0_is_declared_but_never_used, member.symbol.name); } } - else if (member.kind === 150) { + else if (member.kind === 151) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.getModifierFlags(parameter) & 8) { @@ -32330,21 +35279,20 @@ var ts; } function checkUnusedModuleMembers(node) { if (compilerOptions.noUnusedLocals && !ts.isInAmbientContext(node)) { - for (var key in node.locals) { - var local = node.locals[key]; + node.locals.forEach(function (local) { if (!local.isReferenced && !local.exportSymbol) { for (var _i = 0, _a = local.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; if (!ts.isAmbientModule(declaration)) { - error(declaration.name, ts.Diagnostics._0_is_declared_but_never_used, local.name); + errorUnusedLocal(declaration.name, local.name); } } } - } + }); } } function checkBlock(node) { - if (node.kind === 204) { + if (node.kind === 206) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); @@ -32366,19 +35314,19 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 147 || - node.kind === 146 || + if (node.kind === 148 || + node.kind === 147 || + node.kind === 150 || node.kind === 149 || - node.kind === 148 || - node.kind === 151 || - node.kind === 152) { + node.kind === 152 || + node.kind === 153) { return false; } if (ts.isInAmbientContext(node)) { return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 144 && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 145 && ts.nodeIsMissing(root.parent.body)) { return false; } return true; @@ -32388,9 +35336,13 @@ var ts; potentialThisCollisions.push(node); } } + function checkCollisionWithCapturedNewTargetVariable(node, name) { + if (needCollisionCheckForIdentifier(node, name, "_newTarget")) { + potentialNewTargetCollisions.push(node); + } + } function checkIfThisIsCapturedInEnclosingScope(node) { - var current = node; - while (current) { + ts.findAncestor(node, function (current) { if (getNodeCheckFlags(current) & 4) { var isDeclaration_1 = node.kind !== 70; if (isDeclaration_1) { @@ -32399,10 +35351,23 @@ var ts; else { error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference); } - return; + return true; } - current = current.parent; - } + }); + } + function checkIfNewTargetIsCapturedInEnclosingScope(node) { + ts.findAncestor(node, function (current) { + if (getNodeCheckFlags(current) & 8) { + var isDeclaration_2 = node.kind !== 70; + if (isDeclaration_2) { + error(node.name, ts.Diagnostics.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference); + } + else { + error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference); + } + return true; + } + }); } function checkCollisionWithCapturedSuperVariable(node, name) { if (!needCollisionCheckForIdentifier(node, name, "_super")) { @@ -32413,8 +35378,8 @@ var ts; return; } if (ts.getClassExtendsHeritageClauseElement(enclosingClass)) { - var isDeclaration_2 = node.kind !== 70; - if (isDeclaration_2) { + var isDeclaration_3 = node.kind !== 70; + if (isDeclaration_3) { error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); } else { @@ -32429,23 +35394,23 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } - if (node.kind === 230 && ts.getModuleInstanceState(node) !== 1) { + if (node.kind === 232 && ts.getModuleInstanceState(node) !== 1) { return; } var parent = getDeclarationContainer(node); - if (parent.kind === 261 && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 264 && ts.isExternalOrCommonJsModule(parent)) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } function checkCollisionWithGlobalPromiseInGeneratedCode(node, name) { - if (!needCollisionCheckForIdentifier(node, name, "Promise")) { + if (languageVersion >= 4 || !needCollisionCheckForIdentifier(node, name, "Promise")) { return; } - if (node.kind === 230 && ts.getModuleInstanceState(node) !== 1) { + if (node.kind === 232 && ts.getModuleInstanceState(node) !== 1) { return; } var parent = getDeclarationContainer(node); - if (parent.kind === 261 && ts.isExternalOrCommonJsModule(parent) && parent.flags & 8192) { + if (parent.kind === 264 && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -32453,7 +35418,7 @@ var ts; if ((ts.getCombinedNodeFlags(node) & 3) !== 0 || ts.isParameterDeclaration(node)) { return; } - if (node.kind === 223 && !node.initializer) { + if (node.kind === 225 && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -32463,25 +35428,25 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 224); - var container = varDeclList.parent.kind === 205 && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 226); + var container = varDeclList.parent.kind === 207 && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; var namesShareScope = container && - (container.kind === 204 && ts.isFunctionLike(container.parent) || - container.kind === 231 || - container.kind === 230 || - container.kind === 261); + (container.kind === 206 && ts.isFunctionLike(container.parent) || + container.kind === 233 || + container.kind === 232 || + container.kind === 264); if (!namesShareScope) { - var name_23 = symbolToString(localDeclarationSymbol); - error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_23, name_23); + var name = symbolToString(localDeclarationSymbol); + error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name); } } } } } function checkParameterInitializer(node) { - if (ts.getRootDeclaration(node).kind !== 144) { + if (ts.getRootDeclaration(node).kind !== 145) { return; } var func = ts.getContainingFunction(node); @@ -32490,7 +35455,7 @@ var ts; if (ts.isTypeNode(n) || ts.isDeclarationName(n)) { return; } - if (n.kind === 177) { + if (n.kind === 178) { return visit(n.expression); } else if (n.kind === 70) { @@ -32504,21 +35469,21 @@ var ts; } var enclosingContainer = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); if (enclosingContainer === func) { - if (symbol.valueDeclaration.kind === 144) { + if (symbol.valueDeclaration.kind === 145 || + symbol.valueDeclaration.kind === 175) { if (symbol.valueDeclaration.pos < node.pos) { return; } - var current = n; - while (current !== node.initializer) { - if (ts.isFunctionLike(current.parent)) { - return; + if (ts.findAncestor(n, function (current) { + if (current === node.initializer) { + return "quit"; } - if (current.parent.kind === 147 && - !(ts.hasModifier(current.parent, 32)) && - ts.isClassLike(current.parent.parent)) { - return; - } - current = current.parent; + return ts.isFunctionLike(current.parent) || + (current.parent.kind === 148 && + !(ts.hasModifier(current.parent, 32)) && + ts.isClassLike(current.parent.parent)); + })) { + return; } } error(n, ts.Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, ts.declarationNameToString(node.name), ts.declarationNameToString(n)); @@ -32535,34 +35500,40 @@ var ts; function checkVariableLikeDeclaration(node) { checkDecorators(node); checkSourceElement(node.type); - if (node.name.kind === 142) { + if (node.name.kind === 143) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 174) { - if (node.propertyName && node.propertyName.kind === 142) { + if (node.kind === 175) { + if (node.parent.kind === 173 && languageVersion < 5) { + checkExternalEmitHelpers(node, 4); + } + if (node.propertyName && node.propertyName.kind === 143) { checkComputedPropertyName(node.propertyName); } - var parent_10 = node.parent.parent; - var parentType = getTypeForBindingElementParent(parent_10); - var name_24 = node.propertyName || node.name; - var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name_24)); + var parent = node.parent.parent; + var parentType = getTypeForBindingElementParent(parent); + var name = node.propertyName || node.name; + var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name)); markPropertyAsReferenced(property); - if (parent_10.initializer && property && getParentOfSymbol(property)) { - checkClassPropertyAccess(parent_10, parent_10.initializer, parentType, property); + if (parent.initializer && property) { + checkPropertyAccessibility(parent, parent.initializer, parentType, property); } } if (ts.isBindingPattern(node.name)) { + if (node.name.kind === 174 && languageVersion < 2 && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 512); + } ts.forEach(node.name.elements, checkSourceElement); } - if (node.initializer && ts.getRootDeclaration(node).kind === 144 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 145 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } if (ts.isBindingPattern(node.name)) { - if (node.initializer && node.parent.parent.kind !== 212) { + if (node.initializer && node.parent.parent.kind !== 214) { checkTypeAssignableTo(checkExpressionCached(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, undefined); checkParameterInitializer(node); } @@ -32571,7 +35542,7 @@ var ts; var symbol = getSymbolOfNode(node); var type = convertAutoToAny(getTypeOfVariableOrParameterOrProperty(symbol)); if (node === symbol.valueDeclaration) { - if (node.initializer && node.parent.parent.kind !== 212) { + if (node.initializer && node.parent.parent.kind !== 214) { checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, undefined); checkParameterInitializer(node); } @@ -32589,20 +35560,21 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 147 && node.kind !== 146) { + if (node.kind !== 148 && node.kind !== 147) { checkExportsOnMergedDeclarations(node); - if (node.kind === 223 || node.kind === 174) { + if (node.kind === 225 || node.kind === 175) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 144 && right.kind === 223) || - (left.kind === 223 && right.kind === 144)) { + if ((left.kind === 145 && right.kind === 225) || + (left.kind === 225 && right.kind === 145)) { return true; } if (ts.hasQuestionToken(left) !== ts.hasQuestionToken(right)) { @@ -32629,8 +35601,8 @@ var ts; ts.forEach(node.declarationList.declarations, checkSourceElement); } function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) { - if (node.modifiers && node.parent.kind === 176) { - if (ts.isAsyncFunctionLike(node)) { + if (node.modifiers && node.parent.kind === 177) { + if (ts.getFunctionFlags(node) & 2) { if (node.modifiers.length > 1) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } @@ -32648,7 +35620,7 @@ var ts; checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 206) { + if (node.thenStatement.kind === 208) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -32665,12 +35637,12 @@ var ts; } function checkForStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 224) { + if (node.initializer && node.initializer.kind === 226) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 224) { + if (node.initializer.kind === 226) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -32688,13 +35660,23 @@ var ts; } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 224) { + if (node.kind === 215) { + if (node.awaitModifier) { + if (languageVersion < 4) { + checkExternalEmitHelpers(node, 8192); + } + } + else if (languageVersion < 2 && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 256); + } + } + if (node.initializer.kind === 226) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; - var iteratedType = checkRightHandSideOfForOf(node.expression); - if (varExpr.kind === 175 || varExpr.kind === 176) { + var iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier); + if (varExpr.kind === 176 || varExpr.kind === 177) { checkDestructuringAssignment(varExpr, iteratedType || unknownType); } else { @@ -32713,7 +35695,7 @@ var ts; function checkForInStatement(node) { checkGrammarForInOrForOfStatement(node); var rightType = checkNonNullExpression(node.expression); - if (node.initializer.kind === 224) { + if (node.initializer.kind === 226) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -32723,7 +35705,7 @@ var ts; else { var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 175 || varExpr.kind === 176) { + if (varExpr.kind === 176 || varExpr.kind === 177) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -32733,7 +35715,7 @@ var ts; checkReferenceExpression(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access); } } - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 | 16384 | 524288)) { + if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 | 540672 | 16777216)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } checkSourceElement(node.statement); @@ -32748,146 +35730,67 @@ var ts; checkVariableDeclaration(decl); } } - function checkRightHandSideOfForOf(rhsExpression) { + function checkRightHandSideOfForOf(rhsExpression, awaitModifier) { var expressionType = checkNonNullExpression(rhsExpression); - return checkIteratedTypeOrElementType(expressionType, rhsExpression, true); + return checkIteratedTypeOrElementType(expressionType, rhsExpression, true, awaitModifier !== undefined); } - function checkIteratedTypeOrElementType(inputType, errorNode, allowStringInput) { + function checkIteratedTypeOrElementType(inputType, errorNode, allowStringInput, allowAsyncIterable) { if (isTypeAny(inputType)) { return inputType; } - if (languageVersion >= 2) { - return checkElementTypeOfIterable(inputType, errorNode); - } - if (allowStringInput) { - return checkElementTypeOfArrayOrString(inputType, errorNode); - } - if (isArrayLikeType(inputType)) { - var indexType = getIndexTypeOfType(inputType, 1); - if (indexType) { - return indexType; - } - } - if (errorNode) { - error(errorNode, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(inputType)); - } - return unknownType; + return getIteratedTypeOrElementType(inputType, errorNode, allowStringInput, allowAsyncIterable, true) || anyType; } - function checkElementTypeOfIterable(iterable, errorNode) { - var elementType = getElementTypeOfIterable(iterable, errorNode); - if (errorNode && elementType) { - checkTypeAssignableTo(iterable, createIterableType(elementType), errorNode); - } - return elementType || anyType; - } - function getElementTypeOfIterable(type, errorNode) { - if (isTypeAny(type)) { - return undefined; - } - var typeAsIterable = type; - if (!typeAsIterable.iterableElementType) { - if ((getObjectFlags(type) & 4) && type.target === getGlobalIterableType()) { - typeAsIterable.iterableElementType = type.typeArguments[0]; - } - else { - var iteratorFunction = getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("iterator")); - if (isTypeAny(iteratorFunction)) { - return undefined; - } - var iteratorFunctionSignatures = iteratorFunction ? getSignaturesOfType(iteratorFunction, 0) : emptyArray; - if (iteratorFunctionSignatures.length === 0) { - if (errorNode) { - error(errorNode, ts.Diagnostics.Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator); - } - return undefined; - } - typeAsIterable.iterableElementType = getElementTypeOfIterator(getUnionType(ts.map(iteratorFunctionSignatures, getReturnTypeOfSignature), true), errorNode); + function getIteratedTypeOrElementType(inputType, errorNode, allowStringInput, allowAsyncIterable, checkAssignability) { + var uplevelIteration = languageVersion >= 2; + var downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration; + if (uplevelIteration || downlevelIteration || allowAsyncIterable) { + var iteratedType = getIteratedTypeOfIterable(inputType, uplevelIteration ? errorNode : undefined, allowAsyncIterable, allowAsyncIterable, checkAssignability); + if (iteratedType || uplevelIteration) { + return iteratedType; } } - return typeAsIterable.iterableElementType; - } - function getElementTypeOfIterator(type, errorNode) { - if (isTypeAny(type)) { - return undefined; - } - var typeAsIterator = type; - if (!typeAsIterator.iteratorElementType) { - if ((getObjectFlags(type) & 4) && type.target === getGlobalIteratorType()) { - typeAsIterator.iteratorElementType = type.typeArguments[0]; - } - else { - var iteratorNextFunction = getTypeOfPropertyOfType(type, "next"); - if (isTypeAny(iteratorNextFunction)) { - return undefined; - } - var iteratorNextFunctionSignatures = iteratorNextFunction ? getSignaturesOfType(iteratorNextFunction, 0) : emptyArray; - if (iteratorNextFunctionSignatures.length === 0) { - if (errorNode) { - error(errorNode, ts.Diagnostics.An_iterator_must_have_a_next_method); - } - return undefined; - } - var iteratorNextResult = getUnionType(ts.map(iteratorNextFunctionSignatures, getReturnTypeOfSignature), true); - if (isTypeAny(iteratorNextResult)) { - return undefined; - } - var iteratorNextValue = getTypeOfPropertyOfType(iteratorNextResult, "value"); - if (!iteratorNextValue) { - if (errorNode) { - error(errorNode, ts.Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); - } - return undefined; - } - typeAsIterator.iteratorElementType = iteratorNextValue; - } - } - return typeAsIterator.iteratorElementType; - } - function getElementTypeOfIterableIterator(type) { - if (isTypeAny(type)) { - return undefined; - } - if ((getObjectFlags(type) & 4) && type.target === getGlobalIterableIteratorType()) { - return type.typeArguments[0]; - } - return getElementTypeOfIterable(type, undefined) || - getElementTypeOfIterator(type, undefined); - } - function checkElementTypeOfArrayOrString(arrayOrStringType, errorNode) { - ts.Debug.assert(languageVersion < 2); - var arrayType = arrayOrStringType; - if (arrayOrStringType.flags & 65536) { - var arrayTypes = arrayOrStringType.types; - var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 262178); }); - if (filteredTypes !== arrayTypes) { - arrayType = getUnionType(filteredTypes, true); - } - } - else if (arrayOrStringType.flags & 262178) { - arrayType = neverType; - } - var hasStringConstituent = arrayOrStringType !== arrayType; + var arrayType = inputType; var reportedError = false; - if (hasStringConstituent) { - if (languageVersion < 1) { - error(errorNode, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); - reportedError = true; + var hasStringConstituent = false; + if (allowStringInput) { + if (arrayType.flags & 65536) { + var arrayTypes = inputType.types; + var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 262178); }); + if (filteredTypes !== arrayTypes) { + arrayType = getUnionType(filteredTypes, true); + } } - if (arrayType.flags & 8192) { - return stringType; + else if (arrayType.flags & 262178) { + arrayType = neverType; + } + hasStringConstituent = arrayType !== inputType; + if (hasStringConstituent) { + if (languageVersion < 1) { + if (errorNode) { + error(errorNode, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); + reportedError = true; + } + } + if (arrayType.flags & 8192) { + return stringType; + } } } if (!isArrayLikeType(arrayType)) { - if (!reportedError) { - var diagnostic = hasStringConstituent - ? ts.Diagnostics.Type_0_is_not_an_array_type - : ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type; + if (errorNode && !reportedError) { + var diagnostic = !allowStringInput || hasStringConstituent + ? downlevelIteration + ? ts.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator + : ts.Diagnostics.Type_0_is_not_an_array_type + : downlevelIteration + ? ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator + : ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type; error(errorNode, diagnostic, typeToString(arrayType)); } - return hasStringConstituent ? stringType : unknownType; + return hasStringConstituent ? stringType : undefined; } - var arrayElementType = getIndexTypeOfType(arrayType, 1) || unknownType; - if (hasStringConstituent) { + var arrayElementType = getIndexTypeOfType(arrayType, 1); + if (hasStringConstituent && arrayElementType) { if (arrayElementType.flags & 262178) { return stringType; } @@ -32895,14 +35798,131 @@ var ts; } return arrayElementType; } + function getIteratedTypeOfIterable(type, errorNode, isAsyncIterable, allowNonAsyncIterables, checkAssignability) { + if (isTypeAny(type)) { + return undefined; + } + var typeAsIterable = type; + if (isAsyncIterable ? typeAsIterable.iteratedTypeOfAsyncIterable : typeAsIterable.iteratedTypeOfIterable) { + return isAsyncIterable ? typeAsIterable.iteratedTypeOfAsyncIterable : typeAsIterable.iteratedTypeOfIterable; + } + if (isAsyncIterable) { + if (isReferenceToType(type, getGlobalAsyncIterableType(false)) || + isReferenceToType(type, getGlobalAsyncIterableIteratorType(false))) { + return typeAsIterable.iteratedTypeOfAsyncIterable = type.typeArguments[0]; + } + } + if (!isAsyncIterable || allowNonAsyncIterables) { + if (isReferenceToType(type, getGlobalIterableType(false)) || + isReferenceToType(type, getGlobalIterableIteratorType(false))) { + return isAsyncIterable + ? typeAsIterable.iteratedTypeOfAsyncIterable = type.typeArguments[0] + : typeAsIterable.iteratedTypeOfIterable = type.typeArguments[0]; + } + } + var iteratorMethodSignatures; + var mayBeIterable = false; + if (isAsyncIterable) { + var iteratorMethod = getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("asyncIterator")); + if (isTypeAny(iteratorMethod)) { + return undefined; + } + iteratorMethodSignatures = iteratorMethod && getSignaturesOfType(iteratorMethod, 0); + } + if (!isAsyncIterable || (allowNonAsyncIterables && !ts.some(iteratorMethodSignatures))) { + var iteratorMethod = getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("iterator")); + if (isTypeAny(iteratorMethod)) { + return undefined; + } + iteratorMethodSignatures = iteratorMethod && getSignaturesOfType(iteratorMethod, 0); + mayBeIterable = true; + } + if (ts.some(iteratorMethodSignatures)) { + var iteratorMethodReturnType = getUnionType(ts.map(iteratorMethodSignatures, getReturnTypeOfSignature), true); + var iteratedType = getIteratedTypeOfIterator(iteratorMethodReturnType, errorNode, false); + if (checkAssignability && errorNode && iteratedType) { + checkTypeAssignableTo(type, mayBeIterable + ? createIterableType(iteratedType) + : createAsyncIterableType(iteratedType), errorNode); + } + return isAsyncIterable + ? typeAsIterable.iteratedTypeOfAsyncIterable = iteratedType + : typeAsIterable.iteratedTypeOfIterable = iteratedType; + } + if (errorNode) { + error(errorNode, isAsyncIterable + ? ts.Diagnostics.Type_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator + : ts.Diagnostics.Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator); + } + return undefined; + } + function getIteratedTypeOfIterator(type, errorNode, isAsyncIterator) { + if (isTypeAny(type)) { + return undefined; + } + var typeAsIterator = type; + if (isAsyncIterator ? typeAsIterator.iteratedTypeOfAsyncIterator : typeAsIterator.iteratedTypeOfIterator) { + return isAsyncIterator ? typeAsIterator.iteratedTypeOfAsyncIterator : typeAsIterator.iteratedTypeOfIterator; + } + var getIteratorType = isAsyncIterator ? getGlobalAsyncIteratorType : getGlobalIteratorType; + if (isReferenceToType(type, getIteratorType(false))) { + return isAsyncIterator + ? typeAsIterator.iteratedTypeOfAsyncIterator = type.typeArguments[0] + : typeAsIterator.iteratedTypeOfIterator = type.typeArguments[0]; + } + var nextMethod = getTypeOfPropertyOfType(type, "next"); + if (isTypeAny(nextMethod)) { + return undefined; + } + var nextMethodSignatures = nextMethod ? getSignaturesOfType(nextMethod, 0) : emptyArray; + if (nextMethodSignatures.length === 0) { + if (errorNode) { + error(errorNode, isAsyncIterator + ? ts.Diagnostics.An_async_iterator_must_have_a_next_method + : ts.Diagnostics.An_iterator_must_have_a_next_method); + } + return undefined; + } + var nextResult = getUnionType(ts.map(nextMethodSignatures, getReturnTypeOfSignature), true); + if (isTypeAny(nextResult)) { + return undefined; + } + if (isAsyncIterator) { + nextResult = getAwaitedTypeOfPromise(nextResult, errorNode, ts.Diagnostics.The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property); + if (isTypeAny(nextResult)) { + return undefined; + } + } + var nextValue = nextResult && getTypeOfPropertyOfType(nextResult, "value"); + if (!nextValue) { + if (errorNode) { + error(errorNode, isAsyncIterator + ? ts.Diagnostics.The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property + : ts.Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); + } + return undefined; + } + return isAsyncIterator + ? typeAsIterator.iteratedTypeOfAsyncIterator = nextValue + : typeAsIterator.iteratedTypeOfIterator = nextValue; + } + function getIteratedTypeOfGenerator(returnType, isAsyncGenerator) { + if (isTypeAny(returnType)) { + return undefined; + } + return getIteratedTypeOfIterable(returnType, undefined, isAsyncGenerator, false, false) + || getIteratedTypeOfIterator(returnType, undefined, isAsyncGenerator); + } function checkBreakOrContinueStatement(node) { checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node); } function isGetAccessorWithAnnotatedSetAccessor(node) { - return !!(node.kind === 151 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 152))); + return !!(node.kind === 152 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 153))); } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { - var unwrappedReturnType = ts.isAsyncFunctionLike(func) ? getPromisedType(returnType) : returnType; + var unwrappedReturnType = (ts.getFunctionFlags(func) & 3) === 2 + ? getPromisedTypeOfPromise(returnType) + : returnType; return unwrappedReturnType && maybeTypeOfKind(unwrappedReturnType, 1024 | 1); } function checkReturnStatement(node) { @@ -32918,40 +35938,41 @@ var ts; var returnType = getReturnTypeOfSignature(signature); if (strictNullChecks || node.expression || returnType.flags & 8192) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.asteriskToken) { + var functionFlags = ts.getFunctionFlags(func); + if (functionFlags & 1) { return; } - if (func.kind === 152) { + if (func.kind === 153) { if (node.expression) { - error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); + error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 150) { - if (node.expression && !checkTypeAssignableTo(exprType, returnType, node.expression)) { - error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); + else if (func.kind === 151) { + if (node.expression && !checkTypeAssignableTo(exprType, returnType, node)) { + error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } } else if (func.type || isGetAccessorWithAnnotatedSetAccessor(func)) { - if (ts.isAsyncFunctionLike(func)) { - var promisedType = getPromisedType(returnType); - var awaitedType = checkAwaitedType(exprType, node.expression || node, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); + if (functionFlags & 2) { + var promisedType = getPromisedTypeOfPromise(returnType); + var awaitedType = checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); if (promisedType) { - checkTypeAssignableTo(awaitedType, promisedType, node.expression || node); + checkTypeAssignableTo(awaitedType, promisedType, node); } } else { - checkTypeAssignableTo(exprType, returnType, node.expression || node); + checkTypeAssignableTo(exprType, returnType, node); } } } - else if (func.kind !== 150 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 151 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } } } function checkWithStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.flags & 524288) { + if (node.flags & 16384) { grammarErrorOnFirstToken(node, ts.Diagnostics.with_statements_are_not_allowed_in_an_async_function_block); } } @@ -32970,7 +35991,7 @@ var ts; var expressionType = checkExpression(node.expression); var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { - if (clause.kind === 254 && !hasDuplicateDefaultClause) { + if (clause.kind === 257 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -32982,7 +36003,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 253) { + if (produceDiagnostics && clause.kind === 256) { var caseClause = clause; var caseType = checkExpression(caseClause.expression); var caseIsLiteral = isLiteralType(caseType); @@ -33003,18 +36024,16 @@ var ts; } function checkLabeledStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - var current = node.parent; - while (current) { + ts.findAncestor(node.parent, function (current) { if (ts.isFunctionLike(current)) { - break; + return "quit"; } - if (current.kind === 219 && current.label.text === node.label.text) { + if (current.kind === 221 && current.label.text === node.label.text) { var sourceFile = ts.getSourceFileOfNode(node); grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); - break; + return true; } - current = current.parent; - } + }); } checkSourceElement(node.statement); } @@ -33041,14 +36060,14 @@ var ts; grammarErrorOnFirstToken(catchClause.variableDeclaration.initializer, ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer); } else { - var blockLocals = catchClause.block.locals; - if (blockLocals) { - for (var caughtName in catchClause.locals) { - var blockLocal = blockLocals[caughtName]; + var blockLocals_1 = catchClause.block.locals; + if (blockLocals_1) { + ts.forEachKey(catchClause.locals, function (caughtName) { + var blockLocal = blockLocals_1.get(caughtName); if (blockLocal && (blockLocal.flags & 2) !== 0) { grammarErrorOnNode(blockLocal.valueDeclaration, ts.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause, caughtName); } - } + }); } } } @@ -33096,12 +36115,13 @@ var ts; if (!indexType) { return; } - if (indexKind === 1 && !isNumericName(prop.valueDeclaration.name)) { + var propDeclaration = prop.valueDeclaration; + if (indexKind === 1 && !(propDeclaration ? isNumericName(propDeclaration.name) : isNumericLiteralName(prop.name))) { return; } var errorNode; - if (prop.valueDeclaration.name.kind === 142 || prop.parent === containingType.symbol) { - errorNode = prop.valueDeclaration; + if (propDeclaration && (propDeclaration.name.kind === 143 || prop.parent === containingType.symbol)) { + errorNode = propDeclaration; } else if (indexDeclaration) { errorNode = indexDeclaration; @@ -33126,15 +36146,23 @@ var ts; case "string": case "symbol": case "void": + case "object": error(name, message, name.text); } } function checkTypeParameters(typeParameterDeclarations) { if (typeParameterDeclarations) { - for (var i = 0, n = typeParameterDeclarations.length; i < n; i++) { + var seenDefault = false; + for (var i = 0; i < typeParameterDeclarations.length; i++) { var node = typeParameterDeclarations[i]; checkTypeParameter(node); if (produceDiagnostics) { + if (node.default) { + seenDefault = true; + } + else if (seenDefault) { + error(node, ts.Diagnostics.Required_type_parameters_may_not_follow_optional_type_parameters); + } for (var j = 0; j < i; j++) { if (typeParameterDeclarations[j].symbol === node.symbol) { error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.declarationNameToString(node.name)); @@ -33144,23 +36172,57 @@ var ts; } } } - function checkTypeParameterListsIdentical(node, symbol) { + function checkTypeParameterListsIdentical(symbol) { if (symbol.declarations.length === 1) { return; } - var firstDecl; - for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { - var declaration = _a[_i]; - if (declaration.kind === 226 || declaration.kind === 227) { - if (!firstDecl) { - firstDecl = declaration; - } - else if (!areTypeParametersIdentical(firstDecl.typeParameters, node.typeParameters)) { - error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, node.name.text); + var links = getSymbolLinks(symbol); + if (!links.typeParametersChecked) { + links.typeParametersChecked = true; + var declarations = getClassOrInterfaceDeclarationsOfSymbol(symbol); + if (declarations.length <= 1) { + return; + } + var type = getDeclaredTypeOfSymbol(symbol); + if (!areTypeParametersIdentical(declarations, type.localTypeParameters)) { + var name = symbolToString(symbol); + for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { + var declaration = declarations_6[_i]; + error(declaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name); } } } } + function areTypeParametersIdentical(declarations, typeParameters) { + var maxTypeArgumentCount = ts.length(typeParameters); + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { + var declaration = declarations_7[_i]; + var numTypeParameters = ts.length(declaration.typeParameters); + if (numTypeParameters < minTypeArgumentCount || numTypeParameters > maxTypeArgumentCount) { + return false; + } + for (var i = 0; i < numTypeParameters; i++) { + var source = declaration.typeParameters[i]; + var target = typeParameters[i]; + if (source.name.text !== target.symbol.name) { + return false; + } + var sourceConstraint = source.constraint && getTypeFromTypeNode(source.constraint); + var targetConstraint = getConstraintFromTypeParameter(target); + if ((sourceConstraint || targetConstraint) && + (!sourceConstraint || !targetConstraint || !isTypeIdenticalTo(sourceConstraint, targetConstraint))) { + return false; + } + var sourceDefault = source.default && getTypeFromTypeNode(source.default); + var targetDefault = getDefaultFromTypeParameter(target); + if (sourceDefault && targetDefault && !isTypeIdenticalTo(sourceDefault, targetDefault)) { + return false; + } + } + } + return true; + } function checkClassExpression(node) { checkClassLikeDeclaration(node); checkNodeDeferred(node); @@ -33179,11 +36241,12 @@ var ts; registerForUnusedIdentifiersCheck(node); } function checkClassLikeDeclaration(node) { - checkGrammarClassDeclarationHeritageClauses(node); + checkGrammarClassLikeDeclaration(node); checkDecorators(node); if (node.name) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Class_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); } @@ -33193,19 +36256,26 @@ var ts; var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); var staticType = getTypeOfSymbol(symbol); - checkTypeParameterListsIdentical(node, symbol); + checkTypeParameterListsIdentical(symbol); checkClassForDuplicateDeclarations(node); + if (!ts.isInAmbientContext(node)) { + checkClassForStaticPropertyNameConflicts(node); + } var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { + if (languageVersion < 2) { + checkExternalEmitHelpers(baseTypeNode.parent, 1); + } var baseTypes = getBaseTypes(type); if (baseTypes.length && produceDiagnostics) { var baseType_1 = baseTypes[0]; - var staticBaseType = getBaseConstructorTypeOfClass(type); + var baseConstructorType = getBaseConstructorTypeOfClass(type); + var staticBaseType = getApparentType(baseConstructorType); checkBaseTypeAccessibility(staticBaseType, baseTypeNode); checkSourceElement(baseTypeNode.expression); if (baseTypeNode.typeArguments) { ts.forEach(baseTypeNode.typeArguments, checkSourceElement); - for (var _i = 0, _a = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments); _i < _a.length; _i++) { + for (var _i = 0, _a = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); _i < _a.length; _i++) { var constructor = _a[_i]; if (!checkTypeArgumentConstraints(constructor.typeParameters, baseTypeNode.typeArguments)) { break; @@ -33214,15 +36284,11 @@ var ts; } checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(baseType_1, type.thisType), node.name || node, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); checkTypeAssignableTo(staticType, getTypeWithoutSignatures(staticBaseType), node.name || node, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); - if (baseType_1.symbol.valueDeclaration && - !ts.isInAmbientContext(baseType_1.symbol.valueDeclaration) && - baseType_1.symbol.valueDeclaration.kind === 226) { - if (!isBlockScopedNameDeclaredBeforeUse(baseType_1.symbol.valueDeclaration, node)) { - error(baseTypeNode, ts.Diagnostics.A_class_must_be_declared_after_its_base_class); - } + if (baseConstructorType.flags & 540672 && !isMixinConstructorType(staticType)) { + error(node.name || node, ts.Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any); } - if (!(staticBaseType.symbol && staticBaseType.symbol.flags & 32)) { - var constructors = getInstantiatedConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments); + if (!(staticBaseType.symbol && staticBaseType.symbol.flags & 32) && !(baseConstructorType.flags & 540672)) { + var constructors = getInstantiatedConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); if (ts.forEach(constructors, function (sig) { return getReturnTypeOfSignature(sig) !== baseType_1; })) { error(baseTypeNode.expression, ts.Diagnostics.Base_constructors_must_all_have_the_same_return_type); } @@ -33241,8 +36307,7 @@ var ts; if (produceDiagnostics) { var t = getTypeFromTypeNode(typeRefNode); if (t !== unknownType) { - var declaredType = getObjectFlags(t) & 4 ? t.target : t; - if (getObjectFlags(declaredType) & 3) { + if (isValidBaseType(t)) { checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(t, type.thisType), node.name || node, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); } else { @@ -33270,17 +36335,22 @@ var ts; } } function getTargetSymbol(s) { - return s.flags & 16777216 ? getSymbolLinks(s).target : s; + return getCheckFlags(s) & 1 ? s.target : s; } function getClassLikeDeclarationOfSymbol(symbol) { return ts.forEach(symbol.declarations, function (d) { return ts.isClassLike(d) ? d : undefined; }); } + function getClassOrInterfaceDeclarationsOfSymbol(symbol) { + return ts.filter(symbol.declarations, function (d) { + return d.kind === 228 || d.kind === 229; + }); + } function checkKindsOfPropertyMemberOverrides(type, baseType) { - var baseProperties = getPropertiesOfObjectType(baseType); + var baseProperties = getPropertiesOfType(baseType); for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) { var baseProperty = baseProperties_1[_i]; var base = getTargetSymbol(baseProperty); - if (base.flags & 134217728) { + if (base.flags & 16777216) { continue; } var derived = getTargetSymbol(getPropertyOfObjectType(type, base.name)); @@ -33290,7 +36360,7 @@ var ts; if (derived === base) { var derivedClassDecl = getClassLikeDeclarationOfSymbol(type.symbol); if (baseDeclarationFlags & 128 && (!derivedClassDecl || !(ts.getModifierFlags(derivedClassDecl) & 128))) { - if (derivedClassDecl.kind === 197) { + if (derivedClassDecl.kind === 198) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -33300,66 +36370,37 @@ var ts; } else { var derivedDeclarationFlags = getDeclarationModifierFlagsFromSymbol(derived); - if ((baseDeclarationFlags & 8) || (derivedDeclarationFlags & 8)) { + if (baseDeclarationFlags & 8 || derivedDeclarationFlags & 8) { continue; } if ((baseDeclarationFlags & 32) !== (derivedDeclarationFlags & 32)) { continue; } - if ((base.flags & derived.flags & 8192) || ((base.flags & 98308) && (derived.flags & 98308))) { + if (isMethodLike(base) && isMethodLike(derived) || base.flags & 98308 && derived.flags & 98308) { continue; } var errorMessage = void 0; - if (base.flags & 8192) { + if (isMethodLike(base)) { if (derived.flags & 98304) { errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; } else { - ts.Debug.assert((derived.flags & 4) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; } } else if (base.flags & 4) { - ts.Debug.assert((derived.flags & 8192) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; } else { - ts.Debug.assert((base.flags & 98304) !== 0); - ts.Debug.assert((derived.flags & 8192) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; } - error(derived.valueDeclaration.name, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); + error(derived.valueDeclaration.name || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); } } } } function isAccessor(kind) { - return kind === 151 || kind === 152; - } - function areTypeParametersIdentical(list1, list2) { - if (!list1 && !list2) { - return true; - } - if (!list1 || !list2 || list1.length !== list2.length) { - return false; - } - for (var i = 0, len = list1.length; i < len; i++) { - var tp1 = list1[i]; - var tp2 = list2[i]; - if (tp1.name.text !== tp2.name.text) { - return false; - } - if (!tp1.constraint && !tp2.constraint) { - continue; - } - if (!tp1.constraint || !tp2.constraint) { - return false; - } - if (!isTypeIdenticalTo(getTypeFromTypeNode(tp1.constraint), getTypeFromTypeNode(tp2.constraint))) { - return false; - } - } - return true; + return kind === 152 || kind === 153; } function checkInheritedPropertiesAreIdentical(type, typeNode) { var baseTypes = getBaseTypes(type); @@ -33367,16 +36408,16 @@ var ts; return true; } var seen = ts.createMap(); - ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; }); + ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen.set(p.name, { prop: p, containingType: type }); }); var ok = true; for (var _i = 0, baseTypes_2 = baseTypes; _i < baseTypes_2.length; _i++) { var base = baseTypes_2[_i]; - var properties = getPropertiesOfObjectType(getTypeWithThisArgument(base, type.thisType)); - for (var _a = 0, properties_6 = properties; _a < properties_6.length; _a++) { - var prop = properties_6[_a]; - var existing = seen[prop.name]; + var properties = getPropertiesOfType(getTypeWithThisArgument(base, type.thisType)); + for (var _a = 0, properties_8 = properties; _a < properties_8.length; _a++) { + var prop = properties_8[_a]; + var existing = seen.get(prop.name); if (!existing) { - seen[prop.name] = { prop: prop, containingType: base }; + seen.set(prop.name, { prop: prop, containingType: base }); } else { var isInheritedProperty = existing.containingType !== type; @@ -33400,8 +36441,8 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - checkTypeParameterListsIdentical(node, symbol); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 227); + checkTypeParameterListsIdentical(symbol); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 229); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -33497,7 +36538,7 @@ var ts; return value; function evalConstant(e) { switch (e.kind) { - case 190: + case 191: var value_1 = evalConstant(e.operand); if (value_1 === undefined) { return undefined; @@ -33508,7 +36549,7 @@ var ts; case 51: return ~value_1; } return undefined; - case 192: + case 193: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -33532,12 +36573,13 @@ var ts; } return undefined; case 8: + checkGrammarNumericLiteral(e); return +e.text; - case 183: + case 184: return evalConstant(e.expression); case 70: + case 179: case 178: - case 177: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); var enumType_1; @@ -33548,7 +36590,7 @@ var ts; } else { var expression = void 0; - if (e.kind === 178) { + if (e.kind === 179) { if (e.argumentExpression === undefined || e.argumentExpression.kind !== 9) { return undefined; @@ -33565,7 +36607,7 @@ var ts; if (current.kind === 70) { break; } - else if (current.kind === 177) { + else if (current.kind === 178) { current = current.expression; } else { @@ -33605,6 +36647,7 @@ var ts; checkGrammarDecorators(node) || checkGrammarModifiers(node); checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); @@ -33625,7 +36668,7 @@ var ts; } var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 229) { + if (declaration.kind !== 231) { return false; } var enumDeclaration = declaration; @@ -33646,10 +36689,10 @@ var ts; } function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { - var declaration = declarations_5[_i]; - if ((declaration.kind === 226 || - (declaration.kind === 225 && ts.nodeIsPresent(declaration.body))) && + for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { + var declaration = declarations_8[_i]; + if ((declaration.kind === 228 || + (declaration.kind === 227 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } @@ -33708,7 +36751,7 @@ var ts; error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); } } - var mergedClass = ts.getDeclarationOfKind(symbol, 226); + var mergedClass = ts.getDeclarationOfKind(symbol, 228); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768; @@ -33716,7 +36759,7 @@ var ts; } if (isAmbientExternalModule) { if (ts.isExternalModuleAugmentation(node)) { - var checkBody = isGlobalAugmentation || (getSymbolOfNode(node).flags & 33554432); + var checkBody = isGlobalAugmentation || (getSymbolOfNode(node).flags & 134217728); if (checkBody && node.body) { for (var _i = 0, _a = node.body.statements; _i < _a.length; _i++) { var statement = _a[_i]; @@ -33751,42 +36794,42 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 205: + case 207: for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 240: - case 241: + case 242: + case 243: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 234: - case 235: + case 236: + case 237: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 174: - case 223: - var name_25 = node.name; - if (ts.isBindingPattern(name_25)) { - for (var _b = 0, _c = name_25.elements; _b < _c.length; _b++) { + case 175: + case 225: + var name = node.name; + if (ts.isBindingPattern(name)) { + for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { var el = _c[_b]; checkModuleAugmentationElement(el, isGlobalAugmentation); } break; } - case 226: - case 229: - case 225: - case 227: - case 230: case 228: + case 231: + case 227: + case 229: + case 232: + case 230: if (isGlobalAugmentation) { return; } var symbol = getSymbolOfNode(node); if (symbol) { - var reportError = !(symbol.flags & 33554432); + var reportError = !(symbol.flags & 134217728); if (!reportError) { reportError = ts.isExternalModuleAugmentation(symbol.parent.declarations[0]); } @@ -33798,12 +36841,12 @@ var ts; switch (node.kind) { case 70: return node; - case 141: + case 142: do { node = node.left; } while (node.kind !== 70); return node; - case 177: + case 178: do { node = node.expression; } while (node.kind !== 70); @@ -33816,9 +36859,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 231 && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 261 && !inAmbientExternalModule) { - error(moduleName, node.kind === 241 ? + var inAmbientExternalModule = node.parent.kind === 233 && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 264 && !inAmbientExternalModule) { + error(moduleName, node.kind === 243 ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -33839,7 +36882,7 @@ var ts; (symbol.flags & 793064 ? 793064 : 0) | (symbol.flags & 1920 ? 1920 : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 243 ? + var message = node.kind === 245 ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); @@ -33866,7 +36909,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 237) { + if (importClause.namedBindings.kind === 239) { checkImportBinding(importClause.namedBindings); } else { @@ -33917,8 +36960,10 @@ var ts; if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { if (node.exportClause) { ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 231 && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 261 && !inAmbientExternalModule) { + var inAmbientExternalModule = node.parent.kind === 233 && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 233 && + !node.moduleSpecifier && ts.isInAmbientContext(node); + if (node.parent.kind !== 264 && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -33931,7 +36976,7 @@ var ts; } } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 261 || node.parent.kind === 231 || node.parent.kind === 230; + var isInAppropriateContext = node.parent.kind === 264 || node.parent.kind === 233 || node.parent.kind === 232; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -33954,9 +36999,14 @@ var ts; if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_assignment_can_only_be_used_in_a_module)) { return; } - var container = node.parent.kind === 261 ? node.parent : node.parent.parent; - if (container.kind === 230 && !ts.isAmbientModule(container)) { - error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); + var container = node.parent.kind === 264 ? node.parent : node.parent.parent; + if (container.kind === 232 && !ts.isAmbientModule(container)) { + if (node.isExportEquals) { + error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); + } + else { + error(node, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); + } return; } if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.getModifierFlags(node) !== 0) { @@ -33979,18 +37029,13 @@ var ts; } } function hasExportedMembers(moduleSymbol) { - for (var id in moduleSymbol.exports) { - if (id !== "export=") { - return true; - } - } - return false; + return ts.forEachEntry(moduleSymbol.exports, function (_, id) { return id !== "export="; }); } function checkExternalModuleExports(node) { var moduleSymbol = getSymbolOfNode(node); var links = getSymbolLinks(moduleSymbol); if (!links.exportsChecked) { - var exportEqualsSymbol = moduleSymbol.exports["export="]; + var exportEqualsSymbol = moduleSymbol.exports.get("export="); if (exportEqualsSymbol && hasExportedMembers(moduleSymbol)) { var declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; if (!isTopLevelInExternalModuleAugmentation(declaration)) { @@ -33998,31 +37043,31 @@ var ts; } } var exports = getExportsOfModule(moduleSymbol); - for (var id in exports) { + exports && exports.forEach(function (_a, id) { + var declarations = _a.declarations, flags = _a.flags; if (id === "__export") { - continue; + return; } - var _a = exports[id], declarations = _a.declarations, flags = _a.flags; if (flags & (1920 | 64 | 384)) { - continue; + return; } var exportedDeclarationsCount = ts.countWhere(declarations, isNotOverload); if (flags & 524288 && exportedDeclarationsCount <= 2) { - continue; + return; } if (exportedDeclarationsCount > 1) { - for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { - var declaration = declarations_6[_i]; + for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) { + var declaration = declarations_9[_i]; if (isNotOverload(declaration)) { diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Cannot_redeclare_exported_variable_0, id)); } } } - } + }); links.exportsChecked = true; } function isNotOverload(declaration) { - return (declaration.kind !== 225 && declaration.kind !== 149) || + return (declaration.kind !== 227 && declaration.kind !== 150) || !!declaration.body; } } @@ -34033,123 +37078,123 @@ var ts; var kind = node.kind; if (cancellationToken) { switch (kind) { - case 230: - case 226: + case 232: + case 228: + case 229: case 227: - case 225: cancellationToken.throwIfCancellationRequested(); } } switch (kind) { - case 143: - return checkTypeParameter(node); case 144: + return checkTypeParameter(node); + case 145: return checkParameter(node); + case 148: case 147: - case 146: return checkPropertyDeclaration(node); - case 158: case 159: - case 153: + case 160: case 154: - return checkSignatureDeclaration(node); case 155: return checkSignatureDeclaration(node); - case 149: - case 148: - return checkMethodDeclaration(node); - case 150: - return checkConstructorDeclaration(node); - case 151: - case 152: - return checkAccessorDeclaration(node); - case 157: - return checkTypeReferenceNode(node); case 156: + return checkSignatureDeclaration(node); + case 150: + case 149: + return checkMethodDeclaration(node); + case 151: + return checkConstructorDeclaration(node); + case 152: + case 153: + return checkAccessorDeclaration(node); + case 158: + return checkTypeReferenceNode(node); + case 157: return checkTypePredicate(node); - case 160: - return checkTypeQuery(node); case 161: - return checkTypeLiteral(node); + return checkTypeQuery(node); case 162: - return checkArrayType(node); + return checkTypeLiteral(node); case 163: - return checkTupleType(node); + return checkArrayType(node); case 164: + return checkTupleType(node); case 165: - return checkUnionOrIntersectionType(node); case 166: - case 168: - return checkSourceElement(node.type); + return checkUnionOrIntersectionType(node); + case 167: case 169: - return checkIndexedAccessType(node); + return checkSourceElement(node.type); case 170: + return checkIndexedAccessType(node); + case 171: return checkMappedType(node); - case 225: - return checkFunctionDeclaration(node); - case 204: - case 231: - return checkBlock(node); - case 205: - return checkVariableStatement(node); - case 207: - return checkExpressionStatement(node); - case 208: - return checkIfStatement(node); - case 209: - return checkDoStatement(node); - case 210: - return checkWhileStatement(node); - case 211: - return checkForStatement(node); - case 212: - return checkForInStatement(node); - case 213: - return checkForOfStatement(node); - case 214: - case 215: - return checkBreakOrContinueStatement(node); - case 216: - return checkReturnStatement(node); - case 217: - return checkWithStatement(node); - case 218: - return checkSwitchStatement(node); - case 219: - return checkLabeledStatement(node); - case 220: - return checkThrowStatement(node); - case 221: - return checkTryStatement(node); - case 223: - return checkVariableDeclaration(node); - case 174: - return checkBindingElement(node); - case 226: - return checkClassDeclaration(node); case 227: - return checkInterfaceDeclaration(node); - case 228: - return checkTypeAliasDeclaration(node); - case 229: - return checkEnumDeclaration(node); - case 230: - return checkModuleDeclaration(node); - case 235: - return checkImportDeclaration(node); - case 234: - return checkImportEqualsDeclaration(node); - case 241: - return checkExportDeclaration(node); - case 240: - return checkExportAssignment(node); + return checkFunctionDeclaration(node); case 206: - checkGrammarStatementInAmbientContext(node); - return; + case 233: + return checkBlock(node); + case 207: + return checkVariableStatement(node); + case 209: + return checkExpressionStatement(node); + case 210: + return checkIfStatement(node); + case 211: + return checkDoStatement(node); + case 212: + return checkWhileStatement(node); + case 213: + return checkForStatement(node); + case 214: + return checkForInStatement(node); + case 215: + return checkForOfStatement(node); + case 216: + case 217: + return checkBreakOrContinueStatement(node); + case 218: + return checkReturnStatement(node); + case 219: + return checkWithStatement(node); + case 220: + return checkSwitchStatement(node); + case 221: + return checkLabeledStatement(node); case 222: + return checkThrowStatement(node); + case 223: + return checkTryStatement(node); + case 225: + return checkVariableDeclaration(node); + case 175: + return checkBindingElement(node); + case 228: + return checkClassDeclaration(node); + case 229: + return checkInterfaceDeclaration(node); + case 230: + return checkTypeAliasDeclaration(node); + case 231: + return checkEnumDeclaration(node); + case 232: + return checkModuleDeclaration(node); + case 237: + return checkImportDeclaration(node); + case 236: + return checkImportEqualsDeclaration(node); + case 243: + return checkExportDeclaration(node); + case 242: + return checkExportAssignment(node); + case 208: checkGrammarStatementInAmbientContext(node); return; - case 244: + case 224: + checkGrammarStatementInAmbientContext(node); + return; + case 246: return checkMissingDeclaration(node); } } @@ -34162,17 +37207,17 @@ var ts; for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) { var node = deferredNodes_1[_i]; switch (node.kind) { - case 184: case 185: + case 186: + case 150: case 149: - case 148: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 151: case 152: - checkAccessorDeferred(node); + case 153: + checkAccessorDeclaration(node); break; - case 197: + case 198: checkClassExpressionDeferred(node); break; } @@ -34192,6 +37237,7 @@ var ts; } checkGrammarSourceFile(node); potentialThisCollisions.length = 0; + potentialNewTargetCollisions.length = 0; deferredNodes = []; deferredUnusedIdentifierNodes = produceDiagnostics && noUnusedIdentifiers ? [] : undefined; ts.forEach(node.statements, checkSourceElement); @@ -34211,6 +37257,10 @@ var ts; ts.forEach(potentialThisCollisions, checkIfThisIsCapturedInEnclosingScope); potentialThisCollisions.length = 0; } + if (potentialNewTargetCollisions.length) { + ts.forEach(potentialNewTargetCollisions, checkIfNewTargetIsCapturedInEnclosingScope); + potentialNewTargetCollisions.length = 0; + } links.flags |= 1; } } @@ -34255,7 +37305,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 217 && node.parent.statement === node) { + if (node.parent.kind === 219 && node.parent.statement === node) { return true; } node = node.parent; @@ -34264,11 +37314,11 @@ var ts; return false; } function getSymbolsInScope(location, meaning) { - var symbols = ts.createMap(); - var memberFlags = 0; if (isInsideWithStatementBody(location)) { return []; } + var symbols = ts.createMap(); + var memberFlags = 0; populateSymbols(); return symbolsToArray(symbols); function populateSymbols() { @@ -34277,28 +37327,28 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 261: + case 264: if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 230: + case 232: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931); break; - case 229: + case 231: copySymbols(getSymbolOfNode(location).exports, meaning & 8); break; - case 197: + case 198: var className = location.name; if (className) { copySymbol(location.symbol, meaning); } - case 226: - case 227: + case 228: + case 229: if (!(memberFlags & 32)) { copySymbols(getSymbolOfNode(location).members, meaning & 793064); } break; - case 184: + case 185: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -34316,17 +37366,16 @@ var ts; function copySymbol(symbol, meaning) { if (symbol.flags & meaning) { var id = symbol.name; - if (!symbols[id]) { - symbols[id] = symbol; + if (!symbols.has(id)) { + symbols.set(id, symbol); } } } function copySymbols(source, meaning) { if (meaning) { - for (var id in source) { - var symbol = source[id]; + source.forEach(function (symbol) { copySymbol(symbol, meaning); - } + }); } } } @@ -34337,27 +37386,27 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 143: - case 226: - case 227: + case 144: case 228: case 229: + case 230: + case 231: return true; } } function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 141) { + while (node.parent && node.parent.kind === 142) { node = node.parent; } - return node.parent && (node.parent.kind === 157 || node.parent.kind === 272); + return node.parent && (node.parent.kind === 158 || node.parent.kind === 276); } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 177) { + while (node.parent && node.parent.kind === 178) { node = node.parent; } - return node.parent && node.parent.kind === 199; + return node.parent && node.parent.kind === 200; } function forEachEnclosingClass(node, callback) { var result; @@ -34374,13 +37423,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 141) { + while (nodeOnRightSide.parent.kind === 142) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 234) { + if (nodeOnRightSide.parent.kind === 236) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 240) { + if (nodeOnRightSide.parent.kind === 242) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -34388,27 +37437,35 @@ var ts; function isInRightSideOfImportOrExportAssignment(node) { return getLeftSideOfImportEqualsOrExportAssignment(node) !== undefined; } + function getSpecialPropertyAssignmentSymbolFromEntityName(entityName) { + var specialPropertyAssignmentKind = ts.getSpecialPropertyAssignmentKind(entityName.parent.parent); + switch (specialPropertyAssignmentKind) { + case 1: + case 3: + return getSymbolOfNode(entityName.parent); + case 4: + case 2: + case 5: + return getSymbolOfNode(entityName.parent.parent); + } + } function getSymbolOfEntityNameOrPropertyAccessExpression(entityName) { if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (ts.isInJavaScriptFile(entityName) && entityName.parent.kind === 177) { - var specialPropertyAssignmentKind = ts.getSpecialPropertyAssignmentKind(entityName.parent.parent); - switch (specialPropertyAssignmentKind) { - case 1: - case 3: - return getSymbolOfNode(entityName.parent); - case 4: - case 2: - return getSymbolOfNode(entityName.parent.parent); - default: + if (ts.isInJavaScriptFile(entityName) && + entityName.parent.kind === 178 && + entityName.parent === entityName.parent.parent.left) { + var specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(entityName); + if (specialPropertyAssignmentSymbol) { + return specialPropertyAssignmentSymbol; } } - if (entityName.parent.kind === 240 && ts.isEntityNameExpression(entityName)) { + if (entityName.parent.kind === 242 && ts.isEntityNameExpression(entityName)) { return resolveEntityName(entityName, 107455 | 793064 | 1920 | 8388608); } - if (entityName.kind !== 177 && isInRightSideOfImportOrExportAssignment(entityName)) { - var importEqualsDeclaration = ts.getAncestor(entityName, 234); + if (entityName.kind !== 178 && isInRightSideOfImportOrExportAssignment(entityName)) { + var importEqualsDeclaration = ts.getAncestor(entityName, 236); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, true); } @@ -34417,7 +37474,7 @@ var ts; } if (isHeritageClauseElementIdentifier(entityName)) { var meaning = 0; - if (entityName.parent.kind === 199) { + if (entityName.parent.kind === 200) { meaning = 793064; if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { meaning |= 107455; @@ -34427,9 +37484,12 @@ var ts; meaning = 1920; } meaning |= 8388608; - return resolveEntityName(entityName, meaning); + var entityNameSymbol = resolveEntityName(entityName, meaning); + if (entityNameSymbol) { + return entityNameSymbol; + } } - else if (ts.isPartOfExpression(entityName)) { + if (ts.isPartOfExpression(entityName)) { if (ts.nodeIsMissing(entityName)) { return undefined; } @@ -34439,14 +37499,14 @@ var ts; } return resolveEntityName(entityName, 107455, false, true); } - else if (entityName.kind === 177) { + else if (entityName.kind === 178) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); } return getNodeLinks(entityName).resolvedSymbol; } - else if (entityName.kind === 141) { + else if (entityName.kind === 142) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkQualifiedName(entityName); @@ -34455,19 +37515,19 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = (entityName.parent.kind === 157 || entityName.parent.kind === 272) ? 793064 : 1920; + var meaning = (entityName.parent.kind === 158 || entityName.parent.kind === 276) ? 793064 : 1920; return resolveEntityName(entityName, meaning, false, true); } - else if (entityName.parent.kind === 250) { + else if (entityName.parent.kind === 252) { return getJsxAttributePropertySymbol(entityName.parent); } - if (entityName.parent.kind === 156) { + if (entityName.parent.kind === 157) { return resolveEntityName(entityName, 1); } return undefined; } function getSymbolAtLocation(node) { - if (node.kind === 261) { + if (node.kind === 264) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } if (isInsideWithStatementBody(node)) { @@ -34483,8 +37543,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfEntityNameOrPropertyAccessExpression(node); } - else if (node.parent.kind === 174 && - node.parent.parent.kind === 172 && + else if (node.parent.kind === 175 && + node.parent.parent.kind === 173 && node === node.parent.propertyName) { var typeOfPattern = getTypeOfNode(node.parent.parent); var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.text); @@ -34495,8 +37555,8 @@ var ts; } switch (node.kind) { case 70: - case 177: - case 141: + case 178: + case 142: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 98: var container = ts.getThisContainer(node, false); @@ -34509,18 +37569,18 @@ var ts; case 96: var type = ts.isPartOfExpression(node) ? getTypeOfExpression(node) : getTypeFromTypeNode(node); return type.symbol; - case 167: + case 168: return getTypeFromTypeNode(node).symbol; case 122: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 150) { + if (constructorDeclaration && constructorDeclaration.kind === 151) { return constructorDeclaration.parent.symbol; } return undefined; case 9: if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 235 || node.parent.kind === 241) && + ((node.parent.kind === 237 || node.parent.kind === 243) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } @@ -34528,7 +37588,7 @@ var ts; return resolveExternalModuleName(node, node); } case 8: - if (node.parent.kind === 178 && node.parent.argumentExpression === node) { + if (node.parent.kind === 179 && node.parent.argumentExpression === node) { var objectType = getTypeOfExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -34542,7 +37602,7 @@ var ts; return undefined; } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 258) { + if (location && location.kind === 261) { return resolveEntityName(location.name, 107455 | 8388608); } return undefined; @@ -34557,13 +37617,22 @@ var ts; return unknownType; } if (ts.isPartOfTypeNode(node)) { - return getTypeFromTypeNode(node); + var typeFromTypeNode = getTypeFromTypeNode(node); + if (typeFromTypeNode && ts.isExpressionWithTypeArgumentsInClassImplementsClause(node)) { + var containingClass = ts.getContainingClass(node); + var classType = getTypeOfNode(containingClass); + typeFromTypeNode = getTypeWithThisArgument(typeFromTypeNode, classType.thisType); + } + return typeFromTypeNode; } if (ts.isPartOfExpression(node)) { return getRegularTypeOfExpression(node); } if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(node)) { - return getBaseTypes(getDeclaredTypeOfSymbol(getSymbolOfNode(node.parent.parent)))[0]; + var classNode = ts.getContainingClass(node); + var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(classNode)); + var baseType = getBaseTypes(classType)[0]; + return baseType && getTypeWithThisArgument(baseType, classType.thisType); } if (isTypeDeclaration(node)) { var symbol = getSymbolOfNode(node); @@ -34592,22 +37661,22 @@ var ts; return unknownType; } function getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr) { - ts.Debug.assert(expr.kind === 176 || expr.kind === 175); - if (expr.parent.kind === 213) { - var iteratedType = checkRightHandSideOfForOf(expr.parent.expression); + ts.Debug.assert(expr.kind === 177 || expr.kind === 176); + if (expr.parent.kind === 215) { + var iteratedType = checkRightHandSideOfForOf(expr.parent.expression, expr.parent.awaitModifier); return checkDestructuringAssignment(expr, iteratedType || unknownType); } - if (expr.parent.kind === 192) { + if (expr.parent.kind === 193) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || unknownType); } - if (expr.parent.kind === 257) { + if (expr.parent.kind === 260) { var typeOfParentObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent.parent); return checkObjectLiteralDestructuringPropertyAssignment(typeOfParentObjectLiteral || unknownType, expr.parent); } - ts.Debug.assert(expr.parent.kind === 175); + ts.Debug.assert(expr.parent.kind === 176); var typeOfArrayLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent); - var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, false) || unknownType; + var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, false, false) || unknownType; return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, ts.indexOf(expr.parent.elements, expr), elementType || unknownType); } function getPropertySymbolOfDestructuringAssignment(location) { @@ -34631,29 +37700,32 @@ var ts; var propsByName = createSymbolTable(getPropertiesOfType(type)); if (getSignaturesOfType(type, 0).length || getSignaturesOfType(type, 1).length) { ts.forEach(getPropertiesOfType(globalFunctionType), function (p) { - if (!propsByName[p.name]) { - propsByName[p.name] = p; + if (!propsByName.has(p.name)) { + propsByName.set(p.name, p); } }); } return getNamedMembers(propsByName); } function getRootSymbols(symbol) { - if (symbol.flags & 268435456) { + if (getCheckFlags(symbol) & 6) { var symbols_3 = []; - var name_26 = symbol.name; + var name_2 = symbol.name; ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) { - var symbol = getPropertyOfType(t, name_26); + var symbol = getPropertyOfType(t, name_2); if (symbol) { symbols_3.push(symbol); } }); return symbols_3; } - else if (symbol.flags & 67108864) { + else if (symbol.flags & 134217728) { if (symbol.leftSpread) { var links = symbol; - return [links.leftSpread, links.rightSpread]; + return getRootSymbols(links.leftSpread).concat(getRootSymbols(links.rightSpread)); + } + if (symbol.syntheticOrigin) { + return getRootSymbols(symbol.syntheticOrigin); } var target = void 0; var next = symbol; @@ -34670,7 +37742,8 @@ var ts; if (!ts.isGeneratedIdentifier(node)) { node = ts.getParseTreeNode(node, ts.isIdentifier); if (node) { - return getReferencedValueSymbol(node) === argumentsSymbol; + var isPropertyName_1 = node.parent.kind === 178 && node.parent.name === node; + return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } return false; @@ -34686,7 +37759,7 @@ var ts; if (symbolLinks.exportsSomeValue === undefined) { symbolLinks.exportsSomeValue = hasExportAssignment ? !!(moduleSymbol.flags & 107455) - : ts.forEachProperty(getExportsOfModule(moduleSymbol), isValue); + : ts.forEachEntry(getExportsOfModule(moduleSymbol), isValue); } return symbolLinks.exportsSomeValue; function isValue(s) { @@ -34710,19 +37783,15 @@ var ts; } symbol = exportSymbol; } - var parentSymbol = getParentOfSymbol(symbol); - if (parentSymbol) { - if (parentSymbol.flags & 512 && parentSymbol.valueDeclaration.kind === 261) { - var symbolFile = parentSymbol.valueDeclaration; + var parentSymbol_1 = getParentOfSymbol(symbol); + if (parentSymbol_1) { + if (parentSymbol_1.flags & 512 && parentSymbol_1.valueDeclaration.kind === 264) { + var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); var symbolIsUmdExport = symbolFile !== referenceFile; return symbolIsUmdExport ? undefined : symbolFile; } - for (var n = node.parent; n; n = n.parent) { - if (ts.isModuleOrEnumDeclaration(n) && getSymbolOfNode(n) === parentSymbol) { - return n; - } - } + return ts.findAncestor(node.parent, function (n) { return ts.isModuleOrEnumDeclaration(n) && getSymbolOfNode(n) === parentSymbol_1; }); } } } @@ -34750,7 +37819,7 @@ var ts; else if (nodeLinks_1.flags & 131072) { var isDeclaredInLoop = nodeLinks_1.flags & 262144; var inLoopInitializer = ts.isIterationStatement(container, false); - var inLoopBodyBlock = container.kind === 204 && ts.isIterationStatement(container.parent, false); + var inLoopBodyBlock = container.kind === 206 && ts.isIterationStatement(container.parent, false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -34785,21 +37854,17 @@ var ts; return false; } function isValueAliasDeclaration(node) { - node = ts.getParseTreeNode(node); - if (node === undefined) { - return true; - } switch (node.kind) { - case 234: case 236: - case 237: + case 238: case 239: - case 243: - return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); case 241: + case 245: + return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); + case 243: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 240: + case 242: return node.expression && node.expression.kind === 70 ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) @@ -34809,7 +37874,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(node) { node = ts.getParseTreeNode(node, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 261 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 264 || !ts.isInternalModuleImportEqualsDeclaration(node)) { return false; } var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); @@ -34827,10 +37892,6 @@ var ts; return isConstEnumSymbol(s) || s.constEnumOnlyModule; } function isReferencedAliasDeclaration(node, checkChildren) { - node = ts.getParseTreeNode(node); - if (node === undefined) { - return true; - } if (ts.isAliasSymbolDeclaration(node)) { var symbol = getSymbolOfNode(node); if (symbol && getSymbolLinks(symbol).referenced) { @@ -34851,16 +37912,30 @@ var ts; } return false; } + function isRequiredInitializedParameter(parameter) { + return strictNullChecks && + !isOptionalParameter(parameter) && + parameter.initializer && + !(ts.getModifierFlags(parameter) & 92); + } function getNodeCheckFlags(node) { - node = ts.getParseTreeNode(node); - return node ? getNodeLinks(node).flags : undefined; + return getNodeLinks(node).flags; } function getEnumMemberValue(node) { computeEnumMemberValues(node.parent); return getNodeLinks(node).enumMemberValue; } + function canHaveConstantValue(node) { + switch (node.kind) { + case 263: + case 178: + case 179: + return true; + } + return false; + } function getConstantValue(node) { - if (node.kind === 260) { + if (node.kind === 263) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -34876,15 +37951,17 @@ var ts; } function getTypeReferenceSerializationKind(typeName, location) { var valueSymbol = resolveEntityName(typeName, 107455, true, false, location); - var globalPromiseSymbol = tryGetGlobalPromiseConstructorSymbol(); - if (globalPromiseSymbol && valueSymbol === globalPromiseSymbol) { - return ts.TypeReferenceSerializationKind.Promise; - } - var constructorType = valueSymbol ? getTypeOfSymbol(valueSymbol) : undefined; - if (constructorType && isConstructorType(constructorType)) { - return ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue; - } var typeSymbol = resolveEntityName(typeName, 793064, true, false, location); + if (valueSymbol && valueSymbol === typeSymbol) { + var globalPromiseSymbol = getGlobalPromiseConstructorSymbol(false); + if (globalPromiseSymbol && valueSymbol === globalPromiseSymbol) { + return ts.TypeReferenceSerializationKind.Promise; + } + var constructorType = getTypeOfSymbol(valueSymbol); + if (constructorType && isConstructorType(constructorType)) { + return ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue; + } + } if (!typeSymbol) { return ts.TypeReferenceSerializationKind.ObjectType; } @@ -34928,6 +38005,9 @@ var ts; var type = symbol && !(symbol.flags & (2048 | 131072)) ? getWidenedLiteralType(getTypeOfSymbol(symbol)) : unknownType; + if (flags & 4096) { + type = includeFalsyTypes(type, 2048); + } getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { @@ -34942,10 +38022,13 @@ var ts; var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(node)); resolveBaseTypesOfClass(classType); var baseType = classType.resolvedBaseTypes.length ? classType.resolvedBaseTypes[0] : unknownType; + if (!baseType.symbol) { + writer.reportIllegalExtends(); + } getSymbolDisplayBuilder().buildTypeDisplay(baseType, writer, enclosingDeclaration, flags); } function hasGlobalName(name) { - return !!globals[name]; + return globals.has(name); } function getReferencedValueSymbol(reference, startInDeclarationContainer) { var resolvedSymbol = getNodeLinks(reference).resolvedSymbol; @@ -34954,9 +38037,9 @@ var ts; } var location = reference; if (startInDeclarationContainer) { - var parent_11 = reference.parent; - if (ts.isDeclaration(parent_11) && reference === parent_11.name) { - location = getDeclarationContainer(parent_11); + var parent = reference.parent; + if (ts.isDeclaration(parent) && reference === parent.name) { + location = getDeclarationContainer(parent); } } return resolveName(location, reference.text, 107455 | 1048576 | 8388608, undefined, undefined); @@ -34989,34 +38072,46 @@ var ts; var fileToDirective; if (resolvedTypeReferenceDirectives) { fileToDirective = ts.createFileMap(); - for (var key in resolvedTypeReferenceDirectives) { - var resolvedDirective = resolvedTypeReferenceDirectives[key]; + resolvedTypeReferenceDirectives.forEach(function (resolvedDirective, key) { if (!resolvedDirective) { - continue; + return; } var file = host.getSourceFile(resolvedDirective.resolvedFileName); fileToDirective.set(file.path, key); - } + }); } return { getReferencedExportContainer: getReferencedExportContainer, getReferencedImportDeclaration: getReferencedImportDeclaration, getReferencedDeclarationWithCollidingName: getReferencedDeclarationWithCollidingName, isDeclarationWithCollidingName: isDeclarationWithCollidingName, - isValueAliasDeclaration: isValueAliasDeclaration, + isValueAliasDeclaration: function (node) { + node = ts.getParseTreeNode(node); + return node ? isValueAliasDeclaration(node) : true; + }, hasGlobalName: hasGlobalName, - isReferencedAliasDeclaration: isReferencedAliasDeclaration, - getNodeCheckFlags: getNodeCheckFlags, + isReferencedAliasDeclaration: function (node, checkChildren) { + node = ts.getParseTreeNode(node); + return node ? isReferencedAliasDeclaration(node, checkChildren) : true; + }, + getNodeCheckFlags: function (node) { + node = ts.getParseTreeNode(node); + return node ? getNodeCheckFlags(node) : undefined; + }, isTopLevelValueImportEqualsWithEntityName: isTopLevelValueImportEqualsWithEntityName, isDeclarationVisible: isDeclarationVisible, isImplementationOfOverload: isImplementationOfOverload, + isRequiredInitializedParameter: isRequiredInitializedParameter, writeTypeOfDeclaration: writeTypeOfDeclaration, writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration, writeTypeOfExpression: writeTypeOfExpression, writeBaseConstructorTypeOfClass: writeBaseConstructorTypeOfClass, isSymbolAccessible: isSymbolAccessible, isEntityNameVisible: isEntityNameVisible, - getConstantValue: getConstantValue, + getConstantValue: function (node) { + node = ts.getParseTreeNode(node, canHaveConstantValue); + return node ? getConstantValue(node) : undefined; + }, collectLinkedAliases: collectLinkedAliases, getReferencedValueDeclaration: getReferencedValueDeclaration, getTypeReferenceSerializationKind: getTypeReferenceSerializationKind, @@ -35034,7 +38129,7 @@ var ts; if (!fileToDirective) { return undefined; } - var meaning = (node.kind === 177) || (node.kind === 70 && isInTypeQuery(node)) + var meaning = (node.kind === 178) || (node.kind === 70 && isInTypeQuery(node)) ? 107455 | 1048576 : 793064 | 1920; var symbol = resolveEntityName(node, meaning, true); @@ -35069,15 +38164,15 @@ var ts; } var current = symbol; while (true) { - var parent_12 = getParentOfSymbol(current); - if (parent_12) { - current = parent_12; + var parent = getParentOfSymbol(current); + if (parent) { + current = parent; } else { break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 261 && current.flags & 512) { + if (current.valueDeclaration && current.valueDeclaration.kind === 264 && current.flags & 512) { return false; } for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { @@ -35096,7 +38191,7 @@ var ts; if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 261); + return ts.getDeclarationOfKind(moduleSymbol, 264); } function initializeTypeChecker() { for (var _i = 0, _a = host.getSourceFiles(); _i < _a.length; _i++) { @@ -35104,8 +38199,6 @@ var ts; ts.bindSourceFile(file, compilerOptions); } var augmentations; - var requestedExternalEmitHelpers = 0; - var firstFileRequestingExternalHelpers; for (var _b = 0, _c = host.getSourceFiles(); _b < _c.length; _b++) { var file = _c[_b]; if (!ts.isExternalOrCommonJsModule(file)) { @@ -35119,20 +38212,11 @@ var ts; } if (file.symbol && file.symbol.globalExports) { var source = file.symbol.globalExports; - for (var id in source) { - if (!(id in globals)) { - globals[id] = source[id]; + source.forEach(function (sourceSymbol, id) { + if (!globals.has(id)) { + globals.set(id, sourceSymbol); } - } - } - if ((compilerOptions.isolatedModules || ts.isExternalModule(file)) && !file.isDeclarationFile) { - var fileRequestedExternalEmitHelpers = file.flags & 64512; - if (fileRequestedExternalEmitHelpers) { - requestedExternalEmitHelpers |= fileRequestedExternalEmitHelpers; - if (firstFileRequestingExternalHelpers === undefined) { - firstFileRequestingExternalHelpers = file; - } - } + }); } } if (augmentations) { @@ -35146,116 +38230,80 @@ var ts; } addToSymbolTable(globals, builtinGlobals, ts.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0); getSymbolLinks(undefinedSymbol).type = undefinedWideningType; - getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments"); + getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments", 0, true); getSymbolLinks(unknownSymbol).type = unknownType; - globalArrayType = getGlobalType("Array", 1); - globalObjectType = getGlobalType("Object"); - globalFunctionType = getGlobalType("Function"); - globalStringType = getGlobalType("String"); - globalNumberType = getGlobalType("Number"); - globalBooleanType = getGlobalType("Boolean"); - globalRegExpType = getGlobalType("RegExp"); - jsxElementType = getExportedTypeFromNamespace("JSX", JsxNames.Element); - getGlobalClassDecoratorType = ts.memoize(function () { return getGlobalType("ClassDecorator"); }); - getGlobalPropertyDecoratorType = ts.memoize(function () { return getGlobalType("PropertyDecorator"); }); - getGlobalMethodDecoratorType = ts.memoize(function () { return getGlobalType("MethodDecorator"); }); - getGlobalParameterDecoratorType = ts.memoize(function () { return getGlobalType("ParameterDecorator"); }); - getGlobalTypedPropertyDescriptorType = ts.memoize(function () { return getGlobalType("TypedPropertyDescriptor", 1); }); - getGlobalESSymbolConstructorSymbol = ts.memoize(function () { return getGlobalValueSymbol("Symbol"); }); - getGlobalPromiseType = ts.memoize(function () { return getGlobalType("Promise", 1); }); - tryGetGlobalPromiseType = ts.memoize(function () { return getGlobalSymbol("Promise", 793064, undefined) && getGlobalPromiseType(); }); - getGlobalPromiseLikeType = ts.memoize(function () { return getGlobalType("PromiseLike", 1); }); - getInstantiatedGlobalPromiseLikeType = ts.memoize(createInstantiatedPromiseLikeType); - getGlobalPromiseConstructorSymbol = ts.memoize(function () { return getGlobalValueSymbol("Promise"); }); - tryGetGlobalPromiseConstructorSymbol = ts.memoize(function () { return getGlobalSymbol("Promise", 107455, undefined) && getGlobalPromiseConstructorSymbol(); }); - getGlobalPromiseConstructorLikeType = ts.memoize(function () { return getGlobalType("PromiseConstructorLike"); }); - getGlobalThenableType = ts.memoize(createThenableType); - getGlobalTemplateStringsArrayType = ts.memoize(function () { return getGlobalType("TemplateStringsArray"); }); - if (languageVersion >= 2) { - getGlobalESSymbolType = ts.memoize(function () { return getGlobalType("Symbol"); }); - getGlobalIterableType = ts.memoize(function () { return getGlobalType("Iterable", 1); }); - getGlobalIteratorType = ts.memoize(function () { return getGlobalType("Iterator", 1); }); - getGlobalIterableIteratorType = ts.memoize(function () { return getGlobalType("IterableIterator", 1); }); - } - else { - getGlobalESSymbolType = ts.memoize(function () { return emptyObjectType; }); - getGlobalIterableType = ts.memoize(function () { return emptyGenericType; }); - getGlobalIteratorType = ts.memoize(function () { return emptyGenericType; }); - getGlobalIterableIteratorType = ts.memoize(function () { return emptyGenericType; }); - } + globalArrayType = getGlobalType("Array", 1, true); + globalObjectType = getGlobalType("Object", 0, true); + globalFunctionType = getGlobalType("Function", 0, true); + globalStringType = getGlobalType("String", 0, true); + globalNumberType = getGlobalType("Number", 0, true); + globalBooleanType = getGlobalType("Boolean", 0, true); + globalRegExpType = getGlobalType("RegExp", 0, true); anyArrayType = createArrayType(anyType); autoArrayType = createArrayType(autoType); - var symbol = getGlobalSymbol("ReadonlyArray", 793064, undefined); - globalReadonlyArrayType = symbol && getTypeOfGlobalSymbol(symbol, 1); + globalReadonlyArrayType = getGlobalTypeOrUndefined("ReadonlyArray", 1); anyReadonlyArrayType = globalReadonlyArrayType ? createTypeFromGenericGlobalType(globalReadonlyArrayType, [anyType]) : anyArrayType; - if (compilerOptions.importHelpers && firstFileRequestingExternalHelpers) { - var helpersModule = resolveExternalModule(firstFileRequestingExternalHelpers, ts.externalHelpersModuleNameText, ts.Diagnostics.Cannot_find_module_0, undefined); - if (helpersModule) { - var exports = helpersModule.exports; - if (requestedExternalEmitHelpers & 1024 && languageVersion < 2) { - verifyHelperSymbol(exports, "__extends", 107455); - } - if (requestedExternalEmitHelpers & 16384 && - (languageVersion < 5 || compilerOptions.jsx === 2)) { - verifyHelperSymbol(exports, "__assign", 107455); - } - if (languageVersion < 5 && requestedExternalEmitHelpers & 32768) { - verifyHelperSymbol(exports, "__rest", 107455); - } - if (requestedExternalEmitHelpers & 2048) { - verifyHelperSymbol(exports, "__decorate", 107455); - if (compilerOptions.emitDecoratorMetadata) { - verifyHelperSymbol(exports, "__metadata", 107455); - } - } - if (requestedExternalEmitHelpers & 4096) { - verifyHelperSymbol(exports, "__param", 107455); - } - if (requestedExternalEmitHelpers & 8192) { - verifyHelperSymbol(exports, "__awaiter", 107455); - if (languageVersion < 2) { - verifyHelperSymbol(exports, "__generator", 107455); + globalThisType = getGlobalTypeOrUndefined("ThisType", 1); + } + function checkExternalEmitHelpers(location, helpers) { + if ((requestedExternalEmitHelpers & helpers) !== helpers && compilerOptions.importHelpers) { + var sourceFile = ts.getSourceFileOfNode(location); + if (ts.isEffectiveExternalModule(sourceFile, compilerOptions) && !ts.isInAmbientContext(location)) { + var helpersModule = resolveHelpersModule(sourceFile, location); + if (helpersModule !== unknownSymbol) { + var uncheckedHelpers = helpers & ~requestedExternalEmitHelpers; + for (var helper = 1; helper <= 8192; helper <<= 1) { + if (uncheckedHelpers & helper) { + var name = getHelperName(helper); + var symbol = getSymbol(helpersModule.exports, ts.escapeIdentifier(name), 107455); + if (!symbol) { + error(location, ts.Diagnostics.This_syntax_requires_an_imported_helper_named_1_but_module_0_has_no_exported_member_1, ts.externalHelpersModuleNameText, name); + } + } } } + requestedExternalEmitHelpers |= helpers; } } } - function verifyHelperSymbol(symbols, name, meaning) { - var symbol = getSymbol(symbols, ts.escapeIdentifier(name), meaning); - if (!symbol) { - error(undefined, ts.Diagnostics.Module_0_has_no_exported_member_1, ts.externalHelpersModuleNameText, name); + function getHelperName(helper) { + switch (helper) { + case 1: return "__extends"; + case 2: return "__assign"; + case 4: return "__rest"; + case 8: return "__decorate"; + case 16: return "__metadata"; + case 32: return "__param"; + case 64: return "__awaiter"; + case 128: return "__generator"; + case 256: return "__values"; + case 512: return "__read"; + case 1024: return "__spread"; + case 2048: return "__asyncGenerator"; + case 4096: return "__asyncDelegator"; + case 8192: return "__asyncValues"; + default: ts.Debug.fail("Unrecognized helper."); } } - function createInstantiatedPromiseLikeType() { - var promiseLikeType = getGlobalPromiseLikeType(); - if (promiseLikeType !== emptyGenericType) { - return createTypeReference(promiseLikeType, [anyType]); + function resolveHelpersModule(node, errorNode) { + if (!externalHelpersModule) { + externalHelpersModule = resolveExternalModule(node, ts.externalHelpersModuleNameText, ts.Diagnostics.This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found, errorNode) || unknownSymbol; } - return emptyObjectType; - } - function createThenableType() { - var thenPropertySymbol = createSymbol(67108864 | 4, "then"); - getSymbolLinks(thenPropertySymbol).type = globalFunctionType; - var thenableType = createObjectType(16); - thenableType.properties = [thenPropertySymbol]; - thenableType.members = createSymbolTable(thenableType.properties); - thenableType.callSignatures = []; - thenableType.constructSignatures = []; - return thenableType; + return externalHelpersModule; } function checkGrammarDecorators(node) { if (!node.decorators) { return false; } if (!ts.nodeCanBeDecorated(node)) { - if (node.kind === 149 && !ts.nodeIsPresent(node.body)) { + if (node.kind === 150 && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 151 || node.kind === 152) { + else if (node.kind === 152 || node.kind === 153) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -35273,16 +38321,16 @@ var ts; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; if (modifier.kind !== 130) { - if (node.kind === 146 || node.kind === 148) { + if (node.kind === 147 || node.kind === 149) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 155) { + if (node.kind === 156) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 75: - if (node.kind !== 229 && node.parent.kind === 226) { + if (node.kind !== 231 && node.parent.kind === 228) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(75)); } break; @@ -35308,7 +38356,7 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 231 || node.parent.kind === 261) { + else if (node.parent.kind === 233 || node.parent.kind === 264) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128) { @@ -35331,10 +38379,10 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 231 || node.parent.kind === 261) { + else if (node.parent.kind === 233 || node.parent.kind === 264) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 144) { + else if (node.kind === 145) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128) { @@ -35347,7 +38395,7 @@ var ts; if (flags & 64) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 147 && node.kind !== 146 && node.kind !== 155 && node.kind !== 144) { + else if (node.kind !== 148 && node.kind !== 147 && node.kind !== 156 && node.kind !== 145) { return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } flags |= 64; @@ -35366,10 +38414,10 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } - else if (node.parent.kind === 226) { + else if (node.parent.kind === 228) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 144) { + else if (node.kind === 145) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1; @@ -35381,13 +38429,13 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.parent.kind === 226) { + else if (node.parent.kind === 228) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 144) { + else if (node.kind === 145) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 231) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 233) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 2; @@ -35397,14 +38445,14 @@ var ts; if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 226) { - if (node.kind !== 149 && - node.kind !== 147 && - node.kind !== 151 && - node.kind !== 152) { + if (node.kind !== 228) { + if (node.kind !== 150 && + node.kind !== 148 && + node.kind !== 152 && + node.kind !== 153) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 226 && ts.getModifierFlags(node.parent) & 128)) { + if (!(node.parent.kind === 228 && ts.getModifierFlags(node.parent) & 128)) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32) { @@ -35423,7 +38471,7 @@ var ts; else if (flags & 2 || ts.isInAmbientContext(node.parent)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 144) { + else if (node.kind === 145) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256; @@ -35431,7 +38479,7 @@ var ts; break; } } - if (node.kind === 150) { + if (node.kind === 151) { if (flags & 32) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -35446,13 +38494,13 @@ var ts; } return; } - else if ((node.kind === 235 || node.kind === 234) && flags & 2) { + else if ((node.kind === 237 || node.kind === 236) && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 144 && (flags & 92) && ts.isBindingPattern(node.name)) { + else if (node.kind === 145 && (flags & 92) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 144 && (flags & 92) && node.dotDotDotToken) { + else if (node.kind === 145 && (flags & 92) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256) { @@ -35468,37 +38516,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 151: case 152: - case 150: - case 147: - case 146: - case 149: + case 153: + case 151: case 148: - case 155: - case 230: - case 235: - case 234: - case 241: - case 240: - case 184: + case 147: + case 150: + case 149: + case 156: + case 232: + case 237: + case 236: + case 243: + case 242: case 185: - case 144: + case 186: + case 145: return false; default: - if (node.parent.kind === 231 || node.parent.kind === 261) { + if (node.parent.kind === 233 || node.parent.kind === 264) { return false; } switch (node.kind) { - case 225: - return nodeHasAnyModifiersExcept(node, 119); - case 226: - return nodeHasAnyModifiersExcept(node, 116); case 227: - case 205: + return nodeHasAnyModifiersExcept(node, 119); case 228: - return true; + return nodeHasAnyModifiersExcept(node, 116); case 229: + case 207: + case 230: + return true; + case 231: return nodeHasAnyModifiersExcept(node, 75); default: ts.Debug.fail(); @@ -35511,14 +38559,11 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 149: - case 225: - case 184: + case 150: + case 227: case 185: - if (!node.asteriskToken) { - return false; - } - break; + case 186: + return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); } @@ -35575,8 +38620,12 @@ var ts; return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarTypeParameterList(node.typeParameters, file) || checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); } + function checkGrammarClassLikeDeclaration(node) { + var file = ts.getSourceFileOfNode(node); + return checkGrammarClassDeclarationHeritageClauses(node) || checkGrammarTypeParameterList(node.typeParameters, file); + } function checkGrammarArrowFunction(node, file) { - if (node.kind === 185) { + if (node.kind === 186) { var arrowFunction = node; var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; @@ -35611,7 +38660,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 134 && parameter.type.kind !== 132) { + if (parameter.type.kind !== 135 && parameter.type.kind !== 132) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); } if (!node.type) { @@ -35638,7 +38687,7 @@ var ts; var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 198) { + if (arg.kind === 199) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -35708,28 +38757,25 @@ var ts; return false; } function checkGrammarComputedPropertyName(node) { - if (node.kind !== 142) { + if (node.kind !== 143) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 192 && computedPropertyName.expression.operatorToken.kind === 25) { + if (computedPropertyName.expression.kind === 193 && computedPropertyName.expression.operatorToken.kind === 25) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 225 || - node.kind === 184 || - node.kind === 149); + ts.Debug.assert(node.kind === 227 || + node.kind === 185 || + node.kind === 150); if (ts.isInAmbientContext(node)) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } if (!node.body) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.An_overload_signature_cannot_be_declared_as_a_generator); } - if (languageVersion < 2) { - return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher); - } } } function checkGrammarForInvalidQuestionMark(questionToken, message) { @@ -35745,87 +38791,87 @@ var ts; var GetOrSetAccessor = GetAccessor | SetAccessor; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 259) { + if (prop.kind === 262) { continue; } - var name_27 = prop.name; - if (name_27.kind === 142) { - checkGrammarComputedPropertyName(name_27); + var name = prop.name; + if (name.kind === 143) { + checkGrammarComputedPropertyName(name); } - if (prop.kind === 258 && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 261 && !inDestructuring && prop.objectAssignmentInitializer) { return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); } if (prop.modifiers) { for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { var mod = _c[_b]; - if (mod.kind !== 119 || prop.kind !== 149) { + if (mod.kind !== 119 || prop.kind !== 150) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } } var currentKind = void 0; - if (prop.kind === 257 || prop.kind === 258) { + if (prop.kind === 260 || prop.kind === 261) { checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); - if (name_27.kind === 8) { - checkGrammarNumericLiteral(name_27); + if (name.kind === 8) { + checkGrammarNumericLiteral(name); } currentKind = Property; } - else if (prop.kind === 149) { + else if (prop.kind === 150) { currentKind = Property; } - else if (prop.kind === 151) { + else if (prop.kind === 152) { currentKind = GetAccessor; } - else if (prop.kind === 152) { + else if (prop.kind === 153) { currentKind = SetAccessor; } else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - var effectiveName = ts.getPropertyNameForPropertyNameNode(name_27); + var effectiveName = ts.getPropertyNameForPropertyNameNode(name); if (effectiveName === undefined) { continue; } - if (!seen[effectiveName]) { - seen[effectiveName] = currentKind; + var existingKind = seen.get(effectiveName); + if (!existingKind) { + seen.set(effectiveName, currentKind); } else { - var existingKind = seen[effectiveName]; if (currentKind === Property && existingKind === Property) { - grammarErrorOnNode(name_27, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name_27)); + grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name)); } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[effectiveName] = currentKind | existingKind; + seen.set(effectiveName, currentKind | existingKind); } else { - return grammarErrorOnNode(name_27, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); } } else { - return grammarErrorOnNode(name_27, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); } } } } function checkGrammarJsxElement(node) { var seen = ts.createMap(); - for (var _i = 0, _a = node.attributes; _i < _a.length; _i++) { + for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 251) { + if (attr.kind === 254) { continue; } var jsxAttr = attr; - var name_28 = jsxAttr.name; - if (!seen[name_28.text]) { - seen[name_28.text] = true; + var name = jsxAttr.name; + if (!seen.get(name.text)) { + seen.set(name.text, true); } else { - return grammarErrorOnNode(name_28, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); + return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } var initializer = jsxAttr.initializer; - if (initializer && initializer.kind === 252 && !initializer.expression) { + if (initializer && initializer.kind === 255 && !initializer.expression) { return grammarErrorOnNode(jsxAttr.initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -35834,7 +38880,12 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 224) { + if (forInOrOfStatement.kind === 215 && forInOrOfStatement.awaitModifier) { + if ((forInOrOfStatement.flags & 16384) === 0) { + return grammarErrorOnNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); + } + } + if (forInOrOfStatement.initializer.kind === 226) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -35842,20 +38893,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 212 + var diagnostic = forInOrOfStatement.kind === 214 ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 212 + var diagnostic = forInOrOfStatement.kind === 214 ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 212 + var diagnostic = forInOrOfStatement.kind === 214 ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -35875,15 +38926,18 @@ var ts; else if (accessor.body === undefined && !(ts.getModifierFlags(accessor) & 128)) { return grammarErrorAtPos(ts.getSourceFileOfNode(accessor), accessor.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } + else if (accessor.body && ts.getModifierFlags(accessor) & 128) { + return grammarErrorOnNode(accessor, ts.Diagnostics.An_abstract_accessor_cannot_have_an_implementation); + } else if (accessor.typeParameters) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } else if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, kind === 151 ? + return grammarErrorOnNode(accessor.name, kind === 152 ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - else if (kind === 152) { + else if (kind === 153) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -35902,10 +38956,10 @@ var ts; } } function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 151 ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 152 ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 151 ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 152 ? 1 : 2)) { return ts.getThisParameter(accessor); } } @@ -35920,7 +38974,7 @@ var ts; checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 176) { + if (node.parent.kind === 177) { if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) { return true; } @@ -35936,10 +38990,10 @@ var ts; return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol); } } - else if (node.parent.kind === 227) { + else if (node.parent.kind === 229) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol); } - else if (node.parent.kind === 161) { + else if (node.parent.kind === 162) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol); } } @@ -35950,9 +39004,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 219: + case 221: if (node.label && current.label.text === node.label.text) { - var isMisplacedContinueLabel = node.kind === 214 + var isMisplacedContinueLabel = node.kind === 216 && !ts.isIterationStatement(current.statement, true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -35960,8 +39014,8 @@ var ts; return false; } break; - case 218: - if (node.kind === 215 && !node.label) { + case 220: + if (node.kind === 217 && !node.label) { return false; } break; @@ -35974,13 +39028,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 215 + var message = node.kind === 217 ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 215 + var message = node.kind === 217 ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -35992,7 +39046,7 @@ var ts; if (node !== ts.lastOrUndefined(elements)) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } - if (node.name.kind === 173 || node.name.kind === 172) { + if (node.name.kind === 174 || node.name.kind === 173) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } if (node.initializer) { @@ -36002,11 +39056,11 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return expr.kind === 9 || expr.kind === 8 || - expr.kind === 190 && expr.operator === 37 && + expr.kind === 191 && expr.operator === 37 && expr.operand.kind === 8; } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 212 && node.parent.parent.kind !== 213) { + if (node.parent.parent.kind !== 214 && node.parent.parent.kind !== 215) { if (ts.isInAmbientContext(node)) { if (node.initializer) { if (ts.isConst(node) && !node.type) { @@ -36033,9 +39087,29 @@ var ts; } } } + if (compilerOptions.module !== ts.ModuleKind.ES2015 && compilerOptions.module !== ts.ModuleKind.System && !compilerOptions.noEmit && + !ts.isInAmbientContext(node.parent.parent) && ts.hasModifier(node.parent.parent, 1)) { + checkESModuleMarker(node.name); + } var checkLetConstNames = (ts.isLet(node) || ts.isConst(node)); return checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name); } + function checkESModuleMarker(name) { + if (name.kind === 70) { + if (ts.unescapeIdentifier(name.text) === "__esModule") { + return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules); + } + } + else { + var elements = name.elements; + for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) { + var element = elements_2[_i]; + if (!ts.isOmittedExpression(element)) { + return checkESModuleMarker(element.name); + } + } + } + } function checkGrammarNameInLetOrConstDeclarations(name) { if (name.kind === 70) { if (name.originalKeywordKind === 109) { @@ -36044,8 +39118,8 @@ var ts; } else { var elements = name.elements; - for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) { - var element = elements_2[_i]; + for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) { + var element = elements_3[_i]; if (!ts.isOmittedExpression(element)) { checkGrammarNameInLetOrConstDeclarations(element.name); } @@ -36063,15 +39137,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 208: - case 209: case 210: - case 217: case 211: case 212: - case 213: - return false; case 219: + case 213: + case 214: + case 215: + return false; + case 221: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -36086,6 +39160,13 @@ var ts; } } } + function checkGrammarMetaProperty(node) { + if (node.keywordToken === 93) { + if (node.name.text !== "target") { + return grammarErrorOnNode(node.name, ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, node.name.text, ts.tokenToString(node.keywordToken), "target"); + } + } + } function hasParseDiagnostics(sourceFile) { return sourceFile.parseDiagnostics.length > 0; } @@ -36126,7 +39207,7 @@ var ts; return true; } } - else if (node.parent.kind === 227) { + else if (node.parent.kind === 229) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -36134,7 +39215,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 161) { + else if (node.parent.kind === 162) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -36147,13 +39228,13 @@ var ts; } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 227 || - node.kind === 228 || + if (node.kind === 229 || + node.kind === 230 || + node.kind === 237 || + node.kind === 236 || + node.kind === 243 || + node.kind === 242 || node.kind === 235 || - node.kind === 234 || - node.kind === 241 || - node.kind === 240 || - node.kind === 233 || ts.getModifierFlags(node) & (2 | 1 | 512)) { return false; } @@ -36162,7 +39243,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 205) { + if (ts.isDeclaration(decl) || decl.kind === 207) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -36181,7 +39262,7 @@ var ts; if (!links.hasReportedStatementInAmbientContext && ts.isFunctionLike(node.parent)) { return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } - if (node.parent.kind === 204 || node.parent.kind === 231 || node.parent.kind === 261) { + if (node.parent.kind === 206 || node.parent.kind === 233 || node.parent.kind === 264) { var links_1 = getNodeLinks(node.parent); if (!links_1.hasReportedStatementInAmbientContext) { return links_1.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); @@ -36192,8 +39273,22 @@ var ts; } } function checkGrammarNumericLiteral(node) { - if (node.isOctalLiteral && languageVersion >= 1) { - return grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); + if (node.numericLiteralFlags & 4) { + var diagnosticMessage = void 0; + if (languageVersion >= 1) { + diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; + } + else if (ts.isChildOfNodeWithKind(node, 172)) { + diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; + } + else if (ts.isChildOfNodeWithKind(node, 263)) { + diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; + } + if (diagnosticMessage) { + var withMinus = ts.isPrefixUnaryExpression(node.parent) && node.parent.operator === 37; + var literal = (withMinus ? "-" : "") + "0o" + node.text; + return grammarErrorOnNode(withMinus ? node.parent : node, diagnosticMessage, literal); + } } } function grammarErrorAfterFirstToken(node, message, arg0, arg1, arg2) { @@ -36206,11 +39301,11 @@ var ts; } function getAmbientModules() { var result = []; - for (var sym in globals) { + globals.forEach(function (global, sym) { if (ambientModuleSymbolRegex.test(sym)) { - result.push(globals[sym]); + result.push(global); } - } + }); return result; } } @@ -36218,55 +39313,359 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - ; - var nodeEdgeTraversalMap = ts.createMap((_a = {}, - _a[141] = [ - { name: "left", test: ts.isEntityName }, - { name: "right", test: ts.isIdentifier } - ], - _a[145] = [ - { name: "expression", test: ts.isLeftHandSideExpression } - ], - _a[182] = [ - { name: "type", test: ts.isTypeNode }, - { name: "expression", test: ts.isUnaryExpression } - ], - _a[200] = [ - { name: "expression", test: ts.isExpression }, - { name: "type", test: ts.isTypeNode } - ], - _a[201] = [ - { name: "expression", test: ts.isLeftHandSideExpression } - ], - _a[229] = [ - { name: "decorators", test: ts.isDecorator }, - { name: "modifiers", test: ts.isModifier }, - { name: "name", test: ts.isIdentifier }, - { name: "members", test: ts.isEnumMember } - ], - _a[230] = [ - { name: "decorators", test: ts.isDecorator }, - { name: "modifiers", test: ts.isModifier }, - { name: "name", test: ts.isModuleName }, - { name: "body", test: ts.isModuleBody } - ], - _a[231] = [ - { name: "statements", test: ts.isStatement } - ], - _a[234] = [ - { name: "decorators", test: ts.isDecorator }, - { name: "modifiers", test: ts.isModifier }, - { name: "name", test: ts.isIdentifier }, - { name: "moduleReference", test: ts.isModuleReference } - ], - _a[245] = [ - { name: "expression", test: ts.isExpression, optional: true } - ], - _a[260] = [ - { name: "name", test: ts.isPropertyName }, - { name: "initializer", test: ts.isExpression, optional: true, parenthesize: ts.parenthesizeExpressionForList } - ], - _a)); + function visitNode(node, visitor, test, lift) { + if (node === undefined || visitor === undefined) { + return node; + } + ts.aggregateTransformFlags(node); + var visited = visitor(node); + if (visited === node) { + return node; + } + var visitedNode; + if (visited === undefined) { + return undefined; + } + else if (ts.isArray(visited)) { + visitedNode = (lift || extractSingleNode)(visited); + } + else { + visitedNode = visited; + } + ts.Debug.assertNode(visitedNode, test); + ts.aggregateTransformFlags(visitedNode); + return visitedNode; + } + ts.visitNode = visitNode; + function visitNodes(nodes, visitor, test, start, count) { + if (nodes === undefined || visitor === undefined) { + return nodes; + } + var updated; + var length = nodes.length; + if (start === undefined || start < 0) { + start = 0; + } + if (count === undefined || count > length - start) { + count = length - start; + } + if (start > 0 || count < length) { + updated = ts.createNodeArray([], nodes.hasTrailingComma && start + count === length); + } + for (var i = 0; i < count; i++) { + var node = nodes[i + start]; + ts.aggregateTransformFlags(node); + var visited = node !== undefined ? visitor(node) : undefined; + if (updated !== undefined || visited === undefined || visited !== node) { + if (updated === undefined) { + updated = ts.createNodeArray(nodes.slice(0, i), nodes.hasTrailingComma); + ts.setTextRange(updated, nodes); + } + if (visited) { + if (ts.isArray(visited)) { + for (var _i = 0, visited_1 = visited; _i < visited_1.length; _i++) { + var visitedNode = visited_1[_i]; + ts.Debug.assertNode(visitedNode, test); + ts.aggregateTransformFlags(visitedNode); + updated.push(visitedNode); + } + } + else { + ts.Debug.assertNode(visited, test); + ts.aggregateTransformFlags(visited); + updated.push(visited); + } + } + } + } + return updated || nodes; + } + ts.visitNodes = visitNodes; + function visitLexicalEnvironment(statements, visitor, context, start, ensureUseStrict) { + context.startLexicalEnvironment(); + statements = visitNodes(statements, visitor, ts.isStatement, start); + if (ensureUseStrict && !ts.startsWithUseStrict(statements)) { + statements = ts.setTextRange(ts.createNodeArray([ts.createStatement(ts.createLiteral("use strict"))].concat(statements)), statements); + } + var declarations = context.endLexicalEnvironment(); + return ts.setTextRange(ts.createNodeArray(ts.concatenate(statements, declarations)), statements); + } + ts.visitLexicalEnvironment = visitLexicalEnvironment; + function visitParameterList(nodes, visitor, context, nodesVisitor) { + if (nodesVisitor === void 0) { nodesVisitor = visitNodes; } + context.startLexicalEnvironment(); + var updated = nodesVisitor(nodes, visitor, ts.isParameterDeclaration); + context.suspendLexicalEnvironment(); + return updated; + } + ts.visitParameterList = visitParameterList; + function visitFunctionBody(node, visitor, context) { + context.resumeLexicalEnvironment(); + var updated = visitNode(node, visitor, ts.isConciseBody); + var declarations = context.endLexicalEnvironment(); + if (ts.some(declarations)) { + var block = ts.convertToFunctionBody(updated); + var statements = ts.mergeLexicalEnvironment(block.statements, declarations); + return ts.updateBlock(block, statements); + } + return updated; + } + ts.visitFunctionBody = visitFunctionBody; + function visitEachChild(node, visitor, context, nodesVisitor, tokenVisitor) { + if (nodesVisitor === void 0) { nodesVisitor = visitNodes; } + if (node === undefined) { + return undefined; + } + var kind = node.kind; + if ((kind > 0 && kind <= 141) || kind === 168) { + return node; + } + switch (node.kind) { + case 205: + case 208: + case 199: + case 224: + case 297: + case 246: + return node; + case 142: + return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); + case 143: + return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); + case 159: + return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 160: + return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 154: + return ts.updateCallSignatureDeclaration(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 155: + return ts.updateConstructSignatureDeclaration(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 149: + return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); + case 156: + return ts.updateIndexSignatureDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 145: + return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + case 146: + return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); + case 158: + return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); + case 157: + return ts.updateTypePredicateNode(node, visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 161: + return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); + case 162: + return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor)); + case 163: + return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); + case 164: + return ts.updateTypleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); + case 165: + case 166: + return ts.updateUnionOrIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); + case 167: + throw ts.Debug.fail("not implemented."); + case 169: + return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); + case 170: + return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); + case 171: + return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameter), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); + case 172: + return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); + case 144: + return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); + case 147: + return ts.updatePropertySignature(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + case 148: + return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + case 150: + return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 151: + return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); + case 152: + return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 153: + return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); + case 173: + return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); + case 174: + return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); + case 175: + return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); + case 176: + return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); + case 177: + return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); + case 178: + return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier)); + case 179: + return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); + case 180: + return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); + case 181: + return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); + case 182: + return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); + case 183: + return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); + case 184: + return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); + case 185: + return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 186: + return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 187: + return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); + case 188: + return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); + case 189: + return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); + case 190: + return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); + case 193: + return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression)); + case 191: + return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); + case 192: + return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); + case 194: + return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.whenFalse, visitor, ts.isExpression)); + case 195: + return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); + case 196: + return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); + case 197: + return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); + case 198: + return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); + case 200: + return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); + case 201: + return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); + case 202: + return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); + case 204: + return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); + case 206: + return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + case 207: + return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); + case 209: + return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression)); + case 210: + return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); + case 211: + return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); + case 212: + return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 213: + return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 214: + return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 215: + return ts.updateForOf(node, node.awaitModifier, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 216: + return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); + case 217: + return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); + case 218: + return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); + case 219: + return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 220: + return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); + case 221: + return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 222: + return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); + case 223: + return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); + case 225: + return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + case 226: + return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); + case 227: + return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 228: + return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); + case 231: + return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); + case 232: + return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); + case 233: + return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + case 234: + return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); + case 236: + return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); + case 237: + return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); + case 238: + return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings)); + case 239: + return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); + case 240: + return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); + case 241: + return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); + case 242: + return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); + case 243: + return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); + case 244: + return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); + case 245: + return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); + case 247: + return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); + case 248: + return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); + case 253: + return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); + case 249: + return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); + case 250: + return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); + case 251: + return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); + case 252: + return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); + case 254: + return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); + case 255: + return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); + case 256: + return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); + case 257: + return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + case 258: + return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); + case 259: + return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); + case 260: + return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); + case 261: + return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); + case 262: + return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); + case 263: + return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); + case 264: + return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); + case 295: + return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); + default: + return node; + } + } + ts.visitEachChild = visitEachChild; + function extractSingleNode(nodes) { + ts.Debug.assert(nodes.length <= 1, "Too many nodes written to output."); + return ts.singleOrUndefined(nodes); + } +})(ts || (ts = {})); +(function (ts) { function reduceNode(node, f, initial) { return node ? f(initial, node) : initial; } @@ -36280,41 +39679,45 @@ var ts; var reduceNodes = cbNodeArray ? reduceNodeArray : ts.reduceLeft; var cbNodes = cbNodeArray || cbNode; var kind = node.kind; - if ((kind > 0 && kind <= 140)) { + if ((kind > 0 && kind <= 141)) { return initial; } - if ((kind >= 156 && kind <= 171)) { + if ((kind >= 157 && kind <= 172)) { return initial; } var result = initial; switch (node.kind) { - case 203: - case 206: - case 198: - case 222: - case 293: + case 205: + case 208: + case 199: + case 224: + case 294: break; case 142: - result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.left, cbNode, result); + result = reduceNode(node.right, cbNode, result); break; - case 144: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.type, cbNode, result); - result = reduceNode(node.initializer, cbNode, result); + case 143: + result = reduceNode(node.expression, cbNode, result); break; case 145: - result = reduceNode(node.expression, cbNode, result); - break; - case 147: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 149: + case 146: + result = reduceNode(node.expression, cbNode, result); + break; + case 148: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + case 150: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -36323,53 +39726,48 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 150: - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.body, cbNode, result); - break; case 151: - result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; case 152: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.body, cbNode, result); + break; + case 153: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.body, cbNode, result); break; - case 172: case 173: + case 174: result = reduceNodes(node.elements, cbNodes, result); break; - case 174: + case 175: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 175: + case 176: result = reduceNodes(node.elements, cbNodes, result); break; - case 176: - result = reduceNodes(node.properties, cbNodes, result); - break; case 177: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.properties, cbNodes, result); break; case 178: result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.argumentExpression, cbNode, result); + result = reduceNode(node.name, cbNode, result); break; case 179: result = reduceNode(node.expression, cbNode, result); - result = reduceNodes(node.typeArguments, cbNodes, result); - result = reduceNodes(node.arguments, cbNodes, result); + result = reduceNode(node.argumentExpression, cbNode, result); break; case 180: result = reduceNode(node.expression, cbNode, result); @@ -36377,10 +39775,19 @@ var ts; result = reduceNodes(node.arguments, cbNodes, result); break; case 181: + result = reduceNode(node.expression, cbNode, result); + result = reduceNodes(node.typeArguments, cbNodes, result); + result = reduceNodes(node.arguments, cbNodes, result); + break; + case 182: result = reduceNode(node.tag, cbNode, result); result = reduceNode(node.template, cbNode, result); break; - case 184: + case 183: + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.expression, cbNode, result); + break; + case 185: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); @@ -36388,117 +39795,124 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 185: + case 186: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 183: - case 186: + case 184: case 187: case 188: case 189: - case 195: + case 190: case 196: - case 201: + case 197: + case 202: result = reduceNode(node.expression, cbNode, result); break; - case 190: case 191: + case 192: result = reduceNode(node.operand, cbNode, result); break; - case 192: + case 193: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 193: + case 194: result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.whenTrue, cbNode, result); result = reduceNode(node.whenFalse, cbNode, result); break; - case 194: + case 195: result = reduceNode(node.head, cbNode, result); result = reduceNodes(node.templateSpans, cbNodes, result); break; - case 197: + case 198: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 199: + case 200: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); break; + case 201: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.type, cbNode, result); + break; case 202: + result = reduceNode(node.expression, cbNode, result); + break; + case 204: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.literal, cbNode, result); break; - case 204: + case 206: result = reduceNodes(node.statements, cbNodes, result); break; - case 205: + case 207: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.declarationList, cbNode, result); break; - case 207: + case 209: result = reduceNode(node.expression, cbNode, result); break; - case 208: + case 210: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.thenStatement, cbNode, result); result = reduceNode(node.elseStatement, cbNode, result); break; - case 209: - result = reduceNode(node.statement, cbNode, result); - result = reduceNode(node.expression, cbNode, result); - break; - case 210: - case 217: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.statement, cbNode, result); - break; case 211: + result = reduceNode(node.statement, cbNode, result); + result = reduceNode(node.expression, cbNode, result); + break; + case 212: + case 219: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.statement, cbNode, result); + break; + case 213: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.incrementor, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 212: - case 213: + case 214: + case 215: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 216: - case 220: + case 218: + case 222: result = reduceNode(node.expression, cbNode, result); break; - case 218: + case 220: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.caseBlock, cbNode, result); break; - case 219: + case 221: result = reduceNode(node.label, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 221: + case 223: result = reduceNode(node.tryBlock, cbNode, result); result = reduceNode(node.catchClause, cbNode, result); result = reduceNode(node.finallyBlock, cbNode, result); break; - case 223: + case 225: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 224: + case 226: result = reduceNodes(node.declarations, cbNodes, result); break; - case 225: + case 227: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -36507,7 +39921,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 226: + case 228: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -36515,455 +39929,145 @@ var ts; result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; + case 231: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.members, cbNodes, result); + break; case 232: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.body, cbNode, result); + break; + case 233: + result = reduceNodes(node.statements, cbNodes, result); + break; + case 234: result = reduceNodes(node.clauses, cbNodes, result); break; - case 235: + case 236: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.moduleReference, cbNode, result); + break; + case 237: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.importClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 236: + case 238: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.namedBindings, cbNode, result); break; - case 237: - result = reduceNode(node.name, cbNode, result); - break; - case 238: - case 242: - result = reduceNodes(node.elements, cbNodes, result); - break; case 239: - case 243: - result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); break; case 240: + case 244: + result = reduceNodes(node.elements, cbNodes, result); + break; + case 241: + case 245: + result = reduceNode(node.propertyName, cbNode, result); + result = reduceNode(node.name, cbNode, result); + break; + case 242: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 241: + case 243: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.exportClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 246: + case 247: + result = reduceNode(node.expression, cbNode, result); + break; + case 248: result = reduceNode(node.openingElement, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingElement, cbNode, result); break; - case 247: - case 248: - result = reduceNode(node.tagName, cbNode, result); - result = reduceNodes(node.attributes, cbNodes, result); - break; case 249: + case 250: + result = reduceNode(node.tagName, cbNode, result); + result = reduceNode(node.attributes, cbNode, result); + break; + case 253: + result = reduceNodes(node.properties, cbNodes, result); + break; + case 251: result = reduceNode(node.tagName, cbNode, result); break; - case 250: + case 252: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 251: - result = reduceNode(node.expression, cbNode, result); - break; - case 252: - result = reduceNode(node.expression, cbNode, result); - break; - case 253: - result = reduceNode(node.expression, cbNode, result); case 254: - result = reduceNodes(node.statements, cbNodes, result); + result = reduceNode(node.expression, cbNode, result); break; case 255: - result = reduceNodes(node.types, cbNodes, result); + result = reduceNode(node.expression, cbNode, result); break; case 256: + result = reduceNode(node.expression, cbNode, result); + case 257: + result = reduceNodes(node.statements, cbNodes, result); + break; + case 258: + result = reduceNodes(node.types, cbNodes, result); + break; + case 259: result = reduceNode(node.variableDeclaration, cbNode, result); result = reduceNode(node.block, cbNode, result); break; - case 257: + case 260: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 258: + case 261: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.objectAssignmentInitializer, cbNode, result); break; - case 259: + case 262: result = reduceNode(node.expression, cbNode, result); break; - case 261: + case 263: + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + case 264: result = reduceNodes(node.statements, cbNodes, result); break; - case 294: + case 295: result = reduceNode(node.expression, cbNode, result); break; default: - var edgeTraversalPath = nodeEdgeTraversalMap[kind]; - if (edgeTraversalPath) { - for (var _i = 0, edgeTraversalPath_1 = edgeTraversalPath; _i < edgeTraversalPath_1.length; _i++) { - var edge = edgeTraversalPath_1[_i]; - var value = node[edge.name]; - if (value !== undefined) { - result = ts.isArray(value) - ? reduceNodes(value, cbNodes, result) - : cbNode(result, value); - } - } - } break; } return result; } ts.reduceEachChild = reduceEachChild; - function visitNode(node, visitor, test, optional, lift, parenthesize, parentNode) { - if (node === undefined || visitor === undefined) { - return node; - } - aggregateTransformFlags(node); - var visited = visitor(node); - if (visited === node) { - return node; - } - var visitedNode; - if (visited === undefined) { - if (!optional) { - Debug.failNotOptional(); - } - return undefined; - } - else if (ts.isArray(visited)) { - visitedNode = (lift || extractSingleNode)(visited); - } - else { - visitedNode = visited; - } - if (parenthesize !== undefined) { - visitedNode = parenthesize(visitedNode, parentNode); - } - Debug.assertNode(visitedNode, test); - aggregateTransformFlags(visitedNode); - return visitedNode; - } - ts.visitNode = visitNode; - function visitNodes(nodes, visitor, test, start, count, parenthesize, parentNode) { - if (nodes === undefined) { - return undefined; - } - var updated; - var length = nodes.length; - if (start === undefined || start < 0) { - start = 0; - } - if (count === undefined || count > length - start) { - count = length - start; - } - if (start > 0 || count < length) { - updated = ts.createNodeArray([], undefined, nodes.hasTrailingComma && start + count === length); - } - for (var i = 0; i < count; i++) { - var node = nodes[i + start]; - aggregateTransformFlags(node); - var visited = node !== undefined ? visitor(node) : undefined; - if (updated !== undefined || visited === undefined || visited !== node) { - if (updated === undefined) { - updated = ts.createNodeArray(nodes.slice(0, i), nodes, nodes.hasTrailingComma); - } - if (visited) { - if (ts.isArray(visited)) { - for (var _i = 0, visited_1 = visited; _i < visited_1.length; _i++) { - var visitedNode = visited_1[_i]; - visitedNode = parenthesize - ? parenthesize(visitedNode, parentNode) - : visitedNode; - Debug.assertNode(visitedNode, test); - aggregateTransformFlags(visitedNode); - updated.push(visitedNode); - } - } - else { - var visitedNode = parenthesize - ? parenthesize(visited, parentNode) - : visited; - Debug.assertNode(visitedNode, test); - aggregateTransformFlags(visitedNode); - updated.push(visitedNode); - } - } - } - } - return updated || nodes; - } - ts.visitNodes = visitNodes; - function visitLexicalEnvironment(statements, visitor, context, start, ensureUseStrict) { - context.startLexicalEnvironment(); - statements = visitNodes(statements, visitor, ts.isStatement, start); - if (ensureUseStrict && !ts.startsWithUseStrict(statements)) { - statements = ts.createNodeArray([ts.createStatement(ts.createLiteral("use strict"))].concat(statements), statements); - } - var declarations = context.endLexicalEnvironment(); - return ts.createNodeArray(ts.concatenate(statements, declarations), statements); - } - ts.visitLexicalEnvironment = visitLexicalEnvironment; - function visitParameterList(nodes, visitor, context) { - context.startLexicalEnvironment(); - var updated = visitNodes(nodes, visitor, ts.isParameterDeclaration); - context.suspendLexicalEnvironment(); - return updated; - } - ts.visitParameterList = visitParameterList; - function visitFunctionBody(node, visitor, context) { - context.resumeLexicalEnvironment(); - var updated = visitNode(node, visitor, ts.isConciseBody); - var declarations = context.endLexicalEnvironment(); - if (ts.some(declarations)) { - var block = ts.convertToFunctionBody(updated); - var statements = mergeLexicalEnvironment(block.statements, declarations); - return ts.updateBlock(block, statements); - } - return updated; - } - ts.visitFunctionBody = visitFunctionBody; - function visitEachChild(node, visitor, context) { - if (node === undefined) { - return undefined; - } - var kind = node.kind; - if ((kind > 0 && kind <= 140)) { - return node; - } - if ((kind >= 156 && kind <= 171)) { - return node; - } - switch (node.kind) { - case 203: - case 206: - case 198: - case 222: - return node; - case 142: - return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); - case 144: - return ts.updateParameter(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), node.dotDotDotToken, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true)); - case 147: - return ts.updateProperty(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true)); - case 149: - return ts.updateMethod(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, true), visitFunctionBody(node.body, visitor, context)); - case 150: - return ts.updateConstructor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context), visitFunctionBody(node.body, visitor, context)); - case 151: - return ts.updateGetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, true), visitFunctionBody(node.body, visitor, context)); - case 152: - return ts.updateSetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context), visitFunctionBody(node.body, visitor, context)); - case 172: - return ts.updateObjectBindingPattern(node, visitNodes(node.elements, visitor, ts.isBindingElement)); - case 173: - return ts.updateArrayBindingPattern(node, visitNodes(node.elements, visitor, ts.isArrayBindingElement)); - case 174: - return ts.updateBindingElement(node, node.dotDotDotToken, visitNode(node.propertyName, visitor, ts.isPropertyName, true), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression, true)); - case 175: - return ts.updateArrayLiteral(node, visitNodes(node.elements, visitor, ts.isExpression)); - case 176: - return ts.updateObjectLiteral(node, visitNodes(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 177: - return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier)); - case 178: - return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 179: - return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression)); - case 180: - return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression)); - case 181: - return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); - case 183: - return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); - case 184: - return ts.updateFunctionExpression(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, true), visitFunctionBody(node.body, visitor, context)); - case 185: - return ts.updateArrowFunction(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, true), visitFunctionBody(node.body, visitor, context)); - case 186: - return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); - case 187: - return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); - case 188: - return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); - case 189: - return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); - case 192: - return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression)); - case 190: - return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 191: - return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 193: - return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.whenFalse, visitor, ts.isExpression)); - case 194: - return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), visitNodes(node.templateSpans, visitor, ts.isTemplateSpan)); - case 195: - return ts.updateYield(node, visitNode(node.expression, visitor, ts.isExpression)); - case 196: - return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); - case 197: - return ts.updateClassExpression(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier, true), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), visitNodes(node.members, visitor, ts.isClassElement)); - case 199: - return ts.updateExpressionWithTypeArguments(node, visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 202: - return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); - case 204: - return ts.updateBlock(node, visitNodes(node.statements, visitor, ts.isStatement)); - case 205: - return ts.updateVariableStatement(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 207: - return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression)); - case 208: - return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, false, liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, true, liftToBlock)); - case 209: - return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); - case 210: - return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock)); - case 211: - return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock)); - case 212: - return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock)); - case 213: - return ts.updateForOf(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock)); - case 214: - return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier, true)); - case 215: - return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier, true)); - case 216: - return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression, true)); - case 217: - return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock)); - case 218: - return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); - case 219: - return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock)); - case 220: - return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); - case 221: - return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause, true), visitNode(node.finallyBlock, visitor, ts.isBlock, true)); - case 223: - return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true)); - case 224: - return ts.updateVariableDeclarationList(node, visitNodes(node.declarations, visitor, ts.isVariableDeclaration)); - case 225: - return ts.updateFunctionDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, true), visitFunctionBody(node.body, visitor, context)); - case 226: - return ts.updateClassDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier, true), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), visitNodes(node.members, visitor, ts.isClassElement)); - case 232: - return ts.updateCaseBlock(node, visitNodes(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 235: - return ts.updateImportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause, true), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 236: - return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier, true), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings, true)); - case 237: - return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 238: - return ts.updateNamedImports(node, visitNodes(node.elements, visitor, ts.isImportSpecifier)); - case 239: - return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier, true), visitNode(node.name, visitor, ts.isIdentifier)); - case 240: - return ts.updateExportAssignment(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); - case 241: - return ts.updateExportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports, true), visitNode(node.moduleSpecifier, visitor, ts.isExpression, true)); - case 242: - return ts.updateNamedExports(node, visitNodes(node.elements, visitor, ts.isExportSpecifier)); - case 243: - return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier, true), visitNode(node.name, visitor, ts.isIdentifier)); - case 246: - return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), visitNodes(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 247: - return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNodes(node.attributes, visitor, ts.isJsxAttributeLike)); - case 248: - return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNodes(node.attributes, visitor, ts.isJsxAttributeLike)); - case 249: - return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 250: - return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 251: - return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); - case 252: - return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 253: - return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.statements, visitor, ts.isStatement)); - case 254: - return ts.updateDefaultClause(node, visitNodes(node.statements, visitor, ts.isStatement)); - case 255: - return ts.updateHeritageClause(node, visitNodes(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 256: - return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); - case 257: - return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 258: - return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 259: - return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); - case 261: - return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); - case 294: - return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - default: - var updated = void 0; - var edgeTraversalPath = nodeEdgeTraversalMap[kind]; - if (edgeTraversalPath) { - for (var _i = 0, edgeTraversalPath_2 = edgeTraversalPath; _i < edgeTraversalPath_2.length; _i++) { - var edge = edgeTraversalPath_2[_i]; - var value = node[edge.name]; - if (value !== undefined) { - var visited = ts.isArray(value) - ? visitNodes(value, visitor, edge.test, 0, value.length, edge.parenthesize, node) - : visitNode(value, visitor, edge.test, edge.optional, edge.lift, edge.parenthesize, node); - if (updated !== undefined || visited !== value) { - if (updated === undefined) { - updated = ts.getMutableClone(node); - } - if (visited !== value) { - updated[edge.name] = visited; - } - } - } - } - } - return updated ? ts.updateNode(updated, node) : node; - } - } - ts.visitEachChild = visitEachChild; function mergeLexicalEnvironment(statements, declarations) { if (!ts.some(declarations)) { return statements; } return ts.isNodeArray(statements) - ? ts.createNodeArray(ts.concatenate(statements, declarations), statements) + ? ts.setTextRange(ts.createNodeArray(ts.concatenate(statements, declarations)), statements) : ts.addRange(statements, declarations); } ts.mergeLexicalEnvironment = mergeLexicalEnvironment; - function mergeFunctionBodyLexicalEnvironment(body, declarations) { - if (body && declarations !== undefined && declarations.length > 0) { - if (ts.isBlock(body)) { - return ts.updateBlock(body, ts.createNodeArray(ts.concatenate(body.statements, declarations), body.statements)); - } - else { - return ts.createBlock(ts.createNodeArray([ts.createReturn(body, body)].concat(declarations), body), body, true); - } - } - return body; - } - ts.mergeFunctionBodyLexicalEnvironment = mergeFunctionBodyLexicalEnvironment; function liftToBlock(nodes) { Debug.assert(ts.every(nodes, ts.isStatement), "Cannot lift nodes to a Block."); return ts.singleOrUndefined(nodes) || ts.createBlock(nodes); } ts.liftToBlock = liftToBlock; - function extractSingleNode(nodes) { - Debug.assert(nodes.length <= 1, "Too many nodes written to output."); - return ts.singleOrUndefined(nodes); - } function aggregateTransformFlags(node) { aggregateTransformFlagsForNode(node); return node; @@ -36994,7 +40098,7 @@ var ts; return subtreeFlags; } function aggregateTransformFlagsForSubtree(node) { - if (ts.hasModifier(node, 2) || ts.isTypeNode(node)) { + if (ts.hasModifier(node, 2) || (ts.isTypeNode(node) && node.kind !== 200)) { return 0; } return reduceEachChild(node, 0, aggregateTransformFlagsForChildNode, aggregateTransformFlagsForChildNodes); @@ -37007,9 +40111,6 @@ var ts; } var Debug; (function (Debug) { - Debug.failNotOptional = Debug.shouldAssert(1) - ? function (message) { return Debug.assert(false, message || "Node not optional."); } - : ts.noop; Debug.failBadSyntaxKind = Debug.shouldAssert(1) ? function (node, message) { return Debug.assert(false, message || "Unexpected node.", function () { return "Node " + ts.formatSyntaxKind(node.kind) + " was unexpected."; }); } : ts.noop; @@ -37042,7 +40143,6 @@ var ts; } } })(Debug = ts.Debug || (ts.Debug = {})); - var _a; })(ts || (ts = {})); var ts; (function (ts) { @@ -37051,7 +40151,7 @@ var ts; var value; if (ts.isDestructuringAssignment(node)) { value = node.right; - while (ts.isEmptyObjectLiteralOrArrayLiteral(node.left)) { + while (ts.isEmptyArrayLiteral(node.left) || ts.isEmptyObjectLiteral(node.left)) { if (ts.isDestructuringAssignment(value)) { location = node = value; value = node.right; @@ -37065,6 +40165,7 @@ var ts; var flattenContext = { context: context, level: level, + downlevelIteration: context.getCompilerOptions().downlevelIteration, hoistTempVariables: true, emitExpression: emitExpression, emitBindingOrAssignment: emitBindingOrAssignment, @@ -37099,7 +40200,7 @@ var ts; ts.Debug.assertNode(target, createAssignmentCallback ? ts.isIdentifier : ts.isExpression); var expression = createAssignmentCallback ? createAssignmentCallback(target, value, location) - : ts.createAssignment(ts.visitNode(target, visitor, ts.isExpression), value, location); + : ts.setTextRange(ts.createAssignment(ts.visitNode(target, visitor, ts.isExpression), value), location); expression.original = original; emitExpression(expression); } @@ -37112,6 +40213,7 @@ var ts; var flattenContext = { context: context, level: level, + downlevelIteration: context.getCompilerOptions().downlevelIteration, hoistTempVariables: hoistTempVariables, emitExpression: emitExpression, emitBindingOrAssignment: emitBindingOrAssignment, @@ -37137,10 +40239,11 @@ var ts; } } for (var _i = 0, pendingDeclarations_1 = pendingDeclarations; _i < pendingDeclarations_1.length; _i++) { - var _a = pendingDeclarations_1[_i], pendingExpressions_1 = _a.pendingExpressions, name_29 = _a.name, value = _a.value, location_2 = _a.location, original = _a.original; - var variable = ts.createVariableDeclaration(name_29, undefined, pendingExpressions_1 ? ts.inlineExpressions(ts.append(pendingExpressions_1, value)) : value, location_2); + var _a = pendingDeclarations_1[_i], pendingExpressions_1 = _a.pendingExpressions, name = _a.name, value = _a.value, location = _a.location, original = _a.original; + var variable = ts.createVariableDeclaration(name, undefined, pendingExpressions_1 ? ts.inlineExpressions(ts.append(pendingExpressions_1, value)) : value); variable.original = original; - if (ts.isIdentifier(name_29)) { + ts.setTextRange(variable, location); + if (ts.isIdentifier(name)) { ts.setEmitFlags(variable, 64); } ts.aggregateTransformFlags(variable); @@ -37228,7 +40331,12 @@ var ts; function flattenArrayBindingOrAssignmentPattern(flattenContext, parent, pattern, value, location) { var elements = ts.getElementsOfBindingOrAssignmentPattern(pattern); var numElements = elements.length; - if (numElements !== 1 && (flattenContext.level < 1 || numElements === 0)) { + if (flattenContext.level < 1 && flattenContext.downlevelIteration) { + value = ensureIdentifier(flattenContext, ts.createReadHelper(flattenContext.context, value, numElements > 0 && ts.getRestIndicatorOfBindingOrAssignmentElement(elements[numElements - 1]) + ? undefined + : numElements, location), false, location); + } + else if (numElements !== 1 && (flattenContext.level < 1 || numElements === 0)) { var reuseIdentifierExpressions = !ts.isDeclarationBindingElement(parent) || numElements !== 0; value = ensureIdentifier(flattenContext, value, reuseIdentifierExpressions, location); } @@ -37286,8 +40394,8 @@ var ts; return ts.createElementAccess(value, argumentExpression); } else { - var name_30 = ts.createIdentifier(ts.unescapeIdentifier(propertyName.text)); - return ts.createPropertyAccess(value, name_30); + var name = ts.createIdentifier(ts.unescapeIdentifier(propertyName.text)); + return ts.createPropertyAccess(value, name); } } function ensureIdentifier(flattenContext, value, reuseIdentifierExpressions, location) { @@ -37298,7 +40406,7 @@ var ts; var temp = ts.createTempVariable(undefined); if (flattenContext.hoistTempVariables) { flattenContext.context.hoistVariableDeclaration(temp); - flattenContext.emitExpression(ts.createAssignment(temp, value, location)); + flattenContext.emitExpression(ts.setTextRange(ts.createAssignment(temp, value), location)); } else { flattenContext.emitBindingOrAssignment(temp, value, location, undefined); @@ -37329,7 +40437,7 @@ var ts; var restHelper = { name: "typescript:rest", scoped: false, - text: "\n var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\n t[p[i]] = s[p[i]];\n return t;\n };" + text: "\n var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\n t[p[i]] = s[p[i]];\n return t;\n };" }; function createRestCall(context, value, elements, computedTempVariables, location) { context.requestEmitHelper(restHelper); @@ -37348,7 +40456,10 @@ var ts; } } } - return ts.createCall(ts.getHelperName("__rest"), undefined, [value, ts.createArrayLiteral(propertyNames, location)]); + return ts.createCall(ts.getHelperName("__rest"), undefined, [ + value, + ts.setTextRange(ts.createArrayLiteral(propertyNames), location) + ]); } })(ts || (ts = {})); var ts; @@ -37364,8 +40475,8 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(177); context.enableSubstitution(178); + context.enableSubstitution(179); var currentSourceFile; var currentNamespace; var currentNamespaceContainerName; @@ -37398,15 +40509,15 @@ var ts; } function onBeforeVisitNode(node) { switch (node.kind) { - case 261: - case 232: - case 231: - case 204: + case 264: + case 234: + case 233: + case 206: currentScope = node; currentScopeFirstDeclarationsOfName = undefined; break; - case 226: - case 225: + case 228: + case 227: if (ts.hasModifier(node, 2)) { break; } @@ -37431,13 +40542,13 @@ var ts; } function sourceElementVisitorWorker(node) { switch (node.kind) { - case 235: + case 237: return visitImportDeclaration(node); - case 234: + case 236: return visitImportEqualsDeclaration(node); - case 240: + case 242: return visitExportAssignment(node); - case 241: + case 243: return visitExportDeclaration(node); default: return visitorWorker(node); @@ -37447,11 +40558,11 @@ var ts; return saveStateAndInvoke(node, namespaceElementVisitorWorker); } function namespaceElementVisitorWorker(node) { - if (node.kind === 241 || - node.kind === 235 || - node.kind === 236 || - (node.kind === 234 && - node.moduleReference.kind === 245)) { + if (node.kind === 243 || + node.kind === 237 || + node.kind === 238 || + (node.kind === 236 && + node.moduleReference.kind === 247)) { return undefined; } else if (node.transformFlags & 1 || ts.hasModifier(node, 1)) { @@ -37467,15 +40578,15 @@ var ts; } function classElementVisitorWorker(node) { switch (node.kind) { - case 150: - return undefined; - case 147: - case 155: case 151: + return undefined; + case 148: + case 156: case 152: - case 149: + case 153: + case 150: return visitorWorker(node); - case 203: + case 205: return node; default: ts.Debug.failBadSyntaxKind(node); @@ -37506,23 +40617,22 @@ var ts; case 75: case 123: case 130: - case 162: case 163: - case 161: - case 156: - case 143: + case 164: + case 162: + case 157: + case 144: case 118: case 121: - case 134: + case 135: case 132: case 129: case 104: - case 135: - case 159: - case 158: + case 136: case 160: - case 157: - case 164: + case 159: + case 161: + case 158: case 165: case 166: case 167: @@ -37530,56 +40640,58 @@ var ts; case 169: case 170: case 171: - case 155: - case 145: - case 228: - case 147: - case 150: - return visitConstructor(node); - case 227: - return ts.createNotEmittedStatement(node); - case 226: - return visitClassDeclaration(node); - case 197: - return visitClassExpression(node); - case 255: - return visitHeritageClause(node); - case 199: - return visitExpressionWithTypeArguments(node); - case 149: - return visitMethodDeclaration(node); - case 151: - return visitGetAccessor(node); - case 152: - return visitSetAccessor(node); - case 225: - return visitFunctionDeclaration(node); - case 184: - return visitFunctionExpression(node); - case 185: - return visitArrowFunction(node); - case 144: - return visitParameter(node); - case 183: - return visitParenthesizedExpression(node); - case 182: - case 200: - return visitAssertionExpression(node); - case 179: - return visitCallExpression(node); - case 180: - return visitNewExpression(node); - case 201: - return visitNonNullExpression(node); - case 229: - return visitEnumDeclaration(node); - case 205: - return visitVariableStatement(node); - case 223: - return visitVariableDeclaration(node); + case 172: + case 156: + case 146: case 230: + case 148: + return undefined; + case 151: + return visitConstructor(node); + case 229: + return ts.createNotEmittedStatement(node); + case 228: + return visitClassDeclaration(node); + case 198: + return visitClassExpression(node); + case 258: + return visitHeritageClause(node); + case 200: + return visitExpressionWithTypeArguments(node); + case 150: + return visitMethodDeclaration(node); + case 152: + return visitGetAccessor(node); + case 153: + return visitSetAccessor(node); + case 227: + return visitFunctionDeclaration(node); + case 185: + return visitFunctionExpression(node); + case 186: + return visitArrowFunction(node); + case 145: + return visitParameter(node); + case 184: + return visitParenthesizedExpression(node); + case 183: + case 201: + return visitAssertionExpression(node); + case 180: + return visitCallExpression(node); + case 181: + return visitNewExpression(node); + case 202: + return visitNonNullExpression(node); + case 231: + return visitEnumDeclaration(node); + case 207: + return visitVariableStatement(node); + case 225: + return visitVariableDeclaration(node); + case 232: return visitModuleDeclaration(node); - case 234: + case 236: return visitImportEqualsDeclaration(node); default: ts.Debug.failBadSyntaxKind(node); @@ -37587,7 +40699,8 @@ var ts; } } function visitSourceFile(node) { - var alwaysStrict = compilerOptions.alwaysStrict && !(ts.isExternalModule(node) && moduleKind === ts.ModuleKind.ES2015); + var alwaysStrict = (compilerOptions.alwaysStrict === undefined ? compilerOptions.strict : compilerOptions.alwaysStrict) && + !(ts.isExternalModule(node) && moduleKind === ts.ModuleKind.ES2015); return ts.updateSourceFileNode(node, ts.visitLexicalEnvironment(node.statements, sourceElementVisitor, context, 0, alwaysStrict)); } function shouldEmitDecorateCallForClass(node) { @@ -37639,11 +40752,12 @@ var ts; return ts.singleOrMany(statements); } function createClassDeclarationHeadWithoutDecorators(node, name, hasExtendsClause, hasStaticProperties) { - var classDeclaration = ts.createClassDeclaration(undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), name, undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), transformClassMembers(node, hasExtendsClause), node); + var classDeclaration = ts.createClassDeclaration(undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), name, undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), transformClassMembers(node, hasExtendsClause)); var emitFlags = ts.getEmitFlags(node); if (hasStaticProperties) { emitFlags |= 32; } + ts.setTextRange(classDeclaration, node); ts.setOriginalNode(classDeclaration, node); ts.setEmitFlags(classDeclaration, emitFlags); return classDeclaration; @@ -37654,10 +40768,14 @@ var ts; var declName = ts.getLocalName(node, false, true); var heritageClauses = ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause); var members = transformClassMembers(node, hasExtendsClause); - var classExpression = ts.createClassExpression(undefined, name, undefined, heritageClauses, members, location); + var classExpression = ts.createClassExpression(undefined, name, undefined, heritageClauses, members); ts.setOriginalNode(classExpression, node); - var statement = ts.createLetStatement(declName, classAlias ? ts.createAssignment(classAlias, classExpression) : classExpression, location); + ts.setTextRange(classExpression, location); + var statement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration(declName, undefined, classAlias ? ts.createAssignment(classAlias, classExpression) : classExpression) + ], 1)); ts.setOriginalNode(statement, node); + ts.setTextRange(statement, location); ts.setCommentRange(statement, node); return statement; } @@ -37665,7 +40783,9 @@ var ts; var staticProperties = getInitializedProperties(node, true); var heritageClauses = ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause); var members = transformClassMembers(node, ts.some(heritageClauses, function (c) { return c.token === 84; })); - var classExpression = ts.setOriginalNode(ts.createClassExpression(undefined, node.name, undefined, heritageClauses, members, node), node); + var classExpression = ts.createClassExpression(undefined, node.name, undefined, heritageClauses, members); + ts.setOriginalNode(classExpression, node); + ts.setTextRange(classExpression, node); if (staticProperties.length > 0) { var expressions = []; var temp = ts.createTempVariable(hoistVariableDeclaration); @@ -37688,7 +40808,7 @@ var ts; members.push(constructor); } ts.addRange(members, ts.visitNodes(node.members, classElementVisitor, ts.isClassElement)); - return ts.createNodeArray(members, node.members); + return ts.setTextRange(ts.createNodeArray(members), node.members); } function transformConstructor(node, hasExtendsClause) { var hasInstancePropertyWithInitializer = ts.forEach(node.members, isInstanceInitializedProperty); @@ -37699,7 +40819,7 @@ var ts; } var parameters = transformConstructorParameters(constructor); var body = transformConstructorBody(node, constructor, hasExtendsClause); - return ts.startOnNewLine(ts.setOriginalNode(ts.createConstructor(undefined, undefined, parameters, body, constructor || node), constructor)); + return ts.startOnNewLine(ts.setOriginalNode(ts.setTextRange(ts.createConstructor(undefined, undefined, parameters, body), constructor || node), constructor)); } function transformConstructorParameters(constructor) { return ts.visitParameterList(constructor && constructor.parameters, visitor, context) @@ -37722,18 +40842,18 @@ var ts; if (constructor) { ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, indexOfFirstStatement)); } - ts.addRange(statements, endLexicalEnvironment()); - return ts.createBlock(ts.createNodeArray(statements, constructor ? constructor.body.statements : node.members), constructor ? constructor.body : undefined, true); + statements = ts.mergeLexicalEnvironment(statements, endLexicalEnvironment()); + return ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), constructor ? constructor.body.statements : node.members), true), constructor ? constructor.body : undefined); } function addPrologueDirectivesAndInitialSuperCall(ctor, result) { if (ctor.body) { var statements = ctor.body.statements; - var index = ts.addPrologueDirectives(result, statements, false, visitor); + var index = ts.addPrologue(result, statements, false, visitor); if (index === statements.length) { return index; } var statement = statements[index]; - if (statement.kind === 207 && ts.isSuperCall(statement.expression)) { + if (statement.kind === 209 && ts.isSuperCall(statement.expression)) { result.push(ts.visitNode(statement, visitor, ts.isStatement)); return index + 1; } @@ -37755,7 +40875,7 @@ var ts; ts.setEmitFlags(propertyName, 1536 | 48); var localName = ts.getMutableClone(name); ts.setEmitFlags(localName, 1536); - return ts.startOnNewLine(ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createThis(), propertyName, node.name), localName), ts.moveRangePos(node, -1))); + return ts.startOnNewLine(ts.setTextRange(ts.createStatement(ts.createAssignment(ts.setTextRange(ts.createPropertyAccess(ts.createThis(), propertyName), node.name), localName)), ts.moveRangePos(node, -1))); } function getInitializedProperties(node, isStatic) { return ts.filter(node.members, isStatic ? isStaticInitializedProperty : isInstanceInitializedProperty); @@ -37767,13 +40887,13 @@ var ts; return isInitializedProperty(member, false); } function isInitializedProperty(member, isStatic) { - return member.kind === 147 + return member.kind === 148 && isStatic === ts.hasModifier(member, 32) && member.initializer !== undefined; } function addInitializedPropertyStatements(statements, properties, receiver) { - for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) { - var property = properties_7[_i]; + for (var _i = 0, properties_9 = properties; _i < properties_9.length; _i++) { + var property = properties_9[_i]; var statement = ts.createStatement(transformInitializedProperty(property, receiver)); ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property)); ts.setCommentRange(statement, property); @@ -37782,8 +40902,8 @@ var ts; } function generateInitializedPropertyExpressions(properties, receiver) { var expressions = []; - for (var _i = 0, properties_8 = properties; _i < properties_8.length; _i++) { - var property = properties_8[_i]; + for (var _i = 0, properties_10 = properties; _i < properties_10.length; _i++) { + var property = properties_10[_i]; var expression = transformInitializedProperty(property, receiver); expression.startsOnNewLine = true; ts.setSourceMapRange(expression, ts.moveRangePastModifiers(property)); @@ -37840,12 +40960,12 @@ var ts; } function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 151: case 152: + case 153: return getAllDecoratorsOfAccessors(node, member); - case 149: + case 150: return getAllDecoratorsOfMethod(member); - case 147: + case 148: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -37856,10 +40976,11 @@ var ts; return undefined; } var _a = ts.getAllAccessorDeclarations(node.members, accessor), firstAccessor = _a.firstAccessor, secondAccessor = _a.secondAccessor, setAccessor = _a.setAccessor; - if (accessor !== firstAccessor) { + var firstAccessorWithDecorators = firstAccessor.decorators ? firstAccessor : secondAccessor && secondAccessor.decorators ? secondAccessor : undefined; + if (!firstAccessorWithDecorators || accessor !== firstAccessorWithDecorators) { return undefined; } - var decorators = firstAccessor.decorators || (secondAccessor && secondAccessor.decorators); + var decorators = firstAccessorWithDecorators.decorators; var parameters = getDecoratorsOfParameters(setAccessor); if (!decorators && !parameters) { return undefined; @@ -37884,14 +41005,14 @@ var ts; } return { decorators: decorators }; } - function transformAllDecoratorsOfDeclaration(node, allDecorators) { + function transformAllDecoratorsOfDeclaration(node, container, allDecorators) { if (!allDecorators) { return undefined; } var decoratorExpressions = []; ts.addRange(decoratorExpressions, ts.map(allDecorators.decorators, transformDecorator)); ts.addRange(decoratorExpressions, ts.flatMap(allDecorators.parameters, transformDecoratorsOfParameter)); - addTypeMetadata(node, decoratorExpressions); + addTypeMetadata(node, container, decoratorExpressions); return decoratorExpressions; } function addClassElementDecorationStatements(statements, node, isStatic) { @@ -37916,14 +41037,14 @@ var ts; } function generateClassElementDecorationExpression(node, member) { var allDecorators = getAllDecoratorsOfClassElement(node, member); - var decoratorExpressions = transformAllDecoratorsOfDeclaration(member, allDecorators); + var decoratorExpressions = transformAllDecoratorsOfDeclaration(member, node, allDecorators); if (!decoratorExpressions) { return undefined; } var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, true); var descriptor = languageVersion > 0 - ? member.kind === 147 + ? member.kind === 148 ? ts.createVoidZero() : ts.createNull() : undefined; @@ -37939,7 +41060,7 @@ var ts; } function generateConstructorDecorationExpression(node) { var allDecorators = getAllDecoratorsOfConstructor(node); - var decoratorExpressions = transformAllDecoratorsOfDeclaration(node, allDecorators); + var decoratorExpressions = transformAllDecoratorsOfDeclaration(node, node, allDecorators); if (!decoratorExpressions) { return undefined; } @@ -37967,90 +41088,83 @@ var ts; } return expressions; } - function addTypeMetadata(node, decoratorExpressions) { + function addTypeMetadata(node, container, decoratorExpressions) { if (USE_NEW_TYPE_METADATA_FORMAT) { - addNewTypeMetadata(node, decoratorExpressions); + addNewTypeMetadata(node, container, decoratorExpressions); } else { - addOldTypeMetadata(node, decoratorExpressions); + addOldTypeMetadata(node, container, decoratorExpressions); } } - function addOldTypeMetadata(node, decoratorExpressions) { + function addOldTypeMetadata(node, container, decoratorExpressions) { if (compilerOptions.emitDecoratorMetadata) { if (shouldAddTypeMetadata(node)) { decoratorExpressions.push(createMetadataHelper(context, "design:type", serializeTypeOfNode(node))); } if (shouldAddParamTypesMetadata(node)) { - decoratorExpressions.push(createMetadataHelper(context, "design:paramtypes", serializeParameterTypesOfNode(node))); + decoratorExpressions.push(createMetadataHelper(context, "design:paramtypes", serializeParameterTypesOfNode(node, container))); } if (shouldAddReturnTypeMetadata(node)) { decoratorExpressions.push(createMetadataHelper(context, "design:returntype", serializeReturnTypeOfNode(node))); } } } - function addNewTypeMetadata(node, decoratorExpressions) { + function addNewTypeMetadata(node, container, decoratorExpressions) { if (compilerOptions.emitDecoratorMetadata) { var properties = void 0; if (shouldAddTypeMetadata(node)) { (properties || (properties = [])).push(ts.createPropertyAssignment("type", ts.createArrowFunction(undefined, undefined, [], undefined, ts.createToken(35), serializeTypeOfNode(node)))); } if (shouldAddParamTypesMetadata(node)) { - (properties || (properties = [])).push(ts.createPropertyAssignment("paramTypes", ts.createArrowFunction(undefined, undefined, [], undefined, ts.createToken(35), serializeParameterTypesOfNode(node)))); + (properties || (properties = [])).push(ts.createPropertyAssignment("paramTypes", ts.createArrowFunction(undefined, undefined, [], undefined, ts.createToken(35), serializeParameterTypesOfNode(node, container)))); } if (shouldAddReturnTypeMetadata(node)) { (properties || (properties = [])).push(ts.createPropertyAssignment("returnType", ts.createArrowFunction(undefined, undefined, [], undefined, ts.createToken(35), serializeReturnTypeOfNode(node)))); } if (properties) { - decoratorExpressions.push(createMetadataHelper(context, "design:typeinfo", ts.createObjectLiteral(properties, undefined, true))); + decoratorExpressions.push(createMetadataHelper(context, "design:typeinfo", ts.createObjectLiteral(properties, true))); } } } function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 149 - || kind === 151 + return kind === 150 || kind === 152 - || kind === 147; + || kind === 153 + || kind === 148; } function shouldAddReturnTypeMetadata(node) { - return node.kind === 149; + return node.kind === 150; } function shouldAddParamTypesMetadata(node) { - var kind = node.kind; - return kind === 226 - || kind === 197 - || kind === 149 - || kind === 151 - || kind === 152; + switch (node.kind) { + case 228: + case 198: + return ts.getFirstConstructorWithBody(node) !== undefined; + case 150: + case 152: + case 153: + return true; + } + return false; } function serializeTypeOfNode(node) { switch (node.kind) { - case 147: - case 144: - case 151: - return serializeTypeNode(node.type); + case 148: + case 145: case 152: + return serializeTypeNode(node.type); + case 153: return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node)); - case 226: - case 197: - case 149: + case 228: + case 198: + case 150: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); } } - function getRestParameterElementType(node) { - if (node && node.kind === 162) { - return node.elementType; - } - else if (node && node.kind === 157) { - return ts.singleOrUndefined(node.typeArguments); - } - else { - return undefined; - } - } - function serializeParameterTypesOfNode(node) { + function serializeParameterTypesOfNode(node, container) { var valueDeclaration = ts.isClassLike(node) ? ts.getFirstConstructorWithBody(node) : ts.isFunctionLike(node) && ts.nodeIsPresent(node.body) @@ -38058,7 +41172,7 @@ var ts; : undefined; var expressions = []; if (valueDeclaration) { - var parameters = valueDeclaration.parameters; + var parameters = getParametersOfDecoratedDeclaration(valueDeclaration, container); var numParameters = parameters.length; for (var i = 0; i < numParameters; i++) { var parameter = parameters[i]; @@ -38066,7 +41180,7 @@ var ts; continue; } if (parameter.dotDotDotToken) { - expressions.push(serializeTypeNode(getRestParameterElementType(parameter.type))); + expressions.push(serializeTypeNode(ts.getRestParameterElementType(parameter.type))); } else { expressions.push(serializeTypeOfNode(parameter)); @@ -38075,11 +41189,20 @@ var ts; } return ts.createArrayLiteral(expressions); } + function getParametersOfDecoratedDeclaration(node, container) { + if (container && node.kind === 152) { + var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; + if (setAccessor) { + return setAccessor.parameters; + } + } + return node.parameters; + } function serializeReturnTypeOfNode(node) { if (ts.isFunctionLike(node) && node.type) { return serializeTypeNode(node.type); } - else if (ts.isAsyncFunctionLike(node)) { + else if (ts.isAsyncFunction(node)) { return ts.createIdentifier("Promise"); } return ts.createVoidZero(); @@ -38090,21 +41213,26 @@ var ts; } switch (node.kind) { case 104: + case 138: + case 94: + case 129: return ts.createVoidZero(); - case 166: + case 167: return serializeTypeNode(node.type); - case 158: case 159: + case 160: return ts.createIdentifier("Function"); - case 162: case 163: + case 164: return ts.createIdentifier("Array"); - case 156: + case 157: case 121: return ts.createIdentifier("Boolean"); - case 134: + case 135: return ts.createIdentifier("String"); - case 171: + case 133: + return ts.createIdentifier("Object"); + case 172: switch (node.literal.kind) { case 9: return ts.createIdentifier("String"); @@ -38120,44 +41248,22 @@ var ts; break; case 132: return ts.createIdentifier("Number"); - case 135: + case 136: return languageVersion < 2 ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 157: + case 158: return serializeTypeReferenceNode(node); + case 166: case 165: - case 164: - { - var unionOrIntersection = node; - var serializedUnion = void 0; - for (var _i = 0, _a = unionOrIntersection.types; _i < _a.length; _i++) { - var typeNode = _a[_i]; - var serializedIndividual = serializeTypeNode(typeNode); - if (serializedIndividual.kind !== 70) { - serializedUnion = undefined; - break; - } - if (serializedIndividual.text === "Object") { - return serializedIndividual; - } - if (serializedUnion && serializedUnion.text !== serializedIndividual.text) { - serializedUnion = undefined; - break; - } - serializedUnion = serializedIndividual; - } - if (serializedUnion) { - return serializedUnion; - } - } - case 160: - case 168: + return serializeUnionOrIntersectionType(node); + case 161: case 169: case 170: - case 161: + case 171: + case 162: case 118: - case 167: + case 168: break; default: ts.Debug.failBadSyntaxKind(node); @@ -38165,6 +41271,32 @@ var ts; } return ts.createIdentifier("Object"); } + function serializeUnionOrIntersectionType(node) { + var serializedUnion; + for (var _i = 0, _a = node.types; _i < _a.length; _i++) { + var typeNode = _a[_i]; + var serializedIndividual = serializeTypeNode(typeNode); + if (ts.isVoidExpression(serializedIndividual)) { + if (!serializedUnion) { + serializedUnion = serializedIndividual; + } + } + else if (ts.isIdentifier(serializedIndividual) && serializedIndividual.text === "Object") { + return serializedIndividual; + } + else if (serializedUnion && !ts.isVoidExpression(serializedUnion)) { + if (!ts.isIdentifier(serializedUnion) || + !ts.isIdentifier(serializedIndividual) || + serializedUnion.text !== serializedIndividual.text) { + return ts.createIdentifier("Object"); + } + } + else { + serializedUnion = serializedIndividual; + } + } + return serializedUnion; + } function serializeTypeReferenceNode(node) { switch (resolver.getTypeReferenceSerializationKind(node.typeName, currentScope)) { case ts.TypeReferenceSerializationKind.Unknown: @@ -38199,15 +41331,15 @@ var ts; function serializeEntityNameAsExpression(node, useFallback) { switch (node.kind) { case 70: - var name_31 = ts.getMutableClone(node); - name_31.flags &= ~8; - name_31.original = undefined; - name_31.parent = currentScope; + var name = ts.getMutableClone(node); + name.flags &= ~8; + name.original = undefined; + name.parent = currentScope; if (useFallback) { - return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name_31), ts.createLiteral("undefined")), name_31); + return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name), ts.createLiteral("undefined")), name); } - return name_31; - case 141: + return name; + case 142: return serializeQualifiedNameAsExpression(node, useFallback); } } @@ -38236,7 +41368,7 @@ var ts; : name.expression; } else if (ts.isIdentifier(name)) { - return ts.createLiteral(name.text); + return ts.createLiteral(ts.unescapeIdentifier(name.text)); } else { return ts.getSynthesizedClone(name); @@ -38251,7 +41383,7 @@ var ts; hoistVariableDeclaration(generatedName); expression = ts.createAssignment(generatedName, expression); } - return ts.setOriginalNode(ts.createComputedPropertyName(expression, name), name); + return ts.updateComputedPropertyName(name, expression); } else { return name; @@ -38260,13 +41392,12 @@ var ts; function visitHeritageClause(node) { if (node.token === 84) { var types = ts.visitNodes(node.types, visitor, ts.isExpressionWithTypeArguments, 0, 1); - return ts.createHeritageClause(84, types, node); + return ts.setTextRange(ts.createHeritageClause(84, types), node); } return undefined; } function visitExpressionWithTypeArguments(node) { - var expression = ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression); - return ts.createExpressionWithTypeArguments(undefined, expression, node); + return ts.updateExpressionWithTypeArguments(node, undefined, ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression)); } function shouldEmitFunctionLikeDeclaration(node) { return !ts.nodeIsMissing(node.body); @@ -38275,13 +41406,13 @@ var ts; if (!shouldEmitFunctionLikeDeclaration(node)) { return undefined; } - return ts.visitEachChild(node, visitor, context); + return ts.updateConstructor(node, ts.visitNodes(node.decorators, visitor, ts.isDecorator), ts.visitNodes(node.modifiers, visitor, ts.isModifier), ts.visitParameterList(node.parameters, visitor, context), ts.visitFunctionBody(node.body, visitor, context)); } function visitMethodDeclaration(node) { if (!shouldEmitFunctionLikeDeclaration(node)) { return undefined; } - var updated = ts.updateMethod(node, undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), visitPropertyNameOfClassElement(node), undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.visitFunctionBody(node.body, visitor, context)); + var updated = ts.updateMethod(node, undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, visitPropertyNameOfClassElement(node), undefined, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.visitFunctionBody(node.body, visitor, context)); if (updated !== node) { ts.setCommentRange(updated, node); ts.setSourceMapRange(updated, ts.moveRangePastDecorators(node)); @@ -38317,7 +41448,7 @@ var ts; if (!shouldEmitFunctionLikeDeclaration(node)) { return ts.createNotEmittedStatement(node); } - var updated = ts.updateFunctionDeclaration(node, undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.visitFunctionBody(node.body, visitor, context) || ts.createBlock([])); + var updated = ts.updateFunctionDeclaration(node, undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.visitFunctionBody(node.body, visitor, context) || ts.createBlock([])); if (isNamespaceExport(node)) { var statements = [updated]; addExportMemberAssignment(statements, node); @@ -38326,10 +41457,10 @@ var ts; return updated; } function visitFunctionExpression(node) { - if (ts.nodeIsMissing(node.body)) { + if (!shouldEmitFunctionLikeDeclaration(node)) { return ts.createOmittedExpression(); } - var updated = ts.updateFunctionExpression(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.visitFunctionBody(node.body, visitor, context)); + var updated = ts.updateFunctionExpression(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.visitFunctionBody(node.body, visitor, context) || ts.createBlock([])); return updated; } function visitArrowFunction(node) { @@ -38340,8 +41471,9 @@ var ts; if (ts.parameterIsThisKeyword(node)) { return undefined; } - var parameter = ts.createParameter(undefined, undefined, node.dotDotDotToken, ts.visitNode(node.name, visitor, ts.isBindingName), undefined, undefined, ts.visitNode(node.initializer, visitor, ts.isExpression), ts.moveRangePastModifiers(node)); + var parameter = ts.createParameter(undefined, undefined, node.dotDotDotToken, ts.visitNode(node.name, visitor, ts.isBindingName), undefined, undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)); ts.setOriginalNode(parameter, node); + ts.setTextRange(parameter, ts.moveRangePastModifiers(node)); ts.setCommentRange(parameter, node); ts.setSourceMapRange(parameter, ts.moveRangePastModifiers(node)); ts.setEmitFlags(parameter.name, 32); @@ -38353,7 +41485,7 @@ var ts; if (variables.length === 0) { return undefined; } - return ts.createStatement(ts.inlineExpressions(ts.map(variables, transformInitializedVariable)), node); + return ts.setTextRange(ts.createStatement(ts.inlineExpressions(ts.map(variables, transformInitializedVariable))), node); } else { return ts.visitEachChild(node, visitor, context); @@ -38365,7 +41497,7 @@ var ts; return ts.flattenDestructuringAssignment(node, visitor, context, 0, false, createNamespaceExportExpression); } else { - return ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(name), ts.visitNode(node.initializer, visitor, ts.isExpression), node); + return ts.setTextRange(ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(name), ts.visitNode(node.initializer, visitor, ts.isExpression)), node); } } function visitVariableDeclaration(node) { @@ -38419,8 +41551,9 @@ var ts; var localName = ts.getLocalName(node, false, true); moduleArg = ts.createAssignment(localName, moduleArg); } - var enumStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, parameterName)], undefined, transformEnumBody(node, containerName)), undefined, [moduleArg]), node); + var enumStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, parameterName)], undefined, transformEnumBody(node, containerName)), undefined, [moduleArg])); ts.setOriginalNode(enumStatement, node); + ts.setTextRange(enumStatement, node); ts.setEmitFlags(enumStatement, emitFlags); statements.push(enumStatement); statements.push(ts.createEndOfDeclarationMarker(node)); @@ -38434,11 +41567,11 @@ var ts; ts.addRange(statements, ts.map(node.members, transformEnumMember)); ts.addRange(statements, endLexicalEnvironment()); currentNamespaceContainerName = savedCurrentNamespaceLocalName; - return ts.createBlock(ts.createNodeArray(statements, node.members), undefined, true); + return ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), node.members), true); } function transformEnumMember(member) { var name = getExpressionForPropertyName(member, false); - return ts.createStatement(ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, name), transformEnumMemberDeclarationValue(member))), name, member), member); + return ts.setTextRange(ts.createStatement(ts.setTextRange(ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, name), transformEnumMemberDeclarationValue(member))), name), member)), member); } function transformEnumMemberDeclarationValue(member) { var value = resolver.getConstantValue(member); @@ -38470,16 +41603,16 @@ var ts; if (!currentScopeFirstDeclarationsOfName) { currentScopeFirstDeclarationsOfName = ts.createMap(); } - if (!(name in currentScopeFirstDeclarationsOfName)) { - currentScopeFirstDeclarationsOfName[name] = node; + if (!currentScopeFirstDeclarationsOfName.has(name)) { + currentScopeFirstDeclarationsOfName.set(name, node); } } } function isFirstEmittedDeclarationInScope(node) { if (currentScopeFirstDeclarationsOfName) { - var name_32 = node.symbol && node.symbol.name; - if (name_32) { - return currentScopeFirstDeclarationsOfName[name_32] === node; + var name = node.symbol && node.symbol.name; + if (name) { + return currentScopeFirstDeclarationsOfName.get(name) === node; } } return false; @@ -38491,7 +41624,7 @@ var ts; ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { - if (node.kind === 229) { + if (node.kind === 231) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -38532,8 +41665,9 @@ var ts; var localName = ts.getLocalName(node, false, true); moduleArg = ts.createAssignment(localName, moduleArg); } - var moduleStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, parameterName)], undefined, transformModuleBody(node, containerName)), undefined, [moduleArg]), node); + var moduleStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, parameterName)], undefined, transformModuleBody(node, containerName)), undefined, [moduleArg])); ts.setOriginalNode(moduleStatement, node); + ts.setTextRange(moduleStatement, node); ts.setEmitFlags(moduleStatement, emitFlags); statements.push(moduleStatement); statements.push(ts.createEndOfDeclarationMarker(node)); @@ -38551,8 +41685,8 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 231) { - ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); + if (body.kind === 233) { + saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; } @@ -38573,14 +41707,15 @@ var ts; currentNamespaceContainerName = savedCurrentNamespaceContainerName; currentNamespace = savedCurrentNamespace; currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName; - var block = ts.createBlock(ts.createNodeArray(statements, statementsLocation), blockLocation, true); - if (body.kind !== 231) { + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), true); + ts.setTextRange(block, blockLocation); + if (body.kind !== 233) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 230) { + if (moduleDeclaration.body.kind === 232) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -38589,18 +41724,18 @@ var ts; if (!node.importClause) { return node; } - var importClause = ts.visitNode(node.importClause, visitImportClause, ts.isImportClause, true); + var importClause = ts.visitNode(node.importClause, visitImportClause, ts.isImportClause); return importClause ? ts.updateImportDeclaration(node, undefined, undefined, importClause, node.moduleSpecifier) : undefined; } function visitImportClause(node) { var name = resolver.isReferencedAliasDeclaration(node) ? node.name : undefined; - var namedBindings = ts.visitNode(node.namedBindings, visitNamedImportBindings, ts.isNamedImportBindings, true); + var namedBindings = ts.visitNode(node.namedBindings, visitNamedImportBindings, ts.isNamedImportBindings); return (name || namedBindings) ? ts.updateImportClause(node, name, namedBindings) : undefined; } function visitNamedImportBindings(node) { - if (node.kind === 237) { + if (node.kind === 239) { return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } else { @@ -38623,7 +41758,7 @@ var ts; if (!resolver.isValueAliasDeclaration(node)) { return undefined; } - var exportClause = ts.visitNode(node.exportClause, visitNamedExports, ts.isNamedExports, true); + var exportClause = ts.visitNode(node.exportClause, visitNamedExports, ts.isNamedExports); return exportClause ? ts.updateExportDeclaration(node, undefined, undefined, exportClause, node.moduleSpecifier) : undefined; @@ -38652,9 +41787,9 @@ var ts; var moduleReference = ts.createExpressionFromEntityName(node.moduleReference); ts.setEmitFlags(moduleReference, 1536 | 2048); if (isNamedExternalModuleExport(node) || !isNamespaceExport(node)) { - return ts.setOriginalNode(ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ + return ts.setOriginalNode(ts.setTextRange(ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.setOriginalNode(ts.createVariableDeclaration(node.name, undefined, moduleReference), node) - ]), node), node); + ])), node), node); } else { return ts.setOriginalNode(createNamespaceExport(node.name, moduleReference, node), node); @@ -38675,7 +41810,7 @@ var ts; && ts.hasModifier(node, 512); } function expressionToStatement(expression) { - return ts.createStatement(expression, undefined); + return ts.createStatement(expression); } function addExportMemberAssignment(statements, node) { var expression = ts.createAssignment(ts.getExternalModuleOrNamespaceExportName(currentNamespaceContainerName, node, false, true), ts.getLocalName(node)); @@ -38685,10 +41820,10 @@ var ts; statements.push(statement); } function createNamespaceExport(exportName, exportValue, location) { - return ts.createStatement(ts.createAssignment(ts.getNamespaceMemberName(currentNamespaceContainerName, exportName, false, true), exportValue), location); + return ts.setTextRange(ts.createStatement(ts.createAssignment(ts.getNamespaceMemberName(currentNamespaceContainerName, exportName, false, true), exportValue)), location); } function createNamespaceExportExpression(exportName, exportValue, location) { - return ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(exportName), exportValue, location); + return ts.setTextRange(ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(exportName), exportValue), location); } function getNamespaceMemberNameWithSourceMapsAndWithoutComments(name) { return ts.getNamespaceMemberName(currentNamespaceContainerName, name, false, true); @@ -38704,7 +41839,7 @@ var ts; function getClassAliasIfNeeded(node) { if (resolver.getNodeCheckFlags(node) & 8388608) { enableSubstitutionForClassAliases(); - var classAlias = ts.createUniqueName(node.name && !ts.isGeneratedIdentifier(node.name) ? node.name.text : "default"); + var classAlias = ts.createUniqueName(node.name && !ts.isGeneratedIdentifier(node.name) ? ts.unescapeIdentifier(node.name.text) : "default"); classAliases[ts.getOriginalNodeId(node)] = classAlias; hoistVariableDeclaration(classAlias); return classAlias; @@ -38728,37 +41863,42 @@ var ts; if ((enabledSubstitutions & 1) === 0) { enabledSubstitutions |= 1; context.enableSubstitution(70); - classAliases = ts.createMap(); + classAliases = []; } } function enableSubstitutionForNamespaceExports() { if ((enabledSubstitutions & 2) === 0) { enabledSubstitutions |= 2; context.enableSubstitution(70); - context.enableSubstitution(258); - context.enableEmitNotification(230); + context.enableSubstitution(261); + context.enableEmitNotification(232); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 230; + return ts.getOriginalNode(node).kind === 232; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 229; + return ts.getOriginalNode(node).kind === 231; } - function onEmitNode(emitContext, node, emitCallback) { + function onEmitNode(hint, node, emitCallback) { var savedApplicableSubstitutions = applicableSubstitutions; + var savedCurrentSourceFile = currentSourceFile; + if (ts.isSourceFile(node)) { + currentSourceFile = node; + } if (enabledSubstitutions & 2 && isTransformedModuleDeclaration(node)) { applicableSubstitutions |= 2; } if (enabledSubstitutions & 8 && isTransformedEnumDeclaration(node)) { applicableSubstitutions |= 8; } - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); applicableSubstitutions = savedApplicableSubstitutions; + currentSourceFile = savedCurrentSourceFile; } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1) { + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1) { return substituteExpression(node); } else if (ts.isShorthandPropertyAssignment(node)) { @@ -38768,14 +41908,14 @@ var ts; } function substituteShorthandPropertyAssignment(node) { if (enabledSubstitutions & 2) { - var name_33 = node.name; - var exportedName = trySubstituteNamespaceExportedName(name_33); + var name = node.name; + var exportedName = trySubstituteNamespaceExportedName(name); if (exportedName) { if (node.objectAssignmentInitializer) { var initializer = ts.createAssignment(exportedName, node.objectAssignmentInitializer); - return ts.createPropertyAssignment(name_33, initializer, node); + return ts.setTextRange(ts.createPropertyAssignment(name, initializer), node); } - return ts.createPropertyAssignment(name_33, exportedName, node); + return ts.setTextRange(ts.createPropertyAssignment(name, exportedName), node); } } return node; @@ -38784,9 +41924,9 @@ var ts; switch (node.kind) { case 70: return substituteExpressionIdentifier(node); - case 177: - return substitutePropertyAccessExpression(node); case 178: + return substitutePropertyAccessExpression(node); + case 179: return substituteElementAccessExpression(node); } return node; @@ -38816,11 +41956,11 @@ var ts; function trySubstituteNamespaceExportedName(node) { if (enabledSubstitutions & applicableSubstitutions && !ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var container = resolver.getReferencedExportContainer(node, false); - if (container && container.kind !== 261) { - var substitute = (applicableSubstitutions & 2 && container.kind === 230) || - (applicableSubstitutions & 8 && container.kind === 229); + if (container && container.kind !== 264) { + var substitute = (applicableSubstitutions & 2 && container.kind === 232) || + (applicableSubstitutions & 8 && container.kind === 231); if (substitute) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node, node); + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), node); } } } @@ -38835,16 +41975,14 @@ var ts; function substituteConstantValue(node) { var constantValue = tryGetConstEnumValue(node); if (constantValue !== undefined) { + ts.setConstantValue(node, constantValue); var substitute = ts.createLiteral(constantValue); - ts.setSourceMapRange(substitute, node); - ts.setCommentRange(substitute, node); if (!compilerOptions.removeComments) { var propertyName = ts.isPropertyAccessExpression(node) ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); - substitute.trailingComment = " " + propertyName + " "; + ts.addSyntheticTrailingComment(substitute, 3, " " + propertyName + " "); } - ts.setConstantValue(node, constantValue); return substitute; } return node; @@ -38859,24 +41997,24 @@ var ts; } } ts.transformTypeScript = transformTypeScript; - var paramHelper = { - name: "typescript:param", - scoped: false, - priority: 4, - text: "\n var __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n };" - }; - function createParamHelper(context, expression, parameterOffset, location) { - context.requestEmitHelper(paramHelper); - return ts.createCall(ts.getHelperName("__param"), undefined, [ - ts.createLiteral(parameterOffset), - expression - ], location); + function createDecorateHelper(context, decoratorExpressions, target, memberName, descriptor, location) { + var argumentsArray = []; + argumentsArray.push(ts.createArrayLiteral(decoratorExpressions, true)); + argumentsArray.push(target); + if (memberName) { + argumentsArray.push(memberName); + if (descriptor) { + argumentsArray.push(descriptor); + } + } + context.requestEmitHelper(decorateHelper); + return ts.setTextRange(ts.createCall(ts.getHelperName("__decorate"), undefined, argumentsArray), location); } - var metadataHelper = { - name: "typescript:metadata", + var decorateHelper = { + name: "typescript:decorate", scoped: false, - priority: 3, - text: "\n var __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n };" + priority: 2, + text: "\n var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };" }; function createMetadataHelper(context, metadataKey, metadataValue) { context.requestEmitHelper(metadataHelper); @@ -38885,30 +42023,281 @@ var ts; metadataValue ]); } - var decorateHelper = { - name: "typescript:decorate", + var metadataHelper = { + name: "typescript:metadata", scoped: false, - priority: 2, - text: "\n var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };" + priority: 3, + text: "\n var __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n };" }; - function createDecorateHelper(context, decoratorExpressions, target, memberName, descriptor, location) { - context.requestEmitHelper(decorateHelper); - var argumentsArray = []; - argumentsArray.push(ts.createArrayLiteral(decoratorExpressions, undefined, true)); - argumentsArray.push(target); - if (memberName) { - argumentsArray.push(memberName); - if (descriptor) { - argumentsArray.push(descriptor); + function createParamHelper(context, expression, parameterOffset, location) { + context.requestEmitHelper(paramHelper); + return ts.setTextRange(ts.createCall(ts.getHelperName("__param"), undefined, [ + ts.createLiteral(parameterOffset), + expression + ]), location); + } + var paramHelper = { + name: "typescript:param", + scoped: false, + priority: 4, + text: "\n var __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n };" + }; +})(ts || (ts = {})); +var ts; +(function (ts) { + function transformES2017(context) { + var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; + var resolver = context.getEmitResolver(); + var compilerOptions = context.getCompilerOptions(); + var languageVersion = ts.getEmitScriptTarget(compilerOptions); + var currentSourceFile; + var enabledSubstitutions; + var enclosingSuperContainerFlags = 0; + var previousOnEmitNode = context.onEmitNode; + var previousOnSubstituteNode = context.onSubstituteNode; + context.onEmitNode = onEmitNode; + context.onSubstituteNode = onSubstituteNode; + return transformSourceFile; + function transformSourceFile(node) { + if (ts.isDeclarationFile(node)) { + return node; + } + currentSourceFile = node; + var visited = ts.visitEachChild(node, visitor, context); + ts.addEmitHelpers(visited, context.readEmitHelpers()); + currentSourceFile = undefined; + return visited; + } + function visitor(node) { + if ((node.transformFlags & 16) === 0) { + return node; + } + switch (node.kind) { + case 119: + return undefined; + case 190: + return visitAwaitExpression(node); + case 150: + return visitMethodDeclaration(node); + case 227: + return visitFunctionDeclaration(node); + case 185: + return visitFunctionExpression(node); + case 186: + return visitArrowFunction(node); + default: + return ts.visitEachChild(node, visitor, context); + } + } + function visitAwaitExpression(node) { + return ts.setOriginalNode(ts.setTextRange(ts.createYield(undefined, ts.visitNode(node.expression, visitor, ts.isExpression)), node), node); + } + function visitMethodDeclaration(node) { + return ts.updateMethod(node, undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, undefined, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.getFunctionFlags(node) & 2 + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + function visitFunctionDeclaration(node) { + return ts.updateFunctionDeclaration(node, undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.getFunctionFlags(node) & 2 + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + function visitFunctionExpression(node) { + return ts.updateFunctionExpression(node, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.getFunctionFlags(node) & 2 + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + function visitArrowFunction(node) { + return ts.updateArrowFunction(node, ts.visitNodes(node.modifiers, visitor, ts.isModifier), undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.getFunctionFlags(node) & 2 + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + function transformAsyncFunctionBody(node) { + resumeLexicalEnvironment(); + var original = ts.getOriginalNode(node, ts.isFunctionLike); + var nodeType = original.type; + var promiseConstructor = languageVersion < 2 ? getPromiseConstructor(nodeType) : undefined; + var isArrowFunction = node.kind === 186; + var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192) !== 0; + if (!isArrowFunction) { + var statements = []; + var statementOffset = ts.addPrologue(statements, node.body.statements, false, visitor); + statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body, statementOffset)))); + ts.addRange(statements, endLexicalEnvironment()); + var block = ts.createBlock(statements, true); + ts.setTextRange(block, node.body); + if (languageVersion >= 2) { + if (resolver.getNodeCheckFlags(node) & 4096) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.advancedAsyncSuperHelper); + } + else if (resolver.getNodeCheckFlags(node) & 2048) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.asyncSuperHelper); + } + } + return block; + } + else { + var expression = createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body)); + var declarations = endLexicalEnvironment(); + if (ts.some(declarations)) { + var block = ts.convertToFunctionBody(expression); + return ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(ts.concatenate(block.statements, declarations)), block.statements)); + } + return expression; + } + } + function transformFunctionBodyWorker(body, start) { + if (ts.isBlock(body)) { + return ts.updateBlock(body, ts.visitLexicalEnvironment(body.statements, visitor, context, start)); + } + else { + startLexicalEnvironment(); + var visited = ts.convertToFunctionBody(ts.visitNode(body, visitor, ts.isConciseBody)); + var declarations = endLexicalEnvironment(); + return ts.updateBlock(visited, ts.setTextRange(ts.createNodeArray(ts.concatenate(visited.statements, declarations)), visited.statements)); + } + } + function getPromiseConstructor(type) { + var typeName = type && ts.getEntityNameFromTypeNode(type); + if (typeName && ts.isEntityName(typeName)) { + var serializationKind = resolver.getTypeReferenceSerializationKind(typeName); + if (serializationKind === ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue + || serializationKind === ts.TypeReferenceSerializationKind.Unknown) { + return typeName; + } + } + return undefined; + } + function enableSubstitutionForAsyncMethodsWithSuper() { + if ((enabledSubstitutions & 1) === 0) { + enabledSubstitutions |= 1; + context.enableSubstitution(180); + context.enableSubstitution(178); + context.enableSubstitution(179); + context.enableEmitNotification(228); + context.enableEmitNotification(150); + context.enableEmitNotification(152); + context.enableEmitNotification(153); + context.enableEmitNotification(151); + } + } + function onEmitNode(hint, node, emitCallback) { + if (enabledSubstitutions & 1 && isSuperContainer(node)) { + var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 | 4096); + if (superContainerFlags !== enclosingSuperContainerFlags) { + var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; + enclosingSuperContainerFlags = superContainerFlags; + previousOnEmitNode(hint, node, emitCallback); + enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; + return; + } + } + previousOnEmitNode(hint, node, emitCallback); + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 && enclosingSuperContainerFlags) { + return substituteExpression(node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 178: + return substitutePropertyAccessExpression(node); + case 179: + return substituteElementAccessExpression(node); + case 180: + return substituteCallExpression(node); + } + return node; + } + function substitutePropertyAccessExpression(node) { + if (node.expression.kind === 96) { + return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), node); + } + return node; + } + function substituteElementAccessExpression(node) { + if (node.expression.kind === 96) { + return createSuperAccessInAsyncMethod(node.argumentExpression, node); + } + return node; + } + function substituteCallExpression(node) { + var expression = node.expression; + if (ts.isSuperProperty(expression)) { + var argumentExpression = ts.isPropertyAccessExpression(expression) + ? substitutePropertyAccessExpression(expression) + : substituteElementAccessExpression(expression); + return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), undefined, [ + ts.createThis() + ].concat(node.arguments)); + } + return node; + } + function isSuperContainer(node) { + var kind = node.kind; + return kind === 228 + || kind === 151 + || kind === 150 + || kind === 152 + || kind === 153; + } + function createSuperAccessInAsyncMethod(argumentExpression, location) { + if (enclosingSuperContainerFlags & 4096) { + return ts.setTextRange(ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression]), "value"), location); + } + else { + return ts.setTextRange(ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression]), location); } } - return ts.createCall(ts.getHelperName("__decorate"), undefined, argumentsArray, location); } + ts.transformES2017 = transformES2017; + var awaiterHelper = { + name: "typescript:awaiter", + scoped: false, + priority: 5, + text: "\n var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n };" + }; + function createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, body) { + context.requestEmitHelper(awaiterHelper); + var generatorFunc = ts.createFunctionExpression(undefined, ts.createToken(38), undefined, undefined, [], undefined, body); + (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 131072; + return ts.createCall(ts.getHelperName("__awaiter"), undefined, [ + ts.createThis(), + hasLexicalArguments ? ts.createIdentifier("arguments") : ts.createVoidZero(), + promiseConstructor ? ts.createExpressionFromEntityName(promiseConstructor) : ts.createVoidZero(), + generatorFunc + ]); + } + ts.asyncSuperHelper = { + name: "typescript:async-super", + scoped: true, + text: "\n const _super = name => super[name];\n " + }; + ts.advancedAsyncSuperHelper = { + name: "typescript:advanced-async-super", + scoped: true, + text: "\n const _super = (function (geti, seti) {\n const cache = Object.create(null);\n return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n })(name => super[name], (name, value) => super[name] = value);\n " + }; })(ts || (ts = {})); var ts; (function (ts) { function transformESNext(context) { - var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; + var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration; + var resolver = context.getEmitResolver(); + var compilerOptions = context.getCompilerOptions(); + var languageVersion = ts.getEmitScriptTarget(compilerOptions); + var previousOnEmitNode = context.onEmitNode; + context.onEmitNode = onEmitNode; + var previousOnSubstituteNode = context.onSubstituteNode; + context.onSubstituteNode = onSubstituteNode; + var enabledSubstitutions; + var enclosingFunctionFlags; + var enclosingSuperContainerFlags = 0; return transformSourceFile; function transformSourceFile(node) { if (ts.isDeclarationFile(node)) { @@ -38924,53 +42313,93 @@ var ts; function visitorNoDestructuringValue(node) { return visitorWorker(node, true); } + function visitorNoAsyncModifier(node) { + if (node.kind === 119) { + return undefined; + } + return node; + } function visitorWorker(node, noDestructuringValue) { if ((node.transformFlags & 8) === 0) { return node; } switch (node.kind) { - case 176: + case 190: + return visitAwaitExpression(node); + case 196: + return visitYieldExpression(node); + case 221: + return visitLabeledStatement(node); + case 177: return visitObjectLiteralExpression(node); - case 192: + case 193: return visitBinaryExpression(node, noDestructuringValue); - case 223: - return visitVariableDeclaration(node); - case 213: - return visitForOfStatement(node); - case 211: - return visitForStatement(node); - case 188: - return visitVoidExpression(node); - case 150: - return visitConstructorDeclaration(node); - case 149: - return visitMethodDeclaration(node); - case 151: - return visitGetAccessorDeclaration(node); - case 152: - return visitSetAccessorDeclaration(node); case 225: + return visitVariableDeclaration(node); + case 215: + return visitForOfStatement(node, undefined); + case 213: + return visitForStatement(node); + case 189: + return visitVoidExpression(node); + case 151: + return visitConstructorDeclaration(node); + case 150: + return visitMethodDeclaration(node); + case 152: + return visitGetAccessorDeclaration(node); + case 153: + return visitSetAccessorDeclaration(node); + case 227: return visitFunctionDeclaration(node); - case 184: - return visitFunctionExpression(node); case 185: + return visitFunctionExpression(node); + case 186: return visitArrowFunction(node); - case 144: + case 145: return visitParameter(node); - case 207: + case 209: return visitExpressionStatement(node); - case 183: + case 184: return visitParenthesizedExpression(node, noDestructuringValue); default: return ts.visitEachChild(node, visitor, context); } } + function visitAwaitExpression(node) { + if (enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + return ts.setOriginalNode(ts.setTextRange(ts.createYield(undefined, ts.createArrayLiteral([ts.createLiteral("await"), expression])), node), node); + } + return ts.visitEachChild(node, visitor, context); + } + function visitYieldExpression(node) { + if (enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + return ts.updateYield(node, node.asteriskToken, node.asteriskToken + ? createAsyncDelegatorHelper(context, expression, expression) + : ts.createArrayLiteral(expression + ? [ts.createLiteral("yield"), expression] + : [ts.createLiteral("yield")])); + } + return ts.visitEachChild(node, visitor, context); + } + function visitLabeledStatement(node) { + if (enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1) { + var statement = ts.unwrapInnermostStatementOfLabel(node); + if (statement.kind === 215 && statement.awaitModifier) { + return visitForOfStatement(statement, node); + } + return ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), node); + } + return ts.visitEachChild(node, visitor, context); + } function chunkObjectLiteralElements(elements) { var chunkObject; var objects = []; - for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) { - var e = elements_3[_i]; - if (e.kind === 259) { + for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { + var e = elements_4[_i]; + if (e.kind === 262) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -38982,7 +42411,7 @@ var ts; if (!chunkObject) { chunkObject = []; } - if (e.kind === 257) { + if (e.kind === 260) { var p = e; chunkObject.push(ts.createPropertyAssignment(p.name, ts.visitNode(p.initializer, visitor, ts.isExpression))); } @@ -38999,7 +42428,7 @@ var ts; function visitObjectLiteralExpression(node) { if (node.transformFlags & 1048576) { var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 176) { + if (objects.length && objects[0].kind !== 177) { objects.unshift(ts.createObjectLiteral()); } return createAssignHelper(context, objects); @@ -39033,68 +42462,202 @@ var ts; function visitVoidExpression(node) { return ts.visitEachChild(node, visitorNoDestructuringValue, context); } - function visitForOfStatement(node) { - var leadingStatements; - var temp; - var initializer = ts.skipParentheses(node.initializer); - if (initializer.transformFlags & 1048576) { - if (ts.isVariableDeclarationList(initializer)) { - temp = ts.createTempVariable(undefined); - var firstDeclaration = ts.firstOrUndefined(initializer.declarations); - var declarations = ts.flattenDestructuringBinding(firstDeclaration, visitor, context, 1, temp, false, true); - if (ts.some(declarations)) { - var statement = ts.createVariableStatement(undefined, ts.updateVariableDeclarationList(initializer, declarations), initializer); - leadingStatements = ts.append(leadingStatements, statement); - } - } - else if (ts.isAssignmentPattern(initializer)) { - temp = ts.createTempVariable(undefined); - var expression = ts.flattenDestructuringAssignment(ts.aggregateTransformFlags(ts.createAssignment(initializer, temp, node.initializer)), visitor, context, 1); - leadingStatements = ts.append(leadingStatements, ts.createStatement(expression, node.initializer)); - } + function visitForOfStatement(node, outermostLabeledStatement) { + if (node.initializer.transformFlags & 1048576) { + node = transformForOfStatementWithObjectRest(node); } - if (temp) { - var expression = ts.visitNode(node.expression, visitor, ts.isExpression); - var statement = ts.visitNode(node.statement, visitor, ts.isStatement); - var block = ts.isBlock(statement) - ? ts.updateBlock(statement, ts.createNodeArray(ts.concatenate(leadingStatements, statement.statements), statement.statements)) - : ts.createBlock(ts.append(leadingStatements, statement), statement, true); - return ts.updateForOf(node, ts.createVariableDeclarationList([ - ts.createVariableDeclaration(temp, undefined, undefined, node.initializer) - ], node.initializer, 1), expression, block); + if (node.awaitModifier) { + return transformForAwaitOfStatement(node, outermostLabeledStatement); } - return ts.visitEachChild(node, visitor, context); + else { + return ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), outermostLabeledStatement); + } + } + function transformForOfStatementWithObjectRest(node) { + var initializerWithoutParens = ts.skipParentheses(node.initializer); + if (ts.isVariableDeclarationList(initializerWithoutParens) || ts.isAssignmentPattern(initializerWithoutParens)) { + var bodyLocation = void 0; + var statementsLocation = void 0; + var temp = ts.createTempVariable(undefined); + var statements = [ts.createForOfBindingStatement(initializerWithoutParens, temp)]; + if (ts.isBlock(node.statement)) { + ts.addRange(statements, node.statement.statements); + bodyLocation = node.statement; + statementsLocation = node.statement.statements; + } + return ts.updateForOf(node, node.awaitModifier, ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(temp), node.initializer) + ], 1), node.initializer), node.expression, ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), true), bodyLocation)); + } + return node; + } + function convertForOfStatementHead(node, boundValue) { + var binding = ts.createForOfBindingStatement(node.initializer, boundValue); + var bodyLocation; + var statementsLocation; + var statements = [ts.visitNode(binding, visitor, ts.isStatement)]; + var statement = ts.visitNode(node.statement, visitor, ts.isStatement); + if (ts.isBlock(statement)) { + ts.addRange(statements, statement.statements); + bodyLocation = statement; + statementsLocation = statement.statements; + } + else { + statements.push(statement); + } + return ts.setEmitFlags(ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), true), bodyLocation), 48 | 384); + } + function transformForAwaitOfStatement(node, outermostLabeledStatement) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + var iterator = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(expression) : ts.createTempVariable(undefined); + var result = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(iterator) : ts.createTempVariable(undefined); + var errorRecord = ts.createUniqueName("e"); + var catchVariable = ts.getGeneratedNameForNode(errorRecord); + var returnMethod = ts.createTempVariable(undefined); + var values = createAsyncValuesHelper(context, expression, node.expression); + var next = ts.createYield(undefined, enclosingFunctionFlags & 1 + ? ts.createArrayLiteral([ + ts.createLiteral("await"), + ts.createCall(ts.createPropertyAccess(iterator, "next"), undefined, []) + ]) + : ts.createCall(ts.createPropertyAccess(iterator, "next"), undefined, [])); + hoistVariableDeclaration(errorRecord); + hoistVariableDeclaration(returnMethod); + var forStatement = ts.setEmitFlags(ts.setTextRange(ts.createFor(ts.setEmitFlags(ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(iterator, undefined, values), node.expression), + ts.createVariableDeclaration(result, undefined, next) + ]), node.expression), 1048576), ts.createLogicalNot(ts.createPropertyAccess(result, "done")), ts.createAssignment(result, next), convertForOfStatementHead(node, ts.createPropertyAccess(result, "value"))), node), 256); + return ts.createTry(ts.createBlock([ + ts.restoreEnclosingLabel(forStatement, outermostLabeledStatement) + ]), ts.createCatchClause(ts.createVariableDeclaration(catchVariable), ts.setEmitFlags(ts.createBlock([ + ts.createStatement(ts.createAssignment(errorRecord, ts.createObjectLiteral([ + ts.createPropertyAssignment("error", catchVariable) + ]))) + ]), 1)), ts.createBlock([ + ts.createTry(ts.createBlock([ + ts.setEmitFlags(ts.createIf(ts.createLogicalAnd(ts.createLogicalAnd(result, ts.createLogicalNot(ts.createPropertyAccess(result, "done"))), ts.createAssignment(returnMethod, ts.createPropertyAccess(iterator, "return"))), ts.createStatement(ts.createYield(undefined, enclosingFunctionFlags & 1 + ? ts.createArrayLiteral([ + ts.createLiteral("await"), + ts.createFunctionCall(returnMethod, iterator, []) + ]) + : ts.createFunctionCall(returnMethod, iterator, [])))), 1) + ]), undefined, ts.setEmitFlags(ts.createBlock([ + ts.setEmitFlags(ts.createIf(errorRecord, ts.createThrow(ts.createPropertyAccess(errorRecord, "error"))), 1) + ]), 1)) + ])); } function visitParameter(node) { if (node.transformFlags & 1048576) { - return ts.updateParameter(node, undefined, undefined, node.dotDotDotToken, ts.getGeneratedNameForNode(node), undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)); + return ts.updateParameter(node, undefined, undefined, node.dotDotDotToken, ts.getGeneratedNameForNode(node), undefined, undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)); } return ts.visitEachChild(node, visitor, context); } function visitConstructorDeclaration(node) { - return ts.updateConstructor(node, undefined, node.modifiers, ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node)); + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = 0; + var updated = ts.updateConstructor(node, undefined, node.modifiers, ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitGetAccessorDeclaration(node) { - return ts.updateGetAccessor(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = 0; + var updated = ts.updateGetAccessor(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitSetAccessorDeclaration(node) { - return ts.updateSetAccessor(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node)); + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = 0; + var updated = ts.updateSetAccessor(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitMethodDeclaration(node) { - return ts.updateMethod(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateMethod(node, undefined, enclosingFunctionFlags & 1 + ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier) + : node.modifiers, enclosingFunctionFlags & 2 + ? undefined + : node.asteriskToken, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNode(undefined, visitor, ts.isToken), undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1 + ? transformAsyncGeneratorFunctionBody(node) + : transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitFunctionDeclaration(node) { - return ts.updateFunctionDeclaration(node, undefined, node.modifiers, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateFunctionDeclaration(node, undefined, enclosingFunctionFlags & 1 + ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier) + : node.modifiers, enclosingFunctionFlags & 2 + ? undefined + : node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1 + ? transformAsyncGeneratorFunctionBody(node) + : transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitArrowFunction(node) { - return ts.updateArrowFunction(node, node.modifiers, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateArrowFunction(node, node.modifiers, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitFunctionExpression(node) { - return ts.updateFunctionExpression(node, node.modifiers, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateFunctionExpression(node, enclosingFunctionFlags & 1 + ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier) + : node.modifiers, enclosingFunctionFlags & 2 + ? undefined + : node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1 + ? transformAsyncGeneratorFunctionBody(node) + : transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; + } + function transformAsyncGeneratorFunctionBody(node) { + resumeLexicalEnvironment(); + var statements = []; + var statementOffset = ts.addPrologue(statements, node.body.statements, false, visitor); + appendObjectRestAssignmentsIfNeeded(statements, node); + statements.push(ts.createReturn(createAsyncGeneratorHelper(context, ts.createFunctionExpression(undefined, ts.createToken(38), node.name && ts.getGeneratedNameForNode(node.name), undefined, [], undefined, ts.updateBlock(node.body, ts.visitLexicalEnvironment(node.body.statements, visitor, context, statementOffset)))))); + ts.addRange(statements, endLexicalEnvironment()); + var block = ts.updateBlock(node.body, statements); + if (languageVersion >= 2) { + if (resolver.getNodeCheckFlags(node) & 4096) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.advancedAsyncSuperHelper); + } + else if (resolver.getNodeCheckFlags(node) & 2048) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.asyncSuperHelper); + } + } + return block; } function transformFunctionBody(node) { resumeLexicalEnvironment(); - var leadingStatements; + var statementOffset = 0; + var statements = []; + var body = ts.visitNode(node.body, visitor, ts.isConciseBody); + if (ts.isBlock(body)) { + statementOffset = ts.addPrologue(statements, body.statements, false, visitor); + } + ts.addRange(statements, appendObjectRestAssignmentsIfNeeded(undefined, node)); + var trailingStatements = endLexicalEnvironment(); + if (statementOffset > 0 || ts.some(statements) || ts.some(trailingStatements)) { + var block = ts.convertToFunctionBody(body, true); + ts.addRange(statements, block.statements.slice(statementOffset)); + ts.addRange(statements, trailingStatements); + return ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(statements), block.statements)); + } + return body; + } + function appendObjectRestAssignmentsIfNeeded(statements, node) { for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { var parameter = _a[_i]; if (parameter.transformFlags & 1048576) { @@ -39103,17 +42666,95 @@ var ts; if (ts.some(declarations)) { var statement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList(declarations)); ts.setEmitFlags(statement, 524288); - leadingStatements = ts.append(leadingStatements, statement); + statements = ts.append(statements, statement); } } } - var body = ts.visitNode(node.body, visitor, ts.isConciseBody); - var trailingStatements = endLexicalEnvironment(); - if (ts.some(leadingStatements) || ts.some(trailingStatements)) { - var block = ts.convertToFunctionBody(body, true); - return ts.updateBlock(block, ts.createNodeArray(ts.concatenate(ts.concatenate(leadingStatements, block.statements), trailingStatements), block.statements)); + return statements; + } + function enableSubstitutionForAsyncMethodsWithSuper() { + if ((enabledSubstitutions & 1) === 0) { + enabledSubstitutions |= 1; + context.enableSubstitution(180); + context.enableSubstitution(178); + context.enableSubstitution(179); + context.enableEmitNotification(228); + context.enableEmitNotification(150); + context.enableEmitNotification(152); + context.enableEmitNotification(153); + context.enableEmitNotification(151); + } + } + function onEmitNode(hint, node, emitCallback) { + if (enabledSubstitutions & 1 && isSuperContainer(node)) { + var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 | 4096); + if (superContainerFlags !== enclosingSuperContainerFlags) { + var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; + enclosingSuperContainerFlags = superContainerFlags; + previousOnEmitNode(hint, node, emitCallback); + enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; + return; + } + } + previousOnEmitNode(hint, node, emitCallback); + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 && enclosingSuperContainerFlags) { + return substituteExpression(node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 178: + return substitutePropertyAccessExpression(node); + case 179: + return substituteElementAccessExpression(node); + case 180: + return substituteCallExpression(node); + } + return node; + } + function substitutePropertyAccessExpression(node) { + if (node.expression.kind === 96) { + return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), node); + } + return node; + } + function substituteElementAccessExpression(node) { + if (node.expression.kind === 96) { + return createSuperAccessInAsyncMethod(node.argumentExpression, node); + } + return node; + } + function substituteCallExpression(node) { + var expression = node.expression; + if (ts.isSuperProperty(expression)) { + var argumentExpression = ts.isPropertyAccessExpression(expression) + ? substitutePropertyAccessExpression(expression) + : substituteElementAccessExpression(expression); + return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), undefined, [ + ts.createThis() + ].concat(node.arguments)); + } + return node; + } + function isSuperContainer(node) { + var kind = node.kind; + return kind === 228 + || kind === 151 + || kind === 150 + || kind === 152 + || kind === 153; + } + function createSuperAccessInAsyncMethod(argumentExpression, location) { + if (enclosingSuperContainerFlags & 4096) { + return ts.setTextRange(ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression]), "value"), location); + } + else { + return ts.setTextRange(ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression]), location); } - return body; } } ts.transformESNext = transformESNext; @@ -39124,25 +42765,57 @@ var ts; text: "\n var __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };" }; function createAssignHelper(context, attributesSegments) { + if (context.getCompilerOptions().target >= 2) { + return ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "assign"), undefined, attributesSegments); + } context.requestEmitHelper(assignHelper); return ts.createCall(ts.getHelperName("__assign"), undefined, attributesSegments); } ts.createAssignHelper = createAssignHelper; + var asyncGeneratorHelper = { + name: "typescript:asyncGenerator", + scoped: false, + text: "\n var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), q = [], c, i;\n return i = { next: verb(\"next\"), \"throw\": verb(\"throw\"), \"return\": verb(\"return\") }, i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }\n function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }\n function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === \"yield\" ? _yield : r.value[0] === \"delegate\" ? delegate : fulfill, reject); }\n function _yield(value) { settle(c[2], { value: value, done: false }); }\n function delegate(r) { step(r.done ? r : { value: [\"yield\", r.value], done: false }); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { c = void 0, f(v), next(); }\n };\n " + }; + function createAsyncGeneratorHelper(context, generatorFunc) { + context.requestEmitHelper(asyncGeneratorHelper); + (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 131072; + return ts.createCall(ts.getHelperName("__asyncGenerator"), undefined, [ + ts.createThis(), + ts.createIdentifier("arguments"), + generatorFunc + ]); + } + var asyncDelegator = { + name: "typescript:asyncDelegator", + scoped: false, + text: "\n var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {\n var i = { next: verb(\"next\"), \"throw\": verb(\"throw\", function (e) { throw e; }), \"return\": verb(\"return\", function (v) { return { value: v, done: true }; }) };\n return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { return function (v) { return { value: [\"delegate\", (o[n] || f).call(o, v)], done: false }; }; }\n };\n " + }; + function createAsyncDelegatorHelper(context, expression, location) { + context.requestEmitHelper(asyncDelegator); + return ts.setTextRange(ts.createCall(ts.getHelperName("__asyncDelegator"), undefined, [expression]), location); + } + var asyncValues = { + name: "typescript:asyncValues", + scoped: false, + text: "\n var __asyncValues = (this && this.__asyncIterator) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator];\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\n };\n " + }; + function createAsyncValuesHelper(context, expression, location) { + context.requestEmitHelper(asyncValues); + return ts.setTextRange(ts.createCall(ts.getHelperName("__asyncValues"), undefined, [expression]), location); + } })(ts || (ts = {})); var ts; (function (ts) { function transformJsx(context) { var compilerOptions = context.getCompilerOptions(); - var currentSourceFile; return transformSourceFile; function transformSourceFile(node) { if (ts.isDeclarationFile(node)) { return node; } - currentSourceFile = node; var visited = ts.visitEachChild(node, visitor, context); ts.addEmitHelpers(visited, context.readEmitHelpers()); - currentSourceFile = undefined; return visited; } function visitor(node) { @@ -39155,11 +42828,11 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 246: + case 248: return visitJsxElement(node, false); - case 247: + case 249: return visitJsxSelfClosingElement(node, false); - case 252: + case 255: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -39169,11 +42842,11 @@ var ts; switch (node.kind) { case 10: return visitJsxText(node); - case 252: + case 255: return visitJsxExpression(node); - case 246: + case 248: return visitJsxElement(node, true); - case 247: + case 249: return visitJsxSelfClosingElement(node, true); default: ts.Debug.failBadSyntaxKind(node); @@ -39189,7 +42862,7 @@ var ts; function visitJsxOpeningLikeElement(node, children, isChild, location) { var tagName = getTagName(node); var objectProperties; - var attrs = node.attributes; + var attrs = node.attributes.properties; if (attrs.length === 0) { objectProperties = ts.createNull(); } @@ -39221,13 +42894,16 @@ var ts; } function transformJsxAttributeInitializer(node) { if (node === undefined) { - return ts.createLiteral(true); + return ts.createTrue(); } else if (node.kind === 9) { var decoded = tryDecodeEntities(node.text); - return decoded ? ts.createLiteral(decoded, node) : node; + return decoded ? ts.setTextRange(ts.createLiteral(decoded), node) : node; } - else if (node.kind === 252) { + else if (node.kind === 255) { + if (node.expression === undefined) { + return ts.createTrue(); + } return visitJsxExpression(node); } else { @@ -39235,43 +42911,35 @@ var ts; } } function visitJsxText(node) { - var text = ts.getTextOfNode(node, true); - var parts; + var fixed = fixupWhitespaceAndDecodeEntities(ts.getTextOfNode(node, true)); + return fixed === undefined ? undefined : ts.createLiteral(fixed); + } + function fixupWhitespaceAndDecodeEntities(text) { + var acc; var firstNonWhitespace = 0; var lastNonWhitespace = -1; for (var i = 0; i < text.length; i++) { var c = text.charCodeAt(i); if (ts.isLineBreak(c)) { - if (firstNonWhitespace !== -1 && (lastNonWhitespace - firstNonWhitespace + 1 > 0)) { - var part = text.substr(firstNonWhitespace, lastNonWhitespace - firstNonWhitespace + 1); - if (!parts) { - parts = []; - } - parts.push(ts.createLiteral(decodeEntities(part))); + if (firstNonWhitespace !== -1 && lastNonWhitespace !== -1) { + acc = addLineOfJsxText(acc, text.substr(firstNonWhitespace, lastNonWhitespace - firstNonWhitespace + 1)); } firstNonWhitespace = -1; } - else if (!ts.isWhiteSpace(c)) { + else if (!ts.isWhiteSpaceSingleLine(c)) { lastNonWhitespace = i; if (firstNonWhitespace === -1) { firstNonWhitespace = i; } } } - if (firstNonWhitespace !== -1) { - var part = text.substr(firstNonWhitespace); - if (!parts) { - parts = []; - } - parts.push(ts.createLiteral(decodeEntities(part))); - } - if (parts) { - return ts.reduceLeft(parts, aggregateJsxTextParts); - } - return undefined; + return firstNonWhitespace !== -1 + ? addLineOfJsxText(acc, text.substr(firstNonWhitespace)) + : acc; } - function aggregateJsxTextParts(left, right) { - return ts.createAdd(ts.createAdd(left, ts.createLiteral(" ")), right); + function addLineOfJsxText(acc, trimmedLine) { + var decoded = decodeEntities(trimmedLine); + return acc === undefined ? decoded : acc + " " + decoded; } function decodeEntities(text) { return text.replace(/&((#((\d+)|x([\da-fA-F]+)))|(\w+));/g, function (match, _all, _number, _digits, decimal, hex, word) { @@ -39282,7 +42950,7 @@ var ts; return String.fromCharCode(parseInt(hex, 16)); } else { - var ch = entities[word]; + var ch = entities.get(word); return ch ? String.fromCharCode(ch) : match; } }); @@ -39292,16 +42960,16 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 246) { + if (node.kind === 248) { return getTagName(node.openingElement); } else { - var name_34 = node.tagName; - if (ts.isIdentifier(name_34) && ts.isIntrinsicJsxName(name_34.text)) { - return ts.createLiteral(name_34.text); + var name = node.tagName; + if (ts.isIdentifier(name) && ts.isIntrinsicJsxName(name.text)) { + return ts.createLiteral(name.text); } else { - return ts.createExpressionFromEntityName(name_34); + return ts.createExpressionFromEntityName(name); } } } @@ -39319,7 +42987,7 @@ var ts; } } ts.transformJsx = transformJsx; - var entities = ts.createMap({ + var entities = ts.createMapFromTemplate({ "quot": 0x0022, "amp": 0x0026, "apos": 0x0027, @@ -39576,263 +43244,6 @@ var ts; }); })(ts || (ts = {})); var ts; -(function (ts) { - function transformES2017(context) { - var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; - var resolver = context.getEmitResolver(); - var compilerOptions = context.getCompilerOptions(); - var languageVersion = ts.getEmitScriptTarget(compilerOptions); - var currentSourceFile; - var enabledSubstitutions; - var currentSuperContainer; - var previousOnEmitNode = context.onEmitNode; - var previousOnSubstituteNode = context.onSubstituteNode; - context.onEmitNode = onEmitNode; - context.onSubstituteNode = onSubstituteNode; - return transformSourceFile; - function transformSourceFile(node) { - if (ts.isDeclarationFile(node)) { - return node; - } - currentSourceFile = node; - var visited = ts.visitEachChild(node, visitor, context); - ts.addEmitHelpers(visited, context.readEmitHelpers()); - currentSourceFile = undefined; - return visited; - } - function visitor(node) { - if ((node.transformFlags & 16) === 0) { - return node; - } - switch (node.kind) { - case 119: - return undefined; - case 189: - return visitAwaitExpression(node); - case 149: - return visitMethodDeclaration(node); - case 225: - return visitFunctionDeclaration(node); - case 184: - return visitFunctionExpression(node); - case 185: - return visitArrowFunction(node); - default: - return ts.visitEachChild(node, visitor, context); - } - } - function visitAwaitExpression(node) { - return ts.setOriginalNode(ts.createYield(undefined, ts.visitNode(node.expression, visitor, ts.isExpression), node), node); - } - function visitMethodDeclaration(node) { - return ts.updateMethod(node, undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - function visitFunctionDeclaration(node) { - return ts.updateFunctionDeclaration(node, undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - function visitFunctionExpression(node) { - if (ts.nodeIsMissing(node.body)) { - return ts.createOmittedExpression(); - } - return ts.updateFunctionExpression(node, undefined, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - function visitArrowFunction(node) { - return ts.updateArrowFunction(node, ts.visitNodes(node.modifiers, visitor, ts.isModifier), undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - function transformAsyncFunctionBody(node) { - resumeLexicalEnvironment(); - var original = ts.getOriginalNode(node, ts.isFunctionLike); - var nodeType = original.type; - var promiseConstructor = languageVersion < 2 ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 185; - var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192) !== 0; - if (!isArrowFunction) { - var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.body.statements, false, visitor); - statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body, statementOffset)))); - ts.addRange(statements, endLexicalEnvironment()); - var block = ts.createBlock(statements, node.body, true); - if (languageVersion >= 2) { - if (resolver.getNodeCheckFlags(node) & 4096) { - enableSubstitutionForAsyncMethodsWithSuper(); - ts.addEmitHelper(block, advancedAsyncSuperHelper); - } - else if (resolver.getNodeCheckFlags(node) & 2048) { - enableSubstitutionForAsyncMethodsWithSuper(); - ts.addEmitHelper(block, asyncSuperHelper); - } - } - return block; - } - else { - var expression = createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body)); - var declarations = endLexicalEnvironment(); - if (ts.some(declarations)) { - var block = ts.convertToFunctionBody(expression); - return ts.updateBlock(block, ts.createNodeArray(ts.concatenate(block.statements, declarations), block.statements)); - } - return expression; - } - } - function transformFunctionBodyWorker(body, start) { - if (ts.isBlock(body)) { - return ts.updateBlock(body, ts.visitLexicalEnvironment(body.statements, visitor, context, start)); - } - else { - startLexicalEnvironment(); - var visited = ts.convertToFunctionBody(ts.visitNode(body, visitor, ts.isConciseBody)); - var declarations = endLexicalEnvironment(); - return ts.updateBlock(visited, ts.createNodeArray(ts.concatenate(visited.statements, declarations), visited.statements)); - } - } - function getPromiseConstructor(type) { - var typeName = type && ts.getEntityNameFromTypeNode(type); - if (typeName && ts.isEntityName(typeName)) { - var serializationKind = resolver.getTypeReferenceSerializationKind(typeName); - if (serializationKind === ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue - || serializationKind === ts.TypeReferenceSerializationKind.Unknown) { - return typeName; - } - } - return undefined; - } - function enableSubstitutionForAsyncMethodsWithSuper() { - if ((enabledSubstitutions & 1) === 0) { - enabledSubstitutions |= 1; - context.enableSubstitution(179); - context.enableSubstitution(177); - context.enableSubstitution(178); - context.enableEmitNotification(226); - context.enableEmitNotification(149); - context.enableEmitNotification(151); - context.enableEmitNotification(152); - context.enableEmitNotification(150); - } - } - function substituteExpression(node) { - switch (node.kind) { - case 177: - return substitutePropertyAccessExpression(node); - case 178: - return substituteElementAccessExpression(node); - case 179: - if (enabledSubstitutions & 1) { - return substituteCallExpression(node); - } - break; - } - return node; - } - function substitutePropertyAccessExpression(node) { - if (enabledSubstitutions & 1 && node.expression.kind === 96) { - var flags = getSuperContainerAsyncMethodFlags(); - if (flags) { - return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), flags, node); - } - } - return node; - } - function substituteElementAccessExpression(node) { - if (enabledSubstitutions & 1 && node.expression.kind === 96) { - var flags = getSuperContainerAsyncMethodFlags(); - if (flags) { - return createSuperAccessInAsyncMethod(node.argumentExpression, flags, node); - } - } - return node; - } - function substituteCallExpression(node) { - var expression = node.expression; - if (ts.isSuperProperty(expression)) { - var flags = getSuperContainerAsyncMethodFlags(); - if (flags) { - var argumentExpression = ts.isPropertyAccessExpression(expression) - ? substitutePropertyAccessExpression(expression) - : substituteElementAccessExpression(expression); - return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), undefined, [ - ts.createThis() - ].concat(node.arguments)); - } - } - return node; - } - function isSuperContainer(node) { - var kind = node.kind; - return kind === 226 - || kind === 150 - || kind === 149 - || kind === 151 - || kind === 152; - } - function onEmitNode(emitContext, node, emitCallback) { - if (enabledSubstitutions & 1 && isSuperContainer(node)) { - var savedCurrentSuperContainer = currentSuperContainer; - currentSuperContainer = node; - previousOnEmitNode(emitContext, node, emitCallback); - currentSuperContainer = savedCurrentSuperContainer; - } - else { - previousOnEmitNode(emitContext, node, emitCallback); - } - } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1) { - return substituteExpression(node); - } - return node; - } - function createSuperAccessInAsyncMethod(argumentExpression, flags, location) { - if (flags & 4096) { - return ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression]), "value", location); - } - else { - return ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression], location); - } - } - function getSuperContainerAsyncMethodFlags() { - return currentSuperContainer !== undefined - && resolver.getNodeCheckFlags(currentSuperContainer) & (2048 | 4096); - } - } - ts.transformES2017 = transformES2017; - function createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, body) { - context.requestEmitHelper(awaiterHelper); - var generatorFunc = ts.createFunctionExpression(undefined, ts.createToken(38), undefined, undefined, [], undefined, body); - (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 131072; - return ts.createCall(ts.getHelperName("__awaiter"), undefined, [ - ts.createThis(), - hasLexicalArguments ? ts.createIdentifier("arguments") : ts.createVoidZero(), - promiseConstructor ? ts.createExpressionFromEntityName(promiseConstructor) : ts.createVoidZero(), - generatorFunc - ]); - } - var awaiterHelper = { - name: "typescript:awaiter", - scoped: false, - priority: 5, - text: "\n var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments)).next());\n });\n };" - }; - var asyncSuperHelper = { - name: "typescript:async-super", - scoped: true, - text: "\n const _super = name => super[name];" - }; - var advancedAsyncSuperHelper = { - name: "typescript:advanced-async-super", - scoped: true, - text: "\n const _super = (function (geti, seti) {\n const cache = Object.create(null);\n return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n })(name => super[name], (name, value) => super[name] = value);" - }; -})(ts || (ts = {})); -var ts; (function (ts) { function transformES2016(context) { var hoistVariableDeclaration = context.hoistVariableDeclaration; @@ -39848,7 +43259,7 @@ var ts; return node; } switch (node.kind) { - case 192: + case 193: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -39872,19 +43283,19 @@ var ts; if (ts.isElementAccessExpression(left)) { var expressionTemp = ts.createTempVariable(hoistVariableDeclaration); var argumentExpressionTemp = ts.createTempVariable(hoistVariableDeclaration); - target = ts.createElementAccess(ts.createAssignment(expressionTemp, left.expression, left.expression), ts.createAssignment(argumentExpressionTemp, left.argumentExpression, left.argumentExpression), left); - value = ts.createElementAccess(expressionTemp, argumentExpressionTemp, left); + target = ts.setTextRange(ts.createElementAccess(ts.setTextRange(ts.createAssignment(expressionTemp, left.expression), left.expression), ts.setTextRange(ts.createAssignment(argumentExpressionTemp, left.argumentExpression), left.argumentExpression)), left); + value = ts.setTextRange(ts.createElementAccess(expressionTemp, argumentExpressionTemp), left); } else if (ts.isPropertyAccessExpression(left)) { var expressionTemp = ts.createTempVariable(hoistVariableDeclaration); - target = ts.createPropertyAccess(ts.createAssignment(expressionTemp, left.expression, left.expression), left.name, left); - value = ts.createPropertyAccess(expressionTemp, left.name, left); + target = ts.setTextRange(ts.createPropertyAccess(ts.setTextRange(ts.createAssignment(expressionTemp, left.expression), left.expression), left.name), left); + value = ts.setTextRange(ts.createPropertyAccess(expressionTemp, left.name), left); } else { target = left; value = left; } - return ts.createAssignment(target, ts.createMathPow(value, right, node), node); + return ts.setTextRange(ts.createAssignment(target, ts.createMathPow(value, right, node)), node); } function visitExponentiationExpression(node) { var left = ts.visitNode(node.left, visitor, ts.isExpression); @@ -39898,6 +43309,7 @@ var ts; (function (ts) { function transformES2015(context) { var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration; + var compilerOptions = context.getCompilerOptions(); var resolver = context.getEmitResolver(); var previousOnSubstituteNode = context.onSubstituteNode; var previousOnEmitNode = context.onEmitNode; @@ -39905,15 +43317,7 @@ var ts; context.onSubstituteNode = onSubstituteNode; var currentSourceFile; var currentText; - var currentParent; - var currentNode; - var enclosingVariableStatement; - var enclosingBlockScopeContainer; - var enclosingBlockScopeContainerParent; - var enclosingFunction; - var enclosingNonArrowFunction; - var enclosingNonAsyncFunctionBody; - var isInConstructorWithCapturedSuper; + var hierarchyFacts; var convertedLoopState; var enabledSubstitutions; return transformSourceFile; @@ -39923,247 +43327,207 @@ var ts; } currentSourceFile = node; currentText = node.text; - var visited = saveStateAndInvoke(node, visitSourceFile); + var visited = visitSourceFile(node); ts.addEmitHelpers(visited, context.readEmitHelpers()); currentSourceFile = undefined; currentText = undefined; + hierarchyFacts = 0; return visited; } - function visitor(node) { - return saveStateAndInvoke(node, dispatcher); + function enterSubtree(excludeFacts, includeFacts) { + var ancestorFacts = hierarchyFacts; + hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & 16383; + return ancestorFacts; } - function dispatcher(node) { - return convertedLoopState - ? visitorForConvertedLoopWorker(node) - : visitorWorker(node); - } - function saveStateAndInvoke(node, f) { - var savedEnclosingFunction = enclosingFunction; - var savedEnclosingNonArrowFunction = enclosingNonArrowFunction; - var savedEnclosingNonAsyncFunctionBody = enclosingNonAsyncFunctionBody; - var savedEnclosingBlockScopeContainer = enclosingBlockScopeContainer; - var savedEnclosingBlockScopeContainerParent = enclosingBlockScopeContainerParent; - var savedEnclosingVariableStatement = enclosingVariableStatement; - var savedCurrentParent = currentParent; - var savedCurrentNode = currentNode; - var savedConvertedLoopState = convertedLoopState; - var savedIsInConstructorWithCapturedSuper = isInConstructorWithCapturedSuper; - if (ts.nodeStartsNewLexicalEnvironment(node)) { - isInConstructorWithCapturedSuper = false; - convertedLoopState = undefined; - } - onBeforeVisitNode(node); - var visited = f(node); - isInConstructorWithCapturedSuper = savedIsInConstructorWithCapturedSuper; - convertedLoopState = savedConvertedLoopState; - enclosingFunction = savedEnclosingFunction; - enclosingNonArrowFunction = savedEnclosingNonArrowFunction; - enclosingNonAsyncFunctionBody = savedEnclosingNonAsyncFunctionBody; - enclosingBlockScopeContainer = savedEnclosingBlockScopeContainer; - enclosingBlockScopeContainerParent = savedEnclosingBlockScopeContainerParent; - enclosingVariableStatement = savedEnclosingVariableStatement; - currentParent = savedCurrentParent; - currentNode = savedCurrentNode; - return visited; - } - function onBeforeVisitNode(node) { - if (currentNode) { - if (ts.isBlockScope(currentNode, currentParent)) { - enclosingBlockScopeContainer = currentNode; - enclosingBlockScopeContainerParent = currentParent; - } - if (ts.isFunctionLike(currentNode)) { - enclosingFunction = currentNode; - if (currentNode.kind !== 185) { - enclosingNonArrowFunction = currentNode; - if (!(ts.getEmitFlags(currentNode) & 131072)) { - enclosingNonAsyncFunctionBody = currentNode; - } - } - } - switch (currentNode.kind) { - case 205: - enclosingVariableStatement = currentNode; - break; - case 224: - case 223: - case 174: - case 172: - case 173: - break; - default: - enclosingVariableStatement = undefined; - } - } - currentParent = currentNode; - currentNode = node; - } - function returnCapturedThis(node) { - return ts.setOriginalNode(ts.createReturn(ts.createIdentifier("_this")), node); + function exitSubtree(ancestorFacts, excludeFacts, includeFacts) { + hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & -16384 | ancestorFacts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { - return isInConstructorWithCapturedSuper && node.kind === 216 && !node.expression; + return hierarchyFacts & 4096 + && node.kind === 218 + && !node.expression; } - function shouldCheckNode(node) { - return (node.transformFlags & 64) !== 0 || - node.kind === 219 || - (ts.isIterationStatement(node, false) && shouldConvertIterationStatementBody(node)); + function shouldVisitNode(node) { + return (node.transformFlags & 128) !== 0 + || convertedLoopState !== undefined + || (hierarchyFacts & 4096 && ts.isStatement(node)) + || (ts.isIterationStatement(node, false) && shouldConvertIterationStatementBody(node)); } - function visitorWorker(node) { - if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { - return returnCapturedThis(node); - } - else if (shouldCheckNode(node)) { + function visitor(node) { + if (shouldVisitNode(node)) { return visitJavaScript(node); } - else if (node.transformFlags & 128 || (isInConstructorWithCapturedSuper && !ts.isExpression(node))) { - return ts.visitEachChild(node, visitor, context); - } else { return node; } } - function visitorForConvertedLoopWorker(node) { - var result; - if (shouldCheckNode(node)) { - result = visitJavaScript(node); + function functionBodyVisitor(node) { + if (shouldVisitNode(node)) { + return visitBlock(node, true); } - else { - result = visitNodesInConvertedLoop(node); - } - return result; + return node; } - function visitNodesInConvertedLoop(node) { - switch (node.kind) { - case 216: - node = isReturnVoidStatementInConstructorWithCapturedSuper(node) ? returnCapturedThis(node) : node; - return visitReturnStatement(node); - case 205: - return visitVariableStatement(node); - case 218: - return visitSwitchStatement(node); - case 215: - case 214: - return visitBreakOrContinueStatement(node); - case 98: - return visitThisKeyword(node); - case 70: - return visitIdentifier(node); - default: - return ts.visitEachChild(node, visitor, context); + function callExpressionVisitor(node) { + if (node.kind === 96) { + return visitSuperKeyword(true); } + return visitor(node); } function visitJavaScript(node) { switch (node.kind) { case 114: return undefined; - case 226: + case 228: return visitClassDeclaration(node); - case 197: + case 198: return visitClassExpression(node); - case 144: + case 145: return visitParameter(node); - case 225: + case 227: return visitFunctionDeclaration(node); - case 185: + case 186: return visitArrowFunction(node); - case 184: + case 185: return visitFunctionExpression(node); - case 223: + case 225: return visitVariableDeclaration(node); case 70: return visitIdentifier(node); - case 224: + case 226: return visitVariableDeclarationList(node); - case 219: + case 220: + return visitSwitchStatement(node); + case 234: + return visitCaseBlock(node); + case 206: + return visitBlock(node, false); + case 217: + case 216: + return visitBreakOrContinueStatement(node); + case 221: return visitLabeledStatement(node); - case 209: - return visitDoStatement(node); - case 210: - return visitWhileStatement(node); case 211: - return visitForStatement(node); case 212: - return visitForInStatement(node); + return visitDoOrWhileStatement(node, undefined); case 213: - return visitForOfStatement(node); - case 207: + return visitForStatement(node, undefined); + case 214: + return visitForInStatement(node, undefined); + case 215: + return visitForOfStatement(node, undefined); + case 209: return visitExpressionStatement(node); - case 176: + case 177: return visitObjectLiteralExpression(node); - case 256: + case 259: return visitCatchClause(node); - case 258: + case 261: return visitShorthandPropertyAssignment(node); - case 175: + case 143: + return visitComputedPropertyName(node); + case 176: return visitArrayLiteralExpression(node); - case 179: - return visitCallExpression(node); case 180: + return visitCallExpression(node); + case 181: return visitNewExpression(node); - case 183: + case 184: return visitParenthesizedExpression(node, true); - case 192: + case 193: return visitBinaryExpression(node, true); case 12: case 13: case 14: case 15: return visitTemplateLiteral(node); - case 181: + case 9: + return visitStringLiteral(node); + case 8: + return visitNumericLiteral(node); + case 182: return visitTaggedTemplateExpression(node); - case 194: - return visitTemplateExpression(node); case 195: - return visitYieldExpression(node); + return visitTemplateExpression(node); case 196: + return visitYieldExpression(node); + case 197: return visitSpreadElement(node); case 96: - return visitSuperKeyword(); - case 195: - return ts.visitEachChild(node, visitor, context); - case 149: + return visitSuperKeyword(false); + case 98: + return visitThisKeyword(node); + case 203: + return visitMetaProperty(node); + case 150: return visitMethodDeclaration(node); - case 205: + case 152: + case 153: + return visitAccessorDeclaration(node); + case 207: return visitVariableStatement(node); + case 218: + return visitReturnStatement(node); default: - ts.Debug.failBadSyntaxKind(node); return ts.visitEachChild(node, visitor, context); } } function visitSourceFile(node) { + var ancestorFacts = enterSubtree(3968, 64); var statements = []; startLexicalEnvironment(); - var statementOffset = ts.addPrologueDirectives(statements, node.statements, false, visitor); + var statementOffset = ts.addStandardPrologue(statements, node.statements, false); addCaptureThisForNodeIfNeeded(statements, node); + statementOffset = ts.addCustomPrologue(statements, node.statements, statementOffset, visitor); ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset)); ts.addRange(statements, endLexicalEnvironment()); - return ts.updateSourceFileNode(node, ts.createNodeArray(statements, node.statements)); + exitSubtree(ancestorFacts, 0, 0); + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements)); } function visitSwitchStatement(node) { - ts.Debug.assert(convertedLoopState !== undefined); - var savedAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; - convertedLoopState.allowedNonLabeledJumps |= 2; - var result = ts.visitEachChild(node, visitor, context); - convertedLoopState.allowedNonLabeledJumps = savedAllowedNonLabeledJumps; - return result; + if (convertedLoopState !== undefined) { + var savedAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; + convertedLoopState.allowedNonLabeledJumps |= 2; + var result = ts.visitEachChild(node, visitor, context); + convertedLoopState.allowedNonLabeledJumps = savedAllowedNonLabeledJumps; + return result; + } + return ts.visitEachChild(node, visitor, context); + } + function visitCaseBlock(node) { + var ancestorFacts = enterSubtree(4032, 0); + var updated = ts.visitEachChild(node, visitor, context); + exitSubtree(ancestorFacts, 0, 0); + return updated; + } + function returnCapturedThis(node) { + return ts.setOriginalNode(ts.createReturn(ts.createIdentifier("_this")), node); } function visitReturnStatement(node) { - ts.Debug.assert(convertedLoopState !== undefined); - convertedLoopState.nonLocalJumps |= 8; - return ts.createReturn(ts.createObjectLiteral([ - ts.createPropertyAssignment(ts.createIdentifier("value"), node.expression - ? ts.visitNode(node.expression, visitor, ts.isExpression) - : ts.createVoidZero()) - ])); + if (convertedLoopState) { + convertedLoopState.nonLocalJumps |= 8; + if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { + node = returnCapturedThis(node); + } + return ts.createReturn(ts.createObjectLiteral([ + ts.createPropertyAssignment(ts.createIdentifier("value"), node.expression + ? ts.visitNode(node.expression, visitor, ts.isExpression) + : ts.createVoidZero()) + ])); + } + else if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { + return returnCapturedThis(node); + } + return ts.visitEachChild(node, visitor, context); } function visitThisKeyword(node) { - ts.Debug.assert(convertedLoopState !== undefined); - if (enclosingFunction && enclosingFunction.kind === 185) { - convertedLoopState.containsLexicalThis = true; - return node; + if (convertedLoopState) { + if (hierarchyFacts & 2) { + convertedLoopState.containsLexicalThis = true; + return node; + } + return convertedLoopState.thisName || (convertedLoopState.thisName = ts.createUniqueName("this")); } - return convertedLoopState.thisName || (convertedLoopState.thisName = ts.createUniqueName("this")); + return node; } function visitIdentifier(node) { if (!convertedLoopState) { @@ -40172,20 +43536,20 @@ var ts; if (ts.isGeneratedIdentifier(node)) { return node; } - if (node.text !== "arguments" && !resolver.isArgumentsLocalBinding(node)) { + if (node.text !== "arguments" || !resolver.isArgumentsLocalBinding(node)) { return node; } return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = ts.createUniqueName("arguments")); } function visitBreakOrContinueStatement(node) { if (convertedLoopState) { - var jump = node.kind === 215 ? 2 : 4; - var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels[node.label.text]) || + var jump = node.kind === 217 ? 2 : 4; + var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(node.label.text)) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; if (!node.label) { - if (node.kind === 215) { + if (node.kind === 217) { convertedLoopState.nonLocalJumps |= 2; labelMarker = "break"; } @@ -40195,7 +43559,7 @@ var ts; } } else { - if (node.kind === 215) { + if (node.kind === 217) { labelMarker = "break-" + node.label.text; setLabeledJump(convertedLoopState, true, node.label.text, labelMarker); } @@ -40228,8 +43592,9 @@ var ts; var variable = ts.createVariableDeclaration(ts.getLocalName(node, true), undefined, transformClassLikeDeclarationToExpression(node)); ts.setOriginalNode(variable, node); var statements = []; - var statement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([variable]), node); + var statement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([variable])); ts.setOriginalNode(statement, node); + ts.setTextRange(statement, node); ts.startOnNewLine(statement); statements.push(statement); if (ts.hasModifier(node, 1)) { @@ -40284,23 +43649,29 @@ var ts; ts.setEmitFlags(statement, 1536 | 384); statements.push(statement); ts.addRange(statements, endLexicalEnvironment()); - var block = ts.createBlock(ts.createNodeArray(statements, node.members), undefined, true); + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), node.members), true); ts.setEmitFlags(block, 1536); return block; } function addExtendsHelperIfNeeded(statements, node, extendsClauseElement) { if (extendsClauseElement) { - statements.push(ts.createStatement(createExtendsHelper(context, ts.getLocalName(node)), extendsClauseElement)); + statements.push(ts.setTextRange(ts.createStatement(createExtendsHelper(context, ts.getLocalName(node))), extendsClauseElement)); } } function addConstructor(statements, node, extendsClauseElement) { + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16278, 73); var constructor = ts.getFirstConstructorWithBody(node); var hasSynthesizedSuper = hasSynthesizedDefaultSuperCall(constructor, extendsClauseElement !== undefined); - var constructorFunction = ts.createFunctionDeclaration(undefined, undefined, undefined, ts.getDeclarationName(node), undefined, transformConstructorParameters(constructor, hasSynthesizedSuper), undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper), constructor || node); + var constructorFunction = ts.createFunctionDeclaration(undefined, undefined, undefined, ts.getDeclarationName(node), undefined, transformConstructorParameters(constructor, hasSynthesizedSuper), undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper)); + ts.setTextRange(constructorFunction, constructor || node); if (extendsClauseElement) { ts.setEmitFlags(constructorFunction, 8); } statements.push(constructorFunction); + exitSubtree(ancestorFacts, 49152, 0); + convertedLoopState = savedConvertedLoopState; } function transformConstructorParameters(constructor, hasSynthesizedSuper) { return ts.visitParameterList(constructor && !hasSynthesizedSuper && constructor.parameters, visitor, context) @@ -40314,48 +43685,55 @@ var ts; statementOffset = 0; } else if (constructor) { - statementOffset = ts.addPrologueDirectives(statements, constructor.body.statements, false, visitor); + statementOffset = ts.addStandardPrologue(statements, constructor.body.statements, false); } if (constructor) { addDefaultValueAssignmentsIfNeeded(statements, constructor); addRestParameterIfNeeded(statements, constructor, hasSynthesizedSuper); + if (!hasSynthesizedSuper) { + statementOffset = ts.addCustomPrologue(statements, constructor.body.statements, statementOffset, visitor); + } ts.Debug.assert(statementOffset >= 0, "statementOffset not initialized correctly!"); } - var superCaptureStatus = declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, constructor, !!extendsClauseElement, hasSynthesizedSuper, statementOffset); + var isDerivedClass = extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 94; + var superCaptureStatus = declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, constructor, isDerivedClass, hasSynthesizedSuper, statementOffset); if (superCaptureStatus === 1 || superCaptureStatus === 2) { statementOffset++; } if (constructor) { - var body = saveStateAndInvoke(constructor, function (constructor) { - isInConstructorWithCapturedSuper = superCaptureStatus === 1; - return ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, statementOffset); - }); - ts.addRange(statements, body); + if (superCaptureStatus === 1) { + hierarchyFacts |= 4096; + } + ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, statementOffset)); } - if (extendsClauseElement + if (isDerivedClass && superCaptureStatus !== 2 && !(constructor && isSufficientlyCoveredByReturnStatements(constructor.body))) { statements.push(ts.createReturn(ts.createIdentifier("_this"))); } ts.addRange(statements, endLexicalEnvironment()); - var block = ts.createBlock(ts.createNodeArray(statements, constructor ? constructor.body.statements : node.members), constructor ? constructor.body : node, true); + if (constructor) { + prependCaptureNewTargetIfNeeded(statements, constructor, false); + } + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), constructor ? constructor.body.statements : node.members), true); + ts.setTextRange(block, constructor ? constructor.body : node); if (!constructor) { ts.setEmitFlags(block, 1536); } return block; } function isSufficientlyCoveredByReturnStatements(statement) { - if (statement.kind === 216) { + if (statement.kind === 218) { return true; } - else if (statement.kind === 208) { + else if (statement.kind === 210) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement); } } - else if (statement.kind === 204) { + else if (statement.kind === 206) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -40363,8 +43741,8 @@ var ts; } return false; } - function declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, ctor, hasExtendsClause, hasSynthesizedSuper, statementOffset) { - if (!hasExtendsClause) { + function declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, ctor, isDerivedClass, hasSynthesizedSuper, statementOffset) { + if (!isDerivedClass) { if (ctor) { addCaptureThisForNodeIfNeeded(statements, ctor); } @@ -40384,42 +43762,43 @@ var ts; var ctorStatements = ctor.body.statements; if (statementOffset < ctorStatements.length) { firstStatement = ctorStatements[statementOffset]; - if (firstStatement.kind === 207 && ts.isSuperCall(firstStatement.expression)) { - var superCall = firstStatement.expression; - superCallExpression = ts.setOriginalNode(saveStateAndInvoke(superCall, visitImmediateSuperCallInBody), superCall); + if (firstStatement.kind === 209 && ts.isSuperCall(firstStatement.expression)) { + superCallExpression = visitImmediateSuperCallInBody(firstStatement.expression); } } - if (superCallExpression && statementOffset === ctorStatements.length - 1) { + if (superCallExpression + && statementOffset === ctorStatements.length - 1 + && !(ctor.transformFlags & (16384 | 32768))) { var returnStatement = ts.createReturn(superCallExpression); - if (superCallExpression.kind !== 192 - || superCallExpression.left.kind !== 179) { + if (superCallExpression.kind !== 193 + || superCallExpression.left.kind !== 180) { ts.Debug.fail("Assumed generated super call would have form 'super.call(...) || this'."); } ts.setCommentRange(returnStatement, ts.getCommentRange(ts.setEmitFlags(superCallExpression.left, 1536))); statements.push(returnStatement); return 2; } - captureThisForNode(statements, ctor, superCallExpression, firstStatement); + captureThisForNode(statements, ctor, superCallExpression || createActualThis(), firstStatement); if (superCallExpression) { return 1; } return 0; } + function createActualThis() { + return ts.setEmitFlags(ts.createThis(), 4); + } function createDefaultSuperCallOrThis() { - var actualThis = ts.createThis(); - ts.setEmitFlags(actualThis, 4); - var superCall = ts.createFunctionApply(ts.createIdentifier("_super"), actualThis, ts.createIdentifier("arguments")); - return ts.createLogicalOr(superCall, actualThis); + return ts.createLogicalOr(ts.createLogicalAnd(ts.createStrictInequality(ts.createIdentifier("_super"), ts.createNull()), ts.createFunctionApply(ts.createIdentifier("_super"), createActualThis(), ts.createIdentifier("arguments"))), createActualThis()); } function visitParameter(node) { if (node.dotDotDotToken) { return undefined; } else if (ts.isBindingPattern(node.name)) { - return ts.setOriginalNode(ts.createParameter(undefined, undefined, undefined, ts.getGeneratedNameForNode(node), undefined, undefined, undefined, node), node); + return ts.setOriginalNode(ts.setTextRange(ts.createParameter(undefined, undefined, undefined, ts.getGeneratedNameForNode(node), undefined, undefined, undefined), node), node); } else if (node.initializer) { - return ts.setOriginalNode(ts.createParameter(undefined, undefined, undefined, node.name, undefined, undefined, undefined, node), node); + return ts.setOriginalNode(ts.setTextRange(ts.createParameter(undefined, undefined, undefined, node.name, undefined, undefined, undefined), node), node); } else { return node; @@ -40434,15 +43813,15 @@ var ts; } for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { var parameter = _a[_i]; - var name_35 = parameter.name, initializer = parameter.initializer, dotDotDotToken = parameter.dotDotDotToken; + var name = parameter.name, initializer = parameter.initializer, dotDotDotToken = parameter.dotDotDotToken; if (dotDotDotToken) { continue; } - if (ts.isBindingPattern(name_35)) { - addDefaultValueAssignmentForBindingPattern(statements, parameter, name_35, initializer); + if (ts.isBindingPattern(name)) { + addDefaultValueAssignmentForBindingPattern(statements, parameter, name, initializer); } else if (initializer) { - addDefaultValueAssignmentForInitializer(statements, parameter, name_35, initializer); + addDefaultValueAssignmentForInitializer(statements, parameter, name, initializer); } } } @@ -40457,10 +43836,11 @@ var ts; } function addDefaultValueAssignmentForInitializer(statements, parameter, name, initializer) { initializer = ts.visitNode(initializer, visitor, ts.isExpression); - var statement = ts.createIf(ts.createTypeCheck(ts.getSynthesizedClone(name), "undefined"), ts.setEmitFlags(ts.createBlock([ - ts.createStatement(ts.createAssignment(ts.setEmitFlags(ts.getMutableClone(name), 48), ts.setEmitFlags(initializer, 48 | ts.getEmitFlags(initializer)), parameter)) - ], parameter), 1 | 32 | 384), undefined, parameter); + var statement = ts.createIf(ts.createTypeCheck(ts.getSynthesizedClone(name), "undefined"), ts.setEmitFlags(ts.setTextRange(ts.createBlock([ + ts.createStatement(ts.setTextRange(ts.createAssignment(ts.setEmitFlags(ts.getMutableClone(name), 48), ts.setEmitFlags(initializer, 48 | ts.getEmitFlags(initializer))), parameter)) + ]), parameter), 1 | 32 | 384)); statement.startsOnNewLine = true; + ts.setTextRange(statement, parameter); ts.setEmitFlags(statement, 384 | 32 | 524288); statements.push(statement); } @@ -40477,22 +43857,22 @@ var ts; var expressionName = ts.getSynthesizedClone(parameter.name); var restIndex = node.parameters.length - 1; var temp = ts.createLoopVariable(); - statements.push(ts.setEmitFlags(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ + statements.push(ts.setEmitFlags(ts.setTextRange(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ ts.createVariableDeclaration(declarationName, undefined, ts.createArrayLiteral([])) - ]), parameter), 524288)); - var forStatement = ts.createFor(ts.createVariableDeclarationList([ + ])), parameter), 524288)); + var forStatement = ts.createFor(ts.setTextRange(ts.createVariableDeclarationList([ ts.createVariableDeclaration(temp, undefined, ts.createLiteral(restIndex)) - ], parameter), ts.createLessThan(temp, ts.createPropertyAccess(ts.createIdentifier("arguments"), "length"), parameter), ts.createPostfixIncrement(temp, parameter), ts.createBlock([ - ts.startOnNewLine(ts.createStatement(ts.createAssignment(ts.createElementAccess(expressionName, restIndex === 0 + ]), parameter), ts.setTextRange(ts.createLessThan(temp, ts.createPropertyAccess(ts.createIdentifier("arguments"), "length")), parameter), ts.setTextRange(ts.createPostfixIncrement(temp), parameter), ts.createBlock([ + ts.startOnNewLine(ts.setTextRange(ts.createStatement(ts.createAssignment(ts.createElementAccess(expressionName, restIndex === 0 ? temp - : ts.createSubtract(temp, ts.createLiteral(restIndex))), ts.createElementAccess(ts.createIdentifier("arguments"), temp)), parameter)) + : ts.createSubtract(temp, ts.createLiteral(restIndex))), ts.createElementAccess(ts.createIdentifier("arguments"), temp))), parameter)) ])); ts.setEmitFlags(forStatement, 524288); ts.startOnNewLine(forStatement); statements.push(forStatement); } function addCaptureThisForNodeIfNeeded(statements, node) { - if (node.transformFlags & 32768 && node.kind !== 185) { + if (node.transformFlags & 32768 && node.kind !== 186) { captureThisForNode(statements, node, ts.createThis()); } } @@ -40500,29 +43880,62 @@ var ts; enableSubstitutionsForCapturedThis(); var captureThisStatement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ ts.createVariableDeclaration("_this", undefined, initializer) - ]), originalStatement); + ])); ts.setEmitFlags(captureThisStatement, 1536 | 524288); + ts.setTextRange(captureThisStatement, originalStatement); ts.setSourceMapRange(captureThisStatement, node); statements.push(captureThisStatement); } + function prependCaptureNewTargetIfNeeded(statements, node, copyOnWrite) { + if (hierarchyFacts & 16384) { + var newTarget = void 0; + switch (node.kind) { + case 186: + return statements; + case 150: + case 152: + case 153: + newTarget = ts.createVoidZero(); + break; + case 151: + newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4), "constructor"); + break; + case 227: + case 185: + newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4), 92, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4), "constructor"), ts.createVoidZero()); + break; + default: + ts.Debug.failBadSyntaxKind(node); + break; + } + var captureNewTargetStatement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration("_newTarget", undefined, newTarget) + ])); + if (copyOnWrite) { + return [captureNewTargetStatement].concat(statements); + } + statements.unshift(captureNewTargetStatement); + } + return statements; + } function addClassMembers(statements, node) { for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 203: + case 205: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 149: - statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member)); + case 150: + statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 151: case 152: + case 153: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { - statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors)); + statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 150: + case 151: break; default: ts.Debug.failBadSyntaxKind(node); @@ -40531,28 +43944,32 @@ var ts; } } function transformSemicolonClassElementToStatement(member) { - return ts.createEmptyStatement(member); + return ts.setTextRange(ts.createEmptyStatement(), member); } - function transformClassMethodDeclarationToStatement(receiver, member) { + function transformClassMethodDeclarationToStatement(receiver, member, container) { + var ancestorFacts = enterSubtree(0, 0); var commentRange = ts.getCommentRange(member); var sourceMapRange = ts.getSourceMapRange(member); var memberName = ts.createMemberAccessForPropertyName(receiver, ts.visitNode(member.name, visitor, ts.isPropertyName), member.name); - var memberFunction = transformFunctionLikeToExpression(member, member, undefined); + var memberFunction = transformFunctionLikeToExpression(member, member, undefined, container); ts.setEmitFlags(memberFunction, 1536); ts.setSourceMapRange(memberFunction, sourceMapRange); - var statement = ts.createStatement(ts.createAssignment(memberName, memberFunction), member); + var statement = ts.setTextRange(ts.createStatement(ts.createAssignment(memberName, memberFunction)), member); ts.setOriginalNode(statement, member); ts.setCommentRange(statement, commentRange); ts.setEmitFlags(statement, 48); + exitSubtree(ancestorFacts, 49152, hierarchyFacts & 49152 ? 16384 : 0); return statement; } - function transformAccessorsToStatement(receiver, accessors) { - var statement = ts.createStatement(transformAccessorsToExpression(receiver, accessors, false), ts.getSourceMapRange(accessors.firstAccessor)); + function transformAccessorsToStatement(receiver, accessors, container) { + var statement = ts.createStatement(transformAccessorsToExpression(receiver, accessors, container, false)); ts.setEmitFlags(statement, 1536); + ts.setSourceMapRange(statement, ts.getSourceMapRange(accessors.firstAccessor)); return statement; } - function transformAccessorsToExpression(receiver, _a, startsOnNewLine) { + function transformAccessorsToExpression(receiver, _a, container, startsOnNewLine) { var firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; + var ancestorFacts = enterSubtree(0, 0); var target = ts.getMutableClone(receiver); ts.setEmitFlags(target, 1536 | 32); ts.setSourceMapRange(target, firstAccessor.name); @@ -40561,7 +43978,7 @@ var ts; ts.setSourceMapRange(propertyName, firstAccessor.name); var properties = []; if (getAccessor) { - var getterFunction = transformFunctionLikeToExpression(getAccessor, undefined, undefined); + var getterFunction = transformFunctionLikeToExpression(getAccessor, undefined, undefined, container); ts.setSourceMapRange(getterFunction, ts.getSourceMapRange(getAccessor)); ts.setEmitFlags(getterFunction, 512); var getter = ts.createPropertyAssignment("get", getterFunction); @@ -40569,51 +43986,86 @@ var ts; properties.push(getter); } if (setAccessor) { - var setterFunction = transformFunctionLikeToExpression(setAccessor, undefined, undefined); + var setterFunction = transformFunctionLikeToExpression(setAccessor, undefined, undefined, container); ts.setSourceMapRange(setterFunction, ts.getSourceMapRange(setAccessor)); ts.setEmitFlags(setterFunction, 512); var setter = ts.createPropertyAssignment("set", setterFunction); ts.setCommentRange(setter, ts.getCommentRange(setAccessor)); properties.push(setter); } - properties.push(ts.createPropertyAssignment("enumerable", ts.createLiteral(true)), ts.createPropertyAssignment("configurable", ts.createLiteral(true))); + properties.push(ts.createPropertyAssignment("enumerable", ts.createTrue()), ts.createPropertyAssignment("configurable", ts.createTrue())); var call = ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), undefined, [ target, propertyName, - ts.createObjectLiteral(properties, undefined, true) + ts.createObjectLiteral(properties, true) ]); if (startsOnNewLine) { call.startsOnNewLine = true; } + exitSubtree(ancestorFacts, 49152, hierarchyFacts & 49152 ? 16384 : 0); return call; } function visitArrowFunction(node) { if (node.transformFlags & 16384) { enableSubstitutionsForCapturedThis(); } - var func = ts.createFunctionExpression(undefined, undefined, undefined, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node), node); + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16256, 66); + var func = ts.createFunctionExpression(undefined, undefined, undefined, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + ts.setTextRange(func, node); ts.setOriginalNode(func, node); ts.setEmitFlags(func, 8); + exitSubtree(ancestorFacts, 0, 0); + convertedLoopState = savedConvertedLoopState; return func; } function visitFunctionExpression(node) { - return ts.updateFunctionExpression(node, undefined, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, node.transformFlags & 64 + var ancestorFacts = ts.getEmitFlags(node) & 131072 + ? enterSubtree(16278, 69) + : enterSubtree(16286, 65); + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var parameters = ts.visitParameterList(node.parameters, visitor, context); + var body = node.transformFlags & 64 ? transformFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); + : visitFunctionBodyDownLevel(node); + var name = hierarchyFacts & 16384 + ? ts.getLocalName(node) + : node.name; + exitSubtree(ancestorFacts, 49152, 0); + convertedLoopState = savedConvertedLoopState; + return ts.updateFunctionExpression(node, undefined, node.asteriskToken, name, undefined, parameters, undefined, body); } function visitFunctionDeclaration(node) { - return ts.updateFunctionDeclaration(node, undefined, node.modifiers, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, node.transformFlags & 64 + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16286, 65); + var parameters = ts.visitParameterList(node.parameters, visitor, context); + var body = node.transformFlags & 64 ? transformFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); + : visitFunctionBodyDownLevel(node); + var name = hierarchyFacts & 16384 + ? ts.getLocalName(node) + : node.name; + exitSubtree(ancestorFacts, 49152, 0); + convertedLoopState = savedConvertedLoopState; + return ts.updateFunctionDeclaration(node, undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, name, undefined, parameters, undefined, body); } - function transformFunctionLikeToExpression(node, location, name) { - var savedContainingNonArrowFunction = enclosingNonArrowFunction; - if (node.kind !== 185) { - enclosingNonArrowFunction = node; + function transformFunctionLikeToExpression(node, location, name, container) { + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = container && ts.isClassLike(container) && !ts.hasModifier(node, 32) + ? enterSubtree(16286, 65 | 8) + : enterSubtree(16286, 65); + var parameters = ts.visitParameterList(node.parameters, visitor, context); + var body = transformFunctionBody(node); + if (hierarchyFacts & 16384 && !name && (node.kind === 227 || node.kind === 185)) { + name = ts.getGeneratedNameForNode(node); } - var expression = ts.setOriginalNode(ts.createFunctionExpression(undefined, node.asteriskToken, name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, saveStateAndInvoke(node, transformFunctionBody), location), node); - enclosingNonArrowFunction = savedContainingNonArrowFunction; - return expression; + exitSubtree(ancestorFacts, 49152, 0); + convertedLoopState = savedConvertedLoopState; + return ts.setOriginalNode(ts.setTextRange(ts.createFunctionExpression(undefined, node.asteriskToken, name, undefined, parameters, undefined, body), location), node); } function transformFunctionBody(node) { var multiLine = false; @@ -40625,7 +44077,7 @@ var ts; var statementOffset; resumeLexicalEnvironment(); if (ts.isBlock(body)) { - statementOffset = ts.addPrologueDirectives(statements, body.statements, false, visitor); + statementOffset = ts.addStandardPrologue(statements, body.statements, false); } addCaptureThisForNodeIfNeeded(statements, node); addDefaultValueAssignmentsIfNeeded(statements, node); @@ -40634,6 +44086,7 @@ var ts; multiLine = true; } if (ts.isBlock(body)) { + statementOffset = ts.addCustomPrologue(statements, body.statements, statementOffset, visitor); statementsLocation = body.statements; ts.addRange(statements, ts.visitNodes(body.statements, visitor, ts.isStatement, statementOffset)); if (!multiLine && body.multiLine) { @@ -40641,7 +44094,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 185); + ts.Debug.assert(node.kind === 186); statementsLocation = ts.moveRangeEnd(body, -1); var equalsGreaterThanToken = node.equalsGreaterThanToken; if (!ts.nodeIsSynthesized(equalsGreaterThanToken) && !ts.nodeIsSynthesized(body)) { @@ -40653,17 +44106,20 @@ var ts; } } var expression = ts.visitNode(body, visitor, ts.isExpression); - var returnStatement = ts.createReturn(expression, body); + var returnStatement = ts.createReturn(expression); + ts.setTextRange(returnStatement, body); ts.setEmitFlags(returnStatement, 384 | 32 | 1024); statements.push(returnStatement); closeBraceLocation = body; } var lexicalEnvironment = context.endLexicalEnvironment(); ts.addRange(statements, lexicalEnvironment); + prependCaptureNewTargetIfNeeded(statements, node, false); if (!multiLine && lexicalEnvironment && lexicalEnvironment.length) { multiLine = true; } - var block = ts.createBlock(ts.createNodeArray(statements, statementsLocation), node.body, multiLine); + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), multiLine); + ts.setTextRange(block, node.body); if (!multiLine && singleLine) { ts.setEmitFlags(block, 1); } @@ -40673,11 +44129,26 @@ var ts; ts.setOriginalNode(block, node.body); return block; } + function visitFunctionBodyDownLevel(node) { + var updated = ts.visitFunctionBody(node.body, functionBodyVisitor, context); + return ts.updateBlock(updated, ts.setTextRange(ts.createNodeArray(prependCaptureNewTargetIfNeeded(updated.statements, node, true)), updated.statements)); + } + function visitBlock(node, isFunctionBody) { + if (isFunctionBody) { + return ts.visitEachChild(node, visitor, context); + } + var ancestorFacts = hierarchyFacts & 256 + ? enterSubtree(4032, 512) + : enterSubtree(3904, 128); + var updated = ts.visitEachChild(node, visitor, context); + exitSubtree(ancestorFacts, 0, 0); + return updated; + } function visitExpressionStatement(node) { switch (node.expression.kind) { - case 183: + case 184: return ts.updateStatement(node, visitParenthesizedExpression(node.expression, false)); - case 192: + case 193: return ts.updateStatement(node, visitBinaryExpression(node.expression, false)); } return ts.visitEachChild(node, visitor, context); @@ -40685,9 +44156,9 @@ var ts; function visitParenthesizedExpression(node, needsDestructuringValue) { if (!needsDestructuringValue) { switch (node.expression.kind) { - case 183: + case 184: return ts.updateParen(node, visitParenthesizedExpression(node.expression, false)); - case 192: + case 193: return ts.updateParen(node, visitBinaryExpression(node.expression, false)); } } @@ -40697,9 +44168,12 @@ var ts; if (ts.isDestructuringAssignment(node)) { return ts.flattenDestructuringAssignment(node, visitor, context, 0, needsDestructuringValue); } + return ts.visitEachChild(node, visitor, context); } function visitVariableStatement(node) { - if (convertedLoopState && (ts.getCombinedNodeFlags(node.declarationList) & 3) == 0) { + var ancestorFacts = enterSubtree(0, ts.hasModifier(node, 1) ? 32 : 0); + var updated; + if (convertedLoopState && (node.declarationList.flags & 3) === 0) { var assignments = void 0; for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; @@ -40712,53 +44186,59 @@ var ts; else { assignment = ts.createBinary(decl.name, 57, ts.visitNode(decl.initializer, visitor, ts.isExpression)); } - (assignments || (assignments = [])).push(assignment); + assignments = ts.append(assignments, assignment); } } if (assignments) { - return ts.createStatement(ts.reduceLeft(assignments, function (acc, v) { return ts.createBinary(v, 25, acc); }), node); + updated = ts.setTextRange(ts.createStatement(ts.reduceLeft(assignments, function (acc, v) { return ts.createBinary(v, 25, acc); })), node); } else { - return undefined; + updated = undefined; } } - return ts.visitEachChild(node, visitor, context); + else { + updated = ts.visitEachChild(node, visitor, context); + } + exitSubtree(ancestorFacts, 0, 0); + return updated; } function visitVariableDeclarationList(node) { - if (node.flags & 3) { - enableSubstitutionsForBlockScopedBindings(); + if (node.transformFlags & 64) { + if (node.flags & 3) { + enableSubstitutionsForBlockScopedBindings(); + } + var declarations = ts.flatten(ts.map(node.declarations, node.flags & 1 + ? visitVariableDeclarationInLetDeclarationList + : visitVariableDeclaration)); + var declarationList = ts.createVariableDeclarationList(declarations); + ts.setOriginalNode(declarationList, node); + ts.setTextRange(declarationList, node); + ts.setCommentRange(declarationList, node); + if (node.transformFlags & 8388608 + && (ts.isBindingPattern(node.declarations[0].name) + || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) { + var firstDeclaration = ts.firstOrUndefined(declarations); + var lastDeclaration = ts.lastOrUndefined(declarations); + ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); + } + return declarationList; } - var declarations = ts.flatten(ts.map(node.declarations, node.flags & 1 - ? visitVariableDeclarationInLetDeclarationList - : visitVariableDeclaration)); - var declarationList = ts.createVariableDeclarationList(declarations, node); - ts.setOriginalNode(declarationList, node); - ts.setCommentRange(declarationList, node); - if (node.transformFlags & 8388608 - && (ts.isBindingPattern(node.declarations[0].name) - || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) { - var firstDeclaration = ts.firstOrUndefined(declarations); - var lastDeclaration = ts.lastOrUndefined(declarations); - ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); - } - return declarationList; + return ts.visitEachChild(node, visitor, context); } function shouldEmitExplicitInitializerForLetDeclaration(node) { var flags = resolver.getNodeCheckFlags(node); var isCapturedInFunction = flags & 131072; var isDeclaredInLoop = flags & 262144; - var emittedAsTopLevel = ts.isBlockScopedContainerTopLevel(enclosingBlockScopeContainer) + var emittedAsTopLevel = (hierarchyFacts & 64) !== 0 || (isCapturedInFunction && isDeclaredInLoop - && ts.isBlock(enclosingBlockScopeContainer) - && ts.isIterationStatement(enclosingBlockScopeContainerParent, false)); + && (hierarchyFacts & 512) !== 0); var emitExplicitInitializer = !emittedAsTopLevel - && enclosingBlockScopeContainer.kind !== 212 - && enclosingBlockScopeContainer.kind !== 213 + && (hierarchyFacts & 2048) === 0 && (!resolver.isDeclarationWithCollidingName(node) || (isDeclaredInLoop && !isCapturedInFunction - && !ts.isIterationStatement(enclosingBlockScopeContainer, false))); + && (hierarchyFacts & (1024 | 2048)) === 0)); return emitExplicitInitializer; } function visitVariableDeclarationInLetDeclarationList(node) { @@ -40774,84 +44254,94 @@ var ts; return ts.visitEachChild(node, visitor, context); } function visitVariableDeclaration(node) { + var ancestorFacts = enterSubtree(32, 0); + var updated; if (ts.isBindingPattern(node.name)) { - var hoistTempVariables = enclosingVariableStatement - && ts.hasModifier(enclosingVariableStatement, 1); - return ts.flattenDestructuringBinding(node, visitor, context, 0, undefined, hoistTempVariables); - } - return ts.visitEachChild(node, visitor, context); - } - function visitLabeledStatement(node) { - if (convertedLoopState) { - if (!convertedLoopState.labels) { - convertedLoopState.labels = ts.createMap(); - } - convertedLoopState.labels[node.label.text] = node.label.text; - } - var result; - if (ts.isIterationStatement(node.statement, false) && shouldConvertIterationStatementBody(node.statement)) { - result = ts.visitNodes(ts.createNodeArray([node.statement]), visitor, ts.isStatement); + updated = ts.flattenDestructuringBinding(node, visitor, context, 0, undefined, (ancestorFacts & 32) !== 0); } else { - result = ts.visitEachChild(node, visitor, context); + updated = ts.visitEachChild(node, visitor, context); } - if (convertedLoopState) { - convertedLoopState.labels[node.label.text] = undefined; + exitSubtree(ancestorFacts, 0, 0); + return updated; + } + function recordLabel(node) { + convertedLoopState.labels.set(node.label.text, node.label.text); + } + function resetLabel(node) { + convertedLoopState.labels.set(node.label.text, undefined); + } + function visitLabeledStatement(node) { + if (convertedLoopState && !convertedLoopState.labels) { + convertedLoopState.labels = ts.createMap(); } - return result; + var statement = ts.unwrapInnermostStatementOfLabel(node, convertedLoopState && recordLabel); + return ts.isIterationStatement(statement, false) + ? visitIterationStatement(statement, node) + : ts.restoreEnclosingLabel(ts.visitNode(statement, visitor, ts.isStatement), node, convertedLoopState && resetLabel); } - function visitDoStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitIterationStatement(node, outermostLabeledStatement) { + switch (node.kind) { + case 211: + case 212: + return visitDoOrWhileStatement(node, outermostLabeledStatement); + case 213: + return visitForStatement(node, outermostLabeledStatement); + case 214: + return visitForInStatement(node, outermostLabeledStatement); + case 215: + return visitForOfStatement(node, outermostLabeledStatement); + } } - function visitWhileStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitIterationStatementWithFacts(excludeFacts, includeFacts, node, outermostLabeledStatement, convert) { + var ancestorFacts = enterSubtree(excludeFacts, includeFacts); + var updated = convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, convert); + exitSubtree(ancestorFacts, 0, 0); + return updated; } - function visitForStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitDoOrWhileStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(0, 256, node, outermostLabeledStatement); } - function visitForInStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitForStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(3008, 1280, node, outermostLabeledStatement); } - function visitForOfStatement(node) { - return convertIterationStatementBodyIfNecessary(node, convertForOfToFor); + function visitForInStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(1984, 2304, node, outermostLabeledStatement); } - function convertForOfToFor(node, convertedLoopBodyStatements) { - var expression = ts.visitNode(node.expression, visitor, ts.isExpression); - var initializer = node.initializer; + function visitForOfStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(1984, 2304, node, outermostLabeledStatement, compilerOptions.downlevelIteration ? convertForOfStatementForIterable : convertForOfStatementForArray); + } + function convertForOfStatementHead(node, boundValue, convertedLoopBodyStatements) { var statements = []; - var counter = ts.createLoopVariable(); - var rhsReference = expression.kind === 70 - ? ts.createUniqueName(expression.text) - : ts.createTempVariable(undefined); - var elementAccess = ts.createElementAccess(rhsReference, counter); - if (ts.isVariableDeclarationList(initializer)) { - if (initializer.flags & 3) { + if (ts.isVariableDeclarationList(node.initializer)) { + if (node.initializer.flags & 3) { enableSubstitutionsForBlockScopedBindings(); } - var firstOriginalDeclaration = ts.firstOrUndefined(initializer.declarations); + var firstOriginalDeclaration = ts.firstOrUndefined(node.initializer.declarations); if (firstOriginalDeclaration && ts.isBindingPattern(firstOriginalDeclaration.name)) { - var declarations = ts.flattenDestructuringBinding(firstOriginalDeclaration, visitor, context, 0, elementAccess); - var declarationList = ts.createVariableDeclarationList(declarations, initializer); - ts.setOriginalNode(declarationList, initializer); + var declarations = ts.flattenDestructuringBinding(firstOriginalDeclaration, visitor, context, 0, boundValue); + var declarationList = ts.setTextRange(ts.createVariableDeclarationList(declarations), node.initializer); + ts.setOriginalNode(declarationList, node.initializer); var firstDeclaration = declarations[0]; var lastDeclaration = ts.lastOrUndefined(declarations); ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); statements.push(ts.createVariableStatement(undefined, declarationList)); } else { - statements.push(ts.createVariableStatement(undefined, ts.setOriginalNode(ts.createVariableDeclarationList([ - ts.createVariableDeclaration(firstOriginalDeclaration ? firstOriginalDeclaration.name : ts.createTempVariable(undefined), undefined, ts.createElementAccess(rhsReference, counter)) - ], ts.moveRangePos(initializer, -1)), initializer), ts.moveRangeEnd(initializer, -1))); + statements.push(ts.setTextRange(ts.createVariableStatement(undefined, ts.setOriginalNode(ts.setTextRange(ts.createVariableDeclarationList([ + ts.createVariableDeclaration(firstOriginalDeclaration ? firstOriginalDeclaration.name : ts.createTempVariable(undefined), undefined, boundValue) + ]), ts.moveRangePos(node.initializer, -1)), node.initializer)), ts.moveRangeEnd(node.initializer, -1))); } } else { - var assignment = ts.createAssignment(initializer, elementAccess); + var assignment = ts.createAssignment(node.initializer, boundValue); if (ts.isDestructuringAssignment(assignment)) { - statements.push(ts.createStatement(ts.flattenDestructuringAssignment(assignment, visitor, context, 0))); + ts.aggregateTransformFlags(assignment); + statements.push(ts.createStatement(visitBinaryExpression(assignment, false))); } else { - assignment.end = initializer.end; - statements.push(ts.createStatement(assignment, ts.moveRangeEnd(initializer, -1))); + assignment.end = node.initializer.end; + statements.push(ts.setTextRange(ts.createStatement(ts.visitNode(assignment, visitor, ts.isExpression)), ts.moveRangeEnd(node.initializer, -1))); } } var bodyLocation; @@ -40860,7 +44350,7 @@ var ts; ts.addRange(statements, convertedLoopBodyStatements); } else { - var statement = ts.visitNode(node.statement, visitor, ts.isStatement); + var statement = ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock); if (ts.isBlock(statement)) { ts.addRange(statements, statement.statements); bodyLocation = statement; @@ -40870,39 +44360,82 @@ var ts; statements.push(statement); } } + return ts.setEmitFlags(ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), true), bodyLocation), 48 | 384); + } + function convertForOfStatementForArray(node, outermostLabeledStatement, convertedLoopBodyStatements) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + var counter = ts.createLoopVariable(); + var rhsReference = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(expression) : ts.createTempVariable(undefined); ts.setEmitFlags(expression, 48 | ts.getEmitFlags(expression)); - var body = ts.createBlock(ts.createNodeArray(statements, statementsLocation), bodyLocation); - ts.setEmitFlags(body, 48 | 384); - var forStatement = ts.createFor(ts.setEmitFlags(ts.createVariableDeclarationList([ - ts.createVariableDeclaration(counter, undefined, ts.createLiteral(0), ts.moveRangePos(node.expression, -1)), - ts.createVariableDeclaration(rhsReference, undefined, expression, node.expression) - ], node.expression), 1048576), ts.createLessThan(counter, ts.createPropertyAccess(rhsReference, "length"), node.expression), ts.createPostfixIncrement(counter, node.expression), body, node); + var forStatement = ts.setTextRange(ts.createFor(ts.setEmitFlags(ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(counter, undefined, ts.createLiteral(0)), ts.moveRangePos(node.expression, -1)), + ts.setTextRange(ts.createVariableDeclaration(rhsReference, undefined, expression), node.expression) + ]), node.expression), 1048576), ts.setTextRange(ts.createLessThan(counter, ts.createPropertyAccess(rhsReference, "length")), node.expression), ts.setTextRange(ts.createPostfixIncrement(counter), node.expression), convertForOfStatementHead(node, ts.createElementAccess(rhsReference, counter), convertedLoopBodyStatements)), node); ts.setEmitFlags(forStatement, 256); - return forStatement; + ts.setTextRange(forStatement, node); + return ts.restoreEnclosingLabel(forStatement, outermostLabeledStatement, convertedLoopState && resetLabel); + } + function convertForOfStatementForIterable(node, outermostLabeledStatement, convertedLoopBodyStatements) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + var iterator = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(expression) : ts.createTempVariable(undefined); + var result = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(iterator) : ts.createTempVariable(undefined); + var errorRecord = ts.createUniqueName("e"); + var catchVariable = ts.getGeneratedNameForNode(errorRecord); + var returnMethod = ts.createTempVariable(undefined); + var values = ts.createValuesHelper(context, expression, node.expression); + var next = ts.createCall(ts.createPropertyAccess(iterator, "next"), undefined, []); + hoistVariableDeclaration(errorRecord); + hoistVariableDeclaration(returnMethod); + var forStatement = ts.setEmitFlags(ts.setTextRange(ts.createFor(ts.setEmitFlags(ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(iterator, undefined, values), node.expression), + ts.createVariableDeclaration(result, undefined, next) + ]), node.expression), 1048576), ts.createLogicalNot(ts.createPropertyAccess(result, "done")), ts.createAssignment(result, next), convertForOfStatementHead(node, ts.createPropertyAccess(result, "value"), convertedLoopBodyStatements)), node), 256); + return ts.createTry(ts.createBlock([ + ts.restoreEnclosingLabel(forStatement, outermostLabeledStatement, convertedLoopState && resetLabel) + ]), ts.createCatchClause(ts.createVariableDeclaration(catchVariable), ts.setEmitFlags(ts.createBlock([ + ts.createStatement(ts.createAssignment(errorRecord, ts.createObjectLiteral([ + ts.createPropertyAssignment("error", catchVariable) + ]))) + ]), 1)), ts.createBlock([ + ts.createTry(ts.createBlock([ + ts.setEmitFlags(ts.createIf(ts.createLogicalAnd(ts.createLogicalAnd(result, ts.createLogicalNot(ts.createPropertyAccess(result, "done"))), ts.createAssignment(returnMethod, ts.createPropertyAccess(iterator, "return"))), ts.createStatement(ts.createFunctionCall(returnMethod, iterator, []))), 1), + ]), undefined, ts.setEmitFlags(ts.createBlock([ + ts.setEmitFlags(ts.createIf(errorRecord, ts.createThrow(ts.createPropertyAccess(errorRecord, "error"))), 1) + ]), 1)) + ])); } function visitObjectLiteralExpression(node) { var properties = node.properties; var numProperties = properties.length; var numInitialProperties = numProperties; + var numInitialPropertiesWithoutYield = numProperties; for (var i = 0; i < numProperties; i++) { var property = properties[i]; - if (property.transformFlags & 16777216 - || property.name.kind === 142) { + if ((property.transformFlags & 16777216 && hierarchyFacts & 4) + && i < numInitialPropertiesWithoutYield) { + numInitialPropertiesWithoutYield = i; + } + if (property.name.kind === 143) { numInitialProperties = i; break; } } - ts.Debug.assert(numInitialProperties !== numProperties); - var temp = ts.createTempVariable(hoistVariableDeclaration); - var expressions = []; - var assignment = ts.createAssignment(temp, ts.setEmitFlags(ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), undefined, node.multiLine), 32768)); - if (node.multiLine) { - assignment.startsOnNewLine = true; + if (numInitialProperties !== numProperties) { + if (numInitialPropertiesWithoutYield < numInitialProperties) { + numInitialProperties = numInitialPropertiesWithoutYield; + } + var temp = ts.createTempVariable(hoistVariableDeclaration); + var expressions = []; + var assignment = ts.createAssignment(temp, ts.setEmitFlags(ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), node.multiLine), 32768)); + if (node.multiLine) { + assignment.startsOnNewLine = true; + } + expressions.push(assignment); + addObjectLiteralMembers(expressions, node, temp, numInitialProperties); + expressions.push(node.multiLine ? ts.startOnNewLine(ts.getMutableClone(temp)) : temp); + return ts.inlineExpressions(expressions); } - expressions.push(assignment); - addObjectLiteralMembers(expressions, node, temp, numInitialProperties); - expressions.push(node.multiLine ? ts.startOnNewLine(ts.getMutableClone(temp)) : temp); - return ts.inlineExpressions(expressions); + return ts.visitEachChild(node, visitor, context); } function shouldConvertIterationStatementBody(node) { return (resolver.getNodeCheckFlags(node) & 65536) !== 0; @@ -40926,14 +44459,16 @@ var ts; } } } - function convertIterationStatementBodyIfNecessary(node, convert) { + function convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, convert) { if (!shouldConvertIterationStatementBody(node)) { var saveAllowedNonLabeledJumps = void 0; if (convertedLoopState) { saveAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; convertedLoopState.allowedNonLabeledJumps = 2 | 4; } - var result = convert ? convert(node, undefined) : ts.visitEachChild(node, visitor, context); + var result = convert + ? convert(node, outermostLabeledStatement, undefined) + : ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), outermostLabeledStatement, convertedLoopState && resetLabel); if (convertedLoopState) { convertedLoopState.allowedNonLabeledJumps = saveAllowedNonLabeledJumps; } @@ -40942,11 +44477,11 @@ var ts; var functionName = ts.createUniqueName("_loop"); var loopInitializer; switch (node.kind) { - case 211: - case 212: case 213: + case 214: + case 215: var initializer = node.initializer; - if (initializer && initializer.kind === 224) { + if (initializer && initializer.kind === 226) { loopInitializer = initializer; } break; @@ -40972,19 +44507,26 @@ var ts; convertedLoopState.hoistedLocalVariables = outerConvertedLoopState.hoistedLocalVariables; } } - var loopBody = ts.visitNode(node.statement, visitor, ts.isStatement); + startLexicalEnvironment(); + var loopBody = ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock); + var lexicalEnvironment = endLexicalEnvironment(); var currentState = convertedLoopState; convertedLoopState = outerConvertedLoopState; - if (loopOutParameters.length) { + if (loopOutParameters.length || lexicalEnvironment) { var statements_4 = ts.isBlock(loopBody) ? loopBody.statements.slice() : [loopBody]; - copyOutParameters(loopOutParameters, 1, statements_4); - loopBody = ts.createBlock(statements_4, undefined, true); + if (loopOutParameters.length) { + copyOutParameters(loopOutParameters, 1, statements_4); + } + ts.addRange(statements_4, lexicalEnvironment); + loopBody = ts.createBlock(statements_4, true); } - if (!ts.isBlock(loopBody)) { - loopBody = ts.createBlock([loopBody], undefined, true); + if (ts.isBlock(loopBody)) { + loopBody.multiLine = true; } - var isAsyncBlockContainingAwait = enclosingNonArrowFunction - && (ts.getEmitFlags(enclosingNonArrowFunction) & 131072) !== 0 + else { + loopBody = ts.createBlock([loopBody], true); + } + var isAsyncBlockContainingAwait = hierarchyFacts & 4 && (node.statement.transformFlags & 16777216) !== 0; var loopBodyFlags = 0; if (currentState.containsLexicalThis) { @@ -41043,19 +44585,18 @@ var ts; var convertedLoopBodyStatements = generateCallToConvertedLoop(functionName, loopParameters, currentState, isAsyncBlockContainingAwait); var loop; if (convert) { - loop = convert(node, convertedLoopBodyStatements); + loop = convert(node, outermostLabeledStatement, convertedLoopBodyStatements); } else { - loop = ts.getMutableClone(node); - loop.statement = undefined; - loop = ts.visitEachChild(loop, visitor, context); - loop.statement = ts.createBlock(convertedLoopBodyStatements, undefined, true); - loop.transformFlags = 0; - ts.aggregateTransformFlags(loop); + var clone_4 = ts.getMutableClone(node); + clone_4.statement = undefined; + clone_4 = ts.visitEachChild(clone_4, visitor, context); + clone_4.statement = ts.createBlock(convertedLoopBodyStatements, true); + clone_4.transformFlags = 0; + ts.aggregateTransformFlags(clone_4); + loop = ts.restoreEnclosingLabel(clone_4, outermostLabeledStatement, convertedLoopState && resetLabel); } - statements.push(currentParent.kind === 219 - ? ts.createLabel(currentParent.label, loop) - : loop); + statements.push(loop); return statements; } function copyOutParameter(outParam, copyDirection) { @@ -41076,7 +44617,9 @@ var ts; !state.labeledNonLocalBreaks && !state.labeledNonLocalContinues; var call = ts.createCall(loopFunctionExpressionName, undefined, ts.map(parameters, function (p) { return p.name; })); - var callResult = isAsyncBlockContainingAwait ? ts.createYield(ts.createToken(38), call) : call; + var callResult = isAsyncBlockContainingAwait + ? ts.createYield(ts.createToken(38), ts.setEmitFlags(call, 4194304)) + : call; if (isSimpleLoop) { statements.push(ts.createStatement(callResult)); copyOutParameters(state.loopOutParameters, 0, statements); @@ -41114,23 +44657,22 @@ var ts; if (!state.labeledNonLocalBreaks) { state.labeledNonLocalBreaks = ts.createMap(); } - state.labeledNonLocalBreaks[labelText] = labelMarker; + state.labeledNonLocalBreaks.set(labelText, labelMarker); } else { if (!state.labeledNonLocalContinues) { state.labeledNonLocalContinues = ts.createMap(); } - state.labeledNonLocalContinues[labelText] = labelMarker; + state.labeledNonLocalContinues.set(labelText, labelMarker); } } function processLabeledJumps(table, isBreak, loopResultName, outerLoop, caseClauses) { if (!table) { return; } - for (var labelText in table) { - var labelMarker = table[labelText]; + table.forEach(function (labelMarker, labelText) { var statements = []; - if (!outerLoop || (outerLoop.labels && outerLoop.labels[labelText])) { + if (!outerLoop || (outerLoop.labels && outerLoop.labels.get(labelText))) { var label = ts.createIdentifier(labelText); statements.push(isBreak ? ts.createBreak(label) : ts.createContinue(label)); } @@ -41139,7 +44681,7 @@ var ts; statements.push(ts.createReturn(loopResultName)); } caseClauses.push(ts.createCaseClause(ts.createLiteral(labelMarker), statements)); - } + }); } function processLoopVariableDeclaration(decl, loopParameters, loopOutParameters) { var name = decl.name; @@ -41154,7 +44696,7 @@ var ts; else { loopParameters.push(ts.createParameter(undefined, undefined, undefined, name)); if (resolver.getNodeCheckFlags(decl) & 2097152) { - var outParamName = ts.createUniqueName("out_" + name.text); + var outParamName = ts.createUniqueName("out_" + ts.unescapeIdentifier(name.text)); loopOutParameters.push({ originalName: name, outParamName: outParamName }); } } @@ -41165,22 +44707,22 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 151: case 152: + case 153: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { - expressions.push(transformAccessorsToExpression(receiver, accessors, node.multiLine)); + expressions.push(transformAccessorsToExpression(receiver, accessors, node, node.multiLine)); } break; - case 257: + case 150: + expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); + break; + case 260: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 258: + case 261: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 149: - expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node.multiLine)); - break; default: ts.Debug.failBadSyntaxKind(node); break; @@ -41188,34 +44730,49 @@ var ts; } } function transformPropertyAssignmentToExpression(property, receiver, startsOnNewLine) { - var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.visitNode(property.initializer, visitor, ts.isExpression), property); + var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.visitNode(property.initializer, visitor, ts.isExpression)); + ts.setTextRange(expression, property); if (startsOnNewLine) { expression.startsOnNewLine = true; } return expression; } function transformShorthandPropertyAssignmentToExpression(property, receiver, startsOnNewLine) { - var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.getSynthesizedClone(property.name), property); + var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.getSynthesizedClone(property.name)); + ts.setTextRange(expression, property); if (startsOnNewLine) { expression.startsOnNewLine = true; } return expression; } - function transformObjectLiteralMethodDeclarationToExpression(method, receiver, startsOnNewLine) { - var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(method.name, visitor, ts.isPropertyName)), transformFunctionLikeToExpression(method, method, undefined), method); + function transformObjectLiteralMethodDeclarationToExpression(method, receiver, container, startsOnNewLine) { + var ancestorFacts = enterSubtree(0, 0); + var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(method.name, visitor, ts.isPropertyName)), transformFunctionLikeToExpression(method, method, undefined, container)); + ts.setTextRange(expression, method); if (startsOnNewLine) { expression.startsOnNewLine = true; } + exitSubtree(ancestorFacts, 49152, hierarchyFacts & 49152 ? 16384 : 0); return expression; } function visitCatchClause(node) { - ts.Debug.assert(ts.isBindingPattern(node.variableDeclaration.name)); - var temp = ts.createTempVariable(undefined); - var newVariableDeclaration = ts.createVariableDeclaration(temp, undefined, undefined, node.variableDeclaration); - var vars = ts.flattenDestructuringBinding(node.variableDeclaration, visitor, context, 0, temp); - var list = ts.createVariableDeclarationList(vars, node.variableDeclaration, node.variableDeclaration.flags); - var destructure = ts.createVariableStatement(undefined, list); - return ts.updateCatchClause(node, newVariableDeclaration, addStatementToStartOfBlock(node.block, destructure)); + var ancestorFacts = enterSubtree(4032, 0); + var updated; + if (ts.isBindingPattern(node.variableDeclaration.name)) { + var temp = ts.createTempVariable(undefined); + var newVariableDeclaration = ts.createVariableDeclaration(temp); + ts.setTextRange(newVariableDeclaration, node.variableDeclaration); + var vars = ts.flattenDestructuringBinding(node.variableDeclaration, visitor, context, 0, temp); + var list = ts.createVariableDeclarationList(vars); + ts.setTextRange(list, node.variableDeclaration); + var destructure = ts.createVariableStatement(undefined, list); + updated = ts.updateCatchClause(node, newVariableDeclaration, addStatementToStartOfBlock(node.block, destructure)); + } + else { + updated = ts.visitEachChild(node, visitor, context); + } + exitSubtree(ancestorFacts, 0, 0); + return updated; } function addStatementToStartOfBlock(block, statement) { var transformedStatements = ts.visitNodes(block.statements, visitor, ts.isStatement); @@ -41223,21 +44780,43 @@ var ts; } function visitMethodDeclaration(node) { ts.Debug.assert(!ts.isComputedPropertyName(node.name)); - var functionExpression = transformFunctionLikeToExpression(node, ts.moveRangePos(node, -1), undefined); + var functionExpression = transformFunctionLikeToExpression(node, ts.moveRangePos(node, -1), undefined, undefined); ts.setEmitFlags(functionExpression, 512 | ts.getEmitFlags(functionExpression)); - return ts.createPropertyAssignment(node.name, functionExpression, node); + return ts.setTextRange(ts.createPropertyAssignment(node.name, functionExpression), node); + } + function visitAccessorDeclaration(node) { + ts.Debug.assert(!ts.isComputedPropertyName(node.name)); + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16286, 65); + var updated = ts.visitEachChild(node, visitor, context); + exitSubtree(ancestorFacts, 49152, 0); + convertedLoopState = savedConvertedLoopState; + return updated; } function visitShorthandPropertyAssignment(node) { - return ts.createPropertyAssignment(node.name, ts.getSynthesizedClone(node.name), node); + return ts.setTextRange(ts.createPropertyAssignment(node.name, ts.getSynthesizedClone(node.name)), node); + } + function visitComputedPropertyName(node) { + var ancestorFacts = enterSubtree(0, 8192); + var updated = ts.visitEachChild(node, visitor, context); + exitSubtree(ancestorFacts, 49152, hierarchyFacts & 49152 ? 32768 : 0); + return updated; } function visitYieldExpression(node) { return ts.visitEachChild(node, visitor, context); } function visitArrayLiteralExpression(node) { - return transformAndSpreadElements(node.elements, true, node.multiLine, node.elements.hasTrailingComma); + if (node.transformFlags & 64) { + return transformAndSpreadElements(node.elements, true, node.multiLine, node.elements.hasTrailingComma); + } + return ts.visitEachChild(node, visitor, context); } function visitCallExpression(node) { - return visitCallExpressionWithPotentialCapturedThisAssignment(node, true); + if (node.transformFlags & 64) { + return visitCallExpressionWithPotentialCapturedThisAssignment(node, true); + } + return ts.updateCall(node, ts.visitNode(node.expression, callExpressionVisitor, ts.isExpression), undefined, ts.visitNodes(node.arguments, visitor, ts.isExpression)); } function visitImmediateSuperCallInBody(node) { return visitCallExpressionWithPotentialCapturedThisAssignment(node, false); @@ -41249,38 +44828,54 @@ var ts; } var resultingCall; if (node.transformFlags & 524288) { - resultingCall = ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, false, false, false)); + resultingCall = ts.createFunctionApply(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, false, false, false)); } else { - resultingCall = ts.createFunctionCall(ts.visitNode(target, visitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), node); + resultingCall = ts.createFunctionCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), node); } if (node.expression.kind === 96) { var actualThis = ts.createThis(); ts.setEmitFlags(actualThis, 4); var initializer = ts.createLogicalOr(resultingCall, actualThis); - return assignToCapturedThis + resultingCall = assignToCapturedThis ? ts.createAssignment(ts.createIdentifier("_this"), initializer) : initializer; } - return resultingCall; + return ts.setOriginalNode(resultingCall, node); } function visitNewExpression(node) { - ts.Debug.assert((node.transformFlags & 524288) !== 0); - var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; - return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray([ts.createVoidZero()].concat(node.arguments)), false, false, false)), undefined, []); + if (node.transformFlags & 524288) { + var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; + return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray([ts.createVoidZero()].concat(node.arguments)), false, false, false)), undefined, []); + } + return ts.visitEachChild(node, visitor, context); } function transformAndSpreadElements(elements, needsUniqueCopy, multiLine, hasTrailingComma) { var numElements = elements.length; var segments = ts.flatten(ts.spanMap(elements, partitionSpread, function (partition, visitPartition, _start, end) { return visitPartition(partition, multiLine, hasTrailingComma && end === numElements); })); - if (segments.length === 1) { - var firstElement = elements[0]; - return needsUniqueCopy && ts.isSpreadExpression(firstElement) && firstElement.expression.kind !== 175 - ? ts.createArraySlice(segments[0]) - : segments[0]; + if (compilerOptions.downlevelIteration) { + if (segments.length === 1) { + var firstSegment = segments[0]; + if (ts.isCallExpression(firstSegment) + && ts.isIdentifier(firstSegment.expression) + && (ts.getEmitFlags(firstSegment.expression) & 4096) + && firstSegment.expression.text === "___spread") { + return segments[0]; + } + } + return ts.createSpreadHelper(context, segments); + } + else { + if (segments.length === 1) { + var firstElement = elements[0]; + return needsUniqueCopy && ts.isSpreadExpression(firstElement) && firstElement.expression.kind !== 176 + ? ts.createArraySlice(segments[0]) + : segments[0]; + } + return ts.createArrayConcat(segments.shift(), segments); } - return ts.createArrayConcat(segments.shift(), segments); } function partitionSpread(node) { return ts.isSpreadExpression(node) @@ -41291,7 +44886,7 @@ var ts; return ts.map(chunk, visitExpressionOfSpread); } function visitSpanOfNonSpreads(chunk, multiLine, hasTrailingComma) { - return ts.createArrayLiteral(ts.visitNodes(ts.createNodeArray(chunk, undefined, hasTrailingComma), visitor, ts.isExpression), undefined, multiLine); + return ts.createArrayLiteral(ts.visitNodes(ts.createNodeArray(chunk, hasTrailingComma), visitor, ts.isExpression), multiLine); } function visitSpreadElement(node) { return ts.visitNode(node.expression, visitor, ts.isExpression); @@ -41300,7 +44895,19 @@ var ts; return ts.visitNode(node.expression, visitor, ts.isExpression); } function visitTemplateLiteral(node) { - return ts.createLiteral(node.text, node); + return ts.setTextRange(ts.createLiteral(node.text), node); + } + function visitStringLiteral(node) { + if (node.hasExtendedUnicodeEscape) { + return ts.setTextRange(ts.createLiteral(node.text), node); + } + return node; + } + function visitNumericLiteral(node) { + if (node.numericLiteralFlags & 48) { + return ts.setTextRange(ts.createNumericLiteral(node.text), node); + } + return node; } function visitTaggedTemplateExpression(node) { var tag = ts.visitNode(node.tag, visitor, ts.isExpression); @@ -41334,7 +44941,7 @@ var ts; var isLast = node.kind === 12 || node.kind === 15; text = text.substring(1, text.length - (isLast ? 1 : 2)); text = text.replace(/\r\n?/g, "\n"); - return ts.createLiteral(text, node); + return ts.setTextRange(ts.createLiteral(text), node); } function visitTemplateExpression(node) { var expressions = []; @@ -41342,7 +44949,8 @@ var ts; addTemplateSpans(expressions, node); var expression = ts.reduceLeft(expressions, ts.createAdd); if (ts.nodeIsSynthesized(expression)) { - ts.setTextRange(expression, node); + expression.pos = node.pos; + expression.end = node.end; } return expression; } @@ -41365,21 +44973,34 @@ var ts; } } } - function visitSuperKeyword() { - return enclosingNonAsyncFunctionBody - && ts.isClassElement(enclosingNonAsyncFunctionBody) - && !ts.hasModifier(enclosingNonAsyncFunctionBody, 32) - && currentParent.kind !== 179 + function visitSuperKeyword(isExpressionOfCall) { + return hierarchyFacts & 8 + && !isExpressionOfCall ? ts.createPropertyAccess(ts.createIdentifier("_super"), "prototype") : ts.createIdentifier("_super"); } - function onEmitNode(emitContext, node, emitCallback) { - var savedEnclosingFunction = enclosingFunction; - if (enabledSubstitutions & 1 && ts.isFunctionLike(node)) { - enclosingFunction = node; + function visitMetaProperty(node) { + if (node.keywordToken === 93 && node.name.text === "target") { + if (hierarchyFacts & 8192) { + hierarchyFacts |= 32768; + } + else { + hierarchyFacts |= 16384; + } + return ts.createIdentifier("_newTarget"); } - previousOnEmitNode(emitContext, node, emitCallback); - enclosingFunction = savedEnclosingFunction; + return node; + } + function onEmitNode(hint, node, emitCallback) { + if (enabledSubstitutions & 1 && ts.isFunctionLike(node)) { + var ancestorFacts = enterSubtree(16286, ts.getEmitFlags(node) & 8 + ? 65 | 16 + : 65); + previousOnEmitNode(hint, node, emitCallback); + exitSubtree(ancestorFacts, 0, 0); + return; + } + previousOnEmitNode(hint, node, emitCallback); } function enableSubstitutionsForBlockScopedBindings() { if ((enabledSubstitutions & 2) === 0) { @@ -41391,18 +45012,18 @@ var ts; if ((enabledSubstitutions & 1) === 0) { enabledSubstitutions |= 1; context.enableSubstitution(98); - context.enableEmitNotification(150); - context.enableEmitNotification(149); context.enableEmitNotification(151); + context.enableEmitNotification(150); context.enableEmitNotification(152); + context.enableEmitNotification(153); + context.enableEmitNotification(186); context.enableEmitNotification(185); - context.enableEmitNotification(184); - context.enableEmitNotification(225); + context.enableEmitNotification(227); } } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1) { + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1) { return substituteExpression(node); } if (ts.isIdentifier(node)) { @@ -41414,7 +45035,7 @@ var ts; if (enabledSubstitutions & 2) { var original = ts.getParseTreeNode(node, ts.isIdentifier); if (original && isNameOfDeclarationWithCollidingName(original)) { - return ts.getGeneratedNameForNode(original); + return ts.setTextRange(ts.getGeneratedNameForNode(original), node); } } return node; @@ -41422,10 +45043,10 @@ var ts; function isNameOfDeclarationWithCollidingName(node) { var parent = node.parent; switch (parent.kind) { - case 174: - case 226: - case 229: - case 223: + case 175: + case 228: + case 231: + case 225: return parent.name === node && resolver.isDeclarationWithCollidingName(parent); } @@ -41444,16 +45065,15 @@ var ts; if (enabledSubstitutions & 2) { var declaration = resolver.getReferencedDeclarationWithCollidingName(node); if (declaration) { - return ts.getGeneratedNameForNode(declaration.name); + return ts.setTextRange(ts.getGeneratedNameForNode(declaration.name), node); } } return node; } function substituteThisKeyword(node) { if (enabledSubstitutions & 1 - && enclosingFunction - && ts.getEmitFlags(enclosingFunction) & 8) { - return ts.createIdentifier("_this", node); + && hierarchyFacts & 16) { + return ts.setTextRange(ts.createIdentifier("_this"), node); } return node; } @@ -41469,11 +45089,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 207) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 209) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 179) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 180) { return false; } var callTarget = statementExpression.expression; @@ -41481,7 +45101,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 196) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 197) { return false; } var expression = callArgument.expression; @@ -41500,18 +45120,90 @@ var ts; name: "typescript:extends", scoped: false, priority: 0, - text: "\n var __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };" + text: "\n var __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n })();" }; })(ts || (ts = {})); var ts; (function (ts) { - var instructionNames = ts.createMap((_a = {}, - _a[2] = "return", - _a[3] = "break", - _a[4] = "yield", - _a[5] = "yield*", - _a[7] = "endfinally", - _a)); + function transformES5(context) { + var compilerOptions = context.getCompilerOptions(); + var previousOnEmitNode; + var noSubstitution; + if (compilerOptions.jsx === 1 || compilerOptions.jsx === 3) { + previousOnEmitNode = context.onEmitNode; + context.onEmitNode = onEmitNode; + context.enableEmitNotification(250); + context.enableEmitNotification(251); + context.enableEmitNotification(249); + noSubstitution = []; + } + var previousOnSubstituteNode = context.onSubstituteNode; + context.onSubstituteNode = onSubstituteNode; + context.enableSubstitution(178); + context.enableSubstitution(260); + return transformSourceFile; + function transformSourceFile(node) { + return node; + } + function onEmitNode(hint, node, emitCallback) { + switch (node.kind) { + case 250: + case 251: + case 249: + var tagName = node.tagName; + noSubstitution[ts.getOriginalNodeId(tagName)] = true; + break; + } + previousOnEmitNode(hint, node, emitCallback); + } + function onSubstituteNode(hint, node) { + if (node.id && noSubstitution && noSubstitution[node.id]) { + return previousOnSubstituteNode(hint, node); + } + node = previousOnSubstituteNode(hint, node); + if (ts.isPropertyAccessExpression(node)) { + return substitutePropertyAccessExpression(node); + } + else if (ts.isPropertyAssignment(node)) { + return substitutePropertyAssignment(node); + } + return node; + } + function substitutePropertyAccessExpression(node) { + var literalName = trySubstituteReservedName(node.name); + if (literalName) { + return ts.setTextRange(ts.createElementAccess(node.expression, literalName), node); + } + return node; + } + function substitutePropertyAssignment(node) { + var literalName = ts.isIdentifier(node.name) && trySubstituteReservedName(node.name); + if (literalName) { + return ts.updatePropertyAssignment(node, literalName, node.initializer); + } + return node; + } + function trySubstituteReservedName(name) { + var token = name.originalKeywordKind || (ts.nodeIsSynthesized(name) ? ts.stringToToken(name.text) : undefined); + if (token >= 71 && token <= 106) { + return ts.setTextRange(ts.createLiteral(name), name); + } + return undefined; + } + } + ts.transformES5 = transformES5; +})(ts || (ts = {})); +var ts; +(function (ts) { + function getInstructionName(instruction) { + switch (instruction) { + case 2: return "return"; + case 3: return "break"; + case 4: return "yield"; + case 5: return "yield*"; + case 7: return "endfinally"; + } + } function transformGenerators(context) { var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistFunctionDeclaration = context.hoistFunctionDeclaration, hoistVariableDeclaration = context.hoistVariableDeclaration; var compilerOptions = context.getCompilerOptions(); @@ -41577,13 +45269,13 @@ var ts; } function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 209: + case 211: return visitDoStatement(node); - case 210: + case 212: return visitWhileStatement(node); - case 218: + case 220: return visitSwitchStatement(node); - case 219: + case 221: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -41591,24 +45283,24 @@ var ts; } function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 225: + case 227: return visitFunctionDeclaration(node); - case 184: + case 185: return visitFunctionExpression(node); - case 151: case 152: + case 153: return visitAccessorDeclaration(node); - case 205: + case 207: return visitVariableStatement(node); - case 211: + case 213: return visitForStatement(node); - case 212: - return visitForInStatement(node); - case 215: - return visitBreakStatement(node); case 214: - return visitContinueStatement(node); + return visitForInStatement(node); + case 217: + return visitBreakStatement(node); case 216: + return visitContinueStatement(node); + case 218: return visitReturnStatement(node); default: if (node.transformFlags & 16777216) { @@ -41624,21 +45316,21 @@ var ts; } function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 192: - return visitBinaryExpression(node); case 193: + return visitBinaryExpression(node); + case 194: return visitConditionalExpression(node); - case 195: + case 196: return visitYieldExpression(node); - case 175: - return visitArrayLiteralExpression(node); case 176: + return visitArrayLiteralExpression(node); + case 177: return visitObjectLiteralExpression(node); - case 178: - return visitElementAccessExpression(node); case 179: - return visitCallExpression(node); + return visitElementAccessExpression(node); case 180: + return visitCallExpression(node); + case 181: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -41646,9 +45338,9 @@ var ts; } function visitGenerator(node) { switch (node.kind) { - case 225: + case 227: return visitFunctionDeclaration(node); - case 184: + case 185: return visitFunctionExpression(node); default: ts.Debug.failBadSyntaxKind(node); @@ -41656,8 +45348,8 @@ var ts; } } function visitFunctionDeclaration(node) { - if (node.asteriskToken && ts.getEmitFlags(node) & 131072) { - node = ts.setOriginalNode(ts.createFunctionDeclaration(undefined, node.modifiers, undefined, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformGeneratorFunctionBody(node.body), node), node); + if (node.asteriskToken) { + node = ts.setOriginalNode(ts.setTextRange(ts.createFunctionDeclaration(undefined, node.modifiers, undefined, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformGeneratorFunctionBody(node.body)), node), node); } else { var savedInGeneratorFunctionBody = inGeneratorFunctionBody; @@ -41677,8 +45369,8 @@ var ts; } } function visitFunctionExpression(node) { - if (node.asteriskToken && ts.getEmitFlags(node) & 131072) { - node = ts.setOriginalNode(ts.createFunctionExpression(undefined, undefined, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformGeneratorFunctionBody(node.body), node), node); + if (node.asteriskToken) { + node = ts.setOriginalNode(ts.setTextRange(ts.createFunctionExpression(undefined, undefined, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformGeneratorFunctionBody(node.body)), node), node); } else { var savedInGeneratorFunctionBody = inGeneratorFunctionBody; @@ -41730,7 +45422,7 @@ var ts; operationLocations = undefined; state = ts.createTempVariable(undefined); resumeLexicalEnvironment(); - var statementOffset = ts.addPrologueDirectives(statements, body.statements, false, visitor); + var statementOffset = ts.addPrologue(statements, body.statements, false, visitor); transformAndEmitStatements(body.statements, statementOffset); var buildResult = build(); ts.addRange(statements, endLexicalEnvironment()); @@ -41748,7 +45440,7 @@ var ts; operationArguments = savedOperationArguments; operationLocations = savedOperationLocations; state = savedState; - return ts.createBlock(statements, body, body.multiLine); + return ts.setTextRange(ts.createBlock(statements, body.multiLine), body); } function visitVariableStatement(node) { if (node.transformFlags & 16777216) { @@ -41805,10 +45497,10 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 177: + case 178: target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 178: + case 179: target = ts.updateElementAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), cacheExpression(ts.visitNode(left.argumentExpression, visitor, ts.isExpression))); break; default: @@ -41817,7 +45509,7 @@ var ts; } var operator = node.operatorToken.kind; if (isCompoundAssignment(operator)) { - return ts.createBinary(target, 57, ts.createBinary(cacheExpression(target), getOperatorForCompoundAssignment(operator), ts.visitNode(right, visitor, ts.isExpression), node), node); + return ts.setTextRange(ts.createAssignment(target, ts.setTextRange(ts.createBinary(cacheExpression(target), getOperatorForCompoundAssignment(operator), ts.visitNode(right, visitor, ts.isExpression)), node)), node); } else { return ts.updateBinary(node, target, ts.visitNode(right, visitor, ts.isExpression)); @@ -41833,10 +45525,10 @@ var ts; else if (node.operatorToken.kind === 25) { return visitCommaExpression(node); } - var clone_4 = ts.getMutableClone(node); - clone_4.left = cacheExpression(ts.visitNode(node.left, visitor, ts.isExpression)); - clone_4.right = ts.visitNode(node.right, visitor, ts.isExpression); - return clone_4; + var clone_5 = ts.getMutableClone(node); + clone_5.left = cacheExpression(ts.visitNode(node.left, visitor, ts.isExpression)); + clone_5.right = ts.visitNode(node.right, visitor, ts.isExpression); + return clone_5; } return ts.visitEachChild(node, visitor, context); } @@ -41892,38 +45584,43 @@ var ts; var resumeLabel = defineLabel(); var expression = ts.visitNode(node.expression, visitor, ts.isExpression); if (node.asteriskToken) { - emitYieldStar(expression, node); + var iterator = (ts.getEmitFlags(node.expression) & 4194304) === 0 + ? ts.createValuesHelper(context, expression, node) + : expression; + emitYieldStar(iterator, node); } else { emitYield(expression, node); } markLabel(resumeLabel); - return createGeneratorResume(); + return createGeneratorResume(node); } function visitArrayLiteralExpression(node) { return visitElements(node.elements, undefined, undefined, node.multiLine); } function visitElements(elements, leadingElement, location, multiLine) { var numInitialElements = countInitialNodesWithoutYield(elements); - var temp = declareLocal(); - var hasAssignedTemp = false; + var temp; if (numInitialElements > 0) { + temp = declareLocal(); var initialElements = ts.visitNodes(elements, visitor, ts.isExpression, 0, numInitialElements); emitAssignment(temp, ts.createArrayLiteral(leadingElement ? [leadingElement].concat(initialElements) : initialElements)); leadingElement = undefined; - hasAssignedTemp = true; } var expressions = ts.reduceLeft(elements, reduceElement, [], numInitialElements); - return hasAssignedTemp - ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, undefined, multiLine)]) - : ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, location, multiLine); + return temp + ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)]) + : ts.setTextRange(ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine), location); function reduceElement(expressions, element) { if (containsYield(element) && expressions.length > 0) { + var hasAssignedTemp = temp !== undefined; + if (!temp) { + temp = declareLocal(); + } emitAssignment(temp, hasAssignedTemp - ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, undefined, multiLine)]) - : ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, undefined, multiLine)); - hasAssignedTemp = true; + ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)]) + : ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine)); leadingElement = undefined; expressions = []; } @@ -41936,7 +45633,7 @@ var ts; var multiLine = node.multiLine; var numInitialProperties = countInitialNodesWithoutYield(properties); var temp = declareLocal(); - emitAssignment(temp, ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), undefined, multiLine)); + emitAssignment(temp, ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), multiLine)); var expressions = ts.reduceLeft(properties, reduceProperty, [], numInitialProperties); expressions.push(multiLine ? ts.startOnNewLine(ts.getMutableClone(temp)) : temp); return ts.inlineExpressions(expressions); @@ -41958,10 +45655,10 @@ var ts; } function visitElementAccessExpression(node) { if (containsYield(node.argumentExpression)) { - var clone_5 = ts.getMutableClone(node); - clone_5.expression = cacheExpression(ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression)); - clone_5.argumentExpression = ts.visitNode(node.argumentExpression, visitor, ts.isExpression); - return clone_5; + var clone_6 = ts.getMutableClone(node); + clone_6.expression = cacheExpression(ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression)); + clone_6.argumentExpression = ts.visitNode(node.argumentExpression, visitor, ts.isExpression); + return clone_6; } return ts.visitEachChild(node, visitor, context); } @@ -41975,7 +45672,7 @@ var ts; function visitNewExpression(node) { if (ts.forEach(node.arguments, containsYield)) { var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; - return ts.setOriginalNode(ts.createNew(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isExpression)), thisArg, visitElements(node.arguments, ts.createVoidZero())), undefined, [], node), node); + return ts.setOriginalNode(ts.setTextRange(ts.createNew(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isExpression)), thisArg, visitElements(node.arguments, ts.createVoidZero())), undefined, []), node), node); } return ts.visitEachChild(node, visitor, context); } @@ -42004,38 +45701,38 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 204: + case 206: return transformAndEmitBlock(node); - case 207: - return transformAndEmitExpressionStatement(node); - case 208: - return transformAndEmitIfStatement(node); case 209: - return transformAndEmitDoStatement(node); + return transformAndEmitExpressionStatement(node); case 210: - return transformAndEmitWhileStatement(node); + return transformAndEmitIfStatement(node); case 211: - return transformAndEmitForStatement(node); + return transformAndEmitDoStatement(node); case 212: - return transformAndEmitForInStatement(node); + return transformAndEmitWhileStatement(node); + case 213: + return transformAndEmitForStatement(node); case 214: - return transformAndEmitContinueStatement(node); - case 215: - return transformAndEmitBreakStatement(node); + return transformAndEmitForInStatement(node); case 216: - return transformAndEmitReturnStatement(node); + return transformAndEmitContinueStatement(node); case 217: - return transformAndEmitWithStatement(node); + return transformAndEmitBreakStatement(node); case 218: - return transformAndEmitSwitchStatement(node); + return transformAndEmitReturnStatement(node); case 219: - return transformAndEmitLabeledStatement(node); + return transformAndEmitWithStatement(node); case 220: - return transformAndEmitThrowStatement(node); + return transformAndEmitSwitchStatement(node); case 221: + return transformAndEmitLabeledStatement(node); + case 222: + return transformAndEmitThrowStatement(node); + case 223: return transformAndEmitTryStatement(node); default: - return emitStatement(ts.visitNode(node, visitor, ts.isStatement, true)); + return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); } } function transformAndEmitBlock(node) { @@ -42052,7 +45749,9 @@ var ts; function transformAndEmitVariableDeclarationList(node) { for (var _i = 0, _a = node.declarations; _i < _a.length; _i++) { var variable = _a[_i]; - hoistVariableDeclaration(variable.name); + var name = ts.getSynthesizedClone(variable.name); + ts.setCommentRange(name, variable.name); + hoistVariableDeclaration(name); } var variables = ts.getInitializedVariables(node); var numVariables = variables.length; @@ -42082,7 +45781,7 @@ var ts; if (containsYield(node.thenStatement) || containsYield(node.elseStatement)) { var endLabel = defineLabel(); var elseLabel = node.elseStatement ? defineLabel() : undefined; - emitBreakWhenFalse(node.elseStatement ? elseLabel : endLabel, ts.visitNode(node.expression, visitor, ts.isExpression)); + emitBreakWhenFalse(node.elseStatement ? elseLabel : endLabel, ts.visitNode(node.expression, visitor, ts.isExpression), node.expression); transformAndEmitEmbeddedStatement(node.thenStatement); if (node.elseStatement) { emitBreak(endLabel); @@ -42161,7 +45860,7 @@ var ts; transformAndEmitVariableDeclarationList(initializer); } else { - emitStatement(ts.createStatement(ts.visitNode(initializer, visitor, ts.isExpression), initializer)); + emitStatement(ts.setTextRange(ts.createStatement(ts.visitNode(initializer, visitor, ts.isExpression)), initializer)); } } markLabel(conditionLabel); @@ -42171,7 +45870,7 @@ var ts; transformAndEmitEmbeddedStatement(node.statement); markLabel(incrementLabel); if (node.incrementor) { - emitStatement(ts.createStatement(ts.visitNode(node.incrementor, visitor, ts.isExpression), node.incrementor)); + emitStatement(ts.setTextRange(ts.createStatement(ts.visitNode(node.incrementor, visitor, ts.isExpression)), node.incrementor)); } emitBreak(conditionLabel); endLoopBlock(); @@ -42185,7 +45884,7 @@ var ts; beginScriptLoopBlock(); } var initializer = node.initializer; - if (ts.isVariableDeclarationList(initializer)) { + if (initializer && ts.isVariableDeclarationList(initializer)) { for (var _i = 0, _a = initializer.declarations; _i < _a.length; _i++) { var variable = _a[_i]; hoistVariableDeclaration(variable.name); @@ -42193,7 +45892,7 @@ var ts; var variables = ts.getInitializedVariables(initializer); node = ts.updateFor(node, variables.length > 0 ? ts.inlineExpressions(ts.map(variables, transformInitializedVariable)) - : undefined, ts.visitNode(node.condition, visitor, ts.isExpression, true), ts.visitNode(node.incrementor, visitor, ts.isExpression, true), ts.visitNode(node.statement, visitor, ts.isStatement, false, ts.liftToBlock)); + : undefined, ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); } else { node = ts.visitEachChild(node, visitor, context); @@ -42251,7 +45950,7 @@ var ts; var variable = _a[_i]; hoistVariableDeclaration(variable.name); } - node = ts.updateForIn(node, initializer.declarations[0].name, ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, false, ts.liftToBlock)); + node = ts.updateForIn(node, initializer.declarations[0].name, ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); } else { node = ts.visitEachChild(node, visitor, context); @@ -42290,10 +45989,10 @@ var ts; return ts.visitEachChild(node, visitor, context); } function transformAndEmitReturnStatement(node) { - emitReturn(ts.visitNode(node.expression, visitor, ts.isExpression, true), node); + emitReturn(ts.visitNode(node.expression, visitor, ts.isExpression), node); } function visitReturnStatement(node) { - return createInlineReturn(ts.visitNode(node.expression, visitor, ts.isExpression, true), node); + return createInlineReturn(ts.visitNode(node.expression, visitor, ts.isExpression), node); } function transformAndEmitWithStatement(node) { if (containsYield(node)) { @@ -42316,7 +46015,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 254 && defaultClauseIndex === -1) { + if (clause.kind === 257 && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -42326,7 +46025,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 253) { + if (clause.kind === 256) { var caseClause = clause; if (containsYield(caseClause.expression) && pendingClauses.length > 0) { break; @@ -42428,9 +46127,9 @@ var ts; } return -1; } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1) { + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1) { return substituteExpression(node); } return node; @@ -42442,17 +46141,17 @@ var ts; return node; } function substituteExpressionIdentifier(node) { - if (renamedCatchVariables && ts.hasProperty(renamedCatchVariables, node.text)) { + if (!ts.isGeneratedIdentifier(node) && renamedCatchVariables && renamedCatchVariables.has(node.text)) { var original = ts.getOriginalNode(node); if (ts.isIdentifier(original) && original.parent) { var declaration = resolver.getReferencedValueDeclaration(original); if (declaration) { - var name_36 = ts.getProperty(renamedCatchVariableDeclarations, String(ts.getOriginalNodeId(declaration))); - if (name_36) { - var clone_6 = ts.getMutableClone(name_36); - ts.setSourceMapRange(clone_6, node); - ts.setCommentRange(clone_6, node); - return clone_6; + var name = renamedCatchVariableDeclarations[ts.getOriginalNodeId(declaration)]; + if (name) { + var clone_7 = ts.getMutableClone(name); + ts.setSourceMapRange(clone_7, node); + ts.setCommentRange(clone_7, node); + return clone_7; } } } @@ -42461,7 +46160,7 @@ var ts; } function cacheExpression(node) { var temp; - if (ts.isGeneratedIdentifier(node)) { + if (ts.isGeneratedIdentifier(node) || ts.getEmitFlags(node) & 4096) { return node; } temp = ts.createTempVariable(hoistVariableDeclaration); @@ -42553,15 +46252,22 @@ var ts; } function beginCatchBlock(variable) { ts.Debug.assert(peekBlockKind() === 0); - var text = variable.name.text; - var name = declareLocal(text); - if (!renamedCatchVariables) { - renamedCatchVariables = ts.createMap(); - renamedCatchVariableDeclarations = ts.createMap(); - context.enableSubstitution(70); + var name; + if (ts.isGeneratedIdentifier(variable.name)) { + name = variable.name; + hoistVariableDeclaration(variable.name); + } + else { + var text = variable.name.text; + name = declareLocal(text); + if (!renamedCatchVariables) { + renamedCatchVariables = ts.createMap(); + renamedCatchVariableDeclarations = []; + context.enableSubstitution(70); + } + renamedCatchVariables.set(text, true); + renamedCatchVariableDeclarations[ts.getOriginalNodeId(variable)] = name; } - renamedCatchVariables[text] = true; - renamedCatchVariableDeclarations[ts.getOriginalNodeId(variable)] = name; var exception = peekBlock(); ts.Debug.assert(exception.state < 1); var endLabel = exception.endLabel; @@ -42761,23 +46467,23 @@ var ts; } function createInstruction(instruction) { var literal = ts.createLiteral(instruction); - literal.trailingComment = instructionNames[instruction]; + ts.addSyntheticTrailingComment(literal, 3, getInstructionName(instruction)); return literal; } function createInlineBreak(label, location) { ts.Debug.assert(label > 0, "Invalid label: " + label); - return ts.createReturn(ts.createArrayLiteral([ + return ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3), createLabel(label) - ]), location); + ])), location); } function createInlineReturn(expression, location) { - return ts.createReturn(ts.createArrayLiteral(expression + return ts.setTextRange(ts.createReturn(ts.createArrayLiteral(expression ? [createInstruction(2), expression] - : [createInstruction(2)]), location); + : [createInstruction(2)])), location); } function createGeneratorResume(location) { - return ts.createCall(ts.createPropertyAccess(state, "sent"), undefined, [], location); + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(state, "sent"), undefined, []), location); } function emitNop() { emitWorker(0); @@ -42843,7 +46549,7 @@ var ts; currentExceptionBlock = undefined; withBlockStack = undefined; var buildResult = buildStatements(); - return createGeneratorHelper(context, ts.setEmitFlags(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, state)], undefined, ts.createBlock(buildResult, undefined, buildResult.length > 0)), 262144)); + return createGeneratorHelper(context, ts.setEmitFlags(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, state)], undefined, ts.createBlock(buildResult, buildResult.length > 0)), 262144)); } function buildStatements() { if (operations) { @@ -43052,51 +46758,51 @@ var ts; } } function writeAssign(left, right, operationLocation) { - writeStatement(ts.createStatement(ts.createAssignment(left, right), operationLocation)); + writeStatement(ts.setTextRange(ts.createStatement(ts.createAssignment(left, right)), operationLocation)); } function writeThrow(expression, operationLocation) { lastOperationWasAbrupt = true; lastOperationWasCompletion = true; - writeStatement(ts.createThrow(expression, operationLocation)); + writeStatement(ts.setTextRange(ts.createThrow(expression), operationLocation)); } function writeReturn(expression, operationLocation) { lastOperationWasAbrupt = true; lastOperationWasCompletion = true; - writeStatement(ts.createReturn(ts.createArrayLiteral(expression + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral(expression ? [createInstruction(2), expression] - : [createInstruction(2)]), operationLocation)); + : [createInstruction(2)])), operationLocation), 384)); } function writeBreak(label, operationLocation) { lastOperationWasAbrupt = true; - writeStatement(ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3), createLabel(label) - ]), operationLocation)); + ])), operationLocation), 384)); } function writeBreakWhenTrue(label, condition, operationLocation) { - writeStatement(ts.createIf(condition, ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.createIf(condition, ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3), createLabel(label) - ]), operationLocation))); + ])), operationLocation), 384)), 1)); } function writeBreakWhenFalse(label, condition, operationLocation) { - writeStatement(ts.createIf(ts.createLogicalNot(condition), ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.createIf(ts.createLogicalNot(condition), ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3), createLabel(label) - ]), operationLocation))); + ])), operationLocation), 384)), 1)); } function writeYield(expression, operationLocation) { lastOperationWasAbrupt = true; - writeStatement(ts.createReturn(ts.createArrayLiteral(expression + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral(expression ? [createInstruction(4), expression] - : [createInstruction(4)]), operationLocation)); + : [createInstruction(4)])), operationLocation), 384)); } function writeYieldStar(expression, operationLocation) { lastOperationWasAbrupt = true; - writeStatement(ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(5), expression - ]), operationLocation)); + ])), operationLocation), 384)); } function writeEndfinally() { lastOperationWasAbrupt = true; @@ -43114,112 +46820,595 @@ var ts; name: "typescript:generator", scoped: false, priority: 6, - text: "\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;\n return { next: verb(0), \"throw\": verb(1), \"return\": verb(2) };\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [0, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };" + text: "\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [0, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };" }; - var _a; })(ts || (ts = {})); var ts; (function (ts) { - function transformES5(context) { - var previousOnSubstituteNode = context.onSubstituteNode; - context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(177); - context.enableSubstitution(257); - return transformSourceFile; - function transformSourceFile(node) { - return node; - } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (ts.isPropertyAccessExpression(node)) { - return substitutePropertyAccessExpression(node); + function transformModule(context) { + function getTransformModuleDelegate(moduleKind) { + switch (moduleKind) { + case ts.ModuleKind.AMD: return transformAMDModule; + case ts.ModuleKind.UMD: return transformUMDModule; + default: return transformCommonJSModule; } - else if (ts.isPropertyAssignment(node)) { - return substitutePropertyAssignment(node); - } - return node; } - function substitutePropertyAccessExpression(node) { - var literalName = trySubstituteReservedName(node.name); - if (literalName) { - return ts.createElementAccess(node.expression, literalName, node); - } - return node; - } - function substitutePropertyAssignment(node) { - var literalName = ts.isIdentifier(node.name) && trySubstituteReservedName(node.name); - if (literalName) { - return ts.updatePropertyAssignment(node, literalName, node.initializer); - } - return node; - } - function trySubstituteReservedName(name) { - var token = name.originalKeywordKind || (ts.nodeIsSynthesized(name) ? ts.stringToToken(name.text) : undefined); - if (token >= 71 && token <= 106) { - return ts.createLiteral(name, name); - } - return undefined; - } - } - ts.transformES5 = transformES5; -})(ts || (ts = {})); -var ts; -(function (ts) { - function transformES2015Module(context) { + var startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; var compilerOptions = context.getCompilerOptions(); - var previousOnEmitNode = context.onEmitNode; + var resolver = context.getEmitResolver(); + var host = context.getEmitHost(); + var languageVersion = ts.getEmitScriptTarget(compilerOptions); + var moduleKind = ts.getEmitModuleKind(compilerOptions); var previousOnSubstituteNode = context.onSubstituteNode; - context.onEmitNode = onEmitNode; + var previousOnEmitNode = context.onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(261); + context.onEmitNode = onEmitNode; context.enableSubstitution(70); + context.enableSubstitution(193); + context.enableSubstitution(191); + context.enableSubstitution(192); + context.enableSubstitution(261); + context.enableEmitNotification(264); + var moduleInfoMap = []; + var deferredExports = []; var currentSourceFile; + var currentModuleInfo; + var noSubstitution; return transformSourceFile; function transformSourceFile(node) { - if (ts.isDeclarationFile(node)) { + if (ts.isDeclarationFile(node) || !(ts.isExternalModule(node) || compilerOptions.isolatedModules)) { return node; } - if (ts.isExternalModule(node) || compilerOptions.isolatedModules) { - var externalHelpersModuleName = ts.getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions); - if (externalHelpersModuleName) { - var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.statements); - ts.append(statements, ts.createImportDeclaration(undefined, undefined, ts.createImportClause(undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText))); - ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset)); - return ts.updateSourceFileNode(node, ts.createNodeArray(statements, node.statements)); + currentSourceFile = node; + currentModuleInfo = ts.collectExternalModuleInfo(node, resolver, compilerOptions); + moduleInfoMap[ts.getOriginalNodeId(node)] = currentModuleInfo; + var transformModule = getTransformModuleDelegate(moduleKind); + var updated = transformModule(node); + currentSourceFile = undefined; + currentModuleInfo = undefined; + return ts.aggregateTransformFlags(updated); + } + function shouldEmitUnderscoreUnderscoreESModule() { + if (!currentModuleInfo.exportEquals && ts.isExternalModule(currentSourceFile)) { + return true; + } + return false; + } + function transformCommonJSModule(node) { + startLexicalEnvironment(); + var statements = []; + var ensureUseStrict = compilerOptions.alwaysStrict || (!compilerOptions.noImplicitUseStrict && ts.isExternalModule(currentSourceFile)); + var statementOffset = ts.addPrologue(statements, node.statements, ensureUseStrict, sourceElementVisitor); + if (shouldEmitUnderscoreUnderscoreESModule()) { + ts.append(statements, createUnderscoreUnderscoreESModule()); + } + ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement)); + ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); + addExportEqualsIfNeeded(statements, false); + ts.addRange(statements, endLexicalEnvironment()); + var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements)); + if (currentModuleInfo.hasExportStarsToExportValues) { + ts.addEmitHelper(updated, exportStarHelper); + } + return updated; + } + function transformAMDModule(node) { + var define = ts.createIdentifier("define"); + var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions); + var _a = collectAsynchronousDependencies(node, true), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames; + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ + ts.createStatement(ts.createCall(define, undefined, (moduleName ? [moduleName] : []).concat([ + ts.createArrayLiteral([ + ts.createLiteral("require"), + ts.createLiteral("exports") + ].concat(aliasedModuleNames, unaliasedModuleNames)), + ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ + ts.createParameter(undefined, undefined, undefined, "require"), + ts.createParameter(undefined, undefined, undefined, "exports") + ].concat(importAliasNames), undefined, transformAsynchronousModuleBody(node)) + ]))) + ]), node.statements)); + } + function transformUMDModule(node) { + var _a = collectAsynchronousDependencies(node, false), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames; + var umdHeader = ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, "factory")], undefined, ts.setTextRange(ts.createBlock([ + ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier("module"), "object"), ts.createTypeCheck(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), "object")), ts.createBlock([ + ts.createVariableStatement(undefined, [ + ts.createVariableDeclaration("v", undefined, ts.createCall(ts.createIdentifier("factory"), undefined, [ + ts.createIdentifier("require"), + ts.createIdentifier("exports") + ])) + ]), + ts.setEmitFlags(ts.createIf(ts.createStrictInequality(ts.createIdentifier("v"), ts.createIdentifier("undefined")), ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), ts.createIdentifier("v")))), 1) + ]), ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier("define"), "function"), ts.createPropertyAccess(ts.createIdentifier("define"), "amd")), ts.createBlock([ + ts.createStatement(ts.createCall(ts.createIdentifier("define"), undefined, [ + ts.createArrayLiteral([ + ts.createLiteral("require"), + ts.createLiteral("exports") + ].concat(aliasedModuleNames, unaliasedModuleNames)), + ts.createIdentifier("factory") + ])) + ]))) + ], true), undefined)); + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ + ts.createStatement(ts.createCall(umdHeader, undefined, [ + ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ + ts.createParameter(undefined, undefined, undefined, "require"), + ts.createParameter(undefined, undefined, undefined, "exports") + ].concat(importAliasNames), undefined, transformAsynchronousModuleBody(node)) + ])) + ]), node.statements)); + } + function collectAsynchronousDependencies(node, includeNonAmdDependencies) { + var aliasedModuleNames = []; + var unaliasedModuleNames = []; + var importAliasNames = []; + for (var _i = 0, _a = node.amdDependencies; _i < _a.length; _i++) { + var amdDependency = _a[_i]; + if (amdDependency.name) { + aliasedModuleNames.push(ts.createLiteral(amdDependency.path)); + importAliasNames.push(ts.createParameter(undefined, undefined, undefined, amdDependency.name)); } else { - return ts.visitEachChild(node, visitor, context); + unaliasedModuleNames.push(ts.createLiteral(amdDependency.path)); } } - return node; - } - function visitor(node) { - switch (node.kind) { - case 234: - return undefined; - case 240: - return visitExportAssignment(node); + for (var _b = 0, _c = currentModuleInfo.externalImports; _b < _c.length; _b++) { + var importNode = _c[_b]; + var externalModuleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions); + var importAliasName = ts.getLocalNameForExternalImport(importNode, currentSourceFile); + if (externalModuleName) { + if (includeNonAmdDependencies && importAliasName) { + ts.setEmitFlags(importAliasName, 4); + aliasedModuleNames.push(externalModuleName); + importAliasNames.push(ts.createParameter(undefined, undefined, undefined, importAliasName)); + } + else { + unaliasedModuleNames.push(externalModuleName); + } + } } - return node; + return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames }; } - function visitExportAssignment(node) { - return node.isExportEquals ? undefined : node; + function transformAsynchronousModuleBody(node) { + startLexicalEnvironment(); + var statements = []; + var statementOffset = ts.addPrologue(statements, node.statements, !compilerOptions.noImplicitUseStrict, sourceElementVisitor); + if (shouldEmitUnderscoreUnderscoreESModule()) { + ts.append(statements, createUnderscoreUnderscoreESModule()); + } + ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement)); + ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); + addExportEqualsIfNeeded(statements, true); + ts.addRange(statements, endLexicalEnvironment()); + var body = ts.createBlock(statements, true); + if (currentModuleInfo.hasExportStarsToExportValues) { + ts.addEmitHelper(body, exportStarHelper); + } + return body; } - function onEmitNode(emitContext, node, emitCallback) { - if (ts.isSourceFile(node)) { - currentSourceFile = node; - previousOnEmitNode(emitContext, node, emitCallback); - currentSourceFile = undefined; + function addExportEqualsIfNeeded(statements, emitAsReturn) { + if (currentModuleInfo.exportEquals) { + if (emitAsReturn) { + var statement = ts.createReturn(currentModuleInfo.exportEquals.expression); + ts.setTextRange(statement, currentModuleInfo.exportEquals); + ts.setEmitFlags(statement, 384 | 1536); + statements.push(statement); + } + else { + var statement = ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), currentModuleInfo.exportEquals.expression)); + ts.setTextRange(statement, currentModuleInfo.exportEquals); + ts.setEmitFlags(statement, 1536); + statements.push(statement); + } + } + } + function sourceElementVisitor(node) { + switch (node.kind) { + case 237: + return visitImportDeclaration(node); + case 236: + return visitImportEqualsDeclaration(node); + case 243: + return visitExportDeclaration(node); + case 242: + return visitExportAssignment(node); + case 207: + return visitVariableStatement(node); + case 227: + return visitFunctionDeclaration(node); + case 228: + return visitClassDeclaration(node); + case 296: + return visitMergeDeclarationMarker(node); + case 297: + return visitEndOfDeclarationMarker(node); + default: + return node; + } + } + function visitImportDeclaration(node) { + var statements; + var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); + if (moduleKind !== ts.ModuleKind.AMD) { + if (!node.importClause) { + return ts.setTextRange(ts.createStatement(createRequireCall(node)), node); + } + else { + var variables = []; + if (namespaceDeclaration && !ts.isDefaultImport(node)) { + variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, createRequireCall(node))); + } + else { + variables.push(ts.createVariableDeclaration(ts.getGeneratedNameForNode(node), undefined, createRequireCall(node))); + if (namespaceDeclaration && ts.isDefaultImport(node)) { + variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, ts.getGeneratedNameForNode(node))); + } + } + statements = ts.append(statements, ts.setTextRange(ts.createVariableStatement(undefined, ts.createVariableDeclarationList(variables, languageVersion >= 2 ? 2 : 0)), node)); + } + } + else if (namespaceDeclaration && ts.isDefaultImport(node)) { + statements = ts.append(statements, ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, ts.getGeneratedNameForNode(node)), node) + ], languageVersion >= 2 ? 2 : 0))); + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfImportDeclaration(deferredExports[id], node); } else { - previousOnEmitNode(emitContext, node, emitCallback); + statements = appendExportsOfImportDeclaration(statements, node); + } + return ts.singleOrMany(statements); + } + function createRequireCall(importNode) { + var moduleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions); + var args = []; + if (moduleName) { + args.push(moduleName); + } + return ts.createCall(ts.createIdentifier("require"), undefined, args); + } + function visitImportEqualsDeclaration(node) { + ts.Debug.assert(ts.isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer."); + var statements; + if (moduleKind !== ts.ModuleKind.AMD) { + if (ts.hasModifier(node, 1)) { + statements = ts.append(statements, ts.setTextRange(ts.createStatement(createExportExpression(node.name, createRequireCall(node))), node)); + } + else { + statements = ts.append(statements, ts.setTextRange(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration(ts.getSynthesizedClone(node.name), undefined, createRequireCall(node)) + ], languageVersion >= 2 ? 2 : 0)), node)); + } + } + else { + if (ts.hasModifier(node, 1)) { + statements = ts.append(statements, ts.setTextRange(ts.createStatement(createExportExpression(ts.getExportName(node), ts.getLocalName(node))), node)); + } + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfImportEqualsDeclaration(deferredExports[id], node); + } + else { + statements = appendExportsOfImportEqualsDeclaration(statements, node); + } + return ts.singleOrMany(statements); + } + function visitExportDeclaration(node) { + if (!node.moduleSpecifier) { + return undefined; + } + var generatedName = ts.getGeneratedNameForNode(node); + if (node.exportClause) { + var statements = []; + if (moduleKind !== ts.ModuleKind.AMD) { + statements.push(ts.setTextRange(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration(generatedName, undefined, createRequireCall(node)) + ])), node)); + } + for (var _i = 0, _a = node.exportClause.elements; _i < _a.length; _i++) { + var specifier = _a[_i]; + var exportedValue = ts.createPropertyAccess(generatedName, specifier.propertyName || specifier.name); + statements.push(ts.setTextRange(ts.createStatement(createExportExpression(ts.getExportName(specifier), exportedValue)), specifier)); + } + return ts.singleOrMany(statements); + } + else { + return ts.setTextRange(ts.createStatement(ts.createCall(ts.createIdentifier("__export"), undefined, [ + moduleKind !== ts.ModuleKind.AMD + ? createRequireCall(node) + : generatedName + ])), node); } } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (ts.isIdentifier(node) && emitContext === 1) { - return substituteExpressionIdentifier(node); + function visitExportAssignment(node) { + if (node.isExportEquals) { + return undefined; + } + var statements; + var original = node.original; + if (original && hasAssociatedEndOfDeclarationMarker(original)) { + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportStatement(deferredExports[id], ts.createIdentifier("default"), node.expression, node, true); + } + else { + statements = appendExportStatement(statements, ts.createIdentifier("default"), node.expression, node, true); + } + return ts.singleOrMany(statements); + } + function visitFunctionDeclaration(node) { + var statements; + if (ts.hasModifier(node, 1)) { + statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(ts.createFunctionDeclaration(undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, ts.getDeclarationName(node, true, true), undefined, node.parameters, undefined, node.body), node), node)); + } + else { + statements = ts.append(statements, node); + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node); + } + else { + statements = appendExportsOfHoistedDeclaration(statements, node); + } + return ts.singleOrMany(statements); + } + function visitClassDeclaration(node) { + var statements; + if (ts.hasModifier(node, 1)) { + statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(ts.createClassDeclaration(undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.getDeclarationName(node, true, true), undefined, node.heritageClauses, node.members), node), node)); + } + else { + statements = ts.append(statements, node); + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node); + } + else { + statements = appendExportsOfHoistedDeclaration(statements, node); + } + return ts.singleOrMany(statements); + } + function visitVariableStatement(node) { + var statements; + var variables; + var expressions; + if (ts.hasModifier(node, 1)) { + var modifiers = void 0; + for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { + var variable = _a[_i]; + if (ts.isIdentifier(variable.name) && ts.isLocalName(variable.name)) { + if (!modifiers) { + modifiers = ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier); + } + variables = ts.append(variables, variable); + } + else if (variable.initializer) { + expressions = ts.append(expressions, transformInitializedVariable(variable)); + } + } + if (variables) { + statements = ts.append(statements, ts.updateVariableStatement(node, modifiers, ts.updateVariableDeclarationList(node.declarationList, variables))); + } + if (expressions) { + statements = ts.append(statements, ts.setTextRange(ts.createStatement(ts.inlineExpressions(expressions)), node)); + } + } + else { + statements = ts.append(statements, node); + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node); + } + else { + statements = appendExportsOfVariableStatement(statements, node); + } + return ts.singleOrMany(statements); + } + function transformInitializedVariable(node) { + if (ts.isBindingPattern(node.name)) { + return ts.flattenDestructuringAssignment(node, undefined, context, 0, false, createExportExpression); + } + else { + return ts.createAssignment(ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), node.name), node.name), node.initializer); + } + } + function visitMergeDeclarationMarker(node) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 207) { + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); + } + return node; + } + function hasAssociatedEndOfDeclarationMarker(node) { + return (ts.getEmitFlags(node) & 2097152) !== 0; + } + function visitEndOfDeclarationMarker(node) { + var id = ts.getOriginalNodeId(node); + var statements = deferredExports[id]; + if (statements) { + delete deferredExports[id]; + return ts.append(statements, node); + } + return node; + } + function appendExportsOfImportDeclaration(statements, decl) { + if (currentModuleInfo.exportEquals) { + return statements; + } + var importClause = decl.importClause; + if (!importClause) { + return statements; + } + if (importClause.name) { + statements = appendExportsOfDeclaration(statements, importClause); + } + var namedBindings = importClause.namedBindings; + if (namedBindings) { + switch (namedBindings.kind) { + case 239: + statements = appendExportsOfDeclaration(statements, namedBindings); + break; + case 240: + for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { + var importBinding = _a[_i]; + statements = appendExportsOfDeclaration(statements, importBinding); + } + break; + } + } + return statements; + } + function appendExportsOfImportEqualsDeclaration(statements, decl) { + if (currentModuleInfo.exportEquals) { + return statements; + } + return appendExportsOfDeclaration(statements, decl); + } + function appendExportsOfVariableStatement(statements, node) { + if (currentModuleInfo.exportEquals) { + return statements; + } + for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + statements = appendExportsOfBindingElement(statements, decl); + } + return statements; + } + function appendExportsOfBindingElement(statements, decl) { + if (currentModuleInfo.exportEquals) { + return statements; + } + if (ts.isBindingPattern(decl.name)) { + for (var _i = 0, _a = decl.name.elements; _i < _a.length; _i++) { + var element = _a[_i]; + if (!ts.isOmittedExpression(element)) { + statements = appendExportsOfBindingElement(statements, element); + } + } + } + else if (!ts.isGeneratedIdentifier(decl.name)) { + statements = appendExportsOfDeclaration(statements, decl); + } + return statements; + } + function appendExportsOfHoistedDeclaration(statements, decl) { + if (currentModuleInfo.exportEquals) { + return statements; + } + if (ts.hasModifier(decl, 1)) { + var exportName = ts.hasModifier(decl, 512) ? ts.createIdentifier("default") : decl.name; + statements = appendExportStatement(statements, exportName, ts.getLocalName(decl), decl); + } + if (decl.name) { + statements = appendExportsOfDeclaration(statements, decl); + } + return statements; + } + function appendExportsOfDeclaration(statements, decl) { + var name = ts.getDeclarationName(decl); + var exportSpecifiers = currentModuleInfo.exportSpecifiers.get(name.text); + if (exportSpecifiers) { + for (var _i = 0, exportSpecifiers_1 = exportSpecifiers; _i < exportSpecifiers_1.length; _i++) { + var exportSpecifier = exportSpecifiers_1[_i]; + statements = appendExportStatement(statements, exportSpecifier.name, name, exportSpecifier.name); + } + } + return statements; + } + function appendExportStatement(statements, exportName, expression, location, allowComments) { + statements = ts.append(statements, createExportStatement(exportName, expression, location, allowComments)); + return statements; + } + function createUnderscoreUnderscoreESModule() { + var statement; + if (languageVersion === 0) { + statement = ts.createStatement(createExportExpression(ts.createIdentifier("__esModule"), ts.createLiteral(true))); + } + else { + statement = ts.createStatement(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), undefined, [ + ts.createIdentifier("exports"), + ts.createLiteral("__esModule"), + ts.createObjectLiteral([ + ts.createPropertyAssignment("value", ts.createLiteral(true)) + ]) + ])); + } + ts.setEmitFlags(statement, 524288); + return statement; + } + function createExportStatement(name, value, location, allowComments) { + var statement = ts.setTextRange(ts.createStatement(createExportExpression(name, value)), location); + ts.startOnNewLine(statement); + if (!allowComments) { + ts.setEmitFlags(statement, 1536); + } + return statement; + } + function createExportExpression(name, value, location) { + return ts.setTextRange(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(name)), value), location); + } + function modifierVisitor(node) { + switch (node.kind) { + case 83: + case 78: + return undefined; + } + return node; + } + function onEmitNode(hint, node, emitCallback) { + if (node.kind === 264) { + currentSourceFile = node; + currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; + noSubstitution = []; + previousOnEmitNode(hint, node, emitCallback); + currentSourceFile = undefined; + currentModuleInfo = undefined; + noSubstitution = undefined; + } + else { + previousOnEmitNode(hint, node, emitCallback); + } + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (node.id && noSubstitution[node.id]) { + return node; + } + if (hint === 1) { + return substituteExpression(node); + } + else if (ts.isShorthandPropertyAssignment(node)) { + return substituteShorthandPropertyAssignment(node); + } + return node; + } + function substituteShorthandPropertyAssignment(node) { + var name = node.name; + var exportedOrImportedName = substituteExpressionIdentifier(name); + if (exportedOrImportedName !== name) { + if (node.objectAssignmentInitializer) { + var initializer = ts.createAssignment(exportedOrImportedName, node.objectAssignmentInitializer); + return ts.setTextRange(ts.createPropertyAssignment(name, initializer), node); + } + return ts.setTextRange(ts.createPropertyAssignment(name, exportedOrImportedName), node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 70: + return substituteExpressionIdentifier(node); + case 193: + return substituteBinaryExpression(node); + case 192: + case 191: + return substituteUnaryExpression(node); } return node; } @@ -43229,11 +47418,83 @@ var ts; if (externalHelpersModuleName) { return ts.createPropertyAccess(externalHelpersModuleName, node); } + return node; + } + if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { + var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); + if (exportContainer && exportContainer.kind === 264) { + return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), node); + } + var importDeclaration = resolver.getReferencedImportDeclaration(node); + if (importDeclaration) { + if (ts.isImportClause(importDeclaration)) { + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default")), node); + } + else if (ts.isImportSpecifier(importDeclaration)) { + var name = importDeclaration.propertyName || importDeclaration.name; + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(name)), node); + } + } } return node; } + function substituteBinaryExpression(node) { + if (ts.isAssignmentOperator(node.operatorToken.kind) + && ts.isIdentifier(node.left) + && !ts.isGeneratedIdentifier(node.left) + && !ts.isLocalName(node.left) + && !ts.isDeclarationNameOfEnumOrNamespace(node.left)) { + var exportedNames = getExports(node.left); + if (exportedNames) { + var expression = node; + for (var _i = 0, exportedNames_1 = exportedNames; _i < exportedNames_1.length; _i++) { + var exportName = exportedNames_1[_i]; + noSubstitution[ts.getNodeId(expression)] = true; + expression = createExportExpression(exportName, expression, node); + } + return expression; + } + } + return node; + } + function substituteUnaryExpression(node) { + if ((node.operator === 42 || node.operator === 43) + && ts.isIdentifier(node.operand) + && !ts.isGeneratedIdentifier(node.operand) + && !ts.isLocalName(node.operand) + && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { + var exportedNames = getExports(node.operand); + if (exportedNames) { + var expression = node.kind === 192 + ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 42 ? 58 : 59), ts.createLiteral(1)), node) + : node; + for (var _i = 0, exportedNames_2 = exportedNames; _i < exportedNames_2.length; _i++) { + var exportName = exportedNames_2[_i]; + noSubstitution[ts.getNodeId(expression)] = true; + expression = createExportExpression(exportName, expression); + } + return expression; + } + } + return node; + } + function getExports(name) { + if (!ts.isGeneratedIdentifier(name)) { + var valueDeclaration = resolver.getReferencedImportDeclaration(name) + || resolver.getReferencedValueDeclaration(name); + if (valueDeclaration) { + return currentModuleInfo + && currentModuleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]; + } + } + } } - ts.transformES2015Module = transformES2015Module; + ts.transformModule = transformModule; + var exportStarHelper = { + name: "typescript:export-star", + scoped: true, + text: "\n function __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n }" + }; })(ts || (ts = {})); var ts; (function (ts) { @@ -43247,14 +47508,14 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(70); - context.enableSubstitution(192); - context.enableSubstitution(190); + context.enableSubstitution(193); context.enableSubstitution(191); - context.enableEmitNotification(261); - var moduleInfoMap = ts.createMap(); - var deferredExports = ts.createMap(); - var exportFunctionsMap = ts.createMap(); - var noSubstitutionMap = ts.createMap(); + context.enableSubstitution(192); + context.enableEmitNotification(264); + var moduleInfoMap = []; + var deferredExports = []; + var exportFunctionsMap = []; + var noSubstitutionMap = []; var currentSourceFile; var moduleInfo; var exportFunction; @@ -43273,7 +47534,8 @@ var ts; currentSourceFile = node; enclosingBlockScopedContainer = node; moduleInfo = moduleInfoMap[id] = ts.collectExternalModuleInfo(node, resolver, compilerOptions); - exportFunction = exportFunctionsMap[id] = ts.createUniqueName("exports"); + exportFunction = ts.createUniqueName("exports"); + exportFunctionsMap[id] = exportFunction; contextObject = ts.createUniqueName("context"); var dependencyGroups = collectDependencyGroups(moduleInfo.externalImports); var moduleBodyBlock = createSystemModuleBody(node, dependencyGroups); @@ -43283,11 +47545,11 @@ var ts; ], undefined, moduleBodyBlock); var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions); var dependencies = ts.createArrayLiteral(ts.map(dependencyGroups, function (dependencyGroup) { return dependencyGroup.name; })); - var updated = ts.updateSourceFileNode(node, ts.createNodeArray([ + var updated = ts.setEmitFlags(ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ ts.createStatement(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("System"), "register"), undefined, moduleName ? [moduleName, dependencies, moduleBodyFunction] : [dependencies, moduleBodyFunction])) - ], node.statements)); + ]), node.statements)), 1024); if (!(compilerOptions.outFile || compilerOptions.out)) { ts.moveEmitHelpers(updated, moduleBodyBlock, function (helper) { return !helper.scoped; }); } @@ -43309,17 +47571,19 @@ var ts; for (var i = 0; i < externalImports.length; i++) { var externalImport = externalImports[i]; var externalModuleName = ts.getExternalModuleNameLiteral(externalImport, currentSourceFile, host, resolver, compilerOptions); - var text = externalModuleName.text; - if (ts.hasProperty(groupIndices, text)) { - var groupIndex = groupIndices[text]; - dependencyGroups[groupIndex].externalImports.push(externalImport); - } - else { - groupIndices[text] = dependencyGroups.length; - dependencyGroups.push({ - name: externalModuleName, - externalImports: [externalImport] - }); + if (externalModuleName) { + var text = externalModuleName.text; + var groupIndex = groupIndices.get(text); + if (groupIndex !== undefined) { + dependencyGroups[groupIndex].externalImports.push(externalImport); + } + else { + groupIndices.set(text, dependencyGroups.length); + dependencyGroups.push({ + name: externalModuleName, + externalImports: [externalImport] + }); + } } } return dependencyGroups; @@ -43327,30 +47591,33 @@ var ts; function createSystemModuleBody(node, dependencyGroups) { var statements = []; startLexicalEnvironment(); - var statementOffset = ts.addPrologueDirectives(statements, node.statements, !compilerOptions.noImplicitUseStrict, sourceElementVisitor); + var ensureUseStrict = compilerOptions.alwaysStrict || (!compilerOptions.noImplicitUseStrict && ts.isExternalModule(currentSourceFile)); + var statementOffset = ts.addPrologue(statements, node.statements, ensureUseStrict, sourceElementVisitor); statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ ts.createVariableDeclaration("__moduleName", undefined, ts.createLogicalAnd(contextObject, ts.createPropertyAccess(contextObject, "id"))) ]))); - ts.visitNode(moduleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement, true); + ts.visitNode(moduleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement); var executeStatements = ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset); ts.addRange(statements, hoistedStatements); ts.addRange(statements, endLexicalEnvironment()); var exportStarFunction = addExportStarIfNeeded(statements); - statements.push(ts.createReturn(ts.setMultiLine(ts.createObjectLiteral([ + var moduleObject = ts.createObjectLiteral([ ts.createPropertyAssignment("setters", createSettersArray(exportStarFunction, dependencyGroups)), - ts.createPropertyAssignment("execute", ts.createFunctionExpression(undefined, undefined, undefined, undefined, [], undefined, ts.createBlock(executeStatements, undefined, true))) - ]), true))); - return ts.createBlock(statements, undefined, true); + ts.createPropertyAssignment("execute", ts.createFunctionExpression(undefined, undefined, undefined, undefined, [], undefined, ts.createBlock(executeStatements, true))) + ]); + moduleObject.multiLine = true; + statements.push(ts.createReturn(moduleObject)); + return ts.createBlock(statements, true); } function addExportStarIfNeeded(statements) { if (!moduleInfo.hasExportStarsToExportValues) { return; } - if (!moduleInfo.exportedNames && ts.isEmpty(moduleInfo.exportSpecifiers)) { + if (!moduleInfo.exportedNames && moduleInfo.exportSpecifiers.size === 0) { var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 241 && externalImport.exportClause) { + if (externalImport.kind === 243 && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -43368,12 +47635,12 @@ var ts; if (exportedLocalName.text === "default") { continue; } - exportedNames.push(ts.createPropertyAssignment(ts.createLiteral(exportedLocalName), ts.createLiteral(true))); + exportedNames.push(ts.createPropertyAssignment(ts.createLiteral(exportedLocalName), ts.createTrue())); } } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 241) { + if (externalImport.kind !== 243) { continue; } var exportDecl = externalImport; @@ -43382,12 +47649,12 @@ var ts; } for (var _f = 0, _g = exportDecl.exportClause.elements; _f < _g.length; _f++) { var element = _g[_f]; - exportedNames.push(ts.createPropertyAssignment(ts.createLiteral((element.name || element.propertyName).text), ts.createLiteral(true))); + exportedNames.push(ts.createPropertyAssignment(ts.createLiteral((element.name || element.propertyName).text), ts.createTrue())); } } var exportedNamesStorageRef = ts.createUniqueName("exportedNames"); statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ - ts.createVariableDeclaration(exportedNamesStorageRef, undefined, ts.createObjectLiteral(exportedNames, undefined, true)) + ts.createVariableDeclaration(exportedNamesStorageRef, undefined, ts.createObjectLiteral(exportedNames, true)) ]))); var exportStarFunction = createExportStarFunction(exportedNamesStorageRef); statements.push(exportStarFunction); @@ -43412,7 +47679,7 @@ var ts; ts.setEmitFlags(ts.createIf(condition, ts.createStatement(ts.createAssignment(ts.createElementAccess(exports, n), ts.createElementAccess(m, n)))), 1) ])), ts.createStatement(ts.createCall(exportFunction, undefined, [exports])) - ], undefined, true)); + ], true)); } function createSettersArray(exportStarFunction, dependencyGroups) { var setters = []; @@ -43425,15 +47692,15 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); switch (entry.kind) { - case 235: + case 237: if (!entry.importClause) { break; } - case 234: + case 236: ts.Debug.assert(importVariableName !== undefined); statements.push(ts.createStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 241: + case 243: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { var properties = []; @@ -43441,7 +47708,7 @@ var ts; var e = _d[_c]; properties.push(ts.createPropertyAssignment(ts.createLiteral(e.name.text), ts.createElementAccess(parameterName, ts.createLiteral((e.propertyName || e.name).text)))); } - statements.push(ts.createStatement(ts.createCall(exportFunction, undefined, [ts.createObjectLiteral(properties, undefined, true)]))); + statements.push(ts.createStatement(ts.createCall(exportFunction, undefined, [ts.createObjectLiteral(properties, true)]))); } else { statements.push(ts.createStatement(ts.createCall(exportStarFunction, undefined, [parameterName]))); @@ -43449,19 +47716,19 @@ var ts; break; } } - setters.push(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, parameterName)], undefined, ts.createBlock(statements, undefined, true))); + setters.push(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, parameterName)], undefined, ts.createBlock(statements, true))); } - return ts.createArrayLiteral(setters, undefined, true); + return ts.createArrayLiteral(setters, true); } function sourceElementVisitor(node) { switch (node.kind) { - case 235: + case 237: return visitImportDeclaration(node); - case 234: + case 236: return visitImportEqualsDeclaration(node); - case 241: + case 243: return undefined; - case 240: + case 242: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -43510,7 +47777,7 @@ var ts; } function visitFunctionDeclaration(node) { if (ts.hasModifier(node, 1)) { - hoistedStatements = ts.append(hoistedStatements, ts.updateFunctionDeclaration(node, node.decorators, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.getDeclarationName(node, true, true), undefined, ts.visitNodes(node.parameters, destructuringVisitor, ts.isParameterDeclaration), undefined, ts.visitNode(node.body, destructuringVisitor, ts.isBlock))); + hoistedStatements = ts.append(hoistedStatements, ts.updateFunctionDeclaration(node, node.decorators, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, ts.getDeclarationName(node, true, true), undefined, ts.visitNodes(node.parameters, destructuringVisitor, ts.isParameterDeclaration), undefined, ts.visitNode(node.body, destructuringVisitor, ts.isBlock))); } else { hoistedStatements = ts.append(hoistedStatements, node); @@ -43528,7 +47795,7 @@ var ts; var statements; var name = ts.getLocalName(node); hoistVariableDeclaration(name); - statements = ts.append(statements, ts.createStatement(ts.createAssignment(name, ts.createClassExpression(undefined, node.name, undefined, ts.visitNodes(node.heritageClauses, destructuringVisitor, ts.isHeritageClause), ts.visitNodes(node.members, destructuringVisitor, ts.isClassElement), node)), node)); + statements = ts.append(statements, ts.setTextRange(ts.createStatement(ts.createAssignment(name, ts.setTextRange(ts.createClassExpression(undefined, node.name, undefined, ts.visitNodes(node.heritageClauses, destructuringVisitor, ts.isHeritageClause), ts.visitNodes(node.members, destructuringVisitor, ts.isClassElement)), node))), node)); if (hasAssociatedEndOfDeclarationMarker(node)) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node); @@ -43556,7 +47823,7 @@ var ts; } var statements; if (expressions) { - statements = ts.append(statements, ts.createStatement(ts.inlineExpressions(expressions), node)); + statements = ts.append(statements, ts.setTextRange(ts.createStatement(ts.inlineExpressions(expressions)), node)); } if (isMarkedDeclaration) { var id = ts.getOriginalNodeId(node); @@ -43582,7 +47849,7 @@ var ts; } function shouldHoistVariableDeclarationList(node) { return (ts.getEmitFlags(node) & 1048576) === 0 - && (enclosingBlockScopedContainer.kind === 261 + && (enclosingBlockScopedContainer.kind === 264 || (ts.getOriginalNode(node).flags & 3) === 0); } function transformInitializedVariable(node, isExportedDeclaration) { @@ -43600,11 +47867,11 @@ var ts; function createVariableAssignment(name, value, location, isExportedDeclaration) { hoistVariableDeclaration(ts.getSynthesizedClone(name)); return isExportedDeclaration - ? createExportExpression(name, preventSubstitution(ts.createAssignment(name, value, location))) - : preventSubstitution(ts.createAssignment(name, value, location)); + ? createExportExpression(name, preventSubstitution(ts.setTextRange(ts.createAssignment(name, value), location))) + : preventSubstitution(ts.setTextRange(ts.createAssignment(name, value), location)); } function visitMergeDeclarationMarker(node) { - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 205) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 207) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -43637,10 +47904,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 237: + case 239: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 238: + case 240: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -43710,10 +47977,10 @@ var ts; return statements; } var name = ts.getDeclarationName(decl); - var exportSpecifiers = moduleInfo.exportSpecifiers[name.text]; + var exportSpecifiers = moduleInfo.exportSpecifiers.get(name.text); if (exportSpecifiers) { - for (var _i = 0, exportSpecifiers_1 = exportSpecifiers; _i < exportSpecifiers_1.length; _i++) { - var exportSpecifier = exportSpecifiers_1[_i]; + for (var _i = 0, exportSpecifiers_2 = exportSpecifiers; _i < exportSpecifiers_2.length; _i++) { + var exportSpecifier = exportSpecifiers_2[_i]; if (exportSpecifier.name.text !== excludeName) { statements = appendExportStatement(statements, exportSpecifier.name, name); } @@ -43739,43 +48006,43 @@ var ts; } function nestedElementVisitor(node) { switch (node.kind) { - case 205: + case 207: return visitVariableStatement(node); - case 225: + case 227: return visitFunctionDeclaration(node); - case 226: + case 228: return visitClassDeclaration(node); - case 211: - return visitForStatement(node); - case 212: - return visitForInStatement(node); case 213: + return visitForStatement(node); + case 214: + return visitForInStatement(node); + case 215: return visitForOfStatement(node); - case 209: + case 211: return visitDoStatement(node); - case 210: + case 212: return visitWhileStatement(node); - case 219: - return visitLabeledStatement(node); - case 217: - return visitWithStatement(node); - case 218: - return visitSwitchStatement(node); - case 232: - return visitCaseBlock(node); - case 253: - return visitCaseClause(node); - case 254: - return visitDefaultClause(node); case 221: - return visitTryStatement(node); + return visitLabeledStatement(node); + case 219: + return visitWithStatement(node); + case 220: + return visitSwitchStatement(node); + case 234: + return visitCaseBlock(node); case 256: + return visitCaseClause(node); + case 257: + return visitDefaultClause(node); + case 223: + return visitTryStatement(node); + case 259: return visitCatchClause(node); - case 204: + case 206: return visitBlock(node); - case 295: - return visitMergeDeclarationMarker(node); case 296: + return visitMergeDeclarationMarker(node); + case 297: return visitEndOfDeclarationMarker(node); default: return destructuringVisitor(node); @@ -43784,21 +48051,21 @@ var ts; function visitForStatement(node) { var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; enclosingBlockScopedContainer = node; - node = ts.updateFor(node, visitForInitializer(node.initializer), ts.visitNode(node.condition, destructuringVisitor, ts.isExpression, true), ts.visitNode(node.incrementor, destructuringVisitor, ts.isExpression, true), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement)); + node = ts.updateFor(node, visitForInitializer(node.initializer), ts.visitNode(node.condition, destructuringVisitor, ts.isExpression), ts.visitNode(node.incrementor, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement)); enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; return node; } function visitForInStatement(node) { var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; enclosingBlockScopedContainer = node; - node = ts.updateForIn(node, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, false, ts.liftToBlock)); + node = ts.updateForIn(node, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; return node; } function visitForOfStatement(node) { var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; enclosingBlockScopedContainer = node; - node = ts.updateForOf(node, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, false, ts.liftToBlock)); + node = ts.updateForOf(node, node.awaitModifier, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; return node; } @@ -43807,6 +48074,9 @@ var ts; && shouldHoistVariableDeclarationList(node); } function visitForInitializer(node) { + if (!node) { + return node; + } if (shouldHoistForInitializer(node)) { var expressions = void 0; for (var _i = 0, _a = node.declarations; _i < _a.length; _i++) { @@ -43820,16 +48090,16 @@ var ts; } } function visitDoStatement(node) { - return ts.updateDo(node, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, false, ts.liftToBlock), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression)); + return ts.updateDo(node, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression)); } function visitWhileStatement(node) { - return ts.updateWhile(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, false, ts.liftToBlock)); + return ts.updateWhile(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); } function visitLabeledStatement(node) { - return ts.updateLabel(node, node.label, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, false, ts.liftToBlock)); + return ts.updateLabel(node, node.label, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); } function visitWithStatement(node) { - return ts.updateWith(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, false, ts.liftToBlock)); + return ts.updateWith(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); } function visitSwitchStatement(node) { return ts.updateSwitch(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.caseBlock, nestedElementVisitor, ts.isCaseBlock)); @@ -43866,7 +48136,7 @@ var ts; } function destructuringVisitor(node) { if (node.transformFlags & 1024 - && node.kind === 192) { + && node.kind === 193) { return visitDestructuringAssignment(node); } else if (node.transformFlags & 2048) { @@ -43883,7 +48153,7 @@ var ts; return ts.visitEachChild(node, destructuringVisitor, context); } function hasExportedReferenceInDestructuringTarget(node) { - if (ts.isAssignmentExpression(node)) { + if (ts.isAssignmentExpression(node, true)) { return hasExportedReferenceInDestructuringTarget(node.left); } else if (ts.isSpreadExpression(node)) { @@ -43903,7 +48173,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 261; + return container !== undefined && container.kind === 264; } else { return false; @@ -43917,8 +48187,8 @@ var ts; } return node; } - function onEmitNode(emitContext, node, emitCallback) { - if (node.kind === 261) { + function onEmitNode(hint, node, emitCallback) { + if (node.kind === 264) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -43927,22 +48197,22 @@ var ts; if (noSubstitution) { delete noSubstitutionMap[id]; } - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); currentSourceFile = undefined; moduleInfo = undefined; exportFunction = undefined; noSubstitution = undefined; } else { - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); } } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); if (isSubstitutionPrevented(node)) { return node; } - if (emitContext === 1) { + if (hint === 1) { return substituteExpression(node); } return node; @@ -43951,10 +48221,10 @@ var ts; switch (node.kind) { case 70: return substituteExpressionIdentifier(node); - case 192: + case 193: return substituteBinaryExpression(node); - case 190: case 191: + case 192: return substituteUnaryExpression(node); } return node; @@ -43971,655 +48241,10 @@ var ts; var importDeclaration = resolver.getReferencedImportDeclaration(node); if (importDeclaration) { if (ts.isImportClause(importDeclaration)) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default"), node); + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default")), node); } else if (ts.isImportSpecifier(importDeclaration)) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(importDeclaration.propertyName || importDeclaration.name), node); - } - } - } - return node; - } - function substituteBinaryExpression(node) { - if (ts.isAssignmentOperator(node.operatorToken.kind) - && ts.isIdentifier(node.left) - && !ts.isGeneratedIdentifier(node.left) - && !ts.isLocalName(node.left) - && !ts.isDeclarationNameOfEnumOrNamespace(node.left)) { - var exportedNames = getExports(node.left); - if (exportedNames) { - var expression = node; - for (var _i = 0, exportedNames_1 = exportedNames; _i < exportedNames_1.length; _i++) { - var exportName = exportedNames_1[_i]; - expression = createExportExpression(exportName, preventSubstitution(expression)); - } - return expression; - } - } - return node; - } - function substituteUnaryExpression(node) { - if ((node.operator === 42 || node.operator === 43) - && ts.isIdentifier(node.operand) - && !ts.isGeneratedIdentifier(node.operand) - && !ts.isLocalName(node.operand) - && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { - var exportedNames = getExports(node.operand); - if (exportedNames) { - var expression = node.kind === 191 - ? ts.createPrefix(node.operator, node.operand, node) - : node; - for (var _i = 0, exportedNames_2 = exportedNames; _i < exportedNames_2.length; _i++) { - var exportName = exportedNames_2[_i]; - expression = createExportExpression(exportName, preventSubstitution(expression)); - } - if (node.kind === 191) { - expression = node.operator === 42 - ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) - : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); - } - return expression; - } - } - return node; - } - function getExports(name) { - var exportedNames; - if (!ts.isGeneratedIdentifier(name)) { - var valueDeclaration = resolver.getReferencedImportDeclaration(name) - || resolver.getReferencedValueDeclaration(name); - if (valueDeclaration) { - var exportContainer = resolver.getReferencedExportContainer(name, false); - if (exportContainer && exportContainer.kind === 261) { - exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); - } - exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); - } - } - return exportedNames; - } - function preventSubstitution(node) { - if (noSubstitution === undefined) - noSubstitution = ts.createMap(); - noSubstitution[ts.getNodeId(node)] = true; - return node; - } - function isSubstitutionPrevented(node) { - return noSubstitution && node.id && noSubstitution[node.id]; - } - } - ts.transformSystemModule = transformSystemModule; -})(ts || (ts = {})); -var ts; -(function (ts) { - function transformModule(context) { - var transformModuleDelegates = ts.createMap((_a = {}, - _a[ts.ModuleKind.None] = transformCommonJSModule, - _a[ts.ModuleKind.CommonJS] = transformCommonJSModule, - _a[ts.ModuleKind.AMD] = transformAMDModule, - _a[ts.ModuleKind.UMD] = transformUMDModule, - _a)); - var startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; - var compilerOptions = context.getCompilerOptions(); - var resolver = context.getEmitResolver(); - var host = context.getEmitHost(); - var languageVersion = ts.getEmitScriptTarget(compilerOptions); - var moduleKind = ts.getEmitModuleKind(compilerOptions); - var previousOnSubstituteNode = context.onSubstituteNode; - var previousOnEmitNode = context.onEmitNode; - context.onSubstituteNode = onSubstituteNode; - context.onEmitNode = onEmitNode; - context.enableSubstitution(70); - context.enableSubstitution(192); - context.enableSubstitution(190); - context.enableSubstitution(191); - context.enableSubstitution(258); - context.enableEmitNotification(261); - var moduleInfoMap = ts.createMap(); - var deferredExports = ts.createMap(); - var currentSourceFile; - var currentModuleInfo; - var noSubstitution; - return transformSourceFile; - function transformSourceFile(node) { - if (ts.isDeclarationFile(node) - || !(ts.isExternalModule(node) - || compilerOptions.isolatedModules)) { - return node; - } - currentSourceFile = node; - currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(node)] = ts.collectExternalModuleInfo(node, resolver, compilerOptions); - var transformModule = transformModuleDelegates[moduleKind] || transformModuleDelegates[ts.ModuleKind.None]; - var updated = transformModule(node); - currentSourceFile = undefined; - currentModuleInfo = undefined; - return ts.aggregateTransformFlags(updated); - } - function transformCommonJSModule(node) { - startLexicalEnvironment(); - var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.statements, !compilerOptions.noImplicitUseStrict, sourceElementVisitor); - ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement, true)); - ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); - ts.addRange(statements, endLexicalEnvironment()); - addExportEqualsIfNeeded(statements, false); - var updated = ts.updateSourceFileNode(node, ts.createNodeArray(statements, node.statements)); - if (currentModuleInfo.hasExportStarsToExportValues) { - ts.addEmitHelper(updated, exportStarHelper); - } - return updated; - } - function transformAMDModule(node) { - var define = ts.createIdentifier("define"); - var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions); - return transformAsynchronousModule(node, define, moduleName, true); - } - function transformUMDModule(node) { - var define = ts.createRawExpression(umdHelper); - return transformAsynchronousModule(node, define, undefined, false); - } - function transformAsynchronousModule(node, define, moduleName, includeNonAmdDependencies) { - var _a = collectAsynchronousDependencies(node, includeNonAmdDependencies), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames; - return ts.updateSourceFileNode(node, ts.createNodeArray([ - ts.createStatement(ts.createCall(define, undefined, (moduleName ? [moduleName] : []).concat([ - ts.createArrayLiteral([ - ts.createLiteral("require"), - ts.createLiteral("exports") - ].concat(aliasedModuleNames, unaliasedModuleNames)), - ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ - ts.createParameter(undefined, undefined, undefined, "require"), - ts.createParameter(undefined, undefined, undefined, "exports") - ].concat(importAliasNames), undefined, transformAsynchronousModuleBody(node)) - ]))) - ], node.statements)); - } - function collectAsynchronousDependencies(node, includeNonAmdDependencies) { - var aliasedModuleNames = []; - var unaliasedModuleNames = []; - var importAliasNames = []; - for (var _i = 0, _a = node.amdDependencies; _i < _a.length; _i++) { - var amdDependency = _a[_i]; - if (amdDependency.name) { - aliasedModuleNames.push(ts.createLiteral(amdDependency.path)); - importAliasNames.push(ts.createParameter(undefined, undefined, undefined, amdDependency.name)); - } - else { - unaliasedModuleNames.push(ts.createLiteral(amdDependency.path)); - } - } - for (var _b = 0, _c = currentModuleInfo.externalImports; _b < _c.length; _b++) { - var importNode = _c[_b]; - var externalModuleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions); - var importAliasName = ts.getLocalNameForExternalImport(importNode, currentSourceFile); - if (includeNonAmdDependencies && importAliasName) { - ts.setEmitFlags(importAliasName, 4); - aliasedModuleNames.push(externalModuleName); - importAliasNames.push(ts.createParameter(undefined, undefined, undefined, importAliasName)); - } - else { - unaliasedModuleNames.push(externalModuleName); - } - } - return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames }; - } - function transformAsynchronousModuleBody(node) { - startLexicalEnvironment(); - var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.statements, !compilerOptions.noImplicitUseStrict, sourceElementVisitor); - ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement, true)); - ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); - ts.addRange(statements, endLexicalEnvironment()); - addExportEqualsIfNeeded(statements, true); - var body = ts.createBlock(statements, undefined, true); - if (currentModuleInfo.hasExportStarsToExportValues) { - ts.addEmitHelper(body, exportStarHelper); - } - return body; - } - function addExportEqualsIfNeeded(statements, emitAsReturn) { - if (currentModuleInfo.exportEquals) { - if (emitAsReturn) { - var statement = ts.createReturn(currentModuleInfo.exportEquals.expression, currentModuleInfo.exportEquals); - ts.setEmitFlags(statement, 384 | 1536); - statements.push(statement); - } - else { - var statement = ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), currentModuleInfo.exportEquals.expression), currentModuleInfo.exportEquals); - ts.setEmitFlags(statement, 1536); - statements.push(statement); - } - } - } - function sourceElementVisitor(node) { - switch (node.kind) { - case 235: - return visitImportDeclaration(node); - case 234: - return visitImportEqualsDeclaration(node); - case 241: - return visitExportDeclaration(node); - case 240: - return visitExportAssignment(node); - case 205: - return visitVariableStatement(node); - case 225: - return visitFunctionDeclaration(node); - case 226: - return visitClassDeclaration(node); - case 295: - return visitMergeDeclarationMarker(node); - case 296: - return visitEndOfDeclarationMarker(node); - default: - return node; - } - } - function visitImportDeclaration(node) { - var statements; - var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); - if (moduleKind !== ts.ModuleKind.AMD) { - if (!node.importClause) { - return ts.createStatement(createRequireCall(node), node); - } - else { - var variables = []; - if (namespaceDeclaration && !ts.isDefaultImport(node)) { - variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, createRequireCall(node))); - } - else { - variables.push(ts.createVariableDeclaration(ts.getGeneratedNameForNode(node), undefined, createRequireCall(node))); - if (namespaceDeclaration && ts.isDefaultImport(node)) { - variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, ts.getGeneratedNameForNode(node))); - } - } - statements = ts.append(statements, ts.createVariableStatement(undefined, ts.createVariableDeclarationList(variables, undefined, languageVersion >= 2 ? 2 : 0), node)); - } - } - else if (namespaceDeclaration && ts.isDefaultImport(node)) { - statements = ts.append(statements, ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ - ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, ts.getGeneratedNameForNode(node), node) - ], undefined, languageVersion >= 2 ? 2 : 0))); - } - if (hasAssociatedEndOfDeclarationMarker(node)) { - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfImportDeclaration(deferredExports[id], node); - } - else { - statements = appendExportsOfImportDeclaration(statements, node); - } - return ts.singleOrMany(statements); - } - function createRequireCall(importNode) { - var moduleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions); - var args = []; - if (moduleName) { - args.push(moduleName); - } - return ts.createCall(ts.createIdentifier("require"), undefined, args); - } - function visitImportEqualsDeclaration(node) { - ts.Debug.assert(ts.isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer."); - var statements; - if (moduleKind !== ts.ModuleKind.AMD) { - if (ts.hasModifier(node, 1)) { - statements = ts.append(statements, ts.createStatement(createExportExpression(node.name, createRequireCall(node)), node)); - } - else { - statements = ts.append(statements, ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ - ts.createVariableDeclaration(ts.getSynthesizedClone(node.name), undefined, createRequireCall(node)) - ], undefined, languageVersion >= 2 ? 2 : 0), node)); - } - } - else { - if (ts.hasModifier(node, 1)) { - statements = ts.append(statements, ts.createStatement(createExportExpression(ts.getExportName(node), ts.getLocalName(node)), node)); - } - } - if (hasAssociatedEndOfDeclarationMarker(node)) { - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfImportEqualsDeclaration(deferredExports[id], node); - } - else { - statements = appendExportsOfImportEqualsDeclaration(statements, node); - } - return ts.singleOrMany(statements); - } - function visitExportDeclaration(node) { - if (!node.moduleSpecifier) { - return undefined; - } - var generatedName = ts.getGeneratedNameForNode(node); - if (node.exportClause) { - var statements = []; - if (moduleKind !== ts.ModuleKind.AMD) { - statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ - ts.createVariableDeclaration(generatedName, undefined, createRequireCall(node)) - ]), node)); - } - for (var _i = 0, _a = node.exportClause.elements; _i < _a.length; _i++) { - var specifier = _a[_i]; - var exportedValue = ts.createPropertyAccess(generatedName, specifier.propertyName || specifier.name); - statements.push(ts.createStatement(createExportExpression(ts.getExportName(specifier), exportedValue), specifier)); - } - return ts.singleOrMany(statements); - } - else { - return ts.createStatement(ts.createCall(ts.createIdentifier("__export"), undefined, [ - moduleKind !== ts.ModuleKind.AMD - ? createRequireCall(node) - : generatedName - ]), node); - } - } - function visitExportAssignment(node) { - if (node.isExportEquals) { - return undefined; - } - var statements; - var original = node.original; - if (original && hasAssociatedEndOfDeclarationMarker(original)) { - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportStatement(deferredExports[id], ts.createIdentifier("default"), node.expression, node, true); - } - else { - statements = appendExportStatement(statements, ts.createIdentifier("default"), node.expression, node, true); - } - return ts.singleOrMany(statements); - } - function visitFunctionDeclaration(node) { - var statements; - if (ts.hasModifier(node, 1)) { - statements = ts.append(statements, ts.setOriginalNode(ts.createFunctionDeclaration(undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, ts.getDeclarationName(node, true, true), undefined, node.parameters, undefined, node.body, node), node)); - } - else { - statements = ts.append(statements, node); - } - if (hasAssociatedEndOfDeclarationMarker(node)) { - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node); - } - else { - statements = appendExportsOfHoistedDeclaration(statements, node); - } - return ts.singleOrMany(statements); - } - function visitClassDeclaration(node) { - var statements; - if (ts.hasModifier(node, 1)) { - statements = ts.append(statements, ts.setOriginalNode(ts.createClassDeclaration(undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.getDeclarationName(node, true, true), undefined, node.heritageClauses, node.members, node), node)); - } - else { - statements = ts.append(statements, node); - } - if (hasAssociatedEndOfDeclarationMarker(node)) { - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node); - } - else { - statements = appendExportsOfHoistedDeclaration(statements, node); - } - return ts.singleOrMany(statements); - } - function visitVariableStatement(node) { - var statements; - var variables; - var expressions; - if (ts.hasModifier(node, 1)) { - var modifiers = void 0; - for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { - var variable = _a[_i]; - if (ts.isIdentifier(variable.name) && ts.isLocalName(variable.name)) { - if (!modifiers) { - modifiers = ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier); - } - variables = ts.append(variables, variable); - } - else if (variable.initializer) { - expressions = ts.append(expressions, transformInitializedVariable(variable)); - } - } - if (variables) { - statements = ts.append(statements, ts.updateVariableStatement(node, modifiers, ts.updateVariableDeclarationList(node.declarationList, variables))); - } - if (expressions) { - statements = ts.append(statements, ts.createStatement(ts.inlineExpressions(expressions), node)); - } - } - else { - statements = ts.append(statements, node); - } - if (hasAssociatedEndOfDeclarationMarker(node)) { - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node); - } - else { - statements = appendExportsOfVariableStatement(statements, node); - } - return ts.singleOrMany(statements); - } - function transformInitializedVariable(node) { - if (ts.isBindingPattern(node.name)) { - return ts.flattenDestructuringAssignment(node, undefined, context, 0, false, createExportExpression); - } - else { - return ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("exports"), node.name, node.name), node.initializer); - } - } - function visitMergeDeclarationMarker(node) { - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 205) { - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); - } - return node; - } - function hasAssociatedEndOfDeclarationMarker(node) { - return (ts.getEmitFlags(node) & 2097152) !== 0; - } - function visitEndOfDeclarationMarker(node) { - var id = ts.getOriginalNodeId(node); - var statements = deferredExports[id]; - if (statements) { - delete deferredExports[id]; - return ts.append(statements, node); - } - return node; - } - function appendExportsOfImportDeclaration(statements, decl) { - if (currentModuleInfo.exportEquals) { - return statements; - } - var importClause = decl.importClause; - if (!importClause) { - return statements; - } - if (importClause.name) { - statements = appendExportsOfDeclaration(statements, importClause); - } - var namedBindings = importClause.namedBindings; - if (namedBindings) { - switch (namedBindings.kind) { - case 237: - statements = appendExportsOfDeclaration(statements, namedBindings); - break; - case 238: - for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { - var importBinding = _a[_i]; - statements = appendExportsOfDeclaration(statements, importBinding); - } - break; - } - } - return statements; - } - function appendExportsOfImportEqualsDeclaration(statements, decl) { - if (currentModuleInfo.exportEquals) { - return statements; - } - return appendExportsOfDeclaration(statements, decl); - } - function appendExportsOfVariableStatement(statements, node) { - if (currentModuleInfo.exportEquals) { - return statements; - } - for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { - var decl = _a[_i]; - statements = appendExportsOfBindingElement(statements, decl); - } - return statements; - } - function appendExportsOfBindingElement(statements, decl) { - if (currentModuleInfo.exportEquals) { - return statements; - } - if (ts.isBindingPattern(decl.name)) { - for (var _i = 0, _a = decl.name.elements; _i < _a.length; _i++) { - var element = _a[_i]; - if (!ts.isOmittedExpression(element)) { - statements = appendExportsOfBindingElement(statements, element); - } - } - } - else if (!ts.isGeneratedIdentifier(decl.name)) { - statements = appendExportsOfDeclaration(statements, decl); - } - return statements; - } - function appendExportsOfHoistedDeclaration(statements, decl) { - if (currentModuleInfo.exportEquals) { - return statements; - } - if (ts.hasModifier(decl, 1)) { - var exportName = ts.hasModifier(decl, 512) ? ts.createIdentifier("default") : decl.name; - statements = appendExportStatement(statements, exportName, ts.getLocalName(decl), decl); - } - if (decl.name) { - statements = appendExportsOfDeclaration(statements, decl); - } - return statements; - } - function appendExportsOfDeclaration(statements, decl) { - var name = ts.getDeclarationName(decl); - var exportSpecifiers = currentModuleInfo.exportSpecifiers[name.text]; - if (exportSpecifiers) { - for (var _i = 0, exportSpecifiers_2 = exportSpecifiers; _i < exportSpecifiers_2.length; _i++) { - var exportSpecifier = exportSpecifiers_2[_i]; - statements = appendExportStatement(statements, exportSpecifier.name, name, exportSpecifier.name); - } - } - return statements; - } - function appendExportStatement(statements, exportName, expression, location, allowComments) { - if (exportName.text === "default") { - var sourceFile = ts.getOriginalNode(currentSourceFile, ts.isSourceFile); - if (sourceFile && !sourceFile.symbol.exports["___esModule"]) { - if (languageVersion === 0) { - statements = ts.append(statements, ts.createStatement(createExportExpression(ts.createIdentifier("__esModule"), ts.createLiteral(true)))); - } - else { - statements = ts.append(statements, ts.createStatement(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), undefined, [ - ts.createIdentifier("exports"), - ts.createLiteral("__esModule"), - ts.createObjectLiteral([ - ts.createPropertyAssignment("value", ts.createLiteral(true)) - ]) - ]))); - } - } - } - statements = ts.append(statements, createExportStatement(exportName, expression, location, allowComments)); - return statements; - } - function createExportStatement(name, value, location, allowComments) { - var statement = ts.createStatement(createExportExpression(name, value), location); - ts.startOnNewLine(statement); - if (!allowComments) { - ts.setEmitFlags(statement, 1536); - } - return statement; - } - function createExportExpression(name, value, location) { - return ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(name)), value, location); - } - function modifierVisitor(node) { - switch (node.kind) { - case 83: - case 78: - return undefined; - } - return node; - } - function onEmitNode(emitContext, node, emitCallback) { - if (node.kind === 261) { - currentSourceFile = node; - currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; - noSubstitution = ts.createMap(); - previousOnEmitNode(emitContext, node, emitCallback); - currentSourceFile = undefined; - currentModuleInfo = undefined; - noSubstitution = undefined; - } - else { - previousOnEmitNode(emitContext, node, emitCallback); - } - } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (node.id && noSubstitution[node.id]) { - return node; - } - if (emitContext === 1) { - return substituteExpression(node); - } - else if (ts.isShorthandPropertyAssignment(node)) { - return substituteShorthandPropertyAssignment(node); - } - return node; - } - function substituteShorthandPropertyAssignment(node) { - var name = node.name; - var exportedOrImportedName = substituteExpressionIdentifier(name); - if (exportedOrImportedName !== name) { - if (node.objectAssignmentInitializer) { - var initializer = ts.createAssignment(exportedOrImportedName, node.objectAssignmentInitializer); - return ts.createPropertyAssignment(name, initializer, node); - } - return ts.createPropertyAssignment(name, exportedOrImportedName, node); - } - return node; - } - function substituteExpression(node) { - switch (node.kind) { - case 70: - return substituteExpressionIdentifier(node); - case 192: - return substituteBinaryExpression(node); - case 191: - case 190: - return substituteUnaryExpression(node); - } - return node; - } - function substituteExpressionIdentifier(node) { - if (ts.getEmitFlags(node) & 4096) { - var externalHelpersModuleName = ts.getExternalHelpersModuleName(currentSourceFile); - if (externalHelpersModuleName) { - return ts.createPropertyAccess(externalHelpersModuleName, node); - } - return node; - } - if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { - var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 261) { - return ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node), node); - } - var importDeclaration = resolver.getReferencedImportDeclaration(node); - if (importDeclaration) { - if (ts.isImportClause(importDeclaration)) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default"), node); - } - else if (ts.isImportSpecifier(importDeclaration)) { - var name_37 = importDeclaration.propertyName || importDeclaration.name; - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(name_37), node); + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(importDeclaration.propertyName || importDeclaration.name)), node); } } } @@ -44636,8 +48261,7 @@ var ts; var expression = node; for (var _i = 0, exportedNames_3 = exportedNames; _i < exportedNames_3.length; _i++) { var exportName = exportedNames_3[_i]; - noSubstitution[ts.getNodeId(expression)] = true; - expression = createExportExpression(exportName, expression, node); + expression = createExportExpression(exportName, preventSubstitution(expression)); } return expression; } @@ -44652,13 +48276,17 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 191 - ? ts.createBinary(node.operand, ts.createToken(node.operator === 42 ? 58 : 59), ts.createLiteral(1), node) + var expression = node.kind === 192 + ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_4 = exportedNames; _i < exportedNames_4.length; _i++) { var exportName = exportedNames_4[_i]; - noSubstitution[ts.getNodeId(expression)] = true; - expression = createExportExpression(exportName, expression); + expression = createExportExpression(exportName, preventSubstitution(expression)); + } + if (node.kind === 192) { + expression = node.operator === 42 + ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) + : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); } return expression; } @@ -44666,40 +48294,122 @@ var ts; return node; } function getExports(name) { + var exportedNames; if (!ts.isGeneratedIdentifier(name)) { var valueDeclaration = resolver.getReferencedImportDeclaration(name) || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { - return currentModuleInfo - && currentModuleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]; + var exportContainer = resolver.getReferencedExportContainer(name, false); + if (exportContainer && exportContainer.kind === 264) { + exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); + } + exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); } } + return exportedNames; + } + function preventSubstitution(node) { + if (noSubstitution === undefined) + noSubstitution = []; + noSubstitution[ts.getNodeId(node)] = true; + return node; + } + function isSubstitutionPrevented(node) { + return noSubstitution && node.id && noSubstitution[node.id]; } - var _a; } - ts.transformModule = transformModule; - var exportStarHelper = { - name: "typescript:export-star", - scoped: true, - text: "\n function __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n }" - }; - var umdHelper = "\n (function (dependencies, factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define(dependencies, factory);\n }\n })"; + ts.transformSystemModule = transformSystemModule; })(ts || (ts = {})); var ts; (function (ts) { - var moduleTransformerMap = ts.createMap((_a = {}, - _a[ts.ModuleKind.ES2015] = ts.transformES2015Module, - _a[ts.ModuleKind.System] = ts.transformSystemModule, - _a[ts.ModuleKind.AMD] = ts.transformModule, - _a[ts.ModuleKind.CommonJS] = ts.transformModule, - _a[ts.ModuleKind.UMD] = ts.transformModule, - _a[ts.ModuleKind.None] = ts.transformModule, - _a)); - function getTransformers(compilerOptions) { + function transformES2015Module(context) { + var compilerOptions = context.getCompilerOptions(); + var previousOnEmitNode = context.onEmitNode; + var previousOnSubstituteNode = context.onSubstituteNode; + context.onEmitNode = onEmitNode; + context.onSubstituteNode = onSubstituteNode; + context.enableEmitNotification(264); + context.enableSubstitution(70); + var currentSourceFile; + return transformSourceFile; + function transformSourceFile(node) { + if (ts.isDeclarationFile(node)) { + return node; + } + if (ts.isExternalModule(node) || compilerOptions.isolatedModules) { + var externalHelpersModuleName = ts.getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions); + if (externalHelpersModuleName) { + var statements = []; + var statementOffset = ts.addPrologue(statements, node.statements); + ts.append(statements, ts.createImportDeclaration(undefined, undefined, ts.createImportClause(undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText))); + ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset)); + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements)); + } + else { + return ts.visitEachChild(node, visitor, context); + } + } + return node; + } + function visitor(node) { + switch (node.kind) { + case 236: + return undefined; + case 242: + return visitExportAssignment(node); + } + return node; + } + function visitExportAssignment(node) { + return node.isExportEquals ? undefined : node; + } + function onEmitNode(hint, node, emitCallback) { + if (ts.isSourceFile(node)) { + currentSourceFile = node; + previousOnEmitNode(hint, node, emitCallback); + currentSourceFile = undefined; + } + else { + previousOnEmitNode(hint, node, emitCallback); + } + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (ts.isIdentifier(node) && hint === 1) { + return substituteExpressionIdentifier(node); + } + return node; + } + function substituteExpressionIdentifier(node) { + if (ts.getEmitFlags(node) & 4096) { + var externalHelpersModuleName = ts.getExternalHelpersModuleName(currentSourceFile); + if (externalHelpersModuleName) { + return ts.createPropertyAccess(externalHelpersModuleName, node); + } + } + return node; + } + } + ts.transformES2015Module = transformES2015Module; +})(ts || (ts = {})); +var ts; +(function (ts) { + function getModuleTransformer(moduleKind) { + switch (moduleKind) { + case ts.ModuleKind.ES2015: + return ts.transformES2015Module; + case ts.ModuleKind.System: + return ts.transformSystemModule; + default: + return ts.transformModule; + } + } + function getTransformers(compilerOptions, customTransformers) { var jsx = compilerOptions.jsx; var languageVersion = ts.getEmitScriptTarget(compilerOptions); var moduleKind = ts.getEmitModuleKind(compilerOptions); var transformers = []; + ts.addRange(transformers, customTransformers && customTransformers.before); transformers.push(ts.transformTypeScript); if (jsx === 2) { transformers.push(ts.transformJsx); @@ -44717,16 +48427,16 @@ var ts; transformers.push(ts.transformES2015); transformers.push(ts.transformGenerators); } - transformers.push(moduleTransformerMap[moduleKind] || moduleTransformerMap[ts.ModuleKind.None]); + transformers.push(getModuleTransformer(moduleKind)); if (languageVersion < 1) { transformers.push(ts.transformES5); } + ts.addRange(transformers, customTransformers && customTransformers.after); return transformers; } ts.getTransformers = getTransformers; - function transformFiles(resolver, host, sourceFiles, transformers) { + function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { var enabledSyntaxKindFeatures = new Array(298); - var lexicalEnvironmentDisabled = false; var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -44734,8 +48444,11 @@ var ts; var lexicalEnvironmentStackOffset = 0; var lexicalEnvironmentSuspended = false; var emitHelpers; + var onSubstituteNode = function (_, node) { return node; }; + var onEmitNode = function (hint, node, callback) { return callback(hint, node); }; + var state = 0; var context = { - getCompilerOptions: function () { return host.getCompilerOptions(); }, + getCompilerOptions: function () { return options; }, getEmitResolver: function () { return resolver; }, getEmitHost: function () { return host; }, startLexicalEnvironment: startLexicalEnvironment, @@ -44746,65 +48459,77 @@ var ts; hoistFunctionDeclaration: hoistFunctionDeclaration, requestEmitHelper: requestEmitHelper, readEmitHelpers: readEmitHelpers, - onSubstituteNode: function (_emitContext, node) { return node; }, enableSubstitution: enableSubstitution, - isSubstitutionEnabled: isSubstitutionEnabled, - onEmitNode: function (node, emitContext, emitCallback) { return emitCallback(node, emitContext); }, enableEmitNotification: enableEmitNotification, - isEmitNotificationEnabled: isEmitNotificationEnabled + isSubstitutionEnabled: isSubstitutionEnabled, + isEmitNotificationEnabled: isEmitNotificationEnabled, + get onSubstituteNode() { return onSubstituteNode; }, + set onSubstituteNode(value) { + ts.Debug.assert(state < 1, "Cannot modify transformation hooks after initialization has completed."); + ts.Debug.assert(value !== undefined, "Value must not be 'undefined'"); + onSubstituteNode = value; + }, + get onEmitNode() { return onEmitNode; }, + set onEmitNode(value) { + ts.Debug.assert(state < 1, "Cannot modify transformation hooks after initialization has completed."); + ts.Debug.assert(value !== undefined, "Value must not be 'undefined'"); + onEmitNode = value; + } }; + for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { + var node = nodes_4[_i]; + ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node))); + } + ts.performance.mark("beforeTransform"); var transformation = ts.chain.apply(void 0, transformers)(context); - var transformed = ts.map(sourceFiles, transformSourceFile); - lexicalEnvironmentDisabled = true; + state = 1; + var transformed = ts.map(nodes, allowDtsFiles ? transformation : transformRoot); + state = 2; + ts.performance.mark("afterTransform"); + ts.performance.measure("transformTime", "beforeTransform", "afterTransform"); return { transformed: transformed, - emitNodeWithSubstitution: emitNodeWithSubstitution, - emitNodeWithNotification: emitNodeWithNotification + substituteNode: substituteNode, + emitNodeWithNotification: emitNodeWithNotification, + dispose: dispose }; - function transformSourceFile(sourceFile) { - if (ts.isDeclarationFile(sourceFile)) { - return sourceFile; - } - return transformation(sourceFile); + function transformRoot(node) { + return node && (!ts.isSourceFile(node) || !ts.isDeclarationFile(node)) ? transformation(node) : node; } function enableSubstitution(kind) { + ts.Debug.assert(state < 2, "Cannot modify the transformation context after transformation has completed."); enabledSyntaxKindFeatures[kind] |= 1; } function isSubstitutionEnabled(node) { return (enabledSyntaxKindFeatures[node.kind] & 1) !== 0 && (ts.getEmitFlags(node) & 4) === 0; } - function emitNodeWithSubstitution(emitContext, node, emitCallback) { - if (node) { - if (isSubstitutionEnabled(node)) { - var substitute = context.onSubstituteNode(emitContext, node); - if (substitute && substitute !== node) { - emitCallback(emitContext, substitute); - return; - } - } - emitCallback(emitContext, node); - } + function substituteNode(hint, node) { + ts.Debug.assert(state < 3, "Cannot substitute a node after the result is disposed."); + return node && isSubstitutionEnabled(node) && onSubstituteNode(hint, node) || node; } function enableEmitNotification(kind) { + ts.Debug.assert(state < 2, "Cannot modify the transformation context after transformation has completed."); enabledSyntaxKindFeatures[kind] |= 2; } function isEmitNotificationEnabled(node) { return (enabledSyntaxKindFeatures[node.kind] & 2) !== 0 || (ts.getEmitFlags(node) & 2) !== 0; } - function emitNodeWithNotification(emitContext, node, emitCallback) { + function emitNodeWithNotification(hint, node, emitCallback) { + ts.Debug.assert(state < 3, "Cannot invoke TransformationResult callbacks after the result is disposed."); if (node) { if (isEmitNotificationEnabled(node)) { - context.onEmitNode(emitContext, node, emitCallback); + onEmitNode(hint, node, emitCallback); } else { - emitCallback(emitContext, node); + emitCallback(hint, node); } } } function hoistVariableDeclaration(name) { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); var decl = ts.createVariableDeclaration(name); if (!lexicalEnvironmentVariableDeclarations) { lexicalEnvironmentVariableDeclarations = [decl]; @@ -44814,7 +48539,8 @@ var ts; } } function hoistFunctionDeclaration(func) { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); if (!lexicalEnvironmentFunctionDeclarations) { lexicalEnvironmentFunctionDeclarations = [func]; } @@ -44823,7 +48549,8 @@ var ts; } } function startLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot start a lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is suspended."); lexicalEnvironmentVariableDeclarationsStack[lexicalEnvironmentStackOffset] = lexicalEnvironmentVariableDeclarations; lexicalEnvironmentFunctionDeclarationsStack[lexicalEnvironmentStackOffset] = lexicalEnvironmentFunctionDeclarations; @@ -44832,17 +48559,20 @@ var ts; lexicalEnvironmentFunctionDeclarations = undefined; } function suspendLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot suspend a lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is already suspended."); lexicalEnvironmentSuspended = true; } function resumeLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot resume a lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(lexicalEnvironmentSuspended, "Lexical environment is not suspended."); lexicalEnvironmentSuspended = false; } function endLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot end a lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is suspended."); var statements; if (lexicalEnvironmentVariableDeclarations || lexicalEnvironmentFunctionDeclarations) { @@ -44869,19 +48599,36 @@ var ts; return statements; } function requestEmitHelper(helper) { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the transformation context during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the transformation context after transformation has completed."); ts.Debug.assert(!helper.scoped, "Cannot request a scoped emit helper."); emitHelpers = ts.append(emitHelpers, helper); } function readEmitHelpers() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the transformation context during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the transformation context after transformation has completed."); var helpers = emitHelpers; emitHelpers = undefined; return helpers; } + function dispose() { + if (state < 3) { + for (var _i = 0, nodes_5 = nodes; _i < nodes_5.length; _i++) { + var node = nodes_5[_i]; + ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node))); + } + lexicalEnvironmentVariableDeclarations = undefined; + lexicalEnvironmentVariableDeclarationsStack = undefined; + lexicalEnvironmentFunctionDeclarations = undefined; + lexicalEnvironmentFunctionDeclarationsStack = undefined; + onSubstituteNode = undefined; + onEmitNode = undefined; + emitHelpers = undefined; + state = 3; + } + } } - ts.transformFiles = transformFiles; - var _a; + ts.transformNodes = transformNodes; })(ts || (ts = {})); var ts; (function (ts) { @@ -44915,7 +48662,7 @@ var ts; getText: getText, getSourceMappingURL: getSourceMappingURL, }; - function initialize(filePath, sourceMapFilePath, sourceFiles, isBundledEmit) { + function initialize(filePath, sourceMapFilePath, sourceFileOrBundle) { if (disabled) { return; } @@ -44946,9 +48693,8 @@ var ts; } if (compilerOptions.mapRoot) { sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); - if (!isBundledEmit) { - ts.Debug.assert(sourceFiles.length === 1); - sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFiles[0], host, sourceMapDir)); + if (sourceFileOrBundle.kind === 264) { + sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFileOrBundle, host, sourceMapDir)); } if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); @@ -45039,28 +48785,28 @@ var ts; ts.performance.measure("Source Map", "beforeSourcemap", "afterSourcemap"); } } - function emitNodeWithSourceMap(emitContext, node, emitCallback) { + function emitNodeWithSourceMap(hint, node, emitCallback) { if (disabled) { - return emitCallback(emitContext, node); + return emitCallback(hint, node); } if (node) { var emitNode = node.emitNode; var emitFlags = emitNode && emitNode.flags; var _a = emitNode && emitNode.sourceMapRange || node, pos = _a.pos, end = _a.end; - if (node.kind !== 293 + if (node.kind !== 294 && (emitFlags & 16) === 0 && pos >= 0) { emitPos(ts.skipTrivia(currentSourceText, pos)); } if (emitFlags & 64) { disabled = true; - emitCallback(emitContext, node); + emitCallback(hint, node); disabled = false; } else { - emitCallback(emitContext, node); + emitCallback(hint, node); } - if (node.kind !== 293 + if (node.kind !== 294 && (emitFlags & 32) === 0 && end >= 0) { emitPos(end); @@ -45109,7 +48855,7 @@ var ts; return; } encodeLastRecordedSourceMapSpan(); - return ts.stringify({ + return JSON.stringify({ version: 3, file: sourceMapData.sourceMapFile, sourceRoot: sourceMapData.sourceMapSourceRoot, @@ -45161,11 +48907,10 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - function createCommentWriter(host, writer, sourceMap) { - var compilerOptions = host.getCompilerOptions(); - var extendedDiagnostics = compilerOptions.extendedDiagnostics; - var newLine = host.getNewLine(); - var emitPos = sourceMap.emitPos; + function createCommentWriter(printerOptions, emitPos) { + var extendedDiagnostics = printerOptions.extendedDiagnostics; + var newLine = ts.getNewLineCharacter(printerOptions); + var writer; var containerPos = -1; var containerEnd = -1; var declarationListContainerEnd = -1; @@ -45174,37 +48919,34 @@ var ts; var currentLineMap; var detachedCommentsInfo; var hasWrittenComment = false; - var disabled = compilerOptions.removeComments; + var disabled = printerOptions.removeComments; return { reset: reset, + setWriter: setWriter, setSourceFile: setSourceFile, emitNodeWithComments: emitNodeWithComments, emitBodyWithDetachedComments: emitBodyWithDetachedComments, emitTrailingCommentsOfPosition: emitTrailingCommentsOfPosition, + emitLeadingCommentsOfPosition: emitLeadingCommentsOfPosition, }; - function emitNodeWithComments(emitContext, node, emitCallback) { + function emitNodeWithComments(hint, node, emitCallback) { if (disabled) { - emitCallback(emitContext, node); + emitCallback(hint, node); return; } if (node) { - var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var emitFlags = ts.getEmitFlags(node); + hasWrittenComment = false; + var emitNode = node.emitNode; + var emitFlags = emitNode && emitNode.flags; + var _a = emitNode && emitNode.commentRange || node, pos = _a.pos, end = _a.end; if ((pos < 0 && end < 0) || (pos === end)) { - if (emitFlags & 2048) { - disabled = true; - emitCallback(emitContext, node); - disabled = false; - } - else { - emitCallback(emitContext, node); - } + emitNodeWithSynthesizedComments(hint, node, emitNode, emitFlags, emitCallback); } else { if (extendedDiagnostics) { ts.performance.mark("preEmitNodeWithComment"); } - var isEmittedNode = node.kind !== 293; + var isEmittedNode = node.kind !== 294; var skipLeadingComments = pos < 0 || (emitFlags & 512) !== 0; var skipTrailingComments = end < 0 || (emitFlags & 1024) !== 0; if (!skipLeadingComments) { @@ -45218,23 +48960,16 @@ var ts; } if (!skipTrailingComments) { containerEnd = end; - if (node.kind === 224) { + if (node.kind === 226) { declarationListContainerEnd = end; } } if (extendedDiagnostics) { ts.performance.measure("commentTime", "preEmitNodeWithComment"); } - if (emitFlags & 2048) { - disabled = true; - emitCallback(emitContext, node); - disabled = false; - } - else { - emitCallback(emitContext, node); - } + emitNodeWithSynthesizedComments(hint, node, emitNode, emitFlags, emitCallback); if (extendedDiagnostics) { - ts.performance.mark("beginEmitNodeWithComment"); + ts.performance.mark("postEmitNodeWithComment"); } containerPos = savedContainerPos; containerEnd = savedContainerEnd; @@ -45243,11 +48978,75 @@ var ts; emitTrailingComments(end); } if (extendedDiagnostics) { - ts.performance.measure("commentTime", "beginEmitNodeWithComment"); + ts.performance.measure("commentTime", "postEmitNodeWithComment"); } } } } + function emitNodeWithSynthesizedComments(hint, node, emitNode, emitFlags, emitCallback) { + var leadingComments = emitNode && emitNode.leadingComments; + if (ts.some(leadingComments)) { + if (extendedDiagnostics) { + ts.performance.mark("preEmitNodeWithSynthesizedComments"); + } + ts.forEach(leadingComments, emitLeadingSynthesizedComment); + if (extendedDiagnostics) { + ts.performance.measure("commentTime", "preEmitNodeWithSynthesizedComments"); + } + } + emitNodeWithNestedComments(hint, node, emitFlags, emitCallback); + var trailingComments = emitNode && emitNode.trailingComments; + if (ts.some(trailingComments)) { + if (extendedDiagnostics) { + ts.performance.mark("postEmitNodeWithSynthesizedComments"); + } + ts.forEach(trailingComments, emitTrailingSynthesizedComment); + if (extendedDiagnostics) { + ts.performance.measure("commentTime", "postEmitNodeWithSynthesizedComments"); + } + } + } + function emitLeadingSynthesizedComment(comment) { + if (comment.kind === 2) { + writer.writeLine(); + } + writeSynthesizedComment(comment); + if (comment.hasTrailingNewLine || comment.kind === 2) { + writer.writeLine(); + } + else { + writer.write(" "); + } + } + function emitTrailingSynthesizedComment(comment) { + if (!writer.isAtStartOfLine()) { + writer.write(" "); + } + writeSynthesizedComment(comment); + if (comment.hasTrailingNewLine) { + writer.writeLine(); + } + } + function writeSynthesizedComment(comment) { + var text = formatSynthesizedComment(comment); + var lineMap = comment.kind === 3 ? ts.computeLineStarts(text) : undefined; + ts.writeCommentRange(text, lineMap, writer, 0, text.length, newLine); + } + function formatSynthesizedComment(comment) { + return comment.kind === 3 + ? "/*" + comment.text + "*/" + : "//" + comment.text; + } + function emitNodeWithNestedComments(hint, node, emitFlags, emitCallback) { + if (emitFlags & 2048) { + disabled = true; + emitCallback(hint, node); + disabled = false; + } + else { + emitCallback(hint, node); + } + } function emitBodyWithDetachedComments(node, detachedRange, emitCallback) { if (extendedDiagnostics) { ts.performance.mark("preEmitBodyWithDetachedComments"); @@ -45275,6 +49074,9 @@ var ts; } if (!skipTrailingComments) { emitLeadingComments(detachedRange.end, true); + if (hasWrittenComment && !writer.isAtStartOfLine()) { + writer.writeLine(); + } } if (extendedDiagnostics) { ts.performance.measure("commentTime", "beginEmitBodyWithDetachedCommetns"); @@ -45299,9 +49101,11 @@ var ts; ts.emitNewLineBeforeLeadingCommentOfPosition(currentLineMap, writer, rangePos, commentPos); hasWrittenComment = true; } - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); if (hasTrailingNewLine) { writer.writeLine(); } @@ -45309,6 +49113,12 @@ var ts; writer.write(" "); } } + function emitLeadingCommentsOfPosition(pos) { + if (disabled || pos === -1) { + return; + } + emitLeadingComments(pos, true); + } function emitTrailingComments(pos) { forEachTrailingCommentToEmit(pos, emitTrailingComment); } @@ -45316,9 +49126,11 @@ var ts; if (!writer.isAtStartOfLine()) { writer.write(" "); } - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); if (hasTrailingNewLine) { writer.writeLine(); } @@ -45336,9 +49148,11 @@ var ts; } } function emitTrailingCommentOfPosition(commentPos, commentEnd, _kind, hasTrailingNewLine) { - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); if (hasTrailingNewLine) { writer.writeLine(); } @@ -45367,6 +49181,9 @@ var ts; currentLineMap = undefined; detachedCommentsInfo = undefined; } + function setWriter(output) { + writer = output; + } function setSourceFile(sourceFile) { currentSourceFile = sourceFile; currentText = currentSourceFile.text; @@ -45398,9 +49215,11 @@ var ts; } } function writeComment(text, lineMap, writer, commentPos, commentEnd, newLine) { - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(text, lineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); } function isTripleSlashComment(commentPos, commentEnd) { if (currentText.charCodeAt(commentPos + 1) === 47 && @@ -45420,15 +49239,17 @@ var ts; (function (ts) { function getDeclarationDiagnostics(host, resolver, targetSourceFile) { var declarationDiagnostics = ts.createDiagnosticCollection(); - ts.forEachExpectedEmitFile(host, getDeclarationDiagnosticsFromFile, targetSourceFile); + ts.forEachEmittedFile(host, getDeclarationDiagnosticsFromFile, targetSourceFile); return declarationDiagnostics.getDiagnostics(targetSourceFile ? targetSourceFile.fileName : undefined); - function getDeclarationDiagnosticsFromFile(_a, sources, isBundledEmit) { + function getDeclarationDiagnosticsFromFile(_a, sourceFileOrBundle) { var declarationFilePath = _a.declarationFilePath; - emitDeclarations(host, resolver, declarationDiagnostics, declarationFilePath, sources, isBundledEmit, false); + emitDeclarations(host, resolver, declarationDiagnostics, declarationFilePath, sourceFileOrBundle, false); } } ts.getDeclarationDiagnostics = getDeclarationDiagnostics; - function emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFiles, isBundledEmit, emitOnlyDtsFiles) { + function emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles) { + var sourceFiles = sourceFileOrBundle.kind === 265 ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; + var isBundledEmit = sourceFileOrBundle.kind === 265; var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); var write; @@ -45490,7 +49311,7 @@ var ts; var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { - ts.Debug.assert(aliasEmitInfo.node.kind === 235); + ts.Debug.assert(aliasEmitInfo.node.kind === 237); createAndSetNewTextWriterWithSymbolWriter(); ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit)); for (var i = 0; i < aliasEmitInfo.indent; i++) { @@ -45513,9 +49334,9 @@ var ts; } }); if (usedTypeDirectiveReferences) { - for (var directive in usedTypeDirectiveReferences) { + ts.forEachKey(usedTypeDirectiveReferences, function (directive) { referencesOutput += "/// " + newLine; - } + }); } return { reportedDeclarationError: reportedDeclarationError, @@ -45540,12 +49361,14 @@ var ts; var writer = ts.createTextWriter(newLine); writer.trackSymbol = trackSymbol; writer.reportInaccessibleThisError = reportInaccessibleThisError; + writer.reportIllegalExtends = reportIllegalExtends; writer.writeKeyword = writer.write; writer.writeOperator = writer.write; writer.writePunctuation = writer.write; writer.writeSpace = writer.write; writer.writeStringLiteral = writer.writeLiteral; writer.writeParameter = writer.write; + writer.writeProperty = writer.write; writer.writeSymbol = writer.write; setWriter(writer); } @@ -45561,10 +49384,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 223) { + if (declaration.kind === 225) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 238 || declaration.kind === 239 || declaration.kind === 236) { + else if (declaration.kind === 240 || declaration.kind === 241 || declaration.kind === 238) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -45575,7 +49398,7 @@ var ts; moduleElementEmitInfo = ts.forEach(asynchronousSubModuleDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; }); } if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 235) { + if (moduleElementEmitInfo.node.kind === 237) { moduleElementEmitInfo.isVisible = true; } else { @@ -45583,12 +49406,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 230) { + if (nodeToCheck.kind === 232) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 230) { + if (nodeToCheck.kind === 232) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -45607,8 +49430,8 @@ var ts; } for (var _i = 0, typeReferenceDirectives_1 = typeReferenceDirectives; _i < typeReferenceDirectives_1.length; _i++) { var directive = typeReferenceDirectives_1[_i]; - if (!(directive in usedTypeDirectiveReferences)) { - usedTypeDirectiveReferences[directive] = directive; + if (!usedTypeDirectiveReferences.has(directive)) { + usedTypeDirectiveReferences.set(directive, directive); } } } @@ -45635,6 +49458,12 @@ var ts; handleSymbolAccessibilityError(resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning, true)); recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForSymbol(symbol, meaning)); } + function reportIllegalExtends() { + if (errorNameNode) { + reportedDeclarationError = true; + emitterDiagnostics.add(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.extends_clause_of_exported_class_0_refers_to_a_type_whose_name_cannot_be_referenced, ts.declarationNameToString(errorNameNode))); + } + } function reportInaccessibleThisError() { if (errorNameNode) { reportedDeclarationError = true; @@ -45644,12 +49473,16 @@ var ts; function writeTypeOfDeclaration(declaration, type, getSymbolAccessibilityDiagnostic) { writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; write(": "); - if (type) { + var shouldUseResolverType = declaration.kind === 145 && + resolver.isRequiredInitializedParameter(declaration); + if (type && !shouldUseResolverType) { emitType(type); } else { errorNameNode = declaration.name; - resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, 2 | 1024, writer); + var format = 2 | 1024 | + (shouldUseResolverType ? 4096 : 0); + resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, format, writer); errorNameNode = undefined; } } @@ -45666,15 +49499,15 @@ var ts; } } function emitLines(nodes) { - for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { - var node = nodes_4[_i]; + for (var _i = 0, nodes_6 = nodes; _i < nodes_6.length; _i++) { + var node = nodes_6[_i]; emit(node); } } function emitSeparatedList(nodes, separator, eachNodeEmitFn, canEmitFn) { var currentWriterPos = writer.getTextPos(); - for (var _i = 0, nodes_5 = nodes; _i < nodes_5.length; _i++) { - var node = nodes_5[_i]; + for (var _i = 0, nodes_7 = nodes; _i < nodes_7.length; _i++) { + var node = nodes_7[_i]; if (!canEmitFn || canEmitFn(node)) { if (currentWriterPos !== writer.getTextPos()) { write(separator); @@ -45701,49 +49534,50 @@ var ts; function emitType(type) { switch (type.kind) { case 118: - case 134: + case 135: case 132: case 121: - case 135: + case 133: + case 136: case 104: - case 137: + case 138: case 94: case 129: - case 167: - case 171: - return writeTextOfNode(currentText, type); - case 199: - return emitExpressionWithTypeArguments(type); - case 157: - return emitTypeReference(type); - case 160: - return emitTypeQuery(type); - case 162: - return emitArrayType(type); - case 163: - return emitTupleType(type); - case 164: - return emitUnionType(type); - case 165: - return emitIntersectionType(type); - case 166: - return emitParenType(type); case 168: - return emitTypeOperator(type); - case 169: - return emitIndexedAccessType(type); - case 170: - return emitMappedType(type); + case 172: + return writeTextOfNode(currentText, type); + case 200: + return emitExpressionWithTypeArguments(type); case 158: - case 159: - return emitSignatureDeclarationWithJsDocComments(type); + return emitTypeReference(type); case 161: + return emitTypeQuery(type); + case 163: + return emitArrayType(type); + case 164: + return emitTupleType(type); + case 165: + return emitUnionType(type); + case 166: + return emitIntersectionType(type); + case 167: + return emitParenType(type); + case 169: + return emitTypeOperator(type); + case 170: + return emitIndexedAccessType(type); + case 171: + return emitMappedType(type); + case 159: + case 160: + return emitSignatureDeclarationWithJsDocComments(type); + case 162: return emitTypeLiteral(type); case 70: return emitEntityName(type); - case 141: + case 142: return emitEntityName(type); - case 156: + case 157: return emitTypePredicate(type); } function writeEntityName(entityName) { @@ -45751,22 +49585,22 @@ var ts; writeTextOfNode(currentText, entityName); } else { - var left = entityName.kind === 141 ? entityName.left : entityName.expression; - var right = entityName.kind === 141 ? entityName.right : entityName.name; + var left = entityName.kind === 142 ? entityName.left : entityName.expression; + var right = entityName.kind === 142 ? entityName.right : entityName.name; writeEntityName(left); write("."); writeTextOfNode(currentText, right); } } function emitEntityName(entityName) { - var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 234 ? entityName.parent : enclosingDeclaration); + var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 236 ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForEntityName(entityName)); writeEntityName(entityName); } function emitExpressionWithTypeArguments(node) { if (ts.isEntityNameExpression(node.expression)) { - ts.Debug.assert(node.expression.kind === 70 || node.expression.kind === 177); + ts.Debug.assert(node.expression.kind === 70 || node.expression.kind === 178); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -45870,15 +49704,15 @@ var ts; } function getExportDefaultTempVariableName() { var baseName = "_default"; - if (!(baseName in currentIdentifiers)) { + if (!currentIdentifiers.has(baseName)) { return baseName; } var count = 0; while (true) { count++; - var name_38 = baseName + "_" + count; - if (!(name_38 in currentIdentifiers)) { - return name_38; + var name = baseName + "_" + count; + if (!currentIdentifiers.has(name)) { + return name; } } } @@ -45922,10 +49756,10 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 234 || - (node.parent.kind === 261 && isCurrentFileExternalModule)) { + else if (node.kind === 236 || + (node.parent.kind === 264 && isCurrentFileExternalModule)) { var isVisible = void 0; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 261) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 264) { asynchronousSubModuleDeclarationEmitInfo.push({ node: node, outputPos: writer.getTextPos(), @@ -45934,7 +49768,7 @@ var ts; }); } else { - if (node.kind === 235) { + if (node.kind === 237) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -45952,30 +49786,30 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 225: - return writeFunctionDeclaration(node); - case 205: - return writeVariableStatement(node); case 227: - return writeInterfaceDeclaration(node); - case 226: - return writeClassDeclaration(node); - case 228: - return writeTypeAliasDeclaration(node); + return writeFunctionDeclaration(node); + case 207: + return writeVariableStatement(node); case 229: - return writeEnumDeclaration(node); + return writeInterfaceDeclaration(node); + case 228: + return writeClassDeclaration(node); case 230: + return writeTypeAliasDeclaration(node); + case 231: + return writeEnumDeclaration(node); + case 232: return writeModuleDeclaration(node); - case 234: + case 236: return writeImportEqualsDeclaration(node); - case 235: + case 237: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); } } function emitModuleElementDeclarationFlags(node) { - if (node.parent.kind === 261) { + if (node.parent.kind === 264) { var modifiers = ts.getModifierFlags(node); if (modifiers & 1) { write("export "); @@ -45983,7 +49817,7 @@ var ts; if (modifiers & 512) { write("default "); } - else if (node.kind !== 227 && !noDeclare) { + else if (node.kind !== 229 && !noDeclare) { write("declare "); } } @@ -46033,7 +49867,7 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 237) { + if (namedBindings.kind === 239) { return resolver.isDeclarationVisible(namedBindings); } else { @@ -46056,7 +49890,7 @@ var ts; if (currentWriterPos !== writer.getTextPos()) { write(", "); } - if (node.importClause.namedBindings.kind === 237) { + if (node.importClause.namedBindings.kind === 239) { write("* as "); writeTextOfNode(currentText, node.importClause.namedBindings.name); } @@ -46073,13 +49907,13 @@ var ts; writer.writeLine(); } function emitExternalModuleSpecifier(parent) { - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 230; + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 232; var moduleSpecifier; - if (parent.kind === 234) { + if (parent.kind === 236) { var node = parent; moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node); } - else if (parent.kind === 230) { + else if (parent.kind === 232) { moduleSpecifier = parent.name; } else { @@ -46147,7 +49981,7 @@ var ts; writeTextOfNode(currentText, node.name); } } - while (node.body && node.body.kind !== 231) { + while (node.body && node.body.kind !== 233) { node = node.body; write("."); writeTextOfNode(currentText, node.name); @@ -46217,7 +50051,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 149 && ts.hasModifier(node.parent, 8); + return node.parent.kind === 150 && ts.hasModifier(node.parent, 8); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -46227,52 +50061,69 @@ var ts; writeTextOfNode(currentText, node.name); if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 158 || - node.parent.kind === 159 || - (node.parent.parent && node.parent.parent.kind === 161)) { - ts.Debug.assert(node.parent.kind === 149 || - node.parent.kind === 148 || - node.parent.kind === 158 || + if (node.parent.kind === 159 || + node.parent.kind === 160 || + (node.parent.parent && node.parent.parent.kind === 162)) { + ts.Debug.assert(node.parent.kind === 150 || + node.parent.kind === 149 || node.parent.kind === 159 || - node.parent.kind === 153 || - node.parent.kind === 154); + node.parent.kind === 160 || + node.parent.kind === 154 || + node.parent.kind === 155); emitType(node.constraint); } else { emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.constraint, getTypeParameterConstraintVisibilityError); } } + if (node.default && !isPrivateMethodTypeParameter(node)) { + write(" = "); + if (node.parent.kind === 159 || + node.parent.kind === 160 || + (node.parent.parent && node.parent.parent.kind === 162)) { + ts.Debug.assert(node.parent.kind === 150 || + node.parent.kind === 149 || + node.parent.kind === 159 || + node.parent.kind === 160 || + node.parent.kind === 154 || + node.parent.kind === 155); + emitType(node.default); + } + else { + emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.default, getTypeParameterConstraintVisibilityError); + } + } function getTypeParameterConstraintVisibilityError() { var diagnosticMessage; switch (node.parent.kind) { - case 226: + case 228: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 227: + case 229: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 154: + case 155: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 153: + case 154: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; + case 150: case 149: - case 148: if (ts.hasModifier(node.parent, 32)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 226) { + else if (node.parent.parent.kind === 228) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 225: + case 227: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 228: + case 230: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -46291,7 +50142,7 @@ var ts; write(">"); } } - function emitHeritageClause(typeReferences, isImplementsList) { + function emitHeritageClause(className, typeReferences, isImplementsList) { if (typeReferences) { write(isImplementsList ? " implements " : " extends "); emitCommaList(typeReferences, emitTypeOfTypeReference); @@ -46305,17 +50156,19 @@ var ts; } else { writer.getSymbolAccessibilityDiagnostic = getHeritageClauseVisibilityError; + errorNameNode = className; resolver.writeBaseConstructorTypeOfClass(enclosingDeclaration, enclosingDeclaration, 2 | 1024, writer); + errorNameNode = undefined; } function getHeritageClauseVisibilityError() { var diagnosticMessage; - if (node.parent.parent.kind === 226) { + if (node.parent.parent.kind === 228) { diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : - ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; + ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1; } else { - diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; + diagnosticMessage = ts.Diagnostics.extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; } return { diagnosticMessage: diagnosticMessage, @@ -46347,9 +50200,10 @@ var ts; emitTypeParameters(node.typeParameters); var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { - emitHeritageClause([baseTypeNode], false); + node.name; + emitHeritageClause(node.name, [baseTypeNode], false); } - emitHeritageClause(ts.getClassImplementsHeritageClauseElements(node), true); + emitHeritageClause(node.name, ts.getClassImplementsHeritageClauseElements(node), true); write(" {"); writeLine(); increaseIndent(); @@ -46370,7 +50224,7 @@ var ts; emitTypeParameters(node.typeParameters); var interfaceExtendsTypes = ts.filter(ts.getInterfaceBaseTypeNodes(node), function (base) { return ts.isEntityNameExpression(base.expression); }); if (interfaceExtendsTypes && interfaceExtendsTypes.length) { - emitHeritageClause(interfaceExtendsTypes, false); + emitHeritageClause(node.name, interfaceExtendsTypes, false); } write(" {"); writeLine(); @@ -46392,17 +50246,17 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 223 || resolver.isDeclarationVisible(node)) { + if (node.kind !== 225 || resolver.isDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } else { writeTextOfNode(currentText, node.name); - if ((node.kind === 147 || node.kind === 146 || - (node.kind === 144 && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { + if ((node.kind === 148 || node.kind === 147 || + (node.kind === 145 && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { write("?"); } - if ((node.kind === 147 || node.kind === 146) && node.parent.kind === 161) { + if ((node.kind === 148 || node.kind === 147) && node.parent.kind === 162) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (resolver.isLiteralConstDeclaration(node)) { @@ -46415,14 +50269,14 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 223) { + if (node.kind === 225) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 147 || node.kind === 146) { + else if (node.kind === 148 || node.kind === 147) { if (ts.hasModifier(node, 32)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -46430,7 +50284,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 226) { + else if (node.parent.kind === 228) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -46456,7 +50310,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 198) { + if (element.kind !== 199) { elements.push(element); } } @@ -46522,7 +50376,7 @@ var ts; accessorWithTypeAnnotation = node; var type = getTypeAnnotationFromAccessor(node); if (!type) { - var anotherAccessor = node.kind === 151 ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 152 ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -46535,7 +50389,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 151 + return accessor.kind === 152 ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type @@ -46544,7 +50398,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 152) { + if (accessorWithTypeAnnotation.kind === 153) { if (ts.hasModifier(accessorWithTypeAnnotation.parent, 32)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : @@ -46590,17 +50444,17 @@ var ts; } if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 225) { + if (node.kind === 227) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 149 || node.kind === 150) { + else if (node.kind === 150 || node.kind === 151) { emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); } - if (node.kind === 225) { + if (node.kind === 227) { write("function "); writeTextOfNode(currentText, node.name); } - else if (node.kind === 150) { + else if (node.kind === 151) { write("constructor"); } else { @@ -46620,15 +50474,15 @@ var ts; var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; var closeParenthesizedFunctionType = false; - if (node.kind === 155) { + if (node.kind === 156) { emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); write("["); } else { - if (node.kind === 154 || node.kind === 159) { + if (node.kind === 155 || node.kind === 160) { write("new "); } - else if (node.kind === 158) { + else if (node.kind === 159) { var currentOutput = writer.getText(); if (node.typeParameters && currentOutput.charAt(currentOutput.length - 1) === "<") { closeParenthesizedFunctionType = true; @@ -46639,20 +50493,20 @@ var ts; write("("); } emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 155) { + if (node.kind === 156) { write("]"); } else { write(")"); } - var isFunctionTypeOrConstructorType = node.kind === 158 || node.kind === 159; - if (isFunctionTypeOrConstructorType || node.parent.kind === 161) { + var isFunctionTypeOrConstructorType = node.kind === 159 || node.kind === 160; + if (isFunctionTypeOrConstructorType || node.parent.kind === 162) { if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 150 && !ts.hasModifier(node, 8)) { + else if (node.kind !== 151 && !ts.hasModifier(node, 8)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -46666,23 +50520,23 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 154: + case 155: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 153: + case 154: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 155: + case 156: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; + case 150: case 149: - case 148: if (ts.hasModifier(node, 32)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -46690,7 +50544,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 226) { + else if (node.parent.kind === 228) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -46703,7 +50557,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 225: + case 227: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -46735,9 +50589,9 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 158 || - node.parent.kind === 159 || - node.parent.parent.kind === 161) { + if (node.parent.kind === 159 || + node.parent.kind === 160 || + node.parent.parent.kind === 162) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!ts.hasModifier(node.parent, 8)) { @@ -46753,22 +50607,26 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 150: + case 151: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 154: + case 155: return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 153: + case 154: return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; + case 156: + return symbolAccessibilityResult.errorModuleName ? + ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : + ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; + case 150: case 149: - case 148: if (ts.hasModifier(node.parent, 32)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -46776,7 +50634,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 226) { + else if (node.parent.parent.kind === 228) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -46788,7 +50646,7 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 225: + case 227: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -46799,12 +50657,12 @@ var ts; } } function emitBindingPattern(bindingPattern) { - if (bindingPattern.kind === 172) { + if (bindingPattern.kind === 173) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 173) { + else if (bindingPattern.kind === 174) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -46815,10 +50673,10 @@ var ts; } } function emitBindingElement(bindingElement) { - if (bindingElement.kind === 198) { + if (bindingElement.kind === 199) { write(" "); } - else if (bindingElement.kind === 174) { + else if (bindingElement.kind === 175) { if (bindingElement.propertyName) { writeTextOfNode(currentText, bindingElement.propertyName); write(": "); @@ -46840,39 +50698,39 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 225: - case 230: - case 234: case 227: - case 226: - case 228: + case 232: + case 236: case 229: + case 228: + case 230: + case 231: return emitModuleElement(node, isModuleElementVisible(node)); - case 205: + case 207: return emitModuleElement(node, isVariableStatementVisible(node)); - case 235: + case 237: return emitModuleElement(node, !node.importClause); - case 241: + case 243: return emitExportDeclaration(node); + case 151: case 150: case 149: - case 148: return writeFunctionDeclaration(node); - case 154: - case 153: case 155: + case 154: + case 156: return emitSignatureDeclarationWithJsDocComments(node); - case 151: case 152: + case 153: return emitAccessorDeclaration(node); + case 148: case 147: - case 146: return emitPropertyDeclaration(node); - case 260: + case 263: return emitEnumMemberDeclaration(node); - case 240: + case 242: return emitExportAssignment(node); - case 261: + case 264: return emitSourceFile(node); } } @@ -46883,14 +50741,15 @@ var ts; declFileName = referencedFile.fileName; } else { - ts.forEachExpectedEmitFile(host, getDeclFileName, referencedFile, emitOnlyDtsFiles); + ts.forEachEmittedFile(host, getDeclFileName, referencedFile, emitOnlyDtsFiles); } if (declFileName) { declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(declarationFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, false); referencesOutput += "/// " + newLine; } return addedBundledEmitReference; - function getDeclFileName(emitFileNames, _sourceFiles, isBundledEmit) { + function getDeclFileName(emitFileNames, sourceFileOrBundle) { + var isBundledEmit = sourceFileOrBundle.kind === 265; if (isBundledEmit && !addBundledFileReference) { return; } @@ -46900,10 +50759,11 @@ var ts; } } } - function writeDeclarationFile(declarationFilePath, sourceFiles, isBundledEmit, host, resolver, emitterDiagnostics, emitOnlyDtsFiles) { - var emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFiles, isBundledEmit, emitOnlyDtsFiles); + function writeDeclarationFile(declarationFilePath, sourceFileOrBundle, host, resolver, emitterDiagnostics, emitOnlyDtsFiles) { + var emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles); var emitSkipped = emitDeclarationResult.reportedDeclarationError || host.isEmitBlocked(declarationFilePath) || host.getCompilerOptions().noEmit; if (!emitSkipped) { + var sourceFiles = sourceFileOrBundle.kind === 265 ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; var declarationOutput = emitDeclarationResult.referencesOutput + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); ts.writeFile(host, emitterDiagnostics, declarationFilePath, declarationOutput, host.getCompilerOptions().emitBOM, sourceFiles); @@ -46927,63 +50787,55 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var id = function (s) { return s; }; - var nullTransformers = [function (_) { return id; }]; - function emitFiles(resolver, host, targetSourceFile, emitOnlyDtsFiles) { - var delimiters = createDelimiterMap(); - var brackets = createBracketsMap(); + var delimiters = createDelimiterMap(); + var brackets = createBracketsMap(); + function emitFiles(resolver, host, targetSourceFile, emitOnlyDtsFiles, transformers) { var compilerOptions = host.getCompilerOptions(); - var languageVersion = ts.getEmitScriptTarget(compilerOptions); var moduleKind = ts.getEmitModuleKind(compilerOptions); var sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? [] : undefined; var emittedFilesList = compilerOptions.listEmittedFiles ? [] : undefined; var emitterDiagnostics = ts.createDiagnosticCollection(); var newLine = host.getNewLine(); - var transformers = emitOnlyDtsFiles ? nullTransformers : ts.getTransformers(compilerOptions); var writer = ts.createTextWriter(newLine); - var write = writer.write, writeLine = writer.writeLine, increaseIndent = writer.increaseIndent, decreaseIndent = writer.decreaseIndent; var sourceMap = ts.createSourceMapWriter(host, writer); - var emitNodeWithSourceMap = sourceMap.emitNodeWithSourceMap, emitTokenWithSourceMap = sourceMap.emitTokenWithSourceMap; - var comments = ts.createCommentWriter(host, writer, sourceMap); - var emitNodeWithComments = comments.emitNodeWithComments, emitBodyWithDetachedComments = comments.emitBodyWithDetachedComments, emitTrailingCommentsOfPosition = comments.emitTrailingCommentsOfPosition; - var nodeIdToGeneratedName; - var autoGeneratedIdToGeneratedName; - var generatedNameSet; - var tempFlags; var currentSourceFile; - var currentText; - var currentFileIdentifiers; var bundledHelpers; var isOwnFileEmit; var emitSkipped = false; var sourceFiles = ts.getSourceFilesToEmit(host, targetSourceFile); - ts.performance.mark("beforeTransform"); - var _a = ts.transformFiles(resolver, host, sourceFiles, transformers), transformed = _a.transformed, emitNodeWithSubstitution = _a.emitNodeWithSubstitution, emitNodeWithNotification = _a.emitNodeWithNotification; - ts.performance.measure("transformTime", "beforeTransform"); + var transform = ts.transformNodes(resolver, host, compilerOptions, sourceFiles, transformers, false); + var printer = createPrinter(compilerOptions, { + hasGlobalName: resolver.hasGlobalName, + onEmitNode: transform.emitNodeWithNotification, + substituteNode: transform.substituteNode, + onEmitSourceMapOfNode: sourceMap.emitNodeWithSourceMap, + onEmitSourceMapOfToken: sourceMap.emitTokenWithSourceMap, + onEmitSourceMapOfPosition: sourceMap.emitPos, + onEmitHelpers: emitHelpers, + onSetSourceFile: setSourceFile, + }); ts.performance.mark("beforePrint"); - ts.forEachTransformedEmitFile(host, transformed, emitFile, emitOnlyDtsFiles); + ts.forEachEmittedFile(host, emitSourceFileOrBundle, transform.transformed, emitOnlyDtsFiles); ts.performance.measure("printTime", "beforePrint"); - for (var _b = 0, sourceFiles_4 = sourceFiles; _b < sourceFiles_4.length; _b++) { - var sourceFile = sourceFiles_4[_b]; - ts.disposeEmitNodes(sourceFile); - } + transform.dispose(); return { emitSkipped: emitSkipped, diagnostics: emitterDiagnostics.getDiagnostics(), emittedFiles: emittedFilesList, sourceMaps: sourceMapDataList }; - function emitFile(jsFilePath, sourceMapFilePath, declarationFilePath, sourceFiles, isBundledEmit) { + function emitSourceFileOrBundle(_a, sourceFileOrBundle) { + var jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath; if (!host.isEmitBlocked(jsFilePath) && !compilerOptions.noEmit) { if (!emitOnlyDtsFiles) { - printFile(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit); + printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle); } } else { emitSkipped = true; } if (declarationFilePath) { - emitSkipped = ts.writeDeclarationFile(declarationFilePath, ts.getOriginalSourceFiles(sourceFiles), isBundledEmit, host, resolver, emitterDiagnostics, emitOnlyDtsFiles) || emitSkipped; + emitSkipped = ts.writeDeclarationFile(declarationFilePath, ts.getOriginalSourceFileOrBundle(sourceFileOrBundle), host, resolver, emitterDiagnostics, emitOnlyDtsFiles) || emitSkipped; } if (!emitSkipped && emittedFilesList) { if (!emitOnlyDtsFiles) { @@ -46997,24 +50849,24 @@ var ts; } } } - function printFile(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit) { - sourceMap.initialize(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit); - nodeIdToGeneratedName = []; - autoGeneratedIdToGeneratedName = []; - generatedNameSet = ts.createMap(); - bundledHelpers = isBundledEmit ? ts.createMap() : undefined; - isOwnFileEmit = !isBundledEmit; - if (isBundledEmit && moduleKind) { - for (var _a = 0, sourceFiles_5 = sourceFiles; _a < sourceFiles_5.length; _a++) { - var sourceFile = sourceFiles_5[_a]; - emitHelpers(sourceFile, true); - } + function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle) { + var bundle = sourceFileOrBundle.kind === 265 ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 264 ? sourceFileOrBundle : undefined; + var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; + sourceMap.initialize(jsFilePath, sourceMapFilePath, sourceFileOrBundle); + if (bundle) { + bundledHelpers = ts.createMap(); + isOwnFileEmit = false; + printer.writeBundle(bundle, writer); } - ts.forEach(sourceFiles, printSourceFile); - writeLine(); + else { + isOwnFileEmit = true; + printer.writeFile(sourceFile, writer); + } + writer.writeLine(); var sourceMappingURL = sourceMap.getSourceMappingURL(); if (sourceMappingURL) { - write("//# " + "sourceMappingURL" + "=" + sourceMappingURL); + writer.write("//# " + "sourceMappingURL" + "=" + sourceMappingURL); } if (compilerOptions.sourceMap && !compilerOptions.inlineSourceMap) { ts.writeFile(host, emitterDiagnostics, sourceMapFilePath, sourceMap.getText(), false, sourceFiles); @@ -47024,20 +50876,164 @@ var ts; } ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), compilerOptions.emitBOM, sourceFiles); sourceMap.reset(); - comments.reset(); writer.reset(); - tempFlags = 0; currentSourceFile = undefined; - currentText = undefined; + bundledHelpers = undefined; isOwnFileEmit = false; } - function printSourceFile(node) { + function setSourceFile(node) { currentSourceFile = node; - currentText = node.text; - currentFileIdentifiers = node.identifiers; sourceMap.setSourceFile(node); - comments.setSourceFile(node); - pipelineEmitWithNotification(0, node); + } + function emitHelpers(node, writeLines) { + var helpersEmitted = false; + var bundle = node.kind === 265 ? node : undefined; + if (bundle && moduleKind === ts.ModuleKind.None) { + return; + } + var numNodes = bundle ? bundle.sourceFiles.length : 1; + for (var i = 0; i < numNodes; i++) { + var currentNode = bundle ? bundle.sourceFiles[i] : node; + var sourceFile = ts.isSourceFile(currentNode) ? currentNode : currentSourceFile; + var shouldSkip = compilerOptions.noEmitHelpers || (sourceFile && ts.getExternalHelpersModuleName(sourceFile) !== undefined); + var shouldBundle = ts.isSourceFile(currentNode) && !isOwnFileEmit; + var helpers = ts.getEmitHelpers(currentNode); + if (helpers) { + for (var _a = 0, _b = ts.stableSort(helpers, ts.compareEmitHelpers); _a < _b.length; _a++) { + var helper = _b[_a]; + if (!helper.scoped) { + if (shouldSkip) + continue; + if (shouldBundle) { + if (bundledHelpers.get(helper.name)) { + continue; + } + bundledHelpers.set(helper.name, true); + } + } + else if (bundle) { + continue; + } + writeLines(helper.text); + helpersEmitted = true; + } + } + } + return helpersEmitted; + } + } + ts.emitFiles = emitFiles; + function createPrinter(printerOptions, handlers) { + if (printerOptions === void 0) { printerOptions = {}; } + if (handlers === void 0) { handlers = {}; } + var hasGlobalName = handlers.hasGlobalName, onEmitSourceMapOfNode = handlers.onEmitSourceMapOfNode, onEmitSourceMapOfToken = handlers.onEmitSourceMapOfToken, onEmitSourceMapOfPosition = handlers.onEmitSourceMapOfPosition, onEmitNode = handlers.onEmitNode, onEmitHelpers = handlers.onEmitHelpers, onSetSourceFile = handlers.onSetSourceFile, substituteNode = handlers.substituteNode, onBeforeEmitNodeArray = handlers.onBeforeEmitNodeArray, onAfterEmitNodeArray = handlers.onAfterEmitNodeArray; + var newLine = ts.getNewLineCharacter(printerOptions); + var comments = ts.createCommentWriter(printerOptions, onEmitSourceMapOfPosition); + var emitNodeWithComments = comments.emitNodeWithComments, emitBodyWithDetachedComments = comments.emitBodyWithDetachedComments, emitTrailingCommentsOfPosition = comments.emitTrailingCommentsOfPosition, emitLeadingCommentsOfPosition = comments.emitLeadingCommentsOfPosition; + var currentSourceFile; + var nodeIdToGeneratedName; + var autoGeneratedIdToGeneratedName; + var generatedNames; + var tempFlagsStack; + var tempFlags; + var writer; + var ownWriter; + reset(); + return { + printNode: printNode, + printFile: printFile, + printBundle: printBundle, + writeNode: writeNode, + writeFile: writeFile, + writeBundle: writeBundle + }; + function printNode(hint, node, sourceFile) { + switch (hint) { + case 0: + ts.Debug.assert(ts.isSourceFile(node), "Expected a SourceFile node."); + break; + case 2: + ts.Debug.assert(ts.isIdentifier(node), "Expected an Identifier node."); + break; + case 1: + ts.Debug.assert(ts.isExpression(node), "Expected an Expression node."); + break; + } + switch (node.kind) { + case 264: return printFile(node); + case 265: return printBundle(node); + } + writeNode(hint, node, sourceFile, beginPrint()); + return endPrint(); + } + function printBundle(bundle) { + writeBundle(bundle, beginPrint()); + return endPrint(); + } + function printFile(sourceFile) { + writeFile(sourceFile, beginPrint()); + return endPrint(); + } + function writeNode(hint, node, sourceFile, output) { + var previousWriter = writer; + setWriter(output); + print(hint, node, sourceFile); + reset(); + writer = previousWriter; + } + function writeBundle(bundle, output) { + var previousWriter = writer; + setWriter(output); + emitShebangIfNeeded(bundle); + emitPrologueDirectivesIfNeeded(bundle); + emitHelpersIndirect(bundle); + for (var _a = 0, _b = bundle.sourceFiles; _a < _b.length; _a++) { + var sourceFile = _b[_a]; + print(0, sourceFile, sourceFile); + } + reset(); + writer = previousWriter; + } + function writeFile(sourceFile, output) { + var previousWriter = writer; + setWriter(output); + emitShebangIfNeeded(sourceFile); + emitPrologueDirectivesIfNeeded(sourceFile); + print(0, sourceFile, sourceFile); + reset(); + writer = previousWriter; + } + function beginPrint() { + return ownWriter || (ownWriter = ts.createTextWriter(newLine)); + } + function endPrint() { + var text = ownWriter.getText(); + ownWriter.reset(); + return text; + } + function print(hint, node, sourceFile) { + setSourceFile(sourceFile); + pipelineEmitWithNotification(hint, node); + } + function setSourceFile(sourceFile) { + currentSourceFile = sourceFile; + comments.setSourceFile(sourceFile); + if (onSetSourceFile) { + onSetSourceFile(sourceFile); + } + } + function setWriter(output) { + writer = output; + comments.setWriter(output); + } + function reset() { + nodeIdToGeneratedName = []; + autoGeneratedIdToGeneratedName = []; + generatedNames = ts.createMap(); + tempFlagsStack = []; + tempFlags = 0; + comments.reset(); + setWriter(undefined); } function emit(node) { pipelineEmitWithNotification(3, node); @@ -47048,51 +51044,53 @@ var ts; function emitExpression(node) { pipelineEmitWithNotification(1, node); } - function pipelineEmitWithNotification(emitContext, node) { - emitNodeWithNotification(emitContext, node, pipelineEmitWithComments); + function pipelineEmitWithNotification(hint, node) { + if (onEmitNode) { + onEmitNode(hint, node, pipelineEmitWithComments); + } + else { + pipelineEmitWithComments(hint, node); + } } - function pipelineEmitWithComments(emitContext, node) { - if (emitContext === 0) { - pipelineEmitWithSourceMap(emitContext, node); + function pipelineEmitWithComments(hint, node) { + node = trySubstituteNode(hint, node); + if (emitNodeWithComments && hint !== 0) { + emitNodeWithComments(hint, node, pipelineEmitWithSourceMap); + } + else { + pipelineEmitWithSourceMap(hint, node); + } + } + function pipelineEmitWithSourceMap(hint, node) { + if (onEmitSourceMapOfNode && hint !== 0 && hint !== 2) { + onEmitSourceMapOfNode(hint, node, pipelineEmitWithHint); + } + else { + pipelineEmitWithHint(hint, node); + } + } + function pipelineEmitWithHint(hint, node) { + switch (hint) { + case 0: return pipelineEmitSourceFile(node); + case 2: return pipelineEmitIdentifierName(node); + case 1: return pipelineEmitExpression(node); + case 3: return pipelineEmitUnspecified(node); + } + } + function pipelineEmitSourceFile(node) { + ts.Debug.assertNode(node, ts.isSourceFile); + emitSourceFile(node); + } + function pipelineEmitIdentifierName(node) { + ts.Debug.assertNode(node, ts.isIdentifier); + emitIdentifier(node); + } + function pipelineEmitUnspecified(node) { + var kind = node.kind; + if (ts.isKeyword(kind)) { + writeTokenText(kind); return; } - emitNodeWithComments(emitContext, node, pipelineEmitWithSourceMap); - } - function pipelineEmitWithSourceMap(emitContext, node) { - if (emitContext === 0 - || emitContext === 2) { - pipelineEmitWithSubstitution(emitContext, node); - return; - } - emitNodeWithSourceMap(emitContext, node, pipelineEmitWithSubstitution); - } - function pipelineEmitWithSubstitution(emitContext, node) { - emitNodeWithSubstitution(emitContext, node, pipelineEmitForContext); - } - function pipelineEmitForContext(emitContext, node) { - switch (emitContext) { - case 0: return pipelineEmitInSourceFileContext(node); - case 2: return pipelineEmitInIdentifierNameContext(node); - case 3: return pipelineEmitInUnspecifiedContext(node); - case 1: return pipelineEmitInExpressionContext(node); - } - } - function pipelineEmitInSourceFileContext(node) { - var kind = node.kind; - switch (kind) { - case 261: - return emitSourceFile(node); - } - } - function pipelineEmitInIdentifierNameContext(node) { - var kind = node.kind; - switch (kind) { - case 70: - return emitIdentifier(node); - } - } - function pipelineEmitInUnspecifiedContext(node) { - var kind = node.kind; switch (kind) { case 13: case 14: @@ -47100,229 +51098,201 @@ var ts; return emitLiteral(node); case 70: return emitIdentifier(node); - case 75: - case 78: - case 83: - case 104: - case 111: - case 112: - case 113: - case 114: - case 116: - case 117: - case 118: - case 119: - case 120: - case 121: - case 122: - case 123: - case 124: - case 125: - case 127: - case 128: - case 129: - case 130: - case 131: - case 132: - case 133: - case 134: - case 135: - case 136: - case 137: - case 138: - case 139: - case 140: - writeTokenText(kind); - return; - case 141: - return emitQualifiedName(node); case 142: - return emitComputedPropertyName(node); + return emitQualifiedName(node); case 143: - return emitTypeParameter(node); + return emitComputedPropertyName(node); case 144: - return emitParameter(node); + return emitTypeParameter(node); case 145: - return emitDecorator(node); + return emitParameter(node); case 146: - return emitPropertySignature(node); + return emitDecorator(node); case 147: - return emitPropertyDeclaration(node); + return emitPropertySignature(node); case 148: - return emitMethodSignature(node); + return emitPropertyDeclaration(node); case 149: - return emitMethodDeclaration(node); + return emitMethodSignature(node); case 150: - return emitConstructor(node); + return emitMethodDeclaration(node); case 151: + return emitConstructor(node); case 152: - return emitAccessorDeclaration(node); case 153: - return emitCallSignature(node); + return emitAccessorDeclaration(node); case 154: - return emitConstructSignature(node); + return emitCallSignature(node); case 155: - return emitIndexSignature(node); + return emitConstructSignature(node); case 156: - return emitTypePredicate(node); + return emitIndexSignature(node); case 157: - return emitTypeReference(node); + return emitTypePredicate(node); case 158: - return emitFunctionType(node); + return emitTypeReference(node); case 159: - return emitConstructorType(node); + return emitFunctionType(node); case 160: - return emitTypeQuery(node); + return emitConstructorType(node); case 161: - return emitTypeLiteral(node); + return emitTypeQuery(node); case 162: - return emitArrayType(node); + return emitTypeLiteral(node); case 163: - return emitTupleType(node); + return emitArrayType(node); case 164: - return emitUnionType(node); + return emitTupleType(node); case 165: - return emitIntersectionType(node); + return emitUnionType(node); case 166: - return emitParenthesizedType(node); - case 199: - return emitExpressionWithTypeArguments(node); + return emitIntersectionType(node); case 167: - return emitThisType(); + return emitParenthesizedType(node); + case 200: + return emitExpressionWithTypeArguments(node); case 168: - return emitTypeOperator(node); + return emitThisType(); case 169: - return emitIndexedAccessType(node); + return emitTypeOperator(node); case 170: - return emitMappedType(node); + return emitIndexedAccessType(node); case 171: - return emitLiteralType(node); + return emitMappedType(node); case 172: - return emitObjectBindingPattern(node); + return emitLiteralType(node); case 173: - return emitArrayBindingPattern(node); + return emitObjectBindingPattern(node); case 174: + return emitArrayBindingPattern(node); + case 175: return emitBindingElement(node); - case 202: - return emitTemplateSpan(node); - case 203: - return emitSemicolonClassElement(); case 204: - return emitBlock(node); + return emitTemplateSpan(node); case 205: - return emitVariableStatement(node); + return emitSemicolonClassElement(); case 206: - return emitEmptyStatement(); + return emitBlock(node); case 207: - return emitExpressionStatement(node); + return emitVariableStatement(node); case 208: - return emitIfStatement(node); + return emitEmptyStatement(); case 209: - return emitDoStatement(node); + return emitExpressionStatement(node); case 210: - return emitWhileStatement(node); + return emitIfStatement(node); case 211: - return emitForStatement(node); + return emitDoStatement(node); case 212: - return emitForInStatement(node); + return emitWhileStatement(node); case 213: - return emitForOfStatement(node); + return emitForStatement(node); case 214: - return emitContinueStatement(node); + return emitForInStatement(node); case 215: - return emitBreakStatement(node); + return emitForOfStatement(node); case 216: - return emitReturnStatement(node); + return emitContinueStatement(node); case 217: - return emitWithStatement(node); + return emitBreakStatement(node); case 218: - return emitSwitchStatement(node); + return emitReturnStatement(node); case 219: - return emitLabeledStatement(node); + return emitWithStatement(node); case 220: - return emitThrowStatement(node); + return emitSwitchStatement(node); case 221: - return emitTryStatement(node); + return emitLabeledStatement(node); case 222: - return emitDebuggerStatement(node); + return emitThrowStatement(node); case 223: - return emitVariableDeclaration(node); + return emitTryStatement(node); case 224: - return emitVariableDeclarationList(node); + return emitDebuggerStatement(node); case 225: - return emitFunctionDeclaration(node); + return emitVariableDeclaration(node); case 226: - return emitClassDeclaration(node); + return emitVariableDeclarationList(node); case 227: - return emitInterfaceDeclaration(node); + return emitFunctionDeclaration(node); case 228: - return emitTypeAliasDeclaration(node); + return emitClassDeclaration(node); case 229: - return emitEnumDeclaration(node); + return emitInterfaceDeclaration(node); case 230: - return emitModuleDeclaration(node); + return emitTypeAliasDeclaration(node); case 231: - return emitModuleBlock(node); + return emitEnumDeclaration(node); case 232: - return emitCaseBlock(node); + return emitModuleDeclaration(node); + case 233: + return emitModuleBlock(node); case 234: - return emitImportEqualsDeclaration(node); - case 235: - return emitImportDeclaration(node); + return emitCaseBlock(node); case 236: - return emitImportClause(node); + return emitImportEqualsDeclaration(node); case 237: - return emitNamespaceImport(node); + return emitImportDeclaration(node); case 238: - return emitNamedImports(node); + return emitImportClause(node); case 239: - return emitImportSpecifier(node); + return emitNamespaceImport(node); case 240: - return emitExportAssignment(node); + return emitNamedImports(node); case 241: - return emitExportDeclaration(node); + return emitImportSpecifier(node); case 242: - return emitNamedExports(node); + return emitExportAssignment(node); case 243: - return emitExportSpecifier(node); + return emitExportDeclaration(node); case 244: - return; + return emitNamedExports(node); case 245: + return emitExportSpecifier(node); + case 246: + return; + case 247: return emitExternalModuleReference(node); case 10: return emitJsxText(node); - case 248: - return emitJsxOpeningElement(node); - case 249: - return emitJsxClosingElement(node); case 250: - return emitJsxAttribute(node); + return emitJsxOpeningElement(node); case 251: - return emitJsxSpreadAttribute(node); + return emitJsxClosingElement(node); case 252: - return emitJsxExpression(node); + return emitJsxAttribute(node); case 253: - return emitCaseClause(node); + return emitJsxAttributes(node); case 254: - return emitDefaultClause(node); + return emitJsxSpreadAttribute(node); case 255: - return emitHeritageClause(node); + return emitJsxExpression(node); case 256: - return emitCatchClause(node); + return emitCaseClause(node); case 257: - return emitPropertyAssignment(node); + return emitDefaultClause(node); case 258: - return emitShorthandPropertyAssignment(node); + return emitHeritageClause(node); case 259: - return emitSpreadAssignment(node); + return emitCatchClause(node); case 260: + return emitPropertyAssignment(node); + case 261: + return emitShorthandPropertyAssignment(node); + case 262: + return emitSpreadAssignment(node); + case 263: return emitEnumMember(node); } if (ts.isExpression(node)) { - return pipelineEmitWithSubstitution(1, node); + return pipelineEmitExpression(trySubstituteNode(1, node)); + } + if (ts.isToken(node)) { + writeTokenText(kind); + return; } } - function pipelineEmitInExpressionContext(node) { + function pipelineEmitExpression(node) { var kind = node.kind; switch (kind) { case 8: @@ -47340,77 +51310,82 @@ var ts; case 98: writeTokenText(kind); return; - case 175: - return emitArrayLiteralExpression(node); case 176: - return emitObjectLiteralExpression(node); + return emitArrayLiteralExpression(node); case 177: - return emitPropertyAccessExpression(node); + return emitObjectLiteralExpression(node); case 178: - return emitElementAccessExpression(node); + return emitPropertyAccessExpression(node); case 179: - return emitCallExpression(node); + return emitElementAccessExpression(node); case 180: - return emitNewExpression(node); + return emitCallExpression(node); case 181: - return emitTaggedTemplateExpression(node); + return emitNewExpression(node); case 182: - return emitTypeAssertionExpression(node); + return emitTaggedTemplateExpression(node); case 183: - return emitParenthesizedExpression(node); + return emitTypeAssertionExpression(node); case 184: - return emitFunctionExpression(node); + return emitParenthesizedExpression(node); case 185: - return emitArrowFunction(node); + return emitFunctionExpression(node); case 186: - return emitDeleteExpression(node); + return emitArrowFunction(node); case 187: - return emitTypeOfExpression(node); + return emitDeleteExpression(node); case 188: - return emitVoidExpression(node); + return emitTypeOfExpression(node); case 189: - return emitAwaitExpression(node); + return emitVoidExpression(node); case 190: - return emitPrefixUnaryExpression(node); + return emitAwaitExpression(node); case 191: - return emitPostfixUnaryExpression(node); + return emitPrefixUnaryExpression(node); case 192: - return emitBinaryExpression(node); + return emitPostfixUnaryExpression(node); case 193: - return emitConditionalExpression(node); + return emitBinaryExpression(node); case 194: - return emitTemplateExpression(node); + return emitConditionalExpression(node); case 195: - return emitYieldExpression(node); + return emitTemplateExpression(node); case 196: - return emitSpreadExpression(node); + return emitYieldExpression(node); case 197: - return emitClassExpression(node); + return emitSpreadExpression(node); case 198: + return emitClassExpression(node); + case 199: return; - case 200: - return emitAsExpression(node); case 201: + return emitAsExpression(node); + case 202: return emitNonNullExpression(node); - case 246: + case 203: + return emitMetaProperty(node); + case 248: return emitJsxElement(node); - case 247: + case 249: return emitJsxSelfClosingElement(node); - case 294: + case 295: return emitPartiallyEmittedExpression(node); - case 297: - return writeLines(node.text); + } + } + function trySubstituteNode(hint, node) { + return node && substituteNode && substituteNode(hint, node) || node; + } + function emitHelpersIndirect(node) { + if (onEmitHelpers) { + onEmitHelpers(node, writeLines); } } function emitNumericLiteral(node) { emitLiteral(node); - if (node.trailingComment) { - write(" /*" + node.trailingComment + "*/"); - } } function emitLiteral(node) { var text = getLiteralTextOfNode(node); - if ((compilerOptions.sourceMap || compilerOptions.inlineSourceMap) + if ((printerOptions.sourceMap || printerOptions.inlineSourceMap) && (node.kind === 9 || ts.isTemplateLiteralKind(node.kind))) { writer.writeLiteral(text); } @@ -47449,8 +51424,8 @@ var ts; writeIfPresent(node.dotDotDotToken, "..."); emit(node.name); writeIfPresent(node.questionToken, "?"); - emitExpressionWithPrefix(" = ", node.initializer); emitWithPrefix(": ", node.type); + emitExpressionWithPrefix(" = ", node.initializer); } function emitDecorator(decorator) { write("@"); @@ -47497,7 +51472,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write(node.kind === 151 ? "get " : "set "); + write(node.kind === 152 ? "get " : "set "); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); } @@ -47597,17 +51572,13 @@ var ts; write("{"); writeLine(); increaseIndent(); - if (node.readonlyToken) { - write("readonly "); - } + writeIfPresent(node.readonlyToken, "readonly "); write("["); emit(node.typeParameter.name); write(" in "); emit(node.typeParameter.constraint); write("]"); - if (node.questionToken) { - write("?"); - } + writeIfPresent(node.questionToken, "?"); write(": "); emit(node.type); write(";"); @@ -47667,7 +51638,7 @@ var ts; increaseIndent(); } var preferNewLine = node.multiLine ? 32768 : 0; - var allowTrailingComma = languageVersion >= 1 ? 32 : 0; + var allowTrailingComma = currentSourceFile.languageVersion >= 1 ? 32 : 0; emitList(node, properties, 978 | allowTrailingComma | preferNewLine); if (indentedFlag) { decreaseIndent(); @@ -47679,7 +51650,7 @@ var ts; var indentAfterDot = false; if (!(ts.getEmitFlags(node) & 65536)) { var dotRangeStart = node.expression.end; - var dotRangeEnd = ts.skipTrivia(currentText, node.expression.end) + 1; + var dotRangeEnd = ts.skipTrivia(currentSourceFile.text, node.expression.end) + 1; var dotToken = { kind: 22, pos: dotRangeStart, end: dotRangeEnd }; indentBeforeDot = needsIndentation(node, node.expression, dotToken); indentAfterDot = needsIndentation(node, dotToken, node.name); @@ -47693,15 +51664,17 @@ var ts; decreaseIndentIf(indentBeforeDot, indentAfterDot); } function needsDotDotForPropertyAccess(expression) { - if (expression.kind === 8) { + expression = ts.skipPartiallyEmittedExpressions(expression); + if (ts.isNumericLiteral(expression)) { var text = getLiteralTextOfNode(expression); - return text.indexOf(ts.tokenToString(22)) < 0; + return !expression.numericLiteralFlags + && text.indexOf(ts.tokenToString(22)) < 0; } else if (ts.isPropertyAccessExpression(expression) || ts.isElementAccessExpression(expression)) { var constantValue = ts.getConstantValue(expression); return isFinite(constantValue) && Math.floor(constantValue) === constantValue - && compilerOptions.removeComments; + && printerOptions.removeComments; } } function emitElementAccessExpression(node) { @@ -47727,11 +51700,9 @@ var ts; emitExpression(node.template); } function emitTypeAssertionExpression(node) { - if (node.type) { - write("<"); - emit(node.type); - write(">"); - } + write("<"); + emit(node.type); + write(">"); emitExpression(node.expression); } function emitParenthesizedExpression(node) { @@ -47778,7 +51749,7 @@ var ts; } function shouldEmitWhitespaceBeforeOperand(node) { var operand = node.operand; - return operand.kind === 190 + return operand.kind === 191 && ((node.operator === 36 && (operand.operator === 36 || operand.operator === 42)) || (node.operator === 37 && (operand.operator === 37 || operand.operator === 43))); } @@ -47844,6 +51815,11 @@ var ts; emitExpression(node.expression); write("!"); } + function emitMetaProperty(node) { + writeToken(node.keywordToken, node.pos); + write("."); + emit(node.name); + } function emitTemplateSpan(node) { emitExpression(node.expression); emit(node.literal); @@ -47857,6 +51833,9 @@ var ts; else { writeToken(16, node.pos, node); emitBlockStatements(node); + increaseIndent(); + emitLeadingCommentsOfPosition(node.statements.end); + decreaseIndent(); writeToken(17, node.statements.end, node); } } @@ -47886,27 +51865,27 @@ var ts; writeToken(18, openParenPos, node); emitExpression(node.expression); writeToken(19, node.expression.end, node); - emitEmbeddedStatement(node.thenStatement); + emitEmbeddedStatement(node, node.thenStatement); if (node.elseStatement) { - writeLine(); + writeLineOrSpace(node); writeToken(81, node.thenStatement.end, node); - if (node.elseStatement.kind === 208) { + if (node.elseStatement.kind === 210) { write(" "); emit(node.elseStatement); } else { - emitEmbeddedStatement(node.elseStatement); + emitEmbeddedStatement(node, node.elseStatement); } } } function emitDoStatement(node) { write("do"); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); if (ts.isBlock(node.statement)) { write(" "); } else { - writeLine(); + writeLineOrSpace(node); } write("while ("); emitExpression(node.expression); @@ -47916,7 +51895,7 @@ var ts; write("while ("); emitExpression(node.expression); write(")"); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitForStatement(node) { var openParenPos = writeToken(87, node.pos); @@ -47928,7 +51907,7 @@ var ts; write(";"); emitExpressionWithPrefix(" ", node.incrementor); write(")"); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitForInStatement(node) { var openParenPos = writeToken(87, node.pos); @@ -47938,21 +51917,22 @@ var ts; write(" in "); emitExpression(node.expression); writeToken(19, node.expression.end); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitForOfStatement(node) { var openParenPos = writeToken(87, node.pos); write(" "); + emitWithSuffix(node.awaitModifier, " "); writeToken(18, openParenPos); emitForBinding(node.initializer); write(" of "); emitExpression(node.expression); writeToken(19, node.expression.end); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 224) { + if (node.kind === 226) { emit(node); } else { @@ -47979,7 +51959,7 @@ var ts; write("with ("); emitExpression(node.expression); write(")"); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitSwitchStatement(node) { var openParenPos = writeToken(97, node.pos); @@ -48003,9 +51983,12 @@ var ts; function emitTryStatement(node) { write("try "); emit(node.tryBlock); - emit(node.catchClause); + if (node.catchClause) { + writeLineOrSpace(node); + emit(node.catchClause); + } if (node.finallyBlock) { - writeLine(); + writeLineOrSpace(node); write("finally "); emit(node.finallyBlock); } @@ -48033,6 +52016,9 @@ var ts; emitIdentifierName(node.name); emitSignatureAndBody(node, emitSignatureHead); } + function emitBlockCallback(_hint, body) { + emitBlockFunctionBody(body); + } function emitSignatureAndBody(node, emitSignatureHead) { var body = node.body; if (body) { @@ -48043,14 +52029,23 @@ var ts; } if (ts.getEmitFlags(node) & 262144) { emitSignatureHead(node); - emitBlockFunctionBody(body); + if (onEmitNode) { + onEmitNode(3, body, emitBlockCallback); + } + else { + emitBlockFunctionBody(body); + } } else { - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); emitSignatureHead(node); - emitBlockFunctionBody(body); - tempFlags = savedTempFlags; + if (onEmitNode) { + onEmitNode(3, body, emitBlockCallback); + } + else { + emitBlockFunctionBody(body); + } + popNameGenerationScope(); } if (indentedFlag) { decreaseIndent(); @@ -48099,9 +52094,15 @@ var ts; function emitBlockFunctionBody(body) { write(" {"); increaseIndent(); - emitBodyWithDetachedComments(body, body.statements, shouldEmitBlockFunctionBodyOnSingleLine(body) + var emitBlockFunctionBody = shouldEmitBlockFunctionBodyOnSingleLine(body) ? emitBlockFunctionBodyOnSingleLine - : emitBlockFunctionBodyWorker); + : emitBlockFunctionBodyWorker; + if (emitBodyWithDetachedComments) { + emitBodyWithDetachedComments(body, body.statements, emitBlockFunctionBody); + } + else { + emitBlockFunctionBody(body); + } decreaseIndent(); writeToken(17, body.statements.end, body); } @@ -48110,8 +52111,9 @@ var ts; } function emitBlockFunctionBodyWorker(body, emitBlockFunctionBodyOnSingleLine) { var statementOffset = emitPrologueDirectives(body.statements, true); - var helpersEmitted = emitHelpers(body); - if (statementOffset === 0 && !helpersEmitted && emitBlockFunctionBodyOnSingleLine) { + var pos = writer.getTextPos(); + emitHelpersIndirect(body); + if (statementOffset === 0 && pos === writer.getTextPos() && emitBlockFunctionBodyOnSingleLine) { decreaseIndent(); emitList(body, body.statements, 384); increaseIndent(); @@ -48134,15 +52136,14 @@ var ts; } emitTypeParameters(node, node.typeParameters); emitList(node, node.heritageClauses, 256); - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); write(" {"); emitList(node, node.members, 65); write("}"); + popNameGenerationScope(); if (indentedFlag) { decreaseIndent(); } - tempFlags = savedTempFlags; } function emitInterfaceDeclaration(node) { emitDecorators(node, node.decorators); @@ -48169,19 +52170,18 @@ var ts; emitModifiers(node, node.modifiers); write("enum "); emit(node.name); - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); write(" {"); emitList(node, node.members, 81); write("}"); - tempFlags = savedTempFlags; + popNameGenerationScope(); } function emitModuleDeclaration(node) { emitModifiers(node, node.modifiers); write(node.flags & 16 ? "namespace " : "module "); emit(node.name); var body = node.body; - while (body.kind === 230) { + while (body.kind === 232) { write("."); emit(body.name); body = body.body; @@ -48194,13 +52194,11 @@ var ts; write("{ }"); } else { - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); write("{"); - increaseIndent(); emitBlockStatements(node); write("}"); - tempFlags = savedTempFlags; + popNameGenerationScope(); } } function emitCaseBlock(node) { @@ -48302,14 +52300,18 @@ var ts; write("<"); emitJsxTagName(node.tagName); write(" "); - emitList(node, node.attributes, 131328); + if (node.attributes.properties && node.attributes.properties.length > 0) { + emit(node.attributes); + } write("/>"); } function emitJsxOpeningElement(node) { write("<"); emitJsxTagName(node.tagName); - writeIfAny(node.attributes, " "); - emitList(node, node.attributes, 131328); + writeIfAny(node.attributes.properties, " "); + if (node.attributes.properties && node.attributes.properties.length > 0) { + emit(node.attributes); + } write(">"); } function emitJsxText(node) { @@ -48320,6 +52322,9 @@ var ts; emitJsxTagName(node.tagName); write(">"); } + function emitJsxAttributes(node) { + emitList(node, node.properties, 131328); + } function emitJsxAttribute(node) { emit(node.name); emitWithPrefix("=", node.initializer); @@ -48332,6 +52337,9 @@ var ts; function emitJsxExpression(node) { if (node.expression) { write("{"); + if (node.dotDotDotToken) { + write("..."); + } emitExpression(node.expression); write("}"); } @@ -48374,7 +52382,6 @@ var ts; emitList(node, node.types, 272); } function emitCatchClause(node) { - writeLine(); var openParenPos = writeToken(73, node.pos); write(" "); writeToken(18, openParenPos); @@ -48387,7 +52394,7 @@ var ts; emit(node.name); write(": "); var initializer = node.initializer; - if ((ts.getEmitFlags(initializer) & 512) === 0) { + if (emitTrailingCommentsOfPosition && (ts.getEmitFlags(initializer) & 512) === 0) { var commentRange = ts.getCommentRange(initializer); emitTrailingCommentsOfPosition(commentRange.pos); } @@ -48412,28 +52419,43 @@ var ts; } function emitSourceFile(node) { writeLine(); - emitShebang(); - emitBodyWithDetachedComments(node, node.statements, emitSourceFileWorker); + var statements = node.statements; + if (emitBodyWithDetachedComments) { + var shouldEmitDetachedComment = statements.length === 0 || + !ts.isPrologueDirective(statements[0]) || + ts.nodeIsSynthesized(statements[0]); + if (shouldEmitDetachedComment) { + emitBodyWithDetachedComments(node, statements, emitSourceFileWorker); + return; + } + } + emitSourceFileWorker(node); } function emitSourceFileWorker(node) { var statements = node.statements; - var statementOffset = emitPrologueDirectives(statements); - var savedTempFlags = tempFlags; - tempFlags = 0; - emitHelpers(node); - emitList(node, statements, 1, statementOffset); - tempFlags = savedTempFlags; + pushNameGenerationScope(); + emitHelpersIndirect(node); + var index = ts.findIndex(statements, function (statement) { return !ts.isPrologueDirective(statement); }); + emitList(node, statements, 1, index === -1 ? statements.length : index); + popNameGenerationScope(); } function emitPartiallyEmittedExpression(node) { emitExpression(node.expression); } - function emitPrologueDirectives(statements, startWithNewLine) { + function emitPrologueDirectives(statements, startWithNewLine, seenPrologueDirectives) { for (var i = 0; i < statements.length; i++) { - if (ts.isPrologueDirective(statements[i])) { - if (startWithNewLine || i > 0) { - writeLine(); + var statement = statements[i]; + if (ts.isPrologueDirective(statement)) { + var shouldEmitPrologueDirective = seenPrologueDirectives ? !seenPrologueDirectives.has(statement.expression.text) : true; + if (shouldEmitPrologueDirective) { + if (startWithNewLine || i > 0) { + writeLine(); + } + emit(statement); + if (seenPrologueDirectives) { + seenPrologueDirectives.set(statement.expression.text, statement.expression.text); + } } - emit(statements[i]); } else { return i; @@ -48441,70 +52463,36 @@ var ts; } return statements.length; } - function emitHelpers(node, isBundle) { - var sourceFile = ts.isSourceFile(node) ? node : currentSourceFile; - var shouldSkip = compilerOptions.noEmitHelpers || (sourceFile && ts.getExternalHelpersModuleName(sourceFile) !== undefined); - var shouldBundle = ts.isSourceFile(node) && !isOwnFileEmit; - var helpersEmitted = false; - var helpers = ts.getEmitHelpers(node); - if (helpers) { - for (var _a = 0, _b = ts.stableSort(helpers, ts.compareEmitHelpers); _a < _b.length; _a++) { - var helper = _b[_a]; - if (!helper.scoped) { - if (shouldSkip) - continue; - if (shouldBundle) { - if (bundledHelpers[helper.name]) { - continue; - } - bundledHelpers[helper.name] = true; - } - } - else if (isBundle) { - continue; - } - writeLines(helper.text); - helpersEmitted = true; - } + function emitPrologueDirectivesIfNeeded(sourceFileOrBundle) { + if (ts.isSourceFile(sourceFileOrBundle)) { + setSourceFile(sourceFileOrBundle); + emitPrologueDirectives(sourceFileOrBundle.statements); } - if (helpersEmitted) { - writeLine(); - } - return helpersEmitted; - } - function writeLines(text) { - var lines = text.split(/\r\n?|\n/g); - var indentation = guessIndentation(lines); - for (var i = 0; i < lines.length; i++) { - var line = indentation ? lines[i].slice(indentation) : lines[i]; - if (line.length) { - if (i > 0) { - writeLine(); - } - write(line); + else { + var seenPrologueDirectives = ts.createMap(); + for (var _a = 0, _b = sourceFileOrBundle.sourceFiles; _a < _b.length; _a++) { + var sourceFile = _b[_a]; + setSourceFile(sourceFile); + emitPrologueDirectives(sourceFile.statements, true, seenPrologueDirectives); } } } - function guessIndentation(lines) { - var indentation; - for (var _a = 0, lines_1 = lines; _a < lines_1.length; _a++) { - var line = lines_1[_a]; - for (var i = 0; i < line.length && (indentation === undefined || i < indentation); i++) { - if (!ts.isWhiteSpace(line.charCodeAt(i))) { - if (indentation === undefined || i < indentation) { - indentation = i; - break; - } - } + function emitShebangIfNeeded(sourceFileOrBundle) { + if (ts.isSourceFile(sourceFileOrBundle)) { + var shebang = ts.getShebang(sourceFileOrBundle.text); + if (shebang) { + write(shebang); + writeLine(); + return true; } } - return indentation; - } - function emitShebang() { - var shebang = ts.getShebang(currentText); - if (shebang) { - write(shebang); - writeLine(); + else { + for (var _a = 0, _b = sourceFileOrBundle.sourceFiles; _a < _b.length; _a++) { + var sourceFile = _b[_a]; + if (emitShebangIfNeeded(sourceFile)) { + break; + } + } } } function emitModifiers(node, modifiers) { @@ -48531,8 +52519,8 @@ var ts; write(suffix); } } - function emitEmbeddedStatement(node) { - if (ts.isBlock(node)) { + function emitEmbeddedStatement(parent, node) { + if (ts.isBlock(node) || ts.getEmitFlags(parent) & 1) { write(" "); emit(node); } @@ -48589,6 +52577,9 @@ var ts; if (format & 7680) { write(getOpeningBracket(format)); } + if (onBeforeEmitNodeArray) { + onBeforeEmitNodeArray(children); + } if (isEmpty) { if (format & 1) { writeLine(); @@ -48616,6 +52607,9 @@ var ts; for (var i = 0; i < count; i++) { var child = children[start + i]; if (previousSibling) { + if (delimiter && previousSibling.end !== parentNode.end) { + emitLeadingCommentsOfPosition(previousSibling.end); + } write(delimiter); if (shouldWriteSeparatingLineTerminator(previousSibling, child, format)) { if ((format & (3 | 64)) === 0) { @@ -48630,8 +52624,10 @@ var ts; } } if (shouldEmitInterveningComments) { - var commentRange = ts.getCommentRange(child); - emitTrailingCommentsOfPosition(commentRange.pos); + if (emitTrailingCommentsOfPosition) { + var commentRange = ts.getCommentRange(child); + emitTrailingCommentsOfPosition(commentRange.pos); + } } else { shouldEmitInterveningComments = mayEmitInterveningComments; @@ -48647,6 +52643,9 @@ var ts; if (format & 16 && hasTrailingComma) { write(","); } + if (previousSibling && delimiter && previousSibling.end !== parentNode.end) { + emitLeadingCommentsOfPosition(previousSibling.end); + } if (format & 64) { decreaseIndent(); } @@ -48657,28 +52656,80 @@ var ts; write(" "); } } + if (onAfterEmitNodeArray) { + onAfterEmitNodeArray(children); + } if (format & 7680) { write(getClosingBracket(format)); } } + function write(s) { + writer.write(s); + } + function writeLine() { + writer.writeLine(); + } + function increaseIndent() { + writer.increaseIndent(); + } + function decreaseIndent() { + writer.decreaseIndent(); + } function writeIfAny(nodes, text) { - if (nodes && nodes.length > 0) { + if (ts.some(nodes)) { write(text); } } function writeIfPresent(node, text) { - if (node !== undefined) { + if (node) { write(text); } } function writeToken(token, pos, contextNode) { - return emitTokenWithSourceMap(contextNode, token, pos, writeTokenText); + return onEmitSourceMapOfToken + ? onEmitSourceMapOfToken(contextNode, token, pos, writeTokenText) + : writeTokenText(token, pos); } function writeTokenText(token, pos) { var tokenString = ts.tokenToString(token); write(tokenString); return pos < 0 ? pos : pos + tokenString.length; } + function writeLineOrSpace(node) { + if (ts.getEmitFlags(node) & 1) { + write(" "); + } + else { + writeLine(); + } + } + function writeLines(text) { + var lines = text.split(/\r\n?|\n/g); + var indentation = guessIndentation(lines); + for (var i = 0; i < lines.length; i++) { + var line = indentation ? lines[i].slice(indentation) : lines[i]; + if (line.length) { + writeLine(); + write(line); + writeLine(); + } + } + } + function guessIndentation(lines) { + var indentation; + for (var _a = 0, lines_1 = lines; _a < lines_1.length; _a++) { + var line = lines_1[_a]; + for (var i = 0; i < line.length && (indentation === undefined || i < indentation); i++) { + if (!ts.isWhiteSpace(line.charCodeAt(i))) { + if (indentation === undefined || i < indentation) { + indentation = i; + break; + } + } + } + } + return indentation; + } function increaseIndentIf(value, valueToWriteWhenNotIndenting) { if (value) { increaseIndent(); @@ -48783,15 +52834,23 @@ var ts; && !ts.nodeIsSynthesized(node2) && !ts.rangeEndIsOnSameLineAsRangeStart(node1, node2, currentSourceFile); } + function isSingleLineEmptyBlock(block) { + return !block.multiLine + && isEmptyBlock(block); + } + function isEmptyBlock(block) { + return block.statements.length === 0 + && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); + } function skipSynthesizedParentheses(node) { - while (node.kind === 183 && ts.nodeIsSynthesized(node)) { + while (node.kind === 184 && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; } function getTextOfNode(node, includeTrivia) { if (ts.isGeneratedIdentifier(node)) { - return getGeneratedIdentifier(node); + return generateName(node); } else if (ts.isIdentifier(node) && (ts.nodeIsSynthesized(node) || !node.parent)) { return ts.unescapeIdentifier(node.text); @@ -48814,25 +52873,39 @@ var ts; return getLiteralTextOfNode(textSourceNode); } } - return ts.getLiteralText(node, currentSourceFile, languageVersion); + return ts.getLiteralText(node, currentSourceFile); } - function isSingleLineEmptyBlock(block) { - return !block.multiLine - && isEmptyBlock(block); + function pushNameGenerationScope() { + tempFlagsStack.push(tempFlags); + tempFlags = 0; } - function isEmptyBlock(block) { - return block.statements.length === 0 - && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); + function popNameGenerationScope() { + tempFlags = tempFlagsStack.pop(); + } + function generateName(name) { + if (name.autoGenerateKind === 4) { + var node = getNodeForGeneratedName(name); + return generateNameCached(node); + } + else { + var autoGenerateId = name.autoGenerateId; + return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = ts.unescapeIdentifier(makeName(name))); + } + } + function generateNameCached(node) { + var nodeId = ts.getNodeId(node); + return nodeIdToGeneratedName[nodeId] || (nodeIdToGeneratedName[nodeId] = ts.unescapeIdentifier(generateNameForNode(node))); } function isUniqueName(name) { - return !resolver.hasGlobalName(name) && - !ts.hasProperty(currentFileIdentifiers, name) && - !ts.hasProperty(generatedNameSet, name); + return !(hasGlobalName && hasGlobalName(name)) + && !currentSourceFile.identifiers.has(name) + && !generatedNames.has(name); } function isUniqueLocalName(name, container) { for (var node = container; ts.isNodeDescendantOf(node, container); node = node.nextContainer) { - if (node.locals && ts.hasProperty(node.locals, name)) { - if (node.locals[name].flags & (107455 | 1048576 | 8388608)) { + if (node.locals) { + var local = node.locals.get(name); + if (local && local.flags & (107455 | 1048576 | 8388608)) { return false; } } @@ -48841,21 +52914,21 @@ var ts; } function makeTempVariableName(flags) { if (flags && !(tempFlags & flags)) { - var name_39 = flags === 268435456 ? "_i" : "_n"; - if (isUniqueName(name_39)) { + var name = flags === 268435456 ? "_i" : "_n"; + if (isUniqueName(name)) { tempFlags |= flags; - return name_39; + return name; } } while (true) { var count = tempFlags & 268435455; tempFlags++; if (count !== 8 && count !== 13) { - var name_40 = count < 26 + var name = count < 26 ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26); - if (isUniqueName(name_40)) { - return name_40; + if (isUniqueName(name)) { + return name; } } } @@ -48868,7 +52941,8 @@ var ts; while (true) { var generatedName = baseName + i; if (isUniqueName(generatedName)) { - return generatedNameSet[generatedName] = generatedName; + generatedNames.set(generatedName, generatedName); + return generatedName; } i++; } @@ -48889,34 +52963,44 @@ var ts; function generateNameForClassExpression() { return makeUniqueName("class"); } + function generateNameForMethodOrAccessor(node) { + if (ts.isIdentifier(node.name)) { + return generateNameCached(node.name); + } + return makeTempVariableName(0); + } function generateNameForNode(node) { switch (node.kind) { case 70: return makeUniqueName(getTextOfNode(node)); - case 230: - case 229: + case 232: + case 231: return generateNameForModuleOrEnum(node); - case 235: - case 241: + case 237: + case 243: return generateNameForImportOrExportDeclaration(node); - case 225: - case 226: - case 240: + case 227: + case 228: + case 242: return generateNameForExportDefault(); - case 197: + case 198: return generateNameForClassExpression(); + case 150: + case 152: + case 153: + return generateNameForMethodOrAccessor(node); default: return makeTempVariableName(0); } } - function generateName(name) { + function makeName(name) { switch (name.autoGenerateKind) { case 1: return makeTempVariableName(0); case 2: return makeTempVariableName(268435456); case 3: - return makeUniqueName(name.text); + return makeUniqueName(ts.unescapeIdentifier(name.text)); } ts.Debug.fail("Unsupported GeneratedIdentifierKind."); } @@ -48935,48 +53019,38 @@ var ts; } return node; } - function getGeneratedIdentifier(name) { - if (name.autoGenerateKind === 4) { - var node = getNodeForGeneratedName(name); - var nodeId = ts.getNodeId(node); - return nodeIdToGeneratedName[nodeId] || (nodeIdToGeneratedName[nodeId] = ts.unescapeIdentifier(generateNameForNode(node))); - } - else { - var autoGenerateId = name.autoGenerateId; - return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = ts.unescapeIdentifier(generateName(name))); - } - } - function createDelimiterMap() { - var delimiters = []; - delimiters[0] = ""; - delimiters[16] = ","; - delimiters[4] = " |"; - delimiters[8] = " &"; - return delimiters; - } - function getDelimiter(format) { - return delimiters[format & 28]; - } - function createBracketsMap() { - var brackets = []; - brackets[512] = ["{", "}"]; - brackets[1024] = ["(", ")"]; - brackets[2048] = ["<", ">"]; - brackets[4096] = ["[", "]"]; - return brackets; - } - function getOpeningBracket(format) { - return brackets[format & 7680][0]; - } - function getClosingBracket(format) { - return brackets[format & 7680][1]; - } } - ts.emitFiles = emitFiles; + ts.createPrinter = createPrinter; + function createDelimiterMap() { + var delimiters = []; + delimiters[0] = ""; + delimiters[16] = ","; + delimiters[4] = " |"; + delimiters[8] = " &"; + return delimiters; + } + function getDelimiter(format) { + return delimiters[format & 28]; + } + function createBracketsMap() { + var brackets = []; + brackets[512] = ["{", "}"]; + brackets[1024] = ["(", ")"]; + brackets[2048] = ["<", ">"]; + brackets[4096] = ["[", "]"]; + return brackets; + } + function getOpeningBracket(format) { + return brackets[format & 7680][0]; + } + function getClosingBracket(format) { + return brackets[format & 7680][1]; + } })(ts || (ts = {})); var ts; (function (ts) { var emptyArray = []; + var ignoreDiagnosticCommentRegEx = /(^\s*$)|(^\s*\/\/\/?\s*(@ts-ignore)?)/; function findConfigFile(searchPath, fileExists, configName) { if (configName === void 0) { configName = "tsconfig.json"; } while (true) { @@ -49008,7 +53082,8 @@ var ts; commonPathComponents = sourcePathComponents; return; } - for (var i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) { + var n = Math.min(commonPathComponents.length, sourcePathComponents.length); + for (var i = 0; i < n; i++) { if (getCanonicalFileName(commonPathComponents[i]) !== getCanonicalFileName(sourcePathComponents[i])) { if (i === 0) { return true; @@ -49035,7 +53110,6 @@ var ts; function getCanonicalFileName(fileName) { return ts.sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(); } - var unsupportedFileEncodingErrorCode = -2147024809; function getSourceFile(fileName, languageVersion, onError) { var text; try { @@ -49046,20 +53120,18 @@ var ts; } catch (e) { if (onError) { - onError(e.number === unsupportedFileEncodingErrorCode - ? ts.createCompilerDiagnostic(ts.Diagnostics.Unsupported_file_encoding).messageText - : e.message); + onError(e.message); } text = ""; } return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion, setParentNodes) : undefined; } function directoryExists(directoryPath) { - if (directoryPath in existingDirectories) { + if (existingDirectories.has(directoryPath)) { return true; } if (ts.sys.directoryExists(directoryPath)) { - existingDirectories[directoryPath] = true; + existingDirectories.set(directoryPath, true); return true; } return false; @@ -49078,9 +53150,10 @@ var ts; } var hash = ts.sys.createHash(data); var mtimeBefore = ts.sys.getModifiedTime(fileName); - if (mtimeBefore && fileName in outputFingerprints) { - var fingerprint = outputFingerprints[fileName]; - if (fingerprint.byteOrderMark === writeByteOrderMark && + if (mtimeBefore) { + var fingerprint = outputFingerprints.get(fileName); + if (fingerprint && + fingerprint.byteOrderMark === writeByteOrderMark && fingerprint.hash === hash && fingerprint.mtime.getTime() === mtimeBefore.getTime()) { return; @@ -49088,11 +53161,11 @@ var ts; } ts.sys.writeFile(fileName, data, writeByteOrderMark); var mtimeAfter = ts.sys.getModifiedTime(fileName); - outputFingerprints[fileName] = { + outputFingerprints.set(fileName, { hash: hash, byteOrderMark: writeByteOrderMark, mtime: mtimeAfter - }; + }); } function writeFile(fileName, data, writeByteOrderMark, onError) { try { @@ -49191,10 +53264,14 @@ var ts; var resolutions = []; var cache = ts.createMap(); for (var _i = 0, names_1 = names; _i < names_1.length; _i++) { - var name_41 = names_1[_i]; - var result = name_41 in cache - ? cache[name_41] - : cache[name_41] = loader(name_41, containingFile); + var name = names_1[_i]; + var result = void 0; + if (cache.has(name)) { + result = cache.get(name); + } + else { + cache.set(name, result = loader(name, containingFile)); + } resolutions.push(result); } return resolutions; @@ -49206,6 +53283,8 @@ var ts; var diagnosticsProducingTypeChecker; var noDiagnosticsTypeChecker; var classifiableNames; + var cachedSemanticDiagnosticsForFile = {}; + var cachedDeclarationDiagnosticsForFile = {}; var resolvedTypeReferenceDirectives = ts.createMap(); var fileProcessingDiagnostics = ts.createDiagnosticCollection(); var maxNodeModuleJsDepth = typeof options.maxNodeModuleJsDepth === "number" ? options.maxNodeModuleJsDepth : 0; @@ -49219,6 +53298,7 @@ var ts; var currentDirectory = host.getCurrentDirectory(); var supportedExtensions = ts.getSupportedExtensions(options); var hasEmitBlockingDiagnostics = ts.createFileMap(getCanonicalFileName); + var moduleResolutionCache; var resolveModuleNamesWorker; if (host.resolveModuleNames) { resolveModuleNamesWorker = function (moduleNames, containingFile) { return host.resolveModuleNames(moduleNames, containingFile).map(function (resolved) { @@ -49231,7 +53311,8 @@ var ts; }); }; } else { - var loader_1 = function (moduleName, containingFile) { return ts.resolveModuleName(moduleName, containingFile, options, host).resolvedModule; }; + moduleResolutionCache = ts.createModuleResolutionCache(currentDirectory, function (x) { return host.getCanonicalFileName(x); }); + var loader_1 = function (moduleName, containingFile) { return ts.resolveModuleName(moduleName, containingFile, options, host, moduleResolutionCache).resolvedModule; }; resolveModuleNamesWorker = function (moduleNames, containingFile) { return loadWithLocalCache(moduleNames, containingFile, loader_1); }; } var resolveTypeReferenceDirectiveNamesWorker; @@ -49267,6 +53348,7 @@ var ts; } } } + moduleResolutionCache = undefined; oldProgram = undefined; program = { getRootFileNames: function () { return rootNames; }, @@ -49300,7 +53382,7 @@ var ts; return program; function getCommonSourceDirectory() { if (commonSourceDirectory === undefined) { - var emittedFiles = ts.filterSourceFilesInDirectory(files, isSourceFileFromExternalLibrary); + var emittedFiles = ts.filter(files, function (file) { return ts.sourceFileMayBeEmitted(file, options, isSourceFileFromExternalLibrary); }); if (options.rootDir && checkSourceFilesBelongToPath(emittedFiles, options.rootDir)) { commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory); } @@ -49319,7 +53401,7 @@ var ts; classifiableNames = ts.createMap(); for (var _i = 0, files_2 = files; _i < files_2.length; _i++) { var sourceFile = files_2[_i]; - ts.copyProperties(sourceFile.classifiableNames, classifiableNames); + ts.copyEntries(sourceFile.classifiableNames, classifiableNames); } } return classifiableNames; @@ -49362,7 +53444,7 @@ var ts; : emptyArray; var j = 0; for (var i = 0; i < result.length; i++) { - if (result[i] == predictedToResolveToAmbientModuleMarker) { + if (result[i] === predictedToResolveToAmbientModuleMarker) { result[i] = undefined; } else { @@ -49473,7 +53555,7 @@ var ts; newSourceFile.resolvedModules = oldSourceFile.resolvedModules; newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames; } - for (var i = 0, len = newSourceFiles.length; i < len; i++) { + for (var i = 0; i < newSourceFiles.length; i++) { filesByName.set(filePaths[i], newSourceFiles[i]); } files = newSourceFiles; @@ -49502,7 +53584,7 @@ var ts; }; } function isSourceFileFromExternalLibrary(file) { - return sourceFilesFoundSearchingNodeModules[file.path]; + return sourceFilesFoundSearchingNodeModules.get(file.path); } function getDiagnosticsProducingTypeChecker() { return diagnosticsProducingTypeChecker || (diagnosticsProducingTypeChecker = ts.createTypeChecker(program, true)); @@ -49513,13 +53595,13 @@ var ts; function getTypeChecker() { return noDiagnosticsTypeChecker || (noDiagnosticsTypeChecker = ts.createTypeChecker(program, false)); } - function emit(sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles) { - return runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles); }); + function emit(sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers) { + return runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers); }); } function isEmitBlocked(emitFileName) { return hasEmitBlockingDiagnostics.contains(ts.toPath(emitFileName, currentDirectory, getCanonicalFileName)); } - function emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles) { + function emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, customTransformers) { var declarationDiagnostics = []; if (options.noEmit) { return { diagnostics: declarationDiagnostics, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true }; @@ -49540,7 +53622,8 @@ var ts; } var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile); ts.performance.mark("beforeEmit"); - var emitResult = ts.emitFiles(emitResolver, getEmitHost(writeFileCallback), sourceFile, emitOnlyDtsFiles); + var transformers = emitOnlyDtsFiles ? [] : ts.getTransformers(options, customTransformers); + var emitResult = ts.emitFiles(emitResolver, getEmitHost(writeFileCallback), sourceFile, emitOnlyDtsFiles, transformers); ts.performance.mark("afterEmit"); ts.performance.measure("Emit", "beforeEmit", "afterEmit"); return emitResult; @@ -49601,16 +53684,42 @@ var ts; } } function getSemanticDiagnosticsForFile(sourceFile, cancellationToken) { + return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedSemanticDiagnosticsForFile, getSemanticDiagnosticsForFileNoCache); + } + function getSemanticDiagnosticsForFileNoCache(sourceFile, cancellationToken) { return runWithCancellationToken(function () { var typeChecker = getDiagnosticsProducingTypeChecker(); ts.Debug.assert(!!sourceFile.bindDiagnostics); var bindDiagnostics = sourceFile.bindDiagnostics; - var checkDiagnostics = ts.isSourceFileJavaScript(sourceFile) ? [] : typeChecker.getDiagnostics(sourceFile, cancellationToken); + var includeCheckDiagnostics = !ts.isSourceFileJavaScript(sourceFile) || ts.isCheckJsEnabledForFile(sourceFile, options); + var checkDiagnostics = includeCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : []; var fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName); var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName); - return bindDiagnostics.concat(checkDiagnostics, fileProcessingDiagnosticsInFile, programDiagnosticsInFile); + var diagnostics = bindDiagnostics.concat(checkDiagnostics, fileProcessingDiagnosticsInFile, programDiagnosticsInFile); + return ts.isSourceFileJavaScript(sourceFile) + ? ts.filter(diagnostics, shouldReportDiagnostic) + : diagnostics; }); } + function shouldReportDiagnostic(diagnostic) { + var file = diagnostic.file, start = diagnostic.start; + if (file) { + var lineStarts = ts.getLineStarts(file); + var line = ts.computeLineAndCharacterOfPosition(lineStarts, start).line; + while (line > 0) { + var previousLineText = file.text.slice(lineStarts[line - 1], lineStarts[line]); + var result = ignoreDiagnosticCommentRegEx.exec(previousLineText); + if (!result) { + return true; + } + if (result[3]) { + return false; + } + line--; + } + } + return true; + } function getJavaScriptSyntacticDiagnosticsForFile(sourceFile) { return runWithCancellationToken(function () { var diagnostics = []; @@ -49619,57 +53728,57 @@ var ts; return diagnostics; function walk(node) { switch (parent.kind) { - case 144: - case 147: + case 145: + case 148: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, "?")); return; } - case 149: - case 148: case 150: + case 149: case 151: case 152: - case 184: - case 225: + case 153: case 185: + case 227: + case 186: + case 227: case 225: - case 223: if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); return; } } switch (node.kind) { - case 234: + case 236: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); return; - case 240: + case 242: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); return; } break; - case 255: + case 258: var heritageClause = node; if (heritageClause.token === 107) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); return; } break; - case 227: + case 229: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); return; - case 230: + case 232: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); return; - case 228: + case 230: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); return; - case 229: + case 231: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); return; - case 182: + case 183: var typeAssertionExpression = node; diagnostics.push(createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); return; @@ -49684,26 +53793,26 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning)); } switch (parent.kind) { - case 226: - case 149: - case 148: + case 228: case 150: + case 149: case 151: case 152: - case 184: - case 225: + case 153: case 185: - case 225: + case 227: + case 186: + case 227: if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); return; } - case 205: + case 207: if (nodes === parent.modifiers) { - return checkModifiers(nodes, parent.kind === 205); + return checkModifiers(nodes, parent.kind === 207); } break; - case 147: + case 148: if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { var modifier = _a[_i]; @@ -49714,23 +53823,23 @@ var ts; return; } break; - case 144: + case 145: if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); return; } break; - case 179: case 180: - case 199: + case 181: + case 200: if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); return; } break; } - for (var _b = 0, nodes_6 = nodes; _b < nodes_6.length; _b++) { - var node = nodes_6[_b]; + for (var _b = 0, nodes_8 = nodes; _b < nodes_8.length; _b++) { + var node = nodes_8[_b]; walk(node); } } @@ -49766,11 +53875,33 @@ var ts; }); } function getDeclarationDiagnosticsWorker(sourceFile, cancellationToken) { + return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedDeclarationDiagnosticsForFile, getDeclarationDiagnosticsForFileNoCache); + } + function getDeclarationDiagnosticsForFileNoCache(sourceFile, cancellationToken) { return runWithCancellationToken(function () { var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile, cancellationToken); return ts.getDeclarationDiagnostics(getEmitHost(ts.noop), resolver, sourceFile); }); } + function getAndCacheDiagnostics(sourceFile, cancellationToken, cache, getDiagnostics) { + var cachedResult = sourceFile + ? cache.perFile && cache.perFile.get(sourceFile.path) + : cache.allDiagnostics; + if (cachedResult) { + return cachedResult; + } + var result = getDiagnostics(sourceFile, cancellationToken) || emptyArray; + if (sourceFile) { + if (!cache.perFile) { + cache.perFile = ts.createFileMap(); + } + cache.perFile.set(sourceFile.path, result); + } + else { + cache.allDiagnostics = result; + } + return result; + } function getDeclarationDiagnosticsForFile(sourceFile, cancellationToken) { return ts.isDeclarationFile(sourceFile) ? [] : getDeclarationDiagnosticsWorker(sourceFile, cancellationToken); } @@ -49810,11 +53941,10 @@ var ts; if (options.importHelpers && (options.isolatedModules || isExternalModuleFile) && !file.isDeclarationFile) { - var externalHelpersModuleReference = ts.createSynthesizedNode(9); - externalHelpersModuleReference.text = ts.externalHelpersModuleNameText; - var importDecl = ts.createSynthesizedNode(235); - importDecl.parent = file; + var externalHelpersModuleReference = ts.createLiteral(ts.externalHelpersModuleNameText); + var importDecl = ts.createImportDeclaration(undefined, undefined, undefined); externalHelpersModuleReference.parent = importDecl; + importDecl.parent = file; imports = [externalHelpersModuleReference]; } for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { @@ -49830,9 +53960,9 @@ var ts; return; function collectModuleReferences(node, inAmbientModule) { switch (node.kind) { - case 235: - case 234: - case 241: + case 237: + case 236: + case 243: var moduleNameExpr = ts.getExternalModuleName(node); if (!moduleNameExpr || moduleNameExpr.kind !== 9) { break; @@ -49844,7 +53974,7 @@ var ts; (imports || (imports = [])).push(moduleNameExpr); } break; - case 230: + case 232: if (ts.isAmbientModule(node) && (inAmbientModule || ts.hasModifier(node, 2) || ts.isDeclarationFile(file))) { var moduleName = node.name; if (isExternalModuleFile || (inAmbientModule && !ts.isExternalModuleNameRelative(moduleName.text))) { @@ -49928,18 +54058,18 @@ var ts; if (file_1 && options.forceConsistentCasingInFileNames && ts.getNormalizedAbsolutePath(file_1.fileName, currentDirectory) !== ts.getNormalizedAbsolutePath(fileName, currentDirectory)) { reportFileNamesDifferOnlyInCasingError(fileName, file_1.fileName, refFile, refPos, refEnd); } - if (file_1 && sourceFilesFoundSearchingNodeModules[file_1.path] && currentNodeModulesDepth == 0) { - sourceFilesFoundSearchingNodeModules[file_1.path] = false; + if (file_1 && sourceFilesFoundSearchingNodeModules.get(file_1.path) && currentNodeModulesDepth === 0) { + sourceFilesFoundSearchingNodeModules.set(file_1.path, false); if (!options.noResolve) { processReferencedFiles(file_1, isDefaultLib); processTypeReferenceDirectives(file_1); } - modulesWithElidedImports[file_1.path] = false; + modulesWithElidedImports.set(file_1.path, false); processImportedModules(file_1); } - else if (file_1 && modulesWithElidedImports[file_1.path]) { + else if (file_1 && modulesWithElidedImports.get(file_1.path)) { if (currentNodeModulesDepth < maxNodeModuleJsDepth) { - modulesWithElidedImports[file_1.path] = false; + modulesWithElidedImports.set(file_1.path, false); processImportedModules(file_1); } } @@ -49955,7 +54085,7 @@ var ts; }); filesByName.set(path, file); if (file) { - sourceFilesFoundSearchingNodeModules[path] = (currentNodeModulesDepth > 0); + sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0); file.path = path; if (host.useCaseSensitiveFileNames()) { var existingFile = filesByNameIgnoreCase.get(path); @@ -49999,7 +54129,7 @@ var ts; } } function processTypeReferenceDirective(typeReferenceDirective, resolvedTypeReferenceDirective, refFile, refPos, refEnd) { - var previousResolution = resolvedTypeReferenceDirectives[typeReferenceDirective]; + var previousResolution = resolvedTypeReferenceDirectives.get(typeReferenceDirective); if (previousResolution && previousResolution.primary) { return; } @@ -50027,7 +54157,7 @@ var ts; fileProcessingDiagnostics.add(createDiagnostic(refFile, refPos, refEnd, ts.Diagnostics.Cannot_find_type_definition_file_for_0, typeReferenceDirective)); } if (saveResolution) { - resolvedTypeReferenceDirectives[typeReferenceDirective] = resolvedTypeReferenceDirective; + resolvedTypeReferenceDirectives.set(typeReferenceDirective, resolvedTypeReferenceDirective); } } function createDiagnostic(refFile, refPos, refEnd, message) { @@ -50068,7 +54198,7 @@ var ts; var elideImport = isJsFileFromNodeModules && currentNodeModulesDepth > maxNodeModuleJsDepth; var shouldAddFile = resolvedFileName && !getResolutionDiagnostic(options, resolution) && !options.noResolve && i < file.imports.length && !elideImport; if (elideImport) { - modulesWithElidedImports[file.path] = true; + modulesWithElidedImports.set(file.path, true); } else if (shouldAddFile) { var path = ts.toPath(resolvedFileName, currentDirectory, getCanonicalFileName); @@ -50086,8 +54216,8 @@ var ts; } function computeCommonSourceDirectory(sourceFiles) { var fileNames = []; - for (var _i = 0, sourceFiles_6 = sourceFiles; _i < sourceFiles_6.length; _i++) { - var file = sourceFiles_6[_i]; + for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) { + var file = sourceFiles_2[_i]; if (!file.isDeclarationFile) { fileNames.push(file.fileName); } @@ -50098,8 +54228,8 @@ var ts; var allFilesBelongToPath = true; if (sourceFiles) { var absoluteRootDirectoryPath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(rootDirectory, currentDirectory)); - for (var _i = 0, sourceFiles_7 = sourceFiles; _i < sourceFiles_7.length; _i++) { - var sourceFile = sourceFiles_7[_i]; + for (var _i = 0, sourceFiles_3 = sourceFiles; _i < sourceFiles_3.length; _i++) { + var sourceFile = sourceFiles_3[_i]; if (!ts.isDeclarationFile(sourceFile)) { var absoluteSourceFilePath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { @@ -50192,7 +54322,7 @@ var ts; if (options.lib && options.noLib) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "lib", "noLib")); } - if (options.noImplicitUseStrict && options.alwaysStrict) { + if (options.noImplicitUseStrict && (options.alwaysStrict === undefined ? options.strict : options.alwaysStrict)) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "noImplicitUseStrict", "alwaysStrict")); } var languageVersion = options.target || 0; @@ -50232,6 +54362,9 @@ var ts; if (!options.noEmit && options.allowJs && options.declaration) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "allowJs", "declaration")); } + if (options.checkJs && !options.allowJs) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "checkJs", "allowJs")); + } if (options.emitDecoratorMetadata && !options.experimentalDecorators) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators")); @@ -50250,7 +54383,7 @@ var ts; if (!options.noEmit && !options.suppressOutputPathCheck) { var emitHost = getEmitHost(); var emitFilesSeen_1 = ts.createFileMap(!host.useCaseSensitiveFileNames() ? function (key) { return key.toLocaleLowerCase(); } : undefined); - ts.forEachExpectedEmitFile(emitHost, function (emitFileNames) { + ts.forEachEmittedFile(emitHost, function (emitFileNames) { verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen_1); verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen_1); }); @@ -50307,40 +54440,12 @@ var ts; (function (ts) { ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean" }; ts.optionDeclarations = [ - { - name: "charset", - type: "string", - }, - ts.compileOnSaveCommandLineOption, - { - name: "declaration", - shortName: "d", - type: "boolean", - description: ts.Diagnostics.Generates_corresponding_d_ts_file, - }, - { - name: "declarationDir", - type: "string", - isFilePath: true, - paramType: ts.Diagnostics.DIRECTORY, - }, - { - name: "diagnostics", - type: "boolean", - }, - { - name: "extendedDiagnostics", - type: "boolean", - experimental: true - }, - { - name: "emitBOM", - type: "boolean" - }, { name: "help", shortName: "h", type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, description: ts.Diagnostics.Print_this_message, }, { @@ -50348,219 +54453,57 @@ var ts; shortName: "?", type: "boolean" }, + { + name: "all", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Show_all_compiler_options, + }, + { + name: "version", + shortName: "v", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Print_the_compiler_s_version, + }, { name: "init", type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, description: ts.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file, }, - { - name: "inlineSourceMap", - type: "boolean", - }, - { - name: "inlineSources", - type: "boolean", - }, - { - name: "jsx", - type: ts.createMap({ - "preserve": 1, - "react": 2 - }), - paramType: ts.Diagnostics.KIND, - description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_or_react, - }, - { - name: "reactNamespace", - type: "string", - description: ts.Diagnostics.Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit - }, - { - name: "jsxFactory", - type: "string", - description: ts.Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h - }, - { - name: "listFiles", - type: "boolean", - }, - { - name: "locale", - type: "string", - }, - { - name: "mapRoot", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, - paramType: ts.Diagnostics.LOCATION, - }, - { - name: "module", - shortName: "m", - type: ts.createMap({ - "none": ts.ModuleKind.None, - "commonjs": ts.ModuleKind.CommonJS, - "amd": ts.ModuleKind.AMD, - "system": ts.ModuleKind.System, - "umd": ts.ModuleKind.UMD, - "es6": ts.ModuleKind.ES2015, - "es2015": ts.ModuleKind.ES2015, - }), - description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015, - paramType: ts.Diagnostics.KIND, - }, - { - name: "newLine", - type: ts.createMap({ - "crlf": 0, - "lf": 1 - }), - description: ts.Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, - paramType: ts.Diagnostics.NEWLINE, - }, - { - name: "noEmit", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_outputs, - }, - { - name: "noEmitHelpers", - type: "boolean" - }, - { - name: "noEmitOnError", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported, - }, - { - name: "noErrorTruncation", - type: "boolean" - }, - { - name: "noImplicitAny", - type: "boolean", - description: ts.Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type, - }, - { - name: "noImplicitThis", - type: "boolean", - description: ts.Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type, - }, - { - name: "noUnusedLocals", - type: "boolean", - description: ts.Diagnostics.Report_errors_on_unused_locals, - }, - { - name: "noUnusedParameters", - type: "boolean", - description: ts.Diagnostics.Report_errors_on_unused_parameters, - }, - { - name: "noLib", - type: "boolean", - }, - { - name: "noResolve", - type: "boolean", - }, - { - name: "skipDefaultLibCheck", - type: "boolean", - }, - { - name: "skipLibCheck", - type: "boolean", - description: ts.Diagnostics.Skip_type_checking_of_declaration_files, - }, - { - name: "out", - type: "string", - isFilePath: false, - paramType: ts.Diagnostics.FILE, - }, - { - name: "outFile", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Concatenate_and_emit_output_to_single_file, - paramType: ts.Diagnostics.FILE, - }, - { - name: "outDir", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Redirect_output_structure_to_the_directory, - paramType: ts.Diagnostics.DIRECTORY, - }, - { - name: "preserveConstEnums", - type: "boolean", - description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code - }, - { - name: "pretty", - description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental, - type: "boolean" - }, { name: "project", shortName: "p", type: "string", isFilePath: true, - description: ts.Diagnostics.Compile_the_project_in_the_given_directory, - paramType: ts.Diagnostics.DIRECTORY + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + paramType: ts.Diagnostics.FILE_OR_DIRECTORY, + description: ts.Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json, }, { - name: "removeComments", + name: "pretty", type: "boolean", - description: ts.Diagnostics.Do_not_emit_comments_to_output, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental }, { - name: "rootDir", - type: "string", - isFilePath: true, - paramType: ts.Diagnostics.LOCATION, - description: ts.Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, - }, - { - name: "isolatedModules", + name: "watch", + shortName: "w", type: "boolean", - }, - { - name: "sourceMap", - type: "boolean", - description: ts.Diagnostics.Generates_corresponding_map_file, - }, - { - name: "sourceRoot", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, - paramType: ts.Diagnostics.LOCATION, - }, - { - name: "suppressExcessPropertyErrors", - type: "boolean", - description: ts.Diagnostics.Suppress_excess_property_checks_for_object_literals, - experimental: true - }, - { - name: "suppressImplicitAnyIndexErrors", - type: "boolean", - description: ts.Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures, - }, - { - name: "stripInternal", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, - experimental: true + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Watch_input_files, }, { name: "target", shortName: "t", - type: ts.createMap({ + type: ts.createMapFromTemplate({ "es3": 0, "es5": 1, "es6": 2, @@ -50569,146 +54512,41 @@ var ts; "es2017": 4, "esnext": 5, }), - description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015, paramType: ts.Diagnostics.VERSION, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT, }, { - name: "version", - shortName: "v", - type: "boolean", - description: ts.Diagnostics.Print_the_compiler_s_version, - }, - { - name: "watch", - shortName: "w", - type: "boolean", - description: ts.Diagnostics.Watch_input_files, - }, - { - name: "experimentalDecorators", - type: "boolean", - description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators - }, - { - name: "emitDecoratorMetadata", - type: "boolean", - experimental: true, - description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators - }, - { - name: "moduleResolution", - type: ts.createMap({ - "node": ts.ModuleResolutionKind.NodeJs, - "classic": ts.ModuleResolutionKind.Classic, + name: "module", + shortName: "m", + type: ts.createMapFromTemplate({ + "none": ts.ModuleKind.None, + "commonjs": ts.ModuleKind.CommonJS, + "amd": ts.ModuleKind.AMD, + "system": ts.ModuleKind.System, + "umd": ts.ModuleKind.UMD, + "es6": ts.ModuleKind.ES2015, + "es2015": ts.ModuleKind.ES2015, }), - description: ts.Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6, - paramType: ts.Diagnostics.STRATEGY, - }, - { - name: "allowUnusedLabels", - type: "boolean", - description: ts.Diagnostics.Do_not_report_errors_on_unused_labels - }, - { - name: "noImplicitReturns", - type: "boolean", - description: ts.Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value - }, - { - name: "noFallthroughCasesInSwitch", - type: "boolean", - description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement - }, - { - name: "allowUnreachableCode", - type: "boolean", - description: ts.Diagnostics.Do_not_report_errors_on_unreachable_code - }, - { - name: "forceConsistentCasingInFileNames", - type: "boolean", - description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file - }, - { - name: "baseUrl", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Base_directory_to_resolve_non_absolute_module_names - }, - { - name: "paths", - type: "object", - isTSConfigOnly: true - }, - { - name: "rootDirs", - type: "list", - isTSConfigOnly: true, - element: { - name: "rootDirs", - type: "string", - isFilePath: true - } - }, - { - name: "typeRoots", - type: "list", - element: { - name: "typeRoots", - type: "string", - isFilePath: true - } - }, - { - name: "types", - type: "list", - element: { - name: "types", - type: "string" - }, - description: ts.Diagnostics.Type_declaration_files_to_be_included_in_compilation - }, - { - name: "traceResolution", - type: "boolean", - description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process - }, - { - name: "allowJs", - type: "boolean", - description: ts.Diagnostics.Allow_javascript_files_to_be_compiled - }, - { - name: "allowSyntheticDefaultImports", - type: "boolean", - description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking - }, - { - name: "noImplicitUseStrict", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_use_strict_directives_in_module_output - }, - { - name: "maxNodeModuleJsDepth", - type: "number", - description: ts.Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files - }, - { - name: "listEmittedFiles", - type: "boolean" + paramType: ts.Diagnostics.KIND, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015, }, { name: "lib", type: "list", element: { name: "lib", - type: ts.createMap({ + type: ts.createMapFromTemplate({ "es5": "lib.es5.d.ts", "es6": "lib.es2015.d.ts", "es2015": "lib.es2015.d.ts", "es7": "lib.es2016.d.ts", "es2016": "lib.es2016.d.ts", "es2017": "lib.es2017.d.ts", + "esnext": "lib.esnext.d.ts", "dom": "lib.dom.d.ts", "dom.iterable": "lib.dom.iterable.d.ts", "webworker": "lib.webworker.d.ts", @@ -50726,28 +54564,475 @@ var ts; "es2017.object": "lib.es2017.object.d.ts", "es2017.sharedmemory": "lib.es2017.sharedmemory.d.ts", "es2017.string": "lib.es2017.string.d.ts", + "esnext.asynciterable": "lib.esnext.asynciterable.d.ts", }), }, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon }, { - name: "disableSizeLimit", - type: "boolean" + name: "allowJs", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Allow_javascript_files_to_be_compiled }, { - name: "strictNullChecks", + name: "checkJs", type: "boolean", - description: ts.Diagnostics.Enable_strict_null_checks + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Report_errors_in_js_files + }, + { + name: "jsx", + type: ts.createMapFromTemplate({ + "preserve": 1, + "react-native": 3, + "react": 2 + }), + paramType: ts.Diagnostics.KIND, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_react_native_or_react, + }, + { + name: "declaration", + shortName: "d", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Generates_corresponding_d_ts_file, + }, + { + name: "sourceMap", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Generates_corresponding_map_file, + }, + { + name: "outFile", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.FILE, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Concatenate_and_emit_output_to_single_file, + }, + { + name: "outDir", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.DIRECTORY, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Redirect_output_structure_to_the_directory, + }, + { + name: "rootDir", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.LOCATION, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, + }, + { + name: "removeComments", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Do_not_emit_comments_to_output, + }, + { + name: "noEmit", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Do_not_emit_outputs, }, { name: "importHelpers", type: "boolean", + category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Import_emit_helpers_from_tslib }, + { + name: "downlevelIteration", + type: "boolean", + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3 + }, + { + name: "isolatedModules", + type: "boolean", + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule + }, + { + name: "strict", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Enable_all_strict_type_checking_options + }, + { + name: "noImplicitAny", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type, + }, + { + name: "strictNullChecks", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Enable_strict_null_checks + }, + { + name: "noImplicitThis", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type, + }, { name: "alwaysStrict", type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, description: ts.Diagnostics.Parse_in_strict_mode_and_emit_use_strict_for_each_source_file + }, + { + name: "noUnusedLocals", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_errors_on_unused_locals, + }, + { + name: "noUnusedParameters", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_errors_on_unused_parameters, + }, + { + name: "noImplicitReturns", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value + }, + { + name: "noFallthroughCasesInSwitch", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement + }, + { + name: "moduleResolution", + type: ts.createMapFromTemplate({ + "node": ts.ModuleResolutionKind.NodeJs, + "classic": ts.ModuleResolutionKind.Classic, + }), + paramType: ts.Diagnostics.STRATEGY, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6, + }, + { + name: "baseUrl", + type: "string", + isFilePath: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Base_directory_to_resolve_non_absolute_module_names + }, + { + name: "paths", + type: "object", + isTSConfigOnly: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl + }, + { + name: "rootDirs", + type: "list", + isTSConfigOnly: true, + element: { + name: "rootDirs", + type: "string", + isFilePath: true + }, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime + }, + { + name: "typeRoots", + type: "list", + element: { + name: "typeRoots", + type: "string", + isFilePath: true + }, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.List_of_folders_to_include_type_definitions_from + }, + { + name: "types", + type: "list", + element: { + name: "types", + type: "string" + }, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Type_declaration_files_to_be_included_in_compilation + }, + { + name: "allowSyntheticDefaultImports", + type: "boolean", + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking + }, + { + name: "sourceRoot", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.LOCATION, + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, + }, + { + name: "mapRoot", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.LOCATION, + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, + }, + { + name: "inlineSourceMap", + type: "boolean", + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file + }, + { + name: "inlineSources", + type: "boolean", + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set + }, + { + name: "experimentalDecorators", + type: "boolean", + category: ts.Diagnostics.Experimental_Options, + description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators + }, + { + name: "emitDecoratorMetadata", + type: "boolean", + category: ts.Diagnostics.Experimental_Options, + description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators + }, + { + name: "jsxFactory", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h + }, + { + name: "diagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_diagnostic_information + }, + { + name: "extendedDiagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_verbose_diagnostic_information + }, + { + name: "traceResolution", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process + }, + { + name: "listFiles", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Print_names_of_files_part_of_the_compilation + }, + { + name: "listEmittedFiles", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Print_names_of_generated_files_part_of_the_compilation + }, + { + name: "out", + type: "string", + isFilePath: false, + category: ts.Diagnostics.Advanced_Options, + paramType: ts.Diagnostics.FILE, + description: ts.Diagnostics.Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file, + }, + { + name: "reactNamespace", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit + }, + { + name: "skipDefaultLibCheck", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files + }, + { + name: "charset", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.The_character_set_of_the_input_files + }, + { + name: "emitBOM", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files + }, + { + name: "locale", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.The_locale_used_when_displaying_messages_to_the_user_e_g_en_us + }, + { + name: "newLine", + type: ts.createMapFromTemplate({ + "crlf": 0, + "lf": 1 + }), + paramType: ts.Diagnostics.NEWLINE, + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, + }, + { + name: "noErrorTruncation", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_truncate_error_messages + }, + { + name: "noLib", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_include_the_default_library_file_lib_d_ts + }, + { + name: "noResolve", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files + }, + { + name: "stripInternal", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, + }, + { + name: "disableSizeLimit", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Disable_size_limitations_on_JavaScript_projects + }, + { + name: "noImplicitUseStrict", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_emit_use_strict_directives_in_module_output + }, + { + name: "noEmitHelpers", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_generate_custom_helper_functions_like_extends_in_compiled_output + }, + { + name: "noEmitOnError", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported, + }, + { + name: "preserveConstEnums", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code + }, + { + name: "declarationDir", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.DIRECTORY, + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Output_directory_for_generated_declaration_files + }, + { + name: "skipLibCheck", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Skip_type_checking_of_declaration_files, + }, + { + name: "allowUnusedLabels", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_report_errors_on_unused_labels + }, + { + name: "allowUnreachableCode", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_report_errors_on_unreachable_code + }, + { + name: "suppressExcessPropertyErrors", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Suppress_excess_property_checks_for_object_literals, + }, + { + name: "suppressImplicitAnyIndexErrors", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures, + }, + { + name: "forceConsistentCasingInFileNames", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file + }, + { + name: "maxNodeModuleJsDepth", + type: "number", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files + }, + { + name: "plugins", + type: "list", + isTSConfigOnly: true, + element: { + name: "plugin", + type: "object" + }, + description: ts.Diagnostics.List_of_language_service_plugins } ]; ts.typeAcquisitionDeclarations = [ @@ -50779,8 +55064,7 @@ var ts; ts.defaultInitCompilerOptions = { module: ts.ModuleKind.CommonJS, target: 1, - noImplicitAny: false, - sourceMap: false, + strict: true }; var optionNameMapCache; function convertEnableAutoDiscoveryToEnable(typeAcquisition) { @@ -50802,9 +55086,9 @@ var ts; var optionNameMap = ts.createMap(); var shortOptionNames = ts.createMap(); ts.forEach(ts.optionDeclarations, function (option) { - optionNameMap[option.name.toLowerCase()] = option; + optionNameMap.set(option.name.toLowerCase(), option); if (option.shortName) { - shortOptionNames[option.shortName] = option.name; + shortOptionNames.set(option.shortName, option.name); } }); optionNameMapCache = { optionNameMap: optionNameMap, shortOptionNames: shortOptionNames }; @@ -50812,19 +55096,12 @@ var ts; } ts.getOptionNameMap = getOptionNameMap; function createCompilerDiagnosticForInvalidCustomType(opt) { - var namesOfType = Object.keys(opt.type).map(function (key) { return "'" + key + "'"; }).join(", "); + var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'" + key + "'"; }).join(", "); return ts.createCompilerDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType); } ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType; function parseCustomTypeOption(opt, value, errors) { - var key = trimString((value || "")).toLowerCase(); - var map = opt.type; - if (key in map) { - return map[key]; - } - else { - errors.push(createCompilerDiagnosticForInvalidCustomType(opt)); - } + return convertJsonOptionOfCustomType(opt, trimString(value || ""), errors); } ts.parseCustomTypeOption = parseCustomTypeOption; function parseListTypeOption(opt, value, errors) { @@ -50868,11 +55145,12 @@ var ts; } else if (s.charCodeAt(0) === 45) { s = s.slice(s.charCodeAt(1) === 45 ? 2 : 1).toLowerCase(); - if (s in shortOptionNames) { - s = shortOptionNames[s]; + var short = shortOptionNames.get(s); + if (short !== undefined) { + s = short; } - if (s in optionNameMap) { - var opt = optionNameMap[s]; + var opt = optionNameMap.get(s); + if (opt) { if (opt.isTSConfigOnly) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file, opt.name)); } @@ -50977,7 +55255,7 @@ var ts; } } ts.parseConfigFileTextToJson = parseConfigFileTextToJson; - function generateTSConfig(options, fileNames) { + function generateTSConfig(options, fileNames, newLine) { var compilerOptions = ts.extend(options, ts.defaultInitCompilerOptions); var configurations = { compilerOptions: serializeCompilerOptions(compilerOptions) @@ -50985,7 +55263,7 @@ var ts; if (fileNames && fileNames.length) { configurations.files = fileNames; } - return configurations; + return writeConfigurations(); function getCustomTypeMapOfCommandLineOption(optionDefinition) { if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean") { return undefined; @@ -50998,53 +55276,121 @@ var ts; } } function getNameOfCompilerOptionValue(value, customTypeMap) { - for (var key in customTypeMap) { - if (customTypeMap[key] === value) { + return ts.forEachEntry(customTypeMap, function (mapValue, key) { + if (mapValue === value) { return key; } - } - return undefined; + }); } function serializeCompilerOptions(options) { - var result = ts.createMap(); + var result = {}; var optionsNameMap = getOptionNameMap().optionNameMap; - for (var name_42 in options) { - if (ts.hasProperty(options, name_42)) { - switch (name_42) { - case "init": - case "watch": - case "version": - case "help": - case "project": - break; - default: - var value = options[name_42]; - var optionDefinition = optionsNameMap[name_42.toLowerCase()]; - if (optionDefinition) { - var customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition); - if (!customTypeMap) { - result[name_42] = value; - } - else { - if (optionDefinition.type === "list") { - var convertedValue = []; - for (var _i = 0, _a = value; _i < _a.length; _i++) { - var element = _a[_i]; - convertedValue.push(getNameOfCompilerOptionValue(element, customTypeMap)); - } - result[name_42] = convertedValue; - } - else { - result[name_42] = getNameOfCompilerOptionValue(value, customTypeMap); - } + for (var name in options) { + if (ts.hasProperty(options, name)) { + if (optionsNameMap.has(name) && optionsNameMap.get(name).category === ts.Diagnostics.Command_line_Options) { + continue; + } + var value = options[name]; + var optionDefinition = optionsNameMap.get(name.toLowerCase()); + if (optionDefinition) { + var customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition); + if (!customTypeMap) { + result[name] = value; + } + else { + if (optionDefinition.type === "list") { + var convertedValue = []; + for (var _i = 0, _a = value; _i < _a.length; _i++) { + var element = _a[_i]; + convertedValue.push(getNameOfCompilerOptionValue(element, customTypeMap)); } + result[name] = convertedValue; } - break; + else { + result[name] = getNameOfCompilerOptionValue(value, customTypeMap); + } + } } } } return result; } + function getDefaultValueForOption(option) { + switch (option.type) { + case "number": + return 1; + case "boolean": + return true; + case "string": + return option.isFilePath ? "./" : ""; + case "list": + return []; + case "object": + return {}; + default: + return ts.arrayFrom(option.type.keys())[0]; + } + } + function makePadding(paddingLength) { + return Array(paddingLength + 1).join(" "); + } + function writeConfigurations() { + var categorizedOptions = ts.reduceLeft(ts.filter(ts.optionDeclarations, function (o) { return o.category !== ts.Diagnostics.Command_line_Options && o.category !== ts.Diagnostics.Advanced_Options; }), function (memo, value) { + if (value.category) { + var name = ts.getLocaleSpecificMessage(value.category); + (memo[name] || (memo[name] = [])).push(value); + } + return memo; + }, {}); + var marginLength = 0; + var seenKnownKeys = 0; + var nameColumn = []; + var descriptionColumn = []; + var knownKeysCount = ts.getOwnKeys(configurations.compilerOptions).length; + for (var category in categorizedOptions) { + if (nameColumn.length !== 0) { + nameColumn.push(""); + descriptionColumn.push(""); + } + nameColumn.push("/* " + category + " */"); + descriptionColumn.push(""); + for (var _i = 0, _a = categorizedOptions[category]; _i < _a.length; _i++) { + var option = _a[_i]; + var optionName = void 0; + if (ts.hasProperty(configurations.compilerOptions, option.name)) { + optionName = "\"" + option.name + "\": " + JSON.stringify(configurations.compilerOptions[option.name]) + ((seenKnownKeys += 1) === knownKeysCount ? "" : ","); + } + else { + optionName = "// \"" + option.name + "\": " + JSON.stringify(getDefaultValueForOption(option)) + ","; + } + nameColumn.push(optionName); + descriptionColumn.push("/* " + (option.description && ts.getLocaleSpecificMessage(option.description) || option.name) + " */"); + marginLength = Math.max(optionName.length, marginLength); + } + } + var tab = makePadding(2); + var result = []; + result.push("{"); + result.push(tab + "\"compilerOptions\": {"); + for (var i = 0; i < nameColumn.length; i++) { + var optionName = nameColumn[i]; + var description = descriptionColumn[i]; + result.push(tab + tab + optionName + makePadding(marginLength - optionName.length + 2) + description); + } + if (configurations.files && configurations.files.length) { + result.push(tab + "},"); + result.push(tab + "\"files\": ["); + for (var i = 0; i < configurations.files.length; i++) { + result.push("" + tab + tab + JSON.stringify(configurations.files[i]) + (i === configurations.files.length - 1 ? "" : ",")); + } + result.push(tab + "]"); + } + else { + result.push(tab + "}"); + } + result.push("}"); + return result.join(newLine); + } } ts.generateTSConfig = generateTSConfig; function removeComments(jsonText) { @@ -51064,10 +55410,12 @@ var ts; } return output; } - function parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack) { + function parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions) { if (existingOptions === void 0) { existingOptions = {}; } if (resolutionStack === void 0) { resolutionStack = []; } + if (extraFileExtensions === void 0) { extraFileExtensions = []; } var errors = []; + basePath = ts.normalizeSlashes(basePath); var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames); var resolvedPath = ts.toPath(configFileName || "", basePath, getCanonicalFileName); if (resolutionStack.indexOf(resolvedPath) >= 0) { @@ -51189,7 +55537,7 @@ var ts; if (fileNames === undefined && includeSpecs === undefined) { includeSpecs = ["**/*"]; } - var result = matchFileNames(fileNames, includeSpecs, excludeSpecs, basePath, options, host, errors); + var result = matchFileNames(fileNames, includeSpecs, excludeSpecs, basePath, options, host, errors, extraFileExtensions); if (result.fileNames.length === 0 && !ts.hasProperty(json, "files") && resolutionStack.length === 0) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, configFileName || "tsconfig.json", JSON.stringify(includeSpecs || []), JSON.stringify(excludeSpecs || []))); } @@ -51240,8 +55588,8 @@ var ts; } var optionNameMap = ts.arrayToMap(optionDeclarations, function (opt) { return opt.name; }); for (var id in jsonOptions) { - if (id in optionNameMap) { - var opt = optionNameMap[id]; + var opt = optionNameMap.get(id); + if (opt) { defaultOptions[opt.name] = convertJsonOption(opt, jsonOptions[id], basePath, errors); } else { @@ -51275,8 +55623,9 @@ var ts; } function convertJsonOptionOfCustomType(opt, value, errors) { var key = value.toLowerCase(); - if (key in opt.type) { - return opt.type[key]; + var val = opt.type.get(key); + if (val !== undefined) { + return val; } else { errors.push(createCompilerDiagnosticForInvalidCustomType(opt)); @@ -51293,7 +55642,7 @@ var ts; var invalidDotDotAfterRecursiveWildcardPattern = /(^|\/)\*\*\/(.*\/)?\.\.($|\/)/; var watchRecursivePattern = /\/[^/]*?[*?][^/]*\//; var wildcardDirectoryPattern = /^[^*?]*(?=\/[^/]*[*?])/; - function matchFileNames(fileNames, include, exclude, basePath, options, host, errors) { + function matchFileNames(fileNames, include, exclude, basePath, options, host, errors, extraFileExtensions) { basePath = ts.normalizePath(basePath); var keyMapper = host.useCaseSensitiveFileNames ? caseSensitiveKeyMapper : caseInsensitiveKeyMapper; var literalFileMap = ts.createMap(); @@ -51305,12 +55654,12 @@ var ts; exclude = validateSpecs(exclude, errors, true); } var wildcardDirectories = getWildcardDirectories(include, exclude, basePath, host.useCaseSensitiveFileNames); - var supportedExtensions = ts.getSupportedExtensions(options); + var supportedExtensions = ts.getSupportedExtensions(options, extraFileExtensions); if (fileNames) { for (var _i = 0, fileNames_1 = fileNames; _i < fileNames_1.length; _i++) { var fileName = fileNames_1[_i]; var file = ts.combinePaths(basePath, fileName); - literalFileMap[keyMapper(file)] = file; + literalFileMap.set(keyMapper(file), file); } } if (include && include.length > 0) { @@ -51321,14 +55670,13 @@ var ts; } removeWildcardFilesWithLowerPriorityExtension(file, wildcardFileMap, supportedExtensions, keyMapper); var key = keyMapper(file); - if (!(key in literalFileMap) && !(key in wildcardFileMap)) { - wildcardFileMap[key] = file; + if (!literalFileMap.has(key) && !wildcardFileMap.has(key)) { + wildcardFileMap.set(key, file); } } } - var literalFiles = ts.reduceProperties(literalFileMap, addFileToOutput, []); - var wildcardFiles = ts.reduceProperties(wildcardFileMap, addFileToOutput, []); - wildcardFiles.sort(host.useCaseSensitiveFileNames ? ts.compareStrings : ts.compareStringsCaseInsensitive); + var literalFiles = ts.arrayFrom(literalFileMap.values()); + var wildcardFiles = ts.arrayFrom(wildcardFileMap.values()); return { fileNames: literalFiles.concat(wildcardFiles), wildcardDirectories: wildcardDirectories @@ -51336,8 +55684,8 @@ var ts; } function validateSpecs(specs, errors, allowTrailingRecursion) { var validSpecs = []; - for (var _i = 0, specs_2 = specs; _i < specs_2.length; _i++) { - var spec = specs_2[_i]; + for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) { + var spec = specs_1[_i]; if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); } @@ -51356,7 +55704,7 @@ var ts; function getWildcardDirectories(include, exclude, path, useCaseSensitiveFileNames) { var rawExcludeRegex = ts.getRegularExpressionForWildcard(exclude, path, "exclude"); var excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames ? "" : "i"); - var wildcardDirectories = ts.createMap(); + var wildcardDirectories = {}; if (include !== undefined) { var recursiveKeys = []; for (var _i = 0, include_1 = include; _i < include_1.length; _i++) { @@ -51377,14 +55725,15 @@ var ts; } } } - for (var key in wildcardDirectories) { - for (var _a = 0, recursiveKeys_1 = recursiveKeys; _a < recursiveKeys_1.length; _a++) { - var recursiveKey = recursiveKeys_1[_a]; - if (key !== recursiveKey && ts.containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) { - delete wildcardDirectories[key]; + for (var key in wildcardDirectories) + if (ts.hasProperty(wildcardDirectories, key)) { + for (var _a = 0, recursiveKeys_1 = recursiveKeys; _a < recursiveKeys_1.length; _a++) { + var recursiveKey = recursiveKeys_1[_a]; + if (key !== recursiveKey && ts.containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) { + delete wildcardDirectories[key]; + } } } - } } return wildcardDirectories; } @@ -51403,11 +55752,11 @@ var ts; } function hasFileWithHigherPriorityExtension(file, literalFiles, wildcardFiles, extensions, keyMapper) { var extensionPriority = ts.getExtensionPriority(file, extensions); - var adjustedExtensionPriority = ts.adjustExtensionPriority(extensionPriority); + var adjustedExtensionPriority = ts.adjustExtensionPriority(extensionPriority, extensions); for (var i = 0; i < adjustedExtensionPriority; i++) { var higherPriorityExtension = extensions[i]; var higherPriorityPath = keyMapper(ts.changeExtension(file, higherPriorityExtension)); - if (higherPriorityPath in literalFiles || higherPriorityPath in wildcardFiles) { + if (literalFiles.has(higherPriorityPath) || wildcardFiles.has(higherPriorityPath)) { return true; } } @@ -51415,17 +55764,13 @@ var ts; } function removeWildcardFilesWithLowerPriorityExtension(file, wildcardFiles, extensions, keyMapper) { var extensionPriority = ts.getExtensionPriority(file, extensions); - var nextExtensionPriority = ts.getNextLowestExtensionPriority(extensionPriority); + var nextExtensionPriority = ts.getNextLowestExtensionPriority(extensionPriority, extensions); for (var i = nextExtensionPriority; i < extensions.length; i++) { var lowerPriorityExtension = extensions[i]; var lowerPriorityPath = keyMapper(ts.changeExtension(file, lowerPriorityExtension)); - delete wildcardFiles[lowerPriorityPath]; + wildcardFiles.delete(lowerPriorityPath); } } - function addFileToOutput(output, file) { - output.push(file); - return output; - } function caseSensitiveKeyMapper(key) { return key; } @@ -51451,7 +55796,7 @@ var ts; } } function reportEmittedFiles(files) { - if (!files || files.length == 0) { + if (!files || files.length === 0) { return; } var currentDir = ts.sys.getCurrentDirectory(); @@ -51486,20 +55831,22 @@ var ts; var gutterSeparator = " "; var resetEscapeSequence = "\u001b[0m"; var ellipsis = "..."; - var categoryFormatMap = ts.createMap((_a = {}, - _a[ts.DiagnosticCategory.Warning] = yellowForegroundEscapeSequence, - _a[ts.DiagnosticCategory.Error] = redForegroundEscapeSequence, - _a[ts.DiagnosticCategory.Message] = blueForegroundEscapeSequence, - _a)); + function getCategoryFormat(category) { + switch (category) { + case ts.DiagnosticCategory.Warning: return yellowForegroundEscapeSequence; + case ts.DiagnosticCategory.Error: return redForegroundEscapeSequence; + case ts.DiagnosticCategory.Message: return blueForegroundEscapeSequence; + } + } function formatAndReset(text, formatStyle) { return formatStyle + text + resetEscapeSequence; } function reportDiagnosticWithColorAndContext(diagnostic, host) { var output = ""; if (diagnostic.file) { - var start = diagnostic.start, length_4 = diagnostic.length, file = diagnostic.file; + var start = diagnostic.start, length_5 = diagnostic.length, file = diagnostic.file; var _a = ts.getLineAndCharacterOfPosition(file, start), firstLine = _a.line, firstLineChar = _a.character; - var _b = ts.getLineAndCharacterOfPosition(file, start + length_4), lastLine = _b.line, lastLineChar = _b.character; + var _b = ts.getLineAndCharacterOfPosition(file, start + length_5), lastLine = _b.line, lastLineChar = _b.character; var lastLineInFile = ts.getLineAndCharacterOfPosition(file, file.text.length).line; var relativeFileName = host ? ts.convertToRelativePath(file.fileName, host.getCurrentDirectory(), function (fileName) { return host.getCanonicalFileName(fileName); }) : file.fileName; var hasMoreThanFiveLines = (lastLine - firstLine) >= 4; @@ -51539,7 +55886,7 @@ var ts; output += ts.sys.newLine; output += relativeFileName + "(" + (firstLine + 1) + "," + (firstLineChar + 1) + "): "; } - var categoryColor = categoryFormatMap[diagnostic.category]; + var categoryColor = getCategoryFormat(diagnostic.category); var category = ts.DiagnosticCategory[diagnostic.category].toLowerCase(); output += formatAndReset(category, categoryColor) + " TS" + diagnostic.code + ": " + ts.flattenDiagnosticMessageText(diagnostic.messageText, ts.sys.newLine); output += ts.sys.newLine + ts.sys.newLine; @@ -51551,7 +55898,7 @@ var ts; var loc = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start); output += diagnostic.file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + "): "; } - output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, ts.sys.newLine) + ts.sys.newLine; + output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, ts.sys.newLine) + (ts.sys.newLine + ts.sys.newLine + ts.sys.newLine); ts.sys.write(output); } function padLeft(s, length) { @@ -51603,9 +55950,9 @@ var ts; printVersion(); return ts.sys.exit(ts.ExitStatus.Success); } - if (commandLine.options.help) { + if (commandLine.options.help || commandLine.options.all) { printVersion(); - printHelp(); + printHelp(commandLine.options.all); return ts.sys.exit(ts.ExitStatus.Success); } if (commandLine.options.project) { @@ -51639,7 +55986,7 @@ var ts; } if (commandLine.fileNames.length === 0 && !configFileName) { printVersion(); - printHelp(); + printHelp(commandLine.options.all); return ts.sys.exit(ts.ExitStatus.Success); } if (ts.isWatchSet(commandLine.options)) { @@ -51652,7 +55999,7 @@ var ts; } if (ts.sys.watchDirectory && configFileName) { var directory = ts.getDirectoryPath(configFileName); - directoryWatcher = ts.sys.watchDirectory(directory == "" ? "." : directory, watchedDirectoryChanged, true); + directoryWatcher = ts.sys.watchDirectory(directory === "" ? "." : directory, watchedDirectoryChanged, true); } } performCompilation(); @@ -51695,9 +56042,8 @@ var ts; } if (!directoryWatcher && ts.sys.watchDirectory && configFileName) { var directory = ts.getDirectoryPath(configFileName); - directoryWatcher = ts.sys.watchDirectory(directory == "" ? "." : directory, watchedDirectoryChanged, true); + directoryWatcher = ts.sys.watchDirectory(directory === "" ? "." : directory, watchedDirectoryChanged, true); } - ; } return configParseResult; } @@ -51730,9 +56076,11 @@ var ts; reportWatchDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.Compilation_complete_Watching_for_file_changes)); } function cachedFileExists(fileName) { - return fileName in cachedExistingFiles - ? cachedExistingFiles[fileName] - : cachedExistingFiles[fileName] = hostFileExists(fileName); + var fileExists = cachedExistingFiles.get(fileName); + if (fileExists === undefined) { + cachedExistingFiles.set(fileName, fileExists = hostFileExists(fileName)); + } + return fileExists; } function getSourceFile(fileName, languageVersion, onError) { if (cachedProgram) { @@ -51884,17 +56232,17 @@ var ts; var nameSize = 0; var valueSize = 0; for (var _i = 0, statistics_1 = statistics; _i < statistics_1.length; _i++) { - var _a = statistics_1[_i], name_43 = _a.name, value = _a.value; - if (name_43.length > nameSize) { - nameSize = name_43.length; + var _a = statistics_1[_i], name = _a.name, value = _a.value; + if (name.length > nameSize) { + nameSize = name.length; } if (value.length > valueSize) { valueSize = value.length; } } for (var _b = 0, statistics_2 = statistics; _b < statistics_2.length; _b++) { - var _c = statistics_2[_b], name_44 = _c.name, value = _c.value; - ts.sys.write(padRight(name_44 + ":", nameSize + 2) + padLeft(value.toString(), valueSize) + ts.sys.newLine); + var _c = statistics_2[_b], name = _c.name, value = _c.value; + ts.sys.write(padRight(name + ":", nameSize + 2) + padLeft(value.toString(), valueSize) + ts.sys.newLine); } } function reportStatisticalValue(name, value) { @@ -51910,7 +56258,7 @@ var ts; function printVersion() { ts.sys.write(getDiagnosticText(ts.Diagnostics.Version_0, ts.version) + ts.sys.newLine); } - function printHelp() { + function printHelp(showAllOptions) { var output = []; var syntaxLength = getDiagnosticText(ts.Diagnostics.Syntax_Colon_0, "").length; var examplesLength = getDiagnosticText(ts.Diagnostics.Examples_Colon_0, "").length; @@ -51925,8 +56273,9 @@ var ts; output.push(padding + "tsc @args.txt" + ts.sys.newLine); output.push(ts.sys.newLine); output.push(getDiagnosticText(ts.Diagnostics.Options_Colon) + ts.sys.newLine); - var optsList = ts.filter(ts.optionDeclarations.slice(), function (v) { return !v.experimental; }); - optsList.sort(function (a, b) { return ts.compareValues(a.name.toLowerCase(), b.name.toLowerCase()); }); + var optsList = showAllOptions ? + ts.optionDeclarations.slice().sort(function (a, b) { return ts.compareValues(a.name.toLowerCase(), b.name.toLowerCase()); }) : + ts.filter(ts.optionDeclarations.slice(), function (v) { return v.showInSimplifiedHelpView; }); marginLength = 0; var usageColumn = []; var descriptionColumn = []; @@ -51948,13 +56297,9 @@ var ts; var description = void 0; if (option.name === "lib") { description = getDiagnosticText(option.description); - var options = []; var element = option.element; var typeMap = element.type; - for (var key in typeMap) { - options.push("'" + key + "'"); - } - optionsDescriptionMap[description] = options; + optionsDescriptionMap.set(description, ts.arrayFrom(typeMap.keys()).map(function (key) { return "'" + key + "'"; })); } else { description = getDiagnosticText(option.description); @@ -51969,7 +56314,7 @@ var ts; for (var i = 0; i < usageColumn.length; i++) { var usage = usageColumn[i]; var description = descriptionColumn[i]; - var kindsList = optionsDescriptionMap[description]; + var kindsList = optionsDescriptionMap.get(description); output.push(usage + makePadding(marginLength - usage.length + 2) + description + ts.sys.newLine); if (kindsList) { output.push(makePadding(marginLength + 4)); @@ -52002,12 +56347,11 @@ var ts; reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.A_tsconfig_json_file_is_already_defined_at_Colon_0, file), undefined); } else { - ts.sys.writeFile(file, JSON.stringify(ts.generateTSConfig(options, fileNames), undefined, 4)); + ts.sys.writeFile(file, ts.generateTSConfig(options, fileNames, ts.sys.newLine)); reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.Successfully_created_a_tsconfig_json_file), undefined); } return; } - var _a; })(ts || (ts = {})); if (ts.sys.tryEnableSourceMapsForHost && /^development$/i.test(ts.sys.getEnvironmentVariable("NODE_ENV"))) { ts.sys.tryEnableSourceMapsForHost(); diff --git a/node_modules/typescript/lib/tsserver.js b/node_modules/typescript/lib/tsserver.js index 51ba6b309..65d4969da 100644 --- a/node_modules/typescript/lib/tsserver.js +++ b/node_modules/typescript/lib/tsserver.js @@ -13,13 +13,455 @@ See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; }; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var ts; (function (ts) { + var SyntaxKind; + (function (SyntaxKind) { + SyntaxKind[SyntaxKind["Unknown"] = 0] = "Unknown"; + SyntaxKind[SyntaxKind["EndOfFileToken"] = 1] = "EndOfFileToken"; + SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 2] = "SingleLineCommentTrivia"; + SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 3] = "MultiLineCommentTrivia"; + SyntaxKind[SyntaxKind["NewLineTrivia"] = 4] = "NewLineTrivia"; + SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 5] = "WhitespaceTrivia"; + SyntaxKind[SyntaxKind["ShebangTrivia"] = 6] = "ShebangTrivia"; + SyntaxKind[SyntaxKind["ConflictMarkerTrivia"] = 7] = "ConflictMarkerTrivia"; + SyntaxKind[SyntaxKind["NumericLiteral"] = 8] = "NumericLiteral"; + SyntaxKind[SyntaxKind["StringLiteral"] = 9] = "StringLiteral"; + SyntaxKind[SyntaxKind["JsxText"] = 10] = "JsxText"; + SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 11] = "RegularExpressionLiteral"; + SyntaxKind[SyntaxKind["NoSubstitutionTemplateLiteral"] = 12] = "NoSubstitutionTemplateLiteral"; + SyntaxKind[SyntaxKind["TemplateHead"] = 13] = "TemplateHead"; + SyntaxKind[SyntaxKind["TemplateMiddle"] = 14] = "TemplateMiddle"; + SyntaxKind[SyntaxKind["TemplateTail"] = 15] = "TemplateTail"; + SyntaxKind[SyntaxKind["OpenBraceToken"] = 16] = "OpenBraceToken"; + SyntaxKind[SyntaxKind["CloseBraceToken"] = 17] = "CloseBraceToken"; + SyntaxKind[SyntaxKind["OpenParenToken"] = 18] = "OpenParenToken"; + SyntaxKind[SyntaxKind["CloseParenToken"] = 19] = "CloseParenToken"; + SyntaxKind[SyntaxKind["OpenBracketToken"] = 20] = "OpenBracketToken"; + SyntaxKind[SyntaxKind["CloseBracketToken"] = 21] = "CloseBracketToken"; + SyntaxKind[SyntaxKind["DotToken"] = 22] = "DotToken"; + SyntaxKind[SyntaxKind["DotDotDotToken"] = 23] = "DotDotDotToken"; + SyntaxKind[SyntaxKind["SemicolonToken"] = 24] = "SemicolonToken"; + SyntaxKind[SyntaxKind["CommaToken"] = 25] = "CommaToken"; + SyntaxKind[SyntaxKind["LessThanToken"] = 26] = "LessThanToken"; + SyntaxKind[SyntaxKind["LessThanSlashToken"] = 27] = "LessThanSlashToken"; + SyntaxKind[SyntaxKind["GreaterThanToken"] = 28] = "GreaterThanToken"; + SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 29] = "LessThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 30] = "GreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 31] = "EqualsEqualsToken"; + SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 32] = "ExclamationEqualsToken"; + SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 33] = "EqualsEqualsEqualsToken"; + SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 34] = "ExclamationEqualsEqualsToken"; + SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 35] = "EqualsGreaterThanToken"; + SyntaxKind[SyntaxKind["PlusToken"] = 36] = "PlusToken"; + SyntaxKind[SyntaxKind["MinusToken"] = 37] = "MinusToken"; + SyntaxKind[SyntaxKind["AsteriskToken"] = 38] = "AsteriskToken"; + SyntaxKind[SyntaxKind["AsteriskAsteriskToken"] = 39] = "AsteriskAsteriskToken"; + SyntaxKind[SyntaxKind["SlashToken"] = 40] = "SlashToken"; + SyntaxKind[SyntaxKind["PercentToken"] = 41] = "PercentToken"; + SyntaxKind[SyntaxKind["PlusPlusToken"] = 42] = "PlusPlusToken"; + SyntaxKind[SyntaxKind["MinusMinusToken"] = 43] = "MinusMinusToken"; + SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 44] = "LessThanLessThanToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 45] = "GreaterThanGreaterThanToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 46] = "GreaterThanGreaterThanGreaterThanToken"; + SyntaxKind[SyntaxKind["AmpersandToken"] = 47] = "AmpersandToken"; + SyntaxKind[SyntaxKind["BarToken"] = 48] = "BarToken"; + SyntaxKind[SyntaxKind["CaretToken"] = 49] = "CaretToken"; + SyntaxKind[SyntaxKind["ExclamationToken"] = 50] = "ExclamationToken"; + SyntaxKind[SyntaxKind["TildeToken"] = 51] = "TildeToken"; + SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 52] = "AmpersandAmpersandToken"; + SyntaxKind[SyntaxKind["BarBarToken"] = 53] = "BarBarToken"; + SyntaxKind[SyntaxKind["QuestionToken"] = 54] = "QuestionToken"; + SyntaxKind[SyntaxKind["ColonToken"] = 55] = "ColonToken"; + SyntaxKind[SyntaxKind["AtToken"] = 56] = "AtToken"; + SyntaxKind[SyntaxKind["EqualsToken"] = 57] = "EqualsToken"; + SyntaxKind[SyntaxKind["PlusEqualsToken"] = 58] = "PlusEqualsToken"; + SyntaxKind[SyntaxKind["MinusEqualsToken"] = 59] = "MinusEqualsToken"; + SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 60] = "AsteriskEqualsToken"; + SyntaxKind[SyntaxKind["AsteriskAsteriskEqualsToken"] = 61] = "AsteriskAsteriskEqualsToken"; + SyntaxKind[SyntaxKind["SlashEqualsToken"] = 62] = "SlashEqualsToken"; + SyntaxKind[SyntaxKind["PercentEqualsToken"] = 63] = "PercentEqualsToken"; + SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 64] = "LessThanLessThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 65] = "GreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 66] = "GreaterThanGreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 67] = "AmpersandEqualsToken"; + SyntaxKind[SyntaxKind["BarEqualsToken"] = 68] = "BarEqualsToken"; + SyntaxKind[SyntaxKind["CaretEqualsToken"] = 69] = "CaretEqualsToken"; + SyntaxKind[SyntaxKind["Identifier"] = 70] = "Identifier"; + SyntaxKind[SyntaxKind["BreakKeyword"] = 71] = "BreakKeyword"; + SyntaxKind[SyntaxKind["CaseKeyword"] = 72] = "CaseKeyword"; + SyntaxKind[SyntaxKind["CatchKeyword"] = 73] = "CatchKeyword"; + SyntaxKind[SyntaxKind["ClassKeyword"] = 74] = "ClassKeyword"; + SyntaxKind[SyntaxKind["ConstKeyword"] = 75] = "ConstKeyword"; + SyntaxKind[SyntaxKind["ContinueKeyword"] = 76] = "ContinueKeyword"; + SyntaxKind[SyntaxKind["DebuggerKeyword"] = 77] = "DebuggerKeyword"; + SyntaxKind[SyntaxKind["DefaultKeyword"] = 78] = "DefaultKeyword"; + SyntaxKind[SyntaxKind["DeleteKeyword"] = 79] = "DeleteKeyword"; + SyntaxKind[SyntaxKind["DoKeyword"] = 80] = "DoKeyword"; + SyntaxKind[SyntaxKind["ElseKeyword"] = 81] = "ElseKeyword"; + SyntaxKind[SyntaxKind["EnumKeyword"] = 82] = "EnumKeyword"; + SyntaxKind[SyntaxKind["ExportKeyword"] = 83] = "ExportKeyword"; + SyntaxKind[SyntaxKind["ExtendsKeyword"] = 84] = "ExtendsKeyword"; + SyntaxKind[SyntaxKind["FalseKeyword"] = 85] = "FalseKeyword"; + SyntaxKind[SyntaxKind["FinallyKeyword"] = 86] = "FinallyKeyword"; + SyntaxKind[SyntaxKind["ForKeyword"] = 87] = "ForKeyword"; + SyntaxKind[SyntaxKind["FunctionKeyword"] = 88] = "FunctionKeyword"; + SyntaxKind[SyntaxKind["IfKeyword"] = 89] = "IfKeyword"; + SyntaxKind[SyntaxKind["ImportKeyword"] = 90] = "ImportKeyword"; + SyntaxKind[SyntaxKind["InKeyword"] = 91] = "InKeyword"; + SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 92] = "InstanceOfKeyword"; + SyntaxKind[SyntaxKind["NewKeyword"] = 93] = "NewKeyword"; + SyntaxKind[SyntaxKind["NullKeyword"] = 94] = "NullKeyword"; + SyntaxKind[SyntaxKind["ReturnKeyword"] = 95] = "ReturnKeyword"; + SyntaxKind[SyntaxKind["SuperKeyword"] = 96] = "SuperKeyword"; + SyntaxKind[SyntaxKind["SwitchKeyword"] = 97] = "SwitchKeyword"; + SyntaxKind[SyntaxKind["ThisKeyword"] = 98] = "ThisKeyword"; + SyntaxKind[SyntaxKind["ThrowKeyword"] = 99] = "ThrowKeyword"; + SyntaxKind[SyntaxKind["TrueKeyword"] = 100] = "TrueKeyword"; + SyntaxKind[SyntaxKind["TryKeyword"] = 101] = "TryKeyword"; + SyntaxKind[SyntaxKind["TypeOfKeyword"] = 102] = "TypeOfKeyword"; + SyntaxKind[SyntaxKind["VarKeyword"] = 103] = "VarKeyword"; + SyntaxKind[SyntaxKind["VoidKeyword"] = 104] = "VoidKeyword"; + SyntaxKind[SyntaxKind["WhileKeyword"] = 105] = "WhileKeyword"; + SyntaxKind[SyntaxKind["WithKeyword"] = 106] = "WithKeyword"; + SyntaxKind[SyntaxKind["ImplementsKeyword"] = 107] = "ImplementsKeyword"; + SyntaxKind[SyntaxKind["InterfaceKeyword"] = 108] = "InterfaceKeyword"; + SyntaxKind[SyntaxKind["LetKeyword"] = 109] = "LetKeyword"; + SyntaxKind[SyntaxKind["PackageKeyword"] = 110] = "PackageKeyword"; + SyntaxKind[SyntaxKind["PrivateKeyword"] = 111] = "PrivateKeyword"; + SyntaxKind[SyntaxKind["ProtectedKeyword"] = 112] = "ProtectedKeyword"; + SyntaxKind[SyntaxKind["PublicKeyword"] = 113] = "PublicKeyword"; + SyntaxKind[SyntaxKind["StaticKeyword"] = 114] = "StaticKeyword"; + SyntaxKind[SyntaxKind["YieldKeyword"] = 115] = "YieldKeyword"; + SyntaxKind[SyntaxKind["AbstractKeyword"] = 116] = "AbstractKeyword"; + SyntaxKind[SyntaxKind["AsKeyword"] = 117] = "AsKeyword"; + SyntaxKind[SyntaxKind["AnyKeyword"] = 118] = "AnyKeyword"; + SyntaxKind[SyntaxKind["AsyncKeyword"] = 119] = "AsyncKeyword"; + SyntaxKind[SyntaxKind["AwaitKeyword"] = 120] = "AwaitKeyword"; + SyntaxKind[SyntaxKind["BooleanKeyword"] = 121] = "BooleanKeyword"; + SyntaxKind[SyntaxKind["ConstructorKeyword"] = 122] = "ConstructorKeyword"; + SyntaxKind[SyntaxKind["DeclareKeyword"] = 123] = "DeclareKeyword"; + SyntaxKind[SyntaxKind["GetKeyword"] = 124] = "GetKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 125] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 126] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 127] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 128] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 129] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 130] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 131] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 132] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 133] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 134] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 135] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 136] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 137] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 138] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 139] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 140] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 141] = "OfKeyword"; + SyntaxKind[SyntaxKind["QualifiedName"] = 142] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 143] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["TypeParameter"] = 144] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 145] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 146] = "Decorator"; + SyntaxKind[SyntaxKind["PropertySignature"] = 147] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 148] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 149] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 150] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 151] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 152] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 153] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 154] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 155] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 156] = "IndexSignature"; + SyntaxKind[SyntaxKind["TypePredicate"] = 157] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 158] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 159] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 160] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 161] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 162] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 163] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 164] = "TupleType"; + SyntaxKind[SyntaxKind["UnionType"] = 165] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 166] = "IntersectionType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 167] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 168] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 169] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 170] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 171] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 172] = "LiteralType"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 173] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 174] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 175] = "BindingElement"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 176] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 177] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 178] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 179] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 180] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 181] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 182] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 183] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 184] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 185] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 186] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 187] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 188] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 189] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 190] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 191] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 192] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 193] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 194] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 195] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 196] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 197] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 198] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 199] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 200] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 201] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 202] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 203] = "MetaProperty"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 204] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 205] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["Block"] = 206] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 207] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 208] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 209] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 210] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 211] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 212] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 213] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 214] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 215] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 216] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 217] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 218] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 219] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 220] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 221] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 222] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 223] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 224] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 225] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 226] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 227] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 228] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 229] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 230] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 231] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 232] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 233] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 234] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 235] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 236] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 237] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 238] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 239] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 240] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 241] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 242] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 243] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 244] = "NamedExports"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 245] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 246] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 247] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["JsxElement"] = 248] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 249] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 250] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 251] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 252] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 253] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 254] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 255] = "JsxExpression"; + SyntaxKind[SyntaxKind["CaseClause"] = 256] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 257] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 258] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 259] = "CatchClause"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 260] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 261] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 262] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["EnumMember"] = 263] = "EnumMember"; + SyntaxKind[SyntaxKind["SourceFile"] = 264] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 265] = "Bundle"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 266] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 267] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 268] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocArrayType"] = 269] = "JSDocArrayType"; + SyntaxKind[SyntaxKind["JSDocUnionType"] = 270] = "JSDocUnionType"; + SyntaxKind[SyntaxKind["JSDocTupleType"] = 271] = "JSDocTupleType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 272] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 273] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocRecordType"] = 274] = "JSDocRecordType"; + SyntaxKind[SyntaxKind["JSDocRecordMember"] = 275] = "JSDocRecordMember"; + SyntaxKind[SyntaxKind["JSDocTypeReference"] = 276] = "JSDocTypeReference"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 277] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 278] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 279] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocConstructorType"] = 280] = "JSDocConstructorType"; + SyntaxKind[SyntaxKind["JSDocThisType"] = 281] = "JSDocThisType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 282] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTag"] = 283] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 284] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 285] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 286] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 287] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 288] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 289] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 290] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 291] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocLiteralType"] = 292] = "JSDocLiteralType"; + SyntaxKind[SyntaxKind["SyntaxList"] = 293] = "SyntaxList"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 294] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 295] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 296] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 297] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["Count"] = 298] = "Count"; + SyntaxKind[SyntaxKind["FirstAssignment"] = 57] = "FirstAssignment"; + SyntaxKind[SyntaxKind["LastAssignment"] = 69] = "LastAssignment"; + SyntaxKind[SyntaxKind["FirstCompoundAssignment"] = 58] = "FirstCompoundAssignment"; + SyntaxKind[SyntaxKind["LastCompoundAssignment"] = 69] = "LastCompoundAssignment"; + SyntaxKind[SyntaxKind["FirstReservedWord"] = 71] = "FirstReservedWord"; + SyntaxKind[SyntaxKind["LastReservedWord"] = 106] = "LastReservedWord"; + SyntaxKind[SyntaxKind["FirstKeyword"] = 71] = "FirstKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 141] = "LastKeyword"; + SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 107] = "FirstFutureReservedWord"; + SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 115] = "LastFutureReservedWord"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 157] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 172] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstPunctuation"] = 16] = "FirstPunctuation"; + SyntaxKind[SyntaxKind["LastPunctuation"] = 69] = "LastPunctuation"; + SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; + SyntaxKind[SyntaxKind["LastToken"] = 141] = "LastToken"; + SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; + SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; + SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; + SyntaxKind[SyntaxKind["LastLiteralToken"] = 12] = "LastLiteralToken"; + SyntaxKind[SyntaxKind["FirstTemplateToken"] = 12] = "FirstTemplateToken"; + SyntaxKind[SyntaxKind["LastTemplateToken"] = 15] = "LastTemplateToken"; + SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 26] = "FirstBinaryOperator"; + SyntaxKind[SyntaxKind["LastBinaryOperator"] = 69] = "LastBinaryOperator"; + SyntaxKind[SyntaxKind["FirstNode"] = 142] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 266] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 292] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 282] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 292] = "LastJSDocTagNode"; + })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); + var NodeFlags; + (function (NodeFlags) { + NodeFlags[NodeFlags["None"] = 0] = "None"; + NodeFlags[NodeFlags["Let"] = 1] = "Let"; + NodeFlags[NodeFlags["Const"] = 2] = "Const"; + NodeFlags[NodeFlags["NestedNamespace"] = 4] = "NestedNamespace"; + NodeFlags[NodeFlags["Synthesized"] = 8] = "Synthesized"; + NodeFlags[NodeFlags["Namespace"] = 16] = "Namespace"; + NodeFlags[NodeFlags["ExportContext"] = 32] = "ExportContext"; + NodeFlags[NodeFlags["ContainsThis"] = 64] = "ContainsThis"; + NodeFlags[NodeFlags["HasImplicitReturn"] = 128] = "HasImplicitReturn"; + NodeFlags[NodeFlags["HasExplicitReturn"] = 256] = "HasExplicitReturn"; + NodeFlags[NodeFlags["GlobalAugmentation"] = 512] = "GlobalAugmentation"; + NodeFlags[NodeFlags["HasAsyncFunctions"] = 1024] = "HasAsyncFunctions"; + NodeFlags[NodeFlags["DisallowInContext"] = 2048] = "DisallowInContext"; + NodeFlags[NodeFlags["YieldContext"] = 4096] = "YieldContext"; + NodeFlags[NodeFlags["DecoratorContext"] = 8192] = "DecoratorContext"; + NodeFlags[NodeFlags["AwaitContext"] = 16384] = "AwaitContext"; + NodeFlags[NodeFlags["ThisNodeHasError"] = 32768] = "ThisNodeHasError"; + NodeFlags[NodeFlags["JavaScriptFile"] = 65536] = "JavaScriptFile"; + NodeFlags[NodeFlags["ThisNodeOrAnySubNodesHasError"] = 131072] = "ThisNodeOrAnySubNodesHasError"; + NodeFlags[NodeFlags["HasAggregatedChildData"] = 262144] = "HasAggregatedChildData"; + NodeFlags[NodeFlags["BlockScoped"] = 3] = "BlockScoped"; + NodeFlags[NodeFlags["ReachabilityCheckFlags"] = 384] = "ReachabilityCheckFlags"; + NodeFlags[NodeFlags["ReachabilityAndEmitFlags"] = 1408] = "ReachabilityAndEmitFlags"; + NodeFlags[NodeFlags["ContextFlags"] = 96256] = "ContextFlags"; + NodeFlags[NodeFlags["TypeExcludesFlags"] = 20480] = "TypeExcludesFlags"; + })(NodeFlags = ts.NodeFlags || (ts.NodeFlags = {})); + var ModifierFlags; + (function (ModifierFlags) { + ModifierFlags[ModifierFlags["None"] = 0] = "None"; + ModifierFlags[ModifierFlags["Export"] = 1] = "Export"; + ModifierFlags[ModifierFlags["Ambient"] = 2] = "Ambient"; + ModifierFlags[ModifierFlags["Public"] = 4] = "Public"; + ModifierFlags[ModifierFlags["Private"] = 8] = "Private"; + ModifierFlags[ModifierFlags["Protected"] = 16] = "Protected"; + ModifierFlags[ModifierFlags["Static"] = 32] = "Static"; + ModifierFlags[ModifierFlags["Readonly"] = 64] = "Readonly"; + ModifierFlags[ModifierFlags["Abstract"] = 128] = "Abstract"; + ModifierFlags[ModifierFlags["Async"] = 256] = "Async"; + ModifierFlags[ModifierFlags["Default"] = 512] = "Default"; + ModifierFlags[ModifierFlags["Const"] = 2048] = "Const"; + ModifierFlags[ModifierFlags["HasComputedFlags"] = 536870912] = "HasComputedFlags"; + ModifierFlags[ModifierFlags["AccessibilityModifier"] = 28] = "AccessibilityModifier"; + ModifierFlags[ModifierFlags["ParameterPropertyModifier"] = 92] = "ParameterPropertyModifier"; + ModifierFlags[ModifierFlags["NonPublicAccessibilityModifier"] = 24] = "NonPublicAccessibilityModifier"; + ModifierFlags[ModifierFlags["TypeScriptModifier"] = 2270] = "TypeScriptModifier"; + ModifierFlags[ModifierFlags["ExportDefault"] = 513] = "ExportDefault"; + })(ModifierFlags = ts.ModifierFlags || (ts.ModifierFlags = {})); + var JsxFlags; + (function (JsxFlags) { + JsxFlags[JsxFlags["None"] = 0] = "None"; + JsxFlags[JsxFlags["IntrinsicNamedElement"] = 1] = "IntrinsicNamedElement"; + JsxFlags[JsxFlags["IntrinsicIndexedElement"] = 2] = "IntrinsicIndexedElement"; + JsxFlags[JsxFlags["IntrinsicElement"] = 3] = "IntrinsicElement"; + })(JsxFlags = ts.JsxFlags || (ts.JsxFlags = {})); + var RelationComparisonResult; + (function (RelationComparisonResult) { + RelationComparisonResult[RelationComparisonResult["Succeeded"] = 1] = "Succeeded"; + RelationComparisonResult[RelationComparisonResult["Failed"] = 2] = "Failed"; + RelationComparisonResult[RelationComparisonResult["FailedAndReported"] = 3] = "FailedAndReported"; + })(RelationComparisonResult = ts.RelationComparisonResult || (ts.RelationComparisonResult = {})); + var GeneratedIdentifierKind; + (function (GeneratedIdentifierKind) { + GeneratedIdentifierKind[GeneratedIdentifierKind["None"] = 0] = "None"; + GeneratedIdentifierKind[GeneratedIdentifierKind["Auto"] = 1] = "Auto"; + GeneratedIdentifierKind[GeneratedIdentifierKind["Loop"] = 2] = "Loop"; + GeneratedIdentifierKind[GeneratedIdentifierKind["Unique"] = 3] = "Unique"; + GeneratedIdentifierKind[GeneratedIdentifierKind["Node"] = 4] = "Node"; + })(GeneratedIdentifierKind = ts.GeneratedIdentifierKind || (ts.GeneratedIdentifierKind = {})); + var NumericLiteralFlags; + (function (NumericLiteralFlags) { + NumericLiteralFlags[NumericLiteralFlags["None"] = 0] = "None"; + NumericLiteralFlags[NumericLiteralFlags["Scientific"] = 2] = "Scientific"; + NumericLiteralFlags[NumericLiteralFlags["Octal"] = 4] = "Octal"; + NumericLiteralFlags[NumericLiteralFlags["HexSpecifier"] = 8] = "HexSpecifier"; + NumericLiteralFlags[NumericLiteralFlags["BinarySpecifier"] = 16] = "BinarySpecifier"; + NumericLiteralFlags[NumericLiteralFlags["OctalSpecifier"] = 32] = "OctalSpecifier"; + NumericLiteralFlags[NumericLiteralFlags["BinaryOrOctalSpecifier"] = 48] = "BinaryOrOctalSpecifier"; + })(NumericLiteralFlags = ts.NumericLiteralFlags || (ts.NumericLiteralFlags = {})); + var FlowFlags; + (function (FlowFlags) { + FlowFlags[FlowFlags["Unreachable"] = 1] = "Unreachable"; + FlowFlags[FlowFlags["Start"] = 2] = "Start"; + FlowFlags[FlowFlags["BranchLabel"] = 4] = "BranchLabel"; + FlowFlags[FlowFlags["LoopLabel"] = 8] = "LoopLabel"; + FlowFlags[FlowFlags["Assignment"] = 16] = "Assignment"; + FlowFlags[FlowFlags["TrueCondition"] = 32] = "TrueCondition"; + FlowFlags[FlowFlags["FalseCondition"] = 64] = "FalseCondition"; + FlowFlags[FlowFlags["SwitchClause"] = 128] = "SwitchClause"; + FlowFlags[FlowFlags["ArrayMutation"] = 256] = "ArrayMutation"; + FlowFlags[FlowFlags["Referenced"] = 512] = "Referenced"; + FlowFlags[FlowFlags["Shared"] = 1024] = "Shared"; + FlowFlags[FlowFlags["PreFinally"] = 2048] = "PreFinally"; + FlowFlags[FlowFlags["AfterFinally"] = 4096] = "AfterFinally"; + FlowFlags[FlowFlags["Label"] = 12] = "Label"; + FlowFlags[FlowFlags["Condition"] = 96] = "Condition"; + })(FlowFlags = ts.FlowFlags || (ts.FlowFlags = {})); var OperationCanceledException = (function () { function OperationCanceledException() { } @@ -32,6 +474,55 @@ var ts; ExitStatus[ExitStatus["DiagnosticsPresent_OutputsSkipped"] = 1] = "DiagnosticsPresent_OutputsSkipped"; ExitStatus[ExitStatus["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated"; })(ExitStatus = ts.ExitStatus || (ts.ExitStatus = {})); + var NodeBuilderFlags; + (function (NodeBuilderFlags) { + NodeBuilderFlags[NodeBuilderFlags["None"] = 0] = "None"; + NodeBuilderFlags[NodeBuilderFlags["allowThisInObjectLiteral"] = 1] = "allowThisInObjectLiteral"; + NodeBuilderFlags[NodeBuilderFlags["allowQualifedNameInPlaceOfIdentifier"] = 2] = "allowQualifedNameInPlaceOfIdentifier"; + NodeBuilderFlags[NodeBuilderFlags["allowTypeParameterInQualifiedName"] = 4] = "allowTypeParameterInQualifiedName"; + NodeBuilderFlags[NodeBuilderFlags["allowAnonymousIdentifier"] = 8] = "allowAnonymousIdentifier"; + NodeBuilderFlags[NodeBuilderFlags["allowEmptyUnionOrIntersection"] = 16] = "allowEmptyUnionOrIntersection"; + NodeBuilderFlags[NodeBuilderFlags["allowEmptyTuple"] = 32] = "allowEmptyTuple"; + })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {})); + var TypeFormatFlags; + (function (TypeFormatFlags) { + TypeFormatFlags[TypeFormatFlags["None"] = 0] = "None"; + TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 1] = "WriteArrayAsGenericType"; + TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 2] = "UseTypeOfFunction"; + TypeFormatFlags[TypeFormatFlags["NoTruncation"] = 4] = "NoTruncation"; + TypeFormatFlags[TypeFormatFlags["WriteArrowStyleSignature"] = 8] = "WriteArrowStyleSignature"; + TypeFormatFlags[TypeFormatFlags["WriteOwnNameForAnyLike"] = 16] = "WriteOwnNameForAnyLike"; + TypeFormatFlags[TypeFormatFlags["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature"; + TypeFormatFlags[TypeFormatFlags["InElementType"] = 64] = "InElementType"; + TypeFormatFlags[TypeFormatFlags["UseFullyQualifiedType"] = 128] = "UseFullyQualifiedType"; + TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 256] = "InFirstTypeArgument"; + TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 512] = "InTypeAlias"; + TypeFormatFlags[TypeFormatFlags["UseTypeAliasValue"] = 1024] = "UseTypeAliasValue"; + TypeFormatFlags[TypeFormatFlags["SuppressAnyReturnType"] = 2048] = "SuppressAnyReturnType"; + TypeFormatFlags[TypeFormatFlags["AddUndefined"] = 4096] = "AddUndefined"; + })(TypeFormatFlags = ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); + var SymbolFormatFlags; + (function (SymbolFormatFlags) { + SymbolFormatFlags[SymbolFormatFlags["None"] = 0] = "None"; + SymbolFormatFlags[SymbolFormatFlags["WriteTypeParametersOrArguments"] = 1] = "WriteTypeParametersOrArguments"; + SymbolFormatFlags[SymbolFormatFlags["UseOnlyExternalAliasing"] = 2] = "UseOnlyExternalAliasing"; + })(SymbolFormatFlags = ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {})); + var SymbolAccessibility; + (function (SymbolAccessibility) { + SymbolAccessibility[SymbolAccessibility["Accessible"] = 0] = "Accessible"; + SymbolAccessibility[SymbolAccessibility["NotAccessible"] = 1] = "NotAccessible"; + SymbolAccessibility[SymbolAccessibility["CannotBeNamed"] = 2] = "CannotBeNamed"; + })(SymbolAccessibility = ts.SymbolAccessibility || (ts.SymbolAccessibility = {})); + var SyntheticSymbolKind; + (function (SyntheticSymbolKind) { + SyntheticSymbolKind[SyntheticSymbolKind["UnionOrIntersection"] = 0] = "UnionOrIntersection"; + SyntheticSymbolKind[SyntheticSymbolKind["Spread"] = 1] = "Spread"; + })(SyntheticSymbolKind = ts.SyntheticSymbolKind || (ts.SyntheticSymbolKind = {})); + var TypePredicateKind; + (function (TypePredicateKind) { + TypePredicateKind[TypePredicateKind["This"] = 0] = "This"; + TypePredicateKind[TypePredicateKind["Identifier"] = 1] = "Identifier"; + })(TypePredicateKind = ts.TypePredicateKind || (ts.TypePredicateKind = {})); var TypeReferenceSerializationKind; (function (TypeReferenceSerializationKind) { TypeReferenceSerializationKind[TypeReferenceSerializationKind["Unknown"] = 0] = "Unknown"; @@ -46,6 +537,191 @@ var ts; TypeReferenceSerializationKind[TypeReferenceSerializationKind["TypeWithCallSignature"] = 9] = "TypeWithCallSignature"; TypeReferenceSerializationKind[TypeReferenceSerializationKind["ObjectType"] = 10] = "ObjectType"; })(TypeReferenceSerializationKind = ts.TypeReferenceSerializationKind || (ts.TypeReferenceSerializationKind = {})); + var SymbolFlags; + (function (SymbolFlags) { + SymbolFlags[SymbolFlags["None"] = 0] = "None"; + SymbolFlags[SymbolFlags["FunctionScopedVariable"] = 1] = "FunctionScopedVariable"; + SymbolFlags[SymbolFlags["BlockScopedVariable"] = 2] = "BlockScopedVariable"; + SymbolFlags[SymbolFlags["Property"] = 4] = "Property"; + SymbolFlags[SymbolFlags["EnumMember"] = 8] = "EnumMember"; + SymbolFlags[SymbolFlags["Function"] = 16] = "Function"; + SymbolFlags[SymbolFlags["Class"] = 32] = "Class"; + SymbolFlags[SymbolFlags["Interface"] = 64] = "Interface"; + SymbolFlags[SymbolFlags["ConstEnum"] = 128] = "ConstEnum"; + SymbolFlags[SymbolFlags["RegularEnum"] = 256] = "RegularEnum"; + SymbolFlags[SymbolFlags["ValueModule"] = 512] = "ValueModule"; + SymbolFlags[SymbolFlags["NamespaceModule"] = 1024] = "NamespaceModule"; + SymbolFlags[SymbolFlags["TypeLiteral"] = 2048] = "TypeLiteral"; + SymbolFlags[SymbolFlags["ObjectLiteral"] = 4096] = "ObjectLiteral"; + SymbolFlags[SymbolFlags["Method"] = 8192] = "Method"; + SymbolFlags[SymbolFlags["Constructor"] = 16384] = "Constructor"; + SymbolFlags[SymbolFlags["GetAccessor"] = 32768] = "GetAccessor"; + SymbolFlags[SymbolFlags["SetAccessor"] = 65536] = "SetAccessor"; + SymbolFlags[SymbolFlags["Signature"] = 131072] = "Signature"; + SymbolFlags[SymbolFlags["TypeParameter"] = 262144] = "TypeParameter"; + SymbolFlags[SymbolFlags["TypeAlias"] = 524288] = "TypeAlias"; + SymbolFlags[SymbolFlags["ExportValue"] = 1048576] = "ExportValue"; + SymbolFlags[SymbolFlags["ExportType"] = 2097152] = "ExportType"; + SymbolFlags[SymbolFlags["ExportNamespace"] = 4194304] = "ExportNamespace"; + SymbolFlags[SymbolFlags["Alias"] = 8388608] = "Alias"; + SymbolFlags[SymbolFlags["Prototype"] = 16777216] = "Prototype"; + SymbolFlags[SymbolFlags["ExportStar"] = 33554432] = "ExportStar"; + SymbolFlags[SymbolFlags["Optional"] = 67108864] = "Optional"; + SymbolFlags[SymbolFlags["Transient"] = 134217728] = "Transient"; + SymbolFlags[SymbolFlags["Enum"] = 384] = "Enum"; + SymbolFlags[SymbolFlags["Variable"] = 3] = "Variable"; + SymbolFlags[SymbolFlags["Value"] = 107455] = "Value"; + SymbolFlags[SymbolFlags["Type"] = 793064] = "Type"; + SymbolFlags[SymbolFlags["Namespace"] = 1920] = "Namespace"; + SymbolFlags[SymbolFlags["Module"] = 1536] = "Module"; + SymbolFlags[SymbolFlags["Accessor"] = 98304] = "Accessor"; + SymbolFlags[SymbolFlags["FunctionScopedVariableExcludes"] = 107454] = "FunctionScopedVariableExcludes"; + SymbolFlags[SymbolFlags["BlockScopedVariableExcludes"] = 107455] = "BlockScopedVariableExcludes"; + SymbolFlags[SymbolFlags["ParameterExcludes"] = 107455] = "ParameterExcludes"; + SymbolFlags[SymbolFlags["PropertyExcludes"] = 0] = "PropertyExcludes"; + SymbolFlags[SymbolFlags["EnumMemberExcludes"] = 900095] = "EnumMemberExcludes"; + SymbolFlags[SymbolFlags["FunctionExcludes"] = 106927] = "FunctionExcludes"; + SymbolFlags[SymbolFlags["ClassExcludes"] = 899519] = "ClassExcludes"; + SymbolFlags[SymbolFlags["InterfaceExcludes"] = 792968] = "InterfaceExcludes"; + SymbolFlags[SymbolFlags["RegularEnumExcludes"] = 899327] = "RegularEnumExcludes"; + SymbolFlags[SymbolFlags["ConstEnumExcludes"] = 899967] = "ConstEnumExcludes"; + SymbolFlags[SymbolFlags["ValueModuleExcludes"] = 106639] = "ValueModuleExcludes"; + SymbolFlags[SymbolFlags["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes"; + SymbolFlags[SymbolFlags["MethodExcludes"] = 99263] = "MethodExcludes"; + SymbolFlags[SymbolFlags["GetAccessorExcludes"] = 41919] = "GetAccessorExcludes"; + SymbolFlags[SymbolFlags["SetAccessorExcludes"] = 74687] = "SetAccessorExcludes"; + SymbolFlags[SymbolFlags["TypeParameterExcludes"] = 530920] = "TypeParameterExcludes"; + SymbolFlags[SymbolFlags["TypeAliasExcludes"] = 793064] = "TypeAliasExcludes"; + SymbolFlags[SymbolFlags["AliasExcludes"] = 8388608] = "AliasExcludes"; + SymbolFlags[SymbolFlags["ModuleMember"] = 8914931] = "ModuleMember"; + SymbolFlags[SymbolFlags["ExportHasLocal"] = 944] = "ExportHasLocal"; + SymbolFlags[SymbolFlags["HasExports"] = 1952] = "HasExports"; + SymbolFlags[SymbolFlags["HasMembers"] = 6240] = "HasMembers"; + SymbolFlags[SymbolFlags["BlockScoped"] = 418] = "BlockScoped"; + SymbolFlags[SymbolFlags["PropertyOrAccessor"] = 98308] = "PropertyOrAccessor"; + SymbolFlags[SymbolFlags["Export"] = 7340032] = "Export"; + SymbolFlags[SymbolFlags["ClassMember"] = 106500] = "ClassMember"; + SymbolFlags[SymbolFlags["Classifiable"] = 788448] = "Classifiable"; + })(SymbolFlags = ts.SymbolFlags || (ts.SymbolFlags = {})); + var CheckFlags; + (function (CheckFlags) { + CheckFlags[CheckFlags["Instantiated"] = 1] = "Instantiated"; + CheckFlags[CheckFlags["SyntheticProperty"] = 2] = "SyntheticProperty"; + CheckFlags[CheckFlags["SyntheticMethod"] = 4] = "SyntheticMethod"; + CheckFlags[CheckFlags["Readonly"] = 8] = "Readonly"; + CheckFlags[CheckFlags["Partial"] = 16] = "Partial"; + CheckFlags[CheckFlags["HasNonUniformType"] = 32] = "HasNonUniformType"; + CheckFlags[CheckFlags["ContainsPublic"] = 64] = "ContainsPublic"; + CheckFlags[CheckFlags["ContainsProtected"] = 128] = "ContainsProtected"; + CheckFlags[CheckFlags["ContainsPrivate"] = 256] = "ContainsPrivate"; + CheckFlags[CheckFlags["ContainsStatic"] = 512] = "ContainsStatic"; + CheckFlags[CheckFlags["Synthetic"] = 6] = "Synthetic"; + })(CheckFlags = ts.CheckFlags || (ts.CheckFlags = {})); + var NodeCheckFlags; + (function (NodeCheckFlags) { + NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 1] = "TypeChecked"; + NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 2] = "LexicalThis"; + NodeCheckFlags[NodeCheckFlags["CaptureThis"] = 4] = "CaptureThis"; + NodeCheckFlags[NodeCheckFlags["CaptureNewTarget"] = 8] = "CaptureNewTarget"; + NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 256] = "SuperInstance"; + NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 512] = "SuperStatic"; + NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 1024] = "ContextChecked"; + NodeCheckFlags[NodeCheckFlags["AsyncMethodWithSuper"] = 2048] = "AsyncMethodWithSuper"; + NodeCheckFlags[NodeCheckFlags["AsyncMethodWithSuperBinding"] = 4096] = "AsyncMethodWithSuperBinding"; + NodeCheckFlags[NodeCheckFlags["CaptureArguments"] = 8192] = "CaptureArguments"; + NodeCheckFlags[NodeCheckFlags["EnumValuesComputed"] = 16384] = "EnumValuesComputed"; + NodeCheckFlags[NodeCheckFlags["LexicalModuleMergesWithClass"] = 32768] = "LexicalModuleMergesWithClass"; + NodeCheckFlags[NodeCheckFlags["LoopWithCapturedBlockScopedBinding"] = 65536] = "LoopWithCapturedBlockScopedBinding"; + NodeCheckFlags[NodeCheckFlags["CapturedBlockScopedBinding"] = 131072] = "CapturedBlockScopedBinding"; + NodeCheckFlags[NodeCheckFlags["BlockScopedBindingInLoop"] = 262144] = "BlockScopedBindingInLoop"; + NodeCheckFlags[NodeCheckFlags["ClassWithBodyScopedClassBinding"] = 524288] = "ClassWithBodyScopedClassBinding"; + NodeCheckFlags[NodeCheckFlags["BodyScopedClassBinding"] = 1048576] = "BodyScopedClassBinding"; + NodeCheckFlags[NodeCheckFlags["NeedsLoopOutParameter"] = 2097152] = "NeedsLoopOutParameter"; + NodeCheckFlags[NodeCheckFlags["AssignmentsMarked"] = 4194304] = "AssignmentsMarked"; + NodeCheckFlags[NodeCheckFlags["ClassWithConstructorReference"] = 8388608] = "ClassWithConstructorReference"; + NodeCheckFlags[NodeCheckFlags["ConstructorReferenceInClass"] = 16777216] = "ConstructorReferenceInClass"; + })(NodeCheckFlags = ts.NodeCheckFlags || (ts.NodeCheckFlags = {})); + var TypeFlags; + (function (TypeFlags) { + TypeFlags[TypeFlags["Any"] = 1] = "Any"; + TypeFlags[TypeFlags["String"] = 2] = "String"; + TypeFlags[TypeFlags["Number"] = 4] = "Number"; + TypeFlags[TypeFlags["Boolean"] = 8] = "Boolean"; + TypeFlags[TypeFlags["Enum"] = 16] = "Enum"; + TypeFlags[TypeFlags["StringLiteral"] = 32] = "StringLiteral"; + TypeFlags[TypeFlags["NumberLiteral"] = 64] = "NumberLiteral"; + TypeFlags[TypeFlags["BooleanLiteral"] = 128] = "BooleanLiteral"; + TypeFlags[TypeFlags["EnumLiteral"] = 256] = "EnumLiteral"; + TypeFlags[TypeFlags["ESSymbol"] = 512] = "ESSymbol"; + TypeFlags[TypeFlags["Void"] = 1024] = "Void"; + TypeFlags[TypeFlags["Undefined"] = 2048] = "Undefined"; + TypeFlags[TypeFlags["Null"] = 4096] = "Null"; + TypeFlags[TypeFlags["Never"] = 8192] = "Never"; + TypeFlags[TypeFlags["TypeParameter"] = 16384] = "TypeParameter"; + TypeFlags[TypeFlags["Object"] = 32768] = "Object"; + TypeFlags[TypeFlags["Union"] = 65536] = "Union"; + TypeFlags[TypeFlags["Intersection"] = 131072] = "Intersection"; + TypeFlags[TypeFlags["Index"] = 262144] = "Index"; + TypeFlags[TypeFlags["IndexedAccess"] = 524288] = "IndexedAccess"; + TypeFlags[TypeFlags["FreshLiteral"] = 1048576] = "FreshLiteral"; + TypeFlags[TypeFlags["ContainsWideningType"] = 2097152] = "ContainsWideningType"; + TypeFlags[TypeFlags["ContainsObjectLiteral"] = 4194304] = "ContainsObjectLiteral"; + TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 8388608] = "ContainsAnyFunctionType"; + TypeFlags[TypeFlags["NonPrimitive"] = 16777216] = "NonPrimitive"; + TypeFlags[TypeFlags["JsxAttributes"] = 33554432] = "JsxAttributes"; + TypeFlags[TypeFlags["Nullable"] = 6144] = "Nullable"; + TypeFlags[TypeFlags["Literal"] = 480] = "Literal"; + TypeFlags[TypeFlags["StringOrNumberLiteral"] = 96] = "StringOrNumberLiteral"; + TypeFlags[TypeFlags["DefinitelyFalsy"] = 7392] = "DefinitelyFalsy"; + TypeFlags[TypeFlags["PossiblyFalsy"] = 7406] = "PossiblyFalsy"; + TypeFlags[TypeFlags["Intrinsic"] = 16793231] = "Intrinsic"; + TypeFlags[TypeFlags["Primitive"] = 8190] = "Primitive"; + TypeFlags[TypeFlags["StringLike"] = 262178] = "StringLike"; + TypeFlags[TypeFlags["NumberLike"] = 340] = "NumberLike"; + TypeFlags[TypeFlags["BooleanLike"] = 136] = "BooleanLike"; + TypeFlags[TypeFlags["EnumLike"] = 272] = "EnumLike"; + TypeFlags[TypeFlags["UnionOrIntersection"] = 196608] = "UnionOrIntersection"; + TypeFlags[TypeFlags["StructuredType"] = 229376] = "StructuredType"; + TypeFlags[TypeFlags["StructuredOrTypeVariable"] = 1032192] = "StructuredOrTypeVariable"; + TypeFlags[TypeFlags["TypeVariable"] = 540672] = "TypeVariable"; + TypeFlags[TypeFlags["Narrowable"] = 17810431] = "Narrowable"; + TypeFlags[TypeFlags["NotUnionOrUnit"] = 16810497] = "NotUnionOrUnit"; + TypeFlags[TypeFlags["RequiresWidening"] = 6291456] = "RequiresWidening"; + TypeFlags[TypeFlags["PropagatingFlags"] = 14680064] = "PropagatingFlags"; + })(TypeFlags = ts.TypeFlags || (ts.TypeFlags = {})); + var ObjectFlags; + (function (ObjectFlags) { + ObjectFlags[ObjectFlags["Class"] = 1] = "Class"; + ObjectFlags[ObjectFlags["Interface"] = 2] = "Interface"; + ObjectFlags[ObjectFlags["Reference"] = 4] = "Reference"; + ObjectFlags[ObjectFlags["Tuple"] = 8] = "Tuple"; + ObjectFlags[ObjectFlags["Anonymous"] = 16] = "Anonymous"; + ObjectFlags[ObjectFlags["Mapped"] = 32] = "Mapped"; + ObjectFlags[ObjectFlags["Instantiated"] = 64] = "Instantiated"; + ObjectFlags[ObjectFlags["ObjectLiteral"] = 128] = "ObjectLiteral"; + ObjectFlags[ObjectFlags["EvolvingArray"] = 256] = "EvolvingArray"; + ObjectFlags[ObjectFlags["ObjectLiteralPatternWithComputedProperties"] = 512] = "ObjectLiteralPatternWithComputedProperties"; + ObjectFlags[ObjectFlags["ClassOrInterface"] = 3] = "ClassOrInterface"; + })(ObjectFlags = ts.ObjectFlags || (ts.ObjectFlags = {})); + var SignatureKind; + (function (SignatureKind) { + SignatureKind[SignatureKind["Call"] = 0] = "Call"; + SignatureKind[SignatureKind["Construct"] = 1] = "Construct"; + })(SignatureKind = ts.SignatureKind || (ts.SignatureKind = {})); + var IndexKind; + (function (IndexKind) { + IndexKind[IndexKind["String"] = 0] = "String"; + IndexKind[IndexKind["Number"] = 1] = "Number"; + })(IndexKind = ts.IndexKind || (ts.IndexKind = {})); + var SpecialPropertyAssignmentKind; + (function (SpecialPropertyAssignmentKind) { + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["None"] = 0] = "None"; + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ExportsProperty"] = 1] = "ExportsProperty"; + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ModuleExports"] = 2] = "ModuleExports"; + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["PrototypeProperty"] = 3] = "PrototypeProperty"; + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ThisProperty"] = 4] = "ThisProperty"; + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["Property"] = 5] = "Property"; + })(SpecialPropertyAssignmentKind = ts.SpecialPropertyAssignmentKind || (ts.SpecialPropertyAssignmentKind = {})); var DiagnosticCategory; (function (DiagnosticCategory) { DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; @@ -66,6 +742,179 @@ var ts; ModuleKind[ModuleKind["System"] = 4] = "System"; ModuleKind[ModuleKind["ES2015"] = 5] = "ES2015"; })(ModuleKind = ts.ModuleKind || (ts.ModuleKind = {})); + var JsxEmit; + (function (JsxEmit) { + JsxEmit[JsxEmit["None"] = 0] = "None"; + JsxEmit[JsxEmit["Preserve"] = 1] = "Preserve"; + JsxEmit[JsxEmit["React"] = 2] = "React"; + JsxEmit[JsxEmit["ReactNative"] = 3] = "ReactNative"; + })(JsxEmit = ts.JsxEmit || (ts.JsxEmit = {})); + var NewLineKind; + (function (NewLineKind) { + NewLineKind[NewLineKind["CarriageReturnLineFeed"] = 0] = "CarriageReturnLineFeed"; + NewLineKind[NewLineKind["LineFeed"] = 1] = "LineFeed"; + })(NewLineKind = ts.NewLineKind || (ts.NewLineKind = {})); + var ScriptKind; + (function (ScriptKind) { + ScriptKind[ScriptKind["Unknown"] = 0] = "Unknown"; + ScriptKind[ScriptKind["JS"] = 1] = "JS"; + ScriptKind[ScriptKind["JSX"] = 2] = "JSX"; + ScriptKind[ScriptKind["TS"] = 3] = "TS"; + ScriptKind[ScriptKind["TSX"] = 4] = "TSX"; + ScriptKind[ScriptKind["External"] = 5] = "External"; + })(ScriptKind = ts.ScriptKind || (ts.ScriptKind = {})); + var ScriptTarget; + (function (ScriptTarget) { + ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3"; + ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5"; + ScriptTarget[ScriptTarget["ES2015"] = 2] = "ES2015"; + ScriptTarget[ScriptTarget["ES2016"] = 3] = "ES2016"; + ScriptTarget[ScriptTarget["ES2017"] = 4] = "ES2017"; + ScriptTarget[ScriptTarget["ESNext"] = 5] = "ESNext"; + ScriptTarget[ScriptTarget["Latest"] = 5] = "Latest"; + })(ScriptTarget = ts.ScriptTarget || (ts.ScriptTarget = {})); + var LanguageVariant; + (function (LanguageVariant) { + LanguageVariant[LanguageVariant["Standard"] = 0] = "Standard"; + LanguageVariant[LanguageVariant["JSX"] = 1] = "JSX"; + })(LanguageVariant = ts.LanguageVariant || (ts.LanguageVariant = {})); + var DiagnosticStyle; + (function (DiagnosticStyle) { + DiagnosticStyle[DiagnosticStyle["Simple"] = 0] = "Simple"; + DiagnosticStyle[DiagnosticStyle["Pretty"] = 1] = "Pretty"; + })(DiagnosticStyle = ts.DiagnosticStyle || (ts.DiagnosticStyle = {})); + var WatchDirectoryFlags; + (function (WatchDirectoryFlags) { + WatchDirectoryFlags[WatchDirectoryFlags["None"] = 0] = "None"; + WatchDirectoryFlags[WatchDirectoryFlags["Recursive"] = 1] = "Recursive"; + })(WatchDirectoryFlags = ts.WatchDirectoryFlags || (ts.WatchDirectoryFlags = {})); + var CharacterCodes; + (function (CharacterCodes) { + CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter"; + CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 127] = "maxAsciiCharacter"; + CharacterCodes[CharacterCodes["lineFeed"] = 10] = "lineFeed"; + CharacterCodes[CharacterCodes["carriageReturn"] = 13] = "carriageReturn"; + CharacterCodes[CharacterCodes["lineSeparator"] = 8232] = "lineSeparator"; + CharacterCodes[CharacterCodes["paragraphSeparator"] = 8233] = "paragraphSeparator"; + CharacterCodes[CharacterCodes["nextLine"] = 133] = "nextLine"; + CharacterCodes[CharacterCodes["space"] = 32] = "space"; + CharacterCodes[CharacterCodes["nonBreakingSpace"] = 160] = "nonBreakingSpace"; + CharacterCodes[CharacterCodes["enQuad"] = 8192] = "enQuad"; + CharacterCodes[CharacterCodes["emQuad"] = 8193] = "emQuad"; + CharacterCodes[CharacterCodes["enSpace"] = 8194] = "enSpace"; + CharacterCodes[CharacterCodes["emSpace"] = 8195] = "emSpace"; + CharacterCodes[CharacterCodes["threePerEmSpace"] = 8196] = "threePerEmSpace"; + CharacterCodes[CharacterCodes["fourPerEmSpace"] = 8197] = "fourPerEmSpace"; + CharacterCodes[CharacterCodes["sixPerEmSpace"] = 8198] = "sixPerEmSpace"; + CharacterCodes[CharacterCodes["figureSpace"] = 8199] = "figureSpace"; + CharacterCodes[CharacterCodes["punctuationSpace"] = 8200] = "punctuationSpace"; + CharacterCodes[CharacterCodes["thinSpace"] = 8201] = "thinSpace"; + CharacterCodes[CharacterCodes["hairSpace"] = 8202] = "hairSpace"; + CharacterCodes[CharacterCodes["zeroWidthSpace"] = 8203] = "zeroWidthSpace"; + CharacterCodes[CharacterCodes["narrowNoBreakSpace"] = 8239] = "narrowNoBreakSpace"; + CharacterCodes[CharacterCodes["ideographicSpace"] = 12288] = "ideographicSpace"; + CharacterCodes[CharacterCodes["mathematicalSpace"] = 8287] = "mathematicalSpace"; + CharacterCodes[CharacterCodes["ogham"] = 5760] = "ogham"; + CharacterCodes[CharacterCodes["_"] = 95] = "_"; + CharacterCodes[CharacterCodes["$"] = 36] = "$"; + CharacterCodes[CharacterCodes["_0"] = 48] = "_0"; + CharacterCodes[CharacterCodes["_1"] = 49] = "_1"; + CharacterCodes[CharacterCodes["_2"] = 50] = "_2"; + CharacterCodes[CharacterCodes["_3"] = 51] = "_3"; + CharacterCodes[CharacterCodes["_4"] = 52] = "_4"; + CharacterCodes[CharacterCodes["_5"] = 53] = "_5"; + CharacterCodes[CharacterCodes["_6"] = 54] = "_6"; + CharacterCodes[CharacterCodes["_7"] = 55] = "_7"; + CharacterCodes[CharacterCodes["_8"] = 56] = "_8"; + CharacterCodes[CharacterCodes["_9"] = 57] = "_9"; + CharacterCodes[CharacterCodes["a"] = 97] = "a"; + CharacterCodes[CharacterCodes["b"] = 98] = "b"; + CharacterCodes[CharacterCodes["c"] = 99] = "c"; + CharacterCodes[CharacterCodes["d"] = 100] = "d"; + CharacterCodes[CharacterCodes["e"] = 101] = "e"; + CharacterCodes[CharacterCodes["f"] = 102] = "f"; + CharacterCodes[CharacterCodes["g"] = 103] = "g"; + CharacterCodes[CharacterCodes["h"] = 104] = "h"; + CharacterCodes[CharacterCodes["i"] = 105] = "i"; + CharacterCodes[CharacterCodes["j"] = 106] = "j"; + CharacterCodes[CharacterCodes["k"] = 107] = "k"; + CharacterCodes[CharacterCodes["l"] = 108] = "l"; + CharacterCodes[CharacterCodes["m"] = 109] = "m"; + CharacterCodes[CharacterCodes["n"] = 110] = "n"; + CharacterCodes[CharacterCodes["o"] = 111] = "o"; + CharacterCodes[CharacterCodes["p"] = 112] = "p"; + CharacterCodes[CharacterCodes["q"] = 113] = "q"; + CharacterCodes[CharacterCodes["r"] = 114] = "r"; + CharacterCodes[CharacterCodes["s"] = 115] = "s"; + CharacterCodes[CharacterCodes["t"] = 116] = "t"; + CharacterCodes[CharacterCodes["u"] = 117] = "u"; + CharacterCodes[CharacterCodes["v"] = 118] = "v"; + CharacterCodes[CharacterCodes["w"] = 119] = "w"; + CharacterCodes[CharacterCodes["x"] = 120] = "x"; + CharacterCodes[CharacterCodes["y"] = 121] = "y"; + CharacterCodes[CharacterCodes["z"] = 122] = "z"; + CharacterCodes[CharacterCodes["A"] = 65] = "A"; + CharacterCodes[CharacterCodes["B"] = 66] = "B"; + CharacterCodes[CharacterCodes["C"] = 67] = "C"; + CharacterCodes[CharacterCodes["D"] = 68] = "D"; + CharacterCodes[CharacterCodes["E"] = 69] = "E"; + CharacterCodes[CharacterCodes["F"] = 70] = "F"; + CharacterCodes[CharacterCodes["G"] = 71] = "G"; + CharacterCodes[CharacterCodes["H"] = 72] = "H"; + CharacterCodes[CharacterCodes["I"] = 73] = "I"; + CharacterCodes[CharacterCodes["J"] = 74] = "J"; + CharacterCodes[CharacterCodes["K"] = 75] = "K"; + CharacterCodes[CharacterCodes["L"] = 76] = "L"; + CharacterCodes[CharacterCodes["M"] = 77] = "M"; + CharacterCodes[CharacterCodes["N"] = 78] = "N"; + CharacterCodes[CharacterCodes["O"] = 79] = "O"; + CharacterCodes[CharacterCodes["P"] = 80] = "P"; + CharacterCodes[CharacterCodes["Q"] = 81] = "Q"; + CharacterCodes[CharacterCodes["R"] = 82] = "R"; + CharacterCodes[CharacterCodes["S"] = 83] = "S"; + CharacterCodes[CharacterCodes["T"] = 84] = "T"; + CharacterCodes[CharacterCodes["U"] = 85] = "U"; + CharacterCodes[CharacterCodes["V"] = 86] = "V"; + CharacterCodes[CharacterCodes["W"] = 87] = "W"; + CharacterCodes[CharacterCodes["X"] = 88] = "X"; + CharacterCodes[CharacterCodes["Y"] = 89] = "Y"; + CharacterCodes[CharacterCodes["Z"] = 90] = "Z"; + CharacterCodes[CharacterCodes["ampersand"] = 38] = "ampersand"; + CharacterCodes[CharacterCodes["asterisk"] = 42] = "asterisk"; + CharacterCodes[CharacterCodes["at"] = 64] = "at"; + CharacterCodes[CharacterCodes["backslash"] = 92] = "backslash"; + CharacterCodes[CharacterCodes["backtick"] = 96] = "backtick"; + CharacterCodes[CharacterCodes["bar"] = 124] = "bar"; + CharacterCodes[CharacterCodes["caret"] = 94] = "caret"; + CharacterCodes[CharacterCodes["closeBrace"] = 125] = "closeBrace"; + CharacterCodes[CharacterCodes["closeBracket"] = 93] = "closeBracket"; + CharacterCodes[CharacterCodes["closeParen"] = 41] = "closeParen"; + CharacterCodes[CharacterCodes["colon"] = 58] = "colon"; + CharacterCodes[CharacterCodes["comma"] = 44] = "comma"; + CharacterCodes[CharacterCodes["dot"] = 46] = "dot"; + CharacterCodes[CharacterCodes["doubleQuote"] = 34] = "doubleQuote"; + CharacterCodes[CharacterCodes["equals"] = 61] = "equals"; + CharacterCodes[CharacterCodes["exclamation"] = 33] = "exclamation"; + CharacterCodes[CharacterCodes["greaterThan"] = 62] = "greaterThan"; + CharacterCodes[CharacterCodes["hash"] = 35] = "hash"; + CharacterCodes[CharacterCodes["lessThan"] = 60] = "lessThan"; + CharacterCodes[CharacterCodes["minus"] = 45] = "minus"; + CharacterCodes[CharacterCodes["openBrace"] = 123] = "openBrace"; + CharacterCodes[CharacterCodes["openBracket"] = 91] = "openBracket"; + CharacterCodes[CharacterCodes["openParen"] = 40] = "openParen"; + CharacterCodes[CharacterCodes["percent"] = 37] = "percent"; + CharacterCodes[CharacterCodes["plus"] = 43] = "plus"; + CharacterCodes[CharacterCodes["question"] = 63] = "question"; + CharacterCodes[CharacterCodes["semicolon"] = 59] = "semicolon"; + CharacterCodes[CharacterCodes["singleQuote"] = 39] = "singleQuote"; + CharacterCodes[CharacterCodes["slash"] = 47] = "slash"; + CharacterCodes[CharacterCodes["tilde"] = 126] = "tilde"; + CharacterCodes[CharacterCodes["backspace"] = 8] = "backspace"; + CharacterCodes[CharacterCodes["formFeed"] = 12] = "formFeed"; + CharacterCodes[CharacterCodes["byteOrderMark"] = 65279] = "byteOrderMark"; + CharacterCodes[CharacterCodes["tab"] = 9] = "tab"; + CharacterCodes[CharacterCodes["verticalTab"] = 11] = "verticalTab"; + })(CharacterCodes = ts.CharacterCodes || (ts.CharacterCodes = {})); var Extension; (function (Extension) { Extension[Extension["Ts"] = 0] = "Ts"; @@ -75,6 +924,121 @@ var ts; Extension[Extension["Jsx"] = 4] = "Jsx"; Extension[Extension["LastTypeScriptExtension"] = 2] = "LastTypeScriptExtension"; })(Extension = ts.Extension || (ts.Extension = {})); + var TransformFlags; + (function (TransformFlags) { + TransformFlags[TransformFlags["None"] = 0] = "None"; + TransformFlags[TransformFlags["TypeScript"] = 1] = "TypeScript"; + TransformFlags[TransformFlags["ContainsTypeScript"] = 2] = "ContainsTypeScript"; + TransformFlags[TransformFlags["ContainsJsx"] = 4] = "ContainsJsx"; + TransformFlags[TransformFlags["ContainsESNext"] = 8] = "ContainsESNext"; + TransformFlags[TransformFlags["ContainsES2017"] = 16] = "ContainsES2017"; + TransformFlags[TransformFlags["ContainsES2016"] = 32] = "ContainsES2016"; + TransformFlags[TransformFlags["ES2015"] = 64] = "ES2015"; + TransformFlags[TransformFlags["ContainsES2015"] = 128] = "ContainsES2015"; + TransformFlags[TransformFlags["Generator"] = 256] = "Generator"; + TransformFlags[TransformFlags["ContainsGenerator"] = 512] = "ContainsGenerator"; + TransformFlags[TransformFlags["DestructuringAssignment"] = 1024] = "DestructuringAssignment"; + TransformFlags[TransformFlags["ContainsDestructuringAssignment"] = 2048] = "ContainsDestructuringAssignment"; + TransformFlags[TransformFlags["ContainsDecorators"] = 4096] = "ContainsDecorators"; + TransformFlags[TransformFlags["ContainsPropertyInitializer"] = 8192] = "ContainsPropertyInitializer"; + TransformFlags[TransformFlags["ContainsLexicalThis"] = 16384] = "ContainsLexicalThis"; + TransformFlags[TransformFlags["ContainsCapturedLexicalThis"] = 32768] = "ContainsCapturedLexicalThis"; + TransformFlags[TransformFlags["ContainsLexicalThisInComputedPropertyName"] = 65536] = "ContainsLexicalThisInComputedPropertyName"; + TransformFlags[TransformFlags["ContainsDefaultValueAssignments"] = 131072] = "ContainsDefaultValueAssignments"; + TransformFlags[TransformFlags["ContainsParameterPropertyAssignments"] = 262144] = "ContainsParameterPropertyAssignments"; + TransformFlags[TransformFlags["ContainsSpread"] = 524288] = "ContainsSpread"; + TransformFlags[TransformFlags["ContainsObjectSpread"] = 1048576] = "ContainsObjectSpread"; + TransformFlags[TransformFlags["ContainsRest"] = 524288] = "ContainsRest"; + TransformFlags[TransformFlags["ContainsObjectRest"] = 1048576] = "ContainsObjectRest"; + TransformFlags[TransformFlags["ContainsComputedPropertyName"] = 2097152] = "ContainsComputedPropertyName"; + TransformFlags[TransformFlags["ContainsBlockScopedBinding"] = 4194304] = "ContainsBlockScopedBinding"; + TransformFlags[TransformFlags["ContainsBindingPattern"] = 8388608] = "ContainsBindingPattern"; + TransformFlags[TransformFlags["ContainsYield"] = 16777216] = "ContainsYield"; + TransformFlags[TransformFlags["ContainsHoistedDeclarationOrCompletion"] = 33554432] = "ContainsHoistedDeclarationOrCompletion"; + TransformFlags[TransformFlags["HasComputedFlags"] = 536870912] = "HasComputedFlags"; + TransformFlags[TransformFlags["AssertTypeScript"] = 3] = "AssertTypeScript"; + TransformFlags[TransformFlags["AssertJsx"] = 4] = "AssertJsx"; + TransformFlags[TransformFlags["AssertESNext"] = 8] = "AssertESNext"; + TransformFlags[TransformFlags["AssertES2017"] = 16] = "AssertES2017"; + TransformFlags[TransformFlags["AssertES2016"] = 32] = "AssertES2016"; + TransformFlags[TransformFlags["AssertES2015"] = 192] = "AssertES2015"; + TransformFlags[TransformFlags["AssertGenerator"] = 768] = "AssertGenerator"; + TransformFlags[TransformFlags["AssertDestructuringAssignment"] = 3072] = "AssertDestructuringAssignment"; + TransformFlags[TransformFlags["NodeExcludes"] = 536872257] = "NodeExcludes"; + TransformFlags[TransformFlags["ArrowFunctionExcludes"] = 601249089] = "ArrowFunctionExcludes"; + TransformFlags[TransformFlags["FunctionExcludes"] = 601281857] = "FunctionExcludes"; + TransformFlags[TransformFlags["ConstructorExcludes"] = 601015617] = "ConstructorExcludes"; + TransformFlags[TransformFlags["MethodOrAccessorExcludes"] = 601015617] = "MethodOrAccessorExcludes"; + TransformFlags[TransformFlags["ClassExcludes"] = 539358529] = "ClassExcludes"; + TransformFlags[TransformFlags["ModuleExcludes"] = 574674241] = "ModuleExcludes"; + TransformFlags[TransformFlags["TypeExcludes"] = -3] = "TypeExcludes"; + TransformFlags[TransformFlags["ObjectLiteralExcludes"] = 540087617] = "ObjectLiteralExcludes"; + TransformFlags[TransformFlags["ArrayLiteralOrCallOrNewExcludes"] = 537396545] = "ArrayLiteralOrCallOrNewExcludes"; + TransformFlags[TransformFlags["VariableDeclarationListExcludes"] = 546309441] = "VariableDeclarationListExcludes"; + TransformFlags[TransformFlags["ParameterExcludes"] = 536872257] = "ParameterExcludes"; + TransformFlags[TransformFlags["CatchClauseExcludes"] = 537920833] = "CatchClauseExcludes"; + TransformFlags[TransformFlags["BindingPatternExcludes"] = 537396545] = "BindingPatternExcludes"; + TransformFlags[TransformFlags["TypeScriptClassSyntaxMask"] = 274432] = "TypeScriptClassSyntaxMask"; + TransformFlags[TransformFlags["ES2015FunctionSyntaxMask"] = 163840] = "ES2015FunctionSyntaxMask"; + })(TransformFlags = ts.TransformFlags || (ts.TransformFlags = {})); + var EmitFlags; + (function (EmitFlags) { + EmitFlags[EmitFlags["SingleLine"] = 1] = "SingleLine"; + EmitFlags[EmitFlags["AdviseOnEmitNode"] = 2] = "AdviseOnEmitNode"; + EmitFlags[EmitFlags["NoSubstitution"] = 4] = "NoSubstitution"; + EmitFlags[EmitFlags["CapturesThis"] = 8] = "CapturesThis"; + EmitFlags[EmitFlags["NoLeadingSourceMap"] = 16] = "NoLeadingSourceMap"; + EmitFlags[EmitFlags["NoTrailingSourceMap"] = 32] = "NoTrailingSourceMap"; + EmitFlags[EmitFlags["NoSourceMap"] = 48] = "NoSourceMap"; + EmitFlags[EmitFlags["NoNestedSourceMaps"] = 64] = "NoNestedSourceMaps"; + EmitFlags[EmitFlags["NoTokenLeadingSourceMaps"] = 128] = "NoTokenLeadingSourceMaps"; + EmitFlags[EmitFlags["NoTokenTrailingSourceMaps"] = 256] = "NoTokenTrailingSourceMaps"; + EmitFlags[EmitFlags["NoTokenSourceMaps"] = 384] = "NoTokenSourceMaps"; + EmitFlags[EmitFlags["NoLeadingComments"] = 512] = "NoLeadingComments"; + EmitFlags[EmitFlags["NoTrailingComments"] = 1024] = "NoTrailingComments"; + EmitFlags[EmitFlags["NoComments"] = 1536] = "NoComments"; + EmitFlags[EmitFlags["NoNestedComments"] = 2048] = "NoNestedComments"; + EmitFlags[EmitFlags["HelperName"] = 4096] = "HelperName"; + EmitFlags[EmitFlags["ExportName"] = 8192] = "ExportName"; + EmitFlags[EmitFlags["LocalName"] = 16384] = "LocalName"; + EmitFlags[EmitFlags["Indented"] = 32768] = "Indented"; + EmitFlags[EmitFlags["NoIndentation"] = 65536] = "NoIndentation"; + EmitFlags[EmitFlags["AsyncFunctionBody"] = 131072] = "AsyncFunctionBody"; + EmitFlags[EmitFlags["ReuseTempVariableScope"] = 262144] = "ReuseTempVariableScope"; + EmitFlags[EmitFlags["CustomPrologue"] = 524288] = "CustomPrologue"; + EmitFlags[EmitFlags["NoHoisting"] = 1048576] = "NoHoisting"; + EmitFlags[EmitFlags["HasEndOfDeclarationMarker"] = 2097152] = "HasEndOfDeclarationMarker"; + EmitFlags[EmitFlags["Iterator"] = 4194304] = "Iterator"; + })(EmitFlags = ts.EmitFlags || (ts.EmitFlags = {})); + var ExternalEmitHelpers; + (function (ExternalEmitHelpers) { + ExternalEmitHelpers[ExternalEmitHelpers["Extends"] = 1] = "Extends"; + ExternalEmitHelpers[ExternalEmitHelpers["Assign"] = 2] = "Assign"; + ExternalEmitHelpers[ExternalEmitHelpers["Rest"] = 4] = "Rest"; + ExternalEmitHelpers[ExternalEmitHelpers["Decorate"] = 8] = "Decorate"; + ExternalEmitHelpers[ExternalEmitHelpers["Metadata"] = 16] = "Metadata"; + ExternalEmitHelpers[ExternalEmitHelpers["Param"] = 32] = "Param"; + ExternalEmitHelpers[ExternalEmitHelpers["Awaiter"] = 64] = "Awaiter"; + ExternalEmitHelpers[ExternalEmitHelpers["Generator"] = 128] = "Generator"; + ExternalEmitHelpers[ExternalEmitHelpers["Values"] = 256] = "Values"; + ExternalEmitHelpers[ExternalEmitHelpers["Read"] = 512] = "Read"; + ExternalEmitHelpers[ExternalEmitHelpers["Spread"] = 1024] = "Spread"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncGenerator"] = 2048] = "AsyncGenerator"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncDelegator"] = 4096] = "AsyncDelegator"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncValues"] = 8192] = "AsyncValues"; + ExternalEmitHelpers[ExternalEmitHelpers["ForOfIncludes"] = 256] = "ForOfIncludes"; + ExternalEmitHelpers[ExternalEmitHelpers["ForAwaitOfIncludes"] = 8192] = "ForAwaitOfIncludes"; + ExternalEmitHelpers[ExternalEmitHelpers["SpreadIncludes"] = 1536] = "SpreadIncludes"; + ExternalEmitHelpers[ExternalEmitHelpers["FirstEmitHelper"] = 1] = "FirstEmitHelper"; + ExternalEmitHelpers[ExternalEmitHelpers["LastEmitHelper"] = 8192] = "LastEmitHelper"; + })(ExternalEmitHelpers = ts.ExternalEmitHelpers || (ts.ExternalEmitHelpers = {})); + var EmitHint; + (function (EmitHint) { + EmitHint[EmitHint["SourceFile"] = 0] = "SourceFile"; + EmitHint[EmitHint["Expression"] = 1] = "Expression"; + EmitHint[EmitHint["IdentifierName"] = 2] = "IdentifierName"; + EmitHint[EmitHint["Unspecified"] = 3] = "Unspecified"; + })(EmitHint = ts.EmitHint || (ts.EmitHint = {})); })(ts || (ts = {})); var ts; (function (ts) { @@ -93,32 +1057,32 @@ var ts; var measures; function mark(markName) { if (enabled) { - marks[markName] = ts.timestamp(); - counts[markName] = (counts[markName] || 0) + 1; + marks.set(markName, ts.timestamp()); + counts.set(markName, (counts.get(markName) || 0) + 1); profilerEvent(markName); } } performance.mark = mark; function measure(measureName, startMarkName, endMarkName) { if (enabled) { - var end = endMarkName && marks[endMarkName] || ts.timestamp(); - var start = startMarkName && marks[startMarkName] || profilerStart; - measures[measureName] = (measures[measureName] || 0) + (end - start); + var end = endMarkName && marks.get(endMarkName) || ts.timestamp(); + var start = startMarkName && marks.get(startMarkName) || profilerStart; + measures.set(measureName, (measures.get(measureName) || 0) + (end - start)); } } performance.measure = measure; function getCount(markName) { - return counts && counts[markName] || 0; + return counts && counts.get(markName) || 0; } performance.getCount = getCount; function getDuration(measureName) { - return measures && measures[measureName] || 0; + return measures && measures.get(measureName) || 0; } performance.getDuration = getDuration; function forEachMeasure(cb) { - for (var key in measures) { - cb(key, measures[key]); - } + measures.forEach(function (measure, key) { + cb(key, measure); + }); } performance.forEachMeasure = forEachMeasure; function enable() { @@ -137,22 +1101,102 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - ts.version = "2.2.0-dev.20161127"; + ts.version = "2.3.0-dev.20170419"; })(ts || (ts = {})); (function (ts) { - var createObject = Object.create; - ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined; - function createMap(template) { - var map = createObject(null); + var Ternary; + (function (Ternary) { + Ternary[Ternary["False"] = 0] = "False"; + Ternary[Ternary["Maybe"] = 1] = "Maybe"; + Ternary[Ternary["True"] = -1] = "True"; + })(Ternary = ts.Ternary || (ts.Ternary = {})); + ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator(undefined, { usage: "sort", sensitivity: "accent" }) : undefined; + ts.localeCompareIsCorrect = ts.collator && ts.collator.compare("a", "B") < 0; + function createDictionaryObject() { + var map = Object.create(null); map["__"] = undefined; delete map["__"]; + return map; + } + function createMap() { + return new MapCtr(); + } + ts.createMap = createMap; + function createMapFromTemplate(template) { + var map = new MapCtr(); for (var key in template) if (hasOwnProperty.call(template, key)) { - map[key] = template[key]; + map.set(key, template[key]); } return map; } - ts.createMap = createMap; + ts.createMapFromTemplate = createMapFromTemplate; + var MapCtr = typeof Map !== "undefined" && "entries" in Map.prototype ? Map : shimMap(); + function shimMap() { + var MapIterator = (function () { + function MapIterator(data, selector) { + this.index = 0; + this.data = data; + this.selector = selector; + this.keys = Object.keys(data); + } + MapIterator.prototype.next = function () { + var index = this.index; + if (index < this.keys.length) { + this.index++; + return { value: this.selector(this.data, this.keys[index]), done: false }; + } + return { value: undefined, done: true }; + }; + return MapIterator; + }()); + return (function () { + function class_1() { + this.data = createDictionaryObject(); + this.size = 0; + } + class_1.prototype.get = function (key) { + return this.data[key]; + }; + class_1.prototype.set = function (key, value) { + if (!this.has(key)) { + this.size++; + } + this.data[key] = value; + return this; + }; + class_1.prototype.has = function (key) { + return key in this.data; + }; + class_1.prototype.delete = function (key) { + if (this.has(key)) { + this.size--; + delete this.data[key]; + return true; + } + return false; + }; + class_1.prototype.clear = function () { + this.data = createDictionaryObject(); + this.size = 0; + }; + class_1.prototype.keys = function () { + return new MapIterator(this.data, function (_data, key) { return key; }); + }; + class_1.prototype.values = function () { + return new MapIterator(this.data, function (data, key) { return data[key]; }); + }; + class_1.prototype.entries = function () { + return new MapIterator(this.data, function (data, key) { return [key, data[key]]; }); + }; + class_1.prototype.forEach = function (action) { + for (var key in this.data) { + action(this.data[key], key); + } + }; + return class_1; + }()); + } function createFileMap(keyMapper) { var files = createMap(); return { @@ -165,32 +1209,27 @@ var ts; clear: clear, }; function forEachValueInMap(f) { - for (var key in files) { - f(key, files[key]); - } + files.forEach(function (file, key) { + f(key, file); + }); } function getKeys() { - var keys = []; - for (var key in files) { - keys.push(key); - } - return keys; + return arrayFrom(files.keys()); } function get(path) { - return files[toKey(path)]; + return files.get(toKey(path)); } function set(path, value) { - files[toKey(path)] = value; + files.set(toKey(path), value); } function contains(path) { - return toKey(path) in files; + return files.has(toKey(path)); } function remove(path) { - var key = toKey(path); - delete files[key]; + files.delete(toKey(path)); } function clear() { - files = createMap(); + files.clear(); } function toKey(path) { return keyMapper ? keyMapper(path) : path; @@ -204,9 +1243,19 @@ var ts; return getCanonicalFileName(nonCanonicalizedPath); } ts.toPath = toPath; + var Comparison; + (function (Comparison) { + Comparison[Comparison["LessThan"] = -1] = "LessThan"; + Comparison[Comparison["EqualTo"] = 0] = "EqualTo"; + Comparison[Comparison["GreaterThan"] = 1] = "GreaterThan"; + })(Comparison = ts.Comparison || (ts.Comparison = {})); + function length(array) { + return array ? array.length : 0; + } + ts.length = length; function forEach(array, callback) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { var result = callback(array[i], i); if (result) { return result; @@ -216,6 +1265,20 @@ var ts; return undefined; } ts.forEach = forEach; + function findAncestor(node, callback) { + while (node) { + var result = callback(node); + if (result === "quit") { + return undefined; + } + else if (result) { + return node; + } + node = node.parent; + } + return undefined; + } + ts.findAncestor = findAncestor; function zipWith(arrayA, arrayB, callback) { Debug.assert(arrayA.length === arrayB.length); for (var i = 0; i < arrayA.length; i++) { @@ -225,7 +1288,7 @@ var ts; ts.zipWith = zipWith; function every(array, callback) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { if (!callback(array[i], i)) { return false; } @@ -235,7 +1298,7 @@ var ts; } ts.every = every; function find(array, predicate) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { var value = array[i]; if (predicate(value, i)) { return value; @@ -244,8 +1307,17 @@ var ts; return undefined; } ts.find = find; + function findIndex(array, predicate) { + for (var i = 0; i < array.length; i++) { + if (predicate(array[i], i)) { + return i; + } + } + return -1; + } + ts.findIndex = findIndex; function findMap(array, callback) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { var result = callback(array[i], i); if (result) { return result; @@ -268,7 +1340,7 @@ var ts; ts.contains = contains; function indexOf(array, value) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { if (array[i] === value) { return i; } @@ -278,7 +1350,7 @@ var ts; } ts.indexOf = indexOf; function indexOfAnyCharCode(text, charCodes, start) { - for (var i = start || 0, len = text.length; i < len; i++) { + for (var i = start || 0; i < text.length; i++) { if (contains(charCodes, text.charCodeAt(i))) { return i; } @@ -465,21 +1537,18 @@ var ts; return result; } ts.spanMap = spanMap; - function mapObject(object, f) { - var result; - if (object) { - result = {}; - for (var _i = 0, _a = getOwnKeys(object); _i < _a.length; _i++) { - var v = _a[_i]; - var _b = f(v, object[v]) || [undefined, undefined], key = _b[0], value = _b[1]; - if (key !== undefined) { - result[key] = value; - } - } + function mapEntries(map, f) { + if (!map) { + return undefined; } + var result = createMap(); + map.forEach(function (value, key) { + var _a = f(key, value), newKey = _a[0], newValue = _a[1]; + result.set(newKey, newValue); + }); return result; } - ts.mapObject = mapObject; + ts.mapEntries = mapEntries; function some(array, predicate) { if (array) { if (predicate) { @@ -763,38 +1832,55 @@ var ts; return keys; } ts.getOwnKeys = getOwnKeys; - function forEachProperty(map, callback) { - var result; - for (var key in map) { - if (result = callback(map[key], key)) - break; + function arrayFrom(iterator, map) { + var result = []; + for (var _a = iterator.next(), value = _a.value, done = _a.done; !done; _b = iterator.next(), value = _b.value, done = _b.done, _b) { + result.push(map ? map(value) : value); } return result; + var _b; } - ts.forEachProperty = forEachProperty; - function someProperties(map, predicate) { - for (var key in map) { - if (!predicate || predicate(map[key], key)) - return true; + ts.arrayFrom = arrayFrom; + function convertToArray(iterator, f) { + var result = []; + for (var _a = iterator.next(), value = _a.value, done = _a.done; !done; _b = iterator.next(), value = _b.value, done = _b.done, _b) { + result.push(f(value)); } - return false; + return result; + var _b; } - ts.someProperties = someProperties; - function copyProperties(source, target) { - for (var key in source) { - target[key] = source[key]; + ts.convertToArray = convertToArray; + function forEachEntry(map, callback) { + var iterator = map.entries(); + for (var _a = iterator.next(), pair = _a.value, done = _a.done; !done; _b = iterator.next(), pair = _b.value, done = _b.done, _b) { + var key = pair[0], value = pair[1]; + var result = callback(value, key); + if (result) { + return result; + } } + return undefined; + var _b; } - ts.copyProperties = copyProperties; - function appendProperty(map, key, value) { - if (key === undefined || value === undefined) - return map; - if (map === undefined) - map = createMap(); - map[key] = value; - return map; + ts.forEachEntry = forEachEntry; + function forEachKey(map, callback) { + var iterator = map.keys(); + for (var _a = iterator.next(), key = _a.value, done = _a.done; !done; _b = iterator.next(), key = _b.value, done = _b.done, _b) { + var result = callback(key); + if (result) { + return result; + } + } + return undefined; + var _b; } - ts.appendProperty = appendProperty; + ts.forEachKey = forEachKey; + function copyEntries(source, target) { + source.forEach(function (value, key) { + target.set(key, value); + }); + } + ts.copyEntries = copyEntries; function assign(t) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { @@ -802,31 +1888,14 @@ var ts; } for (var _a = 0, args_1 = args; _a < args_1.length; _a++) { var arg = args_1[_a]; - for (var _b = 0, _c = getOwnKeys(arg); _b < _c.length; _b++) { - var p = _c[_b]; - t[p] = arg[p]; - } + for (var p in arg) + if (hasProperty(arg, p)) { + t[p] = arg[p]; + } } return t; } ts.assign = assign; - function reduceProperties(map, callback, initial) { - var result = initial; - for (var key in map) { - result = callback(result, map[key], String(key)); - } - return result; - } - ts.reduceProperties = reduceProperties; - function reduceOwnProperties(map, callback, initial) { - var result = initial; - for (var key in map) - if (hasOwnProperty.call(map, key)) { - result = callback(result, map[key], String(key)); - } - return result; - } - ts.reduceOwnProperties = reduceOwnProperties; function equalOwnProperties(left, right, equalityComparer) { if (left === right) return true; @@ -851,23 +1920,14 @@ var ts; var result = createMap(); for (var _i = 0, array_8 = array; _i < array_8.length; _i++) { var value = array_8[_i]; - result[makeKey(value)] = makeValue ? makeValue(value) : value; + result.set(makeKey(value), makeValue ? makeValue(value) : value); } return result; } ts.arrayToMap = arrayToMap; - function isEmpty(map) { - for (var id in map) { - if (hasProperty(map, id)) { - return false; - } - } - return true; - } - ts.isEmpty = isEmpty; function cloneMap(map) { var clone = createMap(); - copyProperties(map, clone); + copyEntries(map, clone); return clone; } ts.cloneMap = cloneMap; @@ -894,27 +1954,32 @@ var ts; return result; } ts.extend = extend; - function multiMapAdd(map, key, value) { - var values = map[key]; + function createMultiMap() { + var map = createMap(); + map.add = multiMapAdd; + map.remove = multiMapRemove; + return map; + } + ts.createMultiMap = createMultiMap; + function multiMapAdd(key, value) { + var values = this.get(key); if (values) { values.push(value); - return values; } else { - return map[key] = [value]; + this.set(key, values = [value]); } + return values; } - ts.multiMapAdd = multiMapAdd; - function multiMapRemove(map, key, value) { - var values = map[key]; + function multiMapRemove(key, value) { + var values = this.get(key); if (values) { unorderedRemoveItem(values, value); if (!values.length) { - delete map[key]; + this.delete(key); } } } - ts.multiMapRemove = multiMapRemove; function isArray(value) { return Array.isArray ? Array.isArray(value) : value instanceof Array; } @@ -990,6 +2055,7 @@ var ts; baseIndex = baseIndex || 0; return text.replace(/{(\d+)}/g, function (_match, index) { return args[+index + baseIndex]; }); } + ts.formatStringFromArgs = formatStringFromArgs; ts.localizedDiagnosticMessages = undefined; function getLocaleSpecificMessage(message) { return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message.key] || message.message; @@ -1091,8 +2157,10 @@ var ts; if (b === undefined) return 1; if (ignoreCase) { - if (ts.collator && String.prototype.localeCompare) { - var result = a.localeCompare(b, undefined, { usage: "sort", sensitivity: "accent" }); + if (ts.collator) { + var result = ts.localeCompareIsCorrect ? + ts.collator.compare(a, b) : + a.localeCompare(b, undefined, { usage: "sort", sensitivity: "accent" }); return result < 0 ? -1 : result > 0 ? 1 : 0; } a = a.toUpperCase(); @@ -1474,36 +2542,26 @@ var ts; var singleAsteriskRegexFragmentFiles = "([^./]|(\\.(?!min\\.js$))?)*"; var singleAsteriskRegexFragmentOther = "[^/]*"; function getRegularExpressionForWildcard(specs, basePath, usage) { + var patterns = getRegularExpressionsForWildcards(specs, basePath, usage); + if (!patterns || !patterns.length) { + return undefined; + } + var pattern = patterns.map(function (pattern) { return "(" + pattern + ")"; }).join("|"); + var terminator = usage === "exclude" ? "($|/)" : "$"; + return "^(" + pattern + ")" + terminator; + } + ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard; + function getRegularExpressionsForWildcards(specs, basePath, usage) { if (specs === undefined || specs.length === 0) { return undefined; } var replaceWildcardCharacter = usage === "files" ? replaceWildCardCharacterFiles : replaceWildCardCharacterOther; var singleAsteriskRegexFragment = usage === "files" ? singleAsteriskRegexFragmentFiles : singleAsteriskRegexFragmentOther; var doubleAsteriskRegexFragment = usage === "exclude" ? "(/.+?)?" : "(/[^/.][^/]*)*?"; - var pattern = ""; - var hasWrittenSubpattern = false; - for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) { - var spec = specs_1[_i]; - if (!spec) { - continue; - } - var subPattern = getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter); - if (subPattern === undefined) { - continue; - } - if (hasWrittenSubpattern) { - pattern += "|"; - } - pattern += "(" + subPattern + ")"; - hasWrittenSubpattern = true; - } - if (!pattern) { - return undefined; - } - var terminator = usage === "exclude" ? "($|/)" : "$"; - return "^(" + pattern + ")" + terminator; + return flatMap(specs, function (spec) { + return spec && getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter); + }); } - ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard; function isImplicitGlob(lastPathComponent) { return !/[.*?]/.test(lastPathComponent); } @@ -1573,6 +2631,7 @@ var ts; currentDirectory = normalizePath(currentDirectory); var absolutePath = combinePaths(currentDirectory, path); return { + includeFilePatterns: map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^" + pattern + "$"; }), includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"), includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"), excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"), @@ -1585,34 +2644,48 @@ var ts; currentDirectory = normalizePath(currentDirectory); var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory); var regexFlag = useCaseSensitiveFileNames ? "" : "i"; - var includeFileRegex = patterns.includeFilePattern && new RegExp(patterns.includeFilePattern, regexFlag); + var includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map(function (pattern) { return new RegExp(pattern, regexFlag); }); var includeDirectoryRegex = patterns.includeDirectoryPattern && new RegExp(patterns.includeDirectoryPattern, regexFlag); var excludeRegex = patterns.excludePattern && new RegExp(patterns.excludePattern, regexFlag); - var result = []; + var results = includeFileRegexes ? includeFileRegexes.map(function () { return []; }) : [[]]; + var comparer = useCaseSensitiveFileNames ? compareStrings : compareStringsCaseInsensitive; for (var _i = 0, _a = patterns.basePaths; _i < _a.length; _i++) { var basePath = _a[_i]; visitDirectory(basePath, combinePaths(currentDirectory, basePath)); } - return result; + return flatten(results); function visitDirectory(path, absolutePath) { var _a = getFileSystemEntries(path), files = _a.files, directories = _a.directories; + files = files.slice().sort(comparer); + directories = directories.slice().sort(comparer); + var _loop_1 = function (current) { + var name = combinePaths(path, current); + var absoluteName = combinePaths(absolutePath, current); + if (extensions && !fileExtensionIsAny(name, extensions)) + return "continue"; + if (excludeRegex && excludeRegex.test(absoluteName)) + return "continue"; + if (!includeFileRegexes) { + results[0].push(name); + } + else { + var includeIndex = findIndex(includeFileRegexes, function (re) { return re.test(absoluteName); }); + if (includeIndex !== -1) { + results[includeIndex].push(name); + } + } + }; for (var _i = 0, files_1 = files; _i < files_1.length; _i++) { var current = files_1[_i]; - var name_1 = combinePaths(path, current); - var absoluteName = combinePaths(absolutePath, current); - if ((!extensions || fileExtensionIsAny(name_1, extensions)) && - (!includeFileRegex || includeFileRegex.test(absoluteName)) && - (!excludeRegex || !excludeRegex.test(absoluteName))) { - result.push(name_1); - } + _loop_1(current); } for (var _b = 0, directories_1 = directories; _b < directories_1.length; _b++) { var current = directories_1[_b]; - var name_2 = combinePaths(path, current); + var name = combinePaths(path, current); var absoluteName = combinePaths(absolutePath, current); if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) && (!excludeRegex || !excludeRegex.test(absoluteName))) { - visitDirectory(name_2, absoluteName); + visitDirectory(name, absoluteName); } } } @@ -1628,14 +2701,14 @@ var ts; includeBasePaths.push(getIncludeBasePath(absolute)); } includeBasePaths.sort(useCaseSensitiveFileNames ? compareStrings : compareStringsCaseInsensitive); - var _loop_1 = function (includeBasePath) { + var _loop_2 = function (includeBasePath) { if (ts.every(basePaths, function (basePath) { return !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames); })) { basePaths.push(includeBasePath); } }; for (var _a = 0, includeBasePaths_1 = includeBasePaths; _a < includeBasePaths_1.length; _a++) { var includeBasePath = includeBasePaths_1[_a]; - _loop_1(includeBasePath); + _loop_2(includeBasePath); } } return basePaths; @@ -1673,8 +2746,19 @@ var ts; ts.supportedTypescriptExtensionsForExtractExtension = [".d.ts", ".ts", ".tsx"]; ts.supportedJavascriptExtensions = [".js", ".jsx"]; var allSupportedExtensions = ts.supportedTypeScriptExtensions.concat(ts.supportedJavascriptExtensions); - function getSupportedExtensions(options) { - return options && options.allowJs ? allSupportedExtensions : ts.supportedTypeScriptExtensions; + function getSupportedExtensions(options, extraFileExtensions) { + var needAllExtensions = options && options.allowJs; + if (!extraFileExtensions || extraFileExtensions.length === 0 || !needAllExtensions) { + return needAllExtensions ? allSupportedExtensions : ts.supportedTypeScriptExtensions; + } + var extensions = allSupportedExtensions.slice(0); + for (var _i = 0, extraFileExtensions_1 = extraFileExtensions; _i < extraFileExtensions_1.length; _i++) { + var extInfo = extraFileExtensions_1[_i]; + if (extensions.indexOf(extInfo.extension) === -1) { + extensions.push(extInfo.extension); + } + } + return extensions; } ts.getSupportedExtensions = getSupportedExtensions; function hasJavaScriptFileExtension(fileName) { @@ -1685,11 +2769,11 @@ var ts; return forEach(ts.supportedTypeScriptExtensions, function (extension) { return fileExtensionIs(fileName, extension); }); } ts.hasTypeScriptFileExtension = hasTypeScriptFileExtension; - function isSupportedSourceFileName(fileName, compilerOptions) { + function isSupportedSourceFileName(fileName, compilerOptions, extraFileExtensions) { if (!fileName) { return false; } - for (var _i = 0, _a = getSupportedExtensions(compilerOptions); _i < _a.length; _i++) { + for (var _i = 0, _a = getSupportedExtensions(compilerOptions, extraFileExtensions); _i < _a.length; _i++) { var extension = _a[_i]; if (fileExtensionIs(fileName, extension)) { return true; @@ -1698,33 +2782,40 @@ var ts; return false; } ts.isSupportedSourceFileName = isSupportedSourceFileName; + var ExtensionPriority; + (function (ExtensionPriority) { + ExtensionPriority[ExtensionPriority["TypeScriptFiles"] = 0] = "TypeScriptFiles"; + ExtensionPriority[ExtensionPriority["DeclarationAndJavaScriptFiles"] = 2] = "DeclarationAndJavaScriptFiles"; + ExtensionPriority[ExtensionPriority["Highest"] = 0] = "Highest"; + ExtensionPriority[ExtensionPriority["Lowest"] = 2] = "Lowest"; + })(ExtensionPriority = ts.ExtensionPriority || (ts.ExtensionPriority = {})); function getExtensionPriority(path, supportedExtensions) { for (var i = supportedExtensions.length - 1; i >= 0; i--) { if (fileExtensionIs(path, supportedExtensions[i])) { - return adjustExtensionPriority(i); + return adjustExtensionPriority(i, supportedExtensions); } } return 0; } ts.getExtensionPriority = getExtensionPriority; - function adjustExtensionPriority(extensionPriority) { + function adjustExtensionPriority(extensionPriority, supportedExtensions) { if (extensionPriority < 2) { return 0; } - else if (extensionPriority < 5) { + else if (extensionPriority < supportedExtensions.length) { return 2; } else { - return 5; + return supportedExtensions.length; } } ts.adjustExtensionPriority = adjustExtensionPriority; - function getNextLowestExtensionPriority(extensionPriority) { + function getNextLowestExtensionPriority(extensionPriority, supportedExtensions) { if (extensionPriority < 2) { return 2; } else { - return 5; + return supportedExtensions.length; } } ts.getNextLowestExtensionPriority = getNextLowestExtensionPriority; @@ -1782,6 +2873,13 @@ var ts; getTypeConstructor: function () { return Type; }, getSignatureConstructor: function () { return Signature; } }; + var AssertionLevel; + (function (AssertionLevel) { + AssertionLevel[AssertionLevel["None"] = 0] = "None"; + AssertionLevel[AssertionLevel["Normal"] = 1] = "Normal"; + AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive"; + AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive"; + })(AssertionLevel = ts.AssertionLevel || (ts.AssertionLevel = {})); var Debug; (function (Debug) { Debug.currentAssertionLevel = 0; @@ -1933,136 +3031,29 @@ var ts; } } ts.tryGetExtensionFromPath = tryGetExtensionFromPath; + function isCheckJsEnabledForFile(sourceFile, compilerOptions) { + return sourceFile.checkJsDirective ? sourceFile.checkJsDirective.enabled : compilerOptions.checkJs; + } + ts.isCheckJsEnabledForFile = isCheckJsEnabledForFile; })(ts || (ts = {})); var ts; (function (ts) { - ts.sys = (function () { - function getWScriptSystem() { - var fso = new ActiveXObject("Scripting.FileSystemObject"); - var shell = new ActiveXObject("WScript.Shell"); - var fileStream = new ActiveXObject("ADODB.Stream"); - fileStream.Type = 2; - var binaryStream = new ActiveXObject("ADODB.Stream"); - binaryStream.Type = 1; - var args = []; - for (var i = 0; i < WScript.Arguments.length; i++) { - args[i] = WScript.Arguments.Item(i); - } - function readFile(fileName, encoding) { - if (!fso.FileExists(fileName)) { - return undefined; - } - fileStream.Open(); - try { - if (encoding) { - fileStream.Charset = encoding; - fileStream.LoadFromFile(fileName); - } - else { - fileStream.Charset = "x-ansi"; - fileStream.LoadFromFile(fileName); - var bom = fileStream.ReadText(2) || ""; - fileStream.Position = 0; - fileStream.Charset = bom.length >= 2 && (bom.charCodeAt(0) === 0xFF && bom.charCodeAt(1) === 0xFE || bom.charCodeAt(0) === 0xFE && bom.charCodeAt(1) === 0xFF) ? "unicode" : "utf-8"; - } - return fileStream.ReadText(); - } - catch (e) { - throw e; - } - finally { - fileStream.Close(); - } - } - function writeFile(fileName, data, writeByteOrderMark) { - fileStream.Open(); - binaryStream.Open(); - try { - fileStream.Charset = "utf-8"; - fileStream.WriteText(data); - if (writeByteOrderMark) { - fileStream.Position = 0; - } - else { - fileStream.Position = 3; - } - fileStream.CopyTo(binaryStream); - binaryStream.SaveToFile(fileName, 2); - } - finally { - binaryStream.Close(); - fileStream.Close(); - } - } - function getNames(collection) { - var result = []; - for (var e = new Enumerator(collection); !e.atEnd(); e.moveNext()) { - result.push(e.item().Name); - } - return result.sort(); - } - function getDirectories(path) { - var folder = fso.GetFolder(path); - return getNames(folder.subfolders); - } - function getAccessibleFileSystemEntries(path) { - try { - var folder = fso.GetFolder(path || "."); - var files = getNames(folder.files); - var directories = getNames(folder.subfolders); - return { files: files, directories: directories }; - } - catch (e) { - return { files: [], directories: [] }; - } - } - function readDirectory(path, extensions, excludes, includes) { - return ts.matchFiles(path, extensions, excludes, includes, false, shell.CurrentDirectory, getAccessibleFileSystemEntries); - } - var wscriptSystem = { - args: args, - newLine: "\r\n", - useCaseSensitiveFileNames: false, - write: function (s) { - WScript.StdOut.Write(s); - }, - readFile: readFile, - writeFile: writeFile, - resolvePath: function (path) { - return fso.GetAbsolutePathName(path); - }, - fileExists: function (path) { - return fso.FileExists(path); - }, - directoryExists: function (path) { - return fso.FolderExists(path); - }, - createDirectory: function (directoryName) { - if (!wscriptSystem.directoryExists(directoryName)) { - fso.CreateFolder(directoryName); - } - }, - getExecutingFilePath: function () { - return WScript.ScriptFullName; - }, - getCurrentDirectory: function () { - return shell.CurrentDirectory; - }, - getDirectories: getDirectories, - getEnvironmentVariable: function (name) { - return new ActiveXObject("WScript.Shell").ExpandEnvironmentStrings("%" + name + "%"); - }, - readDirectory: readDirectory, - exit: function (exitCode) { - try { - WScript.Quit(exitCode); - } - catch (e) { - } - } - }; - return wscriptSystem; + function getNodeMajorVersion() { + if (typeof process === "undefined") { + return undefined; } + var version = process.version; + if (!version) { + return undefined; + } + var dot = version.indexOf("."); + if (dot === -1) { + return undefined; + } + return parseInt(version.substring(1, dot)); + } + ts.getNodeMajorVersion = getNodeMajorVersion; + ts.sys = (function () { function getNodeSystem() { var _fs = require("fs"); var _path = require("path"); @@ -2071,32 +3062,32 @@ var ts; var useNonPollingWatchers = process.env["TSC_NONPOLLING_WATCHER"]; function createWatchedFileSet() { var dirWatchers = ts.createMap(); - var fileWatcherCallbacks = ts.createMap(); + var fileWatcherCallbacks = ts.createMultiMap(); return { addFile: addFile, removeFile: removeFile }; function reduceDirWatcherRefCountForFile(fileName) { var dirName = ts.getDirectoryPath(fileName); - var watcher = dirWatchers[dirName]; + var watcher = dirWatchers.get(dirName); if (watcher) { watcher.referenceCount -= 1; if (watcher.referenceCount <= 0) { watcher.close(); - delete dirWatchers[dirName]; + dirWatchers.delete(dirName); } } } function addDirWatcher(dirPath) { - var watcher = dirWatchers[dirPath]; + var watcher = dirWatchers.get(dirPath); if (watcher) { watcher.referenceCount += 1; return; } watcher = _fs.watch(dirPath, { persistent: true }, function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); watcher.referenceCount = 1; - dirWatchers[dirPath] = watcher; + dirWatchers.set(dirPath, watcher); return; } function addFileWatcherCallback(filePath, callback) { - ts.multiMapAdd(fileWatcherCallbacks, filePath, callback); + fileWatcherCallbacks.add(filePath, callback); } function addFile(fileName, callback) { addFileWatcherCallback(fileName, callback); @@ -2108,24 +3099,26 @@ var ts; reduceDirWatcherRefCountForFile(watchedFile.fileName); } function removeFileWatcherCallback(filePath, callback) { - ts.multiMapRemove(fileWatcherCallbacks, filePath, callback); + fileWatcherCallbacks.remove(filePath, callback); } function fileEventHandler(eventName, relativeFileName, baseDirPath) { var fileName = typeof relativeFileName !== "string" ? undefined : ts.getNormalizedAbsolutePath(relativeFileName, baseDirPath); - if ((eventName === "change" || eventName === "rename") && fileWatcherCallbacks[fileName]) { - for (var _i = 0, _a = fileWatcherCallbacks[fileName]; _i < _a.length; _i++) { - var fileCallback = _a[_i]; - fileCallback(fileName); + if ((eventName === "change" || eventName === "rename")) { + var callbacks = fileWatcherCallbacks.get(fileName); + if (callbacks) { + for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) { + var fileCallback = callbacks_1[_i]; + fileCallback(fileName); + } } } } } var watchedFileSet = createWatchedFileSet(); - function isNode4OrLater() { - return parseInt(process.version.charAt(1)) >= 4; - } + var nodeVersion = getNodeMajorVersion(); + var isNode4OrLater = nodeVersion >= 4; function isFileSystemCaseSensitive() { if (platform === "win32" || platform === "win64") { return false; @@ -2182,10 +3175,10 @@ var ts; if (entry === "." || entry === "..") { continue; } - var name_3 = ts.combinePaths(path, entry); + var name = ts.combinePaths(path, entry); var stat = void 0; try { - stat = _fs.statSync(name_3); + stat = _fs.statSync(name); } catch (e) { continue; @@ -2206,6 +3199,11 @@ var ts; function readDirectory(path, extensions, excludes, includes) { return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), getAccessibleFileSystemEntries); } + var FileSystemEntryKind; + (function (FileSystemEntryKind) { + FileSystemEntryKind[FileSystemEntryKind["File"] = 0] = "File"; + FileSystemEntryKind[FileSystemEntryKind["Directory"] = 1] = "Directory"; + })(FileSystemEntryKind || (FileSystemEntryKind = {})); function fileSystemEntryExists(path, entryKind) { try { var stat = _fs.statSync(path); @@ -2262,7 +3260,7 @@ var ts; if (!directoryExists(directoryName)) { return noOpFileWatcher; } - if (isNode4OrLater() && (process.platform === "win32" || process.platform === "darwin")) { + if (isNode4OrLater && (process.platform === "win32" || process.platform === "darwin")) { options = { persistent: true, recursive: !!recursive }; } else { @@ -2272,7 +3270,6 @@ var ts; if (eventName === "rename") { callback(!relativeFileName ? relativeFileName : ts.normalizePath(ts.combinePaths(directoryName, relativeFileName))); } - ; }); }, resolvePath: function (path) { @@ -2389,9 +3386,6 @@ var ts; if (typeof ChakraHost !== "undefined") { sys = getChakraSystem(); } - else if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { - sys = getWScriptSystem(); - } else if (typeof process !== "undefined" && process.nextTick && !process.browser && typeof require !== "undefined") { sys = getNodeSystem(); } @@ -2460,11 +3454,11 @@ var ts; Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value: { code: 1055, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055", message: "Type '{0}' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value." }, Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: ts.DiagnosticCategory.Error, key: "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056", message: "Accessors are only available when targeting ECMAScript 5 and higher." }, An_async_function_or_method_must_have_a_valid_awaitable_return_type: { code: 1057, category: ts.DiagnosticCategory.Error, key: "An_async_function_or_method_must_have_a_valid_awaitable_return_type_1057", message: "An async function or method must have a valid awaitable return type." }, - Operand_for_await_does_not_have_a_valid_callable_then_member: { code: 1058, category: ts.DiagnosticCategory.Error, key: "Operand_for_await_does_not_have_a_valid_callable_then_member_1058", message: "Operand for 'await' does not have a valid callable 'then' member." }, - Return_expression_in_async_function_does_not_have_a_valid_callable_then_member: { code: 1059, category: ts.DiagnosticCategory.Error, key: "Return_expression_in_async_function_does_not_have_a_valid_callable_then_member_1059", message: "Return expression in async function does not have a valid callable 'then' member." }, - Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member: { code: 1060, category: ts.DiagnosticCategory.Error, key: "Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member_1060", message: "Expression body for async arrow function does not have a valid callable 'then' member." }, + The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1058, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058", message: "The return type of an async function must either be a valid promise or must not contain a callable 'then' member." }, + A_promise_must_have_a_then_method: { code: 1059, category: ts.DiagnosticCategory.Error, key: "A_promise_must_have_a_then_method_1059", message: "A promise must have a 'then' method." }, + The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback: { code: 1060, category: ts.DiagnosticCategory.Error, key: "The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060", message: "The first parameter of the 'then' method of a promise must be a callback." }, Enum_member_must_have_initializer: { code: 1061, category: ts.DiagnosticCategory.Error, key: "Enum_member_must_have_initializer_1061", message: "Enum member must have initializer." }, - _0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: { code: 1062, category: ts.DiagnosticCategory.Error, key: "_0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062", message: "{0} is referenced directly or indirectly in the fulfillment callback of its own 'then' method." }, + Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: { code: 1062, category: ts.DiagnosticCategory.Error, key: "Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062", message: "Type is referenced directly or indirectly in the fulfillment callback of its own 'then' method." }, An_export_assignment_cannot_be_used_in_a_namespace: { code: 1063, category: ts.DiagnosticCategory.Error, key: "An_export_assignment_cannot_be_used_in_a_namespace_1063", message: "An export assignment cannot be used in a namespace." }, The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type: { code: 1064, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1064", message: "The return type of an async function or method must be the global Promise type." }, In_ambient_enum_declarations_member_initializer_must_be_constant_expression: { code: 1066, category: ts.DiagnosticCategory.Error, key: "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066", message: "In ambient enum declarations member initializer must be constant expression." }, @@ -2473,7 +3467,7 @@ var ts; _0_modifier_cannot_appear_on_an_index_signature: { code: 1071, category: ts.DiagnosticCategory.Error, key: "_0_modifier_cannot_appear_on_an_index_signature_1071", message: "'{0}' modifier cannot appear on an index signature." }, A_0_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: ts.DiagnosticCategory.Error, key: "A_0_modifier_cannot_be_used_with_an_import_declaration_1079", message: "A '{0}' modifier cannot be used with an import declaration." }, Invalid_reference_directive_syntax: { code: 1084, category: ts.DiagnosticCategory.Error, key: "Invalid_reference_directive_syntax_1084", message: "Invalid 'reference' directive syntax." }, - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: ts.DiagnosticCategory.Error, key: "Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_1085", message: "Octal literals are not available when targeting ECMAScript 5 and higher." }, + Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0: { code: 1085, category: ts.DiagnosticCategory.Error, key: "Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0_1085", message: "Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '{0}'." }, An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: ts.DiagnosticCategory.Error, key: "An_accessor_cannot_be_declared_in_an_ambient_context_1086", message: "An accessor cannot be declared in an ambient context." }, _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: ts.DiagnosticCategory.Error, key: "_0_modifier_cannot_appear_on_a_constructor_declaration_1089", message: "'{0}' modifier cannot appear on a constructor declaration." }, _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: ts.DiagnosticCategory.Error, key: "_0_modifier_cannot_appear_on_a_parameter_1090", message: "'{0}' modifier cannot appear on a parameter." }, @@ -2489,6 +3483,7 @@ var ts; Invalid_use_of_0_in_strict_mode: { code: 1100, category: ts.DiagnosticCategory.Error, key: "Invalid_use_of_0_in_strict_mode_1100", message: "Invalid use of '{0}' in strict mode." }, with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: ts.DiagnosticCategory.Error, key: "with_statements_are_not_allowed_in_strict_mode_1101", message: "'with' statements are not allowed in strict mode." }, delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: ts.DiagnosticCategory.Error, key: "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102", message: "'delete' cannot be called on an identifier in strict mode." }, + A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator: { code: 1103, category: ts.DiagnosticCategory.Error, key: "A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator_1103", message: "A 'for-await-of' statement is only allowed within an async function or async generator." }, A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: ts.DiagnosticCategory.Error, key: "A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104", message: "A 'continue' statement can only be used within an enclosing iteration statement." }, A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: ts.DiagnosticCategory.Error, key: "A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105", message: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, Jump_target_cannot_cross_function_boundary: { code: 1107, category: ts.DiagnosticCategory.Error, key: "Jump_target_cannot_cross_function_boundary_1107", message: "Jump target cannot cross function boundary." }, @@ -2496,7 +3491,7 @@ var ts; Expression_expected: { code: 1109, category: ts.DiagnosticCategory.Error, key: "Expression_expected_1109", message: "Expression expected." }, Type_expected: { code: 1110, category: ts.DiagnosticCategory.Error, key: "Type_expected_1110", message: "Type expected." }, A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: ts.DiagnosticCategory.Error, key: "A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113", message: "A 'default' clause cannot appear more than once in a 'switch' statement." }, - Duplicate_label_0: { code: 1114, category: ts.DiagnosticCategory.Error, key: "Duplicate_label_0_1114", message: "Duplicate label '{0}'" }, + Duplicate_label_0: { code: 1114, category: ts.DiagnosticCategory.Error, key: "Duplicate_label_0_1114", message: "Duplicate label '{0}'." }, A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: ts.DiagnosticCategory.Error, key: "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", message: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: ts.DiagnosticCategory.Error, key: "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", message: "A 'break' statement can only jump to a label of an enclosing statement." }, An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: ts.DiagnosticCategory.Error, key: "An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode_1117", message: "An object literal cannot have multiple properties with the same name in strict mode." }, @@ -2528,9 +3523,9 @@ var ts; Declaration_expected: { code: 1146, category: ts.DiagnosticCategory.Error, key: "Declaration_expected_1146", message: "Declaration expected." }, Import_declarations_in_a_namespace_cannot_reference_a_module: { code: 1147, category: ts.DiagnosticCategory.Error, key: "Import_declarations_in_a_namespace_cannot_reference_a_module_1147", message: "Import declarations in a namespace cannot reference a module." }, Cannot_use_imports_exports_or_module_augmentations_when_module_is_none: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148", message: "Cannot use imports, exports, or module augmentations when '--module' is 'none'." }, - File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", message: "File name '{0}' differs from already included file name '{1}' only in casing" }, + File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", message: "File name '{0}' differs from already included file name '{1}' only in casing." }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: ts.DiagnosticCategory.Error, key: "new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead_1150", message: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "const_declarations_must_be_initialized_1155", message: "'const' declarations must be initialized" }, + const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "const_declarations_must_be_initialized_1155", message: "'const' declarations must be initialized." }, const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: ts.DiagnosticCategory.Error, key: "const_declarations_can_only_be_declared_inside_a_block_1156", message: "'const' declarations can only be declared inside a block." }, let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: ts.DiagnosticCategory.Error, key: "let_declarations_can_only_be_declared_inside_a_block_1157", message: "'let' declarations can only be declared inside a block." }, Unterminated_template_literal: { code: 1160, category: ts.DiagnosticCategory.Error, key: "Unterminated_template_literal_1160", message: "Unterminated template literal." }, @@ -2579,11 +3574,12 @@ var ts; Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided_1208", message: "Cannot compile namespaces when the '--isolatedModules' flag is provided." }, Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided_1209", message: "Ambient const enums are not allowed when the '--isolatedModules' flag is provided." }, Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode_1210", message: "Invalid use of '{0}'. Class definitions are automatically in strict mode." }, - A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", message: "A class declaration without the 'default' modifier must have a name" }, - Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", message: "Identifier expected. '{0}' is a reserved word in strict mode" }, + A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", message: "A class declaration without the 'default' modifier must have a name." }, + Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", message: "Identifier expected. '{0}' is a reserved word in strict mode." }, Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213", message: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode: { code: 1214, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214", message: "Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode." }, Invalid_use_of_0_Modules_are_automatically_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215", message: "Invalid use of '{0}'. Modules are automatically in strict mode." }, + Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216", message: "Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules." }, Export_assignment_is_not_supported_when_module_flag_is_system: { code: 1218, category: ts.DiagnosticCategory.Error, key: "Export_assignment_is_not_supported_when_module_flag_is_system_1218", message: "Export assignment is not supported when '--module' flag is 'system'." }, Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning: { code: 1219, category: ts.DiagnosticCategory.Error, key: "Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219", message: "Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning." }, Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher: { code: 1220, category: ts.DiagnosticCategory.Error, key: "Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher_1220", message: "Generators are only available when targeting ECMAScript 2015 or higher." }, @@ -2629,6 +3625,11 @@ var ts; Global_module_exports_may_only_appear_in_declaration_files: { code: 1315, category: ts.DiagnosticCategory.Error, key: "Global_module_exports_may_only_appear_in_declaration_files_1315", message: "Global module exports may only appear in declaration files." }, Global_module_exports_may_only_appear_at_top_level: { code: 1316, category: ts.DiagnosticCategory.Error, key: "Global_module_exports_may_only_appear_at_top_level_1316", message: "Global module exports may only appear at top level." }, A_parameter_property_cannot_be_declared_using_a_rest_parameter: { code: 1317, category: ts.DiagnosticCategory.Error, key: "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317", message: "A parameter property cannot be declared using a rest parameter." }, + An_abstract_accessor_cannot_have_an_implementation: { code: 1318, category: ts.DiagnosticCategory.Error, key: "An_abstract_accessor_cannot_have_an_implementation_1318", message: "An abstract accessor cannot have an implementation." }, + A_default_export_can_only_be_used_in_an_ECMAScript_style_module: { code: 1319, category: ts.DiagnosticCategory.Error, key: "A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319", message: "A default export can only be used in an ECMAScript-style module." }, + Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1320, category: ts.DiagnosticCategory.Error, key: "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320", message: "Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member." }, + Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1321, category: ts.DiagnosticCategory.Error, key: "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321", message: "Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member." }, + Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1322, category: ts.DiagnosticCategory.Error, key: "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322", message: "Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member." }, Duplicate_identifier_0: { code: 2300, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_2300", message: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: ts.DiagnosticCategory.Error, key: "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", message: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: ts.DiagnosticCategory.Error, key: "Static_members_cannot_reference_class_type_parameters_2302", message: "Static members cannot reference class type parameters." }, @@ -2672,6 +3673,7 @@ var ts; Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: ts.DiagnosticCategory.Error, key: "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340", message: "Only public and protected methods of the base class are accessible via the 'super' keyword." }, Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: ts.DiagnosticCategory.Error, key: "Property_0_is_private_and_only_accessible_within_class_1_2341", message: "Property '{0}' is private and only accessible within class '{1}'." }, An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { code: 2342, category: ts.DiagnosticCategory.Error, key: "An_index_expression_argument_must_be_of_type_string_number_symbol_or_any_2342", message: "An index expression argument must be of type 'string', 'number', 'symbol', or 'any'." }, + This_syntax_requires_an_imported_helper_named_1_but_module_0_has_no_exported_member_1: { code: 2343, category: ts.DiagnosticCategory.Error, key: "This_syntax_requires_an_imported_helper_named_1_but_module_0_has_no_exported_member_1_2343", message: "This syntax requires an imported helper named '{1}', but module '{0}' has no exported member '{1}'." }, Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: ts.DiagnosticCategory.Error, key: "Type_0_does_not_satisfy_the_constraint_1_2344", message: "Type '{0}' does not satisfy the constraint '{1}'." }, Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: ts.DiagnosticCategory.Error, key: "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345", message: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: ts.DiagnosticCategory.Error, key: "Supplied_parameters_do_not_match_any_signature_of_call_target_2346", message: "Supplied parameters do not match any signature of call target." }, @@ -2682,19 +3684,20 @@ var ts; Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: ts.DiagnosticCategory.Error, key: "Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature_2351", message: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, Type_0_cannot_be_converted_to_type_1: { code: 2352, category: ts.DiagnosticCategory.Error, key: "Type_0_cannot_be_converted_to_type_1_2352", message: "Type '{0}' cannot be converted to type '{1}'." }, Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1: { code: 2353, category: ts.DiagnosticCategory.Error, key: "Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353", message: "Object literal may only specify known properties, and '{0}' does not exist in type '{1}'." }, + This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found: { code: 2354, category: ts.DiagnosticCategory.Error, key: "This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354", message: "This syntax requires an imported helper but module '{0}' cannot be found." }, A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value: { code: 2355, category: ts.DiagnosticCategory.Error, key: "A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_2355", message: "A function whose declared type is neither 'void' nor 'any' must return a value." }, An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: ts.DiagnosticCategory.Error, key: "An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type_2356", message: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access: { code: 2357, category: ts.DiagnosticCategory.Error, key: "The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357", message: "The operand of an increment or decrement operator must be a variable or a property access." }, The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358", message: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359", message: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { code: 2360, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol_2360", message: "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'." }, - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter_2361", message: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter_2361", message: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter." }, The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2362", message: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2363", message: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access: { code: 2364, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364", message: "The left-hand side of an assignment expression must be a variable or a property access." }, Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: ts.DiagnosticCategory.Error, key: "Operator_0_cannot_be_applied_to_types_1_and_2_2365", message: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined: { code: 2366, category: ts.DiagnosticCategory.Error, key: "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366", message: "Function lacks ending return statement and return type does not include 'undefined'." }, - Type_parameter_name_cannot_be_0: { code: 2368, category: ts.DiagnosticCategory.Error, key: "Type_parameter_name_cannot_be_0_2368", message: "Type parameter name cannot be '{0}'" }, + Type_parameter_name_cannot_be_0: { code: 2368, category: ts.DiagnosticCategory.Error, key: "Type_parameter_name_cannot_be_0_2368", message: "Type parameter name cannot be '{0}'." }, A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: ts.DiagnosticCategory.Error, key: "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369", message: "A parameter property is only allowed in a constructor implementation." }, A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: ts.DiagnosticCategory.Error, key: "A_rest_parameter_must_be_of_an_array_type_2370", message: "A rest parameter must be of an array type." }, A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: ts.DiagnosticCategory.Error, key: "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371", message: "A parameter initializer is only allowed in a function or constructor implementation." }, @@ -2734,12 +3737,12 @@ var ts; The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access: { code: 2406, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406", message: "The left-hand side of a 'for...in' statement must be a variable or a property access." }, The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_2407", message: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, Setters_cannot_return_a_value: { code: 2408, category: ts.DiagnosticCategory.Error, key: "Setters_cannot_return_a_value_2408", message: "Setters cannot return a value." }, - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: ts.DiagnosticCategory.Error, key: "Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409", message: "Return type of constructor signature must be assignable to the instance type of the class" }, + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: ts.DiagnosticCategory.Error, key: "Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409", message: "Return type of constructor signature must be assignable to the instance type of the class." }, The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any: { code: 2410, category: ts.DiagnosticCategory.Error, key: "The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410", message: "The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'." }, Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: ts.DiagnosticCategory.Error, key: "Property_0_of_type_1_is_not_assignable_to_string_index_type_2_2411", message: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: ts.DiagnosticCategory.Error, key: "Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2_2412", message: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: ts.DiagnosticCategory.Error, key: "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413", message: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, - Class_name_cannot_be_0: { code: 2414, category: ts.DiagnosticCategory.Error, key: "Class_name_cannot_be_0_2414", message: "Class name cannot be '{0}'" }, + Class_name_cannot_be_0: { code: 2414, category: ts.DiagnosticCategory.Error, key: "Class_name_cannot_be_0_2414", message: "Class name cannot be '{0}'." }, Class_0_incorrectly_extends_base_class_1: { code: 2415, category: ts.DiagnosticCategory.Error, key: "Class_0_incorrectly_extends_base_class_1_2415", message: "Class '{0}' incorrectly extends base class '{1}'." }, Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: ts.DiagnosticCategory.Error, key: "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", message: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, Class_0_incorrectly_implements_interface_1: { code: 2420, category: ts.DiagnosticCategory.Error, key: "Class_0_incorrectly_implements_interface_1_2420", message: "Class '{0}' incorrectly implements interface '{1}'." }, @@ -2748,19 +3751,19 @@ var ts; Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: ts.DiagnosticCategory.Error, key: "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424", message: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: ts.DiagnosticCategory.Error, key: "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425", message: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: ts.DiagnosticCategory.Error, key: "Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426", message: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Interface_name_cannot_be_0: { code: 2427, category: ts.DiagnosticCategory.Error, key: "Interface_name_cannot_be_0_2427", message: "Interface name cannot be '{0}'" }, + Interface_name_cannot_be_0: { code: 2427, category: ts.DiagnosticCategory.Error, key: "Interface_name_cannot_be_0_2427", message: "Interface name cannot be '{0}'." }, All_declarations_of_0_must_have_identical_type_parameters: { code: 2428, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_0_must_have_identical_type_parameters_2428", message: "All declarations of '{0}' must have identical type parameters." }, Interface_0_incorrectly_extends_interface_1: { code: 2430, category: ts.DiagnosticCategory.Error, key: "Interface_0_incorrectly_extends_interface_1_2430", message: "Interface '{0}' incorrectly extends interface '{1}'." }, - Enum_name_cannot_be_0: { code: 2431, category: ts.DiagnosticCategory.Error, key: "Enum_name_cannot_be_0_2431", message: "Enum name cannot be '{0}'" }, + Enum_name_cannot_be_0: { code: 2431, category: ts.DiagnosticCategory.Error, key: "Enum_name_cannot_be_0_2431", message: "Enum name cannot be '{0}'." }, In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: ts.DiagnosticCategory.Error, key: "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432", message: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433", message: "A namespace declaration cannot be in a different file from a class or function with which it is merged" }, - A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434", message: "A namespace declaration cannot be located prior to a class or function with which it is merged" }, + A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433", message: "A namespace declaration cannot be in a different file from a class or function with which it is merged." }, + A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434", message: "A namespace declaration cannot be located prior to a class or function with which it is merged." }, Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces: { code: 2435, category: ts.DiagnosticCategory.Error, key: "Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435", message: "Ambient modules cannot be nested in other modules or namespaces." }, Ambient_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: ts.DiagnosticCategory.Error, key: "Ambient_module_declaration_cannot_specify_relative_module_name_2436", message: "Ambient module declaration cannot specify relative module name." }, - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: ts.DiagnosticCategory.Error, key: "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437", message: "Module '{0}' is hidden by a local declaration with the same name" }, - Import_name_cannot_be_0: { code: 2438, category: ts.DiagnosticCategory.Error, key: "Import_name_cannot_be_0_2438", message: "Import name cannot be '{0}'" }, + Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: ts.DiagnosticCategory.Error, key: "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437", message: "Module '{0}' is hidden by a local declaration with the same name." }, + Import_name_cannot_be_0: { code: 2438, category: ts.DiagnosticCategory.Error, key: "Import_name_cannot_be_0_2438", message: "Import name cannot be '{0}'." }, Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name: { code: 2439, category: ts.DiagnosticCategory.Error, key: "Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439", message: "Import or export declaration in an ambient module declaration cannot reference module through relative module name." }, - Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: ts.DiagnosticCategory.Error, key: "Import_declaration_conflicts_with_local_declaration_of_0_2440", message: "Import declaration conflicts with local declaration of '{0}'" }, + Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: ts.DiagnosticCategory.Error, key: "Import_declaration_conflicts_with_local_declaration_of_0_2440", message: "Import declaration conflicts with local declaration of '{0}'." }, Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module: { code: 2441, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441", message: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module." }, Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: ts.DiagnosticCategory.Error, key: "Types_have_separate_declarations_of_a_private_property_0_2442", message: "Types have separate declarations of a private property '{0}'." }, Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: ts.DiagnosticCategory.Error, key: "Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443", message: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, @@ -2769,18 +3772,20 @@ var ts; Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: ts.DiagnosticCategory.Error, key: "Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_2446", message: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: ts.DiagnosticCategory.Error, key: "The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447", message: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: ts.DiagnosticCategory.Error, key: "Block_scoped_variable_0_used_before_its_declaration_2448", message: "Block-scoped variable '{0}' used before its declaration." }, + Class_0_used_before_its_declaration: { code: 2449, category: ts.DiagnosticCategory.Error, key: "Class_0_used_before_its_declaration_2449", message: "Class '{0}' used before its declaration." }, + Enum_0_used_before_its_declaration: { code: 2450, category: ts.DiagnosticCategory.Error, key: "Enum_0_used_before_its_declaration_2450", message: "Enum '{0}' used before its declaration." }, Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_block_scoped_variable_0_2451", message: "Cannot redeclare block-scoped variable '{0}'." }, An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: ts.DiagnosticCategory.Error, key: "An_enum_member_cannot_have_a_numeric_name_2452", message: "An enum member cannot have a numeric name." }, The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: ts.DiagnosticCategory.Error, key: "The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_typ_2453", message: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, Variable_0_is_used_before_being_assigned: { code: 2454, category: ts.DiagnosticCategory.Error, key: "Variable_0_is_used_before_being_assigned_2454", message: "Variable '{0}' is used before being assigned." }, Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: ts.DiagnosticCategory.Error, key: "Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0_2455", message: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, Type_alias_0_circularly_references_itself: { code: 2456, category: ts.DiagnosticCategory.Error, key: "Type_alias_0_circularly_references_itself_2456", message: "Type alias '{0}' circularly references itself." }, - Type_alias_name_cannot_be_0: { code: 2457, category: ts.DiagnosticCategory.Error, key: "Type_alias_name_cannot_be_0_2457", message: "Type alias name cannot be '{0}'" }, + Type_alias_name_cannot_be_0: { code: 2457, category: ts.DiagnosticCategory.Error, key: "Type_alias_name_cannot_be_0_2457", message: "Type alias name cannot be '{0}'." }, An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: ts.DiagnosticCategory.Error, key: "An_AMD_module_cannot_have_multiple_name_assignments_2458", message: "An AMD module cannot have multiple name assignments." }, Type_0_has_no_property_1_and_no_string_index_signature: { code: 2459, category: ts.DiagnosticCategory.Error, key: "Type_0_has_no_property_1_and_no_string_index_signature_2459", message: "Type '{0}' has no property '{1}' and no string index signature." }, Type_0_has_no_property_1: { code: 2460, category: ts.DiagnosticCategory.Error, key: "Type_0_has_no_property_1_2460", message: "Type '{0}' has no property '{1}'." }, Type_0_is_not_an_array_type: { code: 2461, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_2461", message: "Type '{0}' is not an array type." }, - A_rest_element_must_be_last_in_a_destructuring_pattern: { code: 2462, category: ts.DiagnosticCategory.Error, key: "A_rest_element_must_be_last_in_a_destructuring_pattern_2462", message: "A rest element must be last in a destructuring pattern" }, + A_rest_element_must_be_last_in_a_destructuring_pattern: { code: 2462, category: ts.DiagnosticCategory.Error, key: "A_rest_element_must_be_last_in_a_destructuring_pattern_2462", message: "A rest element must be last in a destructuring pattern." }, A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { code: 2463, category: ts.DiagnosticCategory.Error, key: "A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463", message: "A binding pattern parameter cannot be optional in an implementation signature." }, A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { code: 2464, category: ts.DiagnosticCategory.Error, key: "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464", message: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." }, this_cannot_be_referenced_in_a_computed_property_name: { code: 2465, category: ts.DiagnosticCategory.Error, key: "this_cannot_be_referenced_in_a_computed_property_name_2465", message: "'this' cannot be referenced in a computed property name." }, @@ -2801,13 +3806,13 @@ var ts; let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2480, category: ts.DiagnosticCategory.Error, key: "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480", message: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2481, category: ts.DiagnosticCategory.Error, key: "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481", message: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." }, The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { code: 2483, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483", message: "The left-hand side of a 'for...of' statement cannot use a type annotation." }, - Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: ts.DiagnosticCategory.Error, key: "Export_declaration_conflicts_with_exported_declaration_of_0_2484", message: "Export declaration conflicts with exported declaration of '{0}'" }, + Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: ts.DiagnosticCategory.Error, key: "Export_declaration_conflicts_with_exported_declaration_of_0_2484", message: "Export declaration conflicts with exported declaration of '{0}'." }, The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access: { code: 2487, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487", message: "The left-hand side of a 'for...of' statement must be a variable or a property access." }, Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: ts.DiagnosticCategory.Error, key: "Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488", message: "Type must have a '[Symbol.iterator]()' method that returns an iterator." }, An_iterator_must_have_a_next_method: { code: 2489, category: ts.DiagnosticCategory.Error, key: "An_iterator_must_have_a_next_method_2489", message: "An iterator must have a 'next()' method." }, The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { code: 2490, category: ts.DiagnosticCategory.Error, key: "The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property_2490", message: "The type returned by the 'next()' method of an iterator must have a 'value' property." }, The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { code: 2491, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491", message: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." }, - Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_identifier_0_in_catch_clause_2492", message: "Cannot redeclare identifier '{0}' in catch clause" }, + Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_identifier_0_in_catch_clause_2492", message: "Cannot redeclare identifier '{0}' in catch clause." }, Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { code: 2493, category: ts.DiagnosticCategory.Error, key: "Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2_2493", message: "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'." }, Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { code: 2494, category: ts.DiagnosticCategory.Error, key: "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494", message: "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher." }, Type_0_is_not_an_array_type_or_a_string_type: { code: 2495, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_or_a_string_type_2495", message: "Type '{0}' is not an array type or a string type." }, @@ -2819,6 +3824,7 @@ var ts; A_rest_element_cannot_contain_a_binding_pattern: { code: 2501, category: ts.DiagnosticCategory.Error, key: "A_rest_element_cannot_contain_a_binding_pattern_2501", message: "A rest element cannot contain a binding pattern." }, _0_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 2502, category: ts.DiagnosticCategory.Error, key: "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502", message: "'{0}' is referenced directly or indirectly in its own type annotation." }, Cannot_find_namespace_0: { code: 2503, category: ts.DiagnosticCategory.Error, key: "Cannot_find_namespace_0_2503", message: "Cannot find namespace '{0}'." }, + Type_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator: { code: 2504, category: ts.DiagnosticCategory.Error, key: "Type_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504", message: "Type must have a '[Symbol.asyncIterator]()' method that returns an async iterator." }, A_generator_cannot_have_a_void_type_annotation: { code: 2505, category: ts.DiagnosticCategory.Error, key: "A_generator_cannot_have_a_void_type_annotation_2505", message: "A generator cannot have a 'void' type annotation." }, _0_is_referenced_directly_or_indirectly_in_its_own_base_expression: { code: 2506, category: ts.DiagnosticCategory.Error, key: "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506", message: "'{0}' is referenced directly or indirectly in its own base expression." }, Type_0_is_not_a_constructor_function_type: { code: 2507, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_a_constructor_function_type_2507", message: "Type '{0}' is not a constructor function type." }, @@ -2833,6 +3839,7 @@ var ts; All_declarations_of_an_abstract_method_must_be_consecutive: { code: 2516, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_an_abstract_method_must_be_consecutive_2516", message: "All declarations of an abstract method must be consecutive." }, Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: { code: 2517, category: ts.DiagnosticCategory.Error, key: "Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517", message: "Cannot assign an abstract constructor type to a non-abstract constructor type." }, A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: { code: 2518, category: ts.DiagnosticCategory.Error, key: "A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518", message: "A 'this'-based type guard is not compatible with a parameter-based type guard." }, + An_async_iterator_must_have_a_next_method: { code: 2519, category: ts.DiagnosticCategory.Error, key: "An_async_iterator_must_have_a_next_method_2519", message: "An async iterator must have a 'next()' method." }, Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: { code: 2520, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520", message: "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions." }, Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: { code: 2521, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions_2521", message: "Expression resolves to variable declaration '{0}' that compiler uses to support async functions." }, The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method: { code: 2522, category: ts.DiagnosticCategory.Error, key: "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522", message: "The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method." }, @@ -2856,23 +3863,33 @@ var ts; Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property: { code: 2540, category: ts.DiagnosticCategory.Error, key: "Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property_2540", message: "Cannot assign to '{0}' because it is a constant or a read-only property." }, The_target_of_an_assignment_must_be_a_variable_or_a_property_access: { code: 2541, category: ts.DiagnosticCategory.Error, key: "The_target_of_an_assignment_must_be_a_variable_or_a_property_access_2541", message: "The target of an assignment must be a variable or a property access." }, Index_signature_in_type_0_only_permits_reading: { code: 2542, category: ts.DiagnosticCategory.Error, key: "Index_signature_in_type_0_only_permits_reading_2542", message: "Index signature in type '{0}' only permits reading." }, + Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference: { code: 2543, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543", message: "Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference." }, + Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference: { code: 2544, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544", message: "Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference." }, + A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any: { code: 2545, category: ts.DiagnosticCategory.Error, key: "A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545", message: "A mixin class must have a constructor with a single rest parameter of type 'any[]'." }, + Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1: { code: 2546, category: ts.DiagnosticCategory.Error, key: "Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1_2546", message: "Property '{0}' has conflicting declarations and is inaccessible in type '{1}'." }, + The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property: { code: 2547, category: ts.DiagnosticCategory.Error, key: "The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value__2547", message: "The type returned by the 'next()' method of an async iterator must be a promise for a type with a 'value' property." }, + Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2548, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548", message: "Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator." }, + Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2549, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549", message: "Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator." }, + Generic_type_instantiation_is_excessively_deep_and_possibly_infinite: { code: 2550, category: ts.DiagnosticCategory.Error, key: "Generic_type_instantiation_is_excessively_deep_and_possibly_infinite_2550", message: "Generic type instantiation is excessively deep and possibly infinite." }, JSX_element_attributes_type_0_may_not_be_a_union_type: { code: 2600, category: ts.DiagnosticCategory.Error, key: "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", message: "JSX element attributes type '{0}' may not be a union type." }, The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: { code: 2601, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", message: "The return type of a JSX element constructor must return an object type." }, JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: { code: 2602, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", message: "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist." }, - Property_0_in_type_1_is_not_assignable_to_type_2: { code: 2603, category: ts.DiagnosticCategory.Error, key: "Property_0_in_type_1_is_not_assignable_to_type_2_2603", message: "Property '{0}' in type '{1}' is not assignable to type '{2}'" }, + Property_0_in_type_1_is_not_assignable_to_type_2: { code: 2603, category: ts.DiagnosticCategory.Error, key: "Property_0_in_type_1_is_not_assignable_to_type_2_2603", message: "Property '{0}' in type '{1}' is not assignable to type '{2}'." }, JSX_element_type_0_does_not_have_any_construct_or_call_signatures: { code: 2604, category: ts.DiagnosticCategory.Error, key: "JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604", message: "JSX element type '{0}' does not have any construct or call signatures." }, JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements: { code: 2605, category: ts.DiagnosticCategory.Error, key: "JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements_2605", message: "JSX element type '{0}' is not a constructor function for JSX elements." }, Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property: { code: 2606, category: ts.DiagnosticCategory.Error, key: "Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606", message: "Property '{0}' of JSX spread attribute is not assignable to target property." }, - JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property: { code: 2607, category: ts.DiagnosticCategory.Error, key: "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607", message: "JSX element class does not support attributes because it does not have a '{0}' property" }, - The_global_type_JSX_0_may_not_have_more_than_one_property: { code: 2608, category: ts.DiagnosticCategory.Error, key: "The_global_type_JSX_0_may_not_have_more_than_one_property_2608", message: "The global type 'JSX.{0}' may not have more than one property" }, - Cannot_emit_namespaced_JSX_elements_in_React: { code: 2650, category: ts.DiagnosticCategory.Error, key: "Cannot_emit_namespaced_JSX_elements_in_React_2650", message: "Cannot emit namespaced JSX elements in React" }, + JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property: { code: 2607, category: ts.DiagnosticCategory.Error, key: "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607", message: "JSX element class does not support attributes because it does not have a '{0}' property." }, + The_global_type_JSX_0_may_not_have_more_than_one_property: { code: 2608, category: ts.DiagnosticCategory.Error, key: "The_global_type_JSX_0_may_not_have_more_than_one_property_2608", message: "The global type 'JSX.{0}' may not have more than one property." }, + JSX_spread_child_must_be_an_array_type: { code: 2609, category: ts.DiagnosticCategory.Error, key: "JSX_spread_child_must_be_an_array_type_2609", message: "JSX spread child must be an array type." }, + Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: { code: 2649, category: ts.DiagnosticCategory.Error, key: "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", message: "Cannot augment module '{0}' with value exports because it resolves to a non-module entity." }, + Cannot_emit_namespaced_JSX_elements_in_React: { code: 2650, category: ts.DiagnosticCategory.Error, key: "Cannot_emit_namespaced_JSX_elements_in_React_2650", message: "Cannot emit namespaced JSX elements in React." }, A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: { code: 2651, category: ts.DiagnosticCategory.Error, key: "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", message: "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums." }, Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: { code: 2652, category: ts.DiagnosticCategory.Error, key: "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", message: "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead." }, Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1: { code: 2653, category: ts.DiagnosticCategory.Error, key: "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653", message: "Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'." }, Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_package_author_to_update_the_package_definition: { code: 2654, category: ts.DiagnosticCategory.Error, key: "Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_pack_2654", message: "Exported external package typings file cannot contain tripleslash references. Please contact the package author to update the package definition." }, Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition: { code: 2656, category: ts.DiagnosticCategory.Error, key: "Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_2656", message: "Exported external package typings file '{0}' is not a module. Please contact the package author to update the package definition." }, - JSX_expressions_must_have_one_parent_element: { code: 2657, category: ts.DiagnosticCategory.Error, key: "JSX_expressions_must_have_one_parent_element_2657", message: "JSX expressions must have one parent element" }, - Type_0_provides_no_match_for_the_signature_1: { code: 2658, category: ts.DiagnosticCategory.Error, key: "Type_0_provides_no_match_for_the_signature_1_2658", message: "Type '{0}' provides no match for the signature '{1}'" }, + JSX_expressions_must_have_one_parent_element: { code: 2657, category: ts.DiagnosticCategory.Error, key: "JSX_expressions_must_have_one_parent_element_2657", message: "JSX expressions must have one parent element." }, + Type_0_provides_no_match_for_the_signature_1: { code: 2658, category: ts.DiagnosticCategory.Error, key: "Type_0_provides_no_match_for_the_signature_1_2658", message: "Type '{0}' provides no match for the signature '{1}'." }, super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: { code: 2659, category: ts.DiagnosticCategory.Error, key: "super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659", message: "'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher." }, super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: { code: 2660, category: ts.DiagnosticCategory.Error, key: "super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660", message: "'super' can only be referenced in members of derived classes or object literal expressions." }, Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module: { code: 2661, category: ts.DiagnosticCategory.Error, key: "Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661", message: "Cannot export '{0}'. Only local declarations can be exported from a module." }, @@ -2904,7 +3921,6 @@ var ts; All_declarations_of_0_must_have_identical_modifiers: { code: 2687, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_0_must_have_identical_modifiers_2687", message: "All declarations of '{0}' must have identical modifiers." }, Cannot_find_type_definition_file_for_0: { code: 2688, category: ts.DiagnosticCategory.Error, key: "Cannot_find_type_definition_file_for_0_2688", message: "Cannot find type definition file for '{0}'." }, Cannot_extend_an_interface_0_Did_you_mean_implements: { code: 2689, category: ts.DiagnosticCategory.Error, key: "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", message: "Cannot extend an interface '{0}'. Did you mean 'implements'?" }, - A_class_must_be_declared_after_its_base_class: { code: 2690, category: ts.DiagnosticCategory.Error, key: "A_class_must_be_declared_after_its_base_class_2690", message: "A class must be declared after its base class." }, An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: { code: 2691, category: ts.DiagnosticCategory.Error, key: "An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691", message: "An import path cannot end with a '{0}' extension. Consider importing '{1}' instead." }, _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: { code: 2692, category: ts.DiagnosticCategory.Error, key: "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", message: "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible." }, _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: { code: 2693, category: ts.DiagnosticCategory.Error, key: "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", message: "'{0}' only refers to a type, but is being used as a value here." }, @@ -2913,9 +3929,17 @@ var ts; The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead: { code: 2696, category: ts.DiagnosticCategory.Error, key: "The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696", message: "The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?" }, An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: { code: 2697, category: ts.DiagnosticCategory.Error, key: "An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697", message: "An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your `--lib` option." }, Spread_types_may_only_be_created_from_object_types: { code: 2698, category: ts.DiagnosticCategory.Error, key: "Spread_types_may_only_be_created_from_object_types_2698", message: "Spread types may only be created from object types." }, + Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1: { code: 2699, category: ts.DiagnosticCategory.Error, key: "Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699", message: "Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'." }, Rest_types_may_only_be_created_from_object_types: { code: 2700, category: ts.DiagnosticCategory.Error, key: "Rest_types_may_only_be_created_from_object_types_2700", message: "Rest types may only be created from object types." }, The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access: { code: 2701, category: ts.DiagnosticCategory.Error, key: "The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701", message: "The target of an object rest assignment must be a variable or a property access." }, _0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here: { code: 2702, category: ts.DiagnosticCategory.Error, key: "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702", message: "'{0}' only refers to a type, but is being used as a namespace here." }, + The_operand_of_a_delete_operator_must_be_a_property_reference: { code: 2703, category: ts.DiagnosticCategory.Error, key: "The_operand_of_a_delete_operator_must_be_a_property_reference_2703", message: "The operand of a delete operator must be a property reference." }, + The_operand_of_a_delete_operator_cannot_be_a_read_only_property: { code: 2704, category: ts.DiagnosticCategory.Error, key: "The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704", message: "The operand of a delete operator cannot be a read-only property." }, + An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: { code: 2705, category: ts.DiagnosticCategory.Error, key: "An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705", message: "An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option." }, + Required_type_parameters_may_not_follow_optional_type_parameters: { code: 2706, category: ts.DiagnosticCategory.Error, key: "Required_type_parameters_may_not_follow_optional_type_parameters_2706", message: "Required type parameters may not follow optional type parameters." }, + Generic_type_0_requires_between_1_and_2_type_arguments: { code: 2707, category: ts.DiagnosticCategory.Error, key: "Generic_type_0_requires_between_1_and_2_type_arguments_2707", message: "Generic type '{0}' requires between {1} and {2} type arguments." }, + Cannot_use_namespace_0_as_a_value: { code: 2708, category: ts.DiagnosticCategory.Error, key: "Cannot_use_namespace_0_as_a_value_2708", message: "Cannot use namespace '{0}' as a value." }, + Cannot_use_namespace_0_as_a_type: { code: 2709, category: ts.DiagnosticCategory.Error, key: "Cannot_use_namespace_0_as_a_type_2709", message: "Cannot use namespace '{0}' as a type." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "Import_declaration_0_is_using_private_name_1_4000", message: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", message: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", message: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, @@ -2926,8 +3950,8 @@ var ts; Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014", message: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016", message: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: ts.DiagnosticCategory.Error, key: "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019", message: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: ts.DiagnosticCategory.Error, key: "Extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020", message: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: ts.DiagnosticCategory.Error, key: "Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022", message: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, + extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: ts.DiagnosticCategory.Error, key: "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020", message: "'extends' clause of exported class '{0}' has or is using private name '{1}'." }, + extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: ts.DiagnosticCategory.Error, key: "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022", message: "'extends' clause of exported interface '{0}' has or is using private name '{1}'." }, Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: ts.DiagnosticCategory.Error, key: "Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023", message: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: ts.DiagnosticCategory.Error, key: "Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024", message: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: ts.DiagnosticCategory.Error, key: "Exported_variable_0_has_or_is_using_private_name_1_4025", message: "Exported variable '{0}' has or is using private name '{1}'." }, @@ -2988,16 +4012,18 @@ var ts; Default_export_of_the_module_has_or_is_using_private_name_0: { code: 4082, category: ts.DiagnosticCategory.Error, key: "Default_export_of_the_module_has_or_is_using_private_name_0_4082", message: "Default export of the module has or is using private name '{0}'." }, Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: { code: 4083, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", message: "Type parameter '{0}' of exported type alias has or is using private name '{1}'." }, Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: { code: 4090, category: ts.DiagnosticCategory.Message, key: "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", message: "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict." }, + Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4091, category: ts.DiagnosticCategory.Error, key: "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", message: "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4092, category: ts.DiagnosticCategory.Error, key: "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", message: "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'." }, + extends_clause_of_exported_class_0_refers_to_a_type_whose_name_cannot_be_referenced: { code: 4093, category: ts.DiagnosticCategory.Error, key: "extends_clause_of_exported_class_0_refers_to_a_type_whose_name_cannot_be_referenced_4093", message: "'extends' clause of exported class '{0}' refers to a type whose name cannot be referenced." }, The_current_host_does_not_support_the_0_option: { code: 5001, category: ts.DiagnosticCategory.Error, key: "The_current_host_does_not_support_the_0_option_5001", message: "The current host does not support the '{0}' option." }, Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: ts.DiagnosticCategory.Error, key: "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", message: "Cannot find the common subdirectory path for the input files." }, File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: { code: 5010, category: ts.DiagnosticCategory.Error, key: "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", message: "File specification cannot end in a recursive directory wildcard ('**'): '{0}'." }, File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0: { code: 5011, category: ts.DiagnosticCategory.Error, key: "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011", message: "File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'." }, - Cannot_read_file_0_Colon_1: { code: 5012, category: ts.DiagnosticCategory.Error, key: "Cannot_read_file_0_Colon_1_5012", message: "Cannot read file '{0}': {1}" }, - Unsupported_file_encoding: { code: 5013, category: ts.DiagnosticCategory.Error, key: "Unsupported_file_encoding_5013", message: "Unsupported file encoding." }, + Cannot_read_file_0_Colon_1: { code: 5012, category: ts.DiagnosticCategory.Error, key: "Cannot_read_file_0_Colon_1_5012", message: "Cannot read file '{0}': {1}." }, Failed_to_parse_file_0_Colon_1: { code: 5014, category: ts.DiagnosticCategory.Error, key: "Failed_to_parse_file_0_Colon_1_5014", message: "Failed to parse file '{0}': {1}." }, Unknown_compiler_option_0: { code: 5023, category: ts.DiagnosticCategory.Error, key: "Unknown_compiler_option_0_5023", message: "Unknown compiler option '{0}'." }, Compiler_option_0_requires_a_value_of_type_1: { code: 5024, category: ts.DiagnosticCategory.Error, key: "Compiler_option_0_requires_a_value_of_type_1_5024", message: "Compiler option '{0}' requires a value of type {1}." }, - Could_not_write_file_0_Colon_1: { code: 5033, category: ts.DiagnosticCategory.Error, key: "Could_not_write_file_0_Colon_1_5033", message: "Could not write file '{0}': {1}" }, + Could_not_write_file_0_Colon_1: { code: 5033, category: ts.DiagnosticCategory.Error, key: "Could_not_write_file_0_Colon_1_5033", message: "Could not write file '{0}': {1}." }, Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: ts.DiagnosticCategory.Error, key: "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042", message: "Option 'project' cannot be mixed with source files on a command line." }, Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher: { code: 5047, category: ts.DiagnosticCategory.Error, key: "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047", message: "Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher." }, Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: { code: 5051, category: ts.DiagnosticCategory.Error, key: "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051", message: "Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided." }, @@ -3006,12 +4032,12 @@ var ts; A_tsconfig_json_file_is_already_defined_at_Colon_0: { code: 5054, category: ts.DiagnosticCategory.Error, key: "A_tsconfig_json_file_is_already_defined_at_Colon_0_5054", message: "A 'tsconfig.json' file is already defined at: '{0}'." }, Cannot_write_file_0_because_it_would_overwrite_input_file: { code: 5055, category: ts.DiagnosticCategory.Error, key: "Cannot_write_file_0_because_it_would_overwrite_input_file_5055", message: "Cannot write file '{0}' because it would overwrite input file." }, Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files: { code: 5056, category: ts.DiagnosticCategory.Error, key: "Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056", message: "Cannot write file '{0}' because it would be overwritten by multiple input files." }, - Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: { code: 5057, category: ts.DiagnosticCategory.Error, key: "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", message: "Cannot find a tsconfig.json file at the specified directory: '{0}'" }, - The_specified_path_does_not_exist_Colon_0: { code: 5058, category: ts.DiagnosticCategory.Error, key: "The_specified_path_does_not_exist_Colon_0_5058", message: "The specified path does not exist: '{0}'" }, + Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: { code: 5057, category: ts.DiagnosticCategory.Error, key: "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", message: "Cannot find a tsconfig.json file at the specified directory: '{0}'." }, + The_specified_path_does_not_exist_Colon_0: { code: 5058, category: ts.DiagnosticCategory.Error, key: "The_specified_path_does_not_exist_Colon_0_5058", message: "The specified path does not exist: '{0}'." }, Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: { code: 5059, category: ts.DiagnosticCategory.Error, key: "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", message: "Invalid value for '--reactNamespace'. '{0}' is not a valid identifier." }, Option_paths_cannot_be_used_without_specifying_baseUrl_option: { code: 5060, category: ts.DiagnosticCategory.Error, key: "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060", message: "Option 'paths' cannot be used without specifying '--baseUrl' option." }, - Pattern_0_can_have_at_most_one_Asterisk_character: { code: 5061, category: ts.DiagnosticCategory.Error, key: "Pattern_0_can_have_at_most_one_Asterisk_character_5061", message: "Pattern '{0}' can have at most one '*' character" }, - Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character: { code: 5062, category: ts.DiagnosticCategory.Error, key: "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062", message: "Substitution '{0}' in pattern '{1}' in can have at most one '*' character" }, + Pattern_0_can_have_at_most_one_Asterisk_character: { code: 5061, category: ts.DiagnosticCategory.Error, key: "Pattern_0_can_have_at_most_one_Asterisk_character_5061", message: "Pattern '{0}' can have at most one '*' character." }, + Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character: { code: 5062, category: ts.DiagnosticCategory.Error, key: "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062", message: "Substitution '{0}' in pattern '{1}' in can have at most one '*' character." }, Substitutions_for_pattern_0_should_be_an_array: { code: 5063, category: ts.DiagnosticCategory.Error, key: "Substitutions_for_pattern_0_should_be_an_array_5063", message: "Substitutions for pattern '{0}' should be an array." }, Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2: { code: 5064, category: ts.DiagnosticCategory.Error, key: "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064", message: "Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'." }, File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: { code: 5065, category: ts.DiagnosticCategory.Error, key: "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065", message: "File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'." }, @@ -3029,11 +4055,11 @@ var ts; Do_not_emit_outputs: { code: 6010, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_outputs_6010", message: "Do not emit outputs." }, Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: { code: 6011, category: ts.DiagnosticCategory.Message, key: "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", message: "Allow default imports from modules with no default export. This does not affect code emit, just typechecking." }, Skip_type_checking_of_declaration_files: { code: 6012, category: ts.DiagnosticCategory.Message, key: "Skip_type_checking_of_declaration_files_6012", message: "Skip type checking of declaration files." }, - Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015_6015", message: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES2015'" }, - Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015_6016", message: "Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'" }, + Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015", message: "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'." }, + Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015_6016", message: "Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'." }, Print_this_message: { code: 6017, category: ts.DiagnosticCategory.Message, key: "Print_this_message_6017", message: "Print this message." }, Print_the_compiler_s_version: { code: 6019, category: ts.DiagnosticCategory.Message, key: "Print_the_compiler_s_version_6019", message: "Print the compiler's version." }, - Compile_the_project_in_the_given_directory: { code: 6020, category: ts.DiagnosticCategory.Message, key: "Compile_the_project_in_the_given_directory_6020", message: "Compile the project in the given directory." }, + Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json: { code: 6020, category: ts.DiagnosticCategory.Message, key: "Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020", message: "Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'." }, Syntax_Colon_0: { code: 6023, category: ts.DiagnosticCategory.Message, key: "Syntax_Colon_0_6023", message: "Syntax: {0}" }, options: { code: 6024, category: ts.DiagnosticCategory.Message, key: "options_6024", message: "options" }, file: { code: 6025, category: ts.DiagnosticCategory.Message, key: "file_6025", message: "file" }, @@ -3048,11 +4074,12 @@ var ts; LOCATION: { code: 6037, category: ts.DiagnosticCategory.Message, key: "LOCATION_6037", message: "LOCATION" }, DIRECTORY: { code: 6038, category: ts.DiagnosticCategory.Message, key: "DIRECTORY_6038", message: "DIRECTORY" }, STRATEGY: { code: 6039, category: ts.DiagnosticCategory.Message, key: "STRATEGY_6039", message: "STRATEGY" }, + FILE_OR_DIRECTORY: { code: 6040, category: ts.DiagnosticCategory.Message, key: "FILE_OR_DIRECTORY_6040", message: "FILE OR DIRECTORY" }, Compilation_complete_Watching_for_file_changes: { code: 6042, category: ts.DiagnosticCategory.Message, key: "Compilation_complete_Watching_for_file_changes_6042", message: "Compilation complete. Watching for file changes." }, Generates_corresponding_map_file: { code: 6043, category: ts.DiagnosticCategory.Message, key: "Generates_corresponding_map_file_6043", message: "Generates corresponding '.map' file." }, Compiler_option_0_expects_an_argument: { code: 6044, category: ts.DiagnosticCategory.Error, key: "Compiler_option_0_expects_an_argument_6044", message: "Compiler option '{0}' expects an argument." }, Unterminated_quoted_string_in_response_file_0: { code: 6045, category: ts.DiagnosticCategory.Error, key: "Unterminated_quoted_string_in_response_file_0_6045", message: "Unterminated quoted string in response file '{0}'." }, - Argument_for_0_option_must_be_Colon_1: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument_for_0_option_must_be_Colon_1_6046", message: "Argument for '{0}' option must be: {1}" }, + Argument_for_0_option_must_be_Colon_1: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument_for_0_option_must_be_Colon_1_6046", message: "Argument for '{0}' option must be: {1}." }, Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: ts.DiagnosticCategory.Error, key: "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048", message: "Locale must be of the form or -. For example '{0}' or '{1}'." }, Unsupported_locale_0: { code: 6049, category: ts.DiagnosticCategory.Error, key: "Unsupported_locale_0_6049", message: "Unsupported locale '{0}'." }, Unable_to_open_file_0: { code: 6050, category: ts.DiagnosticCategory.Error, key: "Unable_to_open_file_0_6050", message: "Unable to open file '{0}'." }, @@ -3074,17 +4101,18 @@ var ts; Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file: { code: 6070, category: ts.DiagnosticCategory.Message, key: "Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070", message: "Initializes a TypeScript project and creates a tsconfig.json file." }, Successfully_created_a_tsconfig_json_file: { code: 6071, category: ts.DiagnosticCategory.Message, key: "Successfully_created_a_tsconfig_json_file_6071", message: "Successfully created a tsconfig.json file." }, Suppress_excess_property_checks_for_object_literals: { code: 6072, category: ts.DiagnosticCategory.Message, key: "Suppress_excess_property_checks_for_object_literals_6072", message: "Suppress excess property checks for object literals." }, - Stylize_errors_and_messages_using_color_and_context_experimental: { code: 6073, category: ts.DiagnosticCategory.Message, key: "Stylize_errors_and_messages_using_color_and_context_experimental_6073", message: "Stylize errors and messages using color and context. (experimental)" }, + Stylize_errors_and_messages_using_color_and_context_experimental: { code: 6073, category: ts.DiagnosticCategory.Message, key: "Stylize_errors_and_messages_using_color_and_context_experimental_6073", message: "Stylize errors and messages using color and context (experimental)." }, Do_not_report_errors_on_unused_labels: { code: 6074, category: ts.DiagnosticCategory.Message, key: "Do_not_report_errors_on_unused_labels_6074", message: "Do not report errors on unused labels." }, Report_error_when_not_all_code_paths_in_function_return_a_value: { code: 6075, category: ts.DiagnosticCategory.Message, key: "Report_error_when_not_all_code_paths_in_function_return_a_value_6075", message: "Report error when not all code paths in function return a value." }, Report_errors_for_fallthrough_cases_in_switch_statement: { code: 6076, category: ts.DiagnosticCategory.Message, key: "Report_errors_for_fallthrough_cases_in_switch_statement_6076", message: "Report errors for fallthrough cases in switch statement." }, Do_not_report_errors_on_unreachable_code: { code: 6077, category: ts.DiagnosticCategory.Message, key: "Do_not_report_errors_on_unreachable_code_6077", message: "Do not report errors on unreachable code." }, Disallow_inconsistently_cased_references_to_the_same_file: { code: 6078, category: ts.DiagnosticCategory.Message, key: "Disallow_inconsistently_cased_references_to_the_same_file_6078", message: "Disallow inconsistently-cased references to the same file." }, Specify_library_files_to_be_included_in_the_compilation_Colon: { code: 6079, category: ts.DiagnosticCategory.Message, key: "Specify_library_files_to_be_included_in_the_compilation_Colon_6079", message: "Specify library files to be included in the compilation: " }, - Specify_JSX_code_generation_Colon_preserve_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify_JSX_code_generation_Colon_preserve_or_react_6080", message: "Specify JSX code generation: 'preserve' or 'react'" }, + Specify_JSX_code_generation_Colon_preserve_react_native_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080", message: "Specify JSX code generation: 'preserve', 'react-native', or 'react'." }, + File_0_has_an_unsupported_extension_so_skipping_it: { code: 6081, category: ts.DiagnosticCategory.Message, key: "File_0_has_an_unsupported_extension_so_skipping_it_6081", message: "File '{0}' has an unsupported extension, so skipping it." }, Only_amd_and_system_modules_are_supported_alongside_0: { code: 6082, category: ts.DiagnosticCategory.Error, key: "Only_amd_and_system_modules_are_supported_alongside_0_6082", message: "Only 'amd' and 'system' modules are supported alongside --{0}." }, Base_directory_to_resolve_non_absolute_module_names: { code: 6083, category: ts.DiagnosticCategory.Message, key: "Base_directory_to_resolve_non_absolute_module_names_6083", message: "Base directory to resolve non-absolute module names." }, - Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit: { code: 6084, category: ts.DiagnosticCategory.Message, key: "Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit_6084", message: "Specify the object invoked for createElement and __spread when targeting 'react' JSX emit" }, + Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit: { code: 6084, category: ts.DiagnosticCategory.Message, key: "Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084", message: "[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit" }, Enable_tracing_of_the_name_resolution_process: { code: 6085, category: ts.DiagnosticCategory.Message, key: "Enable_tracing_of_the_name_resolution_process_6085", message: "Enable tracing of the name resolution process." }, Resolving_module_0_from_1: { code: 6086, category: ts.DiagnosticCategory.Message, key: "Resolving_module_0_from_1_6086", message: "======== Resolving module '{0}' from '{1}'. ========" }, Explicitly_specified_module_resolution_kind_Colon_0: { code: 6087, category: ts.DiagnosticCategory.Message, key: "Explicitly_specified_module_resolution_kind_Colon_0_6087", message: "Explicitly specified module resolution kind: '{0}'." }, @@ -3095,23 +4123,23 @@ var ts; Module_name_0_matched_pattern_1: { code: 6092, category: ts.DiagnosticCategory.Message, key: "Module_name_0_matched_pattern_1_6092", message: "Module name '{0}', matched pattern '{1}'." }, Trying_substitution_0_candidate_module_location_Colon_1: { code: 6093, category: ts.DiagnosticCategory.Message, key: "Trying_substitution_0_candidate_module_location_Colon_1_6093", message: "Trying substitution '{0}', candidate module location: '{1}'." }, Resolving_module_name_0_relative_to_base_url_1_2: { code: 6094, category: ts.DiagnosticCategory.Message, key: "Resolving_module_name_0_relative_to_base_url_1_2_6094", message: "Resolving module name '{0}' relative to base url '{1}' - '{2}'." }, - Loading_module_as_file_Slash_folder_candidate_module_location_0: { code: 6095, category: ts.DiagnosticCategory.Message, key: "Loading_module_as_file_Slash_folder_candidate_module_location_0_6095", message: "Loading module as file / folder, candidate module location '{0}'." }, + Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1: { code: 6095, category: ts.DiagnosticCategory.Message, key: "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1_6095", message: "Loading module as file / folder, candidate module location '{0}', target file type '{1}'." }, File_0_does_not_exist: { code: 6096, category: ts.DiagnosticCategory.Message, key: "File_0_does_not_exist_6096", message: "File '{0}' does not exist." }, File_0_exist_use_it_as_a_name_resolution_result: { code: 6097, category: ts.DiagnosticCategory.Message, key: "File_0_exist_use_it_as_a_name_resolution_result_6097", message: "File '{0}' exist - use it as a name resolution result." }, - Loading_module_0_from_node_modules_folder: { code: 6098, category: ts.DiagnosticCategory.Message, key: "Loading_module_0_from_node_modules_folder_6098", message: "Loading module '{0}' from 'node_modules' folder." }, + Loading_module_0_from_node_modules_folder_target_file_type_1: { code: 6098, category: ts.DiagnosticCategory.Message, key: "Loading_module_0_from_node_modules_folder_target_file_type_1_6098", message: "Loading module '{0}' from 'node_modules' folder, target file type '{1}'." }, Found_package_json_at_0: { code: 6099, category: ts.DiagnosticCategory.Message, key: "Found_package_json_at_0_6099", message: "Found 'package.json' at '{0}'." }, - package_json_does_not_have_a_types_or_main_field: { code: 6100, category: ts.DiagnosticCategory.Message, key: "package_json_does_not_have_a_types_or_main_field_6100", message: "'package.json' does not have a 'types' or 'main' field." }, + package_json_does_not_have_a_0_field: { code: 6100, category: ts.DiagnosticCategory.Message, key: "package_json_does_not_have_a_0_field_6100", message: "'package.json' does not have a '{0}' field." }, package_json_has_0_field_1_that_references_2: { code: 6101, category: ts.DiagnosticCategory.Message, key: "package_json_has_0_field_1_that_references_2_6101", message: "'package.json' has '{0}' field '{1}' that references '{2}'." }, Allow_javascript_files_to_be_compiled: { code: 6102, category: ts.DiagnosticCategory.Message, key: "Allow_javascript_files_to_be_compiled_6102", message: "Allow javascript files to be compiled." }, Option_0_should_have_array_of_strings_as_a_value: { code: 6103, category: ts.DiagnosticCategory.Error, key: "Option_0_should_have_array_of_strings_as_a_value_6103", message: "Option '{0}' should have array of strings as a value." }, Checking_if_0_is_the_longest_matching_prefix_for_1_2: { code: 6104, category: ts.DiagnosticCategory.Message, key: "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104", message: "Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'." }, Expected_type_of_0_field_in_package_json_to_be_string_got_1: { code: 6105, category: ts.DiagnosticCategory.Message, key: "Expected_type_of_0_field_in_package_json_to_be_string_got_1_6105", message: "Expected type of '{0}' field in 'package.json' to be 'string', got '{1}'." }, - baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1: { code: 6106, category: ts.DiagnosticCategory.Message, key: "baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106", message: "'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'" }, - rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0: { code: 6107, category: ts.DiagnosticCategory.Message, key: "rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107", message: "'rootDirs' option is set, using it to resolve relative module name '{0}'" }, - Longest_matching_prefix_for_0_is_1: { code: 6108, category: ts.DiagnosticCategory.Message, key: "Longest_matching_prefix_for_0_is_1_6108", message: "Longest matching prefix for '{0}' is '{1}'" }, - Loading_0_from_the_root_dir_1_candidate_location_2: { code: 6109, category: ts.DiagnosticCategory.Message, key: "Loading_0_from_the_root_dir_1_candidate_location_2_6109", message: "Loading '{0}' from the root dir '{1}', candidate location '{2}'" }, - Trying_other_entries_in_rootDirs: { code: 6110, category: ts.DiagnosticCategory.Message, key: "Trying_other_entries_in_rootDirs_6110", message: "Trying other entries in 'rootDirs'" }, - Module_resolution_using_rootDirs_has_failed: { code: 6111, category: ts.DiagnosticCategory.Message, key: "Module_resolution_using_rootDirs_has_failed_6111", message: "Module resolution using 'rootDirs' has failed" }, + baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1: { code: 6106, category: ts.DiagnosticCategory.Message, key: "baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106", message: "'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'." }, + rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0: { code: 6107, category: ts.DiagnosticCategory.Message, key: "rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107", message: "'rootDirs' option is set, using it to resolve relative module name '{0}'." }, + Longest_matching_prefix_for_0_is_1: { code: 6108, category: ts.DiagnosticCategory.Message, key: "Longest_matching_prefix_for_0_is_1_6108", message: "Longest matching prefix for '{0}' is '{1}'." }, + Loading_0_from_the_root_dir_1_candidate_location_2: { code: 6109, category: ts.DiagnosticCategory.Message, key: "Loading_0_from_the_root_dir_1_candidate_location_2_6109", message: "Loading '{0}' from the root dir '{1}', candidate location '{2}'." }, + Trying_other_entries_in_rootDirs: { code: 6110, category: ts.DiagnosticCategory.Message, key: "Trying_other_entries_in_rootDirs_6110", message: "Trying other entries in 'rootDirs'." }, + Module_resolution_using_rootDirs_has_failed: { code: 6111, category: ts.DiagnosticCategory.Message, key: "Module_resolution_using_rootDirs_has_failed_6111", message: "Module resolution using 'rootDirs' has failed." }, Do_not_emit_use_strict_directives_in_module_output: { code: 6112, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_use_strict_directives_in_module_output_6112", message: "Do not emit 'use strict' directives in module output." }, Enable_strict_null_checks: { code: 6113, category: ts.DiagnosticCategory.Message, key: "Enable_strict_null_checks_6113", message: "Enable strict null checks." }, Unknown_option_excludes_Did_you_mean_exclude: { code: 6114, category: ts.DiagnosticCategory.Error, key: "Unknown_option_excludes_Did_you_mean_exclude_6114", message: "Unknown option 'excludes'. Did you mean 'exclude'?" }, @@ -3121,32 +4149,67 @@ var ts; Resolving_from_node_modules_folder: { code: 6118, category: ts.DiagnosticCategory.Message, key: "Resolving_from_node_modules_folder_6118", message: "Resolving from node_modules folder..." }, Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2: { code: 6119, category: ts.DiagnosticCategory.Message, key: "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119", message: "======== Type reference directive '{0}' was successfully resolved to '{1}', primary: {2}. ========" }, Type_reference_directive_0_was_not_resolved: { code: 6120, category: ts.DiagnosticCategory.Message, key: "Type_reference_directive_0_was_not_resolved_6120", message: "======== Type reference directive '{0}' was not resolved. ========" }, - Resolving_with_primary_search_path_0: { code: 6121, category: ts.DiagnosticCategory.Message, key: "Resolving_with_primary_search_path_0_6121", message: "Resolving with primary search path '{0}'" }, + Resolving_with_primary_search_path_0: { code: 6121, category: ts.DiagnosticCategory.Message, key: "Resolving_with_primary_search_path_0_6121", message: "Resolving with primary search path '{0}'." }, Root_directory_cannot_be_determined_skipping_primary_search_paths: { code: 6122, category: ts.DiagnosticCategory.Message, key: "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122", message: "Root directory cannot be determined, skipping primary search paths." }, Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set: { code: 6123, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123", message: "======== Resolving type reference directive '{0}', containing file '{1}', root directory not set. ========" }, Type_declaration_files_to_be_included_in_compilation: { code: 6124, category: ts.DiagnosticCategory.Message, key: "Type_declaration_files_to_be_included_in_compilation_6124", message: "Type declaration files to be included in compilation." }, - Looking_up_in_node_modules_folder_initial_location_0: { code: 6125, category: ts.DiagnosticCategory.Message, key: "Looking_up_in_node_modules_folder_initial_location_0_6125", message: "Looking up in 'node_modules' folder, initial location '{0}'" }, + Looking_up_in_node_modules_folder_initial_location_0: { code: 6125, category: ts.DiagnosticCategory.Message, key: "Looking_up_in_node_modules_folder_initial_location_0_6125", message: "Looking up in 'node_modules' folder, initial location '{0}'." }, Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder: { code: 6126, category: ts.DiagnosticCategory.Message, key: "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126", message: "Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder." }, Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1: { code: 6127, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127", message: "======== Resolving type reference directive '{0}', containing file not set, root directory '{1}'. ========" }, Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set: { code: 6128, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128", message: "======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========" }, The_config_file_0_found_doesn_t_contain_any_source_files: { code: 6129, category: ts.DiagnosticCategory.Error, key: "The_config_file_0_found_doesn_t_contain_any_source_files_6129", message: "The config file '{0}' found doesn't contain any source files." }, - Resolving_real_path_for_0_result_1: { code: 6130, category: ts.DiagnosticCategory.Message, key: "Resolving_real_path_for_0_result_1_6130", message: "Resolving real path for '{0}', result '{1}'" }, + Resolving_real_path_for_0_result_1: { code: 6130, category: ts.DiagnosticCategory.Message, key: "Resolving_real_path_for_0_result_1_6130", message: "Resolving real path for '{0}', result '{1}'." }, Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system: { code: 6131, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131", message: "Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'." }, - File_name_0_has_a_1_extension_stripping_it: { code: 6132, category: ts.DiagnosticCategory.Message, key: "File_name_0_has_a_1_extension_stripping_it_6132", message: "File name '{0}' has a '{1}' extension - stripping it" }, + File_name_0_has_a_1_extension_stripping_it: { code: 6132, category: ts.DiagnosticCategory.Message, key: "File_name_0_has_a_1_extension_stripping_it_6132", message: "File name '{0}' has a '{1}' extension - stripping it." }, _0_is_declared_but_never_used: { code: 6133, category: ts.DiagnosticCategory.Error, key: "_0_is_declared_but_never_used_6133", message: "'{0}' is declared but never used." }, Report_errors_on_unused_locals: { code: 6134, category: ts.DiagnosticCategory.Message, key: "Report_errors_on_unused_locals_6134", message: "Report errors on unused locals." }, Report_errors_on_unused_parameters: { code: 6135, category: ts.DiagnosticCategory.Message, key: "Report_errors_on_unused_parameters_6135", message: "Report errors on unused parameters." }, - The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files: { code: 6136, category: ts.DiagnosticCategory.Message, key: "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136", message: "The maximum dependency depth to search under node_modules and load JavaScript files" }, - No_types_specified_in_package_json_so_returning_main_value_of_0: { code: 6137, category: ts.DiagnosticCategory.Message, key: "No_types_specified_in_package_json_so_returning_main_value_of_0_6137", message: "No types specified in 'package.json', so returning 'main' value of '{0}'" }, + The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files: { code: 6136, category: ts.DiagnosticCategory.Message, key: "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136", message: "The maximum dependency depth to search under node_modules and load JavaScript files." }, Property_0_is_declared_but_never_used: { code: 6138, category: ts.DiagnosticCategory.Error, key: "Property_0_is_declared_but_never_used_6138", message: "Property '{0}' is declared but never used." }, Import_emit_helpers_from_tslib: { code: 6139, category: ts.DiagnosticCategory.Message, key: "Import_emit_helpers_from_tslib_6139", message: "Import emit helpers from 'tslib'." }, Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2: { code: 6140, category: ts.DiagnosticCategory.Error, key: "Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140", message: "Auto discovery for typings is enabled in project '{0}'. Running extra resolution pass for module '{1}' using cache location '{2}'." }, - Parse_in_strict_mode_and_emit_use_strict_for_each_source_file: { code: 6141, category: ts.DiagnosticCategory.Message, key: "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141", message: "Parse in strict mode and emit \"use strict\" for each source file" }, + Parse_in_strict_mode_and_emit_use_strict_for_each_source_file: { code: 6141, category: ts.DiagnosticCategory.Message, key: "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141", message: "Parse in strict mode and emit \"use strict\" for each source file." }, Module_0_was_resolved_to_1_but_jsx_is_not_set: { code: 6142, category: ts.DiagnosticCategory.Error, key: "Module_0_was_resolved_to_1_but_jsx_is_not_set_6142", message: "Module '{0}' was resolved to '{1}', but '--jsx' is not set." }, Module_0_was_resolved_to_1_but_allowJs_is_not_set: { code: 6143, category: ts.DiagnosticCategory.Error, key: "Module_0_was_resolved_to_1_but_allowJs_is_not_set_6143", message: "Module '{0}' was resolved to '{1}', but '--allowJs' is not set." }, Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1: { code: 6144, category: ts.DiagnosticCategory.Message, key: "Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144", message: "Module '{0}' was resolved as locally declared ambient module in file '{1}'." }, Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified: { code: 6145, category: ts.DiagnosticCategory.Message, key: "Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified_6145", message: "Module '{0}' was resolved as ambient module declared in '{1}' since this file was not modified." }, Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h: { code: 6146, category: ts.DiagnosticCategory.Message, key: "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146", message: "Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'." }, + Resolution_for_module_0_was_found_in_cache: { code: 6147, category: ts.DiagnosticCategory.Message, key: "Resolution_for_module_0_was_found_in_cache_6147", message: "Resolution for module '{0}' was found in cache." }, + Directory_0_does_not_exist_skipping_all_lookups_in_it: { code: 6148, category: ts.DiagnosticCategory.Message, key: "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148", message: "Directory '{0}' does not exist, skipping all lookups in it." }, + Show_diagnostic_information: { code: 6149, category: ts.DiagnosticCategory.Message, key: "Show_diagnostic_information_6149", message: "Show diagnostic information." }, + Show_verbose_diagnostic_information: { code: 6150, category: ts.DiagnosticCategory.Message, key: "Show_verbose_diagnostic_information_6150", message: "Show verbose diagnostic information." }, + Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file: { code: 6151, category: ts.DiagnosticCategory.Message, key: "Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151", message: "Emit a single file with source maps instead of having a separate file." }, + Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set: { code: 6152, category: ts.DiagnosticCategory.Message, key: "Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152", message: "Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set." }, + Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule: { code: 6153, category: ts.DiagnosticCategory.Message, key: "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153", message: "Transpile each file as a separate module (similar to 'ts.transpileModule')." }, + Print_names_of_generated_files_part_of_the_compilation: { code: 6154, category: ts.DiagnosticCategory.Message, key: "Print_names_of_generated_files_part_of_the_compilation_6154", message: "Print names of generated files part of the compilation." }, + Print_names_of_files_part_of_the_compilation: { code: 6155, category: ts.DiagnosticCategory.Message, key: "Print_names_of_files_part_of_the_compilation_6155", message: "Print names of files part of the compilation." }, + The_locale_used_when_displaying_messages_to_the_user_e_g_en_us: { code: 6156, category: ts.DiagnosticCategory.Message, key: "The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156", message: "The locale used when displaying messages to the user (e.g. 'en-us')" }, + Do_not_generate_custom_helper_functions_like_extends_in_compiled_output: { code: 6157, category: ts.DiagnosticCategory.Message, key: "Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157", message: "Do not generate custom helper functions like '__extends' in compiled output." }, + Do_not_include_the_default_library_file_lib_d_ts: { code: 6158, category: ts.DiagnosticCategory.Message, key: "Do_not_include_the_default_library_file_lib_d_ts_6158", message: "Do not include the default library file (lib.d.ts)." }, + Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files: { code: 6159, category: ts.DiagnosticCategory.Message, key: "Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159", message: "Do not add triple-slash references or imported modules to the list of compiled files." }, + Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files: { code: 6160, category: ts.DiagnosticCategory.Message, key: "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160", message: "[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files." }, + List_of_folders_to_include_type_definitions_from: { code: 6161, category: ts.DiagnosticCategory.Message, key: "List_of_folders_to_include_type_definitions_from_6161", message: "List of folders to include type definitions from." }, + Disable_size_limitations_on_JavaScript_projects: { code: 6162, category: ts.DiagnosticCategory.Message, key: "Disable_size_limitations_on_JavaScript_projects_6162", message: "Disable size limitations on JavaScript projects." }, + The_character_set_of_the_input_files: { code: 6163, category: ts.DiagnosticCategory.Message, key: "The_character_set_of_the_input_files_6163", message: "The character set of the input files." }, + Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files: { code: 6164, category: ts.DiagnosticCategory.Message, key: "Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6164", message: "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files." }, + Do_not_truncate_error_messages: { code: 6165, category: ts.DiagnosticCategory.Message, key: "Do_not_truncate_error_messages_6165", message: "Do not truncate error messages." }, + Output_directory_for_generated_declaration_files: { code: 6166, category: ts.DiagnosticCategory.Message, key: "Output_directory_for_generated_declaration_files_6166", message: "Output directory for generated declaration files." }, + A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl: { code: 6167, category: ts.DiagnosticCategory.Message, key: "A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167", message: "A series of entries which re-map imports to lookup locations relative to the 'baseUrl'." }, + List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime: { code: 6168, category: ts.DiagnosticCategory.Message, key: "List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168", message: "List of root folders whose combined content represents the structure of the project at runtime." }, + Show_all_compiler_options: { code: 6169, category: ts.DiagnosticCategory.Message, key: "Show_all_compiler_options_6169", message: "Show all compiler options." }, + Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file: { code: 6170, category: ts.DiagnosticCategory.Message, key: "Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170", message: "[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file" }, + Command_line_Options: { code: 6171, category: ts.DiagnosticCategory.Message, key: "Command_line_Options_6171", message: "Command-line Options" }, + Basic_Options: { code: 6172, category: ts.DiagnosticCategory.Message, key: "Basic_Options_6172", message: "Basic Options" }, + Strict_Type_Checking_Options: { code: 6173, category: ts.DiagnosticCategory.Message, key: "Strict_Type_Checking_Options_6173", message: "Strict Type-Checking Options" }, + Module_Resolution_Options: { code: 6174, category: ts.DiagnosticCategory.Message, key: "Module_Resolution_Options_6174", message: "Module Resolution Options" }, + Source_Map_Options: { code: 6175, category: ts.DiagnosticCategory.Message, key: "Source_Map_Options_6175", message: "Source Map Options" }, + Additional_Checks: { code: 6176, category: ts.DiagnosticCategory.Message, key: "Additional_Checks_6176", message: "Additional Checks" }, + Experimental_Options: { code: 6177, category: ts.DiagnosticCategory.Message, key: "Experimental_Options_6177", message: "Experimental Options" }, + Advanced_Options: { code: 6178, category: ts.DiagnosticCategory.Message, key: "Advanced_Options_6178", message: "Advanced Options" }, + Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3: { code: 6179, category: ts.DiagnosticCategory.Message, key: "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179", message: "Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'." }, + Enable_all_strict_type_checking_options: { code: 6180, category: ts.DiagnosticCategory.Message, key: "Enable_all_strict_type_checking_options_6180", message: "Enable all strict type-checking options." }, + List_of_language_service_plugins: { code: 6181, category: ts.DiagnosticCategory.Message, key: "List_of_language_service_plugins_6181", message: "List of language service plugins." }, + Scoped_package_detected_looking_in_0: { code: 6182, category: ts.DiagnosticCategory.Message, key: "Scoped_package_detected_looking_in_0_6182", message: "Scoped package detected, looking in '{0}'" }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_an_1_type_7005", message: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter_0_implicitly_has_an_1_type_7006", message: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member_0_implicitly_has_an_1_type_7008", message: "Member '{0}' implicitly has an '{1}' type." }, @@ -3164,7 +4227,7 @@ var ts; _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7023, category: ts.DiagnosticCategory.Error, key: "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023", message: "'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7024, category: ts.DiagnosticCategory.Error, key: "Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024", message: "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type: { code: 7025, category: ts.DiagnosticCategory.Error, key: "Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_typ_7025", message: "Generator implicitly has type '{0}' because it does not yield any values. Consider supplying a return type." }, - JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: { code: 7026, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026", message: "JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists" }, + JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: { code: 7026, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026", message: "JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists." }, Unreachable_code_detected: { code: 7027, category: ts.DiagnosticCategory.Error, key: "Unreachable_code_detected_7027", message: "Unreachable code detected." }, Unused_label: { code: 7028, category: ts.DiagnosticCategory.Error, key: "Unused_label_7028", message: "Unused label." }, Fallthrough_case_in_switch: { code: 7029, category: ts.DiagnosticCategory.Error, key: "Fallthrough_case_in_switch_7029", message: "Fallthrough case in switch." }, @@ -3188,7 +4251,7 @@ var ts; parameter_modifiers_can_only_be_used_in_a_ts_file: { code: 8012, category: ts.DiagnosticCategory.Error, key: "parameter_modifiers_can_only_be_used_in_a_ts_file_8012", message: "'parameter modifiers' can only be used in a .ts file." }, enum_declarations_can_only_be_used_in_a_ts_file: { code: 8015, category: ts.DiagnosticCategory.Error, key: "enum_declarations_can_only_be_used_in_a_ts_file_8015", message: "'enum declarations' can only be used in a .ts file." }, type_assertion_expressions_can_only_be_used_in_a_ts_file: { code: 8016, category: ts.DiagnosticCategory.Error, key: "type_assertion_expressions_can_only_be_used_in_a_ts_file_8016", message: "'type assertion expressions' can only be used in a .ts file." }, - Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses: { code: 9002, category: ts.DiagnosticCategory.Error, key: "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002", message: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses." }, + Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clause: { code: 9002, category: ts.DiagnosticCategory.Error, key: "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002", message: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clause." }, class_expressions_are_not_currently_supported: { code: 9003, category: ts.DiagnosticCategory.Error, key: "class_expressions_are_not_currently_supported_9003", message: "'class' expressions are not currently supported." }, Language_service_is_disabled: { code: 9004, category: ts.DiagnosticCategory.Error, key: "Language_service_is_disabled_9004", message: "Language service is disabled." }, JSX_attributes_must_only_be_assigned_a_non_empty_expression: { code: 17000, category: ts.DiagnosticCategory.Error, key: "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", message: "JSX attributes must only be assigned a non-empty 'expression'." }, @@ -3196,37 +4259,4631 @@ var ts; Expected_corresponding_JSX_closing_tag_for_0: { code: 17002, category: ts.DiagnosticCategory.Error, key: "Expected_corresponding_JSX_closing_tag_for_0_17002", message: "Expected corresponding JSX closing tag for '{0}'." }, JSX_attribute_expected: { code: 17003, category: ts.DiagnosticCategory.Error, key: "JSX_attribute_expected_17003", message: "JSX attribute expected." }, Cannot_use_JSX_unless_the_jsx_flag_is_provided: { code: 17004, category: ts.DiagnosticCategory.Error, key: "Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004", message: "Cannot use JSX unless the '--jsx' flag is provided." }, - A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: ts.DiagnosticCategory.Error, key: "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005", message: "A constructor cannot contain a 'super' call when its class extends 'null'" }, + A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: ts.DiagnosticCategory.Error, key: "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005", message: "A constructor cannot contain a 'super' call when its class extends 'null'." }, An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17006, category: ts.DiagnosticCategory.Error, key: "An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006", message: "An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17007, category: ts.DiagnosticCategory.Error, key: "A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007", message: "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, JSX_element_0_has_no_corresponding_closing_tag: { code: 17008, category: ts.DiagnosticCategory.Error, key: "JSX_element_0_has_no_corresponding_closing_tag_17008", message: "JSX element '{0}' has no corresponding closing tag." }, super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class: { code: 17009, category: ts.DiagnosticCategory.Error, key: "super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009", message: "'super' must be called before accessing 'this' in the constructor of a derived class." }, Unknown_type_acquisition_option_0: { code: 17010, category: ts.DiagnosticCategory.Error, key: "Unknown_type_acquisition_option_0_17010", message: "Unknown type acquisition option '{0}'." }, + super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class: { code: 17011, category: ts.DiagnosticCategory.Error, key: "super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011", message: "'super' must be called before accessing a property of 'super' in the constructor of a derived class." }, + _0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2: { code: 17012, category: ts.DiagnosticCategory.Error, key: "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012", message: "'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?" }, + Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor: { code: 17013, category: ts.DiagnosticCategory.Error, key: "Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013", message: "Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor." }, Circularity_detected_while_resolving_configuration_Colon_0: { code: 18000, category: ts.DiagnosticCategory.Error, key: "Circularity_detected_while_resolving_configuration_Colon_0_18000", message: "Circularity detected while resolving configuration: {0}" }, A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not: { code: 18001, category: ts.DiagnosticCategory.Error, key: "A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not_18001", message: "A path in an 'extends' option must be relative or rooted, but '{0}' is not." }, The_files_list_in_config_file_0_is_empty: { code: 18002, category: ts.DiagnosticCategory.Error, key: "The_files_list_in_config_file_0_is_empty_18002", message: "The 'files' list in config file '{0}' is empty." }, No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2: { code: 18003, category: ts.DiagnosticCategory.Error, key: "No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003", message: "No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'." }, Add_missing_super_call: { code: 90001, category: ts.DiagnosticCategory.Message, key: "Add_missing_super_call_90001", message: "Add missing 'super()' call." }, Make_super_call_the_first_statement_in_the_constructor: { code: 90002, category: ts.DiagnosticCategory.Message, key: "Make_super_call_the_first_statement_in_the_constructor_90002", message: "Make 'super()' call the first statement in the constructor." }, - Change_extends_to_implements: { code: 90003, category: ts.DiagnosticCategory.Message, key: "Change_extends_to_implements_90003", message: "Change 'extends' to 'implements'" }, - Remove_unused_identifiers: { code: 90004, category: ts.DiagnosticCategory.Message, key: "Remove_unused_identifiers_90004", message: "Remove unused identifiers" }, - Implement_interface_on_reference: { code: 90005, category: ts.DiagnosticCategory.Message, key: "Implement_interface_on_reference_90005", message: "Implement interface on reference" }, - Implement_interface_on_class: { code: 90006, category: ts.DiagnosticCategory.Message, key: "Implement_interface_on_class_90006", message: "Implement interface on class" }, - Implement_inherited_abstract_class: { code: 90007, category: ts.DiagnosticCategory.Message, key: "Implement_inherited_abstract_class_90007", message: "Implement inherited abstract class" }, - Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: { code: 90009, category: ts.DiagnosticCategory.Error, key: "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009", message: "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig" }, + Change_extends_to_implements: { code: 90003, category: ts.DiagnosticCategory.Message, key: "Change_extends_to_implements_90003", message: "Change 'extends' to 'implements'." }, + Remove_declaration_for_Colon_0: { code: 90004, category: ts.DiagnosticCategory.Message, key: "Remove_declaration_for_Colon_0_90004", message: "Remove declaration for: '{0}'." }, + Implement_interface_0: { code: 90006, category: ts.DiagnosticCategory.Message, key: "Implement_interface_0_90006", message: "Implement interface '{0}'." }, + Implement_inherited_abstract_class: { code: 90007, category: ts.DiagnosticCategory.Message, key: "Implement_inherited_abstract_class_90007", message: "Implement inherited abstract class." }, + Add_this_to_unresolved_variable: { code: 90008, category: ts.DiagnosticCategory.Message, key: "Add_this_to_unresolved_variable_90008", message: "Add 'this.' to unresolved variable." }, + Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: { code: 90009, category: ts.DiagnosticCategory.Error, key: "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009", message: "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig." }, Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: { code: 90010, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010", message: "Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated." }, - Import_0_from_1: { code: 90013, category: ts.DiagnosticCategory.Message, key: "Import_0_from_1_90013", message: "Import {0} from {1}" }, - Change_0_to_1: { code: 90014, category: ts.DiagnosticCategory.Message, key: "Change_0_to_1_90014", message: "Change {0} to {1}" }, - Add_0_to_existing_import_declaration_from_1: { code: 90015, category: ts.DiagnosticCategory.Message, key: "Add_0_to_existing_import_declaration_from_1_90015", message: "Add {0} to existing import declaration from {1}" }, + Import_0_from_1: { code: 90013, category: ts.DiagnosticCategory.Message, key: "Import_0_from_1_90013", message: "Import {0} from {1}." }, + Change_0_to_1: { code: 90014, category: ts.DiagnosticCategory.Message, key: "Change_0_to_1_90014", message: "Change {0} to {1}." }, + Add_0_to_existing_import_declaration_from_1: { code: 90015, category: ts.DiagnosticCategory.Message, key: "Add_0_to_existing_import_declaration_from_1_90015", message: "Add {0} to existing import declaration from {1}." }, + Add_declaration_for_missing_property_0: { code: 90016, category: ts.DiagnosticCategory.Message, key: "Add_declaration_for_missing_property_0_90016", message: "Add declaration for missing property '{0}'." }, + Add_index_signature_for_missing_property_0: { code: 90017, category: ts.DiagnosticCategory.Message, key: "Add_index_signature_for_missing_property_0_90017", message: "Add index signature for missing property '{0}'." }, + Disable_checking_for_this_file: { code: 90018, category: ts.DiagnosticCategory.Message, key: "Disable_checking_for_this_file_90018", message: "Disable checking for this file." }, + Ignore_this_error_message: { code: 90019, category: ts.DiagnosticCategory.Message, key: "Ignore_this_error_message_90019", message: "Ignore this error message." }, + Initialize_property_0_in_the_constructor: { code: 90020, category: ts.DiagnosticCategory.Message, key: "Initialize_property_0_in_the_constructor_90020", message: "Initialize property '{0}' in the constructor." }, + Initialize_static_property_0: { code: 90021, category: ts.DiagnosticCategory.Message, key: "Initialize_static_property_0_90021", message: "Initialize static property '{0}'." }, + Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0: { code: 8017, category: ts.DiagnosticCategory.Error, key: "Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0_8017", message: "Octal literal types must use ES2015 syntax. Use the syntax '{0}'." }, + Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0: { code: 8018, category: ts.DiagnosticCategory.Error, key: "Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0_8018", message: "Octal literals are not allowed in enums members initializer. Use the syntax '{0}'." }, + Report_errors_in_js_files: { code: 8019, category: ts.DiagnosticCategory.Message, key: "Report_errors_in_js_files_8019", message: "Report errors in .js files." }, }; })(ts || (ts = {})); var ts; +(function (ts) { + function trace(host) { + host.trace(ts.formatMessage.apply(undefined, arguments)); + } + ts.trace = trace; + function isTraceEnabled(compilerOptions, host) { + return compilerOptions.traceResolution && host.trace !== undefined; + } + ts.isTraceEnabled = isTraceEnabled; + var Extensions; + (function (Extensions) { + Extensions[Extensions["TypeScript"] = 0] = "TypeScript"; + Extensions[Extensions["JavaScript"] = 1] = "JavaScript"; + Extensions[Extensions["DtsOnly"] = 2] = "DtsOnly"; + })(Extensions || (Extensions = {})); + function resolvedTypeScriptOnly(resolved) { + if (!resolved) { + return undefined; + } + ts.Debug.assert(ts.extensionIsTypeScript(resolved.extension)); + return resolved.path; + } + function resolvedModuleFromResolved(_a, isExternalLibraryImport) { + var path = _a.path, extension = _a.extension; + return { resolvedFileName: path, extension: extension, isExternalLibraryImport: isExternalLibraryImport }; + } + function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations) { + return { resolvedModule: resolved && resolvedModuleFromResolved(resolved, isExternalLibraryImport), failedLookupLocations: failedLookupLocations }; + } + function moduleHasNonRelativeName(moduleName) { + return !(ts.isRootedDiskPath(moduleName) || ts.isExternalModuleNameRelative(moduleName)); + } + ts.moduleHasNonRelativeName = moduleHasNonRelativeName; + function tryReadPackageJsonFields(readTypes, packageJsonPath, baseDirectory, state) { + var jsonContent = readJson(packageJsonPath, state.host); + return readTypes ? tryReadFromField("typings") || tryReadFromField("types") : tryReadFromField("main"); + function tryReadFromField(fieldName) { + if (!ts.hasProperty(jsonContent, fieldName)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.package_json_does_not_have_a_0_field, fieldName); + } + return; + } + var fileName = jsonContent[fieldName]; + if (typeof fileName !== "string") { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_string_got_1, fieldName, typeof fileName); + } + return; + } + var path = ts.normalizePath(ts.combinePaths(baseDirectory, fileName)); + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.package_json_has_0_field_1_that_references_2, fieldName, fileName, path); + } + return path; + } + } + function readJson(path, host) { + try { + var jsonText = host.readFile(path); + return jsonText ? JSON.parse(jsonText) : {}; + } + catch (e) { + return {}; + } + } + function getEffectiveTypeRoots(options, host) { + if (options.typeRoots) { + return options.typeRoots; + } + var currentDirectory; + if (options.configFilePath) { + currentDirectory = ts.getDirectoryPath(options.configFilePath); + } + else if (host.getCurrentDirectory) { + currentDirectory = host.getCurrentDirectory(); + } + if (currentDirectory !== undefined) { + return getDefaultTypeRoots(currentDirectory, host); + } + } + ts.getEffectiveTypeRoots = getEffectiveTypeRoots; + function getDefaultTypeRoots(currentDirectory, host) { + if (!host.directoryExists) { + return [ts.combinePaths(currentDirectory, nodeModulesAtTypes)]; + } + var typeRoots; + forEachAncestorDirectory(ts.normalizePath(currentDirectory), function (directory) { + var atTypes = ts.combinePaths(directory, nodeModulesAtTypes); + if (host.directoryExists(atTypes)) { + (typeRoots || (typeRoots = [])).push(atTypes); + } + return undefined; + }); + return typeRoots; + } + var nodeModulesAtTypes = ts.combinePaths("node_modules", "@types"); + function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host) { + var traceEnabled = isTraceEnabled(options, host); + var moduleResolutionState = { + compilerOptions: options, + host: host, + traceEnabled: traceEnabled + }; + var typeRoots = getEffectiveTypeRoots(options, host); + if (traceEnabled) { + if (containingFile === undefined) { + if (typeRoots === undefined) { + trace(host, ts.Diagnostics.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set, typeReferenceDirectiveName); + } + else { + trace(host, ts.Diagnostics.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1, typeReferenceDirectiveName, typeRoots); + } + } + else { + if (typeRoots === undefined) { + trace(host, ts.Diagnostics.Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set, typeReferenceDirectiveName, containingFile); + } + else { + trace(host, ts.Diagnostics.Resolving_type_reference_directive_0_containing_file_1_root_directory_2, typeReferenceDirectiveName, containingFile, typeRoots); + } + } + } + var failedLookupLocations = []; + var resolved = primaryLookup(); + var primary = true; + if (!resolved) { + resolved = secondaryLookup(); + primary = false; + } + var resolvedTypeReferenceDirective; + if (resolved) { + resolved = realpath(resolved, host, traceEnabled); + if (traceEnabled) { + trace(host, ts.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2, typeReferenceDirectiveName, resolved, primary); + } + resolvedTypeReferenceDirective = { primary: primary, resolvedFileName: resolved }; + } + return { resolvedTypeReferenceDirective: resolvedTypeReferenceDirective, failedLookupLocations: failedLookupLocations }; + function primaryLookup() { + if (typeRoots && typeRoots.length) { + if (traceEnabled) { + trace(host, ts.Diagnostics.Resolving_with_primary_search_path_0, typeRoots.join(", ")); + } + return ts.forEach(typeRoots, function (typeRoot) { + var candidate = ts.combinePaths(typeRoot, typeReferenceDirectiveName); + var candidateDirectory = ts.getDirectoryPath(candidate); + var directoryExists = directoryProbablyExists(candidateDirectory, host); + if (!directoryExists && traceEnabled) { + trace(host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, candidateDirectory); + } + return resolvedTypeScriptOnly(loadNodeModuleFromDirectory(Extensions.DtsOnly, candidate, failedLookupLocations, !directoryExists, moduleResolutionState)); + }); + } + else { + if (traceEnabled) { + trace(host, ts.Diagnostics.Root_directory_cannot_be_determined_skipping_primary_search_paths); + } + } + } + function secondaryLookup() { + var resolvedFile; + var initialLocationForSecondaryLookup = containingFile && ts.getDirectoryPath(containingFile); + if (initialLocationForSecondaryLookup !== undefined) { + if (traceEnabled) { + trace(host, ts.Diagnostics.Looking_up_in_node_modules_folder_initial_location_0, initialLocationForSecondaryLookup); + } + var result = loadModuleFromNodeModules(Extensions.DtsOnly, typeReferenceDirectiveName, initialLocationForSecondaryLookup, failedLookupLocations, moduleResolutionState, undefined); + resolvedFile = resolvedTypeScriptOnly(result && result.value); + if (!resolvedFile && traceEnabled) { + trace(host, ts.Diagnostics.Type_reference_directive_0_was_not_resolved, typeReferenceDirectiveName); + } + return resolvedFile; + } + else { + if (traceEnabled) { + trace(host, ts.Diagnostics.Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder); + } + } + } + } + ts.resolveTypeReferenceDirective = resolveTypeReferenceDirective; + function getAutomaticTypeDirectiveNames(options, host) { + if (options.types) { + return options.types; + } + var result = []; + if (host.directoryExists && host.getDirectories) { + var typeRoots = getEffectiveTypeRoots(options, host); + if (typeRoots) { + for (var _i = 0, typeRoots_1 = typeRoots; _i < typeRoots_1.length; _i++) { + var root = typeRoots_1[_i]; + if (host.directoryExists(root)) { + for (var _a = 0, _b = host.getDirectories(root); _a < _b.length; _a++) { + var typeDirectivePath = _b[_a]; + var normalized = ts.normalizePath(typeDirectivePath); + var packageJsonPath = pathToPackageJson(ts.combinePaths(root, normalized)); + var isNotNeededPackage = host.fileExists(packageJsonPath) && readJson(packageJsonPath, host).typings === null; + if (!isNotNeededPackage) { + result.push(ts.getBaseFileName(normalized)); + } + } + } + } + } + } + return result; + } + ts.getAutomaticTypeDirectiveNames = getAutomaticTypeDirectiveNames; + function createModuleResolutionCache(currentDirectory, getCanonicalFileName) { + var directoryToModuleNameMap = ts.createFileMap(); + var moduleNameToDirectoryMap = ts.createMap(); + return { getOrCreateCacheForDirectory: getOrCreateCacheForDirectory, getOrCreateCacheForModuleName: getOrCreateCacheForModuleName }; + function getOrCreateCacheForDirectory(directoryName) { + var path = ts.toPath(directoryName, currentDirectory, getCanonicalFileName); + var perFolderCache = directoryToModuleNameMap.get(path); + if (!perFolderCache) { + perFolderCache = ts.createMap(); + directoryToModuleNameMap.set(path, perFolderCache); + } + return perFolderCache; + } + function getOrCreateCacheForModuleName(nonRelativeModuleName) { + if (!moduleHasNonRelativeName(nonRelativeModuleName)) { + return undefined; + } + var perModuleNameCache = moduleNameToDirectoryMap.get(nonRelativeModuleName); + if (!perModuleNameCache) { + perModuleNameCache = createPerModuleNameCache(); + moduleNameToDirectoryMap.set(nonRelativeModuleName, perModuleNameCache); + } + return perModuleNameCache; + } + function createPerModuleNameCache() { + var directoryPathMap = ts.createFileMap(); + return { get: get, set: set }; + function get(directory) { + return directoryPathMap.get(ts.toPath(directory, currentDirectory, getCanonicalFileName)); + } + function set(directory, result) { + var path = ts.toPath(directory, currentDirectory, getCanonicalFileName); + if (directoryPathMap.contains(path)) { + return; + } + directoryPathMap.set(path, result); + var resolvedFileName = result.resolvedModule && result.resolvedModule.resolvedFileName; + var commonPrefix = getCommonPrefix(path, resolvedFileName); + var current = path; + while (true) { + var parent = ts.getDirectoryPath(current); + if (parent === current || directoryPathMap.contains(parent)) { + break; + } + directoryPathMap.set(parent, result); + current = parent; + if (current === commonPrefix) { + break; + } + } + } + function getCommonPrefix(directory, resolution) { + if (resolution === undefined) { + return undefined; + } + var resolutionDirectory = ts.toPath(ts.getDirectoryPath(resolution), currentDirectory, getCanonicalFileName); + var i = 0; + while (i < Math.min(directory.length, resolutionDirectory.length) && directory.charCodeAt(i) === resolutionDirectory.charCodeAt(i)) { + i++; + } + var sep = directory.lastIndexOf(ts.directorySeparator, i); + if (sep < 0) { + return undefined; + } + return directory.substr(0, sep); + } + } + } + ts.createModuleResolutionCache = createModuleResolutionCache; + function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache) { + var traceEnabled = isTraceEnabled(compilerOptions, host); + if (traceEnabled) { + trace(host, ts.Diagnostics.Resolving_module_0_from_1, moduleName, containingFile); + } + var containingDirectory = ts.getDirectoryPath(containingFile); + var perFolderCache = cache && cache.getOrCreateCacheForDirectory(containingDirectory); + var result = perFolderCache && perFolderCache.get(moduleName); + if (result) { + if (traceEnabled) { + trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); + } + } + else { + var moduleResolution = compilerOptions.moduleResolution; + if (moduleResolution === undefined) { + moduleResolution = ts.getEmitModuleKind(compilerOptions) === ts.ModuleKind.CommonJS ? ts.ModuleResolutionKind.NodeJs : ts.ModuleResolutionKind.Classic; + if (traceEnabled) { + trace(host, ts.Diagnostics.Module_resolution_kind_is_not_specified_using_0, ts.ModuleResolutionKind[moduleResolution]); + } + } + else { + if (traceEnabled) { + trace(host, ts.Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0, ts.ModuleResolutionKind[moduleResolution]); + } + } + switch (moduleResolution) { + case ts.ModuleResolutionKind.NodeJs: + result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache); + break; + case ts.ModuleResolutionKind.Classic: + result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache); + break; + } + if (perFolderCache) { + perFolderCache.set(moduleName, result); + var perModuleNameCache = cache.getOrCreateCacheForModuleName(moduleName); + if (perModuleNameCache) { + perModuleNameCache.set(containingDirectory, result); + } + } + } + if (traceEnabled) { + if (result.resolvedModule) { + trace(host, ts.Diagnostics.Module_name_0_was_successfully_resolved_to_1, moduleName, result.resolvedModule.resolvedFileName); + } + else { + trace(host, ts.Diagnostics.Module_name_0_was_not_resolved, moduleName); + } + } + return result; + } + ts.resolveModuleName = resolveModuleName; + function tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, failedLookupLocations, state) { + if (moduleHasNonRelativeName(moduleName)) { + return tryLoadModuleUsingBaseUrl(extensions, moduleName, loader, failedLookupLocations, state); + } + else { + return tryLoadModuleUsingRootDirs(extensions, moduleName, containingDirectory, loader, failedLookupLocations, state); + } + } + function tryLoadModuleUsingRootDirs(extensions, moduleName, containingDirectory, loader, failedLookupLocations, state) { + if (!state.compilerOptions.rootDirs) { + return undefined; + } + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0, moduleName); + } + var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); + var matchedRootDir; + var matchedNormalizedPrefix; + for (var _i = 0, _a = state.compilerOptions.rootDirs; _i < _a.length; _i++) { + var rootDir = _a[_i]; + var normalizedRoot = ts.normalizePath(rootDir); + if (!ts.endsWith(normalizedRoot, ts.directorySeparator)) { + normalizedRoot += ts.directorySeparator; + } + var isLongestMatchingPrefix = ts.startsWith(candidate, normalizedRoot) && + (matchedNormalizedPrefix === undefined || matchedNormalizedPrefix.length < normalizedRoot.length); + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Checking_if_0_is_the_longest_matching_prefix_for_1_2, normalizedRoot, candidate, isLongestMatchingPrefix); + } + if (isLongestMatchingPrefix) { + matchedNormalizedPrefix = normalizedRoot; + matchedRootDir = rootDir; + } + } + if (matchedNormalizedPrefix) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Longest_matching_prefix_for_0_is_1, candidate, matchedNormalizedPrefix); + } + var suffix = candidate.substr(matchedNormalizedPrefix.length); + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2, suffix, matchedNormalizedPrefix, candidate); + } + var resolvedFileName = loader(extensions, candidate, failedLookupLocations, !directoryProbablyExists(containingDirectory, state.host), state); + if (resolvedFileName) { + return resolvedFileName; + } + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Trying_other_entries_in_rootDirs); + } + for (var _b = 0, _c = state.compilerOptions.rootDirs; _b < _c.length; _b++) { + var rootDir = _c[_b]; + if (rootDir === matchedRootDir) { + continue; + } + var candidate_1 = ts.combinePaths(ts.normalizePath(rootDir), suffix); + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2, suffix, rootDir, candidate_1); + } + var baseDirectory = ts.getDirectoryPath(candidate_1); + var resolvedFileName_1 = loader(extensions, candidate_1, failedLookupLocations, !directoryProbablyExists(baseDirectory, state.host), state); + if (resolvedFileName_1) { + return resolvedFileName_1; + } + } + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Module_resolution_using_rootDirs_has_failed); + } + } + return undefined; + } + function tryLoadModuleUsingBaseUrl(extensions, moduleName, loader, failedLookupLocations, state) { + if (!state.compilerOptions.baseUrl) { + return undefined; + } + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, state.compilerOptions.baseUrl, moduleName); + } + var matchedPattern = undefined; + if (state.compilerOptions.paths) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, moduleName); + } + matchedPattern = ts.matchPatternOrExact(ts.getOwnKeys(state.compilerOptions.paths), moduleName); + } + if (matchedPattern) { + var matchedStar_1 = typeof matchedPattern === "string" ? undefined : ts.matchedText(matchedPattern, moduleName); + var matchedPatternText = typeof matchedPattern === "string" ? matchedPattern : ts.patternText(matchedPattern); + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Module_name_0_matched_pattern_1, moduleName, matchedPatternText); + } + return ts.forEach(state.compilerOptions.paths[matchedPatternText], function (subst) { + var path = matchedStar_1 ? subst.replace("*", matchedStar_1) : subst; + var candidate = ts.normalizePath(ts.combinePaths(state.compilerOptions.baseUrl, path)); + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path); + } + var tsExtension = ts.tryGetExtensionFromPath(candidate); + if (tsExtension !== undefined) { + var path_1 = tryFile(candidate, failedLookupLocations, false, state); + return path_1 && { path: path_1, extension: tsExtension }; + } + return loader(extensions, candidate, failedLookupLocations, !directoryProbablyExists(ts.getDirectoryPath(candidate), state.host), state); + }); + } + else { + var candidate = ts.normalizePath(ts.combinePaths(state.compilerOptions.baseUrl, moduleName)); + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Resolving_module_name_0_relative_to_base_url_1_2, moduleName, state.compilerOptions.baseUrl, candidate); + } + return loader(extensions, candidate, failedLookupLocations, !directoryProbablyExists(ts.getDirectoryPath(candidate), state.host), state); + } + } + function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache) { + return nodeModuleNameResolverWorker(moduleName, containingFile, compilerOptions, host, cache, false); + } + ts.nodeModuleNameResolver = nodeModuleNameResolver; + function nodeModuleNameResolverWorker(moduleName, containingFile, compilerOptions, host, cache, jsOnly) { + if (jsOnly === void 0) { jsOnly = false; } + var containingDirectory = ts.getDirectoryPath(containingFile); + var traceEnabled = isTraceEnabled(compilerOptions, host); + var failedLookupLocations = []; + var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; + var result = jsOnly ? tryResolve(Extensions.JavaScript) : (tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript)); + if (result && result.value) { + var _a = result.value, resolved = _a.resolved, isExternalLibraryImport = _a.isExternalLibraryImport; + return createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations); + } + return { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; + function tryResolve(extensions) { + var loader = function (extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { return nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, true); }; + var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, failedLookupLocations, state); + if (resolved) { + return toSearchResult({ resolved: resolved, isExternalLibraryImport: false }); + } + if (moduleHasNonRelativeName(moduleName)) { + if (traceEnabled) { + trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1, moduleName, Extensions[extensions]); + } + var resolved_1 = loadModuleFromNodeModules(extensions, moduleName, containingDirectory, failedLookupLocations, state, cache); + return resolved_1 && { value: resolved_1.value && { resolved: { path: realpath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }, isExternalLibraryImport: true } }; + } + else { + var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); + var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, false, state, true); + return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: false }); + } + } + } + ts.nodeModuleNameResolverWorker = nodeModuleNameResolverWorker; + function realpath(path, host, traceEnabled) { + if (!host.realpath) { + return path; + } + var real = ts.normalizePath(host.realpath(path)); + if (traceEnabled) { + trace(host, ts.Diagnostics.Resolving_real_path_for_0_result_1, path, real); + } + return real; + } + function nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1, candidate, Extensions[extensions]); + } + if (!ts.pathEndsWithDirectorySeparator(candidate)) { + if (!onlyRecordFailures) { + var parentOfCandidate = ts.getDirectoryPath(candidate); + if (!directoryProbablyExists(parentOfCandidate, state.host)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, parentOfCandidate); + } + onlyRecordFailures = true; + } + } + var resolvedFromFile = loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); + if (resolvedFromFile) { + return resolvedFromFile; + } + } + if (!onlyRecordFailures) { + var candidateExists = directoryProbablyExists(candidate, state.host); + if (!candidateExists) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, candidate); + } + onlyRecordFailures = true; + } + } + return loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson); + } + function directoryProbablyExists(directoryName, host) { + return !host.directoryExists || host.directoryExists(directoryName); + } + ts.directoryProbablyExists = directoryProbablyExists; + function loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { + var resolvedByAddingExtension = tryAddingExtensions(candidate, extensions, failedLookupLocations, onlyRecordFailures, state); + if (resolvedByAddingExtension) { + return resolvedByAddingExtension; + } + if (ts.hasJavaScriptFileExtension(candidate)) { + var extensionless = ts.removeFileExtension(candidate); + if (state.traceEnabled) { + var extension = candidate.substring(extensionless.length); + trace(state.host, ts.Diagnostics.File_name_0_has_a_1_extension_stripping_it, candidate, extension); + } + return tryAddingExtensions(extensionless, extensions, failedLookupLocations, onlyRecordFailures, state); + } + } + function tryAddingExtensions(candidate, extensions, failedLookupLocations, onlyRecordFailures, state) { + if (!onlyRecordFailures) { + var directory = ts.getDirectoryPath(candidate); + if (directory) { + onlyRecordFailures = !directoryProbablyExists(directory, state.host); + } + } + switch (extensions) { + case Extensions.DtsOnly: + return tryExtension(".d.ts", ts.Extension.Dts); + case Extensions.TypeScript: + return tryExtension(".ts", ts.Extension.Ts) || tryExtension(".tsx", ts.Extension.Tsx) || tryExtension(".d.ts", ts.Extension.Dts); + case Extensions.JavaScript: + return tryExtension(".js", ts.Extension.Js) || tryExtension(".jsx", ts.Extension.Jsx); + } + function tryExtension(ext, extension) { + var path = tryFile(candidate + ext, failedLookupLocations, onlyRecordFailures, state); + return path && { path: path, extension: extension }; + } + } + function tryFile(fileName, failedLookupLocations, onlyRecordFailures, state) { + if (!onlyRecordFailures) { + if (state.host.fileExists(fileName)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName); + } + return fileName; + } + else { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.File_0_does_not_exist, fileName); + } + } + } + failedLookupLocations.push(fileName); + return undefined; + } + function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson) { + if (considerPackageJson === void 0) { considerPackageJson = true; } + var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); + if (considerPackageJson) { + var packageJsonPath = pathToPackageJson(candidate); + if (directoryExists && state.host.fileExists(packageJsonPath)) { + var fromPackageJson = loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state); + if (fromPackageJson) { + return fromPackageJson; + } + } + else { + if (directoryExists && state.traceEnabled) { + trace(state.host, ts.Diagnostics.File_0_does_not_exist, packageJsonPath); + } + failedLookupLocations.push(packageJsonPath); + } + } + return loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state); + } + function loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); + } + var file = tryReadPackageJsonFields(extensions !== Extensions.JavaScript, packageJsonPath, candidate, state); + if (!file) { + return undefined; + } + var onlyRecordFailures = !directoryProbablyExists(ts.getDirectoryPath(file), state.host); + var fromFile = tryFile(file, failedLookupLocations, onlyRecordFailures, state); + if (fromFile) { + var resolved = fromFile && resolvedIfExtensionMatches(extensions, fromFile); + if (resolved) { + return resolved; + } + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromFile); + } + } + var nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions; + return nodeLoadModuleByRelativeName(nextExtensions, file, failedLookupLocations, onlyRecordFailures, state, false); + } + function resolvedIfExtensionMatches(extensions, path) { + var extension = ts.tryGetExtensionFromPath(path); + return extension !== undefined && extensionIsOk(extensions, extension) ? { path: path, extension: extension } : undefined; + } + function extensionIsOk(extensions, extension) { + switch (extensions) { + case Extensions.JavaScript: + return extension === ts.Extension.Js || extension === ts.Extension.Jsx; + case Extensions.TypeScript: + return extension === ts.Extension.Ts || extension === ts.Extension.Tsx || extension === ts.Extension.Dts; + case Extensions.DtsOnly: + return extension === ts.Extension.Dts; + } + } + function pathToPackageJson(directory) { + return ts.combinePaths(directory, "package.json"); + } + function loadModuleFromNodeModulesFolder(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, failedLookupLocations, state) { + var candidate = ts.normalizePath(ts.combinePaths(nodeModulesFolder, moduleName)); + return loadModuleFromFile(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state) || + loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state); + } + function loadModuleFromNodeModules(extensions, moduleName, directory, failedLookupLocations, state, cache) { + return loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, false, cache); + } + function loadModuleFromNodeModulesAtTypes(moduleName, directory, failedLookupLocations, state) { + return loadModuleFromNodeModulesWorker(Extensions.DtsOnly, moduleName, directory, failedLookupLocations, state, true, undefined); + } + function loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, typesOnly, cache) { + var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName); + return forEachAncestorDirectory(ts.normalizeSlashes(directory), function (ancestorDirectory) { + if (ts.getBaseFileName(ancestorDirectory) !== "node_modules") { + var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, ancestorDirectory, state.traceEnabled, state.host); + if (resolutionFromCache) { + return resolutionFromCache; + } + return toSearchResult(loadModuleFromNodeModulesOneLevel(extensions, moduleName, ancestorDirectory, failedLookupLocations, state, typesOnly)); + } + }); + } + function loadModuleFromNodeModulesOneLevel(extensions, moduleName, directory, failedLookupLocations, state, typesOnly) { + if (typesOnly === void 0) { typesOnly = false; } + var nodeModulesFolder = ts.combinePaths(directory, "node_modules"); + var nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, state.host); + if (!nodeModulesFolderExists && state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesFolder); + } + var packageResult = typesOnly ? undefined : loadModuleFromNodeModulesFolder(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, failedLookupLocations, state); + if (packageResult) { + return packageResult; + } + if (extensions !== Extensions.JavaScript) { + var nodeModulesAtTypes_1 = ts.combinePaths(nodeModulesFolder, "@types"); + var nodeModulesAtTypesExists = nodeModulesFolderExists; + if (nodeModulesFolderExists && !directoryProbablyExists(nodeModulesAtTypes_1, state.host)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesAtTypes_1); + } + nodeModulesAtTypesExists = false; + } + return loadModuleFromNodeModulesFolder(Extensions.DtsOnly, mangleScopedPackage(moduleName, state), nodeModulesAtTypes_1, nodeModulesAtTypesExists, failedLookupLocations, state); + } + } + function mangleScopedPackage(moduleName, state) { + if (ts.startsWith(moduleName, "@")) { + var replaceSlash = moduleName.replace(ts.directorySeparator, "__"); + if (replaceSlash !== moduleName) { + var mangled = replaceSlash.slice(1); + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Scoped_package_detected_looking_in_0, mangled); + } + return mangled; + } + } + return moduleName; + } + function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, traceEnabled, host) { + var result = cache && cache.get(containingDirectory); + if (result) { + if (traceEnabled) { + trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); + } + return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension } }; + } + } + function classicNameResolver(moduleName, containingFile, compilerOptions, host, cache) { + var traceEnabled = isTraceEnabled(compilerOptions, host); + var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; + var failedLookupLocations = []; + var containingDirectory = ts.getDirectoryPath(containingFile); + var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); + return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, false, failedLookupLocations); + function tryResolve(extensions) { + var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFile, failedLookupLocations, state); + if (resolvedUsingSettings) { + return { value: resolvedUsingSettings }; + } + var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName); + if (moduleHasNonRelativeName(moduleName)) { + var resolved_3 = forEachAncestorDirectory(containingDirectory, function (directory) { + var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, directory, traceEnabled, host); + if (resolutionFromCache) { + return resolutionFromCache; + } + var searchName = ts.normalizePath(ts.combinePaths(directory, moduleName)); + return toSearchResult(loadModuleFromFile(extensions, searchName, failedLookupLocations, false, state)); + }); + if (resolved_3) { + return resolved_3; + } + if (extensions === Extensions.TypeScript) { + return loadModuleFromNodeModulesAtTypes(moduleName, containingDirectory, failedLookupLocations, state); + } + } + else { + var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); + return toSearchResult(loadModuleFromFile(extensions, candidate, failedLookupLocations, false, state)); + } + } + } + ts.classicNameResolver = classicNameResolver; + function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, host, globalCache) { + var traceEnabled = isTraceEnabled(compilerOptions, host); + if (traceEnabled) { + trace(host, ts.Diagnostics.Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2, projectName, moduleName, globalCache); + } + var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; + var failedLookupLocations = []; + var resolved = loadModuleFromNodeModulesOneLevel(Extensions.DtsOnly, moduleName, globalCache, failedLookupLocations, state); + return createResolvedModuleWithFailedLookupLocations(resolved, true, failedLookupLocations); + } + ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache; + function toSearchResult(value) { + return value !== undefined ? { value: value } : undefined; + } + function forEachAncestorDirectory(directory, callback) { + while (true) { + var result = callback(directory); + if (result !== undefined) { + return result; + } + var parentPath = ts.getDirectoryPath(directory); + if (parentPath === directory) { + return undefined; + } + directory = parentPath; + } + } +})(ts || (ts = {})); +var ts; +(function (ts) { + ts.externalHelpersModuleNameText = "tslib"; + function getDeclarationOfKind(symbol, kind) { + var declarations = symbol.declarations; + if (declarations) { + for (var _i = 0, declarations_1 = declarations; _i < declarations_1.length; _i++) { + var declaration = declarations_1[_i]; + if (declaration.kind === kind) { + return declaration; + } + } + } + return undefined; + } + ts.getDeclarationOfKind = getDeclarationOfKind; + function findDeclaration(symbol, predicate) { + var declarations = symbol.declarations; + if (declarations) { + for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { + var declaration = declarations_2[_i]; + if (predicate(declaration)) { + return declaration; + } + } + } + return undefined; + } + ts.findDeclaration = findDeclaration; + var stringWriters = []; + function getSingleLineStringWriter() { + if (stringWriters.length === 0) { + var str_1 = ""; + var writeText = function (text) { return str_1 += text; }; + return { + string: function () { return str_1; }, + writeKeyword: writeText, + writeOperator: writeText, + writePunctuation: writeText, + writeSpace: writeText, + writeStringLiteral: writeText, + writeParameter: writeText, + writeProperty: writeText, + writeSymbol: writeText, + writeLine: function () { return str_1 += " "; }, + increaseIndent: ts.noop, + decreaseIndent: ts.noop, + clear: function () { return str_1 = ""; }, + trackSymbol: ts.noop, + reportInaccessibleThisError: ts.noop, + reportIllegalExtends: ts.noop + }; + } + return stringWriters.pop(); + } + ts.getSingleLineStringWriter = getSingleLineStringWriter; + function releaseStringWriter(writer) { + writer.clear(); + stringWriters.push(writer); + } + ts.releaseStringWriter = releaseStringWriter; + function getFullWidth(node) { + return node.end - node.pos; + } + ts.getFullWidth = getFullWidth; + function hasResolvedModule(sourceFile, moduleNameText) { + return !!(sourceFile && sourceFile.resolvedModules && sourceFile.resolvedModules.get(moduleNameText)); + } + ts.hasResolvedModule = hasResolvedModule; + function getResolvedModule(sourceFile, moduleNameText) { + return hasResolvedModule(sourceFile, moduleNameText) ? sourceFile.resolvedModules.get(moduleNameText) : undefined; + } + ts.getResolvedModule = getResolvedModule; + function setResolvedModule(sourceFile, moduleNameText, resolvedModule) { + if (!sourceFile.resolvedModules) { + sourceFile.resolvedModules = ts.createMap(); + } + sourceFile.resolvedModules.set(moduleNameText, resolvedModule); + } + ts.setResolvedModule = setResolvedModule; + function setResolvedTypeReferenceDirective(sourceFile, typeReferenceDirectiveName, resolvedTypeReferenceDirective) { + if (!sourceFile.resolvedTypeReferenceDirectiveNames) { + sourceFile.resolvedTypeReferenceDirectiveNames = ts.createMap(); + } + sourceFile.resolvedTypeReferenceDirectiveNames.set(typeReferenceDirectiveName, resolvedTypeReferenceDirective); + } + ts.setResolvedTypeReferenceDirective = setResolvedTypeReferenceDirective; + function moduleResolutionIsEqualTo(oldResolution, newResolution) { + return oldResolution.isExternalLibraryImport === newResolution.isExternalLibraryImport && + oldResolution.extension === newResolution.extension && + oldResolution.resolvedFileName === newResolution.resolvedFileName; + } + ts.moduleResolutionIsEqualTo = moduleResolutionIsEqualTo; + function typeDirectiveIsEqualTo(oldResolution, newResolution) { + return oldResolution.resolvedFileName === newResolution.resolvedFileName && oldResolution.primary === newResolution.primary; + } + ts.typeDirectiveIsEqualTo = typeDirectiveIsEqualTo; + function hasChangesInResolutions(names, newResolutions, oldResolutions, comparer) { + if (names.length !== newResolutions.length) { + return false; + } + for (var i = 0; i < names.length; i++) { + var newResolution = newResolutions[i]; + var oldResolution = oldResolutions && oldResolutions.get(names[i]); + var changed = oldResolution + ? !newResolution || !comparer(oldResolution, newResolution) + : newResolution; + if (changed) { + return true; + } + } + return false; + } + ts.hasChangesInResolutions = hasChangesInResolutions; + function containsParseError(node) { + aggregateChildData(node); + return (node.flags & 131072) !== 0; + } + ts.containsParseError = containsParseError; + function aggregateChildData(node) { + if (!(node.flags & 262144)) { + var thisNodeOrAnySubNodesHasError = ((node.flags & 32768) !== 0) || + ts.forEachChild(node, containsParseError); + if (thisNodeOrAnySubNodesHasError) { + node.flags |= 131072; + } + node.flags |= 262144; + } + } + function getSourceFileOfNode(node) { + while (node && node.kind !== 264) { + node = node.parent; + } + return node; + } + ts.getSourceFileOfNode = getSourceFileOfNode; + function isStatementWithLocals(node) { + switch (node.kind) { + case 206: + case 234: + case 213: + case 214: + case 215: + return true; + } + return false; + } + ts.isStatementWithLocals = isStatementWithLocals; + function getStartPositionOfLine(line, sourceFile) { + ts.Debug.assert(line >= 0); + return ts.getLineStarts(sourceFile)[line]; + } + ts.getStartPositionOfLine = getStartPositionOfLine; + function nodePosToString(node) { + var file = getSourceFileOfNode(node); + var loc = ts.getLineAndCharacterOfPosition(file, node.pos); + return file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + ")"; + } + ts.nodePosToString = nodePosToString; + function getStartPosOfNode(node) { + return node.pos; + } + ts.getStartPosOfNode = getStartPosOfNode; + function isDefined(value) { + return value !== undefined; + } + ts.isDefined = isDefined; + function getEndLinePosition(line, sourceFile) { + ts.Debug.assert(line >= 0); + var lineStarts = ts.getLineStarts(sourceFile); + var lineIndex = line; + var sourceText = sourceFile.text; + if (lineIndex + 1 === lineStarts.length) { + return sourceText.length - 1; + } + else { + var start = lineStarts[lineIndex]; + var pos = lineStarts[lineIndex + 1] - 1; + ts.Debug.assert(ts.isLineBreak(sourceText.charCodeAt(pos))); + while (start <= pos && ts.isLineBreak(sourceText.charCodeAt(pos))) { + pos--; + } + return pos; + } + } + ts.getEndLinePosition = getEndLinePosition; + function nodeIsMissing(node) { + if (node === undefined) { + return true; + } + return node.pos === node.end && node.pos >= 0 && node.kind !== 1; + } + ts.nodeIsMissing = nodeIsMissing; + function nodeIsPresent(node) { + return !nodeIsMissing(node); + } + ts.nodeIsPresent = nodeIsPresent; + function isToken(n) { + return n.kind >= 0 && n.kind <= 141; + } + ts.isToken = isToken; + function getTokenPosOfNode(node, sourceFile, includeJsDoc) { + if (nodeIsMissing(node)) { + return node.pos; + } + if (isJSDocNode(node)) { + return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos, false, true); + } + if (includeJsDoc && node.jsDoc && node.jsDoc.length > 0) { + return getTokenPosOfNode(node.jsDoc[0]); + } + if (node.kind === 293 && node._children.length > 0) { + return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); + } + return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); + } + ts.getTokenPosOfNode = getTokenPosOfNode; + function isJSDocNode(node) { + return node.kind >= 266 && node.kind <= 292; + } + ts.isJSDocNode = isJSDocNode; + function isJSDocTag(node) { + return node.kind >= 282 && node.kind <= 292; + } + ts.isJSDocTag = isJSDocTag; + function getNonDecoratorTokenPosOfNode(node, sourceFile) { + if (nodeIsMissing(node) || !node.decorators) { + return getTokenPosOfNode(node, sourceFile); + } + return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.decorators.end); + } + ts.getNonDecoratorTokenPosOfNode = getNonDecoratorTokenPosOfNode; + function getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia) { + if (includeTrivia === void 0) { includeTrivia = false; } + if (nodeIsMissing(node)) { + return ""; + } + var text = sourceFile.text; + return text.substring(includeTrivia ? node.pos : ts.skipTrivia(text, node.pos), node.end); + } + ts.getSourceTextOfNodeFromSourceFile = getSourceTextOfNodeFromSourceFile; + function getTextOfNodeFromSourceText(sourceText, node) { + if (nodeIsMissing(node)) { + return ""; + } + return sourceText.substring(ts.skipTrivia(sourceText, node.pos), node.end); + } + ts.getTextOfNodeFromSourceText = getTextOfNodeFromSourceText; + function getTextOfNode(node, includeTrivia) { + if (includeTrivia === void 0) { includeTrivia = false; } + return getSourceTextOfNodeFromSourceFile(getSourceFileOfNode(node), node, includeTrivia); + } + ts.getTextOfNode = getTextOfNode; + function getLiteralText(node, sourceFile) { + if (!nodeIsSynthesized(node) && node.parent) { + return getSourceTextOfNodeFromSourceFile(sourceFile, node); + } + switch (node.kind) { + case 9: + return getQuotedEscapedLiteralText('"', node.text, '"'); + case 12: + return getQuotedEscapedLiteralText("`", node.text, "`"); + case 13: + return getQuotedEscapedLiteralText("`", node.text, "${"); + case 14: + return getQuotedEscapedLiteralText("}", node.text, "${"); + case 15: + return getQuotedEscapedLiteralText("}", node.text, "`"); + case 8: + return node.text; + } + ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for."); + } + ts.getLiteralText = getLiteralText; + function getQuotedEscapedLiteralText(leftQuote, text, rightQuote) { + return leftQuote + escapeNonAsciiCharacters(escapeString(text)) + rightQuote; + } + function escapeIdentifier(identifier) { + return identifier.length >= 2 && identifier.charCodeAt(0) === 95 && identifier.charCodeAt(1) === 95 ? "_" + identifier : identifier; + } + ts.escapeIdentifier = escapeIdentifier; + function makeIdentifierFromModuleName(moduleName) { + return ts.getBaseFileName(moduleName).replace(/^(\d)/, "_$1").replace(/\W/g, "_"); + } + ts.makeIdentifierFromModuleName = makeIdentifierFromModuleName; + function isBlockOrCatchScoped(declaration) { + return (ts.getCombinedNodeFlags(declaration) & 3) !== 0 || + isCatchClauseVariableDeclarationOrBindingElement(declaration); + } + ts.isBlockOrCatchScoped = isBlockOrCatchScoped; + function isCatchClauseVariableDeclarationOrBindingElement(declaration) { + var node = getRootDeclaration(declaration); + return node.kind === 225 && node.parent.kind === 259; + } + ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; + function isAmbientModule(node) { + return node && node.kind === 232 && + (node.name.kind === 9 || isGlobalScopeAugmentation(node)); + } + ts.isAmbientModule = isAmbientModule; + function isShorthandAmbientModuleSymbol(moduleSymbol) { + return isShorthandAmbientModule(moduleSymbol.valueDeclaration); + } + ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; + function isShorthandAmbientModule(node) { + return node && node.kind === 232 && (!node.body); + } + function isBlockScopedContainerTopLevel(node) { + return node.kind === 264 || + node.kind === 232 || + isFunctionLike(node); + } + ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; + function isGlobalScopeAugmentation(module) { + return !!(module.flags & 512); + } + ts.isGlobalScopeAugmentation = isGlobalScopeAugmentation; + function isExternalModuleAugmentation(node) { + if (!node || !isAmbientModule(node)) { + return false; + } + switch (node.parent.kind) { + case 264: + return ts.isExternalModule(node.parent); + case 233: + return isAmbientModule(node.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); + } + return false; + } + ts.isExternalModuleAugmentation = isExternalModuleAugmentation; + function isEffectiveExternalModule(node, compilerOptions) { + return ts.isExternalModule(node) || compilerOptions.isolatedModules; + } + ts.isEffectiveExternalModule = isEffectiveExternalModule; + function isBlockScope(node, parentNode) { + switch (node.kind) { + case 264: + case 234: + case 259: + case 232: + case 213: + case 214: + case 215: + case 151: + case 150: + case 152: + case 153: + case 227: + case 185: + case 186: + return true; + case 206: + return parentNode && !isFunctionLike(parentNode); + } + return false; + } + ts.isBlockScope = isBlockScope; + function getEnclosingBlockScopeContainer(node) { + var current = node.parent; + while (current) { + if (isBlockScope(current, current.parent)) { + return current; + } + current = current.parent; + } + } + ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; + function declarationNameToString(name) { + return getFullWidth(name) === 0 ? "(Missing)" : getTextOfNode(name); + } + ts.declarationNameToString = declarationNameToString; + function getNameFromIndexInfo(info) { + return info.declaration ? declarationNameToString(info.declaration.parameters[0].name) : undefined; + } + ts.getNameFromIndexInfo = getNameFromIndexInfo; + function getTextOfPropertyName(name) { + switch (name.kind) { + case 70: + return name.text; + case 9: + case 8: + return name.text; + case 143: + if (isStringOrNumericLiteral(name.expression)) { + return name.expression.text; + } + } + return undefined; + } + ts.getTextOfPropertyName = getTextOfPropertyName; + function entityNameToString(name) { + switch (name.kind) { + case 70: + return getFullWidth(name) === 0 ? ts.unescapeIdentifier(name.text) : getTextOfNode(name); + case 142: + return entityNameToString(name.left) + "." + entityNameToString(name.right); + case 178: + return entityNameToString(name.expression) + "." + entityNameToString(name.name); + } + } + ts.entityNameToString = entityNameToString; + function createDiagnosticForNode(node, message, arg0, arg1, arg2) { + var sourceFile = getSourceFileOfNode(node); + return createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2); + } + ts.createDiagnosticForNode = createDiagnosticForNode; + function createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2) { + var span = getErrorSpanForNode(sourceFile, node); + return ts.createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2); + } + ts.createDiagnosticForNodeInSourceFile = createDiagnosticForNodeInSourceFile; + function createDiagnosticForNodeFromMessageChain(node, messageChain) { + var sourceFile = getSourceFileOfNode(node); + var span = getErrorSpanForNode(sourceFile, node); + return { + file: sourceFile, + start: span.start, + length: span.length, + code: messageChain.code, + category: messageChain.category, + messageText: messageChain.next ? messageChain : messageChain.messageText + }; + } + ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; + function getSpanOfTokenAtPosition(sourceFile, pos) { + var scanner = ts.createScanner(sourceFile.languageVersion, true, sourceFile.languageVariant, sourceFile.text, undefined, pos); + scanner.scan(); + var start = scanner.getTokenPos(); + return ts.createTextSpanFromBounds(start, scanner.getTextPos()); + } + ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; + function getErrorSpanForArrowFunction(sourceFile, node) { + var pos = ts.skipTrivia(sourceFile.text, node.pos); + if (node.body && node.body.kind === 206) { + var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; + var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; + if (startLine < endLine) { + return ts.createTextSpan(pos, getEndLinePosition(startLine, sourceFile) - pos + 1); + } + } + return ts.createTextSpanFromBounds(pos, node.end); + } + function getErrorSpanForNode(sourceFile, node) { + var errorNode = node; + switch (node.kind) { + case 264: + var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); + if (pos_1 === sourceFile.text.length) { + return ts.createTextSpan(0, 0); + } + return getSpanOfTokenAtPosition(sourceFile, pos_1); + case 225: + case 175: + case 228: + case 198: + case 229: + case 232: + case 231: + case 263: + case 227: + case 185: + case 150: + case 152: + case 153: + case 230: + errorNode = node.name; + break; + case 186: + return getErrorSpanForArrowFunction(sourceFile, node); + } + if (errorNode === undefined) { + return getSpanOfTokenAtPosition(sourceFile, node.pos); + } + var pos = nodeIsMissing(errorNode) + ? errorNode.pos + : ts.skipTrivia(sourceFile.text, errorNode.pos); + return ts.createTextSpanFromBounds(pos, errorNode.end); + } + ts.getErrorSpanForNode = getErrorSpanForNode; + function isExternalOrCommonJsModule(file) { + return (file.externalModuleIndicator || file.commonJsModuleIndicator) !== undefined; + } + ts.isExternalOrCommonJsModule = isExternalOrCommonJsModule; + function isDeclarationFile(file) { + return file.isDeclarationFile; + } + ts.isDeclarationFile = isDeclarationFile; + function isConstEnumDeclaration(node) { + return node.kind === 231 && isConst(node); + } + ts.isConstEnumDeclaration = isConstEnumDeclaration; + function isConst(node) { + return !!(ts.getCombinedNodeFlags(node) & 2) + || !!(ts.getCombinedModifierFlags(node) & 2048); + } + ts.isConst = isConst; + function isLet(node) { + return !!(ts.getCombinedNodeFlags(node) & 1); + } + ts.isLet = isLet; + function isSuperCall(n) { + return n.kind === 180 && n.expression.kind === 96; + } + ts.isSuperCall = isSuperCall; + function isPrologueDirective(node) { + return node.kind === 209 + && node.expression.kind === 9; + } + ts.isPrologueDirective = isPrologueDirective; + function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { + return ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos); + } + ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; + function getLeadingCommentRangesOfNodeFromText(node, text) { + return ts.getLeadingCommentRanges(text, node.pos); + } + ts.getLeadingCommentRangesOfNodeFromText = getLeadingCommentRangesOfNodeFromText; + function getJSDocCommentRanges(node, text) { + var commentRanges = (node.kind === 145 || + node.kind === 144 || + node.kind === 185 || + node.kind === 186) ? + ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : + getLeadingCommentRangesOfNodeFromText(node, text); + return ts.filter(commentRanges, function (comment) { + return text.charCodeAt(comment.pos + 1) === 42 && + text.charCodeAt(comment.pos + 2) === 42 && + text.charCodeAt(comment.pos + 3) !== 47; + }); + } + ts.getJSDocCommentRanges = getJSDocCommentRanges; + ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; + ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; + ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; + function isPartOfTypeNode(node) { + if (157 <= node.kind && node.kind <= 172) { + return true; + } + switch (node.kind) { + case 118: + case 132: + case 135: + case 121: + case 136: + case 138: + case 129: + return true; + case 104: + return node.parent.kind !== 189; + case 200: + return !isExpressionWithTypeArgumentsInClassExtendsClause(node); + case 70: + if (node.parent.kind === 142 && node.parent.right === node) { + node = node.parent; + } + else if (node.parent.kind === 178 && node.parent.name === node) { + node = node.parent; + } + ts.Debug.assert(node.kind === 70 || node.kind === 142 || node.kind === 178, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + case 142: + case 178: + case 98: + var parent = node.parent; + if (parent.kind === 161) { + return false; + } + if (157 <= parent.kind && parent.kind <= 172) { + return true; + } + switch (parent.kind) { + case 200: + return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); + case 144: + return node === parent.constraint; + case 148: + case 147: + case 145: + case 225: + return node === parent.type; + case 227: + case 185: + case 186: + case 151: + case 150: + case 149: + case 152: + case 153: + return node === parent.type; + case 154: + case 155: + case 156: + return node === parent.type; + case 183: + return node === parent.type; + case 180: + case 181: + return parent.typeArguments && ts.indexOf(parent.typeArguments, node) >= 0; + case 182: + return false; + } + } + return false; + } + ts.isPartOfTypeNode = isPartOfTypeNode; + function isChildOfNodeWithKind(node, kind) { + while (node) { + if (node.kind === kind) { + return true; + } + node = node.parent; + } + return false; + } + ts.isChildOfNodeWithKind = isChildOfNodeWithKind; + function isPrefixUnaryExpression(node) { + return node.kind === 191; + } + ts.isPrefixUnaryExpression = isPrefixUnaryExpression; + function forEachReturnStatement(body, visitor) { + return traverse(body); + function traverse(node) { + switch (node.kind) { + case 218: + return visitor(node); + case 234: + case 206: + case 210: + case 211: + case 212: + case 213: + case 214: + case 215: + case 219: + case 220: + case 256: + case 257: + case 221: + case 223: + case 259: + return ts.forEachChild(node, traverse); + } + } + } + ts.forEachReturnStatement = forEachReturnStatement; + function forEachYieldExpression(body, visitor) { + return traverse(body); + function traverse(node) { + switch (node.kind) { + case 196: + visitor(node); + var operand = node.expression; + if (operand) { + traverse(operand); + } + return; + case 231: + case 229: + case 232: + case 230: + case 228: + case 198: + return; + default: + if (isFunctionLike(node)) { + var name = node.name; + if (name && name.kind === 143) { + traverse(name.expression); + return; + } + } + else if (!isPartOfTypeNode(node)) { + ts.forEachChild(node, traverse); + } + } + } + } + ts.forEachYieldExpression = forEachYieldExpression; + function getRestParameterElementType(node) { + if (node && node.kind === 163) { + return node.elementType; + } + else if (node && node.kind === 158) { + return ts.singleOrUndefined(node.typeArguments); + } + else { + return undefined; + } + } + ts.getRestParameterElementType = getRestParameterElementType; + function isVariableLike(node) { + if (node) { + switch (node.kind) { + case 175: + case 263: + case 145: + case 260: + case 148: + case 147: + case 261: + case 225: + return true; + } + } + return false; + } + ts.isVariableLike = isVariableLike; + function isAccessor(node) { + return node && (node.kind === 152 || node.kind === 153); + } + ts.isAccessor = isAccessor; + function isClassLike(node) { + return node && (node.kind === 228 || node.kind === 198); + } + ts.isClassLike = isClassLike; + function isFunctionLike(node) { + return node && isFunctionLikeKind(node.kind); + } + ts.isFunctionLike = isFunctionLike; + function isFunctionLikeKind(kind) { + switch (kind) { + case 151: + case 185: + case 227: + case 186: + case 150: + case 149: + case 152: + case 153: + case 154: + case 155: + case 156: + case 159: + case 160: + return true; + } + return false; + } + ts.isFunctionLikeKind = isFunctionLikeKind; + function introducesArgumentsExoticObject(node) { + switch (node.kind) { + case 150: + case 149: + case 151: + case 152: + case 153: + case 227: + case 185: + return true; + } + return false; + } + ts.introducesArgumentsExoticObject = introducesArgumentsExoticObject; + function isIterationStatement(node, lookInLabeledStatements) { + switch (node.kind) { + case 213: + case 214: + case 215: + case 211: + case 212: + return true; + case 221: + return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); + } + return false; + } + ts.isIterationStatement = isIterationStatement; + function unwrapInnermostStatementOfLabel(node, beforeUnwrapLabelCallback) { + while (true) { + if (beforeUnwrapLabelCallback) { + beforeUnwrapLabelCallback(node); + } + if (node.statement.kind !== 221) { + return node.statement; + } + node = node.statement; + } + } + ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; + function isFunctionBlock(node) { + return node && node.kind === 206 && isFunctionLike(node.parent); + } + ts.isFunctionBlock = isFunctionBlock; + function isObjectLiteralMethod(node) { + return node && node.kind === 150 && node.parent.kind === 177; + } + ts.isObjectLiteralMethod = isObjectLiteralMethod; + function isObjectLiteralOrClassExpressionMethod(node) { + return node.kind === 150 && + (node.parent.kind === 177 || + node.parent.kind === 198); + } + ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; + function isIdentifierTypePredicate(predicate) { + return predicate && predicate.kind === 1; + } + ts.isIdentifierTypePredicate = isIdentifierTypePredicate; + function isThisTypePredicate(predicate) { + return predicate && predicate.kind === 0; + } + ts.isThisTypePredicate = isThisTypePredicate; + function getContainingFunction(node) { + while (true) { + node = node.parent; + if (!node || isFunctionLike(node)) { + return node; + } + } + } + ts.getContainingFunction = getContainingFunction; + function getContainingClass(node) { + while (true) { + node = node.parent; + if (!node || isClassLike(node)) { + return node; + } + } + } + ts.getContainingClass = getContainingClass; + function getThisContainer(node, includeArrowFunctions) { + while (true) { + node = node.parent; + if (!node) { + return undefined; + } + switch (node.kind) { + case 143: + if (isClassLike(node.parent.parent)) { + return node; + } + node = node.parent; + break; + case 146: + if (node.parent.kind === 145 && isClassElement(node.parent.parent)) { + node = node.parent.parent; + } + else if (isClassElement(node.parent)) { + node = node.parent; + } + break; + case 186: + if (!includeArrowFunctions) { + continue; + } + case 227: + case 185: + case 232: + case 148: + case 147: + case 150: + case 149: + case 151: + case 152: + case 153: + case 154: + case 155: + case 156: + case 231: + case 264: + return node; + } + } + } + ts.getThisContainer = getThisContainer; + function getNewTargetContainer(node) { + var container = getThisContainer(node, false); + if (container) { + switch (container.kind) { + case 151: + case 227: + case 185: + return container; + } + } + return undefined; + } + ts.getNewTargetContainer = getNewTargetContainer; + function getSuperContainer(node, stopOnFunctions) { + while (true) { + node = node.parent; + if (!node) { + return node; + } + switch (node.kind) { + case 143: + node = node.parent; + break; + case 227: + case 185: + case 186: + if (!stopOnFunctions) { + continue; + } + case 148: + case 147: + case 150: + case 149: + case 151: + case 152: + case 153: + return node; + case 146: + if (node.parent.kind === 145 && isClassElement(node.parent.parent)) { + node = node.parent.parent; + } + else if (isClassElement(node.parent)) { + node = node.parent; + } + break; + } + } + } + ts.getSuperContainer = getSuperContainer; + function getImmediatelyInvokedFunctionExpression(func) { + if (func.kind === 185 || func.kind === 186) { + var prev = func; + var parent = func.parent; + while (parent.kind === 184) { + prev = parent; + parent = parent.parent; + } + if (parent.kind === 180 && parent.expression === prev) { + return parent; + } + } + } + ts.getImmediatelyInvokedFunctionExpression = getImmediatelyInvokedFunctionExpression; + function isSuperProperty(node) { + var kind = node.kind; + return (kind === 178 || kind === 179) + && node.expression.kind === 96; + } + ts.isSuperProperty = isSuperProperty; + function getEntityNameFromTypeNode(node) { + switch (node.kind) { + case 158: + case 276: + return node.typeName; + case 200: + return isEntityNameExpression(node.expression) + ? node.expression + : undefined; + case 70: + case 142: + return node; + } + return undefined; + } + ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; + function isCallLikeExpression(node) { + switch (node.kind) { + case 250: + case 249: + case 180: + case 181: + case 182: + case 146: + return true; + default: + return false; + } + } + ts.isCallLikeExpression = isCallLikeExpression; + function getInvokedExpression(node) { + if (node.kind === 182) { + return node.tag; + } + else if (isJsxOpeningLikeElement(node)) { + return node.tagName; + } + return node.expression; + } + ts.getInvokedExpression = getInvokedExpression; + function nodeCanBeDecorated(node) { + switch (node.kind) { + case 228: + return true; + case 148: + return node.parent.kind === 228; + case 152: + case 153: + case 150: + return node.body !== undefined + && node.parent.kind === 228; + case 145: + return node.parent.body !== undefined + && (node.parent.kind === 151 + || node.parent.kind === 150 + || node.parent.kind === 153) + && node.parent.parent.kind === 228; + } + return false; + } + ts.nodeCanBeDecorated = nodeCanBeDecorated; + function nodeIsDecorated(node) { + return node.decorators !== undefined + && nodeCanBeDecorated(node); + } + ts.nodeIsDecorated = nodeIsDecorated; + function nodeOrChildIsDecorated(node) { + return nodeIsDecorated(node) || childIsDecorated(node); + } + ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; + function childIsDecorated(node) { + switch (node.kind) { + case 228: + return ts.forEach(node.members, nodeOrChildIsDecorated); + case 150: + case 153: + return ts.forEach(node.parameters, nodeIsDecorated); + } + } + ts.childIsDecorated = childIsDecorated; + function isJSXTagName(node) { + var parent = node.parent; + if (parent.kind === 250 || + parent.kind === 249 || + parent.kind === 251) { + return parent.tagName === node; + } + return false; + } + ts.isJSXTagName = isJSXTagName; + function isPartOfExpression(node) { + switch (node.kind) { + case 98: + case 96: + case 94: + case 100: + case 85: + case 11: + case 176: + case 177: + case 178: + case 179: + case 180: + case 181: + case 182: + case 201: + case 183: + case 202: + case 184: + case 185: + case 198: + case 186: + case 189: + case 187: + case 188: + case 191: + case 192: + case 193: + case 194: + case 197: + case 195: + case 12: + case 199: + case 248: + case 249: + case 196: + case 190: + case 203: + return true; + case 142: + while (node.parent.kind === 142) { + node = node.parent; + } + return node.parent.kind === 161 || isJSXTagName(node); + case 70: + if (node.parent.kind === 161 || isJSXTagName(node)) { + return true; + } + case 8: + case 9: + case 98: + var parent = node.parent; + switch (parent.kind) { + case 225: + case 145: + case 148: + case 147: + case 263: + case 260: + case 175: + return parent.initializer === node; + case 209: + case 210: + case 211: + case 212: + case 218: + case 219: + case 220: + case 256: + case 222: + case 220: + return parent.expression === node; + case 213: + var forStatement = parent; + return (forStatement.initializer === node && forStatement.initializer.kind !== 226) || + forStatement.condition === node || + forStatement.incrementor === node; + case 214: + case 215: + var forInStatement = parent; + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 226) || + forInStatement.expression === node; + case 183: + case 201: + return node === parent.expression; + case 204: + return node === parent.expression; + case 143: + return node === parent.expression; + case 146: + case 255: + case 254: + case 262: + return true; + case 200: + return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); + default: + if (isPartOfExpression(parent)) { + return true; + } + } + } + return false; + } + ts.isPartOfExpression = isPartOfExpression; + function isInstantiatedModule(node, preserveConstEnums) { + var moduleState = ts.getModuleInstanceState(node); + return moduleState === 1 || + (preserveConstEnums && moduleState === 2); + } + ts.isInstantiatedModule = isInstantiatedModule; + function isExternalModuleImportEqualsDeclaration(node) { + return node.kind === 236 && node.moduleReference.kind === 247; + } + ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; + function getExternalModuleImportEqualsDeclarationExpression(node) { + ts.Debug.assert(isExternalModuleImportEqualsDeclaration(node)); + return node.moduleReference.expression; + } + ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; + function isInternalModuleImportEqualsDeclaration(node) { + return node.kind === 236 && node.moduleReference.kind !== 247; + } + ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; + function isSourceFileJavaScript(file) { + return isInJavaScriptFile(file); + } + ts.isSourceFileJavaScript = isSourceFileJavaScript; + function isInJavaScriptFile(node) { + return node && !!(node.flags & 65536); + } + ts.isInJavaScriptFile = isInJavaScriptFile; + function isRequireCall(callExpression, checkArgumentIsStringLiteral) { + if (callExpression.kind !== 180) { + return false; + } + var _a = callExpression, expression = _a.expression, args = _a.arguments; + if (expression.kind !== 70 || expression.text !== "require") { + return false; + } + if (args.length !== 1) { + return false; + } + var arg = args[0]; + return !checkArgumentIsStringLiteral || arg.kind === 9 || arg.kind === 12; + } + ts.isRequireCall = isRequireCall; + function isSingleOrDoubleQuote(charCode) { + return charCode === 39 || charCode === 34; + } + ts.isSingleOrDoubleQuote = isSingleOrDoubleQuote; + function isDeclarationOfFunctionOrClassExpression(s) { + if (s.valueDeclaration && s.valueDeclaration.kind === 225) { + var declaration = s.valueDeclaration; + return declaration.initializer && (declaration.initializer.kind === 185 || declaration.initializer.kind === 198); + } + return false; + } + ts.isDeclarationOfFunctionOrClassExpression = isDeclarationOfFunctionOrClassExpression; + function getRightMostAssignedExpression(node) { + while (isAssignmentExpression(node, true)) { + node = node.right; + } + return node; + } + ts.getRightMostAssignedExpression = getRightMostAssignedExpression; + function isExportsIdentifier(node) { + return isIdentifier(node) && node.text === "exports"; + } + ts.isExportsIdentifier = isExportsIdentifier; + function isModuleExportsPropertyAccessExpression(node) { + return isPropertyAccessExpression(node) && isIdentifier(node.expression) && node.expression.text === "module" && node.name.text === "exports"; + } + ts.isModuleExportsPropertyAccessExpression = isModuleExportsPropertyAccessExpression; + function getSpecialPropertyAssignmentKind(expression) { + if (!isInJavaScriptFile(expression)) { + return 0; + } + var expr = expression; + if (expr.operatorToken.kind !== 57 || expr.left.kind !== 178) { + return 0; + } + var lhs = expr.left; + if (lhs.expression.kind === 70) { + var lhsId = lhs.expression; + if (lhsId.text === "exports") { + return 1; + } + else if (lhsId.text === "module" && lhs.name.text === "exports") { + return 2; + } + else { + return 5; + } + } + else if (lhs.expression.kind === 98) { + return 4; + } + else if (lhs.expression.kind === 178) { + var innerPropertyAccess = lhs.expression; + if (innerPropertyAccess.expression.kind === 70) { + var innerPropertyAccessIdentifier = innerPropertyAccess.expression; + if (innerPropertyAccessIdentifier.text === "module" && innerPropertyAccess.name.text === "exports") { + return 1; + } + if (innerPropertyAccess.name.text === "prototype") { + return 3; + } + } + } + return 0; + } + ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind; + function getExternalModuleName(node) { + if (node.kind === 237) { + return node.moduleSpecifier; + } + if (node.kind === 236) { + var reference = node.moduleReference; + if (reference.kind === 247) { + return reference.expression; + } + } + if (node.kind === 243) { + return node.moduleSpecifier; + } + if (node.kind === 232 && node.name.kind === 9) { + return node.name; + } + } + ts.getExternalModuleName = getExternalModuleName; + function getNamespaceDeclarationNode(node) { + if (node.kind === 236) { + return node; + } + var importClause = node.importClause; + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 239) { + return importClause.namedBindings; + } + } + ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; + function isDefaultImport(node) { + return node.kind === 237 + && node.importClause + && !!node.importClause.name; + } + ts.isDefaultImport = isDefaultImport; + function hasQuestionToken(node) { + if (node) { + switch (node.kind) { + case 145: + case 150: + case 149: + case 261: + case 260: + case 148: + case 147: + return node.questionToken !== undefined; + } + } + return false; + } + ts.hasQuestionToken = hasQuestionToken; + function isJSDocConstructSignature(node) { + return node.kind === 278 && + node.parameters.length > 0 && + node.parameters[0].type.kind === 280; + } + ts.isJSDocConstructSignature = isJSDocConstructSignature; + function getCommentsFromJSDoc(node) { + return ts.map(getJSDocs(node), function (doc) { return doc.comment; }); + } + ts.getCommentsFromJSDoc = getCommentsFromJSDoc; + function hasJSDocParameterTags(node) { + var parameterTags = getJSDocTags(node, 285); + return parameterTags && parameterTags.length > 0; + } + ts.hasJSDocParameterTags = hasJSDocParameterTags; + function getJSDocTags(node, kind) { + var docs = getJSDocs(node); + if (docs) { + var result = []; + for (var _i = 0, docs_1 = docs; _i < docs_1.length; _i++) { + var doc = docs_1[_i]; + if (doc.kind === 285) { + if (doc.kind === kind) { + result.push(doc); + } + } + else { + var tags = doc.tags; + if (tags) { + result.push.apply(result, ts.filter(tags, function (tag) { return tag.kind === kind; })); + } + } + } + return result; + } + } + function getFirstJSDocTag(node, kind) { + return node && ts.firstOrUndefined(getJSDocTags(node, kind)); + } + function getJSDocs(node) { + var cache = node.jsDocCache; + if (!cache) { + getJSDocsWorker(node); + node.jsDocCache = cache; + } + return cache; + function getJSDocsWorker(node) { + var parent = node.parent; + var isInitializerOfVariableDeclarationInStatement = isVariableLike(parent) && + parent.initializer === node && + parent.parent.parent.kind === 207; + var isVariableOfVariableDeclarationStatement = isVariableLike(node) && + parent.parent.kind === 207; + var variableStatementNode = isInitializerOfVariableDeclarationInStatement ? parent.parent.parent : + isVariableOfVariableDeclarationStatement ? parent.parent : + undefined; + if (variableStatementNode) { + getJSDocsWorker(variableStatementNode); + } + var isSourceOfAssignmentExpressionStatement = parent && parent.parent && + parent.kind === 193 && + parent.operatorToken.kind === 57 && + parent.parent.kind === 209; + if (isSourceOfAssignmentExpressionStatement) { + getJSDocsWorker(parent.parent); + } + var isModuleDeclaration = node.kind === 232 && + parent && parent.kind === 232; + var isPropertyAssignmentExpression = parent && parent.kind === 260; + if (isModuleDeclaration || isPropertyAssignmentExpression) { + getJSDocsWorker(parent); + } + if (node.kind === 145) { + cache = ts.concatenate(cache, getJSDocParameterTags(node)); + } + if (isVariableLike(node) && node.initializer) { + cache = ts.concatenate(cache, node.initializer.jsDoc); + } + cache = ts.concatenate(cache, node.jsDoc); + } + } + ts.getJSDocs = getJSDocs; + function getJSDocParameterTags(param) { + if (!isParameter(param)) { + return undefined; + } + var func = param.parent; + var tags = getJSDocTags(func, 285); + if (!param.name) { + var i = func.parameters.indexOf(param); + var paramTags = ts.filter(tags, function (tag) { return tag.kind === 285; }); + if (paramTags && 0 <= i && i < paramTags.length) { + return [paramTags[i]]; + } + } + else if (param.name.kind === 70) { + var name_1 = param.name.text; + return ts.filter(tags, function (tag) { return tag.kind === 285 && tag.parameterName.text === name_1; }); + } + else { + return undefined; + } + } + ts.getJSDocParameterTags = getJSDocParameterTags; + function getJSDocType(node) { + var tag = getFirstJSDocTag(node, 287); + if (!tag && node.kind === 145) { + var paramTags = getJSDocParameterTags(node); + if (paramTags) { + tag = ts.find(paramTags, function (tag) { return !!tag.typeExpression; }); + } + } + return tag && tag.typeExpression && tag.typeExpression.type; + } + ts.getJSDocType = getJSDocType; + function getJSDocAugmentsTag(node) { + return getFirstJSDocTag(node, 284); + } + ts.getJSDocAugmentsTag = getJSDocAugmentsTag; + function getJSDocReturnTag(node) { + return getFirstJSDocTag(node, 286); + } + ts.getJSDocReturnTag = getJSDocReturnTag; + function getJSDocTemplateTag(node) { + return getFirstJSDocTag(node, 288); + } + ts.getJSDocTemplateTag = getJSDocTemplateTag; + function hasRestParameter(s) { + return isRestParameter(ts.lastOrUndefined(s.parameters)); + } + ts.hasRestParameter = hasRestParameter; + function hasDeclaredRestParameter(s) { + return isDeclaredRestParam(ts.lastOrUndefined(s.parameters)); + } + ts.hasDeclaredRestParameter = hasDeclaredRestParameter; + function isRestParameter(node) { + if (node && (node.flags & 65536)) { + if (node.type && node.type.kind === 279 || + ts.forEach(getJSDocParameterTags(node), function (t) { return t.typeExpression && t.typeExpression.type.kind === 279; })) { + return true; + } + } + return isDeclaredRestParam(node); + } + ts.isRestParameter = isRestParameter; + function isDeclaredRestParam(node) { + return node && node.dotDotDotToken !== undefined; + } + ts.isDeclaredRestParam = isDeclaredRestParam; + var AssignmentKind; + (function (AssignmentKind) { + AssignmentKind[AssignmentKind["None"] = 0] = "None"; + AssignmentKind[AssignmentKind["Definite"] = 1] = "Definite"; + AssignmentKind[AssignmentKind["Compound"] = 2] = "Compound"; + })(AssignmentKind = ts.AssignmentKind || (ts.AssignmentKind = {})); + function getAssignmentTargetKind(node) { + var parent = node.parent; + while (true) { + switch (parent.kind) { + case 193: + var binaryOperator = parent.operatorToken.kind; + return isAssignmentOperator(binaryOperator) && parent.left === node ? + binaryOperator === 57 ? 1 : 2 : + 0; + case 191: + case 192: + var unaryOperator = parent.operator; + return unaryOperator === 42 || unaryOperator === 43 ? 2 : 0; + case 214: + case 215: + return parent.initializer === node ? 1 : 0; + case 184: + case 176: + case 197: + node = parent; + break; + case 261: + if (parent.name !== node) { + return 0; + } + node = parent.parent; + break; + case 260: + if (parent.name === node) { + return 0; + } + node = parent.parent; + break; + default: + return 0; + } + parent = node.parent; + } + } + ts.getAssignmentTargetKind = getAssignmentTargetKind; + function isAssignmentTarget(node) { + return getAssignmentTargetKind(node) !== 0; + } + ts.isAssignmentTarget = isAssignmentTarget; + function isDeleteTarget(node) { + if (node.kind !== 178 && node.kind !== 179) { + return false; + } + node = node.parent; + while (node && node.kind === 184) { + node = node.parent; + } + return node && node.kind === 187; + } + ts.isDeleteTarget = isDeleteTarget; + function isNodeDescendantOf(node, ancestor) { + while (node) { + if (node === ancestor) + return true; + node = node.parent; + } + return false; + } + ts.isNodeDescendantOf = isNodeDescendantOf; + function isInAmbientContext(node) { + while (node) { + if (hasModifier(node, 2) || (node.kind === 264 && node.isDeclarationFile)) { + return true; + } + node = node.parent; + } + return false; + } + ts.isInAmbientContext = isInAmbientContext; + function isDeclarationName(name) { + if (name.kind !== 70 && name.kind !== 9 && name.kind !== 8) { + return false; + } + var parent = name.parent; + if (parent.kind === 241 || parent.kind === 245) { + if (parent.propertyName) { + return true; + } + } + if (isDeclaration(parent)) { + return parent.name === name; + } + return false; + } + ts.isDeclarationName = isDeclarationName; + function isLiteralComputedPropertyDeclarationName(node) { + return (node.kind === 9 || node.kind === 8) && + node.parent.kind === 143 && + isDeclaration(node.parent.parent); + } + ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; + function isIdentifierName(node) { + var parent = node.parent; + switch (parent.kind) { + case 148: + case 147: + case 150: + case 149: + case 152: + case 153: + case 263: + case 260: + case 178: + return parent.name === node; + case 142: + if (parent.right === node) { + while (parent.kind === 142) { + parent = parent.parent; + } + return parent.kind === 161; + } + return false; + case 175: + case 241: + return parent.propertyName === node; + case 245: + return true; + } + return false; + } + ts.isIdentifierName = isIdentifierName; + function isAliasSymbolDeclaration(node) { + return node.kind === 236 || + node.kind === 235 || + node.kind === 238 && !!node.name || + node.kind === 239 || + node.kind === 241 || + node.kind === 245 || + node.kind === 242 && exportAssignmentIsAlias(node); + } + ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; + function exportAssignmentIsAlias(node) { + return isEntityNameExpression(node.expression); + } + ts.exportAssignmentIsAlias = exportAssignmentIsAlias; + function getClassExtendsHeritageClauseElement(node) { + var heritageClause = getHeritageClause(node.heritageClauses, 84); + return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : undefined; + } + ts.getClassExtendsHeritageClauseElement = getClassExtendsHeritageClauseElement; + function getClassImplementsHeritageClauseElements(node) { + var heritageClause = getHeritageClause(node.heritageClauses, 107); + return heritageClause ? heritageClause.types : undefined; + } + ts.getClassImplementsHeritageClauseElements = getClassImplementsHeritageClauseElements; + function getInterfaceBaseTypeNodes(node) { + var heritageClause = getHeritageClause(node.heritageClauses, 84); + return heritageClause ? heritageClause.types : undefined; + } + ts.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes; + function getHeritageClause(clauses, kind) { + if (clauses) { + for (var _i = 0, clauses_1 = clauses; _i < clauses_1.length; _i++) { + var clause = clauses_1[_i]; + if (clause.token === kind) { + return clause; + } + } + } + return undefined; + } + ts.getHeritageClause = getHeritageClause; + function tryResolveScriptReference(host, sourceFile, reference) { + if (!host.getCompilerOptions().noResolve) { + var referenceFileName = ts.isRootedDiskPath(reference.fileName) ? reference.fileName : ts.combinePaths(ts.getDirectoryPath(sourceFile.fileName), reference.fileName); + return host.getSourceFile(referenceFileName); + } + } + ts.tryResolveScriptReference = tryResolveScriptReference; + function getAncestor(node, kind) { + while (node) { + if (node.kind === kind) { + return node; + } + node = node.parent; + } + return undefined; + } + ts.getAncestor = getAncestor; + function getFileReferenceFromReferencePath(comment, commentRange) { + var simpleReferenceRegEx = /^\/\/\/\s*/gim; + if (simpleReferenceRegEx.test(comment)) { + if (isNoDefaultLibRegEx.test(comment)) { + return { + isNoDefaultLib: true + }; + } + else { + var refMatchResult = ts.fullTripleSlashReferencePathRegEx.exec(comment); + var refLibResult = !refMatchResult && ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx.exec(comment); + if (refMatchResult || refLibResult) { + var start = commentRange.pos; + var end = commentRange.end; + return { + fileReference: { + pos: start, + end: end, + fileName: (refMatchResult || refLibResult)[3] + }, + isNoDefaultLib: false, + isTypeReferenceDirective: !!refLibResult + }; + } + return { + diagnosticMessage: ts.Diagnostics.Invalid_reference_directive_syntax, + isNoDefaultLib: false + }; + } + } + return undefined; + } + ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; + function isKeyword(token) { + return 71 <= token && token <= 141; + } + ts.isKeyword = isKeyword; + function isTrivia(token) { + return 2 <= token && token <= 7; + } + ts.isTrivia = isTrivia; + var FunctionFlags; + (function (FunctionFlags) { + FunctionFlags[FunctionFlags["Normal"] = 0] = "Normal"; + FunctionFlags[FunctionFlags["Generator"] = 1] = "Generator"; + FunctionFlags[FunctionFlags["Async"] = 2] = "Async"; + FunctionFlags[FunctionFlags["AsyncOrAsyncGenerator"] = 3] = "AsyncOrAsyncGenerator"; + FunctionFlags[FunctionFlags["Invalid"] = 4] = "Invalid"; + FunctionFlags[FunctionFlags["InvalidAsyncOrAsyncGenerator"] = 7] = "InvalidAsyncOrAsyncGenerator"; + FunctionFlags[FunctionFlags["InvalidGenerator"] = 5] = "InvalidGenerator"; + })(FunctionFlags = ts.FunctionFlags || (ts.FunctionFlags = {})); + function getFunctionFlags(node) { + var flags = 0; + switch (node.kind) { + case 227: + case 185: + case 150: + if (node.asteriskToken) { + flags |= 1; + } + case 186: + if (hasModifier(node, 256)) { + flags |= 2; + } + break; + } + if (!node.body) { + flags |= 4; + } + return flags; + } + ts.getFunctionFlags = getFunctionFlags; + function isAsyncFunction(node) { + switch (node.kind) { + case 227: + case 185: + case 186: + case 150: + return node.body !== undefined + && node.asteriskToken === undefined + && hasModifier(node, 256); + } + return false; + } + ts.isAsyncFunction = isAsyncFunction; + function isNumericLiteral(node) { + return node.kind === 8; + } + ts.isNumericLiteral = isNumericLiteral; + function isStringOrNumericLiteral(node) { + var kind = node.kind; + return kind === 9 + || kind === 8; + } + ts.isStringOrNumericLiteral = isStringOrNumericLiteral; + function hasDynamicName(declaration) { + return declaration.name && isDynamicName(declaration.name); + } + ts.hasDynamicName = hasDynamicName; + function isDynamicName(name) { + return name.kind === 143 && + !isStringOrNumericLiteral(name.expression) && + !isWellKnownSymbolSyntactically(name.expression); + } + ts.isDynamicName = isDynamicName; + function isWellKnownSymbolSyntactically(node) { + return isPropertyAccessExpression(node) && isESSymbolIdentifier(node.expression); + } + ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically; + function getPropertyNameForPropertyNameNode(name) { + if (name.kind === 70 || name.kind === 9 || name.kind === 8 || name.kind === 145) { + return name.text; + } + if (name.kind === 143) { + var nameExpression = name.expression; + if (isWellKnownSymbolSyntactically(nameExpression)) { + var rightHandSideName = nameExpression.name.text; + return getPropertyNameForKnownSymbolName(rightHandSideName); + } + else if (nameExpression.kind === 9 || nameExpression.kind === 8) { + return nameExpression.text; + } + } + return undefined; + } + ts.getPropertyNameForPropertyNameNode = getPropertyNameForPropertyNameNode; + function getPropertyNameForKnownSymbolName(symbolName) { + return "__@" + symbolName; + } + ts.getPropertyNameForKnownSymbolName = getPropertyNameForKnownSymbolName; + function isESSymbolIdentifier(node) { + return node.kind === 70 && node.text === "Symbol"; + } + ts.isESSymbolIdentifier = isESSymbolIdentifier; + function isPushOrUnshiftIdentifier(node) { + return node.text === "push" || node.text === "unshift"; + } + ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; + function isModifierKind(token) { + switch (token) { + case 116: + case 119: + case 75: + case 123: + case 78: + case 83: + case 113: + case 111: + case 112: + case 130: + case 114: + return true; + } + return false; + } + ts.isModifierKind = isModifierKind; + function isParameterDeclaration(node) { + var root = getRootDeclaration(node); + return root.kind === 145; + } + ts.isParameterDeclaration = isParameterDeclaration; + function getRootDeclaration(node) { + while (node.kind === 175) { + node = node.parent.parent; + } + return node; + } + ts.getRootDeclaration = getRootDeclaration; + function nodeStartsNewLexicalEnvironment(node) { + var kind = node.kind; + return kind === 151 + || kind === 185 + || kind === 227 + || kind === 186 + || kind === 150 + || kind === 152 + || kind === 153 + || kind === 232 + || kind === 264; + } + ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; + function nodeIsSynthesized(node) { + return ts.positionIsSynthesized(node.pos) + || ts.positionIsSynthesized(node.end); + } + ts.nodeIsSynthesized = nodeIsSynthesized; + function getOriginalSourceFileOrBundle(sourceFileOrBundle) { + if (sourceFileOrBundle.kind === 265) { + return ts.updateBundle(sourceFileOrBundle, ts.sameMap(sourceFileOrBundle.sourceFiles, getOriginalSourceFile)); + } + return getOriginalSourceFile(sourceFileOrBundle); + } + ts.getOriginalSourceFileOrBundle = getOriginalSourceFileOrBundle; + function getOriginalSourceFile(sourceFile) { + return ts.getParseTreeNode(sourceFile, isSourceFile) || sourceFile; + } + function getOriginalSourceFiles(sourceFiles) { + return ts.sameMap(sourceFiles, getOriginalSourceFile); + } + ts.getOriginalSourceFiles = getOriginalSourceFiles; + function getOriginalNodeId(node) { + node = ts.getOriginalNode(node); + return node ? ts.getNodeId(node) : 0; + } + ts.getOriginalNodeId = getOriginalNodeId; + var Associativity; + (function (Associativity) { + Associativity[Associativity["Left"] = 0] = "Left"; + Associativity[Associativity["Right"] = 1] = "Right"; + })(Associativity = ts.Associativity || (ts.Associativity = {})); + function getExpressionAssociativity(expression) { + var operator = getOperator(expression); + var hasArguments = expression.kind === 181 && expression.arguments !== undefined; + return getOperatorAssociativity(expression.kind, operator, hasArguments); + } + ts.getExpressionAssociativity = getExpressionAssociativity; + function getOperatorAssociativity(kind, operator, hasArguments) { + switch (kind) { + case 181: + return hasArguments ? 0 : 1; + case 191: + case 188: + case 189: + case 187: + case 190: + case 194: + case 196: + return 1; + case 193: + switch (operator) { + case 39: + case 57: + case 58: + case 59: + case 61: + case 60: + case 62: + case 63: + case 64: + case 65: + case 66: + case 67: + case 69: + case 68: + return 1; + } + } + return 0; + } + ts.getOperatorAssociativity = getOperatorAssociativity; + function getExpressionPrecedence(expression) { + var operator = getOperator(expression); + var hasArguments = expression.kind === 181 && expression.arguments !== undefined; + return getOperatorPrecedence(expression.kind, operator, hasArguments); + } + ts.getExpressionPrecedence = getExpressionPrecedence; + function getOperator(expression) { + if (expression.kind === 193) { + return expression.operatorToken.kind; + } + else if (expression.kind === 191 || expression.kind === 192) { + return expression.operator; + } + else { + return expression.kind; + } + } + ts.getOperator = getOperator; + function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { + switch (nodeKind) { + case 98: + case 96: + case 70: + case 94: + case 100: + case 85: + case 8: + case 9: + case 176: + case 177: + case 185: + case 186: + case 198: + case 248: + case 249: + case 11: + case 12: + case 195: + case 184: + case 199: + return 19; + case 182: + case 178: + case 179: + return 18; + case 181: + return hasArguments ? 18 : 17; + case 180: + return 17; + case 192: + return 16; + case 191: + case 188: + case 189: + case 187: + case 190: + return 15; + case 193: + switch (operatorKind) { + case 50: + case 51: + return 15; + case 39: + case 38: + case 40: + case 41: + return 14; + case 36: + case 37: + return 13; + case 44: + case 45: + case 46: + return 12; + case 26: + case 29: + case 28: + case 30: + case 91: + case 92: + return 11; + case 31: + case 33: + case 32: + case 34: + return 10; + case 47: + return 9; + case 49: + return 8; + case 48: + return 7; + case 52: + return 6; + case 53: + return 5; + case 57: + case 58: + case 59: + case 61: + case 60: + case 62: + case 63: + case 64: + case 65: + case 66: + case 67: + case 69: + case 68: + return 3; + case 25: + return 0; + default: + return -1; + } + case 194: + return 4; + case 196: + return 2; + case 197: + return 1; + default: + return -1; + } + } + ts.getOperatorPrecedence = getOperatorPrecedence; + function createDiagnosticCollection() { + var nonFileDiagnostics = []; + var fileDiagnostics = ts.createMap(); + var diagnosticsModified = false; + var modificationCount = 0; + return { + add: add, + getGlobalDiagnostics: getGlobalDiagnostics, + getDiagnostics: getDiagnostics, + getModificationCount: getModificationCount, + reattachFileDiagnostics: reattachFileDiagnostics + }; + function getModificationCount() { + return modificationCount; + } + function reattachFileDiagnostics(newFile) { + ts.forEach(fileDiagnostics.get(newFile.fileName), function (diagnostic) { return diagnostic.file = newFile; }); + } + function add(diagnostic) { + var diagnostics; + if (diagnostic.file) { + diagnostics = fileDiagnostics.get(diagnostic.file.fileName); + if (!diagnostics) { + diagnostics = []; + fileDiagnostics.set(diagnostic.file.fileName, diagnostics); + } + } + else { + diagnostics = nonFileDiagnostics; + } + diagnostics.push(diagnostic); + diagnosticsModified = true; + modificationCount++; + } + function getGlobalDiagnostics() { + sortAndDeduplicate(); + return nonFileDiagnostics; + } + function getDiagnostics(fileName) { + sortAndDeduplicate(); + if (fileName) { + return fileDiagnostics.get(fileName) || []; + } + var allDiagnostics = []; + function pushDiagnostic(d) { + allDiagnostics.push(d); + } + ts.forEach(nonFileDiagnostics, pushDiagnostic); + fileDiagnostics.forEach(function (diagnostics) { + ts.forEach(diagnostics, pushDiagnostic); + }); + return ts.sortAndDeduplicateDiagnostics(allDiagnostics); + } + function sortAndDeduplicate() { + if (!diagnosticsModified) { + return; + } + diagnosticsModified = false; + nonFileDiagnostics = ts.sortAndDeduplicateDiagnostics(nonFileDiagnostics); + fileDiagnostics.forEach(function (diagnostics, key) { + fileDiagnostics.set(key, ts.sortAndDeduplicateDiagnostics(diagnostics)); + }); + } + } + ts.createDiagnosticCollection = createDiagnosticCollection; + var escapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + var escapedCharsMap = ts.createMapFromTemplate({ + "\0": "\\0", + "\t": "\\t", + "\v": "\\v", + "\f": "\\f", + "\b": "\\b", + "\r": "\\r", + "\n": "\\n", + "\\": "\\\\", + "\"": "\\\"", + "\u2028": "\\u2028", + "\u2029": "\\u2029", + "\u0085": "\\u0085" + }); + function escapeString(s) { + return s.replace(escapedCharsRegExp, getReplacement); + } + ts.escapeString = escapeString; + function getReplacement(c) { + return escapedCharsMap.get(c) || get16BitUnicodeEscapeSequence(c.charCodeAt(0)); + } + function isIntrinsicJsxName(name) { + var ch = name.substr(0, 1); + return ch.toLowerCase() === ch; + } + ts.isIntrinsicJsxName = isIntrinsicJsxName; + function get16BitUnicodeEscapeSequence(charCode) { + var hexCharCode = charCode.toString(16).toUpperCase(); + var paddedHexCode = ("0000" + hexCharCode).slice(-4); + return "\\u" + paddedHexCode; + } + var nonAsciiCharacters = /[^\u0000-\u007F]/g; + function escapeNonAsciiCharacters(s) { + return nonAsciiCharacters.test(s) ? + s.replace(nonAsciiCharacters, function (c) { return get16BitUnicodeEscapeSequence(c.charCodeAt(0)); }) : + s; + } + ts.escapeNonAsciiCharacters = escapeNonAsciiCharacters; + var indentStrings = ["", " "]; + function getIndentString(level) { + if (indentStrings[level] === undefined) { + indentStrings[level] = getIndentString(level - 1) + indentStrings[1]; + } + return indentStrings[level]; + } + ts.getIndentString = getIndentString; + function getIndentSize() { + return indentStrings[1].length; + } + ts.getIndentSize = getIndentSize; + function createTextWriter(newLine) { + var output; + var indent; + var lineStart; + var lineCount; + var linePos; + function write(s) { + if (s && s.length) { + if (lineStart) { + output += getIndentString(indent); + lineStart = false; + } + output += s; + } + } + function reset() { + output = ""; + indent = 0; + lineStart = true; + lineCount = 0; + linePos = 0; + } + function rawWrite(s) { + if (s !== undefined) { + if (lineStart) { + lineStart = false; + } + output += s; + } + } + function writeLiteral(s) { + if (s && s.length) { + write(s); + var lineStartsOfS = ts.computeLineStarts(s); + if (lineStartsOfS.length > 1) { + lineCount = lineCount + lineStartsOfS.length - 1; + linePos = output.length - s.length + ts.lastOrUndefined(lineStartsOfS); + } + } + } + function writeLine() { + if (!lineStart) { + output += newLine; + lineCount++; + linePos = output.length; + lineStart = true; + } + } + function writeTextOfNode(text, node) { + write(getTextOfNodeFromSourceText(text, node)); + } + reset(); + return { + write: write, + rawWrite: rawWrite, + writeTextOfNode: writeTextOfNode, + writeLiteral: writeLiteral, + writeLine: writeLine, + increaseIndent: function () { indent++; }, + decreaseIndent: function () { indent--; }, + getIndent: function () { return indent; }, + getTextPos: function () { return output.length; }, + getLine: function () { return lineCount + 1; }, + getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, + getText: function () { return output; }, + isAtStartOfLine: function () { return lineStart; }, + reset: reset + }; + } + ts.createTextWriter = createTextWriter; + function getResolvedExternalModuleName(host, file) { + return file.moduleName || getExternalModuleNameFromPath(host, file.fileName); + } + ts.getResolvedExternalModuleName = getResolvedExternalModuleName; + function getExternalModuleNameFromDeclaration(host, resolver, declaration) { + var file = resolver.getExternalModuleFileFromDeclaration(declaration); + if (!file || isDeclarationFile(file)) { + return undefined; + } + return getResolvedExternalModuleName(host, file); + } + ts.getExternalModuleNameFromDeclaration = getExternalModuleNameFromDeclaration; + function getExternalModuleNameFromPath(host, fileName) { + var getCanonicalFileName = function (f) { return host.getCanonicalFileName(f); }; + var dir = ts.toPath(host.getCommonSourceDirectory(), host.getCurrentDirectory(), getCanonicalFileName); + var filePath = ts.getNormalizedAbsolutePath(fileName, host.getCurrentDirectory()); + var relativePath = ts.getRelativePathToDirectoryOrUrl(dir, filePath, dir, getCanonicalFileName, false); + return ts.removeFileExtension(relativePath); + } + ts.getExternalModuleNameFromPath = getExternalModuleNameFromPath; + function getOwnEmitOutputFilePath(sourceFile, host, extension) { + var compilerOptions = host.getCompilerOptions(); + var emitOutputFilePathWithoutExtension; + if (compilerOptions.outDir) { + emitOutputFilePathWithoutExtension = ts.removeFileExtension(getSourceFilePathInNewDir(sourceFile, host, compilerOptions.outDir)); + } + else { + emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.fileName); + } + return emitOutputFilePathWithoutExtension + extension; + } + ts.getOwnEmitOutputFilePath = getOwnEmitOutputFilePath; + function getDeclarationEmitOutputFilePath(sourceFile, host) { + var options = host.getCompilerOptions(); + var outputDir = options.declarationDir || options.outDir; + var path = outputDir + ? getSourceFilePathInNewDir(sourceFile, host, outputDir) + : sourceFile.fileName; + return ts.removeFileExtension(path) + ".d.ts"; + } + ts.getDeclarationEmitOutputFilePath = getDeclarationEmitOutputFilePath; + function getSourceFilesToEmit(host, targetSourceFile) { + var options = host.getCompilerOptions(); + var isSourceFileFromExternalLibrary = function (file) { return host.isSourceFileFromExternalLibrary(file); }; + if (options.outFile || options.out) { + var moduleKind = ts.getEmitModuleKind(options); + var moduleEmitEnabled_1 = moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System; + return ts.filter(host.getSourceFiles(), function (sourceFile) { + return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) && sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary); + }); + } + else { + var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile]; + return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary); }); + } + } + ts.getSourceFilesToEmit = getSourceFilesToEmit; + function sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary) { + return !(options.noEmitForJsFiles && isSourceFileJavaScript(sourceFile)) && !isDeclarationFile(sourceFile) && !isSourceFileFromExternalLibrary(sourceFile); + } + ts.sourceFileMayBeEmitted = sourceFileMayBeEmitted; + function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, emitOnlyDtsFiles) { + var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile); + var options = host.getCompilerOptions(); + if (options.outFile || options.out) { + if (sourceFiles.length) { + var jsFilePath = options.outFile || options.out; + var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); + var declarationFilePath = options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : ""; + action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, ts.createBundle(sourceFiles), emitOnlyDtsFiles); + } + } + else { + for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { + var sourceFile = sourceFiles_1[_i]; + var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, getOutputExtension(sourceFile, options)); + var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); + var declarationFilePath = !isSourceFileJavaScript(sourceFile) && (emitOnlyDtsFiles || options.declaration) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; + action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, sourceFile, emitOnlyDtsFiles); + } + } + } + ts.forEachEmittedFile = forEachEmittedFile; + function getSourceMapFilePath(jsFilePath, options) { + return options.sourceMap ? jsFilePath + ".map" : undefined; + } + function getOutputExtension(sourceFile, options) { + if (options.jsx === 1) { + if (isSourceFileJavaScript(sourceFile)) { + if (ts.fileExtensionIs(sourceFile.fileName, ".jsx")) { + return ".jsx"; + } + } + else if (sourceFile.languageVariant === 1) { + return ".jsx"; + } + } + return ".js"; + } + function getSourceFilePathInNewDir(sourceFile, host, newDirPath) { + var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory()); + var commonSourceDirectory = host.getCommonSourceDirectory(); + var isSourceFileInCommonSourceDirectory = host.getCanonicalFileName(sourceFilePath).indexOf(host.getCanonicalFileName(commonSourceDirectory)) === 0; + sourceFilePath = isSourceFileInCommonSourceDirectory ? sourceFilePath.substring(commonSourceDirectory.length) : sourceFilePath; + return ts.combinePaths(newDirPath, sourceFilePath); + } + ts.getSourceFilePathInNewDir = getSourceFilePathInNewDir; + function writeFile(host, diagnostics, fileName, data, writeByteOrderMark, sourceFiles) { + host.writeFile(fileName, data, writeByteOrderMark, function (hostErrorMessage) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); + }, sourceFiles); + } + ts.writeFile = writeFile; + function getLineOfLocalPosition(currentSourceFile, pos) { + return ts.getLineAndCharacterOfPosition(currentSourceFile, pos).line; + } + ts.getLineOfLocalPosition = getLineOfLocalPosition; + function getLineOfLocalPositionFromLineMap(lineMap, pos) { + return ts.computeLineAndCharacterOfPosition(lineMap, pos).line; + } + ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; + function getFirstConstructorWithBody(node) { + return ts.forEach(node.members, function (member) { + if (member.kind === 151 && nodeIsPresent(member.body)) { + return member; + } + }); + } + ts.getFirstConstructorWithBody = getFirstConstructorWithBody; + function getSetAccessorTypeAnnotationNode(accessor) { + if (accessor && accessor.parameters.length > 0) { + var hasThis = accessor.parameters.length === 2 && parameterIsThisKeyword(accessor.parameters[0]); + return accessor.parameters[hasThis ? 1 : 0].type; + } + } + ts.getSetAccessorTypeAnnotationNode = getSetAccessorTypeAnnotationNode; + function getThisParameter(signature) { + if (signature.parameters.length) { + var thisParameter = signature.parameters[0]; + if (parameterIsThisKeyword(thisParameter)) { + return thisParameter; + } + } + } + ts.getThisParameter = getThisParameter; + function parameterIsThisKeyword(parameter) { + return isThisIdentifier(parameter.name); + } + ts.parameterIsThisKeyword = parameterIsThisKeyword; + function isThisIdentifier(node) { + return node && node.kind === 70 && identifierIsThisKeyword(node); + } + ts.isThisIdentifier = isThisIdentifier; + function identifierIsThisKeyword(id) { + return id.originalKeywordKind === 98; + } + ts.identifierIsThisKeyword = identifierIsThisKeyword; + function getAllAccessorDeclarations(declarations, accessor) { + var firstAccessor; + var secondAccessor; + var getAccessor; + var setAccessor; + if (hasDynamicName(accessor)) { + firstAccessor = accessor; + if (accessor.kind === 152) { + getAccessor = accessor; + } + else if (accessor.kind === 153) { + setAccessor = accessor; + } + else { + ts.Debug.fail("Accessor has wrong kind"); + } + } + else { + ts.forEach(declarations, function (member) { + if ((member.kind === 152 || member.kind === 153) + && hasModifier(member, 32) === hasModifier(accessor, 32)) { + var memberName = getPropertyNameForPropertyNameNode(member.name); + var accessorName = getPropertyNameForPropertyNameNode(accessor.name); + if (memberName === accessorName) { + if (!firstAccessor) { + firstAccessor = member; + } + else if (!secondAccessor) { + secondAccessor = member; + } + if (member.kind === 152 && !getAccessor) { + getAccessor = member; + } + if (member.kind === 153 && !setAccessor) { + setAccessor = member; + } + } + } + }); + } + return { + firstAccessor: firstAccessor, + secondAccessor: secondAccessor, + getAccessor: getAccessor, + setAccessor: setAccessor + }; + } + ts.getAllAccessorDeclarations = getAllAccessorDeclarations; + function emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments) { + emitNewLineBeforeLeadingCommentsOfPosition(lineMap, writer, node.pos, leadingComments); + } + ts.emitNewLineBeforeLeadingComments = emitNewLineBeforeLeadingComments; + function emitNewLineBeforeLeadingCommentsOfPosition(lineMap, writer, pos, leadingComments) { + if (leadingComments && leadingComments.length && pos !== leadingComments[0].pos && + getLineOfLocalPositionFromLineMap(lineMap, pos) !== getLineOfLocalPositionFromLineMap(lineMap, leadingComments[0].pos)) { + writer.writeLine(); + } + } + ts.emitNewLineBeforeLeadingCommentsOfPosition = emitNewLineBeforeLeadingCommentsOfPosition; + function emitNewLineBeforeLeadingCommentOfPosition(lineMap, writer, pos, commentPos) { + if (pos !== commentPos && + getLineOfLocalPositionFromLineMap(lineMap, pos) !== getLineOfLocalPositionFromLineMap(lineMap, commentPos)) { + writer.writeLine(); + } + } + ts.emitNewLineBeforeLeadingCommentOfPosition = emitNewLineBeforeLeadingCommentOfPosition; + function emitComments(text, lineMap, writer, comments, leadingSeparator, trailingSeparator, newLine, writeComment) { + if (comments && comments.length > 0) { + if (leadingSeparator) { + writer.write(" "); + } + var emitInterveningSeparator = false; + for (var _i = 0, comments_1 = comments; _i < comments_1.length; _i++) { + var comment = comments_1[_i]; + if (emitInterveningSeparator) { + writer.write(" "); + emitInterveningSeparator = false; + } + writeComment(text, lineMap, writer, comment.pos, comment.end, newLine); + if (comment.hasTrailingNewLine) { + writer.writeLine(); + } + else { + emitInterveningSeparator = true; + } + } + if (emitInterveningSeparator && trailingSeparator) { + writer.write(" "); + } + } + } + ts.emitComments = emitComments; + function emitDetachedComments(text, lineMap, writer, writeComment, node, newLine, removeComments) { + var leadingComments; + var currentDetachedCommentInfo; + if (removeComments) { + if (node.pos === 0) { + leadingComments = ts.filter(ts.getLeadingCommentRanges(text, node.pos), isPinnedComment); + } + } + else { + leadingComments = ts.getLeadingCommentRanges(text, node.pos); + } + if (leadingComments) { + var detachedComments = []; + var lastComment = void 0; + for (var _i = 0, leadingComments_1 = leadingComments; _i < leadingComments_1.length; _i++) { + var comment = leadingComments_1[_i]; + if (lastComment) { + var lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, lastComment.end); + var commentLine = getLineOfLocalPositionFromLineMap(lineMap, comment.pos); + if (commentLine >= lastCommentLine + 2) { + break; + } + } + detachedComments.push(comment); + lastComment = comment; + } + if (detachedComments.length) { + var lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, ts.lastOrUndefined(detachedComments).end); + var nodeLine = getLineOfLocalPositionFromLineMap(lineMap, ts.skipTrivia(text, node.pos)); + if (nodeLine >= lastCommentLine + 2) { + emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments); + emitComments(text, lineMap, writer, detachedComments, false, true, newLine, writeComment); + currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: ts.lastOrUndefined(detachedComments).end }; + } + } + } + return currentDetachedCommentInfo; + function isPinnedComment(comment) { + return text.charCodeAt(comment.pos + 1) === 42 && + text.charCodeAt(comment.pos + 2) === 33; + } + } + ts.emitDetachedComments = emitDetachedComments; + function writeCommentRange(text, lineMap, writer, commentPos, commentEnd, newLine) { + if (text.charCodeAt(commentPos + 1) === 42) { + var firstCommentLineAndCharacter = ts.computeLineAndCharacterOfPosition(lineMap, commentPos); + var lineCount = lineMap.length; + var firstCommentLineIndent = void 0; + for (var pos = commentPos, currentLine = firstCommentLineAndCharacter.line; pos < commentEnd; currentLine++) { + var nextLineStart = (currentLine + 1) === lineCount + ? text.length + 1 + : lineMap[currentLine + 1]; + if (pos !== commentPos) { + if (firstCommentLineIndent === undefined) { + firstCommentLineIndent = calculateIndent(text, lineMap[firstCommentLineAndCharacter.line], commentPos); + } + var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); + var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(text, pos, nextLineStart); + if (spacesToEmit > 0) { + var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); + var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); + writer.rawWrite(indentSizeSpaceString); + while (numberOfSingleSpacesToEmit) { + writer.rawWrite(" "); + numberOfSingleSpacesToEmit--; + } + } + else { + writer.rawWrite(""); + } + } + writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart); + pos = nextLineStart; + } + } + else { + writer.write(text.substring(commentPos, commentEnd)); + } + } + ts.writeCommentRange = writeCommentRange; + function writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart) { + var end = Math.min(commentEnd, nextLineStart - 1); + var currentLineText = text.substring(pos, end).replace(/^\s+|\s+$/g, ""); + if (currentLineText) { + writer.write(currentLineText); + if (end !== commentEnd) { + writer.writeLine(); + } + } + else { + writer.writeLiteral(newLine); + } + } + function calculateIndent(text, pos, end) { + var currentLineIndent = 0; + for (; pos < end && ts.isWhiteSpaceSingleLine(text.charCodeAt(pos)); pos++) { + if (text.charCodeAt(pos) === 9) { + currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); + } + else { + currentLineIndent++; + } + } + return currentLineIndent; + } + function hasModifiers(node) { + return getModifierFlags(node) !== 0; + } + ts.hasModifiers = hasModifiers; + function hasModifier(node, flags) { + return (getModifierFlags(node) & flags) !== 0; + } + ts.hasModifier = hasModifier; + function getModifierFlags(node) { + if (node.modifierFlagsCache & 536870912) { + return node.modifierFlagsCache & ~536870912; + } + var flags = 0; + if (node.modifiers) { + for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { + var modifier = _a[_i]; + flags |= modifierToFlag(modifier.kind); + } + } + if (node.flags & 4 || (node.kind === 70 && node.isInJSDocNamespace)) { + flags |= 1; + } + node.modifierFlagsCache = flags | 536870912; + return flags; + } + ts.getModifierFlags = getModifierFlags; + function modifierToFlag(token) { + switch (token) { + case 114: return 32; + case 113: return 4; + case 112: return 16; + case 111: return 8; + case 116: return 128; + case 83: return 1; + case 123: return 2; + case 75: return 2048; + case 78: return 512; + case 119: return 256; + case 130: return 64; + } + return 0; + } + ts.modifierToFlag = modifierToFlag; + function isLogicalOperator(token) { + return token === 53 + || token === 52 + || token === 50; + } + ts.isLogicalOperator = isLogicalOperator; + function isAssignmentOperator(token) { + return token >= 57 && token <= 69; + } + ts.isAssignmentOperator = isAssignmentOperator; + function tryGetClassExtendingExpressionWithTypeArguments(node) { + if (node.kind === 200 && + node.parent.token === 84 && + isClassLike(node.parent.parent)) { + return node.parent.parent; + } + } + ts.tryGetClassExtendingExpressionWithTypeArguments = tryGetClassExtendingExpressionWithTypeArguments; + function isAssignmentExpression(node, excludeCompoundAssignment) { + return isBinaryExpression(node) + && (excludeCompoundAssignment + ? node.operatorToken.kind === 57 + : isAssignmentOperator(node.operatorToken.kind)) + && isLeftHandSideExpression(node.left); + } + ts.isAssignmentExpression = isAssignmentExpression; + function isDestructuringAssignment(node) { + if (isAssignmentExpression(node, true)) { + var kind = node.left.kind; + return kind === 177 + || kind === 176; + } + return false; + } + ts.isDestructuringAssignment = isDestructuringAssignment; + function isSupportedExpressionWithTypeArguments(node) { + return isSupportedExpressionWithTypeArgumentsRest(node.expression); + } + ts.isSupportedExpressionWithTypeArguments = isSupportedExpressionWithTypeArguments; + function isSupportedExpressionWithTypeArgumentsRest(node) { + if (node.kind === 70) { + return true; + } + else if (isPropertyAccessExpression(node)) { + return isSupportedExpressionWithTypeArgumentsRest(node.expression); + } + else { + return false; + } + } + function isExpressionWithTypeArgumentsInClassExtendsClause(node) { + return tryGetClassExtendingExpressionWithTypeArguments(node) !== undefined; + } + ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause; + function isExpressionWithTypeArgumentsInClassImplementsClause(node) { + return node.kind === 200 + && isEntityNameExpression(node.expression) + && node.parent + && node.parent.token === 107 + && node.parent.parent + && isClassLike(node.parent.parent); + } + ts.isExpressionWithTypeArgumentsInClassImplementsClause = isExpressionWithTypeArgumentsInClassImplementsClause; + function isEntityNameExpression(node) { + return node.kind === 70 || + node.kind === 178 && isEntityNameExpression(node.expression); + } + ts.isEntityNameExpression = isEntityNameExpression; + function isRightSideOfQualifiedNameOrPropertyAccess(node) { + return (node.parent.kind === 142 && node.parent.right === node) || + (node.parent.kind === 178 && node.parent.name === node); + } + ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; + function isEmptyObjectLiteral(expression) { + return expression.kind === 177 && + expression.properties.length === 0; + } + ts.isEmptyObjectLiteral = isEmptyObjectLiteral; + function isEmptyArrayLiteral(expression) { + return expression.kind === 176 && + expression.elements.length === 0; + } + ts.isEmptyArrayLiteral = isEmptyArrayLiteral; + function getLocalSymbolForExportDefault(symbol) { + return isExportDefaultSymbol(symbol) ? symbol.valueDeclaration.localSymbol : undefined; + } + ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; + function isExportDefaultSymbol(symbol) { + return symbol && symbol.valueDeclaration && hasModifier(symbol.valueDeclaration, 512); + } + function tryExtractTypeScriptExtension(fileName) { + return ts.find(ts.supportedTypescriptExtensionsForExtractExtension, function (extension) { return ts.fileExtensionIs(fileName, extension); }); + } + ts.tryExtractTypeScriptExtension = tryExtractTypeScriptExtension; + function getExpandedCharCodes(input) { + var output = []; + var length = input.length; + for (var i = 0; i < length; i++) { + var charCode = input.charCodeAt(i); + if (charCode < 0x80) { + output.push(charCode); + } + else if (charCode < 0x800) { + output.push((charCode >> 6) | 192); + output.push((charCode & 63) | 128); + } + else if (charCode < 0x10000) { + output.push((charCode >> 12) | 224); + output.push(((charCode >> 6) & 63) | 128); + output.push((charCode & 63) | 128); + } + else if (charCode < 0x20000) { + output.push((charCode >> 18) | 240); + output.push(((charCode >> 12) & 63) | 128); + output.push(((charCode >> 6) & 63) | 128); + output.push((charCode & 63) | 128); + } + else { + ts.Debug.assert(false, "Unexpected code point"); + } + } + return output; + } + var base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + function convertToBase64(input) { + var result = ""; + var charCodes = getExpandedCharCodes(input); + var i = 0; + var length = charCodes.length; + var byte1, byte2, byte3, byte4; + while (i < length) { + byte1 = charCodes[i] >> 2; + byte2 = (charCodes[i] & 3) << 4 | charCodes[i + 1] >> 4; + byte3 = (charCodes[i + 1] & 15) << 2 | charCodes[i + 2] >> 6; + byte4 = charCodes[i + 2] & 63; + if (i + 1 >= length) { + byte3 = byte4 = 64; + } + else if (i + 2 >= length) { + byte4 = 64; + } + result += base64Digits.charAt(byte1) + base64Digits.charAt(byte2) + base64Digits.charAt(byte3) + base64Digits.charAt(byte4); + i += 3; + } + return result; + } + ts.convertToBase64 = convertToBase64; + var carriageReturnLineFeed = "\r\n"; + var lineFeed = "\n"; + function getNewLineCharacter(options) { + if (options.newLine === 0) { + return carriageReturnLineFeed; + } + else if (options.newLine === 1) { + return lineFeed; + } + else if (ts.sys) { + return ts.sys.newLine; + } + return carriageReturnLineFeed; + } + ts.getNewLineCharacter = getNewLineCharacter; + function isSimpleExpression(node) { + return isSimpleExpressionWorker(node, 0); + } + ts.isSimpleExpression = isSimpleExpression; + function isSimpleExpressionWorker(node, depth) { + if (depth <= 5) { + var kind = node.kind; + if (kind === 9 + || kind === 8 + || kind === 11 + || kind === 12 + || kind === 70 + || kind === 98 + || kind === 96 + || kind === 100 + || kind === 85 + || kind === 94) { + return true; + } + else if (kind === 178) { + return isSimpleExpressionWorker(node.expression, depth + 1); + } + else if (kind === 179) { + return isSimpleExpressionWorker(node.expression, depth + 1) + && isSimpleExpressionWorker(node.argumentExpression, depth + 1); + } + else if (kind === 191 + || kind === 192) { + return isSimpleExpressionWorker(node.operand, depth + 1); + } + else if (kind === 193) { + return node.operatorToken.kind !== 39 + && isSimpleExpressionWorker(node.left, depth + 1) + && isSimpleExpressionWorker(node.right, depth + 1); + } + else if (kind === 194) { + return isSimpleExpressionWorker(node.condition, depth + 1) + && isSimpleExpressionWorker(node.whenTrue, depth + 1) + && isSimpleExpressionWorker(node.whenFalse, depth + 1); + } + else if (kind === 189 + || kind === 188 + || kind === 187) { + return isSimpleExpressionWorker(node.expression, depth + 1); + } + else if (kind === 176) { + return node.elements.length === 0; + } + else if (kind === 177) { + return node.properties.length === 0; + } + else if (kind === 180) { + if (!isSimpleExpressionWorker(node.expression, depth + 1)) { + return false; + } + for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { + var argument = _a[_i]; + if (!isSimpleExpressionWorker(argument, depth + 1)) { + return false; + } + } + return true; + } + } + return false; + } + var syntaxKindCache = []; + function formatSyntaxKind(kind) { + var syntaxKindEnum = ts.SyntaxKind; + if (syntaxKindEnum) { + var cached = syntaxKindCache[kind]; + if (cached !== undefined) { + return cached; + } + for (var name in syntaxKindEnum) { + if (syntaxKindEnum[name] === kind) { + var result = kind + " (" + name + ")"; + syntaxKindCache[kind] = result; + return result; + } + } + } + else { + return kind.toString(); + } + } + ts.formatSyntaxKind = formatSyntaxKind; + function getRangePos(range) { + return range ? range.pos : -1; + } + ts.getRangePos = getRangePos; + function getRangeEnd(range) { + return range ? range.end : -1; + } + ts.getRangeEnd = getRangeEnd; + function movePos(pos, value) { + return ts.positionIsSynthesized(pos) ? -1 : pos + value; + } + ts.movePos = movePos; + function createRange(pos, end) { + return { pos: pos, end: end }; + } + ts.createRange = createRange; + function moveRangeEnd(range, end) { + return createRange(range.pos, end); + } + ts.moveRangeEnd = moveRangeEnd; + function moveRangePos(range, pos) { + return createRange(pos, range.end); + } + ts.moveRangePos = moveRangePos; + function moveRangePastDecorators(node) { + return node.decorators && node.decorators.length > 0 + ? moveRangePos(node, node.decorators.end) + : node; + } + ts.moveRangePastDecorators = moveRangePastDecorators; + function moveRangePastModifiers(node) { + return node.modifiers && node.modifiers.length > 0 + ? moveRangePos(node, node.modifiers.end) + : moveRangePastDecorators(node); + } + ts.moveRangePastModifiers = moveRangePastModifiers; + function isCollapsedRange(range) { + return range.pos === range.end; + } + ts.isCollapsedRange = isCollapsedRange; + function collapseRangeToStart(range) { + return isCollapsedRange(range) ? range : moveRangeEnd(range, range.pos); + } + ts.collapseRangeToStart = collapseRangeToStart; + function collapseRangeToEnd(range) { + return isCollapsedRange(range) ? range : moveRangePos(range, range.end); + } + ts.collapseRangeToEnd = collapseRangeToEnd; + function createTokenRange(pos, token) { + return createRange(pos, pos + ts.tokenToString(token).length); + } + ts.createTokenRange = createTokenRange; + function rangeIsOnSingleLine(range, sourceFile) { + return rangeStartIsOnSameLineAsRangeEnd(range, range, sourceFile); + } + ts.rangeIsOnSingleLine = rangeIsOnSingleLine; + function rangeStartPositionsAreOnSameLine(range1, range2, sourceFile) { + return positionsAreOnSameLine(getStartPositionOfRange(range1, sourceFile), getStartPositionOfRange(range2, sourceFile), sourceFile); + } + ts.rangeStartPositionsAreOnSameLine = rangeStartPositionsAreOnSameLine; + function rangeEndPositionsAreOnSameLine(range1, range2, sourceFile) { + return positionsAreOnSameLine(range1.end, range2.end, sourceFile); + } + ts.rangeEndPositionsAreOnSameLine = rangeEndPositionsAreOnSameLine; + function rangeStartIsOnSameLineAsRangeEnd(range1, range2, sourceFile) { + return positionsAreOnSameLine(getStartPositionOfRange(range1, sourceFile), range2.end, sourceFile); + } + ts.rangeStartIsOnSameLineAsRangeEnd = rangeStartIsOnSameLineAsRangeEnd; + function rangeEndIsOnSameLineAsRangeStart(range1, range2, sourceFile) { + return positionsAreOnSameLine(range1.end, getStartPositionOfRange(range2, sourceFile), sourceFile); + } + ts.rangeEndIsOnSameLineAsRangeStart = rangeEndIsOnSameLineAsRangeStart; + function positionsAreOnSameLine(pos1, pos2, sourceFile) { + return pos1 === pos2 || + getLineOfLocalPosition(sourceFile, pos1) === getLineOfLocalPosition(sourceFile, pos2); + } + ts.positionsAreOnSameLine = positionsAreOnSameLine; + function getStartPositionOfRange(range, sourceFile) { + return ts.positionIsSynthesized(range.pos) ? -1 : ts.skipTrivia(sourceFile.text, range.pos); + } + ts.getStartPositionOfRange = getStartPositionOfRange; + function isDeclarationNameOfEnumOrNamespace(node) { + var parseNode = ts.getParseTreeNode(node); + if (parseNode) { + switch (parseNode.parent.kind) { + case 231: + case 232: + return parseNode === parseNode.parent.name; + } + } + return false; + } + ts.isDeclarationNameOfEnumOrNamespace = isDeclarationNameOfEnumOrNamespace; + function getInitializedVariables(node) { + return ts.filter(node.declarations, isInitializedVariable); + } + ts.getInitializedVariables = getInitializedVariables; + function isInitializedVariable(node) { + return node.initializer !== undefined; + } + function isMergedWithClass(node) { + if (node.symbol) { + for (var _i = 0, _a = node.symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + if (declaration.kind === 228 && declaration !== node) { + return true; + } + } + } + return false; + } + ts.isMergedWithClass = isMergedWithClass; + function isFirstDeclarationOfKind(node, kind) { + return node.symbol && getDeclarationOfKind(node.symbol, kind) === node; + } + ts.isFirstDeclarationOfKind = isFirstDeclarationOfKind; + function isNodeArray(array) { + return array.hasOwnProperty("pos") + && array.hasOwnProperty("end"); + } + ts.isNodeArray = isNodeArray; + function isNoSubstitutionTemplateLiteral(node) { + return node.kind === 12; + } + ts.isNoSubstitutionTemplateLiteral = isNoSubstitutionTemplateLiteral; + function isLiteralKind(kind) { + return 8 <= kind && kind <= 12; + } + ts.isLiteralKind = isLiteralKind; + function isTextualLiteralKind(kind) { + return kind === 9 || kind === 12; + } + ts.isTextualLiteralKind = isTextualLiteralKind; + function isLiteralExpression(node) { + return isLiteralKind(node.kind); + } + ts.isLiteralExpression = isLiteralExpression; + function isTemplateLiteralKind(kind) { + return 12 <= kind && kind <= 15; + } + ts.isTemplateLiteralKind = isTemplateLiteralKind; + function isTemplateHead(node) { + return node.kind === 13; + } + ts.isTemplateHead = isTemplateHead; + function isTemplateMiddleOrTemplateTail(node) { + var kind = node.kind; + return kind === 14 + || kind === 15; + } + ts.isTemplateMiddleOrTemplateTail = isTemplateMiddleOrTemplateTail; + function isIdentifier(node) { + return node.kind === 70; + } + ts.isIdentifier = isIdentifier; + function isVoidExpression(node) { + return node.kind === 189; + } + ts.isVoidExpression = isVoidExpression; + function isGeneratedIdentifier(node) { + return isIdentifier(node) && node.autoGenerateKind > 0; + } + ts.isGeneratedIdentifier = isGeneratedIdentifier; + function isModifier(node) { + return isModifierKind(node.kind); + } + ts.isModifier = isModifier; + function isQualifiedName(node) { + return node.kind === 142; + } + ts.isQualifiedName = isQualifiedName; + function isComputedPropertyName(node) { + return node.kind === 143; + } + ts.isComputedPropertyName = isComputedPropertyName; + function isEntityName(node) { + var kind = node.kind; + return kind === 142 + || kind === 70; + } + ts.isEntityName = isEntityName; + function isPropertyName(node) { + var kind = node.kind; + return kind === 70 + || kind === 9 + || kind === 8 + || kind === 143; + } + ts.isPropertyName = isPropertyName; + function isModuleName(node) { + var kind = node.kind; + return kind === 70 + || kind === 9; + } + ts.isModuleName = isModuleName; + function isBindingName(node) { + var kind = node.kind; + return kind === 70 + || kind === 173 + || kind === 174; + } + ts.isBindingName = isBindingName; + function isTypeParameter(node) { + return node.kind === 144; + } + ts.isTypeParameter = isTypeParameter; + function isParameter(node) { + return node.kind === 145; + } + ts.isParameter = isParameter; + function isDecorator(node) { + return node.kind === 146; + } + ts.isDecorator = isDecorator; + function isMethodDeclaration(node) { + return node.kind === 150; + } + ts.isMethodDeclaration = isMethodDeclaration; + function isClassElement(node) { + var kind = node.kind; + return kind === 151 + || kind === 148 + || kind === 150 + || kind === 152 + || kind === 153 + || kind === 156 + || kind === 205; + } + ts.isClassElement = isClassElement; + function isObjectLiteralElementLike(node) { + var kind = node.kind; + return kind === 260 + || kind === 261 + || kind === 262 + || kind === 150 + || kind === 152 + || kind === 153 + || kind === 246; + } + ts.isObjectLiteralElementLike = isObjectLiteralElementLike; + function isTypeNodeKind(kind) { + return (kind >= 157 && kind <= 172) + || kind === 118 + || kind === 132 + || kind === 133 + || kind === 121 + || kind === 135 + || kind === 136 + || kind === 98 + || kind === 104 + || kind === 138 + || kind === 94 + || kind === 129 + || kind === 200; + } + function isTypeNode(node) { + return isTypeNodeKind(node.kind); + } + ts.isTypeNode = isTypeNode; + function isArrayBindingPattern(node) { + return node.kind === 174; + } + ts.isArrayBindingPattern = isArrayBindingPattern; + function isObjectBindingPattern(node) { + return node.kind === 173; + } + ts.isObjectBindingPattern = isObjectBindingPattern; + function isBindingPattern(node) { + if (node) { + var kind = node.kind; + return kind === 174 + || kind === 173; + } + return false; + } + ts.isBindingPattern = isBindingPattern; + function isAssignmentPattern(node) { + var kind = node.kind; + return kind === 176 + || kind === 177; + } + ts.isAssignmentPattern = isAssignmentPattern; + function isBindingElement(node) { + return node.kind === 175; + } + ts.isBindingElement = isBindingElement; + function isArrayBindingElement(node) { + var kind = node.kind; + return kind === 175 + || kind === 199; + } + ts.isArrayBindingElement = isArrayBindingElement; + function isDeclarationBindingElement(bindingElement) { + switch (bindingElement.kind) { + case 225: + case 145: + case 175: + return true; + } + return false; + } + ts.isDeclarationBindingElement = isDeclarationBindingElement; + function isBindingOrAssignmentPattern(node) { + return isObjectBindingOrAssignmentPattern(node) + || isArrayBindingOrAssignmentPattern(node); + } + ts.isBindingOrAssignmentPattern = isBindingOrAssignmentPattern; + function isObjectBindingOrAssignmentPattern(node) { + switch (node.kind) { + case 173: + case 177: + return true; + } + return false; + } + ts.isObjectBindingOrAssignmentPattern = isObjectBindingOrAssignmentPattern; + function isArrayBindingOrAssignmentPattern(node) { + switch (node.kind) { + case 174: + case 176: + return true; + } + return false; + } + ts.isArrayBindingOrAssignmentPattern = isArrayBindingOrAssignmentPattern; + function isArrayLiteralExpression(node) { + return node.kind === 176; + } + ts.isArrayLiteralExpression = isArrayLiteralExpression; + function isObjectLiteralExpression(node) { + return node.kind === 177; + } + ts.isObjectLiteralExpression = isObjectLiteralExpression; + function isPropertyAccessExpression(node) { + return node.kind === 178; + } + ts.isPropertyAccessExpression = isPropertyAccessExpression; + function isPropertyAccessOrQualifiedName(node) { + var kind = node.kind; + return kind === 178 + || kind === 142; + } + ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; + function isElementAccessExpression(node) { + return node.kind === 179; + } + ts.isElementAccessExpression = isElementAccessExpression; + function isBinaryExpression(node) { + return node.kind === 193; + } + ts.isBinaryExpression = isBinaryExpression; + function isConditionalExpression(node) { + return node.kind === 194; + } + ts.isConditionalExpression = isConditionalExpression; + function isCallExpression(node) { + return node.kind === 180; + } + ts.isCallExpression = isCallExpression; + function isTemplateLiteral(node) { + var kind = node.kind; + return kind === 195 + || kind === 12; + } + ts.isTemplateLiteral = isTemplateLiteral; + function isSpreadExpression(node) { + return node.kind === 197; + } + ts.isSpreadExpression = isSpreadExpression; + function isExpressionWithTypeArguments(node) { + return node.kind === 200; + } + ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; + function isLeftHandSideExpressionKind(kind) { + return kind === 178 + || kind === 179 + || kind === 181 + || kind === 180 + || kind === 248 + || kind === 249 + || kind === 182 + || kind === 176 + || kind === 184 + || kind === 177 + || kind === 198 + || kind === 185 + || kind === 70 + || kind === 11 + || kind === 8 + || kind === 9 + || kind === 12 + || kind === 195 + || kind === 85 + || kind === 94 + || kind === 98 + || kind === 100 + || kind === 96 + || kind === 202 + || kind === 203; + } + function isLeftHandSideExpression(node) { + return isLeftHandSideExpressionKind(ts.skipPartiallyEmittedExpressions(node).kind); + } + ts.isLeftHandSideExpression = isLeftHandSideExpression; + function isUnaryExpressionKind(kind) { + return kind === 191 + || kind === 192 + || kind === 187 + || kind === 188 + || kind === 189 + || kind === 190 + || kind === 183 + || isLeftHandSideExpressionKind(kind); + } + function isUnaryExpression(node) { + return isUnaryExpressionKind(ts.skipPartiallyEmittedExpressions(node).kind); + } + ts.isUnaryExpression = isUnaryExpression; + function isExpressionKind(kind) { + return kind === 194 + || kind === 196 + || kind === 186 + || kind === 193 + || kind === 197 + || kind === 201 + || kind === 199 + || isUnaryExpressionKind(kind); + } + function isExpression(node) { + return isExpressionKind(ts.skipPartiallyEmittedExpressions(node).kind); + } + ts.isExpression = isExpression; + function isAssertionExpression(node) { + var kind = node.kind; + return kind === 183 + || kind === 201; + } + ts.isAssertionExpression = isAssertionExpression; + function isPartiallyEmittedExpression(node) { + return node.kind === 295; + } + ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; + function isNotEmittedStatement(node) { + return node.kind === 294; + } + ts.isNotEmittedStatement = isNotEmittedStatement; + function isNotEmittedOrPartiallyEmittedNode(node) { + return isNotEmittedStatement(node) + || isPartiallyEmittedExpression(node); + } + ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; + function isOmittedExpression(node) { + return node.kind === 199; + } + ts.isOmittedExpression = isOmittedExpression; + function isTemplateSpan(node) { + return node.kind === 204; + } + ts.isTemplateSpan = isTemplateSpan; + function isBlock(node) { + return node.kind === 206; + } + ts.isBlock = isBlock; + function isConciseBody(node) { + return isBlock(node) + || isExpression(node); + } + ts.isConciseBody = isConciseBody; + function isFunctionBody(node) { + return isBlock(node); + } + ts.isFunctionBody = isFunctionBody; + function isForInitializer(node) { + return isVariableDeclarationList(node) + || isExpression(node); + } + ts.isForInitializer = isForInitializer; + function isVariableDeclaration(node) { + return node.kind === 225; + } + ts.isVariableDeclaration = isVariableDeclaration; + function isVariableDeclarationList(node) { + return node.kind === 226; + } + ts.isVariableDeclarationList = isVariableDeclarationList; + function isCaseBlock(node) { + return node.kind === 234; + } + ts.isCaseBlock = isCaseBlock; + function isModuleBody(node) { + var kind = node.kind; + return kind === 233 + || kind === 232 + || kind === 70; + } + ts.isModuleBody = isModuleBody; + function isNamespaceBody(node) { + var kind = node.kind; + return kind === 233 + || kind === 232; + } + ts.isNamespaceBody = isNamespaceBody; + function isJSDocNamespaceBody(node) { + var kind = node.kind; + return kind === 70 + || kind === 232; + } + ts.isJSDocNamespaceBody = isJSDocNamespaceBody; + function isImportEqualsDeclaration(node) { + return node.kind === 236; + } + ts.isImportEqualsDeclaration = isImportEqualsDeclaration; + function isImportClause(node) { + return node.kind === 238; + } + ts.isImportClause = isImportClause; + function isNamedImportBindings(node) { + var kind = node.kind; + return kind === 240 + || kind === 239; + } + ts.isNamedImportBindings = isNamedImportBindings; + function isImportSpecifier(node) { + return node.kind === 241; + } + ts.isImportSpecifier = isImportSpecifier; + function isNamedExports(node) { + return node.kind === 244; + } + ts.isNamedExports = isNamedExports; + function isExportSpecifier(node) { + return node.kind === 245; + } + ts.isExportSpecifier = isExportSpecifier; + function isModuleOrEnumDeclaration(node) { + return node.kind === 232 || node.kind === 231; + } + ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; + function isDeclarationKind(kind) { + return kind === 186 + || kind === 175 + || kind === 228 + || kind === 198 + || kind === 151 + || kind === 231 + || kind === 263 + || kind === 245 + || kind === 227 + || kind === 185 + || kind === 152 + || kind === 238 + || kind === 236 + || kind === 241 + || kind === 229 + || kind === 252 + || kind === 150 + || kind === 149 + || kind === 232 + || kind === 235 + || kind === 239 + || kind === 145 + || kind === 260 + || kind === 148 + || kind === 147 + || kind === 153 + || kind === 261 + || kind === 230 + || kind === 144 + || kind === 225 + || kind === 289; + } + function isDeclarationStatementKind(kind) { + return kind === 227 + || kind === 246 + || kind === 228 + || kind === 229 + || kind === 230 + || kind === 231 + || kind === 232 + || kind === 237 + || kind === 236 + || kind === 243 + || kind === 242 + || kind === 235; + } + function isStatementKindButNotDeclarationKind(kind) { + return kind === 217 + || kind === 216 + || kind === 224 + || kind === 211 + || kind === 209 + || kind === 208 + || kind === 214 + || kind === 215 + || kind === 213 + || kind === 210 + || kind === 221 + || kind === 218 + || kind === 220 + || kind === 222 + || kind === 223 + || kind === 207 + || kind === 212 + || kind === 219 + || kind === 294 + || kind === 297 + || kind === 296; + } + function isDeclaration(node) { + return isDeclarationKind(node.kind); + } + ts.isDeclaration = isDeclaration; + function isDeclarationStatement(node) { + return isDeclarationStatementKind(node.kind); + } + ts.isDeclarationStatement = isDeclarationStatement; + function isStatementButNotDeclaration(node) { + return isStatementKindButNotDeclarationKind(node.kind); + } + ts.isStatementButNotDeclaration = isStatementButNotDeclaration; + function isStatement(node) { + var kind = node.kind; + return isStatementKindButNotDeclarationKind(kind) + || isDeclarationStatementKind(kind) + || kind === 206; + } + ts.isStatement = isStatement; + function isModuleReference(node) { + var kind = node.kind; + return kind === 247 + || kind === 142 + || kind === 70; + } + ts.isModuleReference = isModuleReference; + function isJsxOpeningElement(node) { + return node.kind === 250; + } + ts.isJsxOpeningElement = isJsxOpeningElement; + function isJsxClosingElement(node) { + return node.kind === 251; + } + ts.isJsxClosingElement = isJsxClosingElement; + function isJsxTagNameExpression(node) { + var kind = node.kind; + return kind === 98 + || kind === 70 + || kind === 178; + } + ts.isJsxTagNameExpression = isJsxTagNameExpression; + function isJsxChild(node) { + var kind = node.kind; + return kind === 248 + || kind === 255 + || kind === 249 + || kind === 10; + } + ts.isJsxChild = isJsxChild; + function isJsxAttributes(node) { + var kind = node.kind; + return kind === 253; + } + ts.isJsxAttributes = isJsxAttributes; + function isJsxAttributeLike(node) { + var kind = node.kind; + return kind === 252 + || kind === 254; + } + ts.isJsxAttributeLike = isJsxAttributeLike; + function isJsxSpreadAttribute(node) { + return node.kind === 254; + } + ts.isJsxSpreadAttribute = isJsxSpreadAttribute; + function isJsxAttribute(node) { + return node.kind === 252; + } + ts.isJsxAttribute = isJsxAttribute; + function isStringLiteralOrJsxExpression(node) { + var kind = node.kind; + return kind === 9 + || kind === 255; + } + ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; + function isJsxOpeningLikeElement(node) { + var kind = node.kind; + return kind === 250 + || kind === 249; + } + ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; + function isCaseOrDefaultClause(node) { + var kind = node.kind; + return kind === 256 + || kind === 257; + } + ts.isCaseOrDefaultClause = isCaseOrDefaultClause; + function isHeritageClause(node) { + return node.kind === 258; + } + ts.isHeritageClause = isHeritageClause; + function isCatchClause(node) { + return node.kind === 259; + } + ts.isCatchClause = isCatchClause; + function isPropertyAssignment(node) { + return node.kind === 260; + } + ts.isPropertyAssignment = isPropertyAssignment; + function isShorthandPropertyAssignment(node) { + return node.kind === 261; + } + ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; + function isEnumMember(node) { + return node.kind === 263; + } + ts.isEnumMember = isEnumMember; + function isSourceFile(node) { + return node.kind === 264; + } + ts.isSourceFile = isSourceFile; + function isWatchSet(options) { + return options.watch && options.hasOwnProperty("watch"); + } + ts.isWatchSet = isWatchSet; +})(ts || (ts = {})); +(function (ts) { + function getDefaultLibFileName(options) { + switch (options.target) { + case 5: + return "lib.esnext.full.d.ts"; + case 4: + return "lib.es2017.full.d.ts"; + case 3: + return "lib.es2016.full.d.ts"; + case 2: + return "lib.es6.d.ts"; + default: + return "lib.d.ts"; + } + } + ts.getDefaultLibFileName = getDefaultLibFileName; + function textSpanEnd(span) { + return span.start + span.length; + } + ts.textSpanEnd = textSpanEnd; + function textSpanIsEmpty(span) { + return span.length === 0; + } + ts.textSpanIsEmpty = textSpanIsEmpty; + function textSpanContainsPosition(span, position) { + return position >= span.start && position < textSpanEnd(span); + } + ts.textSpanContainsPosition = textSpanContainsPosition; + function textSpanContainsTextSpan(span, other) { + return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span); + } + ts.textSpanContainsTextSpan = textSpanContainsTextSpan; + function textSpanOverlapsWith(span, other) { + var overlapStart = Math.max(span.start, other.start); + var overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other)); + return overlapStart < overlapEnd; + } + ts.textSpanOverlapsWith = textSpanOverlapsWith; + function textSpanOverlap(span1, span2) { + var overlapStart = Math.max(span1.start, span2.start); + var overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); + if (overlapStart < overlapEnd) { + return createTextSpanFromBounds(overlapStart, overlapEnd); + } + return undefined; + } + ts.textSpanOverlap = textSpanOverlap; + function textSpanIntersectsWithTextSpan(span, other) { + return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start; + } + ts.textSpanIntersectsWithTextSpan = textSpanIntersectsWithTextSpan; + function textSpanIntersectsWith(span, start, length) { + var end = start + length; + return start <= textSpanEnd(span) && end >= span.start; + } + ts.textSpanIntersectsWith = textSpanIntersectsWith; + function decodedTextSpanIntersectsWith(start1, length1, start2, length2) { + var end1 = start1 + length1; + var end2 = start2 + length2; + return start2 <= end1 && end2 >= start1; + } + ts.decodedTextSpanIntersectsWith = decodedTextSpanIntersectsWith; + function textSpanIntersectsWithPosition(span, position) { + return position <= textSpanEnd(span) && position >= span.start; + } + ts.textSpanIntersectsWithPosition = textSpanIntersectsWithPosition; + function textSpanIntersection(span1, span2) { + var intersectStart = Math.max(span1.start, span2.start); + var intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); + if (intersectStart <= intersectEnd) { + return createTextSpanFromBounds(intersectStart, intersectEnd); + } + return undefined; + } + ts.textSpanIntersection = textSpanIntersection; + function createTextSpan(start, length) { + if (start < 0) { + throw new Error("start < 0"); + } + if (length < 0) { + throw new Error("length < 0"); + } + return { start: start, length: length }; + } + ts.createTextSpan = createTextSpan; + function createTextSpanFromBounds(start, end) { + return createTextSpan(start, end - start); + } + ts.createTextSpanFromBounds = createTextSpanFromBounds; + function textChangeRangeNewSpan(range) { + return createTextSpan(range.span.start, range.newLength); + } + ts.textChangeRangeNewSpan = textChangeRangeNewSpan; + function textChangeRangeIsUnchanged(range) { + return textSpanIsEmpty(range.span) && range.newLength === 0; + } + ts.textChangeRangeIsUnchanged = textChangeRangeIsUnchanged; + function createTextChangeRange(span, newLength) { + if (newLength < 0) { + throw new Error("newLength < 0"); + } + return { span: span, newLength: newLength }; + } + ts.createTextChangeRange = createTextChangeRange; + ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); + function collapseTextChangeRangesAcrossMultipleVersions(changes) { + if (changes.length === 0) { + return ts.unchangedTextChangeRange; + } + if (changes.length === 1) { + return changes[0]; + } + var change0 = changes[0]; + var oldStartN = change0.span.start; + var oldEndN = textSpanEnd(change0.span); + var newEndN = oldStartN + change0.newLength; + for (var i = 1; i < changes.length; i++) { + var nextChange = changes[i]; + var oldStart1 = oldStartN; + var oldEnd1 = oldEndN; + var newEnd1 = newEndN; + var oldStart2 = nextChange.span.start; + var oldEnd2 = textSpanEnd(nextChange.span); + var newEnd2 = oldStart2 + nextChange.newLength; + oldStartN = Math.min(oldStart1, oldStart2); + oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); + newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); + } + return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN); + } + ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; + function getTypeParameterOwner(d) { + if (d && d.kind === 144) { + for (var current = d; current; current = current.parent) { + if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 229) { + return current; + } + } + } + } + ts.getTypeParameterOwner = getTypeParameterOwner; + function isParameterPropertyDeclaration(node) { + return ts.hasModifier(node, 92) && node.parent.kind === 151 && ts.isClassLike(node.parent.parent); + } + ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; + function walkUpBindingElementsAndPatterns(node) { + while (node && (node.kind === 175 || ts.isBindingPattern(node))) { + node = node.parent; + } + return node; + } + function getCombinedModifierFlags(node) { + node = walkUpBindingElementsAndPatterns(node); + var flags = ts.getModifierFlags(node); + if (node.kind === 225) { + node = node.parent; + } + if (node && node.kind === 226) { + flags |= ts.getModifierFlags(node); + node = node.parent; + } + if (node && node.kind === 207) { + flags |= ts.getModifierFlags(node); + } + return flags; + } + ts.getCombinedModifierFlags = getCombinedModifierFlags; + function getCombinedNodeFlags(node) { + node = walkUpBindingElementsAndPatterns(node); + var flags = node.flags; + if (node.kind === 225) { + node = node.parent; + } + if (node && node.kind === 226) { + flags |= node.flags; + node = node.parent; + } + if (node && node.kind === 207) { + flags |= node.flags; + } + return flags; + } + ts.getCombinedNodeFlags = getCombinedNodeFlags; + function validateLocaleAndSetLanguage(locale, sys, errors) { + var matchResult = /^([a-z]+)([_\-]([a-z]+))?$/.exec(locale.toLowerCase()); + if (!matchResult) { + if (errors) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1, "en", "ja-jp")); + } + return; + } + var language = matchResult[1]; + var territory = matchResult[3]; + if (!trySetLanguageAndTerritory(language, territory, errors)) { + trySetLanguageAndTerritory(language, undefined, errors); + } + function trySetLanguageAndTerritory(language, territory, errors) { + var compilerFilePath = ts.normalizePath(sys.getExecutingFilePath()); + var containingDirectoryPath = ts.getDirectoryPath(compilerFilePath); + var filePath = ts.combinePaths(containingDirectoryPath, language); + if (territory) { + filePath = filePath + "-" + territory; + } + filePath = sys.resolvePath(ts.combinePaths(filePath, "diagnosticMessages.generated.json")); + if (!sys.fileExists(filePath)) { + return false; + } + var fileContents = ""; + try { + fileContents = sys.readFile(filePath); + } + catch (e) { + if (errors) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unable_to_open_file_0, filePath)); + } + return false; + } + try { + ts.localizedDiagnosticMessages = JSON.parse(fileContents); + } + catch (e) { + if (errors) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Corrupted_locale_file_0, filePath)); + } + return false; + } + return true; + } + } + ts.validateLocaleAndSetLanguage = validateLocaleAndSetLanguage; + function getOriginalNode(node, nodeTest) { + if (node) { + while (node.original !== undefined) { + node = node.original; + } + } + return !nodeTest || nodeTest(node) ? node : undefined; + } + ts.getOriginalNode = getOriginalNode; + function isParseTreeNode(node) { + return (node.flags & 8) === 0; + } + ts.isParseTreeNode = isParseTreeNode; + function getParseTreeNode(node, nodeTest) { + if (node === undefined || isParseTreeNode(node)) { + return node; + } + node = getOriginalNode(node); + if (isParseTreeNode(node) && (!nodeTest || nodeTest(node))) { + return node; + } + return undefined; + } + ts.getParseTreeNode = getParseTreeNode; + function unescapeIdentifier(identifier) { + return identifier.length >= 3 && identifier.charCodeAt(0) === 95 && identifier.charCodeAt(1) === 95 && identifier.charCodeAt(2) === 95 ? identifier.substr(1) : identifier; + } + ts.unescapeIdentifier = unescapeIdentifier; +})(ts || (ts = {})); +var ts; (function (ts) { function tokenIsIdentifierOrKeyword(token) { return token >= 70; } ts.tokenIsIdentifierOrKeyword = tokenIsIdentifierOrKeyword; - var textToToken = ts.createMap({ + var textToToken = ts.createMapFromTemplate({ "abstract": 116, "any": 118, "as": 117, @@ -3250,7 +8907,7 @@ var ts; "false": 85, "finally": 86, "for": 87, - "from": 138, + "from": 139, "function": 88, "get": 124, "if": 89, @@ -3268,27 +8925,28 @@ var ts; "new": 93, "null": 94, "number": 132, + "object": 133, "package": 110, "private": 111, "protected": 112, "public": 113, "readonly": 130, "require": 131, - "global": 139, + "global": 140, "return": 95, - "set": 133, + "set": 134, "static": 114, - "string": 134, + "string": 135, "super": 96, "switch": 97, - "symbol": 135, + "symbol": 136, "this": 98, "throw": 99, "true": 100, "try": 101, - "type": 136, + "type": 137, "typeof": 102, - "undefined": 137, + "undefined": 138, "var": 103, "void": 104, "while": 105, @@ -3296,7 +8954,7 @@ var ts; "yield": 115, "async": 119, "await": 120, - "of": 140, + "of": 141, "{": 16, "}": 17, "(": 18, @@ -3391,9 +9049,9 @@ var ts; } function makeReverseMap(source) { var result = []; - for (var name_4 in source) { - result[source[name_4]] = name_4; - } + source.forEach(function (value, name) { + result[value] = name; + }); return result; } var tokenStrings = makeReverseMap(textToToken); @@ -3402,7 +9060,7 @@ var ts; } ts.tokenToString = tokenToString; function stringToToken(s) { - return textToToken[s]; + return textToToken.get(s); } ts.stringToToken = stringToToken; function computeLineStarts(text) { @@ -3462,7 +9120,6 @@ var ts; return computeLineAndCharacterOfPosition(getLineStarts(sourceFile), position); } ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; - var hasOwnProperty = Object.prototype.hasOwnProperty; function isWhiteSpace(ch) { return isWhiteSpaceSingleLine(ch) || isLineBreak(ch); } @@ -3598,7 +9255,7 @@ var ts; if (pos === 0 || isLineBreak(text.charCodeAt(pos - 1))) { var ch = text.charCodeAt(pos); if ((pos + mergeConflictMarkerLength) < text.length) { - for (var i = 0, n = mergeConflictMarkerLength; i < n; i++) { + for (var i = 0; i < mergeConflictMarkerLength; i++) { if (text.charCodeAt(pos + i) !== ch) { return false; } @@ -3751,7 +9408,7 @@ var ts; if (!comments) { comments = []; } - comments.push({ pos: pos, end: end, hasTrailingNewLine: hasTrailingNewLine, kind: kind }); + comments.push({ kind: kind, pos: pos, end: end, hasTrailingNewLine: hasTrailingNewLine }); return comments; } function getLeadingCommentRanges(text, pos) { @@ -3784,7 +9441,7 @@ var ts; if (!isIdentifierStart(name.charCodeAt(0), languageVersion)) { return false; } - for (var i = 1, n = name.length; i < n; i++) { + for (var i = 1; i < name.length; i++) { if (!isIdentifierPart(name.charCodeAt(i), languageVersion)) { return false; } @@ -3803,6 +9460,7 @@ var ts; var precedingLineBreak; var hasExtendedUnicodeEscape; var tokenIsUnterminated; + var numericLiteralFlags; setText(text, start, length); return { getStartPos: function () { return startPos; }, @@ -3816,6 +9474,7 @@ var ts; isIdentifier: function () { return token === 70 || token > 106; }, isReservedWord: function () { return token >= 71 && token <= 106; }, isUnterminated: function () { return tokenIsUnterminated; }, + getNumericLiteralFlags: function () { return numericLiteralFlags; }, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, reScanTemplateToken: reScanTemplateToken, @@ -3852,6 +9511,7 @@ var ts; var end = pos; if (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101) { pos++; + numericLiteralFlags = 2; if (text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) pos++; if (isDigit(text.charCodeAt(pos))) { @@ -4121,8 +9781,11 @@ var ts; var len = tokenValue.length; if (len >= 2 && len <= 11) { var ch = tokenValue.charCodeAt(0); - if (ch >= 97 && ch <= 122 && hasOwnProperty.call(textToToken, tokenValue)) { - return token = textToToken[tokenValue]; + if (ch >= 97 && ch <= 122) { + token = textToToken.get(tokenValue); + if (token !== undefined) { + return token; + } } } return token = 70; @@ -4151,6 +9814,7 @@ var ts; hasExtendedUnicodeEscape = false; precedingLineBreak = false; tokenIsUnterminated = false; + numericLiteralFlags = 0; while (true) { tokenPos = pos; if (pos >= end) { @@ -4332,6 +9996,7 @@ var ts; value = 0; } tokenValue = "" + value; + numericLiteralFlags = 8; return token = 8; } else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) { @@ -4342,6 +10007,7 @@ var ts; value = 0; } tokenValue = "" + value; + numericLiteralFlags = 16; return token = 8; } else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) { @@ -4352,10 +10018,12 @@ var ts; value = 0; } tokenValue = "" + value; + numericLiteralFlags = 32; return token = 8; } if (pos + 1 < end && isOctalDigit(text.charCodeAt(pos + 1))) { tokenValue = "" + scanOctalDigits(); + numericLiteralFlags = 4; return token = 8; } case 49: @@ -4602,7 +10270,14 @@ var ts; while (pos < end) { pos++; char = text.charCodeAt(pos); - if ((char === 123) || (char === 60)) { + if (char === 123) { + break; + } + if (char === 60) { + if (isConflictMarkerTrivia(text, pos)) { + pos = scanConflictMarkerTrivia(text, pos, error); + return token = 7; + } break; } } @@ -4774,5804 +10449,15 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean" }; - ts.optionDeclarations = [ - { - name: "charset", - type: "string", - }, - ts.compileOnSaveCommandLineOption, - { - name: "declaration", - shortName: "d", - type: "boolean", - description: ts.Diagnostics.Generates_corresponding_d_ts_file, - }, - { - name: "declarationDir", - type: "string", - isFilePath: true, - paramType: ts.Diagnostics.DIRECTORY, - }, - { - name: "diagnostics", - type: "boolean", - }, - { - name: "extendedDiagnostics", - type: "boolean", - experimental: true - }, - { - name: "emitBOM", - type: "boolean" - }, - { - name: "help", - shortName: "h", - type: "boolean", - description: ts.Diagnostics.Print_this_message, - }, - { - name: "help", - shortName: "?", - type: "boolean" - }, - { - name: "init", - type: "boolean", - description: ts.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file, - }, - { - name: "inlineSourceMap", - type: "boolean", - }, - { - name: "inlineSources", - type: "boolean", - }, - { - name: "jsx", - type: ts.createMap({ - "preserve": 1, - "react": 2 - }), - paramType: ts.Diagnostics.KIND, - description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_or_react, - }, - { - name: "reactNamespace", - type: "string", - description: ts.Diagnostics.Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit - }, - { - name: "jsxFactory", - type: "string", - description: ts.Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h - }, - { - name: "listFiles", - type: "boolean", - }, - { - name: "locale", - type: "string", - }, - { - name: "mapRoot", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, - paramType: ts.Diagnostics.LOCATION, - }, - { - name: "module", - shortName: "m", - type: ts.createMap({ - "none": ts.ModuleKind.None, - "commonjs": ts.ModuleKind.CommonJS, - "amd": ts.ModuleKind.AMD, - "system": ts.ModuleKind.System, - "umd": ts.ModuleKind.UMD, - "es6": ts.ModuleKind.ES2015, - "es2015": ts.ModuleKind.ES2015, - }), - description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015, - paramType: ts.Diagnostics.KIND, - }, - { - name: "newLine", - type: ts.createMap({ - "crlf": 0, - "lf": 1 - }), - description: ts.Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, - paramType: ts.Diagnostics.NEWLINE, - }, - { - name: "noEmit", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_outputs, - }, - { - name: "noEmitHelpers", - type: "boolean" - }, - { - name: "noEmitOnError", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported, - }, - { - name: "noErrorTruncation", - type: "boolean" - }, - { - name: "noImplicitAny", - type: "boolean", - description: ts.Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type, - }, - { - name: "noImplicitThis", - type: "boolean", - description: ts.Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type, - }, - { - name: "noUnusedLocals", - type: "boolean", - description: ts.Diagnostics.Report_errors_on_unused_locals, - }, - { - name: "noUnusedParameters", - type: "boolean", - description: ts.Diagnostics.Report_errors_on_unused_parameters, - }, - { - name: "noLib", - type: "boolean", - }, - { - name: "noResolve", - type: "boolean", - }, - { - name: "skipDefaultLibCheck", - type: "boolean", - }, - { - name: "skipLibCheck", - type: "boolean", - description: ts.Diagnostics.Skip_type_checking_of_declaration_files, - }, - { - name: "out", - type: "string", - isFilePath: false, - paramType: ts.Diagnostics.FILE, - }, - { - name: "outFile", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Concatenate_and_emit_output_to_single_file, - paramType: ts.Diagnostics.FILE, - }, - { - name: "outDir", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Redirect_output_structure_to_the_directory, - paramType: ts.Diagnostics.DIRECTORY, - }, - { - name: "preserveConstEnums", - type: "boolean", - description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code - }, - { - name: "pretty", - description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental, - type: "boolean" - }, - { - name: "project", - shortName: "p", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Compile_the_project_in_the_given_directory, - paramType: ts.Diagnostics.DIRECTORY - }, - { - name: "removeComments", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_comments_to_output, - }, - { - name: "rootDir", - type: "string", - isFilePath: true, - paramType: ts.Diagnostics.LOCATION, - description: ts.Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, - }, - { - name: "isolatedModules", - type: "boolean", - }, - { - name: "sourceMap", - type: "boolean", - description: ts.Diagnostics.Generates_corresponding_map_file, - }, - { - name: "sourceRoot", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, - paramType: ts.Diagnostics.LOCATION, - }, - { - name: "suppressExcessPropertyErrors", - type: "boolean", - description: ts.Diagnostics.Suppress_excess_property_checks_for_object_literals, - experimental: true - }, - { - name: "suppressImplicitAnyIndexErrors", - type: "boolean", - description: ts.Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures, - }, - { - name: "stripInternal", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, - experimental: true - }, - { - name: "target", - shortName: "t", - type: ts.createMap({ - "es3": 0, - "es5": 1, - "es6": 2, - "es2015": 2, - "es2016": 3, - "es2017": 4, - "esnext": 5, - }), - description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015, - paramType: ts.Diagnostics.VERSION, - }, - { - name: "version", - shortName: "v", - type: "boolean", - description: ts.Diagnostics.Print_the_compiler_s_version, - }, - { - name: "watch", - shortName: "w", - type: "boolean", - description: ts.Diagnostics.Watch_input_files, - }, - { - name: "experimentalDecorators", - type: "boolean", - description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators - }, - { - name: "emitDecoratorMetadata", - type: "boolean", - experimental: true, - description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators - }, - { - name: "moduleResolution", - type: ts.createMap({ - "node": ts.ModuleResolutionKind.NodeJs, - "classic": ts.ModuleResolutionKind.Classic, - }), - description: ts.Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6, - paramType: ts.Diagnostics.STRATEGY, - }, - { - name: "allowUnusedLabels", - type: "boolean", - description: ts.Diagnostics.Do_not_report_errors_on_unused_labels - }, - { - name: "noImplicitReturns", - type: "boolean", - description: ts.Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value - }, - { - name: "noFallthroughCasesInSwitch", - type: "boolean", - description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement - }, - { - name: "allowUnreachableCode", - type: "boolean", - description: ts.Diagnostics.Do_not_report_errors_on_unreachable_code - }, - { - name: "forceConsistentCasingInFileNames", - type: "boolean", - description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file - }, - { - name: "baseUrl", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Base_directory_to_resolve_non_absolute_module_names - }, - { - name: "paths", - type: "object", - isTSConfigOnly: true - }, - { - name: "rootDirs", - type: "list", - isTSConfigOnly: true, - element: { - name: "rootDirs", - type: "string", - isFilePath: true - } - }, - { - name: "typeRoots", - type: "list", - element: { - name: "typeRoots", - type: "string", - isFilePath: true - } - }, - { - name: "types", - type: "list", - element: { - name: "types", - type: "string" - }, - description: ts.Diagnostics.Type_declaration_files_to_be_included_in_compilation - }, - { - name: "traceResolution", - type: "boolean", - description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process - }, - { - name: "allowJs", - type: "boolean", - description: ts.Diagnostics.Allow_javascript_files_to_be_compiled - }, - { - name: "allowSyntheticDefaultImports", - type: "boolean", - description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking - }, - { - name: "noImplicitUseStrict", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_use_strict_directives_in_module_output - }, - { - name: "maxNodeModuleJsDepth", - type: "number", - description: ts.Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files - }, - { - name: "listEmittedFiles", - type: "boolean" - }, - { - name: "lib", - type: "list", - element: { - name: "lib", - type: ts.createMap({ - "es5": "lib.es5.d.ts", - "es6": "lib.es2015.d.ts", - "es2015": "lib.es2015.d.ts", - "es7": "lib.es2016.d.ts", - "es2016": "lib.es2016.d.ts", - "es2017": "lib.es2017.d.ts", - "dom": "lib.dom.d.ts", - "dom.iterable": "lib.dom.iterable.d.ts", - "webworker": "lib.webworker.d.ts", - "scripthost": "lib.scripthost.d.ts", - "es2015.core": "lib.es2015.core.d.ts", - "es2015.collection": "lib.es2015.collection.d.ts", - "es2015.generator": "lib.es2015.generator.d.ts", - "es2015.iterable": "lib.es2015.iterable.d.ts", - "es2015.promise": "lib.es2015.promise.d.ts", - "es2015.proxy": "lib.es2015.proxy.d.ts", - "es2015.reflect": "lib.es2015.reflect.d.ts", - "es2015.symbol": "lib.es2015.symbol.d.ts", - "es2015.symbol.wellknown": "lib.es2015.symbol.wellknown.d.ts", - "es2016.array.include": "lib.es2016.array.include.d.ts", - "es2017.object": "lib.es2017.object.d.ts", - "es2017.sharedmemory": "lib.es2017.sharedmemory.d.ts", - "es2017.string": "lib.es2017.string.d.ts", - }), - }, - description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon - }, - { - name: "disableSizeLimit", - type: "boolean" - }, - { - name: "strictNullChecks", - type: "boolean", - description: ts.Diagnostics.Enable_strict_null_checks - }, - { - name: "importHelpers", - type: "boolean", - description: ts.Diagnostics.Import_emit_helpers_from_tslib - }, - { - name: "alwaysStrict", - type: "boolean", - description: ts.Diagnostics.Parse_in_strict_mode_and_emit_use_strict_for_each_source_file - } - ]; - ts.typeAcquisitionDeclarations = [ - { - name: "enableAutoDiscovery", - type: "boolean", - }, - { - name: "enable", - type: "boolean", - }, - { - name: "include", - type: "list", - element: { - name: "include", - type: "string" - } - }, - { - name: "exclude", - type: "list", - element: { - name: "exclude", - type: "string" - } - } - ]; - ts.defaultInitCompilerOptions = { - module: ts.ModuleKind.CommonJS, - target: 1, - noImplicitAny: false, - sourceMap: false, - }; - var optionNameMapCache; - function convertEnableAutoDiscoveryToEnable(typeAcquisition) { - if (typeAcquisition && typeAcquisition.enableAutoDiscovery !== undefined && typeAcquisition.enable === undefined) { - var result = { - enable: typeAcquisition.enableAutoDiscovery, - include: typeAcquisition.include || [], - exclude: typeAcquisition.exclude || [] - }; - return result; - } - return typeAcquisition; - } - ts.convertEnableAutoDiscoveryToEnable = convertEnableAutoDiscoveryToEnable; - function getOptionNameMap() { - if (optionNameMapCache) { - return optionNameMapCache; - } - var optionNameMap = ts.createMap(); - var shortOptionNames = ts.createMap(); - ts.forEach(ts.optionDeclarations, function (option) { - optionNameMap[option.name.toLowerCase()] = option; - if (option.shortName) { - shortOptionNames[option.shortName] = option.name; - } - }); - optionNameMapCache = { optionNameMap: optionNameMap, shortOptionNames: shortOptionNames }; - return optionNameMapCache; - } - ts.getOptionNameMap = getOptionNameMap; - function createCompilerDiagnosticForInvalidCustomType(opt) { - var namesOfType = Object.keys(opt.type).map(function (key) { return "'" + key + "'"; }).join(", "); - return ts.createCompilerDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType); - } - ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType; - function parseCustomTypeOption(opt, value, errors) { - var key = trimString((value || "")).toLowerCase(); - var map = opt.type; - if (key in map) { - return map[key]; - } - else { - errors.push(createCompilerDiagnosticForInvalidCustomType(opt)); - } - } - ts.parseCustomTypeOption = parseCustomTypeOption; - function parseListTypeOption(opt, value, errors) { - if (value === void 0) { value = ""; } - value = trimString(value); - if (ts.startsWith(value, "-")) { - return undefined; - } - if (value === "") { - return []; - } - var values = value.split(","); - switch (opt.element.type) { - case "number": - return ts.map(values, parseInt); - case "string": - return ts.map(values, function (v) { return v || ""; }); - default: - return ts.filter(ts.map(values, function (v) { return parseCustomTypeOption(opt.element, v, errors); }), function (v) { return !!v; }); - } - } - ts.parseListTypeOption = parseListTypeOption; - function parseCommandLine(commandLine, readFile) { - var options = {}; - var fileNames = []; - var errors = []; - var _a = getOptionNameMap(), optionNameMap = _a.optionNameMap, shortOptionNames = _a.shortOptionNames; - parseStrings(commandLine); - return { - options: options, - fileNames: fileNames, - errors: errors - }; - function parseStrings(args) { - var i = 0; - while (i < args.length) { - var s = args[i]; - i++; - if (s.charCodeAt(0) === 64) { - parseResponseFile(s.slice(1)); - } - else if (s.charCodeAt(0) === 45) { - s = s.slice(s.charCodeAt(1) === 45 ? 2 : 1).toLowerCase(); - if (s in shortOptionNames) { - s = shortOptionNames[s]; - } - if (s in optionNameMap) { - var opt = optionNameMap[s]; - if (opt.isTSConfigOnly) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file, opt.name)); - } - else { - if (!args[i] && opt.type !== "boolean") { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_expects_an_argument, opt.name)); - } - switch (opt.type) { - case "number": - options[opt.name] = parseInt(args[i]); - i++; - break; - case "boolean": - var optValue = args[i]; - options[opt.name] = optValue !== "false"; - if (optValue === "false" || optValue === "true") { - i++; - } - break; - case "string": - options[opt.name] = args[i] || ""; - i++; - break; - case "list": - var result = parseListTypeOption(opt, args[i], errors); - options[opt.name] = result || []; - if (result) { - i++; - } - break; - default: - options[opt.name] = parseCustomTypeOption(opt, args[i], errors); - i++; - break; - } - } - } - else { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_compiler_option_0, s)); - } - } - else { - fileNames.push(s); - } - } - } - function parseResponseFile(fileName) { - var text = readFile ? readFile(fileName) : ts.sys.readFile(fileName); - if (!text) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_not_found, fileName)); - return; - } - var args = []; - var pos = 0; - while (true) { - while (pos < text.length && text.charCodeAt(pos) <= 32) - pos++; - if (pos >= text.length) - break; - var start = pos; - if (text.charCodeAt(start) === 34) { - pos++; - while (pos < text.length && text.charCodeAt(pos) !== 34) - pos++; - if (pos < text.length) { - args.push(text.substring(start + 1, pos)); - pos++; - } - else { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unterminated_quoted_string_in_response_file_0, fileName)); - } - } - else { - while (text.charCodeAt(pos) > 32) - pos++; - args.push(text.substring(start, pos)); - } - } - parseStrings(args); - } - } - ts.parseCommandLine = parseCommandLine; - function readConfigFile(fileName, readFile) { - var text = ""; - try { - text = readFile(fileName); - } - catch (e) { - return { error: ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message) }; - } - return parseConfigFileTextToJson(fileName, text); - } - ts.readConfigFile = readConfigFile; - function parseConfigFileTextToJson(fileName, jsonText, stripComments) { - if (stripComments === void 0) { stripComments = true; } - try { - var jsonTextToParse = stripComments ? removeComments(jsonText) : jsonText; - return { config: /\S/.test(jsonTextToParse) ? JSON.parse(jsonTextToParse) : {} }; - } - catch (e) { - return { error: ts.createCompilerDiagnostic(ts.Diagnostics.Failed_to_parse_file_0_Colon_1, fileName, e.message) }; - } - } - ts.parseConfigFileTextToJson = parseConfigFileTextToJson; - function generateTSConfig(options, fileNames) { - var compilerOptions = ts.extend(options, ts.defaultInitCompilerOptions); - var configurations = { - compilerOptions: serializeCompilerOptions(compilerOptions) - }; - if (fileNames && fileNames.length) { - configurations.files = fileNames; - } - return configurations; - function getCustomTypeMapOfCommandLineOption(optionDefinition) { - if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean") { - return undefined; - } - else if (optionDefinition.type === "list") { - return getCustomTypeMapOfCommandLineOption(optionDefinition.element); - } - else { - return optionDefinition.type; - } - } - function getNameOfCompilerOptionValue(value, customTypeMap) { - for (var key in customTypeMap) { - if (customTypeMap[key] === value) { - return key; - } - } - return undefined; - } - function serializeCompilerOptions(options) { - var result = ts.createMap(); - var optionsNameMap = getOptionNameMap().optionNameMap; - for (var name_5 in options) { - if (ts.hasProperty(options, name_5)) { - switch (name_5) { - case "init": - case "watch": - case "version": - case "help": - case "project": - break; - default: - var value = options[name_5]; - var optionDefinition = optionsNameMap[name_5.toLowerCase()]; - if (optionDefinition) { - var customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition); - if (!customTypeMap) { - result[name_5] = value; - } - else { - if (optionDefinition.type === "list") { - var convertedValue = []; - for (var _i = 0, _a = value; _i < _a.length; _i++) { - var element = _a[_i]; - convertedValue.push(getNameOfCompilerOptionValue(element, customTypeMap)); - } - result[name_5] = convertedValue; - } - else { - result[name_5] = getNameOfCompilerOptionValue(value, customTypeMap); - } - } - } - break; - } - } - } - return result; - } - } - ts.generateTSConfig = generateTSConfig; - function removeComments(jsonText) { - var output = ""; - var scanner = ts.createScanner(1, false, 0, jsonText); - var token; - while ((token = scanner.scan()) !== 1) { - switch (token) { - case 2: - case 3: - output += scanner.getTokenText().replace(/\S/g, " "); - break; - default: - output += scanner.getTokenText(); - break; - } - } - return output; - } - function parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack) { - if (existingOptions === void 0) { existingOptions = {}; } - if (resolutionStack === void 0) { resolutionStack = []; } - var errors = []; - var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames); - var resolvedPath = ts.toPath(configFileName || "", basePath, getCanonicalFileName); - if (resolutionStack.indexOf(resolvedPath) >= 0) { - return { - options: {}, - fileNames: [], - typeAcquisition: {}, - raw: json, - errors: [ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, resolutionStack.concat([resolvedPath]).join(" -> "))], - wildcardDirectories: {} - }; - } - var options = convertCompilerOptionsFromJsonWorker(json["compilerOptions"], basePath, errors, configFileName); - var jsonOptions = json["typeAcquisition"] || json["typingOptions"]; - var typeAcquisition = convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName); - if (json["extends"]) { - var _a = [undefined, undefined, undefined, {}], include = _a[0], exclude = _a[1], files = _a[2], baseOptions = _a[3]; - if (typeof json["extends"] === "string") { - _b = (tryExtendsName(json["extends"]) || [include, exclude, files, baseOptions]), include = _b[0], exclude = _b[1], files = _b[2], baseOptions = _b[3]; - } - else { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", "string")); - } - if (include && !json["include"]) { - json["include"] = include; - } - if (exclude && !json["exclude"]) { - json["exclude"] = exclude; - } - if (files && !json["files"]) { - json["files"] = files; - } - options = ts.assign({}, baseOptions, options); - } - options = ts.extend(existingOptions, options); - options.configFilePath = configFileName; - var _c = getFileNames(errors), fileNames = _c.fileNames, wildcardDirectories = _c.wildcardDirectories; - var compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors); - return { - options: options, - fileNames: fileNames, - typeAcquisition: typeAcquisition, - raw: json, - errors: errors, - wildcardDirectories: wildcardDirectories, - compileOnSave: compileOnSave - }; - function tryExtendsName(extendedConfig) { - if (!(ts.isRootedDiskPath(extendedConfig) || ts.startsWith(ts.normalizeSlashes(extendedConfig), "./") || ts.startsWith(ts.normalizeSlashes(extendedConfig), "../"))) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not, extendedConfig)); - return; - } - var extendedConfigPath = ts.toPath(extendedConfig, basePath, getCanonicalFileName); - if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json")) { - extendedConfigPath = extendedConfigPath + ".json"; - if (!host.fileExists(extendedConfigPath)) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_does_not_exist, extendedConfig)); - return; - } - } - var extendedResult = readConfigFile(extendedConfigPath, function (path) { return host.readFile(path); }); - if (extendedResult.error) { - errors.push(extendedResult.error); - return; - } - var extendedDirname = ts.getDirectoryPath(extendedConfigPath); - var relativeDifference = ts.convertToRelativePath(extendedDirname, basePath, getCanonicalFileName); - var updatePath = function (path) { return ts.isRootedDiskPath(path) ? path : ts.combinePaths(relativeDifference, path); }; - var result = parseJsonConfigFileContent(extendedResult.config, host, extendedDirname, undefined, ts.getBaseFileName(extendedConfigPath), resolutionStack.concat([resolvedPath])); - errors.push.apply(errors, result.errors); - var _a = ts.map(["include", "exclude", "files"], function (key) { - if (!json[key] && extendedResult.config[key]) { - return ts.map(extendedResult.config[key], updatePath); - } - }), include = _a[0], exclude = _a[1], files = _a[2]; - return [include, exclude, files, result.options]; - } - function getFileNames(errors) { - var fileNames; - if (ts.hasProperty(json, "files")) { - if (ts.isArray(json["files"])) { - fileNames = json["files"]; - if (fileNames.length === 0) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.The_files_list_in_config_file_0_is_empty, configFileName || "tsconfig.json")); - } - } - else { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "files", "Array")); - } - } - var includeSpecs; - if (ts.hasProperty(json, "include")) { - if (ts.isArray(json["include"])) { - includeSpecs = json["include"]; - } - else { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "include", "Array")); - } - } - var excludeSpecs; - if (ts.hasProperty(json, "exclude")) { - if (ts.isArray(json["exclude"])) { - excludeSpecs = json["exclude"]; - } - else { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "exclude", "Array")); - } - } - else if (ts.hasProperty(json, "excludes")) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)); - } - else { - excludeSpecs = includeSpecs ? [] : ["node_modules", "bower_components", "jspm_packages"]; - var outDir = json["compilerOptions"] && json["compilerOptions"]["outDir"]; - if (outDir) { - excludeSpecs.push(outDir); - } - } - if (fileNames === undefined && includeSpecs === undefined) { - includeSpecs = ["**/*"]; - } - var result = matchFileNames(fileNames, includeSpecs, excludeSpecs, basePath, options, host, errors); - if (result.fileNames.length === 0 && !ts.hasProperty(json, "files") && resolutionStack.length === 0) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, configFileName || "tsconfig.json", JSON.stringify(includeSpecs || []), JSON.stringify(excludeSpecs || []))); - } - return result; - } - var _b; - } - ts.parseJsonConfigFileContent = parseJsonConfigFileContent; - function convertCompileOnSaveOptionFromJson(jsonOption, basePath, errors) { - if (!ts.hasProperty(jsonOption, ts.compileOnSaveCommandLineOption.name)) { - return false; - } - var result = convertJsonOption(ts.compileOnSaveCommandLineOption, jsonOption["compileOnSave"], basePath, errors); - if (typeof result === "boolean" && result) { - return result; - } - return false; - } - ts.convertCompileOnSaveOptionFromJson = convertCompileOnSaveOptionFromJson; - function convertCompilerOptionsFromJson(jsonOptions, basePath, configFileName) { - var errors = []; - var options = convertCompilerOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName); - return { options: options, errors: errors }; - } - ts.convertCompilerOptionsFromJson = convertCompilerOptionsFromJson; - function convertTypeAcquisitionFromJson(jsonOptions, basePath, configFileName) { - var errors = []; - var options = convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName); - return { options: options, errors: errors }; - } - ts.convertTypeAcquisitionFromJson = convertTypeAcquisitionFromJson; - function convertCompilerOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName) { - var options = ts.getBaseFileName(configFileName) === "jsconfig.json" - ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true } - : {}; - convertOptionsFromJson(ts.optionDeclarations, jsonOptions, basePath, options, ts.Diagnostics.Unknown_compiler_option_0, errors); - return options; - } - function convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName) { - var options = { enable: ts.getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] }; - var typeAcquisition = convertEnableAutoDiscoveryToEnable(jsonOptions); - convertOptionsFromJson(ts.typeAcquisitionDeclarations, typeAcquisition, basePath, options, ts.Diagnostics.Unknown_type_acquisition_option_0, errors); - return options; - } - function convertOptionsFromJson(optionDeclarations, jsonOptions, basePath, defaultOptions, diagnosticMessage, errors) { - if (!jsonOptions) { - return; - } - var optionNameMap = ts.arrayToMap(optionDeclarations, function (opt) { return opt.name; }); - for (var id in jsonOptions) { - if (id in optionNameMap) { - var opt = optionNameMap[id]; - defaultOptions[opt.name] = convertJsonOption(opt, jsonOptions[id], basePath, errors); - } - else { - errors.push(ts.createCompilerDiagnostic(diagnosticMessage, id)); - } - } - } - function convertJsonOption(opt, value, basePath, errors) { - var optType = opt.type; - var expectedType = typeof optType === "string" ? optType : "string"; - if (optType === "list" && ts.isArray(value)) { - return convertJsonOptionOfListType(opt, value, basePath, errors); - } - else if (typeof value === expectedType) { - if (typeof optType !== "string") { - return convertJsonOptionOfCustomType(opt, value, errors); - } - else { - if (opt.isFilePath) { - value = ts.normalizePath(ts.combinePaths(basePath, value)); - if (value === "") { - value = "."; - } - } - } - return value; - } - else { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, opt.name, expectedType)); - } - } - function convertJsonOptionOfCustomType(opt, value, errors) { - var key = value.toLowerCase(); - if (key in opt.type) { - return opt.type[key]; - } - else { - errors.push(createCompilerDiagnosticForInvalidCustomType(opt)); - } - } - function convertJsonOptionOfListType(option, values, basePath, errors) { - return ts.filter(ts.map(values, function (v) { return convertJsonOption(option.element, v, basePath, errors); }), function (v) { return !!v; }); - } - function trimString(s) { - return typeof s.trim === "function" ? s.trim() : s.replace(/^[\s]+|[\s]+$/g, ""); - } - var invalidTrailingRecursionPattern = /(^|\/)\*\*\/?$/; - var invalidMultipleRecursionPatterns = /(^|\/)\*\*\/(.*\/)?\*\*($|\/)/; - var invalidDotDotAfterRecursiveWildcardPattern = /(^|\/)\*\*\/(.*\/)?\.\.($|\/)/; - var watchRecursivePattern = /\/[^/]*?[*?][^/]*\//; - var wildcardDirectoryPattern = /^[^*?]*(?=\/[^/]*[*?])/; - function matchFileNames(fileNames, include, exclude, basePath, options, host, errors) { - basePath = ts.normalizePath(basePath); - var keyMapper = host.useCaseSensitiveFileNames ? caseSensitiveKeyMapper : caseInsensitiveKeyMapper; - var literalFileMap = ts.createMap(); - var wildcardFileMap = ts.createMap(); - if (include) { - include = validateSpecs(include, errors, false); - } - if (exclude) { - exclude = validateSpecs(exclude, errors, true); - } - var wildcardDirectories = getWildcardDirectories(include, exclude, basePath, host.useCaseSensitiveFileNames); - var supportedExtensions = ts.getSupportedExtensions(options); - if (fileNames) { - for (var _i = 0, fileNames_1 = fileNames; _i < fileNames_1.length; _i++) { - var fileName = fileNames_1[_i]; - var file = ts.combinePaths(basePath, fileName); - literalFileMap[keyMapper(file)] = file; - } - } - if (include && include.length > 0) { - for (var _a = 0, _b = host.readDirectory(basePath, supportedExtensions, exclude, include); _a < _b.length; _a++) { - var file = _b[_a]; - if (hasFileWithHigherPriorityExtension(file, literalFileMap, wildcardFileMap, supportedExtensions, keyMapper)) { - continue; - } - removeWildcardFilesWithLowerPriorityExtension(file, wildcardFileMap, supportedExtensions, keyMapper); - var key = keyMapper(file); - if (!(key in literalFileMap) && !(key in wildcardFileMap)) { - wildcardFileMap[key] = file; - } - } - } - var literalFiles = ts.reduceProperties(literalFileMap, addFileToOutput, []); - var wildcardFiles = ts.reduceProperties(wildcardFileMap, addFileToOutput, []); - wildcardFiles.sort(host.useCaseSensitiveFileNames ? ts.compareStrings : ts.compareStringsCaseInsensitive); - return { - fileNames: literalFiles.concat(wildcardFiles), - wildcardDirectories: wildcardDirectories - }; - } - function validateSpecs(specs, errors, allowTrailingRecursion) { - var validSpecs = []; - for (var _i = 0, specs_2 = specs; _i < specs_2.length; _i++) { - var spec = specs_2[_i]; - if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); - } - else if (invalidMultipleRecursionPatterns.test(spec)) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0, spec)); - } - else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); - } - else { - validSpecs.push(spec); - } - } - return validSpecs; - } - function getWildcardDirectories(include, exclude, path, useCaseSensitiveFileNames) { - var rawExcludeRegex = ts.getRegularExpressionForWildcard(exclude, path, "exclude"); - var excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames ? "" : "i"); - var wildcardDirectories = ts.createMap(); - if (include !== undefined) { - var recursiveKeys = []; - for (var _i = 0, include_1 = include; _i < include_1.length; _i++) { - var file = include_1[_i]; - var spec = ts.normalizePath(ts.combinePaths(path, file)); - if (excludeRegex && excludeRegex.test(spec)) { - continue; - } - var match = getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames); - if (match) { - var key = match.key, flags = match.flags; - var existingFlags = wildcardDirectories[key]; - if (existingFlags === undefined || existingFlags < flags) { - wildcardDirectories[key] = flags; - if (flags === 1) { - recursiveKeys.push(key); - } - } - } - } - for (var key in wildcardDirectories) { - for (var _a = 0, recursiveKeys_1 = recursiveKeys; _a < recursiveKeys_1.length; _a++) { - var recursiveKey = recursiveKeys_1[_a]; - if (key !== recursiveKey && ts.containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) { - delete wildcardDirectories[key]; - } - } - } - } - return wildcardDirectories; - } - function getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames) { - var match = wildcardDirectoryPattern.exec(spec); - if (match) { - return { - key: useCaseSensitiveFileNames ? match[0] : match[0].toLowerCase(), - flags: watchRecursivePattern.test(spec) ? 1 : 0 - }; - } - if (ts.isImplicitGlob(spec)) { - return { key: spec, flags: 1 }; - } - return undefined; - } - function hasFileWithHigherPriorityExtension(file, literalFiles, wildcardFiles, extensions, keyMapper) { - var extensionPriority = ts.getExtensionPriority(file, extensions); - var adjustedExtensionPriority = ts.adjustExtensionPriority(extensionPriority); - for (var i = 0; i < adjustedExtensionPriority; i++) { - var higherPriorityExtension = extensions[i]; - var higherPriorityPath = keyMapper(ts.changeExtension(file, higherPriorityExtension)); - if (higherPriorityPath in literalFiles || higherPriorityPath in wildcardFiles) { - return true; - } - } - return false; - } - function removeWildcardFilesWithLowerPriorityExtension(file, wildcardFiles, extensions, keyMapper) { - var extensionPriority = ts.getExtensionPriority(file, extensions); - var nextExtensionPriority = ts.getNextLowestExtensionPriority(extensionPriority); - for (var i = nextExtensionPriority; i < extensions.length; i++) { - var lowerPriorityExtension = extensions[i]; - var lowerPriorityPath = keyMapper(ts.changeExtension(file, lowerPriorityExtension)); - delete wildcardFiles[lowerPriorityPath]; - } - } - function addFileToOutput(output, file) { - output.push(file); - return output; - } - function caseSensitiveKeyMapper(key) { - return key; - } - function caseInsensitiveKeyMapper(key) { - return key.toLowerCase(); - } -})(ts || (ts = {})); -var ts; -(function (ts) { - var JsTyping; - (function (JsTyping) { - ; - ; - var safeList; - var EmptySafeList = ts.createMap(); - JsTyping.nodeCoreModuleList = [ - "buffer", "querystring", "events", "http", "cluster", - "zlib", "os", "https", "punycode", "repl", "readline", - "vm", "child_process", "url", "dns", "net", - "dgram", "fs", "path", "string_decoder", "tls", - "crypto", "stream", "util", "assert", "tty", "domain", - "constants", "process", "v8", "timers", "console" - ]; - var nodeCoreModules = ts.arrayToMap(JsTyping.nodeCoreModuleList, function (x) { return x; }); - function discoverTypings(host, fileNames, projectRootPath, safeListPath, packageNameToTypingLocation, typeAcquisition, unresolvedImports) { - var inferredTypings = ts.createMap(); - if (!typeAcquisition || !typeAcquisition.enable) { - return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] }; - } - fileNames = ts.filter(ts.map(fileNames, ts.normalizePath), function (f) { - var kind = ts.ensureScriptKind(f, ts.getScriptKindFromFileName(f)); - return kind === 1 || kind === 2; - }); - if (!safeList) { - var result = ts.readConfigFile(safeListPath, function (path) { return host.readFile(path); }); - safeList = result.config ? ts.createMap(result.config) : EmptySafeList; - } - var filesToWatch = []; - var searchDirs = []; - var exclude = []; - mergeTypings(typeAcquisition.include); - exclude = typeAcquisition.exclude || []; - var possibleSearchDirs = ts.map(fileNames, ts.getDirectoryPath); - if (projectRootPath) { - possibleSearchDirs.push(projectRootPath); - } - searchDirs = ts.deduplicate(possibleSearchDirs); - for (var _i = 0, searchDirs_1 = searchDirs; _i < searchDirs_1.length; _i++) { - var searchDir = searchDirs_1[_i]; - var packageJsonPath = ts.combinePaths(searchDir, "package.json"); - getTypingNamesFromJson(packageJsonPath, filesToWatch); - var bowerJsonPath = ts.combinePaths(searchDir, "bower.json"); - getTypingNamesFromJson(bowerJsonPath, filesToWatch); - var nodeModulesPath = ts.combinePaths(searchDir, "node_modules"); - getTypingNamesFromNodeModuleFolder(nodeModulesPath); - } - getTypingNamesFromSourceFileNames(fileNames); - if (unresolvedImports) { - for (var _a = 0, unresolvedImports_1 = unresolvedImports; _a < unresolvedImports_1.length; _a++) { - var moduleId = unresolvedImports_1[_a]; - var typingName = moduleId in nodeCoreModules ? "node" : moduleId; - if (!(typingName in inferredTypings)) { - inferredTypings[typingName] = undefined; - } - } - } - for (var name_6 in packageNameToTypingLocation) { - if (name_6 in inferredTypings && !inferredTypings[name_6]) { - inferredTypings[name_6] = packageNameToTypingLocation[name_6]; - } - } - for (var _b = 0, exclude_1 = exclude; _b < exclude_1.length; _b++) { - var excludeTypingName = exclude_1[_b]; - delete inferredTypings[excludeTypingName]; - } - var newTypingNames = []; - var cachedTypingPaths = []; - for (var typing in inferredTypings) { - if (inferredTypings[typing] !== undefined) { - cachedTypingPaths.push(inferredTypings[typing]); - } - else { - newTypingNames.push(typing); - } - } - return { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch }; - function mergeTypings(typingNames) { - if (!typingNames) { - return; - } - for (var _i = 0, typingNames_1 = typingNames; _i < typingNames_1.length; _i++) { - var typing = typingNames_1[_i]; - if (!(typing in inferredTypings)) { - inferredTypings[typing] = undefined; - } - } - } - function getTypingNamesFromJson(jsonPath, filesToWatch) { - if (host.fileExists(jsonPath)) { - filesToWatch.push(jsonPath); - } - var result = ts.readConfigFile(jsonPath, function (path) { return host.readFile(path); }); - if (result.config) { - var jsonConfig = result.config; - if (jsonConfig.dependencies) { - mergeTypings(ts.getOwnKeys(jsonConfig.dependencies)); - } - if (jsonConfig.devDependencies) { - mergeTypings(ts.getOwnKeys(jsonConfig.devDependencies)); - } - if (jsonConfig.optionalDependencies) { - mergeTypings(ts.getOwnKeys(jsonConfig.optionalDependencies)); - } - if (jsonConfig.peerDependencies) { - mergeTypings(ts.getOwnKeys(jsonConfig.peerDependencies)); - } - } - } - function getTypingNamesFromSourceFileNames(fileNames) { - var jsFileNames = ts.filter(fileNames, ts.hasJavaScriptFileExtension); - var inferredTypingNames = ts.map(jsFileNames, function (f) { return ts.removeFileExtension(ts.getBaseFileName(f.toLowerCase())); }); - var cleanedTypingNames = ts.map(inferredTypingNames, function (f) { return f.replace(/((?:\.|-)min(?=\.|$))|((?:-|\.)\d+)/g, ""); }); - if (safeList !== EmptySafeList) { - mergeTypings(ts.filter(cleanedTypingNames, function (f) { return f in safeList; })); - } - var hasJsxFile = ts.forEach(fileNames, function (f) { return ts.ensureScriptKind(f, ts.getScriptKindFromFileName(f)) === 2; }); - if (hasJsxFile) { - mergeTypings(["react"]); - } - } - function getTypingNamesFromNodeModuleFolder(nodeModulesPath) { - if (!host.directoryExists(nodeModulesPath)) { - return; - } - var typingNames = []; - var fileNames = host.readDirectory(nodeModulesPath, [".json"], undefined, undefined, 2); - for (var _i = 0, fileNames_2 = fileNames; _i < fileNames_2.length; _i++) { - var fileName = fileNames_2[_i]; - var normalizedFileName = ts.normalizePath(fileName); - if (ts.getBaseFileName(normalizedFileName) !== "package.json") { - continue; - } - var result = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); }); - if (!result.config) { - continue; - } - var packageJson = result.config; - if (packageJson._requiredBy && - ts.filter(packageJson._requiredBy, function (r) { return r[0] === "#" || r === "/"; }).length === 0) { - continue; - } - if (!packageJson.name) { - continue; - } - if (packageJson.typings) { - var absolutePath = ts.getNormalizedAbsolutePath(packageJson.typings, ts.getDirectoryPath(normalizedFileName)); - inferredTypings[packageJson.name] = absolutePath; - } - else { - typingNames.push(packageJson.name); - } - } - mergeTypings(typingNames); - } - } - JsTyping.discoverTypings = discoverTypings; - })(JsTyping = ts.JsTyping || (ts.JsTyping = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var server; - (function (server) { - server.ActionSet = "action::set"; - server.ActionInvalidate = "action::invalidate"; - server.EventInstall = "event::install"; - var Arguments; - (function (Arguments) { - Arguments.GlobalCacheLocation = "--globalTypingsCacheLocation"; - Arguments.LogFile = "--logFile"; - Arguments.EnableTelemetry = "--enableTelemetry"; - })(Arguments = server.Arguments || (server.Arguments = {})); - function hasArgument(argumentName) { - return ts.sys.args.indexOf(argumentName) >= 0; - } - server.hasArgument = hasArgument; - function findArgument(argumentName) { - var index = ts.sys.args.indexOf(argumentName); - return index >= 0 && index < ts.sys.args.length - 1 - ? ts.sys.args[index + 1] - : undefined; - } - server.findArgument = findArgument; - })(server = ts.server || (ts.server = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var server; - (function (server) { - var LogLevel; - (function (LogLevel) { - LogLevel[LogLevel["terse"] = 0] = "terse"; - LogLevel[LogLevel["normal"] = 1] = "normal"; - LogLevel[LogLevel["requestTime"] = 2] = "requestTime"; - LogLevel[LogLevel["verbose"] = 3] = "verbose"; - })(LogLevel = server.LogLevel || (server.LogLevel = {})); - server.emptyArray = []; - var Msg; - (function (Msg) { - Msg.Err = "Err"; - Msg.Info = "Info"; - Msg.Perf = "Perf"; - })(Msg = server.Msg || (server.Msg = {})); - function getProjectRootPath(project) { - switch (project.projectKind) { - case server.ProjectKind.Configured: - return ts.getDirectoryPath(project.getProjectName()); - case server.ProjectKind.Inferred: - return ""; - case server.ProjectKind.External: - var projectName = ts.normalizeSlashes(project.getProjectName()); - return project.projectService.host.fileExists(projectName) ? ts.getDirectoryPath(projectName) : projectName; - } - } - function createInstallTypingsRequest(project, typeAcquisition, unresolvedImports, cachePath) { - return { - projectName: project.getProjectName(), - fileNames: project.getFileNames(true), - compilerOptions: project.getCompilerOptions(), - typeAcquisition: typeAcquisition, - unresolvedImports: unresolvedImports, - projectRootPath: getProjectRootPath(project), - cachePath: cachePath, - kind: "discover" - }; - } - server.createInstallTypingsRequest = createInstallTypingsRequest; - var Errors; - (function (Errors) { - function ThrowNoProject() { - throw new Error("No Project."); - } - Errors.ThrowNoProject = ThrowNoProject; - function ThrowProjectLanguageServiceDisabled() { - throw new Error("The project's language service is disabled."); - } - Errors.ThrowProjectLanguageServiceDisabled = ThrowProjectLanguageServiceDisabled; - function ThrowProjectDoesNotContainDocument(fileName, project) { - throw new Error("Project '" + project.getProjectName() + "' does not contain document '" + fileName + "'"); - } - Errors.ThrowProjectDoesNotContainDocument = ThrowProjectDoesNotContainDocument; - })(Errors = server.Errors || (server.Errors = {})); - function getDefaultFormatCodeSettings(host) { - return { - indentSize: 4, - tabSize: 4, - newLineCharacter: host.newLine || "\n", - convertTabsToSpaces: true, - indentStyle: ts.IndentStyle.Smart, - insertSpaceAfterCommaDelimiter: true, - insertSpaceAfterSemicolonInForStatements: true, - insertSpaceBeforeAndAfterBinaryOperators: true, - insertSpaceAfterKeywordsInControlFlowStatements: true, - insertSpaceAfterFunctionKeywordForAnonymousFunctions: false, - insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false, - insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false, - insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false, - insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false, - placeOpenBraceOnNewLineForFunctions: false, - placeOpenBraceOnNewLineForControlBlocks: false, - }; - } - server.getDefaultFormatCodeSettings = getDefaultFormatCodeSettings; - function mergeMaps(target, source) { - for (var key in source) { - if (ts.hasProperty(source, key)) { - target[key] = source[key]; - } - } - } - server.mergeMaps = mergeMaps; - function removeItemFromSet(items, itemToRemove) { - if (items.length === 0) { - return; - } - var index = items.indexOf(itemToRemove); - if (index < 0) { - return; - } - if (index === items.length - 1) { - items.pop(); - } - else { - items[index] = items.pop(); - } - } - server.removeItemFromSet = removeItemFromSet; - function toNormalizedPath(fileName) { - return ts.normalizePath(fileName); - } - server.toNormalizedPath = toNormalizedPath; - function normalizedPathToPath(normalizedPath, currentDirectory, getCanonicalFileName) { - var f = ts.isRootedDiskPath(normalizedPath) ? normalizedPath : ts.getNormalizedAbsolutePath(normalizedPath, currentDirectory); - return getCanonicalFileName(f); - } - server.normalizedPathToPath = normalizedPathToPath; - function asNormalizedPath(fileName) { - return fileName; - } - server.asNormalizedPath = asNormalizedPath; - function createNormalizedPathMap() { - var map = Object.create(null); - return { - get: function (path) { - return map[path]; - }, - set: function (path, value) { - map[path] = value; - }, - contains: function (path) { - return ts.hasProperty(map, path); - }, - remove: function (path) { - delete map[path]; - } - }; - } - server.createNormalizedPathMap = createNormalizedPathMap; - function isInferredProjectName(name) { - return /dev\/null\/inferredProject\d+\*/.test(name); - } - server.isInferredProjectName = isInferredProjectName; - function makeInferredProjectName(counter) { - return "/dev/null/inferredProject" + counter + "*"; - } - server.makeInferredProjectName = makeInferredProjectName; - function toSortedReadonlyArray(arr) { - arr.sort(); - return arr; - } - server.toSortedReadonlyArray = toSortedReadonlyArray; - var ThrottledOperations = (function () { - function ThrottledOperations(host) { - this.host = host; - this.pendingTimeouts = ts.createMap(); - } - ThrottledOperations.prototype.schedule = function (operationId, delay, cb) { - if (ts.hasProperty(this.pendingTimeouts, operationId)) { - this.host.clearTimeout(this.pendingTimeouts[operationId]); - } - this.pendingTimeouts[operationId] = this.host.setTimeout(ThrottledOperations.run, delay, this, operationId, cb); - }; - ThrottledOperations.run = function (self, operationId, cb) { - delete self.pendingTimeouts[operationId]; - cb(); - }; - return ThrottledOperations; - }()); - server.ThrottledOperations = ThrottledOperations; - var GcTimer = (function () { - function GcTimer(host, delay, logger) { - this.host = host; - this.delay = delay; - this.logger = logger; - } - GcTimer.prototype.scheduleCollect = function () { - if (!this.host.gc || this.timerId != undefined) { - return; - } - this.timerId = this.host.setTimeout(GcTimer.run, this.delay, this); - }; - GcTimer.run = function (self) { - self.timerId = undefined; - var log = self.logger.hasLevel(LogLevel.requestTime); - var before = log && self.host.getMemoryUsage(); - self.host.gc(); - if (log) { - var after = self.host.getMemoryUsage(); - self.logger.perftrc("GC::before " + before + ", after " + after); - } - }; - return GcTimer; - }()); - server.GcTimer = GcTimer; - })(server = ts.server || (ts.server = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - function trace(host) { - host.trace(ts.formatMessage.apply(undefined, arguments)); - } - ts.trace = trace; - function isTraceEnabled(compilerOptions, host) { - return compilerOptions.traceResolution && host.trace !== undefined; - } - ts.isTraceEnabled = isTraceEnabled; - function resolvedTypeScriptOnly(resolved) { - if (!resolved) { - return undefined; - } - ts.Debug.assert(ts.extensionIsTypeScript(resolved.extension)); - return resolved.path; - } - function resolvedFromAnyFile(path) { - return { path: path, extension: ts.extensionFromPath(path) }; - } - function resolvedModuleFromResolved(_a, isExternalLibraryImport) { - var path = _a.path, extension = _a.extension; - return { resolvedFileName: path, extension: extension, isExternalLibraryImport: isExternalLibraryImport }; - } - function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations) { - return { resolvedModule: resolved && resolvedModuleFromResolved(resolved, isExternalLibraryImport), failedLookupLocations: failedLookupLocations }; - } - function moduleHasNonRelativeName(moduleName) { - return !(ts.isRootedDiskPath(moduleName) || ts.isExternalModuleNameRelative(moduleName)); - } - ts.moduleHasNonRelativeName = moduleHasNonRelativeName; - function tryReadTypesSection(extensions, packageJsonPath, baseDirectory, state) { - var jsonContent = readJson(packageJsonPath, state.host); - switch (extensions) { - case 2: - case 0: - return tryReadFromField("typings") || tryReadFromField("types"); - case 1: - if (typeof jsonContent.main === "string") { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.No_types_specified_in_package_json_so_returning_main_value_of_0, jsonContent.main); - } - return ts.normalizePath(ts.combinePaths(baseDirectory, jsonContent.main)); - } - return undefined; - } - function tryReadFromField(fieldName) { - if (ts.hasProperty(jsonContent, fieldName)) { - var typesFile = jsonContent[fieldName]; - if (typeof typesFile === "string") { - var typesFilePath = ts.normalizePath(ts.combinePaths(baseDirectory, typesFile)); - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.package_json_has_0_field_1_that_references_2, fieldName, typesFile, typesFilePath); - } - return typesFilePath; - } - else { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_string_got_1, fieldName, typeof typesFile); - } - } - } - } - } - function readJson(path, host) { - try { - var jsonText = host.readFile(path); - return jsonText ? JSON.parse(jsonText) : {}; - } - catch (e) { - return {}; - } - } - function getEffectiveTypeRoots(options, host) { - if (options.typeRoots) { - return options.typeRoots; - } - var currentDirectory; - if (options.configFilePath) { - currentDirectory = ts.getDirectoryPath(options.configFilePath); - } - else if (host.getCurrentDirectory) { - currentDirectory = host.getCurrentDirectory(); - } - if (currentDirectory !== undefined) { - return getDefaultTypeRoots(currentDirectory, host); - } - } - ts.getEffectiveTypeRoots = getEffectiveTypeRoots; - function getDefaultTypeRoots(currentDirectory, host) { - if (!host.directoryExists) { - return [ts.combinePaths(currentDirectory, nodeModulesAtTypes)]; - } - var typeRoots; - forEachAncestorDirectory(currentDirectory, function (directory) { - var atTypes = ts.combinePaths(directory, nodeModulesAtTypes); - if (host.directoryExists(atTypes)) { - (typeRoots || (typeRoots = [])).push(atTypes); - } - }); - return typeRoots; - } - var nodeModulesAtTypes = ts.combinePaths("node_modules", "@types"); - function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host) { - var traceEnabled = isTraceEnabled(options, host); - var moduleResolutionState = { - compilerOptions: options, - host: host, - traceEnabled: traceEnabled - }; - var typeRoots = getEffectiveTypeRoots(options, host); - if (traceEnabled) { - if (containingFile === undefined) { - if (typeRoots === undefined) { - trace(host, ts.Diagnostics.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set, typeReferenceDirectiveName); - } - else { - trace(host, ts.Diagnostics.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1, typeReferenceDirectiveName, typeRoots); - } - } - else { - if (typeRoots === undefined) { - trace(host, ts.Diagnostics.Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set, typeReferenceDirectiveName, containingFile); - } - else { - trace(host, ts.Diagnostics.Resolving_type_reference_directive_0_containing_file_1_root_directory_2, typeReferenceDirectiveName, containingFile, typeRoots); - } - } - } - var failedLookupLocations = []; - var resolved = primaryLookup(); - var primary = true; - if (!resolved) { - resolved = secondaryLookup(); - primary = false; - } - var resolvedTypeReferenceDirective; - if (resolved) { - resolved = realpath(resolved, host, traceEnabled); - if (traceEnabled) { - trace(host, ts.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2, typeReferenceDirectiveName, resolved, primary); - } - resolvedTypeReferenceDirective = { primary: primary, resolvedFileName: resolved }; - } - return { resolvedTypeReferenceDirective: resolvedTypeReferenceDirective, failedLookupLocations: failedLookupLocations }; - function primaryLookup() { - if (typeRoots && typeRoots.length) { - if (traceEnabled) { - trace(host, ts.Diagnostics.Resolving_with_primary_search_path_0, typeRoots.join(", ")); - } - return ts.forEach(typeRoots, function (typeRoot) { - var candidate = ts.combinePaths(typeRoot, typeReferenceDirectiveName); - var candidateDirectory = ts.getDirectoryPath(candidate); - return resolvedTypeScriptOnly(loadNodeModuleFromDirectory(2, candidate, failedLookupLocations, !directoryProbablyExists(candidateDirectory, host), moduleResolutionState)); - }); - } - else { - if (traceEnabled) { - trace(host, ts.Diagnostics.Root_directory_cannot_be_determined_skipping_primary_search_paths); - } - } - } - function secondaryLookup() { - var resolvedFile; - var initialLocationForSecondaryLookup = containingFile && ts.getDirectoryPath(containingFile); - if (initialLocationForSecondaryLookup !== undefined) { - if (traceEnabled) { - trace(host, ts.Diagnostics.Looking_up_in_node_modules_folder_initial_location_0, initialLocationForSecondaryLookup); - } - resolvedFile = resolvedTypeScriptOnly(loadModuleFromNodeModules(2, typeReferenceDirectiveName, initialLocationForSecondaryLookup, failedLookupLocations, moduleResolutionState)); - if (!resolvedFile && traceEnabled) { - trace(host, ts.Diagnostics.Type_reference_directive_0_was_not_resolved, typeReferenceDirectiveName); - } - return resolvedFile; - } - else { - if (traceEnabled) { - trace(host, ts.Diagnostics.Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder); - } - } - } - } - ts.resolveTypeReferenceDirective = resolveTypeReferenceDirective; - function getAutomaticTypeDirectiveNames(options, host) { - if (options.types) { - return options.types; - } - var result = []; - if (host.directoryExists && host.getDirectories) { - var typeRoots = getEffectiveTypeRoots(options, host); - if (typeRoots) { - for (var _i = 0, typeRoots_1 = typeRoots; _i < typeRoots_1.length; _i++) { - var root = typeRoots_1[_i]; - if (host.directoryExists(root)) { - for (var _a = 0, _b = host.getDirectories(root); _a < _b.length; _a++) { - var typeDirectivePath = _b[_a]; - var normalized = ts.normalizePath(typeDirectivePath); - var packageJsonPath = pathToPackageJson(ts.combinePaths(root, normalized)); - var isNotNeededPackage = host.fileExists(packageJsonPath) && readJson(packageJsonPath, host).typings === null; - if (!isNotNeededPackage) { - result.push(ts.getBaseFileName(normalized)); - } - } - } - } - } - } - return result; - } - ts.getAutomaticTypeDirectiveNames = getAutomaticTypeDirectiveNames; - function resolveModuleName(moduleName, containingFile, compilerOptions, host) { - var traceEnabled = isTraceEnabled(compilerOptions, host); - if (traceEnabled) { - trace(host, ts.Diagnostics.Resolving_module_0_from_1, moduleName, containingFile); - } - var moduleResolution = compilerOptions.moduleResolution; - if (moduleResolution === undefined) { - moduleResolution = ts.getEmitModuleKind(compilerOptions) === ts.ModuleKind.CommonJS ? ts.ModuleResolutionKind.NodeJs : ts.ModuleResolutionKind.Classic; - if (traceEnabled) { - trace(host, ts.Diagnostics.Module_resolution_kind_is_not_specified_using_0, ts.ModuleResolutionKind[moduleResolution]); - } - } - else { - if (traceEnabled) { - trace(host, ts.Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0, ts.ModuleResolutionKind[moduleResolution]); - } - } - var result; - switch (moduleResolution) { - case ts.ModuleResolutionKind.NodeJs: - result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host); - break; - case ts.ModuleResolutionKind.Classic: - result = classicNameResolver(moduleName, containingFile, compilerOptions, host); - break; - } - if (traceEnabled) { - if (result.resolvedModule) { - trace(host, ts.Diagnostics.Module_name_0_was_successfully_resolved_to_1, moduleName, result.resolvedModule.resolvedFileName); - } - else { - trace(host, ts.Diagnostics.Module_name_0_was_not_resolved, moduleName); - } - } - return result; - } - ts.resolveModuleName = resolveModuleName; - function tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, failedLookupLocations, state) { - if (moduleHasNonRelativeName(moduleName)) { - return tryLoadModuleUsingBaseUrl(extensions, moduleName, loader, failedLookupLocations, state); - } - else { - return tryLoadModuleUsingRootDirs(extensions, moduleName, containingDirectory, loader, failedLookupLocations, state); - } - } - function tryLoadModuleUsingRootDirs(extensions, moduleName, containingDirectory, loader, failedLookupLocations, state) { - if (!state.compilerOptions.rootDirs) { - return undefined; - } - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0, moduleName); - } - var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - var matchedRootDir; - var matchedNormalizedPrefix; - for (var _i = 0, _a = state.compilerOptions.rootDirs; _i < _a.length; _i++) { - var rootDir = _a[_i]; - var normalizedRoot = ts.normalizePath(rootDir); - if (!ts.endsWith(normalizedRoot, ts.directorySeparator)) { - normalizedRoot += ts.directorySeparator; - } - var isLongestMatchingPrefix = ts.startsWith(candidate, normalizedRoot) && - (matchedNormalizedPrefix === undefined || matchedNormalizedPrefix.length < normalizedRoot.length); - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Checking_if_0_is_the_longest_matching_prefix_for_1_2, normalizedRoot, candidate, isLongestMatchingPrefix); - } - if (isLongestMatchingPrefix) { - matchedNormalizedPrefix = normalizedRoot; - matchedRootDir = rootDir; - } - } - if (matchedNormalizedPrefix) { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Longest_matching_prefix_for_0_is_1, candidate, matchedNormalizedPrefix); - } - var suffix = candidate.substr(matchedNormalizedPrefix.length); - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2, suffix, matchedNormalizedPrefix, candidate); - } - var resolvedFileName = loader(extensions, candidate, failedLookupLocations, !directoryProbablyExists(containingDirectory, state.host), state); - if (resolvedFileName) { - return resolvedFileName; - } - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Trying_other_entries_in_rootDirs); - } - for (var _b = 0, _c = state.compilerOptions.rootDirs; _b < _c.length; _b++) { - var rootDir = _c[_b]; - if (rootDir === matchedRootDir) { - continue; - } - var candidate_1 = ts.combinePaths(ts.normalizePath(rootDir), suffix); - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2, suffix, rootDir, candidate_1); - } - var baseDirectory = ts.getDirectoryPath(candidate_1); - var resolvedFileName_1 = loader(extensions, candidate_1, failedLookupLocations, !directoryProbablyExists(baseDirectory, state.host), state); - if (resolvedFileName_1) { - return resolvedFileName_1; - } - } - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Module_resolution_using_rootDirs_has_failed); - } - } - return undefined; - } - function tryLoadModuleUsingBaseUrl(extensions, moduleName, loader, failedLookupLocations, state) { - if (!state.compilerOptions.baseUrl) { - return undefined; - } - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, state.compilerOptions.baseUrl, moduleName); - } - var matchedPattern = undefined; - if (state.compilerOptions.paths) { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, moduleName); - } - matchedPattern = ts.matchPatternOrExact(ts.getOwnKeys(state.compilerOptions.paths), moduleName); - } - if (matchedPattern) { - var matchedStar_1 = typeof matchedPattern === "string" ? undefined : ts.matchedText(matchedPattern, moduleName); - var matchedPatternText = typeof matchedPattern === "string" ? matchedPattern : ts.patternText(matchedPattern); - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Module_name_0_matched_pattern_1, moduleName, matchedPatternText); - } - return ts.forEach(state.compilerOptions.paths[matchedPatternText], function (subst) { - var path = matchedStar_1 ? subst.replace("*", matchedStar_1) : subst; - var candidate = ts.normalizePath(ts.combinePaths(state.compilerOptions.baseUrl, path)); - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path); - } - var tsExtension = ts.tryGetExtensionFromPath(candidate); - if (tsExtension !== undefined) { - var path_1 = tryFile(candidate, failedLookupLocations, false, state); - return path_1 && { path: path_1, extension: tsExtension }; - } - return loader(extensions, candidate, failedLookupLocations, !directoryProbablyExists(ts.getDirectoryPath(candidate), state.host), state); - }); - } - else { - var candidate = ts.normalizePath(ts.combinePaths(state.compilerOptions.baseUrl, moduleName)); - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Resolving_module_name_0_relative_to_base_url_1_2, moduleName, state.compilerOptions.baseUrl, candidate); - } - return loader(extensions, candidate, failedLookupLocations, !directoryProbablyExists(ts.getDirectoryPath(candidate), state.host), state); - } - } - function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host) { - var containingDirectory = ts.getDirectoryPath(containingFile); - var traceEnabled = isTraceEnabled(compilerOptions, host); - var failedLookupLocations = []; - var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; - var result = tryResolve(0) || tryResolve(1); - if (result) { - var resolved = result.resolved, isExternalLibraryImport = result.isExternalLibraryImport; - return createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations); - } - return { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; - function tryResolve(extensions) { - var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, nodeLoadModuleByRelativeName, failedLookupLocations, state); - if (resolved) { - return { resolved: resolved, isExternalLibraryImport: false }; - } - if (moduleHasNonRelativeName(moduleName)) { - if (traceEnabled) { - trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder, moduleName); - } - var resolved_1 = loadModuleFromNodeModules(extensions, moduleName, containingDirectory, failedLookupLocations, state); - return resolved_1 && { resolved: { path: realpath(resolved_1.path, host, traceEnabled), extension: resolved_1.extension }, isExternalLibraryImport: true }; - } - else { - var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, false, state); - return resolved_2 && { resolved: resolved_2, isExternalLibraryImport: false }; - } - } - } - ts.nodeModuleNameResolver = nodeModuleNameResolver; - function realpath(path, host, traceEnabled) { - if (!host.realpath) { - return path; - } - var real = ts.normalizePath(host.realpath(path)); - if (traceEnabled) { - trace(host, ts.Diagnostics.Resolving_real_path_for_0_result_1, path, real); - } - return real; - } - function nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0, candidate); - } - var resolvedFromFile = !ts.pathEndsWithDirectorySeparator(candidate) && loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); - return resolvedFromFile || loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); - } - function directoryProbablyExists(directoryName, host) { - return !host.directoryExists || host.directoryExists(directoryName); - } - ts.directoryProbablyExists = directoryProbablyExists; - function loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { - var resolvedByAddingExtension = tryAddingExtensions(candidate, extensions, failedLookupLocations, onlyRecordFailures, state); - if (resolvedByAddingExtension) { - return resolvedByAddingExtension; - } - if (ts.hasJavaScriptFileExtension(candidate)) { - var extensionless = ts.removeFileExtension(candidate); - if (state.traceEnabled) { - var extension = candidate.substring(extensionless.length); - trace(state.host, ts.Diagnostics.File_name_0_has_a_1_extension_stripping_it, candidate, extension); - } - return tryAddingExtensions(extensionless, extensions, failedLookupLocations, onlyRecordFailures, state); - } - } - function tryAddingExtensions(candidate, extensions, failedLookupLocations, onlyRecordFailures, state) { - if (!onlyRecordFailures) { - var directory = ts.getDirectoryPath(candidate); - if (directory) { - onlyRecordFailures = !directoryProbablyExists(directory, state.host); - } - } - switch (extensions) { - case 2: - return tryExtension(".d.ts", ts.Extension.Dts); - case 0: - return tryExtension(".ts", ts.Extension.Ts) || tryExtension(".tsx", ts.Extension.Tsx) || tryExtension(".d.ts", ts.Extension.Dts); - case 1: - return tryExtension(".js", ts.Extension.Js) || tryExtension(".jsx", ts.Extension.Jsx); - } - function tryExtension(ext, extension) { - var path = tryFile(candidate + ext, failedLookupLocations, onlyRecordFailures, state); - return path && { path: path, extension: extension }; - } - } - function tryFile(fileName, failedLookupLocations, onlyRecordFailures, state) { - if (!onlyRecordFailures && state.host.fileExists(fileName)) { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName); - } - return fileName; - } - else { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.File_0_does_not_exist, fileName); - } - failedLookupLocations.push(fileName); - return undefined; - } - } - function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { - var packageJsonPath = pathToPackageJson(candidate); - var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); - if (directoryExists && state.host.fileExists(packageJsonPath)) { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); - } - var typesFile = tryReadTypesSection(extensions, packageJsonPath, candidate, state); - if (typesFile) { - var onlyRecordFailures_1 = !directoryProbablyExists(ts.getDirectoryPath(typesFile), state.host); - var fromFile = tryFile(typesFile, failedLookupLocations, onlyRecordFailures_1, state); - if (fromFile) { - return resolvedFromAnyFile(fromFile); - } - var x = tryAddingExtensions(typesFile, 0, failedLookupLocations, onlyRecordFailures_1, state); - if (x) { - return x; - } - } - else { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.package_json_does_not_have_a_types_or_main_field); - } - } - } - else { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.File_0_does_not_exist, packageJsonPath); - } - failedLookupLocations.push(packageJsonPath); - } - return loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state); - } - function pathToPackageJson(directory) { - return ts.combinePaths(directory, "package.json"); - } - function loadModuleFromNodeModulesFolder(extensions, moduleName, directory, failedLookupLocations, state) { - var nodeModulesFolder = ts.combinePaths(directory, "node_modules"); - var nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, state.host); - var candidate = ts.normalizePath(ts.combinePaths(nodeModulesFolder, moduleName)); - return loadModuleFromFile(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state) || - loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state); - } - function loadModuleFromNodeModules(extensions, moduleName, directory, failedLookupLocations, state) { - return loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, false); - } - function loadModuleFromNodeModulesAtTypes(moduleName, directory, failedLookupLocations, state) { - return loadModuleFromNodeModulesWorker(2, moduleName, directory, failedLookupLocations, state, true); - } - function loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, typesOnly) { - return forEachAncestorDirectory(ts.normalizeSlashes(directory), function (ancestorDirectory) { - if (ts.getBaseFileName(ancestorDirectory) !== "node_modules") { - return loadModuleFromNodeModulesOneLevel(extensions, moduleName, ancestorDirectory, failedLookupLocations, state, typesOnly); - } - }); - } - function loadModuleFromNodeModulesOneLevel(extensions, moduleName, directory, failedLookupLocations, state, typesOnly) { - if (typesOnly === void 0) { typesOnly = false; } - var packageResult = typesOnly ? undefined : loadModuleFromNodeModulesFolder(extensions, moduleName, directory, failedLookupLocations, state); - if (packageResult) { - return packageResult; - } - if (extensions !== 1) { - return loadModuleFromNodeModulesFolder(2, ts.combinePaths("@types", moduleName), directory, failedLookupLocations, state); - } - } - function classicNameResolver(moduleName, containingFile, compilerOptions, host) { - var traceEnabled = isTraceEnabled(compilerOptions, host); - var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; - var failedLookupLocations = []; - var containingDirectory = ts.getDirectoryPath(containingFile); - var resolved = tryResolve(0) || tryResolve(1); - return createResolvedModuleWithFailedLookupLocations(resolved, false, failedLookupLocations); - function tryResolve(extensions) { - var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFile, failedLookupLocations, state); - if (resolvedUsingSettings) { - return resolvedUsingSettings; - } - if (moduleHasNonRelativeName(moduleName)) { - var resolved_3 = forEachAncestorDirectory(containingDirectory, function (directory) { - var searchName = ts.normalizePath(ts.combinePaths(directory, moduleName)); - return loadModuleFromFile(extensions, searchName, failedLookupLocations, false, state); - }); - if (resolved_3) { - return resolved_3; - } - if (extensions === 0) { - return loadModuleFromNodeModulesAtTypes(moduleName, containingDirectory, failedLookupLocations, state); - } - } - else { - var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - return loadModuleFromFile(extensions, candidate, failedLookupLocations, false, state); - } - } - } - ts.classicNameResolver = classicNameResolver; - function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, host, globalCache) { - var traceEnabled = isTraceEnabled(compilerOptions, host); - if (traceEnabled) { - trace(host, ts.Diagnostics.Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2, projectName, moduleName, globalCache); - } - var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; - var failedLookupLocations = []; - var resolved = loadModuleFromNodeModulesOneLevel(2, moduleName, globalCache, failedLookupLocations, state); - return createResolvedModuleWithFailedLookupLocations(resolved, true, failedLookupLocations); - } - ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache; - function forEachAncestorDirectory(directory, callback) { - while (true) { - var result = callback(directory); - if (result !== undefined) { - return result; - } - var parentPath = ts.getDirectoryPath(directory); - if (parentPath === directory) { - return undefined; - } - directory = parentPath; - } - } -})(ts || (ts = {})); -var ts; -(function (ts) { - ts.externalHelpersModuleNameText = "tslib"; - function getDeclarationOfKind(symbol, kind) { - var declarations = symbol.declarations; - if (declarations) { - for (var _i = 0, declarations_1 = declarations; _i < declarations_1.length; _i++) { - var declaration = declarations_1[_i]; - if (declaration.kind === kind) { - return declaration; - } - } - } - return undefined; - } - ts.getDeclarationOfKind = getDeclarationOfKind; - var stringWriters = []; - function getSingleLineStringWriter() { - if (stringWriters.length === 0) { - var str_1 = ""; - var writeText = function (text) { return str_1 += text; }; - return { - string: function () { return str_1; }, - writeKeyword: writeText, - writeOperator: writeText, - writePunctuation: writeText, - writeSpace: writeText, - writeStringLiteral: writeText, - writeParameter: writeText, - writeSymbol: writeText, - writeLine: function () { return str_1 += " "; }, - increaseIndent: ts.noop, - decreaseIndent: ts.noop, - clear: function () { return str_1 = ""; }, - trackSymbol: ts.noop, - reportInaccessibleThisError: ts.noop - }; - } - return stringWriters.pop(); - } - ts.getSingleLineStringWriter = getSingleLineStringWriter; - function releaseStringWriter(writer) { - writer.clear(); - stringWriters.push(writer); - } - ts.releaseStringWriter = releaseStringWriter; - function getFullWidth(node) { - return node.end - node.pos; - } - ts.getFullWidth = getFullWidth; - function hasResolvedModule(sourceFile, moduleNameText) { - return !!(sourceFile && sourceFile.resolvedModules && sourceFile.resolvedModules[moduleNameText]); - } - ts.hasResolvedModule = hasResolvedModule; - function getResolvedModule(sourceFile, moduleNameText) { - return hasResolvedModule(sourceFile, moduleNameText) ? sourceFile.resolvedModules[moduleNameText] : undefined; - } - ts.getResolvedModule = getResolvedModule; - function setResolvedModule(sourceFile, moduleNameText, resolvedModule) { - if (!sourceFile.resolvedModules) { - sourceFile.resolvedModules = ts.createMap(); - } - sourceFile.resolvedModules[moduleNameText] = resolvedModule; - } - ts.setResolvedModule = setResolvedModule; - function setResolvedTypeReferenceDirective(sourceFile, typeReferenceDirectiveName, resolvedTypeReferenceDirective) { - if (!sourceFile.resolvedTypeReferenceDirectiveNames) { - sourceFile.resolvedTypeReferenceDirectiveNames = ts.createMap(); - } - sourceFile.resolvedTypeReferenceDirectiveNames[typeReferenceDirectiveName] = resolvedTypeReferenceDirective; - } - ts.setResolvedTypeReferenceDirective = setResolvedTypeReferenceDirective; - function moduleResolutionIsEqualTo(oldResolution, newResolution) { - return oldResolution.isExternalLibraryImport === newResolution.isExternalLibraryImport && - oldResolution.extension === newResolution.extension && - oldResolution.resolvedFileName === newResolution.resolvedFileName; - } - ts.moduleResolutionIsEqualTo = moduleResolutionIsEqualTo; - function typeDirectiveIsEqualTo(oldResolution, newResolution) { - return oldResolution.resolvedFileName === newResolution.resolvedFileName && oldResolution.primary === newResolution.primary; - } - ts.typeDirectiveIsEqualTo = typeDirectiveIsEqualTo; - function hasChangesInResolutions(names, newResolutions, oldResolutions, comparer) { - if (names.length !== newResolutions.length) { - return false; - } - for (var i = 0; i < names.length; i++) { - var newResolution = newResolutions[i]; - var oldResolution = oldResolutions && oldResolutions[names[i]]; - var changed = oldResolution - ? !newResolution || !comparer(oldResolution, newResolution) - : newResolution; - if (changed) { - return true; - } - } - return false; - } - ts.hasChangesInResolutions = hasChangesInResolutions; - function containsParseError(node) { - aggregateChildData(node); - return (node.flags & 4194304) !== 0; - } - ts.containsParseError = containsParseError; - function aggregateChildData(node) { - if (!(node.flags & 8388608)) { - var thisNodeOrAnySubNodesHasError = ((node.flags & 1048576) !== 0) || - ts.forEachChild(node, containsParseError); - if (thisNodeOrAnySubNodesHasError) { - node.flags |= 4194304; - } - node.flags |= 8388608; - } - } - function getSourceFileOfNode(node) { - while (node && node.kind !== 261) { - node = node.parent; - } - return node; - } - ts.getSourceFileOfNode = getSourceFileOfNode; - function isStatementWithLocals(node) { - switch (node.kind) { - case 204: - case 232: - case 211: - case 212: - case 213: - return true; - } - return false; - } - ts.isStatementWithLocals = isStatementWithLocals; - function getStartPositionOfLine(line, sourceFile) { - ts.Debug.assert(line >= 0); - return ts.getLineStarts(sourceFile)[line]; - } - ts.getStartPositionOfLine = getStartPositionOfLine; - function nodePosToString(node) { - var file = getSourceFileOfNode(node); - var loc = ts.getLineAndCharacterOfPosition(file, node.pos); - return file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + ")"; - } - ts.nodePosToString = nodePosToString; - function getStartPosOfNode(node) { - return node.pos; - } - ts.getStartPosOfNode = getStartPosOfNode; - function isDefined(value) { - return value !== undefined; - } - ts.isDefined = isDefined; - function getEndLinePosition(line, sourceFile) { - ts.Debug.assert(line >= 0); - var lineStarts = ts.getLineStarts(sourceFile); - var lineIndex = line; - var sourceText = sourceFile.text; - if (lineIndex + 1 === lineStarts.length) { - return sourceText.length - 1; - } - else { - var start = lineStarts[lineIndex]; - var pos = lineStarts[lineIndex + 1] - 1; - ts.Debug.assert(ts.isLineBreak(sourceText.charCodeAt(pos))); - while (start <= pos && ts.isLineBreak(sourceText.charCodeAt(pos))) { - pos--; - } - return pos; - } - } - ts.getEndLinePosition = getEndLinePosition; - function nodeIsMissing(node) { - if (node === undefined) { - return true; - } - return node.pos === node.end && node.pos >= 0 && node.kind !== 1; - } - ts.nodeIsMissing = nodeIsMissing; - function nodeIsPresent(node) { - return !nodeIsMissing(node); - } - ts.nodeIsPresent = nodeIsPresent; - function getTokenPosOfNode(node, sourceFile, includeJsDoc) { - if (nodeIsMissing(node)) { - return node.pos; - } - if (isJSDocNode(node)) { - return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos, false, true); - } - if (includeJsDoc && node.jsDoc && node.jsDoc.length > 0) { - return getTokenPosOfNode(node.jsDoc[0]); - } - if (node.kind === 292 && node._children.length > 0) { - return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); - } - return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); - } - ts.getTokenPosOfNode = getTokenPosOfNode; - function isJSDocNode(node) { - return node.kind >= 262 && node.kind <= 288; - } - ts.isJSDocNode = isJSDocNode; - function isJSDocTag(node) { - return node.kind >= 278 && node.kind <= 291; - } - ts.isJSDocTag = isJSDocTag; - function getNonDecoratorTokenPosOfNode(node, sourceFile) { - if (nodeIsMissing(node) || !node.decorators) { - return getTokenPosOfNode(node, sourceFile); - } - return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.decorators.end); - } - ts.getNonDecoratorTokenPosOfNode = getNonDecoratorTokenPosOfNode; - function getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia) { - if (includeTrivia === void 0) { includeTrivia = false; } - if (nodeIsMissing(node)) { - return ""; - } - var text = sourceFile.text; - return text.substring(includeTrivia ? node.pos : ts.skipTrivia(text, node.pos), node.end); - } - ts.getSourceTextOfNodeFromSourceFile = getSourceTextOfNodeFromSourceFile; - function getTextOfNodeFromSourceText(sourceText, node) { - if (nodeIsMissing(node)) { - return ""; - } - return sourceText.substring(ts.skipTrivia(sourceText, node.pos), node.end); - } - ts.getTextOfNodeFromSourceText = getTextOfNodeFromSourceText; - function getTextOfNode(node, includeTrivia) { - if (includeTrivia === void 0) { includeTrivia = false; } - return getSourceTextOfNodeFromSourceFile(getSourceFileOfNode(node), node, includeTrivia); - } - ts.getTextOfNode = getTextOfNode; - function getLiteralText(node, sourceFile, languageVersion) { - if (languageVersion < 2 && (isTemplateLiteralKind(node.kind) || node.hasExtendedUnicodeEscape)) { - return getQuotedEscapedLiteralText('"', node.text, '"'); - } - if (!nodeIsSynthesized(node) && node.parent) { - var text = getSourceTextOfNodeFromSourceFile(sourceFile, node); - if (languageVersion < 2 && isBinaryOrOctalIntegerLiteral(node, text)) { - return node.text; - } - return text; - } - switch (node.kind) { - case 9: - return getQuotedEscapedLiteralText('"', node.text, '"'); - case 12: - return getQuotedEscapedLiteralText("`", node.text, "`"); - case 13: - return getQuotedEscapedLiteralText("`", node.text, "${"); - case 14: - return getQuotedEscapedLiteralText("}", node.text, "${"); - case 15: - return getQuotedEscapedLiteralText("}", node.text, "`"); - case 8: - return node.text; - } - ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for."); - } - ts.getLiteralText = getLiteralText; - function isBinaryOrOctalIntegerLiteral(node, text) { - if (node.kind === 8 && text.length > 1) { - switch (text.charCodeAt(1)) { - case 98: - case 66: - case 111: - case 79: - return true; - } - } - return false; - } - ts.isBinaryOrOctalIntegerLiteral = isBinaryOrOctalIntegerLiteral; - function getQuotedEscapedLiteralText(leftQuote, text, rightQuote) { - return leftQuote + escapeNonAsciiCharacters(escapeString(text)) + rightQuote; - } - function escapeIdentifier(identifier) { - return identifier.length >= 2 && identifier.charCodeAt(0) === 95 && identifier.charCodeAt(1) === 95 ? "_" + identifier : identifier; - } - ts.escapeIdentifier = escapeIdentifier; - function unescapeIdentifier(identifier) { - return identifier.length >= 3 && identifier.charCodeAt(0) === 95 && identifier.charCodeAt(1) === 95 && identifier.charCodeAt(2) === 95 ? identifier.substr(1) : identifier; - } - ts.unescapeIdentifier = unescapeIdentifier; - function makeIdentifierFromModuleName(moduleName) { - return ts.getBaseFileName(moduleName).replace(/^(\d)/, "_$1").replace(/\W/g, "_"); - } - ts.makeIdentifierFromModuleName = makeIdentifierFromModuleName; - function isBlockOrCatchScoped(declaration) { - return (ts.getCombinedNodeFlags(declaration) & 3) !== 0 || - isCatchClauseVariableDeclarationOrBindingElement(declaration); - } - ts.isBlockOrCatchScoped = isBlockOrCatchScoped; - function isCatchClauseVariableDeclarationOrBindingElement(declaration) { - var node = getRootDeclaration(declaration); - return node.kind === 223 && node.parent.kind === 256; - } - ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; - function isAmbientModule(node) { - return node && node.kind === 230 && - (node.name.kind === 9 || isGlobalScopeAugmentation(node)); - } - ts.isAmbientModule = isAmbientModule; - function isShorthandAmbientModuleSymbol(moduleSymbol) { - return isShorthandAmbientModule(moduleSymbol.valueDeclaration); - } - ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; - function isShorthandAmbientModule(node) { - return node.kind === 230 && (!node.body); - } - function isBlockScopedContainerTopLevel(node) { - return node.kind === 261 || - node.kind === 230 || - isFunctionLike(node); - } - ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; - function isGlobalScopeAugmentation(module) { - return !!(module.flags & 512); - } - ts.isGlobalScopeAugmentation = isGlobalScopeAugmentation; - function isExternalModuleAugmentation(node) { - if (!node || !isAmbientModule(node)) { - return false; - } - switch (node.parent.kind) { - case 261: - return ts.isExternalModule(node.parent); - case 231: - return isAmbientModule(node.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); - } - return false; - } - ts.isExternalModuleAugmentation = isExternalModuleAugmentation; - function isBlockScope(node, parentNode) { - switch (node.kind) { - case 261: - case 232: - case 256: - case 230: - case 211: - case 212: - case 213: - case 150: - case 149: - case 151: - case 152: - case 225: - case 184: - case 185: - return true; - case 204: - return parentNode && !isFunctionLike(parentNode); - } - return false; - } - ts.isBlockScope = isBlockScope; - function getEnclosingBlockScopeContainer(node) { - var current = node.parent; - while (current) { - if (isBlockScope(current, current.parent)) { - return current; - } - current = current.parent; - } - } - ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; - function declarationNameToString(name) { - return getFullWidth(name) === 0 ? "(Missing)" : getTextOfNode(name); - } - ts.declarationNameToString = declarationNameToString; - function getTextOfPropertyName(name) { - switch (name.kind) { - case 70: - return name.text; - case 9: - case 8: - return name.text; - case 142: - if (isStringOrNumericLiteral(name.expression)) { - return name.expression.text; - } - } - return undefined; - } - ts.getTextOfPropertyName = getTextOfPropertyName; - function entityNameToString(name) { - switch (name.kind) { - case 70: - return getFullWidth(name) === 0 ? unescapeIdentifier(name.text) : getTextOfNode(name); - case 141: - return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 177: - return entityNameToString(name.expression) + "." + entityNameToString(name.name); - } - } - ts.entityNameToString = entityNameToString; - function createDiagnosticForNode(node, message, arg0, arg1, arg2) { - var sourceFile = getSourceFileOfNode(node); - return createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2); - } - ts.createDiagnosticForNode = createDiagnosticForNode; - function createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2) { - var span = getErrorSpanForNode(sourceFile, node); - return ts.createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2); - } - ts.createDiagnosticForNodeInSourceFile = createDiagnosticForNodeInSourceFile; - function createDiagnosticForNodeFromMessageChain(node, messageChain) { - var sourceFile = getSourceFileOfNode(node); - var span = getErrorSpanForNode(sourceFile, node); - return { - file: sourceFile, - start: span.start, - length: span.length, - code: messageChain.code, - category: messageChain.category, - messageText: messageChain.next ? messageChain : messageChain.messageText - }; - } - ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; - function getSpanOfTokenAtPosition(sourceFile, pos) { - var scanner = ts.createScanner(sourceFile.languageVersion, true, sourceFile.languageVariant, sourceFile.text, undefined, pos); - scanner.scan(); - var start = scanner.getTokenPos(); - return ts.createTextSpanFromBounds(start, scanner.getTextPos()); - } - ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; - function getErrorSpanForArrowFunction(sourceFile, node) { - var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 204) { - var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; - var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; - if (startLine < endLine) { - return ts.createTextSpan(pos, getEndLinePosition(startLine, sourceFile) - pos + 1); - } - } - return ts.createTextSpanFromBounds(pos, node.end); - } - function getErrorSpanForNode(sourceFile, node) { - var errorNode = node; - switch (node.kind) { - case 261: - var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); - if (pos_1 === sourceFile.text.length) { - return ts.createTextSpan(0, 0); - } - return getSpanOfTokenAtPosition(sourceFile, pos_1); - case 223: - case 174: - case 226: - case 197: - case 227: - case 230: - case 229: - case 260: - case 225: - case 184: - case 149: - case 151: - case 152: - case 228: - errorNode = node.name; - break; - case 185: - return getErrorSpanForArrowFunction(sourceFile, node); - } - if (errorNode === undefined) { - return getSpanOfTokenAtPosition(sourceFile, node.pos); - } - var pos = nodeIsMissing(errorNode) - ? errorNode.pos - : ts.skipTrivia(sourceFile.text, errorNode.pos); - return ts.createTextSpanFromBounds(pos, errorNode.end); - } - ts.getErrorSpanForNode = getErrorSpanForNode; - function isExternalOrCommonJsModule(file) { - return (file.externalModuleIndicator || file.commonJsModuleIndicator) !== undefined; - } - ts.isExternalOrCommonJsModule = isExternalOrCommonJsModule; - function isDeclarationFile(file) { - return file.isDeclarationFile; - } - ts.isDeclarationFile = isDeclarationFile; - function isConstEnumDeclaration(node) { - return node.kind === 229 && isConst(node); - } - ts.isConstEnumDeclaration = isConstEnumDeclaration; - function isConst(node) { - return !!(ts.getCombinedNodeFlags(node) & 2) - || !!(ts.getCombinedModifierFlags(node) & 2048); - } - ts.isConst = isConst; - function isLet(node) { - return !!(ts.getCombinedNodeFlags(node) & 1); - } - ts.isLet = isLet; - function isSuperCall(n) { - return n.kind === 179 && n.expression.kind === 96; - } - ts.isSuperCall = isSuperCall; - function isPrologueDirective(node) { - return node.kind === 207 - && node.expression.kind === 9; - } - ts.isPrologueDirective = isPrologueDirective; - function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { - return ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos); - } - ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; - function getLeadingCommentRangesOfNodeFromText(node, text) { - return ts.getLeadingCommentRanges(text, node.pos); - } - ts.getLeadingCommentRangesOfNodeFromText = getLeadingCommentRangesOfNodeFromText; - function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 144 || - node.kind === 143 || - node.kind === 184 || - node.kind === 185) ? - ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : - getLeadingCommentRangesOfNodeFromText(node, text); - return ts.filter(commentRanges, function (comment) { - return text.charCodeAt(comment.pos + 1) === 42 && - text.charCodeAt(comment.pos + 2) === 42 && - text.charCodeAt(comment.pos + 3) !== 47; - }); - } - ts.getJSDocCommentRanges = getJSDocCommentRanges; - ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; - ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; - ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; - function isPartOfTypeNode(node) { - if (156 <= node.kind && node.kind <= 171) { - return true; - } - switch (node.kind) { - case 118: - case 132: - case 134: - case 121: - case 135: - case 137: - case 129: - return true; - case 104: - return node.parent.kind !== 188; - case 199: - return !isExpressionWithTypeArgumentsInClassExtendsClause(node); - case 70: - if (node.parent.kind === 141 && node.parent.right === node) { - node = node.parent; - } - else if (node.parent.kind === 177 && node.parent.name === node) { - node = node.parent; - } - ts.Debug.assert(node.kind === 70 || node.kind === 141 || node.kind === 177, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); - case 141: - case 177: - case 98: - var parent_1 = node.parent; - if (parent_1.kind === 160) { - return false; - } - if (156 <= parent_1.kind && parent_1.kind <= 171) { - return true; - } - switch (parent_1.kind) { - case 199: - return !isExpressionWithTypeArgumentsInClassExtendsClause(parent_1); - case 143: - return node === parent_1.constraint; - case 147: - case 146: - case 144: - case 223: - return node === parent_1.type; - case 225: - case 184: - case 185: - case 150: - case 149: - case 148: - case 151: - case 152: - return node === parent_1.type; - case 153: - case 154: - case 155: - return node === parent_1.type; - case 182: - return node === parent_1.type; - case 179: - case 180: - return parent_1.typeArguments && ts.indexOf(parent_1.typeArguments, node) >= 0; - case 181: - return false; - } - } - return false; - } - ts.isPartOfTypeNode = isPartOfTypeNode; - function forEachReturnStatement(body, visitor) { - return traverse(body); - function traverse(node) { - switch (node.kind) { - case 216: - return visitor(node); - case 232: - case 204: - case 208: - case 209: - case 210: - case 211: - case 212: - case 213: - case 217: - case 218: - case 253: - case 254: - case 219: - case 221: - case 256: - return ts.forEachChild(node, traverse); - } - } - } - ts.forEachReturnStatement = forEachReturnStatement; - function forEachYieldExpression(body, visitor) { - return traverse(body); - function traverse(node) { - switch (node.kind) { - case 195: - visitor(node); - var operand = node.expression; - if (operand) { - traverse(operand); - } - case 229: - case 227: - case 230: - case 228: - case 226: - case 197: - return; - default: - if (isFunctionLike(node)) { - var name_7 = node.name; - if (name_7 && name_7.kind === 142) { - traverse(name_7.expression); - return; - } - } - else if (!isPartOfTypeNode(node)) { - ts.forEachChild(node, traverse); - } - } - } - } - ts.forEachYieldExpression = forEachYieldExpression; - function isVariableLike(node) { - if (node) { - switch (node.kind) { - case 174: - case 260: - case 144: - case 257: - case 147: - case 146: - case 258: - case 223: - return true; - } - } - return false; - } - ts.isVariableLike = isVariableLike; - function isAccessor(node) { - return node && (node.kind === 151 || node.kind === 152); - } - ts.isAccessor = isAccessor; - function isClassLike(node) { - return node && (node.kind === 226 || node.kind === 197); - } - ts.isClassLike = isClassLike; - function isFunctionLike(node) { - return node && isFunctionLikeKind(node.kind); - } - ts.isFunctionLike = isFunctionLike; - function isFunctionLikeKind(kind) { - switch (kind) { - case 150: - case 184: - case 225: - case 185: - case 149: - case 148: - case 151: - case 152: - case 153: - case 154: - case 155: - case 158: - case 159: - return true; - } - return false; - } - ts.isFunctionLikeKind = isFunctionLikeKind; - function introducesArgumentsExoticObject(node) { - switch (node.kind) { - case 149: - case 148: - case 150: - case 151: - case 152: - case 225: - case 184: - return true; - } - return false; - } - ts.introducesArgumentsExoticObject = introducesArgumentsExoticObject; - function isIterationStatement(node, lookInLabeledStatements) { - switch (node.kind) { - case 211: - case 212: - case 213: - case 209: - case 210: - return true; - case 219: - return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); - } - return false; - } - ts.isIterationStatement = isIterationStatement; - function isFunctionBlock(node) { - return node && node.kind === 204 && isFunctionLike(node.parent); - } - ts.isFunctionBlock = isFunctionBlock; - function isObjectLiteralMethod(node) { - return node && node.kind === 149 && node.parent.kind === 176; - } - ts.isObjectLiteralMethod = isObjectLiteralMethod; - function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 149 && - (node.parent.kind === 176 || - node.parent.kind === 197); - } - ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; - function isIdentifierTypePredicate(predicate) { - return predicate && predicate.kind === 1; - } - ts.isIdentifierTypePredicate = isIdentifierTypePredicate; - function isThisTypePredicate(predicate) { - return predicate && predicate.kind === 0; - } - ts.isThisTypePredicate = isThisTypePredicate; - function getContainingFunction(node) { - while (true) { - node = node.parent; - if (!node || isFunctionLike(node)) { - return node; - } - } - } - ts.getContainingFunction = getContainingFunction; - function getContainingClass(node) { - while (true) { - node = node.parent; - if (!node || isClassLike(node)) { - return node; - } - } - } - ts.getContainingClass = getContainingClass; - function getThisContainer(node, includeArrowFunctions) { - while (true) { - node = node.parent; - if (!node) { - return undefined; - } - switch (node.kind) { - case 142: - if (isClassLike(node.parent.parent)) { - return node; - } - node = node.parent; - break; - case 145: - if (node.parent.kind === 144 && isClassElement(node.parent.parent)) { - node = node.parent.parent; - } - else if (isClassElement(node.parent)) { - node = node.parent; - } - break; - case 185: - if (!includeArrowFunctions) { - continue; - } - case 225: - case 184: - case 230: - case 147: - case 146: - case 149: - case 148: - case 150: - case 151: - case 152: - case 153: - case 154: - case 155: - case 229: - case 261: - return node; - } - } - } - ts.getThisContainer = getThisContainer; - function getSuperContainer(node, stopOnFunctions) { - while (true) { - node = node.parent; - if (!node) { - return node; - } - switch (node.kind) { - case 142: - node = node.parent; - break; - case 225: - case 184: - case 185: - if (!stopOnFunctions) { - continue; - } - case 147: - case 146: - case 149: - case 148: - case 150: - case 151: - case 152: - return node; - case 145: - if (node.parent.kind === 144 && isClassElement(node.parent.parent)) { - node = node.parent.parent; - } - else if (isClassElement(node.parent)) { - node = node.parent; - } - break; - } - } - } - ts.getSuperContainer = getSuperContainer; - function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 184 || func.kind === 185) { - var prev = func; - var parent_2 = func.parent; - while (parent_2.kind === 183) { - prev = parent_2; - parent_2 = parent_2.parent; - } - if (parent_2.kind === 179 && parent_2.expression === prev) { - return parent_2; - } - } - } - ts.getImmediatelyInvokedFunctionExpression = getImmediatelyInvokedFunctionExpression; - function isSuperProperty(node) { - var kind = node.kind; - return (kind === 177 || kind === 178) - && node.expression.kind === 96; - } - ts.isSuperProperty = isSuperProperty; - function getEntityNameFromTypeNode(node) { - switch (node.kind) { - case 157: - case 272: - return node.typeName; - case 199: - return isEntityNameExpression(node.expression) - ? node.expression - : undefined; - case 70: - case 141: - return node; - } - return undefined; - } - ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; - function isCallLikeExpression(node) { - switch (node.kind) { - case 179: - case 180: - case 181: - case 145: - return true; - default: - return false; - } - } - ts.isCallLikeExpression = isCallLikeExpression; - function getInvokedExpression(node) { - if (node.kind === 181) { - return node.tag; - } - return node.expression; - } - ts.getInvokedExpression = getInvokedExpression; - function nodeCanBeDecorated(node) { - switch (node.kind) { - case 226: - return true; - case 147: - return node.parent.kind === 226; - case 151: - case 152: - case 149: - return node.body !== undefined - && node.parent.kind === 226; - case 144: - return node.parent.body !== undefined - && (node.parent.kind === 150 - || node.parent.kind === 149 - || node.parent.kind === 152) - && node.parent.parent.kind === 226; - } - return false; - } - ts.nodeCanBeDecorated = nodeCanBeDecorated; - function nodeIsDecorated(node) { - return node.decorators !== undefined - && nodeCanBeDecorated(node); - } - ts.nodeIsDecorated = nodeIsDecorated; - function nodeOrChildIsDecorated(node) { - return nodeIsDecorated(node) || childIsDecorated(node); - } - ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; - function childIsDecorated(node) { - switch (node.kind) { - case 226: - return ts.forEach(node.members, nodeOrChildIsDecorated); - case 149: - case 152: - return ts.forEach(node.parameters, nodeIsDecorated); - } - } - ts.childIsDecorated = childIsDecorated; - function isJSXTagName(node) { - var parent = node.parent; - if (parent.kind === 248 || - parent.kind === 247 || - parent.kind === 249) { - return parent.tagName === node; - } - return false; - } - ts.isJSXTagName = isJSXTagName; - function isPartOfExpression(node) { - switch (node.kind) { - case 98: - case 96: - case 94: - case 100: - case 85: - case 11: - case 175: - case 176: - case 177: - case 178: - case 179: - case 180: - case 181: - case 200: - case 182: - case 201: - case 183: - case 184: - case 197: - case 185: - case 188: - case 186: - case 187: - case 190: - case 191: - case 192: - case 193: - case 196: - case 194: - case 12: - case 198: - case 246: - case 247: - case 195: - case 189: - return true; - case 141: - while (node.parent.kind === 141) { - node = node.parent; - } - return node.parent.kind === 160 || isJSXTagName(node); - case 70: - if (node.parent.kind === 160 || isJSXTagName(node)) { - return true; - } - case 8: - case 9: - case 98: - var parent_3 = node.parent; - switch (parent_3.kind) { - case 223: - case 144: - case 147: - case 146: - case 260: - case 257: - case 174: - return parent_3.initializer === node; - case 207: - case 208: - case 209: - case 210: - case 216: - case 217: - case 218: - case 253: - case 220: - case 218: - return parent_3.expression === node; - case 211: - var forStatement = parent_3; - return (forStatement.initializer === node && forStatement.initializer.kind !== 224) || - forStatement.condition === node || - forStatement.incrementor === node; - case 212: - case 213: - var forInStatement = parent_3; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 224) || - forInStatement.expression === node; - case 182: - case 200: - return node === parent_3.expression; - case 202: - return node === parent_3.expression; - case 142: - return node === parent_3.expression; - case 145: - case 252: - case 251: - case 259: - return true; - case 199: - return parent_3.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent_3); - default: - if (isPartOfExpression(parent_3)) { - return true; - } - } - } - return false; - } - ts.isPartOfExpression = isPartOfExpression; - function isInstantiatedModule(node, preserveConstEnums) { - var moduleState = ts.getModuleInstanceState(node); - return moduleState === 1 || - (preserveConstEnums && moduleState === 2); - } - ts.isInstantiatedModule = isInstantiatedModule; - function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 234 && node.moduleReference.kind === 245; - } - ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; - function getExternalModuleImportEqualsDeclarationExpression(node) { - ts.Debug.assert(isExternalModuleImportEqualsDeclaration(node)); - return node.moduleReference.expression; - } - ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; - function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 234 && node.moduleReference.kind !== 245; - } - ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; - function isSourceFileJavaScript(file) { - return isInJavaScriptFile(file); - } - ts.isSourceFileJavaScript = isSourceFileJavaScript; - function isInJavaScriptFile(node) { - return node && !!(node.flags & 2097152); - } - ts.isInJavaScriptFile = isInJavaScriptFile; - function isRequireCall(expression, checkArgumentIsStringLiteral) { - var isRequire = expression.kind === 179 && - expression.expression.kind === 70 && - expression.expression.text === "require" && - expression.arguments.length === 1; - return isRequire && (!checkArgumentIsStringLiteral || expression.arguments[0].kind === 9); - } - ts.isRequireCall = isRequireCall; - function isSingleOrDoubleQuote(charCode) { - return charCode === 39 || charCode === 34; - } - ts.isSingleOrDoubleQuote = isSingleOrDoubleQuote; - function isDeclarationOfFunctionExpression(s) { - if (s.valueDeclaration && s.valueDeclaration.kind === 223) { - var declaration = s.valueDeclaration; - return declaration.initializer && declaration.initializer.kind === 184; - } - return false; - } - ts.isDeclarationOfFunctionExpression = isDeclarationOfFunctionExpression; - function getSpecialPropertyAssignmentKind(expression) { - if (!isInJavaScriptFile(expression)) { - return 0; - } - if (expression.kind !== 192) { - return 0; - } - var expr = expression; - if (expr.operatorToken.kind !== 57 || expr.left.kind !== 177) { - return 0; - } - var lhs = expr.left; - if (lhs.expression.kind === 70) { - var lhsId = lhs.expression; - if (lhsId.text === "exports") { - return 1; - } - else if (lhsId.text === "module" && lhs.name.text === "exports") { - return 2; - } - } - else if (lhs.expression.kind === 98) { - return 4; - } - else if (lhs.expression.kind === 177) { - var innerPropertyAccess = lhs.expression; - if (innerPropertyAccess.expression.kind === 70) { - var innerPropertyAccessIdentifier = innerPropertyAccess.expression; - if (innerPropertyAccessIdentifier.text === "module" && innerPropertyAccess.name.text === "exports") { - return 1; - } - if (innerPropertyAccess.name.text === "prototype") { - return 3; - } - } - } - return 0; - } - ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind; - function getExternalModuleName(node) { - if (node.kind === 235) { - return node.moduleSpecifier; - } - if (node.kind === 234) { - var reference = node.moduleReference; - if (reference.kind === 245) { - return reference.expression; - } - } - if (node.kind === 241) { - return node.moduleSpecifier; - } - if (node.kind === 230 && node.name.kind === 9) { - return node.name; - } - } - ts.getExternalModuleName = getExternalModuleName; - function getNamespaceDeclarationNode(node) { - if (node.kind === 234) { - return node; - } - var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 237) { - return importClause.namedBindings; - } - } - ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; - function isDefaultImport(node) { - return node.kind === 235 - && node.importClause - && !!node.importClause.name; - } - ts.isDefaultImport = isDefaultImport; - function hasQuestionToken(node) { - if (node) { - switch (node.kind) { - case 144: - case 149: - case 148: - case 258: - case 257: - case 147: - case 146: - return node.questionToken !== undefined; - } - } - return false; - } - ts.hasQuestionToken = hasQuestionToken; - function isJSDocConstructSignature(node) { - return node.kind === 274 && - node.parameters.length > 0 && - node.parameters[0].type.kind === 276; - } - ts.isJSDocConstructSignature = isJSDocConstructSignature; - function getCommentsFromJSDoc(node) { - return ts.map(getJSDocs(node), function (doc) { return doc.comment; }); - } - ts.getCommentsFromJSDoc = getCommentsFromJSDoc; - function getJSDocTags(node, kind) { - var docs = getJSDocs(node); - if (docs) { - var result = []; - for (var _i = 0, docs_1 = docs; _i < docs_1.length; _i++) { - var doc = docs_1[_i]; - if (doc.kind === 281) { - if (doc.kind === kind) { - result.push(doc); - } - } - else { - result.push.apply(result, ts.filter(doc.tags, function (tag) { return tag.kind === kind; })); - } - } - return result; - } - } - function getFirstJSDocTag(node, kind) { - return node && ts.firstOrUndefined(getJSDocTags(node, kind)); - } - function getJSDocs(node) { - var cache = node.jsDocCache; - if (!cache) { - getJSDocsWorker(node); - node.jsDocCache = cache; - } - return cache; - function getJSDocsWorker(node) { - var parent = node.parent; - var isInitializerOfVariableDeclarationInStatement = isVariableLike(parent) && - parent.initializer === node && - parent.parent.parent.kind === 205; - var isVariableOfVariableDeclarationStatement = isVariableLike(node) && - parent.parent.kind === 205; - var variableStatementNode = isInitializerOfVariableDeclarationInStatement ? parent.parent.parent : - isVariableOfVariableDeclarationStatement ? parent.parent : - undefined; - if (variableStatementNode) { - getJSDocsWorker(variableStatementNode); - } - var isSourceOfAssignmentExpressionStatement = parent && parent.parent && - parent.kind === 192 && - parent.operatorToken.kind === 57 && - parent.parent.kind === 207; - if (isSourceOfAssignmentExpressionStatement) { - getJSDocsWorker(parent.parent); - } - var isModuleDeclaration = node.kind === 230 && - parent && parent.kind === 230; - var isPropertyAssignmentExpression = parent && parent.kind === 257; - if (isModuleDeclaration || isPropertyAssignmentExpression) { - getJSDocsWorker(parent); - } - if (node.kind === 144) { - cache = ts.concatenate(cache, getJSDocParameterTags(node)); - } - if (isVariableLike(node) && node.initializer) { - cache = ts.concatenate(cache, node.initializer.jsDoc); - } - cache = ts.concatenate(cache, node.jsDoc); - } - } - function getJSDocParameterTags(param) { - if (!isParameter(param)) { - return undefined; - } - var func = param.parent; - var tags = getJSDocTags(func, 281); - if (!param.name) { - var i = func.parameters.indexOf(param); - var paramTags = ts.filter(tags, function (tag) { return tag.kind === 281; }); - if (paramTags && 0 <= i && i < paramTags.length) { - return [paramTags[i]]; - } - } - else if (param.name.kind === 70) { - var name_8 = param.name.text; - return ts.filter(tags, function (tag) { return tag.kind === 281 && tag.parameterName.text === name_8; }); - } - else { - return undefined; - } - } - ts.getJSDocParameterTags = getJSDocParameterTags; - function getJSDocType(node) { - var tag = getFirstJSDocTag(node, 283); - if (!tag && node.kind === 144) { - var paramTags = getJSDocParameterTags(node); - if (paramTags) { - tag = ts.find(paramTags, function (tag) { return !!tag.typeExpression; }); - } - } - return tag && tag.typeExpression && tag.typeExpression.type; - } - ts.getJSDocType = getJSDocType; - function getJSDocAugmentsTag(node) { - return getFirstJSDocTag(node, 280); - } - ts.getJSDocAugmentsTag = getJSDocAugmentsTag; - function getJSDocReturnTag(node) { - return getFirstJSDocTag(node, 282); - } - ts.getJSDocReturnTag = getJSDocReturnTag; - function getJSDocTemplateTag(node) { - return getFirstJSDocTag(node, 284); - } - ts.getJSDocTemplateTag = getJSDocTemplateTag; - function hasRestParameter(s) { - return isRestParameter(ts.lastOrUndefined(s.parameters)); - } - ts.hasRestParameter = hasRestParameter; - function hasDeclaredRestParameter(s) { - return isDeclaredRestParam(ts.lastOrUndefined(s.parameters)); - } - ts.hasDeclaredRestParameter = hasDeclaredRestParameter; - function isRestParameter(node) { - if (node && (node.flags & 2097152)) { - if (node.type && node.type.kind === 275 || - ts.forEach(getJSDocParameterTags(node), function (t) { return t.typeExpression && t.typeExpression.type.kind === 275; })) { - return true; - } - } - return isDeclaredRestParam(node); - } - ts.isRestParameter = isRestParameter; - function isDeclaredRestParam(node) { - return node && node.dotDotDotToken !== undefined; - } - ts.isDeclaredRestParam = isDeclaredRestParam; - function getAssignmentTargetKind(node) { - var parent = node.parent; - while (true) { - switch (parent.kind) { - case 192: - var binaryOperator = parent.operatorToken.kind; - return isAssignmentOperator(binaryOperator) && parent.left === node ? - binaryOperator === 57 ? 1 : 2 : - 0; - case 190: - case 191: - var unaryOperator = parent.operator; - return unaryOperator === 42 || unaryOperator === 43 ? 2 : 0; - case 212: - case 213: - return parent.initializer === node ? 1 : 0; - case 183: - case 175: - case 196: - node = parent; - break; - case 258: - if (parent.name !== node) { - return 0; - } - case 257: - node = parent.parent; - break; - default: - return 0; - } - parent = node.parent; - } - } - ts.getAssignmentTargetKind = getAssignmentTargetKind; - function isAssignmentTarget(node) { - return getAssignmentTargetKind(node) !== 0; - } - ts.isAssignmentTarget = isAssignmentTarget; - function isNodeDescendantOf(node, ancestor) { - while (node) { - if (node === ancestor) - return true; - node = node.parent; - } - return false; - } - ts.isNodeDescendantOf = isNodeDescendantOf; - function isInAmbientContext(node) { - while (node) { - if (hasModifier(node, 2) || (node.kind === 261 && node.isDeclarationFile)) { - return true; - } - node = node.parent; - } - return false; - } - ts.isInAmbientContext = isInAmbientContext; - function isDeclarationName(name) { - if (name.kind !== 70 && name.kind !== 9 && name.kind !== 8) { - return false; - } - var parent = name.parent; - if (parent.kind === 239 || parent.kind === 243) { - if (parent.propertyName) { - return true; - } - } - if (isDeclaration(parent)) { - return parent.name === name; - } - return false; - } - ts.isDeclarationName = isDeclarationName; - function isLiteralComputedPropertyDeclarationName(node) { - return (node.kind === 9 || node.kind === 8) && - node.parent.kind === 142 && - isDeclaration(node.parent.parent); - } - ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; - function isIdentifierName(node) { - var parent = node.parent; - switch (parent.kind) { - case 147: - case 146: - case 149: - case 148: - case 151: - case 152: - case 260: - case 257: - case 177: - return parent.name === node; - case 141: - if (parent.right === node) { - while (parent.kind === 141) { - parent = parent.parent; - } - return parent.kind === 160; - } - return false; - case 174: - case 239: - return parent.propertyName === node; - case 243: - return true; - } - return false; - } - ts.isIdentifierName = isIdentifierName; - function isAliasSymbolDeclaration(node) { - return node.kind === 234 || - node.kind === 233 || - node.kind === 236 && !!node.name || - node.kind === 237 || - node.kind === 239 || - node.kind === 243 || - node.kind === 240 && exportAssignmentIsAlias(node); - } - ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; - function exportAssignmentIsAlias(node) { - return isEntityNameExpression(node.expression); - } - ts.exportAssignmentIsAlias = exportAssignmentIsAlias; - function getClassExtendsHeritageClauseElement(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 84); - return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : undefined; - } - ts.getClassExtendsHeritageClauseElement = getClassExtendsHeritageClauseElement; - function getClassImplementsHeritageClauseElements(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 107); - return heritageClause ? heritageClause.types : undefined; - } - ts.getClassImplementsHeritageClauseElements = getClassImplementsHeritageClauseElements; - function getInterfaceBaseTypeNodes(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 84); - return heritageClause ? heritageClause.types : undefined; - } - ts.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes; - function getHeritageClause(clauses, kind) { - if (clauses) { - for (var _i = 0, clauses_1 = clauses; _i < clauses_1.length; _i++) { - var clause = clauses_1[_i]; - if (clause.token === kind) { - return clause; - } - } - } - return undefined; - } - ts.getHeritageClause = getHeritageClause; - function tryResolveScriptReference(host, sourceFile, reference) { - if (!host.getCompilerOptions().noResolve) { - var referenceFileName = ts.isRootedDiskPath(reference.fileName) ? reference.fileName : ts.combinePaths(ts.getDirectoryPath(sourceFile.fileName), reference.fileName); - return host.getSourceFile(referenceFileName); - } - } - ts.tryResolveScriptReference = tryResolveScriptReference; - function getAncestor(node, kind) { - while (node) { - if (node.kind === kind) { - return node; - } - node = node.parent; - } - return undefined; - } - ts.getAncestor = getAncestor; - function getFileReferenceFromReferencePath(comment, commentRange) { - var simpleReferenceRegEx = /^\/\/\/\s*/gim; - if (simpleReferenceRegEx.test(comment)) { - if (isNoDefaultLibRegEx.test(comment)) { - return { - isNoDefaultLib: true - }; - } - else { - var refMatchResult = ts.fullTripleSlashReferencePathRegEx.exec(comment); - var refLibResult = !refMatchResult && ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx.exec(comment); - if (refMatchResult || refLibResult) { - var start = commentRange.pos; - var end = commentRange.end; - return { - fileReference: { - pos: start, - end: end, - fileName: (refMatchResult || refLibResult)[3] - }, - isNoDefaultLib: false, - isTypeReferenceDirective: !!refLibResult - }; - } - return { - diagnosticMessage: ts.Diagnostics.Invalid_reference_directive_syntax, - isNoDefaultLib: false - }; - } - } - return undefined; - } - ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; - function isKeyword(token) { - return 71 <= token && token <= 140; - } - ts.isKeyword = isKeyword; - function isTrivia(token) { - return 2 <= token && token <= 7; - } - ts.isTrivia = isTrivia; - function isAsyncFunctionLike(node) { - return isFunctionLike(node) && hasModifier(node, 256) && !isAccessor(node); - } - ts.isAsyncFunctionLike = isAsyncFunctionLike; - function isStringOrNumericLiteral(node) { - var kind = node.kind; - return kind === 9 - || kind === 8; - } - ts.isStringOrNumericLiteral = isStringOrNumericLiteral; - function hasDynamicName(declaration) { - return declaration.name && isDynamicName(declaration.name); - } - ts.hasDynamicName = hasDynamicName; - function isDynamicName(name) { - return name.kind === 142 && - !isStringOrNumericLiteral(name.expression) && - !isWellKnownSymbolSyntactically(name.expression); - } - ts.isDynamicName = isDynamicName; - function isWellKnownSymbolSyntactically(node) { - return isPropertyAccessExpression(node) && isESSymbolIdentifier(node.expression); - } - ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically; - function getPropertyNameForPropertyNameNode(name) { - if (name.kind === 70 || name.kind === 9 || name.kind === 8 || name.kind === 144) { - return name.text; - } - if (name.kind === 142) { - var nameExpression = name.expression; - if (isWellKnownSymbolSyntactically(nameExpression)) { - var rightHandSideName = nameExpression.name.text; - return getPropertyNameForKnownSymbolName(rightHandSideName); - } - else if (nameExpression.kind === 9 || nameExpression.kind === 8) { - return nameExpression.text; - } - } - return undefined; - } - ts.getPropertyNameForPropertyNameNode = getPropertyNameForPropertyNameNode; - function getPropertyNameForKnownSymbolName(symbolName) { - return "__@" + symbolName; - } - ts.getPropertyNameForKnownSymbolName = getPropertyNameForKnownSymbolName; - function isESSymbolIdentifier(node) { - return node.kind === 70 && node.text === "Symbol"; - } - ts.isESSymbolIdentifier = isESSymbolIdentifier; - function isPushOrUnshiftIdentifier(node) { - return node.text === "push" || node.text === "unshift"; - } - ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; - function isModifierKind(token) { - switch (token) { - case 116: - case 119: - case 75: - case 123: - case 78: - case 83: - case 113: - case 111: - case 112: - case 130: - case 114: - return true; - } - return false; - } - ts.isModifierKind = isModifierKind; - function isParameterDeclaration(node) { - var root = getRootDeclaration(node); - return root.kind === 144; - } - ts.isParameterDeclaration = isParameterDeclaration; - function getRootDeclaration(node) { - while (node.kind === 174) { - node = node.parent.parent; - } - return node; - } - ts.getRootDeclaration = getRootDeclaration; - function nodeStartsNewLexicalEnvironment(node) { - var kind = node.kind; - return kind === 150 - || kind === 184 - || kind === 225 - || kind === 185 - || kind === 149 - || kind === 151 - || kind === 152 - || kind === 230 - || kind === 261; - } - ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; - function nodeIsSynthesized(node) { - return ts.positionIsSynthesized(node.pos) - || ts.positionIsSynthesized(node.end); - } - ts.nodeIsSynthesized = nodeIsSynthesized; - function getOriginalNode(node, nodeTest) { - if (node) { - while (node.original !== undefined) { - node = node.original; - } - } - return !nodeTest || nodeTest(node) ? node : undefined; - } - ts.getOriginalNode = getOriginalNode; - function isParseTreeNode(node) { - return (node.flags & 8) === 0; - } - ts.isParseTreeNode = isParseTreeNode; - function getParseTreeNode(node, nodeTest) { - if (isParseTreeNode(node)) { - return node; - } - node = getOriginalNode(node); - if (isParseTreeNode(node) && (!nodeTest || nodeTest(node))) { - return node; - } - return undefined; - } - ts.getParseTreeNode = getParseTreeNode; - function getOriginalSourceFiles(sourceFiles) { - var originalSourceFiles = []; - for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { - var sourceFile = sourceFiles_1[_i]; - var originalSourceFile = getParseTreeNode(sourceFile, isSourceFile); - if (originalSourceFile) { - originalSourceFiles.push(originalSourceFile); - } - } - return originalSourceFiles; - } - ts.getOriginalSourceFiles = getOriginalSourceFiles; - function getOriginalNodeId(node) { - node = getOriginalNode(node); - return node ? ts.getNodeId(node) : 0; - } - ts.getOriginalNodeId = getOriginalNodeId; - function getExpressionAssociativity(expression) { - var operator = getOperator(expression); - var hasArguments = expression.kind === 180 && expression.arguments !== undefined; - return getOperatorAssociativity(expression.kind, operator, hasArguments); - } - ts.getExpressionAssociativity = getExpressionAssociativity; - function getOperatorAssociativity(kind, operator, hasArguments) { - switch (kind) { - case 180: - return hasArguments ? 0 : 1; - case 190: - case 187: - case 188: - case 186: - case 189: - case 193: - case 195: - return 1; - case 192: - switch (operator) { - case 39: - case 57: - case 58: - case 59: - case 61: - case 60: - case 62: - case 63: - case 64: - case 65: - case 66: - case 67: - case 69: - case 68: - return 1; - } - } - return 0; - } - ts.getOperatorAssociativity = getOperatorAssociativity; - function getExpressionPrecedence(expression) { - var operator = getOperator(expression); - var hasArguments = expression.kind === 180 && expression.arguments !== undefined; - return getOperatorPrecedence(expression.kind, operator, hasArguments); - } - ts.getExpressionPrecedence = getExpressionPrecedence; - function getOperator(expression) { - if (expression.kind === 192) { - return expression.operatorToken.kind; - } - else if (expression.kind === 190 || expression.kind === 191) { - return expression.operator; - } - else { - return expression.kind; - } - } - ts.getOperator = getOperator; - function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { - switch (nodeKind) { - case 98: - case 96: - case 70: - case 94: - case 100: - case 85: - case 8: - case 9: - case 175: - case 176: - case 184: - case 185: - case 197: - case 246: - case 247: - case 11: - case 12: - case 194: - case 183: - case 198: - case 297: - return 19; - case 181: - case 177: - case 178: - return 18; - case 180: - return hasArguments ? 18 : 17; - case 179: - return 17; - case 191: - return 16; - case 190: - case 187: - case 188: - case 186: - case 189: - return 15; - case 192: - switch (operatorKind) { - case 50: - case 51: - return 15; - case 39: - case 38: - case 40: - case 41: - return 14; - case 36: - case 37: - return 13; - case 44: - case 45: - case 46: - return 12; - case 26: - case 29: - case 28: - case 30: - case 91: - case 92: - return 11; - case 31: - case 33: - case 32: - case 34: - return 10; - case 47: - return 9; - case 49: - return 8; - case 48: - return 7; - case 52: - return 6; - case 53: - return 5; - case 57: - case 58: - case 59: - case 61: - case 60: - case 62: - case 63: - case 64: - case 65: - case 66: - case 67: - case 69: - case 68: - return 3; - case 25: - return 0; - default: - return -1; - } - case 193: - return 4; - case 195: - return 2; - case 196: - return 1; - default: - return -1; - } - } - ts.getOperatorPrecedence = getOperatorPrecedence; - function createDiagnosticCollection() { - var nonFileDiagnostics = []; - var fileDiagnostics = ts.createMap(); - var diagnosticsModified = false; - var modificationCount = 0; - return { - add: add, - getGlobalDiagnostics: getGlobalDiagnostics, - getDiagnostics: getDiagnostics, - getModificationCount: getModificationCount, - reattachFileDiagnostics: reattachFileDiagnostics - }; - function getModificationCount() { - return modificationCount; - } - function reattachFileDiagnostics(newFile) { - if (!ts.hasProperty(fileDiagnostics, newFile.fileName)) { - return; - } - for (var _i = 0, _a = fileDiagnostics[newFile.fileName]; _i < _a.length; _i++) { - var diagnostic = _a[_i]; - diagnostic.file = newFile; - } - } - function add(diagnostic) { - var diagnostics; - if (diagnostic.file) { - diagnostics = fileDiagnostics[diagnostic.file.fileName]; - if (!diagnostics) { - diagnostics = []; - fileDiagnostics[diagnostic.file.fileName] = diagnostics; - } - } - else { - diagnostics = nonFileDiagnostics; - } - diagnostics.push(diagnostic); - diagnosticsModified = true; - modificationCount++; - } - function getGlobalDiagnostics() { - sortAndDeduplicate(); - return nonFileDiagnostics; - } - function getDiagnostics(fileName) { - sortAndDeduplicate(); - if (fileName) { - return fileDiagnostics[fileName] || []; - } - var allDiagnostics = []; - function pushDiagnostic(d) { - allDiagnostics.push(d); - } - ts.forEach(nonFileDiagnostics, pushDiagnostic); - for (var key in fileDiagnostics) { - ts.forEach(fileDiagnostics[key], pushDiagnostic); - } - return ts.sortAndDeduplicateDiagnostics(allDiagnostics); - } - function sortAndDeduplicate() { - if (!diagnosticsModified) { - return; - } - diagnosticsModified = false; - nonFileDiagnostics = ts.sortAndDeduplicateDiagnostics(nonFileDiagnostics); - for (var key in fileDiagnostics) { - fileDiagnostics[key] = ts.sortAndDeduplicateDiagnostics(fileDiagnostics[key]); - } - } - } - ts.createDiagnosticCollection = createDiagnosticCollection; - var escapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; - var escapedCharsMap = ts.createMap({ - "\0": "\\0", - "\t": "\\t", - "\v": "\\v", - "\f": "\\f", - "\b": "\\b", - "\r": "\\r", - "\n": "\\n", - "\\": "\\\\", - "\"": "\\\"", - "\u2028": "\\u2028", - "\u2029": "\\u2029", - "\u0085": "\\u0085" - }); - function escapeString(s) { - s = escapedCharsRegExp.test(s) ? s.replace(escapedCharsRegExp, getReplacement) : s; - return s; - function getReplacement(c) { - return escapedCharsMap[c] || get16BitUnicodeEscapeSequence(c.charCodeAt(0)); - } - } - ts.escapeString = escapeString; - function isIntrinsicJsxName(name) { - var ch = name.substr(0, 1); - return ch.toLowerCase() === ch; - } - ts.isIntrinsicJsxName = isIntrinsicJsxName; - function get16BitUnicodeEscapeSequence(charCode) { - var hexCharCode = charCode.toString(16).toUpperCase(); - var paddedHexCode = ("0000" + hexCharCode).slice(-4); - return "\\u" + paddedHexCode; - } - var nonAsciiCharacters = /[^\u0000-\u007F]/g; - function escapeNonAsciiCharacters(s) { - return nonAsciiCharacters.test(s) ? - s.replace(nonAsciiCharacters, function (c) { return get16BitUnicodeEscapeSequence(c.charCodeAt(0)); }) : - s; - } - ts.escapeNonAsciiCharacters = escapeNonAsciiCharacters; - var indentStrings = ["", " "]; - function getIndentString(level) { - if (indentStrings[level] === undefined) { - indentStrings[level] = getIndentString(level - 1) + indentStrings[1]; - } - return indentStrings[level]; - } - ts.getIndentString = getIndentString; - function getIndentSize() { - return indentStrings[1].length; - } - ts.getIndentSize = getIndentSize; - function createTextWriter(newLine) { - var output; - var indent; - var lineStart; - var lineCount; - var linePos; - function write(s) { - if (s && s.length) { - if (lineStart) { - output += getIndentString(indent); - lineStart = false; - } - output += s; - } - } - function reset() { - output = ""; - indent = 0; - lineStart = true; - lineCount = 0; - linePos = 0; - } - function rawWrite(s) { - if (s !== undefined) { - if (lineStart) { - lineStart = false; - } - output += s; - } - } - function writeLiteral(s) { - if (s && s.length) { - write(s); - var lineStartsOfS = ts.computeLineStarts(s); - if (lineStartsOfS.length > 1) { - lineCount = lineCount + lineStartsOfS.length - 1; - linePos = output.length - s.length + ts.lastOrUndefined(lineStartsOfS); - } - } - } - function writeLine() { - if (!lineStart) { - output += newLine; - lineCount++; - linePos = output.length; - lineStart = true; - } - } - function writeTextOfNode(text, node) { - write(getTextOfNodeFromSourceText(text, node)); - } - reset(); - return { - write: write, - rawWrite: rawWrite, - writeTextOfNode: writeTextOfNode, - writeLiteral: writeLiteral, - writeLine: writeLine, - increaseIndent: function () { indent++; }, - decreaseIndent: function () { indent--; }, - getIndent: function () { return indent; }, - getTextPos: function () { return output.length; }, - getLine: function () { return lineCount + 1; }, - getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, - getText: function () { return output; }, - isAtStartOfLine: function () { return lineStart; }, - reset: reset - }; - } - ts.createTextWriter = createTextWriter; - function getResolvedExternalModuleName(host, file) { - return file.moduleName || getExternalModuleNameFromPath(host, file.fileName); - } - ts.getResolvedExternalModuleName = getResolvedExternalModuleName; - function getExternalModuleNameFromDeclaration(host, resolver, declaration) { - var file = resolver.getExternalModuleFileFromDeclaration(declaration); - if (!file || isDeclarationFile(file)) { - return undefined; - } - return getResolvedExternalModuleName(host, file); - } - ts.getExternalModuleNameFromDeclaration = getExternalModuleNameFromDeclaration; - function getExternalModuleNameFromPath(host, fileName) { - var getCanonicalFileName = function (f) { return host.getCanonicalFileName(f); }; - var dir = ts.toPath(host.getCommonSourceDirectory(), host.getCurrentDirectory(), getCanonicalFileName); - var filePath = ts.getNormalizedAbsolutePath(fileName, host.getCurrentDirectory()); - var relativePath = ts.getRelativePathToDirectoryOrUrl(dir, filePath, dir, getCanonicalFileName, false); - return ts.removeFileExtension(relativePath); - } - ts.getExternalModuleNameFromPath = getExternalModuleNameFromPath; - function getOwnEmitOutputFilePath(sourceFile, host, extension) { - var compilerOptions = host.getCompilerOptions(); - var emitOutputFilePathWithoutExtension; - if (compilerOptions.outDir) { - emitOutputFilePathWithoutExtension = ts.removeFileExtension(getSourceFilePathInNewDir(sourceFile, host, compilerOptions.outDir)); - } - else { - emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.fileName); - } - return emitOutputFilePathWithoutExtension + extension; - } - ts.getOwnEmitOutputFilePath = getOwnEmitOutputFilePath; - function getDeclarationEmitOutputFilePath(sourceFile, host) { - var options = host.getCompilerOptions(); - var outputDir = options.declarationDir || options.outDir; - var path = outputDir - ? getSourceFilePathInNewDir(sourceFile, host, outputDir) - : sourceFile.fileName; - return ts.removeFileExtension(path) + ".d.ts"; - } - ts.getDeclarationEmitOutputFilePath = getDeclarationEmitOutputFilePath; - function getSourceFilesToEmit(host, targetSourceFile) { - var options = host.getCompilerOptions(); - if (options.outFile || options.out) { - var moduleKind = ts.getEmitModuleKind(options); - var moduleEmitEnabled = moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System; - var sourceFiles = getAllEmittableSourceFiles(); - return ts.filter(sourceFiles, moduleEmitEnabled ? isNonDeclarationFile : isBundleEmitNonExternalModule); - } - else { - var sourceFiles = targetSourceFile === undefined ? getAllEmittableSourceFiles() : [targetSourceFile]; - return filterSourceFilesInDirectory(sourceFiles, function (file) { return host.isSourceFileFromExternalLibrary(file); }); - } - function getAllEmittableSourceFiles() { - return options.noEmitForJsFiles ? ts.filter(host.getSourceFiles(), function (sourceFile) { return !isSourceFileJavaScript(sourceFile); }) : host.getSourceFiles(); - } - } - ts.getSourceFilesToEmit = getSourceFilesToEmit; - function filterSourceFilesInDirectory(sourceFiles, isSourceFileFromExternalLibrary) { - return ts.filter(sourceFiles, function (file) { return shouldEmitInDirectory(file, isSourceFileFromExternalLibrary); }); - } - ts.filterSourceFilesInDirectory = filterSourceFilesInDirectory; - function isNonDeclarationFile(sourceFile) { - return !isDeclarationFile(sourceFile); - } - function shouldEmitInDirectory(sourceFile, isSourceFileFromExternalLibrary) { - return isNonDeclarationFile(sourceFile) && !isSourceFileFromExternalLibrary(sourceFile); - } - function isBundleEmitNonExternalModule(sourceFile) { - return isNonDeclarationFile(sourceFile) && !ts.isExternalModule(sourceFile); - } - function forEachTransformedEmitFile(host, sourceFiles, action, emitOnlyDtsFiles) { - var options = host.getCompilerOptions(); - if (options.outFile || options.out) { - onBundledEmit(sourceFiles); - } - else { - for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) { - var sourceFile = sourceFiles_2[_i]; - if (!isDeclarationFile(sourceFile) && !host.isSourceFileFromExternalLibrary(sourceFile)) { - onSingleFileEmit(host, sourceFile); - } - } - } - function onSingleFileEmit(host, sourceFile) { - var extension = ".js"; - if (options.jsx === 1) { - if (isSourceFileJavaScript(sourceFile)) { - if (ts.fileExtensionIs(sourceFile.fileName, ".jsx")) { - extension = ".jsx"; - } - } - else if (sourceFile.languageVariant === 1) { - extension = ".jsx"; - } - } - var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, extension); - var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); - var declarationFilePath = !isSourceFileJavaScript(sourceFile) && (options.declaration || emitOnlyDtsFiles) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; - action(jsFilePath, sourceMapFilePath, declarationFilePath, [sourceFile], false); - } - function onBundledEmit(sourceFiles) { - if (sourceFiles.length) { - var jsFilePath = options.outFile || options.out; - var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); - var declarationFilePath = options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : undefined; - action(jsFilePath, sourceMapFilePath, declarationFilePath, sourceFiles, true); - } - } - } - ts.forEachTransformedEmitFile = forEachTransformedEmitFile; - function getSourceMapFilePath(jsFilePath, options) { - return options.sourceMap ? jsFilePath + ".map" : undefined; - } - function forEachExpectedEmitFile(host, action, targetSourceFile, emitOnlyDtsFiles) { - var options = host.getCompilerOptions(); - if (options.outFile || options.out) { - onBundledEmit(host); - } - else { - var sourceFiles = targetSourceFile === undefined ? getSourceFilesToEmit(host) : [targetSourceFile]; - for (var _i = 0, sourceFiles_3 = sourceFiles; _i < sourceFiles_3.length; _i++) { - var sourceFile = sourceFiles_3[_i]; - if (shouldEmitInDirectory(sourceFile, function (file) { return host.isSourceFileFromExternalLibrary(file); })) { - onSingleFileEmit(host, sourceFile); - } - } - } - function onSingleFileEmit(host, sourceFile) { - var extension = ".js"; - if (options.jsx === 1) { - if (isSourceFileJavaScript(sourceFile)) { - if (ts.fileExtensionIs(sourceFile.fileName, ".jsx")) { - extension = ".jsx"; - } - } - else if (sourceFile.languageVariant === 1) { - extension = ".jsx"; - } - } - var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, extension); - var declarationFilePath = !isSourceFileJavaScript(sourceFile) && (emitOnlyDtsFiles || options.declaration) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; - var emitFileNames = { - jsFilePath: jsFilePath, - sourceMapFilePath: getSourceMapFilePath(jsFilePath, options), - declarationFilePath: declarationFilePath - }; - action(emitFileNames, [sourceFile], false, emitOnlyDtsFiles); - } - function onBundledEmit(host) { - var bundledSources = ts.filter(getSourceFilesToEmit(host), function (sourceFile) { return !isDeclarationFile(sourceFile) && - !host.isSourceFileFromExternalLibrary(sourceFile) && - (!ts.isExternalModule(sourceFile) || - !!ts.getEmitModuleKind(options)); }); - if (bundledSources.length) { - var jsFilePath = options.outFile || options.out; - var emitFileNames = { - jsFilePath: jsFilePath, - sourceMapFilePath: getSourceMapFilePath(jsFilePath, options), - declarationFilePath: options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : undefined - }; - action(emitFileNames, bundledSources, true, emitOnlyDtsFiles); - } - } - } - ts.forEachExpectedEmitFile = forEachExpectedEmitFile; - function getSourceFilePathInNewDir(sourceFile, host, newDirPath) { - var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory()); - var commonSourceDirectory = host.getCommonSourceDirectory(); - var isSourceFileInCommonSourceDirectory = host.getCanonicalFileName(sourceFilePath).indexOf(host.getCanonicalFileName(commonSourceDirectory)) === 0; - sourceFilePath = isSourceFileInCommonSourceDirectory ? sourceFilePath.substring(commonSourceDirectory.length) : sourceFilePath; - return ts.combinePaths(newDirPath, sourceFilePath); - } - ts.getSourceFilePathInNewDir = getSourceFilePathInNewDir; - function writeFile(host, diagnostics, fileName, data, writeByteOrderMark, sourceFiles) { - host.writeFile(fileName, data, writeByteOrderMark, function (hostErrorMessage) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); - }, sourceFiles); - } - ts.writeFile = writeFile; - function getLineOfLocalPosition(currentSourceFile, pos) { - return ts.getLineAndCharacterOfPosition(currentSourceFile, pos).line; - } - ts.getLineOfLocalPosition = getLineOfLocalPosition; - function getLineOfLocalPositionFromLineMap(lineMap, pos) { - return ts.computeLineAndCharacterOfPosition(lineMap, pos).line; - } - ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; - function getFirstConstructorWithBody(node) { - return ts.forEach(node.members, function (member) { - if (member.kind === 150 && nodeIsPresent(member.body)) { - return member; - } - }); - } - ts.getFirstConstructorWithBody = getFirstConstructorWithBody; - function getSetAccessorTypeAnnotationNode(accessor) { - if (accessor && accessor.parameters.length > 0) { - var hasThis = accessor.parameters.length === 2 && parameterIsThisKeyword(accessor.parameters[0]); - return accessor.parameters[hasThis ? 1 : 0].type; - } - } - ts.getSetAccessorTypeAnnotationNode = getSetAccessorTypeAnnotationNode; - function getThisParameter(signature) { - if (signature.parameters.length) { - var thisParameter = signature.parameters[0]; - if (parameterIsThisKeyword(thisParameter)) { - return thisParameter; - } - } - } - ts.getThisParameter = getThisParameter; - function parameterIsThisKeyword(parameter) { - return isThisIdentifier(parameter.name); - } - ts.parameterIsThisKeyword = parameterIsThisKeyword; - function isThisIdentifier(node) { - return node && node.kind === 70 && identifierIsThisKeyword(node); - } - ts.isThisIdentifier = isThisIdentifier; - function identifierIsThisKeyword(id) { - return id.originalKeywordKind === 98; - } - ts.identifierIsThisKeyword = identifierIsThisKeyword; - function getAllAccessorDeclarations(declarations, accessor) { - var firstAccessor; - var secondAccessor; - var getAccessor; - var setAccessor; - if (hasDynamicName(accessor)) { - firstAccessor = accessor; - if (accessor.kind === 151) { - getAccessor = accessor; - } - else if (accessor.kind === 152) { - setAccessor = accessor; - } - else { - ts.Debug.fail("Accessor has wrong kind"); - } - } - else { - ts.forEach(declarations, function (member) { - if ((member.kind === 151 || member.kind === 152) - && hasModifier(member, 32) === hasModifier(accessor, 32)) { - var memberName = getPropertyNameForPropertyNameNode(member.name); - var accessorName = getPropertyNameForPropertyNameNode(accessor.name); - if (memberName === accessorName) { - if (!firstAccessor) { - firstAccessor = member; - } - else if (!secondAccessor) { - secondAccessor = member; - } - if (member.kind === 151 && !getAccessor) { - getAccessor = member; - } - if (member.kind === 152 && !setAccessor) { - setAccessor = member; - } - } - } - }); - } - return { - firstAccessor: firstAccessor, - secondAccessor: secondAccessor, - getAccessor: getAccessor, - setAccessor: setAccessor - }; - } - ts.getAllAccessorDeclarations = getAllAccessorDeclarations; - function emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments) { - emitNewLineBeforeLeadingCommentsOfPosition(lineMap, writer, node.pos, leadingComments); - } - ts.emitNewLineBeforeLeadingComments = emitNewLineBeforeLeadingComments; - function emitNewLineBeforeLeadingCommentsOfPosition(lineMap, writer, pos, leadingComments) { - if (leadingComments && leadingComments.length && pos !== leadingComments[0].pos && - getLineOfLocalPositionFromLineMap(lineMap, pos) !== getLineOfLocalPositionFromLineMap(lineMap, leadingComments[0].pos)) { - writer.writeLine(); - } - } - ts.emitNewLineBeforeLeadingCommentsOfPosition = emitNewLineBeforeLeadingCommentsOfPosition; - function emitNewLineBeforeLeadingCommentOfPosition(lineMap, writer, pos, commentPos) { - if (pos !== commentPos && - getLineOfLocalPositionFromLineMap(lineMap, pos) !== getLineOfLocalPositionFromLineMap(lineMap, commentPos)) { - writer.writeLine(); - } - } - ts.emitNewLineBeforeLeadingCommentOfPosition = emitNewLineBeforeLeadingCommentOfPosition; - function emitComments(text, lineMap, writer, comments, leadingSeparator, trailingSeparator, newLine, writeComment) { - if (comments && comments.length > 0) { - if (leadingSeparator) { - writer.write(" "); - } - var emitInterveningSeparator = false; - for (var _i = 0, comments_1 = comments; _i < comments_1.length; _i++) { - var comment = comments_1[_i]; - if (emitInterveningSeparator) { - writer.write(" "); - emitInterveningSeparator = false; - } - writeComment(text, lineMap, writer, comment.pos, comment.end, newLine); - if (comment.hasTrailingNewLine) { - writer.writeLine(); - } - else { - emitInterveningSeparator = true; - } - } - if (emitInterveningSeparator && trailingSeparator) { - writer.write(" "); - } - } - } - ts.emitComments = emitComments; - function emitDetachedComments(text, lineMap, writer, writeComment, node, newLine, removeComments) { - var leadingComments; - var currentDetachedCommentInfo; - if (removeComments) { - if (node.pos === 0) { - leadingComments = ts.filter(ts.getLeadingCommentRanges(text, node.pos), isPinnedComment); - } - } - else { - leadingComments = ts.getLeadingCommentRanges(text, node.pos); - } - if (leadingComments) { - var detachedComments = []; - var lastComment = void 0; - for (var _i = 0, leadingComments_1 = leadingComments; _i < leadingComments_1.length; _i++) { - var comment = leadingComments_1[_i]; - if (lastComment) { - var lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, lastComment.end); - var commentLine = getLineOfLocalPositionFromLineMap(lineMap, comment.pos); - if (commentLine >= lastCommentLine + 2) { - break; - } - } - detachedComments.push(comment); - lastComment = comment; - } - if (detachedComments.length) { - var lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, ts.lastOrUndefined(detachedComments).end); - var nodeLine = getLineOfLocalPositionFromLineMap(lineMap, ts.skipTrivia(text, node.pos)); - if (nodeLine >= lastCommentLine + 2) { - emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments); - emitComments(text, lineMap, writer, detachedComments, false, true, newLine, writeComment); - currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: ts.lastOrUndefined(detachedComments).end }; - } - } - } - return currentDetachedCommentInfo; - function isPinnedComment(comment) { - return text.charCodeAt(comment.pos + 1) === 42 && - text.charCodeAt(comment.pos + 2) === 33; - } - } - ts.emitDetachedComments = emitDetachedComments; - function writeCommentRange(text, lineMap, writer, commentPos, commentEnd, newLine) { - if (text.charCodeAt(commentPos + 1) === 42) { - var firstCommentLineAndCharacter = ts.computeLineAndCharacterOfPosition(lineMap, commentPos); - var lineCount = lineMap.length; - var firstCommentLineIndent = void 0; - for (var pos = commentPos, currentLine = firstCommentLineAndCharacter.line; pos < commentEnd; currentLine++) { - var nextLineStart = (currentLine + 1) === lineCount - ? text.length + 1 - : lineMap[currentLine + 1]; - if (pos !== commentPos) { - if (firstCommentLineIndent === undefined) { - firstCommentLineIndent = calculateIndent(text, lineMap[firstCommentLineAndCharacter.line], commentPos); - } - var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); - var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(text, pos, nextLineStart); - if (spacesToEmit > 0) { - var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); - var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); - writer.rawWrite(indentSizeSpaceString); - while (numberOfSingleSpacesToEmit) { - writer.rawWrite(" "); - numberOfSingleSpacesToEmit--; - } - } - else { - writer.rawWrite(""); - } - } - writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart); - pos = nextLineStart; - } - } - else { - writer.write(text.substring(commentPos, commentEnd)); - } - } - ts.writeCommentRange = writeCommentRange; - function writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart) { - var end = Math.min(commentEnd, nextLineStart - 1); - var currentLineText = text.substring(pos, end).replace(/^\s+|\s+$/g, ""); - if (currentLineText) { - writer.write(currentLineText); - if (end !== commentEnd) { - writer.writeLine(); - } - } - else { - writer.writeLiteral(newLine); - } - } - function calculateIndent(text, pos, end) { - var currentLineIndent = 0; - for (; pos < end && ts.isWhiteSpaceSingleLine(text.charCodeAt(pos)); pos++) { - if (text.charCodeAt(pos) === 9) { - currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); - } - else { - currentLineIndent++; - } - } - return currentLineIndent; - } - function hasModifiers(node) { - return getModifierFlags(node) !== 0; - } - ts.hasModifiers = hasModifiers; - function hasModifier(node, flags) { - return (getModifierFlags(node) & flags) !== 0; - } - ts.hasModifier = hasModifier; - function getModifierFlags(node) { - if (node.modifierFlagsCache & 536870912) { - return node.modifierFlagsCache & ~536870912; - } - var flags = 0; - if (node.modifiers) { - for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { - var modifier = _a[_i]; - flags |= modifierToFlag(modifier.kind); - } - } - if (node.flags & 4 || (node.kind === 70 && node.isInJSDocNamespace)) { - flags |= 1; - } - node.modifierFlagsCache = flags | 536870912; - return flags; - } - ts.getModifierFlags = getModifierFlags; - function modifierToFlag(token) { - switch (token) { - case 114: return 32; - case 113: return 4; - case 112: return 16; - case 111: return 8; - case 116: return 128; - case 83: return 1; - case 123: return 2; - case 75: return 2048; - case 78: return 512; - case 119: return 256; - case 130: return 64; - } - return 0; - } - ts.modifierToFlag = modifierToFlag; - function isLogicalOperator(token) { - return token === 53 - || token === 52 - || token === 50; - } - ts.isLogicalOperator = isLogicalOperator; - function isAssignmentOperator(token) { - return token >= 57 && token <= 69; - } - ts.isAssignmentOperator = isAssignmentOperator; - function tryGetClassExtendingExpressionWithTypeArguments(node) { - if (node.kind === 199 && - node.parent.token === 84 && - isClassLike(node.parent.parent)) { - return node.parent.parent; - } - } - ts.tryGetClassExtendingExpressionWithTypeArguments = tryGetClassExtendingExpressionWithTypeArguments; - function isAssignmentExpression(node, excludeCompoundAssignment) { - return isBinaryExpression(node) - && (excludeCompoundAssignment - ? node.operatorToken.kind === 57 - : isAssignmentOperator(node.operatorToken.kind)) - && isLeftHandSideExpression(node.left); - } - ts.isAssignmentExpression = isAssignmentExpression; - function isDestructuringAssignment(node) { - if (isAssignmentExpression(node, true)) { - var kind = node.left.kind; - return kind === 176 - || kind === 175; - } - return false; - } - ts.isDestructuringAssignment = isDestructuringAssignment; - function isSupportedExpressionWithTypeArguments(node) { - return isSupportedExpressionWithTypeArgumentsRest(node.expression); - } - ts.isSupportedExpressionWithTypeArguments = isSupportedExpressionWithTypeArguments; - function isSupportedExpressionWithTypeArgumentsRest(node) { - if (node.kind === 70) { - return true; - } - else if (isPropertyAccessExpression(node)) { - return isSupportedExpressionWithTypeArgumentsRest(node.expression); - } - else { - return false; - } - } - function isExpressionWithTypeArgumentsInClassExtendsClause(node) { - return tryGetClassExtendingExpressionWithTypeArguments(node) !== undefined; - } - ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause; - function isEntityNameExpression(node) { - return node.kind === 70 || - node.kind === 177 && isEntityNameExpression(node.expression); - } - ts.isEntityNameExpression = isEntityNameExpression; - function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 141 && node.parent.right === node) || - (node.parent.kind === 177 && node.parent.name === node); - } - ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; - function isEmptyObjectLiteralOrArrayLiteral(expression) { - var kind = expression.kind; - if (kind === 176) { - return expression.properties.length === 0; - } - if (kind === 175) { - return expression.elements.length === 0; - } - return false; - } - ts.isEmptyObjectLiteralOrArrayLiteral = isEmptyObjectLiteralOrArrayLiteral; - function getLocalSymbolForExportDefault(symbol) { - return symbol && symbol.valueDeclaration && hasModifier(symbol.valueDeclaration, 512) ? symbol.valueDeclaration.localSymbol : undefined; - } - ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; - function tryExtractTypeScriptExtension(fileName) { - return ts.find(ts.supportedTypescriptExtensionsForExtractExtension, function (extension) { return ts.fileExtensionIs(fileName, extension); }); - } - ts.tryExtractTypeScriptExtension = tryExtractTypeScriptExtension; - function getExpandedCharCodes(input) { - var output = []; - var length = input.length; - for (var i = 0; i < length; i++) { - var charCode = input.charCodeAt(i); - if (charCode < 0x80) { - output.push(charCode); - } - else if (charCode < 0x800) { - output.push((charCode >> 6) | 192); - output.push((charCode & 63) | 128); - } - else if (charCode < 0x10000) { - output.push((charCode >> 12) | 224); - output.push(((charCode >> 6) & 63) | 128); - output.push((charCode & 63) | 128); - } - else if (charCode < 0x20000) { - output.push((charCode >> 18) | 240); - output.push(((charCode >> 12) & 63) | 128); - output.push(((charCode >> 6) & 63) | 128); - output.push((charCode & 63) | 128); - } - else { - ts.Debug.assert(false, "Unexpected code point"); - } - } - return output; - } - ts.stringify = typeof JSON !== "undefined" && JSON.stringify - ? JSON.stringify - : stringifyFallback; - function stringifyFallback(value) { - return value === undefined ? undefined : stringifyValue(value); - } - function stringifyValue(value) { - return typeof value === "string" ? "\"" + escapeString(value) + "\"" - : typeof value === "number" ? isFinite(value) ? String(value) : "null" - : typeof value === "boolean" ? value ? "true" : "false" - : typeof value === "object" && value ? ts.isArray(value) ? cycleCheck(stringifyArray, value) : cycleCheck(stringifyObject, value) - : "null"; - } - function cycleCheck(cb, value) { - ts.Debug.assert(!value.hasOwnProperty("__cycle"), "Converting circular structure to JSON"); - value.__cycle = true; - var result = cb(value); - delete value.__cycle; - return result; - } - function stringifyArray(value) { - return "[" + ts.reduceLeft(value, stringifyElement, "") + "]"; - } - function stringifyElement(memo, value) { - return (memo ? memo + "," : memo) + stringifyValue(value); - } - function stringifyObject(value) { - return "{" + ts.reduceOwnProperties(value, stringifyProperty, "") + "}"; - } - function stringifyProperty(memo, value, key) { - return value === undefined || typeof value === "function" || key === "__cycle" ? memo - : (memo ? memo + "," : memo) + ("\"" + escapeString(key) + "\":" + stringifyValue(value)); - } - var base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; - function convertToBase64(input) { - var result = ""; - var charCodes = getExpandedCharCodes(input); - var i = 0; - var length = charCodes.length; - var byte1, byte2, byte3, byte4; - while (i < length) { - byte1 = charCodes[i] >> 2; - byte2 = (charCodes[i] & 3) << 4 | charCodes[i + 1] >> 4; - byte3 = (charCodes[i + 1] & 15) << 2 | charCodes[i + 2] >> 6; - byte4 = charCodes[i + 2] & 63; - if (i + 1 >= length) { - byte3 = byte4 = 64; - } - else if (i + 2 >= length) { - byte4 = 64; - } - result += base64Digits.charAt(byte1) + base64Digits.charAt(byte2) + base64Digits.charAt(byte3) + base64Digits.charAt(byte4); - i += 3; - } - return result; - } - ts.convertToBase64 = convertToBase64; - var carriageReturnLineFeed = "\r\n"; - var lineFeed = "\n"; - function getNewLineCharacter(options) { - if (options.newLine === 0) { - return carriageReturnLineFeed; - } - else if (options.newLine === 1) { - return lineFeed; - } - else if (ts.sys) { - return ts.sys.newLine; - } - return carriageReturnLineFeed; - } - ts.getNewLineCharacter = getNewLineCharacter; - function isSimpleExpression(node) { - return isSimpleExpressionWorker(node, 0); - } - ts.isSimpleExpression = isSimpleExpression; - function isSimpleExpressionWorker(node, depth) { - if (depth <= 5) { - var kind = node.kind; - if (kind === 9 - || kind === 8 - || kind === 11 - || kind === 12 - || kind === 70 - || kind === 98 - || kind === 96 - || kind === 100 - || kind === 85 - || kind === 94) { - return true; - } - else if (kind === 177) { - return isSimpleExpressionWorker(node.expression, depth + 1); - } - else if (kind === 178) { - return isSimpleExpressionWorker(node.expression, depth + 1) - && isSimpleExpressionWorker(node.argumentExpression, depth + 1); - } - else if (kind === 190 - || kind === 191) { - return isSimpleExpressionWorker(node.operand, depth + 1); - } - else if (kind === 192) { - return node.operatorToken.kind !== 39 - && isSimpleExpressionWorker(node.left, depth + 1) - && isSimpleExpressionWorker(node.right, depth + 1); - } - else if (kind === 193) { - return isSimpleExpressionWorker(node.condition, depth + 1) - && isSimpleExpressionWorker(node.whenTrue, depth + 1) - && isSimpleExpressionWorker(node.whenFalse, depth + 1); - } - else if (kind === 188 - || kind === 187 - || kind === 186) { - return isSimpleExpressionWorker(node.expression, depth + 1); - } - else if (kind === 175) { - return node.elements.length === 0; - } - else if (kind === 176) { - return node.properties.length === 0; - } - else if (kind === 179) { - if (!isSimpleExpressionWorker(node.expression, depth + 1)) { - return false; - } - for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { - var argument = _a[_i]; - if (!isSimpleExpressionWorker(argument, depth + 1)) { - return false; - } - } - return true; - } - } - return false; - } - var syntaxKindCache = ts.createMap(); - function formatSyntaxKind(kind) { - var syntaxKindEnum = ts.SyntaxKind; - if (syntaxKindEnum) { - if (syntaxKindCache[kind]) { - return syntaxKindCache[kind]; - } - for (var name_9 in syntaxKindEnum) { - if (syntaxKindEnum[name_9] === kind) { - return syntaxKindCache[kind] = kind.toString() + " (" + name_9 + ")"; - } - } - } - else { - return kind.toString(); - } - } - ts.formatSyntaxKind = formatSyntaxKind; - function movePos(pos, value) { - return ts.positionIsSynthesized(pos) ? -1 : pos + value; - } - ts.movePos = movePos; - function createRange(pos, end) { - return { pos: pos, end: end }; - } - ts.createRange = createRange; - function moveRangeEnd(range, end) { - return createRange(range.pos, end); - } - ts.moveRangeEnd = moveRangeEnd; - function moveRangePos(range, pos) { - return createRange(pos, range.end); - } - ts.moveRangePos = moveRangePos; - function moveRangePastDecorators(node) { - return node.decorators && node.decorators.length > 0 - ? moveRangePos(node, node.decorators.end) - : node; - } - ts.moveRangePastDecorators = moveRangePastDecorators; - function moveRangePastModifiers(node) { - return node.modifiers && node.modifiers.length > 0 - ? moveRangePos(node, node.modifiers.end) - : moveRangePastDecorators(node); - } - ts.moveRangePastModifiers = moveRangePastModifiers; - function isCollapsedRange(range) { - return range.pos === range.end; - } - ts.isCollapsedRange = isCollapsedRange; - function collapseRangeToStart(range) { - return isCollapsedRange(range) ? range : moveRangeEnd(range, range.pos); - } - ts.collapseRangeToStart = collapseRangeToStart; - function collapseRangeToEnd(range) { - return isCollapsedRange(range) ? range : moveRangePos(range, range.end); - } - ts.collapseRangeToEnd = collapseRangeToEnd; - function createTokenRange(pos, token) { - return createRange(pos, pos + ts.tokenToString(token).length); - } - ts.createTokenRange = createTokenRange; - function rangeIsOnSingleLine(range, sourceFile) { - return rangeStartIsOnSameLineAsRangeEnd(range, range, sourceFile); - } - ts.rangeIsOnSingleLine = rangeIsOnSingleLine; - function rangeStartPositionsAreOnSameLine(range1, range2, sourceFile) { - return positionsAreOnSameLine(getStartPositionOfRange(range1, sourceFile), getStartPositionOfRange(range2, sourceFile), sourceFile); - } - ts.rangeStartPositionsAreOnSameLine = rangeStartPositionsAreOnSameLine; - function rangeEndPositionsAreOnSameLine(range1, range2, sourceFile) { - return positionsAreOnSameLine(range1.end, range2.end, sourceFile); - } - ts.rangeEndPositionsAreOnSameLine = rangeEndPositionsAreOnSameLine; - function rangeStartIsOnSameLineAsRangeEnd(range1, range2, sourceFile) { - return positionsAreOnSameLine(getStartPositionOfRange(range1, sourceFile), range2.end, sourceFile); - } - ts.rangeStartIsOnSameLineAsRangeEnd = rangeStartIsOnSameLineAsRangeEnd; - function rangeEndIsOnSameLineAsRangeStart(range1, range2, sourceFile) { - return positionsAreOnSameLine(range1.end, getStartPositionOfRange(range2, sourceFile), sourceFile); - } - ts.rangeEndIsOnSameLineAsRangeStart = rangeEndIsOnSameLineAsRangeStart; - function positionsAreOnSameLine(pos1, pos2, sourceFile) { - return pos1 === pos2 || - getLineOfLocalPosition(sourceFile, pos1) === getLineOfLocalPosition(sourceFile, pos2); - } - ts.positionsAreOnSameLine = positionsAreOnSameLine; - function getStartPositionOfRange(range, sourceFile) { - return ts.positionIsSynthesized(range.pos) ? -1 : ts.skipTrivia(sourceFile.text, range.pos); - } - ts.getStartPositionOfRange = getStartPositionOfRange; - function isDeclarationNameOfEnumOrNamespace(node) { - var parseNode = getParseTreeNode(node); - if (parseNode) { - switch (parseNode.parent.kind) { - case 229: - case 230: - return parseNode === parseNode.parent.name; - } - } - return false; - } - ts.isDeclarationNameOfEnumOrNamespace = isDeclarationNameOfEnumOrNamespace; - function getInitializedVariables(node) { - return ts.filter(node.declarations, isInitializedVariable); - } - ts.getInitializedVariables = getInitializedVariables; - function isInitializedVariable(node) { - return node.initializer !== undefined; - } - function isMergedWithClass(node) { - if (node.symbol) { - for (var _i = 0, _a = node.symbol.declarations; _i < _a.length; _i++) { - var declaration = _a[_i]; - if (declaration.kind === 226 && declaration !== node) { - return true; - } - } - } - return false; - } - ts.isMergedWithClass = isMergedWithClass; - function isFirstDeclarationOfKind(node, kind) { - return node.symbol && getDeclarationOfKind(node.symbol, kind) === node; - } - ts.isFirstDeclarationOfKind = isFirstDeclarationOfKind; - function isNodeArray(array) { - return array.hasOwnProperty("pos") - && array.hasOwnProperty("end"); - } - ts.isNodeArray = isNodeArray; - function isNoSubstitutionTemplateLiteral(node) { - return node.kind === 12; - } - ts.isNoSubstitutionTemplateLiteral = isNoSubstitutionTemplateLiteral; - function isLiteralKind(kind) { - return 8 <= kind && kind <= 12; - } - ts.isLiteralKind = isLiteralKind; - function isTextualLiteralKind(kind) { - return kind === 9 || kind === 12; - } - ts.isTextualLiteralKind = isTextualLiteralKind; - function isLiteralExpression(node) { - return isLiteralKind(node.kind); - } - ts.isLiteralExpression = isLiteralExpression; - function isTemplateLiteralKind(kind) { - return 12 <= kind && kind <= 15; - } - ts.isTemplateLiteralKind = isTemplateLiteralKind; - function isTemplateHead(node) { - return node.kind === 13; - } - ts.isTemplateHead = isTemplateHead; - function isTemplateMiddleOrTemplateTail(node) { - var kind = node.kind; - return kind === 14 - || kind === 15; - } - ts.isTemplateMiddleOrTemplateTail = isTemplateMiddleOrTemplateTail; - function isIdentifier(node) { - return node.kind === 70; - } - ts.isIdentifier = isIdentifier; - function isGeneratedIdentifier(node) { - return isIdentifier(node) && node.autoGenerateKind > 0; - } - ts.isGeneratedIdentifier = isGeneratedIdentifier; - function isModifier(node) { - return isModifierKind(node.kind); - } - ts.isModifier = isModifier; - function isQualifiedName(node) { - return node.kind === 141; - } - ts.isQualifiedName = isQualifiedName; - function isComputedPropertyName(node) { - return node.kind === 142; - } - ts.isComputedPropertyName = isComputedPropertyName; - function isEntityName(node) { - var kind = node.kind; - return kind === 141 - || kind === 70; - } - ts.isEntityName = isEntityName; - function isPropertyName(node) { - var kind = node.kind; - return kind === 70 - || kind === 9 - || kind === 8 - || kind === 142; - } - ts.isPropertyName = isPropertyName; - function isModuleName(node) { - var kind = node.kind; - return kind === 70 - || kind === 9; - } - ts.isModuleName = isModuleName; - function isBindingName(node) { - var kind = node.kind; - return kind === 70 - || kind === 172 - || kind === 173; - } - ts.isBindingName = isBindingName; - function isTypeParameter(node) { - return node.kind === 143; - } - ts.isTypeParameter = isTypeParameter; - function isParameter(node) { - return node.kind === 144; - } - ts.isParameter = isParameter; - function isDecorator(node) { - return node.kind === 145; - } - ts.isDecorator = isDecorator; - function isMethodDeclaration(node) { - return node.kind === 149; - } - ts.isMethodDeclaration = isMethodDeclaration; - function isClassElement(node) { - var kind = node.kind; - return kind === 150 - || kind === 147 - || kind === 149 - || kind === 151 - || kind === 152 - || kind === 155 - || kind === 203; - } - ts.isClassElement = isClassElement; - function isObjectLiteralElementLike(node) { - var kind = node.kind; - return kind === 257 - || kind === 258 - || kind === 259 - || kind === 149 - || kind === 151 - || kind === 152 - || kind === 244; - } - ts.isObjectLiteralElementLike = isObjectLiteralElementLike; - function isTypeNodeKind(kind) { - return (kind >= 156 && kind <= 171) - || kind === 118 - || kind === 132 - || kind === 121 - || kind === 134 - || kind === 135 - || kind === 104 - || kind === 129 - || kind === 199; - } - function isTypeNode(node) { - return isTypeNodeKind(node.kind); - } - ts.isTypeNode = isTypeNode; - function isArrayBindingPattern(node) { - return node.kind === 173; - } - ts.isArrayBindingPattern = isArrayBindingPattern; - function isObjectBindingPattern(node) { - return node.kind === 172; - } - ts.isObjectBindingPattern = isObjectBindingPattern; - function isBindingPattern(node) { - if (node) { - var kind = node.kind; - return kind === 173 - || kind === 172; - } - return false; - } - ts.isBindingPattern = isBindingPattern; - function isAssignmentPattern(node) { - var kind = node.kind; - return kind === 175 - || kind === 176; - } - ts.isAssignmentPattern = isAssignmentPattern; - function isBindingElement(node) { - return node.kind === 174; - } - ts.isBindingElement = isBindingElement; - function isArrayBindingElement(node) { - var kind = node.kind; - return kind === 174 - || kind === 198; - } - ts.isArrayBindingElement = isArrayBindingElement; - function isDeclarationBindingElement(bindingElement) { - switch (bindingElement.kind) { - case 223: - case 144: - case 174: - return true; - } - return false; - } - ts.isDeclarationBindingElement = isDeclarationBindingElement; - function isBindingOrAssignmentPattern(node) { - return isObjectBindingOrAssignmentPattern(node) - || isArrayBindingOrAssignmentPattern(node); - } - ts.isBindingOrAssignmentPattern = isBindingOrAssignmentPattern; - function isObjectBindingOrAssignmentPattern(node) { - switch (node.kind) { - case 172: - case 176: - return true; - } - return false; - } - ts.isObjectBindingOrAssignmentPattern = isObjectBindingOrAssignmentPattern; - function isArrayBindingOrAssignmentPattern(node) { - switch (node.kind) { - case 173: - case 175: - return true; - } - return false; - } - ts.isArrayBindingOrAssignmentPattern = isArrayBindingOrAssignmentPattern; - function isArrayLiteralExpression(node) { - return node.kind === 175; - } - ts.isArrayLiteralExpression = isArrayLiteralExpression; - function isObjectLiteralExpression(node) { - return node.kind === 176; - } - ts.isObjectLiteralExpression = isObjectLiteralExpression; - function isPropertyAccessExpression(node) { - return node.kind === 177; - } - ts.isPropertyAccessExpression = isPropertyAccessExpression; - function isElementAccessExpression(node) { - return node.kind === 178; - } - ts.isElementAccessExpression = isElementAccessExpression; - function isBinaryExpression(node) { - return node.kind === 192; - } - ts.isBinaryExpression = isBinaryExpression; - function isConditionalExpression(node) { - return node.kind === 193; - } - ts.isConditionalExpression = isConditionalExpression; - function isCallExpression(node) { - return node.kind === 179; - } - ts.isCallExpression = isCallExpression; - function isTemplateLiteral(node) { - var kind = node.kind; - return kind === 194 - || kind === 12; - } - ts.isTemplateLiteral = isTemplateLiteral; - function isSpreadExpression(node) { - return node.kind === 196; - } - ts.isSpreadExpression = isSpreadExpression; - function isExpressionWithTypeArguments(node) { - return node.kind === 199; - } - ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; - function isLeftHandSideExpressionKind(kind) { - return kind === 177 - || kind === 178 - || kind === 180 - || kind === 179 - || kind === 246 - || kind === 247 - || kind === 181 - || kind === 175 - || kind === 183 - || kind === 176 - || kind === 197 - || kind === 184 - || kind === 70 - || kind === 11 - || kind === 8 - || kind === 9 - || kind === 12 - || kind === 194 - || kind === 85 - || kind === 94 - || kind === 98 - || kind === 100 - || kind === 96 - || kind === 201 - || kind === 297; - } - function isLeftHandSideExpression(node) { - return isLeftHandSideExpressionKind(ts.skipPartiallyEmittedExpressions(node).kind); - } - ts.isLeftHandSideExpression = isLeftHandSideExpression; - function isUnaryExpressionKind(kind) { - return kind === 190 - || kind === 191 - || kind === 186 - || kind === 187 - || kind === 188 - || kind === 189 - || kind === 182 - || isLeftHandSideExpressionKind(kind); - } - function isUnaryExpression(node) { - return isUnaryExpressionKind(ts.skipPartiallyEmittedExpressions(node).kind); - } - ts.isUnaryExpression = isUnaryExpression; - function isExpressionKind(kind) { - return kind === 193 - || kind === 195 - || kind === 185 - || kind === 192 - || kind === 196 - || kind === 200 - || kind === 198 - || kind === 297 - || isUnaryExpressionKind(kind); - } - function isExpression(node) { - return isExpressionKind(ts.skipPartiallyEmittedExpressions(node).kind); - } - ts.isExpression = isExpression; - function isAssertionExpression(node) { - var kind = node.kind; - return kind === 182 - || kind === 200; - } - ts.isAssertionExpression = isAssertionExpression; - function isPartiallyEmittedExpression(node) { - return node.kind === 294; - } - ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; - function isNotEmittedStatement(node) { - return node.kind === 293; - } - ts.isNotEmittedStatement = isNotEmittedStatement; - function isNotEmittedOrPartiallyEmittedNode(node) { - return isNotEmittedStatement(node) - || isPartiallyEmittedExpression(node); - } - ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; - function isOmittedExpression(node) { - return node.kind === 198; - } - ts.isOmittedExpression = isOmittedExpression; - function isTemplateSpan(node) { - return node.kind === 202; - } - ts.isTemplateSpan = isTemplateSpan; - function isBlock(node) { - return node.kind === 204; - } - ts.isBlock = isBlock; - function isConciseBody(node) { - return isBlock(node) - || isExpression(node); - } - ts.isConciseBody = isConciseBody; - function isFunctionBody(node) { - return isBlock(node); - } - ts.isFunctionBody = isFunctionBody; - function isForInitializer(node) { - return isVariableDeclarationList(node) - || isExpression(node); - } - ts.isForInitializer = isForInitializer; - function isVariableDeclaration(node) { - return node.kind === 223; - } - ts.isVariableDeclaration = isVariableDeclaration; - function isVariableDeclarationList(node) { - return node.kind === 224; - } - ts.isVariableDeclarationList = isVariableDeclarationList; - function isCaseBlock(node) { - return node.kind === 232; - } - ts.isCaseBlock = isCaseBlock; - function isModuleBody(node) { - var kind = node.kind; - return kind === 231 - || kind === 230; - } - ts.isModuleBody = isModuleBody; - function isImportEqualsDeclaration(node) { - return node.kind === 234; - } - ts.isImportEqualsDeclaration = isImportEqualsDeclaration; - function isImportClause(node) { - return node.kind === 236; - } - ts.isImportClause = isImportClause; - function isNamedImportBindings(node) { - var kind = node.kind; - return kind === 238 - || kind === 237; - } - ts.isNamedImportBindings = isNamedImportBindings; - function isImportSpecifier(node) { - return node.kind === 239; - } - ts.isImportSpecifier = isImportSpecifier; - function isNamedExports(node) { - return node.kind === 242; - } - ts.isNamedExports = isNamedExports; - function isExportSpecifier(node) { - return node.kind === 243; - } - ts.isExportSpecifier = isExportSpecifier; - function isModuleOrEnumDeclaration(node) { - return node.kind === 230 || node.kind === 229; - } - ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; - function isDeclarationKind(kind) { - return kind === 185 - || kind === 174 - || kind === 226 - || kind === 197 - || kind === 150 - || kind === 229 - || kind === 260 - || kind === 243 - || kind === 225 - || kind === 184 - || kind === 151 - || kind === 236 - || kind === 234 - || kind === 239 - || kind === 227 - || kind === 149 - || kind === 148 - || kind === 230 - || kind === 233 - || kind === 237 - || kind === 144 - || kind === 257 - || kind === 147 - || kind === 146 - || kind === 152 - || kind === 258 - || kind === 228 - || kind === 143 - || kind === 223 - || kind === 285; - } - function isDeclarationStatementKind(kind) { - return kind === 225 - || kind === 244 - || kind === 226 - || kind === 227 - || kind === 228 - || kind === 229 - || kind === 230 - || kind === 235 - || kind === 234 - || kind === 241 - || kind === 240 - || kind === 233; - } - function isStatementKindButNotDeclarationKind(kind) { - return kind === 215 - || kind === 214 - || kind === 222 - || kind === 209 - || kind === 207 - || kind === 206 - || kind === 212 - || kind === 213 - || kind === 211 - || kind === 208 - || kind === 219 - || kind === 216 - || kind === 218 - || kind === 220 - || kind === 221 - || kind === 205 - || kind === 210 - || kind === 217 - || kind === 293 - || kind === 296 - || kind === 295; - } - function isDeclaration(node) { - return isDeclarationKind(node.kind); - } - ts.isDeclaration = isDeclaration; - function isDeclarationStatement(node) { - return isDeclarationStatementKind(node.kind); - } - ts.isDeclarationStatement = isDeclarationStatement; - function isStatementButNotDeclaration(node) { - return isStatementKindButNotDeclarationKind(node.kind); - } - ts.isStatementButNotDeclaration = isStatementButNotDeclaration; - function isStatement(node) { - var kind = node.kind; - return isStatementKindButNotDeclarationKind(kind) - || isDeclarationStatementKind(kind) - || kind === 204; - } - ts.isStatement = isStatement; - function isModuleReference(node) { - var kind = node.kind; - return kind === 245 - || kind === 141 - || kind === 70; - } - ts.isModuleReference = isModuleReference; - function isJsxOpeningElement(node) { - return node.kind === 248; - } - ts.isJsxOpeningElement = isJsxOpeningElement; - function isJsxClosingElement(node) { - return node.kind === 249; - } - ts.isJsxClosingElement = isJsxClosingElement; - function isJsxTagNameExpression(node) { - var kind = node.kind; - return kind === 98 - || kind === 70 - || kind === 177; - } - ts.isJsxTagNameExpression = isJsxTagNameExpression; - function isJsxChild(node) { - var kind = node.kind; - return kind === 246 - || kind === 252 - || kind === 247 - || kind === 10; - } - ts.isJsxChild = isJsxChild; - function isJsxAttributeLike(node) { - var kind = node.kind; - return kind === 250 - || kind === 251; - } - ts.isJsxAttributeLike = isJsxAttributeLike; - function isJsxSpreadAttribute(node) { - return node.kind === 251; - } - ts.isJsxSpreadAttribute = isJsxSpreadAttribute; - function isJsxAttribute(node) { - return node.kind === 250; - } - ts.isJsxAttribute = isJsxAttribute; - function isStringLiteralOrJsxExpression(node) { - var kind = node.kind; - return kind === 9 - || kind === 252; - } - ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; - function isCaseOrDefaultClause(node) { - var kind = node.kind; - return kind === 253 - || kind === 254; - } - ts.isCaseOrDefaultClause = isCaseOrDefaultClause; - function isHeritageClause(node) { - return node.kind === 255; - } - ts.isHeritageClause = isHeritageClause; - function isCatchClause(node) { - return node.kind === 256; - } - ts.isCatchClause = isCatchClause; - function isPropertyAssignment(node) { - return node.kind === 257; - } - ts.isPropertyAssignment = isPropertyAssignment; - function isShorthandPropertyAssignment(node) { - return node.kind === 258; - } - ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; - function isEnumMember(node) { - return node.kind === 260; - } - ts.isEnumMember = isEnumMember; - function isSourceFile(node) { - return node.kind === 261; - } - ts.isSourceFile = isSourceFile; - function isWatchSet(options) { - return options.watch && options.hasOwnProperty("watch"); - } - ts.isWatchSet = isWatchSet; -})(ts || (ts = {})); -(function (ts) { - function getDefaultLibFileName(options) { - switch (options.target) { - case 5: - case 4: - return "lib.es2017.d.ts"; - case 3: - return "lib.es2016.d.ts"; - case 2: - return "lib.es6.d.ts"; - default: - return "lib.d.ts"; - } - } - ts.getDefaultLibFileName = getDefaultLibFileName; - function textSpanEnd(span) { - return span.start + span.length; - } - ts.textSpanEnd = textSpanEnd; - function textSpanIsEmpty(span) { - return span.length === 0; - } - ts.textSpanIsEmpty = textSpanIsEmpty; - function textSpanContainsPosition(span, position) { - return position >= span.start && position < textSpanEnd(span); - } - ts.textSpanContainsPosition = textSpanContainsPosition; - function textSpanContainsTextSpan(span, other) { - return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span); - } - ts.textSpanContainsTextSpan = textSpanContainsTextSpan; - function textSpanOverlapsWith(span, other) { - var overlapStart = Math.max(span.start, other.start); - var overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other)); - return overlapStart < overlapEnd; - } - ts.textSpanOverlapsWith = textSpanOverlapsWith; - function textSpanOverlap(span1, span2) { - var overlapStart = Math.max(span1.start, span2.start); - var overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); - if (overlapStart < overlapEnd) { - return createTextSpanFromBounds(overlapStart, overlapEnd); - } - return undefined; - } - ts.textSpanOverlap = textSpanOverlap; - function textSpanIntersectsWithTextSpan(span, other) { - return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start; - } - ts.textSpanIntersectsWithTextSpan = textSpanIntersectsWithTextSpan; - function textSpanIntersectsWith(span, start, length) { - var end = start + length; - return start <= textSpanEnd(span) && end >= span.start; - } - ts.textSpanIntersectsWith = textSpanIntersectsWith; - function decodedTextSpanIntersectsWith(start1, length1, start2, length2) { - var end1 = start1 + length1; - var end2 = start2 + length2; - return start2 <= end1 && end2 >= start1; - } - ts.decodedTextSpanIntersectsWith = decodedTextSpanIntersectsWith; - function textSpanIntersectsWithPosition(span, position) { - return position <= textSpanEnd(span) && position >= span.start; - } - ts.textSpanIntersectsWithPosition = textSpanIntersectsWithPosition; - function textSpanIntersection(span1, span2) { - var intersectStart = Math.max(span1.start, span2.start); - var intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); - if (intersectStart <= intersectEnd) { - return createTextSpanFromBounds(intersectStart, intersectEnd); - } - return undefined; - } - ts.textSpanIntersection = textSpanIntersection; - function createTextSpan(start, length) { - if (start < 0) { - throw new Error("start < 0"); - } - if (length < 0) { - throw new Error("length < 0"); - } - return { start: start, length: length }; - } - ts.createTextSpan = createTextSpan; - function createTextSpanFromBounds(start, end) { - return createTextSpan(start, end - start); - } - ts.createTextSpanFromBounds = createTextSpanFromBounds; - function textChangeRangeNewSpan(range) { - return createTextSpan(range.span.start, range.newLength); - } - ts.textChangeRangeNewSpan = textChangeRangeNewSpan; - function textChangeRangeIsUnchanged(range) { - return textSpanIsEmpty(range.span) && range.newLength === 0; - } - ts.textChangeRangeIsUnchanged = textChangeRangeIsUnchanged; - function createTextChangeRange(span, newLength) { - if (newLength < 0) { - throw new Error("newLength < 0"); - } - return { span: span, newLength: newLength }; - } - ts.createTextChangeRange = createTextChangeRange; - ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); - function collapseTextChangeRangesAcrossMultipleVersions(changes) { - if (changes.length === 0) { - return ts.unchangedTextChangeRange; - } - if (changes.length === 1) { - return changes[0]; - } - var change0 = changes[0]; - var oldStartN = change0.span.start; - var oldEndN = textSpanEnd(change0.span); - var newEndN = oldStartN + change0.newLength; - for (var i = 1; i < changes.length; i++) { - var nextChange = changes[i]; - var oldStart1 = oldStartN; - var oldEnd1 = oldEndN; - var newEnd1 = newEndN; - var oldStart2 = nextChange.span.start; - var oldEnd2 = textSpanEnd(nextChange.span); - var newEnd2 = oldStart2 + nextChange.newLength; - oldStartN = Math.min(oldStart1, oldStart2); - oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); - newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); - } - return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN); - } - ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; - function getTypeParameterOwner(d) { - if (d && d.kind === 143) { - for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 227) { - return current; - } - } - } - } - ts.getTypeParameterOwner = getTypeParameterOwner; - function isParameterPropertyDeclaration(node) { - return ts.hasModifier(node, 92) && node.parent.kind === 150 && ts.isClassLike(node.parent.parent); - } - ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; - function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 174 || ts.isBindingPattern(node))) { - node = node.parent; - } - return node; - } - function getCombinedModifierFlags(node) { - node = walkUpBindingElementsAndPatterns(node); - var flags = ts.getModifierFlags(node); - if (node.kind === 223) { - node = node.parent; - } - if (node && node.kind === 224) { - flags |= ts.getModifierFlags(node); - node = node.parent; - } - if (node && node.kind === 205) { - flags |= ts.getModifierFlags(node); - } - return flags; - } - ts.getCombinedModifierFlags = getCombinedModifierFlags; - function getCombinedNodeFlags(node) { - node = walkUpBindingElementsAndPatterns(node); - var flags = node.flags; - if (node.kind === 223) { - node = node.parent; - } - if (node && node.kind === 224) { - flags |= node.flags; - node = node.parent; - } - if (node && node.kind === 205) { - flags |= node.flags; - } - return flags; - } - ts.getCombinedNodeFlags = getCombinedNodeFlags; - function validateLocaleAndSetLanguage(locale, sys, errors) { - var matchResult = /^([a-z]+)([_\-]([a-z]+))?$/.exec(locale.toLowerCase()); - if (!matchResult) { - if (errors) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1, "en", "ja-jp")); - } - return; - } - var language = matchResult[1]; - var territory = matchResult[3]; - if (!trySetLanguageAndTerritory(language, territory, errors)) { - trySetLanguageAndTerritory(language, undefined, errors); - } - function trySetLanguageAndTerritory(language, territory, errors) { - var compilerFilePath = ts.normalizePath(sys.getExecutingFilePath()); - var containingDirectoryPath = ts.getDirectoryPath(compilerFilePath); - var filePath = ts.combinePaths(containingDirectoryPath, language); - if (territory) { - filePath = filePath + "-" + territory; - } - filePath = sys.resolvePath(ts.combinePaths(filePath, "diagnosticMessages.generated.json")); - if (!sys.fileExists(filePath)) { - return false; - } - var fileContents = ""; - try { - fileContents = sys.readFile(filePath); - } - catch (e) { - if (errors) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unable_to_open_file_0, filePath)); - } - return false; - } - try { - ts.localizedDiagnosticMessages = JSON.parse(fileContents); - } - catch (e) { - if (errors) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Corrupted_locale_file_0, filePath)); - } - return false; - } - return true; - } - } - ts.validateLocaleAndSetLanguage = validateLocaleAndSetLanguage; -})(ts || (ts = {})); -var ts; -(function (ts) { - var NodeConstructor; - var SourceFileConstructor; - function createNode(kind, location, flags) { - var ConstructorForKind = kind === 261 - ? (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor())) - : (NodeConstructor || (NodeConstructor = ts.objectAllocator.getNodeConstructor())); - var node = location - ? new ConstructorForKind(kind, location.pos, location.end) - : new ConstructorForKind(kind, -1, -1); - node.flags = flags | 8; + function createSynthesizedNode(kind) { + var node = ts.createNode(kind, -1, -1); + node.flags |= 8; return node; } function updateNode(updated, original) { if (updated !== original) { setOriginalNode(updated, original); + setTextRange(updated, original); if (original.startsOnNewLine) { updated.startsOnNewLine = true; } @@ -10580,7 +10466,7 @@ var ts; return updated; } ts.updateNode = updateNode; - function createNodeArray(elements, location, hasTrailingComma) { + function createNodeArray(elements, hasTrailingComma) { if (elements) { if (ts.isNodeArray(elements)) { return elements; @@ -10590,32 +10476,15 @@ var ts; elements = []; } var array = elements; - if (location) { - array.pos = location.pos; - array.end = location.end; - } - else { - array.pos = -1; - array.end = -1; - } - if (hasTrailingComma) { - array.hasTrailingComma = true; - } + array.pos = -1; + array.end = -1; + array.hasTrailingComma = hasTrailingComma; return array; } ts.createNodeArray = createNodeArray; - function createSynthesizedNode(kind, startsOnNewLine) { - var node = createNode(kind, undefined); - node.startsOnNewLine = startsOnNewLine; - return node; - } - ts.createSynthesizedNode = createSynthesizedNode; - function createSynthesizedNodeArray(elements) { - return createNodeArray(elements, undefined); - } - ts.createSynthesizedNodeArray = createSynthesizedNodeArray; function getSynthesizedClone(node) { - var clone = createNode(node.kind, undefined, node.flags); + var clone = createSynthesizedNode(node.kind); + clone.flags |= node.flags; setOriginalNode(clone, node); for (var key in node) { if (clone.hasOwnProperty(key) || !node.hasOwnProperty(key)) { @@ -10626,50 +10495,48 @@ var ts; return clone; } ts.getSynthesizedClone = getSynthesizedClone; - function getMutableClone(node) { - var clone = getSynthesizedClone(node); - clone.pos = node.pos; - clone.end = node.end; - clone.parent = node.parent; - return clone; - } - ts.getMutableClone = getMutableClone; - function createLiteral(value, location) { + function createLiteral(value) { if (typeof value === "number") { - var node = createNode(8, location, undefined); - node.text = value.toString(); - return node; + return createNumericLiteral(value + ""); } - else if (typeof value === "boolean") { - return createNode(value ? 100 : 85, location, undefined); + if (typeof value === "boolean") { + return value ? createTrue() : createFalse(); } - else if (typeof value === "string") { - var node = createNode(9, location, undefined); - node.text = value; - return node; - } - else if (value) { - var node = createNode(9, location, undefined); - node.textSourceNode = value; - node.text = value.text; - return node; + if (typeof value === "string") { + return createStringLiteral(value); } + return createLiteralFromNode(value); } ts.createLiteral = createLiteral; - var nextAutoGenerateId = 0; - function createIdentifier(text, location) { - var node = createNode(70, location); + function createNumericLiteral(value) { + var node = createSynthesizedNode(8); + node.text = value; + node.numericLiteralFlags = 0; + return node; + } + ts.createNumericLiteral = createNumericLiteral; + function createStringLiteral(text) { + var node = createSynthesizedNode(9); + node.text = text; + return node; + } + function createLiteralFromNode(sourceNode) { + var node = createStringLiteral(sourceNode.text); + node.textSourceNode = sourceNode; + return node; + } + function createIdentifier(text) { + var node = createSynthesizedNode(70); node.text = ts.escapeIdentifier(text); - node.originalKeywordKind = ts.stringToToken(text); + node.originalKeywordKind = text ? ts.stringToToken(text) : 0; node.autoGenerateKind = 0; node.autoGenerateId = 0; return node; } ts.createIdentifier = createIdentifier; - function createTempVariable(recordTempVariable, location) { - var name = createNode(70, location); - name.text = ""; - name.originalKeywordKind = 0; + var nextAutoGenerateId = 0; + function createTempVariable(recordTempVariable) { + var name = createIdentifier(""); name.autoGenerateKind = 1; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; @@ -10679,93 +10546,387 @@ var ts; return name; } ts.createTempVariable = createTempVariable; - function createLoopVariable(location) { - var name = createNode(70, location); - name.text = ""; - name.originalKeywordKind = 0; + function createLoopVariable() { + var name = createIdentifier(""); name.autoGenerateKind = 2; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; return name; } ts.createLoopVariable = createLoopVariable; - function createUniqueName(text, location) { - var name = createNode(70, location); - name.text = text; - name.originalKeywordKind = 0; + function createUniqueName(text) { + var name = createIdentifier(text); name.autoGenerateKind = 3; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; return name; } ts.createUniqueName = createUniqueName; - function getGeneratedNameForNode(node, location) { - var name = createNode(70, location); - name.original = node; - name.text = ""; - name.originalKeywordKind = 0; + function getGeneratedNameForNode(node) { + var name = createIdentifier(""); name.autoGenerateKind = 4; name.autoGenerateId = nextAutoGenerateId; + name.original = node; nextAutoGenerateId++; return name; } ts.getGeneratedNameForNode = getGeneratedNameForNode; function createToken(token) { - return createNode(token); + return createSynthesizedNode(token); } ts.createToken = createToken; function createSuper() { - var node = createNode(96); - return node; + return createSynthesizedNode(96); } ts.createSuper = createSuper; - function createThis(location) { - var node = createNode(98, location); - return node; + function createThis() { + return createSynthesizedNode(98); } ts.createThis = createThis; function createNull() { - var node = createNode(94); - return node; + return createSynthesizedNode(94); } ts.createNull = createNull; - function createComputedPropertyName(expression, location) { - var node = createNode(142, location); + function createTrue() { + return createSynthesizedNode(100); + } + ts.createTrue = createTrue; + function createFalse() { + return createSynthesizedNode(85); + } + ts.createFalse = createFalse; + function createQualifiedName(left, right) { + var node = createSynthesizedNode(142); + node.left = left; + node.right = asName(right); + return node; + } + ts.createQualifiedName = createQualifiedName; + function updateQualifiedName(node, left, right) { + return node.left !== left + || node.right !== right + ? updateNode(createQualifiedName(left, right), node) + : node; + } + ts.updateQualifiedName = updateQualifiedName; + function createComputedPropertyName(expression) { + var node = createSynthesizedNode(143); node.expression = expression; return node; } ts.createComputedPropertyName = createComputedPropertyName; function updateComputedPropertyName(node, expression) { - if (node.expression !== expression) { - return updateNode(createComputedPropertyName(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createComputedPropertyName(expression), node) + : node; } ts.updateComputedPropertyName = updateComputedPropertyName; - function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer, location, flags) { - var node = createNode(144, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createSignatureDeclaration(kind, typeParameters, parameters, type) { + var signatureDeclaration = createSynthesizedNode(kind); + signatureDeclaration.typeParameters = asNodeArray(typeParameters); + signatureDeclaration.parameters = asNodeArray(parameters); + signatureDeclaration.type = type; + return signatureDeclaration; + } + ts.createSignatureDeclaration = createSignatureDeclaration; + function updateSignatureDeclaration(node, typeParameters, parameters, type) { + return node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + ? updateNode(createSignatureDeclaration(node.kind, typeParameters, parameters, type), node) + : node; + } + function createFunctionTypeNode(typeParameters, parameters, type) { + return createSignatureDeclaration(159, typeParameters, parameters, type); + } + ts.createFunctionTypeNode = createFunctionTypeNode; + function updateFunctionTypeNode(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateFunctionTypeNode = updateFunctionTypeNode; + function createConstructorTypeNode(typeParameters, parameters, type) { + return createSignatureDeclaration(160, typeParameters, parameters, type); + } + ts.createConstructorTypeNode = createConstructorTypeNode; + function updateConstructorTypeNode(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateConstructorTypeNode = updateConstructorTypeNode; + function createCallSignatureDeclaration(typeParameters, parameters, type) { + return createSignatureDeclaration(154, typeParameters, parameters, type); + } + ts.createCallSignatureDeclaration = createCallSignatureDeclaration; + function updateCallSignatureDeclaration(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateCallSignatureDeclaration = updateCallSignatureDeclaration; + function createConstructSignatureDeclaration(typeParameters, parameters, type) { + return createSignatureDeclaration(155, typeParameters, parameters, type); + } + ts.createConstructSignatureDeclaration = createConstructSignatureDeclaration; + function updateConstructSignatureDeclaration(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateConstructSignatureDeclaration = updateConstructSignatureDeclaration; + function createMethodSignature(typeParameters, parameters, type, name, questionToken) { + var methodSignature = createSignatureDeclaration(149, typeParameters, parameters, type); + methodSignature.name = asName(name); + methodSignature.questionToken = questionToken; + return methodSignature; + } + ts.createMethodSignature = createMethodSignature; + function updateMethodSignature(node, typeParameters, parameters, type, name, questionToken) { + return node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.name !== name + || node.questionToken !== questionToken + ? updateNode(createMethodSignature(typeParameters, parameters, type, name, questionToken), node) + : node; + } + ts.updateMethodSignature = updateMethodSignature; + function createKeywordTypeNode(kind) { + return createSynthesizedNode(kind); + } + ts.createKeywordTypeNode = createKeywordTypeNode; + function createThisTypeNode() { + return createSynthesizedNode(168); + } + ts.createThisTypeNode = createThisTypeNode; + function createLiteralTypeNode(literal) { + var literalTypeNode = createSynthesizedNode(172); + literalTypeNode.literal = literal; + return literalTypeNode; + } + ts.createLiteralTypeNode = createLiteralTypeNode; + function updateLiteralTypeNode(node, literal) { + return node.literal !== literal + ? updateNode(createLiteralTypeNode(literal), node) + : node; + } + ts.updateLiteralTypeNode = updateLiteralTypeNode; + function createTypeReferenceNode(typeName, typeArguments) { + var typeReference = createSynthesizedNode(158); + typeReference.typeName = asName(typeName); + typeReference.typeArguments = asNodeArray(typeArguments); + return typeReference; + } + ts.createTypeReferenceNode = createTypeReferenceNode; + function updateTypeReferenceNode(node, typeName, typeArguments) { + return node.typeName !== typeName + || node.typeArguments !== typeArguments + ? updateNode(createTypeReferenceNode(typeName, typeArguments), node) + : node; + } + ts.updateTypeReferenceNode = updateTypeReferenceNode; + function createTypePredicateNode(parameterName, type) { + var typePredicateNode = createSynthesizedNode(157); + typePredicateNode.parameterName = asName(parameterName); + typePredicateNode.type = type; + return typePredicateNode; + } + ts.createTypePredicateNode = createTypePredicateNode; + function updateTypePredicateNode(node, parameterName, type) { + return node.parameterName !== parameterName + || node.type !== type + ? updateNode(createTypePredicateNode(parameterName, type), node) + : node; + } + ts.updateTypePredicateNode = updateTypePredicateNode; + function createTypeQueryNode(exprName) { + var typeQueryNode = createSynthesizedNode(161); + typeQueryNode.exprName = exprName; + return typeQueryNode; + } + ts.createTypeQueryNode = createTypeQueryNode; + function updateTypeQueryNode(node, exprName) { + return node.exprName !== exprName ? updateNode(createTypeQueryNode(exprName), node) : node; + } + ts.updateTypeQueryNode = updateTypeQueryNode; + function createArrayTypeNode(elementType) { + var arrayTypeNode = createSynthesizedNode(163); + arrayTypeNode.elementType = elementType; + return arrayTypeNode; + } + ts.createArrayTypeNode = createArrayTypeNode; + function updateArrayTypeNode(node, elementType) { + return node.elementType !== elementType + ? updateNode(createArrayTypeNode(elementType), node) + : node; + } + ts.updateArrayTypeNode = updateArrayTypeNode; + function createUnionOrIntersectionTypeNode(kind, types) { + var unionTypeNode = createSynthesizedNode(kind); + unionTypeNode.types = createNodeArray(types); + return unionTypeNode; + } + ts.createUnionOrIntersectionTypeNode = createUnionOrIntersectionTypeNode; + function updateUnionOrIntersectionTypeNode(node, types) { + return node.types !== types + ? updateNode(createUnionOrIntersectionTypeNode(node.kind, types), node) + : node; + } + ts.updateUnionOrIntersectionTypeNode = updateUnionOrIntersectionTypeNode; + function createTypeLiteralNode(members) { + var typeLiteralNode = createSynthesizedNode(162); + typeLiteralNode.members = createNodeArray(members); + return typeLiteralNode; + } + ts.createTypeLiteralNode = createTypeLiteralNode; + function updateTypeLiteralNode(node, members) { + return node.members !== members + ? updateNode(createTypeLiteralNode(members), node) + : node; + } + ts.updateTypeLiteralNode = updateTypeLiteralNode; + function createTupleTypeNode(elementTypes) { + var tupleTypeNode = createSynthesizedNode(164); + tupleTypeNode.elementTypes = createNodeArray(elementTypes); + return tupleTypeNode; + } + ts.createTupleTypeNode = createTupleTypeNode; + function updateTypleTypeNode(node, elementTypes) { + return node.elementTypes !== elementTypes + ? updateNode(createTupleTypeNode(elementTypes), node) + : node; + } + ts.updateTypleTypeNode = updateTypleTypeNode; + function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { + var mappedTypeNode = createSynthesizedNode(171); + mappedTypeNode.readonlyToken = readonlyToken; + mappedTypeNode.typeParameter = typeParameter; + mappedTypeNode.questionToken = questionToken; + mappedTypeNode.type = type; + return mappedTypeNode; + } + ts.createMappedTypeNode = createMappedTypeNode; + function updateMappedTypeNode(node, readonlyToken, typeParameter, questionToken, type) { + return node.readonlyToken !== readonlyToken + || node.typeParameter !== typeParameter + || node.questionToken !== questionToken + || node.type !== type + ? updateNode(createMappedTypeNode(readonlyToken, typeParameter, questionToken, type), node) + : node; + } + ts.updateMappedTypeNode = updateMappedTypeNode; + function createTypeOperatorNode(type) { + var typeOperatorNode = createSynthesizedNode(169); + typeOperatorNode.operator = 126; + typeOperatorNode.type = type; + return typeOperatorNode; + } + ts.createTypeOperatorNode = createTypeOperatorNode; + function updateTypeOperatorNode(node, type) { + return node.type !== type ? updateNode(createTypeOperatorNode(type), node) : node; + } + ts.updateTypeOperatorNode = updateTypeOperatorNode; + function createIndexedAccessTypeNode(objectType, indexType) { + var indexedAccessTypeNode = createSynthesizedNode(170); + indexedAccessTypeNode.objectType = objectType; + indexedAccessTypeNode.indexType = indexType; + return indexedAccessTypeNode; + } + ts.createIndexedAccessTypeNode = createIndexedAccessTypeNode; + function updateIndexedAccessTypeNode(node, objectType, indexType) { + return node.objectType !== objectType + || node.indexType !== indexType + ? updateNode(createIndexedAccessTypeNode(objectType, indexType), node) + : node; + } + ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; + function createTypeParameterDeclaration(name, constraint, defaultType) { + var typeParameter = createSynthesizedNode(144); + typeParameter.name = asName(name); + typeParameter.constraint = constraint; + typeParameter.default = defaultType; + return typeParameter; + } + ts.createTypeParameterDeclaration = createTypeParameterDeclaration; + function updateTypeParameterDeclaration(node, name, constraint, defaultType) { + return node.name !== name + || node.constraint !== constraint + || node.default !== defaultType + ? updateNode(createTypeParameterDeclaration(name, constraint, defaultType), node) + : node; + } + ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; + function createPropertySignature(name, questionToken, type, initializer) { + var propertySignature = createSynthesizedNode(147); + propertySignature.name = asName(name); + propertySignature.questionToken = questionToken; + propertySignature.type = type; + propertySignature.initializer = initializer; + return propertySignature; + } + ts.createPropertySignature = createPropertySignature; + function updatePropertySignature(node, name, questionToken, type, initializer) { + return node.name !== name + || node.questionToken !== questionToken + || node.type !== type + || node.initializer !== initializer + ? updateNode(createPropertySignature(name, questionToken, type, initializer), node) + : node; + } + ts.updatePropertySignature = updatePropertySignature; + function createIndexSignatureDeclaration(decorators, modifiers, parameters, type) { + var indexSignature = createSynthesizedNode(156); + indexSignature.decorators = asNodeArray(decorators); + indexSignature.modifiers = asNodeArray(modifiers); + indexSignature.parameters = createNodeArray(parameters); + indexSignature.type = type; + return indexSignature; + } + ts.createIndexSignatureDeclaration = createIndexSignatureDeclaration; + function updateIndexSignatureDeclaration(node, decorators, modifiers, parameters, type) { + return node.parameters !== parameters + || node.type !== type + || node.decorators !== decorators + || node.modifiers !== modifiers + ? updateNode(createIndexSignatureDeclaration(decorators, modifiers, parameters, type), node) + : node; + } + ts.updateIndexSignatureDeclaration = updateIndexSignatureDeclaration; + function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { + var node = createSynthesizedNode(145); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; + node.name = asName(name); node.questionToken = questionToken; node.type = type; - node.initializer = initializer ? parenthesizeExpressionForList(initializer) : undefined; + node.initializer = initializer ? ts.parenthesizeExpressionForList(initializer) : undefined; return node; } ts.createParameter = createParameter; - function updateParameter(node, decorators, modifiers, dotDotDotToken, name, type, initializer) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.type !== type || node.initializer !== initializer) { - return updateNode(createParameter(decorators, modifiers, dotDotDotToken, name, node.questionToken, type, initializer, node, node.flags), node); - } - return node; + function updateParameter(node, decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.dotDotDotToken !== dotDotDotToken + || node.name !== name + || node.questionToken !== questionToken + || node.type !== type + || node.initializer !== initializer + ? updateNode(createParameter(decorators, modifiers, dotDotDotToken, name, node.questionToken, type, initializer), node) + : node; } ts.updateParameter = updateParameter; - function createProperty(decorators, modifiers, name, questionToken, type, initializer, location) { - var node = createNode(147, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createDecorator(expression) { + var node = createSynthesizedNode(146); + node.expression = ts.parenthesizeForAccess(expression); + return node; + } + ts.createDecorator = createDecorator; + function updateDecorator(node, expression) { + return node.expression !== expression + ? updateNode(createDecorator(expression), node) + : node; + } + ts.updateDecorator = updateDecorator; + function createProperty(decorators, modifiers, name, questionToken, type, initializer) { + var node = createSynthesizedNode(148); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); node.questionToken = questionToken; node.type = type; node.initializer = initializer; @@ -10773,36 +10934,46 @@ var ts; } ts.createProperty = createProperty; function updateProperty(node, decorators, modifiers, name, type, initializer) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.type !== type || node.initializer !== initializer) { - return updateNode(createProperty(decorators, modifiers, name, node.questionToken, type, initializer, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.type !== type + || node.initializer !== initializer + ? updateNode(createProperty(decorators, modifiers, name, node.questionToken, type, initializer), node) + : node; } ts.updateProperty = updateProperty; - function createMethod(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) { - var node = createNode(149, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createMethodDeclaration(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { + var node = createSynthesizedNode(150); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + node.name = asName(name); + node.questionToken = questionToken; + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.body = body; return node; } - ts.createMethod = createMethod; - function updateMethod(node, decorators, modifiers, name, typeParameters, parameters, type, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createMethod(decorators, modifiers, node.asteriskToken, name, typeParameters, parameters, type, body, node, node.flags), node); - } - return node; + ts.createMethodDeclaration = createMethodDeclaration; + function updateMethod(node, decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.asteriskToken !== asteriskToken + || node.name !== name + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createMethodDeclaration(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body), node) + : node; } ts.updateMethod = updateMethod; - function createConstructor(decorators, modifiers, parameters, body, location, flags) { - var node = createNode(150, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createConstructor(decorators, modifiers, parameters, body) { + var node = createSynthesizedNode(151); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; node.parameters = createNodeArray(parameters); node.type = undefined; @@ -10811,17 +10982,19 @@ var ts; } ts.createConstructor = createConstructor; function updateConstructor(node, decorators, modifiers, parameters, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.parameters !== parameters || node.body !== body) { - return updateNode(createConstructor(decorators, modifiers, parameters, body, node, node.flags), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.parameters !== parameters + || node.body !== body + ? updateNode(createConstructor(decorators, modifiers, parameters, body), node) + : node; } ts.updateConstructor = updateConstructor; - function createGetAccessor(decorators, modifiers, name, parameters, type, body, location, flags) { - var node = createNode(151, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createGetAccessor(decorators, modifiers, name, parameters, type, body) { + var node = createSynthesizedNode(152); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); node.typeParameters = undefined; node.parameters = createNodeArray(parameters); node.type = type; @@ -10830,17 +11003,21 @@ var ts; } ts.createGetAccessor = createGetAccessor; function updateGetAccessor(node, decorators, modifiers, name, parameters, type, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createGetAccessor(decorators, modifiers, name, parameters, type, body, node, node.flags), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createGetAccessor(decorators, modifiers, name, parameters, type, body), node) + : node; } ts.updateGetAccessor = updateGetAccessor; - function createSetAccessor(decorators, modifiers, name, parameters, body, location, flags) { - var node = createNode(152, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createSetAccessor(decorators, modifiers, name, parameters, body) { + var node = createSynthesizedNode(153); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); node.typeParameters = undefined; node.parameters = createNodeArray(parameters); node.body = body; @@ -10848,57 +11025,60 @@ var ts; } ts.createSetAccessor = createSetAccessor; function updateSetAccessor(node, decorators, modifiers, name, parameters, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.parameters !== parameters || node.body !== body) { - return updateNode(createSetAccessor(decorators, modifiers, name, parameters, body, node, node.flags), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.parameters !== parameters + || node.body !== body + ? updateNode(createSetAccessor(decorators, modifiers, name, parameters, body), node) + : node; } ts.updateSetAccessor = updateSetAccessor; - function createObjectBindingPattern(elements, location) { - var node = createNode(172, location); + function createObjectBindingPattern(elements) { + var node = createSynthesizedNode(173); node.elements = createNodeArray(elements); return node; } ts.createObjectBindingPattern = createObjectBindingPattern; function updateObjectBindingPattern(node, elements) { - if (node.elements !== elements) { - return updateNode(createObjectBindingPattern(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createObjectBindingPattern(elements), node) + : node; } ts.updateObjectBindingPattern = updateObjectBindingPattern; - function createArrayBindingPattern(elements, location) { - var node = createNode(173, location); + function createArrayBindingPattern(elements) { + var node = createSynthesizedNode(174); node.elements = createNodeArray(elements); return node; } ts.createArrayBindingPattern = createArrayBindingPattern; function updateArrayBindingPattern(node, elements) { - if (node.elements !== elements) { - return updateNode(createArrayBindingPattern(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createArrayBindingPattern(elements), node) + : node; } ts.updateArrayBindingPattern = updateArrayBindingPattern; - function createBindingElement(propertyName, dotDotDotToken, name, initializer, location) { - var node = createNode(174, location); - node.propertyName = typeof propertyName === "string" ? createIdentifier(propertyName) : propertyName; + function createBindingElement(dotDotDotToken, propertyName, name, initializer) { + var node = createSynthesizedNode(175); node.dotDotDotToken = dotDotDotToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; + node.propertyName = asName(propertyName); + node.name = asName(name); node.initializer = initializer; return node; } ts.createBindingElement = createBindingElement; function updateBindingElement(node, dotDotDotToken, propertyName, name, initializer) { - if (node.propertyName !== propertyName || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.initializer !== initializer) { - return updateNode(createBindingElement(propertyName, dotDotDotToken, name, initializer, node), node); - } - return node; + return node.propertyName !== propertyName + || node.dotDotDotToken !== dotDotDotToken + || node.name !== name + || node.initializer !== initializer + ? updateNode(createBindingElement(dotDotDotToken, propertyName, name, initializer), node) + : node; } ts.updateBindingElement = updateBindingElement; - function createArrayLiteral(elements, location, multiLine) { - var node = createNode(175, location); - node.elements = parenthesizeListElements(createNodeArray(elements)); + function createArrayLiteral(elements, multiLine) { + var node = createSynthesizedNode(176); + node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) { node.multiLine = true; } @@ -10906,14 +11086,13 @@ var ts; } ts.createArrayLiteral = createArrayLiteral; function updateArrayLiteral(node, elements) { - if (node.elements !== elements) { - return updateNode(createArrayLiteral(elements, node, node.multiLine), node); - } - return node; + return node.elements !== elements + ? updateNode(createArrayLiteral(elements, node.multiLine), node) + : node; } ts.updateArrayLiteral = updateArrayLiteral; - function createObjectLiteral(properties, location, multiLine) { - var node = createNode(176, location); + function createObjectLiteral(properties, multiLine) { + var node = createSynthesizedNode(177); node.properties = createNodeArray(properties); if (multiLine) { node.multiLine = true; @@ -10922,431 +11101,461 @@ var ts; } ts.createObjectLiteral = createObjectLiteral; function updateObjectLiteral(node, properties) { - if (node.properties !== properties) { - return updateNode(createObjectLiteral(properties, node, node.multiLine), node); - } - return node; + return node.properties !== properties + ? updateNode(createObjectLiteral(properties, node.multiLine), node) + : node; } ts.updateObjectLiteral = updateObjectLiteral; - function createPropertyAccess(expression, name, location, flags) { - var node = createNode(177, location, flags); - node.expression = parenthesizeForAccess(expression); - (node.emitNode || (node.emitNode = {})).flags |= 65536; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createPropertyAccess(expression, name) { + var node = createSynthesizedNode(178); + node.expression = ts.parenthesizeForAccess(expression); + node.name = asName(name); + setEmitFlags(node, 65536); return node; } ts.createPropertyAccess = createPropertyAccess; function updatePropertyAccess(node, expression, name) { - if (node.expression !== expression || node.name !== name) { - var propertyAccess = createPropertyAccess(expression, name, node, node.flags); - (propertyAccess.emitNode || (propertyAccess.emitNode = {})).flags = getEmitFlags(node); - return updateNode(propertyAccess, node); - } - return node; + return node.expression !== expression + || node.name !== name + ? updateNode(setEmitFlags(createPropertyAccess(expression, name), getEmitFlags(node)), node) + : node; } ts.updatePropertyAccess = updatePropertyAccess; - function createElementAccess(expression, index, location) { - var node = createNode(178, location); - node.expression = parenthesizeForAccess(expression); - node.argumentExpression = typeof index === "number" ? createLiteral(index) : index; + function createElementAccess(expression, index) { + var node = createSynthesizedNode(179); + node.expression = ts.parenthesizeForAccess(expression); + node.argumentExpression = asExpression(index); return node; } ts.createElementAccess = createElementAccess; function updateElementAccess(node, expression, argumentExpression) { - if (node.expression !== expression || node.argumentExpression !== argumentExpression) { - return updateNode(createElementAccess(expression, argumentExpression, node), node); - } - return node; + return node.expression !== expression + || node.argumentExpression !== argumentExpression + ? updateNode(createElementAccess(expression, argumentExpression), node) + : node; } ts.updateElementAccess = updateElementAccess; - function createCall(expression, typeArguments, argumentsArray, location, flags) { - var node = createNode(179, location, flags); - node.expression = parenthesizeForAccess(expression); - if (typeArguments) { - node.typeArguments = createNodeArray(typeArguments); - } - node.arguments = parenthesizeListElements(createNodeArray(argumentsArray)); + function createCall(expression, typeArguments, argumentsArray) { + var node = createSynthesizedNode(180); + node.expression = ts.parenthesizeForAccess(expression); + node.typeArguments = asNodeArray(typeArguments); + node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); return node; } ts.createCall = createCall; function updateCall(node, expression, typeArguments, argumentsArray) { - if (expression !== node.expression || typeArguments !== node.typeArguments || argumentsArray !== node.arguments) { - return updateNode(createCall(expression, typeArguments, argumentsArray, node, node.flags), node); - } - return node; + return expression !== node.expression + || typeArguments !== node.typeArguments + || argumentsArray !== node.arguments + ? updateNode(createCall(expression, typeArguments, argumentsArray), node) + : node; } ts.updateCall = updateCall; - function createNew(expression, typeArguments, argumentsArray, location, flags) { - var node = createNode(180, location, flags); - node.expression = parenthesizeForNew(expression); - node.typeArguments = typeArguments ? createNodeArray(typeArguments) : undefined; - node.arguments = argumentsArray ? parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; + function createNew(expression, typeArguments, argumentsArray) { + var node = createSynthesizedNode(181); + node.expression = ts.parenthesizeForNew(expression); + node.typeArguments = asNodeArray(typeArguments); + node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; return node; } ts.createNew = createNew; function updateNew(node, expression, typeArguments, argumentsArray) { - if (node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray) { - return updateNode(createNew(expression, typeArguments, argumentsArray, node, node.flags), node); - } - return node; + return node.expression !== expression + || node.typeArguments !== typeArguments + || node.arguments !== argumentsArray + ? updateNode(createNew(expression, typeArguments, argumentsArray), node) + : node; } ts.updateNew = updateNew; - function createTaggedTemplate(tag, template, location) { - var node = createNode(181, location); - node.tag = parenthesizeForAccess(tag); + function createTaggedTemplate(tag, template) { + var node = createSynthesizedNode(182); + node.tag = ts.parenthesizeForAccess(tag); node.template = template; return node; } ts.createTaggedTemplate = createTaggedTemplate; function updateTaggedTemplate(node, tag, template) { - if (node.tag !== tag || node.template !== template) { - return updateNode(createTaggedTemplate(tag, template, node), node); - } - return node; + return node.tag !== tag + || node.template !== template + ? updateNode(createTaggedTemplate(tag, template), node) + : node; } ts.updateTaggedTemplate = updateTaggedTemplate; - function createParen(expression, location) { - var node = createNode(183, location); + function createTypeAssertion(type, expression) { + var node = createSynthesizedNode(183); + node.type = type; + node.expression = ts.parenthesizePrefixOperand(expression); + return node; + } + ts.createTypeAssertion = createTypeAssertion; + function updateTypeAssertion(node, type, expression) { + return node.type !== type + || node.expression !== expression + ? updateNode(createTypeAssertion(type, expression), node) + : node; + } + ts.updateTypeAssertion = updateTypeAssertion; + function createParen(expression) { + var node = createSynthesizedNode(184); node.expression = expression; return node; } ts.createParen = createParen; function updateParen(node, expression) { - if (node.expression !== expression) { - return updateNode(createParen(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createParen(expression), node) + : node; } ts.updateParen = updateParen; - function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) { - var node = createNode(184, location, flags); - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + var node = createSynthesizedNode(185); + node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.body = body; return node; } ts.createFunctionExpression = createFunctionExpression; - function updateFunctionExpression(node, modifiers, name, typeParameters, parameters, type, body) { - if (node.name !== name || node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createFunctionExpression(modifiers, node.asteriskToken, name, typeParameters, parameters, type, body, node, node.flags), node); - } - return node; + function updateFunctionExpression(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + return node.name !== name + || node.modifiers !== modifiers + || node.asteriskToken !== asteriskToken + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) + : node; } ts.updateFunctionExpression = updateFunctionExpression; - function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body, location, flags) { - var node = createNode(185, location, flags); - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { + var node = createSynthesizedNode(186); + node.modifiers = asNodeArray(modifiers); + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.equalsGreaterThanToken = equalsGreaterThanToken || createToken(35); - node.body = parenthesizeConciseBody(body); + node.body = ts.parenthesizeConciseBody(body); return node; } ts.createArrowFunction = createArrowFunction; function updateArrowFunction(node, modifiers, typeParameters, parameters, type, body) { - if (node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createArrowFunction(modifiers, typeParameters, parameters, type, node.equalsGreaterThanToken, body, node, node.flags), node); - } - return node; + return node.modifiers !== modifiers + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createArrowFunction(modifiers, typeParameters, parameters, type, node.equalsGreaterThanToken, body), node) + : node; } ts.updateArrowFunction = updateArrowFunction; - function createDelete(expression, location) { - var node = createNode(186, location); - node.expression = parenthesizePrefixOperand(expression); + function createDelete(expression) { + var node = createSynthesizedNode(187); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createDelete = createDelete; function updateDelete(node, expression) { - if (node.expression !== expression) { - return updateNode(createDelete(expression, node), expression); - } - return node; + return node.expression !== expression + ? updateNode(createDelete(expression), node) + : node; } ts.updateDelete = updateDelete; - function createTypeOf(expression, location) { - var node = createNode(187, location); - node.expression = parenthesizePrefixOperand(expression); + function createTypeOf(expression) { + var node = createSynthesizedNode(188); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createTypeOf = createTypeOf; function updateTypeOf(node, expression) { - if (node.expression !== expression) { - return updateNode(createTypeOf(expression, node), expression); - } - return node; + return node.expression !== expression + ? updateNode(createTypeOf(expression), node) + : node; } ts.updateTypeOf = updateTypeOf; - function createVoid(expression, location) { - var node = createNode(188, location); - node.expression = parenthesizePrefixOperand(expression); + function createVoid(expression) { + var node = createSynthesizedNode(189); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createVoid = createVoid; function updateVoid(node, expression) { - if (node.expression !== expression) { - return updateNode(createVoid(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createVoid(expression), node) + : node; } ts.updateVoid = updateVoid; - function createAwait(expression, location) { - var node = createNode(189, location); - node.expression = parenthesizePrefixOperand(expression); + function createAwait(expression) { + var node = createSynthesizedNode(190); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createAwait = createAwait; function updateAwait(node, expression) { - if (node.expression !== expression) { - return updateNode(createAwait(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createAwait(expression), node) + : node; } ts.updateAwait = updateAwait; - function createPrefix(operator, operand, location) { - var node = createNode(190, location); + function createPrefix(operator, operand) { + var node = createSynthesizedNode(191); node.operator = operator; - node.operand = parenthesizePrefixOperand(operand); + node.operand = ts.parenthesizePrefixOperand(operand); return node; } ts.createPrefix = createPrefix; function updatePrefix(node, operand) { - if (node.operand !== operand) { - return updateNode(createPrefix(node.operator, operand, node), node); - } - return node; + return node.operand !== operand + ? updateNode(createPrefix(node.operator, operand), node) + : node; } ts.updatePrefix = updatePrefix; - function createPostfix(operand, operator, location) { - var node = createNode(191, location); - node.operand = parenthesizePostfixOperand(operand); + function createPostfix(operand, operator) { + var node = createSynthesizedNode(192); + node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; } ts.createPostfix = createPostfix; function updatePostfix(node, operand) { - if (node.operand !== operand) { - return updateNode(createPostfix(operand, node.operator, node), node); - } - return node; + return node.operand !== operand + ? updateNode(createPostfix(operand, node.operator), node) + : node; } ts.updatePostfix = updatePostfix; - function createBinary(left, operator, right, location) { - var operatorToken = typeof operator === "number" ? createToken(operator) : operator; + function createBinary(left, operator, right) { + var node = createSynthesizedNode(193); + var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; - var node = createNode(192, location); - node.left = parenthesizeBinaryOperand(operatorKind, left, true, undefined); + node.left = ts.parenthesizeBinaryOperand(operatorKind, left, true, undefined); node.operatorToken = operatorToken; - node.right = parenthesizeBinaryOperand(operatorKind, right, false, node.left); + node.right = ts.parenthesizeBinaryOperand(operatorKind, right, false, node.left); return node; } ts.createBinary = createBinary; function updateBinary(node, left, right) { - if (node.left !== left || node.right !== right) { - return updateNode(createBinary(left, node.operatorToken, right, node), node); - } - return node; + return node.left !== left + || node.right !== right + ? updateNode(createBinary(left, node.operatorToken, right), node) + : node; } ts.updateBinary = updateBinary; - function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonTokenOrLocation, whenFalse, location) { - var node = createNode(193, whenFalse ? location : colonTokenOrLocation); - node.condition = parenthesizeForConditionalHead(condition); - if (whenFalse) { - node.questionToken = questionTokenOrWhenTrue; - node.whenTrue = parenthesizeSubexpressionOfConditionalExpression(whenTrueOrWhenFalse); - node.colonToken = colonTokenOrLocation; - node.whenFalse = parenthesizeSubexpressionOfConditionalExpression(whenFalse); - } - else { - node.questionToken = createToken(54); - node.whenTrue = parenthesizeSubexpressionOfConditionalExpression(questionTokenOrWhenTrue); - node.colonToken = createToken(55); - node.whenFalse = parenthesizeSubexpressionOfConditionalExpression(whenTrueOrWhenFalse); - } + function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { + var node = createSynthesizedNode(194); + node.condition = ts.parenthesizeForConditionalHead(condition); + node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(54); + node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); + node.colonToken = whenFalse ? colonToken : createToken(55); + node.whenFalse = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenFalse : whenTrueOrWhenFalse); return node; } ts.createConditional = createConditional; function updateConditional(node, condition, whenTrue, whenFalse) { - if (node.condition !== condition || node.whenTrue !== whenTrue || node.whenFalse !== whenFalse) { - return updateNode(createConditional(condition, node.questionToken, whenTrue, node.colonToken, whenFalse, node), node); - } - return node; + return node.condition !== condition + || node.whenTrue !== whenTrue + || node.whenFalse !== whenFalse + ? updateNode(createConditional(condition, node.questionToken, whenTrue, node.colonToken, whenFalse), node) + : node; } ts.updateConditional = updateConditional; - function createTemplateExpression(head, templateSpans, location) { - var node = createNode(194, location); + function createTemplateExpression(head, templateSpans) { + var node = createSynthesizedNode(195); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; } ts.createTemplateExpression = createTemplateExpression; function updateTemplateExpression(node, head, templateSpans) { - if (node.head !== head || node.templateSpans !== templateSpans) { - return updateNode(createTemplateExpression(head, templateSpans, node), node); - } - return node; + return node.head !== head + || node.templateSpans !== templateSpans + ? updateNode(createTemplateExpression(head, templateSpans), node) + : node; } ts.updateTemplateExpression = updateTemplateExpression; - function createYield(asteriskToken, expression, location) { - var node = createNode(195, location); - node.asteriskToken = asteriskToken; - node.expression = expression; + function createYield(asteriskTokenOrExpression, expression) { + var node = createSynthesizedNode(196); + node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 38 ? asteriskTokenOrExpression : undefined; + node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 38 ? asteriskTokenOrExpression : expression; return node; } ts.createYield = createYield; - function updateYield(node, expression) { - if (node.expression !== expression) { - return updateNode(createYield(node.asteriskToken, expression, node), node); - } - return node; + function updateYield(node, asteriskToken, expression) { + return node.expression !== expression + || node.asteriskToken !== asteriskToken + ? updateNode(createYield(asteriskToken, expression), node) + : node; } ts.updateYield = updateYield; - function createSpread(expression, location) { - var node = createNode(196, location); - node.expression = parenthesizeExpressionForList(expression); + function createSpread(expression) { + var node = createSynthesizedNode(197); + node.expression = ts.parenthesizeExpressionForList(expression); return node; } ts.createSpread = createSpread; function updateSpread(node, expression) { - if (node.expression !== expression) { - return updateNode(createSpread(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createSpread(expression), node) + : node; } ts.updateSpread = updateSpread; - function createClassExpression(modifiers, name, typeParameters, heritageClauses, members, location) { - var node = createNode(197, location); + function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { + var node = createSynthesizedNode(198); node.decorators = undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; - node.heritageClauses = createNodeArray(heritageClauses); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); + node.heritageClauses = asNodeArray(heritageClauses); node.members = createNodeArray(members); return node; } ts.createClassExpression = createClassExpression; function updateClassExpression(node, modifiers, name, typeParameters, heritageClauses, members) { - if (node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members) { - return updateNode(createClassExpression(modifiers, name, typeParameters, heritageClauses, members, node), node); - } - return node; + return node.modifiers !== modifiers + || node.name !== name + || node.typeParameters !== typeParameters + || node.heritageClauses !== heritageClauses + || node.members !== members + ? updateNode(createClassExpression(modifiers, name, typeParameters, heritageClauses, members), node) + : node; } ts.updateClassExpression = updateClassExpression; - function createOmittedExpression(location) { - var node = createNode(198, location); - return node; + function createOmittedExpression() { + return createSynthesizedNode(199); } ts.createOmittedExpression = createOmittedExpression; - function createExpressionWithTypeArguments(typeArguments, expression, location) { - var node = createNode(199, location); - node.typeArguments = typeArguments ? createNodeArray(typeArguments) : undefined; - node.expression = parenthesizeForAccess(expression); + function createExpressionWithTypeArguments(typeArguments, expression) { + var node = createSynthesizedNode(200); + node.expression = ts.parenthesizeForAccess(expression); + node.typeArguments = asNodeArray(typeArguments); return node; } ts.createExpressionWithTypeArguments = createExpressionWithTypeArguments; function updateExpressionWithTypeArguments(node, typeArguments, expression) { - if (node.typeArguments !== typeArguments || node.expression !== expression) { - return updateNode(createExpressionWithTypeArguments(typeArguments, expression, node), node); - } - return node; + return node.typeArguments !== typeArguments + || node.expression !== expression + ? updateNode(createExpressionWithTypeArguments(typeArguments, expression), node) + : node; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; - function createTemplateSpan(expression, literal, location) { - var node = createNode(202, location); + function createAsExpression(expression, type) { + var node = createSynthesizedNode(201); + node.expression = expression; + node.type = type; + return node; + } + ts.createAsExpression = createAsExpression; + function updateAsExpression(node, expression, type) { + return node.expression !== expression + || node.type !== type + ? updateNode(createAsExpression(expression, type), node) + : node; + } + ts.updateAsExpression = updateAsExpression; + function createNonNullExpression(expression) { + var node = createSynthesizedNode(202); + node.expression = ts.parenthesizeForAccess(expression); + return node; + } + ts.createNonNullExpression = createNonNullExpression; + function updateNonNullExpression(node, expression) { + return node.expression !== expression + ? updateNode(createNonNullExpression(expression), node) + : node; + } + ts.updateNonNullExpression = updateNonNullExpression; + function createTemplateSpan(expression, literal) { + var node = createSynthesizedNode(204); node.expression = expression; node.literal = literal; return node; } ts.createTemplateSpan = createTemplateSpan; function updateTemplateSpan(node, expression, literal) { - if (node.expression !== expression || node.literal !== literal) { - return updateNode(createTemplateSpan(expression, literal, node), node); - } - return node; + return node.expression !== expression + || node.literal !== literal + ? updateNode(createTemplateSpan(expression, literal), node) + : node; } ts.updateTemplateSpan = updateTemplateSpan; - function createBlock(statements, location, multiLine, flags) { - var block = createNode(204, location, flags); + function createBlock(statements, multiLine) { + var block = createSynthesizedNode(206); block.statements = createNodeArray(statements); - if (multiLine) { - block.multiLine = true; - } + if (multiLine) + block.multiLine = multiLine; return block; } ts.createBlock = createBlock; function updateBlock(node, statements) { - if (statements !== node.statements) { - return updateNode(createBlock(statements, node, node.multiLine, node.flags), node); - } - return node; + return statements !== node.statements + ? updateNode(createBlock(statements, node.multiLine), node) + : node; } ts.updateBlock = updateBlock; - function createVariableStatement(modifiers, declarationList, location, flags) { - var node = createNode(205, location, flags); + function createVariableStatement(modifiers, declarationList) { + var node = createSynthesizedNode(207); node.decorators = undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; return node; } ts.createVariableStatement = createVariableStatement; function updateVariableStatement(node, modifiers, declarationList) { - if (node.modifiers !== modifiers || node.declarationList !== declarationList) { - return updateNode(createVariableStatement(modifiers, declarationList, node, node.flags), node); - } - return node; + return node.modifiers !== modifiers + || node.declarationList !== declarationList + ? updateNode(createVariableStatement(modifiers, declarationList), node) + : node; } ts.updateVariableStatement = updateVariableStatement; - function createVariableDeclarationList(declarations, location, flags) { - var node = createNode(224, location, flags); + function createVariableDeclarationList(declarations, flags) { + var node = createSynthesizedNode(226); + node.flags |= flags; node.declarations = createNodeArray(declarations); return node; } ts.createVariableDeclarationList = createVariableDeclarationList; function updateVariableDeclarationList(node, declarations) { - if (node.declarations !== declarations) { - return updateNode(createVariableDeclarationList(declarations, node, node.flags), node); - } - return node; + return node.declarations !== declarations + ? updateNode(createVariableDeclarationList(declarations, node.flags), node) + : node; } ts.updateVariableDeclarationList = updateVariableDeclarationList; - function createVariableDeclaration(name, type, initializer, location, flags) { - var node = createNode(223, location, flags); - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createVariableDeclaration(name, type, initializer) { + var node = createSynthesizedNode(225); + node.name = asName(name); node.type = type; - node.initializer = initializer !== undefined ? parenthesizeExpressionForList(initializer) : undefined; + node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; return node; } ts.createVariableDeclaration = createVariableDeclaration; function updateVariableDeclaration(node, name, type, initializer) { - if (node.name !== name || node.type !== type || node.initializer !== initializer) { - return updateNode(createVariableDeclaration(name, type, initializer, node, node.flags), node); - } - return node; + return node.name !== name + || node.type !== type + || node.initializer !== initializer + ? updateNode(createVariableDeclaration(name, type, initializer), node) + : node; } ts.updateVariableDeclaration = updateVariableDeclaration; - function createEmptyStatement(location) { - return createNode(206, location); + function createEmptyStatement() { + return createSynthesizedNode(208); } ts.createEmptyStatement = createEmptyStatement; - function createStatement(expression, location, flags) { - var node = createNode(207, location, flags); - node.expression = parenthesizeExpressionForExpressionStatement(expression); + function createStatement(expression) { + var node = createSynthesizedNode(209); + node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } ts.createStatement = createStatement; function updateStatement(node, expression) { - if (node.expression !== expression) { - return updateNode(createStatement(expression, node, node.flags), node); - } - return node; + return node.expression !== expression + ? updateNode(createStatement(expression), node) + : node; } ts.updateStatement = updateStatement; - function createIf(expression, thenStatement, elseStatement, location) { - var node = createNode(208, location); + function createIf(expression, thenStatement, elseStatement) { + var node = createSynthesizedNode(210); node.expression = expression; node.thenStatement = thenStatement; node.elseStatement = elseStatement; @@ -11354,42 +11563,43 @@ var ts; } ts.createIf = createIf; function updateIf(node, expression, thenStatement, elseStatement) { - if (node.expression !== expression || node.thenStatement !== thenStatement || node.elseStatement !== elseStatement) { - return updateNode(createIf(expression, thenStatement, elseStatement, node), node); - } - return node; + return node.expression !== expression + || node.thenStatement !== thenStatement + || node.elseStatement !== elseStatement + ? updateNode(createIf(expression, thenStatement, elseStatement), node) + : node; } ts.updateIf = updateIf; - function createDo(statement, expression, location) { - var node = createNode(209, location); + function createDo(statement, expression) { + var node = createSynthesizedNode(211); node.statement = statement; node.expression = expression; return node; } ts.createDo = createDo; function updateDo(node, statement, expression) { - if (node.statement !== statement || node.expression !== expression) { - return updateNode(createDo(statement, expression, node), node); - } - return node; + return node.statement !== statement + || node.expression !== expression + ? updateNode(createDo(statement, expression), node) + : node; } ts.updateDo = updateDo; - function createWhile(expression, statement, location) { - var node = createNode(210, location); + function createWhile(expression, statement) { + var node = createSynthesizedNode(212); node.expression = expression; node.statement = statement; return node; } ts.createWhile = createWhile; function updateWhile(node, expression, statement) { - if (node.expression !== expression || node.statement !== statement) { - return updateNode(createWhile(expression, statement, node), node); - } - return node; + return node.expression !== expression + || node.statement !== statement + ? updateNode(createWhile(expression, statement), node) + : node; } ts.updateWhile = updateWhile; - function createFor(initializer, condition, incrementor, statement, location) { - var node = createNode(211, location, undefined); + function createFor(initializer, condition, incrementor, statement) { + var node = createSynthesizedNode(213); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -11398,14 +11608,16 @@ var ts; } ts.createFor = createFor; function updateFor(node, initializer, condition, incrementor, statement) { - if (node.initializer !== initializer || node.condition !== condition || node.incrementor !== incrementor || node.statement !== statement) { - return updateNode(createFor(initializer, condition, incrementor, statement, node), node); - } - return node; + return node.initializer !== initializer + || node.condition !== condition + || node.incrementor !== incrementor + || node.statement !== statement + ? updateNode(createFor(initializer, condition, incrementor, statement), node) + : node; } ts.updateFor = updateFor; - function createForIn(initializer, expression, statement, location) { - var node = createNode(212, location); + function createForIn(initializer, expression, statement) { + var node = createSynthesizedNode(214); node.initializer = initializer; node.expression = expression; node.statement = statement; @@ -11413,127 +11625,123 @@ var ts; } ts.createForIn = createForIn; function updateForIn(node, initializer, expression, statement) { - if (node.initializer !== initializer || node.expression !== expression || node.statement !== statement) { - return updateNode(createForIn(initializer, expression, statement, node), node); - } - return node; + return node.initializer !== initializer + || node.expression !== expression + || node.statement !== statement + ? updateNode(createForIn(initializer, expression, statement), node) + : node; } ts.updateForIn = updateForIn; - function createForOf(initializer, expression, statement, location) { - var node = createNode(213, location); + function createForOf(awaitModifier, initializer, expression, statement) { + var node = createSynthesizedNode(215); + node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = expression; node.statement = statement; return node; } ts.createForOf = createForOf; - function updateForOf(node, initializer, expression, statement) { - if (node.initializer !== initializer || node.expression !== expression || node.statement !== statement) { - return updateNode(createForOf(initializer, expression, statement, node), node); - } - return node; + function updateForOf(node, awaitModifier, initializer, expression, statement) { + return node.awaitModifier !== awaitModifier + || node.initializer !== initializer + || node.expression !== expression + || node.statement !== statement + ? updateNode(createForOf(awaitModifier, initializer, expression, statement), node) + : node; } ts.updateForOf = updateForOf; - function createContinue(label, location) { - var node = createNode(214, location); - if (label) { - node.label = label; - } + function createContinue(label) { + var node = createSynthesizedNode(216); + node.label = asName(label); return node; } ts.createContinue = createContinue; function updateContinue(node, label) { - if (node.label !== label) { - return updateNode(createContinue(label, node), node); - } - return node; + return node.label !== label + ? updateNode(createContinue(label), node) + : node; } ts.updateContinue = updateContinue; - function createBreak(label, location) { - var node = createNode(215, location); - if (label) { - node.label = label; - } + function createBreak(label) { + var node = createSynthesizedNode(217); + node.label = asName(label); return node; } ts.createBreak = createBreak; function updateBreak(node, label) { - if (node.label !== label) { - return updateNode(createBreak(label, node), node); - } - return node; + return node.label !== label + ? updateNode(createBreak(label), node) + : node; } ts.updateBreak = updateBreak; - function createReturn(expression, location) { - var node = createNode(216, location); + function createReturn(expression) { + var node = createSynthesizedNode(218); node.expression = expression; return node; } ts.createReturn = createReturn; function updateReturn(node, expression) { - if (node.expression !== expression) { - return updateNode(createReturn(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createReturn(expression), node) + : node; } ts.updateReturn = updateReturn; - function createWith(expression, statement, location) { - var node = createNode(217, location); + function createWith(expression, statement) { + var node = createSynthesizedNode(219); node.expression = expression; node.statement = statement; return node; } ts.createWith = createWith; function updateWith(node, expression, statement) { - if (node.expression !== expression || node.statement !== statement) { - return updateNode(createWith(expression, statement, node), node); - } - return node; + return node.expression !== expression + || node.statement !== statement + ? updateNode(createWith(expression, statement), node) + : node; } ts.updateWith = updateWith; - function createSwitch(expression, caseBlock, location) { - var node = createNode(218, location); - node.expression = parenthesizeExpressionForList(expression); + function createSwitch(expression, caseBlock) { + var node = createSynthesizedNode(220); + node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; } ts.createSwitch = createSwitch; function updateSwitch(node, expression, caseBlock) { - if (node.expression !== expression || node.caseBlock !== caseBlock) { - return updateNode(createSwitch(expression, caseBlock, node), node); - } - return node; + return node.expression !== expression + || node.caseBlock !== caseBlock + ? updateNode(createSwitch(expression, caseBlock), node) + : node; } ts.updateSwitch = updateSwitch; - function createLabel(label, statement, location) { - var node = createNode(219, location); - node.label = typeof label === "string" ? createIdentifier(label) : label; + function createLabel(label, statement) { + var node = createSynthesizedNode(221); + node.label = asName(label); node.statement = statement; return node; } ts.createLabel = createLabel; function updateLabel(node, label, statement) { - if (node.label !== label || node.statement !== statement) { - return updateNode(createLabel(label, statement, node), node); - } - return node; + return node.label !== label + || node.statement !== statement + ? updateNode(createLabel(label, statement), node) + : node; } ts.updateLabel = updateLabel; - function createThrow(expression, location) { - var node = createNode(220, location); + function createThrow(expression) { + var node = createSynthesizedNode(222); node.expression = expression; return node; } ts.createThrow = createThrow; function updateThrow(node, expression) { - if (node.expression !== expression) { - return updateNode(createThrow(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createThrow(expression), node) + : node; } ts.updateThrow = updateThrow; - function createTry(tryBlock, catchClause, finallyBlock, location) { - var node = createNode(221, location); + function createTry(tryBlock, catchClause, finallyBlock) { + var node = createSynthesizedNode(223); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -11541,194 +11749,284 @@ var ts; } ts.createTry = createTry; function updateTry(node, tryBlock, catchClause, finallyBlock) { - if (node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock) { - return updateNode(createTry(tryBlock, catchClause, finallyBlock, node), node); - } - return node; + return node.tryBlock !== tryBlock + || node.catchClause !== catchClause + || node.finallyBlock !== finallyBlock + ? updateNode(createTry(tryBlock, catchClause, finallyBlock), node) + : node; } ts.updateTry = updateTry; - function createCaseBlock(clauses, location) { - var node = createNode(232, location); - node.clauses = createNodeArray(clauses); - return node; - } - ts.createCaseBlock = createCaseBlock; - function updateCaseBlock(node, clauses) { - if (node.clauses !== clauses) { - return updateNode(createCaseBlock(clauses, node), node); - } - return node; - } - ts.updateCaseBlock = updateCaseBlock; - function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) { - var node = createNode(225, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + var node = createSynthesizedNode(227); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.body = body; return node; } ts.createFunctionDeclaration = createFunctionDeclaration; - function updateFunctionDeclaration(node, decorators, modifiers, name, typeParameters, parameters, type, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createFunctionDeclaration(decorators, modifiers, node.asteriskToken, name, typeParameters, parameters, type, body, node, node.flags), node); - } - return node; + function updateFunctionDeclaration(node, decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.asteriskToken !== asteriskToken + || node.name !== name + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) + : node; } ts.updateFunctionDeclaration = updateFunctionDeclaration; - function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members, location) { - var node = createNode(226, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; - node.heritageClauses = createNodeArray(heritageClauses); + function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { + var node = createSynthesizedNode(228); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); + node.heritageClauses = asNodeArray(heritageClauses); node.members = createNodeArray(members); return node; } ts.createClassDeclaration = createClassDeclaration; function updateClassDeclaration(node, decorators, modifiers, name, typeParameters, heritageClauses, members) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members) { - return updateNode(createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.typeParameters !== typeParameters + || node.heritageClauses !== heritageClauses + || node.members !== members + ? updateNode(createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members), node) + : node; } ts.updateClassDeclaration = updateClassDeclaration; - function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier, location) { - var node = createNode(235, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createEnumDeclaration(decorators, modifiers, name, members) { + var node = createSynthesizedNode(231); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.members = createNodeArray(members); + return node; + } + ts.createEnumDeclaration = createEnumDeclaration; + function updateEnumDeclaration(node, decorators, modifiers, name, members) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.members !== members + ? updateNode(createEnumDeclaration(decorators, modifiers, name, members), node) + : node; + } + ts.updateEnumDeclaration = updateEnumDeclaration; + function createModuleDeclaration(decorators, modifiers, name, body, flags) { + var node = createSynthesizedNode(232); + node.flags |= flags; + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = name; + node.body = body; + return node; + } + ts.createModuleDeclaration = createModuleDeclaration; + function updateModuleDeclaration(node, decorators, modifiers, name, body) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.body !== body + ? updateNode(createModuleDeclaration(decorators, modifiers, name, body, node.flags), node) + : node; + } + ts.updateModuleDeclaration = updateModuleDeclaration; + function createModuleBlock(statements) { + var node = createSynthesizedNode(233); + node.statements = createNodeArray(statements); + return node; + } + ts.createModuleBlock = createModuleBlock; + function updateModuleBlock(node, statements) { + return node.statements !== statements + ? updateNode(createModuleBlock(statements), node) + : node; + } + ts.updateModuleBlock = updateModuleBlock; + function createCaseBlock(clauses) { + var node = createSynthesizedNode(234); + node.clauses = createNodeArray(clauses); + return node; + } + ts.createCaseBlock = createCaseBlock; + function updateCaseBlock(node, clauses) { + return node.clauses !== clauses + ? updateNode(createCaseBlock(clauses), node) + : node; + } + ts.updateCaseBlock = updateCaseBlock; + function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { + var node = createSynthesizedNode(236); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.moduleReference = moduleReference; + return node; + } + ts.createImportEqualsDeclaration = createImportEqualsDeclaration; + function updateImportEqualsDeclaration(node, decorators, modifiers, name, moduleReference) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.moduleReference !== moduleReference + ? updateNode(createImportEqualsDeclaration(decorators, modifiers, name, moduleReference), node) + : node; + } + ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; + function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { + var node = createSynthesizedNode(237); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.importClause = importClause; node.moduleSpecifier = moduleSpecifier; return node; } ts.createImportDeclaration = createImportDeclaration; function updateImportDeclaration(node, decorators, modifiers, importClause, moduleSpecifier) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier) { - return updateNode(createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier + ? updateNode(createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier), node) + : node; } ts.updateImportDeclaration = updateImportDeclaration; - function createImportClause(name, namedBindings, location) { - var node = createNode(236, location); + function createImportClause(name, namedBindings) { + var node = createSynthesizedNode(238); node.name = name; node.namedBindings = namedBindings; return node; } ts.createImportClause = createImportClause; function updateImportClause(node, name, namedBindings) { - if (node.name !== name || node.namedBindings !== namedBindings) { - return updateNode(createImportClause(name, namedBindings, node), node); - } - return node; + return node.name !== name + || node.namedBindings !== namedBindings + ? updateNode(createImportClause(name, namedBindings), node) + : node; } ts.updateImportClause = updateImportClause; - function createNamespaceImport(name, location) { - var node = createNode(237, location); + function createNamespaceImport(name) { + var node = createSynthesizedNode(239); node.name = name; return node; } ts.createNamespaceImport = createNamespaceImport; function updateNamespaceImport(node, name) { - if (node.name !== name) { - return updateNode(createNamespaceImport(name, node), node); - } - return node; + return node.name !== name + ? updateNode(createNamespaceImport(name), node) + : node; } ts.updateNamespaceImport = updateNamespaceImport; - function createNamedImports(elements, location) { - var node = createNode(238, location); + function createNamedImports(elements) { + var node = createSynthesizedNode(240); node.elements = createNodeArray(elements); return node; } ts.createNamedImports = createNamedImports; function updateNamedImports(node, elements) { - if (node.elements !== elements) { - return updateNode(createNamedImports(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createNamedImports(elements), node) + : node; } ts.updateNamedImports = updateNamedImports; - function createImportSpecifier(propertyName, name, location) { - var node = createNode(239, location); + function createImportSpecifier(propertyName, name) { + var node = createSynthesizedNode(241); node.propertyName = propertyName; node.name = name; return node; } ts.createImportSpecifier = createImportSpecifier; function updateImportSpecifier(node, propertyName, name) { - if (node.propertyName !== propertyName || node.name !== name) { - return updateNode(createImportSpecifier(propertyName, name, node), node); - } - return node; + return node.propertyName !== propertyName + || node.name !== name + ? updateNode(createImportSpecifier(propertyName, name), node) + : node; } ts.updateImportSpecifier = updateImportSpecifier; - function createExportAssignment(decorators, modifiers, isExportEquals, expression, location) { - var node = createNode(240, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createExportAssignment(decorators, modifiers, isExportEquals, expression) { + var node = createSynthesizedNode(242); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; node.expression = expression; return node; } ts.createExportAssignment = createExportAssignment; function updateExportAssignment(node, decorators, modifiers, expression) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.expression !== expression) { - return updateNode(createExportAssignment(decorators, modifiers, node.isExportEquals, expression, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.expression !== expression + ? updateNode(createExportAssignment(decorators, modifiers, node.isExportEquals, expression), node) + : node; } ts.updateExportAssignment = updateExportAssignment; - function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, location) { - var node = createNode(241, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier) { + var node = createSynthesizedNode(243); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.exportClause = exportClause; node.moduleSpecifier = moduleSpecifier; return node; } ts.createExportDeclaration = createExportDeclaration; function updateExportDeclaration(node, decorators, modifiers, exportClause, moduleSpecifier) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier) { - return updateNode(createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.exportClause !== exportClause + || node.moduleSpecifier !== moduleSpecifier + ? updateNode(createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier), node) + : node; } ts.updateExportDeclaration = updateExportDeclaration; - function createNamedExports(elements, location) { - var node = createNode(242, location); + function createNamedExports(elements) { + var node = createSynthesizedNode(244); node.elements = createNodeArray(elements); return node; } ts.createNamedExports = createNamedExports; function updateNamedExports(node, elements) { - if (node.elements !== elements) { - return updateNode(createNamedExports(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createNamedExports(elements), node) + : node; } ts.updateNamedExports = updateNamedExports; - function createExportSpecifier(name, propertyName, location) { - var node = createNode(243, location); - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.propertyName = typeof propertyName === "string" ? createIdentifier(propertyName) : propertyName; + function createExportSpecifier(propertyName, name) { + var node = createSynthesizedNode(245); + node.propertyName = asName(propertyName); + node.name = asName(name); return node; } ts.createExportSpecifier = createExportSpecifier; - function updateExportSpecifier(node, name, propertyName) { - if (node.name !== name || node.propertyName !== propertyName) { - return updateNode(createExportSpecifier(name, propertyName, node), node); - } - return node; + function updateExportSpecifier(node, propertyName, name) { + return node.propertyName !== propertyName + || node.name !== name + ? updateNode(createExportSpecifier(propertyName, name), node) + : node; } ts.updateExportSpecifier = updateExportSpecifier; - function createJsxElement(openingElement, children, closingElement, location) { - var node = createNode(246, location); + function createExternalModuleReference(expression) { + var node = createSynthesizedNode(247); + node.expression = expression; + return node; + } + ts.createExternalModuleReference = createExternalModuleReference; + function updateExternalModuleReference(node, expression) { + return node.expression !== expression + ? updateNode(createExternalModuleReference(expression), node) + : node; + } + ts.updateExternalModuleReference = updateExternalModuleReference; + function createJsxElement(openingElement, children, closingElement) { + var node = createSynthesizedNode(248); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -11736,95 +12034,107 @@ var ts; } ts.createJsxElement = createJsxElement; function updateJsxElement(node, openingElement, children, closingElement) { - if (node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement) { - return updateNode(createJsxElement(openingElement, children, closingElement, node), node); - } - return node; + return node.openingElement !== openingElement + || node.children !== children + || node.closingElement !== closingElement + ? updateNode(createJsxElement(openingElement, children, closingElement), node) + : node; } ts.updateJsxElement = updateJsxElement; - function createJsxSelfClosingElement(tagName, attributes, location) { - var node = createNode(247, location); + function createJsxSelfClosingElement(tagName, attributes) { + var node = createSynthesizedNode(249); node.tagName = tagName; - node.attributes = createNodeArray(attributes); + node.attributes = attributes; return node; } ts.createJsxSelfClosingElement = createJsxSelfClosingElement; function updateJsxSelfClosingElement(node, tagName, attributes) { - if (node.tagName !== tagName || node.attributes !== attributes) { - return updateNode(createJsxSelfClosingElement(tagName, attributes, node), node); - } - return node; + return node.tagName !== tagName + || node.attributes !== attributes + ? updateNode(createJsxSelfClosingElement(tagName, attributes), node) + : node; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; - function createJsxOpeningElement(tagName, attributes, location) { - var node = createNode(248, location); + function createJsxOpeningElement(tagName, attributes) { + var node = createSynthesizedNode(250); node.tagName = tagName; - node.attributes = createNodeArray(attributes); + node.attributes = attributes; return node; } ts.createJsxOpeningElement = createJsxOpeningElement; function updateJsxOpeningElement(node, tagName, attributes) { - if (node.tagName !== tagName || node.attributes !== attributes) { - return updateNode(createJsxOpeningElement(tagName, attributes, node), node); - } - return node; + return node.tagName !== tagName + || node.attributes !== attributes + ? updateNode(createJsxOpeningElement(tagName, attributes), node) + : node; } ts.updateJsxOpeningElement = updateJsxOpeningElement; - function createJsxClosingElement(tagName, location) { - var node = createNode(249, location); + function createJsxClosingElement(tagName) { + var node = createSynthesizedNode(251); node.tagName = tagName; return node; } ts.createJsxClosingElement = createJsxClosingElement; function updateJsxClosingElement(node, tagName) { - if (node.tagName !== tagName) { - return updateNode(createJsxClosingElement(tagName, node), node); - } - return node; + return node.tagName !== tagName + ? updateNode(createJsxClosingElement(tagName), node) + : node; } ts.updateJsxClosingElement = updateJsxClosingElement; - function createJsxAttribute(name, initializer, location) { - var node = createNode(250, location); + function createJsxAttributes(properties) { + var jsxAttributes = createSynthesizedNode(253); + jsxAttributes.properties = createNodeArray(properties); + return jsxAttributes; + } + ts.createJsxAttributes = createJsxAttributes; + function updateJsxAttributes(jsxAttributes, properties) { + if (jsxAttributes.properties !== properties) { + return updateNode(createJsxAttributes(properties), jsxAttributes); + } + return jsxAttributes; + } + ts.updateJsxAttributes = updateJsxAttributes; + function createJsxAttribute(name, initializer) { + var node = createSynthesizedNode(252); node.name = name; node.initializer = initializer; return node; } ts.createJsxAttribute = createJsxAttribute; function updateJsxAttribute(node, name, initializer) { - if (node.name !== name || node.initializer !== initializer) { - return updateNode(createJsxAttribute(name, initializer, node), node); - } - return node; + return node.name !== name + || node.initializer !== initializer + ? updateNode(createJsxAttribute(name, initializer), node) + : node; } ts.updateJsxAttribute = updateJsxAttribute; - function createJsxSpreadAttribute(expression, location) { - var node = createNode(251, location); + function createJsxSpreadAttribute(expression) { + var node = createSynthesizedNode(254); node.expression = expression; return node; } ts.createJsxSpreadAttribute = createJsxSpreadAttribute; function updateJsxSpreadAttribute(node, expression) { - if (node.expression !== expression) { - return updateNode(createJsxSpreadAttribute(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createJsxSpreadAttribute(expression), node) + : node; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; - function createJsxExpression(expression, location) { - var node = createNode(252, location); + function createJsxExpression(dotDotDotToken, expression) { + var node = createSynthesizedNode(255); + node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; } ts.createJsxExpression = createJsxExpression; function updateJsxExpression(node, expression) { - if (node.expression !== expression) { - return updateNode(createJsxExpression(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createJsxExpression(node.dotDotDotToken, expression), node) + : node; } ts.updateJsxExpression = updateJsxExpression; - function createHeritageClause(token, types, location) { - var node = createNode(255, location); + function createHeritageClause(token, types) { + var node = createSynthesizedNode(258); node.token = token; node.types = createNodeArray(types); return node; @@ -11832,40 +12142,40 @@ var ts; ts.createHeritageClause = createHeritageClause; function updateHeritageClause(node, types) { if (node.types !== types) { - return updateNode(createHeritageClause(node.token, types, node), node); + return updateNode(createHeritageClause(node.token, types), node); } return node; } ts.updateHeritageClause = updateHeritageClause; - function createCaseClause(expression, statements, location) { - var node = createNode(253, location); - node.expression = parenthesizeExpressionForList(expression); + function createCaseClause(expression, statements) { + var node = createSynthesizedNode(256); + node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; } ts.createCaseClause = createCaseClause; function updateCaseClause(node, expression, statements) { if (node.expression !== expression || node.statements !== statements) { - return updateNode(createCaseClause(expression, statements, node), node); + return updateNode(createCaseClause(expression, statements), node); } return node; } ts.updateCaseClause = updateCaseClause; - function createDefaultClause(statements, location) { - var node = createNode(254, location); + function createDefaultClause(statements) { + var node = createSynthesizedNode(257); node.statements = createNodeArray(statements); return node; } ts.createDefaultClause = createDefaultClause; function updateDefaultClause(node, statements) { if (node.statements !== statements) { - return updateNode(createDefaultClause(statements, node), node); + return updateNode(createDefaultClause(statements), node); } return node; } ts.updateDefaultClause = updateDefaultClause; - function createCatchClause(variableDeclaration, block, location) { - var node = createNode(256, location); + function createCatchClause(variableDeclaration, block) { + var node = createSynthesizedNode(259); node.variableDeclaration = typeof variableDeclaration === "string" ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -11873,56 +12183,71 @@ var ts; ts.createCatchClause = createCatchClause; function updateCatchClause(node, variableDeclaration, block) { if (node.variableDeclaration !== variableDeclaration || node.block !== block) { - return updateNode(createCatchClause(variableDeclaration, block, node), node); + return updateNode(createCatchClause(variableDeclaration, block), node); } return node; } ts.updateCatchClause = updateCatchClause; - function createPropertyAssignment(name, initializer, location) { - var node = createNode(257, location); - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createPropertyAssignment(name, initializer) { + var node = createSynthesizedNode(260); + node.name = asName(name); node.questionToken = undefined; - node.initializer = initializer !== undefined ? parenthesizeExpressionForList(initializer) : undefined; + node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; return node; } ts.createPropertyAssignment = createPropertyAssignment; function updatePropertyAssignment(node, name, initializer) { if (node.name !== name || node.initializer !== initializer) { - return updateNode(createPropertyAssignment(name, initializer, node), node); + return updateNode(createPropertyAssignment(name, initializer), node); } return node; } ts.updatePropertyAssignment = updatePropertyAssignment; - function createShorthandPropertyAssignment(name, objectAssignmentInitializer, location) { - var node = createNode(258, location); - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; + function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { + var node = createSynthesizedNode(261); + node.name = asName(name); + node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; } ts.createShorthandPropertyAssignment = createShorthandPropertyAssignment; - function createSpreadAssignment(expression, location) { - var node = createNode(259, location); - node.expression = expression !== undefined ? parenthesizeExpressionForList(expression) : undefined; - return node; - } - ts.createSpreadAssignment = createSpreadAssignment; function updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer) { if (node.name !== name || node.objectAssignmentInitializer !== objectAssignmentInitializer) { - return updateNode(createShorthandPropertyAssignment(name, objectAssignmentInitializer, node), node); + return updateNode(createShorthandPropertyAssignment(name, objectAssignmentInitializer), node); } return node; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; + function createSpreadAssignment(expression) { + var node = createSynthesizedNode(262); + node.expression = expression !== undefined ? ts.parenthesizeExpressionForList(expression) : undefined; + return node; + } + ts.createSpreadAssignment = createSpreadAssignment; function updateSpreadAssignment(node, expression) { if (node.expression !== expression) { - return updateNode(createSpreadAssignment(expression, node), node); + return updateNode(createSpreadAssignment(expression), node); } return node; } ts.updateSpreadAssignment = updateSpreadAssignment; + function createEnumMember(name, initializer) { + var node = createSynthesizedNode(263); + node.name = asName(name); + node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); + return node; + } + ts.createEnumMember = createEnumMember; + function updateEnumMember(node, name, initializer) { + return node.name !== name + || node.initializer !== initializer + ? updateNode(createEnumMember(name, initializer), node) + : node; + } + ts.updateEnumMember = updateEnumMember; function updateSourceFileNode(node, statements) { if (node.statements !== statements) { - var updated = createNode(261, node, node.flags); + var updated = createSynthesizedNode(264); + updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; updated.fileName = node.fileName; @@ -11981,56 +12306,73 @@ var ts; return node; } ts.updateSourceFileNode = updateSourceFileNode; + function getMutableClone(node) { + var clone = getSynthesizedClone(node); + clone.pos = node.pos; + clone.end = node.end; + clone.parent = node.parent; + return clone; + } + ts.getMutableClone = getMutableClone; function createNotEmittedStatement(original) { - var node = createNode(293, original); + var node = createSynthesizedNode(294); node.original = original; + setTextRange(node, original); return node; } ts.createNotEmittedStatement = createNotEmittedStatement; function createEndOfDeclarationMarker(original) { - var node = createNode(296); + var node = createSynthesizedNode(297); node.emitNode = {}; node.original = original; return node; } ts.createEndOfDeclarationMarker = createEndOfDeclarationMarker; function createMergeDeclarationMarker(original) { - var node = createNode(295); + var node = createSynthesizedNode(296); node.emitNode = {}; node.original = original; return node; } ts.createMergeDeclarationMarker = createMergeDeclarationMarker; - function createPartiallyEmittedExpression(expression, original, location) { - var node = createNode(294, location || original); + function createPartiallyEmittedExpression(expression, original) { + var node = createSynthesizedNode(295); node.expression = expression; node.original = original; + setTextRange(node, original); return node; } ts.createPartiallyEmittedExpression = createPartiallyEmittedExpression; function updatePartiallyEmittedExpression(node, expression) { if (node.expression !== expression) { - return updateNode(createPartiallyEmittedExpression(expression, node.original, node), node); + return updateNode(createPartiallyEmittedExpression(expression, node.original), node); } return node; } ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; - function createRawExpression(text) { - var node = createNode(297); - node.text = text; + function createBundle(sourceFiles) { + var node = ts.createNode(265); + node.sourceFiles = sourceFiles; return node; } - ts.createRawExpression = createRawExpression; + ts.createBundle = createBundle; + function updateBundle(node, sourceFiles) { + if (node.sourceFiles !== sourceFiles) { + return createBundle(sourceFiles); + } + return node; + } + ts.updateBundle = updateBundle; function createComma(left, right) { return createBinary(left, 25, right); } ts.createComma = createComma; - function createLessThan(left, right, location) { - return createBinary(left, 26, right, location); + function createLessThan(left, right) { + return createBinary(left, 26, right); } ts.createLessThan = createLessThan; - function createAssignment(left, right, location) { - return createBinary(left, 57, right, location); + function createAssignment(left, right) { + return createBinary(left, 57, right); } ts.createAssignment = createAssignment; function createStrictEquality(left, right) { @@ -12049,8 +12391,8 @@ var ts; return createBinary(left, 37, right); } ts.createSubtract = createSubtract; - function createPostfixIncrement(operand, location) { - return createPostfix(operand, 42, location); + function createPostfixIncrement(operand) { + return createPostfix(operand, 42); } ts.createPostfixIncrement = createPostfixIncrement; function createLogicalAnd(left, right) { @@ -12069,672 +12411,25 @@ var ts; return createVoid(createLiteral(0)); } ts.createVoidZero = createVoidZero; - function createTypeCheck(value, tag) { - return tag === "undefined" - ? createStrictEquality(value, createVoidZero()) - : createStrictEquality(createTypeOf(value), createLiteral(tag)); - } - ts.createTypeCheck = createTypeCheck; - function createMemberAccessForPropertyName(target, memberName, location) { - if (ts.isComputedPropertyName(memberName)) { - return createElementAccess(target, memberName.expression, location); - } - else { - var expression = ts.isIdentifier(memberName) ? createPropertyAccess(target, memberName, location) : createElementAccess(target, memberName, location); - (expression.emitNode || (expression.emitNode = {})).flags |= 64; - return expression; - } - } - ts.createMemberAccessForPropertyName = createMemberAccessForPropertyName; - function createFunctionCall(func, thisArg, argumentsList, location) { - return createCall(createPropertyAccess(func, "call"), undefined, [ - thisArg - ].concat(argumentsList), location); - } - ts.createFunctionCall = createFunctionCall; - function createFunctionApply(func, thisArg, argumentsExpression, location) { - return createCall(createPropertyAccess(func, "apply"), undefined, [ - thisArg, - argumentsExpression - ], location); - } - ts.createFunctionApply = createFunctionApply; - function createArraySlice(array, start) { - var argumentsList = []; - if (start !== undefined) { - argumentsList.push(typeof start === "number" ? createLiteral(start) : start); - } - return createCall(createPropertyAccess(array, "slice"), undefined, argumentsList); - } - ts.createArraySlice = createArraySlice; - function createArrayConcat(array, values) { - return createCall(createPropertyAccess(array, "concat"), undefined, values); - } - ts.createArrayConcat = createArrayConcat; - function createMathPow(left, right, location) { - return createCall(createPropertyAccess(createIdentifier("Math"), "pow"), undefined, [left, right], location); - } - ts.createMathPow = createMathPow; - function createReactNamespace(reactNamespace, parent) { - var react = createIdentifier(reactNamespace || "React"); - react.flags &= ~8; - react.parent = ts.getParseTreeNode(parent); - return react; - } - function createJsxFactoryExpressionFromEntityName(jsxFactory, parent) { - if (ts.isQualifiedName(jsxFactory)) { - var left = createJsxFactoryExpressionFromEntityName(jsxFactory.left, parent); - var right = createSynthesizedNode(70); - right.text = jsxFactory.right.text; - return createPropertyAccess(left, right); - } - else { - return createReactNamespace(jsxFactory.text, parent); - } - } - function createJsxFactoryExpression(jsxFactoryEntity, reactNamespace, parent) { - return jsxFactoryEntity ? - createJsxFactoryExpressionFromEntityName(jsxFactoryEntity, parent) : - createPropertyAccess(createReactNamespace(reactNamespace, parent), "createElement"); - } - function createExpressionForJsxElement(jsxFactoryEntity, reactNamespace, tagName, props, children, parentElement, location) { - var argumentsList = [tagName]; - if (props) { - argumentsList.push(props); - } - if (children && children.length > 0) { - if (!props) { - argumentsList.push(createNull()); - } - if (children.length > 1) { - for (var _i = 0, children_1 = children; _i < children_1.length; _i++) { - var child = children_1[_i]; - child.startsOnNewLine = true; - argumentsList.push(child); - } - } - else { - argumentsList.push(children[0]); - } - } - return createCall(createJsxFactoryExpression(jsxFactoryEntity, reactNamespace, parentElement), undefined, argumentsList, location); - } - ts.createExpressionForJsxElement = createExpressionForJsxElement; function createExportDefault(expression) { return createExportAssignment(undefined, undefined, false, expression); } ts.createExportDefault = createExportDefault; function createExternalModuleExport(exportName) { - return createExportDeclaration(undefined, undefined, createNamedExports([createExportSpecifier(exportName)])); + return createExportDeclaration(undefined, undefined, createNamedExports([createExportSpecifier(undefined, exportName)])); } ts.createExternalModuleExport = createExternalModuleExport; - function createLetStatement(name, initializer, location) { - return createVariableStatement(undefined, createLetDeclarationList([createVariableDeclaration(name, undefined, initializer)]), location); + function asName(name) { + return typeof name === "string" ? createIdentifier(name) : name; } - ts.createLetStatement = createLetStatement; - function createLetDeclarationList(declarations, location) { - return createVariableDeclarationList(declarations, location, 1); + function asExpression(value) { + return typeof value === "string" || typeof value === "number" ? createLiteral(value) : value; } - ts.createLetDeclarationList = createLetDeclarationList; - function createConstDeclarationList(declarations, location) { - return createVariableDeclarationList(declarations, location, 2); + function asNodeArray(array) { + return array ? createNodeArray(array) : undefined; } - ts.createConstDeclarationList = createConstDeclarationList; - function getHelperName(name) { - return setEmitFlags(createIdentifier(name), 4096 | 2); - } - ts.getHelperName = getHelperName; - function shouldBeCapturedInTempVariable(node, cacheIdentifiers) { - var target = skipParentheses(node); - switch (target.kind) { - case 70: - return cacheIdentifiers; - case 98: - case 8: - case 9: - return false; - case 175: - var elements = target.elements; - if (elements.length === 0) { - return false; - } - return true; - case 176: - return target.properties.length > 0; - default: - return true; - } - } - function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers) { - var callee = skipOuterExpressions(expression, 7); - var thisArg; - var target; - if (ts.isSuperProperty(callee)) { - thisArg = createThis(); - target = callee; - } - else if (callee.kind === 96) { - thisArg = createThis(); - target = languageVersion < 2 ? createIdentifier("_super", callee) : callee; - } - else { - switch (callee.kind) { - case 177: { - if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { - thisArg = createTempVariable(recordTempVariable); - target = createPropertyAccess(createAssignment(thisArg, callee.expression, callee.expression), callee.name, callee); - } - else { - thisArg = callee.expression; - target = callee; - } - break; - } - case 178: { - if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { - thisArg = createTempVariable(recordTempVariable); - target = createElementAccess(createAssignment(thisArg, callee.expression, callee.expression), callee.argumentExpression, callee); - } - else { - thisArg = callee.expression; - target = callee; - } - break; - } - default: { - thisArg = createVoidZero(); - target = parenthesizeForAccess(expression); - break; - } - } - } - return { target: target, thisArg: thisArg }; - } - ts.createCallBinding = createCallBinding; - function inlineExpressions(expressions) { - return ts.reduceLeft(expressions, createComma); - } - ts.inlineExpressions = inlineExpressions; - function createExpressionFromEntityName(node) { - if (ts.isQualifiedName(node)) { - var left = createExpressionFromEntityName(node.left); - var right = getMutableClone(node.right); - return createPropertyAccess(left, right, node); - } - else { - return getMutableClone(node); - } - } - ts.createExpressionFromEntityName = createExpressionFromEntityName; - function createExpressionForPropertyName(memberName) { - if (ts.isIdentifier(memberName)) { - return createLiteral(memberName, undefined); - } - else if (ts.isComputedPropertyName(memberName)) { - return getMutableClone(memberName.expression); - } - else { - return getMutableClone(memberName); - } - } - ts.createExpressionForPropertyName = createExpressionForPropertyName; - function createExpressionForObjectLiteralElementLike(node, property, receiver) { - switch (property.kind) { - case 151: - case 152: - return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine); - case 257: - return createExpressionForPropertyAssignment(property, receiver); - case 258: - return createExpressionForShorthandPropertyAssignment(property, receiver); - case 149: - return createExpressionForMethodDeclaration(property, receiver); - } - } - ts.createExpressionForObjectLiteralElementLike = createExpressionForObjectLiteralElementLike; - function createExpressionForAccessorDeclaration(properties, property, receiver, multiLine) { - var _a = ts.getAllAccessorDeclarations(properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; - if (property === firstAccessor) { - var properties_1 = []; - if (getAccessor) { - var getterFunction = createFunctionExpression(getAccessor.modifiers, undefined, undefined, undefined, getAccessor.parameters, undefined, getAccessor.body, getAccessor); - setOriginalNode(getterFunction, getAccessor); - var getter = createPropertyAssignment("get", getterFunction); - properties_1.push(getter); - } - if (setAccessor) { - var setterFunction = createFunctionExpression(setAccessor.modifiers, undefined, undefined, undefined, setAccessor.parameters, undefined, setAccessor.body, setAccessor); - setOriginalNode(setterFunction, setAccessor); - var setter = createPropertyAssignment("set", setterFunction); - properties_1.push(setter); - } - properties_1.push(createPropertyAssignment("enumerable", createLiteral(true))); - properties_1.push(createPropertyAssignment("configurable", createLiteral(true))); - var expression = createCall(createPropertyAccess(createIdentifier("Object"), "defineProperty"), undefined, [ - receiver, - createExpressionForPropertyName(property.name), - createObjectLiteral(properties_1, undefined, multiLine) - ], firstAccessor); - return ts.aggregateTransformFlags(expression); - } - return undefined; - } - function createExpressionForPropertyAssignment(property, receiver) { - return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, property.name, property.name), property.initializer, property), property)); - } - function createExpressionForShorthandPropertyAssignment(property, receiver) { - return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, property.name, property.name), getSynthesizedClone(property.name), property), property)); - } - function createExpressionForMethodDeclaration(method, receiver) { - return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, method.name, method.name), setOriginalNode(createFunctionExpression(method.modifiers, method.asteriskToken, undefined, undefined, method.parameters, undefined, method.body, method), method), method), method)); - } - function getLocalName(node, allowComments, allowSourceMaps) { - return getName(node, allowComments, allowSourceMaps, 16384); - } - ts.getLocalName = getLocalName; - function isLocalName(node) { - return (getEmitFlags(node) & 16384) !== 0; - } - ts.isLocalName = isLocalName; - function getExportName(node, allowComments, allowSourceMaps) { - return getName(node, allowComments, allowSourceMaps, 8192); - } - ts.getExportName = getExportName; - function isExportName(node) { - return (getEmitFlags(node) & 8192) !== 0; - } - ts.isExportName = isExportName; - function getDeclarationName(node, allowComments, allowSourceMaps) { - return getName(node, allowComments, allowSourceMaps); - } - ts.getDeclarationName = getDeclarationName; - function getName(node, allowComments, allowSourceMaps, emitFlags) { - if (node.name && ts.isIdentifier(node.name) && !ts.isGeneratedIdentifier(node.name)) { - var name_10 = getMutableClone(node.name); - emitFlags |= getEmitFlags(node.name); - if (!allowSourceMaps) - emitFlags |= 48; - if (!allowComments) - emitFlags |= 1536; - if (emitFlags) - setEmitFlags(name_10, emitFlags); - return name_10; - } - return getGeneratedNameForNode(node); - } - function getExternalModuleOrNamespaceExportName(ns, node, allowComments, allowSourceMaps) { - if (ns && ts.hasModifier(node, 1)) { - return getNamespaceMemberName(ns, getName(node), allowComments, allowSourceMaps); - } - return getExportName(node, allowComments, allowSourceMaps); - } - ts.getExternalModuleOrNamespaceExportName = getExternalModuleOrNamespaceExportName; - function getNamespaceMemberName(ns, name, allowComments, allowSourceMaps) { - var qualifiedName = createPropertyAccess(ns, ts.nodeIsSynthesized(name) ? name : getSynthesizedClone(name), name); - var emitFlags; - if (!allowSourceMaps) - emitFlags |= 48; - if (!allowComments) - emitFlags |= 1536; - if (emitFlags) - setEmitFlags(qualifiedName, emitFlags); - return qualifiedName; - } - ts.getNamespaceMemberName = getNamespaceMemberName; - function convertToFunctionBody(node, multiLine) { - return ts.isBlock(node) ? node : createBlock([createReturn(node, node)], node, multiLine); - } - ts.convertToFunctionBody = convertToFunctionBody; - function isUseStrictPrologue(node) { - return node.expression.text === "use strict"; - } - function addPrologueDirectives(target, source, ensureUseStrict, visitor) { - ts.Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array"); - var foundUseStrict = false; - var statementOffset = 0; - var numStatements = source.length; - while (statementOffset < numStatements) { - var statement = source[statementOffset]; - if (ts.isPrologueDirective(statement)) { - if (isUseStrictPrologue(statement)) { - foundUseStrict = true; - } - target.push(statement); - } - else { - break; - } - statementOffset++; - } - if (ensureUseStrict && !foundUseStrict) { - target.push(startOnNewLine(createStatement(createLiteral("use strict")))); - } - while (statementOffset < numStatements) { - var statement = source[statementOffset]; - if (getEmitFlags(statement) & 524288) { - target.push(visitor ? ts.visitNode(statement, visitor, ts.isStatement) : statement); - } - else { - break; - } - statementOffset++; - } - return statementOffset; - } - ts.addPrologueDirectives = addPrologueDirectives; - function startsWithUseStrict(statements) { - var firstStatement = ts.firstOrUndefined(statements); - return firstStatement !== undefined - && ts.isPrologueDirective(firstStatement) - && isUseStrictPrologue(firstStatement); - } - ts.startsWithUseStrict = startsWithUseStrict; - function ensureUseStrict(statements) { - var foundUseStrict = false; - for (var _i = 0, statements_1 = statements; _i < statements_1.length; _i++) { - var statement = statements_1[_i]; - if (ts.isPrologueDirective(statement)) { - if (isUseStrictPrologue(statement)) { - foundUseStrict = true; - break; - } - } - else { - break; - } - } - if (!foundUseStrict) { - return createNodeArray([ - startOnNewLine(createStatement(createLiteral("use strict"))) - ].concat(statements), statements); - } - return statements; - } - ts.ensureUseStrict = ensureUseStrict; - function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { - var skipped = skipPartiallyEmittedExpressions(operand); - if (skipped.kind === 183) { - return operand; - } - return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) - ? createParen(operand) - : operand; - } - ts.parenthesizeBinaryOperand = parenthesizeBinaryOperand; - function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { - var binaryOperatorPrecedence = ts.getOperatorPrecedence(192, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(192, binaryOperator); - var emittedOperand = skipPartiallyEmittedExpressions(operand); - var operandPrecedence = ts.getExpressionPrecedence(emittedOperand); - switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) { - case -1: - if (!isLeftSideOfBinary - && binaryOperatorAssociativity === 1 - && operand.kind === 195) { - return false; - } - return true; - case 1: - return false; - case 0: - if (isLeftSideOfBinary) { - return binaryOperatorAssociativity === 1; - } - else { - if (ts.isBinaryExpression(emittedOperand) - && emittedOperand.operatorToken.kind === binaryOperator) { - if (operatorHasAssociativeProperty(binaryOperator)) { - return false; - } - if (binaryOperator === 36) { - var leftKind = leftOperand ? getLiteralKindOfBinaryPlusOperand(leftOperand) : 0; - if (ts.isLiteralKind(leftKind) && leftKind === getLiteralKindOfBinaryPlusOperand(emittedOperand)) { - return false; - } - } - } - var operandAssociativity = ts.getExpressionAssociativity(emittedOperand); - return operandAssociativity === 0; - } - } - } - function operatorHasAssociativeProperty(binaryOperator) { - return binaryOperator === 38 - || binaryOperator === 48 - || binaryOperator === 47 - || binaryOperator === 49; - } - function getLiteralKindOfBinaryPlusOperand(node) { - node = skipPartiallyEmittedExpressions(node); - if (ts.isLiteralKind(node.kind)) { - return node.kind; - } - if (node.kind === 192 && node.operatorToken.kind === 36) { - if (node.cachedLiteralKind !== undefined) { - return node.cachedLiteralKind; - } - var leftKind = getLiteralKindOfBinaryPlusOperand(node.left); - var literalKind = ts.isLiteralKind(leftKind) - && leftKind === getLiteralKindOfBinaryPlusOperand(node.right) - ? leftKind - : 0; - node.cachedLiteralKind = literalKind; - return literalKind; - } - return 0; - } - function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(193, 54); - var emittedCondition = skipPartiallyEmittedExpressions(condition); - var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); - if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1) { - return createParen(condition); - } - return condition; - } - ts.parenthesizeForConditionalHead = parenthesizeForConditionalHead; - function parenthesizeSubexpressionOfConditionalExpression(e) { - return e.kind === 192 && e.operatorToken.kind === 25 - ? createParen(e) - : e; - } - function parenthesizeForNew(expression) { - var emittedExpression = skipPartiallyEmittedExpressions(expression); - switch (emittedExpression.kind) { - case 179: - return createParen(expression); - case 180: - return emittedExpression.arguments - ? expression - : createParen(expression); - } - return parenthesizeForAccess(expression); - } - ts.parenthesizeForNew = parenthesizeForNew; - function parenthesizeForAccess(expression) { - var emittedExpression = skipPartiallyEmittedExpressions(expression); - if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 180 || emittedExpression.arguments) - && emittedExpression.kind !== 8) { - return expression; - } - return createParen(expression, expression); - } - ts.parenthesizeForAccess = parenthesizeForAccess; - function parenthesizePostfixOperand(operand) { - return ts.isLeftHandSideExpression(operand) - ? operand - : createParen(operand, operand); - } - ts.parenthesizePostfixOperand = parenthesizePostfixOperand; - function parenthesizePrefixOperand(operand) { - return ts.isUnaryExpression(operand) - ? operand - : createParen(operand, operand); - } - ts.parenthesizePrefixOperand = parenthesizePrefixOperand; - function parenthesizeListElements(elements) { - var result; - for (var i = 0; i < elements.length; i++) { - var element = parenthesizeExpressionForList(elements[i]); - if (result !== undefined || element !== elements[i]) { - if (result === undefined) { - result = elements.slice(0, i); - } - result.push(element); - } - } - if (result !== undefined) { - return createNodeArray(result, elements, elements.hasTrailingComma); - } - return elements; - } - function parenthesizeExpressionForList(expression) { - var emittedExpression = skipPartiallyEmittedExpressions(expression); - var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(192, 25); - return expressionPrecedence > commaPrecedence - ? expression - : createParen(expression, expression); - } - ts.parenthesizeExpressionForList = parenthesizeExpressionForList; - function parenthesizeExpressionForExpressionStatement(expression) { - var emittedExpression = skipPartiallyEmittedExpressions(expression); - if (ts.isCallExpression(emittedExpression)) { - var callee = emittedExpression.expression; - var kind = skipPartiallyEmittedExpressions(callee).kind; - if (kind === 184 || kind === 185) { - var mutableCall = getMutableClone(emittedExpression); - mutableCall.expression = createParen(callee, callee); - return recreatePartiallyEmittedExpressions(expression, mutableCall); - } - } - else { - var leftmostExpressionKind = getLeftmostExpression(emittedExpression).kind; - if (leftmostExpressionKind === 176 || leftmostExpressionKind === 184) { - return createParen(expression, expression); - } - } - return expression; - } - ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; - function recreatePartiallyEmittedExpressions(originalOuterExpression, newInnerExpression) { - if (ts.isPartiallyEmittedExpression(originalOuterExpression)) { - var clone_1 = getMutableClone(originalOuterExpression); - clone_1.expression = recreatePartiallyEmittedExpressions(clone_1.expression, newInnerExpression); - return clone_1; - } - return newInnerExpression; - } - function getLeftmostExpression(node) { - while (true) { - switch (node.kind) { - case 191: - node = node.operand; - continue; - case 192: - node = node.left; - continue; - case 193: - node = node.condition; - continue; - case 179: - case 178: - case 177: - node = node.expression; - continue; - case 294: - node = node.expression; - continue; - } - return node; - } - } - function parenthesizeConciseBody(body) { - var emittedBody = skipPartiallyEmittedExpressions(body); - if (emittedBody.kind === 176) { - return createParen(body, body); - } - return body; - } - ts.parenthesizeConciseBody = parenthesizeConciseBody; - function skipOuterExpressions(node, kinds) { - if (kinds === void 0) { kinds = 7; } - var previousNode; - do { - previousNode = node; - if (kinds & 1) { - node = skipParentheses(node); - } - if (kinds & 2) { - node = skipAssertions(node); - } - if (kinds & 4) { - node = skipPartiallyEmittedExpressions(node); - } - } while (previousNode !== node); - return node; - } - ts.skipOuterExpressions = skipOuterExpressions; - function skipParentheses(node) { - while (node.kind === 183) { - node = node.expression; - } - return node; - } - ts.skipParentheses = skipParentheses; - function skipAssertions(node) { - while (ts.isAssertionExpression(node)) { - node = node.expression; - } - return node; - } - ts.skipAssertions = skipAssertions; - function skipPartiallyEmittedExpressions(node) { - while (node.kind === 294) { - node = node.expression; - } - return node; - } - ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; - function startOnNewLine(node) { - node.startsOnNewLine = true; - return node; - } - ts.startOnNewLine = startOnNewLine; - function setOriginalNode(node, original) { - node.original = original; - if (original) { - var emitNode = original.emitNode; - if (emitNode) - node.emitNode = mergeEmitNode(emitNode, node.emitNode); - } - return node; - } - ts.setOriginalNode = setOriginalNode; - function mergeEmitNode(sourceEmitNode, destEmitNode) { - var flags = sourceEmitNode.flags, commentRange = sourceEmitNode.commentRange, sourceMapRange = sourceEmitNode.sourceMapRange, tokenSourceMapRanges = sourceEmitNode.tokenSourceMapRanges, constantValue = sourceEmitNode.constantValue, helpers = sourceEmitNode.helpers; - if (!destEmitNode) - destEmitNode = {}; - if (flags) - destEmitNode.flags = flags; - if (commentRange) - destEmitNode.commentRange = commentRange; - if (sourceMapRange) - destEmitNode.sourceMapRange = sourceMapRange; - if (tokenSourceMapRanges) - destEmitNode.tokenSourceMapRanges = mergeTokenSourceMapRanges(tokenSourceMapRanges, destEmitNode.tokenSourceMapRanges); - if (constantValue !== undefined) - destEmitNode.constantValue = constantValue; - if (helpers) - destEmitNode.helpers = ts.addRange(destEmitNode.helpers, helpers); - return destEmitNode; - } - function mergeTokenSourceMapRanges(sourceRanges, destRanges) { - if (!destRanges) - destRanges = ts.createMap(); - ts.copyProperties(sourceRanges, destRanges); - return destRanges; + function asToken(value) { + return typeof value === "number" ? createToken(value) : value; } function disposeEmitNodes(sourceFile) { sourceFile = ts.getSourceFileOfNode(ts.getParseTreeNode(sourceFile)); @@ -12751,7 +12446,7 @@ var ts; function getOrCreateEmitNode(node) { if (!node.emitNode) { if (ts.isParseTreeNode(node)) { - if (node.kind === 261) { + if (node.kind === 264) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(node); @@ -12762,6 +12457,14 @@ var ts; return node.emitNode; } ts.getOrCreateEmitNode = getOrCreateEmitNode; + function setTextRange(range, location) { + if (location) { + range.pos = location.pos; + range.end = location.end; + } + return range; + } + ts.setTextRange = setTextRange; function getEmitFlags(node) { var emitNode = node.emitNode; return emitNode && emitNode.flags; @@ -12790,7 +12493,7 @@ var ts; ts.getTokenSourceMapRange = getTokenSourceMapRange; function setTokenSourceMapRange(node, token, range) { var emitNode = getOrCreateEmitNode(node); - var tokenSourceMapRanges = emitNode.tokenSourceMapRanges || (emitNode.tokenSourceMapRanges = ts.createMap()); + var tokenSourceMapRanges = emitNode.tokenSourceMapRanges || (emitNode.tokenSourceMapRanges = []); tokenSourceMapRanges[token] = range; return node; } @@ -12805,6 +12508,34 @@ var ts; return node; } ts.setCommentRange = setCommentRange; + function getSyntheticLeadingComments(node) { + var emitNode = node.emitNode; + return emitNode && emitNode.leadingComments; + } + ts.getSyntheticLeadingComments = getSyntheticLeadingComments; + function setSyntheticLeadingComments(node, comments) { + getOrCreateEmitNode(node).leadingComments = comments; + return node; + } + ts.setSyntheticLeadingComments = setSyntheticLeadingComments; + function addSyntheticLeadingComment(node, kind, text, hasTrailingNewLine) { + return setSyntheticLeadingComments(node, ts.append(getSyntheticLeadingComments(node), { kind: kind, pos: -1, end: -1, hasTrailingNewLine: hasTrailingNewLine, text: text })); + } + ts.addSyntheticLeadingComment = addSyntheticLeadingComment; + function getSyntheticTrailingComments(node) { + var emitNode = node.emitNode; + return emitNode && emitNode.trailingComments; + } + ts.getSyntheticTrailingComments = getSyntheticTrailingComments; + function setSyntheticTrailingComments(node, comments) { + getOrCreateEmitNode(node).trailingComments = comments; + return node; + } + ts.setSyntheticTrailingComments = setSyntheticTrailingComments; + function addSyntheticTrailingComment(node, kind, text, hasTrailingNewLine) { + return setSyntheticTrailingComments(node, ts.append(getSyntheticTrailingComments(node), { kind: kind, pos: -1, end: -1, hasTrailingNewLine: hasTrailingNewLine, text: text })); + } + ts.addSyntheticTrailingComment = addSyntheticTrailingComment; function getConstantValue(node) { var emitNode = node.emitNode; return emitNode && emitNode.constantValue; @@ -12816,32 +12547,6 @@ var ts; return node; } ts.setConstantValue = setConstantValue; - function getExternalHelpersModuleName(node) { - var parseNode = ts.getOriginalNode(node, ts.isSourceFile); - var emitNode = parseNode && parseNode.emitNode; - return emitNode && emitNode.externalHelpersModuleName; - } - ts.getExternalHelpersModuleName = getExternalHelpersModuleName; - function getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions) { - if (compilerOptions.importHelpers && (ts.isExternalModule(node) || compilerOptions.isolatedModules)) { - var externalHelpersModuleName = getExternalHelpersModuleName(node); - if (externalHelpersModuleName) { - return externalHelpersModuleName; - } - var helpers = getEmitHelpers(node); - if (helpers) { - for (var _i = 0, helpers_1 = helpers; _i < helpers_1.length; _i++) { - var helper = helpers_1[_i]; - if (!helper.scoped) { - var parseNode = ts.getOriginalNode(node, ts.isSourceFile); - var emitNode = getOrCreateEmitNode(parseNode); - return emitNode.externalHelpersModuleName || (emitNode.externalHelpersModuleName = createUniqueName(ts.externalHelpersModuleNameText)); - } - } - } - } - } - ts.getOrCreateExternalHelpersModuleNameIfNeeded = getOrCreateExternalHelpersModuleNameIfNeeded; function addEmitHelper(node, helper) { var emitNode = getOrCreateEmitNode(node); emitNode.helpers = ts.append(emitNode.helpers, helper); @@ -12851,8 +12556,8 @@ var ts; function addEmitHelpers(node, helpers) { if (ts.some(helpers)) { var emitNode = getOrCreateEmitNode(node); - for (var _i = 0, helpers_2 = helpers; _i < helpers_2.length; _i++) { - var helper = helpers_2[_i]; + for (var _i = 0, helpers_1 = helpers; _i < helpers_1.length; _i++) { + var helper = helpers_1[_i]; if (!ts.contains(emitNode.helpers, helper)) { emitNode.helpers = ts.append(emitNode.helpers, helper); } @@ -12913,40 +12618,805 @@ var ts; return ts.compareValues(x.priority, y.priority); } ts.compareEmitHelpers = compareEmitHelpers; - function setTextRange(node, location) { - if (location) { - node.pos = location.pos; - node.end = location.end; + function setOriginalNode(node, original) { + node.original = original; + if (original) { + var emitNode = original.emitNode; + if (emitNode) + node.emitNode = mergeEmitNode(emitNode, node.emitNode); } return node; } - ts.setTextRange = setTextRange; - function setNodeFlags(node, flags) { - node.flags = flags; + ts.setOriginalNode = setOriginalNode; + function mergeEmitNode(sourceEmitNode, destEmitNode) { + var flags = sourceEmitNode.flags, leadingComments = sourceEmitNode.leadingComments, trailingComments = sourceEmitNode.trailingComments, commentRange = sourceEmitNode.commentRange, sourceMapRange = sourceEmitNode.sourceMapRange, tokenSourceMapRanges = sourceEmitNode.tokenSourceMapRanges, constantValue = sourceEmitNode.constantValue, helpers = sourceEmitNode.helpers; + if (!destEmitNode) + destEmitNode = {}; + if (leadingComments) + destEmitNode.leadingComments = ts.addRange(leadingComments.slice(), destEmitNode.leadingComments); + if (trailingComments) + destEmitNode.trailingComments = ts.addRange(trailingComments.slice(), destEmitNode.trailingComments); + if (flags) + destEmitNode.flags = flags; + if (commentRange) + destEmitNode.commentRange = commentRange; + if (sourceMapRange) + destEmitNode.sourceMapRange = sourceMapRange; + if (tokenSourceMapRanges) + destEmitNode.tokenSourceMapRanges = mergeTokenSourceMapRanges(tokenSourceMapRanges, destEmitNode.tokenSourceMapRanges); + if (constantValue !== undefined) + destEmitNode.constantValue = constantValue; + if (helpers) + destEmitNode.helpers = ts.addRange(destEmitNode.helpers, helpers); + return destEmitNode; + } + function mergeTokenSourceMapRanges(sourceRanges, destRanges) { + if (!destRanges) + destRanges = []; + for (var key in sourceRanges) { + destRanges[key] = sourceRanges[key]; + } + return destRanges; + } +})(ts || (ts = {})); +(function (ts) { + function createTypeCheck(value, tag) { + return tag === "undefined" + ? ts.createStrictEquality(value, ts.createVoidZero()) + : ts.createStrictEquality(ts.createTypeOf(value), ts.createLiteral(tag)); + } + ts.createTypeCheck = createTypeCheck; + function createMemberAccessForPropertyName(target, memberName, location) { + if (ts.isComputedPropertyName(memberName)) { + return ts.setTextRange(ts.createElementAccess(target, memberName.expression), location); + } + else { + var expression = ts.setTextRange(ts.isIdentifier(memberName) + ? ts.createPropertyAccess(target, memberName) + : ts.createElementAccess(target, memberName), memberName); + ts.getOrCreateEmitNode(expression).flags |= 64; + return expression; + } + } + ts.createMemberAccessForPropertyName = createMemberAccessForPropertyName; + function createFunctionCall(func, thisArg, argumentsList, location) { + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(func, "call"), undefined, [ + thisArg + ].concat(argumentsList)), location); + } + ts.createFunctionCall = createFunctionCall; + function createFunctionApply(func, thisArg, argumentsExpression, location) { + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(func, "apply"), undefined, [ + thisArg, + argumentsExpression + ]), location); + } + ts.createFunctionApply = createFunctionApply; + function createArraySlice(array, start) { + var argumentsList = []; + if (start !== undefined) { + argumentsList.push(typeof start === "number" ? ts.createLiteral(start) : start); + } + return ts.createCall(ts.createPropertyAccess(array, "slice"), undefined, argumentsList); + } + ts.createArraySlice = createArraySlice; + function createArrayConcat(array, values) { + return ts.createCall(ts.createPropertyAccess(array, "concat"), undefined, values); + } + ts.createArrayConcat = createArrayConcat; + function createMathPow(left, right, location) { + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Math"), "pow"), undefined, [left, right]), location); + } + ts.createMathPow = createMathPow; + function createReactNamespace(reactNamespace, parent) { + var react = ts.createIdentifier(reactNamespace || "React"); + react.flags &= ~8; + react.parent = ts.getParseTreeNode(parent); + return react; + } + function createJsxFactoryExpressionFromEntityName(jsxFactory, parent) { + if (ts.isQualifiedName(jsxFactory)) { + var left = createJsxFactoryExpressionFromEntityName(jsxFactory.left, parent); + var right = ts.createIdentifier(jsxFactory.right.text); + right.text = jsxFactory.right.text; + return ts.createPropertyAccess(left, right); + } + else { + return createReactNamespace(jsxFactory.text, parent); + } + } + function createJsxFactoryExpression(jsxFactoryEntity, reactNamespace, parent) { + return jsxFactoryEntity ? + createJsxFactoryExpressionFromEntityName(jsxFactoryEntity, parent) : + ts.createPropertyAccess(createReactNamespace(reactNamespace, parent), "createElement"); + } + function createExpressionForJsxElement(jsxFactoryEntity, reactNamespace, tagName, props, children, parentElement, location) { + var argumentsList = [tagName]; + if (props) { + argumentsList.push(props); + } + if (children && children.length > 0) { + if (!props) { + argumentsList.push(ts.createNull()); + } + if (children.length > 1) { + for (var _i = 0, children_1 = children; _i < children_1.length; _i++) { + var child = children_1[_i]; + child.startsOnNewLine = true; + argumentsList.push(child); + } + } + else { + argumentsList.push(children[0]); + } + } + return ts.setTextRange(ts.createCall(createJsxFactoryExpression(jsxFactoryEntity, reactNamespace, parentElement), undefined, argumentsList), location); + } + ts.createExpressionForJsxElement = createExpressionForJsxElement; + function getHelperName(name) { + return ts.setEmitFlags(ts.createIdentifier(name), 4096 | 2); + } + ts.getHelperName = getHelperName; + var valuesHelper = { + name: "typescript:values", + scoped: false, + text: "\n var __values = (this && this.__values) || function (o) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\n if (m) return m.call(o);\n return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n };\n " + }; + function createValuesHelper(context, expression, location) { + context.requestEmitHelper(valuesHelper); + return ts.setTextRange(ts.createCall(getHelperName("__values"), undefined, [expression]), location); + } + ts.createValuesHelper = createValuesHelper; + var readHelper = { + name: "typescript:read", + scoped: false, + text: "\n var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n };\n " + }; + function createReadHelper(context, iteratorRecord, count, location) { + context.requestEmitHelper(readHelper); + return ts.setTextRange(ts.createCall(getHelperName("__read"), undefined, count !== undefined + ? [iteratorRecord, ts.createLiteral(count)] + : [iteratorRecord]), location); + } + ts.createReadHelper = createReadHelper; + var spreadHelper = { + name: "typescript:spread", + scoped: false, + text: "\n var __spread = (this && this.__spread) || function () {\n for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));\n return ar;\n };" + }; + function createSpreadHelper(context, argumentList, location) { + context.requestEmitHelper(readHelper); + context.requestEmitHelper(spreadHelper); + return ts.setTextRange(ts.createCall(getHelperName("__spread"), undefined, argumentList), location); + } + ts.createSpreadHelper = createSpreadHelper; + function createForOfBindingStatement(node, boundValue) { + if (ts.isVariableDeclarationList(node)) { + var firstDeclaration = ts.firstOrUndefined(node.declarations); + var updatedDeclaration = ts.updateVariableDeclaration(firstDeclaration, firstDeclaration.name, undefined, boundValue); + return ts.setTextRange(ts.createVariableStatement(undefined, ts.updateVariableDeclarationList(node, [updatedDeclaration])), node); + } + else { + var updatedExpression = ts.setTextRange(ts.createAssignment(node, boundValue), node); + return ts.setTextRange(ts.createStatement(updatedExpression), node); + } + } + ts.createForOfBindingStatement = createForOfBindingStatement; + function insertLeadingStatement(dest, source) { + if (ts.isBlock(dest)) { + return ts.updateBlock(dest, ts.setTextRange(ts.createNodeArray([source].concat(dest.statements)), dest.statements)); + } + else { + return ts.createBlock(ts.createNodeArray([dest, source]), true); + } + } + ts.insertLeadingStatement = insertLeadingStatement; + function restoreEnclosingLabel(node, outermostLabeledStatement, afterRestoreLabelCallback) { + if (!outermostLabeledStatement) { + return node; + } + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 221 + ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) + : node); + if (afterRestoreLabelCallback) { + afterRestoreLabelCallback(outermostLabeledStatement); + } + return updated; + } + ts.restoreEnclosingLabel = restoreEnclosingLabel; + function shouldBeCapturedInTempVariable(node, cacheIdentifiers) { + var target = skipParentheses(node); + switch (target.kind) { + case 70: + return cacheIdentifiers; + case 98: + case 8: + case 9: + return false; + case 176: + var elements = target.elements; + if (elements.length === 0) { + return false; + } + return true; + case 177: + return target.properties.length > 0; + default: + return true; + } + } + function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers) { + var callee = skipOuterExpressions(expression, 7); + var thisArg; + var target; + if (ts.isSuperProperty(callee)) { + thisArg = ts.createThis(); + target = callee; + } + else if (callee.kind === 96) { + thisArg = ts.createThis(); + target = languageVersion < 2 + ? ts.setTextRange(ts.createIdentifier("_super"), callee) + : callee; + } + else if (ts.getEmitFlags(callee) & 4096) { + thisArg = ts.createVoidZero(); + target = parenthesizeForAccess(callee); + } + else { + switch (callee.kind) { + case 178: { + if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { + thisArg = ts.createTempVariable(recordTempVariable); + target = ts.createPropertyAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.name); + ts.setTextRange(target, callee); + } + else { + thisArg = callee.expression; + target = callee; + } + break; + } + case 179: { + if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { + thisArg = ts.createTempVariable(recordTempVariable); + target = ts.createElementAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.argumentExpression); + ts.setTextRange(target, callee); + } + else { + thisArg = callee.expression; + target = callee; + } + break; + } + default: { + thisArg = ts.createVoidZero(); + target = parenthesizeForAccess(expression); + break; + } + } + } + return { target: target, thisArg: thisArg }; + } + ts.createCallBinding = createCallBinding; + function inlineExpressions(expressions) { + return ts.reduceLeft(expressions, ts.createComma); + } + ts.inlineExpressions = inlineExpressions; + function createExpressionFromEntityName(node) { + if (ts.isQualifiedName(node)) { + var left = createExpressionFromEntityName(node.left); + var right = ts.getMutableClone(node.right); + return ts.setTextRange(ts.createPropertyAccess(left, right), node); + } + else { + return ts.getMutableClone(node); + } + } + ts.createExpressionFromEntityName = createExpressionFromEntityName; + function createExpressionForPropertyName(memberName) { + if (ts.isIdentifier(memberName)) { + return ts.createLiteral(memberName); + } + else if (ts.isComputedPropertyName(memberName)) { + return ts.getMutableClone(memberName.expression); + } + else { + return ts.getMutableClone(memberName); + } + } + ts.createExpressionForPropertyName = createExpressionForPropertyName; + function createExpressionForObjectLiteralElementLike(node, property, receiver) { + switch (property.kind) { + case 152: + case 153: + return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine); + case 260: + return createExpressionForPropertyAssignment(property, receiver); + case 261: + return createExpressionForShorthandPropertyAssignment(property, receiver); + case 150: + return createExpressionForMethodDeclaration(property, receiver); + } + } + ts.createExpressionForObjectLiteralElementLike = createExpressionForObjectLiteralElementLike; + function createExpressionForAccessorDeclaration(properties, property, receiver, multiLine) { + var _a = ts.getAllAccessorDeclarations(properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; + if (property === firstAccessor) { + var properties_1 = []; + if (getAccessor) { + var getterFunction = ts.createFunctionExpression(getAccessor.modifiers, undefined, undefined, undefined, getAccessor.parameters, undefined, getAccessor.body); + ts.setTextRange(getterFunction, getAccessor); + ts.setOriginalNode(getterFunction, getAccessor); + var getter = ts.createPropertyAssignment("get", getterFunction); + properties_1.push(getter); + } + if (setAccessor) { + var setterFunction = ts.createFunctionExpression(setAccessor.modifiers, undefined, undefined, undefined, setAccessor.parameters, undefined, setAccessor.body); + ts.setTextRange(setterFunction, setAccessor); + ts.setOriginalNode(setterFunction, setAccessor); + var setter = ts.createPropertyAssignment("set", setterFunction); + properties_1.push(setter); + } + properties_1.push(ts.createPropertyAssignment("enumerable", ts.createTrue())); + properties_1.push(ts.createPropertyAssignment("configurable", ts.createTrue())); + var expression = ts.setTextRange(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), undefined, [ + receiver, + createExpressionForPropertyName(property.name), + ts.createObjectLiteral(properties_1, multiLine) + ]), firstAccessor); + return ts.aggregateTransformFlags(expression); + } + return undefined; + } + function createExpressionForPropertyAssignment(property, receiver) { + return ts.aggregateTransformFlags(ts.setOriginalNode(ts.setTextRange(ts.createAssignment(createMemberAccessForPropertyName(receiver, property.name, property.name), property.initializer), property), property)); + } + function createExpressionForShorthandPropertyAssignment(property, receiver) { + return ts.aggregateTransformFlags(ts.setOriginalNode(ts.setTextRange(ts.createAssignment(createMemberAccessForPropertyName(receiver, property.name, property.name), ts.getSynthesizedClone(property.name)), property), property)); + } + function createExpressionForMethodDeclaration(method, receiver) { + return ts.aggregateTransformFlags(ts.setOriginalNode(ts.setTextRange(ts.createAssignment(createMemberAccessForPropertyName(receiver, method.name, method.name), ts.setOriginalNode(ts.setTextRange(ts.createFunctionExpression(method.modifiers, method.asteriskToken, undefined, undefined, method.parameters, undefined, method.body), method), method)), method), method)); + } + function getLocalName(node, allowComments, allowSourceMaps) { + return getName(node, allowComments, allowSourceMaps, 16384); + } + ts.getLocalName = getLocalName; + function isLocalName(node) { + return (ts.getEmitFlags(node) & 16384) !== 0; + } + ts.isLocalName = isLocalName; + function getExportName(node, allowComments, allowSourceMaps) { + return getName(node, allowComments, allowSourceMaps, 8192); + } + ts.getExportName = getExportName; + function isExportName(node) { + return (ts.getEmitFlags(node) & 8192) !== 0; + } + ts.isExportName = isExportName; + function getDeclarationName(node, allowComments, allowSourceMaps) { + return getName(node, allowComments, allowSourceMaps); + } + ts.getDeclarationName = getDeclarationName; + function getName(node, allowComments, allowSourceMaps, emitFlags) { + if (node.name && ts.isIdentifier(node.name) && !ts.isGeneratedIdentifier(node.name)) { + var name = ts.getMutableClone(node.name); + emitFlags |= ts.getEmitFlags(node.name); + if (!allowSourceMaps) + emitFlags |= 48; + if (!allowComments) + emitFlags |= 1536; + if (emitFlags) + ts.setEmitFlags(name, emitFlags); + return name; + } + return ts.getGeneratedNameForNode(node); + } + function getExternalModuleOrNamespaceExportName(ns, node, allowComments, allowSourceMaps) { + if (ns && ts.hasModifier(node, 1)) { + return getNamespaceMemberName(ns, getName(node), allowComments, allowSourceMaps); + } + return getExportName(node, allowComments, allowSourceMaps); + } + ts.getExternalModuleOrNamespaceExportName = getExternalModuleOrNamespaceExportName; + function getNamespaceMemberName(ns, name, allowComments, allowSourceMaps) { + var qualifiedName = ts.createPropertyAccess(ns, ts.nodeIsSynthesized(name) ? name : ts.getSynthesizedClone(name)); + ts.setTextRange(qualifiedName, name); + var emitFlags; + if (!allowSourceMaps) + emitFlags |= 48; + if (!allowComments) + emitFlags |= 1536; + if (emitFlags) + ts.setEmitFlags(qualifiedName, emitFlags); + return qualifiedName; + } + ts.getNamespaceMemberName = getNamespaceMemberName; + function convertToFunctionBody(node, multiLine) { + return ts.isBlock(node) ? node : ts.setTextRange(ts.createBlock([ts.setTextRange(ts.createReturn(node), node)], multiLine), node); + } + ts.convertToFunctionBody = convertToFunctionBody; + function isUseStrictPrologue(node) { + return node.expression.text === "use strict"; + } + function addPrologue(target, source, ensureUseStrict, visitor) { + var offset = addStandardPrologue(target, source, ensureUseStrict); + return addCustomPrologue(target, source, offset, visitor); + } + ts.addPrologue = addPrologue; + function addStandardPrologue(target, source, ensureUseStrict) { + ts.Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array"); + var foundUseStrict = false; + var statementOffset = 0; + var numStatements = source.length; + while (statementOffset < numStatements) { + var statement = source[statementOffset]; + if (ts.isPrologueDirective(statement)) { + if (isUseStrictPrologue(statement)) { + foundUseStrict = true; + } + target.push(statement); + } + else { + break; + } + statementOffset++; + } + if (ensureUseStrict && !foundUseStrict) { + target.push(startOnNewLine(ts.createStatement(ts.createLiteral("use strict")))); + } + return statementOffset; + } + ts.addStandardPrologue = addStandardPrologue; + function addCustomPrologue(target, source, statementOffset, visitor) { + var numStatements = source.length; + while (statementOffset < numStatements) { + var statement = source[statementOffset]; + if (ts.getEmitFlags(statement) & 524288) { + target.push(visitor ? ts.visitNode(statement, visitor, ts.isStatement) : statement); + } + else { + break; + } + statementOffset++; + } + return statementOffset; + } + ts.addCustomPrologue = addCustomPrologue; + function startsWithUseStrict(statements) { + var firstStatement = ts.firstOrUndefined(statements); + return firstStatement !== undefined + && ts.isPrologueDirective(firstStatement) + && isUseStrictPrologue(firstStatement); + } + ts.startsWithUseStrict = startsWithUseStrict; + function ensureUseStrict(statements) { + var foundUseStrict = false; + for (var _i = 0, statements_1 = statements; _i < statements_1.length; _i++) { + var statement = statements_1[_i]; + if (ts.isPrologueDirective(statement)) { + if (isUseStrictPrologue(statement)) { + foundUseStrict = true; + break; + } + } + else { + break; + } + } + if (!foundUseStrict) { + return ts.setTextRange(ts.createNodeArray([ + startOnNewLine(ts.createStatement(ts.createLiteral("use strict"))) + ].concat(statements)), statements); + } + return statements; + } + ts.ensureUseStrict = ensureUseStrict; + function parenthesizeConditionalHead(condition) { + var conditionalPrecedence = ts.getOperatorPrecedence(194, 54); + var emittedCondition = skipPartiallyEmittedExpressions(condition); + var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); + if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1) { + return ts.createParen(condition); + } + return condition; + } + ts.parenthesizeConditionalHead = parenthesizeConditionalHead; + function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { + var skipped = skipPartiallyEmittedExpressions(operand); + if (skipped.kind === 184) { + return operand; + } + return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) + ? ts.createParen(operand) + : operand; + } + ts.parenthesizeBinaryOperand = parenthesizeBinaryOperand; + function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { + var binaryOperatorPrecedence = ts.getOperatorPrecedence(193, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(193, binaryOperator); + var emittedOperand = skipPartiallyEmittedExpressions(operand); + var operandPrecedence = ts.getExpressionPrecedence(emittedOperand); + switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) { + case -1: + if (!isLeftSideOfBinary + && binaryOperatorAssociativity === 1 + && operand.kind === 196) { + return false; + } + return true; + case 1: + return false; + case 0: + if (isLeftSideOfBinary) { + return binaryOperatorAssociativity === 1; + } + else { + if (ts.isBinaryExpression(emittedOperand) + && emittedOperand.operatorToken.kind === binaryOperator) { + if (operatorHasAssociativeProperty(binaryOperator)) { + return false; + } + if (binaryOperator === 36) { + var leftKind = leftOperand ? getLiteralKindOfBinaryPlusOperand(leftOperand) : 0; + if (ts.isLiteralKind(leftKind) && leftKind === getLiteralKindOfBinaryPlusOperand(emittedOperand)) { + return false; + } + } + } + var operandAssociativity = ts.getExpressionAssociativity(emittedOperand); + return operandAssociativity === 0; + } + } + } + function operatorHasAssociativeProperty(binaryOperator) { + return binaryOperator === 38 + || binaryOperator === 48 + || binaryOperator === 47 + || binaryOperator === 49; + } + function getLiteralKindOfBinaryPlusOperand(node) { + node = skipPartiallyEmittedExpressions(node); + if (ts.isLiteralKind(node.kind)) { + return node.kind; + } + if (node.kind === 193 && node.operatorToken.kind === 36) { + if (node.cachedLiteralKind !== undefined) { + return node.cachedLiteralKind; + } + var leftKind = getLiteralKindOfBinaryPlusOperand(node.left); + var literalKind = ts.isLiteralKind(leftKind) + && leftKind === getLiteralKindOfBinaryPlusOperand(node.right) + ? leftKind + : 0; + node.cachedLiteralKind = literalKind; + return literalKind; + } + return 0; + } + function parenthesizeForConditionalHead(condition) { + var conditionalPrecedence = ts.getOperatorPrecedence(194, 54); + var emittedCondition = skipPartiallyEmittedExpressions(condition); + var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); + if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1) { + return ts.createParen(condition); + } + return condition; + } + ts.parenthesizeForConditionalHead = parenthesizeForConditionalHead; + function parenthesizeSubexpressionOfConditionalExpression(e) { + return e.kind === 193 && e.operatorToken.kind === 25 + ? ts.createParen(e) + : e; + } + ts.parenthesizeSubexpressionOfConditionalExpression = parenthesizeSubexpressionOfConditionalExpression; + function parenthesizeForNew(expression) { + var emittedExpression = skipPartiallyEmittedExpressions(expression); + switch (emittedExpression.kind) { + case 180: + return ts.createParen(expression); + case 181: + return emittedExpression.arguments + ? expression + : ts.createParen(expression); + } + return parenthesizeForAccess(expression); + } + ts.parenthesizeForNew = parenthesizeForNew; + function parenthesizeForAccess(expression) { + var emittedExpression = skipPartiallyEmittedExpressions(expression); + if (ts.isLeftHandSideExpression(emittedExpression) + && (emittedExpression.kind !== 181 || emittedExpression.arguments)) { + return expression; + } + return ts.setTextRange(ts.createParen(expression), expression); + } + ts.parenthesizeForAccess = parenthesizeForAccess; + function parenthesizePostfixOperand(operand) { + return ts.isLeftHandSideExpression(operand) + ? operand + : ts.setTextRange(ts.createParen(operand), operand); + } + ts.parenthesizePostfixOperand = parenthesizePostfixOperand; + function parenthesizePrefixOperand(operand) { + return ts.isUnaryExpression(operand) + ? operand + : ts.setTextRange(ts.createParen(operand), operand); + } + ts.parenthesizePrefixOperand = parenthesizePrefixOperand; + function parenthesizeListElements(elements) { + var result; + for (var i = 0; i < elements.length; i++) { + var element = parenthesizeExpressionForList(elements[i]); + if (result !== undefined || element !== elements[i]) { + if (result === undefined) { + result = elements.slice(0, i); + } + result.push(element); + } + } + if (result !== undefined) { + return ts.setTextRange(ts.createNodeArray(result, elements.hasTrailingComma), elements); + } + return elements; + } + ts.parenthesizeListElements = parenthesizeListElements; + function parenthesizeExpressionForList(expression) { + var emittedExpression = skipPartiallyEmittedExpressions(expression); + var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); + var commaPrecedence = ts.getOperatorPrecedence(193, 25); + return expressionPrecedence > commaPrecedence + ? expression + : ts.setTextRange(ts.createParen(expression), expression); + } + ts.parenthesizeExpressionForList = parenthesizeExpressionForList; + function parenthesizeExpressionForExpressionStatement(expression) { + var emittedExpression = skipPartiallyEmittedExpressions(expression); + if (ts.isCallExpression(emittedExpression)) { + var callee = emittedExpression.expression; + var kind = skipPartiallyEmittedExpressions(callee).kind; + if (kind === 185 || kind === 186) { + var mutableCall = ts.getMutableClone(emittedExpression); + mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); + return recreatePartiallyEmittedExpressions(expression, mutableCall); + } + } + else { + var leftmostExpressionKind = getLeftmostExpression(emittedExpression).kind; + if (leftmostExpressionKind === 177 || leftmostExpressionKind === 185) { + return ts.setTextRange(ts.createParen(expression), expression); + } + } + return expression; + } + ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; + function recreatePartiallyEmittedExpressions(originalOuterExpression, newInnerExpression) { + if (ts.isPartiallyEmittedExpression(originalOuterExpression)) { + var clone_1 = ts.getMutableClone(originalOuterExpression); + clone_1.expression = recreatePartiallyEmittedExpressions(clone_1.expression, newInnerExpression); + return clone_1; + } + return newInnerExpression; + } + function getLeftmostExpression(node) { + while (true) { + switch (node.kind) { + case 192: + node = node.operand; + continue; + case 193: + node = node.left; + continue; + case 194: + node = node.condition; + continue; + case 180: + case 179: + case 178: + node = node.expression; + continue; + case 295: + node = node.expression; + continue; + } + return node; + } + } + function parenthesizeConciseBody(body) { + if (!ts.isBlock(body) && getLeftmostExpression(body).kind === 177) { + return ts.setTextRange(ts.createParen(body), body); + } + return body; + } + ts.parenthesizeConciseBody = parenthesizeConciseBody; + var OuterExpressionKinds; + (function (OuterExpressionKinds) { + OuterExpressionKinds[OuterExpressionKinds["Parentheses"] = 1] = "Parentheses"; + OuterExpressionKinds[OuterExpressionKinds["Assertions"] = 2] = "Assertions"; + OuterExpressionKinds[OuterExpressionKinds["PartiallyEmittedExpressions"] = 4] = "PartiallyEmittedExpressions"; + OuterExpressionKinds[OuterExpressionKinds["All"] = 7] = "All"; + })(OuterExpressionKinds = ts.OuterExpressionKinds || (ts.OuterExpressionKinds = {})); + function skipOuterExpressions(node, kinds) { + if (kinds === void 0) { kinds = 7; } + var previousNode; + do { + previousNode = node; + if (kinds & 1) { + node = skipParentheses(node); + } + if (kinds & 2) { + node = skipAssertions(node); + } + if (kinds & 4) { + node = skipPartiallyEmittedExpressions(node); + } + } while (previousNode !== node); return node; } - ts.setNodeFlags = setNodeFlags; - function setMultiLine(node, multiLine) { - node.multiLine = multiLine; + ts.skipOuterExpressions = skipOuterExpressions; + function skipParentheses(node) { + while (node.kind === 184) { + node = node.expression; + } return node; } - ts.setMultiLine = setMultiLine; - function setHasTrailingComma(nodes, hasTrailingComma) { - nodes.hasTrailingComma = hasTrailingComma; - return nodes; + ts.skipParentheses = skipParentheses; + function skipAssertions(node) { + while (ts.isAssertionExpression(node)) { + node = node.expression; + } + return node; } - ts.setHasTrailingComma = setHasTrailingComma; + ts.skipAssertions = skipAssertions; + function skipPartiallyEmittedExpressions(node) { + while (node.kind === 295) { + node = node.expression; + } + return node; + } + ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; + function startOnNewLine(node) { + node.startsOnNewLine = true; + return node; + } + ts.startOnNewLine = startOnNewLine; + function getExternalHelpersModuleName(node) { + var parseNode = ts.getOriginalNode(node, ts.isSourceFile); + var emitNode = parseNode && parseNode.emitNode; + return emitNode && emitNode.externalHelpersModuleName; + } + ts.getExternalHelpersModuleName = getExternalHelpersModuleName; + function getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions) { + if (compilerOptions.importHelpers && (ts.isExternalModule(node) || compilerOptions.isolatedModules)) { + var externalHelpersModuleName = getExternalHelpersModuleName(node); + if (externalHelpersModuleName) { + return externalHelpersModuleName; + } + var helpers = ts.getEmitHelpers(node); + if (helpers) { + for (var _i = 0, helpers_2 = helpers; _i < helpers_2.length; _i++) { + var helper = helpers_2[_i]; + if (!helper.scoped) { + var parseNode = ts.getOriginalNode(node, ts.isSourceFile); + var emitNode = ts.getOrCreateEmitNode(parseNode); + return emitNode.externalHelpersModuleName || (emitNode.externalHelpersModuleName = ts.createUniqueName(ts.externalHelpersModuleNameText)); + } + } + } + } + } + ts.getOrCreateExternalHelpersModuleNameIfNeeded = getOrCreateExternalHelpersModuleNameIfNeeded; function getLocalNameForExternalImport(node, sourceFile) { var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); if (namespaceDeclaration && !ts.isDefaultImport(node)) { - var name_11 = namespaceDeclaration.name; - return ts.isGeneratedIdentifier(name_11) ? name_11 : createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, namespaceDeclaration.name)); + var name = namespaceDeclaration.name; + return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, namespaceDeclaration.name)); } - if (node.kind === 235 && node.importClause) { - return getGeneratedNameForNode(node); + if (node.kind === 237 && node.importClause) { + return ts.getGeneratedNameForNode(node); } - if (node.kind === 241 && node.moduleSpecifier) { - return getGeneratedNameForNode(node); + if (node.kind === 243 && node.moduleSpecifier) { + return ts.getGeneratedNameForNode(node); } return undefined; } @@ -12956,26 +13426,24 @@ var ts; if (moduleName.kind === 9) { return tryGetModuleNameFromDeclaration(importNode, host, resolver, compilerOptions) || tryRenameExternalModule(moduleName, sourceFile) - || getSynthesizedClone(moduleName); + || ts.getSynthesizedClone(moduleName); } return undefined; } ts.getExternalModuleNameLiteral = getExternalModuleNameLiteral; function tryRenameExternalModule(moduleName, sourceFile) { - if (sourceFile.renamedDependencies && ts.hasProperty(sourceFile.renamedDependencies, moduleName.text)) { - return createLiteral(sourceFile.renamedDependencies[moduleName.text]); - } - return undefined; + var rename = sourceFile.renamedDependencies && sourceFile.renamedDependencies.get(moduleName.text); + return rename && ts.createLiteral(rename); } function tryGetModuleNameFromFile(file, host, options) { if (!file) { return undefined; } if (file.moduleName) { - return createLiteral(file.moduleName); + return ts.createLiteral(file.moduleName); } if (!ts.isDeclarationFile(file) && (options.out || options.outFile)) { - return createLiteral(ts.getExternalModuleNameFromPath(host, file.fileName)); + return ts.createLiteral(ts.getExternalModuleNameFromPath(host, file.fileName)); } return undefined; } @@ -13009,11 +13477,11 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 257: + case 260: return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 258: + case 261: return bindingElement.name; - case 259: + case 262: return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } return undefined; @@ -13029,11 +13497,11 @@ var ts; ts.getTargetOfBindingOrAssignmentElement = getTargetOfBindingOrAssignmentElement; function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 144: - case 174: + case 145: + case 175: return bindingElement.dotDotDotToken; - case 196: - case 259: + case 197: + case 262: return bindingElement; } return undefined; @@ -13041,7 +13509,7 @@ var ts; ts.getRestIndicatorOfBindingOrAssignmentElement = getRestIndicatorOfBindingOrAssignmentElement; function getPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 174: + case 175: if (bindingElement.propertyName) { var propertyName = bindingElement.propertyName; return ts.isComputedPropertyName(propertyName) && ts.isStringOrNumericLiteral(propertyName.expression) @@ -13049,7 +13517,7 @@ var ts; : propertyName; } break; - case 257: + case 260: if (bindingElement.name) { var propertyName = bindingElement.name; return ts.isComputedPropertyName(propertyName) && ts.isStringOrNumericLiteral(propertyName.expression) @@ -13057,7 +13525,7 @@ var ts; : propertyName; } break; - case 259: + case 262: return bindingElement.name; } var target = getTargetOfBindingOrAssignmentElement(bindingElement); @@ -13071,11 +13539,11 @@ var ts; ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 172: case 173: - case 175: - return name.elements; + case 174: case 176: + return name.elements; + case 177: return name.properties; } } @@ -13084,10 +13552,12 @@ var ts; if (ts.isBindingElement(element)) { if (element.dotDotDotToken) { ts.Debug.assertNode(element.name, ts.isIdentifier); - return setOriginalNode(createSpread(element.name, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createSpread(element.name), element), element); } var expression = convertToAssignmentElementTarget(element.name); - return element.initializer ? setOriginalNode(createAssignment(expression, element.initializer, element), element) : expression; + return element.initializer + ? ts.setOriginalNode(ts.setTextRange(ts.createAssignment(expression, element.initializer), element), element) + : expression; } ts.Debug.assertNode(element, ts.isExpression); return element; @@ -13097,14 +13567,14 @@ var ts; if (ts.isBindingElement(element)) { if (element.dotDotDotToken) { ts.Debug.assertNode(element.name, ts.isIdentifier); - return setOriginalNode(createSpreadAssignment(element.name, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createSpreadAssignment(element.name), element), element); } if (element.propertyName) { var expression = convertToAssignmentElementTarget(element.name); - return setOriginalNode(createPropertyAssignment(element.propertyName, element.initializer ? createAssignment(expression, element.initializer) : expression, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createPropertyAssignment(element.propertyName, element.initializer ? ts.createAssignment(expression, element.initializer) : expression), element), element); } ts.Debug.assertNode(element.name, ts.isIdentifier); - return setOriginalNode(createShorthandPropertyAssignment(element.name, element.initializer, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createShorthandPropertyAssignment(element.name, element.initializer), element), element); } ts.Debug.assertNode(element, ts.isObjectLiteralElementLike); return element; @@ -13112,18 +13582,18 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 173: - case 175: - return convertToArrayAssignmentPattern(node); - case 172: + case 174: case 176: + return convertToArrayAssignmentPattern(node); + case 173: + case 177: return convertToObjectAssignmentPattern(node); } } ts.convertToAssignmentPattern = convertToAssignmentPattern; function convertToObjectAssignmentPattern(node) { if (ts.isObjectBindingPattern(node)) { - return setOriginalNode(createObjectLiteral(ts.map(node.elements, convertToObjectAssignmentElement), node), node); + return ts.setOriginalNode(ts.setTextRange(ts.createObjectLiteral(ts.map(node.elements, convertToObjectAssignmentElement)), node), node); } ts.Debug.assertNode(node, ts.isObjectLiteralExpression); return node; @@ -13131,7 +13601,7 @@ var ts; ts.convertToObjectAssignmentPattern = convertToObjectAssignmentPattern; function convertToArrayAssignmentPattern(node) { if (ts.isArrayBindingPattern(node)) { - return setOriginalNode(createArrayLiteral(ts.map(node.elements, convertToArrayAssignmentElement), node), node); + return ts.setOriginalNode(ts.setTextRange(ts.createArrayLiteral(ts.map(node.elements, convertToArrayAssignmentElement)), node), node); } ts.Debug.assertNode(node, ts.isArrayLiteralExpression); return node; @@ -13147,30 +13617,30 @@ var ts; ts.convertToAssignmentElementTarget = convertToAssignmentElementTarget; function collectExternalModuleInfo(sourceFile, resolver, compilerOptions) { var externalImports = []; - var exportSpecifiers = ts.createMap(); - var exportedBindings = ts.createMap(); + var exportSpecifiers = ts.createMultiMap(); + var exportedBindings = []; var uniqueExports = ts.createMap(); var exportedNames; var hasExportDefault = false; var exportEquals = undefined; var hasExportStarsToExportValues = false; var externalHelpersModuleName = getOrCreateExternalHelpersModuleNameIfNeeded(sourceFile, compilerOptions); - var externalHelpersImportDeclaration = externalHelpersModuleName && createImportDeclaration(undefined, undefined, createImportClause(undefined, createNamespaceImport(externalHelpersModuleName)), createLiteral(ts.externalHelpersModuleNameText)); + var externalHelpersImportDeclaration = externalHelpersModuleName && ts.createImportDeclaration(undefined, undefined, ts.createImportClause(undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText)); if (externalHelpersImportDeclaration) { externalImports.push(externalHelpersImportDeclaration); } for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 235: + case 237: externalImports.push(node); break; - case 234: - if (node.moduleReference.kind === 245) { + case 236: + if (node.moduleReference.kind === 247) { externalImports.push(node); } break; - case 241: + case 243: if (node.moduleSpecifier) { if (!node.exportClause) { externalImports.push(node); @@ -13183,26 +13653,26 @@ var ts; else { for (var _b = 0, _c = node.exportClause.elements; _b < _c.length; _b++) { var specifier = _c[_b]; - if (!uniqueExports[specifier.name.text]) { - var name_12 = specifier.propertyName || specifier.name; - ts.multiMapAdd(exportSpecifiers, name_12.text, specifier); - var decl = resolver.getReferencedImportDeclaration(name_12) - || resolver.getReferencedValueDeclaration(name_12); + if (!uniqueExports.get(specifier.name.text)) { + var name = specifier.propertyName || specifier.name; + exportSpecifiers.add(name.text, specifier); + var decl = resolver.getReferencedImportDeclaration(name) + || resolver.getReferencedValueDeclaration(name); if (decl) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(decl), specifier.name); + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(decl), specifier.name); } - uniqueExports[specifier.name.text] = true; + uniqueExports.set(specifier.name.text, true); exportedNames = ts.append(exportedNames, specifier.name); } } } break; - case 240: + case 242: if (node.isExportEquals && !exportEquals) { exportEquals = node; } break; - case 205: + case 207: if (ts.hasModifier(node, 1)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -13210,38 +13680,38 @@ var ts; } } break; - case 225: + case 227: if (ts.hasModifier(node, 1)) { if (ts.hasModifier(node, 512)) { if (!hasExportDefault) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); hasExportDefault = true; } } else { - var name_13 = node.name; - if (!uniqueExports[name_13.text]) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), name_13); - uniqueExports[name_13.text] = true; - exportedNames = ts.append(exportedNames, name_13); + var name = node.name; + if (!uniqueExports.get(name.text)) { + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), name); + uniqueExports.set(name.text, true); + exportedNames = ts.append(exportedNames, name); } } } break; - case 226: + case 228: if (ts.hasModifier(node, 1)) { if (ts.hasModifier(node, 512)) { if (!hasExportDefault) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); hasExportDefault = true; } } else { - var name_14 = node.name; - if (!uniqueExports[name_14.text]) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), name_14); - uniqueExports[name_14.text] = true; - exportedNames = ts.append(exportedNames, name_14); + var name = node.name; + if (!uniqueExports.get(name.text)) { + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), name); + uniqueExports.set(name.text, true); + exportedNames = ts.append(exportedNames, name); } } } @@ -13261,13 +13731,23 @@ var ts; } } else if (!ts.isGeneratedIdentifier(decl.name)) { - if (!uniqueExports[decl.name.text]) { - uniqueExports[decl.name.text] = true; + if (!uniqueExports.get(decl.name.text)) { + uniqueExports.set(decl.name.text, true); exportedNames = ts.append(exportedNames, decl.name); } } return exportedNames; } + function multiMapSparseArrayAdd(map, key, value) { + var values = map[key]; + if (values) { + values.push(value); + } + else { + map[key] = values = [value]; + } + return values; + } })(ts || (ts = {})); var ts; (function (ts) { @@ -13276,13 +13756,13 @@ var ts; var IdentifierConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 261) { + if (kind === 264) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 70) { return new (IdentifierConstructor || (IdentifierConstructor = ts.objectAllocator.getIdentifierConstructor()))(kind, pos, end); } - else if (kind < 141) { + else if (kind < 142) { return new (TokenConstructor || (TokenConstructor = ts.objectAllocator.getTokenConstructor()))(kind, pos, end); } else { @@ -13318,28 +13798,29 @@ var ts; var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode; var cbNodes = cbNodeArray || cbNode; switch (node.kind) { - case 141: + case 142: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 143: + case 144: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || + visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 258: + case 261: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 259: + case 262: return visitNode(cbNode, node.expression); - case 144: + case 145: + case 148: case 147: - case 146: - case 257: - case 223: - case 174: + case 260: + case 225: + case 175: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || @@ -13348,24 +13829,24 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 158: case 159: - case 153: + case 160: case 154: case 155: + case 156: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 149: - case 148: case 150: + case 149: case 151: case 152: - case 184: - case 225: + case 153: case 185: + case 227: + case 186: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -13376,320 +13857,326 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 157: + case 158: return visitNode(cbNode, node.typeName) || visitNodes(cbNodes, node.typeArguments); - case 156: + case 157: return visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 160: - return visitNode(cbNode, node.exprName); case 161: - return visitNodes(cbNodes, node.members); + return visitNode(cbNode, node.exprName); case 162: - return visitNode(cbNode, node.elementType); + return visitNodes(cbNodes, node.members); case 163: - return visitNodes(cbNodes, node.elementTypes); + return visitNode(cbNode, node.elementType); case 164: + return visitNodes(cbNodes, node.elementTypes); case 165: - return visitNodes(cbNodes, node.types); case 166: - case 168: - return visitNode(cbNode, node.type); + return visitNodes(cbNodes, node.types); + case 167: case 169: + return visitNode(cbNode, node.type); + case 170: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 170: + case 171: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 171: - return visitNode(cbNode, node.literal); case 172: + return visitNode(cbNode, node.literal); case 173: - return visitNodes(cbNodes, node.elements); - case 175: + case 174: return visitNodes(cbNodes, node.elements); case 176: - return visitNodes(cbNodes, node.properties); + return visitNodes(cbNodes, node.elements); case 177: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.name); + return visitNodes(cbNodes, node.properties); case 178: return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.argumentExpression); + visitNode(cbNode, node.name); case 179: + return visitNode(cbNode, node.expression) || + visitNode(cbNode, node.argumentExpression); case 180: + case 181: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); - case 181: + case 182: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 182: + case 183: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 183: - return visitNode(cbNode, node.expression); - case 186: + case 184: return visitNode(cbNode, node.expression); case 187: return visitNode(cbNode, node.expression); case 188: return visitNode(cbNode, node.expression); - case 190: - return visitNode(cbNode, node.operand); - case 195: - return visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.expression); case 189: return visitNode(cbNode, node.expression); case 191: return visitNode(cbNode, node.operand); + case 196: + return visitNode(cbNode, node.asteriskToken) || + visitNode(cbNode, node.expression); + case 190: + return visitNode(cbNode, node.expression); case 192: + return visitNode(cbNode, node.operand); + case 193: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 200: + case 201: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 201: + case 202: return visitNode(cbNode, node.expression); - case 193: + case 203: + return visitNode(cbNode, node.name); + case 194: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 196: + case 197: return visitNode(cbNode, node.expression); - case 204: - case 231: + case 206: + case 233: return visitNodes(cbNodes, node.statements); - case 261: + case 264: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 205: + case 207: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 224: + case 226: return visitNodes(cbNodes, node.declarations); - case 207: + case 209: return visitNode(cbNode, node.expression); - case 208: + case 210: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 209: + case 211: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 210: + case 212: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 211: + case 213: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 212: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); - case 213: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); case 214: - case 215: - return visitNode(cbNode, node.label); - case 216: - return visitNode(cbNode, node.expression); - case 217: - return visitNode(cbNode, node.expression) || + return visitNode(cbNode, node.initializer) || + visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); + case 215: + return visitNode(cbNode, node.awaitModifier) || + visitNode(cbNode, node.initializer) || + visitNode(cbNode, node.expression) || + visitNode(cbNode, node.statement); + case 216: + case 217: + return visitNode(cbNode, node.label); case 218: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.caseBlock); - case 232: - return visitNodes(cbNodes, node.clauses); - case 253: - return visitNode(cbNode, node.expression) || - visitNodes(cbNodes, node.statements); - case 254: - return visitNodes(cbNodes, node.statements); + return visitNode(cbNode, node.expression); case 219: - return visitNode(cbNode, node.label) || + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 220: - return visitNode(cbNode, node.expression); + return visitNode(cbNode, node.expression) || + visitNode(cbNode, node.caseBlock); + case 234: + return visitNodes(cbNodes, node.clauses); + case 256: + return visitNode(cbNode, node.expression) || + visitNodes(cbNodes, node.statements); + case 257: + return visitNodes(cbNodes, node.statements); case 221: + return visitNode(cbNode, node.label) || + visitNode(cbNode, node.statement); + case 222: + return visitNode(cbNode, node.expression); + case 223: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 256: + case 259: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 145: + case 146: return visitNode(cbNode, node.expression); - case 226: - case 197: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.heritageClauses) || - visitNodes(cbNodes, node.members); - case 227: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.heritageClauses) || - visitNodes(cbNodes, node.members); case 228: + case 198: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || - visitNode(cbNode, node.type); + visitNodes(cbNodes, node.heritageClauses) || + visitNodes(cbNodes, node.members); case 229: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.typeParameters) || + visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); - case 260: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.initializer); case 230: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.typeParameters) || + visitNode(cbNode, node.type); + case 231: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.members); + case 263: + return visitNode(cbNode, node.name) || + visitNode(cbNode, node.initializer); + case 232: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 234: + case 236: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 235: + case 237: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 236: + case 238: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 233: + case 235: return visitNode(cbNode, node.name); - case 237: + case 239: return visitNode(cbNode, node.name); - case 238: - case 242: + case 240: + case 244: return visitNodes(cbNodes, node.elements); - case 241: + case 243: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 239: - case 243: + case 241: + case 245: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 240: + case 242: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 194: + case 195: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 202: + case 204: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 142: + case 143: return visitNode(cbNode, node.expression); - case 255: + case 258: return visitNodes(cbNodes, node.types); - case 199: + case 200: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments); - case 245: + case 247: return visitNode(cbNode, node.expression); - case 244: - return visitNodes(cbNodes, node.decorators); case 246: + return visitNodes(cbNodes, node.decorators); + case 248: return visitNode(cbNode, node.openingElement) || visitNodes(cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 247: - case 248: - return visitNode(cbNode, node.tagName) || - visitNodes(cbNodes, node.attributes); + case 249: case 250: + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.attributes); + case 253: + return visitNodes(cbNodes, node.properties); + case 252: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); + case 254: + return visitNode(cbNode, node.expression); + case 255: + return visitNode(cbNode, node.dotDotDotToken) || + visitNode(cbNode, node.expression); case 251: - return visitNode(cbNode, node.expression); - case 252: - return visitNode(cbNode, node.expression); - case 249: return visitNode(cbNode, node.tagName); - case 262: - return visitNode(cbNode, node.type); case 266: - return visitNodes(cbNodes, node.types); - case 267: - return visitNodes(cbNodes, node.types); - case 265: - return visitNode(cbNode, node.elementType); - case 269: - return visitNode(cbNode, node.type); - case 268: return visitNode(cbNode, node.type); case 270: - return visitNode(cbNode, node.literal); - case 272: - return visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeArguments); + return visitNodes(cbNodes, node.types); + case 271: + return visitNodes(cbNodes, node.types); + case 269: + return visitNode(cbNode, node.elementType); case 273: return visitNode(cbNode, node.type); + case 272: + return visitNode(cbNode, node.type); case 274: - return visitNodes(cbNodes, node.parameters) || - visitNode(cbNode, node.type); - case 275: - return visitNode(cbNode, node.type); + return visitNode(cbNode, node.literal); case 276: - return visitNode(cbNode, node.type); + return visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.typeArguments); case 277: return visitNode(cbNode, node.type); - case 271: + case 278: + return visitNodes(cbNodes, node.parameters) || + visitNode(cbNode, node.type); + case 279: + return visitNode(cbNode, node.type); + case 280: + return visitNode(cbNode, node.type); + case 281: + return visitNode(cbNode, node.type); + case 275: return visitNode(cbNode, node.name) || visitNode(cbNode, node.type); - case 278: + case 282: return visitNodes(cbNodes, node.tags); - case 281: + case 285: return visitNode(cbNode, node.preParameterName) || visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.postParameterName); - case 282: + case 286: return visitNode(cbNode, node.typeExpression); - case 283: - return visitNode(cbNode, node.typeExpression); - case 280: + case 287: return visitNode(cbNode, node.typeExpression); case 284: + return visitNode(cbNode, node.typeExpression); + case 288: return visitNodes(cbNodes, node.typeParameters); - case 285: + case 289: return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.jsDocTypeLiteral); - case 287: + case 291: return visitNodes(cbNodes, node.jsDocPropertyTags); - case 286: + case 290: return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name); - case 294: + case 295: return visitNode(cbNode, node.expression); - case 288: + case 292: return visitNode(cbNode, node.literal); } } @@ -13730,7 +14217,7 @@ var ts; var Parser; (function (Parser) { var scanner = ts.createScanner(5, true); - var disallowInAndDecoratorContext = 65536 | 262144; + var disallowInAndDecoratorContext = 2048 | 8192; var NodeConstructor; var TokenConstructor; var IdentifierConstructor; @@ -13778,7 +14265,7 @@ var ts; identifiers = ts.createMap(); identifierCount = 0; nodeCount = 0; - contextFlags = scriptKind === 1 || scriptKind === 2 ? 2097152 : 0; + contextFlags = scriptKind === 1 || scriptKind === 2 ? 65536 : 0; parseErrorBeforeNextFinishedNode = false; scanner.setText(sourceText); scanner.setOnError(scanError); @@ -13853,7 +14340,7 @@ var ts; } Parser.fixupParentReferences = fixupParentReferences; function createSourceFile(fileName, languageVersion, scriptKind) { - var sourceFile = new SourceFileConstructor(261, 0, sourceText.length); + var sourceFile = new SourceFileConstructor(264, 0, sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -13873,16 +14360,16 @@ var ts; } } function setDisallowInContext(val) { - setContextFlag(val, 65536); + setContextFlag(val, 2048); } function setYieldContext(val) { - setContextFlag(val, 131072); + setContextFlag(val, 4096); } function setDecoratorContext(val) { - setContextFlag(val, 262144); + setContextFlag(val, 8192); } function setAwaitContext(val) { - setContextFlag(val, 524288); + setContextFlag(val, 16384); } function doOutsideOfContext(context, func) { var contextFlagsToClear = context & contextFlags; @@ -13905,40 +14392,40 @@ var ts; return func(); } function allowInAnd(func) { - return doOutsideOfContext(65536, func); + return doOutsideOfContext(2048, func); } function disallowInAnd(func) { - return doInsideOfContext(65536, func); + return doInsideOfContext(2048, func); } function doInYieldContext(func) { - return doInsideOfContext(131072, func); + return doInsideOfContext(4096, func); } function doInDecoratorContext(func) { - return doInsideOfContext(262144, func); + return doInsideOfContext(8192, func); } function doInAwaitContext(func) { - return doInsideOfContext(524288, func); + return doInsideOfContext(16384, func); } function doOutsideOfAwaitContext(func) { - return doOutsideOfContext(524288, func); + return doOutsideOfContext(16384, func); } function doInYieldAndAwaitContext(func) { - return doInsideOfContext(131072 | 524288, func); + return doInsideOfContext(4096 | 16384, func); } function inContext(flags) { return (contextFlags & flags) !== 0; } function inYieldContext() { - return inContext(131072); + return inContext(4096); } function inDisallowInContext() { - return inContext(65536); + return inContext(2048); } function inDecoratorContext() { - return inContext(262144); + return inContext(8192); } function inAwaitContext() { - return inContext(524288); + return inContext(16384); } function parseErrorAtCurrentToken(message, arg0) { var start = scanner.getTokenPos(); @@ -14080,7 +14567,7 @@ var ts; if (!(pos >= 0)) { pos = scanner.getStartPos(); } - return kind >= 141 ? new NodeConstructor(kind, pos, pos) : + return kind >= 142 ? new NodeConstructor(kind, pos, pos) : kind === 70 ? new IdentifierConstructor(kind, pos, pos) : new TokenConstructor(kind, pos, pos); } @@ -14100,7 +14587,7 @@ var ts; } if (parseErrorBeforeNextFinishedNode) { parseErrorBeforeNextFinishedNode = false; - node.flags |= 1048576; + node.flags |= 32768; } return node; } @@ -14117,7 +14604,11 @@ var ts; } function internIdentifier(text) { text = ts.escapeIdentifier(text); - return identifiers[text] || (identifiers[text] = text); + var identifier = identifiers.get(text); + if (identifier === undefined) { + identifiers.set(text, identifier = text); + } + return identifier; } function createIdentifier(isIdentifier, diagnosticMessage) { identifierCount++; @@ -14162,7 +14653,7 @@ var ts; return token() === 9 || token() === 8 || ts.tokenIsIdentifierOrKeyword(token()); } function parseComputedPropertyName() { - var node = createNode(142); + var node = createNode(143); parseExpected(20); node.expression = allowInAnd(parseExpression); parseExpected(21); @@ -14211,6 +14702,7 @@ var ts; function nextTokenIsClassOrFunctionOrAsync() { nextToken(); return token() === 74 || token() === 88 || + (token() === 116 && lookAhead(nextTokenIsClassKeywordOnSameLine)) || (token() === 119 && lookAhead(nextTokenIsFunctionKeywordOnSameLine)); } function isListElement(parsingContext, inErrorRecovery) { @@ -14418,7 +14910,7 @@ var ts; if (ts.containsParseError(node)) { return undefined; } - var nodeContextFlags = node.flags & 3080192; + var nodeContextFlags = node.flags & 96256; if (nodeContextFlags !== contextFlags) { return undefined; } @@ -14467,14 +14959,14 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 150: - case 155: case 151: + case 156: case 152: - case 147: - case 203: + case 153: + case 148: + case 205: return true; - case 149: + case 150: var methodDeclaration = node; var nameIsConstructor = methodDeclaration.name.kind === 70 && methodDeclaration.name.originalKeywordKind === 122; @@ -14486,8 +14978,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 253: - case 254: + case 256: + case 257: return true; } } @@ -14496,65 +14988,65 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 225: - case 205: - case 204: - case 208: + case 227: case 207: - case 220: - case 216: - case 218: - case 215: - case 214: - case 212: - case 213: - case 211: - case 210: - case 217: case 206: - case 221: - case 219: + case 210: case 209: case 222: - case 235: - case 234: - case 241: - case 240: - case 230: - case 226: - case 227: - case 229: + case 218: + case 220: + case 217: + case 216: + case 214: + case 215: + case 213: + case 212: + case 219: + case 208: + case 223: + case 221: + case 211: + case 224: + case 237: + case 236: + case 243: + case 242: + case 232: case 228: + case 229: + case 231: + case 230: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 260; + return node.kind === 263; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 154: - case 148: case 155: - case 146: - case 153: + case 149: + case 156: + case 147: + case 154: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 223) { + if (node.kind !== 225) { return false; } var variableDeclarator = node; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 144) { + if (node.kind !== 145) { return false; } var parameter = node; @@ -14599,7 +15091,6 @@ var ts; case 25: return ts.Diagnostics.Property_assignment_expected; } } - ; function parseDelimitedList(kind, parseElement, considerSemicolonAsDelimiter) { var saveParsingContext = parsingContext; parsingContext |= 1 << kind; @@ -14650,7 +15141,7 @@ var ts; function parseEntityName(allowReservedWords, diagnosticMessage) { var entity = parseIdentifier(diagnosticMessage); while (parseOptional(22)) { - var node = createNode(141, entity.pos); + var node = createNode(142, entity.pos); node.left = entity; node.right = parseRightSideOfDot(allowReservedWords); entity = finishNode(node); @@ -14667,7 +15158,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(194); + var template = createNode(195); template.head = parseTemplateHead(); ts.Debug.assert(template.head.kind === 13, "Template head has wrong token kind"); var templateSpans = createNodeArray(); @@ -14679,7 +15170,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(202); + var span = createNode(204); span.expression = allowInAnd(parseExpression); var literal; if (token() === 17) { @@ -14715,20 +15206,16 @@ var ts; if (scanner.isUnterminated()) { node.isUnterminated = true; } - var tokenPos = scanner.getTokenPos(); + if (node.kind === 8) { + node.numericLiteralFlags = scanner.getNumericLiteralFlags(); + } nextToken(); finishNode(node); - if (node.kind === 8 - && sourceText.charCodeAt(tokenPos) === 48 - && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { - node.isOctalLiteral = true; - } return node; } function parseTypeReference() { - var typeName = parseEntityName(false, ts.Diagnostics.Type_expected); - var node = createNode(157, typeName.pos); - node.typeName = typeName; + var node = createNode(158); + node.typeName = parseEntityName(false, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && token() === 26) { node.typeArguments = parseBracketedList(19, parseType, 26, 28); } @@ -14736,24 +15223,24 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(156, lhs.pos); + var node = createNode(157, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(167); + var node = createNode(168); nextToken(); return finishNode(node); } function parseTypeQuery() { - var node = createNode(160); + var node = createNode(161); parseExpected(102); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(143); + var node = createNode(144); node.name = parseIdentifier(); if (parseOptional(84)) { if (isStartOfType() || !isStartOfExpression()) { @@ -14763,6 +15250,9 @@ var ts; node.expression = parseUnaryExpressionOrHigher(); } } + if (parseOptional(57)) { + node.default = parseType(); + } return finishNode(node); } function parseTypeParameters() { @@ -14780,9 +15270,9 @@ var ts; return token() === 23 || isIdentifierOrPattern() || ts.isModifierKind(token()) || token() === 56 || token() === 98; } function parseParameter() { - var node = createNode(144); + var node = createNode(145); if (token() === 98) { - node.name = createIdentifier(true, undefined); + node.name = createIdentifier(true); node.type = parseParameterType(); return finishNode(node); } @@ -14840,7 +15330,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNode(kind); - if (kind === 154) { + if (kind === 155) { parseExpected(93); } fillSignature(55, false, false, false, node); @@ -14880,7 +15370,7 @@ var ts; return token() === 55 || token() === 25 || token() === 21; } function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) { - var node = createNode(155, fullStart); + var node = createNode(156, fullStart); node.decorators = decorators; node.modifiers = modifiers; node.parameters = parseBracketedList(16, parseParameter, 20, 21); @@ -14892,7 +15382,7 @@ var ts; var name = parsePropertyName(); var questionToken = parseOptionalToken(54); if (token() === 18 || token() === 26) { - var method = createNode(148, fullStart); + var method = createNode(149, fullStart); method.modifiers = modifiers; method.name = name; method.questionToken = questionToken; @@ -14901,7 +15391,7 @@ var ts; return addJSDocComment(finishNode(method)); } else { - var property = createNode(146, fullStart); + var property = createNode(147, fullStart); property.modifiers = modifiers; property.name = name; property.questionToken = questionToken; @@ -14914,19 +15404,19 @@ var ts; } } function isTypeMemberStart() { - var idToken; if (token() === 18 || token() === 26) { return true; } + var idToken; while (ts.isModifierKind(token())) { - idToken = token(); + idToken = true; nextToken(); } if (token() === 20) { return true; } if (isLiteralPropertyName()) { - idToken = token(); + idToken = true; nextToken(); } if (idToken) { @@ -14941,10 +15431,10 @@ var ts; } function parseTypeMember() { if (token() === 18 || token() === 26) { - return parseSignatureMember(153); + return parseSignatureMember(154); } if (token() === 93 && lookAhead(isStartOfConstructSignature)) { - return parseSignatureMember(154); + return parseSignatureMember(155); } var fullStart = getNodePos(); var modifiers = parseModifiers(); @@ -14958,7 +15448,7 @@ var ts; return token() === 18 || token() === 26; } function parseTypeLiteral() { - var node = createNode(161); + var node = createNode(162); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -14981,14 +15471,14 @@ var ts; return token() === 20 && nextTokenIsIdentifier() && nextToken() === 91; } function parseMappedTypeParameter() { - var node = createNode(143); + var node = createNode(144); node.name = parseIdentifier(); parseExpected(91); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(170); + var node = createNode(171); parseExpected(16); node.readonlyToken = parseOptionalToken(130); parseExpected(20); @@ -15001,12 +15491,12 @@ var ts; return finishNode(node); } function parseTupleType() { - var node = createNode(163); + var node = createNode(164); node.elementTypes = parseBracketedList(20, parseType, 20, 21); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(166); + var node = createNode(167); parseExpected(18); node.type = parseType(); parseExpected(19); @@ -15014,7 +15504,7 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNode(kind); - if (kind === 159) { + if (kind === 160) { parseExpected(93); } fillSignature(35, false, false, false, node); @@ -15025,7 +15515,7 @@ var ts; return token() === 22 ? undefined : node; } function parseLiteralTypeNode() { - var node = createNode(171); + var node = createNode(172); node.literal = parseSimpleUnaryExpression(); finishNode(node); return node; @@ -15036,12 +15526,13 @@ var ts; function parseNonArrayType() { switch (token()) { case 118: - case 134: + case 135: case 132: case 121: - case 135: - case 137: + case 136: + case 138: case 129: + case 133: var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReference(); case 9: @@ -15078,12 +15569,12 @@ var ts; function isStartOfType() { switch (token()) { case 118: - case 134: + case 135: case 132: case 121: - case 135: + case 136: case 104: - case 137: + case 138: case 94: case 98: case 102: @@ -15091,11 +15582,14 @@ var ts; case 16: case 20: case 26: + case 48: + case 47: case 93: case 9: case 8: case 100: case 85: + case 133: return true; case 37: return lookAhead(nextTokenIsNumericLiteral); @@ -15113,14 +15607,14 @@ var ts; var type = parseNonArrayType(); while (!scanner.hasPrecedingLineBreak() && parseOptional(20)) { if (isStartOfType()) { - var node = createNode(169, type.pos); + var node = createNode(170, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(21); type = finishNode(node); } else { - var node = createNode(162, type.pos); + var node = createNode(163, type.pos); node.elementType = type; parseExpected(21); type = finishNode(node); @@ -15129,7 +15623,7 @@ var ts; return type; } function parseTypeOperator(operator) { - var node = createNode(168); + var node = createNode(169); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); @@ -15143,6 +15637,7 @@ var ts; return parseArrayTypeOrHigher(); } function parseUnionOrIntersectionType(kind, parseConstituentType, operator) { + parseOptional(operator); var type = parseConstituentType(); if (token() === operator) { var types = createNodeArray([type], type.pos); @@ -15157,10 +15652,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(165, parseTypeOperatorOrHigher, 47); + return parseUnionOrIntersectionType(166, parseTypeOperatorOrHigher, 47); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(164, parseIntersectionTypeOrHigher, 48); + return parseUnionOrIntersectionType(165, parseIntersectionTypeOrHigher, 48); } function isStartOfFunctionType() { if (token() === 26) { @@ -15206,7 +15701,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(156, typePredicateVariable.pos); + var node = createNode(157, typePredicateVariable.pos); node.parameterName = typePredicateVariable; node.type = type; return finishNode(node); @@ -15223,14 +15718,14 @@ var ts; } } function parseType() { - return doOutsideOfContext(655360, parseTypeWorker); + return doOutsideOfContext(20480, parseTypeWorker); } function parseTypeWorker() { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(158); + return parseFunctionOrConstructorType(159); } if (token() === 93) { - return parseFunctionOrConstructorType(159); + return parseFunctionOrConstructorType(160); } return parseUnionTypeOrHigher(); } @@ -15349,7 +15844,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(195); + var node = createNode(196); nextToken(); if (!scanner.hasPrecedingLineBreak() && (token() === 38 || isStartOfExpression())) { @@ -15365,13 +15860,13 @@ var ts; ts.Debug.assert(token() === 35, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(185, asyncModifier.pos); + node = createNode(186, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(185, identifier.pos); + node = createNode(186, identifier.pos); } - var parameter = createNode(144, identifier.pos); + var parameter = createNode(145, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos); @@ -15505,7 +16000,7 @@ var ts; return 0; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(185); + var node = createNode(186); node.modifiers = parseModifiersForArrowFunction(); var isAsync = !!(ts.getModifierFlags(node) & 256); fillSignature(55, false, isAsync, !allowAmbiguity, node); @@ -15537,7 +16032,7 @@ var ts; if (!questionToken) { return leftOperand; } - var node = createNode(193, leftOperand.pos); + var node = createNode(194, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -15550,7 +16045,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 91 || t === 140; + return t === 91 || t === 141; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -15628,43 +16123,43 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(192, left.pos); + var node = createNode(193, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(200, left.pos); + var node = createNode(201, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(190); + var node = createNode(191); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(186); - nextToken(); - node.expression = parseSimpleUnaryExpression(); - return finishNode(node); - } - function parseTypeOfExpression() { var node = createNode(187); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } - function parseVoidExpression() { + function parseTypeOfExpression() { var node = createNode(188); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } + function parseVoidExpression() { + var node = createNode(189); + nextToken(); + node.expression = parseSimpleUnaryExpression(); + return finishNode(node); + } function isAwaitExpression() { if (token() === 120) { if (inAwaitContext()) { @@ -15675,7 +16170,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(189); + var node = createNode(190); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -15691,7 +16186,7 @@ var ts; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token() === 39) { var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); - if (simpleUnaryExpression.kind === 182) { + if (simpleUnaryExpression.kind === 183) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -15744,7 +16239,7 @@ var ts; } function parseIncrementExpression() { if (token() === 42 || token() === 43) { - var node = createNode(190); + var node = createNode(191); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -15756,7 +16251,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 42 || token() === 43) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(191, expression.pos); + var node = createNode(192, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -15779,7 +16274,7 @@ var ts; if (token() === 18 || token() === 22 || token() === 20) { return expression; } - var node = createNode(177, expression.pos); + var node = createNode(178, expression.pos); node.expression = expression; parseExpectedToken(22, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(true); @@ -15801,8 +16296,8 @@ var ts; function parseJsxElementOrSelfClosingElement(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElement(inExpressionContext); var result; - if (opening.kind === 248) { - var node = createNode(246, opening.pos); + if (opening.kind === 250) { + var node = createNode(248, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement.tagName); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -15812,14 +16307,14 @@ var ts; result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 247); + ts.Debug.assert(opening.kind === 249); result = opening; } if (inExpressionContext && token() === 26) { var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElement(true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(192, result.pos); + var badNode = createNode(193, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -15859,20 +16354,28 @@ var ts; parseErrorAtPosition(openingTagName.pos, openingTagName.end - openingTagName.pos, ts.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, ts.getTextOfNodeFromSourceText(sourceText, openingTagName)); break; } + else if (token() === 7) { + break; + } result.push(parseJsxChild()); } result.end = scanner.getTokenPos(); parsingContext = saveParsingContext; return result; } + function parseJsxAttributes() { + var jsxAttributes = createNode(253); + jsxAttributes.properties = parseList(13, parseJsxAttribute); + return finishNode(jsxAttributes); + } function parseJsxOpeningOrSelfClosingElement(inExpressionContext) { var fullStart = scanner.getStartPos(); parseExpected(26); var tagName = parseJsxElementName(); - var attributes = parseList(13, parseJsxAttribute); + var attributes = parseJsxAttributes(); var node; if (token() === 28) { - node = createNode(248, fullStart); + node = createNode(250, fullStart); scanJsxText(); } else { @@ -15884,7 +16387,7 @@ var ts; parseExpected(28, undefined, false); scanJsxText(); } - node = createNode(247, fullStart); + node = createNode(249, fullStart); } node.tagName = tagName; node.attributes = attributes; @@ -15895,7 +16398,7 @@ var ts; var expression = token() === 98 ? parseTokenNode() : parseIdentifierName(); while (parseOptional(22)) { - var propertyAccess = createNode(177, expression.pos); + var propertyAccess = createNode(178, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(true); expression = finishNode(propertyAccess); @@ -15903,9 +16406,10 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(252); + var node = createNode(255); parseExpected(16); if (token() !== 17) { + node.dotDotDotToken = parseOptionalToken(23); node.expression = parseAssignmentExpressionOrHigher(); } if (inExpressionContext) { @@ -15922,7 +16426,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(250); + var node = createNode(252); node.name = parseIdentifierName(); if (token() === 57) { switch (scanJsxAttributeValue()) { @@ -15937,7 +16441,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(251); + var node = createNode(254); parseExpected(16); parseExpected(23); node.expression = parseExpression(); @@ -15945,7 +16449,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(249); + var node = createNode(251); parseExpected(27); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -15958,7 +16462,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(182); + var node = createNode(183); parseExpected(26); node.type = parseType(); parseExpected(28); @@ -15969,7 +16473,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(22); if (dotToken) { - var propertyAccess = createNode(177, expression.pos); + var propertyAccess = createNode(178, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(true); expression = finishNode(propertyAccess); @@ -15977,13 +16481,13 @@ var ts; } if (token() === 50 && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(201, expression.pos); + var nonNullExpression = createNode(202, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; } if (!inDecoratorContext() && parseOptional(20)) { - var indexedAccess = createNode(178, expression.pos); + var indexedAccess = createNode(179, expression.pos); indexedAccess.expression = expression; if (token() !== 21) { indexedAccess.argumentExpression = allowInAnd(parseExpression); @@ -15997,7 +16501,7 @@ var ts; continue; } if (token() === 12 || token() === 13) { - var tagExpression = createNode(181, expression.pos); + var tagExpression = createNode(182, expression.pos); tagExpression.tag = expression; tagExpression.template = token() === 12 ? parseLiteralNode() @@ -16016,7 +16520,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(179, expression.pos); + var callExpr = createNode(180, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -16024,7 +16528,7 @@ var ts; continue; } else if (token() === 18) { - var callExpr = createNode(179, expression.pos); + var callExpr = createNode(180, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -16119,28 +16623,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(183); + var node = createNode(184); parseExpected(18); node.expression = allowInAnd(parseExpression); parseExpected(19); return finishNode(node); } function parseSpreadElement() { - var node = createNode(196); + var node = createNode(197); parseExpected(23); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 23 ? parseSpreadElement() : - token() === 25 ? createNode(198) : + token() === 25 ? createNode(199) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(175); + var node = createNode(176); parseExpected(20); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -16151,18 +16655,18 @@ var ts; } function tryParseAccessorDeclaration(fullStart, decorators, modifiers) { if (parseContextualModifier(124)) { - return parseAccessorDeclaration(151, fullStart, decorators, modifiers); - } - else if (parseContextualModifier(133)) { return parseAccessorDeclaration(152, fullStart, decorators, modifiers); } + else if (parseContextualModifier(134)) { + return parseAccessorDeclaration(153, fullStart, decorators, modifiers); + } return undefined; } function parseObjectLiteralElement() { var fullStart = scanner.getStartPos(); var dotDotDotToken = parseOptionalToken(23); if (dotDotDotToken) { - var spreadElement = createNode(259, fullStart); + var spreadElement = createNode(262, fullStart); spreadElement.expression = parseAssignmentExpressionOrHigher(); return addJSDocComment(finishNode(spreadElement)); } @@ -16181,7 +16685,7 @@ var ts; } var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 25 || token() === 17 || token() === 57); if (isShorthandPropertyAssignment) { - var shorthandDeclaration = createNode(258, fullStart); + var shorthandDeclaration = createNode(261, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; var equalsToken = parseOptionalToken(57); @@ -16192,7 +16696,7 @@ var ts; return addJSDocComment(finishNode(shorthandDeclaration)); } else { - var propertyAssignment = createNode(257, fullStart); + var propertyAssignment = createNode(260, fullStart); propertyAssignment.modifiers = modifiers; propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; @@ -16202,7 +16706,7 @@ var ts; } } function parseObjectLiteralExpression() { - var node = createNode(176); + var node = createNode(177); parseExpected(16); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -16216,7 +16720,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(false); } - var node = createNode(184); + var node = createNode(185); node.modifiers = parseModifiers(); parseExpected(88); node.asteriskToken = parseOptionalToken(38); @@ -16238,8 +16742,15 @@ var ts; return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(180); + var fullStart = scanner.getStartPos(); parseExpected(93); + if (parseOptional(22)) { + var node_1 = createNode(203, fullStart); + node_1.keywordToken = 93; + node_1.name = parseIdentifierName(); + return finishNode(node_1); + } + var node = createNode(181, fullStart); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); if (node.typeArguments || token() === 18) { @@ -16248,7 +16759,7 @@ var ts; return finishNode(node); } function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(204); + var node = createNode(206); if (parseExpected(16, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -16279,12 +16790,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(206); + var node = createNode(208); parseExpected(24); return finishNode(node); } function parseIfStatement() { - var node = createNode(208); + var node = createNode(210); parseExpected(89); parseExpected(18); node.expression = allowInAnd(parseExpression); @@ -16294,7 +16805,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(209); + var node = createNode(211); parseExpected(80); node.statement = parseStatement(); parseExpected(105); @@ -16305,7 +16816,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(210); + var node = createNode(212); parseExpected(105); parseExpected(18); node.expression = allowInAnd(parseExpression); @@ -16316,6 +16827,7 @@ var ts; function parseForOrForInOrForOfStatement() { var pos = getNodePos(); parseExpected(87); + var awaitToken = parseOptionalToken(120); parseExpected(18); var initializer = undefined; if (token() !== 24) { @@ -16327,22 +16839,23 @@ var ts; } } var forOrForInOrForOfStatement; - if (parseOptional(91)) { - var forInStatement = createNode(212, pos); - forInStatement.initializer = initializer; - forInStatement.expression = allowInAnd(parseExpression); - parseExpected(19); - forOrForInOrForOfStatement = forInStatement; - } - else if (parseOptional(140)) { - var forOfStatement = createNode(213, pos); + if (awaitToken ? parseExpected(141) : parseOptional(141)) { + var forOfStatement = createNode(215, pos); + forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(19); forOrForInOrForOfStatement = forOfStatement; } + else if (parseOptional(91)) { + var forInStatement = createNode(214, pos); + forInStatement.initializer = initializer; + forInStatement.expression = allowInAnd(parseExpression); + parseExpected(19); + forOrForInOrForOfStatement = forInStatement; + } else { - var forStatement = createNode(211, pos); + var forStatement = createNode(213, pos); forStatement.initializer = initializer; parseExpected(24); if (token() !== 24 && token() !== 19) { @@ -16360,7 +16873,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 215 ? 71 : 76); + parseExpected(kind === 217 ? 71 : 76); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -16368,7 +16881,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(216); + var node = createNode(218); parseExpected(95); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -16377,7 +16890,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(217); + var node = createNode(219); parseExpected(106); parseExpected(18); node.expression = allowInAnd(parseExpression); @@ -16386,7 +16899,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(253); + var node = createNode(256); parseExpected(72); node.expression = allowInAnd(parseExpression); parseExpected(55); @@ -16394,7 +16907,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(254); + var node = createNode(257); parseExpected(78); parseExpected(55); node.statements = parseList(3, parseStatement); @@ -16404,12 +16917,12 @@ var ts; return token() === 72 ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(218); + var node = createNode(220); parseExpected(97); parseExpected(18); node.expression = allowInAnd(parseExpression); parseExpected(19); - var caseBlock = createNode(232, scanner.getStartPos()); + var caseBlock = createNode(234, scanner.getStartPos()); parseExpected(16); caseBlock.clauses = parseList(2, parseCaseOrDefaultClause); parseExpected(17); @@ -16417,14 +16930,14 @@ var ts; return finishNode(node); } function parseThrowStatement() { - var node = createNode(220); + var node = createNode(222); parseExpected(99); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } function parseTryStatement() { - var node = createNode(221); + var node = createNode(223); parseExpected(101); node.tryBlock = parseBlock(false); node.catchClause = token() === 73 ? parseCatchClause() : undefined; @@ -16435,7 +16948,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(256); + var result = createNode(259); parseExpected(73); if (parseExpected(18)) { result.variableDeclaration = parseVariableDeclaration(); @@ -16445,7 +16958,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(222); + var node = createNode(224); parseExpected(77); parseSemicolon(); return finishNode(node); @@ -16454,13 +16967,13 @@ var ts; var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); if (expression.kind === 70 && parseOptional(55)) { - var labeledStatement = createNode(219, fullStart); + var labeledStatement = createNode(221, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return addJSDocComment(finishNode(labeledStatement)); } else { - var expressionStatement = createNode(207, fullStart); + var expressionStatement = createNode(209, fullStart); expressionStatement.expression = expression; parseSemicolon(); return addJSDocComment(finishNode(expressionStatement)); @@ -16470,6 +16983,10 @@ var ts; nextToken(); return ts.tokenIsIdentifierOrKeyword(token()) && !scanner.hasPrecedingLineBreak(); } + function nextTokenIsClassKeywordOnSameLine() { + nextToken(); + return token() === 74 && !scanner.hasPrecedingLineBreak(); + } function nextTokenIsFunctionKeywordOnSameLine() { nextToken(); return token() === 88 && !scanner.hasPrecedingLineBreak(); @@ -16489,7 +17006,7 @@ var ts; case 82: return true; case 108: - case 136: + case 137: return nextTokenIsIdentifierOnSameLine(); case 127: case 128: @@ -16506,7 +17023,7 @@ var ts; return false; } continue; - case 139: + case 140: nextToken(); return token() === 16 || token() === 70 || token() === 83; case 90: @@ -16566,8 +17083,8 @@ var ts; case 108: case 127: case 128: - case 136: - case 139: + case 137: + case 140: return true; case 113: case 111: @@ -16612,9 +17129,9 @@ var ts; case 87: return parseForOrForInOrForOfStatement(); case 76: - return parseBreakOrContinueStatement(214); + return parseBreakOrContinueStatement(216); case 71: - return parseBreakOrContinueStatement(215); + return parseBreakOrContinueStatement(217); case 95: return parseReturnStatement(); case 106: @@ -16633,7 +17150,7 @@ var ts; return parseDeclaration(); case 119: case 108: - case 136: + case 137: case 127: case 128: case 123: @@ -16647,7 +17164,7 @@ var ts; case 116: case 114: case 130: - case 139: + case 140: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -16670,11 +17187,11 @@ var ts; return parseClassDeclaration(fullStart, decorators, modifiers); case 108: return parseInterfaceDeclaration(fullStart, decorators, modifiers); - case 136: + case 137: return parseTypeAliasDeclaration(fullStart, decorators, modifiers); case 82: return parseEnumDeclaration(fullStart, decorators, modifiers); - case 139: + case 140: case 127: case 128: return parseModuleDeclaration(fullStart, decorators, modifiers); @@ -16693,7 +17210,7 @@ var ts; } default: if (decorators || modifiers) { - var node = createMissingNode(244, true, ts.Diagnostics.Declaration_expected); + var node = createMissingNode(246, true, ts.Diagnostics.Declaration_expected); node.pos = fullStart; node.decorators = decorators; node.modifiers = modifiers; @@ -16714,16 +17231,16 @@ var ts; } function parseArrayBindingElement() { if (token() === 25) { - return createNode(198); + return createNode(199); } - var node = createNode(174); + var node = createNode(175); node.dotDotDotToken = parseOptionalToken(23); node.name = parseIdentifierOrPattern(); node.initializer = parseBindingElementInitializer(false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(174); + var node = createNode(175); node.dotDotDotToken = parseOptionalToken(23); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -16739,14 +17256,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(172); + var node = createNode(173); parseExpected(16); node.elements = parseDelimitedList(9, parseObjectBindingElement); parseExpected(17); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(173); + var node = createNode(174); parseExpected(20); node.elements = parseDelimitedList(10, parseArrayBindingElement); parseExpected(21); @@ -16765,7 +17282,7 @@ var ts; return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(223); + var node = createNode(225); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token())) { @@ -16774,7 +17291,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(224); + var node = createNode(226); switch (token()) { case 103: break; @@ -16788,7 +17305,7 @@ var ts; ts.Debug.fail(); } nextToken(); - if (token() === 140 && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 141 && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -16803,7 +17320,7 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 19; } function parseVariableStatement(fullStart, decorators, modifiers) { - var node = createNode(205, fullStart); + var node = createNode(207, fullStart); node.decorators = decorators; node.modifiers = modifiers; node.declarationList = parseVariableDeclarationList(false); @@ -16811,7 +17328,7 @@ var ts; return addJSDocComment(finishNode(node)); } function parseFunctionDeclaration(fullStart, decorators, modifiers) { - var node = createNode(225, fullStart); + var node = createNode(227, fullStart); node.decorators = decorators; node.modifiers = modifiers; parseExpected(88); @@ -16824,7 +17341,7 @@ var ts; return addJSDocComment(finishNode(node)); } function parseConstructorDeclaration(pos, decorators, modifiers) { - var node = createNode(150, pos); + var node = createNode(151, pos); node.decorators = decorators; node.modifiers = modifiers; parseExpected(122); @@ -16833,7 +17350,7 @@ var ts; return addJSDocComment(finishNode(node)); } function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { - var method = createNode(149, fullStart); + var method = createNode(150, fullStart); method.decorators = decorators; method.modifiers = modifiers; method.asteriskToken = asteriskToken; @@ -16846,7 +17363,7 @@ var ts; return addJSDocComment(finishNode(method)); } function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) { - var property = createNode(147, fullStart); + var property = createNode(148, fullStart); property.decorators = decorators; property.modifiers = modifiers; property.name = name; @@ -16854,7 +17371,7 @@ var ts; property.type = parseTypeAnnotation(); property.initializer = ts.hasModifier(property, 32) ? allowInAnd(parseNonParameterInitializer) - : doOutsideOfContext(131072 | 65536, parseNonParameterInitializer); + : doOutsideOfContext(4096 | 2048, parseNonParameterInitializer); parseSemicolon(); return addJSDocComment(finishNode(property)); } @@ -16916,7 +17433,7 @@ var ts; return true; } if (idToken !== undefined) { - if (!ts.isKeyword(idToken) || idToken === 133 || idToken === 124) { + if (!ts.isKeyword(idToken) || idToken === 134 || idToken === 124) { return true; } switch (token()) { @@ -16939,7 +17456,7 @@ var ts; if (!parseOptional(56)) { break; } - var decorator = createNode(145, decoratorStart); + var decorator = createNode(146, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); if (!decorators) { @@ -16996,7 +17513,7 @@ var ts; } function parseClassElement() { if (token() === 24) { - var result = createNode(203); + var result = createNode(205); nextToken(); return finishNode(result); } @@ -17021,16 +17538,16 @@ var ts; return parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers); } if (decorators || modifiers) { - var name_15 = createMissingNode(70, true, ts.Diagnostics.Declaration_expected); - return parsePropertyDeclaration(fullStart, decorators, modifiers, name_15, undefined); + var name = createMissingNode(70, true, ts.Diagnostics.Declaration_expected); + return parsePropertyDeclaration(fullStart, decorators, modifiers, name, undefined); } ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 197); + return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 198); } function parseClassDeclaration(fullStart, decorators, modifiers) { - return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 226); + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 228); } function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { var node = createNode(kind, fullStart); @@ -17064,9 +17581,10 @@ var ts; return undefined; } function parseHeritageClause() { - if (token() === 84 || token() === 107) { - var node = createNode(255); - node.token = token(); + var tok = token(); + if (tok === 84 || tok === 107) { + var node = createNode(258); + node.token = tok; nextToken(); node.types = parseDelimitedList(7, parseExpressionWithTypeArguments); return finishNode(node); @@ -17074,7 +17592,7 @@ var ts; return undefined; } function parseExpressionWithTypeArguments() { - var node = createNode(199); + var node = createNode(200); node.expression = parseLeftHandSideExpressionOrHigher(); if (token() === 26) { node.typeArguments = parseBracketedList(19, parseType, 26, 28); @@ -17088,7 +17606,7 @@ var ts; return parseList(5, parseClassElement); } function parseInterfaceDeclaration(fullStart, decorators, modifiers) { - var node = createNode(227, fullStart); + var node = createNode(229, fullStart); node.decorators = decorators; node.modifiers = modifiers; parseExpected(108); @@ -17099,10 +17617,10 @@ var ts; return addJSDocComment(finishNode(node)); } function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { - var node = createNode(228, fullStart); + var node = createNode(230, fullStart); node.decorators = decorators; node.modifiers = modifiers; - parseExpected(136); + parseExpected(137); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(57); @@ -17111,13 +17629,13 @@ var ts; return addJSDocComment(finishNode(node)); } function parseEnumMember() { - var node = createNode(260, scanner.getStartPos()); + var node = createNode(263, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return addJSDocComment(finishNode(node)); } function parseEnumDeclaration(fullStart, decorators, modifiers) { - var node = createNode(229, fullStart); + var node = createNode(231, fullStart); node.decorators = decorators; node.modifiers = modifiers; parseExpected(82); @@ -17132,7 +17650,7 @@ var ts; return addJSDocComment(finishNode(node)); } function parseModuleBlock() { - var node = createNode(231, scanner.getStartPos()); + var node = createNode(233, scanner.getStartPos()); if (parseExpected(16)) { node.statements = parseList(1, parseStatement); parseExpected(17); @@ -17143,7 +17661,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags) { - var node = createNode(230, fullStart); + var node = createNode(232, fullStart); var namespaceFlag = flags & 16; node.decorators = decorators; node.modifiers = modifiers; @@ -17155,10 +17673,10 @@ var ts; return addJSDocComment(finishNode(node)); } function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { - var node = createNode(230, fullStart); + var node = createNode(232, fullStart); node.decorators = decorators; node.modifiers = modifiers; - if (token() === 139) { + if (token() === 140) { node.name = parseIdentifier(); node.flags |= 512; } @@ -17175,7 +17693,7 @@ var ts; } function parseModuleDeclaration(fullStart, decorators, modifiers) { var flags = 0; - if (token() === 139) { + if (token() === 140) { return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers); } else if (parseOptional(128)) { @@ -17200,7 +17718,7 @@ var ts; return nextToken() === 40; } function parseNamespaceExportDeclaration(fullStart, decorators, modifiers) { - var exportDeclaration = createNode(233, fullStart); + var exportDeclaration = createNode(235, fullStart); exportDeclaration.decorators = decorators; exportDeclaration.modifiers = modifiers; parseExpected(117); @@ -17215,38 +17733,41 @@ var ts; var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token() !== 25 && token() !== 138) { - var importEqualsDeclaration = createNode(234, fullStart); - importEqualsDeclaration.decorators = decorators; - importEqualsDeclaration.modifiers = modifiers; - importEqualsDeclaration.name = identifier; - parseExpected(57); - importEqualsDeclaration.moduleReference = parseModuleReference(); - parseSemicolon(); - return addJSDocComment(finishNode(importEqualsDeclaration)); + if (token() !== 25 && token() !== 139) { + return parseImportEqualsDeclaration(fullStart, decorators, modifiers, identifier); } } - var importDeclaration = createNode(235, fullStart); + var importDeclaration = createNode(237, fullStart); importDeclaration.decorators = decorators; importDeclaration.modifiers = modifiers; if (identifier || token() === 38 || token() === 16) { importDeclaration.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(138); + parseExpected(139); } importDeclaration.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); return finishNode(importDeclaration); } + function parseImportEqualsDeclaration(fullStart, decorators, modifiers, identifier) { + var importEqualsDeclaration = createNode(236, fullStart); + importEqualsDeclaration.decorators = decorators; + importEqualsDeclaration.modifiers = modifiers; + importEqualsDeclaration.name = identifier; + parseExpected(57); + importEqualsDeclaration.moduleReference = parseModuleReference(); + parseSemicolon(); + return addJSDocComment(finishNode(importEqualsDeclaration)); + } function parseImportClause(identifier, fullStart) { - var importClause = createNode(236, fullStart); + var importClause = createNode(238, fullStart); if (identifier) { importClause.name = identifier; } if (!importClause.name || parseOptional(25)) { - importClause.namedBindings = token() === 38 ? parseNamespaceImport() : parseNamedImportsOrExports(238); + importClause.namedBindings = token() === 38 ? parseNamespaceImport() : parseNamedImportsOrExports(240); } return finishNode(importClause); } @@ -17256,7 +17777,7 @@ var ts; : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(245); + var node = createNode(247); parseExpected(131); parseExpected(18); node.expression = parseModuleSpecifier(); @@ -17274,7 +17795,7 @@ var ts; } } function parseNamespaceImport() { - var namespaceImport = createNode(237); + var namespaceImport = createNode(239); parseExpected(38); parseExpected(117); namespaceImport.name = parseIdentifier(); @@ -17282,14 +17803,14 @@ var ts; } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(22, kind === 238 ? parseImportSpecifier : parseExportSpecifier, 16, 17); + node.elements = parseBracketedList(22, kind === 240 ? parseImportSpecifier : parseExportSpecifier, 16, 17); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(243); + return parseImportOrExportSpecifier(245); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(239); + return parseImportOrExportSpecifier(241); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -17308,23 +17829,23 @@ var ts; else { node.name = identifierName; } - if (kind === 239 && checkIdentifierIsKeyword) { + if (kind === 241 && checkIdentifierIsKeyword) { parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(fullStart, decorators, modifiers) { - var node = createNode(241, fullStart); + var node = createNode(243, fullStart); node.decorators = decorators; node.modifiers = modifiers; if (parseOptional(38)) { - parseExpected(138); + parseExpected(139); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(242); - if (token() === 138 || (token() === 9 && !scanner.hasPrecedingLineBreak())) { - parseExpected(138); + node.exportClause = parseNamedImportsOrExports(244); + if (token() === 139 || (token() === 9 && !scanner.hasPrecedingLineBreak())) { + parseExpected(139); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -17332,7 +17853,7 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, decorators, modifiers) { - var node = createNode(240, fullStart); + var node = createNode(242, fullStart); node.decorators = decorators; node.modifiers = modifiers; if (parseOptional(57)) { @@ -17351,6 +17872,7 @@ var ts; var typeReferenceDirectives = []; var amdDependencies = []; var amdModuleName; + var checkJsDirective = undefined; while (true) { var kind = triviaScanner.scan(); if (kind !== 2) { @@ -17361,7 +17883,11 @@ var ts; break; } } - var range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos(), kind: triviaScanner.getToken() }; + var range = { + kind: triviaScanner.getToken(), + pos: triviaScanner.getTokenPos(), + end: triviaScanner.getTextPos(), + }; var comment = sourceText.substring(range.pos, range.end); var referencePathMatchResult = ts.getFileReferenceFromReferencePath(comment, range); if (referencePathMatchResult) { @@ -17401,24 +17927,71 @@ var ts; amdDependencies.push(amdDependency); } } + var checkJsDirectiveRegEx = /^\/\/\/?\s*(@ts-check|@ts-nocheck)\s*$/gim; + var checkJsDirectiveMatchResult = checkJsDirectiveRegEx.exec(comment); + if (checkJsDirectiveMatchResult) { + checkJsDirective = { + enabled: ts.compareStrings(checkJsDirectiveMatchResult[1], "@ts-check", true) === 0, + end: range.end, + pos: range.pos + }; + } } } sourceFile.referencedFiles = referencedFiles; sourceFile.typeReferenceDirectives = typeReferenceDirectives; sourceFile.amdDependencies = amdDependencies; sourceFile.moduleName = amdModuleName; + sourceFile.checkJsDirective = checkJsDirective; } function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return ts.hasModifier(node, 1) - || node.kind === 234 && node.moduleReference.kind === 245 - || node.kind === 235 - || node.kind === 240 - || node.kind === 241 + || node.kind === 236 && node.moduleReference.kind === 247 + || node.kind === 237 + || node.kind === 242 + || node.kind === 243 ? node : undefined; }); } + var ParsingContext; + (function (ParsingContext) { + ParsingContext[ParsingContext["SourceElements"] = 0] = "SourceElements"; + ParsingContext[ParsingContext["BlockStatements"] = 1] = "BlockStatements"; + ParsingContext[ParsingContext["SwitchClauses"] = 2] = "SwitchClauses"; + ParsingContext[ParsingContext["SwitchClauseStatements"] = 3] = "SwitchClauseStatements"; + ParsingContext[ParsingContext["TypeMembers"] = 4] = "TypeMembers"; + ParsingContext[ParsingContext["ClassMembers"] = 5] = "ClassMembers"; + ParsingContext[ParsingContext["EnumMembers"] = 6] = "EnumMembers"; + ParsingContext[ParsingContext["HeritageClauseElement"] = 7] = "HeritageClauseElement"; + ParsingContext[ParsingContext["VariableDeclarations"] = 8] = "VariableDeclarations"; + ParsingContext[ParsingContext["ObjectBindingElements"] = 9] = "ObjectBindingElements"; + ParsingContext[ParsingContext["ArrayBindingElements"] = 10] = "ArrayBindingElements"; + ParsingContext[ParsingContext["ArgumentExpressions"] = 11] = "ArgumentExpressions"; + ParsingContext[ParsingContext["ObjectLiteralMembers"] = 12] = "ObjectLiteralMembers"; + ParsingContext[ParsingContext["JsxAttributes"] = 13] = "JsxAttributes"; + ParsingContext[ParsingContext["JsxChildren"] = 14] = "JsxChildren"; + ParsingContext[ParsingContext["ArrayLiteralMembers"] = 15] = "ArrayLiteralMembers"; + ParsingContext[ParsingContext["Parameters"] = 16] = "Parameters"; + ParsingContext[ParsingContext["RestProperties"] = 17] = "RestProperties"; + ParsingContext[ParsingContext["TypeParameters"] = 18] = "TypeParameters"; + ParsingContext[ParsingContext["TypeArguments"] = 19] = "TypeArguments"; + ParsingContext[ParsingContext["TupleElementTypes"] = 20] = "TupleElementTypes"; + ParsingContext[ParsingContext["HeritageClauses"] = 21] = "HeritageClauses"; + ParsingContext[ParsingContext["ImportOrExportSpecifiers"] = 22] = "ImportOrExportSpecifiers"; + ParsingContext[ParsingContext["JSDocFunctionParameters"] = 23] = "JSDocFunctionParameters"; + ParsingContext[ParsingContext["JSDocTypeArguments"] = 24] = "JSDocTypeArguments"; + ParsingContext[ParsingContext["JSDocRecordMembers"] = 25] = "JSDocRecordMembers"; + ParsingContext[ParsingContext["JSDocTupleTypes"] = 26] = "JSDocTupleTypes"; + ParsingContext[ParsingContext["Count"] = 27] = "Count"; + })(ParsingContext || (ParsingContext = {})); + var Tristate; + (function (Tristate) { + Tristate[Tristate["False"] = 0] = "False"; + Tristate[Tristate["True"] = 1] = "True"; + Tristate[Tristate["Unknown"] = 2] = "Unknown"; + })(Tristate || (Tristate = {})); var JSDocParser; (function (JSDocParser) { function isJSDocType() { @@ -17450,7 +18023,7 @@ var ts; } JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; function parseJSDocTypeExpression() { - var result = createNode(262, scanner.getTokenPos()); + var result = createNode(266, scanner.getTokenPos()); parseExpected(16); result.type = parseJSDocTopLevelType(); parseExpected(17); @@ -17461,12 +18034,12 @@ var ts; function parseJSDocTopLevelType() { var type = parseJSDocType(); if (token() === 48) { - var unionType = createNode(266, type.pos); + var unionType = createNode(270, type.pos); unionType.types = parseJSDocTypeList(type); type = finishNode(unionType); } if (token() === 57) { - var optionalType = createNode(273, type.pos); + var optionalType = createNode(277, type.pos); nextToken(); optionalType.type = type; type = finishNode(optionalType); @@ -17477,20 +18050,20 @@ var ts; var type = parseBasicTypeExpression(); while (true) { if (token() === 20) { - var arrayType = createNode(265, type.pos); + var arrayType = createNode(269, type.pos); arrayType.elementType = type; nextToken(); parseExpected(21); type = finishNode(arrayType); } else if (token() === 54) { - var nullableType = createNode(268, type.pos); + var nullableType = createNode(272, type.pos); nullableType.type = type; nextToken(); type = finishNode(nullableType); } else if (token() === 50) { - var nonNullableType = createNode(269, type.pos); + var nonNullableType = createNode(273, type.pos); nonNullableType.type = type; nextToken(); type = finishNode(nonNullableType); @@ -17524,14 +18097,15 @@ var ts; case 98: return parseJSDocThisType(); case 118: - case 134: + case 135: case 132: case 121: - case 135: + case 136: case 104: case 94: - case 137: + case 138: case 129: + case 133: return parseTokenNode(); case 9: case 8: @@ -17542,27 +18116,27 @@ var ts; return parseJSDocTypeReference(); } function parseJSDocThisType() { - var result = createNode(277); + var result = createNode(281); nextToken(); parseExpected(55); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocConstructorType() { - var result = createNode(276); + var result = createNode(280); nextToken(); parseExpected(55); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocVariadicType() { - var result = createNode(275); + var result = createNode(279); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocFunctionType() { - var result = createNode(274); + var result = createNode(278); nextToken(); parseExpected(18); result.parameters = parseDelimitedList(23, parseJSDocParameter); @@ -17575,7 +18149,7 @@ var ts; return finishNode(result); } function parseJSDocParameter() { - var parameter = createNode(144); + var parameter = createNode(145); parameter.type = parseJSDocType(); if (parseOptional(57)) { parameter.questionToken = createNode(57); @@ -17583,7 +18157,7 @@ var ts; return finishNode(parameter); } function parseJSDocTypeReference() { - var result = createNode(272); + var result = createNode(276); result.name = parseSimplePropertyName(); if (token() === 26) { result.typeArguments = parseTypeArguments(); @@ -17617,24 +18191,24 @@ var ts; } } function parseQualifiedName(left) { - var result = createNode(141, left.pos); + var result = createNode(142, left.pos); result.left = left; result.right = parseIdentifierName(); return finishNode(result); } function parseJSDocRecordType() { - var result = createNode(270); + var result = createNode(274); result.literal = parseTypeLiteral(); return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(269); + var result = createNode(273); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocTupleType() { - var result = createNode(267); + var result = createNode(271); nextToken(); result.types = parseDelimitedList(26, parseJSDocType); checkForTrailingComma(result.types); @@ -17648,7 +18222,7 @@ var ts; } } function parseJSDocUnionType() { - var result = createNode(266); + var result = createNode(270); nextToken(); result.types = parseJSDocTypeList(parseJSDocType()); parseExpected(19); @@ -17664,12 +18238,12 @@ var ts; return types; } function parseJSDocAllType() { - var result = createNode(263); + var result = createNode(267); nextToken(); return finishNode(result); } function parseJSDocLiteralType() { - var result = createNode(288); + var result = createNode(292); result.literal = parseLiteralTypeNode(); return finishNode(result); } @@ -17682,11 +18256,11 @@ var ts; token() === 28 || token() === 57 || token() === 48) { - var result = createNode(264, pos); + var result = createNode(268, pos); return finishNode(result); } else { - var result = createNode(268, pos); + var result = createNode(272, pos); result.type = parseJSDocType(); return finishNode(result); } @@ -17714,6 +18288,12 @@ var ts; return comment; } JSDocParser.parseJSDocComment = parseJSDocComment; + var JSDocState; + (function (JSDocState) { + JSDocState[JSDocState["BeginningOfLine"] = 0] = "BeginningOfLine"; + JSDocState[JSDocState["SawAsterisk"] = 1] = "SawAsterisk"; + JSDocState[JSDocState["SavingComments"] = 2] = "SavingComments"; + })(JSDocState || (JSDocState = {})); function parseJSDocCommentWorker(start, length) { var content = sourceText; start = start || 0; @@ -17771,7 +18351,7 @@ var ts; break; case 38: var asterisk = scanner.getTokenText(); - if (state === 1) { + if (state === 1 || state === 2) { state = 2; pushComment(asterisk); } @@ -17786,7 +18366,10 @@ var ts; break; case 5: var whitespace = scanner.getTokenText(); - if (state === 2 || margin !== undefined && indent + whitespace.length > margin) { + if (state === 2) { + comments.push(whitespace); + } + else if (margin !== undefined && indent + whitespace.length > margin) { comments.push(whitespace.slice(margin - indent - 1)); } indent += whitespace.length; @@ -17794,6 +18377,7 @@ var ts; case 1: break; default: + state = 2; pushComment(scanner.getTokenText()); break; } @@ -17826,7 +18410,7 @@ var ts; content.charCodeAt(start + 3) !== 42; } function createJSDocComment() { - var result = createNode(278, start); + var result = createNode(282, start); result.tags = tags; result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -17883,7 +18467,7 @@ var ts; } function parseTagComments(indent) { var comments = []; - var state = 1; + var state = 0; var margin; function pushComment(text) { if (!margin) { @@ -17936,7 +18520,7 @@ var ts; return comments; } function parseUnknownTag(atToken, tagName) { - var result = createNode(279, atToken.pos); + var result = createNode(283, atToken.pos); result.atToken = atToken; result.tagName = tagName; return finishNode(result); @@ -17991,7 +18575,7 @@ var ts; if (!typeExpression) { typeExpression = tryParseTypeExpression(); } - var result = createNode(281, atToken.pos); + var result = createNode(285, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.preParameterName = preName; @@ -18002,20 +18586,20 @@ var ts; return finishNode(result); } function parseReturnTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 282; })) { + if (ts.forEach(tags, function (t) { return t.kind === 286; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(282, atToken.pos); + var result = createNode(286, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); } function parseTypeTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 283; })) { + if (ts.forEach(tags, function (t) { return t.kind === 287; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(283, atToken.pos); + var result = createNode(287, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); @@ -18030,7 +18614,7 @@ var ts; parseErrorAtPosition(scanner.getStartPos(), 0, ts.Diagnostics.Identifier_expected); return undefined; } - var result = createNode(286, atToken.pos); + var result = createNode(290, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.name = name; @@ -18039,7 +18623,7 @@ var ts; } function parseAugmentsTag(atToken, tagName) { var typeExpression = tryParseTypeExpression(); - var result = createNode(280, atToken.pos); + var result = createNode(284, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = typeExpression; @@ -18048,25 +18632,28 @@ var ts; function parseTypedefTag(atToken, tagName) { var typeExpression = tryParseTypeExpression(); skipWhitespace(); - var typedefTag = createNode(285, atToken.pos); + var typedefTag = createNode(289, atToken.pos); typedefTag.atToken = atToken; typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(0); if (typedefTag.fullName) { var rightNode = typedefTag.fullName; - while (rightNode.kind !== 70) { + while (true) { + if (rightNode.kind === 70 || !rightNode.body) { + typedefTag.name = rightNode.kind === 70 ? rightNode : rightNode.name; + break; + } rightNode = rightNode.body; } - typedefTag.name = rightNode; } typedefTag.typeExpression = typeExpression; skipWhitespace(); if (typeExpression) { - if (typeExpression.type.kind === 272) { + if (typeExpression.type.kind === 276) { var jsDocTypeReference = typeExpression.type; if (jsDocTypeReference.name.kind === 70) { - var name_16 = jsDocTypeReference.name; - if (name_16.text === "Object") { + var name = jsDocTypeReference.name; + if (name.text === "Object") { typedefTag.jsDocTypeLiteral = scanChildTags(); } } @@ -18080,7 +18667,7 @@ var ts; } return finishNode(typedefTag); function scanChildTags() { - var jsDocTypeLiteral = createNode(287, scanner.getStartPos()); + var jsDocTypeLiteral = createNode(291, scanner.getStartPos()); var resumePos = scanner.getStartPos(); var canParseTag = true; var seenAsterisk = false; @@ -18110,6 +18697,7 @@ var ts; break; case 70: canParseTag = false; + break; case 1: break; } @@ -18121,7 +18709,7 @@ var ts; var pos = scanner.getTokenPos(); var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (typeNameOrNamespaceName && parseOptional(22)) { - var jsDocNamespaceNode = createNode(230, pos); + var jsDocNamespaceNode = createNode(232, pos); jsDocNamespaceNode.flags |= flags; jsDocNamespaceNode.name = typeNameOrNamespaceName; jsDocNamespaceNode.body = parseJSDocTypeNameWithNamespace(4); @@ -18165,19 +18753,19 @@ var ts; return false; } function parseTemplateTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 284; })) { + if (ts.forEach(tags, function (t) { return t.kind === 288; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } var typeParameters = createNodeArray(); while (true) { - var name_17 = parseJSDocIdentifierName(); + var name = parseJSDocIdentifierName(); skipWhitespace(); - if (!name_17) { + if (!name) { parseErrorAtPosition(scanner.getStartPos(), 0, ts.Diagnostics.Identifier_expected); return undefined; } - var typeParameter = createNode(143, name_17.pos); - typeParameter.name = name_17; + var typeParameter = createNode(144, name.pos); + typeParameter.name = name; finishNode(typeParameter); typeParameters.push(typeParameter); if (token() === 25) { @@ -18188,7 +18776,7 @@ var ts; break; } } - var result = createNode(284, atToken.pos); + var result = createNode(288, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeParameters = typeParameters; @@ -18480,7 +19068,7 @@ var ts; } function visitArray(array) { if (position >= array.pos && position < array.end) { - for (var i = 0, n = array.length; i < n; i++) { + for (var i = 0; i < array.length; i++) { var child = array[i]; if (child) { if (child.pos === position) { @@ -18502,21 +19090,31 @@ var ts; } } } + var InvalidPosition; + (function (InvalidPosition) { + InvalidPosition[InvalidPosition["Value"] = -1] = "Value"; + })(InvalidPosition || (InvalidPosition = {})); })(IncrementalParser || (IncrementalParser = {})); })(ts || (ts = {})); var ts; (function (ts) { + var ModuleInstanceState; + (function (ModuleInstanceState) { + ModuleInstanceState[ModuleInstanceState["NonInstantiated"] = 0] = "NonInstantiated"; + ModuleInstanceState[ModuleInstanceState["Instantiated"] = 1] = "Instantiated"; + ModuleInstanceState[ModuleInstanceState["ConstEnumOnly"] = 2] = "ConstEnumOnly"; + })(ModuleInstanceState = ts.ModuleInstanceState || (ts.ModuleInstanceState = {})); function getModuleInstanceState(node) { - if (node.kind === 227 || node.kind === 228) { + if (node.kind === 229 || node.kind === 230) { return 0; } else if (ts.isConstEnumDeclaration(node)) { return 2; } - else if ((node.kind === 235 || node.kind === 234) && !(ts.hasModifier(node, 1))) { + else if ((node.kind === 237 || node.kind === 236) && !(ts.hasModifier(node, 1))) { return 0; } - else if (node.kind === 231) { + else if (node.kind === 233) { var state_1 = 0; ts.forEachChild(node, function (n) { switch (getModuleInstanceState(n)) { @@ -18532,7 +19130,7 @@ var ts; }); return state_1; } - else if (node.kind === 230) { + else if (node.kind === 232) { var body = node.body; return body ? getModuleInstanceState(body) : 1; } @@ -18544,6 +19142,18 @@ var ts; } } ts.getModuleInstanceState = getModuleInstanceState; + var ContainerFlags; + (function (ContainerFlags) { + ContainerFlags[ContainerFlags["None"] = 0] = "None"; + ContainerFlags[ContainerFlags["IsContainer"] = 1] = "IsContainer"; + ContainerFlags[ContainerFlags["IsBlockScopedContainer"] = 2] = "IsBlockScopedContainer"; + ContainerFlags[ContainerFlags["IsControlFlowContainer"] = 4] = "IsControlFlowContainer"; + ContainerFlags[ContainerFlags["IsFunctionLike"] = 8] = "IsFunctionLike"; + ContainerFlags[ContainerFlags["IsFunctionExpression"] = 16] = "IsFunctionExpression"; + ContainerFlags[ContainerFlags["HasLocals"] = 32] = "HasLocals"; + ContainerFlags[ContainerFlags["IsInterface"] = 64] = "IsInterface"; + ContainerFlags[ContainerFlags["IsObjectLiteralOrClassExpressionMethod"] = 128] = "IsObjectLiteralOrClassExpressionMethod"; + })(ContainerFlags || (ContainerFlags = {})); var binder = createBinder(); function bindSourceFile(file, options) { ts.performance.mark("beforeBind"); @@ -18614,7 +19224,7 @@ var ts; } return bindSourceFile; function bindInStrictMode(file, opts) { - if (opts.alwaysStrict && !ts.isDeclarationFile(file)) { + if ((opts.alwaysStrict === undefined ? opts.strict : opts.alwaysStrict) && !ts.isDeclarationFile(file)) { return true; } else { @@ -18641,7 +19251,7 @@ var ts; if (symbolFlags & 107455) { var valueDeclaration = symbol.valueDeclaration; if (!valueDeclaration || - (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 230)) { + (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 232)) { symbol.valueDeclaration = node; } } @@ -18651,7 +19261,7 @@ var ts; if (ts.isAmbientModule(node)) { return ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + node.name.text + "\""; } - if (node.name.kind === 142) { + if (node.name.kind === 143) { var nameExpression = node.name.expression; if (ts.isStringOrNumericLiteral(nameExpression)) { return nameExpression.text; @@ -18662,46 +19272,47 @@ var ts; return node.name.text; } switch (node.kind) { - case 150: + case 151: return "__constructor"; - case 158: - case 153: - return "__call"; case 159: case 154: - return "__new"; + return "__call"; + case 160: case 155: + return "__new"; + case 156: return "__index"; - case 241: + case 243: return "__export"; - case 240: + case 242: return node.isExportEquals ? "export=" : "default"; - case 192: + case 193: switch (ts.getSpecialPropertyAssignmentKind(node)) { case 2: return "export="; case 1: case 4: + case 5: return node.left.name.text; case 3: return node.left.expression.name.text; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 225: - case 226: + case 227: + case 228: return ts.hasModifier(node, 512) ? "default" : undefined; - case 274: + case 278: return ts.isJSDocConstructSignature(node) ? "__new" : "__call"; - case 144: - ts.Debug.assert(node.parent.kind === 274); + case 145: + ts.Debug.assert(node.parent.kind === 278); var functionType = node.parent; var index = ts.indexOf(functionType.parameters, node); return "arg" + index; - case 285: + case 289: var parentNode = node.parent && node.parent.parent; var nameFromParentNode = void 0; - if (parentNode && parentNode.kind === 205) { + if (parentNode && parentNode.kind === 207) { if (parentNode.declarationList.declarations.length > 0) { var nameIdentifier = parentNode.declarationList.declarations[0].name; if (nameIdentifier.kind === 70) { @@ -18724,13 +19335,16 @@ var ts; symbol = createSymbol(0, "__missing"); } else { - symbol = symbolTable[name] || (symbolTable[name] = createSymbol(0, name)); + symbol = symbolTable.get(name); + if (!symbol) { + symbolTable.set(name, symbol = createSymbol(0, name)); + } if (name && (includes & 788448)) { - classifiableNames[name] = name; + classifiableNames.set(name, name); } if (symbol.flags & excludes) { if (symbol.isReplaceableByMethod) { - symbol = symbolTable[name] = createSymbol(0, name); + symbolTable.set(name, symbol = createSymbol(0, name)); } else { if (node.name) { @@ -18745,7 +19359,7 @@ var ts; } else { if (symbol.declarations && symbol.declarations.length && - (isDefaultExport || (node.kind === 240 && !node.isExportEquals))) { + (isDefaultExport || (node.kind === 242 && !node.isExportEquals))) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; } } @@ -18765,7 +19379,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1; if (symbolFlags & 8388608) { - if (node.kind === 243 || (node.kind === 234 && hasExportModifier)) { + if (node.kind === 245 || (node.kind === 236 && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -18773,7 +19387,7 @@ var ts; } } else { - var isJSDocTypedefInJSDocNamespace = node.kind === 285 && + var isJSDocTypedefInJSDocNamespace = node.kind === 289 && node.name && node.name.kind === 70 && node.name.isInJSDocNamespace; @@ -18828,13 +19442,13 @@ var ts; activeLabels = undefined; hasExplicitReturn = false; bindChildren(node); - node.flags &= ~64896; + node.flags &= ~1408; if (!(currentFlow.flags & 1) && containerFlags & 8 && ts.nodeIsPresent(node.body)) { node.flags |= 128; if (hasExplicitReturn) node.flags |= 256; } - if (node.kind === 261) { + if (node.kind === 264) { node.flags |= emitFlags; } if (isIIFE) { @@ -18910,66 +19524,72 @@ var ts; return; } switch (node.kind) { - case 210: + case 212: bindWhileStatement(node); break; - case 209: + case 211: bindDoStatement(node); break; - case 211: + case 213: bindForStatement(node); break; - case 212: - case 213: + case 214: + case 215: bindForInOrForOfStatement(node); break; - case 208: + case 210: bindIfStatement(node); break; - case 216: - case 220: + case 218: + case 222: bindReturnOrThrow(node); break; - case 215: - case 214: + case 217: + case 216: bindBreakOrContinueStatement(node); break; - case 221: + case 223: bindTryStatement(node); break; - case 218: + case 220: bindSwitchStatement(node); break; - case 232: + case 234: bindCaseBlock(node); break; - case 253: + case 256: bindCaseClause(node); break; - case 219: + case 221: bindLabeledStatement(node); break; - case 190: + case 191: bindPrefixUnaryExpressionFlow(node); break; - case 191: + case 192: bindPostfixUnaryExpressionFlow(node); break; - case 192: + case 193: bindBinaryExpressionFlow(node); break; - case 186: + case 187: bindDeleteExpressionFlow(node); break; - case 193: + case 194: bindConditionalExpressionFlow(node); break; - case 223: + case 225: bindVariableDeclarationFlow(node); break; - case 179: + case 180: bindCallExpressionFlow(node); break; + case 282: + bindJSDocComment(node); + break; + case 289: + bindJSDocTypedefTag(node); + break; default: bindEachChild(node); break; @@ -18979,15 +19599,15 @@ var ts; switch (expr.kind) { case 70: case 98: - case 177: + case 178: return isNarrowableReference(expr); - case 179: + case 180: return hasNarrowableArgument(expr); - case 183: + case 184: return isNarrowingExpression(expr.expression); - case 192: + case 193: return isNarrowingBinaryExpression(expr); - case 190: + case 191: return expr.operator === 50 && isNarrowingExpression(expr.operand); } return false; @@ -18995,7 +19615,8 @@ var ts; function isNarrowableReference(expr) { return expr.kind === 70 || expr.kind === 98 || - expr.kind === 177 && isNarrowableReference(expr.expression); + expr.kind === 96 || + expr.kind === 178 && isNarrowableReference(expr.expression); } function hasNarrowableArgument(expr) { if (expr.arguments) { @@ -19006,14 +19627,14 @@ var ts; } } } - if (expr.expression.kind === 177 && + if (expr.expression.kind === 178 && isNarrowableReference(expr.expression.expression)) { return true; } return false; } function isNarrowingTypeofOperands(expr1, expr2) { - return expr1.kind === 187 && isNarrowableOperand(expr1.expression) && expr2.kind === 9; + return expr1.kind === 188 && isNarrowableOperand(expr1.expression) && expr2.kind === 9; } function isNarrowingBinaryExpression(expr) { switch (expr.operatorToken.kind) { @@ -19034,9 +19655,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 183: + case 184: return isNarrowableOperand(expr.expression); - case 192: + case 193: switch (expr.operatorToken.kind) { case 57: return isNarrowableOperand(expr.left); @@ -19130,33 +19751,33 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 208: case 210: - case 209: - return parent.expression === node; + case 212: case 211: - case 193: + return parent.expression === node; + case 213: + case 194: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 183) { + if (node.kind === 184) { node = node.expression; } - else if (node.kind === 190 && node.operator === 50) { + else if (node.kind === 191 && node.operator === 50) { node = node.operand; } else { - return node.kind === 192 && (node.operatorToken.kind === 52 || + return node.kind === 193 && (node.operatorToken.kind === 52 || node.operatorToken.kind === 53); } } } function isTopLevelLogicalExpression(node) { - while (node.parent.kind === 183 || - node.parent.kind === 190 && + while (node.parent.kind === 184 || + node.parent.kind === 191 && node.parent.operator === 50) { node = node.parent; } @@ -19198,7 +19819,7 @@ var ts; } function bindDoStatement(node) { var preDoLabel = createLoopLabel(); - var enclosingLabeledStatement = node.parent.kind === 219 + var enclosingLabeledStatement = node.parent.kind === 221 ? ts.lastOrUndefined(activeLabels) : undefined; var preConditionLabel = enclosingLabeledStatement ? enclosingLabeledStatement.continueTarget : createBranchLabel(); @@ -19230,10 +19851,13 @@ var ts; var postLoopLabel = createBranchLabel(); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; + if (node.kind === 215) { + bind(node.awaitModifier); + } bind(node.expression); addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 224) { + if (node.initializer.kind !== 226) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -19255,7 +19879,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 216) { + if (node.kind === 218) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -19275,7 +19899,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 215 ? breakTarget : continueTarget; + var flowLabel = node.kind === 217 ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -19308,7 +19932,8 @@ var ts; flowAfterCatch = currentFlow; } if (node.finallyBlock) { - addAntecedent(preFinallyLabel, preTryFlow); + var preFinallyFlow = { flags: 2048, antecedent: preTryFlow, lock: {} }; + addAntecedent(preFinallyLabel, preFinallyFlow); currentFlow = finishFlowLabel(preFinallyLabel); bind(node.finallyBlock); if (!(currentFlow.flags & 1)) { @@ -19318,6 +19943,11 @@ var ts; : unreachableFlow; } } + if (!(currentFlow.flags & 1)) { + var afterFinallyFlow = { flags: 4096, antecedent: currentFlow }; + preFinallyFlow.lock = afterFinallyFlow; + currentFlow = afterFinallyFlow; + } } else { currentFlow = finishFlowLabel(preFinallyLabel); @@ -19332,7 +19962,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 254; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 257; }); node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents; if (!hasDefault) { addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0)); @@ -19397,13 +20027,13 @@ var ts; if (!activeLabel.referenced && !options.allowUnusedLabels) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node.label, ts.Diagnostics.Unused_label)); } - if (!node.statement || node.statement.kind !== 209) { + if (!node.statement || node.statement.kind !== 211) { addAntecedent(postStatementLabel, currentFlow); currentFlow = finishFlowLabel(postStatementLabel); } } function bindDestructuringTargetFlow(node) { - if (node.kind === 192 && node.operatorToken.kind === 57) { + if (node.kind === 193 && node.operatorToken.kind === 57) { bindAssignmentTargetFlow(node.left); } else { @@ -19414,10 +20044,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowAssignment(currentFlow, node); } - else if (node.kind === 175) { + else if (node.kind === 176) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 196) { + if (e.kind === 197) { bindAssignmentTargetFlow(e.expression); } else { @@ -19425,16 +20055,16 @@ var ts; } } } - else if (node.kind === 176) { + else if (node.kind === 177) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 257) { + if (p.kind === 260) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 258) { + else if (p.kind === 261) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 259) { + else if (p.kind === 262) { bindAssignmentTargetFlow(p.expression); } } @@ -19490,7 +20120,7 @@ var ts; bindEachChild(node); if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 57 && node.left.kind === 178) { + if (operator === 57 && node.left.kind === 179) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -19501,7 +20131,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 177) { + if (node.expression.kind === 178) { bindAssignmentTargetFlow(node.expression); } } @@ -19534,16 +20164,31 @@ var ts; } function bindVariableDeclarationFlow(node) { bindEachChild(node); - if (node.initializer || node.parent.parent.kind === 212 || node.parent.parent.kind === 213) { + if (node.initializer || node.parent.parent.kind === 214 || node.parent.parent.kind === 215) { bindInitializedVariableFlow(node); } } + function bindJSDocComment(node) { + ts.forEachChild(node, function (n) { + if (n.kind !== 289) { + bind(n); + } + }); + } + function bindJSDocTypedefTag(node) { + ts.forEachChild(node, function (n) { + if (node.fullName && n === node.name && node.fullName.kind !== 70) { + return; + } + bind(n); + }); + } function bindCallExpressionFlow(node) { var expr = node.expression; - while (expr.kind === 183) { + while (expr.kind === 184) { expr = expr.expression; } - if (expr.kind === 184 || expr.kind === 185) { + if (expr.kind === 185 || expr.kind === 186) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -19551,7 +20196,7 @@ var ts; else { bindEachChild(node); } - if (node.expression.kind === 177) { + if (node.expression.kind === 178) { var propertyAccess = node.expression; if (isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -19560,52 +20205,53 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 197: - case 226: - case 229: - case 176: - case 161: - case 287: - case 270: - return 1; - case 227: - return 1 | 64; - case 274: - case 230: + case 198: case 228: - case 170: + case 231: + case 177: + case 162: + case 291: + case 274: + case 253: + return 1; + case 229: + return 1 | 64; + case 278: + case 232: + case 230: + case 171: return 1 | 32; - case 261: + case 264: return 1 | 4 | 32; - case 149: + case 150: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 | 4 | 32 | 8 | 128; } - case 150: - case 225: - case 148: case 151: + case 227: + case 149: case 152: case 153: case 154: case 155: - case 158: + case 156: case 159: + case 160: return 1 | 4 | 32 | 8; - case 184: case 185: + case 186: return 1 | 4 | 32 | 8 | 16; - case 231: + case 233: return 4; - case 147: + case 148: return node.initializer ? 4 : 0; - case 256: - case 211: - case 212: + case 259: case 213: - case 232: + case 214: + case 215: + case 234: return 2; - case 204: + case 206: return ts.isFunctionLike(node.parent) ? 0 : 2; } return 0; @@ -19621,37 +20267,38 @@ var ts; } function declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes) { switch (container.kind) { - case 230: + case 232: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 261: + case 264: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 197: - case 226: + case 198: + case 228: return declareClassMember(node, symbolFlags, symbolExcludes); - case 229: + case 231: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 161: - case 176: - case 227: - case 270: - case 287: + case 162: + case 177: + case 229: + case 274: + case 291: + case 253: return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 158: case 159: - case 153: + case 160: case 154: case 155: - case 149: - case 148: + case 156: case 150: + case 149: case 151: case 152: - case 225: - case 184: + case 153: + case 227: case 185: - case 274: - case 228: - case 170: + case 186: + case 278: + case 230: + case 171: return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); } } @@ -19666,11 +20313,11 @@ var ts; : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); } function hasExportDeclarations(node) { - var body = node.kind === 261 ? node : node.body; - if (body && (body.kind === 261 || body.kind === 231)) { + var body = node.kind === 264 ? node : node.body; + if (body && (body.kind === 264 || body.kind === 233)) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 241 || stat.kind === 240) { + if (stat.kind === 243 || stat.kind === 242) { return true; } } @@ -19692,7 +20339,7 @@ var ts; errorOnFirstToken(node, ts.Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible); } if (ts.isExternalModuleAugmentation(node)) { - declareSymbolAndAddToSymbolTable(node, 1024, 0); + declareModuleSymbol(node); } else { var pattern = void 0; @@ -19712,12 +20359,8 @@ var ts; } } else { - var state = getModuleInstanceState(node); - if (state === 0) { - declareSymbolAndAddToSymbolTable(node, 1024, 0); - } - else { - declareSymbolAndAddToSymbolTable(node, 512, 106639); + var state = declareModuleSymbol(node); + if (state !== 0) { if (node.symbol.flags & (16 | 32 | 256)) { node.symbol.constEnumOnlyModule = false; } @@ -19733,29 +20376,40 @@ var ts; } } } + function declareModuleSymbol(node) { + var state = getModuleInstanceState(node); + var instantiated = state !== 0; + declareSymbolAndAddToSymbolTable(node, instantiated ? 512 : 1024, instantiated ? 106639 : 0); + return state; + } function bindFunctionOrConstructorType(node) { var symbol = createSymbol(131072, getDeclarationName(node)); addDeclarationToSymbol(symbol, node, 131072); var typeLiteralSymbol = createSymbol(2048, "__type"); addDeclarationToSymbol(typeLiteralSymbol, node, 2048); typeLiteralSymbol.members = ts.createMap(); - typeLiteralSymbol.members[symbol.name] = symbol; + typeLiteralSymbol.members.set(symbol.name, symbol); } function bindObjectLiteralExpression(node) { + var ElementKind; + (function (ElementKind) { + ElementKind[ElementKind["Property"] = 1] = "Property"; + ElementKind[ElementKind["Accessor"] = 2] = "Accessor"; + })(ElementKind || (ElementKind = {})); if (inStrictMode) { var seen = ts.createMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 259 || prop.name.kind !== 70) { + if (prop.kind === 262 || prop.name.kind !== 70) { continue; } var identifier = prop.name; - var currentKind = prop.kind === 257 || prop.kind === 258 || prop.kind === 149 + var currentKind = prop.kind === 260 || prop.kind === 261 || prop.kind === 150 ? 1 : 2; - var existingKind = seen[identifier.text]; + var existingKind = seen.get(identifier.text); if (!existingKind) { - seen[identifier.text] = currentKind; + seen.set(identifier.text, currentKind); continue; } if (currentKind === 1 && existingKind === 1) { @@ -19766,16 +20420,22 @@ var ts; } return bindAnonymousDeclaration(node, 4096, "__object"); } + function bindJsxAttributes(node) { + return bindAnonymousDeclaration(node, 4096, "__jsxAttributes"); + } + function bindJsxAttribute(node, symbolFlags, symbolExcludes) { + return declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); + } function bindAnonymousDeclaration(node, symbolFlags, name) { var symbol = createSymbol(symbolFlags, name); addDeclarationToSymbol(symbol, node, symbolFlags); } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 230: + case 232: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 261: + case 264: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -19865,8 +20525,8 @@ var ts; } function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2) { - if (blockScopeContainer.kind !== 261 && - blockScopeContainer.kind !== 230 && + if (blockScopeContainer.kind !== 264 && + blockScopeContainer.kind !== 232 && !ts.isFunctionLike(blockScopeContainer)) { var errorSpan = ts.getErrorSpanForNode(file, node); file.bindDiagnostics.push(ts.createFileDiagnostic(file, errorSpan.start, errorSpan.length, getStrictModeBlockScopeFunctionDeclarationMessage(node))); @@ -19874,7 +20534,7 @@ var ts; } } function checkStrictModeNumericLiteral(node) { - if (inStrictMode && node.isOctalLiteral) { + if (inStrictMode && node.numericLiteralFlags & 4) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode)); } } @@ -19908,8 +20568,11 @@ var ts; } node.parent = parent; var saveInStrictMode = inStrictMode; + if (ts.isInJavaScriptFile(node)) { + bindJSDocTypedefTagIfAny(node); + } bindWorker(node); - if (node.kind > 140) { + if (node.kind > 141) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -19926,6 +20589,26 @@ var ts; } inStrictMode = saveInStrictMode; } + function bindJSDocTypedefTagIfAny(node) { + if (!node.jsDoc) { + return; + } + for (var _i = 0, _a = node.jsDoc; _i < _a.length; _i++) { + var jsDoc = _a[_i]; + if (!jsDoc.tags) { + continue; + } + for (var _b = 0, _c = jsDoc.tags; _b < _c.length; _b++) { + var tag = _c[_b]; + if (tag.kind === 289) { + var savedParent = parent; + parent = jsDoc; + bind(tag); + parent = savedParent; + } + } + } + } function updateStrictModeStatementList(statements) { if (!inStrictMode) { for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) { @@ -19949,90 +20632,88 @@ var ts; case 70: if (node.isInJSDocNamespace) { var parentNode = node.parent; - while (parentNode && parentNode.kind !== 285) { + while (parentNode && parentNode.kind !== 289) { parentNode = parentNode.parent; } bindBlockScopedDeclaration(parentNode, 524288, 793064); break; } case 98: - if (currentFlow && (ts.isExpression(node) || parent.kind === 258)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 261)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); - case 177: + case 178: if (currentFlow && isNarrowableReference(node)) { node.flowNode = currentFlow; } break; - case 192: - if (ts.isInJavaScriptFile(node)) { - var specialKind = ts.getSpecialPropertyAssignmentKind(node); - switch (specialKind) { - case 1: - bindExportsPropertyAssignment(node); - break; - case 2: - bindModuleExportsAssignment(node); - break; - case 3: - bindPrototypePropertyAssignment(node); - break; - case 4: - bindThisPropertyAssignment(node); - break; - case 0: - break; - default: - ts.Debug.fail("Unknown special property assignment kind"); - } + case 193: + var specialKind = ts.getSpecialPropertyAssignmentKind(node); + switch (specialKind) { + case 1: + bindExportsPropertyAssignment(node); + break; + case 2: + bindModuleExportsAssignment(node); + break; + case 3: + bindPrototypePropertyAssignment(node); + break; + case 4: + bindThisPropertyAssignment(node); + break; + case 5: + bindStaticPropertyAssignment(node); + break; + case 0: + break; + default: + ts.Debug.fail("Unknown special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 256: + case 259: return checkStrictModeCatchClause(node); - case 186: + case 187: return checkStrictModeDeleteExpression(node); case 8: return checkStrictModeNumericLiteral(node); - case 191: + case 192: return checkStrictModePostfixUnaryExpression(node); - case 190: + case 191: return checkStrictModePrefixUnaryExpression(node); - case 217: + case 219: return checkStrictModeWithStatement(node); - case 167: + case 168: seenThisKeyword = true; return; - case 156: + case 157: return checkTypePredicate(node); - case 143: - return declareSymbolAndAddToSymbolTable(node, 262144, 530920); case 144: + return declareSymbolAndAddToSymbolTable(node, 262144, 530920); + case 145: return bindParameter(node); - case 223: - case 174: - if (node.dotDotDotToken && node.parent.kind === 172) { - emitFlags |= 32768; - } + case 225: + case 175: return bindVariableDeclarationOrBindingElement(node); + case 148: case 147: - case 146: - case 271: - return bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 0); - case 286: + case 275: + return bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 67108864 : 0), 0); + case 290: return bindJSDocProperty(node); - case 257: - case 258: - return bindPropertyOrMethodOrAccessor(node, 4, 0); case 260: + case 261: + return bindPropertyOrMethodOrAccessor(node, 4, 0); + case 263: return bindPropertyOrMethodOrAccessor(node, 8, 900095); - case 259: - case 251: + case 262: + case 254: var root = container; var hasRest = false; while (root.parent) { - if (root.kind === 176 && - root.parent.kind === 192 && + if (root.kind === 177 && + root.parent.kind === 193 && root.parent.operatorToken.kind === 57 && root.parent.left === root) { hasRest = true; @@ -20040,80 +20721,83 @@ var ts; } root = root.parent; } - emitFlags |= hasRest ? 32768 : 16384; return; - case 153: case 154: case 155: + case 156: return declareSymbolAndAddToSymbolTable(node, 131072, 0); - case 149: - case 148: - return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 0 : 99263); - case 225: - return bindFunctionDeclaration(node); case 150: - return declareSymbolAndAddToSymbolTable(node, 16384, 0); + case 149: + return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 67108864 : 0), ts.isObjectLiteralMethod(node) ? 0 : 99263); + case 227: + return bindFunctionDeclaration(node); case 151: - return bindPropertyOrMethodOrAccessor(node, 32768, 41919); + return declareSymbolAndAddToSymbolTable(node, 16384, 0); case 152: + return bindPropertyOrMethodOrAccessor(node, 32768, 41919); + case 153: return bindPropertyOrMethodOrAccessor(node, 65536, 74687); - case 158: case 159: - case 274: + case 160: + case 278: return bindFunctionOrConstructorType(node); - case 161: - case 170: - case 287: - case 270: + case 162: + case 171: + case 291: + case 274: return bindAnonymousDeclaration(node, 2048, "__type"); - case 176: + case 177: return bindObjectLiteralExpression(node); - case 184: case 185: + case 186: return bindFunctionExpression(node); - case 179: + case 180: if (ts.isInJavaScriptFile(node)) { bindCallExpression(node); } break; - case 197: - case 226: + case 198: + case 228: inStrictMode = true; return bindClassLikeDeclaration(node); - case 227: + case 229: return bindBlockScopedDeclaration(node, 64, 792968); - case 285: + case 289: if (!node.fullName || node.fullName.kind === 70) { return bindBlockScopedDeclaration(node, 524288, 793064); } break; - case 228: - return bindBlockScopedDeclaration(node, 524288, 793064); - case 229: - return bindEnumDeclaration(node); case 230: + return bindBlockScopedDeclaration(node, 524288, 793064); + case 231: + return bindEnumDeclaration(node); + case 232: return bindModuleDeclaration(node); - case 234: - case 237: - case 239: - case 243: - return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608); - case 233: - return bindNamespaceExportDeclaration(node); + case 253: + return bindJsxAttributes(node); + case 252: + return bindJsxAttribute(node, 4, 0); case 236: - return bindImportClause(node); + case 239: case 241: + case 245: + return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608); + case 235: + return bindNamespaceExportDeclaration(node); + case 238: + return bindImportClause(node); + case 243: return bindExportDeclaration(node); - case 240: + case 242: return bindExportAssignment(node); - case 261: + case 264: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 204: + case 206: if (!ts.isFunctionLike(node.parent)) { return; } - case 231: + case 233: return updateStrictModeStatementList(node.statements); } } @@ -20122,7 +20806,7 @@ var ts; if (parameterName && parameterName.kind === 70) { checkStrictModeIdentifier(parameterName); } - if (parameterName && parameterName.kind === 167) { + if (parameterName && parameterName.kind === 168) { seenThisKeyword = true; } bind(type); @@ -20141,7 +20825,7 @@ var ts; bindAnonymousDeclaration(node, 8388608, getDeclarationName(node)); } else { - var flags = node.kind === 240 && ts.exportAssignmentIsAlias(node) + var flags = node.kind === 242 && ts.exportAssignmentIsAlias(node) ? 8388608 : 4; declareSymbol(container.symbol.exports, container.symbol, node, flags, 4 | 8388608 | 32 | 16); @@ -20151,17 +20835,17 @@ var ts; if (node.modifiers && node.modifiers.length) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Modifiers_cannot_appear_here)); } - if (node.parent.kind !== 261) { + if (node.parent.kind !== 264) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_at_top_level)); return; } else { - var parent_4 = node.parent; - if (!ts.isExternalModule(parent_4)) { + var parent_1 = node.parent; + if (!ts.isExternalModule(parent_1)) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_in_module_files)); return; } - if (!parent_4.isDeclarationFile) { + if (!parent_1.isDeclarationFile) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_in_declaration_files)); return; } @@ -20171,10 +20855,10 @@ var ts; } function bindExportDeclaration(node) { if (!container.symbol || !container.symbol.exports) { - bindAnonymousDeclaration(node, 1073741824, getDeclarationName(node)); + bindAnonymousDeclaration(node, 33554432, getDeclarationName(node)); } else if (!node.exportClause) { - declareSymbol(container.symbol.exports, container.symbol, node, 1073741824, 0); + declareSymbol(container.symbol.exports, container.symbol, node, 33554432, 0); } } function bindImportClause(node) { @@ -20194,24 +20878,56 @@ var ts; setCommonJsModuleIndicator(node); declareSymbol(file.symbol.exports, file.symbol, node.left, 4 | 7340032, 0); } + function isExportsOrModuleExportsOrAlias(node) { + return ts.isExportsIdentifier(node) || + ts.isModuleExportsPropertyAccessExpression(node) || + isNameOfExportsOrModuleExportsAliasDeclaration(node); + } + function isNameOfExportsOrModuleExportsAliasDeclaration(node) { + if (node.kind === 70) { + var symbol = lookupSymbolForName(node.text); + if (symbol && symbol.valueDeclaration && symbol.valueDeclaration.kind === 225) { + var declaration = symbol.valueDeclaration; + if (declaration.initializer) { + return isExportsOrModuleExportsOrAliasOrAssignemnt(declaration.initializer); + } + } + } + return false; + } + function isExportsOrModuleExportsOrAliasOrAssignemnt(node) { + return isExportsOrModuleExportsOrAlias(node) || + (ts.isAssignmentExpression(node, true) && (isExportsOrModuleExportsOrAliasOrAssignemnt(node.left) || isExportsOrModuleExportsOrAliasOrAssignemnt(node.right))); + } function bindModuleExportsAssignment(node) { + var assignedExpression = ts.getRightMostAssignedExpression(node.right); + if (ts.isEmptyObjectLiteral(assignedExpression) || isExportsOrModuleExportsOrAlias(assignedExpression)) { + setCommonJsModuleIndicator(node); + return; + } setCommonJsModuleIndicator(node); declareSymbol(file.symbol.exports, file.symbol, node, 4 | 7340032 | 512, 0); } function bindThisPropertyAssignment(node) { ts.Debug.assert(ts.isInJavaScriptFile(node)); - if (container.kind === 225 || container.kind === 184) { - container.symbol.members = container.symbol.members || ts.createMap(); - declareSymbol(container.symbol.members, container.symbol, node, 4, 0 & ~4); - } - else if (container.kind === 150) { - var saveContainer = container; - container = container.parent; - var symbol = bindPropertyOrMethodOrAccessor(node, 4, 0); - if (symbol) { - symbol.isReplaceableByMethod = true; - } - container = saveContainer; + var container = ts.getThisContainer(node, false); + switch (container.kind) { + case 227: + case 185: + container.symbol.members = container.symbol.members || ts.createMap(); + declareSymbol(container.symbol.members, container.symbol, node, 4, 0 & ~4); + break; + case 151: + case 148: + case 150: + case 152: + case 153: + var containingClass = container.parent; + var symbol = declareSymbol(ts.hasModifier(container, 32) ? containingClass.symbol.exports : containingClass.symbol.members, containingClass.symbol, node, 4, 0); + if (symbol) { + symbol.isReplaceableByMethod = true; + } + break; } } function bindPrototypePropertyAssignment(node) { @@ -20221,14 +20937,35 @@ var ts; leftSideOfAssignment.parent = node; constructorFunction.parent = classPrototype; classPrototype.parent = leftSideOfAssignment; - var funcSymbol = container.locals[constructorFunction.text]; - if (!funcSymbol || !(funcSymbol.flags & 16 || ts.isDeclarationOfFunctionExpression(funcSymbol))) { + bindPropertyAssignment(constructorFunction.text, leftSideOfAssignment, true); + } + function bindStaticPropertyAssignment(node) { + var leftSideOfAssignment = node.left; + var target = leftSideOfAssignment.expression; + leftSideOfAssignment.parent = node; + target.parent = leftSideOfAssignment; + if (isNameOfExportsOrModuleExportsAliasDeclaration(target)) { + bindExportsPropertyAssignment(node); + } + else { + bindPropertyAssignment(target.text, leftSideOfAssignment, false); + } + } + function lookupSymbolForName(name) { + return (container.symbol && container.symbol.exports && container.symbol.exports.get(name)) || (container.locals && container.locals.get(name)); + } + function bindPropertyAssignment(functionName, propertyAccessExpression, isPrototypeProperty) { + var targetSymbol = lookupSymbolForName(functionName); + if (targetSymbol && ts.isDeclarationOfFunctionOrClassExpression(targetSymbol)) { + targetSymbol = targetSymbol.valueDeclaration.initializer.symbol; + } + if (!targetSymbol || !(targetSymbol.flags & (16 | 32))) { return; } - if (!funcSymbol.members) { - funcSymbol.members = ts.createMap(); - } - declareSymbol(funcSymbol.members, funcSymbol, leftSideOfAssignment, 4, 0); + var symbolTable = isPrototypeProperty ? + (targetSymbol.members || (targetSymbol.members = ts.createMap())) : + (targetSymbol.exports || (targetSymbol.exports = ts.createMap())); + declareSymbol(symbolTable, targetSymbol, propertyAccessExpression, 4, 0); } function bindCallExpression(node) { if (!file.commonJsModuleIndicator && ts.isRequireCall(node, false)) { @@ -20236,33 +20973,26 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { - if (ts.getClassExtendsHeritageClauseElement(node) !== undefined) { - emitFlags |= 1024; - } - if (ts.nodeIsDecorated(node)) { - emitFlags |= 2048; - } - } - if (node.kind === 226) { + if (node.kind === 228) { bindBlockScopedDeclaration(node, 32, 899519); } else { var bindingName = node.name ? node.name.text : "__class"; bindAnonymousDeclaration(node, 32, bindingName); if (node.name) { - classifiableNames[node.name.text] = node.name.text; + classifiableNames.set(node.name.text, node.name.text); } } var symbol = node.symbol; - var prototypeSymbol = createSymbol(4 | 134217728, "prototype"); - if (symbol.exports[prototypeSymbol.name]) { + var prototypeSymbol = createSymbol(4 | 16777216, "prototype"); + var symbolExport = symbol.exports.get(prototypeSymbol.name); + if (symbolExport) { if (node.name) { node.name.parent = node; } - file.bindDiagnostics.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); + file.bindDiagnostics.push(ts.createDiagnosticForNode(symbolExport.declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); } - symbol.exports[prototypeSymbol.name] = prototypeSymbol; + symbol.exports.set(prototypeSymbol.name, prototypeSymbol); prototypeSymbol.parent = symbol; } function bindEnumDeclaration(node) { @@ -20287,11 +21017,6 @@ var ts; } } function bindParameter(node) { - if (!ts.isDeclarationFile(file) && - !ts.isInAmbientContext(node) && - ts.nodeIsDecorated(node)) { - emitFlags |= (2048 | 4096); - } if (inStrictMode) { checkStrictModeEvalOrArguments(node, node.name); } @@ -20303,13 +21028,13 @@ var ts; } if (ts.isParameterPropertyDeclaration(node)) { var classDeclaration = node.parent.parent; - declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 | (node.questionToken ? 536870912 : 0), 0); + declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 | (node.questionToken ? 67108864 : 0), 0); } } function bindFunctionDeclaration(node) { if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { - if (ts.isAsyncFunctionLike(node)) { - emitFlags |= 8192; + if (ts.isAsyncFunction(node)) { + emitFlags |= 1024; } } checkStrictModeFunctionName(node); @@ -20323,8 +21048,8 @@ var ts; } function bindFunctionExpression(node) { if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { - if (ts.isAsyncFunctionLike(node)) { - emitFlags |= 8192; + if (ts.isAsyncFunction(node)) { + emitFlags |= 1024; } } if (currentFlow) { @@ -20336,11 +21061,8 @@ var ts; } function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) { if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { - if (ts.isAsyncFunctionLike(node)) { - emitFlags |= 8192; - } - if (ts.nodeIsDecorated(node)) { - emitFlags |= 2048; + if (ts.isAsyncFunction(node)) { + emitFlags |= 1024; } } if (currentFlow && ts.isObjectLiteralOrClassExpressionMethod(node)) { @@ -20362,15 +21084,15 @@ var ts; return false; } if (currentFlow === unreachableFlow) { - var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 206) || - node.kind === 226 || - (node.kind === 230 && shouldReportErrorOnModuleDeclaration(node)) || - (node.kind === 229 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 208) || + node.kind === 228 || + (node.kind === 232 && shouldReportErrorOnModuleDeclaration(node)) || + (node.kind === 231 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); if (reportError) { currentFlow = reportedUnreachableFlow; var reportUnreachableCode = !options.allowUnreachableCode && !ts.isInAmbientContext(node) && - (node.kind !== 205 || + (node.kind !== 207 || ts.getCombinedNodeFlags(node.declarationList) & 3 || ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); if (reportUnreachableCode) { @@ -20384,56 +21106,56 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 179: - return computeCallExpression(node, subtreeFlags); case 180: + return computeCallExpression(node, subtreeFlags); + case 181: return computeNewExpression(node, subtreeFlags); - case 230: + case 232: return computeModuleDeclaration(node, subtreeFlags); - case 183: - return computeParenthesizedExpression(node, subtreeFlags); - case 192: - return computeBinaryExpression(node, subtreeFlags); - case 207: - return computeExpressionStatement(node, subtreeFlags); - case 144: - return computeParameter(node, subtreeFlags); - case 185: - return computeArrowFunction(node, subtreeFlags); case 184: + return computeParenthesizedExpression(node, subtreeFlags); + case 193: + return computeBinaryExpression(node, subtreeFlags); + case 209: + return computeExpressionStatement(node, subtreeFlags); + case 145: + return computeParameter(node, subtreeFlags); + case 186: + return computeArrowFunction(node, subtreeFlags); + case 185: return computeFunctionExpression(node, subtreeFlags); - case 225: + case 227: return computeFunctionDeclaration(node, subtreeFlags); - case 223: + case 225: return computeVariableDeclaration(node, subtreeFlags); - case 224: - return computeVariableDeclarationList(node, subtreeFlags); - case 205: - return computeVariableStatement(node, subtreeFlags); - case 219: - return computeLabeledStatement(node, subtreeFlags); case 226: + return computeVariableDeclarationList(node, subtreeFlags); + case 207: + return computeVariableStatement(node, subtreeFlags); + case 221: + return computeLabeledStatement(node, subtreeFlags); + case 228: return computeClassDeclaration(node, subtreeFlags); - case 197: + case 198: return computeClassExpression(node, subtreeFlags); - case 255: + case 258: return computeHeritageClause(node, subtreeFlags); - case 256: + case 259: return computeCatchClause(node, subtreeFlags); - case 199: + case 200: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 150: - return computeConstructor(node, subtreeFlags); - case 147: - return computePropertyDeclaration(node, subtreeFlags); - case 149: - return computeMethod(node, subtreeFlags); case 151: + return computeConstructor(node, subtreeFlags); + case 148: + return computePropertyDeclaration(node, subtreeFlags); + case 150: + return computeMethod(node, subtreeFlags); case 152: + case 153: return computeAccessor(node, subtreeFlags); - case 234: + case 236: return computeImportEquals(node, subtreeFlags); - case 177: + case 178: return computePropertyAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); @@ -20458,8 +21180,8 @@ var ts; switch (kind) { case 96: return true; - case 177: case 178: + case 179: var expression = node.expression; var expressionKind = expression.kind; return expressionKind === 96; @@ -20481,10 +21203,10 @@ var ts; var transformFlags = subtreeFlags; var operatorTokenKind = node.operatorToken.kind; var leftKind = node.left.kind; - if (operatorTokenKind === 57 && leftKind === 176) { + if (operatorTokenKind === 57 && leftKind === 177) { transformFlags |= 8 | 192 | 3072; } - else if (operatorTokenKind === 57 && leftKind === 175) { + else if (operatorTokenKind === 57 && leftKind === 176) { transformFlags |= 192 | 3072; } else if (operatorTokenKind === 39 @@ -20523,8 +21245,8 @@ var ts; var expression = node.expression; var expressionKind = expression.kind; var expressionTransformFlags = expression.transformFlags; - if (expressionKind === 200 - || expressionKind === 182) { + if (expressionKind === 201 + || expressionKind === 183) { transformFlags |= 3; } if (expressionTransformFlags & 1024) { @@ -20621,9 +21343,9 @@ var ts; transformFlags |= 8; } if (ts.hasModifier(node, 256)) { - transformFlags |= 16; + transformFlags |= node.asteriskToken ? 8 : 16; } - if (node.asteriskToken && ts.getEmitFlags(node) & 131072) { + if (node.asteriskToken) { transformFlags |= 768; } node.transformFlags = transformFlags | 536870912; @@ -20666,7 +21388,7 @@ var ts; transformFlags |= 3; } if (modifierFlags & 256) { - transformFlags |= 16; + transformFlags |= node.asteriskToken ? 8 : 16; } if (subtreeFlags & 1048576) { transformFlags |= 8; @@ -20674,7 +21396,7 @@ var ts; if (subtreeFlags & 163840) { transformFlags |= 192; } - if (node.asteriskToken && ts.getEmitFlags(node) & 131072) { + if (node.asteriskToken) { transformFlags |= 768; } } @@ -20689,7 +21411,7 @@ var ts; transformFlags |= 3; } if (ts.hasModifier(node, 256)) { - transformFlags |= 16; + transformFlags |= node.asteriskToken ? 8 : 16; } if (subtreeFlags & 1048576) { transformFlags |= 8; @@ -20697,7 +21419,7 @@ var ts; if (subtreeFlags & 163840) { transformFlags |= 192; } - if (node.asteriskToken && ts.getEmitFlags(node) & 131072) { + if (node.asteriskToken) { transformFlags |= 768; } node.transformFlags = transformFlags | 536870912; @@ -20810,8 +21532,8 @@ var ts; var excludeFlags = 536872257; switch (kind) { case 119: - case 189: - transformFlags |= 16; + case 190: + transformFlags |= 8 | 16; break; case 113: case 111: @@ -20819,50 +21541,66 @@ var ts; case 116: case 123: case 75: - case 229: - case 260: - case 182: - case 200: + case 231: + case 263: + case 183: case 201: + case 202: case 130: transformFlags |= 3; break; - case 246: - case 247: case 248: - case 10: case 249: case 250: + case 10: case 251: case 252: + case 253: + case 254: + case 255: transformFlags |= 4; break; - case 213: - transformFlags |= 8; case 12: case 13: case 14: case 15: - case 194: - case 181: - case 258: + case 195: + case 182: + case 261: case 114: + case 203: transformFlags |= 192; break; - case 195: - transformFlags |= 192 | 16777216; + case 9: + if (node.hasExtendedUnicodeEscape) { + transformFlags |= 192; + } + break; + case 8: + if (node.numericLiteralFlags & 48) { + transformFlags |= 192; + } + break; + case 215: + if (node.awaitModifier) { + transformFlags |= 8; + } + transformFlags |= 192; + break; + case 196: + transformFlags |= 8 | 192 | 16777216; break; case 118: case 132: case 129: - case 134: - case 121: + case 133: case 135: + case 121: + case 136: case 104: - case 143: - case 146: - case 148: - case 153: + case 144: + case 147: + case 149: case 154: case 155: case 156: @@ -20876,26 +21614,27 @@ var ts; case 164: case 165: case 166: - case 227: - case 228: case 167: + case 229: + case 230: case 168: case 169: case 170: case 171: + case 172: transformFlags = 3; excludeFlags = -3; break; - case 142: + case 143: transformFlags |= 2097152; if (subtreeFlags & 16384) { transformFlags |= 65536; } break; - case 196: + case 197: transformFlags |= 192 | 524288; break; - case 259: + case 262: transformFlags |= 8 | 1048576; break; case 96: @@ -20904,27 +21643,27 @@ var ts; case 98: transformFlags |= 16384; break; - case 172: + case 173: transformFlags |= 192 | 8388608; if (subtreeFlags & 524288) { transformFlags |= 8 | 1048576; } excludeFlags = 537396545; break; - case 173: + case 174: transformFlags |= 192 | 8388608; excludeFlags = 537396545; break; - case 174: + case 175: transformFlags |= 192; if (node.dotDotDotToken) { transformFlags |= 524288; } break; - case 145: + case 146: transformFlags |= 3 | 4096; break; - case 176: + case 177: excludeFlags = 540087617; if (subtreeFlags & 2097152) { transformFlags |= 192; @@ -20936,29 +21675,29 @@ var ts; transformFlags |= 8; } break; - case 175: - case 180: + case 176: + case 181: excludeFlags = 537396545; if (subtreeFlags & 524288) { transformFlags |= 192; } break; - case 209: - case 210: case 211: case 212: + case 213: + case 214: if (subtreeFlags & 4194304) { transformFlags |= 192; } break; - case 261: + case 264: if (subtreeFlags & 32768) { transformFlags |= 192; } break; + case 218: case 216: - case 214: - case 215: + case 217: transformFlags |= 33554432; break; } @@ -20966,56 +21705,57 @@ var ts; return transformFlags & ~excludeFlags; } function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 156 && kind <= 171) { + if (kind >= 157 && kind <= 172) { return -3; } switch (kind) { - case 179: case 180: - case 175: + case 181: + case 176: return 537396545; - case 230: + case 232: return 574674241; - case 144: + case 145: return 536872257; - case 185: + case 186: return 601249089; - case 184: - case 225: + case 185: + case 227: return 601281857; - case 224: - return 546309441; case 226: - case 197: + return 546309441; + case 228: + case 198: return 539358529; - case 150: - return 601015617; - case 149: case 151: + return 601015617; + case 150: case 152: + case 153: return 601015617; case 118: case 132: case 129: - case 134: - case 121: case 135: + case 133: + case 121: + case 136: case 104: - case 143: - case 146: - case 148: - case 153: + case 144: + case 147: + case 149: case 154: case 155: - case 227: - case 228: + case 156: + case 229: + case 230: return -3; - case 176: + case 177: return 540087617; - case 256: + case 259: return 537920833; - case 172: case 173: + case 174: return 537396545; default: return 536872257; @@ -21048,23 +21788,29 @@ var ts; ts.getSymbolId = getSymbolId; function createTypeChecker(host, produceDiagnostics) { var cancellationToken; + var requestedExternalEmitHelpers; + var externalHelpersModule; var Symbol = ts.objectAllocator.getSymbolConstructor(); var Type = ts.objectAllocator.getTypeConstructor(); var Signature = ts.objectAllocator.getSignatureConstructor(); var typeCount = 0; var symbolCount = 0; + var symbolInstantiationDepth = 0; var emptyArray = []; var emptySymbols = ts.createMap(); var compilerOptions = host.getCompilerOptions(); - var languageVersion = compilerOptions.target || 0; + var languageVersion = ts.getEmitScriptTarget(compilerOptions); var modulekind = ts.getEmitModuleKind(compilerOptions); var noUnusedIdentifiers = !!compilerOptions.noUnusedLocals || !!compilerOptions.noUnusedParameters; var allowSyntheticDefaultImports = typeof compilerOptions.allowSyntheticDefaultImports !== "undefined" ? compilerOptions.allowSyntheticDefaultImports : modulekind === ts.ModuleKind.System; - var strictNullChecks = compilerOptions.strictNullChecks; + var strictNullChecks = compilerOptions.strictNullChecks === undefined ? compilerOptions.strict : compilerOptions.strictNullChecks; + var noImplicitAny = compilerOptions.noImplicitAny === undefined ? compilerOptions.strict : compilerOptions.noImplicitAny; + var noImplicitThis = compilerOptions.noImplicitThis === undefined ? compilerOptions.strict : compilerOptions.noImplicitThis; var emitResolver = createResolver(); - var undefinedSymbol = createSymbol(4 | 67108864, "undefined"); + var nodeBuilder = createNodeBuilder(); + var undefinedSymbol = createSymbol(4, "undefined"); undefinedSymbol.declarations = []; - var argumentsSymbol = createSymbol(4 | 67108864, "arguments"); + var argumentsSymbol = createSymbol(4, "arguments"); var checker = { getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), "identifierCount"); }, @@ -21073,47 +21819,127 @@ var ts; isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, isUnknownSymbol: function (symbol) { return symbol === unknownSymbol; }, + getMergedSymbol: getMergedSymbol, getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, - getTypeOfSymbolAtLocation: getTypeOfSymbolAtLocation, - getSymbolsOfParameterPropertyDeclaration: getSymbolsOfParameterPropertyDeclaration, + getTypeOfSymbolAtLocation: function (symbol, location) { + location = ts.getParseTreeNode(location); + return location ? getTypeOfSymbolAtLocation(symbol, location) : unknownType; + }, + getSymbolsOfParameterPropertyDeclaration: function (parameter, parameterName) { + parameter = ts.getParseTreeNode(parameter, ts.isParameter); + ts.Debug.assert(parameter !== undefined, "Cannot get symbols of a synthetic parameter that cannot be resolved to a parse-tree node."); + return getSymbolsOfParameterPropertyDeclaration(parameter, parameterName); + }, getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, getPropertiesOfType: getPropertiesOfType, getPropertyOfType: getPropertyOfType, + getIndexInfoOfType: getIndexInfoOfType, getSignaturesOfType: getSignaturesOfType, getIndexTypeOfType: getIndexTypeOfType, getBaseTypes: getBaseTypes, + getBaseTypeOfLiteralType: getBaseTypeOfLiteralType, + getWidenedType: getWidenedType, + getTypeFromTypeNode: function (node) { + node = ts.getParseTreeNode(node, ts.isTypeNode); + return node ? getTypeFromTypeNode(node) : unknownType; + }, + getParameterType: getTypeAtPosition, getReturnTypeOfSignature: getReturnTypeOfSignature, getNonNullableType: getNonNullableType, - getSymbolsInScope: getSymbolsInScope, - getSymbolAtLocation: getSymbolAtLocation, - getShorthandAssignmentValueSymbol: getShorthandAssignmentValueSymbol, - getExportSpecifierLocalTargetSymbol: getExportSpecifierLocalTargetSymbol, - getTypeAtLocation: getTypeOfNode, - getPropertySymbolOfDestructuringAssignment: getPropertySymbolOfDestructuringAssignment, - typeToString: typeToString, + typeToTypeNode: nodeBuilder.typeToTypeNode, + indexInfoToIndexSignatureDeclaration: nodeBuilder.indexInfoToIndexSignatureDeclaration, + signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration, + getSymbolsInScope: function (location, meaning) { + location = ts.getParseTreeNode(location); + return location ? getSymbolsInScope(location, meaning) : []; + }, + getSymbolAtLocation: function (node) { + node = ts.getParseTreeNode(node); + return node ? getSymbolAtLocation(node) : undefined; + }, + getShorthandAssignmentValueSymbol: function (node) { + node = ts.getParseTreeNode(node); + return node ? getShorthandAssignmentValueSymbol(node) : undefined; + }, + getExportSpecifierLocalTargetSymbol: function (node) { + node = ts.getParseTreeNode(node, ts.isExportSpecifier); + return node ? getExportSpecifierLocalTargetSymbol(node) : undefined; + }, + getTypeAtLocation: function (node) { + node = ts.getParseTreeNode(node); + return node ? getTypeOfNode(node) : unknownType; + }, + getPropertySymbolOfDestructuringAssignment: function (location) { + location = ts.getParseTreeNode(location, ts.isIdentifier); + return location ? getPropertySymbolOfDestructuringAssignment(location) : undefined; + }, + signatureToString: function (signature, enclosingDeclaration, flags, kind) { + return signatureToString(signature, ts.getParseTreeNode(enclosingDeclaration), flags, kind); + }, + typeToString: function (type, enclosingDeclaration, flags) { + return typeToString(type, ts.getParseTreeNode(enclosingDeclaration), flags); + }, getSymbolDisplayBuilder: getSymbolDisplayBuilder, - symbolToString: symbolToString, + symbolToString: function (symbol, enclosingDeclaration, meaning) { + return symbolToString(symbol, ts.getParseTreeNode(enclosingDeclaration), meaning); + }, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, - getContextualType: getContextualType, + getContextualType: function (node) { + node = ts.getParseTreeNode(node, ts.isExpression); + return node ? getContextualType(node) : undefined; + }, getFullyQualifiedName: getFullyQualifiedName, - getResolvedSignature: getResolvedSignature, - getConstantValue: getConstantValue, - isValidPropertyAccess: isValidPropertyAccess, - getSignatureFromDeclaration: getSignatureFromDeclaration, - isImplementationOfOverload: isImplementationOfOverload, + getResolvedSignature: function (node, candidatesOutArray) { + node = ts.getParseTreeNode(node, ts.isCallLikeExpression); + return node ? getResolvedSignature(node, candidatesOutArray) : undefined; + }, + getConstantValue: function (node) { + node = ts.getParseTreeNode(node, canHaveConstantValue); + return node ? getConstantValue(node) : undefined; + }, + isValidPropertyAccess: function (node, propertyName) { + node = ts.getParseTreeNode(node, ts.isPropertyAccessOrQualifiedName); + return node ? isValidPropertyAccess(node, propertyName) : false; + }, + getSignatureFromDeclaration: function (declaration) { + declaration = ts.getParseTreeNode(declaration, ts.isFunctionLike); + return declaration ? getSignatureFromDeclaration(declaration) : undefined; + }, + isImplementationOfOverload: function (node) { + node = ts.getParseTreeNode(node, ts.isFunctionLike); + return node ? isImplementationOfOverload(node) : undefined; + }, + getImmediateAliasedSymbol: function (symbol) { + ts.Debug.assert((symbol.flags & 8388608) !== 0, "Should only get Alias here."); + var links = getSymbolLinks(symbol); + if (!links.immediateTarget) { + var node = getDeclarationOfAliasSymbol(symbol); + ts.Debug.assert(!!node); + links.immediateTarget = getTargetOfAliasDeclaration(node, true); + } + return links.immediateTarget; + }, getAliasedSymbol: resolveAlias, getEmitResolver: getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, + getExportsAndPropertiesOfModule: getExportsAndPropertiesOfModule, getAmbientModules: getAmbientModules, - getJsxElementAttributesType: getJsxElementAttributesType, + getAllAttributesTypeFromJsxOpeningLikeElement: function (node) { + node = ts.getParseTreeNode(node, ts.isJsxOpeningLikeElement); + return node ? getAllAttributesTypeFromJsxOpeningLikeElement(node) : undefined; + }, getJsxIntrinsicTagNames: getJsxIntrinsicTagNames, - isOptionalParameter: isOptionalParameter, + isOptionalParameter: function (node) { + node = ts.getParseTreeNode(node, ts.isParameter); + return node ? isOptionalParameter(node) : false; + }, tryGetMemberInModuleExports: tryGetMemberInModuleExports, tryFindAmbientModuleWithoutAugmentations: function (moduleName) { return tryFindAmbientModule(moduleName, false); - } + }, + getApparentType: getApparentType }; var tupleTypes = []; var unionTypes = ts.createMap(); @@ -21122,8 +21948,8 @@ var ts; var numericLiteralTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); var evolvingArrayTypes = []; - var unknownSymbol = createSymbol(4 | 67108864, "unknown"); - var resolvingSymbol = createSymbol(67108864, "__resolving__"); + var unknownSymbol = createSymbol(4, "unknown"); + var resolvingSymbol = createSymbol(0, "__resolving__"); var anyType = createIntrinsicType(1, "any"); var autoType = createIntrinsicType(1, "any"); var unknownType = createIntrinsicType(1, "unknown"); @@ -21140,8 +21966,9 @@ var ts; var voidType = createIntrinsicType(1024, "void"); var neverType = createIntrinsicType(8192, "never"); var silentNeverType = createIntrinsicType(8192, "never"); + var nonPrimitiveType = createIntrinsicType(16777216, "object"); var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); - var emptyTypeLiteralSymbol = createSymbol(2048 | 67108864, "__type"); + var emptyTypeLiteralSymbol = createSymbol(2048, "__type"); emptyTypeLiteralSymbol.members = ts.createMap(); var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, undefined, undefined); var emptyGenericType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); @@ -21149,16 +21976,15 @@ var ts; var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); anyFunctionType.flags |= 8388608; var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var circularConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anySignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, undefined, 0, false, false); var unknownSignature = createSignature(undefined, undefined, undefined, emptyArray, unknownType, undefined, 0, false, false); var resolvingSignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, undefined, 0, false, false); var silentNeverSignature = createSignature(undefined, undefined, undefined, emptyArray, silentNeverType, undefined, 0, false, false); var enumNumberIndexInfo = createIndexInfo(stringType, true); + var jsObjectLiteralIndexInfo = createIndexInfo(anyType, false); var globals = ts.createMap(); var patternAmbientModules; - var getGlobalESSymbolConstructorSymbol; - var getGlobalPromiseConstructorSymbol; - var tryGetGlobalPromiseConstructorSymbol; var globalObjectType; var globalFunctionType; var globalArrayType; @@ -21167,26 +21993,26 @@ var ts; var globalNumberType; var globalBooleanType; var globalRegExpType; + var globalThisType; var anyArrayType; var autoArrayType; var anyReadonlyArrayType; - var getGlobalTemplateStringsArrayType; - var getGlobalESSymbolType; - var getGlobalIterableType; - var getGlobalIteratorType; - var getGlobalIterableIteratorType; - var getGlobalClassDecoratorType; - var getGlobalParameterDecoratorType; - var getGlobalPropertyDecoratorType; - var getGlobalMethodDecoratorType; - var getGlobalTypedPropertyDescriptorType; - var getGlobalPromiseType; - var tryGetGlobalPromiseType; - var getGlobalPromiseLikeType; - var getInstantiatedGlobalPromiseLikeType; - var getGlobalPromiseConstructorLikeType; - var getGlobalThenableType; - var jsxElementClassType; + var deferredGlobalESSymbolConstructorSymbol; + var deferredGlobalESSymbolType; + var deferredGlobalTypedPropertyDescriptorType; + var deferredGlobalPromiseType; + var deferredGlobalPromiseConstructorSymbol; + var deferredGlobalPromiseConstructorLikeType; + var deferredGlobalIterableType; + var deferredGlobalIteratorType; + var deferredGlobalIterableIteratorType; + var deferredGlobalAsyncIterableType; + var deferredGlobalAsyncIteratorType; + var deferredGlobalAsyncIterableIteratorType; + var deferredGlobalTemplateStringsArrayType; + var deferredJsxElementClassType; + var deferredJsxElementType; + var deferredJsxStatelessElementType; var deferredNodes; var deferredUnusedIdentifierNodes; var flowLoopStart = 0; @@ -21207,9 +22033,70 @@ var ts; var visitedFlowNodes = []; var visitedFlowTypes = []; var potentialThisCollisions = []; + var potentialNewTargetCollisions = []; var awaitedTypeStack = []; var diagnostics = ts.createDiagnosticCollection(); - var typeofEQFacts = ts.createMap({ + var TypeFacts; + (function (TypeFacts) { + TypeFacts[TypeFacts["None"] = 0] = "None"; + TypeFacts[TypeFacts["TypeofEQString"] = 1] = "TypeofEQString"; + TypeFacts[TypeFacts["TypeofEQNumber"] = 2] = "TypeofEQNumber"; + TypeFacts[TypeFacts["TypeofEQBoolean"] = 4] = "TypeofEQBoolean"; + TypeFacts[TypeFacts["TypeofEQSymbol"] = 8] = "TypeofEQSymbol"; + TypeFacts[TypeFacts["TypeofEQObject"] = 16] = "TypeofEQObject"; + TypeFacts[TypeFacts["TypeofEQFunction"] = 32] = "TypeofEQFunction"; + TypeFacts[TypeFacts["TypeofEQHostObject"] = 64] = "TypeofEQHostObject"; + TypeFacts[TypeFacts["TypeofNEString"] = 128] = "TypeofNEString"; + TypeFacts[TypeFacts["TypeofNENumber"] = 256] = "TypeofNENumber"; + TypeFacts[TypeFacts["TypeofNEBoolean"] = 512] = "TypeofNEBoolean"; + TypeFacts[TypeFacts["TypeofNESymbol"] = 1024] = "TypeofNESymbol"; + TypeFacts[TypeFacts["TypeofNEObject"] = 2048] = "TypeofNEObject"; + TypeFacts[TypeFacts["TypeofNEFunction"] = 4096] = "TypeofNEFunction"; + TypeFacts[TypeFacts["TypeofNEHostObject"] = 8192] = "TypeofNEHostObject"; + TypeFacts[TypeFacts["EQUndefined"] = 16384] = "EQUndefined"; + TypeFacts[TypeFacts["EQNull"] = 32768] = "EQNull"; + TypeFacts[TypeFacts["EQUndefinedOrNull"] = 65536] = "EQUndefinedOrNull"; + TypeFacts[TypeFacts["NEUndefined"] = 131072] = "NEUndefined"; + TypeFacts[TypeFacts["NENull"] = 262144] = "NENull"; + TypeFacts[TypeFacts["NEUndefinedOrNull"] = 524288] = "NEUndefinedOrNull"; + TypeFacts[TypeFacts["Truthy"] = 1048576] = "Truthy"; + TypeFacts[TypeFacts["Falsy"] = 2097152] = "Falsy"; + TypeFacts[TypeFacts["Discriminatable"] = 4194304] = "Discriminatable"; + TypeFacts[TypeFacts["All"] = 8388607] = "All"; + TypeFacts[TypeFacts["BaseStringStrictFacts"] = 933633] = "BaseStringStrictFacts"; + TypeFacts[TypeFacts["BaseStringFacts"] = 3145473] = "BaseStringFacts"; + TypeFacts[TypeFacts["StringStrictFacts"] = 4079361] = "StringStrictFacts"; + TypeFacts[TypeFacts["StringFacts"] = 4194049] = "StringFacts"; + TypeFacts[TypeFacts["EmptyStringStrictFacts"] = 3030785] = "EmptyStringStrictFacts"; + TypeFacts[TypeFacts["EmptyStringFacts"] = 3145473] = "EmptyStringFacts"; + TypeFacts[TypeFacts["NonEmptyStringStrictFacts"] = 1982209] = "NonEmptyStringStrictFacts"; + TypeFacts[TypeFacts["NonEmptyStringFacts"] = 4194049] = "NonEmptyStringFacts"; + TypeFacts[TypeFacts["BaseNumberStrictFacts"] = 933506] = "BaseNumberStrictFacts"; + TypeFacts[TypeFacts["BaseNumberFacts"] = 3145346] = "BaseNumberFacts"; + TypeFacts[TypeFacts["NumberStrictFacts"] = 4079234] = "NumberStrictFacts"; + TypeFacts[TypeFacts["NumberFacts"] = 4193922] = "NumberFacts"; + TypeFacts[TypeFacts["ZeroStrictFacts"] = 3030658] = "ZeroStrictFacts"; + TypeFacts[TypeFacts["ZeroFacts"] = 3145346] = "ZeroFacts"; + TypeFacts[TypeFacts["NonZeroStrictFacts"] = 1982082] = "NonZeroStrictFacts"; + TypeFacts[TypeFacts["NonZeroFacts"] = 4193922] = "NonZeroFacts"; + TypeFacts[TypeFacts["BaseBooleanStrictFacts"] = 933252] = "BaseBooleanStrictFacts"; + TypeFacts[TypeFacts["BaseBooleanFacts"] = 3145092] = "BaseBooleanFacts"; + TypeFacts[TypeFacts["BooleanStrictFacts"] = 4078980] = "BooleanStrictFacts"; + TypeFacts[TypeFacts["BooleanFacts"] = 4193668] = "BooleanFacts"; + TypeFacts[TypeFacts["FalseStrictFacts"] = 3030404] = "FalseStrictFacts"; + TypeFacts[TypeFacts["FalseFacts"] = 3145092] = "FalseFacts"; + TypeFacts[TypeFacts["TrueStrictFacts"] = 1981828] = "TrueStrictFacts"; + TypeFacts[TypeFacts["TrueFacts"] = 4193668] = "TrueFacts"; + TypeFacts[TypeFacts["SymbolStrictFacts"] = 1981320] = "SymbolStrictFacts"; + TypeFacts[TypeFacts["SymbolFacts"] = 4193160] = "SymbolFacts"; + TypeFacts[TypeFacts["ObjectStrictFacts"] = 6166480] = "ObjectStrictFacts"; + TypeFacts[TypeFacts["ObjectFacts"] = 8378320] = "ObjectFacts"; + TypeFacts[TypeFacts["FunctionStrictFacts"] = 6164448] = "FunctionStrictFacts"; + TypeFacts[TypeFacts["FunctionFacts"] = 8376288] = "FunctionFacts"; + TypeFacts[TypeFacts["UndefinedFacts"] = 2457472] = "UndefinedFacts"; + TypeFacts[TypeFacts["NullFacts"] = 2340752] = "NullFacts"; + })(TypeFacts || (TypeFacts = {})); + var typeofEQFacts = ts.createMapFromTemplate({ "string": 1, "number": 2, "boolean": 4, @@ -21218,7 +22105,7 @@ var ts; "object": 16, "function": 32 }); - var typeofNEFacts = ts.createMap({ + var typeofNEFacts = ts.createMapFromTemplate({ "string": 128, "number": 256, "boolean": 512, @@ -21227,14 +22114,14 @@ var ts; "object": 2048, "function": 4096 }); - var typeofTypesByName = ts.createMap({ + var typeofTypesByName = ts.createMapFromTemplate({ "string": stringType, "number": numberType, "boolean": booleanType, "symbol": esSymbolType, "undefined": undefinedType }); - var jsxElementType; + var typeofType = createTypeofType(); var _jsxNamespace; var _jsxFactoryEntity; var jsxTypes = ts.createMap(); @@ -21253,8 +22140,21 @@ var ts; var identityRelation = ts.createMap(); var enumRelation = ts.createMap(); var _displayBuilder; + var TypeSystemPropertyName; + (function (TypeSystemPropertyName) { + TypeSystemPropertyName[TypeSystemPropertyName["Type"] = 0] = "Type"; + TypeSystemPropertyName[TypeSystemPropertyName["ResolvedBaseConstructorType"] = 1] = "ResolvedBaseConstructorType"; + TypeSystemPropertyName[TypeSystemPropertyName["DeclaredType"] = 2] = "DeclaredType"; + TypeSystemPropertyName[TypeSystemPropertyName["ResolvedReturnType"] = 3] = "ResolvedReturnType"; + })(TypeSystemPropertyName || (TypeSystemPropertyName = {})); + var CheckMode; + (function (CheckMode) { + CheckMode[CheckMode["Normal"] = 0] = "Normal"; + CheckMode[CheckMode["SkipContextSensitive"] = 1] = "SkipContextSensitive"; + CheckMode[CheckMode["Inferential"] = 2] = "Inferential"; + })(CheckMode || (CheckMode = {})); var builtinGlobals = ts.createMap(); - builtinGlobals[undefinedSymbol.name] = undefinedSymbol; + builtinGlobals.set(undefinedSymbol.name, undefinedSymbol); initializeTypeChecker(); return checker; function getJsxNamespace() { @@ -21284,7 +22184,12 @@ var ts; } function createSymbol(flags, name) { symbolCount++; - return new Symbol(flags, name); + var symbol = (new Symbol(flags | 134217728, name)); + symbol.checkFlags = 0; + return symbol; + } + function isTransientSymbol(symbol) { + return (symbol.flags & 134217728) !== 0; } function getExcludedSymbolFlags(flags) { var result = 0; @@ -21330,7 +22235,7 @@ var ts; mergedSymbols[source.mergeId] = target; } function cloneSymbol(symbol) { - var result = createSymbol(symbol.flags | 33554432, symbol.name); + var result = createSymbol(symbol.flags, symbol.name); result.declarations = symbol.declarations.slice(0); result.parent = symbol.parent; if (symbol.valueDeclaration) @@ -21352,12 +22257,10 @@ var ts; target.flags |= source.flags; if (source.valueDeclaration && (!target.valueDeclaration || - (target.valueDeclaration.kind === 230 && source.valueDeclaration.kind !== 230))) { + (target.valueDeclaration.kind === 232 && source.valueDeclaration.kind !== 232))) { target.valueDeclaration = source.valueDeclaration; } - ts.forEach(source.declarations, function (node) { - target.declarations.push(node); - }); + ts.addRange(target.declarations, source.declarations); if (source.members) { if (!target.members) target.members = ts.createMap(); @@ -21370,6 +22273,9 @@ var ts; } recordMergedSymbol(target, source); } + else if (target.flags & 1024) { + error(source.valueDeclaration.name, ts.Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target)); + } else { var message_2 = target.flags & 2 || source.flags & 2 ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; @@ -21382,18 +22288,19 @@ var ts; } } function mergeSymbolTable(target, source) { - for (var id in source) { - var targetSymbol = target[id]; + source.forEach(function (sourceSymbol, id) { + var targetSymbol = target.get(id); if (!targetSymbol) { - target[id] = source[id]; + target.set(id, sourceSymbol); } else { - if (!(targetSymbol.flags & 33554432)) { - target[id] = targetSymbol = cloneSymbol(targetSymbol); + if (!(targetSymbol.flags & 134217728)) { + targetSymbol = cloneSymbol(targetSymbol); + target.set(id, targetSymbol); } - mergeSymbol(targetSymbol, source[id]); + mergeSymbol(targetSymbol, sourceSymbol); } - } + }); } function mergeModuleAugmentation(moduleName) { var moduleAugmentation = moduleName.parent; @@ -21414,7 +22321,7 @@ var ts; } mainModule = resolveExternalModuleSymbol(mainModule); if (mainModule.flags & 1920) { - mainModule = mainModule.flags & 33554432 ? mainModule : cloneSymbol(mainModule); + mainModule = mainModule.flags & 134217728 ? mainModule : cloneSymbol(mainModule); mergeSymbol(mainModule, moduleAugmentation.symbol); } else { @@ -21423,20 +22330,21 @@ var ts; } } function addToSymbolTable(target, source, message) { - for (var id in source) { - if (target[id]) { - ts.forEach(target[id].declarations, addDeclarationDiagnostic(id, message)); + source.forEach(function (sourceSymbol, id) { + var targetSymbol = target.get(id); + if (targetSymbol) { + ts.forEach(targetSymbol.declarations, addDeclarationDiagnostic(id, message)); } else { - target[id] = source[id]; + target.set(id, sourceSymbol); } - } + }); function addDeclarationDiagnostic(id, message) { return function (declaration) { return diagnostics.add(ts.createDiagnosticForNode(declaration, message, id)); }; } } function getSymbolLinks(symbol) { - if (symbol.flags & 67108864) + if (symbol.flags & 134217728) return symbol; var id = getSymbolId(symbol); return symbolLinks[id] || (symbolLinks[id] = {}); @@ -21448,14 +22356,17 @@ var ts; function getObjectFlags(type) { return type.flags & 32768 ? type.objectFlags : 0; } + function getCheckFlags(symbol) { + return symbol.flags & 134217728 ? symbol.checkFlags : 0; + } function isGlobalSourceFile(node) { - return node.kind === 261 && !ts.isExternalOrCommonJsModule(node); + return node.kind === 264 && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { - var symbol = symbols[name]; + var symbol = symbols.get(name); if (symbol) { - ts.Debug.assert((symbol.flags & 16777216) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((getCheckFlags(symbol) & 1) === 0, "Should never get an instantiated symbol here."); if (symbol.flags & meaning) { return symbol; } @@ -21486,57 +22397,76 @@ var ts; (!compilerOptions.outFile && !compilerOptions.out)) { return true; } - if (isUsedInFunctionOrNonStaticProperty(usage)) { + if (isUsedInFunctionOrInstanceProperty(usage, declaration)) { return true; } var sourceFiles = host.getSourceFiles(); return ts.indexOf(sourceFiles, declarationFile) <= ts.indexOf(sourceFiles, useFile); } if (declaration.pos <= usage.pos) { - return declaration.kind !== 223 || - !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); + if (declaration.kind === 175) { + var errorBindingElement = ts.getAncestor(usage, 175); + if (errorBindingElement) { + return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || + declaration.pos < errorBindingElement.pos; + } + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 225), usage); + } + else if (declaration.kind === 225) { + return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); + } + return true; + } + if (usage.parent.kind === 245) { + return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); - return isUsedInFunctionOrNonStaticProperty(usage, container); + return isInTypeQuery(usage) || isUsedInFunctionOrInstanceProperty(usage, declaration, container); function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 205: - case 211: + case 207: case 213: + case 215: if (isSameScopeDescendentOf(usage, declaration, container)) { return true; } break; } switch (declaration.parent.parent.kind) { - case 212: - case 213: + case 214: + case 215: if (isSameScopeDescendentOf(usage, declaration.parent.parent.expression, container)) { return true; } } return false; } - function isUsedInFunctionOrNonStaticProperty(usage, container) { - var current = usage; - while (current) { + function isUsedInFunctionOrInstanceProperty(usage, declaration, container) { + return !!ts.findAncestor(usage, function (current) { if (current === container) { - return false; + return "quit"; } if (ts.isFunctionLike(current)) { return true; } - var initializerOfNonStaticProperty = current.parent && - current.parent.kind === 147 && - (ts.getModifierFlags(current.parent) & 32) === 0 && + var initializerOfProperty = current.parent && + current.parent.kind === 148 && current.parent.initializer === current; - if (initializerOfNonStaticProperty) { - return true; + if (initializerOfProperty) { + if (ts.getModifierFlags(current.parent) & 32) { + if (declaration.kind === 150) { + return true; + } + } + else { + var isDeclarationInstanceProperty = declaration.kind === 148 && !(ts.getModifierFlags(declaration) & 32); + if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { + return true; + } + } } - current = current.parent; - } - return false; + }); } } function resolveName(location, name, meaning, nameNotFoundMessage, nameArg) { @@ -21551,18 +22481,18 @@ var ts; if (result = getSymbol(location.locals, name, meaning)) { var useResult = true; if (ts.isFunctionLike(location) && lastLocation && lastLocation !== location.body) { - if (meaning & result.flags & 793064 && lastLocation.kind !== 278) { + if (meaning & result.flags & 793064 && lastLocation.kind !== 282) { useResult = result.flags & 262144 ? lastLocation === location.type || - lastLocation.kind === 144 || - lastLocation.kind === 143 + lastLocation.kind === 145 || + lastLocation.kind === 144 : false; } if (meaning & 107455 && result.flags & 1) { useResult = - lastLocation.kind === 144 || + lastLocation.kind === 145 || (lastLocation === location.type && - result.valueDeclaration.kind === 144); + result.valueDeclaration.kind === 145); } } if (useResult) { @@ -21574,23 +22504,24 @@ var ts; } } switch (location.kind) { - case 261: + case 264: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; - case 230: + case 232: var moduleExports = getSymbolOfNode(location).exports; - if (location.kind === 261 || ts.isAmbientModule(location)) { - if (result = moduleExports["default"]) { + if (location.kind === 264 || ts.isAmbientModule(location)) { + if (result = moduleExports.get("default")) { var localSymbol = ts.getLocalSymbolForExportDefault(result); if (localSymbol && (result.flags & meaning) && localSymbol.name === name) { break loop; } result = undefined; } - if (moduleExports[name] && - moduleExports[name].flags === 8388608 && - ts.getDeclarationOfKind(moduleExports[name], 243)) { + var moduleExport = moduleExports.get(name); + if (moduleExport && + moduleExport.flags === 8388608 && + ts.getDeclarationOfKind(moduleExport, 245)) { break; } } @@ -21598,13 +22529,13 @@ var ts; break loop; } break; - case 229: + case 231: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8)) { break loop; } break; + case 148: case 147: - case 146: if (ts.isClassLike(location.parent) && !(ts.getModifierFlags(location) & 32)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { @@ -21614,17 +22545,21 @@ var ts; } } break; - case 226: - case 197: - case 227: + case 228: + case 198: + case 229: if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793064)) { + if (!isTypeParameterSymbolDeclaredInContainer(result, location)) { + result = undefined; + break; + } if (lastLocation && ts.getModifierFlags(lastLocation) & 32) { error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); return undefined; } break loop; } - if (location.kind === 197 && meaning & 32) { + if (location.kind === 198 && meaning & 32) { var className = location.name; if (className && name === className.text) { result = location.symbol; @@ -21632,28 +22567,28 @@ var ts; } } break; - case 142: + case 143: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 227) { + if (ts.isClassLike(grandparent) || grandparent.kind === 229) { if (result = getSymbol(getSymbolOfNode(grandparent).members, name, meaning & 793064)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); return undefined; } } break; - case 149: - case 148: case 150: + case 149: case 151: case 152: - case 225: - case 185: + case 153: + case 227: + case 186: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 184: + case 185: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; @@ -21666,8 +22601,8 @@ var ts; } } break; - case 145: - if (location.parent && location.parent.kind === 144) { + case 146: + if (location.parent && location.parent.kind === 145) { location = location.parent; } if (location.parent && ts.isClassElement(location.parent)) { @@ -21690,7 +22625,8 @@ var ts; !checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && !checkAndReportErrorForExtendingInterface(errorLocation) && !checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) && - !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning)) { + !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) && + !checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning)) { error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); } } @@ -21702,21 +22638,31 @@ var ts; error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.declarationNameToString(propertyName), typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); return undefined; } - if (meaning & 2) { + if (meaning & 2 || + ((meaning & 32 || meaning & 384) && (meaning & 107455) === 107455)) { var exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result); - if (exportOrLocalSymbol.flags & 2) { + if (exportOrLocalSymbol.flags & 2 || exportOrLocalSymbol.flags & 32 || exportOrLocalSymbol.flags & 384) { checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation); } } if (result && isInExternalModule && (meaning & 107455) === 107455) { var decls = result.declarations; - if (decls && decls.length === 1 && decls[0].kind === 233) { + if (decls && decls.length === 1 && decls[0].kind === 235) { error(errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, name); } } } return result; } + function isTypeParameterSymbolDeclaredInContainer(symbol, container) { + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + if (decl.kind === 144 && decl.parent === container) { + return true; + } + } + return false; + } function checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) { if ((errorLocation.kind === 70 && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) { return false; @@ -21757,9 +22703,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 70: - case 177: + case 178: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 199: + case 200: ts.Debug.assert(ts.isEntityNameExpression(node.expression)); return node.expression; default: @@ -21786,65 +22732,84 @@ var ts; } return false; } - function checkResolvedBlockScopedVariable(result, errorLocation) { - ts.Debug.assert((result.flags & 2) !== 0); - var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; }); - ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); - if (!ts.isInAmbientContext(declaration) && !isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 223), errorLocation)) { - error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + function checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) { + if (meaning & (107455 & ~1024 & ~793064)) { + var symbol = resolveSymbol(resolveName(errorLocation, name, 1024 & ~107455, undefined, undefined)); + if (symbol) { + error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_value, name); + return true; + } } - } - function isSameScopeDescendentOf(initial, parent, stopAt) { - if (!parent) { - return false; - } - for (var current = initial; current && current !== stopAt && !ts.isFunctionLike(current); current = current.parent) { - if (current === parent) { + else if (meaning & (793064 & ~1024 & ~107455)) { + var symbol = resolveSymbol(resolveName(errorLocation, name, 1024 & ~793064, undefined, undefined)); + if (symbol) { + error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_type, name); return true; } } return false; } + function checkResolvedBlockScopedVariable(result, errorLocation) { + ts.Debug.assert(!!(result.flags & 2 || result.flags & 32 || result.flags & 384)); + var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 231) ? d : undefined; }); + ts.Debug.assert(declaration !== undefined, "Declaration to checkResolvedBlockScopedVariable is undefined"); + if (!ts.isInAmbientContext(declaration) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { + if (result.flags & 2) { + error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + } + else if (result.flags & 32) { + error(errorLocation, ts.Diagnostics.Class_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + } + else if (result.flags & 384) { + error(errorLocation, ts.Diagnostics.Enum_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + } + } + } + function isSameScopeDescendentOf(initial, parent, stopAt) { + return parent && !!ts.findAncestor(initial, function (n) { return n === stopAt || ts.isFunctionLike(n) ? "quit" : n === parent; }); + } function getAnyImportSyntax(node) { if (ts.isAliasSymbolDeclaration(node)) { - if (node.kind === 234) { + if (node.kind === 236) { return node; } - while (node && node.kind !== 235) { - node = node.parent; - } - return node; + return ts.findAncestor(node, function (n) { return n.kind === 237; }); } } function getDeclarationOfAliasSymbol(symbol) { - return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); + return ts.find(symbol.declarations, ts.isAliasSymbolDeclaration); } - function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 245) { + function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { + if (node.moduleReference.kind === 247) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } - return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference); + return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias); } - function getTargetOfImportClause(node) { + function getTargetOfImportClause(node, dontResolveAlias) { var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { - var exportDefaultSymbol = ts.isShorthandAmbientModuleSymbol(moduleSymbol) ? - moduleSymbol : - moduleSymbol.exports["export="] ? - getPropertyOfType(getTypeOfSymbol(moduleSymbol.exports["export="]), "default") : - resolveSymbol(moduleSymbol.exports["default"]); + var exportDefaultSymbol = void 0; + if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { + exportDefaultSymbol = moduleSymbol; + } + else { + var exportValue = moduleSymbol.exports.get("export="); + exportDefaultSymbol = exportValue + ? getPropertyOfType(getTypeOfSymbol(exportValue), "default") + : resolveSymbol(moduleSymbol.exports.get("default"), dontResolveAlias); + } if (!exportDefaultSymbol && !allowSyntheticDefaultImports) { error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); } else if (!exportDefaultSymbol && allowSyntheticDefaultImports) { - return resolveExternalModuleSymbol(moduleSymbol) || resolveSymbol(moduleSymbol); + return resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); } return exportDefaultSymbol; } } - function getTargetOfNamespaceImport(node) { + function getTargetOfNamespaceImport(node, dontResolveAlias) { var moduleSpecifier = node.parent.parent.moduleSpecifier; - return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier); + return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier, dontResolveAlias); } function combineValueAndTypeSymbols(valueSymbol, typeSymbol) { if (valueSymbol.flags & (793064 | 1920)) { @@ -21861,12 +22826,9 @@ var ts; result.exports = valueSymbol.exports; return result; } - function getExportOfModule(symbol, name) { + function getExportOfModule(symbol, name, dontResolveAlias) { if (symbol.flags & 1536) { - var exportedSymbol = getExportsOfSymbol(symbol)[name]; - if (exportedSymbol) { - return resolveSymbol(exportedSymbol); - } + return resolveSymbol(getExportsOfSymbol(symbol).get(name), dontResolveAlias); } } function getPropertyOfVariable(symbol, name) { @@ -21877,71 +22839,72 @@ var ts; } } } - function getExternalModuleMember(node, specifier) { + function getExternalModuleMember(node, specifier, dontResolveAlias) { var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); - var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier); + var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier, dontResolveAlias); if (targetSymbol) { - var name_18 = specifier.propertyName || specifier.name; - if (name_18.text) { + var name = specifier.propertyName || specifier.name; + if (name.text) { if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { return moduleSymbol; } var symbolFromVariable = void 0; - if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports["export="]) { - symbolFromVariable = getPropertyOfType(getTypeOfSymbol(targetSymbol), name_18.text); + if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports.get("export=")) { + symbolFromVariable = getPropertyOfType(getTypeOfSymbol(targetSymbol), name.text); } else { - symbolFromVariable = getPropertyOfVariable(targetSymbol, name_18.text); + symbolFromVariable = getPropertyOfVariable(targetSymbol, name.text); } - symbolFromVariable = resolveSymbol(symbolFromVariable); - var symbolFromModule = getExportOfModule(targetSymbol, name_18.text); - if (!symbolFromModule && allowSyntheticDefaultImports && name_18.text === "default") { - symbolFromModule = resolveExternalModuleSymbol(moduleSymbol) || resolveSymbol(moduleSymbol); + symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias); + var symbolFromModule = getExportOfModule(targetSymbol, name.text, dontResolveAlias); + if (!symbolFromModule && allowSyntheticDefaultImports && name.text === "default") { + symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); } var symbol = symbolFromModule && symbolFromVariable ? combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) : symbolFromModule || symbolFromVariable; if (!symbol) { - error(name_18, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name_18)); + error(name, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name)); } return symbol; } } } - function getTargetOfImportSpecifier(node) { - return getExternalModuleMember(node.parent.parent.parent, node); + function getTargetOfImportSpecifier(node, dontResolveAlias) { + return getExternalModuleMember(node.parent.parent.parent, node, dontResolveAlias); } - function getTargetOfNamespaceExportDeclaration(node) { - return resolveExternalModuleSymbol(node.parent.symbol); + function getTargetOfNamespaceExportDeclaration(node, dontResolveAlias) { + return resolveExternalModuleSymbol(node.parent.symbol, dontResolveAlias); } - function getTargetOfExportSpecifier(node) { + function getTargetOfExportSpecifier(node, dontResolveAlias) { return node.parent.parent.moduleSpecifier ? - getExternalModuleMember(node.parent.parent, node) : - resolveEntityName(node.propertyName || node.name, 107455 | 793064 | 1920); + getExternalModuleMember(node.parent.parent, node, dontResolveAlias) : + resolveEntityName(node.propertyName || node.name, 107455 | 793064 | 1920, false, dontResolveAlias); } - function getTargetOfExportAssignment(node) { - return resolveEntityName(node.expression, 107455 | 793064 | 1920); + function getTargetOfExportAssignment(node, dontResolveAlias) { + return resolveEntityName(node.expression, 107455 | 793064 | 1920, false, dontResolveAlias); } - function getTargetOfAliasDeclaration(node) { + function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { switch (node.kind) { - case 234: - return getTargetOfImportEqualsDeclaration(node); case 236: - return getTargetOfImportClause(node); - case 237: - return getTargetOfNamespaceImport(node); + return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); + case 238: + return getTargetOfImportClause(node, dontRecursivelyResolve); case 239: - return getTargetOfImportSpecifier(node); - case 243: - return getTargetOfExportSpecifier(node); - case 240: - return getTargetOfExportAssignment(node); - case 233: - return getTargetOfNamespaceExportDeclaration(node); + return getTargetOfNamespaceImport(node, dontRecursivelyResolve); + case 241: + return getTargetOfImportSpecifier(node, dontRecursivelyResolve); + case 245: + return getTargetOfExportSpecifier(node, dontRecursivelyResolve); + case 242: + return getTargetOfExportAssignment(node, dontRecursivelyResolve); + case 235: + return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); } } - function resolveSymbol(symbol) { - return symbol && symbol.flags & 8388608 && !(symbol.flags & (107455 | 793064 | 1920)) ? resolveAlias(symbol) : symbol; + function resolveSymbol(symbol, dontResolveAlias) { + var shouldResolve = !dontResolveAlias && symbol && symbol.flags & 8388608 && !(symbol.flags & (107455 | 793064 | 1920)); + return shouldResolve ? resolveAlias(symbol) : symbol; } function resolveAlias(symbol) { ts.Debug.assert((symbol.flags & 8388608) !== 0, "Should only get Alias here."); @@ -21980,10 +22943,10 @@ var ts; links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); ts.Debug.assert(!!node); - if (node.kind === 240) { + if (node.kind === 242) { checkExpressionCached(node.expression); } - else if (node.kind === 243) { + else if (node.kind === 245) { checkExpressionCached(node.propertyName || node.name); } else if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -21995,11 +22958,11 @@ var ts; if (entityName.kind === 70 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 70 || entityName.parent.kind === 141) { + if (entityName.kind === 70 || entityName.parent.kind === 142) { return resolveEntityName(entityName, 1920, false, dontResolveAlias); } else { - ts.Debug.assert(entityName.parent.kind === 234); + ts.Debug.assert(entityName.parent.kind === 236); return resolveEntityName(entityName, 107455 | 793064 | 1920, false, dontResolveAlias); } } @@ -22018,9 +22981,19 @@ var ts; return undefined; } } - else if (name.kind === 141 || name.kind === 177) { - var left = name.kind === 141 ? name.left : name.expression; - var right = name.kind === 141 ? name.right : name.name; + else if (name.kind === 142 || name.kind === 178) { + var left = void 0; + if (name.kind === 142) { + left = name.left; + } + else if (name.kind === 178 && + (name.expression.kind === 184 || ts.isEntityNameExpression(name.expression))) { + left = name.expression; + } + else { + return undefined; + } + var right = name.kind === 142 ? name.right : name.name; var namespace = resolveEntityName(left, 1920, ignoreErrors, false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -22036,10 +23009,15 @@ var ts; return undefined; } } + else if (name.kind === 184) { + return ts.isEntityNameExpression(name.expression) ? + resolveEntityName(name.expression, meaning, ignoreErrors, dontResolveAlias, location) : + undefined; + } else { ts.Debug.fail("Unknown entity name kind."); } - ts.Debug.assert((symbol.flags & 16777216) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((getCheckFlags(symbol) & 1) === 0, "Should never get an instantiated symbol here."); return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); } function resolveExternalModuleName(location, moduleReferenceExpression) { @@ -22047,7 +23025,7 @@ var ts; } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } - if (moduleReferenceExpression.kind !== 9) { + if (moduleReferenceExpression.kind !== 9 && moduleReferenceExpression.kind !== 12) { return; } var moduleReferenceLiteral = moduleReferenceExpression; @@ -22084,11 +23062,10 @@ var ts; } if (!isRelative && resolvedModule && !ts.extensionIsTypeScript(resolvedModule.extension)) { if (isForAugmentation) { - ts.Debug.assert(!!moduleNotFoundError); var diag = ts.Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented; - error(errorNode, diag, moduleName, resolvedModule.resolvedFileName); + error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName); } - else if (compilerOptions.noImplicitAny && moduleNotFoundError) { + else if (noImplicitAny && moduleNotFoundError) { error(errorNode, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedModule.resolvedFileName); } return undefined; @@ -22110,27 +23087,35 @@ var ts; } return undefined; } - function resolveExternalModuleSymbol(moduleSymbol) { - return moduleSymbol && getMergedSymbol(resolveSymbol(moduleSymbol.exports["export="])) || moduleSymbol; + function resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) { + return moduleSymbol && getMergedSymbol(resolveSymbol(moduleSymbol.exports.get("export="), dontResolveAlias)) || moduleSymbol; } - function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression) { - var symbol = resolveExternalModuleSymbol(moduleSymbol); - if (symbol && !(symbol.flags & (1536 | 3))) { + function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression, dontResolveAlias) { + var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); + if (!dontResolveAlias && symbol && !(symbol.flags & (1536 | 3))) { error(moduleReferenceExpression, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); symbol = undefined; } return symbol; } function hasExportAssignmentSymbol(moduleSymbol) { - return moduleSymbol.exports["export="] !== undefined; + return moduleSymbol.exports.get("export=") !== undefined; } function getExportsOfModuleAsArray(moduleSymbol) { return symbolsToArray(getExportsOfModule(moduleSymbol)); } + function getExportsAndPropertiesOfModule(moduleSymbol) { + var exports = getExportsOfModuleAsArray(moduleSymbol); + var exportEquals = resolveExternalModuleSymbol(moduleSymbol); + if (exportEquals !== moduleSymbol) { + ts.addRange(exports, getPropertiesOfType(getTypeOfSymbol(exportEquals))); + } + return exports; + } function tryGetMemberInModuleExports(memberName, moduleSymbol) { var symbolTable = getExportsOfModule(moduleSymbol); if (symbolTable) { - return symbolTable[memberName]; + return symbolTable.get(memberName); } } function getExportsOfSymbol(symbol) { @@ -22141,24 +23126,28 @@ var ts; return links.resolvedExports || (links.resolvedExports = getExportsForModule(moduleSymbol)); } function extendExportSymbols(target, source, lookupTable, exportNode) { - for (var id in source) { - if (id !== "default" && !target[id]) { - target[id] = source[id]; + source && source.forEach(function (sourceSymbol, id) { + if (id === "default") + return; + var targetSymbol = target.get(id); + if (!targetSymbol) { + target.set(id, sourceSymbol); if (lookupTable && exportNode) { - lookupTable[id] = { + lookupTable.set(id, { specifierText: ts.getTextOfNode(exportNode.moduleSpecifier) - }; + }); } } - else if (lookupTable && exportNode && id !== "default" && target[id] && resolveSymbol(target[id]) !== resolveSymbol(source[id])) { - if (!lookupTable[id].exportsWithDuplicate) { - lookupTable[id].exportsWithDuplicate = [exportNode]; + else if (lookupTable && exportNode && targetSymbol && resolveSymbol(targetSymbol) !== resolveSymbol(sourceSymbol)) { + var collisionTracker = lookupTable.get(id); + if (!collisionTracker.exportsWithDuplicate) { + collisionTracker.exportsWithDuplicate = [exportNode]; } else { - lookupTable[id].exportsWithDuplicate.push(exportNode); + collisionTracker.exportsWithDuplicate.push(exportNode); } } - } + }); } function getExportsForModule(moduleSymbol) { var visitedSymbols = []; @@ -22170,26 +23159,26 @@ var ts; } visitedSymbols.push(symbol); var symbols = ts.cloneMap(symbol.exports); - var exportStars = symbol.exports["__export"]; + var exportStars = symbol.exports.get("__export"); if (exportStars) { var nestedSymbols = ts.createMap(); - var lookupTable = ts.createMap(); + var lookupTable_1 = ts.createMap(); for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) { var node = _a[_i]; var resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier); var exportedSymbols = visit(resolvedModule); - extendExportSymbols(nestedSymbols, exportedSymbols, lookupTable, node); + extendExportSymbols(nestedSymbols, exportedSymbols, lookupTable_1, node); } - for (var id in lookupTable) { - var exportsWithDuplicate = lookupTable[id].exportsWithDuplicate; - if (id === "export=" || !(exportsWithDuplicate && exportsWithDuplicate.length) || symbols[id]) { - continue; + lookupTable_1.forEach(function (_a, id) { + var exportsWithDuplicate = _a.exportsWithDuplicate; + if (id === "export=" || !(exportsWithDuplicate && exportsWithDuplicate.length) || symbols.has(id)) { + return; } - for (var _b = 0, exportsWithDuplicate_1 = exportsWithDuplicate; _b < exportsWithDuplicate_1.length; _b++) { - var node = exportsWithDuplicate_1[_b]; - diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity, lookupTable[id].specifierText, id)); + for (var _i = 0, exportsWithDuplicate_1 = exportsWithDuplicate; _i < exportsWithDuplicate_1.length; _i++) { + var node = exportsWithDuplicate_1[_i]; + diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity, lookupTable_1.get(id).specifierText, id)); } - } + }); extendExportSymbols(symbols, nestedSymbols); } return symbols; @@ -22211,22 +23200,13 @@ var ts; : symbol; } function symbolIsValue(symbol) { - if (symbol.flags & 16777216) { - return symbolIsValue(getSymbolLinks(symbol).target); - } - if (symbol.flags & 107455) { - return true; - } - if (symbol.flags & 8388608) { - return (resolveAlias(symbol).flags & 107455) !== 0; - } - return false; + return !!(symbol.flags & 107455 || symbol.flags & 8388608 && resolveAlias(symbol).flags & 107455); } function findConstructorDeclaration(node) { var members = node.members; for (var _i = 0, members_1 = members; _i < members_1.length; _i++) { var member = members_1[_i]; - if (member.kind === 150 && ts.nodeIsPresent(member.body)) { + if (member.kind === 151 && ts.nodeIsPresent(member.body)) { return member; } } @@ -22254,6 +23234,9 @@ var ts; type.symbol = symbol; return type; } + function createTypeofType() { + return getUnionType(ts.convertToArray(typeofEQFacts.keys(), function (s) { return getLiteralTypeForText(32, s); })); + } function isReservedMemberName(name) { return name.charCodeAt(0) === 95 && name.charCodeAt(1) === 95 && @@ -22262,16 +23245,15 @@ var ts; } function getNamedMembers(members) { var result; - for (var id in members) { + members.forEach(function (symbol, id) { if (!isReservedMemberName(id)) { if (!result) result = []; - var symbol = members[id]; if (symbolIsValue(symbol)) { result.push(symbol); } } - } + }); return result || emptyArray; } function setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) { @@ -22290,19 +23272,19 @@ var ts; } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; - for (var location_1 = enclosingDeclaration; location_1; location_1 = location_1.parent) { - if (location_1.locals && !isGlobalSourceFile(location_1)) { - if (result = callback(location_1.locals)) { + for (var location = enclosingDeclaration; location; location = location.parent) { + if (location.locals && !isGlobalSourceFile(location)) { + if (result = callback(location.locals)) { return result; } } - switch (location_1.kind) { - case 261: - if (!ts.isExternalOrCommonJsModule(location_1)) { + switch (location.kind) { + case 264: + if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 230: - if (result = callback(getSymbolOfNode(location_1).exports)) { + case 232: + if (result = callback(getSymbolOfNode(location).exports)) { return result; } break; @@ -22315,6 +23297,16 @@ var ts; } function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing) { function getAccessibleSymbolChainFromSymbolTable(symbols) { + return getAccessibleSymbolChainFromSymbolTableWorker(symbols, []); + } + function getAccessibleSymbolChainFromSymbolTableWorker(symbols, visitedSymbolTables) { + if (ts.contains(visitedSymbolTables, symbols)) { + return undefined; + } + visitedSymbolTables.push(symbols); + var result = trySymbolTable(symbols); + visitedSymbolTables.pop(); + return result; function canQualifySymbol(symbolFromSymbolTable, meaning) { if (!needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning)) { return true; @@ -22328,26 +23320,28 @@ var ts; canQualifySymbol(symbolFromSymbolTable, meaning); } } - if (isAccessible(symbols[symbol.name])) { - return [symbol]; - } - return ts.forEachProperty(symbols, function (symbolFromSymbolTable) { - if (symbolFromSymbolTable.flags & 8388608 - && symbolFromSymbolTable.name !== "export=" - && !ts.getDeclarationOfKind(symbolFromSymbolTable, 243)) { - if (!useOnlyExternalAliasing || - ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { - var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); - if (isAccessible(symbolFromSymbolTable, resolveAlias(symbolFromSymbolTable))) { - return [symbolFromSymbolTable]; - } - var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; - if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { - return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); + function trySymbolTable(symbols) { + if (isAccessible(symbols.get(symbol.name))) { + return [symbol]; + } + return ts.forEachEntry(symbols, function (symbolFromSymbolTable) { + if (symbolFromSymbolTable.flags & 8388608 + && symbolFromSymbolTable.name !== "export=" + && !ts.getDeclarationOfKind(symbolFromSymbolTable, 245)) { + if (!useOnlyExternalAliasing || + ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { + var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); + if (isAccessible(symbolFromSymbolTable, resolveAlias(symbolFromSymbolTable))) { + return [symbolFromSymbolTable]; + } + var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTableWorker(resolvedImportedSymbol.exports, visitedSymbolTables) : undefined; + if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { + return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); + } } } - } - }); + }); + } } if (symbol) { if (!(isPropertyOrMethodDeclarationSymbol(symbol))) { @@ -22358,14 +23352,14 @@ var ts; function needsQualification(symbol, enclosingDeclaration, meaning) { var qualify = false; forEachSymbolTableInScope(enclosingDeclaration, function (symbolTable) { - var symbolFromSymbolTable = symbolTable[symbol.name]; + var symbolFromSymbolTable = symbolTable.get(symbol.name); if (!symbolFromSymbolTable) { return false; } if (symbolFromSymbolTable === symbol) { return true; } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 243)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 245)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -22379,10 +23373,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 147: - case 149: - case 151: + case 148: + case 150: case 152: + case 153: continue; default: return false; @@ -22430,15 +23424,12 @@ var ts; } return { accessibility: 0 }; function getExternalModuleContainer(declaration) { - for (; declaration; declaration = declaration.parent) { - if (hasExternalModuleSymbol(declaration)) { - return getSymbolOfNode(declaration); - } - } + var node = ts.findAncestor(declaration, hasExternalModuleSymbol); + return node && getSymbolOfNode(node); } } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 261 && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 264 && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -22472,11 +23463,11 @@ var ts; } function isEntityNameVisible(entityName, enclosingDeclaration) { var meaning; - if (entityName.parent.kind === 160 || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { + if (entityName.parent.kind === 161 || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { meaning = 107455 | 1048576; } - else if (entityName.kind === 141 || entityName.kind === 177 || - entityName.parent.kind === 234) { + else if (entityName.kind === 142 || entityName.kind === 178 || + entityName.parent.kind === 236) { meaning = 1920; } else { @@ -22524,6 +23515,483 @@ var ts; } return result; } + function createNodeBuilder() { + var context; + return { + typeToTypeNode: function (type, enclosingDeclaration, flags) { + context = createNodeBuilderContext(enclosingDeclaration, flags); + var resultingNode = typeToTypeNodeHelper(type); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + indexInfoToIndexSignatureDeclaration: function (indexInfo, kind, enclosingDeclaration, flags) { + context = createNodeBuilderContext(enclosingDeclaration, flags); + var resultingNode = indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + signatureToSignatureDeclaration: function (signature, kind, enclosingDeclaration, flags) { + context = createNodeBuilderContext(enclosingDeclaration, flags); + var resultingNode = signatureToSignatureDeclarationHelper(signature, kind); + var result = context.encounteredError ? undefined : resultingNode; + return result; + } + }; + function createNodeBuilderContext(enclosingDeclaration, flags) { + return { + enclosingDeclaration: enclosingDeclaration, + flags: flags, + encounteredError: false, + inObjectTypeLiteral: false, + checkAlias: true, + symbolStack: undefined + }; + } + function typeToTypeNodeHelper(type) { + if (!type) { + context.encounteredError = true; + return undefined; + } + if (type.flags & 1) { + return ts.createKeywordTypeNode(118); + } + if (type.flags & 2) { + return ts.createKeywordTypeNode(135); + } + if (type.flags & 4) { + return ts.createKeywordTypeNode(132); + } + if (type.flags & 8) { + return ts.createKeywordTypeNode(121); + } + if (type.flags & 16) { + var name = symbolToName(type.symbol, false); + return ts.createTypeReferenceNode(name, undefined); + } + if (type.flags & (32)) { + return ts.createLiteralTypeNode((ts.createLiteral(type.text))); + } + if (type.flags & (64)) { + return ts.createLiteralTypeNode((ts.createNumericLiteral(type.text))); + } + if (type.flags & 128) { + return type.intrinsicName === "true" ? ts.createTrue() : ts.createFalse(); + } + if (type.flags & 256) { + var name = symbolToName(type.symbol, false); + return ts.createTypeReferenceNode(name, undefined); + } + if (type.flags & 1024) { + return ts.createKeywordTypeNode(104); + } + if (type.flags & 2048) { + return ts.createKeywordTypeNode(138); + } + if (type.flags & 4096) { + return ts.createKeywordTypeNode(94); + } + if (type.flags & 8192) { + return ts.createKeywordTypeNode(129); + } + if (type.flags & 512) { + return ts.createKeywordTypeNode(136); + } + if (type.flags & 16777216) { + return ts.createKeywordTypeNode(133); + } + if (type.flags & 16384 && type.isThisType) { + if (context.inObjectTypeLiteral) { + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowThisInObjectLiteral)) { + context.encounteredError = true; + } + } + return ts.createThis(); + } + var objectFlags = getObjectFlags(type); + if (objectFlags & 4) { + ts.Debug.assert(!!(type.flags & 32768)); + return typeReferenceToTypeNode(type); + } + if (objectFlags & 3) { + ts.Debug.assert(!!(type.flags & 32768)); + var name = symbolToName(type.symbol, false); + return ts.createTypeReferenceNode(name, undefined); + } + if (type.flags & 16384) { + var name = symbolToName(type.symbol, false); + return ts.createTypeReferenceNode(name, undefined); + } + if (context.checkAlias && type.aliasSymbol) { + var name = symbolToName(type.aliasSymbol, false); + var typeArgumentNodes = type.aliasTypeArguments && mapToTypeNodeArray(type.aliasTypeArguments); + return ts.createTypeReferenceNode(name, typeArgumentNodes); + } + context.checkAlias = false; + if (type.flags & 65536) { + var formattedUnionTypes = formatUnionTypes(type.types); + var unionTypeNodes = formattedUnionTypes && mapToTypeNodeArray(formattedUnionTypes); + if (unionTypeNodes && unionTypeNodes.length > 0) { + return ts.createUnionOrIntersectionTypeNode(165, unionTypeNodes); + } + else { + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowEmptyUnionOrIntersection)) { + context.encounteredError = true; + } + return undefined; + } + } + if (type.flags & 131072) { + return ts.createUnionOrIntersectionTypeNode(166, mapToTypeNodeArray(type.types)); + } + if (objectFlags & (16 | 32)) { + ts.Debug.assert(!!(type.flags & 32768)); + return createAnonymousTypeNode(type); + } + if (type.flags & 262144) { + var indexedType = type.type; + var indexTypeNode = typeToTypeNodeHelper(indexedType); + return ts.createTypeOperatorNode(indexTypeNode); + } + if (type.flags & 524288) { + var objectTypeNode = typeToTypeNodeHelper(type.objectType); + var indexTypeNode = typeToTypeNodeHelper(type.indexType); + return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); + } + ts.Debug.fail("Should be unreachable."); + function mapToTypeNodeArray(types) { + var result = []; + for (var _i = 0, types_1 = types; _i < types_1.length; _i++) { + var type_1 = types_1[_i]; + var typeNode = typeToTypeNodeHelper(type_1); + if (typeNode) { + result.push(typeNode); + } + } + return result; + } + function createMappedTypeNodeFromType(type) { + ts.Debug.assert(!!(type.flags & 32768)); + var typeParameter = getTypeParameterFromMappedType(type); + var typeParameterNode = typeParameterToDeclaration(typeParameter); + var templateType = getTemplateTypeFromMappedType(type); + var templateTypeNode = typeToTypeNodeHelper(templateType); + var readonlyToken = type.declaration && type.declaration.readonlyToken ? ts.createToken(130) : undefined; + var questionToken = type.declaration && type.declaration.questionToken ? ts.createToken(54) : undefined; + return ts.createMappedTypeNode(readonlyToken, typeParameterNode, questionToken, templateTypeNode); + } + function createAnonymousTypeNode(type) { + var symbol = type.symbol; + if (symbol) { + if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) || + symbol.flags & (384 | 512) || + shouldWriteTypeOfFunctionSymbol()) { + return createTypeQueryNodeFromSymbol(symbol); + } + else if (ts.contains(context.symbolStack, symbol)) { + var typeAlias = getTypeAliasForTypeLiteral(type); + if (typeAlias) { + var entityName = symbolToName(typeAlias, false); + return ts.createTypeReferenceNode(entityName, undefined); + } + else { + return ts.createKeywordTypeNode(118); + } + } + else { + if (!context.symbolStack) { + context.symbolStack = []; + } + context.symbolStack.push(symbol); + var result = createTypeNodeFromObjectType(type); + context.symbolStack.pop(); + return result; + } + } + else { + return createTypeNodeFromObjectType(type); + } + function shouldWriteTypeOfFunctionSymbol() { + var isStaticMethodSymbol = !!(symbol.flags & 8192 && + ts.forEach(symbol.declarations, function (declaration) { return ts.getModifierFlags(declaration) & 32; })); + var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && + (symbol.parent || + ts.forEach(symbol.declarations, function (declaration) { + return declaration.parent.kind === 264 || declaration.parent.kind === 233; + })); + if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { + return ts.contains(context.symbolStack, symbol); + } + } + } + function createTypeNodeFromObjectType(type) { + if (type.objectFlags & 32) { + if (getConstraintTypeFromMappedType(type).flags & (16384 | 262144)) { + return createMappedTypeNodeFromType(type); + } + } + var resolved = resolveStructuredTypeMembers(type); + if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { + if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { + return ts.createTypeLiteralNode(undefined); + } + if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { + var signature = resolved.callSignatures[0]; + return signatureToSignatureDeclarationHelper(signature, 159); + } + if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { + var signature = resolved.constructSignatures[0]; + return signatureToSignatureDeclarationHelper(signature, 160); + } + } + var saveInObjectTypeLiteral = context.inObjectTypeLiteral; + context.inObjectTypeLiteral = true; + var members = createTypeNodesFromResolvedType(resolved); + context.inObjectTypeLiteral = saveInObjectTypeLiteral; + return ts.createTypeLiteralNode(members); + } + function createTypeQueryNodeFromSymbol(symbol) { + var entityName = symbolToName(symbol, false); + return ts.createTypeQueryNode(entityName); + } + function typeReferenceToTypeNode(type) { + var typeArguments = type.typeArguments || emptyArray; + if (type.target === globalArrayType) { + var elementType = typeToTypeNodeHelper(typeArguments[0]); + return ts.createArrayTypeNode(elementType); + } + else if (type.target.objectFlags & 8) { + if (typeArguments.length > 0) { + var tupleConstituentNodes = mapToTypeNodeArray(typeArguments.slice(0, getTypeReferenceArity(type))); + if (tupleConstituentNodes && tupleConstituentNodes.length > 0) { + return ts.createTupleTypeNode(tupleConstituentNodes); + } + } + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowEmptyTuple)) { + context.encounteredError = true; + } + return undefined; + } + else { + var outerTypeParameters = type.target.outerTypeParameters; + var i = 0; + var qualifiedName = undefined; + if (outerTypeParameters) { + var length_1 = outerTypeParameters.length; + while (i < length_1) { + var start = i; + var parent = getParentSymbolOfTypeParameter(outerTypeParameters[i]); + do { + i++; + } while (i < length_1 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent); + if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { + var qualifiedNamePart = symbolToName(parent, true); + if (!qualifiedName) { + qualifiedName = ts.createQualifiedName(qualifiedNamePart, undefined); + } + else { + ts.Debug.assert(!qualifiedName.right); + qualifiedName.right = qualifiedNamePart; + qualifiedName = ts.createQualifiedName(qualifiedName, undefined); + } + } + } + } + var entityName = undefined; + var nameIdentifier = symbolToName(type.symbol, true); + if (qualifiedName) { + ts.Debug.assert(!qualifiedName.right); + qualifiedName.right = nameIdentifier; + entityName = qualifiedName; + } + else { + entityName = nameIdentifier; + } + var typeParameterCount = (type.target.typeParameters || emptyArray).length; + var typeArgumentNodes = ts.some(typeArguments) ? mapToTypeNodeArray(typeArguments.slice(i, typeParameterCount - i)) : undefined; + return ts.createTypeReferenceNode(entityName, typeArgumentNodes); + } + } + function createTypeNodesFromResolvedType(resolvedType) { + var typeElements = []; + for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { + var signature = _a[_i]; + typeElements.push(signatureToSignatureDeclarationHelper(signature, 154)); + } + for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { + var signature = _c[_b]; + typeElements.push(signatureToSignatureDeclarationHelper(signature, 155)); + } + if (resolvedType.stringIndexInfo) { + typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.stringIndexInfo, 0)); + } + if (resolvedType.numberIndexInfo) { + typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.numberIndexInfo, 1)); + } + var properties = resolvedType.properties; + if (!properties) { + return typeElements; + } + for (var _d = 0, properties_2 = properties; _d < properties_2.length; _d++) { + var propertySymbol = properties_2[_d]; + var propertyType = getTypeOfSymbol(propertySymbol); + var oldDeclaration = propertySymbol.declarations && propertySymbol.declarations[0]; + if (!oldDeclaration) { + return; + } + var propertyName = oldDeclaration.name; + var optionalToken = propertySymbol.flags & 67108864 ? ts.createToken(54) : undefined; + if (propertySymbol.flags & (16 | 8192) && !getPropertiesOfObjectType(propertyType).length) { + var signatures = getSignaturesOfType(propertyType, 0); + for (var _e = 0, signatures_1 = signatures; _e < signatures_1.length; _e++) { + var signature = signatures_1[_e]; + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 149); + methodDeclaration.name = propertyName; + methodDeclaration.questionToken = optionalToken; + typeElements.push(methodDeclaration); + } + } + else { + var propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType) : ts.createKeywordTypeNode(118); + typeElements.push(ts.createPropertySignature(propertyName, optionalToken, propertyTypeNode, undefined)); + } + } + return typeElements.length ? typeElements : undefined; + } + } + function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind) { + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 ? 135 : 132); + var name = ts.getNameFromIndexInfo(indexInfo); + var indexingParameter = ts.createParameter(undefined, undefined, undefined, name, undefined, indexerTypeNode, undefined); + var typeNode = typeToTypeNodeHelper(indexInfo.type); + return ts.createIndexSignatureDeclaration(undefined, indexInfo.isReadonly ? [ts.createToken(130)] : undefined, [indexingParameter], typeNode); + } + function signatureToSignatureDeclarationHelper(signature, kind) { + var typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter); }); + var parameters = signature.parameters.map(function (parameter) { return symbolToParameterDeclaration(parameter); }); + var returnTypeNode; + if (signature.typePredicate) { + var typePredicate = signature.typePredicate; + var parameterName = typePredicate.kind === 1 ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(); + var typeNode = typeToTypeNodeHelper(typePredicate.type); + returnTypeNode = ts.createTypePredicateNode(parameterName, typeNode); + } + else { + var returnType = getReturnTypeOfSignature(signature); + returnTypeNode = returnType && typeToTypeNodeHelper(returnType); + } + var returnTypeNodeExceptAny = returnTypeNode && returnTypeNode.kind !== 118 ? returnTypeNode : undefined; + return ts.createSignatureDeclaration(kind, typeParameters, parameters, returnTypeNodeExceptAny); + } + function typeParameterToDeclaration(type) { + var constraint = getConstraintFromTypeParameter(type); + var constraintNode = constraint && typeToTypeNodeHelper(constraint); + var defaultParameter = getDefaultFromTypeParameter(type); + var defaultParameterNode = defaultParameter && typeToTypeNodeHelper(defaultParameter); + var name = symbolToName(type.symbol, true); + return ts.createTypeParameterDeclaration(name, constraintNode, defaultParameterNode); + } + function symbolToParameterDeclaration(parameterSymbol) { + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 145); + var parameterType = getTypeOfSymbol(parameterSymbol); + var parameterTypeNode = typeToTypeNodeHelper(parameterType); + var parameterNode = ts.createParameter(parameterDeclaration.decorators, parameterDeclaration.modifiers, parameterDeclaration.dotDotDotToken && ts.createToken(23), ts.getSynthesizedClone(parameterDeclaration.name), parameterDeclaration.questionToken && ts.createToken(54), parameterTypeNode, parameterDeclaration.initializer); + return parameterNode; + } + function symbolToName(symbol, expectsIdentifier) { + var chain; + var isTypeParameter = symbol.flags & 262144; + if (!isTypeParameter && context.enclosingDeclaration) { + chain = getSymbolChain(symbol, 0, true); + ts.Debug.assert(chain && chain.length > 0); + } + else { + chain = [symbol]; + } + if (expectsIdentifier && chain.length !== 1 + && !context.encounteredError + && !(context.flags & ts.NodeBuilderFlags.allowQualifedNameInPlaceOfIdentifier)) { + context.encounteredError = true; + } + return createEntityNameFromSymbolChain(chain, chain.length - 1); + function createEntityNameFromSymbolChain(chain, index) { + ts.Debug.assert(chain && 0 <= index && index < chain.length); + var symbol = chain[index]; + var typeParameterString = ""; + if (index > 0) { + var parentSymbol = chain[index - 1]; + var typeParameters = void 0; + if (getCheckFlags(symbol) & 1) { + typeParameters = getTypeParametersOfClassOrInterface(parentSymbol); + } + else { + var targetSymbol = getTargetSymbol(parentSymbol); + if (targetSymbol.flags & (32 | 64 | 524288)) { + typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); + } + } + if (typeParameters && typeParameters.length > 0) { + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowTypeParameterInQualifiedName)) { + context.encounteredError = true; + } + var writer = ts.getSingleLineStringWriter(); + var displayBuilder = getSymbolDisplayBuilder(); + displayBuilder.buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, context.enclosingDeclaration, 0); + typeParameterString = writer.string(); + ts.releaseStringWriter(writer); + } + } + var symbolName = getNameOfSymbol(symbol); + var symbolNameWithTypeParameters = typeParameterString.length > 0 ? symbolName + "<" + typeParameterString + ">" : symbolName; + var identifier = ts.createIdentifier(symbolNameWithTypeParameters); + return index > 0 ? ts.createQualifiedName(createEntityNameFromSymbolChain(chain, index - 1), identifier) : identifier; + } + function getSymbolChain(symbol, meaning, endOfChain) { + var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, false); + var parentSymbol; + if (!accessibleSymbolChain || + needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { + var parent = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); + if (parent) { + var parentChain = getSymbolChain(parent, getQualifiedLeftMeaning(meaning), false); + if (parentChain) { + parentSymbol = parent; + accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [symbol]); + } + } + } + if (accessibleSymbolChain) { + return accessibleSymbolChain; + } + if (endOfChain || + !(!parentSymbol && ts.forEach(symbol.declarations, hasExternalModuleSymbol)) && + !(symbol.flags & (2048 | 4096))) { + return [symbol]; + } + } + function getNameOfSymbol(symbol) { + var declaration = ts.firstOrUndefined(symbol.declarations); + if (declaration) { + if (declaration.name) { + return ts.declarationNameToString(declaration.name); + } + if (declaration.parent && declaration.parent.kind === 225) { + return ts.declarationNameToString(declaration.parent.name); + } + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowAnonymousIdentifier)) { + context.encounteredError = true; + } + switch (declaration.kind) { + case 198: + return "(Anonymous class)"; + case 185: + case 186: + return "(Anonymous function)"; + } + } + return symbol.name; + } + } + } function typePredicateToString(typePredicate, enclosingDeclaration, flags) { var writer = ts.getSingleLineStringWriter(); getSymbolDisplayBuilder().buildTypePredicateDisplay(typePredicate, writer, enclosingDeclaration, flags); @@ -22567,11 +24035,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048) { - var node = type.symbol.declarations[0].parent; - while (node.kind === 166) { - node = node.parent; - } - if (node.kind === 228) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 167; }); + if (node.kind === 230) { return getSymbolOfNode(node); } } @@ -22579,29 +24044,32 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 231 && + node.parent.kind === 233 && ts.isExternalModuleAugmentation(node.parent.parent); } function literalTypeToString(type) { return type.flags & 32 ? "\"" + ts.escapeString(type.text) + "\"" : type.text; } - function getSymbolDisplayBuilder() { - function getNameOfSymbol(symbol) { - if (symbol.declarations && symbol.declarations.length) { - var declaration = symbol.declarations[0]; - if (declaration.name) { - return ts.declarationNameToString(declaration.name); - } - switch (declaration.kind) { - case 197: - return "(Anonymous class)"; - case 184: - case 185: - return "(Anonymous function)"; - } + function getNameOfSymbol(symbol) { + if (symbol.declarations && symbol.declarations.length) { + var declaration = symbol.declarations[0]; + if (declaration.name) { + return ts.declarationNameToString(declaration.name); + } + if (declaration.parent && declaration.parent.kind === 225) { + return ts.declarationNameToString(declaration.parent.name); + } + switch (declaration.kind) { + case 198: + return "(Anonymous class)"; + case 185: + case 186: + return "(Anonymous function)"; } - return symbol.name; } + return symbol.name; + } + function getSymbolDisplayBuilder() { function appendSymbolNameOnly(symbol, writer) { writer.writeSymbol(getNameOfSymbol(symbol), symbol); } @@ -22629,7 +24097,7 @@ var ts; function appendParentTypeArgumentsAndSymbolName(symbol) { if (parentSymbol) { if (flags & 1) { - if (symbol.flags & 16777216) { + if (getCheckFlags(symbol) & 1) { buildDisplayForTypeArgumentsAndDelimiters(getTypeParametersOfClassOrInterface(parentSymbol), symbol.mapper, writer, enclosingDeclaration); } else { @@ -22648,9 +24116,9 @@ var ts; var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & 2)); if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { - var parent_5 = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); - if (parent_5) { - walkSymbol(parent_5, getQualifiedLeftMeaning(meaning), false); + var parent = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); + if (parent) { + walkSymbol(parent, getQualifiedLeftMeaning(meaning), false); } } if (accessibleSymbolChain) { @@ -22680,7 +24148,7 @@ var ts; return writeType(type, globalFlags); function writeType(type, flags) { var nextFlags = flags & ~512; - if (type.flags & 16015) { + if (type.flags & 16793231) { writer.writeKeyword(!(globalFlags & 16) && isTypeAny(type) ? "any" : type.intrinsicName); @@ -22705,7 +24173,7 @@ var ts; else if (!(flags & 512) && type.aliasSymbol && isSymbolAccessible(type.aliasSymbol, enclosingDeclaration, 793064, false).accessibility === 0) { var typeArguments = type.aliasTypeArguments; - writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, typeArguments ? typeArguments.length : 0, nextFlags); + writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, ts.length(typeArguments), nextFlags); } else if (type.flags & 196608) { writeUnionOrIntersectionType(type, nextFlags); @@ -22780,15 +24248,15 @@ var ts; var outerTypeParameters = type.target.outerTypeParameters; var i = 0; if (outerTypeParameters) { - var length_1 = outerTypeParameters.length; - while (i < length_1) { + var length_2 = outerTypeParameters.length; + while (i < length_2) { var start = i; - var parent_6 = getParentSymbolOfTypeParameter(outerTypeParameters[i]); + var parent = getParentSymbolOfTypeParameter(outerTypeParameters[i]); do { i++; - } while (i < length_1 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent_6); + } while (i < length_2 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent); if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { - writeSymbolTypeReference(parent_6, typeArguments, start, i, flags); + writeSymbolTypeReference(parent, typeArguments, start, i, flags); writePunctuation(writer, 22); } } @@ -22814,7 +24282,8 @@ var ts; function writeAnonymousType(type, flags) { var symbol = type.symbol; if (symbol) { - if (symbol.flags & (32 | 384 | 512)) { + if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) || + symbol.flags & (384 | 512)) { writeTypeOfSymbol(type, flags); } else if (shouldWriteTypeOfFunctionSymbol()) { @@ -22847,7 +24316,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && (symbol.parent || ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 261 || declaration.parent.kind === 231; + return declaration.parent.kind === 264 || declaration.parent.kind === 233; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 2) || @@ -22860,32 +24329,13 @@ var ts; writeSpace(writer); buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455, 0, typeFormatFlags); } - function writeIndexSignature(info, keyword) { - if (info) { - if (info.isReadonly) { - writeKeyword(writer, 130); - writeSpace(writer); - } - writePunctuation(writer, 20); - writer.writeParameter(info.declaration ? ts.declarationNameToString(info.declaration.parameters[0].name) : "x"); - writePunctuation(writer, 55); - writeSpace(writer); - writeKeyword(writer, keyword); - writePunctuation(writer, 21); - writePunctuation(writer, 55); - writeSpace(writer); - writeType(info.type, 0); - writePunctuation(writer, 24); - writer.writeLine(); - } - } function writePropertyWithModifiers(prop) { if (isReadonlySymbol(prop)) { writeKeyword(writer, 130); writeSpace(writer); } buildSymbolDisplay(prop, writer); - if (prop.flags & 536870912) { + if (prop.flags & 67108864) { writePunctuation(writer, 54); } } @@ -22961,15 +24411,15 @@ var ts; writePunctuation(writer, 24); writer.writeLine(); } - writeIndexSignature(resolved.stringIndexInfo, 134); - writeIndexSignature(resolved.numberIndexInfo, 132); + buildIndexSignatureDisplay(resolved.stringIndexInfo, writer, 0, enclosingDeclaration, globalFlags, symbolStack); + buildIndexSignatureDisplay(resolved.numberIndexInfo, writer, 1, enclosingDeclaration, globalFlags, symbolStack); for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) { var p = _e[_d]; var t = getTypeOfSymbol(p); if (p.flags & (16 | 8192) && !getPropertiesOfObjectType(t).length) { var signatures = getSignaturesOfType(t, 0); - for (var _f = 0, signatures_1 = signatures; _f < signatures_1.length; _f++) { - var signature = signatures_1[_f]; + for (var _f = 0, signatures_2 = signatures; _f < signatures_2.length; _f++) { + var signature = signatures_2[_f]; writePropertyWithModifiers(p); buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, undefined, symbolStack); writePunctuation(writer, 24); @@ -23028,32 +24478,43 @@ var ts; writeSpace(writer); buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, symbolStack); } + var defaultType = getDefaultFromTypeParameter(tp); + if (defaultType) { + writeSpace(writer); + writePunctuation(writer, 57); + writeSpace(writer); + buildTypeDisplay(defaultType, writer, enclosingDeclaration, flags, symbolStack); + } } function buildParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack) { var parameterNode = p.valueDeclaration; - if (ts.isRestParameter(parameterNode)) { + if (parameterNode ? ts.isRestParameter(parameterNode) : isTransientSymbol(p) && p.isRestParameter) { writePunctuation(writer, 23); } - if (ts.isBindingPattern(parameterNode.name)) { + if (parameterNode && ts.isBindingPattern(parameterNode.name)) { buildBindingPatternDisplay(parameterNode.name, writer, enclosingDeclaration, flags, symbolStack); } else { appendSymbolNameOnly(p, writer); } - if (isOptionalParameter(parameterNode)) { + if (parameterNode && isOptionalParameter(parameterNode)) { writePunctuation(writer, 54); } writePunctuation(writer, 55); writeSpace(writer); - buildTypeDisplay(getTypeOfSymbol(p), writer, enclosingDeclaration, flags, symbolStack); + var type = getTypeOfSymbol(p); + if (parameterNode && isRequiredInitializedParameter(parameterNode)) { + type = includeFalsyTypes(type, 2048); + } + buildTypeDisplay(type, writer, enclosingDeclaration, flags, symbolStack); } function buildBindingPatternDisplay(bindingPattern, writer, enclosingDeclaration, flags, symbolStack) { - if (bindingPattern.kind === 172) { + if (bindingPattern.kind === 173) { writePunctuation(writer, 16); buildDisplayForCommaSeparatedList(bindingPattern.elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); }); writePunctuation(writer, 17); } - else if (bindingPattern.kind === 173) { + else if (bindingPattern.kind === 174) { writePunctuation(writer, 20); var elements = bindingPattern.elements; buildDisplayForCommaSeparatedList(elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); }); @@ -23067,9 +24528,9 @@ var ts; if (ts.isOmittedExpression(bindingElement)) { return; } - ts.Debug.assert(bindingElement.kind === 174); + ts.Debug.assert(bindingElement.kind === 175); if (bindingElement.propertyName) { - writer.writeSymbol(ts.getTextOfNode(bindingElement.propertyName), bindingElement.symbol); + writer.writeProperty(ts.getTextOfNode(bindingElement.propertyName)); writePunctuation(writer, 55); writeSpace(writer); } @@ -23141,6 +24602,10 @@ var ts; buildTypeDisplay(predicate.type, writer, enclosingDeclaration, flags, symbolStack); } function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) { + var returnType = getReturnTypeOfSignature(signature); + if (flags & 2048 && isTypeAny(returnType)) { + return; + } if (flags & 8) { writeSpace(writer); writePunctuation(writer, 35); @@ -23153,7 +24618,6 @@ var ts; buildTypePredicateDisplay(signature.typePredicate, writer, enclosingDeclaration, flags, symbolStack); } else { - var returnType = getReturnTypeOfSignature(signature); buildTypeDisplay(returnType, writer, enclosingDeclaration, flags, symbolStack); } } @@ -23171,6 +24635,32 @@ var ts; buildDisplayForParametersAndDelimiters(signature.thisParameter, signature.parameters, writer, enclosingDeclaration, flags, symbolStack); buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack); } + function buildIndexSignatureDisplay(info, writer, kind, enclosingDeclaration, globalFlags, symbolStack) { + if (info) { + if (info.isReadonly) { + writeKeyword(writer, 130); + writeSpace(writer); + } + writePunctuation(writer, 20); + writer.writeParameter(info.declaration ? ts.declarationNameToString(info.declaration.parameters[0].name) : "x"); + writePunctuation(writer, 55); + writeSpace(writer); + switch (kind) { + case 1: + writeKeyword(writer, 132); + break; + case 0: + writeKeyword(writer, 135); + break; + } + writePunctuation(writer, 21); + writePunctuation(writer, 55); + writeSpace(writer); + buildTypeDisplay(info.type, writer, enclosingDeclaration, globalFlags, symbolStack); + writePunctuation(writer, 24); + writer.writeLine(); + } + } return _displayBuilder || (_displayBuilder = { buildSymbolDisplay: buildSymbolDisplay, buildTypeDisplay: buildTypeDisplay, @@ -23181,6 +24671,7 @@ var ts; buildDisplayForTypeParametersAndDelimiters: buildDisplayForTypeParametersAndDelimiters, buildTypeParameterDisplayFromSymbol: buildTypeParameterDisplayFromSymbol, buildSignatureDisplay: buildSignatureDisplay, + buildIndexSignatureDisplay: buildIndexSignatureDisplay, buildReturnTypeDisplay: buildReturnTypeDisplay }); } @@ -23195,63 +24686,63 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 174: + case 175: return isDeclarationVisible(node.parent.parent); - case 223: + case 225: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { return false; } - case 230: - case 226: - case 227: + case 232: case 228: - case 225: case 229: - case 234: + case 230: + case 227: + case 231: + case 236: if (ts.isExternalModuleAugmentation(node)) { return true; } - var parent_7 = getDeclarationContainer(node); + var parent = getDeclarationContainer(node); if (!(ts.getCombinedModifierFlags(node) & 1) && - !(node.kind !== 234 && parent_7.kind !== 261 && ts.isInAmbientContext(parent_7))) { - return isGlobalSourceFile(parent_7); + !(node.kind !== 236 && parent.kind !== 264 && ts.isInAmbientContext(parent))) { + return isGlobalSourceFile(parent); } - return isDeclarationVisible(parent_7); - case 147: - case 146: - case 151: - case 152: - case 149: + return isDeclarationVisible(parent); case 148: + case 147: + case 152: + case 153: + case 150: + case 149: if (ts.getModifierFlags(node) & (8 | 16)) { return false; } - case 150: - case 154: - case 153: + case 151: case 155: - case 144: - case 231: - case 158: + case 154: + case 156: + case 145: + case 233: case 159: - case 161: - case 157: + case 160: case 162: + case 158: case 163: case 164: case 165: case 166: + case 167: return isDeclarationVisible(node.parent); - case 236: - case 237: + case 238: case 239: + case 241: return false; - case 143: - case 261: - case 233: + case 144: + case 264: + case 235: return true; - case 240: + case 242: return false; default: return false; @@ -23260,10 +24751,10 @@ var ts; } function collectLinkedAliases(node) { var exportSymbol; - if (node.parent && node.parent.kind === 240) { + if (node.parent && node.parent.kind === 242) { exportSymbol = resolveName(node.parent, node.text, 107455 | 793064 | 1920 | 8388608, ts.Diagnostics.Cannot_find_name_0, node); } - else if (node.parent.kind === 243) { + else if (node.parent.kind === 245) { var exportSpecifier = node.parent; exportSymbol = exportSpecifier.parent.parent.moduleSpecifier ? getExternalModuleMember(exportSpecifier.parent.parent, exportSpecifier) : @@ -23295,8 +24786,8 @@ var ts; function pushTypeResolution(target, propertyName) { var resolutionCycleStartIndex = findResolutionCycleStartIndex(target, propertyName); if (resolutionCycleStartIndex >= 0) { - var length_2 = resolutionTargets.length; - for (var i = resolutionCycleStartIndex; i < length_2; i++) { + var length_3 = resolutionTargets.length; + for (var i = resolutionCycleStartIndex; i < length_3; i++) { resolutionResults[i] = false; } return false; @@ -23338,21 +24829,20 @@ var ts; return resolutionResults.pop(); } function getDeclarationContainer(node) { - node = ts.getRootDeclaration(node); - while (node) { + node = ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 223: - case 224: + case 225: + case 226: + case 241: + case 240: case 239: case 238: - case 237: - case 236: - node = node.parent; - break; + return false; default: - return node.parent; + return true; } - } + }); + return node && node.parent; } function getTypeOfPrototypeProperty(prototype) { var classType = getDeclaredTypeOfSymbol(getParentOfSymbol(prototype)); @@ -23365,32 +24855,34 @@ var ts; function isTypeAny(type) { return type && (type.flags & 1) !== 0; } - function isTypeNever(type) { - return type && (type.flags & 8192) !== 0; - } function getTypeForBindingElementParent(node) { var symbol = getSymbolOfNode(node); return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, false); } function isComputedNonLiteralName(name) { - return name.kind === 142 && !ts.isStringOrNumericLiteral(name.expression); + return name.kind === 143 && !ts.isStringOrNumericLiteral(name.expression); } function getRestType(source, properties, symbol) { - ts.Debug.assert(!!(source.flags & 32768), "Rest types only support object types right now."); + source = filterType(source, function (t) { return !(t.flags & 6144); }); + if (source.flags & 8192) { + return emptyObjectType; + } + if (source.flags & 65536) { + return mapType(source, function (t) { return getRestType(t, properties, symbol); }); + } var members = ts.createMap(); var names = ts.createMap(); - for (var _i = 0, properties_2 = properties; _i < properties_2.length; _i++) { - var name_19 = properties_2[_i]; - names[ts.getTextOfPropertyName(name_19)] = true; + for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { + var name = properties_3[_i]; + names.set(ts.getTextOfPropertyName(name), true); } for (var _a = 0, _b = getPropertiesOfType(source); _a < _b.length; _a++) { var prop = _b[_a]; - var inNamesToRemove = prop.name in names; + var inNamesToRemove = names.has(prop.name); var isPrivate = getDeclarationModifierFlagsFromSymbol(prop) & (8 | 16); - var isMethod = prop.flags & 8192; var isSetOnlyAccessor = prop.flags & 65536 && !(prop.flags & 32768); - if (!inNamesToRemove && !isPrivate && !isMethod && !isSetOnlyAccessor) { - members[prop.name] = prop; + if (!inNamesToRemove && !isPrivate && !isClassMethod(prop) && !isSetOnlyAccessor) { + members.set(prop.name, prop); } } var stringIndexInfo = getIndexInfoOfType(source, 0); @@ -23410,9 +24902,9 @@ var ts; return parentType; } var type; - if (pattern.kind === 172) { + if (pattern.kind === 173) { if (declaration.dotDotDotToken) { - if (!(parentType.flags & 32768)) { + if (!isValidSpreadType(parentType)) { error(declaration, ts.Diagnostics.Rest_types_may_only_be_created_from_object_types); return unknownType; } @@ -23426,25 +24918,25 @@ var ts; type = getRestType(parentType, literalMembers, declaration.symbol); } else { - var name_20 = declaration.propertyName || declaration.name; - if (isComputedNonLiteralName(name_20)) { + var name = declaration.propertyName || declaration.name; + if (isComputedNonLiteralName(name)) { return anyType; } if (declaration.initializer) { getContextualType(declaration.initializer); } - var text = ts.getTextOfPropertyName(name_20); + var text = ts.getTextOfPropertyName(name); type = getTypeOfPropertyOfType(parentType, text) || isNumericLiteralName(text) && getIndexTypeOfType(parentType, 1) || getIndexTypeOfType(parentType, 0); if (!type) { - error(name_20, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_20)); + error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name)); return unknownType; } } } else { - var elementType = checkIteratedTypeOrElementType(parentType, pattern, false); + var elementType = checkIteratedTypeOrElementType(parentType, pattern, false, false); if (declaration.dotDotDotToken) { type = createArrayType(elementType); } @@ -23471,7 +24963,7 @@ var ts; getUnionType([type, checkExpressionCached(declaration.initializer)], true) : type; } - function getTypeForVariableLikeDeclarationFromJSDocComment(declaration) { + function getTypeForDeclarationFromJSDocComment(declaration) { var jsdocType = ts.getJSDocType(declaration); if (jsdocType) { return getTypeFromTypeNode(jsdocType); @@ -23484,33 +24976,35 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 175 && expr.elements.length === 0; + return expr.kind === 176 && expr.elements.length === 0; } function addOptionality(type, optional) { return strictNullChecks && optional ? includeFalsyTypes(type, 2048) : type; } function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { - if (declaration.flags & 2097152) { - var type = getTypeForVariableLikeDeclarationFromJSDocComment(declaration); + if (declaration.flags & 65536) { + var type = getTypeForDeclarationFromJSDocComment(declaration); if (type && type !== unknownType) { return type; } } - if (declaration.parent.parent.kind === 212) { + if (declaration.parent.parent.kind === 214) { var indexType = getIndexType(checkNonNullExpression(declaration.parent.parent.expression)); return indexType.flags & (16384 | 262144) ? indexType : stringType; } - if (declaration.parent.parent.kind === 213) { - return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType; + if (declaration.parent.parent.kind === 215) { + var forOfStatement = declaration.parent.parent; + return checkRightHandSideOfForOf(forOfStatement.expression, forOfStatement.awaitModifier) || anyType; } if (ts.isBindingPattern(declaration.parent)) { return getTypeForBindingElement(declaration); } if (declaration.type) { - return addOptionality(getTypeFromTypeNode(declaration.type), declaration.questionToken && includeOptionality); + var declaredType = getTypeFromTypeNode(declaration.type); + return addOptionality(declaredType, declaration.questionToken && includeOptionality); } - if ((compilerOptions.noImplicitAny || declaration.flags & 2097152) && - declaration.kind === 223 && !ts.isBindingPattern(declaration.name) && + if ((noImplicitAny || declaration.flags & 65536) && + declaration.kind === 225 && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1) && !ts.isInAmbientContext(declaration)) { if (!(ts.getCombinedNodeFlags(declaration) & 2) && (!declaration.initializer || isNullOrUndefined(declaration.initializer))) { return autoType; @@ -23519,10 +25013,10 @@ var ts; return autoArrayType; } } - if (declaration.kind === 144) { + if (declaration.kind === 145) { var func = declaration.parent; - if (func.kind === 152 && !ts.hasDynamicName(func)) { - var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 151); + if (func.kind === 153 && !ts.hasDynamicName(func)) { + var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 152); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -23548,7 +25042,10 @@ var ts; var type = checkDeclarationInitializer(declaration); return addOptionality(type, declaration.questionToken && includeOptionality); } - if (declaration.kind === 258) { + if (ts.isJsxAttribute(declaration)) { + return trueType; + } + if (declaration.kind === 261) { return checkIdentifier(declaration.name); } if (ts.isBindingPattern(declaration.name)) { @@ -23556,6 +25053,37 @@ var ts; } return undefined; } + function getWidenedTypeFromJSSpecialPropertyDeclarations(symbol) { + var types = []; + var definedInConstructor = false; + var definedInMethod = false; + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + var expression = declaration.kind === 193 ? declaration : + declaration.kind === 178 ? ts.getAncestor(declaration, 193) : + undefined; + if (!expression) { + return unknownType; + } + if (ts.isPropertyAccessExpression(expression.left) && expression.left.expression.kind === 98) { + if (ts.getThisContainer(expression, false).kind === 151) { + definedInConstructor = true; + } + else { + definedInMethod = true; + } + } + if (expression.flags & 65536) { + var type = getTypeForDeclarationFromJSDocComment(expression.parent); + if (type && type !== unknownType) { + types.push(getWidenedType(type)); + continue; + } + } + types.push(getWidenedLiteralType(checkExpressionCached(expression.right))); + } + return getWidenedType(addOptionality(getUnionType(types, true), definedInMethod && !definedInConstructor)); + } function getTypeFromBindingElement(element, includePatternInType, reportErrors) { if (element.initializer) { return checkDeclarationInitializer(element); @@ -23563,28 +25091,33 @@ var ts; if (ts.isBindingPattern(element.name)) { return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors); } - if (reportErrors && compilerOptions.noImplicitAny && !declarationBelongsToPrivateAmbientMember(element)) { + if (reportErrors && noImplicitAny && !declarationBelongsToPrivateAmbientMember(element)) { reportImplicitAnyError(element, anyType); } return anyType; } function getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) { var members = ts.createMap(); + var stringIndexInfo; var hasComputedProperties = false; ts.forEach(pattern.elements, function (e) { var name = e.propertyName || e.name; - if (isComputedNonLiteralName(name) || e.dotDotDotToken) { + if (isComputedNonLiteralName(name)) { hasComputedProperties = true; return; } + if (e.dotDotDotToken) { + stringIndexInfo = createIndexInfo(anyType, false); + return; + } var text = ts.getTextOfPropertyName(name); - var flags = 4 | 67108864 | (e.initializer ? 536870912 : 0); + var flags = 4 | (e.initializer ? 67108864 : 0); var symbol = createSymbol(flags, text); symbol.type = getTypeFromBindingElement(e, includePatternInType, reportErrors); symbol.bindingElement = e; - members[symbol.name] = symbol; + members.set(symbol.name, symbol); }); - var result = createAnonymousType(undefined, members, emptyArray, emptyArray, undefined, undefined); + var result = createAnonymousType(undefined, members, emptyArray, emptyArray, stringIndexInfo, undefined); if (includePatternInType) { result.pattern = pattern; } @@ -23608,7 +25141,7 @@ var ts; return result; } function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { - return pattern.kind === 172 + return pattern.kind === 173 ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -23618,13 +25151,13 @@ var ts; if (reportErrors) { reportErrorsFromWidening(declaration, type); } - if (declaration.kind === 257) { + if (declaration.kind === 260) { return type; } return getWidenedType(type); } type = declaration.dotDotDotToken ? anyArrayType : anyType; - if (reportErrors && compilerOptions.noImplicitAny) { + if (reportErrors && noImplicitAny) { if (!declarationBelongsToPrivateAmbientMember(declaration)) { reportImplicitAnyError(declaration, type); } @@ -23633,56 +25166,38 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 144 ? root.parent : root; + var memberDeclaration = root.kind === 145 ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function getTypeOfVariableOrParameterOrProperty(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - if (symbol.flags & 134217728) { + if (symbol.flags & 16777216) { return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; if (ts.isCatchClauseVariableDeclarationOrBindingElement(declaration)) { return links.type = anyType; } - if (declaration.kind === 240) { + if (declaration.kind === 242) { return links.type = checkExpression(declaration.expression); } - if (declaration.flags & 2097152 && declaration.kind === 286 && declaration.typeExpression) { + if (declaration.flags & 65536 && declaration.kind === 290 && declaration.typeExpression) { return links.type = getTypeFromTypeNode(declaration.typeExpression.type); } if (!pushTypeResolution(symbol, 0)) { return unknownType; } var type = void 0; - if (declaration.kind === 192 || - declaration.kind === 177 && declaration.parent.kind === 192) { - if (declaration.flags & 2097152) { - var jsdocType = ts.getJSDocType(declaration.parent); - if (jsdocType) { - return links.type = getTypeFromTypeNode(jsdocType); - } - } - var declaredTypes = ts.map(symbol.declarations, function (decl) { return decl.kind === 192 ? - checkExpressionCached(decl.right) : - checkExpressionCached(decl.parent.right); }); - type = getUnionType(declaredTypes, true); + if (declaration.kind === 193 || + declaration.kind === 178 && declaration.parent.kind === 193) { + type = getWidenedTypeFromJSSpecialPropertyDeclarations(symbol); } else { type = getWidenedTypeForVariableLikeDeclaration(declaration, true); } if (!popTypeResolution()) { - if (symbol.valueDeclaration.type) { - type = unknownType; - error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); - } - else { - type = anyType; - if (compilerOptions.noImplicitAny) { - error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); - } - } + type = reportCircularityError(symbol); } links.type = type; } @@ -23690,7 +25205,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 151) { + if (accessor.kind === 152) { return accessor.type && getTypeFromTypeNode(accessor.type); } else { @@ -23710,10 +25225,10 @@ var ts; function getTypeOfAccessors(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - var getter = ts.getDeclarationOfKind(symbol, 151); - var setter = ts.getDeclarationOfKind(symbol, 152); - if (getter && getter.flags & 2097152) { - var jsDocType = getTypeForVariableLikeDeclarationFromJSDocComment(getter); + var getter = ts.getDeclarationOfKind(symbol, 152); + var setter = ts.getDeclarationOfKind(symbol, 153); + if (getter && getter.flags & 65536) { + var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { return links.type = jsDocType; } @@ -23736,7 +25251,7 @@ var ts; type = getReturnTypeFromBody(getter); } else { - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { if (setter) { error(setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation, symbolToString(symbol)); } @@ -23751,8 +25266,8 @@ var ts; } if (!popTypeResolution()) { type = anyType; - if (compilerOptions.noImplicitAny) { - var getter_1 = ts.getDeclarationOfKind(symbol, 151); + if (noImplicitAny) { + var getter_1 = ts.getDeclarationOfKind(symbol, 152); error(getter_1, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -23760,6 +25275,10 @@ var ts; } return links.type; } + function getBaseTypeVariableOfClass(symbol) { + var baseConstructorType = getBaseConstructorTypeOfClass(getDeclaredTypeOfClassOrInterface(symbol)); + return baseConstructorType.flags & 540672 ? baseConstructorType : undefined; + } function getTypeOfFuncClassEnumModule(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { @@ -23768,8 +25287,13 @@ var ts; } else { var type = createObjectType(16, symbol); - links.type = strictNullChecks && symbol.flags & 536870912 ? - includeFalsyTypes(type, 2048) : type; + if (symbol.flags & 32) { + var baseTypeVariable = getBaseTypeVariableOfClass(symbol); + links.type = baseTypeVariable ? getIntersectionType([type, baseTypeVariable]) : type; + } + else { + links.type = strictNullChecks && symbol.flags & 67108864 ? includeFalsyTypes(type, 2048) : type; + } } } return links.type; @@ -23794,12 +25318,37 @@ var ts; function getTypeOfInstantiatedSymbol(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - links.type = instantiateType(getTypeOfSymbol(links.target), links.mapper); + if (symbolInstantiationDepth === 100) { + error(symbol.valueDeclaration, ts.Diagnostics.Generic_type_instantiation_is_excessively_deep_and_possibly_infinite); + links.type = unknownType; + } + else { + if (!pushTypeResolution(symbol, 0)) { + return unknownType; + } + symbolInstantiationDepth++; + var type = instantiateType(getTypeOfSymbol(links.target), links.mapper); + symbolInstantiationDepth--; + if (!popTypeResolution()) { + type = reportCircularityError(symbol); + } + links.type = type; + } } return links.type; } + function reportCircularityError(symbol) { + if (symbol.valueDeclaration.type) { + error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); + return unknownType; + } + if (noImplicitAny) { + error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); + } + return anyType; + } function getTypeOfSymbol(symbol) { - if (symbol.flags & 16777216) { + if (getCheckFlags(symbol) & 1) { return getTypeOfInstantiatedSymbol(symbol); } if (symbol.flags & (3 | 4)) { @@ -23819,19 +25368,30 @@ var ts; } return unknownType; } + function isReferenceToType(type, target) { + return type !== undefined + && target !== undefined + && (getObjectFlags(type) & 4) !== 0 + && type.target === target; + } function getTargetType(type) { return getObjectFlags(type) & 4 ? type.target : type; } function hasBaseType(type, checkBase) { return check(type); function check(type) { - var target = getTargetType(type); - return target === checkBase || ts.forEach(getBaseTypes(target), check); + if (getObjectFlags(type) & (3 | 4)) { + var target = getTargetType(type); + return target === checkBase || ts.forEach(getBaseTypes(target), check); + } + else if (type.flags & 131072) { + return ts.forEach(type.types, check); + } } } function appendTypeParameters(typeParameters, declarations) { - for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { - var declaration = declarations_2[_i]; + for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { + var declaration = declarations_3[_i]; var tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(declaration)); if (!typeParameters) { typeParameters = [tp]; @@ -23848,9 +25408,9 @@ var ts; if (!node) { return typeParameters; } - if (node.kind === 226 || node.kind === 197 || - node.kind === 225 || node.kind === 184 || - node.kind === 149 || node.kind === 185) { + if (node.kind === 228 || node.kind === 198 || + node.kind === 227 || node.kind === 185 || + node.kind === 150 || node.kind === 186) { var declarations = node.typeParameters; if (declarations) { return appendTypeParameters(appendOuterTypeParameters(typeParameters, node), declarations); @@ -23859,15 +25419,15 @@ var ts; } } function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 227); + var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 229); return appendOuterTypeParameters(undefined, declaration); } function getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) { var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 227 || node.kind === 226 || - node.kind === 197 || node.kind === 228) { + if (node.kind === 229 || node.kind === 228 || + node.kind === 198 || node.kind === 230) { var declaration = node; if (declaration.typeParameters) { result = appendTypeParameters(result, declaration.typeParameters); @@ -23879,18 +25439,34 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { return ts.concatenate(getOuterTypeParametersOfClassOrInterface(symbol), getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol)); } + function isMixinConstructorType(type) { + var signatures = getSignaturesOfType(type, 1); + if (signatures.length === 1) { + var s = signatures[0]; + return !s.typeParameters && s.parameters.length === 1 && s.hasRestParameter && getTypeOfParameter(s.parameters[0]) === anyArrayType; + } + return false; + } function isConstructorType(type) { - return type.flags & 32768 && getSignaturesOfType(type, 1).length > 0; + if (isValidBaseType(type) && getSignaturesOfType(type, 1).length > 0) { + return true; + } + if (type.flags & 540672) { + var constraint = getBaseConstraintOfType(type); + return constraint && isValidBaseType(constraint) && isMixinConstructorType(constraint); + } + return false; } function getBaseTypeNodeOfClass(type) { return ts.getClassExtendsHeritageClauseElement(type.symbol.valueDeclaration); } - function getConstructorsForTypeArguments(type, typeArgumentNodes) { - var typeArgCount = typeArgumentNodes ? typeArgumentNodes.length : 0; - return ts.filter(getSignaturesOfType(type, 1), function (sig) { return (sig.typeParameters ? sig.typeParameters.length : 0) === typeArgCount; }); + function getConstructorsForTypeArguments(type, typeArgumentNodes, location) { + var typeArgCount = ts.length(typeArgumentNodes); + var isJavaScript = ts.isInJavaScriptFile(location); + return ts.filter(getSignaturesOfType(type, 1), function (sig) { return (isJavaScript || typeArgCount >= getMinTypeArgumentCount(sig.typeParameters)) && typeArgCount <= ts.length(sig.typeParameters); }); } - function getInstantiatedConstructorsForTypeArguments(type, typeArgumentNodes) { - var signatures = getConstructorsForTypeArguments(type, typeArgumentNodes); + function getInstantiatedConstructorsForTypeArguments(type, typeArgumentNodes, location) { + var signatures = getConstructorsForTypeArguments(type, typeArgumentNodes, location); if (typeArgumentNodes) { var typeArguments_1 = ts.map(typeArgumentNodes, getTypeFromTypeNode); signatures = ts.map(signatures, function (sig) { return getSignatureInstantiation(sig, typeArguments_1); }); @@ -23907,14 +25483,14 @@ var ts; return unknownType; } var baseConstructorType = checkExpression(baseTypeNode.expression); - if (baseConstructorType.flags & 32768) { + if (baseConstructorType.flags & (32768 | 131072)) { resolveStructuredTypeMembers(baseConstructorType); } if (!popTypeResolution()) { error(type.symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_base_expression, symbolToString(type.symbol)); return type.resolvedBaseConstructorType = unknownType; } - if (baseConstructorType !== unknownType && baseConstructorType !== nullWideningType && !isConstructorType(baseConstructorType)) { + if (!(baseConstructorType.flags & 1) && baseConstructorType !== nullWideningType && !isConstructorType(baseConstructorType)) { error(baseTypeNode.expression, ts.Diagnostics.Type_0_is_not_a_constructor_function_type, typeToString(baseConstructorType)); return type.resolvedBaseConstructorType = unknownType; } @@ -23943,8 +25519,8 @@ var ts; } function resolveBaseTypesOfClass(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; - var baseConstructorType = getBaseConstructorTypeOfClass(type); - if (!(baseConstructorType.flags & 32768)) { + var baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type)); + if (!(baseConstructorType.flags & (32768 | 131072 | 1))) { return; } var baseTypeNode = getBaseTypeNodeOfClass(type); @@ -23954,8 +25530,11 @@ var ts; areAllOuterTypeParametersApplied(originalBaseType)) { baseType = getTypeFromClassOrInterfaceReference(baseTypeNode, baseConstructorType.symbol); } + else if (baseConstructorType.flags & 1) { + baseType = baseConstructorType; + } else { - var constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments); + var constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments, baseTypeNode); if (!constructors.length) { error(baseTypeNode.expression, ts.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments); return; @@ -23972,7 +25551,7 @@ var ts; if (baseType === unknownType) { return; } - if (!(getObjectFlags(getTargetType(baseType)) & 3)) { + if (!isValidBaseType(baseType)) { error(baseTypeNode.expression, ts.Diagnostics.Base_constructor_return_type_0_is_not_a_class_or_interface_type, typeToString(baseType)); return; } @@ -23996,16 +25575,20 @@ var ts; } return true; } + function isValidBaseType(type) { + return type.flags & (32768 | 16777216 | 1) && !isGenericMappedType(type) || + type.flags & 131072 && !ts.forEach(type.types, function (t) { return !isValidBaseType(t); }); + } function resolveBaseTypesOfInterface(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 227 && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 229 && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getTypeFromTypeNode(node); if (baseType !== unknownType) { - if (getObjectFlags(getTargetType(baseType)) & 3) { + if (isValidBaseType(baseType)) { if (type !== baseType && !hasBaseType(baseType, type)) { if (type.resolvedBaseTypes === emptyArray) { type.resolvedBaseTypes = [baseType]; @@ -24029,7 +25612,7 @@ var ts; function isIndependentInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 227) { + if (declaration.kind === 229) { if (declaration.flags & 64) { return false; } @@ -24062,7 +25645,7 @@ var ts; type.outerTypeParameters = outerTypeParameters; type.localTypeParameters = localTypeParameters; type.instantiations = ts.createMap(); - type.instantiations[getTypeListId(type.typeParameters)] = type; + type.instantiations.set(getTypeListId(type.typeParameters), type); type.target = type; type.typeArguments = type.typeParameters; type.thisType = createType(16384); @@ -24079,7 +25662,7 @@ var ts; if (!pushTypeResolution(symbol, 2)) { return unknownType; } - var declaration = ts.getDeclarationOfKind(symbol, 285); + var declaration = ts.getDeclarationOfKind(symbol, 289); var type = void 0; if (declaration) { if (declaration.jsDocTypeLiteral) { @@ -24090,7 +25673,7 @@ var ts; } } else { - declaration = ts.getDeclarationOfKind(symbol, 228); + declaration = ts.getDeclarationOfKind(symbol, 230); type = getTypeFromTypeNode(declaration.type); } if (popTypeResolution()) { @@ -24098,7 +25681,7 @@ var ts; if (typeParameters) { links.typeParameters = typeParameters; links.instantiations = ts.createMap(); - links.instantiations[getTypeListId(typeParameters)] = type; + links.instantiations.set(getTypeListId(typeParameters), type); } } else { @@ -24115,14 +25698,14 @@ var ts; return !ts.isInAmbientContext(member); } return expr.kind === 8 || - expr.kind === 190 && expr.operator === 37 && + expr.kind === 191 && expr.operator === 37 && expr.operand.kind === 8 || - expr.kind === 70 && !!symbol.exports[expr.text]; + expr.kind === 70 && !!symbol.exports.get(expr.text); } function enumHasLiteralMembers(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 229) { + if (declaration.kind === 231) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (!isLiteralEnumMember(symbol, member)) { @@ -24147,10 +25730,10 @@ var ts; enumType.symbol = symbol; if (enumHasLiteralMembers(symbol)) { var memberTypeList = []; - var memberTypes = ts.createMap(); + var memberTypes = []; for (var _i = 0, _a = enumType.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 229) { + if (declaration.kind === 231) { computeEnumMemberValues(declaration); for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; @@ -24167,7 +25750,7 @@ var ts; if (memberTypeList.length > 1) { enumType.flags |= 65536; enumType.types = memberTypeList; - unionTypes[getTypeListId(memberTypeList)] = enumType; + unionTypes.set(getTypeListId(memberTypeList), enumType); } } } @@ -24188,9 +25771,6 @@ var ts; if (!links.declaredType) { var type = createType(16384); type.symbol = symbol; - if (!ts.getDeclarationOfKind(symbol, 143).constraint) { - type.constraint = noConstraintType; - } links.declaredType = type; } return links.declaredType; @@ -24203,7 +25783,6 @@ var ts; return links.declaredType; } function getDeclaredTypeOfSymbol(symbol) { - ts.Debug.assert((symbol.flags & 16777216) === 0); if (symbol.flags & (32 | 64)) { return getDeclaredTypeOfClassOrInterface(symbol); } @@ -24238,19 +25817,20 @@ var ts; function isIndependentType(node) { switch (node.kind) { case 118: - case 134: + case 135: case 132: case 121: - case 135: + case 136: + case 133: case 104: - case 137: + case 138: case 94: case 129: - case 171: + case 172: return true; - case 162: + case 163: return isIndependentType(node.elementType); - case 157: + case 158: return isIndependentTypeReference(node); } return false; @@ -24259,7 +25839,7 @@ var ts; return node.type && isIndependentType(node.type) || !node.type && !node.initializer; } function isIndependentFunctionLikeDeclaration(node) { - if (node.kind !== 150 && (!node.type || !isIndependentType(node.type))) { + if (node.kind !== 151 && (!node.type || !isIndependentType(node.type))) { return false; } for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { @@ -24275,12 +25855,12 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 147: - case 146: - return isIndependentVariableLikeDeclaration(declaration); - case 149: case 148: + case 147: + return isIndependentVariableLikeDeclaration(declaration); case 150: + case 149: + case 151: return isIndependentFunctionLikeDeclaration(declaration); } } @@ -24291,7 +25871,7 @@ var ts; var result = ts.createMap(); for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) { var symbol = symbols_1[_i]; - result[symbol.name] = symbol; + result.set(symbol.name, symbol); } return result; } @@ -24299,15 +25879,15 @@ var ts; var result = ts.createMap(); for (var _i = 0, symbols_2 = symbols; _i < symbols_2.length; _i++) { var symbol = symbols_2[_i]; - result[symbol.name] = mappingThisOnly && isIndependentMember(symbol) ? symbol : instantiateSymbol(symbol, mapper); + result.set(symbol.name, mappingThisOnly && isIndependentMember(symbol) ? symbol : instantiateSymbol(symbol, mapper)); } return result; } function addInheritedMembers(symbols, baseSymbols) { for (var _i = 0, baseSymbols_1 = baseSymbols; _i < baseSymbols_1.length; _i++) { var s = baseSymbols_1[_i]; - if (!symbols[s.name]) { - symbols[s.name] = s; + if (!symbols.has(s.name)) { + symbols.set(s.name, s); } } } @@ -24315,8 +25895,8 @@ var ts; if (!type.declaredProperties) { var symbol = type.symbol; type.declaredProperties = getNamedMembers(symbol.members); - type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); - type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); + type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members.get("__call")); + type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members.get("__new")); type.declaredStringIndexInfo = getIndexInfoOfSymbol(symbol, 0); type.declaredNumberIndexInfo = getIndexInfoOfSymbol(symbol, 1); } @@ -24324,7 +25904,14 @@ var ts; } function getTypeWithThisArgument(type, thisArgument) { if (getObjectFlags(type) & 4) { - return createTypeReference(type.target, ts.concatenate(type.typeArguments, [thisArgument || type.target.thisType])); + var target = type.target; + var typeArguments = type.typeArguments; + if (ts.length(target.typeParameters) === ts.length(typeArguments)) { + return createTypeReference(target, ts.concatenate(typeArguments, [thisArgument || target.thisType])); + } + } + else if (type.flags & 131072) { + return getIntersectionType(ts.map(type.types, function (t) { return getTypeWithThisArgument(t, thisArgument); })); } return type; } @@ -24360,10 +25947,14 @@ var ts; for (var _i = 0, baseTypes_1 = baseTypes; _i < baseTypes_1.length; _i++) { var baseType = baseTypes_1[_i]; var instantiatedBaseType = thisArgument ? getTypeWithThisArgument(instantiateType(baseType, mapper), thisArgument) : baseType; - addInheritedMembers(members, getPropertiesOfObjectType(instantiatedBaseType)); + addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType)); callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0)); constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1)); - stringIndexInfo = stringIndexInfo || getIndexInfoOfType(instantiatedBaseType, 0); + if (!stringIndexInfo) { + stringIndexInfo = instantiatedBaseType === anyType ? + createIndexInfo(anyType, false) : + getIndexInfoOfType(instantiatedBaseType, 0); + } numberIndexInfo = numberIndexInfo || getIndexInfoOfType(instantiatedBaseType, 1); } } @@ -24402,14 +25993,16 @@ var ts; return [createSignature(undefined, classType.localTypeParameters, undefined, emptyArray, classType, undefined, 0, false, false)]; } var baseTypeNode = getBaseTypeNodeOfClass(classType); + var isJavaScript = ts.isInJavaScriptFile(baseTypeNode); var typeArguments = ts.map(baseTypeNode.typeArguments, getTypeFromTypeNode); - var typeArgCount = typeArguments ? typeArguments.length : 0; + var typeArgCount = ts.length(typeArguments); var result = []; for (var _i = 0, baseSignatures_1 = baseSignatures; _i < baseSignatures_1.length; _i++) { var baseSig = baseSignatures_1[_i]; - var typeParamCount = baseSig.typeParameters ? baseSig.typeParameters.length : 0; - if (typeParamCount === typeArgCount) { - var sig = typeParamCount ? createSignatureInstantiation(baseSig, typeArguments) : cloneSignature(baseSig); + var minTypeArgumentCount = getMinTypeArgumentCount(baseSig.typeParameters); + var typeParamCount = ts.length(baseSig.typeParameters); + if ((isJavaScript || typeArgCount >= minTypeArgumentCount) && typeArgCount <= typeParamCount) { + var sig = typeParamCount ? createSignatureInstantiation(baseSig, fillMissingTypeArguments(typeArguments, baseSig.typeParameters, minTypeArgumentCount, baseTypeNode)) : cloneSignature(baseSig); sig.typeParameters = classType.localTypeParameters; sig.resolvedReturnType = classType; result.push(sig); @@ -24463,7 +26056,7 @@ var ts; s = cloneSignature(signature); if (ts.forEach(unionSignatures, function (sig) { return sig.thisParameter; })) { var thisType = getUnionType(ts.map(unionSignatures, function (sig) { return getTypeOfSymbol(sig.thisParameter) || anyType; }), true); - s.thisParameter = createTransientSymbol(signature.thisParameter, thisType); + s.thisParameter = createSymbolWithType(signature.thisParameter, thisType); } s.resolvedReturnType = undefined; s.unionSignatures = unionSignatures; @@ -24478,8 +26071,8 @@ var ts; function getUnionIndexInfo(types, kind) { var indexTypes = []; var isAnyReadonly = false; - for (var _i = 0, types_1 = types; _i < types_1.length; _i++) { - var type = types_1[_i]; + for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { + var type = types_2[_i]; var indexInfo = getIndexInfoOfType(type, kind); if (!indexInfo) { return undefined; @@ -24505,17 +26098,44 @@ var ts; function unionSpreadIndexInfos(info1, info2) { return info1 && info2 && createIndexInfo(getUnionType([info1.type, info2.type]), info1.isReadonly || info2.isReadonly); } + function includeMixinType(type, types, index) { + var mixedTypes = []; + for (var i = 0; i < types.length; i++) { + if (i === index) { + mixedTypes.push(type); + } + else if (isMixinConstructorType(types[i])) { + mixedTypes.push(getReturnTypeOfSignature(getSignaturesOfType(types[i], 1)[0])); + } + } + return getIntersectionType(mixedTypes); + } function resolveIntersectionTypeMembers(type) { var callSignatures = emptyArray; var constructSignatures = emptyArray; - var stringIndexInfo = undefined; - var numberIndexInfo = undefined; - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var t = _a[_i]; + var stringIndexInfo; + var numberIndexInfo; + var types = type.types; + var mixinCount = ts.countWhere(types, isMixinConstructorType); + var _loop_3 = function (i) { + var t = type.types[i]; + if (mixinCount === 0 || mixinCount === types.length && i === 0 || !isMixinConstructorType(t)) { + var signatures = getSignaturesOfType(t, 1); + if (signatures.length && mixinCount > 0) { + signatures = ts.map(signatures, function (s) { + var clone = cloneSignature(s); + clone.resolvedReturnType = includeMixinType(getReturnTypeOfSignature(s), types, i); + return clone; + }); + } + constructSignatures = ts.concatenate(constructSignatures, signatures); + } callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(t, 0)); - constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(t, 1)); stringIndexInfo = intersectIndexInfos(stringIndexInfo, getIndexInfoOfType(t, 0)); numberIndexInfo = intersectIndexInfos(numberIndexInfo, getIndexInfoOfType(t, 1)); + }; + for (var i = 0; i < types.length; i++) { + _loop_3(i); } setStructuredTypeMembers(type, emptySymbols, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo); } @@ -24531,8 +26151,8 @@ var ts; } else if (symbol.flags & 2048) { var members = symbol.members; - var callSignatures = getSignaturesOfSymbol(members["__call"]); - var constructSignatures = getSignaturesOfSymbol(members["__new"]); + var callSignatures = getSignaturesOfSymbol(members.get("__call")); + var constructSignatures = getSignaturesOfSymbol(members.get("__new")); var stringIndexInfo = getIndexInfoOfSymbol(symbol, 0); var numberIndexInfo = getIndexInfoOfSymbol(symbol, 1); setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo); @@ -24540,23 +26160,27 @@ var ts; else { var members = emptySymbols; var constructSignatures = emptyArray; - if (symbol.flags & 1952) { + var stringIndexInfo = undefined; + if (symbol.exports) { members = getExportsOfSymbol(symbol); } if (symbol.flags & 32) { var classType = getDeclaredTypeOfClassOrInterface(symbol); - constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); + constructSignatures = getSignaturesOfSymbol(symbol.members.get("__constructor")); if (!constructSignatures.length) { constructSignatures = getDefaultConstructSignatures(classType); } var baseConstructorType = getBaseConstructorTypeOfClass(classType); - if (baseConstructorType.flags & 32768) { + if (baseConstructorType.flags & (32768 | 131072 | 540672)) { members = createSymbolTable(getNamedMembers(members)); - addInheritedMembers(members, getPropertiesOfObjectType(baseConstructorType)); + addInheritedMembers(members, getPropertiesOfType(baseConstructorType)); + } + else if (baseConstructorType === anyType) { + stringIndexInfo = createIndexInfo(anyType, false); } } var numberIndexInfo = symbol.flags & 384 ? enumNumberIndexInfo : undefined; - setStructuredTypeMembers(type, members, emptyArray, constructSignatures, undefined, numberIndexInfo); + setStructuredTypeMembers(type, members, emptyArray, constructSignatures, stringIndexInfo, numberIndexInfo); if (symbol.flags & (16 | 8192)) { type.callSignatures = getSignaturesOfSymbol(symbol); } @@ -24565,37 +26189,48 @@ var ts; function resolveMappedTypeMembers(type) { var members = ts.createMap(); var stringIndexInfo; - var numberIndexInfo; setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, undefined, undefined); var typeParameter = getTypeParameterFromMappedType(type); var constraintType = getConstraintTypeFromMappedType(type); var templateType = getTemplateTypeFromMappedType(type); - var isReadonly = !!type.declaration.readonlyToken; - var isOptional = !!type.declaration.questionToken; - var keyType = constraintType.flags & 16384 ? getApparentType(constraintType) : constraintType; - var iterationType = keyType.flags & 262144 ? getIndexType(getApparentType(keyType.type)) : keyType; - forEachType(iterationType, function (t) { - var iterationMapper = createUnaryTypeMapper(typeParameter, t); + var modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); + var templateReadonly = !!type.declaration.readonlyToken; + var templateOptional = !!type.declaration.questionToken; + if (type.declaration.typeParameter.constraint.kind === 169) { + for (var _i = 0, _a = getPropertiesOfType(modifiersType); _i < _a.length; _i++) { + var propertySymbol = _a[_i]; + addMemberForKeyType(getLiteralTypeFromPropertyName(propertySymbol), propertySymbol); + } + if (getIndexInfoOfType(modifiersType, 0)) { + addMemberForKeyType(stringType); + } + } + else { + var keyType = constraintType.flags & 540672 ? getApparentType(constraintType) : constraintType; + var iterationType = keyType.flags & 262144 ? getIndexType(getApparentType(keyType.type)) : keyType; + forEachType(iterationType, addMemberForKeyType); + } + setStructuredTypeMembers(type, members, emptyArray, emptyArray, stringIndexInfo, undefined); + function addMemberForKeyType(t, propertySymbol) { + var iterationMapper = createTypeMapper([typeParameter], [t]); var templateMapper = type.mapper ? combineTypeMappers(type.mapper, iterationMapper) : iterationMapper; var propType = instantiateType(templateType, templateMapper); - if (t.flags & (32 | 64 | 256)) { + if (t.flags & 32) { var propName = t.text; - var prop = createSymbol(4 | 67108864 | (isOptional ? 536870912 : 0), propName); - prop.type = addOptionality(propType, isOptional); - prop.isReadonly = isReadonly; - members[propName] = prop; + var modifiersProp = getPropertyOfType(modifiersType, propName); + var isOptional = templateOptional || !!(modifiersProp && modifiersProp.flags & 67108864); + var prop = createSymbol(4 | (isOptional ? 67108864 : 0), propName); + prop.checkFlags = templateReadonly || modifiersProp && isReadonlySymbol(modifiersProp) ? 8 : 0; + prop.type = propType; + if (propertySymbol) { + prop.syntheticOrigin = propertySymbol; + } + members.set(propName, prop); } else if (t.flags & 2) { - stringIndexInfo = createIndexInfo(propType, isReadonly); + stringIndexInfo = createIndexInfo(propType, templateReadonly); } - else if (t.flags & 4) { - numberIndexInfo = createIndexInfo(propType, isReadonly); - } - }); - if (stringIndexInfo && numberIndexInfo && isTypeIdenticalTo(stringIndexInfo.type, numberIndexInfo.type)) { - numberIndexInfo = undefined; } - setStructuredTypeMembers(type, members, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo); } function getTypeParameterFromMappedType(type) { return type.typeParameter || @@ -24608,16 +26243,28 @@ var ts; function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? - instantiateType(getTypeFromTypeNode(type.declaration.type), type.mapper || identityMapper) : + instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!type.declaration.questionToken), type.mapper || identityMapper) : unknownType); } - function getErasedTemplateTypeFromMappedType(type) { - return instantiateType(getTemplateTypeFromMappedType(type), createUnaryTypeMapper(getTypeParameterFromMappedType(type), anyType)); + function getModifiersTypeFromMappedType(type) { + if (!type.modifiersType) { + var constraintDeclaration = type.declaration.typeParameter.constraint; + if (constraintDeclaration.kind === 169) { + type.modifiersType = instantiateType(getTypeFromTypeNode(constraintDeclaration.type), type.mapper || identityMapper); + } + else { + var declaredType = getTypeFromMappedTypeNode(type.declaration); + var constraint = getConstraintTypeFromMappedType(declaredType); + var extendedConstraint = constraint && constraint.flags & 16384 ? getConstraintOfTypeParameter(constraint) : constraint; + type.modifiersType = extendedConstraint && extendedConstraint.flags & 262144 ? instantiateType(extendedConstraint.type, type.mapper || identityMapper) : emptyObjectType; + } + } + return type.modifiersType; } function isGenericMappedType(type) { if (getObjectFlags(type) & 32) { var constraintType = getConstraintTypeFromMappedType(type); - return !!(constraintType.flags & (16384 | 262144)); + return maybeTypeOfKind(constraintType, 540672 | 262144); } return false; } @@ -24655,35 +26302,33 @@ var ts; function getPropertyOfObjectType(type, name) { if (type.flags & 32768) { var resolved = resolveStructuredTypeMembers(type); - var symbol = resolved.members[name]; + var symbol = resolved.members.get(name); if (symbol && symbolIsValue(symbol)) { return symbol; } } } function getPropertiesOfUnionOrIntersectionType(type) { - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var current = _a[_i]; - for (var _b = 0, _c = getPropertiesOfType(current); _b < _c.length; _b++) { - var prop = _c[_b]; - getUnionOrIntersectionProperty(type, prop.name); - } - if (type.flags & 65536) { - break; - } - } - var props = type.resolvedProperties; - if (props) { - var result = []; - for (var key in props) { - var prop = props[key]; - if (!(prop.flags & 268435456 && prop.isPartial)) { - result.push(prop); + if (!type.resolvedProperties) { + var members = ts.createMap(); + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var current = _a[_i]; + for (var _b = 0, _c = getPropertiesOfType(current); _b < _c.length; _b++) { + var prop = _c[_b]; + if (!members.has(prop.name)) { + var combinedProp = getPropertyOfUnionOrIntersectionType(type, prop.name); + if (combinedProp) { + members.set(prop.name, combinedProp); + } + } + } + if (type.flags & 65536) { + break; } } - return result; + type.resolvedProperties = getNamedMembers(members); } - return emptyArray; + return type.resolvedProperties; } function getPropertiesOfType(type) { type = getApparentType(type); @@ -24691,41 +26336,126 @@ var ts; getPropertiesOfUnionOrIntersectionType(type) : getPropertiesOfObjectType(type); } - function getApparentTypeOfTypeParameter(type) { - if (!type.resolvedApparentType) { - var constraintType = getConstraintOfTypeParameter(type); - while (constraintType && constraintType.flags & 16384) { - constraintType = getConstraintOfTypeParameter(constraintType); - } - type.resolvedApparentType = getTypeWithThisArgument(constraintType || emptyObjectType, type); - } - return type.resolvedApparentType; + function getConstraintOfType(type) { + return type.flags & 16384 ? getConstraintOfTypeParameter(type) : + type.flags & 524288 ? getConstraintOfIndexedAccess(type) : + getBaseConstraintOfType(type); } - function getApparentTypeOfIndexedAccess(type) { - return getIndexTypeOfType(getApparentType(type.objectType), 0) || type; + function getConstraintOfTypeParameter(typeParameter) { + return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : undefined; + } + function getConstraintOfIndexedAccess(type) { + var baseObjectType = getBaseConstraintOfType(type.objectType); + var baseIndexType = getBaseConstraintOfType(type.indexType); + return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined; + } + function getBaseConstraintOfType(type) { + if (type.flags & (540672 | 196608)) { + var constraint = getResolvedBaseConstraint(type); + if (constraint !== noConstraintType && constraint !== circularConstraintType) { + return constraint; + } + } + else if (type.flags & 262144) { + return stringType; + } + return undefined; + } + function hasNonCircularBaseConstraint(type) { + return getResolvedBaseConstraint(type) !== circularConstraintType; + } + function getResolvedBaseConstraint(type) { + var typeStack; + var circular; + if (!type.resolvedBaseConstraint) { + typeStack = []; + var constraint = getBaseConstraint(type); + type.resolvedBaseConstraint = circular ? circularConstraintType : getTypeWithThisArgument(constraint || noConstraintType, type); + } + return type.resolvedBaseConstraint; + function getBaseConstraint(t) { + if (ts.contains(typeStack, t)) { + circular = true; + return undefined; + } + typeStack.push(t); + var result = computeBaseConstraint(t); + typeStack.pop(); + return result; + } + function computeBaseConstraint(t) { + if (t.flags & 16384) { + var constraint = getConstraintFromTypeParameter(t); + return t.isThisType ? constraint : + constraint ? getBaseConstraint(constraint) : undefined; + } + if (t.flags & 196608) { + var types = t.types; + var baseTypes = []; + for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { + var type_2 = types_3[_i]; + var baseType = getBaseConstraint(type_2); + if (baseType) { + baseTypes.push(baseType); + } + } + return t.flags & 65536 && baseTypes.length === types.length ? getUnionType(baseTypes) : + t.flags & 131072 && baseTypes.length ? getIntersectionType(baseTypes) : + undefined; + } + if (t.flags & 262144) { + return stringType; + } + if (t.flags & 524288) { + var baseObjectType = getBaseConstraint(t.objectType); + var baseIndexType = getBaseConstraint(t.indexType); + var baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined; + return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined; + } + return t; + } + } + function getApparentTypeOfIntersectionType(type) { + return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument(type, type)); + } + function getDefaultFromTypeParameter(typeParameter) { + if (!typeParameter.default) { + if (typeParameter.target) { + var targetDefault = getDefaultFromTypeParameter(typeParameter.target); + typeParameter.default = targetDefault ? instantiateType(targetDefault, typeParameter.mapper) : noConstraintType; + } + else { + var defaultDeclaration = typeParameter.symbol && ts.forEach(typeParameter.symbol.declarations, function (decl) { return ts.isTypeParameter(decl) && decl.default; }); + typeParameter.default = defaultDeclaration ? getTypeFromTypeNode(defaultDeclaration) : noConstraintType; + } + } + return typeParameter.default === noConstraintType ? undefined : typeParameter.default; } function getApparentType(type) { - var t = type.flags & 16384 ? getApparentTypeOfTypeParameter(type) : - type.flags & 524288 ? getApparentTypeOfIndexedAccess(type) : - type; - return t.flags & 262178 ? globalStringType : - t.flags & 340 ? globalNumberType : - t.flags & 136 ? globalBooleanType : - t.flags & 512 ? getGlobalESSymbolType() : - t; + var t = type.flags & 540672 ? getBaseConstraintOfType(type) || emptyObjectType : type; + return t.flags & 131072 ? getApparentTypeOfIntersectionType(t) : + t.flags & 262178 ? globalStringType : + t.flags & 340 ? globalNumberType : + t.flags & 136 ? globalBooleanType : + t.flags & 512 ? getGlobalESSymbolType(languageVersion >= 2) : + t.flags & 16777216 ? emptyObjectType : + t; } function createUnionOrIntersectionProperty(containingType, name) { - var types = containingType.types; var props; - var commonFlags = (containingType.flags & 131072) ? 536870912 : 0; - var isReadonly = false; - var isPartial = false; - for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { - var current = types_2[_i]; + var types = containingType.types; + var isUnion = containingType.flags & 65536; + var excludeModifiers = isUnion ? 24 : 0; + var commonFlags = isUnion ? 0 : 67108864; + var syntheticFlag = 4; + var checkFlags = 0; + for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { + var current = types_4[_i]; var type = getApparentType(current); if (type !== unknownType) { var prop = getPropertyOfType(type, name); - if (prop && !(getDeclarationModifierFlagsFromSymbol(prop) & (8 | 16))) { + var modifiers = prop ? getDeclarationModifierFlagsFromSymbol(prop) : 0; + if (prop && !(modifiers & excludeModifiers)) { commonFlags &= prop.flags; if (!props) { props = [prop]; @@ -24733,25 +26463,29 @@ var ts; else if (!ts.contains(props, prop)) { props.push(prop); } - if (isReadonlySymbol(prop)) { - isReadonly = true; + checkFlags |= (isReadonlySymbol(prop) ? 8 : 0) | + (!(modifiers & 24) ? 64 : 0) | + (modifiers & 16 ? 128 : 0) | + (modifiers & 8 ? 256 : 0) | + (modifiers & 32 ? 512 : 0); + if (!isMethodLike(prop)) { + syntheticFlag = 2; } } - else if (containingType.flags & 65536) { - isPartial = true; + else if (isUnion) { + checkFlags |= 16; } } } if (!props) { return undefined; } - if (props.length === 1 && !isPartial) { + if (props.length === 1 && !(checkFlags & 16)) { return props[0]; } var propTypes = []; var declarations = []; var commonType = undefined; - var hasNonUniformType = false; for (var _a = 0, props_1 = props; _a < props_1.length; _a++) { var prop = props_1[_a]; if (prop.declarations) { @@ -24762,39 +26496,37 @@ var ts; commonType = type; } else if (type !== commonType) { - hasNonUniformType = true; + checkFlags |= 32; } propTypes.push(type); } - var result = createSymbol(4 | 67108864 | 268435456 | commonFlags, name); + var result = createSymbol(4 | commonFlags, name); + result.checkFlags = syntheticFlag | checkFlags; result.containingType = containingType; - result.hasNonUniformType = hasNonUniformType; - result.isPartial = isPartial; result.declarations = declarations; - result.isReadonly = isReadonly; - result.type = containingType.flags & 65536 ? getUnionType(propTypes) : getIntersectionType(propTypes); + result.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes); return result; } function getUnionOrIntersectionProperty(type, name) { - var properties = type.resolvedProperties || (type.resolvedProperties = ts.createMap()); - var property = properties[name]; + var properties = type.propertyCache || (type.propertyCache = ts.createMap()); + var property = properties.get(name); if (!property) { property = createUnionOrIntersectionProperty(type, name); if (property) { - properties[name] = property; + properties.set(name, property); } } return property; } function getPropertyOfUnionOrIntersectionType(type, name) { var property = getUnionOrIntersectionProperty(type, name); - return property && !(property.flags & 268435456 && property.isPartial) ? property : undefined; + return property && !(getCheckFlags(property) & 16) ? property : undefined; } function getPropertyOfType(type, name) { type = getApparentType(type); if (type.flags & 32768) { var resolved = resolveStructuredTypeMembers(type); - var symbol = resolved.members[name]; + var symbol = resolved.members.get(name); if (symbol && symbolIsValue(symbol)) { return symbol; } @@ -24853,7 +26585,7 @@ var ts; return undefined; } function getTypeParametersFromJSDocTemplate(declaration) { - if (declaration.flags & 2097152) { + if (declaration.flags & 65536) { var templateTag = ts.getJSDocTemplateTag(declaration); if (templateTag) { return getTypeParametersFromDeclaration(templateTag.typeParameters); @@ -24873,16 +26605,16 @@ var ts; } function symbolsToArray(symbols) { var result = []; - for (var id in symbols) { + symbols.forEach(function (symbol, id) { if (!isReservedMemberName(id)) { - result.push(symbols[id]); + result.push(symbol); } - } + }); return result; } function isJSDocOptionalParameter(node) { - if (node.flags & 2097152) { - if (node.type && node.type.kind === 273) { + if (node.flags & 65536) { + if (node.type && node.type.kind === 277) { return true; } var paramTags = ts.getJSDocParameterTags(node); @@ -24893,7 +26625,7 @@ var ts; return true; } if (paramTag.typeExpression) { - return paramTag.typeExpression.type.kind === 273; + return paramTag.typeExpression.type.kind === 277; } } } @@ -24917,6 +26649,12 @@ var ts; ts.Debug.assert(parameterIndex >= 0); return parameterIndex >= signature.minArgumentCount; } + var iife = ts.getImmediatelyInvokedFunctionExpression(node.parent); + if (iife) { + return !node.type && + !node.dotDotDotToken && + ts.indexOf(node.parent.parameters, node) >= iife.arguments.length; + } return false; } function createTypePredicateFromTypePredicateNode(node) { @@ -24936,16 +26674,50 @@ var ts; }; } } + function getMinTypeArgumentCount(typeParameters) { + var minTypeArgumentCount = 0; + if (typeParameters) { + for (var i = 0; i < typeParameters.length; i++) { + if (!getDefaultFromTypeParameter(typeParameters[i])) { + minTypeArgumentCount = i + 1; + } + } + } + return minTypeArgumentCount; + } + function fillMissingTypeArguments(typeArguments, typeParameters, minTypeArgumentCount, location) { + var numTypeParameters = ts.length(typeParameters); + if (numTypeParameters) { + var numTypeArguments = ts.length(typeArguments); + var isJavaScript = ts.isInJavaScriptFile(location); + if ((isJavaScript || numTypeArguments >= minTypeArgumentCount) && numTypeArguments <= numTypeParameters) { + if (!typeArguments) { + typeArguments = []; + } + for (var i = numTypeArguments; i < numTypeParameters; i++) { + typeArguments[i] = isJavaScript ? anyType : emptyObjectType; + } + for (var i = numTypeArguments; i < numTypeParameters; i++) { + var mapper = createTypeMapper(typeParameters, typeArguments); + var defaultType = getDefaultFromTypeParameter(typeParameters[i]); + typeArguments[i] = defaultType ? instantiateType(defaultType, mapper) : isJavaScript ? anyType : emptyObjectType; + } + } + } + return typeArguments; + } function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { var parameters = []; var hasLiteralTypes = false; - var minArgumentCount = -1; + var minArgumentCount = 0; var thisParameter = undefined; var hasThisParameter = void 0; + var iife = ts.getImmediatelyInvokedFunctionExpression(declaration); var isJSConstructSignature = ts.isJSDocConstructSignature(declaration); - for (var i = isJSConstructSignature ? 1 : 0, n = declaration.parameters.length; i < n; i++) { + var isUntypedSignatureInJSFile = !iife && !isJSConstructSignature && ts.isInJavaScriptFile(declaration) && !ts.hasJSDocParameterTags(declaration); + for (var i = isJSConstructSignature ? 1 : 0; i < declaration.parameters.length; i++) { var param = declaration.parameters[i]; var paramSymbol = param.symbol; if (paramSymbol && !!(paramSymbol.flags & 4) && !ts.isBindingPattern(param.name)) { @@ -24959,41 +26731,34 @@ var ts; else { parameters.push(paramSymbol); } - if (param.type && param.type.kind === 171) { + if (param.type && param.type.kind === 172) { hasLiteralTypes = true; } - if (param.initializer || param.questionToken || param.dotDotDotToken || isJSDocOptionalParameter(param)) { - if (minArgumentCount < 0) { - minArgumentCount = i - (hasThisParameter ? 1 : 0); - } - } - else { - minArgumentCount = -1; + var isOptionalParameter_1 = param.initializer || param.questionToken || param.dotDotDotToken || + iife && parameters.length > iife.arguments.length && !param.type || + isJSDocOptionalParameter(param) || + isUntypedSignatureInJSFile; + if (!isOptionalParameter_1) { + minArgumentCount = parameters.length; } } - if ((declaration.kind === 151 || declaration.kind === 152) && + if ((declaration.kind === 152 || declaration.kind === 153) && !ts.hasDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 151 ? 152 : 151; + var otherKind = declaration.kind === 152 ? 153 : 152; var other = ts.getDeclarationOfKind(declaration.symbol, otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - if (minArgumentCount < 0) { - minArgumentCount = declaration.parameters.length - (hasThisParameter ? 1 : 0); - } - if (isJSConstructSignature) { - minArgumentCount--; - } - var classType = declaration.kind === 150 ? + var classType = declaration.kind === 151 ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : getTypeParametersFromJSDocTemplate(declaration); var returnType = getSignatureReturnTypeFromDeclaration(declaration, isJSConstructSignature, classType); - var typePredicate = declaration.type && declaration.type.kind === 156 ? + var typePredicate = declaration.type && declaration.type.kind === 157 ? createTypePredicateFromTypePredicateNode(declaration.type) : undefined; links.resolvedSignature = createSignature(declaration, typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, ts.hasRestParameter(declaration), hasLiteralTypes); @@ -25010,41 +26775,69 @@ var ts; else if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.flags & 2097152) { + if (declaration.flags & 65536) { var type = getReturnTypeFromJSDocComment(declaration); if (type && type !== unknownType) { return type; } } - if (declaration.kind === 151 && !ts.hasDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(declaration.symbol, 152); + if (declaration.kind === 152 && !ts.hasDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(declaration.symbol, 153); return getAnnotatedAccessorType(setter); } if (ts.nodeIsMissing(declaration.body)) { return anyType; } } + function containsArgumentsReference(declaration) { + var links = getNodeLinks(declaration); + if (links.containsArgumentsReference === undefined) { + if (links.flags & 8192) { + links.containsArgumentsReference = true; + } + else { + links.containsArgumentsReference = traverse(declaration.body); + } + } + return links.containsArgumentsReference; + function traverse(node) { + if (!node) + return false; + switch (node.kind) { + case 70: + return node.text === "arguments" && ts.isPartOfExpression(node); + case 148: + case 150: + case 152: + case 153: + return node.name.kind === 143 + && traverse(node.name); + default: + return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && ts.forEachChild(node, traverse); + } + } + } function getSignaturesOfSymbol(symbol) { if (!symbol) return emptyArray; var result = []; - for (var i = 0, len = symbol.declarations.length; i < len; i++) { + for (var i = 0; i < symbol.declarations.length; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 158: case 159: - case 225: - case 149: - case 148: + case 160: + case 227: case 150: - case 153: + case 149: + case 151: case 154: case 155: - case 151: + case 156: case 152: - case 184: + case 153: case 185: - case 274: + case 186: + case 278: if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -25088,7 +26881,7 @@ var ts; } if (!popTypeResolution()) { type = anyType; - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { var declaration = signature.declaration; if (declaration.name) { error(declaration.name, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, ts.declarationNameToString(declaration.name)); @@ -25112,9 +26905,14 @@ var ts; return anyType; } function getSignatureInstantiation(signature, typeArguments) { + typeArguments = fillMissingTypeArguments(typeArguments, signature.typeParameters, getMinTypeArgumentCount(signature.typeParameters)); var instantiations = signature.instantiations || (signature.instantiations = ts.createMap()); var id = getTypeListId(typeArguments); - return instantiations[id] || (instantiations[id] = createSignatureInstantiation(signature, typeArguments)); + var instantiation = instantiations.get(id); + if (!instantiation) { + instantiations.set(id, instantiation = createSignatureInstantiation(signature, typeArguments)); + } + return instantiation; } function createSignatureInstantiation(signature, typeArguments) { return instantiateSignature(signature, createTypeMapper(signature.typeParameters, typeArguments), true); @@ -25129,7 +26927,7 @@ var ts; } function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 150 || signature.declaration.kind === 154; + var isConstructor = signature.declaration.kind === 151 || signature.declaration.kind === 155; var type = createObjectType(16); type.members = emptySymbols; type.properties = emptyArray; @@ -25140,10 +26938,10 @@ var ts; return signature.isolatedSignatureType; } function getIndexSymbol(symbol) { - return symbol.members["__index"]; + return symbol.members.get("__index"); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 ? 132 : 134; + var syntaxKind = kind === 1 ? 132 : 135; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -25170,21 +26968,9 @@ var ts; return undefined; } function getConstraintDeclaration(type) { - return ts.getDeclarationOfKind(type.symbol, 143).constraint; + return ts.getDeclarationOfKind(type.symbol, 144).constraint; } - function hasConstraintReferenceTo(type, target) { - var checked; - while (type && type.flags & 16384 && !(type.isThisType) && !ts.contains(checked, type)) { - if (type === target) { - return true; - } - (checked || (checked = [])).push(type); - var constraintDeclaration = getConstraintDeclaration(type); - type = constraintDeclaration && getTypeFromTypeNode(constraintDeclaration); - } - return false; - } - function getConstraintOfTypeParameter(typeParameter) { + function getConstraintFromTypeParameter(typeParameter) { if (!typeParameter.constraint) { if (typeParameter.target) { var targetConstraint = getConstraintOfTypeParameter(typeParameter.target); @@ -25192,28 +26978,23 @@ var ts; } else { var constraintDeclaration = getConstraintDeclaration(typeParameter); - var constraint = getTypeFromTypeNode(constraintDeclaration); - if (hasConstraintReferenceTo(constraint, typeParameter)) { - error(constraintDeclaration, ts.Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(typeParameter)); - constraint = unknownType; - } - typeParameter.constraint = constraint; + typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : noConstraintType; } } return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 143).parent); + return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 144).parent); } function getTypeListId(types) { var result = ""; if (types) { - var length_3 = types.length; + var length_4 = types.length; var i = 0; - while (i < length_3) { + while (i < length_4) { var startId = types[i].id; var count = 1; - while (i + count < length_3 && types[i + count].id === startId + count) { + while (i + count < length_4 && types[i + count].id === startId + count) { count++; } if (result.length) { @@ -25230,8 +27011,8 @@ var ts; } function getPropagatingFlagsOfTypes(types, excludeKinds) { var result = 0; - for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { - var type = types_3[_i]; + for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { + var type = types_5[_i]; if (!(type.flags & excludeKinds)) { result |= type.flags; } @@ -25240,9 +27021,10 @@ var ts; } function createTypeReference(target, typeArguments) { var id = getTypeListId(typeArguments); - var type = target.instantiations[id]; + var type = target.instantiations.get(id); if (!type) { - type = target.instantiations[id] = createObjectType(4, target.symbol); + type = createObjectType(4, target.symbol); + target.instantiations.set(id, type); type.flags |= typeArguments ? getPropagatingFlagsOfTypes(typeArguments, 0) : 0; type.target = target; type.typeArguments = typeArguments; @@ -25258,17 +27040,22 @@ var ts; return type; } function getTypeReferenceArity(type) { - return type.target.typeParameters ? type.target.typeParameters.length : 0; + return ts.length(type.target.typeParameters); } function getTypeFromClassOrInterfaceReference(node, symbol) { var type = getDeclaredTypeOfSymbol(getMergedSymbol(symbol)); var typeParameters = type.localTypeParameters; if (typeParameters) { - if (!node.typeArguments || node.typeArguments.length !== typeParameters.length) { - error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, undefined, 1), typeParameters.length); + var numTypeArguments = ts.length(node.typeArguments); + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + if (!ts.isInJavaScriptFile(node) && (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length)) { + error(node, minTypeArgumentCount === typeParameters.length + ? ts.Diagnostics.Generic_type_0_requires_1_type_argument_s + : ts.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments, typeToString(type, undefined, 1), minTypeArgumentCount, typeParameters.length); return unknownType; } - return createTypeReference(type, ts.concatenate(type.outerTypeParameters, ts.map(node.typeArguments, getTypeFromTypeNode))); + var typeArguments = ts.concatenate(type.outerTypeParameters, fillMissingTypeArguments(ts.map(node.typeArguments, getTypeFromTypeNode), typeParameters, minTypeArgumentCount, node)); + return createTypeReference(type, typeArguments); } if (node.typeArguments) { error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); @@ -25281,14 +27068,22 @@ var ts; var links = getSymbolLinks(symbol); var typeParameters = links.typeParameters; var id = getTypeListId(typeArguments); - return links.instantiations[id] || (links.instantiations[id] = instantiateTypeNoAlias(type, createTypeMapper(typeParameters, typeArguments))); + var instantiation = links.instantiations.get(id); + if (!instantiation) { + links.instantiations.set(id, instantiation = instantiateTypeNoAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters))))); + } + return instantiation; } function getTypeFromTypeAliasReference(node, symbol) { var type = getDeclaredTypeOfSymbol(symbol); var typeParameters = getSymbolLinks(symbol).typeParameters; if (typeParameters) { - if (!node.typeArguments || node.typeArguments.length !== typeParameters.length) { - error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, symbolToString(symbol), typeParameters.length); + var numTypeArguments = ts.length(node.typeArguments); + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + if (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length) { + error(node, minTypeArgumentCount === typeParameters.length + ? ts.Diagnostics.Generic_type_0_requires_1_type_argument_s + : ts.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments, symbolToString(symbol), minTypeArgumentCount, typeParameters.length); return unknownType; } var typeArguments = ts.map(node.typeArguments, getTypeFromTypeNode); @@ -25309,11 +27104,11 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 157: + case 158: return node.typeName; - case 272: + case 276: return node.name; - case 199: + case 200: var expr = node.expression; if (ts.isEntityNameExpression(expr)) { return expr; @@ -25337,23 +27132,58 @@ var ts; if (symbol.flags & 524288) { return getTypeFromTypeAliasReference(node, symbol); } - if (symbol.flags & 107455 && node.kind === 272) { + if (symbol.flags & 107455 && node.kind === 276) { return getTypeOfSymbol(symbol); } return getTypeFromNonGenericTypeReference(node, symbol); } + function getPrimitiveTypeFromJSDocTypeReference(node) { + if (ts.isIdentifier(node.name)) { + switch (node.name.text) { + case "String": + return stringType; + case "Number": + return numberType; + case "Boolean": + return booleanType; + case "Void": + return voidType; + case "Undefined": + return undefinedType; + case "Null": + return nullType; + case "Object": + return anyType; + case "Function": + return anyFunctionType; + case "Array": + case "array": + return !node.typeArguments || !node.typeArguments.length ? createArrayType(anyType) : undefined; + case "Promise": + case "promise": + return !node.typeArguments || !node.typeArguments.length ? createPromiseType(anyType) : undefined; + } + } + } + function getTypeFromJSDocNullableTypeNode(node) { + var type = getTypeFromTypeNode(node.type); + return strictNullChecks ? getUnionType([type, nullType]) : type; + } function getTypeFromTypeReference(node) { var links = getNodeLinks(node); if (!links.resolvedType) { var symbol = void 0; var type = void 0; - if (node.kind === 272) { - var typeReferenceName = getTypeReferenceName(node); - symbol = resolveTypeReferenceName(typeReferenceName); - type = getTypeReferenceType(node, symbol); + if (node.kind === 276) { + type = getPrimitiveTypeFromJSDocTypeReference(node); + if (!type) { + var typeReferenceName = getTypeReferenceName(node); + symbol = resolveTypeReferenceName(typeReferenceName); + type = getTypeReferenceType(node, symbol); + } } else { - var typeNameOrExpression = node.kind === 157 + var typeNameOrExpression = node.kind === 158 ? node.typeName : ts.isEntityNameExpression(node.expression) ? node.expression @@ -25379,12 +27209,12 @@ var ts; function getTypeOfGlobalSymbol(symbol, arity) { function getTypeDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { - var declaration = declarations_3[_i]; + for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { + var declaration = declarations_4[_i]; switch (declaration.kind) { - case 226: - case 227: + case 228: case 229: + case 231: return declaration; } } @@ -25397,44 +27227,91 @@ var ts; error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbol.name); return arity ? emptyGenericType : emptyObjectType; } - if ((type.typeParameters ? type.typeParameters.length : 0) !== arity) { + if (ts.length(type.typeParameters) !== arity) { error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_have_1_type_parameter_s, symbol.name, arity); return arity ? emptyGenericType : emptyObjectType; } return type; } - function getGlobalValueSymbol(name) { - return getGlobalSymbol(name, 107455, ts.Diagnostics.Cannot_find_global_value_0); + function getGlobalValueSymbol(name, reportErrors) { + return getGlobalSymbol(name, 107455, reportErrors ? ts.Diagnostics.Cannot_find_global_value_0 : undefined); } - function getGlobalTypeSymbol(name) { - return getGlobalSymbol(name, 793064, ts.Diagnostics.Cannot_find_global_type_0); + function getGlobalTypeSymbol(name, reportErrors) { + return getGlobalSymbol(name, 793064, reportErrors ? ts.Diagnostics.Cannot_find_global_type_0 : undefined); } function getGlobalSymbol(name, meaning, diagnostic) { return resolveName(undefined, name, meaning, diagnostic, name); } - function getGlobalType(name, arity) { + function getGlobalType(name, arity, reportErrors) { + var symbol = getGlobalTypeSymbol(name, reportErrors); + return symbol || reportErrors ? getTypeOfGlobalSymbol(symbol, arity) : undefined; + } + function getGlobalTypedPropertyDescriptorType() { + return deferredGlobalTypedPropertyDescriptorType || (deferredGlobalTypedPropertyDescriptorType = getGlobalType("TypedPropertyDescriptor", 1, true)) || emptyGenericType; + } + function getGlobalTemplateStringsArrayType() { + return deferredGlobalTemplateStringsArrayType || (deferredGlobalTemplateStringsArrayType = getGlobalType("TemplateStringsArray", 0, true)) || emptyObjectType; + } + function getGlobalESSymbolConstructorSymbol(reportErrors) { + return deferredGlobalESSymbolConstructorSymbol || (deferredGlobalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol", reportErrors)); + } + function getGlobalESSymbolType(reportErrors) { + return deferredGlobalESSymbolType || (deferredGlobalESSymbolType = getGlobalType("Symbol", 0, reportErrors)) || emptyObjectType; + } + function getGlobalPromiseType(reportErrors) { + return deferredGlobalPromiseType || (deferredGlobalPromiseType = getGlobalType("Promise", 1, reportErrors)) || emptyGenericType; + } + function getGlobalPromiseConstructorSymbol(reportErrors) { + return deferredGlobalPromiseConstructorSymbol || (deferredGlobalPromiseConstructorSymbol = getGlobalValueSymbol("Promise", reportErrors)); + } + function getGlobalPromiseConstructorLikeType(reportErrors) { + return deferredGlobalPromiseConstructorLikeType || (deferredGlobalPromiseConstructorLikeType = getGlobalType("PromiseConstructorLike", 0, reportErrors)) || emptyObjectType; + } + function getGlobalAsyncIterableType(reportErrors) { + return deferredGlobalAsyncIterableType || (deferredGlobalAsyncIterableType = getGlobalType("AsyncIterable", 1, reportErrors)) || emptyGenericType; + } + function getGlobalAsyncIteratorType(reportErrors) { + return deferredGlobalAsyncIteratorType || (deferredGlobalAsyncIteratorType = getGlobalType("AsyncIterator", 1, reportErrors)) || emptyGenericType; + } + function getGlobalAsyncIterableIteratorType(reportErrors) { + return deferredGlobalAsyncIterableIteratorType || (deferredGlobalAsyncIterableIteratorType = getGlobalType("AsyncIterableIterator", 1, reportErrors)) || emptyGenericType; + } + function getGlobalIterableType(reportErrors) { + return deferredGlobalIterableType || (deferredGlobalIterableType = getGlobalType("Iterable", 1, reportErrors)) || emptyGenericType; + } + function getGlobalIteratorType(reportErrors) { + return deferredGlobalIteratorType || (deferredGlobalIteratorType = getGlobalType("Iterator", 1, reportErrors)) || emptyGenericType; + } + function getGlobalIterableIteratorType(reportErrors) { + return deferredGlobalIterableIteratorType || (deferredGlobalIterableIteratorType = getGlobalType("IterableIterator", 1, reportErrors)) || emptyGenericType; + } + function getGlobalTypeOrUndefined(name, arity) { if (arity === void 0) { arity = 0; } - return getTypeOfGlobalSymbol(getGlobalTypeSymbol(name), arity); + var symbol = getGlobalSymbol(name, 793064, undefined); + return symbol && getTypeOfGlobalSymbol(symbol, arity); } function getExportedTypeFromNamespace(namespace, name) { var namespaceSymbol = getGlobalSymbol(namespace, 1920, undefined); var typeSymbol = namespaceSymbol && getSymbol(namespaceSymbol.exports, name, 793064); return typeSymbol && getDeclaredTypeOfSymbol(typeSymbol); } - function createTypedPropertyDescriptorType(propertyType) { - var globalTypedPropertyDescriptorType = getGlobalTypedPropertyDescriptorType(); - return globalTypedPropertyDescriptorType !== emptyGenericType - ? createTypeReference(globalTypedPropertyDescriptorType, [propertyType]) - : emptyObjectType; - } function createTypeFromGenericGlobalType(genericGlobalType, typeArguments) { return genericGlobalType !== emptyGenericType ? createTypeReference(genericGlobalType, typeArguments) : emptyObjectType; } - function createIterableType(elementType) { - return createTypeFromGenericGlobalType(getGlobalIterableType(), [elementType]); + function createTypedPropertyDescriptorType(propertyType) { + return createTypeFromGenericGlobalType(getGlobalTypedPropertyDescriptorType(), [propertyType]); } - function createIterableIteratorType(elementType) { - return createTypeFromGenericGlobalType(getGlobalIterableIteratorType(), [elementType]); + function createAsyncIterableType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalAsyncIterableType(true), [iteratedType]); + } + function createAsyncIterableIteratorType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalAsyncIterableIteratorType(true), [iteratedType]); + } + function createIterableType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalIterableType(true), [iteratedType]); + } + function createIterableIteratorType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalIterableIteratorType(true), [iteratedType]); } function createArrayType(elementType) { return createTypeFromGenericGlobalType(globalArrayType, [elementType]); @@ -25452,7 +27329,7 @@ var ts; for (var i = 0; i < arity; i++) { var typeParameter = createType(16384); typeParameters.push(typeParameter); - var property = createSymbol(4 | 67108864, "" + i); + var property = createSymbol(4, "" + i); property.type = typeParameter; properties.push(property); } @@ -25461,7 +27338,7 @@ var ts; type.outerTypeParameters = undefined; type.localTypeParameters = typeParameters; type.instantiations = ts.createMap(); - type.instantiations[getTypeListId(type.typeParameters)] = type; + type.instantiations.set(getTypeListId(type.typeParameters), type); type.target = type; type.typeArguments = type.typeParameters; type.thisType = createType(16384); @@ -25543,14 +27420,14 @@ var ts; } } function addTypesToUnion(typeSet, types) { - for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { - var type = types_4[_i]; + for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { + var type = types_6[_i]; addTypeToUnion(typeSet, type); } } function containsIdenticalType(types, type) { - for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { - var t = types_5[_i]; + for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { + var t = types_7[_i]; if (isTypeIdenticalTo(t, type)) { return true; } @@ -25558,8 +27435,9 @@ var ts; return false; } function isSubtypeOfAny(candidate, types) { - for (var i = 0, len = types.length; i < len; i++) { - if (candidate !== types[i] && isTypeSubtypeOf(candidate, types[i])) { + for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { + var type = types_8[_i]; + if (candidate !== type && isTypeSubtypeOf(candidate, type)) { return true; } } @@ -25637,10 +27515,11 @@ var ts; return types[0]; } var id = getTypeListId(types); - var type = unionTypes[id]; + var type = unionTypes.get(id); if (!type) { var propagatedFlags = getPropagatingFlagsOfTypes(types, 6144); - type = unionTypes[id] = createType(65536 | propagatedFlags); + type = createType(65536 | propagatedFlags); + unionTypes.set(id, type); type.types = types; type.aliasSymbol = aliasSymbol; type.aliasTypeArguments = aliasTypeArguments; @@ -25661,13 +27540,25 @@ var ts; else if (type.flags & 1) { typeSet.containsAny = true; } + else if (getObjectFlags(type) & 16 && isEmptyObjectType(type)) { + typeSet.containsEmptyObject = true; + } else if (!(type.flags & 8192) && (strictNullChecks || !(type.flags & 6144)) && !ts.contains(typeSet, type)) { - typeSet.push(type); + if (type.flags & 32768) { + typeSet.containsObjectType = true; + } + if (type.flags & 65536 && typeSet.unionIndex === undefined) { + typeSet.unionIndex = typeSet.length; + } + if (!(type.flags & 32768 && type.objectFlags & 16 && + type.symbol && type.symbol.flags & (16 | 8192) && containsIdenticalType(typeSet, type))) { + typeSet.push(type); + } } } function addTypesToIntersection(typeSet, types) { - for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { - var type = types_6[_i]; + for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { + var type = types_9[_i]; addTypeToIntersection(typeSet, type); } } @@ -25675,30 +27566,28 @@ var ts; if (types.length === 0) { return emptyObjectType; } - var _loop_2 = function (i) { - var type_1 = types[i]; - if (type_1.flags & 65536) { - return { value: getUnionType(ts.map(type_1.types, function (t) { return getIntersectionType(ts.replaceElement(types, i, t)); }), false, aliasSymbol, aliasTypeArguments) }; - } - }; - for (var i = 0; i < types.length; i++) { - var state_2 = _loop_2(i); - if (typeof state_2 === "object") - return state_2.value; - } var typeSet = []; addTypesToIntersection(typeSet, types); if (typeSet.containsAny) { return anyType; } + if (typeSet.containsEmptyObject && !typeSet.containsObjectType) { + typeSet.push(emptyObjectType); + } if (typeSet.length === 1) { return typeSet[0]; } + var unionIndex = typeSet.unionIndex; + if (unionIndex !== undefined) { + var unionType = typeSet[unionIndex]; + return getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex, t)); }), false, aliasSymbol, aliasTypeArguments); + } var id = getTypeListId(typeSet); - var type = intersectionTypes[id]; + var type = intersectionTypes.get(id); if (!type) { var propagatedFlags = getPropagatingFlagsOfTypes(typeSet, 6144); - type = intersectionTypes[id] = createType(131072 | propagatedFlags); + type = createType(131072 | propagatedFlags); + intersectionTypes.set(id, type); type.types = typeSet; type.aliasSymbol = aliasSymbol; type.aliasTypeArguments = aliasTypeArguments; @@ -25712,7 +27601,7 @@ var ts; } return links.resolvedType; } - function getIndexTypeForTypeParameter(type) { + function getIndexTypeForGenericType(type) { if (!type.resolvedIndexType) { type.resolvedIndexType = createType(262144); type.resolvedIndexType.type = type; @@ -25728,7 +27617,7 @@ var ts; return getUnionType(ts.map(getPropertiesOfType(type), getLiteralTypeFromPropertyName)); } function getIndexType(type) { - return type.flags & 16384 ? getIndexTypeForTypeParameter(type) : + return maybeTypeOfKind(type, 540672) ? getIndexTypeForGenericType(type) : getObjectFlags(type) & 32 ? getConstraintTypeFromMappedType(type) : type.flags & 1 || getIndexInfoOfType(type, 0) ? stringType : getLiteralTypeFromPropertyNames(type); @@ -25751,7 +27640,7 @@ var ts; return type; } function getPropertyTypeForIndexType(objectType, indexType, accessNode, cacheSymbol) { - var accessExpression = accessNode && accessNode.kind === 178 ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 179 ? accessNode : undefined; var propName = indexType.flags & (32 | 64 | 256) ? indexType.text : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, false) ? @@ -25780,14 +27669,14 @@ var ts; getIndexInfoOfType(objectType, 0) || undefined; if (indexInfo) { - if (accessExpression && ts.isAssignmentTarget(accessExpression) && indexInfo.isReadonly) { + if (accessExpression && indexInfo.isReadonly && (ts.isAssignmentTarget(accessExpression) || ts.isDeleteTarget(accessExpression))) { error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); return unknownType; } return indexInfo.type; } if (accessExpression && !isConstEnumObjectType(objectType)) { - if (compilerOptions.noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors) { + if (noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors) { if (getIndexTypeOfType(objectType, 1)) { error(accessExpression.argumentExpression, ts.Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number); } @@ -25799,7 +27688,7 @@ var ts; } } if (accessNode) { - var indexNode = accessNode.kind === 178 ? accessNode.argumentExpression : accessNode.indexType; + var indexNode = accessNode.kind === 179 ? accessNode.argumentExpression : accessNode.indexType; if (indexType.flags & (32 | 64)) { error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, indexType.text, typeToString(objectType)); } @@ -25809,34 +27698,36 @@ var ts; else { error(indexNode, ts.Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType)); } + return unknownType; } - return unknownType; + return anyType; } function getIndexedAccessForMappedType(type, indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 178 ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 179 ? accessNode : undefined; if (accessExpression && ts.isAssignmentTarget(accessExpression) && type.declaration.readonlyToken) { error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(type)); return unknownType; } - var mapper = createUnaryTypeMapper(getTypeParameterFromMappedType(type), indexType); + var mapper = createTypeMapper([getTypeParameterFromMappedType(type)], [indexType]); var templateMapper = type.mapper ? combineTypeMappers(type.mapper, mapper) : mapper; - return addOptionality(instantiateType(getTemplateTypeFromMappedType(type), templateMapper), !!type.declaration.questionToken); + return instantiateType(getTemplateTypeFromMappedType(type), templateMapper); } function getIndexedAccessType(objectType, indexType, accessNode) { - if (indexType.flags & 16384 || - objectType.flags & 16384 && indexType.flags & 262144 || + if (maybeTypeOfKind(indexType, 540672 | 262144) || + maybeTypeOfKind(objectType, 540672) && !(accessNode && accessNode.kind === 179) || isGenericMappedType(objectType)) { - if (accessNode) { - if (!isTypeAssignableTo(indexType, getIndexType(objectType))) { - error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); - return unknownType; - } + if (objectType.flags & 1) { + return objectType; } if (isGenericMappedType(objectType)) { return getIndexedAccessForMappedType(objectType, indexType, accessNode); } var id = objectType.id + "," + indexType.id; - return indexedAccessTypes[id] || (indexedAccessTypes[id] = createIndexedAccessType(objectType, indexType)); + var type = indexedAccessTypes.get(id); + if (!type) { + indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType)); + } + return type; } var apparentObjectType = getApparentType(objectType); if (indexType.flags & 65536 && !(indexType.flags & 8190)) { @@ -25876,7 +27767,7 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { var aliasSymbol = getAliasSymbolForTypeNode(node); - if (ts.isEmpty(node.symbol.members) && !aliasSymbol) { + if (node.symbol.members.size === 0 && !aliasSymbol) { links.resolvedType = emptyTypeLiteralType; } else { @@ -25889,17 +27780,33 @@ var ts; return links.resolvedType; } function getAliasSymbolForTypeNode(node) { - return node.parent.kind === 228 ? getSymbolOfNode(node.parent) : undefined; + return node.parent.kind === 230 ? getSymbolOfNode(node.parent) : undefined; } function getAliasTypeArgumentsForTypeNode(node) { var symbol = getAliasSymbolForTypeNode(node); return symbol ? getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) : undefined; } - function getSpreadType(left, right, isFromObjectLiteral) { - ts.Debug.assert(!!(left.flags & (32768 | 1)) && !!(right.flags & (32768 | 1)), "Only object types may be spread."); + function getSpreadType(left, right) { if (left.flags & 1 || right.flags & 1) { return anyType; } + left = filterType(left, function (t) { return !(t.flags & 6144); }); + if (left.flags & 8192) { + return right; + } + right = filterType(right, function (t) { return !(t.flags & 6144); }); + if (right.flags & 8192) { + return left; + } + if (left.flags & 65536) { + return mapType(left, function (t) { return getSpreadType(t, right); }); + } + if (right.flags & 65536) { + return mapType(right, function (t) { return getSpreadType(left, t); }); + } + if (right.flags & 16777216) { + return emptyObjectType; + } var members = ts.createMap(); var skippedPrivateMembers = ts.createMap(); var stringIndexInfo; @@ -25914,42 +27821,55 @@ var ts; } for (var _i = 0, _a = getPropertiesOfType(right); _i < _a.length; _i++) { var rightProp = _a[_i]; - var isOwnProperty = !(rightProp.flags & 8192) || isFromObjectLiteral; var isSetterWithoutGetter = rightProp.flags & 65536 && !(rightProp.flags & 32768); if (getDeclarationModifierFlagsFromSymbol(rightProp) & (8 | 16)) { - skippedPrivateMembers[rightProp.name] = true; + skippedPrivateMembers.set(rightProp.name, true); } - else if (isOwnProperty && !isSetterWithoutGetter) { - members[rightProp.name] = rightProp; + else if (!isClassMethod(rightProp) && !isSetterWithoutGetter) { + members.set(rightProp.name, getNonReadonlySymbol(rightProp)); } } for (var _b = 0, _c = getPropertiesOfType(left); _b < _c.length; _b++) { var leftProp = _c[_b]; if (leftProp.flags & 65536 && !(leftProp.flags & 32768) - || leftProp.name in skippedPrivateMembers) { + || skippedPrivateMembers.has(leftProp.name) + || isClassMethod(leftProp)) { continue; } - if (leftProp.name in members) { - var rightProp = members[leftProp.name]; + if (members.has(leftProp.name)) { + var rightProp = members.get(leftProp.name); var rightType = getTypeOfSymbol(rightProp); - if (maybeTypeOfKind(rightType, 2048) || rightProp.flags & 536870912) { + if (maybeTypeOfKind(rightType, 2048) || rightProp.flags & 67108864) { var declarations = ts.concatenate(leftProp.declarations, rightProp.declarations); - var flags = 4 | 67108864 | (leftProp.flags & 536870912); + var flags = 4 | (leftProp.flags & 67108864); var result = createSymbol(flags, leftProp.name); result.type = getUnionType([getTypeOfSymbol(leftProp), getTypeWithFacts(rightType, 131072)]); result.leftSpread = leftProp; result.rightSpread = rightProp; result.declarations = declarations; - result.isReadonly = isReadonlySymbol(leftProp) || isReadonlySymbol(rightProp); - members[leftProp.name] = result; + members.set(leftProp.name, result); } } else { - members[leftProp.name] = leftProp; + members.set(leftProp.name, getNonReadonlySymbol(leftProp)); } } return createAnonymousType(undefined, members, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo); } + function getNonReadonlySymbol(prop) { + if (!isReadonlySymbol(prop)) { + return prop; + } + var flags = 4 | (prop.flags & 67108864); + var result = createSymbol(flags, prop.name); + result.type = getTypeOfSymbol(prop); + result.declarations = prop.declarations; + result.syntheticOrigin = prop; + return result; + } + function isClassMethod(prop) { + return prop.flags & 8192 && ts.find(prop.declarations, function (decl) { return ts.isClassLike(decl.parent); }); + } function createLiteralType(flags, text) { var type = createType(flags); type.text = text; @@ -25971,7 +27891,11 @@ var ts; } function getLiteralTypeForText(flags, text) { var map = flags & 32 ? stringLiteralTypes : numericLiteralTypes; - return map[text] || (map[text] = createLiteralType(flags, text)); + var type = map.get(text); + if (!type) { + map.set(text, type = createLiteralType(flags, text)); + } + return type; } function getTypeFromLiteralTypeNode(node) { var links = getNodeLinks(node); @@ -25999,9 +27923,9 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 227)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 229)) { if (!(ts.getModifierFlags(container) & 32) && - (container.kind !== 150 || ts.isNodeDescendantOf(node, container.body))) { + (container.kind !== 151 || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } } @@ -26018,85 +27942,82 @@ var ts; function getTypeFromTypeNode(node) { switch (node.kind) { case 118: - case 263: - case 264: + case 267: + case 268: return anyType; - case 134: + case 135: return stringType; case 132: return numberType; case 121: return booleanType; - case 135: + case 136: return esSymbolType; case 104: return voidType; - case 137: + case 138: return undefinedType; case 94: return nullType; case 129: return neverType; - case 289: - return nullType; - case 290: - return undefinedType; - case 291: - return neverType; - case 167: + case 133: + return nonPrimitiveType; + case 168: case 98: return getTypeFromThisTypeNode(node); - case 171: + case 172: return getTypeFromLiteralTypeNode(node); - case 288: + case 292: return getTypeFromLiteralTypeNode(node.literal); - case 157: - case 272: - return getTypeFromTypeReference(node); - case 156: - return booleanType; - case 199: - return getTypeFromTypeReference(node); - case 160: - return getTypeFromTypeQueryNode(node); - case 162: - case 265: - return getTypeFromArrayTypeNode(node); - case 163: - return getTypeFromTupleTypeNode(node); - case 164: - case 266: - return getTypeFromUnionTypeNode(node); - case 165: - return getTypeFromIntersectionTypeNode(node); - case 166: - case 268: - case 269: - case 276: - case 277: - case 273: - return getTypeFromTypeNode(node.type); - case 270: - return getTypeFromTypeNode(node.literal); case 158: - case 159: + case 276: + return getTypeFromTypeReference(node); + case 157: + return booleanType; + case 200: + return getTypeFromTypeReference(node); case 161: - case 287: + return getTypeFromTypeQueryNode(node); + case 163: + case 269: + return getTypeFromArrayTypeNode(node); + case 164: + return getTypeFromTupleTypeNode(node); + case 165: + case 270: + return getTypeFromUnionTypeNode(node); + case 166: + return getTypeFromIntersectionTypeNode(node); + case 272: + return getTypeFromJSDocNullableTypeNode(node); + case 167: + case 273: + case 280: + case 281: + case 277: + return getTypeFromTypeNode(node.type); case 274: + return getTypeFromTypeNode(node.literal); + case 159: + case 160: + case 162: + case 291: + case 278: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 168: - return getTypeFromTypeOperatorNode(node); case 169: - return getTypeFromIndexedAccessTypeNode(node); + return getTypeFromTypeOperatorNode(node); case 170: + return getTypeFromIndexedAccessTypeNode(node); + case 171: return getTypeFromMappedTypeNode(node); case 70: - case 141: + case 142: var symbol = getSymbolAtLocation(node); return symbol && getDeclaredTypeOfSymbol(symbol); - case 267: + case 271: return getTypeFromJSDocTupleType(node); - case 275: + case 279: return getTypeFromJSDocVariadicType(node); default: return unknownType; @@ -26123,13 +28044,13 @@ var ts; var instantiations = mapper.instantiations || (mapper.instantiations = []); return instantiations[type.id] || (instantiations[type.id] = instantiator(type, mapper)); } - function createUnaryTypeMapper(source, target) { + function makeUnaryTypeMapper(source, target) { return function (t) { return t === source ? target : t; }; } - function createBinaryTypeMapper(source1, target1, source2, target2) { + function makeBinaryTypeMapper(source1, target1, source2, target2) { return function (t) { return t === source1 ? target1 : t === source2 ? target2 : t; }; } - function createArrayTypeMapper(sources, targets) { + function makeArrayTypeMapper(sources, targets) { return function (t) { for (var i = 0; i < sources.length; i++) { if (t === sources[i]) { @@ -26140,16 +28061,20 @@ var ts; }; } function createTypeMapper(sources, targets) { - var count = sources.length; - var mapper = count == 1 ? createUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : - count == 2 ? createBinaryTypeMapper(sources[0], targets ? targets[0] : anyType, sources[1], targets ? targets[1] : anyType) : - createArrayTypeMapper(sources, targets); + var mapper = sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : + sources.length === 2 ? makeBinaryTypeMapper(sources[0], targets ? targets[0] : anyType, sources[1], targets ? targets[1] : anyType) : + makeArrayTypeMapper(sources, targets); mapper.mappedTypes = sources; return mapper; } function createTypeEraser(sources) { return createTypeMapper(sources, undefined); } + function createBackreferenceMapper(typeParameters, index) { + var mapper = function (t) { return ts.indexOf(typeParameters, t) >= index ? emptyObjectType : t; }; + mapper.mappedTypes = typeParameters; + return mapper; + } function getInferenceMapper(context) { if (!context.mapper) { var mapper = function (t) { @@ -26173,7 +28098,12 @@ var ts; } function combineTypeMappers(mapper1, mapper2) { var mapper = function (t) { return instantiateType(mapper1(t), mapper2); }; - mapper.mappedTypes = mapper1.mappedTypes; + mapper.mappedTypes = ts.concatenate(mapper1.mappedTypes, mapper2.mappedTypes); + return mapper; + } + function createReplacementMapper(source, target, baseMapper) { + var mapper = function (t) { return t === source ? target : baseMapper(t); }; + mapper.mappedTypes = baseMapper.mappedTypes; return mapper; } function cloneTypeParameter(typeParameter) { @@ -26218,12 +28148,13 @@ var ts; return result; } function instantiateSymbol(symbol, mapper) { - if (symbol.flags & 16777216) { + if (getCheckFlags(symbol) & 1) { var links = getSymbolLinks(symbol); symbol = links.target; mapper = combineTypeMappers(links.mapper, mapper); } - var result = createSymbol(16777216 | 67108864 | symbol.flags, symbol.name); + var result = createSymbol(symbol.flags, symbol.name); + result.checkFlags = 1; result.declarations = symbol.declarations; result.parent = symbol.parent; result.target = symbol; @@ -26244,18 +28175,17 @@ var ts; function instantiateMappedType(type, mapper) { var constraintType = getConstraintTypeFromMappedType(type); if (constraintType.flags & 262144) { - var typeParameter_1 = constraintType.type; - var mappedTypeParameter = mapper(typeParameter_1); - if (typeParameter_1 !== mappedTypeParameter) { - return mapType(mappedTypeParameter, function (t) { - if (isMappableType(t)) { - var replacementMapper = createUnaryTypeMapper(typeParameter_1, t); - var combinedMapper = mapper.mappedTypes && mapper.mappedTypes.length === 1 ? replacementMapper : combineTypeMappers(replacementMapper, mapper); - combinedMapper.mappedTypes = mapper.mappedTypes; - return instantiateMappedObjectType(type, combinedMapper); - } - return t; - }); + var typeVariable_1 = constraintType.type; + if (typeVariable_1.flags & 16384) { + var mappedTypeVariable = instantiateType(typeVariable_1, mapper); + if (typeVariable_1 !== mappedTypeVariable) { + return mapType(mappedTypeVariable, function (t) { + if (isMappableType(t)) { + return instantiateMappedObjectType(type, createReplacementMapper(typeVariable_1, t, mapper)); + } + return t; + }); + } } } return instantiateMappedObjectType(type, mapper); @@ -26276,26 +28206,28 @@ var ts; return false; } var mappedTypes = mapper.mappedTypes; - var node = symbol.declarations[0].parent; - while (node) { + return !!ts.findAncestor(symbol.declarations[0], function (node) { + if (node.kind === 232 || node.kind === 264) { + return "quit"; + } switch (node.kind) { - case 158: case 159: - case 225: - case 149: - case 148: + case 160: + case 227: case 150: - case 153: + case 149: + case 151: case 154: case 155: - case 151: + case 156: case 152: - case 184: + case 153: case 185: - case 226: - case 197: - case 227: + case 186: case 228: + case 198: + case 229: + case 230: var declaration = node; if (declaration.typeParameters) { for (var _i = 0, _a = declaration.typeParameters; _i < _a.length; _i++) { @@ -26305,25 +28237,34 @@ var ts; } } } - if (ts.isClassLike(node) || node.kind === 227) { + if (ts.isClassLike(node) || node.kind === 229) { var thisType = getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; if (thisType && ts.contains(mappedTypes, thisType)) { return true; } } break; - case 230: - case 261: - return false; + case 171: + if (ts.contains(mappedTypes, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter)))) { + return true; + } + break; + case 278: + var func = node; + for (var _b = 0, _c = func.parameters; _b < _c.length; _b++) { + var p = _c[_b]; + if (ts.contains(mappedTypes, getTypeOfNode(p))) { + return true; + } + } + break; } - node = node.parent; - } - return false; + }); } function isTopLevelTypeAlias(symbol) { if (symbol.declarations && symbol.declarations.length) { var parentKind = symbol.declarations[0].parent.kind; - return parentKind === 261 || parentKind === 231; + return parentKind === 264 || parentKind === 233; } return false; } @@ -26375,28 +28316,34 @@ var ts; return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration); } function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 149 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 150 || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 184: case 185: + case 186: return isContextSensitiveFunctionLikeDeclaration(node); - case 176: + case 177: return ts.forEach(node.properties, isContextSensitive); - case 175: + case 176: return ts.forEach(node.elements, isContextSensitive); - case 193: + case 194: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 192: + case 193: return node.operatorToken.kind === 53 && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 257: + case 260: return isContextSensitive(node.initializer); + case 150: case 149: - case 148: return isContextSensitiveFunctionLikeDeclaration(node); - case 183: + case 184: return isContextSensitive(node.expression); + case 253: + return ts.forEach(node.properties, isContextSensitive); + case 252: + return node.initializer && isContextSensitive(node.initializer); + case 255: + return node.expression && isContextSensitive(node.expression); } return false; } @@ -26407,7 +28354,7 @@ var ts; if (ts.forEach(node.parameters, function (p) { return !p.type; })) { return true; } - if (node.kind === 185) { + if (node.kind === 186) { return false; } var parameter = ts.firstOrUndefined(node.parameters); @@ -26425,9 +28372,12 @@ var ts; result.properties = resolved.properties; result.callSignatures = emptyArray; result.constructSignatures = emptyArray; - type = result; + return result; } } + else if (type.flags & 131072) { + return getIntersectionType(ts.map(type.types, getTypeWithoutSignatures)); + } return type; } function isTypeIdenticalTo(source, target) { @@ -26446,7 +28396,7 @@ var ts; return isTypeRelatedTo(source, target, assignableRelation); } function isTypeInstanceOf(source, target) { - return source === target || isTypeSubtypeOf(source, target) && !isTypeIdenticalTo(source, target); + return getTargetType(source) === getTargetType(target) || isTypeSubtypeOf(source, target) && !isTypeIdenticalTo(source, target); } function isTypeComparableTo(source, target) { return isTypeRelatedTo(source, target, comparableRelation); @@ -26464,9 +28414,9 @@ var ts; return checkTypeRelatedTo(source, target, comparableRelation, errorNode, headMessage, containingMessageChain); } function isSignatureAssignableTo(source, target, ignoreReturnTypes) { - return compareSignaturesRelated(source, target, ignoreReturnTypes, false, undefined, compareTypesAssignable) !== 0; + return compareSignaturesRelated(source, target, false, ignoreReturnTypes, false, undefined, compareTypesAssignable) !== 0; } - function compareSignaturesRelated(source, target, ignoreReturnTypes, reportErrors, errorReporter, compareTypes) { + function compareSignaturesRelated(source, target, checkAsCallback, ignoreReturnTypes, reportErrors, errorReporter, compareTypes) { if (source === target) { return -1; } @@ -26497,9 +28447,15 @@ var ts; var sourceParams = source.parameters; var targetParams = target.parameters; for (var i = 0; i < checkCount; i++) { - var s = i < sourceMax ? getTypeOfParameter(sourceParams[i]) : getRestTypeOfSignature(source); - var t = i < targetMax ? getTypeOfParameter(targetParams[i]) : getRestTypeOfSignature(target); - var related = compareTypes(s, t, false) || compareTypes(t, s, reportErrors); + var sourceType = i < sourceMax ? getTypeOfParameter(sourceParams[i]) : getRestTypeOfSignature(source); + var targetType = i < targetMax ? getTypeOfParameter(targetParams[i]) : getRestTypeOfSignature(target); + var sourceSig = getSingleCallSignature(getNonNullableType(sourceType)); + var targetSig = getSingleCallSignature(getNonNullableType(targetType)); + var callbacks = sourceSig && targetSig && !sourceSig.typePredicate && !targetSig.typePredicate && + (getFalsyFlags(sourceType) & 6144) === (getFalsyFlags(targetType) & 6144); + var related = callbacks ? + compareSignaturesRelated(targetSig, sourceSig, true, false, reportErrors, errorReporter, compareTypes) : + !checkAsCallback && compareTypes(sourceType, targetType, false) || compareTypes(targetType, sourceType, reportErrors); if (!related) { if (reportErrors) { errorReporter(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, sourceParams[i < sourceMax ? i : sourceMax].name, targetParams[i < targetMax ? i : targetMax].name); @@ -26526,7 +28482,8 @@ var ts; } } else { - result &= compareTypes(sourceReturnType, targetReturnType, reportErrors); + result &= checkAsCallback && compareTypes(targetReturnType, sourceReturnType, false) || + compareTypes(sourceReturnType, targetReturnType, reportErrors); } } return result; @@ -26589,18 +28546,33 @@ var ts; sourceNonRestParamCount; } } + function isEmptyResolvedType(t) { + return t.properties.length === 0 && + t.callSignatures.length === 0 && + t.constructSignatures.length === 0 && + !t.stringIndexInfo && + !t.numberIndexInfo; + } + function isEmptyObjectType(type) { + return type.flags & 32768 ? isEmptyResolvedType(resolveStructuredTypeMembers(type)) : + type.flags & 65536 ? ts.forEach(type.types, isEmptyObjectType) : + type.flags & 131072 ? !ts.forEach(type.types, function (t) { return !isEmptyObjectType(t); }) : + false; + } function isEnumTypeRelatedTo(source, target, errorReporter) { if (source === target) { return true; } var id = source.id + "," + target.id; - if (enumRelation[id] !== undefined) { - return enumRelation[id]; + var relation = enumRelation.get(id); + if (relation !== undefined) { + return relation; } if (source.symbol.name !== target.symbol.name || !(source.symbol.flags & 256) || !(target.symbol.flags & 256) || (source.flags & 65536) !== (target.flags & 65536)) { - return enumRelation[id] = false; + enumRelation.set(id, false); + return false; } var targetEnumType = getTypeOfSymbol(target.symbol); for (var _i = 0, _a = getPropertiesOfType(getTypeOfSymbol(source.symbol)); _i < _a.length; _i++) { @@ -26611,11 +28583,13 @@ var ts; if (errorReporter) { errorReporter(ts.Diagnostics.Property_0_is_missing_in_type_1, property.name, typeToString(target, undefined, 128)); } - return enumRelation[id] = false; + enumRelation.set(id, false); + return false; } } } - return enumRelation[id] = true; + enumRelation.set(id, true); + return true; } function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { if (target.flags & 8192) @@ -26636,6 +28610,8 @@ var ts; return true; if (source.flags & 4096 && (!strictNullChecks || target.flags & 4096)) return true; + if (source.flags & 32768 && target.flags & 16777216) + return true; if (relation === assignableRelation || relation === comparableRelation) { if (source.flags & 1) return true; @@ -26667,13 +28643,13 @@ var ts; } if (source.flags & 32768 && target.flags & 32768) { var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; - var related = relation[id]; + var related = relation.get(id); if (related !== undefined) { return related === 1; } } - if (source.flags & 507904 || target.flags & 507904) { - return checkTypeRelatedTo(source, target, relation, undefined, undefined, undefined); + if (source.flags & 1032192 || target.flags & 1032192) { + return checkTypeRelatedTo(source, target, relation, undefined); } return false; } @@ -26727,10 +28703,27 @@ var ts; if ((globalStringType === source && stringType === target) || (globalNumberType === source && numberType === target) || (globalBooleanType === source && booleanType === target) || - (getGlobalESSymbolType() === source && esSymbolType === target)) { + (getGlobalESSymbolType(false) === source && esSymbolType === target)) { reportError(ts.Diagnostics._0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible, targetType, sourceType); } } + function isUnionOrIntersectionTypeWithoutNullableConstituents(type) { + if (!(type.flags & 196608)) { + return false; + } + var seenNonNullable = false; + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (t.flags & 6144) { + continue; + } + if (seenNonNullable) { + return true; + } + seenNonNullable = true; + } + return false; + } function isRelatedTo(source, target, reportErrors, headMessage) { var result; if (source.flags & 96 && source.flags & 1048576) { @@ -26753,7 +28746,7 @@ var ts; } return 0; } - if (target.flags & 196608) { + if (isUnionOrIntersectionTypeWithoutNullableConstituents(target)) { source = getRegularTypeOfObjectLiteral(source); } } @@ -26769,91 +28762,24 @@ var ts; return result; } } - else if (target.flags & 65536) { - if (result = typeRelatedToSomeType(source, target, reportErrors && !(source.flags & 8190) && !(target.flags & 8190))) { - return result; - } - } - else if (target.flags & 131072) { - if (result = typeRelatedToEachType(source, target, reportErrors)) { - return result; - } - } - else if (source.flags & 131072) { - if (result = someTypeRelatedToType(source, target, false)) { - return result; - } - } - if (target.flags & 16384) { - if (getObjectFlags(source) & 32 && getConstraintTypeFromMappedType(source) === getIndexType(target)) { - if (!source.declaration.questionToken) { - var templateType = getTemplateTypeFromMappedType(source); - var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); - if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) { - return result; - } - } - } - else { - var constraint = getConstraintOfTypeParameter(target); - if (constraint && constraint.flags & 262144) { - if (result = isRelatedTo(source, constraint, reportErrors)) { - return result; - } - } - } - } - else if (target.flags & 262144) { - if (source.flags & 262144) { - if (result = isRelatedTo(target.type, source.type, false)) { - return result; - } - } - var constraint = getConstraintOfTypeParameter(target.type); - if (constraint) { - if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) { - return result; - } - } - } - else if (target.flags & 524288) { - if (source.flags & 524288 && source.indexType === target.indexType) { - if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) { - return result; - } - } - } - if (source.flags & 16384) { - if (getObjectFlags(target) & 32 && getConstraintTypeFromMappedType(target) === getIndexType(source)) { - var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); - var templateType = getTemplateTypeFromMappedType(target); - if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { - return result; - } - } - else { - var constraint = getConstraintOfTypeParameter(source); - if (!constraint || constraint.flags & 1) { - constraint = emptyObjectType; - } - constraint = getTypeWithThisArgument(constraint, source); - var reportConstraintErrors = reportErrors && constraint !== emptyObjectType; - if (result = isRelatedTo(constraint, target, reportConstraintErrors)) { - errorInfo = saveErrorInfo; - return result; - } - } - } else { - if (getObjectFlags(source) & 4 && getObjectFlags(target) & 4 && source.target === target.target) { - if (result = typeArgumentsRelatedTo(source, target, reportErrors)) { + if (target.flags & 65536) { + if (result = typeRelatedToSomeType(source, target, reportErrors && !(source.flags & 8190) && !(target.flags & 8190))) { return result; } } - var apparentSource = getApparentType(source); - if (apparentSource.flags & (32768 | 131072) && target.flags & 32768) { - var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !(source.flags & 8190); - if (result = objectTypeRelatedTo(apparentSource, source, target, reportStructuralErrors)) { + else if (target.flags & 131072) { + if (result = typeRelatedToEachType(source, target, reportErrors)) { + return result; + } + } + else if (source.flags & 131072) { + if (result = someTypeRelatedToType(source, target, false)) { + return result; + } + } + if (source.flags & 1032192 || target.flags & 1032192) { + if (result = recursiveTypeRelatedTo(source, target, reportErrors)) { errorInfo = saveErrorInfo; return result; } @@ -26873,12 +28799,7 @@ var ts; function isIdenticalTo(source, target) { var result; if (source.flags & 32768 && target.flags & 32768) { - if (getObjectFlags(source) & 4 && getObjectFlags(target) & 4 && source.target === target.target) { - if (result = typeArgumentsRelatedTo(source, target, false)) { - return result; - } - } - return objectTypeRelatedTo(source, source, target, false); + return recursiveTypeRelatedTo(source, target, false); } if (source.flags & 65536 && target.flags & 65536 || source.flags & 131072 && target.flags & 131072) { @@ -26890,42 +28811,43 @@ var ts; } return 0; } - function isKnownProperty(type, name) { + function isKnownProperty(type, name, isComparingJsxAttributes) { if (type.flags & 32768) { var resolved = resolveStructuredTypeMembers(type); - if ((relation === assignableRelation || relation === comparableRelation) && (type === globalObjectType || isEmptyObjectType(resolved)) || - resolved.stringIndexInfo || - (resolved.numberIndexInfo && isNumericLiteralName(name)) || - getPropertyOfType(type, name)) { + if (resolved.stringIndexInfo || resolved.numberIndexInfo && isNumericLiteralName(name) || + getPropertyOfType(type, name) || isComparingJsxAttributes && !isUnhyphenatedJsxName(name)) { return true; } } else if (type.flags & 196608) { for (var _i = 0, _a = type.types; _i < _a.length; _i++) { var t = _a[_i]; - if (isKnownProperty(t, name)) { + if (isKnownProperty(t, name, isComparingJsxAttributes)) { return true; } } } return false; } - function isEmptyObjectType(t) { - return t.properties.length === 0 && - t.callSignatures.length === 0 && - t.constructSignatures.length === 0 && - !t.stringIndexInfo && - !t.numberIndexInfo; - } function hasExcessProperties(source, target, reportErrors) { if (maybeTypeOfKind(target, 32768) && !(getObjectFlags(target) & 512)) { + var isComparingJsxAttributes = !!(source.flags & 33554432); + if ((relation === assignableRelation || relation === comparableRelation) && + (isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) { + return false; + } for (var _i = 0, _a = getPropertiesOfObjectType(source); _i < _a.length; _i++) { var prop = _a[_i]; - if (!isKnownProperty(target, prop.name)) { + if (!isKnownProperty(target, prop.name, isComparingJsxAttributes)) { if (reportErrors) { ts.Debug.assert(!!errorNode); - errorNode = prop.valueDeclaration; - reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target)); + if (ts.isJsxAttributes(errorNode)) { + reportError(ts.Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(target)); + } + else { + errorNode = prop.valueDeclaration; + reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target)); + } } return true; } @@ -26951,20 +28873,42 @@ var ts; if (target.flags & 65536 && containsType(targetTypes, source)) { return -1; } - var len = targetTypes.length; - for (var i = 0; i < len; i++) { - var related = isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1); + for (var _i = 0, targetTypes_1 = targetTypes; _i < targetTypes_1.length; _i++) { + var type = targetTypes_1[_i]; + var related = isRelatedTo(source, type, false); if (related) { return related; } } + if (reportErrors) { + var discriminantType = findMatchingDiscriminantType(source, target); + isRelatedTo(source, discriminantType || targetTypes[targetTypes.length - 1], true); + } return 0; } + function findMatchingDiscriminantType(source, target) { + var sourceProperties = getPropertiesOfObjectType(source); + if (sourceProperties) { + for (var _i = 0, sourceProperties_1 = sourceProperties; _i < sourceProperties_1.length; _i++) { + var sourceProperty = sourceProperties_1[_i]; + if (isDiscriminantProperty(target, sourceProperty.name)) { + var sourceType = getTypeOfSymbol(sourceProperty); + for (var _a = 0, _b = target.types; _a < _b.length; _a++) { + var type = _b[_a]; + var targetType = getTypeOfPropertyOfType(type, sourceProperty.name); + if (targetType && isRelatedTo(sourceType, targetType)) { + return type; + } + } + } + } + } + } function typeRelatedToEachType(source, target, reportErrors) { var result = -1; var targetTypes = target.types; - for (var _i = 0, targetTypes_1 = targetTypes; _i < targetTypes_1.length; _i++) { - var targetType = targetTypes_1[_i]; + for (var _i = 0, targetTypes_2 = targetTypes; _i < targetTypes_2.length; _i++) { + var targetType = targetTypes_2[_i]; var related = isRelatedTo(source, targetType, reportErrors); if (!related) { return 0; @@ -27017,15 +28961,15 @@ var ts; } return result; } - function objectTypeRelatedTo(source, originalSource, target, reportErrors) { + function recursiveTypeRelatedTo(source, target, reportErrors) { if (overflow) { return 0; } var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; - var related = relation[id]; + var related = relation.get(id); if (related !== undefined) { if (reportErrors && related === 2) { - relation[id] = 3; + relation.set(id, 3); } else { return related === 1 ? -1 : 0; @@ -27033,7 +28977,7 @@ var ts; } if (depth > 0) { for (var i = 0; i < depth; i++) { - if (maybeStack[i][id]) { + if (maybeStack[i].get(id)) { return 1; } } @@ -27051,71 +28995,165 @@ var ts; sourceStack[depth] = source; targetStack[depth] = target; maybeStack[depth] = ts.createMap(); - maybeStack[depth][id] = 1; + maybeStack[depth].set(id, 1); depth++; var saveExpandingFlags = expandingFlags; - if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack, depth)) + if (!(expandingFlags & 1) && isDeeplyNestedType(source, sourceStack, depth)) expandingFlags |= 1; - if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack, depth)) + if (!(expandingFlags & 2) && isDeeplyNestedType(target, targetStack, depth)) expandingFlags |= 2; - var result; - if (expandingFlags === 3) { - result = 1; - } - else if (isGenericMappedType(source) || isGenericMappedType(target)) { - result = mappedTypeRelatedTo(source, target, reportErrors); - } - else { - result = propertiesRelatedTo(source, target, reportErrors); - if (result) { - result &= signaturesRelatedTo(source, target, 0, reportErrors); - if (result) { - result &= signaturesRelatedTo(source, target, 1, reportErrors); - if (result) { - result &= indexTypesRelatedTo(source, originalSource, target, 0, reportErrors); - if (result) { - result &= indexTypesRelatedTo(source, originalSource, target, 1, reportErrors); - } - } - } - } - } + var result = expandingFlags !== 3 ? structuredTypeRelatedTo(source, target, reportErrors) : 1; expandingFlags = saveExpandingFlags; depth--; if (result) { var maybeCache = maybeStack[depth]; var destinationCache = (result === -1 || depth === 0) ? relation : maybeStack[depth - 1]; - ts.copyProperties(maybeCache, destinationCache); + ts.copyEntries(maybeCache, destinationCache); } else { - relation[id] = reportErrors ? 3 : 2; + relation.set(id, reportErrors ? 3 : 2); } return result; } - function mappedTypeRelatedTo(source, target, reportErrors) { - if (isGenericMappedType(target)) { - if (isGenericMappedType(source)) { - var result_2; - if (relation === identityRelation) { - var readonlyMatches = !source.declaration.readonlyToken === !target.declaration.readonlyToken; - var optionalMatches = !source.declaration.questionToken === !target.declaration.questionToken; - if (readonlyMatches && optionalMatches) { - if (result_2 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { - return result_2 & isRelatedTo(getErasedTemplateTypeFromMappedType(source), getErasedTemplateTypeFromMappedType(target), reportErrors); - } - } - } - else { - if (relation === comparableRelation || !source.declaration.questionToken || target.declaration.questionToken) { - if (result_2 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { - return result_2 & isRelatedTo(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target), reportErrors); - } + function structuredTypeRelatedTo(source, target, reportErrors) { + var result; + var saveErrorInfo = errorInfo; + if (target.flags & 16384) { + if (getObjectFlags(source) & 32 && getConstraintTypeFromMappedType(source) === getIndexType(target)) { + if (!source.declaration.questionToken) { + var templateType = getTemplateTypeFromMappedType(source); + var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); + if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) { + return result; } } } } - else if (relation !== identityRelation && isEmptyObjectType(resolveStructuredTypeMembers(target))) { - return -1; + else if (target.flags & 262144) { + if (source.flags & 262144) { + if (result = isRelatedTo(target.type, source.type, false)) { + return result; + } + } + var constraint = getConstraintOfType(target.type); + if (constraint) { + if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) { + return result; + } + } + } + else if (target.flags & 524288) { + var constraint = getConstraintOfType(target); + if (constraint) { + if (result = isRelatedTo(source, constraint, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + } + if (source.flags & 16384) { + if (getObjectFlags(target) & 32 && getConstraintTypeFromMappedType(target) === getIndexType(source)) { + var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); + var templateType = getTemplateTypeFromMappedType(target); + if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + else { + var constraint = getConstraintOfTypeParameter(source); + if (constraint || !(target.flags & 16777216)) { + if (!constraint || constraint.flags & 1) { + constraint = emptyObjectType; + } + constraint = getTypeWithThisArgument(constraint, source); + var reportConstraintErrors = reportErrors && constraint !== emptyObjectType; + if (result = isRelatedTo(constraint, target, reportConstraintErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + } + } + else if (source.flags & 524288) { + var constraint = getConstraintOfType(source); + if (constraint) { + if (result = isRelatedTo(constraint, target, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + else if (target.flags & 524288 && source.indexType === target.indexType) { + if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) { + return result; + } + } + } + else { + if (getObjectFlags(source) & 4 && getObjectFlags(target) & 4 && source.target === target.target) { + if (result = typeArgumentsRelatedTo(source, target, reportErrors)) { + return result; + } + } + var sourceIsPrimitive = !!(source.flags & 8190); + if (relation !== identityRelation) { + source = getApparentType(source); + } + if (source.flags & (32768 | 131072) && target.flags & 32768) { + var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !sourceIsPrimitive; + if (isGenericMappedType(source) || isGenericMappedType(target)) { + result = mappedTypeRelatedTo(source, target, reportStructuralErrors); + } + else { + result = propertiesRelatedTo(source, target, reportStructuralErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 0, reportStructuralErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 1, reportStructuralErrors); + if (result) { + result &= indexTypesRelatedTo(source, target, 0, sourceIsPrimitive, reportStructuralErrors); + if (result) { + result &= indexTypesRelatedTo(source, target, 1, sourceIsPrimitive, reportStructuralErrors); + } + } + } + } + } + if (result) { + errorInfo = saveErrorInfo; + return result; + } + } + } + return 0; + } + function mappedTypeRelatedTo(source, target, reportErrors) { + if (isGenericMappedType(target)) { + if (isGenericMappedType(source)) { + var sourceReadonly = !!source.declaration.readonlyToken; + var sourceOptional = !!source.declaration.questionToken; + var targetReadonly = !!target.declaration.readonlyToken; + var targetOptional = !!target.declaration.questionToken; + var modifiersRelated = relation === identityRelation ? + sourceReadonly === targetReadonly && sourceOptional === targetOptional : + relation === comparableRelation || !sourceOptional || targetOptional; + if (modifiersRelated) { + var result_2; + if (result_2 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { + var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); + return result_2 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); + } + } + } + else if (target.declaration.questionToken && isEmptyObjectType(source)) { + return -1; + } + } + else if (relation !== identityRelation) { + var resolved = resolveStructuredTypeMembers(target); + if (isEmptyResolvedType(resolved) || resolved.stringIndexInfo && resolved.stringIndexInfo.type.flags & 1) { + return -1; + } } return 0; } @@ -27126,22 +29164,28 @@ var ts; var result = -1; var properties = getPropertiesOfObjectType(target); var requireOptionalProperties = relation === subtypeRelation && !(getObjectFlags(source) & 128); - for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { - var targetProp = properties_3[_i]; + for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) { + var targetProp = properties_4[_i]; var sourceProp = getPropertyOfType(source, targetProp.name); if (sourceProp !== targetProp) { if (!sourceProp) { - if (!(targetProp.flags & 536870912) || requireOptionalProperties) { + if (!(targetProp.flags & 67108864) || requireOptionalProperties) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source)); } return 0; } } - else if (!(targetProp.flags & 134217728)) { + else if (!(targetProp.flags & 16777216)) { var sourcePropFlags = getDeclarationModifierFlagsFromSymbol(sourceProp); var targetPropFlags = getDeclarationModifierFlagsFromSymbol(targetProp); if (sourcePropFlags & 8 || targetPropFlags & 8) { + if (getCheckFlags(sourceProp) & 256) { + if (reportErrors) { + reportError(ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(sourceProp), typeToString(source)); + } + return 0; + } if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) { if (reportErrors) { if (sourcePropFlags & 8 && targetPropFlags & 8) { @@ -27155,12 +29199,9 @@ var ts; } } else if (targetPropFlags & 16) { - var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 32; - var sourceClass = sourceDeclaredInClass ? getDeclaredTypeOfSymbol(getParentOfSymbol(sourceProp)) : undefined; - var targetClass = getDeclaredTypeOfSymbol(getParentOfSymbol(targetProp)); - if (!sourceClass || !hasBaseType(sourceClass, targetClass)) { + if (!isValidOverrideOf(sourceProp, targetProp)) { if (reportErrors) { - reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(sourceClass || source), typeToString(targetClass)); + reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(getDeclaringClass(sourceProp) || source), typeToString(getDeclaringClass(targetProp) || target)); } return 0; } @@ -27179,7 +29220,7 @@ var ts; return 0; } result &= related; - if (relation !== comparableRelation && sourceProp.flags & 536870912 && !(targetProp.flags & 536870912)) { + if (relation !== comparableRelation && sourceProp.flags & 67108864 && !(targetProp.flags & 67108864)) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); } @@ -27200,8 +29241,8 @@ var ts; return 0; } var result = -1; - for (var _i = 0, sourceProperties_1 = sourceProperties; _i < sourceProperties_1.length; _i++) { - var sourceProp = sourceProperties_1[_i]; + for (var _i = 0, sourceProperties_2 = sourceProperties; _i < sourceProperties_2.length; _i++) { + var sourceProp = sourceProperties_2[_i]; var targetProp = getPropertyOfObjectType(target, sourceProp.name); if (!targetProp) { return 0; @@ -27257,7 +29298,7 @@ var ts; return result; } function signatureRelatedTo(source, target, reportErrors) { - return compareSignaturesRelated(source, target, false, reportErrors, reportError, isRelatedTo); + return compareSignaturesRelated(source, target, false, false, reportErrors, reportError, isRelatedTo); } function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); @@ -27266,7 +29307,7 @@ var ts; return 0; } var result = -1; - for (var i = 0, len = sourceSignatures.length; i < len; i++) { + for (var i = 0; i < sourceSignatures.length; i++) { var related = compareSignaturesIdentical(sourceSignatures[i], targetSignatures[i], false, false, false, isRelatedTo); if (!related) { return 0; @@ -27299,12 +29340,12 @@ var ts; } return related; } - function indexTypesRelatedTo(source, originalSource, target, kind, reportErrors) { + function indexTypesRelatedTo(source, target, kind, sourceIsPrimitive, reportErrors) { if (relation === identityRelation) { return indexTypesIdenticalTo(source, target, kind); } var targetInfo = getIndexInfoOfType(target, kind); - if (!targetInfo || ((targetInfo.type.flags & 1) && !(originalSource.flags & 8190))) { + if (!targetInfo || targetInfo.type.flags & 1 && !sourceIsPrimitive) { return -1; } var sourceInfo = getIndexInfoOfType(source, kind) || @@ -27362,6 +29403,37 @@ var ts; return false; } } + function forEachProperty(prop, callback) { + if (getCheckFlags(prop) & 6) { + for (var _i = 0, _a = prop.containingType.types; _i < _a.length; _i++) { + var t = _a[_i]; + var p = getPropertyOfType(t, prop.name); + var result = p && forEachProperty(p, callback); + if (result) { + return result; + } + } + return undefined; + } + return callback(prop); + } + function getDeclaringClass(prop) { + return prop.parent && prop.parent.flags & 32 ? getDeclaredTypeOfSymbol(getParentOfSymbol(prop)) : undefined; + } + function isPropertyInClassDerivedFrom(prop, baseClass) { + return forEachProperty(prop, function (sp) { + var sourceClass = getDeclaringClass(sp); + return sourceClass ? hasBaseType(sourceClass, baseClass) : false; + }); + } + function isValidOverrideOf(sourceProp, targetProp) { + return !forEachProperty(targetProp, function (tp) { return getDeclarationModifierFlagsFromSymbol(tp) & 16 ? + !isPropertyInClassDerivedFrom(sourceProp, getDeclaringClass(tp)) : false; }); + } + function isClassDerivedFromDeclaringClasses(checkClass, prop) { + return forEachProperty(prop, function (p) { return getDeclarationModifierFlagsFromSymbol(p) & 16 ? + !hasBaseType(checkClass, getDeclaringClass(p)) : false; }) ? undefined : checkClass; + } function isAbstractConstructorType(type) { if (getObjectFlags(type) & 16) { var symbol = type.symbol; @@ -27374,16 +29446,18 @@ var ts; } return false; } - function isDeeplyNestedGeneric(type, stack, depth) { - if (getObjectFlags(type) & (4 | 64) && depth >= 5) { + function isDeeplyNestedType(type, stack, depth) { + if (depth >= 5 && type.flags & 32768) { var symbol = type.symbol; - var count = 0; - for (var i = 0; i < depth; i++) { - var t = stack[i]; - if (getObjectFlags(t) & (4 | 64) && t.symbol === symbol) { - count++; - if (count >= 5) - return true; + if (symbol) { + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (t.flags & 32768 && t.symbol === symbol) { + count++; + if (count >= 5) + return true; + } } } } @@ -27407,7 +29481,7 @@ var ts; } } else { - if ((sourceProp.flags & 536870912) !== (targetProp.flags & 536870912)) { + if ((sourceProp.flags & 67108864) !== (targetProp.flags & 67108864)) { return 0; } } @@ -27437,7 +29511,7 @@ var ts; if (!(isMatchingSignature(source, target, partialMatch))) { return 0; } - if ((source.typeParameters ? source.typeParameters.length : 0) !== (target.typeParameters ? target.typeParameters.length : 0)) { + if (ts.length(source.typeParameters) !== ts.length(target.typeParameters)) { return 0; } source = getErasedSignature(source); @@ -27475,8 +29549,8 @@ var ts; return signature.hasRestParameter && parameterIndex >= signature.parameters.length - 1; } function isSupertypeOfEach(candidate, types) { - for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { - var t = types_7[_i]; + for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { + var t = types_10[_i]; if (candidate !== t && !isTypeSubtypeOf(t, candidate)) return false; } @@ -27484,8 +29558,8 @@ var ts; } function literalTypesWithSameBaseType(types) { var commonBaseType; - for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { - var t = types_8[_i]; + for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { + var t = types_11[_i]; var baseType = getBaseTypeOfLiteralType(t); if (!commonBaseType) { commonBaseType = baseType; @@ -27576,8 +29650,8 @@ var ts; } function getFalsyFlagsOfTypes(types) { var result = 0; - for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { - var t = types_9[_i]; + for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { + var t = types_12[_i]; result |= getFalsyFlags(t); } return result; @@ -27606,7 +29680,7 @@ var ts; types.push(undefinedType); if (flags & 4096) types.push(nullType); - return getUnionType(types, true); + return getUnionType(types); } function removeDefinitelyFalsyTypes(type) { return getFalsyFlags(type) & 7392 ? @@ -27621,8 +29695,8 @@ var ts; getSignaturesOfType(type, 0).length === 0 && getSignaturesOfType(type, 1).length === 0; } - function createTransientSymbol(source, type) { - var symbol = createSymbol(source.flags | 67108864, source.name); + function createSymbolWithType(source, type) { + var symbol = createSymbol(source.flags, source.name); symbol.declarations = source.declarations; symbol.parent = source.parent; symbol.type = type; @@ -27638,9 +29712,8 @@ var ts; var property = _a[_i]; var original = getTypeOfSymbol(property); var updated = f(original); - members[property.name] = updated === original ? property : createTransientSymbol(property, updated); + members.set(property.name, updated === original ? property : createSymbolWithType(property, updated)); } - ; return members; } function getRegularTypeOfObjectLiteral(type) { @@ -27659,11 +29732,17 @@ var ts; type.regularType = regularNew; return regularNew; } + function getWidenedProperty(prop) { + var original = getTypeOfSymbol(prop); + var widened = getWidenedType(original); + return widened === original ? prop : createSymbolWithType(prop, widened); + } function getWidenedTypeOfObjectLiteral(type) { - var members = transformTypeOfMembers(type, function (prop) { - var widened = getWidenedType(prop); - return prop === widened ? prop : widened; - }); + var members = ts.createMap(); + for (var _i = 0, _a = getPropertiesOfObjectType(type); _i < _a.length; _i++) { + var prop = _a[_i]; + members.set(prop.name, prop.flags & 4 ? getWidenedProperty(prop) : prop); + } var stringIndexInfo = getIndexInfoOfType(type, 0); var numberIndexInfo = getIndexInfoOfType(type, 1); return createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexInfo && createIndexInfo(getWidenedType(stringIndexInfo.type), stringIndexInfo.isReadonly), numberIndexInfo && createIndexInfo(getWidenedType(numberIndexInfo.type), numberIndexInfo.isReadonly)); @@ -27724,25 +29803,25 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { + case 148: case 147: - case 146: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 144: + case 145: diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 174: + case 175: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; break; - case 225: + case 227: + case 150: case 149: - case 148: - case 151: case 152: - case 184: + case 153: case 185: + case 186: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -27755,7 +29834,7 @@ var ts; error(declaration, diagnostic, ts.declarationNameToString(declaration.name), typeAsString); } function reportErrorsFromWidening(declaration, type) { - if (produceDiagnostics && compilerOptions.noImplicitAny && type.flags & 2097152) { + if (produceDiagnostics && noImplicitAny && type.flags & 2097152) { if (!reportWideningErrorsInType(type)) { reportImplicitAnyError(declaration, type); } @@ -27781,13 +29860,14 @@ var ts; callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i)); } } - function createInferenceContext(signature, inferUnionTypes) { + function createInferenceContext(signature, inferUnionTypes, useAnyForNoInferences) { var inferences = ts.map(signature.typeParameters, createTypeInferencesObject); return { signature: signature, inferUnionTypes: inferUnionTypes, inferences: inferences, inferredTypes: new Array(signature.typeParameters.length), + useAnyForNoInferences: useAnyForNoInferences }; } function createTypeInferencesObject() { @@ -27798,25 +29878,69 @@ var ts; isFixed: false, }; } - function couldContainTypeParameters(type) { + function couldContainTypeVariables(type) { var objectFlags = getObjectFlags(type); - return !!(type.flags & 16384 || - objectFlags & 4 && ts.forEach(type.typeArguments, couldContainTypeParameters) || + return !!(type.flags & 540672 || + objectFlags & 4 && ts.forEach(type.typeArguments, couldContainTypeVariables) || objectFlags & 16 && type.symbol && type.symbol.flags & (8192 | 2048 | 32) || objectFlags & 32 || - type.flags & 196608 && couldUnionOrIntersectionContainTypeParameters(type)); + type.flags & 196608 && couldUnionOrIntersectionContainTypeVariables(type)); } - function couldUnionOrIntersectionContainTypeParameters(type) { - if (type.couldContainTypeParameters === undefined) { - type.couldContainTypeParameters = ts.forEach(type.types, couldContainTypeParameters); + function couldUnionOrIntersectionContainTypeVariables(type) { + if (type.couldContainTypeVariables === undefined) { + type.couldContainTypeVariables = ts.forEach(type.types, couldContainTypeVariables); } - return type.couldContainTypeParameters; + return type.couldContainTypeVariables; } function isTypeParameterAtTopLevel(type, typeParameter) { return type === typeParameter || type.flags & 196608 && ts.forEach(type.types, function (t) { return isTypeParameterAtTopLevel(t, typeParameter); }); } - function inferTypes(context, originalSource, originalTarget) { - var typeParameters = context.signature.typeParameters; + function inferTypeForHomomorphicMappedType(source, target) { + var properties = getPropertiesOfType(source); + var indexInfo = getIndexInfoOfType(source, 0); + if (properties.length === 0 && !indexInfo) { + return undefined; + } + var typeVariable = getIndexedAccessType(getConstraintTypeFromMappedType(target).type, getTypeParameterFromMappedType(target)); + var typeVariableArray = [typeVariable]; + var typeInferences = createTypeInferencesObject(); + var typeInferencesArray = [typeInferences]; + var templateType = getTemplateTypeFromMappedType(target); + var readonlyMask = target.declaration.readonlyToken ? false : true; + var optionalMask = target.declaration.questionToken ? 0 : 67108864; + var members = createSymbolTable(properties); + for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) { + var prop = properties_5[_i]; + var inferredPropType = inferTargetType(getTypeOfSymbol(prop)); + if (!inferredPropType) { + return undefined; + } + var inferredProp = createSymbol(4 | prop.flags & optionalMask, prop.name); + inferredProp.checkFlags = readonlyMask && isReadonlySymbol(prop) ? 8 : 0; + inferredProp.declarations = prop.declarations; + inferredProp.type = inferredPropType; + members.set(prop.name, inferredProp); + } + if (indexInfo) { + var inferredIndexType = inferTargetType(indexInfo.type); + if (!inferredIndexType) { + return undefined; + } + indexInfo = createIndexInfo(inferredIndexType, readonlyMask && indexInfo.isReadonly); + } + return createAnonymousType(undefined, members, emptyArray, emptyArray, indexInfo, undefined); + function inferTargetType(sourceType) { + typeInferences.primary = undefined; + typeInferences.secondary = undefined; + inferTypes(typeVariableArray, typeInferencesArray, sourceType, templateType); + var inferences = typeInferences.primary || typeInferences.secondary; + return inferences && getUnionType(inferences, true); + } + } + function inferTypesWithContext(context, originalSource, originalTarget) { + inferTypes(context.signature.typeParameters, context.inferences, originalSource, originalTarget); + } + function inferTypes(typeVariables, typeInferences, originalSource, originalTarget) { var sourceStack; var targetStack; var depth = 0; @@ -27832,7 +29956,7 @@ var ts; return false; } function inferFromTypes(source, target) { - if (!couldContainTypeParameters(target)) { + if (!couldContainTypeVariables(target)) { return; } if (source.aliasSymbol && source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol) { @@ -27871,13 +29995,13 @@ var ts; target = removeTypesFromUnionOrIntersection(target, matchingTypes); } } - if (target.flags & 16384) { + if (target.flags & 540672) { if (source.flags & 8388608) { return; } - for (var i = 0; i < typeParameters.length; i++) { - if (target === typeParameters[i]) { - var inferences = context.inferences[i]; + for (var i = 0; i < typeVariables.length; i++) { + if (target === typeVariables[i]) { + var inferences = typeInferences[i]; if (!inferences.isFixed) { var candidates = inferiority ? inferences.secondary || (inferences.secondary = []) : @@ -27885,7 +30009,7 @@ var ts; if (!ts.contains(candidates, source)) { candidates.push(source); } - if (!isTypeParameterAtTopLevel(originalTarget, target)) { + if (target.flags & 16384 && !isTypeParameterAtTopLevel(originalTarget, target)) { inferences.topLevel = false; } } @@ -27903,21 +30027,21 @@ var ts; } else if (target.flags & 196608) { var targetTypes = target.types; - var typeParameterCount = 0; - var typeParameter = void 0; - for (var _d = 0, targetTypes_2 = targetTypes; _d < targetTypes_2.length; _d++) { - var t = targetTypes_2[_d]; - if (t.flags & 16384 && ts.contains(typeParameters, t)) { - typeParameter = t; - typeParameterCount++; + var typeVariableCount = 0; + var typeVariable = void 0; + for (var _d = 0, targetTypes_3 = targetTypes; _d < targetTypes_3.length; _d++) { + var t = targetTypes_3[_d]; + if (t.flags & 540672 && ts.contains(typeVariables, t)) { + typeVariable = t; + typeVariableCount++; } else { inferFromTypes(source, t); } } - if (typeParameterCount === 1) { + if (typeVariableCount === 1) { inferiority++; - inferFromTypes(source, typeParameter); + inferFromTypes(source, typeVariable); inferiority--; } } @@ -27934,14 +30058,14 @@ var ts; if (isInProcess(source, target)) { return; } - if (isDeeplyNestedGeneric(source, sourceStack, depth) && isDeeplyNestedGeneric(target, targetStack, depth)) { + if (isDeeplyNestedType(source, sourceStack, depth) && isDeeplyNestedType(target, targetStack, depth)) { return; } var key = source.id + "," + target.id; - if (visited[key]) { + if (visited.get(key)) { return; } - visited[key] = true; + visited.set(key, true); if (depth === 0) { sourceStack = []; targetStack = []; @@ -27957,9 +30081,16 @@ var ts; function inferFromObjectTypes(source, target) { if (getObjectFlags(target) & 32) { var constraintType = getConstraintTypeFromMappedType(target); - if (getObjectFlags(source) & 32) { - inferFromTypes(getConstraintTypeFromMappedType(source), constraintType); - inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target)); + if (constraintType.flags & 262144) { + var index = ts.indexOf(typeVariables, constraintType.type); + if (index >= 0 && !typeInferences[index].isFixed) { + var inferredType = inferTypeForHomomorphicMappedType(source, target); + if (inferredType) { + inferiority++; + inferFromTypes(inferredType, typeVariables[index]); + inferiority--; + } + } return; } if (constraintType.flags & 16384) { @@ -27975,8 +30106,8 @@ var ts; } function inferFromProperties(source, target) { var properties = getPropertiesOfObjectType(target); - for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) { - var targetProp = properties_4[_i]; + for (var _i = 0, properties_6 = properties; _i < properties_6.length; _i++) { + var targetProp = properties_6[_i]; var sourceProp = getPropertyOfObjectType(source, targetProp.name); if (sourceProp) { inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); @@ -28026,8 +30157,8 @@ var ts; } } function typeIdenticalToSomeType(type, types) { - for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { - var t = types_10[_i]; + for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { + var t = types_13[_i]; if (isTypeIdenticalTo(t, type)) { return true; } @@ -28068,7 +30199,13 @@ var ts; inferenceSucceeded = !!unionOrSuperType; } else { - inferredType = emptyObjectType; + var defaultType = getDefaultFromTypeParameter(context.signature.typeParameters[index]); + if (defaultType) { + inferredType = instantiateType(defaultType, combineTypeMappers(createBackreferenceMapper(context.signature.typeParameters, index), getInferenceMapper(context))); + } + else { + inferredType = context.useAnyForNoInferences ? anyType : emptyObjectType; + } inferenceSucceeded = true; } context.inferredTypes[index] = inferredType; @@ -28101,19 +30238,7 @@ var ts; return links.resolvedSymbol; } function isInTypeQuery(node) { - while (node) { - switch (node.kind) { - case 160: - return true; - case 70: - case 141: - node = node.parent; - continue; - default: - return false; - } - } - ts.Debug.fail("should not get here"); + return !!ts.findAncestor(node, function (n) { return n.kind === 161 ? true : n.kind === 70 || n.kind === 142 ? false : "quit"; }); } function getFlowCacheKey(node) { if (node.kind === 70) { @@ -28123,7 +30248,7 @@ var ts; if (node.kind === 98) { return "0"; } - if (node.kind === 177) { + if (node.kind === 178) { var key = getFlowCacheKey(node.expression); return key && key + "." + node.name.text; } @@ -28134,7 +30259,7 @@ var ts; case 70: case 98: return node; - case 177: + case 178: return getLeftmostIdentifierOrThis(node.expression); } return undefined; @@ -28143,19 +30268,21 @@ var ts; switch (source.kind) { case 70: return target.kind === 70 && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 223 || target.kind === 174) && + (target.kind === 225 || target.kind === 175) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 98: return target.kind === 98; - case 177: - return target.kind === 177 && + case 96: + return target.kind === 96; + case 178: + return target.kind === 178 && source.name.text === target.name.text && isMatchingReference(source.expression, target.expression); } return false; } function containsMatchingReference(source, target) { - while (source.kind === 177) { + while (source.kind === 178) { source = source.expression; if (isMatchingReference(source, target)) { return true; @@ -28164,7 +30291,7 @@ var ts; return false; } function containsMatchingReferenceDiscriminant(source, target) { - return target.kind === 177 && + return target.kind === 178 && containsMatchingReference(source, target.expression) && isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.text); } @@ -28172,7 +30299,7 @@ var ts; if (expr.kind === 70) { return getTypeOfSymbol(getResolvedSymbol(expr)); } - if (expr.kind === 177) { + if (expr.kind === 178) { var type = getDeclaredTypeOfReference(expr.expression); return type && getTypeOfPropertyOfType(type, expr.name.text); } @@ -28181,9 +30308,9 @@ var ts; function isDiscriminantProperty(type, name) { if (type && type.flags & 65536) { var prop = getUnionOrIntersectionProperty(type, name); - if (prop && prop.flags & 268435456) { + if (prop && getCheckFlags(prop) & 2) { if (prop.isDiscriminantProperty === undefined) { - prop.isDiscriminantProperty = prop.hasNonUniformType && isLiteralType(getTypeOfSymbol(prop)); + prop.isDiscriminantProperty = prop.checkFlags & 32 && isLiteralType(getTypeOfSymbol(prop)); } return prop.isDiscriminantProperty; } @@ -28202,7 +30329,7 @@ var ts; } } } - if (callExpression.expression.kind === 177 && + if (callExpression.expression.kind === 178 && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -28241,8 +30368,8 @@ var ts; } function getTypeFactsOfTypes(types) { var result = 0; - for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { - var t = types_11[_i]; + for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { + var t = types_14[_i]; result |= getTypeFacts(t); } return result; @@ -28250,7 +30377,7 @@ var ts; function isFunctionObjectType(type) { var resolved = resolveStructuredTypeMembers(type); return !!(resolved.callSignatures.length || resolved.constructSignatures.length || - resolved.members["bind"] && isTypeSubtypeOf(type, globalFunctionType)); + resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType)); } function getTypeFacts(type) { var flags = type.flags; @@ -28293,9 +30420,11 @@ var ts; if (flags & 512) { return strictNullChecks ? 1981320 : 4193160; } - if (flags & 16384) { - var constraint = getConstraintOfTypeParameter(type); - return getTypeFacts(constraint || emptyObjectType); + if (flags & 16777216) { + return strictNullChecks ? 6166480 : 8378320; + } + if (flags & 540672) { + return getTypeFacts(getBaseConstraintOfType(type) || emptyObjectType); } if (flags & 196608) { return getTypeFactsOfTypes(type.types); @@ -28321,17 +30450,23 @@ var ts; } function getTypeOfDestructuredArrayElement(type, index) { return isTupleLikeType(type) && getTypeOfPropertyOfType(type, "" + index) || - checkIteratedTypeOrElementType(type, undefined, false) || + checkIteratedTypeOrElementType(type, undefined, false, false) || unknownType; } function getTypeOfDestructuredSpreadExpression(type) { - return createArrayType(checkIteratedTypeOrElementType(type, undefined, false) || unknownType); + return createArrayType(checkIteratedTypeOrElementType(type, undefined, false, false) || unknownType); } function getAssignedTypeOfBinaryExpression(node) { - return node.parent.kind === 175 || node.parent.kind === 257 ? + var isDestructuringDefaultAssignment = node.parent.kind === 176 && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 260 && isDestructuringAssignmentTarget(node.parent.parent); + return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } + function isDestructuringAssignmentTarget(parent) { + return parent.parent.kind === 193 && parent.parent.left === parent || + parent.parent.kind === 215 && parent.parent.initializer === parent; + } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), ts.indexOf(node.elements, element)); } @@ -28347,21 +30482,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 212: + case 214: return stringType; - case 213: - return checkRightHandSideOfForOf(parent.expression) || unknownType; - case 192: + case 215: + return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || unknownType; + case 193: return getAssignedTypeOfBinaryExpression(parent); - case 186: + case 187: return undefinedType; - case 175: + case 176: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 196: + case 197: return getAssignedTypeOfSpreadExpression(parent); - case 257: + case 260: return getAssignedTypeOfPropertyAssignment(parent); - case 258: + case 261: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return unknownType; @@ -28369,7 +30504,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 172 ? + var type = pattern.kind === 173 ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, ts.indexOf(pattern.elements, node)) : @@ -28384,35 +30519,35 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 212) { + if (node.parent.parent.kind === 214) { return stringType; } - if (node.parent.parent.kind === 213) { - return checkRightHandSideOfForOf(node.parent.parent.expression) || unknownType; + if (node.parent.parent.kind === 215) { + return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || unknownType; } return unknownType; } function getInitialType(node) { - return node.kind === 223 ? + return node.kind === 225 ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function getInitialOrAssignedType(node) { - return node.kind === 223 || node.kind === 174 ? + return node.kind === 225 || node.kind === 175 ? getInitialType(node) : getAssignedType(node); } function isEmptyArrayAssignment(node) { - return node.kind === 223 && node.initializer && + return node.kind === 225 && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 174 && node.parent.kind === 192 && + node.kind !== 175 && node.parent.kind === 193 && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 183: + case 184: return getReferenceCandidate(node.expression); - case 192: + case 193: switch (node.operatorToken.kind) { case 57: return getReferenceCandidate(node.left); @@ -28424,13 +30559,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 183 || - parent.kind === 192 && parent.operatorToken.kind === 57 && parent.left === node || - parent.kind === 192 && parent.operatorToken.kind === 25 && parent.right === node ? + return parent.kind === 184 || + parent.kind === 193 && parent.operatorToken.kind === 57 && parent.left === node || + parent.kind === 193 && parent.operatorToken.kind === 25 && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 253) { + if (clause.kind === 256) { var caseType = getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); return isUnitType(caseType) ? caseType : undefined; } @@ -28476,8 +30611,29 @@ var ts; } return f(type) ? type : neverType; } - function mapType(type, f) { - return type.flags & 65536 ? getUnionType(ts.map(type.types, f)) : f(type); + function mapType(type, mapper) { + if (!(type.flags & 65536)) { + return mapper(type); + } + var types = type.types; + var mappedType; + var mappedTypes; + for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { + var current = types_15[_i]; + var t = mapper(current); + if (t) { + if (!mappedType) { + mappedType = t; + } + else if (!mappedTypes) { + mappedTypes = [mappedType, t]; + } + else { + mappedTypes.push(t); + } + } + } + return mappedTypes ? getUnionType(mappedTypes) : mappedType; } function extractTypesOfKind(type, kind) { return filterType(type, function (t) { return (t.flags & kind) !== 0; }); @@ -28511,7 +30667,7 @@ var ts; return evolvingArrayTypes[elementType.id] || (evolvingArrayTypes[elementType.id] = createEvolvingArrayType(elementType)); } function addEvolvingArrayElementType(evolvingArrayType, node) { - var elementType = getBaseTypeOfLiteralType(getTypeOfExpression(node)); + var elementType = getBaseTypeOfLiteralType(getContextFreeTypeOfExpression(node)); return isTypeSubsetOf(elementType, evolvingArrayType.elementType) ? evolvingArrayType : getEvolvingArrayType(getUnionType([evolvingArrayType.elementType, elementType])); } function createFinalArrayType(elementType) { @@ -28532,8 +30688,8 @@ var ts; } function isEvolvingArrayTypeList(types) { var hasEvolvingArrayType = false; - for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { - var t = types_12[_i]; + for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { + var t = types_16[_i]; if (!(t.flags & 8192)) { if (!(getObjectFlags(t) & 256)) { return false; @@ -28551,11 +30707,11 @@ var ts; function isEvolvingArrayOperationTarget(node) { var root = getReferenceRoot(node); var parent = root.parent; - var isLengthPushOrUnshift = parent.kind === 177 && (parent.name.text === "length" || - parent.parent.kind === 179 && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 178 && + var isLengthPushOrUnshift = parent.kind === 178 && (parent.name.text === "length" || + parent.parent.kind === 180 && ts.isPushOrUnshiftIdentifier(parent.name)); + var isElementAssignment = parent.kind === 179 && parent.expression === root && - parent.parent.kind === 192 && + parent.parent.kind === 193 && parent.parent.operatorToken.kind === 57 && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -28582,19 +30738,17 @@ var ts; } return false; } - function getFlowTypeOfReference(reference, declaredType, assumeInitialized, flowContainer) { + function getFlowTypeOfReference(reference, declaredType, initialType, flowContainer, couldBeUninitialized) { + if (initialType === void 0) { initialType = declaredType; } var key; - if (!reference.flowNode || assumeInitialized && !(declaredType.flags & 1033215)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 17810431)) { return declaredType; } - var initialType = assumeInitialized ? declaredType : - declaredType === autoType || declaredType === autoArrayType ? undefinedType : - includeFalsyTypes(declaredType, 2048); var visitedFlowStart = visitedFlowCount; var evolvedType = getTypeFromFlowType(getTypeAtFlowNode(reference.flowNode)); visitedFlowCount = visitedFlowStart; var resultType = getObjectFlags(evolvedType) & 256 && isEvolvingArrayOperationTarget(reference) ? anyArrayType : finalizeEvolvingArrayType(evolvedType); - if (reference.parent.kind === 201 && getTypeWithFacts(resultType, 524288).flags & 8192) { + if (reference.parent.kind === 202 && getTypeWithFacts(resultType, 524288).flags & 8192) { return declaredType; } return resultType; @@ -28608,7 +30762,16 @@ var ts; } } var type = void 0; - if (flow.flags & 16) { + if (flow.flags & 4096) { + flow.locked = true; + type = getTypeAtFlowNode(flow.antecedent); + flow.locked = false; + } + else if (flow.flags & 2048) { + flow = flow.antecedent; + continue; + } + else if (flow.flags & 16) { type = getTypeAtFlowAssignment(flow); if (!type) { flow = flow.antecedent; @@ -28639,7 +30802,7 @@ var ts; } else if (flow.flags & 2) { var container = flow.container; - if (container && container !== flowContainer && reference.kind !== 177) { + if (container && container !== flowContainer && reference.kind !== 178 && reference.kind !== 98) { flow = container.flowNode; continue; } @@ -28682,7 +30845,7 @@ var ts; } function getTypeAtFlowArrayMutation(flow) { var node = flow.node; - var expr = node.kind === 179 ? + var expr = node.kind === 180 ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -28690,7 +30853,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (getObjectFlags(type) & 256) { var evolvedType_1 = type; - if (node.kind === 179) { + if (node.kind === 180) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -28742,6 +30905,9 @@ var ts; var seenIncomplete = false; for (var _i = 0, _a = flow.antecedents; _i < _a.length; _i++) { var antecedent = _a[_i]; + if (antecedent.flags & 2048 && antecedent.lock.locked) { + continue; + } var flowType = getTypeAtFlowNode(antecedent); var type = getTypeFromFlowType(flowType); if (type === declaredType && declaredType === initialType) { @@ -28765,8 +30931,9 @@ var ts; if (!key) { key = getFlowCacheKey(reference); } - if (cache[key]) { - return cache[key]; + var cached = cache.get(key); + if (cached) { + return cached; } for (var i = flowLoopStart; i < flowLoopCount; i++) { if (flowLoopNodes[i] === flow && flowLoopKeys[i] === key && flowLoopTypes[i].length) { @@ -28788,8 +30955,9 @@ var ts; firstAntecedentType = flowType; } var type = getTypeFromFlowType(flowType); - if (cache[key]) { - return cache[key]; + var cached_1 = cache.get(key); + if (cached_1) { + return cached_1; } if (!ts.contains(antecedentTypes, type)) { antecedentTypes.push(type); @@ -28805,10 +30973,11 @@ var ts; if (isIncomplete(firstAntecedentType)) { return createFlowType(result, true); } - return cache[key] = result; + cache.set(key, result); + return result; } function isMatchingReferenceDiscriminant(expr) { - return expr.kind === 177 && + return expr.kind === 178 && declaredType.flags & 65536 && isMatchingReference(reference, expr.expression) && isDiscriminantProperty(declaredType, expr.name.text); @@ -28842,10 +31011,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 187 && right_1.kind === 9) { + if (left_1.kind === 188 && right_1.kind === 9) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 187 && left_1.kind === 9) { + if (right_1.kind === 188 && left_1.kind === 9) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (isMatchingReference(reference, left_1)) { @@ -28891,7 +31060,7 @@ var ts; assumeTrue ? 16384 : 131072; return getTypeWithFacts(type, facts); } - if (type.flags & 33281) { + if (type.flags & 16810497) { return type; } if (assumeTrue) { @@ -28916,14 +31085,22 @@ var ts; assumeTrue = !assumeTrue; } if (assumeTrue && !(type.flags & 65536)) { - var targetType = typeofTypesByName[literal.text]; - if (targetType && isTypeSubtypeOf(targetType, type)) { - return targetType; + var targetType = typeofTypesByName.get(literal.text); + if (targetType) { + if (isTypeSubtypeOf(targetType, type)) { + return targetType; + } + if (type.flags & 540672) { + var constraint = getBaseConstraintOfType(type) || anyType; + if (isTypeSubtypeOf(targetType, constraint)) { + return getIntersectionType([type, targetType]); + } + } } } var facts = assumeTrue ? - typeofEQFacts[literal.text] || 64 : - typeofNEFacts[literal.text] || 8192; + typeofEQFacts.get(literal.text) || 64 : + typeofNEFacts.get(literal.text) || 8192; return getTypeWithFacts(type, facts); } function narrowTypeBySwitchOnDiscriminant(type, switchStatement, clauseStart, clauseEnd) { @@ -28992,10 +31169,9 @@ var ts; return assignableType; } } - var targetType = type.flags & 16384 ? getApparentType(type) : type; return isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : - isTypeAssignableTo(candidate, targetType) ? candidate : + isTypeAssignableTo(candidate, type) ? candidate : getIntersectionType([type, candidate]); } function narrowTypeByTypePredicate(type, callExpression, assumeTrue) { @@ -29023,7 +31199,7 @@ var ts; } else { var invokedExpression = ts.skipParentheses(callExpression.expression); - if (invokedExpression.kind === 178 || invokedExpression.kind === 177) { + if (invokedExpression.kind === 179 || invokedExpression.kind === 178) { var accessExpression = invokedExpression; var possibleReference = ts.skipParentheses(accessExpression.expression); if (isMatchingReference(reference, possibleReference)) { @@ -29040,15 +31216,16 @@ var ts; switch (expr.kind) { case 70: case 98: - case 177: + case 96: + case 178: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 179: + case 180: return narrowTypeByTypePredicate(type, expr, assumeTrue); - case 183: + case 184: return narrowType(type, expr.expression, assumeTrue); - case 192: + case 193: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 190: + case 191: if (expr.operator === 50) { return narrowType(type, expr.operand, !assumeTrue); } @@ -29072,15 +31249,12 @@ var ts; return getTypeOfSymbol(symbol); } function getControlFlowContainer(node) { - while (true) { - node = node.parent; - if (ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 231 || - node.kind === 261 || - node.kind === 147) { - return node; - } - } + return ts.findAncestor(node.parent, function (node) { + return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || + node.kind === 233 || + node.kind === 264 || + node.kind === 148; + }); } function isParameterAssigned(symbol) { var func = ts.getRootDeclaration(symbol.valueDeclaration).parent; @@ -29094,21 +31268,13 @@ var ts; return symbol.isAssigned || false; } function hasParentWithAssignmentsMarked(node) { - while (true) { - node = node.parent; - if (!node) { - return false; - } - if (ts.isFunctionLike(node) && getNodeLinks(node).flags & 4194304) { - return true; - } - } + return !!ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !!(getNodeLinks(node).flags & 4194304); }); } function markParameterAssignments(node) { if (node.kind === 70) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 144) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 145) { symbol.isAssigned = true; } } @@ -29120,6 +31286,14 @@ var ts; function isConstVariable(symbol) { return symbol.flags & 3 && (getDeclarationNodeFlagsFromSymbol(symbol) & 2) !== 0 && getTypeOfSymbol(symbol) !== autoArrayType; } + function removeOptionalityFromDeclaredType(declaredType, declaration) { + var annotationIncludesUndefined = strictNullChecks && + declaration.kind === 145 && + declaration.initializer && + getFalsyFlags(declaredType) & 2048 && + !(getFalsyFlags(checkExpression(declaration.initializer)) & 2048); + return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 131072) : declaredType; + } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); if (symbol === unknownSymbol) { @@ -29128,16 +31302,14 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2) { - if (container.kind === 185) { + if (container.kind === 186) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasModifier(container, 256)) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method); } } - if (node.flags & 524288) { - getNodeLinks(container).flags |= 8192; - } + getNodeLinks(container).flags |= 8192; return getTypeOfSymbol(symbol); } if (symbol.flags & 8388608 && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { @@ -29146,7 +31318,7 @@ var ts; var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); if (localOrExportSymbol.flags & 32) { var declaration_1 = localOrExportSymbol.valueDeclaration; - if (declaration_1.kind === 226 + if (declaration_1.kind === 228 && ts.nodeIsDecorated(declaration_1)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -29158,11 +31330,11 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration_1.kind === 197) { + else if (declaration_1.kind === 198) { var container = ts.getThisContainer(node, false); while (container !== undefined) { if (container.parent === declaration_1) { - if (container.kind === 147 && ts.hasModifier(container, 32)) { + if (container.kind === 148 && ts.hasModifier(container, 32)) { getNodeLinks(declaration_1).flags |= 8388608; getNodeLinks(node).flags |= 16777216; } @@ -29174,6 +31346,7 @@ var ts; } checkCollisionWithCapturedSuperVariable(node, node); checkCollisionWithCapturedThisVariable(node, node); + checkCollisionWithCapturedNewTargetVariable(node, node); checkNestedBlockScopedBinding(node, symbol); var type = getTypeOfSymbol(localOrExportSymbol); var declaration = localOrExportSymbol.valueDeclaration; @@ -29191,22 +31364,25 @@ var ts; if (!(localOrExportSymbol.flags & 3) || assignmentKind === 1 || !declaration) { return type; } - var isParameter = ts.getRootDeclaration(declaration).kind === 144; + var isParameter = ts.getRootDeclaration(declaration).kind === 145; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; - while (flowContainer !== declarationContainer && (flowContainer.kind === 184 || - flowContainer.kind === 185 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 185 || + flowContainer.kind === 186 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } var assumeInitialized = isParameter || isOuterVariable || - type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1) !== 0) || + type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1) !== 0 || isInTypeQuery(node)) || ts.isInAmbientContext(declaration); - var flowType = getFlowTypeOfReference(node, type, assumeInitialized, flowContainer); + var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, ts.getRootDeclaration(declaration)) : type) : + type === autoType || type === autoArrayType ? undefinedType : + includeFalsyTypes(type, 2048); + var flowType = getFlowTypeOfReference(node, type, initialType, flowContainer, !assumeInitialized); if (type === autoType || type === autoArrayType) { if (flowType === autoType || flowType === autoArrayType) { - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { error(declaration.name, ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined, symbolToString(symbol), typeToString(flowType)); error(node, ts.Diagnostics.Variable_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType)); } @@ -29220,19 +31396,12 @@ var ts; return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType; } function isInsideFunction(node, threshold) { - var current = node; - while (current && current !== threshold) { - if (ts.isFunctionLike(current)) { - return true; - } - current = current.parent; - } - return false; + return !!ts.findAncestor(node, function (n) { return n === threshold ? "quit" : ts.isFunctionLike(n); }); } function checkNestedBlockScopedBinding(node, symbol) { if (languageVersion >= 2 || (symbol.flags & (2 | 32)) === 0 || - symbol.valueDeclaration.parent.kind === 256) { + symbol.valueDeclaration.parent.kind === 259) { return; } var container = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); @@ -29250,8 +31419,8 @@ var ts; if (usedInFunction) { getNodeLinks(current).flags |= 65536; } - if (container.kind === 211 && - ts.getAncestor(symbol.valueDeclaration, 224).parent === container && + if (container.kind === 213 && + ts.getAncestor(symbol.valueDeclaration, 226).parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 2097152; } @@ -29263,33 +31432,25 @@ var ts; } function isAssignedInBodyOfForStatement(node, container) { var current = node; - while (current.parent.kind === 183) { + while (current.parent.kind === 184) { current = current.parent; } var isAssigned = false; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 190 || current.parent.kind === 191)) { + else if ((current.parent.kind === 191 || current.parent.kind === 192)) { var expr = current.parent; isAssigned = expr.operator === 42 || expr.operator === 43; } if (!isAssigned) { return false; } - while (current !== container) { - if (current === container.statement) { - return true; - } - else { - current = current.parent; - } - } - return false; + return !!ts.findAncestor(current, function (n) { return n === container ? "quit" : n === container.statement; }); } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2; - if (container.kind === 147 || container.kind === 150) { + if (container.kind === 148 || container.kind === 151) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4; } @@ -29320,42 +31481,45 @@ var ts; var baseConstructorType = getBaseConstructorTypeOfClass(classInstanceType); return baseConstructorType === nullWideningType; } + function checkThisBeforeSuper(node, container, diagnosticMessage) { + var containingClassDecl = container.parent; + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(containingClassDecl); + if (baseTypeNode && !classDeclarationExtendsNull(containingClassDecl)) { + var superCall = getSuperCallInConstructor(container); + if (!superCall || superCall.end > node.pos) { + error(node, diagnosticMessage); + } + } + } function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 150) { - var containingClassDecl = container.parent; - var baseTypeNode = ts.getClassExtendsHeritageClauseElement(containingClassDecl); - if (baseTypeNode && !classDeclarationExtendsNull(containingClassDecl)) { - var superCall = getSuperCallInConstructor(container); - if (!superCall || superCall.end > node.pos) { - error(node, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); - } - } + if (container.kind === 151) { + checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } - if (container.kind === 185) { + if (container.kind === 186) { container = ts.getThisContainer(container, false); needToCaptureLexicalThis = (languageVersion < 2); } switch (container.kind) { - case 230: + case 232: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); break; - case 229: + case 231: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 150: + case 151: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; + case 148: case 147: - case 146: if (ts.getModifierFlags(container) & 32) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; - case 142: + case 143: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -29364,8 +31528,8 @@ var ts; } if (ts.isFunctionLike(container) && (!isInParameterInitializerBeforeContainingFunction(node) || ts.getThisParameter(container))) { - if (container.kind === 184 && - ts.isInJavaScriptFile(container.parent) && + if (container.kind === 185 && + container.parent.kind === 193 && ts.getSpecialPropertyAssignmentKind(container.parent) === 3) { var className = container.parent .left @@ -29384,7 +31548,7 @@ var ts; if (ts.isClassLike(container.parent)) { var symbol = getSymbolOfNode(container.parent); var type = ts.hasModifier(container, 32) ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType; - return getFlowTypeOfReference(node, type, true, undefined); + return getFlowTypeOfReference(node, type); } if (ts.isInJavaScriptFile(node)) { var type = getTypeForThisExpressionFromJSDoc(container); @@ -29392,34 +31556,29 @@ var ts; return type; } } - if (compilerOptions.noImplicitThis) { + if (noImplicitThis) { error(node, ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation); } return anyType; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 274) { + if (jsdocType && jsdocType.kind === 278) { var jsDocFunctionType = jsdocType; - if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].type.kind === 277) { + if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].type.kind === 281) { return getTypeFromTypeNode(jsDocFunctionType.parameters[0].type); } } } function isInConstructorArgumentInitializer(node, constructorDecl) { - for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 144) { - return true; - } - } - return false; + return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 145; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 179 && node.parent.expression === node; + var isCallExpression = node.parent.kind === 180 && node.parent.expression === node; var container = ts.getSuperContainer(node, true); var needToCaptureLexicalThis = false; if (!isCallExpression) { - while (container && container.kind === 185) { + while (container && container.kind === 186) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = languageVersion < 2; } @@ -29427,17 +31586,14 @@ var ts; var canUseSuperExpression = isLegalUsageOfSuperExpression(container); var nodeCheckFlag = 0; if (!canUseSuperExpression) { - var current = node; - while (current && current !== container && current.kind !== 142) { - current = current.parent; - } - if (current && current.kind === 142) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 143; }); + if (current && current.kind === 143) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 176)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 177)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -29445,6 +31601,9 @@ var ts; } return unknownType; } + if (!isCallExpression && container.kind === 151) { + checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); + } if ((ts.getModifierFlags(container) & 32) || isCallExpression) { nodeCheckFlag = 512; } @@ -29452,7 +31611,7 @@ var ts; nodeCheckFlag = 256; } getNodeLinks(node).flags |= nodeCheckFlag; - if (container.kind === 149 && ts.getModifierFlags(container) & 256) { + if (container.kind === 150 && ts.getModifierFlags(container) & 256) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096; } @@ -29463,7 +31622,7 @@ var ts; if (needToCaptureLexicalThis) { captureLexicalThis(node.parent, container); } - if (container.parent.kind === 176) { + if (container.parent.kind === 177) { if (languageVersion < 2) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return unknownType; @@ -29481,7 +31640,7 @@ var ts; } return unknownType; } - if (container.kind === 150 && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 151 && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return unknownType; } @@ -29493,32 +31652,50 @@ var ts; return false; } if (isCallExpression) { - return container.kind === 150; + return container.kind === 151; } else { - if (ts.isClassLike(container.parent) || container.parent.kind === 176) { + if (ts.isClassLike(container.parent) || container.parent.kind === 177) { if (ts.getModifierFlags(container) & 32) { - return container.kind === 149 || - container.kind === 148 || - container.kind === 151 || - container.kind === 152; + return container.kind === 150 || + container.kind === 149 || + container.kind === 152 || + container.kind === 153; } else { - return container.kind === 149 || - container.kind === 148 || - container.kind === 151 || + return container.kind === 150 || + container.kind === 149 || container.kind === 152 || + container.kind === 153 || + container.kind === 148 || container.kind === 147 || - container.kind === 146 || - container.kind === 150; + container.kind === 151; } } } return false; } } + function getContainingObjectLiteral(func) { + return (func.kind === 150 || + func.kind === 152 || + func.kind === 153) && func.parent.kind === 177 ? func.parent : + func.kind === 185 && func.parent.kind === 260 ? func.parent.parent : + undefined; + } + function getThisTypeArgument(type) { + return getObjectFlags(type) & 4 && type.target === globalThisType ? type.typeArguments[0] : undefined; + } + function getThisTypeFromContextualType(type) { + return mapType(type, function (t) { + return t.flags & 131072 ? ts.forEach(t.types, getThisTypeArgument) : getThisTypeArgument(t); + }); + } function getContextualThisParameterType(func) { - if (isContextSensitiveFunctionOrObjectLiteralMethod(func) && func.kind !== 185) { + if (func.kind === 186) { + return undefined; + } + if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { var contextualSignature = getContextualSignature(func); if (contextualSignature) { var thisParameter = contextualSignature.thisParameter; @@ -29527,29 +31704,55 @@ var ts; } } } + if (noImplicitThis) { + var containingLiteral = getContainingObjectLiteral(func); + if (containingLiteral) { + var contextualType = getApparentTypeOfContextualType(containingLiteral); + var literal = containingLiteral; + var type = contextualType; + while (type) { + var thisType = getThisTypeFromContextualType(type); + if (thisType) { + return instantiateType(thisType, getContextualMapper(containingLiteral)); + } + if (literal.parent.kind !== 260) { + break; + } + literal = literal.parent.parent; + type = getApparentTypeOfContextualType(literal); + } + return contextualType ? getNonNullableType(contextualType) : checkExpressionCached(containingLiteral); + } + if (func.parent.kind === 193 && func.parent.operatorToken.kind === 57) { + var target = func.parent.left; + if (target.kind === 178 || target.kind === 179) { + return checkExpressionCached(target.expression); + } + } + } return undefined; } function getContextuallyTypedParameterType(parameter) { var func = parameter.parent; if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { var iife = ts.getImmediatelyInvokedFunctionExpression(func); - if (iife) { + if (iife && iife.arguments) { var indexOfParameter = ts.indexOf(func.parameters, parameter); - if (iife.arguments && indexOfParameter < iife.arguments.length) { - if (parameter.dotDotDotToken) { - var restTypes = []; - for (var i = indexOfParameter; i < iife.arguments.length; i++) { - restTypes.push(getWidenedLiteralType(checkExpression(iife.arguments[i]))); - } - return createArrayType(getUnionType(restTypes)); + if (parameter.dotDotDotToken) { + var restTypes = []; + for (var i = indexOfParameter; i < iife.arguments.length; i++) { + restTypes.push(getWidenedLiteralType(checkExpression(iife.arguments[i]))); } - var links = getNodeLinks(iife); - var cached = links.resolvedSignature; - links.resolvedSignature = anySignature; - var type = getWidenedLiteralType(checkExpression(iife.arguments[indexOfParameter])); - links.resolvedSignature = cached; - return type; + return restTypes.length ? createArrayType(getUnionType(restTypes)) : undefined; } + var links = getNodeLinks(iife); + var cached = links.resolvedSignature; + links.resolvedSignature = anySignature; + var type = indexOfParameter < iife.arguments.length ? + getWidenedLiteralType(checkExpression(iife.arguments[indexOfParameter])) : + parameter.initializer ? undefined : undefinedWideningType; + links.resolvedSignature = cached; + return type; } var contextualSignature = getContextualSignature(func); if (contextualSignature) { @@ -29574,7 +31777,7 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 144) { + if (declaration.kind === 145) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -29585,11 +31788,11 @@ var ts; } if (ts.isBindingPattern(declaration.parent)) { var parentDeclaration = declaration.parent.parent; - var name_21 = declaration.propertyName || declaration.name; - if (ts.isVariableLike(parentDeclaration) && + var name = declaration.propertyName || declaration.name; + if (parentDeclaration.kind !== 175 && parentDeclaration.type && - !ts.isBindingPattern(name_21)) { - var text = ts.getTextOfPropertyName(name_21); + !ts.isBindingPattern(name)) { + var text = ts.getTextOfPropertyName(name); if (text) { return getTypeOfPropertyOfType(getTypeFromTypeNode(parentDeclaration.type), text); } @@ -29600,33 +31803,34 @@ var ts; } function getContextualTypeForReturnExpression(node) { var func = ts.getContainingFunction(node); - if (ts.isAsyncFunctionLike(func)) { - var contextualReturnType = getContextualReturnType(func); - if (contextualReturnType) { - return getPromisedType(contextualReturnType); + if (func) { + var functionFlags = ts.getFunctionFlags(func); + if (functionFlags & 1) { + return undefined; } - return undefined; - } - if (func && !func.asteriskToken) { - return getContextualReturnType(func); + var contextualReturnType = getContextualReturnType(func); + return functionFlags & 2 + ? contextualReturnType && getAwaitedTypeOfPromise(contextualReturnType) + : contextualReturnType; } return undefined; } function getContextualTypeForYieldOperand(node) { var func = ts.getContainingFunction(node); if (func) { + var functionFlags = ts.getFunctionFlags(func); var contextualReturnType = getContextualReturnType(func); if (contextualReturnType) { return node.asteriskToken ? contextualReturnType - : getElementTypeOfIterableIterator(contextualReturnType); + : getIteratedTypeOfGenerator(contextualReturnType, (functionFlags & 2) !== 0); } } return undefined; } function isInParameterInitializerBeforeContainingFunction(node) { while (node.parent && !ts.isFunctionLike(node.parent)) { - if (node.parent.kind === 144 && node.parent.initializer === node) { + if (node.parent.kind === 145 && node.parent.initializer === node) { return true; } node = node.parent; @@ -29635,8 +31839,8 @@ var ts; } function getContextualReturnType(functionDecl) { if (functionDecl.type || - functionDecl.kind === 150 || - functionDecl.kind === 151 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 152))) { + functionDecl.kind === 151 || + functionDecl.kind === 152 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 153))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl)); } var signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl); @@ -29655,7 +31859,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 181) { + if (template.parent.kind === 182) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -29685,38 +31889,14 @@ var ts; } return undefined; } - function applyToContextualType(type, mapper) { - if (!(type.flags & 65536)) { - return mapper(type); - } - var types = type.types; - var mappedType; - var mappedTypes; - for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { - var current = types_13[_i]; - var t = mapper(current); - if (t) { - if (!mappedType) { - mappedType = t; - } - else if (!mappedTypes) { - mappedTypes = [mappedType, t]; - } - else { - mappedTypes.push(t); - } - } - } - return mappedTypes ? getUnionType(mappedTypes) : mappedType; - } function getTypeOfPropertyOfContextualType(type, name) { - return applyToContextualType(type, function (t) { + return mapType(type, function (t) { var prop = t.flags & 229376 ? getPropertyOfType(t, name) : undefined; return prop ? getTypeOfSymbol(prop) : undefined; }); } function getIndexTypeOfContextualType(type, kind) { - return applyToContextualType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }); + return mapType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }); } function contextualTypeIsTupleLikeType(type) { return !!(type.flags & 65536 ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type)); @@ -29751,7 +31931,7 @@ var ts; var index = ts.indexOf(arrayLiteral.elements, node); return getTypeOfPropertyOfContextualType(type, "" + index) || getIndexTypeOfContextualType(type, 1) - || (languageVersion >= 2 ? getElementTypeOfIterable(type, undefined) : undefined); + || getIteratedTypeOrElementType(type, undefined, false, false, false); } return undefined; } @@ -29760,19 +31940,16 @@ var ts; return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; } function getContextualTypeForJsxAttribute(attribute) { - var kind = attribute.kind; - var jsxElement = attribute.parent; - var attrsType = getJsxElementAttributesType(jsxElement); - if (attribute.kind === 250) { - if (!attrsType || isTypeAny(attrsType)) { + var attributesType = getContextualType(attribute.parent); + if (ts.isJsxAttribute(attribute)) { + if (!attributesType || isTypeAny(attributesType)) { return undefined; } - return getTypeOfPropertyOfType(attrsType, attribute.name.text); + return getTypeOfPropertyOfType(attributesType, attribute.name.text); } - else if (attribute.kind === 251) { - return attrsType; + else { + return attributesType; } - ts.Debug.fail("Expected JsxAttribute or JsxSpreadAttribute, got ts.SyntaxKind[" + kind + "]"); } function getApparentTypeOfContextualType(node) { var type = getContextualType(node); @@ -29787,45 +31964,52 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 223: - case 144: + case 225: + case 145: + case 148: case 147: - case 146: - case 174: - return getContextualTypeForInitializerExpression(node); - case 185: - case 216: - return getContextualTypeForReturnExpression(node); - case 195: - return getContextualTypeForYieldOperand(parent); - case 179: - case 180: - return getContextualTypeForArgument(parent, node); - case 182: - case 200: - return getTypeFromTypeNode(parent.type); - case 192: - return getContextualTypeForBinaryOperand(node); - case 257: - case 258: - return getContextualTypeForObjectLiteralElement(parent); case 175: - return getContextualTypeForElementExpression(node); - case 193: - return getContextualTypeForConditionalOperand(node); - case 202: - ts.Debug.assert(parent.parent.kind === 194); - return getContextualTypeForSubstitutionExpression(parent.parent, node); + return getContextualTypeForInitializerExpression(node); + case 186: + case 218: + return getContextualTypeForReturnExpression(node); + case 196: + return getContextualTypeForYieldOperand(parent); + case 180: + case 181: + return getContextualTypeForArgument(parent, node); case 183: + case 201: + return getTypeFromTypeNode(parent.type); + case 193: + return getContextualTypeForBinaryOperand(node); + case 260: + case 261: + return getContextualTypeForObjectLiteralElement(parent); + case 176: + return getContextualTypeForElementExpression(node); + case 194: + return getContextualTypeForConditionalOperand(node); + case 204: + ts.Debug.assert(parent.parent.kind === 195); + return getContextualTypeForSubstitutionExpression(parent.parent, node); + case 184: + return getContextualType(parent); + case 255: return getContextualType(parent); case 252: - return getContextualType(parent); - case 250: - case 251: + case 254: return getContextualTypeForJsxAttribute(parent); + case 250: + case 249: + return getAttributesTypeFromJsxOpeningLikeElement(parent); } return undefined; } + function getContextualMapper(node) { + node = ts.findAncestor(node, function (n) { return !!n.contextualMapper; }); + return node ? node.contextualMapper : identityMapper; + } function getNonGenericSignature(type, node) { var signatures = getSignaturesOfStructuredType(type, 0); if (signatures.length === 1) { @@ -29850,7 +32034,7 @@ var ts; return sourceLength < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 184 || node.kind === 185; + return node.kind === 185 || node.kind === 186; } function getContextualSignatureForFunctionLikeDeclaration(node) { return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node) @@ -29863,7 +32047,7 @@ var ts; getApparentTypeOfContextualType(node); } function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 149 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 150 || ts.isObjectLiteralMethod(node)); var type = getContextualTypeForFunctionLikeDeclaration(node); if (!type) { return undefined; @@ -29873,8 +32057,8 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { - var current = types_14[_i]; + for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { + var current = types_17[_i]; var signature = getNonGenericSignature(current, node); if (signature) { if (!signatureList) { @@ -29896,37 +32080,37 @@ var ts; } return result; } - function isInferentialContext(mapper) { - return mapper && mapper.context; - } - function checkSpreadExpression(node, contextualMapper) { - var arrayOrIterableType = checkExpressionCached(node.expression, contextualMapper); - return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, false); + function checkSpreadExpression(node, checkMode) { + if (languageVersion < 2 && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 1536); + } + var arrayOrIterableType = checkExpression(node.expression, checkMode); + return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, false, false); } function hasDefaultValue(node) { - return (node.kind === 174 && !!node.initializer) || - (node.kind === 192 && node.operatorToken.kind === 57); + return (node.kind === 175 && !!node.initializer) || + (node.kind === 193 && node.operatorToken.kind === 57); } - function checkArrayLiteral(node, contextualMapper) { + function checkArrayLiteral(node, checkMode) { var elements = node.elements; var hasSpreadElement = false; var elementTypes = []; var inDestructuringPattern = ts.isAssignmentTarget(node); for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) { var e = elements_1[_i]; - if (inDestructuringPattern && e.kind === 196) { - var restArrayType = checkExpression(e.expression, contextualMapper); + if (inDestructuringPattern && e.kind === 197) { + var restArrayType = checkExpression(e.expression, checkMode); var restElementType = getIndexTypeOfType(restArrayType, 1) || - (languageVersion >= 2 ? getElementTypeOfIterable(restArrayType, undefined) : undefined); + getIteratedTypeOrElementType(restArrayType, undefined, false, false, false); if (restElementType) { elementTypes.push(restElementType); } } else { - var type = checkExpressionForMutableLocation(e, contextualMapper); + var type = checkExpressionForMutableLocation(e, checkMode); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 196; + hasSpreadElement = hasSpreadElement || e.kind === 197; } if (!hasSpreadElement) { if (inDestructuringPattern && elementTypes.length) { @@ -29937,7 +32121,7 @@ var ts; var contextualType = getApparentTypeOfContextualType(node); if (contextualType && contextualTypeIsTupleLikeType(contextualType)) { var pattern = contextualType.pattern; - if (pattern && (pattern.kind === 173 || pattern.kind === 175)) { + if (pattern && (pattern.kind === 174 || pattern.kind === 176)) { var patternElements = pattern.elements; for (var i = elementTypes.length; i < patternElements.length; i++) { var patternElement = patternElements[i]; @@ -29945,7 +32129,7 @@ var ts; elementTypes.push(contextualType.typeArguments[i]); } else { - if (patternElement.kind !== 198) { + if (patternElement.kind !== 199) { error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } elementTypes.push(unknownType); @@ -29962,7 +32146,7 @@ var ts; strictNullChecks ? neverType : undefinedWideningType); } function isNumericName(name) { - return name.kind === 142 ? isNumericComputedName(name) : isNumericLiteralName(name.text); + return name.kind === 143 ? isNumericComputedName(name) : isNumericLiteralName(name.text); } function isNumericComputedName(name) { return isTypeAnyOrAllConstituentTypesHaveKind(checkComputedPropertyName(name), 340); @@ -29999,7 +32183,7 @@ var ts; var unionType = propTypes.length ? getUnionType(propTypes, true) : undefinedType; return createIndexInfo(unionType, false); } - function checkObjectLiteral(node, contextualMapper) { + function checkObjectLiteral(node, checkMode) { var inDestructuringPattern = ts.isAssignmentTarget(node); checkGrammarObjectLiteralExpression(node, inDestructuringPattern); var propertiesTable = ts.createMap(); @@ -30008,7 +32192,8 @@ var ts; var propagatedFlags = 0; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 172 || contextualType.pattern.kind === 176); + (contextualType.pattern.kind === 173 || contextualType.pattern.kind === 177); + var isJSObjectLiteral = !contextualType && ts.isInJavaScriptFile(node); var typeFlags = 0; var patternWithComputedProperties = false; var hasComputedStringProperty = false; @@ -30017,27 +32202,27 @@ var ts; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = memberDecl.symbol; - if (memberDecl.kind === 257 || - memberDecl.kind === 258 || + if (memberDecl.kind === 260 || + memberDecl.kind === 261 || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 257) { - type = checkPropertyAssignment(memberDecl, contextualMapper); + if (memberDecl.kind === 260) { + type = checkPropertyAssignment(memberDecl, checkMode); } - else if (memberDecl.kind === 149) { - type = checkObjectLiteralMethod(memberDecl, contextualMapper); + else if (memberDecl.kind === 150) { + type = checkObjectLiteralMethod(memberDecl, checkMode); } else { - ts.Debug.assert(memberDecl.kind === 258); - type = checkExpressionForMutableLocation(memberDecl.name, contextualMapper); + ts.Debug.assert(memberDecl.kind === 261); + type = checkExpressionForMutableLocation(memberDecl.name, checkMode); } typeFlags |= type.flags; - var prop = createSymbol(4 | 67108864 | member.flags, member.name); + var prop = createSymbol(4 | member.flags, member.name); if (inDestructuringPattern) { - var isOptional = (memberDecl.kind === 257 && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 258 && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 260 && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 261 && memberDecl.objectAssignmentInitializer); if (isOptional) { - prop.flags |= 536870912; + prop.flags |= 67108864; } if (ts.hasDynamicName(memberDecl)) { patternWithComputedProperties = true; @@ -30046,9 +32231,9 @@ var ts; else if (contextualTypeHasPattern && !(getObjectFlags(contextualType) & 512)) { var impliedProp = getPropertyOfType(contextualType, member.name); if (impliedProp) { - prop.flags |= impliedProp.flags & 536870912; + prop.flags |= impliedProp.flags & 67108864; } - else if (!compilerOptions.suppressExcessPropertyErrors) { + else if (!compilerOptions.suppressExcessPropertyErrors && !getIndexInfoOfType(contextualType, 0)) { error(memberDecl.name, ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(member), typeToString(contextualType)); } } @@ -30061,9 +32246,12 @@ var ts; prop.target = member; member = prop; } - else if (memberDecl.kind === 259) { + else if (memberDecl.kind === 262) { + if (languageVersion < 2) { + checkExternalEmitHelpers(memberDecl, 2); + } if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), true); + spread = getSpreadType(spread, createObjectLiteralType()); propertiesArray = []; propertiesTable = ts.createMap(); hasComputedStringProperty = false; @@ -30071,17 +32259,17 @@ var ts; typeFlags = 0; } var type = checkExpression(memberDecl.expression); - if (!(type.flags & (32768 | 1))) { + if (!isValidSpreadType(type)) { error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); return unknownType; } - spread = getSpreadType(spread, type, false); + spread = getSpreadType(spread, type); offset = i + 1; continue; } else { - ts.Debug.assert(memberDecl.kind === 151 || memberDecl.kind === 152); - checkAccessorDeclaration(memberDecl); + ts.Debug.assert(memberDecl.kind === 152 || memberDecl.kind === 153); + checkNodeDeferred(memberDecl); } if (ts.hasDynamicName(memberDecl)) { if (isNumericName(memberDecl.name)) { @@ -30092,34 +32280,36 @@ var ts; } } else { - propertiesTable[member.name] = member; + propertiesTable.set(member.name, member); } propertiesArray.push(member); } if (contextualTypeHasPattern) { for (var _i = 0, _a = getPropertiesOfType(contextualType); _i < _a.length; _i++) { var prop = _a[_i]; - if (!propertiesTable[prop.name]) { - if (!(prop.flags & 536870912)) { + if (!propertiesTable.get(prop.name)) { + if (!(prop.flags & 67108864)) { error(prop.valueDeclaration || prop.bindingElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } - propertiesTable[prop.name] = prop; + propertiesTable.set(prop.name, prop); propertiesArray.push(prop); } } } if (spread !== emptyObjectType) { if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), true); + spread = getSpreadType(spread, createObjectLiteralType()); + } + if (spread.flags & 32768) { + spread.flags |= propagatedFlags; + spread.symbol = node.symbol; } - spread.flags |= propagatedFlags; - spread.symbol = node.symbol; return spread; } return createObjectLiteralType(); function createObjectLiteralType() { - var stringIndexInfo = hasComputedStringProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 0) : undefined; - var numberIndexInfo = hasComputedNumberProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 1) : undefined; + var stringIndexInfo = isJSObjectLiteral ? jsObjectLiteralIndexInfo : hasComputedStringProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 0) : undefined; + var numberIndexInfo = hasComputedNumberProperty && !isJSObjectLiteral ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 1) : undefined; var result = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo); var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 1048576; result.flags |= 4194304 | freshObjectLiteralFlag | (typeFlags & 14680064); @@ -30136,9 +32326,14 @@ var ts; return result; } } + function isValidSpreadType(type) { + return !!(type.flags & (1 | 4096 | 2048 | 16777216) || + type.flags & 32768 && !isGenericMappedType(type) || + type.flags & 196608 && !ts.forEach(type.types, function (t) { return !isValidSpreadType(t); })); + } function checkJsxSelfClosingElement(node) { checkJsxOpeningLikeElement(node); - return jsxElementType || anyType; + return getJsxGlobalElementType() || anyType; } function checkJsxElement(node) { checkJsxOpeningLikeElement(node.openingElement); @@ -30151,85 +32346,105 @@ var ts; for (var _i = 0, _a = node.children; _i < _a.length; _i++) { var child = _a[_i]; switch (child.kind) { - case 252: + case 255: checkJsxExpression(child); break; - case 246: + case 248: checkJsxElement(child); break; - case 247: + case 249: checkJsxSelfClosingElement(child); break; } } - return jsxElementType || anyType; + return getJsxGlobalElementType() || anyType; } function isUnhyphenatedJsxName(name) { return name.indexOf("-") < 0; } function isJsxIntrinsicIdentifier(tagName) { - if (tagName.kind === 177 || tagName.kind === 98) { + if (tagName.kind === 178 || tagName.kind === 98) { return false; } else { return ts.isIntrinsicJsxName(tagName.text); } } - function checkJsxAttribute(node, elementAttributesType, nameTable) { - var correspondingPropType = undefined; - if (elementAttributesType === emptyObjectType && isUnhyphenatedJsxName(node.name.text)) { - error(node.parent, ts.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, getJsxElementPropertiesName()); - } - else if (elementAttributesType && !isTypeAny(elementAttributesType)) { - var correspondingPropSymbol = getPropertyOfType(elementAttributesType, node.name.text); - correspondingPropType = correspondingPropSymbol && getTypeOfSymbol(correspondingPropSymbol); - if (isUnhyphenatedJsxName(node.name.text)) { - var attributeType = getTypeOfPropertyOfType(elementAttributesType, ts.getTextOfPropertyName(node.name)) || getIndexTypeOfType(elementAttributesType, 0); - if (attributeType) { - correspondingPropType = attributeType; + function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, filter, checkMode) { + var attributes = openingLikeElement.attributes; + var attributesTable = ts.createMap(); + var spread = emptyObjectType; + var attributesArray = []; + for (var _i = 0, _a = attributes.properties; _i < _a.length; _i++) { + var attributeDecl = _a[_i]; + var member = attributeDecl.symbol; + if (ts.isJsxAttribute(attributeDecl)) { + var exprType = attributeDecl.initializer ? + checkExpression(attributeDecl.initializer, checkMode) : + trueType; + var attributeSymbol = createSymbol(4 | 134217728 | member.flags, member.name); + attributeSymbol.declarations = member.declarations; + attributeSymbol.parent = member.parent; + if (member.valueDeclaration) { + attributeSymbol.valueDeclaration = member.valueDeclaration; } - else { - if (!correspondingPropType) { - error(node.name, ts.Diagnostics.Property_0_does_not_exist_on_type_1, node.name.text, typeToString(elementAttributesType)); - return unknownType; - } + attributeSymbol.type = exprType; + attributeSymbol.target = member; + attributesTable.set(attributeSymbol.name, attributeSymbol); + attributesArray.push(attributeSymbol); + } + else { + ts.Debug.assert(attributeDecl.kind === 254); + if (attributesArray.length > 0) { + spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable)); + attributesArray = []; + attributesTable = ts.createMap(); } + var exprType = checkExpression(attributeDecl.expression); + if (!isValidSpreadType(exprType)) { + error(attributeDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); + return anyType; + } + if (isTypeAny(exprType)) { + return anyType; + } + spread = getSpreadType(spread, exprType); } } - var exprType; - if (node.initializer) { - exprType = checkExpression(node.initializer); + if (spread !== emptyObjectType) { + if (attributesArray.length > 0) { + spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable)); + attributesArray = []; + attributesTable = ts.createMap(); + } + attributesArray = getPropertiesOfType(spread); } - else { - exprType = booleanType; + attributesTable = ts.createMap(); + if (attributesArray) { + ts.forEach(attributesArray, function (attr) { + if (!filter || filter(attr)) { + attributesTable.set(attr.name, attr); + } + }); } - if (correspondingPropType) { - checkTypeAssignableTo(exprType, correspondingPropType, node); + return createJsxAttributesType(attributes.symbol, attributesTable); + function createJsxAttributesType(symbol, attributesTable) { + var result = createAnonymousType(symbol, attributesTable, emptyArray, emptyArray, undefined, undefined); + var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 1048576; + result.flags |= 33554432 | 4194304 | freshObjectLiteralFlag; + result.objectFlags |= 128; + return result; } - nameTable[node.name.text] = true; - return exprType; } - function checkJsxSpreadAttribute(node, elementAttributesType, nameTable) { - var type = checkExpression(node.expression); - var props = getPropertiesOfType(type); - for (var _i = 0, props_2 = props; _i < props_2.length; _i++) { - var prop = props_2[_i]; - if (!nameTable[prop.name]) { - var targetPropSym = getPropertyOfType(elementAttributesType, prop.name); - if (targetPropSym) { - var msg = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property, prop.name); - checkTypeAssignableTo(getTypeOfSymbol(prop), getTypeOfSymbol(targetPropSym), node, undefined, msg); - } - nameTable[prop.name] = true; - } - } - return type; + function checkJsxAttributes(node, checkMode) { + return createJsxAttributesTypeFromAttributesProperty(node.parent, undefined, checkMode); } function getJsxType(name) { - if (jsxTypes[name] === undefined) { - return jsxTypes[name] = getExportedTypeFromNamespace(JsxNames.JSX, name) || unknownType; + var jsxType = jsxTypes.get(name); + if (jsxType === undefined) { + jsxTypes.set(name, jsxType = getExportedTypeFromNamespace(JsxNames.JSX, name) || unknownType); } - return jsxTypes[name]; + return jsxType; } function getIntrinsicTagSymbol(node) { var links = getNodeLinks(node); @@ -30250,7 +32465,7 @@ var ts; return links.resolvedSymbol = unknownSymbol; } else { - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { error(node, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists, JsxNames.IntrinsicElements); } return links.resolvedSymbol = unknownSymbol; @@ -30294,23 +32509,86 @@ var ts; return undefined; } } - function getResolvedJsxType(node, elemType, elemClassType) { - if (!elemType) { - elemType = checkExpression(node.tagName); + function defaultTryGetJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) { + ts.Debug.assert(!(elementType.flags & 65536)); + if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) { + var jsxStatelessElementType = getJsxGlobalStatelessElementType(); + if (jsxStatelessElementType) { + var callSignature = getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, undefined); + if (callSignature !== unknownSignature) { + var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); + var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); + if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) { + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttributes !== unknownType) { + paramType = intersectTypes(intrinsicAttributes, paramType); + } + return paramType; + } + } + } } - if (elemType.flags & 65536) { - var types = elemType.types; - return getUnionType(ts.map(types, function (type) { - return getResolvedJsxType(node, type, elemClassType); + return undefined; + } + function tryGetAllJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) { + ts.Debug.assert(!(elementType.flags & 65536)); + if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) { + var jsxStatelessElementType = getJsxGlobalStatelessElementType(); + if (jsxStatelessElementType) { + var candidatesOutArray = []; + getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, candidatesOutArray); + var result = void 0; + var allMatchingAttributesType = void 0; + for (var _i = 0, candidatesOutArray_1 = candidatesOutArray; _i < candidatesOutArray_1.length; _i++) { + var candidate = candidatesOutArray_1[_i]; + var callReturnType = getReturnTypeOfSignature(candidate); + var paramType = callReturnType && (candidate.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(candidate.parameters[0])); + if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) { + var shouldBeCandidate = true; + for (var _a = 0, _b = openingLikeElement.attributes.properties; _a < _b.length; _a++) { + var attribute = _b[_a]; + if (ts.isJsxAttribute(attribute) && + isUnhyphenatedJsxName(attribute.name.text) && + !getPropertyOfType(paramType, attribute.name.text)) { + shouldBeCandidate = false; + break; + } + } + if (shouldBeCandidate) { + result = intersectTypes(result, paramType); + } + allMatchingAttributesType = intersectTypes(allMatchingAttributesType, paramType); + } + } + if (!result) { + result = allMatchingAttributesType; + } + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttributes !== unknownType) { + result = intersectTypes(intrinsicAttributes, result); + } + return result; + } + } + return undefined; + } + function resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, elementType, elementClassType) { + if (!elementType) { + elementType = checkExpression(openingLikeElement.tagName); + } + if (elementType.flags & 65536) { + var types = elementType.types; + return getUnionType(types.map(function (type) { + return resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, type, elementClassType); }), true); } - if (elemType.flags & 2) { + if (elementType.flags & 2) { return anyType; } - else if (elemType.flags & 32) { + else if (elementType.flags & 32) { var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); if (intrinsicElementsType !== unknownType) { - var stringLiteralTypeName = elemType.text; + var stringLiteralTypeName = elementType.text; var intrinsicProp = getPropertyOfType(intrinsicElementsType, stringLiteralTypeName); if (intrinsicProp) { return getTypeOfSymbol(intrinsicProp); @@ -30319,28 +32597,19 @@ var ts; if (indexSignatureType) { return indexSignatureType; } - error(node, ts.Diagnostics.Property_0_does_not_exist_on_type_1, stringLiteralTypeName, "JSX." + JsxNames.IntrinsicElements); + error(openingLikeElement, ts.Diagnostics.Property_0_does_not_exist_on_type_1, stringLiteralTypeName, "JSX." + JsxNames.IntrinsicElements); } return anyType; } - var elemInstanceType = getJsxElementInstanceType(node, elemType); - if (!elemClassType || !isTypeAssignableTo(elemInstanceType, elemClassType)) { - if (jsxElementType) { - var callSignatures = elemType && getSignaturesOfType(elemType, 0); - var callSignature = callSignatures && callSignatures.length > 0 && callSignatures[0]; - var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); - var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); - if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType)) { - var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); - if (intrinsicAttributes !== unknownType) { - paramType = intersectTypes(intrinsicAttributes, paramType); - } - return paramType; - } - } + var elemInstanceType = getJsxElementInstanceType(openingLikeElement, elementType); + var statelessAttributesType = shouldIncludeAllStatelessAttributesType ? + tryGetAllJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) : + defaultTryGetJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType); + if (statelessAttributesType) { + return statelessAttributesType; } - if (elemClassType) { - checkTypeRelatedTo(elemInstanceType, elemClassType, assignableRelation, node, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); + if (elementClassType) { + checkTypeRelatedTo(elemInstanceType, elementClassType, assignableRelation, openingLikeElement, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); } if (isTypeAny(elemInstanceType)) { return elemInstanceType; @@ -30360,10 +32629,6 @@ var ts; else if (isTypeAny(attributesType) || (attributesType === unknownType)) { return attributesType; } - else if (attributesType.flags & 65536) { - error(node.tagName, ts.Diagnostics.JSX_element_attributes_type_0_may_not_be_a_union_type, typeToString(attributesType)); - return anyType; - } else { var apparentAttributesType = attributesType; var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes); @@ -30386,38 +32651,72 @@ var ts; } } } - function getJsxElementAttributesType(node) { + function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) { + ts.Debug.assert(isJsxIntrinsicIdentifier(node.tagName)); var links = getNodeLinks(node); - if (!links.resolvedJsxType) { - if (isJsxIntrinsicIdentifier(node.tagName)) { - var symbol = getIntrinsicTagSymbol(node); - if (links.jsxFlags & 1) { - return links.resolvedJsxType = getTypeOfSymbol(symbol); - } - else if (links.jsxFlags & 2) { - return links.resolvedJsxType = getIndexInfoOfSymbol(symbol, 0).type; - } - else { - return links.resolvedJsxType = unknownType; - } + if (!links.resolvedJsxElementAttributesType) { + var symbol = getIntrinsicTagSymbol(node); + if (links.jsxFlags & 1) { + return links.resolvedJsxElementAttributesType = getTypeOfSymbol(symbol); + } + else if (links.jsxFlags & 2) { + return links.resolvedJsxElementAttributesType = getIndexInfoOfSymbol(symbol, 0).type; } else { - var elemClassType = getJsxGlobalElementClassType(); - return links.resolvedJsxType = getResolvedJsxType(node, undefined, elemClassType); + return links.resolvedJsxElementAttributesType = unknownType; } } - return links.resolvedJsxType; + return links.resolvedJsxElementAttributesType; + } + function getCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType) { + var links = getNodeLinks(node); + if (!links.resolvedJsxElementAttributesType) { + var elemClassType = getJsxGlobalElementClassType(); + return links.resolvedJsxElementAttributesType = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, undefined, elemClassType); + } + return links.resolvedJsxElementAttributesType; + } + function getAllAttributesTypeFromJsxOpeningLikeElement(node) { + if (isJsxIntrinsicIdentifier(node.tagName)) { + return getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); + } + else { + return getCustomJsxElementAttributesType(node, true); + } + } + function getAttributesTypeFromJsxOpeningLikeElement(node) { + if (isJsxIntrinsicIdentifier(node.tagName)) { + return getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); + } + else { + return getCustomJsxElementAttributesType(node, false); + } } function getJsxAttributePropertySymbol(attrib) { - var attributesType = getJsxElementAttributesType(attrib.parent); + var attributesType = getAttributesTypeFromJsxOpeningLikeElement(attrib.parent.parent); var prop = getPropertyOfType(attributesType, attrib.name.text); return prop || unknownSymbol; } function getJsxGlobalElementClassType() { - if (!jsxElementClassType) { - jsxElementClassType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.ElementClass); + if (!deferredJsxElementClassType) { + deferredJsxElementClassType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.ElementClass); } - return jsxElementClassType; + return deferredJsxElementClassType; + } + function getJsxGlobalElementType() { + if (!deferredJsxElementType) { + deferredJsxElementType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.Element); + } + return deferredJsxElementType; + } + function getJsxGlobalStatelessElementType() { + if (!deferredJsxStatelessElementType) { + var jsxElementType = getJsxGlobalElementType(); + if (jsxElementType) { + deferredJsxStatelessElementType = getUnionType([jsxElementType, nullType]); + } + } + return deferredJsxStatelessElementType; } function getJsxIntrinsicTagNames() { var intrinsics = getJsxType(JsxNames.IntrinsicElements); @@ -30427,8 +32726,8 @@ var ts; if ((compilerOptions.jsx || 0) === 0) { error(errorNode, ts.Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided); } - if (jsxElementType === undefined) { - if (compilerOptions.noImplicitAny) { + if (getJsxGlobalElementType() === undefined) { + if (noImplicitAny) { error(errorNode, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist); } } @@ -30445,61 +32744,83 @@ var ts; markAliasSymbolAsReferenced(reactSym); } } - var targetAttributesType = getJsxElementAttributesType(node); - var nameTable = ts.createMap(); - var sawSpreadedAny = false; - for (var i = node.attributes.length - 1; i >= 0; i--) { - if (node.attributes[i].kind === 250) { - checkJsxAttribute((node.attributes[i]), targetAttributesType, nameTable); - } - else { - ts.Debug.assert(node.attributes[i].kind === 251); - var spreadType = checkJsxSpreadAttribute((node.attributes[i]), targetAttributesType, nameTable); - if (isTypeAny(spreadType)) { - sawSpreadedAny = true; - } - } + checkJsxAttributesAssignableToTagNameAttributes(node); + } + function checkJsxAttributesAssignableToTagNameAttributes(openingLikeElement) { + var targetAttributesType = isJsxIntrinsicIdentifier(openingLikeElement.tagName) ? + getIntrinsicAttributesTypeFromJsxOpeningLikeElement(openingLikeElement) : + getCustomJsxElementAttributesType(openingLikeElement, false); + var sourceAttributesType = createJsxAttributesTypeFromAttributesProperty(openingLikeElement, function (attribute) { + return isUnhyphenatedJsxName(attribute.name) || !!(getPropertyOfType(targetAttributesType, attribute.name)); + }); + if (targetAttributesType === emptyObjectType && (isTypeAny(sourceAttributesType) || sourceAttributesType.properties.length > 0)) { + error(openingLikeElement, ts.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, getJsxElementPropertiesName()); } - if (targetAttributesType && !sawSpreadedAny) { - var targetProperties = getPropertiesOfType(targetAttributesType); - for (var i = 0; i < targetProperties.length; i++) { - if (!(targetProperties[i].flags & 536870912) && - !nameTable[targetProperties[i].name]) { - error(node, ts.Diagnostics.Property_0_is_missing_in_type_1, targetProperties[i].name, typeToString(targetAttributesType)); - } - } + else { + checkTypeAssignableTo(sourceAttributesType, targetAttributesType, openingLikeElement.attributes.properties.length > 0 ? openingLikeElement.attributes : openingLikeElement); } } - function checkJsxExpression(node) { + function checkJsxExpression(node, checkMode) { if (node.expression) { - return checkExpression(node.expression); + var type = checkExpression(node.expression, checkMode); + if (node.dotDotDotToken && type !== anyType && !isArrayType(type)) { + error(node, ts.Diagnostics.JSX_spread_child_must_be_an_array_type, node.toString(), typeToString(type)); + } + return type; } else { return unknownType; } } function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 147; + return s.valueDeclaration ? s.valueDeclaration.kind : 148; } function getDeclarationModifierFlagsFromSymbol(s) { - return s.valueDeclaration ? ts.getCombinedModifierFlags(s.valueDeclaration) : s.flags & 134217728 ? 4 | 32 : 0; + if (s.valueDeclaration) { + var flags = ts.getCombinedModifierFlags(s.valueDeclaration); + return s.parent && s.parent.flags & 32 ? flags : flags & ~28; + } + if (getCheckFlags(s) & 6) { + var checkFlags = s.checkFlags; + var accessModifier = checkFlags & 256 ? 8 : + checkFlags & 64 ? 4 : + 16; + var staticModifier = checkFlags & 512 ? 32 : 0; + return accessModifier | staticModifier; + } + if (s.flags & 16777216) { + return 4 | 32; + } + return 0; } function getDeclarationNodeFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : 0; } - function checkClassPropertyAccess(node, left, type, prop) { + function isMethodLike(symbol) { + return !!(symbol.flags & 8192 || getCheckFlags(symbol) & 4); + } + function checkPropertyAccessibility(node, left, type, prop) { var flags = getDeclarationModifierFlagsFromSymbol(prop); - var declaringClass = getDeclaredTypeOfSymbol(getParentOfSymbol(prop)); - var errorNode = node.kind === 177 || node.kind === 223 ? + var errorNode = node.kind === 178 || node.kind === 225 ? node.name : node.right; + if (getCheckFlags(prop) & 256) { + error(errorNode, ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(prop), typeToString(type)); + return false; + } if (left.kind === 96) { - if (languageVersion < 2 && getDeclarationKindFromSymbol(prop) !== 149) { - error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); - return false; + if (languageVersion < 2) { + var hasNonMethodDeclaration = forEachProperty(prop, function (p) { + var propKind = getDeclarationKindFromSymbol(p); + return propKind !== 150 && propKind !== 149; + }); + if (hasNonMethodDeclaration) { + error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); + return false; + } } if (flags & 128) { - error(errorNode, ts.Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString(prop), typeToString(declaringClass)); + error(errorNode, ts.Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString(prop), typeToString(getDeclaringClass(prop))); return false; } } @@ -30509,7 +32830,7 @@ var ts; if (flags & 8) { var declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop)); if (!isNodeWithinClass(node, declaringClassDeclaration)) { - error(errorNode, ts.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(declaringClass)); + error(errorNode, ts.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(getDeclaringClass(prop))); return false; } return true; @@ -30519,10 +32840,10 @@ var ts; } var enclosingClass = forEachEnclosingClass(node, function (enclosingDeclaration) { var enclosingClass = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingDeclaration)); - return hasBaseType(enclosingClass, declaringClass) ? enclosingClass : undefined; + return isClassDerivedFromDeclaringClasses(enclosingClass, prop) ? enclosingClass : undefined; }); if (!enclosingClass) { - error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(declaringClass)); + error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(getDeclaringClass(prop) || type)); return false; } if (flags & 32) { @@ -30538,16 +32859,17 @@ var ts; return true; } function checkNonNullExpression(node) { - var type = checkExpression(node); - if (strictNullChecks) { - var kind = getFalsyFlags(type) & 6144; - if (kind) { - error(node, kind & 2048 ? kind & 4096 ? - ts.Diagnostics.Object_is_possibly_null_or_undefined : - ts.Diagnostics.Object_is_possibly_undefined : - ts.Diagnostics.Object_is_possibly_null); - } - return getNonNullableType(type); + return checkNonNullType(checkExpression(node), node); + } + function checkNonNullType(type, errorNode) { + var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 6144; + if (kind) { + error(errorNode, kind & 2048 ? kind & 4096 ? + ts.Diagnostics.Object_is_possibly_null_or_undefined : + ts.Diagnostics.Object_is_possibly_undefined : + ts.Diagnostics.Object_is_possibly_null); + var t = getNonNullableType(type); + return t.flags & (6144 | 8192) ? unknownType : t; } return type; } @@ -30576,7 +32898,7 @@ var ts; noUnusedIdentifiers && (prop.flags & 106500) && prop.valueDeclaration && (ts.getModifierFlags(prop.valueDeclaration) & 8)) { - if (prop.flags & 16777216) { + if (getCheckFlags(prop) & 1) { getSymbolLinks(prop).target.isReferenced = true; } else { @@ -30584,6 +32906,15 @@ var ts; } } } + function isInPropertyInitializer(node) { + while (node) { + if (node.parent && node.parent.kind === 148 && node.parent.initializer === node) { + return true; + } + node = node.parent; + } + return false; + } function checkPropertyAccessExpressionOrQualifiedName(node, left, right) { var type = checkNonNullExpression(left); if (isTypeAny(type) || type === silentNeverType) { @@ -30595,16 +32926,30 @@ var ts; } var prop = getPropertyOfType(apparentType, right.text); if (!prop) { + var stringIndexType = getIndexTypeOfType(apparentType, 0); + if (stringIndexType) { + return stringIndexType; + } if (right.text && !checkAndReportErrorForExtendingInterface(node)) { reportNonexistentProperty(right, type.flags & 16384 && type.isThisType ? apparentType : type); } return unknownType; } + if (prop.valueDeclaration) { + if (isInPropertyInitializer(node) && + !isBlockScopedNameDeclaredBeforeUse(prop.valueDeclaration, right)) { + error(right, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, right.text); + } + if (prop.valueDeclaration.kind === 228 && + node.parent && node.parent.kind !== 158 && + !ts.isInAmbientContext(prop.valueDeclaration) && + !isBlockScopedNameDeclaredBeforeUse(prop.valueDeclaration, right)) { + error(right, ts.Diagnostics.Class_0_used_before_its_declaration, right.text); + } + } markPropertyAsReferenced(prop); getNodeLinks(node).resolvedSymbol = prop; - if (prop.parent && prop.parent.flags & 32) { - checkClassPropertyAccess(node, left, apparentType, prop); - } + checkPropertyAccessibility(node, left, apparentType, prop); var propType = getTypeOfSymbol(prop); var assignmentKind = ts.getAssignmentTargetKind(node); if (assignmentKind) { @@ -30613,30 +32958,30 @@ var ts; return unknownType; } } - if (node.kind !== 177 || assignmentKind === 1 || + if (node.kind !== 178 || assignmentKind === 1 || !(prop.flags & (3 | 4 | 98304)) && !(prop.flags & 8192 && propType.flags & 65536)) { return propType; } - var flowType = getFlowTypeOfReference(node, propType, true, undefined); + var flowType = getFlowTypeOfReference(node, propType); return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 177 + var left = node.kind === 178 ? node.expression : node.left; var type = checkExpression(left); if (type !== unknownType && !isTypeAny(type)) { var prop = getPropertyOfType(getWidenedType(type), propertyName); - if (prop && prop.parent && prop.parent.flags & 32) { - return checkClassPropertyAccess(node, left, type, prop); + if (prop) { + return checkPropertyAccessibility(node, left, type, prop); } } return true; } function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 224) { + if (initializer.kind === 226) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -30658,7 +33003,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 212 && + if (node.kind === 214 && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -30676,7 +33021,7 @@ var ts; var indexExpression = node.argumentExpression; if (!indexExpression) { var sourceFile = ts.getSourceFileOfNode(node); - if (node.parent.kind === 180 && node.parent.expression === node) { + if (node.parent.kind === 181 && node.parent.expression === node) { var start = ts.skipTrivia(sourceFile.text, node.expression.end); var end = node.end; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); @@ -30696,7 +33041,7 @@ var ts; error(indexExpression, ts.Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal); return unknownType; } - return getIndexedAccessType(objectType, indexType, node); + return checkIndexedAccessIndexType(getIndexedAccessType(objectType, indexType, node), node); } function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) { if (expressionType === unknownType) { @@ -30716,7 +33061,7 @@ var ts; if (!leftHandSideSymbol) { return false; } - var globalESSymbol = getGlobalESSymbolConstructorSymbol(); + var globalESSymbol = getGlobalESSymbolConstructorSymbol(true); if (!globalESSymbol) { return false; } @@ -30729,10 +33074,10 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 181) { + if (node.kind === 182) { checkExpression(node.template); } - else if (node.kind !== 145) { + else if (node.kind !== 146) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -30751,22 +33096,22 @@ var ts; var specializedIndex = -1; var spliceIndex; ts.Debug.assert(!result.length); - for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { - var signature = signatures_2[_i]; + for (var _i = 0, signatures_3 = signatures; _i < signatures_3.length; _i++) { + var signature = signatures_3[_i]; var symbol = signature.declaration && getSymbolOfNode(signature.declaration); - var parent_8 = signature.declaration && signature.declaration.parent; + var parent = signature.declaration && signature.declaration.parent; if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && parent_8 === lastParent) { + if (lastParent && parent === lastParent) { index++; } else { - lastParent = parent_8; + lastParent = parent; index = cutoffIndex; } } else { index = cutoffIndex = result.length; - lastParent = parent_8; + lastParent = parent; } lastSymbol = symbol; if (signature.hasLiteralTypes) { @@ -30783,7 +33128,7 @@ var ts; function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg && arg.kind === 196) { + if (arg && arg.kind === 197) { return i; } } @@ -30796,11 +33141,14 @@ var ts; var callIsIncomplete; var isDecorator; var spreadArgIndex = -1; - if (node.kind === 181) { + if (ts.isJsxOpeningLikeElement(node)) { + return true; + } + if (node.kind === 182) { var tagExpression = node; argCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 194) { + if (tagExpression.template.kind === 195) { var templateExpression = tagExpression.template; var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); ts.Debug.assert(lastSpan !== undefined); @@ -30812,7 +33160,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 145) { + else if (node.kind === 146) { isDecorator = true; typeArguments = undefined; argCount = getEffectiveArgumentCount(node, undefined, signature); @@ -30820,7 +33168,7 @@ var ts; else { var callExpression = node; if (!callExpression.arguments) { - ts.Debug.assert(callExpression.kind === 180); + ts.Debug.assert(callExpression.kind === 181); return signature.minArgumentCount === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; @@ -30828,8 +33176,10 @@ var ts; typeArguments = callExpression.typeArguments; spreadArgIndex = getSpreadArgumentIndex(args); } + var numTypeParameters = ts.length(signature.typeParameters); + var minTypeArgumentCount = getMinTypeArgumentCount(signature.typeParameters); var hasRightNumberOfTypeArgs = !typeArguments || - (signature.typeParameters && typeArguments.length === signature.typeParameters.length); + (typeArguments.length >= minTypeArgumentCount && typeArguments.length <= numTypeParameters); if (!hasRightNumberOfTypeArgs) { return false; } @@ -30853,9 +33203,9 @@ var ts; return undefined; } function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper) { - var context = createInferenceContext(signature, true); + var context = createInferenceContext(signature, true, false); forEachMatchingParameterType(contextualSignature, signature, function (source, target) { - inferTypes(context, instantiateType(source, contextualMapper), target); + inferTypesWithContext(context, instantiateType(source, contextualMapper), target); }); return getSignatureInstantiation(signature, getInferredTypes(context)); } @@ -30874,19 +33224,19 @@ var ts; if (thisType) { var thisArgumentNode = getThisArgumentOfCall(node); var thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType; - inferTypes(context, thisArgumentType, thisType); + inferTypesWithContext(context, thisArgumentType, thisType); } var argCount = getEffectiveArgumentCount(node, args, signature); for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); - if (arg === undefined || arg.kind !== 198) { + if (arg === undefined || arg.kind !== 199) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i); if (argType === undefined) { var mapper = excludeArgument && excludeArgument[i] !== undefined ? identityMapper : inferenceMapper; argType = checkExpressionWithContextualType(arg, paramType, mapper); } - inferTypes(context, argType, paramType); + inferTypesWithContext(context, argType, paramType); } } if (excludeArgument) { @@ -30894,7 +33244,7 @@ var ts; if (excludeArgument[i] === false) { var arg = args[i]; var paramType = getTypeAtPosition(signature, i); - inferTypes(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); + inferTypesWithContext(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); } } } @@ -30904,7 +33254,7 @@ var ts; var typeParameters = signature.typeParameters; var typeArgumentsAreAssignable = true; var mapper; - for (var i = 0; i < typeParameters.length; i++) { + for (var i = 0; i < typeArgumentNodes.length; i++) { if (typeArgumentsAreAssignable) { var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { @@ -30924,9 +33274,29 @@ var ts; } return typeArgumentsAreAssignable; } + function checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation) { + var callIsIncomplete = node.attributes.end === node.end; + if (callIsIncomplete) { + return true; + } + var headMessage = ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1; + var paramType = getTypeAtPosition(signature, 0); + var attributesType = checkExpressionWithContextualType(node.attributes, paramType, undefined); + var argProperties = getPropertiesOfType(attributesType); + for (var _i = 0, argProperties_1 = argProperties; _i < argProperties_1.length; _i++) { + var arg = argProperties_1[_i]; + if (!getPropertyOfType(paramType, arg.name) && isUnhyphenatedJsxName(arg.name)) { + return false; + } + } + return checkTypeRelatedTo(attributesType, paramType, relation, undefined, headMessage); + } function checkApplicableSignature(node, args, signature, relation, excludeArgument, reportErrors) { + if (ts.isJsxOpeningLikeElement(node)) { + return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation); + } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 180) { + if (thisType && thisType !== voidType && node.kind !== 181) { var thisArgumentNode = getThisArgumentOfCall(node); var thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType; var errorNode = reportErrors ? (thisArgumentNode || node) : undefined; @@ -30939,7 +33309,7 @@ var ts; var argCount = getEffectiveArgumentCount(node, args, signature); for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); - if (arg === undefined || arg.kind !== 198) { + if (arg === undefined || arg.kind !== 199) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i); if (argType === undefined) { @@ -30954,51 +33324,54 @@ var ts; return true; } function getThisArgumentOfCall(node) { - if (node.kind === 179) { + if (node.kind === 180) { var callee = node.expression; - if (callee.kind === 177) { + if (callee.kind === 178) { return callee.expression; } - else if (callee.kind === 178) { + else if (callee.kind === 179) { return callee.expression; } } } function getEffectiveCallArguments(node) { var args; - if (node.kind === 181) { + if (node.kind === 182) { var template = node.template; args = [undefined]; - if (template.kind === 194) { + if (template.kind === 195) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); } } - else if (node.kind === 145) { + else if (node.kind === 146) { return undefined; } + else if (ts.isJsxOpeningLikeElement(node)) { + args = node.attributes.properties.length > 0 ? [node.attributes] : emptyArray; + } else { args = node.arguments || emptyArray; } return args; } function getEffectiveArgumentCount(node, args, signature) { - if (node.kind === 145) { + if (node.kind === 146) { switch (node.parent.kind) { - case 226: - case 197: + case 228: + case 198: return 1; - case 147: + case 148: return 2; - case 149: - case 151: + case 150: case 152: + case 153: if (languageVersion === 0) { return 2; } return signature.parameters.length >= 3 ? 3 : 2; - case 144: + case 145: return 3; } } @@ -31007,48 +33380,48 @@ var ts; } } function getEffectiveDecoratorFirstArgumentType(node) { - if (node.kind === 226) { + if (node.kind === 228) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } - if (node.kind === 144) { + if (node.kind === 145) { node = node.parent; - if (node.kind === 150) { + if (node.kind === 151) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } } - if (node.kind === 147 || - node.kind === 149 || - node.kind === 151 || - node.kind === 152) { + if (node.kind === 148 || + node.kind === 150 || + node.kind === 152 || + node.kind === 153) { return getParentTypeOfClassElement(node); } ts.Debug.fail("Unsupported decorator target."); return unknownType; } function getEffectiveDecoratorSecondArgumentType(node) { - if (node.kind === 226) { + if (node.kind === 228) { ts.Debug.fail("Class decorators should not have a second synthetic argument."); return unknownType; } - if (node.kind === 144) { + if (node.kind === 145) { node = node.parent; - if (node.kind === 150) { + if (node.kind === 151) { return anyType; } } - if (node.kind === 147 || - node.kind === 149 || - node.kind === 151 || - node.kind === 152) { + if (node.kind === 148 || + node.kind === 150 || + node.kind === 152 || + node.kind === 153) { var element = node; switch (element.name.kind) { case 70: case 8: case 9: return getLiteralTypeForText(32, element.name.text); - case 142: + case 143: var nameType = checkComputedPropertyName(element.name); if (isTypeOfKind(nameType, 512)) { return nameType; @@ -31065,20 +33438,20 @@ var ts; return unknownType; } function getEffectiveDecoratorThirdArgumentType(node) { - if (node.kind === 226) { + if (node.kind === 228) { ts.Debug.fail("Class decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 144) { + if (node.kind === 145) { return numberType; } - if (node.kind === 147) { + if (node.kind === 148) { ts.Debug.fail("Property decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 149 || - node.kind === 151 || - node.kind === 152) { + if (node.kind === 150 || + node.kind === 152 || + node.kind === 153) { var propertyType = getTypeOfNode(node); return createTypedPropertyDescriptorType(propertyType); } @@ -31099,26 +33472,26 @@ var ts; return unknownType; } function getEffectiveArgumentType(node, argIndex) { - if (node.kind === 145) { + if (node.kind === 146) { return getEffectiveDecoratorArgumentType(node, argIndex); } - else if (argIndex === 0 && node.kind === 181) { + else if (argIndex === 0 && node.kind === 182) { return getGlobalTemplateStringsArrayType(); } return undefined; } function getEffectiveArgument(node, args, argIndex) { - if (node.kind === 145 || - (argIndex === 0 && node.kind === 181)) { + if (node.kind === 146 || + (argIndex === 0 && node.kind === 182)) { return undefined; } return args[argIndex]; } function getEffectiveArgumentErrorNode(node, argIndex, arg) { - if (node.kind === 145) { + if (node.kind === 146) { return node.expression; } - else if (argIndex === 0 && node.kind === 181) { + else if (argIndex === 0 && node.kind === 182) { return node.template; } else { @@ -31126,15 +33499,30 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray, headMessage) { - var isTaggedTemplate = node.kind === 181; - var isDecorator = node.kind === 145; + var isTaggedTemplate = node.kind === 182; + var isDecorator = node.kind === 146; + var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var typeArguments; - if (!isTaggedTemplate && !isDecorator) { + if (!isTaggedTemplate && !isDecorator && !isJsxOpeningOrSelfClosingElement) { typeArguments = node.typeArguments; if (node.expression.kind !== 96) { ts.forEach(typeArguments, checkSourceElement); } } + if (signatures.length === 1) { + var declaration = signatures[0].declaration; + if (declaration && ts.isInJavaScriptFile(declaration) && !ts.hasJSDocParameterTags(declaration)) { + if (containsArgumentsReference(declaration)) { + var signatureWithRest = cloneSignature(signatures[0]); + var syntheticArgsSymbol = createSymbol(3, "args"); + syntheticArgsSymbol.type = anyArrayType; + syntheticArgsSymbol.isRestParameter = true; + signatureWithRest.parameters = ts.concatenate(signatureWithRest.parameters, [syntheticArgsSymbol]); + signatureWithRest.hasRestParameter = true; + signatures = [signatureWithRest]; + } + } + } var candidates = candidatesOutArray || []; reorderCandidates(signatures, candidates); if (!candidates.length) { @@ -31157,7 +33545,7 @@ var ts; var candidateForTypeArgumentError; var resultOfFailedInference; var result; - var signatureHelpTrailingComma = candidatesOutArray && node.kind === 179 && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = candidatesOutArray && node.kind === 180 && node.arguments.hasTrailingComma; if (candidates.length > 1) { result = chooseOverload(candidates, subtypeRelation, signatureHelpTrailingComma); } @@ -31171,6 +33559,9 @@ var ts; return result; } if (candidateForArgumentError) { + if (isJsxOpeningOrSelfClosingElement) { + return candidateForArgumentError; + } checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, undefined, true); } else if (candidateForTypeArgumentError) { @@ -31186,7 +33577,7 @@ var ts; if (headMessage) { diagnosticChainHead = ts.chainDiagnosticMessages(diagnosticChainHead, headMessage); } - reportNoCommonSupertypeError(inferenceCandidates, node.expression || node.tag, diagnosticChainHead); + reportNoCommonSupertypeError(inferenceCandidates, node.tagName || node.expression || node.tag, diagnosticChainHead); } } else { @@ -31222,20 +33613,20 @@ var ts; var candidate = void 0; var typeArgumentsAreValid = void 0; var inferenceContext = originalCandidate.typeParameters - ? createInferenceContext(originalCandidate, false) + ? createInferenceContext(originalCandidate, false, ts.isInJavaScriptFile(node)) : undefined; while (true) { candidate = originalCandidate; if (candidate.typeParameters) { var typeArgumentTypes = void 0; if (typeArguments) { - typeArgumentTypes = ts.map(typeArguments, getTypeFromTypeNode); + typeArgumentTypes = fillMissingTypeArguments(ts.map(typeArguments, getTypeFromTypeNode), candidate.typeParameters, getMinTypeArgumentCount(candidate.typeParameters)); typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, false); } else { inferTypeArguments(node, candidate, args, excludeArgument, inferenceContext); - typeArgumentsAreValid = inferenceContext.failedTypeParameterIndex === undefined; typeArgumentTypes = inferenceContext.inferredTypes; + typeArgumentsAreValid = inferenceContext.failedTypeParameterIndex === undefined; } if (!typeArgumentsAreValid) { break; @@ -31277,7 +33668,7 @@ var ts; if (superType !== unknownType) { var baseTypeNode = ts.getClassExtendsHeritageClauseElement(ts.getContainingClass(node)); if (baseTypeNode) { - var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments); + var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments, baseTypeNode); return resolveCall(node, baseConstructors, candidatesOutArray); } } @@ -31388,12 +33779,13 @@ var ts; if (containingClass) { var containingType = getTypeOfNode(containingClass); var baseTypes = getBaseTypes(containingType); - if (baseTypes.length) { + while (baseTypes.length) { var baseType = baseTypes[0]; if (modifiers & 16 && baseType.symbol === declaration.parent.symbol) { return true; } + baseTypes = getBaseTypes(baseType); } } if (modifiers & 8) { @@ -31425,16 +33817,16 @@ var ts; } function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 226: - case 197: + case 228: + case 198: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 144: + case 145: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 147: + case 148: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 149: - case 151: + case 150: case 152: + case 153: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; } } @@ -31459,16 +33851,42 @@ var ts; } return resolveCall(node, callSignatures, candidatesOutArray, headMessage); } + function getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, candidatesOutArray) { + ts.Debug.assert(!(elementType.flags & 65536)); + var callSignature = resolveStatelessJsxOpeningLikeElement(openingLikeElement, elementType, candidatesOutArray); + return callSignature; + } + function resolveStatelessJsxOpeningLikeElement(openingLikeElement, elementType, candidatesOutArray) { + if (elementType.flags & 65536) { + var types = elementType.types; + var result = void 0; + for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { + var type = types_18[_i]; + result = result || resolveStatelessJsxOpeningLikeElement(openingLikeElement, type, candidatesOutArray); + } + return result; + } + var callSignatures = elementType && getSignaturesOfType(elementType, 0); + if (callSignatures && callSignatures.length > 0) { + var callSignature = void 0; + callSignature = resolveCall(openingLikeElement, callSignatures, candidatesOutArray); + return callSignature; + } + return undefined; + } function resolveSignature(node, candidatesOutArray) { switch (node.kind) { - case 179: - return resolveCallExpression(node, candidatesOutArray); case 180: - return resolveNewExpression(node, candidatesOutArray); + return resolveCallExpression(node, candidatesOutArray); case 181: + return resolveNewExpression(node, candidatesOutArray); + case 182: return resolveTaggedTemplateExpression(node, candidatesOutArray); - case 145: + case 146: return resolveDecorator(node, candidatesOutArray); + case 250: + case 249: + return resolveStatelessJsxOpeningLikeElement(node, checkExpression(node.tagName), candidatesOutArray); } ts.Debug.fail("Branch in 'resolveSignature' should be unreachable."); } @@ -31499,20 +33917,23 @@ var ts; if (node.expression.kind === 96) { return voidType; } - if (node.kind === 180) { + if (node.kind === 181) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 150 && - declaration.kind !== 154 && - declaration.kind !== 159 && + declaration.kind !== 151 && + declaration.kind !== 155 && + declaration.kind !== 160 && !ts.isJSDocConstructSignature(declaration)) { var funcSymbol = node.expression.kind === 70 ? getResolvedSymbol(node.expression) : checkExpression(node.expression).symbol; - if (funcSymbol && funcSymbol.members && (funcSymbol.flags & 16 || ts.isDeclarationOfFunctionExpression(funcSymbol))) { + if (funcSymbol && ts.isDeclarationOfFunctionOrClassExpression(funcSymbol)) { + funcSymbol = getSymbolOfNode(funcSymbol.valueDeclaration.initializer); + } + if (funcSymbol && funcSymbol.members && funcSymbol.flags & 16) { return getInferredClassType(funcSymbol); } - else if (compilerOptions.noImplicitAny) { + else if (noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } return anyType; @@ -31535,9 +33956,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 - ? 225 + ? 227 : resolvedRequire.flags & 3 - ? 223 + ? 225 : 0; if (targetDeclarationKind !== 0) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -31563,6 +33984,22 @@ var ts; function checkNonNullAssertion(node) { return getNonNullableType(checkExpression(node.expression)); } + function checkMetaProperty(node) { + checkGrammarMetaProperty(node); + var container = ts.getNewTargetContainer(node); + if (!container) { + error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); + return unknownType; + } + else if (container.kind === 151) { + var symbol = getSymbolOfNode(container.parent); + return getTypeOfSymbol(symbol); + } + else { + var symbol = getSymbolOfNode(container); + return getTypeOfSymbol(symbol); + } + } function getTypeOfParameter(symbol) { var type = getTypeOfSymbol(symbol); if (strictNullChecks) { @@ -31578,13 +34015,16 @@ var ts; pos < signature.parameters.length - 1 ? getTypeOfParameter(signature.parameters[pos]) : getRestTypeOfSignature(signature) : pos < signature.parameters.length ? getTypeOfParameter(signature.parameters[pos]) : anyType; } - function assignContextualParameterTypes(signature, context, mapper) { + function getTypeOfFirstParameterOfSignature(signature) { + return signature.parameters.length > 0 ? getTypeAtPosition(signature, 0) : neverType; + } + function assignContextualParameterTypes(signature, context, mapper, checkMode) { var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0); - if (isInferentialContext(mapper)) { + if (checkMode === 2) { for (var i = 0; i < len; i++) { var declaration = signature.parameters[i].valueDeclaration; if (declaration.type) { - inferTypes(mapper.context, getTypeFromTypeNode(declaration.type), getTypeAtPosition(context, i)); + inferTypesWithContext(mapper.context, getTypeFromTypeNode(declaration.type), getTypeAtPosition(context, i)); } } } @@ -31592,23 +34032,23 @@ var ts; var parameter = signature.thisParameter; if (!parameter || parameter.valueDeclaration && !parameter.valueDeclaration.type) { if (!parameter) { - signature.thisParameter = createTransientSymbol(context.thisParameter, undefined); + signature.thisParameter = createSymbolWithType(context.thisParameter, undefined); } - assignTypeToParameterAndFixTypeParameters(signature.thisParameter, getTypeOfSymbol(context.thisParameter), mapper); + assignTypeToParameterAndFixTypeParameters(signature.thisParameter, getTypeOfSymbol(context.thisParameter), mapper, checkMode); } } for (var i = 0; i < len; i++) { var parameter = signature.parameters[i]; if (!parameter.valueDeclaration.type) { var contextualParameterType = getTypeAtPosition(context, i); - assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper); + assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper, checkMode); } } if (signature.hasRestParameter && isRestParameterIndex(context, signature.parameters.length - 1)) { var parameter = ts.lastOrUndefined(signature.parameters); if (!parameter.valueDeclaration.type) { var contextualParameterType = getTypeOfSymbol(ts.lastOrUndefined(context.parameters)); - assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper); + assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper, checkMode); } } } @@ -31625,19 +34065,19 @@ var ts; } } } - function assignTypeToParameterAndFixTypeParameters(parameter, contextualType, mapper) { + function assignTypeToParameterAndFixTypeParameters(parameter, contextualType, mapper, checkMode) { var links = getSymbolLinks(parameter); if (!links.type) { links.type = instantiateType(contextualType, mapper); if (links.type === emptyObjectType && - (parameter.valueDeclaration.name.kind === 172 || - parameter.valueDeclaration.name.kind === 173)) { + (parameter.valueDeclaration.name.kind === 173 || + parameter.valueDeclaration.name.kind === 174)) { links.type = getTypeFromBindingPattern(parameter.valueDeclaration.name); } assignBindingElementTypes(parameter.valueDeclaration); } - else if (isInferentialContext(mapper)) { - inferTypes(mapper.context, links.type, instantiateType(contextualType, mapper)); + else if (checkMode === 2) { + inferTypesWithContext(mapper.context, links.type, instantiateType(contextualType, mapper)); } } function getReturnTypeFromJSDocComment(func) { @@ -31648,9 +34088,9 @@ var ts; return undefined; } function createPromiseType(promisedType) { - var globalPromiseType = getGlobalPromiseType(); + var globalPromiseType = getGlobalPromiseType(true); if (globalPromiseType !== emptyGenericType) { - promisedType = getAwaitedType(promisedType); + promisedType = getAwaitedType(promisedType) || emptyObjectType; return createTypeReference(globalPromiseType, [promisedType]); } return emptyObjectType; @@ -31661,46 +34101,56 @@ var ts; error(func, ts.Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option); return unknownType; } + else if (!getGlobalPromiseConstructorSymbol(true)) { + error(func, ts.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option); + } return promiseType; } - function getReturnTypeFromBody(func, contextualMapper) { + function getReturnTypeFromBody(func, checkMode) { var contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func); if (!func.body) { return unknownType; } - var isAsync = ts.isAsyncFunctionLike(func); + var functionFlags = ts.getFunctionFlags(func); var type; - if (func.body.kind !== 204) { - type = checkExpressionCached(func.body, contextualMapper); - if (isAsync) { - type = checkAwaitedType(type, func, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); + if (func.body.kind !== 206) { + type = checkExpressionCached(func.body, checkMode); + if (functionFlags & 2) { + type = checkAwaitedType(type, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } } else { var types = void 0; - var funcIsGenerator = !!func.asteriskToken; - if (funcIsGenerator) { - types = checkAndAggregateYieldOperandTypes(func, contextualMapper); - if (types.length === 0) { - var iterableIteratorAny = createIterableIteratorType(anyType); - if (compilerOptions.noImplicitAny) { + if (functionFlags & 1) { + types = ts.concatenate(checkAndAggregateYieldOperandTypes(func, checkMode), checkAndAggregateReturnExpressionTypes(func, checkMode)); + if (!types || types.length === 0) { + var iterableIteratorAny = functionFlags & 2 + ? createAsyncIterableIteratorType(anyType) + : createIterableIteratorType(anyType); + if (noImplicitAny) { error(func.asteriskToken, ts.Diagnostics.Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type, typeToString(iterableIteratorAny)); } return iterableIteratorAny; } } else { - types = checkAndAggregateReturnExpressionTypes(func, contextualMapper); + types = checkAndAggregateReturnExpressionTypes(func, checkMode); if (!types) { - return isAsync ? createPromiseReturnType(func, neverType) : neverType; + return functionFlags & 2 + ? createPromiseReturnType(func, neverType) + : neverType; } if (types.length === 0) { - return isAsync ? createPromiseReturnType(func, voidType) : voidType; + return functionFlags & 2 + ? createPromiseReturnType(func, voidType) + : voidType; } } type = getUnionType(types, true); - if (funcIsGenerator) { - type = createIterableIteratorType(type); + if (functionFlags & 1) { + type = functionFlags & 2 + ? createAsyncIterableIteratorType(type) + : createIterableIteratorType(type); } } if (!contextualSignature) { @@ -31712,16 +34162,24 @@ var ts; type = getWidenedLiteralType(type); } var widenedType = getWidenedType(type); - return isAsync ? createPromiseReturnType(func, widenedType) : widenedType; + return (functionFlags & 3) === 2 + ? createPromiseReturnType(func, widenedType) + : widenedType; } - function checkAndAggregateYieldOperandTypes(func, contextualMapper) { + function checkAndAggregateYieldOperandTypes(func, checkMode) { var aggregatedTypes = []; + var functionFlags = ts.getFunctionFlags(func); ts.forEachYieldExpression(func.body, function (yieldExpression) { var expr = yieldExpression.expression; if (expr) { - var type = checkExpressionCached(expr, contextualMapper); + var type = checkExpressionCached(expr, checkMode); if (yieldExpression.asteriskToken) { - type = checkElementTypeOfIterable(type, yieldExpression.expression); + type = checkIteratedTypeOrElementType(type, yieldExpression.expression, false, (functionFlags & 2) !== 0); + } + if (functionFlags & 2) { + type = checkAwaitedType(type, expr, yieldExpression.asteriskToken + ? ts.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + : ts.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } if (!ts.contains(aggregatedTypes, type)) { aggregatedTypes.push(type); @@ -31742,29 +34200,29 @@ var ts; if (!switchTypes.length) { return false; } - return eachTypeContainedIn(type, switchTypes); + return eachTypeContainedIn(mapType(type, getRegularTypeOfLiteralType), switchTypes); } function functionHasImplicitReturn(func) { if (!(func.flags & 128)) { return false; } var lastStatement = ts.lastOrUndefined(func.body.statements); - if (lastStatement && lastStatement.kind === 218 && isExhaustiveSwitchStatement(lastStatement)) { + if (lastStatement && lastStatement.kind === 220 && isExhaustiveSwitchStatement(lastStatement)) { return false; } return true; } - function checkAndAggregateReturnExpressionTypes(func, contextualMapper) { - var isAsync = ts.isAsyncFunctionLike(func); + function checkAndAggregateReturnExpressionTypes(func, checkMode) { + var functionFlags = ts.getFunctionFlags(func); var aggregatedTypes = []; var hasReturnWithNoExpression = functionHasImplicitReturn(func); var hasReturnOfTypeNever = false; ts.forEachReturnStatement(func.body, function (returnStatement) { var expr = returnStatement.expression; if (expr) { - var type = checkExpressionCached(expr, contextualMapper); - if (isAsync) { - type = checkAwaitedType(type, func, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); + var type = checkExpressionCached(expr, checkMode); + if (functionFlags & 2) { + type = checkAwaitedType(type, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } if (type.flags & 8192) { hasReturnOfTypeNever = true; @@ -31778,7 +34236,7 @@ var ts; } }); if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever || - func.kind === 184 || func.kind === 185)) { + func.kind === 185 || func.kind === 186)) { return undefined; } if (strictNullChecks && aggregatedTypes.length && hasReturnWithNoExpression) { @@ -31795,7 +34253,7 @@ var ts; if (returnType && maybeTypeOfKind(returnType, 1 | 1024)) { return; } - if (ts.nodeIsMissing(func.body) || func.body.kind !== 204 || !functionHasImplicitReturn(func)) { + if (ts.nodeIsMissing(func.body) || func.body.kind !== 206 || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 256; @@ -31821,20 +34279,20 @@ var ts; error(func.type || func, ts.Diagnostics.Not_all_code_paths_return_a_value); } } - function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) { - ts.Debug.assert(node.kind !== 149 || ts.isObjectLiteralMethod(node)); + function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { + ts.Debug.assert(node.kind !== 150 || ts.isObjectLiteralMethod(node)); var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 184) { + if (!hasGrammarError && node.kind === 185) { checkGrammarForGenerator(node); } - if (contextualMapper === identityMapper && isContextSensitive(node)) { + if (checkMode === 1 && isContextSensitive(node)) { checkNodeDeferred(node); return anyFunctionType; } var links = getNodeLinks(node); var type = getTypeOfSymbol(node.symbol); var contextSensitive = isContextSensitive(node); - var mightFixTypeParameters = contextSensitive && isInferentialContext(contextualMapper); + var mightFixTypeParameters = contextSensitive && checkMode === 2; if (mightFixTypeParameters || !(links.flags & 1024)) { var contextualSignature = getContextualSignature(node); var contextChecked = !!(links.flags & 1024); @@ -31843,10 +34301,10 @@ var ts; if (contextualSignature) { var signature = getSignaturesOfType(type, 0)[0]; if (contextSensitive) { - assignContextualParameterTypes(signature, contextualSignature, contextualMapper || identityMapper); + assignContextualParameterTypes(signature, contextualSignature, getContextualMapper(node), checkMode); } if (mightFixTypeParameters || !node.type && !signature.resolvedReturnType) { - var returnType = getReturnTypeFromBody(node, contextualMapper); + var returnType = getReturnTypeFromBody(node, checkMode); if (!signature.resolvedReturnType) { signature.resolvedReturnType = returnType; } @@ -31858,31 +34316,35 @@ var ts; } } } - if (produceDiagnostics && node.kind !== 149) { + if (produceDiagnostics && node.kind !== 150) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); } return type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 149 || ts.isObjectLiteralMethod(node)); - var isAsync = ts.isAsyncFunctionLike(node); - var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); - if (!node.asteriskToken) { + ts.Debug.assert(node.kind !== 150 || ts.isObjectLiteralMethod(node)); + var functionFlags = ts.getFunctionFlags(node); + var returnOrPromisedType = node.type && + ((functionFlags & 3) === 2 ? + checkAsyncFunctionReturnType(node) : + getTypeFromTypeNode(node.type)); + if ((functionFlags & 1) === 0) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } if (node.body) { if (!node.type) { getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 204) { + if (node.body.kind === 206) { checkSourceElement(node.body); } else { var exprType = checkExpression(node.body); if (returnOrPromisedType) { - if (isAsync) { - var awaitedType = checkAwaitedType(exprType, node.body, ts.Diagnostics.Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member); + if ((functionFlags & 3) === 2) { + var awaitedType = checkAwaitedType(exprType, node.body, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); checkTypeAssignableTo(awaitedType, returnOrPromisedType, node.body); } else { @@ -31901,19 +34363,19 @@ var ts; return true; } function isReadonlySymbol(symbol) { - return symbol.isReadonly || - symbol.flags & 4 && (getDeclarationModifierFlagsFromSymbol(symbol) & 64) !== 0 || - symbol.flags & 3 && (getDeclarationNodeFlagsFromSymbol(symbol) & 2) !== 0 || + return !!(getCheckFlags(symbol) & 8 || + symbol.flags & 4 && getDeclarationModifierFlagsFromSymbol(symbol) & 64 || + symbol.flags & 3 && getDeclarationNodeFlagsFromSymbol(symbol) & 2 || symbol.flags & 98304 && !(symbol.flags & 65536) || - (symbol.flags & 8) !== 0; + symbol.flags & 8); } function isReferenceToReadonlyEntity(expr, symbol) { if (isReadonlySymbol(symbol)) { if (symbol.flags & 4 && - (expr.kind === 177 || expr.kind === 178) && + (expr.kind === 178 || expr.kind === 179) && expr.expression.kind === 98) { var func = ts.getContainingFunction(expr); - if (!(func && func.kind === 150)) + if (!(func && func.kind === 151)) return true; return !(func.parent === symbol.valueDeclaration.parent || func === symbol.valueDeclaration.parent); } @@ -31922,13 +34384,13 @@ var ts; return false; } function isReferenceThroughNamespaceImport(expr) { - if (expr.kind === 177 || expr.kind === 178) { + if (expr.kind === 178 || expr.kind === 179) { var node = ts.skipParentheses(expr.expression); if (node.kind === 70) { var symbol = getNodeLinks(node).resolvedSymbol; if (symbol.flags & 8388608) { var declaration = getDeclarationOfAliasSymbol(symbol); - return declaration && declaration.kind === 237; + return declaration && declaration.kind === 239; } } } @@ -31936,7 +34398,7 @@ var ts; } function checkReferenceExpression(expr, invalidReferenceMessage) { var node = ts.skipParentheses(expr); - if (node.kind !== 70 && node.kind !== 177 && node.kind !== 178) { + if (node.kind !== 70 && node.kind !== 178 && node.kind !== 179) { error(expr, invalidReferenceMessage); return false; } @@ -31944,11 +34406,21 @@ var ts; } function checkDeleteExpression(node) { checkExpression(node.expression); + var expr = ts.skipParentheses(node.expression); + if (expr.kind !== 178 && expr.kind !== 179) { + error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); + return booleanType; + } + var links = getNodeLinks(expr); + var symbol = getExportSymbolOfValueSymbolIfExported(links.resolvedSymbol); + if (symbol && isReadonlySymbol(symbol)) { + error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_read_only_property); + } return booleanType; } function checkTypeOfExpression(node) { checkExpression(node.expression); - return stringType; + return typeofType; } function checkVoidExpression(node) { checkExpression(node.expression); @@ -31956,7 +34428,7 @@ var ts; } function checkAwaitExpression(node) { if (produceDiagnostics) { - if (!(node.flags & 524288)) { + if (!(node.flags & 16384)) { grammarErrorOnFirstToken(node, ts.Diagnostics.await_expression_is_only_allowed_within_an_async_function); } if (isInParameterInitializerBeforeContainingFunction(node)) { @@ -31964,7 +34436,7 @@ var ts; } } var operandType = checkExpression(node.expression); - return checkAwaitedType(operandType, node); + return checkAwaitedType(operandType, node, ts.Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } function checkPrefixUnaryExpression(node) { var operandType = checkExpression(node.operand); @@ -31978,6 +34450,7 @@ var ts; case 36: case 37: case 51: + checkNonNullType(operandType, node.operand); if (maybeTypeOfKind(operandType, 512)) { error(node.operand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(node.operator)); } @@ -31989,7 +34462,7 @@ var ts; booleanType; case 42: case 43: - var ok = checkArithmeticOperandType(node.operand, getNonNullableType(operandType), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); + var ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access); } @@ -32002,7 +34475,7 @@ var ts; if (operandType === silentNeverType) { return silentNeverType; } - var ok = checkArithmeticOperandType(node.operand, getNonNullableType(operandType), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); + var ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access); } @@ -32014,8 +34487,8 @@ var ts; } if (type.flags & 196608) { var types = type.types; - for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { - var t = types_15[_i]; + for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { + var t = types_19[_i]; if (maybeTypeOfKind(t, kind)) { return true; } @@ -32029,8 +34502,8 @@ var ts; } if (type.flags & 65536) { var types = type.types; - for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { - var t = types_16[_i]; + for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { + var t = types_20[_i]; if (!isTypeOfKind(t, kind)) { return false; } @@ -32039,8 +34512,8 @@ var ts; } if (type.flags & 131072) { var types = type.types; - for (var _a = 0, types_17 = types; _a < types_17.length; _a++) { - var t = types_17[_a]; + for (var _a = 0, types_21 = types; _a < types_21.length; _a++) { + var t = types_21[_a]; if (isTypeOfKind(t, kind)) { return true; } @@ -32061,7 +34534,10 @@ var ts; if (isTypeOfKind(leftType, 8190)) { error(left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } - if (!(isTypeAny(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) { + if (!(isTypeAny(rightType) || + getSignaturesOfType(rightType, 0).length || + getSignaturesOfType(rightType, 1).length || + isTypeSubtypeOf(rightType, globalFunctionType))) { error(right, ts.Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); } return booleanType; @@ -32070,39 +34546,41 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } + leftType = checkNonNullType(leftType, left); + rightType = checkNonNullType(rightType, right); if (!(isTypeComparableTo(leftType, stringType) || isTypeOfKind(leftType, 340 | 512))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 | 16384 | 524288)) { + if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 | 540672 | 16777216)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; } function checkObjectLiteralAssignment(node, sourceType) { var properties = node.properties; - for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) { - var p = properties_5[_i]; + for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) { + var p = properties_7[_i]; checkObjectLiteralDestructuringPropertyAssignment(sourceType, p, properties); } return sourceType; } function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property, allProperties) { - if (property.kind === 257 || property.kind === 258) { - var name_22 = property.name; - if (name_22.kind === 142) { - checkComputedPropertyName(name_22); + if (property.kind === 260 || property.kind === 261) { + var name = property.name; + if (name.kind === 143) { + checkComputedPropertyName(name); } - if (isComputedNonLiteralName(name_22)) { + if (isComputedNonLiteralName(name)) { return undefined; } - var text = ts.getTextOfPropertyName(name_22); + var text = ts.getTextOfPropertyName(name); var type = isTypeAny(objectLiteralType) ? objectLiteralType : getTypeOfPropertyOfType(objectLiteralType, text) || isNumericLiteralName(text) && getIndexTypeOfType(objectLiteralType, 1) || getIndexTypeOfType(objectLiteralType, 0); if (type) { - if (property.kind === 258) { + if (property.kind === 261) { return checkDestructuringAssignment(property, type); } else { @@ -32110,10 +34588,13 @@ var ts; } } else { - error(name_22, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name_22)); + error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name)); } } - else if (property.kind === 259) { + else if (property.kind === 262) { + if (languageVersion < 5) { + checkExternalEmitHelpers(property, 4); + } var nonRestNames = []; if (allProperties) { for (var i = 0; i < allProperties.length - 1; i++) { @@ -32127,19 +34608,22 @@ var ts; error(property, ts.Diagnostics.Property_assignment_expected); } } - function checkArrayLiteralAssignment(node, sourceType, contextualMapper) { - var elementType = checkIteratedTypeOrElementType(sourceType, node, false) || unknownType; + function checkArrayLiteralAssignment(node, sourceType, checkMode) { + if (languageVersion < 2 && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 512); + } + var elementType = checkIteratedTypeOrElementType(sourceType, node, false, false) || unknownType; var elements = node.elements; for (var i = 0; i < elements.length; i++) { - checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, elementType, contextualMapper); + checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, elementType, checkMode); } return sourceType; } - function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, contextualMapper) { + function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 198) { - if (element.kind !== 196) { + if (element.kind !== 199) { + if (element.kind !== 197) { var propName = "" + elementIndex; var type = isTypeAny(sourceType) ? sourceType @@ -32147,7 +34631,7 @@ var ts; ? getTypeOfPropertyOfType(sourceType, propName) : elementType; if (type) { - return checkDestructuringAssignment(element, type, contextualMapper); + return checkDestructuringAssignment(element, type, checkMode); } else { checkExpression(element); @@ -32165,48 +34649,48 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 192 && restExpression.operatorToken.kind === 57) { + if (restExpression.kind === 193 && restExpression.operatorToken.kind === 57) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { - return checkDestructuringAssignment(restExpression, createArrayType(elementType), contextualMapper); + return checkDestructuringAssignment(restExpression, createArrayType(elementType), checkMode); } } } } return undefined; } - function checkDestructuringAssignment(exprOrAssignment, sourceType, contextualMapper) { + function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode) { var target; - if (exprOrAssignment.kind === 258) { + if (exprOrAssignment.kind === 261) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { if (strictNullChecks && !(getFalsyFlags(checkExpression(prop.objectAssignmentInitializer)) & 2048)) { sourceType = getTypeWithFacts(sourceType, 131072); } - checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, contextualMapper); + checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode); } target = exprOrAssignment.name; } else { target = exprOrAssignment; } - if (target.kind === 192 && target.operatorToken.kind === 57) { - checkBinaryExpression(target, contextualMapper); + if (target.kind === 193 && target.operatorToken.kind === 57) { + checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 176) { + if (target.kind === 177) { return checkObjectLiteralAssignment(target, sourceType); } - if (target.kind === 175) { - return checkArrayLiteralAssignment(target, sourceType, contextualMapper); + if (target.kind === 176) { + return checkArrayLiteralAssignment(target, sourceType, checkMode); } - return checkReferenceAssignment(target, sourceType, contextualMapper); + return checkReferenceAssignment(target, sourceType, checkMode); } - function checkReferenceAssignment(target, sourceType, contextualMapper) { - var targetType = checkExpression(target, contextualMapper); - var error = target.parent.kind === 259 ? + function checkReferenceAssignment(target, sourceType, checkMode) { + var targetType = checkExpression(target, checkMode); + var error = target.parent.kind === 262 ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; if (checkReferenceExpression(target, error)) { @@ -32220,35 +34704,35 @@ var ts; case 70: case 9: case 11: - case 181: - case 194: + case 182: + case 195: case 12: case 8: case 100: case 85: case 94: - case 137: - case 184: - case 197: + case 138: case 185: - case 175: + case 198: + case 186: case 176: - case 187: - case 201: - case 247: - case 246: + case 177: + case 188: + case 202: + case 249: + case 248: return true; - case 193: + case 194: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 192: + case 193: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 190: case 191: + case 192: switch (node.operator) { case 50: case 36: @@ -32257,9 +34741,9 @@ var ts; return true; } return false; - case 188: - case 182: - case 200: + case 189: + case 183: + case 201: default: return false; } @@ -32274,16 +34758,16 @@ var ts; firstAssignableToSecond && !secondAssignableToFirst ? type2 : getUnionType([type1, type2], true); } - function checkBinaryExpression(node, contextualMapper) { - return checkBinaryLikeExpression(node.left, node.operatorToken, node.right, contextualMapper, node); + function checkBinaryExpression(node, checkMode) { + return checkBinaryLikeExpression(node.left, node.operatorToken, node.right, checkMode, node); } - function checkBinaryLikeExpression(left, operatorToken, right, contextualMapper, errorNode) { + function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 57 && (left.kind === 176 || left.kind === 175)) { - return checkDestructuringAssignment(left, checkExpression(right, contextualMapper), contextualMapper); + if (operator === 57 && (left.kind === 177 || left.kind === 176)) { + return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode); } - var leftType = checkExpression(left, contextualMapper); - var rightType = checkExpression(right, contextualMapper); + var leftType = checkExpression(left, checkMode); + var rightType = checkExpression(right, checkMode); switch (operator) { case 38: case 39: @@ -32310,12 +34794,8 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (leftType.flags & 6144) - leftType = rightType; - if (rightType.flags & 6144) - rightType = leftType; - leftType = getNonNullableType(leftType); - rightType = getNonNullableType(rightType); + leftType = checkNonNullType(leftType, left); + rightType = checkNonNullType(rightType, right); var suggestedOperator = void 0; if ((leftType.flags & 136) && (rightType.flags & 136) && @@ -32335,12 +34815,10 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (leftType.flags & 6144) - leftType = rightType; - if (rightType.flags & 6144) - rightType = leftType; - leftType = getNonNullableType(leftType); - rightType = getNonNullableType(rightType); + if (!isTypeOfKind(leftType, 1 | 262178) && !isTypeOfKind(rightType, 1 | 262178)) { + leftType = checkNonNullType(leftType, left); + rightType = checkNonNullType(rightType, right); + } var resultType = void 0; if (isTypeOfKind(leftType, 340) && isTypeOfKind(rightType, 340)) { resultType = numberType; @@ -32369,8 +34847,8 @@ var ts; case 29: case 30: if (checkForDisallowedESSymbolOperand(operator)) { - leftType = getBaseTypeOfLiteralType(leftType); - rightType = getBaseTypeOfLiteralType(rightType); + leftType = getBaseTypeOfLiteralType(checkNonNullType(leftType, left)); + rightType = getBaseTypeOfLiteralType(checkNonNullType(rightType, right)); if (!isTypeComparableTo(leftType, rightType) && !isTypeComparableTo(rightType, leftType)) { reportOperatorError(); } @@ -32406,11 +34884,14 @@ var ts; checkAssignmentOperator(rightType); return getRegularTypeOfObjectLiteral(rightType); case 25: - if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left)) { + if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isEvalNode(right)) { error(left, ts.Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects); } return rightType; } + function isEvalNode(node) { + return node.kind === 70 && node.text === "eval"; + } function checkForDisallowedESSymbolOperand(operator) { var offendingSymbolOperand = maybeTypeOfKind(leftType, 512) ? left : maybeTypeOfKind(rightType, 512) ? right : @@ -32464,7 +34945,7 @@ var ts; } function checkYieldExpression(node) { if (produceDiagnostics) { - if (!(node.flags & 131072) || isYieldExpressionInClass(node)) { + if (!(node.flags & 4096) || isYieldExpressionInClass(node)) { grammarErrorOnFirstToken(node, ts.Diagnostics.A_yield_expression_is_only_allowed_in_a_generator_body); } if (isInParameterInitializerBeforeContainingFunction(node)) { @@ -32473,30 +34954,45 @@ var ts; } if (node.expression) { var func = ts.getContainingFunction(node); - if (func && func.asteriskToken) { + var functionFlags = func && ts.getFunctionFlags(func); + if (node.asteriskToken) { + if (functionFlags & 2) { + if (languageVersion < 4) { + checkExternalEmitHelpers(node, 4096); + } + } + else if (languageVersion < 2 && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 256); + } + } + if (functionFlags & 1) { var expressionType = checkExpressionCached(node.expression, undefined); var expressionElementType = void 0; var nodeIsYieldStar = !!node.asteriskToken; if (nodeIsYieldStar) { - expressionElementType = checkElementTypeOfIterable(expressionType, node.expression); + expressionElementType = checkIteratedTypeOrElementType(expressionType, node.expression, false, (functionFlags & 2) !== 0); } if (func.type) { - var signatureElementType = getElementTypeOfIterableIterator(getTypeFromTypeNode(func.type)) || anyType; + var signatureElementType = getIteratedTypeOfGenerator(getTypeFromTypeNode(func.type), (functionFlags & 2) !== 0) || anyType; if (nodeIsYieldStar) { - checkTypeAssignableTo(expressionElementType, signatureElementType, node.expression, undefined); + checkTypeAssignableTo(functionFlags & 2 + ? getAwaitedType(expressionElementType, node.expression, ts.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) + : expressionElementType, signatureElementType, node.expression, undefined); } else { - checkTypeAssignableTo(expressionType, signatureElementType, node.expression, undefined); + checkTypeAssignableTo(functionFlags & 2 + ? getAwaitedType(expressionType, node.expression, ts.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) + : expressionType, signatureElementType, node.expression, undefined); } } } } return anyType; } - function checkConditionalExpression(node, contextualMapper) { + function checkConditionalExpression(node, checkMode) { checkExpression(node.condition); - var type1 = checkExpression(node.whenTrue, contextualMapper); - var type2 = checkExpression(node.whenFalse, contextualMapper); + var type1 = checkExpression(node.whenTrue, checkMode); + var type2 = checkExpression(node.whenFalse, checkMode); return getBestChoiceType(type1, type2); } function checkLiteralExpression(node) { @@ -32522,107 +35018,119 @@ var ts; } function checkExpressionWithContextualType(node, contextualType, contextualMapper) { var saveContextualType = node.contextualType; + var saveContextualMapper = node.contextualMapper; node.contextualType = contextualType; - var result = checkExpression(node, contextualMapper); + node.contextualMapper = contextualMapper; + var checkMode = contextualMapper === identityMapper ? 1 : + contextualMapper ? 2 : 0; + var result = checkExpression(node, checkMode); node.contextualType = saveContextualType; + node.contextualMapper = saveContextualMapper; return result; } - function checkExpressionCached(node, contextualMapper) { + function checkExpressionCached(node, checkMode) { var links = getNodeLinks(node); if (!links.resolvedType) { var saveFlowLoopStart = flowLoopStart; flowLoopStart = flowLoopCount; - links.resolvedType = checkExpression(node, contextualMapper); + links.resolvedType = checkExpression(node, checkMode); flowLoopStart = saveFlowLoopStart; } return links.resolvedType; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 182 || node.kind === 200; + return node.kind === 183 || node.kind === 201; } function checkDeclarationInitializer(declaration) { - var type = checkExpressionCached(declaration.initializer); + var type = getTypeOfExpression(declaration.initializer, true); return ts.getCombinedNodeFlags(declaration) & 2 || ts.getCombinedModifierFlags(declaration) & 64 && !ts.isParameterPropertyDeclaration(declaration) || isTypeAssertion(declaration.initializer) ? type : getWidenedLiteralType(type); } function isLiteralContextualType(contextualType) { if (contextualType) { - if (contextualType.flags & 16384) { - var apparentType = getApparentTypeOfTypeParameter(contextualType); - if (apparentType.flags & (2 | 4 | 8 | 16)) { + if (contextualType.flags & 540672) { + var constraint = getBaseConstraintOfType(contextualType) || emptyObjectType; + if (constraint.flags & (2 | 4 | 8 | 16)) { return true; } - contextualType = apparentType; + contextualType = constraint; } return maybeTypeOfKind(contextualType, (480 | 262144)); } return false; } - function checkExpressionForMutableLocation(node, contextualMapper) { - var type = checkExpression(node, contextualMapper); + function checkExpressionForMutableLocation(node, checkMode) { + var type = checkExpression(node, checkMode); return isTypeAssertion(node) || isLiteralContextualType(getContextualType(node)) ? type : getWidenedLiteralType(type); } - function checkPropertyAssignment(node, contextualMapper) { - if (node.name.kind === 142) { + function checkPropertyAssignment(node, checkMode) { + if (node.name.kind === 143) { checkComputedPropertyName(node.name); } - return checkExpressionForMutableLocation(node.initializer, contextualMapper); + return checkExpressionForMutableLocation(node.initializer, checkMode); } - function checkObjectLiteralMethod(node, contextualMapper) { + function checkObjectLiteralMethod(node, checkMode) { checkGrammarMethod(node); - if (node.name.kind === 142) { + if (node.name.kind === 143) { checkComputedPropertyName(node.name); } - var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - return instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); + var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); + return instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode); } - function instantiateTypeWithSingleGenericCallSignature(node, type, contextualMapper) { - if (isInferentialContext(contextualMapper)) { + function instantiateTypeWithSingleGenericCallSignature(node, type, checkMode) { + if (checkMode === 2) { var signature = getSingleCallSignature(type); if (signature && signature.typeParameters) { var contextualType = getApparentTypeOfContextualType(node); if (contextualType) { var contextualSignature = getSingleCallSignature(contextualType); if (contextualSignature && !contextualSignature.typeParameters) { - return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper)); + return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, getContextualMapper(node))); } } } } return type; } - function getTypeOfExpression(node) { - if (node.kind === 179 && node.expression.kind !== 96) { + function getTypeOfExpression(node, cache) { + if (node.kind === 180 && node.expression.kind !== 96 && !ts.isRequireCall(node, true)) { var funcType = checkNonNullExpression(node.expression); var signature = getSingleCallSignature(funcType); if (signature && !signature.typeParameters) { return getReturnTypeOfSignature(signature); } } - return checkExpression(node); + return cache ? checkExpressionCached(node) : checkExpression(node); } - function checkExpression(node, contextualMapper) { + function getContextFreeTypeOfExpression(node) { + var saveContextualType = node.contextualType; + node.contextualType = anyType; + var type = getTypeOfExpression(node); + node.contextualType = saveContextualType; + return type; + } + function checkExpression(node, checkMode) { var type; - if (node.kind === 141) { + if (node.kind === 142) { type = checkQualifiedName(node); } else { - var uninstantiatedType = checkExpressionWorker(node, contextualMapper); - type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); + var uninstantiatedType = checkExpressionWorker(node, checkMode); + type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode); } if (isConstEnumObjectType(type)) { - var ok = (node.parent.kind === 177 && node.parent.expression === node) || - (node.parent.kind === 178 && node.parent.expression === node) || - ((node.kind === 70 || node.kind === 141) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 178 && node.parent.expression === node) || + (node.parent.kind === 179 && node.parent.expression === node) || + ((node.kind === 70 || node.kind === 142) && isInRightSideOfImportOrExportAssignment(node)); if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); } } return type; } - function checkExpressionWorker(node, contextualMapper) { + function checkExpressionWorker(node, checkMode) { switch (node.kind) { case 70: return checkIdentifier(node); @@ -32637,66 +35145,70 @@ var ts; case 100: case 85: return checkLiteralExpression(node); - case 194: + case 195: return checkTemplateExpression(node); case 12: return stringType; case 11: return globalRegExpType; - case 175: - return checkArrayLiteral(node, contextualMapper); case 176: - return checkObjectLiteral(node, contextualMapper); + return checkArrayLiteral(node, checkMode); case 177: - return checkPropertyAccessExpression(node); + return checkObjectLiteral(node, checkMode); case 178: - return checkIndexedAccess(node); + return checkPropertyAccessExpression(node); case 179: + return checkIndexedAccess(node); case 180: - return checkCallExpression(node); case 181: - return checkTaggedTemplateExpression(node); - case 183: - return checkExpression(node.expression, contextualMapper); - case 197: - return checkClassExpression(node); - case 184: - case 185: - return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 187: - return checkTypeOfExpression(node); + return checkCallExpression(node); case 182: - case 200: - return checkAssertion(node); - case 201: - return checkNonNullAssertion(node); - case 186: - return checkDeleteExpression(node); - case 188: - return checkVoidExpression(node); - case 189: - return checkAwaitExpression(node); - case 190: - return checkPrefixUnaryExpression(node); - case 191: - return checkPostfixUnaryExpression(node); - case 192: - return checkBinaryExpression(node, contextualMapper); - case 193: - return checkConditionalExpression(node, contextualMapper); - case 196: - return checkSpreadExpression(node, contextualMapper); + return checkTaggedTemplateExpression(node); + case 184: + return checkExpression(node.expression, checkMode); case 198: + return checkClassExpression(node); + case 185: + case 186: + return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); + case 188: + return checkTypeOfExpression(node); + case 183: + case 201: + return checkAssertion(node); + case 202: + return checkNonNullAssertion(node); + case 203: + return checkMetaProperty(node); + case 187: + return checkDeleteExpression(node); + case 189: + return checkVoidExpression(node); + case 190: + return checkAwaitExpression(node); + case 191: + return checkPrefixUnaryExpression(node); + case 192: + return checkPostfixUnaryExpression(node); + case 193: + return checkBinaryExpression(node, checkMode); + case 194: + return checkConditionalExpression(node, checkMode); + case 197: + return checkSpreadExpression(node, checkMode); + case 199: return undefinedWideningType; - case 195: + case 196: return checkYieldExpression(node); - case 252: - return checkJsxExpression(node); - case 246: - return checkJsxElement(node); - case 247: - return checkJsxSelfClosingElement(node); + case 255: + return checkJsxExpression(node, checkMode); case 248: + return checkJsxElement(node); + case 249: + return checkJsxSelfClosingElement(node); + case 253: + return checkJsxAttributes(node, checkMode); + case 250: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return unknownType; @@ -32706,7 +35218,16 @@ var ts; grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected); } checkSourceElement(node.constraint); - getConstraintOfTypeParameter(getDeclaredTypeOfTypeParameter(getSymbolOfNode(node))); + checkSourceElement(node.default); + var typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node)); + if (!hasNonCircularBaseConstraint(typeParameter)) { + error(node.constraint, ts.Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(typeParameter)); + } + var constraintType = getConstraintOfTypeParameter(typeParameter); + var defaultType = getDefaultFromTypeParameter(typeParameter); + if (constraintType && defaultType) { + checkTypeAssignableTo(defaultType, getTypeWithThisArgument(constraintType, defaultType), node.default, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + } if (produceDiagnostics) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); } @@ -32717,7 +35238,7 @@ var ts; var func = ts.getContainingFunction(node); if (ts.getModifierFlags(node) & 92) { func = ts.getContainingFunction(node); - if (!(func.kind === 150 && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 151 && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -32728,7 +35249,7 @@ var ts; if (ts.indexOf(func.parameters, node) !== 0) { error(node, ts.Diagnostics.A_this_parameter_must_be_the_first_parameter); } - if (func.kind === 150 || func.kind === 154 || func.kind === 159) { + if (func.kind === 151 || func.kind === 155 || func.kind === 160) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } } @@ -32736,14 +35257,6 @@ var ts; error(node, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); } } - function isSyntacticallyValidGenerator(node) { - if (!node.asteriskToken || !node.body) { - return false; - } - return node.kind === 149 || - node.kind === 225 || - node.kind === 184; - } function getTypePredicateParameterIndex(parameterList, parameter) { if (parameterList) { for (var i = 0; i < parameterList.length; i++) { @@ -32783,9 +35296,9 @@ var ts; else if (parameterName) { var hasReportedError = false; for (var _i = 0, _a = parent.parameters; _i < _a.length; _i++) { - var name_23 = _a[_i].name; - if (ts.isBindingPattern(name_23) && - checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_23, parameterName, typePredicate.parameterName)) { + var name = _a[_i].name; + if (ts.isBindingPattern(name) && + checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, parameterName, typePredicate.parameterName)) { hasReportedError = true; break; } @@ -32798,16 +35311,16 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { + case 186: + case 154: + case 227: case 185: - case 153: - case 225: - case 184: - case 158: + case 159: + case 150: case 149: - case 148: - var parent_9 = node.parent; - if (node === parent_9.type) { - return parent_9; + var parent = node.parent; + if (node === parent.type) { + return parent; } } } @@ -32817,29 +35330,44 @@ var ts; if (ts.isOmittedExpression(element)) { continue; } - var name_24 = element.name; - if (name_24.kind === 70 && - name_24.text === predicateVariableName) { + var name = element.name; + if (name.kind === 70 && + name.text === predicateVariableName) { error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name_24.kind === 173 || - name_24.kind === 172) { - if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_24, predicateVariableNode, predicateVariableName)) { + else if (name.kind === 174 || + name.kind === 173) { + if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } } } } function checkSignatureDeclaration(node) { - if (node.kind === 155) { + if (node.kind === 156) { checkGrammarIndexSignature(node); } - else if (node.kind === 158 || node.kind === 225 || node.kind === 159 || - node.kind === 153 || node.kind === 150 || - node.kind === 154) { + else if (node.kind === 159 || node.kind === 227 || node.kind === 160 || + node.kind === 154 || node.kind === 151 || + node.kind === 155) { checkGrammarFunctionLikeDeclaration(node); } + var functionFlags = ts.getFunctionFlags(node); + if ((functionFlags & 7) === 2 && languageVersion < 4) { + checkExternalEmitHelpers(node, 64); + if (languageVersion < 2) { + checkExternalEmitHelpers(node, 128); + } + } + if ((functionFlags & 5) === 1) { + if (functionFlags & 2 && languageVersion < 4) { + checkExternalEmitHelpers(node, 2048); + } + else if (languageVersion < 2) { + checkExternalEmitHelpers(node, 128); + } + } checkTypeParameters(node.typeParameters); ts.forEach(node.parameters, checkParameter); if (node.type) { @@ -32847,29 +35375,32 @@ var ts; } if (produceDiagnostics) { checkCollisionWithArgumentsInGeneratedCode(node); - if (compilerOptions.noImplicitAny && !node.type) { + if (noImplicitAny && !node.type) { switch (node.kind) { - case 154: + case 155: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 153: + case 154: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } } if (node.type) { - if (languageVersion >= 2 && isSyntacticallyValidGenerator(node)) { + var functionFlags_1 = ts.getFunctionFlags(node); + if ((functionFlags_1 & 5) === 1) { var returnType = getTypeFromTypeNode(node.type); if (returnType === voidType) { error(node.type, ts.Diagnostics.A_generator_cannot_have_a_void_type_annotation); } else { - var generatorElementType = getElementTypeOfIterableIterator(returnType) || anyType; - var iterableIteratorInstantiation = createIterableIteratorType(generatorElementType); + var generatorElementType = getIteratedTypeOfGenerator(returnType, (functionFlags_1 & 2) !== 0) || anyType; + var iterableIteratorInstantiation = functionFlags_1 & 2 + ? createAsyncIterableIteratorType(generatorElementType) + : createIterableIteratorType(generatorElementType); checkTypeAssignableTo(iterableIteratorInstantiation, returnType, node.type); } } - else if (ts.isAsyncFunctionLike(node)) { + else if ((functionFlags_1 & 3) === 2) { checkAsyncFunctionReturnType(node); } } @@ -32879,11 +35410,18 @@ var ts; } } function checkClassForDuplicateDeclarations(node) { + var Declaration; + (function (Declaration) { + Declaration[Declaration["Getter"] = 1] = "Getter"; + Declaration[Declaration["Setter"] = 2] = "Setter"; + Declaration[Declaration["Method"] = 4] = "Method"; + Declaration[Declaration["Property"] = 3] = "Property"; + })(Declaration || (Declaration = {})); var instanceNames = ts.createMap(); var staticNames = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 150) { + if (member.kind === 151) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param)) { @@ -32892,36 +35430,65 @@ var ts; } } else { - var isStatic = ts.forEach(member.modifiers, function (m) { return m.kind === 114; }); + var isStatic = ts.getModifierFlags(member) & 32; var names = isStatic ? staticNames : instanceNames; var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name); if (memberName) { switch (member.kind) { - case 151: + case 152: addName(names, member.name, memberName, 1); break; - case 152: + case 153: addName(names, member.name, memberName, 2); break; - case 147: + case 148: addName(names, member.name, memberName, 3); break; + case 150: + addName(names, member.name, memberName, 4); + break; } } } } function addName(names, location, name, meaning) { - var prev = names[name]; + var prev = names.get(name); if (prev) { - if (prev & meaning) { + if (prev & 4) { + if (meaning !== 4) { + error(location, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(location)); + } + } + else if (prev & meaning) { error(location, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(location)); } else { - names[name] = prev | meaning; + names.set(name, prev | meaning); } } else { - names[name] = meaning; + names.set(name, meaning); + } + } + } + function checkClassForStaticPropertyNameConflicts(node) { + for (var _i = 0, _a = node.members; _i < _a.length; _i++) { + var member = _a[_i]; + var memberNameNode = member.name; + var isStatic = ts.getModifierFlags(member) & 32; + if (isStatic && memberNameNode) { + var memberName = ts.getPropertyNameForPropertyNameNode(memberNameNode); + switch (memberName) { + case "name": + case "length": + case "caller": + case "arguments": + case "prototype": + var message = ts.Diagnostics.Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1; + var className = getNameOfSymbol(getSymbolOfNode(node)); + error(memberNameNode, message, memberName, className); + break; + } } } } @@ -32929,7 +35496,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind == 146) { + if (member.kind === 147) { var memberName = void 0; switch (member.name.kind) { case 9: @@ -32940,18 +35507,18 @@ var ts; default: continue; } - if (names[memberName]) { + if (names.get(memberName)) { error(member.symbol.valueDeclaration.name, ts.Diagnostics.Duplicate_identifier_0, memberName); error(member.name, ts.Diagnostics.Duplicate_identifier_0, memberName); } else { - names[memberName] = true; + names.set(memberName, true); } } } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 227) { + if (node.kind === 229) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -32966,7 +35533,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 134: + case 135: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -33033,12 +35600,12 @@ var ts; if (n.kind === 98) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 184 && n.kind !== 225) { + else if (n.kind !== 185 && n.kind !== 227) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 147 && + return n.kind === 148 && !(ts.getModifierFlags(n) & 32) && !!n.initializer; } @@ -33058,7 +35625,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_3 = statements; _i < statements_3.length; _i++) { var statement = statements_3[_i]; - if (statement.kind === 207 && ts.isSuperCall(statement.expression)) { + if (statement.kind === 209 && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -33081,18 +35648,18 @@ var ts; checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 151) { + if (node.kind === 152) { if (!ts.isInAmbientContext(node) && ts.nodeIsPresent(node.body) && (node.flags & 128)) { if (!(node.flags & 256)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); } } } - if (node.name.kind === 142) { + if (node.name.kind === 143) { checkComputedPropertyName(node.name); } if (!ts.hasDynamicName(node)) { - var otherKind = node.kind === 151 ? 152 : 151; + var otherKind = node.kind === 152 ? 153 : 152; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { if ((ts.getModifierFlags(node) & 28) !== (ts.getModifierFlags(otherAccessor) & 28)) { @@ -33106,17 +35673,12 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 151) { + if (node.kind === 152) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } - if (node.parent.kind !== 176) { - checkSourceElement(node.body); - registerForUnusedIdentifiersCheck(node); - } - else { - checkNodeDeferred(node); - } + checkSourceElement(node.body); + registerForUnusedIdentifiersCheck(node); } function checkAccessorDeclarationTypesIdentical(first, second, getAnnotatedType, message) { var firstType = getAnnotatedType(first); @@ -33125,14 +35687,11 @@ var ts; error(first, message); } } - function checkAccessorDeferred(node) { - checkSourceElement(node.body); - registerForUnusedIdentifiersCheck(node); - } function checkMissingDeclaration(node) { checkDecorators(node); } function checkTypeArgumentConstraints(typeParameters, typeArgumentNodes) { + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); var typeArguments; var mapper; var result = true; @@ -33140,7 +35699,7 @@ var ts; var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { if (!typeArguments) { - typeArguments = ts.map(typeArgumentNodes, getTypeFromTypeNode); + typeArguments = fillMissingTypeArguments(ts.map(typeArgumentNodes, getTypeFromTypeNode), typeParameters, minTypeArgumentCount); mapper = createTypeMapper(typeParameters, typeArguments); } var typeArgument = typeArguments[i]; @@ -33191,25 +35750,42 @@ var ts; function checkUnionOrIntersectionType(node) { ts.forEach(node.types, checkSourceElement); } + function checkIndexedAccessIndexType(type, accessNode) { + if (!(type.flags & 524288)) { + return type; + } + var objectType = type.objectType; + var indexType = type.indexType; + if (isTypeAssignableTo(indexType, getIndexType(objectType))) { + return type; + } + if (maybeTypeOfKind(objectType, 540672) && isTypeOfKind(indexType, 340)) { + var constraint = getBaseConstraintOfType(objectType); + if (constraint && getIndexInfoOfType(constraint, 1)) { + return type; + } + } + error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); + return type; + } function checkIndexedAccessType(node) { - getTypeFromIndexedAccessTypeNode(node); + checkIndexedAccessIndexType(getTypeFromIndexedAccessTypeNode(node), node); } function checkMappedType(node) { checkSourceElement(node.typeParameter); checkSourceElement(node.type); var type = getTypeFromMappedTypeNode(node); var constraintType = getConstraintTypeFromMappedType(type); - var keyType = constraintType.flags & 16384 ? getApparentTypeOfTypeParameter(constraintType) : constraintType; - checkTypeAssignableTo(keyType, stringType, node.typeParameter.constraint); + checkTypeAssignableTo(constraintType, stringType, node.typeParameter.constraint); } function isPrivateWithinAmbient(node) { return (ts.getModifierFlags(node) & 8) && ts.isInAmbientContext(node); } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedModifierFlags(n); - if (n.parent.kind !== 227 && - n.parent.kind !== 226 && - n.parent.kind !== 197 && + if (n.parent.kind !== 229 && + n.parent.kind !== 228 && + n.parent.kind !== 198 && ts.isInAmbientContext(n)) { if (!(flags & 2)) { flags |= 1; @@ -33286,7 +35862,7 @@ var ts; if (subsequentNode.kind === node.kind) { var errorNode_1 = subsequentNode.name || subsequentNode; if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - var reportError = (node.kind === 149 || node.kind === 148) && + var reportError = (node.kind === 150 || node.kind === 149) && (ts.getModifierFlags(node) & 32) !== (ts.getModifierFlags(subsequentNode) & 32); if (reportError) { var diagnostic = ts.getModifierFlags(node) & 32 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; @@ -33315,15 +35891,15 @@ var ts; } var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; - for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { - var current = declarations_4[_i]; + for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { + var current = declarations_5[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 227 || node.parent.kind === 161 || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 229 || node.parent.kind === 162 || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 225 || node.kind === 149 || node.kind === 148 || node.kind === 150) { + if (node.kind === 227 || node.kind === 150 || node.kind === 149 || node.kind === 151) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -33374,8 +35950,8 @@ var ts; if (bodyDeclaration) { var signatures = getSignaturesOfSymbol(symbol); var bodySignature = getSignatureFromDeclaration(bodyDeclaration); - for (var _a = 0, signatures_3 = signatures; _a < signatures_3.length; _a++) { - var signature = signatures_3[_a]; + for (var _a = 0, signatures_4 = signatures; _a < signatures_4.length; _a++) { + var signature = signatures_4[_a]; if (!isImplementationCompatibleWithOverload(bodySignature, signature)) { error(signature.declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); break; @@ -33434,16 +36010,16 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 227: + case 229: return 2097152; - case 230: + case 232: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 ? 4194304 | 1048576 : 4194304; - case 226: - case 229: + case 228: + case 231: return 2097152 | 1048576; - case 234: + case 236: var result_3 = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_3 |= getDeclarationSpaces(d); }); @@ -33453,87 +36029,92 @@ var ts; } } } - function checkNonThenableType(type, location, message) { - type = getWidenedType(type); - if (!isTypeAny(type) && !isTypeNever(type) && isTypeAssignableTo(type, getGlobalThenableType())) { - if (location) { - if (!message) { - message = ts.Diagnostics.Operand_for_await_does_not_have_a_valid_callable_then_member; - } - error(location, message); - } - return unknownType; - } - return type; + function getAwaitedTypeOfPromise(type, errorNode, diagnosticMessage) { + var promisedType = getPromisedTypeOfPromise(type, errorNode); + return promisedType && getAwaitedType(promisedType, errorNode, diagnosticMessage); } - function getPromisedType(promise) { + function getPromisedTypeOfPromise(promise, errorNode) { if (isTypeAny(promise)) { return undefined; } - if (getObjectFlags(promise) & 4) { - if (promise.target === tryGetGlobalPromiseType() - || promise.target === getGlobalPromiseLikeType()) { - return promise.typeArguments[0]; - } + var typeAsPromise = promise; + if (typeAsPromise.promisedTypeOfPromise) { + return typeAsPromise.promisedTypeOfPromise; } - var globalPromiseLikeType = getInstantiatedGlobalPromiseLikeType(); - if (globalPromiseLikeType === emptyObjectType || !isTypeAssignableTo(promise, globalPromiseLikeType)) { - return undefined; + if (isReferenceToType(promise, getGlobalPromiseType(false))) { + return typeAsPromise.promisedTypeOfPromise = promise.typeArguments[0]; } var thenFunction = getTypeOfPropertyOfType(promise, "then"); - if (!thenFunction || isTypeAny(thenFunction)) { + if (isTypeAny(thenFunction)) { return undefined; } - var thenSignatures = getSignaturesOfType(thenFunction, 0); + var thenSignatures = thenFunction ? getSignaturesOfType(thenFunction, 0) : emptyArray; if (thenSignatures.length === 0) { + if (errorNode) { + error(errorNode, ts.Diagnostics.A_promise_must_have_a_then_method); + } return undefined; } - var onfulfilledParameterType = getTypeWithFacts(getUnionType(ts.map(thenSignatures, getTypeOfFirstParameterOfSignature)), 131072); + var onfulfilledParameterType = getTypeWithFacts(getUnionType(ts.map(thenSignatures, getTypeOfFirstParameterOfSignature)), 524288); if (isTypeAny(onfulfilledParameterType)) { return undefined; } var onfulfilledParameterSignatures = getSignaturesOfType(onfulfilledParameterType, 0); if (onfulfilledParameterSignatures.length === 0) { + if (errorNode) { + error(errorNode, ts.Diagnostics.The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback); + } return undefined; } - return getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), true); + return typeAsPromise.promisedTypeOfPromise = getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), true); } - function getTypeOfFirstParameterOfSignature(signature) { - return signature.parameters.length > 0 ? getTypeAtPosition(signature, 0) : neverType; + function checkAwaitedType(type, errorNode, diagnosticMessage) { + return getAwaitedType(type, errorNode, diagnosticMessage) || unknownType; } - function getAwaitedType(type) { - return checkAwaitedType(type, undefined, undefined); - } - function checkAwaitedType(type, location, message) { - return checkAwaitedTypeWorker(type); - function checkAwaitedTypeWorker(type) { - if (type.flags & 65536) { - var types = []; - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var constituentType = _a[_i]; - types.push(checkAwaitedTypeWorker(constituentType)); - } - return getUnionType(types, true); - } - else { - var promisedType = getPromisedType(type); - if (promisedType === undefined) { - return checkNonThenableType(type, location, message); - } - else { - if (type.id === promisedType.id || ts.indexOf(awaitedTypeStack, promisedType.id) >= 0) { - if (location) { - error(location, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method, symbolToString(type.symbol)); - } - return unknownType; - } - awaitedTypeStack.push(type.id); - var awaitedType = checkAwaitedTypeWorker(promisedType); - awaitedTypeStack.pop(); - return awaitedType; - } - } + function getAwaitedType(type, errorNode, diagnosticMessage) { + var typeAsAwaitable = type; + if (typeAsAwaitable.awaitedTypeOfType) { + return typeAsAwaitable.awaitedTypeOfType; } + if (isTypeAny(type)) { + return typeAsAwaitable.awaitedTypeOfType = type; + } + if (type.flags & 65536) { + var types = void 0; + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var constituentType = _a[_i]; + types = ts.append(types, getAwaitedType(constituentType, errorNode, diagnosticMessage)); + } + if (!types) { + return undefined; + } + return typeAsAwaitable.awaitedTypeOfType = getUnionType(types, true); + } + var promisedType = getPromisedTypeOfPromise(type); + if (promisedType) { + if (type.id === promisedType.id || ts.indexOf(awaitedTypeStack, promisedType.id) >= 0) { + if (errorNode) { + error(errorNode, ts.Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method); + } + return undefined; + } + awaitedTypeStack.push(type.id); + var awaitedType = getAwaitedType(promisedType, errorNode, diagnosticMessage); + awaitedTypeStack.pop(); + if (!awaitedType) { + return undefined; + } + return typeAsAwaitable.awaitedTypeOfType = awaitedType; + } + var thenFunction = getTypeOfPropertyOfType(type, "then"); + if (thenFunction && getSignaturesOfType(thenFunction, 0).length > 0) { + if (errorNode) { + ts.Debug.assert(!!diagnosticMessage); + error(errorNode, diagnosticMessage); + } + return undefined; + } + return typeAsAwaitable.awaitedTypeOfType = type; } function checkAsyncFunctionReturnType(node) { var returnType = getTypeFromTypeNode(node.type); @@ -33541,8 +36122,8 @@ var ts; if (returnType === unknownType) { return unknownType; } - var globalPromiseType = getGlobalPromiseType(); - if (globalPromiseType !== emptyGenericType && globalPromiseType !== getTargetType(returnType)) { + var globalPromiseType = getGlobalPromiseType(true); + if (globalPromiseType !== emptyGenericType && !isReferenceToType(returnType, globalPromiseType)) { error(node.type, ts.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type); return unknownType; } @@ -33560,10 +36141,15 @@ var ts; var promiseConstructorSymbol = resolveEntityName(promiseConstructorName, 107455, true); var promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : unknownType; if (promiseConstructorType === unknownType) { - error(node.type, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, ts.entityNameToString(promiseConstructorName)); + if (promiseConstructorName.kind === 70 && promiseConstructorName.text === "Promise" && getTargetType(returnType) === getGlobalPromiseType(false)) { + error(node.type, ts.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option); + } + else { + error(node.type, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, ts.entityNameToString(promiseConstructorName)); + } return unknownType; } - var globalPromiseConstructorLikeType = getGlobalPromiseConstructorLikeType(); + var globalPromiseConstructorLikeType = getGlobalPromiseConstructorLikeType(true); if (globalPromiseConstructorLikeType === emptyObjectType) { error(node.type, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, ts.entityNameToString(promiseConstructorName)); return unknownType; @@ -33578,7 +36164,7 @@ var ts; return unknownType; } } - return checkAwaitedType(returnType, node, ts.Diagnostics.An_async_function_or_method_must_have_a_valid_awaitable_return_type); + return checkAwaitedType(returnType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } function checkDecorator(node) { var signature = getResolvedSignature(node); @@ -33590,22 +36176,22 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 226: + case 228: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 144: + case 145: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 147: + case 148: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 149: - case 151: + case 150: case 152: + case 153: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -33624,6 +36210,9 @@ var ts; markAliasSymbolAsReferenced(rootSymbol); } } + function getParameterTypeNodeForDecoratorCheck(node) { + return node.dotDotDotToken ? ts.getRestParameterElementType(node.type) : node.type; + } function checkDecorators(node) { if (!node.decorators) { return; @@ -33634,28 +36223,36 @@ var ts; if (!compilerOptions.experimentalDecorators) { error(node, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning); } + var firstDecorator = node.decorators[0]; + checkExternalEmitHelpers(firstDecorator, 8); + if (node.kind === 145) { + checkExternalEmitHelpers(firstDecorator, 32); + } if (compilerOptions.emitDecoratorMetadata) { + checkExternalEmitHelpers(firstDecorator, 16); switch (node.kind) { - case 226: + case 228: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { var parameter = _a[_i]; - markTypeNodeAsReferenced(parameter.type); + markTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } } break; - case 149: - case 151: + case 150: case 152: + case 153: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; - markTypeNodeAsReferenced(parameter.type); + markTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markTypeNodeAsReferenced(node.type); break; - case 147: - case 144: + case 148: + markTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); + break; + case 145: markTypeNodeAsReferenced(node.type); break; } @@ -33667,6 +36264,7 @@ var ts; checkFunctionOrMethodDeclaration(node) || checkGrammarForGenerator(node); checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); } @@ -33674,8 +36272,8 @@ var ts; function checkFunctionOrMethodDeclaration(node) { checkDecorators(node); checkSignatureDeclaration(node); - var isAsync = ts.isAsyncFunctionLike(node); - if (node.name && node.name.kind === 142) { + var functionFlags = ts.getFunctionFlags(node); + if (node.name && node.name.kind === 143) { checkComputedPropertyName(node.name); } if (!ts.hasDynamicName(node)) { @@ -33693,15 +36291,17 @@ var ts; } } checkSourceElement(node.body); - if (!node.asteriskToken) { - var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); + if ((functionFlags & 1) === 0) { + var returnOrPromisedType = node.type && (functionFlags & 2 + ? checkAsyncFunctionReturnType(node) + : getTypeFromTypeNode(node.type)); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } if (produceDiagnostics && !node.type) { - if (compilerOptions.noImplicitAny && ts.nodeIsMissing(node.body) && !isPrivateWithinAmbient(node)) { + if (noImplicitAny && ts.nodeIsMissing(node.body) && !isPrivateWithinAmbient(node)) { reportImplicitAnyError(node, anyType); } - if (node.asteriskToken && ts.nodeIsPresent(node.body)) { + if (functionFlags & 1 && ts.nodeIsPresent(node.body)) { getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } } @@ -33717,56 +36317,54 @@ var ts; for (var _i = 0, deferredUnusedIdentifierNodes_1 = deferredUnusedIdentifierNodes; _i < deferredUnusedIdentifierNodes_1.length; _i++) { var node = deferredUnusedIdentifierNodes_1[_i]; switch (node.kind) { - case 261: - case 230: + case 264: + case 232: checkUnusedModuleMembers(node); break; - case 226: - case 197: + case 228: + case 198: checkUnusedClassMembers(node); checkUnusedTypeParameters(node); break; - case 227: + case 229: checkUnusedTypeParameters(node); break; - case 204: - case 232: - case 211: - case 212: + case 206: + case 234: case 213: + case 214: + case 215: checkUnusedLocalsAndParameters(node); break; - case 150: - case 184: - case 225: - case 185: - case 149: case 151: + case 185: + case 227: + case 186: + case 150: case 152: + case 153: if (node.body) { checkUnusedLocalsAndParameters(node); } checkUnusedTypeParameters(node); break; - case 148: - case 153: + case 149: case 154: case 155: - case 158: + case 156: case 159: + case 160: checkUnusedTypeParameters(node); break; } - ; } } } function checkUnusedLocalsAndParameters(node) { - if (node.parent.kind !== 227 && noUnusedIdentifiers && !ts.isInAmbientContext(node)) { - var _loop_3 = function (key) { - var local = node.locals[key]; + if (node.parent.kind !== 229 && noUnusedIdentifiers && !ts.isInAmbientContext(node)) { + node.locals.forEach(function (local) { if (!local.isReferenced) { - if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 144) { + if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 145) { var parameter = ts.getRootDeclaration(local.valueDeclaration); if (compilerOptions.noUnusedParameters && !ts.isParameterPropertyDeclaration(parameter) && @@ -33779,22 +36377,28 @@ var ts; ts.forEach(local.declarations, function (d) { return errorUnusedLocal(d.name || d, local.name); }); } } - }; - for (var key in node.locals) { - _loop_3(key); - } + }); } } + function isRemovedPropertyFromObjectSpread(node) { + if (ts.isBindingElement(node) && ts.isObjectBindingPattern(node.parent)) { + var lastElement = ts.lastOrUndefined(node.parent.elements); + return lastElement !== node && !!lastElement.dotDotDotToken; + } + return false; + } function errorUnusedLocal(node, name) { if (isIdentifierThatStartsWithUnderScore(node)) { var declaration = ts.getRootDeclaration(node.parent); - if (declaration.kind === 223 && - (declaration.parent.parent.kind === 212 || - declaration.parent.parent.kind === 213)) { + if (declaration.kind === 225 && + (declaration.parent.parent.kind === 214 || + declaration.parent.parent.kind === 215)) { return; } } - error(node, ts.Diagnostics._0_is_declared_but_never_used, name); + if (!isRemovedPropertyFromObjectSpread(node.kind === 70 ? node.parent : node)) { + error(node, ts.Diagnostics._0_is_declared_but_never_used, name); + } } function parameterNameStartsWithUnderscore(parameterName) { return parameterName && isIdentifierThatStartsWithUnderScore(parameterName); @@ -33807,12 +36411,12 @@ var ts; if (node.members) { for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 149 || member.kind === 147) { + if (member.kind === 150 || member.kind === 148) { if (!member.symbol.isReferenced && ts.getModifierFlags(member) & 8) { error(member.name, ts.Diagnostics._0_is_declared_but_never_used, member.symbol.name); } } - else if (member.kind === 150) { + else if (member.kind === 151) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.getModifierFlags(parameter) & 8) { @@ -33843,21 +36447,20 @@ var ts; } function checkUnusedModuleMembers(node) { if (compilerOptions.noUnusedLocals && !ts.isInAmbientContext(node)) { - for (var key in node.locals) { - var local = node.locals[key]; + node.locals.forEach(function (local) { if (!local.isReferenced && !local.exportSymbol) { for (var _i = 0, _a = local.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; if (!ts.isAmbientModule(declaration)) { - error(declaration.name, ts.Diagnostics._0_is_declared_but_never_used, local.name); + errorUnusedLocal(declaration.name, local.name); } } } - } + }); } } function checkBlock(node) { - if (node.kind === 204) { + if (node.kind === 206) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); @@ -33879,19 +36482,19 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 147 || - node.kind === 146 || + if (node.kind === 148 || + node.kind === 147 || + node.kind === 150 || node.kind === 149 || - node.kind === 148 || - node.kind === 151 || - node.kind === 152) { + node.kind === 152 || + node.kind === 153) { return false; } if (ts.isInAmbientContext(node)) { return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 144 && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 145 && ts.nodeIsMissing(root.parent.body)) { return false; } return true; @@ -33901,9 +36504,13 @@ var ts; potentialThisCollisions.push(node); } } + function checkCollisionWithCapturedNewTargetVariable(node, name) { + if (needCollisionCheckForIdentifier(node, name, "_newTarget")) { + potentialNewTargetCollisions.push(node); + } + } function checkIfThisIsCapturedInEnclosingScope(node) { - var current = node; - while (current) { + ts.findAncestor(node, function (current) { if (getNodeCheckFlags(current) & 4) { var isDeclaration_1 = node.kind !== 70; if (isDeclaration_1) { @@ -33912,10 +36519,23 @@ var ts; else { error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference); } - return; + return true; } - current = current.parent; - } + }); + } + function checkIfNewTargetIsCapturedInEnclosingScope(node) { + ts.findAncestor(node, function (current) { + if (getNodeCheckFlags(current) & 8) { + var isDeclaration_2 = node.kind !== 70; + if (isDeclaration_2) { + error(node.name, ts.Diagnostics.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference); + } + else { + error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference); + } + return true; + } + }); } function checkCollisionWithCapturedSuperVariable(node, name) { if (!needCollisionCheckForIdentifier(node, name, "_super")) { @@ -33926,8 +36546,8 @@ var ts; return; } if (ts.getClassExtendsHeritageClauseElement(enclosingClass)) { - var isDeclaration_2 = node.kind !== 70; - if (isDeclaration_2) { + var isDeclaration_3 = node.kind !== 70; + if (isDeclaration_3) { error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); } else { @@ -33942,23 +36562,23 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } - if (node.kind === 230 && ts.getModuleInstanceState(node) !== 1) { + if (node.kind === 232 && ts.getModuleInstanceState(node) !== 1) { return; } var parent = getDeclarationContainer(node); - if (parent.kind === 261 && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 264 && ts.isExternalOrCommonJsModule(parent)) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } function checkCollisionWithGlobalPromiseInGeneratedCode(node, name) { - if (!needCollisionCheckForIdentifier(node, name, "Promise")) { + if (languageVersion >= 4 || !needCollisionCheckForIdentifier(node, name, "Promise")) { return; } - if (node.kind === 230 && ts.getModuleInstanceState(node) !== 1) { + if (node.kind === 232 && ts.getModuleInstanceState(node) !== 1) { return; } var parent = getDeclarationContainer(node); - if (parent.kind === 261 && ts.isExternalOrCommonJsModule(parent) && parent.flags & 8192) { + if (parent.kind === 264 && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -33966,7 +36586,7 @@ var ts; if ((ts.getCombinedNodeFlags(node) & 3) !== 0 || ts.isParameterDeclaration(node)) { return; } - if (node.kind === 223 && !node.initializer) { + if (node.kind === 225 && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -33976,25 +36596,25 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 224); - var container = varDeclList.parent.kind === 205 && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 226); + var container = varDeclList.parent.kind === 207 && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; var namesShareScope = container && - (container.kind === 204 && ts.isFunctionLike(container.parent) || - container.kind === 231 || - container.kind === 230 || - container.kind === 261); + (container.kind === 206 && ts.isFunctionLike(container.parent) || + container.kind === 233 || + container.kind === 232 || + container.kind === 264); if (!namesShareScope) { - var name_25 = symbolToString(localDeclarationSymbol); - error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_25, name_25); + var name = symbolToString(localDeclarationSymbol); + error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name); } } } } } function checkParameterInitializer(node) { - if (ts.getRootDeclaration(node).kind !== 144) { + if (ts.getRootDeclaration(node).kind !== 145) { return; } var func = ts.getContainingFunction(node); @@ -34003,7 +36623,7 @@ var ts; if (ts.isTypeNode(n) || ts.isDeclarationName(n)) { return; } - if (n.kind === 177) { + if (n.kind === 178) { return visit(n.expression); } else if (n.kind === 70) { @@ -34017,21 +36637,21 @@ var ts; } var enclosingContainer = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); if (enclosingContainer === func) { - if (symbol.valueDeclaration.kind === 144) { + if (symbol.valueDeclaration.kind === 145 || + symbol.valueDeclaration.kind === 175) { if (symbol.valueDeclaration.pos < node.pos) { return; } - var current = n; - while (current !== node.initializer) { - if (ts.isFunctionLike(current.parent)) { - return; + if (ts.findAncestor(n, function (current) { + if (current === node.initializer) { + return "quit"; } - if (current.parent.kind === 147 && - !(ts.hasModifier(current.parent, 32)) && - ts.isClassLike(current.parent.parent)) { - return; - } - current = current.parent; + return ts.isFunctionLike(current.parent) || + (current.parent.kind === 148 && + !(ts.hasModifier(current.parent, 32)) && + ts.isClassLike(current.parent.parent)); + })) { + return; } } error(n, ts.Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, ts.declarationNameToString(node.name), ts.declarationNameToString(n)); @@ -34048,34 +36668,40 @@ var ts; function checkVariableLikeDeclaration(node) { checkDecorators(node); checkSourceElement(node.type); - if (node.name.kind === 142) { + if (node.name.kind === 143) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 174) { - if (node.propertyName && node.propertyName.kind === 142) { + if (node.kind === 175) { + if (node.parent.kind === 173 && languageVersion < 5) { + checkExternalEmitHelpers(node, 4); + } + if (node.propertyName && node.propertyName.kind === 143) { checkComputedPropertyName(node.propertyName); } - var parent_10 = node.parent.parent; - var parentType = getTypeForBindingElementParent(parent_10); - var name_26 = node.propertyName || node.name; - var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name_26)); + var parent = node.parent.parent; + var parentType = getTypeForBindingElementParent(parent); + var name = node.propertyName || node.name; + var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name)); markPropertyAsReferenced(property); - if (parent_10.initializer && property && getParentOfSymbol(property)) { - checkClassPropertyAccess(parent_10, parent_10.initializer, parentType, property); + if (parent.initializer && property) { + checkPropertyAccessibility(parent, parent.initializer, parentType, property); } } if (ts.isBindingPattern(node.name)) { + if (node.name.kind === 174 && languageVersion < 2 && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 512); + } ts.forEach(node.name.elements, checkSourceElement); } - if (node.initializer && ts.getRootDeclaration(node).kind === 144 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 145 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } if (ts.isBindingPattern(node.name)) { - if (node.initializer && node.parent.parent.kind !== 212) { + if (node.initializer && node.parent.parent.kind !== 214) { checkTypeAssignableTo(checkExpressionCached(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, undefined); checkParameterInitializer(node); } @@ -34084,7 +36710,7 @@ var ts; var symbol = getSymbolOfNode(node); var type = convertAutoToAny(getTypeOfVariableOrParameterOrProperty(symbol)); if (node === symbol.valueDeclaration) { - if (node.initializer && node.parent.parent.kind !== 212) { + if (node.initializer && node.parent.parent.kind !== 214) { checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, undefined); checkParameterInitializer(node); } @@ -34102,20 +36728,21 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 147 && node.kind !== 146) { + if (node.kind !== 148 && node.kind !== 147) { checkExportsOnMergedDeclarations(node); - if (node.kind === 223 || node.kind === 174) { + if (node.kind === 225 || node.kind === 175) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 144 && right.kind === 223) || - (left.kind === 223 && right.kind === 144)) { + if ((left.kind === 145 && right.kind === 225) || + (left.kind === 225 && right.kind === 145)) { return true; } if (ts.hasQuestionToken(left) !== ts.hasQuestionToken(right)) { @@ -34142,8 +36769,8 @@ var ts; ts.forEach(node.declarationList.declarations, checkSourceElement); } function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) { - if (node.modifiers && node.parent.kind === 176) { - if (ts.isAsyncFunctionLike(node)) { + if (node.modifiers && node.parent.kind === 177) { + if (ts.getFunctionFlags(node) & 2) { if (node.modifiers.length > 1) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } @@ -34161,7 +36788,7 @@ var ts; checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 206) { + if (node.thenStatement.kind === 208) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -34178,12 +36805,12 @@ var ts; } function checkForStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 224) { + if (node.initializer && node.initializer.kind === 226) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 224) { + if (node.initializer.kind === 226) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -34201,13 +36828,23 @@ var ts; } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 224) { + if (node.kind === 215) { + if (node.awaitModifier) { + if (languageVersion < 4) { + checkExternalEmitHelpers(node, 8192); + } + } + else if (languageVersion < 2 && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 256); + } + } + if (node.initializer.kind === 226) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; - var iteratedType = checkRightHandSideOfForOf(node.expression); - if (varExpr.kind === 175 || varExpr.kind === 176) { + var iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier); + if (varExpr.kind === 176 || varExpr.kind === 177) { checkDestructuringAssignment(varExpr, iteratedType || unknownType); } else { @@ -34226,7 +36863,7 @@ var ts; function checkForInStatement(node) { checkGrammarForInOrForOfStatement(node); var rightType = checkNonNullExpression(node.expression); - if (node.initializer.kind === 224) { + if (node.initializer.kind === 226) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -34236,7 +36873,7 @@ var ts; else { var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 175 || varExpr.kind === 176) { + if (varExpr.kind === 176 || varExpr.kind === 177) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -34246,7 +36883,7 @@ var ts; checkReferenceExpression(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access); } } - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 | 16384 | 524288)) { + if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 | 540672 | 16777216)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } checkSourceElement(node.statement); @@ -34261,146 +36898,67 @@ var ts; checkVariableDeclaration(decl); } } - function checkRightHandSideOfForOf(rhsExpression) { + function checkRightHandSideOfForOf(rhsExpression, awaitModifier) { var expressionType = checkNonNullExpression(rhsExpression); - return checkIteratedTypeOrElementType(expressionType, rhsExpression, true); + return checkIteratedTypeOrElementType(expressionType, rhsExpression, true, awaitModifier !== undefined); } - function checkIteratedTypeOrElementType(inputType, errorNode, allowStringInput) { + function checkIteratedTypeOrElementType(inputType, errorNode, allowStringInput, allowAsyncIterable) { if (isTypeAny(inputType)) { return inputType; } - if (languageVersion >= 2) { - return checkElementTypeOfIterable(inputType, errorNode); - } - if (allowStringInput) { - return checkElementTypeOfArrayOrString(inputType, errorNode); - } - if (isArrayLikeType(inputType)) { - var indexType = getIndexTypeOfType(inputType, 1); - if (indexType) { - return indexType; - } - } - if (errorNode) { - error(errorNode, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(inputType)); - } - return unknownType; + return getIteratedTypeOrElementType(inputType, errorNode, allowStringInput, allowAsyncIterable, true) || anyType; } - function checkElementTypeOfIterable(iterable, errorNode) { - var elementType = getElementTypeOfIterable(iterable, errorNode); - if (errorNode && elementType) { - checkTypeAssignableTo(iterable, createIterableType(elementType), errorNode); - } - return elementType || anyType; - } - function getElementTypeOfIterable(type, errorNode) { - if (isTypeAny(type)) { - return undefined; - } - var typeAsIterable = type; - if (!typeAsIterable.iterableElementType) { - if ((getObjectFlags(type) & 4) && type.target === getGlobalIterableType()) { - typeAsIterable.iterableElementType = type.typeArguments[0]; - } - else { - var iteratorFunction = getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("iterator")); - if (isTypeAny(iteratorFunction)) { - return undefined; - } - var iteratorFunctionSignatures = iteratorFunction ? getSignaturesOfType(iteratorFunction, 0) : emptyArray; - if (iteratorFunctionSignatures.length === 0) { - if (errorNode) { - error(errorNode, ts.Diagnostics.Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator); - } - return undefined; - } - typeAsIterable.iterableElementType = getElementTypeOfIterator(getUnionType(ts.map(iteratorFunctionSignatures, getReturnTypeOfSignature), true), errorNode); + function getIteratedTypeOrElementType(inputType, errorNode, allowStringInput, allowAsyncIterable, checkAssignability) { + var uplevelIteration = languageVersion >= 2; + var downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration; + if (uplevelIteration || downlevelIteration || allowAsyncIterable) { + var iteratedType = getIteratedTypeOfIterable(inputType, uplevelIteration ? errorNode : undefined, allowAsyncIterable, allowAsyncIterable, checkAssignability); + if (iteratedType || uplevelIteration) { + return iteratedType; } } - return typeAsIterable.iterableElementType; - } - function getElementTypeOfIterator(type, errorNode) { - if (isTypeAny(type)) { - return undefined; - } - var typeAsIterator = type; - if (!typeAsIterator.iteratorElementType) { - if ((getObjectFlags(type) & 4) && type.target === getGlobalIteratorType()) { - typeAsIterator.iteratorElementType = type.typeArguments[0]; - } - else { - var iteratorNextFunction = getTypeOfPropertyOfType(type, "next"); - if (isTypeAny(iteratorNextFunction)) { - return undefined; - } - var iteratorNextFunctionSignatures = iteratorNextFunction ? getSignaturesOfType(iteratorNextFunction, 0) : emptyArray; - if (iteratorNextFunctionSignatures.length === 0) { - if (errorNode) { - error(errorNode, ts.Diagnostics.An_iterator_must_have_a_next_method); - } - return undefined; - } - var iteratorNextResult = getUnionType(ts.map(iteratorNextFunctionSignatures, getReturnTypeOfSignature), true); - if (isTypeAny(iteratorNextResult)) { - return undefined; - } - var iteratorNextValue = getTypeOfPropertyOfType(iteratorNextResult, "value"); - if (!iteratorNextValue) { - if (errorNode) { - error(errorNode, ts.Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); - } - return undefined; - } - typeAsIterator.iteratorElementType = iteratorNextValue; - } - } - return typeAsIterator.iteratorElementType; - } - function getElementTypeOfIterableIterator(type) { - if (isTypeAny(type)) { - return undefined; - } - if ((getObjectFlags(type) & 4) && type.target === getGlobalIterableIteratorType()) { - return type.typeArguments[0]; - } - return getElementTypeOfIterable(type, undefined) || - getElementTypeOfIterator(type, undefined); - } - function checkElementTypeOfArrayOrString(arrayOrStringType, errorNode) { - ts.Debug.assert(languageVersion < 2); - var arrayType = arrayOrStringType; - if (arrayOrStringType.flags & 65536) { - var arrayTypes = arrayOrStringType.types; - var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 262178); }); - if (filteredTypes !== arrayTypes) { - arrayType = getUnionType(filteredTypes, true); - } - } - else if (arrayOrStringType.flags & 262178) { - arrayType = neverType; - } - var hasStringConstituent = arrayOrStringType !== arrayType; + var arrayType = inputType; var reportedError = false; - if (hasStringConstituent) { - if (languageVersion < 1) { - error(errorNode, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); - reportedError = true; + var hasStringConstituent = false; + if (allowStringInput) { + if (arrayType.flags & 65536) { + var arrayTypes = inputType.types; + var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 262178); }); + if (filteredTypes !== arrayTypes) { + arrayType = getUnionType(filteredTypes, true); + } } - if (arrayType.flags & 8192) { - return stringType; + else if (arrayType.flags & 262178) { + arrayType = neverType; + } + hasStringConstituent = arrayType !== inputType; + if (hasStringConstituent) { + if (languageVersion < 1) { + if (errorNode) { + error(errorNode, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); + reportedError = true; + } + } + if (arrayType.flags & 8192) { + return stringType; + } } } if (!isArrayLikeType(arrayType)) { - if (!reportedError) { - var diagnostic = hasStringConstituent - ? ts.Diagnostics.Type_0_is_not_an_array_type - : ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type; + if (errorNode && !reportedError) { + var diagnostic = !allowStringInput || hasStringConstituent + ? downlevelIteration + ? ts.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator + : ts.Diagnostics.Type_0_is_not_an_array_type + : downlevelIteration + ? ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator + : ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type; error(errorNode, diagnostic, typeToString(arrayType)); } - return hasStringConstituent ? stringType : unknownType; + return hasStringConstituent ? stringType : undefined; } - var arrayElementType = getIndexTypeOfType(arrayType, 1) || unknownType; - if (hasStringConstituent) { + var arrayElementType = getIndexTypeOfType(arrayType, 1); + if (hasStringConstituent && arrayElementType) { if (arrayElementType.flags & 262178) { return stringType; } @@ -34408,14 +36966,131 @@ var ts; } return arrayElementType; } + function getIteratedTypeOfIterable(type, errorNode, isAsyncIterable, allowNonAsyncIterables, checkAssignability) { + if (isTypeAny(type)) { + return undefined; + } + var typeAsIterable = type; + if (isAsyncIterable ? typeAsIterable.iteratedTypeOfAsyncIterable : typeAsIterable.iteratedTypeOfIterable) { + return isAsyncIterable ? typeAsIterable.iteratedTypeOfAsyncIterable : typeAsIterable.iteratedTypeOfIterable; + } + if (isAsyncIterable) { + if (isReferenceToType(type, getGlobalAsyncIterableType(false)) || + isReferenceToType(type, getGlobalAsyncIterableIteratorType(false))) { + return typeAsIterable.iteratedTypeOfAsyncIterable = type.typeArguments[0]; + } + } + if (!isAsyncIterable || allowNonAsyncIterables) { + if (isReferenceToType(type, getGlobalIterableType(false)) || + isReferenceToType(type, getGlobalIterableIteratorType(false))) { + return isAsyncIterable + ? typeAsIterable.iteratedTypeOfAsyncIterable = type.typeArguments[0] + : typeAsIterable.iteratedTypeOfIterable = type.typeArguments[0]; + } + } + var iteratorMethodSignatures; + var mayBeIterable = false; + if (isAsyncIterable) { + var iteratorMethod = getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("asyncIterator")); + if (isTypeAny(iteratorMethod)) { + return undefined; + } + iteratorMethodSignatures = iteratorMethod && getSignaturesOfType(iteratorMethod, 0); + } + if (!isAsyncIterable || (allowNonAsyncIterables && !ts.some(iteratorMethodSignatures))) { + var iteratorMethod = getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("iterator")); + if (isTypeAny(iteratorMethod)) { + return undefined; + } + iteratorMethodSignatures = iteratorMethod && getSignaturesOfType(iteratorMethod, 0); + mayBeIterable = true; + } + if (ts.some(iteratorMethodSignatures)) { + var iteratorMethodReturnType = getUnionType(ts.map(iteratorMethodSignatures, getReturnTypeOfSignature), true); + var iteratedType = getIteratedTypeOfIterator(iteratorMethodReturnType, errorNode, false); + if (checkAssignability && errorNode && iteratedType) { + checkTypeAssignableTo(type, mayBeIterable + ? createIterableType(iteratedType) + : createAsyncIterableType(iteratedType), errorNode); + } + return isAsyncIterable + ? typeAsIterable.iteratedTypeOfAsyncIterable = iteratedType + : typeAsIterable.iteratedTypeOfIterable = iteratedType; + } + if (errorNode) { + error(errorNode, isAsyncIterable + ? ts.Diagnostics.Type_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator + : ts.Diagnostics.Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator); + } + return undefined; + } + function getIteratedTypeOfIterator(type, errorNode, isAsyncIterator) { + if (isTypeAny(type)) { + return undefined; + } + var typeAsIterator = type; + if (isAsyncIterator ? typeAsIterator.iteratedTypeOfAsyncIterator : typeAsIterator.iteratedTypeOfIterator) { + return isAsyncIterator ? typeAsIterator.iteratedTypeOfAsyncIterator : typeAsIterator.iteratedTypeOfIterator; + } + var getIteratorType = isAsyncIterator ? getGlobalAsyncIteratorType : getGlobalIteratorType; + if (isReferenceToType(type, getIteratorType(false))) { + return isAsyncIterator + ? typeAsIterator.iteratedTypeOfAsyncIterator = type.typeArguments[0] + : typeAsIterator.iteratedTypeOfIterator = type.typeArguments[0]; + } + var nextMethod = getTypeOfPropertyOfType(type, "next"); + if (isTypeAny(nextMethod)) { + return undefined; + } + var nextMethodSignatures = nextMethod ? getSignaturesOfType(nextMethod, 0) : emptyArray; + if (nextMethodSignatures.length === 0) { + if (errorNode) { + error(errorNode, isAsyncIterator + ? ts.Diagnostics.An_async_iterator_must_have_a_next_method + : ts.Diagnostics.An_iterator_must_have_a_next_method); + } + return undefined; + } + var nextResult = getUnionType(ts.map(nextMethodSignatures, getReturnTypeOfSignature), true); + if (isTypeAny(nextResult)) { + return undefined; + } + if (isAsyncIterator) { + nextResult = getAwaitedTypeOfPromise(nextResult, errorNode, ts.Diagnostics.The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property); + if (isTypeAny(nextResult)) { + return undefined; + } + } + var nextValue = nextResult && getTypeOfPropertyOfType(nextResult, "value"); + if (!nextValue) { + if (errorNode) { + error(errorNode, isAsyncIterator + ? ts.Diagnostics.The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property + : ts.Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); + } + return undefined; + } + return isAsyncIterator + ? typeAsIterator.iteratedTypeOfAsyncIterator = nextValue + : typeAsIterator.iteratedTypeOfIterator = nextValue; + } + function getIteratedTypeOfGenerator(returnType, isAsyncGenerator) { + if (isTypeAny(returnType)) { + return undefined; + } + return getIteratedTypeOfIterable(returnType, undefined, isAsyncGenerator, false, false) + || getIteratedTypeOfIterator(returnType, undefined, isAsyncGenerator); + } function checkBreakOrContinueStatement(node) { checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node); } function isGetAccessorWithAnnotatedSetAccessor(node) { - return !!(node.kind === 151 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 152))); + return !!(node.kind === 152 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 153))); } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { - var unwrappedReturnType = ts.isAsyncFunctionLike(func) ? getPromisedType(returnType) : returnType; + var unwrappedReturnType = (ts.getFunctionFlags(func) & 3) === 2 + ? getPromisedTypeOfPromise(returnType) + : returnType; return unwrappedReturnType && maybeTypeOfKind(unwrappedReturnType, 1024 | 1); } function checkReturnStatement(node) { @@ -34431,40 +37106,41 @@ var ts; var returnType = getReturnTypeOfSignature(signature); if (strictNullChecks || node.expression || returnType.flags & 8192) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.asteriskToken) { + var functionFlags = ts.getFunctionFlags(func); + if (functionFlags & 1) { return; } - if (func.kind === 152) { + if (func.kind === 153) { if (node.expression) { - error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); + error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 150) { - if (node.expression && !checkTypeAssignableTo(exprType, returnType, node.expression)) { - error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); + else if (func.kind === 151) { + if (node.expression && !checkTypeAssignableTo(exprType, returnType, node)) { + error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } } else if (func.type || isGetAccessorWithAnnotatedSetAccessor(func)) { - if (ts.isAsyncFunctionLike(func)) { - var promisedType = getPromisedType(returnType); - var awaitedType = checkAwaitedType(exprType, node.expression || node, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); + if (functionFlags & 2) { + var promisedType = getPromisedTypeOfPromise(returnType); + var awaitedType = checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); if (promisedType) { - checkTypeAssignableTo(awaitedType, promisedType, node.expression || node); + checkTypeAssignableTo(awaitedType, promisedType, node); } } else { - checkTypeAssignableTo(exprType, returnType, node.expression || node); + checkTypeAssignableTo(exprType, returnType, node); } } } - else if (func.kind !== 150 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 151 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } } } function checkWithStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.flags & 524288) { + if (node.flags & 16384) { grammarErrorOnFirstToken(node, ts.Diagnostics.with_statements_are_not_allowed_in_an_async_function_block); } } @@ -34483,7 +37159,7 @@ var ts; var expressionType = checkExpression(node.expression); var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { - if (clause.kind === 254 && !hasDuplicateDefaultClause) { + if (clause.kind === 257 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -34495,7 +37171,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 253) { + if (produceDiagnostics && clause.kind === 256) { var caseClause = clause; var caseType = checkExpression(caseClause.expression); var caseIsLiteral = isLiteralType(caseType); @@ -34516,18 +37192,16 @@ var ts; } function checkLabeledStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - var current = node.parent; - while (current) { + ts.findAncestor(node.parent, function (current) { if (ts.isFunctionLike(current)) { - break; + return "quit"; } - if (current.kind === 219 && current.label.text === node.label.text) { + if (current.kind === 221 && current.label.text === node.label.text) { var sourceFile = ts.getSourceFileOfNode(node); grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); - break; + return true; } - current = current.parent; - } + }); } checkSourceElement(node.statement); } @@ -34554,14 +37228,14 @@ var ts; grammarErrorOnFirstToken(catchClause.variableDeclaration.initializer, ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer); } else { - var blockLocals = catchClause.block.locals; - if (blockLocals) { - for (var caughtName in catchClause.locals) { - var blockLocal = blockLocals[caughtName]; + var blockLocals_1 = catchClause.block.locals; + if (blockLocals_1) { + ts.forEachKey(catchClause.locals, function (caughtName) { + var blockLocal = blockLocals_1.get(caughtName); if (blockLocal && (blockLocal.flags & 2) !== 0) { grammarErrorOnNode(blockLocal.valueDeclaration, ts.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause, caughtName); } - } + }); } } } @@ -34609,12 +37283,13 @@ var ts; if (!indexType) { return; } - if (indexKind === 1 && !isNumericName(prop.valueDeclaration.name)) { + var propDeclaration = prop.valueDeclaration; + if (indexKind === 1 && !(propDeclaration ? isNumericName(propDeclaration.name) : isNumericLiteralName(prop.name))) { return; } var errorNode; - if (prop.valueDeclaration.name.kind === 142 || prop.parent === containingType.symbol) { - errorNode = prop.valueDeclaration; + if (propDeclaration && (propDeclaration.name.kind === 143 || prop.parent === containingType.symbol)) { + errorNode = propDeclaration; } else if (indexDeclaration) { errorNode = indexDeclaration; @@ -34639,15 +37314,23 @@ var ts; case "string": case "symbol": case "void": + case "object": error(name, message, name.text); } } function checkTypeParameters(typeParameterDeclarations) { if (typeParameterDeclarations) { - for (var i = 0, n = typeParameterDeclarations.length; i < n; i++) { + var seenDefault = false; + for (var i = 0; i < typeParameterDeclarations.length; i++) { var node = typeParameterDeclarations[i]; checkTypeParameter(node); if (produceDiagnostics) { + if (node.default) { + seenDefault = true; + } + else if (seenDefault) { + error(node, ts.Diagnostics.Required_type_parameters_may_not_follow_optional_type_parameters); + } for (var j = 0; j < i; j++) { if (typeParameterDeclarations[j].symbol === node.symbol) { error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.declarationNameToString(node.name)); @@ -34657,23 +37340,57 @@ var ts; } } } - function checkTypeParameterListsIdentical(node, symbol) { + function checkTypeParameterListsIdentical(symbol) { if (symbol.declarations.length === 1) { return; } - var firstDecl; - for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { - var declaration = _a[_i]; - if (declaration.kind === 226 || declaration.kind === 227) { - if (!firstDecl) { - firstDecl = declaration; - } - else if (!areTypeParametersIdentical(firstDecl.typeParameters, node.typeParameters)) { - error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, node.name.text); + var links = getSymbolLinks(symbol); + if (!links.typeParametersChecked) { + links.typeParametersChecked = true; + var declarations = getClassOrInterfaceDeclarationsOfSymbol(symbol); + if (declarations.length <= 1) { + return; + } + var type = getDeclaredTypeOfSymbol(symbol); + if (!areTypeParametersIdentical(declarations, type.localTypeParameters)) { + var name = symbolToString(symbol); + for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { + var declaration = declarations_6[_i]; + error(declaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name); } } } } + function areTypeParametersIdentical(declarations, typeParameters) { + var maxTypeArgumentCount = ts.length(typeParameters); + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { + var declaration = declarations_7[_i]; + var numTypeParameters = ts.length(declaration.typeParameters); + if (numTypeParameters < minTypeArgumentCount || numTypeParameters > maxTypeArgumentCount) { + return false; + } + for (var i = 0; i < numTypeParameters; i++) { + var source = declaration.typeParameters[i]; + var target = typeParameters[i]; + if (source.name.text !== target.symbol.name) { + return false; + } + var sourceConstraint = source.constraint && getTypeFromTypeNode(source.constraint); + var targetConstraint = getConstraintFromTypeParameter(target); + if ((sourceConstraint || targetConstraint) && + (!sourceConstraint || !targetConstraint || !isTypeIdenticalTo(sourceConstraint, targetConstraint))) { + return false; + } + var sourceDefault = source.default && getTypeFromTypeNode(source.default); + var targetDefault = getDefaultFromTypeParameter(target); + if (sourceDefault && targetDefault && !isTypeIdenticalTo(sourceDefault, targetDefault)) { + return false; + } + } + } + return true; + } function checkClassExpression(node) { checkClassLikeDeclaration(node); checkNodeDeferred(node); @@ -34692,11 +37409,12 @@ var ts; registerForUnusedIdentifiersCheck(node); } function checkClassLikeDeclaration(node) { - checkGrammarClassDeclarationHeritageClauses(node); + checkGrammarClassLikeDeclaration(node); checkDecorators(node); if (node.name) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Class_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); } @@ -34706,19 +37424,26 @@ var ts; var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); var staticType = getTypeOfSymbol(symbol); - checkTypeParameterListsIdentical(node, symbol); + checkTypeParameterListsIdentical(symbol); checkClassForDuplicateDeclarations(node); + if (!ts.isInAmbientContext(node)) { + checkClassForStaticPropertyNameConflicts(node); + } var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { + if (languageVersion < 2) { + checkExternalEmitHelpers(baseTypeNode.parent, 1); + } var baseTypes = getBaseTypes(type); if (baseTypes.length && produceDiagnostics) { var baseType_1 = baseTypes[0]; - var staticBaseType = getBaseConstructorTypeOfClass(type); + var baseConstructorType = getBaseConstructorTypeOfClass(type); + var staticBaseType = getApparentType(baseConstructorType); checkBaseTypeAccessibility(staticBaseType, baseTypeNode); checkSourceElement(baseTypeNode.expression); if (baseTypeNode.typeArguments) { ts.forEach(baseTypeNode.typeArguments, checkSourceElement); - for (var _i = 0, _a = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments); _i < _a.length; _i++) { + for (var _i = 0, _a = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); _i < _a.length; _i++) { var constructor = _a[_i]; if (!checkTypeArgumentConstraints(constructor.typeParameters, baseTypeNode.typeArguments)) { break; @@ -34727,15 +37452,11 @@ var ts; } checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(baseType_1, type.thisType), node.name || node, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); checkTypeAssignableTo(staticType, getTypeWithoutSignatures(staticBaseType), node.name || node, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); - if (baseType_1.symbol.valueDeclaration && - !ts.isInAmbientContext(baseType_1.symbol.valueDeclaration) && - baseType_1.symbol.valueDeclaration.kind === 226) { - if (!isBlockScopedNameDeclaredBeforeUse(baseType_1.symbol.valueDeclaration, node)) { - error(baseTypeNode, ts.Diagnostics.A_class_must_be_declared_after_its_base_class); - } + if (baseConstructorType.flags & 540672 && !isMixinConstructorType(staticType)) { + error(node.name || node, ts.Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any); } - if (!(staticBaseType.symbol && staticBaseType.symbol.flags & 32)) { - var constructors = getInstantiatedConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments); + if (!(staticBaseType.symbol && staticBaseType.symbol.flags & 32) && !(baseConstructorType.flags & 540672)) { + var constructors = getInstantiatedConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); if (ts.forEach(constructors, function (sig) { return getReturnTypeOfSignature(sig) !== baseType_1; })) { error(baseTypeNode.expression, ts.Diagnostics.Base_constructors_must_all_have_the_same_return_type); } @@ -34754,8 +37475,7 @@ var ts; if (produceDiagnostics) { var t = getTypeFromTypeNode(typeRefNode); if (t !== unknownType) { - var declaredType = getObjectFlags(t) & 4 ? t.target : t; - if (getObjectFlags(declaredType) & 3) { + if (isValidBaseType(t)) { checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(t, type.thisType), node.name || node, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); } else { @@ -34783,17 +37503,22 @@ var ts; } } function getTargetSymbol(s) { - return s.flags & 16777216 ? getSymbolLinks(s).target : s; + return getCheckFlags(s) & 1 ? s.target : s; } function getClassLikeDeclarationOfSymbol(symbol) { return ts.forEach(symbol.declarations, function (d) { return ts.isClassLike(d) ? d : undefined; }); } + function getClassOrInterfaceDeclarationsOfSymbol(symbol) { + return ts.filter(symbol.declarations, function (d) { + return d.kind === 228 || d.kind === 229; + }); + } function checkKindsOfPropertyMemberOverrides(type, baseType) { - var baseProperties = getPropertiesOfObjectType(baseType); + var baseProperties = getPropertiesOfType(baseType); for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) { var baseProperty = baseProperties_1[_i]; var base = getTargetSymbol(baseProperty); - if (base.flags & 134217728) { + if (base.flags & 16777216) { continue; } var derived = getTargetSymbol(getPropertyOfObjectType(type, base.name)); @@ -34803,7 +37528,7 @@ var ts; if (derived === base) { var derivedClassDecl = getClassLikeDeclarationOfSymbol(type.symbol); if (baseDeclarationFlags & 128 && (!derivedClassDecl || !(ts.getModifierFlags(derivedClassDecl) & 128))) { - if (derivedClassDecl.kind === 197) { + if (derivedClassDecl.kind === 198) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -34813,66 +37538,37 @@ var ts; } else { var derivedDeclarationFlags = getDeclarationModifierFlagsFromSymbol(derived); - if ((baseDeclarationFlags & 8) || (derivedDeclarationFlags & 8)) { + if (baseDeclarationFlags & 8 || derivedDeclarationFlags & 8) { continue; } if ((baseDeclarationFlags & 32) !== (derivedDeclarationFlags & 32)) { continue; } - if ((base.flags & derived.flags & 8192) || ((base.flags & 98308) && (derived.flags & 98308))) { + if (isMethodLike(base) && isMethodLike(derived) || base.flags & 98308 && derived.flags & 98308) { continue; } var errorMessage = void 0; - if (base.flags & 8192) { + if (isMethodLike(base)) { if (derived.flags & 98304) { errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; } else { - ts.Debug.assert((derived.flags & 4) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; } } else if (base.flags & 4) { - ts.Debug.assert((derived.flags & 8192) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; } else { - ts.Debug.assert((base.flags & 98304) !== 0); - ts.Debug.assert((derived.flags & 8192) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; } - error(derived.valueDeclaration.name, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); + error(derived.valueDeclaration.name || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); } } } } function isAccessor(kind) { - return kind === 151 || kind === 152; - } - function areTypeParametersIdentical(list1, list2) { - if (!list1 && !list2) { - return true; - } - if (!list1 || !list2 || list1.length !== list2.length) { - return false; - } - for (var i = 0, len = list1.length; i < len; i++) { - var tp1 = list1[i]; - var tp2 = list2[i]; - if (tp1.name.text !== tp2.name.text) { - return false; - } - if (!tp1.constraint && !tp2.constraint) { - continue; - } - if (!tp1.constraint || !tp2.constraint) { - return false; - } - if (!isTypeIdenticalTo(getTypeFromTypeNode(tp1.constraint), getTypeFromTypeNode(tp2.constraint))) { - return false; - } - } - return true; + return kind === 152 || kind === 153; } function checkInheritedPropertiesAreIdentical(type, typeNode) { var baseTypes = getBaseTypes(type); @@ -34880,16 +37576,16 @@ var ts; return true; } var seen = ts.createMap(); - ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; }); + ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen.set(p.name, { prop: p, containingType: type }); }); var ok = true; for (var _i = 0, baseTypes_2 = baseTypes; _i < baseTypes_2.length; _i++) { var base = baseTypes_2[_i]; - var properties = getPropertiesOfObjectType(getTypeWithThisArgument(base, type.thisType)); - for (var _a = 0, properties_6 = properties; _a < properties_6.length; _a++) { - var prop = properties_6[_a]; - var existing = seen[prop.name]; + var properties = getPropertiesOfType(getTypeWithThisArgument(base, type.thisType)); + for (var _a = 0, properties_8 = properties; _a < properties_8.length; _a++) { + var prop = properties_8[_a]; + var existing = seen.get(prop.name); if (!existing) { - seen[prop.name] = { prop: prop, containingType: base }; + seen.set(prop.name, { prop: prop, containingType: base }); } else { var isInheritedProperty = existing.containingType !== type; @@ -34913,8 +37609,8 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - checkTypeParameterListsIdentical(node, symbol); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 227); + checkTypeParameterListsIdentical(symbol); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 229); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -35010,7 +37706,7 @@ var ts; return value; function evalConstant(e) { switch (e.kind) { - case 190: + case 191: var value_1 = evalConstant(e.operand); if (value_1 === undefined) { return undefined; @@ -35021,7 +37717,7 @@ var ts; case 51: return ~value_1; } return undefined; - case 192: + case 193: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -35045,12 +37741,13 @@ var ts; } return undefined; case 8: + checkGrammarNumericLiteral(e); return +e.text; - case 183: + case 184: return evalConstant(e.expression); case 70: + case 179: case 178: - case 177: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); var enumType_1; @@ -35061,7 +37758,7 @@ var ts; } else { var expression = void 0; - if (e.kind === 178) { + if (e.kind === 179) { if (e.argumentExpression === undefined || e.argumentExpression.kind !== 9) { return undefined; @@ -35078,7 +37775,7 @@ var ts; if (current.kind === 70) { break; } - else if (current.kind === 177) { + else if (current.kind === 178) { current = current.expression; } else { @@ -35118,6 +37815,7 @@ var ts; checkGrammarDecorators(node) || checkGrammarModifiers(node); checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); @@ -35138,7 +37836,7 @@ var ts; } var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 229) { + if (declaration.kind !== 231) { return false; } var enumDeclaration = declaration; @@ -35159,10 +37857,10 @@ var ts; } function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { - var declaration = declarations_5[_i]; - if ((declaration.kind === 226 || - (declaration.kind === 225 && ts.nodeIsPresent(declaration.body))) && + for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { + var declaration = declarations_8[_i]; + if ((declaration.kind === 228 || + (declaration.kind === 227 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } @@ -35221,7 +37919,7 @@ var ts; error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); } } - var mergedClass = ts.getDeclarationOfKind(symbol, 226); + var mergedClass = ts.getDeclarationOfKind(symbol, 228); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768; @@ -35229,7 +37927,7 @@ var ts; } if (isAmbientExternalModule) { if (ts.isExternalModuleAugmentation(node)) { - var checkBody = isGlobalAugmentation || (getSymbolOfNode(node).flags & 33554432); + var checkBody = isGlobalAugmentation || (getSymbolOfNode(node).flags & 134217728); if (checkBody && node.body) { for (var _i = 0, _a = node.body.statements; _i < _a.length; _i++) { var statement = _a[_i]; @@ -35264,42 +37962,42 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 205: + case 207: for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 240: - case 241: + case 242: + case 243: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 234: - case 235: + case 236: + case 237: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 174: - case 223: - var name_27 = node.name; - if (ts.isBindingPattern(name_27)) { - for (var _b = 0, _c = name_27.elements; _b < _c.length; _b++) { + case 175: + case 225: + var name = node.name; + if (ts.isBindingPattern(name)) { + for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { var el = _c[_b]; checkModuleAugmentationElement(el, isGlobalAugmentation); } break; } - case 226: - case 229: - case 225: - case 227: - case 230: case 228: + case 231: + case 227: + case 229: + case 232: + case 230: if (isGlobalAugmentation) { return; } var symbol = getSymbolOfNode(node); if (symbol) { - var reportError = !(symbol.flags & 33554432); + var reportError = !(symbol.flags & 134217728); if (!reportError) { reportError = ts.isExternalModuleAugmentation(symbol.parent.declarations[0]); } @@ -35311,12 +38009,12 @@ var ts; switch (node.kind) { case 70: return node; - case 141: + case 142: do { node = node.left; } while (node.kind !== 70); return node; - case 177: + case 178: do { node = node.expression; } while (node.kind !== 70); @@ -35329,9 +38027,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 231 && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 261 && !inAmbientExternalModule) { - error(moduleName, node.kind === 241 ? + var inAmbientExternalModule = node.parent.kind === 233 && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 264 && !inAmbientExternalModule) { + error(moduleName, node.kind === 243 ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -35352,7 +38050,7 @@ var ts; (symbol.flags & 793064 ? 793064 : 0) | (symbol.flags & 1920 ? 1920 : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 243 ? + var message = node.kind === 245 ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); @@ -35379,7 +38077,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 237) { + if (importClause.namedBindings.kind === 239) { checkImportBinding(importClause.namedBindings); } else { @@ -35430,8 +38128,10 @@ var ts; if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { if (node.exportClause) { ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 231 && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 261 && !inAmbientExternalModule) { + var inAmbientExternalModule = node.parent.kind === 233 && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 233 && + !node.moduleSpecifier && ts.isInAmbientContext(node); + if (node.parent.kind !== 264 && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -35444,7 +38144,7 @@ var ts; } } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 261 || node.parent.kind === 231 || node.parent.kind === 230; + var isInAppropriateContext = node.parent.kind === 264 || node.parent.kind === 233 || node.parent.kind === 232; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -35467,9 +38167,14 @@ var ts; if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_assignment_can_only_be_used_in_a_module)) { return; } - var container = node.parent.kind === 261 ? node.parent : node.parent.parent; - if (container.kind === 230 && !ts.isAmbientModule(container)) { - error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); + var container = node.parent.kind === 264 ? node.parent : node.parent.parent; + if (container.kind === 232 && !ts.isAmbientModule(container)) { + if (node.isExportEquals) { + error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); + } + else { + error(node, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); + } return; } if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.getModifierFlags(node) !== 0) { @@ -35492,18 +38197,13 @@ var ts; } } function hasExportedMembers(moduleSymbol) { - for (var id in moduleSymbol.exports) { - if (id !== "export=") { - return true; - } - } - return false; + return ts.forEachEntry(moduleSymbol.exports, function (_, id) { return id !== "export="; }); } function checkExternalModuleExports(node) { var moduleSymbol = getSymbolOfNode(node); var links = getSymbolLinks(moduleSymbol); if (!links.exportsChecked) { - var exportEqualsSymbol = moduleSymbol.exports["export="]; + var exportEqualsSymbol = moduleSymbol.exports.get("export="); if (exportEqualsSymbol && hasExportedMembers(moduleSymbol)) { var declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; if (!isTopLevelInExternalModuleAugmentation(declaration)) { @@ -35511,31 +38211,31 @@ var ts; } } var exports_1 = getExportsOfModule(moduleSymbol); - for (var id in exports_1) { + exports_1 && exports_1.forEach(function (_a, id) { + var declarations = _a.declarations, flags = _a.flags; if (id === "__export") { - continue; + return; } - var _a = exports_1[id], declarations = _a.declarations, flags = _a.flags; if (flags & (1920 | 64 | 384)) { - continue; + return; } var exportedDeclarationsCount = ts.countWhere(declarations, isNotOverload); if (flags & 524288 && exportedDeclarationsCount <= 2) { - continue; + return; } if (exportedDeclarationsCount > 1) { - for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { - var declaration = declarations_6[_i]; + for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) { + var declaration = declarations_9[_i]; if (isNotOverload(declaration)) { diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Cannot_redeclare_exported_variable_0, id)); } } } - } + }); links.exportsChecked = true; } function isNotOverload(declaration) { - return (declaration.kind !== 225 && declaration.kind !== 149) || + return (declaration.kind !== 227 && declaration.kind !== 150) || !!declaration.body; } } @@ -35546,123 +38246,123 @@ var ts; var kind = node.kind; if (cancellationToken) { switch (kind) { - case 230: - case 226: + case 232: + case 228: + case 229: case 227: - case 225: cancellationToken.throwIfCancellationRequested(); } } switch (kind) { - case 143: - return checkTypeParameter(node); case 144: + return checkTypeParameter(node); + case 145: return checkParameter(node); + case 148: case 147: - case 146: return checkPropertyDeclaration(node); - case 158: case 159: - case 153: + case 160: case 154: - return checkSignatureDeclaration(node); case 155: return checkSignatureDeclaration(node); - case 149: - case 148: - return checkMethodDeclaration(node); - case 150: - return checkConstructorDeclaration(node); - case 151: - case 152: - return checkAccessorDeclaration(node); - case 157: - return checkTypeReferenceNode(node); case 156: + return checkSignatureDeclaration(node); + case 150: + case 149: + return checkMethodDeclaration(node); + case 151: + return checkConstructorDeclaration(node); + case 152: + case 153: + return checkAccessorDeclaration(node); + case 158: + return checkTypeReferenceNode(node); + case 157: return checkTypePredicate(node); - case 160: - return checkTypeQuery(node); case 161: - return checkTypeLiteral(node); + return checkTypeQuery(node); case 162: - return checkArrayType(node); + return checkTypeLiteral(node); case 163: - return checkTupleType(node); + return checkArrayType(node); case 164: + return checkTupleType(node); case 165: - return checkUnionOrIntersectionType(node); case 166: - case 168: - return checkSourceElement(node.type); + return checkUnionOrIntersectionType(node); + case 167: case 169: - return checkIndexedAccessType(node); + return checkSourceElement(node.type); case 170: + return checkIndexedAccessType(node); + case 171: return checkMappedType(node); - case 225: - return checkFunctionDeclaration(node); - case 204: - case 231: - return checkBlock(node); - case 205: - return checkVariableStatement(node); - case 207: - return checkExpressionStatement(node); - case 208: - return checkIfStatement(node); - case 209: - return checkDoStatement(node); - case 210: - return checkWhileStatement(node); - case 211: - return checkForStatement(node); - case 212: - return checkForInStatement(node); - case 213: - return checkForOfStatement(node); - case 214: - case 215: - return checkBreakOrContinueStatement(node); - case 216: - return checkReturnStatement(node); - case 217: - return checkWithStatement(node); - case 218: - return checkSwitchStatement(node); - case 219: - return checkLabeledStatement(node); - case 220: - return checkThrowStatement(node); - case 221: - return checkTryStatement(node); - case 223: - return checkVariableDeclaration(node); - case 174: - return checkBindingElement(node); - case 226: - return checkClassDeclaration(node); case 227: - return checkInterfaceDeclaration(node); - case 228: - return checkTypeAliasDeclaration(node); - case 229: - return checkEnumDeclaration(node); - case 230: - return checkModuleDeclaration(node); - case 235: - return checkImportDeclaration(node); - case 234: - return checkImportEqualsDeclaration(node); - case 241: - return checkExportDeclaration(node); - case 240: - return checkExportAssignment(node); + return checkFunctionDeclaration(node); case 206: - checkGrammarStatementInAmbientContext(node); - return; + case 233: + return checkBlock(node); + case 207: + return checkVariableStatement(node); + case 209: + return checkExpressionStatement(node); + case 210: + return checkIfStatement(node); + case 211: + return checkDoStatement(node); + case 212: + return checkWhileStatement(node); + case 213: + return checkForStatement(node); + case 214: + return checkForInStatement(node); + case 215: + return checkForOfStatement(node); + case 216: + case 217: + return checkBreakOrContinueStatement(node); + case 218: + return checkReturnStatement(node); + case 219: + return checkWithStatement(node); + case 220: + return checkSwitchStatement(node); + case 221: + return checkLabeledStatement(node); case 222: + return checkThrowStatement(node); + case 223: + return checkTryStatement(node); + case 225: + return checkVariableDeclaration(node); + case 175: + return checkBindingElement(node); + case 228: + return checkClassDeclaration(node); + case 229: + return checkInterfaceDeclaration(node); + case 230: + return checkTypeAliasDeclaration(node); + case 231: + return checkEnumDeclaration(node); + case 232: + return checkModuleDeclaration(node); + case 237: + return checkImportDeclaration(node); + case 236: + return checkImportEqualsDeclaration(node); + case 243: + return checkExportDeclaration(node); + case 242: + return checkExportAssignment(node); + case 208: checkGrammarStatementInAmbientContext(node); return; - case 244: + case 224: + checkGrammarStatementInAmbientContext(node); + return; + case 246: return checkMissingDeclaration(node); } } @@ -35675,17 +38375,17 @@ var ts; for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) { var node = deferredNodes_1[_i]; switch (node.kind) { - case 184: case 185: + case 186: + case 150: case 149: - case 148: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 151: case 152: - checkAccessorDeferred(node); + case 153: + checkAccessorDeclaration(node); break; - case 197: + case 198: checkClassExpressionDeferred(node); break; } @@ -35705,6 +38405,7 @@ var ts; } checkGrammarSourceFile(node); potentialThisCollisions.length = 0; + potentialNewTargetCollisions.length = 0; deferredNodes = []; deferredUnusedIdentifierNodes = produceDiagnostics && noUnusedIdentifiers ? [] : undefined; ts.forEach(node.statements, checkSourceElement); @@ -35724,6 +38425,10 @@ var ts; ts.forEach(potentialThisCollisions, checkIfThisIsCapturedInEnclosingScope); potentialThisCollisions.length = 0; } + if (potentialNewTargetCollisions.length) { + ts.forEach(potentialNewTargetCollisions, checkIfNewTargetIsCapturedInEnclosingScope); + potentialNewTargetCollisions.length = 0; + } links.flags |= 1; } } @@ -35768,7 +38473,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 217 && node.parent.statement === node) { + if (node.parent.kind === 219 && node.parent.statement === node) { return true; } node = node.parent; @@ -35777,11 +38482,11 @@ var ts; return false; } function getSymbolsInScope(location, meaning) { - var symbols = ts.createMap(); - var memberFlags = 0; if (isInsideWithStatementBody(location)) { return []; } + var symbols = ts.createMap(); + var memberFlags = 0; populateSymbols(); return symbolsToArray(symbols); function populateSymbols() { @@ -35790,28 +38495,28 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 261: + case 264: if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 230: + case 232: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931); break; - case 229: + case 231: copySymbols(getSymbolOfNode(location).exports, meaning & 8); break; - case 197: + case 198: var className = location.name; if (className) { copySymbol(location.symbol, meaning); } - case 226: - case 227: + case 228: + case 229: if (!(memberFlags & 32)) { copySymbols(getSymbolOfNode(location).members, meaning & 793064); } break; - case 184: + case 185: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -35829,17 +38534,16 @@ var ts; function copySymbol(symbol, meaning) { if (symbol.flags & meaning) { var id = symbol.name; - if (!symbols[id]) { - symbols[id] = symbol; + if (!symbols.has(id)) { + symbols.set(id, symbol); } } } function copySymbols(source, meaning) { if (meaning) { - for (var id in source) { - var symbol = source[id]; + source.forEach(function (symbol) { copySymbol(symbol, meaning); - } + }); } } } @@ -35850,27 +38554,27 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 143: - case 226: - case 227: + case 144: case 228: case 229: + case 230: + case 231: return true; } } function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 141) { + while (node.parent && node.parent.kind === 142) { node = node.parent; } - return node.parent && (node.parent.kind === 157 || node.parent.kind === 272); + return node.parent && (node.parent.kind === 158 || node.parent.kind === 276); } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 177) { + while (node.parent && node.parent.kind === 178) { node = node.parent; } - return node.parent && node.parent.kind === 199; + return node.parent && node.parent.kind === 200; } function forEachEnclosingClass(node, callback) { var result; @@ -35887,13 +38591,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 141) { + while (nodeOnRightSide.parent.kind === 142) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 234) { + if (nodeOnRightSide.parent.kind === 236) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 240) { + if (nodeOnRightSide.parent.kind === 242) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -35901,27 +38605,35 @@ var ts; function isInRightSideOfImportOrExportAssignment(node) { return getLeftSideOfImportEqualsOrExportAssignment(node) !== undefined; } + function getSpecialPropertyAssignmentSymbolFromEntityName(entityName) { + var specialPropertyAssignmentKind = ts.getSpecialPropertyAssignmentKind(entityName.parent.parent); + switch (specialPropertyAssignmentKind) { + case 1: + case 3: + return getSymbolOfNode(entityName.parent); + case 4: + case 2: + case 5: + return getSymbolOfNode(entityName.parent.parent); + } + } function getSymbolOfEntityNameOrPropertyAccessExpression(entityName) { if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (ts.isInJavaScriptFile(entityName) && entityName.parent.kind === 177) { - var specialPropertyAssignmentKind = ts.getSpecialPropertyAssignmentKind(entityName.parent.parent); - switch (specialPropertyAssignmentKind) { - case 1: - case 3: - return getSymbolOfNode(entityName.parent); - case 4: - case 2: - return getSymbolOfNode(entityName.parent.parent); - default: + if (ts.isInJavaScriptFile(entityName) && + entityName.parent.kind === 178 && + entityName.parent === entityName.parent.parent.left) { + var specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(entityName); + if (specialPropertyAssignmentSymbol) { + return specialPropertyAssignmentSymbol; } } - if (entityName.parent.kind === 240 && ts.isEntityNameExpression(entityName)) { + if (entityName.parent.kind === 242 && ts.isEntityNameExpression(entityName)) { return resolveEntityName(entityName, 107455 | 793064 | 1920 | 8388608); } - if (entityName.kind !== 177 && isInRightSideOfImportOrExportAssignment(entityName)) { - var importEqualsDeclaration = ts.getAncestor(entityName, 234); + if (entityName.kind !== 178 && isInRightSideOfImportOrExportAssignment(entityName)) { + var importEqualsDeclaration = ts.getAncestor(entityName, 236); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, true); } @@ -35930,7 +38642,7 @@ var ts; } if (isHeritageClauseElementIdentifier(entityName)) { var meaning = 0; - if (entityName.parent.kind === 199) { + if (entityName.parent.kind === 200) { meaning = 793064; if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { meaning |= 107455; @@ -35940,9 +38652,12 @@ var ts; meaning = 1920; } meaning |= 8388608; - return resolveEntityName(entityName, meaning); + var entityNameSymbol = resolveEntityName(entityName, meaning); + if (entityNameSymbol) { + return entityNameSymbol; + } } - else if (ts.isPartOfExpression(entityName)) { + if (ts.isPartOfExpression(entityName)) { if (ts.nodeIsMissing(entityName)) { return undefined; } @@ -35952,14 +38667,14 @@ var ts; } return resolveEntityName(entityName, 107455, false, true); } - else if (entityName.kind === 177) { + else if (entityName.kind === 178) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); } return getNodeLinks(entityName).resolvedSymbol; } - else if (entityName.kind === 141) { + else if (entityName.kind === 142) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkQualifiedName(entityName); @@ -35968,19 +38683,19 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = (entityName.parent.kind === 157 || entityName.parent.kind === 272) ? 793064 : 1920; + var meaning = (entityName.parent.kind === 158 || entityName.parent.kind === 276) ? 793064 : 1920; return resolveEntityName(entityName, meaning, false, true); } - else if (entityName.parent.kind === 250) { + else if (entityName.parent.kind === 252) { return getJsxAttributePropertySymbol(entityName.parent); } - if (entityName.parent.kind === 156) { + if (entityName.parent.kind === 157) { return resolveEntityName(entityName, 1); } return undefined; } function getSymbolAtLocation(node) { - if (node.kind === 261) { + if (node.kind === 264) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } if (isInsideWithStatementBody(node)) { @@ -35996,8 +38711,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfEntityNameOrPropertyAccessExpression(node); } - else if (node.parent.kind === 174 && - node.parent.parent.kind === 172 && + else if (node.parent.kind === 175 && + node.parent.parent.kind === 173 && node === node.parent.propertyName) { var typeOfPattern = getTypeOfNode(node.parent.parent); var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.text); @@ -36008,8 +38723,8 @@ var ts; } switch (node.kind) { case 70: - case 177: - case 141: + case 178: + case 142: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 98: var container = ts.getThisContainer(node, false); @@ -36022,18 +38737,18 @@ var ts; case 96: var type = ts.isPartOfExpression(node) ? getTypeOfExpression(node) : getTypeFromTypeNode(node); return type.symbol; - case 167: + case 168: return getTypeFromTypeNode(node).symbol; case 122: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 150) { + if (constructorDeclaration && constructorDeclaration.kind === 151) { return constructorDeclaration.parent.symbol; } return undefined; case 9: if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 235 || node.parent.kind === 241) && + ((node.parent.kind === 237 || node.parent.kind === 243) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } @@ -36041,7 +38756,7 @@ var ts; return resolveExternalModuleName(node, node); } case 8: - if (node.parent.kind === 178 && node.parent.argumentExpression === node) { + if (node.parent.kind === 179 && node.parent.argumentExpression === node) { var objectType = getTypeOfExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -36055,7 +38770,7 @@ var ts; return undefined; } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 258) { + if (location && location.kind === 261) { return resolveEntityName(location.name, 107455 | 8388608); } return undefined; @@ -36070,13 +38785,22 @@ var ts; return unknownType; } if (ts.isPartOfTypeNode(node)) { - return getTypeFromTypeNode(node); + var typeFromTypeNode = getTypeFromTypeNode(node); + if (typeFromTypeNode && ts.isExpressionWithTypeArgumentsInClassImplementsClause(node)) { + var containingClass = ts.getContainingClass(node); + var classType = getTypeOfNode(containingClass); + typeFromTypeNode = getTypeWithThisArgument(typeFromTypeNode, classType.thisType); + } + return typeFromTypeNode; } if (ts.isPartOfExpression(node)) { return getRegularTypeOfExpression(node); } if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(node)) { - return getBaseTypes(getDeclaredTypeOfSymbol(getSymbolOfNode(node.parent.parent)))[0]; + var classNode = ts.getContainingClass(node); + var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(classNode)); + var baseType = getBaseTypes(classType)[0]; + return baseType && getTypeWithThisArgument(baseType, classType.thisType); } if (isTypeDeclaration(node)) { var symbol = getSymbolOfNode(node); @@ -36105,22 +38829,22 @@ var ts; return unknownType; } function getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr) { - ts.Debug.assert(expr.kind === 176 || expr.kind === 175); - if (expr.parent.kind === 213) { - var iteratedType = checkRightHandSideOfForOf(expr.parent.expression); + ts.Debug.assert(expr.kind === 177 || expr.kind === 176); + if (expr.parent.kind === 215) { + var iteratedType = checkRightHandSideOfForOf(expr.parent.expression, expr.parent.awaitModifier); return checkDestructuringAssignment(expr, iteratedType || unknownType); } - if (expr.parent.kind === 192) { + if (expr.parent.kind === 193) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || unknownType); } - if (expr.parent.kind === 257) { + if (expr.parent.kind === 260) { var typeOfParentObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent.parent); return checkObjectLiteralDestructuringPropertyAssignment(typeOfParentObjectLiteral || unknownType, expr.parent); } - ts.Debug.assert(expr.parent.kind === 175); + ts.Debug.assert(expr.parent.kind === 176); var typeOfArrayLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent); - var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, false) || unknownType; + var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, false, false) || unknownType; return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, ts.indexOf(expr.parent.elements, expr), elementType || unknownType); } function getPropertySymbolOfDestructuringAssignment(location) { @@ -36144,29 +38868,32 @@ var ts; var propsByName = createSymbolTable(getPropertiesOfType(type)); if (getSignaturesOfType(type, 0).length || getSignaturesOfType(type, 1).length) { ts.forEach(getPropertiesOfType(globalFunctionType), function (p) { - if (!propsByName[p.name]) { - propsByName[p.name] = p; + if (!propsByName.has(p.name)) { + propsByName.set(p.name, p); } }); } return getNamedMembers(propsByName); } function getRootSymbols(symbol) { - if (symbol.flags & 268435456) { + if (getCheckFlags(symbol) & 6) { var symbols_3 = []; - var name_28 = symbol.name; + var name_2 = symbol.name; ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) { - var symbol = getPropertyOfType(t, name_28); + var symbol = getPropertyOfType(t, name_2); if (symbol) { symbols_3.push(symbol); } }); return symbols_3; } - else if (symbol.flags & 67108864) { + else if (symbol.flags & 134217728) { if (symbol.leftSpread) { var links = symbol; - return [links.leftSpread, links.rightSpread]; + return getRootSymbols(links.leftSpread).concat(getRootSymbols(links.rightSpread)); + } + if (symbol.syntheticOrigin) { + return getRootSymbols(symbol.syntheticOrigin); } var target = void 0; var next = symbol; @@ -36183,7 +38910,8 @@ var ts; if (!ts.isGeneratedIdentifier(node)) { node = ts.getParseTreeNode(node, ts.isIdentifier); if (node) { - return getReferencedValueSymbol(node) === argumentsSymbol; + var isPropertyName_1 = node.parent.kind === 178 && node.parent.name === node; + return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } return false; @@ -36199,7 +38927,7 @@ var ts; if (symbolLinks.exportsSomeValue === undefined) { symbolLinks.exportsSomeValue = hasExportAssignment ? !!(moduleSymbol.flags & 107455) - : ts.forEachProperty(getExportsOfModule(moduleSymbol), isValue); + : ts.forEachEntry(getExportsOfModule(moduleSymbol), isValue); } return symbolLinks.exportsSomeValue; function isValue(s) { @@ -36223,19 +38951,15 @@ var ts; } symbol = exportSymbol; } - var parentSymbol = getParentOfSymbol(symbol); - if (parentSymbol) { - if (parentSymbol.flags & 512 && parentSymbol.valueDeclaration.kind === 261) { - var symbolFile = parentSymbol.valueDeclaration; + var parentSymbol_1 = getParentOfSymbol(symbol); + if (parentSymbol_1) { + if (parentSymbol_1.flags & 512 && parentSymbol_1.valueDeclaration.kind === 264) { + var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); var symbolIsUmdExport = symbolFile !== referenceFile; return symbolIsUmdExport ? undefined : symbolFile; } - for (var n = node.parent; n; n = n.parent) { - if (ts.isModuleOrEnumDeclaration(n) && getSymbolOfNode(n) === parentSymbol) { - return n; - } - } + return ts.findAncestor(node.parent, function (n) { return ts.isModuleOrEnumDeclaration(n) && getSymbolOfNode(n) === parentSymbol_1; }); } } } @@ -36263,7 +38987,7 @@ var ts; else if (nodeLinks_1.flags & 131072) { var isDeclaredInLoop = nodeLinks_1.flags & 262144; var inLoopInitializer = ts.isIterationStatement(container, false); - var inLoopBodyBlock = container.kind === 204 && ts.isIterationStatement(container.parent, false); + var inLoopBodyBlock = container.kind === 206 && ts.isIterationStatement(container.parent, false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -36298,21 +39022,17 @@ var ts; return false; } function isValueAliasDeclaration(node) { - node = ts.getParseTreeNode(node); - if (node === undefined) { - return true; - } switch (node.kind) { - case 234: case 236: - case 237: + case 238: case 239: - case 243: - return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); case 241: + case 245: + return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); + case 243: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 240: + case 242: return node.expression && node.expression.kind === 70 ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) @@ -36322,7 +39042,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(node) { node = ts.getParseTreeNode(node, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 261 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 264 || !ts.isInternalModuleImportEqualsDeclaration(node)) { return false; } var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); @@ -36340,10 +39060,6 @@ var ts; return isConstEnumSymbol(s) || s.constEnumOnlyModule; } function isReferencedAliasDeclaration(node, checkChildren) { - node = ts.getParseTreeNode(node); - if (node === undefined) { - return true; - } if (ts.isAliasSymbolDeclaration(node)) { var symbol = getSymbolOfNode(node); if (symbol && getSymbolLinks(symbol).referenced) { @@ -36364,16 +39080,30 @@ var ts; } return false; } + function isRequiredInitializedParameter(parameter) { + return strictNullChecks && + !isOptionalParameter(parameter) && + parameter.initializer && + !(ts.getModifierFlags(parameter) & 92); + } function getNodeCheckFlags(node) { - node = ts.getParseTreeNode(node); - return node ? getNodeLinks(node).flags : undefined; + return getNodeLinks(node).flags; } function getEnumMemberValue(node) { computeEnumMemberValues(node.parent); return getNodeLinks(node).enumMemberValue; } + function canHaveConstantValue(node) { + switch (node.kind) { + case 263: + case 178: + case 179: + return true; + } + return false; + } function getConstantValue(node) { - if (node.kind === 260) { + if (node.kind === 263) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -36389,15 +39119,17 @@ var ts; } function getTypeReferenceSerializationKind(typeName, location) { var valueSymbol = resolveEntityName(typeName, 107455, true, false, location); - var globalPromiseSymbol = tryGetGlobalPromiseConstructorSymbol(); - if (globalPromiseSymbol && valueSymbol === globalPromiseSymbol) { - return ts.TypeReferenceSerializationKind.Promise; - } - var constructorType = valueSymbol ? getTypeOfSymbol(valueSymbol) : undefined; - if (constructorType && isConstructorType(constructorType)) { - return ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue; - } var typeSymbol = resolveEntityName(typeName, 793064, true, false, location); + if (valueSymbol && valueSymbol === typeSymbol) { + var globalPromiseSymbol = getGlobalPromiseConstructorSymbol(false); + if (globalPromiseSymbol && valueSymbol === globalPromiseSymbol) { + return ts.TypeReferenceSerializationKind.Promise; + } + var constructorType = getTypeOfSymbol(valueSymbol); + if (constructorType && isConstructorType(constructorType)) { + return ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue; + } + } if (!typeSymbol) { return ts.TypeReferenceSerializationKind.ObjectType; } @@ -36441,6 +39173,9 @@ var ts; var type = symbol && !(symbol.flags & (2048 | 131072)) ? getWidenedLiteralType(getTypeOfSymbol(symbol)) : unknownType; + if (flags & 4096) { + type = includeFalsyTypes(type, 2048); + } getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { @@ -36455,10 +39190,13 @@ var ts; var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(node)); resolveBaseTypesOfClass(classType); var baseType = classType.resolvedBaseTypes.length ? classType.resolvedBaseTypes[0] : unknownType; + if (!baseType.symbol) { + writer.reportIllegalExtends(); + } getSymbolDisplayBuilder().buildTypeDisplay(baseType, writer, enclosingDeclaration, flags); } function hasGlobalName(name) { - return !!globals[name]; + return globals.has(name); } function getReferencedValueSymbol(reference, startInDeclarationContainer) { var resolvedSymbol = getNodeLinks(reference).resolvedSymbol; @@ -36467,9 +39205,9 @@ var ts; } var location = reference; if (startInDeclarationContainer) { - var parent_11 = reference.parent; - if (ts.isDeclaration(parent_11) && reference === parent_11.name) { - location = getDeclarationContainer(parent_11); + var parent = reference.parent; + if (ts.isDeclaration(parent) && reference === parent.name) { + location = getDeclarationContainer(parent); } } return resolveName(location, reference.text, 107455 | 1048576 | 8388608, undefined, undefined); @@ -36502,34 +39240,46 @@ var ts; var fileToDirective; if (resolvedTypeReferenceDirectives) { fileToDirective = ts.createFileMap(); - for (var key in resolvedTypeReferenceDirectives) { - var resolvedDirective = resolvedTypeReferenceDirectives[key]; + resolvedTypeReferenceDirectives.forEach(function (resolvedDirective, key) { if (!resolvedDirective) { - continue; + return; } var file = host.getSourceFile(resolvedDirective.resolvedFileName); fileToDirective.set(file.path, key); - } + }); } return { getReferencedExportContainer: getReferencedExportContainer, getReferencedImportDeclaration: getReferencedImportDeclaration, getReferencedDeclarationWithCollidingName: getReferencedDeclarationWithCollidingName, isDeclarationWithCollidingName: isDeclarationWithCollidingName, - isValueAliasDeclaration: isValueAliasDeclaration, + isValueAliasDeclaration: function (node) { + node = ts.getParseTreeNode(node); + return node ? isValueAliasDeclaration(node) : true; + }, hasGlobalName: hasGlobalName, - isReferencedAliasDeclaration: isReferencedAliasDeclaration, - getNodeCheckFlags: getNodeCheckFlags, + isReferencedAliasDeclaration: function (node, checkChildren) { + node = ts.getParseTreeNode(node); + return node ? isReferencedAliasDeclaration(node, checkChildren) : true; + }, + getNodeCheckFlags: function (node) { + node = ts.getParseTreeNode(node); + return node ? getNodeCheckFlags(node) : undefined; + }, isTopLevelValueImportEqualsWithEntityName: isTopLevelValueImportEqualsWithEntityName, isDeclarationVisible: isDeclarationVisible, isImplementationOfOverload: isImplementationOfOverload, + isRequiredInitializedParameter: isRequiredInitializedParameter, writeTypeOfDeclaration: writeTypeOfDeclaration, writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration, writeTypeOfExpression: writeTypeOfExpression, writeBaseConstructorTypeOfClass: writeBaseConstructorTypeOfClass, isSymbolAccessible: isSymbolAccessible, isEntityNameVisible: isEntityNameVisible, - getConstantValue: getConstantValue, + getConstantValue: function (node) { + node = ts.getParseTreeNode(node, canHaveConstantValue); + return node ? getConstantValue(node) : undefined; + }, collectLinkedAliases: collectLinkedAliases, getReferencedValueDeclaration: getReferencedValueDeclaration, getTypeReferenceSerializationKind: getTypeReferenceSerializationKind, @@ -36547,7 +39297,7 @@ var ts; if (!fileToDirective) { return undefined; } - var meaning = (node.kind === 177) || (node.kind === 70 && isInTypeQuery(node)) + var meaning = (node.kind === 178) || (node.kind === 70 && isInTypeQuery(node)) ? 107455 | 1048576 : 793064 | 1920; var symbol = resolveEntityName(node, meaning, true); @@ -36582,15 +39332,15 @@ var ts; } var current = symbol; while (true) { - var parent_12 = getParentOfSymbol(current); - if (parent_12) { - current = parent_12; + var parent = getParentOfSymbol(current); + if (parent) { + current = parent; } else { break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 261 && current.flags & 512) { + if (current.valueDeclaration && current.valueDeclaration.kind === 264 && current.flags & 512) { return false; } for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { @@ -36609,7 +39359,7 @@ var ts; if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 261); + return ts.getDeclarationOfKind(moduleSymbol, 264); } function initializeTypeChecker() { for (var _i = 0, _a = host.getSourceFiles(); _i < _a.length; _i++) { @@ -36617,8 +39367,6 @@ var ts; ts.bindSourceFile(file, compilerOptions); } var augmentations; - var requestedExternalEmitHelpers = 0; - var firstFileRequestingExternalHelpers; for (var _b = 0, _c = host.getSourceFiles(); _b < _c.length; _b++) { var file = _c[_b]; if (!ts.isExternalOrCommonJsModule(file)) { @@ -36632,20 +39380,11 @@ var ts; } if (file.symbol && file.symbol.globalExports) { var source = file.symbol.globalExports; - for (var id in source) { - if (!(id in globals)) { - globals[id] = source[id]; + source.forEach(function (sourceSymbol, id) { + if (!globals.has(id)) { + globals.set(id, sourceSymbol); } - } - } - if ((compilerOptions.isolatedModules || ts.isExternalModule(file)) && !file.isDeclarationFile) { - var fileRequestedExternalEmitHelpers = file.flags & 64512; - if (fileRequestedExternalEmitHelpers) { - requestedExternalEmitHelpers |= fileRequestedExternalEmitHelpers; - if (firstFileRequestingExternalHelpers === undefined) { - firstFileRequestingExternalHelpers = file; - } - } + }); } } if (augmentations) { @@ -36659,116 +39398,80 @@ var ts; } addToSymbolTable(globals, builtinGlobals, ts.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0); getSymbolLinks(undefinedSymbol).type = undefinedWideningType; - getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments"); + getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments", 0, true); getSymbolLinks(unknownSymbol).type = unknownType; - globalArrayType = getGlobalType("Array", 1); - globalObjectType = getGlobalType("Object"); - globalFunctionType = getGlobalType("Function"); - globalStringType = getGlobalType("String"); - globalNumberType = getGlobalType("Number"); - globalBooleanType = getGlobalType("Boolean"); - globalRegExpType = getGlobalType("RegExp"); - jsxElementType = getExportedTypeFromNamespace("JSX", JsxNames.Element); - getGlobalClassDecoratorType = ts.memoize(function () { return getGlobalType("ClassDecorator"); }); - getGlobalPropertyDecoratorType = ts.memoize(function () { return getGlobalType("PropertyDecorator"); }); - getGlobalMethodDecoratorType = ts.memoize(function () { return getGlobalType("MethodDecorator"); }); - getGlobalParameterDecoratorType = ts.memoize(function () { return getGlobalType("ParameterDecorator"); }); - getGlobalTypedPropertyDescriptorType = ts.memoize(function () { return getGlobalType("TypedPropertyDescriptor", 1); }); - getGlobalESSymbolConstructorSymbol = ts.memoize(function () { return getGlobalValueSymbol("Symbol"); }); - getGlobalPromiseType = ts.memoize(function () { return getGlobalType("Promise", 1); }); - tryGetGlobalPromiseType = ts.memoize(function () { return getGlobalSymbol("Promise", 793064, undefined) && getGlobalPromiseType(); }); - getGlobalPromiseLikeType = ts.memoize(function () { return getGlobalType("PromiseLike", 1); }); - getInstantiatedGlobalPromiseLikeType = ts.memoize(createInstantiatedPromiseLikeType); - getGlobalPromiseConstructorSymbol = ts.memoize(function () { return getGlobalValueSymbol("Promise"); }); - tryGetGlobalPromiseConstructorSymbol = ts.memoize(function () { return getGlobalSymbol("Promise", 107455, undefined) && getGlobalPromiseConstructorSymbol(); }); - getGlobalPromiseConstructorLikeType = ts.memoize(function () { return getGlobalType("PromiseConstructorLike"); }); - getGlobalThenableType = ts.memoize(createThenableType); - getGlobalTemplateStringsArrayType = ts.memoize(function () { return getGlobalType("TemplateStringsArray"); }); - if (languageVersion >= 2) { - getGlobalESSymbolType = ts.memoize(function () { return getGlobalType("Symbol"); }); - getGlobalIterableType = ts.memoize(function () { return getGlobalType("Iterable", 1); }); - getGlobalIteratorType = ts.memoize(function () { return getGlobalType("Iterator", 1); }); - getGlobalIterableIteratorType = ts.memoize(function () { return getGlobalType("IterableIterator", 1); }); - } - else { - getGlobalESSymbolType = ts.memoize(function () { return emptyObjectType; }); - getGlobalIterableType = ts.memoize(function () { return emptyGenericType; }); - getGlobalIteratorType = ts.memoize(function () { return emptyGenericType; }); - getGlobalIterableIteratorType = ts.memoize(function () { return emptyGenericType; }); - } + globalArrayType = getGlobalType("Array", 1, true); + globalObjectType = getGlobalType("Object", 0, true); + globalFunctionType = getGlobalType("Function", 0, true); + globalStringType = getGlobalType("String", 0, true); + globalNumberType = getGlobalType("Number", 0, true); + globalBooleanType = getGlobalType("Boolean", 0, true); + globalRegExpType = getGlobalType("RegExp", 0, true); anyArrayType = createArrayType(anyType); autoArrayType = createArrayType(autoType); - var symbol = getGlobalSymbol("ReadonlyArray", 793064, undefined); - globalReadonlyArrayType = symbol && getTypeOfGlobalSymbol(symbol, 1); + globalReadonlyArrayType = getGlobalTypeOrUndefined("ReadonlyArray", 1); anyReadonlyArrayType = globalReadonlyArrayType ? createTypeFromGenericGlobalType(globalReadonlyArrayType, [anyType]) : anyArrayType; - if (compilerOptions.importHelpers && firstFileRequestingExternalHelpers) { - var helpersModule = resolveExternalModule(firstFileRequestingExternalHelpers, ts.externalHelpersModuleNameText, ts.Diagnostics.Cannot_find_module_0, undefined); - if (helpersModule) { - var exports_2 = helpersModule.exports; - if (requestedExternalEmitHelpers & 1024 && languageVersion < 2) { - verifyHelperSymbol(exports_2, "__extends", 107455); - } - if (requestedExternalEmitHelpers & 16384 && - (languageVersion < 5 || compilerOptions.jsx === 2)) { - verifyHelperSymbol(exports_2, "__assign", 107455); - } - if (languageVersion < 5 && requestedExternalEmitHelpers & 32768) { - verifyHelperSymbol(exports_2, "__rest", 107455); - } - if (requestedExternalEmitHelpers & 2048) { - verifyHelperSymbol(exports_2, "__decorate", 107455); - if (compilerOptions.emitDecoratorMetadata) { - verifyHelperSymbol(exports_2, "__metadata", 107455); - } - } - if (requestedExternalEmitHelpers & 4096) { - verifyHelperSymbol(exports_2, "__param", 107455); - } - if (requestedExternalEmitHelpers & 8192) { - verifyHelperSymbol(exports_2, "__awaiter", 107455); - if (languageVersion < 2) { - verifyHelperSymbol(exports_2, "__generator", 107455); + globalThisType = getGlobalTypeOrUndefined("ThisType", 1); + } + function checkExternalEmitHelpers(location, helpers) { + if ((requestedExternalEmitHelpers & helpers) !== helpers && compilerOptions.importHelpers) { + var sourceFile = ts.getSourceFileOfNode(location); + if (ts.isEffectiveExternalModule(sourceFile, compilerOptions) && !ts.isInAmbientContext(location)) { + var helpersModule = resolveHelpersModule(sourceFile, location); + if (helpersModule !== unknownSymbol) { + var uncheckedHelpers = helpers & ~requestedExternalEmitHelpers; + for (var helper = 1; helper <= 8192; helper <<= 1) { + if (uncheckedHelpers & helper) { + var name = getHelperName(helper); + var symbol = getSymbol(helpersModule.exports, ts.escapeIdentifier(name), 107455); + if (!symbol) { + error(location, ts.Diagnostics.This_syntax_requires_an_imported_helper_named_1_but_module_0_has_no_exported_member_1, ts.externalHelpersModuleNameText, name); + } + } } } + requestedExternalEmitHelpers |= helpers; } } } - function verifyHelperSymbol(symbols, name, meaning) { - var symbol = getSymbol(symbols, ts.escapeIdentifier(name), meaning); - if (!symbol) { - error(undefined, ts.Diagnostics.Module_0_has_no_exported_member_1, ts.externalHelpersModuleNameText, name); + function getHelperName(helper) { + switch (helper) { + case 1: return "__extends"; + case 2: return "__assign"; + case 4: return "__rest"; + case 8: return "__decorate"; + case 16: return "__metadata"; + case 32: return "__param"; + case 64: return "__awaiter"; + case 128: return "__generator"; + case 256: return "__values"; + case 512: return "__read"; + case 1024: return "__spread"; + case 2048: return "__asyncGenerator"; + case 4096: return "__asyncDelegator"; + case 8192: return "__asyncValues"; + default: ts.Debug.fail("Unrecognized helper."); } } - function createInstantiatedPromiseLikeType() { - var promiseLikeType = getGlobalPromiseLikeType(); - if (promiseLikeType !== emptyGenericType) { - return createTypeReference(promiseLikeType, [anyType]); + function resolveHelpersModule(node, errorNode) { + if (!externalHelpersModule) { + externalHelpersModule = resolveExternalModule(node, ts.externalHelpersModuleNameText, ts.Diagnostics.This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found, errorNode) || unknownSymbol; } - return emptyObjectType; - } - function createThenableType() { - var thenPropertySymbol = createSymbol(67108864 | 4, "then"); - getSymbolLinks(thenPropertySymbol).type = globalFunctionType; - var thenableType = createObjectType(16); - thenableType.properties = [thenPropertySymbol]; - thenableType.members = createSymbolTable(thenableType.properties); - thenableType.callSignatures = []; - thenableType.constructSignatures = []; - return thenableType; + return externalHelpersModule; } function checkGrammarDecorators(node) { if (!node.decorators) { return false; } if (!ts.nodeCanBeDecorated(node)) { - if (node.kind === 149 && !ts.nodeIsPresent(node.body)) { + if (node.kind === 150 && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 151 || node.kind === 152) { + else if (node.kind === 152 || node.kind === 153) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -36786,16 +39489,16 @@ var ts; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; if (modifier.kind !== 130) { - if (node.kind === 146 || node.kind === 148) { + if (node.kind === 147 || node.kind === 149) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 155) { + if (node.kind === 156) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 75: - if (node.kind !== 229 && node.parent.kind === 226) { + if (node.kind !== 231 && node.parent.kind === 228) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(75)); } break; @@ -36821,7 +39524,7 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 231 || node.parent.kind === 261) { + else if (node.parent.kind === 233 || node.parent.kind === 264) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128) { @@ -36844,10 +39547,10 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 231 || node.parent.kind === 261) { + else if (node.parent.kind === 233 || node.parent.kind === 264) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 144) { + else if (node.kind === 145) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128) { @@ -36860,7 +39563,7 @@ var ts; if (flags & 64) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 147 && node.kind !== 146 && node.kind !== 155 && node.kind !== 144) { + else if (node.kind !== 148 && node.kind !== 147 && node.kind !== 156 && node.kind !== 145) { return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } flags |= 64; @@ -36879,10 +39582,10 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } - else if (node.parent.kind === 226) { + else if (node.parent.kind === 228) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 144) { + else if (node.kind === 145) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1; @@ -36894,13 +39597,13 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.parent.kind === 226) { + else if (node.parent.kind === 228) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 144) { + else if (node.kind === 145) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 231) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 233) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 2; @@ -36910,14 +39613,14 @@ var ts; if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 226) { - if (node.kind !== 149 && - node.kind !== 147 && - node.kind !== 151 && - node.kind !== 152) { + if (node.kind !== 228) { + if (node.kind !== 150 && + node.kind !== 148 && + node.kind !== 152 && + node.kind !== 153) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 226 && ts.getModifierFlags(node.parent) & 128)) { + if (!(node.parent.kind === 228 && ts.getModifierFlags(node.parent) & 128)) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32) { @@ -36936,7 +39639,7 @@ var ts; else if (flags & 2 || ts.isInAmbientContext(node.parent)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 144) { + else if (node.kind === 145) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256; @@ -36944,7 +39647,7 @@ var ts; break; } } - if (node.kind === 150) { + if (node.kind === 151) { if (flags & 32) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -36959,13 +39662,13 @@ var ts; } return; } - else if ((node.kind === 235 || node.kind === 234) && flags & 2) { + else if ((node.kind === 237 || node.kind === 236) && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 144 && (flags & 92) && ts.isBindingPattern(node.name)) { + else if (node.kind === 145 && (flags & 92) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 144 && (flags & 92) && node.dotDotDotToken) { + else if (node.kind === 145 && (flags & 92) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256) { @@ -36981,37 +39684,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 151: case 152: - case 150: - case 147: - case 146: - case 149: + case 153: + case 151: case 148: - case 155: - case 230: - case 235: - case 234: - case 241: - case 240: - case 184: + case 147: + case 150: + case 149: + case 156: + case 232: + case 237: + case 236: + case 243: + case 242: case 185: - case 144: + case 186: + case 145: return false; default: - if (node.parent.kind === 231 || node.parent.kind === 261) { + if (node.parent.kind === 233 || node.parent.kind === 264) { return false; } switch (node.kind) { - case 225: - return nodeHasAnyModifiersExcept(node, 119); - case 226: - return nodeHasAnyModifiersExcept(node, 116); case 227: - case 205: + return nodeHasAnyModifiersExcept(node, 119); case 228: - return true; + return nodeHasAnyModifiersExcept(node, 116); case 229: + case 207: + case 230: + return true; + case 231: return nodeHasAnyModifiersExcept(node, 75); default: ts.Debug.fail(); @@ -37024,14 +39727,11 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 149: - case 225: - case 184: + case 150: + case 227: case 185: - if (!node.asteriskToken) { - return false; - } - break; + case 186: + return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); } @@ -37088,8 +39788,12 @@ var ts; return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarTypeParameterList(node.typeParameters, file) || checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); } + function checkGrammarClassLikeDeclaration(node) { + var file = ts.getSourceFileOfNode(node); + return checkGrammarClassDeclarationHeritageClauses(node) || checkGrammarTypeParameterList(node.typeParameters, file); + } function checkGrammarArrowFunction(node, file) { - if (node.kind === 185) { + if (node.kind === 186) { var arrowFunction = node; var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; @@ -37124,7 +39828,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 134 && parameter.type.kind !== 132) { + if (parameter.type.kind !== 135 && parameter.type.kind !== 132) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); } if (!node.type) { @@ -37151,7 +39855,7 @@ var ts; var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 198) { + if (arg.kind === 199) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -37221,28 +39925,25 @@ var ts; return false; } function checkGrammarComputedPropertyName(node) { - if (node.kind !== 142) { + if (node.kind !== 143) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 192 && computedPropertyName.expression.operatorToken.kind === 25) { + if (computedPropertyName.expression.kind === 193 && computedPropertyName.expression.operatorToken.kind === 25) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 225 || - node.kind === 184 || - node.kind === 149); + ts.Debug.assert(node.kind === 227 || + node.kind === 185 || + node.kind === 150); if (ts.isInAmbientContext(node)) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } if (!node.body) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.An_overload_signature_cannot_be_declared_as_a_generator); } - if (languageVersion < 2) { - return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher); - } } } function checkGrammarForInvalidQuestionMark(questionToken, message) { @@ -37258,87 +39959,87 @@ var ts; var GetOrSetAccessor = GetAccessor | SetAccessor; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 259) { + if (prop.kind === 262) { continue; } - var name_29 = prop.name; - if (name_29.kind === 142) { - checkGrammarComputedPropertyName(name_29); + var name = prop.name; + if (name.kind === 143) { + checkGrammarComputedPropertyName(name); } - if (prop.kind === 258 && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 261 && !inDestructuring && prop.objectAssignmentInitializer) { return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); } if (prop.modifiers) { for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { var mod = _c[_b]; - if (mod.kind !== 119 || prop.kind !== 149) { + if (mod.kind !== 119 || prop.kind !== 150) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } } var currentKind = void 0; - if (prop.kind === 257 || prop.kind === 258) { + if (prop.kind === 260 || prop.kind === 261) { checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); - if (name_29.kind === 8) { - checkGrammarNumericLiteral(name_29); + if (name.kind === 8) { + checkGrammarNumericLiteral(name); } currentKind = Property; } - else if (prop.kind === 149) { + else if (prop.kind === 150) { currentKind = Property; } - else if (prop.kind === 151) { + else if (prop.kind === 152) { currentKind = GetAccessor; } - else if (prop.kind === 152) { + else if (prop.kind === 153) { currentKind = SetAccessor; } else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - var effectiveName = ts.getPropertyNameForPropertyNameNode(name_29); + var effectiveName = ts.getPropertyNameForPropertyNameNode(name); if (effectiveName === undefined) { continue; } - if (!seen[effectiveName]) { - seen[effectiveName] = currentKind; + var existingKind = seen.get(effectiveName); + if (!existingKind) { + seen.set(effectiveName, currentKind); } else { - var existingKind = seen[effectiveName]; if (currentKind === Property && existingKind === Property) { - grammarErrorOnNode(name_29, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name_29)); + grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name)); } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[effectiveName] = currentKind | existingKind; + seen.set(effectiveName, currentKind | existingKind); } else { - return grammarErrorOnNode(name_29, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); } } else { - return grammarErrorOnNode(name_29, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); } } } } function checkGrammarJsxElement(node) { var seen = ts.createMap(); - for (var _i = 0, _a = node.attributes; _i < _a.length; _i++) { + for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 251) { + if (attr.kind === 254) { continue; } var jsxAttr = attr; - var name_30 = jsxAttr.name; - if (!seen[name_30.text]) { - seen[name_30.text] = true; + var name = jsxAttr.name; + if (!seen.get(name.text)) { + seen.set(name.text, true); } else { - return grammarErrorOnNode(name_30, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); + return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } var initializer = jsxAttr.initializer; - if (initializer && initializer.kind === 252 && !initializer.expression) { + if (initializer && initializer.kind === 255 && !initializer.expression) { return grammarErrorOnNode(jsxAttr.initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -37347,7 +40048,12 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 224) { + if (forInOrOfStatement.kind === 215 && forInOrOfStatement.awaitModifier) { + if ((forInOrOfStatement.flags & 16384) === 0) { + return grammarErrorOnNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); + } + } + if (forInOrOfStatement.initializer.kind === 226) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -37355,20 +40061,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 212 + var diagnostic = forInOrOfStatement.kind === 214 ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 212 + var diagnostic = forInOrOfStatement.kind === 214 ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 212 + var diagnostic = forInOrOfStatement.kind === 214 ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -37388,15 +40094,18 @@ var ts; else if (accessor.body === undefined && !(ts.getModifierFlags(accessor) & 128)) { return grammarErrorAtPos(ts.getSourceFileOfNode(accessor), accessor.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } + else if (accessor.body && ts.getModifierFlags(accessor) & 128) { + return grammarErrorOnNode(accessor, ts.Diagnostics.An_abstract_accessor_cannot_have_an_implementation); + } else if (accessor.typeParameters) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } else if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, kind === 151 ? + return grammarErrorOnNode(accessor.name, kind === 152 ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - else if (kind === 152) { + else if (kind === 153) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -37415,10 +40124,10 @@ var ts; } } function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 151 ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 152 ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 151 ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 152 ? 1 : 2)) { return ts.getThisParameter(accessor); } } @@ -37433,7 +40142,7 @@ var ts; checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 176) { + if (node.parent.kind === 177) { if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) { return true; } @@ -37449,10 +40158,10 @@ var ts; return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol); } } - else if (node.parent.kind === 227) { + else if (node.parent.kind === 229) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol); } - else if (node.parent.kind === 161) { + else if (node.parent.kind === 162) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol); } } @@ -37463,9 +40172,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 219: + case 221: if (node.label && current.label.text === node.label.text) { - var isMisplacedContinueLabel = node.kind === 214 + var isMisplacedContinueLabel = node.kind === 216 && !ts.isIterationStatement(current.statement, true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -37473,8 +40182,8 @@ var ts; return false; } break; - case 218: - if (node.kind === 215 && !node.label) { + case 220: + if (node.kind === 217 && !node.label) { return false; } break; @@ -37487,13 +40196,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 215 + var message = node.kind === 217 ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 215 + var message = node.kind === 217 ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -37505,7 +40214,7 @@ var ts; if (node !== ts.lastOrUndefined(elements)) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } - if (node.name.kind === 173 || node.name.kind === 172) { + if (node.name.kind === 174 || node.name.kind === 173) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } if (node.initializer) { @@ -37515,11 +40224,11 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return expr.kind === 9 || expr.kind === 8 || - expr.kind === 190 && expr.operator === 37 && + expr.kind === 191 && expr.operator === 37 && expr.operand.kind === 8; } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 212 && node.parent.parent.kind !== 213) { + if (node.parent.parent.kind !== 214 && node.parent.parent.kind !== 215) { if (ts.isInAmbientContext(node)) { if (node.initializer) { if (ts.isConst(node) && !node.type) { @@ -37546,9 +40255,29 @@ var ts; } } } + if (compilerOptions.module !== ts.ModuleKind.ES2015 && compilerOptions.module !== ts.ModuleKind.System && !compilerOptions.noEmit && + !ts.isInAmbientContext(node.parent.parent) && ts.hasModifier(node.parent.parent, 1)) { + checkESModuleMarker(node.name); + } var checkLetConstNames = (ts.isLet(node) || ts.isConst(node)); return checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name); } + function checkESModuleMarker(name) { + if (name.kind === 70) { + if (ts.unescapeIdentifier(name.text) === "__esModule") { + return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules); + } + } + else { + var elements = name.elements; + for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) { + var element = elements_2[_i]; + if (!ts.isOmittedExpression(element)) { + return checkESModuleMarker(element.name); + } + } + } + } function checkGrammarNameInLetOrConstDeclarations(name) { if (name.kind === 70) { if (name.originalKeywordKind === 109) { @@ -37557,8 +40286,8 @@ var ts; } else { var elements = name.elements; - for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) { - var element = elements_2[_i]; + for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) { + var element = elements_3[_i]; if (!ts.isOmittedExpression(element)) { checkGrammarNameInLetOrConstDeclarations(element.name); } @@ -37576,15 +40305,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 208: - case 209: case 210: - case 217: case 211: case 212: - case 213: - return false; case 219: + case 213: + case 214: + case 215: + return false; + case 221: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -37599,6 +40328,13 @@ var ts; } } } + function checkGrammarMetaProperty(node) { + if (node.keywordToken === 93) { + if (node.name.text !== "target") { + return grammarErrorOnNode(node.name, ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, node.name.text, ts.tokenToString(node.keywordToken), "target"); + } + } + } function hasParseDiagnostics(sourceFile) { return sourceFile.parseDiagnostics.length > 0; } @@ -37639,7 +40375,7 @@ var ts; return true; } } - else if (node.parent.kind === 227) { + else if (node.parent.kind === 229) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -37647,7 +40383,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 161) { + else if (node.parent.kind === 162) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -37660,13 +40396,13 @@ var ts; } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 227 || - node.kind === 228 || + if (node.kind === 229 || + node.kind === 230 || + node.kind === 237 || + node.kind === 236 || + node.kind === 243 || + node.kind === 242 || node.kind === 235 || - node.kind === 234 || - node.kind === 241 || - node.kind === 240 || - node.kind === 233 || ts.getModifierFlags(node) & (2 | 1 | 512)) { return false; } @@ -37675,7 +40411,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 205) { + if (ts.isDeclaration(decl) || decl.kind === 207) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -37694,7 +40430,7 @@ var ts; if (!links.hasReportedStatementInAmbientContext && ts.isFunctionLike(node.parent)) { return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } - if (node.parent.kind === 204 || node.parent.kind === 231 || node.parent.kind === 261) { + if (node.parent.kind === 206 || node.parent.kind === 233 || node.parent.kind === 264) { var links_1 = getNodeLinks(node.parent); if (!links_1.hasReportedStatementInAmbientContext) { return links_1.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); @@ -37705,8 +40441,22 @@ var ts; } } function checkGrammarNumericLiteral(node) { - if (node.isOctalLiteral && languageVersion >= 1) { - return grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); + if (node.numericLiteralFlags & 4) { + var diagnosticMessage = void 0; + if (languageVersion >= 1) { + diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; + } + else if (ts.isChildOfNodeWithKind(node, 172)) { + diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; + } + else if (ts.isChildOfNodeWithKind(node, 263)) { + diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; + } + if (diagnosticMessage) { + var withMinus = ts.isPrefixUnaryExpression(node.parent) && node.parent.operator === 37; + var literal = (withMinus ? "-" : "") + "0o" + node.text; + return grammarErrorOnNode(withMinus ? node.parent : node, diagnosticMessage, literal); + } } } function grammarErrorAfterFirstToken(node, message, arg0, arg1, arg2) { @@ -37719,11 +40469,11 @@ var ts; } function getAmbientModules() { var result = []; - for (var sym in globals) { + globals.forEach(function (global, sym) { if (ambientModuleSymbolRegex.test(sym)) { - result.push(globals[sym]); + result.push(global); } - } + }); return result; } } @@ -37731,55 +40481,359 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - ; - var nodeEdgeTraversalMap = ts.createMap((_a = {}, - _a[141] = [ - { name: "left", test: ts.isEntityName }, - { name: "right", test: ts.isIdentifier } - ], - _a[145] = [ - { name: "expression", test: ts.isLeftHandSideExpression } - ], - _a[182] = [ - { name: "type", test: ts.isTypeNode }, - { name: "expression", test: ts.isUnaryExpression } - ], - _a[200] = [ - { name: "expression", test: ts.isExpression }, - { name: "type", test: ts.isTypeNode } - ], - _a[201] = [ - { name: "expression", test: ts.isLeftHandSideExpression } - ], - _a[229] = [ - { name: "decorators", test: ts.isDecorator }, - { name: "modifiers", test: ts.isModifier }, - { name: "name", test: ts.isIdentifier }, - { name: "members", test: ts.isEnumMember } - ], - _a[230] = [ - { name: "decorators", test: ts.isDecorator }, - { name: "modifiers", test: ts.isModifier }, - { name: "name", test: ts.isModuleName }, - { name: "body", test: ts.isModuleBody } - ], - _a[231] = [ - { name: "statements", test: ts.isStatement } - ], - _a[234] = [ - { name: "decorators", test: ts.isDecorator }, - { name: "modifiers", test: ts.isModifier }, - { name: "name", test: ts.isIdentifier }, - { name: "moduleReference", test: ts.isModuleReference } - ], - _a[245] = [ - { name: "expression", test: ts.isExpression, optional: true } - ], - _a[260] = [ - { name: "name", test: ts.isPropertyName }, - { name: "initializer", test: ts.isExpression, optional: true, parenthesize: ts.parenthesizeExpressionForList } - ], - _a)); + function visitNode(node, visitor, test, lift) { + if (node === undefined || visitor === undefined) { + return node; + } + ts.aggregateTransformFlags(node); + var visited = visitor(node); + if (visited === node) { + return node; + } + var visitedNode; + if (visited === undefined) { + return undefined; + } + else if (ts.isArray(visited)) { + visitedNode = (lift || extractSingleNode)(visited); + } + else { + visitedNode = visited; + } + ts.Debug.assertNode(visitedNode, test); + ts.aggregateTransformFlags(visitedNode); + return visitedNode; + } + ts.visitNode = visitNode; + function visitNodes(nodes, visitor, test, start, count) { + if (nodes === undefined || visitor === undefined) { + return nodes; + } + var updated; + var length = nodes.length; + if (start === undefined || start < 0) { + start = 0; + } + if (count === undefined || count > length - start) { + count = length - start; + } + if (start > 0 || count < length) { + updated = ts.createNodeArray([], nodes.hasTrailingComma && start + count === length); + } + for (var i = 0; i < count; i++) { + var node = nodes[i + start]; + ts.aggregateTransformFlags(node); + var visited = node !== undefined ? visitor(node) : undefined; + if (updated !== undefined || visited === undefined || visited !== node) { + if (updated === undefined) { + updated = ts.createNodeArray(nodes.slice(0, i), nodes.hasTrailingComma); + ts.setTextRange(updated, nodes); + } + if (visited) { + if (ts.isArray(visited)) { + for (var _i = 0, visited_1 = visited; _i < visited_1.length; _i++) { + var visitedNode = visited_1[_i]; + ts.Debug.assertNode(visitedNode, test); + ts.aggregateTransformFlags(visitedNode); + updated.push(visitedNode); + } + } + else { + ts.Debug.assertNode(visited, test); + ts.aggregateTransformFlags(visited); + updated.push(visited); + } + } + } + } + return updated || nodes; + } + ts.visitNodes = visitNodes; + function visitLexicalEnvironment(statements, visitor, context, start, ensureUseStrict) { + context.startLexicalEnvironment(); + statements = visitNodes(statements, visitor, ts.isStatement, start); + if (ensureUseStrict && !ts.startsWithUseStrict(statements)) { + statements = ts.setTextRange(ts.createNodeArray([ts.createStatement(ts.createLiteral("use strict"))].concat(statements)), statements); + } + var declarations = context.endLexicalEnvironment(); + return ts.setTextRange(ts.createNodeArray(ts.concatenate(statements, declarations)), statements); + } + ts.visitLexicalEnvironment = visitLexicalEnvironment; + function visitParameterList(nodes, visitor, context, nodesVisitor) { + if (nodesVisitor === void 0) { nodesVisitor = visitNodes; } + context.startLexicalEnvironment(); + var updated = nodesVisitor(nodes, visitor, ts.isParameterDeclaration); + context.suspendLexicalEnvironment(); + return updated; + } + ts.visitParameterList = visitParameterList; + function visitFunctionBody(node, visitor, context) { + context.resumeLexicalEnvironment(); + var updated = visitNode(node, visitor, ts.isConciseBody); + var declarations = context.endLexicalEnvironment(); + if (ts.some(declarations)) { + var block = ts.convertToFunctionBody(updated); + var statements = ts.mergeLexicalEnvironment(block.statements, declarations); + return ts.updateBlock(block, statements); + } + return updated; + } + ts.visitFunctionBody = visitFunctionBody; + function visitEachChild(node, visitor, context, nodesVisitor, tokenVisitor) { + if (nodesVisitor === void 0) { nodesVisitor = visitNodes; } + if (node === undefined) { + return undefined; + } + var kind = node.kind; + if ((kind > 0 && kind <= 141) || kind === 168) { + return node; + } + switch (node.kind) { + case 205: + case 208: + case 199: + case 224: + case 297: + case 246: + return node; + case 142: + return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); + case 143: + return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); + case 159: + return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 160: + return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 154: + return ts.updateCallSignatureDeclaration(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 155: + return ts.updateConstructSignatureDeclaration(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 149: + return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); + case 156: + return ts.updateIndexSignatureDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 145: + return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + case 146: + return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); + case 158: + return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); + case 157: + return ts.updateTypePredicateNode(node, visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 161: + return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); + case 162: + return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor)); + case 163: + return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); + case 164: + return ts.updateTypleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); + case 165: + case 166: + return ts.updateUnionOrIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); + case 167: + throw ts.Debug.fail("not implemented."); + case 169: + return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); + case 170: + return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); + case 171: + return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameter), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); + case 172: + return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); + case 144: + return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); + case 147: + return ts.updatePropertySignature(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + case 148: + return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + case 150: + return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 151: + return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); + case 152: + return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 153: + return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); + case 173: + return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); + case 174: + return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); + case 175: + return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); + case 176: + return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); + case 177: + return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); + case 178: + return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier)); + case 179: + return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); + case 180: + return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); + case 181: + return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); + case 182: + return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); + case 183: + return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); + case 184: + return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); + case 185: + return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 186: + return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 187: + return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); + case 188: + return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); + case 189: + return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); + case 190: + return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); + case 193: + return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression)); + case 191: + return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); + case 192: + return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); + case 194: + return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.whenFalse, visitor, ts.isExpression)); + case 195: + return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); + case 196: + return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); + case 197: + return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); + case 198: + return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); + case 200: + return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); + case 201: + return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); + case 202: + return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); + case 204: + return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); + case 206: + return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + case 207: + return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); + case 209: + return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression)); + case 210: + return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); + case 211: + return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); + case 212: + return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 213: + return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 214: + return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 215: + return ts.updateForOf(node, node.awaitModifier, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 216: + return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); + case 217: + return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); + case 218: + return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); + case 219: + return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 220: + return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); + case 221: + return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 222: + return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); + case 223: + return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); + case 225: + return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + case 226: + return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); + case 227: + return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 228: + return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); + case 231: + return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); + case 232: + return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); + case 233: + return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + case 234: + return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); + case 236: + return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); + case 237: + return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); + case 238: + return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings)); + case 239: + return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); + case 240: + return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); + case 241: + return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); + case 242: + return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); + case 243: + return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); + case 244: + return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); + case 245: + return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); + case 247: + return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); + case 248: + return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); + case 253: + return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); + case 249: + return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); + case 250: + return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); + case 251: + return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); + case 252: + return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); + case 254: + return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); + case 255: + return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); + case 256: + return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); + case 257: + return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + case 258: + return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); + case 259: + return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); + case 260: + return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); + case 261: + return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); + case 262: + return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); + case 263: + return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); + case 264: + return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); + case 295: + return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); + default: + return node; + } + } + ts.visitEachChild = visitEachChild; + function extractSingleNode(nodes) { + ts.Debug.assert(nodes.length <= 1, "Too many nodes written to output."); + return ts.singleOrUndefined(nodes); + } +})(ts || (ts = {})); +(function (ts) { function reduceNode(node, f, initial) { return node ? f(initial, node) : initial; } @@ -37793,41 +40847,45 @@ var ts; var reduceNodes = cbNodeArray ? reduceNodeArray : ts.reduceLeft; var cbNodes = cbNodeArray || cbNode; var kind = node.kind; - if ((kind > 0 && kind <= 140)) { + if ((kind > 0 && kind <= 141)) { return initial; } - if ((kind >= 156 && kind <= 171)) { + if ((kind >= 157 && kind <= 172)) { return initial; } var result = initial; switch (node.kind) { - case 203: - case 206: - case 198: - case 222: - case 293: + case 205: + case 208: + case 199: + case 224: + case 294: break; case 142: - result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.left, cbNode, result); + result = reduceNode(node.right, cbNode, result); break; - case 144: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.type, cbNode, result); - result = reduceNode(node.initializer, cbNode, result); + case 143: + result = reduceNode(node.expression, cbNode, result); break; case 145: - result = reduceNode(node.expression, cbNode, result); - break; - case 147: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 149: + case 146: + result = reduceNode(node.expression, cbNode, result); + break; + case 148: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + case 150: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -37836,53 +40894,48 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 150: - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.body, cbNode, result); - break; case 151: - result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; case 152: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.body, cbNode, result); + break; + case 153: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.body, cbNode, result); break; - case 172: case 173: + case 174: result = reduceNodes(node.elements, cbNodes, result); break; - case 174: + case 175: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 175: + case 176: result = reduceNodes(node.elements, cbNodes, result); break; - case 176: - result = reduceNodes(node.properties, cbNodes, result); - break; case 177: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.properties, cbNodes, result); break; case 178: result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.argumentExpression, cbNode, result); + result = reduceNode(node.name, cbNode, result); break; case 179: result = reduceNode(node.expression, cbNode, result); - result = reduceNodes(node.typeArguments, cbNodes, result); - result = reduceNodes(node.arguments, cbNodes, result); + result = reduceNode(node.argumentExpression, cbNode, result); break; case 180: result = reduceNode(node.expression, cbNode, result); @@ -37890,10 +40943,19 @@ var ts; result = reduceNodes(node.arguments, cbNodes, result); break; case 181: + result = reduceNode(node.expression, cbNode, result); + result = reduceNodes(node.typeArguments, cbNodes, result); + result = reduceNodes(node.arguments, cbNodes, result); + break; + case 182: result = reduceNode(node.tag, cbNode, result); result = reduceNode(node.template, cbNode, result); break; - case 184: + case 183: + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.expression, cbNode, result); + break; + case 185: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); @@ -37901,117 +40963,124 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 185: + case 186: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 183: - case 186: + case 184: case 187: case 188: case 189: - case 195: + case 190: case 196: - case 201: + case 197: + case 202: result = reduceNode(node.expression, cbNode, result); break; - case 190: case 191: + case 192: result = reduceNode(node.operand, cbNode, result); break; - case 192: + case 193: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 193: + case 194: result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.whenTrue, cbNode, result); result = reduceNode(node.whenFalse, cbNode, result); break; - case 194: + case 195: result = reduceNode(node.head, cbNode, result); result = reduceNodes(node.templateSpans, cbNodes, result); break; - case 197: + case 198: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 199: + case 200: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); break; + case 201: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.type, cbNode, result); + break; case 202: + result = reduceNode(node.expression, cbNode, result); + break; + case 204: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.literal, cbNode, result); break; - case 204: + case 206: result = reduceNodes(node.statements, cbNodes, result); break; - case 205: + case 207: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.declarationList, cbNode, result); break; - case 207: + case 209: result = reduceNode(node.expression, cbNode, result); break; - case 208: + case 210: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.thenStatement, cbNode, result); result = reduceNode(node.elseStatement, cbNode, result); break; - case 209: - result = reduceNode(node.statement, cbNode, result); - result = reduceNode(node.expression, cbNode, result); - break; - case 210: - case 217: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.statement, cbNode, result); - break; case 211: + result = reduceNode(node.statement, cbNode, result); + result = reduceNode(node.expression, cbNode, result); + break; + case 212: + case 219: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.statement, cbNode, result); + break; + case 213: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.incrementor, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 212: - case 213: + case 214: + case 215: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 216: - case 220: + case 218: + case 222: result = reduceNode(node.expression, cbNode, result); break; - case 218: + case 220: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.caseBlock, cbNode, result); break; - case 219: + case 221: result = reduceNode(node.label, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 221: + case 223: result = reduceNode(node.tryBlock, cbNode, result); result = reduceNode(node.catchClause, cbNode, result); result = reduceNode(node.finallyBlock, cbNode, result); break; - case 223: + case 225: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 224: + case 226: result = reduceNodes(node.declarations, cbNodes, result); break; - case 225: + case 227: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -38020,7 +41089,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 226: + case 228: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -38028,455 +41097,145 @@ var ts; result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; + case 231: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.members, cbNodes, result); + break; case 232: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.body, cbNode, result); + break; + case 233: + result = reduceNodes(node.statements, cbNodes, result); + break; + case 234: result = reduceNodes(node.clauses, cbNodes, result); break; - case 235: + case 236: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.moduleReference, cbNode, result); + break; + case 237: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.importClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 236: + case 238: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.namedBindings, cbNode, result); break; - case 237: - result = reduceNode(node.name, cbNode, result); - break; - case 238: - case 242: - result = reduceNodes(node.elements, cbNodes, result); - break; case 239: - case 243: - result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); break; case 240: + case 244: + result = reduceNodes(node.elements, cbNodes, result); + break; + case 241: + case 245: + result = reduceNode(node.propertyName, cbNode, result); + result = reduceNode(node.name, cbNode, result); + break; + case 242: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 241: + case 243: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.exportClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 246: + case 247: + result = reduceNode(node.expression, cbNode, result); + break; + case 248: result = reduceNode(node.openingElement, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingElement, cbNode, result); break; - case 247: - case 248: - result = reduceNode(node.tagName, cbNode, result); - result = reduceNodes(node.attributes, cbNodes, result); - break; case 249: + case 250: + result = reduceNode(node.tagName, cbNode, result); + result = reduceNode(node.attributes, cbNode, result); + break; + case 253: + result = reduceNodes(node.properties, cbNodes, result); + break; + case 251: result = reduceNode(node.tagName, cbNode, result); break; - case 250: + case 252: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 251: - result = reduceNode(node.expression, cbNode, result); - break; - case 252: - result = reduceNode(node.expression, cbNode, result); - break; - case 253: - result = reduceNode(node.expression, cbNode, result); case 254: - result = reduceNodes(node.statements, cbNodes, result); + result = reduceNode(node.expression, cbNode, result); break; case 255: - result = reduceNodes(node.types, cbNodes, result); + result = reduceNode(node.expression, cbNode, result); break; case 256: + result = reduceNode(node.expression, cbNode, result); + case 257: + result = reduceNodes(node.statements, cbNodes, result); + break; + case 258: + result = reduceNodes(node.types, cbNodes, result); + break; + case 259: result = reduceNode(node.variableDeclaration, cbNode, result); result = reduceNode(node.block, cbNode, result); break; - case 257: + case 260: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 258: + case 261: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.objectAssignmentInitializer, cbNode, result); break; - case 259: + case 262: result = reduceNode(node.expression, cbNode, result); break; - case 261: + case 263: + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + case 264: result = reduceNodes(node.statements, cbNodes, result); break; - case 294: + case 295: result = reduceNode(node.expression, cbNode, result); break; default: - var edgeTraversalPath = nodeEdgeTraversalMap[kind]; - if (edgeTraversalPath) { - for (var _i = 0, edgeTraversalPath_1 = edgeTraversalPath; _i < edgeTraversalPath_1.length; _i++) { - var edge = edgeTraversalPath_1[_i]; - var value = node[edge.name]; - if (value !== undefined) { - result = ts.isArray(value) - ? reduceNodes(value, cbNodes, result) - : cbNode(result, value); - } - } - } break; } return result; } ts.reduceEachChild = reduceEachChild; - function visitNode(node, visitor, test, optional, lift, parenthesize, parentNode) { - if (node === undefined || visitor === undefined) { - return node; - } - aggregateTransformFlags(node); - var visited = visitor(node); - if (visited === node) { - return node; - } - var visitedNode; - if (visited === undefined) { - if (!optional) { - Debug.failNotOptional(); - } - return undefined; - } - else if (ts.isArray(visited)) { - visitedNode = (lift || extractSingleNode)(visited); - } - else { - visitedNode = visited; - } - if (parenthesize !== undefined) { - visitedNode = parenthesize(visitedNode, parentNode); - } - Debug.assertNode(visitedNode, test); - aggregateTransformFlags(visitedNode); - return visitedNode; - } - ts.visitNode = visitNode; - function visitNodes(nodes, visitor, test, start, count, parenthesize, parentNode) { - if (nodes === undefined) { - return undefined; - } - var updated; - var length = nodes.length; - if (start === undefined || start < 0) { - start = 0; - } - if (count === undefined || count > length - start) { - count = length - start; - } - if (start > 0 || count < length) { - updated = ts.createNodeArray([], undefined, nodes.hasTrailingComma && start + count === length); - } - for (var i = 0; i < count; i++) { - var node = nodes[i + start]; - aggregateTransformFlags(node); - var visited = node !== undefined ? visitor(node) : undefined; - if (updated !== undefined || visited === undefined || visited !== node) { - if (updated === undefined) { - updated = ts.createNodeArray(nodes.slice(0, i), nodes, nodes.hasTrailingComma); - } - if (visited) { - if (ts.isArray(visited)) { - for (var _i = 0, visited_1 = visited; _i < visited_1.length; _i++) { - var visitedNode = visited_1[_i]; - visitedNode = parenthesize - ? parenthesize(visitedNode, parentNode) - : visitedNode; - Debug.assertNode(visitedNode, test); - aggregateTransformFlags(visitedNode); - updated.push(visitedNode); - } - } - else { - var visitedNode = parenthesize - ? parenthesize(visited, parentNode) - : visited; - Debug.assertNode(visitedNode, test); - aggregateTransformFlags(visitedNode); - updated.push(visitedNode); - } - } - } - } - return updated || nodes; - } - ts.visitNodes = visitNodes; - function visitLexicalEnvironment(statements, visitor, context, start, ensureUseStrict) { - context.startLexicalEnvironment(); - statements = visitNodes(statements, visitor, ts.isStatement, start); - if (ensureUseStrict && !ts.startsWithUseStrict(statements)) { - statements = ts.createNodeArray([ts.createStatement(ts.createLiteral("use strict"))].concat(statements), statements); - } - var declarations = context.endLexicalEnvironment(); - return ts.createNodeArray(ts.concatenate(statements, declarations), statements); - } - ts.visitLexicalEnvironment = visitLexicalEnvironment; - function visitParameterList(nodes, visitor, context) { - context.startLexicalEnvironment(); - var updated = visitNodes(nodes, visitor, ts.isParameterDeclaration); - context.suspendLexicalEnvironment(); - return updated; - } - ts.visitParameterList = visitParameterList; - function visitFunctionBody(node, visitor, context) { - context.resumeLexicalEnvironment(); - var updated = visitNode(node, visitor, ts.isConciseBody); - var declarations = context.endLexicalEnvironment(); - if (ts.some(declarations)) { - var block = ts.convertToFunctionBody(updated); - var statements = mergeLexicalEnvironment(block.statements, declarations); - return ts.updateBlock(block, statements); - } - return updated; - } - ts.visitFunctionBody = visitFunctionBody; - function visitEachChild(node, visitor, context) { - if (node === undefined) { - return undefined; - } - var kind = node.kind; - if ((kind > 0 && kind <= 140)) { - return node; - } - if ((kind >= 156 && kind <= 171)) { - return node; - } - switch (node.kind) { - case 203: - case 206: - case 198: - case 222: - return node; - case 142: - return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); - case 144: - return ts.updateParameter(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), node.dotDotDotToken, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true)); - case 147: - return ts.updateProperty(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true)); - case 149: - return ts.updateMethod(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, true), visitFunctionBody(node.body, visitor, context)); - case 150: - return ts.updateConstructor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context), visitFunctionBody(node.body, visitor, context)); - case 151: - return ts.updateGetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, true), visitFunctionBody(node.body, visitor, context)); - case 152: - return ts.updateSetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context), visitFunctionBody(node.body, visitor, context)); - case 172: - return ts.updateObjectBindingPattern(node, visitNodes(node.elements, visitor, ts.isBindingElement)); - case 173: - return ts.updateArrayBindingPattern(node, visitNodes(node.elements, visitor, ts.isArrayBindingElement)); - case 174: - return ts.updateBindingElement(node, node.dotDotDotToken, visitNode(node.propertyName, visitor, ts.isPropertyName, true), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression, true)); - case 175: - return ts.updateArrayLiteral(node, visitNodes(node.elements, visitor, ts.isExpression)); - case 176: - return ts.updateObjectLiteral(node, visitNodes(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 177: - return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier)); - case 178: - return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 179: - return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression)); - case 180: - return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression)); - case 181: - return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); - case 183: - return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); - case 184: - return ts.updateFunctionExpression(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, true), visitFunctionBody(node.body, visitor, context)); - case 185: - return ts.updateArrowFunction(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, true), visitFunctionBody(node.body, visitor, context)); - case 186: - return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); - case 187: - return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); - case 188: - return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); - case 189: - return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); - case 192: - return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression)); - case 190: - return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 191: - return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 193: - return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.whenFalse, visitor, ts.isExpression)); - case 194: - return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), visitNodes(node.templateSpans, visitor, ts.isTemplateSpan)); - case 195: - return ts.updateYield(node, visitNode(node.expression, visitor, ts.isExpression)); - case 196: - return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); - case 197: - return ts.updateClassExpression(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier, true), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), visitNodes(node.members, visitor, ts.isClassElement)); - case 199: - return ts.updateExpressionWithTypeArguments(node, visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 202: - return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); - case 204: - return ts.updateBlock(node, visitNodes(node.statements, visitor, ts.isStatement)); - case 205: - return ts.updateVariableStatement(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 207: - return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression)); - case 208: - return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, false, liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, true, liftToBlock)); - case 209: - return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); - case 210: - return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock)); - case 211: - return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock)); - case 212: - return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock)); - case 213: - return ts.updateForOf(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock)); - case 214: - return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier, true)); - case 215: - return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier, true)); - case 216: - return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression, true)); - case 217: - return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock)); - case 218: - return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); - case 219: - return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock)); - case 220: - return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); - case 221: - return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause, true), visitNode(node.finallyBlock, visitor, ts.isBlock, true)); - case 223: - return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true)); - case 224: - return ts.updateVariableDeclarationList(node, visitNodes(node.declarations, visitor, ts.isVariableDeclaration)); - case 225: - return ts.updateFunctionDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, true), visitFunctionBody(node.body, visitor, context)); - case 226: - return ts.updateClassDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier, true), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), visitNodes(node.members, visitor, ts.isClassElement)); - case 232: - return ts.updateCaseBlock(node, visitNodes(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 235: - return ts.updateImportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause, true), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 236: - return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier, true), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings, true)); - case 237: - return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 238: - return ts.updateNamedImports(node, visitNodes(node.elements, visitor, ts.isImportSpecifier)); - case 239: - return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier, true), visitNode(node.name, visitor, ts.isIdentifier)); - case 240: - return ts.updateExportAssignment(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); - case 241: - return ts.updateExportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports, true), visitNode(node.moduleSpecifier, visitor, ts.isExpression, true)); - case 242: - return ts.updateNamedExports(node, visitNodes(node.elements, visitor, ts.isExportSpecifier)); - case 243: - return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier, true), visitNode(node.name, visitor, ts.isIdentifier)); - case 246: - return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), visitNodes(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 247: - return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNodes(node.attributes, visitor, ts.isJsxAttributeLike)); - case 248: - return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNodes(node.attributes, visitor, ts.isJsxAttributeLike)); - case 249: - return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 250: - return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 251: - return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); - case 252: - return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 253: - return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.statements, visitor, ts.isStatement)); - case 254: - return ts.updateDefaultClause(node, visitNodes(node.statements, visitor, ts.isStatement)); - case 255: - return ts.updateHeritageClause(node, visitNodes(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 256: - return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); - case 257: - return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 258: - return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 259: - return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); - case 261: - return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); - case 294: - return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - default: - var updated = void 0; - var edgeTraversalPath = nodeEdgeTraversalMap[kind]; - if (edgeTraversalPath) { - for (var _i = 0, edgeTraversalPath_2 = edgeTraversalPath; _i < edgeTraversalPath_2.length; _i++) { - var edge = edgeTraversalPath_2[_i]; - var value = node[edge.name]; - if (value !== undefined) { - var visited = ts.isArray(value) - ? visitNodes(value, visitor, edge.test, 0, value.length, edge.parenthesize, node) - : visitNode(value, visitor, edge.test, edge.optional, edge.lift, edge.parenthesize, node); - if (updated !== undefined || visited !== value) { - if (updated === undefined) { - updated = ts.getMutableClone(node); - } - if (visited !== value) { - updated[edge.name] = visited; - } - } - } - } - } - return updated ? ts.updateNode(updated, node) : node; - } - } - ts.visitEachChild = visitEachChild; function mergeLexicalEnvironment(statements, declarations) { if (!ts.some(declarations)) { return statements; } return ts.isNodeArray(statements) - ? ts.createNodeArray(ts.concatenate(statements, declarations), statements) + ? ts.setTextRange(ts.createNodeArray(ts.concatenate(statements, declarations)), statements) : ts.addRange(statements, declarations); } ts.mergeLexicalEnvironment = mergeLexicalEnvironment; - function mergeFunctionBodyLexicalEnvironment(body, declarations) { - if (body && declarations !== undefined && declarations.length > 0) { - if (ts.isBlock(body)) { - return ts.updateBlock(body, ts.createNodeArray(ts.concatenate(body.statements, declarations), body.statements)); - } - else { - return ts.createBlock(ts.createNodeArray([ts.createReturn(body, body)].concat(declarations), body), body, true); - } - } - return body; - } - ts.mergeFunctionBodyLexicalEnvironment = mergeFunctionBodyLexicalEnvironment; function liftToBlock(nodes) { Debug.assert(ts.every(nodes, ts.isStatement), "Cannot lift nodes to a Block."); return ts.singleOrUndefined(nodes) || ts.createBlock(nodes); } ts.liftToBlock = liftToBlock; - function extractSingleNode(nodes) { - Debug.assert(nodes.length <= 1, "Too many nodes written to output."); - return ts.singleOrUndefined(nodes); - } function aggregateTransformFlags(node) { aggregateTransformFlagsForNode(node); return node; @@ -38507,7 +41266,7 @@ var ts; return subtreeFlags; } function aggregateTransformFlagsForSubtree(node) { - if (ts.hasModifier(node, 2) || ts.isTypeNode(node)) { + if (ts.hasModifier(node, 2) || (ts.isTypeNode(node) && node.kind !== 200)) { return 0; } return reduceEachChild(node, 0, aggregateTransformFlagsForChildNode, aggregateTransformFlagsForChildNodes); @@ -38520,9 +41279,6 @@ var ts; } var Debug; (function (Debug) { - Debug.failNotOptional = Debug.shouldAssert(1) - ? function (message) { return Debug.assert(false, message || "Node not optional."); } - : ts.noop; Debug.failBadSyntaxKind = Debug.shouldAssert(1) ? function (node, message) { return Debug.assert(false, message || "Unexpected node.", function () { return "Node " + ts.formatSyntaxKind(node.kind) + " was unexpected."; }); } : ts.noop; @@ -38555,16 +41311,20 @@ var ts; } } })(Debug = ts.Debug || (ts.Debug = {})); - var _a; })(ts || (ts = {})); var ts; (function (ts) { + var FlattenLevel; + (function (FlattenLevel) { + FlattenLevel[FlattenLevel["All"] = 0] = "All"; + FlattenLevel[FlattenLevel["ObjectRest"] = 1] = "ObjectRest"; + })(FlattenLevel = ts.FlattenLevel || (ts.FlattenLevel = {})); function flattenDestructuringAssignment(node, visitor, context, level, needsValue, createAssignmentCallback) { var location = node; var value; if (ts.isDestructuringAssignment(node)) { value = node.right; - while (ts.isEmptyObjectLiteralOrArrayLiteral(node.left)) { + while (ts.isEmptyArrayLiteral(node.left) || ts.isEmptyObjectLiteral(node.left)) { if (ts.isDestructuringAssignment(value)) { location = node = value; value = node.right; @@ -38578,6 +41338,7 @@ var ts; var flattenContext = { context: context, level: level, + downlevelIteration: context.getCompilerOptions().downlevelIteration, hoistTempVariables: true, emitExpression: emitExpression, emitBindingOrAssignment: emitBindingOrAssignment, @@ -38612,7 +41373,7 @@ var ts; ts.Debug.assertNode(target, createAssignmentCallback ? ts.isIdentifier : ts.isExpression); var expression = createAssignmentCallback ? createAssignmentCallback(target, value, location) - : ts.createAssignment(ts.visitNode(target, visitor, ts.isExpression), value, location); + : ts.setTextRange(ts.createAssignment(ts.visitNode(target, visitor, ts.isExpression), value), location); expression.original = original; emitExpression(expression); } @@ -38625,6 +41386,7 @@ var ts; var flattenContext = { context: context, level: level, + downlevelIteration: context.getCompilerOptions().downlevelIteration, hoistTempVariables: hoistTempVariables, emitExpression: emitExpression, emitBindingOrAssignment: emitBindingOrAssignment, @@ -38650,10 +41412,11 @@ var ts; } } for (var _i = 0, pendingDeclarations_1 = pendingDeclarations; _i < pendingDeclarations_1.length; _i++) { - var _a = pendingDeclarations_1[_i], pendingExpressions_1 = _a.pendingExpressions, name_31 = _a.name, value = _a.value, location_2 = _a.location, original = _a.original; - var variable = ts.createVariableDeclaration(name_31, undefined, pendingExpressions_1 ? ts.inlineExpressions(ts.append(pendingExpressions_1, value)) : value, location_2); + var _a = pendingDeclarations_1[_i], pendingExpressions_1 = _a.pendingExpressions, name = _a.name, value = _a.value, location = _a.location, original = _a.original; + var variable = ts.createVariableDeclaration(name, undefined, pendingExpressions_1 ? ts.inlineExpressions(ts.append(pendingExpressions_1, value)) : value); variable.original = original; - if (ts.isIdentifier(name_31)) { + ts.setTextRange(variable, location); + if (ts.isIdentifier(name)) { ts.setEmitFlags(variable, 64); } ts.aggregateTransformFlags(variable); @@ -38741,7 +41504,12 @@ var ts; function flattenArrayBindingOrAssignmentPattern(flattenContext, parent, pattern, value, location) { var elements = ts.getElementsOfBindingOrAssignmentPattern(pattern); var numElements = elements.length; - if (numElements !== 1 && (flattenContext.level < 1 || numElements === 0)) { + if (flattenContext.level < 1 && flattenContext.downlevelIteration) { + value = ensureIdentifier(flattenContext, ts.createReadHelper(flattenContext.context, value, numElements > 0 && ts.getRestIndicatorOfBindingOrAssignmentElement(elements[numElements - 1]) + ? undefined + : numElements, location), false, location); + } + else if (numElements !== 1 && (flattenContext.level < 1 || numElements === 0)) { var reuseIdentifierExpressions = !ts.isDeclarationBindingElement(parent) || numElements !== 0; value = ensureIdentifier(flattenContext, value, reuseIdentifierExpressions, location); } @@ -38799,8 +41567,8 @@ var ts; return ts.createElementAccess(value, argumentExpression); } else { - var name_32 = ts.createIdentifier(ts.unescapeIdentifier(propertyName.text)); - return ts.createPropertyAccess(value, name_32); + var name = ts.createIdentifier(ts.unescapeIdentifier(propertyName.text)); + return ts.createPropertyAccess(value, name); } } function ensureIdentifier(flattenContext, value, reuseIdentifierExpressions, location) { @@ -38811,7 +41579,7 @@ var ts; var temp = ts.createTempVariable(undefined); if (flattenContext.hoistTempVariables) { flattenContext.context.hoistVariableDeclaration(temp); - flattenContext.emitExpression(ts.createAssignment(temp, value, location)); + flattenContext.emitExpression(ts.setTextRange(ts.createAssignment(temp, value), location)); } else { flattenContext.emitBindingOrAssignment(temp, value, location, undefined); @@ -38842,7 +41610,7 @@ var ts; var restHelper = { name: "typescript:rest", scoped: false, - text: "\n var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\n t[p[i]] = s[p[i]];\n return t;\n };" + text: "\n var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\n t[p[i]] = s[p[i]];\n return t;\n };" }; function createRestCall(context, value, elements, computedTempVariables, location) { context.requestEmitHelper(restHelper); @@ -38861,12 +41629,21 @@ var ts; } } } - return ts.createCall(ts.getHelperName("__rest"), undefined, [value, ts.createArrayLiteral(propertyNames, location)]); + return ts.createCall(ts.getHelperName("__rest"), undefined, [ + value, + ts.setTextRange(ts.createArrayLiteral(propertyNames), location) + ]); } })(ts || (ts = {})); var ts; (function (ts) { var USE_NEW_TYPE_METADATA_FORMAT = false; + var TypeScriptSubstitutionFlags; + (function (TypeScriptSubstitutionFlags) { + TypeScriptSubstitutionFlags[TypeScriptSubstitutionFlags["ClassAliases"] = 1] = "ClassAliases"; + TypeScriptSubstitutionFlags[TypeScriptSubstitutionFlags["NamespaceExports"] = 2] = "NamespaceExports"; + TypeScriptSubstitutionFlags[TypeScriptSubstitutionFlags["NonQualifiedEnumMembers"] = 8] = "NonQualifiedEnumMembers"; + })(TypeScriptSubstitutionFlags || (TypeScriptSubstitutionFlags = {})); function transformTypeScript(context) { var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration; var resolver = context.getEmitResolver(); @@ -38877,8 +41654,8 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(177); context.enableSubstitution(178); + context.enableSubstitution(179); var currentSourceFile; var currentNamespace; var currentNamespaceContainerName; @@ -38911,15 +41688,15 @@ var ts; } function onBeforeVisitNode(node) { switch (node.kind) { - case 261: - case 232: - case 231: - case 204: + case 264: + case 234: + case 233: + case 206: currentScope = node; currentScopeFirstDeclarationsOfName = undefined; break; - case 226: - case 225: + case 228: + case 227: if (ts.hasModifier(node, 2)) { break; } @@ -38944,13 +41721,13 @@ var ts; } function sourceElementVisitorWorker(node) { switch (node.kind) { - case 235: + case 237: return visitImportDeclaration(node); - case 234: + case 236: return visitImportEqualsDeclaration(node); - case 240: + case 242: return visitExportAssignment(node); - case 241: + case 243: return visitExportDeclaration(node); default: return visitorWorker(node); @@ -38960,11 +41737,11 @@ var ts; return saveStateAndInvoke(node, namespaceElementVisitorWorker); } function namespaceElementVisitorWorker(node) { - if (node.kind === 241 || - node.kind === 235 || - node.kind === 236 || - (node.kind === 234 && - node.moduleReference.kind === 245)) { + if (node.kind === 243 || + node.kind === 237 || + node.kind === 238 || + (node.kind === 236 && + node.moduleReference.kind === 247)) { return undefined; } else if (node.transformFlags & 1 || ts.hasModifier(node, 1)) { @@ -38980,15 +41757,15 @@ var ts; } function classElementVisitorWorker(node) { switch (node.kind) { - case 150: - return undefined; - case 147: - case 155: case 151: + return undefined; + case 148: + case 156: case 152: - case 149: + case 153: + case 150: return visitorWorker(node); - case 203: + case 205: return node; default: ts.Debug.failBadSyntaxKind(node); @@ -39019,23 +41796,22 @@ var ts; case 75: case 123: case 130: - case 162: case 163: - case 161: - case 156: - case 143: + case 164: + case 162: + case 157: + case 144: case 118: case 121: - case 134: + case 135: case 132: case 129: case 104: - case 135: - case 159: - case 158: + case 136: case 160: - case 157: - case 164: + case 159: + case 161: + case 158: case 165: case 166: case 167: @@ -39043,56 +41819,58 @@ var ts; case 169: case 170: case 171: - case 155: - case 145: - case 228: - case 147: - case 150: - return visitConstructor(node); - case 227: - return ts.createNotEmittedStatement(node); - case 226: - return visitClassDeclaration(node); - case 197: - return visitClassExpression(node); - case 255: - return visitHeritageClause(node); - case 199: - return visitExpressionWithTypeArguments(node); - case 149: - return visitMethodDeclaration(node); - case 151: - return visitGetAccessor(node); - case 152: - return visitSetAccessor(node); - case 225: - return visitFunctionDeclaration(node); - case 184: - return visitFunctionExpression(node); - case 185: - return visitArrowFunction(node); - case 144: - return visitParameter(node); - case 183: - return visitParenthesizedExpression(node); - case 182: - case 200: - return visitAssertionExpression(node); - case 179: - return visitCallExpression(node); - case 180: - return visitNewExpression(node); - case 201: - return visitNonNullExpression(node); - case 229: - return visitEnumDeclaration(node); - case 205: - return visitVariableStatement(node); - case 223: - return visitVariableDeclaration(node); + case 172: + case 156: + case 146: case 230: + case 148: + return undefined; + case 151: + return visitConstructor(node); + case 229: + return ts.createNotEmittedStatement(node); + case 228: + return visitClassDeclaration(node); + case 198: + return visitClassExpression(node); + case 258: + return visitHeritageClause(node); + case 200: + return visitExpressionWithTypeArguments(node); + case 150: + return visitMethodDeclaration(node); + case 152: + return visitGetAccessor(node); + case 153: + return visitSetAccessor(node); + case 227: + return visitFunctionDeclaration(node); + case 185: + return visitFunctionExpression(node); + case 186: + return visitArrowFunction(node); + case 145: + return visitParameter(node); + case 184: + return visitParenthesizedExpression(node); + case 183: + case 201: + return visitAssertionExpression(node); + case 180: + return visitCallExpression(node); + case 181: + return visitNewExpression(node); + case 202: + return visitNonNullExpression(node); + case 231: + return visitEnumDeclaration(node); + case 207: + return visitVariableStatement(node); + case 225: + return visitVariableDeclaration(node); + case 232: return visitModuleDeclaration(node); - case 234: + case 236: return visitImportEqualsDeclaration(node); default: ts.Debug.failBadSyntaxKind(node); @@ -39100,7 +41878,8 @@ var ts; } } function visitSourceFile(node) { - var alwaysStrict = compilerOptions.alwaysStrict && !(ts.isExternalModule(node) && moduleKind === ts.ModuleKind.ES2015); + var alwaysStrict = (compilerOptions.alwaysStrict === undefined ? compilerOptions.strict : compilerOptions.alwaysStrict) && + !(ts.isExternalModule(node) && moduleKind === ts.ModuleKind.ES2015); return ts.updateSourceFileNode(node, ts.visitLexicalEnvironment(node.statements, sourceElementVisitor, context, 0, alwaysStrict)); } function shouldEmitDecorateCallForClass(node) { @@ -39152,11 +41931,12 @@ var ts; return ts.singleOrMany(statements); } function createClassDeclarationHeadWithoutDecorators(node, name, hasExtendsClause, hasStaticProperties) { - var classDeclaration = ts.createClassDeclaration(undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), name, undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), transformClassMembers(node, hasExtendsClause), node); + var classDeclaration = ts.createClassDeclaration(undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), name, undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), transformClassMembers(node, hasExtendsClause)); var emitFlags = ts.getEmitFlags(node); if (hasStaticProperties) { emitFlags |= 32; } + ts.setTextRange(classDeclaration, node); ts.setOriginalNode(classDeclaration, node); ts.setEmitFlags(classDeclaration, emitFlags); return classDeclaration; @@ -39167,10 +41947,14 @@ var ts; var declName = ts.getLocalName(node, false, true); var heritageClauses = ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause); var members = transformClassMembers(node, hasExtendsClause); - var classExpression = ts.createClassExpression(undefined, name, undefined, heritageClauses, members, location); + var classExpression = ts.createClassExpression(undefined, name, undefined, heritageClauses, members); ts.setOriginalNode(classExpression, node); - var statement = ts.createLetStatement(declName, classAlias ? ts.createAssignment(classAlias, classExpression) : classExpression, location); + ts.setTextRange(classExpression, location); + var statement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration(declName, undefined, classAlias ? ts.createAssignment(classAlias, classExpression) : classExpression) + ], 1)); ts.setOriginalNode(statement, node); + ts.setTextRange(statement, location); ts.setCommentRange(statement, node); return statement; } @@ -39178,7 +41962,9 @@ var ts; var staticProperties = getInitializedProperties(node, true); var heritageClauses = ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause); var members = transformClassMembers(node, ts.some(heritageClauses, function (c) { return c.token === 84; })); - var classExpression = ts.setOriginalNode(ts.createClassExpression(undefined, node.name, undefined, heritageClauses, members, node), node); + var classExpression = ts.createClassExpression(undefined, node.name, undefined, heritageClauses, members); + ts.setOriginalNode(classExpression, node); + ts.setTextRange(classExpression, node); if (staticProperties.length > 0) { var expressions = []; var temp = ts.createTempVariable(hoistVariableDeclaration); @@ -39201,7 +41987,7 @@ var ts; members.push(constructor); } ts.addRange(members, ts.visitNodes(node.members, classElementVisitor, ts.isClassElement)); - return ts.createNodeArray(members, node.members); + return ts.setTextRange(ts.createNodeArray(members), node.members); } function transformConstructor(node, hasExtendsClause) { var hasInstancePropertyWithInitializer = ts.forEach(node.members, isInstanceInitializedProperty); @@ -39212,7 +41998,7 @@ var ts; } var parameters = transformConstructorParameters(constructor); var body = transformConstructorBody(node, constructor, hasExtendsClause); - return ts.startOnNewLine(ts.setOriginalNode(ts.createConstructor(undefined, undefined, parameters, body, constructor || node), constructor)); + return ts.startOnNewLine(ts.setOriginalNode(ts.setTextRange(ts.createConstructor(undefined, undefined, parameters, body), constructor || node), constructor)); } function transformConstructorParameters(constructor) { return ts.visitParameterList(constructor && constructor.parameters, visitor, context) @@ -39235,18 +42021,18 @@ var ts; if (constructor) { ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, indexOfFirstStatement)); } - ts.addRange(statements, endLexicalEnvironment()); - return ts.createBlock(ts.createNodeArray(statements, constructor ? constructor.body.statements : node.members), constructor ? constructor.body : undefined, true); + statements = ts.mergeLexicalEnvironment(statements, endLexicalEnvironment()); + return ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), constructor ? constructor.body.statements : node.members), true), constructor ? constructor.body : undefined); } function addPrologueDirectivesAndInitialSuperCall(ctor, result) { if (ctor.body) { var statements = ctor.body.statements; - var index = ts.addPrologueDirectives(result, statements, false, visitor); + var index = ts.addPrologue(result, statements, false, visitor); if (index === statements.length) { return index; } var statement = statements[index]; - if (statement.kind === 207 && ts.isSuperCall(statement.expression)) { + if (statement.kind === 209 && ts.isSuperCall(statement.expression)) { result.push(ts.visitNode(statement, visitor, ts.isStatement)); return index + 1; } @@ -39268,7 +42054,7 @@ var ts; ts.setEmitFlags(propertyName, 1536 | 48); var localName = ts.getMutableClone(name); ts.setEmitFlags(localName, 1536); - return ts.startOnNewLine(ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createThis(), propertyName, node.name), localName), ts.moveRangePos(node, -1))); + return ts.startOnNewLine(ts.setTextRange(ts.createStatement(ts.createAssignment(ts.setTextRange(ts.createPropertyAccess(ts.createThis(), propertyName), node.name), localName)), ts.moveRangePos(node, -1))); } function getInitializedProperties(node, isStatic) { return ts.filter(node.members, isStatic ? isStaticInitializedProperty : isInstanceInitializedProperty); @@ -39280,13 +42066,13 @@ var ts; return isInitializedProperty(member, false); } function isInitializedProperty(member, isStatic) { - return member.kind === 147 + return member.kind === 148 && isStatic === ts.hasModifier(member, 32) && member.initializer !== undefined; } function addInitializedPropertyStatements(statements, properties, receiver) { - for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) { - var property = properties_7[_i]; + for (var _i = 0, properties_9 = properties; _i < properties_9.length; _i++) { + var property = properties_9[_i]; var statement = ts.createStatement(transformInitializedProperty(property, receiver)); ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property)); ts.setCommentRange(statement, property); @@ -39295,8 +42081,8 @@ var ts; } function generateInitializedPropertyExpressions(properties, receiver) { var expressions = []; - for (var _i = 0, properties_8 = properties; _i < properties_8.length; _i++) { - var property = properties_8[_i]; + for (var _i = 0, properties_10 = properties; _i < properties_10.length; _i++) { + var property = properties_10[_i]; var expression = transformInitializedProperty(property, receiver); expression.startsOnNewLine = true; ts.setSourceMapRange(expression, ts.moveRangePastModifiers(property)); @@ -39353,12 +42139,12 @@ var ts; } function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 151: case 152: + case 153: return getAllDecoratorsOfAccessors(node, member); - case 149: + case 150: return getAllDecoratorsOfMethod(member); - case 147: + case 148: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -39369,10 +42155,11 @@ var ts; return undefined; } var _a = ts.getAllAccessorDeclarations(node.members, accessor), firstAccessor = _a.firstAccessor, secondAccessor = _a.secondAccessor, setAccessor = _a.setAccessor; - if (accessor !== firstAccessor) { + var firstAccessorWithDecorators = firstAccessor.decorators ? firstAccessor : secondAccessor && secondAccessor.decorators ? secondAccessor : undefined; + if (!firstAccessorWithDecorators || accessor !== firstAccessorWithDecorators) { return undefined; } - var decorators = firstAccessor.decorators || (secondAccessor && secondAccessor.decorators); + var decorators = firstAccessorWithDecorators.decorators; var parameters = getDecoratorsOfParameters(setAccessor); if (!decorators && !parameters) { return undefined; @@ -39397,14 +42184,14 @@ var ts; } return { decorators: decorators }; } - function transformAllDecoratorsOfDeclaration(node, allDecorators) { + function transformAllDecoratorsOfDeclaration(node, container, allDecorators) { if (!allDecorators) { return undefined; } var decoratorExpressions = []; ts.addRange(decoratorExpressions, ts.map(allDecorators.decorators, transformDecorator)); ts.addRange(decoratorExpressions, ts.flatMap(allDecorators.parameters, transformDecoratorsOfParameter)); - addTypeMetadata(node, decoratorExpressions); + addTypeMetadata(node, container, decoratorExpressions); return decoratorExpressions; } function addClassElementDecorationStatements(statements, node, isStatic) { @@ -39429,14 +42216,14 @@ var ts; } function generateClassElementDecorationExpression(node, member) { var allDecorators = getAllDecoratorsOfClassElement(node, member); - var decoratorExpressions = transformAllDecoratorsOfDeclaration(member, allDecorators); + var decoratorExpressions = transformAllDecoratorsOfDeclaration(member, node, allDecorators); if (!decoratorExpressions) { return undefined; } var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, true); var descriptor = languageVersion > 0 - ? member.kind === 147 + ? member.kind === 148 ? ts.createVoidZero() : ts.createNull() : undefined; @@ -39452,7 +42239,7 @@ var ts; } function generateConstructorDecorationExpression(node) { var allDecorators = getAllDecoratorsOfConstructor(node); - var decoratorExpressions = transformAllDecoratorsOfDeclaration(node, allDecorators); + var decoratorExpressions = transformAllDecoratorsOfDeclaration(node, node, allDecorators); if (!decoratorExpressions) { return undefined; } @@ -39480,90 +42267,83 @@ var ts; } return expressions; } - function addTypeMetadata(node, decoratorExpressions) { + function addTypeMetadata(node, container, decoratorExpressions) { if (USE_NEW_TYPE_METADATA_FORMAT) { - addNewTypeMetadata(node, decoratorExpressions); + addNewTypeMetadata(node, container, decoratorExpressions); } else { - addOldTypeMetadata(node, decoratorExpressions); + addOldTypeMetadata(node, container, decoratorExpressions); } } - function addOldTypeMetadata(node, decoratorExpressions) { + function addOldTypeMetadata(node, container, decoratorExpressions) { if (compilerOptions.emitDecoratorMetadata) { if (shouldAddTypeMetadata(node)) { decoratorExpressions.push(createMetadataHelper(context, "design:type", serializeTypeOfNode(node))); } if (shouldAddParamTypesMetadata(node)) { - decoratorExpressions.push(createMetadataHelper(context, "design:paramtypes", serializeParameterTypesOfNode(node))); + decoratorExpressions.push(createMetadataHelper(context, "design:paramtypes", serializeParameterTypesOfNode(node, container))); } if (shouldAddReturnTypeMetadata(node)) { decoratorExpressions.push(createMetadataHelper(context, "design:returntype", serializeReturnTypeOfNode(node))); } } } - function addNewTypeMetadata(node, decoratorExpressions) { + function addNewTypeMetadata(node, container, decoratorExpressions) { if (compilerOptions.emitDecoratorMetadata) { var properties = void 0; if (shouldAddTypeMetadata(node)) { (properties || (properties = [])).push(ts.createPropertyAssignment("type", ts.createArrowFunction(undefined, undefined, [], undefined, ts.createToken(35), serializeTypeOfNode(node)))); } if (shouldAddParamTypesMetadata(node)) { - (properties || (properties = [])).push(ts.createPropertyAssignment("paramTypes", ts.createArrowFunction(undefined, undefined, [], undefined, ts.createToken(35), serializeParameterTypesOfNode(node)))); + (properties || (properties = [])).push(ts.createPropertyAssignment("paramTypes", ts.createArrowFunction(undefined, undefined, [], undefined, ts.createToken(35), serializeParameterTypesOfNode(node, container)))); } if (shouldAddReturnTypeMetadata(node)) { (properties || (properties = [])).push(ts.createPropertyAssignment("returnType", ts.createArrowFunction(undefined, undefined, [], undefined, ts.createToken(35), serializeReturnTypeOfNode(node)))); } if (properties) { - decoratorExpressions.push(createMetadataHelper(context, "design:typeinfo", ts.createObjectLiteral(properties, undefined, true))); + decoratorExpressions.push(createMetadataHelper(context, "design:typeinfo", ts.createObjectLiteral(properties, true))); } } } function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 149 - || kind === 151 + return kind === 150 || kind === 152 - || kind === 147; + || kind === 153 + || kind === 148; } function shouldAddReturnTypeMetadata(node) { - return node.kind === 149; + return node.kind === 150; } function shouldAddParamTypesMetadata(node) { - var kind = node.kind; - return kind === 226 - || kind === 197 - || kind === 149 - || kind === 151 - || kind === 152; + switch (node.kind) { + case 228: + case 198: + return ts.getFirstConstructorWithBody(node) !== undefined; + case 150: + case 152: + case 153: + return true; + } + return false; } function serializeTypeOfNode(node) { switch (node.kind) { - case 147: - case 144: - case 151: - return serializeTypeNode(node.type); + case 148: + case 145: case 152: + return serializeTypeNode(node.type); + case 153: return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node)); - case 226: - case 197: - case 149: + case 228: + case 198: + case 150: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); } } - function getRestParameterElementType(node) { - if (node && node.kind === 162) { - return node.elementType; - } - else if (node && node.kind === 157) { - return ts.singleOrUndefined(node.typeArguments); - } - else { - return undefined; - } - } - function serializeParameterTypesOfNode(node) { + function serializeParameterTypesOfNode(node, container) { var valueDeclaration = ts.isClassLike(node) ? ts.getFirstConstructorWithBody(node) : ts.isFunctionLike(node) && ts.nodeIsPresent(node.body) @@ -39571,7 +42351,7 @@ var ts; : undefined; var expressions = []; if (valueDeclaration) { - var parameters = valueDeclaration.parameters; + var parameters = getParametersOfDecoratedDeclaration(valueDeclaration, container); var numParameters = parameters.length; for (var i = 0; i < numParameters; i++) { var parameter = parameters[i]; @@ -39579,7 +42359,7 @@ var ts; continue; } if (parameter.dotDotDotToken) { - expressions.push(serializeTypeNode(getRestParameterElementType(parameter.type))); + expressions.push(serializeTypeNode(ts.getRestParameterElementType(parameter.type))); } else { expressions.push(serializeTypeOfNode(parameter)); @@ -39588,11 +42368,20 @@ var ts; } return ts.createArrayLiteral(expressions); } + function getParametersOfDecoratedDeclaration(node, container) { + if (container && node.kind === 152) { + var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; + if (setAccessor) { + return setAccessor.parameters; + } + } + return node.parameters; + } function serializeReturnTypeOfNode(node) { if (ts.isFunctionLike(node) && node.type) { return serializeTypeNode(node.type); } - else if (ts.isAsyncFunctionLike(node)) { + else if (ts.isAsyncFunction(node)) { return ts.createIdentifier("Promise"); } return ts.createVoidZero(); @@ -39603,21 +42392,26 @@ var ts; } switch (node.kind) { case 104: + case 138: + case 94: + case 129: return ts.createVoidZero(); - case 166: + case 167: return serializeTypeNode(node.type); - case 158: case 159: + case 160: return ts.createIdentifier("Function"); - case 162: case 163: + case 164: return ts.createIdentifier("Array"); - case 156: + case 157: case 121: return ts.createIdentifier("Boolean"); - case 134: + case 135: return ts.createIdentifier("String"); - case 171: + case 133: + return ts.createIdentifier("Object"); + case 172: switch (node.literal.kind) { case 9: return ts.createIdentifier("String"); @@ -39633,44 +42427,22 @@ var ts; break; case 132: return ts.createIdentifier("Number"); - case 135: + case 136: return languageVersion < 2 ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 157: + case 158: return serializeTypeReferenceNode(node); + case 166: case 165: - case 164: - { - var unionOrIntersection = node; - var serializedUnion = void 0; - for (var _i = 0, _a = unionOrIntersection.types; _i < _a.length; _i++) { - var typeNode = _a[_i]; - var serializedIndividual = serializeTypeNode(typeNode); - if (serializedIndividual.kind !== 70) { - serializedUnion = undefined; - break; - } - if (serializedIndividual.text === "Object") { - return serializedIndividual; - } - if (serializedUnion && serializedUnion.text !== serializedIndividual.text) { - serializedUnion = undefined; - break; - } - serializedUnion = serializedIndividual; - } - if (serializedUnion) { - return serializedUnion; - } - } - case 160: - case 168: + return serializeUnionOrIntersectionType(node); + case 161: case 169: case 170: - case 161: + case 171: + case 162: case 118: - case 167: + case 168: break; default: ts.Debug.failBadSyntaxKind(node); @@ -39678,6 +42450,32 @@ var ts; } return ts.createIdentifier("Object"); } + function serializeUnionOrIntersectionType(node) { + var serializedUnion; + for (var _i = 0, _a = node.types; _i < _a.length; _i++) { + var typeNode = _a[_i]; + var serializedIndividual = serializeTypeNode(typeNode); + if (ts.isVoidExpression(serializedIndividual)) { + if (!serializedUnion) { + serializedUnion = serializedIndividual; + } + } + else if (ts.isIdentifier(serializedIndividual) && serializedIndividual.text === "Object") { + return serializedIndividual; + } + else if (serializedUnion && !ts.isVoidExpression(serializedUnion)) { + if (!ts.isIdentifier(serializedUnion) || + !ts.isIdentifier(serializedIndividual) || + serializedUnion.text !== serializedIndividual.text) { + return ts.createIdentifier("Object"); + } + } + else { + serializedUnion = serializedIndividual; + } + } + return serializedUnion; + } function serializeTypeReferenceNode(node) { switch (resolver.getTypeReferenceSerializationKind(node.typeName, currentScope)) { case ts.TypeReferenceSerializationKind.Unknown: @@ -39712,15 +42510,15 @@ var ts; function serializeEntityNameAsExpression(node, useFallback) { switch (node.kind) { case 70: - var name_33 = ts.getMutableClone(node); - name_33.flags &= ~8; - name_33.original = undefined; - name_33.parent = currentScope; + var name = ts.getMutableClone(node); + name.flags &= ~8; + name.original = undefined; + name.parent = currentScope; if (useFallback) { - return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name_33), ts.createLiteral("undefined")), name_33); + return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name), ts.createLiteral("undefined")), name); } - return name_33; - case 141: + return name; + case 142: return serializeQualifiedNameAsExpression(node, useFallback); } } @@ -39749,7 +42547,7 @@ var ts; : name.expression; } else if (ts.isIdentifier(name)) { - return ts.createLiteral(name.text); + return ts.createLiteral(ts.unescapeIdentifier(name.text)); } else { return ts.getSynthesizedClone(name); @@ -39764,7 +42562,7 @@ var ts; hoistVariableDeclaration(generatedName); expression = ts.createAssignment(generatedName, expression); } - return ts.setOriginalNode(ts.createComputedPropertyName(expression, name), name); + return ts.updateComputedPropertyName(name, expression); } else { return name; @@ -39773,13 +42571,12 @@ var ts; function visitHeritageClause(node) { if (node.token === 84) { var types = ts.visitNodes(node.types, visitor, ts.isExpressionWithTypeArguments, 0, 1); - return ts.createHeritageClause(84, types, node); + return ts.setTextRange(ts.createHeritageClause(84, types), node); } return undefined; } function visitExpressionWithTypeArguments(node) { - var expression = ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression); - return ts.createExpressionWithTypeArguments(undefined, expression, node); + return ts.updateExpressionWithTypeArguments(node, undefined, ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression)); } function shouldEmitFunctionLikeDeclaration(node) { return !ts.nodeIsMissing(node.body); @@ -39788,13 +42585,13 @@ var ts; if (!shouldEmitFunctionLikeDeclaration(node)) { return undefined; } - return ts.visitEachChild(node, visitor, context); + return ts.updateConstructor(node, ts.visitNodes(node.decorators, visitor, ts.isDecorator), ts.visitNodes(node.modifiers, visitor, ts.isModifier), ts.visitParameterList(node.parameters, visitor, context), ts.visitFunctionBody(node.body, visitor, context)); } function visitMethodDeclaration(node) { if (!shouldEmitFunctionLikeDeclaration(node)) { return undefined; } - var updated = ts.updateMethod(node, undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), visitPropertyNameOfClassElement(node), undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.visitFunctionBody(node.body, visitor, context)); + var updated = ts.updateMethod(node, undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, visitPropertyNameOfClassElement(node), undefined, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.visitFunctionBody(node.body, visitor, context)); if (updated !== node) { ts.setCommentRange(updated, node); ts.setSourceMapRange(updated, ts.moveRangePastDecorators(node)); @@ -39830,7 +42627,7 @@ var ts; if (!shouldEmitFunctionLikeDeclaration(node)) { return ts.createNotEmittedStatement(node); } - var updated = ts.updateFunctionDeclaration(node, undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.visitFunctionBody(node.body, visitor, context) || ts.createBlock([])); + var updated = ts.updateFunctionDeclaration(node, undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.visitFunctionBody(node.body, visitor, context) || ts.createBlock([])); if (isNamespaceExport(node)) { var statements = [updated]; addExportMemberAssignment(statements, node); @@ -39839,10 +42636,10 @@ var ts; return updated; } function visitFunctionExpression(node) { - if (ts.nodeIsMissing(node.body)) { + if (!shouldEmitFunctionLikeDeclaration(node)) { return ts.createOmittedExpression(); } - var updated = ts.updateFunctionExpression(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.visitFunctionBody(node.body, visitor, context)); + var updated = ts.updateFunctionExpression(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.visitFunctionBody(node.body, visitor, context) || ts.createBlock([])); return updated; } function visitArrowFunction(node) { @@ -39853,8 +42650,9 @@ var ts; if (ts.parameterIsThisKeyword(node)) { return undefined; } - var parameter = ts.createParameter(undefined, undefined, node.dotDotDotToken, ts.visitNode(node.name, visitor, ts.isBindingName), undefined, undefined, ts.visitNode(node.initializer, visitor, ts.isExpression), ts.moveRangePastModifiers(node)); + var parameter = ts.createParameter(undefined, undefined, node.dotDotDotToken, ts.visitNode(node.name, visitor, ts.isBindingName), undefined, undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)); ts.setOriginalNode(parameter, node); + ts.setTextRange(parameter, ts.moveRangePastModifiers(node)); ts.setCommentRange(parameter, node); ts.setSourceMapRange(parameter, ts.moveRangePastModifiers(node)); ts.setEmitFlags(parameter.name, 32); @@ -39866,7 +42664,7 @@ var ts; if (variables.length === 0) { return undefined; } - return ts.createStatement(ts.inlineExpressions(ts.map(variables, transformInitializedVariable)), node); + return ts.setTextRange(ts.createStatement(ts.inlineExpressions(ts.map(variables, transformInitializedVariable))), node); } else { return ts.visitEachChild(node, visitor, context); @@ -39878,7 +42676,7 @@ var ts; return ts.flattenDestructuringAssignment(node, visitor, context, 0, false, createNamespaceExportExpression); } else { - return ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(name), ts.visitNode(node.initializer, visitor, ts.isExpression), node); + return ts.setTextRange(ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(name), ts.visitNode(node.initializer, visitor, ts.isExpression)), node); } } function visitVariableDeclaration(node) { @@ -39932,8 +42730,9 @@ var ts; var localName = ts.getLocalName(node, false, true); moduleArg = ts.createAssignment(localName, moduleArg); } - var enumStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, parameterName)], undefined, transformEnumBody(node, containerName)), undefined, [moduleArg]), node); + var enumStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, parameterName)], undefined, transformEnumBody(node, containerName)), undefined, [moduleArg])); ts.setOriginalNode(enumStatement, node); + ts.setTextRange(enumStatement, node); ts.setEmitFlags(enumStatement, emitFlags); statements.push(enumStatement); statements.push(ts.createEndOfDeclarationMarker(node)); @@ -39947,11 +42746,11 @@ var ts; ts.addRange(statements, ts.map(node.members, transformEnumMember)); ts.addRange(statements, endLexicalEnvironment()); currentNamespaceContainerName = savedCurrentNamespaceLocalName; - return ts.createBlock(ts.createNodeArray(statements, node.members), undefined, true); + return ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), node.members), true); } function transformEnumMember(member) { var name = getExpressionForPropertyName(member, false); - return ts.createStatement(ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, name), transformEnumMemberDeclarationValue(member))), name, member), member); + return ts.setTextRange(ts.createStatement(ts.setTextRange(ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, name), transformEnumMemberDeclarationValue(member))), name), member)), member); } function transformEnumMemberDeclarationValue(member) { var value = resolver.getConstantValue(member); @@ -39983,16 +42782,16 @@ var ts; if (!currentScopeFirstDeclarationsOfName) { currentScopeFirstDeclarationsOfName = ts.createMap(); } - if (!(name in currentScopeFirstDeclarationsOfName)) { - currentScopeFirstDeclarationsOfName[name] = node; + if (!currentScopeFirstDeclarationsOfName.has(name)) { + currentScopeFirstDeclarationsOfName.set(name, node); } } } function isFirstEmittedDeclarationInScope(node) { if (currentScopeFirstDeclarationsOfName) { - var name_34 = node.symbol && node.symbol.name; - if (name_34) { - return currentScopeFirstDeclarationsOfName[name_34] === node; + var name = node.symbol && node.symbol.name; + if (name) { + return currentScopeFirstDeclarationsOfName.get(name) === node; } } return false; @@ -40004,7 +42803,7 @@ var ts; ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { - if (node.kind === 229) { + if (node.kind === 231) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -40045,8 +42844,9 @@ var ts; var localName = ts.getLocalName(node, false, true); moduleArg = ts.createAssignment(localName, moduleArg); } - var moduleStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, parameterName)], undefined, transformModuleBody(node, containerName)), undefined, [moduleArg]), node); + var moduleStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, parameterName)], undefined, transformModuleBody(node, containerName)), undefined, [moduleArg])); ts.setOriginalNode(moduleStatement, node); + ts.setTextRange(moduleStatement, node); ts.setEmitFlags(moduleStatement, emitFlags); statements.push(moduleStatement); statements.push(ts.createEndOfDeclarationMarker(node)); @@ -40064,8 +42864,8 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 231) { - ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); + if (body.kind === 233) { + saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; } @@ -40086,14 +42886,15 @@ var ts; currentNamespaceContainerName = savedCurrentNamespaceContainerName; currentNamespace = savedCurrentNamespace; currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName; - var block = ts.createBlock(ts.createNodeArray(statements, statementsLocation), blockLocation, true); - if (body.kind !== 231) { + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), true); + ts.setTextRange(block, blockLocation); + if (body.kind !== 233) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 230) { + if (moduleDeclaration.body.kind === 232) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -40102,18 +42903,18 @@ var ts; if (!node.importClause) { return node; } - var importClause = ts.visitNode(node.importClause, visitImportClause, ts.isImportClause, true); + var importClause = ts.visitNode(node.importClause, visitImportClause, ts.isImportClause); return importClause ? ts.updateImportDeclaration(node, undefined, undefined, importClause, node.moduleSpecifier) : undefined; } function visitImportClause(node) { var name = resolver.isReferencedAliasDeclaration(node) ? node.name : undefined; - var namedBindings = ts.visitNode(node.namedBindings, visitNamedImportBindings, ts.isNamedImportBindings, true); + var namedBindings = ts.visitNode(node.namedBindings, visitNamedImportBindings, ts.isNamedImportBindings); return (name || namedBindings) ? ts.updateImportClause(node, name, namedBindings) : undefined; } function visitNamedImportBindings(node) { - if (node.kind === 237) { + if (node.kind === 239) { return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } else { @@ -40136,7 +42937,7 @@ var ts; if (!resolver.isValueAliasDeclaration(node)) { return undefined; } - var exportClause = ts.visitNode(node.exportClause, visitNamedExports, ts.isNamedExports, true); + var exportClause = ts.visitNode(node.exportClause, visitNamedExports, ts.isNamedExports); return exportClause ? ts.updateExportDeclaration(node, undefined, undefined, exportClause, node.moduleSpecifier) : undefined; @@ -40165,9 +42966,9 @@ var ts; var moduleReference = ts.createExpressionFromEntityName(node.moduleReference); ts.setEmitFlags(moduleReference, 1536 | 2048); if (isNamedExternalModuleExport(node) || !isNamespaceExport(node)) { - return ts.setOriginalNode(ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ + return ts.setOriginalNode(ts.setTextRange(ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.setOriginalNode(ts.createVariableDeclaration(node.name, undefined, moduleReference), node) - ]), node), node); + ])), node), node); } else { return ts.setOriginalNode(createNamespaceExport(node.name, moduleReference, node), node); @@ -40188,7 +42989,7 @@ var ts; && ts.hasModifier(node, 512); } function expressionToStatement(expression) { - return ts.createStatement(expression, undefined); + return ts.createStatement(expression); } function addExportMemberAssignment(statements, node) { var expression = ts.createAssignment(ts.getExternalModuleOrNamespaceExportName(currentNamespaceContainerName, node, false, true), ts.getLocalName(node)); @@ -40198,10 +42999,10 @@ var ts; statements.push(statement); } function createNamespaceExport(exportName, exportValue, location) { - return ts.createStatement(ts.createAssignment(ts.getNamespaceMemberName(currentNamespaceContainerName, exportName, false, true), exportValue), location); + return ts.setTextRange(ts.createStatement(ts.createAssignment(ts.getNamespaceMemberName(currentNamespaceContainerName, exportName, false, true), exportValue)), location); } function createNamespaceExportExpression(exportName, exportValue, location) { - return ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(exportName), exportValue, location); + return ts.setTextRange(ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(exportName), exportValue), location); } function getNamespaceMemberNameWithSourceMapsAndWithoutComments(name) { return ts.getNamespaceMemberName(currentNamespaceContainerName, name, false, true); @@ -40217,7 +43018,7 @@ var ts; function getClassAliasIfNeeded(node) { if (resolver.getNodeCheckFlags(node) & 8388608) { enableSubstitutionForClassAliases(); - var classAlias = ts.createUniqueName(node.name && !ts.isGeneratedIdentifier(node.name) ? node.name.text : "default"); + var classAlias = ts.createUniqueName(node.name && !ts.isGeneratedIdentifier(node.name) ? ts.unescapeIdentifier(node.name.text) : "default"); classAliases[ts.getOriginalNodeId(node)] = classAlias; hoistVariableDeclaration(classAlias); return classAlias; @@ -40241,37 +43042,42 @@ var ts; if ((enabledSubstitutions & 1) === 0) { enabledSubstitutions |= 1; context.enableSubstitution(70); - classAliases = ts.createMap(); + classAliases = []; } } function enableSubstitutionForNamespaceExports() { if ((enabledSubstitutions & 2) === 0) { enabledSubstitutions |= 2; context.enableSubstitution(70); - context.enableSubstitution(258); - context.enableEmitNotification(230); + context.enableSubstitution(261); + context.enableEmitNotification(232); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 230; + return ts.getOriginalNode(node).kind === 232; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 229; + return ts.getOriginalNode(node).kind === 231; } - function onEmitNode(emitContext, node, emitCallback) { + function onEmitNode(hint, node, emitCallback) { var savedApplicableSubstitutions = applicableSubstitutions; + var savedCurrentSourceFile = currentSourceFile; + if (ts.isSourceFile(node)) { + currentSourceFile = node; + } if (enabledSubstitutions & 2 && isTransformedModuleDeclaration(node)) { applicableSubstitutions |= 2; } if (enabledSubstitutions & 8 && isTransformedEnumDeclaration(node)) { applicableSubstitutions |= 8; } - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); applicableSubstitutions = savedApplicableSubstitutions; + currentSourceFile = savedCurrentSourceFile; } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1) { + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1) { return substituteExpression(node); } else if (ts.isShorthandPropertyAssignment(node)) { @@ -40281,14 +43087,14 @@ var ts; } function substituteShorthandPropertyAssignment(node) { if (enabledSubstitutions & 2) { - var name_35 = node.name; - var exportedName = trySubstituteNamespaceExportedName(name_35); + var name = node.name; + var exportedName = trySubstituteNamespaceExportedName(name); if (exportedName) { if (node.objectAssignmentInitializer) { var initializer = ts.createAssignment(exportedName, node.objectAssignmentInitializer); - return ts.createPropertyAssignment(name_35, initializer, node); + return ts.setTextRange(ts.createPropertyAssignment(name, initializer), node); } - return ts.createPropertyAssignment(name_35, exportedName, node); + return ts.setTextRange(ts.createPropertyAssignment(name, exportedName), node); } } return node; @@ -40297,9 +43103,9 @@ var ts; switch (node.kind) { case 70: return substituteExpressionIdentifier(node); - case 177: - return substitutePropertyAccessExpression(node); case 178: + return substitutePropertyAccessExpression(node); + case 179: return substituteElementAccessExpression(node); } return node; @@ -40329,11 +43135,11 @@ var ts; function trySubstituteNamespaceExportedName(node) { if (enabledSubstitutions & applicableSubstitutions && !ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var container = resolver.getReferencedExportContainer(node, false); - if (container && container.kind !== 261) { - var substitute = (applicableSubstitutions & 2 && container.kind === 230) || - (applicableSubstitutions & 8 && container.kind === 229); + if (container && container.kind !== 264) { + var substitute = (applicableSubstitutions & 2 && container.kind === 232) || + (applicableSubstitutions & 8 && container.kind === 231); if (substitute) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node, node); + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), node); } } } @@ -40348,16 +43154,14 @@ var ts; function substituteConstantValue(node) { var constantValue = tryGetConstEnumValue(node); if (constantValue !== undefined) { + ts.setConstantValue(node, constantValue); var substitute = ts.createLiteral(constantValue); - ts.setSourceMapRange(substitute, node); - ts.setCommentRange(substitute, node); if (!compilerOptions.removeComments) { var propertyName = ts.isPropertyAccessExpression(node) ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); - substitute.trailingComment = " " + propertyName + " "; + ts.addSyntheticTrailingComment(substitute, 3, " " + propertyName + " "); } - ts.setConstantValue(node, constantValue); return substitute; } return node; @@ -40372,24 +43176,24 @@ var ts; } } ts.transformTypeScript = transformTypeScript; - var paramHelper = { - name: "typescript:param", - scoped: false, - priority: 4, - text: "\n var __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n };" - }; - function createParamHelper(context, expression, parameterOffset, location) { - context.requestEmitHelper(paramHelper); - return ts.createCall(ts.getHelperName("__param"), undefined, [ - ts.createLiteral(parameterOffset), - expression - ], location); + function createDecorateHelper(context, decoratorExpressions, target, memberName, descriptor, location) { + var argumentsArray = []; + argumentsArray.push(ts.createArrayLiteral(decoratorExpressions, true)); + argumentsArray.push(target); + if (memberName) { + argumentsArray.push(memberName); + if (descriptor) { + argumentsArray.push(descriptor); + } + } + context.requestEmitHelper(decorateHelper); + return ts.setTextRange(ts.createCall(ts.getHelperName("__decorate"), undefined, argumentsArray), location); } - var metadataHelper = { - name: "typescript:metadata", + var decorateHelper = { + name: "typescript:decorate", scoped: false, - priority: 3, - text: "\n var __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n };" + priority: 2, + text: "\n var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };" }; function createMetadataHelper(context, metadataKey, metadataValue) { context.requestEmitHelper(metadataHelper); @@ -40398,30 +43202,289 @@ var ts; metadataValue ]); } - var decorateHelper = { - name: "typescript:decorate", + var metadataHelper = { + name: "typescript:metadata", scoped: false, - priority: 2, - text: "\n var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };" + priority: 3, + text: "\n var __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n };" }; - function createDecorateHelper(context, decoratorExpressions, target, memberName, descriptor, location) { - context.requestEmitHelper(decorateHelper); - var argumentsArray = []; - argumentsArray.push(ts.createArrayLiteral(decoratorExpressions, undefined, true)); - argumentsArray.push(target); - if (memberName) { - argumentsArray.push(memberName); - if (descriptor) { - argumentsArray.push(descriptor); - } - } - return ts.createCall(ts.getHelperName("__decorate"), undefined, argumentsArray, location); + function createParamHelper(context, expression, parameterOffset, location) { + context.requestEmitHelper(paramHelper); + return ts.setTextRange(ts.createCall(ts.getHelperName("__param"), undefined, [ + ts.createLiteral(parameterOffset), + expression + ]), location); } + var paramHelper = { + name: "typescript:param", + scoped: false, + priority: 4, + text: "\n var __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n };" + }; })(ts || (ts = {})); var ts; (function (ts) { + var ES2017SubstitutionFlags; + (function (ES2017SubstitutionFlags) { + ES2017SubstitutionFlags[ES2017SubstitutionFlags["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper"; + })(ES2017SubstitutionFlags || (ES2017SubstitutionFlags = {})); + function transformES2017(context) { + var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; + var resolver = context.getEmitResolver(); + var compilerOptions = context.getCompilerOptions(); + var languageVersion = ts.getEmitScriptTarget(compilerOptions); + var currentSourceFile; + var enabledSubstitutions; + var enclosingSuperContainerFlags = 0; + var previousOnEmitNode = context.onEmitNode; + var previousOnSubstituteNode = context.onSubstituteNode; + context.onEmitNode = onEmitNode; + context.onSubstituteNode = onSubstituteNode; + return transformSourceFile; + function transformSourceFile(node) { + if (ts.isDeclarationFile(node)) { + return node; + } + currentSourceFile = node; + var visited = ts.visitEachChild(node, visitor, context); + ts.addEmitHelpers(visited, context.readEmitHelpers()); + currentSourceFile = undefined; + return visited; + } + function visitor(node) { + if ((node.transformFlags & 16) === 0) { + return node; + } + switch (node.kind) { + case 119: + return undefined; + case 190: + return visitAwaitExpression(node); + case 150: + return visitMethodDeclaration(node); + case 227: + return visitFunctionDeclaration(node); + case 185: + return visitFunctionExpression(node); + case 186: + return visitArrowFunction(node); + default: + return ts.visitEachChild(node, visitor, context); + } + } + function visitAwaitExpression(node) { + return ts.setOriginalNode(ts.setTextRange(ts.createYield(undefined, ts.visitNode(node.expression, visitor, ts.isExpression)), node), node); + } + function visitMethodDeclaration(node) { + return ts.updateMethod(node, undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, undefined, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.getFunctionFlags(node) & 2 + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + function visitFunctionDeclaration(node) { + return ts.updateFunctionDeclaration(node, undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.getFunctionFlags(node) & 2 + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + function visitFunctionExpression(node) { + return ts.updateFunctionExpression(node, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.getFunctionFlags(node) & 2 + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + function visitArrowFunction(node) { + return ts.updateArrowFunction(node, ts.visitNodes(node.modifiers, visitor, ts.isModifier), undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.getFunctionFlags(node) & 2 + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + function transformAsyncFunctionBody(node) { + resumeLexicalEnvironment(); + var original = ts.getOriginalNode(node, ts.isFunctionLike); + var nodeType = original.type; + var promiseConstructor = languageVersion < 2 ? getPromiseConstructor(nodeType) : undefined; + var isArrowFunction = node.kind === 186; + var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192) !== 0; + if (!isArrowFunction) { + var statements = []; + var statementOffset = ts.addPrologue(statements, node.body.statements, false, visitor); + statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body, statementOffset)))); + ts.addRange(statements, endLexicalEnvironment()); + var block = ts.createBlock(statements, true); + ts.setTextRange(block, node.body); + if (languageVersion >= 2) { + if (resolver.getNodeCheckFlags(node) & 4096) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.advancedAsyncSuperHelper); + } + else if (resolver.getNodeCheckFlags(node) & 2048) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.asyncSuperHelper); + } + } + return block; + } + else { + var expression = createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body)); + var declarations = endLexicalEnvironment(); + if (ts.some(declarations)) { + var block = ts.convertToFunctionBody(expression); + return ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(ts.concatenate(block.statements, declarations)), block.statements)); + } + return expression; + } + } + function transformFunctionBodyWorker(body, start) { + if (ts.isBlock(body)) { + return ts.updateBlock(body, ts.visitLexicalEnvironment(body.statements, visitor, context, start)); + } + else { + startLexicalEnvironment(); + var visited = ts.convertToFunctionBody(ts.visitNode(body, visitor, ts.isConciseBody)); + var declarations = endLexicalEnvironment(); + return ts.updateBlock(visited, ts.setTextRange(ts.createNodeArray(ts.concatenate(visited.statements, declarations)), visited.statements)); + } + } + function getPromiseConstructor(type) { + var typeName = type && ts.getEntityNameFromTypeNode(type); + if (typeName && ts.isEntityName(typeName)) { + var serializationKind = resolver.getTypeReferenceSerializationKind(typeName); + if (serializationKind === ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue + || serializationKind === ts.TypeReferenceSerializationKind.Unknown) { + return typeName; + } + } + return undefined; + } + function enableSubstitutionForAsyncMethodsWithSuper() { + if ((enabledSubstitutions & 1) === 0) { + enabledSubstitutions |= 1; + context.enableSubstitution(180); + context.enableSubstitution(178); + context.enableSubstitution(179); + context.enableEmitNotification(228); + context.enableEmitNotification(150); + context.enableEmitNotification(152); + context.enableEmitNotification(153); + context.enableEmitNotification(151); + } + } + function onEmitNode(hint, node, emitCallback) { + if (enabledSubstitutions & 1 && isSuperContainer(node)) { + var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 | 4096); + if (superContainerFlags !== enclosingSuperContainerFlags) { + var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; + enclosingSuperContainerFlags = superContainerFlags; + previousOnEmitNode(hint, node, emitCallback); + enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; + return; + } + } + previousOnEmitNode(hint, node, emitCallback); + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 && enclosingSuperContainerFlags) { + return substituteExpression(node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 178: + return substitutePropertyAccessExpression(node); + case 179: + return substituteElementAccessExpression(node); + case 180: + return substituteCallExpression(node); + } + return node; + } + function substitutePropertyAccessExpression(node) { + if (node.expression.kind === 96) { + return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), node); + } + return node; + } + function substituteElementAccessExpression(node) { + if (node.expression.kind === 96) { + return createSuperAccessInAsyncMethod(node.argumentExpression, node); + } + return node; + } + function substituteCallExpression(node) { + var expression = node.expression; + if (ts.isSuperProperty(expression)) { + var argumentExpression = ts.isPropertyAccessExpression(expression) + ? substitutePropertyAccessExpression(expression) + : substituteElementAccessExpression(expression); + return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), undefined, [ + ts.createThis() + ].concat(node.arguments)); + } + return node; + } + function isSuperContainer(node) { + var kind = node.kind; + return kind === 228 + || kind === 151 + || kind === 150 + || kind === 152 + || kind === 153; + } + function createSuperAccessInAsyncMethod(argumentExpression, location) { + if (enclosingSuperContainerFlags & 4096) { + return ts.setTextRange(ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression]), "value"), location); + } + else { + return ts.setTextRange(ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression]), location); + } + } + } + ts.transformES2017 = transformES2017; + var awaiterHelper = { + name: "typescript:awaiter", + scoped: false, + priority: 5, + text: "\n var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n };" + }; + function createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, body) { + context.requestEmitHelper(awaiterHelper); + var generatorFunc = ts.createFunctionExpression(undefined, ts.createToken(38), undefined, undefined, [], undefined, body); + (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 131072; + return ts.createCall(ts.getHelperName("__awaiter"), undefined, [ + ts.createThis(), + hasLexicalArguments ? ts.createIdentifier("arguments") : ts.createVoidZero(), + promiseConstructor ? ts.createExpressionFromEntityName(promiseConstructor) : ts.createVoidZero(), + generatorFunc + ]); + } + ts.asyncSuperHelper = { + name: "typescript:async-super", + scoped: true, + text: "\n const _super = name => super[name];\n " + }; + ts.advancedAsyncSuperHelper = { + name: "typescript:advanced-async-super", + scoped: true, + text: "\n const _super = (function (geti, seti) {\n const cache = Object.create(null);\n return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n })(name => super[name], (name, value) => super[name] = value);\n " + }; +})(ts || (ts = {})); +var ts; +(function (ts) { + var ESNextSubstitutionFlags; + (function (ESNextSubstitutionFlags) { + ESNextSubstitutionFlags[ESNextSubstitutionFlags["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper"; + })(ESNextSubstitutionFlags || (ESNextSubstitutionFlags = {})); function transformESNext(context) { - var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; + var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration; + var resolver = context.getEmitResolver(); + var compilerOptions = context.getCompilerOptions(); + var languageVersion = ts.getEmitScriptTarget(compilerOptions); + var previousOnEmitNode = context.onEmitNode; + context.onEmitNode = onEmitNode; + var previousOnSubstituteNode = context.onSubstituteNode; + context.onSubstituteNode = onSubstituteNode; + var enabledSubstitutions; + var enclosingFunctionFlags; + var enclosingSuperContainerFlags = 0; return transformSourceFile; function transformSourceFile(node) { if (ts.isDeclarationFile(node)) { @@ -40437,53 +43500,93 @@ var ts; function visitorNoDestructuringValue(node) { return visitorWorker(node, true); } + function visitorNoAsyncModifier(node) { + if (node.kind === 119) { + return undefined; + } + return node; + } function visitorWorker(node, noDestructuringValue) { if ((node.transformFlags & 8) === 0) { return node; } switch (node.kind) { - case 176: + case 190: + return visitAwaitExpression(node); + case 196: + return visitYieldExpression(node); + case 221: + return visitLabeledStatement(node); + case 177: return visitObjectLiteralExpression(node); - case 192: + case 193: return visitBinaryExpression(node, noDestructuringValue); - case 223: - return visitVariableDeclaration(node); - case 213: - return visitForOfStatement(node); - case 211: - return visitForStatement(node); - case 188: - return visitVoidExpression(node); - case 150: - return visitConstructorDeclaration(node); - case 149: - return visitMethodDeclaration(node); - case 151: - return visitGetAccessorDeclaration(node); - case 152: - return visitSetAccessorDeclaration(node); case 225: + return visitVariableDeclaration(node); + case 215: + return visitForOfStatement(node, undefined); + case 213: + return visitForStatement(node); + case 189: + return visitVoidExpression(node); + case 151: + return visitConstructorDeclaration(node); + case 150: + return visitMethodDeclaration(node); + case 152: + return visitGetAccessorDeclaration(node); + case 153: + return visitSetAccessorDeclaration(node); + case 227: return visitFunctionDeclaration(node); - case 184: - return visitFunctionExpression(node); case 185: + return visitFunctionExpression(node); + case 186: return visitArrowFunction(node); - case 144: + case 145: return visitParameter(node); - case 207: + case 209: return visitExpressionStatement(node); - case 183: + case 184: return visitParenthesizedExpression(node, noDestructuringValue); default: return ts.visitEachChild(node, visitor, context); } } + function visitAwaitExpression(node) { + if (enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + return ts.setOriginalNode(ts.setTextRange(ts.createYield(undefined, ts.createArrayLiteral([ts.createLiteral("await"), expression])), node), node); + } + return ts.visitEachChild(node, visitor, context); + } + function visitYieldExpression(node) { + if (enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + return ts.updateYield(node, node.asteriskToken, node.asteriskToken + ? createAsyncDelegatorHelper(context, expression, expression) + : ts.createArrayLiteral(expression + ? [ts.createLiteral("yield"), expression] + : [ts.createLiteral("yield")])); + } + return ts.visitEachChild(node, visitor, context); + } + function visitLabeledStatement(node) { + if (enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1) { + var statement = ts.unwrapInnermostStatementOfLabel(node); + if (statement.kind === 215 && statement.awaitModifier) { + return visitForOfStatement(statement, node); + } + return ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), node); + } + return ts.visitEachChild(node, visitor, context); + } function chunkObjectLiteralElements(elements) { var chunkObject; var objects = []; - for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) { - var e = elements_3[_i]; - if (e.kind === 259) { + for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { + var e = elements_4[_i]; + if (e.kind === 262) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -40495,7 +43598,7 @@ var ts; if (!chunkObject) { chunkObject = []; } - if (e.kind === 257) { + if (e.kind === 260) { var p = e; chunkObject.push(ts.createPropertyAssignment(p.name, ts.visitNode(p.initializer, visitor, ts.isExpression))); } @@ -40512,7 +43615,7 @@ var ts; function visitObjectLiteralExpression(node) { if (node.transformFlags & 1048576) { var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 176) { + if (objects.length && objects[0].kind !== 177) { objects.unshift(ts.createObjectLiteral()); } return createAssignHelper(context, objects); @@ -40546,68 +43649,202 @@ var ts; function visitVoidExpression(node) { return ts.visitEachChild(node, visitorNoDestructuringValue, context); } - function visitForOfStatement(node) { - var leadingStatements; - var temp; - var initializer = ts.skipParentheses(node.initializer); - if (initializer.transformFlags & 1048576) { - if (ts.isVariableDeclarationList(initializer)) { - temp = ts.createTempVariable(undefined); - var firstDeclaration = ts.firstOrUndefined(initializer.declarations); - var declarations = ts.flattenDestructuringBinding(firstDeclaration, visitor, context, 1, temp, false, true); - if (ts.some(declarations)) { - var statement = ts.createVariableStatement(undefined, ts.updateVariableDeclarationList(initializer, declarations), initializer); - leadingStatements = ts.append(leadingStatements, statement); - } - } - else if (ts.isAssignmentPattern(initializer)) { - temp = ts.createTempVariable(undefined); - var expression = ts.flattenDestructuringAssignment(ts.aggregateTransformFlags(ts.createAssignment(initializer, temp, node.initializer)), visitor, context, 1); - leadingStatements = ts.append(leadingStatements, ts.createStatement(expression, node.initializer)); - } + function visitForOfStatement(node, outermostLabeledStatement) { + if (node.initializer.transformFlags & 1048576) { + node = transformForOfStatementWithObjectRest(node); } - if (temp) { - var expression = ts.visitNode(node.expression, visitor, ts.isExpression); - var statement = ts.visitNode(node.statement, visitor, ts.isStatement); - var block = ts.isBlock(statement) - ? ts.updateBlock(statement, ts.createNodeArray(ts.concatenate(leadingStatements, statement.statements), statement.statements)) - : ts.createBlock(ts.append(leadingStatements, statement), statement, true); - return ts.updateForOf(node, ts.createVariableDeclarationList([ - ts.createVariableDeclaration(temp, undefined, undefined, node.initializer) - ], node.initializer, 1), expression, block); + if (node.awaitModifier) { + return transformForAwaitOfStatement(node, outermostLabeledStatement); } - return ts.visitEachChild(node, visitor, context); + else { + return ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), outermostLabeledStatement); + } + } + function transformForOfStatementWithObjectRest(node) { + var initializerWithoutParens = ts.skipParentheses(node.initializer); + if (ts.isVariableDeclarationList(initializerWithoutParens) || ts.isAssignmentPattern(initializerWithoutParens)) { + var bodyLocation = void 0; + var statementsLocation = void 0; + var temp = ts.createTempVariable(undefined); + var statements = [ts.createForOfBindingStatement(initializerWithoutParens, temp)]; + if (ts.isBlock(node.statement)) { + ts.addRange(statements, node.statement.statements); + bodyLocation = node.statement; + statementsLocation = node.statement.statements; + } + return ts.updateForOf(node, node.awaitModifier, ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(temp), node.initializer) + ], 1), node.initializer), node.expression, ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), true), bodyLocation)); + } + return node; + } + function convertForOfStatementHead(node, boundValue) { + var binding = ts.createForOfBindingStatement(node.initializer, boundValue); + var bodyLocation; + var statementsLocation; + var statements = [ts.visitNode(binding, visitor, ts.isStatement)]; + var statement = ts.visitNode(node.statement, visitor, ts.isStatement); + if (ts.isBlock(statement)) { + ts.addRange(statements, statement.statements); + bodyLocation = statement; + statementsLocation = statement.statements; + } + else { + statements.push(statement); + } + return ts.setEmitFlags(ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), true), bodyLocation), 48 | 384); + } + function transformForAwaitOfStatement(node, outermostLabeledStatement) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + var iterator = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(expression) : ts.createTempVariable(undefined); + var result = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(iterator) : ts.createTempVariable(undefined); + var errorRecord = ts.createUniqueName("e"); + var catchVariable = ts.getGeneratedNameForNode(errorRecord); + var returnMethod = ts.createTempVariable(undefined); + var values = createAsyncValuesHelper(context, expression, node.expression); + var next = ts.createYield(undefined, enclosingFunctionFlags & 1 + ? ts.createArrayLiteral([ + ts.createLiteral("await"), + ts.createCall(ts.createPropertyAccess(iterator, "next"), undefined, []) + ]) + : ts.createCall(ts.createPropertyAccess(iterator, "next"), undefined, [])); + hoistVariableDeclaration(errorRecord); + hoistVariableDeclaration(returnMethod); + var forStatement = ts.setEmitFlags(ts.setTextRange(ts.createFor(ts.setEmitFlags(ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(iterator, undefined, values), node.expression), + ts.createVariableDeclaration(result, undefined, next) + ]), node.expression), 1048576), ts.createLogicalNot(ts.createPropertyAccess(result, "done")), ts.createAssignment(result, next), convertForOfStatementHead(node, ts.createPropertyAccess(result, "value"))), node), 256); + return ts.createTry(ts.createBlock([ + ts.restoreEnclosingLabel(forStatement, outermostLabeledStatement) + ]), ts.createCatchClause(ts.createVariableDeclaration(catchVariable), ts.setEmitFlags(ts.createBlock([ + ts.createStatement(ts.createAssignment(errorRecord, ts.createObjectLiteral([ + ts.createPropertyAssignment("error", catchVariable) + ]))) + ]), 1)), ts.createBlock([ + ts.createTry(ts.createBlock([ + ts.setEmitFlags(ts.createIf(ts.createLogicalAnd(ts.createLogicalAnd(result, ts.createLogicalNot(ts.createPropertyAccess(result, "done"))), ts.createAssignment(returnMethod, ts.createPropertyAccess(iterator, "return"))), ts.createStatement(ts.createYield(undefined, enclosingFunctionFlags & 1 + ? ts.createArrayLiteral([ + ts.createLiteral("await"), + ts.createFunctionCall(returnMethod, iterator, []) + ]) + : ts.createFunctionCall(returnMethod, iterator, [])))), 1) + ]), undefined, ts.setEmitFlags(ts.createBlock([ + ts.setEmitFlags(ts.createIf(errorRecord, ts.createThrow(ts.createPropertyAccess(errorRecord, "error"))), 1) + ]), 1)) + ])); } function visitParameter(node) { if (node.transformFlags & 1048576) { - return ts.updateParameter(node, undefined, undefined, node.dotDotDotToken, ts.getGeneratedNameForNode(node), undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)); + return ts.updateParameter(node, undefined, undefined, node.dotDotDotToken, ts.getGeneratedNameForNode(node), undefined, undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)); } return ts.visitEachChild(node, visitor, context); } function visitConstructorDeclaration(node) { - return ts.updateConstructor(node, undefined, node.modifiers, ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node)); + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = 0; + var updated = ts.updateConstructor(node, undefined, node.modifiers, ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitGetAccessorDeclaration(node) { - return ts.updateGetAccessor(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = 0; + var updated = ts.updateGetAccessor(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitSetAccessorDeclaration(node) { - return ts.updateSetAccessor(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node)); + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = 0; + var updated = ts.updateSetAccessor(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitMethodDeclaration(node) { - return ts.updateMethod(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateMethod(node, undefined, enclosingFunctionFlags & 1 + ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier) + : node.modifiers, enclosingFunctionFlags & 2 + ? undefined + : node.asteriskToken, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNode(undefined, visitor, ts.isToken), undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1 + ? transformAsyncGeneratorFunctionBody(node) + : transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitFunctionDeclaration(node) { - return ts.updateFunctionDeclaration(node, undefined, node.modifiers, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateFunctionDeclaration(node, undefined, enclosingFunctionFlags & 1 + ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier) + : node.modifiers, enclosingFunctionFlags & 2 + ? undefined + : node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1 + ? transformAsyncGeneratorFunctionBody(node) + : transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitArrowFunction(node) { - return ts.updateArrowFunction(node, node.modifiers, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateArrowFunction(node, node.modifiers, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitFunctionExpression(node) { - return ts.updateFunctionExpression(node, node.modifiers, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateFunctionExpression(node, enclosingFunctionFlags & 1 + ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier) + : node.modifiers, enclosingFunctionFlags & 2 + ? undefined + : node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1 + ? transformAsyncGeneratorFunctionBody(node) + : transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; + } + function transformAsyncGeneratorFunctionBody(node) { + resumeLexicalEnvironment(); + var statements = []; + var statementOffset = ts.addPrologue(statements, node.body.statements, false, visitor); + appendObjectRestAssignmentsIfNeeded(statements, node); + statements.push(ts.createReturn(createAsyncGeneratorHelper(context, ts.createFunctionExpression(undefined, ts.createToken(38), node.name && ts.getGeneratedNameForNode(node.name), undefined, [], undefined, ts.updateBlock(node.body, ts.visitLexicalEnvironment(node.body.statements, visitor, context, statementOffset)))))); + ts.addRange(statements, endLexicalEnvironment()); + var block = ts.updateBlock(node.body, statements); + if (languageVersion >= 2) { + if (resolver.getNodeCheckFlags(node) & 4096) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.advancedAsyncSuperHelper); + } + else if (resolver.getNodeCheckFlags(node) & 2048) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.asyncSuperHelper); + } + } + return block; } function transformFunctionBody(node) { resumeLexicalEnvironment(); - var leadingStatements; + var statementOffset = 0; + var statements = []; + var body = ts.visitNode(node.body, visitor, ts.isConciseBody); + if (ts.isBlock(body)) { + statementOffset = ts.addPrologue(statements, body.statements, false, visitor); + } + ts.addRange(statements, appendObjectRestAssignmentsIfNeeded(undefined, node)); + var trailingStatements = endLexicalEnvironment(); + if (statementOffset > 0 || ts.some(statements) || ts.some(trailingStatements)) { + var block = ts.convertToFunctionBody(body, true); + ts.addRange(statements, block.statements.slice(statementOffset)); + ts.addRange(statements, trailingStatements); + return ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(statements), block.statements)); + } + return body; + } + function appendObjectRestAssignmentsIfNeeded(statements, node) { for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { var parameter = _a[_i]; if (parameter.transformFlags & 1048576) { @@ -40616,17 +43853,95 @@ var ts; if (ts.some(declarations)) { var statement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList(declarations)); ts.setEmitFlags(statement, 524288); - leadingStatements = ts.append(leadingStatements, statement); + statements = ts.append(statements, statement); } } } - var body = ts.visitNode(node.body, visitor, ts.isConciseBody); - var trailingStatements = endLexicalEnvironment(); - if (ts.some(leadingStatements) || ts.some(trailingStatements)) { - var block = ts.convertToFunctionBody(body, true); - return ts.updateBlock(block, ts.createNodeArray(ts.concatenate(ts.concatenate(leadingStatements, block.statements), trailingStatements), block.statements)); + return statements; + } + function enableSubstitutionForAsyncMethodsWithSuper() { + if ((enabledSubstitutions & 1) === 0) { + enabledSubstitutions |= 1; + context.enableSubstitution(180); + context.enableSubstitution(178); + context.enableSubstitution(179); + context.enableEmitNotification(228); + context.enableEmitNotification(150); + context.enableEmitNotification(152); + context.enableEmitNotification(153); + context.enableEmitNotification(151); + } + } + function onEmitNode(hint, node, emitCallback) { + if (enabledSubstitutions & 1 && isSuperContainer(node)) { + var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 | 4096); + if (superContainerFlags !== enclosingSuperContainerFlags) { + var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; + enclosingSuperContainerFlags = superContainerFlags; + previousOnEmitNode(hint, node, emitCallback); + enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; + return; + } + } + previousOnEmitNode(hint, node, emitCallback); + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 && enclosingSuperContainerFlags) { + return substituteExpression(node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 178: + return substitutePropertyAccessExpression(node); + case 179: + return substituteElementAccessExpression(node); + case 180: + return substituteCallExpression(node); + } + return node; + } + function substitutePropertyAccessExpression(node) { + if (node.expression.kind === 96) { + return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), node); + } + return node; + } + function substituteElementAccessExpression(node) { + if (node.expression.kind === 96) { + return createSuperAccessInAsyncMethod(node.argumentExpression, node); + } + return node; + } + function substituteCallExpression(node) { + var expression = node.expression; + if (ts.isSuperProperty(expression)) { + var argumentExpression = ts.isPropertyAccessExpression(expression) + ? substitutePropertyAccessExpression(expression) + : substituteElementAccessExpression(expression); + return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), undefined, [ + ts.createThis() + ].concat(node.arguments)); + } + return node; + } + function isSuperContainer(node) { + var kind = node.kind; + return kind === 228 + || kind === 151 + || kind === 150 + || kind === 152 + || kind === 153; + } + function createSuperAccessInAsyncMethod(argumentExpression, location) { + if (enclosingSuperContainerFlags & 4096) { + return ts.setTextRange(ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression]), "value"), location); + } + else { + return ts.setTextRange(ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression]), location); } - return body; } } ts.transformESNext = transformESNext; @@ -40637,25 +43952,57 @@ var ts; text: "\n var __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };" }; function createAssignHelper(context, attributesSegments) { + if (context.getCompilerOptions().target >= 2) { + return ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "assign"), undefined, attributesSegments); + } context.requestEmitHelper(assignHelper); return ts.createCall(ts.getHelperName("__assign"), undefined, attributesSegments); } ts.createAssignHelper = createAssignHelper; + var asyncGeneratorHelper = { + name: "typescript:asyncGenerator", + scoped: false, + text: "\n var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), q = [], c, i;\n return i = { next: verb(\"next\"), \"throw\": verb(\"throw\"), \"return\": verb(\"return\") }, i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }\n function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }\n function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === \"yield\" ? _yield : r.value[0] === \"delegate\" ? delegate : fulfill, reject); }\n function _yield(value) { settle(c[2], { value: value, done: false }); }\n function delegate(r) { step(r.done ? r : { value: [\"yield\", r.value], done: false }); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { c = void 0, f(v), next(); }\n };\n " + }; + function createAsyncGeneratorHelper(context, generatorFunc) { + context.requestEmitHelper(asyncGeneratorHelper); + (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 131072; + return ts.createCall(ts.getHelperName("__asyncGenerator"), undefined, [ + ts.createThis(), + ts.createIdentifier("arguments"), + generatorFunc + ]); + } + var asyncDelegator = { + name: "typescript:asyncDelegator", + scoped: false, + text: "\n var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {\n var i = { next: verb(\"next\"), \"throw\": verb(\"throw\", function (e) { throw e; }), \"return\": verb(\"return\", function (v) { return { value: v, done: true }; }) };\n return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { return function (v) { return { value: [\"delegate\", (o[n] || f).call(o, v)], done: false }; }; }\n };\n " + }; + function createAsyncDelegatorHelper(context, expression, location) { + context.requestEmitHelper(asyncDelegator); + return ts.setTextRange(ts.createCall(ts.getHelperName("__asyncDelegator"), undefined, [expression]), location); + } + var asyncValues = { + name: "typescript:asyncValues", + scoped: false, + text: "\n var __asyncValues = (this && this.__asyncIterator) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator];\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\n };\n " + }; + function createAsyncValuesHelper(context, expression, location) { + context.requestEmitHelper(asyncValues); + return ts.setTextRange(ts.createCall(ts.getHelperName("__asyncValues"), undefined, [expression]), location); + } })(ts || (ts = {})); var ts; (function (ts) { function transformJsx(context) { var compilerOptions = context.getCompilerOptions(); - var currentSourceFile; return transformSourceFile; function transformSourceFile(node) { if (ts.isDeclarationFile(node)) { return node; } - currentSourceFile = node; var visited = ts.visitEachChild(node, visitor, context); ts.addEmitHelpers(visited, context.readEmitHelpers()); - currentSourceFile = undefined; return visited; } function visitor(node) { @@ -40668,11 +44015,11 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 246: + case 248: return visitJsxElement(node, false); - case 247: + case 249: return visitJsxSelfClosingElement(node, false); - case 252: + case 255: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -40682,11 +44029,11 @@ var ts; switch (node.kind) { case 10: return visitJsxText(node); - case 252: + case 255: return visitJsxExpression(node); - case 246: + case 248: return visitJsxElement(node, true); - case 247: + case 249: return visitJsxSelfClosingElement(node, true); default: ts.Debug.failBadSyntaxKind(node); @@ -40702,7 +44049,7 @@ var ts; function visitJsxOpeningLikeElement(node, children, isChild, location) { var tagName = getTagName(node); var objectProperties; - var attrs = node.attributes; + var attrs = node.attributes.properties; if (attrs.length === 0) { objectProperties = ts.createNull(); } @@ -40734,13 +44081,16 @@ var ts; } function transformJsxAttributeInitializer(node) { if (node === undefined) { - return ts.createLiteral(true); + return ts.createTrue(); } else if (node.kind === 9) { var decoded = tryDecodeEntities(node.text); - return decoded ? ts.createLiteral(decoded, node) : node; + return decoded ? ts.setTextRange(ts.createLiteral(decoded), node) : node; } - else if (node.kind === 252) { + else if (node.kind === 255) { + if (node.expression === undefined) { + return ts.createTrue(); + } return visitJsxExpression(node); } else { @@ -40748,43 +44098,35 @@ var ts; } } function visitJsxText(node) { - var text = ts.getTextOfNode(node, true); - var parts; + var fixed = fixupWhitespaceAndDecodeEntities(ts.getTextOfNode(node, true)); + return fixed === undefined ? undefined : ts.createLiteral(fixed); + } + function fixupWhitespaceAndDecodeEntities(text) { + var acc; var firstNonWhitespace = 0; var lastNonWhitespace = -1; for (var i = 0; i < text.length; i++) { var c = text.charCodeAt(i); if (ts.isLineBreak(c)) { - if (firstNonWhitespace !== -1 && (lastNonWhitespace - firstNonWhitespace + 1 > 0)) { - var part = text.substr(firstNonWhitespace, lastNonWhitespace - firstNonWhitespace + 1); - if (!parts) { - parts = []; - } - parts.push(ts.createLiteral(decodeEntities(part))); + if (firstNonWhitespace !== -1 && lastNonWhitespace !== -1) { + acc = addLineOfJsxText(acc, text.substr(firstNonWhitespace, lastNonWhitespace - firstNonWhitespace + 1)); } firstNonWhitespace = -1; } - else if (!ts.isWhiteSpace(c)) { + else if (!ts.isWhiteSpaceSingleLine(c)) { lastNonWhitespace = i; if (firstNonWhitespace === -1) { firstNonWhitespace = i; } } } - if (firstNonWhitespace !== -1) { - var part = text.substr(firstNonWhitespace); - if (!parts) { - parts = []; - } - parts.push(ts.createLiteral(decodeEntities(part))); - } - if (parts) { - return ts.reduceLeft(parts, aggregateJsxTextParts); - } - return undefined; + return firstNonWhitespace !== -1 + ? addLineOfJsxText(acc, text.substr(firstNonWhitespace)) + : acc; } - function aggregateJsxTextParts(left, right) { - return ts.createAdd(ts.createAdd(left, ts.createLiteral(" ")), right); + function addLineOfJsxText(acc, trimmedLine) { + var decoded = decodeEntities(trimmedLine); + return acc === undefined ? decoded : acc + " " + decoded; } function decodeEntities(text) { return text.replace(/&((#((\d+)|x([\da-fA-F]+)))|(\w+));/g, function (match, _all, _number, _digits, decimal, hex, word) { @@ -40795,7 +44137,7 @@ var ts; return String.fromCharCode(parseInt(hex, 16)); } else { - var ch = entities[word]; + var ch = entities.get(word); return ch ? String.fromCharCode(ch) : match; } }); @@ -40805,16 +44147,16 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 246) { + if (node.kind === 248) { return getTagName(node.openingElement); } else { - var name_36 = node.tagName; - if (ts.isIdentifier(name_36) && ts.isIntrinsicJsxName(name_36.text)) { - return ts.createLiteral(name_36.text); + var name = node.tagName; + if (ts.isIdentifier(name) && ts.isIntrinsicJsxName(name.text)) { + return ts.createLiteral(name.text); } else { - return ts.createExpressionFromEntityName(name_36); + return ts.createExpressionFromEntityName(name); } } } @@ -40832,7 +44174,7 @@ var ts; } } ts.transformJsx = transformJsx; - var entities = ts.createMap({ + var entities = ts.createMapFromTemplate({ "quot": 0x0022, "amp": 0x0026, "apos": 0x0027, @@ -41089,263 +44431,6 @@ var ts; }); })(ts || (ts = {})); var ts; -(function (ts) { - function transformES2017(context) { - var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; - var resolver = context.getEmitResolver(); - var compilerOptions = context.getCompilerOptions(); - var languageVersion = ts.getEmitScriptTarget(compilerOptions); - var currentSourceFile; - var enabledSubstitutions; - var currentSuperContainer; - var previousOnEmitNode = context.onEmitNode; - var previousOnSubstituteNode = context.onSubstituteNode; - context.onEmitNode = onEmitNode; - context.onSubstituteNode = onSubstituteNode; - return transformSourceFile; - function transformSourceFile(node) { - if (ts.isDeclarationFile(node)) { - return node; - } - currentSourceFile = node; - var visited = ts.visitEachChild(node, visitor, context); - ts.addEmitHelpers(visited, context.readEmitHelpers()); - currentSourceFile = undefined; - return visited; - } - function visitor(node) { - if ((node.transformFlags & 16) === 0) { - return node; - } - switch (node.kind) { - case 119: - return undefined; - case 189: - return visitAwaitExpression(node); - case 149: - return visitMethodDeclaration(node); - case 225: - return visitFunctionDeclaration(node); - case 184: - return visitFunctionExpression(node); - case 185: - return visitArrowFunction(node); - default: - return ts.visitEachChild(node, visitor, context); - } - } - function visitAwaitExpression(node) { - return ts.setOriginalNode(ts.createYield(undefined, ts.visitNode(node.expression, visitor, ts.isExpression), node), node); - } - function visitMethodDeclaration(node) { - return ts.updateMethod(node, undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - function visitFunctionDeclaration(node) { - return ts.updateFunctionDeclaration(node, undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - function visitFunctionExpression(node) { - if (ts.nodeIsMissing(node.body)) { - return ts.createOmittedExpression(); - } - return ts.updateFunctionExpression(node, undefined, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - function visitArrowFunction(node) { - return ts.updateArrowFunction(node, ts.visitNodes(node.modifiers, visitor, ts.isModifier), undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - function transformAsyncFunctionBody(node) { - resumeLexicalEnvironment(); - var original = ts.getOriginalNode(node, ts.isFunctionLike); - var nodeType = original.type; - var promiseConstructor = languageVersion < 2 ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 185; - var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192) !== 0; - if (!isArrowFunction) { - var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.body.statements, false, visitor); - statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body, statementOffset)))); - ts.addRange(statements, endLexicalEnvironment()); - var block = ts.createBlock(statements, node.body, true); - if (languageVersion >= 2) { - if (resolver.getNodeCheckFlags(node) & 4096) { - enableSubstitutionForAsyncMethodsWithSuper(); - ts.addEmitHelper(block, advancedAsyncSuperHelper); - } - else if (resolver.getNodeCheckFlags(node) & 2048) { - enableSubstitutionForAsyncMethodsWithSuper(); - ts.addEmitHelper(block, asyncSuperHelper); - } - } - return block; - } - else { - var expression = createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body)); - var declarations = endLexicalEnvironment(); - if (ts.some(declarations)) { - var block = ts.convertToFunctionBody(expression); - return ts.updateBlock(block, ts.createNodeArray(ts.concatenate(block.statements, declarations), block.statements)); - } - return expression; - } - } - function transformFunctionBodyWorker(body, start) { - if (ts.isBlock(body)) { - return ts.updateBlock(body, ts.visitLexicalEnvironment(body.statements, visitor, context, start)); - } - else { - startLexicalEnvironment(); - var visited = ts.convertToFunctionBody(ts.visitNode(body, visitor, ts.isConciseBody)); - var declarations = endLexicalEnvironment(); - return ts.updateBlock(visited, ts.createNodeArray(ts.concatenate(visited.statements, declarations), visited.statements)); - } - } - function getPromiseConstructor(type) { - var typeName = type && ts.getEntityNameFromTypeNode(type); - if (typeName && ts.isEntityName(typeName)) { - var serializationKind = resolver.getTypeReferenceSerializationKind(typeName); - if (serializationKind === ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue - || serializationKind === ts.TypeReferenceSerializationKind.Unknown) { - return typeName; - } - } - return undefined; - } - function enableSubstitutionForAsyncMethodsWithSuper() { - if ((enabledSubstitutions & 1) === 0) { - enabledSubstitutions |= 1; - context.enableSubstitution(179); - context.enableSubstitution(177); - context.enableSubstitution(178); - context.enableEmitNotification(226); - context.enableEmitNotification(149); - context.enableEmitNotification(151); - context.enableEmitNotification(152); - context.enableEmitNotification(150); - } - } - function substituteExpression(node) { - switch (node.kind) { - case 177: - return substitutePropertyAccessExpression(node); - case 178: - return substituteElementAccessExpression(node); - case 179: - if (enabledSubstitutions & 1) { - return substituteCallExpression(node); - } - break; - } - return node; - } - function substitutePropertyAccessExpression(node) { - if (enabledSubstitutions & 1 && node.expression.kind === 96) { - var flags = getSuperContainerAsyncMethodFlags(); - if (flags) { - return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), flags, node); - } - } - return node; - } - function substituteElementAccessExpression(node) { - if (enabledSubstitutions & 1 && node.expression.kind === 96) { - var flags = getSuperContainerAsyncMethodFlags(); - if (flags) { - return createSuperAccessInAsyncMethod(node.argumentExpression, flags, node); - } - } - return node; - } - function substituteCallExpression(node) { - var expression = node.expression; - if (ts.isSuperProperty(expression)) { - var flags = getSuperContainerAsyncMethodFlags(); - if (flags) { - var argumentExpression = ts.isPropertyAccessExpression(expression) - ? substitutePropertyAccessExpression(expression) - : substituteElementAccessExpression(expression); - return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), undefined, [ - ts.createThis() - ].concat(node.arguments)); - } - } - return node; - } - function isSuperContainer(node) { - var kind = node.kind; - return kind === 226 - || kind === 150 - || kind === 149 - || kind === 151 - || kind === 152; - } - function onEmitNode(emitContext, node, emitCallback) { - if (enabledSubstitutions & 1 && isSuperContainer(node)) { - var savedCurrentSuperContainer = currentSuperContainer; - currentSuperContainer = node; - previousOnEmitNode(emitContext, node, emitCallback); - currentSuperContainer = savedCurrentSuperContainer; - } - else { - previousOnEmitNode(emitContext, node, emitCallback); - } - } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1) { - return substituteExpression(node); - } - return node; - } - function createSuperAccessInAsyncMethod(argumentExpression, flags, location) { - if (flags & 4096) { - return ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression]), "value", location); - } - else { - return ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression], location); - } - } - function getSuperContainerAsyncMethodFlags() { - return currentSuperContainer !== undefined - && resolver.getNodeCheckFlags(currentSuperContainer) & (2048 | 4096); - } - } - ts.transformES2017 = transformES2017; - function createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, body) { - context.requestEmitHelper(awaiterHelper); - var generatorFunc = ts.createFunctionExpression(undefined, ts.createToken(38), undefined, undefined, [], undefined, body); - (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 131072; - return ts.createCall(ts.getHelperName("__awaiter"), undefined, [ - ts.createThis(), - hasLexicalArguments ? ts.createIdentifier("arguments") : ts.createVoidZero(), - promiseConstructor ? ts.createExpressionFromEntityName(promiseConstructor) : ts.createVoidZero(), - generatorFunc - ]); - } - var awaiterHelper = { - name: "typescript:awaiter", - scoped: false, - priority: 5, - text: "\n var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments)).next());\n });\n };" - }; - var asyncSuperHelper = { - name: "typescript:async-super", - scoped: true, - text: "\n const _super = name => super[name];" - }; - var advancedAsyncSuperHelper = { - name: "typescript:advanced-async-super", - scoped: true, - text: "\n const _super = (function (geti, seti) {\n const cache = Object.create(null);\n return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n })(name => super[name], (name, value) => super[name] = value);" - }; -})(ts || (ts = {})); -var ts; (function (ts) { function transformES2016(context) { var hoistVariableDeclaration = context.hoistVariableDeclaration; @@ -41361,7 +44446,7 @@ var ts; return node; } switch (node.kind) { - case 192: + case 193: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -41385,19 +44470,19 @@ var ts; if (ts.isElementAccessExpression(left)) { var expressionTemp = ts.createTempVariable(hoistVariableDeclaration); var argumentExpressionTemp = ts.createTempVariable(hoistVariableDeclaration); - target = ts.createElementAccess(ts.createAssignment(expressionTemp, left.expression, left.expression), ts.createAssignment(argumentExpressionTemp, left.argumentExpression, left.argumentExpression), left); - value = ts.createElementAccess(expressionTemp, argumentExpressionTemp, left); + target = ts.setTextRange(ts.createElementAccess(ts.setTextRange(ts.createAssignment(expressionTemp, left.expression), left.expression), ts.setTextRange(ts.createAssignment(argumentExpressionTemp, left.argumentExpression), left.argumentExpression)), left); + value = ts.setTextRange(ts.createElementAccess(expressionTemp, argumentExpressionTemp), left); } else if (ts.isPropertyAccessExpression(left)) { var expressionTemp = ts.createTempVariable(hoistVariableDeclaration); - target = ts.createPropertyAccess(ts.createAssignment(expressionTemp, left.expression, left.expression), left.name, left); - value = ts.createPropertyAccess(expressionTemp, left.name, left); + target = ts.setTextRange(ts.createPropertyAccess(ts.setTextRange(ts.createAssignment(expressionTemp, left.expression), left.expression), left.name), left); + value = ts.setTextRange(ts.createPropertyAccess(expressionTemp, left.name), left); } else { target = left; value = left; } - return ts.createAssignment(target, ts.createMathPow(value, right, node), node); + return ts.setTextRange(ts.createAssignment(target, ts.createMathPow(value, right, node)), node); } function visitExponentiationExpression(node) { var left = ts.visitNode(node.left, visitor, ts.isExpression); @@ -41409,8 +44494,78 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { + var ES2015SubstitutionFlags; + (function (ES2015SubstitutionFlags) { + ES2015SubstitutionFlags[ES2015SubstitutionFlags["CapturedThis"] = 1] = "CapturedThis"; + ES2015SubstitutionFlags[ES2015SubstitutionFlags["BlockScopedBindings"] = 2] = "BlockScopedBindings"; + })(ES2015SubstitutionFlags || (ES2015SubstitutionFlags = {})); + var CopyDirection; + (function (CopyDirection) { + CopyDirection[CopyDirection["ToOriginal"] = 0] = "ToOriginal"; + CopyDirection[CopyDirection["ToOutParameter"] = 1] = "ToOutParameter"; + })(CopyDirection || (CopyDirection = {})); + var Jump; + (function (Jump) { + Jump[Jump["Break"] = 2] = "Break"; + Jump[Jump["Continue"] = 4] = "Continue"; + Jump[Jump["Return"] = 8] = "Return"; + })(Jump || (Jump = {})); + var SuperCaptureResult; + (function (SuperCaptureResult) { + SuperCaptureResult[SuperCaptureResult["NoReplacement"] = 0] = "NoReplacement"; + SuperCaptureResult[SuperCaptureResult["ReplaceSuperCapture"] = 1] = "ReplaceSuperCapture"; + SuperCaptureResult[SuperCaptureResult["ReplaceWithReturn"] = 2] = "ReplaceWithReturn"; + })(SuperCaptureResult || (SuperCaptureResult = {})); + var HierarchyFacts; + (function (HierarchyFacts) { + HierarchyFacts[HierarchyFacts["None"] = 0] = "None"; + HierarchyFacts[HierarchyFacts["Function"] = 1] = "Function"; + HierarchyFacts[HierarchyFacts["ArrowFunction"] = 2] = "ArrowFunction"; + HierarchyFacts[HierarchyFacts["AsyncFunctionBody"] = 4] = "AsyncFunctionBody"; + HierarchyFacts[HierarchyFacts["NonStaticClassElement"] = 8] = "NonStaticClassElement"; + HierarchyFacts[HierarchyFacts["CapturesThis"] = 16] = "CapturesThis"; + HierarchyFacts[HierarchyFacts["ExportedVariableStatement"] = 32] = "ExportedVariableStatement"; + HierarchyFacts[HierarchyFacts["TopLevel"] = 64] = "TopLevel"; + HierarchyFacts[HierarchyFacts["Block"] = 128] = "Block"; + HierarchyFacts[HierarchyFacts["IterationStatement"] = 256] = "IterationStatement"; + HierarchyFacts[HierarchyFacts["IterationStatementBlock"] = 512] = "IterationStatementBlock"; + HierarchyFacts[HierarchyFacts["ForStatement"] = 1024] = "ForStatement"; + HierarchyFacts[HierarchyFacts["ForInOrForOfStatement"] = 2048] = "ForInOrForOfStatement"; + HierarchyFacts[HierarchyFacts["ConstructorWithCapturedSuper"] = 4096] = "ConstructorWithCapturedSuper"; + HierarchyFacts[HierarchyFacts["ComputedPropertyName"] = 8192] = "ComputedPropertyName"; + HierarchyFacts[HierarchyFacts["AncestorFactsMask"] = 16383] = "AncestorFactsMask"; + HierarchyFacts[HierarchyFacts["BlockScopeIncludes"] = 0] = "BlockScopeIncludes"; + HierarchyFacts[HierarchyFacts["BlockScopeExcludes"] = 4032] = "BlockScopeExcludes"; + HierarchyFacts[HierarchyFacts["SourceFileIncludes"] = 64] = "SourceFileIncludes"; + HierarchyFacts[HierarchyFacts["SourceFileExcludes"] = 3968] = "SourceFileExcludes"; + HierarchyFacts[HierarchyFacts["FunctionIncludes"] = 65] = "FunctionIncludes"; + HierarchyFacts[HierarchyFacts["FunctionExcludes"] = 16286] = "FunctionExcludes"; + HierarchyFacts[HierarchyFacts["AsyncFunctionBodyIncludes"] = 69] = "AsyncFunctionBodyIncludes"; + HierarchyFacts[HierarchyFacts["AsyncFunctionBodyExcludes"] = 16278] = "AsyncFunctionBodyExcludes"; + HierarchyFacts[HierarchyFacts["ArrowFunctionIncludes"] = 66] = "ArrowFunctionIncludes"; + HierarchyFacts[HierarchyFacts["ArrowFunctionExcludes"] = 16256] = "ArrowFunctionExcludes"; + HierarchyFacts[HierarchyFacts["ConstructorIncludes"] = 73] = "ConstructorIncludes"; + HierarchyFacts[HierarchyFacts["ConstructorExcludes"] = 16278] = "ConstructorExcludes"; + HierarchyFacts[HierarchyFacts["DoOrWhileStatementIncludes"] = 256] = "DoOrWhileStatementIncludes"; + HierarchyFacts[HierarchyFacts["DoOrWhileStatementExcludes"] = 0] = "DoOrWhileStatementExcludes"; + HierarchyFacts[HierarchyFacts["ForStatementIncludes"] = 1280] = "ForStatementIncludes"; + HierarchyFacts[HierarchyFacts["ForStatementExcludes"] = 3008] = "ForStatementExcludes"; + HierarchyFacts[HierarchyFacts["ForInOrForOfStatementIncludes"] = 2304] = "ForInOrForOfStatementIncludes"; + HierarchyFacts[HierarchyFacts["ForInOrForOfStatementExcludes"] = 1984] = "ForInOrForOfStatementExcludes"; + HierarchyFacts[HierarchyFacts["BlockIncludes"] = 128] = "BlockIncludes"; + HierarchyFacts[HierarchyFacts["BlockExcludes"] = 3904] = "BlockExcludes"; + HierarchyFacts[HierarchyFacts["IterationStatementBlockIncludes"] = 512] = "IterationStatementBlockIncludes"; + HierarchyFacts[HierarchyFacts["IterationStatementBlockExcludes"] = 4032] = "IterationStatementBlockExcludes"; + HierarchyFacts[HierarchyFacts["ComputedPropertyNameIncludes"] = 8192] = "ComputedPropertyNameIncludes"; + HierarchyFacts[HierarchyFacts["ComputedPropertyNameExcludes"] = 0] = "ComputedPropertyNameExcludes"; + HierarchyFacts[HierarchyFacts["NewTarget"] = 16384] = "NewTarget"; + HierarchyFacts[HierarchyFacts["NewTargetInComputedPropertyName"] = 32768] = "NewTargetInComputedPropertyName"; + HierarchyFacts[HierarchyFacts["SubtreeFactsMask"] = -16384] = "SubtreeFactsMask"; + HierarchyFacts[HierarchyFacts["PropagateNewTargetMask"] = 49152] = "PropagateNewTargetMask"; + })(HierarchyFacts || (HierarchyFacts = {})); function transformES2015(context) { var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration; + var compilerOptions = context.getCompilerOptions(); var resolver = context.getEmitResolver(); var previousOnSubstituteNode = context.onSubstituteNode; var previousOnEmitNode = context.onEmitNode; @@ -41418,15 +44573,7 @@ var ts; context.onSubstituteNode = onSubstituteNode; var currentSourceFile; var currentText; - var currentParent; - var currentNode; - var enclosingVariableStatement; - var enclosingBlockScopeContainer; - var enclosingBlockScopeContainerParent; - var enclosingFunction; - var enclosingNonArrowFunction; - var enclosingNonAsyncFunctionBody; - var isInConstructorWithCapturedSuper; + var hierarchyFacts; var convertedLoopState; var enabledSubstitutions; return transformSourceFile; @@ -41436,247 +44583,207 @@ var ts; } currentSourceFile = node; currentText = node.text; - var visited = saveStateAndInvoke(node, visitSourceFile); + var visited = visitSourceFile(node); ts.addEmitHelpers(visited, context.readEmitHelpers()); currentSourceFile = undefined; currentText = undefined; + hierarchyFacts = 0; return visited; } - function visitor(node) { - return saveStateAndInvoke(node, dispatcher); + function enterSubtree(excludeFacts, includeFacts) { + var ancestorFacts = hierarchyFacts; + hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & 16383; + return ancestorFacts; } - function dispatcher(node) { - return convertedLoopState - ? visitorForConvertedLoopWorker(node) - : visitorWorker(node); - } - function saveStateAndInvoke(node, f) { - var savedEnclosingFunction = enclosingFunction; - var savedEnclosingNonArrowFunction = enclosingNonArrowFunction; - var savedEnclosingNonAsyncFunctionBody = enclosingNonAsyncFunctionBody; - var savedEnclosingBlockScopeContainer = enclosingBlockScopeContainer; - var savedEnclosingBlockScopeContainerParent = enclosingBlockScopeContainerParent; - var savedEnclosingVariableStatement = enclosingVariableStatement; - var savedCurrentParent = currentParent; - var savedCurrentNode = currentNode; - var savedConvertedLoopState = convertedLoopState; - var savedIsInConstructorWithCapturedSuper = isInConstructorWithCapturedSuper; - if (ts.nodeStartsNewLexicalEnvironment(node)) { - isInConstructorWithCapturedSuper = false; - convertedLoopState = undefined; - } - onBeforeVisitNode(node); - var visited = f(node); - isInConstructorWithCapturedSuper = savedIsInConstructorWithCapturedSuper; - convertedLoopState = savedConvertedLoopState; - enclosingFunction = savedEnclosingFunction; - enclosingNonArrowFunction = savedEnclosingNonArrowFunction; - enclosingNonAsyncFunctionBody = savedEnclosingNonAsyncFunctionBody; - enclosingBlockScopeContainer = savedEnclosingBlockScopeContainer; - enclosingBlockScopeContainerParent = savedEnclosingBlockScopeContainerParent; - enclosingVariableStatement = savedEnclosingVariableStatement; - currentParent = savedCurrentParent; - currentNode = savedCurrentNode; - return visited; - } - function onBeforeVisitNode(node) { - if (currentNode) { - if (ts.isBlockScope(currentNode, currentParent)) { - enclosingBlockScopeContainer = currentNode; - enclosingBlockScopeContainerParent = currentParent; - } - if (ts.isFunctionLike(currentNode)) { - enclosingFunction = currentNode; - if (currentNode.kind !== 185) { - enclosingNonArrowFunction = currentNode; - if (!(ts.getEmitFlags(currentNode) & 131072)) { - enclosingNonAsyncFunctionBody = currentNode; - } - } - } - switch (currentNode.kind) { - case 205: - enclosingVariableStatement = currentNode; - break; - case 224: - case 223: - case 174: - case 172: - case 173: - break; - default: - enclosingVariableStatement = undefined; - } - } - currentParent = currentNode; - currentNode = node; - } - function returnCapturedThis(node) { - return ts.setOriginalNode(ts.createReturn(ts.createIdentifier("_this")), node); + function exitSubtree(ancestorFacts, excludeFacts, includeFacts) { + hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & -16384 | ancestorFacts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { - return isInConstructorWithCapturedSuper && node.kind === 216 && !node.expression; + return hierarchyFacts & 4096 + && node.kind === 218 + && !node.expression; } - function shouldCheckNode(node) { - return (node.transformFlags & 64) !== 0 || - node.kind === 219 || - (ts.isIterationStatement(node, false) && shouldConvertIterationStatementBody(node)); + function shouldVisitNode(node) { + return (node.transformFlags & 128) !== 0 + || convertedLoopState !== undefined + || (hierarchyFacts & 4096 && ts.isStatement(node)) + || (ts.isIterationStatement(node, false) && shouldConvertIterationStatementBody(node)); } - function visitorWorker(node) { - if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { - return returnCapturedThis(node); - } - else if (shouldCheckNode(node)) { + function visitor(node) { + if (shouldVisitNode(node)) { return visitJavaScript(node); } - else if (node.transformFlags & 128 || (isInConstructorWithCapturedSuper && !ts.isExpression(node))) { - return ts.visitEachChild(node, visitor, context); - } else { return node; } } - function visitorForConvertedLoopWorker(node) { - var result; - if (shouldCheckNode(node)) { - result = visitJavaScript(node); + function functionBodyVisitor(node) { + if (shouldVisitNode(node)) { + return visitBlock(node, true); } - else { - result = visitNodesInConvertedLoop(node); - } - return result; + return node; } - function visitNodesInConvertedLoop(node) { - switch (node.kind) { - case 216: - node = isReturnVoidStatementInConstructorWithCapturedSuper(node) ? returnCapturedThis(node) : node; - return visitReturnStatement(node); - case 205: - return visitVariableStatement(node); - case 218: - return visitSwitchStatement(node); - case 215: - case 214: - return visitBreakOrContinueStatement(node); - case 98: - return visitThisKeyword(node); - case 70: - return visitIdentifier(node); - default: - return ts.visitEachChild(node, visitor, context); + function callExpressionVisitor(node) { + if (node.kind === 96) { + return visitSuperKeyword(true); } + return visitor(node); } function visitJavaScript(node) { switch (node.kind) { case 114: return undefined; - case 226: + case 228: return visitClassDeclaration(node); - case 197: + case 198: return visitClassExpression(node); - case 144: + case 145: return visitParameter(node); - case 225: + case 227: return visitFunctionDeclaration(node); - case 185: + case 186: return visitArrowFunction(node); - case 184: + case 185: return visitFunctionExpression(node); - case 223: + case 225: return visitVariableDeclaration(node); case 70: return visitIdentifier(node); - case 224: + case 226: return visitVariableDeclarationList(node); - case 219: + case 220: + return visitSwitchStatement(node); + case 234: + return visitCaseBlock(node); + case 206: + return visitBlock(node, false); + case 217: + case 216: + return visitBreakOrContinueStatement(node); + case 221: return visitLabeledStatement(node); - case 209: - return visitDoStatement(node); - case 210: - return visitWhileStatement(node); case 211: - return visitForStatement(node); case 212: - return visitForInStatement(node); + return visitDoOrWhileStatement(node, undefined); case 213: - return visitForOfStatement(node); - case 207: + return visitForStatement(node, undefined); + case 214: + return visitForInStatement(node, undefined); + case 215: + return visitForOfStatement(node, undefined); + case 209: return visitExpressionStatement(node); - case 176: + case 177: return visitObjectLiteralExpression(node); - case 256: + case 259: return visitCatchClause(node); - case 258: + case 261: return visitShorthandPropertyAssignment(node); - case 175: + case 143: + return visitComputedPropertyName(node); + case 176: return visitArrayLiteralExpression(node); - case 179: - return visitCallExpression(node); case 180: + return visitCallExpression(node); + case 181: return visitNewExpression(node); - case 183: + case 184: return visitParenthesizedExpression(node, true); - case 192: + case 193: return visitBinaryExpression(node, true); case 12: case 13: case 14: case 15: return visitTemplateLiteral(node); - case 181: + case 9: + return visitStringLiteral(node); + case 8: + return visitNumericLiteral(node); + case 182: return visitTaggedTemplateExpression(node); - case 194: - return visitTemplateExpression(node); case 195: - return visitYieldExpression(node); + return visitTemplateExpression(node); case 196: + return visitYieldExpression(node); + case 197: return visitSpreadElement(node); case 96: - return visitSuperKeyword(); - case 195: - return ts.visitEachChild(node, visitor, context); - case 149: + return visitSuperKeyword(false); + case 98: + return visitThisKeyword(node); + case 203: + return visitMetaProperty(node); + case 150: return visitMethodDeclaration(node); - case 205: + case 152: + case 153: + return visitAccessorDeclaration(node); + case 207: return visitVariableStatement(node); + case 218: + return visitReturnStatement(node); default: - ts.Debug.failBadSyntaxKind(node); return ts.visitEachChild(node, visitor, context); } } function visitSourceFile(node) { + var ancestorFacts = enterSubtree(3968, 64); var statements = []; startLexicalEnvironment(); - var statementOffset = ts.addPrologueDirectives(statements, node.statements, false, visitor); + var statementOffset = ts.addStandardPrologue(statements, node.statements, false); addCaptureThisForNodeIfNeeded(statements, node); + statementOffset = ts.addCustomPrologue(statements, node.statements, statementOffset, visitor); ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset)); ts.addRange(statements, endLexicalEnvironment()); - return ts.updateSourceFileNode(node, ts.createNodeArray(statements, node.statements)); + exitSubtree(ancestorFacts, 0, 0); + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements)); } function visitSwitchStatement(node) { - ts.Debug.assert(convertedLoopState !== undefined); - var savedAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; - convertedLoopState.allowedNonLabeledJumps |= 2; - var result = ts.visitEachChild(node, visitor, context); - convertedLoopState.allowedNonLabeledJumps = savedAllowedNonLabeledJumps; - return result; + if (convertedLoopState !== undefined) { + var savedAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; + convertedLoopState.allowedNonLabeledJumps |= 2; + var result = ts.visitEachChild(node, visitor, context); + convertedLoopState.allowedNonLabeledJumps = savedAllowedNonLabeledJumps; + return result; + } + return ts.visitEachChild(node, visitor, context); + } + function visitCaseBlock(node) { + var ancestorFacts = enterSubtree(4032, 0); + var updated = ts.visitEachChild(node, visitor, context); + exitSubtree(ancestorFacts, 0, 0); + return updated; + } + function returnCapturedThis(node) { + return ts.setOriginalNode(ts.createReturn(ts.createIdentifier("_this")), node); } function visitReturnStatement(node) { - ts.Debug.assert(convertedLoopState !== undefined); - convertedLoopState.nonLocalJumps |= 8; - return ts.createReturn(ts.createObjectLiteral([ - ts.createPropertyAssignment(ts.createIdentifier("value"), node.expression - ? ts.visitNode(node.expression, visitor, ts.isExpression) - : ts.createVoidZero()) - ])); + if (convertedLoopState) { + convertedLoopState.nonLocalJumps |= 8; + if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { + node = returnCapturedThis(node); + } + return ts.createReturn(ts.createObjectLiteral([ + ts.createPropertyAssignment(ts.createIdentifier("value"), node.expression + ? ts.visitNode(node.expression, visitor, ts.isExpression) + : ts.createVoidZero()) + ])); + } + else if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { + return returnCapturedThis(node); + } + return ts.visitEachChild(node, visitor, context); } function visitThisKeyword(node) { - ts.Debug.assert(convertedLoopState !== undefined); - if (enclosingFunction && enclosingFunction.kind === 185) { - convertedLoopState.containsLexicalThis = true; - return node; + if (convertedLoopState) { + if (hierarchyFacts & 2) { + convertedLoopState.containsLexicalThis = true; + return node; + } + return convertedLoopState.thisName || (convertedLoopState.thisName = ts.createUniqueName("this")); } - return convertedLoopState.thisName || (convertedLoopState.thisName = ts.createUniqueName("this")); + return node; } function visitIdentifier(node) { if (!convertedLoopState) { @@ -41685,20 +44792,20 @@ var ts; if (ts.isGeneratedIdentifier(node)) { return node; } - if (node.text !== "arguments" && !resolver.isArgumentsLocalBinding(node)) { + if (node.text !== "arguments" || !resolver.isArgumentsLocalBinding(node)) { return node; } return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = ts.createUniqueName("arguments")); } function visitBreakOrContinueStatement(node) { if (convertedLoopState) { - var jump = node.kind === 215 ? 2 : 4; - var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels[node.label.text]) || + var jump = node.kind === 217 ? 2 : 4; + var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(node.label.text)) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; if (!node.label) { - if (node.kind === 215) { + if (node.kind === 217) { convertedLoopState.nonLocalJumps |= 2; labelMarker = "break"; } @@ -41708,7 +44815,7 @@ var ts; } } else { - if (node.kind === 215) { + if (node.kind === 217) { labelMarker = "break-" + node.label.text; setLabeledJump(convertedLoopState, true, node.label.text, labelMarker); } @@ -41741,8 +44848,9 @@ var ts; var variable = ts.createVariableDeclaration(ts.getLocalName(node, true), undefined, transformClassLikeDeclarationToExpression(node)); ts.setOriginalNode(variable, node); var statements = []; - var statement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([variable]), node); + var statement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([variable])); ts.setOriginalNode(statement, node); + ts.setTextRange(statement, node); ts.startOnNewLine(statement); statements.push(statement); if (ts.hasModifier(node, 1)) { @@ -41797,23 +44905,29 @@ var ts; ts.setEmitFlags(statement, 1536 | 384); statements.push(statement); ts.addRange(statements, endLexicalEnvironment()); - var block = ts.createBlock(ts.createNodeArray(statements, node.members), undefined, true); + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), node.members), true); ts.setEmitFlags(block, 1536); return block; } function addExtendsHelperIfNeeded(statements, node, extendsClauseElement) { if (extendsClauseElement) { - statements.push(ts.createStatement(createExtendsHelper(context, ts.getLocalName(node)), extendsClauseElement)); + statements.push(ts.setTextRange(ts.createStatement(createExtendsHelper(context, ts.getLocalName(node))), extendsClauseElement)); } } function addConstructor(statements, node, extendsClauseElement) { + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16278, 73); var constructor = ts.getFirstConstructorWithBody(node); var hasSynthesizedSuper = hasSynthesizedDefaultSuperCall(constructor, extendsClauseElement !== undefined); - var constructorFunction = ts.createFunctionDeclaration(undefined, undefined, undefined, ts.getDeclarationName(node), undefined, transformConstructorParameters(constructor, hasSynthesizedSuper), undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper), constructor || node); + var constructorFunction = ts.createFunctionDeclaration(undefined, undefined, undefined, ts.getDeclarationName(node), undefined, transformConstructorParameters(constructor, hasSynthesizedSuper), undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper)); + ts.setTextRange(constructorFunction, constructor || node); if (extendsClauseElement) { ts.setEmitFlags(constructorFunction, 8); } statements.push(constructorFunction); + exitSubtree(ancestorFacts, 49152, 0); + convertedLoopState = savedConvertedLoopState; } function transformConstructorParameters(constructor, hasSynthesizedSuper) { return ts.visitParameterList(constructor && !hasSynthesizedSuper && constructor.parameters, visitor, context) @@ -41827,48 +44941,55 @@ var ts; statementOffset = 0; } else if (constructor) { - statementOffset = ts.addPrologueDirectives(statements, constructor.body.statements, false, visitor); + statementOffset = ts.addStandardPrologue(statements, constructor.body.statements, false); } if (constructor) { addDefaultValueAssignmentsIfNeeded(statements, constructor); addRestParameterIfNeeded(statements, constructor, hasSynthesizedSuper); + if (!hasSynthesizedSuper) { + statementOffset = ts.addCustomPrologue(statements, constructor.body.statements, statementOffset, visitor); + } ts.Debug.assert(statementOffset >= 0, "statementOffset not initialized correctly!"); } - var superCaptureStatus = declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, constructor, !!extendsClauseElement, hasSynthesizedSuper, statementOffset); + var isDerivedClass = extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 94; + var superCaptureStatus = declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, constructor, isDerivedClass, hasSynthesizedSuper, statementOffset); if (superCaptureStatus === 1 || superCaptureStatus === 2) { statementOffset++; } if (constructor) { - var body = saveStateAndInvoke(constructor, function (constructor) { - isInConstructorWithCapturedSuper = superCaptureStatus === 1; - return ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, statementOffset); - }); - ts.addRange(statements, body); + if (superCaptureStatus === 1) { + hierarchyFacts |= 4096; + } + ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, statementOffset)); } - if (extendsClauseElement + if (isDerivedClass && superCaptureStatus !== 2 && !(constructor && isSufficientlyCoveredByReturnStatements(constructor.body))) { statements.push(ts.createReturn(ts.createIdentifier("_this"))); } ts.addRange(statements, endLexicalEnvironment()); - var block = ts.createBlock(ts.createNodeArray(statements, constructor ? constructor.body.statements : node.members), constructor ? constructor.body : node, true); + if (constructor) { + prependCaptureNewTargetIfNeeded(statements, constructor, false); + } + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), constructor ? constructor.body.statements : node.members), true); + ts.setTextRange(block, constructor ? constructor.body : node); if (!constructor) { ts.setEmitFlags(block, 1536); } return block; } function isSufficientlyCoveredByReturnStatements(statement) { - if (statement.kind === 216) { + if (statement.kind === 218) { return true; } - else if (statement.kind === 208) { + else if (statement.kind === 210) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement); } } - else if (statement.kind === 204) { + else if (statement.kind === 206) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -41876,8 +44997,8 @@ var ts; } return false; } - function declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, ctor, hasExtendsClause, hasSynthesizedSuper, statementOffset) { - if (!hasExtendsClause) { + function declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, ctor, isDerivedClass, hasSynthesizedSuper, statementOffset) { + if (!isDerivedClass) { if (ctor) { addCaptureThisForNodeIfNeeded(statements, ctor); } @@ -41897,42 +45018,43 @@ var ts; var ctorStatements = ctor.body.statements; if (statementOffset < ctorStatements.length) { firstStatement = ctorStatements[statementOffset]; - if (firstStatement.kind === 207 && ts.isSuperCall(firstStatement.expression)) { - var superCall = firstStatement.expression; - superCallExpression = ts.setOriginalNode(saveStateAndInvoke(superCall, visitImmediateSuperCallInBody), superCall); + if (firstStatement.kind === 209 && ts.isSuperCall(firstStatement.expression)) { + superCallExpression = visitImmediateSuperCallInBody(firstStatement.expression); } } - if (superCallExpression && statementOffset === ctorStatements.length - 1) { + if (superCallExpression + && statementOffset === ctorStatements.length - 1 + && !(ctor.transformFlags & (16384 | 32768))) { var returnStatement = ts.createReturn(superCallExpression); - if (superCallExpression.kind !== 192 - || superCallExpression.left.kind !== 179) { + if (superCallExpression.kind !== 193 + || superCallExpression.left.kind !== 180) { ts.Debug.fail("Assumed generated super call would have form 'super.call(...) || this'."); } ts.setCommentRange(returnStatement, ts.getCommentRange(ts.setEmitFlags(superCallExpression.left, 1536))); statements.push(returnStatement); return 2; } - captureThisForNode(statements, ctor, superCallExpression, firstStatement); + captureThisForNode(statements, ctor, superCallExpression || createActualThis(), firstStatement); if (superCallExpression) { return 1; } return 0; } + function createActualThis() { + return ts.setEmitFlags(ts.createThis(), 4); + } function createDefaultSuperCallOrThis() { - var actualThis = ts.createThis(); - ts.setEmitFlags(actualThis, 4); - var superCall = ts.createFunctionApply(ts.createIdentifier("_super"), actualThis, ts.createIdentifier("arguments")); - return ts.createLogicalOr(superCall, actualThis); + return ts.createLogicalOr(ts.createLogicalAnd(ts.createStrictInequality(ts.createIdentifier("_super"), ts.createNull()), ts.createFunctionApply(ts.createIdentifier("_super"), createActualThis(), ts.createIdentifier("arguments"))), createActualThis()); } function visitParameter(node) { if (node.dotDotDotToken) { return undefined; } else if (ts.isBindingPattern(node.name)) { - return ts.setOriginalNode(ts.createParameter(undefined, undefined, undefined, ts.getGeneratedNameForNode(node), undefined, undefined, undefined, node), node); + return ts.setOriginalNode(ts.setTextRange(ts.createParameter(undefined, undefined, undefined, ts.getGeneratedNameForNode(node), undefined, undefined, undefined), node), node); } else if (node.initializer) { - return ts.setOriginalNode(ts.createParameter(undefined, undefined, undefined, node.name, undefined, undefined, undefined, node), node); + return ts.setOriginalNode(ts.setTextRange(ts.createParameter(undefined, undefined, undefined, node.name, undefined, undefined, undefined), node), node); } else { return node; @@ -41947,15 +45069,15 @@ var ts; } for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { var parameter = _a[_i]; - var name_37 = parameter.name, initializer = parameter.initializer, dotDotDotToken = parameter.dotDotDotToken; + var name = parameter.name, initializer = parameter.initializer, dotDotDotToken = parameter.dotDotDotToken; if (dotDotDotToken) { continue; } - if (ts.isBindingPattern(name_37)) { - addDefaultValueAssignmentForBindingPattern(statements, parameter, name_37, initializer); + if (ts.isBindingPattern(name)) { + addDefaultValueAssignmentForBindingPattern(statements, parameter, name, initializer); } else if (initializer) { - addDefaultValueAssignmentForInitializer(statements, parameter, name_37, initializer); + addDefaultValueAssignmentForInitializer(statements, parameter, name, initializer); } } } @@ -41970,10 +45092,11 @@ var ts; } function addDefaultValueAssignmentForInitializer(statements, parameter, name, initializer) { initializer = ts.visitNode(initializer, visitor, ts.isExpression); - var statement = ts.createIf(ts.createTypeCheck(ts.getSynthesizedClone(name), "undefined"), ts.setEmitFlags(ts.createBlock([ - ts.createStatement(ts.createAssignment(ts.setEmitFlags(ts.getMutableClone(name), 48), ts.setEmitFlags(initializer, 48 | ts.getEmitFlags(initializer)), parameter)) - ], parameter), 1 | 32 | 384), undefined, parameter); + var statement = ts.createIf(ts.createTypeCheck(ts.getSynthesizedClone(name), "undefined"), ts.setEmitFlags(ts.setTextRange(ts.createBlock([ + ts.createStatement(ts.setTextRange(ts.createAssignment(ts.setEmitFlags(ts.getMutableClone(name), 48), ts.setEmitFlags(initializer, 48 | ts.getEmitFlags(initializer))), parameter)) + ]), parameter), 1 | 32 | 384)); statement.startsOnNewLine = true; + ts.setTextRange(statement, parameter); ts.setEmitFlags(statement, 384 | 32 | 524288); statements.push(statement); } @@ -41990,22 +45113,22 @@ var ts; var expressionName = ts.getSynthesizedClone(parameter.name); var restIndex = node.parameters.length - 1; var temp = ts.createLoopVariable(); - statements.push(ts.setEmitFlags(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ + statements.push(ts.setEmitFlags(ts.setTextRange(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ ts.createVariableDeclaration(declarationName, undefined, ts.createArrayLiteral([])) - ]), parameter), 524288)); - var forStatement = ts.createFor(ts.createVariableDeclarationList([ + ])), parameter), 524288)); + var forStatement = ts.createFor(ts.setTextRange(ts.createVariableDeclarationList([ ts.createVariableDeclaration(temp, undefined, ts.createLiteral(restIndex)) - ], parameter), ts.createLessThan(temp, ts.createPropertyAccess(ts.createIdentifier("arguments"), "length"), parameter), ts.createPostfixIncrement(temp, parameter), ts.createBlock([ - ts.startOnNewLine(ts.createStatement(ts.createAssignment(ts.createElementAccess(expressionName, restIndex === 0 + ]), parameter), ts.setTextRange(ts.createLessThan(temp, ts.createPropertyAccess(ts.createIdentifier("arguments"), "length")), parameter), ts.setTextRange(ts.createPostfixIncrement(temp), parameter), ts.createBlock([ + ts.startOnNewLine(ts.setTextRange(ts.createStatement(ts.createAssignment(ts.createElementAccess(expressionName, restIndex === 0 ? temp - : ts.createSubtract(temp, ts.createLiteral(restIndex))), ts.createElementAccess(ts.createIdentifier("arguments"), temp)), parameter)) + : ts.createSubtract(temp, ts.createLiteral(restIndex))), ts.createElementAccess(ts.createIdentifier("arguments"), temp))), parameter)) ])); ts.setEmitFlags(forStatement, 524288); ts.startOnNewLine(forStatement); statements.push(forStatement); } function addCaptureThisForNodeIfNeeded(statements, node) { - if (node.transformFlags & 32768 && node.kind !== 185) { + if (node.transformFlags & 32768 && node.kind !== 186) { captureThisForNode(statements, node, ts.createThis()); } } @@ -42013,29 +45136,62 @@ var ts; enableSubstitutionsForCapturedThis(); var captureThisStatement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ ts.createVariableDeclaration("_this", undefined, initializer) - ]), originalStatement); + ])); ts.setEmitFlags(captureThisStatement, 1536 | 524288); + ts.setTextRange(captureThisStatement, originalStatement); ts.setSourceMapRange(captureThisStatement, node); statements.push(captureThisStatement); } + function prependCaptureNewTargetIfNeeded(statements, node, copyOnWrite) { + if (hierarchyFacts & 16384) { + var newTarget = void 0; + switch (node.kind) { + case 186: + return statements; + case 150: + case 152: + case 153: + newTarget = ts.createVoidZero(); + break; + case 151: + newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4), "constructor"); + break; + case 227: + case 185: + newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4), 92, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4), "constructor"), ts.createVoidZero()); + break; + default: + ts.Debug.failBadSyntaxKind(node); + break; + } + var captureNewTargetStatement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration("_newTarget", undefined, newTarget) + ])); + if (copyOnWrite) { + return [captureNewTargetStatement].concat(statements); + } + statements.unshift(captureNewTargetStatement); + } + return statements; + } function addClassMembers(statements, node) { for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 203: + case 205: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 149: - statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member)); + case 150: + statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 151: case 152: + case 153: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { - statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors)); + statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 150: + case 151: break; default: ts.Debug.failBadSyntaxKind(node); @@ -42044,28 +45200,32 @@ var ts; } } function transformSemicolonClassElementToStatement(member) { - return ts.createEmptyStatement(member); + return ts.setTextRange(ts.createEmptyStatement(), member); } - function transformClassMethodDeclarationToStatement(receiver, member) { + function transformClassMethodDeclarationToStatement(receiver, member, container) { + var ancestorFacts = enterSubtree(0, 0); var commentRange = ts.getCommentRange(member); var sourceMapRange = ts.getSourceMapRange(member); var memberName = ts.createMemberAccessForPropertyName(receiver, ts.visitNode(member.name, visitor, ts.isPropertyName), member.name); - var memberFunction = transformFunctionLikeToExpression(member, member, undefined); + var memberFunction = transformFunctionLikeToExpression(member, member, undefined, container); ts.setEmitFlags(memberFunction, 1536); ts.setSourceMapRange(memberFunction, sourceMapRange); - var statement = ts.createStatement(ts.createAssignment(memberName, memberFunction), member); + var statement = ts.setTextRange(ts.createStatement(ts.createAssignment(memberName, memberFunction)), member); ts.setOriginalNode(statement, member); ts.setCommentRange(statement, commentRange); ts.setEmitFlags(statement, 48); + exitSubtree(ancestorFacts, 49152, hierarchyFacts & 49152 ? 16384 : 0); return statement; } - function transformAccessorsToStatement(receiver, accessors) { - var statement = ts.createStatement(transformAccessorsToExpression(receiver, accessors, false), ts.getSourceMapRange(accessors.firstAccessor)); + function transformAccessorsToStatement(receiver, accessors, container) { + var statement = ts.createStatement(transformAccessorsToExpression(receiver, accessors, container, false)); ts.setEmitFlags(statement, 1536); + ts.setSourceMapRange(statement, ts.getSourceMapRange(accessors.firstAccessor)); return statement; } - function transformAccessorsToExpression(receiver, _a, startsOnNewLine) { + function transformAccessorsToExpression(receiver, _a, container, startsOnNewLine) { var firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; + var ancestorFacts = enterSubtree(0, 0); var target = ts.getMutableClone(receiver); ts.setEmitFlags(target, 1536 | 32); ts.setSourceMapRange(target, firstAccessor.name); @@ -42074,7 +45234,7 @@ var ts; ts.setSourceMapRange(propertyName, firstAccessor.name); var properties = []; if (getAccessor) { - var getterFunction = transformFunctionLikeToExpression(getAccessor, undefined, undefined); + var getterFunction = transformFunctionLikeToExpression(getAccessor, undefined, undefined, container); ts.setSourceMapRange(getterFunction, ts.getSourceMapRange(getAccessor)); ts.setEmitFlags(getterFunction, 512); var getter = ts.createPropertyAssignment("get", getterFunction); @@ -42082,51 +45242,86 @@ var ts; properties.push(getter); } if (setAccessor) { - var setterFunction = transformFunctionLikeToExpression(setAccessor, undefined, undefined); + var setterFunction = transformFunctionLikeToExpression(setAccessor, undefined, undefined, container); ts.setSourceMapRange(setterFunction, ts.getSourceMapRange(setAccessor)); ts.setEmitFlags(setterFunction, 512); var setter = ts.createPropertyAssignment("set", setterFunction); ts.setCommentRange(setter, ts.getCommentRange(setAccessor)); properties.push(setter); } - properties.push(ts.createPropertyAssignment("enumerable", ts.createLiteral(true)), ts.createPropertyAssignment("configurable", ts.createLiteral(true))); + properties.push(ts.createPropertyAssignment("enumerable", ts.createTrue()), ts.createPropertyAssignment("configurable", ts.createTrue())); var call = ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), undefined, [ target, propertyName, - ts.createObjectLiteral(properties, undefined, true) + ts.createObjectLiteral(properties, true) ]); if (startsOnNewLine) { call.startsOnNewLine = true; } + exitSubtree(ancestorFacts, 49152, hierarchyFacts & 49152 ? 16384 : 0); return call; } function visitArrowFunction(node) { if (node.transformFlags & 16384) { enableSubstitutionsForCapturedThis(); } - var func = ts.createFunctionExpression(undefined, undefined, undefined, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node), node); + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16256, 66); + var func = ts.createFunctionExpression(undefined, undefined, undefined, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + ts.setTextRange(func, node); ts.setOriginalNode(func, node); ts.setEmitFlags(func, 8); + exitSubtree(ancestorFacts, 0, 0); + convertedLoopState = savedConvertedLoopState; return func; } function visitFunctionExpression(node) { - return ts.updateFunctionExpression(node, undefined, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, node.transformFlags & 64 + var ancestorFacts = ts.getEmitFlags(node) & 131072 + ? enterSubtree(16278, 69) + : enterSubtree(16286, 65); + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var parameters = ts.visitParameterList(node.parameters, visitor, context); + var body = node.transformFlags & 64 ? transformFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); + : visitFunctionBodyDownLevel(node); + var name = hierarchyFacts & 16384 + ? ts.getLocalName(node) + : node.name; + exitSubtree(ancestorFacts, 49152, 0); + convertedLoopState = savedConvertedLoopState; + return ts.updateFunctionExpression(node, undefined, node.asteriskToken, name, undefined, parameters, undefined, body); } function visitFunctionDeclaration(node) { - return ts.updateFunctionDeclaration(node, undefined, node.modifiers, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, node.transformFlags & 64 + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16286, 65); + var parameters = ts.visitParameterList(node.parameters, visitor, context); + var body = node.transformFlags & 64 ? transformFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); + : visitFunctionBodyDownLevel(node); + var name = hierarchyFacts & 16384 + ? ts.getLocalName(node) + : node.name; + exitSubtree(ancestorFacts, 49152, 0); + convertedLoopState = savedConvertedLoopState; + return ts.updateFunctionDeclaration(node, undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, name, undefined, parameters, undefined, body); } - function transformFunctionLikeToExpression(node, location, name) { - var savedContainingNonArrowFunction = enclosingNonArrowFunction; - if (node.kind !== 185) { - enclosingNonArrowFunction = node; + function transformFunctionLikeToExpression(node, location, name, container) { + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = container && ts.isClassLike(container) && !ts.hasModifier(node, 32) + ? enterSubtree(16286, 65 | 8) + : enterSubtree(16286, 65); + var parameters = ts.visitParameterList(node.parameters, visitor, context); + var body = transformFunctionBody(node); + if (hierarchyFacts & 16384 && !name && (node.kind === 227 || node.kind === 185)) { + name = ts.getGeneratedNameForNode(node); } - var expression = ts.setOriginalNode(ts.createFunctionExpression(undefined, node.asteriskToken, name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, saveStateAndInvoke(node, transformFunctionBody), location), node); - enclosingNonArrowFunction = savedContainingNonArrowFunction; - return expression; + exitSubtree(ancestorFacts, 49152, 0); + convertedLoopState = savedConvertedLoopState; + return ts.setOriginalNode(ts.setTextRange(ts.createFunctionExpression(undefined, node.asteriskToken, name, undefined, parameters, undefined, body), location), node); } function transformFunctionBody(node) { var multiLine = false; @@ -42138,7 +45333,7 @@ var ts; var statementOffset; resumeLexicalEnvironment(); if (ts.isBlock(body)) { - statementOffset = ts.addPrologueDirectives(statements, body.statements, false, visitor); + statementOffset = ts.addStandardPrologue(statements, body.statements, false); } addCaptureThisForNodeIfNeeded(statements, node); addDefaultValueAssignmentsIfNeeded(statements, node); @@ -42147,6 +45342,7 @@ var ts; multiLine = true; } if (ts.isBlock(body)) { + statementOffset = ts.addCustomPrologue(statements, body.statements, statementOffset, visitor); statementsLocation = body.statements; ts.addRange(statements, ts.visitNodes(body.statements, visitor, ts.isStatement, statementOffset)); if (!multiLine && body.multiLine) { @@ -42154,7 +45350,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 185); + ts.Debug.assert(node.kind === 186); statementsLocation = ts.moveRangeEnd(body, -1); var equalsGreaterThanToken = node.equalsGreaterThanToken; if (!ts.nodeIsSynthesized(equalsGreaterThanToken) && !ts.nodeIsSynthesized(body)) { @@ -42166,17 +45362,20 @@ var ts; } } var expression = ts.visitNode(body, visitor, ts.isExpression); - var returnStatement = ts.createReturn(expression, body); + var returnStatement = ts.createReturn(expression); + ts.setTextRange(returnStatement, body); ts.setEmitFlags(returnStatement, 384 | 32 | 1024); statements.push(returnStatement); closeBraceLocation = body; } var lexicalEnvironment = context.endLexicalEnvironment(); ts.addRange(statements, lexicalEnvironment); + prependCaptureNewTargetIfNeeded(statements, node, false); if (!multiLine && lexicalEnvironment && lexicalEnvironment.length) { multiLine = true; } - var block = ts.createBlock(ts.createNodeArray(statements, statementsLocation), node.body, multiLine); + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), multiLine); + ts.setTextRange(block, node.body); if (!multiLine && singleLine) { ts.setEmitFlags(block, 1); } @@ -42186,11 +45385,26 @@ var ts; ts.setOriginalNode(block, node.body); return block; } + function visitFunctionBodyDownLevel(node) { + var updated = ts.visitFunctionBody(node.body, functionBodyVisitor, context); + return ts.updateBlock(updated, ts.setTextRange(ts.createNodeArray(prependCaptureNewTargetIfNeeded(updated.statements, node, true)), updated.statements)); + } + function visitBlock(node, isFunctionBody) { + if (isFunctionBody) { + return ts.visitEachChild(node, visitor, context); + } + var ancestorFacts = hierarchyFacts & 256 + ? enterSubtree(4032, 512) + : enterSubtree(3904, 128); + var updated = ts.visitEachChild(node, visitor, context); + exitSubtree(ancestorFacts, 0, 0); + return updated; + } function visitExpressionStatement(node) { switch (node.expression.kind) { - case 183: + case 184: return ts.updateStatement(node, visitParenthesizedExpression(node.expression, false)); - case 192: + case 193: return ts.updateStatement(node, visitBinaryExpression(node.expression, false)); } return ts.visitEachChild(node, visitor, context); @@ -42198,9 +45412,9 @@ var ts; function visitParenthesizedExpression(node, needsDestructuringValue) { if (!needsDestructuringValue) { switch (node.expression.kind) { - case 183: + case 184: return ts.updateParen(node, visitParenthesizedExpression(node.expression, false)); - case 192: + case 193: return ts.updateParen(node, visitBinaryExpression(node.expression, false)); } } @@ -42210,9 +45424,12 @@ var ts; if (ts.isDestructuringAssignment(node)) { return ts.flattenDestructuringAssignment(node, visitor, context, 0, needsDestructuringValue); } + return ts.visitEachChild(node, visitor, context); } function visitVariableStatement(node) { - if (convertedLoopState && (ts.getCombinedNodeFlags(node.declarationList) & 3) == 0) { + var ancestorFacts = enterSubtree(0, ts.hasModifier(node, 1) ? 32 : 0); + var updated; + if (convertedLoopState && (node.declarationList.flags & 3) === 0) { var assignments = void 0; for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; @@ -42225,53 +45442,59 @@ var ts; else { assignment = ts.createBinary(decl.name, 57, ts.visitNode(decl.initializer, visitor, ts.isExpression)); } - (assignments || (assignments = [])).push(assignment); + assignments = ts.append(assignments, assignment); } } if (assignments) { - return ts.createStatement(ts.reduceLeft(assignments, function (acc, v) { return ts.createBinary(v, 25, acc); }), node); + updated = ts.setTextRange(ts.createStatement(ts.reduceLeft(assignments, function (acc, v) { return ts.createBinary(v, 25, acc); })), node); } else { - return undefined; + updated = undefined; } } - return ts.visitEachChild(node, visitor, context); + else { + updated = ts.visitEachChild(node, visitor, context); + } + exitSubtree(ancestorFacts, 0, 0); + return updated; } function visitVariableDeclarationList(node) { - if (node.flags & 3) { - enableSubstitutionsForBlockScopedBindings(); + if (node.transformFlags & 64) { + if (node.flags & 3) { + enableSubstitutionsForBlockScopedBindings(); + } + var declarations = ts.flatten(ts.map(node.declarations, node.flags & 1 + ? visitVariableDeclarationInLetDeclarationList + : visitVariableDeclaration)); + var declarationList = ts.createVariableDeclarationList(declarations); + ts.setOriginalNode(declarationList, node); + ts.setTextRange(declarationList, node); + ts.setCommentRange(declarationList, node); + if (node.transformFlags & 8388608 + && (ts.isBindingPattern(node.declarations[0].name) + || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) { + var firstDeclaration = ts.firstOrUndefined(declarations); + var lastDeclaration = ts.lastOrUndefined(declarations); + ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); + } + return declarationList; } - var declarations = ts.flatten(ts.map(node.declarations, node.flags & 1 - ? visitVariableDeclarationInLetDeclarationList - : visitVariableDeclaration)); - var declarationList = ts.createVariableDeclarationList(declarations, node); - ts.setOriginalNode(declarationList, node); - ts.setCommentRange(declarationList, node); - if (node.transformFlags & 8388608 - && (ts.isBindingPattern(node.declarations[0].name) - || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) { - var firstDeclaration = ts.firstOrUndefined(declarations); - var lastDeclaration = ts.lastOrUndefined(declarations); - ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); - } - return declarationList; + return ts.visitEachChild(node, visitor, context); } function shouldEmitExplicitInitializerForLetDeclaration(node) { var flags = resolver.getNodeCheckFlags(node); var isCapturedInFunction = flags & 131072; var isDeclaredInLoop = flags & 262144; - var emittedAsTopLevel = ts.isBlockScopedContainerTopLevel(enclosingBlockScopeContainer) + var emittedAsTopLevel = (hierarchyFacts & 64) !== 0 || (isCapturedInFunction && isDeclaredInLoop - && ts.isBlock(enclosingBlockScopeContainer) - && ts.isIterationStatement(enclosingBlockScopeContainerParent, false)); + && (hierarchyFacts & 512) !== 0); var emitExplicitInitializer = !emittedAsTopLevel - && enclosingBlockScopeContainer.kind !== 212 - && enclosingBlockScopeContainer.kind !== 213 + && (hierarchyFacts & 2048) === 0 && (!resolver.isDeclarationWithCollidingName(node) || (isDeclaredInLoop && !isCapturedInFunction - && !ts.isIterationStatement(enclosingBlockScopeContainer, false))); + && (hierarchyFacts & (1024 | 2048)) === 0)); return emitExplicitInitializer; } function visitVariableDeclarationInLetDeclarationList(node) { @@ -42287,84 +45510,94 @@ var ts; return ts.visitEachChild(node, visitor, context); } function visitVariableDeclaration(node) { + var ancestorFacts = enterSubtree(32, 0); + var updated; if (ts.isBindingPattern(node.name)) { - var hoistTempVariables = enclosingVariableStatement - && ts.hasModifier(enclosingVariableStatement, 1); - return ts.flattenDestructuringBinding(node, visitor, context, 0, undefined, hoistTempVariables); - } - return ts.visitEachChild(node, visitor, context); - } - function visitLabeledStatement(node) { - if (convertedLoopState) { - if (!convertedLoopState.labels) { - convertedLoopState.labels = ts.createMap(); - } - convertedLoopState.labels[node.label.text] = node.label.text; - } - var result; - if (ts.isIterationStatement(node.statement, false) && shouldConvertIterationStatementBody(node.statement)) { - result = ts.visitNodes(ts.createNodeArray([node.statement]), visitor, ts.isStatement); + updated = ts.flattenDestructuringBinding(node, visitor, context, 0, undefined, (ancestorFacts & 32) !== 0); } else { - result = ts.visitEachChild(node, visitor, context); + updated = ts.visitEachChild(node, visitor, context); } - if (convertedLoopState) { - convertedLoopState.labels[node.label.text] = undefined; + exitSubtree(ancestorFacts, 0, 0); + return updated; + } + function recordLabel(node) { + convertedLoopState.labels.set(node.label.text, node.label.text); + } + function resetLabel(node) { + convertedLoopState.labels.set(node.label.text, undefined); + } + function visitLabeledStatement(node) { + if (convertedLoopState && !convertedLoopState.labels) { + convertedLoopState.labels = ts.createMap(); } - return result; + var statement = ts.unwrapInnermostStatementOfLabel(node, convertedLoopState && recordLabel); + return ts.isIterationStatement(statement, false) + ? visitIterationStatement(statement, node) + : ts.restoreEnclosingLabel(ts.visitNode(statement, visitor, ts.isStatement), node, convertedLoopState && resetLabel); } - function visitDoStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitIterationStatement(node, outermostLabeledStatement) { + switch (node.kind) { + case 211: + case 212: + return visitDoOrWhileStatement(node, outermostLabeledStatement); + case 213: + return visitForStatement(node, outermostLabeledStatement); + case 214: + return visitForInStatement(node, outermostLabeledStatement); + case 215: + return visitForOfStatement(node, outermostLabeledStatement); + } } - function visitWhileStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitIterationStatementWithFacts(excludeFacts, includeFacts, node, outermostLabeledStatement, convert) { + var ancestorFacts = enterSubtree(excludeFacts, includeFacts); + var updated = convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, convert); + exitSubtree(ancestorFacts, 0, 0); + return updated; } - function visitForStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitDoOrWhileStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(0, 256, node, outermostLabeledStatement); } - function visitForInStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitForStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(3008, 1280, node, outermostLabeledStatement); } - function visitForOfStatement(node) { - return convertIterationStatementBodyIfNecessary(node, convertForOfToFor); + function visitForInStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(1984, 2304, node, outermostLabeledStatement); } - function convertForOfToFor(node, convertedLoopBodyStatements) { - var expression = ts.visitNode(node.expression, visitor, ts.isExpression); - var initializer = node.initializer; + function visitForOfStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(1984, 2304, node, outermostLabeledStatement, compilerOptions.downlevelIteration ? convertForOfStatementForIterable : convertForOfStatementForArray); + } + function convertForOfStatementHead(node, boundValue, convertedLoopBodyStatements) { var statements = []; - var counter = ts.createLoopVariable(); - var rhsReference = expression.kind === 70 - ? ts.createUniqueName(expression.text) - : ts.createTempVariable(undefined); - var elementAccess = ts.createElementAccess(rhsReference, counter); - if (ts.isVariableDeclarationList(initializer)) { - if (initializer.flags & 3) { + if (ts.isVariableDeclarationList(node.initializer)) { + if (node.initializer.flags & 3) { enableSubstitutionsForBlockScopedBindings(); } - var firstOriginalDeclaration = ts.firstOrUndefined(initializer.declarations); + var firstOriginalDeclaration = ts.firstOrUndefined(node.initializer.declarations); if (firstOriginalDeclaration && ts.isBindingPattern(firstOriginalDeclaration.name)) { - var declarations = ts.flattenDestructuringBinding(firstOriginalDeclaration, visitor, context, 0, elementAccess); - var declarationList = ts.createVariableDeclarationList(declarations, initializer); - ts.setOriginalNode(declarationList, initializer); + var declarations = ts.flattenDestructuringBinding(firstOriginalDeclaration, visitor, context, 0, boundValue); + var declarationList = ts.setTextRange(ts.createVariableDeclarationList(declarations), node.initializer); + ts.setOriginalNode(declarationList, node.initializer); var firstDeclaration = declarations[0]; var lastDeclaration = ts.lastOrUndefined(declarations); ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); statements.push(ts.createVariableStatement(undefined, declarationList)); } else { - statements.push(ts.createVariableStatement(undefined, ts.setOriginalNode(ts.createVariableDeclarationList([ - ts.createVariableDeclaration(firstOriginalDeclaration ? firstOriginalDeclaration.name : ts.createTempVariable(undefined), undefined, ts.createElementAccess(rhsReference, counter)) - ], ts.moveRangePos(initializer, -1)), initializer), ts.moveRangeEnd(initializer, -1))); + statements.push(ts.setTextRange(ts.createVariableStatement(undefined, ts.setOriginalNode(ts.setTextRange(ts.createVariableDeclarationList([ + ts.createVariableDeclaration(firstOriginalDeclaration ? firstOriginalDeclaration.name : ts.createTempVariable(undefined), undefined, boundValue) + ]), ts.moveRangePos(node.initializer, -1)), node.initializer)), ts.moveRangeEnd(node.initializer, -1))); } } else { - var assignment = ts.createAssignment(initializer, elementAccess); + var assignment = ts.createAssignment(node.initializer, boundValue); if (ts.isDestructuringAssignment(assignment)) { - statements.push(ts.createStatement(ts.flattenDestructuringAssignment(assignment, visitor, context, 0))); + ts.aggregateTransformFlags(assignment); + statements.push(ts.createStatement(visitBinaryExpression(assignment, false))); } else { - assignment.end = initializer.end; - statements.push(ts.createStatement(assignment, ts.moveRangeEnd(initializer, -1))); + assignment.end = node.initializer.end; + statements.push(ts.setTextRange(ts.createStatement(ts.visitNode(assignment, visitor, ts.isExpression)), ts.moveRangeEnd(node.initializer, -1))); } } var bodyLocation; @@ -42373,7 +45606,7 @@ var ts; ts.addRange(statements, convertedLoopBodyStatements); } else { - var statement = ts.visitNode(node.statement, visitor, ts.isStatement); + var statement = ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock); if (ts.isBlock(statement)) { ts.addRange(statements, statement.statements); bodyLocation = statement; @@ -42383,39 +45616,82 @@ var ts; statements.push(statement); } } + return ts.setEmitFlags(ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), true), bodyLocation), 48 | 384); + } + function convertForOfStatementForArray(node, outermostLabeledStatement, convertedLoopBodyStatements) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + var counter = ts.createLoopVariable(); + var rhsReference = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(expression) : ts.createTempVariable(undefined); ts.setEmitFlags(expression, 48 | ts.getEmitFlags(expression)); - var body = ts.createBlock(ts.createNodeArray(statements, statementsLocation), bodyLocation); - ts.setEmitFlags(body, 48 | 384); - var forStatement = ts.createFor(ts.setEmitFlags(ts.createVariableDeclarationList([ - ts.createVariableDeclaration(counter, undefined, ts.createLiteral(0), ts.moveRangePos(node.expression, -1)), - ts.createVariableDeclaration(rhsReference, undefined, expression, node.expression) - ], node.expression), 1048576), ts.createLessThan(counter, ts.createPropertyAccess(rhsReference, "length"), node.expression), ts.createPostfixIncrement(counter, node.expression), body, node); + var forStatement = ts.setTextRange(ts.createFor(ts.setEmitFlags(ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(counter, undefined, ts.createLiteral(0)), ts.moveRangePos(node.expression, -1)), + ts.setTextRange(ts.createVariableDeclaration(rhsReference, undefined, expression), node.expression) + ]), node.expression), 1048576), ts.setTextRange(ts.createLessThan(counter, ts.createPropertyAccess(rhsReference, "length")), node.expression), ts.setTextRange(ts.createPostfixIncrement(counter), node.expression), convertForOfStatementHead(node, ts.createElementAccess(rhsReference, counter), convertedLoopBodyStatements)), node); ts.setEmitFlags(forStatement, 256); - return forStatement; + ts.setTextRange(forStatement, node); + return ts.restoreEnclosingLabel(forStatement, outermostLabeledStatement, convertedLoopState && resetLabel); + } + function convertForOfStatementForIterable(node, outermostLabeledStatement, convertedLoopBodyStatements) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + var iterator = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(expression) : ts.createTempVariable(undefined); + var result = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(iterator) : ts.createTempVariable(undefined); + var errorRecord = ts.createUniqueName("e"); + var catchVariable = ts.getGeneratedNameForNode(errorRecord); + var returnMethod = ts.createTempVariable(undefined); + var values = ts.createValuesHelper(context, expression, node.expression); + var next = ts.createCall(ts.createPropertyAccess(iterator, "next"), undefined, []); + hoistVariableDeclaration(errorRecord); + hoistVariableDeclaration(returnMethod); + var forStatement = ts.setEmitFlags(ts.setTextRange(ts.createFor(ts.setEmitFlags(ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(iterator, undefined, values), node.expression), + ts.createVariableDeclaration(result, undefined, next) + ]), node.expression), 1048576), ts.createLogicalNot(ts.createPropertyAccess(result, "done")), ts.createAssignment(result, next), convertForOfStatementHead(node, ts.createPropertyAccess(result, "value"), convertedLoopBodyStatements)), node), 256); + return ts.createTry(ts.createBlock([ + ts.restoreEnclosingLabel(forStatement, outermostLabeledStatement, convertedLoopState && resetLabel) + ]), ts.createCatchClause(ts.createVariableDeclaration(catchVariable), ts.setEmitFlags(ts.createBlock([ + ts.createStatement(ts.createAssignment(errorRecord, ts.createObjectLiteral([ + ts.createPropertyAssignment("error", catchVariable) + ]))) + ]), 1)), ts.createBlock([ + ts.createTry(ts.createBlock([ + ts.setEmitFlags(ts.createIf(ts.createLogicalAnd(ts.createLogicalAnd(result, ts.createLogicalNot(ts.createPropertyAccess(result, "done"))), ts.createAssignment(returnMethod, ts.createPropertyAccess(iterator, "return"))), ts.createStatement(ts.createFunctionCall(returnMethod, iterator, []))), 1), + ]), undefined, ts.setEmitFlags(ts.createBlock([ + ts.setEmitFlags(ts.createIf(errorRecord, ts.createThrow(ts.createPropertyAccess(errorRecord, "error"))), 1) + ]), 1)) + ])); } function visitObjectLiteralExpression(node) { var properties = node.properties; var numProperties = properties.length; var numInitialProperties = numProperties; + var numInitialPropertiesWithoutYield = numProperties; for (var i = 0; i < numProperties; i++) { var property = properties[i]; - if (property.transformFlags & 16777216 - || property.name.kind === 142) { + if ((property.transformFlags & 16777216 && hierarchyFacts & 4) + && i < numInitialPropertiesWithoutYield) { + numInitialPropertiesWithoutYield = i; + } + if (property.name.kind === 143) { numInitialProperties = i; break; } } - ts.Debug.assert(numInitialProperties !== numProperties); - var temp = ts.createTempVariable(hoistVariableDeclaration); - var expressions = []; - var assignment = ts.createAssignment(temp, ts.setEmitFlags(ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), undefined, node.multiLine), 32768)); - if (node.multiLine) { - assignment.startsOnNewLine = true; + if (numInitialProperties !== numProperties) { + if (numInitialPropertiesWithoutYield < numInitialProperties) { + numInitialProperties = numInitialPropertiesWithoutYield; + } + var temp = ts.createTempVariable(hoistVariableDeclaration); + var expressions = []; + var assignment = ts.createAssignment(temp, ts.setEmitFlags(ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), node.multiLine), 32768)); + if (node.multiLine) { + assignment.startsOnNewLine = true; + } + expressions.push(assignment); + addObjectLiteralMembers(expressions, node, temp, numInitialProperties); + expressions.push(node.multiLine ? ts.startOnNewLine(ts.getMutableClone(temp)) : temp); + return ts.inlineExpressions(expressions); } - expressions.push(assignment); - addObjectLiteralMembers(expressions, node, temp, numInitialProperties); - expressions.push(node.multiLine ? ts.startOnNewLine(ts.getMutableClone(temp)) : temp); - return ts.inlineExpressions(expressions); + return ts.visitEachChild(node, visitor, context); } function shouldConvertIterationStatementBody(node) { return (resolver.getNodeCheckFlags(node) & 65536) !== 0; @@ -42439,14 +45715,16 @@ var ts; } } } - function convertIterationStatementBodyIfNecessary(node, convert) { + function convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, convert) { if (!shouldConvertIterationStatementBody(node)) { var saveAllowedNonLabeledJumps = void 0; if (convertedLoopState) { saveAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; convertedLoopState.allowedNonLabeledJumps = 2 | 4; } - var result = convert ? convert(node, undefined) : ts.visitEachChild(node, visitor, context); + var result = convert + ? convert(node, outermostLabeledStatement, undefined) + : ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), outermostLabeledStatement, convertedLoopState && resetLabel); if (convertedLoopState) { convertedLoopState.allowedNonLabeledJumps = saveAllowedNonLabeledJumps; } @@ -42455,11 +45733,11 @@ var ts; var functionName = ts.createUniqueName("_loop"); var loopInitializer; switch (node.kind) { - case 211: - case 212: case 213: + case 214: + case 215: var initializer = node.initializer; - if (initializer && initializer.kind === 224) { + if (initializer && initializer.kind === 226) { loopInitializer = initializer; } break; @@ -42485,19 +45763,26 @@ var ts; convertedLoopState.hoistedLocalVariables = outerConvertedLoopState.hoistedLocalVariables; } } - var loopBody = ts.visitNode(node.statement, visitor, ts.isStatement); + startLexicalEnvironment(); + var loopBody = ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock); + var lexicalEnvironment = endLexicalEnvironment(); var currentState = convertedLoopState; convertedLoopState = outerConvertedLoopState; - if (loopOutParameters.length) { + if (loopOutParameters.length || lexicalEnvironment) { var statements_4 = ts.isBlock(loopBody) ? loopBody.statements.slice() : [loopBody]; - copyOutParameters(loopOutParameters, 1, statements_4); - loopBody = ts.createBlock(statements_4, undefined, true); + if (loopOutParameters.length) { + copyOutParameters(loopOutParameters, 1, statements_4); + } + ts.addRange(statements_4, lexicalEnvironment); + loopBody = ts.createBlock(statements_4, true); } - if (!ts.isBlock(loopBody)) { - loopBody = ts.createBlock([loopBody], undefined, true); + if (ts.isBlock(loopBody)) { + loopBody.multiLine = true; } - var isAsyncBlockContainingAwait = enclosingNonArrowFunction - && (ts.getEmitFlags(enclosingNonArrowFunction) & 131072) !== 0 + else { + loopBody = ts.createBlock([loopBody], true); + } + var isAsyncBlockContainingAwait = hierarchyFacts & 4 && (node.statement.transformFlags & 16777216) !== 0; var loopBodyFlags = 0; if (currentState.containsLexicalThis) { @@ -42556,19 +45841,18 @@ var ts; var convertedLoopBodyStatements = generateCallToConvertedLoop(functionName, loopParameters, currentState, isAsyncBlockContainingAwait); var loop; if (convert) { - loop = convert(node, convertedLoopBodyStatements); + loop = convert(node, outermostLabeledStatement, convertedLoopBodyStatements); } else { - loop = ts.getMutableClone(node); - loop.statement = undefined; - loop = ts.visitEachChild(loop, visitor, context); - loop.statement = ts.createBlock(convertedLoopBodyStatements, undefined, true); - loop.transformFlags = 0; - ts.aggregateTransformFlags(loop); + var clone_4 = ts.getMutableClone(node); + clone_4.statement = undefined; + clone_4 = ts.visitEachChild(clone_4, visitor, context); + clone_4.statement = ts.createBlock(convertedLoopBodyStatements, true); + clone_4.transformFlags = 0; + ts.aggregateTransformFlags(clone_4); + loop = ts.restoreEnclosingLabel(clone_4, outermostLabeledStatement, convertedLoopState && resetLabel); } - statements.push(currentParent.kind === 219 - ? ts.createLabel(currentParent.label, loop) - : loop); + statements.push(loop); return statements; } function copyOutParameter(outParam, copyDirection) { @@ -42589,7 +45873,9 @@ var ts; !state.labeledNonLocalBreaks && !state.labeledNonLocalContinues; var call = ts.createCall(loopFunctionExpressionName, undefined, ts.map(parameters, function (p) { return p.name; })); - var callResult = isAsyncBlockContainingAwait ? ts.createYield(ts.createToken(38), call) : call; + var callResult = isAsyncBlockContainingAwait + ? ts.createYield(ts.createToken(38), ts.setEmitFlags(call, 4194304)) + : call; if (isSimpleLoop) { statements.push(ts.createStatement(callResult)); copyOutParameters(state.loopOutParameters, 0, statements); @@ -42627,23 +45913,22 @@ var ts; if (!state.labeledNonLocalBreaks) { state.labeledNonLocalBreaks = ts.createMap(); } - state.labeledNonLocalBreaks[labelText] = labelMarker; + state.labeledNonLocalBreaks.set(labelText, labelMarker); } else { if (!state.labeledNonLocalContinues) { state.labeledNonLocalContinues = ts.createMap(); } - state.labeledNonLocalContinues[labelText] = labelMarker; + state.labeledNonLocalContinues.set(labelText, labelMarker); } } function processLabeledJumps(table, isBreak, loopResultName, outerLoop, caseClauses) { if (!table) { return; } - for (var labelText in table) { - var labelMarker = table[labelText]; + table.forEach(function (labelMarker, labelText) { var statements = []; - if (!outerLoop || (outerLoop.labels && outerLoop.labels[labelText])) { + if (!outerLoop || (outerLoop.labels && outerLoop.labels.get(labelText))) { var label = ts.createIdentifier(labelText); statements.push(isBreak ? ts.createBreak(label) : ts.createContinue(label)); } @@ -42652,7 +45937,7 @@ var ts; statements.push(ts.createReturn(loopResultName)); } caseClauses.push(ts.createCaseClause(ts.createLiteral(labelMarker), statements)); - } + }); } function processLoopVariableDeclaration(decl, loopParameters, loopOutParameters) { var name = decl.name; @@ -42667,7 +45952,7 @@ var ts; else { loopParameters.push(ts.createParameter(undefined, undefined, undefined, name)); if (resolver.getNodeCheckFlags(decl) & 2097152) { - var outParamName = ts.createUniqueName("out_" + name.text); + var outParamName = ts.createUniqueName("out_" + ts.unescapeIdentifier(name.text)); loopOutParameters.push({ originalName: name, outParamName: outParamName }); } } @@ -42678,22 +45963,22 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 151: case 152: + case 153: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { - expressions.push(transformAccessorsToExpression(receiver, accessors, node.multiLine)); + expressions.push(transformAccessorsToExpression(receiver, accessors, node, node.multiLine)); } break; - case 257: + case 150: + expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); + break; + case 260: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 258: + case 261: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 149: - expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node.multiLine)); - break; default: ts.Debug.failBadSyntaxKind(node); break; @@ -42701,34 +45986,49 @@ var ts; } } function transformPropertyAssignmentToExpression(property, receiver, startsOnNewLine) { - var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.visitNode(property.initializer, visitor, ts.isExpression), property); + var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.visitNode(property.initializer, visitor, ts.isExpression)); + ts.setTextRange(expression, property); if (startsOnNewLine) { expression.startsOnNewLine = true; } return expression; } function transformShorthandPropertyAssignmentToExpression(property, receiver, startsOnNewLine) { - var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.getSynthesizedClone(property.name), property); + var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.getSynthesizedClone(property.name)); + ts.setTextRange(expression, property); if (startsOnNewLine) { expression.startsOnNewLine = true; } return expression; } - function transformObjectLiteralMethodDeclarationToExpression(method, receiver, startsOnNewLine) { - var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(method.name, visitor, ts.isPropertyName)), transformFunctionLikeToExpression(method, method, undefined), method); + function transformObjectLiteralMethodDeclarationToExpression(method, receiver, container, startsOnNewLine) { + var ancestorFacts = enterSubtree(0, 0); + var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(method.name, visitor, ts.isPropertyName)), transformFunctionLikeToExpression(method, method, undefined, container)); + ts.setTextRange(expression, method); if (startsOnNewLine) { expression.startsOnNewLine = true; } + exitSubtree(ancestorFacts, 49152, hierarchyFacts & 49152 ? 16384 : 0); return expression; } function visitCatchClause(node) { - ts.Debug.assert(ts.isBindingPattern(node.variableDeclaration.name)); - var temp = ts.createTempVariable(undefined); - var newVariableDeclaration = ts.createVariableDeclaration(temp, undefined, undefined, node.variableDeclaration); - var vars = ts.flattenDestructuringBinding(node.variableDeclaration, visitor, context, 0, temp); - var list = ts.createVariableDeclarationList(vars, node.variableDeclaration, node.variableDeclaration.flags); - var destructure = ts.createVariableStatement(undefined, list); - return ts.updateCatchClause(node, newVariableDeclaration, addStatementToStartOfBlock(node.block, destructure)); + var ancestorFacts = enterSubtree(4032, 0); + var updated; + if (ts.isBindingPattern(node.variableDeclaration.name)) { + var temp = ts.createTempVariable(undefined); + var newVariableDeclaration = ts.createVariableDeclaration(temp); + ts.setTextRange(newVariableDeclaration, node.variableDeclaration); + var vars = ts.flattenDestructuringBinding(node.variableDeclaration, visitor, context, 0, temp); + var list = ts.createVariableDeclarationList(vars); + ts.setTextRange(list, node.variableDeclaration); + var destructure = ts.createVariableStatement(undefined, list); + updated = ts.updateCatchClause(node, newVariableDeclaration, addStatementToStartOfBlock(node.block, destructure)); + } + else { + updated = ts.visitEachChild(node, visitor, context); + } + exitSubtree(ancestorFacts, 0, 0); + return updated; } function addStatementToStartOfBlock(block, statement) { var transformedStatements = ts.visitNodes(block.statements, visitor, ts.isStatement); @@ -42736,21 +46036,43 @@ var ts; } function visitMethodDeclaration(node) { ts.Debug.assert(!ts.isComputedPropertyName(node.name)); - var functionExpression = transformFunctionLikeToExpression(node, ts.moveRangePos(node, -1), undefined); + var functionExpression = transformFunctionLikeToExpression(node, ts.moveRangePos(node, -1), undefined, undefined); ts.setEmitFlags(functionExpression, 512 | ts.getEmitFlags(functionExpression)); - return ts.createPropertyAssignment(node.name, functionExpression, node); + return ts.setTextRange(ts.createPropertyAssignment(node.name, functionExpression), node); + } + function visitAccessorDeclaration(node) { + ts.Debug.assert(!ts.isComputedPropertyName(node.name)); + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16286, 65); + var updated = ts.visitEachChild(node, visitor, context); + exitSubtree(ancestorFacts, 49152, 0); + convertedLoopState = savedConvertedLoopState; + return updated; } function visitShorthandPropertyAssignment(node) { - return ts.createPropertyAssignment(node.name, ts.getSynthesizedClone(node.name), node); + return ts.setTextRange(ts.createPropertyAssignment(node.name, ts.getSynthesizedClone(node.name)), node); + } + function visitComputedPropertyName(node) { + var ancestorFacts = enterSubtree(0, 8192); + var updated = ts.visitEachChild(node, visitor, context); + exitSubtree(ancestorFacts, 49152, hierarchyFacts & 49152 ? 32768 : 0); + return updated; } function visitYieldExpression(node) { return ts.visitEachChild(node, visitor, context); } function visitArrayLiteralExpression(node) { - return transformAndSpreadElements(node.elements, true, node.multiLine, node.elements.hasTrailingComma); + if (node.transformFlags & 64) { + return transformAndSpreadElements(node.elements, true, node.multiLine, node.elements.hasTrailingComma); + } + return ts.visitEachChild(node, visitor, context); } function visitCallExpression(node) { - return visitCallExpressionWithPotentialCapturedThisAssignment(node, true); + if (node.transformFlags & 64) { + return visitCallExpressionWithPotentialCapturedThisAssignment(node, true); + } + return ts.updateCall(node, ts.visitNode(node.expression, callExpressionVisitor, ts.isExpression), undefined, ts.visitNodes(node.arguments, visitor, ts.isExpression)); } function visitImmediateSuperCallInBody(node) { return visitCallExpressionWithPotentialCapturedThisAssignment(node, false); @@ -42762,38 +46084,54 @@ var ts; } var resultingCall; if (node.transformFlags & 524288) { - resultingCall = ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, false, false, false)); + resultingCall = ts.createFunctionApply(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, false, false, false)); } else { - resultingCall = ts.createFunctionCall(ts.visitNode(target, visitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), node); + resultingCall = ts.createFunctionCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), node); } if (node.expression.kind === 96) { var actualThis = ts.createThis(); ts.setEmitFlags(actualThis, 4); var initializer = ts.createLogicalOr(resultingCall, actualThis); - return assignToCapturedThis + resultingCall = assignToCapturedThis ? ts.createAssignment(ts.createIdentifier("_this"), initializer) : initializer; } - return resultingCall; + return ts.setOriginalNode(resultingCall, node); } function visitNewExpression(node) { - ts.Debug.assert((node.transformFlags & 524288) !== 0); - var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; - return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray([ts.createVoidZero()].concat(node.arguments)), false, false, false)), undefined, []); + if (node.transformFlags & 524288) { + var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; + return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray([ts.createVoidZero()].concat(node.arguments)), false, false, false)), undefined, []); + } + return ts.visitEachChild(node, visitor, context); } function transformAndSpreadElements(elements, needsUniqueCopy, multiLine, hasTrailingComma) { var numElements = elements.length; var segments = ts.flatten(ts.spanMap(elements, partitionSpread, function (partition, visitPartition, _start, end) { return visitPartition(partition, multiLine, hasTrailingComma && end === numElements); })); - if (segments.length === 1) { - var firstElement = elements[0]; - return needsUniqueCopy && ts.isSpreadExpression(firstElement) && firstElement.expression.kind !== 175 - ? ts.createArraySlice(segments[0]) - : segments[0]; + if (compilerOptions.downlevelIteration) { + if (segments.length === 1) { + var firstSegment = segments[0]; + if (ts.isCallExpression(firstSegment) + && ts.isIdentifier(firstSegment.expression) + && (ts.getEmitFlags(firstSegment.expression) & 4096) + && firstSegment.expression.text === "___spread") { + return segments[0]; + } + } + return ts.createSpreadHelper(context, segments); + } + else { + if (segments.length === 1) { + var firstElement = elements[0]; + return needsUniqueCopy && ts.isSpreadExpression(firstElement) && firstElement.expression.kind !== 176 + ? ts.createArraySlice(segments[0]) + : segments[0]; + } + return ts.createArrayConcat(segments.shift(), segments); } - return ts.createArrayConcat(segments.shift(), segments); } function partitionSpread(node) { return ts.isSpreadExpression(node) @@ -42804,7 +46142,7 @@ var ts; return ts.map(chunk, visitExpressionOfSpread); } function visitSpanOfNonSpreads(chunk, multiLine, hasTrailingComma) { - return ts.createArrayLiteral(ts.visitNodes(ts.createNodeArray(chunk, undefined, hasTrailingComma), visitor, ts.isExpression), undefined, multiLine); + return ts.createArrayLiteral(ts.visitNodes(ts.createNodeArray(chunk, hasTrailingComma), visitor, ts.isExpression), multiLine); } function visitSpreadElement(node) { return ts.visitNode(node.expression, visitor, ts.isExpression); @@ -42813,7 +46151,19 @@ var ts; return ts.visitNode(node.expression, visitor, ts.isExpression); } function visitTemplateLiteral(node) { - return ts.createLiteral(node.text, node); + return ts.setTextRange(ts.createLiteral(node.text), node); + } + function visitStringLiteral(node) { + if (node.hasExtendedUnicodeEscape) { + return ts.setTextRange(ts.createLiteral(node.text), node); + } + return node; + } + function visitNumericLiteral(node) { + if (node.numericLiteralFlags & 48) { + return ts.setTextRange(ts.createNumericLiteral(node.text), node); + } + return node; } function visitTaggedTemplateExpression(node) { var tag = ts.visitNode(node.tag, visitor, ts.isExpression); @@ -42847,7 +46197,7 @@ var ts; var isLast = node.kind === 12 || node.kind === 15; text = text.substring(1, text.length - (isLast ? 1 : 2)); text = text.replace(/\r\n?/g, "\n"); - return ts.createLiteral(text, node); + return ts.setTextRange(ts.createLiteral(text), node); } function visitTemplateExpression(node) { var expressions = []; @@ -42855,7 +46205,8 @@ var ts; addTemplateSpans(expressions, node); var expression = ts.reduceLeft(expressions, ts.createAdd); if (ts.nodeIsSynthesized(expression)) { - ts.setTextRange(expression, node); + expression.pos = node.pos; + expression.end = node.end; } return expression; } @@ -42878,21 +46229,34 @@ var ts; } } } - function visitSuperKeyword() { - return enclosingNonAsyncFunctionBody - && ts.isClassElement(enclosingNonAsyncFunctionBody) - && !ts.hasModifier(enclosingNonAsyncFunctionBody, 32) - && currentParent.kind !== 179 + function visitSuperKeyword(isExpressionOfCall) { + return hierarchyFacts & 8 + && !isExpressionOfCall ? ts.createPropertyAccess(ts.createIdentifier("_super"), "prototype") : ts.createIdentifier("_super"); } - function onEmitNode(emitContext, node, emitCallback) { - var savedEnclosingFunction = enclosingFunction; - if (enabledSubstitutions & 1 && ts.isFunctionLike(node)) { - enclosingFunction = node; + function visitMetaProperty(node) { + if (node.keywordToken === 93 && node.name.text === "target") { + if (hierarchyFacts & 8192) { + hierarchyFacts |= 32768; + } + else { + hierarchyFacts |= 16384; + } + return ts.createIdentifier("_newTarget"); } - previousOnEmitNode(emitContext, node, emitCallback); - enclosingFunction = savedEnclosingFunction; + return node; + } + function onEmitNode(hint, node, emitCallback) { + if (enabledSubstitutions & 1 && ts.isFunctionLike(node)) { + var ancestorFacts = enterSubtree(16286, ts.getEmitFlags(node) & 8 + ? 65 | 16 + : 65); + previousOnEmitNode(hint, node, emitCallback); + exitSubtree(ancestorFacts, 0, 0); + return; + } + previousOnEmitNode(hint, node, emitCallback); } function enableSubstitutionsForBlockScopedBindings() { if ((enabledSubstitutions & 2) === 0) { @@ -42904,18 +46268,18 @@ var ts; if ((enabledSubstitutions & 1) === 0) { enabledSubstitutions |= 1; context.enableSubstitution(98); - context.enableEmitNotification(150); - context.enableEmitNotification(149); context.enableEmitNotification(151); + context.enableEmitNotification(150); context.enableEmitNotification(152); + context.enableEmitNotification(153); + context.enableEmitNotification(186); context.enableEmitNotification(185); - context.enableEmitNotification(184); - context.enableEmitNotification(225); + context.enableEmitNotification(227); } } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1) { + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1) { return substituteExpression(node); } if (ts.isIdentifier(node)) { @@ -42927,7 +46291,7 @@ var ts; if (enabledSubstitutions & 2) { var original = ts.getParseTreeNode(node, ts.isIdentifier); if (original && isNameOfDeclarationWithCollidingName(original)) { - return ts.getGeneratedNameForNode(original); + return ts.setTextRange(ts.getGeneratedNameForNode(original), node); } } return node; @@ -42935,10 +46299,10 @@ var ts; function isNameOfDeclarationWithCollidingName(node) { var parent = node.parent; switch (parent.kind) { - case 174: - case 226: - case 229: - case 223: + case 175: + case 228: + case 231: + case 225: return parent.name === node && resolver.isDeclarationWithCollidingName(parent); } @@ -42957,16 +46321,15 @@ var ts; if (enabledSubstitutions & 2) { var declaration = resolver.getReferencedDeclarationWithCollidingName(node); if (declaration) { - return ts.getGeneratedNameForNode(declaration.name); + return ts.setTextRange(ts.getGeneratedNameForNode(declaration.name), node); } } return node; } function substituteThisKeyword(node) { if (enabledSubstitutions & 1 - && enclosingFunction - && ts.getEmitFlags(enclosingFunction) & 8) { - return ts.createIdentifier("_this", node); + && hierarchyFacts & 16) { + return ts.setTextRange(ts.createIdentifier("_this"), node); } return node; } @@ -42982,11 +46345,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 207) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 209) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 179) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 180) { return false; } var callTarget = statementExpression.expression; @@ -42994,7 +46357,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 196) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 197) { return false; } var expression = callArgument.expression; @@ -43013,18 +46376,65 @@ var ts; name: "typescript:extends", scoped: false, priority: 0, - text: "\n var __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };" + text: "\n var __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n })();" }; })(ts || (ts = {})); var ts; (function (ts) { - var instructionNames = ts.createMap((_a = {}, - _a[2] = "return", - _a[3] = "break", - _a[4] = "yield", - _a[5] = "yield*", - _a[7] = "endfinally", - _a)); + var OpCode; + (function (OpCode) { + OpCode[OpCode["Nop"] = 0] = "Nop"; + OpCode[OpCode["Statement"] = 1] = "Statement"; + OpCode[OpCode["Assign"] = 2] = "Assign"; + OpCode[OpCode["Break"] = 3] = "Break"; + OpCode[OpCode["BreakWhenTrue"] = 4] = "BreakWhenTrue"; + OpCode[OpCode["BreakWhenFalse"] = 5] = "BreakWhenFalse"; + OpCode[OpCode["Yield"] = 6] = "Yield"; + OpCode[OpCode["YieldStar"] = 7] = "YieldStar"; + OpCode[OpCode["Return"] = 8] = "Return"; + OpCode[OpCode["Throw"] = 9] = "Throw"; + OpCode[OpCode["Endfinally"] = 10] = "Endfinally"; + })(OpCode || (OpCode = {})); + var BlockAction; + (function (BlockAction) { + BlockAction[BlockAction["Open"] = 0] = "Open"; + BlockAction[BlockAction["Close"] = 1] = "Close"; + })(BlockAction || (BlockAction = {})); + var CodeBlockKind; + (function (CodeBlockKind) { + CodeBlockKind[CodeBlockKind["Exception"] = 0] = "Exception"; + CodeBlockKind[CodeBlockKind["With"] = 1] = "With"; + CodeBlockKind[CodeBlockKind["Switch"] = 2] = "Switch"; + CodeBlockKind[CodeBlockKind["Loop"] = 3] = "Loop"; + CodeBlockKind[CodeBlockKind["Labeled"] = 4] = "Labeled"; + })(CodeBlockKind || (CodeBlockKind = {})); + var ExceptionBlockState; + (function (ExceptionBlockState) { + ExceptionBlockState[ExceptionBlockState["Try"] = 0] = "Try"; + ExceptionBlockState[ExceptionBlockState["Catch"] = 1] = "Catch"; + ExceptionBlockState[ExceptionBlockState["Finally"] = 2] = "Finally"; + ExceptionBlockState[ExceptionBlockState["Done"] = 3] = "Done"; + })(ExceptionBlockState || (ExceptionBlockState = {})); + var Instruction; + (function (Instruction) { + Instruction[Instruction["Next"] = 0] = "Next"; + Instruction[Instruction["Throw"] = 1] = "Throw"; + Instruction[Instruction["Return"] = 2] = "Return"; + Instruction[Instruction["Break"] = 3] = "Break"; + Instruction[Instruction["Yield"] = 4] = "Yield"; + Instruction[Instruction["YieldStar"] = 5] = "YieldStar"; + Instruction[Instruction["Catch"] = 6] = "Catch"; + Instruction[Instruction["Endfinally"] = 7] = "Endfinally"; + })(Instruction || (Instruction = {})); + function getInstructionName(instruction) { + switch (instruction) { + case 2: return "return"; + case 3: return "break"; + case 4: return "yield"; + case 5: return "yield*"; + case 7: return "endfinally"; + } + } function transformGenerators(context) { var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistFunctionDeclaration = context.hoistFunctionDeclaration, hoistVariableDeclaration = context.hoistVariableDeclaration; var compilerOptions = context.getCompilerOptions(); @@ -43090,13 +46500,13 @@ var ts; } function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 209: + case 211: return visitDoStatement(node); - case 210: + case 212: return visitWhileStatement(node); - case 218: + case 220: return visitSwitchStatement(node); - case 219: + case 221: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -43104,24 +46514,24 @@ var ts; } function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 225: + case 227: return visitFunctionDeclaration(node); - case 184: + case 185: return visitFunctionExpression(node); - case 151: case 152: + case 153: return visitAccessorDeclaration(node); - case 205: + case 207: return visitVariableStatement(node); - case 211: + case 213: return visitForStatement(node); - case 212: - return visitForInStatement(node); - case 215: - return visitBreakStatement(node); case 214: - return visitContinueStatement(node); + return visitForInStatement(node); + case 217: + return visitBreakStatement(node); case 216: + return visitContinueStatement(node); + case 218: return visitReturnStatement(node); default: if (node.transformFlags & 16777216) { @@ -43137,21 +46547,21 @@ var ts; } function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 192: - return visitBinaryExpression(node); case 193: + return visitBinaryExpression(node); + case 194: return visitConditionalExpression(node); - case 195: + case 196: return visitYieldExpression(node); - case 175: - return visitArrayLiteralExpression(node); case 176: + return visitArrayLiteralExpression(node); + case 177: return visitObjectLiteralExpression(node); - case 178: - return visitElementAccessExpression(node); case 179: - return visitCallExpression(node); + return visitElementAccessExpression(node); case 180: + return visitCallExpression(node); + case 181: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -43159,9 +46569,9 @@ var ts; } function visitGenerator(node) { switch (node.kind) { - case 225: + case 227: return visitFunctionDeclaration(node); - case 184: + case 185: return visitFunctionExpression(node); default: ts.Debug.failBadSyntaxKind(node); @@ -43169,8 +46579,8 @@ var ts; } } function visitFunctionDeclaration(node) { - if (node.asteriskToken && ts.getEmitFlags(node) & 131072) { - node = ts.setOriginalNode(ts.createFunctionDeclaration(undefined, node.modifiers, undefined, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformGeneratorFunctionBody(node.body), node), node); + if (node.asteriskToken) { + node = ts.setOriginalNode(ts.setTextRange(ts.createFunctionDeclaration(undefined, node.modifiers, undefined, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformGeneratorFunctionBody(node.body)), node), node); } else { var savedInGeneratorFunctionBody = inGeneratorFunctionBody; @@ -43190,8 +46600,8 @@ var ts; } } function visitFunctionExpression(node) { - if (node.asteriskToken && ts.getEmitFlags(node) & 131072) { - node = ts.setOriginalNode(ts.createFunctionExpression(undefined, undefined, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformGeneratorFunctionBody(node.body), node), node); + if (node.asteriskToken) { + node = ts.setOriginalNode(ts.setTextRange(ts.createFunctionExpression(undefined, undefined, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformGeneratorFunctionBody(node.body)), node), node); } else { var savedInGeneratorFunctionBody = inGeneratorFunctionBody; @@ -43243,7 +46653,7 @@ var ts; operationLocations = undefined; state = ts.createTempVariable(undefined); resumeLexicalEnvironment(); - var statementOffset = ts.addPrologueDirectives(statements, body.statements, false, visitor); + var statementOffset = ts.addPrologue(statements, body.statements, false, visitor); transformAndEmitStatements(body.statements, statementOffset); var buildResult = build(); ts.addRange(statements, endLexicalEnvironment()); @@ -43261,7 +46671,7 @@ var ts; operationArguments = savedOperationArguments; operationLocations = savedOperationLocations; state = savedState; - return ts.createBlock(statements, body, body.multiLine); + return ts.setTextRange(ts.createBlock(statements, body.multiLine), body); } function visitVariableStatement(node) { if (node.transformFlags & 16777216) { @@ -43318,10 +46728,10 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 177: + case 178: target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 178: + case 179: target = ts.updateElementAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), cacheExpression(ts.visitNode(left.argumentExpression, visitor, ts.isExpression))); break; default: @@ -43330,7 +46740,7 @@ var ts; } var operator = node.operatorToken.kind; if (isCompoundAssignment(operator)) { - return ts.createBinary(target, 57, ts.createBinary(cacheExpression(target), getOperatorForCompoundAssignment(operator), ts.visitNode(right, visitor, ts.isExpression), node), node); + return ts.setTextRange(ts.createAssignment(target, ts.setTextRange(ts.createBinary(cacheExpression(target), getOperatorForCompoundAssignment(operator), ts.visitNode(right, visitor, ts.isExpression)), node)), node); } else { return ts.updateBinary(node, target, ts.visitNode(right, visitor, ts.isExpression)); @@ -43346,10 +46756,10 @@ var ts; else if (node.operatorToken.kind === 25) { return visitCommaExpression(node); } - var clone_4 = ts.getMutableClone(node); - clone_4.left = cacheExpression(ts.visitNode(node.left, visitor, ts.isExpression)); - clone_4.right = ts.visitNode(node.right, visitor, ts.isExpression); - return clone_4; + var clone_5 = ts.getMutableClone(node); + clone_5.left = cacheExpression(ts.visitNode(node.left, visitor, ts.isExpression)); + clone_5.right = ts.visitNode(node.right, visitor, ts.isExpression); + return clone_5; } return ts.visitEachChild(node, visitor, context); } @@ -43405,38 +46815,43 @@ var ts; var resumeLabel = defineLabel(); var expression = ts.visitNode(node.expression, visitor, ts.isExpression); if (node.asteriskToken) { - emitYieldStar(expression, node); + var iterator = (ts.getEmitFlags(node.expression) & 4194304) === 0 + ? ts.createValuesHelper(context, expression, node) + : expression; + emitYieldStar(iterator, node); } else { emitYield(expression, node); } markLabel(resumeLabel); - return createGeneratorResume(); + return createGeneratorResume(node); } function visitArrayLiteralExpression(node) { return visitElements(node.elements, undefined, undefined, node.multiLine); } function visitElements(elements, leadingElement, location, multiLine) { var numInitialElements = countInitialNodesWithoutYield(elements); - var temp = declareLocal(); - var hasAssignedTemp = false; + var temp; if (numInitialElements > 0) { + temp = declareLocal(); var initialElements = ts.visitNodes(elements, visitor, ts.isExpression, 0, numInitialElements); emitAssignment(temp, ts.createArrayLiteral(leadingElement ? [leadingElement].concat(initialElements) : initialElements)); leadingElement = undefined; - hasAssignedTemp = true; } var expressions = ts.reduceLeft(elements, reduceElement, [], numInitialElements); - return hasAssignedTemp - ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, undefined, multiLine)]) - : ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, location, multiLine); + return temp + ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)]) + : ts.setTextRange(ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine), location); function reduceElement(expressions, element) { if (containsYield(element) && expressions.length > 0) { + var hasAssignedTemp = temp !== undefined; + if (!temp) { + temp = declareLocal(); + } emitAssignment(temp, hasAssignedTemp - ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, undefined, multiLine)]) - : ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, undefined, multiLine)); - hasAssignedTemp = true; + ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)]) + : ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine)); leadingElement = undefined; expressions = []; } @@ -43449,7 +46864,7 @@ var ts; var multiLine = node.multiLine; var numInitialProperties = countInitialNodesWithoutYield(properties); var temp = declareLocal(); - emitAssignment(temp, ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), undefined, multiLine)); + emitAssignment(temp, ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), multiLine)); var expressions = ts.reduceLeft(properties, reduceProperty, [], numInitialProperties); expressions.push(multiLine ? ts.startOnNewLine(ts.getMutableClone(temp)) : temp); return ts.inlineExpressions(expressions); @@ -43471,10 +46886,10 @@ var ts; } function visitElementAccessExpression(node) { if (containsYield(node.argumentExpression)) { - var clone_5 = ts.getMutableClone(node); - clone_5.expression = cacheExpression(ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression)); - clone_5.argumentExpression = ts.visitNode(node.argumentExpression, visitor, ts.isExpression); - return clone_5; + var clone_6 = ts.getMutableClone(node); + clone_6.expression = cacheExpression(ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression)); + clone_6.argumentExpression = ts.visitNode(node.argumentExpression, visitor, ts.isExpression); + return clone_6; } return ts.visitEachChild(node, visitor, context); } @@ -43488,7 +46903,7 @@ var ts; function visitNewExpression(node) { if (ts.forEach(node.arguments, containsYield)) { var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; - return ts.setOriginalNode(ts.createNew(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isExpression)), thisArg, visitElements(node.arguments, ts.createVoidZero())), undefined, [], node), node); + return ts.setOriginalNode(ts.setTextRange(ts.createNew(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isExpression)), thisArg, visitElements(node.arguments, ts.createVoidZero())), undefined, []), node), node); } return ts.visitEachChild(node, visitor, context); } @@ -43517,38 +46932,38 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 204: + case 206: return transformAndEmitBlock(node); - case 207: - return transformAndEmitExpressionStatement(node); - case 208: - return transformAndEmitIfStatement(node); case 209: - return transformAndEmitDoStatement(node); + return transformAndEmitExpressionStatement(node); case 210: - return transformAndEmitWhileStatement(node); + return transformAndEmitIfStatement(node); case 211: - return transformAndEmitForStatement(node); + return transformAndEmitDoStatement(node); case 212: - return transformAndEmitForInStatement(node); + return transformAndEmitWhileStatement(node); + case 213: + return transformAndEmitForStatement(node); case 214: - return transformAndEmitContinueStatement(node); - case 215: - return transformAndEmitBreakStatement(node); + return transformAndEmitForInStatement(node); case 216: - return transformAndEmitReturnStatement(node); + return transformAndEmitContinueStatement(node); case 217: - return transformAndEmitWithStatement(node); + return transformAndEmitBreakStatement(node); case 218: - return transformAndEmitSwitchStatement(node); + return transformAndEmitReturnStatement(node); case 219: - return transformAndEmitLabeledStatement(node); + return transformAndEmitWithStatement(node); case 220: - return transformAndEmitThrowStatement(node); + return transformAndEmitSwitchStatement(node); case 221: + return transformAndEmitLabeledStatement(node); + case 222: + return transformAndEmitThrowStatement(node); + case 223: return transformAndEmitTryStatement(node); default: - return emitStatement(ts.visitNode(node, visitor, ts.isStatement, true)); + return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); } } function transformAndEmitBlock(node) { @@ -43565,7 +46980,9 @@ var ts; function transformAndEmitVariableDeclarationList(node) { for (var _i = 0, _a = node.declarations; _i < _a.length; _i++) { var variable = _a[_i]; - hoistVariableDeclaration(variable.name); + var name = ts.getSynthesizedClone(variable.name); + ts.setCommentRange(name, variable.name); + hoistVariableDeclaration(name); } var variables = ts.getInitializedVariables(node); var numVariables = variables.length; @@ -43595,7 +47012,7 @@ var ts; if (containsYield(node.thenStatement) || containsYield(node.elseStatement)) { var endLabel = defineLabel(); var elseLabel = node.elseStatement ? defineLabel() : undefined; - emitBreakWhenFalse(node.elseStatement ? elseLabel : endLabel, ts.visitNode(node.expression, visitor, ts.isExpression)); + emitBreakWhenFalse(node.elseStatement ? elseLabel : endLabel, ts.visitNode(node.expression, visitor, ts.isExpression), node.expression); transformAndEmitEmbeddedStatement(node.thenStatement); if (node.elseStatement) { emitBreak(endLabel); @@ -43674,7 +47091,7 @@ var ts; transformAndEmitVariableDeclarationList(initializer); } else { - emitStatement(ts.createStatement(ts.visitNode(initializer, visitor, ts.isExpression), initializer)); + emitStatement(ts.setTextRange(ts.createStatement(ts.visitNode(initializer, visitor, ts.isExpression)), initializer)); } } markLabel(conditionLabel); @@ -43684,7 +47101,7 @@ var ts; transformAndEmitEmbeddedStatement(node.statement); markLabel(incrementLabel); if (node.incrementor) { - emitStatement(ts.createStatement(ts.visitNode(node.incrementor, visitor, ts.isExpression), node.incrementor)); + emitStatement(ts.setTextRange(ts.createStatement(ts.visitNode(node.incrementor, visitor, ts.isExpression)), node.incrementor)); } emitBreak(conditionLabel); endLoopBlock(); @@ -43698,7 +47115,7 @@ var ts; beginScriptLoopBlock(); } var initializer = node.initializer; - if (ts.isVariableDeclarationList(initializer)) { + if (initializer && ts.isVariableDeclarationList(initializer)) { for (var _i = 0, _a = initializer.declarations; _i < _a.length; _i++) { var variable = _a[_i]; hoistVariableDeclaration(variable.name); @@ -43706,7 +47123,7 @@ var ts; var variables = ts.getInitializedVariables(initializer); node = ts.updateFor(node, variables.length > 0 ? ts.inlineExpressions(ts.map(variables, transformInitializedVariable)) - : undefined, ts.visitNode(node.condition, visitor, ts.isExpression, true), ts.visitNode(node.incrementor, visitor, ts.isExpression, true), ts.visitNode(node.statement, visitor, ts.isStatement, false, ts.liftToBlock)); + : undefined, ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); } else { node = ts.visitEachChild(node, visitor, context); @@ -43764,7 +47181,7 @@ var ts; var variable = _a[_i]; hoistVariableDeclaration(variable.name); } - node = ts.updateForIn(node, initializer.declarations[0].name, ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, false, ts.liftToBlock)); + node = ts.updateForIn(node, initializer.declarations[0].name, ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); } else { node = ts.visitEachChild(node, visitor, context); @@ -43803,10 +47220,10 @@ var ts; return ts.visitEachChild(node, visitor, context); } function transformAndEmitReturnStatement(node) { - emitReturn(ts.visitNode(node.expression, visitor, ts.isExpression, true), node); + emitReturn(ts.visitNode(node.expression, visitor, ts.isExpression), node); } function visitReturnStatement(node) { - return createInlineReturn(ts.visitNode(node.expression, visitor, ts.isExpression, true), node); + return createInlineReturn(ts.visitNode(node.expression, visitor, ts.isExpression), node); } function transformAndEmitWithStatement(node) { if (containsYield(node)) { @@ -43829,7 +47246,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 254 && defaultClauseIndex === -1) { + if (clause.kind === 257 && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -43839,7 +47256,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 253) { + if (clause.kind === 256) { var caseClause = clause; if (containsYield(caseClause.expression) && pendingClauses.length > 0) { break; @@ -43941,9 +47358,9 @@ var ts; } return -1; } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1) { + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1) { return substituteExpression(node); } return node; @@ -43955,17 +47372,17 @@ var ts; return node; } function substituteExpressionIdentifier(node) { - if (renamedCatchVariables && ts.hasProperty(renamedCatchVariables, node.text)) { + if (!ts.isGeneratedIdentifier(node) && renamedCatchVariables && renamedCatchVariables.has(node.text)) { var original = ts.getOriginalNode(node); if (ts.isIdentifier(original) && original.parent) { var declaration = resolver.getReferencedValueDeclaration(original); if (declaration) { - var name_38 = ts.getProperty(renamedCatchVariableDeclarations, String(ts.getOriginalNodeId(declaration))); - if (name_38) { - var clone_6 = ts.getMutableClone(name_38); - ts.setSourceMapRange(clone_6, node); - ts.setCommentRange(clone_6, node); - return clone_6; + var name = renamedCatchVariableDeclarations[ts.getOriginalNodeId(declaration)]; + if (name) { + var clone_7 = ts.getMutableClone(name); + ts.setSourceMapRange(clone_7, node); + ts.setCommentRange(clone_7, node); + return clone_7; } } } @@ -43974,7 +47391,7 @@ var ts; } function cacheExpression(node) { var temp; - if (ts.isGeneratedIdentifier(node)) { + if (ts.isGeneratedIdentifier(node) || ts.getEmitFlags(node) & 4096) { return node; } temp = ts.createTempVariable(hoistVariableDeclaration); @@ -44066,15 +47483,22 @@ var ts; } function beginCatchBlock(variable) { ts.Debug.assert(peekBlockKind() === 0); - var text = variable.name.text; - var name = declareLocal(text); - if (!renamedCatchVariables) { - renamedCatchVariables = ts.createMap(); - renamedCatchVariableDeclarations = ts.createMap(); - context.enableSubstitution(70); + var name; + if (ts.isGeneratedIdentifier(variable.name)) { + name = variable.name; + hoistVariableDeclaration(variable.name); + } + else { + var text = variable.name.text; + name = declareLocal(text); + if (!renamedCatchVariables) { + renamedCatchVariables = ts.createMap(); + renamedCatchVariableDeclarations = []; + context.enableSubstitution(70); + } + renamedCatchVariables.set(text, true); + renamedCatchVariableDeclarations[ts.getOriginalNodeId(variable)] = name; } - renamedCatchVariables[text] = true; - renamedCatchVariableDeclarations[ts.getOriginalNodeId(variable)] = name; var exception = peekBlock(); ts.Debug.assert(exception.state < 1); var endLabel = exception.endLabel; @@ -44274,23 +47698,23 @@ var ts; } function createInstruction(instruction) { var literal = ts.createLiteral(instruction); - literal.trailingComment = instructionNames[instruction]; + ts.addSyntheticTrailingComment(literal, 3, getInstructionName(instruction)); return literal; } function createInlineBreak(label, location) { ts.Debug.assert(label > 0, "Invalid label: " + label); - return ts.createReturn(ts.createArrayLiteral([ + return ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3), createLabel(label) - ]), location); + ])), location); } function createInlineReturn(expression, location) { - return ts.createReturn(ts.createArrayLiteral(expression + return ts.setTextRange(ts.createReturn(ts.createArrayLiteral(expression ? [createInstruction(2), expression] - : [createInstruction(2)]), location); + : [createInstruction(2)])), location); } function createGeneratorResume(location) { - return ts.createCall(ts.createPropertyAccess(state, "sent"), undefined, [], location); + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(state, "sent"), undefined, []), location); } function emitNop() { emitWorker(0); @@ -44356,7 +47780,7 @@ var ts; currentExceptionBlock = undefined; withBlockStack = undefined; var buildResult = buildStatements(); - return createGeneratorHelper(context, ts.setEmitFlags(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, state)], undefined, ts.createBlock(buildResult, undefined, buildResult.length > 0)), 262144)); + return createGeneratorHelper(context, ts.setEmitFlags(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, state)], undefined, ts.createBlock(buildResult, buildResult.length > 0)), 262144)); } function buildStatements() { if (operations) { @@ -44565,51 +47989,51 @@ var ts; } } function writeAssign(left, right, operationLocation) { - writeStatement(ts.createStatement(ts.createAssignment(left, right), operationLocation)); + writeStatement(ts.setTextRange(ts.createStatement(ts.createAssignment(left, right)), operationLocation)); } function writeThrow(expression, operationLocation) { lastOperationWasAbrupt = true; lastOperationWasCompletion = true; - writeStatement(ts.createThrow(expression, operationLocation)); + writeStatement(ts.setTextRange(ts.createThrow(expression), operationLocation)); } function writeReturn(expression, operationLocation) { lastOperationWasAbrupt = true; lastOperationWasCompletion = true; - writeStatement(ts.createReturn(ts.createArrayLiteral(expression + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral(expression ? [createInstruction(2), expression] - : [createInstruction(2)]), operationLocation)); + : [createInstruction(2)])), operationLocation), 384)); } function writeBreak(label, operationLocation) { lastOperationWasAbrupt = true; - writeStatement(ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3), createLabel(label) - ]), operationLocation)); + ])), operationLocation), 384)); } function writeBreakWhenTrue(label, condition, operationLocation) { - writeStatement(ts.createIf(condition, ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.createIf(condition, ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3), createLabel(label) - ]), operationLocation))); + ])), operationLocation), 384)), 1)); } function writeBreakWhenFalse(label, condition, operationLocation) { - writeStatement(ts.createIf(ts.createLogicalNot(condition), ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.createIf(ts.createLogicalNot(condition), ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3), createLabel(label) - ]), operationLocation))); + ])), operationLocation), 384)), 1)); } function writeYield(expression, operationLocation) { lastOperationWasAbrupt = true; - writeStatement(ts.createReturn(ts.createArrayLiteral(expression + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral(expression ? [createInstruction(4), expression] - : [createInstruction(4)]), operationLocation)); + : [createInstruction(4)])), operationLocation), 384)); } function writeYieldStar(expression, operationLocation) { lastOperationWasAbrupt = true; - writeStatement(ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(5), expression - ]), operationLocation)); + ])), operationLocation), 384)); } function writeEndfinally() { lastOperationWasAbrupt = true; @@ -44627,23 +48051,47 @@ var ts; name: "typescript:generator", scoped: false, priority: 6, - text: "\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;\n return { next: verb(0), \"throw\": verb(1), \"return\": verb(2) };\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [0, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };" + text: "\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [0, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };" }; - var _a; })(ts || (ts = {})); var ts; (function (ts) { function transformES5(context) { + var compilerOptions = context.getCompilerOptions(); + var previousOnEmitNode; + var noSubstitution; + if (compilerOptions.jsx === 1 || compilerOptions.jsx === 3) { + previousOnEmitNode = context.onEmitNode; + context.onEmitNode = onEmitNode; + context.enableEmitNotification(250); + context.enableEmitNotification(251); + context.enableEmitNotification(249); + noSubstitution = []; + } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(177); - context.enableSubstitution(257); + context.enableSubstitution(178); + context.enableSubstitution(260); return transformSourceFile; function transformSourceFile(node) { return node; } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); + function onEmitNode(hint, node, emitCallback) { + switch (node.kind) { + case 250: + case 251: + case 249: + var tagName = node.tagName; + noSubstitution[ts.getOriginalNodeId(tagName)] = true; + break; + } + previousOnEmitNode(hint, node, emitCallback); + } + function onSubstituteNode(hint, node) { + if (node.id && noSubstitution && noSubstitution[node.id]) { + return previousOnSubstituteNode(hint, node); + } + node = previousOnSubstituteNode(hint, node); if (ts.isPropertyAccessExpression(node)) { return substitutePropertyAccessExpression(node); } @@ -44655,7 +48103,7 @@ var ts; function substitutePropertyAccessExpression(node) { var literalName = trySubstituteReservedName(node.name); if (literalName) { - return ts.createElementAccess(node.expression, literalName, node); + return ts.setTextRange(ts.createElementAccess(node.expression, literalName), node); } return node; } @@ -44669,7 +48117,7 @@ var ts; function trySubstituteReservedName(name) { var token = name.originalKeywordKind || (ts.nodeIsSynthesized(name) ? ts.stringToToken(name.text) : undefined); if (token >= 71 && token <= 106) { - return ts.createLiteral(name, name); + return ts.setTextRange(ts.createLiteral(name), name); } return undefined; } @@ -44679,12 +48127,13 @@ var ts; var ts; (function (ts) { function transformModule(context) { - var transformModuleDelegates = ts.createMap((_a = {}, - _a[ts.ModuleKind.None] = transformCommonJSModule, - _a[ts.ModuleKind.CommonJS] = transformCommonJSModule, - _a[ts.ModuleKind.AMD] = transformAMDModule, - _a[ts.ModuleKind.UMD] = transformUMDModule, - _a)); + function getTransformModuleDelegate(moduleKind) { + switch (moduleKind) { + case ts.ModuleKind.AMD: return transformAMDModule; + case ts.ModuleKind.UMD: return transformUMDModule; + default: return transformCommonJSModule; + } + } var startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; var compilerOptions = context.getCompilerOptions(); var resolver = context.getEmitResolver(); @@ -44696,40 +48145,49 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(70); - context.enableSubstitution(192); - context.enableSubstitution(190); + context.enableSubstitution(193); context.enableSubstitution(191); - context.enableSubstitution(258); - context.enableEmitNotification(261); - var moduleInfoMap = ts.createMap(); - var deferredExports = ts.createMap(); + context.enableSubstitution(192); + context.enableSubstitution(261); + context.enableEmitNotification(264); + var moduleInfoMap = []; + var deferredExports = []; var currentSourceFile; var currentModuleInfo; var noSubstitution; return transformSourceFile; function transformSourceFile(node) { - if (ts.isDeclarationFile(node) - || !(ts.isExternalModule(node) - || compilerOptions.isolatedModules)) { + if (ts.isDeclarationFile(node) || !(ts.isExternalModule(node) || compilerOptions.isolatedModules)) { return node; } currentSourceFile = node; - currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(node)] = ts.collectExternalModuleInfo(node, resolver, compilerOptions); - var transformModule = transformModuleDelegates[moduleKind] || transformModuleDelegates[ts.ModuleKind.None]; + currentModuleInfo = ts.collectExternalModuleInfo(node, resolver, compilerOptions); + moduleInfoMap[ts.getOriginalNodeId(node)] = currentModuleInfo; + var transformModule = getTransformModuleDelegate(moduleKind); var updated = transformModule(node); currentSourceFile = undefined; currentModuleInfo = undefined; return ts.aggregateTransformFlags(updated); } + function shouldEmitUnderscoreUnderscoreESModule() { + if (!currentModuleInfo.exportEquals && ts.isExternalModule(currentSourceFile)) { + return true; + } + return false; + } function transformCommonJSModule(node) { startLexicalEnvironment(); var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.statements, !compilerOptions.noImplicitUseStrict, sourceElementVisitor); - ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement, true)); + var ensureUseStrict = compilerOptions.alwaysStrict || (!compilerOptions.noImplicitUseStrict && ts.isExternalModule(currentSourceFile)); + var statementOffset = ts.addPrologue(statements, node.statements, ensureUseStrict, sourceElementVisitor); + if (shouldEmitUnderscoreUnderscoreESModule()) { + ts.append(statements, createUnderscoreUnderscoreESModule()); + } + ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement)); ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); - ts.addRange(statements, endLexicalEnvironment()); addExportEqualsIfNeeded(statements, false); - var updated = ts.updateSourceFileNode(node, ts.createNodeArray(statements, node.statements)); + ts.addRange(statements, endLexicalEnvironment()); + var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements)); if (currentModuleInfo.hasExportStarsToExportValues) { ts.addEmitHelper(updated, exportStarHelper); } @@ -44738,15 +48196,8 @@ var ts; function transformAMDModule(node) { var define = ts.createIdentifier("define"); var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions); - return transformAsynchronousModule(node, define, moduleName, true); - } - function transformUMDModule(node) { - var define = ts.createRawExpression(umdHelper); - return transformAsynchronousModule(node, define, undefined, false); - } - function transformAsynchronousModule(node, define, moduleName, includeNonAmdDependencies) { - var _a = collectAsynchronousDependencies(node, includeNonAmdDependencies), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames; - return ts.updateSourceFileNode(node, ts.createNodeArray([ + var _a = collectAsynchronousDependencies(node, true), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames; + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ ts.createStatement(ts.createCall(define, undefined, (moduleName ? [moduleName] : []).concat([ ts.createArrayLiteral([ ts.createLiteral("require"), @@ -44757,7 +48208,37 @@ var ts; ts.createParameter(undefined, undefined, undefined, "exports") ].concat(importAliasNames), undefined, transformAsynchronousModuleBody(node)) ]))) - ], node.statements)); + ]), node.statements)); + } + function transformUMDModule(node) { + var _a = collectAsynchronousDependencies(node, false), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames; + var umdHeader = ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, "factory")], undefined, ts.setTextRange(ts.createBlock([ + ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier("module"), "object"), ts.createTypeCheck(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), "object")), ts.createBlock([ + ts.createVariableStatement(undefined, [ + ts.createVariableDeclaration("v", undefined, ts.createCall(ts.createIdentifier("factory"), undefined, [ + ts.createIdentifier("require"), + ts.createIdentifier("exports") + ])) + ]), + ts.setEmitFlags(ts.createIf(ts.createStrictInequality(ts.createIdentifier("v"), ts.createIdentifier("undefined")), ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), ts.createIdentifier("v")))), 1) + ]), ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier("define"), "function"), ts.createPropertyAccess(ts.createIdentifier("define"), "amd")), ts.createBlock([ + ts.createStatement(ts.createCall(ts.createIdentifier("define"), undefined, [ + ts.createArrayLiteral([ + ts.createLiteral("require"), + ts.createLiteral("exports") + ].concat(aliasedModuleNames, unaliasedModuleNames)), + ts.createIdentifier("factory") + ])) + ]))) + ], true), undefined)); + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ + ts.createStatement(ts.createCall(umdHeader, undefined, [ + ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ + ts.createParameter(undefined, undefined, undefined, "require"), + ts.createParameter(undefined, undefined, undefined, "exports") + ].concat(importAliasNames), undefined, transformAsynchronousModuleBody(node)) + ])) + ]), node.statements)); } function collectAsynchronousDependencies(node, includeNonAmdDependencies) { var aliasedModuleNames = []; @@ -44777,13 +48258,15 @@ var ts; var importNode = _c[_b]; var externalModuleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions); var importAliasName = ts.getLocalNameForExternalImport(importNode, currentSourceFile); - if (includeNonAmdDependencies && importAliasName) { - ts.setEmitFlags(importAliasName, 4); - aliasedModuleNames.push(externalModuleName); - importAliasNames.push(ts.createParameter(undefined, undefined, undefined, importAliasName)); - } - else { - unaliasedModuleNames.push(externalModuleName); + if (externalModuleName) { + if (includeNonAmdDependencies && importAliasName) { + ts.setEmitFlags(importAliasName, 4); + aliasedModuleNames.push(externalModuleName); + importAliasNames.push(ts.createParameter(undefined, undefined, undefined, importAliasName)); + } + else { + unaliasedModuleNames.push(externalModuleName); + } } } return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames }; @@ -44791,12 +48274,15 @@ var ts; function transformAsynchronousModuleBody(node) { startLexicalEnvironment(); var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.statements, !compilerOptions.noImplicitUseStrict, sourceElementVisitor); - ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement, true)); + var statementOffset = ts.addPrologue(statements, node.statements, !compilerOptions.noImplicitUseStrict, sourceElementVisitor); + if (shouldEmitUnderscoreUnderscoreESModule()) { + ts.append(statements, createUnderscoreUnderscoreESModule()); + } + ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement)); ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); - ts.addRange(statements, endLexicalEnvironment()); addExportEqualsIfNeeded(statements, true); - var body = ts.createBlock(statements, undefined, true); + ts.addRange(statements, endLexicalEnvironment()); + var body = ts.createBlock(statements, true); if (currentModuleInfo.hasExportStarsToExportValues) { ts.addEmitHelper(body, exportStarHelper); } @@ -44805,12 +48291,14 @@ var ts; function addExportEqualsIfNeeded(statements, emitAsReturn) { if (currentModuleInfo.exportEquals) { if (emitAsReturn) { - var statement = ts.createReturn(currentModuleInfo.exportEquals.expression, currentModuleInfo.exportEquals); + var statement = ts.createReturn(currentModuleInfo.exportEquals.expression); + ts.setTextRange(statement, currentModuleInfo.exportEquals); ts.setEmitFlags(statement, 384 | 1536); statements.push(statement); } else { - var statement = ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), currentModuleInfo.exportEquals.expression), currentModuleInfo.exportEquals); + var statement = ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), currentModuleInfo.exportEquals.expression)); + ts.setTextRange(statement, currentModuleInfo.exportEquals); ts.setEmitFlags(statement, 1536); statements.push(statement); } @@ -44818,23 +48306,23 @@ var ts; } function sourceElementVisitor(node) { switch (node.kind) { - case 235: + case 237: return visitImportDeclaration(node); - case 234: + case 236: return visitImportEqualsDeclaration(node); - case 241: + case 243: return visitExportDeclaration(node); - case 240: + case 242: return visitExportAssignment(node); - case 205: + case 207: return visitVariableStatement(node); - case 225: + case 227: return visitFunctionDeclaration(node); - case 226: + case 228: return visitClassDeclaration(node); - case 295: - return visitMergeDeclarationMarker(node); case 296: + return visitMergeDeclarationMarker(node); + case 297: return visitEndOfDeclarationMarker(node); default: return node; @@ -44845,7 +48333,7 @@ var ts; var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); if (moduleKind !== ts.ModuleKind.AMD) { if (!node.importClause) { - return ts.createStatement(createRequireCall(node), node); + return ts.setTextRange(ts.createStatement(createRequireCall(node)), node); } else { var variables = []; @@ -44858,13 +48346,13 @@ var ts; variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, ts.getGeneratedNameForNode(node))); } } - statements = ts.append(statements, ts.createVariableStatement(undefined, ts.createVariableDeclarationList(variables, undefined, languageVersion >= 2 ? 2 : 0), node)); + statements = ts.append(statements, ts.setTextRange(ts.createVariableStatement(undefined, ts.createVariableDeclarationList(variables, languageVersion >= 2 ? 2 : 0)), node)); } } else if (namespaceDeclaration && ts.isDefaultImport(node)) { statements = ts.append(statements, ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ - ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, ts.getGeneratedNameForNode(node), node) - ], undefined, languageVersion >= 2 ? 2 : 0))); + ts.setTextRange(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, ts.getGeneratedNameForNode(node)), node) + ], languageVersion >= 2 ? 2 : 0))); } if (hasAssociatedEndOfDeclarationMarker(node)) { var id = ts.getOriginalNodeId(node); @@ -44888,17 +48376,17 @@ var ts; var statements; if (moduleKind !== ts.ModuleKind.AMD) { if (ts.hasModifier(node, 1)) { - statements = ts.append(statements, ts.createStatement(createExportExpression(node.name, createRequireCall(node)), node)); + statements = ts.append(statements, ts.setTextRange(ts.createStatement(createExportExpression(node.name, createRequireCall(node))), node)); } else { - statements = ts.append(statements, ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ + statements = ts.append(statements, ts.setTextRange(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ ts.createVariableDeclaration(ts.getSynthesizedClone(node.name), undefined, createRequireCall(node)) - ], undefined, languageVersion >= 2 ? 2 : 0), node)); + ], languageVersion >= 2 ? 2 : 0)), node)); } } else { if (ts.hasModifier(node, 1)) { - statements = ts.append(statements, ts.createStatement(createExportExpression(ts.getExportName(node), ts.getLocalName(node)), node)); + statements = ts.append(statements, ts.setTextRange(ts.createStatement(createExportExpression(ts.getExportName(node), ts.getLocalName(node))), node)); } } if (hasAssociatedEndOfDeclarationMarker(node)) { @@ -44918,23 +48406,23 @@ var ts; if (node.exportClause) { var statements = []; if (moduleKind !== ts.ModuleKind.AMD) { - statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ + statements.push(ts.setTextRange(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ ts.createVariableDeclaration(generatedName, undefined, createRequireCall(node)) - ]), node)); + ])), node)); } for (var _i = 0, _a = node.exportClause.elements; _i < _a.length; _i++) { var specifier = _a[_i]; var exportedValue = ts.createPropertyAccess(generatedName, specifier.propertyName || specifier.name); - statements.push(ts.createStatement(createExportExpression(ts.getExportName(specifier), exportedValue), specifier)); + statements.push(ts.setTextRange(ts.createStatement(createExportExpression(ts.getExportName(specifier), exportedValue)), specifier)); } return ts.singleOrMany(statements); } else { - return ts.createStatement(ts.createCall(ts.createIdentifier("__export"), undefined, [ + return ts.setTextRange(ts.createStatement(ts.createCall(ts.createIdentifier("__export"), undefined, [ moduleKind !== ts.ModuleKind.AMD ? createRequireCall(node) : generatedName - ]), node); + ])), node); } } function visitExportAssignment(node) { @@ -44955,7 +48443,7 @@ var ts; function visitFunctionDeclaration(node) { var statements; if (ts.hasModifier(node, 1)) { - statements = ts.append(statements, ts.setOriginalNode(ts.createFunctionDeclaration(undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, ts.getDeclarationName(node, true, true), undefined, node.parameters, undefined, node.body, node), node)); + statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(ts.createFunctionDeclaration(undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, ts.getDeclarationName(node, true, true), undefined, node.parameters, undefined, node.body), node), node)); } else { statements = ts.append(statements, node); @@ -44972,7 +48460,7 @@ var ts; function visitClassDeclaration(node) { var statements; if (ts.hasModifier(node, 1)) { - statements = ts.append(statements, ts.setOriginalNode(ts.createClassDeclaration(undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.getDeclarationName(node, true, true), undefined, node.heritageClauses, node.members, node), node)); + statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(ts.createClassDeclaration(undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.getDeclarationName(node, true, true), undefined, node.heritageClauses, node.members), node), node)); } else { statements = ts.append(statements, node); @@ -45008,7 +48496,7 @@ var ts; statements = ts.append(statements, ts.updateVariableStatement(node, modifiers, ts.updateVariableDeclarationList(node.declarationList, variables))); } if (expressions) { - statements = ts.append(statements, ts.createStatement(ts.inlineExpressions(expressions), node)); + statements = ts.append(statements, ts.setTextRange(ts.createStatement(ts.inlineExpressions(expressions)), node)); } } else { @@ -45028,11 +48516,11 @@ var ts; return ts.flattenDestructuringAssignment(node, undefined, context, 0, false, createExportExpression); } else { - return ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("exports"), node.name, node.name), node.initializer); + return ts.createAssignment(ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), node.name), node.name), node.initializer); } } function visitMergeDeclarationMarker(node) { - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 205) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 207) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -45064,10 +48552,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 237: + case 239: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 238: + case 240: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -45125,7 +48613,7 @@ var ts; } function appendExportsOfDeclaration(statements, decl) { var name = ts.getDeclarationName(decl); - var exportSpecifiers = currentModuleInfo.exportSpecifiers[name.text]; + var exportSpecifiers = currentModuleInfo.exportSpecifiers.get(name.text); if (exportSpecifiers) { for (var _i = 0, exportSpecifiers_1 = exportSpecifiers; _i < exportSpecifiers_1.length; _i++) { var exportSpecifier = exportSpecifiers_1[_i]; @@ -45135,28 +48623,28 @@ var ts; return statements; } function appendExportStatement(statements, exportName, expression, location, allowComments) { - if (exportName.text === "default") { - var sourceFile = ts.getOriginalNode(currentSourceFile, ts.isSourceFile); - if (sourceFile && !sourceFile.symbol.exports["___esModule"]) { - if (languageVersion === 0) { - statements = ts.append(statements, ts.createStatement(createExportExpression(ts.createIdentifier("__esModule"), ts.createLiteral(true)))); - } - else { - statements = ts.append(statements, ts.createStatement(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), undefined, [ - ts.createIdentifier("exports"), - ts.createLiteral("__esModule"), - ts.createObjectLiteral([ - ts.createPropertyAssignment("value", ts.createLiteral(true)) - ]) - ]))); - } - } - } statements = ts.append(statements, createExportStatement(exportName, expression, location, allowComments)); return statements; } + function createUnderscoreUnderscoreESModule() { + var statement; + if (languageVersion === 0) { + statement = ts.createStatement(createExportExpression(ts.createIdentifier("__esModule"), ts.createLiteral(true))); + } + else { + statement = ts.createStatement(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), undefined, [ + ts.createIdentifier("exports"), + ts.createLiteral("__esModule"), + ts.createObjectLiteral([ + ts.createPropertyAssignment("value", ts.createLiteral(true)) + ]) + ])); + } + ts.setEmitFlags(statement, 524288); + return statement; + } function createExportStatement(name, value, location, allowComments) { - var statement = ts.createStatement(createExportExpression(name, value), location); + var statement = ts.setTextRange(ts.createStatement(createExportExpression(name, value)), location); ts.startOnNewLine(statement); if (!allowComments) { ts.setEmitFlags(statement, 1536); @@ -45164,7 +48652,7 @@ var ts; return statement; } function createExportExpression(name, value, location) { - return ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(name)), value, location); + return ts.setTextRange(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(name)), value), location); } function modifierVisitor(node) { switch (node.kind) { @@ -45174,26 +48662,26 @@ var ts; } return node; } - function onEmitNode(emitContext, node, emitCallback) { - if (node.kind === 261) { + function onEmitNode(hint, node, emitCallback) { + if (node.kind === 264) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; - noSubstitution = ts.createMap(); - previousOnEmitNode(emitContext, node, emitCallback); + noSubstitution = []; + previousOnEmitNode(hint, node, emitCallback); currentSourceFile = undefined; currentModuleInfo = undefined; noSubstitution = undefined; } else { - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); } } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); if (node.id && noSubstitution[node.id]) { return node; } - if (emitContext === 1) { + if (hint === 1) { return substituteExpression(node); } else if (ts.isShorthandPropertyAssignment(node)) { @@ -45207,9 +48695,9 @@ var ts; if (exportedOrImportedName !== name) { if (node.objectAssignmentInitializer) { var initializer = ts.createAssignment(exportedOrImportedName, node.objectAssignmentInitializer); - return ts.createPropertyAssignment(name, initializer, node); + return ts.setTextRange(ts.createPropertyAssignment(name, initializer), node); } - return ts.createPropertyAssignment(name, exportedOrImportedName, node); + return ts.setTextRange(ts.createPropertyAssignment(name, exportedOrImportedName), node); } return node; } @@ -45217,10 +48705,10 @@ var ts; switch (node.kind) { case 70: return substituteExpressionIdentifier(node); - case 192: + case 193: return substituteBinaryExpression(node); + case 192: case 191: - case 190: return substituteUnaryExpression(node); } return node; @@ -45235,17 +48723,17 @@ var ts; } if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 261) { - return ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node), node); + if (exportContainer && exportContainer.kind === 264) { + return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), node); } var importDeclaration = resolver.getReferencedImportDeclaration(node); if (importDeclaration) { if (ts.isImportClause(importDeclaration)) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default"), node); + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default")), node); } else if (ts.isImportSpecifier(importDeclaration)) { - var name_39 = importDeclaration.propertyName || importDeclaration.name; - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(name_39), node); + var name = importDeclaration.propertyName || importDeclaration.name; + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(name)), node); } } } @@ -45278,8 +48766,8 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 191 - ? ts.createBinary(node.operand, ts.createToken(node.operator === 42 ? 58 : 59), ts.createLiteral(1), node) + var expression = node.kind === 192 + ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 42 ? 58 : 59), ts.createLiteral(1)), node) : node; for (var _i = 0, exportedNames_2 = exportedNames; _i < exportedNames_2.length; _i++) { var exportName = exportedNames_2[_i]; @@ -45301,7 +48789,6 @@ var ts; } } } - var _a; } ts.transformModule = transformModule; var exportStarHelper = { @@ -45309,7 +48796,6 @@ var ts; scoped: true, text: "\n function __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n }" }; - var umdHelper = "\n (function (dependencies, factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define(dependencies, factory);\n }\n })"; })(ts || (ts = {})); var ts; (function (ts) { @@ -45323,14 +48809,14 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(70); - context.enableSubstitution(192); - context.enableSubstitution(190); + context.enableSubstitution(193); context.enableSubstitution(191); - context.enableEmitNotification(261); - var moduleInfoMap = ts.createMap(); - var deferredExports = ts.createMap(); - var exportFunctionsMap = ts.createMap(); - var noSubstitutionMap = ts.createMap(); + context.enableSubstitution(192); + context.enableEmitNotification(264); + var moduleInfoMap = []; + var deferredExports = []; + var exportFunctionsMap = []; + var noSubstitutionMap = []; var currentSourceFile; var moduleInfo; var exportFunction; @@ -45349,7 +48835,8 @@ var ts; currentSourceFile = node; enclosingBlockScopedContainer = node; moduleInfo = moduleInfoMap[id] = ts.collectExternalModuleInfo(node, resolver, compilerOptions); - exportFunction = exportFunctionsMap[id] = ts.createUniqueName("exports"); + exportFunction = ts.createUniqueName("exports"); + exportFunctionsMap[id] = exportFunction; contextObject = ts.createUniqueName("context"); var dependencyGroups = collectDependencyGroups(moduleInfo.externalImports); var moduleBodyBlock = createSystemModuleBody(node, dependencyGroups); @@ -45359,11 +48846,11 @@ var ts; ], undefined, moduleBodyBlock); var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions); var dependencies = ts.createArrayLiteral(ts.map(dependencyGroups, function (dependencyGroup) { return dependencyGroup.name; })); - var updated = ts.updateSourceFileNode(node, ts.createNodeArray([ + var updated = ts.setEmitFlags(ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ ts.createStatement(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("System"), "register"), undefined, moduleName ? [moduleName, dependencies, moduleBodyFunction] : [dependencies, moduleBodyFunction])) - ], node.statements)); + ]), node.statements)), 1024); if (!(compilerOptions.outFile || compilerOptions.out)) { ts.moveEmitHelpers(updated, moduleBodyBlock, function (helper) { return !helper.scoped; }); } @@ -45385,17 +48872,19 @@ var ts; for (var i = 0; i < externalImports.length; i++) { var externalImport = externalImports[i]; var externalModuleName = ts.getExternalModuleNameLiteral(externalImport, currentSourceFile, host, resolver, compilerOptions); - var text = externalModuleName.text; - if (ts.hasProperty(groupIndices, text)) { - var groupIndex = groupIndices[text]; - dependencyGroups[groupIndex].externalImports.push(externalImport); - } - else { - groupIndices[text] = dependencyGroups.length; - dependencyGroups.push({ - name: externalModuleName, - externalImports: [externalImport] - }); + if (externalModuleName) { + var text = externalModuleName.text; + var groupIndex = groupIndices.get(text); + if (groupIndex !== undefined) { + dependencyGroups[groupIndex].externalImports.push(externalImport); + } + else { + groupIndices.set(text, dependencyGroups.length); + dependencyGroups.push({ + name: externalModuleName, + externalImports: [externalImport] + }); + } } } return dependencyGroups; @@ -45403,30 +48892,33 @@ var ts; function createSystemModuleBody(node, dependencyGroups) { var statements = []; startLexicalEnvironment(); - var statementOffset = ts.addPrologueDirectives(statements, node.statements, !compilerOptions.noImplicitUseStrict, sourceElementVisitor); + var ensureUseStrict = compilerOptions.alwaysStrict || (!compilerOptions.noImplicitUseStrict && ts.isExternalModule(currentSourceFile)); + var statementOffset = ts.addPrologue(statements, node.statements, ensureUseStrict, sourceElementVisitor); statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ ts.createVariableDeclaration("__moduleName", undefined, ts.createLogicalAnd(contextObject, ts.createPropertyAccess(contextObject, "id"))) ]))); - ts.visitNode(moduleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement, true); + ts.visitNode(moduleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement); var executeStatements = ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset); ts.addRange(statements, hoistedStatements); ts.addRange(statements, endLexicalEnvironment()); var exportStarFunction = addExportStarIfNeeded(statements); - statements.push(ts.createReturn(ts.setMultiLine(ts.createObjectLiteral([ + var moduleObject = ts.createObjectLiteral([ ts.createPropertyAssignment("setters", createSettersArray(exportStarFunction, dependencyGroups)), - ts.createPropertyAssignment("execute", ts.createFunctionExpression(undefined, undefined, undefined, undefined, [], undefined, ts.createBlock(executeStatements, undefined, true))) - ]), true))); - return ts.createBlock(statements, undefined, true); + ts.createPropertyAssignment("execute", ts.createFunctionExpression(undefined, undefined, undefined, undefined, [], undefined, ts.createBlock(executeStatements, true))) + ]); + moduleObject.multiLine = true; + statements.push(ts.createReturn(moduleObject)); + return ts.createBlock(statements, true); } function addExportStarIfNeeded(statements) { if (!moduleInfo.hasExportStarsToExportValues) { return; } - if (!moduleInfo.exportedNames && ts.isEmpty(moduleInfo.exportSpecifiers)) { + if (!moduleInfo.exportedNames && moduleInfo.exportSpecifiers.size === 0) { var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 241 && externalImport.exportClause) { + if (externalImport.kind === 243 && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -45444,12 +48936,12 @@ var ts; if (exportedLocalName.text === "default") { continue; } - exportedNames.push(ts.createPropertyAssignment(ts.createLiteral(exportedLocalName), ts.createLiteral(true))); + exportedNames.push(ts.createPropertyAssignment(ts.createLiteral(exportedLocalName), ts.createTrue())); } } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 241) { + if (externalImport.kind !== 243) { continue; } var exportDecl = externalImport; @@ -45458,12 +48950,12 @@ var ts; } for (var _f = 0, _g = exportDecl.exportClause.elements; _f < _g.length; _f++) { var element = _g[_f]; - exportedNames.push(ts.createPropertyAssignment(ts.createLiteral((element.name || element.propertyName).text), ts.createLiteral(true))); + exportedNames.push(ts.createPropertyAssignment(ts.createLiteral((element.name || element.propertyName).text), ts.createTrue())); } } var exportedNamesStorageRef = ts.createUniqueName("exportedNames"); statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ - ts.createVariableDeclaration(exportedNamesStorageRef, undefined, ts.createObjectLiteral(exportedNames, undefined, true)) + ts.createVariableDeclaration(exportedNamesStorageRef, undefined, ts.createObjectLiteral(exportedNames, true)) ]))); var exportStarFunction = createExportStarFunction(exportedNamesStorageRef); statements.push(exportStarFunction); @@ -45488,7 +48980,7 @@ var ts; ts.setEmitFlags(ts.createIf(condition, ts.createStatement(ts.createAssignment(ts.createElementAccess(exports, n), ts.createElementAccess(m, n)))), 1) ])), ts.createStatement(ts.createCall(exportFunction, undefined, [exports])) - ], undefined, true)); + ], true)); } function createSettersArray(exportStarFunction, dependencyGroups) { var setters = []; @@ -45501,15 +48993,15 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); switch (entry.kind) { - case 235: + case 237: if (!entry.importClause) { break; } - case 234: + case 236: ts.Debug.assert(importVariableName !== undefined); statements.push(ts.createStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 241: + case 243: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { var properties = []; @@ -45517,7 +49009,7 @@ var ts; var e = _d[_c]; properties.push(ts.createPropertyAssignment(ts.createLiteral(e.name.text), ts.createElementAccess(parameterName, ts.createLiteral((e.propertyName || e.name).text)))); } - statements.push(ts.createStatement(ts.createCall(exportFunction, undefined, [ts.createObjectLiteral(properties, undefined, true)]))); + statements.push(ts.createStatement(ts.createCall(exportFunction, undefined, [ts.createObjectLiteral(properties, true)]))); } else { statements.push(ts.createStatement(ts.createCall(exportStarFunction, undefined, [parameterName]))); @@ -45525,19 +49017,19 @@ var ts; break; } } - setters.push(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, parameterName)], undefined, ts.createBlock(statements, undefined, true))); + setters.push(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, parameterName)], undefined, ts.createBlock(statements, true))); } - return ts.createArrayLiteral(setters, undefined, true); + return ts.createArrayLiteral(setters, true); } function sourceElementVisitor(node) { switch (node.kind) { - case 235: + case 237: return visitImportDeclaration(node); - case 234: + case 236: return visitImportEqualsDeclaration(node); - case 241: + case 243: return undefined; - case 240: + case 242: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -45586,7 +49078,7 @@ var ts; } function visitFunctionDeclaration(node) { if (ts.hasModifier(node, 1)) { - hoistedStatements = ts.append(hoistedStatements, ts.updateFunctionDeclaration(node, node.decorators, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.getDeclarationName(node, true, true), undefined, ts.visitNodes(node.parameters, destructuringVisitor, ts.isParameterDeclaration), undefined, ts.visitNode(node.body, destructuringVisitor, ts.isBlock))); + hoistedStatements = ts.append(hoistedStatements, ts.updateFunctionDeclaration(node, node.decorators, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, ts.getDeclarationName(node, true, true), undefined, ts.visitNodes(node.parameters, destructuringVisitor, ts.isParameterDeclaration), undefined, ts.visitNode(node.body, destructuringVisitor, ts.isBlock))); } else { hoistedStatements = ts.append(hoistedStatements, node); @@ -45604,7 +49096,7 @@ var ts; var statements; var name = ts.getLocalName(node); hoistVariableDeclaration(name); - statements = ts.append(statements, ts.createStatement(ts.createAssignment(name, ts.createClassExpression(undefined, node.name, undefined, ts.visitNodes(node.heritageClauses, destructuringVisitor, ts.isHeritageClause), ts.visitNodes(node.members, destructuringVisitor, ts.isClassElement), node)), node)); + statements = ts.append(statements, ts.setTextRange(ts.createStatement(ts.createAssignment(name, ts.setTextRange(ts.createClassExpression(undefined, node.name, undefined, ts.visitNodes(node.heritageClauses, destructuringVisitor, ts.isHeritageClause), ts.visitNodes(node.members, destructuringVisitor, ts.isClassElement)), node))), node)); if (hasAssociatedEndOfDeclarationMarker(node)) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node); @@ -45632,7 +49124,7 @@ var ts; } var statements; if (expressions) { - statements = ts.append(statements, ts.createStatement(ts.inlineExpressions(expressions), node)); + statements = ts.append(statements, ts.setTextRange(ts.createStatement(ts.inlineExpressions(expressions)), node)); } if (isMarkedDeclaration) { var id = ts.getOriginalNodeId(node); @@ -45658,7 +49150,7 @@ var ts; } function shouldHoistVariableDeclarationList(node) { return (ts.getEmitFlags(node) & 1048576) === 0 - && (enclosingBlockScopedContainer.kind === 261 + && (enclosingBlockScopedContainer.kind === 264 || (ts.getOriginalNode(node).flags & 3) === 0); } function transformInitializedVariable(node, isExportedDeclaration) { @@ -45676,11 +49168,11 @@ var ts; function createVariableAssignment(name, value, location, isExportedDeclaration) { hoistVariableDeclaration(ts.getSynthesizedClone(name)); return isExportedDeclaration - ? createExportExpression(name, preventSubstitution(ts.createAssignment(name, value, location))) - : preventSubstitution(ts.createAssignment(name, value, location)); + ? createExportExpression(name, preventSubstitution(ts.setTextRange(ts.createAssignment(name, value), location))) + : preventSubstitution(ts.setTextRange(ts.createAssignment(name, value), location)); } function visitMergeDeclarationMarker(node) { - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 205) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 207) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -45713,10 +49205,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 237: + case 239: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 238: + case 240: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -45786,7 +49278,7 @@ var ts; return statements; } var name = ts.getDeclarationName(decl); - var exportSpecifiers = moduleInfo.exportSpecifiers[name.text]; + var exportSpecifiers = moduleInfo.exportSpecifiers.get(name.text); if (exportSpecifiers) { for (var _i = 0, exportSpecifiers_2 = exportSpecifiers; _i < exportSpecifiers_2.length; _i++) { var exportSpecifier = exportSpecifiers_2[_i]; @@ -45815,43 +49307,43 @@ var ts; } function nestedElementVisitor(node) { switch (node.kind) { - case 205: + case 207: return visitVariableStatement(node); - case 225: + case 227: return visitFunctionDeclaration(node); - case 226: + case 228: return visitClassDeclaration(node); - case 211: - return visitForStatement(node); - case 212: - return visitForInStatement(node); case 213: + return visitForStatement(node); + case 214: + return visitForInStatement(node); + case 215: return visitForOfStatement(node); - case 209: + case 211: return visitDoStatement(node); - case 210: + case 212: return visitWhileStatement(node); - case 219: - return visitLabeledStatement(node); - case 217: - return visitWithStatement(node); - case 218: - return visitSwitchStatement(node); - case 232: - return visitCaseBlock(node); - case 253: - return visitCaseClause(node); - case 254: - return visitDefaultClause(node); case 221: - return visitTryStatement(node); + return visitLabeledStatement(node); + case 219: + return visitWithStatement(node); + case 220: + return visitSwitchStatement(node); + case 234: + return visitCaseBlock(node); case 256: + return visitCaseClause(node); + case 257: + return visitDefaultClause(node); + case 223: + return visitTryStatement(node); + case 259: return visitCatchClause(node); - case 204: + case 206: return visitBlock(node); - case 295: - return visitMergeDeclarationMarker(node); case 296: + return visitMergeDeclarationMarker(node); + case 297: return visitEndOfDeclarationMarker(node); default: return destructuringVisitor(node); @@ -45860,21 +49352,21 @@ var ts; function visitForStatement(node) { var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; enclosingBlockScopedContainer = node; - node = ts.updateFor(node, visitForInitializer(node.initializer), ts.visitNode(node.condition, destructuringVisitor, ts.isExpression, true), ts.visitNode(node.incrementor, destructuringVisitor, ts.isExpression, true), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement)); + node = ts.updateFor(node, visitForInitializer(node.initializer), ts.visitNode(node.condition, destructuringVisitor, ts.isExpression), ts.visitNode(node.incrementor, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement)); enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; return node; } function visitForInStatement(node) { var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; enclosingBlockScopedContainer = node; - node = ts.updateForIn(node, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, false, ts.liftToBlock)); + node = ts.updateForIn(node, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; return node; } function visitForOfStatement(node) { var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; enclosingBlockScopedContainer = node; - node = ts.updateForOf(node, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, false, ts.liftToBlock)); + node = ts.updateForOf(node, node.awaitModifier, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; return node; } @@ -45883,6 +49375,9 @@ var ts; && shouldHoistVariableDeclarationList(node); } function visitForInitializer(node) { + if (!node) { + return node; + } if (shouldHoistForInitializer(node)) { var expressions = void 0; for (var _i = 0, _a = node.declarations; _i < _a.length; _i++) { @@ -45896,16 +49391,16 @@ var ts; } } function visitDoStatement(node) { - return ts.updateDo(node, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, false, ts.liftToBlock), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression)); + return ts.updateDo(node, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression)); } function visitWhileStatement(node) { - return ts.updateWhile(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, false, ts.liftToBlock)); + return ts.updateWhile(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); } function visitLabeledStatement(node) { - return ts.updateLabel(node, node.label, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, false, ts.liftToBlock)); + return ts.updateLabel(node, node.label, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); } function visitWithStatement(node) { - return ts.updateWith(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, false, ts.liftToBlock)); + return ts.updateWith(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); } function visitSwitchStatement(node) { return ts.updateSwitch(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.caseBlock, nestedElementVisitor, ts.isCaseBlock)); @@ -45942,7 +49437,7 @@ var ts; } function destructuringVisitor(node) { if (node.transformFlags & 1024 - && node.kind === 192) { + && node.kind === 193) { return visitDestructuringAssignment(node); } else if (node.transformFlags & 2048) { @@ -45959,7 +49454,7 @@ var ts; return ts.visitEachChild(node, destructuringVisitor, context); } function hasExportedReferenceInDestructuringTarget(node) { - if (ts.isAssignmentExpression(node)) { + if (ts.isAssignmentExpression(node, true)) { return hasExportedReferenceInDestructuringTarget(node.left); } else if (ts.isSpreadExpression(node)) { @@ -45979,7 +49474,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 261; + return container !== undefined && container.kind === 264; } else { return false; @@ -45993,8 +49488,8 @@ var ts; } return node; } - function onEmitNode(emitContext, node, emitCallback) { - if (node.kind === 261) { + function onEmitNode(hint, node, emitCallback) { + if (node.kind === 264) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -46003,22 +49498,22 @@ var ts; if (noSubstitution) { delete noSubstitutionMap[id]; } - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); currentSourceFile = undefined; moduleInfo = undefined; exportFunction = undefined; noSubstitution = undefined; } else { - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); } } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); if (isSubstitutionPrevented(node)) { return node; } - if (emitContext === 1) { + if (hint === 1) { return substituteExpression(node); } return node; @@ -46027,10 +49522,10 @@ var ts; switch (node.kind) { case 70: return substituteExpressionIdentifier(node); - case 192: + case 193: return substituteBinaryExpression(node); - case 190: case 191: + case 192: return substituteUnaryExpression(node); } return node; @@ -46047,10 +49542,10 @@ var ts; var importDeclaration = resolver.getReferencedImportDeclaration(node); if (importDeclaration) { if (ts.isImportClause(importDeclaration)) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default"), node); + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default")), node); } else if (ts.isImportSpecifier(importDeclaration)) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(importDeclaration.propertyName || importDeclaration.name), node); + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(importDeclaration.propertyName || importDeclaration.name)), node); } } } @@ -46082,14 +49577,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 191 - ? ts.createPrefix(node.operator, node.operand, node) + var expression = node.kind === 192 + ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_4 = exportedNames; _i < exportedNames_4.length; _i++) { var exportName = exportedNames_4[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 191) { + if (node.kind === 192) { expression = node.operator === 42 ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); @@ -46106,7 +49601,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, false); - if (exportContainer && exportContainer.kind === 261) { + if (exportContainer && exportContainer.kind === 264) { exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -46116,7 +49611,7 @@ var ts; } function preventSubstitution(node) { if (noSubstitution === undefined) - noSubstitution = ts.createMap(); + noSubstitution = []; noSubstitution[ts.getNodeId(node)] = true; return node; } @@ -46134,7 +49629,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(261); + context.enableEmitNotification(264); context.enableSubstitution(70); var currentSourceFile; return transformSourceFile; @@ -46146,10 +49641,10 @@ var ts; var externalHelpersModuleName = ts.getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions); if (externalHelpersModuleName) { var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.statements); + var statementOffset = ts.addPrologue(statements, node.statements); ts.append(statements, ts.createImportDeclaration(undefined, undefined, ts.createImportClause(undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText))); ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset)); - return ts.updateSourceFileNode(node, ts.createNodeArray(statements, node.statements)); + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements)); } else { return ts.visitEachChild(node, visitor, context); @@ -46159,9 +49654,9 @@ var ts; } function visitor(node) { switch (node.kind) { - case 234: + case 236: return undefined; - case 240: + case 242: return visitExportAssignment(node); } return node; @@ -46169,19 +49664,19 @@ var ts; function visitExportAssignment(node) { return node.isExportEquals ? undefined : node; } - function onEmitNode(emitContext, node, emitCallback) { + function onEmitNode(hint, node, emitCallback) { if (ts.isSourceFile(node)) { currentSourceFile = node; - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); currentSourceFile = undefined; } else { - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); } } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (ts.isIdentifier(node) && emitContext === 1) { + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (ts.isIdentifier(node) && hint === 1) { return substituteExpressionIdentifier(node); } return node; @@ -46200,19 +49695,34 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var moduleTransformerMap = ts.createMap((_a = {}, - _a[ts.ModuleKind.ES2015] = ts.transformES2015Module, - _a[ts.ModuleKind.System] = ts.transformSystemModule, - _a[ts.ModuleKind.AMD] = ts.transformModule, - _a[ts.ModuleKind.CommonJS] = ts.transformModule, - _a[ts.ModuleKind.UMD] = ts.transformModule, - _a[ts.ModuleKind.None] = ts.transformModule, - _a)); - function getTransformers(compilerOptions) { + function getModuleTransformer(moduleKind) { + switch (moduleKind) { + case ts.ModuleKind.ES2015: + return ts.transformES2015Module; + case ts.ModuleKind.System: + return ts.transformSystemModule; + default: + return ts.transformModule; + } + } + var TransformationState; + (function (TransformationState) { + TransformationState[TransformationState["Uninitialized"] = 0] = "Uninitialized"; + TransformationState[TransformationState["Initialized"] = 1] = "Initialized"; + TransformationState[TransformationState["Completed"] = 2] = "Completed"; + TransformationState[TransformationState["Disposed"] = 3] = "Disposed"; + })(TransformationState || (TransformationState = {})); + var SyntaxKindFeatureFlags; + (function (SyntaxKindFeatureFlags) { + SyntaxKindFeatureFlags[SyntaxKindFeatureFlags["Substitution"] = 1] = "Substitution"; + SyntaxKindFeatureFlags[SyntaxKindFeatureFlags["EmitNotifications"] = 2] = "EmitNotifications"; + })(SyntaxKindFeatureFlags || (SyntaxKindFeatureFlags = {})); + function getTransformers(compilerOptions, customTransformers) { var jsx = compilerOptions.jsx; var languageVersion = ts.getEmitScriptTarget(compilerOptions); var moduleKind = ts.getEmitModuleKind(compilerOptions); var transformers = []; + ts.addRange(transformers, customTransformers && customTransformers.before); transformers.push(ts.transformTypeScript); if (jsx === 2) { transformers.push(ts.transformJsx); @@ -46230,16 +49740,16 @@ var ts; transformers.push(ts.transformES2015); transformers.push(ts.transformGenerators); } - transformers.push(moduleTransformerMap[moduleKind] || moduleTransformerMap[ts.ModuleKind.None]); + transformers.push(getModuleTransformer(moduleKind)); if (languageVersion < 1) { transformers.push(ts.transformES5); } + ts.addRange(transformers, customTransformers && customTransformers.after); return transformers; } ts.getTransformers = getTransformers; - function transformFiles(resolver, host, sourceFiles, transformers) { + function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { var enabledSyntaxKindFeatures = new Array(298); - var lexicalEnvironmentDisabled = false; var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -46247,8 +49757,11 @@ var ts; var lexicalEnvironmentStackOffset = 0; var lexicalEnvironmentSuspended = false; var emitHelpers; + var onSubstituteNode = function (_, node) { return node; }; + var onEmitNode = function (hint, node, callback) { return callback(hint, node); }; + var state = 0; var context = { - getCompilerOptions: function () { return host.getCompilerOptions(); }, + getCompilerOptions: function () { return options; }, getEmitResolver: function () { return resolver; }, getEmitHost: function () { return host; }, startLexicalEnvironment: startLexicalEnvironment, @@ -46259,65 +49772,77 @@ var ts; hoistFunctionDeclaration: hoistFunctionDeclaration, requestEmitHelper: requestEmitHelper, readEmitHelpers: readEmitHelpers, - onSubstituteNode: function (_emitContext, node) { return node; }, enableSubstitution: enableSubstitution, - isSubstitutionEnabled: isSubstitutionEnabled, - onEmitNode: function (node, emitContext, emitCallback) { return emitCallback(node, emitContext); }, enableEmitNotification: enableEmitNotification, - isEmitNotificationEnabled: isEmitNotificationEnabled + isSubstitutionEnabled: isSubstitutionEnabled, + isEmitNotificationEnabled: isEmitNotificationEnabled, + get onSubstituteNode() { return onSubstituteNode; }, + set onSubstituteNode(value) { + ts.Debug.assert(state < 1, "Cannot modify transformation hooks after initialization has completed."); + ts.Debug.assert(value !== undefined, "Value must not be 'undefined'"); + onSubstituteNode = value; + }, + get onEmitNode() { return onEmitNode; }, + set onEmitNode(value) { + ts.Debug.assert(state < 1, "Cannot modify transformation hooks after initialization has completed."); + ts.Debug.assert(value !== undefined, "Value must not be 'undefined'"); + onEmitNode = value; + } }; + for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { + var node = nodes_4[_i]; + ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node))); + } + ts.performance.mark("beforeTransform"); var transformation = ts.chain.apply(void 0, transformers)(context); - var transformed = ts.map(sourceFiles, transformSourceFile); - lexicalEnvironmentDisabled = true; + state = 1; + var transformed = ts.map(nodes, allowDtsFiles ? transformation : transformRoot); + state = 2; + ts.performance.mark("afterTransform"); + ts.performance.measure("transformTime", "beforeTransform", "afterTransform"); return { transformed: transformed, - emitNodeWithSubstitution: emitNodeWithSubstitution, - emitNodeWithNotification: emitNodeWithNotification + substituteNode: substituteNode, + emitNodeWithNotification: emitNodeWithNotification, + dispose: dispose }; - function transformSourceFile(sourceFile) { - if (ts.isDeclarationFile(sourceFile)) { - return sourceFile; - } - return transformation(sourceFile); + function transformRoot(node) { + return node && (!ts.isSourceFile(node) || !ts.isDeclarationFile(node)) ? transformation(node) : node; } function enableSubstitution(kind) { + ts.Debug.assert(state < 2, "Cannot modify the transformation context after transformation has completed."); enabledSyntaxKindFeatures[kind] |= 1; } function isSubstitutionEnabled(node) { return (enabledSyntaxKindFeatures[node.kind] & 1) !== 0 && (ts.getEmitFlags(node) & 4) === 0; } - function emitNodeWithSubstitution(emitContext, node, emitCallback) { - if (node) { - if (isSubstitutionEnabled(node)) { - var substitute = context.onSubstituteNode(emitContext, node); - if (substitute && substitute !== node) { - emitCallback(emitContext, substitute); - return; - } - } - emitCallback(emitContext, node); - } + function substituteNode(hint, node) { + ts.Debug.assert(state < 3, "Cannot substitute a node after the result is disposed."); + return node && isSubstitutionEnabled(node) && onSubstituteNode(hint, node) || node; } function enableEmitNotification(kind) { + ts.Debug.assert(state < 2, "Cannot modify the transformation context after transformation has completed."); enabledSyntaxKindFeatures[kind] |= 2; } function isEmitNotificationEnabled(node) { return (enabledSyntaxKindFeatures[node.kind] & 2) !== 0 || (ts.getEmitFlags(node) & 2) !== 0; } - function emitNodeWithNotification(emitContext, node, emitCallback) { + function emitNodeWithNotification(hint, node, emitCallback) { + ts.Debug.assert(state < 3, "Cannot invoke TransformationResult callbacks after the result is disposed."); if (node) { if (isEmitNotificationEnabled(node)) { - context.onEmitNode(emitContext, node, emitCallback); + onEmitNode(hint, node, emitCallback); } else { - emitCallback(emitContext, node); + emitCallback(hint, node); } } } function hoistVariableDeclaration(name) { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); var decl = ts.createVariableDeclaration(name); if (!lexicalEnvironmentVariableDeclarations) { lexicalEnvironmentVariableDeclarations = [decl]; @@ -46327,7 +49852,8 @@ var ts; } } function hoistFunctionDeclaration(func) { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); if (!lexicalEnvironmentFunctionDeclarations) { lexicalEnvironmentFunctionDeclarations = [func]; } @@ -46336,7 +49862,8 @@ var ts; } } function startLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot start a lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is suspended."); lexicalEnvironmentVariableDeclarationsStack[lexicalEnvironmentStackOffset] = lexicalEnvironmentVariableDeclarations; lexicalEnvironmentFunctionDeclarationsStack[lexicalEnvironmentStackOffset] = lexicalEnvironmentFunctionDeclarations; @@ -46345,17 +49872,20 @@ var ts; lexicalEnvironmentFunctionDeclarations = undefined; } function suspendLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot suspend a lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is already suspended."); lexicalEnvironmentSuspended = true; } function resumeLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot resume a lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(lexicalEnvironmentSuspended, "Lexical environment is not suspended."); lexicalEnvironmentSuspended = false; } function endLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot end a lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is suspended."); var statements; if (lexicalEnvironmentVariableDeclarations || lexicalEnvironmentFunctionDeclarations) { @@ -46382,33 +49912,52 @@ var ts; return statements; } function requestEmitHelper(helper) { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the transformation context during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the transformation context after transformation has completed."); ts.Debug.assert(!helper.scoped, "Cannot request a scoped emit helper."); emitHelpers = ts.append(emitHelpers, helper); } function readEmitHelpers() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the transformation context during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the transformation context after transformation has completed."); var helpers = emitHelpers; emitHelpers = undefined; return helpers; } + function dispose() { + if (state < 3) { + for (var _i = 0, nodes_5 = nodes; _i < nodes_5.length; _i++) { + var node = nodes_5[_i]; + ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node))); + } + lexicalEnvironmentVariableDeclarations = undefined; + lexicalEnvironmentVariableDeclarationsStack = undefined; + lexicalEnvironmentFunctionDeclarations = undefined; + lexicalEnvironmentFunctionDeclarationsStack = undefined; + onSubstituteNode = undefined; + onEmitNode = undefined; + emitHelpers = undefined; + state = 3; + } + } } - ts.transformFiles = transformFiles; - var _a; + ts.transformNodes = transformNodes; })(ts || (ts = {})); var ts; (function (ts) { function getDeclarationDiagnostics(host, resolver, targetSourceFile) { var declarationDiagnostics = ts.createDiagnosticCollection(); - ts.forEachExpectedEmitFile(host, getDeclarationDiagnosticsFromFile, targetSourceFile); + ts.forEachEmittedFile(host, getDeclarationDiagnosticsFromFile, targetSourceFile); return declarationDiagnostics.getDiagnostics(targetSourceFile ? targetSourceFile.fileName : undefined); - function getDeclarationDiagnosticsFromFile(_a, sources, isBundledEmit) { + function getDeclarationDiagnosticsFromFile(_a, sourceFileOrBundle) { var declarationFilePath = _a.declarationFilePath; - emitDeclarations(host, resolver, declarationDiagnostics, declarationFilePath, sources, isBundledEmit, false); + emitDeclarations(host, resolver, declarationDiagnostics, declarationFilePath, sourceFileOrBundle, false); } } ts.getDeclarationDiagnostics = getDeclarationDiagnostics; - function emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFiles, isBundledEmit, emitOnlyDtsFiles) { + function emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles) { + var sourceFiles = sourceFileOrBundle.kind === 265 ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; + var isBundledEmit = sourceFileOrBundle.kind === 265; var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); var write; @@ -46470,7 +50019,7 @@ var ts; var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { - ts.Debug.assert(aliasEmitInfo.node.kind === 235); + ts.Debug.assert(aliasEmitInfo.node.kind === 237); createAndSetNewTextWriterWithSymbolWriter(); ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit)); for (var i = 0; i < aliasEmitInfo.indent; i++) { @@ -46493,9 +50042,9 @@ var ts; } }); if (usedTypeDirectiveReferences) { - for (var directive in usedTypeDirectiveReferences) { + ts.forEachKey(usedTypeDirectiveReferences, function (directive) { referencesOutput += "/// " + newLine; - } + }); } return { reportedDeclarationError: reportedDeclarationError, @@ -46520,12 +50069,14 @@ var ts; var writer = ts.createTextWriter(newLine); writer.trackSymbol = trackSymbol; writer.reportInaccessibleThisError = reportInaccessibleThisError; + writer.reportIllegalExtends = reportIllegalExtends; writer.writeKeyword = writer.write; writer.writeOperator = writer.write; writer.writePunctuation = writer.write; writer.writeSpace = writer.write; writer.writeStringLiteral = writer.writeLiteral; writer.writeParameter = writer.write; + writer.writeProperty = writer.write; writer.writeSymbol = writer.write; setWriter(writer); } @@ -46541,10 +50092,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 223) { + if (declaration.kind === 225) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 238 || declaration.kind === 239 || declaration.kind === 236) { + else if (declaration.kind === 240 || declaration.kind === 241 || declaration.kind === 238) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -46555,7 +50106,7 @@ var ts; moduleElementEmitInfo = ts.forEach(asynchronousSubModuleDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; }); } if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 235) { + if (moduleElementEmitInfo.node.kind === 237) { moduleElementEmitInfo.isVisible = true; } else { @@ -46563,12 +50114,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 230) { + if (nodeToCheck.kind === 232) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 230) { + if (nodeToCheck.kind === 232) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -46587,8 +50138,8 @@ var ts; } for (var _i = 0, typeReferenceDirectives_1 = typeReferenceDirectives; _i < typeReferenceDirectives_1.length; _i++) { var directive = typeReferenceDirectives_1[_i]; - if (!(directive in usedTypeDirectiveReferences)) { - usedTypeDirectiveReferences[directive] = directive; + if (!usedTypeDirectiveReferences.has(directive)) { + usedTypeDirectiveReferences.set(directive, directive); } } } @@ -46615,6 +50166,12 @@ var ts; handleSymbolAccessibilityError(resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning, true)); recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForSymbol(symbol, meaning)); } + function reportIllegalExtends() { + if (errorNameNode) { + reportedDeclarationError = true; + emitterDiagnostics.add(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.extends_clause_of_exported_class_0_refers_to_a_type_whose_name_cannot_be_referenced, ts.declarationNameToString(errorNameNode))); + } + } function reportInaccessibleThisError() { if (errorNameNode) { reportedDeclarationError = true; @@ -46624,12 +50181,16 @@ var ts; function writeTypeOfDeclaration(declaration, type, getSymbolAccessibilityDiagnostic) { writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; write(": "); - if (type) { + var shouldUseResolverType = declaration.kind === 145 && + resolver.isRequiredInitializedParameter(declaration); + if (type && !shouldUseResolverType) { emitType(type); } else { errorNameNode = declaration.name; - resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, 2 | 1024, writer); + var format = 2 | 1024 | + (shouldUseResolverType ? 4096 : 0); + resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, format, writer); errorNameNode = undefined; } } @@ -46646,15 +50207,15 @@ var ts; } } function emitLines(nodes) { - for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { - var node = nodes_4[_i]; + for (var _i = 0, nodes_6 = nodes; _i < nodes_6.length; _i++) { + var node = nodes_6[_i]; emit(node); } } function emitSeparatedList(nodes, separator, eachNodeEmitFn, canEmitFn) { var currentWriterPos = writer.getTextPos(); - for (var _i = 0, nodes_5 = nodes; _i < nodes_5.length; _i++) { - var node = nodes_5[_i]; + for (var _i = 0, nodes_7 = nodes; _i < nodes_7.length; _i++) { + var node = nodes_7[_i]; if (!canEmitFn || canEmitFn(node)) { if (currentWriterPos !== writer.getTextPos()) { write(separator); @@ -46681,49 +50242,50 @@ var ts; function emitType(type) { switch (type.kind) { case 118: - case 134: + case 135: case 132: case 121: - case 135: + case 133: + case 136: case 104: - case 137: + case 138: case 94: case 129: - case 167: - case 171: - return writeTextOfNode(currentText, type); - case 199: - return emitExpressionWithTypeArguments(type); - case 157: - return emitTypeReference(type); - case 160: - return emitTypeQuery(type); - case 162: - return emitArrayType(type); - case 163: - return emitTupleType(type); - case 164: - return emitUnionType(type); - case 165: - return emitIntersectionType(type); - case 166: - return emitParenType(type); case 168: - return emitTypeOperator(type); - case 169: - return emitIndexedAccessType(type); - case 170: - return emitMappedType(type); + case 172: + return writeTextOfNode(currentText, type); + case 200: + return emitExpressionWithTypeArguments(type); case 158: - case 159: - return emitSignatureDeclarationWithJsDocComments(type); + return emitTypeReference(type); case 161: + return emitTypeQuery(type); + case 163: + return emitArrayType(type); + case 164: + return emitTupleType(type); + case 165: + return emitUnionType(type); + case 166: + return emitIntersectionType(type); + case 167: + return emitParenType(type); + case 169: + return emitTypeOperator(type); + case 170: + return emitIndexedAccessType(type); + case 171: + return emitMappedType(type); + case 159: + case 160: + return emitSignatureDeclarationWithJsDocComments(type); + case 162: return emitTypeLiteral(type); case 70: return emitEntityName(type); - case 141: + case 142: return emitEntityName(type); - case 156: + case 157: return emitTypePredicate(type); } function writeEntityName(entityName) { @@ -46731,22 +50293,22 @@ var ts; writeTextOfNode(currentText, entityName); } else { - var left = entityName.kind === 141 ? entityName.left : entityName.expression; - var right = entityName.kind === 141 ? entityName.right : entityName.name; + var left = entityName.kind === 142 ? entityName.left : entityName.expression; + var right = entityName.kind === 142 ? entityName.right : entityName.name; writeEntityName(left); write("."); writeTextOfNode(currentText, right); } } function emitEntityName(entityName) { - var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 234 ? entityName.parent : enclosingDeclaration); + var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 236 ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForEntityName(entityName)); writeEntityName(entityName); } function emitExpressionWithTypeArguments(node) { if (ts.isEntityNameExpression(node.expression)) { - ts.Debug.assert(node.expression.kind === 70 || node.expression.kind === 177); + ts.Debug.assert(node.expression.kind === 70 || node.expression.kind === 178); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -46850,15 +50412,15 @@ var ts; } function getExportDefaultTempVariableName() { var baseName = "_default"; - if (!(baseName in currentIdentifiers)) { + if (!currentIdentifiers.has(baseName)) { return baseName; } var count = 0; while (true) { count++; - var name_40 = baseName + "_" + count; - if (!(name_40 in currentIdentifiers)) { - return name_40; + var name = baseName + "_" + count; + if (!currentIdentifiers.has(name)) { + return name; } } } @@ -46902,10 +50464,10 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 234 || - (node.parent.kind === 261 && isCurrentFileExternalModule)) { + else if (node.kind === 236 || + (node.parent.kind === 264 && isCurrentFileExternalModule)) { var isVisible = void 0; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 261) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 264) { asynchronousSubModuleDeclarationEmitInfo.push({ node: node, outputPos: writer.getTextPos(), @@ -46914,7 +50476,7 @@ var ts; }); } else { - if (node.kind === 235) { + if (node.kind === 237) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -46932,30 +50494,30 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 225: - return writeFunctionDeclaration(node); - case 205: - return writeVariableStatement(node); case 227: - return writeInterfaceDeclaration(node); - case 226: - return writeClassDeclaration(node); - case 228: - return writeTypeAliasDeclaration(node); + return writeFunctionDeclaration(node); + case 207: + return writeVariableStatement(node); case 229: - return writeEnumDeclaration(node); + return writeInterfaceDeclaration(node); + case 228: + return writeClassDeclaration(node); case 230: + return writeTypeAliasDeclaration(node); + case 231: + return writeEnumDeclaration(node); + case 232: return writeModuleDeclaration(node); - case 234: + case 236: return writeImportEqualsDeclaration(node); - case 235: + case 237: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); } } function emitModuleElementDeclarationFlags(node) { - if (node.parent.kind === 261) { + if (node.parent.kind === 264) { var modifiers = ts.getModifierFlags(node); if (modifiers & 1) { write("export "); @@ -46963,7 +50525,7 @@ var ts; if (modifiers & 512) { write("default "); } - else if (node.kind !== 227 && !noDeclare) { + else if (node.kind !== 229 && !noDeclare) { write("declare "); } } @@ -47013,7 +50575,7 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 237) { + if (namedBindings.kind === 239) { return resolver.isDeclarationVisible(namedBindings); } else { @@ -47036,7 +50598,7 @@ var ts; if (currentWriterPos !== writer.getTextPos()) { write(", "); } - if (node.importClause.namedBindings.kind === 237) { + if (node.importClause.namedBindings.kind === 239) { write("* as "); writeTextOfNode(currentText, node.importClause.namedBindings.name); } @@ -47053,13 +50615,13 @@ var ts; writer.writeLine(); } function emitExternalModuleSpecifier(parent) { - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 230; + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 232; var moduleSpecifier; - if (parent.kind === 234) { + if (parent.kind === 236) { var node = parent; moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node); } - else if (parent.kind === 230) { + else if (parent.kind === 232) { moduleSpecifier = parent.name; } else { @@ -47127,7 +50689,7 @@ var ts; writeTextOfNode(currentText, node.name); } } - while (node.body && node.body.kind !== 231) { + while (node.body && node.body.kind !== 233) { node = node.body; write("."); writeTextOfNode(currentText, node.name); @@ -47197,7 +50759,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 149 && ts.hasModifier(node.parent, 8); + return node.parent.kind === 150 && ts.hasModifier(node.parent, 8); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -47207,52 +50769,69 @@ var ts; writeTextOfNode(currentText, node.name); if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 158 || - node.parent.kind === 159 || - (node.parent.parent && node.parent.parent.kind === 161)) { - ts.Debug.assert(node.parent.kind === 149 || - node.parent.kind === 148 || - node.parent.kind === 158 || + if (node.parent.kind === 159 || + node.parent.kind === 160 || + (node.parent.parent && node.parent.parent.kind === 162)) { + ts.Debug.assert(node.parent.kind === 150 || + node.parent.kind === 149 || node.parent.kind === 159 || - node.parent.kind === 153 || - node.parent.kind === 154); + node.parent.kind === 160 || + node.parent.kind === 154 || + node.parent.kind === 155); emitType(node.constraint); } else { emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.constraint, getTypeParameterConstraintVisibilityError); } } + if (node.default && !isPrivateMethodTypeParameter(node)) { + write(" = "); + if (node.parent.kind === 159 || + node.parent.kind === 160 || + (node.parent.parent && node.parent.parent.kind === 162)) { + ts.Debug.assert(node.parent.kind === 150 || + node.parent.kind === 149 || + node.parent.kind === 159 || + node.parent.kind === 160 || + node.parent.kind === 154 || + node.parent.kind === 155); + emitType(node.default); + } + else { + emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.default, getTypeParameterConstraintVisibilityError); + } + } function getTypeParameterConstraintVisibilityError() { var diagnosticMessage; switch (node.parent.kind) { - case 226: + case 228: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 227: + case 229: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 154: + case 155: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 153: + case 154: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; + case 150: case 149: - case 148: if (ts.hasModifier(node.parent, 32)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 226) { + else if (node.parent.parent.kind === 228) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 225: + case 227: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 228: + case 230: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -47271,7 +50850,7 @@ var ts; write(">"); } } - function emitHeritageClause(typeReferences, isImplementsList) { + function emitHeritageClause(className, typeReferences, isImplementsList) { if (typeReferences) { write(isImplementsList ? " implements " : " extends "); emitCommaList(typeReferences, emitTypeOfTypeReference); @@ -47285,17 +50864,19 @@ var ts; } else { writer.getSymbolAccessibilityDiagnostic = getHeritageClauseVisibilityError; + errorNameNode = className; resolver.writeBaseConstructorTypeOfClass(enclosingDeclaration, enclosingDeclaration, 2 | 1024, writer); + errorNameNode = undefined; } function getHeritageClauseVisibilityError() { var diagnosticMessage; - if (node.parent.parent.kind === 226) { + if (node.parent.parent.kind === 228) { diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : - ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; + ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1; } else { - diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; + diagnosticMessage = ts.Diagnostics.extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; } return { diagnosticMessage: diagnosticMessage, @@ -47327,9 +50908,10 @@ var ts; emitTypeParameters(node.typeParameters); var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { - emitHeritageClause([baseTypeNode], false); + node.name; + emitHeritageClause(node.name, [baseTypeNode], false); } - emitHeritageClause(ts.getClassImplementsHeritageClauseElements(node), true); + emitHeritageClause(node.name, ts.getClassImplementsHeritageClauseElements(node), true); write(" {"); writeLine(); increaseIndent(); @@ -47350,7 +50932,7 @@ var ts; emitTypeParameters(node.typeParameters); var interfaceExtendsTypes = ts.filter(ts.getInterfaceBaseTypeNodes(node), function (base) { return ts.isEntityNameExpression(base.expression); }); if (interfaceExtendsTypes && interfaceExtendsTypes.length) { - emitHeritageClause(interfaceExtendsTypes, false); + emitHeritageClause(node.name, interfaceExtendsTypes, false); } write(" {"); writeLine(); @@ -47372,17 +50954,17 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 223 || resolver.isDeclarationVisible(node)) { + if (node.kind !== 225 || resolver.isDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } else { writeTextOfNode(currentText, node.name); - if ((node.kind === 147 || node.kind === 146 || - (node.kind === 144 && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { + if ((node.kind === 148 || node.kind === 147 || + (node.kind === 145 && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { write("?"); } - if ((node.kind === 147 || node.kind === 146) && node.parent.kind === 161) { + if ((node.kind === 148 || node.kind === 147) && node.parent.kind === 162) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (resolver.isLiteralConstDeclaration(node)) { @@ -47395,14 +50977,14 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 223) { + if (node.kind === 225) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 147 || node.kind === 146) { + else if (node.kind === 148 || node.kind === 147) { if (ts.hasModifier(node, 32)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -47410,7 +50992,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 226) { + else if (node.parent.kind === 228) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -47436,7 +51018,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 198) { + if (element.kind !== 199) { elements.push(element); } } @@ -47502,7 +51084,7 @@ var ts; accessorWithTypeAnnotation = node; var type = getTypeAnnotationFromAccessor(node); if (!type) { - var anotherAccessor = node.kind === 151 ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 152 ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -47515,7 +51097,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 151 + return accessor.kind === 152 ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type @@ -47524,7 +51106,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 152) { + if (accessorWithTypeAnnotation.kind === 153) { if (ts.hasModifier(accessorWithTypeAnnotation.parent, 32)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : @@ -47570,17 +51152,17 @@ var ts; } if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 225) { + if (node.kind === 227) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 149 || node.kind === 150) { + else if (node.kind === 150 || node.kind === 151) { emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); } - if (node.kind === 225) { + if (node.kind === 227) { write("function "); writeTextOfNode(currentText, node.name); } - else if (node.kind === 150) { + else if (node.kind === 151) { write("constructor"); } else { @@ -47600,15 +51182,15 @@ var ts; var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; var closeParenthesizedFunctionType = false; - if (node.kind === 155) { + if (node.kind === 156) { emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); write("["); } else { - if (node.kind === 154 || node.kind === 159) { + if (node.kind === 155 || node.kind === 160) { write("new "); } - else if (node.kind === 158) { + else if (node.kind === 159) { var currentOutput = writer.getText(); if (node.typeParameters && currentOutput.charAt(currentOutput.length - 1) === "<") { closeParenthesizedFunctionType = true; @@ -47619,20 +51201,20 @@ var ts; write("("); } emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 155) { + if (node.kind === 156) { write("]"); } else { write(")"); } - var isFunctionTypeOrConstructorType = node.kind === 158 || node.kind === 159; - if (isFunctionTypeOrConstructorType || node.parent.kind === 161) { + var isFunctionTypeOrConstructorType = node.kind === 159 || node.kind === 160; + if (isFunctionTypeOrConstructorType || node.parent.kind === 162) { if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 150 && !ts.hasModifier(node, 8)) { + else if (node.kind !== 151 && !ts.hasModifier(node, 8)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -47646,23 +51228,23 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 154: + case 155: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 153: + case 154: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 155: + case 156: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; + case 150: case 149: - case 148: if (ts.hasModifier(node, 32)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -47670,7 +51252,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 226) { + else if (node.parent.kind === 228) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -47683,7 +51265,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 225: + case 227: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -47715,9 +51297,9 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 158 || - node.parent.kind === 159 || - node.parent.parent.kind === 161) { + if (node.parent.kind === 159 || + node.parent.kind === 160 || + node.parent.parent.kind === 162) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!ts.hasModifier(node.parent, 8)) { @@ -47733,22 +51315,26 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 150: + case 151: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 154: + case 155: return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 153: + case 154: return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; + case 156: + return symbolAccessibilityResult.errorModuleName ? + ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : + ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; + case 150: case 149: - case 148: if (ts.hasModifier(node.parent, 32)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -47756,7 +51342,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 226) { + else if (node.parent.parent.kind === 228) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -47768,7 +51354,7 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 225: + case 227: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -47779,12 +51365,12 @@ var ts; } } function emitBindingPattern(bindingPattern) { - if (bindingPattern.kind === 172) { + if (bindingPattern.kind === 173) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 173) { + else if (bindingPattern.kind === 174) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -47795,10 +51381,10 @@ var ts; } } function emitBindingElement(bindingElement) { - if (bindingElement.kind === 198) { + if (bindingElement.kind === 199) { write(" "); } - else if (bindingElement.kind === 174) { + else if (bindingElement.kind === 175) { if (bindingElement.propertyName) { writeTextOfNode(currentText, bindingElement.propertyName); write(": "); @@ -47820,39 +51406,39 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 225: - case 230: - case 234: case 227: - case 226: - case 228: + case 232: + case 236: case 229: + case 228: + case 230: + case 231: return emitModuleElement(node, isModuleElementVisible(node)); - case 205: + case 207: return emitModuleElement(node, isVariableStatementVisible(node)); - case 235: + case 237: return emitModuleElement(node, !node.importClause); - case 241: + case 243: return emitExportDeclaration(node); + case 151: case 150: case 149: - case 148: return writeFunctionDeclaration(node); - case 154: - case 153: case 155: + case 154: + case 156: return emitSignatureDeclarationWithJsDocComments(node); - case 151: case 152: + case 153: return emitAccessorDeclaration(node); + case 148: case 147: - case 146: return emitPropertyDeclaration(node); - case 260: + case 263: return emitEnumMemberDeclaration(node); - case 240: + case 242: return emitExportAssignment(node); - case 261: + case 264: return emitSourceFile(node); } } @@ -47863,14 +51449,15 @@ var ts; declFileName = referencedFile.fileName; } else { - ts.forEachExpectedEmitFile(host, getDeclFileName, referencedFile, emitOnlyDtsFiles); + ts.forEachEmittedFile(host, getDeclFileName, referencedFile, emitOnlyDtsFiles); } if (declFileName) { declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(declarationFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, false); referencesOutput += "/// " + newLine; } return addedBundledEmitReference; - function getDeclFileName(emitFileNames, _sourceFiles, isBundledEmit) { + function getDeclFileName(emitFileNames, sourceFileOrBundle) { + var isBundledEmit = sourceFileOrBundle.kind === 265; if (isBundledEmit && !addBundledFileReference) { return; } @@ -47880,10 +51467,11 @@ var ts; } } } - function writeDeclarationFile(declarationFilePath, sourceFiles, isBundledEmit, host, resolver, emitterDiagnostics, emitOnlyDtsFiles) { - var emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFiles, isBundledEmit, emitOnlyDtsFiles); + function writeDeclarationFile(declarationFilePath, sourceFileOrBundle, host, resolver, emitterDiagnostics, emitOnlyDtsFiles) { + var emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles); var emitSkipped = emitDeclarationResult.reportedDeclarationError || host.isEmitBlocked(declarationFilePath) || host.getCompilerOptions().noEmit; if (!emitSkipped) { + var sourceFiles = sourceFileOrBundle.kind === 265 ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; var declarationOutput = emitDeclarationResult.referencesOutput + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); ts.writeFile(host, emitterDiagnostics, declarationFilePath, declarationOutput, host.getCompilerOptions().emitBOM, sourceFiles); @@ -47937,7 +51525,7 @@ var ts; getText: getText, getSourceMappingURL: getSourceMappingURL, }; - function initialize(filePath, sourceMapFilePath, sourceFiles, isBundledEmit) { + function initialize(filePath, sourceMapFilePath, sourceFileOrBundle) { if (disabled) { return; } @@ -47968,9 +51556,8 @@ var ts; } if (compilerOptions.mapRoot) { sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); - if (!isBundledEmit) { - ts.Debug.assert(sourceFiles.length === 1); - sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFiles[0], host, sourceMapDir)); + if (sourceFileOrBundle.kind === 264) { + sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFileOrBundle, host, sourceMapDir)); } if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); @@ -48061,28 +51648,28 @@ var ts; ts.performance.measure("Source Map", "beforeSourcemap", "afterSourcemap"); } } - function emitNodeWithSourceMap(emitContext, node, emitCallback) { + function emitNodeWithSourceMap(hint, node, emitCallback) { if (disabled) { - return emitCallback(emitContext, node); + return emitCallback(hint, node); } if (node) { var emitNode = node.emitNode; var emitFlags = emitNode && emitNode.flags; var _a = emitNode && emitNode.sourceMapRange || node, pos = _a.pos, end = _a.end; - if (node.kind !== 293 + if (node.kind !== 294 && (emitFlags & 16) === 0 && pos >= 0) { emitPos(ts.skipTrivia(currentSourceText, pos)); } if (emitFlags & 64) { disabled = true; - emitCallback(emitContext, node); + emitCallback(hint, node); disabled = false; } else { - emitCallback(emitContext, node); + emitCallback(hint, node); } - if (node.kind !== 293 + if (node.kind !== 294 && (emitFlags & 32) === 0 && end >= 0) { emitPos(end); @@ -48131,7 +51718,7 @@ var ts; return; } encodeLastRecordedSourceMapSpan(); - return ts.stringify({ + return JSON.stringify({ version: 3, file: sourceMapData.sourceMapFile, sourceRoot: sourceMapData.sourceMapSourceRoot, @@ -48183,11 +51770,10 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - function createCommentWriter(host, writer, sourceMap) { - var compilerOptions = host.getCompilerOptions(); - var extendedDiagnostics = compilerOptions.extendedDiagnostics; - var newLine = host.getNewLine(); - var emitPos = sourceMap.emitPos; + function createCommentWriter(printerOptions, emitPos) { + var extendedDiagnostics = printerOptions.extendedDiagnostics; + var newLine = ts.getNewLineCharacter(printerOptions); + var writer; var containerPos = -1; var containerEnd = -1; var declarationListContainerEnd = -1; @@ -48196,37 +51782,34 @@ var ts; var currentLineMap; var detachedCommentsInfo; var hasWrittenComment = false; - var disabled = compilerOptions.removeComments; + var disabled = printerOptions.removeComments; return { reset: reset, + setWriter: setWriter, setSourceFile: setSourceFile, emitNodeWithComments: emitNodeWithComments, emitBodyWithDetachedComments: emitBodyWithDetachedComments, emitTrailingCommentsOfPosition: emitTrailingCommentsOfPosition, + emitLeadingCommentsOfPosition: emitLeadingCommentsOfPosition, }; - function emitNodeWithComments(emitContext, node, emitCallback) { + function emitNodeWithComments(hint, node, emitCallback) { if (disabled) { - emitCallback(emitContext, node); + emitCallback(hint, node); return; } if (node) { - var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var emitFlags = ts.getEmitFlags(node); + hasWrittenComment = false; + var emitNode = node.emitNode; + var emitFlags = emitNode && emitNode.flags; + var _a = emitNode && emitNode.commentRange || node, pos = _a.pos, end = _a.end; if ((pos < 0 && end < 0) || (pos === end)) { - if (emitFlags & 2048) { - disabled = true; - emitCallback(emitContext, node); - disabled = false; - } - else { - emitCallback(emitContext, node); - } + emitNodeWithSynthesizedComments(hint, node, emitNode, emitFlags, emitCallback); } else { if (extendedDiagnostics) { ts.performance.mark("preEmitNodeWithComment"); } - var isEmittedNode = node.kind !== 293; + var isEmittedNode = node.kind !== 294; var skipLeadingComments = pos < 0 || (emitFlags & 512) !== 0; var skipTrailingComments = end < 0 || (emitFlags & 1024) !== 0; if (!skipLeadingComments) { @@ -48240,23 +51823,16 @@ var ts; } if (!skipTrailingComments) { containerEnd = end; - if (node.kind === 224) { + if (node.kind === 226) { declarationListContainerEnd = end; } } if (extendedDiagnostics) { ts.performance.measure("commentTime", "preEmitNodeWithComment"); } - if (emitFlags & 2048) { - disabled = true; - emitCallback(emitContext, node); - disabled = false; - } - else { - emitCallback(emitContext, node); - } + emitNodeWithSynthesizedComments(hint, node, emitNode, emitFlags, emitCallback); if (extendedDiagnostics) { - ts.performance.mark("beginEmitNodeWithComment"); + ts.performance.mark("postEmitNodeWithComment"); } containerPos = savedContainerPos; containerEnd = savedContainerEnd; @@ -48265,11 +51841,75 @@ var ts; emitTrailingComments(end); } if (extendedDiagnostics) { - ts.performance.measure("commentTime", "beginEmitNodeWithComment"); + ts.performance.measure("commentTime", "postEmitNodeWithComment"); } } } } + function emitNodeWithSynthesizedComments(hint, node, emitNode, emitFlags, emitCallback) { + var leadingComments = emitNode && emitNode.leadingComments; + if (ts.some(leadingComments)) { + if (extendedDiagnostics) { + ts.performance.mark("preEmitNodeWithSynthesizedComments"); + } + ts.forEach(leadingComments, emitLeadingSynthesizedComment); + if (extendedDiagnostics) { + ts.performance.measure("commentTime", "preEmitNodeWithSynthesizedComments"); + } + } + emitNodeWithNestedComments(hint, node, emitFlags, emitCallback); + var trailingComments = emitNode && emitNode.trailingComments; + if (ts.some(trailingComments)) { + if (extendedDiagnostics) { + ts.performance.mark("postEmitNodeWithSynthesizedComments"); + } + ts.forEach(trailingComments, emitTrailingSynthesizedComment); + if (extendedDiagnostics) { + ts.performance.measure("commentTime", "postEmitNodeWithSynthesizedComments"); + } + } + } + function emitLeadingSynthesizedComment(comment) { + if (comment.kind === 2) { + writer.writeLine(); + } + writeSynthesizedComment(comment); + if (comment.hasTrailingNewLine || comment.kind === 2) { + writer.writeLine(); + } + else { + writer.write(" "); + } + } + function emitTrailingSynthesizedComment(comment) { + if (!writer.isAtStartOfLine()) { + writer.write(" "); + } + writeSynthesizedComment(comment); + if (comment.hasTrailingNewLine) { + writer.writeLine(); + } + } + function writeSynthesizedComment(comment) { + var text = formatSynthesizedComment(comment); + var lineMap = comment.kind === 3 ? ts.computeLineStarts(text) : undefined; + ts.writeCommentRange(text, lineMap, writer, 0, text.length, newLine); + } + function formatSynthesizedComment(comment) { + return comment.kind === 3 + ? "/*" + comment.text + "*/" + : "//" + comment.text; + } + function emitNodeWithNestedComments(hint, node, emitFlags, emitCallback) { + if (emitFlags & 2048) { + disabled = true; + emitCallback(hint, node); + disabled = false; + } + else { + emitCallback(hint, node); + } + } function emitBodyWithDetachedComments(node, detachedRange, emitCallback) { if (extendedDiagnostics) { ts.performance.mark("preEmitBodyWithDetachedComments"); @@ -48297,6 +51937,9 @@ var ts; } if (!skipTrailingComments) { emitLeadingComments(detachedRange.end, true); + if (hasWrittenComment && !writer.isAtStartOfLine()) { + writer.writeLine(); + } } if (extendedDiagnostics) { ts.performance.measure("commentTime", "beginEmitBodyWithDetachedCommetns"); @@ -48321,9 +51964,11 @@ var ts; ts.emitNewLineBeforeLeadingCommentOfPosition(currentLineMap, writer, rangePos, commentPos); hasWrittenComment = true; } - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); if (hasTrailingNewLine) { writer.writeLine(); } @@ -48331,6 +51976,12 @@ var ts; writer.write(" "); } } + function emitLeadingCommentsOfPosition(pos) { + if (disabled || pos === -1) { + return; + } + emitLeadingComments(pos, true); + } function emitTrailingComments(pos) { forEachTrailingCommentToEmit(pos, emitTrailingComment); } @@ -48338,9 +51989,11 @@ var ts; if (!writer.isAtStartOfLine()) { writer.write(" "); } - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); if (hasTrailingNewLine) { writer.writeLine(); } @@ -48358,9 +52011,11 @@ var ts; } } function emitTrailingCommentOfPosition(commentPos, commentEnd, _kind, hasTrailingNewLine) { - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); if (hasTrailingNewLine) { writer.writeLine(); } @@ -48389,6 +52044,9 @@ var ts; currentLineMap = undefined; detachedCommentsInfo = undefined; } + function setWriter(output) { + writer = output; + } function setSourceFile(sourceFile) { currentSourceFile = sourceFile; currentText = currentSourceFile.text; @@ -48420,9 +52078,11 @@ var ts; } } function writeComment(text, lineMap, writer, commentPos, commentEnd, newLine) { - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(text, lineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); } function isTripleSlashComment(commentPos, commentEnd) { if (currentText.charCodeAt(commentPos + 1) === 47 && @@ -48440,63 +52100,55 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var id = function (s) { return s; }; - var nullTransformers = [function (_) { return id; }]; - function emitFiles(resolver, host, targetSourceFile, emitOnlyDtsFiles) { - var delimiters = createDelimiterMap(); - var brackets = createBracketsMap(); + var delimiters = createDelimiterMap(); + var brackets = createBracketsMap(); + function emitFiles(resolver, host, targetSourceFile, emitOnlyDtsFiles, transformers) { var compilerOptions = host.getCompilerOptions(); - var languageVersion = ts.getEmitScriptTarget(compilerOptions); var moduleKind = ts.getEmitModuleKind(compilerOptions); var sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? [] : undefined; var emittedFilesList = compilerOptions.listEmittedFiles ? [] : undefined; var emitterDiagnostics = ts.createDiagnosticCollection(); var newLine = host.getNewLine(); - var transformers = emitOnlyDtsFiles ? nullTransformers : ts.getTransformers(compilerOptions); var writer = ts.createTextWriter(newLine); - var write = writer.write, writeLine = writer.writeLine, increaseIndent = writer.increaseIndent, decreaseIndent = writer.decreaseIndent; var sourceMap = ts.createSourceMapWriter(host, writer); - var emitNodeWithSourceMap = sourceMap.emitNodeWithSourceMap, emitTokenWithSourceMap = sourceMap.emitTokenWithSourceMap; - var comments = ts.createCommentWriter(host, writer, sourceMap); - var emitNodeWithComments = comments.emitNodeWithComments, emitBodyWithDetachedComments = comments.emitBodyWithDetachedComments, emitTrailingCommentsOfPosition = comments.emitTrailingCommentsOfPosition; - var nodeIdToGeneratedName; - var autoGeneratedIdToGeneratedName; - var generatedNameSet; - var tempFlags; var currentSourceFile; - var currentText; - var currentFileIdentifiers; var bundledHelpers; var isOwnFileEmit; var emitSkipped = false; var sourceFiles = ts.getSourceFilesToEmit(host, targetSourceFile); - ts.performance.mark("beforeTransform"); - var _a = ts.transformFiles(resolver, host, sourceFiles, transformers), transformed = _a.transformed, emitNodeWithSubstitution = _a.emitNodeWithSubstitution, emitNodeWithNotification = _a.emitNodeWithNotification; - ts.performance.measure("transformTime", "beforeTransform"); + var transform = ts.transformNodes(resolver, host, compilerOptions, sourceFiles, transformers, false); + var printer = createPrinter(compilerOptions, { + hasGlobalName: resolver.hasGlobalName, + onEmitNode: transform.emitNodeWithNotification, + substituteNode: transform.substituteNode, + onEmitSourceMapOfNode: sourceMap.emitNodeWithSourceMap, + onEmitSourceMapOfToken: sourceMap.emitTokenWithSourceMap, + onEmitSourceMapOfPosition: sourceMap.emitPos, + onEmitHelpers: emitHelpers, + onSetSourceFile: setSourceFile, + }); ts.performance.mark("beforePrint"); - ts.forEachTransformedEmitFile(host, transformed, emitFile, emitOnlyDtsFiles); + ts.forEachEmittedFile(host, emitSourceFileOrBundle, transform.transformed, emitOnlyDtsFiles); ts.performance.measure("printTime", "beforePrint"); - for (var _b = 0, sourceFiles_4 = sourceFiles; _b < sourceFiles_4.length; _b++) { - var sourceFile = sourceFiles_4[_b]; - ts.disposeEmitNodes(sourceFile); - } + transform.dispose(); return { emitSkipped: emitSkipped, diagnostics: emitterDiagnostics.getDiagnostics(), emittedFiles: emittedFilesList, sourceMaps: sourceMapDataList }; - function emitFile(jsFilePath, sourceMapFilePath, declarationFilePath, sourceFiles, isBundledEmit) { + function emitSourceFileOrBundle(_a, sourceFileOrBundle) { + var jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath; if (!host.isEmitBlocked(jsFilePath) && !compilerOptions.noEmit) { if (!emitOnlyDtsFiles) { - printFile(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit); + printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle); } } else { emitSkipped = true; } if (declarationFilePath) { - emitSkipped = ts.writeDeclarationFile(declarationFilePath, ts.getOriginalSourceFiles(sourceFiles), isBundledEmit, host, resolver, emitterDiagnostics, emitOnlyDtsFiles) || emitSkipped; + emitSkipped = ts.writeDeclarationFile(declarationFilePath, ts.getOriginalSourceFileOrBundle(sourceFileOrBundle), host, resolver, emitterDiagnostics, emitOnlyDtsFiles) || emitSkipped; } if (!emitSkipped && emittedFilesList) { if (!emitOnlyDtsFiles) { @@ -48510,24 +52162,24 @@ var ts; } } } - function printFile(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit) { - sourceMap.initialize(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit); - nodeIdToGeneratedName = []; - autoGeneratedIdToGeneratedName = []; - generatedNameSet = ts.createMap(); - bundledHelpers = isBundledEmit ? ts.createMap() : undefined; - isOwnFileEmit = !isBundledEmit; - if (isBundledEmit && moduleKind) { - for (var _a = 0, sourceFiles_5 = sourceFiles; _a < sourceFiles_5.length; _a++) { - var sourceFile = sourceFiles_5[_a]; - emitHelpers(sourceFile, true); - } + function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle) { + var bundle = sourceFileOrBundle.kind === 265 ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 264 ? sourceFileOrBundle : undefined; + var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; + sourceMap.initialize(jsFilePath, sourceMapFilePath, sourceFileOrBundle); + if (bundle) { + bundledHelpers = ts.createMap(); + isOwnFileEmit = false; + printer.writeBundle(bundle, writer); } - ts.forEach(sourceFiles, printSourceFile); - writeLine(); + else { + isOwnFileEmit = true; + printer.writeFile(sourceFile, writer); + } + writer.writeLine(); var sourceMappingURL = sourceMap.getSourceMappingURL(); if (sourceMappingURL) { - write("//# " + "sourceMappingURL" + "=" + sourceMappingURL); + writer.write("//# " + "sourceMappingURL" + "=" + sourceMappingURL); } if (compilerOptions.sourceMap && !compilerOptions.inlineSourceMap) { ts.writeFile(host, emitterDiagnostics, sourceMapFilePath, sourceMap.getText(), false, sourceFiles); @@ -48537,20 +52189,164 @@ var ts; } ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), compilerOptions.emitBOM, sourceFiles); sourceMap.reset(); - comments.reset(); writer.reset(); - tempFlags = 0; currentSourceFile = undefined; - currentText = undefined; + bundledHelpers = undefined; isOwnFileEmit = false; } - function printSourceFile(node) { + function setSourceFile(node) { currentSourceFile = node; - currentText = node.text; - currentFileIdentifiers = node.identifiers; sourceMap.setSourceFile(node); - comments.setSourceFile(node); - pipelineEmitWithNotification(0, node); + } + function emitHelpers(node, writeLines) { + var helpersEmitted = false; + var bundle = node.kind === 265 ? node : undefined; + if (bundle && moduleKind === ts.ModuleKind.None) { + return; + } + var numNodes = bundle ? bundle.sourceFiles.length : 1; + for (var i = 0; i < numNodes; i++) { + var currentNode = bundle ? bundle.sourceFiles[i] : node; + var sourceFile = ts.isSourceFile(currentNode) ? currentNode : currentSourceFile; + var shouldSkip = compilerOptions.noEmitHelpers || (sourceFile && ts.getExternalHelpersModuleName(sourceFile) !== undefined); + var shouldBundle = ts.isSourceFile(currentNode) && !isOwnFileEmit; + var helpers = ts.getEmitHelpers(currentNode); + if (helpers) { + for (var _a = 0, _b = ts.stableSort(helpers, ts.compareEmitHelpers); _a < _b.length; _a++) { + var helper = _b[_a]; + if (!helper.scoped) { + if (shouldSkip) + continue; + if (shouldBundle) { + if (bundledHelpers.get(helper.name)) { + continue; + } + bundledHelpers.set(helper.name, true); + } + } + else if (bundle) { + continue; + } + writeLines(helper.text); + helpersEmitted = true; + } + } + } + return helpersEmitted; + } + } + ts.emitFiles = emitFiles; + function createPrinter(printerOptions, handlers) { + if (printerOptions === void 0) { printerOptions = {}; } + if (handlers === void 0) { handlers = {}; } + var hasGlobalName = handlers.hasGlobalName, onEmitSourceMapOfNode = handlers.onEmitSourceMapOfNode, onEmitSourceMapOfToken = handlers.onEmitSourceMapOfToken, onEmitSourceMapOfPosition = handlers.onEmitSourceMapOfPosition, onEmitNode = handlers.onEmitNode, onEmitHelpers = handlers.onEmitHelpers, onSetSourceFile = handlers.onSetSourceFile, substituteNode = handlers.substituteNode, onBeforeEmitNodeArray = handlers.onBeforeEmitNodeArray, onAfterEmitNodeArray = handlers.onAfterEmitNodeArray; + var newLine = ts.getNewLineCharacter(printerOptions); + var comments = ts.createCommentWriter(printerOptions, onEmitSourceMapOfPosition); + var emitNodeWithComments = comments.emitNodeWithComments, emitBodyWithDetachedComments = comments.emitBodyWithDetachedComments, emitTrailingCommentsOfPosition = comments.emitTrailingCommentsOfPosition, emitLeadingCommentsOfPosition = comments.emitLeadingCommentsOfPosition; + var currentSourceFile; + var nodeIdToGeneratedName; + var autoGeneratedIdToGeneratedName; + var generatedNames; + var tempFlagsStack; + var tempFlags; + var writer; + var ownWriter; + reset(); + return { + printNode: printNode, + printFile: printFile, + printBundle: printBundle, + writeNode: writeNode, + writeFile: writeFile, + writeBundle: writeBundle + }; + function printNode(hint, node, sourceFile) { + switch (hint) { + case 0: + ts.Debug.assert(ts.isSourceFile(node), "Expected a SourceFile node."); + break; + case 2: + ts.Debug.assert(ts.isIdentifier(node), "Expected an Identifier node."); + break; + case 1: + ts.Debug.assert(ts.isExpression(node), "Expected an Expression node."); + break; + } + switch (node.kind) { + case 264: return printFile(node); + case 265: return printBundle(node); + } + writeNode(hint, node, sourceFile, beginPrint()); + return endPrint(); + } + function printBundle(bundle) { + writeBundle(bundle, beginPrint()); + return endPrint(); + } + function printFile(sourceFile) { + writeFile(sourceFile, beginPrint()); + return endPrint(); + } + function writeNode(hint, node, sourceFile, output) { + var previousWriter = writer; + setWriter(output); + print(hint, node, sourceFile); + reset(); + writer = previousWriter; + } + function writeBundle(bundle, output) { + var previousWriter = writer; + setWriter(output); + emitShebangIfNeeded(bundle); + emitPrologueDirectivesIfNeeded(bundle); + emitHelpersIndirect(bundle); + for (var _a = 0, _b = bundle.sourceFiles; _a < _b.length; _a++) { + var sourceFile = _b[_a]; + print(0, sourceFile, sourceFile); + } + reset(); + writer = previousWriter; + } + function writeFile(sourceFile, output) { + var previousWriter = writer; + setWriter(output); + emitShebangIfNeeded(sourceFile); + emitPrologueDirectivesIfNeeded(sourceFile); + print(0, sourceFile, sourceFile); + reset(); + writer = previousWriter; + } + function beginPrint() { + return ownWriter || (ownWriter = ts.createTextWriter(newLine)); + } + function endPrint() { + var text = ownWriter.getText(); + ownWriter.reset(); + return text; + } + function print(hint, node, sourceFile) { + setSourceFile(sourceFile); + pipelineEmitWithNotification(hint, node); + } + function setSourceFile(sourceFile) { + currentSourceFile = sourceFile; + comments.setSourceFile(sourceFile); + if (onSetSourceFile) { + onSetSourceFile(sourceFile); + } + } + function setWriter(output) { + writer = output; + comments.setWriter(output); + } + function reset() { + nodeIdToGeneratedName = []; + autoGeneratedIdToGeneratedName = []; + generatedNames = ts.createMap(); + tempFlagsStack = []; + tempFlags = 0; + comments.reset(); + setWriter(undefined); } function emit(node) { pipelineEmitWithNotification(3, node); @@ -48561,51 +52357,53 @@ var ts; function emitExpression(node) { pipelineEmitWithNotification(1, node); } - function pipelineEmitWithNotification(emitContext, node) { - emitNodeWithNotification(emitContext, node, pipelineEmitWithComments); + function pipelineEmitWithNotification(hint, node) { + if (onEmitNode) { + onEmitNode(hint, node, pipelineEmitWithComments); + } + else { + pipelineEmitWithComments(hint, node); + } } - function pipelineEmitWithComments(emitContext, node) { - if (emitContext === 0) { - pipelineEmitWithSourceMap(emitContext, node); + function pipelineEmitWithComments(hint, node) { + node = trySubstituteNode(hint, node); + if (emitNodeWithComments && hint !== 0) { + emitNodeWithComments(hint, node, pipelineEmitWithSourceMap); + } + else { + pipelineEmitWithSourceMap(hint, node); + } + } + function pipelineEmitWithSourceMap(hint, node) { + if (onEmitSourceMapOfNode && hint !== 0 && hint !== 2) { + onEmitSourceMapOfNode(hint, node, pipelineEmitWithHint); + } + else { + pipelineEmitWithHint(hint, node); + } + } + function pipelineEmitWithHint(hint, node) { + switch (hint) { + case 0: return pipelineEmitSourceFile(node); + case 2: return pipelineEmitIdentifierName(node); + case 1: return pipelineEmitExpression(node); + case 3: return pipelineEmitUnspecified(node); + } + } + function pipelineEmitSourceFile(node) { + ts.Debug.assertNode(node, ts.isSourceFile); + emitSourceFile(node); + } + function pipelineEmitIdentifierName(node) { + ts.Debug.assertNode(node, ts.isIdentifier); + emitIdentifier(node); + } + function pipelineEmitUnspecified(node) { + var kind = node.kind; + if (ts.isKeyword(kind)) { + writeTokenText(kind); return; } - emitNodeWithComments(emitContext, node, pipelineEmitWithSourceMap); - } - function pipelineEmitWithSourceMap(emitContext, node) { - if (emitContext === 0 - || emitContext === 2) { - pipelineEmitWithSubstitution(emitContext, node); - return; - } - emitNodeWithSourceMap(emitContext, node, pipelineEmitWithSubstitution); - } - function pipelineEmitWithSubstitution(emitContext, node) { - emitNodeWithSubstitution(emitContext, node, pipelineEmitForContext); - } - function pipelineEmitForContext(emitContext, node) { - switch (emitContext) { - case 0: return pipelineEmitInSourceFileContext(node); - case 2: return pipelineEmitInIdentifierNameContext(node); - case 3: return pipelineEmitInUnspecifiedContext(node); - case 1: return pipelineEmitInExpressionContext(node); - } - } - function pipelineEmitInSourceFileContext(node) { - var kind = node.kind; - switch (kind) { - case 261: - return emitSourceFile(node); - } - } - function pipelineEmitInIdentifierNameContext(node) { - var kind = node.kind; - switch (kind) { - case 70: - return emitIdentifier(node); - } - } - function pipelineEmitInUnspecifiedContext(node) { - var kind = node.kind; switch (kind) { case 13: case 14: @@ -48613,229 +52411,201 @@ var ts; return emitLiteral(node); case 70: return emitIdentifier(node); - case 75: - case 78: - case 83: - case 104: - case 111: - case 112: - case 113: - case 114: - case 116: - case 117: - case 118: - case 119: - case 120: - case 121: - case 122: - case 123: - case 124: - case 125: - case 127: - case 128: - case 129: - case 130: - case 131: - case 132: - case 133: - case 134: - case 135: - case 136: - case 137: - case 138: - case 139: - case 140: - writeTokenText(kind); - return; - case 141: - return emitQualifiedName(node); case 142: - return emitComputedPropertyName(node); + return emitQualifiedName(node); case 143: - return emitTypeParameter(node); + return emitComputedPropertyName(node); case 144: - return emitParameter(node); + return emitTypeParameter(node); case 145: - return emitDecorator(node); + return emitParameter(node); case 146: - return emitPropertySignature(node); + return emitDecorator(node); case 147: - return emitPropertyDeclaration(node); + return emitPropertySignature(node); case 148: - return emitMethodSignature(node); + return emitPropertyDeclaration(node); case 149: - return emitMethodDeclaration(node); + return emitMethodSignature(node); case 150: - return emitConstructor(node); + return emitMethodDeclaration(node); case 151: + return emitConstructor(node); case 152: - return emitAccessorDeclaration(node); case 153: - return emitCallSignature(node); + return emitAccessorDeclaration(node); case 154: - return emitConstructSignature(node); + return emitCallSignature(node); case 155: - return emitIndexSignature(node); + return emitConstructSignature(node); case 156: - return emitTypePredicate(node); + return emitIndexSignature(node); case 157: - return emitTypeReference(node); + return emitTypePredicate(node); case 158: - return emitFunctionType(node); + return emitTypeReference(node); case 159: - return emitConstructorType(node); + return emitFunctionType(node); case 160: - return emitTypeQuery(node); + return emitConstructorType(node); case 161: - return emitTypeLiteral(node); + return emitTypeQuery(node); case 162: - return emitArrayType(node); + return emitTypeLiteral(node); case 163: - return emitTupleType(node); + return emitArrayType(node); case 164: - return emitUnionType(node); + return emitTupleType(node); case 165: - return emitIntersectionType(node); + return emitUnionType(node); case 166: - return emitParenthesizedType(node); - case 199: - return emitExpressionWithTypeArguments(node); + return emitIntersectionType(node); case 167: - return emitThisType(); + return emitParenthesizedType(node); + case 200: + return emitExpressionWithTypeArguments(node); case 168: - return emitTypeOperator(node); + return emitThisType(); case 169: - return emitIndexedAccessType(node); + return emitTypeOperator(node); case 170: - return emitMappedType(node); + return emitIndexedAccessType(node); case 171: - return emitLiteralType(node); + return emitMappedType(node); case 172: - return emitObjectBindingPattern(node); + return emitLiteralType(node); case 173: - return emitArrayBindingPattern(node); + return emitObjectBindingPattern(node); case 174: + return emitArrayBindingPattern(node); + case 175: return emitBindingElement(node); - case 202: - return emitTemplateSpan(node); - case 203: - return emitSemicolonClassElement(); case 204: - return emitBlock(node); + return emitTemplateSpan(node); case 205: - return emitVariableStatement(node); + return emitSemicolonClassElement(); case 206: - return emitEmptyStatement(); + return emitBlock(node); case 207: - return emitExpressionStatement(node); + return emitVariableStatement(node); case 208: - return emitIfStatement(node); + return emitEmptyStatement(); case 209: - return emitDoStatement(node); + return emitExpressionStatement(node); case 210: - return emitWhileStatement(node); + return emitIfStatement(node); case 211: - return emitForStatement(node); + return emitDoStatement(node); case 212: - return emitForInStatement(node); + return emitWhileStatement(node); case 213: - return emitForOfStatement(node); + return emitForStatement(node); case 214: - return emitContinueStatement(node); + return emitForInStatement(node); case 215: - return emitBreakStatement(node); + return emitForOfStatement(node); case 216: - return emitReturnStatement(node); + return emitContinueStatement(node); case 217: - return emitWithStatement(node); + return emitBreakStatement(node); case 218: - return emitSwitchStatement(node); + return emitReturnStatement(node); case 219: - return emitLabeledStatement(node); + return emitWithStatement(node); case 220: - return emitThrowStatement(node); + return emitSwitchStatement(node); case 221: - return emitTryStatement(node); + return emitLabeledStatement(node); case 222: - return emitDebuggerStatement(node); + return emitThrowStatement(node); case 223: - return emitVariableDeclaration(node); + return emitTryStatement(node); case 224: - return emitVariableDeclarationList(node); + return emitDebuggerStatement(node); case 225: - return emitFunctionDeclaration(node); + return emitVariableDeclaration(node); case 226: - return emitClassDeclaration(node); + return emitVariableDeclarationList(node); case 227: - return emitInterfaceDeclaration(node); + return emitFunctionDeclaration(node); case 228: - return emitTypeAliasDeclaration(node); + return emitClassDeclaration(node); case 229: - return emitEnumDeclaration(node); + return emitInterfaceDeclaration(node); case 230: - return emitModuleDeclaration(node); + return emitTypeAliasDeclaration(node); case 231: - return emitModuleBlock(node); + return emitEnumDeclaration(node); case 232: - return emitCaseBlock(node); + return emitModuleDeclaration(node); + case 233: + return emitModuleBlock(node); case 234: - return emitImportEqualsDeclaration(node); - case 235: - return emitImportDeclaration(node); + return emitCaseBlock(node); case 236: - return emitImportClause(node); + return emitImportEqualsDeclaration(node); case 237: - return emitNamespaceImport(node); + return emitImportDeclaration(node); case 238: - return emitNamedImports(node); + return emitImportClause(node); case 239: - return emitImportSpecifier(node); + return emitNamespaceImport(node); case 240: - return emitExportAssignment(node); + return emitNamedImports(node); case 241: - return emitExportDeclaration(node); + return emitImportSpecifier(node); case 242: - return emitNamedExports(node); + return emitExportAssignment(node); case 243: - return emitExportSpecifier(node); + return emitExportDeclaration(node); case 244: - return; + return emitNamedExports(node); case 245: + return emitExportSpecifier(node); + case 246: + return; + case 247: return emitExternalModuleReference(node); case 10: return emitJsxText(node); - case 248: - return emitJsxOpeningElement(node); - case 249: - return emitJsxClosingElement(node); case 250: - return emitJsxAttribute(node); + return emitJsxOpeningElement(node); case 251: - return emitJsxSpreadAttribute(node); + return emitJsxClosingElement(node); case 252: - return emitJsxExpression(node); + return emitJsxAttribute(node); case 253: - return emitCaseClause(node); + return emitJsxAttributes(node); case 254: - return emitDefaultClause(node); + return emitJsxSpreadAttribute(node); case 255: - return emitHeritageClause(node); + return emitJsxExpression(node); case 256: - return emitCatchClause(node); + return emitCaseClause(node); case 257: - return emitPropertyAssignment(node); + return emitDefaultClause(node); case 258: - return emitShorthandPropertyAssignment(node); + return emitHeritageClause(node); case 259: - return emitSpreadAssignment(node); + return emitCatchClause(node); case 260: + return emitPropertyAssignment(node); + case 261: + return emitShorthandPropertyAssignment(node); + case 262: + return emitSpreadAssignment(node); + case 263: return emitEnumMember(node); } if (ts.isExpression(node)) { - return pipelineEmitWithSubstitution(1, node); + return pipelineEmitExpression(trySubstituteNode(1, node)); + } + if (ts.isToken(node)) { + writeTokenText(kind); + return; } } - function pipelineEmitInExpressionContext(node) { + function pipelineEmitExpression(node) { var kind = node.kind; switch (kind) { case 8: @@ -48853,77 +52623,82 @@ var ts; case 98: writeTokenText(kind); return; - case 175: - return emitArrayLiteralExpression(node); case 176: - return emitObjectLiteralExpression(node); + return emitArrayLiteralExpression(node); case 177: - return emitPropertyAccessExpression(node); + return emitObjectLiteralExpression(node); case 178: - return emitElementAccessExpression(node); + return emitPropertyAccessExpression(node); case 179: - return emitCallExpression(node); + return emitElementAccessExpression(node); case 180: - return emitNewExpression(node); + return emitCallExpression(node); case 181: - return emitTaggedTemplateExpression(node); + return emitNewExpression(node); case 182: - return emitTypeAssertionExpression(node); + return emitTaggedTemplateExpression(node); case 183: - return emitParenthesizedExpression(node); + return emitTypeAssertionExpression(node); case 184: - return emitFunctionExpression(node); + return emitParenthesizedExpression(node); case 185: - return emitArrowFunction(node); + return emitFunctionExpression(node); case 186: - return emitDeleteExpression(node); + return emitArrowFunction(node); case 187: - return emitTypeOfExpression(node); + return emitDeleteExpression(node); case 188: - return emitVoidExpression(node); + return emitTypeOfExpression(node); case 189: - return emitAwaitExpression(node); + return emitVoidExpression(node); case 190: - return emitPrefixUnaryExpression(node); + return emitAwaitExpression(node); case 191: - return emitPostfixUnaryExpression(node); + return emitPrefixUnaryExpression(node); case 192: - return emitBinaryExpression(node); + return emitPostfixUnaryExpression(node); case 193: - return emitConditionalExpression(node); + return emitBinaryExpression(node); case 194: - return emitTemplateExpression(node); + return emitConditionalExpression(node); case 195: - return emitYieldExpression(node); + return emitTemplateExpression(node); case 196: - return emitSpreadExpression(node); + return emitYieldExpression(node); case 197: - return emitClassExpression(node); + return emitSpreadExpression(node); case 198: + return emitClassExpression(node); + case 199: return; - case 200: - return emitAsExpression(node); case 201: + return emitAsExpression(node); + case 202: return emitNonNullExpression(node); - case 246: + case 203: + return emitMetaProperty(node); + case 248: return emitJsxElement(node); - case 247: + case 249: return emitJsxSelfClosingElement(node); - case 294: + case 295: return emitPartiallyEmittedExpression(node); - case 297: - return writeLines(node.text); + } + } + function trySubstituteNode(hint, node) { + return node && substituteNode && substituteNode(hint, node) || node; + } + function emitHelpersIndirect(node) { + if (onEmitHelpers) { + onEmitHelpers(node, writeLines); } } function emitNumericLiteral(node) { emitLiteral(node); - if (node.trailingComment) { - write(" /*" + node.trailingComment + "*/"); - } } function emitLiteral(node) { var text = getLiteralTextOfNode(node); - if ((compilerOptions.sourceMap || compilerOptions.inlineSourceMap) + if ((printerOptions.sourceMap || printerOptions.inlineSourceMap) && (node.kind === 9 || ts.isTemplateLiteralKind(node.kind))) { writer.writeLiteral(text); } @@ -48962,8 +52737,8 @@ var ts; writeIfPresent(node.dotDotDotToken, "..."); emit(node.name); writeIfPresent(node.questionToken, "?"); - emitExpressionWithPrefix(" = ", node.initializer); emitWithPrefix(": ", node.type); + emitExpressionWithPrefix(" = ", node.initializer); } function emitDecorator(decorator) { write("@"); @@ -49010,7 +52785,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write(node.kind === 151 ? "get " : "set "); + write(node.kind === 152 ? "get " : "set "); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); } @@ -49110,17 +52885,13 @@ var ts; write("{"); writeLine(); increaseIndent(); - if (node.readonlyToken) { - write("readonly "); - } + writeIfPresent(node.readonlyToken, "readonly "); write("["); emit(node.typeParameter.name); write(" in "); emit(node.typeParameter.constraint); write("]"); - if (node.questionToken) { - write("?"); - } + writeIfPresent(node.questionToken, "?"); write(": "); emit(node.type); write(";"); @@ -49180,7 +52951,7 @@ var ts; increaseIndent(); } var preferNewLine = node.multiLine ? 32768 : 0; - var allowTrailingComma = languageVersion >= 1 ? 32 : 0; + var allowTrailingComma = currentSourceFile.languageVersion >= 1 ? 32 : 0; emitList(node, properties, 978 | allowTrailingComma | preferNewLine); if (indentedFlag) { decreaseIndent(); @@ -49192,7 +52963,7 @@ var ts; var indentAfterDot = false; if (!(ts.getEmitFlags(node) & 65536)) { var dotRangeStart = node.expression.end; - var dotRangeEnd = ts.skipTrivia(currentText, node.expression.end) + 1; + var dotRangeEnd = ts.skipTrivia(currentSourceFile.text, node.expression.end) + 1; var dotToken = { kind: 22, pos: dotRangeStart, end: dotRangeEnd }; indentBeforeDot = needsIndentation(node, node.expression, dotToken); indentAfterDot = needsIndentation(node, dotToken, node.name); @@ -49206,15 +52977,17 @@ var ts; decreaseIndentIf(indentBeforeDot, indentAfterDot); } function needsDotDotForPropertyAccess(expression) { - if (expression.kind === 8) { + expression = ts.skipPartiallyEmittedExpressions(expression); + if (ts.isNumericLiteral(expression)) { var text = getLiteralTextOfNode(expression); - return text.indexOf(ts.tokenToString(22)) < 0; + return !expression.numericLiteralFlags + && text.indexOf(ts.tokenToString(22)) < 0; } else if (ts.isPropertyAccessExpression(expression) || ts.isElementAccessExpression(expression)) { var constantValue = ts.getConstantValue(expression); return isFinite(constantValue) && Math.floor(constantValue) === constantValue - && compilerOptions.removeComments; + && printerOptions.removeComments; } } function emitElementAccessExpression(node) { @@ -49240,11 +53013,9 @@ var ts; emitExpression(node.template); } function emitTypeAssertionExpression(node) { - if (node.type) { - write("<"); - emit(node.type); - write(">"); - } + write("<"); + emit(node.type); + write(">"); emitExpression(node.expression); } function emitParenthesizedExpression(node) { @@ -49291,7 +53062,7 @@ var ts; } function shouldEmitWhitespaceBeforeOperand(node) { var operand = node.operand; - return operand.kind === 190 + return operand.kind === 191 && ((node.operator === 36 && (operand.operator === 36 || operand.operator === 42)) || (node.operator === 37 && (operand.operator === 37 || operand.operator === 43))); } @@ -49357,6 +53128,11 @@ var ts; emitExpression(node.expression); write("!"); } + function emitMetaProperty(node) { + writeToken(node.keywordToken, node.pos); + write("."); + emit(node.name); + } function emitTemplateSpan(node) { emitExpression(node.expression); emit(node.literal); @@ -49370,6 +53146,9 @@ var ts; else { writeToken(16, node.pos, node); emitBlockStatements(node); + increaseIndent(); + emitLeadingCommentsOfPosition(node.statements.end); + decreaseIndent(); writeToken(17, node.statements.end, node); } } @@ -49399,27 +53178,27 @@ var ts; writeToken(18, openParenPos, node); emitExpression(node.expression); writeToken(19, node.expression.end, node); - emitEmbeddedStatement(node.thenStatement); + emitEmbeddedStatement(node, node.thenStatement); if (node.elseStatement) { - writeLine(); + writeLineOrSpace(node); writeToken(81, node.thenStatement.end, node); - if (node.elseStatement.kind === 208) { + if (node.elseStatement.kind === 210) { write(" "); emit(node.elseStatement); } else { - emitEmbeddedStatement(node.elseStatement); + emitEmbeddedStatement(node, node.elseStatement); } } } function emitDoStatement(node) { write("do"); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); if (ts.isBlock(node.statement)) { write(" "); } else { - writeLine(); + writeLineOrSpace(node); } write("while ("); emitExpression(node.expression); @@ -49429,7 +53208,7 @@ var ts; write("while ("); emitExpression(node.expression); write(")"); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitForStatement(node) { var openParenPos = writeToken(87, node.pos); @@ -49441,7 +53220,7 @@ var ts; write(";"); emitExpressionWithPrefix(" ", node.incrementor); write(")"); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitForInStatement(node) { var openParenPos = writeToken(87, node.pos); @@ -49451,21 +53230,22 @@ var ts; write(" in "); emitExpression(node.expression); writeToken(19, node.expression.end); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitForOfStatement(node) { var openParenPos = writeToken(87, node.pos); write(" "); + emitWithSuffix(node.awaitModifier, " "); writeToken(18, openParenPos); emitForBinding(node.initializer); write(" of "); emitExpression(node.expression); writeToken(19, node.expression.end); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 224) { + if (node.kind === 226) { emit(node); } else { @@ -49492,7 +53272,7 @@ var ts; write("with ("); emitExpression(node.expression); write(")"); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitSwitchStatement(node) { var openParenPos = writeToken(97, node.pos); @@ -49516,9 +53296,12 @@ var ts; function emitTryStatement(node) { write("try "); emit(node.tryBlock); - emit(node.catchClause); + if (node.catchClause) { + writeLineOrSpace(node); + emit(node.catchClause); + } if (node.finallyBlock) { - writeLine(); + writeLineOrSpace(node); write("finally "); emit(node.finallyBlock); } @@ -49546,6 +53329,9 @@ var ts; emitIdentifierName(node.name); emitSignatureAndBody(node, emitSignatureHead); } + function emitBlockCallback(_hint, body) { + emitBlockFunctionBody(body); + } function emitSignatureAndBody(node, emitSignatureHead) { var body = node.body; if (body) { @@ -49556,14 +53342,23 @@ var ts; } if (ts.getEmitFlags(node) & 262144) { emitSignatureHead(node); - emitBlockFunctionBody(body); + if (onEmitNode) { + onEmitNode(3, body, emitBlockCallback); + } + else { + emitBlockFunctionBody(body); + } } else { - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); emitSignatureHead(node); - emitBlockFunctionBody(body); - tempFlags = savedTempFlags; + if (onEmitNode) { + onEmitNode(3, body, emitBlockCallback); + } + else { + emitBlockFunctionBody(body); + } + popNameGenerationScope(); } if (indentedFlag) { decreaseIndent(); @@ -49612,9 +53407,15 @@ var ts; function emitBlockFunctionBody(body) { write(" {"); increaseIndent(); - emitBodyWithDetachedComments(body, body.statements, shouldEmitBlockFunctionBodyOnSingleLine(body) + var emitBlockFunctionBody = shouldEmitBlockFunctionBodyOnSingleLine(body) ? emitBlockFunctionBodyOnSingleLine - : emitBlockFunctionBodyWorker); + : emitBlockFunctionBodyWorker; + if (emitBodyWithDetachedComments) { + emitBodyWithDetachedComments(body, body.statements, emitBlockFunctionBody); + } + else { + emitBlockFunctionBody(body); + } decreaseIndent(); writeToken(17, body.statements.end, body); } @@ -49623,8 +53424,9 @@ var ts; } function emitBlockFunctionBodyWorker(body, emitBlockFunctionBodyOnSingleLine) { var statementOffset = emitPrologueDirectives(body.statements, true); - var helpersEmitted = emitHelpers(body); - if (statementOffset === 0 && !helpersEmitted && emitBlockFunctionBodyOnSingleLine) { + var pos = writer.getTextPos(); + emitHelpersIndirect(body); + if (statementOffset === 0 && pos === writer.getTextPos() && emitBlockFunctionBodyOnSingleLine) { decreaseIndent(); emitList(body, body.statements, 384); increaseIndent(); @@ -49647,15 +53449,14 @@ var ts; } emitTypeParameters(node, node.typeParameters); emitList(node, node.heritageClauses, 256); - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); write(" {"); emitList(node, node.members, 65); write("}"); + popNameGenerationScope(); if (indentedFlag) { decreaseIndent(); } - tempFlags = savedTempFlags; } function emitInterfaceDeclaration(node) { emitDecorators(node, node.decorators); @@ -49682,19 +53483,18 @@ var ts; emitModifiers(node, node.modifiers); write("enum "); emit(node.name); - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); write(" {"); emitList(node, node.members, 81); write("}"); - tempFlags = savedTempFlags; + popNameGenerationScope(); } function emitModuleDeclaration(node) { emitModifiers(node, node.modifiers); write(node.flags & 16 ? "namespace " : "module "); emit(node.name); var body = node.body; - while (body.kind === 230) { + while (body.kind === 232) { write("."); emit(body.name); body = body.body; @@ -49707,13 +53507,11 @@ var ts; write("{ }"); } else { - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); write("{"); - increaseIndent(); emitBlockStatements(node); write("}"); - tempFlags = savedTempFlags; + popNameGenerationScope(); } } function emitCaseBlock(node) { @@ -49815,14 +53613,18 @@ var ts; write("<"); emitJsxTagName(node.tagName); write(" "); - emitList(node, node.attributes, 131328); + if (node.attributes.properties && node.attributes.properties.length > 0) { + emit(node.attributes); + } write("/>"); } function emitJsxOpeningElement(node) { write("<"); emitJsxTagName(node.tagName); - writeIfAny(node.attributes, " "); - emitList(node, node.attributes, 131328); + writeIfAny(node.attributes.properties, " "); + if (node.attributes.properties && node.attributes.properties.length > 0) { + emit(node.attributes); + } write(">"); } function emitJsxText(node) { @@ -49833,6 +53635,9 @@ var ts; emitJsxTagName(node.tagName); write(">"); } + function emitJsxAttributes(node) { + emitList(node, node.properties, 131328); + } function emitJsxAttribute(node) { emit(node.name); emitWithPrefix("=", node.initializer); @@ -49845,6 +53650,9 @@ var ts; function emitJsxExpression(node) { if (node.expression) { write("{"); + if (node.dotDotDotToken) { + write("..."); + } emitExpression(node.expression); write("}"); } @@ -49887,7 +53695,6 @@ var ts; emitList(node, node.types, 272); } function emitCatchClause(node) { - writeLine(); var openParenPos = writeToken(73, node.pos); write(" "); writeToken(18, openParenPos); @@ -49900,7 +53707,7 @@ var ts; emit(node.name); write(": "); var initializer = node.initializer; - if ((ts.getEmitFlags(initializer) & 512) === 0) { + if (emitTrailingCommentsOfPosition && (ts.getEmitFlags(initializer) & 512) === 0) { var commentRange = ts.getCommentRange(initializer); emitTrailingCommentsOfPosition(commentRange.pos); } @@ -49925,28 +53732,43 @@ var ts; } function emitSourceFile(node) { writeLine(); - emitShebang(); - emitBodyWithDetachedComments(node, node.statements, emitSourceFileWorker); + var statements = node.statements; + if (emitBodyWithDetachedComments) { + var shouldEmitDetachedComment = statements.length === 0 || + !ts.isPrologueDirective(statements[0]) || + ts.nodeIsSynthesized(statements[0]); + if (shouldEmitDetachedComment) { + emitBodyWithDetachedComments(node, statements, emitSourceFileWorker); + return; + } + } + emitSourceFileWorker(node); } function emitSourceFileWorker(node) { var statements = node.statements; - var statementOffset = emitPrologueDirectives(statements); - var savedTempFlags = tempFlags; - tempFlags = 0; - emitHelpers(node); - emitList(node, statements, 1, statementOffset); - tempFlags = savedTempFlags; + pushNameGenerationScope(); + emitHelpersIndirect(node); + var index = ts.findIndex(statements, function (statement) { return !ts.isPrologueDirective(statement); }); + emitList(node, statements, 1, index === -1 ? statements.length : index); + popNameGenerationScope(); } function emitPartiallyEmittedExpression(node) { emitExpression(node.expression); } - function emitPrologueDirectives(statements, startWithNewLine) { + function emitPrologueDirectives(statements, startWithNewLine, seenPrologueDirectives) { for (var i = 0; i < statements.length; i++) { - if (ts.isPrologueDirective(statements[i])) { - if (startWithNewLine || i > 0) { - writeLine(); + var statement = statements[i]; + if (ts.isPrologueDirective(statement)) { + var shouldEmitPrologueDirective = seenPrologueDirectives ? !seenPrologueDirectives.has(statement.expression.text) : true; + if (shouldEmitPrologueDirective) { + if (startWithNewLine || i > 0) { + writeLine(); + } + emit(statement); + if (seenPrologueDirectives) { + seenPrologueDirectives.set(statement.expression.text, statement.expression.text); + } } - emit(statements[i]); } else { return i; @@ -49954,70 +53776,36 @@ var ts; } return statements.length; } - function emitHelpers(node, isBundle) { - var sourceFile = ts.isSourceFile(node) ? node : currentSourceFile; - var shouldSkip = compilerOptions.noEmitHelpers || (sourceFile && ts.getExternalHelpersModuleName(sourceFile) !== undefined); - var shouldBundle = ts.isSourceFile(node) && !isOwnFileEmit; - var helpersEmitted = false; - var helpers = ts.getEmitHelpers(node); - if (helpers) { - for (var _a = 0, _b = ts.stableSort(helpers, ts.compareEmitHelpers); _a < _b.length; _a++) { - var helper = _b[_a]; - if (!helper.scoped) { - if (shouldSkip) - continue; - if (shouldBundle) { - if (bundledHelpers[helper.name]) { - continue; - } - bundledHelpers[helper.name] = true; - } - } - else if (isBundle) { - continue; - } - writeLines(helper.text); - helpersEmitted = true; - } + function emitPrologueDirectivesIfNeeded(sourceFileOrBundle) { + if (ts.isSourceFile(sourceFileOrBundle)) { + setSourceFile(sourceFileOrBundle); + emitPrologueDirectives(sourceFileOrBundle.statements); } - if (helpersEmitted) { - writeLine(); - } - return helpersEmitted; - } - function writeLines(text) { - var lines = text.split(/\r\n?|\n/g); - var indentation = guessIndentation(lines); - for (var i = 0; i < lines.length; i++) { - var line = indentation ? lines[i].slice(indentation) : lines[i]; - if (line.length) { - if (i > 0) { - writeLine(); - } - write(line); + else { + var seenPrologueDirectives = ts.createMap(); + for (var _a = 0, _b = sourceFileOrBundle.sourceFiles; _a < _b.length; _a++) { + var sourceFile = _b[_a]; + setSourceFile(sourceFile); + emitPrologueDirectives(sourceFile.statements, true, seenPrologueDirectives); } } } - function guessIndentation(lines) { - var indentation; - for (var _a = 0, lines_1 = lines; _a < lines_1.length; _a++) { - var line = lines_1[_a]; - for (var i = 0; i < line.length && (indentation === undefined || i < indentation); i++) { - if (!ts.isWhiteSpace(line.charCodeAt(i))) { - if (indentation === undefined || i < indentation) { - indentation = i; - break; - } - } + function emitShebangIfNeeded(sourceFileOrBundle) { + if (ts.isSourceFile(sourceFileOrBundle)) { + var shebang = ts.getShebang(sourceFileOrBundle.text); + if (shebang) { + write(shebang); + writeLine(); + return true; } } - return indentation; - } - function emitShebang() { - var shebang = ts.getShebang(currentText); - if (shebang) { - write(shebang); - writeLine(); + else { + for (var _a = 0, _b = sourceFileOrBundle.sourceFiles; _a < _b.length; _a++) { + var sourceFile = _b[_a]; + if (emitShebangIfNeeded(sourceFile)) { + break; + } + } } } function emitModifiers(node, modifiers) { @@ -50044,8 +53832,8 @@ var ts; write(suffix); } } - function emitEmbeddedStatement(node) { - if (ts.isBlock(node)) { + function emitEmbeddedStatement(parent, node) { + if (ts.isBlock(node) || ts.getEmitFlags(parent) & 1) { write(" "); emit(node); } @@ -50102,6 +53890,9 @@ var ts; if (format & 7680) { write(getOpeningBracket(format)); } + if (onBeforeEmitNodeArray) { + onBeforeEmitNodeArray(children); + } if (isEmpty) { if (format & 1) { writeLine(); @@ -50129,6 +53920,9 @@ var ts; for (var i = 0; i < count; i++) { var child = children[start + i]; if (previousSibling) { + if (delimiter && previousSibling.end !== parentNode.end) { + emitLeadingCommentsOfPosition(previousSibling.end); + } write(delimiter); if (shouldWriteSeparatingLineTerminator(previousSibling, child, format)) { if ((format & (3 | 64)) === 0) { @@ -50143,8 +53937,10 @@ var ts; } } if (shouldEmitInterveningComments) { - var commentRange = ts.getCommentRange(child); - emitTrailingCommentsOfPosition(commentRange.pos); + if (emitTrailingCommentsOfPosition) { + var commentRange = ts.getCommentRange(child); + emitTrailingCommentsOfPosition(commentRange.pos); + } } else { shouldEmitInterveningComments = mayEmitInterveningComments; @@ -50160,6 +53956,9 @@ var ts; if (format & 16 && hasTrailingComma) { write(","); } + if (previousSibling && delimiter && previousSibling.end !== parentNode.end) { + emitLeadingCommentsOfPosition(previousSibling.end); + } if (format & 64) { decreaseIndent(); } @@ -50170,28 +53969,80 @@ var ts; write(" "); } } + if (onAfterEmitNodeArray) { + onAfterEmitNodeArray(children); + } if (format & 7680) { write(getClosingBracket(format)); } } + function write(s) { + writer.write(s); + } + function writeLine() { + writer.writeLine(); + } + function increaseIndent() { + writer.increaseIndent(); + } + function decreaseIndent() { + writer.decreaseIndent(); + } function writeIfAny(nodes, text) { - if (nodes && nodes.length > 0) { + if (ts.some(nodes)) { write(text); } } function writeIfPresent(node, text) { - if (node !== undefined) { + if (node) { write(text); } } function writeToken(token, pos, contextNode) { - return emitTokenWithSourceMap(contextNode, token, pos, writeTokenText); + return onEmitSourceMapOfToken + ? onEmitSourceMapOfToken(contextNode, token, pos, writeTokenText) + : writeTokenText(token, pos); } function writeTokenText(token, pos) { var tokenString = ts.tokenToString(token); write(tokenString); return pos < 0 ? pos : pos + tokenString.length; } + function writeLineOrSpace(node) { + if (ts.getEmitFlags(node) & 1) { + write(" "); + } + else { + writeLine(); + } + } + function writeLines(text) { + var lines = text.split(/\r\n?|\n/g); + var indentation = guessIndentation(lines); + for (var i = 0; i < lines.length; i++) { + var line = indentation ? lines[i].slice(indentation) : lines[i]; + if (line.length) { + writeLine(); + write(line); + writeLine(); + } + } + } + function guessIndentation(lines) { + var indentation; + for (var _a = 0, lines_1 = lines; _a < lines_1.length; _a++) { + var line = lines_1[_a]; + for (var i = 0; i < line.length && (indentation === undefined || i < indentation); i++) { + if (!ts.isWhiteSpace(line.charCodeAt(i))) { + if (indentation === undefined || i < indentation) { + indentation = i; + break; + } + } + } + } + return indentation; + } function increaseIndentIf(value, valueToWriteWhenNotIndenting) { if (value) { increaseIndent(); @@ -50296,15 +54147,23 @@ var ts; && !ts.nodeIsSynthesized(node2) && !ts.rangeEndIsOnSameLineAsRangeStart(node1, node2, currentSourceFile); } + function isSingleLineEmptyBlock(block) { + return !block.multiLine + && isEmptyBlock(block); + } + function isEmptyBlock(block) { + return block.statements.length === 0 + && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); + } function skipSynthesizedParentheses(node) { - while (node.kind === 183 && ts.nodeIsSynthesized(node)) { + while (node.kind === 184 && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; } function getTextOfNode(node, includeTrivia) { if (ts.isGeneratedIdentifier(node)) { - return getGeneratedIdentifier(node); + return generateName(node); } else if (ts.isIdentifier(node) && (ts.nodeIsSynthesized(node) || !node.parent)) { return ts.unescapeIdentifier(node.text); @@ -50327,25 +54186,39 @@ var ts; return getLiteralTextOfNode(textSourceNode); } } - return ts.getLiteralText(node, currentSourceFile, languageVersion); + return ts.getLiteralText(node, currentSourceFile); } - function isSingleLineEmptyBlock(block) { - return !block.multiLine - && isEmptyBlock(block); + function pushNameGenerationScope() { + tempFlagsStack.push(tempFlags); + tempFlags = 0; } - function isEmptyBlock(block) { - return block.statements.length === 0 - && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); + function popNameGenerationScope() { + tempFlags = tempFlagsStack.pop(); + } + function generateName(name) { + if (name.autoGenerateKind === 4) { + var node = getNodeForGeneratedName(name); + return generateNameCached(node); + } + else { + var autoGenerateId = name.autoGenerateId; + return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = ts.unescapeIdentifier(makeName(name))); + } + } + function generateNameCached(node) { + var nodeId = ts.getNodeId(node); + return nodeIdToGeneratedName[nodeId] || (nodeIdToGeneratedName[nodeId] = ts.unescapeIdentifier(generateNameForNode(node))); } function isUniqueName(name) { - return !resolver.hasGlobalName(name) && - !ts.hasProperty(currentFileIdentifiers, name) && - !ts.hasProperty(generatedNameSet, name); + return !(hasGlobalName && hasGlobalName(name)) + && !currentSourceFile.identifiers.has(name) + && !generatedNames.has(name); } function isUniqueLocalName(name, container) { for (var node = container; ts.isNodeDescendantOf(node, container); node = node.nextContainer) { - if (node.locals && ts.hasProperty(node.locals, name)) { - if (node.locals[name].flags & (107455 | 1048576 | 8388608)) { + if (node.locals) { + var local = node.locals.get(name); + if (local && local.flags & (107455 | 1048576 | 8388608)) { return false; } } @@ -50354,21 +54227,21 @@ var ts; } function makeTempVariableName(flags) { if (flags && !(tempFlags & flags)) { - var name_41 = flags === 268435456 ? "_i" : "_n"; - if (isUniqueName(name_41)) { + var name = flags === 268435456 ? "_i" : "_n"; + if (isUniqueName(name)) { tempFlags |= flags; - return name_41; + return name; } } while (true) { var count = tempFlags & 268435455; tempFlags++; if (count !== 8 && count !== 13) { - var name_42 = count < 26 + var name = count < 26 ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26); - if (isUniqueName(name_42)) { - return name_42; + if (isUniqueName(name)) { + return name; } } } @@ -50381,7 +54254,8 @@ var ts; while (true) { var generatedName = baseName + i; if (isUniqueName(generatedName)) { - return generatedNameSet[generatedName] = generatedName; + generatedNames.set(generatedName, generatedName); + return generatedName; } i++; } @@ -50402,34 +54276,44 @@ var ts; function generateNameForClassExpression() { return makeUniqueName("class"); } + function generateNameForMethodOrAccessor(node) { + if (ts.isIdentifier(node.name)) { + return generateNameCached(node.name); + } + return makeTempVariableName(0); + } function generateNameForNode(node) { switch (node.kind) { case 70: return makeUniqueName(getTextOfNode(node)); - case 230: - case 229: + case 232: + case 231: return generateNameForModuleOrEnum(node); - case 235: - case 241: + case 237: + case 243: return generateNameForImportOrExportDeclaration(node); - case 225: - case 226: - case 240: + case 227: + case 228: + case 242: return generateNameForExportDefault(); - case 197: + case 198: return generateNameForClassExpression(); + case 150: + case 152: + case 153: + return generateNameForMethodOrAccessor(node); default: return makeTempVariableName(0); } } - function generateName(name) { + function makeName(name) { switch (name.autoGenerateKind) { case 1: return makeTempVariableName(0); case 2: return makeTempVariableName(268435456); case 3: - return makeUniqueName(name.text); + return makeUniqueName(ts.unescapeIdentifier(name.text)); } ts.Debug.fail("Unsupported GeneratedIdentifierKind."); } @@ -50448,48 +54332,106 @@ var ts; } return node; } - function getGeneratedIdentifier(name) { - if (name.autoGenerateKind === 4) { - var node = getNodeForGeneratedName(name); - var nodeId = ts.getNodeId(node); - return nodeIdToGeneratedName[nodeId] || (nodeIdToGeneratedName[nodeId] = ts.unescapeIdentifier(generateNameForNode(node))); - } - else { - var autoGenerateId = name.autoGenerateId; - return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = ts.unescapeIdentifier(generateName(name))); - } - } - function createDelimiterMap() { - var delimiters = []; - delimiters[0] = ""; - delimiters[16] = ","; - delimiters[4] = " |"; - delimiters[8] = " &"; - return delimiters; - } - function getDelimiter(format) { - return delimiters[format & 28]; - } - function createBracketsMap() { - var brackets = []; - brackets[512] = ["{", "}"]; - brackets[1024] = ["(", ")"]; - brackets[2048] = ["<", ">"]; - brackets[4096] = ["[", "]"]; - return brackets; - } - function getOpeningBracket(format) { - return brackets[format & 7680][0]; - } - function getClosingBracket(format) { - return brackets[format & 7680][1]; - } } - ts.emitFiles = emitFiles; + ts.createPrinter = createPrinter; + function createDelimiterMap() { + var delimiters = []; + delimiters[0] = ""; + delimiters[16] = ","; + delimiters[4] = " |"; + delimiters[8] = " &"; + return delimiters; + } + function getDelimiter(format) { + return delimiters[format & 28]; + } + function createBracketsMap() { + var brackets = []; + brackets[512] = ["{", "}"]; + brackets[1024] = ["(", ")"]; + brackets[2048] = ["<", ">"]; + brackets[4096] = ["[", "]"]; + return brackets; + } + function getOpeningBracket(format) { + return brackets[format & 7680][0]; + } + function getClosingBracket(format) { + return brackets[format & 7680][1]; + } + var TempFlags; + (function (TempFlags) { + TempFlags[TempFlags["Auto"] = 0] = "Auto"; + TempFlags[TempFlags["CountMask"] = 268435455] = "CountMask"; + TempFlags[TempFlags["_i"] = 268435456] = "_i"; + })(TempFlags || (TempFlags = {})); + var ListFormat; + (function (ListFormat) { + ListFormat[ListFormat["None"] = 0] = "None"; + ListFormat[ListFormat["SingleLine"] = 0] = "SingleLine"; + ListFormat[ListFormat["MultiLine"] = 1] = "MultiLine"; + ListFormat[ListFormat["PreserveLines"] = 2] = "PreserveLines"; + ListFormat[ListFormat["LinesMask"] = 3] = "LinesMask"; + ListFormat[ListFormat["NotDelimited"] = 0] = "NotDelimited"; + ListFormat[ListFormat["BarDelimited"] = 4] = "BarDelimited"; + ListFormat[ListFormat["AmpersandDelimited"] = 8] = "AmpersandDelimited"; + ListFormat[ListFormat["CommaDelimited"] = 16] = "CommaDelimited"; + ListFormat[ListFormat["DelimitersMask"] = 28] = "DelimitersMask"; + ListFormat[ListFormat["AllowTrailingComma"] = 32] = "AllowTrailingComma"; + ListFormat[ListFormat["Indented"] = 64] = "Indented"; + ListFormat[ListFormat["SpaceBetweenBraces"] = 128] = "SpaceBetweenBraces"; + ListFormat[ListFormat["SpaceBetweenSiblings"] = 256] = "SpaceBetweenSiblings"; + ListFormat[ListFormat["Braces"] = 512] = "Braces"; + ListFormat[ListFormat["Parenthesis"] = 1024] = "Parenthesis"; + ListFormat[ListFormat["AngleBrackets"] = 2048] = "AngleBrackets"; + ListFormat[ListFormat["SquareBrackets"] = 4096] = "SquareBrackets"; + ListFormat[ListFormat["BracketsMask"] = 7680] = "BracketsMask"; + ListFormat[ListFormat["OptionalIfUndefined"] = 8192] = "OptionalIfUndefined"; + ListFormat[ListFormat["OptionalIfEmpty"] = 16384] = "OptionalIfEmpty"; + ListFormat[ListFormat["Optional"] = 24576] = "Optional"; + ListFormat[ListFormat["PreferNewLine"] = 32768] = "PreferNewLine"; + ListFormat[ListFormat["NoTrailingNewLine"] = 65536] = "NoTrailingNewLine"; + ListFormat[ListFormat["NoInterveningComments"] = 131072] = "NoInterveningComments"; + ListFormat[ListFormat["Modifiers"] = 256] = "Modifiers"; + ListFormat[ListFormat["HeritageClauses"] = 256] = "HeritageClauses"; + ListFormat[ListFormat["TypeLiteralMembers"] = 65] = "TypeLiteralMembers"; + ListFormat[ListFormat["TupleTypeElements"] = 336] = "TupleTypeElements"; + ListFormat[ListFormat["UnionTypeConstituents"] = 260] = "UnionTypeConstituents"; + ListFormat[ListFormat["IntersectionTypeConstituents"] = 264] = "IntersectionTypeConstituents"; + ListFormat[ListFormat["ObjectBindingPatternElements"] = 432] = "ObjectBindingPatternElements"; + ListFormat[ListFormat["ArrayBindingPatternElements"] = 304] = "ArrayBindingPatternElements"; + ListFormat[ListFormat["ObjectLiteralExpressionProperties"] = 978] = "ObjectLiteralExpressionProperties"; + ListFormat[ListFormat["ArrayLiteralExpressionElements"] = 4466] = "ArrayLiteralExpressionElements"; + ListFormat[ListFormat["CallExpressionArguments"] = 1296] = "CallExpressionArguments"; + ListFormat[ListFormat["NewExpressionArguments"] = 9488] = "NewExpressionArguments"; + ListFormat[ListFormat["TemplateExpressionSpans"] = 131072] = "TemplateExpressionSpans"; + ListFormat[ListFormat["SingleLineBlockStatements"] = 384] = "SingleLineBlockStatements"; + ListFormat[ListFormat["MultiLineBlockStatements"] = 65] = "MultiLineBlockStatements"; + ListFormat[ListFormat["VariableDeclarationList"] = 272] = "VariableDeclarationList"; + ListFormat[ListFormat["SingleLineFunctionBodyStatements"] = 384] = "SingleLineFunctionBodyStatements"; + ListFormat[ListFormat["MultiLineFunctionBodyStatements"] = 1] = "MultiLineFunctionBodyStatements"; + ListFormat[ListFormat["ClassHeritageClauses"] = 256] = "ClassHeritageClauses"; + ListFormat[ListFormat["ClassMembers"] = 65] = "ClassMembers"; + ListFormat[ListFormat["InterfaceMembers"] = 65] = "InterfaceMembers"; + ListFormat[ListFormat["EnumMembers"] = 81] = "EnumMembers"; + ListFormat[ListFormat["CaseBlockClauses"] = 65] = "CaseBlockClauses"; + ListFormat[ListFormat["NamedImportsOrExportsElements"] = 432] = "NamedImportsOrExportsElements"; + ListFormat[ListFormat["JsxElementChildren"] = 131072] = "JsxElementChildren"; + ListFormat[ListFormat["JsxElementAttributes"] = 131328] = "JsxElementAttributes"; + ListFormat[ListFormat["CaseOrDefaultClauseStatements"] = 81985] = "CaseOrDefaultClauseStatements"; + ListFormat[ListFormat["HeritageClauseTypes"] = 272] = "HeritageClauseTypes"; + ListFormat[ListFormat["SourceFileStatements"] = 65537] = "SourceFileStatements"; + ListFormat[ListFormat["Decorators"] = 24577] = "Decorators"; + ListFormat[ListFormat["TypeArguments"] = 26960] = "TypeArguments"; + ListFormat[ListFormat["TypeParameters"] = 26960] = "TypeParameters"; + ListFormat[ListFormat["Parameters"] = 1360] = "Parameters"; + ListFormat[ListFormat["IndexSignatureParameters"] = 4432] = "IndexSignatureParameters"; + })(ListFormat || (ListFormat = {})); })(ts || (ts = {})); var ts; (function (ts) { var emptyArray = []; + var ignoreDiagnosticCommentRegEx = /(^\s*$)|(^\s*\/\/\/?\s*(@ts-ignore)?)/; function findConfigFile(searchPath, fileExists, configName) { if (configName === void 0) { configName = "tsconfig.json"; } while (true) { @@ -50521,7 +54463,8 @@ var ts; commonPathComponents = sourcePathComponents; return; } - for (var i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) { + var n = Math.min(commonPathComponents.length, sourcePathComponents.length); + for (var i = 0; i < n; i++) { if (getCanonicalFileName(commonPathComponents[i]) !== getCanonicalFileName(sourcePathComponents[i])) { if (i === 0) { return true; @@ -50548,7 +54491,6 @@ var ts; function getCanonicalFileName(fileName) { return ts.sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(); } - var unsupportedFileEncodingErrorCode = -2147024809; function getSourceFile(fileName, languageVersion, onError) { var text; try { @@ -50559,20 +54501,18 @@ var ts; } catch (e) { if (onError) { - onError(e.number === unsupportedFileEncodingErrorCode - ? ts.createCompilerDiagnostic(ts.Diagnostics.Unsupported_file_encoding).messageText - : e.message); + onError(e.message); } text = ""; } return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion, setParentNodes) : undefined; } function directoryExists(directoryPath) { - if (directoryPath in existingDirectories) { + if (existingDirectories.has(directoryPath)) { return true; } if (ts.sys.directoryExists(directoryPath)) { - existingDirectories[directoryPath] = true; + existingDirectories.set(directoryPath, true); return true; } return false; @@ -50591,9 +54531,10 @@ var ts; } var hash = ts.sys.createHash(data); var mtimeBefore = ts.sys.getModifiedTime(fileName); - if (mtimeBefore && fileName in outputFingerprints) { - var fingerprint = outputFingerprints[fileName]; - if (fingerprint.byteOrderMark === writeByteOrderMark && + if (mtimeBefore) { + var fingerprint = outputFingerprints.get(fileName); + if (fingerprint && + fingerprint.byteOrderMark === writeByteOrderMark && fingerprint.hash === hash && fingerprint.mtime.getTime() === mtimeBefore.getTime()) { return; @@ -50601,11 +54542,11 @@ var ts; } ts.sys.writeFile(fileName, data, writeByteOrderMark); var mtimeAfter = ts.sys.getModifiedTime(fileName); - outputFingerprints[fileName] = { + outputFingerprints.set(fileName, { hash: hash, byteOrderMark: writeByteOrderMark, mtime: mtimeAfter - }; + }); } function writeFile(fileName, data, writeByteOrderMark, onError) { try { @@ -50704,10 +54645,14 @@ var ts; var resolutions = []; var cache = ts.createMap(); for (var _i = 0, names_1 = names; _i < names_1.length; _i++) { - var name_43 = names_1[_i]; - var result = name_43 in cache - ? cache[name_43] - : cache[name_43] = loader(name_43, containingFile); + var name = names_1[_i]; + var result = void 0; + if (cache.has(name)) { + result = cache.get(name); + } + else { + cache.set(name, result = loader(name, containingFile)); + } resolutions.push(result); } return resolutions; @@ -50719,6 +54664,8 @@ var ts; var diagnosticsProducingTypeChecker; var noDiagnosticsTypeChecker; var classifiableNames; + var cachedSemanticDiagnosticsForFile = {}; + var cachedDeclarationDiagnosticsForFile = {}; var resolvedTypeReferenceDirectives = ts.createMap(); var fileProcessingDiagnostics = ts.createDiagnosticCollection(); var maxNodeModuleJsDepth = typeof options.maxNodeModuleJsDepth === "number" ? options.maxNodeModuleJsDepth : 0; @@ -50732,6 +54679,7 @@ var ts; var currentDirectory = host.getCurrentDirectory(); var supportedExtensions = ts.getSupportedExtensions(options); var hasEmitBlockingDiagnostics = ts.createFileMap(getCanonicalFileName); + var moduleResolutionCache; var resolveModuleNamesWorker; if (host.resolveModuleNames) { resolveModuleNamesWorker = function (moduleNames, containingFile) { return host.resolveModuleNames(moduleNames, containingFile).map(function (resolved) { @@ -50744,7 +54692,8 @@ var ts; }); }; } else { - var loader_1 = function (moduleName, containingFile) { return ts.resolveModuleName(moduleName, containingFile, options, host).resolvedModule; }; + moduleResolutionCache = ts.createModuleResolutionCache(currentDirectory, function (x) { return host.getCanonicalFileName(x); }); + var loader_1 = function (moduleName, containingFile) { return ts.resolveModuleName(moduleName, containingFile, options, host, moduleResolutionCache).resolvedModule; }; resolveModuleNamesWorker = function (moduleNames, containingFile) { return loadWithLocalCache(moduleNames, containingFile, loader_1); }; } var resolveTypeReferenceDirectiveNamesWorker; @@ -50780,6 +54729,7 @@ var ts; } } } + moduleResolutionCache = undefined; oldProgram = undefined; program = { getRootFileNames: function () { return rootNames; }, @@ -50813,7 +54763,7 @@ var ts; return program; function getCommonSourceDirectory() { if (commonSourceDirectory === undefined) { - var emittedFiles = ts.filterSourceFilesInDirectory(files, isSourceFileFromExternalLibrary); + var emittedFiles = ts.filter(files, function (file) { return ts.sourceFileMayBeEmitted(file, options, isSourceFileFromExternalLibrary); }); if (options.rootDir && checkSourceFilesBelongToPath(emittedFiles, options.rootDir)) { commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory); } @@ -50832,7 +54782,7 @@ var ts; classifiableNames = ts.createMap(); for (var _i = 0, files_2 = files; _i < files_2.length; _i++) { var sourceFile = files_2[_i]; - ts.copyProperties(sourceFile.classifiableNames, classifiableNames); + ts.copyEntries(sourceFile.classifiableNames, classifiableNames); } } return classifiableNames; @@ -50875,7 +54825,7 @@ var ts; : emptyArray; var j = 0; for (var i = 0; i < result.length; i++) { - if (result[i] == predictedToResolveToAmbientModuleMarker) { + if (result[i] === predictedToResolveToAmbientModuleMarker) { result[i] = undefined; } else { @@ -50986,7 +54936,7 @@ var ts; newSourceFile.resolvedModules = oldSourceFile.resolvedModules; newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames; } - for (var i = 0, len = newSourceFiles.length; i < len; i++) { + for (var i = 0; i < newSourceFiles.length; i++) { filesByName.set(filePaths[i], newSourceFiles[i]); } files = newSourceFiles; @@ -51015,7 +54965,7 @@ var ts; }; } function isSourceFileFromExternalLibrary(file) { - return sourceFilesFoundSearchingNodeModules[file.path]; + return sourceFilesFoundSearchingNodeModules.get(file.path); } function getDiagnosticsProducingTypeChecker() { return diagnosticsProducingTypeChecker || (diagnosticsProducingTypeChecker = ts.createTypeChecker(program, true)); @@ -51026,13 +54976,13 @@ var ts; function getTypeChecker() { return noDiagnosticsTypeChecker || (noDiagnosticsTypeChecker = ts.createTypeChecker(program, false)); } - function emit(sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles) { - return runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles); }); + function emit(sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers) { + return runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers); }); } function isEmitBlocked(emitFileName) { return hasEmitBlockingDiagnostics.contains(ts.toPath(emitFileName, currentDirectory, getCanonicalFileName)); } - function emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles) { + function emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, customTransformers) { var declarationDiagnostics = []; if (options.noEmit) { return { diagnostics: declarationDiagnostics, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true }; @@ -51053,7 +55003,8 @@ var ts; } var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile); ts.performance.mark("beforeEmit"); - var emitResult = ts.emitFiles(emitResolver, getEmitHost(writeFileCallback), sourceFile, emitOnlyDtsFiles); + var transformers = emitOnlyDtsFiles ? [] : ts.getTransformers(options, customTransformers); + var emitResult = ts.emitFiles(emitResolver, getEmitHost(writeFileCallback), sourceFile, emitOnlyDtsFiles, transformers); ts.performance.mark("afterEmit"); ts.performance.measure("Emit", "beforeEmit", "afterEmit"); return emitResult; @@ -51114,16 +55065,42 @@ var ts; } } function getSemanticDiagnosticsForFile(sourceFile, cancellationToken) { + return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedSemanticDiagnosticsForFile, getSemanticDiagnosticsForFileNoCache); + } + function getSemanticDiagnosticsForFileNoCache(sourceFile, cancellationToken) { return runWithCancellationToken(function () { var typeChecker = getDiagnosticsProducingTypeChecker(); ts.Debug.assert(!!sourceFile.bindDiagnostics); var bindDiagnostics = sourceFile.bindDiagnostics; - var checkDiagnostics = ts.isSourceFileJavaScript(sourceFile) ? [] : typeChecker.getDiagnostics(sourceFile, cancellationToken); + var includeCheckDiagnostics = !ts.isSourceFileJavaScript(sourceFile) || ts.isCheckJsEnabledForFile(sourceFile, options); + var checkDiagnostics = includeCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : []; var fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName); var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName); - return bindDiagnostics.concat(checkDiagnostics, fileProcessingDiagnosticsInFile, programDiagnosticsInFile); + var diagnostics = bindDiagnostics.concat(checkDiagnostics, fileProcessingDiagnosticsInFile, programDiagnosticsInFile); + return ts.isSourceFileJavaScript(sourceFile) + ? ts.filter(diagnostics, shouldReportDiagnostic) + : diagnostics; }); } + function shouldReportDiagnostic(diagnostic) { + var file = diagnostic.file, start = diagnostic.start; + if (file) { + var lineStarts = ts.getLineStarts(file); + var line = ts.computeLineAndCharacterOfPosition(lineStarts, start).line; + while (line > 0) { + var previousLineText = file.text.slice(lineStarts[line - 1], lineStarts[line]); + var result = ignoreDiagnosticCommentRegEx.exec(previousLineText); + if (!result) { + return true; + } + if (result[3]) { + return false; + } + line--; + } + } + return true; + } function getJavaScriptSyntacticDiagnosticsForFile(sourceFile) { return runWithCancellationToken(function () { var diagnostics = []; @@ -51132,57 +55109,57 @@ var ts; return diagnostics; function walk(node) { switch (parent.kind) { - case 144: - case 147: + case 145: + case 148: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, "?")); return; } - case 149: - case 148: case 150: + case 149: case 151: case 152: - case 184: - case 225: + case 153: case 185: + case 227: + case 186: + case 227: case 225: - case 223: if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); return; } } switch (node.kind) { - case 234: + case 236: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); return; - case 240: + case 242: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); return; } break; - case 255: + case 258: var heritageClause = node; if (heritageClause.token === 107) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); return; } break; - case 227: + case 229: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); return; - case 230: + case 232: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); return; - case 228: + case 230: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); return; - case 229: + case 231: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); return; - case 182: + case 183: var typeAssertionExpression = node; diagnostics.push(createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); return; @@ -51197,26 +55174,26 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning)); } switch (parent.kind) { - case 226: - case 149: - case 148: + case 228: case 150: + case 149: case 151: case 152: - case 184: - case 225: + case 153: case 185: - case 225: + case 227: + case 186: + case 227: if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); return; } - case 205: + case 207: if (nodes === parent.modifiers) { - return checkModifiers(nodes, parent.kind === 205); + return checkModifiers(nodes, parent.kind === 207); } break; - case 147: + case 148: if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { var modifier = _a[_i]; @@ -51227,23 +55204,23 @@ var ts; return; } break; - case 144: + case 145: if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); return; } break; - case 179: case 180: - case 199: + case 181: + case 200: if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); return; } break; } - for (var _b = 0, nodes_6 = nodes; _b < nodes_6.length; _b++) { - var node = nodes_6[_b]; + for (var _b = 0, nodes_8 = nodes; _b < nodes_8.length; _b++) { + var node = nodes_8[_b]; walk(node); } } @@ -51279,11 +55256,33 @@ var ts; }); } function getDeclarationDiagnosticsWorker(sourceFile, cancellationToken) { + return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedDeclarationDiagnosticsForFile, getDeclarationDiagnosticsForFileNoCache); + } + function getDeclarationDiagnosticsForFileNoCache(sourceFile, cancellationToken) { return runWithCancellationToken(function () { var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile, cancellationToken); return ts.getDeclarationDiagnostics(getEmitHost(ts.noop), resolver, sourceFile); }); } + function getAndCacheDiagnostics(sourceFile, cancellationToken, cache, getDiagnostics) { + var cachedResult = sourceFile + ? cache.perFile && cache.perFile.get(sourceFile.path) + : cache.allDiagnostics; + if (cachedResult) { + return cachedResult; + } + var result = getDiagnostics(sourceFile, cancellationToken) || emptyArray; + if (sourceFile) { + if (!cache.perFile) { + cache.perFile = ts.createFileMap(); + } + cache.perFile.set(sourceFile.path, result); + } + else { + cache.allDiagnostics = result; + } + return result; + } function getDeclarationDiagnosticsForFile(sourceFile, cancellationToken) { return ts.isDeclarationFile(sourceFile) ? [] : getDeclarationDiagnosticsWorker(sourceFile, cancellationToken); } @@ -51323,11 +55322,10 @@ var ts; if (options.importHelpers && (options.isolatedModules || isExternalModuleFile) && !file.isDeclarationFile) { - var externalHelpersModuleReference = ts.createSynthesizedNode(9); - externalHelpersModuleReference.text = ts.externalHelpersModuleNameText; - var importDecl = ts.createSynthesizedNode(235); - importDecl.parent = file; + var externalHelpersModuleReference = ts.createLiteral(ts.externalHelpersModuleNameText); + var importDecl = ts.createImportDeclaration(undefined, undefined, undefined); externalHelpersModuleReference.parent = importDecl; + importDecl.parent = file; imports = [externalHelpersModuleReference]; } for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { @@ -51343,9 +55341,9 @@ var ts; return; function collectModuleReferences(node, inAmbientModule) { switch (node.kind) { - case 235: - case 234: - case 241: + case 237: + case 236: + case 243: var moduleNameExpr = ts.getExternalModuleName(node); if (!moduleNameExpr || moduleNameExpr.kind !== 9) { break; @@ -51357,7 +55355,7 @@ var ts; (imports || (imports = [])).push(moduleNameExpr); } break; - case 230: + case 232: if (ts.isAmbientModule(node) && (inAmbientModule || ts.hasModifier(node, 2) || ts.isDeclarationFile(file))) { var moduleName = node.name; if (isExternalModuleFile || (inAmbientModule && !ts.isExternalModuleNameRelative(moduleName.text))) { @@ -51441,18 +55439,18 @@ var ts; if (file_1 && options.forceConsistentCasingInFileNames && ts.getNormalizedAbsolutePath(file_1.fileName, currentDirectory) !== ts.getNormalizedAbsolutePath(fileName, currentDirectory)) { reportFileNamesDifferOnlyInCasingError(fileName, file_1.fileName, refFile, refPos, refEnd); } - if (file_1 && sourceFilesFoundSearchingNodeModules[file_1.path] && currentNodeModulesDepth == 0) { - sourceFilesFoundSearchingNodeModules[file_1.path] = false; + if (file_1 && sourceFilesFoundSearchingNodeModules.get(file_1.path) && currentNodeModulesDepth === 0) { + sourceFilesFoundSearchingNodeModules.set(file_1.path, false); if (!options.noResolve) { processReferencedFiles(file_1, isDefaultLib); processTypeReferenceDirectives(file_1); } - modulesWithElidedImports[file_1.path] = false; + modulesWithElidedImports.set(file_1.path, false); processImportedModules(file_1); } - else if (file_1 && modulesWithElidedImports[file_1.path]) { + else if (file_1 && modulesWithElidedImports.get(file_1.path)) { if (currentNodeModulesDepth < maxNodeModuleJsDepth) { - modulesWithElidedImports[file_1.path] = false; + modulesWithElidedImports.set(file_1.path, false); processImportedModules(file_1); } } @@ -51468,7 +55466,7 @@ var ts; }); filesByName.set(path, file); if (file) { - sourceFilesFoundSearchingNodeModules[path] = (currentNodeModulesDepth > 0); + sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0); file.path = path; if (host.useCaseSensitiveFileNames()) { var existingFile = filesByNameIgnoreCase.get(path); @@ -51512,7 +55510,7 @@ var ts; } } function processTypeReferenceDirective(typeReferenceDirective, resolvedTypeReferenceDirective, refFile, refPos, refEnd) { - var previousResolution = resolvedTypeReferenceDirectives[typeReferenceDirective]; + var previousResolution = resolvedTypeReferenceDirectives.get(typeReferenceDirective); if (previousResolution && previousResolution.primary) { return; } @@ -51540,7 +55538,7 @@ var ts; fileProcessingDiagnostics.add(createDiagnostic(refFile, refPos, refEnd, ts.Diagnostics.Cannot_find_type_definition_file_for_0, typeReferenceDirective)); } if (saveResolution) { - resolvedTypeReferenceDirectives[typeReferenceDirective] = resolvedTypeReferenceDirective; + resolvedTypeReferenceDirectives.set(typeReferenceDirective, resolvedTypeReferenceDirective); } } function createDiagnostic(refFile, refPos, refEnd, message) { @@ -51581,7 +55579,7 @@ var ts; var elideImport = isJsFileFromNodeModules && currentNodeModulesDepth > maxNodeModuleJsDepth; var shouldAddFile = resolvedFileName && !getResolutionDiagnostic(options, resolution) && !options.noResolve && i < file.imports.length && !elideImport; if (elideImport) { - modulesWithElidedImports[file.path] = true; + modulesWithElidedImports.set(file.path, true); } else if (shouldAddFile) { var path = ts.toPath(resolvedFileName, currentDirectory, getCanonicalFileName); @@ -51599,8 +55597,8 @@ var ts; } function computeCommonSourceDirectory(sourceFiles) { var fileNames = []; - for (var _i = 0, sourceFiles_6 = sourceFiles; _i < sourceFiles_6.length; _i++) { - var file = sourceFiles_6[_i]; + for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) { + var file = sourceFiles_2[_i]; if (!file.isDeclarationFile) { fileNames.push(file.fileName); } @@ -51611,8 +55609,8 @@ var ts; var allFilesBelongToPath = true; if (sourceFiles) { var absoluteRootDirectoryPath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(rootDirectory, currentDirectory)); - for (var _i = 0, sourceFiles_7 = sourceFiles; _i < sourceFiles_7.length; _i++) { - var sourceFile = sourceFiles_7[_i]; + for (var _i = 0, sourceFiles_3 = sourceFiles; _i < sourceFiles_3.length; _i++) { + var sourceFile = sourceFiles_3[_i]; if (!ts.isDeclarationFile(sourceFile)) { var absoluteSourceFilePath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { @@ -51705,7 +55703,7 @@ var ts; if (options.lib && options.noLib) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "lib", "noLib")); } - if (options.noImplicitUseStrict && options.alwaysStrict) { + if (options.noImplicitUseStrict && (options.alwaysStrict === undefined ? options.strict : options.alwaysStrict)) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "noImplicitUseStrict", "alwaysStrict")); } var languageVersion = options.target || 0; @@ -51745,6 +55743,9 @@ var ts; if (!options.noEmit && options.allowJs && options.declaration) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "allowJs", "declaration")); } + if (options.checkJs && !options.allowJs) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "checkJs", "allowJs")); + } if (options.emitDecoratorMetadata && !options.experimentalDecorators) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators")); @@ -51763,7 +55764,7 @@ var ts; if (!options.noEmit && !options.suppressOutputPathCheck) { var emitHost = getEmitHost(); var emitFilesSeen_1 = ts.createFileMap(!host.useCaseSensitiveFileNames() ? function (key) { return key.toLocaleLowerCase(); } : undefined); - ts.forEachExpectedEmitFile(emitHost, function (emitFileNames) { + ts.forEachEmittedFile(emitHost, function (emitFileNames) { verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen_1); verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen_1); }); @@ -51817,6 +55818,1348 @@ var ts; ts.getResolutionDiagnostic = getResolutionDiagnostic; })(ts || (ts = {})); var ts; +(function (ts) { + ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean" }; + ts.optionDeclarations = [ + { + name: "help", + shortName: "h", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Print_this_message, + }, + { + name: "help", + shortName: "?", + type: "boolean" + }, + { + name: "all", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Show_all_compiler_options, + }, + { + name: "version", + shortName: "v", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Print_the_compiler_s_version, + }, + { + name: "init", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file, + }, + { + name: "project", + shortName: "p", + type: "string", + isFilePath: true, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + paramType: ts.Diagnostics.FILE_OR_DIRECTORY, + description: ts.Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json, + }, + { + name: "pretty", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental + }, + { + name: "watch", + shortName: "w", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Watch_input_files, + }, + { + name: "target", + shortName: "t", + type: ts.createMapFromTemplate({ + "es3": 0, + "es5": 1, + "es6": 2, + "es2015": 2, + "es2016": 3, + "es2017": 4, + "esnext": 5, + }), + paramType: ts.Diagnostics.VERSION, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT, + }, + { + name: "module", + shortName: "m", + type: ts.createMapFromTemplate({ + "none": ts.ModuleKind.None, + "commonjs": ts.ModuleKind.CommonJS, + "amd": ts.ModuleKind.AMD, + "system": ts.ModuleKind.System, + "umd": ts.ModuleKind.UMD, + "es6": ts.ModuleKind.ES2015, + "es2015": ts.ModuleKind.ES2015, + }), + paramType: ts.Diagnostics.KIND, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015, + }, + { + name: "lib", + type: "list", + element: { + name: "lib", + type: ts.createMapFromTemplate({ + "es5": "lib.es5.d.ts", + "es6": "lib.es2015.d.ts", + "es2015": "lib.es2015.d.ts", + "es7": "lib.es2016.d.ts", + "es2016": "lib.es2016.d.ts", + "es2017": "lib.es2017.d.ts", + "esnext": "lib.esnext.d.ts", + "dom": "lib.dom.d.ts", + "dom.iterable": "lib.dom.iterable.d.ts", + "webworker": "lib.webworker.d.ts", + "scripthost": "lib.scripthost.d.ts", + "es2015.core": "lib.es2015.core.d.ts", + "es2015.collection": "lib.es2015.collection.d.ts", + "es2015.generator": "lib.es2015.generator.d.ts", + "es2015.iterable": "lib.es2015.iterable.d.ts", + "es2015.promise": "lib.es2015.promise.d.ts", + "es2015.proxy": "lib.es2015.proxy.d.ts", + "es2015.reflect": "lib.es2015.reflect.d.ts", + "es2015.symbol": "lib.es2015.symbol.d.ts", + "es2015.symbol.wellknown": "lib.es2015.symbol.wellknown.d.ts", + "es2016.array.include": "lib.es2016.array.include.d.ts", + "es2017.object": "lib.es2017.object.d.ts", + "es2017.sharedmemory": "lib.es2017.sharedmemory.d.ts", + "es2017.string": "lib.es2017.string.d.ts", + "esnext.asynciterable": "lib.esnext.asynciterable.d.ts", + }), + }, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon + }, + { + name: "allowJs", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Allow_javascript_files_to_be_compiled + }, + { + name: "checkJs", + type: "boolean", + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Report_errors_in_js_files + }, + { + name: "jsx", + type: ts.createMapFromTemplate({ + "preserve": 1, + "react-native": 3, + "react": 2 + }), + paramType: ts.Diagnostics.KIND, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_react_native_or_react, + }, + { + name: "declaration", + shortName: "d", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Generates_corresponding_d_ts_file, + }, + { + name: "sourceMap", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Generates_corresponding_map_file, + }, + { + name: "outFile", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.FILE, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Concatenate_and_emit_output_to_single_file, + }, + { + name: "outDir", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.DIRECTORY, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Redirect_output_structure_to_the_directory, + }, + { + name: "rootDir", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.LOCATION, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, + }, + { + name: "removeComments", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Do_not_emit_comments_to_output, + }, + { + name: "noEmit", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Do_not_emit_outputs, + }, + { + name: "importHelpers", + type: "boolean", + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Import_emit_helpers_from_tslib + }, + { + name: "downlevelIteration", + type: "boolean", + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3 + }, + { + name: "isolatedModules", + type: "boolean", + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule + }, + { + name: "strict", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Enable_all_strict_type_checking_options + }, + { + name: "noImplicitAny", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type, + }, + { + name: "strictNullChecks", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Enable_strict_null_checks + }, + { + name: "noImplicitThis", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type, + }, + { + name: "alwaysStrict", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Parse_in_strict_mode_and_emit_use_strict_for_each_source_file + }, + { + name: "noUnusedLocals", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_errors_on_unused_locals, + }, + { + name: "noUnusedParameters", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_errors_on_unused_parameters, + }, + { + name: "noImplicitReturns", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value + }, + { + name: "noFallthroughCasesInSwitch", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement + }, + { + name: "moduleResolution", + type: ts.createMapFromTemplate({ + "node": ts.ModuleResolutionKind.NodeJs, + "classic": ts.ModuleResolutionKind.Classic, + }), + paramType: ts.Diagnostics.STRATEGY, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6, + }, + { + name: "baseUrl", + type: "string", + isFilePath: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Base_directory_to_resolve_non_absolute_module_names + }, + { + name: "paths", + type: "object", + isTSConfigOnly: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl + }, + { + name: "rootDirs", + type: "list", + isTSConfigOnly: true, + element: { + name: "rootDirs", + type: "string", + isFilePath: true + }, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime + }, + { + name: "typeRoots", + type: "list", + element: { + name: "typeRoots", + type: "string", + isFilePath: true + }, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.List_of_folders_to_include_type_definitions_from + }, + { + name: "types", + type: "list", + element: { + name: "types", + type: "string" + }, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Type_declaration_files_to_be_included_in_compilation + }, + { + name: "allowSyntheticDefaultImports", + type: "boolean", + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking + }, + { + name: "sourceRoot", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.LOCATION, + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, + }, + { + name: "mapRoot", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.LOCATION, + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, + }, + { + name: "inlineSourceMap", + type: "boolean", + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file + }, + { + name: "inlineSources", + type: "boolean", + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set + }, + { + name: "experimentalDecorators", + type: "boolean", + category: ts.Diagnostics.Experimental_Options, + description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators + }, + { + name: "emitDecoratorMetadata", + type: "boolean", + category: ts.Diagnostics.Experimental_Options, + description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators + }, + { + name: "jsxFactory", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h + }, + { + name: "diagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_diagnostic_information + }, + { + name: "extendedDiagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_verbose_diagnostic_information + }, + { + name: "traceResolution", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process + }, + { + name: "listFiles", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Print_names_of_files_part_of_the_compilation + }, + { + name: "listEmittedFiles", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Print_names_of_generated_files_part_of_the_compilation + }, + { + name: "out", + type: "string", + isFilePath: false, + category: ts.Diagnostics.Advanced_Options, + paramType: ts.Diagnostics.FILE, + description: ts.Diagnostics.Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file, + }, + { + name: "reactNamespace", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit + }, + { + name: "skipDefaultLibCheck", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files + }, + { + name: "charset", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.The_character_set_of_the_input_files + }, + { + name: "emitBOM", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files + }, + { + name: "locale", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.The_locale_used_when_displaying_messages_to_the_user_e_g_en_us + }, + { + name: "newLine", + type: ts.createMapFromTemplate({ + "crlf": 0, + "lf": 1 + }), + paramType: ts.Diagnostics.NEWLINE, + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, + }, + { + name: "noErrorTruncation", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_truncate_error_messages + }, + { + name: "noLib", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_include_the_default_library_file_lib_d_ts + }, + { + name: "noResolve", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files + }, + { + name: "stripInternal", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, + }, + { + name: "disableSizeLimit", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Disable_size_limitations_on_JavaScript_projects + }, + { + name: "noImplicitUseStrict", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_emit_use_strict_directives_in_module_output + }, + { + name: "noEmitHelpers", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_generate_custom_helper_functions_like_extends_in_compiled_output + }, + { + name: "noEmitOnError", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported, + }, + { + name: "preserveConstEnums", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code + }, + { + name: "declarationDir", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.DIRECTORY, + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Output_directory_for_generated_declaration_files + }, + { + name: "skipLibCheck", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Skip_type_checking_of_declaration_files, + }, + { + name: "allowUnusedLabels", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_report_errors_on_unused_labels + }, + { + name: "allowUnreachableCode", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_report_errors_on_unreachable_code + }, + { + name: "suppressExcessPropertyErrors", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Suppress_excess_property_checks_for_object_literals, + }, + { + name: "suppressImplicitAnyIndexErrors", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures, + }, + { + name: "forceConsistentCasingInFileNames", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file + }, + { + name: "maxNodeModuleJsDepth", + type: "number", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files + }, + { + name: "plugins", + type: "list", + isTSConfigOnly: true, + element: { + name: "plugin", + type: "object" + }, + description: ts.Diagnostics.List_of_language_service_plugins + } + ]; + ts.typeAcquisitionDeclarations = [ + { + name: "enableAutoDiscovery", + type: "boolean", + }, + { + name: "enable", + type: "boolean", + }, + { + name: "include", + type: "list", + element: { + name: "include", + type: "string" + } + }, + { + name: "exclude", + type: "list", + element: { + name: "exclude", + type: "string" + } + } + ]; + ts.defaultInitCompilerOptions = { + module: ts.ModuleKind.CommonJS, + target: 1, + strict: true + }; + var optionNameMapCache; + function convertEnableAutoDiscoveryToEnable(typeAcquisition) { + if (typeAcquisition && typeAcquisition.enableAutoDiscovery !== undefined && typeAcquisition.enable === undefined) { + var result = { + enable: typeAcquisition.enableAutoDiscovery, + include: typeAcquisition.include || [], + exclude: typeAcquisition.exclude || [] + }; + return result; + } + return typeAcquisition; + } + ts.convertEnableAutoDiscoveryToEnable = convertEnableAutoDiscoveryToEnable; + function getOptionNameMap() { + if (optionNameMapCache) { + return optionNameMapCache; + } + var optionNameMap = ts.createMap(); + var shortOptionNames = ts.createMap(); + ts.forEach(ts.optionDeclarations, function (option) { + optionNameMap.set(option.name.toLowerCase(), option); + if (option.shortName) { + shortOptionNames.set(option.shortName, option.name); + } + }); + optionNameMapCache = { optionNameMap: optionNameMap, shortOptionNames: shortOptionNames }; + return optionNameMapCache; + } + ts.getOptionNameMap = getOptionNameMap; + function createCompilerDiagnosticForInvalidCustomType(opt) { + var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'" + key + "'"; }).join(", "); + return ts.createCompilerDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType); + } + ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType; + function parseCustomTypeOption(opt, value, errors) { + return convertJsonOptionOfCustomType(opt, trimString(value || ""), errors); + } + ts.parseCustomTypeOption = parseCustomTypeOption; + function parseListTypeOption(opt, value, errors) { + if (value === void 0) { value = ""; } + value = trimString(value); + if (ts.startsWith(value, "-")) { + return undefined; + } + if (value === "") { + return []; + } + var values = value.split(","); + switch (opt.element.type) { + case "number": + return ts.map(values, parseInt); + case "string": + return ts.map(values, function (v) { return v || ""; }); + default: + return ts.filter(ts.map(values, function (v) { return parseCustomTypeOption(opt.element, v, errors); }), function (v) { return !!v; }); + } + } + ts.parseListTypeOption = parseListTypeOption; + function parseCommandLine(commandLine, readFile) { + var options = {}; + var fileNames = []; + var errors = []; + var _a = getOptionNameMap(), optionNameMap = _a.optionNameMap, shortOptionNames = _a.shortOptionNames; + parseStrings(commandLine); + return { + options: options, + fileNames: fileNames, + errors: errors + }; + function parseStrings(args) { + var i = 0; + while (i < args.length) { + var s = args[i]; + i++; + if (s.charCodeAt(0) === 64) { + parseResponseFile(s.slice(1)); + } + else if (s.charCodeAt(0) === 45) { + s = s.slice(s.charCodeAt(1) === 45 ? 2 : 1).toLowerCase(); + var short = shortOptionNames.get(s); + if (short !== undefined) { + s = short; + } + var opt = optionNameMap.get(s); + if (opt) { + if (opt.isTSConfigOnly) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file, opt.name)); + } + else { + if (!args[i] && opt.type !== "boolean") { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_expects_an_argument, opt.name)); + } + switch (opt.type) { + case "number": + options[opt.name] = parseInt(args[i]); + i++; + break; + case "boolean": + var optValue = args[i]; + options[opt.name] = optValue !== "false"; + if (optValue === "false" || optValue === "true") { + i++; + } + break; + case "string": + options[opt.name] = args[i] || ""; + i++; + break; + case "list": + var result = parseListTypeOption(opt, args[i], errors); + options[opt.name] = result || []; + if (result) { + i++; + } + break; + default: + options[opt.name] = parseCustomTypeOption(opt, args[i], errors); + i++; + break; + } + } + } + else { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_compiler_option_0, s)); + } + } + else { + fileNames.push(s); + } + } + } + function parseResponseFile(fileName) { + var text = readFile ? readFile(fileName) : ts.sys.readFile(fileName); + if (!text) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_not_found, fileName)); + return; + } + var args = []; + var pos = 0; + while (true) { + while (pos < text.length && text.charCodeAt(pos) <= 32) + pos++; + if (pos >= text.length) + break; + var start = pos; + if (text.charCodeAt(start) === 34) { + pos++; + while (pos < text.length && text.charCodeAt(pos) !== 34) + pos++; + if (pos < text.length) { + args.push(text.substring(start + 1, pos)); + pos++; + } + else { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unterminated_quoted_string_in_response_file_0, fileName)); + } + } + else { + while (text.charCodeAt(pos) > 32) + pos++; + args.push(text.substring(start, pos)); + } + } + parseStrings(args); + } + } + ts.parseCommandLine = parseCommandLine; + function readConfigFile(fileName, readFile) { + var text = ""; + try { + text = readFile(fileName); + } + catch (e) { + return { error: ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message) }; + } + return parseConfigFileTextToJson(fileName, text); + } + ts.readConfigFile = readConfigFile; + function parseConfigFileTextToJson(fileName, jsonText, stripComments) { + if (stripComments === void 0) { stripComments = true; } + try { + var jsonTextToParse = stripComments ? removeComments(jsonText) : jsonText; + return { config: /\S/.test(jsonTextToParse) ? JSON.parse(jsonTextToParse) : {} }; + } + catch (e) { + return { error: ts.createCompilerDiagnostic(ts.Diagnostics.Failed_to_parse_file_0_Colon_1, fileName, e.message) }; + } + } + ts.parseConfigFileTextToJson = parseConfigFileTextToJson; + function generateTSConfig(options, fileNames, newLine) { + var compilerOptions = ts.extend(options, ts.defaultInitCompilerOptions); + var configurations = { + compilerOptions: serializeCompilerOptions(compilerOptions) + }; + if (fileNames && fileNames.length) { + configurations.files = fileNames; + } + return writeConfigurations(); + function getCustomTypeMapOfCommandLineOption(optionDefinition) { + if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean") { + return undefined; + } + else if (optionDefinition.type === "list") { + return getCustomTypeMapOfCommandLineOption(optionDefinition.element); + } + else { + return optionDefinition.type; + } + } + function getNameOfCompilerOptionValue(value, customTypeMap) { + return ts.forEachEntry(customTypeMap, function (mapValue, key) { + if (mapValue === value) { + return key; + } + }); + } + function serializeCompilerOptions(options) { + var result = {}; + var optionsNameMap = getOptionNameMap().optionNameMap; + for (var name in options) { + if (ts.hasProperty(options, name)) { + if (optionsNameMap.has(name) && optionsNameMap.get(name).category === ts.Diagnostics.Command_line_Options) { + continue; + } + var value = options[name]; + var optionDefinition = optionsNameMap.get(name.toLowerCase()); + if (optionDefinition) { + var customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition); + if (!customTypeMap) { + result[name] = value; + } + else { + if (optionDefinition.type === "list") { + var convertedValue = []; + for (var _i = 0, _a = value; _i < _a.length; _i++) { + var element = _a[_i]; + convertedValue.push(getNameOfCompilerOptionValue(element, customTypeMap)); + } + result[name] = convertedValue; + } + else { + result[name] = getNameOfCompilerOptionValue(value, customTypeMap); + } + } + } + } + } + return result; + } + function getDefaultValueForOption(option) { + switch (option.type) { + case "number": + return 1; + case "boolean": + return true; + case "string": + return option.isFilePath ? "./" : ""; + case "list": + return []; + case "object": + return {}; + default: + return ts.arrayFrom(option.type.keys())[0]; + } + } + function makePadding(paddingLength) { + return Array(paddingLength + 1).join(" "); + } + function writeConfigurations() { + var categorizedOptions = ts.reduceLeft(ts.filter(ts.optionDeclarations, function (o) { return o.category !== ts.Diagnostics.Command_line_Options && o.category !== ts.Diagnostics.Advanced_Options; }), function (memo, value) { + if (value.category) { + var name = ts.getLocaleSpecificMessage(value.category); + (memo[name] || (memo[name] = [])).push(value); + } + return memo; + }, {}); + var marginLength = 0; + var seenKnownKeys = 0; + var nameColumn = []; + var descriptionColumn = []; + var knownKeysCount = ts.getOwnKeys(configurations.compilerOptions).length; + for (var category in categorizedOptions) { + if (nameColumn.length !== 0) { + nameColumn.push(""); + descriptionColumn.push(""); + } + nameColumn.push("/* " + category + " */"); + descriptionColumn.push(""); + for (var _i = 0, _a = categorizedOptions[category]; _i < _a.length; _i++) { + var option = _a[_i]; + var optionName = void 0; + if (ts.hasProperty(configurations.compilerOptions, option.name)) { + optionName = "\"" + option.name + "\": " + JSON.stringify(configurations.compilerOptions[option.name]) + ((seenKnownKeys += 1) === knownKeysCount ? "" : ","); + } + else { + optionName = "// \"" + option.name + "\": " + JSON.stringify(getDefaultValueForOption(option)) + ","; + } + nameColumn.push(optionName); + descriptionColumn.push("/* " + (option.description && ts.getLocaleSpecificMessage(option.description) || option.name) + " */"); + marginLength = Math.max(optionName.length, marginLength); + } + } + var tab = makePadding(2); + var result = []; + result.push("{"); + result.push(tab + "\"compilerOptions\": {"); + for (var i = 0; i < nameColumn.length; i++) { + var optionName = nameColumn[i]; + var description = descriptionColumn[i]; + result.push(tab + tab + optionName + makePadding(marginLength - optionName.length + 2) + description); + } + if (configurations.files && configurations.files.length) { + result.push(tab + "},"); + result.push(tab + "\"files\": ["); + for (var i = 0; i < configurations.files.length; i++) { + result.push("" + tab + tab + JSON.stringify(configurations.files[i]) + (i === configurations.files.length - 1 ? "" : ",")); + } + result.push(tab + "]"); + } + else { + result.push(tab + "}"); + } + result.push("}"); + return result.join(newLine); + } + } + ts.generateTSConfig = generateTSConfig; + function removeComments(jsonText) { + var output = ""; + var scanner = ts.createScanner(1, false, 0, jsonText); + var token; + while ((token = scanner.scan()) !== 1) { + switch (token) { + case 2: + case 3: + output += scanner.getTokenText().replace(/\S/g, " "); + break; + default: + output += scanner.getTokenText(); + break; + } + } + return output; + } + function parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions) { + if (existingOptions === void 0) { existingOptions = {}; } + if (resolutionStack === void 0) { resolutionStack = []; } + if (extraFileExtensions === void 0) { extraFileExtensions = []; } + var errors = []; + basePath = ts.normalizeSlashes(basePath); + var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames); + var resolvedPath = ts.toPath(configFileName || "", basePath, getCanonicalFileName); + if (resolutionStack.indexOf(resolvedPath) >= 0) { + return { + options: {}, + fileNames: [], + typeAcquisition: {}, + raw: json, + errors: [ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, resolutionStack.concat([resolvedPath]).join(" -> "))], + wildcardDirectories: {} + }; + } + var options = convertCompilerOptionsFromJsonWorker(json["compilerOptions"], basePath, errors, configFileName); + var jsonOptions = json["typeAcquisition"] || json["typingOptions"]; + var typeAcquisition = convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName); + if (json["extends"]) { + var _a = [undefined, undefined, undefined, {}], include = _a[0], exclude = _a[1], files = _a[2], baseOptions = _a[3]; + if (typeof json["extends"] === "string") { + _b = (tryExtendsName(json["extends"]) || [include, exclude, files, baseOptions]), include = _b[0], exclude = _b[1], files = _b[2], baseOptions = _b[3]; + } + else { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", "string")); + } + if (include && !json["include"]) { + json["include"] = include; + } + if (exclude && !json["exclude"]) { + json["exclude"] = exclude; + } + if (files && !json["files"]) { + json["files"] = files; + } + options = ts.assign({}, baseOptions, options); + } + options = ts.extend(existingOptions, options); + options.configFilePath = configFileName; + var _c = getFileNames(errors), fileNames = _c.fileNames, wildcardDirectories = _c.wildcardDirectories; + var compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors); + return { + options: options, + fileNames: fileNames, + typeAcquisition: typeAcquisition, + raw: json, + errors: errors, + wildcardDirectories: wildcardDirectories, + compileOnSave: compileOnSave + }; + function tryExtendsName(extendedConfig) { + if (!(ts.isRootedDiskPath(extendedConfig) || ts.startsWith(ts.normalizeSlashes(extendedConfig), "./") || ts.startsWith(ts.normalizeSlashes(extendedConfig), "../"))) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not, extendedConfig)); + return; + } + var extendedConfigPath = ts.toPath(extendedConfig, basePath, getCanonicalFileName); + if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json")) { + extendedConfigPath = extendedConfigPath + ".json"; + if (!host.fileExists(extendedConfigPath)) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_does_not_exist, extendedConfig)); + return; + } + } + var extendedResult = readConfigFile(extendedConfigPath, function (path) { return host.readFile(path); }); + if (extendedResult.error) { + errors.push(extendedResult.error); + return; + } + var extendedDirname = ts.getDirectoryPath(extendedConfigPath); + var relativeDifference = ts.convertToRelativePath(extendedDirname, basePath, getCanonicalFileName); + var updatePath = function (path) { return ts.isRootedDiskPath(path) ? path : ts.combinePaths(relativeDifference, path); }; + var result = parseJsonConfigFileContent(extendedResult.config, host, extendedDirname, undefined, ts.getBaseFileName(extendedConfigPath), resolutionStack.concat([resolvedPath])); + errors.push.apply(errors, result.errors); + var _a = ts.map(["include", "exclude", "files"], function (key) { + if (!json[key] && extendedResult.config[key]) { + return ts.map(extendedResult.config[key], updatePath); + } + }), include = _a[0], exclude = _a[1], files = _a[2]; + return [include, exclude, files, result.options]; + } + function getFileNames(errors) { + var fileNames; + if (ts.hasProperty(json, "files")) { + if (ts.isArray(json["files"])) { + fileNames = json["files"]; + if (fileNames.length === 0) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.The_files_list_in_config_file_0_is_empty, configFileName || "tsconfig.json")); + } + } + else { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "files", "Array")); + } + } + var includeSpecs; + if (ts.hasProperty(json, "include")) { + if (ts.isArray(json["include"])) { + includeSpecs = json["include"]; + } + else { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "include", "Array")); + } + } + var excludeSpecs; + if (ts.hasProperty(json, "exclude")) { + if (ts.isArray(json["exclude"])) { + excludeSpecs = json["exclude"]; + } + else { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "exclude", "Array")); + } + } + else if (ts.hasProperty(json, "excludes")) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)); + } + else { + excludeSpecs = includeSpecs ? [] : ["node_modules", "bower_components", "jspm_packages"]; + var outDir = json["compilerOptions"] && json["compilerOptions"]["outDir"]; + if (outDir) { + excludeSpecs.push(outDir); + } + } + if (fileNames === undefined && includeSpecs === undefined) { + includeSpecs = ["**/*"]; + } + var result = matchFileNames(fileNames, includeSpecs, excludeSpecs, basePath, options, host, errors, extraFileExtensions); + if (result.fileNames.length === 0 && !ts.hasProperty(json, "files") && resolutionStack.length === 0) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, configFileName || "tsconfig.json", JSON.stringify(includeSpecs || []), JSON.stringify(excludeSpecs || []))); + } + return result; + } + var _b; + } + ts.parseJsonConfigFileContent = parseJsonConfigFileContent; + function convertCompileOnSaveOptionFromJson(jsonOption, basePath, errors) { + if (!ts.hasProperty(jsonOption, ts.compileOnSaveCommandLineOption.name)) { + return false; + } + var result = convertJsonOption(ts.compileOnSaveCommandLineOption, jsonOption["compileOnSave"], basePath, errors); + if (typeof result === "boolean" && result) { + return result; + } + return false; + } + ts.convertCompileOnSaveOptionFromJson = convertCompileOnSaveOptionFromJson; + function convertCompilerOptionsFromJson(jsonOptions, basePath, configFileName) { + var errors = []; + var options = convertCompilerOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName); + return { options: options, errors: errors }; + } + ts.convertCompilerOptionsFromJson = convertCompilerOptionsFromJson; + function convertTypeAcquisitionFromJson(jsonOptions, basePath, configFileName) { + var errors = []; + var options = convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName); + return { options: options, errors: errors }; + } + ts.convertTypeAcquisitionFromJson = convertTypeAcquisitionFromJson; + function convertCompilerOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName) { + var options = ts.getBaseFileName(configFileName) === "jsconfig.json" + ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true } + : {}; + convertOptionsFromJson(ts.optionDeclarations, jsonOptions, basePath, options, ts.Diagnostics.Unknown_compiler_option_0, errors); + return options; + } + function convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName) { + var options = { enable: ts.getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] }; + var typeAcquisition = convertEnableAutoDiscoveryToEnable(jsonOptions); + convertOptionsFromJson(ts.typeAcquisitionDeclarations, typeAcquisition, basePath, options, ts.Diagnostics.Unknown_type_acquisition_option_0, errors); + return options; + } + function convertOptionsFromJson(optionDeclarations, jsonOptions, basePath, defaultOptions, diagnosticMessage, errors) { + if (!jsonOptions) { + return; + } + var optionNameMap = ts.arrayToMap(optionDeclarations, function (opt) { return opt.name; }); + for (var id in jsonOptions) { + var opt = optionNameMap.get(id); + if (opt) { + defaultOptions[opt.name] = convertJsonOption(opt, jsonOptions[id], basePath, errors); + } + else { + errors.push(ts.createCompilerDiagnostic(diagnosticMessage, id)); + } + } + } + function convertJsonOption(opt, value, basePath, errors) { + var optType = opt.type; + var expectedType = typeof optType === "string" ? optType : "string"; + if (optType === "list" && ts.isArray(value)) { + return convertJsonOptionOfListType(opt, value, basePath, errors); + } + else if (typeof value === expectedType) { + if (typeof optType !== "string") { + return convertJsonOptionOfCustomType(opt, value, errors); + } + else { + if (opt.isFilePath) { + value = ts.normalizePath(ts.combinePaths(basePath, value)); + if (value === "") { + value = "."; + } + } + } + return value; + } + else { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, opt.name, expectedType)); + } + } + function convertJsonOptionOfCustomType(opt, value, errors) { + var key = value.toLowerCase(); + var val = opt.type.get(key); + if (val !== undefined) { + return val; + } + else { + errors.push(createCompilerDiagnosticForInvalidCustomType(opt)); + } + } + function convertJsonOptionOfListType(option, values, basePath, errors) { + return ts.filter(ts.map(values, function (v) { return convertJsonOption(option.element, v, basePath, errors); }), function (v) { return !!v; }); + } + function trimString(s) { + return typeof s.trim === "function" ? s.trim() : s.replace(/^[\s]+|[\s]+$/g, ""); + } + var invalidTrailingRecursionPattern = /(^|\/)\*\*\/?$/; + var invalidMultipleRecursionPatterns = /(^|\/)\*\*\/(.*\/)?\*\*($|\/)/; + var invalidDotDotAfterRecursiveWildcardPattern = /(^|\/)\*\*\/(.*\/)?\.\.($|\/)/; + var watchRecursivePattern = /\/[^/]*?[*?][^/]*\//; + var wildcardDirectoryPattern = /^[^*?]*(?=\/[^/]*[*?])/; + function matchFileNames(fileNames, include, exclude, basePath, options, host, errors, extraFileExtensions) { + basePath = ts.normalizePath(basePath); + var keyMapper = host.useCaseSensitiveFileNames ? caseSensitiveKeyMapper : caseInsensitiveKeyMapper; + var literalFileMap = ts.createMap(); + var wildcardFileMap = ts.createMap(); + if (include) { + include = validateSpecs(include, errors, false); + } + if (exclude) { + exclude = validateSpecs(exclude, errors, true); + } + var wildcardDirectories = getWildcardDirectories(include, exclude, basePath, host.useCaseSensitiveFileNames); + var supportedExtensions = ts.getSupportedExtensions(options, extraFileExtensions); + if (fileNames) { + for (var _i = 0, fileNames_1 = fileNames; _i < fileNames_1.length; _i++) { + var fileName = fileNames_1[_i]; + var file = ts.combinePaths(basePath, fileName); + literalFileMap.set(keyMapper(file), file); + } + } + if (include && include.length > 0) { + for (var _a = 0, _b = host.readDirectory(basePath, supportedExtensions, exclude, include); _a < _b.length; _a++) { + var file = _b[_a]; + if (hasFileWithHigherPriorityExtension(file, literalFileMap, wildcardFileMap, supportedExtensions, keyMapper)) { + continue; + } + removeWildcardFilesWithLowerPriorityExtension(file, wildcardFileMap, supportedExtensions, keyMapper); + var key = keyMapper(file); + if (!literalFileMap.has(key) && !wildcardFileMap.has(key)) { + wildcardFileMap.set(key, file); + } + } + } + var literalFiles = ts.arrayFrom(literalFileMap.values()); + var wildcardFiles = ts.arrayFrom(wildcardFileMap.values()); + return { + fileNames: literalFiles.concat(wildcardFiles), + wildcardDirectories: wildcardDirectories + }; + } + function validateSpecs(specs, errors, allowTrailingRecursion) { + var validSpecs = []; + for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) { + var spec = specs_1[_i]; + if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); + } + else if (invalidMultipleRecursionPatterns.test(spec)) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0, spec)); + } + else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); + } + else { + validSpecs.push(spec); + } + } + return validSpecs; + } + function getWildcardDirectories(include, exclude, path, useCaseSensitiveFileNames) { + var rawExcludeRegex = ts.getRegularExpressionForWildcard(exclude, path, "exclude"); + var excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames ? "" : "i"); + var wildcardDirectories = {}; + if (include !== undefined) { + var recursiveKeys = []; + for (var _i = 0, include_1 = include; _i < include_1.length; _i++) { + var file = include_1[_i]; + var spec = ts.normalizePath(ts.combinePaths(path, file)); + if (excludeRegex && excludeRegex.test(spec)) { + continue; + } + var match = getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames); + if (match) { + var key = match.key, flags = match.flags; + var existingFlags = wildcardDirectories[key]; + if (existingFlags === undefined || existingFlags < flags) { + wildcardDirectories[key] = flags; + if (flags === 1) { + recursiveKeys.push(key); + } + } + } + } + for (var key in wildcardDirectories) + if (ts.hasProperty(wildcardDirectories, key)) { + for (var _a = 0, recursiveKeys_1 = recursiveKeys; _a < recursiveKeys_1.length; _a++) { + var recursiveKey = recursiveKeys_1[_a]; + if (key !== recursiveKey && ts.containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) { + delete wildcardDirectories[key]; + } + } + } + } + return wildcardDirectories; + } + function getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames) { + var match = wildcardDirectoryPattern.exec(spec); + if (match) { + return { + key: useCaseSensitiveFileNames ? match[0] : match[0].toLowerCase(), + flags: watchRecursivePattern.test(spec) ? 1 : 0 + }; + } + if (ts.isImplicitGlob(spec)) { + return { key: spec, flags: 1 }; + } + return undefined; + } + function hasFileWithHigherPriorityExtension(file, literalFiles, wildcardFiles, extensions, keyMapper) { + var extensionPriority = ts.getExtensionPriority(file, extensions); + var adjustedExtensionPriority = ts.adjustExtensionPriority(extensionPriority, extensions); + for (var i = 0; i < adjustedExtensionPriority; i++) { + var higherPriorityExtension = extensions[i]; + var higherPriorityPath = keyMapper(ts.changeExtension(file, higherPriorityExtension)); + if (literalFiles.has(higherPriorityPath) || wildcardFiles.has(higherPriorityPath)) { + return true; + } + } + return false; + } + function removeWildcardFilesWithLowerPriorityExtension(file, wildcardFiles, extensions, keyMapper) { + var extensionPriority = ts.getExtensionPriority(file, extensions); + var nextExtensionPriority = ts.getNextLowestExtensionPriority(extensionPriority, extensions); + for (var i = nextExtensionPriority; i < extensions.length; i++) { + var lowerPriorityExtension = extensions[i]; + var lowerPriorityPath = keyMapper(ts.changeExtension(file, lowerPriorityExtension)); + wildcardFiles.delete(lowerPriorityPath); + } + } + function caseSensitiveKeyMapper(key) { + return key; + } + function caseInsensitiveKeyMapper(key) { + return key.toLowerCase(); + } +})(ts || (ts = {})); +var ts; (function (ts) { var ScriptSnapshot; (function (ScriptSnapshot) { @@ -51825,7 +57168,9 @@ var ts; this.text = text; } StringScriptSnapshot.prototype.getText = function (start, end) { - return this.text.substring(start, end); + return start === 0 && end === this.text.length + ? this.text + : this.text.substring(start, end); }; StringScriptSnapshot.prototype.getLength = function () { return this.text.length; @@ -51884,6 +57229,22 @@ var ts; SymbolDisplayPartKind[SymbolDisplayPartKind["functionName"] = 20] = "functionName"; SymbolDisplayPartKind[SymbolDisplayPartKind["regularExpressionLiteral"] = 21] = "regularExpressionLiteral"; })(SymbolDisplayPartKind = ts.SymbolDisplayPartKind || (ts.SymbolDisplayPartKind = {})); + var OutputFileType; + (function (OutputFileType) { + OutputFileType[OutputFileType["JavaScript"] = 0] = "JavaScript"; + OutputFileType[OutputFileType["SourceMap"] = 1] = "SourceMap"; + OutputFileType[OutputFileType["Declaration"] = 2] = "Declaration"; + })(OutputFileType = ts.OutputFileType || (ts.OutputFileType = {})); + var EndOfLineState; + (function (EndOfLineState) { + EndOfLineState[EndOfLineState["None"] = 0] = "None"; + EndOfLineState[EndOfLineState["InMultiLineCommentTrivia"] = 1] = "InMultiLineCommentTrivia"; + EndOfLineState[EndOfLineState["InSingleQuoteStringLiteral"] = 2] = "InSingleQuoteStringLiteral"; + EndOfLineState[EndOfLineState["InDoubleQuoteStringLiteral"] = 3] = "InDoubleQuoteStringLiteral"; + EndOfLineState[EndOfLineState["InTemplateHeadOrNoSubstitutionTemplate"] = 4] = "InTemplateHeadOrNoSubstitutionTemplate"; + EndOfLineState[EndOfLineState["InTemplateMiddleOrTail"] = 5] = "InTemplateMiddleOrTail"; + EndOfLineState[EndOfLineState["InTemplateSubstitutionPosition"] = 6] = "InTemplateSubstitutionPosition"; + })(EndOfLineState = ts.EndOfLineState || (ts.EndOfLineState = {})); var TokenClass; (function (TokenClass) { TokenClass[TokenClass["Punctuation"] = 0] = "Punctuation"; @@ -51908,7 +57269,7 @@ var ts; ScriptElementKind.interfaceElement = "interface"; ScriptElementKind.typeElement = "type"; ScriptElementKind.enumElement = "enum"; - ScriptElementKind.enumMemberElement = "const"; + ScriptElementKind.enumMemberElement = "enum member"; ScriptElementKind.variableElement = "var"; ScriptElementKind.localVariableElement = "local var"; ScriptElementKind.functionElement = "function"; @@ -51930,6 +57291,7 @@ var ts; ScriptElementKind.letElement = "let"; ScriptElementKind.directory = "directory"; ScriptElementKind.externalModuleName = "external module name"; + ScriptElementKind.jsxAttribute = "JSX attribute"; })(ScriptElementKind = ts.ScriptElementKind || (ts.ScriptElementKind = {})); var ScriptElementKindModifier; (function (ScriptElementKindModifier) { @@ -51971,40 +57333,76 @@ var ts; ClassificationTypeNames.jsxText = "jsx text"; ClassificationTypeNames.jsxAttributeStringLiteralValue = "jsx attribute string literal value"; ts.ClassificationTypeNames = ClassificationTypeNames; + var ClassificationType; + (function (ClassificationType) { + ClassificationType[ClassificationType["comment"] = 1] = "comment"; + ClassificationType[ClassificationType["identifier"] = 2] = "identifier"; + ClassificationType[ClassificationType["keyword"] = 3] = "keyword"; + ClassificationType[ClassificationType["numericLiteral"] = 4] = "numericLiteral"; + ClassificationType[ClassificationType["operator"] = 5] = "operator"; + ClassificationType[ClassificationType["stringLiteral"] = 6] = "stringLiteral"; + ClassificationType[ClassificationType["regularExpressionLiteral"] = 7] = "regularExpressionLiteral"; + ClassificationType[ClassificationType["whiteSpace"] = 8] = "whiteSpace"; + ClassificationType[ClassificationType["text"] = 9] = "text"; + ClassificationType[ClassificationType["punctuation"] = 10] = "punctuation"; + ClassificationType[ClassificationType["className"] = 11] = "className"; + ClassificationType[ClassificationType["enumName"] = 12] = "enumName"; + ClassificationType[ClassificationType["interfaceName"] = 13] = "interfaceName"; + ClassificationType[ClassificationType["moduleName"] = 14] = "moduleName"; + ClassificationType[ClassificationType["typeParameterName"] = 15] = "typeParameterName"; + ClassificationType[ClassificationType["typeAliasName"] = 16] = "typeAliasName"; + ClassificationType[ClassificationType["parameterName"] = 17] = "parameterName"; + ClassificationType[ClassificationType["docCommentTagName"] = 18] = "docCommentTagName"; + ClassificationType[ClassificationType["jsxOpenTagName"] = 19] = "jsxOpenTagName"; + ClassificationType[ClassificationType["jsxCloseTagName"] = 20] = "jsxCloseTagName"; + ClassificationType[ClassificationType["jsxSelfClosingTagName"] = 21] = "jsxSelfClosingTagName"; + ClassificationType[ClassificationType["jsxAttribute"] = 22] = "jsxAttribute"; + ClassificationType[ClassificationType["jsxText"] = 23] = "jsxText"; + ClassificationType[ClassificationType["jsxAttributeStringLiteralValue"] = 24] = "jsxAttributeStringLiteralValue"; + })(ClassificationType = ts.ClassificationType || (ts.ClassificationType = {})); })(ts || (ts = {})); var ts; (function (ts) { ts.scanner = ts.createScanner(5, true); ts.emptyArray = []; + var SemanticMeaning; + (function (SemanticMeaning) { + SemanticMeaning[SemanticMeaning["None"] = 0] = "None"; + SemanticMeaning[SemanticMeaning["Value"] = 1] = "Value"; + SemanticMeaning[SemanticMeaning["Type"] = 2] = "Type"; + SemanticMeaning[SemanticMeaning["Namespace"] = 4] = "Namespace"; + SemanticMeaning[SemanticMeaning["All"] = 7] = "All"; + })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 144: - case 223: - case 174: - case 147: - case 146: - case 257: - case 258: - case 260: - case 149: + case 145: + case 225: + case 175: case 148: + case 147: + case 260: + case 261: + case 263: case 150: + case 149: case 151: case 152: - case 225: - case 184: - case 185: - case 256: - return 1; - case 143: + case 153: case 227: - case 228: - case 161: - return 2; - case 226: + case 185: + case 186: + case 259: + case 252: + return 1; + case 144: case 229: - return 1 | 2; case 230: + case 162: + return 2; + case 228: + case 231: + return 1 | 2; + case 232: if (ts.isAmbientModule(node)) { return 4 | 1; } @@ -52014,21 +57412,24 @@ var ts; else { return 4; } - case 238: - case 239: - case 234: - case 235: case 240: case 241: + case 236: + case 237: + case 242: + case 243: return 1 | 2 | 4; - case 261: + case 264: return 4 | 1; } return 1 | 2 | 4; } ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { - if (node.parent.kind === 240) { + if (node.kind === 264) { + return 1; + } + else if (node.parent.kind === 242) { return 1 | 2 | 4; } else if (isInRightSideOfImport(node)) { @@ -52050,15 +57451,15 @@ var ts; ts.getMeaningFromLocation = getMeaningFromLocation; function getMeaningFromRightHandSideOfImportEquals(node) { ts.Debug.assert(node.kind === 70); - if (node.parent.kind === 141 && + if (node.parent.kind === 142 && node.parent.right === node && - node.parent.parent.kind === 234) { + node.parent.parent.kind === 236) { return 1 | 2 | 4; } return 4; } function isInRightSideOfImport(node) { - while (node.parent.kind === 141) { + while (node.parent.kind === 142) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -52069,27 +57470,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 141) { - while (root.parent && root.parent.kind === 141) { + if (root.parent.kind === 142) { + while (root.parent && root.parent.kind === 142) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 157 && !isLastClause; + return root.parent.kind === 158 && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 177) { - while (root.parent && root.parent.kind === 177) { + if (root.parent.kind === 178) { + while (root.parent && root.parent.kind === 178) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 199 && root.parent.parent.kind === 255) { + if (!isLastClause && root.parent.kind === 200 && root.parent.parent.kind === 258) { var decl = root.parent.parent.parent; - return (decl.kind === 226 && root.parent.parent.token === 107) || - (decl.kind === 227 && root.parent.parent.token === 84); + return (decl.kind === 228 && root.parent.parent.token === 107) || + (decl.kind === 229 && root.parent.parent.token === 84); } return false; } @@ -52097,17 +57498,17 @@ var ts; if (ts.isRightSideOfQualifiedNameOrPropertyAccess(node)) { node = node.parent; } - return node.parent.kind === 157 || - (node.parent.kind === 199 && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || + return node.parent.kind === 158 || + (node.parent.kind === 200 && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || (node.kind === 98 && !ts.isPartOfExpression(node)) || - node.kind === 167; + node.kind === 168; } function isCallExpressionTarget(node) { - return isCallOrNewExpressionTarget(node, 179); + return isCallOrNewExpressionTarget(node, 180); } ts.isCallExpressionTarget = isCallExpressionTarget; function isNewExpressionTarget(node) { - return isCallOrNewExpressionTarget(node, 180); + return isCallOrNewExpressionTarget(node, 181); } ts.isNewExpressionTarget = isNewExpressionTarget; function isCallOrNewExpressionTarget(node, kind) { @@ -52120,7 +57521,7 @@ var ts; ts.climbPastPropertyAccess = climbPastPropertyAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 219 && referenceNode.label.text === labelName) { + if (referenceNode.kind === 221 && referenceNode.label.text === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -52130,13 +57531,13 @@ var ts; ts.getTargetLabel = getTargetLabel; function isJumpStatementTarget(node) { return node.kind === 70 && - (node.parent.kind === 215 || node.parent.kind === 214) && + (node.parent.kind === 217 || node.parent.kind === 216) && node.parent.label === node; } ts.isJumpStatementTarget = isJumpStatementTarget; function isLabelOfLabeledStatement(node) { return node.kind === 70 && - node.parent.kind === 219 && + node.parent.kind === 221 && node.parent.label === node; } function isLabelName(node) { @@ -52144,15 +57545,15 @@ var ts; } ts.isLabelName = isLabelName; function isRightSideOfQualifiedName(node) { - return node.parent.kind === 141 && node.parent.right === node; + return node.parent.kind === 142 && node.parent.right === node; } ts.isRightSideOfQualifiedName = isRightSideOfQualifiedName; function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 177 && node.parent.name === node; + return node && node.parent && node.parent.kind === 178 && node.parent.name === node; } ts.isRightSideOfPropertyAccess = isRightSideOfPropertyAccess; function isNameOfModuleDeclaration(node) { - return node.parent.kind === 230 && node.parent.name === node; + return node.parent.kind === 232 && node.parent.name === node; } ts.isNameOfModuleDeclaration = isNameOfModuleDeclaration; function isNameOfFunctionDeclaration(node) { @@ -52163,19 +57564,19 @@ var ts; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 9 || node.kind === 8) { switch (node.parent.kind) { - case 147: - case 146: - case 257: - case 260: - case 149: case 148: - case 151: + case 147: + case 260: + case 263: + case 150: + case 149: case 152: - case 230: + case 153: + case 232: return node.parent.name === node; - case 178: + case 179: return node.parent.argumentExpression === node; - case 142: + case 143: return true; } } @@ -52219,17 +57620,17 @@ var ts; return undefined; } switch (node.kind) { - case 261: + case 264: + case 150: case 149: - case 148: - case 225: - case 184: - case 151: - case 152: - case 226: case 227: + case 185: + case 152: + case 153: + case 228: case 229: - case 230: + case 231: + case 232: return node; } } @@ -52237,46 +57638,46 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 261: + case 264: return ts.isExternalModule(node) ? ts.ScriptElementKind.moduleElement : ts.ScriptElementKind.scriptElement; - case 230: + case 232: return ts.ScriptElementKind.moduleElement; - case 226: - case 197: + case 228: + case 198: return ts.ScriptElementKind.classElement; - case 227: return ts.ScriptElementKind.interfaceElement; - case 228: return ts.ScriptElementKind.typeElement; - case 229: return ts.ScriptElementKind.enumElement; - case 223: - return getKindOfVariableDeclaration(node); - case 174: - return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 185: + case 229: return ts.ScriptElementKind.interfaceElement; + case 230: return ts.ScriptElementKind.typeElement; + case 231: return ts.ScriptElementKind.enumElement; case 225: - case 184: + return getKindOfVariableDeclaration(node); + case 175: + return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); + case 186: + case 227: + case 185: return ts.ScriptElementKind.functionElement; - case 151: return ts.ScriptElementKind.memberGetAccessorElement; - case 152: return ts.ScriptElementKind.memberSetAccessorElement; + case 152: return ts.ScriptElementKind.memberGetAccessorElement; + case 153: return ts.ScriptElementKind.memberSetAccessorElement; + case 150: case 149: - case 148: return ts.ScriptElementKind.memberFunctionElement; + case 148: case 147: - case 146: return ts.ScriptElementKind.memberVariableElement; - case 155: return ts.ScriptElementKind.indexSignatureElement; - case 154: return ts.ScriptElementKind.constructSignatureElement; - case 153: return ts.ScriptElementKind.callSignatureElement; - case 150: return ts.ScriptElementKind.constructorImplementationElement; - case 143: return ts.ScriptElementKind.typeParameterElement; - case 260: return ts.ScriptElementKind.enumMemberElement; - case 144: return ts.hasModifier(node, 92) ? ts.ScriptElementKind.memberVariableElement : ts.ScriptElementKind.parameterElement; - case 234: - case 239: + case 156: return ts.ScriptElementKind.indexSignatureElement; + case 155: return ts.ScriptElementKind.constructSignatureElement; + case 154: return ts.ScriptElementKind.callSignatureElement; + case 151: return ts.ScriptElementKind.constructorImplementationElement; + case 144: return ts.ScriptElementKind.typeParameterElement; + case 263: return ts.ScriptElementKind.enumMemberElement; + case 145: return ts.hasModifier(node, 92) ? ts.ScriptElementKind.memberVariableElement : ts.ScriptElementKind.parameterElement; case 236: - case 243: - case 237: + case 241: + case 238: + case 245: + case 239: return ts.ScriptElementKind.alias; - case 285: + case 289: return ts.ScriptElementKind.typeElement; default: return ts.ScriptElementKind.unknown; @@ -52290,21 +57691,12 @@ var ts; } } ts.getNodeKind = getNodeKind; - function getStringLiteralTypeForNode(node, typeChecker) { - var searchNode = node.parent.kind === 171 ? node.parent : node; - var type = typeChecker.getTypeAtLocation(searchNode); - if (type && type.flags & 32) { - return type; - } - return undefined; - } - ts.getStringLiteralTypeForNode = getStringLiteralTypeForNode; function isThis(node) { switch (node.kind) { case 98: return true; case 70: - return ts.identifierIsThisKeyword(node) && node.parent.kind === 144; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 145; default: return false; } @@ -52312,7 +57704,7 @@ var ts; ts.isThis = isThis; var tripleSlashDirectivePrefixRegex = /^\/\/\/\s*= node.end) { + if (c.kind === 293 && c.pos <= node.pos && c.end >= node.end) { return c; } }); @@ -52523,7 +57915,7 @@ var ts; if (includeJsDocComment === void 0) { includeJsDocComment = false; } var current = sourceFile; outer: while (true) { - if (isToken(current)) { + if (ts.isToken(current)) { return current; } if (includeJsDocComment) { @@ -52546,8 +57938,8 @@ var ts; } } } - for (var i = 0, n = current.getChildCount(sourceFile); i < n; i++) { - var child = current.getChildAt(i); + for (var _a = 0, _b = current.getChildren(); _a < _b.length; _a++) { + var child = _b[_a]; if (ts.isJSDocNode(child)) { continue; } @@ -52571,7 +57963,7 @@ var ts; } function findTokenOnLeftOfPosition(file, position) { var tokenAtPosition = getTokenAtPosition(file, position); - if (isToken(tokenAtPosition) && position > tokenAtPosition.getStart(file) && position < tokenAtPosition.getEnd()) { + if (ts.isToken(tokenAtPosition) && position > tokenAtPosition.getStart(file) && position < tokenAtPosition.getEnd()) { return tokenAtPosition; } return findPrecedingToken(position, file); @@ -52580,7 +57972,7 @@ var ts; function findNextToken(previousToken, parent) { return find(parent); function find(n) { - if (isToken(n) && n.pos === previousToken.end) { + if (ts.isToken(n) && n.pos === previousToken.end) { return n; } var children = n.getChildren(); @@ -52599,7 +57991,7 @@ var ts; function findPrecedingToken(position, sourceFile, startNode) { return find(startNode || sourceFile); function findRightmostToken(n) { - if (isToken(n)) { + if (ts.isToken(n)) { return n; } var children = n.getChildren(); @@ -52607,11 +57999,11 @@ var ts; return candidate && findRightmostToken(candidate); } function find(n) { - if (isToken(n)) { + if (ts.isToken(n)) { return n; } var children = n.getChildren(); - for (var i = 0, len = children.length; i < len; i++) { + for (var i = 0; i < children.length; i++) { var child = children[i]; if (position < child.end && (nodeHasTokens(child) || child.kind === 10)) { var start = child.getStart(sourceFile); @@ -52626,7 +58018,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 261); + ts.Debug.assert(startNode !== undefined || n.kind === 264); if (children.length) { var candidate = findRightmostChildNodeWithTokens(children, children.length); return candidate && findRightmostToken(candidate); @@ -52671,13 +58063,13 @@ var ts; if (token.kind === 26 && token.parent.kind === 10) { return true; } - if (token.kind === 26 && token.parent.kind === 252) { + if (token.kind === 26 && token.parent.kind === 255) { return true; } - if (token && token.kind === 17 && token.parent.kind === 252) { + if (token && token.kind === 17 && token.parent.kind === 255) { return true; } - if (token.kind === 26 && token.parent.kind === 249) { + if (token.kind === 26 && token.parent.kind === 251) { return true; } return false; @@ -52694,10 +58086,10 @@ var ts; var commentRanges = ts.getLeadingCommentRanges(sourceFile.text, token.pos); return predicate ? ts.forEach(commentRanges, function (c) { return c.pos < position && - (c.kind == 2 ? position <= c.end : position < c.end) && + (c.kind === 2 ? position <= c.end : position < c.end) && predicate(c); }) : ts.forEach(commentRanges, function (c) { return c.pos < position && - (c.kind == 2 ? position <= c.end : position < c.end); }); + (c.kind === 2 ? position <= c.end : position < c.end); }); } return false; } @@ -52714,7 +58106,7 @@ var ts; ts.hasDocComment = hasDocComment; function getJsDocTagAtPosition(sourceFile, position) { var node = ts.getTokenAtPosition(sourceFile, position); - if (isToken(node)) { + if (ts.isToken(node)) { switch (node.kind) { case 103: case 109: @@ -52768,19 +58160,15 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 157 || node.kind === 179) { + if (node.kind === 158 || node.kind === 180) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 226 || node.kind === 227) { + if (ts.isFunctionLike(node) || node.kind === 228 || node.kind === 229) { return node.typeParameters; } return undefined; } ts.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList; - function isToken(n) { - return n.kind >= 0 && n.kind <= 140; - } - ts.isToken = isToken; function isWord(kind) { return kind === 70 || ts.isKeyword(kind); } @@ -52837,18 +58225,18 @@ var ts; } ts.compareDataObjects = compareDataObjects; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 175 || - node.kind === 176) { - if (node.parent.kind === 192 && + if (node.kind === 176 || + node.kind === 177) { + if (node.parent.kind === 193 && node.parent.left === node && node.parent.operatorToken.kind === 57) { return true; } - if (node.parent.kind === 213 && + if (node.parent.kind === 215 && node.parent.initializer === node) { return true; } - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 257 ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 260 ? node.parent.parent : node.parent)) { return true; } } @@ -52876,10 +58264,43 @@ var ts; } } ts.isInNonReferenceComment = isInNonReferenceComment; + function createTextSpanFromNode(node, sourceFile) { + return ts.createTextSpanFromBounds(node.getStart(sourceFile), node.getEnd()); + } + ts.createTextSpanFromNode = createTextSpanFromNode; + function isTypeKeyword(kind) { + switch (kind) { + case 118: + case 121: + case 129: + case 132: + case 133: + case 135: + case 136: + case 104: + return true; + default: + return false; + } + } + ts.isTypeKeyword = isTypeKeyword; + function isExternalModuleSymbol(moduleSymbol) { + ts.Debug.assert(!!(moduleSymbol.flags & 1536)); + return moduleSymbol.name.charCodeAt(0) === 34; + } + ts.isExternalModuleSymbol = isExternalModuleSymbol; + function nodeSeenTracker() { + var seen = []; + return function (node) { + var id = ts.getNodeId(node); + return !seen[id] && (seen[id] = true); + }; + } + ts.nodeSeenTracker = nodeSeenTracker; })(ts || (ts = {})); (function (ts) { function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 144; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 145; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -52896,13 +58317,15 @@ var ts; writeSpace: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.space); }, writeStringLiteral: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.stringLiteral); }, writeParameter: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.parameterName); }, + writeProperty: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.propertyName); }, writeSymbol: writeSymbol, writeLine: writeLine, increaseIndent: function () { indent++; }, decreaseIndent: function () { indent--; }, clear: resetWriter, trackSymbol: ts.noop, - reportInaccessibleThisError: ts.noop + reportInaccessibleThisError: ts.noop, + reportIllegalExtends: ts.noop }; function writeIndent() { if (lineStart) { @@ -53050,21 +58473,16 @@ var ts; } ts.signatureToDisplayParts = signatureToDisplayParts; function getDeclaredName(typeChecker, symbol, location) { - if (isImportOrExportSpecifierName(location)) { - return location.getText(); - } - else if (ts.isStringOrNumericLiteral(location) && - location.parent.kind === 142) { + if (isImportOrExportSpecifierName(location) || ts.isStringOrNumericLiteral(location) && location.parent.kind === 143) { return location.text; } var localExportDefaultSymbol = ts.getLocalSymbolForExportDefault(symbol); - var name = typeChecker.symbolToString(localExportDefaultSymbol || symbol); - return name; + return typeChecker.symbolToString(localExportDefaultSymbol || symbol); } ts.getDeclaredName = getDeclaredName; function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 239 || location.parent.kind === 243) && + (location.parent.kind === 241 || location.parent.kind === 245) && location.parent.propertyName === location; } ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName; @@ -53075,7 +58493,6 @@ var ts; (name.charCodeAt(0) === 34 || name.charCodeAt(0) === 39)) { return name.substring(1, length - 1); } - ; return name; } ts.stripQuotes = stripQuotes; @@ -53121,6 +58538,21 @@ var ts; }; } ts.sanitizeConfigFile = sanitizeConfigFile; + function getFirstNonSpaceCharacterPosition(text, position) { + while (ts.isWhiteSpace(text.charCodeAt(position))) { + position += 1; + } + return position; + } + ts.getFirstNonSpaceCharacterPosition = getFirstNonSpaceCharacterPosition; + function getOpenBrace(constructor, sourceFile) { + return constructor.body.getFirstToken(sourceFile); + } + ts.getOpenBrace = getOpenBrace; + function getOpenBraceOfClassLike(declaration, sourceFile) { + return ts.getTokenAtPosition(sourceFile, declaration.members.pos - 1); + } + ts.getOpenBraceOfClassLike = getOpenBraceOfClassLike; })(ts || (ts = {})); var ts; (function (ts) { @@ -53169,89 +58601,89 @@ var ts; function spanInNode(node) { if (node) { switch (node.kind) { - case 205: + case 207: return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 223: - case 147: - case 146: - return spanInVariableDeclaration(node); - case 144: - return spanInParameterDeclaration(node); case 225: - case 149: case 148: - case 151: - case 152: + case 147: + return spanInVariableDeclaration(node); + case 145: + return spanInParameterDeclaration(node); + case 227: case 150: - case 184: + case 149: + case 152: + case 153: + case 151: case 185: + case 186: return spanInFunctionDeclaration(node); - case 204: + case 206: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } - case 231: + case 233: return spanInBlock(node); - case 256: + case 259: return spanInBlock(node.block); - case 207: - return textSpan(node.expression); - case 216: - return textSpan(node.getChildAt(0), node.expression); - case 210: - return textSpanEndingAtNextToken(node, node.expression); case 209: - return spanInNode(node.statement); - case 222: - return textSpan(node.getChildAt(0)); - case 208: - return textSpanEndingAtNextToken(node, node.expression); - case 219: - return spanInNode(node.statement); - case 215: - case 214: - return textSpan(node.getChildAt(0), node.label); - case 211: - return spanInForStatement(node); + return textSpan(node.expression); + case 218: + return textSpan(node.getChildAt(0), node.expression); case 212: return textSpanEndingAtNextToken(node, node.expression); - case 213: - return spanInInitializerOfForLike(node); - case 218: + case 211: + return spanInNode(node.statement); + case 224: + return textSpan(node.getChildAt(0)); + case 210: return textSpanEndingAtNextToken(node, node.expression); - case 253: - case 254: - return spanInNode(node.statements[0]); case 221: - return spanInBlock(node.tryBlock); + return spanInNode(node.statement); + case 217: + case 216: + return textSpan(node.getChildAt(0), node.label); + case 213: + return spanInForStatement(node); + case 214: + return textSpanEndingAtNextToken(node, node.expression); + case 215: + return spanInInitializerOfForLike(node); case 220: + return textSpanEndingAtNextToken(node, node.expression); + case 256: + case 257: + return spanInNode(node.statements[0]); + case 223: + return spanInBlock(node.tryBlock); + case 222: return textSpan(node, node.expression); - case 240: + case 242: return textSpan(node, node.expression); - case 234: + case 236: return textSpan(node, node.moduleReference); - case 235: + case 237: return textSpan(node, node.moduleSpecifier); - case 241: + case 243: return textSpan(node, node.moduleSpecifier); - case 230: + case 232: if (ts.getModuleInstanceState(node) !== 1) { return undefined; } - case 226: - case 229: - case 260: - case 174: - return textSpan(node); - case 217: - return spanInNode(node.statement); - case 145: - return spanInNodeArray(node.parent.decorators); - case 172: - case 173: - return spanInBindingPattern(node); - case 227: case 228: + case 231: + case 263: + case 175: + return textSpan(node); + case 219: + return spanInNode(node.statement); + case 146: + return spanInNodeArray(node.parent.decorators); + case 173: + case 174: + return spanInBindingPattern(node); + case 229: + case 230: return undefined; case 24: case 1: @@ -53279,20 +58711,20 @@ var ts; case 73: case 86: return spanInNextNode(node); - case 140: + case 141: return spanInOfKeyword(node); default: if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node)) { return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node); } if ((node.kind === 70 || - node.kind == 196 || - node.kind === 257 || - node.kind === 258) && + node.kind === 197 || + node.kind === 260 || + node.kind === 261) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { return textSpan(node); } - if (node.kind === 192) { + if (node.kind === 193) { var binaryExpression = node; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left)) { return spanInArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left); @@ -53307,38 +58739,38 @@ var ts; } if (ts.isPartOfExpression(node)) { switch (node.parent.kind) { - case 209: - return spanInPreviousNode(node); - case 145: - return spanInNode(node.parent); case 211: + return spanInPreviousNode(node); + case 146: + return spanInNode(node.parent); case 213: + case 215: return textSpan(node); - case 192: + case 193: if (node.parent.operatorToken.kind === 25) { return textSpan(node); } break; - case 185: + case 186: if (node.parent.body === node) { return textSpan(node); } break; } } - if (node.parent.kind === 257 && + if (node.parent.kind === 260 && node.parent.name === node && !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } - if (node.parent.kind === 182 && node.parent.type === node) { + if (node.parent.kind === 183 && node.parent.type === node) { return spanInNextNode(node.parent.type); } if (ts.isFunctionLike(node.parent) && node.parent.type === node) { return spanInPreviousNode(node); } - if ((node.parent.kind === 223 || - node.parent.kind === 144)) { + if ((node.parent.kind === 225 || + node.parent.kind === 145)) { var paramOrVarDecl = node.parent; if (paramOrVarDecl.initializer === node || paramOrVarDecl.type === node || @@ -53346,7 +58778,7 @@ var ts; return spanInPreviousNode(node); } } - if (node.parent.kind === 192) { + if (node.parent.kind === 193) { var binaryExpression = node.parent; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left) && (binaryExpression.right === node || @@ -53358,8 +58790,8 @@ var ts; } } function textSpanFromVariableDeclaration(variableDeclaration) { - var declarations = variableDeclaration.parent.declarations; - if (declarations && declarations[0] === variableDeclaration) { + if (variableDeclaration.parent.kind === 226 && + variableDeclaration.parent.declarations[0] === variableDeclaration) { return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); } else { @@ -53367,7 +58799,7 @@ var ts; } } function spanInVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.parent.kind === 212) { + if (variableDeclaration.parent.parent.kind === 214) { return spanInNode(variableDeclaration.parent.parent); } if (ts.isBindingPattern(variableDeclaration.name)) { @@ -53375,11 +58807,11 @@ var ts; } if (variableDeclaration.initializer || ts.hasModifier(variableDeclaration, 1) || - variableDeclaration.parent.parent.kind === 213) { + variableDeclaration.parent.parent.kind === 215) { return textSpanFromVariableDeclaration(variableDeclaration); } - var declarations = variableDeclaration.parent.declarations; - if (declarations && declarations[0] !== variableDeclaration) { + if (variableDeclaration.parent.kind === 226 && + variableDeclaration.parent.declarations[0] !== variableDeclaration) { return spanInNode(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent)); } } @@ -53407,7 +58839,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasModifier(functionDeclaration, 1) || - (functionDeclaration.parent.kind === 226 && functionDeclaration.kind !== 150); + (functionDeclaration.parent.kind === 228 && functionDeclaration.kind !== 151); } function spanInFunctionDeclaration(functionDeclaration) { if (!functionDeclaration.body) { @@ -53427,22 +58859,22 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 230: + case 232: if (ts.getModuleInstanceState(block.parent) !== 1) { return undefined; } - case 210: - case 208: case 212: + case 210: + case 214: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); - case 211: case 213: + case 215: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 224) { + if (forLikeStatement.initializer.kind === 226) { var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { return spanInNode(variableDeclarationList.declarations[0]); @@ -53464,62 +58896,62 @@ var ts; } } function spanInBindingPattern(bindingPattern) { - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 198 ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 199 ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } - if (bindingPattern.parent.kind === 174) { + if (bindingPattern.parent.kind === 175) { return textSpan(bindingPattern.parent); } return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 173 && node.kind !== 172); - var elements = node.kind === 175 ? + ts.Debug.assert(node.kind !== 174 && node.kind !== 173); + var elements = node.kind === 176 ? node.elements : node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 198 ? element : undefined; }); + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 199 ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } - return textSpan(node.parent.kind === 192 ? node.parent : node); + return textSpan(node.parent.kind === 193 ? node.parent : node); } function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 229: + case 231: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 226: + case 228: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 232: + case 234: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } return spanInNode(node.parent); } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 231: + case 233: if (ts.getModuleInstanceState(node.parent.parent) !== 1) { return undefined; } - case 229: - case 226: + case 231: + case 228: return textSpan(node); - case 204: + case 206: if (ts.isFunctionBlock(node.parent)) { return textSpan(node); } - case 256: + case 259: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 232: + case 234: var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); if (lastClause) { return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 172: + case 173: var bindingPattern = node.parent; return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); default: @@ -53532,7 +58964,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 173: + case 174: var bindingPattern = node.parent; return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); default: @@ -53544,33 +58976,33 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 209 || - node.parent.kind === 179 || - node.parent.kind === 180) { + if (node.parent.kind === 211 || + node.parent.kind === 180 || + node.parent.kind === 181) { return spanInPreviousNode(node); } - if (node.parent.kind === 183) { + if (node.parent.kind === 184) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInCloseParenToken(node) { switch (node.parent.kind) { - case 184: - case 225: case 185: - case 149: - case 148: - case 151: - case 152: + case 227: + case 186: case 150: - case 210: - case 209: + case 149: + case 152: + case 153: + case 151: + case 212: case 211: case 213: - case 179: + case 215: case 180: - case 183: + case 181: + case 184: return spanInPreviousNode(node); default: return spanInNode(node.parent); @@ -53578,26 +59010,26 @@ var ts; } function spanInColonToken(node) { if (ts.isFunctionLike(node.parent) || - node.parent.kind === 257 || - node.parent.kind === 144) { + node.parent.kind === 260 || + node.parent.kind === 145) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 182) { + if (node.parent.kind === 183) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 209) { + if (node.parent.kind === 211) { return textSpanEndingAtNextToken(node, node.parent.expression); } return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 213) { + if (node.parent.kind === 215) { return spanInNextNode(node); } return spanInNode(node.parent); @@ -53628,7 +59060,7 @@ var ts; function canFollow(keyword1, keyword2) { if (ts.isAccessibilityModifier(keyword1)) { if (keyword2 === 124 || - keyword2 === 133 || + keyword2 === 134 || keyword2 === 122 || keyword2 === 114) { return true; @@ -53641,9 +59073,9 @@ var ts; var entries = []; var dense = classifications.spans; var lastEnd = 0; - for (var i = 0, n = dense.length; i < n; i += 3) { + for (var i = 0; i < dense.length; i += 3) { var start = dense[i]; - var length_4 = dense[i + 1]; + var length_5 = dense[i + 1]; var type = dense[i + 2]; if (lastEnd >= 0) { var whitespaceLength_1 = start - lastEnd; @@ -53651,8 +59083,8 @@ var ts; entries.push({ length: whitespaceLength_1, classification: ts.TokenClass.Whitespace }); } } - entries.push({ length: length_4, classification: convertClassification(type) }); - lastEnd = start + length_4; + entries.push({ length: length_5, classification: convertClassification(type) }); + lastEnd = start + length_5; } var whitespaceLength = text.length - lastEnd; if (whitespaceLength > 0) { @@ -53744,10 +59176,10 @@ var ts; angleBracketStack--; } else if (token === 118 || - token === 134 || + token === 135 || token === 132 || token === 121 || - token === 135) { + token === 136) { if (angleBracketStack > 0 && !syntacticClassifierAbsent) { token = 70; } @@ -53902,7 +59334,7 @@ var ts; } } function isKeyword(token) { - return token >= 71 && token <= 140; + return token >= 71 && token <= 141; } function classFromKind(token) { if (isKeyword(token)) { @@ -53948,10 +59380,10 @@ var ts; ts.getSemanticClassifications = getSemanticClassifications; function checkForClassificationCancellation(cancellationToken, kind) { switch (kind) { - case 230: - case 226: + case 232: + case 228: + case 229: case 227: - case 225: cancellationToken.throwIfCancellationRequested(); } } @@ -53995,7 +59427,7 @@ var ts; return undefined; function hasValueSideModule(symbol) { return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 230 && + return declaration.kind === 232 && ts.getModuleInstanceState(declaration) === 1; }); } @@ -54006,7 +59438,7 @@ var ts; checkForClassificationCancellation(cancellationToken, kind); if (kind === 70 && !ts.nodeIsMissing(node)) { var identifier = node; - if (classifiableNames[identifier.text]) { + if (classifiableNames.get(identifier.text)) { var symbol = typeChecker.getSymbolAtLocation(node); if (symbol) { var type = classifySymbol(symbol, ts.getMeaningFromLocation(node)); @@ -54052,7 +59484,7 @@ var ts; ts.Debug.assert(classifications.spans.length % 3 === 0); var dense = classifications.spans; var result = []; - for (var i = 0, n = dense.length; i < n; i += 3) { + for (var i = 0; i < dense.length; i += 3) { result.push({ textSpan: ts.createTextSpan(dense[i], dense[i + 1]), classificationType: getClassificationTypeName(dense[i + 2]) @@ -54136,16 +59568,16 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18); pos = tag.tagName.end; switch (tag.kind) { - case 281: + case 285: processJSDocParameterTag(tag); break; - case 284: + case 288: processJSDocTemplateTag(tag); break; - case 283: + case 287: processElement(tag.typeExpression); break; - case 282: + case 286: processElement(tag.typeExpression); break; } @@ -54226,22 +59658,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 248: + case 250: if (token.parent.tagName === token) { return 19; } break; - case 249: + case 251: if (token.parent.tagName === token) { return 20; } break; - case 247: + case 249: if (token.parent.tagName === token) { return 21; } break; - case 250: + case 252: if (token.parent.name === token) { return 22; } @@ -54261,17 +59693,17 @@ var ts; if (ts.isPunctuation(tokenKind)) { if (token) { if (tokenKind === 57) { - if (token.parent.kind === 223 || - token.parent.kind === 147 || - token.parent.kind === 144 || - token.parent.kind === 250) { + if (token.parent.kind === 225 || + token.parent.kind === 148 || + token.parent.kind === 145 || + token.parent.kind === 252) { return 5; } } - if (token.parent.kind === 192 || - token.parent.kind === 190 || + if (token.parent.kind === 193 || token.parent.kind === 191 || - token.parent.kind === 193) { + token.parent.kind === 192 || + token.parent.kind === 194) { return 5; } } @@ -54281,7 +59713,7 @@ var ts; return 4; } else if (tokenKind === 9) { - return token.parent.kind === 250 ? 24 : 6; + return token.parent.kind === 252 ? 24 : 6; } else if (tokenKind === 11) { return 6; @@ -54295,32 +59727,32 @@ var ts; else if (tokenKind === 70) { if (token) { switch (token.parent.kind) { - case 226: + case 228: if (token.parent.name === token) { return 11; } return; - case 143: + case 144: if (token.parent.name === token) { return 15; } return; - case 227: + case 229: if (token.parent.name === token) { return 13; } return; - case 229: + case 231: if (token.parent.name === token) { return 12; } return; - case 230: + case 232: if (token.parent.name === token) { return 14; } return; - case 144: + case 145: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 : 17; } @@ -54336,9 +59768,8 @@ var ts; } if (ts.decodedTextSpanIntersectsWith(spanStart, spanLength, element.pos, element.getFullWidth())) { checkForClassificationCancellation(cancellationToken, element.kind); - var children = element.getChildren(sourceFile); - for (var i = 0, n = children.length; i < n; i++) { - var child = children[i]; + for (var _i = 0, _a = element.getChildren(sourceFile); _i < _a.length; _i++) { + var child = _a[_i]; if (!tryClassifyNode(child)) { processElement(child); } @@ -54352,208 +59783,25 @@ var ts; (function (ts) { var Completions; (function (Completions) { - function getCompletionsAtPosition(host, typeChecker, log, compilerOptions, sourceFile, position) { - if (ts.isInReferenceComment(sourceFile, position)) { - return getTripleSlashReferenceCompletion(sourceFile, position); - } - if (ts.isInString(sourceFile, position)) { - return getStringLiteralCompletionEntries(sourceFile, position); - } - var completionData = getCompletionData(typeChecker, log, sourceFile, position); - if (!completionData) { - return undefined; - } - var symbols = completionData.symbols, isGlobalCompletion = completionData.isGlobalCompletion, isMemberCompletion = completionData.isMemberCompletion, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, isJsDocTagName = completionData.isJsDocTagName; - if (isJsDocTagName) { - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: ts.JsDoc.getAllJsDocCompletionEntries() }; - } - var entries = []; - if (ts.isSourceFileJavaScript(sourceFile)) { - var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, location, true); - ts.addRange(entries, getJavaScriptCompletionEntries(sourceFile, location.pos, uniqueNames)); - } - else { - if (!symbols || symbols.length === 0) { - if (sourceFile.languageVariant === 1 && - location.parent && location.parent.kind === 249) { - var tagName = location.parent.parent.openingElement.tagName; - entries.push({ - name: tagName.text, - kind: undefined, - kindModifiers: undefined, - sortText: "0", - }); - } - else { - return undefined; - } - } - getCompletionEntriesFromSymbols(symbols, entries, location, true); - } - if (!isMemberCompletion && !isJsDocTagName) { - ts.addRange(entries, keywordCompletions); - } - return { isGlobalCompletion: isGlobalCompletion, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; - function getJavaScriptCompletionEntries(sourceFile, position, uniqueNames) { - var entries = []; - var nameTable = ts.getNameTable(sourceFile); - for (var name_44 in nameTable) { - if (nameTable[name_44] === position) { - continue; - } - if (!uniqueNames[name_44]) { - uniqueNames[name_44] = name_44; - var displayName = getCompletionEntryDisplayName(ts.unescapeIdentifier(name_44), compilerOptions.target, true); - if (displayName) { - var entry = { - name: displayName, - kind: ts.ScriptElementKind.warning, - kindModifiers: "", - sortText: "1" - }; - entries.push(entry); - } - } - } - return entries; - } - function createCompletionEntry(symbol, location, performCharacterChecks) { - var displayName = getCompletionEntryDisplayNameForSymbol(typeChecker, symbol, compilerOptions.target, performCharacterChecks, location); - if (!displayName) { - return undefined; - } - return { - name: displayName, - kind: ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location), - kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), - sortText: "0", - }; - } - function getCompletionEntriesFromSymbols(symbols, entries, location, performCharacterChecks) { - var start = ts.timestamp(); - var uniqueNames = ts.createMap(); - if (symbols) { - for (var _i = 0, symbols_4 = symbols; _i < symbols_4.length; _i++) { - var symbol = symbols_4[_i]; - var entry = createCompletionEntry(symbol, location, performCharacterChecks); - if (entry) { - var id = ts.escapeIdentifier(entry.name); - if (!uniqueNames[id]) { - entries.push(entry); - uniqueNames[id] = id; - } - } - } - } - log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (ts.timestamp() - start)); - return uniqueNames; - } - function getStringLiteralCompletionEntries(sourceFile, position) { - var node = ts.findPrecedingToken(position, sourceFile); - if (!node || node.kind !== 9) { - return undefined; - } - if (node.parent.kind === 257 && - node.parent.parent.kind === 176 && - node.parent.name === node) { - return getStringLiteralCompletionEntriesFromPropertyAssignment(node.parent); - } - else if (ts.isElementAccessExpression(node.parent) && node.parent.argumentExpression === node) { - return getStringLiteralCompletionEntriesFromElementAccess(node.parent); - } - else if (node.parent.kind === 235 || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node) || ts.isRequireCall(node.parent, false)) { - return getStringLiteralCompletionEntriesFromModuleNames(node); - } - else { - var argumentInfo = ts.SignatureHelp.getContainingArgumentInfo(node, position, sourceFile); - if (argumentInfo) { - return getStringLiteralCompletionEntriesFromCallExpression(argumentInfo); - } - return getStringLiteralCompletionEntriesFromContextualType(node); - } - } - function getStringLiteralCompletionEntriesFromPropertyAssignment(element) { - var type = typeChecker.getContextualType(element.parent); - var entries = []; - if (type) { - getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, element, false); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; - } - } - } - function getStringLiteralCompletionEntriesFromCallExpression(argumentInfo) { - var candidates = []; - var entries = []; - typeChecker.getResolvedSignature(argumentInfo.invocation, candidates); - for (var _i = 0, candidates_3 = candidates; _i < candidates_3.length; _i++) { - var candidate = candidates_3[_i]; - if (candidate.parameters.length > argumentInfo.argumentIndex) { - var parameter = candidate.parameters[argumentInfo.argumentIndex]; - addStringLiteralCompletionsFromType(typeChecker.getTypeAtLocation(parameter.valueDeclaration), entries); - } - } - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: true, entries: entries }; - } - return undefined; - } - function getStringLiteralCompletionEntriesFromElementAccess(node) { - var type = typeChecker.getTypeAtLocation(node.expression); - var entries = []; - if (type) { - getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, node, false); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; - } - } - return undefined; - } - function getStringLiteralCompletionEntriesFromContextualType(node) { - var type = typeChecker.getContextualType(node); - if (type) { - var entries_2 = []; - addStringLiteralCompletionsFromType(type, entries_2); - if (entries_2.length) { - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries_2 }; - } - } - return undefined; - } - function addStringLiteralCompletionsFromType(type, result) { - if (!type) { - return; - } - if (type.flags & 65536) { - ts.forEach(type.types, function (t) { return addStringLiteralCompletionsFromType(t, result); }); - } - else { - if (type.flags & 32) { - result.push({ - name: type.text, - kindModifiers: ts.ScriptElementKindModifier.none, - kind: ts.ScriptElementKind.variableElement, - sortText: "0" - }); - } - } - } - function getStringLiteralCompletionEntriesFromModuleNames(node) { + var PathCompletions; + (function (PathCompletions) { + function getStringLiteralCompletionEntriesFromModuleNames(node, compilerOptions, host, typeChecker) { var literalValue = ts.normalizeSlashes(node.text); var scriptPath = node.getSourceFile().path; var scriptDirectory = ts.getDirectoryPath(scriptPath); var span = getDirectoryFragmentTextSpan(node.text, node.getStart() + 1); var entries; if (isPathRelativeToScript(literalValue) || ts.isRootedDiskPath(literalValue)) { + var extensions = ts.getSupportedExtensions(compilerOptions); if (compilerOptions.rootDirs) { - entries = getCompletionEntriesForDirectoryFragmentWithRootDirs(compilerOptions.rootDirs, literalValue, scriptDirectory, ts.getSupportedExtensions(compilerOptions), false, span, scriptPath); + entries = getCompletionEntriesForDirectoryFragmentWithRootDirs(compilerOptions.rootDirs, literalValue, scriptDirectory, extensions, false, span, compilerOptions, host, scriptPath); } else { - entries = getCompletionEntriesForDirectoryFragment(literalValue, scriptDirectory, ts.getSupportedExtensions(compilerOptions), false, span, scriptPath); + entries = getCompletionEntriesForDirectoryFragment(literalValue, scriptDirectory, extensions, false, span, host, scriptPath); } } else { - entries = getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, span); + entries = getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, span, compilerOptions, host, typeChecker); } return { isGlobalCompletion: false, @@ -54562,6 +59810,7 @@ var ts; entries: entries }; } + PathCompletions.getStringLiteralCompletionEntriesFromModuleNames = getStringLiteralCompletionEntriesFromModuleNames; function getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptPath, ignoreCase) { rootDirs = ts.map(rootDirs, function (rootDirectory) { return ts.normalizePath(ts.isRootedDiskPath(rootDirectory) ? rootDirectory : ts.combinePaths(basePath, rootDirectory)); }); var relativeDirectory; @@ -54574,18 +59823,18 @@ var ts; } return ts.deduplicate(ts.map(rootDirs, function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); })); } - function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptPath, extensions, includeExtensions, span, exclude) { + function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptPath, extensions, includeExtensions, span, compilerOptions, host, exclude) { var basePath = compilerOptions.project || host.getCurrentDirectory(); var ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); var baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptPath, ignoreCase); var result = []; for (var _i = 0, baseDirectories_1 = baseDirectories; _i < baseDirectories_1.length; _i++) { var baseDirectory = baseDirectories_1[_i]; - getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensions, includeExtensions, span, exclude, result); + getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensions, includeExtensions, span, host, exclude, result); } return result; } - function getCompletionEntriesForDirectoryFragment(fragment, scriptPath, extensions, includeExtensions, span, exclude, result) { + function getCompletionEntriesForDirectoryFragment(fragment, scriptPath, extensions, includeExtensions, span, host, exclude, result) { if (result === void 0) { result = []; } if (fragment === undefined) { fragment = ""; @@ -54610,13 +59859,13 @@ var ts; continue; } var foundFileName = includeExtensions ? ts.getBaseFileName(filePath) : ts.removeFileExtension(ts.getBaseFileName(filePath)); - if (!foundFiles[foundFileName]) { - foundFiles[foundFileName] = true; + if (!foundFiles.get(foundFileName)) { + foundFiles.set(foundFileName, true); } } - for (var foundFile in foundFiles) { + ts.forEachKey(foundFiles, function (foundFile) { result.push(createCompletionEntryForModule(foundFile, ts.ScriptElementKind.scriptElement, span)); - } + }); } var directories = tryGetDirectories(host, baseDirectory); if (directories) { @@ -54629,14 +59878,14 @@ var ts; } return result; } - function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, span) { + function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, span, compilerOptions, host, typeChecker) { var baseUrl = compilerOptions.baseUrl, paths = compilerOptions.paths; var result; if (baseUrl) { var fileExtensions = ts.getSupportedExtensions(compilerOptions); var projectDir = compilerOptions.project || host.getCurrentDirectory(); var absolute = ts.isRootedDiskPath(baseUrl) ? baseUrl : ts.combinePaths(projectDir, baseUrl); - result = getCompletionEntriesForDirectoryFragment(fragment, ts.normalizePath(absolute), fileExtensions, false, span); + result = getCompletionEntriesForDirectoryFragment(fragment, ts.normalizePath(absolute), fileExtensions, false, span, host); if (paths) { for (var path in paths) { if (paths.hasOwnProperty(path)) { @@ -54644,7 +59893,7 @@ var ts; if (paths[path]) { for (var _i = 0, _a = paths[path]; _i < _a.length; _i++) { var pattern = _a[_i]; - for (var _b = 0, _c = getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions); _b < _c.length; _b++) { + for (var _b = 0, _c = getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host); _b < _c.length; _b++) { var match = _c[_b]; result.push(createCompletionEntryForModule(match, ts.ScriptElementKind.externalModuleName, span)); } @@ -54665,13 +59914,13 @@ var ts; result = []; } getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, span, result); - for (var _d = 0, _e = enumeratePotentialNonRelativeModules(fragment, scriptPath, compilerOptions); _d < _e.length; _d++) { + for (var _d = 0, _e = enumeratePotentialNonRelativeModules(fragment, scriptPath, compilerOptions, typeChecker, host); _d < _e.length; _d++) { var moduleName = _e[_d]; result.push(createCompletionEntryForModule(moduleName, ts.ScriptElementKind.externalModuleName, span)); } return result; } - function getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions) { + function getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host) { if (host.readDirectory) { var parsed = ts.hasZeroOrOneAsteriskCharacter(pattern) ? ts.tryParsePattern(pattern) : undefined; if (parsed) { @@ -54694,8 +59943,8 @@ var ts; continue; } var start = completePrefix.length; - var length_5 = normalizedMatch.length - start - normalizedSuffix.length; - result.push(ts.removeFileExtension(normalizedMatch.substr(start, length_5))); + var length_6 = normalizedMatch.length - start - normalizedSuffix.length; + result.push(ts.removeFileExtension(normalizedMatch.substr(start, length_6))); } return result; } @@ -54703,7 +59952,7 @@ var ts; } return undefined; } - function enumeratePotentialNonRelativeModules(fragment, scriptPath, options) { + function enumeratePotentialNonRelativeModules(fragment, scriptPath, options, typeChecker, host) { var isNestedModule = fragment.indexOf(ts.directorySeparator) !== -1; var moduleNameFragment = isNestedModule ? fragment.substr(0, fragment.lastIndexOf(ts.directorySeparator)) : undefined; var ambientModules = ts.map(typeChecker.getAmbientModules(), function (sym) { return ts.stripQuotes(sym.name); }); @@ -54738,7 +59987,7 @@ var ts; } return ts.deduplicate(nonRelativeModules); } - function getTripleSlashReferenceCompletion(sourceFile, position) { + function getTripleSlashReferenceCompletion(sourceFile, position, compilerOptions, host) { var token = ts.getTokenAtPosition(sourceFile, position); if (!token) { return undefined; @@ -54766,7 +60015,7 @@ var ts; var scriptPath = ts.getDirectoryPath(sourceFile.path); if (kind === "path") { var span_10 = getDirectoryFragmentTextSpan(toComplete, range.pos + prefix.length); - completionInfo.entries = getCompletionEntriesForDirectoryFragment(toComplete, scriptPath, ts.getSupportedExtensions(compilerOptions), true, span_10, sourceFile.path); + completionInfo.entries = getCompletionEntriesForDirectoryFragment(toComplete, scriptPath, ts.getSupportedExtensions(compilerOptions), true, span_10, host, sourceFile.path); } else { var span_11 = { start: range.pos + prefix.length, length: match[0].length - prefix.length }; @@ -54775,6 +60024,7 @@ var ts; } return completionInfo; } + PathCompletions.getTripleSlashReferenceCompletion = getTripleSlashReferenceCompletion; function getCompletionEntriesFromTypings(host, options, scriptPath, span, result) { if (result === void 0) { result = []; } if (options.types) { @@ -54797,7 +60047,7 @@ var ts; } } if (host.getDirectories) { - for (var _c = 0, _d = findPackageJsons(scriptPath); _c < _d.length; _c++) { + for (var _c = 0, _d = findPackageJsons(scriptPath, host); _c < _d.length; _c++) { var packageJson = _d[_c]; var typesDir = ts.combinePaths(ts.getDirectoryPath(packageJson), "node_modules/@types"); getCompletionEntriesFromDirectories(host, typesDir, span, result); @@ -54817,7 +60067,7 @@ var ts; } } } - function findPackageJsons(currentDir) { + function findPackageJsons(currentDir, host) { var paths = []; var currentConfigPath; while (true) { @@ -54825,11 +60075,11 @@ var ts; if (currentConfigPath) { paths.push(currentConfigPath); currentDir = ts.getDirectoryPath(currentConfigPath); - var parent_13 = ts.getDirectoryPath(currentDir); - if (currentDir === parent_13) { + var parent = ts.getDirectoryPath(currentDir); + if (currentDir === parent) { break; } - currentDir = parent_13; + currentDir = parent; } else { break; @@ -54840,7 +60090,7 @@ var ts; function enumerateNodeModulesVisibleToScript(host, scriptPath) { var result = []; if (host.readFile && host.fileExists) { - for (var _i = 0, _a = findPackageJsons(scriptPath); _i < _a.length; _i++) { + for (var _i = 0, _a = findPackageJsons(scriptPath, host); _i < _a.length; _i++) { var packageJson = _a[_i]; var contents = tryReadingPackageJson(packageJson); if (!contents) { @@ -54901,21 +60151,256 @@ var ts; function normalizeAndPreserveTrailingSlash(path) { return ts.hasTrailingDirectorySeparator(path) ? ts.ensureTrailingDirectorySeparator(ts.normalizePath(path)) : ts.normalizePath(path); } + var tripleSlashDirectiveFragmentRegex = /^(\/\/\/\s*= 0; i--) { - if (pushKeywordIf(keywords, loopTokens[i], 105)) { - break; - } - } - } - } - var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); - ts.forEach(breaksAndContinues, function (statement) { - if (ownsBreakOrContinueStatement(loopNode, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 71, 76); - } - }); - return ts.map(keywords, getHighlightSpanForNode); - } - function getBreakOrContinueStatementOccurrences(breakOrContinueStatement) { - var owner = getBreakOrContinueOwner(breakOrContinueStatement); - if (owner) { - switch (owner.kind) { - case 211: - case 212: - case 213: - case 209: - case 210: - return getLoopBreakContinueOccurrences(owner); - case 218: - return getSwitchCaseDefaultOccurrences(owner); - } - } - return undefined; - } - function getSwitchCaseDefaultOccurrences(switchStatement) { - var keywords = []; - pushKeywordIf(keywords, switchStatement.getFirstToken(), 97); - ts.forEach(switchStatement.caseBlock.clauses, function (clause) { - pushKeywordIf(keywords, clause.getFirstToken(), 72, 78); - var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); - ts.forEach(breaksAndContinues, function (statement) { - if (ownsBreakOrContinueStatement(switchStatement, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 71); - } - }); - }); - return ts.map(keywords, getHighlightSpanForNode); - } - function getTryCatchFinallyOccurrences(tryStatement) { - var keywords = []; - pushKeywordIf(keywords, tryStatement.getFirstToken(), 101); - if (tryStatement.catchClause) { - pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 73); + aggregate(tryStatement.tryBlock); } if (tryStatement.finallyBlock) { - var finallyKeyword = ts.findChildOfKind(tryStatement, 86, sourceFile); - pushKeywordIf(keywords, finallyKeyword, 86); + aggregate(tryStatement.finallyBlock); } - return ts.map(keywords, getHighlightSpanForNode); } - function getThrowOccurrences(throwStatement) { - var owner = getThrowStatementOwner(throwStatement); - if (!owner) { - return undefined; - } - var keywords = []; - ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 99); - }); - if (ts.isFunctionBlock(owner)) { - ts.forEachReturnStatement(owner, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 95); - }); - } - return ts.map(keywords, getHighlightSpanForNode); - } - function getReturnOccurrences(returnStatement) { - var func = ts.getContainingFunction(returnStatement); - if (!(func && hasKind(func.body, 204))) { - return undefined; - } - var keywords = []; - ts.forEachReturnStatement(func.body, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 95); - }); - ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 99); - }); - return ts.map(keywords, getHighlightSpanForNode); - } - function getIfElseOccurrences(ifStatement) { - var keywords = []; - while (hasKind(ifStatement.parent, 208) && ifStatement.parent.elseStatement === ifStatement) { - ifStatement = ifStatement.parent; - } - while (ifStatement) { - var children = ifStatement.getChildren(); - pushKeywordIf(keywords, children[0], 89); - for (var i = children.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, children[i], 81)) { - break; - } - } - if (!hasKind(ifStatement.elseStatement, 208)) { - break; - } - ifStatement = ifStatement.elseStatement; - } - var result = []; - for (var i = 0; i < keywords.length; i++) { - if (keywords[i].kind === 81 && i < keywords.length - 1) { - var elseKeyword = keywords[i]; - var ifKeyword = keywords[i + 1]; - var shouldCombindElseAndIf = true; - for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { - if (!ts.isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(j))) { - shouldCombindElseAndIf = false; - break; - } - } - if (shouldCombindElseAndIf) { - result.push({ - fileName: fileName, - textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), - kind: ts.HighlightSpanKind.reference - }); - i++; - continue; - } - } - result.push(getHighlightSpanForNode(keywords[i])); - } - return result; + else if (!ts.isFunctionLike(node)) { + ts.forEachChild(node, aggregate); } } } - DocumentHighlights.getDocumentHighlights = getDocumentHighlights; + function getThrowStatementOwner(throwStatement) { + var child = throwStatement; + while (child.parent) { + var parent_2 = child.parent; + if (ts.isFunctionBlock(parent_2) || parent_2.kind === 264) { + return parent_2; + } + if (parent_2.kind === 223) { + var tryStatement = parent_2; + if (tryStatement.tryBlock === child && tryStatement.catchClause) { + return child; + } + } + child = parent_2; + } + return undefined; + } + function aggregateAllBreakAndContinueStatements(node) { + var statementAccumulator = []; + aggregate(node); + return statementAccumulator; + function aggregate(node) { + if (node.kind === 217 || node.kind === 216) { + statementAccumulator.push(node); + } + else if (!ts.isFunctionLike(node)) { + ts.forEachChild(node, aggregate); + } + } + } + function ownsBreakOrContinueStatement(owner, statement) { + var actualOwner = getBreakOrContinueOwner(statement); + return actualOwner && actualOwner === owner; + } + function getBreakOrContinueOwner(statement) { + for (var node = statement.parent; node; node = node.parent) { + switch (node.kind) { + case 220: + if (statement.kind === 216) { + continue; + } + case 213: + case 214: + case 215: + case 212: + case 211: + if (!statement.label || isLabeledBy(node, statement.label.text)) { + return node; + } + break; + default: + if (ts.isFunctionLike(node)) { + return undefined; + } + break; + } + } + return undefined; + } + function getModifierOccurrences(modifier, declaration) { + var container = declaration.parent; + if (ts.isAccessibilityModifier(modifier)) { + if (!(container.kind === 228 || + container.kind === 198 || + (declaration.kind === 145 && hasKind(container, 151)))) { + return undefined; + } + } + else if (modifier === 114) { + if (!(container.kind === 228 || container.kind === 198)) { + return undefined; + } + } + else if (modifier === 83 || modifier === 123) { + if (!(container.kind === 233 || container.kind === 264)) { + return undefined; + } + } + else if (modifier === 116) { + if (!(container.kind === 228 || declaration.kind === 228)) { + return undefined; + } + } + else { + return undefined; + } + var keywords = []; + var modifierFlag = getFlagFromModifier(modifier); + var nodes; + switch (container.kind) { + case 233: + case 264: + if (modifierFlag & 128) { + nodes = declaration.members.concat(declaration); + } + else { + nodes = container.statements; + } + break; + case 151: + nodes = container.parameters.concat(container.parent.members); + break; + case 228: + case 198: + nodes = container.members; + if (modifierFlag & 28) { + var constructor = ts.forEach(container.members, function (member) { + return member.kind === 151 && member; + }); + if (constructor) { + nodes = nodes.concat(constructor.parameters); + } + } + else if (modifierFlag & 128) { + nodes = nodes.concat(container); + } + break; + default: + ts.Debug.fail("Invalid container kind."); + } + ts.forEach(nodes, function (node) { + if (ts.getModifierFlags(node) & modifierFlag) { + ts.forEach(node.modifiers, function (child) { return pushKeywordIf(keywords, child, modifier); }); + } + }); + return keywords; + function getFlagFromModifier(modifier) { + switch (modifier) { + case 113: + return 4; + case 111: + return 8; + case 112: + return 16; + case 114: + return 32; + case 83: + return 1; + case 123: + return 2; + case 116: + return 128; + default: + ts.Debug.fail(); + } + } + } + function pushKeywordIf(keywordList, token) { + var expected = []; + for (var _i = 2; _i < arguments.length; _i++) { + expected[_i - 2] = arguments[_i]; + } + if (token && ts.contains(expected, token.kind)) { + keywordList.push(token); + return true; + } + return false; + } + function getGetAndSetOccurrences(accessorDeclaration) { + var keywords = []; + tryPushAccessorKeyword(accessorDeclaration.symbol, 152); + tryPushAccessorKeyword(accessorDeclaration.symbol, 153); + return keywords; + function tryPushAccessorKeyword(accessorSymbol, accessorKind) { + var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); + if (accessor) { + ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 124, 134); }); + } + } + } + function getConstructorOccurrences(constructorDeclaration) { + var declarations = constructorDeclaration.symbol.getDeclarations(); + var keywords = []; + ts.forEach(declarations, function (declaration) { + ts.forEach(declaration.getChildren(), function (token) { + return pushKeywordIf(keywords, token, 122); + }); + }); + return keywords; + } + function getLoopBreakContinueOccurrences(loopNode) { + var keywords = []; + if (pushKeywordIf(keywords, loopNode.getFirstToken(), 87, 105, 80)) { + if (loopNode.kind === 211) { + var loopTokens = loopNode.getChildren(); + for (var i = loopTokens.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, loopTokens[i], 105)) { + break; + } + } + } + } + var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); + ts.forEach(breaksAndContinues, function (statement) { + if (ownsBreakOrContinueStatement(loopNode, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), 71, 76); + } + }); + return keywords; + } + function getBreakOrContinueStatementOccurrences(breakOrContinueStatement) { + var owner = getBreakOrContinueOwner(breakOrContinueStatement); + if (owner) { + switch (owner.kind) { + case 213: + case 214: + case 215: + case 211: + case 212: + return getLoopBreakContinueOccurrences(owner); + case 220: + return getSwitchCaseDefaultOccurrences(owner); + } + } + return undefined; + } + function getSwitchCaseDefaultOccurrences(switchStatement) { + var keywords = []; + pushKeywordIf(keywords, switchStatement.getFirstToken(), 97); + ts.forEach(switchStatement.caseBlock.clauses, function (clause) { + pushKeywordIf(keywords, clause.getFirstToken(), 72, 78); + var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); + ts.forEach(breaksAndContinues, function (statement) { + if (ownsBreakOrContinueStatement(switchStatement, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), 71); + } + }); + }); + return keywords; + } + function getTryCatchFinallyOccurrences(tryStatement, sourceFile) { + var keywords = []; + pushKeywordIf(keywords, tryStatement.getFirstToken(), 101); + if (tryStatement.catchClause) { + pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 73); + } + if (tryStatement.finallyBlock) { + var finallyKeyword = ts.findChildOfKind(tryStatement, 86, sourceFile); + pushKeywordIf(keywords, finallyKeyword, 86); + } + return keywords; + } + function getThrowOccurrences(throwStatement) { + var owner = getThrowStatementOwner(throwStatement); + if (!owner) { + return undefined; + } + var keywords = []; + ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { + pushKeywordIf(keywords, throwStatement.getFirstToken(), 99); + }); + if (ts.isFunctionBlock(owner)) { + ts.forEachReturnStatement(owner, function (returnStatement) { + pushKeywordIf(keywords, returnStatement.getFirstToken(), 95); + }); + } + return keywords; + } + function getReturnOccurrences(returnStatement) { + var func = ts.getContainingFunction(returnStatement); + if (!(func && hasKind(func.body, 206))) { + return undefined; + } + var keywords = []; + ts.forEachReturnStatement(func.body, function (returnStatement) { + pushKeywordIf(keywords, returnStatement.getFirstToken(), 95); + }); + ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { + pushKeywordIf(keywords, throwStatement.getFirstToken(), 99); + }); + return keywords; + } + function getIfElseOccurrences(ifStatement, sourceFile) { + var keywords = []; + while (hasKind(ifStatement.parent, 210) && ifStatement.parent.elseStatement === ifStatement) { + ifStatement = ifStatement.parent; + } + while (ifStatement) { + var children = ifStatement.getChildren(); + pushKeywordIf(keywords, children[0], 89); + for (var i = children.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, children[i], 81)) { + break; + } + } + if (!hasKind(ifStatement.elseStatement, 210)) { + break; + } + ifStatement = ifStatement.elseStatement; + } + var result = []; + for (var i = 0; i < keywords.length; i++) { + if (keywords[i].kind === 81 && i < keywords.length - 1) { + var elseKeyword = keywords[i]; + var ifKeyword = keywords[i + 1]; + var shouldCombindElseAndIf = true; + for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { + if (!ts.isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(j))) { + shouldCombindElseAndIf = false; + break; + } + } + if (shouldCombindElseAndIf) { + result.push({ + fileName: sourceFile.fileName, + textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), + kind: ts.HighlightSpanKind.reference + }); + i++; + continue; + } + } + result.push(getHighlightSpanForNode(keywords[i], sourceFile)); + } + return result; + } function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 219; owner = owner.parent) { + for (var owner = node.parent; owner.kind === 221; owner = owner.parent) { if (owner.label.text === labelName) { return true; } @@ -56110,15 +61574,15 @@ var ts; return "_" + settings.target + "|" + settings.module + "|" + settings.noResolve + "|" + settings.jsx + "|" + settings.allowJs + "|" + settings.baseUrl + "|" + JSON.stringify(settings.typeRoots) + "|" + JSON.stringify(settings.rootDirs) + "|" + JSON.stringify(settings.paths); } function getBucketForCompilationSettings(key, createIfMissing) { - var bucket = buckets[key]; + var bucket = buckets.get(key); if (!bucket && createIfMissing) { - buckets[key] = bucket = ts.createFileMap(); + buckets.set(key, bucket = ts.createFileMap()); } return bucket; } function reportStats() { - var bucketInfoArray = Object.keys(buckets).filter(function (name) { return name && name.charAt(0) === "_"; }).map(function (name) { - var entries = buckets[name]; + var bucketInfoArray = ts.arrayFrom(buckets.keys()).filter(function (name) { return name && name.charAt(0) === "_"; }).map(function (name) { + var entries = buckets.get(name); var sourceFiles = []; entries.forEachValue(function (key, entry) { sourceFiles.push({ @@ -56206,179 +61670,871 @@ var ts; (function (ts) { var FindAllReferences; (function (FindAllReferences) { - function findReferencedSymbols(typeChecker, cancellationToken, sourceFiles, sourceFile, position, findInStrings, findInComments) { - var node = ts.getTouchingPropertyName(sourceFile, position, true); - if (node === sourceFile) { + function createImportTracker(sourceFiles, checker, cancellationToken) { + var allDirectImports = getDirectImportsMap(sourceFiles, checker, cancellationToken); + return function (exportSymbol, exportInfo, isForRename) { + var _a = getImportersForExport(sourceFiles, allDirectImports, exportInfo, checker, cancellationToken), directImports = _a.directImports, indirectUsers = _a.indirectUsers; + return __assign({ indirectUsers: indirectUsers }, getSearchesFromDirectImports(directImports, exportSymbol, exportInfo.exportKind, checker, isForRename)); + }; + } + FindAllReferences.createImportTracker = createImportTracker; + var ExportKind; + (function (ExportKind) { + ExportKind[ExportKind["Named"] = 0] = "Named"; + ExportKind[ExportKind["Default"] = 1] = "Default"; + ExportKind[ExportKind["ExportEquals"] = 2] = "ExportEquals"; + })(ExportKind = FindAllReferences.ExportKind || (FindAllReferences.ExportKind = {})); + var ImportExport; + (function (ImportExport) { + ImportExport[ImportExport["Import"] = 0] = "Import"; + ImportExport[ImportExport["Export"] = 1] = "Export"; + })(ImportExport = FindAllReferences.ImportExport || (FindAllReferences.ImportExport = {})); + function getImportersForExport(sourceFiles, allDirectImports, _a, checker, cancellationToken) { + var exportingModuleSymbol = _a.exportingModuleSymbol, exportKind = _a.exportKind; + var markSeenDirectImport = ts.nodeSeenTracker(); + var markSeenIndirectUser = ts.nodeSeenTracker(); + var directImports = []; + var isAvailableThroughGlobal = !!exportingModuleSymbol.globalExports; + var indirectUserDeclarations = isAvailableThroughGlobal ? undefined : []; + handleDirectImports(exportingModuleSymbol); + return { directImports: directImports, indirectUsers: getIndirectUsers() }; + function getIndirectUsers() { + if (isAvailableThroughGlobal) { + return sourceFiles; + } + for (var _i = 0, _a = exportingModuleSymbol.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + if (ts.isExternalModuleAugmentation(decl)) { + addIndirectUser(decl); + } + } + return indirectUserDeclarations.map(ts.getSourceFileOfNode); + } + function handleDirectImports(exportingModuleSymbol) { + var theseDirectImports = getDirectImports(exportingModuleSymbol); + if (theseDirectImports) + for (var _i = 0, theseDirectImports_1 = theseDirectImports; _i < theseDirectImports_1.length; _i++) { + var direct = theseDirectImports_1[_i]; + if (!markSeenDirectImport(direct)) { + continue; + } + cancellationToken.throwIfCancellationRequested(); + switch (direct.kind) { + case 180: + if (!isAvailableThroughGlobal) { + var parent = direct.parent; + if (exportKind === 2 && parent.kind === 225) { + var name = parent.name; + if (name.kind === 70) { + directImports.push(name); + break; + } + } + addIndirectUser(direct.getSourceFile()); + } + break; + case 236: + handleNamespaceImport(direct, direct.name, ts.hasModifier(direct, 1)); + break; + case 237: + var namedBindings = direct.importClause && direct.importClause.namedBindings; + if (namedBindings && namedBindings.kind === 239) { + handleNamespaceImport(direct, namedBindings.name); + } + else { + directImports.push(direct); + } + break; + case 243: + if (!direct.exportClause) { + handleDirectImports(getContainingModuleSymbol(direct, checker)); + } + else { + directImports.push(direct); + } + break; + } + } + } + function handleNamespaceImport(importDeclaration, name, isReExport) { + if (exportKind === 2) { + directImports.push(importDeclaration); + } + else if (!isAvailableThroughGlobal) { + var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); + ts.Debug.assert(sourceFileLike.kind === 264 || sourceFileLike.kind === 232); + if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { + addIndirectUsers(sourceFileLike); + } + else { + addIndirectUser(sourceFileLike); + } + } + } + function addIndirectUser(sourceFileLike) { + ts.Debug.assert(!isAvailableThroughGlobal); + var isNew = markSeenIndirectUser(sourceFileLike); + if (isNew) { + indirectUserDeclarations.push(sourceFileLike); + } + return isNew; + } + function addIndirectUsers(sourceFileLike) { + if (!addIndirectUser(sourceFileLike)) { + return; + } + var moduleSymbol = checker.getMergedSymbol(sourceFileLike.symbol); + ts.Debug.assert(!!(moduleSymbol.flags & 1536)); + var directImports = getDirectImports(moduleSymbol); + if (directImports) + for (var _i = 0, directImports_1 = directImports; _i < directImports_1.length; _i++) { + var directImport = directImports_1[_i]; + addIndirectUsers(getSourceFileLikeForImportDeclaration(directImport)); + } + } + function getDirectImports(moduleSymbol) { + return allDirectImports.get(ts.getSymbolId(moduleSymbol).toString()); + } + } + function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, checker, isForRename) { + var exportName = exportSymbol.name; + var importSearches = []; + var singleReferences = []; + function addSearch(location, symbol) { + importSearches.push([location, symbol]); + } + if (directImports) + for (var _i = 0, directImports_2 = directImports; _i < directImports_2.length; _i++) { + var decl = directImports_2[_i]; + handleImport(decl); + } + return { importSearches: importSearches, singleReferences: singleReferences }; + function handleImport(decl) { + if (decl.kind === 236) { + if (isExternalModuleImportEquals(decl)) { + handleNamespaceImportLike(decl.name); + } + return; + } + if (decl.kind === 70) { + handleNamespaceImportLike(decl); + return; + } + if (decl.moduleSpecifier.kind !== 9) { + return; + } + if (decl.kind === 243) { + searchForNamedImport(decl.exportClause); + return; + } + var importClause = decl.importClause; + var namedBindings = importClause.namedBindings; + if (namedBindings && namedBindings.kind === 239) { + handleNamespaceImportLike(namedBindings.name); + return; + } + if (exportKind === 0) { + searchForNamedImport(namedBindings); + } + else { + var name = importClause.name; + if (name && (!isForRename || name.text === symbolName(exportSymbol))) { + var defaultImportAlias = checker.getSymbolAtLocation(name); + addSearch(name, defaultImportAlias); + } + if (!isForRename && exportKind === 1) { + ts.Debug.assert(exportName === "default"); + searchForNamedImport(namedBindings); + } + } + } + function handleNamespaceImportLike(importName) { + if (exportKind === 2 && (!isForRename || importName.text === exportName)) { + addSearch(importName, checker.getSymbolAtLocation(importName)); + } + } + function searchForNamedImport(namedBindings) { + if (namedBindings) + for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { + var element = _a[_i]; + var name = element.name, propertyName = element.propertyName; + if ((propertyName || name).text !== exportName) { + continue; + } + if (propertyName) { + singleReferences.push(propertyName); + if (!isForRename) { + addSearch(name, checker.getSymbolAtLocation(name)); + } + } + else { + var localSymbol = element.kind === 245 && element.propertyName + ? checker.getExportSpecifierLocalTargetSymbol(element) + : checker.getSymbolAtLocation(name); + addSearch(name, localSymbol); + } + } + } + } + function findNamespaceReExports(sourceFileLike, name, checker) { + var namespaceImportSymbol = checker.getSymbolAtLocation(name); + return forEachPossibleImportOrExportStatement(sourceFileLike, function (statement) { + if (statement.kind !== 243) + return; + var _a = statement, exportClause = _a.exportClause, moduleSpecifier = _a.moduleSpecifier; + if (moduleSpecifier || !exportClause) + return; + for (var _i = 0, _b = exportClause.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (checker.getExportSpecifierLocalTargetSymbol(element) === namespaceImportSymbol) { + return true; + } + } + }); + } + function getDirectImportsMap(sourceFiles, checker, cancellationToken) { + var map = ts.createMap(); + for (var _i = 0, sourceFiles_4 = sourceFiles; _i < sourceFiles_4.length; _i++) { + var sourceFile = sourceFiles_4[_i]; + cancellationToken.throwIfCancellationRequested(); + forEachImport(sourceFile, function (importDecl, moduleSpecifier) { + var moduleSymbol = checker.getSymbolAtLocation(moduleSpecifier); + if (moduleSymbol) { + var id = ts.getSymbolId(moduleSymbol).toString(); + var imports = map.get(id); + if (!imports) { + map.set(id, imports = []); + } + imports.push(importDecl); + } + }); + } + return map; + } + function forEachPossibleImportOrExportStatement(sourceFileLike, action) { + return ts.forEach(sourceFileLike.kind === 264 ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); + }); + } + function forEachImport(sourceFile, action) { + if (sourceFile.externalModuleIndicator) { + for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { + var moduleSpecifier = _a[_i]; + action(importerFromModuleSpecifier(moduleSpecifier), moduleSpecifier); + } + } + else { + forEachPossibleImportOrExportStatement(sourceFile, function (statement) { + switch (statement.kind) { + case 243: + case 237: { + var decl = statement; + if (decl.moduleSpecifier && decl.moduleSpecifier.kind === 9) { + action(decl, decl.moduleSpecifier); + } + break; + } + case 236: { + var decl = statement; + var moduleReference = decl.moduleReference; + if (moduleReference.kind === 247 && + moduleReference.expression.kind === 9) { + action(decl, moduleReference.expression); + } + break; + } + } + }); + if (sourceFile.flags & 65536) { + sourceFile.forEachChild(function recur(node) { + if (ts.isRequireCall(node, true)) { + action(node, node.arguments[0]); + } + else { + node.forEachChild(recur); + } + }); + } + } + } + function importerFromModuleSpecifier(moduleSpecifier) { + var decl = moduleSpecifier.parent; + if (decl.kind === 237 || decl.kind === 243) { + return decl; + } + ts.Debug.assert(decl.kind === 247); + return decl.parent; + } + function getImportOrExportSymbol(node, symbol, checker, comingFromExport) { + return comingFromExport ? getExport() : getExport() || getImport(); + function getExport() { + var parent = node.parent; + if (symbol.flags & 7340032) { + if (parent.kind === 178) { + return symbol.declarations.some(function (d) { return d === parent; }) && parent.parent.kind === 193 + ? getSpecialPropertyExport(parent.parent, false) + : undefined; + } + else { + var exportSymbol = symbol.exportSymbol; + ts.Debug.assert(!!exportSymbol); + return exportInfo(exportSymbol, getExportKindForDeclaration(parent)); + } + } + else { + var exportNode = parent.kind === 225 ? ts.getAncestor(parent, 207) : parent; + if (ts.hasModifier(exportNode, 1)) { + if (exportNode.kind === 236 && exportNode.moduleReference === node) { + if (comingFromExport) { + return undefined; + } + var lhsSymbol = checker.getSymbolAtLocation(exportNode.name); + return { kind: 0, symbol: lhsSymbol, isNamedImport: false }; + } + else { + return exportInfo(symbol, getExportKindForDeclaration(exportNode)); + } + } + else if (parent.kind === 242) { + var exportingModuleSymbol = parent.symbol.parent; + ts.Debug.assert(!!exportingModuleSymbol); + return { kind: 1, symbol: symbol, exportInfo: { exportingModuleSymbol: exportingModuleSymbol, exportKind: 2 } }; + } + else if (parent.kind === 193) { + return getSpecialPropertyExport(parent, true); + } + else if (parent.parent.kind === 193) { + return getSpecialPropertyExport(parent.parent, true); + } + } + function getSpecialPropertyExport(node, useLhsSymbol) { + var kind; + switch (ts.getSpecialPropertyAssignmentKind(node)) { + case 1: + kind = 0; + break; + case 2: + kind = 2; + break; + default: + return undefined; + } + var sym = useLhsSymbol ? checker.getSymbolAtLocation(node.left.name) : symbol; + return sym && exportInfo(sym, kind); + } + } + function getImport() { + var isImport = isNodeImport(node); + if (!isImport) + return; + var importedSymbol = checker.getImmediateAliasedSymbol(symbol); + if (importedSymbol) { + importedSymbol = skipExportSpecifierSymbol(importedSymbol, checker); + if (importedSymbol.name === "export=") { + importedSymbol = checker.getImmediateAliasedSymbol(importedSymbol); + } + if (symbolName(importedSymbol) === symbol.name) { + return __assign({ kind: 0, symbol: importedSymbol }, isImport); + } + } + } + function exportInfo(symbol, kind) { + var exportInfo = getExportInfo(symbol, kind, checker); + return exportInfo && { kind: 1, symbol: symbol, exportInfo: exportInfo }; + } + function getExportKindForDeclaration(node) { + return ts.hasModifier(node, 512) ? 1 : 0; + } + } + FindAllReferences.getImportOrExportSymbol = getImportOrExportSymbol; + function isNodeImport(node) { + var parent = node.parent; + switch (parent.kind) { + case 236: + return parent.name === node && isExternalModuleImportEquals(parent) + ? { isNamedImport: false } + : undefined; + case 241: + return parent.propertyName ? undefined : { isNamedImport: true }; + case 238: + case 239: + ts.Debug.assert(parent.name === node); + return { isNamedImport: false }; + default: + return undefined; + } + } + function getExportInfo(exportSymbol, exportKind, checker) { + var exportingModuleSymbol = checker.getMergedSymbol(exportSymbol.parent); + return ts.isExternalModuleSymbol(exportingModuleSymbol) ? { exportingModuleSymbol: exportingModuleSymbol, exportKind: exportKind } : undefined; + } + FindAllReferences.getExportInfo = getExportInfo; + function symbolName(symbol) { + if (symbol.name !== "default") { + return symbol.name; + } + var name = ts.forEach(symbol.declarations, function (_a) { + var name = _a.name; + return name && name.kind === 70 && name.text; + }); + ts.Debug.assert(!!name); + return name; + } + function skipExportSpecifierSymbol(symbol, checker) { + if (symbol.declarations) + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + if (ts.isExportSpecifier(declaration) && !declaration.propertyName && !declaration.parent.parent.moduleSpecifier) { + return checker.getExportSpecifierLocalTargetSymbol(declaration); + } + } + return symbol; + } + function getContainingModuleSymbol(importer, checker) { + return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); + } + function getSourceFileLikeForImportDeclaration(node) { + if (node.kind === 180) { + return node.getSourceFile(); + } + var parent = node.parent; + if (parent.kind === 264) { + return parent; + } + ts.Debug.assert(parent.kind === 233 && isAmbientModuleDeclaration(parent.parent)); + return parent.parent; + } + function isAmbientModuleDeclaration(node) { + return node.kind === 232 && node.name.kind === 9; + } + function isExternalModuleImportEquals(_a) { + var moduleReference = _a.moduleReference; + return moduleReference.kind === 247 && moduleReference.expression.kind === 9; + } + })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var FindAllReferences; + (function (FindAllReferences) { + function nodeEntry(node, isInString) { + return { type: "node", node: node, isInString: isInString }; + } + FindAllReferences.nodeEntry = nodeEntry; + function findReferencedSymbols(checker, cancellationToken, sourceFiles, sourceFile, position) { + var referencedSymbols = findAllReferencedSymbols(checker, cancellationToken, sourceFiles, sourceFile, position); + if (!referencedSymbols || !referencedSymbols.length) { return undefined; } - switch (node.kind) { - case 8: - if (!ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) { - break; - } - case 70: - case 98: - case 122: - case 9: - return getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFiles, findInStrings, findInComments, false); + var out = []; + for (var _i = 0, referencedSymbols_1 = referencedSymbols; _i < referencedSymbols_1.length; _i++) { + var _a = referencedSymbols_1[_i], definition = _a.definition, references = _a.references; + if (definition) { + out.push({ definition: definitionToReferencedSymbolDefinitionInfo(definition, checker), references: references.map(toReferenceEntry) }); + } } - return undefined; + return out; } FindAllReferences.findReferencedSymbols = findReferencedSymbols; - function getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFiles, findInStrings, findInComments, implementations) { - if (!implementations) { + function getImplementationsAtPosition(checker, cancellationToken, sourceFiles, sourceFile, position) { + var node = ts.getTouchingPropertyName(sourceFile, position); + var referenceEntries = getImplementationReferenceEntries(checker, cancellationToken, sourceFiles, node); + return ts.map(referenceEntries, function (entry) { return toImplementationLocation(entry, checker); }); + } + FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; + function getImplementationReferenceEntries(typeChecker, cancellationToken, sourceFiles, node) { + if (node.parent.kind === 261) { + var result_4 = []; + FindAllReferences.Core.getReferenceEntriesForShorthandPropertyAssignment(node, typeChecker, function (node) { return result_4.push(nodeEntry(node)); }); + return result_4; + } + else if (node.kind === 96 || ts.isSuperProperty(node.parent)) { + var symbol = typeChecker.getSymbolAtLocation(node); + return symbol.valueDeclaration && [nodeEntry(symbol.valueDeclaration)]; + } + else { + return getReferenceEntriesForNode(node, sourceFiles, typeChecker, cancellationToken, { implementations: true }); + } + } + function findReferencedEntries(checker, cancellationToken, sourceFiles, sourceFile, position, options) { + var x = flattenEntries(findAllReferencedSymbols(checker, cancellationToken, sourceFiles, sourceFile, position, options)); + return ts.map(x, toReferenceEntry); + } + FindAllReferences.findReferencedEntries = findReferencedEntries; + function getReferenceEntriesForNode(node, sourceFiles, checker, cancellationToken, options) { + if (options === void 0) { options = {}; } + return flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(node, sourceFiles, checker, cancellationToken, options)); + } + FindAllReferences.getReferenceEntriesForNode = getReferenceEntriesForNode; + function findAllReferencedSymbols(checker, cancellationToken, sourceFiles, sourceFile, position, options) { + var node = ts.getTouchingPropertyName(sourceFile, position, true); + return FindAllReferences.Core.getReferencedSymbolsForNode(node, sourceFiles, checker, cancellationToken, options); + } + function flattenEntries(referenceSymbols) { + return referenceSymbols && ts.flatMap(referenceSymbols, function (r) { return r.references; }); + } + function definitionToReferencedSymbolDefinitionInfo(def, checker) { + var info = (function () { + switch (def.type) { + case "symbol": { + var symbol = def.symbol, node_2 = def.node; + var declarations = symbol.declarations; + if (!declarations || declarations.length === 0) { + return undefined; + } + var _a = getDefinitionKindAndDisplayParts(symbol, node_2, checker), displayParts_1 = _a.displayParts, kind_1 = _a.kind; + var name_3 = displayParts_1.map(function (p) { return p.text; }).join(""); + return { node: node_2, name: name_3, kind: kind_1, displayParts: displayParts_1 }; + } + case "label": { + var node_3 = def.node; + return { node: node_3, name: node_3.text, kind: ts.ScriptElementKind.label, displayParts: [ts.displayPart(node_3.text, ts.SymbolDisplayPartKind.text)] }; + } + case "keyword": { + var node_4 = def.node; + var name_4 = ts.tokenToString(node_4.kind); + return { node: node_4, name: name_4, kind: ts.ScriptElementKind.keyword, displayParts: [{ text: name_4, kind: ts.ScriptElementKind.keyword }] }; + } + case "this": { + var node_5 = def.node; + var symbol = checker.getSymbolAtLocation(node_5); + var displayParts_2 = symbol && ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, node_5.getSourceFile(), ts.getContainerNode(node_5), node_5).displayParts; + return { node: node_5, name: "this", kind: ts.ScriptElementKind.variableElement, displayParts: displayParts_2 }; + } + case "string": { + var node_6 = def.node; + return { node: node_6, name: node_6.text, kind: ts.ScriptElementKind.variableElement, displayParts: [ts.displayPart(ts.getTextOfNode(node_6), ts.SymbolDisplayPartKind.stringLiteral)] }; + } + } + })(); + if (!info) { + return undefined; + } + var node = info.node, name = info.name, kind = info.kind, displayParts = info.displayParts; + var sourceFile = node.getSourceFile(); + return { + containerKind: "", + containerName: "", + fileName: sourceFile.fileName, + kind: kind, + name: name, + textSpan: ts.createTextSpanFromNode(node, sourceFile), + displayParts: displayParts + }; + } + function getDefinitionKindAndDisplayParts(symbol, node, checker) { + var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, node.getSourceFile(), ts.getContainerNode(node), node), displayParts = _a.displayParts, symbolKind = _a.symbolKind; + return { displayParts: displayParts, kind: symbolKind }; + } + function toReferenceEntry(entry) { + if (entry.type === "span") { + return { textSpan: entry.textSpan, fileName: entry.fileName, isWriteAccess: false, isDefinition: false }; + } + var node = entry.node, isInString = entry.isInString; + return { + fileName: node.getSourceFile().fileName, + textSpan: getTextSpan(node), + isWriteAccess: isWriteAccess(node), + isDefinition: ts.isDeclarationName(node) || ts.isLiteralComputedPropertyDeclarationName(node), + isInString: isInString + }; + } + function toImplementationLocation(entry, checker) { + if (entry.type === "node") { + var node = entry.node; + return __assign({ textSpan: getTextSpan(node), fileName: node.getSourceFile().fileName }, implementationKindDisplayParts(node, checker)); + } + else { + var textSpan = entry.textSpan, fileName = entry.fileName; + return { textSpan: textSpan, fileName: fileName, kind: ts.ScriptElementKind.unknown, displayParts: [] }; + } + } + function implementationKindDisplayParts(node, checker) { + var symbol = checker.getSymbolAtLocation(ts.isDeclaration(node) && node.name ? node.name : node); + if (symbol) { + return getDefinitionKindAndDisplayParts(symbol, node, checker); + } + else if (node.kind === 177) { + return { + kind: ts.ScriptElementKind.interfaceElement, + displayParts: [ts.punctuationPart(18), ts.textPart("object literal"), ts.punctuationPart(19)] + }; + } + else if (node.kind === 198) { + return { + kind: ts.ScriptElementKind.localClassElement, + displayParts: [ts.punctuationPart(18), ts.textPart("anonymous local class"), ts.punctuationPart(19)] + }; + } + else { + return { kind: ts.getNodeKind(node), displayParts: [] }; + } + } + function toHighlightSpan(entry) { + if (entry.type === "span") { + var fileName_1 = entry.fileName, textSpan = entry.textSpan; + return { fileName: fileName_1, span: { textSpan: textSpan, kind: ts.HighlightSpanKind.reference } }; + } + var node = entry.node, isInString = entry.isInString; + var fileName = entry.node.getSourceFile().fileName; + var writeAccess = isWriteAccess(node); + var span = { + textSpan: getTextSpan(node), + kind: writeAccess ? ts.HighlightSpanKind.writtenReference : ts.HighlightSpanKind.reference, + isInString: isInString + }; + return { fileName: fileName, span: span }; + } + FindAllReferences.toHighlightSpan = toHighlightSpan; + function getTextSpan(node) { + var start = node.getStart(); + var end = node.getEnd(); + if (node.kind === 9) { + start += 1; + end -= 1; + } + return ts.createTextSpanFromBounds(start, end); + } + function isWriteAccess(node) { + if (node.kind === 70 && ts.isDeclarationName(node)) { + return true; + } + var parent = node.parent; + if (parent) { + if (parent.kind === 192 || parent.kind === 191) { + return true; + } + else if (parent.kind === 193 && parent.left === node) { + var operator = parent.operatorToken.kind; + return 57 <= operator && operator <= 69; + } + } + return false; + } + })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); +})(ts || (ts = {})); +(function (ts) { + var FindAllReferences; + (function (FindAllReferences) { + var Core; + (function (Core) { + function getReferencedSymbolsForNode(node, sourceFiles, checker, cancellationToken, options) { + if (options === void 0) { options = {}; } + if (node.kind === 264) { + return undefined; + } + if (!options.implementations) { + var special = getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken); + if (special) { + return special; + } + } + var symbol = checker.getSymbolAtLocation(node); + if (!symbol) { + if (!options.implementations && node.kind === 9) { + return getReferencesForStringLiteral(node, sourceFiles, cancellationToken); + } + return undefined; + } + if (!symbol.declarations || !symbol.declarations.length) { + return undefined; + } + return getReferencedSymbolsForSymbol(symbol, node, sourceFiles, checker, cancellationToken, options); + } + Core.getReferencedSymbolsForNode = getReferencedSymbolsForNode; + function getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken) { + if (ts.isTypeKeyword(node.kind)) { + return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken); + } if (ts.isLabelName(node)) { if (ts.isJumpStatementTarget(node)) { var labelDefinition = ts.getTargetLabel(node.parent, node.text); - return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : undefined; + return labelDefinition && getLabelReferencesInNode(labelDefinition.parent, labelDefinition); } else { return getLabelReferencesInNode(node.parent, node); } } if (ts.isThis(node)) { - return getReferencesForThisKeyword(node, sourceFiles); + return getReferencesForThisKeyword(node, sourceFiles, cancellationToken); } if (node.kind === 96) { return getReferencesForSuperKeyword(node); } - } - var symbol = typeChecker.getSymbolAtLocation(node); - if (!implementations && !symbol && node.kind === 9) { - return getReferencesForStringLiteral(node, sourceFiles); - } - if (!symbol) { return undefined; } - var declarations = symbol.declarations; - if (!declarations || !declarations.length) { - return undefined; + function getReferencedSymbolsForSymbol(symbol, node, sourceFiles, checker, cancellationToken, options) { + symbol = skipPastExportOrImportSpecifier(symbol, node, checker); + var searchMeaning = getIntersectingMeaningFromDeclarations(ts.getMeaningFromLocation(node), symbol.declarations); + var result = []; + var state = createState(sourceFiles, node, checker, cancellationToken, searchMeaning, options, result); + var search = state.createSearch(node, symbol, undefined, { allSearchSymbols: populateSearchSymbolSet(symbol, node, checker, options.implementations) }); + var scope = getSymbolScope(symbol); + if (scope) { + getReferencesInContainer(scope, scope.getSourceFile(), search, state); + } + else { + for (var _i = 0, _a = state.sourceFiles; _i < _a.length; _i++) { + var sourceFile = _a[_i]; + state.cancellationToken.throwIfCancellationRequested(); + searchForName(sourceFile, search, state); + } + } + return result; } - var result; - var searchMeaning = getIntersectingMeaningFromDeclarations(ts.getMeaningFromLocation(node), declarations); - var declaredName = ts.stripQuotes(ts.getDeclaredName(typeChecker, symbol, node)); - var scope = getSymbolScope(symbol); - var symbolToIndex = []; - if (scope) { - result = []; - getReferencesInNode(scope, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); + function skipPastExportOrImportSpecifier(symbol, node, checker) { + var parent = node.parent; + if (ts.isExportSpecifier(parent)) { + return getLocalSymbolForExportSpecifier(node, symbol, parent, checker); + } + if (ts.isImportSpecifier(parent) && parent.propertyName === node) { + return checker.getImmediateAliasedSymbol(symbol); + } + return symbol; } - else { - var internedName = getInternedName(symbol, node); - for (var _i = 0, sourceFiles_8 = sourceFiles; _i < sourceFiles_8.length; _i++) { - var sourceFile = sourceFiles_8[_i]; - cancellationToken.throwIfCancellationRequested(); - var nameTable = ts.getNameTable(sourceFile); - if (nameTable[internedName] !== undefined) { - result = result || []; - getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); + function createState(sourceFiles, originalLocation, checker, cancellationToken, searchMeaning, options, result) { + var symbolIdToReferences = []; + var inheritsFromCache = ts.createMap(); + var sourceFileToSeenSymbols = []; + var isForConstructor = originalLocation.kind === 122; + var importTracker; + return __assign({}, options, { sourceFiles: sourceFiles, isForConstructor: isForConstructor, checker: checker, cancellationToken: cancellationToken, searchMeaning: searchMeaning, inheritsFromCache: inheritsFromCache, getImportSearches: getImportSearches, createSearch: createSearch, referenceAdder: referenceAdder, addStringOrCommentReference: addStringOrCommentReference, + markSearchedSymbol: markSearchedSymbol, markSeenContainingTypeReference: ts.nodeSeenTracker(), markSeenReExportRHS: ts.nodeSeenTracker() }); + function getImportSearches(exportSymbol, exportInfo) { + if (!importTracker) + importTracker = FindAllReferences.createImportTracker(sourceFiles, checker, cancellationToken); + return importTracker(exportSymbol, exportInfo, options.isForRename); + } + function createSearch(location, symbol, comingFrom, searchOptions) { + if (searchOptions === void 0) { searchOptions = {}; } + var _a = searchOptions.text, text = _a === void 0 ? ts.stripQuotes(ts.getDeclaredName(checker, symbol, location)) : _a, _b = searchOptions.allSearchSymbols, allSearchSymbols = _b === void 0 ? undefined : _b; + var escapedText = ts.escapeIdentifier(text); + var parents = options.implementations && getParentSymbolsOfPropertyAccess(location, symbol, checker); + return { location: location, symbol: symbol, comingFrom: comingFrom, text: text, escapedText: escapedText, parents: parents, includes: includes }; + function includes(referenceSymbol) { + return allSearchSymbols ? ts.contains(allSearchSymbols, referenceSymbol) : referenceSymbol === symbol; + } + } + function referenceAdder(referenceSymbol, searchLocation) { + var symbolId = ts.getSymbolId(referenceSymbol); + var references = symbolIdToReferences[symbolId]; + if (!references) { + references = symbolIdToReferences[symbolId] = []; + result.push({ definition: { type: "symbol", symbol: referenceSymbol, node: searchLocation }, references: references }); + } + return function (node) { return references.push(FindAllReferences.nodeEntry(node)); }; + } + function addStringOrCommentReference(fileName, textSpan) { + result.push({ + definition: undefined, + references: [{ type: "span", fileName: fileName, textSpan: textSpan }] + }); + } + function markSearchedSymbol(sourceFile, symbol) { + var sourceId = ts.getNodeId(sourceFile); + var symbolId = ts.getSymbolId(symbol); + var seenSymbols = sourceFileToSeenSymbols[sourceId] || (sourceFileToSeenSymbols[sourceId] = []); + return !seenSymbols[symbolId] && (seenSymbols[symbolId] = true); + } + } + function searchForImportsOfExport(exportLocation, exportSymbol, exportInfo, state) { + var _a = state.getImportSearches(exportSymbol, exportInfo), importSearches = _a.importSearches, singleReferences = _a.singleReferences, indirectUsers = _a.indirectUsers; + if (singleReferences.length) { + var addRef = state.referenceAdder(exportSymbol, exportLocation); + for (var _i = 0, singleReferences_1 = singleReferences; _i < singleReferences_1.length; _i++) { + var singleRef = singleReferences_1[_i]; + addRef(singleRef); + } + } + for (var _b = 0, importSearches_1 = importSearches; _b < importSearches_1.length; _b++) { + var _c = importSearches_1[_b], importLocation = _c[0], importSymbol = _c[1]; + getReferencesInSourceFile(importLocation.getSourceFile(), state.createSearch(importLocation, importSymbol, 1), state); + } + if (indirectUsers.length) { + var indirectSearch = void 0; + switch (exportInfo.exportKind) { + case 0: + indirectSearch = state.createSearch(exportLocation, exportSymbol, 1); + break; + case 1: + indirectSearch = state.isForRename ? undefined : state.createSearch(exportLocation, exportSymbol, 1, { text: "default" }); + break; + case 2: + break; + } + if (indirectSearch) { + for (var _d = 0, indirectUsers_1 = indirectUsers; _d < indirectUsers_1.length; _d++) { + var indirectUser = indirectUsers_1[_d]; + searchForName(indirectUser, indirectSearch, state); + } } } } - return result; - function getDefinition(symbol) { - var info = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, node.getSourceFile(), ts.getContainerNode(node), node); - var name = ts.map(info.displayParts, function (p) { return p.text; }).join(""); - var declarations = symbol.declarations; - if (!declarations || declarations.length === 0) { - return undefined; + function searchForImportedSymbol(symbol, state) { + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + getReferencesInSourceFile(declaration.getSourceFile(), state.createSearch(declaration, symbol, 0), state); } - return { - containerKind: "", - containerName: "", - name: name, - kind: info.symbolKind, - fileName: declarations[0].getSourceFile().fileName, - textSpan: ts.createTextSpan(declarations[0].getStart(), 0), - displayParts: info.displayParts - }; } - function getAliasSymbolForPropertyNameSymbol(symbol, location) { - if (symbol.flags & 8388608) { - var defaultImport = ts.getDeclarationOfKind(symbol, 236); - if (defaultImport) { - return typeChecker.getAliasedSymbol(symbol); - } - var importOrExportSpecifier = ts.forEach(symbol.declarations, function (declaration) { return (declaration.kind === 239 || - declaration.kind === 243) ? declaration : undefined; }); - if (importOrExportSpecifier && - (!importOrExportSpecifier.propertyName || - importOrExportSpecifier.propertyName === location)) { - return importOrExportSpecifier.kind === 239 ? - typeChecker.getAliasedSymbol(symbol) : - typeChecker.getExportSpecifierLocalTargetSymbol(importOrExportSpecifier); - } + function searchForName(sourceFile, search, state) { + if (ts.getNameTable(sourceFile).get(search.escapedText) !== undefined) { + getReferencesInSourceFile(sourceFile, search, state); } - return undefined; } - function followAliasIfNecessary(symbol, location) { - return getAliasSymbolForPropertyNameSymbol(symbol, location) || symbol; - } - function getPropertySymbolOfDestructuringAssignment(location) { + function getPropertySymbolOfDestructuringAssignment(location, checker) { return ts.isArrayLiteralOrObjectLiteralDestructuringPattern(location.parent.parent) && - typeChecker.getPropertySymbolOfDestructuringAssignment(location); + checker.getPropertySymbolOfDestructuringAssignment(location); } function isObjectBindingPatternElementWithoutPropertyName(symbol) { - var bindingElement = ts.getDeclarationOfKind(symbol, 174); + var bindingElement = ts.getDeclarationOfKind(symbol, 175); return bindingElement && - bindingElement.parent.kind === 172 && + bindingElement.parent.kind === 173 && !bindingElement.propertyName; } - function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol) { + function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker) { if (isObjectBindingPatternElementWithoutPropertyName(symbol)) { - var bindingElement = ts.getDeclarationOfKind(symbol, 174); - var typeOfPattern = typeChecker.getTypeAtLocation(bindingElement.parent); - return typeOfPattern && typeChecker.getPropertyOfType(typeOfPattern, bindingElement.name.text); + var bindingElement = ts.getDeclarationOfKind(symbol, 175); + var typeOfPattern = checker.getTypeAtLocation(bindingElement.parent); + return typeOfPattern && checker.getPropertyOfType(typeOfPattern, bindingElement.name.text); } return undefined; } - function getInternedName(symbol, location) { - if (ts.isImportOrExportSpecifierName(location)) { - return location.getText(); - } - var localExportDefaultSymbol = ts.getLocalSymbolForExportDefault(symbol); - symbol = localExportDefaultSymbol || symbol; - return ts.stripQuotes(symbol.name); - } function getSymbolScope(symbol) { - var valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 184 || valueDeclaration.kind === 197)) { + var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; + if (valueDeclaration && (valueDeclaration.kind === 185 || valueDeclaration.kind === 198)) { return valueDeclaration; } - if (symbol.flags & (4 | 8192)) { - var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (ts.getModifierFlags(d) & 8) ? d : undefined; }); - if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 226); - } - } - if (symbol.flags & 8388608) { + if (!declarations) { return undefined; } + if (flags & (4 | 8192)) { + var privateDeclaration = ts.find(declarations, function (d) { return !!(ts.getModifierFlags(d) & 8); }); + if (privateDeclaration) { + return ts.getAncestor(privateDeclaration, 228); + } + } if (isObjectBindingPatternElementWithoutPropertyName(symbol)) { return undefined; } - if (symbol.parent || (symbol.flags & 268435456)) { + if (parent && !((parent.flags & 1536) && ts.isExternalModuleSymbol(parent) && !parent.globalExports)) { + return undefined; + } + if ((flags & 134217728 && symbol.checkFlags & 6)) { return undefined; } var scope; - var declarations = symbol.getDeclarations(); - if (declarations) { - for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { - var declaration = declarations_7[_i]; - var container = ts.getContainerNode(declaration); - if (!container) { - return undefined; - } - if (scope && scope !== container) { - return undefined; - } - if (container.kind === 261 && !ts.isExternalModule(container)) { - return undefined; - } - scope = container; + for (var _i = 0, declarations_10 = declarations; _i < declarations_10.length; _i++) { + var declaration = declarations_10[_i]; + var container = ts.getContainerNode(declaration); + if (scope && scope !== container) { + return undefined; } + if (!container || container.kind === 264 && !ts.isExternalOrCommonJsModule(container)) { + return undefined; + } + scope = container; } - return scope; + return parent ? scope.getSourceFile() : scope; } function getPossibleSymbolReferencePositions(sourceFile, symbolName, start, end) { var positions = []; @@ -56390,7 +62546,6 @@ var ts; var symbolNameLength = symbolName.length; var position = text.indexOf(symbolName, start); while (position >= 0) { - cancellationToken.throwIfCancellationRequested(); if (position > end) break; var endPosition = position + symbolNameLength; @@ -56407,242 +62562,277 @@ var ts; var sourceFile = container.getSourceFile(); var labelName = targetLabel.text; var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, labelName, container.getStart(), container.getEnd()); - ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); + for (var _i = 0, possiblePositions_1 = possiblePositions; _i < possiblePositions_1.length; _i++) { + var position = possiblePositions_1[_i]; var node = ts.getTouchingWord(sourceFile, position); if (!node || node.getWidth() !== labelName.length) { - return; + continue; } if (node === targetLabel || (ts.isJumpStatementTarget(node) && ts.getTargetLabel(node, labelName) === targetLabel)) { - references.push(getReferenceEntryFromNode(node)); + references.push(FindAllReferences.nodeEntry(node)); } - }); - var definition = { - containerKind: "", - containerName: "", - fileName: targetLabel.getSourceFile().fileName, - kind: ts.ScriptElementKind.label, - name: labelName, - textSpan: ts.createTextSpanFromBounds(targetLabel.getStart(), targetLabel.getEnd()), - displayParts: [ts.displayPart(labelName, ts.SymbolDisplayPartKind.text)] - }; - return [{ definition: definition, references: references }]; + } + return [{ definition: { type: "label", node: targetLabel }, references: references }]; } function isValidReferencePosition(node, searchSymbolName) { - if (node) { - switch (node.kind) { - case 70: - return node.getWidth() === searchSymbolName.length; - case 9: - if (ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || - isNameOfExternalModuleImportOrDeclaration(node)) { - return node.getWidth() === searchSymbolName.length + 2; - } - break; - case 8: - if (ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) { - return node.getWidth() === searchSymbolName.length; - } - break; - } + switch (node && node.kind) { + case 70: + return node.getWidth() === searchSymbolName.length; + case 9: + return (ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) && + node.getWidth() === searchSymbolName.length + 2; + case 8: + return ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && node.getWidth() === searchSymbolName.length; + default: + return false; } - return false; } - function getReferencesInNode(container, searchSymbol, searchText, searchLocation, searchMeaning, findInStrings, findInComments, result, symbolToIndex) { - var sourceFile = container.getSourceFile(); - var start = findInComments ? container.getFullStart() : container.getStart(); - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, searchText, start, container.getEnd()); - var parents = getParentSymbolsOfPropertyAccess(); - var inheritsFromCache = ts.createMap(); - if (possiblePositions.length) { - var searchSymbols_1 = populateSearchSymbolSet(searchSymbol, searchLocation); - ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); - var referenceLocation = ts.getTouchingPropertyName(sourceFile, position); - if (!isValidReferencePosition(referenceLocation, searchText)) { - if (!implementations && ((findInStrings && ts.isInString(sourceFile, position)) || - (findInComments && ts.isInNonReferenceComment(sourceFile, position)))) { - result.push({ - definition: undefined, - references: [{ - fileName: sourceFile.fileName, - textSpan: ts.createTextSpan(position, searchText.length), - isWriteAccess: false, - isDefinition: false - }] - }); - } - return; - } - if (!(ts.getMeaningFromLocation(referenceLocation) & searchMeaning)) { - return; - } - var referenceSymbol = typeChecker.getSymbolAtLocation(referenceLocation); - if (referenceSymbol) { - var referenceSymbolDeclaration = referenceSymbol.valueDeclaration; - var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration); - var relatedSymbol = getRelatedSymbol(searchSymbols_1, referenceSymbol, referenceLocation, searchLocation.kind === 122, parents, inheritsFromCache); - if (relatedSymbol) { - addReferenceToRelatedSymbol(referenceLocation, relatedSymbol); - } - else if (!(referenceSymbol.flags & 67108864) && searchSymbols_1.indexOf(shorthandValueSymbol) >= 0) { - addReferenceToRelatedSymbol(referenceSymbolDeclaration.name, shorthandValueSymbol); - } - else if (searchLocation.kind === 122) { - findAdditionalConstructorReferences(referenceSymbol, referenceLocation); - } - } - }); + function getAllReferencesForKeyword(sourceFiles, keywordKind, cancellationToken) { + var references = []; + for (var _i = 0, sourceFiles_5 = sourceFiles; _i < sourceFiles_5.length; _i++) { + var sourceFile = sourceFiles_5[_i]; + cancellationToken.throwIfCancellationRequested(); + addReferencesForKeywordInFile(sourceFile, keywordKind, ts.tokenToString(keywordKind), references); } - return; - function getParentSymbolsOfPropertyAccess() { - if (implementations) { - var propertyAccessExpression = getPropertyAccessExpressionFromRightHandSide(searchLocation); - if (propertyAccessExpression) { - var localParentType = typeChecker.getTypeAtLocation(propertyAccessExpression.expression); - if (localParentType) { - if (localParentType.symbol && localParentType.symbol.flags & (32 | 64) && localParentType.symbol !== searchSymbol.parent) { - return [localParentType.symbol]; - } - else if (localParentType.flags & 196608) { - return getSymbolsForClassAndInterfaceComponents(localParentType); - } - } - } + return references.length ? [{ definition: { type: "keyword", node: references[0].node }, references: references }] : undefined; + } + function addReferencesForKeywordInFile(sourceFile, kind, searchText, references) { + var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, searchText, sourceFile.getStart(), sourceFile.getEnd()); + for (var _i = 0, possiblePositions_2 = possiblePositions; _i < possiblePositions_2.length; _i++) { + var position = possiblePositions_2[_i]; + var referenceLocation = ts.getTouchingPropertyName(sourceFile, position); + if (referenceLocation.kind === kind) { + references.push(FindAllReferences.nodeEntry(referenceLocation)); } } - function getPropertyAccessExpressionFromRightHandSide(node) { - return ts.isRightSideOfPropertyAccess(node) && node.parent; + } + function getReferencesInSourceFile(sourceFile, search, state) { + state.cancellationToken.throwIfCancellationRequested(); + return getReferencesInContainer(sourceFile, sourceFile, search, state); + } + function getReferencesInContainer(container, sourceFile, search, state) { + if (!state.markSearchedSymbol(sourceFile, search.symbol)) { + return; } - function findAdditionalConstructorReferences(referenceSymbol, referenceLocation) { - ts.Debug.assert(ts.isClassLike(searchSymbol.valueDeclaration)); - var referenceClass = referenceLocation.parent; - if (referenceSymbol === searchSymbol && ts.isClassLike(referenceClass)) { - ts.Debug.assert(referenceClass.name === referenceLocation); - addReferences(findOwnConstructorCalls(searchSymbol)); + var start = state.findInComments ? container.getFullStart() : container.getStart(); + var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, search.text, start, container.getEnd()); + for (var _i = 0, possiblePositions_3 = possiblePositions; _i < possiblePositions_3.length; _i++) { + var position = possiblePositions_3[_i]; + getReferencesAtLocation(sourceFile, position, search, state); + } + } + function getReferencesAtLocation(sourceFile, position, search, state) { + var referenceLocation = ts.getTouchingPropertyName(sourceFile, position); + if (!isValidReferencePosition(referenceLocation, search.text)) { + if (!state.implementations && (state.findInStrings && ts.isInString(sourceFile, position) || state.findInComments && ts.isInNonReferenceComment(sourceFile, position))) { + state.addStringOrCommentReference(sourceFile.fileName, ts.createTextSpan(position, search.text.length)); } - else { - var classExtending = tryGetClassByExtendingIdentifier(referenceLocation); - if (classExtending && ts.isClassLike(classExtending) && followAliasIfNecessary(referenceSymbol, referenceLocation) === searchSymbol) { - addReferences(superConstructorAccesses(classExtending)); - } + return; + } + if (!(ts.getMeaningFromLocation(referenceLocation) & state.searchMeaning)) { + return; + } + var referenceSymbol = state.checker.getSymbolAtLocation(referenceLocation); + if (!referenceSymbol) { + return; + } + var parent = referenceLocation.parent; + if (ts.isImportSpecifier(parent) && parent.propertyName === referenceLocation) { + return; + } + if (ts.isExportSpecifier(parent)) { + ts.Debug.assert(referenceLocation.kind === 70); + getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, parent, search, state); + return; + } + var relatedSymbol = getRelatedSymbol(search, referenceSymbol, referenceLocation, state); + if (!relatedSymbol) { + getReferenceForShorthandProperty(referenceSymbol, search, state); + return; + } + if (state.isForConstructor) { + findConstructorReferences(referenceLocation, sourceFile, search, state); + } + else { + addReference(referenceLocation, relatedSymbol, search.location, state); + } + getImportOrExportReferences(referenceLocation, referenceSymbol, search, state); + } + function getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, search, state) { + var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name; + var exportDeclaration = parent.parent; + var localSymbol = getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, state.checker); + if (!search.includes(localSymbol)) { + return; + } + if (!propertyName) { + addRef(); + } + else if (referenceLocation === propertyName) { + if (!exportDeclaration.moduleSpecifier) { + addRef(); + } + if (!state.isForRename && state.markSeenReExportRHS(name)) { + addReference(name, referenceSymbol, name, state); } } - function addReferences(references) { - if (references.length) { - var referencedSymbol = getReferencedSymbol(searchSymbol); - ts.addRange(referencedSymbol.references, ts.map(references, getReferenceEntryFromNode)); + else { + if (state.markSeenReExportRHS(referenceLocation)) { + addRef(); } } - function findOwnConstructorCalls(classSymbol) { - var result = []; - for (var _i = 0, _a = classSymbol.members["__constructor"].declarations; _i < _a.length; _i++) { - var decl = _a[_i]; - ts.Debug.assert(decl.kind === 150); - var ctrKeyword = decl.getChildAt(0); - ts.Debug.assert(ctrKeyword.kind === 122); - result.push(ctrKeyword); - } - ts.forEachProperty(classSymbol.exports, function (member) { - var decl = member.valueDeclaration; - if (decl && decl.kind === 149) { - var body = decl.body; - if (body) { - forEachDescendantOfKind(body, 98, function (thisKeyword) { - if (ts.isNewExpressionTarget(thisKeyword)) { - result.push(thisKeyword); - } - }); - } - } - }); - return result; + if (!(referenceLocation === propertyName && state.isForRename)) { + var exportKind = referenceLocation.originalKeywordKind === 78 ? 1 : 0; + var exportInfo = FindAllReferences.getExportInfo(referenceSymbol, exportKind, state.checker); + ts.Debug.assert(!!exportInfo); + searchForImportsOfExport(referenceLocation, referenceSymbol, exportInfo, state); } - function superConstructorAccesses(cls) { - var symbol = cls.symbol; - var ctr = symbol.members["__constructor"]; - if (!ctr) { - return []; + if (search.comingFrom !== 1 && exportDeclaration.moduleSpecifier && !propertyName) { + searchForImportedSymbol(state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier), state); + } + function addRef() { + addReference(referenceLocation, localSymbol, search.location, state); + } + } + function getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, checker) { + return isExportSpecifierAlias(referenceLocation, exportSpecifier) ? checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) : referenceSymbol; + } + function isExportSpecifierAlias(referenceLocation, exportSpecifier) { + var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name; + ts.Debug.assert(propertyName === referenceLocation || name === referenceLocation); + if (propertyName) { + return propertyName === referenceLocation; + } + else { + return !parent.parent.moduleSpecifier; + } + } + function getImportOrExportReferences(referenceLocation, referenceSymbol, search, state) { + var importOrExport = FindAllReferences.getImportOrExportSymbol(referenceLocation, referenceSymbol, state.checker, search.comingFrom === 1); + if (!importOrExport) + return; + var symbol = importOrExport.symbol; + if (importOrExport.kind === 0) { + if (!state.isForRename || importOrExport.isNamedImport) { + searchForImportedSymbol(symbol, state); } - var result = []; - for (var _i = 0, _a = ctr.declarations; _i < _a.length; _i++) { - var decl = _a[_i]; - ts.Debug.assert(decl.kind === 150); + } + else { + searchForImportsOfExport(referenceLocation, symbol, importOrExport.exportInfo, state); + } + } + function getReferenceForShorthandProperty(_a, search, state) { + var flags = _a.flags, valueDeclaration = _a.valueDeclaration; + var shorthandValueSymbol = state.checker.getShorthandAssignmentValueSymbol(valueDeclaration); + if (!(flags & 134217728) && search.includes(shorthandValueSymbol)) { + addReference(valueDeclaration.name, shorthandValueSymbol, search.location, state); + } + } + function addReference(referenceLocation, relatedSymbol, searchLocation, state) { + var addRef = state.referenceAdder(relatedSymbol, searchLocation); + if (state.implementations) { + addImplementationReferences(referenceLocation, addRef, state); + } + else { + addRef(referenceLocation); + } + } + function findConstructorReferences(referenceLocation, sourceFile, search, state) { + if (ts.isNewExpressionTarget(referenceLocation)) { + addReference(referenceLocation, search.symbol, search.location, state); + } + var pusher = state.referenceAdder(search.symbol, search.location); + if (ts.isClassLike(referenceLocation.parent)) { + ts.Debug.assert(referenceLocation.parent.name === referenceLocation); + findOwnConstructorReferences(search.symbol, sourceFile, pusher); + } + else { + var classExtending = tryGetClassByExtendingIdentifier(referenceLocation); + if (classExtending && ts.isClassLike(classExtending)) { + findSuperConstructorAccesses(classExtending, pusher); + } + } + } + function getPropertyAccessExpressionFromRightHandSide(node) { + return ts.isRightSideOfPropertyAccess(node) && node.parent; + } + function findOwnConstructorReferences(classSymbol, sourceFile, addNode) { + for (var _i = 0, _a = classSymbol.members.get("__constructor").declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + var ctrKeyword = ts.findChildOfKind(decl, 122, sourceFile); + ts.Debug.assert(decl.kind === 151 && !!ctrKeyword); + addNode(ctrKeyword); + } + classSymbol.exports.forEach(function (member) { + var decl = member.valueDeclaration; + if (decl && decl.kind === 150) { var body = decl.body; if (body) { - forEachDescendantOfKind(body, 96, function (node) { - if (ts.isCallExpressionTarget(node)) { - result.push(node); + forEachDescendantOfKind(body, 98, function (thisKeyword) { + if (ts.isNewExpressionTarget(thisKeyword)) { + addNode(thisKeyword); } }); } } - ; - return result; + }); + } + function findSuperConstructorAccesses(cls, addNode) { + var symbol = cls.symbol; + var ctr = symbol.members.get("__constructor"); + if (!ctr) { + return; } - function getReferencedSymbol(symbol) { - var symbolId = ts.getSymbolId(symbol); - var index = symbolToIndex[symbolId]; - if (index === undefined) { - index = result.length; - symbolToIndex[symbolId] = index; - result.push({ - definition: getDefinition(symbol), - references: [] + for (var _i = 0, _a = ctr.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + ts.Debug.assert(decl.kind === 151); + var body = decl.body; + if (body) { + forEachDescendantOfKind(body, 96, function (node) { + if (ts.isCallExpressionTarget(node)) { + addNode(node); + } }); } - return result[index]; - } - function addReferenceToRelatedSymbol(node, relatedSymbol) { - var references = getReferencedSymbol(relatedSymbol).references; - if (implementations) { - getImplementationReferenceEntryForNode(node, references); - } - else { - references.push(getReferenceEntryFromNode(node)); - } } } - function getImplementationReferenceEntryForNode(refNode, result) { + function addImplementationReferences(refNode, addReference, state) { if (ts.isDeclarationName(refNode) && isImplementation(refNode.parent)) { - result.push(getReferenceEntryFromNode(refNode.parent)); + addReference(refNode.parent); + return; } - else if (refNode.kind === 70) { - if (refNode.parent.kind === 258) { - getReferenceEntriesForShorthandPropertyAssignment(refNode, typeChecker, result); - } - var containingClass = getContainingClassIfInHeritageClause(refNode); - if (containingClass) { - result.push(getReferenceEntryFromNode(containingClass)); - return; - } - var containingTypeReference = getContainingTypeReference(refNode); - if (containingTypeReference) { - var parent_18 = containingTypeReference.parent; - if (ts.isVariableLike(parent_18) && parent_18.type === containingTypeReference && parent_18.initializer && isImplementationExpression(parent_18.initializer)) { - maybeAdd(getReferenceEntryFromNode(parent_18.initializer)); - } - else if (ts.isFunctionLike(parent_18) && parent_18.type === containingTypeReference && parent_18.body) { - if (parent_18.body.kind === 204) { - ts.forEachReturnStatement(parent_18.body, function (returnStatement) { - if (returnStatement.expression && isImplementationExpression(returnStatement.expression)) { - maybeAdd(getReferenceEntryFromNode(returnStatement.expression)); - } - }); - } - else if (isImplementationExpression(parent_18.body)) { - maybeAdd(getReferenceEntryFromNode(parent_18.body)); - } - } - else if (ts.isAssertionExpression(parent_18) && isImplementationExpression(parent_18.expression)) { - maybeAdd(getReferenceEntryFromNode(parent_18.expression)); - } - } + if (refNode.kind !== 70) { + return; } - function maybeAdd(a) { - if (!ts.forEach(result, function (b) { return a.fileName === b.fileName && a.textSpan.start === b.textSpan.start && a.textSpan.length === b.textSpan.length; })) { - result.push(a); + if (refNode.parent.kind === 261) { + getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); + } + var containingClass = getContainingClassIfInHeritageClause(refNode); + if (containingClass) { + addReference(containingClass); + return; + } + var containingTypeReference = getContainingTypeReference(refNode); + if (containingTypeReference && state.markSeenContainingTypeReference(containingTypeReference)) { + var parent = containingTypeReference.parent; + if (ts.isVariableLike(parent) && parent.type === containingTypeReference && parent.initializer && isImplementationExpression(parent.initializer)) { + addReference(parent.initializer); + } + else if (ts.isFunctionLike(parent) && parent.type === containingTypeReference && parent.body) { + if (parent.body.kind === 206) { + ts.forEachReturnStatement(parent.body, function (returnStatement) { + if (returnStatement.expression && isImplementationExpression(returnStatement.expression)) { + addReference(returnStatement.expression); + } + }); + } + else if (isImplementationExpression(parent.body)) { + addReference(parent.body); + } + } + else if (ts.isAssertionExpression(parent) && isImplementationExpression(parent.expression)) { + addReference(parent.expression); } } } @@ -56671,28 +62861,32 @@ var ts; } function getContainingClassIfInHeritageClause(node) { if (node && node.parent) { - if (node.kind === 199 - && node.parent.kind === 255 + if (node.kind === 200 + && node.parent.kind === 258 && ts.isClassLike(node.parent.parent)) { return node.parent.parent; } - else if (node.kind === 70 || node.kind === 177) { + else if (node.kind === 70 || node.kind === 178) { return getContainingClassIfInHeritageClause(node.parent); } } return undefined; } function isImplementationExpression(node) { - if (node.kind === 183) { - return isImplementationExpression(node.expression); + switch (node.kind) { + case 184: + return isImplementationExpression(node.expression); + case 186: + case 185: + case 177: + case 198: + case 176: + return true; + default: + return false; } - return node.kind === 185 || - node.kind === 184 || - node.kind === 176 || - node.kind === 197 || - node.kind === 175; } - function explicitlyInheritsFrom(child, parent, cachedResults) { + function explicitlyInheritsFrom(child, parent, cachedResults, checker) { var parentIsInterface = parent.getFlags() & 64; return searchHierarchy(child); function searchHierarchy(symbol) { @@ -56700,10 +62894,11 @@ var ts; return true; } var key = ts.getSymbolId(symbol) + "," + ts.getSymbolId(parent); - if (key in cachedResults) { - return cachedResults[key]; + var cached = cachedResults.get(key); + if (cached !== undefined) { + return cached; } - cachedResults[key] = false; + cachedResults.set(key, false); var inherits = ts.forEach(symbol.getDeclarations(), function (declaration) { if (ts.isClassLike(declaration)) { if (parentIsInterface) { @@ -56719,19 +62914,19 @@ var ts; } return searchTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); } - else if (declaration.kind === 227) { + else if (declaration.kind === 229) { if (parentIsInterface) { return ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), searchTypeReference); } } return false; }); - cachedResults[key] = inherits; + cachedResults.set(key, inherits); return inherits; } function searchTypeReference(typeReference) { if (typeReference) { - var type = typeChecker.getTypeAtLocation(typeReference); + var type = checker.getTypeAtLocation(typeReference); if (type && type.symbol) { return searchHierarchy(type.symbol); } @@ -56746,13 +62941,13 @@ var ts; } var staticFlag = 32; switch (searchSpaceNode.kind) { - case 147: - case 146: - case 149: case 148: + case 147: case 150: + case 149: case 151: case 152: + case 153: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; break; @@ -56762,51 +62957,51 @@ var ts; var references = []; var sourceFile = searchSpaceNode.getSourceFile(); var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); - ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); + for (var _i = 0, possiblePositions_4 = possiblePositions; _i < possiblePositions_4.length; _i++) { + var position = possiblePositions_4[_i]; var node = ts.getTouchingWord(sourceFile, position); if (!node || node.kind !== 96) { - return; + continue; } var container = ts.getSuperContainer(node, false); if (container && (32 & ts.getModifierFlags(container)) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) { - references.push(getReferenceEntryFromNode(node)); + references.push(FindAllReferences.nodeEntry(node)); } - }); - var definition = getDefinition(searchSpaceNode.symbol); - return [{ definition: definition, references: references }]; + } + return [{ definition: { type: "symbol", symbol: searchSpaceNode.symbol, node: superKeyword }, references: references }]; } - function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles) { + function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, false); var staticFlag = 32; switch (searchSpaceNode.kind) { + case 150: case 149: - case 148: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } + case 148: case 147: - case 146: - case 150: case 151: case 152: + case 153: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; break; - case 261: + case 264: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } - case 225: - case 184: + case 227: + case 185: break; default: return undefined; } var references = []; var possiblePositions; - if (searchSpaceNode.kind === 261) { + if (searchSpaceNode.kind === 264) { ts.forEach(sourceFiles, function (sourceFile) { + cancellationToken.throwIfCancellationRequested(); possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); }); @@ -56816,139 +63011,109 @@ var ts; possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, references); } - var thisOrSuperSymbol = typeChecker.getSymbolAtLocation(thisOrSuperKeyword); - var displayParts = thisOrSuperSymbol && ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, thisOrSuperSymbol, thisOrSuperKeyword.getSourceFile(), ts.getContainerNode(thisOrSuperKeyword), thisOrSuperKeyword).displayParts; return [{ - definition: { - containerKind: "", - containerName: "", - fileName: node.getSourceFile().fileName, - kind: ts.ScriptElementKind.variableElement, - name: "this", - textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()), - displayParts: displayParts - }, + definition: { type: "this", node: thisOrSuperKeyword }, references: references }]; function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result) { ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); var node = ts.getTouchingWord(sourceFile, position); if (!node || !ts.isThis(node)) { return; } var container = ts.getThisContainer(node, false); switch (searchSpaceNode.kind) { - case 184: - case 225: + case 185: + case 227: if (searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(node)); + result.push(FindAllReferences.nodeEntry(node)); } break; + case 150: case 149: - case 148: if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(node)); + result.push(FindAllReferences.nodeEntry(node)); } break; - case 197: - case 226: + case 198: + case 228: if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32) === staticFlag) { - result.push(getReferenceEntryFromNode(node)); + result.push(FindAllReferences.nodeEntry(node)); } break; - case 261: - if (container.kind === 261 && !ts.isExternalModule(container)) { - result.push(getReferenceEntryFromNode(node)); + case 264: + if (container.kind === 264 && !ts.isExternalModule(container)) { + result.push(FindAllReferences.nodeEntry(node)); } break; } }); } } - function getReferencesForStringLiteral(node, sourceFiles) { - var type = ts.getStringLiteralTypeForNode(node, typeChecker); - if (!type) { - return undefined; - } + function getReferencesForStringLiteral(node, sourceFiles, cancellationToken) { var references = []; - for (var _i = 0, sourceFiles_9 = sourceFiles; _i < sourceFiles_9.length; _i++) { - var sourceFile = sourceFiles_9[_i]; - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, type.text, sourceFile.getStart(), sourceFile.getEnd()); - getReferencesForStringLiteralInFile(sourceFile, type, possiblePositions, references); + for (var _i = 0, sourceFiles_6 = sourceFiles; _i < sourceFiles_6.length; _i++) { + var sourceFile = sourceFiles_6[_i]; + cancellationToken.throwIfCancellationRequested(); + var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, node.text, sourceFile.getStart(), sourceFile.getEnd()); + getReferencesForStringLiteralInFile(sourceFile, node.text, possiblePositions, references); } return [{ - definition: { - containerKind: "", - containerName: "", - fileName: node.getSourceFile().fileName, - kind: ts.ScriptElementKind.variableElement, - name: type.text, - textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()), - displayParts: [ts.displayPart(ts.getTextOfNode(node), ts.SymbolDisplayPartKind.stringLiteral)] - }, + definition: { type: "string", node: node }, references: references }]; - function getReferencesForStringLiteralInFile(sourceFile, searchType, possiblePositions, references) { - for (var _i = 0, possiblePositions_1 = possiblePositions; _i < possiblePositions_1.length; _i++) { - var position = possiblePositions_1[_i]; - cancellationToken.throwIfCancellationRequested(); - var node_2 = ts.getTouchingWord(sourceFile, position); - if (!node_2 || node_2.kind !== 9) { - return; - } - var type_2 = ts.getStringLiteralTypeForNode(node_2, typeChecker); - if (type_2 === searchType) { - references.push(getReferenceEntryFromNode(node_2)); + function getReferencesForStringLiteralInFile(sourceFile, searchText, possiblePositions, references) { + for (var _i = 0, possiblePositions_5 = possiblePositions; _i < possiblePositions_5.length; _i++) { + var position = possiblePositions_5[_i]; + var node_7 = ts.getTouchingWord(sourceFile, position); + if (node_7 && node_7.kind === 9 && node_7.text === searchText) { + references.push(FindAllReferences.nodeEntry(node_7, true)); } } } } - function populateSearchSymbolSet(symbol, location) { + function populateSearchSymbolSet(symbol, location, checker, implementations) { var result = [symbol]; - var containingObjectLiteralElement = getContainingObjectLiteralElement(location); - if (containingObjectLiteralElement && containingObjectLiteralElement.kind !== 258) { - var propertySymbol = getPropertySymbolOfDestructuringAssignment(location); - if (propertySymbol) { - result.push(propertySymbol); - } - } - var aliasSymbol = getAliasSymbolForPropertyNameSymbol(symbol, location); - if (aliasSymbol) { - result = result.concat(populateSearchSymbolSet(aliasSymbol, location)); - } + var containingObjectLiteralElement = ts.getContainingObjectLiteralElement(location); if (containingObjectLiteralElement) { - ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement), function (contextualSymbol) { - ts.addRange(result, typeChecker.getRootSymbols(contextualSymbol)); + if (containingObjectLiteralElement.kind !== 261) { + var propertySymbol = getPropertySymbolOfDestructuringAssignment(location, checker); + if (propertySymbol) { + result.push(propertySymbol); + } + } + ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker), function (contextualSymbol) { + ts.addRange(result, checker.getRootSymbols(contextualSymbol)); }); - var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(location.parent); + var shorthandValueSymbol = checker.getShorthandAssignmentValueSymbol(location.parent); if (shorthandValueSymbol) { result.push(shorthandValueSymbol); } } - if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 144 && + if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 145 && ts.isParameterPropertyDeclaration(symbol.valueDeclaration)) { - result = result.concat(typeChecker.getSymbolsOfParameterPropertyDeclaration(symbol.valueDeclaration, symbol.name)); + ts.addRange(result, checker.getSymbolsOfParameterPropertyDeclaration(symbol.valueDeclaration, symbol.name)); } - var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol); + var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker); if (bindingElementPropertySymbol) { result.push(bindingElementPropertySymbol); } - ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) { + for (var _i = 0, _a = checker.getRootSymbols(symbol); _i < _a.length; _i++) { + var rootSymbol = _a[_i]; if (rootSymbol !== symbol) { result.push(rootSymbol); } if (!implementations && rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, ts.createMap()); + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, ts.createMap(), checker); } - }); + } return result; } - function getPropertySymbolsFromBaseTypes(symbol, propertyName, result, previousIterationSymbolsCache) { + function getPropertySymbolsFromBaseTypes(symbol, propertyName, result, previousIterationSymbolsCache, checker) { if (!symbol) { return; } - if (symbol.name in previousIterationSymbolsCache) { + if (previousIterationSymbolsCache.has(symbol.name)) { return; } if (symbol.flags & (32 | 64)) { @@ -56957,7 +63122,7 @@ var ts; getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 227) { + else if (declaration.kind === 229) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -56965,62 +63130,56 @@ var ts; return; function getPropertySymbolFromTypeReference(typeReference) { if (typeReference) { - var type = typeChecker.getTypeAtLocation(typeReference); + var type = checker.getTypeAtLocation(typeReference); if (type) { - var propertySymbol = typeChecker.getPropertyOfType(type, propertyName); + var propertySymbol = checker.getPropertyOfType(type, propertyName); if (propertySymbol) { - result.push.apply(result, typeChecker.getRootSymbols(propertySymbol)); + result.push.apply(result, checker.getRootSymbols(propertySymbol)); } - previousIterationSymbolsCache[symbol.name] = symbol; - getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result, previousIterationSymbolsCache); + previousIterationSymbolsCache.set(symbol.name, symbol); + getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result, previousIterationSymbolsCache, checker); } } } } - function getRelatedSymbol(searchSymbols, referenceSymbol, referenceLocation, searchLocationIsConstructor, parents, cache) { - if (ts.contains(searchSymbols, referenceSymbol)) { - return (!searchLocationIsConstructor || ts.isNewExpressionTarget(referenceLocation)) && referenceSymbol; + function getRelatedSymbol(search, referenceSymbol, referenceLocation, state) { + if (search.includes(referenceSymbol)) { + return referenceSymbol; } - var aliasSymbol = getAliasSymbolForPropertyNameSymbol(referenceSymbol, referenceLocation); - if (aliasSymbol) { - return getRelatedSymbol(searchSymbols, aliasSymbol, referenceLocation, searchLocationIsConstructor, parents, cache); - } - var containingObjectLiteralElement = getContainingObjectLiteralElement(referenceLocation); + var containingObjectLiteralElement = ts.getContainingObjectLiteralElement(referenceLocation); if (containingObjectLiteralElement) { - var contextualSymbol = ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement), function (contextualSymbol) { - return ts.forEach(typeChecker.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); + var contextualSymbol = ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement, state.checker), function (contextualSymbol) { + return ts.find(state.checker.getRootSymbols(contextualSymbol), search.includes); }); if (contextualSymbol) { return contextualSymbol; } - var propertySymbol = getPropertySymbolOfDestructuringAssignment(referenceLocation); - if (propertySymbol && searchSymbols.indexOf(propertySymbol) >= 0) { + var propertySymbol = getPropertySymbolOfDestructuringAssignment(referenceLocation, state.checker); + if (propertySymbol && search.includes(propertySymbol)) { return propertySymbol; } } - var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(referenceSymbol); - if (bindingElementPropertySymbol && searchSymbols.indexOf(bindingElementPropertySymbol) >= 0) { + var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(referenceSymbol, state.checker); + if (bindingElementPropertySymbol && search.includes(bindingElementPropertySymbol)) { return bindingElementPropertySymbol; } - return ts.forEach(typeChecker.getRootSymbols(referenceSymbol), function (rootSymbol) { - if (searchSymbols.indexOf(rootSymbol) >= 0) { + return ts.forEach(state.checker.getRootSymbols(referenceSymbol), function (rootSymbol) { + if (search.includes(rootSymbol)) { return rootSymbol; } if (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { - if (parents) { - if (!ts.forEach(parents, function (parent) { return explicitlyInheritsFrom(rootSymbol.parent, parent, cache); })) { - return undefined; - } + if (search.parents && !ts.some(search.parents, function (parent) { return explicitlyInheritsFrom(rootSymbol.parent, parent, state.inheritsFromCache, state.checker); })) { + return undefined; } - var result_4 = []; - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_4, ts.createMap()); - return ts.forEach(result_4, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); + var result = []; + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, ts.createMap(), state.checker); + return ts.find(result, search.includes); } return undefined; }); } function getNameFromObjectLiteralElement(node) { - if (node.name.kind === 142) { + if (node.name.kind === 143) { var nameExpression = node.name.expression; if (ts.isStringOrNumericLiteral(nameExpression)) { return nameExpression.text; @@ -57029,15 +63188,15 @@ var ts; } return node.name.text; } - function getPropertySymbolsFromContextualType(node) { + function getPropertySymbolsFromContextualType(node, checker) { var objectLiteral = node.parent; - var contextualType = typeChecker.getContextualType(objectLiteral); + var contextualType = checker.getContextualType(objectLiteral); var name = getNameFromObjectLiteralElement(node); if (name && contextualType) { var result_5 = []; - var symbol_2 = contextualType.getProperty(name); - if (symbol_2) { - result_5.push(symbol_2); + var symbol = contextualType.getProperty(name); + if (symbol) { + result_5.push(symbol); } if (contextualType.flags & 65536) { ts.forEach(contextualType.types, function (t) { @@ -57056,8 +63215,8 @@ var ts; var lastIterationMeaning = void 0; do { lastIterationMeaning = meaning; - for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { - var declaration = declarations_8[_i]; + for (var _i = 0, declarations_11 = declarations; _i < declarations_11.length; _i++) { + var declaration = declarations_11[_i]; var declarationMeaning = ts.getMeaningFromDeclaration(declaration); if (declarationMeaning & meaning) { meaning |= declarationMeaning; @@ -57067,137 +63226,86 @@ var ts; } return meaning; } - } - FindAllReferences.getReferencedSymbolsForNode = getReferencedSymbolsForNode; - function convertReferences(referenceSymbols) { - if (!referenceSymbols) { - return undefined; - } - var referenceEntries = []; - for (var _i = 0, referenceSymbols_1 = referenceSymbols; _i < referenceSymbols_1.length; _i++) { - var referenceSymbol = referenceSymbols_1[_i]; - ts.addRange(referenceEntries, referenceSymbol.references); - } - return referenceEntries; - } - FindAllReferences.convertReferences = convertReferences; - function isImplementation(node) { - if (!node) { + function isImplementation(node) { + if (!node) { + return false; + } + else if (ts.isVariableLike(node)) { + if (node.initializer) { + return true; + } + else if (node.kind === 225) { + var parentStatement = getParentStatementOfVariableDeclaration(node); + return parentStatement && ts.hasModifier(parentStatement, 2); + } + } + else if (ts.isFunctionLike(node)) { + return !!node.body || ts.hasModifier(node, 2); + } + else { + switch (node.kind) { + case 228: + case 198: + case 231: + case 232: + return true; + } + } return false; } - else if (ts.isVariableLike(node)) { - if (node.initializer) { - return true; - } - else if (node.kind === 223) { - var parentStatement = getParentStatementOfVariableDeclaration(node); - return parentStatement && ts.hasModifier(parentStatement, 2); + function getParentStatementOfVariableDeclaration(node) { + if (node.parent && node.parent.parent && node.parent.parent.kind === 207) { + ts.Debug.assert(node.parent.kind === 226); + return node.parent.parent; } } - else if (ts.isFunctionLike(node)) { - return !!node.body || ts.hasModifier(node, 2); - } - else { - switch (node.kind) { - case 226: - case 197: - case 229: - case 230: - return true; - } - } - return false; - } - function getParentStatementOfVariableDeclaration(node) { - if (node.parent && node.parent.parent && node.parent.parent.kind === 205) { - ts.Debug.assert(node.parent.kind === 224); - return node.parent.parent; - } - } - function getReferenceEntriesForShorthandPropertyAssignment(node, typeChecker, result) { - var refSymbol = typeChecker.getSymbolAtLocation(node); - var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(refSymbol.valueDeclaration); - if (shorthandSymbol) { - for (var _i = 0, _a = shorthandSymbol.getDeclarations(); _i < _a.length; _i++) { - var declaration = _a[_i]; - if (ts.getMeaningFromDeclaration(declaration) & 1) { - result.push(getReferenceEntryFromNode(declaration)); + function getReferenceEntriesForShorthandPropertyAssignment(node, checker, addReference) { + var refSymbol = checker.getSymbolAtLocation(node); + var shorthandSymbol = checker.getShorthandAssignmentValueSymbol(refSymbol.valueDeclaration); + if (shorthandSymbol) { + for (var _i = 0, _a = shorthandSymbol.getDeclarations(); _i < _a.length; _i++) { + var declaration = _a[_i]; + if (ts.getMeaningFromDeclaration(declaration) & 1) { + addReference(declaration); + } } } } - } - FindAllReferences.getReferenceEntriesForShorthandPropertyAssignment = getReferenceEntriesForShorthandPropertyAssignment; - function getReferenceEntryFromNode(node) { - var start = node.getStart(); - var end = node.getEnd(); - if (node.kind === 9) { - start += 1; - end -= 1; - } - return { - fileName: node.getSourceFile().fileName, - textSpan: ts.createTextSpanFromBounds(start, end), - isWriteAccess: isWriteAccess(node), - isDefinition: ts.isDeclarationName(node) || ts.isLiteralComputedPropertyDeclarationName(node) - }; - } - FindAllReferences.getReferenceEntryFromNode = getReferenceEntryFromNode; - function isWriteAccess(node) { - if (node.kind === 70 && ts.isDeclarationName(node)) { - return true; - } - var parent = node.parent; - if (parent) { - if (parent.kind === 191 || parent.kind === 190) { - return true; - } - else if (parent.kind === 192 && parent.left === node) { - var operator = parent.operatorToken.kind; - return 57 <= operator && operator <= 69; - } - } - return false; - } - function forEachDescendantOfKind(node, kind, action) { - ts.forEachChild(node, function (child) { - if (child.kind === kind) { - action(child); - } - forEachDescendantOfKind(child, kind, action); - }); - } - function getContainingObjectLiteralElement(node) { - switch (node.kind) { - case 9: - case 8: - if (node.parent.kind === 142) { - return isObjectLiteralPropertyDeclaration(node.parent.parent) ? node.parent.parent : undefined; + Core.getReferenceEntriesForShorthandPropertyAssignment = getReferenceEntriesForShorthandPropertyAssignment; + function forEachDescendantOfKind(node, kind, action) { + ts.forEachChild(node, function (child) { + if (child.kind === kind) { + action(child); } - case 70: - return isObjectLiteralPropertyDeclaration(node.parent) && node.parent.name === node ? node.parent : undefined; + forEachDescendantOfKind(child, kind, action); + }); } - return undefined; - } - function isObjectLiteralPropertyDeclaration(node) { - switch (node.kind) { - case 257: - case 258: - case 149: - case 151: - case 152: - return true; + function tryGetClassByExtendingIdentifier(node) { + return ts.tryGetClassExtendingExpressionWithTypeArguments(ts.climbPastPropertyAccess(node).parent); } - return false; - } - function tryGetClassByExtendingIdentifier(node) { - return ts.tryGetClassExtendingExpressionWithTypeArguments(ts.climbPastPropertyAccess(node).parent); - } - function isNameOfExternalModuleImportOrDeclaration(node) { - if (node.kind === 9) { - return ts.isNameOfModuleDeclaration(node) || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node); + function isNameOfExternalModuleImportOrDeclaration(node) { + if (node.kind === 9) { + return ts.isNameOfModuleDeclaration(node) || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node); + } + return false; } - return false; - } + function getParentSymbolsOfPropertyAccess(location, symbol, checker) { + var propertyAccessExpression = getPropertyAccessExpressionFromRightHandSide(location); + if (!propertyAccessExpression) { + return undefined; + } + var localParentType = checker.getTypeAtLocation(propertyAccessExpression.expression); + if (!localParentType) { + return undefined; + } + if (localParentType.symbol && localParentType.symbol.flags & (32 | 64) && localParentType.symbol !== symbol.parent) { + return [localParentType.symbol]; + } + else if (localParentType.flags & 196608) { + return getSymbolsForClassAndInterfaceComponents(localParentType); + } + } + })(Core = FindAllReferences.Core || (FindAllReferences.Core = {})); })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); var ts; @@ -57215,11 +63323,9 @@ var ts; } var typeReferenceDirective = findReferenceInPosition(sourceFile.typeReferenceDirectives, position); if (typeReferenceDirective) { - var referenceFile = program.getResolvedTypeReferenceDirectives()[typeReferenceDirective.fileName]; - if (referenceFile && referenceFile.resolvedFileName) { - return [getDefinitionInfoForFileReference(typeReferenceDirective.fileName, referenceFile.resolvedFileName)]; - } - return undefined; + var referenceFile = program.getResolvedTypeReferenceDirectives().get(typeReferenceDirective.fileName); + return referenceFile && referenceFile.resolvedFileName && + [getDefinitionInfoForFileReference(typeReferenceDirective.fileName, referenceFile.resolvedFileName)]; } var node = ts.getTouchingPropertyName(sourceFile, position); if (node === sourceFile) { @@ -57228,7 +63334,7 @@ var ts; if (ts.isJumpStatementTarget(node)) { var labelName = node.text; var label = ts.getTargetLabel(node.parent, node.text); - return label ? [createDefinitionInfo(label, ts.ScriptElementKind.label, labelName, undefined)] : undefined; + return label ? [createDefinitionInfoFromName(label, ts.ScriptElementKind.label, labelName, undefined)] : undefined; } var typeChecker = program.getTypeChecker(); var calledDeclaration = tryGetSignatureDeclaration(typeChecker, node); @@ -57243,11 +63349,11 @@ var ts; var declaration = symbol.declarations[0]; if (node.kind === 70 && (node.parent === declaration || - (declaration.kind === 239 && declaration.parent && declaration.parent.kind === 238))) { + (declaration.kind === 241 && declaration.parent && declaration.parent.kind === 240))) { symbol = typeChecker.getAliasedSymbol(symbol); } } - if (node.parent.kind === 258) { + if (node.parent.kind === 261) { var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); if (!shorthandSymbol) { return []; @@ -57258,6 +63364,22 @@ var ts; var shorthandContainerName_1 = typeChecker.symbolToString(symbol.parent, node); return ts.map(shorthandDeclarations, function (declaration) { return createDefinitionInfo(declaration, shorthandSymbolKind_1, shorthandSymbolName_1, shorthandContainerName_1); }); } + if (ts.isJsxOpeningLikeElement(node.parent)) { + var _a = getSymbolInfo(typeChecker, symbol, node), symbolName = _a.symbolName, symbolKind = _a.symbolKind, containerName = _a.containerName; + return [createDefinitionInfo(symbol.valueDeclaration, symbolKind, symbolName, containerName)]; + } + var element = ts.getContainingObjectLiteralElement(node); + if (element) { + if (typeChecker.getContextualType(element.parent)) { + var result = []; + var propertySymbols = ts.getPropertySymbolsFromContextualType(typeChecker, element); + for (var _i = 0, propertySymbols_1 = propertySymbols; _i < propertySymbols_1.length; _i++) { + var propertySymbol = propertySymbols_1[_i]; + result.push.apply(result, getDefinitionFromSymbol(typeChecker, propertySymbol, node)); + } + return result; + } + } return getDefinitionFromSymbol(typeChecker, symbol, node); } GoToDefinition.getDefinitionAtPosition = getDefinitionAtPosition; @@ -57321,31 +63443,45 @@ var ts; return false; } function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { + if (!signatureDeclarations) { + return false; + } var declarations = []; var definition; - ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 150) || - (!selectConstructors && (d.kind === 225 || d.kind === 149 || d.kind === 148))) { + for (var _i = 0, signatureDeclarations_1 = signatureDeclarations; _i < signatureDeclarations_1.length; _i++) { + var d = signatureDeclarations_1[_i]; + if (selectConstructors ? d.kind === 151 : isSignatureDeclaration(d)) { declarations.push(d); if (d.body) definition = d; } - }); - if (definition) { - result.push(createDefinitionInfo(definition, symbolKind, symbolName, containerName)); - return true; } - else if (declarations.length) { - result.push(createDefinitionInfo(ts.lastOrUndefined(declarations), symbolKind, symbolName, containerName)); + if (declarations.length) { + result.push(createDefinitionInfo(definition || ts.lastOrUndefined(declarations), symbolKind, symbolName, containerName)); return true; } return false; } } + function isSignatureDeclaration(node) { + switch (node.kind) { + case 151: + case 227: + case 150: + case 149: + return true; + default: + return false; + } + } function createDefinitionInfo(node, symbolKind, symbolName, containerName) { + return createDefinitionInfoFromName(node.name || node, symbolKind, symbolName, containerName); + } + function createDefinitionInfoFromName(name, symbolKind, symbolName, containerName) { + var sourceFile = name.getSourceFile(); return { - fileName: node.getSourceFile().fileName, - textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()), + fileName: sourceFile.fileName, + textSpan: ts.createTextSpanFromNode(name, sourceFile), kind: symbolKind, name: symbolName, containerKind: undefined, @@ -57392,39 +63528,18 @@ var ts; } function tryGetSignatureDeclaration(typeChecker, node) { var callLike = getAncestorCallLikeExpression(node); - return callLike && typeChecker.getResolvedSignature(callLike).declaration; + var signature = callLike && typeChecker.getResolvedSignature(callLike); + if (signature) { + var decl = signature.declaration; + if (decl && isSignatureDeclaration(decl)) { + return decl; + } + } + return undefined; } })(GoToDefinition = ts.GoToDefinition || (ts.GoToDefinition = {})); })(ts || (ts = {})); var ts; -(function (ts) { - var GoToImplementation; - (function (GoToImplementation) { - function getImplementationAtPosition(typeChecker, cancellationToken, sourceFiles, node) { - if (node.parent.kind === 258) { - var result = []; - ts.FindAllReferences.getReferenceEntriesForShorthandPropertyAssignment(node, typeChecker, result); - return result.length > 0 ? result : undefined; - } - else if (node.kind === 96 || ts.isSuperProperty(node.parent)) { - var symbol = typeChecker.getSymbolAtLocation(node); - return symbol.valueDeclaration && [ts.FindAllReferences.getReferenceEntryFromNode(symbol.valueDeclaration)]; - } - else { - var referencedSymbols = ts.FindAllReferences.getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFiles, false, false, true); - var result = ts.flatMap(referencedSymbols, function (symbol) { - return ts.map(symbol.references, function (_a) { - var textSpan = _a.textSpan, fileName = _a.fileName; - return ({ textSpan: textSpan, fileName: fileName }); - }); - }); - return result && result.length > 0 ? result : undefined; - } - } - GoToImplementation.getImplementationAtPosition = getImplementationAtPosition; - })(GoToImplementation = ts.GoToImplementation || (ts.GoToImplementation = {})); -})(ts || (ts = {})); -var ts; (function (ts) { var JsDoc; (function (JsDoc) { @@ -57451,6 +63566,7 @@ var ts; "lends", "link", "memberOf", + "method", "name", "namespace", "param", @@ -57469,7 +63585,8 @@ var ts; "prop", "version" ]; - var jsDocCompletionEntries; + var jsDocTagNameCompletionEntries; + var jsDocTagCompletionEntries; function getJsDocCommentsFromDeclarations(declarations) { var documentationComment = []; forEachUnique(declarations, function (declaration) { @@ -57490,9 +63607,32 @@ var ts; return documentationComment; } JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; + function getJsDocTagsFromDeclarations(declarations) { + var tags = []; + forEachUnique(declarations, function (declaration) { + var jsDocs = ts.getJSDocs(declaration); + if (!jsDocs) { + return; + } + for (var _i = 0, jsDocs_1 = jsDocs; _i < jsDocs_1.length; _i++) { + var doc = jsDocs_1[_i]; + var tagsForDoc = doc.tags; + if (tagsForDoc) { + tags.push.apply(tags, tagsForDoc.filter(function (tag) { return tag.kind === 283; }).map(function (jsDocTag) { + return { + name: jsDocTag.tagName.text, + text: jsDocTag.comment + }; + })); + } + } + }); + return tags; + } + JsDoc.getJsDocTagsFromDeclarations = getJsDocTagsFromDeclarations; function forEachUnique(array, callback) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { if (ts.indexOf(array, array[i]) === i) { var result = callback(array[i], i); if (result) { @@ -57503,8 +63643,8 @@ var ts; } return undefined; } - function getAllJsDocCompletionEntries() { - return jsDocCompletionEntries || (jsDocCompletionEntries = ts.map(jsDocTagNames, function (tagName) { + function getJSDocTagNameCompletions() { + return jsDocTagNameCompletionEntries || (jsDocTagNameCompletionEntries = ts.map(jsDocTagNames, function (tagName) { return { name: tagName, kind: ts.ScriptElementKind.keyword, @@ -57513,7 +63653,18 @@ var ts; }; })); } - JsDoc.getAllJsDocCompletionEntries = getAllJsDocCompletionEntries; + JsDoc.getJSDocTagNameCompletions = getJSDocTagNameCompletions; + function getJSDocTagCompletions() { + return jsDocTagCompletionEntries || (jsDocTagCompletionEntries = ts.map(jsDocTagNames, function (tagName) { + return { + name: "@" + tagName, + kind: ts.ScriptElementKind.keyword, + kindModifiers: "", + sortText: "0" + }; + })); + } + JsDoc.getJSDocTagCompletions = getJSDocTagCompletions; function getDocCommentTemplateAtPosition(newLine, sourceFile, position) { if (ts.isInString(sourceFile, position) || ts.isInComment(sourceFile, position) || ts.hasDocComment(sourceFile, position)) { return undefined; @@ -57526,16 +63677,16 @@ var ts; var commentOwner; findOwner: for (commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) { switch (commentOwner.kind) { - case 225: - case 149: + case 227: case 150: - case 226: - case 205: + case 151: + case 228: + case 207: break findOwner; - case 261: + case 264: return undefined; - case 230: - if (commentOwner.parent.kind === 230) { + case 232: + if (commentOwner.parent.kind === 232) { return undefined; } break findOwner; @@ -57547,14 +63698,20 @@ var ts; var parameters = getParametersForJsDocOwningNode(commentOwner); var posLineAndChar = sourceFile.getLineAndCharacterOfPosition(position); var lineStart = sourceFile.getLineStarts()[posLineAndChar.line]; - var indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character); + var indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character).replace(/\S/i, function () { return " "; }); + var isJavaScriptFile = ts.hasJavaScriptFileExtension(sourceFile.fileName); var docParams = ""; - for (var i = 0, numParams = parameters.length; i < numParams; i++) { + for (var i = 0; i < parameters.length; i++) { var currentName = parameters[i].name; var paramName = currentName.kind === 70 ? currentName.text : "param" + i; - docParams += indentationStr + " * @param " + paramName + newLine; + if (isJavaScriptFile) { + docParams += indentationStr + " * @param {any} " + paramName + newLine; + } + else { + docParams += indentationStr + " * @param " + paramName + newLine; + } } var preamble = "/**" + newLine + indentationStr + " * "; @@ -57569,7 +63726,7 @@ var ts; if (ts.isFunctionLike(commentOwner)) { return commentOwner.parameters; } - if (commentOwner.kind === 205) { + if (commentOwner.kind === 207) { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; if (varDeclarations.length === 1 && varDeclarations[0].initializer) { @@ -57579,17 +63736,17 @@ var ts; return ts.emptyArray; } function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 183) { + while (rightHandSide.kind === 184) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 184: case 185: + case 186: return rightHandSide.parameters; - case 197: + case 198: for (var _i = 0, _a = rightHandSide.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 150) { + if (member.kind === 151) { return member.parameters; } } @@ -57600,47 +63757,212 @@ var ts; })(JsDoc = ts.JsDoc || (ts.JsDoc = {})); })(ts || (ts = {})); var ts; +(function (ts) { + var JsTyping; + (function (JsTyping) { + var safeList; + var EmptySafeList = ts.createMap(); + JsTyping.nodeCoreModuleList = [ + "buffer", "querystring", "events", "http", "cluster", + "zlib", "os", "https", "punycode", "repl", "readline", + "vm", "child_process", "url", "dns", "net", + "dgram", "fs", "path", "string_decoder", "tls", + "crypto", "stream", "util", "assert", "tty", "domain", + "constants", "process", "v8", "timers", "console" + ]; + var nodeCoreModules = ts.arrayToMap(JsTyping.nodeCoreModuleList, function (x) { return x; }); + function discoverTypings(host, fileNames, projectRootPath, safeListPath, packageNameToTypingLocation, typeAcquisition, unresolvedImports) { + var inferredTypings = ts.createMap(); + if (!typeAcquisition || !typeAcquisition.enable) { + return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] }; + } + fileNames = ts.filter(ts.map(fileNames, ts.normalizePath), function (f) { + var kind = ts.ensureScriptKind(f, ts.getScriptKindFromFileName(f)); + return kind === 1 || kind === 2; + }); + if (!safeList) { + var result = ts.readConfigFile(safeListPath, function (path) { return host.readFile(path); }); + safeList = result.config ? ts.createMapFromTemplate(result.config) : EmptySafeList; + } + var filesToWatch = []; + var searchDirs = []; + var exclude = []; + mergeTypings(typeAcquisition.include); + exclude = typeAcquisition.exclude || []; + var possibleSearchDirs = ts.map(fileNames, ts.getDirectoryPath); + if (projectRootPath) { + possibleSearchDirs.push(projectRootPath); + } + searchDirs = ts.deduplicate(possibleSearchDirs); + for (var _i = 0, searchDirs_1 = searchDirs; _i < searchDirs_1.length; _i++) { + var searchDir = searchDirs_1[_i]; + var packageJsonPath = ts.combinePaths(searchDir, "package.json"); + getTypingNamesFromJson(packageJsonPath, filesToWatch); + var bowerJsonPath = ts.combinePaths(searchDir, "bower.json"); + getTypingNamesFromJson(bowerJsonPath, filesToWatch); + var bowerComponentsPath = ts.combinePaths(searchDir, "bower_components"); + getTypingNamesFromPackagesFolder(bowerComponentsPath); + var nodeModulesPath = ts.combinePaths(searchDir, "node_modules"); + getTypingNamesFromPackagesFolder(nodeModulesPath); + } + getTypingNamesFromSourceFileNames(fileNames); + if (unresolvedImports) { + for (var _a = 0, unresolvedImports_1 = unresolvedImports; _a < unresolvedImports_1.length; _a++) { + var moduleId = unresolvedImports_1[_a]; + var typingName = nodeCoreModules.has(moduleId) ? "node" : moduleId; + if (!inferredTypings.has(typingName)) { + inferredTypings.set(typingName, undefined); + } + } + } + packageNameToTypingLocation.forEach(function (typingLocation, name) { + if (inferredTypings.has(name) && inferredTypings.get(name) === undefined) { + inferredTypings.set(name, typingLocation); + } + }); + for (var _b = 0, exclude_1 = exclude; _b < exclude_1.length; _b++) { + var excludeTypingName = exclude_1[_b]; + inferredTypings.delete(excludeTypingName); + } + var newTypingNames = []; + var cachedTypingPaths = []; + inferredTypings.forEach(function (inferred, typing) { + if (inferred !== undefined) { + cachedTypingPaths.push(inferred); + } + else { + newTypingNames.push(typing); + } + }); + return { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch }; + function mergeTypings(typingNames) { + if (!typingNames) { + return; + } + for (var _i = 0, typingNames_1 = typingNames; _i < typingNames_1.length; _i++) { + var typing = typingNames_1[_i]; + if (!inferredTypings.has(typing)) { + inferredTypings.set(typing, undefined); + } + } + } + function getTypingNamesFromJson(jsonPath, filesToWatch) { + if (host.fileExists(jsonPath)) { + filesToWatch.push(jsonPath); + } + var result = ts.readConfigFile(jsonPath, function (path) { return host.readFile(path); }); + if (result.config) { + var jsonConfig = result.config; + if (jsonConfig.dependencies) { + mergeTypings(ts.getOwnKeys(jsonConfig.dependencies)); + } + if (jsonConfig.devDependencies) { + mergeTypings(ts.getOwnKeys(jsonConfig.devDependencies)); + } + if (jsonConfig.optionalDependencies) { + mergeTypings(ts.getOwnKeys(jsonConfig.optionalDependencies)); + } + if (jsonConfig.peerDependencies) { + mergeTypings(ts.getOwnKeys(jsonConfig.peerDependencies)); + } + } + } + function getTypingNamesFromSourceFileNames(fileNames) { + var jsFileNames = ts.filter(fileNames, ts.hasJavaScriptFileExtension); + var inferredTypingNames = ts.map(jsFileNames, function (f) { return ts.removeFileExtension(ts.getBaseFileName(f.toLowerCase())); }); + var cleanedTypingNames = ts.map(inferredTypingNames, function (f) { return f.replace(/((?:\.|-)min(?=\.|$))|((?:-|\.)\d+)/g, ""); }); + if (safeList !== EmptySafeList) { + mergeTypings(ts.filter(cleanedTypingNames, function (f) { return safeList.has(f); })); + } + var hasJsxFile = ts.forEach(fileNames, function (f) { return ts.ensureScriptKind(f, ts.getScriptKindFromFileName(f)) === 2; }); + if (hasJsxFile) { + mergeTypings(["react"]); + } + } + function getTypingNamesFromPackagesFolder(packagesFolderPath) { + filesToWatch.push(packagesFolderPath); + if (!host.directoryExists(packagesFolderPath)) { + return; + } + var typingNames = []; + var fileNames = host.readDirectory(packagesFolderPath, [".json"], undefined, undefined, 2); + for (var _i = 0, fileNames_2 = fileNames; _i < fileNames_2.length; _i++) { + var fileName = fileNames_2[_i]; + var normalizedFileName = ts.normalizePath(fileName); + var baseFileName = ts.getBaseFileName(normalizedFileName); + if (baseFileName !== "package.json" && baseFileName !== "bower.json") { + continue; + } + var result = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); }); + if (!result.config) { + continue; + } + var packageJson = result.config; + if (baseFileName === "package.json" && packageJson._requiredBy && + ts.filter(packageJson._requiredBy, function (r) { return r[0] === "#" || r === "/"; }).length === 0) { + continue; + } + if (!packageJson.name) { + continue; + } + if (packageJson.typings) { + var absolutePath = ts.getNormalizedAbsolutePath(packageJson.typings, ts.getDirectoryPath(normalizedFileName)); + inferredTypings.set(packageJson.name, absolutePath); + } + else { + typingNames.push(packageJson.name); + } + } + mergeTypings(typingNames); + } + } + JsTyping.discoverTypings = discoverTypings; + })(JsTyping = ts.JsTyping || (ts.JsTyping = {})); +})(ts || (ts = {})); +var ts; (function (ts) { var NavigateTo; (function (NavigateTo) { function getNavigateToItems(sourceFiles, checker, cancellationToken, searchValue, maxResultCount, excludeDtsFiles) { var patternMatcher = ts.createPatternMatcher(searchValue); var rawItems = []; - ts.forEach(sourceFiles, function (sourceFile) { + var _loop_4 = function (sourceFile) { cancellationToken.throwIfCancellationRequested(); if (excludeDtsFiles && ts.fileExtensionIs(sourceFile.fileName, ".d.ts")) { - return; + return "continue"; } - var nameToDeclarations = sourceFile.getNamedDeclarations(); - for (var name_46 in nameToDeclarations) { - var declarations = nameToDeclarations[name_46]; + ts.forEachEntry(sourceFile.getNamedDeclarations(), function (declarations, name) { if (declarations) { - var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_46); + var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name); if (!matches) { - continue; + return; } - for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) { - var declaration = declarations_9[_i]; + for (var _i = 0, declarations_12 = declarations; _i < declarations_12.length; _i++) { + var declaration = declarations_12[_i]; if (patternMatcher.patternContainsDots) { var containers = getContainers(declaration); if (!containers) { - return undefined; + return true; } - matches = patternMatcher.getMatches(containers, name_46); + matches = patternMatcher.getMatches(containers, name); if (!matches) { - continue; + return; } } var fileName = sourceFile.fileName; var matchKind = bestMatchKind(matches); - rawItems.push({ name: name_46, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); + rawItems.push({ name: name, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); } } - } - }); + }); + }; + for (var _i = 0, sourceFiles_7 = sourceFiles; _i < sourceFiles_7.length; _i++) { + var sourceFile = sourceFiles_7[_i]; + _loop_4(sourceFile); + } rawItems = ts.filter(rawItems, function (item) { var decl = item.declaration; - if (decl.kind === 236 || decl.kind === 239 || decl.kind === 234) { + if (decl.kind === 238 || decl.kind === 241 || decl.kind === 236) { var importer = checker.getSymbolAtLocation(decl.name); var imported = checker.getAliasedSymbol(importer); return importer.name !== imported.name; @@ -57681,7 +64003,7 @@ var ts; if (text !== undefined) { containers.unshift(text); } - else if (declaration.name.kind === 142) { + else if (declaration.name.kind === 143) { return tryAddComputedPropertyName(declaration.name.expression, containers, true); } else { @@ -57698,7 +64020,7 @@ var ts; } return true; } - if (expression.kind === 177) { + if (expression.kind === 178) { var propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); @@ -57709,7 +64031,7 @@ var ts; } function getContainers(declaration) { var containers = []; - if (declaration.name.kind === 142) { + if (declaration.name.kind === 143) { if (!tryAddComputedPropertyName(declaration.name.expression, containers, false)) { return undefined; } @@ -57750,7 +64072,7 @@ var ts; matchKind: ts.PatternMatchKind[rawItem.matchKind], isCaseSensitive: rawItem.isCaseSensitive, fileName: rawItem.fileName, - textSpan: ts.createTextSpanFromBounds(declaration.getStart(), declaration.getEnd()), + textSpan: ts.createTextSpanFromNode(declaration), containerName: container && container.name ? container.name.text : "", containerKind: container && container.name ? ts.getNodeKind(container) : "" }; @@ -57763,21 +64085,41 @@ var ts; (function (ts) { var NavigationBar; (function (NavigationBar) { - function getNavigationBarItems(sourceFile) { + var whiteSpaceRegex = /\s+/g; + var curCancellationToken; + var curSourceFile; + var parentsStack = []; + var parent; + var emptyChildItemArray = []; + function getNavigationBarItems(sourceFile, cancellationToken) { + curCancellationToken = cancellationToken; curSourceFile = sourceFile; - var result = ts.map(topLevelItems(rootNavigationBarNode(sourceFile)), convertToTopLevelItem); - curSourceFile = undefined; - return result; + try { + return ts.map(topLevelItems(rootNavigationBarNode(sourceFile)), convertToTopLevelItem); + } + finally { + reset(); + } } NavigationBar.getNavigationBarItems = getNavigationBarItems; - function getNavigationTree(sourceFile) { + function getNavigationTree(sourceFile, cancellationToken) { + curCancellationToken = cancellationToken; curSourceFile = sourceFile; - var result = convertToTree(rootNavigationBarNode(sourceFile)); - curSourceFile = undefined; - return result; + try { + return convertToTree(rootNavigationBarNode(sourceFile)); + } + finally { + reset(); + } } NavigationBar.getNavigationTree = getNavigationTree; - var curSourceFile; + function reset() { + curSourceFile = undefined; + curCancellationToken = undefined; + parentsStack = []; + parent = undefined; + emptyChildItemArray = []; + } function nodeText(node) { return node.getText(curSourceFile); } @@ -57792,8 +64134,6 @@ var ts; parent.children = [child]; } } - var parentsStack = []; - var parent; function rootNavigationBarNode(sourceFile) { ts.Debug.assert(!parentsStack.length); var root = { node: sourceFile, additionalNodes: undefined, parent: undefined, children: undefined, indent: 0 }; @@ -57837,11 +64177,12 @@ var ts; endNode(); } function addChildrenRecursively(node) { + curCancellationToken.throwIfCancellationRequested(); if (!node || ts.isToken(node)) { return; } switch (node.kind) { - case 150: + case 151: var ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); for (var _i = 0, _a = ctr.parameters; _i < _a.length; _i++) { @@ -57851,28 +64192,28 @@ var ts; } } break; - case 149: - case 151: + case 150: case 152: - case 148: + case 153: + case 149: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; + case 148: case 147: - case 146: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 236: + case 238: var importClause = node; if (importClause.name) { addLeafNode(importClause); } var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 237) { + if (namedBindings.kind === 239) { addLeafNode(namedBindings); } else { @@ -57883,12 +64224,12 @@ var ts; } } break; - case 174: - case 223: + case 175: + case 225: var decl = node; - var name_47 = decl.name; - if (ts.isBindingPattern(name_47)) { - addChildrenRecursively(name_47); + var name = decl.name; + if (ts.isBindingPattern(name)) { + addChildrenRecursively(name); } else if (decl.initializer && isFunctionOrClassExpression(decl.initializer)) { addChildrenRecursively(decl.initializer); @@ -57897,12 +64238,12 @@ var ts; addNodeWithRecursiveChild(decl, decl.initializer); } break; + case 186: + case 227: case 185: - case 225: - case 184: addNodeWithRecursiveChild(node, node.body); break; - case 229: + case 231: startNode(node); for (var _d = 0, _e = node.members; _d < _e.length; _d++) { var member = _e[_d]; @@ -57912,9 +64253,9 @@ var ts; } endNode(); break; - case 226: - case 197: - case 227: + case 228: + case 198: + case 229: startNode(node); for (var _f = 0, _g = node.members; _f < _g.length; _f++) { var member = _g[_f]; @@ -57922,21 +64263,21 @@ var ts; } endNode(); break; - case 230: + case 232: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 243: - case 234: - case 155: - case 153: + case 245: + case 236: + case 156: case 154: - case 228: + case 155: + case 230: addLeafNode(node); break; default: ts.forEach(node.jsDoc, function (jsDoc) { ts.forEach(jsDoc.tags, function (tag) { - if (tag.kind === 285) { + if (tag.kind === 289) { addLeafNode(tag); } }); @@ -57952,9 +64293,9 @@ var ts; if (!name) { return true; } - var itemsWithSameName = nameToItems[name]; + var itemsWithSameName = nameToItems.get(name); if (!itemsWithSameName) { - nameToItems[name] = child; + nameToItems.set(name, child); return true; } if (itemsWithSameName instanceof Array) { @@ -57972,7 +64313,7 @@ var ts; if (tryMerge(itemWithSameName, child)) { return false; } - nameToItems[name] = [itemWithSameName, child]; + nameToItems.set(name, [itemWithSameName, child]); return true; } function tryMerge(a, b) { @@ -57984,12 +64325,12 @@ var ts; } }); function shouldReallyMerge(a, b) { - return a.kind === b.kind && (a.kind !== 230 || areSameModule(a, b)); + return a.kind === b.kind && (a.kind !== 232 || areSameModule(a, b)); function areSameModule(a, b) { if (a.body.kind !== b.body.kind) { return false; } - if (a.body.kind !== 230) { + if (a.body.kind !== 232) { return true; } return areSameModule(a.body, b.body); @@ -58015,32 +64356,15 @@ var ts; function compareChildren(child1, child2) { var name1 = tryGetName(child1.node), name2 = tryGetName(child2.node); if (name1 && name2) { - var cmp = localeCompareFix(name1, name2); + var cmp = ts.compareStringsCaseInsensitive(name1, name2); return cmp !== 0 ? cmp : navigationBarNodeKind(child1) - navigationBarNodeKind(child2); } else { return name1 ? 1 : name2 ? -1 : navigationBarNodeKind(child1) - navigationBarNodeKind(child2); } } - var localeCompareIsCorrect = ts.collator && ts.collator.compare("a", "B") < 0; - var localeCompareFix = localeCompareIsCorrect ? ts.collator.compare : function (a, b) { - for (var i = 0; i < Math.min(a.length, b.length); i++) { - var chA = a.charAt(i), chB = b.charAt(i); - if (chA === "\"" && chB === "'") { - return 1; - } - if (chA === "'" && chB === "\"") { - return -1; - } - var cmp = ts.compareStrings(chA.toLocaleLowerCase(), chB.toLocaleLowerCase()); - if (cmp !== 0) { - return cmp; - } - } - return a.length - b.length; - }; function tryGetName(node) { - if (node.kind === 230) { + if (node.kind === 232) { return getModuleName(node); } var decl = node; @@ -58048,18 +64372,18 @@ var ts; return ts.getPropertyNameForPropertyNameNode(decl.name); } switch (node.kind) { - case 184: case 185: - case 197: + case 186: + case 198: return getFunctionOrClassName(node); - case 285: + case 289: return getJSDocTypedefTagName(node); default: return undefined; } } function getItemName(node) { - if (node.kind === 230) { + if (node.kind === 232) { return getModuleName(node); } var name = node.name; @@ -58070,29 +64394,29 @@ var ts; } } switch (node.kind) { - case 261: + case 264: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : ""; + case 186: + case 227: case 185: - case 225: - case 184: - case 226: - case 197: + case 228: + case 198: if (ts.getModifierFlags(node) & 512) { return "default"; } return getFunctionOrClassName(node); - case 150: + case 151: return "constructor"; - case 154: - return "new()"; - case 153: - return "()"; case 155: + return "new()"; + case 154: + return "()"; + case 156: return "[]"; - case 285: + case 289: return getJSDocTypedefTagName(node); default: return ""; @@ -58104,7 +64428,7 @@ var ts; } else { var parentNode = node.parent && node.parent.parent; - if (parentNode && parentNode.kind === 205) { + if (parentNode && parentNode.kind === 207) { if (parentNode.declarationList.declarations.length > 0) { var nameIdentifier = parentNode.declarationList.declarations[0].name; if (nameIdentifier.kind === 70) { @@ -58132,24 +64456,24 @@ var ts; return topLevel; function isTopLevel(item) { switch (navigationBarNodeKind(item)) { - case 226: - case 197: - case 229: - case 227: - case 230: - case 261: case 228: - case 285: + case 198: + case 231: + case 229: + case 232: + case 264: + case 230: + case 289: return true; - case 150: - case 149: case 151: + case 150: case 152: - case 223: - return hasSomeImportantChild(item); - case 185: + case 153: case 225: - case 184: + return hasSomeImportantChild(item); + case 186: + case 227: + case 185: return isTopLevelFunctionDeclaration(item); default: return false; @@ -58159,10 +64483,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 231: - case 261: - case 149: + case 233: + case 264: case 150: + case 151: return true; default: return hasSomeImportantChild(item); @@ -58171,17 +64495,16 @@ var ts; function hasSomeImportantChild(item) { return ts.forEach(item.children, function (child) { var childKind = navigationBarNodeKind(child); - return childKind !== 223 && childKind !== 174; + return childKind !== 225 && childKind !== 175; }); } } } - var emptyChildItemArray = []; function convertToTree(n) { return { text: getItemName(n.node), kind: ts.getNodeKind(n.node), - kindModifiers: ts.getNodeModifiers(n.node), + kindModifiers: getModifiers(n.node), spans: getSpans(n), childItems: ts.map(n.children, convertToTree) }; @@ -58190,7 +64513,7 @@ var ts; return { text: getItemName(n.node), kind: ts.getNodeKind(n.node), - kindModifiers: ts.getNodeModifiers(n.node), + kindModifiers: getModifiers(n.node), spans: getSpans(n), childItems: ts.map(n.children, convertToChildItem) || emptyChildItemArray, indent: n.indent, @@ -58226,35 +64549,41 @@ var ts; } var result = []; result.push(moduleDeclaration.name.text); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 230) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 232) { moduleDeclaration = moduleDeclaration.body; result.push(moduleDeclaration.name.text); } return result.join("."); } function getInteriorModule(decl) { - return decl.body.kind === 230 ? getInteriorModule(decl.body) : decl; + return decl.body.kind === 232 ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 142; + return !member.name || member.name.kind === 143; } function getNodeSpan(node) { - return node.kind === 261 + return node.kind === 264 ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) - : ts.createTextSpanFromBounds(node.getStart(curSourceFile), node.getEnd()); + : ts.createTextSpanFromNode(node, curSourceFile); + } + function getModifiers(node) { + if (node.parent && node.parent.kind === 225) { + node = node.parent; + } + return ts.getNodeModifiers(node); } function getFunctionOrClassName(node) { if (node.name && ts.getFullWidth(node.name) > 0) { return ts.declarationNameToString(node.name); } - else if (node.parent.kind === 223) { + else if (node.parent.kind === 225) { return ts.declarationNameToString(node.parent.name); } - else if (node.parent.kind === 192 && + else if (node.parent.kind === 193 && node.parent.operatorToken.kind === 57) { return nodeText(node.parent.left).replace(whiteSpaceRegex, ""); } - else if (node.parent.kind === 257 && node.parent.name) { + else if (node.parent.kind === 260 && node.parent.name) { return nodeText(node.parent.name); } else if (ts.getModifierFlags(node) & 512) { @@ -58265,38 +64594,37 @@ var ts; } } function isFunctionOrClassExpression(node) { - return node.kind === 184 || node.kind === 185 || node.kind === 197; + return node.kind === 185 || node.kind === 186 || node.kind === 198; } - var whiteSpaceRegex = /\s+/g; })(NavigationBar = ts.NavigationBar || (ts.NavigationBar = {})); })(ts || (ts = {})); var ts; (function (ts) { var OutliningElementsCollector; (function (OutliningElementsCollector) { - function collectElements(sourceFile) { + function collectElements(sourceFile, cancellationToken) { var elements = []; var collapseText = "..."; function addOutliningSpan(hintSpanNode, startElement, endElement, autoCollapse) { if (hintSpanNode && startElement && endElement) { - var span_12 = { + var span_13 = { textSpan: ts.createTextSpanFromBounds(startElement.pos, endElement.end), - hintSpan: ts.createTextSpanFromBounds(hintSpanNode.getStart(), hintSpanNode.end), + hintSpan: ts.createTextSpanFromNode(hintSpanNode, sourceFile), bannerText: collapseText, autoCollapse: autoCollapse }; - elements.push(span_12); + elements.push(span_13); } } function addOutliningSpanComments(commentSpan, autoCollapse) { if (commentSpan) { - var span_13 = { + var span_14 = { textSpan: ts.createTextSpanFromBounds(commentSpan.pos, commentSpan.end), hintSpan: ts.createTextSpanFromBounds(commentSpan.pos, commentSpan.end), bannerText: collapseText, autoCollapse: autoCollapse }; - elements.push(span_13); + elements.push(span_14); } } function addOutliningForLeadingCommentsForNode(n) { @@ -58308,6 +64636,7 @@ var ts; var singleLineCommentCount = 0; for (var _i = 0, comments_4 = comments; _i < comments_4.length; _i++) { var currentComment = comments_4[_i]; + cancellationToken.throwIfCancellationRequested(); if (currentComment.kind === 2) { if (isFirstSingleLineComment) { firstSingleLineCommentStart = currentComment.pos; @@ -58330,19 +64659,20 @@ var ts; function combineAndAddMultipleSingleLineComments(count, start, end) { if (count > 1) { var multipleSingleLineComments = { + kind: 2, pos: start, end: end, - kind: 2 }; addOutliningSpanComments(multipleSingleLineComments, false); } } function autoCollapse(node) { - return ts.isFunctionBlock(node) && node.parent.kind !== 185; + return ts.isFunctionBlock(node) && node.parent.kind !== 186; } var depth = 0; var maxDepth = 20; function walk(n) { + cancellationToken.throwIfCancellationRequested(); if (depth > maxDepth) { return; } @@ -58350,26 +64680,26 @@ var ts; addOutliningForLeadingCommentsForNode(n); } switch (n.kind) { - case 204: + case 206: if (!ts.isFunctionBlock(n)) { - var parent_19 = n.parent; + var parent = n.parent; var openBrace = ts.findChildOfKind(n, 16, sourceFile); var closeBrace = ts.findChildOfKind(n, 17, sourceFile); - if (parent_19.kind === 209 || - parent_19.kind === 212 || - parent_19.kind === 213 || - parent_19.kind === 211 || - parent_19.kind === 208 || - parent_19.kind === 210 || - parent_19.kind === 217 || - parent_19.kind === 256) { - addOutliningSpan(parent_19, openBrace, closeBrace, autoCollapse(n)); + if (parent.kind === 211 || + parent.kind === 214 || + parent.kind === 215 || + parent.kind === 213 || + parent.kind === 210 || + parent.kind === 212 || + parent.kind === 219 || + parent.kind === 259) { + addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); break; } - if (parent_19.kind === 221) { - var tryStatement = parent_19; + if (parent.kind === 223) { + var tryStatement = parent; if (tryStatement.tryBlock === n) { - addOutliningSpan(parent_19, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); break; } else if (tryStatement.finallyBlock === n) { @@ -58380,32 +64710,32 @@ var ts; } } } - var span_14 = ts.createTextSpanFromBounds(n.getStart(), n.end); + var span_15 = ts.createTextSpanFromNode(n); elements.push({ - textSpan: span_14, - hintSpan: span_14, + textSpan: span_15, + hintSpan: span_15, bannerText: collapseText, autoCollapse: autoCollapse(n) }); break; } - case 231: { + case 233: { var openBrace = ts.findChildOfKind(n, 16, sourceFile); var closeBrace = ts.findChildOfKind(n, 17, sourceFile); addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); break; } - case 226: - case 227: + case 228: case 229: - case 176: - case 232: { + case 231: + case 177: + case 234: { var openBrace = ts.findChildOfKind(n, 16, sourceFile); var closeBrace = ts.findChildOfKind(n, 17, sourceFile); addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); break; } - case 175: + case 176: var openBracket = ts.findChildOfKind(n, 20, sourceFile); var closeBracket = ts.findChildOfKind(n, 21, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); @@ -58482,10 +64812,11 @@ var ts; return totalMatch; } function getWordSpans(word) { - if (!(word in stringToWordSpans)) { - stringToWordSpans[word] = breakIntoWordSpans(word); + var spans = stringToWordSpans.get(word); + if (!spans) { + stringToWordSpans.set(word, spans = breakIntoWordSpans(word)); } - return stringToWordSpans[word]; + return spans; } function matchTextChunk(candidate, chunk, punctuationStripped) { var index = indexOfIgnoringCase(candidate, chunk.textLowerCase); @@ -58502,9 +64833,9 @@ var ts; if (index > 0) { var wordSpans = getWordSpans(candidate); for (var _i = 0, wordSpans_1 = wordSpans; _i < wordSpans_1.length; _i++) { - var span_15 = wordSpans_1[_i]; - if (partStartsWith(candidate, span_15, chunk.text, true)) { - return createPatternMatch(PatternMatchKind.substring, punctuationStripped, partStartsWith(candidate, span_15, chunk.text, false)); + var span_16 = wordSpans_1[_i]; + if (partStartsWith(candidate, span_16, chunk.text, true)) { + return createPatternMatch(PatternMatchKind.substring, punctuationStripped, partStartsWith(candidate, span_16, chunk.text, false)); } } } @@ -58667,7 +64998,8 @@ var ts; return str === str.toLowerCase(); } function indexOfIgnoringCase(string, value) { - for (var i = 0, n = string.length - value.length; i <= n; i++) { + var n = string.length - value.length; + for (var i = 0; i <= n; i++) { if (startsWithIgnoringCase(string, value, i)) { return i; } @@ -58675,7 +65007,7 @@ var ts; return -1; } function startsWithIgnoringCase(string, value, start) { - for (var i = 0, n = value.length; i < n; i++) { + for (var i = 0; i < value.length; i++) { var ch1 = toLowerCase(string.charCodeAt(i + start)); var ch2 = value.charCodeAt(i); if (ch1 !== ch2) { @@ -58743,7 +65075,7 @@ var ts; function breakIntoSpans(identifier, word) { var result = []; var wordStart = 0; - for (var i = 1, n = identifier.length; i < n; i++) { + for (var i = 1; i < identifier.length; i++) { var lastIsDigit = isDigit(identifier.charCodeAt(i - 1)); var currentIsDigit = isDigit(identifier.charCodeAt(i)); var hasTransitionFromLowerToUpper = transitionFromLowerToUpper(identifier, word, i); @@ -58917,7 +65249,7 @@ var ts; else { if (token === 70 || ts.isKeyword(token)) { token = nextToken(); - if (token === 138) { + if (token === 139) { token = nextToken(); if (token === 9) { recordModuleName(); @@ -58943,7 +65275,7 @@ var ts; } if (token === 17) { token = nextToken(); - if (token === 138) { + if (token === 139) { token = nextToken(); if (token === 9) { recordModuleName(); @@ -58957,7 +65289,7 @@ var ts; token = nextToken(); if (token === 70 || ts.isKeyword(token)) { token = nextToken(); - if (token === 138) { + if (token === 139) { token = nextToken(); if (token === 9) { recordModuleName(); @@ -58983,7 +65315,7 @@ var ts; } if (token === 17) { token = nextToken(); - if (token === 138) { + if (token === 139) { token = nextToken(); if (token === 9) { recordModuleName(); @@ -58993,7 +65325,7 @@ var ts; } else if (token === 38) { token = nextToken(); - if (token === 138) { + if (token === 139) { token = nextToken(); if (token === 9) { recordModuleName(); @@ -59120,90 +65452,85 @@ var ts; var Rename; (function (Rename) { function getRenameInfo(typeChecker, defaultLibFileName, getCanonicalFileName, sourceFile, position) { - var canonicalDefaultLibName = getCanonicalFileName(ts.normalizePath(defaultLibFileName)); + var getCanonicalDefaultLibName = ts.memoize(function () { return getCanonicalFileName(ts.normalizePath(defaultLibFileName)); }); var node = ts.getTouchingWord(sourceFile, position, true); - if (node) { - if (node.kind === 70 || - node.kind === 9 || - ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || - ts.isThis(node)) { - var symbol = typeChecker.getSymbolAtLocation(node); - if (symbol) { - var declarations = symbol.getDeclarations(); - if (declarations && declarations.length > 0) { - if (ts.forEach(declarations, isDefinedInLibraryFile)) { - return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library)); - } - var displayName = ts.stripQuotes(ts.getDeclaredName(typeChecker, symbol, node)); - var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - if (kind) { - return { - canRename: true, - kind: kind, - displayName: displayName, - localizedErrorMessage: undefined, - fullDisplayName: typeChecker.getFullyQualifiedName(symbol), - kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), - triggerSpan: createTriggerSpanForNode(node, sourceFile) - }; - } - } - } - else if (node.kind === 9) { - var type = ts.getStringLiteralTypeForNode(node, typeChecker); - if (type) { - if (isDefinedInLibraryFile(node)) { - return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library)); - } - else { - var displayName = ts.stripQuotes(type.text); - return { - canRename: true, - kind: ts.ScriptElementKind.variableElement, - displayName: displayName, - localizedErrorMessage: undefined, - fullDisplayName: displayName, - kindModifiers: ts.ScriptElementKindModifier.none, - triggerSpan: createTriggerSpanForNode(node, sourceFile) - }; - } - } - } - } - } - return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_this_element)); - function getRenameInfoError(localizedErrorMessage) { - return { - canRename: false, - localizedErrorMessage: localizedErrorMessage, - displayName: undefined, - fullDisplayName: undefined, - kind: undefined, - kindModifiers: undefined, - triggerSpan: undefined - }; - } + var renameInfo = node && nodeIsEligibleForRename(node) + ? getRenameInfoForNode(node, typeChecker, sourceFile, isDefinedInLibraryFile) + : undefined; + return renameInfo || getRenameInfoError(ts.Diagnostics.You_cannot_rename_this_element); function isDefinedInLibraryFile(declaration) { - if (defaultLibFileName) { - var sourceFile_1 = declaration.getSourceFile(); - var canonicalName = getCanonicalFileName(ts.normalizePath(sourceFile_1.fileName)); - if (canonicalName === canonicalDefaultLibName) { - return true; - } + if (!defaultLibFileName) { + return false; } - return false; - } - function createTriggerSpanForNode(node, sourceFile) { - var start = node.getStart(sourceFile); - var width = node.getWidth(sourceFile); - if (node.kind === 9) { - start += 1; - width -= 2; - } - return ts.createTextSpan(start, width); + var sourceFile = declaration.getSourceFile(); + var canonicalName = getCanonicalFileName(ts.normalizePath(sourceFile.fileName)); + return canonicalName === getCanonicalDefaultLibName(); } } Rename.getRenameInfo = getRenameInfo; + function getRenameInfoForNode(node, typeChecker, sourceFile, isDefinedInLibraryFile) { + var symbol = typeChecker.getSymbolAtLocation(node); + if (symbol) { + var declarations = symbol.getDeclarations(); + if (declarations && declarations.length > 0) { + if (ts.some(declarations, isDefinedInLibraryFile)) { + return getRenameInfoError(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); + } + if (node.kind === 70 && + node.originalKeywordKind === 78 && + symbol.parent.flags & 1536) { + return undefined; + } + var displayName = ts.stripQuotes(ts.getDeclaredName(typeChecker, symbol, node)); + var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); + return kind ? getRenameInfoSuccess(displayName, typeChecker.getFullyQualifiedName(symbol), kind, ts.SymbolDisplay.getSymbolModifiers(symbol), node, sourceFile) : undefined; + } + } + else if (node.kind === 9) { + if (isDefinedInLibraryFile(node)) { + return getRenameInfoError(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); + } + var displayName = ts.stripQuotes(node.text); + return getRenameInfoSuccess(displayName, displayName, ts.ScriptElementKind.variableElement, ts.ScriptElementKindModifier.none, node, sourceFile); + } + } + function getRenameInfoSuccess(displayName, fullDisplayName, kind, kindModifiers, node, sourceFile) { + return { + canRename: true, + kind: kind, + displayName: displayName, + localizedErrorMessage: undefined, + fullDisplayName: fullDisplayName, + kindModifiers: kindModifiers, + triggerSpan: createTriggerSpanForNode(node, sourceFile) + }; + } + function getRenameInfoError(diagnostic) { + return { + canRename: false, + localizedErrorMessage: ts.getLocaleSpecificMessage(diagnostic), + displayName: undefined, + fullDisplayName: undefined, + kind: undefined, + kindModifiers: undefined, + triggerSpan: undefined + }; + } + function createTriggerSpanForNode(node, sourceFile) { + var start = node.getStart(sourceFile); + var width = node.getWidth(sourceFile); + if (node.kind === 9) { + start += 1; + width -= 2; + } + return ts.createTextSpan(start, width); + } + function nodeIsEligibleForRename(node) { + return node.kind === 70 || + node.kind === 9 || + ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || + ts.isThis(node); + } })(Rename = ts.Rename || (ts.Rename = {})); })(ts || (ts = {})); var ts; @@ -59211,6 +65538,13 @@ var ts; var SignatureHelp; (function (SignatureHelp) { var emptyArray = []; + var ArgumentListKind; + (function (ArgumentListKind) { + ArgumentListKind[ArgumentListKind["TypeArguments"] = 0] = "TypeArguments"; + ArgumentListKind[ArgumentListKind["CallArguments"] = 1] = "CallArguments"; + ArgumentListKind[ArgumentListKind["TaggedTemplateArguments"] = 2] = "TaggedTemplateArguments"; + ArgumentListKind[ArgumentListKind["JSXAttributesArguments"] = 3] = "JSXAttributesArguments"; + })(ArgumentListKind = SignatureHelp.ArgumentListKind || (SignatureHelp.ArgumentListKind = {})); function getSignatureHelpItems(program, sourceFile, position, cancellationToken) { var typeChecker = program.getTypeChecker(); var startingToken = ts.findTokenOnLeftOfPosition(sourceFile, position); @@ -59236,14 +65570,14 @@ var ts; } SignatureHelp.getSignatureHelpItems = getSignatureHelpItems; function createJavaScriptSignatureHelpItems(argumentInfo, program) { - if (argumentInfo.invocation.kind !== 179) { + if (argumentInfo.invocation.kind !== 180) { return undefined; } var callExpression = argumentInfo.invocation; var expression = callExpression.expression; var name = expression.kind === 70 ? expression - : expression.kind === 177 + : expression.kind === 178 ? expression.name : undefined; if (!name || !name.text) { @@ -59253,10 +65587,10 @@ var ts; for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { var sourceFile = _a[_i]; var nameToDeclarations = sourceFile.getNamedDeclarations(); - var declarations = nameToDeclarations[name.text]; + var declarations = nameToDeclarations.get(name.text); if (declarations) { - for (var _b = 0, declarations_10 = declarations; _b < declarations_10.length; _b++) { - var declaration = declarations_10[_b]; + for (var _b = 0, declarations_13 = declarations; _b < declarations_13.length; _b++) { + var declaration = declarations_13[_b]; var symbol = declaration.symbol; if (symbol) { var type = typeChecker.getTypeOfSymbolAtLocation(symbol, declaration); @@ -59272,7 +65606,7 @@ var ts; } } function getImmediatelyContainingArgumentInfo(node, position, sourceFile) { - if (node.parent.kind === 179 || node.parent.kind === 180) { + if (node.parent.kind === 180 || node.parent.kind === 181) { var callExpression = node.parent; if (node.kind === 26 || node.kind === 18) { @@ -59304,23 +65638,23 @@ var ts; } return undefined; } - else if (node.kind === 12 && node.parent.kind === 181) { + else if (node.kind === 12 && node.parent.kind === 182) { if (ts.isInsideTemplateLiteral(node, position)) { return getArgumentListInfoForTemplate(node.parent, 0, sourceFile); } } - else if (node.kind === 13 && node.parent.parent.kind === 181) { + else if (node.kind === 13 && node.parent.parent.kind === 182) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 194); + ts.Debug.assert(templateExpression.kind === 195); var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } - else if (node.parent.kind === 202 && node.parent.parent.parent.kind === 181) { + else if (node.parent.kind === 204 && node.parent.parent.parent.kind === 182) { var templateSpan = node.parent; var templateExpression = templateSpan.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 194); + ts.Debug.assert(templateExpression.kind === 195); if (node.kind === 15 && !ts.isInsideTemplateLiteral(node, position)) { return undefined; } @@ -59328,8 +65662,20 @@ var ts; var argumentIndex = getArgumentIndexForTemplatePiece(spanIndex, node, position); return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } + else if (node.parent && ts.isJsxOpeningLikeElement(node.parent)) { + var attributeSpanStart = node.parent.attributes.getFullStart(); + var attributeSpanEnd = ts.skipTrivia(sourceFile.text, node.parent.attributes.getEnd(), false); + return { + kind: 3, + invocation: node.parent, + argumentsSpan: ts.createTextSpan(attributeSpanStart, attributeSpanEnd - attributeSpanStart), + argumentIndex: 0, + argumentCount: 1 + }; + } return undefined; } + SignatureHelp.getImmediatelyContainingArgumentInfo = getImmediatelyContainingArgumentInfo; function getArgumentIndex(argumentsList, node) { var argumentIndex = 0; var listChildren = argumentsList.getChildren(); @@ -59384,7 +65730,7 @@ var ts; var template = taggedTemplate.template; var applicableSpanStart = template.getStart(); var applicableSpanEnd = template.getEnd(); - if (template.kind === 194) { + if (template.kind === 195) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, false); @@ -59393,7 +65739,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node, position, sourceFile) { - for (var n = node; n.kind !== 261; n = n.parent) { + for (var n = node; n.kind !== 264; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } @@ -59476,7 +65822,8 @@ var ts; suffixDisplayParts: suffixDisplayParts, separatorDisplayParts: [ts.punctuationPart(25), ts.spacePart()], parameters: signatureHelpParameters, - documentation: candidateSignature.getDocumentationComment() + documentation: candidateSignature.getDocumentationComment(), + tags: candidateSignature.getJsDocTags() }; }); var argumentIndex = argumentListInfo.argumentIndex; @@ -59523,9 +65870,9 @@ var ts; var SymbolDisplay; (function (SymbolDisplay) { function getSymbolKind(typeChecker, symbol, location) { - var flags = symbol.getFlags(); + var flags = symbol.flags; if (flags & 32) - return ts.getDeclarationOfKind(symbol, 197) ? + return ts.getDeclarationOfKind(symbol, 198) ? ts.ScriptElementKind.localClassElement : ts.ScriptElementKind.classElement; if (flags & 384) return ts.ScriptElementKind.enumElement; @@ -59535,12 +65882,12 @@ var ts; return ts.ScriptElementKind.interfaceElement; if (flags & 262144) return ts.ScriptElementKind.typeParameterElement; - var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, flags, location); + var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location); if (result === ts.ScriptElementKind.unknown) { if (flags & 262144) return ts.ScriptElementKind.typeParameterElement; if (flags & 8) - return ts.ScriptElementKind.variableElement; + return ts.ScriptElementKind.enumMemberElement; if (flags & 8388608) return ts.ScriptElementKind.alias; if (flags & 1536) @@ -59549,7 +65896,7 @@ var ts; return result; } SymbolDisplay.getSymbolKind = getSymbolKind; - function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, flags, location) { + function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location) { if (typeChecker.isUndefinedSymbol(symbol)) { return ts.ScriptElementKind.variableElement; } @@ -59559,6 +65906,7 @@ var ts; if (location.kind === 98 && ts.isExpression(location)) { return ts.ScriptElementKind.parameterElement; } + var flags = symbol.flags; if (flags & 3) { if (ts.isFirstDeclarationOfSymbolParameter(symbol)) { return ts.ScriptElementKind.parameterElement; @@ -59582,7 +65930,7 @@ var ts; if (flags & 16384) return ts.ScriptElementKind.constructorImplementationElement; if (flags & 4) { - if (flags & 268435456) { + if (flags & 134217728 && symbol.checkFlags & 6) { var unionPropertyKind = ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) { var rootSymbolFlags = rootSymbol.getFlags(); if (rootSymbolFlags & (98308 | 3)) { @@ -59599,6 +65947,9 @@ var ts; } return unionPropertyKind; } + if (location.parent && ts.isJsxAttribute(location.parent)) { + return ts.ScriptElementKind.jsxAttribute; + } return ts.ScriptElementKind.memberVariableElement; } return ts.ScriptElementKind.unknown; @@ -59613,8 +65964,9 @@ var ts; if (semanticMeaning === void 0) { semanticMeaning = ts.getMeaningFromLocation(location); } var displayParts = []; var documentation; + var tags; var symbolFlags = symbol.flags; - var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, symbolFlags, location); + var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location); var hasAddedSymbolInfo; var isThisExpression = location.kind === 98 && ts.isExpression(location); var type; @@ -59625,26 +65977,29 @@ var ts; var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (type) { - if (location.parent && location.parent.kind === 177) { + if (location.parent && location.parent.kind === 178) { var right = location.parent.name; if (right === location || (right && right.getFullWidth() === 0)) { location = location.parent; } } - var callExpression = void 0; - if (location.kind === 179 || location.kind === 180) { - callExpression = location; + var callExpressionLike = void 0; + if (location.kind === 180 || location.kind === 181) { + callExpressionLike = location; } else if (ts.isCallExpressionTarget(location) || ts.isNewExpressionTarget(location)) { - callExpression = location.parent; + callExpressionLike = location.parent; } - if (callExpression) { + else if (location.parent && ts.isJsxOpeningLikeElement(location.parent) && ts.isFunctionLike(symbol.valueDeclaration)) { + callExpressionLike = location.parent; + } + if (callExpressionLike) { var candidateSignatures = []; - signature = typeChecker.getResolvedSignature(callExpression, candidateSignatures); + signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures); if (!signature && candidateSignatures.length) { signature = candidateSignatures[0]; } - var useConstructSignatures = callExpression.kind === 180 || callExpression.expression.kind === 96; + var useConstructSignatures = callExpressionLike.kind === 181 || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 96); var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { signature = allSignatures.length ? allSignatures[0] : undefined; @@ -59668,6 +66023,7 @@ var ts; addPrefixForAnyFunctionOrVar(symbol, symbolKind); } switch (symbolKind) { + case ts.ScriptElementKind.jsxAttribute: case ts.ScriptElementKind.memberVariableElement: case ts.ScriptElementKind.variableElement: case ts.ScriptElementKind.constElement: @@ -59692,21 +66048,21 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304)) || - (location.kind === 122 && location.parent.kind === 150)) { + (location.kind === 122 && location.parent.kind === 151)) { var functionDeclaration = location.parent; - var allSignatures = functionDeclaration.kind === 150 ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration.kind === 151 ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); } else { signature = allSignatures[0]; } - if (functionDeclaration.kind === 150) { + if (functionDeclaration.kind === 151) { symbolKind = ts.ScriptElementKind.constructorImplementationElement; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 153 && + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 154 && !(type.symbol.flags & 2048 || type.symbol.flags & 4096) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -59715,7 +66071,7 @@ var ts; } } if (symbolFlags & 32 && !hasAddedSymbolInfo && !isThisExpression) { - if (ts.getDeclarationOfKind(symbol, 197)) { + if (ts.getDeclarationOfKind(symbol, 198)) { pushTypePart(ts.ScriptElementKind.localClassElement); } else { @@ -59734,7 +66090,7 @@ var ts; } if (symbolFlags & 524288) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(136)); + displayParts.push(ts.keywordPart(137)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); @@ -59755,7 +66111,7 @@ var ts; } if (symbolFlags & 1536) { addNewLineIfDisplayPartsExist(); - var declaration = ts.getDeclarationOfKind(symbol, 230); + var declaration = ts.getDeclarationOfKind(symbol, 232); var isNamespace = declaration && declaration.name && declaration.name.kind === 70; displayParts.push(ts.keywordPart(isNamespace ? 128 : 127)); displayParts.push(ts.spacePart()); @@ -59774,25 +66130,25 @@ var ts; writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); } else { - var declaration = ts.getDeclarationOfKind(symbol, 143); + var declaration = ts.getDeclarationOfKind(symbol, 144); ts.Debug.assert(declaration !== undefined); declaration = declaration.parent; if (declaration) { if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); - if (declaration.kind === 154) { + if (declaration.kind === 155) { displayParts.push(ts.keywordPart(93)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 153 && declaration.name) { + else if (declaration.kind !== 154 && declaration.name) { addFullSymbolName(declaration.symbol); } ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32)); } - else if (declaration.kind === 228) { + else if (declaration.kind === 230) { addInPrefix(); - displayParts.push(ts.keywordPart(136)); + displayParts.push(ts.keywordPart(137)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -59801,9 +66157,10 @@ var ts; } } if (symbolFlags & 8) { + symbolKind = ts.ScriptElementKind.enumMemberElement; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 260) { + if (declaration.kind === 263) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -59815,7 +66172,7 @@ var ts; } if (symbolFlags & 8388608) { addNewLineIfDisplayPartsExist(); - if (symbol.declarations[0].kind === 233) { + if (symbol.declarations[0].kind === 235) { displayParts.push(ts.keywordPart(83)); displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(128)); @@ -59826,7 +66183,7 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 234) { + if (declaration.kind === 236) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); @@ -59861,6 +66218,7 @@ var ts; addPrefixForAnyFunctionOrVar(symbol, symbolKind); } if (symbolKind === ts.ScriptElementKind.memberVariableElement || + symbolKind === ts.ScriptElementKind.jsxAttribute || symbolFlags & 3 || symbolKind === ts.ScriptElementKind.localVariableElement || isThisExpression) { @@ -59893,11 +66251,12 @@ var ts; } if (!documentation) { documentation = symbol.getDocumentationComment(); + tags = symbol.getJsDocTags(); if (documentation.length === 0 && symbol.flags & 4) { - if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 261; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 264; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 192) { + if (!declaration.parent || declaration.parent.kind !== 193) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -59905,6 +66264,7 @@ var ts; continue; } documentation = rhsSymbol.getDocumentationComment(); + tags = rhsSymbol.getJsDocTags(); if (documentation.length > 0) { break; } @@ -59912,7 +66272,7 @@ var ts; } } } - return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind }; + return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind, tags: tags }; function addNewLineIfDisplayPartsExist() { if (displayParts.length) { displayParts.push(ts.lineBreakPart()); @@ -59963,6 +66323,7 @@ var ts; displayParts.push(ts.punctuationPart(19)); } documentation = signature.getDocumentationComment(); + tags = signature.getJsDocTags(); } function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) { var typeParameterParts = ts.mapToDisplayParts(function (writer) { @@ -59977,14 +66338,14 @@ var ts; return false; } return ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 184) { + if (declaration.kind === 185) { return true; } - if (declaration.kind !== 223 && declaration.kind !== 225) { + if (declaration.kind !== 225 && declaration.kind !== 227) { return false; } - for (var parent_20 = declaration.parent; !ts.isFunctionBlock(parent_20); parent_20 = parent_20.parent) { - if (parent_20.kind === 261 || parent_20.kind === 231) { + for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { + if (parent.kind === 264 || parent.kind === 233) { return false; } } @@ -60019,7 +66380,7 @@ var ts; sourceFile.moduleName = transpileOptions.moduleName; } if (transpileOptions.renamedDependencies) { - sourceFile.renamedDependencies = ts.createMap(transpileOptions.renamedDependencies); + sourceFile.renamedDependencies = ts.createMapFromTemplate(transpileOptions.renamedDependencies); } var newLine = ts.getNewLineCharacter(options); var outputText; @@ -60065,10 +66426,10 @@ var ts; var commandLineOptionsStringToEnum; function fixupCompilerOptions(options, diagnostics) { commandLineOptionsStringToEnum = commandLineOptionsStringToEnum || ts.filter(ts.optionDeclarations, function (o) { - return typeof o.type === "object" && !ts.forEachProperty(o.type, function (v) { return typeof v !== "number"; }); + return typeof o.type === "object" && !ts.forEachEntry(o.type, function (v) { return typeof v !== "number"; }); }); options = ts.clone(options); - var _loop_4 = function (opt) { + var _loop_5 = function (opt) { if (!ts.hasProperty(options, opt.name)) { return "continue"; } @@ -60077,17 +66438,18 @@ var ts; options[opt.name] = ts.parseCustomTypeOption(opt, value, diagnostics); } else { - if (!ts.forEachProperty(opt.type, function (v) { return v === value; })) { + if (!ts.forEachEntry(opt.type, function (v) { return v === value; })) { diagnostics.push(ts.createCompilerDiagnosticForInvalidCustomType(opt)); } } }; for (var _i = 0, commandLineOptionsStringToEnum_1 = commandLineOptionsStringToEnum; _i < commandLineOptionsStringToEnum_1.length; _i++) { var opt = commandLineOptionsStringToEnum_1[_i]; - _loop_4(opt); + _loop_5(opt); } return options; } + ts.fixupCompilerOptions = fixupCompilerOptions; })(ts || (ts = {})); var ts; (function (ts) { @@ -60096,10 +66458,19 @@ var ts; var standardScanner = ts.createScanner(5, false, 0); var jsxScanner = ts.createScanner(5, false, 1); var scanner; - function getFormattingScanner(sourceFile, startPos, endPos) { + var ScanAction; + (function (ScanAction) { + ScanAction[ScanAction["Scan"] = 0] = "Scan"; + ScanAction[ScanAction["RescanGreaterThanToken"] = 1] = "RescanGreaterThanToken"; + ScanAction[ScanAction["RescanSlashToken"] = 2] = "RescanSlashToken"; + ScanAction[ScanAction["RescanTemplateToken"] = 3] = "RescanTemplateToken"; + ScanAction[ScanAction["RescanJsxIdentifier"] = 4] = "RescanJsxIdentifier"; + ScanAction[ScanAction["RescanJsxText"] = 5] = "RescanJsxText"; + })(ScanAction || (ScanAction = {})); + function getFormattingScanner(text, languageVariant, startPos, endPos) { ts.Debug.assert(scanner === undefined, "Scanner should be undefined"); - scanner = sourceFile.languageVariant === 1 ? jsxScanner : standardScanner; - scanner.setText(sourceFile.text); + scanner = languageVariant === 1 ? jsxScanner : standardScanner; + scanner.setText(text); scanner.setTextPos(startPos); var wasNewLine = true; var leadingTrivia; @@ -60175,10 +66546,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { + case 252: case 250: - case 248: + case 251: case 249: - case 247: return node.kind === 70; } } @@ -60287,8 +66658,8 @@ var ts; } function isOnToken() { ts.Debug.assert(scanner !== undefined); - var current = (lastTokenInfo && lastTokenInfo.token.kind) || scanner.getToken(); - var startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); + var current = lastTokenInfo ? lastTokenInfo.token.kind : scanner.getToken(); + var startPos = lastTokenInfo ? lastTokenInfo.token.pos : scanner.getStartPos(); return startPos < endPos && current !== 1 && !ts.isTrivia(current); } function fixTokenKind(tokenInfo, container) { @@ -60389,6 +66760,20 @@ var ts; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); var ts; +(function (ts) { + var formatting; + (function (formatting) { + var FormattingRequestKind; + (function (FormattingRequestKind) { + FormattingRequestKind[FormattingRequestKind["FormatDocument"] = 0] = "FormatDocument"; + FormattingRequestKind[FormattingRequestKind["FormatSelection"] = 1] = "FormatSelection"; + FormattingRequestKind[FormattingRequestKind["FormatOnEnter"] = 2] = "FormatOnEnter"; + FormattingRequestKind[FormattingRequestKind["FormatOnSemicolon"] = 3] = "FormatOnSemicolon"; + FormattingRequestKind[FormattingRequestKind["FormatOnClosingCurlyBrace"] = 4] = "FormatOnClosingCurlyBrace"; + })(FormattingRequestKind = formatting.FormattingRequestKind || (formatting.FormattingRequestKind = {})); + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; (function (ts) { var formatting; (function (formatting) { @@ -60410,6 +66795,19 @@ var ts; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); var ts; +(function (ts) { + var formatting; + (function (formatting) { + var RuleAction; + (function (RuleAction) { + RuleAction[RuleAction["Ignore"] = 1] = "Ignore"; + RuleAction[RuleAction["Space"] = 2] = "Space"; + RuleAction[RuleAction["NewLine"] = 4] = "NewLine"; + RuleAction[RuleAction["Delete"] = 8] = "Delete"; + })(RuleAction = formatting.RuleAction || (formatting.RuleAction = {})); + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; (function (ts) { var formatting; (function (formatting) { @@ -60440,6 +66838,17 @@ var ts; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); var ts; +(function (ts) { + var formatting; + (function (formatting) { + var RuleFlags; + (function (RuleFlags) { + RuleFlags[RuleFlags["None"] = 0] = "None"; + RuleFlags[RuleFlags["CanDeleteNewLines"] = 1] = "CanDeleteNewLines"; + })(RuleFlags = formatting.RuleFlags || (formatting.RuleFlags = {})); + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; (function (ts) { var formatting; (function (formatting) { @@ -60511,10 +66920,10 @@ var ts; this.SpaceAfterQuestionMarkInConditionalOperator = new formatting.Rule(formatting.RuleDescriptor.create3(54, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsConditionalOperatorContext), 2)); this.NoSpaceAfterQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create3(54, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); this.SpaceAfterSemicolon = new formatting.Rule(formatting.RuleDescriptor.create3(24, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); - this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2)); + this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17, formatting.Shared.TokenRange.FromRange(0, 141, [19])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2)); this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(17, 81), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(17, 105), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); - this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17, formatting.Shared.TokenRange.FromTokens([19, 21, 25, 24])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); + this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17, formatting.Shared.TokenRange.FromTokens([21, 25, 24])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); this.NoSpaceBeforeDot = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 22), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); this.NoSpaceAfterDot = new formatting.Rule(formatting.RuleDescriptor.create3(22, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); this.NoSpaceBeforeOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); @@ -60525,10 +66934,10 @@ var ts; this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1); this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([19, 3, 80, 101, 86, 81]); this.SpaceBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1); - this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2)); - this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2)); - this.NoSpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 8)); - this.NoSpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 8)); + this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsBraceWrappedContext), 2)); + this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsBraceWrappedContext), 2)); + this.NoSpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); + this.NoSpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); this.NoSpaceBetweenEmptyBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(16, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsObjectContext), 8)); this.NewLineAfterOpenBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4)); this.NewLineBeforeCloseBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.AnyIncludingMultilineComments, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4)); @@ -60548,18 +66957,20 @@ var ts; this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([109, 75]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2)); this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionCallOrNewContext, Rules.IsPreviousTokenNotComma), 8)); this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(88, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); + this.SpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionDeclContext), 2)); this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionDeclContext), 8)); this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(104, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsVoidOpContext), 2)); this.NoSpaceBetweenReturnAndSemicolon = new formatting.Rule(formatting.RuleDescriptor.create1(95, 24), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); this.SpaceBetweenStatements = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([19, 80, 81, 72]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonJsxElementContext, Rules.IsNotForContext), 2)); this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([101, 86]), 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); - this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([124, 133]), 70), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); + this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([124, 134]), 70), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); this.SpaceBeforeBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryKeywordOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.SpaceAfterBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryKeywordOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2)); + this.SpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(122, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); this.NoSpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(122, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([127, 131]), 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); - this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([116, 74, 123, 78, 82, 83, 84, 124, 107, 90, 108, 127, 128, 111, 113, 112, 133, 114, 136, 138]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); - this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([84, 107, 138])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); + this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([116, 74, 123, 78, 82, 83, 84, 124, 107, 90, 108, 127, 128, 111, 113, 112, 130, 134, 114, 137, 139, 126]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); + this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([84, 107, 139])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(9, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2)); this.SpaceBeforeArrow = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 35), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); this.SpaceAfterArrow = new formatting.Rule(formatting.RuleDescriptor.create3(35, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); @@ -60573,7 +66984,7 @@ var ts; this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(16, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsObjectTypeContext), 8)); this.SpaceBeforeAt = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 56), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); this.NoSpaceAfterAt = new formatting.Rule(formatting.RuleDescriptor.create3(56, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); - this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([116, 70, 83, 78, 74, 114, 113, 111, 112, 124, 133, 20, 38])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2)); + this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([116, 70, 83, 78, 74, 114, 113, 111, 112, 124, 134, 20, 38])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2)); this.NoSpaceBetweenFunctionKeywordAndStar = new formatting.Rule(formatting.RuleDescriptor.create1(88, 38), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), 8)); this.SpaceAfterStarInGeneratorDeclaration = new formatting.Rule(formatting.RuleDescriptor.create3(38, formatting.Shared.TokenRange.FromTokens([70, 18])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), 2)); this.NoSpaceBetweenYieldKeywordAndStar = new formatting.Rule(formatting.RuleDescriptor.create1(115, 38), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsYieldOrYieldStarWithOperand), 8)); @@ -60586,6 +66997,7 @@ var ts; this.NoSpaceBeforeGreaterThanTokenInJsxOpeningElement = new formatting.Rule(formatting.RuleDescriptor.create1(40, 28), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxSelfClosingElementContext, Rules.IsNonJsxSameLineTokenContext), 8)); this.NoSpaceBeforeEqualInJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 57), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxAttributeContext, Rules.IsNonJsxSameLineTokenContext), 8)); this.NoSpaceAfterEqualInJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create3(57, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxAttributeContext, Rules.IsNonJsxSameLineTokenContext), 8)); + this.NoSpaceBeforeNonNullAssertionOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 50), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonNullAssertionContext), 8)); this.HighPriorityCommonRules = [ this.IgnoreBeforeComment, this.IgnoreAfterLineComment, this.NoSpaceBeforeColon, this.SpaceAfterColon, this.NoSpaceBeforeQuestionMark, this.SpaceAfterQuestionMarkInConditionalOperator, @@ -60614,7 +67026,7 @@ var ts; this.NoSpaceBetweenTagAndTemplateString, this.SpaceBeforeJsxAttribute, this.SpaceBeforeSlashInJsxOpeningElement, this.NoSpaceBeforeGreaterThanTokenInJsxOpeningElement, this.NoSpaceBeforeEqualInJsxAttribute, this.NoSpaceAfterEqualInJsxAttribute, - this.NoSpaceAfterConstructor, this.NoSpaceAfterModuleImport, + this.NoSpaceAfterModuleImport, this.SpaceAfterCertainTypeScriptKeywords, this.SpaceBeforeCertainTypeScriptKeywords, this.SpaceAfterModuleName, this.SpaceBeforeArrow, this.SpaceAfterArrow, @@ -60629,6 +67041,7 @@ var ts; this.SpaceBeforeAt, this.NoSpaceAfterAt, this.SpaceAfterDecorator, + this.NoSpaceBeforeNonNullAssertionOperator ]; this.LowPriorityCommonRules = [ this.NoSpaceBeforeSemicolon, @@ -60637,7 +67050,6 @@ var ts; this.NoSpaceBeforeOpenBracket, this.NoSpaceAfterCloseBracket, this.SpaceAfterSemicolon, - this.NoSpaceBeforeOpenParenInFuncDecl, this.SpaceBetweenStatements, this.SpaceAfterTryFinally ]; this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(25, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonJsxElementContext, Rules.IsNextTokenNotCloseBracket), 2)); @@ -60678,43 +67090,44 @@ var ts; } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name_48 in o) { - if (o[name_48] === rule) { - return name_48; + for (var name in o) { + if (o[name] === rule) { + return name; } } throw new Error("Unknown rule"); }; Rules.IsForContext = function (context) { - return context.contextNode.kind === 211; + return context.contextNode.kind === 213; }; Rules.IsNotForContext = function (context) { return !Rules.IsForContext(context); }; Rules.IsBinaryOpContext = function (context) { switch (context.contextNode.kind) { - case 192: case 193: - case 200: - case 243: - case 239: - case 156: - case 164: + case 194: + case 201: + case 245: + case 241: + case 157: case 165: + case 166: return true; - case 174: - case 228: - case 234: - case 223: - case 144: - case 260: + case 175: + case 230: + case 236: + case 225: + case 145: + case 263: + case 148: case 147: - case 146: return context.currentTokenSpan.kind === 57 || context.nextTokenSpan.kind === 57; - case 212: + case 214: + case 144: return context.currentTokenSpan.kind === 91 || context.nextTokenSpan.kind === 91; - case 213: - return context.currentTokenSpan.kind === 140 || context.nextTokenSpan.kind === 140; + case 215: + return context.currentTokenSpan.kind === 141 || context.nextTokenSpan.kind === 141; } return false; }; @@ -60722,11 +67135,14 @@ var ts; return !Rules.IsBinaryOpContext(context); }; Rules.IsConditionalOperatorContext = function (context) { - return context.contextNode.kind === 193; + return context.contextNode.kind === 194; }; Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { return context.TokensAreOnSameLine() || Rules.IsBeforeMultilineBlockContext(context); }; + Rules.IsBraceWrappedContext = function (context) { + return context.contextNode.kind === 173 || Rules.IsSingleLineBlockContext(context); + }; Rules.IsBeforeMultilineBlockContext = function (context) { return Rules.IsBeforeBlockContext(context) && !(context.NextNodeAllOnSameLine() || context.NextNodeBlockIsOnOneLine()); }; @@ -60747,90 +67163,96 @@ var ts; return true; } switch (node.kind) { - case 204: - case 232: - case 176: - case 231: + case 206: + case 234: + case 177: + case 233: return true; } return false; }; Rules.IsFunctionDeclContext = function (context) { switch (context.contextNode.kind) { - case 225: + case 227: + case 150: case 149: - case 148: - case 151: case 152: case 153: - case 184: - case 150: + case 154: case 185: - case 227: + case 151: + case 186: + case 229: return true; } return false; }; Rules.IsFunctionDeclarationOrFunctionExpressionContext = function (context) { - return context.contextNode.kind === 225 || context.contextNode.kind === 184; + return context.contextNode.kind === 227 || context.contextNode.kind === 185; }; Rules.IsTypeScriptDeclWithBlockContext = function (context) { return Rules.NodeIsTypeScriptDeclWithBlockContext(context.contextNode); }; Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { switch (node.kind) { - case 226: - case 197: - case 227: + case 228: + case 198: case 229: - case 161: - case 230: - case 241: - case 242: - case 235: - case 238: + case 231: + case 162: + case 232: + case 243: + case 244: + case 237: + case 240: return true; } return false; }; Rules.IsAfterCodeBlockContext = function (context) { switch (context.currentTokenParent.kind) { - case 226: - case 230: - case 229: - case 204: - case 256: + case 228: + case 232: case 231: - case 218: + case 259: + case 233: + case 220: return true; + case 206: { + var blockParent = context.currentTokenParent.parent; + if (blockParent.kind !== 186 && + blockParent.kind !== 185) { + return true; + } + } } return false; }; Rules.IsControlDeclContext = function (context) { switch (context.contextNode.kind) { - case 208: - case 218: - case 211: - case 212: - case 213: case 210: - case 221: - case 209: - case 217: - case 256: + case 220: + case 213: + case 214: + case 215: + case 212: + case 223: + case 211: + case 219: + case 259: return true; default: return false; } }; Rules.IsObjectContext = function (context) { - return context.contextNode.kind === 176; + return context.contextNode.kind === 177; }; Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind === 179; + return context.contextNode.kind === 180; }; Rules.IsNewContext = function (context) { - return context.contextNode.kind === 180; + return context.contextNode.kind === 181; }; Rules.IsFunctionCallOrNewContext = function (context) { return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); @@ -60842,25 +67264,25 @@ var ts; return context.nextTokenSpan.kind !== 21; }; Rules.IsArrowFunctionContext = function (context) { - return context.contextNode.kind === 185; + return context.contextNode.kind === 186; }; Rules.IsNonJsxSameLineTokenContext = function (context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 10; }; Rules.IsNonJsxElementContext = function (context) { - return context.contextNode.kind !== 246; + return context.contextNode.kind !== 248; }; Rules.IsJsxExpressionContext = function (context) { - return context.contextNode.kind === 252; + return context.contextNode.kind === 255; }; Rules.IsNextTokenParentJsxAttribute = function (context) { - return context.nextTokenParent.kind === 250; + return context.nextTokenParent.kind === 252; }; Rules.IsJsxAttributeContext = function (context) { - return context.contextNode.kind === 250; + return context.contextNode.kind === 252; }; Rules.IsJsxSelfClosingElementContext = function (context) { - return context.contextNode.kind === 247; + return context.contextNode.kind === 249; }; Rules.IsNotBeforeBlockInFunctionDeclarationContext = function (context) { return !Rules.IsFunctionDeclContext(context) && !Rules.IsBeforeBlockContext(context); @@ -60875,41 +67297,42 @@ var ts; while (ts.isPartOfExpression(node)) { node = node.parent; } - return node.kind === 145; + return node.kind === 146; }; Rules.IsStartOfVariableDeclarationList = function (context) { - return context.currentTokenParent.kind === 224 && + return context.currentTokenParent.kind === 226 && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; }; Rules.IsNotFormatOnEnter = function (context) { return context.formattingRequestKind !== 2; }; Rules.IsModuleDeclContext = function (context) { - return context.contextNode.kind === 230; + return context.contextNode.kind === 232; }; Rules.IsObjectTypeContext = function (context) { - return context.contextNode.kind === 161; + return context.contextNode.kind === 162; }; Rules.IsTypeArgumentOrParameterOrAssertion = function (token, parent) { if (token.kind !== 26 && token.kind !== 28) { return false; } switch (parent.kind) { - case 157: - case 182: - case 226: - case 197: + case 158: + case 183: + case 230: + case 228: + case 198: + case 229: case 227: - case 225: - case 184: case 185: + case 186: + case 150: case 149: - case 148: - case 153: case 154: - case 179: + case 155: case 180: - case 199: + case 181: + case 200: return true; default: return false; @@ -60920,13 +67343,16 @@ var ts; Rules.IsTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); }; Rules.IsTypeAssertionContext = function (context) { - return context.contextNode.kind === 182; + return context.contextNode.kind === 183; }; Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 104 && context.currentTokenParent.kind === 188; + return context.currentTokenSpan.kind === 104 && context.currentTokenParent.kind === 189; }; Rules.IsYieldOrYieldStarWithOperand = function (context) { - return context.contextNode.kind === 195 && context.contextNode.expression !== undefined; + return context.contextNode.kind === 196 && context.contextNode.expression !== undefined; + }; + Rules.IsNonNullAssertionContext = function (context) { + return context.contextNode.kind === 202; }; return Rules; }()); @@ -60948,7 +67374,7 @@ var ts; return result; }; RulesMap.prototype.Initialize = function (rules) { - this.mapRowLength = 140 + 1; + this.mapRowLength = 141 + 1; this.map = new Array(this.mapRowLength * this.mapRowLength); var rulesBucketConstructionStateList = new Array(this.map.length); this.FillRules(rules, rulesBucketConstructionStateList); @@ -60961,7 +67387,7 @@ var ts; }); }; RulesMap.prototype.GetRuleBucketIndex = function (row, column) { - ts.Debug.assert(row <= 140 && column <= 140, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 141 && column <= 141, "Must compute formatting context from tokens"); var rulesBucketIndex = (row * this.mapRowLength) + column; return rulesBucketIndex; }; @@ -61125,7 +67551,7 @@ var ts; } TokenAllAccess.prototype.GetTokens = function () { var result = []; - for (var token = 0; token <= 140; token++) { + for (var token = 0; token <= 141; token++) { result.push(token); } return result; @@ -61169,9 +67595,9 @@ var ts; }()); TokenRange.Any = TokenRange.AllTokens(); TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3])); - TokenRange.Keywords = TokenRange.FromRange(71, 140); + TokenRange.Keywords = TokenRange.FromRange(71, 141); TokenRange.BinaryOperators = TokenRange.FromRange(26, 69); - TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([91, 92, 140, 117, 125]); + TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([91, 92, 141, 117, 125]); TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([42, 43, 51, 50]); TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([8, 70, 18, 20, 16, 98, 93]); TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([70, 18, 98, 93]); @@ -61179,7 +67605,7 @@ var ts; TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([70, 18, 98, 93]); TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([70, 19, 21, 93]); TokenRange.Comments = TokenRange.FromTokens([2, 3]); - TokenRange.TypeNames = TokenRange.FromTokens([70, 132, 134, 121, 135, 104, 118]); + TokenRange.TypeNames = TokenRange.FromTokens([70, 132, 135, 121, 136, 104, 118]); Shared.TokenRange = TokenRange; })(Shared = formatting.Shared || (formatting.Shared = {})); })(formatting = ts.formatting || (ts.formatting = {})); @@ -61201,6 +67627,9 @@ var ts; RulesProvider.prototype.getRulesMap = function () { return this.rulesMap; }; + RulesProvider.prototype.getFormatOptions = function () { + return this.options; + }; RulesProvider.prototype.ensureUpToDate = function (options) { if (!this.options || !ts.compareDataObjects(this.options, options)) { var activeRules = this.createActiveRules(options); @@ -61212,6 +67641,12 @@ var ts; }; RulesProvider.prototype.createActiveRules = function (options) { var rules = this.globalRules.HighPriorityCommonRules.slice(0); + if (options.insertSpaceAfterConstructor) { + rules.push(this.globalRules.SpaceAfterConstructor); + } + else { + rules.push(this.globalRules.NoSpaceAfterConstructor); + } if (options.insertSpaceAfterCommaDelimiter) { rules.push(this.globalRules.SpaceAfterComma); } @@ -61290,6 +67725,12 @@ var ts; rules.push(this.globalRules.NoSpaceBeforeBinaryOperator); rules.push(this.globalRules.NoSpaceAfterBinaryOperator); } + if (options.insertSpaceBeforeFunctionParenthesis) { + rules.push(this.globalRules.SpaceBeforeOpenParenInFuncDecl); + } + else { + rules.push(this.globalRules.NoSpaceBeforeOpenParenInFuncDecl); + } if (options.placeOpenBraceOnNewLineForControlBlocks) { rules.push(this.globalRules.NewLineBeforeOpenBraceInControl); } @@ -61315,6 +67756,10 @@ var ts; (function (ts) { var formatting; (function (formatting) { + var Constants; + (function (Constants) { + Constants[Constants["Unknown"] = -1] = "Unknown"; + })(Constants || (Constants = {})); function formatOnEnter(position, sourceFile, rulesProvider, options) { var line = sourceFile.getLineAndCharacterOfPosition(position).line; if (line === 0) { @@ -61387,17 +67832,17 @@ var ts; } function isListElement(parent, node) { switch (parent.kind) { - case 226: - case 227: + case 228: + case 229: return ts.rangeContainsRange(parent.members, node); - case 230: + case 232: var body = parent.body; - return body && body.kind === 231 && ts.rangeContainsRange(body.statements, node); - case 261: - case 204: - case 231: + return body && body.kind === 233 && ts.rangeContainsRange(body.statements, node); + case 264: + case 206: + case 233: return ts.rangeContainsRange(parent.statements, node); - case 256: + case 259: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -61476,12 +67921,17 @@ var ts; } return 0; } + function formatNode(node, sourceFileLike, languageVariant, initialIndentation, delta, rulesProvider) { + var range = { pos: 0, end: sourceFileLike.text.length }; + return formatSpanWorker(range, node, initialIndentation, delta, formatting.getFormattingScanner(sourceFileLike.text, languageVariant, range.pos, range.end), rulesProvider.getFormatOptions(), rulesProvider, 1, function (_) { return false; }, sourceFileLike); + } + formatting.formatNode = formatNode; function formatSpan(originalRange, sourceFile, options, rulesProvider, requestKind) { - var rangeContainsError = prepareRangeContainsErrorFunction(sourceFile.parseDiagnostics, originalRange); - var formattingContext = new formatting.FormattingContext(sourceFile, requestKind); var enclosingNode = findEnclosingNode(originalRange, sourceFile); - var formattingScanner = formatting.getFormattingScanner(sourceFile, getScanStartPosition(enclosingNode, originalRange, sourceFile), originalRange.end); - var initialIndentation = formatting.SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, options); + return formatSpanWorker(originalRange, enclosingNode, formatting.SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, options), getOwnOrInheritedDelta(enclosingNode, options, sourceFile), formatting.getFormattingScanner(sourceFile.text, sourceFile.languageVariant, getScanStartPosition(enclosingNode, originalRange, sourceFile), originalRange.end), options, rulesProvider, requestKind, prepareRangeContainsErrorFunction(sourceFile.parseDiagnostics, originalRange), sourceFile); + } + function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delta, formattingScanner, options, rulesProvider, requestKind, rangeContainsError, sourceFile) { + var formattingContext = new formatting.FormattingContext(sourceFile, requestKind); var previousRangeHasError; var previousRange; var previousParent; @@ -61496,7 +67946,6 @@ var ts; if (enclosingNode.decorators) { undecoratedStartLine = sourceFile.getLineAndCharacterOfPosition(ts.getNonDecoratorTokenPosOfNode(enclosingNode, sourceFile)).line; } - var delta = getOwnOrInheritedDelta(enclosingNode, options, sourceFile); processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta); } if (!formattingScanner.isOnToken()) { @@ -61553,18 +68002,18 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 226: return 74; - case 227: return 108; - case 225: return 88; - case 229: return 229; - case 151: return 124; - case 152: return 133; - case 149: + case 228: return 74; + case 229: return 108; + case 227: return 88; + case 231: return 231; + case 152: return 124; + case 153: return 134; + case 150: if (node.asteriskToken) { return 38; } - case 147: - case 144: + case 148: + case 145: return node.name.kind; } } @@ -61588,17 +68037,30 @@ var ts; switch (kind) { case 16: case 17: - case 20: - case 21: case 18: case 19: case 81: case 105: case 56: return indentation; - default: - return nodeStartLine !== line ? indentation + getEffectiveDelta(delta, container) : indentation; + case 40: + case 28: { + if (container.kind === 250 || + container.kind === 251 || + container.kind === 249) { + return indentation; + } + break; + } + case 20: + case 21: { + if (container.kind !== 171) { + return indentation; + } + break; + } } + return nodeStartLine !== line ? indentation + getEffectiveDelta(delta, container) : indentation; }, getIndentation: function () { return indentation; }, getDelta: function (child) { return getEffectiveDelta(delta, child); }, @@ -61639,7 +68101,7 @@ var ts; if (tokenInfo.token.end > node.end) { break; } - consumeTokenAndAdvanceScanner(tokenInfo, node, nodeDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, node, nodeDynamicIndentation, node); } function processChildNode(child, inheritedIndentation, parent, parentDynamicIndentation, parentStartLine, undecoratedParentStartLine, isListItem, isFirstListItem) { var childStartPos = child.getStart(sourceFile); @@ -61669,7 +68131,7 @@ var ts; if (tokenInfo.token.end > childStartPos) { break; } - consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, node); } if (!formattingScanner.isOnToken()) { return inheritedIndentation; @@ -61680,11 +68142,11 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 145 ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 146 ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); childContextNode = node; - if (isFirstListItem && parent.kind === 175 && inheritedIndentation === -1) { + if (isFirstListItem && parent.kind === 176 && inheritedIndentation === -1) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -61704,10 +68166,10 @@ var ts; startLine = sourceFile.getLineAndCharacterOfPosition(tokenInfo.token.pos).line; var indentation_1 = computeIndentation(tokenInfo.token, startLine, -1, parent, parentDynamicIndentation, parentStartLine); listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, indentation_1.indentation, indentation_1.delta); - consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation, parent); } else { - consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation, parent); } } } @@ -61720,7 +68182,7 @@ var ts; if (formattingScanner.isOnToken()) { var tokenInfo = formattingScanner.readTokenInfo(parent); if (tokenInfo.token.kind === listEndToken && ts.rangeContainsRange(parent, tokenInfo.token)) { - consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation, parent); } } } @@ -61910,7 +68372,7 @@ var ts; startLine++; } var delta = indentation - nonWhitespaceColumnInFirstPart.column; - for (var i = startIndex, len = parts.length; i < len; i++, startLine++) { + for (var i = startIndex; i < parts.length; i++, startLine++) { var startLinePos_1 = ts.getStartPositionOfLine(startLine, sourceFile); var nonWhitespaceCharacterAndColumn = i === 0 ? nonWhitespaceColumnInFirstPart @@ -62000,12 +68462,12 @@ var ts; } function getOpenTokenForList(node, list) { switch (node.kind) { - case 150: - case 225: - case 184: - case 149: - case 148: + case 151: + case 227: case 185: + case 150: + case 149: + case 186: if (node.typeParameters === list) { return 26; } @@ -62013,8 +68475,8 @@ var ts; return 18; } break; - case 179: case 180: + case 181: if (node.typeArguments === list) { return 26; } @@ -62022,7 +68484,7 @@ var ts; return 18; } break; - case 157: + case 158: if (node.typeArguments === list) { return 26; } @@ -62095,7 +68557,12 @@ var ts; (function (formatting) { var SmartIndenter; (function (SmartIndenter) { - function getIndentation(position, sourceFile, options) { + var Value; + (function (Value) { + Value[Value["Unknown"] = -1] = "Unknown"; + })(Value || (Value = {})); + function getIndentation(position, sourceFile, options, assumeNewLineBeforeCloseBrace) { + if (assumeNewLineBeforeCloseBrace === void 0) { assumeNewLineBeforeCloseBrace = false; } if (position > sourceFile.text.length) { return getBaseIndentation(options); } @@ -62123,7 +68590,7 @@ var ts; var lineStart = ts.getLineStartPositionForPosition(current_1, sourceFile); return SmartIndenter.findFirstNonWhitespaceColumn(lineStart, current_1, sourceFile, options); } - if (precedingToken.kind === 25 && precedingToken.parent.kind !== 192) { + if (precedingToken.kind === 25 && precedingToken.parent.kind !== 193) { var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1) { return actualIndentation; @@ -62136,8 +68603,9 @@ var ts; while (current) { if (ts.positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current, previous)) { currentStart = getStartLineAndCharacterForNode(current, sourceFile); - if (nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile)) { - indentationDelta = 0; + var nextTokenKind = nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile); + if (nextTokenKind !== 0) { + indentationDelta = assumeNewLineBeforeCloseBrace && nextTokenKind === 2 ? options.indentSize : 0; } else { indentationDelta = lineAtPosition !== currentStart.line ? options.indentSize : 0; @@ -62225,31 +68693,37 @@ var ts; } function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) && - (parent.kind === 261 || !parentAndChildShareLine); + (parent.kind === 264 || !parentAndChildShareLine); if (!useActualIndentation) { return -1; } return findColumnForFirstNonWhitespaceCharacterInLine(currentLineAndChar, sourceFile, options); } + var NextTokenKind; + (function (NextTokenKind) { + NextTokenKind[NextTokenKind["Unknown"] = 0] = "Unknown"; + NextTokenKind[NextTokenKind["OpenBrace"] = 1] = "OpenBrace"; + NextTokenKind[NextTokenKind["CloseBrace"] = 2] = "CloseBrace"; + })(NextTokenKind || (NextTokenKind = {})); function nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile) { var nextToken = ts.findNextToken(precedingToken, current); if (!nextToken) { - return false; + return 0; } if (nextToken.kind === 16) { - return true; + return 1; } else if (nextToken.kind === 17) { var nextTokenStartLine = getStartLineAndCharacterForNode(nextToken, sourceFile).line; - return lineAtPosition === nextTokenStartLine; + return lineAtPosition === nextTokenStartLine ? 2 : 0; } - return false; + return 0; } function getStartLineAndCharacterForNode(n, sourceFile) { return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); } function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 208 && parent.elseStatement === child) { + if (parent.kind === 210 && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 81, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -62258,53 +68732,49 @@ var ts; return false; } SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement = childStartsOnTheSameLineWithElseInIfStatement; + function getListIfStartEndIsInListRange(list, start, end) { + return list && ts.rangeContainsStartEnd(list, start, end) ? list : undefined; + } function getContainingList(node, sourceFile) { if (node.parent) { switch (node.parent.kind) { - case 157: - if (node.parent.typeArguments && - ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { - return node.parent.typeArguments; - } - break; - case 176: + case 158: + return getListIfStartEndIsInListRange(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd()); + case 177: return node.parent.properties; - case 175: + case 176: return node.parent.elements; - case 225: - case 184: + case 227: case 185: + case 186: + case 150: case 149: - case 148: - case 153: - case 154: { + case 154: + case 151: + case 160: + case 155: { var start = node.getStart(sourceFile); - if (node.parent.typeParameters && - ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { - return node.parent.typeParameters; - } - if (ts.rangeContainsStartEnd(node.parent.parameters, start, node.getEnd())) { - return node.parent.parameters; - } - break; + return getListIfStartEndIsInListRange(node.parent.typeParameters, start, node.getEnd()) || + getListIfStartEndIsInListRange(node.parent.parameters, start, node.getEnd()); } - case 180: - case 179: { + case 228: + return getListIfStartEndIsInListRange(node.parent.typeParameters, node.getStart(sourceFile), node.getEnd()); + case 181: + case 180: { var start = node.getStart(sourceFile); - if (node.parent.typeArguments && - ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { - return node.parent.typeArguments; - } - if (node.parent.arguments && - ts.rangeContainsStartEnd(node.parent.arguments, start, node.getEnd())) { - return node.parent.arguments; - } - break; + return getListIfStartEndIsInListRange(node.parent.typeArguments, start, node.getEnd()) || + getListIfStartEndIsInListRange(node.parent.arguments, start, node.getEnd()); } + case 226: + return getListIfStartEndIsInListRange(node.parent.declarations, node.getStart(sourceFile), node.getEnd()); + case 240: + case 244: + return getListIfStartEndIsInListRange(node.parent.elements, node.getStart(sourceFile), node.getEnd()); } } return undefined; } + SmartIndenter.getContainingList = getContainingList; function getActualIndentationForListItem(node, sourceFile, options) { var containingList = getContainingList(node, sourceFile); return containingList ? getActualIndentationFromList(containingList) : -1; @@ -62317,8 +68787,8 @@ var ts; if (node.kind === 19) { return -1; } - if (node.parent && (node.parent.kind === 179 || - node.parent.kind === 180) && + if (node.parent && (node.parent.kind === 180 || + node.parent.kind === 181) && node.parent.expression !== node) { var fullCallOrNewExpression = node.parent.expression; var startingExpression = getStartingExpression(fullCallOrNewExpression); @@ -62336,10 +68806,10 @@ var ts; function getStartingExpression(node) { while (true) { switch (node.kind) { - case 179: case 180: - case 177: + case 181: case 178: + case 179: node = node.expression; break; default: @@ -62393,48 +68863,49 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 207: - case 226: - case 197: - case 227: - case 229: + case 209: case 228: - case 175: - case 204: + case 198: + case 229: case 231: + case 230: case 176: - case 161: - case 163: - case 232: - case 254: - case 253: - case 183: + case 206: + case 233: case 177: - case 179: + case 162: + case 171: + case 164: + case 234: + case 257: + case 256: + case 184: + case 178: case 180: - case 205: - case 223: - case 240: - case 216: - case 193: - case 173: - case 172: - case 248: - case 247: - case 252: - case 148: - case 153: - case 154: - case 144: - case 158: - case 159: - case 166: case 181: - case 189: + case 207: + case 225: case 242: - case 238: - case 243: - case 239: + case 218: + case 194: + case 174: + case 173: + case 250: + case 249: + case 255: + case 149: + case 154: + case 155: + case 145: + case 159: + case 160: + case 167: + case 182: + case 190: + case 244: + case 240: + case 245: + case 241: return true; } return false; @@ -62442,27 +68913,27 @@ var ts; function nodeWillIndentChild(parent, child, indentByDefault) { var childKind = child ? child.kind : 0; switch (parent.kind) { - case 209: - case 210: - case 212: - case 213: case 211: - case 208: - case 225: - case 184: - case 149: + case 212: + case 214: + case 215: + case 213: + case 210: + case 227: case 185: case 150: + case 186: case 151: case 152: - return childKind !== 204; - case 241: - return childKind !== 242; - case 235: - return childKind !== 236 || - (child.namedBindings && child.namedBindings.kind !== 238); - case 246: - return childKind !== 249; + case 153: + return childKind !== 206; + case 243: + return childKind !== 244; + case 237: + return childKind !== 238 || + (child.namedBindings && child.namedBindings.kind !== 240); + case 248: + return childKind !== 251; } return indentByDefault; } @@ -62475,10 +68946,503 @@ var ts; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); var ts; +(function (ts) { + var textChanges; + (function (textChanges) { + function getPos(n) { + return n["__pos"]; + } + function setPos(n, pos) { + n["__pos"] = pos; + } + function getEnd(n) { + return n["__end"]; + } + function setEnd(n, end) { + n["__end"] = end; + } + var Position; + (function (Position) { + Position[Position["FullStart"] = 0] = "FullStart"; + Position[Position["Start"] = 1] = "Start"; + })(Position = textChanges.Position || (textChanges.Position = {})); + function skipWhitespacesAndLineBreaks(text, start) { + return ts.skipTrivia(text, start, false, true); + } + function hasCommentsBeforeLineBreak(text, start) { + var i = start; + while (i < text.length) { + var ch = text.charCodeAt(i); + if (ts.isWhiteSpaceSingleLine(ch)) { + i++; + continue; + } + return ch === 47; + } + return false; + } + function getSeparatorCharacter(separator) { + return ts.tokenToString(separator.kind); + } + textChanges.getSeparatorCharacter = getSeparatorCharacter; + function getAdjustedStartPosition(sourceFile, node, options, position) { + if (options.useNonAdjustedStartPosition) { + return node.getFullStart(); + } + var fullStart = node.getFullStart(); + var start = node.getStart(sourceFile); + if (fullStart === start) { + return start; + } + var fullStartLine = ts.getLineStartPositionForPosition(fullStart, sourceFile); + var startLine = ts.getLineStartPositionForPosition(start, sourceFile); + if (startLine === fullStartLine) { + return position === Position.Start ? start : fullStart; + } + var adjustedStartPosition = ts.getStartPositionOfLine(ts.getLineOfLocalPosition(sourceFile, fullStartLine) + 1, sourceFile); + adjustedStartPosition = skipWhitespacesAndLineBreaks(sourceFile.text, adjustedStartPosition); + return ts.getStartPositionOfLine(ts.getLineOfLocalPosition(sourceFile, adjustedStartPosition), sourceFile); + } + textChanges.getAdjustedStartPosition = getAdjustedStartPosition; + function getAdjustedEndPosition(sourceFile, node, options) { + if (options.useNonAdjustedEndPosition) { + return node.getEnd(); + } + var end = node.getEnd(); + var newEnd = ts.skipTrivia(sourceFile.text, end, true); + return newEnd !== end && ts.isLineBreak(sourceFile.text.charCodeAt(newEnd - 1)) + ? newEnd + : end; + } + textChanges.getAdjustedEndPosition = getAdjustedEndPosition; + function isSeparator(node, candidate) { + return candidate && node.parent && (candidate.kind === 25 || (candidate.kind === 24 && node.parent.kind === 177)); + } + function spaces(count) { + var s = ""; + for (var i = 0; i < count; i++) { + s += " "; + } + return s; + } + var ChangeTracker = (function () { + function ChangeTracker(newLine, rulesProvider, validator) { + this.newLine = newLine; + this.rulesProvider = rulesProvider; + this.validator = validator; + this.changes = []; + this.newLineCharacter = ts.getNewLineCharacter({ newLine: newLine }); + } + ChangeTracker.fromCodeFixContext = function (context) { + return new ChangeTracker(context.newLineCharacter === "\n" ? 1 : 0, context.rulesProvider); + }; + ChangeTracker.prototype.deleteNode = function (sourceFile, node, options) { + if (options === void 0) { options = {}; } + var startPosition = getAdjustedStartPosition(sourceFile, node, options, Position.FullStart); + var endPosition = getAdjustedEndPosition(sourceFile, node, options); + this.changes.push({ sourceFile: sourceFile, options: options, range: { pos: startPosition, end: endPosition } }); + return this; + }; + ChangeTracker.prototype.deleteRange = function (sourceFile, range) { + this.changes.push({ sourceFile: sourceFile, range: range }); + return this; + }; + ChangeTracker.prototype.deleteNodeRange = function (sourceFile, startNode, endNode, options) { + if (options === void 0) { options = {}; } + var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.FullStart); + var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); + this.changes.push({ sourceFile: sourceFile, options: options, range: { pos: startPosition, end: endPosition } }); + return this; + }; + ChangeTracker.prototype.deleteNodeInList = function (sourceFile, node) { + var containingList = ts.formatting.SmartIndenter.getContainingList(node, sourceFile); + if (!containingList) { + ts.Debug.fail("node is not a list element"); + return this; + } + var index = containingList.indexOf(node); + if (index < 0) { + return this; + } + if (containingList.length === 1) { + this.deleteNode(sourceFile, node); + return this; + } + if (index !== containingList.length - 1) { + var nextToken = ts.getTokenAtPosition(sourceFile, node.end); + if (nextToken && isSeparator(node, nextToken)) { + var startPosition = ts.skipTrivia(sourceFile.text, getAdjustedStartPosition(sourceFile, node, {}, Position.FullStart), false, true); + var nextElement = containingList[index + 1]; + var endPosition = ts.skipTrivia(sourceFile.text, getAdjustedStartPosition(sourceFile, nextElement, {}, Position.FullStart), false, true); + this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); + } + } + else { + var previousToken = ts.getTokenAtPosition(sourceFile, containingList[index - 1].end); + if (previousToken && isSeparator(node, previousToken)) { + this.deleteNodeRange(sourceFile, previousToken, node); + } + } + return this; + }; + ChangeTracker.prototype.replaceRange = function (sourceFile, range, newNode, options) { + if (options === void 0) { options = {}; } + this.changes.push({ sourceFile: sourceFile, range: range, options: options, node: newNode }); + return this; + }; + ChangeTracker.prototype.replaceNode = function (sourceFile, oldNode, newNode, options) { + if (options === void 0) { options = {}; } + var startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); + var endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); + this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: endPosition } }); + return this; + }; + ChangeTracker.prototype.replaceNodeRange = function (sourceFile, startNode, endNode, newNode, options) { + if (options === void 0) { options = {}; } + var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); + var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); + this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: endPosition } }); + return this; + }; + ChangeTracker.prototype.insertNodeAt = function (sourceFile, pos, newNode, options) { + if (options === void 0) { options = {}; } + this.changes.push({ sourceFile: sourceFile, options: options, node: newNode, range: { pos: pos, end: pos } }); + return this; + }; + ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, options) { + if (options === void 0) { options = {}; } + var startPosition = getAdjustedStartPosition(sourceFile, before, options, Position.Start); + this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: startPosition } }); + return this; + }; + ChangeTracker.prototype.insertNodeAfter = function (sourceFile, after, newNode, options) { + if (options === void 0) { options = {}; } + if ((ts.isStatementButNotDeclaration(after)) || + after.kind === 148 || + after.kind === 147 || + after.kind === 149) { + if (sourceFile.text.charCodeAt(after.end - 1) !== 59) { + this.changes.push({ + sourceFile: sourceFile, + options: {}, + range: { pos: after.end, end: after.end }, + node: ts.createToken(24) + }); + } + } + var endPosition = getAdjustedEndPosition(sourceFile, after, options); + this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: endPosition, end: endPosition } }); + return this; + }; + ChangeTracker.prototype.insertNodeInListAfter = function (sourceFile, after, newNode) { + var containingList = ts.formatting.SmartIndenter.getContainingList(after, sourceFile); + if (!containingList) { + ts.Debug.fail("node is not a list element"); + return this; + } + var index = containingList.indexOf(after); + if (index < 0) { + return this; + } + var end = after.getEnd(); + if (index !== containingList.length - 1) { + var nextToken = ts.getTokenAtPosition(sourceFile, after.end); + if (nextToken && isSeparator(after, nextToken)) { + var lineAndCharOfNextElement = ts.getLineAndCharacterOfPosition(sourceFile, skipWhitespacesAndLineBreaks(sourceFile.text, containingList[index + 1].getFullStart())); + var lineAndCharOfNextToken = ts.getLineAndCharacterOfPosition(sourceFile, nextToken.end); + var prefix = void 0; + var startPos = void 0; + if (lineAndCharOfNextToken.line === lineAndCharOfNextElement.line) { + startPos = nextToken.end; + prefix = spaces(lineAndCharOfNextElement.character - lineAndCharOfNextToken.character); + } + else { + startPos = ts.getStartPositionOfLine(lineAndCharOfNextElement.line, sourceFile); + } + this.changes.push({ + sourceFile: sourceFile, + range: { pos: startPos, end: containingList[index + 1].getStart(sourceFile) }, + node: newNode, + useIndentationFromFile: true, + options: { + prefix: prefix, + suffix: "" + ts.tokenToString(nextToken.kind) + sourceFile.text.substring(nextToken.end, containingList[index + 1].getStart(sourceFile)) + } + }); + } + } + else { + var afterStart = after.getStart(sourceFile); + var afterStartLinePosition = ts.getLineStartPositionForPosition(afterStart, sourceFile); + var separator = void 0; + var multilineList = false; + if (containingList.length === 1) { + separator = 25; + } + else { + var tokenBeforeInsertPosition = ts.findPrecedingToken(after.pos, sourceFile); + separator = isSeparator(after, tokenBeforeInsertPosition) ? tokenBeforeInsertPosition.kind : 25; + var afterMinusOneStartLinePosition = ts.getLineStartPositionForPosition(containingList[index - 1].getStart(sourceFile), sourceFile); + multilineList = afterMinusOneStartLinePosition !== afterStartLinePosition; + } + if (hasCommentsBeforeLineBreak(sourceFile.text, after.end)) { + multilineList = true; + } + if (multilineList) { + this.changes.push({ + sourceFile: sourceFile, + range: { pos: end, end: end }, + node: ts.createToken(separator), + options: {} + }); + var indentation = ts.formatting.SmartIndenter.findFirstNonWhitespaceColumn(afterStartLinePosition, afterStart, sourceFile, this.rulesProvider.getFormatOptions()); + var insertPos = ts.skipTrivia(sourceFile.text, end, true, false); + if (insertPos !== end && ts.isLineBreak(sourceFile.text.charCodeAt(insertPos - 1))) { + insertPos--; + } + this.changes.push({ + sourceFile: sourceFile, + range: { pos: insertPos, end: insertPos }, + node: newNode, + options: { indentation: indentation, prefix: this.newLineCharacter } + }); + } + else { + this.changes.push({ + sourceFile: sourceFile, + range: { pos: end, end: end }, + node: newNode, + options: { prefix: ts.tokenToString(separator) + " " } + }); + } + } + return this; + }; + ChangeTracker.prototype.getChanges = function () { + var _this = this; + var changesPerFile = ts.createFileMap(); + for (var _i = 0, _a = this.changes; _i < _a.length; _i++) { + var c = _a[_i]; + var changesInFile = changesPerFile.get(c.sourceFile.path); + if (!changesInFile) { + changesPerFile.set(c.sourceFile.path, changesInFile = []); + } + changesInFile.push(c); + } + var fileChangesList = []; + changesPerFile.forEachValue(function (path) { + var changesInFile = changesPerFile.get(path); + var sourceFile = changesInFile[0].sourceFile; + var fileTextChanges = { fileName: sourceFile.fileName, textChanges: [] }; + for (var _i = 0, _a = ChangeTracker.normalize(changesInFile); _i < _a.length; _i++) { + var c = _a[_i]; + fileTextChanges.textChanges.push({ + span: _this.computeSpan(c, sourceFile), + newText: _this.computeNewText(c, sourceFile) + }); + } + fileChangesList.push(fileTextChanges); + }); + return fileChangesList; + }; + ChangeTracker.prototype.computeSpan = function (change, _sourceFile) { + return ts.createTextSpanFromBounds(change.range.pos, change.range.end); + }; + ChangeTracker.prototype.computeNewText = function (change, sourceFile) { + if (!change.node) { + return ""; + } + var options = change.options || {}; + var nonFormattedText = getNonformattedText(change.node, sourceFile, this.newLine); + if (this.validator) { + this.validator(nonFormattedText); + } + var formatOptions = this.rulesProvider.getFormatOptions(); + var pos = change.range.pos; + var posStartsLine = ts.getLineStartPositionForPosition(pos, sourceFile) === pos; + var initialIndentation = change.options.indentation !== undefined + ? change.options.indentation + : change.useIndentationFromFile + ? ts.formatting.SmartIndenter.getIndentation(change.range.pos, sourceFile, formatOptions, posStartsLine || (change.options.prefix === this.newLineCharacter)) + : 0; + var delta = change.options.delta !== undefined + ? change.options.delta + : ts.formatting.SmartIndenter.shouldIndentChildNode(change.node) + ? formatOptions.indentSize + : 0; + var text = applyFormatting(nonFormattedText, sourceFile, initialIndentation, delta, this.rulesProvider); + text = posStartsLine || change.options.indentation !== undefined ? text : text.replace(/^\s+/, ""); + return (options.prefix || "") + text + (options.suffix || ""); + }; + ChangeTracker.normalize = function (changes) { + var normalized = ts.stableSort(changes, function (a, b) { return a.range.pos - b.range.pos; }); + for (var i = 0; i < normalized.length - 2; i++) { + ts.Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos); + } + return normalized; + }; + return ChangeTracker; + }()); + textChanges.ChangeTracker = ChangeTracker; + function getNonformattedText(node, sourceFile, newLine) { + var options = { newLine: newLine, target: sourceFile.languageVersion }; + var writer = new Writer(ts.getNewLineCharacter(options)); + var printer = ts.createPrinter(options, writer); + printer.writeNode(3, node, sourceFile, writer); + return { text: writer.getText(), node: assignPositionsToNode(node) }; + } + textChanges.getNonformattedText = getNonformattedText; + function applyFormatting(nonFormattedText, sourceFile, initialIndentation, delta, rulesProvider) { + var lineMap = ts.computeLineStarts(nonFormattedText.text); + var file = { + text: nonFormattedText.text, + lineMap: lineMap, + getLineAndCharacterOfPosition: function (pos) { return ts.computeLineAndCharacterOfPosition(lineMap, pos); } + }; + var changes = ts.formatting.formatNode(nonFormattedText.node, file, sourceFile.languageVariant, initialIndentation, delta, rulesProvider); + return applyChanges(nonFormattedText.text, changes); + } + textChanges.applyFormatting = applyFormatting; + function applyChanges(text, changes) { + for (var i = changes.length - 1; i >= 0; i--) { + var change = changes[i]; + text = "" + text.substring(0, change.span.start) + change.newText + text.substring(ts.textSpanEnd(change.span)); + } + return text; + } + textChanges.applyChanges = applyChanges; + function isTrivia(s) { + return ts.skipTrivia(s, 0) === s.length; + } + var nullTransformationContext = { + enableEmitNotification: ts.noop, + enableSubstitution: ts.noop, + endLexicalEnvironment: function () { return undefined; }, + getCompilerOptions: ts.notImplemented, + getEmitHost: ts.notImplemented, + getEmitResolver: ts.notImplemented, + hoistFunctionDeclaration: ts.noop, + hoistVariableDeclaration: ts.noop, + isEmitNotificationEnabled: ts.notImplemented, + isSubstitutionEnabled: ts.notImplemented, + onEmitNode: ts.noop, + onSubstituteNode: ts.notImplemented, + readEmitHelpers: ts.notImplemented, + requestEmitHelper: ts.noop, + resumeLexicalEnvironment: ts.noop, + startLexicalEnvironment: ts.noop, + suspendLexicalEnvironment: ts.noop + }; + function assignPositionsToNode(node) { + var visited = ts.visitEachChild(node, assignPositionsToNode, nullTransformationContext, assignPositionsToNodeArray, assignPositionsToNode); + var newNode = ts.nodeIsSynthesized(visited) + ? visited + : (Proxy.prototype = visited, new Proxy()); + newNode.pos = getPos(node); + newNode.end = getEnd(node); + return newNode; + function Proxy() { } + } + function assignPositionsToNodeArray(nodes, visitor, test, start, count) { + var visited = ts.visitNodes(nodes, visitor, test, start, count); + if (!visited) { + return visited; + } + var nodeArray = visited === nodes ? ts.createNodeArray(visited.slice(0)) : visited; + nodeArray.pos = getPos(nodes); + nodeArray.end = getEnd(nodes); + return nodeArray; + } + var Writer = (function () { + function Writer(newLine) { + var _this = this; + this.lastNonTriviaPosition = 0; + this.writer = ts.createTextWriter(newLine); + this.onEmitNode = function (hint, node, printCallback) { + if (node) { + setPos(node, _this.lastNonTriviaPosition); + } + printCallback(hint, node); + if (node) { + setEnd(node, _this.lastNonTriviaPosition); + } + }; + this.onBeforeEmitNodeArray = function (nodes) { + if (nodes) { + setPos(nodes, _this.lastNonTriviaPosition); + } + }; + this.onAfterEmitNodeArray = function (nodes) { + if (nodes) { + setEnd(nodes, _this.lastNonTriviaPosition); + } + }; + } + Writer.prototype.setLastNonTriviaPosition = function (s, force) { + if (force || !isTrivia(s)) { + this.lastNonTriviaPosition = this.writer.getTextPos(); + var i = 0; + while (ts.isWhiteSpace(s.charCodeAt(s.length - i - 1))) { + i++; + } + this.lastNonTriviaPosition -= i; + } + }; + Writer.prototype.write = function (s) { + this.writer.write(s); + this.setLastNonTriviaPosition(s, false); + }; + Writer.prototype.writeTextOfNode = function (text, node) { + this.writer.writeTextOfNode(text, node); + }; + Writer.prototype.writeLine = function () { + this.writer.writeLine(); + }; + Writer.prototype.increaseIndent = function () { + this.writer.increaseIndent(); + }; + Writer.prototype.decreaseIndent = function () { + this.writer.decreaseIndent(); + }; + Writer.prototype.getText = function () { + return this.writer.getText(); + }; + Writer.prototype.rawWrite = function (s) { + this.writer.rawWrite(s); + this.setLastNonTriviaPosition(s, false); + }; + Writer.prototype.writeLiteral = function (s) { + this.writer.writeLiteral(s); + this.setLastNonTriviaPosition(s, true); + }; + Writer.prototype.getTextPos = function () { + return this.writer.getTextPos(); + }; + Writer.prototype.getLine = function () { + return this.writer.getLine(); + }; + Writer.prototype.getColumn = function () { + return this.writer.getColumn(); + }; + Writer.prototype.getIndent = function () { + return this.writer.getIndent(); + }; + Writer.prototype.isAtStartOfLine = function () { + return this.writer.isAtStartOfLine(); + }; + Writer.prototype.reset = function () { + this.writer.reset(); + this.lastNonTriviaPosition = 0; + }; + return Writer; + }()); + })(textChanges = ts.textChanges || (ts.textChanges = {})); +})(ts || (ts = {})); +var ts; (function (ts) { var codefix; (function (codefix) { - var codeFixes = ts.createMap(); + var codeFixes = []; function registerCodeFix(action) { ts.forEach(action.errorCodes, function (error) { var fixes = codeFixes[error]; @@ -62512,24 +69476,203 @@ var ts; (function (ts) { var codefix; (function (codefix) { - function getOpenBraceEnd(constructor, sourceFile) { - return constructor.body.getFirstToken(sourceFile).getEnd(); - } codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code], - getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start); - if (token.kind !== 122) { - return undefined; - } - var newPosition = getOpenBraceEnd(token.parent, sourceFile); - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_missing_super_call), - changes: [{ fileName: sourceFile.fileName, textChanges: [{ newText: "super();", span: { start: newPosition, length: 0 } }] }] - }]; - } + errorCodes: [ts.Diagnostics.Class_0_incorrectly_implements_interface_1.code], + getCodeActions: getActionForClassLikeIncorrectImplementsInterface }); + function getActionForClassLikeIncorrectImplementsInterface(context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + var token = ts.getTokenAtPosition(sourceFile, start); + var checker = context.program.getTypeChecker(); + var classDeclaration = ts.getContainingClass(token); + if (!classDeclaration) { + return undefined; + } + var openBrace = ts.getOpenBraceOfClassLike(classDeclaration, sourceFile); + var classType = checker.getTypeAtLocation(classDeclaration); + var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(classDeclaration); + var hasNumericIndexSignature = !!checker.getIndexTypeOfType(classType, 1); + var hasStringIndexSignature = !!checker.getIndexTypeOfType(classType, 0); + var result = []; + for (var _i = 0, implementedTypeNodes_2 = implementedTypeNodes; _i < implementedTypeNodes_2.length; _i++) { + var implementedTypeNode = implementedTypeNodes_2[_i]; + var implementedType = checker.getTypeAtLocation(implementedTypeNode); + var implementedTypeSymbols = checker.getPropertiesOfType(implementedType); + var nonPrivateMembers = implementedTypeSymbols.filter(function (symbol) { return !(ts.getModifierFlags(symbol.valueDeclaration) & 8); }); + var newNodes = []; + createAndAddMissingIndexSignatureDeclaration(implementedType, 1, hasNumericIndexSignature, newNodes); + createAndAddMissingIndexSignatureDeclaration(implementedType, 0, hasStringIndexSignature, newNodes); + newNodes = newNodes.concat(codefix.createMissingMemberNodes(classDeclaration, nonPrivateMembers, checker)); + var message = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_interface_0), [implementedTypeNode.getText()]); + if (newNodes.length > 0) { + pushAction(result, newNodes, message); + } + } + return result; + function createAndAddMissingIndexSignatureDeclaration(type, kind, hasIndexSigOfKind, newNodes) { + if (hasIndexSigOfKind) { + return; + } + var indexInfoOfKind = checker.getIndexInfoOfType(type, kind); + if (!indexInfoOfKind) { + return; + } + var newIndexSignatureDeclaration = checker.indexInfoToIndexSignatureDeclaration(indexInfoOfKind, kind, classDeclaration); + newNodes.push(newIndexSignatureDeclaration); + } + function pushAction(result, newNodes, description) { + var newAction = { + description: description, + changes: codefix.newNodesToChanges(newNodes, openBrace, context) + }; + result.push(newAction); + } + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Property_0_does_not_exist_on_type_1.code], + getCodeActions: getActionsForAddMissingMember + }); + function getActionsForAddMissingMember(context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + var token = ts.getTokenAtPosition(sourceFile, start); + if (token.kind !== 70) { + return undefined; + } + if (!ts.isPropertyAccessExpression(token.parent) || token.parent.expression.kind !== 98) { + return undefined; + } + var classMemberDeclaration = ts.getThisContainer(token, false); + if (!ts.isClassElement(classMemberDeclaration)) { + return undefined; + } + var classDeclaration = classMemberDeclaration.parent; + if (!classDeclaration || !ts.isClassLike(classDeclaration)) { + return undefined; + } + var isStatic = ts.hasModifier(classMemberDeclaration, 32); + return ts.isInJavaScriptFile(sourceFile) ? getActionsForAddMissingMemberInJavaScriptFile() : getActionsForAddMissingMemberInTypeScriptFile(); + function getActionsForAddMissingMemberInJavaScriptFile() { + var memberName = token.getText(); + if (isStatic) { + if (classDeclaration.kind === 198) { + return undefined; + } + var className = classDeclaration.name.getText(); + return [{ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Initialize_static_property_0), [memberName]), + changes: [{ + fileName: sourceFile.fileName, + textChanges: [{ + span: { start: classDeclaration.getEnd(), length: 0 }, + newText: "" + context.newLineCharacter + className + "." + memberName + " = undefined;" + context.newLineCharacter + }] + }] + }]; + } + else { + var classConstructor = ts.getFirstConstructorWithBody(classDeclaration); + if (!classConstructor) { + return undefined; + } + return [{ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Initialize_property_0_in_the_constructor), [memberName]), + changes: [{ + fileName: sourceFile.fileName, + textChanges: [{ + span: { start: classConstructor.body.getEnd() - 1, length: 0 }, + newText: "this." + memberName + " = undefined;" + context.newLineCharacter + }] + }] + }]; + } + } + function getActionsForAddMissingMemberInTypeScriptFile() { + var typeNode; + if (token.parent.parent.kind === 193) { + var binaryExpression = token.parent.parent; + var checker = context.program.getTypeChecker(); + var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(binaryExpression.right))); + typeNode = checker.typeToTypeNode(widenedType, classDeclaration); + } + typeNode = typeNode || ts.createKeywordTypeNode(118); + var openBrace = ts.getOpenBraceOfClassLike(classDeclaration, sourceFile); + var property = ts.createProperty(undefined, isStatic ? [ts.createToken(114)] : undefined, token.getText(sourceFile), undefined, typeNode, undefined); + var propertyChangeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + propertyChangeTracker.insertNodeAfter(sourceFile, openBrace, property, { suffix: context.newLineCharacter }); + var actions = [{ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_declaration_for_missing_property_0), [token.getText()]), + changes: propertyChangeTracker.getChanges() + }]; + if (!isStatic) { + var stringTypeNode = ts.createKeywordTypeNode(135); + var indexingParameter = ts.createParameter(undefined, undefined, undefined, "x", undefined, stringTypeNode, undefined); + var indexSignature = ts.createIndexSignatureDeclaration(undefined, undefined, [indexingParameter], typeNode); + var indexSignatureChangeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + indexSignatureChangeTracker.insertNodeAfter(sourceFile, openBrace, indexSignature, { suffix: context.newLineCharacter }); + actions.push({ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_index_signature_for_missing_property_0), [token.getText()]), + changes: indexSignatureChangeTracker.getChanges() + }); + } + return actions; + } + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code], + getCodeActions: getActionForClassLikeMissingAbstractMember + }); + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code], + getCodeActions: getActionForClassLikeMissingAbstractMember + }); + function getActionForClassLikeMissingAbstractMember(context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + var token = ts.getTokenAtPosition(sourceFile, start); + var checker = context.program.getTypeChecker(); + if (ts.isClassLike(token.parent)) { + var classDeclaration = token.parent; + var extendsNode = ts.getClassExtendsHeritageClauseElement(classDeclaration); + var instantiatedExtendsType = checker.getTypeAtLocation(extendsNode); + var extendsSymbols = checker.getPropertiesOfType(instantiatedExtendsType); + var abstractAndNonPrivateExtendsSymbols = extendsSymbols.filter(symbolPointsToNonPrivateAndAbstractMember); + var newNodes = codefix.createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, checker); + var changes = codefix.newNodesToChanges(newNodes, ts.getOpenBraceOfClassLike(classDeclaration, sourceFile), context); + if (changes && changes.length > 0) { + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_inherited_abstract_class), + changes: changes + }]; + } + } + return undefined; + } + function symbolPointsToNonPrivateAndAbstractMember(symbol) { + var decls = symbol.getDeclarations(); + ts.Debug.assert(!!(decls && decls.length > 0)); + var flags = ts.getModifierFlags(decls[0]); + return !(flags & 8) && !!(flags & 128); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var codefix; + (function (codefix) { codefix.registerCodeFix({ errorCodes: [ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code], getCodeActions: function (context) { @@ -62543,7 +69686,7 @@ var ts; if (!superCall) { return undefined; } - if (superCall.expression && superCall.expression.kind == 179) { + if (superCall.expression && superCall.expression.kind === 180) { var arguments_1 = superCall.expression.arguments; for (var i = 0; i < arguments_1.length; i++) { if (arguments_1[i].expression === token) { @@ -62551,23 +69694,15 @@ var ts; } } } - var newPosition = getOpenBraceEnd(constructor, sourceFile); - var changes = [{ - fileName: sourceFile.fileName, textChanges: [{ - newText: superCall.getText(sourceFile), - span: { start: newPosition, length: 0 } - }, - { - newText: "", - span: { start: superCall.getStart(sourceFile), length: superCall.getWidth(sourceFile) } - }] - }]; + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + changeTracker.insertNodeAfter(sourceFile, ts.getOpenBrace(constructor, sourceFile), superCall, { suffix: context.newLineCharacter }); + changeTracker.deleteNode(sourceFile, superCall); return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Make_super_call_the_first_statement_in_the_constructor), - changes: changes + changes: changeTracker.getChanges() }]; function findSuperCall(n) { - if (n.kind === 207 && ts.isSuperCall(n.expression)) { + if (n.kind === 209 && ts.isSuperCall(n.expression)) { return n; } if (ts.isFunctionLike(n)) { @@ -62580,6 +69715,248 @@ var ts; })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code], + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var token = ts.getTokenAtPosition(sourceFile, context.span.start); + if (token.kind !== 122) { + return undefined; + } + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + var superCall = ts.createStatement(ts.createCall(ts.createSuper(), undefined, ts.emptyArray)); + changeTracker.insertNodeAfter(sourceFile, ts.getOpenBrace(token.parent, sourceFile), superCall, { suffix: context.newLineCharacter }); + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_missing_super_call), + changes: changeTracker.getChanges() + }]; + } + }); + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code], + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + var token = ts.getTokenAtPosition(sourceFile, start); + var classDeclNode = ts.getContainingClass(token); + if (!(token.kind === 70 && ts.isClassLike(classDeclNode))) { + return undefined; + } + var heritageClauses = classDeclNode.heritageClauses; + if (!(heritageClauses && heritageClauses.length > 0)) { + return undefined; + } + var extendsToken = heritageClauses[0].getFirstToken(); + if (!(extendsToken && extendsToken.kind === 84)) { + return undefined; + } + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + changeTracker.replaceNode(sourceFile, extendsToken, ts.createToken(107)); + for (var i = 1; i < heritageClauses.length; i++) { + var keywordToken = heritageClauses[i].getFirstToken(); + if (keywordToken) { + changeTracker.replaceNode(sourceFile, keywordToken, ts.createToken(25)); + } + } + var result = [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Change_extends_to_implements), + changes: changeTracker.getChanges() + }]; + return result; + } + }); + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code], + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var token = ts.getTokenAtPosition(sourceFile, context.span.start); + if (token.kind !== 70) { + return undefined; + } + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + changeTracker.replaceNode(sourceFile, token, ts.createPropertyAccess(ts.createThis(), token)); + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_this_to_unresolved_variable), + changes: changeTracker.getChanges() + }]; + } + }); + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ + ts.Diagnostics._0_is_declared_but_never_used.code, + ts.Diagnostics.Property_0_is_declared_but_never_used.code + ], + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + var token = ts.getTokenAtPosition(sourceFile, start); + if (token.kind === 20) { + token = ts.getTokenAtPosition(sourceFile, start + 1); + } + switch (token.kind) { + case 70: + switch (token.parent.kind) { + case 225: + switch (token.parent.parent.parent.kind) { + case 213: + var forStatement = token.parent.parent.parent; + var forInitializer = forStatement.initializer; + if (forInitializer.declarations.length === 1) { + return deleteNode(forInitializer); + } + else { + return deleteNodeInList(token.parent); + } + case 215: + var forOfStatement = token.parent.parent.parent; + if (forOfStatement.initializer.kind === 226) { + var forOfInitializer = forOfStatement.initializer; + return replaceNode(forOfInitializer.declarations[0], ts.createObjectLiteral()); + } + break; + case 214: + return undefined; + case 259: + var catchClause = token.parent.parent; + var parameter = catchClause.variableDeclaration.getChildren()[0]; + return deleteNode(parameter); + default: + var variableStatement = token.parent.parent.parent; + if (variableStatement.declarationList.declarations.length === 1) { + return deleteNode(variableStatement); + } + else { + return deleteNodeInList(token.parent); + } + } + case 144: + var typeParameters = token.parent.parent.typeParameters; + if (typeParameters.length === 1) { + var previousToken = ts.getTokenAtPosition(sourceFile, typeParameters.pos - 1); + if (!previousToken || previousToken.kind !== 26) { + return deleteRange(typeParameters); + } + var nextToken = ts.getTokenAtPosition(sourceFile, typeParameters.end); + if (!nextToken || nextToken.kind !== 28) { + return deleteRange(typeParameters); + } + return deleteNodeRange(previousToken, nextToken); + } + else { + return deleteNodeInList(token.parent); + } + case 145: + var functionDeclaration = token.parent.parent; + if (functionDeclaration.parameters.length === 1) { + return deleteNode(token.parent); + } + else { + return deleteNodeInList(token.parent); + } + case 236: + var importEquals = ts.getAncestor(token, 236); + return deleteNode(importEquals); + case 241: + var namedImports = token.parent.parent; + if (namedImports.elements.length === 1) { + var importSpec = ts.getAncestor(token, 237); + return deleteNode(importSpec); + } + else { + return deleteNodeInList(token.parent); + } + case 238: + var importClause = token.parent; + if (!importClause.namedBindings) { + var importDecl = ts.getAncestor(importClause, 237); + return deleteNode(importDecl); + } + else { + var start_4 = importClause.name.getStart(sourceFile); + var nextToken = ts.getTokenAtPosition(sourceFile, importClause.name.end); + if (nextToken && nextToken.kind === 25) { + return deleteRange({ pos: start_4, end: ts.skipTrivia(sourceFile.text, nextToken.end, false, true) }); + } + else { + return deleteNode(importClause.name); + } + } + case 239: + var namespaceImport = token.parent; + if (namespaceImport.name === token && !namespaceImport.parent.name) { + var importDecl = ts.getAncestor(namespaceImport, 237); + return deleteNode(importDecl); + } + else { + var previousToken = ts.getTokenAtPosition(sourceFile, namespaceImport.pos - 1); + if (previousToken && previousToken.kind === 25) { + var startPosition = ts.textChanges.getAdjustedStartPosition(sourceFile, previousToken, {}, ts.textChanges.Position.FullStart); + return deleteRange({ pos: startPosition, end: namespaceImport.end }); + } + return deleteRange(namespaceImport); + } + } + break; + case 148: + case 239: + return deleteNode(token.parent); + } + if (ts.isDeclarationName(token)) { + return deleteNode(token.parent); + } + else if (ts.isLiteralComputedPropertyDeclarationName(token)) { + return deleteNode(token.parent.parent); + } + else { + return undefined; + } + function deleteNode(n) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).deleteNode(sourceFile, n)); + } + function deleteRange(range) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).deleteRange(sourceFile, range)); + } + function deleteNodeInList(n) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).deleteNodeInList(sourceFile, n)); + } + function deleteNodeRange(start, end) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).deleteNodeRange(sourceFile, start, end)); + } + function replaceNode(n, newNode) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).replaceNode(sourceFile, n, newNode)); + } + function makeChange(changeTracker) { + return [{ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Remove_declaration_for_Colon_0), { 0: token.getText() }), + changes: changeTracker.getChanges() + }]; + } + } + }); + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +var ts; (function (ts) { var codefix; (function (codefix) { @@ -62591,18 +69968,19 @@ var ts; })(ModuleSpecifierComparison || (ModuleSpecifierComparison = {})); var ImportCodeActionMap = (function () { function ImportCodeActionMap() { - this.symbolIdToActionMap = ts.createMap(); + this.symbolIdToActionMap = []; } ImportCodeActionMap.prototype.addAction = function (symbolId, newAction) { if (!newAction) { return; } - if (!this.symbolIdToActionMap[symbolId]) { + var actions = this.symbolIdToActionMap[symbolId]; + if (!actions) { this.symbolIdToActionMap[symbolId] = [newAction]; return; } if (newAction.kind === "CodeChange") { - this.symbolIdToActionMap[symbolId].push(newAction); + actions.push(newAction); return; } var updatedNewImports = []; @@ -62635,8 +70013,8 @@ var ts; }; ImportCodeActionMap.prototype.getAllActions = function () { var result = []; - for (var symbolId in this.symbolIdToActionMap) { - result = ts.concatenate(result, this.symbolIdToActionMap[symbolId]); + for (var key in this.symbolIdToActionMap) { + result = ts.concatenate(result, this.symbolIdToActionMap[key]); } return result; }; @@ -62665,7 +70043,11 @@ var ts; return ImportCodeActionMap; }()); codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Cannot_find_name_0.code], + errorCodes: [ + ts.Diagnostics.Cannot_find_name_0.code, + ts.Diagnostics.Cannot_find_namespace_0.code, + ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code + ], getCodeActions: function (context) { var sourceFile = context.sourceFile; var checker = context.program.getTypeChecker(); @@ -62674,18 +70056,22 @@ var ts; var token = ts.getTokenAtPosition(sourceFile, context.span.start); var name = token.getText(); var symbolIdActionMap = new ImportCodeActionMap(); - var cachedImportDeclarations = ts.createMap(); - var cachedNewImportInsertPosition; - var allPotentialModules = checker.getAmbientModules(); + var cachedImportDeclarations = []; + var lastImportDeclaration; + var currentTokenMeaning = ts.getMeaningFromLocation(token); + if (context.errorCode === ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code) { + var symbol = checker.getAliasedSymbol(checker.getSymbolAtLocation(token)); + return getCodeActionForImport(symbol, false, true); + } + var candidateModules = checker.getAmbientModules(); for (var _i = 0, allSourceFiles_1 = allSourceFiles; _i < allSourceFiles_1.length; _i++) { var otherSourceFile = allSourceFiles_1[_i]; if (otherSourceFile !== sourceFile && ts.isExternalOrCommonJsModule(otherSourceFile)) { - allPotentialModules.push(otherSourceFile.symbol); + candidateModules.push(otherSourceFile.symbol); } } - var currentTokenMeaning = ts.getMeaningFromLocation(token); - for (var _a = 0, allPotentialModules_1 = allPotentialModules; _a < allPotentialModules_1.length; _a++) { - var moduleSymbol = allPotentialModules_1[_a]; + for (var _a = 0, candidateModules_1 = candidateModules; _a < candidateModules_1.length; _a++) { + var moduleSymbol = candidateModules_1[_a]; context.cancellationToken.throwIfCancellationRequested(); var defaultExport = checker.tryGetMemberInModuleExports("default", moduleSymbol); if (defaultExport) { @@ -62704,8 +70090,9 @@ var ts; return symbolIdActionMap.getAllActions(); function getImportDeclarations(moduleSymbol) { var moduleSymbolId = getUniqueSymbolId(moduleSymbol); - if (cachedImportDeclarations[moduleSymbolId]) { - return cachedImportDeclarations[moduleSymbolId]; + var cached = cachedImportDeclarations[moduleSymbolId]; + if (cached) { + return cached; } var existingDeclarations = []; for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { @@ -62720,10 +70107,10 @@ var ts; function getImportDeclaration(moduleSpecifier) { var node = moduleSpecifier; while (node) { - if (node.kind === 235) { + if (node.kind === 237) { return node; } - if (node.kind === 234) { + if (node.kind === 236) { return node; } node = node.parent; @@ -62741,7 +70128,7 @@ var ts; var declarations = symbol.getDeclarations(); return declarations ? ts.some(symbol.declarations, function (decl) { return !!(ts.getMeaningFromDeclaration(decl) & meaning); }) : false; } - function getCodeActionForImport(moduleSymbol, isDefault) { + function getCodeActionForImport(moduleSymbol, isDefault, isNamespaceImport) { var existingDeclarations = getImportDeclarations(moduleSymbol); if (existingDeclarations.length > 0) { return getCodeActionsForExistingImport(existingDeclarations); @@ -62754,11 +70141,11 @@ var ts; var namespaceImportDeclaration; var namedImportDeclaration; var existingModuleSpecifier; - for (var _i = 0, declarations_11 = declarations; _i < declarations_11.length; _i++) { - var declaration = declarations_11[_i]; - if (declaration.kind === 235) { + for (var _i = 0, declarations_14 = declarations; _i < declarations_14.length; _i++) { + var declaration = declarations_14[_i]; + if (declaration.kind === 237) { var namedBindings = declaration.importClause && declaration.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 237) { + if (namedBindings && namedBindings.kind === 239) { namespaceImportDeclaration = declaration; } else { @@ -62774,94 +70161,82 @@ var ts; if (namespaceImportDeclaration) { actions.push(getCodeActionForNamespaceImport(namespaceImportDeclaration)); } - if (namedImportDeclaration && namedImportDeclaration.importClause && + if (!isNamespaceImport && namedImportDeclaration && namedImportDeclaration.importClause && (namedImportDeclaration.importClause.name || namedImportDeclaration.importClause.namedBindings)) { - var textChange = getTextChangeForImportClause(namedImportDeclaration.importClause); + var fileTextChanges = getTextChangeForImportClause(namedImportDeclaration.importClause); var moduleSpecifierWithoutQuotes = ts.stripQuotes(namedImportDeclaration.moduleSpecifier.getText()); - actions.push(createCodeAction(ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, [name, moduleSpecifierWithoutQuotes], textChange.newText, textChange.span, sourceFile.fileName, "InsertingIntoExistingImport", moduleSpecifierWithoutQuotes)); + actions.push(createCodeAction(ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, [name, moduleSpecifierWithoutQuotes], fileTextChanges, "InsertingIntoExistingImport", moduleSpecifierWithoutQuotes)); } else { actions.push(getCodeActionForNewImport(existingModuleSpecifier)); } return actions; function getModuleSpecifierFromImportEqualsDeclaration(declaration) { - if (declaration.moduleReference && declaration.moduleReference.kind === 245) { + if (declaration.moduleReference && declaration.moduleReference.kind === 247) { return declaration.moduleReference.expression.getText(); } return declaration.moduleReference.getText(); } function getTextChangeForImportClause(importClause) { - var newImportText = isDefault ? "default as " + name : name; var importList = importClause.namedBindings; - if (!importList && importClause.name) { - var start = importClause.name.getEnd(); - return { - newText: ", { " + newImportText + " }", - span: { start: start, length: 0 } - }; + var newImportSpecifier = ts.createImportSpecifier(undefined, ts.createIdentifier(name)); + if (!importList || importList.elements.length === 0) { + var newImportClause = ts.createImportClause(importClause.name, ts.createNamedImports([newImportSpecifier])); + return createChangeTracker().replaceNode(sourceFile, importClause, newImportClause).getChanges(); } - if (importList.elements.length === 0) { - var start = importList.getStart(); - return { - newText: "{ " + newImportText + " }", - span: { start: start, length: importList.getEnd() - start } - }; - } - var insertPoint = importList.elements[importList.elements.length - 1].getEnd(); - var startLine = ts.getLineOfLocalPosition(sourceFile, importList.getStart()); - var endLine = ts.getLineOfLocalPosition(sourceFile, importList.getEnd()); - var oneImportPerLine = endLine - startLine > importList.elements.length; - return { - newText: "," + (oneImportPerLine ? context.newLineCharacter : " ") + newImportText, - span: { start: insertPoint, length: 0 } - }; + return createChangeTracker().insertNodeInListAfter(sourceFile, importList.elements[importList.elements.length - 1], newImportSpecifier).getChanges(); } function getCodeActionForNamespaceImport(declaration) { var namespacePrefix; - if (declaration.kind === 235) { + if (declaration.kind === 237) { namespacePrefix = declaration.importClause.namedBindings.name.getText(); } else { namespacePrefix = declaration.name.getText(); } namespacePrefix = ts.stripQuotes(namespacePrefix); - return createCodeAction(ts.Diagnostics.Change_0_to_1, [name, namespacePrefix + "." + name], namespacePrefix + ".", { start: token.getStart(), length: 0 }, sourceFile.fileName, "CodeChange"); + return createCodeAction(ts.Diagnostics.Change_0_to_1, [name, namespacePrefix + "." + name], createChangeTracker().replaceNode(sourceFile, token, ts.createPropertyAccess(ts.createIdentifier(namespacePrefix), name)).getChanges(), "CodeChange"); } } function getCodeActionForNewImport(moduleSpecifier) { - if (!cachedNewImportInsertPosition) { - var lastModuleSpecifierEnd = -1; - for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { - var moduleSpecifier_1 = _a[_i]; - var end = moduleSpecifier_1.getEnd(); - if (!lastModuleSpecifierEnd || end > lastModuleSpecifierEnd) { - lastModuleSpecifierEnd = end; + if (!lastImportDeclaration) { + for (var i = sourceFile.statements.length - 1; i >= 0; i--) { + var statement = sourceFile.statements[i]; + if (statement.kind === 236 || statement.kind === 237) { + lastImportDeclaration = statement; + break; } } - cachedNewImportInsertPosition = lastModuleSpecifierEnd > 0 ? sourceFile.getLineEndOfPosition(lastModuleSpecifierEnd) : sourceFile.getStart(); } var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); var moduleSpecifierWithoutQuotes = ts.stripQuotes(moduleSpecifier || getModuleSpecifierForNewImport()); - var importStatementText = isDefault - ? "import " + name + " from \"" + moduleSpecifierWithoutQuotes + "\"" - : "import { " + name + " } from \"" + moduleSpecifierWithoutQuotes + "\""; - var newText = cachedNewImportInsertPosition === sourceFile.getStart() - ? importStatementText + ";" + context.newLineCharacter + context.newLineCharacter - : "" + context.newLineCharacter + importStatementText + ";"; - return createCodeAction(ts.Diagnostics.Import_0_from_1, [name, "\"" + moduleSpecifierWithoutQuotes + "\""], newText, { start: cachedNewImportInsertPosition, length: 0 }, sourceFile.fileName, "NewImport", moduleSpecifierWithoutQuotes); + var changeTracker = createChangeTracker(); + var importClause = isDefault + ? ts.createImportClause(ts.createIdentifier(name), undefined) + : isNamespaceImport + ? ts.createImportClause(undefined, ts.createNamespaceImport(ts.createIdentifier(name))) + : ts.createImportClause(undefined, ts.createNamedImports([ts.createImportSpecifier(undefined, ts.createIdentifier(name))])); + var importDecl = ts.createImportDeclaration(undefined, undefined, importClause, ts.createLiteral(moduleSpecifierWithoutQuotes)); + if (!lastImportDeclaration) { + changeTracker.insertNodeAt(sourceFile, sourceFile.getStart(), importDecl, { suffix: "" + context.newLineCharacter + context.newLineCharacter }); + } + else { + changeTracker.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl, { suffix: context.newLineCharacter }); + } + return createCodeAction(ts.Diagnostics.Import_0_from_1, [name, "\"" + moduleSpecifierWithoutQuotes + "\""], changeTracker.getChanges(), "NewImport", moduleSpecifierWithoutQuotes); function getModuleSpecifierForNewImport() { - var fileName = sourceFile.path; - var moduleFileName = moduleSymbol.valueDeclaration.getSourceFile().path; + var fileName = sourceFile.fileName; + var moduleFileName = moduleSymbol.valueDeclaration.getSourceFile().fileName; var sourceDirectory = ts.getDirectoryPath(fileName); var options = context.program.getCompilerOptions(); return tryGetModuleNameFromAmbientModule() || - tryGetModuleNameFromBaseUrl() || - tryGetModuleNameFromRootDirs() || tryGetModuleNameFromTypeRoots() || tryGetModuleNameAsNodeModule() || + tryGetModuleNameFromBaseUrl() || + tryGetModuleNameFromRootDirs() || ts.removeFileExtension(getRelativePath(moduleFileName, sourceDirectory)); function tryGetModuleNameFromAmbientModule() { - if (moduleSymbol.valueDeclaration.kind !== 261) { + if (moduleSymbol.valueDeclaration.kind !== 264) { return moduleSymbol.name; } } @@ -62869,11 +70244,11 @@ var ts; if (!options.baseUrl) { return undefined; } - var normalizedBaseUrl = ts.toPath(options.baseUrl, ts.getDirectoryPath(options.baseUrl), getCanonicalFileName); - var relativeName = tryRemoveParentDirectoryName(moduleFileName, normalizedBaseUrl); + var relativeName = getRelativePathIfInDirectory(moduleFileName, options.baseUrl); if (!relativeName) { return undefined; } + var relativeNameWithIndex = ts.removeFileExtension(relativeName); relativeName = removeExtensionAndIndexPostFix(relativeName); if (options.paths) { for (var key in options.paths) { @@ -62893,7 +70268,7 @@ var ts; return key.replace("\*", matchedStar); } } - else if (pattern === relativeName) { + else if (pattern === relativeName || pattern === relativeNameWithIndex) { return key; } } @@ -62903,9 +70278,8 @@ var ts; } function tryGetModuleNameFromRootDirs() { if (options.rootDirs) { - var normalizedRootDirs = ts.map(options.rootDirs, function (rootDir) { return ts.toPath(rootDir, undefined, getCanonicalFileName); }); - var normalizedTargetPath = getPathRelativeToRootDirs(moduleFileName, normalizedRootDirs); - var normalizedSourcePath = getPathRelativeToRootDirs(sourceDirectory, normalizedRootDirs); + var normalizedTargetPath = getPathRelativeToRootDirs(moduleFileName, options.rootDirs); + var normalizedSourcePath = getPathRelativeToRootDirs(sourceDirectory, options.rootDirs); if (normalizedTargetPath !== undefined) { var relativePath = normalizedSourcePath !== undefined ? getRelativePath(normalizedTargetPath, normalizedSourcePath) : normalizedTargetPath; return ts.removeFileExtension(relativePath); @@ -62967,7 +70341,7 @@ var ts; function getPathRelativeToRootDirs(path, rootDirs) { for (var _i = 0, rootDirs_2 = rootDirs; _i < rootDirs_2.length; _i++) { var rootDir = rootDirs_2[_i]; - var relativeName = tryRemoveParentDirectoryName(path, rootDir); + var relativeName = getRelativePathIfInDirectory(path, rootDir); if (relativeName !== undefined) { return relativeName; } @@ -62981,25 +70355,23 @@ var ts; } return fileName; } + function getRelativePathIfInDirectory(path, directoryPath) { + var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, false); + return ts.isRootedDiskPath(relativePath) || ts.startsWith(relativePath, "..") ? undefined : relativePath; + } function getRelativePath(path, directoryPath) { var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, false); return ts.moduleHasNonRelativeName(relativePath) ? "./" + relativePath : relativePath; } - function tryRemoveParentDirectoryName(path, parentDirectory) { - var index = path.indexOf(parentDirectory); - if (index === 0) { - return ts.endsWith(parentDirectory, ts.directorySeparator) - ? path.substring(parentDirectory.length) - : path.substring(parentDirectory.length + 1); - } - return undefined; - } } } - function createCodeAction(description, diagnosticArgs, newText, span, fileName, kind, moduleSpecifier) { + function createChangeTracker() { + return ts.textChanges.ChangeTracker.fromCodeFixContext(context); + } + function createCodeAction(description, diagnosticArgs, changes, kind, moduleSpecifier) { return { description: ts.formatMessage.apply(undefined, [undefined, description].concat(diagnosticArgs)), - changes: [{ fileName: fileName, textChanges: [{ newText: newText, span: span }] }], + changes: changes, kind: kind, moduleSpecifier: moduleSpecifier }; @@ -63013,150 +70385,225 @@ var ts; var codefix; (function (codefix) { codefix.registerCodeFix({ - errorCodes: [ - ts.Diagnostics._0_is_declared_but_never_used.code, - ts.Diagnostics.Property_0_is_declared_but_never_used.code - ], - getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var start = context.span.start; - var token = ts.getTokenAtPosition(sourceFile, start); - if (token.kind === 20) { - token = ts.getTokenAtPosition(sourceFile, start + 1); + errorCodes: getApplicableDiagnosticCodes(), + getCodeActions: getDisableJsDiagnosticsCodeActions + }); + function getApplicableDiagnosticCodes() { + var allDiagnostcs = ts.Diagnostics; + return Object.keys(allDiagnostcs) + .filter(function (d) { return allDiagnostcs[d] && allDiagnostcs[d].category === ts.DiagnosticCategory.Error; }) + .map(function (d) { return allDiagnostcs[d].code; }); + } + function getIgnoreCommentLocationForLocation(sourceFile, position, newLineCharacter) { + var line = ts.getLineAndCharacterOfPosition(sourceFile, position).line; + var lineStartPosition = ts.getStartPositionOfLine(line, sourceFile); + var startPosition = ts.getFirstNonSpaceCharacterPosition(sourceFile.text, lineStartPosition); + if (!ts.isInComment(sourceFile, startPosition) && !ts.isInString(sourceFile, startPosition) && !ts.isInTemplateString(sourceFile, startPosition)) { + var token = ts.getTouchingToken(sourceFile, startPosition); + var tokenLeadingCommnets = ts.getLeadingCommentRangesOfNode(token, sourceFile); + if (!tokenLeadingCommnets || !tokenLeadingCommnets.length || tokenLeadingCommnets[0].pos >= startPosition) { + return { + span: { start: startPosition, length: 0 }, + newText: "// @ts-ignore" + newLineCharacter + }; } - switch (token.kind) { - case 70: - switch (token.parent.kind) { - case 223: - switch (token.parent.parent.parent.kind) { - case 211: - var forStatement = token.parent.parent.parent; - var forInitializer = forStatement.initializer; - if (forInitializer.declarations.length === 1) { - return createCodeFix("", forInitializer.pos, forInitializer.end - forInitializer.pos); - } - else { - return removeSingleItem(forInitializer.declarations, token); - } - case 213: - var forOfStatement = token.parent.parent.parent; - if (forOfStatement.initializer.kind === 224) { - var forOfInitializer = forOfStatement.initializer; - return createCodeFix("{}", forOfInitializer.declarations[0].pos, forOfInitializer.declarations[0].end - forOfInitializer.declarations[0].pos); - } - break; - case 212: - return undefined; - case 256: - var catchClause = token.parent.parent; - var parameter = catchClause.variableDeclaration.getChildren()[0]; - return createCodeFix("", parameter.pos, parameter.end - parameter.pos); - default: - var variableStatement = token.parent.parent.parent; - if (variableStatement.declarationList.declarations.length === 1) { - return createCodeFix("", variableStatement.pos, variableStatement.end - variableStatement.pos); - } - else { - var declarations = variableStatement.declarationList.declarations; - return removeSingleItem(declarations, token); - } - } - case 143: - var typeParameters = token.parent.parent.typeParameters; - if (typeParameters.length === 1) { - return createCodeFix("", token.parent.pos - 1, token.parent.end - token.parent.pos + 2); - } - else { - return removeSingleItem(typeParameters, token); - } - case 144: - var functionDeclaration = token.parent.parent; - if (functionDeclaration.parameters.length === 1) { - return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos); - } - else { - return removeSingleItem(functionDeclaration.parameters, token); - } - case 234: - var importEquals = findImportDeclaration(token); - return createCodeFix("", importEquals.pos, importEquals.end - importEquals.pos); - case 239: - var namedImports = token.parent.parent; - if (namedImports.elements.length === 1) { - var importSpec = findImportDeclaration(token); - return createCodeFix("", importSpec.pos, importSpec.end - importSpec.pos); - } - else { - return removeSingleItem(namedImports.elements, token); - } - case 236: - var importClause = token.parent; - if (!importClause.namedBindings) { - var importDecl = findImportDeclaration(importClause); - return createCodeFix("", importDecl.pos, importDecl.end - importDecl.pos); - } - else { - return createCodeFix("", importClause.name.pos, importClause.namedBindings.pos - importClause.name.pos); - } - case 237: - var namespaceImport = token.parent; - if (namespaceImport.name == token && !namespaceImport.parent.name) { - var importDecl = findImportDeclaration(namespaceImport); - return createCodeFix("", importDecl.pos, importDecl.end - importDecl.pos); - } - else { - var start_4 = namespaceImport.parent.name.end; - return createCodeFix("", start_4, namespaceImport.parent.namedBindings.end - start_4); - } - } - break; - case 147: - return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos); - case 237: - return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos); - } - if (ts.isDeclarationName(token)) { - return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos); - } - else if (ts.isLiteralComputedPropertyDeclarationName(token)) { - return createCodeFix("", token.parent.parent.pos, token.parent.parent.end - token.parent.parent.pos); - } - else { - return undefined; - } - function findImportDeclaration(token) { - var importDecl = token; - while (importDecl.kind != 235 && importDecl.parent) { - importDecl = importDecl.parent; - } - return importDecl; - } - function createCodeFix(newText, start, length) { - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Remove_unused_identifiers), - changes: [{ - fileName: sourceFile.fileName, - textChanges: [{ newText: newText, span: { start: start, length: length } }] + } + return { + span: { start: position, length: 0 }, + newText: (position === startPosition ? "" : newLineCharacter) + "// @ts-ignore" + newLineCharacter + }; + } + function getDisableJsDiagnosticsCodeActions(context) { + var sourceFile = context.sourceFile, program = context.program, newLineCharacter = context.newLineCharacter, span = context.span; + if (!ts.isInJavaScriptFile(sourceFile) || !ts.isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) { + return undefined; + } + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Ignore_this_error_message), + changes: [{ + fileName: sourceFile.fileName, + textChanges: [getIgnoreCommentLocationForLocation(sourceFile, span.start, newLineCharacter)] + }] + }, + { + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Disable_checking_for_this_file), + changes: [{ + fileName: sourceFile.fileName, + textChanges: [{ + span: { + start: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.pos : 0, + length: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.end - sourceFile.checkJsDirective.pos : 0 + }, + newText: "// @ts-nocheck" + newLineCharacter }] - }]; - } - function removeSingleItem(elements, token) { - if (elements[0] === token.parent) { - return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos + 1); + }] + }]; + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var codefix; + (function (codefix) { + function newNodesToChanges(newNodes, insertAfter, context) { + var sourceFile = context.sourceFile; + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + for (var _i = 0, newNodes_1 = newNodes; _i < newNodes_1.length; _i++) { + var newNode = newNodes_1[_i]; + changeTracker.insertNodeAfter(sourceFile, insertAfter, newNode, { suffix: context.newLineCharacter }); + } + var changes = changeTracker.getChanges(); + if (!ts.some(changes)) { + return changes; + } + ts.Debug.assert(changes.length === 1); + var consolidatedChanges = [{ + fileName: changes[0].fileName, + textChanges: [{ + span: changes[0].textChanges[0].span, + newText: changes[0].textChanges.reduce(function (prev, cur) { return prev + cur.newText; }, "") + }] + }]; + return consolidatedChanges; + } + codefix.newNodesToChanges = newNodesToChanges; + function createMissingMemberNodes(classDeclaration, possiblyMissingSymbols, checker) { + var classMembers = classDeclaration.symbol.members; + var missingMembers = possiblyMissingSymbols.filter(function (symbol) { return !classMembers.has(symbol.getName()); }); + var newNodes = []; + for (var _i = 0, missingMembers_1 = missingMembers; _i < missingMembers_1.length; _i++) { + var symbol = missingMembers_1[_i]; + var newNode = createNewNodeForMemberSymbol(symbol, classDeclaration, checker); + if (newNode) { + if (Array.isArray(newNode)) { + newNodes = newNodes.concat(newNode); } else { - return createCodeFix("", token.parent.pos - 1, token.parent.end - token.parent.pos + 1); + newNodes.push(newNode); } } } - }); + return newNodes; + } + codefix.createMissingMemberNodes = createMissingMemberNodes; + function createNewNodeForMemberSymbol(symbol, enclosingDeclaration, checker) { + var declarations = symbol.getDeclarations(); + if (!(declarations && declarations.length)) { + return undefined; + } + var declaration = declarations[0]; + var name = ts.getSynthesizedClone(declaration.name); + var visibilityModifier = createVisibilityModifier(ts.getModifierFlags(declaration)); + var modifiers = visibilityModifier ? ts.createNodeArray([visibilityModifier]) : undefined; + var type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration)); + var optional = !!(symbol.flags & 67108864); + switch (declaration.kind) { + case 152: + case 153: + case 147: + case 148: + var typeNode = checker.typeToTypeNode(type, enclosingDeclaration); + var property = ts.createProperty(undefined, modifiers, name, optional ? ts.createToken(54) : undefined, typeNode, undefined); + return property; + case 149: + case 150: + var signatures = checker.getSignaturesOfType(type, 0); + if (!ts.some(signatures)) { + return undefined; + } + if (declarations.length === 1) { + ts.Debug.assert(signatures.length === 1); + var signature = signatures[0]; + return signatureToMethodDeclaration(signature, enclosingDeclaration, createStubbedMethodBody()); + } + var signatureDeclarations = []; + for (var i = 0; i < signatures.length; i++) { + var signature = signatures[i]; + var methodDeclaration = signatureToMethodDeclaration(signature, enclosingDeclaration); + if (methodDeclaration) { + signatureDeclarations.push(methodDeclaration); + } + } + if (declarations.length > signatures.length) { + var signature = checker.getSignatureFromDeclaration(declarations[declarations.length - 1]); + var methodDeclaration = signatureToMethodDeclaration(signature, enclosingDeclaration, createStubbedMethodBody()); + if (methodDeclaration) { + signatureDeclarations.push(methodDeclaration); + } + } + else { + ts.Debug.assert(declarations.length === signatures.length); + var methodImplementingSignatures = createMethodImplementingSignatures(signatures, name, optional, modifiers); + signatureDeclarations.push(methodImplementingSignatures); + } + return signatureDeclarations; + default: + return undefined; + } + function signatureToMethodDeclaration(signature, enclosingDeclaration, body) { + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 150, enclosingDeclaration); + if (signatureDeclaration) { + signatureDeclaration.decorators = undefined; + signatureDeclaration.modifiers = modifiers; + signatureDeclaration.name = name; + signatureDeclaration.questionToken = optional ? ts.createToken(54) : undefined; + signatureDeclaration.body = body; + } + return signatureDeclaration; + } + } + function createMethodImplementingSignatures(signatures, name, optional, modifiers) { + var maxArgsSignature = signatures[0]; + var minArgumentCount = signatures[0].minArgumentCount; + var someSigHasRestParameter = false; + for (var i = 0; i < signatures.length; i++) { + var sig = signatures[i]; + minArgumentCount = Math.min(sig.minArgumentCount, minArgumentCount); + if (sig.hasRestParameter) { + someSigHasRestParameter = true; + } + if (sig.parameters.length >= maxArgsSignature.parameters.length && (!sig.hasRestParameter || maxArgsSignature.hasRestParameter)) { + maxArgsSignature = sig; + } + } + var maxNonRestArgs = maxArgsSignature.parameters.length - (maxArgsSignature.hasRestParameter ? 1 : 0); + var maxArgsParameterSymbolNames = maxArgsSignature.parameters.map(function (symbol) { return symbol.getName(); }); + var parameters = []; + for (var i = 0; i < maxNonRestArgs; i++) { + var anyType = ts.createKeywordTypeNode(118); + var newParameter = ts.createParameter(undefined, undefined, undefined, maxArgsParameterSymbolNames[i], i >= minArgumentCount ? ts.createToken(54) : undefined, anyType, undefined); + parameters.push(newParameter); + } + if (someSigHasRestParameter) { + var anyArrayType = ts.createArrayTypeNode(ts.createKeywordTypeNode(118)); + var restParameter = ts.createParameter(undefined, undefined, ts.createToken(23), maxArgsParameterSymbolNames[maxNonRestArgs] || "rest", maxNonRestArgs >= minArgumentCount ? ts.createToken(54) : undefined, anyArrayType, undefined); + parameters.push(restParameter); + } + return createStubbedMethod(modifiers, name, optional, undefined, parameters, undefined); + } + function createStubbedMethod(modifiers, name, optional, typeParameters, parameters, returnType) { + return ts.createMethodDeclaration(undefined, modifiers, undefined, name, optional ? ts.createToken(54) : undefined, typeParameters, parameters, returnType, createStubbedMethodBody()); + } + codefix.createStubbedMethod = createStubbedMethod; + function createStubbedMethodBody() { + return ts.createBlock([ts.createThrow(ts.createNew(ts.createIdentifier("Error"), undefined, [ts.createLiteral("Method not implemented.")]))], true); + } + function createVisibilityModifier(flags) { + if (flags & 4) { + return ts.createToken(113); + } + else if (flags & 16) { + return ts.createToken(112); + } + return undefined; + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); var ts; (function (ts) { ts.servicesVersion = "0.5"; function createNode(kind, pos, end, parent) { - var node = kind >= 141 ? new NodeObject(kind, pos, end) : + var node = kind >= 142 ? new NodeObject(kind, pos, end) : kind === 70 ? new IdentifierObject(70, pos, end) : new TokenObject(kind, pos, end); node.parent = parent; @@ -63214,11 +70661,11 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(292, nodes.pos, nodes.end, this); + var list = createNode(293, nodes.pos, nodes.end, this); list._children = []; var pos = nodes.pos; - for (var _i = 0, nodes_7 = nodes; _i < nodes_7.length; _i++) { - var node = nodes_7[_i]; + for (var _i = 0, nodes_9 = nodes; _i < nodes_9.length; _i++) { + var node = nodes_9[_i]; if (pos < node.pos) { pos = this.addSyntheticNodes(list._children, pos, node.pos); } @@ -63233,11 +70680,11 @@ var ts; NodeObject.prototype.createChildren = function (sourceFile) { var _this = this; var children; - if (this.kind >= 141) { + if (this.kind >= 142) { ts.scanner.setText((sourceFile || this.getSourceFile()).text); children = []; var pos_3 = this.pos; - var useJSDocScanner_1 = this.kind >= 278 && this.kind <= 291; + var useJSDocScanner_1 = this.kind >= 282 && this.kind <= 292; var processNode = function (node) { var isJSDocTagNode = ts.isJSDocTag(node); if (!isJSDocTagNode && pos_3 < node.pos) { @@ -63290,8 +70737,10 @@ var ts; if (!children.length) { return undefined; } - var child = children[0]; - return child.kind < 141 ? child : child.getFirstToken(sourceFile); + var child = ts.find(children, function (kid) { return kid.kind < 266 || kid.kind > 292; }); + return child.kind < 142 ? + child : + child.getFirstToken(sourceFile); }; NodeObject.prototype.getLastToken = function (sourceFile) { var children = this.getChildren(sourceFile); @@ -63299,7 +70748,10 @@ var ts; if (!child) { return undefined; } - return child.kind < 141 ? child : child.getLastToken(sourceFile); + return child.kind < 142 ? child : child.getLastToken(sourceFile); + }; + NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { + return ts.forEachChild(this, cbNode, cbNodeArray); }; return NodeObject; }()); @@ -63352,6 +70804,9 @@ var ts; TokenOrIdentifierObject.prototype.getLastToken = function () { return undefined; }; + TokenOrIdentifierObject.prototype.forEachChild = function () { + return undefined; + }; return TokenOrIdentifierObject; }()); var SymbolObject = (function () { @@ -63374,6 +70829,12 @@ var ts; } return this.documentationComment; }; + SymbolObject.prototype.getJsDocTags = function () { + if (this.tags === undefined) { + this.tags = ts.JsDoc.getJsDocTagsFromDeclarations(this.declarations); + } + return this.tags; + }; return SymbolObject; }()); var TokenObject = (function (_super) { @@ -63457,6 +70918,12 @@ var ts; } return this.documentationComment; }; + SignatureObject.prototype.getJsDocTags = function () { + if (this.jsDocTags === undefined) { + this.jsDocTags = this.declaration ? ts.JsDoc.getJsDocTagsFromDeclarations([this.declaration]) : []; + } + return this.jsDocTags; + }; return SignatureObject; }()); var SourceFileObject = (function (_super) { @@ -63496,17 +70963,21 @@ var ts; return this.namedDeclarations; }; SourceFileObject.prototype.computeNamedDeclarations = function () { - var result = ts.createMap(); + var result = ts.createMultiMap(); ts.forEachChild(this, visit); return result; function addDeclaration(declaration) { var name = getDeclarationName(declaration); if (name) { - ts.multiMapAdd(result, name, declaration); + result.add(name, declaration); } } function getDeclarations(name) { - return result[name] || (result[name] = []); + var declarations = result.get(name); + if (!declarations) { + result.set(name, declarations = []); + } + return declarations; } function getDeclarationName(declaration) { if (declaration.name) { @@ -63514,9 +70985,9 @@ var ts; if (result_7 !== undefined) { return result_7; } - if (declaration.name.kind === 142) { + if (declaration.name.kind === 143) { var expr = declaration.name.expression; - if (expr.kind === 177) { + if (expr.kind === 178) { return expr.name.text; } return getTextOfIdentifierOrLiteral(expr); @@ -63536,10 +71007,10 @@ var ts; } function visit(node) { switch (node.kind) { - case 225: - case 184: + case 227: + case 185: + case 150: case 149: - case 148: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -63553,33 +71024,33 @@ var ts; else { declarations.push(functionDeclaration); } - ts.forEachChild(node, visit); } + ts.forEachChild(node, visit); break; - case 226: - case 197: - case 227: case 228: + case 198: case 229: case 230: - case 234: - case 243: - case 239: - case 234: + case 231: + case 232: case 236: - case 237: - case 151: + case 245: + case 241: + case 236: + case 238: + case 239: case 152: - case 161: + case 153: + case 162: addDeclaration(node); ts.forEachChild(node, visit); break; - case 144: + case 145: if (!ts.hasModifier(node, 92)) { break; } - case 223: - case 174: { + case 225: + case 175: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -63588,24 +71059,24 @@ var ts; if (decl.initializer) visit(decl.initializer); } - case 260: + case 263: + case 148: case 147: - case 146: addDeclaration(node); break; - case 241: + case 243: if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 235: + case 237: var importClause = node.importClause; if (importClause) { if (importClause.name) { addDeclaration(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 237) { + if (importClause.namedBindings.kind === 239) { addDeclaration(importClause.namedBindings); } else { @@ -63831,6 +71302,30 @@ var ts; }; return CancellationTokenObject; }()); + var ThrottledCancellationToken = (function () { + function ThrottledCancellationToken(hostCancellationToken, throttleWaitMilliseconds) { + if (throttleWaitMilliseconds === void 0) { throttleWaitMilliseconds = 20; } + this.hostCancellationToken = hostCancellationToken; + this.throttleWaitMilliseconds = throttleWaitMilliseconds; + this.lastCancellationCheckTime = 0; + } + ThrottledCancellationToken.prototype.isCancellationRequested = function () { + var time = ts.timestamp(); + var duration = Math.abs(time - this.lastCancellationCheckTime); + if (duration >= this.throttleWaitMilliseconds) { + this.lastCancellationCheckTime = time; + return this.hostCancellationToken.isCancellationRequested(); + } + return false; + }; + ThrottledCancellationToken.prototype.throwIfCancellationRequested = function () { + if (this.isCancellationRequested()) { + throw new ts.OperationCanceledException(); + } + }; + return ThrottledCancellationToken; + }()); + ts.ThrottledCancellationToken = ThrottledCancellationToken; function createLanguageService(host, documentRegistry) { if (documentRegistry === void 0) { documentRegistry = ts.createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory()); } var syntaxTreeCache = new SyntaxTreeCache(host); @@ -64048,10 +71543,10 @@ var ts; if (!symbol || typeChecker.isUnknownSymbol(symbol)) { switch (node.kind) { case 70: - case 177: - case 141: + case 178: + case 142: case 98: - case 167: + case 168: case 96: var type = typeChecker.getTypeAtLocation(node); if (type) { @@ -64060,7 +71555,8 @@ var ts; kindModifiers: ts.ScriptElementKindModifier.none, textSpan: ts.createTextSpan(node.getStart(), node.getWidth()), displayParts: ts.typeToDisplayParts(typeChecker, type, ts.getContainerNode(node)), - documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined + documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined, + tags: type.symbol ? type.symbol.getJsDocTags() : undefined }; } } @@ -64072,26 +71568,27 @@ var ts; kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), textSpan: ts.createTextSpan(node.getStart(), node.getWidth()), displayParts: displayPartsDocumentationsAndKind.displayParts, - documentation: displayPartsDocumentationsAndKind.documentation + documentation: displayPartsDocumentationsAndKind.documentation, + tags: displayPartsDocumentationsAndKind.tags }; } function getDefinitionAtPosition(fileName, position) { synchronizeHostData(); return ts.GoToDefinition.getDefinitionAtPosition(program, getValidSourceFile(fileName), position); } - function getImplementationAtPosition(fileName, position) { - synchronizeHostData(); - return ts.GoToImplementation.getImplementationAtPosition(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), ts.getTouchingPropertyName(getValidSourceFile(fileName), position)); - } function getTypeDefinitionAtPosition(fileName, position) { synchronizeHostData(); return ts.GoToDefinition.getTypeDefinitionAtPosition(program.getTypeChecker(), getValidSourceFile(fileName), position); } + function getImplementationAtPosition(fileName, position) { + synchronizeHostData(); + return ts.FindAllReferences.getImplementationsAtPosition(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position); + } function getOccurrencesAtPosition(fileName, position) { var results = getOccurrencesAtPositionCore(fileName, position); if (results) { - var sourceFile_2 = getCanonicalFileName(ts.normalizeSlashes(fileName)); - results = ts.filter(results, function (r) { return getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile_2; }); + var sourceFile_1 = getCanonicalFileName(ts.normalizeSlashes(fileName)); + results = ts.filter(results, function (r) { return getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile_1; }); } return results; } @@ -64102,7 +71599,6 @@ var ts; return ts.DocumentHighlights.getDocumentHighlights(program.getTypeChecker(), cancellationToken, sourceFile, position, sourceFilesToSearch); } function getOccurrencesAtPositionCore(fileName, position) { - synchronizeHostData(); return convertDocumentHighlights(getDocumentHighlights(fileName, position, [fileName])); function convertDocumentHighlights(documentHighlights) { if (!documentHighlights) { @@ -64117,7 +71613,8 @@ var ts; fileName: entry.fileName, textSpan: highlightSpan.textSpan, isWriteAccess: highlightSpan.kind === ts.HighlightSpanKind.writtenReference, - isDefinition: false + isDefinition: false, + isInString: highlightSpan.isInString, }); } } @@ -64125,20 +71622,18 @@ var ts; } } function findRenameLocations(fileName, position, findInStrings, findInComments) { - var referencedSymbols = findReferencedSymbols(fileName, position, findInStrings, findInComments); - return ts.FindAllReferences.convertReferences(referencedSymbols); + return getReferences(fileName, position, { findInStrings: findInStrings, findInComments: findInComments, isForRename: true }); } function getReferencesAtPosition(fileName, position) { - var referencedSymbols = findReferencedSymbols(fileName, position, false, false); - return ts.FindAllReferences.convertReferences(referencedSymbols); + return getReferences(fileName, position); + } + function getReferences(fileName, position, options) { + synchronizeHostData(); + return ts.FindAllReferences.findReferencedEntries(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position, options); } function findReferences(fileName, position) { - var referencedSymbols = findReferencedSymbols(fileName, position, false, false); - return ts.filter(referencedSymbols, function (rs) { return !!rs.definition; }); - } - function findReferencedSymbols(fileName, position, findInStrings, findInComments) { synchronizeHostData(); - return ts.FindAllReferences.findReferencedSymbols(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position, findInStrings, findInComments); + return ts.FindAllReferences.findReferencedSymbols(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position); } function getNavigateToItems(searchValue, maxResultCount, fileName, excludeDtsFiles) { synchronizeHostData(); @@ -64156,7 +71651,8 @@ var ts; text: data }); } - var emitOutput = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles); + var customTransformers = host.getCustomTransformers && host.getCustomTransformers(); + var emitOutput = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); return { outputFiles: outputFiles, emitSkipped: emitOutput.emitSkipped @@ -64180,15 +71676,15 @@ var ts; return; } switch (node.kind) { - case 177: - case 141: + case 178: + case 142: case 9: case 85: case 100: case 94: case 96: case 98: - case 167: + case 168: case 70: break; default: @@ -64200,7 +71696,7 @@ var ts; nodeForStartPos = nodeForStartPos.parent; } else if (ts.isNameOfModuleDeclaration(nodeForStartPos)) { - if (nodeForStartPos.parent.parent.kind === 230 && + if (nodeForStartPos.parent.parent.kind === 232 && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { nodeForStartPos = nodeForStartPos.parent.parent.name; } @@ -64219,10 +71715,10 @@ var ts; return ts.BreakpointResolver.spanInSourceFileAtLocation(sourceFile, position); } function getNavigationBarItems(fileName) { - return ts.NavigationBar.getNavigationBarItems(syntaxTreeCache.getCurrentSourceFile(fileName)); + return ts.NavigationBar.getNavigationBarItems(syntaxTreeCache.getCurrentSourceFile(fileName), cancellationToken); } function getNavigationTree(fileName) { - return ts.NavigationBar.getNavigationTree(syntaxTreeCache.getCurrentSourceFile(fileName)); + return ts.NavigationBar.getNavigationTree(syntaxTreeCache.getCurrentSourceFile(fileName), cancellationToken); } function isTsOrTsxFile(fileName) { var kind = ts.getScriptKind(fileName, host); @@ -64250,7 +71746,7 @@ var ts; } function getOutliningSpans(fileName) { var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - return ts.OutliningElementsCollector.collectElements(sourceFile); + return ts.OutliningElementsCollector.collectElements(sourceFile, cancellationToken); } function getBraceMatchingAtPosition(fileName, position) { var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); @@ -64326,13 +71822,13 @@ var ts; } return []; } - function getCodeFixesAtPosition(fileName, start, end, errorCodes) { + function getCodeFixesAtPosition(fileName, start, end, errorCodes, formatOptions) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); var span = { start: start, length: end - start }; var newLineChar = ts.getNewLineOrDefaultFromHost(host); var allFixes = []; - ts.forEach(errorCodes, function (error) { + ts.forEach(ts.deduplicate(errorCodes), function (error) { cancellationToken.throwIfCancellationRequested(); var context = { errorCode: error, @@ -64341,7 +71837,8 @@ var ts; program: program, newLineCharacter: newLineChar, host: host, - cancellationToken: cancellationToken + cancellationToken: cancellationToken, + rulesProvider: getRuleProvider(formatOptions) }; var fixes = ts.codefix.getFixes(context); if (fixes) { @@ -64358,7 +71855,7 @@ var ts; return false; } var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - if (ts.isInString(sourceFile, position) || ts.isInComment(sourceFile, position)) { + if (ts.isInString(sourceFile, position)) { return false; } if (ts.isInsideJsxElementOrAttribute(sourceFile, position)) { @@ -64389,7 +71886,7 @@ var ts; continue; } var descriptor = undefined; - for (var i = 0, n = descriptors.length; i < n; i++) { + for (var i = 0; i < descriptors.length; i++) { if (matchArray[i + firstDescriptorCaptureIndex]) { descriptor = descriptors[i]; } @@ -64493,15 +71990,15 @@ var ts; function walk(node) { switch (node.kind) { case 70: - nameTable[node.text] = nameTable[node.text] === undefined ? node.pos : -1; + setNameTable(node.text, node); break; case 9: case 8: if (ts.isDeclarationName(node) || - node.parent.kind === 245 || + node.parent.kind === 247 || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node)) { - nameTable[node.text] = nameTable[node.text] === undefined ? node.pos : -1; + setNameTable(node.text, node); } break; default: @@ -64514,11 +72011,66 @@ var ts; } } } + function setNameTable(text, node) { + nameTable.set(text, nameTable.get(text) === undefined ? node.pos : -1); + } } + function isObjectLiteralElement(node) { + switch (node.kind) { + case 252: + case 254: + case 260: + case 261: + case 150: + case 152: + case 153: + return true; + } + return false; + } + function getContainingObjectLiteralElement(node) { + switch (node.kind) { + case 9: + case 8: + if (node.parent.kind === 143) { + return isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; + } + case 70: + return isObjectLiteralElement(node.parent) && + (node.parent.parent.kind === 177 || node.parent.parent.kind === 253) && + node.parent.name === node ? node.parent : undefined; + } + return undefined; + } + ts.getContainingObjectLiteralElement = getContainingObjectLiteralElement; + function getPropertySymbolsFromContextualType(typeChecker, node) { + var objectLiteral = node.parent; + var contextualType = typeChecker.getContextualType(objectLiteral); + var name = ts.getTextOfPropertyName(node.name); + if (name && contextualType) { + var result_8 = []; + var symbol = contextualType.getProperty(name); + if (contextualType.flags & 65536) { + ts.forEach(contextualType.types, function (t) { + var symbol = t.getProperty(name); + if (symbol) { + result_8.push(symbol); + } + }); + return result_8; + } + if (symbol) { + result_8.push(symbol); + return result_8; + } + } + return undefined; + } + ts.getPropertySymbolsFromContextualType = getPropertySymbolsFromContextualType; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 178 && + node.parent.kind === 179 && node.parent.argumentExpression === node; } function getDefaultLibFilePath(options) { @@ -64528,5394 +72080,7 @@ var ts; throw new Error("getDefaultLibFilePath is only supported when consumed as a node module. "); } ts.getDefaultLibFilePath = getDefaultLibFilePath; - function initializeServices() { - ts.objectAllocator = getServicesObjectAllocator(); - } - initializeServices(); -})(ts || (ts = {})); -var ts; -(function (ts) { - var server; - (function (server) { - var ScriptInfo = (function () { - function ScriptInfo(host, fileName, content, scriptKind, isOpen, hasMixedContent) { - if (isOpen === void 0) { isOpen = false; } - if (hasMixedContent === void 0) { hasMixedContent = false; } - this.host = host; - this.fileName = fileName; - this.scriptKind = scriptKind; - this.isOpen = isOpen; - this.hasMixedContent = hasMixedContent; - this.containingProjects = []; - this.path = ts.toPath(fileName, host.getCurrentDirectory(), ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames)); - this.svc = server.ScriptVersionCache.fromString(host, content); - this.scriptKind = scriptKind - ? scriptKind - : ts.getScriptKindFromFileName(fileName); - } - ScriptInfo.prototype.getFormatCodeSettings = function () { - return this.formatCodeSettings; - }; - ScriptInfo.prototype.attachToProject = function (project) { - var isNew = !this.isAttached(project); - if (isNew) { - this.containingProjects.push(project); - } - return isNew; - }; - ScriptInfo.prototype.isAttached = function (project) { - switch (this.containingProjects.length) { - case 0: return false; - case 1: return this.containingProjects[0] === project; - case 2: return this.containingProjects[0] === project || this.containingProjects[1] === project; - default: return ts.contains(this.containingProjects, project); - } - }; - ScriptInfo.prototype.detachFromProject = function (project) { - switch (this.containingProjects.length) { - case 0: - return; - case 1: - if (this.containingProjects[0] === project) { - this.containingProjects.pop(); - } - break; - case 2: - if (this.containingProjects[0] === project) { - this.containingProjects[0] = this.containingProjects.pop(); - } - else if (this.containingProjects[1] === project) { - this.containingProjects.pop(); - } - break; - default: - server.removeItemFromSet(this.containingProjects, project); - break; - } - }; - ScriptInfo.prototype.detachAllProjects = function () { - for (var _i = 0, _a = this.containingProjects; _i < _a.length; _i++) { - var p = _a[_i]; - p.removeFile(this, false); - } - this.containingProjects.length = 0; - }; - ScriptInfo.prototype.getDefaultProject = function () { - if (this.containingProjects.length === 0) { - return server.Errors.ThrowNoProject(); - } - return this.containingProjects[0]; - }; - ScriptInfo.prototype.setFormatOptions = function (formatSettings) { - if (formatSettings) { - if (!this.formatCodeSettings) { - this.formatCodeSettings = server.getDefaultFormatCodeSettings(this.host); - } - server.mergeMaps(this.formatCodeSettings, formatSettings); - } - }; - ScriptInfo.prototype.setWatcher = function (watcher) { - this.stopWatcher(); - this.fileWatcher = watcher; - }; - ScriptInfo.prototype.stopWatcher = function () { - if (this.fileWatcher) { - this.fileWatcher.close(); - this.fileWatcher = undefined; - } - }; - ScriptInfo.prototype.getLatestVersion = function () { - return this.svc.latestVersion().toString(); - }; - ScriptInfo.prototype.reload = function (script) { - this.svc.reload(script); - this.markContainingProjectsAsDirty(); - }; - ScriptInfo.prototype.saveTo = function (fileName) { - var snap = this.snap(); - this.host.writeFile(fileName, snap.getText(0, snap.getLength())); - }; - ScriptInfo.prototype.reloadFromFile = function (tempFileName) { - if (this.hasMixedContent) { - this.reload(""); - } - else { - this.svc.reloadFromFile(tempFileName || this.fileName); - this.markContainingProjectsAsDirty(); - } - }; - ScriptInfo.prototype.snap = function () { - return this.svc.getSnapshot(); - }; - ScriptInfo.prototype.getLineInfo = function (line) { - var snap = this.snap(); - return snap.index.lineNumberToInfo(line); - }; - ScriptInfo.prototype.editContent = function (start, end, newText) { - this.svc.edit(start, end - start, newText); - this.markContainingProjectsAsDirty(); - }; - ScriptInfo.prototype.markContainingProjectsAsDirty = function () { - for (var _i = 0, _a = this.containingProjects; _i < _a.length; _i++) { - var p = _a[_i]; - p.markAsDirty(); - } - }; - ScriptInfo.prototype.lineToTextSpan = function (line) { - var index = this.snap().index; - var lineInfo = index.lineNumberToInfo(line + 1); - var len; - if (lineInfo.leaf) { - len = lineInfo.leaf.text.length; - } - else { - var nextLineInfo = index.lineNumberToInfo(line + 2); - len = nextLineInfo.offset - lineInfo.offset; - } - return ts.createTextSpan(lineInfo.offset, len); - }; - ScriptInfo.prototype.lineOffsetToPosition = function (line, offset) { - var index = this.snap().index; - var lineInfo = index.lineNumberToInfo(line); - return (lineInfo.offset + offset - 1); - }; - ScriptInfo.prototype.positionToLineOffset = function (position) { - var index = this.snap().index; - var lineOffset = index.charOffsetToLineNumberAndPos(position); - return { line: lineOffset.line, offset: lineOffset.offset + 1 }; - }; - return ScriptInfo; - }()); - server.ScriptInfo = ScriptInfo; - })(server = ts.server || (ts.server = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var server; - (function (server) { - var LSHost = (function () { - function LSHost(host, project, cancellationToken) { - var _this = this; - this.host = host; - this.project = project; - this.cancellationToken = cancellationToken; - this.resolvedModuleNames = ts.createFileMap(); - this.resolvedTypeReferenceDirectives = ts.createFileMap(); - this.getCanonicalFileName = ts.createGetCanonicalFileName(this.host.useCaseSensitiveFileNames); - if (host.trace) { - this.trace = function (s) { return host.trace(s); }; - } - this.resolveModuleName = function (moduleName, containingFile, compilerOptions, host) { - var globalCache = _this.project.getTypeAcquisition().enable - ? _this.project.projectService.typingsInstaller.globalTypingsCacheLocation - : undefined; - var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host); - if (!(primaryResult.resolvedModule && ts.extensionIsTypeScript(primaryResult.resolvedModule.extension)) && globalCache !== undefined) { - var _a = ts.loadModuleFromGlobalCache(moduleName, _this.project.getProjectName(), compilerOptions, host, globalCache), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations; - if (resolvedModule) { - return { resolvedModule: resolvedModule, failedLookupLocations: primaryResult.failedLookupLocations.concat(failedLookupLocations) }; - } - } - return primaryResult; - }; - if (this.host.realpath) { - this.realpath = function (path) { return _this.host.realpath(path); }; - } - } - LSHost.prototype.startRecordingFilesWithChangedResolutions = function () { - this.filesWithChangedSetOfUnresolvedImports = []; - }; - LSHost.prototype.finishRecordingFilesWithChangedResolutions = function () { - var collected = this.filesWithChangedSetOfUnresolvedImports; - this.filesWithChangedSetOfUnresolvedImports = undefined; - return collected; - }; - LSHost.prototype.resolveNamesWithLocalCache = function (names, containingFile, cache, loader, getResult, getResultFileName, logChanges) { - var path = ts.toPath(containingFile, this.host.getCurrentDirectory(), this.getCanonicalFileName); - var currentResolutionsInFile = cache.get(path); - var newResolutions = ts.createMap(); - var resolvedModules = []; - var compilerOptions = this.getCompilationSettings(); - var lastDeletedFileName = this.project.projectService.lastDeletedFile && this.project.projectService.lastDeletedFile.fileName; - for (var _i = 0, names_2 = names; _i < names_2.length; _i++) { - var name_49 = names_2[_i]; - var resolution = newResolutions[name_49]; - if (!resolution) { - var existingResolution = currentResolutionsInFile && currentResolutionsInFile[name_49]; - if (moduleResolutionIsValid(existingResolution)) { - resolution = existingResolution; - } - else { - newResolutions[name_49] = resolution = loader(name_49, containingFile, compilerOptions, this); - } - if (logChanges && this.filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) { - this.filesWithChangedSetOfUnresolvedImports.push(path); - logChanges = false; - } - } - ts.Debug.assert(resolution !== undefined); - resolvedModules.push(getResult(resolution)); - } - cache.set(path, newResolutions); - return resolvedModules; - function resolutionIsEqualTo(oldResolution, newResolution) { - if (oldResolution === newResolution) { - return true; - } - if (!oldResolution || !newResolution) { - return false; - } - var oldResult = getResult(oldResolution); - var newResult = getResult(newResolution); - if (oldResult === newResult) { - return true; - } - if (!oldResult || !newResult) { - return false; - } - return getResultFileName(oldResult) === getResultFileName(newResult); - } - function moduleResolutionIsValid(resolution) { - if (!resolution) { - return false; - } - var result = getResult(resolution); - if (result) { - return getResultFileName(result) !== lastDeletedFileName; - } - return resolution.failedLookupLocations.length === 0; - } - }; - LSHost.prototype.getProjectVersion = function () { - return this.project.getProjectVersion(); - }; - LSHost.prototype.getCompilationSettings = function () { - return this.compilationSettings; - }; - LSHost.prototype.useCaseSensitiveFileNames = function () { - return this.host.useCaseSensitiveFileNames; - }; - LSHost.prototype.getCancellationToken = function () { - return this.cancellationToken; - }; - LSHost.prototype.resolveTypeReferenceDirectives = function (typeDirectiveNames, containingFile) { - return this.resolveNamesWithLocalCache(typeDirectiveNames, containingFile, this.resolvedTypeReferenceDirectives, ts.resolveTypeReferenceDirective, function (m) { return m.resolvedTypeReferenceDirective; }, function (r) { return r.resolvedFileName; }, false); - }; - LSHost.prototype.resolveModuleNames = function (moduleNames, containingFile) { - return this.resolveNamesWithLocalCache(moduleNames, containingFile, this.resolvedModuleNames, this.resolveModuleName, function (m) { return m.resolvedModule; }, function (r) { return r.resolvedFileName; }, true); - }; - LSHost.prototype.getDefaultLibFileName = function () { - var nodeModuleBinDir = ts.getDirectoryPath(ts.normalizePath(this.host.getExecutingFilePath())); - return ts.combinePaths(nodeModuleBinDir, ts.getDefaultLibFileName(this.compilationSettings)); - }; - LSHost.prototype.getScriptSnapshot = function (filename) { - var scriptInfo = this.project.getScriptInfoLSHost(filename); - if (scriptInfo) { - return scriptInfo.snap(); - } - }; - LSHost.prototype.getScriptFileNames = function () { - return this.project.getRootFilesLSHost(); - }; - LSHost.prototype.getTypeRootsVersion = function () { - return this.project.typesVersion; - }; - LSHost.prototype.getScriptKind = function (fileName) { - var info = this.project.getScriptInfoLSHost(fileName); - return info && info.scriptKind; - }; - LSHost.prototype.getScriptVersion = function (filename) { - var info = this.project.getScriptInfoLSHost(filename); - return info && info.getLatestVersion(); - }; - LSHost.prototype.getCurrentDirectory = function () { - return this.host.getCurrentDirectory(); - }; - LSHost.prototype.resolvePath = function (path) { - return this.host.resolvePath(path); - }; - LSHost.prototype.fileExists = function (path) { - return this.host.fileExists(path); - }; - LSHost.prototype.readFile = function (fileName) { - return this.host.readFile(fileName); - }; - LSHost.prototype.directoryExists = function (path) { - return this.host.directoryExists(path); - }; - LSHost.prototype.readDirectory = function (path, extensions, exclude, include) { - return this.host.readDirectory(path, extensions, exclude, include); - }; - LSHost.prototype.getDirectories = function (path) { - return this.host.getDirectories(path); - }; - LSHost.prototype.notifyFileRemoved = function (info) { - this.resolvedModuleNames.remove(info.path); - this.resolvedTypeReferenceDirectives.remove(info.path); - }; - LSHost.prototype.setCompilationSettings = function (opt) { - if (ts.changesAffectModuleResolution(this.compilationSettings, opt)) { - this.resolvedModuleNames.clear(); - this.resolvedTypeReferenceDirectives.clear(); - } - this.compilationSettings = opt; - }; - return LSHost; - }()); - server.LSHost = LSHost; - })(server = ts.server || (ts.server = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var server; - (function (server) { - server.nullTypingsInstaller = { - enqueueInstallTypingsRequest: ts.noop, - attach: ts.noop, - onProjectClosed: ts.noop, - globalTypingsCacheLocation: undefined - }; - var TypingsCacheEntry = (function () { - function TypingsCacheEntry() { - } - return TypingsCacheEntry; - }()); - function setIsEqualTo(arr1, arr2) { - if (arr1 === arr2) { - return true; - } - if ((arr1 || server.emptyArray).length === 0 && (arr2 || server.emptyArray).length === 0) { - return true; - } - var set = ts.createMap(); - var unique = 0; - for (var _i = 0, arr1_1 = arr1; _i < arr1_1.length; _i++) { - var v = arr1_1[_i]; - if (set[v] !== true) { - set[v] = true; - unique++; - } - } - for (var _a = 0, arr2_1 = arr2; _a < arr2_1.length; _a++) { - var v = arr2_1[_a]; - if (!ts.hasProperty(set, v)) { - return false; - } - if (set[v] === true) { - set[v] = false; - unique--; - } - } - return unique === 0; - } - function typeAcquisitionChanged(opt1, opt2) { - return opt1.enable !== opt2.enable || - !setIsEqualTo(opt1.include, opt2.include) || - !setIsEqualTo(opt1.exclude, opt2.exclude); - } - function compilerOptionsChanged(opt1, opt2) { - return opt1.allowJs != opt2.allowJs; - } - function unresolvedImportsChanged(imports1, imports2) { - if (imports1 === imports2) { - return false; - } - return !ts.arrayIsEqualTo(imports1, imports2); - } - var TypingsCache = (function () { - function TypingsCache(installer) { - this.installer = installer; - this.perProjectCache = ts.createMap(); - } - TypingsCache.prototype.getTypingsForProject = function (project, unresolvedImports, forceRefresh) { - var typeAcquisition = project.getTypeAcquisition(); - if (!typeAcquisition || !typeAcquisition.enable) { - return server.emptyArray; - } - var entry = this.perProjectCache[project.getProjectName()]; - var result = entry ? entry.typings : server.emptyArray; - if (forceRefresh || - !entry || - typeAcquisitionChanged(typeAcquisition, entry.typeAcquisition) || - compilerOptionsChanged(project.getCompilerOptions(), entry.compilerOptions) || - unresolvedImportsChanged(unresolvedImports, entry.unresolvedImports)) { - this.perProjectCache[project.getProjectName()] = { - compilerOptions: project.getCompilerOptions(), - typeAcquisition: typeAcquisition, - typings: result, - unresolvedImports: unresolvedImports, - poisoned: true - }; - this.installer.enqueueInstallTypingsRequest(project, typeAcquisition, unresolvedImports); - } - return result; - }; - TypingsCache.prototype.updateTypingsForProject = function (projectName, compilerOptions, typeAcquisition, unresolvedImports, newTypings) { - this.perProjectCache[projectName] = { - compilerOptions: compilerOptions, - typeAcquisition: typeAcquisition, - typings: server.toSortedReadonlyArray(newTypings), - unresolvedImports: unresolvedImports, - poisoned: false - }; - }; - TypingsCache.prototype.deleteTypingsForProject = function (projectName) { - delete this.perProjectCache[projectName]; - }; - TypingsCache.prototype.onProjectClosed = function (project) { - delete this.perProjectCache[project.getProjectName()]; - this.installer.onProjectClosed(project); - }; - return TypingsCache; - }()); - server.TypingsCache = TypingsCache; - })(server = ts.server || (ts.server = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var server; - (function (server) { - function shouldEmitFile(scriptInfo) { - return !scriptInfo.hasMixedContent; - } - server.shouldEmitFile = shouldEmitFile; - var BuilderFileInfo = (function () { - function BuilderFileInfo(scriptInfo, project) { - this.scriptInfo = scriptInfo; - this.project = project; - } - BuilderFileInfo.prototype.isExternalModuleOrHasOnlyAmbientExternalModules = function () { - var sourceFile = this.getSourceFile(); - return ts.isExternalModule(sourceFile) || this.containsOnlyAmbientModules(sourceFile); - }; - BuilderFileInfo.prototype.containsOnlyAmbientModules = function (sourceFile) { - for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { - var statement = _a[_i]; - if (statement.kind !== 230 || statement.name.kind !== 9) { - return false; - } - } - return true; - }; - BuilderFileInfo.prototype.computeHash = function (text) { - return this.project.projectService.host.createHash(text); - }; - BuilderFileInfo.prototype.getSourceFile = function () { - return this.project.getSourceFile(this.scriptInfo.path); - }; - BuilderFileInfo.prototype.updateShapeSignature = function () { - var sourceFile = this.getSourceFile(); - if (!sourceFile) { - return true; - } - var lastSignature = this.lastCheckedShapeSignature; - if (sourceFile.isDeclarationFile) { - this.lastCheckedShapeSignature = this.computeHash(sourceFile.text); - } - else { - var emitOutput = this.project.getFileEmitOutput(this.scriptInfo, true); - if (emitOutput.outputFiles && emitOutput.outputFiles.length > 0) { - this.lastCheckedShapeSignature = this.computeHash(emitOutput.outputFiles[0].text); - } - } - return !lastSignature || this.lastCheckedShapeSignature !== lastSignature; - }; - return BuilderFileInfo; - }()); - server.BuilderFileInfo = BuilderFileInfo; - var AbstractBuilder = (function () { - function AbstractBuilder(project, ctor) { - this.project = project; - this.ctor = ctor; - this.fileInfos = ts.createFileMap(); - } - AbstractBuilder.prototype.getFileInfo = function (path) { - return this.fileInfos.get(path); - }; - AbstractBuilder.prototype.getOrCreateFileInfo = function (path) { - var fileInfo = this.getFileInfo(path); - if (!fileInfo) { - var scriptInfo = this.project.getScriptInfo(path); - fileInfo = new this.ctor(scriptInfo, this.project); - this.setFileInfo(path, fileInfo); - } - return fileInfo; - }; - AbstractBuilder.prototype.getFileInfoPaths = function () { - return this.fileInfos.getKeys(); - }; - AbstractBuilder.prototype.setFileInfo = function (path, info) { - this.fileInfos.set(path, info); - }; - AbstractBuilder.prototype.removeFileInfo = function (path) { - this.fileInfos.remove(path); - }; - AbstractBuilder.prototype.forEachFileInfo = function (action) { - this.fileInfos.forEachValue(function (_path, value) { return action(value); }); - }; - AbstractBuilder.prototype.emitFile = function (scriptInfo, writeFile) { - var fileInfo = this.getFileInfo(scriptInfo.path); - if (!fileInfo) { - return false; - } - var _a = this.project.getFileEmitOutput(fileInfo.scriptInfo, false), emitSkipped = _a.emitSkipped, outputFiles = _a.outputFiles; - if (!emitSkipped) { - var projectRootPath = this.project.getProjectRootPath(); - for (var _i = 0, outputFiles_1 = outputFiles; _i < outputFiles_1.length; _i++) { - var outputFile = outputFiles_1[_i]; - var outputFileAbsoluteFileName = ts.getNormalizedAbsolutePath(outputFile.name, projectRootPath ? projectRootPath : ts.getDirectoryPath(scriptInfo.fileName)); - writeFile(outputFileAbsoluteFileName, outputFile.text, outputFile.writeByteOrderMark); - } - } - return !emitSkipped; - }; - return AbstractBuilder; - }()); - var NonModuleBuilder = (function (_super) { - __extends(NonModuleBuilder, _super); - function NonModuleBuilder(project) { - var _this = _super.call(this, project, BuilderFileInfo) || this; - _this.project = project; - return _this; - } - NonModuleBuilder.prototype.onProjectUpdateGraph = function () { - }; - NonModuleBuilder.prototype.getFilesAffectedBy = function (scriptInfo) { - var info = this.getOrCreateFileInfo(scriptInfo.path); - var singleFileResult = scriptInfo.hasMixedContent ? [] : [scriptInfo.fileName]; - if (info.updateShapeSignature()) { - var options = this.project.getCompilerOptions(); - if (options && (options.out || options.outFile)) { - return singleFileResult; - } - return this.project.getAllEmittableFiles(); - } - return singleFileResult; - }; - return NonModuleBuilder; - }(AbstractBuilder)); - var ModuleBuilderFileInfo = (function (_super) { - __extends(ModuleBuilderFileInfo, _super); - function ModuleBuilderFileInfo() { - var _this = _super.apply(this, arguments) || this; - _this.references = []; - _this.referencedBy = []; - return _this; - } - ModuleBuilderFileInfo.compareFileInfos = function (lf, rf) { - var l = lf.scriptInfo.fileName; - var r = rf.scriptInfo.fileName; - return (l < r ? -1 : (l > r ? 1 : 0)); - }; - ; - ModuleBuilderFileInfo.addToReferenceList = function (array, fileInfo) { - if (array.length === 0) { - array.push(fileInfo); - return; - } - var insertIndex = ts.binarySearch(array, fileInfo, ModuleBuilderFileInfo.compareFileInfos); - if (insertIndex < 0) { - array.splice(~insertIndex, 0, fileInfo); - } - }; - ModuleBuilderFileInfo.removeFromReferenceList = function (array, fileInfo) { - if (!array || array.length === 0) { - return; - } - if (array[0] === fileInfo) { - array.splice(0, 1); - return; - } - var removeIndex = ts.binarySearch(array, fileInfo, ModuleBuilderFileInfo.compareFileInfos); - if (removeIndex >= 0) { - array.splice(removeIndex, 1); - } - }; - ModuleBuilderFileInfo.prototype.addReferencedBy = function (fileInfo) { - ModuleBuilderFileInfo.addToReferenceList(this.referencedBy, fileInfo); - }; - ModuleBuilderFileInfo.prototype.removeReferencedBy = function (fileInfo) { - ModuleBuilderFileInfo.removeFromReferenceList(this.referencedBy, fileInfo); - }; - ModuleBuilderFileInfo.prototype.removeFileReferences = function () { - for (var _i = 0, _a = this.references; _i < _a.length; _i++) { - var reference = _a[_i]; - reference.removeReferencedBy(this); - } - this.references = []; - }; - return ModuleBuilderFileInfo; - }(BuilderFileInfo)); - var ModuleBuilder = (function (_super) { - __extends(ModuleBuilder, _super); - function ModuleBuilder(project) { - var _this = _super.call(this, project, ModuleBuilderFileInfo) || this; - _this.project = project; - return _this; - } - ModuleBuilder.prototype.getReferencedFileInfos = function (fileInfo) { - var _this = this; - if (!fileInfo.isExternalModuleOrHasOnlyAmbientExternalModules()) { - return []; - } - var referencedFilePaths = this.project.getReferencedFiles(fileInfo.scriptInfo.path); - if (referencedFilePaths.length > 0) { - return ts.map(referencedFilePaths, function (f) { return _this.getOrCreateFileInfo(f); }).sort(ModuleBuilderFileInfo.compareFileInfos); - } - return []; - }; - ModuleBuilder.prototype.onProjectUpdateGraph = function () { - this.ensureProjectDependencyGraphUpToDate(); - }; - ModuleBuilder.prototype.ensureProjectDependencyGraphUpToDate = function () { - var _this = this; - if (!this.projectVersionForDependencyGraph || this.project.getProjectVersion() !== this.projectVersionForDependencyGraph) { - var currentScriptInfos = this.project.getScriptInfos(); - for (var _i = 0, currentScriptInfos_1 = currentScriptInfos; _i < currentScriptInfos_1.length; _i++) { - var scriptInfo = currentScriptInfos_1[_i]; - var fileInfo = this.getOrCreateFileInfo(scriptInfo.path); - this.updateFileReferences(fileInfo); - } - this.forEachFileInfo(function (fileInfo) { - if (!_this.project.containsScriptInfo(fileInfo.scriptInfo)) { - fileInfo.removeFileReferences(); - _this.removeFileInfo(fileInfo.scriptInfo.path); - } - }); - this.projectVersionForDependencyGraph = this.project.getProjectVersion(); - } - }; - ModuleBuilder.prototype.updateFileReferences = function (fileInfo) { - if (fileInfo.scriptVersionForReferences === fileInfo.scriptInfo.getLatestVersion()) { - return; - } - var newReferences = this.getReferencedFileInfos(fileInfo); - var oldReferences = fileInfo.references; - var oldIndex = 0; - var newIndex = 0; - while (oldIndex < oldReferences.length && newIndex < newReferences.length) { - var oldReference = oldReferences[oldIndex]; - var newReference = newReferences[newIndex]; - var compare = ModuleBuilderFileInfo.compareFileInfos(oldReference, newReference); - if (compare < 0) { - oldReference.removeReferencedBy(fileInfo); - oldIndex++; - } - else if (compare > 0) { - newReference.addReferencedBy(fileInfo); - newIndex++; - } - else { - oldIndex++; - newIndex++; - } - } - for (var i = oldIndex; i < oldReferences.length; i++) { - oldReferences[i].removeReferencedBy(fileInfo); - } - for (var i = newIndex; i < newReferences.length; i++) { - newReferences[i].addReferencedBy(fileInfo); - } - fileInfo.references = newReferences; - fileInfo.scriptVersionForReferences = fileInfo.scriptInfo.getLatestVersion(); - }; - ModuleBuilder.prototype.getFilesAffectedBy = function (scriptInfo) { - this.ensureProjectDependencyGraphUpToDate(); - var singleFileResult = scriptInfo.hasMixedContent ? [] : [scriptInfo.fileName]; - var fileInfo = this.getFileInfo(scriptInfo.path); - if (!fileInfo || !fileInfo.updateShapeSignature()) { - return singleFileResult; - } - if (!fileInfo.isExternalModuleOrHasOnlyAmbientExternalModules()) { - return this.project.getAllEmittableFiles(); - } - var options = this.project.getCompilerOptions(); - if (options && (options.isolatedModules || options.out || options.outFile)) { - return singleFileResult; - } - var queue = fileInfo.referencedBy.slice(0); - var fileNameSet = ts.createMap(); - fileNameSet[scriptInfo.fileName] = scriptInfo; - while (queue.length > 0) { - var processingFileInfo = queue.pop(); - if (processingFileInfo.updateShapeSignature() && processingFileInfo.referencedBy.length > 0) { - for (var _i = 0, _a = processingFileInfo.referencedBy; _i < _a.length; _i++) { - var potentialFileInfo = _a[_i]; - if (!fileNameSet[potentialFileInfo.scriptInfo.fileName]) { - queue.push(potentialFileInfo); - } - } - } - fileNameSet[processingFileInfo.scriptInfo.fileName] = processingFileInfo.scriptInfo; - } - var result = []; - for (var fileName in fileNameSet) { - if (shouldEmitFile(fileNameSet[fileName])) { - result.push(fileName); - } - } - return result; - }; - return ModuleBuilder; - }(AbstractBuilder)); - function createBuilder(project) { - var moduleKind = project.getCompilerOptions().module; - switch (moduleKind) { - case ts.ModuleKind.None: - return new NonModuleBuilder(project); - default: - return new ModuleBuilder(project); - } - } - server.createBuilder = createBuilder; - })(server = ts.server || (ts.server = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var server; - (function (server) { - var ProjectKind; - (function (ProjectKind) { - ProjectKind[ProjectKind["Inferred"] = 0] = "Inferred"; - ProjectKind[ProjectKind["Configured"] = 1] = "Configured"; - ProjectKind[ProjectKind["External"] = 2] = "External"; - })(ProjectKind = server.ProjectKind || (server.ProjectKind = {})); - function remove(items, item) { - var index = items.indexOf(item); - if (index >= 0) { - items.splice(index, 1); - } - } - function countEachFileTypes(infos) { - var result = { js: 0, jsx: 0, ts: 0, tsx: 0, dts: 0 }; - for (var _i = 0, infos_1 = infos; _i < infos_1.length; _i++) { - var info = infos_1[_i]; - switch (info.scriptKind) { - case 1: - result.js += 1; - break; - case 2: - result.jsx += 1; - break; - case 3: - ts.fileExtensionIs(info.fileName, ".d.ts") - ? result.dts += 1 - : result.ts += 1; - break; - case 4: - result.tsx += 1; - break; - } - } - return result; - } - function hasOneOrMoreJsAndNoTsFiles(project) { - var counts = countEachFileTypes(project.getScriptInfos()); - return counts.js > 0 && counts.ts === 0 && counts.tsx === 0; - } - function allRootFilesAreJsOrDts(project) { - var counts = countEachFileTypes(project.getRootScriptInfos()); - return counts.ts === 0 && counts.tsx === 0; - } - server.allRootFilesAreJsOrDts = allRootFilesAreJsOrDts; - function allFilesAreJsOrDts(project) { - var counts = countEachFileTypes(project.getScriptInfos()); - return counts.ts === 0 && counts.tsx === 0; - } - server.allFilesAreJsOrDts = allFilesAreJsOrDts; - var UnresolvedImportsMap = (function () { - function UnresolvedImportsMap() { - this.perFileMap = ts.createFileMap(); - this.version = 0; - } - UnresolvedImportsMap.prototype.clear = function () { - this.perFileMap.clear(); - this.version = 0; - }; - UnresolvedImportsMap.prototype.getVersion = function () { - return this.version; - }; - UnresolvedImportsMap.prototype.remove = function (path) { - this.perFileMap.remove(path); - this.version++; - }; - UnresolvedImportsMap.prototype.get = function (path) { - return this.perFileMap.get(path); - }; - UnresolvedImportsMap.prototype.set = function (path, value) { - this.perFileMap.set(path, value); - this.version++; - }; - return UnresolvedImportsMap; - }()); - server.UnresolvedImportsMap = UnresolvedImportsMap; - var emptyResult = []; - var getEmptyResult = function () { return emptyResult; }; - var getUndefined = function () { return undefined; }; - var emptyEncodedSemanticClassifications = { spans: emptyResult, endOfLineState: 0 }; - function createNoSemanticFeaturesWrapper(realLanguageService) { - return { - cleanupSemanticCache: ts.noop, - getSyntacticDiagnostics: function (fileName) { - return fileName ? realLanguageService.getSyntacticDiagnostics(fileName) : emptyResult; - }, - getSemanticDiagnostics: getEmptyResult, - getCompilerOptionsDiagnostics: function () { - return realLanguageService.getCompilerOptionsDiagnostics(); - }, - getSyntacticClassifications: function (fileName, span) { - return realLanguageService.getSyntacticClassifications(fileName, span); - }, - getEncodedSyntacticClassifications: function (fileName, span) { - return realLanguageService.getEncodedSyntacticClassifications(fileName, span); - }, - getSemanticClassifications: getEmptyResult, - getEncodedSemanticClassifications: function () { - return emptyEncodedSemanticClassifications; - }, - getCompletionsAtPosition: getUndefined, - findReferences: getEmptyResult, - getCompletionEntryDetails: getUndefined, - getQuickInfoAtPosition: getUndefined, - findRenameLocations: getEmptyResult, - getNameOrDottedNameSpan: function (fileName, startPos, endPos) { - return realLanguageService.getNameOrDottedNameSpan(fileName, startPos, endPos); - }, - getBreakpointStatementAtPosition: function (fileName, position) { - return realLanguageService.getBreakpointStatementAtPosition(fileName, position); - }, - getBraceMatchingAtPosition: function (fileName, position) { - return realLanguageService.getBraceMatchingAtPosition(fileName, position); - }, - getSignatureHelpItems: getUndefined, - getDefinitionAtPosition: getEmptyResult, - getRenameInfo: function () { return ({ - canRename: false, - localizedErrorMessage: ts.getLocaleSpecificMessage(ts.Diagnostics.Language_service_is_disabled), - displayName: undefined, - fullDisplayName: undefined, - kind: undefined, - kindModifiers: undefined, - triggerSpan: undefined - }); }, - getTypeDefinitionAtPosition: getUndefined, - getReferencesAtPosition: getEmptyResult, - getDocumentHighlights: getEmptyResult, - getOccurrencesAtPosition: getEmptyResult, - getNavigateToItems: getEmptyResult, - getNavigationBarItems: function (fileName) { - return realLanguageService.getNavigationBarItems(fileName); - }, - getNavigationTree: function (fileName) { - return realLanguageService.getNavigationTree(fileName); - }, - getOutliningSpans: function (fileName) { - return realLanguageService.getOutliningSpans(fileName); - }, - getTodoComments: getEmptyResult, - getIndentationAtPosition: function (fileName, position, options) { - return realLanguageService.getIndentationAtPosition(fileName, position, options); - }, - getFormattingEditsForRange: function (fileName, start, end, options) { - return realLanguageService.getFormattingEditsForRange(fileName, start, end, options); - }, - getFormattingEditsForDocument: function (fileName, options) { - return realLanguageService.getFormattingEditsForDocument(fileName, options); - }, - getFormattingEditsAfterKeystroke: function (fileName, position, key, options) { - return realLanguageService.getFormattingEditsAfterKeystroke(fileName, position, key, options); - }, - getDocCommentTemplateAtPosition: function (fileName, position) { - return realLanguageService.getDocCommentTemplateAtPosition(fileName, position); - }, - isValidBraceCompletionAtPosition: function (fileName, position, openingBrace) { - return realLanguageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace); - }, - getEmitOutput: getUndefined, - getProgram: function () { - return realLanguageService.getProgram(); - }, - getNonBoundSourceFile: function (fileName) { - return realLanguageService.getNonBoundSourceFile(fileName); - }, - dispose: function () { - return realLanguageService.dispose(); - }, - getCompletionEntrySymbol: getUndefined, - getImplementationAtPosition: getEmptyResult, - getSourceFile: function (fileName) { - return realLanguageService.getSourceFile(fileName); - }, - getCodeFixesAtPosition: getEmptyResult - }; - } - server.createNoSemanticFeaturesWrapper = createNoSemanticFeaturesWrapper; - var Project = (function () { - function Project(projectName, projectKind, projectService, documentRegistry, hasExplicitListOfFiles, languageServiceEnabled, compilerOptions, compileOnSaveEnabled) { - this.projectName = projectName; - this.projectKind = projectKind; - this.projectService = projectService; - this.documentRegistry = documentRegistry; - this.compilerOptions = compilerOptions; - this.compileOnSaveEnabled = compileOnSaveEnabled; - this.rootFiles = []; - this.rootFilesMap = ts.createFileMap(); - this.cachedUnresolvedImportsPerFile = new UnresolvedImportsMap(); - this.languageServiceEnabled = true; - this.lastReportedVersion = 0; - this.projectStructureVersion = 0; - this.projectStateVersion = 0; - this.typesVersion = 0; - if (!this.compilerOptions) { - this.compilerOptions = ts.getDefaultCompilerOptions(); - this.compilerOptions.allowNonTsExtensions = true; - this.compilerOptions.allowJs = true; - } - else if (hasExplicitListOfFiles) { - this.compilerOptions.allowNonTsExtensions = true; - } - if (this.projectKind === ProjectKind.Inferred || this.projectKind === ProjectKind.External) { - this.compilerOptions.noEmitForJsFiles = true; - } - this.lsHost = new server.LSHost(this.projectService.host, this, this.projectService.cancellationToken); - this.lsHost.setCompilationSettings(this.compilerOptions); - this.languageService = ts.createLanguageService(this.lsHost, this.documentRegistry); - this.noSemanticFeaturesLanguageService = createNoSemanticFeaturesWrapper(this.languageService); - if (!languageServiceEnabled) { - this.disableLanguageService(); - } - this.builder = server.createBuilder(this); - this.markAsDirty(); - } - Project.prototype.isNonTsProject = function () { - this.updateGraph(); - return allFilesAreJsOrDts(this); - }; - Project.prototype.isJsOnlyProject = function () { - this.updateGraph(); - return hasOneOrMoreJsAndNoTsFiles(this); - }; - Project.prototype.getCachedUnresolvedImportsPerFile_TestOnly = function () { - return this.cachedUnresolvedImportsPerFile; - }; - Project.prototype.getProjectErrors = function () { - return this.projectErrors; - }; - Project.prototype.getLanguageService = function (ensureSynchronized) { - if (ensureSynchronized === void 0) { ensureSynchronized = true; } - if (ensureSynchronized) { - this.updateGraph(); - } - return this.languageServiceEnabled - ? this.languageService - : this.noSemanticFeaturesLanguageService; - }; - Project.prototype.getCompileOnSaveAffectedFileList = function (scriptInfo) { - if (!this.languageServiceEnabled) { - return []; - } - this.updateGraph(); - return this.builder.getFilesAffectedBy(scriptInfo); - }; - Project.prototype.getProjectVersion = function () { - return this.projectStateVersion.toString(); - }; - Project.prototype.enableLanguageService = function () { - if (this.languageServiceEnabled) { - return; - } - this.languageServiceEnabled = true; - this.projectService.onUpdateLanguageServiceStateForProject(this, true); - }; - Project.prototype.disableLanguageService = function () { - if (!this.languageServiceEnabled) { - return; - } - this.languageService.cleanupSemanticCache(); - this.languageServiceEnabled = false; - this.projectService.onUpdateLanguageServiceStateForProject(this, false); - }; - Project.prototype.getProjectName = function () { - return this.projectName; - }; - Project.prototype.getSourceFile = function (path) { - if (!this.program) { - return undefined; - } - return this.program.getSourceFileByPath(path); - }; - Project.prototype.updateTypes = function () { - this.typesVersion++; - this.markAsDirty(); - this.updateGraph(); - }; - Project.prototype.close = function () { - if (this.program) { - for (var _i = 0, _a = this.program.getSourceFiles(); _i < _a.length; _i++) { - var f = _a[_i]; - var info = this.projectService.getScriptInfo(f.fileName); - info.detachFromProject(this); - } - } - else { - for (var _b = 0, _c = this.rootFiles; _b < _c.length; _b++) { - var root = _c[_b]; - root.detachFromProject(this); - } - } - this.rootFiles = undefined; - this.rootFilesMap = undefined; - this.program = undefined; - this.languageService.dispose(); - }; - Project.prototype.getCompilerOptions = function () { - return this.compilerOptions; - }; - Project.prototype.hasRoots = function () { - return this.rootFiles && this.rootFiles.length > 0; - }; - Project.prototype.getRootFiles = function () { - return this.rootFiles && this.rootFiles.map(function (info) { return info.fileName; }); - }; - Project.prototype.getRootFilesLSHost = function () { - var result = []; - if (this.rootFiles) { - for (var _i = 0, _a = this.rootFiles; _i < _a.length; _i++) { - var f = _a[_i]; - result.push(f.fileName); - } - if (this.typingFiles) { - for (var _b = 0, _c = this.typingFiles; _b < _c.length; _b++) { - var f = _c[_b]; - result.push(f); - } - } - } - return result; - }; - Project.prototype.getRootScriptInfos = function () { - return this.rootFiles; - }; - Project.prototype.getScriptInfos = function () { - var _this = this; - return ts.map(this.program.getSourceFiles(), function (sourceFile) { - var scriptInfo = _this.projectService.getScriptInfoForPath(sourceFile.path); - if (!scriptInfo) { - ts.Debug.assert(false, "scriptInfo for a file '" + sourceFile.fileName + "' is missing."); - } - return scriptInfo; - }); - }; - Project.prototype.getFileEmitOutput = function (info, emitOnlyDtsFiles) { - if (!this.languageServiceEnabled) { - return undefined; - } - return this.getLanguageService().getEmitOutput(info.fileName, emitOnlyDtsFiles); - }; - Project.prototype.getFileNames = function (excludeFilesFromExternalLibraries) { - if (!this.program) { - return []; - } - if (!this.languageServiceEnabled) { - var rootFiles = this.getRootFiles(); - if (this.compilerOptions) { - var defaultLibrary = ts.getDefaultLibFilePath(this.compilerOptions); - if (defaultLibrary) { - (rootFiles || (rootFiles = [])).push(server.asNormalizedPath(defaultLibrary)); - } - } - return rootFiles; - } - var result = []; - for (var _i = 0, _a = this.program.getSourceFiles(); _i < _a.length; _i++) { - var f = _a[_i]; - if (excludeFilesFromExternalLibraries && this.program.isSourceFileFromExternalLibrary(f)) { - continue; - } - result.push(server.asNormalizedPath(f.fileName)); - } - return result; - }; - Project.prototype.getAllEmittableFiles = function () { - if (!this.languageServiceEnabled) { - return []; - } - var defaultLibraryFileName = ts.getDefaultLibFileName(this.compilerOptions); - var infos = this.getScriptInfos(); - var result = []; - for (var _i = 0, infos_2 = infos; _i < infos_2.length; _i++) { - var info = infos_2[_i]; - if (ts.getBaseFileName(info.fileName) !== defaultLibraryFileName && server.shouldEmitFile(info)) { - result.push(info.fileName); - } - } - return result; - }; - Project.prototype.containsScriptInfo = function (info) { - return this.isRoot(info) || (this.program && this.program.getSourceFileByPath(info.path) !== undefined); - }; - Project.prototype.containsFile = function (filename, requireOpen) { - var info = this.projectService.getScriptInfoForNormalizedPath(filename); - if (info && (info.isOpen || !requireOpen)) { - return this.containsScriptInfo(info); - } - }; - Project.prototype.isRoot = function (info) { - return this.rootFilesMap && this.rootFilesMap.contains(info.path); - }; - Project.prototype.addRoot = function (info) { - if (!this.isRoot(info)) { - this.rootFiles.push(info); - this.rootFilesMap.set(info.path, info); - info.attachToProject(this); - this.markAsDirty(); - } - }; - Project.prototype.removeFile = function (info, detachFromProject) { - if (detachFromProject === void 0) { detachFromProject = true; } - this.removeRootFileIfNecessary(info); - this.lsHost.notifyFileRemoved(info); - this.cachedUnresolvedImportsPerFile.remove(info.path); - if (detachFromProject) { - info.detachFromProject(this); - } - this.markAsDirty(); - }; - Project.prototype.markAsDirty = function () { - this.projectStateVersion++; - }; - Project.prototype.extractUnresolvedImportsFromSourceFile = function (file, result) { - var cached = this.cachedUnresolvedImportsPerFile.get(file.path); - if (cached) { - for (var _i = 0, cached_1 = cached; _i < cached_1.length; _i++) { - var f = cached_1[_i]; - result.push(f); - } - return; - } - var unresolvedImports; - if (file.resolvedModules) { - for (var name_50 in file.resolvedModules) { - if (!file.resolvedModules[name_50] && !ts.isExternalModuleNameRelative(name_50)) { - var trimmed = name_50.trim(); - var i = trimmed.indexOf("/"); - if (i !== -1 && trimmed.charCodeAt(0) === 64) { - i = trimmed.indexOf("/", i + 1); - } - if (i !== -1) { - trimmed = trimmed.substr(0, i); - } - (unresolvedImports || (unresolvedImports = [])).push(trimmed); - result.push(trimmed); - } - } - } - this.cachedUnresolvedImportsPerFile.set(file.path, unresolvedImports || server.emptyArray); - }; - Project.prototype.updateGraph = function () { - if (!this.languageServiceEnabled) { - return true; - } - this.lsHost.startRecordingFilesWithChangedResolutions(); - var hasChanges = this.updateGraphWorker(); - var changedFiles = this.lsHost.finishRecordingFilesWithChangedResolutions() || server.emptyArray; - for (var _i = 0, changedFiles_1 = changedFiles; _i < changedFiles_1.length; _i++) { - var file = changedFiles_1[_i]; - this.cachedUnresolvedImportsPerFile.remove(file); - } - var unresolvedImports; - if (hasChanges || changedFiles.length) { - var result = []; - for (var _a = 0, _b = this.program.getSourceFiles(); _a < _b.length; _a++) { - var sourceFile = _b[_a]; - this.extractUnresolvedImportsFromSourceFile(sourceFile, result); - } - this.lastCachedUnresolvedImportsList = server.toSortedReadonlyArray(result); - } - unresolvedImports = this.lastCachedUnresolvedImportsList; - var cachedTypings = this.projectService.typingsCache.getTypingsForProject(this, unresolvedImports, hasChanges); - if (this.setTypings(cachedTypings)) { - hasChanges = this.updateGraphWorker() || hasChanges; - } - if (hasChanges) { - this.projectStructureVersion++; - } - return !hasChanges; - }; - Project.prototype.setTypings = function (typings) { - if (ts.arrayIsEqualTo(this.typingFiles, typings)) { - return false; - } - this.typingFiles = typings; - this.markAsDirty(); - return true; - }; - Project.prototype.updateGraphWorker = function () { - var oldProgram = this.program; - this.program = this.languageService.getProgram(); - var hasChanges = false; - if (!oldProgram || (this.program !== oldProgram && !oldProgram.structureIsReused)) { - hasChanges = true; - if (oldProgram) { - for (var _i = 0, _a = oldProgram.getSourceFiles(); _i < _a.length; _i++) { - var f = _a[_i]; - if (this.program.getSourceFileByPath(f.path)) { - continue; - } - var scriptInfoToDetach = this.projectService.getScriptInfo(f.fileName); - if (scriptInfoToDetach) { - scriptInfoToDetach.detachFromProject(this); - } - } - } - } - this.builder.onProjectUpdateGraph(); - return hasChanges; - }; - Project.prototype.getScriptInfoLSHost = function (fileName) { - var scriptInfo = this.projectService.getOrCreateScriptInfo(fileName, false); - if (scriptInfo) { - scriptInfo.attachToProject(this); - } - return scriptInfo; - }; - Project.prototype.getScriptInfoForNormalizedPath = function (fileName) { - var scriptInfo = this.projectService.getOrCreateScriptInfoForNormalizedPath(fileName, false); - if (scriptInfo && !scriptInfo.isAttached(this)) { - return server.Errors.ThrowProjectDoesNotContainDocument(fileName, this); - } - return scriptInfo; - }; - Project.prototype.getScriptInfo = function (uncheckedFileName) { - return this.getScriptInfoForNormalizedPath(server.toNormalizedPath(uncheckedFileName)); - }; - Project.prototype.filesToString = function () { - if (!this.program) { - return ""; - } - var strBuilder = ""; - for (var _i = 0, _a = this.program.getSourceFiles(); _i < _a.length; _i++) { - var file = _a[_i]; - strBuilder += file.fileName + "\n"; - } - return strBuilder; - }; - Project.prototype.setCompilerOptions = function (compilerOptions) { - if (compilerOptions) { - if (this.projectKind === ProjectKind.Inferred) { - compilerOptions.allowJs = true; - } - compilerOptions.allowNonTsExtensions = true; - if (ts.changesAffectModuleResolution(this.compilerOptions, compilerOptions)) { - this.cachedUnresolvedImportsPerFile.clear(); - this.lastCachedUnresolvedImportsList = undefined; - } - this.compilerOptions = compilerOptions; - this.lsHost.setCompilationSettings(compilerOptions); - this.markAsDirty(); - } - }; - Project.prototype.reloadScript = function (filename, tempFileName) { - var script = this.projectService.getScriptInfoForNormalizedPath(filename); - if (script) { - ts.Debug.assert(script.isAttached(this)); - script.reloadFromFile(tempFileName); - return true; - } - return false; - }; - Project.prototype.getChangesSinceVersion = function (lastKnownVersion) { - this.updateGraph(); - var info = { - projectName: this.getProjectName(), - version: this.projectStructureVersion, - isInferred: this.projectKind === ProjectKind.Inferred, - options: this.getCompilerOptions() - }; - if (this.lastReportedFileNames && lastKnownVersion === this.lastReportedVersion) { - if (this.projectStructureVersion == this.lastReportedVersion) { - return { info: info, projectErrors: this.projectErrors }; - } - var lastReportedFileNames = this.lastReportedFileNames; - var currentFiles = ts.arrayToMap(this.getFileNames(), function (x) { return x; }); - var added = []; - var removed = []; - for (var id in currentFiles) { - if (!ts.hasProperty(lastReportedFileNames, id)) { - added.push(id); - } - } - for (var id in lastReportedFileNames) { - if (!ts.hasProperty(currentFiles, id)) { - removed.push(id); - } - } - this.lastReportedFileNames = currentFiles; - this.lastReportedVersion = this.projectStructureVersion; - return { info: info, changes: { added: added, removed: removed }, projectErrors: this.projectErrors }; - } - else { - var projectFileNames = this.getFileNames(); - this.lastReportedFileNames = ts.arrayToMap(projectFileNames, function (x) { return x; }); - this.lastReportedVersion = this.projectStructureVersion; - return { info: info, files: projectFileNames, projectErrors: this.projectErrors }; - } - }; - Project.prototype.getReferencedFiles = function (path) { - var _this = this; - if (!this.languageServiceEnabled) { - return []; - } - var sourceFile = this.getSourceFile(path); - if (!sourceFile) { - return []; - } - var referencedFiles = ts.createMap(); - if (sourceFile.imports && sourceFile.imports.length > 0) { - var checker = this.program.getTypeChecker(); - for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { - var importName = _a[_i]; - var symbol = checker.getSymbolAtLocation(importName); - if (symbol && symbol.declarations && symbol.declarations[0]) { - var declarationSourceFile = symbol.declarations[0].getSourceFile(); - if (declarationSourceFile) { - referencedFiles[declarationSourceFile.path] = true; - } - } - } - } - var currentDirectory = ts.getDirectoryPath(path); - var getCanonicalFileName = ts.createGetCanonicalFileName(this.projectService.host.useCaseSensitiveFileNames); - if (sourceFile.referencedFiles && sourceFile.referencedFiles.length > 0) { - for (var _b = 0, _c = sourceFile.referencedFiles; _b < _c.length; _b++) { - var referencedFile = _c[_b]; - var referencedPath = ts.toPath(referencedFile.fileName, currentDirectory, getCanonicalFileName); - referencedFiles[referencedPath] = true; - } - } - if (sourceFile.resolvedTypeReferenceDirectiveNames) { - for (var typeName in sourceFile.resolvedTypeReferenceDirectiveNames) { - var resolvedTypeReferenceDirective = sourceFile.resolvedTypeReferenceDirectiveNames[typeName]; - if (!resolvedTypeReferenceDirective) { - continue; - } - var fileName = resolvedTypeReferenceDirective.resolvedFileName; - var typeFilePath = ts.toPath(fileName, currentDirectory, getCanonicalFileName); - referencedFiles[typeFilePath] = true; - } - } - var allFileNames = ts.map(Object.keys(referencedFiles), function (key) { return key; }); - return ts.filter(allFileNames, function (file) { return _this.projectService.host.fileExists(file); }); - }; - Project.prototype.removeRootFileIfNecessary = function (info) { - if (this.isRoot(info)) { - remove(this.rootFiles, info); - this.rootFilesMap.remove(info.path); - } - }; - return Project; - }()); - server.Project = Project; - var InferredProject = (function (_super) { - __extends(InferredProject, _super); - function InferredProject(projectService, documentRegistry, compilerOptions) { - var _this = _super.call(this, InferredProject.newName(), ProjectKind.Inferred, projectService, documentRegistry, undefined, true, compilerOptions, false) || this; - _this.directoriesWatchedForTsconfig = []; - return _this; - } - InferredProject.prototype.getProjectRootPath = function () { - if (this.projectService.useSingleInferredProject) { - return undefined; - } - var rootFiles = this.getRootFiles(); - return ts.getDirectoryPath(rootFiles[0]); - }; - InferredProject.prototype.close = function () { - _super.prototype.close.call(this); - for (var _i = 0, _a = this.directoriesWatchedForTsconfig; _i < _a.length; _i++) { - var directory = _a[_i]; - this.projectService.stopWatchingDirectory(directory); - } - }; - InferredProject.prototype.getTypeAcquisition = function () { - return { - enable: allRootFilesAreJsOrDts(this), - include: [], - exclude: [] - }; - }; - return InferredProject; - }(Project)); - InferredProject.newName = (function () { - var nextId = 1; - return function () { - var id = nextId; - nextId++; - return server.makeInferredProjectName(id); - }; - })(); - server.InferredProject = InferredProject; - var ConfiguredProject = (function (_super) { - __extends(ConfiguredProject, _super); - function ConfiguredProject(configFileName, projectService, documentRegistry, hasExplicitListOfFiles, compilerOptions, wildcardDirectories, languageServiceEnabled, compileOnSaveEnabled) { - var _this = _super.call(this, configFileName, ProjectKind.Configured, projectService, documentRegistry, hasExplicitListOfFiles, languageServiceEnabled, compilerOptions, compileOnSaveEnabled) || this; - _this.wildcardDirectories = wildcardDirectories; - _this.compileOnSaveEnabled = compileOnSaveEnabled; - _this.openRefCount = 0; - _this.canonicalConfigFilePath = server.asNormalizedPath(projectService.toCanonicalFileName(configFileName)); - return _this; - } - ConfiguredProject.prototype.getConfigFilePath = function () { - return this.getProjectName(); - }; - ConfiguredProject.prototype.getProjectRootPath = function () { - return ts.getDirectoryPath(this.getConfigFilePath()); - }; - ConfiguredProject.prototype.setProjectErrors = function (projectErrors) { - this.projectErrors = projectErrors; - }; - ConfiguredProject.prototype.setTypeAcquisition = function (newTypeAcquisition) { - this.typeAcquisition = newTypeAcquisition; - }; - ConfiguredProject.prototype.getTypeAcquisition = function () { - return this.typeAcquisition; - }; - ConfiguredProject.prototype.watchConfigFile = function (callback) { - var _this = this; - this.projectFileWatcher = this.projectService.host.watchFile(this.getConfigFilePath(), function (_) { return callback(_this); }); - }; - ConfiguredProject.prototype.watchTypeRoots = function (callback) { - var _this = this; - var roots = this.getEffectiveTypeRoots(); - var watchers = []; - for (var _i = 0, roots_1 = roots; _i < roots_1.length; _i++) { - var root = roots_1[_i]; - this.projectService.logger.info("Add type root watcher for: " + root); - watchers.push(this.projectService.host.watchDirectory(root, function (path) { return callback(_this, path); }, false)); - } - this.typeRootsWatchers = watchers; - }; - ConfiguredProject.prototype.watchConfigDirectory = function (callback) { - var _this = this; - if (this.directoryWatcher) { - return; - } - var directoryToWatch = ts.getDirectoryPath(this.getConfigFilePath()); - this.projectService.logger.info("Add recursive watcher for: " + directoryToWatch); - this.directoryWatcher = this.projectService.host.watchDirectory(directoryToWatch, function (path) { return callback(_this, path); }, true); - }; - ConfiguredProject.prototype.watchWildcards = function (callback) { - var _this = this; - if (!this.wildcardDirectories) { - return; - } - var configDirectoryPath = ts.getDirectoryPath(this.getConfigFilePath()); - this.directoriesWatchedForWildcards = ts.reduceProperties(this.wildcardDirectories, function (watchers, flag, directory) { - if (ts.comparePaths(configDirectoryPath, directory, ".", !_this.projectService.host.useCaseSensitiveFileNames) !== 0) { - var recursive = (flag & 1) !== 0; - _this.projectService.logger.info("Add " + (recursive ? "recursive " : "") + "watcher for: " + directory); - watchers[directory] = _this.projectService.host.watchDirectory(directory, function (path) { return callback(_this, path); }, recursive); - } - return watchers; - }, {}); - }; - ConfiguredProject.prototype.stopWatchingDirectory = function () { - if (this.directoryWatcher) { - this.directoryWatcher.close(); - this.directoryWatcher = undefined; - } - }; - ConfiguredProject.prototype.close = function () { - _super.prototype.close.call(this); - if (this.projectFileWatcher) { - this.projectFileWatcher.close(); - } - if (this.typeRootsWatchers) { - for (var _i = 0, _a = this.typeRootsWatchers; _i < _a.length; _i++) { - var watcher = _a[_i]; - watcher.close(); - } - this.typeRootsWatchers = undefined; - } - for (var id in this.directoriesWatchedForWildcards) { - this.directoriesWatchedForWildcards[id].close(); - } - this.directoriesWatchedForWildcards = undefined; - this.stopWatchingDirectory(); - }; - ConfiguredProject.prototype.addOpenRef = function () { - this.openRefCount++; - }; - ConfiguredProject.prototype.deleteOpenRef = function () { - this.openRefCount--; - return this.openRefCount; - }; - ConfiguredProject.prototype.getEffectiveTypeRoots = function () { - return ts.getEffectiveTypeRoots(this.getCompilerOptions(), this.projectService.host) || []; - }; - return ConfiguredProject; - }(Project)); - server.ConfiguredProject = ConfiguredProject; - var ExternalProject = (function (_super) { - __extends(ExternalProject, _super); - function ExternalProject(externalProjectName, projectService, documentRegistry, compilerOptions, languageServiceEnabled, compileOnSaveEnabled, projectFilePath) { - var _this = _super.call(this, externalProjectName, ProjectKind.External, projectService, documentRegistry, true, languageServiceEnabled, compilerOptions, compileOnSaveEnabled) || this; - _this.compileOnSaveEnabled = compileOnSaveEnabled; - _this.projectFilePath = projectFilePath; - return _this; - } - ExternalProject.prototype.getProjectRootPath = function () { - if (this.projectFilePath) { - return ts.getDirectoryPath(this.projectFilePath); - } - return ts.getDirectoryPath(ts.normalizeSlashes(this.getProjectName())); - }; - ExternalProject.prototype.getTypeAcquisition = function () { - return this.typeAcquisition; - }; - ExternalProject.prototype.setProjectErrors = function (projectErrors) { - this.projectErrors = projectErrors; - }; - ExternalProject.prototype.setTypeAcquisition = function (newTypeAcquisition) { - if (!newTypeAcquisition) { - newTypeAcquisition = { - enable: allRootFilesAreJsOrDts(this), - include: [], - exclude: [] - }; - } - else { - if (newTypeAcquisition.enable === undefined) { - newTypeAcquisition.enable = allRootFilesAreJsOrDts(this); - } - if (!newTypeAcquisition.include) { - newTypeAcquisition.include = []; - } - if (!newTypeAcquisition.exclude) { - newTypeAcquisition.exclude = []; - } - } - this.typeAcquisition = newTypeAcquisition; - }; - return ExternalProject; - }(Project)); - server.ExternalProject = ExternalProject; - })(server = ts.server || (ts.server = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var server; - (function (server) { - server.maxProgramSizeForNonTsFiles = 20 * 1024 * 1024; - server.ContextEvent = "context"; - server.ConfigFileDiagEvent = "configFileDiag"; - server.ProjectLanguageServiceStateEvent = "projectLanguageServiceState"; - function prepareConvertersForEnumLikeCompilerOptions(commandLineOptions) { - var map = ts.createMap(); - for (var _i = 0, commandLineOptions_1 = commandLineOptions; _i < commandLineOptions_1.length; _i++) { - var option = commandLineOptions_1[_i]; - if (typeof option.type === "object") { - var optionMap = option.type; - for (var id in optionMap) { - ts.Debug.assert(typeof optionMap[id] === "number"); - } - map[option.name] = optionMap; - } - } - return map; - } - var compilerOptionConverters = prepareConvertersForEnumLikeCompilerOptions(ts.optionDeclarations); - var indentStyle = ts.createMap({ - "none": ts.IndentStyle.None, - "block": ts.IndentStyle.Block, - "smart": ts.IndentStyle.Smart - }); - function convertFormatOptions(protocolOptions) { - if (typeof protocolOptions.indentStyle === "string") { - protocolOptions.indentStyle = indentStyle[protocolOptions.indentStyle.toLowerCase()]; - ts.Debug.assert(protocolOptions.indentStyle !== undefined); - } - return protocolOptions; - } - server.convertFormatOptions = convertFormatOptions; - function convertCompilerOptions(protocolOptions) { - for (var id in compilerOptionConverters) { - var propertyValue = protocolOptions[id]; - if (typeof propertyValue === "string") { - var mappedValues = compilerOptionConverters[id]; - protocolOptions[id] = mappedValues[propertyValue.toLowerCase()]; - } - } - return protocolOptions; - } - server.convertCompilerOptions = convertCompilerOptions; - function tryConvertScriptKindName(scriptKindName) { - return typeof scriptKindName === "string" - ? convertScriptKindName(scriptKindName) - : scriptKindName; - } - server.tryConvertScriptKindName = tryConvertScriptKindName; - function convertScriptKindName(scriptKindName) { - switch (scriptKindName) { - case "JS": - return 1; - case "JSX": - return 2; - case "TS": - return 3; - case "TSX": - return 4; - default: - return 0; - } - } - server.convertScriptKindName = convertScriptKindName; - function combineProjectOutput(projects, action, comparer, areEqual) { - var result = projects.reduce(function (previous, current) { return ts.concatenate(previous, action(current)); }, []).sort(comparer); - return projects.length > 1 ? ts.deduplicate(result, areEqual) : result; - } - server.combineProjectOutput = combineProjectOutput; - var fileNamePropertyReader = { - getFileName: function (x) { return x; }, - getScriptKind: function (_) { return undefined; }, - hasMixedContent: function (_) { return false; } - }; - var externalFilePropertyReader = { - getFileName: function (x) { return x.fileName; }, - getScriptKind: function (x) { return tryConvertScriptKindName(x.scriptKind); }, - hasMixedContent: function (x) { return x.hasMixedContent; } - }; - function findProjectByName(projectName, projects) { - for (var _i = 0, projects_1 = projects; _i < projects_1.length; _i++) { - var proj = projects_1[_i]; - if (proj.getProjectName() === projectName) { - return proj; - } - } - } - function createFileNotFoundDiagnostic(fileName) { - return ts.createCompilerDiagnostic(ts.Diagnostics.File_0_not_found, fileName); - } - function isRootFileInInferredProject(info) { - if (info.containingProjects.length === 0) { - return false; - } - return info.containingProjects[0].projectKind === server.ProjectKind.Inferred && info.containingProjects[0].isRoot(info); - } - var DirectoryWatchers = (function () { - function DirectoryWatchers(projectService) { - this.projectService = projectService; - this.directoryWatchersForTsconfig = ts.createMap(); - this.directoryWatchersRefCount = ts.createMap(); - } - DirectoryWatchers.prototype.stopWatchingDirectory = function (directory) { - this.directoryWatchersRefCount[directory]--; - if (this.directoryWatchersRefCount[directory] === 0) { - this.projectService.logger.info("Close directory watcher for: " + directory); - this.directoryWatchersForTsconfig[directory].close(); - delete this.directoryWatchersForTsconfig[directory]; - } - }; - DirectoryWatchers.prototype.startWatchingContainingDirectoriesForFile = function (fileName, project, callback) { - var currentPath = ts.getDirectoryPath(fileName); - var parentPath = ts.getDirectoryPath(currentPath); - while (currentPath != parentPath) { - if (!this.directoryWatchersForTsconfig[currentPath]) { - this.projectService.logger.info("Add watcher for: " + currentPath); - this.directoryWatchersForTsconfig[currentPath] = this.projectService.host.watchDirectory(currentPath, callback); - this.directoryWatchersRefCount[currentPath] = 1; - } - else { - this.directoryWatchersRefCount[currentPath] += 1; - } - project.directoriesWatchedForTsconfig.push(currentPath); - currentPath = parentPath; - parentPath = ts.getDirectoryPath(parentPath); - } - }; - return DirectoryWatchers; - }()); - var ProjectService = (function () { - function ProjectService(host, logger, cancellationToken, useSingleInferredProject, typingsInstaller, eventHandler) { - if (typingsInstaller === void 0) { typingsInstaller = server.nullTypingsInstaller; } - this.host = host; - this.logger = logger; - this.cancellationToken = cancellationToken; - this.useSingleInferredProject = useSingleInferredProject; - this.typingsInstaller = typingsInstaller; - this.eventHandler = eventHandler; - this.filenameToScriptInfo = ts.createFileMap(); - this.externalProjectToConfiguredProjectMap = ts.createMap(); - this.externalProjects = []; - this.inferredProjects = []; - this.configuredProjects = []; - this.openFiles = []; - ts.Debug.assert(!!host.createHash, "'ServerHost.createHash' is required for ProjectService"); - this.toCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames); - this.directoryWatchers = new DirectoryWatchers(this); - this.throttledOperations = new server.ThrottledOperations(host); - this.typingsInstaller.attach(this); - this.typingsCache = new server.TypingsCache(this.typingsInstaller); - this.hostConfiguration = { - formatCodeOptions: server.getDefaultFormatCodeSettings(this.host), - hostInfo: "Unknown host" - }; - this.documentRegistry = ts.createDocumentRegistry(host.useCaseSensitiveFileNames, host.getCurrentDirectory()); - } - ProjectService.prototype.getChangedFiles_TestOnly = function () { - return this.changedFiles; - }; - ProjectService.prototype.ensureInferredProjectsUpToDate_TestOnly = function () { - this.ensureInferredProjectsUpToDate(); - }; - ProjectService.prototype.getCompilerOptionsForInferredProjects = function () { - return this.compilerOptionsForInferredProjects; - }; - ProjectService.prototype.onUpdateLanguageServiceStateForProject = function (project, languageServiceEnabled) { - if (!this.eventHandler) { - return; - } - this.eventHandler({ - eventName: server.ProjectLanguageServiceStateEvent, - data: { project: project, languageServiceEnabled: languageServiceEnabled } - }); - }; - ProjectService.prototype.updateTypingsForProject = function (response) { - var project = this.findProject(response.projectName); - if (!project) { - return; - } - switch (response.kind) { - case server.ActionSet: - this.typingsCache.updateTypingsForProject(response.projectName, response.compilerOptions, response.typeAcquisition, response.unresolvedImports, response.typings); - break; - case server.ActionInvalidate: - this.typingsCache.deleteTypingsForProject(response.projectName); - break; - } - project.updateGraph(); - }; - ProjectService.prototype.setCompilerOptionsForInferredProjects = function (projectCompilerOptions) { - this.compilerOptionsForInferredProjects = convertCompilerOptions(projectCompilerOptions); - this.compilerOptionsForInferredProjects.allowNonTsExtensions = true; - this.compileOnSaveForInferredProjects = projectCompilerOptions.compileOnSave; - for (var _i = 0, _a = this.inferredProjects; _i < _a.length; _i++) { - var proj = _a[_i]; - proj.setCompilerOptions(this.compilerOptionsForInferredProjects); - proj.compileOnSaveEnabled = projectCompilerOptions.compileOnSave; - } - this.updateProjectGraphs(this.inferredProjects); - }; - ProjectService.prototype.stopWatchingDirectory = function (directory) { - this.directoryWatchers.stopWatchingDirectory(directory); - }; - ProjectService.prototype.findProject = function (projectName) { - if (projectName === undefined) { - return undefined; - } - if (server.isInferredProjectName(projectName)) { - this.ensureInferredProjectsUpToDate(); - return findProjectByName(projectName, this.inferredProjects); - } - return this.findExternalProjectByProjectName(projectName) || this.findConfiguredProjectByProjectName(server.toNormalizedPath(projectName)); - }; - ProjectService.prototype.getDefaultProjectForFile = function (fileName, refreshInferredProjects) { - if (refreshInferredProjects) { - this.ensureInferredProjectsUpToDate(); - } - var scriptInfo = this.getScriptInfoForNormalizedPath(fileName); - return scriptInfo && scriptInfo.getDefaultProject(); - }; - ProjectService.prototype.ensureInferredProjectsUpToDate = function () { - if (this.changedFiles) { - var projectsToUpdate = void 0; - if (this.changedFiles.length === 1) { - projectsToUpdate = this.changedFiles[0].containingProjects; - } - else { - projectsToUpdate = []; - for (var _i = 0, _a = this.changedFiles; _i < _a.length; _i++) { - var f = _a[_i]; - projectsToUpdate = projectsToUpdate.concat(f.containingProjects); - } - } - this.updateProjectGraphs(projectsToUpdate); - this.changedFiles = undefined; - } - }; - ProjectService.prototype.findContainingExternalProject = function (fileName) { - for (var _i = 0, _a = this.externalProjects; _i < _a.length; _i++) { - var proj = _a[_i]; - if (proj.containsFile(fileName)) { - return proj; - } - } - return undefined; - }; - ProjectService.prototype.getFormatCodeOptions = function (file) { - var formatCodeSettings; - if (file) { - var info = this.getScriptInfoForNormalizedPath(file); - if (info) { - formatCodeSettings = info.getFormatCodeSettings(); - } - } - return formatCodeSettings || this.hostConfiguration.formatCodeOptions; - }; - ProjectService.prototype.updateProjectGraphs = function (projects) { - var shouldRefreshInferredProjects = false; - for (var _i = 0, projects_2 = projects; _i < projects_2.length; _i++) { - var p = projects_2[_i]; - if (!p.updateGraph()) { - shouldRefreshInferredProjects = true; - } - } - if (shouldRefreshInferredProjects) { - this.refreshInferredProjects(); - } - }; - ProjectService.prototype.onSourceFileChanged = function (fileName) { - var info = this.getScriptInfoForNormalizedPath(fileName); - if (!info) { - this.logger.info("Error: got watch notification for unknown file: " + fileName); - return; - } - if (!this.host.fileExists(fileName)) { - this.handleDeletedFile(info); - } - else { - if (info && (!info.isOpen)) { - info.reloadFromFile(); - this.updateProjectGraphs(info.containingProjects); - } - } - }; - ProjectService.prototype.handleDeletedFile = function (info) { - this.logger.info(info.fileName + " deleted"); - info.stopWatcher(); - if (!info.isOpen) { - this.filenameToScriptInfo.remove(info.path); - this.lastDeletedFile = info; - var containingProjects = info.containingProjects.slice(); - info.detachAllProjects(); - this.updateProjectGraphs(containingProjects); - this.lastDeletedFile = undefined; - if (!this.eventHandler) { - return; - } - for (var _i = 0, _a = this.openFiles; _i < _a.length; _i++) { - var openFile = _a[_i]; - this.eventHandler({ - eventName: server.ContextEvent, - data: { project: openFile.getDefaultProject(), fileName: openFile.fileName } - }); - } - } - this.printProjects(); - }; - ProjectService.prototype.onTypeRootFileChanged = function (project, fileName) { - var _this = this; - this.logger.info("Type root file " + fileName + " changed"); - this.throttledOperations.schedule(project.getConfigFilePath() + " * type root", 250, function () { - project.updateTypes(); - _this.updateConfiguredProject(project); - _this.refreshInferredProjects(); - }); - }; - ProjectService.prototype.onSourceFileInDirectoryChangedForConfiguredProject = function (project, fileName) { - var _this = this; - if (fileName && !ts.isSupportedSourceFileName(fileName, project.getCompilerOptions())) { - return; - } - this.logger.info("Detected source file changes: " + fileName); - this.throttledOperations.schedule(project.getConfigFilePath(), 250, function () { return _this.handleChangeInSourceFileForConfiguredProject(project, fileName); }); - }; - ProjectService.prototype.handleChangeInSourceFileForConfiguredProject = function (project, triggerFile) { - var _this = this; - var _a = this.convertConfigFileContentToProjectOptions(project.getConfigFilePath()), projectOptions = _a.projectOptions, configFileErrors = _a.configFileErrors; - this.reportConfigFileDiagnostics(project.getProjectName(), configFileErrors, triggerFile); - var newRootFiles = projectOptions.files.map((function (f) { return _this.getCanonicalFileName(f); })); - var currentRootFiles = project.getRootFiles().map((function (f) { return _this.getCanonicalFileName(f); })); - if (!ts.arrayIsEqualTo(currentRootFiles.sort(), newRootFiles.sort())) { - this.logger.info("Updating configured project"); - this.updateConfiguredProject(project); - this.refreshInferredProjects(); - } - }; - ProjectService.prototype.onConfigChangedForConfiguredProject = function (project) { - var configFileName = project.getConfigFilePath(); - this.logger.info("Config file changed: " + configFileName); - var configFileErrors = this.updateConfiguredProject(project); - this.reportConfigFileDiagnostics(configFileName, configFileErrors, configFileName); - this.refreshInferredProjects(); - }; - ProjectService.prototype.onConfigFileAddedForInferredProject = function (fileName) { - if (ts.getBaseFileName(fileName) != "tsconfig.json") { - this.logger.info(fileName + " is not tsconfig.json"); - return; - } - var configFileErrors = this.convertConfigFileContentToProjectOptions(fileName).configFileErrors; - this.reportConfigFileDiagnostics(fileName, configFileErrors, fileName); - this.logger.info("Detected newly added tsconfig file: " + fileName); - this.reloadProjects(); - }; - ProjectService.prototype.getCanonicalFileName = function (fileName) { - var name = this.host.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(); - return ts.normalizePath(name); - }; - ProjectService.prototype.removeProject = function (project) { - this.logger.info("remove project: " + project.getRootFiles().toString()); - project.close(); - switch (project.projectKind) { - case server.ProjectKind.External: - server.removeItemFromSet(this.externalProjects, project); - break; - case server.ProjectKind.Configured: - server.removeItemFromSet(this.configuredProjects, project); - break; - case server.ProjectKind.Inferred: - server.removeItemFromSet(this.inferredProjects, project); - break; - } - }; - ProjectService.prototype.assignScriptInfoToInferredProjectIfNecessary = function (info, addToListOfOpenFiles) { - var externalProject = this.findContainingExternalProject(info.fileName); - if (externalProject) { - if (addToListOfOpenFiles) { - this.openFiles.push(info); - } - return; - } - var foundConfiguredProject = false; - for (var _i = 0, _a = info.containingProjects; _i < _a.length; _i++) { - var p = _a[_i]; - if (p.projectKind === server.ProjectKind.Configured) { - foundConfiguredProject = true; - if (addToListOfOpenFiles) { - (p).addOpenRef(); - } - } - } - if (foundConfiguredProject) { - if (addToListOfOpenFiles) { - this.openFiles.push(info); - } - return; - } - if (info.containingProjects.length === 0) { - var inferredProject = this.createInferredProjectWithRootFileIfNecessary(info); - if (!this.useSingleInferredProject) { - for (var _b = 0, _c = this.openFiles; _b < _c.length; _b++) { - var f = _c[_b]; - if (f.containingProjects.length === 0) { - continue; - } - var defaultProject = f.getDefaultProject(); - if (isRootFileInInferredProject(info) && defaultProject !== inferredProject && inferredProject.containsScriptInfo(f)) { - this.removeProject(defaultProject); - f.attachToProject(inferredProject); - } - } - } - } - if (addToListOfOpenFiles) { - this.openFiles.push(info); - } - }; - ProjectService.prototype.closeOpenFile = function (info) { - info.reloadFromFile(); - server.removeItemFromSet(this.openFiles, info); - info.isOpen = false; - var projectsToRemove; - for (var _i = 0, _a = info.containingProjects; _i < _a.length; _i++) { - var p = _a[_i]; - if (p.projectKind === server.ProjectKind.Configured) { - if (p.deleteOpenRef() === 0) { - (projectsToRemove || (projectsToRemove = [])).push(p); - } - } - else if (p.projectKind === server.ProjectKind.Inferred && p.isRoot(info)) { - (projectsToRemove || (projectsToRemove = [])).push(p); - } - } - if (projectsToRemove) { - for (var _b = 0, projectsToRemove_1 = projectsToRemove; _b < projectsToRemove_1.length; _b++) { - var project = projectsToRemove_1[_b]; - this.removeProject(project); - } - var orphanFiles = void 0; - for (var _c = 0, _d = this.openFiles; _c < _d.length; _c++) { - var f = _d[_c]; - if (f.containingProjects.length === 0) { - (orphanFiles || (orphanFiles = [])).push(f); - } - } - if (orphanFiles) { - for (var _e = 0, orphanFiles_1 = orphanFiles; _e < orphanFiles_1.length; _e++) { - var f = orphanFiles_1[_e]; - this.assignScriptInfoToInferredProjectIfNecessary(f, false); - } - } - } - if (info.containingProjects.length === 0) { - this.filenameToScriptInfo.remove(info.path); - } - }; - ProjectService.prototype.openOrUpdateConfiguredProjectForFile = function (fileName) { - var searchPath = ts.getDirectoryPath(fileName); - this.logger.info("Search path: " + searchPath); - var configFileName = this.findConfigFile(server.asNormalizedPath(searchPath)); - if (!configFileName) { - this.logger.info("No config files found."); - return {}; - } - this.logger.info("Config file name: " + configFileName); - var project = this.findConfiguredProjectByProjectName(configFileName); - if (!project) { - var _a = this.openConfigFile(configFileName, fileName), success = _a.success, errors = _a.errors; - if (!success) { - return { configFileName: configFileName, configFileErrors: errors }; - } - this.logger.info("Opened configuration file " + configFileName); - if (errors && errors.length > 0) { - return { configFileName: configFileName, configFileErrors: errors }; - } - } - else { - this.updateConfiguredProject(project); - } - return { configFileName: configFileName }; - }; - ProjectService.prototype.findConfigFile = function (searchPath) { - while (true) { - var tsconfigFileName = server.asNormalizedPath(ts.combinePaths(searchPath, "tsconfig.json")); - if (this.host.fileExists(tsconfigFileName)) { - return tsconfigFileName; - } - var jsconfigFileName = server.asNormalizedPath(ts.combinePaths(searchPath, "jsconfig.json")); - if (this.host.fileExists(jsconfigFileName)) { - return jsconfigFileName; - } - var parentPath = server.asNormalizedPath(ts.getDirectoryPath(searchPath)); - if (parentPath === searchPath) { - break; - } - searchPath = parentPath; - } - return undefined; - }; - ProjectService.prototype.printProjects = function () { - if (!this.logger.hasLevel(server.LogLevel.verbose)) { - return; - } - this.logger.startGroup(); - var counter = 0; - counter = printProjects(this.logger, this.externalProjects, counter); - counter = printProjects(this.logger, this.configuredProjects, counter); - counter = printProjects(this.logger, this.inferredProjects, counter); - this.logger.info("Open files: "); - for (var _i = 0, _a = this.openFiles; _i < _a.length; _i++) { - var rootFile = _a[_i]; - this.logger.info(rootFile.fileName); - } - this.logger.endGroup(); - function printProjects(logger, projects, counter) { - for (var _i = 0, projects_3 = projects; _i < projects_3.length; _i++) { - var project = projects_3[_i]; - project.updateGraph(); - logger.info("Project '" + project.getProjectName() + "' (" + server.ProjectKind[project.projectKind] + ") " + counter); - logger.info(project.filesToString()); - logger.info("-----------------------------------------------"); - counter++; - } - return counter; - } - }; - ProjectService.prototype.findConfiguredProjectByProjectName = function (configFileName) { - configFileName = server.asNormalizedPath(this.toCanonicalFileName(configFileName)); - for (var _i = 0, _a = this.configuredProjects; _i < _a.length; _i++) { - var proj = _a[_i]; - if (proj.canonicalConfigFilePath === configFileName) { - return proj; - } - } - }; - ProjectService.prototype.findExternalProjectByProjectName = function (projectFileName) { - return findProjectByName(projectFileName, this.externalProjects); - }; - ProjectService.prototype.convertConfigFileContentToProjectOptions = function (configFilename) { - configFilename = ts.normalizePath(configFilename); - var configFileContent = this.host.readFile(configFilename); - var errors; - var result = ts.parseConfigFileTextToJson(configFilename, configFileContent); - var config = result.config; - if (result.error) { - var _a = ts.sanitizeConfigFile(configFilename, configFileContent), sanitizedConfig = _a.configJsonObject, diagnostics = _a.diagnostics; - config = sanitizedConfig; - errors = diagnostics.length ? diagnostics : [result.error]; - } - var parsedCommandLine = ts.parseJsonConfigFileContent(config, this.host, ts.getDirectoryPath(configFilename), {}, configFilename); - if (parsedCommandLine.errors.length) { - errors = ts.concatenate(errors, parsedCommandLine.errors); - } - ts.Debug.assert(!!parsedCommandLine.fileNames); - if (parsedCommandLine.fileNames.length === 0) { - (errors || (errors = [])).push(ts.createCompilerDiagnostic(ts.Diagnostics.The_config_file_0_found_doesn_t_contain_any_source_files, configFilename)); - return { success: false, configFileErrors: errors }; - } - var projectOptions = { - files: parsedCommandLine.fileNames, - compilerOptions: parsedCommandLine.options, - configHasFilesProperty: config["files"] !== undefined, - wildcardDirectories: ts.createMap(parsedCommandLine.wildcardDirectories), - typeAcquisition: parsedCommandLine.typeAcquisition, - compileOnSave: parsedCommandLine.compileOnSave - }; - return { success: true, projectOptions: projectOptions, configFileErrors: errors }; - }; - ProjectService.prototype.exceededTotalSizeLimitForNonTsFiles = function (options, fileNames, propertyReader) { - if (options && options.disableSizeLimit || !this.host.getFileSize) { - return false; - } - var totalNonTsFileSize = 0; - for (var _i = 0, fileNames_3 = fileNames; _i < fileNames_3.length; _i++) { - var f = fileNames_3[_i]; - var fileName = propertyReader.getFileName(f); - if (ts.hasTypeScriptFileExtension(fileName)) { - continue; - } - totalNonTsFileSize += this.host.getFileSize(fileName); - if (totalNonTsFileSize > server.maxProgramSizeForNonTsFiles) { - return true; - } - } - return false; - }; - ProjectService.prototype.createAndAddExternalProject = function (projectFileName, files, options, typeAcquisition) { - var compilerOptions = convertCompilerOptions(options); - var project = new server.ExternalProject(projectFileName, this, this.documentRegistry, compilerOptions, !this.exceededTotalSizeLimitForNonTsFiles(compilerOptions, files, externalFilePropertyReader), options.compileOnSave === undefined ? true : options.compileOnSave); - this.addFilesToProjectAndUpdateGraph(project, files, externalFilePropertyReader, undefined, typeAcquisition, undefined); - this.externalProjects.push(project); - return project; - }; - ProjectService.prototype.reportConfigFileDiagnostics = function (configFileName, diagnostics, triggerFile) { - if (!this.eventHandler) { - return; - } - this.eventHandler({ - eventName: server.ConfigFileDiagEvent, - data: { configFileName: configFileName, diagnostics: diagnostics || [], triggerFile: triggerFile } - }); - }; - ProjectService.prototype.createAndAddConfiguredProject = function (configFileName, projectOptions, configFileErrors, clientFileName) { - var _this = this; - var sizeLimitExceeded = this.exceededTotalSizeLimitForNonTsFiles(projectOptions.compilerOptions, projectOptions.files, fileNamePropertyReader); - var project = new server.ConfiguredProject(configFileName, this, this.documentRegistry, projectOptions.configHasFilesProperty, projectOptions.compilerOptions, projectOptions.wildcardDirectories, !sizeLimitExceeded, projectOptions.compileOnSave === undefined ? false : projectOptions.compileOnSave); - this.addFilesToProjectAndUpdateGraph(project, projectOptions.files, fileNamePropertyReader, clientFileName, projectOptions.typeAcquisition, configFileErrors); - project.watchConfigFile(function (project) { return _this.onConfigChangedForConfiguredProject(project); }); - if (!sizeLimitExceeded) { - this.watchConfigDirectoryForProject(project, projectOptions); - } - project.watchWildcards(function (project, path) { return _this.onSourceFileInDirectoryChangedForConfiguredProject(project, path); }); - project.watchTypeRoots(function (project, path) { return _this.onTypeRootFileChanged(project, path); }); - this.configuredProjects.push(project); - return project; - }; - ProjectService.prototype.watchConfigDirectoryForProject = function (project, options) { - var _this = this; - if (!options.configHasFilesProperty) { - project.watchConfigDirectory(function (project, path) { return _this.onSourceFileInDirectoryChangedForConfiguredProject(project, path); }); - } - }; - ProjectService.prototype.addFilesToProjectAndUpdateGraph = function (project, files, propertyReader, clientFileName, typeAcquisition, configFileErrors) { - var errors; - for (var _i = 0, files_4 = files; _i < files_4.length; _i++) { - var f = files_4[_i]; - var rootFilename = propertyReader.getFileName(f); - var scriptKind = propertyReader.getScriptKind(f); - var hasMixedContent = propertyReader.hasMixedContent(f); - if (this.host.fileExists(rootFilename)) { - var info = this.getOrCreateScriptInfoForNormalizedPath(server.toNormalizedPath(rootFilename), clientFileName == rootFilename, undefined, scriptKind, hasMixedContent); - project.addRoot(info); - } - else { - (errors || (errors = [])).push(createFileNotFoundDiagnostic(rootFilename)); - } - } - project.setProjectErrors(ts.concatenate(configFileErrors, errors)); - project.setTypeAcquisition(typeAcquisition); - project.updateGraph(); - }; - ProjectService.prototype.openConfigFile = function (configFileName, clientFileName) { - var conversionResult = this.convertConfigFileContentToProjectOptions(configFileName); - var projectOptions = conversionResult.success - ? conversionResult.projectOptions - : { files: [], compilerOptions: {} }; - var project = this.createAndAddConfiguredProject(configFileName, projectOptions, conversionResult.configFileErrors, clientFileName); - return { - success: conversionResult.success, - project: project, - errors: project.getProjectErrors() - }; - }; - ProjectService.prototype.updateNonInferredProject = function (project, newUncheckedFiles, propertyReader, newOptions, newTypeAcquisition, compileOnSave, configFileErrors) { - var oldRootScriptInfos = project.getRootScriptInfos(); - var newRootScriptInfos = []; - var newRootScriptInfoMap = server.createNormalizedPathMap(); - var projectErrors; - var rootFilesChanged = false; - for (var _i = 0, newUncheckedFiles_1 = newUncheckedFiles; _i < newUncheckedFiles_1.length; _i++) { - var f = newUncheckedFiles_1[_i]; - var newRootFile = propertyReader.getFileName(f); - if (!this.host.fileExists(newRootFile)) { - (projectErrors || (projectErrors = [])).push(createFileNotFoundDiagnostic(newRootFile)); - continue; - } - var normalizedPath = server.toNormalizedPath(newRootFile); - var scriptInfo = this.getScriptInfoForNormalizedPath(normalizedPath); - if (!scriptInfo || !project.isRoot(scriptInfo)) { - rootFilesChanged = true; - if (!scriptInfo) { - var scriptKind = propertyReader.getScriptKind(f); - var hasMixedContent = propertyReader.hasMixedContent(f); - scriptInfo = this.getOrCreateScriptInfoForNormalizedPath(normalizedPath, false, undefined, scriptKind, hasMixedContent); - } - } - newRootScriptInfos.push(scriptInfo); - newRootScriptInfoMap.set(scriptInfo.fileName, scriptInfo); - } - if (rootFilesChanged || newRootScriptInfos.length !== oldRootScriptInfos.length) { - var toAdd = void 0; - var toRemove = void 0; - for (var _a = 0, oldRootScriptInfos_1 = oldRootScriptInfos; _a < oldRootScriptInfos_1.length; _a++) { - var oldFile = oldRootScriptInfos_1[_a]; - if (!newRootScriptInfoMap.contains(oldFile.fileName)) { - (toRemove || (toRemove = [])).push(oldFile); - } - } - for (var _b = 0, newRootScriptInfos_1 = newRootScriptInfos; _b < newRootScriptInfos_1.length; _b++) { - var newFile = newRootScriptInfos_1[_b]; - if (!project.isRoot(newFile)) { - (toAdd || (toAdd = [])).push(newFile); - } - } - if (toRemove) { - for (var _c = 0, toRemove_1 = toRemove; _c < toRemove_1.length; _c++) { - var f = toRemove_1[_c]; - project.removeFile(f); - } - } - if (toAdd) { - for (var _d = 0, toAdd_1 = toAdd; _d < toAdd_1.length; _d++) { - var f = toAdd_1[_d]; - if (f.isOpen && isRootFileInInferredProject(f)) { - var inferredProject = f.containingProjects[0]; - inferredProject.removeFile(f); - if (!inferredProject.hasRoots()) { - this.removeProject(inferredProject); - } - } - project.addRoot(f); - } - } - } - project.setCompilerOptions(newOptions); - project.setTypeAcquisition(newTypeAcquisition); - if (compileOnSave !== undefined) { - project.compileOnSaveEnabled = compileOnSave; - } - project.setProjectErrors(ts.concatenate(configFileErrors, projectErrors)); - project.updateGraph(); - }; - ProjectService.prototype.updateConfiguredProject = function (project) { - if (!this.host.fileExists(project.getConfigFilePath())) { - this.logger.info("Config file deleted"); - this.removeProject(project); - return; - } - var _a = this.convertConfigFileContentToProjectOptions(project.getConfigFilePath()), success = _a.success, projectOptions = _a.projectOptions, configFileErrors = _a.configFileErrors; - if (!success) { - this.updateNonInferredProject(project, [], fileNamePropertyReader, {}, {}, false, configFileErrors); - return configFileErrors; - } - if (this.exceededTotalSizeLimitForNonTsFiles(projectOptions.compilerOptions, projectOptions.files, fileNamePropertyReader)) { - project.setCompilerOptions(projectOptions.compilerOptions); - if (!project.languageServiceEnabled) { - return configFileErrors; - } - project.disableLanguageService(); - project.stopWatchingDirectory(); - } - else { - if (!project.languageServiceEnabled) { - project.enableLanguageService(); - } - this.watchConfigDirectoryForProject(project, projectOptions); - this.updateNonInferredProject(project, projectOptions.files, fileNamePropertyReader, projectOptions.compilerOptions, projectOptions.typeAcquisition, projectOptions.compileOnSave, configFileErrors); - } - return configFileErrors; - }; - ProjectService.prototype.createInferredProjectWithRootFileIfNecessary = function (root) { - var _this = this; - var useExistingProject = this.useSingleInferredProject && this.inferredProjects.length; - var project = useExistingProject - ? this.inferredProjects[0] - : new server.InferredProject(this, this.documentRegistry, this.compilerOptionsForInferredProjects); - project.addRoot(root); - this.directoryWatchers.startWatchingContainingDirectoriesForFile(root.fileName, project, function (fileName) { return _this.onConfigFileAddedForInferredProject(fileName); }); - project.updateGraph(); - if (!useExistingProject) { - this.inferredProjects.push(project); - } - return project; - }; - ProjectService.prototype.getOrCreateScriptInfo = function (uncheckedFileName, openedByClient, fileContent, scriptKind) { - return this.getOrCreateScriptInfoForNormalizedPath(server.toNormalizedPath(uncheckedFileName), openedByClient, fileContent, scriptKind); - }; - ProjectService.prototype.getScriptInfo = function (uncheckedFileName) { - return this.getScriptInfoForNormalizedPath(server.toNormalizedPath(uncheckedFileName)); - }; - ProjectService.prototype.getOrCreateScriptInfoForNormalizedPath = function (fileName, openedByClient, fileContent, scriptKind, hasMixedContent) { - var _this = this; - var info = this.getScriptInfoForNormalizedPath(fileName); - if (!info) { - var content = void 0; - if (this.host.fileExists(fileName)) { - content = fileContent || (hasMixedContent ? "" : this.host.readFile(fileName)); - } - if (!content) { - if (openedByClient) { - content = ""; - } - } - if (content !== undefined) { - info = new server.ScriptInfo(this.host, fileName, content, scriptKind, openedByClient, hasMixedContent); - this.filenameToScriptInfo.set(info.path, info); - if (!info.isOpen && !hasMixedContent) { - info.setWatcher(this.host.watchFile(fileName, function (_) { return _this.onSourceFileChanged(fileName); })); - } - } - } - if (info) { - if (fileContent !== undefined) { - info.reload(fileContent); - } - if (openedByClient) { - info.isOpen = true; - } - } - return info; - }; - ProjectService.prototype.getScriptInfoForNormalizedPath = function (fileName) { - return this.getScriptInfoForPath(server.normalizedPathToPath(fileName, this.host.getCurrentDirectory(), this.toCanonicalFileName)); - }; - ProjectService.prototype.getScriptInfoForPath = function (fileName) { - return this.filenameToScriptInfo.get(fileName); - }; - ProjectService.prototype.setHostConfiguration = function (args) { - if (args.file) { - var info = this.getScriptInfoForNormalizedPath(server.toNormalizedPath(args.file)); - if (info) { - info.setFormatOptions(convertFormatOptions(args.formatOptions)); - this.logger.info("Host configuration update for file " + args.file); - } - } - else { - if (args.hostInfo !== undefined) { - this.hostConfiguration.hostInfo = args.hostInfo; - this.logger.info("Host information " + args.hostInfo); - } - if (args.formatOptions) { - server.mergeMaps(this.hostConfiguration.formatCodeOptions, convertFormatOptions(args.formatOptions)); - this.logger.info("Format host information updated"); - } - } - }; - ProjectService.prototype.closeLog = function () { - this.logger.close(); - }; - ProjectService.prototype.reloadProjects = function () { - this.logger.info("reload projects."); - for (var _i = 0, _a = this.openFiles; _i < _a.length; _i++) { - var info = _a[_i]; - this.openOrUpdateConfiguredProjectForFile(info.fileName); - } - this.refreshInferredProjects(); - }; - ProjectService.prototype.refreshInferredProjects = function () { - this.logger.info("updating project structure from ..."); - this.printProjects(); - var orphantedFiles = []; - for (var _i = 0, _a = this.openFiles; _i < _a.length; _i++) { - var info = _a[_i]; - if (info.containingProjects.length === 0) { - orphantedFiles.push(info); - } - else { - if (isRootFileInInferredProject(info) && info.containingProjects.length > 1) { - var inferredProject = info.containingProjects[0]; - ts.Debug.assert(inferredProject.projectKind === server.ProjectKind.Inferred); - inferredProject.removeFile(info); - if (!inferredProject.hasRoots()) { - this.removeProject(inferredProject); - } - } - } - } - for (var _b = 0, orphantedFiles_1 = orphantedFiles; _b < orphantedFiles_1.length; _b++) { - var f = orphantedFiles_1[_b]; - this.assignScriptInfoToInferredProjectIfNecessary(f, false); - } - for (var _c = 0, _d = this.inferredProjects; _c < _d.length; _c++) { - var p = _d[_c]; - p.updateGraph(); - } - this.printProjects(); - }; - ProjectService.prototype.openClientFile = function (fileName, fileContent, scriptKind) { - return this.openClientFileWithNormalizedPath(server.toNormalizedPath(fileName), fileContent, scriptKind); - }; - ProjectService.prototype.openClientFileWithNormalizedPath = function (fileName, fileContent, scriptKind, hasMixedContent) { - var _a = this.findContainingExternalProject(fileName) - ? {} - : this.openOrUpdateConfiguredProjectForFile(fileName), _b = _a.configFileName, configFileName = _b === void 0 ? undefined : _b, _c = _a.configFileErrors, configFileErrors = _c === void 0 ? undefined : _c; - var info = this.getOrCreateScriptInfoForNormalizedPath(fileName, true, fileContent, scriptKind, hasMixedContent); - this.assignScriptInfoToInferredProjectIfNecessary(info, true); - this.printProjects(); - return { configFileName: configFileName, configFileErrors: configFileErrors }; - }; - ProjectService.prototype.closeClientFile = function (uncheckedFileName) { - var info = this.getScriptInfoForNormalizedPath(server.toNormalizedPath(uncheckedFileName)); - if (info) { - this.closeOpenFile(info); - info.isOpen = false; - } - this.printProjects(); - }; - ProjectService.prototype.collectChanges = function (lastKnownProjectVersions, currentProjects, result) { - var _loop_5 = function (proj) { - var knownProject = ts.forEach(lastKnownProjectVersions, function (p) { return p.projectName === proj.getProjectName() && p; }); - result.push(proj.getChangesSinceVersion(knownProject && knownProject.version)); - }; - for (var _i = 0, currentProjects_1 = currentProjects; _i < currentProjects_1.length; _i++) { - var proj = currentProjects_1[_i]; - _loop_5(proj); - } - }; - ProjectService.prototype.synchronizeProjectList = function (knownProjects) { - var files = []; - this.collectChanges(knownProjects, this.externalProjects, files); - this.collectChanges(knownProjects, this.configuredProjects, files); - this.collectChanges(knownProjects, this.inferredProjects, files); - return files; - }; - ProjectService.prototype.applyChangesInOpenFiles = function (openFiles, changedFiles, closedFiles) { - var recordChangedFiles = changedFiles && !openFiles && !closedFiles; - if (openFiles) { - for (var _i = 0, openFiles_1 = openFiles; _i < openFiles_1.length; _i++) { - var file = openFiles_1[_i]; - var scriptInfo = this.getScriptInfo(file.fileName); - ts.Debug.assert(!scriptInfo || !scriptInfo.isOpen); - var normalizedPath = scriptInfo ? scriptInfo.fileName : server.toNormalizedPath(file.fileName); - this.openClientFileWithNormalizedPath(normalizedPath, file.content, tryConvertScriptKindName(file.scriptKind), file.hasMixedContent); - } - } - if (changedFiles) { - for (var _a = 0, changedFiles_2 = changedFiles; _a < changedFiles_2.length; _a++) { - var file = changedFiles_2[_a]; - var scriptInfo = this.getScriptInfo(file.fileName); - ts.Debug.assert(!!scriptInfo); - for (var i = file.changes.length - 1; i >= 0; i--) { - var change = file.changes[i]; - scriptInfo.editContent(change.span.start, change.span.start + change.span.length, change.newText); - } - if (recordChangedFiles) { - if (!this.changedFiles) { - this.changedFiles = [scriptInfo]; - } - else if (this.changedFiles.indexOf(scriptInfo) < 0) { - this.changedFiles.push(scriptInfo); - } - } - } - } - if (closedFiles) { - for (var _b = 0, closedFiles_1 = closedFiles; _b < closedFiles_1.length; _b++) { - var file = closedFiles_1[_b]; - this.closeClientFile(file); - } - } - if (openFiles || closedFiles) { - this.refreshInferredProjects(); - } - }; - ProjectService.prototype.closeConfiguredProject = function (configFile) { - var configuredProject = this.findConfiguredProjectByProjectName(configFile); - if (configuredProject && configuredProject.deleteOpenRef() === 0) { - this.removeProject(configuredProject); - } - }; - ProjectService.prototype.closeExternalProject = function (uncheckedFileName, suppressRefresh) { - if (suppressRefresh === void 0) { suppressRefresh = false; } - var fileName = server.toNormalizedPath(uncheckedFileName); - var configFiles = this.externalProjectToConfiguredProjectMap[fileName]; - if (configFiles) { - var shouldRefreshInferredProjects = false; - for (var _i = 0, configFiles_1 = configFiles; _i < configFiles_1.length; _i++) { - var configFile = configFiles_1[_i]; - if (this.closeConfiguredProject(configFile)) { - shouldRefreshInferredProjects = true; - } - } - delete this.externalProjectToConfiguredProjectMap[fileName]; - if (shouldRefreshInferredProjects && !suppressRefresh) { - this.refreshInferredProjects(); - } - } - else { - var externalProject = this.findExternalProjectByProjectName(uncheckedFileName); - if (externalProject) { - this.removeProject(externalProject); - if (!suppressRefresh) { - this.refreshInferredProjects(); - } - } - } - }; - ProjectService.prototype.openExternalProject = function (proj) { - if (proj.typingOptions && !proj.typeAcquisition) { - var typeAcquisition = ts.convertEnableAutoDiscoveryToEnable(proj.typingOptions); - proj.typeAcquisition = typeAcquisition; - } - var tsConfigFiles; - var rootFiles = []; - for (var _i = 0, _a = proj.rootFiles; _i < _a.length; _i++) { - var file = _a[_i]; - var normalized = server.toNormalizedPath(file.fileName); - if (ts.getBaseFileName(normalized) === "tsconfig.json") { - if (this.host.fileExists(normalized)) { - (tsConfigFiles || (tsConfigFiles = [])).push(normalized); - } - } - else { - rootFiles.push(file); - } - } - if (tsConfigFiles) { - tsConfigFiles.sort(); - } - var externalProject = this.findExternalProjectByProjectName(proj.projectFileName); - var exisingConfigFiles; - if (externalProject) { - if (!tsConfigFiles) { - this.updateNonInferredProject(externalProject, proj.rootFiles, externalFilePropertyReader, convertCompilerOptions(proj.options), proj.typeAcquisition, proj.options.compileOnSave, undefined); - return; - } - this.closeExternalProject(proj.projectFileName, true); - } - else if (this.externalProjectToConfiguredProjectMap[proj.projectFileName]) { - if (!tsConfigFiles) { - this.closeExternalProject(proj.projectFileName, true); - } - else { - var oldConfigFiles = this.externalProjectToConfiguredProjectMap[proj.projectFileName]; - var iNew = 0; - var iOld = 0; - while (iNew < tsConfigFiles.length && iOld < oldConfigFiles.length) { - var newConfig = tsConfigFiles[iNew]; - var oldConfig = oldConfigFiles[iOld]; - if (oldConfig < newConfig) { - this.closeConfiguredProject(oldConfig); - iOld++; - } - else if (oldConfig > newConfig) { - iNew++; - } - else { - (exisingConfigFiles || (exisingConfigFiles = [])).push(oldConfig); - iOld++; - iNew++; - } - } - for (var i = iOld; i < oldConfigFiles.length; i++) { - this.closeConfiguredProject(oldConfigFiles[i]); - } - } - } - if (tsConfigFiles) { - this.externalProjectToConfiguredProjectMap[proj.projectFileName] = tsConfigFiles; - for (var _b = 0, tsConfigFiles_1 = tsConfigFiles; _b < tsConfigFiles_1.length; _b++) { - var tsconfigFile = tsConfigFiles_1[_b]; - var project = this.findConfiguredProjectByProjectName(tsconfigFile); - if (!project) { - var result = this.openConfigFile(tsconfigFile); - project = result.success && result.project; - } - if (project && !ts.contains(exisingConfigFiles, tsconfigFile)) { - project.addOpenRef(); - } - } - } - else { - delete this.externalProjectToConfiguredProjectMap[proj.projectFileName]; - this.createAndAddExternalProject(proj.projectFileName, rootFiles, proj.options, proj.typeAcquisition); - } - this.refreshInferredProjects(); - }; - return ProjectService; - }()); - server.ProjectService = ProjectService; - })(server = ts.server || (ts.server = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var server; - (function (server) { - function hrTimeToMilliseconds(time) { - var seconds = time[0]; - var nanoseconds = time[1]; - return ((1e9 * seconds) + nanoseconds) / 1000000.0; - } - function shouldSkipSematicCheck(project) { - if (project.getCompilerOptions().skipLibCheck !== undefined) { - return false; - } - if ((project.projectKind === server.ProjectKind.Inferred || project.projectKind === server.ProjectKind.External) && project.isJsOnlyProject()) { - return true; - } - return false; - } - function compareNumber(a, b) { - return a - b; - } - function compareFileStart(a, b) { - if (a.file < b.file) { - return -1; - } - else if (a.file == b.file) { - var n = compareNumber(a.start.line, b.start.line); - if (n === 0) { - return compareNumber(a.start.offset, b.start.offset); - } - else - return n; - } - else { - return 1; - } - } - function formatDiag(fileName, project, diag) { - var scriptInfo = project.getScriptInfoForNormalizedPath(fileName); - return { - start: scriptInfo.positionToLineOffset(diag.start), - end: scriptInfo.positionToLineOffset(diag.start + diag.length), - text: ts.flattenDiagnosticMessageText(diag.messageText, "\n"), - code: diag.code - }; - } - function formatConfigFileDiag(diag) { - return { - start: undefined, - end: undefined, - text: ts.flattenDiagnosticMessageText(diag.messageText, "\n") - }; - } - function allEditsBeforePos(edits, pos) { - for (var _i = 0, edits_1 = edits; _i < edits_1.length; _i++) { - var edit = edits_1[_i]; - if (ts.textSpanEnd(edit.span) >= pos) { - return false; - } - } - return true; - } - var CommandNames; - (function (CommandNames) { - CommandNames.Brace = "brace"; - CommandNames.BraceFull = "brace-full"; - CommandNames.BraceCompletion = "braceCompletion"; - CommandNames.Change = "change"; - CommandNames.Close = "close"; - CommandNames.Completions = "completions"; - CommandNames.CompletionsFull = "completions-full"; - CommandNames.CompletionDetails = "completionEntryDetails"; - CommandNames.CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList"; - CommandNames.CompileOnSaveEmitFile = "compileOnSaveEmitFile"; - CommandNames.Configure = "configure"; - CommandNames.Definition = "definition"; - CommandNames.DefinitionFull = "definition-full"; - CommandNames.Exit = "exit"; - CommandNames.Format = "format"; - CommandNames.Formatonkey = "formatonkey"; - CommandNames.FormatFull = "format-full"; - CommandNames.FormatonkeyFull = "formatonkey-full"; - CommandNames.FormatRangeFull = "formatRange-full"; - CommandNames.Geterr = "geterr"; - CommandNames.GeterrForProject = "geterrForProject"; - CommandNames.Implementation = "implementation"; - CommandNames.ImplementationFull = "implementation-full"; - CommandNames.SemanticDiagnosticsSync = "semanticDiagnosticsSync"; - CommandNames.SyntacticDiagnosticsSync = "syntacticDiagnosticsSync"; - CommandNames.NavBar = "navbar"; - CommandNames.NavBarFull = "navbar-full"; - CommandNames.NavTree = "navtree"; - CommandNames.NavTreeFull = "navtree-full"; - CommandNames.Navto = "navto"; - CommandNames.NavtoFull = "navto-full"; - CommandNames.Occurrences = "occurrences"; - CommandNames.DocumentHighlights = "documentHighlights"; - CommandNames.DocumentHighlightsFull = "documentHighlights-full"; - CommandNames.Open = "open"; - CommandNames.Quickinfo = "quickinfo"; - CommandNames.QuickinfoFull = "quickinfo-full"; - CommandNames.References = "references"; - CommandNames.ReferencesFull = "references-full"; - CommandNames.Reload = "reload"; - CommandNames.Rename = "rename"; - CommandNames.RenameInfoFull = "rename-full"; - CommandNames.RenameLocationsFull = "renameLocations-full"; - CommandNames.Saveto = "saveto"; - CommandNames.SignatureHelp = "signatureHelp"; - CommandNames.SignatureHelpFull = "signatureHelp-full"; - CommandNames.TypeDefinition = "typeDefinition"; - CommandNames.ProjectInfo = "projectInfo"; - CommandNames.ReloadProjects = "reloadProjects"; - CommandNames.Unknown = "unknown"; - CommandNames.OpenExternalProject = "openExternalProject"; - CommandNames.OpenExternalProjects = "openExternalProjects"; - CommandNames.CloseExternalProject = "closeExternalProject"; - CommandNames.SynchronizeProjectList = "synchronizeProjectList"; - CommandNames.ApplyChangedToOpenFiles = "applyChangedToOpenFiles"; - CommandNames.EncodedSemanticClassificationsFull = "encodedSemanticClassifications-full"; - CommandNames.Cleanup = "cleanup"; - CommandNames.OutliningSpans = "outliningSpans"; - CommandNames.TodoComments = "todoComments"; - CommandNames.Indentation = "indentation"; - CommandNames.DocCommentTemplate = "docCommentTemplate"; - CommandNames.CompilerOptionsDiagnosticsFull = "compilerOptionsDiagnostics-full"; - CommandNames.NameOrDottedNameSpan = "nameOrDottedNameSpan"; - CommandNames.BreakpointStatement = "breakpointStatement"; - CommandNames.CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects"; - CommandNames.GetCodeFixes = "getCodeFixes"; - CommandNames.GetCodeFixesFull = "getCodeFixes-full"; - CommandNames.GetSupportedCodeFixes = "getSupportedCodeFixes"; - })(CommandNames = server.CommandNames || (server.CommandNames = {})); - function formatMessage(msg, logger, byteLength, newLine) { - var verboseLogging = logger.hasLevel(server.LogLevel.verbose); - var json = JSON.stringify(msg); - if (verboseLogging) { - logger.info(msg.type + ": " + json); - } - var len = byteLength(json, "utf8"); - return "Content-Length: " + (1 + len) + "\r\n\r\n" + json + newLine; - } - server.formatMessage = formatMessage; - var Session = (function () { - function Session(host, cancellationToken, useSingleInferredProject, typingsInstaller, byteLength, hrtime, logger, canUseEvents, eventHandler) { - var _this = this; - this.host = host; - this.typingsInstaller = typingsInstaller; - this.byteLength = byteLength; - this.hrtime = hrtime; - this.logger = logger; - this.canUseEvents = canUseEvents; - this.changeSeq = 0; - this.handlers = ts.createMap((_a = {}, - _a[CommandNames.OpenExternalProject] = function (request) { - _this.projectService.openExternalProject(request.arguments); - return _this.requiredResponse(true); - }, - _a[CommandNames.OpenExternalProjects] = function (request) { - for (var _i = 0, _a = request.arguments.projects; _i < _a.length; _i++) { - var proj = _a[_i]; - _this.projectService.openExternalProject(proj); - } - return _this.requiredResponse(true); - }, - _a[CommandNames.CloseExternalProject] = function (request) { - _this.projectService.closeExternalProject(request.arguments.projectFileName); - return _this.requiredResponse(true); - }, - _a[CommandNames.SynchronizeProjectList] = function (request) { - var result = _this.projectService.synchronizeProjectList(request.arguments.knownProjects); - if (!result.some(function (p) { return p.projectErrors && p.projectErrors.length !== 0; })) { - return _this.requiredResponse(result); - } - var converted = ts.map(result, function (p) { - if (!p.projectErrors || p.projectErrors.length === 0) { - return p; - } - return { - info: p.info, - changes: p.changes, - files: p.files, - projectErrors: _this.convertToDiagnosticsWithLinePosition(p.projectErrors, undefined) - }; - }); - return _this.requiredResponse(converted); - }, - _a[CommandNames.ApplyChangedToOpenFiles] = function (request) { - _this.projectService.applyChangesInOpenFiles(request.arguments.openFiles, request.arguments.changedFiles, request.arguments.closedFiles); - _this.changeSeq++; - return _this.requiredResponse(true); - }, - _a[CommandNames.Exit] = function () { - _this.exit(); - return _this.notRequired(); - }, - _a[CommandNames.Definition] = function (request) { - return _this.requiredResponse(_this.getDefinition(request.arguments, true)); - }, - _a[CommandNames.DefinitionFull] = function (request) { - return _this.requiredResponse(_this.getDefinition(request.arguments, false)); - }, - _a[CommandNames.TypeDefinition] = function (request) { - return _this.requiredResponse(_this.getTypeDefinition(request.arguments)); - }, - _a[CommandNames.Implementation] = function (request) { - return _this.requiredResponse(_this.getImplementation(request.arguments, true)); - }, - _a[CommandNames.ImplementationFull] = function (request) { - return _this.requiredResponse(_this.getImplementation(request.arguments, false)); - }, - _a[CommandNames.References] = function (request) { - return _this.requiredResponse(_this.getReferences(request.arguments, true)); - }, - _a[CommandNames.ReferencesFull] = function (request) { - return _this.requiredResponse(_this.getReferences(request.arguments, false)); - }, - _a[CommandNames.Rename] = function (request) { - return _this.requiredResponse(_this.getRenameLocations(request.arguments, true)); - }, - _a[CommandNames.RenameLocationsFull] = function (request) { - return _this.requiredResponse(_this.getRenameLocations(request.arguments, false)); - }, - _a[CommandNames.RenameInfoFull] = function (request) { - return _this.requiredResponse(_this.getRenameInfo(request.arguments)); - }, - _a[CommandNames.Open] = function (request) { - _this.openClientFile(server.toNormalizedPath(request.arguments.file), request.arguments.fileContent, server.convertScriptKindName(request.arguments.scriptKindName)); - return _this.notRequired(); - }, - _a[CommandNames.Quickinfo] = function (request) { - return _this.requiredResponse(_this.getQuickInfoWorker(request.arguments, true)); - }, - _a[CommandNames.QuickinfoFull] = function (request) { - return _this.requiredResponse(_this.getQuickInfoWorker(request.arguments, false)); - }, - _a[CommandNames.OutliningSpans] = function (request) { - return _this.requiredResponse(_this.getOutliningSpans(request.arguments)); - }, - _a[CommandNames.TodoComments] = function (request) { - return _this.requiredResponse(_this.getTodoComments(request.arguments)); - }, - _a[CommandNames.Indentation] = function (request) { - return _this.requiredResponse(_this.getIndentation(request.arguments)); - }, - _a[CommandNames.NameOrDottedNameSpan] = function (request) { - return _this.requiredResponse(_this.getNameOrDottedNameSpan(request.arguments)); - }, - _a[CommandNames.BreakpointStatement] = function (request) { - return _this.requiredResponse(_this.getBreakpointStatement(request.arguments)); - }, - _a[CommandNames.BraceCompletion] = function (request) { - return _this.requiredResponse(_this.isValidBraceCompletion(request.arguments)); - }, - _a[CommandNames.DocCommentTemplate] = function (request) { - return _this.requiredResponse(_this.getDocCommentTemplate(request.arguments)); - }, - _a[CommandNames.Format] = function (request) { - return _this.requiredResponse(_this.getFormattingEditsForRange(request.arguments)); - }, - _a[CommandNames.Formatonkey] = function (request) { - return _this.requiredResponse(_this.getFormattingEditsAfterKeystroke(request.arguments)); - }, - _a[CommandNames.FormatFull] = function (request) { - return _this.requiredResponse(_this.getFormattingEditsForDocumentFull(request.arguments)); - }, - _a[CommandNames.FormatonkeyFull] = function (request) { - return _this.requiredResponse(_this.getFormattingEditsAfterKeystrokeFull(request.arguments)); - }, - _a[CommandNames.FormatRangeFull] = function (request) { - return _this.requiredResponse(_this.getFormattingEditsForRangeFull(request.arguments)); - }, - _a[CommandNames.Completions] = function (request) { - return _this.requiredResponse(_this.getCompletions(request.arguments, true)); - }, - _a[CommandNames.CompletionsFull] = function (request) { - return _this.requiredResponse(_this.getCompletions(request.arguments, false)); - }, - _a[CommandNames.CompletionDetails] = function (request) { - return _this.requiredResponse(_this.getCompletionEntryDetails(request.arguments)); - }, - _a[CommandNames.CompileOnSaveAffectedFileList] = function (request) { - return _this.requiredResponse(_this.getCompileOnSaveAffectedFileList(request.arguments)); - }, - _a[CommandNames.CompileOnSaveEmitFile] = function (request) { - return _this.requiredResponse(_this.emitFile(request.arguments)); - }, - _a[CommandNames.SignatureHelp] = function (request) { - return _this.requiredResponse(_this.getSignatureHelpItems(request.arguments, true)); - }, - _a[CommandNames.SignatureHelpFull] = function (request) { - return _this.requiredResponse(_this.getSignatureHelpItems(request.arguments, false)); - }, - _a[CommandNames.CompilerOptionsDiagnosticsFull] = function (request) { - return _this.requiredResponse(_this.getCompilerOptionsDiagnostics(request.arguments)); - }, - _a[CommandNames.EncodedSemanticClassificationsFull] = function (request) { - return _this.requiredResponse(_this.getEncodedSemanticClassifications(request.arguments)); - }, - _a[CommandNames.Cleanup] = function () { - _this.cleanup(); - return _this.requiredResponse(true); - }, - _a[CommandNames.SemanticDiagnosticsSync] = function (request) { - return _this.requiredResponse(_this.getSemanticDiagnosticsSync(request.arguments)); - }, - _a[CommandNames.SyntacticDiagnosticsSync] = function (request) { - return _this.requiredResponse(_this.getSyntacticDiagnosticsSync(request.arguments)); - }, - _a[CommandNames.Geterr] = function (request) { - var geterrArgs = request.arguments; - return { response: _this.getDiagnostics(geterrArgs.delay, geterrArgs.files), responseRequired: false }; - }, - _a[CommandNames.GeterrForProject] = function (request) { - var _a = request.arguments, file = _a.file, delay = _a.delay; - return { response: _this.getDiagnosticsForProject(delay, file), responseRequired: false }; - }, - _a[CommandNames.Change] = function (request) { - _this.change(request.arguments); - return _this.notRequired(); - }, - _a[CommandNames.Configure] = function (request) { - _this.projectService.setHostConfiguration(request.arguments); - _this.output(undefined, CommandNames.Configure, request.seq); - return _this.notRequired(); - }, - _a[CommandNames.Reload] = function (request) { - _this.reload(request.arguments, request.seq); - return _this.requiredResponse({ reloadFinished: true }); - }, - _a[CommandNames.Saveto] = function (request) { - var savetoArgs = request.arguments; - _this.saveToTmp(savetoArgs.file, savetoArgs.tmpfile); - return _this.notRequired(); - }, - _a[CommandNames.Close] = function (request) { - var closeArgs = request.arguments; - _this.closeClientFile(closeArgs.file); - return _this.notRequired(); - }, - _a[CommandNames.Navto] = function (request) { - return _this.requiredResponse(_this.getNavigateToItems(request.arguments, true)); - }, - _a[CommandNames.NavtoFull] = function (request) { - return _this.requiredResponse(_this.getNavigateToItems(request.arguments, false)); - }, - _a[CommandNames.Brace] = function (request) { - return _this.requiredResponse(_this.getBraceMatching(request.arguments, true)); - }, - _a[CommandNames.BraceFull] = function (request) { - return _this.requiredResponse(_this.getBraceMatching(request.arguments, false)); - }, - _a[CommandNames.NavBar] = function (request) { - return _this.requiredResponse(_this.getNavigationBarItems(request.arguments, true)); - }, - _a[CommandNames.NavBarFull] = function (request) { - return _this.requiredResponse(_this.getNavigationBarItems(request.arguments, false)); - }, - _a[CommandNames.NavTree] = function (request) { - return _this.requiredResponse(_this.getNavigationTree(request.arguments, true)); - }, - _a[CommandNames.NavTreeFull] = function (request) { - return _this.requiredResponse(_this.getNavigationTree(request.arguments, false)); - }, - _a[CommandNames.Occurrences] = function (request) { - return _this.requiredResponse(_this.getOccurrences(request.arguments)); - }, - _a[CommandNames.DocumentHighlights] = function (request) { - return _this.requiredResponse(_this.getDocumentHighlights(request.arguments, true)); - }, - _a[CommandNames.DocumentHighlightsFull] = function (request) { - return _this.requiredResponse(_this.getDocumentHighlights(request.arguments, false)); - }, - _a[CommandNames.CompilerOptionsForInferredProjects] = function (request) { - _this.setCompilerOptionsForInferredProjects(request.arguments); - return _this.requiredResponse(true); - }, - _a[CommandNames.ProjectInfo] = function (request) { - return _this.requiredResponse(_this.getProjectInfo(request.arguments)); - }, - _a[CommandNames.ReloadProjects] = function () { - _this.projectService.reloadProjects(); - return _this.notRequired(); - }, - _a[CommandNames.GetCodeFixes] = function (request) { - return _this.requiredResponse(_this.getCodeFixes(request.arguments, true)); - }, - _a[CommandNames.GetCodeFixesFull] = function (request) { - return _this.requiredResponse(_this.getCodeFixes(request.arguments, false)); - }, - _a[CommandNames.GetSupportedCodeFixes] = function () { - return _this.requiredResponse(_this.getSupportedCodeFixes()); - }, - _a)); - this.eventHander = canUseEvents - ? eventHandler || (function (event) { return _this.defaultEventHandler(event); }) - : undefined; - this.projectService = new server.ProjectService(host, logger, cancellationToken, useSingleInferredProject, typingsInstaller, this.eventHander); - this.gcTimer = new server.GcTimer(host, 7000, logger); - var _a; - } - Session.prototype.defaultEventHandler = function (event) { - var _this = this; - switch (event.eventName) { - case server.ContextEvent: - var _a = event.data, project = _a.project, fileName = _a.fileName; - this.projectService.logger.info("got context event, updating diagnostics for " + fileName); - this.updateErrorCheck([{ fileName: fileName, project: project }], this.changeSeq, function (n) { return n === _this.changeSeq; }, 100); - break; - case server.ConfigFileDiagEvent: - var _b = event.data, triggerFile = _b.triggerFile, configFileName = _b.configFileName, diagnostics = _b.diagnostics; - this.configFileDiagnosticEvent(triggerFile, configFileName, diagnostics); - break; - case server.ProjectLanguageServiceStateEvent: - var eventName = "projectLanguageServiceState"; - this.event({ - projectName: event.data.project.getProjectName(), - languageServiceEnabled: event.data.languageServiceEnabled - }, eventName); - break; - } - }; - Session.prototype.logError = function (err, cmd) { - var msg = "Exception on executing command " + cmd; - if (err.message) { - msg += ":\n" + err.message; - if (err.stack) { - msg += "\n" + err.stack; - } - } - this.logger.msg(msg, server.Msg.Err); - }; - Session.prototype.send = function (msg) { - if (msg.type === "event" && !this.canUseEvents) { - if (this.logger.hasLevel(server.LogLevel.verbose)) { - this.logger.info("Session does not support events: ignored event: " + JSON.stringify(msg)); - } - return; - } - this.host.write(formatMessage(msg, this.logger, this.byteLength, this.host.newLine)); - }; - Session.prototype.configFileDiagnosticEvent = function (triggerFile, configFile, diagnostics) { - var bakedDiags = ts.map(diagnostics, formatConfigFileDiag); - var ev = { - seq: 0, - type: "event", - event: "configFileDiag", - body: { - triggerFile: triggerFile, - configFile: configFile, - diagnostics: bakedDiags - } - }; - this.send(ev); - }; - Session.prototype.event = function (info, eventName) { - var ev = { - seq: 0, - type: "event", - event: eventName, - body: info, - }; - this.send(ev); - }; - Session.prototype.output = function (info, cmdName, reqSeq, errorMsg) { - if (reqSeq === void 0) { reqSeq = 0; } - var res = { - seq: 0, - type: "response", - command: cmdName, - request_seq: reqSeq, - success: !errorMsg, - }; - if (!errorMsg) { - res.body = info; - } - else { - res.message = errorMsg; - } - this.send(res); - }; - Session.prototype.semanticCheck = function (file, project) { - try { - var diags = []; - if (!shouldSkipSematicCheck(project)) { - diags = project.getLanguageService().getSemanticDiagnostics(file); - } - var bakedDiags = diags.map(function (diag) { return formatDiag(file, project, diag); }); - this.event({ file: file, diagnostics: bakedDiags }, "semanticDiag"); - } - catch (err) { - this.logError(err, "semantic check"); - } - }; - Session.prototype.syntacticCheck = function (file, project) { - try { - var diags = project.getLanguageService().getSyntacticDiagnostics(file); - if (diags) { - var bakedDiags = diags.map(function (diag) { return formatDiag(file, project, diag); }); - this.event({ file: file, diagnostics: bakedDiags }, "syntaxDiag"); - } - } - catch (err) { - this.logError(err, "syntactic check"); - } - }; - Session.prototype.updateProjectStructure = function (seq, matchSeq, ms) { - var _this = this; - if (ms === void 0) { ms = 1500; } - this.host.setTimeout(function () { - if (matchSeq(seq)) { - _this.projectService.refreshInferredProjects(); - } - }, ms); - }; - Session.prototype.updateErrorCheck = function (checkList, seq, matchSeq, ms, followMs, requireOpen) { - var _this = this; - if (ms === void 0) { ms = 1500; } - if (followMs === void 0) { followMs = 200; } - if (requireOpen === void 0) { requireOpen = true; } - if (followMs > ms) { - followMs = ms; - } - if (this.errorTimer) { - this.host.clearTimeout(this.errorTimer); - } - if (this.immediateId) { - this.host.clearImmediate(this.immediateId); - this.immediateId = undefined; - } - var index = 0; - var checkOne = function () { - if (matchSeq(seq)) { - var checkSpec_1 = checkList[index]; - index++; - if (checkSpec_1.project.containsFile(checkSpec_1.fileName, requireOpen)) { - _this.syntacticCheck(checkSpec_1.fileName, checkSpec_1.project); - _this.immediateId = _this.host.setImmediate(function () { - _this.semanticCheck(checkSpec_1.fileName, checkSpec_1.project); - _this.immediateId = undefined; - if (checkList.length > index) { - _this.errorTimer = _this.host.setTimeout(checkOne, followMs); - } - else { - _this.errorTimer = undefined; - } - }); - } - } - }; - if ((checkList.length > index) && (matchSeq(seq))) { - this.errorTimer = this.host.setTimeout(checkOne, ms); - } - }; - Session.prototype.cleanProjects = function (caption, projects) { - if (!projects) { - return; - } - this.logger.info("cleaning " + caption); - for (var _i = 0, projects_4 = projects; _i < projects_4.length; _i++) { - var p = projects_4[_i]; - p.getLanguageService(false).cleanupSemanticCache(); - } - }; - Session.prototype.cleanup = function () { - this.cleanProjects("inferred projects", this.projectService.inferredProjects); - this.cleanProjects("configured projects", this.projectService.configuredProjects); - this.cleanProjects("external projects", this.projectService.externalProjects); - if (this.host.gc) { - this.logger.info("host.gc()"); - this.host.gc(); - } - }; - Session.prototype.getEncodedSemanticClassifications = function (args) { - var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; - return project.getLanguageService().getEncodedSemanticClassifications(file, args); - }; - Session.prototype.getProject = function (projectFileName) { - return projectFileName && this.projectService.findProject(projectFileName); - }; - Session.prototype.getCompilerOptionsDiagnostics = function (args) { - var project = this.getProject(args.projectFileName); - return this.convertToDiagnosticsWithLinePosition(project.getLanguageService().getCompilerOptionsDiagnostics(), undefined); - }; - Session.prototype.convertToDiagnosticsWithLinePosition = function (diagnostics, scriptInfo) { - var _this = this; - return diagnostics.map(function (d) { return ({ - message: ts.flattenDiagnosticMessageText(d.messageText, _this.host.newLine), - start: d.start, - length: d.length, - category: ts.DiagnosticCategory[d.category].toLowerCase(), - code: d.code, - startLocation: scriptInfo && scriptInfo.positionToLineOffset(d.start), - endLocation: scriptInfo && scriptInfo.positionToLineOffset(d.start + d.length) - }); }); - }; - Session.prototype.getDiagnosticsWorker = function (args, isSemantic, selector, includeLinePosition) { - var _a = this.getFileAndProject(args), project = _a.project, file = _a.file; - if (isSemantic && shouldSkipSematicCheck(project)) { - return []; - } - var scriptInfo = project.getScriptInfoForNormalizedPath(file); - var diagnostics = selector(project, file); - return includeLinePosition - ? this.convertToDiagnosticsWithLinePosition(diagnostics, scriptInfo) - : diagnostics.map(function (d) { return formatDiag(file, project, d); }); - }; - Session.prototype.getDefinition = function (args, simplifiedResult) { - var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; - var scriptInfo = project.getScriptInfoForNormalizedPath(file); - var position = this.getPosition(args, scriptInfo); - var definitions = project.getLanguageService().getDefinitionAtPosition(file, position); - if (!definitions) { - return undefined; - } - if (simplifiedResult) { - return definitions.map(function (def) { - var defScriptInfo = project.getScriptInfo(def.fileName); - return { - file: def.fileName, - start: defScriptInfo.positionToLineOffset(def.textSpan.start), - end: defScriptInfo.positionToLineOffset(ts.textSpanEnd(def.textSpan)) - }; - }); - } - else { - return definitions; - } - }; - Session.prototype.getTypeDefinition = function (args) { - var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; - var scriptInfo = project.getScriptInfoForNormalizedPath(file); - var position = this.getPosition(args, scriptInfo); - var definitions = project.getLanguageService().getTypeDefinitionAtPosition(file, position); - if (!definitions) { - return undefined; - } - return definitions.map(function (def) { - var defScriptInfo = project.getScriptInfo(def.fileName); - return { - file: def.fileName, - start: defScriptInfo.positionToLineOffset(def.textSpan.start), - end: defScriptInfo.positionToLineOffset(ts.textSpanEnd(def.textSpan)) - }; - }); - }; - Session.prototype.getImplementation = function (args, simplifiedResult) { - var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; - var scriptInfo = project.getScriptInfoForNormalizedPath(file); - var position = this.getPosition(args, scriptInfo); - var implementations = project.getLanguageService().getImplementationAtPosition(file, position); - if (!implementations) { - return []; - } - if (simplifiedResult) { - return implementations.map(function (impl) { return ({ - file: impl.fileName, - start: scriptInfo.positionToLineOffset(impl.textSpan.start), - end: scriptInfo.positionToLineOffset(ts.textSpanEnd(impl.textSpan)) - }); }); - } - else { - return implementations; - } - }; - Session.prototype.getOccurrences = function (args) { - var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; - var scriptInfo = project.getScriptInfoForNormalizedPath(file); - var position = this.getPosition(args, scriptInfo); - var occurrences = project.getLanguageService().getOccurrencesAtPosition(file, position); - if (!occurrences) { - return undefined; - } - return occurrences.map(function (occurrence) { - var fileName = occurrence.fileName, isWriteAccess = occurrence.isWriteAccess, textSpan = occurrence.textSpan; - var scriptInfo = project.getScriptInfo(fileName); - var start = scriptInfo.positionToLineOffset(textSpan.start); - var end = scriptInfo.positionToLineOffset(ts.textSpanEnd(textSpan)); - return { - start: start, - end: end, - file: fileName, - isWriteAccess: isWriteAccess, - }; - }); - }; - Session.prototype.getSyntacticDiagnosticsSync = function (args) { - return this.getDiagnosticsWorker(args, false, function (project, file) { return project.getLanguageService().getSyntacticDiagnostics(file); }, args.includeLinePosition); - }; - Session.prototype.getSemanticDiagnosticsSync = function (args) { - return this.getDiagnosticsWorker(args, true, function (project, file) { return project.getLanguageService().getSemanticDiagnostics(file); }, args.includeLinePosition); - }; - Session.prototype.getDocumentHighlights = function (args, simplifiedResult) { - var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; - var scriptInfo = project.getScriptInfoForNormalizedPath(file); - var position = this.getPosition(args, scriptInfo); - var documentHighlights = project.getLanguageService().getDocumentHighlights(file, position, args.filesToSearch); - if (!documentHighlights) { - return undefined; - } - if (simplifiedResult) { - return documentHighlights.map(convertToDocumentHighlightsItem); - } - else { - return documentHighlights; - } - function convertToDocumentHighlightsItem(documentHighlights) { - var fileName = documentHighlights.fileName, highlightSpans = documentHighlights.highlightSpans; - var scriptInfo = project.getScriptInfo(fileName); - return { - file: fileName, - highlightSpans: highlightSpans.map(convertHighlightSpan) - }; - function convertHighlightSpan(highlightSpan) { - var textSpan = highlightSpan.textSpan, kind = highlightSpan.kind; - var start = scriptInfo.positionToLineOffset(textSpan.start); - var end = scriptInfo.positionToLineOffset(ts.textSpanEnd(textSpan)); - return { start: start, end: end, kind: kind }; - } - } - }; - Session.prototype.setCompilerOptionsForInferredProjects = function (args) { - this.projectService.setCompilerOptionsForInferredProjects(args.options); - }; - Session.prototype.getProjectInfo = function (args) { - return this.getProjectInfoWorker(args.file, args.projectFileName, args.needFileNameList); - }; - Session.prototype.getProjectInfoWorker = function (uncheckedFileName, projectFileName, needFileNameList) { - var project = this.getFileAndProjectWorker(uncheckedFileName, projectFileName, true, true).project; - var projectInfo = { - configFileName: project.getProjectName(), - languageServiceDisabled: !project.languageServiceEnabled, - fileNames: needFileNameList ? project.getFileNames() : undefined - }; - return projectInfo; - }; - Session.prototype.getRenameInfo = function (args) { - var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; - var scriptInfo = project.getScriptInfoForNormalizedPath(file); - var position = this.getPosition(args, scriptInfo); - return project.getLanguageService().getRenameInfo(file, position); - }; - Session.prototype.getProjects = function (args) { - var projects; - if (args.projectFileName) { - var project = this.getProject(args.projectFileName); - if (project) { - projects = [project]; - } - } - else { - var scriptInfo = this.projectService.getScriptInfo(args.file); - projects = scriptInfo.containingProjects; - } - projects = ts.filter(projects, function (p) { return p.languageServiceEnabled; }); - if (!projects || !projects.length) { - return server.Errors.ThrowNoProject(); - } - return projects; - }; - Session.prototype.getRenameLocations = function (args, simplifiedResult) { - var file = server.toNormalizedPath(args.file); - var info = this.projectService.getScriptInfoForNormalizedPath(file); - var position = this.getPosition(args, info); - var projects = this.getProjects(args); - if (simplifiedResult) { - var defaultProject = projects[0]; - var renameInfo = defaultProject.getLanguageService().getRenameInfo(file, position); - if (!renameInfo) { - return undefined; - } - if (!renameInfo.canRename) { - return { - info: renameInfo, - locs: [] - }; - } - var fileSpans = server.combineProjectOutput(projects, function (project) { - var renameLocations = project.getLanguageService().findRenameLocations(file, position, args.findInStrings, args.findInComments); - if (!renameLocations) { - return []; - } - return renameLocations.map(function (location) { - var locationScriptInfo = project.getScriptInfo(location.fileName); - return { - file: location.fileName, - start: locationScriptInfo.positionToLineOffset(location.textSpan.start), - end: locationScriptInfo.positionToLineOffset(ts.textSpanEnd(location.textSpan)), - }; - }); - }, compareRenameLocation, function (a, b) { return a.file === b.file && a.start.line === b.start.line && a.start.offset === b.start.offset; }); - var locs = fileSpans.reduce(function (accum, cur) { - var curFileAccum; - if (accum.length > 0) { - curFileAccum = accum[accum.length - 1]; - if (curFileAccum.file !== cur.file) { - curFileAccum = undefined; - } - } - if (!curFileAccum) { - curFileAccum = { file: cur.file, locs: [] }; - accum.push(curFileAccum); - } - curFileAccum.locs.push({ start: cur.start, end: cur.end }); - return accum; - }, []); - return { info: renameInfo, locs: locs }; - } - else { - return server.combineProjectOutput(projects, function (p) { return p.getLanguageService().findRenameLocations(file, position, args.findInStrings, args.findInComments); }, undefined, renameLocationIsEqualTo); - } - function renameLocationIsEqualTo(a, b) { - if (a === b) { - return true; - } - if (!a || !b) { - return false; - } - return a.fileName === b.fileName && - a.textSpan.start === b.textSpan.start && - a.textSpan.length === b.textSpan.length; - } - function compareRenameLocation(a, b) { - if (a.file < b.file) { - return -1; - } - else if (a.file > b.file) { - return 1; - } - else { - if (a.start.line < b.start.line) { - return 1; - } - else if (a.start.line > b.start.line) { - return -1; - } - else { - return b.start.offset - a.start.offset; - } - } - } - }; - Session.prototype.getReferences = function (args, simplifiedResult) { - var file = server.toNormalizedPath(args.file); - var projects = this.getProjects(args); - var defaultProject = projects[0]; - var scriptInfo = defaultProject.getScriptInfoForNormalizedPath(file); - var position = this.getPosition(args, scriptInfo); - if (simplifiedResult) { - var nameInfo = defaultProject.getLanguageService().getQuickInfoAtPosition(file, position); - if (!nameInfo) { - return undefined; - } - var displayString = ts.displayPartsToString(nameInfo.displayParts); - var nameSpan = nameInfo.textSpan; - var nameColStart = scriptInfo.positionToLineOffset(nameSpan.start).offset; - var nameText = scriptInfo.snap().getText(nameSpan.start, ts.textSpanEnd(nameSpan)); - var refs = server.combineProjectOutput(projects, function (project) { - var references = project.getLanguageService().getReferencesAtPosition(file, position); - if (!references) { - return []; - } - return references.map(function (ref) { - var refScriptInfo = project.getScriptInfo(ref.fileName); - var start = refScriptInfo.positionToLineOffset(ref.textSpan.start); - var refLineSpan = refScriptInfo.lineToTextSpan(start.line - 1); - var lineText = refScriptInfo.snap().getText(refLineSpan.start, ts.textSpanEnd(refLineSpan)).replace(/\r|\n/g, ""); - return { - file: ref.fileName, - start: start, - lineText: lineText, - end: refScriptInfo.positionToLineOffset(ts.textSpanEnd(ref.textSpan)), - isWriteAccess: ref.isWriteAccess, - isDefinition: ref.isDefinition - }; - }); - }, compareFileStart, areReferencesResponseItemsForTheSameLocation); - return { - refs: refs, - symbolName: nameText, - symbolStartOffset: nameColStart, - symbolDisplayString: displayString - }; - } - else { - return server.combineProjectOutput(projects, function (project) { return project.getLanguageService().findReferences(file, position); }, undefined, undefined); - } - function areReferencesResponseItemsForTheSameLocation(a, b) { - if (a && b) { - return a.file === b.file && - a.start === b.start && - a.end === b.end; - } - return false; - } - }; - Session.prototype.openClientFile = function (fileName, fileContent, scriptKind) { - var _a = this.projectService.openClientFileWithNormalizedPath(fileName, fileContent, scriptKind), configFileName = _a.configFileName, configFileErrors = _a.configFileErrors; - if (this.eventHander) { - this.eventHander({ - eventName: "configFileDiag", - data: { triggerFile: fileName, configFileName: configFileName, diagnostics: configFileErrors || [] } - }); - } - }; - Session.prototype.getPosition = function (args, scriptInfo) { - return args.position !== undefined ? args.position : scriptInfo.lineOffsetToPosition(args.line, args.offset); - }; - Session.prototype.getFileAndProject = function (args, errorOnMissingProject) { - if (errorOnMissingProject === void 0) { errorOnMissingProject = true; } - return this.getFileAndProjectWorker(args.file, args.projectFileName, true, errorOnMissingProject); - }; - Session.prototype.getFileAndProjectWithoutRefreshingInferredProjects = function (args, errorOnMissingProject) { - if (errorOnMissingProject === void 0) { errorOnMissingProject = true; } - return this.getFileAndProjectWorker(args.file, args.projectFileName, false, errorOnMissingProject); - }; - Session.prototype.getFileAndProjectWorker = function (uncheckedFileName, projectFileName, refreshInferredProjects, errorOnMissingProject) { - var file = server.toNormalizedPath(uncheckedFileName); - var project = this.getProject(projectFileName) || this.projectService.getDefaultProjectForFile(file, refreshInferredProjects); - if (!project && errorOnMissingProject) { - return server.Errors.ThrowNoProject(); - } - return { file: file, project: project }; - }; - Session.prototype.getOutliningSpans = function (args) { - var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; - return project.getLanguageService(false).getOutliningSpans(file); - }; - Session.prototype.getTodoComments = function (args) { - var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; - return project.getLanguageService().getTodoComments(file, args.descriptors); - }; - Session.prototype.getDocCommentTemplate = function (args) { - var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; - var scriptInfo = project.getScriptInfoForNormalizedPath(file); - var position = this.getPosition(args, scriptInfo); - return project.getLanguageService(false).getDocCommentTemplateAtPosition(file, position); - }; - Session.prototype.getIndentation = function (args) { - var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; - var position = this.getPosition(args, project.getScriptInfoForNormalizedPath(file)); - var options = args.options ? server.convertFormatOptions(args.options) : this.projectService.getFormatCodeOptions(file); - var indentation = project.getLanguageService(false).getIndentationAtPosition(file, position, options); - return { position: position, indentation: indentation }; - }; - Session.prototype.getBreakpointStatement = function (args) { - var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; - var position = this.getPosition(args, project.getScriptInfoForNormalizedPath(file)); - return project.getLanguageService(false).getBreakpointStatementAtPosition(file, position); - }; - Session.prototype.getNameOrDottedNameSpan = function (args) { - var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; - var position = this.getPosition(args, project.getScriptInfoForNormalizedPath(file)); - return project.getLanguageService(false).getNameOrDottedNameSpan(file, position, position); - }; - Session.prototype.isValidBraceCompletion = function (args) { - var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; - var position = this.getPosition(args, project.getScriptInfoForNormalizedPath(file)); - return project.getLanguageService(false).isValidBraceCompletionAtPosition(file, position, args.openingBrace.charCodeAt(0)); - }; - Session.prototype.getQuickInfoWorker = function (args, simplifiedResult) { - var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; - var scriptInfo = project.getScriptInfoForNormalizedPath(file); - var quickInfo = project.getLanguageService().getQuickInfoAtPosition(file, this.getPosition(args, scriptInfo)); - if (!quickInfo) { - return undefined; - } - if (simplifiedResult) { - var displayString = ts.displayPartsToString(quickInfo.displayParts); - var docString = ts.displayPartsToString(quickInfo.documentation); - return { - kind: quickInfo.kind, - kindModifiers: quickInfo.kindModifiers, - start: scriptInfo.positionToLineOffset(quickInfo.textSpan.start), - end: scriptInfo.positionToLineOffset(ts.textSpanEnd(quickInfo.textSpan)), - displayString: displayString, - documentation: docString, - }; - } - else { - return quickInfo; - } - }; - Session.prototype.getFormattingEditsForRange = function (args) { - var _this = this; - var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; - var scriptInfo = project.getScriptInfoForNormalizedPath(file); - var startPosition = scriptInfo.lineOffsetToPosition(args.line, args.offset); - var endPosition = scriptInfo.lineOffsetToPosition(args.endLine, args.endOffset); - var edits = project.getLanguageService(false).getFormattingEditsForRange(file, startPosition, endPosition, this.projectService.getFormatCodeOptions(file)); - if (!edits) { - return undefined; - } - return edits.map(function (edit) { return _this.convertTextChangeToCodeEdit(edit, scriptInfo); }); - }; - Session.prototype.getFormattingEditsForRangeFull = function (args) { - var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; - var options = args.options ? server.convertFormatOptions(args.options) : this.projectService.getFormatCodeOptions(file); - return project.getLanguageService(false).getFormattingEditsForRange(file, args.position, args.endPosition, options); - }; - Session.prototype.getFormattingEditsForDocumentFull = function (args) { - var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; - var options = args.options ? server.convertFormatOptions(args.options) : this.projectService.getFormatCodeOptions(file); - return project.getLanguageService(false).getFormattingEditsForDocument(file, options); - }; - Session.prototype.getFormattingEditsAfterKeystrokeFull = function (args) { - var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; - var options = args.options ? server.convertFormatOptions(args.options) : this.projectService.getFormatCodeOptions(file); - return project.getLanguageService(false).getFormattingEditsAfterKeystroke(file, args.position, args.key, options); - }; - Session.prototype.getFormattingEditsAfterKeystroke = function (args) { - var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; - var scriptInfo = project.getScriptInfoForNormalizedPath(file); - var position = scriptInfo.lineOffsetToPosition(args.line, args.offset); - var formatOptions = this.projectService.getFormatCodeOptions(file); - var edits = project.getLanguageService(false).getFormattingEditsAfterKeystroke(file, position, args.key, formatOptions); - if ((args.key == "\n") && ((!edits) || (edits.length === 0) || allEditsBeforePos(edits, position))) { - var lineInfo = scriptInfo.getLineInfo(args.line); - if (lineInfo && (lineInfo.leaf) && (lineInfo.leaf.text)) { - var lineText = lineInfo.leaf.text; - if (lineText.search("\\S") < 0) { - var preferredIndent = project.getLanguageService(false).getIndentationAtPosition(file, position, formatOptions); - var hasIndent = 0; - var i = void 0, len = void 0; - for (i = 0, len = lineText.length; i < len; i++) { - if (lineText.charAt(i) == " ") { - hasIndent++; - } - else if (lineText.charAt(i) == "\t") { - hasIndent += formatOptions.tabSize; - } - else { - break; - } - } - if (preferredIndent !== hasIndent) { - var firstNoWhiteSpacePosition = lineInfo.offset + i; - edits.push({ - span: ts.createTextSpanFromBounds(lineInfo.offset, firstNoWhiteSpacePosition), - newText: ts.formatting.getIndentationString(preferredIndent, formatOptions) - }); - } - } - } - } - if (!edits) { - return undefined; - } - return edits.map(function (edit) { - return { - start: scriptInfo.positionToLineOffset(edit.span.start), - end: scriptInfo.positionToLineOffset(ts.textSpanEnd(edit.span)), - newText: edit.newText ? edit.newText : "" - }; - }); - }; - Session.prototype.getCompletions = function (args, simplifiedResult) { - var _this = this; - var prefix = args.prefix || ""; - var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; - var scriptInfo = project.getScriptInfoForNormalizedPath(file); - var position = this.getPosition(args, scriptInfo); - var completions = project.getLanguageService().getCompletionsAtPosition(file, position); - if (!completions) { - return undefined; - } - if (simplifiedResult) { - return completions.entries.reduce(function (result, entry) { - if (completions.isMemberCompletion || (entry.name.toLowerCase().indexOf(prefix.toLowerCase()) === 0)) { - var name_51 = entry.name, kind = entry.kind, kindModifiers = entry.kindModifiers, sortText = entry.sortText, replacementSpan = entry.replacementSpan; - var convertedSpan = replacementSpan ? _this.decorateSpan(replacementSpan, scriptInfo) : undefined; - result.push({ name: name_51, kind: kind, kindModifiers: kindModifiers, sortText: sortText, replacementSpan: convertedSpan }); - } - return result; - }, []).sort(function (a, b) { return ts.compareStrings(a.name, b.name); }); - } - else { - return completions; - } - }; - Session.prototype.getCompletionEntryDetails = function (args) { - var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; - var scriptInfo = project.getScriptInfoForNormalizedPath(file); - var position = this.getPosition(args, scriptInfo); - return args.entryNames.reduce(function (accum, entryName) { - var details = project.getLanguageService().getCompletionEntryDetails(file, position, entryName); - if (details) { - accum.push(details); - } - return accum; - }, []); - }; - Session.prototype.getCompileOnSaveAffectedFileList = function (args) { - var info = this.projectService.getScriptInfo(args.file); - var result = []; - if (!info) { - return []; - } - var projectsToSearch = args.projectFileName ? [this.projectService.findProject(args.projectFileName)] : info.containingProjects; - for (var _i = 0, projectsToSearch_1 = projectsToSearch; _i < projectsToSearch_1.length; _i++) { - var project = projectsToSearch_1[_i]; - if (project.compileOnSaveEnabled && project.languageServiceEnabled) { - result.push({ - projectFileName: project.getProjectName(), - fileNames: project.getCompileOnSaveAffectedFileList(info) - }); - } - } - return result; - }; - Session.prototype.emitFile = function (args) { - var _this = this; - var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; - if (!project) { - server.Errors.ThrowNoProject(); - } - var scriptInfo = project.getScriptInfo(file); - return project.builder.emitFile(scriptInfo, function (path, data, writeByteOrderMark) { return _this.host.writeFile(path, data, writeByteOrderMark); }); - }; - Session.prototype.getSignatureHelpItems = function (args, simplifiedResult) { - var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; - var scriptInfo = project.getScriptInfoForNormalizedPath(file); - var position = this.getPosition(args, scriptInfo); - var helpItems = project.getLanguageService().getSignatureHelpItems(file, position); - if (!helpItems) { - return undefined; - } - if (simplifiedResult) { - var span_16 = helpItems.applicableSpan; - return { - items: helpItems.items, - applicableSpan: { - start: scriptInfo.positionToLineOffset(span_16.start), - end: scriptInfo.positionToLineOffset(span_16.start + span_16.length) - }, - selectedItemIndex: helpItems.selectedItemIndex, - argumentIndex: helpItems.argumentIndex, - argumentCount: helpItems.argumentCount, - }; - } - else { - return helpItems; - } - }; - Session.prototype.getDiagnostics = function (delay, fileNames) { - var _this = this; - var checkList = fileNames.reduce(function (accum, uncheckedFileName) { - var fileName = server.toNormalizedPath(uncheckedFileName); - var project = _this.projectService.getDefaultProjectForFile(fileName, true); - if (project) { - accum.push({ fileName: fileName, project: project }); - } - return accum; - }, []); - if (checkList.length > 0) { - this.updateErrorCheck(checkList, this.changeSeq, function (n) { return n === _this.changeSeq; }, delay); - } - }; - Session.prototype.change = function (args) { - var _this = this; - var _a = this.getFileAndProject(args, false), file = _a.file, project = _a.project; - if (project) { - var scriptInfo = project.getScriptInfoForNormalizedPath(file); - var start = scriptInfo.lineOffsetToPosition(args.line, args.offset); - var end = scriptInfo.lineOffsetToPosition(args.endLine, args.endOffset); - if (start >= 0) { - scriptInfo.editContent(start, end, args.insertString); - this.changeSeq++; - } - this.updateProjectStructure(this.changeSeq, function (n) { return n === _this.changeSeq; }); - } - }; - Session.prototype.reload = function (args, reqSeq) { - var file = server.toNormalizedPath(args.file); - var tempFileName = args.tmpfile && server.toNormalizedPath(args.tmpfile); - var project = this.projectService.getDefaultProjectForFile(file, true); - if (project) { - this.changeSeq++; - if (project.reloadScript(file, tempFileName)) { - this.output(undefined, CommandNames.Reload, reqSeq); - } - } - }; - Session.prototype.saveToTmp = function (fileName, tempFileName) { - var scriptInfo = this.projectService.getScriptInfo(fileName); - if (scriptInfo) { - scriptInfo.saveTo(tempFileName); - } - }; - Session.prototype.closeClientFile = function (fileName) { - if (!fileName) { - return; - } - var file = ts.normalizePath(fileName); - this.projectService.closeClientFile(file); - }; - Session.prototype.decorateNavigationBarItems = function (items, scriptInfo) { - var _this = this; - return ts.map(items, function (item) { return ({ - text: item.text, - kind: item.kind, - kindModifiers: item.kindModifiers, - spans: item.spans.map(function (span) { return _this.decorateSpan(span, scriptInfo); }), - childItems: _this.decorateNavigationBarItems(item.childItems, scriptInfo), - indent: item.indent - }); }); - }; - Session.prototype.getNavigationBarItems = function (args, simplifiedResult) { - var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; - var items = project.getLanguageService(false).getNavigationBarItems(file); - return !items - ? undefined - : simplifiedResult - ? this.decorateNavigationBarItems(items, project.getScriptInfoForNormalizedPath(file)) - : items; - }; - Session.prototype.decorateNavigationTree = function (tree, scriptInfo) { - var _this = this; - return { - text: tree.text, - kind: tree.kind, - kindModifiers: tree.kindModifiers, - spans: tree.spans.map(function (span) { return _this.decorateSpan(span, scriptInfo); }), - childItems: ts.map(tree.childItems, function (item) { return _this.decorateNavigationTree(item, scriptInfo); }) - }; - }; - Session.prototype.decorateSpan = function (span, scriptInfo) { - return { - start: scriptInfo.positionToLineOffset(span.start), - end: scriptInfo.positionToLineOffset(ts.textSpanEnd(span)) - }; - }; - Session.prototype.getNavigationTree = function (args, simplifiedResult) { - var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; - var tree = project.getLanguageService(false).getNavigationTree(file); - return !tree - ? undefined - : simplifiedResult - ? this.decorateNavigationTree(tree, project.getScriptInfoForNormalizedPath(file)) - : tree; - }; - Session.prototype.getNavigateToItems = function (args, simplifiedResult) { - var projects = this.getProjects(args); - var fileName = args.currentFileOnly ? args.file && ts.normalizeSlashes(args.file) : undefined; - if (simplifiedResult) { - return server.combineProjectOutput(projects, function (project) { - var navItems = project.getLanguageService().getNavigateToItems(args.searchValue, args.maxResultCount, fileName, project.isNonTsProject()); - if (!navItems) { - return []; - } - return navItems.map(function (navItem) { - var scriptInfo = project.getScriptInfo(navItem.fileName); - var start = scriptInfo.positionToLineOffset(navItem.textSpan.start); - var end = scriptInfo.positionToLineOffset(ts.textSpanEnd(navItem.textSpan)); - var bakedItem = { - name: navItem.name, - kind: navItem.kind, - file: navItem.fileName, - start: start, - end: end, - }; - if (navItem.kindModifiers && (navItem.kindModifiers !== "")) { - bakedItem.kindModifiers = navItem.kindModifiers; - } - if (navItem.matchKind !== "none") { - bakedItem.matchKind = navItem.matchKind; - } - if (navItem.containerName && (navItem.containerName.length > 0)) { - bakedItem.containerName = navItem.containerName; - } - if (navItem.containerKind && (navItem.containerKind.length > 0)) { - bakedItem.containerKind = navItem.containerKind; - } - return bakedItem; - }); - }, undefined, areNavToItemsForTheSameLocation); - } - else { - return server.combineProjectOutput(projects, function (project) { return project.getLanguageService().getNavigateToItems(args.searchValue, args.maxResultCount, fileName, project.isNonTsProject()); }, undefined, navigateToItemIsEqualTo); - } - function navigateToItemIsEqualTo(a, b) { - if (a === b) { - return true; - } - if (!a || !b) { - return false; - } - return a.containerKind === b.containerKind && - a.containerName === b.containerName && - a.fileName === b.fileName && - a.isCaseSensitive === b.isCaseSensitive && - a.kind === b.kind && - a.kindModifiers === b.containerName && - a.matchKind === b.matchKind && - a.name === b.name && - a.textSpan.start === b.textSpan.start && - a.textSpan.length === b.textSpan.length; - } - function areNavToItemsForTheSameLocation(a, b) { - if (a && b) { - return a.file === b.file && - a.start === b.start && - a.end === b.end; - } - return false; - } - }; - Session.prototype.getSupportedCodeFixes = function () { - return ts.getSupportedCodeFixes(); - }; - Session.prototype.getCodeFixes = function (args, simplifiedResult) { - var _this = this; - var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; - var scriptInfo = project.getScriptInfoForNormalizedPath(file); - var startPosition = getStartPosition(); - var endPosition = getEndPosition(); - var codeActions = project.getLanguageService().getCodeFixesAtPosition(file, startPosition, endPosition, args.errorCodes); - if (!codeActions) { - return undefined; - } - if (simplifiedResult) { - return codeActions.map(function (codeAction) { return _this.mapCodeAction(codeAction, scriptInfo); }); - } - else { - return codeActions; - } - function getStartPosition() { - return args.startPosition !== undefined ? args.startPosition : scriptInfo.lineOffsetToPosition(args.startLine, args.startOffset); - } - function getEndPosition() { - return args.endPosition !== undefined ? args.endPosition : scriptInfo.lineOffsetToPosition(args.endLine, args.endOffset); - } - }; - Session.prototype.mapCodeAction = function (codeAction, scriptInfo) { - var _this = this; - return { - description: codeAction.description, - changes: codeAction.changes.map(function (change) { return ({ - fileName: change.fileName, - textChanges: change.textChanges.map(function (textChange) { return _this.convertTextChangeToCodeEdit(textChange, scriptInfo); }) - }); }) - }; - }; - Session.prototype.convertTextChangeToCodeEdit = function (change, scriptInfo) { - return { - start: scriptInfo.positionToLineOffset(change.span.start), - end: scriptInfo.positionToLineOffset(change.span.start + change.span.length), - newText: change.newText ? change.newText : "" - }; - }; - Session.prototype.getBraceMatching = function (args, simplifiedResult) { - var _this = this; - var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; - var scriptInfo = project.getScriptInfoForNormalizedPath(file); - var position = this.getPosition(args, scriptInfo); - var spans = project.getLanguageService(false).getBraceMatchingAtPosition(file, position); - return !spans - ? undefined - : simplifiedResult - ? spans.map(function (span) { return _this.decorateSpan(span, scriptInfo); }) - : spans; - }; - Session.prototype.getDiagnosticsForProject = function (delay, fileName) { - var _this = this; - var _a = this.getProjectInfoWorker(fileName, undefined, true), fileNames = _a.fileNames, languageServiceDisabled = _a.languageServiceDisabled; - if (languageServiceDisabled) { - return; - } - var fileNamesInProject = fileNames.filter(function (value) { return value.indexOf("lib.d.ts") < 0; }); - var highPriorityFiles = []; - var mediumPriorityFiles = []; - var lowPriorityFiles = []; - var veryLowPriorityFiles = []; - var normalizedFileName = server.toNormalizedPath(fileName); - var project = this.projectService.getDefaultProjectForFile(normalizedFileName, true); - for (var _i = 0, fileNamesInProject_1 = fileNamesInProject; _i < fileNamesInProject_1.length; _i++) { - var fileNameInProject = fileNamesInProject_1[_i]; - if (this.getCanonicalFileName(fileNameInProject) == this.getCanonicalFileName(fileName)) - highPriorityFiles.push(fileNameInProject); - else { - var info = this.projectService.getScriptInfo(fileNameInProject); - if (!info.isOpen) { - if (fileNameInProject.indexOf(".d.ts") > 0) - veryLowPriorityFiles.push(fileNameInProject); - else - lowPriorityFiles.push(fileNameInProject); - } - else - mediumPriorityFiles.push(fileNameInProject); - } - } - fileNamesInProject = highPriorityFiles.concat(mediumPriorityFiles).concat(lowPriorityFiles).concat(veryLowPriorityFiles); - if (fileNamesInProject.length > 0) { - var checkList = fileNamesInProject.map(function (fileName) { return ({ fileName: fileName, project: project }); }); - this.updateErrorCheck(checkList, this.changeSeq, function (n) { return n == _this.changeSeq; }, delay, 200, false); - } - }; - Session.prototype.getCanonicalFileName = function (fileName) { - var name = this.host.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(); - return ts.normalizePath(name); - }; - Session.prototype.exit = function () { - }; - Session.prototype.notRequired = function () { - return { responseRequired: false }; - }; - Session.prototype.requiredResponse = function (response) { - return { response: response, responseRequired: true }; - }; - Session.prototype.addProtocolHandler = function (command, handler) { - if (command in this.handlers) { - throw new Error("Protocol handler already exists for command \"" + command + "\""); - } - this.handlers[command] = handler; - }; - Session.prototype.executeCommand = function (request) { - var handler = this.handlers[request.command]; - if (handler) { - return handler(request); - } - else { - this.logger.msg("Unrecognized JSON command: " + JSON.stringify(request), server.Msg.Err); - this.output(undefined, CommandNames.Unknown, request.seq, "Unrecognized JSON command: " + request.command); - return { responseRequired: false }; - } - }; - Session.prototype.onMessage = function (message) { - this.gcTimer.scheduleCollect(); - var start; - if (this.logger.hasLevel(server.LogLevel.requestTime)) { - start = this.hrtime(); - if (this.logger.hasLevel(server.LogLevel.verbose)) { - this.logger.info("request: " + message); - } - } - var request; - try { - request = JSON.parse(message); - var _a = this.executeCommand(request), response = _a.response, responseRequired = _a.responseRequired; - if (this.logger.hasLevel(server.LogLevel.requestTime)) { - var elapsedTime = hrTimeToMilliseconds(this.hrtime(start)).toFixed(4); - if (responseRequired) { - this.logger.perftrc(request.seq + "::" + request.command + ": elapsed time (in milliseconds) " + elapsedTime); - } - else { - this.logger.perftrc(request.seq + "::" + request.command + ": async elapsed time (in milliseconds) " + elapsedTime); - } - } - if (response) { - this.output(response, request.command, request.seq); - } - else if (responseRequired) { - this.output(undefined, request.command, request.seq, "No content available."); - } - } - catch (err) { - if (err instanceof ts.OperationCanceledException) { - this.output({ canceled: true }, request.command, request.seq); - return; - } - this.logError(err, message); - this.output(undefined, request ? request.command : CommandNames.Unknown, request ? request.seq : 0, "Error processing request. " + err.message + "\n" + err.stack); - } - }; - return Session; - }()); - server.Session = Session; - })(server = ts.server || (ts.server = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var server; - (function (server) { - var lineCollectionCapacity = 4; - var CharRangeSection; - (function (CharRangeSection) { - CharRangeSection[CharRangeSection["PreStart"] = 0] = "PreStart"; - CharRangeSection[CharRangeSection["Start"] = 1] = "Start"; - CharRangeSection[CharRangeSection["Entire"] = 2] = "Entire"; - CharRangeSection[CharRangeSection["Mid"] = 3] = "Mid"; - CharRangeSection[CharRangeSection["End"] = 4] = "End"; - CharRangeSection[CharRangeSection["PostEnd"] = 5] = "PostEnd"; - })(CharRangeSection = server.CharRangeSection || (server.CharRangeSection = {})); - var BaseLineIndexWalker = (function () { - function BaseLineIndexWalker() { - this.goSubtree = true; - this.done = false; - } - BaseLineIndexWalker.prototype.leaf = function (_rangeStart, _rangeLength, _ll) { - }; - return BaseLineIndexWalker; - }()); - var EditWalker = (function (_super) { - __extends(EditWalker, _super); - function EditWalker() { - var _this = _super.call(this) || this; - _this.lineIndex = new LineIndex(); - _this.endBranch = []; - _this.state = CharRangeSection.Entire; - _this.initialText = ""; - _this.trailingText = ""; - _this.suppressTrailingText = false; - _this.lineIndex.root = new LineNode(); - _this.startPath = [_this.lineIndex.root]; - _this.stack = [_this.lineIndex.root]; - return _this; - } - EditWalker.prototype.insertLines = function (insertedText) { - if (this.suppressTrailingText) { - this.trailingText = ""; - } - if (insertedText) { - insertedText = this.initialText + insertedText + this.trailingText; - } - else { - insertedText = this.initialText + this.trailingText; - } - var lm = LineIndex.linesFromText(insertedText); - var lines = lm.lines; - if (lines.length > 1) { - if (lines[lines.length - 1] == "") { - lines.length--; - } - } - var branchParent; - var lastZeroCount; - for (var k = this.endBranch.length - 1; k >= 0; k--) { - this.endBranch[k].updateCounts(); - if (this.endBranch[k].charCount() === 0) { - lastZeroCount = this.endBranch[k]; - if (k > 0) { - branchParent = this.endBranch[k - 1]; - } - else { - branchParent = this.branchNode; - } - } - } - if (lastZeroCount) { - branchParent.remove(lastZeroCount); - } - var insertionNode = this.startPath[this.startPath.length - 2]; - var leafNode = this.startPath[this.startPath.length - 1]; - var len = lines.length; - if (len > 0) { - leafNode.text = lines[0]; - if (len > 1) { - var insertedNodes = new Array(len - 1); - var startNode = leafNode; - for (var i = 1, len_1 = lines.length; i < len_1; i++) { - insertedNodes[i - 1] = new LineLeaf(lines[i]); - } - var pathIndex = this.startPath.length - 2; - while (pathIndex >= 0) { - insertionNode = this.startPath[pathIndex]; - insertedNodes = insertionNode.insertAt(startNode, insertedNodes); - pathIndex--; - startNode = insertionNode; - } - var insertedNodesLen = insertedNodes.length; - while (insertedNodesLen > 0) { - var newRoot = new LineNode(); - newRoot.add(this.lineIndex.root); - insertedNodes = newRoot.insertAt(this.lineIndex.root, insertedNodes); - insertedNodesLen = insertedNodes.length; - this.lineIndex.root = newRoot; - } - this.lineIndex.root.updateCounts(); - } - else { - for (var j = this.startPath.length - 2; j >= 0; j--) { - this.startPath[j].updateCounts(); - } - } - } - else { - insertionNode.remove(leafNode); - for (var j = this.startPath.length - 2; j >= 0; j--) { - this.startPath[j].updateCounts(); - } - } - return this.lineIndex; - }; - EditWalker.prototype.post = function (_relativeStart, _relativeLength, lineCollection) { - if (lineCollection === this.lineCollectionAtBranch) { - this.state = CharRangeSection.End; - } - this.stack.length--; - return undefined; - }; - EditWalker.prototype.pre = function (_relativeStart, _relativeLength, lineCollection, _parent, nodeType) { - var currentNode = this.stack[this.stack.length - 1]; - if ((this.state === CharRangeSection.Entire) && (nodeType === CharRangeSection.Start)) { - this.state = CharRangeSection.Start; - this.branchNode = currentNode; - this.lineCollectionAtBranch = lineCollection; - } - var child; - function fresh(node) { - if (node.isLeaf()) { - return new LineLeaf(""); - } - else - return new LineNode(); - } - switch (nodeType) { - case CharRangeSection.PreStart: - this.goSubtree = false; - if (this.state !== CharRangeSection.End) { - currentNode.add(lineCollection); - } - break; - case CharRangeSection.Start: - if (this.state === CharRangeSection.End) { - this.goSubtree = false; - } - else { - child = fresh(lineCollection); - currentNode.add(child); - this.startPath[this.startPath.length] = child; - } - break; - case CharRangeSection.Entire: - if (this.state !== CharRangeSection.End) { - child = fresh(lineCollection); - currentNode.add(child); - this.startPath[this.startPath.length] = child; - } - else { - if (!lineCollection.isLeaf()) { - child = fresh(lineCollection); - currentNode.add(child); - this.endBranch[this.endBranch.length] = child; - } - } - break; - case CharRangeSection.Mid: - this.goSubtree = false; - break; - case CharRangeSection.End: - if (this.state !== CharRangeSection.End) { - this.goSubtree = false; - } - else { - if (!lineCollection.isLeaf()) { - child = fresh(lineCollection); - currentNode.add(child); - this.endBranch[this.endBranch.length] = child; - } - } - break; - case CharRangeSection.PostEnd: - this.goSubtree = false; - if (this.state !== CharRangeSection.Start) { - currentNode.add(lineCollection); - } - break; - } - if (this.goSubtree) { - this.stack[this.stack.length] = child; - } - return lineCollection; - }; - EditWalker.prototype.leaf = function (relativeStart, relativeLength, ll) { - if (this.state === CharRangeSection.Start) { - this.initialText = ll.text.substring(0, relativeStart); - } - else if (this.state === CharRangeSection.Entire) { - this.initialText = ll.text.substring(0, relativeStart); - this.trailingText = ll.text.substring(relativeStart + relativeLength); - } - else { - this.trailingText = ll.text.substring(relativeStart + relativeLength); - } - }; - return EditWalker; - }(BaseLineIndexWalker)); - var TextChange = (function () { - function TextChange(pos, deleteLen, insertedText) { - this.pos = pos; - this.deleteLen = deleteLen; - this.insertedText = insertedText; - } - TextChange.prototype.getTextChangeRange = function () { - return ts.createTextChangeRange(ts.createTextSpan(this.pos, this.deleteLen), this.insertedText ? this.insertedText.length : 0); - }; - return TextChange; - }()); - server.TextChange = TextChange; - var ScriptVersionCache = (function () { - function ScriptVersionCache() { - this.changes = []; - this.versions = new Array(ScriptVersionCache.maxVersions); - this.minVersion = 0; - this.currentVersion = 0; - } - ScriptVersionCache.prototype.versionToIndex = function (version) { - if (version < this.minVersion || version > this.currentVersion) { - return undefined; - } - return version % ScriptVersionCache.maxVersions; - }; - ScriptVersionCache.prototype.currentVersionToIndex = function () { - return this.currentVersion % ScriptVersionCache.maxVersions; - }; - ScriptVersionCache.prototype.edit = function (pos, deleteLen, insertedText) { - this.changes[this.changes.length] = new TextChange(pos, deleteLen, insertedText); - if ((this.changes.length > ScriptVersionCache.changeNumberThreshold) || - (deleteLen > ScriptVersionCache.changeLengthThreshold) || - (insertedText && (insertedText.length > ScriptVersionCache.changeLengthThreshold))) { - this.getSnapshot(); - } - }; - ScriptVersionCache.prototype.latest = function () { - return this.versions[this.currentVersionToIndex()]; - }; - ScriptVersionCache.prototype.latestVersion = function () { - if (this.changes.length > 0) { - this.getSnapshot(); - } - return this.currentVersion; - }; - ScriptVersionCache.prototype.reloadFromFile = function (filename) { - var content = this.host.readFile(filename); - if (!content) { - content = ""; - } - this.reload(content); - }; - ScriptVersionCache.prototype.reload = function (script) { - this.currentVersion++; - this.changes = []; - var snap = new LineIndexSnapshot(this.currentVersion, this); - for (var i = 0; i < this.versions.length; i++) { - this.versions[i] = undefined; - } - this.versions[this.currentVersionToIndex()] = snap; - snap.index = new LineIndex(); - var lm = LineIndex.linesFromText(script); - snap.index.load(lm.lines); - this.minVersion = this.currentVersion; - }; - ScriptVersionCache.prototype.getSnapshot = function () { - var snap = this.versions[this.currentVersionToIndex()]; - if (this.changes.length > 0) { - var snapIndex = snap.index; - for (var i = 0, len = this.changes.length; i < len; i++) { - var change = this.changes[i]; - snapIndex = snapIndex.edit(change.pos, change.deleteLen, change.insertedText); - } - snap = new LineIndexSnapshot(this.currentVersion + 1, this); - snap.index = snapIndex; - snap.changesSincePreviousVersion = this.changes; - this.currentVersion = snap.version; - this.versions[this.currentVersionToIndex()] = snap; - this.changes = []; - if ((this.currentVersion - this.minVersion) >= ScriptVersionCache.maxVersions) { - this.minVersion = (this.currentVersion - ScriptVersionCache.maxVersions) + 1; - } - } - return snap; - }; - ScriptVersionCache.prototype.getTextChangesBetweenVersions = function (oldVersion, newVersion) { - if (oldVersion < newVersion) { - if (oldVersion >= this.minVersion) { - var textChangeRanges = []; - for (var i = oldVersion + 1; i <= newVersion; i++) { - var snap = this.versions[this.versionToIndex(i)]; - for (var j = 0, len = snap.changesSincePreviousVersion.length; j < len; j++) { - var textChange = snap.changesSincePreviousVersion[j]; - textChangeRanges[textChangeRanges.length] = textChange.getTextChangeRange(); - } - } - return ts.collapseTextChangeRangesAcrossMultipleVersions(textChangeRanges); - } - else { - return undefined; - } - } - else { - return ts.unchangedTextChangeRange; - } - }; - ScriptVersionCache.fromString = function (host, script) { - var svc = new ScriptVersionCache(); - var snap = new LineIndexSnapshot(0, svc); - svc.versions[svc.currentVersion] = snap; - svc.host = host; - snap.index = new LineIndex(); - var lm = LineIndex.linesFromText(script); - snap.index.load(lm.lines); - return svc; - }; - return ScriptVersionCache; - }()); - ScriptVersionCache.changeNumberThreshold = 8; - ScriptVersionCache.changeLengthThreshold = 256; - ScriptVersionCache.maxVersions = 8; - server.ScriptVersionCache = ScriptVersionCache; - var LineIndexSnapshot = (function () { - function LineIndexSnapshot(version, cache) { - this.version = version; - this.cache = cache; - this.changesSincePreviousVersion = []; - } - LineIndexSnapshot.prototype.getText = function (rangeStart, rangeEnd) { - return this.index.getText(rangeStart, rangeEnd - rangeStart); - }; - LineIndexSnapshot.prototype.getLength = function () { - return this.index.root.charCount(); - }; - LineIndexSnapshot.prototype.getLineStartPositions = function () { - var starts = [-1]; - var count = 1; - var pos = 0; - this.index.every(function (ll) { - starts[count] = pos; - count++; - pos += ll.text.length; - return true; - }, 0); - return starts; - }; - LineIndexSnapshot.prototype.getLineMapper = function () { - var _this = this; - return function (line) { - return _this.index.lineNumberToInfo(line).offset; - }; - }; - LineIndexSnapshot.prototype.getTextChangeRangeSinceVersion = function (scriptVersion) { - if (this.version <= scriptVersion) { - return ts.unchangedTextChangeRange; - } - else { - return this.cache.getTextChangesBetweenVersions(scriptVersion, this.version); - } - }; - LineIndexSnapshot.prototype.getChangeRange = function (oldSnapshot) { - var oldSnap = oldSnapshot; - return this.getTextChangeRangeSinceVersion(oldSnap.version); - }; - return LineIndexSnapshot; - }()); - server.LineIndexSnapshot = LineIndexSnapshot; - var LineIndex = (function () { - function LineIndex() { - this.checkEdits = false; - } - LineIndex.prototype.charOffsetToLineNumberAndPos = function (charOffset) { - return this.root.charOffsetToLineNumberAndPos(1, charOffset); - }; - LineIndex.prototype.lineNumberToInfo = function (lineNumber) { - var lineCount = this.root.lineCount(); - if (lineNumber <= lineCount) { - var lineInfo = this.root.lineNumberToInfo(lineNumber, 0); - lineInfo.line = lineNumber; - return lineInfo; - } - else { - return { - line: lineNumber, - offset: this.root.charCount() - }; - } - }; - LineIndex.prototype.load = function (lines) { - if (lines.length > 0) { - var leaves = []; - for (var i = 0, len = lines.length; i < len; i++) { - leaves[i] = new LineLeaf(lines[i]); - } - this.root = LineIndex.buildTreeFromBottom(leaves); - } - else { - this.root = new LineNode(); - } - }; - LineIndex.prototype.walk = function (rangeStart, rangeLength, walkFns) { - this.root.walk(rangeStart, rangeLength, walkFns); - }; - LineIndex.prototype.getText = function (rangeStart, rangeLength) { - var accum = ""; - if ((rangeLength > 0) && (rangeStart < this.root.charCount())) { - this.walk(rangeStart, rangeLength, { - goSubtree: true, - done: false, - leaf: function (relativeStart, relativeLength, ll) { - accum = accum.concat(ll.text.substring(relativeStart, relativeStart + relativeLength)); - } - }); - } - return accum; - }; - LineIndex.prototype.getLength = function () { - return this.root.charCount(); - }; - LineIndex.prototype.every = function (f, rangeStart, rangeEnd) { - if (!rangeEnd) { - rangeEnd = this.root.charCount(); - } - var walkFns = { - goSubtree: true, - done: false, - leaf: function (relativeStart, relativeLength, ll) { - if (!f(ll, relativeStart, relativeLength)) { - this.done = true; - } - } - }; - this.walk(rangeStart, rangeEnd - rangeStart, walkFns); - return !walkFns.done; - }; - LineIndex.prototype.edit = function (pos, deleteLength, newText) { - function editFlat(source, s, dl, nt) { - if (nt === void 0) { nt = ""; } - return source.substring(0, s) + nt + source.substring(s + dl, source.length); - } - if (this.root.charCount() === 0) { - if (newText !== undefined) { - this.load(LineIndex.linesFromText(newText).lines); - return this; - } - } - else { - var checkText = void 0; - if (this.checkEdits) { - checkText = editFlat(this.getText(0, this.root.charCount()), pos, deleteLength, newText); - } - var walker = new EditWalker(); - if (pos >= this.root.charCount()) { - pos = this.root.charCount() - 1; - var endString = this.getText(pos, 1); - if (newText) { - newText = endString + newText; - } - else { - newText = endString; - } - deleteLength = 0; - walker.suppressTrailingText = true; - } - else if (deleteLength > 0) { - var e = pos + deleteLength; - var lineInfo = this.charOffsetToLineNumberAndPos(e); - if ((lineInfo && (lineInfo.offset === 0))) { - deleteLength += lineInfo.text.length; - if (newText) { - newText = newText + lineInfo.text; - } - else { - newText = lineInfo.text; - } - } - } - if (pos < this.root.charCount()) { - this.root.walk(pos, deleteLength, walker); - walker.insertLines(newText); - } - if (this.checkEdits) { - var updatedText = this.getText(0, this.root.charCount()); - ts.Debug.assert(checkText == updatedText, "buffer edit mismatch"); - } - return walker.lineIndex; - } - }; - LineIndex.buildTreeFromBottom = function (nodes) { - var nodeCount = Math.ceil(nodes.length / lineCollectionCapacity); - var interiorNodes = []; - var nodeIndex = 0; - for (var i = 0; i < nodeCount; i++) { - interiorNodes[i] = new LineNode(); - var charCount = 0; - var lineCount = 0; - for (var j = 0; j < lineCollectionCapacity; j++) { - if (nodeIndex < nodes.length) { - interiorNodes[i].add(nodes[nodeIndex]); - charCount += nodes[nodeIndex].charCount(); - lineCount += nodes[nodeIndex].lineCount(); - } - else { - break; - } - nodeIndex++; - } - interiorNodes[i].totalChars = charCount; - interiorNodes[i].totalLines = lineCount; - } - if (interiorNodes.length === 1) { - return interiorNodes[0]; - } - else { - return this.buildTreeFromBottom(interiorNodes); - } - }; - LineIndex.linesFromText = function (text) { - var lineStarts = ts.computeLineStarts(text); - if (lineStarts.length === 0) { - return { lines: [], lineMap: lineStarts }; - } - var lines = new Array(lineStarts.length); - var lc = lineStarts.length - 1; - for (var lmi = 0; lmi < lc; lmi++) { - lines[lmi] = text.substring(lineStarts[lmi], lineStarts[lmi + 1]); - } - var endText = text.substring(lineStarts[lc]); - if (endText.length > 0) { - lines[lc] = endText; - } - else { - lines.length--; - } - return { lines: lines, lineMap: lineStarts }; - }; - return LineIndex; - }()); - server.LineIndex = LineIndex; - var LineNode = (function () { - function LineNode() { - this.totalChars = 0; - this.totalLines = 0; - this.children = []; - } - LineNode.prototype.isLeaf = function () { - return false; - }; - LineNode.prototype.updateCounts = function () { - this.totalChars = 0; - this.totalLines = 0; - for (var i = 0, len = this.children.length; i < len; i++) { - var child = this.children[i]; - this.totalChars += child.charCount(); - this.totalLines += child.lineCount(); - } - }; - LineNode.prototype.execWalk = function (rangeStart, rangeLength, walkFns, childIndex, nodeType) { - if (walkFns.pre) { - walkFns.pre(rangeStart, rangeLength, this.children[childIndex], this, nodeType); - } - if (walkFns.goSubtree) { - this.children[childIndex].walk(rangeStart, rangeLength, walkFns); - if (walkFns.post) { - walkFns.post(rangeStart, rangeLength, this.children[childIndex], this, nodeType); - } - } - else { - walkFns.goSubtree = true; - } - return walkFns.done; - }; - LineNode.prototype.skipChild = function (relativeStart, relativeLength, childIndex, walkFns, nodeType) { - if (walkFns.pre && (!walkFns.done)) { - walkFns.pre(relativeStart, relativeLength, this.children[childIndex], this, nodeType); - walkFns.goSubtree = true; - } - }; - LineNode.prototype.walk = function (rangeStart, rangeLength, walkFns) { - var childIndex = 0; - var child = this.children[0]; - var childCharCount = child.charCount(); - var adjustedStart = rangeStart; - while (adjustedStart >= childCharCount) { - this.skipChild(adjustedStart, rangeLength, childIndex, walkFns, CharRangeSection.PreStart); - adjustedStart -= childCharCount; - childIndex++; - child = this.children[childIndex]; - childCharCount = child.charCount(); - } - if ((adjustedStart + rangeLength) <= childCharCount) { - if (this.execWalk(adjustedStart, rangeLength, walkFns, childIndex, CharRangeSection.Entire)) { - return; - } - } - else { - if (this.execWalk(adjustedStart, childCharCount - adjustedStart, walkFns, childIndex, CharRangeSection.Start)) { - return; - } - var adjustedLength = rangeLength - (childCharCount - adjustedStart); - childIndex++; - child = this.children[childIndex]; - childCharCount = child.charCount(); - while (adjustedLength > childCharCount) { - if (this.execWalk(0, childCharCount, walkFns, childIndex, CharRangeSection.Mid)) { - return; - } - adjustedLength -= childCharCount; - childIndex++; - child = this.children[childIndex]; - childCharCount = child.charCount(); - } - if (adjustedLength > 0) { - if (this.execWalk(0, adjustedLength, walkFns, childIndex, CharRangeSection.End)) { - return; - } - } - } - if (walkFns.pre) { - var clen = this.children.length; - if (childIndex < (clen - 1)) { - for (var ej = childIndex + 1; ej < clen; ej++) { - this.skipChild(0, 0, ej, walkFns, CharRangeSection.PostEnd); - } - } - } - }; - LineNode.prototype.charOffsetToLineNumberAndPos = function (lineNumber, charOffset) { - var childInfo = this.childFromCharOffset(lineNumber, charOffset); - if (!childInfo.child) { - return { - line: lineNumber, - offset: charOffset, - }; - } - else if (childInfo.childIndex < this.children.length) { - if (childInfo.child.isLeaf()) { - return { - line: childInfo.lineNumber, - offset: childInfo.charOffset, - text: (childInfo.child).text, - leaf: (childInfo.child) - }; - } - else { - var lineNode = (childInfo.child); - return lineNode.charOffsetToLineNumberAndPos(childInfo.lineNumber, childInfo.charOffset); - } - } - else { - var lineInfo = this.lineNumberToInfo(this.lineCount(), 0); - return { line: this.lineCount(), offset: lineInfo.leaf.charCount() }; - } - }; - LineNode.prototype.lineNumberToInfo = function (lineNumber, charOffset) { - var childInfo = this.childFromLineNumber(lineNumber, charOffset); - if (!childInfo.child) { - return { - line: lineNumber, - offset: charOffset - }; - } - else if (childInfo.child.isLeaf()) { - return { - line: lineNumber, - offset: childInfo.charOffset, - text: (childInfo.child).text, - leaf: (childInfo.child) - }; - } - else { - var lineNode = (childInfo.child); - return lineNode.lineNumberToInfo(childInfo.relativeLineNumber, childInfo.charOffset); - } - }; - LineNode.prototype.childFromLineNumber = function (lineNumber, charOffset) { - var child; - var relativeLineNumber = lineNumber; - var i; - var len; - for (i = 0, len = this.children.length; i < len; i++) { - child = this.children[i]; - var childLineCount = child.lineCount(); - if (childLineCount >= relativeLineNumber) { - break; - } - else { - relativeLineNumber -= childLineCount; - charOffset += child.charCount(); - } - } - return { - child: child, - childIndex: i, - relativeLineNumber: relativeLineNumber, - charOffset: charOffset - }; - }; - LineNode.prototype.childFromCharOffset = function (lineNumber, charOffset) { - var child; - var i; - var len; - for (i = 0, len = this.children.length; i < len; i++) { - child = this.children[i]; - if (child.charCount() > charOffset) { - break; - } - else { - charOffset -= child.charCount(); - lineNumber += child.lineCount(); - } - } - return { - child: child, - childIndex: i, - charOffset: charOffset, - lineNumber: lineNumber - }; - }; - LineNode.prototype.splitAfter = function (childIndex) { - var splitNode; - var clen = this.children.length; - childIndex++; - var endLength = childIndex; - if (childIndex < clen) { - splitNode = new LineNode(); - while (childIndex < clen) { - splitNode.add(this.children[childIndex]); - childIndex++; - } - splitNode.updateCounts(); - } - this.children.length = endLength; - return splitNode; - }; - LineNode.prototype.remove = function (child) { - var childIndex = this.findChildIndex(child); - var clen = this.children.length; - if (childIndex < (clen - 1)) { - for (var i = childIndex; i < (clen - 1); i++) { - this.children[i] = this.children[i + 1]; - } - } - this.children.length--; - }; - LineNode.prototype.findChildIndex = function (child) { - var childIndex = 0; - var clen = this.children.length; - while ((this.children[childIndex] !== child) && (childIndex < clen)) - childIndex++; - return childIndex; - }; - LineNode.prototype.insertAt = function (child, nodes) { - var childIndex = this.findChildIndex(child); - var clen = this.children.length; - var nodeCount = nodes.length; - if ((clen < lineCollectionCapacity) && (childIndex === (clen - 1)) && (nodeCount === 1)) { - this.add(nodes[0]); - this.updateCounts(); - return []; - } - else { - var shiftNode = this.splitAfter(childIndex); - var nodeIndex = 0; - childIndex++; - while ((childIndex < lineCollectionCapacity) && (nodeIndex < nodeCount)) { - this.children[childIndex] = nodes[nodeIndex]; - childIndex++; - nodeIndex++; - } - var splitNodes = []; - var splitNodeCount = 0; - if (nodeIndex < nodeCount) { - splitNodeCount = Math.ceil((nodeCount - nodeIndex) / lineCollectionCapacity); - splitNodes = new Array(splitNodeCount); - var splitNodeIndex = 0; - for (var i = 0; i < splitNodeCount; i++) { - splitNodes[i] = new LineNode(); - } - var splitNode = splitNodes[0]; - while (nodeIndex < nodeCount) { - splitNode.add(nodes[nodeIndex]); - nodeIndex++; - if (splitNode.children.length === lineCollectionCapacity) { - splitNodeIndex++; - splitNode = splitNodes[splitNodeIndex]; - } - } - for (var i = splitNodes.length - 1; i >= 0; i--) { - if (splitNodes[i].children.length === 0) { - splitNodes.length--; - } - } - } - if (shiftNode) { - splitNodes[splitNodes.length] = shiftNode; - } - this.updateCounts(); - for (var i = 0; i < splitNodeCount; i++) { - splitNodes[i].updateCounts(); - } - return splitNodes; - } - }; - LineNode.prototype.add = function (collection) { - this.children[this.children.length] = collection; - return (this.children.length < lineCollectionCapacity); - }; - LineNode.prototype.charCount = function () { - return this.totalChars; - }; - LineNode.prototype.lineCount = function () { - return this.totalLines; - }; - return LineNode; - }()); - server.LineNode = LineNode; - var LineLeaf = (function () { - function LineLeaf(text) { - this.text = text; - } - LineLeaf.prototype.isLeaf = function () { - return true; - }; - LineLeaf.prototype.walk = function (rangeStart, rangeLength, walkFns) { - walkFns.leaf(rangeStart, rangeLength, this); - }; - LineLeaf.prototype.charCount = function () { - return this.text.length; - }; - LineLeaf.prototype.lineCount = function () { - return 1; - }; - return LineLeaf; - }()); - server.LineLeaf = LineLeaf; - })(server = ts.server || (ts.server = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var server; - (function (server) { - var net = require("net"); - var childProcess = require("child_process"); - var os = require("os"); - function getGlobalTypingsCacheLocation() { - var basePath; - switch (process.platform) { - case "win32": - basePath = process.env.LOCALAPPDATA || - process.env.APPDATA || - (os.homedir && os.homedir()) || - process.env.USERPROFILE || - (process.env.HOMEDRIVE && process.env.HOMEPATH && ts.normalizeSlashes(process.env.HOMEDRIVE + process.env.HOMEPATH)) || - os.tmpdir(); - break; - case "linux": - case "android": - basePath = (os.homedir && os.homedir()) || - process.env.HOME || - ((process.env.LOGNAME || process.env.USER) && "/home/" + (process.env.LOGNAME || process.env.USER)) || - os.tmpdir(); - break; - case "darwin": - var homeDir = (os.homedir && os.homedir()) || - process.env.HOME || - ((process.env.LOGNAME || process.env.USER) && "/Users/" + (process.env.LOGNAME || process.env.USER)) || - os.tmpdir(); - basePath = ts.combinePaths(homeDir, "Library/Application Support/"); - break; - } - ts.Debug.assert(basePath !== undefined); - return ts.combinePaths(ts.normalizeSlashes(basePath), "Microsoft/TypeScript"); - } - var readline = require("readline"); - var fs = require("fs"); - var rl = readline.createInterface({ - input: process.stdin, - output: process.stdout, - terminal: false, - }); - var Logger = (function () { - function Logger(logFilename, traceToConsole, level) { - this.logFilename = logFilename; - this.traceToConsole = traceToConsole; - this.level = level; - this.fd = -1; - this.seq = 0; - this.inGroup = false; - this.firstInGroup = true; - } - Logger.padStringRight = function (str, padding) { - return (str + padding).slice(0, padding.length); - }; - Logger.prototype.close = function () { - if (this.fd >= 0) { - fs.close(this.fd); - } - }; - Logger.prototype.getLogFileName = function () { - return this.logFilename; - }; - Logger.prototype.perftrc = function (s) { - this.msg(s, server.Msg.Perf); - }; - Logger.prototype.info = function (s) { - this.msg(s, server.Msg.Info); - }; - Logger.prototype.startGroup = function () { - this.inGroup = true; - this.firstInGroup = true; - }; - Logger.prototype.endGroup = function () { - this.inGroup = false; - this.seq++; - this.firstInGroup = true; - }; - Logger.prototype.loggingEnabled = function () { - return !!this.logFilename || this.traceToConsole; - }; - Logger.prototype.hasLevel = function (level) { - return this.loggingEnabled() && this.level >= level; - }; - Logger.prototype.msg = function (s, type) { - if (type === void 0) { type = server.Msg.Err; } - if (this.fd < 0) { - if (this.logFilename) { - this.fd = fs.openSync(this.logFilename, "w"); - } - } - if (this.fd >= 0 || this.traceToConsole) { - s = s + "\n"; - var prefix = Logger.padStringRight(type + " " + this.seq.toString(), " "); - if (this.firstInGroup) { - s = prefix + s; - this.firstInGroup = false; - } - if (!this.inGroup) { - this.seq++; - this.firstInGroup = true; - } - if (this.fd >= 0) { - var buf = new Buffer(s); - fs.writeSync(this.fd, buf, 0, buf.length, null); - } - if (this.traceToConsole) { - console.warn(s); - } - } - }; - return Logger; - }()); - var NodeTypingsInstaller = (function () { - function NodeTypingsInstaller(telemetryEnabled, logger, host, eventPort, globalTypingsCacheLocation, newLine) { - var _this = this; - this.telemetryEnabled = telemetryEnabled; - this.logger = logger; - this.globalTypingsCacheLocation = globalTypingsCacheLocation; - this.newLine = newLine; - this.installerPidReported = false; - this.throttledOperations = new server.ThrottledOperations(host); - if (eventPort) { - var s_1 = net.connect({ port: eventPort }, function () { - _this.socket = s_1; - _this.reportInstallerProcessId(); - }); - } - } - NodeTypingsInstaller.prototype.reportInstallerProcessId = function () { - if (this.installerPidReported) { - return; - } - if (this.socket && this.installer) { - this.sendEvent(0, "typingsInstallerPid", { pid: this.installer.pid }); - this.installerPidReported = true; - } - }; - NodeTypingsInstaller.prototype.sendEvent = function (seq, event, body) { - this.socket.write(server.formatMessage({ seq: seq, type: "event", event: event, body: body }, this.logger, Buffer.byteLength, this.newLine), "utf8"); - }; - NodeTypingsInstaller.prototype.setTelemetrySender = function (telemetrySender) { - this.telemetrySender = telemetrySender; - }; - NodeTypingsInstaller.prototype.attach = function (projectService) { - var _this = this; - this.projectService = projectService; - if (this.logger.hasLevel(server.LogLevel.requestTime)) { - this.logger.info("Binding..."); - } - var args = [server.Arguments.GlobalCacheLocation, this.globalTypingsCacheLocation]; - if (this.telemetryEnabled) { - args.push(server.Arguments.EnableTelemetry); - } - if (this.logger.loggingEnabled() && this.logger.getLogFileName()) { - args.push(server.Arguments.LogFile, ts.combinePaths(ts.getDirectoryPath(ts.normalizeSlashes(this.logger.getLogFileName())), "ti-" + process.pid + ".log")); - } - var execArgv = []; - { - for (var _i = 0, _a = process.execArgv; _i < _a.length; _i++) { - var arg = _a[_i]; - var match = /^--(debug|inspect)(=(\d+))?$/.exec(arg); - if (match) { - var currentPort = match[3] !== undefined - ? +match[3] - : match[1] === "debug" ? 5858 : 9229; - execArgv.push("--" + match[1] + "=" + (currentPort + 1)); - break; - } - } - } - this.installer = childProcess.fork(ts.combinePaths(__dirname, "typingsInstaller.js"), args, { execArgv: execArgv }); - this.installer.on("message", function (m) { return _this.handleMessage(m); }); - this.reportInstallerProcessId(); - process.on("exit", function () { - _this.installer.kill(); - }); - }; - NodeTypingsInstaller.prototype.onProjectClosed = function (p) { - this.installer.send({ projectName: p.getProjectName(), kind: "closeProject" }); - }; - NodeTypingsInstaller.prototype.enqueueInstallTypingsRequest = function (project, typeAcquisition, unresolvedImports) { - var _this = this; - var request = server.createInstallTypingsRequest(project, typeAcquisition, unresolvedImports); - if (this.logger.hasLevel(server.LogLevel.verbose)) { - if (this.logger.hasLevel(server.LogLevel.verbose)) { - this.logger.info("Scheduling throttled operation: " + JSON.stringify(request)); - } - } - this.throttledOperations.schedule(project.getProjectName(), 250, function () { - if (_this.logger.hasLevel(server.LogLevel.verbose)) { - _this.logger.info("Sending request: " + JSON.stringify(request)); - } - _this.installer.send(request); - }); - }; - NodeTypingsInstaller.prototype.handleMessage = function (response) { - if (this.logger.hasLevel(server.LogLevel.verbose)) { - this.logger.info("Received response: " + JSON.stringify(response)); - } - if (response.kind === server.EventInstall) { - if (this.telemetrySender) { - var body = { - telemetryEventName: "typingsInstalled", - payload: { - installedPackages: response.packagesToInstall.join(","), - installSuccess: response.installSuccess, - typingsInstallerVersion: response.typingsInstallerVersion - } - }; - var eventName = "telemetry"; - this.telemetrySender.event(body, eventName); - } - return; - } - this.projectService.updateTypingsForProject(response); - if (response.kind == server.ActionSet && this.socket) { - this.sendEvent(0, "setTypings", response); - } - }; - return NodeTypingsInstaller; - }()); - var IOSession = (function (_super) { - __extends(IOSession, _super); - function IOSession(host, cancellationToken, installerEventPort, canUseEvents, useSingleInferredProject, disableAutomaticTypingAcquisition, globalTypingsCacheLocation, telemetryEnabled, logger) { - var _this; - var typingsInstaller = disableAutomaticTypingAcquisition - ? undefined - : new NodeTypingsInstaller(telemetryEnabled, logger, host, installerEventPort, globalTypingsCacheLocation, host.newLine); - _this = _super.call(this, host, cancellationToken, useSingleInferredProject, typingsInstaller || server.nullTypingsInstaller, Buffer.byteLength, process.hrtime, logger, canUseEvents) || this; - if (telemetryEnabled && typingsInstaller) { - typingsInstaller.setTelemetrySender(_this); - } - return _this; - } - IOSession.prototype.exit = function () { - this.logger.info("Exiting..."); - this.projectService.closeLog(); - process.exit(0); - }; - IOSession.prototype.listen = function () { - var _this = this; - rl.on("line", function (input) { - var message = input.trim(); - _this.onMessage(message); - }); - rl.on("close", function () { - _this.exit(); - }); - }; - return IOSession; - }(server.Session)); - function parseLoggingEnvironmentString(logEnvStr) { - var logEnv = { logToFile: true }; - var args = logEnvStr.split(" "); - for (var i = 0, len = args.length; i < (len - 1); i += 2) { - var option = args[i]; - var value = args[i + 1]; - if (option && value) { - switch (option) { - case "-file": - logEnv.file = ts.stripQuotes(value); - break; - case "-level": - var level = server.LogLevel[value]; - logEnv.detailLevel = typeof level === "number" ? level : server.LogLevel.normal; - break; - case "-traceToConsole": - logEnv.traceToConsole = value.toLowerCase() === "true"; - break; - case "-logToFile": - logEnv.logToFile = value.toLowerCase() === "true"; - break; - } - } - } - return logEnv; - } - function createLoggerFromEnv() { - var fileName = undefined; - var detailLevel = server.LogLevel.normal; - var traceToConsole = false; - var logEnvStr = process.env["TSS_LOG"]; - if (logEnvStr) { - var logEnv = parseLoggingEnvironmentString(logEnvStr); - if (logEnv.logToFile) { - if (logEnv.file) { - fileName = logEnv.file; - } - else { - fileName = __dirname + "/.log" + process.pid.toString(); - } - } - if (logEnv.detailLevel) { - detailLevel = logEnv.detailLevel; - } - traceToConsole = logEnv.traceToConsole; - } - return new Logger(fileName, traceToConsole, detailLevel); - } - function createPollingWatchedFileSet(interval, chunkSize) { - if (interval === void 0) { interval = 2500; } - if (chunkSize === void 0) { chunkSize = 30; } - var watchedFiles = []; - var nextFileToCheck = 0; - var watchTimer; - function getModifiedTime(fileName) { - return fs.statSync(fileName).mtime; - } - function poll(checkedIndex) { - var watchedFile = watchedFiles[checkedIndex]; - if (!watchedFile) { - return; - } - fs.stat(watchedFile.fileName, function (err, stats) { - if (err) { - watchedFile.callback(watchedFile.fileName); - } - else if (watchedFile.mtime.getTime() !== stats.mtime.getTime()) { - watchedFile.mtime = getModifiedTime(watchedFile.fileName); - watchedFile.callback(watchedFile.fileName, watchedFile.mtime.getTime() === 0); - } - }); - } - function startWatchTimer() { - watchTimer = setInterval(function () { - var count = 0; - var nextToCheck = nextFileToCheck; - var firstCheck = -1; - while ((count < chunkSize) && (nextToCheck !== firstCheck)) { - poll(nextToCheck); - if (firstCheck < 0) { - firstCheck = nextToCheck; - } - nextToCheck++; - if (nextToCheck === watchedFiles.length) { - nextToCheck = 0; - } - count++; - } - nextFileToCheck = nextToCheck; - }, interval); - } - function addFile(fileName, callback) { - var file = { - fileName: fileName, - callback: callback, - mtime: getModifiedTime(fileName) - }; - watchedFiles.push(file); - if (watchedFiles.length === 1) { - startWatchTimer(); - } - return file; - } - function removeFile(file) { - ts.unorderedRemoveItem(watchedFiles, file); - } - return { - getModifiedTime: getModifiedTime, - poll: poll, - startWatchTimer: startWatchTimer, - addFile: addFile, - removeFile: removeFile - }; - } - var pollingWatchedFileSet = createPollingWatchedFileSet(); - var logger = createLoggerFromEnv(); - var pending = []; - var canWrite = true; - function writeMessage(buf) { - if (!canWrite) { - pending.push(buf); - } - else { - canWrite = false; - process.stdout.write(buf, setCanWriteFlagAndWriteMessageIfNecessary); - } - } - function setCanWriteFlagAndWriteMessageIfNecessary() { - canWrite = true; - if (pending.length) { - writeMessage(pending.shift()); - } - } - var sys = ts.sys; - sys.write = function (s) { return writeMessage(new Buffer(s, "utf8")); }; - sys.watchFile = function (fileName, callback) { - var watchedFile = pollingWatchedFileSet.addFile(fileName, callback); - return { - close: function () { return pollingWatchedFileSet.removeFile(watchedFile); } - }; - }; - sys.setTimeout = setTimeout; - sys.clearTimeout = clearTimeout; - sys.setImmediate = setImmediate; - sys.clearImmediate = clearImmediate; - if (typeof global !== "undefined" && global.gc) { - sys.gc = function () { return global.gc(); }; - } - var cancellationToken; - try { - var factory = require("./cancellationToken"); - cancellationToken = factory(sys.args); - } - catch (e) { - cancellationToken = { - isCancellationRequested: function () { return false; } - }; - } - ; - var eventPort; - { - var str = server.findArgument("--eventPort"); - var v = str && parseInt(str); - if (!isNaN(v)) { - eventPort = v; - } - } - var localeStr = server.findArgument("--locale"); - if (localeStr) { - ts.validateLocaleAndSetLanguage(localeStr, sys); - } - var useSingleInferredProject = server.hasArgument("--useSingleInferredProject"); - var disableAutomaticTypingAcquisition = server.hasArgument("--disableAutomaticTypingAcquisition"); - var telemetryEnabled = server.hasArgument(server.Arguments.EnableTelemetry); - var ioSession = new IOSession(sys, cancellationToken, eventPort, eventPort === undefined, useSingleInferredProject, disableAutomaticTypingAcquisition, getGlobalTypingsCacheLocation(), telemetryEnabled, logger); - process.on("uncaughtException", function (err) { - ioSession.logError(err, "unknown"); - }); - process.noAsar = true; - ioSession.listen(); - })(server = ts.server || (ts.server = {})); + ts.objectAllocator = getServicesObjectAllocator(); })(ts || (ts = {})); var debugObjectHost = (function () { return this; })(); var ts; @@ -69938,7 +72103,7 @@ var ts; ScriptSnapshotShimAdapter.prototype.getChangeRange = function (oldSnapshot) { var oldSnapshotShim = oldSnapshot; var encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim); - if (encoded == null) { + if (encoded === null) { return null; } var decoded = JSON.parse(encoded); @@ -70006,10 +72171,12 @@ var ts; }; LanguageServiceShimHostAdapter.prototype.getCompilationSettings = function () { var settingsJson = this.shimHost.getCompilationSettings(); - if (settingsJson == null || settingsJson == "") { + if (settingsJson === null || settingsJson === "") { throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings"); } - return JSON.parse(settingsJson); + var compilerOptions = JSON.parse(settingsJson); + compilerOptions.allowNonTsExtensions = true; + return compilerOptions; }; LanguageServiceShimHostAdapter.prototype.getScriptFileNames = function () { var encoded = this.shimHost.getScriptFileNames(); @@ -70032,7 +72199,7 @@ var ts; }; LanguageServiceShimHostAdapter.prototype.getLocalizedDiagnosticMessages = function () { var diagnosticMessagesJson = this.shimHost.getLocalizedDiagnosticMessages(); - if (diagnosticMessagesJson == null || diagnosticMessagesJson == "") { + if (diagnosticMessagesJson === null || diagnosticMessagesJson === "") { return null; } try { @@ -70045,7 +72212,7 @@ var ts; }; LanguageServiceShimHostAdapter.prototype.getCancellationToken = function () { var hostCancellationToken = this.shimHost.getCancellationToken(); - return new ThrottledCancellationToken(hostCancellationToken); + return new ts.ThrottledCancellationToken(hostCancellationToken); }; LanguageServiceShimHostAdapter.prototype.getCurrentDirectory = function () { return this.shimHost.getCurrentDirectory(); @@ -70069,22 +72236,6 @@ var ts; return LanguageServiceShimHostAdapter; }()); ts.LanguageServiceShimHostAdapter = LanguageServiceShimHostAdapter; - var ThrottledCancellationToken = (function () { - function ThrottledCancellationToken(hostCancellationToken) { - this.hostCancellationToken = hostCancellationToken; - this.lastCancellationCheckTime = 0; - } - ThrottledCancellationToken.prototype.isCancellationRequested = function () { - var time = ts.timestamp(); - var duration = Math.abs(time - this.lastCancellationCheckTime); - if (duration > 10) { - this.lastCancellationCheckTime = time; - return this.hostCancellationToken.isCancellationRequested(); - } - return false; - }; - return ThrottledCancellationToken; - }()); var CoreServicesShimHostAdapter = (function () { function CoreServicesShimHostAdapter(shimHost) { var _this = this; @@ -70447,12 +72598,6 @@ var ts; var compilerOptions = JSON.parse(compilerOptionsJson); var result = ts.resolveModuleName(moduleName, ts.normalizeSlashes(fileName), compilerOptions, _this.host); var resolvedFileName = result.resolvedModule ? result.resolvedModule.resolvedFileName : undefined; - if (resolvedFileName && !compilerOptions.allowJs && ts.fileExtensionIs(resolvedFileName, ".js")) { - return { - resolvedFileName: undefined, - failedLookupLocations: [] - }; - } return { resolvedFileName: resolvedFileName, failedLookupLocations: result.failedLookupLocations @@ -70592,7 +72737,7 @@ var ts; this._shims.push(shim); }; TypeScriptServicesFactory.prototype.unregisterShim = function (shim) { - for (var i = 0, n = this._shims.length; i < n; i++) { + for (var i = 0; i < this._shims.length; i++) { if (this._shims[i] === shim) { delete this._shims[i]; return; @@ -70614,4 +72759,6281 @@ var TypeScript; Services.TypeScriptServicesFactory = ts.TypeScriptServicesFactory; })(Services = TypeScript.Services || (TypeScript.Services = {})); })(TypeScript || (TypeScript = {})); -var toolsVersion = "2.2"; +var toolsVersion = "2.3"; +var ts; +(function (ts) { + var server; + (function (server) { + server.ActionSet = "action::set"; + server.ActionInvalidate = "action::invalidate"; + server.EventBeginInstallTypes = "event::beginInstallTypes"; + server.EventEndInstallTypes = "event::endInstallTypes"; + server.EventInitializationFailed = "event::initializationFailed"; + var Arguments; + (function (Arguments) { + Arguments.GlobalCacheLocation = "--globalTypingsCacheLocation"; + Arguments.LogFile = "--logFile"; + Arguments.EnableTelemetry = "--enableTelemetry"; + Arguments.TypingSafeListLocation = "--typingSafeListLocation"; + })(Arguments = server.Arguments || (server.Arguments = {})); + function hasArgument(argumentName) { + return ts.sys.args.indexOf(argumentName) >= 0; + } + server.hasArgument = hasArgument; + function findArgument(argumentName) { + var index = ts.sys.args.indexOf(argumentName); + return index >= 0 && index < ts.sys.args.length - 1 + ? ts.sys.args[index + 1] + : undefined; + } + server.findArgument = findArgument; + })(server = ts.server || (ts.server = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var server; + (function (server) { + var LogLevel; + (function (LogLevel) { + LogLevel[LogLevel["terse"] = 0] = "terse"; + LogLevel[LogLevel["normal"] = 1] = "normal"; + LogLevel[LogLevel["requestTime"] = 2] = "requestTime"; + LogLevel[LogLevel["verbose"] = 3] = "verbose"; + })(LogLevel = server.LogLevel || (server.LogLevel = {})); + server.emptyArray = []; + var Msg; + (function (Msg) { + Msg.Err = "Err"; + Msg.Info = "Info"; + Msg.Perf = "Perf"; + })(Msg = server.Msg || (server.Msg = {})); + function getProjectRootPath(project) { + switch (project.projectKind) { + case server.ProjectKind.Configured: + return ts.getDirectoryPath(project.getProjectName()); + case server.ProjectKind.Inferred: + return ""; + case server.ProjectKind.External: + var projectName = ts.normalizeSlashes(project.getProjectName()); + return project.projectService.host.fileExists(projectName) ? ts.getDirectoryPath(projectName) : projectName; + } + } + function createInstallTypingsRequest(project, typeAcquisition, unresolvedImports, cachePath) { + return { + projectName: project.getProjectName(), + fileNames: project.getFileNames(true), + compilerOptions: project.getCompilerOptions(), + typeAcquisition: typeAcquisition, + unresolvedImports: unresolvedImports, + projectRootPath: getProjectRootPath(project), + cachePath: cachePath, + kind: "discover" + }; + } + server.createInstallTypingsRequest = createInstallTypingsRequest; + var Errors; + (function (Errors) { + function ThrowNoProject() { + throw new Error("No Project."); + } + Errors.ThrowNoProject = ThrowNoProject; + function ThrowProjectLanguageServiceDisabled() { + throw new Error("The project's language service is disabled."); + } + Errors.ThrowProjectLanguageServiceDisabled = ThrowProjectLanguageServiceDisabled; + function ThrowProjectDoesNotContainDocument(fileName, project) { + throw new Error("Project '" + project.getProjectName() + "' does not contain document '" + fileName + "'"); + } + Errors.ThrowProjectDoesNotContainDocument = ThrowProjectDoesNotContainDocument; + })(Errors = server.Errors || (server.Errors = {})); + function getDefaultFormatCodeSettings(host) { + return { + indentSize: 4, + tabSize: 4, + newLineCharacter: host.newLine || "\n", + convertTabsToSpaces: true, + indentStyle: ts.IndentStyle.Smart, + insertSpaceAfterConstructor: false, + insertSpaceAfterCommaDelimiter: true, + insertSpaceAfterSemicolonInForStatements: true, + insertSpaceBeforeAndAfterBinaryOperators: true, + insertSpaceAfterKeywordsInControlFlowStatements: true, + insertSpaceAfterFunctionKeywordForAnonymousFunctions: false, + insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false, + insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false, + insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: true, + insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false, + insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false, + insertSpaceBeforeFunctionParenthesis: false, + placeOpenBraceOnNewLineForFunctions: false, + placeOpenBraceOnNewLineForControlBlocks: false, + }; + } + server.getDefaultFormatCodeSettings = getDefaultFormatCodeSettings; + function mergeMapLikes(target, source) { + for (var key in source) { + if (ts.hasProperty(source, key)) { + target[key] = source[key]; + } + } + } + server.mergeMapLikes = mergeMapLikes; + function removeItemFromSet(items, itemToRemove) { + if (items.length === 0) { + return; + } + var index = items.indexOf(itemToRemove); + if (index < 0) { + return; + } + if (index === items.length - 1) { + items.pop(); + } + else { + items[index] = items.pop(); + } + } + server.removeItemFromSet = removeItemFromSet; + function toNormalizedPath(fileName) { + return ts.normalizePath(fileName); + } + server.toNormalizedPath = toNormalizedPath; + function normalizedPathToPath(normalizedPath, currentDirectory, getCanonicalFileName) { + var f = ts.isRootedDiskPath(normalizedPath) ? normalizedPath : ts.getNormalizedAbsolutePath(normalizedPath, currentDirectory); + return getCanonicalFileName(f); + } + server.normalizedPathToPath = normalizedPathToPath; + function asNormalizedPath(fileName) { + return fileName; + } + server.asNormalizedPath = asNormalizedPath; + function createNormalizedPathMap() { + var map = ts.createMap(); + return { + get: function (path) { + return map.get(path); + }, + set: function (path, value) { + map.set(path, value); + }, + contains: function (path) { + return map.has(path); + }, + remove: function (path) { + map.delete(path); + } + }; + } + server.createNormalizedPathMap = createNormalizedPathMap; + function isInferredProjectName(name) { + return /dev\/null\/inferredProject\d+\*/.test(name); + } + server.isInferredProjectName = isInferredProjectName; + function makeInferredProjectName(counter) { + return "/dev/null/inferredProject" + counter + "*"; + } + server.makeInferredProjectName = makeInferredProjectName; + function toSortedReadonlyArray(arr) { + arr.sort(); + return arr; + } + server.toSortedReadonlyArray = toSortedReadonlyArray; + var ThrottledOperations = (function () { + function ThrottledOperations(host) { + this.host = host; + this.pendingTimeouts = ts.createMap(); + } + ThrottledOperations.prototype.schedule = function (operationId, delay, cb) { + var pendingTimeout = this.pendingTimeouts.get(operationId); + if (pendingTimeout) { + this.host.clearTimeout(pendingTimeout); + } + this.pendingTimeouts.set(operationId, this.host.setTimeout(ThrottledOperations.run, delay, this, operationId, cb)); + }; + ThrottledOperations.run = function (self, operationId, cb) { + self.pendingTimeouts.delete(operationId); + cb(); + }; + return ThrottledOperations; + }()); + server.ThrottledOperations = ThrottledOperations; + var GcTimer = (function () { + function GcTimer(host, delay, logger) { + this.host = host; + this.delay = delay; + this.logger = logger; + } + GcTimer.prototype.scheduleCollect = function () { + if (!this.host.gc || this.timerId !== undefined) { + return; + } + this.timerId = this.host.setTimeout(GcTimer.run, this.delay, this); + }; + GcTimer.run = function (self) { + self.timerId = undefined; + var log = self.logger.hasLevel(LogLevel.requestTime); + var before = log && self.host.getMemoryUsage(); + self.host.gc(); + if (log) { + var after = self.host.getMemoryUsage(); + self.logger.perftrc("GC::before " + before + ", after " + after); + } + }; + return GcTimer; + }()); + server.GcTimer = GcTimer; + })(server = ts.server || (ts.server = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var server; + (function (server) { + var TextStorage = (function () { + function TextStorage(host, fileName) { + this.host = host; + this.fileName = fileName; + this.svcVersion = 0; + this.textVersion = 0; + } + TextStorage.prototype.getVersion = function () { + return this.svc + ? "SVC-" + this.svcVersion + "-" + this.svc.getSnapshot().version + : "Text-" + this.textVersion; + }; + TextStorage.prototype.hasScriptVersionCache = function () { + return this.svc !== undefined; + }; + TextStorage.prototype.useScriptVersionCache = function (newText) { + this.switchToScriptVersionCache(newText); + }; + TextStorage.prototype.useText = function (newText) { + this.svc = undefined; + this.setText(newText); + }; + TextStorage.prototype.edit = function (start, end, newText) { + this.switchToScriptVersionCache().edit(start, end - start, newText); + }; + TextStorage.prototype.reload = function (text) { + if (this.svc) { + this.svc.reload(text); + } + else { + this.setText(text); + } + }; + TextStorage.prototype.reloadFromFile = function (tempFileName) { + if (this.svc || (tempFileName !== this.fileName)) { + this.reload(this.getFileText(tempFileName)); + } + else { + this.setText(undefined); + } + }; + TextStorage.prototype.getSnapshot = function () { + return this.svc + ? this.svc.getSnapshot() + : ts.ScriptSnapshot.fromString(this.getOrLoadText()); + }; + TextStorage.prototype.getLineInfo = function (line) { + return this.switchToScriptVersionCache().getSnapshot().index.lineNumberToInfo(line); + }; + TextStorage.prototype.lineToTextSpan = function (line) { + if (!this.svc) { + var lineMap = this.getLineMap(); + var start = lineMap[line]; + var end = line + 1 < lineMap.length ? lineMap[line + 1] : this.text.length; + return ts.createTextSpanFromBounds(start, end); + } + var index = this.svc.getSnapshot().index; + var lineInfo = index.lineNumberToInfo(line + 1); + var len; + if (lineInfo.leaf) { + len = lineInfo.leaf.text.length; + } + else { + var nextLineInfo = index.lineNumberToInfo(line + 2); + len = nextLineInfo.offset - lineInfo.offset; + } + return ts.createTextSpan(lineInfo.offset, len); + }; + TextStorage.prototype.lineOffsetToPosition = function (line, offset) { + if (!this.svc) { + return ts.computePositionOfLineAndCharacter(this.getLineMap(), line - 1, offset - 1); + } + var index = this.svc.getSnapshot().index; + var lineInfo = index.lineNumberToInfo(line); + return (lineInfo.offset + offset - 1); + }; + TextStorage.prototype.positionToLineOffset = function (position) { + if (!this.svc) { + var _a = ts.computeLineAndCharacterOfPosition(this.getLineMap(), position), line = _a.line, character = _a.character; + return { line: line + 1, offset: character + 1 }; + } + var index = this.svc.getSnapshot().index; + var lineOffset = index.charOffsetToLineNumberAndPos(position); + return { line: lineOffset.line, offset: lineOffset.offset + 1 }; + }; + TextStorage.prototype.getFileText = function (tempFileName) { + return this.host.readFile(tempFileName || this.fileName) || ""; + }; + TextStorage.prototype.ensureNoScriptVersionCache = function () { + ts.Debug.assert(!this.svc, "ScriptVersionCache should not be set"); + }; + TextStorage.prototype.switchToScriptVersionCache = function (newText) { + if (!this.svc) { + this.svc = server.ScriptVersionCache.fromString(this.host, newText !== undefined ? newText : this.getOrLoadText()); + this.svcVersion++; + this.text = undefined; + } + return this.svc; + }; + TextStorage.prototype.getOrLoadText = function () { + this.ensureNoScriptVersionCache(); + if (this.text === undefined) { + this.setText(this.getFileText()); + } + return this.text; + }; + TextStorage.prototype.getLineMap = function () { + this.ensureNoScriptVersionCache(); + return this.lineMap || (this.lineMap = ts.computeLineStarts(this.getOrLoadText())); + }; + TextStorage.prototype.setText = function (newText) { + this.ensureNoScriptVersionCache(); + if (newText === undefined || this.text !== newText) { + this.text = newText; + this.lineMap = undefined; + this.textVersion++; + } + }; + return TextStorage; + }()); + server.TextStorage = TextStorage; + var ScriptInfo = (function () { + function ScriptInfo(host, fileName, scriptKind, hasMixedContent) { + if (hasMixedContent === void 0) { hasMixedContent = false; } + this.host = host; + this.fileName = fileName; + this.scriptKind = scriptKind; + this.hasMixedContent = hasMixedContent; + this.containingProjects = []; + this.path = ts.toPath(fileName, host.getCurrentDirectory(), ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames)); + this.textStorage = new TextStorage(host, fileName); + if (hasMixedContent) { + this.textStorage.reload(""); + } + this.scriptKind = scriptKind + ? scriptKind + : ts.getScriptKindFromFileName(fileName); + } + ScriptInfo.prototype.isScriptOpen = function () { + return this.isOpen; + }; + ScriptInfo.prototype.open = function (newText) { + this.isOpen = true; + this.textStorage.useScriptVersionCache(newText); + this.markContainingProjectsAsDirty(); + }; + ScriptInfo.prototype.close = function () { + this.isOpen = false; + this.textStorage.useText(this.hasMixedContent ? "" : undefined); + this.markContainingProjectsAsDirty(); + }; + ScriptInfo.prototype.getSnapshot = function () { + return this.textStorage.getSnapshot(); + }; + ScriptInfo.prototype.getFormatCodeSettings = function () { + return this.formatCodeSettings; + }; + ScriptInfo.prototype.attachToProject = function (project) { + var isNew = !this.isAttached(project); + if (isNew) { + this.containingProjects.push(project); + } + return isNew; + }; + ScriptInfo.prototype.isAttached = function (project) { + switch (this.containingProjects.length) { + case 0: return false; + case 1: return this.containingProjects[0] === project; + case 2: return this.containingProjects[0] === project || this.containingProjects[1] === project; + default: return ts.contains(this.containingProjects, project); + } + }; + ScriptInfo.prototype.detachFromProject = function (project) { + switch (this.containingProjects.length) { + case 0: + return; + case 1: + if (this.containingProjects[0] === project) { + this.containingProjects.pop(); + } + break; + case 2: + if (this.containingProjects[0] === project) { + this.containingProjects[0] = this.containingProjects.pop(); + } + else if (this.containingProjects[1] === project) { + this.containingProjects.pop(); + } + break; + default: + server.removeItemFromSet(this.containingProjects, project); + break; + } + }; + ScriptInfo.prototype.detachAllProjects = function () { + for (var _i = 0, _a = this.containingProjects; _i < _a.length; _i++) { + var p = _a[_i]; + p.removeFile(this, false); + } + this.containingProjects.length = 0; + }; + ScriptInfo.prototype.getDefaultProject = function () { + switch (this.containingProjects.length) { + case 0: + return server.Errors.ThrowNoProject(); + case 1: + return this.containingProjects[0]; + default: + var firstExternalProject = void 0; + for (var _i = 0, _a = this.containingProjects; _i < _a.length; _i++) { + var project = _a[_i]; + if (project.projectKind === server.ProjectKind.Configured) { + return project; + } + else if (project.projectKind === server.ProjectKind.External && !firstExternalProject) { + firstExternalProject = project; + } + } + return firstExternalProject || this.containingProjects[0]; + } + }; + ScriptInfo.prototype.registerFileUpdate = function () { + for (var _i = 0, _a = this.containingProjects; _i < _a.length; _i++) { + var p = _a[_i]; + p.registerFileUpdate(this.path); + } + }; + ScriptInfo.prototype.setFormatOptions = function (formatSettings) { + if (formatSettings) { + if (!this.formatCodeSettings) { + this.formatCodeSettings = server.getDefaultFormatCodeSettings(this.host); + } + server.mergeMapLikes(this.formatCodeSettings, formatSettings); + } + }; + ScriptInfo.prototype.setWatcher = function (watcher) { + this.stopWatcher(); + this.fileWatcher = watcher; + }; + ScriptInfo.prototype.stopWatcher = function () { + if (this.fileWatcher) { + this.fileWatcher.close(); + this.fileWatcher = undefined; + } + }; + ScriptInfo.prototype.getLatestVersion = function () { + return this.textStorage.getVersion(); + }; + ScriptInfo.prototype.reload = function (script) { + this.textStorage.reload(script); + this.markContainingProjectsAsDirty(); + }; + ScriptInfo.prototype.saveTo = function (fileName) { + var snap = this.textStorage.getSnapshot(); + this.host.writeFile(fileName, snap.getText(0, snap.getLength())); + }; + ScriptInfo.prototype.reloadFromFile = function (tempFileName) { + if (this.hasMixedContent) { + this.reload(""); + } + else { + this.textStorage.reloadFromFile(tempFileName); + this.markContainingProjectsAsDirty(); + } + }; + ScriptInfo.prototype.getLineInfo = function (line) { + return this.textStorage.getLineInfo(line); + }; + ScriptInfo.prototype.editContent = function (start, end, newText) { + this.textStorage.edit(start, end, newText); + this.markContainingProjectsAsDirty(); + }; + ScriptInfo.prototype.markContainingProjectsAsDirty = function () { + for (var _i = 0, _a = this.containingProjects; _i < _a.length; _i++) { + var p = _a[_i]; + p.markAsDirty(); + } + }; + ScriptInfo.prototype.lineToTextSpan = function (line) { + return this.textStorage.lineToTextSpan(line); + }; + ScriptInfo.prototype.lineOffsetToPosition = function (line, offset) { + return this.textStorage.lineOffsetToPosition(line, offset); + }; + ScriptInfo.prototype.positionToLineOffset = function (position) { + return this.textStorage.positionToLineOffset(position); + }; + ScriptInfo.prototype.isJavaScript = function () { + return this.scriptKind === 1 || this.scriptKind === 2; + }; + return ScriptInfo; + }()); + server.ScriptInfo = ScriptInfo; + })(server = ts.server || (ts.server = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var server; + (function (server) { + var LSHost = (function () { + function LSHost(host, project, cancellationToken) { + var _this = this; + this.host = host; + this.project = project; + this.cancellationToken = cancellationToken; + this.resolvedModuleNames = ts.createFileMap(); + this.resolvedTypeReferenceDirectives = ts.createFileMap(); + this.cancellationToken = new ts.ThrottledCancellationToken(cancellationToken, project.projectService.throttleWaitMilliseconds); + this.getCanonicalFileName = ts.createGetCanonicalFileName(this.host.useCaseSensitiveFileNames); + if (host.trace) { + this.trace = function (s) { return host.trace(s); }; + } + this.resolveModuleName = function (moduleName, containingFile, compilerOptions, host) { + var globalCache = _this.project.getTypeAcquisition().enable + ? _this.project.projectService.typingsInstaller.globalTypingsCacheLocation + : undefined; + var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host); + if (ts.moduleHasNonRelativeName(moduleName) && !(primaryResult.resolvedModule && ts.extensionIsTypeScript(primaryResult.resolvedModule.extension)) && globalCache !== undefined) { + var _a = ts.loadModuleFromGlobalCache(moduleName, _this.project.getProjectName(), compilerOptions, host, globalCache), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations; + if (resolvedModule) { + return { resolvedModule: resolvedModule, failedLookupLocations: primaryResult.failedLookupLocations.concat(failedLookupLocations) }; + } + } + return primaryResult; + }; + if (this.host.realpath) { + this.realpath = function (path) { return _this.host.realpath(path); }; + } + } + LSHost.prototype.startRecordingFilesWithChangedResolutions = function () { + this.filesWithChangedSetOfUnresolvedImports = []; + }; + LSHost.prototype.finishRecordingFilesWithChangedResolutions = function () { + var collected = this.filesWithChangedSetOfUnresolvedImports; + this.filesWithChangedSetOfUnresolvedImports = undefined; + return collected; + }; + LSHost.prototype.resolveNamesWithLocalCache = function (names, containingFile, cache, loader, getResult, getResultFileName, logChanges) { + var path = ts.toPath(containingFile, this.host.getCurrentDirectory(), this.getCanonicalFileName); + var currentResolutionsInFile = cache.get(path); + var newResolutions = ts.createMap(); + var resolvedModules = []; + var compilerOptions = this.getCompilationSettings(); + var lastDeletedFileName = this.project.projectService.lastDeletedFile && this.project.projectService.lastDeletedFile.fileName; + for (var _i = 0, names_2 = names; _i < names_2.length; _i++) { + var name = names_2[_i]; + var resolution = newResolutions.get(name); + if (!resolution) { + var existingResolution = currentResolutionsInFile && currentResolutionsInFile.get(name); + if (moduleResolutionIsValid(existingResolution)) { + resolution = existingResolution; + } + else { + resolution = loader(name, containingFile, compilerOptions, this); + newResolutions.set(name, resolution); + } + if (logChanges && this.filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) { + this.filesWithChangedSetOfUnresolvedImports.push(path); + logChanges = false; + } + } + ts.Debug.assert(resolution !== undefined); + resolvedModules.push(getResult(resolution)); + } + cache.set(path, newResolutions); + return resolvedModules; + function resolutionIsEqualTo(oldResolution, newResolution) { + if (oldResolution === newResolution) { + return true; + } + if (!oldResolution || !newResolution) { + return false; + } + var oldResult = getResult(oldResolution); + var newResult = getResult(newResolution); + if (oldResult === newResult) { + return true; + } + if (!oldResult || !newResult) { + return false; + } + return getResultFileName(oldResult) === getResultFileName(newResult); + } + function moduleResolutionIsValid(resolution) { + if (!resolution) { + return false; + } + var result = getResult(resolution); + if (result) { + return getResultFileName(result) !== lastDeletedFileName; + } + return resolution.failedLookupLocations.length === 0; + } + }; + LSHost.prototype.getNewLine = function () { + return this.host.newLine; + }; + LSHost.prototype.getProjectVersion = function () { + return this.project.getProjectVersion(); + }; + LSHost.prototype.getCompilationSettings = function () { + return this.compilationSettings; + }; + LSHost.prototype.useCaseSensitiveFileNames = function () { + return this.host.useCaseSensitiveFileNames; + }; + LSHost.prototype.getCancellationToken = function () { + return this.cancellationToken; + }; + LSHost.prototype.resolveTypeReferenceDirectives = function (typeDirectiveNames, containingFile) { + return this.resolveNamesWithLocalCache(typeDirectiveNames, containingFile, this.resolvedTypeReferenceDirectives, ts.resolveTypeReferenceDirective, function (m) { return m.resolvedTypeReferenceDirective; }, function (r) { return r.resolvedFileName; }, false); + }; + LSHost.prototype.resolveModuleNames = function (moduleNames, containingFile) { + return this.resolveNamesWithLocalCache(moduleNames, containingFile, this.resolvedModuleNames, this.resolveModuleName, function (m) { return m.resolvedModule; }, function (r) { return r.resolvedFileName; }, true); + }; + LSHost.prototype.getDefaultLibFileName = function () { + var nodeModuleBinDir = ts.getDirectoryPath(ts.normalizePath(this.host.getExecutingFilePath())); + return ts.combinePaths(nodeModuleBinDir, ts.getDefaultLibFileName(this.compilationSettings)); + }; + LSHost.prototype.getScriptSnapshot = function (filename) { + var scriptInfo = this.project.getScriptInfoLSHost(filename); + if (scriptInfo) { + return scriptInfo.getSnapshot(); + } + }; + LSHost.prototype.getScriptFileNames = function () { + return this.project.getRootFilesLSHost(); + }; + LSHost.prototype.getTypeRootsVersion = function () { + return this.project.typesVersion; + }; + LSHost.prototype.getScriptKind = function (fileName) { + var info = this.project.getScriptInfoLSHost(fileName); + return info && info.scriptKind; + }; + LSHost.prototype.getScriptVersion = function (filename) { + var info = this.project.getScriptInfoLSHost(filename); + return info && info.getLatestVersion(); + }; + LSHost.prototype.getCurrentDirectory = function () { + return this.host.getCurrentDirectory(); + }; + LSHost.prototype.resolvePath = function (path) { + return this.host.resolvePath(path); + }; + LSHost.prototype.fileExists = function (path) { + return this.host.fileExists(path); + }; + LSHost.prototype.readFile = function (fileName) { + return this.host.readFile(fileName); + }; + LSHost.prototype.directoryExists = function (path) { + return this.host.directoryExists(path); + }; + LSHost.prototype.readDirectory = function (path, extensions, exclude, include) { + return this.host.readDirectory(path, extensions, exclude, include); + }; + LSHost.prototype.getDirectories = function (path) { + return this.host.getDirectories(path); + }; + LSHost.prototype.notifyFileRemoved = function (info) { + this.resolvedModuleNames.remove(info.path); + this.resolvedTypeReferenceDirectives.remove(info.path); + }; + LSHost.prototype.setCompilationSettings = function (opt) { + if (ts.changesAffectModuleResolution(this.compilationSettings, opt)) { + this.resolvedModuleNames.clear(); + this.resolvedTypeReferenceDirectives.clear(); + } + this.compilationSettings = opt; + }; + return LSHost; + }()); + server.LSHost = LSHost; + })(server = ts.server || (ts.server = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var server; + (function (server) { + server.nullTypingsInstaller = { + enqueueInstallTypingsRequest: ts.noop, + attach: ts.noop, + onProjectClosed: ts.noop, + globalTypingsCacheLocation: undefined + }; + var TypingsCacheEntry = (function () { + function TypingsCacheEntry() { + } + return TypingsCacheEntry; + }()); + function setIsEqualTo(arr1, arr2) { + if (arr1 === arr2) { + return true; + } + if ((arr1 || server.emptyArray).length === 0 && (arr2 || server.emptyArray).length === 0) { + return true; + } + var set = ts.createMap(); + var unique = 0; + for (var _i = 0, arr1_1 = arr1; _i < arr1_1.length; _i++) { + var v = arr1_1[_i]; + if (set.get(v) !== true) { + set.set(v, true); + unique++; + } + } + for (var _a = 0, arr2_1 = arr2; _a < arr2_1.length; _a++) { + var v = arr2_1[_a]; + var isSet = set.get(v); + if (isSet === undefined) { + return false; + } + if (isSet === true) { + set.set(v, false); + unique--; + } + } + return unique === 0; + } + function typeAcquisitionChanged(opt1, opt2) { + return opt1.enable !== opt2.enable || + !setIsEqualTo(opt1.include, opt2.include) || + !setIsEqualTo(opt1.exclude, opt2.exclude); + } + function compilerOptionsChanged(opt1, opt2) { + return opt1.allowJs !== opt2.allowJs; + } + function unresolvedImportsChanged(imports1, imports2) { + if (imports1 === imports2) { + return false; + } + return !ts.arrayIsEqualTo(imports1, imports2); + } + var TypingsCache = (function () { + function TypingsCache(installer) { + this.installer = installer; + this.perProjectCache = ts.createMap(); + } + TypingsCache.prototype.getTypingsForProject = function (project, unresolvedImports, forceRefresh) { + var typeAcquisition = project.getTypeAcquisition(); + if (!typeAcquisition || !typeAcquisition.enable) { + return server.emptyArray; + } + var entry = this.perProjectCache.get(project.getProjectName()); + var result = entry ? entry.typings : server.emptyArray; + if (forceRefresh || + !entry || + typeAcquisitionChanged(typeAcquisition, entry.typeAcquisition) || + compilerOptionsChanged(project.getCompilerOptions(), entry.compilerOptions) || + unresolvedImportsChanged(unresolvedImports, entry.unresolvedImports)) { + this.perProjectCache.set(project.getProjectName(), { + compilerOptions: project.getCompilerOptions(), + typeAcquisition: typeAcquisition, + typings: result, + unresolvedImports: unresolvedImports, + poisoned: true + }); + this.installer.enqueueInstallTypingsRequest(project, typeAcquisition, unresolvedImports); + } + return result; + }; + TypingsCache.prototype.updateTypingsForProject = function (projectName, compilerOptions, typeAcquisition, unresolvedImports, newTypings) { + this.perProjectCache.set(projectName, { + compilerOptions: compilerOptions, + typeAcquisition: typeAcquisition, + typings: server.toSortedReadonlyArray(newTypings), + unresolvedImports: unresolvedImports, + poisoned: false + }); + }; + TypingsCache.prototype.deleteTypingsForProject = function (projectName) { + this.perProjectCache.delete(projectName); + }; + TypingsCache.prototype.onProjectClosed = function (project) { + this.perProjectCache.delete(project.getProjectName()); + this.installer.onProjectClosed(project); + }; + return TypingsCache; + }()); + server.TypingsCache = TypingsCache; + })(server = ts.server || (ts.server = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var server; + (function (server) { + function shouldEmitFile(scriptInfo) { + return !scriptInfo.hasMixedContent; + } + server.shouldEmitFile = shouldEmitFile; + var BuilderFileInfo = (function () { + function BuilderFileInfo(scriptInfo, project) { + this.scriptInfo = scriptInfo; + this.project = project; + } + BuilderFileInfo.prototype.isExternalModuleOrHasOnlyAmbientExternalModules = function () { + var sourceFile = this.getSourceFile(); + return ts.isExternalModule(sourceFile) || this.containsOnlyAmbientModules(sourceFile); + }; + BuilderFileInfo.prototype.containsOnlyAmbientModules = function (sourceFile) { + for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + if (statement.kind !== 232 || statement.name.kind !== 9) { + return false; + } + } + return true; + }; + BuilderFileInfo.prototype.computeHash = function (text) { + return this.project.projectService.host.createHash(text); + }; + BuilderFileInfo.prototype.getSourceFile = function () { + return this.project.getSourceFile(this.scriptInfo.path); + }; + BuilderFileInfo.prototype.updateShapeSignature = function () { + var sourceFile = this.getSourceFile(); + if (!sourceFile) { + return true; + } + var lastSignature = this.lastCheckedShapeSignature; + if (sourceFile.isDeclarationFile) { + this.lastCheckedShapeSignature = this.computeHash(sourceFile.text); + } + else { + var emitOutput = this.project.getFileEmitOutput(this.scriptInfo, true); + if (emitOutput.outputFiles && emitOutput.outputFiles.length > 0) { + this.lastCheckedShapeSignature = this.computeHash(emitOutput.outputFiles[0].text); + } + } + return !lastSignature || this.lastCheckedShapeSignature !== lastSignature; + }; + return BuilderFileInfo; + }()); + server.BuilderFileInfo = BuilderFileInfo; + var AbstractBuilder = (function () { + function AbstractBuilder(project, ctor) { + this.project = project; + this.ctor = ctor; + } + AbstractBuilder.prototype.getFileInfos = function () { + return this.fileInfos_doNotAccessDirectly || (this.fileInfos_doNotAccessDirectly = ts.createFileMap()); + }; + AbstractBuilder.prototype.clear = function () { + this.fileInfos_doNotAccessDirectly = undefined; + }; + AbstractBuilder.prototype.getFileInfo = function (path) { + return this.getFileInfos().get(path); + }; + AbstractBuilder.prototype.getOrCreateFileInfo = function (path) { + var fileInfo = this.getFileInfo(path); + if (!fileInfo) { + var scriptInfo = this.project.getScriptInfo(path); + fileInfo = new this.ctor(scriptInfo, this.project); + this.setFileInfo(path, fileInfo); + } + return fileInfo; + }; + AbstractBuilder.prototype.getFileInfoPaths = function () { + return this.getFileInfos().getKeys(); + }; + AbstractBuilder.prototype.setFileInfo = function (path, info) { + this.getFileInfos().set(path, info); + }; + AbstractBuilder.prototype.removeFileInfo = function (path) { + this.getFileInfos().remove(path); + }; + AbstractBuilder.prototype.forEachFileInfo = function (action) { + this.getFileInfos().forEachValue(function (_path, value) { return action(value); }); + }; + AbstractBuilder.prototype.emitFile = function (scriptInfo, writeFile) { + var fileInfo = this.getFileInfo(scriptInfo.path); + if (!fileInfo) { + return false; + } + var _a = this.project.getFileEmitOutput(fileInfo.scriptInfo, false), emitSkipped = _a.emitSkipped, outputFiles = _a.outputFiles; + if (!emitSkipped) { + var projectRootPath = this.project.getProjectRootPath(); + for (var _i = 0, outputFiles_1 = outputFiles; _i < outputFiles_1.length; _i++) { + var outputFile = outputFiles_1[_i]; + var outputFileAbsoluteFileName = ts.getNormalizedAbsolutePath(outputFile.name, projectRootPath ? projectRootPath : ts.getDirectoryPath(scriptInfo.fileName)); + writeFile(outputFileAbsoluteFileName, outputFile.text, outputFile.writeByteOrderMark); + } + } + return !emitSkipped; + }; + return AbstractBuilder; + }()); + var NonModuleBuilder = (function (_super) { + __extends(NonModuleBuilder, _super); + function NonModuleBuilder(project) { + var _this = _super.call(this, project, BuilderFileInfo) || this; + _this.project = project; + return _this; + } + NonModuleBuilder.prototype.onProjectUpdateGraph = function () { + }; + NonModuleBuilder.prototype.getFilesAffectedBy = function (scriptInfo) { + var info = this.getOrCreateFileInfo(scriptInfo.path); + var singleFileResult = scriptInfo.hasMixedContent ? [] : [scriptInfo.fileName]; + if (info.updateShapeSignature()) { + var options = this.project.getCompilerOptions(); + if (options && (options.out || options.outFile)) { + return singleFileResult; + } + return this.project.getAllEmittableFiles(); + } + return singleFileResult; + }; + return NonModuleBuilder; + }(AbstractBuilder)); + var ModuleBuilderFileInfo = (function (_super) { + __extends(ModuleBuilderFileInfo, _super); + function ModuleBuilderFileInfo() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.references = []; + _this.referencedBy = []; + return _this; + } + ModuleBuilderFileInfo.compareFileInfos = function (lf, rf) { + var l = lf.scriptInfo.fileName; + var r = rf.scriptInfo.fileName; + return (l < r ? -1 : (l > r ? 1 : 0)); + }; + ModuleBuilderFileInfo.addToReferenceList = function (array, fileInfo) { + if (array.length === 0) { + array.push(fileInfo); + return; + } + var insertIndex = ts.binarySearch(array, fileInfo, ModuleBuilderFileInfo.compareFileInfos); + if (insertIndex < 0) { + array.splice(~insertIndex, 0, fileInfo); + } + }; + ModuleBuilderFileInfo.removeFromReferenceList = function (array, fileInfo) { + if (!array || array.length === 0) { + return; + } + if (array[0] === fileInfo) { + array.splice(0, 1); + return; + } + var removeIndex = ts.binarySearch(array, fileInfo, ModuleBuilderFileInfo.compareFileInfos); + if (removeIndex >= 0) { + array.splice(removeIndex, 1); + } + }; + ModuleBuilderFileInfo.prototype.addReferencedBy = function (fileInfo) { + ModuleBuilderFileInfo.addToReferenceList(this.referencedBy, fileInfo); + }; + ModuleBuilderFileInfo.prototype.removeReferencedBy = function (fileInfo) { + ModuleBuilderFileInfo.removeFromReferenceList(this.referencedBy, fileInfo); + }; + ModuleBuilderFileInfo.prototype.removeFileReferences = function () { + for (var _i = 0, _a = this.references; _i < _a.length; _i++) { + var reference = _a[_i]; + reference.removeReferencedBy(this); + } + this.references = []; + }; + return ModuleBuilderFileInfo; + }(BuilderFileInfo)); + var ModuleBuilder = (function (_super) { + __extends(ModuleBuilder, _super); + function ModuleBuilder(project) { + var _this = _super.call(this, project, ModuleBuilderFileInfo) || this; + _this.project = project; + return _this; + } + ModuleBuilder.prototype.clear = function () { + this.projectVersionForDependencyGraph = undefined; + _super.prototype.clear.call(this); + }; + ModuleBuilder.prototype.getReferencedFileInfos = function (fileInfo) { + var _this = this; + if (!fileInfo.isExternalModuleOrHasOnlyAmbientExternalModules()) { + return []; + } + var referencedFilePaths = this.project.getReferencedFiles(fileInfo.scriptInfo.path); + if (referencedFilePaths.length > 0) { + return ts.map(referencedFilePaths, function (f) { return _this.getOrCreateFileInfo(f); }).sort(ModuleBuilderFileInfo.compareFileInfos); + } + return []; + }; + ModuleBuilder.prototype.onProjectUpdateGraph = function () { + this.ensureProjectDependencyGraphUpToDate(); + }; + ModuleBuilder.prototype.ensureProjectDependencyGraphUpToDate = function () { + var _this = this; + if (!this.projectVersionForDependencyGraph || this.project.getProjectVersion() !== this.projectVersionForDependencyGraph) { + var currentScriptInfos = this.project.getScriptInfos(); + for (var _i = 0, currentScriptInfos_1 = currentScriptInfos; _i < currentScriptInfos_1.length; _i++) { + var scriptInfo = currentScriptInfos_1[_i]; + var fileInfo = this.getOrCreateFileInfo(scriptInfo.path); + this.updateFileReferences(fileInfo); + } + this.forEachFileInfo(function (fileInfo) { + if (!_this.project.containsScriptInfo(fileInfo.scriptInfo)) { + fileInfo.removeFileReferences(); + _this.removeFileInfo(fileInfo.scriptInfo.path); + } + }); + this.projectVersionForDependencyGraph = this.project.getProjectVersion(); + } + }; + ModuleBuilder.prototype.updateFileReferences = function (fileInfo) { + if (fileInfo.scriptVersionForReferences === fileInfo.scriptInfo.getLatestVersion()) { + return; + } + var newReferences = this.getReferencedFileInfos(fileInfo); + var oldReferences = fileInfo.references; + var oldIndex = 0; + var newIndex = 0; + while (oldIndex < oldReferences.length && newIndex < newReferences.length) { + var oldReference = oldReferences[oldIndex]; + var newReference = newReferences[newIndex]; + var compare = ModuleBuilderFileInfo.compareFileInfos(oldReference, newReference); + if (compare < 0) { + oldReference.removeReferencedBy(fileInfo); + oldIndex++; + } + else if (compare > 0) { + newReference.addReferencedBy(fileInfo); + newIndex++; + } + else { + oldIndex++; + newIndex++; + } + } + for (var i = oldIndex; i < oldReferences.length; i++) { + oldReferences[i].removeReferencedBy(fileInfo); + } + for (var i = newIndex; i < newReferences.length; i++) { + newReferences[i].addReferencedBy(fileInfo); + } + fileInfo.references = newReferences; + fileInfo.scriptVersionForReferences = fileInfo.scriptInfo.getLatestVersion(); + }; + ModuleBuilder.prototype.getFilesAffectedBy = function (scriptInfo) { + this.ensureProjectDependencyGraphUpToDate(); + var singleFileResult = scriptInfo.hasMixedContent ? [] : [scriptInfo.fileName]; + var fileInfo = this.getFileInfo(scriptInfo.path); + if (!fileInfo || !fileInfo.updateShapeSignature()) { + return singleFileResult; + } + if (!fileInfo.isExternalModuleOrHasOnlyAmbientExternalModules()) { + return this.project.getAllEmittableFiles(); + } + var options = this.project.getCompilerOptions(); + if (options && (options.isolatedModules || options.out || options.outFile)) { + return singleFileResult; + } + var queue = fileInfo.referencedBy.slice(0); + var fileNameSet = ts.createMap(); + fileNameSet.set(scriptInfo.fileName, scriptInfo); + while (queue.length > 0) { + var processingFileInfo = queue.pop(); + if (processingFileInfo.updateShapeSignature() && processingFileInfo.referencedBy.length > 0) { + for (var _i = 0, _a = processingFileInfo.referencedBy; _i < _a.length; _i++) { + var potentialFileInfo = _a[_i]; + if (!fileNameSet.has(potentialFileInfo.scriptInfo.fileName)) { + queue.push(potentialFileInfo); + } + } + } + fileNameSet.set(processingFileInfo.scriptInfo.fileName, processingFileInfo.scriptInfo); + } + var result = []; + fileNameSet.forEach(function (scriptInfo, fileName) { + if (shouldEmitFile(scriptInfo)) { + result.push(fileName); + } + }); + return result; + }; + return ModuleBuilder; + }(AbstractBuilder)); + function createBuilder(project) { + var moduleKind = project.getCompilerOptions().module; + switch (moduleKind) { + case ts.ModuleKind.None: + return new NonModuleBuilder(project); + default: + return new ModuleBuilder(project); + } + } + server.createBuilder = createBuilder; + })(server = ts.server || (ts.server = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var server; + (function (server) { + var ProjectKind; + (function (ProjectKind) { + ProjectKind[ProjectKind["Inferred"] = 0] = "Inferred"; + ProjectKind[ProjectKind["Configured"] = 1] = "Configured"; + ProjectKind[ProjectKind["External"] = 2] = "External"; + })(ProjectKind = server.ProjectKind || (server.ProjectKind = {})); + function remove(items, item) { + var index = items.indexOf(item); + if (index >= 0) { + items.splice(index, 1); + } + } + function countEachFileTypes(infos) { + var result = { js: 0, jsx: 0, ts: 0, tsx: 0, dts: 0 }; + for (var _i = 0, infos_1 = infos; _i < infos_1.length; _i++) { + var info = infos_1[_i]; + switch (info.scriptKind) { + case 1: + result.js += 1; + break; + case 2: + result.jsx += 1; + break; + case 3: + ts.fileExtensionIs(info.fileName, ".d.ts") + ? result.dts += 1 + : result.ts += 1; + break; + case 4: + result.tsx += 1; + break; + } + } + return result; + } + function hasOneOrMoreJsAndNoTsFiles(project) { + var counts = countEachFileTypes(project.getScriptInfos()); + return counts.js > 0 && counts.ts === 0 && counts.tsx === 0; + } + function allRootFilesAreJsOrDts(project) { + var counts = countEachFileTypes(project.getRootScriptInfos()); + return counts.ts === 0 && counts.tsx === 0; + } + server.allRootFilesAreJsOrDts = allRootFilesAreJsOrDts; + function allFilesAreJsOrDts(project) { + var counts = countEachFileTypes(project.getScriptInfos()); + return counts.ts === 0 && counts.tsx === 0; + } + server.allFilesAreJsOrDts = allFilesAreJsOrDts; + var UnresolvedImportsMap = (function () { + function UnresolvedImportsMap() { + this.perFileMap = ts.createFileMap(); + this.version = 0; + } + UnresolvedImportsMap.prototype.clear = function () { + this.perFileMap.clear(); + this.version = 0; + }; + UnresolvedImportsMap.prototype.getVersion = function () { + return this.version; + }; + UnresolvedImportsMap.prototype.remove = function (path) { + this.perFileMap.remove(path); + this.version++; + }; + UnresolvedImportsMap.prototype.get = function (path) { + return this.perFileMap.get(path); + }; + UnresolvedImportsMap.prototype.set = function (path, value) { + this.perFileMap.set(path, value); + this.version++; + }; + return UnresolvedImportsMap; + }()); + server.UnresolvedImportsMap = UnresolvedImportsMap; + var Project = (function () { + function Project(projectName, projectKind, projectService, documentRegistry, hasExplicitListOfFiles, languageServiceEnabled, compilerOptions, compileOnSaveEnabled) { + this.projectName = projectName; + this.projectKind = projectKind; + this.projectService = projectService; + this.documentRegistry = documentRegistry; + this.compilerOptions = compilerOptions; + this.compileOnSaveEnabled = compileOnSaveEnabled; + this.rootFiles = []; + this.rootFilesMap = ts.createFileMap(); + this.cachedUnresolvedImportsPerFile = new UnresolvedImportsMap(); + this.languageServiceEnabled = true; + this.lastReportedVersion = 0; + this.projectStructureVersion = 0; + this.projectStateVersion = 0; + this.typesVersion = 0; + if (!this.compilerOptions) { + this.compilerOptions = ts.getDefaultCompilerOptions(); + this.compilerOptions.allowNonTsExtensions = true; + this.compilerOptions.allowJs = true; + } + else if (hasExplicitListOfFiles || this.compilerOptions.allowJs) { + this.compilerOptions.allowNonTsExtensions = true; + } + this.setInternalCompilerOptionsForEmittingJsFiles(); + this.lsHost = new server.LSHost(this.projectService.host, this, this.projectService.cancellationToken); + this.lsHost.setCompilationSettings(this.compilerOptions); + this.languageService = ts.createLanguageService(this.lsHost, this.documentRegistry); + if (!languageServiceEnabled) { + this.disableLanguageService(); + } + this.builder = server.createBuilder(this); + this.markAsDirty(); + } + Project.prototype.isNonTsProject = function () { + this.updateGraph(); + return allFilesAreJsOrDts(this); + }; + Project.prototype.isJsOnlyProject = function () { + this.updateGraph(); + return hasOneOrMoreJsAndNoTsFiles(this); + }; + Project.prototype.getCachedUnresolvedImportsPerFile_TestOnly = function () { + return this.cachedUnresolvedImportsPerFile; + }; + Project.resolveModule = function (moduleName, initialDir, host, log) { + var resolvedPath = ts.normalizeSlashes(host.resolvePath(ts.combinePaths(initialDir, "node_modules"))); + log("Loading " + moduleName + " from " + initialDir + " (resolved to " + resolvedPath + ")"); + var result = host.require(resolvedPath, moduleName); + if (result.error) { + log("Failed to load module: " + JSON.stringify(result.error)); + return undefined; + } + return result.module; + }; + Project.prototype.setInternalCompilerOptionsForEmittingJsFiles = function () { + if (this.projectKind === ProjectKind.Inferred || this.projectKind === ProjectKind.External) { + this.compilerOptions.noEmitForJsFiles = true; + } + }; + Project.prototype.getProjectErrors = function () { + return this.projectErrors; + }; + Project.prototype.getLanguageService = function (ensureSynchronized) { + if (ensureSynchronized === void 0) { ensureSynchronized = true; } + if (ensureSynchronized) { + this.updateGraph(); + } + return this.languageService; + }; + Project.prototype.getCompileOnSaveAffectedFileList = function (scriptInfo) { + if (!this.languageServiceEnabled) { + return []; + } + this.updateGraph(); + return this.builder.getFilesAffectedBy(scriptInfo); + }; + Project.prototype.getProjectVersion = function () { + return this.projectStateVersion.toString(); + }; + Project.prototype.enableLanguageService = function () { + if (this.languageServiceEnabled) { + return; + } + this.languageServiceEnabled = true; + this.projectService.onUpdateLanguageServiceStateForProject(this, true); + }; + Project.prototype.disableLanguageService = function () { + if (!this.languageServiceEnabled) { + return; + } + this.languageService.cleanupSemanticCache(); + this.languageServiceEnabled = false; + this.projectService.onUpdateLanguageServiceStateForProject(this, false); + }; + Project.prototype.getProjectName = function () { + return this.projectName; + }; + Project.prototype.getExternalFiles = function () { + return []; + }; + Project.prototype.getSourceFile = function (path) { + if (!this.program) { + return undefined; + } + return this.program.getSourceFileByPath(path); + }; + Project.prototype.updateTypes = function () { + this.typesVersion++; + this.markAsDirty(); + this.updateGraph(); + }; + Project.prototype.close = function () { + if (this.program) { + for (var _i = 0, _a = this.program.getSourceFiles(); _i < _a.length; _i++) { + var f = _a[_i]; + var info = this.projectService.getScriptInfo(f.fileName); + info.detachFromProject(this); + } + } + if (!this.program || !this.languageServiceEnabled) { + for (var _b = 0, _c = this.rootFiles; _b < _c.length; _b++) { + var root = _c[_b]; + root.detachFromProject(this); + } + } + this.rootFiles = undefined; + this.rootFilesMap = undefined; + this.program = undefined; + this.languageService.dispose(); + }; + Project.prototype.getCompilerOptions = function () { + return this.compilerOptions; + }; + Project.prototype.hasRoots = function () { + return this.rootFiles && this.rootFiles.length > 0; + }; + Project.prototype.getRootFiles = function () { + return this.rootFiles && this.rootFiles.map(function (info) { return info.fileName; }); + }; + Project.prototype.getRootFilesLSHost = function () { + var result = []; + if (this.rootFiles) { + for (var _i = 0, _a = this.rootFiles; _i < _a.length; _i++) { + var f = _a[_i]; + if (this.languageServiceEnabled || f.isScriptOpen()) { + result.push(f.fileName); + } + } + if (this.typingFiles) { + for (var _b = 0, _c = this.typingFiles; _b < _c.length; _b++) { + var f = _c[_b]; + result.push(f); + } + } + } + return result; + }; + Project.prototype.getRootScriptInfos = function () { + return this.rootFiles; + }; + Project.prototype.getScriptInfos = function () { + var _this = this; + if (!this.languageServiceEnabled) { + return this.rootFiles; + } + return ts.map(this.program.getSourceFiles(), function (sourceFile) { + var scriptInfo = _this.projectService.getScriptInfoForPath(sourceFile.path); + if (!scriptInfo) { + ts.Debug.assert(false, "scriptInfo for a file '" + sourceFile.fileName + "' is missing."); + } + return scriptInfo; + }); + }; + Project.prototype.getFileEmitOutput = function (info, emitOnlyDtsFiles) { + if (!this.languageServiceEnabled) { + return undefined; + } + return this.getLanguageService().getEmitOutput(info.fileName, emitOnlyDtsFiles); + }; + Project.prototype.getFileNames = function (excludeFilesFromExternalLibraries) { + if (!this.program) { + return []; + } + if (!this.languageServiceEnabled) { + var rootFiles = this.getRootFiles(); + if (this.compilerOptions) { + var defaultLibrary = ts.getDefaultLibFilePath(this.compilerOptions); + if (defaultLibrary) { + (rootFiles || (rootFiles = [])).push(server.asNormalizedPath(defaultLibrary)); + } + } + return rootFiles; + } + var result = []; + for (var _i = 0, _a = this.program.getSourceFiles(); _i < _a.length; _i++) { + var f = _a[_i]; + if (excludeFilesFromExternalLibraries && this.program.isSourceFileFromExternalLibrary(f)) { + continue; + } + result.push(server.asNormalizedPath(f.fileName)); + } + return result; + }; + Project.prototype.getAllEmittableFiles = function () { + if (!this.languageServiceEnabled) { + return []; + } + var defaultLibraryFileName = ts.getDefaultLibFileName(this.compilerOptions); + var infos = this.getScriptInfos(); + var result = []; + for (var _i = 0, infos_2 = infos; _i < infos_2.length; _i++) { + var info = infos_2[_i]; + if (ts.getBaseFileName(info.fileName) !== defaultLibraryFileName && server.shouldEmitFile(info)) { + result.push(info.fileName); + } + } + return result; + }; + Project.prototype.containsScriptInfo = function (info) { + return this.isRoot(info) || (this.program && this.program.getSourceFileByPath(info.path) !== undefined); + }; + Project.prototype.containsFile = function (filename, requireOpen) { + var info = this.projectService.getScriptInfoForNormalizedPath(filename); + if (info && (info.isScriptOpen() || !requireOpen)) { + return this.containsScriptInfo(info); + } + }; + Project.prototype.isRoot = function (info) { + return this.rootFilesMap && this.rootFilesMap.contains(info.path); + }; + Project.prototype.addRoot = function (info) { + if (!this.isRoot(info)) { + this.rootFiles.push(info); + this.rootFilesMap.set(info.path, info); + info.attachToProject(this); + this.markAsDirty(); + } + }; + Project.prototype.removeFile = function (info, detachFromProject) { + if (detachFromProject === void 0) { detachFromProject = true; } + if (this.isRoot(info)) { + this.removeRoot(info); + } + this.lsHost.notifyFileRemoved(info); + this.cachedUnresolvedImportsPerFile.remove(info.path); + if (detachFromProject) { + info.detachFromProject(this); + } + this.markAsDirty(); + }; + Project.prototype.registerFileUpdate = function (fileName) { + (this.updatedFileNames || (this.updatedFileNames = ts.createMap())).set(fileName, fileName); + }; + Project.prototype.markAsDirty = function () { + this.projectStateVersion++; + }; + Project.prototype.extractUnresolvedImportsFromSourceFile = function (file, result) { + var cached = this.cachedUnresolvedImportsPerFile.get(file.path); + if (cached) { + for (var _i = 0, cached_2 = cached; _i < cached_2.length; _i++) { + var f = cached_2[_i]; + result.push(f); + } + return; + } + var unresolvedImports; + if (file.resolvedModules) { + file.resolvedModules.forEach(function (resolvedModule, name) { + if (!resolvedModule && !ts.isExternalModuleNameRelative(name)) { + var trimmed = name.trim(); + var i = trimmed.indexOf("/"); + if (i !== -1 && trimmed.charCodeAt(0) === 64) { + i = trimmed.indexOf("/", i + 1); + } + if (i !== -1) { + trimmed = trimmed.substr(0, i); + } + (unresolvedImports || (unresolvedImports = [])).push(trimmed); + result.push(trimmed); + } + }); + } + this.cachedUnresolvedImportsPerFile.set(file.path, unresolvedImports || server.emptyArray); + }; + Project.prototype.updateGraph = function () { + this.lsHost.startRecordingFilesWithChangedResolutions(); + var hasChanges = this.updateGraphWorker(); + var changedFiles = this.lsHost.finishRecordingFilesWithChangedResolutions() || server.emptyArray; + for (var _i = 0, changedFiles_1 = changedFiles; _i < changedFiles_1.length; _i++) { + var file = changedFiles_1[_i]; + this.cachedUnresolvedImportsPerFile.remove(file); + } + var unresolvedImports; + if (hasChanges || changedFiles.length) { + var result = []; + for (var _a = 0, _b = this.program.getSourceFiles(); _a < _b.length; _a++) { + var sourceFile = _b[_a]; + this.extractUnresolvedImportsFromSourceFile(sourceFile, result); + } + this.lastCachedUnresolvedImportsList = server.toSortedReadonlyArray(result); + } + unresolvedImports = this.lastCachedUnresolvedImportsList; + var cachedTypings = this.projectService.typingsCache.getTypingsForProject(this, unresolvedImports, hasChanges); + if (this.setTypings(cachedTypings)) { + hasChanges = this.updateGraphWorker() || hasChanges; + } + if (this.languageServiceEnabled) { + this.builder.onProjectUpdateGraph(); + } + else { + this.builder.clear(); + } + if (hasChanges) { + this.projectStructureVersion++; + } + return !hasChanges; + }; + Project.prototype.setTypings = function (typings) { + if (ts.arrayIsEqualTo(this.typingFiles, typings)) { + return false; + } + this.typingFiles = typings; + this.markAsDirty(); + return true; + }; + Project.prototype.updateGraphWorker = function () { + var oldProgram = this.program; + this.program = this.languageService.getProgram(); + var hasChanges = false; + if (!oldProgram || (this.program !== oldProgram && !oldProgram.structureIsReused)) { + hasChanges = true; + if (oldProgram) { + for (var _i = 0, _a = oldProgram.getSourceFiles(); _i < _a.length; _i++) { + var f = _a[_i]; + if (this.program.getSourceFileByPath(f.path)) { + continue; + } + var scriptInfoToDetach = this.projectService.getScriptInfo(f.fileName); + if (scriptInfoToDetach) { + scriptInfoToDetach.detachFromProject(this); + } + } + } + } + return hasChanges; + }; + Project.prototype.getScriptInfoLSHost = function (fileName) { + var scriptInfo = this.projectService.getOrCreateScriptInfo(fileName, false); + if (scriptInfo) { + scriptInfo.attachToProject(this); + } + return scriptInfo; + }; + Project.prototype.getScriptInfoForNormalizedPath = function (fileName) { + var scriptInfo = this.projectService.getOrCreateScriptInfoForNormalizedPath(fileName, false); + if (scriptInfo && !scriptInfo.isAttached(this)) { + return server.Errors.ThrowProjectDoesNotContainDocument(fileName, this); + } + return scriptInfo; + }; + Project.prototype.getScriptInfo = function (uncheckedFileName) { + return this.getScriptInfoForNormalizedPath(server.toNormalizedPath(uncheckedFileName)); + }; + Project.prototype.filesToString = function () { + if (!this.program) { + return ""; + } + var strBuilder = ""; + for (var _i = 0, _a = this.program.getSourceFiles(); _i < _a.length; _i++) { + var file = _a[_i]; + strBuilder += file.fileName + "\n"; + } + return strBuilder; + }; + Project.prototype.setCompilerOptions = function (compilerOptions) { + if (compilerOptions) { + compilerOptions.allowNonTsExtensions = true; + if (ts.changesAffectModuleResolution(this.compilerOptions, compilerOptions)) { + this.cachedUnresolvedImportsPerFile.clear(); + this.lastCachedUnresolvedImportsList = undefined; + } + this.compilerOptions = compilerOptions; + this.setInternalCompilerOptionsForEmittingJsFiles(); + this.lsHost.setCompilationSettings(compilerOptions); + this.markAsDirty(); + } + }; + Project.prototype.reloadScript = function (filename, tempFileName) { + var script = this.projectService.getScriptInfoForNormalizedPath(filename); + if (script) { + ts.Debug.assert(script.isAttached(this)); + script.reloadFromFile(tempFileName); + return true; + } + return false; + }; + Project.prototype.getChangesSinceVersion = function (lastKnownVersion) { + this.updateGraph(); + var info = { + projectName: this.getProjectName(), + version: this.projectStructureVersion, + isInferred: this.projectKind === ProjectKind.Inferred, + options: this.getCompilerOptions(), + languageServiceDisabled: !this.languageServiceEnabled + }; + var updatedFileNames = this.updatedFileNames; + this.updatedFileNames = undefined; + if (this.lastReportedFileNames && lastKnownVersion === this.lastReportedVersion) { + if (this.projectStructureVersion === this.lastReportedVersion && !updatedFileNames) { + return { info: info, projectErrors: this.projectErrors }; + } + var lastReportedFileNames_1 = this.lastReportedFileNames; + var currentFiles_1 = ts.arrayToMap(this.getFileNames(), function (x) { return x; }); + var added_1 = []; + var removed_1 = []; + var updated = ts.arrayFrom(updatedFileNames.keys()); + ts.forEachKey(currentFiles_1, function (id) { + if (!lastReportedFileNames_1.has(id)) { + added_1.push(id); + } + }); + ts.forEachKey(lastReportedFileNames_1, function (id) { + if (!currentFiles_1.has(id)) { + removed_1.push(id); + } + }); + this.lastReportedFileNames = currentFiles_1; + this.lastReportedVersion = this.projectStructureVersion; + return { info: info, changes: { added: added_1, removed: removed_1, updated: updated }, projectErrors: this.projectErrors }; + } + else { + var projectFileNames = this.getFileNames(); + this.lastReportedFileNames = ts.arrayToMap(projectFileNames, function (x) { return x; }); + this.lastReportedVersion = this.projectStructureVersion; + return { info: info, files: projectFileNames, projectErrors: this.projectErrors }; + } + }; + Project.prototype.getReferencedFiles = function (path) { + var _this = this; + if (!this.languageServiceEnabled) { + return []; + } + var sourceFile = this.getSourceFile(path); + if (!sourceFile) { + return []; + } + var referencedFiles = ts.createMap(); + if (sourceFile.imports && sourceFile.imports.length > 0) { + var checker = this.program.getTypeChecker(); + for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { + var importName = _a[_i]; + var symbol = checker.getSymbolAtLocation(importName); + if (symbol && symbol.declarations && symbol.declarations[0]) { + var declarationSourceFile = symbol.declarations[0].getSourceFile(); + if (declarationSourceFile) { + referencedFiles.set(declarationSourceFile.path, true); + } + } + } + } + var currentDirectory = ts.getDirectoryPath(path); + var getCanonicalFileName = ts.createGetCanonicalFileName(this.projectService.host.useCaseSensitiveFileNames); + if (sourceFile.referencedFiles && sourceFile.referencedFiles.length > 0) { + for (var _b = 0, _c = sourceFile.referencedFiles; _b < _c.length; _b++) { + var referencedFile = _c[_b]; + var referencedPath = ts.toPath(referencedFile.fileName, currentDirectory, getCanonicalFileName); + referencedFiles.set(referencedPath, true); + } + } + if (sourceFile.resolvedTypeReferenceDirectiveNames) { + sourceFile.resolvedTypeReferenceDirectiveNames.forEach(function (resolvedTypeReferenceDirective) { + if (!resolvedTypeReferenceDirective) { + return; + } + var fileName = resolvedTypeReferenceDirective.resolvedFileName; + var typeFilePath = ts.toPath(fileName, currentDirectory, getCanonicalFileName); + referencedFiles.set(typeFilePath, true); + }); + } + var allFileNames = ts.arrayFrom(referencedFiles.keys()); + return ts.filter(allFileNames, function (file) { return _this.projectService.host.fileExists(file); }); + }; + Project.prototype.removeRoot = function (info) { + remove(this.rootFiles, info); + this.rootFilesMap.remove(info.path); + }; + return Project; + }()); + server.Project = Project; + var InferredProject = (function (_super) { + __extends(InferredProject, _super); + function InferredProject(projectService, documentRegistry, compilerOptions) { + var _this = _super.call(this, InferredProject.newName(), ProjectKind.Inferred, projectService, documentRegistry, undefined, true, compilerOptions, false) || this; + _this._isJsInferredProject = false; + _this.directoriesWatchedForTsconfig = []; + return _this; + } + InferredProject.prototype.toggleJsInferredProject = function (isJsInferredProject) { + if (isJsInferredProject !== this._isJsInferredProject) { + this._isJsInferredProject = isJsInferredProject; + this.setCompilerOptions(); + } + }; + InferredProject.prototype.setCompilerOptions = function (options) { + var newOptions = options ? ts.clone(options) : this.getCompilerOptions(); + if (!newOptions) { + return; + } + if (this._isJsInferredProject && typeof newOptions.maxNodeModuleJsDepth !== "number") { + newOptions.maxNodeModuleJsDepth = 2; + } + else if (!this._isJsInferredProject) { + newOptions.maxNodeModuleJsDepth = undefined; + } + newOptions.allowJs = true; + _super.prototype.setCompilerOptions.call(this, newOptions); + }; + InferredProject.prototype.addRoot = function (info) { + if (!this._isJsInferredProject && info.isJavaScript()) { + this.toggleJsInferredProject(true); + } + _super.prototype.addRoot.call(this, info); + }; + InferredProject.prototype.removeRoot = function (info) { + if (this._isJsInferredProject && info.isJavaScript()) { + if (ts.filter(this.getRootScriptInfos(), function (info) { return info.isJavaScript(); }).length === 0) { + this.toggleJsInferredProject(false); + } + } + _super.prototype.removeRoot.call(this, info); + }; + InferredProject.prototype.getProjectRootPath = function () { + if (this.projectService.useSingleInferredProject) { + return undefined; + } + var rootFiles = this.getRootFiles(); + return ts.getDirectoryPath(rootFiles[0]); + }; + InferredProject.prototype.close = function () { + _super.prototype.close.call(this); + for (var _i = 0, _a = this.directoriesWatchedForTsconfig; _i < _a.length; _i++) { + var directory = _a[_i]; + this.projectService.stopWatchingDirectory(directory); + } + }; + InferredProject.prototype.getTypeAcquisition = function () { + return { + enable: allRootFilesAreJsOrDts(this), + include: [], + exclude: [] + }; + }; + return InferredProject; + }(Project)); + InferredProject.newName = (function () { + var nextId = 1; + return function () { + var id = nextId; + nextId++; + return server.makeInferredProjectName(id); + }; + })(); + server.InferredProject = InferredProject; + var ConfiguredProject = (function (_super) { + __extends(ConfiguredProject, _super); + function ConfiguredProject(configFileName, projectService, documentRegistry, hasExplicitListOfFiles, compilerOptions, wildcardDirectories, languageServiceEnabled, compileOnSaveEnabled) { + var _this = _super.call(this, configFileName, ProjectKind.Configured, projectService, documentRegistry, hasExplicitListOfFiles, languageServiceEnabled, compilerOptions, compileOnSaveEnabled) || this; + _this.wildcardDirectories = wildcardDirectories; + _this.compileOnSaveEnabled = compileOnSaveEnabled; + _this.plugins = []; + _this.openRefCount = 0; + _this.canonicalConfigFilePath = server.asNormalizedPath(projectService.toCanonicalFileName(configFileName)); + _this.enablePlugins(); + return _this; + } + ConfiguredProject.prototype.getConfigFilePath = function () { + return this.getProjectName(); + }; + ConfiguredProject.prototype.enablePlugins = function () { + var host = this.projectService.host; + var options = this.getCompilerOptions(); + if (!host.require) { + this.projectService.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded"); + return; + } + var searchPaths = [ts.combinePaths(host.getExecutingFilePath(), "../../..")].concat(this.projectService.pluginProbeLocations); + if (options.plugins) { + for (var _i = 0, _a = options.plugins; _i < _a.length; _i++) { + var pluginConfigEntry = _a[_i]; + this.enablePlugin(pluginConfigEntry, searchPaths); + } + } + if (this.projectService.globalPlugins) { + var _loop_6 = function (globalPluginName) { + if (options.plugins && options.plugins.some(function (p) { return p.name === globalPluginName; })) + return "continue"; + this_1.enablePlugin({ name: globalPluginName, global: true }, searchPaths); + }; + var this_1 = this; + for (var _b = 0, _c = this.projectService.globalPlugins; _b < _c.length; _b++) { + var globalPluginName = _c[_b]; + _loop_6(globalPluginName); + } + } + }; + ConfiguredProject.prototype.enablePlugin = function (pluginConfigEntry, searchPaths) { + var _this = this; + var log = function (message) { + _this.projectService.logger.info(message); + }; + for (var _i = 0, searchPaths_1 = searchPaths; _i < searchPaths_1.length; _i++) { + var searchPath = searchPaths_1[_i]; + var resolvedModule = Project.resolveModule(pluginConfigEntry.name, searchPath, this.projectService.host, log); + if (resolvedModule) { + this.enableProxy(resolvedModule, pluginConfigEntry); + return; + } + } + this.projectService.logger.info("Couldn't find " + pluginConfigEntry.name + " anywhere in paths: " + searchPaths.join(",")); + }; + ConfiguredProject.prototype.enableProxy = function (pluginModuleFactory, configEntry) { + try { + if (typeof pluginModuleFactory !== "function") { + this.projectService.logger.info("Skipped loading plugin " + configEntry.name + " because it did expose a proper factory function"); + return; + } + var info = { + config: configEntry, + project: this, + languageService: this.languageService, + languageServiceHost: this.lsHost, + serverHost: this.projectService.host + }; + var pluginModule = pluginModuleFactory({ typescript: ts }); + this.languageService = pluginModule.create(info); + this.plugins.push(pluginModule); + } + catch (e) { + this.projectService.logger.info("Plugin activation failed: " + e); + } + }; + ConfiguredProject.prototype.getProjectRootPath = function () { + return ts.getDirectoryPath(this.getConfigFilePath()); + }; + ConfiguredProject.prototype.setProjectErrors = function (projectErrors) { + this.projectErrors = projectErrors; + }; + ConfiguredProject.prototype.setTypeAcquisition = function (newTypeAcquisition) { + this.typeAcquisition = newTypeAcquisition; + }; + ConfiguredProject.prototype.getTypeAcquisition = function () { + return this.typeAcquisition; + }; + ConfiguredProject.prototype.getExternalFiles = function () { + var items = []; + for (var _i = 0, _a = this.plugins; _i < _a.length; _i++) { + var plugin = _a[_i]; + if (typeof plugin.getExternalFiles === "function") { + try { + items.push.apply(items, plugin.getExternalFiles(this)); + } + catch (e) { + this.projectService.logger.info("A plugin threw an exception in getExternalFiles: " + e); + } + } + } + return items; + }; + ConfiguredProject.prototype.watchConfigFile = function (callback) { + var _this = this; + this.projectFileWatcher = this.projectService.host.watchFile(this.getConfigFilePath(), function (_) { return callback(_this); }); + }; + ConfiguredProject.prototype.watchTypeRoots = function (callback) { + var _this = this; + var roots = this.getEffectiveTypeRoots(); + var watchers = []; + for (var _i = 0, roots_1 = roots; _i < roots_1.length; _i++) { + var root = roots_1[_i]; + this.projectService.logger.info("Add type root watcher for: " + root); + watchers.push(this.projectService.host.watchDirectory(root, function (path) { return callback(_this, path); }, false)); + } + this.typeRootsWatchers = watchers; + }; + ConfiguredProject.prototype.watchConfigDirectory = function (callback) { + var _this = this; + if (this.directoryWatcher) { + return; + } + var directoryToWatch = ts.getDirectoryPath(this.getConfigFilePath()); + this.projectService.logger.info("Add recursive watcher for: " + directoryToWatch); + this.directoryWatcher = this.projectService.host.watchDirectory(directoryToWatch, function (path) { return callback(_this, path); }, true); + }; + ConfiguredProject.prototype.watchWildcards = function (callback) { + var _this = this; + if (!this.wildcardDirectories) { + return; + } + var configDirectoryPath = ts.getDirectoryPath(this.getConfigFilePath()); + this.directoriesWatchedForWildcards = ts.createMap(); + this.wildcardDirectories.forEach(function (flag, directory) { + if (ts.comparePaths(configDirectoryPath, directory, ".", !_this.projectService.host.useCaseSensitiveFileNames) !== 0) { + var recursive = (flag & 1) !== 0; + _this.projectService.logger.info("Add " + (recursive ? "recursive " : "") + "watcher for: " + directory); + _this.directoriesWatchedForWildcards.set(directory, _this.projectService.host.watchDirectory(directory, function (path) { return callback(_this, path); }, recursive)); + } + }); + }; + ConfiguredProject.prototype.stopWatchingDirectory = function () { + if (this.directoryWatcher) { + this.directoryWatcher.close(); + this.directoryWatcher = undefined; + } + }; + ConfiguredProject.prototype.close = function () { + _super.prototype.close.call(this); + if (this.projectFileWatcher) { + this.projectFileWatcher.close(); + } + if (this.typeRootsWatchers) { + for (var _i = 0, _a = this.typeRootsWatchers; _i < _a.length; _i++) { + var watcher = _a[_i]; + watcher.close(); + } + this.typeRootsWatchers = undefined; + } + this.directoriesWatchedForWildcards.forEach(function (watcher) { + watcher.close(); + }); + this.directoriesWatchedForWildcards = undefined; + this.stopWatchingDirectory(); + }; + ConfiguredProject.prototype.addOpenRef = function () { + this.openRefCount++; + }; + ConfiguredProject.prototype.deleteOpenRef = function () { + this.openRefCount--; + return this.openRefCount; + }; + ConfiguredProject.prototype.getEffectiveTypeRoots = function () { + return ts.getEffectiveTypeRoots(this.getCompilerOptions(), this.projectService.host) || []; + }; + return ConfiguredProject; + }(Project)); + server.ConfiguredProject = ConfiguredProject; + var ExternalProject = (function (_super) { + __extends(ExternalProject, _super); + function ExternalProject(externalProjectName, projectService, documentRegistry, compilerOptions, languageServiceEnabled, compileOnSaveEnabled, projectFilePath) { + var _this = _super.call(this, externalProjectName, ProjectKind.External, projectService, documentRegistry, true, languageServiceEnabled, compilerOptions, compileOnSaveEnabled) || this; + _this.externalProjectName = externalProjectName; + _this.compileOnSaveEnabled = compileOnSaveEnabled; + _this.projectFilePath = projectFilePath; + return _this; + } + ExternalProject.prototype.getProjectRootPath = function () { + if (this.projectFilePath) { + return ts.getDirectoryPath(this.projectFilePath); + } + return ts.getDirectoryPath(ts.normalizeSlashes(this.getProjectName())); + }; + ExternalProject.prototype.getTypeAcquisition = function () { + return this.typeAcquisition; + }; + ExternalProject.prototype.setProjectErrors = function (projectErrors) { + this.projectErrors = projectErrors; + }; + ExternalProject.prototype.setTypeAcquisition = function (newTypeAcquisition) { + if (!newTypeAcquisition) { + newTypeAcquisition = { + enable: allRootFilesAreJsOrDts(this), + include: [], + exclude: [] + }; + } + else { + if (newTypeAcquisition.enable === undefined) { + newTypeAcquisition.enable = allRootFilesAreJsOrDts(this); + } + if (!newTypeAcquisition.include) { + newTypeAcquisition.include = []; + } + if (!newTypeAcquisition.exclude) { + newTypeAcquisition.exclude = []; + } + } + this.typeAcquisition = newTypeAcquisition; + }; + return ExternalProject; + }(Project)); + server.ExternalProject = ExternalProject; + })(server = ts.server || (ts.server = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var server; + (function (server) { + server.maxProgramSizeForNonTsFiles = 20 * 1024 * 1024; + server.ContextEvent = "context"; + server.ConfigFileDiagEvent = "configFileDiag"; + server.ProjectLanguageServiceStateEvent = "projectLanguageServiceState"; + function prepareConvertersForEnumLikeCompilerOptions(commandLineOptions) { + var map = ts.createMap(); + for (var _i = 0, commandLineOptions_1 = commandLineOptions; _i < commandLineOptions_1.length; _i++) { + var option = commandLineOptions_1[_i]; + if (typeof option.type === "object") { + var optionMap = option.type; + optionMap.forEach(function (value) { + ts.Debug.assert(typeof value === "number"); + }); + map.set(option.name, optionMap); + } + } + return map; + } + var compilerOptionConverters = prepareConvertersForEnumLikeCompilerOptions(ts.optionDeclarations); + var indentStyle = ts.createMapFromTemplate({ + "none": ts.IndentStyle.None, + "block": ts.IndentStyle.Block, + "smart": ts.IndentStyle.Smart + }); + var defaultTypeSafeList = { + "jquery": { + "match": /jquery(-(\.?\d+)+)?(\.intellisense)?(\.min)?\.js$/i, + "types": ["jquery"] + }, + "WinJS": { + "match": /^(.*\/winjs-[.\d]+)\/js\/base\.js$/i, + "exclude": [["^", 1, "/.*"]], + "types": ["winjs"] + }, + "Kendo": { + "match": /^(.*\/kendo)\/kendo\.all\.min\.js$/i, + "exclude": [["^", 1, "/.*"]], + "types": ["kendo-ui"] + }, + "Office Nuget": { + "match": /^(.*\/office\/1)\/excel-\d+\.debug\.js$/i, + "exclude": [["^", 1, "/.*"]], + "types": ["office"] + }, + "Minified files": { + "match": /^(.+\.min\.js)$/i, + "exclude": [["^", 1, "$"]] + } + }; + function convertFormatOptions(protocolOptions) { + if (typeof protocolOptions.indentStyle === "string") { + protocolOptions.indentStyle = indentStyle.get(protocolOptions.indentStyle.toLowerCase()); + ts.Debug.assert(protocolOptions.indentStyle !== undefined); + } + return protocolOptions; + } + server.convertFormatOptions = convertFormatOptions; + function convertCompilerOptions(protocolOptions) { + compilerOptionConverters.forEach(function (mappedValues, id) { + var propertyValue = protocolOptions[id]; + if (typeof propertyValue === "string") { + protocolOptions[id] = mappedValues.get(propertyValue.toLowerCase()); + } + }); + return protocolOptions; + } + server.convertCompilerOptions = convertCompilerOptions; + function tryConvertScriptKindName(scriptKindName) { + return typeof scriptKindName === "string" + ? convertScriptKindName(scriptKindName) + : scriptKindName; + } + server.tryConvertScriptKindName = tryConvertScriptKindName; + function convertScriptKindName(scriptKindName) { + switch (scriptKindName) { + case "JS": + return 1; + case "JSX": + return 2; + case "TS": + return 3; + case "TSX": + return 4; + default: + return 0; + } + } + server.convertScriptKindName = convertScriptKindName; + function combineProjectOutput(projects, action, comparer, areEqual) { + var result = projects.reduce(function (previous, current) { return ts.concatenate(previous, action(current)); }, []).sort(comparer); + return projects.length > 1 ? ts.deduplicate(result, areEqual) : result; + } + server.combineProjectOutput = combineProjectOutput; + var fileNamePropertyReader = { + getFileName: function (x) { return x; }, + getScriptKind: function (_) { return undefined; }, + hasMixedContent: function (fileName, extraFileExtensions) { + var mixedContentExtensions = ts.map(ts.filter(extraFileExtensions, function (item) { return item.isMixedContent; }), function (item) { return item.extension; }); + return ts.forEach(mixedContentExtensions, function (extension) { return ts.fileExtensionIs(fileName, extension); }); + } + }; + var externalFilePropertyReader = { + getFileName: function (x) { return x.fileName; }, + getScriptKind: function (x) { return tryConvertScriptKindName(x.scriptKind); }, + hasMixedContent: function (x) { return x.hasMixedContent; } + }; + function findProjectByName(projectName, projects) { + for (var _i = 0, projects_1 = projects; _i < projects_1.length; _i++) { + var proj = projects_1[_i]; + if (proj.getProjectName() === projectName) { + return proj; + } + } + } + function createFileNotFoundDiagnostic(fileName) { + return ts.createCompilerDiagnostic(ts.Diagnostics.File_0_not_found, fileName); + } + function isRootFileInInferredProject(info) { + if (info.containingProjects.length === 0) { + return false; + } + return info.containingProjects[0].projectKind === server.ProjectKind.Inferred && info.containingProjects[0].isRoot(info); + } + var DirectoryWatchers = (function () { + function DirectoryWatchers(projectService) { + this.projectService = projectService; + this.directoryWatchersForTsconfig = ts.createMap(); + this.directoryWatchersRefCount = ts.createMap(); + } + DirectoryWatchers.prototype.stopWatchingDirectory = function (directory) { + var refCount = this.directoryWatchersRefCount.get(directory) - 1; + this.directoryWatchersRefCount.set(directory, refCount); + if (refCount === 0) { + this.projectService.logger.info("Close directory watcher for: " + directory); + this.directoryWatchersForTsconfig.get(directory).close(); + this.directoryWatchersForTsconfig.delete(directory); + } + }; + DirectoryWatchers.prototype.startWatchingContainingDirectoriesForFile = function (fileName, project, callback) { + var currentPath = ts.getDirectoryPath(fileName); + var parentPath = ts.getDirectoryPath(currentPath); + while (currentPath !== parentPath) { + if (!this.directoryWatchersForTsconfig.has(currentPath)) { + this.projectService.logger.info("Add watcher for: " + currentPath); + this.directoryWatchersForTsconfig.set(currentPath, this.projectService.host.watchDirectory(currentPath, callback)); + this.directoryWatchersRefCount.set(currentPath, 1); + } + else { + this.directoryWatchersRefCount.set(currentPath, this.directoryWatchersRefCount.get(currentPath) + 1); + } + project.directoriesWatchedForTsconfig.push(currentPath); + currentPath = parentPath; + parentPath = ts.getDirectoryPath(parentPath); + } + }; + return DirectoryWatchers; + }()); + var ProjectService = (function () { + function ProjectService(opts) { + this.filenameToScriptInfo = ts.createFileMap(); + this.externalProjectToConfiguredProjectMap = ts.createMap(); + this.externalProjects = []; + this.inferredProjects = []; + this.configuredProjects = []; + this.openFiles = []; + this.projectToSizeMap = ts.createMap(); + this.host = opts.host; + this.logger = opts.logger; + this.cancellationToken = opts.cancellationToken; + this.useSingleInferredProject = opts.useSingleInferredProject; + this.typingsInstaller = opts.typingsInstaller || server.nullTypingsInstaller; + this.throttleWaitMilliseconds = opts.throttleWaitMilliseconds; + this.eventHandler = opts.eventHandler; + this.globalPlugins = opts.globalPlugins || server.emptyArray; + this.pluginProbeLocations = opts.pluginProbeLocations || server.emptyArray; + ts.Debug.assert(!!this.host.createHash, "'ServerHost.createHash' is required for ProjectService"); + this.toCanonicalFileName = ts.createGetCanonicalFileName(this.host.useCaseSensitiveFileNames); + this.directoryWatchers = new DirectoryWatchers(this); + this.throttledOperations = new server.ThrottledOperations(this.host); + this.typingsInstaller.attach(this); + this.typingsCache = new server.TypingsCache(this.typingsInstaller); + this.hostConfiguration = { + formatCodeOptions: server.getDefaultFormatCodeSettings(this.host), + hostInfo: "Unknown host", + extraFileExtensions: [] + }; + this.documentRegistry = ts.createDocumentRegistry(this.host.useCaseSensitiveFileNames, this.host.getCurrentDirectory()); + } + ProjectService.prototype.getChangedFiles_TestOnly = function () { + return this.changedFiles; + }; + ProjectService.prototype.ensureInferredProjectsUpToDate_TestOnly = function () { + this.ensureInferredProjectsUpToDate(); + }; + ProjectService.prototype.getCompilerOptionsForInferredProjects = function () { + return this.compilerOptionsForInferredProjects; + }; + ProjectService.prototype.onUpdateLanguageServiceStateForProject = function (project, languageServiceEnabled) { + if (!this.eventHandler) { + return; + } + this.eventHandler({ + eventName: server.ProjectLanguageServiceStateEvent, + data: { project: project, languageServiceEnabled: languageServiceEnabled } + }); + }; + ProjectService.prototype.updateTypingsForProject = function (response) { + var project = this.findProject(response.projectName); + if (!project) { + return; + } + switch (response.kind) { + case server.ActionSet: + this.typingsCache.updateTypingsForProject(response.projectName, response.compilerOptions, response.typeAcquisition, response.unresolvedImports, response.typings); + break; + case server.ActionInvalidate: + this.typingsCache.deleteTypingsForProject(response.projectName); + break; + } + project.updateGraph(); + }; + ProjectService.prototype.setCompilerOptionsForInferredProjects = function (projectCompilerOptions) { + this.compilerOptionsForInferredProjects = convertCompilerOptions(projectCompilerOptions); + this.compilerOptionsForInferredProjects.allowNonTsExtensions = true; + this.compileOnSaveForInferredProjects = projectCompilerOptions.compileOnSave; + for (var _i = 0, _a = this.inferredProjects; _i < _a.length; _i++) { + var proj = _a[_i]; + proj.setCompilerOptions(this.compilerOptionsForInferredProjects); + proj.compileOnSaveEnabled = projectCompilerOptions.compileOnSave; + } + this.updateProjectGraphs(this.inferredProjects); + }; + ProjectService.prototype.stopWatchingDirectory = function (directory) { + this.directoryWatchers.stopWatchingDirectory(directory); + }; + ProjectService.prototype.findProject = function (projectName) { + if (projectName === undefined) { + return undefined; + } + if (server.isInferredProjectName(projectName)) { + this.ensureInferredProjectsUpToDate(); + return findProjectByName(projectName, this.inferredProjects); + } + return this.findExternalProjectByProjectName(projectName) || this.findConfiguredProjectByProjectName(server.toNormalizedPath(projectName)); + }; + ProjectService.prototype.getDefaultProjectForFile = function (fileName, refreshInferredProjects) { + if (refreshInferredProjects) { + this.ensureInferredProjectsUpToDate(); + } + var scriptInfo = this.getScriptInfoForNormalizedPath(fileName); + return scriptInfo && scriptInfo.getDefaultProject(); + }; + ProjectService.prototype.ensureInferredProjectsUpToDate = function () { + if (this.changedFiles) { + var projectsToUpdate = void 0; + if (this.changedFiles.length === 1) { + projectsToUpdate = this.changedFiles[0].containingProjects; + } + else { + projectsToUpdate = []; + for (var _i = 0, _a = this.changedFiles; _i < _a.length; _i++) { + var f = _a[_i]; + projectsToUpdate = projectsToUpdate.concat(f.containingProjects); + } + } + this.updateProjectGraphs(projectsToUpdate); + this.changedFiles = undefined; + } + }; + ProjectService.prototype.findContainingExternalProject = function (fileName) { + for (var _i = 0, _a = this.externalProjects; _i < _a.length; _i++) { + var proj = _a[_i]; + if (proj.containsFile(fileName)) { + return proj; + } + } + return undefined; + }; + ProjectService.prototype.getFormatCodeOptions = function (file) { + var formatCodeSettings; + if (file) { + var info = this.getScriptInfoForNormalizedPath(file); + if (info) { + formatCodeSettings = info.getFormatCodeSettings(); + } + } + return formatCodeSettings || this.hostConfiguration.formatCodeOptions; + }; + ProjectService.prototype.updateProjectGraphs = function (projects) { + var shouldRefreshInferredProjects = false; + for (var _i = 0, projects_2 = projects; _i < projects_2.length; _i++) { + var p = projects_2[_i]; + if (!p.updateGraph()) { + shouldRefreshInferredProjects = true; + } + } + if (shouldRefreshInferredProjects) { + this.refreshInferredProjects(); + } + }; + ProjectService.prototype.onSourceFileChanged = function (fileName) { + var info = this.getScriptInfoForNormalizedPath(fileName); + if (!info) { + this.logger.info("Error: got watch notification for unknown file: " + fileName); + return; + } + if (!this.host.fileExists(fileName)) { + this.handleDeletedFile(info); + } + else { + if (info && (!info.isScriptOpen())) { + info.reloadFromFile(); + this.updateProjectGraphs(info.containingProjects); + } + } + }; + ProjectService.prototype.handleDeletedFile = function (info) { + this.logger.info(info.fileName + " deleted"); + info.stopWatcher(); + if (!info.isScriptOpen()) { + this.filenameToScriptInfo.remove(info.path); + this.lastDeletedFile = info; + var containingProjects = info.containingProjects.slice(); + info.detachAllProjects(); + this.updateProjectGraphs(containingProjects); + this.lastDeletedFile = undefined; + if (!this.eventHandler) { + return; + } + for (var _i = 0, _a = this.openFiles; _i < _a.length; _i++) { + var openFile = _a[_i]; + this.eventHandler({ + eventName: server.ContextEvent, + data: { project: openFile.getDefaultProject(), fileName: openFile.fileName } + }); + } + } + this.printProjects(); + }; + ProjectService.prototype.onTypeRootFileChanged = function (project, fileName) { + var _this = this; + this.logger.info("Type root file " + fileName + " changed"); + this.throttledOperations.schedule(project.getConfigFilePath() + " * type root", 250, function () { + project.updateTypes(); + _this.updateConfiguredProject(project); + _this.refreshInferredProjects(); + }); + }; + ProjectService.prototype.onSourceFileInDirectoryChangedForConfiguredProject = function (project, fileName) { + var _this = this; + if (fileName && !ts.isSupportedSourceFileName(fileName, project.getCompilerOptions(), this.hostConfiguration.extraFileExtensions)) { + return; + } + this.logger.info("Detected source file changes: " + fileName); + this.throttledOperations.schedule(project.getConfigFilePath(), 250, function () { return _this.handleChangeInSourceFileForConfiguredProject(project, fileName); }); + }; + ProjectService.prototype.handleChangeInSourceFileForConfiguredProject = function (project, triggerFile) { + var _this = this; + var _a = this.convertConfigFileContentToProjectOptions(project.getConfigFilePath()), projectOptions = _a.projectOptions, configFileErrors = _a.configFileErrors; + this.reportConfigFileDiagnostics(project.getProjectName(), configFileErrors, triggerFile); + var newRootFiles = projectOptions.files.map((function (f) { return _this.getCanonicalFileName(f); })); + var currentRootFiles = project.getRootFiles().map((function (f) { return _this.getCanonicalFileName(f); })); + if (!ts.arrayIsEqualTo(currentRootFiles.sort(), newRootFiles.sort())) { + this.logger.info("Updating configured project"); + this.updateConfiguredProject(project); + this.refreshInferredProjects(); + } + }; + ProjectService.prototype.onConfigChangedForConfiguredProject = function (project) { + var configFileName = project.getConfigFilePath(); + this.logger.info("Config file changed: " + configFileName); + var configFileErrors = this.updateConfiguredProject(project); + this.reportConfigFileDiagnostics(configFileName, configFileErrors, configFileName); + this.refreshInferredProjects(); + }; + ProjectService.prototype.onConfigFileAddedForInferredProject = function (fileName) { + if (ts.getBaseFileName(fileName) !== "tsconfig.json") { + this.logger.info(fileName + " is not tsconfig.json"); + return; + } + var configFileErrors = this.convertConfigFileContentToProjectOptions(fileName).configFileErrors; + this.reportConfigFileDiagnostics(fileName, configFileErrors, fileName); + this.logger.info("Detected newly added tsconfig file: " + fileName); + this.reloadProjects(); + }; + ProjectService.prototype.getCanonicalFileName = function (fileName) { + var name = this.host.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(); + return ts.normalizePath(name); + }; + ProjectService.prototype.removeProject = function (project) { + this.logger.info("remove project: " + project.getRootFiles().toString()); + project.close(); + switch (project.projectKind) { + case server.ProjectKind.External: + server.removeItemFromSet(this.externalProjects, project); + this.projectToSizeMap.delete(project.externalProjectName); + break; + case server.ProjectKind.Configured: + server.removeItemFromSet(this.configuredProjects, project); + this.projectToSizeMap.delete(project.canonicalConfigFilePath); + break; + case server.ProjectKind.Inferred: + server.removeItemFromSet(this.inferredProjects, project); + break; + } + }; + ProjectService.prototype.assignScriptInfoToInferredProjectIfNecessary = function (info, addToListOfOpenFiles) { + var externalProject = this.findContainingExternalProject(info.fileName); + if (externalProject) { + if (addToListOfOpenFiles) { + this.openFiles.push(info); + } + return; + } + var foundConfiguredProject = false; + for (var _i = 0, _a = info.containingProjects; _i < _a.length; _i++) { + var p = _a[_i]; + if (p.projectKind === server.ProjectKind.Configured) { + foundConfiguredProject = true; + if (addToListOfOpenFiles) { + (p).addOpenRef(); + } + } + } + if (foundConfiguredProject) { + if (addToListOfOpenFiles) { + this.openFiles.push(info); + } + return; + } + if (info.containingProjects.length === 0) { + var inferredProject = this.createInferredProjectWithRootFileIfNecessary(info); + if (!this.useSingleInferredProject) { + for (var _b = 0, _c = this.openFiles; _b < _c.length; _b++) { + var f = _c[_b]; + if (f.containingProjects.length === 0 || !inferredProject.containsScriptInfo(f)) { + continue; + } + for (var _d = 0, _e = f.containingProjects; _d < _e.length; _d++) { + var fContainingProject = _e[_d]; + if (fContainingProject.projectKind === server.ProjectKind.Inferred && + fContainingProject.isRoot(f) && + fContainingProject !== inferredProject) { + this.removeProject(fContainingProject); + f.attachToProject(inferredProject); + } + } + } + } + } + if (addToListOfOpenFiles) { + this.openFiles.push(info); + } + }; + ProjectService.prototype.closeOpenFile = function (info) { + info.close(); + server.removeItemFromSet(this.openFiles, info); + var projectsToRemove; + for (var _i = 0, _a = info.containingProjects; _i < _a.length; _i++) { + var p = _a[_i]; + if (p.projectKind === server.ProjectKind.Configured) { + if (info.hasMixedContent) { + info.registerFileUpdate(); + } + if (p.deleteOpenRef() === 0) { + (projectsToRemove || (projectsToRemove = [])).push(p); + } + } + else if (p.projectKind === server.ProjectKind.Inferred && p.isRoot(info)) { + (projectsToRemove || (projectsToRemove = [])).push(p); + } + if (!p.languageServiceEnabled) { + p.markAsDirty(); + } + } + if (projectsToRemove) { + for (var _b = 0, projectsToRemove_1 = projectsToRemove; _b < projectsToRemove_1.length; _b++) { + var project = projectsToRemove_1[_b]; + this.removeProject(project); + } + var orphanFiles = void 0; + for (var _c = 0, _d = this.openFiles; _c < _d.length; _c++) { + var f = _d[_c]; + if (f.containingProjects.length === 0) { + (orphanFiles || (orphanFiles = [])).push(f); + } + } + if (orphanFiles) { + for (var _e = 0, orphanFiles_1 = orphanFiles; _e < orphanFiles_1.length; _e++) { + var f = orphanFiles_1[_e]; + this.assignScriptInfoToInferredProjectIfNecessary(f, false); + } + } + } + if (info.containingProjects.length === 0) { + this.filenameToScriptInfo.remove(info.path); + } + }; + ProjectService.prototype.openOrUpdateConfiguredProjectForFile = function (fileName) { + var searchPath = ts.getDirectoryPath(fileName); + this.logger.info("Search path: " + searchPath); + var configFileName = this.findConfigFile(server.asNormalizedPath(searchPath)); + if (!configFileName) { + this.logger.info("No config files found."); + return {}; + } + this.logger.info("Config file name: " + configFileName); + var project = this.findConfiguredProjectByProjectName(configFileName); + if (!project) { + var _a = this.openConfigFile(configFileName, fileName), success = _a.success, errors = _a.errors; + if (!success) { + return { configFileName: configFileName, configFileErrors: errors }; + } + this.logger.info("Opened configuration file " + configFileName); + if (errors && errors.length > 0) { + return { configFileName: configFileName, configFileErrors: errors }; + } + } + else { + this.updateConfiguredProject(project); + } + return { configFileName: configFileName }; + }; + ProjectService.prototype.findConfigFile = function (searchPath) { + while (true) { + var tsconfigFileName = server.asNormalizedPath(ts.combinePaths(searchPath, "tsconfig.json")); + if (this.host.fileExists(tsconfigFileName)) { + return tsconfigFileName; + } + var jsconfigFileName = server.asNormalizedPath(ts.combinePaths(searchPath, "jsconfig.json")); + if (this.host.fileExists(jsconfigFileName)) { + return jsconfigFileName; + } + var parentPath = server.asNormalizedPath(ts.getDirectoryPath(searchPath)); + if (parentPath === searchPath) { + break; + } + searchPath = parentPath; + } + return undefined; + }; + ProjectService.prototype.printProjects = function () { + if (!this.logger.hasLevel(server.LogLevel.verbose)) { + return; + } + this.logger.startGroup(); + var counter = 0; + counter = printProjects(this.logger, this.externalProjects, counter); + counter = printProjects(this.logger, this.configuredProjects, counter); + counter = printProjects(this.logger, this.inferredProjects, counter); + this.logger.info("Open files: "); + for (var _i = 0, _a = this.openFiles; _i < _a.length; _i++) { + var rootFile = _a[_i]; + this.logger.info(rootFile.fileName); + } + this.logger.endGroup(); + function printProjects(logger, projects, counter) { + for (var _i = 0, projects_3 = projects; _i < projects_3.length; _i++) { + var project = projects_3[_i]; + project.updateGraph(); + logger.info("Project '" + project.getProjectName() + "' (" + server.ProjectKind[project.projectKind] + ") " + counter); + logger.info(project.filesToString()); + logger.info("-----------------------------------------------"); + counter++; + } + return counter; + } + }; + ProjectService.prototype.findConfiguredProjectByProjectName = function (configFileName) { + configFileName = server.asNormalizedPath(this.toCanonicalFileName(configFileName)); + for (var _i = 0, _a = this.configuredProjects; _i < _a.length; _i++) { + var proj = _a[_i]; + if (proj.canonicalConfigFilePath === configFileName) { + return proj; + } + } + }; + ProjectService.prototype.findExternalProjectByProjectName = function (projectFileName) { + return findProjectByName(projectFileName, this.externalProjects); + }; + ProjectService.prototype.convertConfigFileContentToProjectOptions = function (configFilename) { + configFilename = ts.normalizePath(configFilename); + var configFileContent = this.host.readFile(configFilename); + var errors; + var result = ts.parseConfigFileTextToJson(configFilename, configFileContent); + var config = result.config; + if (result.error) { + var _a = ts.sanitizeConfigFile(configFilename, configFileContent), sanitizedConfig = _a.configJsonObject, diagnostics = _a.diagnostics; + config = sanitizedConfig; + errors = diagnostics.length ? diagnostics : [result.error]; + } + var parsedCommandLine = ts.parseJsonConfigFileContent(config, this.host, ts.getDirectoryPath(configFilename), {}, configFilename, [], this.hostConfiguration.extraFileExtensions); + if (parsedCommandLine.errors.length) { + errors = ts.concatenate(errors, parsedCommandLine.errors); + } + ts.Debug.assert(!!parsedCommandLine.fileNames); + if (parsedCommandLine.fileNames.length === 0) { + (errors || (errors = [])).push(ts.createCompilerDiagnostic(ts.Diagnostics.The_config_file_0_found_doesn_t_contain_any_source_files, configFilename)); + return { success: false, configFileErrors: errors }; + } + var projectOptions = { + files: parsedCommandLine.fileNames, + compilerOptions: parsedCommandLine.options, + configHasFilesProperty: config["files"] !== undefined, + wildcardDirectories: ts.createMapFromTemplate(parsedCommandLine.wildcardDirectories), + typeAcquisition: parsedCommandLine.typeAcquisition, + compileOnSave: parsedCommandLine.compileOnSave + }; + return { success: true, projectOptions: projectOptions, configFileErrors: errors }; + }; + ProjectService.prototype.exceededTotalSizeLimitForNonTsFiles = function (name, options, fileNames, propertyReader) { + if (options && options.disableSizeLimit || !this.host.getFileSize) { + return false; + } + var availableSpace = server.maxProgramSizeForNonTsFiles; + this.projectToSizeMap.set(name, 0); + this.projectToSizeMap.forEach(function (val) { return (availableSpace -= (val || 0)); }); + var totalNonTsFileSize = 0; + for (var _i = 0, fileNames_3 = fileNames; _i < fileNames_3.length; _i++) { + var f = fileNames_3[_i]; + var fileName = propertyReader.getFileName(f); + if (ts.hasTypeScriptFileExtension(fileName)) { + continue; + } + totalNonTsFileSize += this.host.getFileSize(fileName); + if (totalNonTsFileSize > server.maxProgramSizeForNonTsFiles) { + return true; + } + } + if (totalNonTsFileSize > availableSpace) { + return true; + } + this.projectToSizeMap.set(name, totalNonTsFileSize); + return false; + }; + ProjectService.prototype.createAndAddExternalProject = function (projectFileName, files, options, typeAcquisition) { + var compilerOptions = convertCompilerOptions(options); + var project = new server.ExternalProject(projectFileName, this, this.documentRegistry, compilerOptions, !this.exceededTotalSizeLimitForNonTsFiles(projectFileName, compilerOptions, files, externalFilePropertyReader), options.compileOnSave === undefined ? true : options.compileOnSave); + this.addFilesToProjectAndUpdateGraph(project, files, externalFilePropertyReader, undefined, typeAcquisition, undefined); + this.externalProjects.push(project); + return project; + }; + ProjectService.prototype.reportConfigFileDiagnostics = function (configFileName, diagnostics, triggerFile) { + if (!this.eventHandler) { + return; + } + this.eventHandler({ + eventName: server.ConfigFileDiagEvent, + data: { configFileName: configFileName, diagnostics: diagnostics || [], triggerFile: triggerFile } + }); + }; + ProjectService.prototype.createAndAddConfiguredProject = function (configFileName, projectOptions, configFileErrors, clientFileName) { + var _this = this; + var sizeLimitExceeded = this.exceededTotalSizeLimitForNonTsFiles(configFileName, projectOptions.compilerOptions, projectOptions.files, fileNamePropertyReader); + var project = new server.ConfiguredProject(configFileName, this, this.documentRegistry, projectOptions.configHasFilesProperty, projectOptions.compilerOptions, projectOptions.wildcardDirectories, !sizeLimitExceeded, projectOptions.compileOnSave === undefined ? false : projectOptions.compileOnSave); + this.addFilesToProjectAndUpdateGraph(project, projectOptions.files, fileNamePropertyReader, clientFileName, projectOptions.typeAcquisition, configFileErrors); + project.watchConfigFile(function (project) { return _this.onConfigChangedForConfiguredProject(project); }); + if (!sizeLimitExceeded) { + this.watchConfigDirectoryForProject(project, projectOptions); + } + project.watchWildcards(function (project, path) { return _this.onSourceFileInDirectoryChangedForConfiguredProject(project, path); }); + project.watchTypeRoots(function (project, path) { return _this.onTypeRootFileChanged(project, path); }); + this.configuredProjects.push(project); + return project; + }; + ProjectService.prototype.watchConfigDirectoryForProject = function (project, options) { + var _this = this; + if (!options.configHasFilesProperty) { + project.watchConfigDirectory(function (project, path) { return _this.onSourceFileInDirectoryChangedForConfiguredProject(project, path); }); + } + }; + ProjectService.prototype.addFilesToProjectAndUpdateGraph = function (project, files, propertyReader, clientFileName, typeAcquisition, configFileErrors) { + var errors; + for (var _i = 0, files_4 = files; _i < files_4.length; _i++) { + var f = files_4[_i]; + var rootFilename = propertyReader.getFileName(f); + var scriptKind = propertyReader.getScriptKind(f); + var hasMixedContent = propertyReader.hasMixedContent(f, this.hostConfiguration.extraFileExtensions); + if (this.host.fileExists(rootFilename)) { + var info = this.getOrCreateScriptInfoForNormalizedPath(server.toNormalizedPath(rootFilename), clientFileName === rootFilename, undefined, scriptKind, hasMixedContent); + project.addRoot(info); + } + else { + (errors || (errors = [])).push(createFileNotFoundDiagnostic(rootFilename)); + } + } + project.setProjectErrors(ts.concatenate(configFileErrors, errors)); + project.setTypeAcquisition(typeAcquisition); + project.updateGraph(); + }; + ProjectService.prototype.openConfigFile = function (configFileName, clientFileName) { + var conversionResult = this.convertConfigFileContentToProjectOptions(configFileName); + var projectOptions = conversionResult.success + ? conversionResult.projectOptions + : { files: [], compilerOptions: {}, typeAcquisition: { enable: false } }; + var project = this.createAndAddConfiguredProject(configFileName, projectOptions, conversionResult.configFileErrors, clientFileName); + return { + success: conversionResult.success, + project: project, + errors: project.getProjectErrors() + }; + }; + ProjectService.prototype.updateNonInferredProject = function (project, newUncheckedFiles, propertyReader, newOptions, newTypeAcquisition, compileOnSave, configFileErrors) { + var oldRootScriptInfos = project.getRootScriptInfos(); + var newRootScriptInfos = []; + var newRootScriptInfoMap = server.createNormalizedPathMap(); + var projectErrors; + var rootFilesChanged = false; + for (var _i = 0, newUncheckedFiles_1 = newUncheckedFiles; _i < newUncheckedFiles_1.length; _i++) { + var f = newUncheckedFiles_1[_i]; + var newRootFile = propertyReader.getFileName(f); + if (!this.host.fileExists(newRootFile)) { + (projectErrors || (projectErrors = [])).push(createFileNotFoundDiagnostic(newRootFile)); + continue; + } + var normalizedPath = server.toNormalizedPath(newRootFile); + var scriptInfo = this.getScriptInfoForNormalizedPath(normalizedPath); + if (!scriptInfo || !project.isRoot(scriptInfo)) { + rootFilesChanged = true; + if (!scriptInfo) { + var scriptKind = propertyReader.getScriptKind(f); + var hasMixedContent = propertyReader.hasMixedContent(f, this.hostConfiguration.extraFileExtensions); + scriptInfo = this.getOrCreateScriptInfoForNormalizedPath(normalizedPath, false, undefined, scriptKind, hasMixedContent); + } + } + newRootScriptInfos.push(scriptInfo); + newRootScriptInfoMap.set(scriptInfo.fileName, scriptInfo); + } + if (rootFilesChanged || newRootScriptInfos.length !== oldRootScriptInfos.length) { + var toAdd = void 0; + var toRemove = void 0; + for (var _a = 0, oldRootScriptInfos_1 = oldRootScriptInfos; _a < oldRootScriptInfos_1.length; _a++) { + var oldFile = oldRootScriptInfos_1[_a]; + if (!newRootScriptInfoMap.contains(oldFile.fileName)) { + (toRemove || (toRemove = [])).push(oldFile); + } + } + for (var _b = 0, newRootScriptInfos_1 = newRootScriptInfos; _b < newRootScriptInfos_1.length; _b++) { + var newFile = newRootScriptInfos_1[_b]; + if (!project.isRoot(newFile)) { + (toAdd || (toAdd = [])).push(newFile); + } + } + if (toRemove) { + for (var _c = 0, toRemove_1 = toRemove; _c < toRemove_1.length; _c++) { + var f = toRemove_1[_c]; + project.removeFile(f); + } + } + if (toAdd) { + for (var _d = 0, toAdd_1 = toAdd; _d < toAdd_1.length; _d++) { + var f = toAdd_1[_d]; + if (f.isScriptOpen() && isRootFileInInferredProject(f)) { + var inferredProject = f.containingProjects[0]; + inferredProject.removeFile(f); + if (!inferredProject.hasRoots()) { + this.removeProject(inferredProject); + } + } + project.addRoot(f); + } + } + } + project.setCompilerOptions(newOptions); + project.setTypeAcquisition(newTypeAcquisition); + if (compileOnSave !== undefined) { + project.compileOnSaveEnabled = compileOnSave; + } + project.setProjectErrors(ts.concatenate(configFileErrors, projectErrors)); + project.updateGraph(); + }; + ProjectService.prototype.updateConfiguredProject = function (project) { + if (!this.host.fileExists(project.getConfigFilePath())) { + this.logger.info("Config file deleted"); + this.removeProject(project); + return; + } + var _a = this.convertConfigFileContentToProjectOptions(project.getConfigFilePath()), success = _a.success, projectOptions = _a.projectOptions, configFileErrors = _a.configFileErrors; + if (!success) { + this.updateNonInferredProject(project, [], fileNamePropertyReader, {}, {}, false, configFileErrors); + return configFileErrors; + } + if (this.exceededTotalSizeLimitForNonTsFiles(project.canonicalConfigFilePath, projectOptions.compilerOptions, projectOptions.files, fileNamePropertyReader)) { + project.setCompilerOptions(projectOptions.compilerOptions); + if (!project.languageServiceEnabled) { + return configFileErrors; + } + project.disableLanguageService(); + project.stopWatchingDirectory(); + } + else { + project.enableLanguageService(); + this.watchConfigDirectoryForProject(project, projectOptions); + this.updateNonInferredProject(project, projectOptions.files, fileNamePropertyReader, projectOptions.compilerOptions, projectOptions.typeAcquisition, projectOptions.compileOnSave, configFileErrors); + } + return configFileErrors; + }; + ProjectService.prototype.createInferredProjectWithRootFileIfNecessary = function (root) { + var _this = this; + var useExistingProject = this.useSingleInferredProject && this.inferredProjects.length; + var project = useExistingProject + ? this.inferredProjects[0] + : new server.InferredProject(this, this.documentRegistry, this.compilerOptionsForInferredProjects); + project.addRoot(root); + this.directoryWatchers.startWatchingContainingDirectoriesForFile(root.fileName, project, function (fileName) { return _this.onConfigFileAddedForInferredProject(fileName); }); + project.updateGraph(); + if (!useExistingProject) { + this.inferredProjects.push(project); + } + return project; + }; + ProjectService.prototype.getOrCreateScriptInfo = function (uncheckedFileName, openedByClient, fileContent, scriptKind) { + return this.getOrCreateScriptInfoForNormalizedPath(server.toNormalizedPath(uncheckedFileName), openedByClient, fileContent, scriptKind); + }; + ProjectService.prototype.getScriptInfo = function (uncheckedFileName) { + return this.getScriptInfoForNormalizedPath(server.toNormalizedPath(uncheckedFileName)); + }; + ProjectService.prototype.getOrCreateScriptInfoForNormalizedPath = function (fileName, openedByClient, fileContent, scriptKind, hasMixedContent) { + var _this = this; + var info = this.getScriptInfoForNormalizedPath(fileName); + if (!info) { + if (openedByClient || this.host.fileExists(fileName)) { + info = new server.ScriptInfo(this.host, fileName, scriptKind, hasMixedContent); + this.filenameToScriptInfo.set(info.path, info); + if (openedByClient) { + if (fileContent === undefined) { + fileContent = this.host.readFile(fileName) || ""; + } + } + else { + if (!hasMixedContent) { + info.setWatcher(this.host.watchFile(fileName, function (_) { return _this.onSourceFileChanged(fileName); })); + } + } + } + } + if (info) { + if (openedByClient && !info.isScriptOpen()) { + info.open(fileContent); + if (hasMixedContent) { + info.registerFileUpdate(); + } + } + else if (fileContent !== undefined) { + info.reload(fileContent); + } + } + return info; + }; + ProjectService.prototype.getScriptInfoForNormalizedPath = function (fileName) { + return this.getScriptInfoForPath(server.normalizedPathToPath(fileName, this.host.getCurrentDirectory(), this.toCanonicalFileName)); + }; + ProjectService.prototype.getScriptInfoForPath = function (fileName) { + return this.filenameToScriptInfo.get(fileName); + }; + ProjectService.prototype.setHostConfiguration = function (args) { + if (args.file) { + var info = this.getScriptInfoForNormalizedPath(server.toNormalizedPath(args.file)); + if (info) { + info.setFormatOptions(convertFormatOptions(args.formatOptions)); + this.logger.info("Host configuration update for file " + args.file); + } + } + else { + if (args.hostInfo !== undefined) { + this.hostConfiguration.hostInfo = args.hostInfo; + this.logger.info("Host information " + args.hostInfo); + } + if (args.formatOptions) { + server.mergeMapLikes(this.hostConfiguration.formatCodeOptions, convertFormatOptions(args.formatOptions)); + this.logger.info("Format host information updated"); + } + if (args.extraFileExtensions) { + this.hostConfiguration.extraFileExtensions = args.extraFileExtensions; + this.logger.info("Host file extension mappings updated"); + } + } + }; + ProjectService.prototype.closeLog = function () { + this.logger.close(); + }; + ProjectService.prototype.reloadProjects = function () { + this.logger.info("reload projects."); + for (var _i = 0, _a = this.openFiles; _i < _a.length; _i++) { + var info = _a[_i]; + this.openOrUpdateConfiguredProjectForFile(info.fileName); + } + this.refreshInferredProjects(); + }; + ProjectService.prototype.refreshInferredProjects = function () { + this.logger.info("updating project structure from ..."); + this.printProjects(); + var orphantedFiles = []; + for (var _i = 0, _a = this.openFiles; _i < _a.length; _i++) { + var info = _a[_i]; + if (info.containingProjects.length === 0) { + orphantedFiles.push(info); + } + else { + if (isRootFileInInferredProject(info) && info.containingProjects.length > 1) { + var inferredProject = info.containingProjects[0]; + ts.Debug.assert(inferredProject.projectKind === server.ProjectKind.Inferred); + inferredProject.removeFile(info); + if (!inferredProject.hasRoots()) { + this.removeProject(inferredProject); + } + } + } + } + for (var _b = 0, orphantedFiles_1 = orphantedFiles; _b < orphantedFiles_1.length; _b++) { + var f = orphantedFiles_1[_b]; + this.assignScriptInfoToInferredProjectIfNecessary(f, false); + } + for (var _c = 0, _d = this.inferredProjects; _c < _d.length; _c++) { + var p = _d[_c]; + p.updateGraph(); + } + this.printProjects(); + }; + ProjectService.prototype.openClientFile = function (fileName, fileContent, scriptKind) { + return this.openClientFileWithNormalizedPath(server.toNormalizedPath(fileName), fileContent, scriptKind); + }; + ProjectService.prototype.openClientFileWithNormalizedPath = function (fileName, fileContent, scriptKind, hasMixedContent) { + var configFileName; + var configFileErrors; + var project = this.findContainingExternalProject(fileName); + if (!project) { + (_a = this.openOrUpdateConfiguredProjectForFile(fileName), configFileName = _a.configFileName, configFileErrors = _a.configFileErrors); + if (configFileName) { + project = this.findConfiguredProjectByProjectName(configFileName); + } + } + if (project && !project.languageServiceEnabled) { + project.markAsDirty(); + } + var info = this.getOrCreateScriptInfoForNormalizedPath(fileName, true, fileContent, scriptKind, hasMixedContent); + this.assignScriptInfoToInferredProjectIfNecessary(info, true); + this.printProjects(); + return { configFileName: configFileName, configFileErrors: configFileErrors }; + var _a; + }; + ProjectService.prototype.closeClientFile = function (uncheckedFileName) { + var info = this.getScriptInfoForNormalizedPath(server.toNormalizedPath(uncheckedFileName)); + if (info) { + this.closeOpenFile(info); + } + this.printProjects(); + }; + ProjectService.prototype.collectChanges = function (lastKnownProjectVersions, currentProjects, result) { + var _loop_7 = function (proj) { + var knownProject = ts.forEach(lastKnownProjectVersions, function (p) { return p.projectName === proj.getProjectName() && p; }); + result.push(proj.getChangesSinceVersion(knownProject && knownProject.version)); + }; + for (var _i = 0, currentProjects_1 = currentProjects; _i < currentProjects_1.length; _i++) { + var proj = currentProjects_1[_i]; + _loop_7(proj); + } + }; + ProjectService.prototype.synchronizeProjectList = function (knownProjects) { + var files = []; + this.collectChanges(knownProjects, this.externalProjects, files); + this.collectChanges(knownProjects, this.configuredProjects, files); + this.collectChanges(knownProjects, this.inferredProjects, files); + return files; + }; + ProjectService.prototype.applyChangesInOpenFiles = function (openFiles, changedFiles, closedFiles) { + var recordChangedFiles = changedFiles && !openFiles && !closedFiles; + if (openFiles) { + for (var _i = 0, openFiles_1 = openFiles; _i < openFiles_1.length; _i++) { + var file = openFiles_1[_i]; + var scriptInfo = this.getScriptInfo(file.fileName); + ts.Debug.assert(!scriptInfo || !scriptInfo.isScriptOpen()); + var normalizedPath = scriptInfo ? scriptInfo.fileName : server.toNormalizedPath(file.fileName); + this.openClientFileWithNormalizedPath(normalizedPath, file.content, tryConvertScriptKindName(file.scriptKind), file.hasMixedContent); + } + } + if (changedFiles) { + for (var _a = 0, changedFiles_2 = changedFiles; _a < changedFiles_2.length; _a++) { + var file = changedFiles_2[_a]; + var scriptInfo = this.getScriptInfo(file.fileName); + ts.Debug.assert(!!scriptInfo); + for (var i = file.changes.length - 1; i >= 0; i--) { + var change = file.changes[i]; + scriptInfo.editContent(change.span.start, change.span.start + change.span.length, change.newText); + } + if (recordChangedFiles) { + if (!this.changedFiles) { + this.changedFiles = [scriptInfo]; + } + else if (this.changedFiles.indexOf(scriptInfo) < 0) { + this.changedFiles.push(scriptInfo); + } + } + } + } + if (closedFiles) { + for (var _b = 0, closedFiles_1 = closedFiles; _b < closedFiles_1.length; _b++) { + var file = closedFiles_1[_b]; + this.closeClientFile(file); + } + } + if (openFiles || closedFiles) { + this.refreshInferredProjects(); + } + }; + ProjectService.prototype.closeConfiguredProject = function (configFile) { + var configuredProject = this.findConfiguredProjectByProjectName(configFile); + if (configuredProject && configuredProject.deleteOpenRef() === 0) { + this.removeProject(configuredProject); + } + }; + ProjectService.prototype.closeExternalProject = function (uncheckedFileName, suppressRefresh) { + if (suppressRefresh === void 0) { suppressRefresh = false; } + var fileName = server.toNormalizedPath(uncheckedFileName); + var configFiles = this.externalProjectToConfiguredProjectMap.get(fileName); + if (configFiles) { + var shouldRefreshInferredProjects = false; + for (var _i = 0, configFiles_1 = configFiles; _i < configFiles_1.length; _i++) { + var configFile = configFiles_1[_i]; + if (this.closeConfiguredProject(configFile)) { + shouldRefreshInferredProjects = true; + } + } + this.externalProjectToConfiguredProjectMap.delete(fileName); + if (shouldRefreshInferredProjects && !suppressRefresh) { + this.refreshInferredProjects(); + } + } + else { + var externalProject = this.findExternalProjectByProjectName(uncheckedFileName); + if (externalProject) { + this.removeProject(externalProject); + if (!suppressRefresh) { + this.refreshInferredProjects(); + } + } + } + }; + ProjectService.prototype.openExternalProjects = function (projects) { + var _this = this; + var projectsToClose = ts.arrayToMap(this.externalProjects, function (p) { return p.getProjectName(); }, function (_) { return true; }); + ts.forEachKey(this.externalProjectToConfiguredProjectMap, function (externalProjectName) { + projectsToClose.set(externalProjectName, true); + }); + for (var _i = 0, projects_4 = projects; _i < projects_4.length; _i++) { + var externalProject = projects_4[_i]; + this.openExternalProject(externalProject, true); + projectsToClose.delete(externalProject.projectFileName); + } + ts.forEachKey(projectsToClose, function (externalProjectName) { + _this.closeExternalProject(externalProjectName, true); + }); + this.refreshInferredProjects(); + }; + ProjectService.escapeFilenameForRegex = function (filename) { + return filename.replace(this.filenameEscapeRegexp, "\\$&"); + }; + ProjectService.prototype.resetSafeList = function () { + ProjectService.safelist = defaultTypeSafeList; + }; + ProjectService.prototype.loadSafeList = function (fileName) { + var raw = JSON.parse(this.host.readFile(fileName, "utf-8")); + for (var _i = 0, _a = Object.keys(raw); _i < _a.length; _i++) { + var k = _a[_i]; + raw[k].match = new RegExp(raw[k].match, "i"); + } + ProjectService.safelist = raw; + }; + ProjectService.prototype.applySafeList = function (proj) { + var _this = this; + var rootFiles = proj.rootFiles, typeAcquisition = proj.typeAcquisition; + var types = (typeAcquisition && typeAcquisition.include) || []; + var excludeRules = []; + var normalizedNames = rootFiles.map(function (f) { return ts.normalizeSlashes(f.fileName); }); + var _loop_8 = function (name) { + var rule = ProjectService.safelist[name]; + for (var _i = 0, normalizedNames_1 = normalizedNames; _i < normalizedNames_1.length; _i++) { + var root = normalizedNames_1[_i]; + if (rule.match.test(root)) { + this_2.logger.info("Excluding files based on rule " + name); + if (rule.types) { + for (var _a = 0, _b = rule.types; _a < _b.length; _a++) { + var type = _b[_a]; + if (types.indexOf(type) < 0) { + types.push(type); + } + } + } + if (rule.exclude) { + var _loop_9 = function (exclude) { + var processedRule = root.replace(rule.match, function () { + var groups = []; + for (var _i = 0; _i < arguments.length; _i++) { + groups[_i] = arguments[_i]; + } + return exclude.map(function (groupNumberOrString) { + if (typeof groupNumberOrString === "number") { + if (typeof groups[groupNumberOrString] !== "string") { + _this.logger.info("Incorrect RegExp specification in safelist rule " + name + " - not enough groups"); + return "\\*"; + } + return ProjectService.escapeFilenameForRegex(groups[groupNumberOrString]); + } + return groupNumberOrString; + }).join(""); + }); + if (excludeRules.indexOf(processedRule) === -1) { + excludeRules.push(processedRule); + } + }; + for (var _c = 0, _d = rule.exclude; _c < _d.length; _c++) { + var exclude = _d[_c]; + _loop_9(exclude); + } + } + else { + var escaped = ProjectService.escapeFilenameForRegex(root); + if (excludeRules.indexOf(escaped) < 0) { + excludeRules.push(escaped); + } + } + } + } + if (types.length > 0) { + proj.typeAcquisition = proj.typeAcquisition || {}; + proj.typeAcquisition.include = types; + } + }; + var this_2 = this; + for (var _i = 0, _a = Object.keys(ProjectService.safelist); _i < _a.length; _i++) { + var name = _a[_i]; + _loop_8(name); + } + var excludeRegexes = excludeRules.map(function (e) { return new RegExp(e, "i"); }); + proj.rootFiles = proj.rootFiles.filter(function (_file, index) { return !excludeRegexes.some(function (re) { return re.test(normalizedNames[index]); }); }); + }; + ProjectService.prototype.openExternalProject = function (proj, suppressRefreshOfInferredProjects) { + if (suppressRefreshOfInferredProjects === void 0) { suppressRefreshOfInferredProjects = false; } + if (proj.typingOptions && !proj.typeAcquisition) { + var typeAcquisition = ts.convertEnableAutoDiscoveryToEnable(proj.typingOptions); + proj.typeAcquisition = typeAcquisition; + } + this.applySafeList(proj); + var tsConfigFiles; + var rootFiles = []; + for (var _i = 0, _a = proj.rootFiles; _i < _a.length; _i++) { + var file = _a[_i]; + var normalized = server.toNormalizedPath(file.fileName); + if (ts.getBaseFileName(normalized) === "tsconfig.json") { + if (this.host.fileExists(normalized)) { + (tsConfigFiles || (tsConfigFiles = [])).push(normalized); + } + } + else { + rootFiles.push(file); + } + } + if (tsConfigFiles) { + tsConfigFiles.sort(); + } + var externalProject = this.findExternalProjectByProjectName(proj.projectFileName); + var exisingConfigFiles; + if (externalProject) { + if (!tsConfigFiles) { + var compilerOptions = convertCompilerOptions(proj.options); + if (this.exceededTotalSizeLimitForNonTsFiles(proj.projectFileName, compilerOptions, proj.rootFiles, externalFilePropertyReader)) { + externalProject.disableLanguageService(); + } + else { + externalProject.enableLanguageService(); + } + this.updateNonInferredProject(externalProject, proj.rootFiles, externalFilePropertyReader, compilerOptions, proj.typeAcquisition, proj.options.compileOnSave, undefined); + return; + } + this.closeExternalProject(proj.projectFileName, true); + } + else if (this.externalProjectToConfiguredProjectMap.get(proj.projectFileName)) { + if (!tsConfigFiles) { + this.closeExternalProject(proj.projectFileName, true); + } + else { + var oldConfigFiles = this.externalProjectToConfiguredProjectMap.get(proj.projectFileName); + var iNew = 0; + var iOld = 0; + while (iNew < tsConfigFiles.length && iOld < oldConfigFiles.length) { + var newConfig = tsConfigFiles[iNew]; + var oldConfig = oldConfigFiles[iOld]; + if (oldConfig < newConfig) { + this.closeConfiguredProject(oldConfig); + iOld++; + } + else if (oldConfig > newConfig) { + iNew++; + } + else { + (exisingConfigFiles || (exisingConfigFiles = [])).push(oldConfig); + iOld++; + iNew++; + } + } + for (var i = iOld; i < oldConfigFiles.length; i++) { + this.closeConfiguredProject(oldConfigFiles[i]); + } + } + } + if (tsConfigFiles) { + this.externalProjectToConfiguredProjectMap.set(proj.projectFileName, tsConfigFiles); + for (var _b = 0, tsConfigFiles_1 = tsConfigFiles; _b < tsConfigFiles_1.length; _b++) { + var tsconfigFile = tsConfigFiles_1[_b]; + var project = this.findConfiguredProjectByProjectName(tsconfigFile); + if (!project) { + var result = this.openConfigFile(tsconfigFile); + project = result.success && result.project; + } + if (project && !ts.contains(exisingConfigFiles, tsconfigFile)) { + project.addOpenRef(); + } + } + } + else { + this.externalProjectToConfiguredProjectMap.delete(proj.projectFileName); + this.createAndAddExternalProject(proj.projectFileName, rootFiles, proj.options, proj.typeAcquisition); + } + if (!suppressRefreshOfInferredProjects) { + this.refreshInferredProjects(); + } + }; + return ProjectService; + }()); + ProjectService.safelist = defaultTypeSafeList; + ProjectService.filenameEscapeRegexp = /[-\/\\^$*+?.()|[\]{}]/g; + server.ProjectService = ProjectService; + })(server = ts.server || (ts.server = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var server; + (function (server) { + server.nullCancellationToken = { + isCancellationRequested: function () { return false; }, + setRequest: function () { return void 0; }, + resetRequest: function () { return void 0; } + }; + function hrTimeToMilliseconds(time) { + var seconds = time[0]; + var nanoseconds = time[1]; + return ((1e9 * seconds) + nanoseconds) / 1000000.0; + } + function shouldSkipSemanticCheck(project) { + if (project.projectKind === server.ProjectKind.Inferred || project.projectKind === server.ProjectKind.External) { + return project.isJsOnlyProject(); + } + else { + var options = project.getCompilerOptions(); + return options.skipLibCheck && !options.checkJs && project.isJsOnlyProject(); + } + } + function compareNumber(a, b) { + return a - b; + } + function compareFileStart(a, b) { + if (a.file < b.file) { + return -1; + } + else if (a.file === b.file) { + var n = compareNumber(a.start.line, b.start.line); + if (n === 0) { + return compareNumber(a.start.offset, b.start.offset); + } + else + return n; + } + else { + return 1; + } + } + function formatDiag(fileName, project, diag) { + var scriptInfo = project.getScriptInfoForNormalizedPath(fileName); + return { + start: scriptInfo.positionToLineOffset(diag.start), + end: scriptInfo.positionToLineOffset(diag.start + diag.length), + text: ts.flattenDiagnosticMessageText(diag.messageText, "\n"), + code: diag.code + }; + } + function formatConfigFileDiag(diag) { + return { + start: undefined, + end: undefined, + text: ts.flattenDiagnosticMessageText(diag.messageText, "\n") + }; + } + function allEditsBeforePos(edits, pos) { + for (var _i = 0, edits_1 = edits; _i < edits_1.length; _i++) { + var edit = edits_1[_i]; + if (ts.textSpanEnd(edit.span) >= pos) { + return false; + } + } + return true; + } + var CommandNames; + (function (CommandNames) { + CommandNames.Brace = "brace"; + CommandNames.BraceFull = "brace-full"; + CommandNames.BraceCompletion = "braceCompletion"; + CommandNames.Change = "change"; + CommandNames.Close = "close"; + CommandNames.Completions = "completions"; + CommandNames.CompletionsFull = "completions-full"; + CommandNames.CompletionDetails = "completionEntryDetails"; + CommandNames.CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList"; + CommandNames.CompileOnSaveEmitFile = "compileOnSaveEmitFile"; + CommandNames.Configure = "configure"; + CommandNames.Definition = "definition"; + CommandNames.DefinitionFull = "definition-full"; + CommandNames.Exit = "exit"; + CommandNames.Format = "format"; + CommandNames.Formatonkey = "formatonkey"; + CommandNames.FormatFull = "format-full"; + CommandNames.FormatonkeyFull = "formatonkey-full"; + CommandNames.FormatRangeFull = "formatRange-full"; + CommandNames.Geterr = "geterr"; + CommandNames.GeterrForProject = "geterrForProject"; + CommandNames.Implementation = "implementation"; + CommandNames.ImplementationFull = "implementation-full"; + CommandNames.SemanticDiagnosticsSync = "semanticDiagnosticsSync"; + CommandNames.SyntacticDiagnosticsSync = "syntacticDiagnosticsSync"; + CommandNames.NavBar = "navbar"; + CommandNames.NavBarFull = "navbar-full"; + CommandNames.NavTree = "navtree"; + CommandNames.NavTreeFull = "navtree-full"; + CommandNames.Navto = "navto"; + CommandNames.NavtoFull = "navto-full"; + CommandNames.Occurrences = "occurrences"; + CommandNames.DocumentHighlights = "documentHighlights"; + CommandNames.DocumentHighlightsFull = "documentHighlights-full"; + CommandNames.Open = "open"; + CommandNames.Quickinfo = "quickinfo"; + CommandNames.QuickinfoFull = "quickinfo-full"; + CommandNames.References = "references"; + CommandNames.ReferencesFull = "references-full"; + CommandNames.Reload = "reload"; + CommandNames.Rename = "rename"; + CommandNames.RenameInfoFull = "rename-full"; + CommandNames.RenameLocationsFull = "renameLocations-full"; + CommandNames.Saveto = "saveto"; + CommandNames.SignatureHelp = "signatureHelp"; + CommandNames.SignatureHelpFull = "signatureHelp-full"; + CommandNames.TypeDefinition = "typeDefinition"; + CommandNames.ProjectInfo = "projectInfo"; + CommandNames.ReloadProjects = "reloadProjects"; + CommandNames.Unknown = "unknown"; + CommandNames.OpenExternalProject = "openExternalProject"; + CommandNames.OpenExternalProjects = "openExternalProjects"; + CommandNames.CloseExternalProject = "closeExternalProject"; + CommandNames.SynchronizeProjectList = "synchronizeProjectList"; + CommandNames.ApplyChangedToOpenFiles = "applyChangedToOpenFiles"; + CommandNames.EncodedSemanticClassificationsFull = "encodedSemanticClassifications-full"; + CommandNames.Cleanup = "cleanup"; + CommandNames.OutliningSpans = "outliningSpans"; + CommandNames.TodoComments = "todoComments"; + CommandNames.Indentation = "indentation"; + CommandNames.DocCommentTemplate = "docCommentTemplate"; + CommandNames.CompilerOptionsDiagnosticsFull = "compilerOptionsDiagnostics-full"; + CommandNames.NameOrDottedNameSpan = "nameOrDottedNameSpan"; + CommandNames.BreakpointStatement = "breakpointStatement"; + CommandNames.CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects"; + CommandNames.GetCodeFixes = "getCodeFixes"; + CommandNames.GetCodeFixesFull = "getCodeFixes-full"; + CommandNames.GetSupportedCodeFixes = "getSupportedCodeFixes"; + })(CommandNames = server.CommandNames || (server.CommandNames = {})); + function formatMessage(msg, logger, byteLength, newLine) { + var verboseLogging = logger.hasLevel(server.LogLevel.verbose); + var json = JSON.stringify(msg); + if (verboseLogging) { + logger.info(msg.type + ": " + json); + } + var len = byteLength(json, "utf8"); + return "Content-Length: " + (1 + len) + "\r\n\r\n" + json + newLine; + } + server.formatMessage = formatMessage; + var MultistepOperation = (function () { + function MultistepOperation(operationHost) { + var _this = this; + this.operationHost = operationHost; + this.completed = true; + this.next = { + immediate: function (action) { return _this.immediate(action); }, + delay: function (ms, action) { return _this.delay(ms, action); } + }; + } + MultistepOperation.prototype.startNew = function (action) { + this.complete(); + this.requestId = this.operationHost.getCurrentRequestId(); + this.completed = false; + this.executeAction(action); + }; + MultistepOperation.prototype.complete = function () { + if (!this.completed) { + if (this.requestId) { + this.operationHost.sendRequestCompletedEvent(this.requestId); + } + this.completed = true; + } + this.setTimerHandle(undefined); + this.setImmediateId(undefined); + }; + MultistepOperation.prototype.immediate = function (action) { + var _this = this; + var requestId = this.requestId; + ts.Debug.assert(requestId === this.operationHost.getCurrentRequestId(), "immediate: incorrect request id"); + this.setImmediateId(this.operationHost.getServerHost().setImmediate(function () { + _this.immediateId = undefined; + _this.operationHost.executeWithRequestId(requestId, function () { return _this.executeAction(action); }); + })); + }; + MultistepOperation.prototype.delay = function (ms, action) { + var _this = this; + var requestId = this.requestId; + ts.Debug.assert(requestId === this.operationHost.getCurrentRequestId(), "delay: incorrect request id"); + this.setTimerHandle(this.operationHost.getServerHost().setTimeout(function () { + _this.timerHandle = undefined; + _this.operationHost.executeWithRequestId(requestId, function () { return _this.executeAction(action); }); + }, ms)); + }; + MultistepOperation.prototype.executeAction = function (action) { + var stop = false; + try { + if (this.operationHost.isCancellationRequested()) { + stop = true; + } + else { + action(this.next); + } + } + catch (e) { + stop = true; + if (!(e instanceof ts.OperationCanceledException)) { + this.operationHost.logError(e, "delayed processing of request " + this.requestId); + } + } + if (stop || !this.hasPendingWork()) { + this.complete(); + } + }; + MultistepOperation.prototype.setTimerHandle = function (timerHandle) { + if (this.timerHandle !== undefined) { + this.operationHost.getServerHost().clearTimeout(this.timerHandle); + } + this.timerHandle = timerHandle; + }; + MultistepOperation.prototype.setImmediateId = function (immediateId) { + if (this.immediateId !== undefined) { + this.operationHost.getServerHost().clearImmediate(this.immediateId); + } + this.immediateId = immediateId; + }; + MultistepOperation.prototype.hasPendingWork = function () { + return !!this.timerHandle || !!this.immediateId; + }; + return MultistepOperation; + }()); + var Session = (function () { + function Session(opts) { + var _this = this; + this.changeSeq = 0; + this.handlers = ts.createMapFromTemplate((_a = {}, + _a[CommandNames.OpenExternalProject] = function (request) { + _this.projectService.openExternalProject(request.arguments, false); + return _this.requiredResponse(true); + }, + _a[CommandNames.OpenExternalProjects] = function (request) { + _this.projectService.openExternalProjects(request.arguments.projects); + return _this.requiredResponse(true); + }, + _a[CommandNames.CloseExternalProject] = function (request) { + _this.projectService.closeExternalProject(request.arguments.projectFileName); + return _this.requiredResponse(true); + }, + _a[CommandNames.SynchronizeProjectList] = function (request) { + var result = _this.projectService.synchronizeProjectList(request.arguments.knownProjects); + if (!result.some(function (p) { return p.projectErrors && p.projectErrors.length !== 0; })) { + return _this.requiredResponse(result); + } + var converted = ts.map(result, function (p) { + if (!p.projectErrors || p.projectErrors.length === 0) { + return p; + } + return { + info: p.info, + changes: p.changes, + files: p.files, + projectErrors: _this.convertToDiagnosticsWithLinePosition(p.projectErrors, undefined) + }; + }); + return _this.requiredResponse(converted); + }, + _a[CommandNames.ApplyChangedToOpenFiles] = function (request) { + _this.projectService.applyChangesInOpenFiles(request.arguments.openFiles, request.arguments.changedFiles, request.arguments.closedFiles); + _this.changeSeq++; + return _this.requiredResponse(true); + }, + _a[CommandNames.Exit] = function () { + _this.exit(); + return _this.notRequired(); + }, + _a[CommandNames.Definition] = function (request) { + return _this.requiredResponse(_this.getDefinition(request.arguments, true)); + }, + _a[CommandNames.DefinitionFull] = function (request) { + return _this.requiredResponse(_this.getDefinition(request.arguments, false)); + }, + _a[CommandNames.TypeDefinition] = function (request) { + return _this.requiredResponse(_this.getTypeDefinition(request.arguments)); + }, + _a[CommandNames.Implementation] = function (request) { + return _this.requiredResponse(_this.getImplementation(request.arguments, true)); + }, + _a[CommandNames.ImplementationFull] = function (request) { + return _this.requiredResponse(_this.getImplementation(request.arguments, false)); + }, + _a[CommandNames.References] = function (request) { + return _this.requiredResponse(_this.getReferences(request.arguments, true)); + }, + _a[CommandNames.ReferencesFull] = function (request) { + return _this.requiredResponse(_this.getReferences(request.arguments, false)); + }, + _a[CommandNames.Rename] = function (request) { + return _this.requiredResponse(_this.getRenameLocations(request.arguments, true)); + }, + _a[CommandNames.RenameLocationsFull] = function (request) { + return _this.requiredResponse(_this.getRenameLocations(request.arguments, false)); + }, + _a[CommandNames.RenameInfoFull] = function (request) { + return _this.requiredResponse(_this.getRenameInfo(request.arguments)); + }, + _a[CommandNames.Open] = function (request) { + _this.openClientFile(server.toNormalizedPath(request.arguments.file), request.arguments.fileContent, server.convertScriptKindName(request.arguments.scriptKindName)); + return _this.notRequired(); + }, + _a[CommandNames.Quickinfo] = function (request) { + return _this.requiredResponse(_this.getQuickInfoWorker(request.arguments, true)); + }, + _a[CommandNames.QuickinfoFull] = function (request) { + return _this.requiredResponse(_this.getQuickInfoWorker(request.arguments, false)); + }, + _a[CommandNames.OutliningSpans] = function (request) { + return _this.requiredResponse(_this.getOutliningSpans(request.arguments)); + }, + _a[CommandNames.TodoComments] = function (request) { + return _this.requiredResponse(_this.getTodoComments(request.arguments)); + }, + _a[CommandNames.Indentation] = function (request) { + return _this.requiredResponse(_this.getIndentation(request.arguments)); + }, + _a[CommandNames.NameOrDottedNameSpan] = function (request) { + return _this.requiredResponse(_this.getNameOrDottedNameSpan(request.arguments)); + }, + _a[CommandNames.BreakpointStatement] = function (request) { + return _this.requiredResponse(_this.getBreakpointStatement(request.arguments)); + }, + _a[CommandNames.BraceCompletion] = function (request) { + return _this.requiredResponse(_this.isValidBraceCompletion(request.arguments)); + }, + _a[CommandNames.DocCommentTemplate] = function (request) { + return _this.requiredResponse(_this.getDocCommentTemplate(request.arguments)); + }, + _a[CommandNames.Format] = function (request) { + return _this.requiredResponse(_this.getFormattingEditsForRange(request.arguments)); + }, + _a[CommandNames.Formatonkey] = function (request) { + return _this.requiredResponse(_this.getFormattingEditsAfterKeystroke(request.arguments)); + }, + _a[CommandNames.FormatFull] = function (request) { + return _this.requiredResponse(_this.getFormattingEditsForDocumentFull(request.arguments)); + }, + _a[CommandNames.FormatonkeyFull] = function (request) { + return _this.requiredResponse(_this.getFormattingEditsAfterKeystrokeFull(request.arguments)); + }, + _a[CommandNames.FormatRangeFull] = function (request) { + return _this.requiredResponse(_this.getFormattingEditsForRangeFull(request.arguments)); + }, + _a[CommandNames.Completions] = function (request) { + return _this.requiredResponse(_this.getCompletions(request.arguments, true)); + }, + _a[CommandNames.CompletionsFull] = function (request) { + return _this.requiredResponse(_this.getCompletions(request.arguments, false)); + }, + _a[CommandNames.CompletionDetails] = function (request) { + return _this.requiredResponse(_this.getCompletionEntryDetails(request.arguments)); + }, + _a[CommandNames.CompileOnSaveAffectedFileList] = function (request) { + return _this.requiredResponse(_this.getCompileOnSaveAffectedFileList(request.arguments)); + }, + _a[CommandNames.CompileOnSaveEmitFile] = function (request) { + return _this.requiredResponse(_this.emitFile(request.arguments)); + }, + _a[CommandNames.SignatureHelp] = function (request) { + return _this.requiredResponse(_this.getSignatureHelpItems(request.arguments, true)); + }, + _a[CommandNames.SignatureHelpFull] = function (request) { + return _this.requiredResponse(_this.getSignatureHelpItems(request.arguments, false)); + }, + _a[CommandNames.CompilerOptionsDiagnosticsFull] = function (request) { + return _this.requiredResponse(_this.getCompilerOptionsDiagnostics(request.arguments)); + }, + _a[CommandNames.EncodedSemanticClassificationsFull] = function (request) { + return _this.requiredResponse(_this.getEncodedSemanticClassifications(request.arguments)); + }, + _a[CommandNames.Cleanup] = function () { + _this.cleanup(); + return _this.requiredResponse(true); + }, + _a[CommandNames.SemanticDiagnosticsSync] = function (request) { + return _this.requiredResponse(_this.getSemanticDiagnosticsSync(request.arguments)); + }, + _a[CommandNames.SyntacticDiagnosticsSync] = function (request) { + return _this.requiredResponse(_this.getSyntacticDiagnosticsSync(request.arguments)); + }, + _a[CommandNames.Geterr] = function (request) { + _this.errorCheck.startNew(function (next) { return _this.getDiagnostics(next, request.arguments.delay, request.arguments.files); }); + return _this.notRequired(); + }, + _a[CommandNames.GeterrForProject] = function (request) { + _this.errorCheck.startNew(function (next) { return _this.getDiagnosticsForProject(next, request.arguments.delay, request.arguments.file); }); + return _this.notRequired(); + }, + _a[CommandNames.Change] = function (request) { + _this.change(request.arguments); + return _this.notRequired(); + }, + _a[CommandNames.Configure] = function (request) { + _this.projectService.setHostConfiguration(request.arguments); + _this.output(undefined, CommandNames.Configure, request.seq); + return _this.notRequired(); + }, + _a[CommandNames.Reload] = function (request) { + _this.reload(request.arguments, request.seq); + return _this.requiredResponse({ reloadFinished: true }); + }, + _a[CommandNames.Saveto] = function (request) { + var savetoArgs = request.arguments; + _this.saveToTmp(savetoArgs.file, savetoArgs.tmpfile); + return _this.notRequired(); + }, + _a[CommandNames.Close] = function (request) { + var closeArgs = request.arguments; + _this.closeClientFile(closeArgs.file); + return _this.notRequired(); + }, + _a[CommandNames.Navto] = function (request) { + return _this.requiredResponse(_this.getNavigateToItems(request.arguments, true)); + }, + _a[CommandNames.NavtoFull] = function (request) { + return _this.requiredResponse(_this.getNavigateToItems(request.arguments, false)); + }, + _a[CommandNames.Brace] = function (request) { + return _this.requiredResponse(_this.getBraceMatching(request.arguments, true)); + }, + _a[CommandNames.BraceFull] = function (request) { + return _this.requiredResponse(_this.getBraceMatching(request.arguments, false)); + }, + _a[CommandNames.NavBar] = function (request) { + return _this.requiredResponse(_this.getNavigationBarItems(request.arguments, true)); + }, + _a[CommandNames.NavBarFull] = function (request) { + return _this.requiredResponse(_this.getNavigationBarItems(request.arguments, false)); + }, + _a[CommandNames.NavTree] = function (request) { + return _this.requiredResponse(_this.getNavigationTree(request.arguments, true)); + }, + _a[CommandNames.NavTreeFull] = function (request) { + return _this.requiredResponse(_this.getNavigationTree(request.arguments, false)); + }, + _a[CommandNames.Occurrences] = function (request) { + return _this.requiredResponse(_this.getOccurrences(request.arguments)); + }, + _a[CommandNames.DocumentHighlights] = function (request) { + return _this.requiredResponse(_this.getDocumentHighlights(request.arguments, true)); + }, + _a[CommandNames.DocumentHighlightsFull] = function (request) { + return _this.requiredResponse(_this.getDocumentHighlights(request.arguments, false)); + }, + _a[CommandNames.CompilerOptionsForInferredProjects] = function (request) { + _this.setCompilerOptionsForInferredProjects(request.arguments); + return _this.requiredResponse(true); + }, + _a[CommandNames.ProjectInfo] = function (request) { + return _this.requiredResponse(_this.getProjectInfo(request.arguments)); + }, + _a[CommandNames.ReloadProjects] = function () { + _this.projectService.reloadProjects(); + return _this.notRequired(); + }, + _a[CommandNames.GetCodeFixes] = function (request) { + return _this.requiredResponse(_this.getCodeFixes(request.arguments, true)); + }, + _a[CommandNames.GetCodeFixesFull] = function (request) { + return _this.requiredResponse(_this.getCodeFixes(request.arguments, false)); + }, + _a[CommandNames.GetSupportedCodeFixes] = function () { + return _this.requiredResponse(_this.getSupportedCodeFixes()); + }, + _a)); + this.host = opts.host; + this.cancellationToken = opts.cancellationToken; + this.typingsInstaller = opts.typingsInstaller; + this.byteLength = opts.byteLength; + this.hrtime = opts.hrtime; + this.logger = opts.logger; + this.canUseEvents = opts.canUseEvents; + var throttleWaitMilliseconds = opts.throttleWaitMilliseconds; + this.eventHandler = this.canUseEvents + ? opts.eventHandler || (function (event) { return _this.defaultEventHandler(event); }) + : undefined; + var multistepOperationHost = { + executeWithRequestId: function (requestId, action) { return _this.executeWithRequestId(requestId, action); }, + getCurrentRequestId: function () { return _this.currentRequestId; }, + getServerHost: function () { return _this.host; }, + logError: function (err, cmd) { return _this.logError(err, cmd); }, + sendRequestCompletedEvent: function (requestId) { return _this.sendRequestCompletedEvent(requestId); }, + isCancellationRequested: function () { return _this.cancellationToken.isCancellationRequested(); } + }; + this.errorCheck = new MultistepOperation(multistepOperationHost); + var settings = { + host: this.host, + logger: this.logger, + cancellationToken: this.cancellationToken, + useSingleInferredProject: opts.useSingleInferredProject, + typingsInstaller: this.typingsInstaller, + throttleWaitMilliseconds: throttleWaitMilliseconds, + eventHandler: this.eventHandler, + globalPlugins: opts.globalPlugins, + pluginProbeLocations: opts.pluginProbeLocations + }; + this.projectService = new server.ProjectService(settings); + this.gcTimer = new server.GcTimer(this.host, 7000, this.logger); + var _a; + } + Session.prototype.sendRequestCompletedEvent = function (requestId) { + var event = { + seq: 0, + type: "event", + event: "requestCompleted", + body: { request_seq: requestId } + }; + this.send(event); + }; + Session.prototype.defaultEventHandler = function (event) { + var _this = this; + switch (event.eventName) { + case server.ContextEvent: + var _a = event.data, project_1 = _a.project, fileName_2 = _a.fileName; + this.projectService.logger.info("got context event, updating diagnostics for " + fileName_2); + this.errorCheck.startNew(function (next) { return _this.updateErrorCheck(next, [{ fileName: fileName_2, project: project_1 }], _this.changeSeq, function (n) { return n === _this.changeSeq; }, 100); }); + break; + case server.ConfigFileDiagEvent: + var _b = event.data, triggerFile = _b.triggerFile, configFileName = _b.configFileName, diagnostics = _b.diagnostics; + this.configFileDiagnosticEvent(triggerFile, configFileName, diagnostics); + break; + case server.ProjectLanguageServiceStateEvent: + var eventName = "projectLanguageServiceState"; + this.event({ + projectName: event.data.project.getProjectName(), + languageServiceEnabled: event.data.languageServiceEnabled + }, eventName); + break; + } + }; + Session.prototype.logError = function (err, cmd) { + var msg = "Exception on executing command " + cmd; + if (err.message) { + msg += ":\n" + err.message; + if (err.stack) { + msg += "\n" + err.stack; + } + } + this.logger.msg(msg, server.Msg.Err); + }; + Session.prototype.send = function (msg) { + if (msg.type === "event" && !this.canUseEvents) { + if (this.logger.hasLevel(server.LogLevel.verbose)) { + this.logger.info("Session does not support events: ignored event: " + JSON.stringify(msg)); + } + return; + } + this.host.write(formatMessage(msg, this.logger, this.byteLength, this.host.newLine)); + }; + Session.prototype.configFileDiagnosticEvent = function (triggerFile, configFile, diagnostics) { + var bakedDiags = ts.map(diagnostics, formatConfigFileDiag); + var ev = { + seq: 0, + type: "event", + event: "configFileDiag", + body: { + triggerFile: triggerFile, + configFile: configFile, + diagnostics: bakedDiags + } + }; + this.send(ev); + }; + Session.prototype.event = function (info, eventName) { + var ev = { + seq: 0, + type: "event", + event: eventName, + body: info + }; + this.send(ev); + }; + Session.prototype.output = function (info, cmdName, reqSeq, errorMsg) { + if (reqSeq === void 0) { reqSeq = 0; } + var res = { + seq: 0, + type: "response", + command: cmdName, + request_seq: reqSeq, + success: !errorMsg, + }; + if (!errorMsg) { + res.body = info; + } + else { + res.message = errorMsg; + } + this.send(res); + }; + Session.prototype.semanticCheck = function (file, project) { + try { + var diags = []; + if (!shouldSkipSemanticCheck(project)) { + diags = project.getLanguageService().getSemanticDiagnostics(file); + } + var bakedDiags = diags.map(function (diag) { return formatDiag(file, project, diag); }); + this.event({ file: file, diagnostics: bakedDiags }, "semanticDiag"); + } + catch (err) { + this.logError(err, "semantic check"); + } + }; + Session.prototype.syntacticCheck = function (file, project) { + try { + var diags = project.getLanguageService().getSyntacticDiagnostics(file); + if (diags) { + var bakedDiags = diags.map(function (diag) { return formatDiag(file, project, diag); }); + this.event({ file: file, diagnostics: bakedDiags }, "syntaxDiag"); + } + } + catch (err) { + this.logError(err, "syntactic check"); + } + }; + Session.prototype.updateProjectStructure = function (seq, matchSeq, ms) { + var _this = this; + if (ms === void 0) { ms = 1500; } + this.host.setTimeout(function () { + if (matchSeq(seq)) { + _this.projectService.refreshInferredProjects(); + } + }, ms); + }; + Session.prototype.updateErrorCheck = function (next, checkList, seq, matchSeq, ms, followMs, requireOpen) { + var _this = this; + if (ms === void 0) { ms = 1500; } + if (followMs === void 0) { followMs = 200; } + if (requireOpen === void 0) { requireOpen = true; } + if (followMs > ms) { + followMs = ms; + } + var index = 0; + var checkOne = function () { + if (matchSeq(seq)) { + var checkSpec_1 = checkList[index]; + index++; + if (checkSpec_1.project.containsFile(checkSpec_1.fileName, requireOpen)) { + _this.syntacticCheck(checkSpec_1.fileName, checkSpec_1.project); + next.immediate(function () { + _this.semanticCheck(checkSpec_1.fileName, checkSpec_1.project); + if (checkList.length > index) { + next.delay(followMs, checkOne); + } + }); + } + } + }; + if ((checkList.length > index) && (matchSeq(seq))) { + next.delay(ms, checkOne); + } + }; + Session.prototype.cleanProjects = function (caption, projects) { + if (!projects) { + return; + } + this.logger.info("cleaning " + caption); + for (var _i = 0, projects_5 = projects; _i < projects_5.length; _i++) { + var p = projects_5[_i]; + p.getLanguageService(false).cleanupSemanticCache(); + } + }; + Session.prototype.cleanup = function () { + this.cleanProjects("inferred projects", this.projectService.inferredProjects); + this.cleanProjects("configured projects", this.projectService.configuredProjects); + this.cleanProjects("external projects", this.projectService.externalProjects); + if (this.host.gc) { + this.logger.info("host.gc()"); + this.host.gc(); + } + }; + Session.prototype.getEncodedSemanticClassifications = function (args) { + var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; + return project.getLanguageService().getEncodedSemanticClassifications(file, args); + }; + Session.prototype.getProject = function (projectFileName) { + return projectFileName && this.projectService.findProject(projectFileName); + }; + Session.prototype.getCompilerOptionsDiagnostics = function (args) { + var project = this.getProject(args.projectFileName); + return this.convertToDiagnosticsWithLinePosition(project.getLanguageService().getCompilerOptionsDiagnostics(), undefined); + }; + Session.prototype.convertToDiagnosticsWithLinePosition = function (diagnostics, scriptInfo) { + var _this = this; + return diagnostics.map(function (d) { return ({ + message: ts.flattenDiagnosticMessageText(d.messageText, _this.host.newLine), + start: d.start, + length: d.length, + category: ts.DiagnosticCategory[d.category].toLowerCase(), + code: d.code, + startLocation: scriptInfo && scriptInfo.positionToLineOffset(d.start), + endLocation: scriptInfo && scriptInfo.positionToLineOffset(d.start + d.length) + }); }); + }; + Session.prototype.getDiagnosticsWorker = function (args, isSemantic, selector, includeLinePosition) { + var _a = this.getFileAndProject(args), project = _a.project, file = _a.file; + if (isSemantic && shouldSkipSemanticCheck(project)) { + return []; + } + var scriptInfo = project.getScriptInfoForNormalizedPath(file); + var diagnostics = selector(project, file); + return includeLinePosition + ? this.convertToDiagnosticsWithLinePosition(diagnostics, scriptInfo) + : diagnostics.map(function (d) { return formatDiag(file, project, d); }); + }; + Session.prototype.getDefinition = function (args, simplifiedResult) { + var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; + var scriptInfo = project.getScriptInfoForNormalizedPath(file); + var position = this.getPosition(args, scriptInfo); + var definitions = project.getLanguageService().getDefinitionAtPosition(file, position); + if (!definitions) { + return undefined; + } + if (simplifiedResult) { + return definitions.map(function (def) { + var defScriptInfo = project.getScriptInfo(def.fileName); + return { + file: def.fileName, + start: defScriptInfo.positionToLineOffset(def.textSpan.start), + end: defScriptInfo.positionToLineOffset(ts.textSpanEnd(def.textSpan)) + }; + }); + } + else { + return definitions; + } + }; + Session.prototype.getTypeDefinition = function (args) { + var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; + var scriptInfo = project.getScriptInfoForNormalizedPath(file); + var position = this.getPosition(args, scriptInfo); + var definitions = project.getLanguageService().getTypeDefinitionAtPosition(file, position); + if (!definitions) { + return undefined; + } + return definitions.map(function (def) { + var defScriptInfo = project.getScriptInfo(def.fileName); + return { + file: def.fileName, + start: defScriptInfo.positionToLineOffset(def.textSpan.start), + end: defScriptInfo.positionToLineOffset(ts.textSpanEnd(def.textSpan)) + }; + }); + }; + Session.prototype.getImplementation = function (args, simplifiedResult) { + var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; + var position = this.getPosition(args, project.getScriptInfoForNormalizedPath(file)); + var implementations = project.getLanguageService().getImplementationAtPosition(file, position); + if (!implementations) { + return []; + } + if (simplifiedResult) { + return implementations.map(function (_a) { + var fileName = _a.fileName, textSpan = _a.textSpan; + var scriptInfo = project.getScriptInfo(fileName); + return { + file: fileName, + start: scriptInfo.positionToLineOffset(textSpan.start), + end: scriptInfo.positionToLineOffset(ts.textSpanEnd(textSpan)) + }; + }); + } + else { + return implementations; + } + }; + Session.prototype.getOccurrences = function (args) { + var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; + var scriptInfo = project.getScriptInfoForNormalizedPath(file); + var position = this.getPosition(args, scriptInfo); + var occurrences = project.getLanguageService().getOccurrencesAtPosition(file, position); + if (!occurrences) { + return undefined; + } + return occurrences.map(function (occurrence) { + var fileName = occurrence.fileName, isWriteAccess = occurrence.isWriteAccess, textSpan = occurrence.textSpan, isInString = occurrence.isInString; + var scriptInfo = project.getScriptInfo(fileName); + var start = scriptInfo.positionToLineOffset(textSpan.start); + var end = scriptInfo.positionToLineOffset(ts.textSpanEnd(textSpan)); + var result = { + start: start, + end: end, + file: fileName, + isWriteAccess: isWriteAccess, + }; + if (isInString) { + result.isInString = isInString; + } + return result; + }); + }; + Session.prototype.getSyntacticDiagnosticsSync = function (args) { + return this.getDiagnosticsWorker(args, false, function (project, file) { return project.getLanguageService().getSyntacticDiagnostics(file); }, args.includeLinePosition); + }; + Session.prototype.getSemanticDiagnosticsSync = function (args) { + return this.getDiagnosticsWorker(args, true, function (project, file) { return project.getLanguageService().getSemanticDiagnostics(file); }, args.includeLinePosition); + }; + Session.prototype.getDocumentHighlights = function (args, simplifiedResult) { + var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; + var scriptInfo = project.getScriptInfoForNormalizedPath(file); + var position = this.getPosition(args, scriptInfo); + var documentHighlights = project.getLanguageService().getDocumentHighlights(file, position, args.filesToSearch); + if (!documentHighlights) { + return undefined; + } + if (simplifiedResult) { + return documentHighlights.map(convertToDocumentHighlightsItem); + } + else { + return documentHighlights; + } + function convertToDocumentHighlightsItem(documentHighlights) { + var fileName = documentHighlights.fileName, highlightSpans = documentHighlights.highlightSpans; + var scriptInfo = project.getScriptInfo(fileName); + return { + file: fileName, + highlightSpans: highlightSpans.map(convertHighlightSpan) + }; + function convertHighlightSpan(highlightSpan) { + var textSpan = highlightSpan.textSpan, kind = highlightSpan.kind; + var start = scriptInfo.positionToLineOffset(textSpan.start); + var end = scriptInfo.positionToLineOffset(ts.textSpanEnd(textSpan)); + return { start: start, end: end, kind: kind }; + } + } + }; + Session.prototype.setCompilerOptionsForInferredProjects = function (args) { + this.projectService.setCompilerOptionsForInferredProjects(args.options); + }; + Session.prototype.getProjectInfo = function (args) { + return this.getProjectInfoWorker(args.file, args.projectFileName, args.needFileNameList); + }; + Session.prototype.getProjectInfoWorker = function (uncheckedFileName, projectFileName, needFileNameList) { + var project = this.getFileAndProjectWorker(uncheckedFileName, projectFileName, true, true).project; + var projectInfo = { + configFileName: project.getProjectName(), + languageServiceDisabled: !project.languageServiceEnabled, + fileNames: needFileNameList ? project.getFileNames() : undefined + }; + return projectInfo; + }; + Session.prototype.getRenameInfo = function (args) { + var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; + var scriptInfo = project.getScriptInfoForNormalizedPath(file); + var position = this.getPosition(args, scriptInfo); + return project.getLanguageService().getRenameInfo(file, position); + }; + Session.prototype.getProjects = function (args) { + var projects; + if (args.projectFileName) { + var project = this.getProject(args.projectFileName); + if (project) { + projects = [project]; + } + } + else { + var scriptInfo = this.projectService.getScriptInfo(args.file); + projects = scriptInfo.containingProjects; + } + projects = ts.filter(projects, function (p) { return p.languageServiceEnabled; }); + if (!projects || !projects.length) { + return server.Errors.ThrowNoProject(); + } + return projects; + }; + Session.prototype.getDefaultProject = function (args) { + if (args.projectFileName) { + var project = this.getProject(args.projectFileName); + if (project) { + return project; + } + } + var info = this.projectService.getScriptInfo(args.file); + return info.getDefaultProject(); + }; + Session.prototype.getRenameLocations = function (args, simplifiedResult) { + var file = server.toNormalizedPath(args.file); + var info = this.projectService.getScriptInfoForNormalizedPath(file); + var position = this.getPosition(args, info); + var projects = this.getProjects(args); + if (simplifiedResult) { + var defaultProject = this.getDefaultProject(args); + var renameInfo = defaultProject.getLanguageService().getRenameInfo(file, position); + if (!renameInfo) { + return undefined; + } + if (!renameInfo.canRename) { + return { + info: renameInfo, + locs: [] + }; + } + var fileSpans = server.combineProjectOutput(projects, function (project) { + var renameLocations = project.getLanguageService().findRenameLocations(file, position, args.findInStrings, args.findInComments); + if (!renameLocations) { + return []; + } + return renameLocations.map(function (location) { + var locationScriptInfo = project.getScriptInfo(location.fileName); + return { + file: location.fileName, + start: locationScriptInfo.positionToLineOffset(location.textSpan.start), + end: locationScriptInfo.positionToLineOffset(ts.textSpanEnd(location.textSpan)), + }; + }); + }, compareRenameLocation, function (a, b) { return a.file === b.file && a.start.line === b.start.line && a.start.offset === b.start.offset; }); + var locs = fileSpans.reduce(function (accum, cur) { + var curFileAccum; + if (accum.length > 0) { + curFileAccum = accum[accum.length - 1]; + if (curFileAccum.file !== cur.file) { + curFileAccum = undefined; + } + } + if (!curFileAccum) { + curFileAccum = { file: cur.file, locs: [] }; + accum.push(curFileAccum); + } + curFileAccum.locs.push({ start: cur.start, end: cur.end }); + return accum; + }, []); + return { info: renameInfo, locs: locs }; + } + else { + return server.combineProjectOutput(projects, function (p) { return p.getLanguageService().findRenameLocations(file, position, args.findInStrings, args.findInComments); }, undefined, renameLocationIsEqualTo); + } + function renameLocationIsEqualTo(a, b) { + if (a === b) { + return true; + } + if (!a || !b) { + return false; + } + return a.fileName === b.fileName && + a.textSpan.start === b.textSpan.start && + a.textSpan.length === b.textSpan.length; + } + function compareRenameLocation(a, b) { + if (a.file < b.file) { + return -1; + } + else if (a.file > b.file) { + return 1; + } + else { + if (a.start.line < b.start.line) { + return 1; + } + else if (a.start.line > b.start.line) { + return -1; + } + else { + return b.start.offset - a.start.offset; + } + } + } + }; + Session.prototype.getReferences = function (args, simplifiedResult) { + var file = server.toNormalizedPath(args.file); + var projects = this.getProjects(args); + var defaultProject = this.getDefaultProject(args); + var scriptInfo = defaultProject.getScriptInfoForNormalizedPath(file); + var position = this.getPosition(args, scriptInfo); + if (simplifiedResult) { + var nameInfo = defaultProject.getLanguageService().getQuickInfoAtPosition(file, position); + if (!nameInfo) { + return undefined; + } + var displayString = ts.displayPartsToString(nameInfo.displayParts); + var nameSpan = nameInfo.textSpan; + var nameColStart = scriptInfo.positionToLineOffset(nameSpan.start).offset; + var nameText = scriptInfo.getSnapshot().getText(nameSpan.start, ts.textSpanEnd(nameSpan)); + var refs = server.combineProjectOutput(projects, function (project) { + var references = project.getLanguageService().getReferencesAtPosition(file, position); + if (!references) { + return []; + } + return references.map(function (ref) { + var refScriptInfo = project.getScriptInfo(ref.fileName); + var start = refScriptInfo.positionToLineOffset(ref.textSpan.start); + var refLineSpan = refScriptInfo.lineToTextSpan(start.line - 1); + var lineText = refScriptInfo.getSnapshot().getText(refLineSpan.start, ts.textSpanEnd(refLineSpan)).replace(/\r|\n/g, ""); + return { + file: ref.fileName, + start: start, + lineText: lineText, + end: refScriptInfo.positionToLineOffset(ts.textSpanEnd(ref.textSpan)), + isWriteAccess: ref.isWriteAccess, + isDefinition: ref.isDefinition + }; + }); + }, compareFileStart, areReferencesResponseItemsForTheSameLocation); + return { + refs: refs, + symbolName: nameText, + symbolStartOffset: nameColStart, + symbolDisplayString: displayString + }; + } + else { + return server.combineProjectOutput(projects, function (project) { return project.getLanguageService().findReferences(file, position); }, undefined, undefined); + } + function areReferencesResponseItemsForTheSameLocation(a, b) { + if (a && b) { + return a.file === b.file && + a.start === b.start && + a.end === b.end; + } + return false; + } + }; + Session.prototype.openClientFile = function (fileName, fileContent, scriptKind) { + var _a = this.projectService.openClientFileWithNormalizedPath(fileName, fileContent, scriptKind), configFileName = _a.configFileName, configFileErrors = _a.configFileErrors; + if (this.eventHandler) { + this.eventHandler({ + eventName: "configFileDiag", + data: { triggerFile: fileName, configFileName: configFileName, diagnostics: configFileErrors || [] } + }); + } + }; + Session.prototype.getPosition = function (args, scriptInfo) { + return args.position !== undefined ? args.position : scriptInfo.lineOffsetToPosition(args.line, args.offset); + }; + Session.prototype.getFileAndProject = function (args, errorOnMissingProject) { + if (errorOnMissingProject === void 0) { errorOnMissingProject = true; } + return this.getFileAndProjectWorker(args.file, args.projectFileName, true, errorOnMissingProject); + }; + Session.prototype.getFileAndProjectWithoutRefreshingInferredProjects = function (args, errorOnMissingProject) { + if (errorOnMissingProject === void 0) { errorOnMissingProject = true; } + return this.getFileAndProjectWorker(args.file, args.projectFileName, false, errorOnMissingProject); + }; + Session.prototype.getFileAndProjectWorker = function (uncheckedFileName, projectFileName, refreshInferredProjects, errorOnMissingProject) { + var file = server.toNormalizedPath(uncheckedFileName); + var project = this.getProject(projectFileName) || this.projectService.getDefaultProjectForFile(file, refreshInferredProjects); + if (!project && errorOnMissingProject) { + return server.Errors.ThrowNoProject(); + } + return { file: file, project: project }; + }; + Session.prototype.getOutliningSpans = function (args) { + var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; + return project.getLanguageService(false).getOutliningSpans(file); + }; + Session.prototype.getTodoComments = function (args) { + var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; + return project.getLanguageService().getTodoComments(file, args.descriptors); + }; + Session.prototype.getDocCommentTemplate = function (args) { + var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; + var scriptInfo = project.getScriptInfoForNormalizedPath(file); + var position = this.getPosition(args, scriptInfo); + return project.getLanguageService(false).getDocCommentTemplateAtPosition(file, position); + }; + Session.prototype.getIndentation = function (args) { + var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; + var position = this.getPosition(args, project.getScriptInfoForNormalizedPath(file)); + var options = args.options ? server.convertFormatOptions(args.options) : this.projectService.getFormatCodeOptions(file); + var indentation = project.getLanguageService(false).getIndentationAtPosition(file, position, options); + return { position: position, indentation: indentation }; + }; + Session.prototype.getBreakpointStatement = function (args) { + var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; + var position = this.getPosition(args, project.getScriptInfoForNormalizedPath(file)); + return project.getLanguageService(false).getBreakpointStatementAtPosition(file, position); + }; + Session.prototype.getNameOrDottedNameSpan = function (args) { + var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; + var position = this.getPosition(args, project.getScriptInfoForNormalizedPath(file)); + return project.getLanguageService(false).getNameOrDottedNameSpan(file, position, position); + }; + Session.prototype.isValidBraceCompletion = function (args) { + var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; + var position = this.getPosition(args, project.getScriptInfoForNormalizedPath(file)); + return project.getLanguageService(false).isValidBraceCompletionAtPosition(file, position, args.openingBrace.charCodeAt(0)); + }; + Session.prototype.getQuickInfoWorker = function (args, simplifiedResult) { + var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; + var scriptInfo = project.getScriptInfoForNormalizedPath(file); + var quickInfo = project.getLanguageService().getQuickInfoAtPosition(file, this.getPosition(args, scriptInfo)); + if (!quickInfo) { + return undefined; + } + if (simplifiedResult) { + var displayString = ts.displayPartsToString(quickInfo.displayParts); + var docString = ts.displayPartsToString(quickInfo.documentation); + return { + kind: quickInfo.kind, + kindModifiers: quickInfo.kindModifiers, + start: scriptInfo.positionToLineOffset(quickInfo.textSpan.start), + end: scriptInfo.positionToLineOffset(ts.textSpanEnd(quickInfo.textSpan)), + displayString: displayString, + documentation: docString, + tags: quickInfo.tags || [] + }; + } + else { + return quickInfo; + } + }; + Session.prototype.getFormattingEditsForRange = function (args) { + var _this = this; + var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; + var scriptInfo = project.getScriptInfoForNormalizedPath(file); + var startPosition = scriptInfo.lineOffsetToPosition(args.line, args.offset); + var endPosition = scriptInfo.lineOffsetToPosition(args.endLine, args.endOffset); + var edits = project.getLanguageService(false).getFormattingEditsForRange(file, startPosition, endPosition, this.projectService.getFormatCodeOptions(file)); + if (!edits) { + return undefined; + } + return edits.map(function (edit) { return _this.convertTextChangeToCodeEdit(edit, scriptInfo); }); + }; + Session.prototype.getFormattingEditsForRangeFull = function (args) { + var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; + var options = args.options ? server.convertFormatOptions(args.options) : this.projectService.getFormatCodeOptions(file); + return project.getLanguageService(false).getFormattingEditsForRange(file, args.position, args.endPosition, options); + }; + Session.prototype.getFormattingEditsForDocumentFull = function (args) { + var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; + var options = args.options ? server.convertFormatOptions(args.options) : this.projectService.getFormatCodeOptions(file); + return project.getLanguageService(false).getFormattingEditsForDocument(file, options); + }; + Session.prototype.getFormattingEditsAfterKeystrokeFull = function (args) { + var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; + var options = args.options ? server.convertFormatOptions(args.options) : this.projectService.getFormatCodeOptions(file); + return project.getLanguageService(false).getFormattingEditsAfterKeystroke(file, args.position, args.key, options); + }; + Session.prototype.getFormattingEditsAfterKeystroke = function (args) { + var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; + var scriptInfo = project.getScriptInfoForNormalizedPath(file); + var position = scriptInfo.lineOffsetToPosition(args.line, args.offset); + var formatOptions = this.projectService.getFormatCodeOptions(file); + var edits = project.getLanguageService(false).getFormattingEditsAfterKeystroke(file, position, args.key, formatOptions); + if ((args.key === "\n") && ((!edits) || (edits.length === 0) || allEditsBeforePos(edits, position))) { + var lineInfo = scriptInfo.getLineInfo(args.line); + if (lineInfo && (lineInfo.leaf) && (lineInfo.leaf.text)) { + var lineText = lineInfo.leaf.text; + if (lineText.search("\\S") < 0) { + var preferredIndent = project.getLanguageService(false).getIndentationAtPosition(file, position, formatOptions); + var hasIndent = 0; + var i = void 0, len = void 0; + for (i = 0, len = lineText.length; i < len; i++) { + if (lineText.charAt(i) === " ") { + hasIndent++; + } + else if (lineText.charAt(i) === "\t") { + hasIndent += formatOptions.tabSize; + } + else { + break; + } + } + if (preferredIndent !== hasIndent) { + var firstNoWhiteSpacePosition = lineInfo.offset + i; + edits.push({ + span: ts.createTextSpanFromBounds(lineInfo.offset, firstNoWhiteSpacePosition), + newText: ts.formatting.getIndentationString(preferredIndent, formatOptions) + }); + } + } + } + } + if (!edits) { + return undefined; + } + return edits.map(function (edit) { + return { + start: scriptInfo.positionToLineOffset(edit.span.start), + end: scriptInfo.positionToLineOffset(ts.textSpanEnd(edit.span)), + newText: edit.newText ? edit.newText : "" + }; + }); + }; + Session.prototype.getCompletions = function (args, simplifiedResult) { + var _this = this; + var prefix = args.prefix || ""; + var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; + var scriptInfo = project.getScriptInfoForNormalizedPath(file); + var position = this.getPosition(args, scriptInfo); + var completions = project.getLanguageService().getCompletionsAtPosition(file, position); + if (!completions) { + return undefined; + } + if (simplifiedResult) { + return completions.entries.reduce(function (result, entry) { + if (completions.isMemberCompletion || (entry.name.toLowerCase().indexOf(prefix.toLowerCase()) === 0)) { + var name = entry.name, kind = entry.kind, kindModifiers = entry.kindModifiers, sortText = entry.sortText, replacementSpan = entry.replacementSpan; + var convertedSpan = replacementSpan ? _this.decorateSpan(replacementSpan, scriptInfo) : undefined; + result.push({ name: name, kind: kind, kindModifiers: kindModifiers, sortText: sortText, replacementSpan: convertedSpan }); + } + return result; + }, []).sort(function (a, b) { return ts.compareStrings(a.name, b.name); }); + } + else { + return completions; + } + }; + Session.prototype.getCompletionEntryDetails = function (args) { + var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; + var scriptInfo = project.getScriptInfoForNormalizedPath(file); + var position = this.getPosition(args, scriptInfo); + return args.entryNames.reduce(function (accum, entryName) { + var details = project.getLanguageService().getCompletionEntryDetails(file, position, entryName); + if (details) { + accum.push(details); + } + return accum; + }, []); + }; + Session.prototype.getCompileOnSaveAffectedFileList = function (args) { + var info = this.projectService.getScriptInfo(args.file); + var result = []; + if (!info) { + return []; + } + var projectsToSearch = args.projectFileName ? [this.projectService.findProject(args.projectFileName)] : info.containingProjects; + for (var _i = 0, projectsToSearch_1 = projectsToSearch; _i < projectsToSearch_1.length; _i++) { + var project = projectsToSearch_1[_i]; + if (project.compileOnSaveEnabled && project.languageServiceEnabled) { + result.push({ + projectFileName: project.getProjectName(), + fileNames: project.getCompileOnSaveAffectedFileList(info), + projectUsesOutFile: !!project.getCompilerOptions().outFile || !!project.getCompilerOptions().out + }); + } + } + return result; + }; + Session.prototype.emitFile = function (args) { + var _this = this; + var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; + if (!project) { + server.Errors.ThrowNoProject(); + } + if (!project.languageServiceEnabled) { + return false; + } + var scriptInfo = project.getScriptInfo(file); + return project.builder.emitFile(scriptInfo, function (path, data, writeByteOrderMark) { return _this.host.writeFile(path, data, writeByteOrderMark); }); + }; + Session.prototype.getSignatureHelpItems = function (args, simplifiedResult) { + var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; + var scriptInfo = project.getScriptInfoForNormalizedPath(file); + var position = this.getPosition(args, scriptInfo); + var helpItems = project.getLanguageService().getSignatureHelpItems(file, position); + if (!helpItems) { + return undefined; + } + if (simplifiedResult) { + var span_17 = helpItems.applicableSpan; + return { + items: helpItems.items, + applicableSpan: { + start: scriptInfo.positionToLineOffset(span_17.start), + end: scriptInfo.positionToLineOffset(span_17.start + span_17.length) + }, + selectedItemIndex: helpItems.selectedItemIndex, + argumentIndex: helpItems.argumentIndex, + argumentCount: helpItems.argumentCount, + }; + } + else { + return helpItems; + } + }; + Session.prototype.getDiagnostics = function (next, delay, fileNames) { + var _this = this; + var checkList = fileNames.reduce(function (accum, uncheckedFileName) { + var fileName = server.toNormalizedPath(uncheckedFileName); + var project = _this.projectService.getDefaultProjectForFile(fileName, true); + if (project) { + accum.push({ fileName: fileName, project: project }); + } + return accum; + }, []); + if (checkList.length > 0) { + this.updateErrorCheck(next, checkList, this.changeSeq, function (n) { return n === _this.changeSeq; }, delay); + } + }; + Session.prototype.change = function (args) { + var _this = this; + var _a = this.getFileAndProject(args, false), file = _a.file, project = _a.project; + if (project) { + var scriptInfo = project.getScriptInfoForNormalizedPath(file); + var start = scriptInfo.lineOffsetToPosition(args.line, args.offset); + var end = scriptInfo.lineOffsetToPosition(args.endLine, args.endOffset); + if (start >= 0) { + scriptInfo.editContent(start, end, args.insertString); + this.changeSeq++; + } + this.updateProjectStructure(this.changeSeq, function (n) { return n === _this.changeSeq; }); + } + }; + Session.prototype.reload = function (args, reqSeq) { + var file = server.toNormalizedPath(args.file); + var tempFileName = args.tmpfile && server.toNormalizedPath(args.tmpfile); + var project = this.projectService.getDefaultProjectForFile(file, true); + if (project) { + this.changeSeq++; + if (project.reloadScript(file, tempFileName)) { + this.output(undefined, CommandNames.Reload, reqSeq); + } + } + }; + Session.prototype.saveToTmp = function (fileName, tempFileName) { + var scriptInfo = this.projectService.getScriptInfo(fileName); + if (scriptInfo) { + scriptInfo.saveTo(tempFileName); + } + }; + Session.prototype.closeClientFile = function (fileName) { + if (!fileName) { + return; + } + var file = ts.normalizePath(fileName); + this.projectService.closeClientFile(file); + }; + Session.prototype.decorateNavigationBarItems = function (items, scriptInfo) { + var _this = this; + return ts.map(items, function (item) { return ({ + text: item.text, + kind: item.kind, + kindModifiers: item.kindModifiers, + spans: item.spans.map(function (span) { return _this.decorateSpan(span, scriptInfo); }), + childItems: _this.decorateNavigationBarItems(item.childItems, scriptInfo), + indent: item.indent + }); }); + }; + Session.prototype.getNavigationBarItems = function (args, simplifiedResult) { + var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; + var items = project.getLanguageService(false).getNavigationBarItems(file); + return !items + ? undefined + : simplifiedResult + ? this.decorateNavigationBarItems(items, project.getScriptInfoForNormalizedPath(file)) + : items; + }; + Session.prototype.decorateNavigationTree = function (tree, scriptInfo) { + var _this = this; + return { + text: tree.text, + kind: tree.kind, + kindModifiers: tree.kindModifiers, + spans: tree.spans.map(function (span) { return _this.decorateSpan(span, scriptInfo); }), + childItems: ts.map(tree.childItems, function (item) { return _this.decorateNavigationTree(item, scriptInfo); }) + }; + }; + Session.prototype.decorateSpan = function (span, scriptInfo) { + return { + start: scriptInfo.positionToLineOffset(span.start), + end: scriptInfo.positionToLineOffset(ts.textSpanEnd(span)) + }; + }; + Session.prototype.getNavigationTree = function (args, simplifiedResult) { + var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; + var tree = project.getLanguageService(false).getNavigationTree(file); + return !tree + ? undefined + : simplifiedResult + ? this.decorateNavigationTree(tree, project.getScriptInfoForNormalizedPath(file)) + : tree; + }; + Session.prototype.getNavigateToItems = function (args, simplifiedResult) { + var projects = this.getProjects(args); + var fileName = args.currentFileOnly ? args.file && ts.normalizeSlashes(args.file) : undefined; + if (simplifiedResult) { + return server.combineProjectOutput(projects, function (project) { + var navItems = project.getLanguageService().getNavigateToItems(args.searchValue, args.maxResultCount, fileName, project.isNonTsProject()); + if (!navItems) { + return []; + } + return navItems.map(function (navItem) { + var scriptInfo = project.getScriptInfo(navItem.fileName); + var start = scriptInfo.positionToLineOffset(navItem.textSpan.start); + var end = scriptInfo.positionToLineOffset(ts.textSpanEnd(navItem.textSpan)); + var bakedItem = { + name: navItem.name, + kind: navItem.kind, + file: navItem.fileName, + start: start, + end: end, + }; + if (navItem.kindModifiers && (navItem.kindModifiers !== "")) { + bakedItem.kindModifiers = navItem.kindModifiers; + } + if (navItem.matchKind !== "none") { + bakedItem.matchKind = navItem.matchKind; + } + if (navItem.containerName && (navItem.containerName.length > 0)) { + bakedItem.containerName = navItem.containerName; + } + if (navItem.containerKind && (navItem.containerKind.length > 0)) { + bakedItem.containerKind = navItem.containerKind; + } + return bakedItem; + }); + }, undefined, areNavToItemsForTheSameLocation); + } + else { + return server.combineProjectOutput(projects, function (project) { return project.getLanguageService().getNavigateToItems(args.searchValue, args.maxResultCount, fileName, project.isNonTsProject()); }, undefined, navigateToItemIsEqualTo); + } + function navigateToItemIsEqualTo(a, b) { + if (a === b) { + return true; + } + if (!a || !b) { + return false; + } + return a.containerKind === b.containerKind && + a.containerName === b.containerName && + a.fileName === b.fileName && + a.isCaseSensitive === b.isCaseSensitive && + a.kind === b.kind && + a.kindModifiers === b.containerName && + a.matchKind === b.matchKind && + a.name === b.name && + a.textSpan.start === b.textSpan.start && + a.textSpan.length === b.textSpan.length; + } + function areNavToItemsForTheSameLocation(a, b) { + if (a && b) { + return a.file === b.file && + a.start === b.start && + a.end === b.end; + } + return false; + } + }; + Session.prototype.getSupportedCodeFixes = function () { + return ts.getSupportedCodeFixes(); + }; + Session.prototype.getCodeFixes = function (args, simplifiedResult) { + var _this = this; + if (args.errorCodes.length === 0) { + return undefined; + } + var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; + var scriptInfo = project.getScriptInfoForNormalizedPath(file); + var startPosition = getStartPosition(); + var endPosition = getEndPosition(); + var formatOptions = this.projectService.getFormatCodeOptions(file); + var codeActions = project.getLanguageService().getCodeFixesAtPosition(file, startPosition, endPosition, args.errorCodes, formatOptions); + if (!codeActions) { + return undefined; + } + if (simplifiedResult) { + return codeActions.map(function (codeAction) { return _this.mapCodeAction(codeAction, scriptInfo); }); + } + else { + return codeActions; + } + function getStartPosition() { + return args.startPosition !== undefined ? args.startPosition : scriptInfo.lineOffsetToPosition(args.startLine, args.startOffset); + } + function getEndPosition() { + return args.endPosition !== undefined ? args.endPosition : scriptInfo.lineOffsetToPosition(args.endLine, args.endOffset); + } + }; + Session.prototype.mapCodeAction = function (codeAction, scriptInfo) { + var _this = this; + return { + description: codeAction.description, + changes: codeAction.changes.map(function (change) { return ({ + fileName: change.fileName, + textChanges: change.textChanges.map(function (textChange) { return _this.convertTextChangeToCodeEdit(textChange, scriptInfo); }) + }); }) + }; + }; + Session.prototype.convertTextChangeToCodeEdit = function (change, scriptInfo) { + return { + start: scriptInfo.positionToLineOffset(change.span.start), + end: scriptInfo.positionToLineOffset(change.span.start + change.span.length), + newText: change.newText ? change.newText : "" + }; + }; + Session.prototype.getBraceMatching = function (args, simplifiedResult) { + var _this = this; + var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; + var scriptInfo = project.getScriptInfoForNormalizedPath(file); + var position = this.getPosition(args, scriptInfo); + var spans = project.getLanguageService(false).getBraceMatchingAtPosition(file, position); + return !spans + ? undefined + : simplifiedResult + ? spans.map(function (span) { return _this.decorateSpan(span, scriptInfo); }) + : spans; + }; + Session.prototype.getDiagnosticsForProject = function (next, delay, fileName) { + var _this = this; + var _a = this.getProjectInfoWorker(fileName, undefined, true), fileNames = _a.fileNames, languageServiceDisabled = _a.languageServiceDisabled; + if (languageServiceDisabled) { + return; + } + var fileNamesInProject = fileNames.filter(function (value) { return value.indexOf("lib.d.ts") < 0; }); + var highPriorityFiles = []; + var mediumPriorityFiles = []; + var lowPriorityFiles = []; + var veryLowPriorityFiles = []; + var normalizedFileName = server.toNormalizedPath(fileName); + var project = this.projectService.getDefaultProjectForFile(normalizedFileName, true); + for (var _i = 0, fileNamesInProject_1 = fileNamesInProject; _i < fileNamesInProject_1.length; _i++) { + var fileNameInProject = fileNamesInProject_1[_i]; + if (this.getCanonicalFileName(fileNameInProject) === this.getCanonicalFileName(fileName)) + highPriorityFiles.push(fileNameInProject); + else { + var info = this.projectService.getScriptInfo(fileNameInProject); + if (!info.isScriptOpen()) { + if (fileNameInProject.indexOf(".d.ts") > 0) + veryLowPriorityFiles.push(fileNameInProject); + else + lowPriorityFiles.push(fileNameInProject); + } + else + mediumPriorityFiles.push(fileNameInProject); + } + } + fileNamesInProject = highPriorityFiles.concat(mediumPriorityFiles).concat(lowPriorityFiles).concat(veryLowPriorityFiles); + if (fileNamesInProject.length > 0) { + var checkList = fileNamesInProject.map(function (fileName) { return ({ fileName: fileName, project: project }); }); + this.updateErrorCheck(next, checkList, this.changeSeq, function (n) { return n === _this.changeSeq; }, delay, 200, false); + } + }; + Session.prototype.getCanonicalFileName = function (fileName) { + var name = this.host.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(); + return ts.normalizePath(name); + }; + Session.prototype.exit = function () { + }; + Session.prototype.notRequired = function () { + return { responseRequired: false }; + }; + Session.prototype.requiredResponse = function (response) { + return { response: response, responseRequired: true }; + }; + Session.prototype.addProtocolHandler = function (command, handler) { + if (this.handlers.has(command)) { + throw new Error("Protocol handler already exists for command \"" + command + "\""); + } + this.handlers.set(command, handler); + }; + Session.prototype.setCurrentRequest = function (requestId) { + ts.Debug.assert(this.currentRequestId === undefined); + this.currentRequestId = requestId; + this.cancellationToken.setRequest(requestId); + }; + Session.prototype.resetCurrentRequest = function (requestId) { + ts.Debug.assert(this.currentRequestId === requestId); + this.currentRequestId = undefined; + this.cancellationToken.resetRequest(requestId); + }; + Session.prototype.executeWithRequestId = function (requestId, f) { + try { + this.setCurrentRequest(requestId); + return f(); + } + finally { + this.resetCurrentRequest(requestId); + } + }; + Session.prototype.executeCommand = function (request) { + var handler = this.handlers.get(request.command); + if (handler) { + return this.executeWithRequestId(request.seq, function () { return handler(request); }); + } + else { + this.logger.msg("Unrecognized JSON command: " + JSON.stringify(request), server.Msg.Err); + this.output(undefined, CommandNames.Unknown, request.seq, "Unrecognized JSON command: " + request.command); + return { responseRequired: false }; + } + }; + Session.prototype.onMessage = function (message) { + this.gcTimer.scheduleCollect(); + var start; + if (this.logger.hasLevel(server.LogLevel.requestTime)) { + start = this.hrtime(); + if (this.logger.hasLevel(server.LogLevel.verbose)) { + this.logger.info("request: " + message); + } + } + var request; + try { + request = JSON.parse(message); + var _a = this.executeCommand(request), response = _a.response, responseRequired = _a.responseRequired; + if (this.logger.hasLevel(server.LogLevel.requestTime)) { + var elapsedTime = hrTimeToMilliseconds(this.hrtime(start)).toFixed(4); + if (responseRequired) { + this.logger.perftrc(request.seq + "::" + request.command + ": elapsed time (in milliseconds) " + elapsedTime); + } + else { + this.logger.perftrc(request.seq + "::" + request.command + ": async elapsed time (in milliseconds) " + elapsedTime); + } + } + if (response) { + this.output(response, request.command, request.seq); + } + else if (responseRequired) { + this.output(undefined, request.command, request.seq, "No content available."); + } + } + catch (err) { + if (err instanceof ts.OperationCanceledException) { + this.output({ canceled: true }, request.command, request.seq); + return; + } + this.logError(err, message); + this.output(undefined, request ? request.command : CommandNames.Unknown, request ? request.seq : 0, "Error processing request. " + err.message + "\n" + err.stack); + } + }; + return Session; + }()); + server.Session = Session; + })(server = ts.server || (ts.server = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var server; + (function (server) { + var lineCollectionCapacity = 4; + var CharRangeSection; + (function (CharRangeSection) { + CharRangeSection[CharRangeSection["PreStart"] = 0] = "PreStart"; + CharRangeSection[CharRangeSection["Start"] = 1] = "Start"; + CharRangeSection[CharRangeSection["Entire"] = 2] = "Entire"; + CharRangeSection[CharRangeSection["Mid"] = 3] = "Mid"; + CharRangeSection[CharRangeSection["End"] = 4] = "End"; + CharRangeSection[CharRangeSection["PostEnd"] = 5] = "PostEnd"; + })(CharRangeSection = server.CharRangeSection || (server.CharRangeSection = {})); + var BaseLineIndexWalker = (function () { + function BaseLineIndexWalker() { + this.goSubtree = true; + this.done = false; + } + BaseLineIndexWalker.prototype.leaf = function (_rangeStart, _rangeLength, _ll) { + }; + return BaseLineIndexWalker; + }()); + var EditWalker = (function (_super) { + __extends(EditWalker, _super); + function EditWalker() { + var _this = _super.call(this) || this; + _this.lineIndex = new LineIndex(); + _this.endBranch = []; + _this.state = CharRangeSection.Entire; + _this.initialText = ""; + _this.trailingText = ""; + _this.suppressTrailingText = false; + _this.lineIndex.root = new LineNode(); + _this.startPath = [_this.lineIndex.root]; + _this.stack = [_this.lineIndex.root]; + return _this; + } + EditWalker.prototype.insertLines = function (insertedText) { + if (this.suppressTrailingText) { + this.trailingText = ""; + } + if (insertedText) { + insertedText = this.initialText + insertedText + this.trailingText; + } + else { + insertedText = this.initialText + this.trailingText; + } + var lm = LineIndex.linesFromText(insertedText); + var lines = lm.lines; + if (lines.length > 1) { + if (lines[lines.length - 1] === "") { + lines.length--; + } + } + var branchParent; + var lastZeroCount; + for (var k = this.endBranch.length - 1; k >= 0; k--) { + this.endBranch[k].updateCounts(); + if (this.endBranch[k].charCount() === 0) { + lastZeroCount = this.endBranch[k]; + if (k > 0) { + branchParent = this.endBranch[k - 1]; + } + else { + branchParent = this.branchNode; + } + } + } + if (lastZeroCount) { + branchParent.remove(lastZeroCount); + } + var insertionNode = this.startPath[this.startPath.length - 2]; + var leafNode = this.startPath[this.startPath.length - 1]; + var len = lines.length; + if (len > 0) { + leafNode.text = lines[0]; + if (len > 1) { + var insertedNodes = new Array(len - 1); + var startNode = leafNode; + for (var i = 1; i < lines.length; i++) { + insertedNodes[i - 1] = new LineLeaf(lines[i]); + } + var pathIndex = this.startPath.length - 2; + while (pathIndex >= 0) { + insertionNode = this.startPath[pathIndex]; + insertedNodes = insertionNode.insertAt(startNode, insertedNodes); + pathIndex--; + startNode = insertionNode; + } + var insertedNodesLen = insertedNodes.length; + while (insertedNodesLen > 0) { + var newRoot = new LineNode(); + newRoot.add(this.lineIndex.root); + insertedNodes = newRoot.insertAt(this.lineIndex.root, insertedNodes); + insertedNodesLen = insertedNodes.length; + this.lineIndex.root = newRoot; + } + this.lineIndex.root.updateCounts(); + } + else { + for (var j = this.startPath.length - 2; j >= 0; j--) { + this.startPath[j].updateCounts(); + } + } + } + else { + insertionNode.remove(leafNode); + for (var j = this.startPath.length - 2; j >= 0; j--) { + this.startPath[j].updateCounts(); + } + } + return this.lineIndex; + }; + EditWalker.prototype.post = function (_relativeStart, _relativeLength, lineCollection) { + if (lineCollection === this.lineCollectionAtBranch) { + this.state = CharRangeSection.End; + } + this.stack.length--; + return undefined; + }; + EditWalker.prototype.pre = function (_relativeStart, _relativeLength, lineCollection, _parent, nodeType) { + var currentNode = this.stack[this.stack.length - 1]; + if ((this.state === CharRangeSection.Entire) && (nodeType === CharRangeSection.Start)) { + this.state = CharRangeSection.Start; + this.branchNode = currentNode; + this.lineCollectionAtBranch = lineCollection; + } + var child; + function fresh(node) { + if (node.isLeaf()) { + return new LineLeaf(""); + } + else + return new LineNode(); + } + switch (nodeType) { + case CharRangeSection.PreStart: + this.goSubtree = false; + if (this.state !== CharRangeSection.End) { + currentNode.add(lineCollection); + } + break; + case CharRangeSection.Start: + if (this.state === CharRangeSection.End) { + this.goSubtree = false; + } + else { + child = fresh(lineCollection); + currentNode.add(child); + this.startPath[this.startPath.length] = child; + } + break; + case CharRangeSection.Entire: + if (this.state !== CharRangeSection.End) { + child = fresh(lineCollection); + currentNode.add(child); + this.startPath[this.startPath.length] = child; + } + else { + if (!lineCollection.isLeaf()) { + child = fresh(lineCollection); + currentNode.add(child); + this.endBranch[this.endBranch.length] = child; + } + } + break; + case CharRangeSection.Mid: + this.goSubtree = false; + break; + case CharRangeSection.End: + if (this.state !== CharRangeSection.End) { + this.goSubtree = false; + } + else { + if (!lineCollection.isLeaf()) { + child = fresh(lineCollection); + currentNode.add(child); + this.endBranch[this.endBranch.length] = child; + } + } + break; + case CharRangeSection.PostEnd: + this.goSubtree = false; + if (this.state !== CharRangeSection.Start) { + currentNode.add(lineCollection); + } + break; + } + if (this.goSubtree) { + this.stack[this.stack.length] = child; + } + return lineCollection; + }; + EditWalker.prototype.leaf = function (relativeStart, relativeLength, ll) { + if (this.state === CharRangeSection.Start) { + this.initialText = ll.text.substring(0, relativeStart); + } + else if (this.state === CharRangeSection.Entire) { + this.initialText = ll.text.substring(0, relativeStart); + this.trailingText = ll.text.substring(relativeStart + relativeLength); + } + else { + this.trailingText = ll.text.substring(relativeStart + relativeLength); + } + }; + return EditWalker; + }(BaseLineIndexWalker)); + var TextChange = (function () { + function TextChange(pos, deleteLen, insertedText) { + this.pos = pos; + this.deleteLen = deleteLen; + this.insertedText = insertedText; + } + TextChange.prototype.getTextChangeRange = function () { + return ts.createTextChangeRange(ts.createTextSpan(this.pos, this.deleteLen), this.insertedText ? this.insertedText.length : 0); + }; + return TextChange; + }()); + server.TextChange = TextChange; + var ScriptVersionCache = (function () { + function ScriptVersionCache() { + this.changes = []; + this.versions = new Array(ScriptVersionCache.maxVersions); + this.minVersion = 0; + this.currentVersion = 0; + } + ScriptVersionCache.prototype.versionToIndex = function (version) { + if (version < this.minVersion || version > this.currentVersion) { + return undefined; + } + return version % ScriptVersionCache.maxVersions; + }; + ScriptVersionCache.prototype.currentVersionToIndex = function () { + return this.currentVersion % ScriptVersionCache.maxVersions; + }; + ScriptVersionCache.prototype.edit = function (pos, deleteLen, insertedText) { + this.changes[this.changes.length] = new TextChange(pos, deleteLen, insertedText); + if ((this.changes.length > ScriptVersionCache.changeNumberThreshold) || + (deleteLen > ScriptVersionCache.changeLengthThreshold) || + (insertedText && (insertedText.length > ScriptVersionCache.changeLengthThreshold))) { + this.getSnapshot(); + } + }; + ScriptVersionCache.prototype.latest = function () { + return this.versions[this.currentVersionToIndex()]; + }; + ScriptVersionCache.prototype.latestVersion = function () { + if (this.changes.length > 0) { + this.getSnapshot(); + } + return this.currentVersion; + }; + ScriptVersionCache.prototype.reloadFromFile = function (filename) { + var content = this.host.readFile(filename); + if (!content) { + content = ""; + } + this.reload(content); + }; + ScriptVersionCache.prototype.reload = function (script) { + this.currentVersion++; + this.changes = []; + var snap = new LineIndexSnapshot(this.currentVersion, this); + for (var i = 0; i < this.versions.length; i++) { + this.versions[i] = undefined; + } + this.versions[this.currentVersionToIndex()] = snap; + snap.index = new LineIndex(); + var lm = LineIndex.linesFromText(script); + snap.index.load(lm.lines); + this.minVersion = this.currentVersion; + }; + ScriptVersionCache.prototype.getSnapshot = function () { + var snap = this.versions[this.currentVersionToIndex()]; + if (this.changes.length > 0) { + var snapIndex = snap.index; + for (var _i = 0, _a = this.changes; _i < _a.length; _i++) { + var change = _a[_i]; + snapIndex = snapIndex.edit(change.pos, change.deleteLen, change.insertedText); + } + snap = new LineIndexSnapshot(this.currentVersion + 1, this); + snap.index = snapIndex; + snap.changesSincePreviousVersion = this.changes; + this.currentVersion = snap.version; + this.versions[this.currentVersionToIndex()] = snap; + this.changes = []; + if ((this.currentVersion - this.minVersion) >= ScriptVersionCache.maxVersions) { + this.minVersion = (this.currentVersion - ScriptVersionCache.maxVersions) + 1; + } + } + return snap; + }; + ScriptVersionCache.prototype.getTextChangesBetweenVersions = function (oldVersion, newVersion) { + if (oldVersion < newVersion) { + if (oldVersion >= this.minVersion) { + var textChangeRanges = []; + for (var i = oldVersion + 1; i <= newVersion; i++) { + var snap = this.versions[this.versionToIndex(i)]; + for (var _i = 0, _a = snap.changesSincePreviousVersion; _i < _a.length; _i++) { + var textChange = _a[_i]; + textChangeRanges[textChangeRanges.length] = textChange.getTextChangeRange(); + } + } + return ts.collapseTextChangeRangesAcrossMultipleVersions(textChangeRanges); + } + else { + return undefined; + } + } + else { + return ts.unchangedTextChangeRange; + } + }; + ScriptVersionCache.fromString = function (host, script) { + var svc = new ScriptVersionCache(); + var snap = new LineIndexSnapshot(0, svc); + svc.versions[svc.currentVersion] = snap; + svc.host = host; + snap.index = new LineIndex(); + var lm = LineIndex.linesFromText(script); + snap.index.load(lm.lines); + return svc; + }; + return ScriptVersionCache; + }()); + ScriptVersionCache.changeNumberThreshold = 8; + ScriptVersionCache.changeLengthThreshold = 256; + ScriptVersionCache.maxVersions = 8; + server.ScriptVersionCache = ScriptVersionCache; + var LineIndexSnapshot = (function () { + function LineIndexSnapshot(version, cache) { + this.version = version; + this.cache = cache; + this.changesSincePreviousVersion = []; + } + LineIndexSnapshot.prototype.getText = function (rangeStart, rangeEnd) { + return this.index.getText(rangeStart, rangeEnd - rangeStart); + }; + LineIndexSnapshot.prototype.getLength = function () { + return this.index.root.charCount(); + }; + LineIndexSnapshot.prototype.getLineStartPositions = function () { + var starts = [-1]; + var count = 1; + var pos = 0; + this.index.every(function (ll) { + starts[count] = pos; + count++; + pos += ll.text.length; + return true; + }, 0); + return starts; + }; + LineIndexSnapshot.prototype.getLineMapper = function () { + var _this = this; + return function (line) { + return _this.index.lineNumberToInfo(line).offset; + }; + }; + LineIndexSnapshot.prototype.getTextChangeRangeSinceVersion = function (scriptVersion) { + if (this.version <= scriptVersion) { + return ts.unchangedTextChangeRange; + } + else { + return this.cache.getTextChangesBetweenVersions(scriptVersion, this.version); + } + }; + LineIndexSnapshot.prototype.getChangeRange = function (oldSnapshot) { + if (oldSnapshot instanceof LineIndexSnapshot && this.cache === oldSnapshot.cache) { + return this.getTextChangeRangeSinceVersion(oldSnapshot.version); + } + }; + return LineIndexSnapshot; + }()); + server.LineIndexSnapshot = LineIndexSnapshot; + var LineIndex = (function () { + function LineIndex() { + this.checkEdits = false; + } + LineIndex.prototype.charOffsetToLineNumberAndPos = function (charOffset) { + return this.root.charOffsetToLineNumberAndPos(1, charOffset); + }; + LineIndex.prototype.lineNumberToInfo = function (lineNumber) { + var lineCount = this.root.lineCount(); + if (lineNumber <= lineCount) { + var lineInfo = this.root.lineNumberToInfo(lineNumber, 0); + lineInfo.line = lineNumber; + return lineInfo; + } + else { + return { + line: lineNumber, + offset: this.root.charCount() + }; + } + }; + LineIndex.prototype.load = function (lines) { + if (lines.length > 0) { + var leaves = []; + for (var i = 0; i < lines.length; i++) { + leaves[i] = new LineLeaf(lines[i]); + } + this.root = LineIndex.buildTreeFromBottom(leaves); + } + else { + this.root = new LineNode(); + } + }; + LineIndex.prototype.walk = function (rangeStart, rangeLength, walkFns) { + this.root.walk(rangeStart, rangeLength, walkFns); + }; + LineIndex.prototype.getText = function (rangeStart, rangeLength) { + var accum = ""; + if ((rangeLength > 0) && (rangeStart < this.root.charCount())) { + this.walk(rangeStart, rangeLength, { + goSubtree: true, + done: false, + leaf: function (relativeStart, relativeLength, ll) { + accum = accum.concat(ll.text.substring(relativeStart, relativeStart + relativeLength)); + } + }); + } + return accum; + }; + LineIndex.prototype.getLength = function () { + return this.root.charCount(); + }; + LineIndex.prototype.every = function (f, rangeStart, rangeEnd) { + if (!rangeEnd) { + rangeEnd = this.root.charCount(); + } + var walkFns = { + goSubtree: true, + done: false, + leaf: function (relativeStart, relativeLength, ll) { + if (!f(ll, relativeStart, relativeLength)) { + this.done = true; + } + } + }; + this.walk(rangeStart, rangeEnd - rangeStart, walkFns); + return !walkFns.done; + }; + LineIndex.prototype.edit = function (pos, deleteLength, newText) { + function editFlat(source, s, dl, nt) { + if (nt === void 0) { nt = ""; } + return source.substring(0, s) + nt + source.substring(s + dl, source.length); + } + if (this.root.charCount() === 0) { + if (newText !== undefined) { + this.load(LineIndex.linesFromText(newText).lines); + return this; + } + } + else { + var checkText = void 0; + if (this.checkEdits) { + checkText = editFlat(this.getText(0, this.root.charCount()), pos, deleteLength, newText); + } + var walker = new EditWalker(); + if (pos >= this.root.charCount()) { + pos = this.root.charCount() - 1; + var endString = this.getText(pos, 1); + if (newText) { + newText = endString + newText; + } + else { + newText = endString; + } + deleteLength = 0; + walker.suppressTrailingText = true; + } + else if (deleteLength > 0) { + var e = pos + deleteLength; + var lineInfo = this.charOffsetToLineNumberAndPos(e); + if ((lineInfo && (lineInfo.offset === 0))) { + deleteLength += lineInfo.text.length; + if (newText) { + newText = newText + lineInfo.text; + } + else { + newText = lineInfo.text; + } + } + } + if (pos < this.root.charCount()) { + this.root.walk(pos, deleteLength, walker); + walker.insertLines(newText); + } + if (this.checkEdits) { + var updatedText = this.getText(0, this.root.charCount()); + ts.Debug.assert(checkText === updatedText, "buffer edit mismatch"); + } + return walker.lineIndex; + } + }; + LineIndex.buildTreeFromBottom = function (nodes) { + var nodeCount = Math.ceil(nodes.length / lineCollectionCapacity); + var interiorNodes = []; + var nodeIndex = 0; + for (var i = 0; i < nodeCount; i++) { + interiorNodes[i] = new LineNode(); + var charCount = 0; + var lineCount = 0; + for (var j = 0; j < lineCollectionCapacity; j++) { + if (nodeIndex < nodes.length) { + interiorNodes[i].add(nodes[nodeIndex]); + charCount += nodes[nodeIndex].charCount(); + lineCount += nodes[nodeIndex].lineCount(); + } + else { + break; + } + nodeIndex++; + } + interiorNodes[i].totalChars = charCount; + interiorNodes[i].totalLines = lineCount; + } + if (interiorNodes.length === 1) { + return interiorNodes[0]; + } + else { + return this.buildTreeFromBottom(interiorNodes); + } + }; + LineIndex.linesFromText = function (text) { + var lineStarts = ts.computeLineStarts(text); + if (lineStarts.length === 0) { + return { lines: [], lineMap: lineStarts }; + } + var lines = new Array(lineStarts.length); + var lc = lineStarts.length - 1; + for (var lmi = 0; lmi < lc; lmi++) { + lines[lmi] = text.substring(lineStarts[lmi], lineStarts[lmi + 1]); + } + var endText = text.substring(lineStarts[lc]); + if (endText.length > 0) { + lines[lc] = endText; + } + else { + lines.length--; + } + return { lines: lines, lineMap: lineStarts }; + }; + return LineIndex; + }()); + server.LineIndex = LineIndex; + var LineNode = (function () { + function LineNode() { + this.totalChars = 0; + this.totalLines = 0; + this.children = []; + } + LineNode.prototype.isLeaf = function () { + return false; + }; + LineNode.prototype.updateCounts = function () { + this.totalChars = 0; + this.totalLines = 0; + for (var _i = 0, _a = this.children; _i < _a.length; _i++) { + var child = _a[_i]; + this.totalChars += child.charCount(); + this.totalLines += child.lineCount(); + } + }; + LineNode.prototype.execWalk = function (rangeStart, rangeLength, walkFns, childIndex, nodeType) { + if (walkFns.pre) { + walkFns.pre(rangeStart, rangeLength, this.children[childIndex], this, nodeType); + } + if (walkFns.goSubtree) { + this.children[childIndex].walk(rangeStart, rangeLength, walkFns); + if (walkFns.post) { + walkFns.post(rangeStart, rangeLength, this.children[childIndex], this, nodeType); + } + } + else { + walkFns.goSubtree = true; + } + return walkFns.done; + }; + LineNode.prototype.skipChild = function (relativeStart, relativeLength, childIndex, walkFns, nodeType) { + if (walkFns.pre && (!walkFns.done)) { + walkFns.pre(relativeStart, relativeLength, this.children[childIndex], this, nodeType); + walkFns.goSubtree = true; + } + }; + LineNode.prototype.walk = function (rangeStart, rangeLength, walkFns) { + var childIndex = 0; + var child = this.children[0]; + var childCharCount = child.charCount(); + var adjustedStart = rangeStart; + while (adjustedStart >= childCharCount) { + this.skipChild(adjustedStart, rangeLength, childIndex, walkFns, CharRangeSection.PreStart); + adjustedStart -= childCharCount; + childIndex++; + child = this.children[childIndex]; + childCharCount = child.charCount(); + } + if ((adjustedStart + rangeLength) <= childCharCount) { + if (this.execWalk(adjustedStart, rangeLength, walkFns, childIndex, CharRangeSection.Entire)) { + return; + } + } + else { + if (this.execWalk(adjustedStart, childCharCount - adjustedStart, walkFns, childIndex, CharRangeSection.Start)) { + return; + } + var adjustedLength = rangeLength - (childCharCount - adjustedStart); + childIndex++; + child = this.children[childIndex]; + childCharCount = child.charCount(); + while (adjustedLength > childCharCount) { + if (this.execWalk(0, childCharCount, walkFns, childIndex, CharRangeSection.Mid)) { + return; + } + adjustedLength -= childCharCount; + childIndex++; + child = this.children[childIndex]; + childCharCount = child.charCount(); + } + if (adjustedLength > 0) { + if (this.execWalk(0, adjustedLength, walkFns, childIndex, CharRangeSection.End)) { + return; + } + } + } + if (walkFns.pre) { + var clen = this.children.length; + if (childIndex < (clen - 1)) { + for (var ej = childIndex + 1; ej < clen; ej++) { + this.skipChild(0, 0, ej, walkFns, CharRangeSection.PostEnd); + } + } + } + }; + LineNode.prototype.charOffsetToLineNumberAndPos = function (lineNumber, charOffset) { + var childInfo = this.childFromCharOffset(lineNumber, charOffset); + if (!childInfo.child) { + return { + line: lineNumber, + offset: charOffset, + }; + } + else if (childInfo.childIndex < this.children.length) { + if (childInfo.child.isLeaf()) { + return { + line: childInfo.lineNumber, + offset: childInfo.charOffset, + text: (childInfo.child).text, + leaf: (childInfo.child) + }; + } + else { + var lineNode = (childInfo.child); + return lineNode.charOffsetToLineNumberAndPos(childInfo.lineNumber, childInfo.charOffset); + } + } + else { + var lineInfo = this.lineNumberToInfo(this.lineCount(), 0); + return { line: this.lineCount(), offset: lineInfo.leaf.charCount() }; + } + }; + LineNode.prototype.lineNumberToInfo = function (lineNumber, charOffset) { + var childInfo = this.childFromLineNumber(lineNumber, charOffset); + if (!childInfo.child) { + return { + line: lineNumber, + offset: charOffset + }; + } + else if (childInfo.child.isLeaf()) { + return { + line: lineNumber, + offset: childInfo.charOffset, + text: (childInfo.child).text, + leaf: (childInfo.child) + }; + } + else { + var lineNode = (childInfo.child); + return lineNode.lineNumberToInfo(childInfo.relativeLineNumber, childInfo.charOffset); + } + }; + LineNode.prototype.childFromLineNumber = function (lineNumber, charOffset) { + var child; + var relativeLineNumber = lineNumber; + var i; + var len; + for (i = 0, len = this.children.length; i < len; i++) { + child = this.children[i]; + var childLineCount = child.lineCount(); + if (childLineCount >= relativeLineNumber) { + break; + } + else { + relativeLineNumber -= childLineCount; + charOffset += child.charCount(); + } + } + return { + child: child, + childIndex: i, + relativeLineNumber: relativeLineNumber, + charOffset: charOffset + }; + }; + LineNode.prototype.childFromCharOffset = function (lineNumber, charOffset) { + var child; + var i; + var len; + for (i = 0, len = this.children.length; i < len; i++) { + child = this.children[i]; + if (child.charCount() > charOffset) { + break; + } + else { + charOffset -= child.charCount(); + lineNumber += child.lineCount(); + } + } + return { + child: child, + childIndex: i, + charOffset: charOffset, + lineNumber: lineNumber + }; + }; + LineNode.prototype.splitAfter = function (childIndex) { + var splitNode; + var clen = this.children.length; + childIndex++; + var endLength = childIndex; + if (childIndex < clen) { + splitNode = new LineNode(); + while (childIndex < clen) { + splitNode.add(this.children[childIndex]); + childIndex++; + } + splitNode.updateCounts(); + } + this.children.length = endLength; + return splitNode; + }; + LineNode.prototype.remove = function (child) { + var childIndex = this.findChildIndex(child); + var clen = this.children.length; + if (childIndex < (clen - 1)) { + for (var i = childIndex; i < (clen - 1); i++) { + this.children[i] = this.children[i + 1]; + } + } + this.children.length--; + }; + LineNode.prototype.findChildIndex = function (child) { + var childIndex = 0; + var clen = this.children.length; + while ((this.children[childIndex] !== child) && (childIndex < clen)) + childIndex++; + return childIndex; + }; + LineNode.prototype.insertAt = function (child, nodes) { + var childIndex = this.findChildIndex(child); + var clen = this.children.length; + var nodeCount = nodes.length; + if ((clen < lineCollectionCapacity) && (childIndex === (clen - 1)) && (nodeCount === 1)) { + this.add(nodes[0]); + this.updateCounts(); + return []; + } + else { + var shiftNode = this.splitAfter(childIndex); + var nodeIndex = 0; + childIndex++; + while ((childIndex < lineCollectionCapacity) && (nodeIndex < nodeCount)) { + this.children[childIndex] = nodes[nodeIndex]; + childIndex++; + nodeIndex++; + } + var splitNodes = []; + var splitNodeCount = 0; + if (nodeIndex < nodeCount) { + splitNodeCount = Math.ceil((nodeCount - nodeIndex) / lineCollectionCapacity); + splitNodes = new Array(splitNodeCount); + var splitNodeIndex = 0; + for (var i = 0; i < splitNodeCount; i++) { + splitNodes[i] = new LineNode(); + } + var splitNode = splitNodes[0]; + while (nodeIndex < nodeCount) { + splitNode.add(nodes[nodeIndex]); + nodeIndex++; + if (splitNode.children.length === lineCollectionCapacity) { + splitNodeIndex++; + splitNode = splitNodes[splitNodeIndex]; + } + } + for (var i = splitNodes.length - 1; i >= 0; i--) { + if (splitNodes[i].children.length === 0) { + splitNodes.length--; + } + } + } + if (shiftNode) { + splitNodes[splitNodes.length] = shiftNode; + } + this.updateCounts(); + for (var i = 0; i < splitNodeCount; i++) { + splitNodes[i].updateCounts(); + } + return splitNodes; + } + }; + LineNode.prototype.add = function (collection) { + this.children[this.children.length] = collection; + return (this.children.length < lineCollectionCapacity); + }; + LineNode.prototype.charCount = function () { + return this.totalChars; + }; + LineNode.prototype.lineCount = function () { + return this.totalLines; + }; + return LineNode; + }()); + server.LineNode = LineNode; + var LineLeaf = (function () { + function LineLeaf(text) { + this.text = text; + } + LineLeaf.prototype.isLeaf = function () { + return true; + }; + LineLeaf.prototype.walk = function (rangeStart, rangeLength, walkFns) { + walkFns.leaf(rangeStart, rangeLength, this); + }; + LineLeaf.prototype.charCount = function () { + return this.text.length; + }; + LineLeaf.prototype.lineCount = function () { + return 1; + }; + return LineLeaf; + }()); + server.LineLeaf = LineLeaf; + })(server = ts.server || (ts.server = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var server; + (function (server) { + var net = require("net"); + var childProcess = require("child_process"); + var os = require("os"); + function getGlobalTypingsCacheLocation() { + switch (process.platform) { + case "win32": { + var basePath = process.env.LOCALAPPDATA || + process.env.APPDATA || + (os.homedir && os.homedir()) || + process.env.USERPROFILE || + (process.env.HOMEDRIVE && process.env.HOMEPATH && ts.normalizeSlashes(process.env.HOMEDRIVE + process.env.HOMEPATH)) || + os.tmpdir(); + return ts.combinePaths(ts.normalizeSlashes(basePath), "Microsoft/TypeScript"); + } + case "darwin": + case "linux": + case "android": { + var cacheLocation = getNonWindowsCacheLocation(process.platform === "darwin"); + return ts.combinePaths(cacheLocation, "typescript"); + } + default: + ts.Debug.fail("unsupported platform '" + process.platform + "'"); + return; + } + } + function getNonWindowsCacheLocation(platformIsDarwin) { + if (process.env.XDG_CACHE_HOME) { + return process.env.XDG_CACHE_HOME; + } + var usersDir = platformIsDarwin ? "Users" : "home"; + var homePath = (os.homedir && os.homedir()) || + process.env.HOME || + ((process.env.LOGNAME || process.env.USER) && "/" + usersDir + "/" + (process.env.LOGNAME || process.env.USER)) || + os.tmpdir(); + var cacheFolder = platformIsDarwin + ? "Library/Caches" + : ".cache"; + return ts.combinePaths(ts.normalizeSlashes(homePath), cacheFolder); + } + var readline = require("readline"); + var fs = require("fs"); + var rl = readline.createInterface({ + input: process.stdin, + output: process.stdout, + terminal: false, + }); + var Logger = (function () { + function Logger(logFilename, traceToConsole, level) { + this.logFilename = logFilename; + this.traceToConsole = traceToConsole; + this.level = level; + this.fd = -1; + this.seq = 0; + this.inGroup = false; + this.firstInGroup = true; + if (this.logFilename) { + try { + this.fd = fs.openSync(this.logFilename, "w"); + } + catch (_) { + } + } + } + Logger.padStringRight = function (str, padding) { + return (str + padding).slice(0, padding.length); + }; + Logger.prototype.close = function () { + if (this.fd >= 0) { + fs.close(this.fd); + } + }; + Logger.prototype.getLogFileName = function () { + return this.logFilename; + }; + Logger.prototype.perftrc = function (s) { + this.msg(s, server.Msg.Perf); + }; + Logger.prototype.info = function (s) { + this.msg(s, server.Msg.Info); + }; + Logger.prototype.startGroup = function () { + this.inGroup = true; + this.firstInGroup = true; + }; + Logger.prototype.endGroup = function () { + this.inGroup = false; + this.seq++; + this.firstInGroup = true; + }; + Logger.prototype.loggingEnabled = function () { + return !!this.logFilename || this.traceToConsole; + }; + Logger.prototype.hasLevel = function (level) { + return this.loggingEnabled() && this.level >= level; + }; + Logger.prototype.msg = function (s, type) { + if (type === void 0) { type = server.Msg.Err; } + if (this.fd >= 0 || this.traceToConsole) { + s = s + "\n"; + var prefix = Logger.padStringRight(type + " " + this.seq.toString(), " "); + if (this.firstInGroup) { + s = prefix + s; + this.firstInGroup = false; + } + if (!this.inGroup) { + this.seq++; + this.firstInGroup = true; + } + if (this.fd >= 0) { + var buf = new Buffer(s); + fs.writeSync(this.fd, buf, 0, buf.length, null); + } + if (this.traceToConsole) { + console.warn(s); + } + } + }; + return Logger; + }()); + var NodeTypingsInstaller = (function () { + function NodeTypingsInstaller(telemetryEnabled, logger, host, eventPort, globalTypingsCacheLocation, typingSafeListLocation, newLine) { + var _this = this; + this.telemetryEnabled = telemetryEnabled; + this.logger = logger; + this.globalTypingsCacheLocation = globalTypingsCacheLocation; + this.typingSafeListLocation = typingSafeListLocation; + this.newLine = newLine; + this.installerPidReported = false; + this.throttledOperations = new server.ThrottledOperations(host); + if (eventPort) { + var s_1 = net.connect({ port: eventPort }, function () { + _this.socket = s_1; + _this.reportInstallerProcessId(); + }); + } + } + NodeTypingsInstaller.prototype.reportInstallerProcessId = function () { + if (this.installerPidReported) { + return; + } + if (this.socket && this.installer) { + this.sendEvent(0, "typingsInstallerPid", { pid: this.installer.pid }); + this.installerPidReported = true; + } + }; + NodeTypingsInstaller.prototype.sendEvent = function (seq, event, body) { + this.socket.write(server.formatMessage({ seq: seq, type: "event", event: event, body: body }, this.logger, Buffer.byteLength, this.newLine), "utf8"); + }; + NodeTypingsInstaller.prototype.setTelemetrySender = function (telemetrySender) { + this.eventSender = telemetrySender; + }; + NodeTypingsInstaller.prototype.attach = function (projectService) { + var _this = this; + this.projectService = projectService; + if (this.logger.hasLevel(server.LogLevel.requestTime)) { + this.logger.info("Binding..."); + } + var args = [server.Arguments.GlobalCacheLocation, this.globalTypingsCacheLocation]; + if (this.telemetryEnabled) { + args.push(server.Arguments.EnableTelemetry); + } + if (this.logger.loggingEnabled() && this.logger.getLogFileName()) { + args.push(server.Arguments.LogFile, ts.combinePaths(ts.getDirectoryPath(ts.normalizeSlashes(this.logger.getLogFileName())), "ti-" + process.pid + ".log")); + } + if (this.typingSafeListLocation) { + args.push(server.Arguments.TypingSafeListLocation, this.typingSafeListLocation); + } + var execArgv = []; + { + for (var _i = 0, _a = process.execArgv; _i < _a.length; _i++) { + var arg = _a[_i]; + var match = /^--(debug|inspect)(=(\d+))?$/.exec(arg); + if (match) { + var currentPort = match[3] !== undefined + ? +match[3] + : match[1] === "debug" ? 5858 : 9229; + execArgv.push("--" + match[1] + "=" + (currentPort + 1)); + break; + } + } + } + this.installer = childProcess.fork(ts.combinePaths(__dirname, "typingsInstaller.js"), args, { execArgv: execArgv }); + this.installer.on("message", function (m) { return _this.handleMessage(m); }); + this.reportInstallerProcessId(); + process.on("exit", function () { + _this.installer.kill(); + }); + }; + NodeTypingsInstaller.prototype.onProjectClosed = function (p) { + this.installer.send({ projectName: p.getProjectName(), kind: "closeProject" }); + }; + NodeTypingsInstaller.prototype.enqueueInstallTypingsRequest = function (project, typeAcquisition, unresolvedImports) { + var _this = this; + var request = server.createInstallTypingsRequest(project, typeAcquisition, unresolvedImports); + if (this.logger.hasLevel(server.LogLevel.verbose)) { + if (this.logger.hasLevel(server.LogLevel.verbose)) { + this.logger.info("Scheduling throttled operation: " + JSON.stringify(request)); + } + } + this.throttledOperations.schedule(project.getProjectName(), 250, function () { + if (_this.logger.hasLevel(server.LogLevel.verbose)) { + _this.logger.info("Sending request: " + JSON.stringify(request)); + } + _this.installer.send(request); + }); + }; + NodeTypingsInstaller.prototype.handleMessage = function (response) { + if (this.logger.hasLevel(server.LogLevel.verbose)) { + this.logger.info("Received response: " + JSON.stringify(response)); + } + if (response.kind === server.EventInitializationFailed) { + if (!this.eventSender) { + return; + } + var body = { + message: response.message + }; + var eventName = "typesInstallerInitializationFailed"; + this.eventSender.event(body, eventName); + return; + } + if (response.kind === server.EventBeginInstallTypes) { + if (!this.eventSender) { + return; + } + var body = { + eventId: response.eventId, + packages: response.packagesToInstall, + }; + var eventName = "beginInstallTypes"; + this.eventSender.event(body, eventName); + return; + } + if (response.kind === server.EventEndInstallTypes) { + if (!this.eventSender) { + return; + } + if (this.telemetryEnabled) { + var body_1 = { + telemetryEventName: "typingsInstalled", + payload: { + installedPackages: response.packagesToInstall.join(","), + installSuccess: response.installSuccess, + typingsInstallerVersion: response.typingsInstallerVersion + } + }; + var eventName_1 = "telemetry"; + this.eventSender.event(body_1, eventName_1); + } + var body = { + eventId: response.eventId, + packages: response.packagesToInstall, + success: response.installSuccess, + }; + var eventName = "endInstallTypes"; + this.eventSender.event(body, eventName); + return; + } + this.projectService.updateTypingsForProject(response); + if (response.kind === server.ActionSet && this.socket) { + this.sendEvent(0, "setTypings", response); + } + }; + return NodeTypingsInstaller; + }()); + var IOSession = (function (_super) { + __extends(IOSession, _super); + function IOSession(options) { + var _this = this; + var host = options.host, installerEventPort = options.installerEventPort, globalTypingsCacheLocation = options.globalTypingsCacheLocation, typingSafeListLocation = options.typingSafeListLocation, canUseEvents = options.canUseEvents; + var typingsInstaller = disableAutomaticTypingAcquisition + ? undefined + : new NodeTypingsInstaller(telemetryEnabled, logger, host, installerEventPort, globalTypingsCacheLocation, typingSafeListLocation, host.newLine); + _this = _super.call(this, { + host: host, + cancellationToken: cancellationToken, + useSingleInferredProject: useSingleInferredProject, + typingsInstaller: typingsInstaller || server.nullTypingsInstaller, + byteLength: Buffer.byteLength, + hrtime: process.hrtime, + logger: logger, + canUseEvents: canUseEvents, + globalPlugins: options.globalPlugins, + pluginProbeLocations: options.pluginProbeLocations + }) || this; + if (telemetryEnabled && typingsInstaller) { + typingsInstaller.setTelemetrySender(_this); + } + return _this; + } + IOSession.prototype.exit = function () { + this.logger.info("Exiting..."); + this.projectService.closeLog(); + process.exit(0); + }; + IOSession.prototype.listen = function () { + var _this = this; + rl.on("line", function (input) { + var message = input.trim(); + _this.onMessage(message); + }); + rl.on("close", function () { + _this.exit(); + }); + }; + return IOSession; + }(server.Session)); + function parseLoggingEnvironmentString(logEnvStr) { + if (!logEnvStr) { + return {}; + } + var logEnv = { logToFile: true }; + var args = logEnvStr.split(" "); + var len = args.length - 1; + for (var i = 0; i < len; i += 2) { + var option = args[i]; + var value = args[i + 1]; + if (option && value) { + switch (option) { + case "-file": + logEnv.file = ts.stripQuotes(value); + break; + case "-level": + var level = getLogLevel(value); + logEnv.detailLevel = level !== undefined ? level : server.LogLevel.normal; + break; + case "-traceToConsole": + logEnv.traceToConsole = value.toLowerCase() === "true"; + break; + case "-logToFile": + logEnv.logToFile = value.toLowerCase() === "true"; + break; + } + } + } + return logEnv; + } + function getLogLevel(level) { + if (level) { + var l = level.toLowerCase(); + for (var name in server.LogLevel) { + if (isNaN(+name) && l === name.toLowerCase()) { + return server.LogLevel[name]; + } + } + } + return undefined; + } + function createLogger() { + var cmdLineLogFileName = server.findArgument("--logFile"); + var cmdLineVerbosity = getLogLevel(server.findArgument("--logVerbosity")); + var envLogOptions = parseLoggingEnvironmentString(process.env["TSS_LOG"]); + var logFileName = cmdLineLogFileName + ? ts.stripQuotes(cmdLineLogFileName) + : envLogOptions.logToFile + ? envLogOptions.file || (__dirname + "/.log" + process.pid.toString()) + : undefined; + var logVerbosity = cmdLineVerbosity || envLogOptions.detailLevel; + return new Logger(logFileName, envLogOptions.traceToConsole, logVerbosity); + } + function createPollingWatchedFileSet(interval, chunkSize) { + if (interval === void 0) { interval = 2500; } + if (chunkSize === void 0) { chunkSize = 30; } + var watchedFiles = []; + var nextFileToCheck = 0; + var watchTimer; + function getModifiedTime(fileName) { + return fs.statSync(fileName).mtime; + } + function poll(checkedIndex) { + var watchedFile = watchedFiles[checkedIndex]; + if (!watchedFile) { + return; + } + fs.stat(watchedFile.fileName, function (err, stats) { + if (err) { + watchedFile.callback(watchedFile.fileName); + } + else if (watchedFile.mtime.getTime() !== stats.mtime.getTime()) { + watchedFile.mtime = getModifiedTime(watchedFile.fileName); + watchedFile.callback(watchedFile.fileName, watchedFile.mtime.getTime() === 0); + } + }); + } + function startWatchTimer() { + watchTimer = setInterval(function () { + var count = 0; + var nextToCheck = nextFileToCheck; + var firstCheck = -1; + while ((count < chunkSize) && (nextToCheck !== firstCheck)) { + poll(nextToCheck); + if (firstCheck < 0) { + firstCheck = nextToCheck; + } + nextToCheck++; + if (nextToCheck === watchedFiles.length) { + nextToCheck = 0; + } + count++; + } + nextFileToCheck = nextToCheck; + }, interval); + } + function addFile(fileName, callback) { + var file = { + fileName: fileName, + callback: callback, + mtime: getModifiedTime(fileName) + }; + watchedFiles.push(file); + if (watchedFiles.length === 1) { + startWatchTimer(); + } + return file; + } + function removeFile(file) { + ts.unorderedRemoveItem(watchedFiles, file); + } + return { + getModifiedTime: getModifiedTime, + poll: poll, + startWatchTimer: startWatchTimer, + addFile: addFile, + removeFile: removeFile + }; + } + var pollingWatchedFileSet = createPollingWatchedFileSet(); + var pending = []; + var canWrite = true; + function writeMessage(buf) { + if (!canWrite) { + pending.push(buf); + } + else { + canWrite = false; + process.stdout.write(buf, setCanWriteFlagAndWriteMessageIfNecessary); + } + } + function setCanWriteFlagAndWriteMessageIfNecessary() { + canWrite = true; + if (pending.length) { + writeMessage(pending.shift()); + } + } + function extractWatchDirectoryCacheKey(path, currentDriveKey) { + path = ts.normalizeSlashes(path); + if (isUNCPath(path)) { + var firstSlash = path.indexOf(ts.directorySeparator, 2); + return firstSlash !== -1 ? path.substring(0, firstSlash).toLowerCase() : path; + } + var rootLength = ts.getRootLength(path); + if (rootLength === 0) { + return currentDriveKey; + } + if (path.charCodeAt(1) === 58 && path.charCodeAt(2) === 47) { + return path.charAt(0).toLowerCase(); + } + if (path.charCodeAt(0) === 47 && path.charCodeAt(1) !== 47) { + return currentDriveKey; + } + return undefined; + } + function isUNCPath(s) { + return s.length > 2 && s.charCodeAt(0) === 47 && s.charCodeAt(1) === 47; + } + var logger = createLogger(); + var sys = ts.sys; + var useWatchGuard = process.platform === "win32" && ts.getNodeMajorVersion() >= 4; + if (useWatchGuard) { + var currentDrive_1 = extractWatchDirectoryCacheKey(sys.resolvePath(sys.getCurrentDirectory()), undefined); + var statusCache_1 = ts.createMap(); + var originalWatchDirectory_1 = sys.watchDirectory; + sys.watchDirectory = function (path, callback, recursive) { + var cacheKey = extractWatchDirectoryCacheKey(path, currentDrive_1); + var status = cacheKey && statusCache_1.get(cacheKey); + if (status === undefined) { + if (logger.hasLevel(server.LogLevel.verbose)) { + logger.info(cacheKey + " for path " + path + " not found in cache..."); + } + try { + var args = [ts.combinePaths(__dirname, "watchGuard.js"), path]; + if (logger.hasLevel(server.LogLevel.verbose)) { + logger.info("Starting " + process.execPath + " with args " + JSON.stringify(args)); + } + childProcess.execFileSync(process.execPath, args, { stdio: "ignore", env: { "ELECTRON_RUN_AS_NODE": "1" } }); + status = true; + if (logger.hasLevel(server.LogLevel.verbose)) { + logger.info("WatchGuard for path " + path + " returned: OK"); + } + } + catch (e) { + status = false; + if (logger.hasLevel(server.LogLevel.verbose)) { + logger.info("WatchGuard for path " + path + " returned: " + e.message); + } + } + if (cacheKey) { + statusCache_1.set(cacheKey, status); + } + } + else if (logger.hasLevel(server.LogLevel.verbose)) { + logger.info("watchDirectory for " + path + " uses cached drive information."); + } + if (status) { + return originalWatchDirectory_1.call(sys, path, callback, recursive); + } + else { + return { close: function () { } }; + } + }; + } + sys.write = function (s) { return writeMessage(new Buffer(s, "utf8")); }; + sys.watchFile = function (fileName, callback) { + var watchedFile = pollingWatchedFileSet.addFile(fileName, callback); + return { + close: function () { return pollingWatchedFileSet.removeFile(watchedFile); } + }; + }; + sys.setTimeout = setTimeout; + sys.clearTimeout = clearTimeout; + sys.setImmediate = setImmediate; + sys.clearImmediate = clearImmediate; + if (typeof global !== "undefined" && global.gc) { + sys.gc = function () { return global.gc(); }; + } + sys.require = function (initialDir, moduleName) { + var result = ts.nodeModuleNameResolverWorker(moduleName, initialDir + "/program.ts", { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, sys, undefined, true); + try { + return { module: require(result.resolvedModule.resolvedFileName), error: undefined }; + } + catch (e) { + return { module: undefined, error: e }; + } + }; + var cancellationToken; + try { + var factory = require("./cancellationToken"); + cancellationToken = factory(sys.args); + } + catch (e) { + cancellationToken = server.nullCancellationToken; + } + var eventPort; + { + var str = server.findArgument("--eventPort"); + var v = str && parseInt(str); + if (!isNaN(v)) { + eventPort = v; + } + } + var localeStr = server.findArgument("--locale"); + if (localeStr) { + ts.validateLocaleAndSetLanguage(localeStr, sys); + } + var typingSafeListLocation = server.findArgument("--typingSafeListLocation"); + var globalPlugins = (server.findArgument("--globalPlugins") || "").split(","); + var pluginProbeLocations = (server.findArgument("--pluginProbeLocations") || "").split(","); + var useSingleInferredProject = server.hasArgument("--useSingleInferredProject"); + var disableAutomaticTypingAcquisition = server.hasArgument("--disableAutomaticTypingAcquisition"); + var telemetryEnabled = server.hasArgument(server.Arguments.EnableTelemetry); + var options = { + host: sys, + cancellationToken: cancellationToken, + installerEventPort: eventPort, + canUseEvents: eventPort === undefined, + useSingleInferredProject: useSingleInferredProject, + disableAutomaticTypingAcquisition: disableAutomaticTypingAcquisition, + globalTypingsCacheLocation: getGlobalTypingsCacheLocation(), + typingSafeListLocation: typingSafeListLocation, + telemetryEnabled: telemetryEnabled, + logger: logger, + globalPlugins: globalPlugins, + pluginProbeLocations: pluginProbeLocations + }; + var ioSession = new IOSession(options); + process.on("uncaughtException", function (err) { + ioSession.logError(err, "unknown"); + }); + process.noAsar = true; + ioSession.listen(); + })(server = ts.server || (ts.server = {})); +})(ts || (ts = {})); diff --git a/node_modules/typescript/lib/tsserverlibrary.d.ts b/node_modules/typescript/lib/tsserverlibrary.d.ts index 3f46cb68b..44bd394e3 100644 --- a/node_modules/typescript/lib/tsserverlibrary.d.ts +++ b/node_modules/typescript/lib/tsserverlibrary.d.ts @@ -1,857 +1,42 @@ -/// -declare namespace ts.server.protocol { - namespace CommandTypes { - type Brace = "brace"; - type BraceFull = "brace-full"; - type BraceCompletion = "braceCompletion"; - type Change = "change"; - type Close = "close"; - type Completions = "completions"; - type CompletionsFull = "completions-full"; - type CompletionDetails = "completionEntryDetails"; - type CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList"; - type CompileOnSaveEmitFile = "compileOnSaveEmitFile"; - type Configure = "configure"; - type Definition = "definition"; - type DefinitionFull = "definition-full"; - type Implementation = "implementation"; - type ImplementationFull = "implementation-full"; - type Exit = "exit"; - type Format = "format"; - type Formatonkey = "formatonkey"; - type FormatFull = "format-full"; - type FormatonkeyFull = "formatonkey-full"; - type FormatRangeFull = "formatRange-full"; - type Geterr = "geterr"; - type GeterrForProject = "geterrForProject"; - type SemanticDiagnosticsSync = "semanticDiagnosticsSync"; - type SyntacticDiagnosticsSync = "syntacticDiagnosticsSync"; - type NavBar = "navbar"; - type NavBarFull = "navbar-full"; - type Navto = "navto"; - type NavtoFull = "navto-full"; - type NavTree = "navtree"; - type NavTreeFull = "navtree-full"; - type Occurrences = "occurrences"; - type DocumentHighlights = "documentHighlights"; - type DocumentHighlightsFull = "documentHighlights-full"; - type Open = "open"; - type Quickinfo = "quickinfo"; - type QuickinfoFull = "quickinfo-full"; - type References = "references"; - type ReferencesFull = "references-full"; - type Reload = "reload"; - type Rename = "rename"; - type RenameInfoFull = "rename-full"; - type RenameLocationsFull = "renameLocations-full"; - type Saveto = "saveto"; - type SignatureHelp = "signatureHelp"; - type SignatureHelpFull = "signatureHelp-full"; - type TypeDefinition = "typeDefinition"; - type ProjectInfo = "projectInfo"; - type ReloadProjects = "reloadProjects"; - type Unknown = "unknown"; - type OpenExternalProject = "openExternalProject"; - type OpenExternalProjects = "openExternalProjects"; - type CloseExternalProject = "closeExternalProject"; - type SynchronizeProjectList = "synchronizeProjectList"; - type ApplyChangedToOpenFiles = "applyChangedToOpenFiles"; - type EncodedSemanticClassificationsFull = "encodedSemanticClassifications-full"; - type Cleanup = "cleanup"; - type OutliningSpans = "outliningSpans"; - type TodoComments = "todoComments"; - type Indentation = "indentation"; - type DocCommentTemplate = "docCommentTemplate"; - type CompilerOptionsDiagnosticsFull = "compilerOptionsDiagnostics-full"; - type NameOrDottedNameSpan = "nameOrDottedNameSpan"; - type BreakpointStatement = "breakpointStatement"; - type CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects"; - type GetCodeFixes = "getCodeFixes"; - type GetCodeFixesFull = "getCodeFixes-full"; - type GetSupportedCodeFixes = "getSupportedCodeFixes"; - } - interface Message { - seq: number; - type: "request" | "response" | "event"; - } - interface Request extends Message { - command: string; - arguments?: any; - } - interface ReloadProjectsRequest extends Message { - command: CommandTypes.ReloadProjects; - } - interface Event extends Message { - event: string; - body?: any; - } - interface Response extends Message { - request_seq: number; - success: boolean; - command: string; - message?: string; - body?: any; - } - interface FileRequestArgs { - file: string; - projectFileName?: string; - } - interface DocCommentTemplateRequest extends FileLocationRequest { - command: CommandTypes.DocCommentTemplate; - } - interface DocCommandTemplateResponse extends Response { - body?: TextInsertion; - } - interface TodoCommentRequest extends FileRequest { - command: CommandTypes.TodoComments; - arguments: TodoCommentRequestArgs; - } - interface TodoCommentRequestArgs extends FileRequestArgs { - descriptors: TodoCommentDescriptor[]; - } - interface TodoCommentsResponse extends Response { - body?: TodoComment[]; - } - interface OutliningSpansRequest extends FileRequest { - command: CommandTypes.OutliningSpans; - } - interface OutliningSpansResponse extends Response { - body?: OutliningSpan[]; - } - interface IndentationRequest extends FileLocationRequest { - command: CommandTypes.Indentation; - arguments: IndentationRequestArgs; - } - interface IndentationResponse extends Response { - body?: IndentationResult; - } - interface IndentationResult { - position: number; - indentation: number; - } - interface IndentationRequestArgs extends FileLocationRequestArgs { - options?: EditorSettings; - } - interface ProjectInfoRequestArgs extends FileRequestArgs { - needFileNameList: boolean; - } - interface ProjectInfoRequest extends Request { - command: CommandTypes.ProjectInfo; - arguments: ProjectInfoRequestArgs; - } - interface CompilerOptionsDiagnosticsRequest extends Request { - arguments: CompilerOptionsDiagnosticsRequestArgs; - } - interface CompilerOptionsDiagnosticsRequestArgs { - projectFileName: string; - } - interface ProjectInfo { - configFileName: string; - fileNames?: string[]; - languageServiceDisabled?: boolean; - } - interface DiagnosticWithLinePosition { - message: string; - start: number; - length: number; - startLocation: Location; - endLocation: Location; - category: string; - code: number; - } - interface ProjectInfoResponse extends Response { - body?: ProjectInfo; - } - interface FileRequest extends Request { - arguments: FileRequestArgs; - } - interface FileLocationRequestArgs extends FileRequestArgs { - line: number; - offset: number; - position?: number; - } - interface CodeFixRequest extends Request { - command: CommandTypes.GetCodeFixes; - arguments: CodeFixRequestArgs; - } - interface CodeFixRequestArgs extends FileRequestArgs { - startLine: number; - startOffset: number; - startPosition?: number; - endLine: number; - endOffset: number; - endPosition?: number; - errorCodes?: number[]; - } - interface GetCodeFixesResponse extends Response { - body?: CodeAction[]; - } - interface FileLocationRequest extends FileRequest { - arguments: FileLocationRequestArgs; - } - interface GetSupportedCodeFixesRequest extends Request { - command: CommandTypes.GetSupportedCodeFixes; - } - interface GetSupportedCodeFixesResponse extends Response { - body?: string[]; - } - interface EncodedSemanticClassificationsRequest extends FileRequest { - arguments: EncodedSemanticClassificationsRequestArgs; - } - interface EncodedSemanticClassificationsRequestArgs extends FileRequestArgs { - start: number; - length: number; - } - interface DocumentHighlightsRequestArgs extends FileLocationRequestArgs { - filesToSearch: string[]; - } - interface DefinitionRequest extends FileLocationRequest { - command: CommandTypes.Definition; - } - interface TypeDefinitionRequest extends FileLocationRequest { - command: CommandTypes.TypeDefinition; - } - interface ImplementationRequest extends FileLocationRequest { - command: CommandTypes.Implementation; - } - interface Location { - line: number; - offset: number; - } - interface TextSpan { - start: Location; - end: Location; - } - interface FileSpan extends TextSpan { - file: string; - } - interface DefinitionResponse extends Response { - body?: FileSpan[]; - } - interface TypeDefinitionResponse extends Response { - body?: FileSpan[]; - } - interface ImplementationResponse extends Response { - body?: FileSpan[]; - } - interface BraceCompletionRequest extends FileLocationRequest { - command: CommandTypes.BraceCompletion; - arguments: BraceCompletionRequestArgs; - } - interface BraceCompletionRequestArgs extends FileLocationRequestArgs { - openingBrace: string; - } - interface OccurrencesRequest extends FileLocationRequest { - command: CommandTypes.Occurrences; - } - interface OccurrencesResponseItem extends FileSpan { - isWriteAccess: boolean; - } - interface OccurrencesResponse extends Response { - body?: OccurrencesResponseItem[]; - } - interface DocumentHighlightsRequest extends FileLocationRequest { - command: CommandTypes.DocumentHighlights; - arguments: DocumentHighlightsRequestArgs; - } - interface HighlightSpan extends TextSpan { - kind: string; - } - interface DocumentHighlightsItem { - file: string; - highlightSpans: HighlightSpan[]; - } - interface DocumentHighlightsResponse extends Response { - body?: DocumentHighlightsItem[]; - } - interface ReferencesRequest extends FileLocationRequest { - command: CommandTypes.References; - } - interface ReferencesResponseItem extends FileSpan { - lineText: string; - isWriteAccess: boolean; - isDefinition: boolean; - } - interface ReferencesResponseBody { - refs: ReferencesResponseItem[]; - symbolName: string; - symbolStartOffset: number; - symbolDisplayString: string; - } - interface ReferencesResponse extends Response { - body?: ReferencesResponseBody; - } - interface RenameRequestArgs extends FileLocationRequestArgs { - findInComments?: boolean; - findInStrings?: boolean; - } - interface RenameRequest extends FileLocationRequest { - command: CommandTypes.Rename; - arguments: RenameRequestArgs; - } - interface RenameInfo { - canRename: boolean; - localizedErrorMessage?: string; - displayName: string; - fullDisplayName: string; - kind: string; - kindModifiers: string; - } - interface SpanGroup { - file: string; - locs: TextSpan[]; - } - interface RenameResponseBody { - info: RenameInfo; - locs: SpanGroup[]; - } - interface RenameResponse extends Response { - body?: RenameResponseBody; - } - interface ExternalFile { - fileName: string; - scriptKind?: ScriptKindName | ts.ScriptKind; - hasMixedContent?: boolean; - content?: string; - } - interface ExternalProject { - projectFileName: string; - rootFiles: ExternalFile[]; - options: ExternalProjectCompilerOptions; - typingOptions?: TypeAcquisition; - typeAcquisition?: TypeAcquisition; - } - interface CompileOnSaveMixin { - compileOnSave?: boolean; - } - type ExternalProjectCompilerOptions = CompilerOptions & CompileOnSaveMixin; - interface ProjectVersionInfo { - projectName: string; - isInferred: boolean; - version: number; - options: ts.CompilerOptions; - } - interface ProjectChanges { - added: string[]; - removed: string[]; - } - interface ProjectFiles { - info?: ProjectVersionInfo; - files?: string[]; - changes?: ProjectChanges; - } - interface ProjectFilesWithDiagnostics extends ProjectFiles { - projectErrors: DiagnosticWithLinePosition[]; - } - interface ChangedOpenFile { - fileName: string; - changes: ts.TextChange[]; - } - interface ConfigureRequestArguments { - hostInfo?: string; - file?: string; - formatOptions?: FormatCodeSettings; - } - interface ConfigureRequest extends Request { - command: CommandTypes.Configure; - arguments: ConfigureRequestArguments; - } - interface ConfigureResponse extends Response { - } - interface OpenRequestArgs extends FileRequestArgs { - fileContent?: string; - scriptKindName?: ScriptKindName; - } - type ScriptKindName = "TS" | "JS" | "TSX" | "JSX"; - interface OpenRequest extends Request { - command: CommandTypes.Open; - arguments: OpenRequestArgs; - } - interface OpenExternalProjectRequest extends Request { - command: CommandTypes.OpenExternalProject; - arguments: OpenExternalProjectArgs; - } - type OpenExternalProjectArgs = ExternalProject; - interface OpenExternalProjectsRequest extends Request { - command: CommandTypes.OpenExternalProjects; - arguments: OpenExternalProjectsArgs; - } - interface OpenExternalProjectsArgs { - projects: ExternalProject[]; - } - interface OpenExternalProjectResponse extends Response { - } - interface OpenExternalProjectsResponse extends Response { - } - interface CloseExternalProjectRequest extends Request { - command: CommandTypes.CloseExternalProject; - arguments: CloseExternalProjectRequestArgs; - } - interface CloseExternalProjectRequestArgs { - projectFileName: string; - } - interface CloseExternalProjectResponse extends Response { - } - interface SynchronizeProjectListRequest extends Request { - arguments: SynchronizeProjectListRequestArgs; - } - interface SynchronizeProjectListRequestArgs { - knownProjects: protocol.ProjectVersionInfo[]; - } - interface ApplyChangedToOpenFilesRequest extends Request { - arguments: ApplyChangedToOpenFilesRequestArgs; - } - interface ApplyChangedToOpenFilesRequestArgs { - openFiles?: ExternalFile[]; - changedFiles?: ChangedOpenFile[]; - closedFiles?: string[]; - } - interface SetCompilerOptionsForInferredProjectsRequest extends Request { - command: CommandTypes.CompilerOptionsForInferredProjects; - arguments: SetCompilerOptionsForInferredProjectsArgs; - } - interface SetCompilerOptionsForInferredProjectsArgs { - options: ExternalProjectCompilerOptions; - } - interface SetCompilerOptionsForInferredProjectsResponse extends Response { - } - interface ExitRequest extends Request { - command: CommandTypes.Exit; - } - interface CloseRequest extends FileRequest { - command: CommandTypes.Close; - } - interface CompileOnSaveAffectedFileListRequest extends FileRequest { - command: CommandTypes.CompileOnSaveAffectedFileList; - } - interface CompileOnSaveAffectedFileListSingleProject { - projectFileName: string; - fileNames: string[]; - } - interface CompileOnSaveAffectedFileListResponse extends Response { - body: CompileOnSaveAffectedFileListSingleProject[]; - } - interface CompileOnSaveEmitFileRequest extends FileRequest { - command: CommandTypes.CompileOnSaveEmitFile; - arguments: CompileOnSaveEmitFileRequestArgs; - } - interface CompileOnSaveEmitFileRequestArgs extends FileRequestArgs { - forced?: boolean; - } - interface QuickInfoRequest extends FileLocationRequest { - command: CommandTypes.Quickinfo; - } - interface QuickInfoResponseBody { - kind: string; - kindModifiers: string; - start: Location; - end: Location; - displayString: string; - documentation: string; - } - interface QuickInfoResponse extends Response { - body?: QuickInfoResponseBody; - } - interface FormatRequestArgs extends FileLocationRequestArgs { - endLine: number; - endOffset: number; - endPosition?: number; - options?: FormatCodeSettings; - } - interface FormatRequest extends FileLocationRequest { - command: CommandTypes.Format; - arguments: FormatRequestArgs; - } - interface CodeEdit { - start: Location; - end: Location; - newText: string; - } - interface FileCodeEdits { - fileName: string; - textChanges: CodeEdit[]; - } - interface CodeFixResponse extends Response { - body?: CodeAction[]; - } - interface CodeAction { - description: string; - changes: FileCodeEdits[]; - } - interface FormatResponse extends Response { - body?: CodeEdit[]; - } - interface FormatOnKeyRequestArgs extends FileLocationRequestArgs { - key: string; - options?: FormatCodeSettings; - } - interface FormatOnKeyRequest extends FileLocationRequest { - command: CommandTypes.Formatonkey; - arguments: FormatOnKeyRequestArgs; - } - interface CompletionsRequestArgs extends FileLocationRequestArgs { - prefix?: string; - } - interface CompletionsRequest extends FileLocationRequest { - command: CommandTypes.Completions; - arguments: CompletionsRequestArgs; - } - interface CompletionDetailsRequestArgs extends FileLocationRequestArgs { - entryNames: string[]; - } - interface CompletionDetailsRequest extends FileLocationRequest { - command: CommandTypes.CompletionDetails; - arguments: CompletionDetailsRequestArgs; - } - interface SymbolDisplayPart { - text: string; - kind: string; - } - interface CompletionEntry { - name: string; - kind: string; - kindModifiers: string; - sortText: string; - replacementSpan?: TextSpan; - } - interface CompletionEntryDetails { - name: string; - kind: string; - kindModifiers: string; - displayParts: SymbolDisplayPart[]; - documentation: SymbolDisplayPart[]; - } - interface CompletionsResponse extends Response { - body?: CompletionEntry[]; - } - interface CompletionDetailsResponse extends Response { - body?: CompletionEntryDetails[]; - } - interface SignatureHelpParameter { - name: string; - documentation: SymbolDisplayPart[]; - displayParts: SymbolDisplayPart[]; - isOptional: boolean; - } - interface SignatureHelpItem { - isVariadic: boolean; - prefixDisplayParts: SymbolDisplayPart[]; - suffixDisplayParts: SymbolDisplayPart[]; - separatorDisplayParts: SymbolDisplayPart[]; - parameters: SignatureHelpParameter[]; - documentation: SymbolDisplayPart[]; - } - interface SignatureHelpItems { - items: SignatureHelpItem[]; - applicableSpan: TextSpan; - selectedItemIndex: number; - argumentIndex: number; - argumentCount: number; - } - interface SignatureHelpRequestArgs extends FileLocationRequestArgs { - } - interface SignatureHelpRequest extends FileLocationRequest { - command: CommandTypes.SignatureHelp; - arguments: SignatureHelpRequestArgs; - } - interface SignatureHelpResponse extends Response { - body?: SignatureHelpItems; - } - interface SemanticDiagnosticsSyncRequest extends FileRequest { - command: CommandTypes.SemanticDiagnosticsSync; - arguments: SemanticDiagnosticsSyncRequestArgs; - } - interface SemanticDiagnosticsSyncRequestArgs extends FileRequestArgs { - includeLinePosition?: boolean; - } - interface SemanticDiagnosticsSyncResponse extends Response { - body?: Diagnostic[] | DiagnosticWithLinePosition[]; - } - interface SyntacticDiagnosticsSyncRequest extends FileRequest { - command: CommandTypes.SyntacticDiagnosticsSync; - arguments: SyntacticDiagnosticsSyncRequestArgs; - } - interface SyntacticDiagnosticsSyncRequestArgs extends FileRequestArgs { - includeLinePosition?: boolean; - } - interface SyntacticDiagnosticsSyncResponse extends Response { - body?: Diagnostic[] | DiagnosticWithLinePosition[]; - } - interface GeterrForProjectRequestArgs { - file: string; - delay: number; - } - interface GeterrForProjectRequest extends Request { - command: CommandTypes.GeterrForProject; - arguments: GeterrForProjectRequestArgs; - } - interface GeterrRequestArgs { - files: string[]; - delay: number; - } - interface GeterrRequest extends Request { - command: CommandTypes.Geterr; - arguments: GeterrRequestArgs; - } - interface Diagnostic { - start: Location; - end: Location; - text: string; - code?: number; - } - interface DiagnosticEventBody { - file: string; - diagnostics: Diagnostic[]; - } - interface DiagnosticEvent extends Event { - body?: DiagnosticEventBody; - } - interface ConfigFileDiagnosticEventBody { - triggerFile: string; - configFile: string; - diagnostics: Diagnostic[]; - } - interface ConfigFileDiagnosticEvent extends Event { - body?: ConfigFileDiagnosticEventBody; - event: "configFileDiag"; - } - type ProjectLanguageServiceStateEventName = "projectLanguageServiceState"; - interface ProjectLanguageServiceStateEvent extends Event { - event: ProjectLanguageServiceStateEventName; - body?: ProjectLanguageServiceStateEventBody; - } - interface ProjectLanguageServiceStateEventBody { - projectName: string; - languageServiceEnabled: boolean; - } - interface ReloadRequestArgs extends FileRequestArgs { - tmpfile: string; - } - interface ReloadRequest extends FileRequest { - command: CommandTypes.Reload; - arguments: ReloadRequestArgs; - } - interface ReloadResponse extends Response { - } - interface SavetoRequestArgs extends FileRequestArgs { - tmpfile: string; - } - interface SavetoRequest extends FileRequest { - command: CommandTypes.Saveto; - arguments: SavetoRequestArgs; - } - interface NavtoRequestArgs extends FileRequestArgs { - searchValue: string; - maxResultCount?: number; - currentFileOnly?: boolean; - projectFileName?: string; - } - interface NavtoRequest extends FileRequest { - command: CommandTypes.Navto; - arguments: NavtoRequestArgs; - } - interface NavtoItem { - name: string; - kind: string; - matchKind?: string; - isCaseSensitive?: boolean; - kindModifiers?: string; - file: string; - start: Location; - end: Location; - containerName?: string; - containerKind?: string; - } - interface NavtoResponse extends Response { - body?: NavtoItem[]; - } - interface ChangeRequestArgs extends FormatRequestArgs { - insertString?: string; - } - interface ChangeRequest extends FileLocationRequest { - command: CommandTypes.Change; - arguments: ChangeRequestArgs; - } - interface BraceResponse extends Response { - body?: TextSpan[]; - } - interface BraceRequest extends FileLocationRequest { - command: CommandTypes.Brace; - } - interface NavBarRequest extends FileRequest { - command: CommandTypes.NavBar; - } - interface NavTreeRequest extends FileRequest { - command: CommandTypes.NavTree; - } - interface NavigationBarItem { - text: string; - kind: string; - kindModifiers?: string; - spans: TextSpan[]; - childItems?: NavigationBarItem[]; - indent: number; - } - interface NavigationTree { - text: string; - kind: string; - kindModifiers: string; - spans: TextSpan[]; - childItems?: NavigationTree[]; - } - type TelemetryEventName = "telemetry"; - interface TelemetryEvent extends Event { - event: TelemetryEventName; - body: TelemetryEventBody; - } - interface TelemetryEventBody { - telemetryEventName: string; - payload: any; - } - type TypingsInstalledTelemetryEventName = "typingsInstalled"; - interface TypingsInstalledTelemetryEventBody extends TelemetryEventBody { - telemetryEventName: TypingsInstalledTelemetryEventName; - payload: TypingsInstalledTelemetryEventPayload; - } - interface TypingsInstalledTelemetryEventPayload { - installedPackages: string; - installSuccess: boolean; - typingsInstallerVersion: string; - } - interface NavBarResponse extends Response { - body?: NavigationBarItem[]; - } - interface NavTreeResponse extends Response { - body?: NavigationTree; - } - namespace IndentStyle { - type None = "None"; - type Block = "Block"; - type Smart = "Smart"; - } - type IndentStyle = IndentStyle.None | IndentStyle.Block | IndentStyle.Smart; - interface EditorSettings { - baseIndentSize?: number; - indentSize?: number; - tabSize?: number; - newLineCharacter?: string; - convertTabsToSpaces?: boolean; - indentStyle?: IndentStyle | ts.IndentStyle; - } - interface FormatCodeSettings extends EditorSettings { - insertSpaceAfterCommaDelimiter?: boolean; - insertSpaceAfterSemicolonInForStatements?: boolean; - insertSpaceBeforeAndAfterBinaryOperators?: boolean; - insertSpaceAfterKeywordsInControlFlowStatements?: boolean; - insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean; - insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean; - insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean; - insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean; - insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean; - placeOpenBraceOnNewLineForFunctions?: boolean; - placeOpenBraceOnNewLineForControlBlocks?: boolean; - } - interface CompilerOptions { - allowJs?: boolean; - allowSyntheticDefaultImports?: boolean; - allowUnreachableCode?: boolean; - allowUnusedLabels?: boolean; - baseUrl?: string; - charset?: string; - declaration?: boolean; - declarationDir?: string; - disableSizeLimit?: boolean; - emitBOM?: boolean; - emitDecoratorMetadata?: boolean; - experimentalDecorators?: boolean; - forceConsistentCasingInFileNames?: boolean; - inlineSourceMap?: boolean; - inlineSources?: boolean; - isolatedModules?: boolean; - jsx?: JsxEmit | ts.JsxEmit; - lib?: string[]; - locale?: string; - mapRoot?: string; - maxNodeModuleJsDepth?: number; - module?: ModuleKind | ts.ModuleKind; - moduleResolution?: ModuleResolutionKind | ts.ModuleResolutionKind; - newLine?: NewLineKind | ts.NewLineKind; - noEmit?: boolean; - noEmitHelpers?: boolean; - noEmitOnError?: boolean; - noErrorTruncation?: boolean; - noFallthroughCasesInSwitch?: boolean; - noImplicitAny?: boolean; - noImplicitReturns?: boolean; - noImplicitThis?: boolean; - noUnusedLocals?: boolean; - noUnusedParameters?: boolean; - noImplicitUseStrict?: boolean; - noLib?: boolean; - noResolve?: boolean; - out?: string; - outDir?: string; - outFile?: string; - paths?: MapLike; - preserveConstEnums?: boolean; - project?: string; - reactNamespace?: string; - removeComments?: boolean; - rootDir?: string; - rootDirs?: string[]; - skipLibCheck?: boolean; - skipDefaultLibCheck?: boolean; - sourceMap?: boolean; - sourceRoot?: string; - strictNullChecks?: boolean; - suppressExcessPropertyErrors?: boolean; - suppressImplicitAnyIndexErrors?: boolean; - target?: ScriptTarget | ts.ScriptTarget; - traceResolution?: boolean; - types?: string[]; - typeRoots?: string[]; - [option: string]: CompilerOptionsValue | undefined; - } - namespace JsxEmit { - type None = "None"; - type Preserve = "Preserve"; - type React = "React"; - } - type JsxEmit = JsxEmit.None | JsxEmit.Preserve | JsxEmit.React; - namespace ModuleKind { - type None = "None"; - type CommonJS = "CommonJS"; - type AMD = "AMD"; - type UMD = "UMD"; - type System = "System"; - type ES6 = "ES6"; - type ES2015 = "ES2015"; - } - type ModuleKind = ModuleKind.None | ModuleKind.CommonJS | ModuleKind.AMD | ModuleKind.UMD | ModuleKind.System | ModuleKind.ES6 | ModuleKind.ES2015; - namespace ModuleResolutionKind { - type Classic = "Classic"; - type Node = "Node"; - } - type ModuleResolutionKind = ModuleResolutionKind.Classic | ModuleResolutionKind.Node; - namespace NewLineKind { - type Crlf = "Crlf"; - type Lf = "Lf"; - } - type NewLineKind = NewLineKind.Crlf | NewLineKind.Lf; - namespace ScriptTarget { - type ES3 = "ES3"; - type ES5 = "ES5"; - type ES6 = "ES6"; - type ES2015 = "ES2015"; - } - type ScriptTarget = ScriptTarget.ES3 | ScriptTarget.ES5 | ScriptTarget.ES6 | ScriptTarget.ES2015; -} +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + declare namespace ts { interface MapLike { [index: string]: T; } - interface Map extends MapLike { - __mapBrand: any; + interface Map { + get(key: string): T; + has(key: string): boolean; + set(key: string, value: T): this; + delete(key: string): boolean; + clear(): void; + forEach(action: (value: T, key: string) => void): void; + readonly size: number; + keys(): Iterator; + values(): Iterator; + entries(): Iterator<[string, T]>; + } + interface Iterator { + next(): { + value: T; + done: false; + } | { + value: never; + done: true; + }; } type Path = string & { __pathBrand: any; @@ -1003,171 +188,171 @@ declare namespace ts { ReadonlyKeyword = 130, RequireKeyword = 131, NumberKeyword = 132, - SetKeyword = 133, - StringKeyword = 134, - SymbolKeyword = 135, - TypeKeyword = 136, - UndefinedKeyword = 137, - FromKeyword = 138, - GlobalKeyword = 139, - OfKeyword = 140, - QualifiedName = 141, - ComputedPropertyName = 142, - TypeParameter = 143, - Parameter = 144, - Decorator = 145, - PropertySignature = 146, - PropertyDeclaration = 147, - MethodSignature = 148, - MethodDeclaration = 149, - Constructor = 150, - GetAccessor = 151, - SetAccessor = 152, - CallSignature = 153, - ConstructSignature = 154, - IndexSignature = 155, - TypePredicate = 156, - TypeReference = 157, - FunctionType = 158, - ConstructorType = 159, - TypeQuery = 160, - TypeLiteral = 161, - ArrayType = 162, - TupleType = 163, - UnionType = 164, - IntersectionType = 165, - ParenthesizedType = 166, - ThisType = 167, - TypeOperator = 168, - IndexedAccessType = 169, - MappedType = 170, - LiteralType = 171, - ObjectBindingPattern = 172, - ArrayBindingPattern = 173, - BindingElement = 174, - ArrayLiteralExpression = 175, - ObjectLiteralExpression = 176, - PropertyAccessExpression = 177, - ElementAccessExpression = 178, - CallExpression = 179, - NewExpression = 180, - TaggedTemplateExpression = 181, - TypeAssertionExpression = 182, - ParenthesizedExpression = 183, - FunctionExpression = 184, - ArrowFunction = 185, - DeleteExpression = 186, - TypeOfExpression = 187, - VoidExpression = 188, - AwaitExpression = 189, - PrefixUnaryExpression = 190, - PostfixUnaryExpression = 191, - BinaryExpression = 192, - ConditionalExpression = 193, - TemplateExpression = 194, - YieldExpression = 195, - SpreadElement = 196, - ClassExpression = 197, - OmittedExpression = 198, - ExpressionWithTypeArguments = 199, - AsExpression = 200, - NonNullExpression = 201, - TemplateSpan = 202, - SemicolonClassElement = 203, - Block = 204, - VariableStatement = 205, - EmptyStatement = 206, - ExpressionStatement = 207, - IfStatement = 208, - DoStatement = 209, - WhileStatement = 210, - ForStatement = 211, - ForInStatement = 212, - ForOfStatement = 213, - ContinueStatement = 214, - BreakStatement = 215, - ReturnStatement = 216, - WithStatement = 217, - SwitchStatement = 218, - LabeledStatement = 219, - ThrowStatement = 220, - TryStatement = 221, - DebuggerStatement = 222, - VariableDeclaration = 223, - VariableDeclarationList = 224, - FunctionDeclaration = 225, - ClassDeclaration = 226, - InterfaceDeclaration = 227, - TypeAliasDeclaration = 228, - EnumDeclaration = 229, - ModuleDeclaration = 230, - ModuleBlock = 231, - CaseBlock = 232, - NamespaceExportDeclaration = 233, - ImportEqualsDeclaration = 234, - ImportDeclaration = 235, - ImportClause = 236, - NamespaceImport = 237, - NamedImports = 238, - ImportSpecifier = 239, - ExportAssignment = 240, - ExportDeclaration = 241, - NamedExports = 242, - ExportSpecifier = 243, - MissingDeclaration = 244, - ExternalModuleReference = 245, - JsxElement = 246, - JsxSelfClosingElement = 247, - JsxOpeningElement = 248, - JsxClosingElement = 249, - JsxAttribute = 250, - JsxSpreadAttribute = 251, - JsxExpression = 252, - CaseClause = 253, - DefaultClause = 254, - HeritageClause = 255, - CatchClause = 256, - PropertyAssignment = 257, - ShorthandPropertyAssignment = 258, - SpreadAssignment = 259, - EnumMember = 260, - SourceFile = 261, - JSDocTypeExpression = 262, - JSDocAllType = 263, - JSDocUnknownType = 264, - JSDocArrayType = 265, - JSDocUnionType = 266, - JSDocTupleType = 267, - JSDocNullableType = 268, - JSDocNonNullableType = 269, - JSDocRecordType = 270, - JSDocRecordMember = 271, - JSDocTypeReference = 272, - JSDocOptionalType = 273, - JSDocFunctionType = 274, - JSDocVariadicType = 275, - JSDocConstructorType = 276, - JSDocThisType = 277, - JSDocComment = 278, - JSDocTag = 279, - JSDocAugmentsTag = 280, - JSDocParameterTag = 281, - JSDocReturnTag = 282, - JSDocTypeTag = 283, - JSDocTemplateTag = 284, - JSDocTypedefTag = 285, - JSDocPropertyTag = 286, - JSDocTypeLiteral = 287, - JSDocLiteralType = 288, - JSDocNullKeyword = 289, - JSDocUndefinedKeyword = 290, - JSDocNeverKeyword = 291, - SyntaxList = 292, - NotEmittedStatement = 293, - PartiallyEmittedExpression = 294, - MergeDeclarationMarker = 295, - EndOfDeclarationMarker = 296, - RawExpression = 297, + ObjectKeyword = 133, + SetKeyword = 134, + StringKeyword = 135, + SymbolKeyword = 136, + TypeKeyword = 137, + UndefinedKeyword = 138, + FromKeyword = 139, + GlobalKeyword = 140, + OfKeyword = 141, + QualifiedName = 142, + ComputedPropertyName = 143, + TypeParameter = 144, + Parameter = 145, + Decorator = 146, + PropertySignature = 147, + PropertyDeclaration = 148, + MethodSignature = 149, + MethodDeclaration = 150, + Constructor = 151, + GetAccessor = 152, + SetAccessor = 153, + CallSignature = 154, + ConstructSignature = 155, + IndexSignature = 156, + TypePredicate = 157, + TypeReference = 158, + FunctionType = 159, + ConstructorType = 160, + TypeQuery = 161, + TypeLiteral = 162, + ArrayType = 163, + TupleType = 164, + UnionType = 165, + IntersectionType = 166, + ParenthesizedType = 167, + ThisType = 168, + TypeOperator = 169, + IndexedAccessType = 170, + MappedType = 171, + LiteralType = 172, + ObjectBindingPattern = 173, + ArrayBindingPattern = 174, + BindingElement = 175, + ArrayLiteralExpression = 176, + ObjectLiteralExpression = 177, + PropertyAccessExpression = 178, + ElementAccessExpression = 179, + CallExpression = 180, + NewExpression = 181, + TaggedTemplateExpression = 182, + TypeAssertionExpression = 183, + ParenthesizedExpression = 184, + FunctionExpression = 185, + ArrowFunction = 186, + DeleteExpression = 187, + TypeOfExpression = 188, + VoidExpression = 189, + AwaitExpression = 190, + PrefixUnaryExpression = 191, + PostfixUnaryExpression = 192, + BinaryExpression = 193, + ConditionalExpression = 194, + TemplateExpression = 195, + YieldExpression = 196, + SpreadElement = 197, + ClassExpression = 198, + OmittedExpression = 199, + ExpressionWithTypeArguments = 200, + AsExpression = 201, + NonNullExpression = 202, + MetaProperty = 203, + TemplateSpan = 204, + SemicolonClassElement = 205, + Block = 206, + VariableStatement = 207, + EmptyStatement = 208, + ExpressionStatement = 209, + IfStatement = 210, + DoStatement = 211, + WhileStatement = 212, + ForStatement = 213, + ForInStatement = 214, + ForOfStatement = 215, + ContinueStatement = 216, + BreakStatement = 217, + ReturnStatement = 218, + WithStatement = 219, + SwitchStatement = 220, + LabeledStatement = 221, + ThrowStatement = 222, + TryStatement = 223, + DebuggerStatement = 224, + VariableDeclaration = 225, + VariableDeclarationList = 226, + FunctionDeclaration = 227, + ClassDeclaration = 228, + InterfaceDeclaration = 229, + TypeAliasDeclaration = 230, + EnumDeclaration = 231, + ModuleDeclaration = 232, + ModuleBlock = 233, + CaseBlock = 234, + NamespaceExportDeclaration = 235, + ImportEqualsDeclaration = 236, + ImportDeclaration = 237, + ImportClause = 238, + NamespaceImport = 239, + NamedImports = 240, + ImportSpecifier = 241, + ExportAssignment = 242, + ExportDeclaration = 243, + NamedExports = 244, + ExportSpecifier = 245, + MissingDeclaration = 246, + ExternalModuleReference = 247, + JsxElement = 248, + JsxSelfClosingElement = 249, + JsxOpeningElement = 250, + JsxClosingElement = 251, + JsxAttribute = 252, + JsxAttributes = 253, + JsxSpreadAttribute = 254, + JsxExpression = 255, + CaseClause = 256, + DefaultClause = 257, + HeritageClause = 258, + CatchClause = 259, + PropertyAssignment = 260, + ShorthandPropertyAssignment = 261, + SpreadAssignment = 262, + EnumMember = 263, + SourceFile = 264, + Bundle = 265, + JSDocTypeExpression = 266, + JSDocAllType = 267, + JSDocUnknownType = 268, + JSDocArrayType = 269, + JSDocUnionType = 270, + JSDocTupleType = 271, + JSDocNullableType = 272, + JSDocNonNullableType = 273, + JSDocRecordType = 274, + JSDocRecordMember = 275, + JSDocTypeReference = 276, + JSDocOptionalType = 277, + JSDocFunctionType = 278, + JSDocVariadicType = 279, + JSDocConstructorType = 280, + JSDocThisType = 281, + JSDocComment = 282, + JSDocTag = 283, + JSDocAugmentsTag = 284, + JSDocParameterTag = 285, + JSDocReturnTag = 286, + JSDocTypeTag = 287, + JSDocTemplateTag = 288, + JSDocTypedefTag = 289, + JSDocPropertyTag = 290, + JSDocTypeLiteral = 291, + JSDocLiteralType = 292, + SyntaxList = 293, + NotEmittedStatement = 294, + PartiallyEmittedExpression = 295, + MergeDeclarationMarker = 296, + EndOfDeclarationMarker = 297, Count = 298, FirstAssignment = 57, LastAssignment = 69, @@ -1176,15 +361,15 @@ declare namespace ts { FirstReservedWord = 71, LastReservedWord = 106, FirstKeyword = 71, - LastKeyword = 140, + LastKeyword = 141, FirstFutureReservedWord = 107, LastFutureReservedWord = 115, - FirstTypeNode = 156, - LastTypeNode = 171, + FirstTypeNode = 157, + LastTypeNode = 172, FirstPunctuation = 16, LastPunctuation = 69, FirstToken = 0, - LastToken = 140, + LastToken = 141, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -1193,11 +378,11 @@ declare namespace ts { LastTemplateToken = 15, FirstBinaryOperator = 26, LastBinaryOperator = 69, - FirstNode = 141, - FirstJSDocNode = 262, - LastJSDocNode = 288, - FirstJSDocTagNode = 278, - LastJSDocTagNode = 291, + FirstNode = 142, + FirstJSDocNode = 266, + LastJSDocNode = 292, + FirstJSDocTagNode = 282, + LastJSDocTagNode = 292, } const enum NodeFlags { None = 0, @@ -1211,26 +396,20 @@ declare namespace ts { HasImplicitReturn = 128, HasExplicitReturn = 256, GlobalAugmentation = 512, - HasClassExtends = 1024, - HasDecorators = 2048, - HasParamDecorators = 4096, - HasAsyncFunctions = 8192, - HasSpreadAttribute = 16384, - HasRestAttribute = 32768, - DisallowInContext = 65536, - YieldContext = 131072, - DecoratorContext = 262144, - AwaitContext = 524288, - ThisNodeHasError = 1048576, - JavaScriptFile = 2097152, - ThisNodeOrAnySubNodesHasError = 4194304, - HasAggregatedChildData = 8388608, + HasAsyncFunctions = 1024, + DisallowInContext = 2048, + YieldContext = 4096, + DecoratorContext = 8192, + AwaitContext = 16384, + ThisNodeHasError = 32768, + JavaScriptFile = 65536, + ThisNodeOrAnySubNodesHasError = 131072, + HasAggregatedChildData = 262144, BlockScoped = 3, ReachabilityCheckFlags = 384, - EmitHelperFlags = 64512, - ReachabilityAndEmitFlags = 64896, - ContextFlags = 3080192, - TypeExcludesFlags = 655360, + ReachabilityAndEmitFlags = 1408, + ContextFlags = 96256, + TypeExcludesFlags = 20480, } const enum ModifierFlags { None = 0, @@ -1258,34 +437,15 @@ declare namespace ts { IntrinsicIndexedElement = 2, IntrinsicElement = 3, } - const enum RelationComparisonResult { - Succeeded = 1, - Failed = 2, - FailedAndReported = 3, - } interface Node extends TextRange { kind: SyntaxKind; flags: NodeFlags; - modifierFlagsCache?: ModifierFlags; - transformFlags?: TransformFlags; decorators?: NodeArray; modifiers?: ModifiersArray; - id?: number; parent?: Node; - original?: Node; - startsOnNewLine?: boolean; - jsDoc?: JSDoc[]; - jsDocCache?: (JSDoc | JSDocTag)[]; - symbol?: Symbol; - locals?: SymbolTable; - nextContainer?: Node; - localSymbol?: Symbol; - flowNode?: FlowNode; - emitNode?: EmitNode; } interface NodeArray extends Array, TextRange { hasTrailingComma?: boolean; - transformFlags?: TransformFlags; } interface Token extends Node { kind: TKind; @@ -1299,29 +459,18 @@ declare namespace ts { type EndOfFileToken = Token; type AtToken = Token; type ReadonlyToken = Token; + type AwaitKeywordToken = Token; type Modifier = Token | Token | Token | Token | Token | Token | Token | Token | Token | Token | Token; type ModifiersArray = NodeArray; - const enum GeneratedIdentifierKind { - None = 0, - Auto = 1, - Loop = 2, - Unique = 3, - Node = 4, - } interface Identifier extends PrimaryExpression { kind: SyntaxKind.Identifier; text: string; originalKeywordKind?: SyntaxKind; - autoGenerateKind?: GeneratedIdentifierKind; - autoGenerateId?: number; isInJSDocNamespace?: boolean; } interface TransientIdentifier extends Identifier { resolvedSymbol: Symbol; } - interface GeneratedIdentifier extends Identifier { - autoGenerateKind: GeneratedIdentifierKind.Auto | GeneratedIdentifierKind.Loop | GeneratedIdentifierKind.Unique | GeneratedIdentifierKind.Node; - } interface QualifiedName extends Node { kind: SyntaxKind.QualifiedName; left: EntityName; @@ -1347,8 +496,10 @@ declare namespace ts { } interface TypeParameterDeclaration extends Declaration { kind: SyntaxKind.TypeParameter; + parent?: DeclarationWithTypeParameters; name: Identifier; constraint?: TypeNode; + default?: TypeNode; expression?: Expression; } interface SignatureDeclaration extends Declaration { @@ -1366,17 +517,19 @@ declare namespace ts { type BindingName = Identifier | BindingPattern; interface VariableDeclaration extends Declaration { kind: SyntaxKind.VariableDeclaration; - parent?: VariableDeclarationList; + parent?: VariableDeclarationList | CatchClause; name: BindingName; type?: TypeNode; initializer?: Expression; } interface VariableDeclarationList extends Node { kind: SyntaxKind.VariableDeclarationList; + parent?: VariableStatement | ForStatement | ForOfStatement | ForInStatement; declarations: NodeArray; } interface ParameterDeclaration extends Declaration { kind: SyntaxKind.Parameter; + parent?: SignatureDeclaration; dotDotDotToken?: DotDotDotToken; name: BindingName; questionToken?: QuestionToken; @@ -1385,6 +538,7 @@ declare namespace ts { } interface BindingElement extends Declaration { kind: SyntaxKind.BindingElement; + parent?: BindingPattern; propertyName?: PropertyName; dotDotDotToken?: DotDotDotToken; name: BindingName; @@ -1408,7 +562,7 @@ declare namespace ts { _objectLiteralBrandBrand: any; name?: PropertyName; } - type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | MethodDeclaration | AccessorDeclaration | SpreadAssignment; + type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | MethodDeclaration | AccessorDeclaration; interface PropertyAssignment extends ObjectLiteralElement { kind: SyntaxKind.PropertyAssignment; name: PropertyName; @@ -1439,10 +593,12 @@ declare namespace ts { } interface ObjectBindingPattern extends Node { kind: SyntaxKind.ObjectBindingPattern; + parent?: VariableDeclaration | ParameterDeclaration | BindingElement; elements: NodeArray; } interface ArrayBindingPattern extends Node { kind: SyntaxKind.ArrayBindingPattern; + parent?: VariableDeclaration | ParameterDeclaration | BindingElement; elements: NodeArray; } type BindingPattern = ObjectBindingPattern | ArrayBindingPattern; @@ -1469,41 +625,44 @@ declare namespace ts { } interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { kind: SyntaxKind.Constructor; + parent?: ClassDeclaration | ClassExpression; body?: FunctionBody; } interface SemicolonClassElement extends ClassElement { kind: SyntaxKind.SemicolonClassElement; + parent?: ClassDeclaration | ClassExpression; } interface GetAccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { kind: SyntaxKind.GetAccessor; + parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression; name: PropertyName; body: FunctionBody; } interface SetAccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { kind: SyntaxKind.SetAccessor; + parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression; name: PropertyName; body: FunctionBody; } type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration; interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement, TypeElement { kind: SyntaxKind.IndexSignature; + parent?: ClassDeclaration | ClassExpression | InterfaceDeclaration | TypeLiteralNode; } interface TypeNode extends Node { _typeNodeBrand: any; } interface KeywordTypeNode extends TypeNode { - kind: SyntaxKind.AnyKeyword | SyntaxKind.NumberKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.VoidKeyword; + kind: SyntaxKind.AnyKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.VoidKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.NullKeyword | SyntaxKind.NeverKeyword; } interface ThisTypeNode extends TypeNode { kind: SyntaxKind.ThisType; } - interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { - kind: SyntaxKind.FunctionType | SyntaxKind.ConstructorType; - } - interface FunctionTypeNode extends FunctionOrConstructorTypeNode { + type FunctionOrConstructorTypeNode = FunctionTypeNode | ConstructorTypeNode; + interface FunctionTypeNode extends TypeNode, SignatureDeclaration { kind: SyntaxKind.FunctionType; } - interface ConstructorTypeNode extends FunctionOrConstructorTypeNode { + interface ConstructorTypeNode extends TypeNode, SignatureDeclaration { kind: SyntaxKind.ConstructorType; } interface TypeReferenceNode extends TypeNode { @@ -1532,15 +691,14 @@ declare namespace ts { kind: SyntaxKind.TupleType; elementTypes: NodeArray; } - interface UnionOrIntersectionTypeNode extends TypeNode { - kind: SyntaxKind.UnionType | SyntaxKind.IntersectionType; + type UnionOrIntersectionTypeNode = UnionTypeNode | IntersectionTypeNode; + interface UnionTypeNode extends TypeNode { + kind: SyntaxKind.UnionType; types: NodeArray; } - interface UnionTypeNode extends UnionOrIntersectionTypeNode { - kind: SyntaxKind.UnionType; - } - interface IntersectionTypeNode extends UnionOrIntersectionTypeNode { + interface IntersectionTypeNode extends TypeNode { kind: SyntaxKind.IntersectionType; + types: NodeArray; } interface ParenthesizedTypeNode extends TypeNode { kind: SyntaxKind.ParenthesizedType; @@ -1558,6 +716,7 @@ declare namespace ts { } interface MappedTypeNode extends TypeNode, Declaration { kind: SyntaxKind.MappedType; + parent?: TypeAliasDeclaration; readonlyToken?: ReadonlyToken; typeParameter: TypeParameterDeclaration; questionToken?: QuestionToken; @@ -1569,11 +728,9 @@ declare namespace ts { } interface StringLiteral extends LiteralExpression { kind: SyntaxKind.StringLiteral; - textSourceNode?: Identifier | StringLiteral | NumericLiteral; } interface Expression extends Node { _expressionBrand: any; - contextualType?: Type; } interface OmittedExpression extends Expression { kind: SyntaxKind.OmittedExpression; @@ -1609,13 +766,13 @@ declare namespace ts { interface PrimaryExpression extends MemberExpression { _primaryExpressionBrand: any; } - interface NullLiteral extends PrimaryExpression { + interface NullLiteral extends PrimaryExpression, TypeNode { kind: SyntaxKind.NullKeyword; } - interface BooleanLiteral extends PrimaryExpression { + interface BooleanLiteral extends PrimaryExpression, TypeNode { kind: SyntaxKind.TrueKeyword | SyntaxKind.FalseKeyword; } - interface ThisExpression extends PrimaryExpression { + interface ThisExpression extends PrimaryExpression, KeywordTypeNode { kind: SyntaxKind.ThisKeyword; } interface SuperExpression extends PrimaryExpression { @@ -1711,7 +868,6 @@ declare namespace ts { text: string; isUnterminated?: boolean; hasExtendedUnicodeEscape?: boolean; - isOctalLiteral?: boolean; } interface LiteralExpression extends LiteralLikeNode, PrimaryExpression { _literalExpressionBrand: any; @@ -1724,16 +880,18 @@ declare namespace ts { } interface NumericLiteral extends LiteralExpression { kind: SyntaxKind.NumericLiteral; - trailingComment?: string; } interface TemplateHead extends LiteralLikeNode { kind: SyntaxKind.TemplateHead; + parent?: TemplateExpression; } interface TemplateMiddle extends LiteralLikeNode { kind: SyntaxKind.TemplateMiddle; + parent?: TemplateSpan; } interface TemplateTail extends LiteralLikeNode { kind: SyntaxKind.TemplateTail; + parent?: TemplateSpan; } type TemplateLiteral = TemplateExpression | NoSubstitutionTemplateLiteral; interface TemplateExpression extends PrimaryExpression { @@ -1743,6 +901,7 @@ declare namespace ts { } interface TemplateSpan extends Node { kind: SyntaxKind.TemplateSpan; + parent?: TemplateExpression; expression: Expression; literal: TemplateMiddle | TemplateTail; } @@ -1753,7 +912,6 @@ declare namespace ts { interface ArrayLiteralExpression extends PrimaryExpression { kind: SyntaxKind.ArrayLiteralExpression; elements: NodeArray; - multiLine?: boolean; } interface SpreadElement extends Expression { kind: SyntaxKind.SpreadElement; @@ -1764,9 +922,8 @@ declare namespace ts { } interface ObjectLiteralExpression extends ObjectLiteralExpressionBase { kind: SyntaxKind.ObjectLiteralExpression; - multiLine?: boolean; } - type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression; + type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression | ParenthesizedExpression; type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression; interface PropertyAccessExpression extends MemberExpression, Declaration { kind: SyntaxKind.PropertyAccessExpression; @@ -1800,6 +957,7 @@ declare namespace ts { } interface ExpressionWithTypeArguments extends TypeNode { kind: SyntaxKind.ExpressionWithTypeArguments; + parent?: HeritageClause; expression: LeftHandSideExpression; typeArguments?: NodeArray; } @@ -1807,14 +965,14 @@ declare namespace ts { kind: SyntaxKind.NewExpression; expression: LeftHandSideExpression; typeArguments?: NodeArray; - arguments: NodeArray; + arguments?: NodeArray; } interface TaggedTemplateExpression extends MemberExpression { kind: SyntaxKind.TaggedTemplateExpression; tag: LeftHandSideExpression; template: TemplateLiteral; } - type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression | Decorator; + type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression | Decorator | JsxOpeningLikeElement; interface AsExpression extends Expression { kind: SyntaxKind.AsExpression; expression: Expression; @@ -1830,44 +988,59 @@ declare namespace ts { kind: SyntaxKind.NonNullExpression; expression: Expression; } + interface MetaProperty extends PrimaryExpression { + kind: SyntaxKind.MetaProperty; + keywordToken: SyntaxKind; + name: Identifier; + } interface JsxElement extends PrimaryExpression { kind: SyntaxKind.JsxElement; openingElement: JsxOpeningElement; children: NodeArray; closingElement: JsxClosingElement; } + type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement; + type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute; type JsxTagNameExpression = PrimaryExpression | PropertyAccessExpression; + interface JsxAttributes extends ObjectLiteralExpressionBase { + parent?: JsxOpeningLikeElement; + } interface JsxOpeningElement extends Expression { kind: SyntaxKind.JsxOpeningElement; + parent?: JsxElement; tagName: JsxTagNameExpression; - attributes: NodeArray; + attributes: JsxAttributes; } interface JsxSelfClosingElement extends PrimaryExpression { kind: SyntaxKind.JsxSelfClosingElement; tagName: JsxTagNameExpression; - attributes: NodeArray; + attributes: JsxAttributes; } - type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement; - type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute; - interface JsxAttribute extends Node { + interface JsxAttribute extends ObjectLiteralElement { kind: SyntaxKind.JsxAttribute; + parent?: JsxAttributes; name: Identifier; initializer?: StringLiteral | JsxExpression; } - interface JsxSpreadAttribute extends Node { + interface JsxSpreadAttribute extends ObjectLiteralElement { kind: SyntaxKind.JsxSpreadAttribute; + parent?: JsxAttributes; expression: Expression; } interface JsxClosingElement extends Node { kind: SyntaxKind.JsxClosingElement; + parent?: JsxElement; tagName: JsxTagNameExpression; } interface JsxExpression extends Expression { kind: SyntaxKind.JsxExpression; + parent?: JsxElement | JsxAttributeLike; + dotDotDotToken?: Token; expression?: Expression; } interface JsxText extends Node { kind: SyntaxKind.JsxText; + parent?: JsxElement; } type JsxChild = JsxText | JsxExpression | JsxElement | JsxSelfClosingElement; interface Statement extends Node { @@ -1876,16 +1049,6 @@ declare namespace ts { interface NotEmittedStatement extends Statement { kind: SyntaxKind.NotEmittedStatement; } - interface EndOfDeclarationMarker extends Statement { - kind: SyntaxKind.EndOfDeclarationMarker; - } - interface RawExpression extends PrimaryExpression { - kind: SyntaxKind.RawExpression; - text: string; - } - interface MergeDeclarationMarker extends Statement { - kind: SyntaxKind.MergeDeclarationMarker; - } interface EmptyStatement extends Statement { kind: SyntaxKind.EmptyStatement; } @@ -1896,11 +1059,10 @@ declare namespace ts { kind: SyntaxKind.MissingDeclaration; name?: Identifier; } - type BlockLike = SourceFile | Block | ModuleBlock | CaseClause; + type BlockLike = SourceFile | Block | ModuleBlock | CaseOrDefaultClause; interface Block extends Statement { kind: SyntaxKind.Block; statements: NodeArray; - multiLine?: boolean; } interface VariableStatement extends Statement { kind: SyntaxKind.VariableStatement; @@ -1910,9 +1072,6 @@ declare namespace ts { kind: SyntaxKind.ExpressionStatement; expression: Expression; } - interface PrologueDirective extends ExpressionStatement { - expression: StringLiteral; - } interface IfStatement extends Statement { kind: SyntaxKind.IfStatement; expression: Expression; @@ -1944,6 +1103,7 @@ declare namespace ts { } interface ForOfStatement extends IterationStatement { kind: SyntaxKind.ForOfStatement; + awaitModifier?: AwaitKeywordToken; initializer: ForInitializer; expression: Expression; } @@ -1973,15 +1133,18 @@ declare namespace ts { } interface CaseBlock extends Node { kind: SyntaxKind.CaseBlock; + parent?: SwitchStatement; clauses: NodeArray; } interface CaseClause extends Node { kind: SyntaxKind.CaseClause; + parent?: CaseBlock; expression: Expression; statements: NodeArray; } interface DefaultClause extends Node { kind: SyntaxKind.DefaultClause; + parent?: CaseBlock; statements: NodeArray; } type CaseOrDefaultClause = CaseClause | DefaultClause; @@ -2002,6 +1165,7 @@ declare namespace ts { } interface CatchClause extends Node { kind: SyntaxKind.CatchClause; + parent?: TryStatement; variableDeclaration: VariableDeclaration; block: Block; } @@ -2037,8 +1201,9 @@ declare namespace ts { } interface HeritageClause extends Node { kind: SyntaxKind.HeritageClause; - token: SyntaxKind; - types?: NodeArray; + parent?: InterfaceDeclaration | ClassDeclaration | ClassExpression; + token: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword; + types: NodeArray; } interface TypeAliasDeclaration extends DeclarationStatement { kind: SyntaxKind.TypeAliasDeclaration; @@ -2048,6 +1213,7 @@ declare namespace ts { } interface EnumMember extends Declaration { kind: SyntaxKind.EnumMember; + parent?: EnumDeclaration; name: PropertyName; initializer?: Expression; } @@ -2056,91 +1222,114 @@ declare namespace ts { name: Identifier; members: NodeArray; } - type ModuleBody = ModuleBlock | ModuleDeclaration; type ModuleName = Identifier | StringLiteral; + type ModuleBody = NamespaceBody | JSDocNamespaceBody; interface ModuleDeclaration extends DeclarationStatement { kind: SyntaxKind.ModuleDeclaration; - name: Identifier | StringLiteral; - body?: ModuleBlock | NamespaceDeclaration | JSDocNamespaceDeclaration | Identifier; + parent?: ModuleBody | SourceFile; + name: ModuleName; + body?: ModuleBody | JSDocNamespaceDeclaration; } + type NamespaceBody = ModuleBlock | NamespaceDeclaration; interface NamespaceDeclaration extends ModuleDeclaration { name: Identifier; - body: ModuleBlock | NamespaceDeclaration; + body: NamespaceBody; } + type JSDocNamespaceBody = Identifier | JSDocNamespaceDeclaration; interface JSDocNamespaceDeclaration extends ModuleDeclaration { name: Identifier; - body: JSDocNamespaceDeclaration | Identifier; + body: JSDocNamespaceBody; } interface ModuleBlock extends Node, Statement { kind: SyntaxKind.ModuleBlock; + parent?: ModuleDeclaration; statements: NodeArray; } type ModuleReference = EntityName | ExternalModuleReference; interface ImportEqualsDeclaration extends DeclarationStatement { kind: SyntaxKind.ImportEqualsDeclaration; + parent?: SourceFile | ModuleBlock; name: Identifier; moduleReference: ModuleReference; } interface ExternalModuleReference extends Node { kind: SyntaxKind.ExternalModuleReference; + parent?: ImportEqualsDeclaration; expression?: Expression; } interface ImportDeclaration extends Statement { kind: SyntaxKind.ImportDeclaration; + parent?: SourceFile | ModuleBlock; importClause?: ImportClause; moduleSpecifier: Expression; } type NamedImportBindings = NamespaceImport | NamedImports; interface ImportClause extends Declaration { kind: SyntaxKind.ImportClause; + parent?: ImportDeclaration; name?: Identifier; namedBindings?: NamedImportBindings; } interface NamespaceImport extends Declaration { kind: SyntaxKind.NamespaceImport; + parent?: ImportClause; name: Identifier; } interface NamespaceExportDeclaration extends DeclarationStatement { kind: SyntaxKind.NamespaceExportDeclaration; name: Identifier; - moduleReference: LiteralLikeNode; } interface ExportDeclaration extends DeclarationStatement { kind: SyntaxKind.ExportDeclaration; + parent?: SourceFile | ModuleBlock; exportClause?: NamedExports; moduleSpecifier?: Expression; } interface NamedImports extends Node { kind: SyntaxKind.NamedImports; + parent?: ImportClause; elements: NodeArray; } interface NamedExports extends Node { kind: SyntaxKind.NamedExports; + parent?: ExportDeclaration; elements: NodeArray; } type NamedImportsOrExports = NamedImports | NamedExports; interface ImportSpecifier extends Declaration { kind: SyntaxKind.ImportSpecifier; + parent?: NamedImports; propertyName?: Identifier; name: Identifier; } interface ExportSpecifier extends Declaration { kind: SyntaxKind.ExportSpecifier; + parent?: NamedExports; propertyName?: Identifier; name: Identifier; } type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier; interface ExportAssignment extends DeclarationStatement { kind: SyntaxKind.ExportAssignment; + parent?: SourceFile; isExportEquals?: boolean; expression: Expression; } interface FileReference extends TextRange { fileName: string; } + interface CheckJsDirective extends TextRange { + enabled: boolean; + } + type CommentKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia; interface CommentRange extends TextRange { hasTrailingNewLine?: boolean; - kind: SyntaxKind; + kind: CommentKind; + } + interface SynthesizedComment extends CommentRange { + text: string; + pos: -1; + end: -1; } interface JSDocTypeExpression extends Node { kind: SyntaxKind.JSDocTypeExpression; @@ -2281,9 +1470,21 @@ declare namespace ts { ArrayMutation = 256, Referenced = 512, Shared = 1024, + PreFinally = 2048, + AfterFinally = 4096, Label = 12, Condition = 96, } + interface FlowLock { + locked?: boolean; + } + interface AfterFinallyFlow extends FlowNode, FlowLock { + antecedent: FlowNode; + } + interface PreFinallyFlow extends FlowNode { + antecedent: FlowNode; + lock: FlowLock; + } interface FlowNode { flags: FlowFlags; id?: number; @@ -2326,7 +1527,6 @@ declare namespace ts { statements: NodeArray; endOfFileToken: Token; fileName: string; - path: Path; text: string; amdDependencies: AmdDependency[]; moduleName: string; @@ -2334,27 +1534,12 @@ declare namespace ts { typeReferenceDirectives: FileReference[]; languageVariant: LanguageVariant; isDeclarationFile: boolean; - renamedDependencies?: Map; hasNoDefaultLib: boolean; languageVersion: ScriptTarget; - scriptKind: ScriptKind; - externalModuleIndicator: Node; - commonJsModuleIndicator: Node; - identifiers: Map; - nodeCount: number; - identifierCount: number; - symbolCount: number; - parseDiagnostics: Diagnostic[]; - additionalSyntacticDiagnostics?: Diagnostic[]; - bindDiagnostics: Diagnostic[]; - lineMap: number[]; - classifiableNames?: Map; - resolvedModules: Map; - resolvedTypeReferenceDirectiveNames: Map; - imports: LiteralExpression[]; - moduleAugmentations: LiteralExpression[]; - patternAmbientModules?: PatternAmbientModule[]; - ambientModuleNames: string[]; + } + interface Bundle extends Node { + kind: SyntaxKind.Bundle; + sourceFiles: SourceFile[]; } interface ScriptReferenceHost { getCompilerOptions(): CompilerOptions; @@ -2380,25 +1565,17 @@ declare namespace ts { interface Program extends ScriptReferenceHost { getRootFileNames(): string[]; getSourceFiles(): SourceFile[]; - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean): EmitResult; + emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult; getOptionsDiagnostics(cancellationToken?: CancellationToken): Diagnostic[]; getGlobalDiagnostics(cancellationToken?: CancellationToken): Diagnostic[]; getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[]; getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[]; getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[]; getTypeChecker(): TypeChecker; - getCommonSourceDirectory(): string; - getDiagnosticsProducingTypeChecker(): TypeChecker; - dropDiagnosticsProducingTypeChecker(): void; - getClassifiableNames(): Map; - getNodeCount(): number; - getIdentifierCount(): number; - getSymbolCount(): number; - getTypeCount(): number; - getFileProcessingDiagnostics(): DiagnosticCollection; - getResolvedTypeReferenceDirectives(): Map; - isSourceFileFromExternalLibrary(file: SourceFile): boolean; - structureIsReused?: boolean; + } + interface CustomTransformers { + before?: TransformerFactory[]; + after?: TransformerFactory[]; } interface SourceMapSpan { emittedLine: number; @@ -2429,24 +1606,23 @@ declare namespace ts { emitSkipped: boolean; diagnostics: Diagnostic[]; emittedFiles: string[]; - sourceMaps: SourceMapData[]; - } - interface TypeCheckerHost { - getCompilerOptions(): CompilerOptions; - getSourceFiles(): SourceFile[]; - getSourceFile(fileName: string): SourceFile; - getResolvedTypeReferenceDirectives(): Map; } interface TypeChecker { getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; getDeclaredTypeOfSymbol(symbol: Symbol): Type; getPropertiesOfType(type: Type): Symbol[]; getPropertyOfType(type: Type, propertyName: string): Symbol; + getIndexInfoOfType(type: Type, kind: IndexKind): IndexInfo; getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; getIndexTypeOfType(type: Type, kind: IndexKind): Type; - getBaseTypes(type: InterfaceType): ObjectType[]; + getBaseTypes(type: InterfaceType): BaseType[]; + getBaseTypeOfLiteralType(type: Type): Type; + getWidenedType(type: Type): Type; getReturnTypeOfSignature(signature: Signature): Type; getNonNullableType(type: Type): Type; + typeToTypeNode(type: Type, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): TypeNode; + signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): SignatureDeclaration; + indexInfoToIndexSignatureDeclaration(indexInfo: IndexInfo, kind: IndexKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): IndexSignatureDeclaration; getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; getSymbolAtLocation(node: Node): Symbol; getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[]; @@ -2454,6 +1630,8 @@ declare namespace ts { getExportSpecifierLocalTargetSymbol(location: ExportSpecifier): Symbol; getPropertySymbolOfDestructuringAssignment(location: Identifier): Symbol; getTypeAtLocation(node: Node): Type; + getTypeFromTypeNode(node: TypeNode): Type; + signatureToString(signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): string; typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; getSymbolDisplayBuilder(): SymbolDisplayBuilder; @@ -2471,24 +1649,27 @@ declare namespace ts { isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; getAliasedSymbol(symbol: Symbol): Symbol; getExportsOfModule(moduleSymbol: Symbol): Symbol[]; - getJsxElementAttributesType(elementNode: JsxOpeningLikeElement): Type; + getAllAttributesTypeFromJsxOpeningLikeElement(elementNode: JsxOpeningLikeElement): Type; getJsxIntrinsicTagNames(): Symbol[]; isOptionalParameter(node: ParameterDeclaration): boolean; getAmbientModules(): Symbol[]; tryGetMemberInModuleExports(memberName: string, moduleSymbol: Symbol): Symbol | undefined; - tryFindAmbientModuleWithoutAugmentations(moduleName: string): Symbol; - getDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[]; - getGlobalDiagnostics(): Diagnostic[]; - getEmitResolver(sourceFile?: SourceFile, cancellationToken?: CancellationToken): EmitResolver; - getNodeCount(): number; - getIdentifierCount(): number; - getSymbolCount(): number; - getTypeCount(): number; + getApparentType(type: Type): Type; + } + enum NodeBuilderFlags { + None = 0, + allowThisInObjectLiteral = 1, + allowQualifedNameInPlaceOfIdentifier = 2, + allowTypeParameterInQualifiedName = 4, + allowAnonymousIdentifier = 8, + allowEmptyUnionOrIntersection = 16, + allowEmptyTuple = 32, } interface SymbolDisplayBuilder { buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): void; + buildIndexSignatureDisplay(info: IndexInfo, writer: SymbolWriter, kind: IndexKind, enclosingDeclaration?: Node, globalFlags?: TypeFormatFlags, symbolStack?: Symbol[]): void; buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; buildTypePredicateDisplay(predicate: TypePredicate, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; @@ -2504,6 +1685,7 @@ declare namespace ts { writeSpace(text: string): void; writeStringLiteral(text: string): void; writeParameter(text: string): void; + writeProperty(text: string): void; writeSymbol(text: string, symbol: Symbol): void; writeLine(): void; increaseIndent(): void; @@ -2511,6 +1693,7 @@ declare namespace ts { clear(): void; trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; reportInaccessibleThisError(): void; + reportIllegalExtends(): void; } const enum TypeFormatFlags { None = 0, @@ -2525,21 +1708,14 @@ declare namespace ts { InFirstTypeArgument = 256, InTypeAlias = 512, UseTypeAliasValue = 1024, + SuppressAnyReturnType = 2048, + AddUndefined = 4096, } const enum SymbolFormatFlags { None = 0, WriteTypeParametersOrArguments = 1, UseOnlyExternalAliasing = 2, } - const enum SymbolAccessibility { - Accessible = 0, - NotAccessible = 1, - CannotBeNamed = 2, - } - const enum SyntheticSymbolKind { - UnionOrIntersection = 0, - Spread = 1, - } const enum TypePredicateKind { This = 0, Identifier = 1, @@ -2557,61 +1733,6 @@ declare namespace ts { parameterIndex: number; } type TypePredicate = IdentifierTypePredicate | ThisTypePredicate; - type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; - interface SymbolVisibilityResult { - accessibility: SymbolAccessibility; - aliasesToMakeVisible?: AnyImportSyntax[]; - errorSymbolName?: string; - errorNode?: Node; - } - interface SymbolAccessibilityResult extends SymbolVisibilityResult { - errorModuleName?: string; - } - enum TypeReferenceSerializationKind { - Unknown = 0, - TypeWithConstructSignatureAndValue = 1, - VoidNullableOrNeverType = 2, - NumberLikeType = 3, - StringLikeType = 4, - BooleanType = 5, - ArrayLikeType = 6, - ESSymbolType = 7, - Promise = 8, - TypeWithCallSignature = 9, - ObjectType = 10, - } - interface EmitResolver { - hasGlobalName(name: string): boolean; - getReferencedExportContainer(node: Identifier, prefixLocals?: boolean): SourceFile | ModuleDeclaration | EnumDeclaration; - getReferencedImportDeclaration(node: Identifier): Declaration; - getReferencedDeclarationWithCollidingName(node: Identifier): Declaration; - isDeclarationWithCollidingName(node: Declaration): boolean; - isValueAliasDeclaration(node: Node): boolean; - isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; - isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; - getNodeCheckFlags(node: Node): NodeCheckFlags; - isDeclarationVisible(node: Declaration): boolean; - collectLinkedAliases(node: Identifier): Node[]; - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; - writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - writeBaseConstructorTypeOfClass(node: ClassLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags, shouldComputeAliasToMarkVisible: boolean): SymbolAccessibilityResult; - isEntityNameVisible(entityName: EntityNameOrEntityNameExpression, enclosingDeclaration: Node): SymbolVisibilityResult; - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; - getReferencedValueDeclaration(reference: Identifier): Declaration; - getTypeReferenceSerializationKind(typeName: EntityName, location?: Node): TypeReferenceSerializationKind; - isOptionalParameter(node: ParameterDeclaration): boolean; - moduleExportsSomeValue(moduleReferenceExpression: Expression): boolean; - isArgumentsLocalBinding(node: Identifier): boolean; - getExternalModuleFileFromDeclaration(declaration: ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration | ModuleDeclaration): SourceFile; - getTypeReferenceDirectivesForEntityName(name: EntityNameOrEntityNameExpression): string[]; - getTypeReferenceDirectivesForSymbol(symbol: Symbol, meaning?: SymbolFlags): string[]; - isLiteralConstDeclaration(node: VariableDeclaration | PropertyDeclaration | PropertySignature | ParameterDeclaration): boolean; - writeLiteralConstValue(node: VariableDeclaration | PropertyDeclaration | PropertySignature | ParameterDeclaration, writer: SymbolWriter): void; - getJsxFactoryEntity(): EntityName; - } const enum SymbolFlags { None = 0, FunctionScopedVariable = 1, @@ -2638,13 +1759,10 @@ declare namespace ts { ExportType = 2097152, ExportNamespace = 4194304, Alias = 8388608, - Instantiated = 16777216, - Merged = 33554432, - Transient = 67108864, - Prototype = 134217728, - SyntheticProperty = 268435456, - Optional = 536870912, - ExportStar = 1073741824, + Prototype = 16777216, + ExportStar = 33554432, + Optional = 67108864, + Transient = 134217728, Enum = 384, Variable = 3, Value = 107455, @@ -2678,7 +1796,6 @@ declare namespace ts { PropertyOrAccessor = 98308, Export = 7340032, ClassMember = 106500, - Classifiable = 788448, } interface Symbol { flags: SymbolFlags; @@ -2688,86 +1805,8 @@ declare namespace ts { members?: SymbolTable; exports?: SymbolTable; globalExports?: SymbolTable; - isReadonly?: boolean; - id?: number; - mergeId?: number; - parent?: Symbol; - exportSymbol?: Symbol; - constEnumOnlyModule?: boolean; - isReferenced?: boolean; - isReplaceableByMethod?: boolean; - isAssigned?: boolean; - } - interface SymbolLinks { - target?: Symbol; - type?: Type; - declaredType?: Type; - typeParameters?: TypeParameter[]; - inferredClassType?: Type; - instantiations?: Map; - mapper?: TypeMapper; - referenced?: boolean; - containingType?: UnionOrIntersectionType; - leftSpread?: Symbol; - rightSpread?: Symbol; - hasNonUniformType?: boolean; - isPartial?: boolean; - isDiscriminantProperty?: boolean; - resolvedExports?: SymbolTable; - exportsChecked?: boolean; - isDeclarationWithCollidingName?: boolean; - bindingElement?: BindingElement; - exportsSomeValue?: boolean; - } - interface TransientSymbol extends Symbol, SymbolLinks { } type SymbolTable = Map; - interface Pattern { - prefix: string; - suffix: string; - } - interface PatternAmbientModule { - pattern: Pattern; - symbol: Symbol; - } - const enum NodeCheckFlags { - TypeChecked = 1, - LexicalThis = 2, - CaptureThis = 4, - SuperInstance = 256, - SuperStatic = 512, - ContextChecked = 1024, - AsyncMethodWithSuper = 2048, - AsyncMethodWithSuperBinding = 4096, - CaptureArguments = 8192, - EnumValuesComputed = 16384, - LexicalModuleMergesWithClass = 32768, - LoopWithCapturedBlockScopedBinding = 65536, - CapturedBlockScopedBinding = 131072, - BlockScopedBindingInLoop = 262144, - ClassWithBodyScopedClassBinding = 524288, - BodyScopedClassBinding = 1048576, - NeedsLoopOutParameter = 2097152, - AssignmentsMarked = 4194304, - ClassWithConstructorReference = 8388608, - ConstructorReferenceInClass = 16777216, - } - interface NodeLinks { - flags?: NodeCheckFlags; - resolvedType?: Type; - resolvedSignature?: Signature; - resolvedSymbol?: Symbol; - resolvedIndexInfo?: IndexInfo; - maybeTypePredicate?: boolean; - enumMemberValue?: number; - isVisible?: boolean; - hasReportedStatementInAmbientContext?: boolean; - jsxFlags?: JsxFlags; - resolvedJsxType?: Type; - hasSuperCall?: boolean; - superCall?: ExpressionStatement; - switchTypes?: Type[]; - } const enum TypeFlags { Any = 1, String = 2, @@ -2789,48 +1828,36 @@ declare namespace ts { Intersection = 131072, Index = 262144, IndexedAccess = 524288, - FreshLiteral = 1048576, - ContainsWideningType = 2097152, - ContainsObjectLiteral = 4194304, - ContainsAnyFunctionType = 8388608, - Nullable = 6144, + NonPrimitive = 16777216, Literal = 480, StringOrNumberLiteral = 96, - DefinitelyFalsy = 7392, PossiblyFalsy = 7406, - Intrinsic = 16015, - Primitive = 8190, StringLike = 262178, NumberLike = 340, BooleanLike = 136, EnumLike = 272, UnionOrIntersection = 196608, StructuredType = 229376, - StructuredOrTypeParameter = 507904, - Narrowable = 1033215, - NotUnionOrUnit = 33281, - RequiresWidening = 6291456, - PropagatingFlags = 14680064, + StructuredOrTypeVariable = 1032192, + TypeVariable = 540672, + Narrowable = 17810431, + NotUnionOrUnit = 16810497, } type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; interface Type { flags: TypeFlags; - id: number; symbol?: Symbol; pattern?: DestructuringPattern; aliasSymbol?: Symbol; aliasTypeArguments?: Type[]; } - interface IntrinsicType extends Type { - intrinsicName: string; - } interface LiteralType extends Type { text: string; freshType?: LiteralType; regularType?: LiteralType; } interface EnumType extends Type { - memberTypes: Map; + memberTypes: EnumLiteralType[]; } interface EnumLiteralType extends LiteralType { baseType: EnumType & UnionType; @@ -2856,9 +1883,8 @@ declare namespace ts { outerTypeParameters: TypeParameter[]; localTypeParameters: TypeParameter[]; thisType: TypeParameter; - resolvedBaseConstructorType?: Type; - resolvedBaseTypes: ObjectType[]; } + type BaseType = ObjectType | IntersectionType; interface InterfaceTypeWithDeclaredMembers extends InterfaceType { declaredProperties: Symbol[]; declaredCallSignatures: Signature[]; @@ -2871,62 +1897,32 @@ declare namespace ts { typeArguments: Type[]; } interface GenericType extends InterfaceType, TypeReference { - instantiations: Map; } interface UnionOrIntersectionType extends Type { types: Type[]; - resolvedProperties: SymbolTable; - couldContainTypeParameters: boolean; } interface UnionType extends UnionOrIntersectionType { } interface IntersectionType extends UnionOrIntersectionType { } type StructuredType = ObjectType | UnionType | IntersectionType; - interface AnonymousType extends ObjectType { - target?: AnonymousType; - mapper?: TypeMapper; - } - interface MappedType extends ObjectType { - declaration: MappedTypeNode; - typeParameter?: TypeParameter; - constraintType?: Type; - templateType?: Type; - mapper?: TypeMapper; - } interface EvolvingArrayType extends ObjectType { elementType: Type; finalArrayType?: Type; } - interface ResolvedType extends ObjectType, UnionOrIntersectionType { - members: SymbolTable; - properties: Symbol[]; - callSignatures: Signature[]; - constructSignatures: Signature[]; - stringIndexInfo?: IndexInfo; - numberIndexInfo?: IndexInfo; + interface TypeVariable extends Type { } - interface FreshObjectLiteralType extends ResolvedType { - regularType: ResolvedType; - } - interface IterableOrIteratorType extends ObjectType, UnionType { - iterableElementType?: Type; - iteratorElementType?: Type; - } - interface TypeParameter extends Type { + interface TypeParameter extends TypeVariable { constraint: Type; - target?: TypeParameter; - mapper?: TypeMapper; - resolvedApparentType: Type; - resolvedIndexType: IndexType; - isThisType?: boolean; + default?: Type; } - interface IndexType extends Type { - type: TypeParameter; - } - interface IndexedAccessType extends Type { + interface IndexedAccessType extends TypeVariable { objectType: Type; indexType: Type; + constraint?: Type; + } + interface IndexType extends Type { + type: TypeVariable | UnionOrIntersectionType; } const enum SignatureKind { Call = 0, @@ -2936,18 +1932,6 @@ declare namespace ts { declaration: SignatureDeclaration; typeParameters: TypeParameter[]; parameters: Symbol[]; - thisParameter?: Symbol; - resolvedReturnType: Type; - minArgumentCount: number; - hasRestParameter: boolean; - hasLiteralTypes: boolean; - target?: Signature; - mapper?: TypeMapper; - unionSignatures?: Signature[]; - erasedSignatureCache?: Signature; - isolatedSignatureType?: ObjectType; - typePredicate?: TypePredicate; - instantiations?: Map; } const enum IndexKind { String = 0, @@ -2958,32 +1942,9 @@ declare namespace ts { isReadonly: boolean; declaration?: SignatureDeclaration; } - interface TypeMapper { - (t: TypeParameter): Type; - mappedTypes?: Type[]; - instantiations?: Type[]; - context?: InferenceContext; - } - interface TypeInferences { - primary: Type[]; - secondary: Type[]; - topLevel: boolean; - isFixed: boolean; - } - interface InferenceContext { - signature: Signature; - inferUnionTypes: boolean; - inferences: TypeInferences[]; - inferredTypes: Type[]; - mapper?: TypeMapper; - failedTypeParameterIndex?: number; - } - const enum SpecialPropertyAssignmentKind { - None = 0, - ExportsProperty = 1, - ModuleExports = 2, - PrototypeProperty = 3, - ThisProperty = 4, + interface JsFileExtensionInfo { + extension: string; + isMixedContent: boolean; } interface DiagnosticMessage { key: string; @@ -3014,36 +1975,33 @@ declare namespace ts { Classic = 1, NodeJs = 2, } - type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike; + interface PluginImport { + name: string; + } + type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike | PluginImport[]; interface CompilerOptions { allowJs?: boolean; - allowNonTsExtensions?: boolean; allowSyntheticDefaultImports?: boolean; allowUnreachableCode?: boolean; allowUnusedLabels?: boolean; alwaysStrict?: boolean; baseUrl?: string; charset?: string; - configFilePath?: string; + checkJs?: boolean; declaration?: boolean; declarationDir?: string; - diagnostics?: boolean; - extendedDiagnostics?: boolean; disableSizeLimit?: boolean; + downlevelIteration?: boolean; emitBOM?: boolean; emitDecoratorMetadata?: boolean; experimentalDecorators?: boolean; forceConsistentCasingInFileNames?: boolean; - help?: boolean; importHelpers?: boolean; - init?: boolean; inlineSourceMap?: boolean; inlineSources?: boolean; isolatedModules?: boolean; jsx?: JsxEmit; lib?: string[]; - listEmittedFiles?: boolean; - listFiles?: boolean; locale?: string; mapRoot?: string; maxNodeModuleJsDepth?: number; @@ -3051,7 +2009,6 @@ declare namespace ts { moduleResolution?: ModuleResolutionKind; newLine?: NewLineKind; noEmit?: boolean; - noEmitForJsFiles?: boolean; noEmitHelpers?: boolean; noEmitOnError?: boolean; noErrorTruncation?: boolean; @@ -3070,7 +2027,6 @@ declare namespace ts { paths?: MapLike; preserveConstEnums?: boolean; project?: string; - pretty?: DiagnosticStyle; reactNamespace?: string; jsxFactory?: string; removeComments?: boolean; @@ -3080,17 +2036,14 @@ declare namespace ts { skipDefaultLibCheck?: boolean; sourceMap?: boolean; sourceRoot?: string; + strict?: boolean; strictNullChecks?: boolean; - stripInternal?: boolean; suppressExcessPropertyErrors?: boolean; suppressImplicitAnyIndexErrors?: boolean; - suppressOutputPathCheck?: boolean; target?: ScriptTarget; traceResolution?: boolean; types?: string[]; typeRoots?: string[]; - version?: boolean; - watch?: boolean; [option: string]: CompilerOptionsValue | undefined; } interface TypeAcquisition { @@ -3121,6 +2074,7 @@ declare namespace ts { None = 0, Preserve = 1, React = 2, + ReactNative = 3, } const enum NewLineKind { CarriageReturnLineFeed = 0, @@ -3136,6 +2090,7 @@ declare namespace ts { JSX = 2, TS = 3, TSX = 4, + External = 5, } const enum ScriptTarget { ES3 = 0, @@ -3150,10 +2105,6 @@ declare namespace ts { Standard = 0, JSX = 1, } - const enum DiagnosticStyle { - Simple = 0, - Pretty = 1, - } interface ParsedCommandLine { options: CompilerOptions; typeAcquisition?: TypeAcquisition; @@ -3171,156 +2122,6 @@ declare namespace ts { fileNames: string[]; wildcardDirectories: MapLike; } - interface CommandLineOptionBase { - name: string; - type: "string" | "number" | "boolean" | "object" | "list" | Map; - isFilePath?: boolean; - shortName?: string; - description?: DiagnosticMessage; - paramType?: DiagnosticMessage; - experimental?: boolean; - isTSConfigOnly?: boolean; - } - interface CommandLineOptionOfPrimitiveType extends CommandLineOptionBase { - type: "string" | "number" | "boolean"; - } - interface CommandLineOptionOfCustomType extends CommandLineOptionBase { - type: Map; - } - interface TsConfigOnlyOption extends CommandLineOptionBase { - type: "object"; - } - interface CommandLineOptionOfListType extends CommandLineOptionBase { - type: "list"; - element: CommandLineOptionOfCustomType | CommandLineOptionOfPrimitiveType; - } - type CommandLineOption = CommandLineOptionOfCustomType | CommandLineOptionOfPrimitiveType | TsConfigOnlyOption | CommandLineOptionOfListType; - const enum CharacterCodes { - nullCharacter = 0, - maxAsciiCharacter = 127, - lineFeed = 10, - carriageReturn = 13, - lineSeparator = 8232, - paragraphSeparator = 8233, - nextLine = 133, - space = 32, - nonBreakingSpace = 160, - enQuad = 8192, - emQuad = 8193, - enSpace = 8194, - emSpace = 8195, - threePerEmSpace = 8196, - fourPerEmSpace = 8197, - sixPerEmSpace = 8198, - figureSpace = 8199, - punctuationSpace = 8200, - thinSpace = 8201, - hairSpace = 8202, - zeroWidthSpace = 8203, - narrowNoBreakSpace = 8239, - ideographicSpace = 12288, - mathematicalSpace = 8287, - ogham = 5760, - _ = 95, - $ = 36, - _0 = 48, - _1 = 49, - _2 = 50, - _3 = 51, - _4 = 52, - _5 = 53, - _6 = 54, - _7 = 55, - _8 = 56, - _9 = 57, - a = 97, - b = 98, - c = 99, - d = 100, - e = 101, - f = 102, - g = 103, - h = 104, - i = 105, - j = 106, - k = 107, - l = 108, - m = 109, - n = 110, - o = 111, - p = 112, - q = 113, - r = 114, - s = 115, - t = 116, - u = 117, - v = 118, - w = 119, - x = 120, - y = 121, - z = 122, - A = 65, - B = 66, - C = 67, - D = 68, - E = 69, - F = 70, - G = 71, - H = 72, - I = 73, - J = 74, - K = 75, - L = 76, - M = 77, - N = 78, - O = 79, - P = 80, - Q = 81, - R = 82, - S = 83, - T = 84, - U = 85, - V = 86, - W = 87, - X = 88, - Y = 89, - Z = 90, - ampersand = 38, - asterisk = 42, - at = 64, - backslash = 92, - backtick = 96, - bar = 124, - caret = 94, - closeBrace = 125, - closeBracket = 93, - closeParen = 41, - colon = 58, - comma = 44, - dot = 46, - doubleQuote = 34, - equals = 61, - exclamation = 33, - greaterThan = 62, - hash = 35, - lessThan = 60, - minus = 45, - openBrace = 123, - openBracket = 91, - openParen = 40, - percent = 37, - plus = 43, - question = 63, - semicolon = 59, - singleQuote = 39, - slash = 47, - tilde = 126, - backspace = 8, - formFeed = 12, - byteOrderMark = 65279, - tab = 9, - verticalTab = 11, - } interface ModuleResolutionHost { fileExists(fileName: string): boolean; readFile(fileName: string): string; @@ -3347,7 +2148,6 @@ declare namespace ts { } interface ResolvedModuleWithFailedLookupLocations { resolvedModule: ResolvedModuleFull | undefined; - failedLookupLocations: string[]; } interface ResolvedTypeReferenceDirective { primary: boolean; @@ -3373,72 +2173,6 @@ declare namespace ts { resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[]; getEnvironmentVariable?(name: string): string; } - const enum TransformFlags { - None = 0, - TypeScript = 1, - ContainsTypeScript = 2, - ContainsJsx = 4, - ContainsESNext = 8, - ContainsES2017 = 16, - ContainsES2016 = 32, - ES2015 = 64, - ContainsES2015 = 128, - Generator = 256, - ContainsGenerator = 512, - DestructuringAssignment = 1024, - ContainsDestructuringAssignment = 2048, - ContainsDecorators = 4096, - ContainsPropertyInitializer = 8192, - ContainsLexicalThis = 16384, - ContainsCapturedLexicalThis = 32768, - ContainsLexicalThisInComputedPropertyName = 65536, - ContainsDefaultValueAssignments = 131072, - ContainsParameterPropertyAssignments = 262144, - ContainsSpread = 524288, - ContainsObjectSpread = 1048576, - ContainsRest = 524288, - ContainsObjectRest = 1048576, - ContainsComputedPropertyName = 2097152, - ContainsBlockScopedBinding = 4194304, - ContainsBindingPattern = 8388608, - ContainsYield = 16777216, - ContainsHoistedDeclarationOrCompletion = 33554432, - HasComputedFlags = 536870912, - AssertTypeScript = 3, - AssertJsx = 4, - AssertESNext = 8, - AssertES2017 = 16, - AssertES2016 = 32, - AssertES2015 = 192, - AssertGenerator = 768, - AssertDestructuringAssignment = 3072, - NodeExcludes = 536872257, - ArrowFunctionExcludes = 601249089, - FunctionExcludes = 601281857, - ConstructorExcludes = 601015617, - MethodOrAccessorExcludes = 601015617, - ClassExcludes = 539358529, - ModuleExcludes = 574674241, - TypeExcludes = -3, - ObjectLiteralExcludes = 540087617, - ArrayLiteralOrCallOrNewExcludes = 537396545, - VariableDeclarationListExcludes = 546309441, - ParameterExcludes = 536872257, - CatchClauseExcludes = 537920833, - BindingPatternExcludes = 537396545, - TypeScriptClassSyntaxMask = 274432, - ES2015FunctionSyntaxMask = 163840, - } - interface EmitNode { - annotatedNodes?: Node[]; - flags?: EmitFlags; - commentRange?: TextRange; - sourceMapRange?: TextRange; - tokenSourceMapRanges?: Map; - constantValue?: number; - externalHelpersModuleName?: Identifier; - helpers?: EmitHelper[]; - } const enum EmitFlags { SingleLine = 1, AdviseOnEmitNode = 2, @@ -3465,6 +2199,7 @@ declare namespace ts { CustomPrologue = 524288, NoHoisting = 1048576, HasEndOfDeclarationMarker = 2097152, + Iterator = 4194304, } interface EmitHelper { readonly name: string; @@ -3472,25 +2207,14 @@ declare namespace ts { readonly text: string; readonly priority?: number; } - const enum EmitContext { + const enum EmitHint { SourceFile = 0, Expression = 1, IdentifierName = 2, Unspecified = 3, } - interface EmitHost extends ScriptReferenceHost { - getSourceFiles(): SourceFile[]; - isSourceFileFromExternalLibrary(file: SourceFile): boolean; - getCommonSourceDirectory(): string; - getCanonicalFileName(fileName: string): string; - getNewLine(): string; - isEmitBlocked(emitFileName: string): boolean; - writeFile: WriteFileCallback; - } interface TransformationContext { getCompilerOptions(): CompilerOptions; - getEmitResolver(): EmitResolver; - getEmitHost(): EmitHost; startLexicalEnvironment(): void; suspendLexicalEnvironment(): void; resumeLexicalEnvironment(): void; @@ -3501,17 +2225,36 @@ declare namespace ts { readEmitHelpers(): EmitHelper[] | undefined; enableSubstitution(kind: SyntaxKind): void; isSubstitutionEnabled(node: Node): boolean; - onSubstituteNode?: (emitContext: EmitContext, node: Node) => Node; + onSubstituteNode: (hint: EmitHint, node: Node) => Node; enableEmitNotification(kind: SyntaxKind): void; isEmitNotificationEnabled(node: Node): boolean; - onEmitNode?: (emitContext: EmitContext, node: Node, emitCallback: (emitContext: EmitContext, node: Node) => void) => void; + onEmitNode: (hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void) => void; } - interface TransformationResult { - transformed: SourceFile[]; - emitNodeWithSubstitution(emitContext: EmitContext, node: Node, emitCallback: (emitContext: EmitContext, node: Node) => void): void; - emitNodeWithNotification(emitContext: EmitContext, node: Node, emitCallback: (emitContext: EmitContext, node: Node) => void): void; + interface TransformationResult { + transformed: T[]; + diagnostics?: Diagnostic[]; + substituteNode(hint: EmitHint, node: Node): Node; + emitNodeWithNotification(hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void): void; + dispose(): void; + } + type TransformerFactory = (context: TransformationContext) => Transformer; + type Transformer = (node: T) => T; + type Visitor = (node: Node) => VisitResult; + type VisitResult = T | T[]; + interface Printer { + printNode(hint: EmitHint, node: Node, sourceFile: SourceFile): string; + printFile(sourceFile: SourceFile): string; + printBundle(bundle: Bundle): string; + } + interface PrintHandlers { + hasGlobalName?(name: string): boolean; + onEmitNode?(hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void): void; + substituteNode?(hint: EmitHint, node: Node): Node; + } + interface PrinterOptions { + removeComments?: boolean; + newLine?: NewLineKind; } - type Transformer = (context: TransformationContext) => (node: SourceFile) => SourceFile; interface TextSpan { start: number; length: number; @@ -3520,236 +2263,15 @@ declare namespace ts { span: TextSpan; newLength: number; } - interface DiagnosticCollection { - add(diagnostic: Diagnostic): void; - getGlobalDiagnostics(): Diagnostic[]; - getDiagnostics(fileName?: string): Diagnostic[]; - getModificationCount(): number; - reattachFileDiagnostics(newFile: SourceFile): void; - } interface SyntaxList extends Node { _children: Node[]; } } declare namespace ts { - const timestamp: () => number; -} -declare namespace ts.performance { - function mark(markName: string): void; - function measure(measureName: string, startMarkName?: string, endMarkName?: string): void; - function getCount(markName: string): number; - function getDuration(measureName: string): number; - function forEachMeasure(cb: (measureName: string, duration: number) => void): void; - function enable(): void; - function disable(): void; -} -declare namespace ts { - const version = "2.2.0-dev.20161127"; -} -declare namespace ts { - const enum Ternary { - False = 0, - Maybe = 1, - True = -1, - } - const collator: { - compare(a: string, b: string): number; - }; - function createMap(template?: MapLike): Map; - function createFileMap(keyMapper?: (key: string) => string): FileMap; - function toPath(fileName: string, basePath: string, getCanonicalFileName: (path: string) => string): Path; - const enum Comparison { - LessThan = -1, - EqualTo = 0, - GreaterThan = 1, - } - function forEach(array: T[] | undefined, callback: (element: T, index: number) => U | undefined): U | undefined; - function zipWith(arrayA: T[], arrayB: U[], callback: (a: T, b: U, index: number) => void): void; - function every(array: T[], callback: (element: T, index: number) => boolean): boolean; - function find(array: T[], predicate: (element: T, index: number) => boolean): T | undefined; - function findMap(array: T[], callback: (element: T, index: number) => U | undefined): U; - function contains(array: T[], value: T): boolean; - function indexOf(array: T[], value: T): number; - function indexOfAnyCharCode(text: string, charCodes: number[], start?: number): number; - function countWhere(array: T[], predicate: (x: T, i: number) => boolean): number; - function filter(array: T[], f: (x: T) => x is U): U[]; - function filter(array: T[], f: (x: T) => boolean): T[]; - function removeWhere(array: T[], f: (x: T) => boolean): boolean; - function filterMutate(array: T[], f: (x: T) => boolean): void; - function map(array: T[], f: (x: T, i: number) => U): U[]; - function sameMap(array: T[], f: (x: T, i: number) => T): T[]; - function flatten(array: (T | T[])[]): T[]; - function flatMap(array: T[], mapfn: (x: T, i: number) => U | U[]): U[]; - function span(array: T[], f: (x: T, i: number) => boolean): [T[], T[]]; - function spanMap(array: T[], keyfn: (x: T, i: number) => K, mapfn: (chunk: T[], key: K, start: number, end: number) => U): U[]; - function mapObject(object: MapLike, f: (key: string, x: T) => [string, U]): MapLike; - function some(array: T[], predicate?: (value: T) => boolean): boolean; - function concatenate(array1: T[], array2: T[]): T[]; - function deduplicate(array: T[], areEqual?: (a: T, b: T) => boolean): T[]; - function arrayIsEqualTo(array1: ReadonlyArray, array2: ReadonlyArray, equaler?: (a: T, b: T) => boolean): boolean; - function changesAffectModuleResolution(oldOptions: CompilerOptions, newOptions: CompilerOptions): boolean; - function compact(array: T[]): T[]; - function relativeComplement(arrayA: T[] | undefined, arrayB: T[] | undefined, comparer?: (x: T, y: T) => Comparison, offsetA?: number, offsetB?: number): T[] | undefined; - function sum(array: any[], prop: string): number; - function append(to: T[] | undefined, value: T | undefined): T[] | undefined; - function addRange(to: T[] | undefined, from: T[] | undefined): T[] | undefined; - function stableSort(array: T[], comparer?: (x: T, y: T) => Comparison): T[]; - function rangeEquals(array1: T[], array2: T[], pos: number, end: number): boolean; - function firstOrUndefined(array: T[]): T; - function lastOrUndefined(array: T[]): T; - function singleOrUndefined(array: T[]): T; - function singleOrMany(array: T[]): T | T[]; - function replaceElement(array: T[], index: number, value: T): T[]; - function binarySearch(array: T[], value: T, comparer?: (v1: T, v2: T) => number, offset?: number): number; - function reduceLeft(array: T[], f: (memo: U, value: T, i: number) => U, initial: U, start?: number, count?: number): U; - function reduceLeft(array: T[], f: (memo: T, value: T, i: number) => T): T; - function reduceRight(array: T[], f: (memo: U, value: T, i: number) => U, initial: U, start?: number, count?: number): U; - function reduceRight(array: T[], f: (memo: T, value: T, i: number) => T): T; - function hasProperty(map: MapLike, key: string): boolean; - function getProperty(map: MapLike, key: string): T | undefined; - function getOwnKeys(map: MapLike): string[]; - function forEachProperty(map: Map, callback: (value: T, key: string) => U): U; - function someProperties(map: Map, predicate?: (value: T, key: string) => boolean): boolean; - function copyProperties(source: Map, target: MapLike): void; - function appendProperty(map: Map, key: string | number, value: T): Map; - function assign, T2, T3>(t: T1, arg1: T2, arg2: T3): T1 & T2 & T3; - function assign, T2>(t: T1, arg1: T2): T1 & T2; - function assign>(t: T1, ...args: any[]): any; - function reduceProperties(map: Map, callback: (aggregate: U, value: T, key: string) => U, initial: U): U; - function reduceOwnProperties(map: MapLike, callback: (aggregate: U, value: T, key: string) => U, initial: U): U; - function equalOwnProperties(left: MapLike, right: MapLike, equalityComparer?: (left: T, right: T) => boolean): boolean; - function arrayToMap(array: T[], makeKey: (value: T) => string): Map; - function arrayToMap(array: T[], makeKey: (value: T) => string, makeValue: (value: T) => U): Map; - function isEmpty(map: Map): boolean; - function cloneMap(map: Map): Map; - function clone(object: T): T; - function extend(first: T1, second: T2): T1 & T2; - function multiMapAdd(map: Map, key: string | number, value: V): V[]; - function multiMapRemove(map: Map, key: string, value: V): void; - function isArray(value: any): value is any[]; - function noop(): void; - function notImplemented(): never; - function memoize(callback: () => T): () => T; - function chain(...args: ((t: T) => (u: U) => U)[]): (t: T) => (u: U) => U; - function compose(...args: ((t: T) => T)[]): (t: T) => T; - let localizedDiagnosticMessages: Map; - function getLocaleSpecificMessage(message: DiagnosticMessage): string; - function createFileDiagnostic(file: SourceFile, start: number, length: number, message: DiagnosticMessage, ...args: (string | number)[]): Diagnostic; - function formatMessage(_dummy: any, message: DiagnosticMessage): string; - function createCompilerDiagnostic(message: DiagnosticMessage, ...args: (string | number)[]): Diagnostic; - function createCompilerDiagnosticFromMessageChain(chain: DiagnosticMessageChain): Diagnostic; - function chainDiagnosticMessages(details: DiagnosticMessageChain, message: DiagnosticMessage, ...args: any[]): DiagnosticMessageChain; - function concatenateDiagnosticMessageChains(headChain: DiagnosticMessageChain, tailChain: DiagnosticMessageChain): DiagnosticMessageChain; - function compareValues(a: T, b: T): Comparison; - function compareStrings(a: string, b: string, ignoreCase?: boolean): Comparison; - function compareStringsCaseInsensitive(a: string, b: string): Comparison; - function compareDiagnostics(d1: Diagnostic, d2: Diagnostic): Comparison; - function sortAndDeduplicateDiagnostics(diagnostics: Diagnostic[]): Diagnostic[]; - function deduplicateSortedDiagnostics(diagnostics: Diagnostic[]): Diagnostic[]; - function normalizeSlashes(path: string): string; - function getRootLength(path: string): number; - const directorySeparator = "/"; - function normalizePath(path: string): string; - function pathEndsWithDirectorySeparator(path: string): boolean; - function getDirectoryPath(path: Path): Path; - function getDirectoryPath(path: string): string; - function isUrl(path: string): boolean; - function isExternalModuleNameRelative(moduleName: string): boolean; - function getEmitScriptTarget(compilerOptions: CompilerOptions): ScriptTarget; - function getEmitModuleKind(compilerOptions: CompilerOptions): ModuleKind; - function getEmitModuleResolutionKind(compilerOptions: CompilerOptions): ModuleResolutionKind; - function hasZeroOrOneAsteriskCharacter(str: string): boolean; - function isRootedDiskPath(path: string): boolean; - function convertToRelativePath(absoluteOrRelativePath: string, basePath: string, getCanonicalFileName: (path: string) => string): string; - function getNormalizedPathComponents(path: string, currentDirectory: string): string[]; - function getNormalizedAbsolutePath(fileName: string, currentDirectory: string): string; - function getNormalizedPathFromPathComponents(pathComponents: string[]): string; - function getRelativePathToDirectoryOrUrl(directoryPathOrUrl: string, relativeOrAbsolutePath: string, currentDirectory: string, getCanonicalFileName: (fileName: string) => string, isAbsolutePathAnUrl: boolean): string; - function getBaseFileName(path: string): string; - function combinePaths(path1: string, path2: string): string; - function removeTrailingDirectorySeparator(path: string): string; - function ensureTrailingDirectorySeparator(path: string): string; - function comparePaths(a: string, b: string, currentDirectory: string, ignoreCase?: boolean): Comparison; - function containsPath(parent: string, child: string, currentDirectory: string, ignoreCase?: boolean): boolean; - function startsWith(str: string, prefix: string): boolean; - function endsWith(str: string, suffix: string): boolean; - function hasExtension(fileName: string): boolean; - function fileExtensionIs(path: string, extension: string): boolean; - function fileExtensionIsAny(path: string, extensions: string[]): boolean; - function getRegularExpressionForWildcard(specs: string[], basePath: string, usage: "files" | "directories" | "exclude"): string; - function isImplicitGlob(lastPathComponent: string): boolean; - interface FileSystemEntries { - files: string[]; - directories: string[]; - } - interface FileMatcherPatterns { - includeFilePattern: string; - includeDirectoryPattern: string; - excludePattern: string; - basePaths: string[]; - } - function getFileMatcherPatterns(path: string, excludes: string[], includes: string[], useCaseSensitiveFileNames: boolean, currentDirectory: string): FileMatcherPatterns; - function matchFiles(path: string, extensions: string[], excludes: string[], includes: string[], useCaseSensitiveFileNames: boolean, currentDirectory: string, getFileSystemEntries: (path: string) => FileSystemEntries): string[]; - function ensureScriptKind(fileName: string, scriptKind?: ScriptKind): ScriptKind; - function getScriptKindFromFileName(fileName: string): ScriptKind; - const supportedTypeScriptExtensions: string[]; - const supportedTypescriptExtensionsForExtractExtension: string[]; - const supportedJavascriptExtensions: string[]; - function getSupportedExtensions(options?: CompilerOptions): string[]; - function hasJavaScriptFileExtension(fileName: string): boolean; - function hasTypeScriptFileExtension(fileName: string): boolean; - function isSupportedSourceFileName(fileName: string, compilerOptions?: CompilerOptions): boolean; - const enum ExtensionPriority { - TypeScriptFiles = 0, - DeclarationAndJavaScriptFiles = 2, - Limit = 5, - Highest = 0, - Lowest = 2, - } - function getExtensionPriority(path: string, supportedExtensions: string[]): ExtensionPriority; - function adjustExtensionPriority(extensionPriority: ExtensionPriority): ExtensionPriority; - function getNextLowestExtensionPriority(extensionPriority: ExtensionPriority): ExtensionPriority; - function removeFileExtension(path: string): string; - function tryRemoveExtension(path: string, extension: string): string | undefined; - function removeExtension(path: string, extension: string): string; - function changeExtension(path: T, newExtension: string): T; - interface ObjectAllocator { - getNodeConstructor(): new (kind: SyntaxKind, pos?: number, end?: number) => Node; - getTokenConstructor(): new (kind: TKind, pos?: number, end?: number) => Token; - getIdentifierConstructor(): new (kind: SyntaxKind.Identifier, pos?: number, end?: number) => Identifier; - getSourceFileConstructor(): new (kind: SyntaxKind.SourceFile, pos?: number, end?: number) => SourceFile; - getSymbolConstructor(): new (flags: SymbolFlags, name: string) => Symbol; - getTypeConstructor(): new (checker: TypeChecker, flags: TypeFlags) => Type; - getSignatureConstructor(): new (checker: TypeChecker) => Signature; - } - let objectAllocator: ObjectAllocator; - const enum AssertionLevel { - None = 0, - Normal = 1, - Aggressive = 2, - VeryAggressive = 3, - } - namespace Debug { - let currentAssertionLevel: AssertionLevel; - function shouldAssert(level: AssertionLevel): boolean; - function assert(expression: boolean, message?: string, verboseDebugInfo?: () => string): void; - function fail(message?: string): void; - } - function orderedRemoveItem(array: T[], item: T): boolean; - function orderedRemoveItemAt(array: T[], index: number): void; - function unorderedRemoveItemAt(array: T[], index: number): void; - function unorderedRemoveItem(array: T[], item: T): void; - function createGetCanonicalFileName(useCaseSensitiveFileNames: boolean): (fileName: string) => string; - function matchPatternOrExact(patternStrings: string[], candidate: string): string | Pattern | undefined; - function patternText({prefix, suffix}: Pattern): string; - function matchedText(pattern: Pattern, candidate: string): string; - function findBestPatternMatch(values: T[], getPattern: (value: T) => Pattern, candidate: string): T | undefined; - function tryParsePattern(pattern: string): Pattern | undefined; - function positionIsSynthesized(pos: number): boolean; - function extensionIsTypeScript(ext: Extension): boolean; - function extensionFromPath(path: string): Extension; - function tryGetExtensionFromPath(path: string): Extension | undefined; + const version = "2.3.0-dev.20170419"; } +declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any; +declare function clearTimeout(handle: any): void; declare namespace ts { type FileWatcherCallback = (fileName: string, removed?: boolean) => void; type DirectoryWatcherCallback = (fileName: string) => void; @@ -3781,8 +2303,6 @@ declare namespace ts { getMemoryUsage?(): number; exit(exitCode?: number): void; realpath?(path: string): string; - getEnvironmentVariable(name: string): string; - tryEnableSourceMapsForHost?(): void; setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any; clearTimeout?(timeoutId: any): void; } @@ -3793,4829 +2313,13 @@ declare namespace ts { directoryName: string; referenceCount: number; } + function getNodeMajorVersion(): number; let sys: System; } -declare namespace ts { - const Diagnostics: { - Unterminated_string_literal: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Identifier_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_file_cannot_have_a_reference_to_itself: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Trailing_comma_not_allowed: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Asterisk_Slash_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Unexpected_token: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_rest_parameter_must_be_last_in_a_parameter_list: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_cannot_have_question_mark_and_initializer: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_required_parameter_cannot_follow_an_optional_parameter: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_index_signature_cannot_have_a_rest_parameter: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_index_signature_parameter_cannot_have_an_accessibility_modifier: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_index_signature_parameter_cannot_have_a_question_mark: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_index_signature_parameter_cannot_have_an_initializer: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_index_signature_must_have_a_type_annotation: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_index_signature_parameter_must_have_a_type_annotation: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_index_signature_parameter_type_must_be_string_or_number: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Accessibility_modifier_already_seen: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_modifier_must_precede_1_modifier: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_modifier_already_seen: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_modifier_cannot_appear_on_a_class_element: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - super_must_be_followed_by_an_argument_list_or_member_access: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Only_ambient_modules_can_use_quoted_names: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Statements_are_not_allowed_in_ambient_contexts: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Initializers_are_not_allowed_in_ambient_contexts: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_modifier_cannot_be_used_in_an_ambient_context: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_modifier_cannot_be_used_with_a_class_declaration: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_modifier_cannot_be_used_here: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_modifier_cannot_appear_on_a_data_property: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_modifier_cannot_appear_on_a_module_or_namespace_element: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_0_modifier_cannot_be_used_with_an_interface_declaration: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_rest_parameter_cannot_be_optional: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_rest_parameter_cannot_have_an_initializer: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_set_accessor_must_have_exactly_one_parameter: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_set_accessor_cannot_have_an_optional_parameter: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_set_accessor_parameter_cannot_have_an_initializer: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_set_accessor_cannot_have_rest_parameter: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_get_accessor_cannot_have_parameters: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_async_function_or_method_must_have_a_valid_awaitable_return_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Operand_for_await_does_not_have_a_valid_callable_then_member: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_expression_in_async_function_does_not_have_a_valid_callable_then_member: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Enum_member_must_have_initializer: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_export_assignment_cannot_be_used_in_a_namespace: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - In_ambient_enum_declarations_member_initializer_must_be_constant_expression: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_modifier_cannot_appear_on_a_type_member: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_modifier_cannot_appear_on_an_index_signature: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_0_modifier_cannot_be_used_with_an_import_declaration: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Invalid_reference_directive_syntax: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_accessor_cannot_be_declared_in_an_ambient_context: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_modifier_cannot_appear_on_a_constructor_declaration: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_modifier_cannot_appear_on_a_parameter: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_parameters_cannot_appear_on_a_constructor_declaration: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_annotation_cannot_appear_on_a_constructor_declaration: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_accessor_cannot_have_type_parameters: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_set_accessor_cannot_have_a_return_type_annotation: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_index_signature_must_have_exactly_one_parameter: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_list_cannot_be_empty: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_parameter_list_cannot_be_empty: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_argument_list_cannot_be_empty: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Invalid_use_of_0_in_strict_mode: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - with_statements_are_not_allowed_in_strict_mode: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - delete_cannot_be_called_on_an_identifier_in_strict_mode: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Jump_target_cannot_cross_function_boundary: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_return_statement_can_only_be_used_within_a_function_body: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Expression_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Duplicate_label_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_export_assignment_cannot_have_modifiers: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Octal_literals_are_not_allowed_in_strict_mode: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_tuple_type_element_list_cannot_be_empty: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Variable_declaration_list_cannot_be_empty: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Digit_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Hexadecimal_digit_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Unexpected_end_of_text: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Invalid_character: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Declaration_or_statement_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Statement_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - case_or_default_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Property_or_signature_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Enum_member_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Variable_declaration_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Argument_expression_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Property_assignment_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Expression_or_comma_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_declaration_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_parameter_declaration_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_argument_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - String_literal_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Line_break_not_permitted_here: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - or_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Declaration_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Import_declarations_in_a_namespace_cannot_reference_a_module: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_use_imports_exports_or_module_augmentations_when_module_is_none: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - File_name_0_differs_from_already_included_file_name_1_only_in_casing: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - const_declarations_must_be_initialized: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - const_declarations_can_only_be_declared_inside_a_block: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - let_declarations_can_only_be_declared_inside_a_block: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Unterminated_template_literal: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Unterminated_regular_expression_literal: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_object_member_cannot_be_declared_optional: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_yield_expression_is_only_allowed_in_a_generator_body: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Computed_property_names_are_not_allowed_in_enums: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_comma_expression_is_not_allowed_in_a_computed_property_name: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - extends_clause_already_seen: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - extends_clause_must_precede_implements_clause: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Classes_can_only_extend_a_single_class: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - implements_clause_already_seen: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Interface_declaration_cannot_have_implements_clause: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Binary_digit_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Octal_digit_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Unexpected_token_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Property_destructuring_pattern_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Array_element_destructuring_pattern_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_destructuring_declaration_must_have_an_initializer: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_implementation_cannot_be_declared_in_ambient_contexts: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Modifiers_cannot_appear_here: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Merge_conflict_marker_encountered: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_rest_element_cannot_have_an_initializer: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_parameter_property_may_not_be_declared_using_a_binding_pattern: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_import_declaration_cannot_have_modifiers: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Module_0_has_no_default_export: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_export_declaration_cannot_have_modifiers: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Export_declarations_are_not_permitted_in_a_namespace: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Catch_clause_variable_cannot_have_a_type_annotation: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Catch_clause_variable_cannot_have_an_initializer: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Unterminated_Unicode_escape_sequence: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Line_terminator_not_permitted_before_arrow: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Import_assignment_cannot_be_used_when_targeting_ECMAScript_2015_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Export_assignment_cannot_be_used_when_targeting_ECMAScript_2015_modules_Consider_using_export_default_or_another_module_format_instead: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Decorators_are_not_valid_here: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_class_declaration_without_the_default_modifier_must_have_a_name: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Identifier_expected_0_is_a_reserved_word_in_strict_mode: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Invalid_use_of_0_Modules_are_automatically_in_strict_mode: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Export_assignment_is_not_supported_when_module_flag_is_system: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Generators_are_not_allowed_in_an_ambient_context: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_overload_signature_cannot_be_declared_as_a_generator: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_tag_already_specified: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Signature_0_must_have_a_type_predicate: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_find_parameter_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_predicate_0_is_not_assignable_to_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_is_not_in_the_same_position_as_parameter_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_type_predicate_cannot_reference_a_rest_parameter: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_type_predicate_cannot_reference_element_0_in_a_binding_pattern: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_export_assignment_can_only_be_used_in_a_module: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_import_declaration_can_only_be_used_in_a_namespace_or_module: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_export_declaration_can_only_be_used_in_a_module: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_namespace_declaration_is_only_allowed_in_a_namespace_or_module: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_return_type_of_a_property_decorator_function_must_be_either_void_or_any: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_modifier_cannot_be_used_with_1_modifier: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Abstract_methods_can_only_appear_within_an_abstract_class: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Method_0_cannot_have_an_implementation_because_it_is_marked_abstract: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_interface_property_cannot_have_an_initializer: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_type_literal_property_cannot_have_an_initializer: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_class_member_cannot_have_the_0_keyword: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_decorator_can_only_decorate_a_method_implementation_not_an_overload: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_tag_cannot_be_used_independently_as_a_top_level_JSDoc_tag: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - with_statements_are_not_allowed_in_an_async_function_block: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - await_expression_is_only_allowed_within_an_async_function: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_body_of_an_if_statement_cannot_be_the_empty_statement: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Global_module_exports_may_only_appear_in_module_files: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Global_module_exports_may_only_appear_in_declaration_files: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Global_module_exports_may_only_appear_at_top_level: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_parameter_property_cannot_be_declared_using_a_rest_parameter: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Duplicate_identifier_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Static_members_cannot_reference_class_type_parameters: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Circular_definition_of_import_alias_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_find_name_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Module_0_has_no_exported_member_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - File_0_is_not_a_module: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_find_module_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_0_recursively_references_itself_as_a_base_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_class_may_only_extend_another_class: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_interface_may_only_extend_a_class_or_another_interface: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_parameter_0_has_a_circular_constraint: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Generic_type_0_requires_1_type_argument_s: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_0_is_not_generic: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Global_type_0_must_be_a_class_or_interface_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Global_type_0_must_have_1_type_parameter_s: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_find_global_type_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Named_property_0_of_types_1_and_2_are_not_identical: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Interface_0_cannot_simultaneously_extend_types_1_and_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Excessive_stack_depth_comparing_types_0_and_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_0_is_not_assignable_to_type_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_redeclare_exported_variable_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Property_0_is_missing_in_type_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Property_0_is_private_in_type_1_but_not_in_type_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Types_of_property_0_are_incompatible: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Property_0_is_optional_in_type_1_but_required_in_type_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Types_of_parameters_0_and_1_are_incompatible: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Index_signature_is_missing_in_type_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Index_signatures_are_incompatible: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - this_cannot_be_referenced_in_a_module_or_namespace_body: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - this_cannot_be_referenced_in_current_location: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - this_cannot_be_referenced_in_constructor_arguments: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - this_cannot_be_referenced_in_a_static_property_initializer: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - super_can_only_be_referenced_in_a_derived_class: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - super_cannot_be_referenced_in_constructor_arguments: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Property_0_does_not_exist_on_type_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Property_0_is_private_and_only_accessible_within_class_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_0_does_not_satisfy_the_constraint_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Supplied_parameters_do_not_match_any_signature_of_call_target: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Untyped_function_calls_may_not_accept_type_arguments: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Only_a_void_function_can_be_called_with_the_new_keyword: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_0_cannot_be_converted_to_type_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Operator_0_cannot_be_applied_to_types_1_and_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_parameter_name_cannot_be_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_parameter_property_is_only_allowed_in_a_constructor_implementation: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_rest_parameter_must_be_of_an_array_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_cannot_be_referenced_in_its_initializer: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Duplicate_string_index_signature: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Duplicate_number_index_signature: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Constructors_for_derived_classes_must_contain_a_super_call: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_get_accessor_must_return_a_value: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Getter_and_setter_accessors_do_not_agree_in_visibility: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - get_and_set_accessor_must_have_the_same_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_signature_with_an_implementation_cannot_use_a_string_literal_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Overload_signatures_must_all_be_exported_or_non_exported: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Overload_signatures_must_all_be_ambient_or_non_ambient: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Overload_signatures_must_all_be_public_private_or_protected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Overload_signatures_must_all_be_optional_or_required: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Function_overload_must_be_static: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Function_overload_must_not_be_static: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Function_implementation_name_must_be_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Constructor_implementation_is_missing: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Function_implementation_is_missing_or_not_immediately_following_the_declaration: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Multiple_constructor_implementations_are_not_allowed: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Duplicate_function_implementation: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Overload_signature_is_not_compatible_with_function_implementation: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Declaration_name_conflicts_with_built_in_global_identifier_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Setters_cannot_return_a_value: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Class_name_cannot_be_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Class_0_incorrectly_extends_base_class_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Class_static_side_0_incorrectly_extends_base_class_static_side_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Class_0_incorrectly_implements_interface_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_class_may_only_implement_another_class_or_interface: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Interface_name_cannot_be_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - All_declarations_of_0_must_have_identical_type_parameters: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Interface_0_incorrectly_extends_interface_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Enum_name_cannot_be_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Ambient_module_declaration_cannot_specify_relative_module_name: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Import_name_cannot_be_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Import_declaration_conflicts_with_local_declaration_of_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Types_have_separate_declarations_of_a_private_property_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Property_0_is_protected_in_type_1_but_public_in_type_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Block_scoped_variable_0_used_before_its_declaration: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_redeclare_block_scoped_variable_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_enum_member_cannot_have_a_numeric_name: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Variable_0_is_used_before_being_assigned: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_alias_0_circularly_references_itself: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_alias_name_cannot_be_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_AMD_module_cannot_have_multiple_name_assignments: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_0_has_no_property_1_and_no_string_index_signature: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_0_has_no_property_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_0_is_not_an_array_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_rest_element_must_be_last_in_a_destructuring_pattern: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - this_cannot_be_referenced_in_a_computed_property_name: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - super_cannot_be_referenced_in_a_computed_property_name: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_find_global_value_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_0_operator_cannot_be_applied_to_type_symbol: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_computed_property_name_of_the_form_0_must_be_of_type_symbol: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Enum_declarations_must_all_be_const_or_non_const: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - In_const_enum_declarations_member_initializer_must_be_constant_expression: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_const_enum_member_can_only_be_accessed_using_a_string_literal: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Property_0_does_not_exist_on_const_enum_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Export_declaration_conflicts_with_exported_declaration_of_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_iterator_must_have_a_next_method: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_redeclare_identifier_0_in_catch_clause: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_0_is_not_an_array_type_or_a_string_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Module_0_uses_export_and_cannot_be_used_with_export_Asterisk: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_rest_element_cannot_contain_a_binding_pattern: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_find_namespace_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_generator_cannot_have_a_void_type_annotation: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_is_referenced_directly_or_indirectly_in_its_own_base_expression: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_0_is_not_a_constructor_function_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - No_base_constructor_has_the_specified_number_of_type_arguments: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Base_constructor_return_type_0_is_not_a_class_or_interface_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Base_constructors_must_all_have_the_same_return_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_create_an_instance_of_the_abstract_class_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Overload_signatures_must_all_be_abstract_or_non_abstract: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Classes_containing_abstract_methods_must_be_marked_abstract: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - All_declarations_of_an_abstract_method_must_be_consecutive: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - yield_expressions_cannot_be_used_in_a_parameter_initializer: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - await_expressions_cannot_be_used_in_a_parameter_initializer: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_module_cannot_have_multiple_default_exports: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Property_0_is_incompatible_with_index_signature: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Object_is_possibly_null: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Object_is_possibly_undefined: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Object_is_possibly_null_or_undefined: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_function_returning_never_cannot_have_a_reachable_end_point: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Enum_type_0_has_members_with_initializers_that_are_not_literals: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_0_cannot_be_used_to_index_type_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_0_has_no_matching_index_signature_for_type_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_0_cannot_be_used_as_an_index_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_assign_to_0_because_it_is_not_a_variable: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_target_of_an_assignment_must_be_a_variable_or_a_property_access: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Index_signature_in_type_0_only_permits_reading: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - JSX_element_attributes_type_0_may_not_be_a_union_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Property_0_in_type_1_is_not_assignable_to_type_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - JSX_element_type_0_does_not_have_any_construct_or_call_signatures: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_global_type_JSX_0_may_not_have_more_than_one_property: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_emit_namespaced_JSX_elements_in_React: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_package_author_to_update_the_package_definition: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - JSX_expressions_must_have_one_parent_element: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_0_provides_no_match_for_the_signature_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_find_name_0_Did_you_mean_the_static_member_1_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_find_name_0_Did_you_mean_the_instance_member_this_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Invalid_module_name_in_augmentation_module_0_cannot_be_found: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Exports_and_export_assignments_are_not_permitted_in_module_augmentations: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_assign_a_0_constructor_type_to_a_1_constructor_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_extend_a_class_0_Class_constructor_is_marked_as_private: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Accessors_must_both_be_abstract_or_non_abstract: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_0_is_not_comparable_to_type_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_this_parameter_must_be_the_first_parameter: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_constructor_cannot_have_a_this_parameter: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - get_and_set_accessor_must_have_the_same_this_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_this_types_of_each_signature_are_incompatible: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - All_declarations_of_0_must_have_identical_modifiers: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_find_type_definition_file_for_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_extend_an_interface_0_Did_you_mean_implements: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_class_must_be_declared_after_its_base_class: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Namespace_0_has_no_exported_member_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Left_side_of_comma_operator_is_unused_and_has_no_side_effects: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Spread_types_may_only_be_created_from_object_types: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Rest_types_may_only_be_created_from_object_types: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Import_declaration_0_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Exported_variable_0_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Public_property_0_of_exported_class_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Property_0_of_exported_interface_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Return_type_of_exported_function_has_or_is_using_private_name_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_of_exported_function_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Exported_type_alias_0_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Default_export_of_the_module_has_or_is_using_private_name_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_current_host_does_not_support_the_0_option: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_find_the_common_subdirectory_path_for_the_input_files: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_read_file_0_Colon_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Unsupported_file_encoding: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Failed_to_parse_file_0_Colon_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Unknown_compiler_option_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Compiler_option_0_requires_a_value_of_type_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Could_not_write_file_0_Colon_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Option_0_cannot_be_specified_without_specifying_option_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Option_0_cannot_be_specified_with_option_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_tsconfig_json_file_is_already_defined_at_Colon_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_write_file_0_because_it_would_overwrite_input_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_specified_path_does_not_exist_Colon_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Option_paths_cannot_be_used_without_specifying_baseUrl_option: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Pattern_0_can_have_at_most_one_Asterisk_character: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Substitutions_for_pattern_0_should_be_an_array: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Substitutions_for_pattern_0_shouldn_t_be_an_empty_array: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Concatenate_and_emit_output_to_single_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Generates_corresponding_d_ts_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Watch_input_files: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Redirect_output_structure_to_the_directory: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Do_not_erase_const_enum_declarations_in_generated_code: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Do_not_emit_outputs_if_any_errors_were_reported: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Do_not_emit_comments_to_output: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Do_not_emit_outputs: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Skip_type_checking_of_declaration_files: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Print_this_message: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Print_the_compiler_s_version: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Compile_the_project_in_the_given_directory: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Syntax_Colon_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - options: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Examples_Colon_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Options_Colon: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Version_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Insert_command_line_options_and_files_from_a_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - File_change_detected_Starting_incremental_compilation: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - KIND: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - FILE: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - VERSION: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - LOCATION: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - DIRECTORY: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - STRATEGY: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Compilation_complete_Watching_for_file_changes: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Generates_corresponding_map_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Compiler_option_0_expects_an_argument: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Unterminated_quoted_string_in_response_file_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Argument_for_0_option_must_be_Colon_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Unsupported_locale_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Unable_to_open_file_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Corrupted_locale_file_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Raise_error_on_expressions_and_declarations_with_an_implied_any_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - File_0_not_found: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - File_0_has_unsupported_extension_The_only_supported_extensions_are_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - NEWLINE: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Option_0_can_only_be_specified_in_tsconfig_json_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Enables_experimental_support_for_ES7_decorators: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Enables_experimental_support_for_emitting_type_metadata_for_decorators: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Enables_experimental_support_for_ES7_async_functions: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Successfully_created_a_tsconfig_json_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Suppress_excess_property_checks_for_object_literals: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Stylize_errors_and_messages_using_color_and_context_experimental: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Do_not_report_errors_on_unused_labels: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Report_error_when_not_all_code_paths_in_function_return_a_value: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Report_errors_for_fallthrough_cases_in_switch_statement: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Do_not_report_errors_on_unreachable_code: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Disallow_inconsistently_cased_references_to_the_same_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Specify_library_files_to_be_included_in_the_compilation_Colon: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Specify_JSX_code_generation_Colon_preserve_or_react: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Only_amd_and_system_modules_are_supported_alongside_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Base_directory_to_resolve_non_absolute_module_names: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Enable_tracing_of_the_name_resolution_process: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Resolving_module_0_from_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Explicitly_specified_module_resolution_kind_Colon_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Module_resolution_kind_is_not_specified_using_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Module_name_0_was_successfully_resolved_to_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Module_name_0_was_not_resolved: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Module_name_0_matched_pattern_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Trying_substitution_0_candidate_module_location_Colon_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Resolving_module_name_0_relative_to_base_url_1_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Loading_module_as_file_Slash_folder_candidate_module_location_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - File_0_does_not_exist: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - File_0_exist_use_it_as_a_name_resolution_result: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Loading_module_0_from_node_modules_folder: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Found_package_json_at_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - package_json_does_not_have_a_types_or_main_field: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - package_json_has_0_field_1_that_references_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Allow_javascript_files_to_be_compiled: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Option_0_should_have_array_of_strings_as_a_value: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Checking_if_0_is_the_longest_matching_prefix_for_1_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Expected_type_of_0_field_in_package_json_to_be_string_got_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Longest_matching_prefix_for_0_is_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Loading_0_from_the_root_dir_1_candidate_location_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Trying_other_entries_in_rootDirs: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Module_resolution_using_rootDirs_has_failed: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Do_not_emit_use_strict_directives_in_module_output: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Enable_strict_null_checks: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Unknown_option_excludes_Did_you_mean_exclude: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Raise_error_on_this_expressions_with_an_implied_any_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Resolving_type_reference_directive_0_containing_file_1_root_directory_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Resolving_using_primary_search_paths: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Resolving_from_node_modules_folder: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_reference_directive_0_was_not_resolved: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Resolving_with_primary_search_path_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Root_directory_cannot_be_determined_skipping_primary_search_paths: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_declaration_files_to_be_included_in_compilation: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Looking_up_in_node_modules_folder_initial_location_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_config_file_0_found_doesn_t_contain_any_source_files: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Resolving_real_path_for_0_result_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - File_name_0_has_a_1_extension_stripping_it: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_is_declared_but_never_used: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Report_errors_on_unused_locals: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Report_errors_on_unused_parameters: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - No_types_specified_in_package_json_so_returning_main_value_of_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Property_0_is_declared_but_never_used: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Import_emit_helpers_from_tslib: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parse_in_strict_mode_and_emit_use_strict_for_each_source_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Module_0_was_resolved_to_1_but_jsx_is_not_set: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Module_0_was_resolved_to_1_but_allowJs_is_not_set: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Variable_0_implicitly_has_an_1_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Parameter_0_implicitly_has_an_1_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Member_0_implicitly_has_an_1_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Object_literal_s_property_0_implicitly_has_an_1_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Rest_parameter_0_implicitly_has_an_any_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Unreachable_code_detected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Unused_label: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Fallthrough_case_in_switch: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Not_all_code_paths_return_a_value: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Binding_element_0_implicitly_has_an_1_type: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - You_cannot_rename_this_element: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - import_can_only_be_used_in_a_ts_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - export_can_only_be_used_in_a_ts_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - type_parameter_declarations_can_only_be_used_in_a_ts_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - implements_clauses_can_only_be_used_in_a_ts_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - interface_declarations_can_only_be_used_in_a_ts_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - module_declarations_can_only_be_used_in_a_ts_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - type_aliases_can_only_be_used_in_a_ts_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - _0_can_only_be_used_in_a_ts_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - types_can_only_be_used_in_a_ts_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - type_arguments_can_only_be_used_in_a_ts_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - parameter_modifiers_can_only_be_used_in_a_ts_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - enum_declarations_can_only_be_used_in_a_ts_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - type_assertion_expressions_can_only_be_used_in_a_ts_file: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - class_expressions_are_not_currently_supported: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Language_service_is_disabled: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - JSX_attributes_must_only_be_assigned_a_non_empty_expression: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - JSX_elements_cannot_have_multiple_attributes_with_the_same_name: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Expected_corresponding_JSX_closing_tag_for_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - JSX_attribute_expected: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Cannot_use_JSX_unless_the_jsx_flag_is_provided: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - JSX_element_0_has_no_corresponding_closing_tag: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Unknown_type_acquisition_option_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Circularity_detected_while_resolving_configuration_Colon_0: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - The_files_list_in_config_file_0_is_empty: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Add_missing_super_call: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Make_super_call_the_first_statement_in_the_constructor: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Change_extends_to_implements: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Remove_unused_identifiers: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Implement_interface_on_reference: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Implement_interface_on_class: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Implement_inherited_abstract_class: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Import_0_from_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Change_0_to_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - Add_0_to_existing_import_declaration_from_1: { - code: number; - category: DiagnosticCategory; - key: string; - message: string; - }; - }; -} declare namespace ts { interface ErrorCallback { (message: DiagnosticMessage, length: number): void; } - function tokenIsIdentifierOrKeyword(token: SyntaxKind): boolean; interface Scanner { getStartPos(): number; getToken(): SyntaxKind; @@ -8647,50 +2351,25 @@ declare namespace ts { scanRange(start: number, length: number, callback: () => T): T; tryScan(callback: () => T): T; } - function isUnicodeIdentifierStart(code: number, languageVersion: ScriptTarget): boolean; function tokenToString(t: SyntaxKind): string; - function stringToToken(s: string): SyntaxKind; - function computeLineStarts(text: string): number[]; function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; - function computePositionOfLineAndCharacter(lineStarts: number[], line: number, character: number): number; - function getLineStarts(sourceFile: SourceFile): number[]; - function computeLineAndCharacterOfPosition(lineStarts: number[], position: number): { - line: number; - character: number; - }; function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; function isWhiteSpace(ch: number): boolean; function isWhiteSpaceSingleLine(ch: number): boolean; function isLineBreak(ch: number): boolean; - function isOctalDigit(ch: number): boolean; function couldStartTrivia(text: string, pos: number): boolean; - function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean, stopAtComments?: boolean): number; - function forEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: SyntaxKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U; - function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: SyntaxKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U; - function reduceEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: SyntaxKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; - function reduceEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: SyntaxKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; - function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; - function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; + function forEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U; + function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U; + function reduceEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; + function reduceEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; + function getLeadingCommentRanges(text: string, pos: number): CommentRange[] | undefined; + function getTrailingCommentRanges(text: string, pos: number): CommentRange[] | undefined; function getShebang(text: string): string; function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; - function isIdentifierText(name: string, languageVersion: ScriptTarget): boolean; function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, text?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner; } declare namespace ts { - const compileOnSaveCommandLineOption: CommandLineOption; - const optionDeclarations: CommandLineOption[]; - let typeAcquisitionDeclarations: CommandLineOption[]; - interface OptionNameMap { - optionNameMap: Map; - shortOptionNames: Map; - } - const defaultInitCompilerOptions: CompilerOptions; - function convertEnableAutoDiscoveryToEnable(typeAcquisition: TypeAcquisition): TypeAcquisition; - function getOptionNameMap(): OptionNameMap; - function createCompilerDiagnosticForInvalidCustomType(opt: CommandLineOptionOfCustomType): Diagnostic; - function parseCustomTypeOption(opt: CommandLineOptionOfCustomType, value: string, errors: Diagnostic[]): string | number; - function parseListTypeOption(opt: CommandLineOptionOfListType, value: string, errors: Diagnostic[]): (string | number)[] | undefined; function parseCommandLine(commandLine: string[], readFile?: (path: string) => string): ParsedCommandLine; function readConfigFile(fileName: string, readFile: (path: string) => string): { config?: any; @@ -8700,10 +2379,7 @@ declare namespace ts { config?: any; error?: Diagnostic; }; - function generateTSConfig(options: CompilerOptions, fileNames: string[]): { - compilerOptions: Map; - }; - function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[]): ParsedCommandLine; + function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: JsFileExtensionInfo[]): ParsedCommandLine; function convertCompileOnSaveOptionFromJson(jsonOption: any, basePath: string, errors: Diagnostic[]): boolean; function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): { options: CompilerOptions; @@ -8714,113 +2390,10 @@ declare namespace ts { errors: Diagnostic[]; }; } -declare namespace ts.JsTyping { - interface TypingResolutionHost { - directoryExists: (path: string) => boolean; - fileExists: (fileName: string) => boolean; - readFile: (path: string, encoding?: string) => string; - readDirectory: (rootDir: string, extensions: string[], excludes: string[], includes: string[], depth?: number) => string[]; - } - const nodeCoreModuleList: ReadonlyArray; - function discoverTypings(host: TypingResolutionHost, fileNames: string[], projectRootPath: Path, safeListPath: Path, packageNameToTypingLocation: Map, typeAcquisition: TypeAcquisition, unresolvedImports: ReadonlyArray): { - cachedTypingPaths: string[]; - newTypingNames: string[]; - filesToWatch: string[]; - }; -} -declare namespace ts.server { - const ActionSet: ActionSet; - const ActionInvalidate: ActionInvalidate; - const EventInstall: EventInstall; - namespace Arguments { - const GlobalCacheLocation = "--globalTypingsCacheLocation"; - const LogFile = "--logFile"; - const EnableTelemetry = "--enableTelemetry"; - } - function hasArgument(argumentName: string): boolean; - function findArgument(argumentName: string): string; -} -declare namespace ts.server { - enum LogLevel { - terse = 0, - normal = 1, - requestTime = 2, - verbose = 3, - } - const emptyArray: ReadonlyArray; - interface Logger { - close(): void; - hasLevel(level: LogLevel): boolean; - loggingEnabled(): boolean; - perftrc(s: string): void; - info(s: string): void; - startGroup(): void; - endGroup(): void; - msg(s: string, type?: Msg.Types): void; - getLogFileName(): string; - } - namespace Msg { - type Err = "Err"; - const Err: Err; - type Info = "Info"; - const Info: Info; - type Perf = "Perf"; - const Perf: Perf; - type Types = Err | Info | Perf; - } - function createInstallTypingsRequest(project: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray, cachePath?: string): DiscoverTypings; - namespace Errors { - function ThrowNoProject(): never; - function ThrowProjectLanguageServiceDisabled(): never; - function ThrowProjectDoesNotContainDocument(fileName: string, project: Project): never; - } - function getDefaultFormatCodeSettings(host: ServerHost): FormatCodeSettings; - function mergeMaps(target: MapLike, source: MapLike): void; - function removeItemFromSet(items: T[], itemToRemove: T): void; - type NormalizedPath = string & { - __normalizedPathTag: any; - }; - function toNormalizedPath(fileName: string): NormalizedPath; - function normalizedPathToPath(normalizedPath: NormalizedPath, currentDirectory: string, getCanonicalFileName: (f: string) => string): Path; - function asNormalizedPath(fileName: string): NormalizedPath; - interface NormalizedPathMap { - get(path: NormalizedPath): T; - set(path: NormalizedPath, value: T): void; - contains(path: NormalizedPath): boolean; - remove(path: NormalizedPath): void; - } - function createNormalizedPathMap(): NormalizedPathMap; - interface ProjectOptions { - configHasFilesProperty?: boolean; - files?: string[]; - wildcardDirectories?: Map; - compilerOptions?: CompilerOptions; - typeAcquisition?: TypeAcquisition; - compileOnSave?: boolean; - } - function isInferredProjectName(name: string): boolean; - function makeInferredProjectName(counter: number): string; - function toSortedReadonlyArray(arr: string[]): SortedReadonlyArray; - class ThrottledOperations { - private readonly host; - private pendingTimeouts; - constructor(host: ServerHost); - schedule(operationId: string, delay: number, cb: () => void): void; - private static run(self, operationId, cb); - } - class GcTimer { - private readonly host; - private readonly delay; - private readonly logger; - private timerId; - constructor(host: ServerHost, delay: number, logger: Logger); - scheduleCollect(): void; - private static run(self); - } -} declare namespace ts { - function trace(host: ModuleResolutionHost, message: DiagnosticMessage, ...args: any[]): void; - function isTraceEnabled(compilerOptions: CompilerOptions, host: ModuleResolutionHost): boolean; + interface Push { + push(value: T): void; + } function moduleHasNonRelativeName(moduleName: string): boolean; function getEffectiveTypeRoots(options: CompilerOptions, host: { directoryExists?: (directoryName: string) => boolean; @@ -8828,391 +2401,20 @@ declare namespace ts { }): string[] | undefined; function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost): ResolvedTypeReferenceDirectiveWithFailedLookupLocations; function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): string[]; - function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations; - function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations; - function directoryProbablyExists(directoryName: string, host: { - directoryExists?: (directoryName: string) => boolean; - }): boolean; - function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations; - function loadModuleFromGlobalCache(moduleName: string, projectName: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, globalCache: string): ResolvedModuleWithFailedLookupLocations; -} -declare namespace ts { - const externalHelpersModuleNameText = "tslib"; - interface ReferencePathMatchResult { - fileReference?: FileReference; - diagnosticMessage?: DiagnosticMessage; - isNoDefaultLib?: boolean; - isTypeReferenceDirective?: boolean; + interface ModuleResolutionCache extends NonRelativeModuleNameResolutionCache { + getOrCreateCacheForDirectory(directoryName: string): Map; } - function getDeclarationOfKind(symbol: Symbol, kind: SyntaxKind): Declaration; - interface StringSymbolWriter extends SymbolWriter { - string(): string; + interface NonRelativeModuleNameResolutionCache { + getOrCreateCacheForModuleName(nonRelativeModuleName: string): PerModuleNameCache; } - function getSingleLineStringWriter(): StringSymbolWriter; - function releaseStringWriter(writer: StringSymbolWriter): void; - function getFullWidth(node: Node): number; - function hasResolvedModule(sourceFile: SourceFile, moduleNameText: string): boolean; - function getResolvedModule(sourceFile: SourceFile, moduleNameText: string): ResolvedModuleFull; - function setResolvedModule(sourceFile: SourceFile, moduleNameText: string, resolvedModule: ResolvedModuleFull): void; - function setResolvedTypeReferenceDirective(sourceFile: SourceFile, typeReferenceDirectiveName: string, resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective): void; - function moduleResolutionIsEqualTo(oldResolution: ResolvedModuleFull, newResolution: ResolvedModuleFull): boolean; - function typeDirectiveIsEqualTo(oldResolution: ResolvedTypeReferenceDirective, newResolution: ResolvedTypeReferenceDirective): boolean; - function hasChangesInResolutions(names: string[], newResolutions: T[], oldResolutions: Map, comparer: (oldResolution: T, newResolution: T) => boolean): boolean; - function containsParseError(node: Node): boolean; - function getSourceFileOfNode(node: Node): SourceFile; - function isStatementWithLocals(node: Node): boolean; - function getStartPositionOfLine(line: number, sourceFile: SourceFile): number; - function nodePosToString(node: Node): string; - function getStartPosOfNode(node: Node): number; - function isDefined(value: any): boolean; - function getEndLinePosition(line: number, sourceFile: SourceFile): number; - function nodeIsMissing(node: Node): boolean; - function nodeIsPresent(node: Node): boolean; - function getTokenPosOfNode(node: Node, sourceFile?: SourceFile, includeJsDoc?: boolean): number; - function isJSDocNode(node: Node): boolean; - function isJSDocTag(node: Node): boolean; - function getNonDecoratorTokenPosOfNode(node: Node, sourceFile?: SourceFile): number; - function getSourceTextOfNodeFromSourceFile(sourceFile: SourceFile, node: Node, includeTrivia?: boolean): string; - function getTextOfNodeFromSourceText(sourceText: string, node: Node): string; - function getTextOfNode(node: Node, includeTrivia?: boolean): string; - function getLiteralText(node: LiteralLikeNode, sourceFile: SourceFile, languageVersion: ScriptTarget): string; - function isBinaryOrOctalIntegerLiteral(node: LiteralLikeNode, text: string): boolean; - function escapeIdentifier(identifier: string): string; - function unescapeIdentifier(identifier: string): string; - function makeIdentifierFromModuleName(moduleName: string): string; - function isBlockOrCatchScoped(declaration: Declaration): boolean; - function isCatchClauseVariableDeclarationOrBindingElement(declaration: Declaration): boolean; - function isAmbientModule(node: Node): boolean; - function isShorthandAmbientModuleSymbol(moduleSymbol: Symbol): boolean; - function isBlockScopedContainerTopLevel(node: Node): boolean; - function isGlobalScopeAugmentation(module: ModuleDeclaration): boolean; - function isExternalModuleAugmentation(node: Node): boolean; - function isBlockScope(node: Node, parentNode: Node): boolean; - function getEnclosingBlockScopeContainer(node: Node): Node; - function declarationNameToString(name: DeclarationName): string; - function getTextOfPropertyName(name: PropertyName): string; - function entityNameToString(name: EntityNameOrEntityNameExpression): string; - function createDiagnosticForNode(node: Node, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number): Diagnostic; - function createDiagnosticForNodeInSourceFile(sourceFile: SourceFile, node: Node, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number): Diagnostic; - function createDiagnosticForNodeFromMessageChain(node: Node, messageChain: DiagnosticMessageChain): Diagnostic; - function getSpanOfTokenAtPosition(sourceFile: SourceFile, pos: number): TextSpan; - function getErrorSpanForNode(sourceFile: SourceFile, node: Node): TextSpan; - function isExternalOrCommonJsModule(file: SourceFile): boolean; - function isDeclarationFile(file: SourceFile): boolean; - function isConstEnumDeclaration(node: Node): boolean; - function isConst(node: Node): boolean; - function isLet(node: Node): boolean; - function isSuperCall(n: Node): n is SuperCall; - function isPrologueDirective(node: Node): node is PrologueDirective; - function getLeadingCommentRangesOfNode(node: Node, sourceFileOfNode: SourceFile): CommentRange[]; - function getLeadingCommentRangesOfNodeFromText(node: Node, text: string): CommentRange[]; - function getJSDocCommentRanges(node: Node, text: string): CommentRange[]; - let fullTripleSlashReferencePathRegEx: RegExp; - let fullTripleSlashReferenceTypeReferenceDirectiveRegEx: RegExp; - let fullTripleSlashAMDReferencePathRegEx: RegExp; - function isPartOfTypeNode(node: Node): boolean; - function forEachReturnStatement(body: Block, visitor: (stmt: ReturnStatement) => T): T; - function forEachYieldExpression(body: Block, visitor: (expr: YieldExpression) => void): void; - function isVariableLike(node: Node): node is VariableLikeDeclaration; - function isAccessor(node: Node): node is AccessorDeclaration; - function isClassLike(node: Node): node is ClassLikeDeclaration; - function isFunctionLike(node: Node): node is FunctionLikeDeclaration; - function isFunctionLikeKind(kind: SyntaxKind): boolean; - function introducesArgumentsExoticObject(node: Node): boolean; - function isIterationStatement(node: Node, lookInLabeledStatements: boolean): node is IterationStatement; - function isFunctionBlock(node: Node): boolean; - function isObjectLiteralMethod(node: Node): node is MethodDeclaration; - function isObjectLiteralOrClassExpressionMethod(node: Node): node is MethodDeclaration; - function isIdentifierTypePredicate(predicate: TypePredicate): predicate is IdentifierTypePredicate; - function isThisTypePredicate(predicate: TypePredicate): predicate is ThisTypePredicate; - function getContainingFunction(node: Node): FunctionLikeDeclaration; - function getContainingClass(node: Node): ClassLikeDeclaration; - function getThisContainer(node: Node, includeArrowFunctions: boolean): Node; - function getSuperContainer(node: Node, stopOnFunctions: boolean): Node; - function getImmediatelyInvokedFunctionExpression(func: Node): CallExpression; - function isSuperProperty(node: Node): node is SuperProperty; - function getEntityNameFromTypeNode(node: TypeNode): EntityNameOrEntityNameExpression; - function isCallLikeExpression(node: Node): node is CallLikeExpression; - function getInvokedExpression(node: CallLikeExpression): Expression; - function nodeCanBeDecorated(node: Node): boolean; - function nodeIsDecorated(node: Node): boolean; - function nodeOrChildIsDecorated(node: Node): boolean; - function childIsDecorated(node: Node): boolean; - function isJSXTagName(node: Node): boolean; - function isPartOfExpression(node: Node): boolean; - function isInstantiatedModule(node: ModuleDeclaration, preserveConstEnums: boolean): boolean; - function isExternalModuleImportEqualsDeclaration(node: Node): boolean; - function getExternalModuleImportEqualsDeclarationExpression(node: Node): Expression; - function isInternalModuleImportEqualsDeclaration(node: Node): node is ImportEqualsDeclaration; - function isSourceFileJavaScript(file: SourceFile): boolean; - function isInJavaScriptFile(node: Node): boolean; - function isRequireCall(expression: Node, checkArgumentIsStringLiteral: boolean): expression is CallExpression; - function isSingleOrDoubleQuote(charCode: number): boolean; - function isDeclarationOfFunctionExpression(s: Symbol): boolean; - function getSpecialPropertyAssignmentKind(expression: Node): SpecialPropertyAssignmentKind; - function getExternalModuleName(node: Node): Expression; - function getNamespaceDeclarationNode(node: ImportDeclaration | ImportEqualsDeclaration | ExportDeclaration): ImportEqualsDeclaration | NamespaceImport; - function isDefaultImport(node: ImportDeclaration | ImportEqualsDeclaration | ExportDeclaration): boolean; - function hasQuestionToken(node: Node): boolean; - function isJSDocConstructSignature(node: Node): boolean; - function getCommentsFromJSDoc(node: Node): string[]; - function getJSDocParameterTags(param: Node): JSDocParameterTag[]; - function getJSDocType(node: Node): JSDocType; - function getJSDocAugmentsTag(node: Node): JSDocAugmentsTag; - function getJSDocReturnTag(node: Node): JSDocReturnTag; - function getJSDocTemplateTag(node: Node): JSDocTemplateTag; - function hasRestParameter(s: SignatureDeclaration): boolean; - function hasDeclaredRestParameter(s: SignatureDeclaration): boolean; - function isRestParameter(node: ParameterDeclaration): boolean; - function isDeclaredRestParam(node: ParameterDeclaration): boolean; - const enum AssignmentKind { - None = 0, - Definite = 1, - Compound = 2, + interface PerModuleNameCache { + get(directory: string): ResolvedModuleWithFailedLookupLocations; + set(directory: string, result: ResolvedModuleWithFailedLookupLocations): void; } - function getAssignmentTargetKind(node: Node): AssignmentKind; - function isAssignmentTarget(node: Node): boolean; - function isNodeDescendantOf(node: Node, ancestor: Node): boolean; - function isInAmbientContext(node: Node): boolean; - function isDeclarationName(name: Node): boolean; - function isLiteralComputedPropertyDeclarationName(node: Node): boolean; - function isIdentifierName(node: Identifier): boolean; - function isAliasSymbolDeclaration(node: Node): boolean; - function exportAssignmentIsAlias(node: ExportAssignment): boolean; - function getClassExtendsHeritageClauseElement(node: ClassLikeDeclaration | InterfaceDeclaration): ExpressionWithTypeArguments; - function getClassImplementsHeritageClauseElements(node: ClassLikeDeclaration): NodeArray; - function getInterfaceBaseTypeNodes(node: InterfaceDeclaration): NodeArray; - function getHeritageClause(clauses: NodeArray, kind: SyntaxKind): HeritageClause; - function tryResolveScriptReference(host: ScriptReferenceHost, sourceFile: SourceFile, reference: FileReference): SourceFile; - function getAncestor(node: Node, kind: SyntaxKind): Node; - function getFileReferenceFromReferencePath(comment: string, commentRange: CommentRange): ReferencePathMatchResult; - function isKeyword(token: SyntaxKind): boolean; - function isTrivia(token: SyntaxKind): boolean; - function isAsyncFunctionLike(node: Node): boolean; - function isStringOrNumericLiteral(node: Node): node is StringLiteral | NumericLiteral; - function hasDynamicName(declaration: Declaration): boolean; - function isDynamicName(name: DeclarationName): boolean; - function isWellKnownSymbolSyntactically(node: Expression): boolean; - function getPropertyNameForPropertyNameNode(name: DeclarationName | ParameterDeclaration): string; - function getPropertyNameForKnownSymbolName(symbolName: string): string; - function isESSymbolIdentifier(node: Node): boolean; - function isPushOrUnshiftIdentifier(node: Identifier): boolean; - function isModifierKind(token: SyntaxKind): boolean; - function isParameterDeclaration(node: VariableLikeDeclaration): boolean; - function getRootDeclaration(node: Node): Node; - function nodeStartsNewLexicalEnvironment(node: Node): boolean; - function nodeIsSynthesized(node: TextRange): boolean; - function getOriginalNode(node: Node): Node; - function getOriginalNode(node: Node, nodeTest: (node: Node) => node is T): T; - function isParseTreeNode(node: Node): boolean; - function getParseTreeNode(node: Node): Node; - function getParseTreeNode(node: Node, nodeTest?: (node: Node) => node is T): T; - function getOriginalSourceFiles(sourceFiles: SourceFile[]): SourceFile[]; - function getOriginalNodeId(node: Node): number; - const enum Associativity { - Left = 0, - Right = 1, - } - function getExpressionAssociativity(expression: Expression): Associativity; - function getOperatorAssociativity(kind: SyntaxKind, operator: SyntaxKind, hasArguments?: boolean): Associativity; - function getExpressionPrecedence(expression: Expression): 0 | 1 | -1 | 2 | 4 | 3 | 16 | 10 | 5 | 6 | 11 | 8 | 19 | 18 | 17 | 15 | 14 | 13 | 12 | 9 | 7; - function getOperator(expression: Expression): SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.NumericLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral | SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken | SyntaxKind.Identifier | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.LetKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.StaticKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AbstractKeyword | SyntaxKind.AsKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.GetKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.NumberKeyword | SyntaxKind.SetKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.TypeKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.FromKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.OfKeyword | SyntaxKind.QualifiedName | SyntaxKind.ComputedPropertyName | SyntaxKind.TypeParameter | SyntaxKind.Parameter | SyntaxKind.Decorator | SyntaxKind.PropertySignature | SyntaxKind.PropertyDeclaration | SyntaxKind.MethodSignature | SyntaxKind.MethodDeclaration | SyntaxKind.Constructor | SyntaxKind.GetAccessor | SyntaxKind.SetAccessor | SyntaxKind.CallSignature | SyntaxKind.ConstructSignature | SyntaxKind.IndexSignature | SyntaxKind.TypePredicate | SyntaxKind.TypeReference | SyntaxKind.FunctionType | SyntaxKind.ConstructorType | SyntaxKind.TypeQuery | SyntaxKind.TypeLiteral | SyntaxKind.ArrayType | SyntaxKind.TupleType | SyntaxKind.UnionType | SyntaxKind.IntersectionType | SyntaxKind.ParenthesizedType | SyntaxKind.ThisType | SyntaxKind.TypeOperator | SyntaxKind.IndexedAccessType | SyntaxKind.MappedType | SyntaxKind.LiteralType | SyntaxKind.ObjectBindingPattern | SyntaxKind.ArrayBindingPattern | SyntaxKind.BindingElement | SyntaxKind.ArrayLiteralExpression | SyntaxKind.ObjectLiteralExpression | SyntaxKind.PropertyAccessExpression | SyntaxKind.ElementAccessExpression | SyntaxKind.CallExpression | SyntaxKind.NewExpression | SyntaxKind.TaggedTemplateExpression | SyntaxKind.TypeAssertionExpression | SyntaxKind.ParenthesizedExpression | SyntaxKind.FunctionExpression | SyntaxKind.ArrowFunction | SyntaxKind.DeleteExpression | SyntaxKind.TypeOfExpression | SyntaxKind.VoidExpression | SyntaxKind.AwaitExpression | SyntaxKind.ConditionalExpression | SyntaxKind.TemplateExpression | SyntaxKind.YieldExpression | SyntaxKind.SpreadElement | SyntaxKind.ClassExpression | SyntaxKind.OmittedExpression | SyntaxKind.ExpressionWithTypeArguments | SyntaxKind.AsExpression | SyntaxKind.NonNullExpression | SyntaxKind.TemplateSpan | SyntaxKind.SemicolonClassElement | SyntaxKind.Block | SyntaxKind.VariableStatement | SyntaxKind.EmptyStatement | SyntaxKind.ExpressionStatement | SyntaxKind.IfStatement | SyntaxKind.DoStatement | SyntaxKind.WhileStatement | SyntaxKind.ForStatement | SyntaxKind.ForInStatement | SyntaxKind.ForOfStatement | SyntaxKind.ContinueStatement | SyntaxKind.BreakStatement | SyntaxKind.ReturnStatement | SyntaxKind.WithStatement | SyntaxKind.SwitchStatement | SyntaxKind.LabeledStatement | SyntaxKind.ThrowStatement | SyntaxKind.TryStatement | SyntaxKind.DebuggerStatement | SyntaxKind.VariableDeclaration | SyntaxKind.VariableDeclarationList | SyntaxKind.FunctionDeclaration | SyntaxKind.ClassDeclaration | SyntaxKind.InterfaceDeclaration | SyntaxKind.TypeAliasDeclaration | SyntaxKind.EnumDeclaration | SyntaxKind.ModuleDeclaration | SyntaxKind.ModuleBlock | SyntaxKind.CaseBlock | SyntaxKind.NamespaceExportDeclaration | SyntaxKind.ImportEqualsDeclaration | SyntaxKind.ImportDeclaration | SyntaxKind.ImportClause | SyntaxKind.NamespaceImport | SyntaxKind.NamedImports | SyntaxKind.ImportSpecifier | SyntaxKind.ExportAssignment | SyntaxKind.ExportDeclaration | SyntaxKind.NamedExports | SyntaxKind.ExportSpecifier | SyntaxKind.MissingDeclaration | SyntaxKind.ExternalModuleReference | SyntaxKind.JsxElement | SyntaxKind.JsxSelfClosingElement | SyntaxKind.JsxOpeningElement | SyntaxKind.JsxClosingElement | SyntaxKind.JsxAttribute | SyntaxKind.JsxSpreadAttribute | SyntaxKind.JsxExpression | SyntaxKind.CaseClause | SyntaxKind.DefaultClause | SyntaxKind.HeritageClause | SyntaxKind.CatchClause | SyntaxKind.PropertyAssignment | SyntaxKind.ShorthandPropertyAssignment | SyntaxKind.SpreadAssignment | SyntaxKind.EnumMember | SyntaxKind.SourceFile | SyntaxKind.JSDocTypeExpression | SyntaxKind.JSDocAllType | SyntaxKind.JSDocUnknownType | SyntaxKind.JSDocArrayType | SyntaxKind.JSDocUnionType | SyntaxKind.JSDocTupleType | SyntaxKind.JSDocNullableType | SyntaxKind.JSDocNonNullableType | SyntaxKind.JSDocRecordType | SyntaxKind.JSDocRecordMember | SyntaxKind.JSDocTypeReference | SyntaxKind.JSDocOptionalType | SyntaxKind.JSDocFunctionType | SyntaxKind.JSDocVariadicType | SyntaxKind.JSDocConstructorType | SyntaxKind.JSDocThisType | SyntaxKind.JSDocComment | SyntaxKind.JSDocTag | SyntaxKind.JSDocAugmentsTag | SyntaxKind.JSDocParameterTag | SyntaxKind.JSDocReturnTag | SyntaxKind.JSDocTypeTag | SyntaxKind.JSDocTemplateTag | SyntaxKind.JSDocTypedefTag | SyntaxKind.JSDocPropertyTag | SyntaxKind.JSDocTypeLiteral | SyntaxKind.JSDocLiteralType | SyntaxKind.JSDocNullKeyword | SyntaxKind.JSDocUndefinedKeyword | SyntaxKind.JSDocNeverKeyword | SyntaxKind.SyntaxList | SyntaxKind.NotEmittedStatement | SyntaxKind.PartiallyEmittedExpression | SyntaxKind.MergeDeclarationMarker | SyntaxKind.EndOfDeclarationMarker | SyntaxKind.RawExpression | SyntaxKind.Count; - function getOperatorPrecedence(nodeKind: SyntaxKind, operatorKind: SyntaxKind, hasArguments?: boolean): 0 | 1 | -1 | 2 | 4 | 3 | 16 | 10 | 5 | 6 | 11 | 8 | 19 | 18 | 17 | 15 | 14 | 13 | 12 | 9 | 7; - function createDiagnosticCollection(): DiagnosticCollection; - function escapeString(s: string): string; - function isIntrinsicJsxName(name: string): boolean; - function escapeNonAsciiCharacters(s: string): string; - interface EmitTextWriter { - write(s: string): void; - writeTextOfNode(text: string, node: Node): void; - writeLine(): void; - increaseIndent(): void; - decreaseIndent(): void; - getText(): string; - rawWrite(s: string): void; - writeLiteral(s: string): void; - getTextPos(): number; - getLine(): number; - getColumn(): number; - getIndent(): number; - isAtStartOfLine(): boolean; - reset(): void; - } - function getIndentString(level: number): string; - function getIndentSize(): number; - function createTextWriter(newLine: String): EmitTextWriter; - function getResolvedExternalModuleName(host: EmitHost, file: SourceFile): string; - function getExternalModuleNameFromDeclaration(host: EmitHost, resolver: EmitResolver, declaration: ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration | ModuleDeclaration): string; - function getExternalModuleNameFromPath(host: EmitHost, fileName: string): string; - function getOwnEmitOutputFilePath(sourceFile: SourceFile, host: EmitHost, extension: string): string; - function getDeclarationEmitOutputFilePath(sourceFile: SourceFile, host: EmitHost): string; - interface EmitFileNames { - jsFilePath: string; - sourceMapFilePath: string; - declarationFilePath: string; - } - function getSourceFilesToEmit(host: EmitHost, targetSourceFile?: SourceFile): SourceFile[]; - function filterSourceFilesInDirectory(sourceFiles: SourceFile[], isSourceFileFromExternalLibrary: (file: SourceFile) => boolean): SourceFile[]; - function forEachTransformedEmitFile(host: EmitHost, sourceFiles: SourceFile[], action: (jsFilePath: string, sourceMapFilePath: string, declarationFilePath: string, sourceFiles: SourceFile[], isBundledEmit: boolean) => void, emitOnlyDtsFiles?: boolean): void; - function forEachExpectedEmitFile(host: EmitHost, action: (emitFileNames: EmitFileNames, sourceFiles: SourceFile[], isBundledEmit: boolean, emitOnlyDtsFiles: boolean) => void, targetSourceFile?: SourceFile, emitOnlyDtsFiles?: boolean): void; - function getSourceFilePathInNewDir(sourceFile: SourceFile, host: EmitHost, newDirPath: string): string; - function writeFile(host: EmitHost, diagnostics: DiagnosticCollection, fileName: string, data: string, writeByteOrderMark: boolean, sourceFiles?: SourceFile[]): void; - function getLineOfLocalPosition(currentSourceFile: SourceFile, pos: number): number; - function getLineOfLocalPositionFromLineMap(lineMap: number[], pos: number): number; - function getFirstConstructorWithBody(node: ClassLikeDeclaration): ConstructorDeclaration; - function getSetAccessorTypeAnnotationNode(accessor: SetAccessorDeclaration): TypeNode; - function getThisParameter(signature: SignatureDeclaration): ParameterDeclaration | undefined; - function parameterIsThisKeyword(parameter: ParameterDeclaration): boolean; - function isThisIdentifier(node: Node | undefined): boolean; - function identifierIsThisKeyword(id: Identifier): boolean; - interface AllAccessorDeclarations { - firstAccessor: AccessorDeclaration; - secondAccessor: AccessorDeclaration; - getAccessor: AccessorDeclaration; - setAccessor: AccessorDeclaration; - } - function getAllAccessorDeclarations(declarations: NodeArray, accessor: AccessorDeclaration): AllAccessorDeclarations; - function emitNewLineBeforeLeadingComments(lineMap: number[], writer: EmitTextWriter, node: TextRange, leadingComments: CommentRange[]): void; - function emitNewLineBeforeLeadingCommentsOfPosition(lineMap: number[], writer: EmitTextWriter, pos: number, leadingComments: CommentRange[]): void; - function emitNewLineBeforeLeadingCommentOfPosition(lineMap: number[], writer: EmitTextWriter, pos: number, commentPos: number): void; - function emitComments(text: string, lineMap: number[], writer: EmitTextWriter, comments: CommentRange[], leadingSeparator: boolean, trailingSeparator: boolean, newLine: string, writeComment: (text: string, lineMap: number[], writer: EmitTextWriter, commentPos: number, commentEnd: number, newLine: string) => void): void; - function emitDetachedComments(text: string, lineMap: number[], writer: EmitTextWriter, writeComment: (text: string, lineMap: number[], writer: EmitTextWriter, commentPos: number, commentEnd: number, newLine: string) => void, node: TextRange, newLine: string, removeComments: boolean): { - nodePos: number; - detachedCommentEndPos: number; - }; - function writeCommentRange(text: string, lineMap: number[], writer: EmitTextWriter, commentPos: number, commentEnd: number, newLine: string): void; - function hasModifiers(node: Node): boolean; - function hasModifier(node: Node, flags: ModifierFlags): boolean; - function getModifierFlags(node: Node): ModifierFlags; - function modifierToFlag(token: SyntaxKind): ModifierFlags; - function isLogicalOperator(token: SyntaxKind): boolean; - function isAssignmentOperator(token: SyntaxKind): boolean; - function tryGetClassExtendingExpressionWithTypeArguments(node: Node): ClassLikeDeclaration | undefined; - function isAssignmentExpression(node: Node, excludeCompoundAssignment: true): node is AssignmentExpression; - function isAssignmentExpression(node: Node, excludeCompoundAssignment?: false): node is AssignmentExpression; - function isDestructuringAssignment(node: Node): node is DestructuringAssignment; - function isSupportedExpressionWithTypeArguments(node: ExpressionWithTypeArguments): boolean; - function isExpressionWithTypeArgumentsInClassExtendsClause(node: Node): boolean; - function isEntityNameExpression(node: Expression): node is EntityNameExpression; - function isRightSideOfQualifiedNameOrPropertyAccess(node: Node): boolean; - function isEmptyObjectLiteralOrArrayLiteral(expression: Node): boolean; - function getLocalSymbolForExportDefault(symbol: Symbol): Symbol; - function tryExtractTypeScriptExtension(fileName: string): string | undefined; - const stringify: (value: any) => string; - function convertToBase64(input: string): string; - function getNewLineCharacter(options: CompilerOptions): string; - function isSimpleExpression(node: Expression): boolean; - function formatSyntaxKind(kind: SyntaxKind): string; - function movePos(pos: number, value: number): number; - function createRange(pos: number, end: number): TextRange; - function moveRangeEnd(range: TextRange, end: number): TextRange; - function moveRangePos(range: TextRange, pos: number): TextRange; - function moveRangePastDecorators(node: Node): TextRange; - function moveRangePastModifiers(node: Node): TextRange; - function isCollapsedRange(range: TextRange): boolean; - function collapseRangeToStart(range: TextRange): TextRange; - function collapseRangeToEnd(range: TextRange): TextRange; - function createTokenRange(pos: number, token: SyntaxKind): TextRange; - function rangeIsOnSingleLine(range: TextRange, sourceFile: SourceFile): boolean; - function rangeStartPositionsAreOnSameLine(range1: TextRange, range2: TextRange, sourceFile: SourceFile): boolean; - function rangeEndPositionsAreOnSameLine(range1: TextRange, range2: TextRange, sourceFile: SourceFile): boolean; - function rangeStartIsOnSameLineAsRangeEnd(range1: TextRange, range2: TextRange, sourceFile: SourceFile): boolean; - function rangeEndIsOnSameLineAsRangeStart(range1: TextRange, range2: TextRange, sourceFile: SourceFile): boolean; - function positionsAreOnSameLine(pos1: number, pos2: number, sourceFile: SourceFile): boolean; - function getStartPositionOfRange(range: TextRange, sourceFile: SourceFile): number; - function isDeclarationNameOfEnumOrNamespace(node: Identifier): boolean; - function getInitializedVariables(node: VariableDeclarationList): VariableDeclaration[]; - function isMergedWithClass(node: Node): boolean; - function isFirstDeclarationOfKind(node: Node, kind: SyntaxKind): boolean; - function isNodeArray(array: T[]): array is NodeArray; - function isNoSubstitutionTemplateLiteral(node: Node): node is LiteralExpression; - function isLiteralKind(kind: SyntaxKind): boolean; - function isTextualLiteralKind(kind: SyntaxKind): boolean; - function isLiteralExpression(node: Node): node is LiteralExpression; - function isTemplateLiteralKind(kind: SyntaxKind): boolean; - function isTemplateHead(node: Node): node is TemplateHead; - function isTemplateMiddleOrTemplateTail(node: Node): node is TemplateMiddle | TemplateTail; - function isIdentifier(node: Node): node is Identifier; - function isGeneratedIdentifier(node: Node): node is GeneratedIdentifier; - function isModifier(node: Node): node is Modifier; - function isQualifiedName(node: Node): node is QualifiedName; - function isComputedPropertyName(node: Node): node is ComputedPropertyName; - function isEntityName(node: Node): node is EntityName; - function isPropertyName(node: Node): node is PropertyName; - function isModuleName(node: Node): node is ModuleName; - function isBindingName(node: Node): node is BindingName; - function isTypeParameter(node: Node): node is TypeParameterDeclaration; - function isParameter(node: Node): node is ParameterDeclaration; - function isDecorator(node: Node): node is Decorator; - function isMethodDeclaration(node: Node): node is MethodDeclaration; - function isClassElement(node: Node): node is ClassElement; - function isObjectLiteralElementLike(node: Node): node is ObjectLiteralElementLike; - function isTypeNode(node: Node): node is TypeNode; - function isArrayBindingPattern(node: Node): node is ArrayBindingPattern; - function isObjectBindingPattern(node: Node): node is ObjectBindingPattern; - function isBindingPattern(node: Node): node is BindingPattern; - function isAssignmentPattern(node: Node): node is AssignmentPattern; - function isBindingElement(node: Node): node is BindingElement; - function isArrayBindingElement(node: Node): node is ArrayBindingElement; - function isDeclarationBindingElement(bindingElement: BindingOrAssignmentElement): bindingElement is VariableDeclaration | ParameterDeclaration | BindingElement; - function isBindingOrAssignmentPattern(node: BindingOrAssignmentElementTarget): node is BindingOrAssignmentPattern; - function isObjectBindingOrAssignmentPattern(node: BindingOrAssignmentElementTarget): node is ObjectBindingOrAssignmentPattern; - function isArrayBindingOrAssignmentPattern(node: BindingOrAssignmentElementTarget): node is ArrayBindingOrAssignmentPattern; - function isArrayLiteralExpression(node: Node): node is ArrayLiteralExpression; - function isObjectLiteralExpression(node: Node): node is ObjectLiteralExpression; - function isPropertyAccessExpression(node: Node): node is PropertyAccessExpression; - function isElementAccessExpression(node: Node): node is ElementAccessExpression; - function isBinaryExpression(node: Node): node is BinaryExpression; - function isConditionalExpression(node: Node): node is ConditionalExpression; - function isCallExpression(node: Node): node is CallExpression; - function isTemplateLiteral(node: Node): node is TemplateLiteral; - function isSpreadExpression(node: Node): node is SpreadElement; - function isExpressionWithTypeArguments(node: Node): node is ExpressionWithTypeArguments; - function isLeftHandSideExpression(node: Node): node is LeftHandSideExpression; - function isUnaryExpression(node: Node): node is UnaryExpression; - function isExpression(node: Node): node is Expression; - function isAssertionExpression(node: Node): node is AssertionExpression; - function isPartiallyEmittedExpression(node: Node): node is PartiallyEmittedExpression; - function isNotEmittedStatement(node: Node): node is NotEmittedStatement; - function isNotEmittedOrPartiallyEmittedNode(node: Node): node is NotEmittedStatement | PartiallyEmittedExpression; - function isOmittedExpression(node: Node): node is OmittedExpression; - function isTemplateSpan(node: Node): node is TemplateSpan; - function isBlock(node: Node): node is Block; - function isConciseBody(node: Node): node is ConciseBody; - function isFunctionBody(node: Node): node is FunctionBody; - function isForInitializer(node: Node): node is ForInitializer; - function isVariableDeclaration(node: Node): node is VariableDeclaration; - function isVariableDeclarationList(node: Node): node is VariableDeclarationList; - function isCaseBlock(node: Node): node is CaseBlock; - function isModuleBody(node: Node): node is ModuleBody; - function isImportEqualsDeclaration(node: Node): node is ImportEqualsDeclaration; - function isImportClause(node: Node): node is ImportClause; - function isNamedImportBindings(node: Node): node is NamedImportBindings; - function isImportSpecifier(node: Node): node is ImportSpecifier; - function isNamedExports(node: Node): node is NamedExports; - function isExportSpecifier(node: Node): node is ExportSpecifier; - function isModuleOrEnumDeclaration(node: Node): node is ModuleDeclaration | EnumDeclaration; - function isDeclaration(node: Node): node is Declaration; - function isDeclarationStatement(node: Node): node is DeclarationStatement; - function isStatementButNotDeclaration(node: Node): node is Statement; - function isStatement(node: Node): node is Statement; - function isModuleReference(node: Node): node is ModuleReference; - function isJsxOpeningElement(node: Node): node is JsxOpeningElement; - function isJsxClosingElement(node: Node): node is JsxClosingElement; - function isJsxTagNameExpression(node: Node): node is JsxTagNameExpression; - function isJsxChild(node: Node): node is JsxChild; - function isJsxAttributeLike(node: Node): node is JsxAttributeLike; - function isJsxSpreadAttribute(node: Node): node is JsxSpreadAttribute; - function isJsxAttribute(node: Node): node is JsxAttribute; - function isStringLiteralOrJsxExpression(node: Node): node is StringLiteral | JsxExpression; - function isCaseOrDefaultClause(node: Node): node is CaseOrDefaultClause; - function isHeritageClause(node: Node): node is HeritageClause; - function isCatchClause(node: Node): node is CatchClause; - function isPropertyAssignment(node: Node): node is PropertyAssignment; - function isShorthandPropertyAssignment(node: Node): node is ShorthandPropertyAssignment; - function isEnumMember(node: Node): node is EnumMember; - function isSourceFile(node: Node): node is SourceFile; - function isWatchSet(options: CompilerOptions): boolean; + function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string): ModuleResolutionCache; + function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations; + function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations; + function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache): ResolvedModuleWithFailedLookupLocations; } declare namespace ts { function getDefaultLibFileName(options: CompilerOptions): string; @@ -9244,317 +2446,307 @@ declare namespace ts { fileExists(fileName: string): boolean; readFile(fileName: string): string; }, errors?: Diagnostic[]): void; + function getOriginalNode(node: Node): Node; + function getOriginalNode(node: Node, nodeTest: (node: Node) => node is T): T; + function isParseTreeNode(node: Node): boolean; + function getParseTreeNode(node: Node): Node; + function getParseTreeNode(node: Node, nodeTest?: (node: Node) => node is T): T; + function unescapeIdentifier(identifier: string): string; } declare namespace ts { - function updateNode(updated: T, original: T): T; - function createNodeArray(elements?: T[], location?: TextRange, hasTrailingComma?: boolean): NodeArray; - function createSynthesizedNode(kind: SyntaxKind, startsOnNewLine?: boolean): Node; - function createSynthesizedNodeArray(elements?: T[]): NodeArray; - function getSynthesizedClone(node: T): T; - function getMutableClone(node: T): T; - function createLiteral(textSource: StringLiteral | NumericLiteral | Identifier, location?: TextRange): StringLiteral; - function createLiteral(value: string, location?: TextRange): StringLiteral; - function createLiteral(value: number, location?: TextRange): NumericLiteral; - function createLiteral(value: boolean, location?: TextRange): BooleanLiteral; - function createLiteral(value: string | number | boolean, location?: TextRange): PrimaryExpression; - function createIdentifier(text: string, location?: TextRange): Identifier; - function createTempVariable(recordTempVariable: ((node: Identifier) => void) | undefined, location?: TextRange): Identifier; - function createLoopVariable(location?: TextRange): Identifier; - function createUniqueName(text: string, location?: TextRange): Identifier; - function getGeneratedNameForNode(node: Node, location?: TextRange): Identifier; + function createNodeArray(elements?: T[], hasTrailingComma?: boolean): NodeArray; + function createLiteral(value: string): StringLiteral; + function createLiteral(value: number): NumericLiteral; + function createLiteral(value: boolean): BooleanLiteral; + function createLiteral(sourceNode: StringLiteral | NumericLiteral | Identifier): StringLiteral; + function createLiteral(value: string | number | boolean): PrimaryExpression; + function createNumericLiteral(value: string): NumericLiteral; + function createIdentifier(text: string): Identifier; + function createTempVariable(recordTempVariable: ((node: Identifier) => void) | undefined): Identifier; + function createLoopVariable(): Identifier; + function createUniqueName(text: string): Identifier; + function getGeneratedNameForNode(node: Node): Identifier; function createToken(token: TKind): Token; - function createSuper(): PrimaryExpression; - function createThis(location?: TextRange): PrimaryExpression; - function createNull(): PrimaryExpression; - function createComputedPropertyName(expression: Expression, location?: TextRange): ComputedPropertyName; + function createSuper(): SuperExpression; + function createThis(): ThisExpression & Token; + function createNull(): NullLiteral & Token; + function createTrue(): BooleanLiteral & Token; + function createFalse(): BooleanLiteral & Token; + function createQualifiedName(left: EntityName, right: string | Identifier): QualifiedName; + function updateQualifiedName(node: QualifiedName, left: EntityName, right: Identifier): QualifiedName; + function createComputedPropertyName(expression: Expression): ComputedPropertyName; function updateComputedPropertyName(node: ComputedPropertyName, expression: Expression): ComputedPropertyName; - function createParameter(decorators: Decorator[], modifiers: Modifier[], dotDotDotToken: DotDotDotToken, name: string | Identifier | BindingPattern, questionToken?: QuestionToken, type?: TypeNode, initializer?: Expression, location?: TextRange, flags?: NodeFlags): ParameterDeclaration; - function updateParameter(node: ParameterDeclaration, decorators: Decorator[], modifiers: Modifier[], dotDotDotToken: DotDotDotToken, name: BindingName, type: TypeNode, initializer: Expression): ParameterDeclaration; - function createProperty(decorators: Decorator[], modifiers: Modifier[], name: string | PropertyName, questionToken: QuestionToken, type: TypeNode, initializer: Expression, location?: TextRange): PropertyDeclaration; - function updateProperty(node: PropertyDeclaration, decorators: Decorator[], modifiers: Modifier[], name: PropertyName, type: TypeNode, initializer: Expression): PropertyDeclaration; - function createMethod(decorators: Decorator[], modifiers: Modifier[], asteriskToken: AsteriskToken, name: string | PropertyName, typeParameters: TypeParameterDeclaration[], parameters: ParameterDeclaration[], type: TypeNode, body: Block, location?: TextRange, flags?: NodeFlags): MethodDeclaration; - function updateMethod(node: MethodDeclaration, decorators: Decorator[], modifiers: Modifier[], name: PropertyName, typeParameters: TypeParameterDeclaration[], parameters: ParameterDeclaration[], type: TypeNode, body: Block): MethodDeclaration; - function createConstructor(decorators: Decorator[], modifiers: Modifier[], parameters: ParameterDeclaration[], body: Block, location?: TextRange, flags?: NodeFlags): ConstructorDeclaration; - function updateConstructor(node: ConstructorDeclaration, decorators: Decorator[], modifiers: Modifier[], parameters: ParameterDeclaration[], body: Block): ConstructorDeclaration; - function createGetAccessor(decorators: Decorator[], modifiers: Modifier[], name: string | PropertyName, parameters: ParameterDeclaration[], type: TypeNode, body: Block, location?: TextRange, flags?: NodeFlags): GetAccessorDeclaration; - function updateGetAccessor(node: GetAccessorDeclaration, decorators: Decorator[], modifiers: Modifier[], name: PropertyName, parameters: ParameterDeclaration[], type: TypeNode, body: Block): GetAccessorDeclaration; - function createSetAccessor(decorators: Decorator[], modifiers: Modifier[], name: string | PropertyName, parameters: ParameterDeclaration[], body: Block, location?: TextRange, flags?: NodeFlags): SetAccessorDeclaration; - function updateSetAccessor(node: SetAccessorDeclaration, decorators: Decorator[], modifiers: Modifier[], name: PropertyName, parameters: ParameterDeclaration[], body: Block): SetAccessorDeclaration; - function createObjectBindingPattern(elements: BindingElement[], location?: TextRange): ObjectBindingPattern; + function createSignatureDeclaration(kind: SyntaxKind, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): SignatureDeclaration; + function createFunctionTypeNode(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): FunctionTypeNode; + function updateFunctionTypeNode(node: FunctionTypeNode, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): FunctionTypeNode; + function createConstructorTypeNode(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): ConstructorTypeNode; + function updateConstructorTypeNode(node: ConstructorTypeNode, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): ConstructorTypeNode; + function createCallSignatureDeclaration(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): CallSignatureDeclaration; + function updateCallSignatureDeclaration(node: CallSignatureDeclaration, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): CallSignatureDeclaration; + function createConstructSignatureDeclaration(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): ConstructSignatureDeclaration; + function updateConstructSignatureDeclaration(node: ConstructSignatureDeclaration, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): ConstructSignatureDeclaration; + function createMethodSignature(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined): MethodSignature; + function updateMethodSignature(node: MethodSignature, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined, name: PropertyName, questionToken: QuestionToken | undefined): MethodSignature; + function createKeywordTypeNode(kind: KeywordTypeNode["kind"]): KeywordTypeNode; + function createThisTypeNode(): ThisTypeNode; + function createLiteralTypeNode(literal: Expression): LiteralTypeNode; + function updateLiteralTypeNode(node: LiteralTypeNode, literal: Expression): LiteralTypeNode; + function createTypeReferenceNode(typeName: string | EntityName, typeArguments: TypeNode[] | undefined): TypeReferenceNode; + function updateTypeReferenceNode(node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray | undefined): TypeReferenceNode; + function createTypePredicateNode(parameterName: Identifier | ThisTypeNode | string, type: TypeNode): TypePredicateNode; + function updateTypePredicateNode(node: TypePredicateNode, parameterName: Identifier | ThisTypeNode, type: TypeNode): TypePredicateNode; + function createTypeQueryNode(exprName: EntityName): TypeQueryNode; + function updateTypeQueryNode(node: TypeQueryNode, exprName: EntityName): TypeQueryNode; + function createArrayTypeNode(elementType: TypeNode): ArrayTypeNode; + function updateArrayTypeNode(node: ArrayTypeNode, elementType: TypeNode): ArrayTypeNode; + function createUnionOrIntersectionTypeNode(kind: SyntaxKind.UnionType, types: TypeNode[]): UnionTypeNode; + function createUnionOrIntersectionTypeNode(kind: SyntaxKind.IntersectionType, types: TypeNode[]): IntersectionTypeNode; + function createUnionOrIntersectionTypeNode(kind: SyntaxKind.UnionType | SyntaxKind.IntersectionType, types: TypeNode[]): UnionOrIntersectionTypeNode; + function updateUnionOrIntersectionTypeNode(node: UnionOrIntersectionTypeNode, types: NodeArray): UnionOrIntersectionTypeNode; + function createTypeLiteralNode(members: TypeElement[]): TypeLiteralNode; + function updateTypeLiteralNode(node: TypeLiteralNode, members: NodeArray): TypeLiteralNode; + function createTupleTypeNode(elementTypes: TypeNode[]): TupleTypeNode; + function updateTypleTypeNode(node: TupleTypeNode, elementTypes: TypeNode[]): TupleTypeNode; + function createMappedTypeNode(readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; + function updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; + function createTypeOperatorNode(type: TypeNode): TypeOperatorNode; + function updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; + function createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; + function updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; + function createTypeParameterDeclaration(name: string | Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined): TypeParameterDeclaration; + function updateTypeParameterDeclaration(node: TypeParameterDeclaration, name: Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined): TypeParameterDeclaration; + function createPropertySignature(name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertySignature; + function updatePropertySignature(node: PropertySignature, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertySignature; + function createIndexSignatureDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, parameters: ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; + function updateIndexSignatureDeclaration(node: IndexSignatureDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, parameters: ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; + function createParameter(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken?: QuestionToken, type?: TypeNode, initializer?: Expression): ParameterDeclaration; + function updateParameter(node: ParameterDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): ParameterDeclaration; + function createDecorator(expression: Expression): Decorator; + function updateDecorator(node: Decorator, expression: Expression): Decorator; + function createProperty(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression): PropertyDeclaration; + function updateProperty(node: PropertyDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: PropertyName, type: TypeNode | undefined, initializer: Expression): PropertyDeclaration; + function createMethodDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; + function updateMethod(node: MethodDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; + function createConstructor(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, parameters: ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; + function updateConstructor(node: ConstructorDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, parameters: ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; + function createGetAccessor(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | PropertyName, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration; + function updateGetAccessor(node: GetAccessorDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: PropertyName, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration; + function createSetAccessor(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | PropertyName, parameters: ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration; + function updateSetAccessor(node: SetAccessorDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: PropertyName, parameters: ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration; + function createObjectBindingPattern(elements: BindingElement[]): ObjectBindingPattern; function updateObjectBindingPattern(node: ObjectBindingPattern, elements: BindingElement[]): ObjectBindingPattern; - function createArrayBindingPattern(elements: ArrayBindingElement[], location?: TextRange): ArrayBindingPattern; + function createArrayBindingPattern(elements: ArrayBindingElement[]): ArrayBindingPattern; function updateArrayBindingPattern(node: ArrayBindingPattern, elements: ArrayBindingElement[]): ArrayBindingPattern; - function createBindingElement(propertyName: string | PropertyName, dotDotDotToken: DotDotDotToken, name: string | BindingName, initializer?: Expression, location?: TextRange): BindingElement; - function updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken, propertyName: PropertyName, name: BindingName, initializer: Expression): BindingElement; - function createArrayLiteral(elements?: Expression[], location?: TextRange, multiLine?: boolean): ArrayLiteralExpression; + function createBindingElement(dotDotDotToken: DotDotDotToken | undefined, propertyName: string | PropertyName | undefined, name: string | BindingName, initializer?: Expression): BindingElement; + function updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken | undefined, propertyName: PropertyName | undefined, name: BindingName, initializer: Expression | undefined): BindingElement; + function createArrayLiteral(elements?: Expression[], multiLine?: boolean): ArrayLiteralExpression; function updateArrayLiteral(node: ArrayLiteralExpression, elements: Expression[]): ArrayLiteralExpression; - function createObjectLiteral(properties?: ObjectLiteralElementLike[], location?: TextRange, multiLine?: boolean): ObjectLiteralExpression; + function createObjectLiteral(properties?: ObjectLiteralElementLike[], multiLine?: boolean): ObjectLiteralExpression; function updateObjectLiteral(node: ObjectLiteralExpression, properties: ObjectLiteralElementLike[]): ObjectLiteralExpression; - function createPropertyAccess(expression: Expression, name: string | Identifier, location?: TextRange, flags?: NodeFlags): PropertyAccessExpression; + function createPropertyAccess(expression: Expression, name: string | Identifier): PropertyAccessExpression; function updatePropertyAccess(node: PropertyAccessExpression, expression: Expression, name: Identifier): PropertyAccessExpression; - function createElementAccess(expression: Expression, index: number | Expression, location?: TextRange): ElementAccessExpression; + function createElementAccess(expression: Expression, index: number | Expression): ElementAccessExpression; function updateElementAccess(node: ElementAccessExpression, expression: Expression, argumentExpression: Expression): ElementAccessExpression; - function createCall(expression: Expression, typeArguments: TypeNode[], argumentsArray: Expression[], location?: TextRange, flags?: NodeFlags): CallExpression; - function updateCall(node: CallExpression, expression: Expression, typeArguments: TypeNode[], argumentsArray: Expression[]): CallExpression; - function createNew(expression: Expression, typeArguments: TypeNode[], argumentsArray: Expression[], location?: TextRange, flags?: NodeFlags): NewExpression; - function updateNew(node: NewExpression, expression: Expression, typeArguments: TypeNode[], argumentsArray: Expression[]): NewExpression; - function createTaggedTemplate(tag: Expression, template: TemplateLiteral, location?: TextRange): TaggedTemplateExpression; + function createCall(expression: Expression, typeArguments: TypeNode[] | undefined, argumentsArray: Expression[]): CallExpression; + function updateCall(node: CallExpression, expression: Expression, typeArguments: TypeNode[] | undefined, argumentsArray: Expression[]): CallExpression; + function createNew(expression: Expression, typeArguments: TypeNode[] | undefined, argumentsArray: Expression[] | undefined): NewExpression; + function updateNew(node: NewExpression, expression: Expression, typeArguments: TypeNode[] | undefined, argumentsArray: Expression[] | undefined): NewExpression; + function createTaggedTemplate(tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; - function createParen(expression: Expression, location?: TextRange): ParenthesizedExpression; + function createTypeAssertion(type: TypeNode, expression: Expression): TypeAssertion; + function updateTypeAssertion(node: TypeAssertion, type: TypeNode, expression: Expression): TypeAssertion; + function createParen(expression: Expression): ParenthesizedExpression; function updateParen(node: ParenthesizedExpression, expression: Expression): ParenthesizedExpression; - function createFunctionExpression(modifiers: Modifier[], asteriskToken: AsteriskToken, name: string | Identifier, typeParameters: TypeParameterDeclaration[], parameters: ParameterDeclaration[], type: TypeNode, body: Block, location?: TextRange, flags?: NodeFlags): FunctionExpression; - function updateFunctionExpression(node: FunctionExpression, modifiers: Modifier[], name: Identifier, typeParameters: TypeParameterDeclaration[], parameters: ParameterDeclaration[], type: TypeNode, body: Block): FunctionExpression; - function createArrowFunction(modifiers: Modifier[], typeParameters: TypeParameterDeclaration[], parameters: ParameterDeclaration[], type: TypeNode, equalsGreaterThanToken: EqualsGreaterThanToken, body: ConciseBody, location?: TextRange, flags?: NodeFlags): ArrowFunction; - function updateArrowFunction(node: ArrowFunction, modifiers: Modifier[], typeParameters: TypeParameterDeclaration[], parameters: ParameterDeclaration[], type: TypeNode, body: ConciseBody): ArrowFunction; - function createDelete(expression: Expression, location?: TextRange): DeleteExpression; - function updateDelete(node: DeleteExpression, expression: Expression): Expression; - function createTypeOf(expression: Expression, location?: TextRange): TypeOfExpression; - function updateTypeOf(node: TypeOfExpression, expression: Expression): Expression; - function createVoid(expression: Expression, location?: TextRange): VoidExpression; + function createFunctionExpression(modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block): FunctionExpression; + function updateFunctionExpression(node: FunctionExpression, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block): FunctionExpression; + function createArrowFunction(modifiers: Modifier[] | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction; + function updateArrowFunction(node: ArrowFunction, modifiers: Modifier[] | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: ConciseBody): ArrowFunction; + function createDelete(expression: Expression): DeleteExpression; + function updateDelete(node: DeleteExpression, expression: Expression): DeleteExpression; + function createTypeOf(expression: Expression): TypeOfExpression; + function updateTypeOf(node: TypeOfExpression, expression: Expression): TypeOfExpression; + function createVoid(expression: Expression): VoidExpression; function updateVoid(node: VoidExpression, expression: Expression): VoidExpression; - function createAwait(expression: Expression, location?: TextRange): AwaitExpression; + function createAwait(expression: Expression): AwaitExpression; function updateAwait(node: AwaitExpression, expression: Expression): AwaitExpression; - function createPrefix(operator: PrefixUnaryOperator, operand: Expression, location?: TextRange): PrefixUnaryExpression; + function createPrefix(operator: PrefixUnaryOperator, operand: Expression): PrefixUnaryExpression; function updatePrefix(node: PrefixUnaryExpression, operand: Expression): PrefixUnaryExpression; - function createPostfix(operand: Expression, operator: PostfixUnaryOperator, location?: TextRange): PostfixUnaryExpression; + function createPostfix(operand: Expression, operator: PostfixUnaryOperator): PostfixUnaryExpression; function updatePostfix(node: PostfixUnaryExpression, operand: Expression): PostfixUnaryExpression; - function createBinary(left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression, location?: TextRange): BinaryExpression; + function createBinary(left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression): BinaryExpression; function updateBinary(node: BinaryExpression, left: Expression, right: Expression): BinaryExpression; - function createConditional(condition: Expression, whenTrue: Expression, whenFalse: Expression, location?: TextRange): ConditionalExpression; - function createConditional(condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression, location?: TextRange): ConditionalExpression; + function createConditional(condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression; + function createConditional(condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression; function updateConditional(node: ConditionalExpression, condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression; - function createTemplateExpression(head: TemplateHead, templateSpans: TemplateSpan[], location?: TextRange): TemplateExpression; + function createTemplateExpression(head: TemplateHead, templateSpans: TemplateSpan[]): TemplateExpression; function updateTemplateExpression(node: TemplateExpression, head: TemplateHead, templateSpans: TemplateSpan[]): TemplateExpression; - function createYield(asteriskToken: AsteriskToken, expression: Expression, location?: TextRange): YieldExpression; - function updateYield(node: YieldExpression, expression: Expression): YieldExpression; - function createSpread(expression: Expression, location?: TextRange): SpreadElement; + function createYield(expression?: Expression): YieldExpression; + function createYield(asteriskToken: AsteriskToken, expression: Expression): YieldExpression; + function updateYield(node: YieldExpression, asteriskToken: AsteriskToken | undefined, expression: Expression): YieldExpression; + function createSpread(expression: Expression): SpreadElement; function updateSpread(node: SpreadElement, expression: Expression): SpreadElement; - function createClassExpression(modifiers: Modifier[], name: Identifier, typeParameters: TypeParameterDeclaration[], heritageClauses: HeritageClause[], members: ClassElement[], location?: TextRange): ClassExpression; - function updateClassExpression(node: ClassExpression, modifiers: Modifier[], name: Identifier, typeParameters: TypeParameterDeclaration[], heritageClauses: HeritageClause[], members: ClassElement[]): ClassExpression; - function createOmittedExpression(location?: TextRange): OmittedExpression; - function createExpressionWithTypeArguments(typeArguments: TypeNode[], expression: Expression, location?: TextRange): ExpressionWithTypeArguments; + function createClassExpression(modifiers: Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, heritageClauses: HeritageClause[], members: ClassElement[]): ClassExpression; + function updateClassExpression(node: ClassExpression, modifiers: Modifier[] | undefined, name: Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, heritageClauses: HeritageClause[], members: ClassElement[]): ClassExpression; + function createOmittedExpression(): OmittedExpression; + function createExpressionWithTypeArguments(typeArguments: TypeNode[], expression: Expression): ExpressionWithTypeArguments; function updateExpressionWithTypeArguments(node: ExpressionWithTypeArguments, typeArguments: TypeNode[], expression: Expression): ExpressionWithTypeArguments; - function createTemplateSpan(expression: Expression, literal: TemplateMiddle | TemplateTail, location?: TextRange): TemplateSpan; + function createAsExpression(expression: Expression, type: TypeNode): AsExpression; + function updateAsExpression(node: AsExpression, expression: Expression, type: TypeNode): AsExpression; + function createNonNullExpression(expression: Expression): NonNullExpression; + function updateNonNullExpression(node: NonNullExpression, expression: Expression): NonNullExpression; + function createTemplateSpan(expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan; function updateTemplateSpan(node: TemplateSpan, expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan; - function createBlock(statements: Statement[], location?: TextRange, multiLine?: boolean, flags?: NodeFlags): Block; + function createBlock(statements: Statement[], multiLine?: boolean): Block; function updateBlock(node: Block, statements: Statement[]): Block; - function createVariableStatement(modifiers: Modifier[], declarationList: VariableDeclarationList | VariableDeclaration[], location?: TextRange, flags?: NodeFlags): VariableStatement; - function updateVariableStatement(node: VariableStatement, modifiers: Modifier[], declarationList: VariableDeclarationList): VariableStatement; - function createVariableDeclarationList(declarations: VariableDeclaration[], location?: TextRange, flags?: NodeFlags): VariableDeclarationList; + function createVariableStatement(modifiers: Modifier[] | undefined, declarationList: VariableDeclarationList | VariableDeclaration[]): VariableStatement; + function updateVariableStatement(node: VariableStatement, modifiers: Modifier[] | undefined, declarationList: VariableDeclarationList): VariableStatement; + function createVariableDeclarationList(declarations: VariableDeclaration[], flags?: NodeFlags): VariableDeclarationList; function updateVariableDeclarationList(node: VariableDeclarationList, declarations: VariableDeclaration[]): VariableDeclarationList; - function createVariableDeclaration(name: string | BindingPattern | Identifier, type?: TypeNode, initializer?: Expression, location?: TextRange, flags?: NodeFlags): VariableDeclaration; - function updateVariableDeclaration(node: VariableDeclaration, name: BindingName, type: TypeNode, initializer: Expression): VariableDeclaration; - function createEmptyStatement(location: TextRange): EmptyStatement; - function createStatement(expression: Expression, location?: TextRange, flags?: NodeFlags): ExpressionStatement; + function createVariableDeclaration(name: string | BindingName, type?: TypeNode, initializer?: Expression): VariableDeclaration; + function updateVariableDeclaration(node: VariableDeclaration, name: BindingName, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration; + function createEmptyStatement(): EmptyStatement; + function createStatement(expression: Expression): ExpressionStatement; function updateStatement(node: ExpressionStatement, expression: Expression): ExpressionStatement; - function createIf(expression: Expression, thenStatement: Statement, elseStatement?: Statement, location?: TextRange): IfStatement; - function updateIf(node: IfStatement, expression: Expression, thenStatement: Statement, elseStatement: Statement): IfStatement; - function createDo(statement: Statement, expression: Expression, location?: TextRange): DoStatement; + function createIf(expression: Expression, thenStatement: Statement, elseStatement?: Statement): IfStatement; + function updateIf(node: IfStatement, expression: Expression, thenStatement: Statement, elseStatement: Statement | undefined): IfStatement; + function createDo(statement: Statement, expression: Expression): DoStatement; function updateDo(node: DoStatement, statement: Statement, expression: Expression): DoStatement; - function createWhile(expression: Expression, statement: Statement, location?: TextRange): WhileStatement; + function createWhile(expression: Expression, statement: Statement): WhileStatement; function updateWhile(node: WhileStatement, expression: Expression, statement: Statement): WhileStatement; - function createFor(initializer: ForInitializer, condition: Expression, incrementor: Expression, statement: Statement, location?: TextRange): ForStatement; - function updateFor(node: ForStatement, initializer: ForInitializer, condition: Expression, incrementor: Expression, statement: Statement): ForStatement; - function createForIn(initializer: ForInitializer, expression: Expression, statement: Statement, location?: TextRange): ForInStatement; + function createFor(initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement): ForStatement; + function updateFor(node: ForStatement, initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement): ForStatement; + function createForIn(initializer: ForInitializer, expression: Expression, statement: Statement): ForInStatement; function updateForIn(node: ForInStatement, initializer: ForInitializer, expression: Expression, statement: Statement): ForInStatement; - function createForOf(initializer: ForInitializer, expression: Expression, statement: Statement, location?: TextRange): ForOfStatement; - function updateForOf(node: ForOfStatement, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement; - function createContinue(label?: Identifier, location?: TextRange): ContinueStatement; - function updateContinue(node: ContinueStatement, label: Identifier): ContinueStatement; - function createBreak(label?: Identifier, location?: TextRange): BreakStatement; - function updateBreak(node: BreakStatement, label: Identifier): BreakStatement; - function createReturn(expression?: Expression, location?: TextRange): ReturnStatement; - function updateReturn(node: ReturnStatement, expression: Expression): ReturnStatement; - function createWith(expression: Expression, statement: Statement, location?: TextRange): WithStatement; + function createForOf(awaitModifier: AwaitKeywordToken, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement; + function updateForOf(node: ForOfStatement, awaitModifier: AwaitKeywordToken, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement; + function createContinue(label?: string | Identifier): ContinueStatement; + function updateContinue(node: ContinueStatement, label: Identifier | undefined): ContinueStatement; + function createBreak(label?: string | Identifier): BreakStatement; + function updateBreak(node: BreakStatement, label: Identifier | undefined): BreakStatement; + function createReturn(expression?: Expression): ReturnStatement; + function updateReturn(node: ReturnStatement, expression: Expression | undefined): ReturnStatement; + function createWith(expression: Expression, statement: Statement): WithStatement; function updateWith(node: WithStatement, expression: Expression, statement: Statement): WithStatement; - function createSwitch(expression: Expression, caseBlock: CaseBlock, location?: TextRange): SwitchStatement; + function createSwitch(expression: Expression, caseBlock: CaseBlock): SwitchStatement; function updateSwitch(node: SwitchStatement, expression: Expression, caseBlock: CaseBlock): SwitchStatement; - function createLabel(label: string | Identifier, statement: Statement, location?: TextRange): LabeledStatement; + function createLabel(label: string | Identifier, statement: Statement): LabeledStatement; function updateLabel(node: LabeledStatement, label: Identifier, statement: Statement): LabeledStatement; - function createThrow(expression: Expression, location?: TextRange): ThrowStatement; + function createThrow(expression: Expression): ThrowStatement; function updateThrow(node: ThrowStatement, expression: Expression): ThrowStatement; - function createTry(tryBlock: Block, catchClause: CatchClause, finallyBlock: Block, location?: TextRange): TryStatement; - function updateTry(node: TryStatement, tryBlock: Block, catchClause: CatchClause, finallyBlock: Block): TryStatement; - function createCaseBlock(clauses: CaseOrDefaultClause[], location?: TextRange): CaseBlock; + function createTry(tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined): TryStatement; + function updateTry(node: TryStatement, tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined): TryStatement; + function createFunctionDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration; + function updateFunctionDeclaration(node: FunctionDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration; + function createClassDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, heritageClauses: HeritageClause[], members: ClassElement[]): ClassDeclaration; + function updateClassDeclaration(node: ClassDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, heritageClauses: HeritageClause[], members: ClassElement[]): ClassDeclaration; + function createEnumDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | Identifier, members: EnumMember[]): EnumDeclaration; + function updateEnumDeclaration(node: EnumDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: Identifier, members: EnumMember[]): EnumDeclaration; + function createModuleDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration; + function updateModuleDeclaration(node: ModuleDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined): ModuleDeclaration; + function createModuleBlock(statements: Statement[]): ModuleBlock; + function updateModuleBlock(node: ModuleBlock, statements: Statement[]): ModuleBlock; + function createCaseBlock(clauses: CaseOrDefaultClause[]): CaseBlock; function updateCaseBlock(node: CaseBlock, clauses: CaseOrDefaultClause[]): CaseBlock; - function createFunctionDeclaration(decorators: Decorator[], modifiers: Modifier[], asteriskToken: AsteriskToken, name: string | Identifier, typeParameters: TypeParameterDeclaration[], parameters: ParameterDeclaration[], type: TypeNode, body: Block, location?: TextRange, flags?: NodeFlags): FunctionDeclaration; - function updateFunctionDeclaration(node: FunctionDeclaration, decorators: Decorator[], modifiers: Modifier[], name: Identifier, typeParameters: TypeParameterDeclaration[], parameters: ParameterDeclaration[], type: TypeNode, body: Block): FunctionDeclaration; - function createClassDeclaration(decorators: Decorator[], modifiers: Modifier[], name: Identifier, typeParameters: TypeParameterDeclaration[], heritageClauses: HeritageClause[], members: ClassElement[], location?: TextRange): ClassDeclaration; - function updateClassDeclaration(node: ClassDeclaration, decorators: Decorator[], modifiers: Modifier[], name: Identifier, typeParameters: TypeParameterDeclaration[], heritageClauses: HeritageClause[], members: ClassElement[]): ClassDeclaration; - function createImportDeclaration(decorators: Decorator[], modifiers: Modifier[], importClause: ImportClause, moduleSpecifier?: Expression, location?: TextRange): ImportDeclaration; - function updateImportDeclaration(node: ImportDeclaration, decorators: Decorator[], modifiers: Modifier[], importClause: ImportClause, moduleSpecifier: Expression): ImportDeclaration; - function createImportClause(name: Identifier, namedBindings: NamedImportBindings, location?: TextRange): ImportClause; + function createImportEqualsDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; + function updateImportEqualsDeclaration(node: ImportEqualsDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; + function createImportDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier?: Expression): ImportDeclaration; + function updateImportDeclaration(node: ImportDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression | undefined): ImportDeclaration; + function createImportClause(name: Identifier, namedBindings: NamedImportBindings): ImportClause; function updateImportClause(node: ImportClause, name: Identifier, namedBindings: NamedImportBindings): ImportClause; - function createNamespaceImport(name: Identifier, location?: TextRange): NamespaceImport; + function createNamespaceImport(name: Identifier): NamespaceImport; function updateNamespaceImport(node: NamespaceImport, name: Identifier): NamespaceImport; - function createNamedImports(elements: ImportSpecifier[], location?: TextRange): NamedImports; + function createNamedImports(elements: ImportSpecifier[]): NamedImports; function updateNamedImports(node: NamedImports, elements: ImportSpecifier[]): NamedImports; - function createImportSpecifier(propertyName: Identifier, name: Identifier, location?: TextRange): ImportSpecifier; - function updateImportSpecifier(node: ImportSpecifier, propertyName: Identifier, name: Identifier): ImportSpecifier; - function createExportAssignment(decorators: Decorator[], modifiers: Modifier[], isExportEquals: boolean, expression: Expression, location?: TextRange): ExportAssignment; - function updateExportAssignment(node: ExportAssignment, decorators: Decorator[], modifiers: Modifier[], expression: Expression): ExportAssignment; - function createExportDeclaration(decorators: Decorator[], modifiers: Modifier[], exportClause: NamedExports, moduleSpecifier?: Expression, location?: TextRange): ExportDeclaration; - function updateExportDeclaration(node: ExportDeclaration, decorators: Decorator[], modifiers: Modifier[], exportClause: NamedExports, moduleSpecifier: Expression): ExportDeclaration; - function createNamedExports(elements: ExportSpecifier[], location?: TextRange): NamedExports; + function createImportSpecifier(propertyName: Identifier | undefined, name: Identifier): ImportSpecifier; + function updateImportSpecifier(node: ImportSpecifier, propertyName: Identifier | undefined, name: Identifier): ImportSpecifier; + function createExportAssignment(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, isExportEquals: boolean, expression: Expression): ExportAssignment; + function updateExportAssignment(node: ExportAssignment, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, expression: Expression): ExportAssignment; + function createExportDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, exportClause: NamedExports | undefined, moduleSpecifier?: Expression): ExportDeclaration; + function updateExportDeclaration(node: ExportDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, exportClause: NamedExports | undefined, moduleSpecifier: Expression | undefined): ExportDeclaration; + function createNamedExports(elements: ExportSpecifier[]): NamedExports; function updateNamedExports(node: NamedExports, elements: ExportSpecifier[]): NamedExports; - function createExportSpecifier(name: string | Identifier, propertyName?: string | Identifier, location?: TextRange): ExportSpecifier; - function updateExportSpecifier(node: ExportSpecifier, name: Identifier, propertyName: Identifier): ExportSpecifier; - function createJsxElement(openingElement: JsxOpeningElement, children: JsxChild[], closingElement: JsxClosingElement, location?: TextRange): JsxElement; + function createExportSpecifier(propertyName: string | Identifier | undefined, name: string | Identifier): ExportSpecifier; + function updateExportSpecifier(node: ExportSpecifier, propertyName: Identifier | undefined, name: Identifier): ExportSpecifier; + function createExternalModuleReference(expression: Expression): ExternalModuleReference; + function updateExternalModuleReference(node: ExternalModuleReference, expression: Expression): ExternalModuleReference; + function createJsxElement(openingElement: JsxOpeningElement, children: JsxChild[], closingElement: JsxClosingElement): JsxElement; function updateJsxElement(node: JsxElement, openingElement: JsxOpeningElement, children: JsxChild[], closingElement: JsxClosingElement): JsxElement; - function createJsxSelfClosingElement(tagName: JsxTagNameExpression, attributes: JsxAttributeLike[], location?: TextRange): JsxSelfClosingElement; - function updateJsxSelfClosingElement(node: JsxSelfClosingElement, tagName: JsxTagNameExpression, attributes: JsxAttributeLike[]): JsxSelfClosingElement; - function createJsxOpeningElement(tagName: JsxTagNameExpression, attributes: JsxAttributeLike[], location?: TextRange): JsxOpeningElement; - function updateJsxOpeningElement(node: JsxOpeningElement, tagName: JsxTagNameExpression, attributes: JsxAttributeLike[]): JsxOpeningElement; - function createJsxClosingElement(tagName: JsxTagNameExpression, location?: TextRange): JsxClosingElement; + function createJsxSelfClosingElement(tagName: JsxTagNameExpression, attributes: JsxAttributes): JsxSelfClosingElement; + function updateJsxSelfClosingElement(node: JsxSelfClosingElement, tagName: JsxTagNameExpression, attributes: JsxAttributes): JsxSelfClosingElement; + function createJsxOpeningElement(tagName: JsxTagNameExpression, attributes: JsxAttributes): JsxOpeningElement; + function updateJsxOpeningElement(node: JsxOpeningElement, tagName: JsxTagNameExpression, attributes: JsxAttributes): JsxOpeningElement; + function createJsxClosingElement(tagName: JsxTagNameExpression): JsxClosingElement; function updateJsxClosingElement(node: JsxClosingElement, tagName: JsxTagNameExpression): JsxClosingElement; - function createJsxAttribute(name: Identifier, initializer: StringLiteral | JsxExpression, location?: TextRange): JsxAttribute; + function createJsxAttributes(properties: JsxAttributeLike[]): JsxAttributes; + function updateJsxAttributes(jsxAttributes: JsxAttributes, properties: JsxAttributeLike[]): JsxAttributes; + function createJsxAttribute(name: Identifier, initializer: StringLiteral | JsxExpression): JsxAttribute; function updateJsxAttribute(node: JsxAttribute, name: Identifier, initializer: StringLiteral | JsxExpression): JsxAttribute; - function createJsxSpreadAttribute(expression: Expression, location?: TextRange): JsxSpreadAttribute; + function createJsxSpreadAttribute(expression: Expression): JsxSpreadAttribute; function updateJsxSpreadAttribute(node: JsxSpreadAttribute, expression: Expression): JsxSpreadAttribute; - function createJsxExpression(expression: Expression, location?: TextRange): JsxExpression; - function updateJsxExpression(node: JsxExpression, expression: Expression): JsxExpression; - function createHeritageClause(token: SyntaxKind, types: ExpressionWithTypeArguments[], location?: TextRange): HeritageClause; + function createJsxExpression(dotDotDotToken: DotDotDotToken | undefined, expression: Expression | undefined): JsxExpression; + function updateJsxExpression(node: JsxExpression, expression: Expression | undefined): JsxExpression; + function createHeritageClause(token: HeritageClause["token"], types: ExpressionWithTypeArguments[]): HeritageClause; function updateHeritageClause(node: HeritageClause, types: ExpressionWithTypeArguments[]): HeritageClause; - function createCaseClause(expression: Expression, statements: Statement[], location?: TextRange): CaseClause; + function createCaseClause(expression: Expression, statements: Statement[]): CaseClause; function updateCaseClause(node: CaseClause, expression: Expression, statements: Statement[]): CaseClause; - function createDefaultClause(statements: Statement[], location?: TextRange): DefaultClause; + function createDefaultClause(statements: Statement[]): DefaultClause; function updateDefaultClause(node: DefaultClause, statements: Statement[]): DefaultClause; - function createCatchClause(variableDeclaration: string | VariableDeclaration, block: Block, location?: TextRange): CatchClause; + function createCatchClause(variableDeclaration: string | VariableDeclaration, block: Block): CatchClause; function updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration, block: Block): CatchClause; - function createPropertyAssignment(name: string | PropertyName, initializer: Expression, location?: TextRange): PropertyAssignment; + function createPropertyAssignment(name: string | PropertyName, initializer: Expression): PropertyAssignment; function updatePropertyAssignment(node: PropertyAssignment, name: PropertyName, initializer: Expression): PropertyAssignment; - function createShorthandPropertyAssignment(name: string | Identifier, objectAssignmentInitializer: Expression, location?: TextRange): ShorthandPropertyAssignment; - function createSpreadAssignment(expression: Expression, location?: TextRange): SpreadAssignment; - function updateShorthandPropertyAssignment(node: ShorthandPropertyAssignment, name: Identifier, objectAssignmentInitializer: Expression): ShorthandPropertyAssignment; + function createShorthandPropertyAssignment(name: string | Identifier, objectAssignmentInitializer?: Expression): ShorthandPropertyAssignment; + function updateShorthandPropertyAssignment(node: ShorthandPropertyAssignment, name: Identifier, objectAssignmentInitializer: Expression | undefined): ShorthandPropertyAssignment; + function createSpreadAssignment(expression: Expression): SpreadAssignment; function updateSpreadAssignment(node: SpreadAssignment, expression: Expression): SpreadAssignment; + function createEnumMember(name: string | PropertyName, initializer?: Expression): EnumMember; + function updateEnumMember(node: EnumMember, name: PropertyName, initializer: Expression | undefined): EnumMember; function updateSourceFileNode(node: SourceFile, statements: Statement[]): SourceFile; + function getMutableClone(node: T): T; function createNotEmittedStatement(original: Node): NotEmittedStatement; - function createEndOfDeclarationMarker(original: Node): EndOfDeclarationMarker; - function createMergeDeclarationMarker(original: Node): MergeDeclarationMarker; - function createPartiallyEmittedExpression(expression: Expression, original?: Node, location?: TextRange): PartiallyEmittedExpression; + function createPartiallyEmittedExpression(expression: Expression, original?: Node): PartiallyEmittedExpression; function updatePartiallyEmittedExpression(node: PartiallyEmittedExpression, expression: Expression): PartiallyEmittedExpression; - function createRawExpression(text: string): RawExpression; + function createBundle(sourceFiles: SourceFile[]): Bundle; + function updateBundle(node: Bundle, sourceFiles: SourceFile[]): Bundle; function createComma(left: Expression, right: Expression): Expression; - function createLessThan(left: Expression, right: Expression, location?: TextRange): Expression; - function createAssignment(left: ObjectLiteralExpression | ArrayLiteralExpression, right: Expression, location?: TextRange): DestructuringAssignment; - function createAssignment(left: Expression, right: Expression, location?: TextRange): BinaryExpression; + function createLessThan(left: Expression, right: Expression): Expression; + function createAssignment(left: ObjectLiteralExpression | ArrayLiteralExpression, right: Expression): DestructuringAssignment; + function createAssignment(left: Expression, right: Expression): BinaryExpression; function createStrictEquality(left: Expression, right: Expression): BinaryExpression; function createStrictInequality(left: Expression, right: Expression): BinaryExpression; function createAdd(left: Expression, right: Expression): BinaryExpression; function createSubtract(left: Expression, right: Expression): BinaryExpression; - function createPostfixIncrement(operand: Expression, location?: TextRange): PostfixUnaryExpression; + function createPostfixIncrement(operand: Expression): PostfixUnaryExpression; function createLogicalAnd(left: Expression, right: Expression): BinaryExpression; function createLogicalOr(left: Expression, right: Expression): BinaryExpression; function createLogicalNot(operand: Expression): PrefixUnaryExpression; function createVoidZero(): VoidExpression; - type TypeOfTag = "undefined" | "number" | "boolean" | "string" | "symbol" | "object" | "function"; - function createTypeCheck(value: Expression, tag: TypeOfTag): BinaryExpression; - function createMemberAccessForPropertyName(target: Expression, memberName: PropertyName, location?: TextRange): MemberExpression; - function createFunctionCall(func: Expression, thisArg: Expression, argumentsList: Expression[], location?: TextRange): CallExpression; - function createFunctionApply(func: Expression, thisArg: Expression, argumentsExpression: Expression, location?: TextRange): CallExpression; - function createArraySlice(array: Expression, start?: number | Expression): CallExpression; - function createArrayConcat(array: Expression, values: Expression[]): CallExpression; - function createMathPow(left: Expression, right: Expression, location?: TextRange): CallExpression; - function createExpressionForJsxElement(jsxFactoryEntity: EntityName, reactNamespace: string, tagName: Expression, props: Expression, children: Expression[], parentElement: JsxOpeningLikeElement, location: TextRange): LeftHandSideExpression; function createExportDefault(expression: Expression): ExportAssignment; function createExternalModuleExport(exportName: Identifier): ExportDeclaration; - function createLetStatement(name: Identifier, initializer: Expression, location?: TextRange): VariableStatement; - function createLetDeclarationList(declarations: VariableDeclaration[], location?: TextRange): VariableDeclarationList; - function createConstDeclarationList(declarations: VariableDeclaration[], location?: TextRange): VariableDeclarationList; - function getHelperName(name: string): Identifier; - interface CallBinding { - target: LeftHandSideExpression; - thisArg: Expression; - } - function createCallBinding(expression: Expression, recordTempVariable: (temp: Identifier) => void, languageVersion?: ScriptTarget, cacheIdentifiers?: boolean): CallBinding; - function inlineExpressions(expressions: Expression[]): Expression; - function createExpressionFromEntityName(node: EntityName | Expression): Expression; - function createExpressionForPropertyName(memberName: PropertyName): Expression; - function createExpressionForObjectLiteralElementLike(node: ObjectLiteralExpression, property: ObjectLiteralElementLike, receiver: Expression): Expression; - function getLocalName(node: Declaration, allowComments?: boolean, allowSourceMaps?: boolean): Identifier; - function isLocalName(node: Identifier): boolean; - function getExportName(node: Declaration, allowComments?: boolean, allowSourceMaps?: boolean): Identifier; - function isExportName(node: Identifier): boolean; - function getDeclarationName(node: Declaration, allowComments?: boolean, allowSourceMaps?: boolean): Identifier; - function getExternalModuleOrNamespaceExportName(ns: Identifier | undefined, node: Declaration, allowComments?: boolean, allowSourceMaps?: boolean): Identifier | PropertyAccessExpression; - function getNamespaceMemberName(ns: Identifier, name: Identifier, allowComments?: boolean, allowSourceMaps?: boolean): PropertyAccessExpression; - function convertToFunctionBody(node: ConciseBody, multiLine?: boolean): Block; - function addPrologueDirectives(target: Statement[], source: Statement[], ensureUseStrict?: boolean, visitor?: (node: Node) => VisitResult): number; - function startsWithUseStrict(statements: Statement[]): boolean; - function ensureUseStrict(statements: NodeArray): NodeArray; - function parenthesizeBinaryOperand(binaryOperator: SyntaxKind, operand: Expression, isLeftSideOfBinary: boolean, leftOperand?: Expression): Expression; - function parenthesizeForConditionalHead(condition: Expression): Expression; - function parenthesizeForNew(expression: Expression): LeftHandSideExpression; - function parenthesizeForAccess(expression: Expression): LeftHandSideExpression; - function parenthesizePostfixOperand(operand: Expression): LeftHandSideExpression; - function parenthesizePrefixOperand(operand: Expression): UnaryExpression; - function parenthesizeExpressionForList(expression: Expression): Expression; - function parenthesizeExpressionForExpressionStatement(expression: Expression): Expression; - function parenthesizeConciseBody(body: ConciseBody): ConciseBody; - const enum OuterExpressionKinds { - Parentheses = 1, - Assertions = 2, - PartiallyEmittedExpressions = 4, - All = 7, - } - function skipOuterExpressions(node: Expression, kinds?: OuterExpressionKinds): Expression; - function skipOuterExpressions(node: Node, kinds?: OuterExpressionKinds): Node; - function skipParentheses(node: Expression): Expression; - function skipParentheses(node: Node): Node; - function skipAssertions(node: Expression): Expression; - function skipAssertions(node: Node): Node; - function skipPartiallyEmittedExpressions(node: Expression): Expression; - function skipPartiallyEmittedExpressions(node: Node): Node; - function startOnNewLine(node: T): T; - function setOriginalNode(node: T, original: Node): T; function disposeEmitNodes(sourceFile: SourceFile): void; - function getOrCreateEmitNode(node: Node): EmitNode; - function getEmitFlags(node: Node): EmitFlags; + function setTextRange(range: T, location: TextRange | undefined): T; + function getEmitFlags(node: Node): EmitFlags | undefined; function setEmitFlags(node: T, emitFlags: EmitFlags): T; function getSourceMapRange(node: Node): TextRange; - function setSourceMapRange(node: T, range: TextRange): T; - function getTokenSourceMapRange(node: Node, token: SyntaxKind): TextRange; - function setTokenSourceMapRange(node: T, token: SyntaxKind, range: TextRange): T; + function setSourceMapRange(node: T, range: TextRange | undefined): T; + function getTokenSourceMapRange(node: Node, token: SyntaxKind): TextRange | undefined; + function setTokenSourceMapRange(node: T, token: SyntaxKind, range: TextRange | undefined): T; function getCommentRange(node: Node): TextRange; function setCommentRange(node: T, range: TextRange): T; + function getSyntheticLeadingComments(node: Node): SynthesizedComment[] | undefined; + function setSyntheticLeadingComments(node: T, comments: SynthesizedComment[]): T; + function addSyntheticLeadingComment(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean): T; + function getSyntheticTrailingComments(node: Node): SynthesizedComment[] | undefined; + function setSyntheticTrailingComments(node: T, comments: SynthesizedComment[]): T; + function addSyntheticTrailingComment(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean): T; function getConstantValue(node: PropertyAccessExpression | ElementAccessExpression): number; function setConstantValue(node: PropertyAccessExpression | ElementAccessExpression, value: number): PropertyAccessExpression | ElementAccessExpression; - function getExternalHelpersModuleName(node: SourceFile): Identifier; - function getOrCreateExternalHelpersModuleNameIfNeeded(node: SourceFile, compilerOptions: CompilerOptions): Identifier; function addEmitHelper(node: T, helper: EmitHelper): T; function addEmitHelpers(node: T, helpers: EmitHelper[] | undefined): T; function removeEmitHelper(node: Node, helper: EmitHelper): boolean; function getEmitHelpers(node: Node): EmitHelper[] | undefined; function moveEmitHelpers(source: Node, target: Node, predicate: (helper: EmitHelper) => boolean): void; - function compareEmitHelpers(x: EmitHelper, y: EmitHelper): Comparison; - function setTextRange(node: T, location: TextRange): T; - function setNodeFlags(node: T, flags: NodeFlags): T; - function setMultiLine(node: T, multiLine: boolean): T; - function setHasTrailingComma(nodes: NodeArray, hasTrailingComma: boolean): NodeArray; - function getLocalNameForExternalImport(node: ImportDeclaration | ExportDeclaration | ImportEqualsDeclaration, sourceFile: SourceFile): Identifier; - function getExternalModuleNameLiteral(importNode: ImportDeclaration | ExportDeclaration | ImportEqualsDeclaration, sourceFile: SourceFile, host: EmitHost, resolver: EmitResolver, compilerOptions: CompilerOptions): StringLiteral; - function tryGetModuleNameFromFile(file: SourceFile, host: EmitHost, options: CompilerOptions): StringLiteral; - function getInitializerOfBindingOrAssignmentElement(bindingElement: BindingOrAssignmentElement): Expression | undefined; - function getTargetOfBindingOrAssignmentElement(bindingElement: BindingOrAssignmentElement): BindingOrAssignmentElementTarget; - function getRestIndicatorOfBindingOrAssignmentElement(bindingElement: BindingOrAssignmentElement): BindingOrAssignmentElementRestIndicator; - function getPropertyNameOfBindingOrAssignmentElement(bindingElement: BindingOrAssignmentElement): PropertyName; - function getElementsOfBindingOrAssignmentPattern(name: BindingOrAssignmentPattern): BindingOrAssignmentElement[]; - function convertToArrayAssignmentElement(element: BindingOrAssignmentElement): Expression; - function convertToObjectAssignmentElement(element: BindingOrAssignmentElement): ObjectLiteralElementLike; - function convertToAssignmentPattern(node: BindingOrAssignmentPattern): AssignmentPattern; - function convertToObjectAssignmentPattern(node: ObjectBindingOrAssignmentPattern): ObjectLiteralExpression; - function convertToArrayAssignmentPattern(node: ArrayBindingOrAssignmentPattern): ArrayLiteralExpression; - function convertToAssignmentElementTarget(node: BindingOrAssignmentElementTarget): Expression; - interface ExternalModuleInfo { - externalImports: (ImportDeclaration | ImportEqualsDeclaration | ExportDeclaration)[]; - externalHelpersImportDeclaration: ImportDeclaration | undefined; - exportSpecifiers: Map; - exportedBindings: Map; - exportedNames: Identifier[]; - exportEquals: ExportAssignment | undefined; - hasExportStarsToExportValues: boolean; - } - function collectExternalModuleInfo(sourceFile: SourceFile, resolver: EmitResolver, compilerOptions: CompilerOptions): ExternalModuleInfo; + function setOriginalNode(node: T, original: Node | undefined): T; } declare namespace ts { function createNode(kind: SyntaxKind, pos?: number, end?: number): Node; @@ -9563,140 +2755,26 @@ declare namespace ts { function parseIsolatedEntityName(text: string, languageVersion: ScriptTarget): EntityName; function isExternalModule(file: SourceFile): boolean; function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; - function parseIsolatedJSDocComment(content: string, start?: number, length?: number): { - jsDoc: JSDoc; - diagnostics: Diagnostic[]; - }; - function parseJSDocTypeExpressionForTests(content: string, start?: number, length?: number): { - jsDocTypeExpression: JSDocTypeExpression; - diagnostics: Diagnostic[]; - }; } declare namespace ts { - const enum ModuleInstanceState { - NonInstantiated = 0, - Instantiated = 1, - ConstEnumOnly = 2, - } - function getModuleInstanceState(node: Node): ModuleInstanceState; - function bindSourceFile(file: SourceFile, options: CompilerOptions): void; - function computeTransformFlagsForNode(node: Node, subtreeFlags: TransformFlags): TransformFlags; - function getTransformFlagsSubtreeExclusions(kind: SyntaxKind): TransformFlags; + function visitNode(node: T, visitor: Visitor, test?: (node: Node) => boolean, lift?: (node: NodeArray) => T): T; + function visitNode(node: T | undefined, visitor: Visitor, test?: (node: Node) => boolean, lift?: (node: NodeArray) => T): T | undefined; + function visitNodes(nodes: NodeArray, visitor: Visitor, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray; + function visitNodes(nodes: NodeArray | undefined, visitor: Visitor, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray | undefined; + function visitLexicalEnvironment(statements: NodeArray, visitor: Visitor, context: TransformationContext, start?: number, ensureUseStrict?: boolean): NodeArray; + function visitParameterList(nodes: NodeArray, visitor: Visitor, context: TransformationContext, nodesVisitor?: typeof visitNodes): NodeArray; + function visitFunctionBody(node: FunctionBody, visitor: Visitor, context: TransformationContext): FunctionBody; + function visitFunctionBody(node: FunctionBody | undefined, visitor: Visitor, context: TransformationContext): FunctionBody | undefined; + function visitFunctionBody(node: ConciseBody, visitor: Visitor, context: TransformationContext): ConciseBody; + function visitEachChild(node: T, visitor: Visitor, context: TransformationContext): T; + function visitEachChild(node: T | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: typeof visitNodes, tokenVisitor?: Visitor): T | undefined; } declare namespace ts { - function getNodeId(node: Node): number; - function getSymbolId(symbol: Symbol): number; - function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; -} -declare namespace ts { - type VisitResult = T | T[]; - function reduceEachChild(node: Node, initial: T, cbNode: (memo: T, node: Node) => T, cbNodeArray?: (memo: T, nodes: Node[]) => T): T; - function visitNode(node: T, visitor: (node: Node) => VisitResult, test: (node: Node) => boolean, optional?: boolean, lift?: (node: NodeArray) => T): T; - function visitNode(node: T, visitor: (node: Node) => VisitResult, test: (node: Node) => boolean, optional: boolean, lift: (node: NodeArray) => T, parenthesize: (node: Node, parentNode: Node) => Node, parentNode: Node): T; - function visitNodes(nodes: NodeArray, visitor: (node: Node) => VisitResult, test: (node: Node) => boolean, start?: number, count?: number): NodeArray; - function visitNodes(nodes: NodeArray, visitor: (node: Node) => VisitResult, test: (node: Node) => boolean, start: number, count: number, parenthesize: (node: Node, parentNode: Node) => Node, parentNode: Node): NodeArray; - function visitLexicalEnvironment(statements: NodeArray, visitor: (node: Node) => VisitResult, context: TransformationContext, start?: number, ensureUseStrict?: boolean): NodeArray; - function visitParameterList(nodes: NodeArray, visitor: (node: Node) => VisitResult, context: TransformationContext): NodeArray; - function visitFunctionBody(node: FunctionBody, visitor: (node: Node) => VisitResult, context: TransformationContext): FunctionBody; - function visitFunctionBody(node: ConciseBody, visitor: (node: Node) => VisitResult, context: TransformationContext): ConciseBody; - function visitEachChild(node: T, visitor: (node: Node) => VisitResult, context: TransformationContext): T; - function mergeLexicalEnvironment(statements: NodeArray, declarations: Statement[]): NodeArray; - function mergeLexicalEnvironment(statements: Statement[], declarations: Statement[]): Statement[]; - function mergeFunctionBodyLexicalEnvironment(body: FunctionBody, declarations: Statement[]): FunctionBody; - function mergeFunctionBodyLexicalEnvironment(body: ConciseBody, declarations: Statement[]): ConciseBody; - function liftToBlock(nodes: Node[]): Statement; - function aggregateTransformFlags(node: T): T; - namespace Debug { - const failNotOptional: typeof noop; - const failBadSyntaxKind: (node: Node, message?: string) => void; - const assertEachNode: (nodes: Node[], test: (node: Node) => boolean, message?: string) => void; - const assertNode: (node: Node, test: (node: Node) => boolean, message?: string) => void; - const assertOptionalNode: (node: Node, test: (node: Node) => boolean, message?: string) => void; - const assertOptionalToken: (node: Node, kind: SyntaxKind, message?: string) => void; - const assertMissingNode: (node: Node, message?: string) => void; - } -} -declare namespace ts { - const enum FlattenLevel { - All = 0, - ObjectRest = 1, - } - function flattenDestructuringAssignment(node: VariableDeclaration | DestructuringAssignment, visitor: ((node: Node) => VisitResult) | undefined, context: TransformationContext, level: FlattenLevel, needsValue?: boolean, createAssignmentCallback?: (name: Identifier, value: Expression, location?: TextRange) => Expression): Expression; - function flattenDestructuringBinding(node: VariableDeclaration | ParameterDeclaration, visitor: (node: Node) => VisitResult, context: TransformationContext, level: FlattenLevel, rval?: Expression, hoistTempVariables?: boolean, skipInitializer?: boolean): VariableDeclaration[]; -} -declare namespace ts { - function transformTypeScript(context: TransformationContext): (node: SourceFile) => SourceFile; -} -declare namespace ts { - function transformESNext(context: TransformationContext): (node: SourceFile) => SourceFile; - function createAssignHelper(context: TransformationContext, attributesSegments: Expression[]): CallExpression; -} -declare namespace ts { - function transformJsx(context: TransformationContext): (node: SourceFile) => SourceFile; -} -declare namespace ts { - function transformES2017(context: TransformationContext): (node: SourceFile) => SourceFile; -} -declare namespace ts { - function transformES2016(context: TransformationContext): (node: SourceFile) => SourceFile; -} -declare namespace ts { - function transformES2015(context: TransformationContext): (node: SourceFile) => SourceFile; -} -declare namespace ts { - function transformGenerators(context: TransformationContext): (node: SourceFile) => SourceFile; -} -declare namespace ts { - function transformES5(context: TransformationContext): (node: SourceFile) => SourceFile; -} -declare namespace ts { - function transformModule(context: TransformationContext): (node: SourceFile) => SourceFile; -} -declare namespace ts { - function transformSystemModule(context: TransformationContext): (node: SourceFile) => SourceFile; -} -declare namespace ts { - function transformES2015Module(context: TransformationContext): (node: SourceFile) => SourceFile; -} -declare namespace ts { - function getTransformers(compilerOptions: CompilerOptions): Transformer[]; - function transformFiles(resolver: EmitResolver, host: EmitHost, sourceFiles: SourceFile[], transformers: Transformer[]): TransformationResult; -} -declare namespace ts { - function getDeclarationDiagnostics(host: EmitHost, resolver: EmitResolver, targetSourceFile: SourceFile): Diagnostic[]; - function writeDeclarationFile(declarationFilePath: string, sourceFiles: SourceFile[], isBundledEmit: boolean, host: EmitHost, resolver: EmitResolver, emitterDiagnostics: DiagnosticCollection, emitOnlyDtsFiles: boolean): boolean; -} -declare namespace ts { - interface SourceMapWriter { - initialize(filePath: string, sourceMapFilePath: string, sourceFiles: SourceFile[], isBundledEmit: boolean): void; - reset(): void; - setSourceFile(sourceFile: SourceFile): void; - emitPos(pos: number): void; - emitNodeWithSourceMap(emitContext: EmitContext, node: Node, emitCallback: (emitContext: EmitContext, node: Node) => void): void; - emitTokenWithSourceMap(node: Node, token: SyntaxKind, tokenStartPos: number, emitCallback: (token: SyntaxKind, tokenStartPos: number) => number): number; - getText(): string; - getSourceMappingURL(): string; - getSourceMapData(): SourceMapData; - } - function createSourceMapWriter(host: EmitHost, writer: EmitTextWriter): SourceMapWriter; -} -declare namespace ts { - interface CommentWriter { - reset(): void; - setSourceFile(sourceFile: SourceFile): void; - emitNodeWithComments(emitContext: EmitContext, node: Node, emitCallback: (emitContext: EmitContext, node: Node) => void): void; - emitBodyWithDetachedComments(node: Node, detachedRange: TextRange, emitCallback: (node: Node) => void): void; - emitTrailingCommentsOfPosition(pos: number): void; - } - function createCommentWriter(host: EmitHost, writer: EmitTextWriter, sourceMap: SourceMapWriter): CommentWriter; -} -declare namespace ts { - function emitFiles(resolver: EmitResolver, host: EmitHost, targetSourceFile: SourceFile, emitOnlyDtsFiles?: boolean): EmitResult; + function createPrinter(printerOptions?: PrinterOptions, handlers?: PrintHandlers): Printer; } declare namespace ts { function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string; function resolveTripleslashReference(moduleName: string, containingFile: string): string; - function computeCommonSourceDirectoryOfFilenames(fileNames: string[], currentDirectory: string, getCanonicalFileName: (fileName: string) => string): string; function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[]; interface FormatDiagnosticsHost { @@ -9707,7 +2785,6 @@ declare namespace ts { function formatDiagnostics(diagnostics: Diagnostic[], host: FormatDiagnosticsHost): string; function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost, oldProgram?: Program): Program; - function getResolutionDiagnostic(options: CompilerOptions, {extension}: ResolvedModuleFull): DiagnosticMessage | undefined; } declare namespace ts { interface Node { @@ -9725,12 +2802,14 @@ declare namespace ts { getText(sourceFile?: SourceFile): string; getFirstToken(sourceFile?: SourceFile): Node; getLastToken(sourceFile?: SourceFile): Node; + forEachChild(cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; } interface Symbol { getFlags(): SymbolFlags; getName(): string; getDeclarations(): Declaration[]; getDocumentationComment(): SymbolDisplayPart[]; + getJsDocTags(): JSDocTagInfo[]; } interface Type { getFlags(): TypeFlags; @@ -9742,27 +2821,27 @@ declare namespace ts { getConstructSignatures(): Signature[]; getStringIndexType(): Type; getNumberIndexType(): Type; - getBaseTypes(): ObjectType[]; + getBaseTypes(): BaseType[]; getNonNullableType(): Type; } interface Signature { getDeclaration(): SignatureDeclaration; - getTypeParameters(): Type[]; + getTypeParameters(): TypeParameter[]; getParameters(): Symbol[]; getReturnType(): Type; getDocumentationComment(): SymbolDisplayPart[]; + getJsDocTags(): JSDocTagInfo[]; } interface SourceFile { - version: string; - scriptSnapshot: IScriptSnapshot; - nameTable: Map; - getNamedDeclarations(): Map; getLineAndCharacterOfPosition(pos: number): LineAndCharacter; getLineEndOfPosition(pos: number): number; getLineStarts(): number[]; getPositionOfLineAndCharacter(line: number, character: number): number; update(newText: string, textChangeRange: TextChangeRange): SourceFile; } + interface SourceFileLike { + getLineAndCharacterOfPosition(pos: number): LineAndCharacter; + } interface IScriptSnapshot { getText(start: number, end: number): string; getLength(): number; @@ -9806,6 +2885,7 @@ declare namespace ts { resolveTypeReferenceDirectives?(typeDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[]; directoryExists?(directoryName: string): boolean; getDirectories?(directoryName: string): string[]; + getCustomTransformers?(): CustomTransformers | undefined; } interface LanguageService { cleanupSemanticCache(): void; @@ -9844,11 +2924,9 @@ declare namespace ts { getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; getDocCommentTemplateAtPosition(fileName: string, position: number): TextInsertion; isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean; - getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[]): CodeAction[]; + getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[]; getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput; getProgram(): Program; - getNonBoundSourceFile(fileName: string): SourceFile; - getSourceFile(fileName: string): SourceFile; dispose(): void; } interface Classifications { @@ -9901,19 +2979,20 @@ declare namespace ts { newText: string; caretOffset: number; } - interface RenameLocation { + interface DocumentSpan { textSpan: TextSpan; fileName: string; } - interface ReferenceEntry { - textSpan: TextSpan; - fileName: string; + interface RenameLocation extends DocumentSpan { + } + interface ReferenceEntry extends DocumentSpan { isWriteAccess: boolean; isDefinition: boolean; + isInString?: true; } - interface ImplementationLocation { - textSpan: TextSpan; - fileName: string; + interface ImplementationLocation extends DocumentSpan { + kind: string; + displayParts: SymbolDisplayPart[]; } interface DocumentHighlights { fileName: string; @@ -9927,6 +3006,7 @@ declare namespace ts { } interface HighlightSpan { fileName?: string; + isInString?: true; textSpan: TextSpan; kind: string; } @@ -9966,6 +3046,7 @@ declare namespace ts { InsertSpaceAfterCommaDelimiter: boolean; InsertSpaceAfterSemicolonInForStatements: boolean; InsertSpaceBeforeAndAfterBinaryOperators: boolean; + InsertSpaceAfterConstructor?: boolean; InsertSpaceAfterKeywordsInControlFlowStatements: boolean; InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; @@ -9974,6 +3055,7 @@ declare namespace ts { InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: boolean; InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean; InsertSpaceAfterTypeAssertion?: boolean; + InsertSpaceBeforeFunctionParenthesis?: boolean; PlaceOpenBraceOnNewLineForFunctions: boolean; PlaceOpenBraceOnNewLineForControlBlocks: boolean; } @@ -9981,6 +3063,7 @@ declare namespace ts { insertSpaceAfterCommaDelimiter?: boolean; insertSpaceAfterSemicolonInForStatements?: boolean; insertSpaceBeforeAndAfterBinaryOperators?: boolean; + insertSpaceAfterConstructor?: boolean; insertSpaceAfterKeywordsInControlFlowStatements?: boolean; insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean; insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean; @@ -9989,6 +3072,7 @@ declare namespace ts { insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean; insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean; insertSpaceAfterTypeAssertion?: boolean; + insertSpaceBeforeFunctionParenthesis?: boolean; placeOpenBraceOnNewLineForFunctions?: boolean; placeOpenBraceOnNewLineForControlBlocks?: boolean; } @@ -10035,12 +3119,17 @@ declare namespace ts { text: string; kind: string; } + interface JSDocTagInfo { + name: string; + text?: string; + } interface QuickInfo { kind: string; kindModifiers: string; textSpan: TextSpan; displayParts: SymbolDisplayPart[]; documentation: SymbolDisplayPart[]; + tags: JSDocTagInfo[]; } interface RenameInfo { canRename: boolean; @@ -10064,6 +3153,7 @@ declare namespace ts { separatorDisplayParts: SymbolDisplayPart[]; parameters: SignatureHelpParameter[]; documentation: SymbolDisplayPart[]; + tags: JSDocTagInfo[]; } interface SignatureHelpItems { items: SignatureHelpItem[]; @@ -10091,6 +3181,7 @@ declare namespace ts { kindModifiers: string; displayParts: SymbolDisplayPart[]; documentation: SymbolDisplayPart[]; + tags: JSDocTagInfo[]; } interface OutliningSpan { textSpan: TextSpan; @@ -10155,7 +3246,7 @@ declare namespace ts { const interfaceElement = "interface"; const typeElement = "type"; const enumElement = "enum"; - const enumMemberElement = "const"; + const enumMemberElement = "enum member"; const variableElement = "var"; const localVariableElement = "local var"; const functionElement = "function"; @@ -10177,6 +3268,7 @@ declare namespace ts { const letElement = "let"; const directory = "directory"; const externalModuleName = "external module name"; + const jsxAttribute = "JSX attribute"; } namespace ScriptElementKindModifier { const none = ""; @@ -10240,123 +3332,8 @@ declare namespace ts { jsxAttributeStringLiteralValue = 24, } } -declare namespace ts { - const scanner: Scanner; - const emptyArray: any[]; - const enum SemanticMeaning { - None = 0, - Value = 1, - Type = 2, - Namespace = 4, - All = 7, - } - function getMeaningFromDeclaration(node: Node): SemanticMeaning; - function getMeaningFromLocation(node: Node): SemanticMeaning; - function isCallExpressionTarget(node: Node): boolean; - function isNewExpressionTarget(node: Node): boolean; - function climbPastPropertyAccess(node: Node): Node; - function getTargetLabel(referenceNode: Node, labelName: string): Identifier; - function isJumpStatementTarget(node: Node): boolean; - function isLabelName(node: Node): boolean; - function isRightSideOfQualifiedName(node: Node): boolean; - function isRightSideOfPropertyAccess(node: Node): boolean; - function isNameOfModuleDeclaration(node: Node): boolean; - function isNameOfFunctionDeclaration(node: Node): boolean; - function isLiteralNameOfPropertyDeclarationOrIndexAccess(node: Node): boolean; - function isExpressionOfExternalModuleImportEqualsDeclaration(node: Node): boolean; - function isInsideComment(sourceFile: SourceFile, token: Node, position: number): boolean; - function getContainerNode(node: Node): Declaration; - function getNodeKind(node: Node): string; - function getStringLiteralTypeForNode(node: StringLiteral | LiteralTypeNode, typeChecker: TypeChecker): LiteralType; - function isThis(node: Node): boolean; - interface ListItemInfo { - listItemIndex: number; - list: Node; - } - function getLineStartPositionForPosition(position: number, sourceFile: SourceFile): number; - function rangeContainsRange(r1: TextRange, r2: TextRange): boolean; - function startEndContainsRange(start: number, end: number, range: TextRange): boolean; - function rangeContainsStartEnd(range: TextRange, start: number, end: number): boolean; - function rangeOverlapsWithStartEnd(r1: TextRange, start: number, end: number): boolean; - function startEndOverlapsWithStartEnd(start1: number, end1: number, start2: number, end2: number): boolean; - function positionBelongsToNode(candidate: Node, position: number, sourceFile: SourceFile): boolean; - function isCompletedNode(n: Node, sourceFile: SourceFile): boolean; - function findListItemInfo(node: Node): ListItemInfo; - function hasChildOfKind(n: Node, kind: SyntaxKind, sourceFile?: SourceFile): boolean; - function findChildOfKind(n: Node, kind: SyntaxKind, sourceFile?: SourceFile): Node; - function findContainingList(node: Node): Node; - function getTouchingWord(sourceFile: SourceFile, position: number, includeJsDocComment?: boolean): Node; - function getTouchingPropertyName(sourceFile: SourceFile, position: number, includeJsDocComment?: boolean): Node; - function getTouchingToken(sourceFile: SourceFile, position: number, includeItemAtEndPosition?: (n: Node) => boolean, includeJsDocComment?: boolean): Node; - function getTokenAtPosition(sourceFile: SourceFile, position: number, includeJsDocComment?: boolean): Node; - function findTokenOnLeftOfPosition(file: SourceFile, position: number): Node; - function findNextToken(previousToken: Node, parent: Node): Node; - function findPrecedingToken(position: number, sourceFile: SourceFile, startNode?: Node): Node; - function isInString(sourceFile: SourceFile, position: number): boolean; - function isInComment(sourceFile: SourceFile, position: number): boolean; - function isInsideJsxElementOrAttribute(sourceFile: SourceFile, position: number): boolean; - function isInTemplateString(sourceFile: SourceFile, position: number): boolean; - function isInCommentHelper(sourceFile: SourceFile, position: number, predicate?: (c: CommentRange) => boolean): boolean; - function hasDocComment(sourceFile: SourceFile, position: number): boolean; - function getJsDocTagAtPosition(sourceFile: SourceFile, position: number): JSDocTag; - function getNodeModifiers(node: Node): string; - function getTypeArgumentOrTypeParameterList(node: Node): NodeArray; - function isToken(n: Node): boolean; - function isWord(kind: SyntaxKind): boolean; - function isComment(kind: SyntaxKind): boolean; - function isStringOrRegularExpressionOrTemplateLiteral(kind: SyntaxKind): boolean; - function isPunctuation(kind: SyntaxKind): boolean; - function isInsideTemplateLiteral(node: LiteralExpression, position: number): boolean; - function isAccessibilityModifier(kind: SyntaxKind): boolean; - function compareDataObjects(dst: any, src: any): boolean; - function isArrayLiteralOrObjectLiteralDestructuringPattern(node: Node): boolean; - function hasTrailingDirectorySeparator(path: string): boolean; - function isInReferenceComment(sourceFile: SourceFile, position: number): boolean; - function isInNonReferenceComment(sourceFile: SourceFile, position: number): boolean; -} -declare namespace ts { - function isFirstDeclarationOfSymbolParameter(symbol: Symbol): boolean; - function symbolPart(text: string, symbol: Symbol): SymbolDisplayPart; - function displayPart(text: string, kind: SymbolDisplayPartKind): SymbolDisplayPart; - function spacePart(): SymbolDisplayPart; - function keywordPart(kind: SyntaxKind): SymbolDisplayPart; - function punctuationPart(kind: SyntaxKind): SymbolDisplayPart; - function operatorPart(kind: SyntaxKind): SymbolDisplayPart; - function textOrKeywordPart(text: string): SymbolDisplayPart; - function textPart(text: string): SymbolDisplayPart; - function getNewLineOrDefaultFromHost(host: LanguageServiceHost | LanguageServiceShimHost): string; - function lineBreakPart(): SymbolDisplayPart; - function mapToDisplayParts(writeDisplayParts: (writer: DisplayPartsSymbolWriter) => void): SymbolDisplayPart[]; - function typeToDisplayParts(typechecker: TypeChecker, type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): SymbolDisplayPart[]; - function symbolToDisplayParts(typeChecker: TypeChecker, symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): SymbolDisplayPart[]; - function signatureToDisplayParts(typechecker: TypeChecker, signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags): SymbolDisplayPart[]; - function getDeclaredName(typeChecker: TypeChecker, symbol: Symbol, location: Node): string; - function isImportOrExportSpecifierName(location: Node): boolean; - function stripQuotes(name: string): string; - function scriptKindIs(fileName: string, host: LanguageServiceHost, ...scriptKinds: ScriptKind[]): boolean; - function getScriptKind(fileName: string, host?: LanguageServiceHost): ScriptKind; - function sanitizeConfigFile(configFileName: string, content: string): { - configJsonObject: any; - diagnostics: Diagnostic[]; - }; -} -declare namespace ts.BreakpointResolver { - function spanInSourceFileAtLocation(sourceFile: SourceFile, position: number): TextSpan; -} declare namespace ts { function createClassifier(): Classifier; - function getSemanticClassifications(typeChecker: TypeChecker, cancellationToken: CancellationToken, sourceFile: SourceFile, classifiableNames: Map, span: TextSpan): ClassifiedSpan[]; - function getEncodedSemanticClassifications(typeChecker: TypeChecker, cancellationToken: CancellationToken, sourceFile: SourceFile, classifiableNames: Map, span: TextSpan): Classifications; - function getSyntacticClassifications(cancellationToken: CancellationToken, sourceFile: SourceFile, span: TextSpan): ClassifiedSpan[]; - function getEncodedSyntacticClassifications(cancellationToken: CancellationToken, sourceFile: SourceFile, span: TextSpan): Classifications; -} -declare namespace ts.Completions { - function getCompletionsAtPosition(host: LanguageServiceHost, typeChecker: TypeChecker, log: (message: string) => void, compilerOptions: CompilerOptions, sourceFile: SourceFile, position: number): CompletionInfo; - function getCompletionEntryDetails(typeChecker: TypeChecker, log: (message: string) => void, compilerOptions: CompilerOptions, sourceFile: SourceFile, position: number, entryName: string): CompletionEntryDetails; - function getCompletionEntrySymbol(typeChecker: TypeChecker, log: (message: string) => void, compilerOptions: CompilerOptions, sourceFile: SourceFile, position: number, entryName: string): Symbol; -} -declare namespace ts.DocumentHighlights { - function getDocumentHighlights(typeChecker: TypeChecker, cancellationToken: CancellationToken, sourceFile: SourceFile, position: number, sourceFilesToSearch: SourceFile[]): DocumentHighlights[]; } declare namespace ts { interface DocumentRegistry { @@ -10374,88 +3351,9 @@ declare namespace ts { }; function createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory?: string): DocumentRegistry; } -declare namespace ts.FindAllReferences { - function findReferencedSymbols(typeChecker: TypeChecker, cancellationToken: CancellationToken, sourceFiles: SourceFile[], sourceFile: SourceFile, position: number, findInStrings: boolean, findInComments: boolean): ReferencedSymbol[]; - function getReferencedSymbolsForNode(typeChecker: TypeChecker, cancellationToken: CancellationToken, node: Node, sourceFiles: SourceFile[], findInStrings: boolean, findInComments: boolean, implementations: boolean): ReferencedSymbol[]; - function convertReferences(referenceSymbols: ReferencedSymbol[]): ReferenceEntry[]; - function getReferenceEntriesForShorthandPropertyAssignment(node: Node, typeChecker: TypeChecker, result: ReferenceEntry[]): void; - function getReferenceEntryFromNode(node: Node): ReferenceEntry; -} -declare namespace ts.GoToDefinition { - function getDefinitionAtPosition(program: Program, sourceFile: SourceFile, position: number): DefinitionInfo[]; - function getTypeDefinitionAtPosition(typeChecker: TypeChecker, sourceFile: SourceFile, position: number): DefinitionInfo[]; -} -declare namespace ts.GoToImplementation { - function getImplementationAtPosition(typeChecker: TypeChecker, cancellationToken: CancellationToken, sourceFiles: SourceFile[], node: Node): ImplementationLocation[]; -} -declare namespace ts.JsDoc { - function getJsDocCommentsFromDeclarations(declarations: Declaration[]): SymbolDisplayPart[]; - function getAllJsDocCompletionEntries(): CompletionEntry[]; - function getDocCommentTemplateAtPosition(newLine: string, sourceFile: SourceFile, position: number): TextInsertion; -} -declare namespace ts.NavigateTo { - function getNavigateToItems(sourceFiles: SourceFile[], checker: TypeChecker, cancellationToken: CancellationToken, searchValue: string, maxResultCount: number, excludeDtsFiles: boolean): NavigateToItem[]; -} -declare namespace ts.NavigationBar { - function getNavigationBarItems(sourceFile: SourceFile): NavigationBarItem[]; - function getNavigationTree(sourceFile: SourceFile): NavigationTree; -} -declare namespace ts.OutliningElementsCollector { - function collectElements(sourceFile: SourceFile): OutliningSpan[]; -} -declare namespace ts { - enum PatternMatchKind { - exact = 0, - prefix = 1, - substring = 2, - camelCase = 3, - } - interface PatternMatch { - kind: PatternMatchKind; - camelCaseWeight?: number; - isCaseSensitive: boolean; - punctuationStripped: boolean; - } - interface PatternMatcher { - getMatchesForLastSegmentOfPattern(candidate: string): PatternMatch[]; - getMatches(candidateContainers: string[], candidate: string): PatternMatch[]; - patternContainsDots: boolean; - } - function createPatternMatcher(pattern: string): PatternMatcher; - function breakIntoCharacterSpans(identifier: string): TextSpan[]; - function breakIntoWordSpans(identifier: string): TextSpan[]; -} declare namespace ts { function preProcessFile(sourceText: string, readImportFiles?: boolean, detectJavaScriptImports?: boolean): PreProcessedFileInfo; } -declare namespace ts.Rename { - function getRenameInfo(typeChecker: TypeChecker, defaultLibFileName: string, getCanonicalFileName: (fileName: string) => string, sourceFile: SourceFile, position: number): RenameInfo; -} -declare namespace ts.SignatureHelp { - const enum ArgumentListKind { - TypeArguments = 0, - CallArguments = 1, - TaggedTemplateArguments = 2, - } - interface ArgumentListInfo { - kind: ArgumentListKind; - invocation: CallLikeExpression; - argumentsSpan: TextSpan; - argumentIndex?: number; - argumentCount: number; - } - function getSignatureHelpItems(program: Program, sourceFile: SourceFile, position: number, cancellationToken: CancellationToken): SignatureHelpItems; - function getContainingArgumentInfo(node: Node, position: number, sourceFile: SourceFile): ArgumentListInfo; -} -declare namespace ts.SymbolDisplay { - function getSymbolKind(typeChecker: TypeChecker, symbol: Symbol, location: Node): string; - function getSymbolModifiers(symbol: Symbol): string; - function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker: TypeChecker, symbol: Symbol, sourceFile: SourceFile, enclosingDeclaration: Node, location: Node, semanticMeaning?: SemanticMeaning): { - displayParts: SymbolDisplayPart[]; - documentation: SymbolDisplayPart[]; - symbolKind: string; - }; -} declare namespace ts { interface TranspileOptions { compilerOptions?: CompilerOptions; @@ -10472,444 +3370,11 @@ declare namespace ts { function transpileModule(input: string, transpileOptions: TranspileOptions): TranspileOutput; function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string): string; } -declare namespace ts.formatting { - interface FormattingScanner { - advance(): void; - isOnToken(): boolean; - readTokenInfo(n: Node): TokenInfo; - getCurrentLeadingTrivia(): TextRangeWithKind[]; - lastTrailingTriviaWasNewLine(): boolean; - skipToEndOf(node: Node): void; - close(): void; - } - function getFormattingScanner(sourceFile: SourceFile, startPos: number, endPos: number): FormattingScanner; -} -declare namespace ts.formatting { - class FormattingContext { - sourceFile: SourceFile; - formattingRequestKind: FormattingRequestKind; - currentTokenSpan: TextRangeWithKind; - nextTokenSpan: TextRangeWithKind; - contextNode: Node; - currentTokenParent: Node; - nextTokenParent: Node; - private contextNodeAllOnSameLine; - private nextNodeAllOnSameLine; - private tokensAreOnSameLine; - private contextNodeBlockIsOnOneLine; - private nextNodeBlockIsOnOneLine; - constructor(sourceFile: SourceFile, formattingRequestKind: FormattingRequestKind); - updateContext(currentRange: TextRangeWithKind, currentTokenParent: Node, nextRange: TextRangeWithKind, nextTokenParent: Node, commonParent: Node): void; - ContextNodeAllOnSameLine(): boolean; - NextNodeAllOnSameLine(): boolean; - TokensAreOnSameLine(): boolean; - ContextNodeBlockIsOnOneLine(): boolean; - NextNodeBlockIsOnOneLine(): boolean; - private NodeIsOnOneLine(node); - private BlockIsOnOneLine(node); - } -} -declare namespace ts.formatting { - const enum FormattingRequestKind { - FormatDocument = 0, - FormatSelection = 1, - FormatOnEnter = 2, - FormatOnSemicolon = 3, - FormatOnClosingCurlyBrace = 4, - } -} -declare namespace ts.formatting { - class Rule { - Descriptor: RuleDescriptor; - Operation: RuleOperation; - Flag: RuleFlags; - constructor(Descriptor: RuleDescriptor, Operation: RuleOperation, Flag?: RuleFlags); - toString(): string; - } -} -declare namespace ts.formatting { - const enum RuleAction { - Ignore = 1, - Space = 2, - NewLine = 4, - Delete = 8, - } -} -declare namespace ts.formatting { - class RuleDescriptor { - LeftTokenRange: Shared.TokenRange; - RightTokenRange: Shared.TokenRange; - constructor(LeftTokenRange: Shared.TokenRange, RightTokenRange: Shared.TokenRange); - toString(): string; - static create1(left: SyntaxKind, right: SyntaxKind): RuleDescriptor; - static create2(left: Shared.TokenRange, right: SyntaxKind): RuleDescriptor; - static create3(left: SyntaxKind, right: Shared.TokenRange): RuleDescriptor; - static create4(left: Shared.TokenRange, right: Shared.TokenRange): RuleDescriptor; - } -} -declare namespace ts.formatting { - const enum RuleFlags { - None = 0, - CanDeleteNewLines = 1, - } -} -declare namespace ts.formatting { - class RuleOperation { - Context: RuleOperationContext; - Action: RuleAction; - constructor(Context: RuleOperationContext, Action: RuleAction); - toString(): string; - static create1(action: RuleAction): RuleOperation; - static create2(context: RuleOperationContext, action: RuleAction): RuleOperation; - } -} -declare namespace ts.formatting { - class RuleOperationContext { - private customContextChecks; - constructor(...funcs: { - (context: FormattingContext): boolean; - }[]); - static Any: RuleOperationContext; - IsAny(): boolean; - InContext(context: FormattingContext): boolean; - } -} -declare namespace ts.formatting { - class Rules { - getRuleName(rule: Rule): string; - [name: string]: any; - IgnoreBeforeComment: Rule; - IgnoreAfterLineComment: Rule; - NoSpaceBeforeSemicolon: Rule; - NoSpaceBeforeColon: Rule; - NoSpaceBeforeQuestionMark: Rule; - SpaceAfterColon: Rule; - SpaceAfterQuestionMarkInConditionalOperator: Rule; - NoSpaceAfterQuestionMark: Rule; - SpaceAfterSemicolon: Rule; - SpaceAfterCloseBrace: Rule; - SpaceBetweenCloseBraceAndElse: Rule; - SpaceBetweenCloseBraceAndWhile: Rule; - NoSpaceAfterCloseBrace: Rule; - NoSpaceBeforeDot: Rule; - NoSpaceAfterDot: Rule; - NoSpaceBeforeOpenBracket: Rule; - NoSpaceAfterCloseBracket: Rule; - SpaceAfterOpenBrace: Rule; - SpaceBeforeCloseBrace: Rule; - NoSpaceAfterOpenBrace: Rule; - NoSpaceBeforeCloseBrace: Rule; - NoSpaceBetweenEmptyBraceBrackets: Rule; - NewLineAfterOpenBraceInBlockContext: Rule; - NewLineBeforeCloseBraceInBlockContext: Rule; - NoSpaceAfterUnaryPrefixOperator: Rule; - NoSpaceAfterUnaryPreincrementOperator: Rule; - NoSpaceAfterUnaryPredecrementOperator: Rule; - NoSpaceBeforeUnaryPostincrementOperator: Rule; - NoSpaceBeforeUnaryPostdecrementOperator: Rule; - SpaceAfterPostincrementWhenFollowedByAdd: Rule; - SpaceAfterAddWhenFollowedByUnaryPlus: Rule; - SpaceAfterAddWhenFollowedByPreincrement: Rule; - SpaceAfterPostdecrementWhenFollowedBySubtract: Rule; - SpaceAfterSubtractWhenFollowedByUnaryMinus: Rule; - SpaceAfterSubtractWhenFollowedByPredecrement: Rule; - NoSpaceBeforeComma: Rule; - SpaceAfterCertainKeywords: Rule; - SpaceAfterLetConstInVariableDeclaration: Rule; - NoSpaceBeforeOpenParenInFuncCall: Rule; - SpaceAfterFunctionInFuncDecl: Rule; - NoSpaceBeforeOpenParenInFuncDecl: Rule; - SpaceAfterVoidOperator: Rule; - NoSpaceBetweenReturnAndSemicolon: Rule; - SpaceBetweenStatements: Rule; - SpaceAfterTryFinally: Rule; - SpaceAfterGetSetInMember: Rule; - SpaceBeforeBinaryKeywordOperator: Rule; - SpaceAfterBinaryKeywordOperator: Rule; - NoSpaceAfterConstructor: Rule; - NoSpaceAfterModuleImport: Rule; - SpaceAfterCertainTypeScriptKeywords: Rule; - SpaceBeforeCertainTypeScriptKeywords: Rule; - SpaceAfterModuleName: Rule; - SpaceBeforeArrow: Rule; - SpaceAfterArrow: Rule; - NoSpaceAfterEllipsis: Rule; - NoSpaceAfterOptionalParameters: Rule; - NoSpaceBeforeOpenAngularBracket: Rule; - NoSpaceBetweenCloseParenAndAngularBracket: Rule; - NoSpaceAfterOpenAngularBracket: Rule; - NoSpaceBeforeCloseAngularBracket: Rule; - NoSpaceAfterCloseAngularBracket: Rule; - NoSpaceBetweenEmptyInterfaceBraceBrackets: Rule; - HighPriorityCommonRules: Rule[]; - LowPriorityCommonRules: Rule[]; - SpaceAfterComma: Rule; - NoSpaceAfterComma: Rule; - SpaceBeforeBinaryOperator: Rule; - SpaceAfterBinaryOperator: Rule; - NoSpaceBeforeBinaryOperator: Rule; - NoSpaceAfterBinaryOperator: Rule; - SpaceAfterKeywordInControl: Rule; - NoSpaceAfterKeywordInControl: Rule; - FunctionOpenBraceLeftTokenRange: Shared.TokenRange; - SpaceBeforeOpenBraceInFunction: Rule; - NewLineBeforeOpenBraceInFunction: Rule; - TypeScriptOpenBraceLeftTokenRange: Shared.TokenRange; - SpaceBeforeOpenBraceInTypeScriptDeclWithBlock: Rule; - NewLineBeforeOpenBraceInTypeScriptDeclWithBlock: Rule; - ControlOpenBraceLeftTokenRange: Shared.TokenRange; - SpaceBeforeOpenBraceInControl: Rule; - NewLineBeforeOpenBraceInControl: Rule; - SpaceAfterSemicolonInFor: Rule; - NoSpaceAfterSemicolonInFor: Rule; - SpaceAfterOpenParen: Rule; - SpaceBeforeCloseParen: Rule; - NoSpaceBetweenParens: Rule; - NoSpaceAfterOpenParen: Rule; - NoSpaceBeforeCloseParen: Rule; - SpaceAfterOpenBracket: Rule; - SpaceBeforeCloseBracket: Rule; - NoSpaceBetweenBrackets: Rule; - NoSpaceAfterOpenBracket: Rule; - NoSpaceBeforeCloseBracket: Rule; - SpaceAfterAnonymousFunctionKeyword: Rule; - NoSpaceAfterAnonymousFunctionKeyword: Rule; - SpaceBeforeAt: Rule; - NoSpaceAfterAt: Rule; - SpaceAfterDecorator: Rule; - NoSpaceBetweenFunctionKeywordAndStar: Rule; - SpaceAfterStarInGeneratorDeclaration: Rule; - NoSpaceBetweenYieldKeywordAndStar: Rule; - SpaceBetweenYieldOrYieldStarAndOperand: Rule; - SpaceBetweenAsyncAndOpenParen: Rule; - SpaceBetweenAsyncAndFunctionKeyword: Rule; - NoSpaceBetweenTagAndTemplateString: Rule; - NoSpaceAfterTemplateHeadAndMiddle: Rule; - SpaceAfterTemplateHeadAndMiddle: Rule; - NoSpaceBeforeTemplateMiddleAndTail: Rule; - SpaceBeforeTemplateMiddleAndTail: Rule; - NoSpaceAfterOpenBraceInJsxExpression: Rule; - SpaceAfterOpenBraceInJsxExpression: Rule; - NoSpaceBeforeCloseBraceInJsxExpression: Rule; - SpaceBeforeCloseBraceInJsxExpression: Rule; - SpaceBeforeJsxAttribute: Rule; - SpaceBeforeSlashInJsxOpeningElement: Rule; - NoSpaceBeforeGreaterThanTokenInJsxOpeningElement: Rule; - NoSpaceBeforeEqualInJsxAttribute: Rule; - NoSpaceAfterEqualInJsxAttribute: Rule; - NoSpaceAfterTypeAssertion: Rule; - SpaceAfterTypeAssertion: Rule; - constructor(); - static IsForContext(context: FormattingContext): boolean; - static IsNotForContext(context: FormattingContext): boolean; - static IsBinaryOpContext(context: FormattingContext): boolean; - static IsNotBinaryOpContext(context: FormattingContext): boolean; - static IsConditionalOperatorContext(context: FormattingContext): boolean; - static IsSameLineTokenOrBeforeMultilineBlockContext(context: FormattingContext): boolean; - static IsBeforeMultilineBlockContext(context: FormattingContext): boolean; - static IsMultilineBlockContext(context: FormattingContext): boolean; - static IsSingleLineBlockContext(context: FormattingContext): boolean; - static IsBlockContext(context: FormattingContext): boolean; - static IsBeforeBlockContext(context: FormattingContext): boolean; - static NodeIsBlockContext(node: Node): boolean; - static IsFunctionDeclContext(context: FormattingContext): boolean; - static IsFunctionDeclarationOrFunctionExpressionContext(context: FormattingContext): boolean; - static IsTypeScriptDeclWithBlockContext(context: FormattingContext): boolean; - static NodeIsTypeScriptDeclWithBlockContext(node: Node): boolean; - static IsAfterCodeBlockContext(context: FormattingContext): boolean; - static IsControlDeclContext(context: FormattingContext): boolean; - static IsObjectContext(context: FormattingContext): boolean; - static IsFunctionCallContext(context: FormattingContext): boolean; - static IsNewContext(context: FormattingContext): boolean; - static IsFunctionCallOrNewContext(context: FormattingContext): boolean; - static IsPreviousTokenNotComma(context: FormattingContext): boolean; - static IsNextTokenNotCloseBracket(context: FormattingContext): boolean; - static IsArrowFunctionContext(context: FormattingContext): boolean; - static IsNonJsxSameLineTokenContext(context: FormattingContext): boolean; - static IsNonJsxElementContext(context: FormattingContext): boolean; - static IsJsxExpressionContext(context: FormattingContext): boolean; - static IsNextTokenParentJsxAttribute(context: FormattingContext): boolean; - static IsJsxAttributeContext(context: FormattingContext): boolean; - static IsJsxSelfClosingElementContext(context: FormattingContext): boolean; - static IsNotBeforeBlockInFunctionDeclarationContext(context: FormattingContext): boolean; - static IsEndOfDecoratorContextOnSameLine(context: FormattingContext): boolean; - static NodeIsInDecoratorContext(node: Node): boolean; - static IsStartOfVariableDeclarationList(context: FormattingContext): boolean; - static IsNotFormatOnEnter(context: FormattingContext): boolean; - static IsModuleDeclContext(context: FormattingContext): boolean; - static IsObjectTypeContext(context: FormattingContext): boolean; - static IsTypeArgumentOrParameterOrAssertion(token: TextRangeWithKind, parent: Node): boolean; - static IsTypeArgumentOrParameterOrAssertionContext(context: FormattingContext): boolean; - static IsTypeAssertionContext(context: FormattingContext): boolean; - static IsVoidOpContext(context: FormattingContext): boolean; - static IsYieldOrYieldStarWithOperand(context: FormattingContext): boolean; - } -} -declare namespace ts.formatting { - class RulesMap { - map: RulesBucket[]; - mapRowLength: number; - constructor(); - static create(rules: Rule[]): RulesMap; - Initialize(rules: Rule[]): RulesBucket[]; - FillRules(rules: Rule[], rulesBucketConstructionStateList: RulesBucketConstructionState[]): void; - private GetRuleBucketIndex(row, column); - private FillRule(rule, rulesBucketConstructionStateList); - GetRule(context: FormattingContext): Rule; - } - enum RulesPosition { - IgnoreRulesSpecific = 0, - IgnoreRulesAny, - ContextRulesSpecific, - ContextRulesAny, - NoContextRulesSpecific, - NoContextRulesAny, - } - class RulesBucketConstructionState { - private rulesInsertionIndexBitmap; - constructor(); - GetInsertionIndex(maskPosition: RulesPosition): number; - IncreaseInsertionIndex(maskPosition: RulesPosition): void; - } - class RulesBucket { - private rules; - constructor(); - Rules(): Rule[]; - AddRule(rule: Rule, specificTokens: boolean, constructionState: RulesBucketConstructionState[], rulesBucketIndex: number): void; - } -} -declare namespace ts.formatting { - namespace Shared { - interface ITokenAccess { - GetTokens(): SyntaxKind[]; - Contains(token: SyntaxKind): boolean; - } - class TokenRangeAccess implements ITokenAccess { - private tokens; - constructor(from: SyntaxKind, to: SyntaxKind, except: SyntaxKind[]); - GetTokens(): SyntaxKind[]; - Contains(token: SyntaxKind): boolean; - } - class TokenValuesAccess implements ITokenAccess { - private tokens; - constructor(tks: SyntaxKind[]); - GetTokens(): SyntaxKind[]; - Contains(token: SyntaxKind): boolean; - } - class TokenSingleValueAccess implements ITokenAccess { - token: SyntaxKind; - constructor(token: SyntaxKind); - GetTokens(): SyntaxKind[]; - Contains(tokenValue: SyntaxKind): boolean; - } - class TokenAllAccess implements ITokenAccess { - GetTokens(): SyntaxKind[]; - Contains(): boolean; - toString(): string; - } - class TokenRange { - tokenAccess: ITokenAccess; - constructor(tokenAccess: ITokenAccess); - static FromToken(token: SyntaxKind): TokenRange; - static FromTokens(tokens: SyntaxKind[]): TokenRange; - static FromRange(f: SyntaxKind, to: SyntaxKind, except?: SyntaxKind[]): TokenRange; - static AllTokens(): TokenRange; - GetTokens(): SyntaxKind[]; - Contains(token: SyntaxKind): boolean; - toString(): string; - static Any: TokenRange; - static AnyIncludingMultilineComments: TokenRange; - static Keywords: TokenRange; - static BinaryOperators: TokenRange; - static BinaryKeywordOperators: TokenRange; - static UnaryPrefixOperators: TokenRange; - static UnaryPrefixExpressions: TokenRange; - static UnaryPreincrementExpressions: TokenRange; - static UnaryPostincrementExpressions: TokenRange; - static UnaryPredecrementExpressions: TokenRange; - static UnaryPostdecrementExpressions: TokenRange; - static Comments: TokenRange; - static TypeNames: TokenRange; - } - } -} -declare namespace ts.formatting { - class RulesProvider { - private globalRules; - private options; - private activeRules; - private rulesMap; - constructor(); - getRuleName(rule: Rule): string; - getRuleByName(name: string): Rule; - getRulesMap(): RulesMap; - ensureUpToDate(options: ts.FormatCodeSettings): void; - private createActiveRules(options); - } -} -declare namespace ts.formatting { - interface TextRangeWithKind extends TextRange { - kind: SyntaxKind; - } - interface TokenInfo { - leadingTrivia: TextRangeWithKind[]; - token: TextRangeWithKind; - trailingTrivia: TextRangeWithKind[]; - } - function formatOnEnter(position: number, sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeSettings): TextChange[]; - function formatOnSemicolon(position: number, sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeSettings): TextChange[]; - function formatOnClosingCurly(position: number, sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeSettings): TextChange[]; - function formatDocument(sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeSettings): TextChange[]; - function formatSelection(start: number, end: number, sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeSettings): TextChange[]; - function getIndentationString(indentation: number, options: EditorSettings): string; -} -declare namespace ts.formatting { - namespace SmartIndenter { - function getIndentation(position: number, sourceFile: SourceFile, options: EditorSettings): number; - function getIndentationForNode(n: Node, ignoreActualIndentationRange: TextRange, sourceFile: SourceFile, options: EditorSettings): number; - function getBaseIndentation(options: EditorSettings): number; - function childStartsOnTheSameLineWithElseInIfStatement(parent: Node, child: TextRangeWithKind, childStartLine: number, sourceFile: SourceFile): boolean; - function findFirstNonWhitespaceCharacterAndColumn(startPos: number, endPos: number, sourceFile: SourceFile, options: EditorSettings): { - column: number; - character: number; - }; - function findFirstNonWhitespaceColumn(startPos: number, endPos: number, sourceFile: SourceFile, options: EditorSettings): number; - function nodeWillIndentChild(parent: TextRangeWithKind, child: TextRangeWithKind, indentByDefault: boolean): boolean; - function shouldIndentChildNode(parent: TextRangeWithKind, child?: TextRangeWithKind): boolean; - } -} -declare namespace ts { - interface CodeFix { - errorCodes: number[]; - getCodeActions(context: CodeFixContext): CodeAction[] | undefined; - } - interface CodeFixContext { - errorCode: number; - sourceFile: SourceFile; - span: TextSpan; - program: Program; - newLineCharacter: string; - host: LanguageServiceHost; - cancellationToken: CancellationToken; - } - namespace codefix { - function registerCodeFix(action: CodeFix): void; - function getSupportedErrorCodes(): string[]; - function getFixes(context: CodeFixContext): CodeAction[]; - } -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} declare namespace ts { const servicesVersion = "0.5"; interface DisplayPartsSymbolWriter extends SymbolWriter { displayParts(): SymbolDisplayPart[]; } - function toEditorSettings(options: FormatCodeOptions | FormatCodeSettings): FormatCodeSettings; function toEditorSettings(options: EditorOptions | EditorSettings): EditorSettings; function displayPartsToString(displayParts: SymbolDisplayPart[]): string; function getDefaultCompilerOptions(): CompilerOptions; @@ -10918,387 +3383,1012 @@ declare namespace ts { let disableIncrementalParsing: boolean; function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; - function getNameTable(sourceFile: SourceFile): Map; function getDefaultLibFilePath(options: CompilerOptions): string; } declare namespace ts.server { - class ScriptInfo { + interface CompressedData { + length: number; + compressionKind: string; + data: any; + } + type RequireResult = { + module: {}; + error: undefined; + } | { + module: undefined; + error: {}; + }; + interface ServerHost extends System { + setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): any; + clearTimeout(timeoutId: any): void; + setImmediate(callback: (...args: any[]) => void, ...args: any[]): any; + clearImmediate(timeoutId: any): void; + gc?(): void; + trace?(s: string): void; + require?(initialPath: string, moduleName: string): RequireResult; + } + interface SortedReadonlyArray extends ReadonlyArray { + " __sortedReadonlyArrayBrand": any; + } + interface TypingInstallerRequest { + readonly projectName: string; + readonly kind: "discover" | "closeProject"; + } + interface DiscoverTypings extends TypingInstallerRequest { + readonly fileNames: string[]; + readonly projectRootPath: ts.Path; + readonly compilerOptions: ts.CompilerOptions; + readonly typeAcquisition: ts.TypeAcquisition; + readonly unresolvedImports: SortedReadonlyArray; + readonly cachePath?: string; + readonly kind: "discover"; + } + interface CloseProject extends TypingInstallerRequest { + readonly kind: "closeProject"; + } + type ActionSet = "action::set"; + type ActionInvalidate = "action::invalidate"; + type EventBeginInstallTypes = "event::beginInstallTypes"; + type EventEndInstallTypes = "event::endInstallTypes"; + type EventInitializationFailed = "event::initializationFailed"; + interface TypingInstallerResponse { + readonly kind: ActionSet | ActionInvalidate | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed; + } + interface InitializationFailedResponse extends TypingInstallerResponse { + readonly kind: EventInitializationFailed; + readonly message: string; + } + interface ProjectResponse extends TypingInstallerResponse { + readonly projectName: string; + } + interface SetTypings extends ProjectResponse { + readonly typeAcquisition: ts.TypeAcquisition; + readonly compilerOptions: ts.CompilerOptions; + readonly typings: string[]; + readonly unresolvedImports: SortedReadonlyArray; + readonly kind: ActionSet; + } + interface InvalidateCachedTypings extends ProjectResponse { + readonly kind: ActionInvalidate; + } + interface InstallTypes extends ProjectResponse { + readonly kind: EventBeginInstallTypes | EventEndInstallTypes; + readonly eventId: number; + readonly typingsInstallerVersion: string; + readonly packagesToInstall: ReadonlyArray; + } + interface BeginInstallTypes extends InstallTypes { + readonly kind: EventBeginInstallTypes; + } + interface EndInstallTypes extends InstallTypes { + readonly kind: EventEndInstallTypes; + readonly installSuccess: boolean; + } +} +declare namespace ts.server { + const ActionSet: ActionSet; + const ActionInvalidate: ActionInvalidate; + const EventBeginInstallTypes: EventBeginInstallTypes; + const EventEndInstallTypes: EventEndInstallTypes; + const EventInitializationFailed: EventInitializationFailed; + namespace Arguments { + const GlobalCacheLocation = "--globalTypingsCacheLocation"; + const LogFile = "--logFile"; + const EnableTelemetry = "--enableTelemetry"; + const TypingSafeListLocation = "--typingSafeListLocation"; + } + function hasArgument(argumentName: string): boolean; + function findArgument(argumentName: string): string; +} +declare namespace ts.server { + enum LogLevel { + terse = 0, + normal = 1, + requestTime = 2, + verbose = 3, + } + const emptyArray: ReadonlyArray; + interface Logger { + close(): void; + hasLevel(level: LogLevel): boolean; + loggingEnabled(): boolean; + perftrc(s: string): void; + info(s: string): void; + startGroup(): void; + endGroup(): void; + msg(s: string, type?: Msg.Types): void; + getLogFileName(): string; + } + namespace Msg { + type Err = "Err"; + const Err: Err; + type Info = "Info"; + const Info: Info; + type Perf = "Perf"; + const Perf: Perf; + type Types = Err | Info | Perf; + } + function createInstallTypingsRequest(project: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray, cachePath?: string): DiscoverTypings; + namespace Errors { + function ThrowNoProject(): never; + function ThrowProjectLanguageServiceDisabled(): never; + function ThrowProjectDoesNotContainDocument(fileName: string, project: Project): never; + } + function getDefaultFormatCodeSettings(host: ServerHost): FormatCodeSettings; + function mergeMapLikes(target: MapLike, source: MapLike): void; + function removeItemFromSet(items: T[], itemToRemove: T): void; + type NormalizedPath = string & { + __normalizedPathTag: any; + }; + function toNormalizedPath(fileName: string): NormalizedPath; + function normalizedPathToPath(normalizedPath: NormalizedPath, currentDirectory: string, getCanonicalFileName: (f: string) => string): Path; + function asNormalizedPath(fileName: string): NormalizedPath; + interface NormalizedPathMap { + get(path: NormalizedPath): T; + set(path: NormalizedPath, value: T): void; + contains(path: NormalizedPath): boolean; + remove(path: NormalizedPath): void; + } + function createNormalizedPathMap(): NormalizedPathMap; + interface ProjectOptions { + configHasFilesProperty?: boolean; + files?: string[]; + wildcardDirectories?: Map; + compilerOptions?: CompilerOptions; + typeAcquisition?: TypeAcquisition; + compileOnSave?: boolean; + } + function isInferredProjectName(name: string): boolean; + function makeInferredProjectName(counter: number): string; + function toSortedReadonlyArray(arr: string[]): SortedReadonlyArray; + class ThrottledOperations { private readonly host; - readonly fileName: NormalizedPath; - readonly scriptKind: ScriptKind; - isOpen: boolean; - hasMixedContent: boolean; - readonly containingProjects: Project[]; - private formatCodeSettings; - readonly path: Path; - private fileWatcher; - private svc; - constructor(host: ServerHost, fileName: NormalizedPath, content: string, scriptKind: ScriptKind, isOpen?: boolean, hasMixedContent?: boolean); - getFormatCodeSettings(): FormatCodeSettings; - attachToProject(project: Project): boolean; - isAttached(project: Project): boolean; - detachFromProject(project: Project): void; - detachAllProjects(): void; - getDefaultProject(): Project; - setFormatOptions(formatSettings: FormatCodeSettings): void; - setWatcher(watcher: FileWatcher): void; - stopWatcher(): void; - getLatestVersion(): string; - reload(script: string): void; - saveTo(fileName: string): void; - reloadFromFile(tempFileName?: NormalizedPath): void; - snap(): LineIndexSnapshot; - getLineInfo(line: number): ILineInfo; - editContent(start: number, end: number, newText: string): void; - markContainingProjectsAsDirty(): void; - lineToTextSpan(line: number): TextSpan; - lineOffsetToPosition(line: number, offset: number): number; - positionToLineOffset(position: number): ILineInfo; + private pendingTimeouts; + constructor(host: ServerHost); + schedule(operationId: string, delay: number, cb: () => void): void; + private static run(self, operationId, cb); } -} -declare namespace ts.server { - class LSHost implements ts.LanguageServiceHost, ModuleResolutionHost { + class GcTimer { private readonly host; - private readonly project; - private readonly cancellationToken; - private compilationSettings; - private readonly resolvedModuleNames; - private readonly resolvedTypeReferenceDirectives; - private readonly getCanonicalFileName; - private filesWithChangedSetOfUnresolvedImports; - private readonly resolveModuleName; - readonly trace: (s: string) => void; - readonly realpath?: (path: string) => string; - constructor(host: ServerHost, project: Project, cancellationToken: HostCancellationToken); - startRecordingFilesWithChangedResolutions(): void; - finishRecordingFilesWithChangedResolutions(): Path[]; - private resolveNamesWithLocalCache(names, containingFile, cache, loader, getResult, getResultFileName, logChanges); - getProjectVersion(): string; - getCompilationSettings(): CompilerOptions; - useCaseSensitiveFileNames(): boolean; - getCancellationToken(): HostCancellationToken; - resolveTypeReferenceDirectives(typeDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[]; - resolveModuleNames(moduleNames: string[], containingFile: string): ResolvedModuleFull[]; - getDefaultLibFileName(): string; - getScriptSnapshot(filename: string): ts.IScriptSnapshot; - getScriptFileNames(): string[]; - getTypeRootsVersion(): number; - getScriptKind(fileName: string): ScriptKind; - getScriptVersion(filename: string): string; - getCurrentDirectory(): string; - resolvePath(path: string): string; - fileExists(path: string): boolean; - readFile(fileName: string): string; - directoryExists(path: string): boolean; - readDirectory(path: string, extensions?: string[], exclude?: string[], include?: string[]): string[]; - getDirectories(path: string): string[]; - notifyFileRemoved(info: ScriptInfo): void; - setCompilationSettings(opt: ts.CompilerOptions): void; + private readonly delay; + private readonly logger; + private timerId; + constructor(host: ServerHost, delay: number, logger: Logger); + scheduleCollect(): void; + private static run(self); } } -declare namespace ts.server { - interface ITypingsInstaller { - enqueueInstallTypingsRequest(p: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray): void; - attach(projectService: ProjectService): void; - onProjectClosed(p: Project): void; - readonly globalTypingsCacheLocation: string; +declare namespace ts.server.protocol { + namespace CommandTypes { + type Brace = "brace"; + type BraceCompletion = "braceCompletion"; + type Change = "change"; + type Close = "close"; + type Completions = "completions"; + type CompletionDetails = "completionEntryDetails"; + type CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList"; + type CompileOnSaveEmitFile = "compileOnSaveEmitFile"; + type Configure = "configure"; + type Definition = "definition"; + type Implementation = "implementation"; + type Exit = "exit"; + type Format = "format"; + type Formatonkey = "formatonkey"; + type Geterr = "geterr"; + type GeterrForProject = "geterrForProject"; + type SemanticDiagnosticsSync = "semanticDiagnosticsSync"; + type SyntacticDiagnosticsSync = "syntacticDiagnosticsSync"; + type NavBar = "navbar"; + type Navto = "navto"; + type NavTree = "navtree"; + type NavTreeFull = "navtree-full"; + type Occurrences = "occurrences"; + type DocumentHighlights = "documentHighlights"; + type Open = "open"; + type Quickinfo = "quickinfo"; + type References = "references"; + type Reload = "reload"; + type Rename = "rename"; + type Saveto = "saveto"; + type SignatureHelp = "signatureHelp"; + type TypeDefinition = "typeDefinition"; + type ProjectInfo = "projectInfo"; + type ReloadProjects = "reloadProjects"; + type Unknown = "unknown"; + type OpenExternalProject = "openExternalProject"; + type OpenExternalProjects = "openExternalProjects"; + type CloseExternalProject = "closeExternalProject"; + type TodoComments = "todoComments"; + type Indentation = "indentation"; + type DocCommentTemplate = "docCommentTemplate"; + type CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects"; + type GetCodeFixes = "getCodeFixes"; + type GetSupportedCodeFixes = "getSupportedCodeFixes"; } - const nullTypingsInstaller: ITypingsInstaller; - class TypingsCache { - private readonly installer; - private readonly perProjectCache; - constructor(installer: ITypingsInstaller); - getTypingsForProject(project: Project, unresolvedImports: SortedReadonlyArray, forceRefresh: boolean): SortedReadonlyArray; - updateTypingsForProject(projectName: string, compilerOptions: CompilerOptions, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray, newTypings: string[]): void; - deleteTypingsForProject(projectName: string): void; - onProjectClosed(project: Project): void; + interface Message { + seq: number; + type: "request" | "response" | "event"; } -} -declare namespace ts.server { - function shouldEmitFile(scriptInfo: ScriptInfo): boolean; - class BuilderFileInfo { - readonly scriptInfo: ScriptInfo; - readonly project: Project; - private lastCheckedShapeSignature; - constructor(scriptInfo: ScriptInfo, project: Project); - isExternalModuleOrHasOnlyAmbientExternalModules(): boolean; - private containsOnlyAmbientModules(sourceFile); - private computeHash(text); - private getSourceFile(); - updateShapeSignature(): boolean; + interface Request extends Message { + command: string; + arguments?: any; } - interface Builder { - readonly project: Project; - getFilesAffectedBy(scriptInfo: ScriptInfo): string[]; - onProjectUpdateGraph(): void; - emitFile(scriptInfo: ScriptInfo, writeFile: (path: string, data: string, writeByteOrderMark?: boolean) => void): boolean; + interface ReloadProjectsRequest extends Message { + command: CommandTypes.ReloadProjects; } - function createBuilder(project: Project): Builder; -} -declare namespace ts.server { - enum ProjectKind { - Inferred = 0, - Configured = 1, - External = 2, + interface Event extends Message { + event: string; + body?: any; } - function allRootFilesAreJsOrDts(project: Project): boolean; - function allFilesAreJsOrDts(project: Project): boolean; - interface ProjectFilesWithTSDiagnostics extends protocol.ProjectFiles { - projectErrors: Diagnostic[]; + interface Response extends Message { + request_seq: number; + success: boolean; + command: string; + message?: string; + body?: any; } - class UnresolvedImportsMap { - readonly perFileMap: FileMap>; - private version; - clear(): void; - getVersion(): number; - remove(path: Path): void; - get(path: Path): ReadonlyArray; - set(path: Path, value: ReadonlyArray): void; + interface FileRequestArgs { + file: string; + projectFileName?: string; } - function createNoSemanticFeaturesWrapper(realLanguageService: LanguageService): LanguageService; - abstract class Project { - private readonly projectName; - readonly projectKind: ProjectKind; - readonly projectService: ProjectService; - private documentRegistry; - private compilerOptions; - compileOnSaveEnabled: boolean; - private rootFiles; - private rootFilesMap; - private lsHost; - private program; - private cachedUnresolvedImportsPerFile; - private lastCachedUnresolvedImportsList; - private readonly languageService; - private readonly noSemanticFeaturesLanguageService; + interface DocCommentTemplateRequest extends FileLocationRequest { + command: CommandTypes.DocCommentTemplate; + } + interface DocCommandTemplateResponse extends Response { + body?: TextInsertion; + } + interface TodoCommentRequest extends FileRequest { + command: CommandTypes.TodoComments; + arguments: TodoCommentRequestArgs; + } + interface TodoCommentRequestArgs extends FileRequestArgs { + descriptors: TodoCommentDescriptor[]; + } + interface TodoCommentsResponse extends Response { + body?: TodoComment[]; + } + interface IndentationRequest extends FileLocationRequest { + command: CommandTypes.Indentation; + arguments: IndentationRequestArgs; + } + interface IndentationResponse extends Response { + body?: IndentationResult; + } + interface IndentationResult { + position: number; + indentation: number; + } + interface IndentationRequestArgs extends FileLocationRequestArgs { + options?: EditorSettings; + } + interface ProjectInfoRequestArgs extends FileRequestArgs { + needFileNameList: boolean; + } + interface ProjectInfoRequest extends Request { + command: CommandTypes.ProjectInfo; + arguments: ProjectInfoRequestArgs; + } + interface CompilerOptionsDiagnosticsRequest extends Request { + arguments: CompilerOptionsDiagnosticsRequestArgs; + } + interface CompilerOptionsDiagnosticsRequestArgs { + projectFileName: string; + } + interface ProjectInfo { + configFileName: string; + fileNames?: string[]; + languageServiceDisabled?: boolean; + } + interface DiagnosticWithLinePosition { + message: string; + start: number; + length: number; + startLocation: Location; + endLocation: Location; + category: string; + code: number; + } + interface ProjectInfoResponse extends Response { + body?: ProjectInfo; + } + interface FileRequest extends Request { + arguments: FileRequestArgs; + } + interface FileLocationRequestArgs extends FileRequestArgs { + line: number; + offset: number; + } + interface CodeFixRequest extends Request { + command: CommandTypes.GetCodeFixes; + arguments: CodeFixRequestArgs; + } + interface CodeFixRequestArgs extends FileRequestArgs { + startLine: number; + startOffset: number; + endLine: number; + endOffset: number; + errorCodes?: number[]; + } + interface GetCodeFixesResponse extends Response { + body?: CodeAction[]; + } + interface FileLocationRequest extends FileRequest { + arguments: FileLocationRequestArgs; + } + interface GetSupportedCodeFixesRequest extends Request { + command: CommandTypes.GetSupportedCodeFixes; + } + interface GetSupportedCodeFixesResponse extends Response { + body?: string[]; + } + interface EncodedSemanticClassificationsRequestArgs extends FileRequestArgs { + start: number; + length: number; + } + interface DocumentHighlightsRequestArgs extends FileLocationRequestArgs { + filesToSearch: string[]; + } + interface DefinitionRequest extends FileLocationRequest { + command: CommandTypes.Definition; + } + interface TypeDefinitionRequest extends FileLocationRequest { + command: CommandTypes.TypeDefinition; + } + interface ImplementationRequest extends FileLocationRequest { + command: CommandTypes.Implementation; + } + interface Location { + line: number; + offset: number; + } + interface TextSpan { + start: Location; + end: Location; + } + interface FileSpan extends TextSpan { + file: string; + } + interface DefinitionResponse extends Response { + body?: FileSpan[]; + } + interface TypeDefinitionResponse extends Response { + body?: FileSpan[]; + } + interface ImplementationResponse extends Response { + body?: FileSpan[]; + } + interface BraceCompletionRequest extends FileLocationRequest { + command: CommandTypes.BraceCompletion; + arguments: BraceCompletionRequestArgs; + } + interface BraceCompletionRequestArgs extends FileLocationRequestArgs { + openingBrace: string; + } + interface OccurrencesRequest extends FileLocationRequest { + command: CommandTypes.Occurrences; + } + interface OccurrencesResponseItem extends FileSpan { + isWriteAccess: boolean; + isInString?: true; + } + interface OccurrencesResponse extends Response { + body?: OccurrencesResponseItem[]; + } + interface DocumentHighlightsRequest extends FileLocationRequest { + command: CommandTypes.DocumentHighlights; + arguments: DocumentHighlightsRequestArgs; + } + interface HighlightSpan extends TextSpan { + kind: string; + } + interface DocumentHighlightsItem { + file: string; + highlightSpans: HighlightSpan[]; + } + interface DocumentHighlightsResponse extends Response { + body?: DocumentHighlightsItem[]; + } + interface ReferencesRequest extends FileLocationRequest { + command: CommandTypes.References; + } + interface ReferencesResponseItem extends FileSpan { + lineText: string; + isWriteAccess: boolean; + isDefinition: boolean; + } + interface ReferencesResponseBody { + refs: ReferencesResponseItem[]; + symbolName: string; + symbolStartOffset: number; + symbolDisplayString: string; + } + interface ReferencesResponse extends Response { + body?: ReferencesResponseBody; + } + interface RenameRequestArgs extends FileLocationRequestArgs { + findInComments?: boolean; + findInStrings?: boolean; + } + interface RenameRequest extends FileLocationRequest { + command: CommandTypes.Rename; + arguments: RenameRequestArgs; + } + interface RenameInfo { + canRename: boolean; + localizedErrorMessage?: string; + displayName: string; + fullDisplayName: string; + kind: string; + kindModifiers: string; + } + interface SpanGroup { + file: string; + locs: TextSpan[]; + } + interface RenameResponseBody { + info: RenameInfo; + locs: SpanGroup[]; + } + interface RenameResponse extends Response { + body?: RenameResponseBody; + } + interface ExternalFile { + fileName: string; + scriptKind?: ScriptKindName | ts.ScriptKind; + hasMixedContent?: boolean; + content?: string; + } + interface ExternalProject { + projectFileName: string; + rootFiles: ExternalFile[]; + options: ExternalProjectCompilerOptions; + typingOptions?: TypeAcquisition; + typeAcquisition?: TypeAcquisition; + } + interface CompileOnSaveMixin { + compileOnSave?: boolean; + } + type ExternalProjectCompilerOptions = CompilerOptions & CompileOnSaveMixin; + interface ProjectChanges { + added: string[]; + removed: string[]; + updated: string[]; + } + interface ConfigureRequestArguments { + hostInfo?: string; + file?: string; + formatOptions?: FormatCodeSettings; + extraFileExtensions?: JsFileExtensionInfo[]; + } + interface ConfigureRequest extends Request { + command: CommandTypes.Configure; + arguments: ConfigureRequestArguments; + } + interface ConfigureResponse extends Response { + } + interface OpenRequestArgs extends FileRequestArgs { + fileContent?: string; + scriptKindName?: ScriptKindName; + } + type ScriptKindName = "TS" | "JS" | "TSX" | "JSX"; + interface OpenRequest extends Request { + command: CommandTypes.Open; + arguments: OpenRequestArgs; + } + interface OpenExternalProjectRequest extends Request { + command: CommandTypes.OpenExternalProject; + arguments: OpenExternalProjectArgs; + } + type OpenExternalProjectArgs = ExternalProject; + interface OpenExternalProjectsRequest extends Request { + command: CommandTypes.OpenExternalProjects; + arguments: OpenExternalProjectsArgs; + } + interface OpenExternalProjectsArgs { + projects: ExternalProject[]; + } + interface OpenExternalProjectResponse extends Response { + } + interface OpenExternalProjectsResponse extends Response { + } + interface CloseExternalProjectRequest extends Request { + command: CommandTypes.CloseExternalProject; + arguments: CloseExternalProjectRequestArgs; + } + interface CloseExternalProjectRequestArgs { + projectFileName: string; + } + interface CloseExternalProjectResponse extends Response { + } + interface SetCompilerOptionsForInferredProjectsRequest extends Request { + command: CommandTypes.CompilerOptionsForInferredProjects; + arguments: SetCompilerOptionsForInferredProjectsArgs; + } + interface SetCompilerOptionsForInferredProjectsArgs { + options: ExternalProjectCompilerOptions; + } + interface SetCompilerOptionsForInferredProjectsResponse extends Response { + } + interface ExitRequest extends Request { + command: CommandTypes.Exit; + } + interface CloseRequest extends FileRequest { + command: CommandTypes.Close; + } + interface CompileOnSaveAffectedFileListRequest extends FileRequest { + command: CommandTypes.CompileOnSaveAffectedFileList; + } + interface CompileOnSaveAffectedFileListSingleProject { + projectFileName: string; + fileNames: string[]; + projectUsesOutFile: boolean; + } + interface CompileOnSaveAffectedFileListResponse extends Response { + body: CompileOnSaveAffectedFileListSingleProject[]; + } + interface CompileOnSaveEmitFileRequest extends FileRequest { + command: CommandTypes.CompileOnSaveEmitFile; + arguments: CompileOnSaveEmitFileRequestArgs; + } + interface CompileOnSaveEmitFileRequestArgs extends FileRequestArgs { + forced?: boolean; + } + interface QuickInfoRequest extends FileLocationRequest { + command: CommandTypes.Quickinfo; + } + interface QuickInfoResponseBody { + kind: string; + kindModifiers: string; + start: Location; + end: Location; + displayString: string; + documentation: string; + tags: JSDocTagInfo[]; + } + interface QuickInfoResponse extends Response { + body?: QuickInfoResponseBody; + } + interface FormatRequestArgs extends FileLocationRequestArgs { + endLine: number; + endOffset: number; + options?: FormatCodeSettings; + } + interface FormatRequest extends FileLocationRequest { + command: CommandTypes.Format; + arguments: FormatRequestArgs; + } + interface CodeEdit { + start: Location; + end: Location; + newText: string; + } + interface FileCodeEdits { + fileName: string; + textChanges: CodeEdit[]; + } + interface CodeFixResponse extends Response { + body?: CodeAction[]; + } + interface CodeAction { + description: string; + changes: FileCodeEdits[]; + } + interface FormatResponse extends Response { + body?: CodeEdit[]; + } + interface FormatOnKeyRequestArgs extends FileLocationRequestArgs { + key: string; + options?: FormatCodeSettings; + } + interface FormatOnKeyRequest extends FileLocationRequest { + command: CommandTypes.Formatonkey; + arguments: FormatOnKeyRequestArgs; + } + interface CompletionsRequestArgs extends FileLocationRequestArgs { + prefix?: string; + } + interface CompletionsRequest extends FileLocationRequest { + command: CommandTypes.Completions; + arguments: CompletionsRequestArgs; + } + interface CompletionDetailsRequestArgs extends FileLocationRequestArgs { + entryNames: string[]; + } + interface CompletionDetailsRequest extends FileLocationRequest { + command: CommandTypes.CompletionDetails; + arguments: CompletionDetailsRequestArgs; + } + interface SymbolDisplayPart { + text: string; + kind: string; + } + interface CompletionEntry { + name: string; + kind: string; + kindModifiers: string; + sortText: string; + replacementSpan?: TextSpan; + } + interface CompletionEntryDetails { + name: string; + kind: string; + kindModifiers: string; + displayParts: SymbolDisplayPart[]; + documentation: SymbolDisplayPart[]; + tags: JSDocTagInfo[]; + } + interface CompletionsResponse extends Response { + body?: CompletionEntry[]; + } + interface CompletionDetailsResponse extends Response { + body?: CompletionEntryDetails[]; + } + interface SignatureHelpParameter { + name: string; + documentation: SymbolDisplayPart[]; + displayParts: SymbolDisplayPart[]; + isOptional: boolean; + } + interface SignatureHelpItem { + isVariadic: boolean; + prefixDisplayParts: SymbolDisplayPart[]; + suffixDisplayParts: SymbolDisplayPart[]; + separatorDisplayParts: SymbolDisplayPart[]; + parameters: SignatureHelpParameter[]; + documentation: SymbolDisplayPart[]; + tags: JSDocTagInfo[]; + } + interface SignatureHelpItems { + items: SignatureHelpItem[]; + applicableSpan: TextSpan; + selectedItemIndex: number; + argumentIndex: number; + argumentCount: number; + } + interface SignatureHelpRequestArgs extends FileLocationRequestArgs { + } + interface SignatureHelpRequest extends FileLocationRequest { + command: CommandTypes.SignatureHelp; + arguments: SignatureHelpRequestArgs; + } + interface SignatureHelpResponse extends Response { + body?: SignatureHelpItems; + } + interface SemanticDiagnosticsSyncRequest extends FileRequest { + command: CommandTypes.SemanticDiagnosticsSync; + arguments: SemanticDiagnosticsSyncRequestArgs; + } + interface SemanticDiagnosticsSyncRequestArgs extends FileRequestArgs { + includeLinePosition?: boolean; + } + interface SemanticDiagnosticsSyncResponse extends Response { + body?: Diagnostic[] | DiagnosticWithLinePosition[]; + } + interface SyntacticDiagnosticsSyncRequest extends FileRequest { + command: CommandTypes.SyntacticDiagnosticsSync; + arguments: SyntacticDiagnosticsSyncRequestArgs; + } + interface SyntacticDiagnosticsSyncRequestArgs extends FileRequestArgs { + includeLinePosition?: boolean; + } + interface SyntacticDiagnosticsSyncResponse extends Response { + body?: Diagnostic[] | DiagnosticWithLinePosition[]; + } + interface GeterrForProjectRequestArgs { + file: string; + delay: number; + } + interface GeterrForProjectRequest extends Request { + command: CommandTypes.GeterrForProject; + arguments: GeterrForProjectRequestArgs; + } + interface GeterrRequestArgs { + files: string[]; + delay: number; + } + interface GeterrRequest extends Request { + command: CommandTypes.Geterr; + arguments: GeterrRequestArgs; + } + type RequestCompletedEventName = "requestCompleted"; + interface RequestCompletedEvent extends Event { + event: RequestCompletedEventName; + body: RequestCompletedEventBody; + } + interface RequestCompletedEventBody { + request_seq: number; + } + interface Diagnostic { + start: Location; + end: Location; + text: string; + code?: number; + } + interface DiagnosticEventBody { + file: string; + diagnostics: Diagnostic[]; + } + interface DiagnosticEvent extends Event { + body?: DiagnosticEventBody; + } + interface ConfigFileDiagnosticEventBody { + triggerFile: string; + configFile: string; + diagnostics: Diagnostic[]; + } + interface ConfigFileDiagnosticEvent extends Event { + body?: ConfigFileDiagnosticEventBody; + event: "configFileDiag"; + } + type ProjectLanguageServiceStateEventName = "projectLanguageServiceState"; + interface ProjectLanguageServiceStateEvent extends Event { + event: ProjectLanguageServiceStateEventName; + body?: ProjectLanguageServiceStateEventBody; + } + interface ProjectLanguageServiceStateEventBody { + projectName: string; languageServiceEnabled: boolean; - builder: Builder; - private lastReportedFileNames; - private lastReportedVersion; - private projectStructureVersion; - private projectStateVersion; - private typingFiles; - protected projectErrors: Diagnostic[]; - typesVersion: number; - isNonTsProject(): boolean; - isJsOnlyProject(): boolean; - getCachedUnresolvedImportsPerFile_TestOnly(): UnresolvedImportsMap; - constructor(projectName: string, projectKind: ProjectKind, projectService: ProjectService, documentRegistry: ts.DocumentRegistry, hasExplicitListOfFiles: boolean, languageServiceEnabled: boolean, compilerOptions: CompilerOptions, compileOnSaveEnabled: boolean); - getProjectErrors(): Diagnostic[]; - getLanguageService(ensureSynchronized?: boolean): LanguageService; - getCompileOnSaveAffectedFileList(scriptInfo: ScriptInfo): string[]; - getProjectVersion(): string; - enableLanguageService(): void; - disableLanguageService(): void; - getProjectName(): string; - abstract getProjectRootPath(): string | undefined; - abstract getTypeAcquisition(): TypeAcquisition; - getSourceFile(path: Path): SourceFile; - updateTypes(): void; - close(): void; - getCompilerOptions(): CompilerOptions; - hasRoots(): boolean; - getRootFiles(): NormalizedPath[]; - getRootFilesLSHost(): string[]; - getRootScriptInfos(): ScriptInfo[]; - getScriptInfos(): ScriptInfo[]; - getFileEmitOutput(info: ScriptInfo, emitOnlyDtsFiles: boolean): EmitOutput; - getFileNames(excludeFilesFromExternalLibraries?: boolean): NormalizedPath[]; - getAllEmittableFiles(): string[]; - containsScriptInfo(info: ScriptInfo): boolean; - containsFile(filename: NormalizedPath, requireOpen?: boolean): boolean; - isRoot(info: ScriptInfo): boolean; - addRoot(info: ScriptInfo): void; - removeFile(info: ScriptInfo, detachFromProject?: boolean): void; - markAsDirty(): void; - private extractUnresolvedImportsFromSourceFile(file, result); - updateGraph(): boolean; - private setTypings(typings); - private updateGraphWorker(); - getScriptInfoLSHost(fileName: string): ScriptInfo; - getScriptInfoForNormalizedPath(fileName: NormalizedPath): ScriptInfo; - getScriptInfo(uncheckedFileName: string): ScriptInfo; - filesToString(): string; - setCompilerOptions(compilerOptions: CompilerOptions): void; - reloadScript(filename: NormalizedPath, tempFileName?: NormalizedPath): boolean; - getChangesSinceVersion(lastKnownVersion?: number): ProjectFilesWithTSDiagnostics; - getReferencedFiles(path: Path): Path[]; - private removeRootFileIfNecessary(info); } - class InferredProject extends Project { - private static newName; - directoriesWatchedForTsconfig: string[]; - constructor(projectService: ProjectService, documentRegistry: ts.DocumentRegistry, compilerOptions: CompilerOptions); - getProjectRootPath(): string; - close(): void; - getTypeAcquisition(): TypeAcquisition; + interface ReloadRequestArgs extends FileRequestArgs { + tmpfile: string; } - class ConfiguredProject extends Project { - private wildcardDirectories; - compileOnSaveEnabled: boolean; - private typeAcquisition; - private projectFileWatcher; - private directoryWatcher; - private directoriesWatchedForWildcards; - private typeRootsWatchers; - readonly canonicalConfigFilePath: NormalizedPath; - openRefCount: number; - constructor(configFileName: NormalizedPath, projectService: ProjectService, documentRegistry: ts.DocumentRegistry, hasExplicitListOfFiles: boolean, compilerOptions: CompilerOptions, wildcardDirectories: Map, languageServiceEnabled: boolean, compileOnSaveEnabled: boolean); - getConfigFilePath(): string; - getProjectRootPath(): string; - setProjectErrors(projectErrors: Diagnostic[]): void; - setTypeAcquisition(newTypeAcquisition: TypeAcquisition): void; - getTypeAcquisition(): TypeAcquisition; - watchConfigFile(callback: (project: ConfiguredProject) => void): void; - watchTypeRoots(callback: (project: ConfiguredProject, path: string) => void): void; - watchConfigDirectory(callback: (project: ConfiguredProject, path: string) => void): void; - watchWildcards(callback: (project: ConfiguredProject, path: string) => void): void; - stopWatchingDirectory(): void; - close(): void; - addOpenRef(): void; - deleteOpenRef(): number; - getEffectiveTypeRoots(): string[]; + interface ReloadRequest extends FileRequest { + command: CommandTypes.Reload; + arguments: ReloadRequestArgs; } - class ExternalProject extends Project { - compileOnSaveEnabled: boolean; - private readonly projectFilePath; - private typeAcquisition; - constructor(externalProjectName: string, projectService: ProjectService, documentRegistry: ts.DocumentRegistry, compilerOptions: CompilerOptions, languageServiceEnabled: boolean, compileOnSaveEnabled: boolean, projectFilePath?: string); - getProjectRootPath(): string; - getTypeAcquisition(): TypeAcquisition; - setProjectErrors(projectErrors: Diagnostic[]): void; - setTypeAcquisition(newTypeAcquisition: TypeAcquisition): void; + interface ReloadResponse extends Response { } + interface SavetoRequestArgs extends FileRequestArgs { + tmpfile: string; + } + interface SavetoRequest extends FileRequest { + command: CommandTypes.Saveto; + arguments: SavetoRequestArgs; + } + interface NavtoRequestArgs extends FileRequestArgs { + searchValue: string; + maxResultCount?: number; + currentFileOnly?: boolean; + projectFileName?: string; + } + interface NavtoRequest extends FileRequest { + command: CommandTypes.Navto; + arguments: NavtoRequestArgs; + } + interface NavtoItem { + name: string; + kind: string; + matchKind?: string; + isCaseSensitive?: boolean; + kindModifiers?: string; + file: string; + start: Location; + end: Location; + containerName?: string; + containerKind?: string; + } + interface NavtoResponse extends Response { + body?: NavtoItem[]; + } + interface ChangeRequestArgs extends FormatRequestArgs { + insertString?: string; + } + interface ChangeRequest extends FileLocationRequest { + command: CommandTypes.Change; + arguments: ChangeRequestArgs; + } + interface BraceResponse extends Response { + body?: TextSpan[]; + } + interface BraceRequest extends FileLocationRequest { + command: CommandTypes.Brace; + } + interface NavBarRequest extends FileRequest { + command: CommandTypes.NavBar; + } + interface NavTreeRequest extends FileRequest { + command: CommandTypes.NavTree; + } + interface NavigationBarItem { + text: string; + kind: string; + kindModifiers?: string; + spans: TextSpan[]; + childItems?: NavigationBarItem[]; + indent: number; + } + interface NavigationTree { + text: string; + kind: string; + kindModifiers: string; + spans: TextSpan[]; + childItems?: NavigationTree[]; + } + type TelemetryEventName = "telemetry"; + interface TelemetryEvent extends Event { + event: TelemetryEventName; + body: TelemetryEventBody; + } + interface TelemetryEventBody { + telemetryEventName: string; + payload: any; + } + type TypesInstallerInitializationFailedEventName = "typesInstallerInitializationFailed"; + interface TypesInstallerInitializationFailedEvent extends Event { + event: TypesInstallerInitializationFailedEventName; + body: TypesInstallerInitializationFailedEventBody; + } + interface TypesInstallerInitializationFailedEventBody { + message: string; + } + type TypingsInstalledTelemetryEventName = "typingsInstalled"; + interface TypingsInstalledTelemetryEventBody extends TelemetryEventBody { + telemetryEventName: TypingsInstalledTelemetryEventName; + payload: TypingsInstalledTelemetryEventPayload; + } + interface TypingsInstalledTelemetryEventPayload { + installedPackages: string; + installSuccess: boolean; + typingsInstallerVersion: string; + } + type BeginInstallTypesEventName = "beginInstallTypes"; + type EndInstallTypesEventName = "endInstallTypes"; + interface BeginInstallTypesEvent extends Event { + event: BeginInstallTypesEventName; + body: BeginInstallTypesEventBody; + } + interface EndInstallTypesEvent extends Event { + event: EndInstallTypesEventName; + body: EndInstallTypesEventBody; + } + interface InstallTypesEventBody { + eventId: number; + packages: ReadonlyArray; + } + interface BeginInstallTypesEventBody extends InstallTypesEventBody { + } + interface EndInstallTypesEventBody extends InstallTypesEventBody { + success: boolean; + } + interface NavBarResponse extends Response { + body?: NavigationBarItem[]; + } + interface NavTreeResponse extends Response { + body?: NavigationTree; + } + namespace IndentStyle { + type None = "None"; + type Block = "Block"; + type Smart = "Smart"; + } + type IndentStyle = IndentStyle.None | IndentStyle.Block | IndentStyle.Smart; + interface EditorSettings { + baseIndentSize?: number; + indentSize?: number; + tabSize?: number; + newLineCharacter?: string; + convertTabsToSpaces?: boolean; + indentStyle?: IndentStyle | ts.IndentStyle; + } + interface FormatCodeSettings extends EditorSettings { + insertSpaceAfterCommaDelimiter?: boolean; + insertSpaceAfterSemicolonInForStatements?: boolean; + insertSpaceBeforeAndAfterBinaryOperators?: boolean; + insertSpaceAfterConstructor?: boolean; + insertSpaceAfterKeywordsInControlFlowStatements?: boolean; + insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean; + insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean; + insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean; + insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean; + insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean; + insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean; + insertSpaceBeforeFunctionParenthesis?: boolean; + placeOpenBraceOnNewLineForFunctions?: boolean; + placeOpenBraceOnNewLineForControlBlocks?: boolean; + } + interface CompilerOptions { + allowJs?: boolean; + allowSyntheticDefaultImports?: boolean; + allowUnreachableCode?: boolean; + allowUnusedLabels?: boolean; + baseUrl?: string; + charset?: string; + declaration?: boolean; + declarationDir?: string; + disableSizeLimit?: boolean; + emitBOM?: boolean; + emitDecoratorMetadata?: boolean; + experimentalDecorators?: boolean; + forceConsistentCasingInFileNames?: boolean; + inlineSourceMap?: boolean; + inlineSources?: boolean; + isolatedModules?: boolean; + jsx?: JsxEmit | ts.JsxEmit; + lib?: string[]; + locale?: string; + mapRoot?: string; + maxNodeModuleJsDepth?: number; + module?: ModuleKind | ts.ModuleKind; + moduleResolution?: ModuleResolutionKind | ts.ModuleResolutionKind; + newLine?: NewLineKind | ts.NewLineKind; + noEmit?: boolean; + noEmitHelpers?: boolean; + noEmitOnError?: boolean; + noErrorTruncation?: boolean; + noFallthroughCasesInSwitch?: boolean; + noImplicitAny?: boolean; + noImplicitReturns?: boolean; + noImplicitThis?: boolean; + noUnusedLocals?: boolean; + noUnusedParameters?: boolean; + noImplicitUseStrict?: boolean; + noLib?: boolean; + noResolve?: boolean; + out?: string; + outDir?: string; + outFile?: string; + paths?: MapLike; + plugins?: PluginImport[]; + preserveConstEnums?: boolean; + project?: string; + reactNamespace?: string; + removeComments?: boolean; + rootDir?: string; + rootDirs?: string[]; + skipLibCheck?: boolean; + skipDefaultLibCheck?: boolean; + sourceMap?: boolean; + sourceRoot?: string; + strictNullChecks?: boolean; + suppressExcessPropertyErrors?: boolean; + suppressImplicitAnyIndexErrors?: boolean; + target?: ScriptTarget | ts.ScriptTarget; + traceResolution?: boolean; + types?: string[]; + typeRoots?: string[]; + [option: string]: CompilerOptionsValue | undefined; + } + namespace JsxEmit { + type None = "None"; + type Preserve = "Preserve"; + type ReactNative = "ReactNative"; + type React = "React"; + } + type JsxEmit = JsxEmit.None | JsxEmit.Preserve | JsxEmit.React | JsxEmit.ReactNative; + namespace ModuleKind { + type None = "None"; + type CommonJS = "CommonJS"; + type AMD = "AMD"; + type UMD = "UMD"; + type System = "System"; + type ES6 = "ES6"; + type ES2015 = "ES2015"; + } + type ModuleKind = ModuleKind.None | ModuleKind.CommonJS | ModuleKind.AMD | ModuleKind.UMD | ModuleKind.System | ModuleKind.ES6 | ModuleKind.ES2015; + namespace ModuleResolutionKind { + type Classic = "Classic"; + type Node = "Node"; + } + type ModuleResolutionKind = ModuleResolutionKind.Classic | ModuleResolutionKind.Node; + namespace NewLineKind { + type Crlf = "Crlf"; + type Lf = "Lf"; + } + type NewLineKind = NewLineKind.Crlf | NewLineKind.Lf; + namespace ScriptTarget { + type ES3 = "ES3"; + type ES5 = "ES5"; + type ES6 = "ES6"; + type ES2015 = "ES2015"; + } + type ScriptTarget = ScriptTarget.ES3 | ScriptTarget.ES5 | ScriptTarget.ES6 | ScriptTarget.ES2015; } declare namespace ts.server { - const maxProgramSizeForNonTsFiles: number; - const ContextEvent = "context"; - const ConfigFileDiagEvent = "configFileDiag"; - const ProjectLanguageServiceStateEvent = "projectLanguageServiceState"; - interface ContextEvent { - eventName: typeof ContextEvent; - data: { - project: Project; - fileName: NormalizedPath; - }; + interface ServerCancellationToken extends HostCancellationToken { + setRequest(requestId: number): void; + resetRequest(requestId: number): void; } - interface ConfigFileDiagEvent { - eventName: typeof ConfigFileDiagEvent; - data: { - triggerFile: string; - configFileName: string; - diagnostics: Diagnostic[]; - }; - } - interface ProjectLanguageServiceStateEvent { - eventName: typeof ProjectLanguageServiceStateEvent; - data: { - project: Project; - languageServiceEnabled: boolean; - }; - } - type ProjectServiceEvent = ContextEvent | ConfigFileDiagEvent | ProjectLanguageServiceStateEvent; - interface ProjectServiceEventHandler { - (event: ProjectServiceEvent): void; - } - function convertFormatOptions(protocolOptions: protocol.FormatCodeSettings): FormatCodeSettings; - function convertCompilerOptions(protocolOptions: protocol.ExternalProjectCompilerOptions): CompilerOptions & protocol.CompileOnSaveMixin; - function tryConvertScriptKindName(scriptKindName: protocol.ScriptKindName | ScriptKind): ScriptKind; - function convertScriptKindName(scriptKindName: protocol.ScriptKindName): ScriptKind; - function combineProjectOutput(projects: Project[], action: (project: Project) => T[], comparer?: (a: T, b: T) => number, areEqual?: (a: T, b: T) => boolean): T[]; - interface HostConfiguration { - formatCodeOptions: FormatCodeSettings; - hostInfo: string; - } - interface OpenConfiguredProjectResult { - configFileName?: string; - configFileErrors?: Diagnostic[]; - } - class ProjectService { - readonly host: ServerHost; - readonly logger: Logger; - readonly cancellationToken: HostCancellationToken; - readonly useSingleInferredProject: boolean; - readonly typingsInstaller: ITypingsInstaller; - private readonly eventHandler; - readonly typingsCache: TypingsCache; - private readonly documentRegistry; - private readonly filenameToScriptInfo; - private readonly externalProjectToConfiguredProjectMap; - readonly externalProjects: ExternalProject[]; - readonly inferredProjects: InferredProject[]; - readonly configuredProjects: ConfiguredProject[]; - readonly openFiles: ScriptInfo[]; - private compilerOptionsForInferredProjects; - private compileOnSaveForInferredProjects; - private readonly directoryWatchers; - private readonly throttledOperations; - private readonly hostConfiguration; - private changedFiles; - readonly toCanonicalFileName: (f: string) => string; - lastDeletedFile: ScriptInfo; - constructor(host: ServerHost, logger: Logger, cancellationToken: HostCancellationToken, useSingleInferredProject: boolean, typingsInstaller?: ITypingsInstaller, eventHandler?: ProjectServiceEventHandler); - getChangedFiles_TestOnly(): ScriptInfo[]; - ensureInferredProjectsUpToDate_TestOnly(): void; - getCompilerOptionsForInferredProjects(): CompilerOptions; - onUpdateLanguageServiceStateForProject(project: Project, languageServiceEnabled: boolean): void; - updateTypingsForProject(response: SetTypings | InvalidateCachedTypings): void; - setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.ExternalProjectCompilerOptions): void; - stopWatchingDirectory(directory: string): void; - findProject(projectName: string): Project; - getDefaultProjectForFile(fileName: NormalizedPath, refreshInferredProjects: boolean): Project; - private ensureInferredProjectsUpToDate(); - private findContainingExternalProject(fileName); - getFormatCodeOptions(file?: NormalizedPath): FormatCodeSettings; - private updateProjectGraphs(projects); - private onSourceFileChanged(fileName); - private handleDeletedFile(info); - private onTypeRootFileChanged(project, fileName); - private onSourceFileInDirectoryChangedForConfiguredProject(project, fileName); - private handleChangeInSourceFileForConfiguredProject(project, triggerFile); - private onConfigChangedForConfiguredProject(project); - private onConfigFileAddedForInferredProject(fileName); - private getCanonicalFileName(fileName); - private removeProject(project); - private assignScriptInfoToInferredProjectIfNecessary(info, addToListOfOpenFiles); - private closeOpenFile(info); - private openOrUpdateConfiguredProjectForFile(fileName); - private findConfigFile(searchPath); - private printProjects(); - private findConfiguredProjectByProjectName(configFileName); - private findExternalProjectByProjectName(projectFileName); - private convertConfigFileContentToProjectOptions(configFilename); - private exceededTotalSizeLimitForNonTsFiles(options, fileNames, propertyReader); - private createAndAddExternalProject(projectFileName, files, options, typeAcquisition); - private reportConfigFileDiagnostics(configFileName, diagnostics, triggerFile); - private createAndAddConfiguredProject(configFileName, projectOptions, configFileErrors, clientFileName?); - private watchConfigDirectoryForProject(project, options); - private addFilesToProjectAndUpdateGraph(project, files, propertyReader, clientFileName, typeAcquisition, configFileErrors); - private openConfigFile(configFileName, clientFileName?); - private updateNonInferredProject(project, newUncheckedFiles, propertyReader, newOptions, newTypeAcquisition, compileOnSave, configFileErrors); - private updateConfiguredProject(project); - createInferredProjectWithRootFileIfNecessary(root: ScriptInfo): InferredProject; - getOrCreateScriptInfo(uncheckedFileName: string, openedByClient: boolean, fileContent?: string, scriptKind?: ScriptKind): ScriptInfo; - getScriptInfo(uncheckedFileName: string): ScriptInfo; - getOrCreateScriptInfoForNormalizedPath(fileName: NormalizedPath, openedByClient: boolean, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean): ScriptInfo; - getScriptInfoForNormalizedPath(fileName: NormalizedPath): ScriptInfo; - getScriptInfoForPath(fileName: Path): ScriptInfo; - setHostConfiguration(args: protocol.ConfigureRequestArguments): void; - closeLog(): void; - reloadProjects(): void; - refreshInferredProjects(): void; - openClientFile(fileName: string, fileContent?: string, scriptKind?: ScriptKind): OpenConfiguredProjectResult; - openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean): OpenConfiguredProjectResult; - closeClientFile(uncheckedFileName: string): void; - private collectChanges(lastKnownProjectVersions, currentProjects, result); - synchronizeProjectList(knownProjects: protocol.ProjectVersionInfo[]): ProjectFilesWithTSDiagnostics[]; - applyChangesInOpenFiles(openFiles: protocol.ExternalFile[], changedFiles: protocol.ChangedOpenFile[], closedFiles: string[]): void; - private closeConfiguredProject(configFile); - closeExternalProject(uncheckedFileName: string, suppressRefresh?: boolean): void; - openExternalProject(proj: protocol.ExternalProject): void; - } -} -declare namespace ts.server { + const nullCancellationToken: ServerCancellationToken; interface PendingErrorCheck { fileName: NormalizedPath; project: Project; @@ -11308,51 +4398,36 @@ declare namespace ts.server { } namespace CommandNames { const Brace: protocol.CommandTypes.Brace; - const BraceFull: protocol.CommandTypes.BraceFull; const BraceCompletion: protocol.CommandTypes.BraceCompletion; const Change: protocol.CommandTypes.Change; const Close: protocol.CommandTypes.Close; const Completions: protocol.CommandTypes.Completions; - const CompletionsFull: protocol.CommandTypes.CompletionsFull; const CompletionDetails: protocol.CommandTypes.CompletionDetails; const CompileOnSaveAffectedFileList: protocol.CommandTypes.CompileOnSaveAffectedFileList; const CompileOnSaveEmitFile: protocol.CommandTypes.CompileOnSaveEmitFile; const Configure: protocol.CommandTypes.Configure; const Definition: protocol.CommandTypes.Definition; - const DefinitionFull: protocol.CommandTypes.DefinitionFull; const Exit: protocol.CommandTypes.Exit; const Format: protocol.CommandTypes.Format; const Formatonkey: protocol.CommandTypes.Formatonkey; - const FormatFull: protocol.CommandTypes.FormatFull; - const FormatonkeyFull: protocol.CommandTypes.FormatonkeyFull; - const FormatRangeFull: protocol.CommandTypes.FormatRangeFull; const Geterr: protocol.CommandTypes.Geterr; const GeterrForProject: protocol.CommandTypes.GeterrForProject; const Implementation: protocol.CommandTypes.Implementation; - const ImplementationFull: protocol.CommandTypes.ImplementationFull; const SemanticDiagnosticsSync: protocol.CommandTypes.SemanticDiagnosticsSync; const SyntacticDiagnosticsSync: protocol.CommandTypes.SyntacticDiagnosticsSync; const NavBar: protocol.CommandTypes.NavBar; - const NavBarFull: protocol.CommandTypes.NavBarFull; const NavTree: protocol.CommandTypes.NavTree; const NavTreeFull: protocol.CommandTypes.NavTreeFull; const Navto: protocol.CommandTypes.Navto; - const NavtoFull: protocol.CommandTypes.NavtoFull; const Occurrences: protocol.CommandTypes.Occurrences; const DocumentHighlights: protocol.CommandTypes.DocumentHighlights; - const DocumentHighlightsFull: protocol.CommandTypes.DocumentHighlightsFull; const Open: protocol.CommandTypes.Open; const Quickinfo: protocol.CommandTypes.Quickinfo; - const QuickinfoFull: protocol.CommandTypes.QuickinfoFull; const References: protocol.CommandTypes.References; - const ReferencesFull: protocol.CommandTypes.ReferencesFull; const Reload: protocol.CommandTypes.Reload; const Rename: protocol.CommandTypes.Rename; - const RenameInfoFull: protocol.CommandTypes.RenameInfoFull; - const RenameLocationsFull: protocol.CommandTypes.RenameLocationsFull; const Saveto: protocol.CommandTypes.Saveto; const SignatureHelp: protocol.CommandTypes.SignatureHelp; - const SignatureHelpFull: protocol.CommandTypes.SignatureHelpFull; const TypeDefinition: protocol.CommandTypes.TypeDefinition; const ProjectInfo: protocol.CommandTypes.ProjectInfo; const ReloadProjects: protocol.CommandTypes.ReloadProjects; @@ -11360,37 +4435,44 @@ declare namespace ts.server { const OpenExternalProject: protocol.CommandTypes.OpenExternalProject; const OpenExternalProjects: protocol.CommandTypes.OpenExternalProjects; const CloseExternalProject: protocol.CommandTypes.CloseExternalProject; - const SynchronizeProjectList: protocol.CommandTypes.SynchronizeProjectList; - const ApplyChangedToOpenFiles: protocol.CommandTypes.ApplyChangedToOpenFiles; - const EncodedSemanticClassificationsFull: protocol.CommandTypes.EncodedSemanticClassificationsFull; - const Cleanup: protocol.CommandTypes.Cleanup; - const OutliningSpans: protocol.CommandTypes.OutliningSpans; const TodoComments: protocol.CommandTypes.TodoComments; const Indentation: protocol.CommandTypes.Indentation; const DocCommentTemplate: protocol.CommandTypes.DocCommentTemplate; - const CompilerOptionsDiagnosticsFull: protocol.CommandTypes.CompilerOptionsDiagnosticsFull; - const NameOrDottedNameSpan: protocol.CommandTypes.NameOrDottedNameSpan; - const BreakpointStatement: protocol.CommandTypes.BreakpointStatement; const CompilerOptionsForInferredProjects: protocol.CommandTypes.CompilerOptionsForInferredProjects; const GetCodeFixes: protocol.CommandTypes.GetCodeFixes; - const GetCodeFixesFull: protocol.CommandTypes.GetCodeFixesFull; const GetSupportedCodeFixes: protocol.CommandTypes.GetSupportedCodeFixes; } function formatMessage(msg: T, logger: server.Logger, byteLength: (s: string, encoding: string) => number, newLine: string): string; + interface SessionOptions { + host: ServerHost; + cancellationToken: ServerCancellationToken; + useSingleInferredProject: boolean; + typingsInstaller: ITypingsInstaller; + byteLength: (buf: string, encoding?: string) => number; + hrtime: (start?: number[]) => number[]; + logger: Logger; + canUseEvents: boolean; + eventHandler?: ProjectServiceEventHandler; + throttleWaitMilliseconds?: number; + globalPlugins?: string[]; + pluginProbeLocations?: string[]; + } class Session implements EventSender { + private readonly gcTimer; + protected projectService: ProjectService; + private changeSeq; + private currentRequestId; + private errorCheck; + private eventHandler; private host; + private readonly cancellationToken; protected readonly typingsInstaller: ITypingsInstaller; private byteLength; private hrtime; protected logger: Logger; - protected readonly canUseEvents: boolean; - private readonly gcTimer; - protected projectService: ProjectService; - private errorTimer; - private immediateId; - private changeSeq; - private eventHander; - constructor(host: ServerHost, cancellationToken: HostCancellationToken, useSingleInferredProject: boolean, typingsInstaller: ITypingsInstaller, byteLength: (buf: string, encoding?: string) => number, hrtime: (start?: number[]) => number[], logger: Logger, canUseEvents: boolean, eventHandler?: ProjectServiceEventHandler); + private canUseEvents; + constructor(opts: SessionOptions); + private sendRequestCompletedEvent(requestId); private defaultEventHandler(event); logError(err: Error, cmd: string): void; send(msg: protocol.Message): void; @@ -11400,7 +4482,7 @@ declare namespace ts.server { private semanticCheck(file, project); private syntacticCheck(file, project); private updateProjectStructure(seq, matchSeq, ms?); - private updateErrorCheck(checkList, seq, matchSeq, ms?, followMs?, requireOpen?); + private updateErrorCheck(next, checkList, seq, matchSeq, ms?, followMs?, requireOpen?); private cleanProjects(caption, projects); private cleanup(); private getEncodedSemanticClassifications(args); @@ -11420,6 +4502,7 @@ declare namespace ts.server { private getProjectInfoWorker(uncheckedFileName, projectFileName, needFileNameList); private getRenameInfo(args); private getProjects(args); + private getDefaultProject(args); private getRenameLocations(args, simplifiedResult); private getReferences(args, simplifiedResult); private openClientFile(fileName, fileContent?, scriptKind?); @@ -11445,7 +4528,7 @@ declare namespace ts.server { private getCompileOnSaveAffectedFileList(args); private emitFile(args); private getSignatureHelpItems(args, simplifiedResult); - private getDiagnostics(delay, fileNames); + private getDiagnostics(next, delay, fileNames); private change(args); private reload(args, reqSeq); private saveToTmp(fileName, tempFileName); @@ -11461,7 +4544,7 @@ declare namespace ts.server { private mapCodeAction(codeAction, scriptInfo); private convertTextChangeToCodeEdit(change, scriptInfo); private getBraceMatching(args, simplifiedResult); - getDiagnosticsForProject(delay: number, fileName: string): void; + private getDiagnosticsForProject(next, delay, fileName); getCanonicalFileName(fileName: string): string; exit(): void; private notRequired(); @@ -11471,6 +4554,9 @@ declare namespace ts.server { response?: any; responseRequired: boolean; }): void; + private setCurrentRequest(requestId); + private resetCurrentRequest(requestId); + executeWithRequestId(requestId: number, f: () => T): T; executeCommand(request: protocol.Request): { response?: any; responseRequired?: boolean; @@ -11534,8 +4620,8 @@ declare namespace ts.server { static fromString(host: ServerHost, script: string): ScriptVersionCache; } class LineIndexSnapshot implements ts.IScriptSnapshot { - version: number; - cache: ScriptVersionCache; + readonly version: number; + readonly cache: ScriptVersionCache; index: LineIndex; changesSincePreviousVersion: TextChange[]; constructor(version: number, cache: ScriptVersionCache); @@ -11603,178 +4689,443 @@ declare namespace ts.server { lineCount(): number; } } -declare let debugObjectHost: any; -declare namespace ts { - interface ScriptSnapshotShim { - getText(start: number, end: number): string; - getLength(): number; - getChangeRange(oldSnapshot: ScriptSnapshotShim): string; - dispose?(): void; - } - interface Logger { - log(s: string): void; - trace(s: string): void; - error(s: string): void; - } - interface LanguageServiceShimHost extends Logger { - getCompilationSettings(): string; - getScriptFileNames(): string; - getScriptKind?(fileName: string): ScriptKind; - getScriptVersion(fileName: string): string; - getScriptSnapshot(fileName: string): ScriptSnapshotShim; - getLocalizedDiagnosticMessages(): string; - getCancellationToken(): HostCancellationToken; - getCurrentDirectory(): string; - getDirectories(path: string): string; - getDefaultLibFileName(options: string): string; - getNewLine?(): string; - getProjectVersion?(): string; - useCaseSensitiveFileNames?(): boolean; - getTypeRootsVersion?(): number; - readDirectory(rootDir: string, extension: string, basePaths?: string, excludeEx?: string, includeFileEx?: string, includeDirEx?: string, depth?: number): string; - readFile(path: string, encoding?: string): string; - fileExists(path: string): boolean; - getModuleResolutionsForFile?(fileName: string): string; - getTypeReferenceDirectiveResolutionsForFile?(fileName: string): string; - directoryExists(directoryName: string): boolean; - } - interface CoreServicesShimHost extends Logger { - directoryExists(directoryName: string): boolean; - fileExists(fileName: string): boolean; - getCurrentDirectory(): string; - getDirectories(path: string): string; - readDirectory(rootDir: string, extension: string, basePaths?: string, excludeEx?: string, includeFileEx?: string, includeDirEx?: string, depth?: number): string; - readFile(fileName: string): string; - realpath?(path: string): string; - trace(s: string): void; - useCaseSensitiveFileNames?(): boolean; - } - interface IFileReference { - path: string; - position: number; - length: number; - } - interface ShimFactory { - registerShim(shim: Shim): void; - unregisterShim(shim: Shim): void; - } - interface Shim { - dispose(_dummy: any): void; - } - interface LanguageServiceShim extends Shim { - languageService: LanguageService; - dispose(_dummy: any): void; - refresh(throwOnError: boolean): void; - cleanupSemanticCache(): void; - getSyntacticDiagnostics(fileName: string): string; - getSemanticDiagnostics(fileName: string): string; - getCompilerOptionsDiagnostics(): string; - getSyntacticClassifications(fileName: string, start: number, length: number): string; - getSemanticClassifications(fileName: string, start: number, length: number): string; - getEncodedSyntacticClassifications(fileName: string, start: number, length: number): string; - getEncodedSemanticClassifications(fileName: string, start: number, length: number): string; - getCompletionsAtPosition(fileName: string, position: number): string; - getCompletionEntryDetails(fileName: string, position: number, entryName: string): string; - getQuickInfoAtPosition(fileName: string, position: number): string; - getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): string; - getBreakpointStatementAtPosition(fileName: string, position: number): string; - getSignatureHelpItems(fileName: string, position: number): string; - getRenameInfo(fileName: string, position: number): string; - findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): string; - getDefinitionAtPosition(fileName: string, position: number): string; - getTypeDefinitionAtPosition(fileName: string, position: number): string; - getImplementationAtPosition(fileName: string, position: number): string; - getReferencesAtPosition(fileName: string, position: number): string; - findReferences(fileName: string, position: number): string; - getOccurrencesAtPosition(fileName: string, position: number): string; - getDocumentHighlights(fileName: string, position: number, filesToSearch: string): string; - getNavigateToItems(searchValue: string, maxResultCount?: number, fileName?: string): string; - getNavigationBarItems(fileName: string): string; - getNavigationTree(fileName: string): string; - getOutliningSpans(fileName: string): string; - getTodoComments(fileName: string, todoCommentDescriptors: string): string; - getBraceMatchingAtPosition(fileName: string, position: number): string; - getIndentationAtPosition(fileName: string, position: number, options: string): string; - getFormattingEditsForRange(fileName: string, start: number, end: number, options: string): string; - getFormattingEditsForDocument(fileName: string, options: string): string; - getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: string): string; - getDocCommentTemplateAtPosition(fileName: string, position: number): string; - isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): string; - getEmitOutput(fileName: string): string; - getEmitOutputObject(fileName: string): EmitOutput; - } - interface ClassifierShim extends Shim { - getEncodedLexicalClassifications(text: string, lexState: EndOfLineState, syntacticClassifierAbsent?: boolean): string; - getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent?: boolean): string; - } - interface CoreServicesShim extends Shim { - getAutomaticTypeDirectiveNames(compilerOptionsJson: string): string; - getPreProcessedFileInfo(fileName: string, sourceText: IScriptSnapshot): string; - getTSConfigFileInfo(fileName: string, sourceText: IScriptSnapshot): string; - getDefaultCompilationSettings(): string; - discoverTypings(discoverTypingsJson: string): string; - } - class LanguageServiceShimHostAdapter implements LanguageServiceHost { - private shimHost; - private files; - private loggingEnabled; - private tracingEnabled; - resolveModuleNames: (moduleName: string[], containingFile: string) => ResolvedModuleFull[]; - resolveTypeReferenceDirectives: (typeDirectiveNames: string[], containingFile: string) => ResolvedTypeReferenceDirective[]; - directoryExists: (directoryName: string) => boolean; - constructor(shimHost: LanguageServiceShimHost); - log(s: string): void; - trace(s: string): void; - error(s: string): void; - getProjectVersion(): string; - getTypeRootsVersion(): number; - useCaseSensitiveFileNames(): boolean; - getCompilationSettings(): CompilerOptions; - getScriptFileNames(): string[]; - getScriptSnapshot(fileName: string): IScriptSnapshot; - getScriptKind(fileName: string): ScriptKind; - getScriptVersion(fileName: string): string; - getLocalizedDiagnosticMessages(): any; - getCancellationToken(): HostCancellationToken; - getCurrentDirectory(): string; - getDirectories(path: string): string[]; - getDefaultLibFileName(options: CompilerOptions): string; - readDirectory(path: string, extensions?: string[], exclude?: string[], include?: string[], depth?: number): string[]; - readFile(path: string, encoding?: string): string; - fileExists(path: string): boolean; - } - class CoreServicesShimHostAdapter implements ParseConfigHost, ModuleResolutionHost { - private shimHost; - directoryExists: (directoryName: string) => boolean; - realpath: (path: string) => string; - useCaseSensitiveFileNames: boolean; - constructor(shimHost: CoreServicesShimHost); - readDirectory(rootDir: string, extensions: string[], exclude: string[], include: string[], depth?: number): string[]; - fileExists(fileName: string): boolean; - readFile(fileName: string): string; - private readDirectoryFallback(rootDir, extension, exclude); - getDirectories(path: string): string[]; - } - function realizeDiagnostics(diagnostics: Diagnostic[], newLine: string): { - message: string; - start: number; - length: number; - category: string; - code: number; - }[]; - class TypeScriptServicesFactory implements ShimFactory { - private _shims; - private documentRegistry; - getServicesVersion(): string; - createLanguageServiceShim(host: LanguageServiceShimHost): LanguageServiceShim; - createClassifierShim(logger: Logger): ClassifierShim; - createCoreServicesShim(host: CoreServicesShimHost): CoreServicesShim; +declare namespace ts.server { + class ScriptInfo { + private readonly host; + readonly fileName: NormalizedPath; + readonly scriptKind: ScriptKind; + hasMixedContent: boolean; + readonly containingProjects: Project[]; + private formatCodeSettings; + readonly path: Path; + private fileWatcher; + private textStorage; + private isOpen; + constructor(host: ServerHost, fileName: NormalizedPath, scriptKind: ScriptKind, hasMixedContent?: boolean); + isScriptOpen(): boolean; + open(newText: string): void; close(): void; - registerShim(shim: Shim): void; - unregisterShim(shim: Shim): void; + getSnapshot(): IScriptSnapshot; + getFormatCodeSettings(): FormatCodeSettings; + attachToProject(project: Project): boolean; + isAttached(project: Project): boolean; + detachFromProject(project: Project): void; + detachAllProjects(): void; + getDefaultProject(): Project; + registerFileUpdate(): void; + setFormatOptions(formatSettings: FormatCodeSettings): void; + setWatcher(watcher: FileWatcher): void; + stopWatcher(): void; + getLatestVersion(): string; + reload(script: string): void; + saveTo(fileName: string): void; + reloadFromFile(tempFileName?: NormalizedPath): void; + getLineInfo(line: number): ILineInfo; + editContent(start: number, end: number, newText: string): void; + markContainingProjectsAsDirty(): void; + lineToTextSpan(line: number): TextSpan; + lineOffsetToPosition(line: number, offset: number): number; + positionToLineOffset(position: number): ILineInfo; + isJavaScript(): boolean; } } -declare namespace TypeScript.Services { - const TypeScriptServicesFactory: typeof ts.TypeScriptServicesFactory; +declare namespace ts.server { + class LSHost implements ts.LanguageServiceHost, ModuleResolutionHost { + private readonly host; + private readonly project; + private readonly cancellationToken; + private compilationSettings; + private readonly resolvedModuleNames; + private readonly resolvedTypeReferenceDirectives; + private readonly getCanonicalFileName; + private filesWithChangedSetOfUnresolvedImports; + private readonly resolveModuleName; + readonly trace: (s: string) => void; + readonly realpath?: (path: string) => string; + constructor(host: ServerHost, project: Project, cancellationToken: HostCancellationToken); + startRecordingFilesWithChangedResolutions(): void; + finishRecordingFilesWithChangedResolutions(): Path[]; + private resolveNamesWithLocalCache(names, containingFile, cache, loader, getResult, getResultFileName, logChanges); + getNewLine(): string; + getProjectVersion(): string; + getCompilationSettings(): CompilerOptions; + useCaseSensitiveFileNames(): boolean; + getCancellationToken(): HostCancellationToken; + resolveTypeReferenceDirectives(typeDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[]; + resolveModuleNames(moduleNames: string[], containingFile: string): ResolvedModuleFull[]; + getDefaultLibFileName(): string; + getScriptSnapshot(filename: string): ts.IScriptSnapshot; + getScriptFileNames(): string[]; + getTypeRootsVersion(): number; + getScriptKind(fileName: string): ScriptKind; + getScriptVersion(filename: string): string; + getCurrentDirectory(): string; + resolvePath(path: string): string; + fileExists(path: string): boolean; + readFile(fileName: string): string; + directoryExists(path: string): boolean; + readDirectory(path: string, extensions?: string[], exclude?: string[], include?: string[]): string[]; + getDirectories(path: string): string[]; + notifyFileRemoved(info: ScriptInfo): void; + setCompilationSettings(opt: ts.CompilerOptions): void; + } } -declare const toolsVersion = "2.2"; +declare namespace ts.server { + interface ITypingsInstaller { + enqueueInstallTypingsRequest(p: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray): void; + attach(projectService: ProjectService): void; + onProjectClosed(p: Project): void; + readonly globalTypingsCacheLocation: string; + } + const nullTypingsInstaller: ITypingsInstaller; + class TypingsCache { + private readonly installer; + private readonly perProjectCache; + constructor(installer: ITypingsInstaller); + getTypingsForProject(project: Project, unresolvedImports: SortedReadonlyArray, forceRefresh: boolean): SortedReadonlyArray; + updateTypingsForProject(projectName: string, compilerOptions: CompilerOptions, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray, newTypings: string[]): void; + deleteTypingsForProject(projectName: string): void; + onProjectClosed(project: Project): void; + } +} +declare namespace ts.server { + function shouldEmitFile(scriptInfo: ScriptInfo): boolean; + class BuilderFileInfo { + readonly scriptInfo: ScriptInfo; + readonly project: Project; + private lastCheckedShapeSignature; + constructor(scriptInfo: ScriptInfo, project: Project); + isExternalModuleOrHasOnlyAmbientExternalModules(): boolean; + private containsOnlyAmbientModules(sourceFile); + private computeHash(text); + private getSourceFile(); + updateShapeSignature(): boolean; + } + interface Builder { + readonly project: Project; + getFilesAffectedBy(scriptInfo: ScriptInfo): string[]; + onProjectUpdateGraph(): void; + emitFile(scriptInfo: ScriptInfo, writeFile: (path: string, data: string, writeByteOrderMark?: boolean) => void): boolean; + clear(): void; + } + function createBuilder(project: Project): Builder; +} +declare namespace ts.server { + enum ProjectKind { + Inferred = 0, + Configured = 1, + External = 2, + } + function allRootFilesAreJsOrDts(project: Project): boolean; + function allFilesAreJsOrDts(project: Project): boolean; + class UnresolvedImportsMap { + readonly perFileMap: FileMap>; + private version; + clear(): void; + getVersion(): number; + remove(path: Path): void; + get(path: Path): ReadonlyArray; + set(path: Path, value: ReadonlyArray): void; + } + interface PluginCreateInfo { + project: Project; + languageService: LanguageService; + languageServiceHost: LanguageServiceHost; + serverHost: ServerHost; + config: any; + } + interface PluginModule { + create(createInfo: PluginCreateInfo): LanguageService; + getExternalFiles?(proj: Project): string[]; + } + interface PluginModuleFactory { + (mod: { + typescript: typeof ts; + }): PluginModule; + } + abstract class Project { + private readonly projectName; + readonly projectKind: ProjectKind; + readonly projectService: ProjectService; + private documentRegistry; + private compilerOptions; + compileOnSaveEnabled: boolean; + private rootFiles; + private rootFilesMap; + private program; + private cachedUnresolvedImportsPerFile; + private lastCachedUnresolvedImportsList; + protected languageService: LanguageService; + languageServiceEnabled: boolean; + protected readonly lsHost: LSHost; + builder: Builder; + private updatedFileNames; + private lastReportedFileNames; + private lastReportedVersion; + private projectStructureVersion; + private projectStateVersion; + private typingFiles; + protected projectErrors: Diagnostic[]; + typesVersion: number; + isNonTsProject(): boolean; + isJsOnlyProject(): boolean; + getCachedUnresolvedImportsPerFile_TestOnly(): UnresolvedImportsMap; + static resolveModule(moduleName: string, initialDir: string, host: ServerHost, log: (message: string) => void): {}; + constructor(projectName: string, projectKind: ProjectKind, projectService: ProjectService, documentRegistry: ts.DocumentRegistry, hasExplicitListOfFiles: boolean, languageServiceEnabled: boolean, compilerOptions: CompilerOptions, compileOnSaveEnabled: boolean); + private setInternalCompilerOptionsForEmittingJsFiles(); + getProjectErrors(): Diagnostic[]; + getLanguageService(ensureSynchronized?: boolean): LanguageService; + getCompileOnSaveAffectedFileList(scriptInfo: ScriptInfo): string[]; + getProjectVersion(): string; + enableLanguageService(): void; + disableLanguageService(): void; + getProjectName(): string; + abstract getProjectRootPath(): string | undefined; + abstract getTypeAcquisition(): TypeAcquisition; + getExternalFiles(): string[]; + getSourceFile(path: Path): SourceFile; + updateTypes(): void; + close(): void; + getCompilerOptions(): CompilerOptions; + hasRoots(): boolean; + getRootFiles(): NormalizedPath[]; + getRootFilesLSHost(): string[]; + getRootScriptInfos(): ScriptInfo[]; + getScriptInfos(): ScriptInfo[]; + getFileEmitOutput(info: ScriptInfo, emitOnlyDtsFiles: boolean): EmitOutput; + getFileNames(excludeFilesFromExternalLibraries?: boolean): NormalizedPath[]; + getAllEmittableFiles(): string[]; + containsScriptInfo(info: ScriptInfo): boolean; + containsFile(filename: NormalizedPath, requireOpen?: boolean): boolean; + isRoot(info: ScriptInfo): boolean; + addRoot(info: ScriptInfo): void; + removeFile(info: ScriptInfo, detachFromProject?: boolean): void; + registerFileUpdate(fileName: string): void; + markAsDirty(): void; + private extractUnresolvedImportsFromSourceFile(file, result); + updateGraph(): boolean; + private setTypings(typings); + private updateGraphWorker(); + getScriptInfoLSHost(fileName: string): ScriptInfo; + getScriptInfoForNormalizedPath(fileName: NormalizedPath): ScriptInfo; + getScriptInfo(uncheckedFileName: string): ScriptInfo; + filesToString(): string; + setCompilerOptions(compilerOptions: CompilerOptions): void; + reloadScript(filename: NormalizedPath, tempFileName?: NormalizedPath): boolean; + getReferencedFiles(path: Path): Path[]; + protected removeRoot(info: ScriptInfo): void; + } + class InferredProject extends Project { + private static newName; + private _isJsInferredProject; + toggleJsInferredProject(isJsInferredProject: boolean): void; + setCompilerOptions(options?: CompilerOptions): void; + directoriesWatchedForTsconfig: string[]; + constructor(projectService: ProjectService, documentRegistry: ts.DocumentRegistry, compilerOptions: CompilerOptions); + addRoot(info: ScriptInfo): void; + removeRoot(info: ScriptInfo): void; + getProjectRootPath(): string; + close(): void; + getTypeAcquisition(): TypeAcquisition; + } + class ConfiguredProject extends Project { + private wildcardDirectories; + compileOnSaveEnabled: boolean; + private typeAcquisition; + private projectFileWatcher; + private directoryWatcher; + private directoriesWatchedForWildcards; + private typeRootsWatchers; + readonly canonicalConfigFilePath: NormalizedPath; + private plugins; + openRefCount: number; + constructor(configFileName: NormalizedPath, projectService: ProjectService, documentRegistry: ts.DocumentRegistry, hasExplicitListOfFiles: boolean, compilerOptions: CompilerOptions, wildcardDirectories: Map, languageServiceEnabled: boolean, compileOnSaveEnabled: boolean); + getConfigFilePath(): string; + enablePlugins(): void; + private enablePlugin(pluginConfigEntry, searchPaths); + private enableProxy(pluginModuleFactory, configEntry); + getProjectRootPath(): string; + setProjectErrors(projectErrors: Diagnostic[]): void; + setTypeAcquisition(newTypeAcquisition: TypeAcquisition): void; + getTypeAcquisition(): TypeAcquisition; + getExternalFiles(): string[]; + watchConfigFile(callback: (project: ConfiguredProject) => void): void; + watchTypeRoots(callback: (project: ConfiguredProject, path: string) => void): void; + watchConfigDirectory(callback: (project: ConfiguredProject, path: string) => void): void; + watchWildcards(callback: (project: ConfiguredProject, path: string) => void): void; + stopWatchingDirectory(): void; + close(): void; + addOpenRef(): void; + deleteOpenRef(): number; + getEffectiveTypeRoots(): string[]; + } + class ExternalProject extends Project { + externalProjectName: string; + compileOnSaveEnabled: boolean; + private readonly projectFilePath; + private typeAcquisition; + constructor(externalProjectName: string, projectService: ProjectService, documentRegistry: ts.DocumentRegistry, compilerOptions: CompilerOptions, languageServiceEnabled: boolean, compileOnSaveEnabled: boolean, projectFilePath?: string); + getProjectRootPath(): string; + getTypeAcquisition(): TypeAcquisition; + setProjectErrors(projectErrors: Diagnostic[]): void; + setTypeAcquisition(newTypeAcquisition: TypeAcquisition): void; + } +} +declare namespace ts.server { + const maxProgramSizeForNonTsFiles: number; + const ContextEvent = "context"; + const ConfigFileDiagEvent = "configFileDiag"; + const ProjectLanguageServiceStateEvent = "projectLanguageServiceState"; + interface ContextEvent { + eventName: typeof ContextEvent; + data: { + project: Project; + fileName: NormalizedPath; + }; + } + interface ConfigFileDiagEvent { + eventName: typeof ConfigFileDiagEvent; + data: { + triggerFile: string; + configFileName: string; + diagnostics: Diagnostic[]; + }; + } + interface ProjectLanguageServiceStateEvent { + eventName: typeof ProjectLanguageServiceStateEvent; + data: { + project: Project; + languageServiceEnabled: boolean; + }; + } + type ProjectServiceEvent = ContextEvent | ConfigFileDiagEvent | ProjectLanguageServiceStateEvent; + interface ProjectServiceEventHandler { + (event: ProjectServiceEvent): void; + } + interface SafeList { + [name: string]: { + match: RegExp; + exclude?: Array>; + types?: string[]; + }; + } + function convertFormatOptions(protocolOptions: protocol.FormatCodeSettings): FormatCodeSettings; + function convertCompilerOptions(protocolOptions: protocol.ExternalProjectCompilerOptions): CompilerOptions & protocol.CompileOnSaveMixin; + function tryConvertScriptKindName(scriptKindName: protocol.ScriptKindName | ScriptKind): ScriptKind; + function convertScriptKindName(scriptKindName: protocol.ScriptKindName): ScriptKind.Unknown | ScriptKind.JS | ScriptKind.JSX | ScriptKind.TS | ScriptKind.TSX; + function combineProjectOutput(projects: Project[], action: (project: Project) => T[], comparer?: (a: T, b: T) => number, areEqual?: (a: T, b: T) => boolean): T[]; + interface HostConfiguration { + formatCodeOptions: FormatCodeSettings; + hostInfo: string; + extraFileExtensions?: JsFileExtensionInfo[]; + } + interface OpenConfiguredProjectResult { + configFileName?: NormalizedPath; + configFileErrors?: Diagnostic[]; + } + interface ProjectServiceOptions { + host: ServerHost; + logger: Logger; + cancellationToken: HostCancellationToken; + useSingleInferredProject: boolean; + typingsInstaller: ITypingsInstaller; + eventHandler?: ProjectServiceEventHandler; + throttleWaitMilliseconds?: number; + globalPlugins?: string[]; + pluginProbeLocations?: string[]; + } + class ProjectService { + readonly typingsCache: TypingsCache; + private readonly documentRegistry; + private readonly filenameToScriptInfo; + private readonly externalProjectToConfiguredProjectMap; + readonly externalProjects: ExternalProject[]; + readonly inferredProjects: InferredProject[]; + readonly configuredProjects: ConfiguredProject[]; + readonly openFiles: ScriptInfo[]; + private compilerOptionsForInferredProjects; + private compileOnSaveForInferredProjects; + private readonly projectToSizeMap; + private readonly directoryWatchers; + private readonly throttledOperations; + private readonly hostConfiguration; + private static safelist; + private changedFiles; + readonly toCanonicalFileName: (f: string) => string; + lastDeletedFile: ScriptInfo; + readonly host: ServerHost; + readonly logger: Logger; + readonly cancellationToken: HostCancellationToken; + readonly useSingleInferredProject: boolean; + readonly typingsInstaller: ITypingsInstaller; + readonly throttleWaitMilliseconds?: number; + private readonly eventHandler?; + readonly globalPlugins: ReadonlyArray; + readonly pluginProbeLocations: ReadonlyArray; + constructor(opts: ProjectServiceOptions); + ensureInferredProjectsUpToDate_TestOnly(): void; + getCompilerOptionsForInferredProjects(): CompilerOptions; + onUpdateLanguageServiceStateForProject(project: Project, languageServiceEnabled: boolean): void; + updateTypingsForProject(response: SetTypings | InvalidateCachedTypings): void; + setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.ExternalProjectCompilerOptions): void; + stopWatchingDirectory(directory: string): void; + findProject(projectName: string): Project; + getDefaultProjectForFile(fileName: NormalizedPath, refreshInferredProjects: boolean): Project; + private ensureInferredProjectsUpToDate(); + private findContainingExternalProject(fileName); + getFormatCodeOptions(file?: NormalizedPath): FormatCodeSettings; + private updateProjectGraphs(projects); + private onSourceFileChanged(fileName); + private handleDeletedFile(info); + private onTypeRootFileChanged(project, fileName); + private onSourceFileInDirectoryChangedForConfiguredProject(project, fileName); + private handleChangeInSourceFileForConfiguredProject(project, triggerFile); + private onConfigChangedForConfiguredProject(project); + private onConfigFileAddedForInferredProject(fileName); + private getCanonicalFileName(fileName); + private removeProject(project); + private assignScriptInfoToInferredProjectIfNecessary(info, addToListOfOpenFiles); + private closeOpenFile(info); + private openOrUpdateConfiguredProjectForFile(fileName); + private findConfigFile(searchPath); + private printProjects(); + private findConfiguredProjectByProjectName(configFileName); + private findExternalProjectByProjectName(projectFileName); + private convertConfigFileContentToProjectOptions(configFilename); + private exceededTotalSizeLimitForNonTsFiles(name, options, fileNames, propertyReader); + private createAndAddExternalProject(projectFileName, files, options, typeAcquisition); + private reportConfigFileDiagnostics(configFileName, diagnostics, triggerFile); + private createAndAddConfiguredProject(configFileName, projectOptions, configFileErrors, clientFileName?); + private watchConfigDirectoryForProject(project, options); + private addFilesToProjectAndUpdateGraph(project, files, propertyReader, clientFileName, typeAcquisition, configFileErrors); + private openConfigFile(configFileName, clientFileName?); + private updateNonInferredProject(project, newUncheckedFiles, propertyReader, newOptions, newTypeAcquisition, compileOnSave, configFileErrors); + private updateConfiguredProject(project); + createInferredProjectWithRootFileIfNecessary(root: ScriptInfo): InferredProject; + getOrCreateScriptInfo(uncheckedFileName: string, openedByClient: boolean, fileContent?: string, scriptKind?: ScriptKind): ScriptInfo; + getScriptInfo(uncheckedFileName: string): ScriptInfo; + getOrCreateScriptInfoForNormalizedPath(fileName: NormalizedPath, openedByClient: boolean, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean): ScriptInfo; + getScriptInfoForNormalizedPath(fileName: NormalizedPath): ScriptInfo; + getScriptInfoForPath(fileName: Path): ScriptInfo; + setHostConfiguration(args: protocol.ConfigureRequestArguments): void; + closeLog(): void; + reloadProjects(): void; + refreshInferredProjects(): void; + openClientFile(fileName: string, fileContent?: string, scriptKind?: ScriptKind): OpenConfiguredProjectResult; + openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean): OpenConfiguredProjectResult; + closeClientFile(uncheckedFileName: string): void; + private collectChanges(lastKnownProjectVersions, currentProjects, result); + private closeConfiguredProject(configFile); + closeExternalProject(uncheckedFileName: string, suppressRefresh?: boolean): void; + openExternalProjects(projects: protocol.ExternalProject[]): void; + private static filenameEscapeRegexp; + private static escapeFilenameForRegex(filename); + resetSafeList(): void; + loadSafeList(fileName: string): void; + applySafeList(proj: protocol.ExternalProject): void; + openExternalProject(proj: protocol.ExternalProject, suppressRefreshOfInferredProjects?: boolean): void; + } +} + +export = ts; +export as namespace ts; \ No newline at end of file diff --git a/node_modules/typescript/lib/tsserverlibrary.js b/node_modules/typescript/lib/tsserverlibrary.js index 4ed37099e..5acf5bb26 100644 --- a/node_modules/typescript/lib/tsserverlibrary.js +++ b/node_modules/typescript/lib/tsserverlibrary.js @@ -13,13 +13,455 @@ See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; }; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var ts; (function (ts) { + var SyntaxKind; + (function (SyntaxKind) { + SyntaxKind[SyntaxKind["Unknown"] = 0] = "Unknown"; + SyntaxKind[SyntaxKind["EndOfFileToken"] = 1] = "EndOfFileToken"; + SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 2] = "SingleLineCommentTrivia"; + SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 3] = "MultiLineCommentTrivia"; + SyntaxKind[SyntaxKind["NewLineTrivia"] = 4] = "NewLineTrivia"; + SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 5] = "WhitespaceTrivia"; + SyntaxKind[SyntaxKind["ShebangTrivia"] = 6] = "ShebangTrivia"; + SyntaxKind[SyntaxKind["ConflictMarkerTrivia"] = 7] = "ConflictMarkerTrivia"; + SyntaxKind[SyntaxKind["NumericLiteral"] = 8] = "NumericLiteral"; + SyntaxKind[SyntaxKind["StringLiteral"] = 9] = "StringLiteral"; + SyntaxKind[SyntaxKind["JsxText"] = 10] = "JsxText"; + SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 11] = "RegularExpressionLiteral"; + SyntaxKind[SyntaxKind["NoSubstitutionTemplateLiteral"] = 12] = "NoSubstitutionTemplateLiteral"; + SyntaxKind[SyntaxKind["TemplateHead"] = 13] = "TemplateHead"; + SyntaxKind[SyntaxKind["TemplateMiddle"] = 14] = "TemplateMiddle"; + SyntaxKind[SyntaxKind["TemplateTail"] = 15] = "TemplateTail"; + SyntaxKind[SyntaxKind["OpenBraceToken"] = 16] = "OpenBraceToken"; + SyntaxKind[SyntaxKind["CloseBraceToken"] = 17] = "CloseBraceToken"; + SyntaxKind[SyntaxKind["OpenParenToken"] = 18] = "OpenParenToken"; + SyntaxKind[SyntaxKind["CloseParenToken"] = 19] = "CloseParenToken"; + SyntaxKind[SyntaxKind["OpenBracketToken"] = 20] = "OpenBracketToken"; + SyntaxKind[SyntaxKind["CloseBracketToken"] = 21] = "CloseBracketToken"; + SyntaxKind[SyntaxKind["DotToken"] = 22] = "DotToken"; + SyntaxKind[SyntaxKind["DotDotDotToken"] = 23] = "DotDotDotToken"; + SyntaxKind[SyntaxKind["SemicolonToken"] = 24] = "SemicolonToken"; + SyntaxKind[SyntaxKind["CommaToken"] = 25] = "CommaToken"; + SyntaxKind[SyntaxKind["LessThanToken"] = 26] = "LessThanToken"; + SyntaxKind[SyntaxKind["LessThanSlashToken"] = 27] = "LessThanSlashToken"; + SyntaxKind[SyntaxKind["GreaterThanToken"] = 28] = "GreaterThanToken"; + SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 29] = "LessThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 30] = "GreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 31] = "EqualsEqualsToken"; + SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 32] = "ExclamationEqualsToken"; + SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 33] = "EqualsEqualsEqualsToken"; + SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 34] = "ExclamationEqualsEqualsToken"; + SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 35] = "EqualsGreaterThanToken"; + SyntaxKind[SyntaxKind["PlusToken"] = 36] = "PlusToken"; + SyntaxKind[SyntaxKind["MinusToken"] = 37] = "MinusToken"; + SyntaxKind[SyntaxKind["AsteriskToken"] = 38] = "AsteriskToken"; + SyntaxKind[SyntaxKind["AsteriskAsteriskToken"] = 39] = "AsteriskAsteriskToken"; + SyntaxKind[SyntaxKind["SlashToken"] = 40] = "SlashToken"; + SyntaxKind[SyntaxKind["PercentToken"] = 41] = "PercentToken"; + SyntaxKind[SyntaxKind["PlusPlusToken"] = 42] = "PlusPlusToken"; + SyntaxKind[SyntaxKind["MinusMinusToken"] = 43] = "MinusMinusToken"; + SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 44] = "LessThanLessThanToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 45] = "GreaterThanGreaterThanToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 46] = "GreaterThanGreaterThanGreaterThanToken"; + SyntaxKind[SyntaxKind["AmpersandToken"] = 47] = "AmpersandToken"; + SyntaxKind[SyntaxKind["BarToken"] = 48] = "BarToken"; + SyntaxKind[SyntaxKind["CaretToken"] = 49] = "CaretToken"; + SyntaxKind[SyntaxKind["ExclamationToken"] = 50] = "ExclamationToken"; + SyntaxKind[SyntaxKind["TildeToken"] = 51] = "TildeToken"; + SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 52] = "AmpersandAmpersandToken"; + SyntaxKind[SyntaxKind["BarBarToken"] = 53] = "BarBarToken"; + SyntaxKind[SyntaxKind["QuestionToken"] = 54] = "QuestionToken"; + SyntaxKind[SyntaxKind["ColonToken"] = 55] = "ColonToken"; + SyntaxKind[SyntaxKind["AtToken"] = 56] = "AtToken"; + SyntaxKind[SyntaxKind["EqualsToken"] = 57] = "EqualsToken"; + SyntaxKind[SyntaxKind["PlusEqualsToken"] = 58] = "PlusEqualsToken"; + SyntaxKind[SyntaxKind["MinusEqualsToken"] = 59] = "MinusEqualsToken"; + SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 60] = "AsteriskEqualsToken"; + SyntaxKind[SyntaxKind["AsteriskAsteriskEqualsToken"] = 61] = "AsteriskAsteriskEqualsToken"; + SyntaxKind[SyntaxKind["SlashEqualsToken"] = 62] = "SlashEqualsToken"; + SyntaxKind[SyntaxKind["PercentEqualsToken"] = 63] = "PercentEqualsToken"; + SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 64] = "LessThanLessThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 65] = "GreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 66] = "GreaterThanGreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 67] = "AmpersandEqualsToken"; + SyntaxKind[SyntaxKind["BarEqualsToken"] = 68] = "BarEqualsToken"; + SyntaxKind[SyntaxKind["CaretEqualsToken"] = 69] = "CaretEqualsToken"; + SyntaxKind[SyntaxKind["Identifier"] = 70] = "Identifier"; + SyntaxKind[SyntaxKind["BreakKeyword"] = 71] = "BreakKeyword"; + SyntaxKind[SyntaxKind["CaseKeyword"] = 72] = "CaseKeyword"; + SyntaxKind[SyntaxKind["CatchKeyword"] = 73] = "CatchKeyword"; + SyntaxKind[SyntaxKind["ClassKeyword"] = 74] = "ClassKeyword"; + SyntaxKind[SyntaxKind["ConstKeyword"] = 75] = "ConstKeyword"; + SyntaxKind[SyntaxKind["ContinueKeyword"] = 76] = "ContinueKeyword"; + SyntaxKind[SyntaxKind["DebuggerKeyword"] = 77] = "DebuggerKeyword"; + SyntaxKind[SyntaxKind["DefaultKeyword"] = 78] = "DefaultKeyword"; + SyntaxKind[SyntaxKind["DeleteKeyword"] = 79] = "DeleteKeyword"; + SyntaxKind[SyntaxKind["DoKeyword"] = 80] = "DoKeyword"; + SyntaxKind[SyntaxKind["ElseKeyword"] = 81] = "ElseKeyword"; + SyntaxKind[SyntaxKind["EnumKeyword"] = 82] = "EnumKeyword"; + SyntaxKind[SyntaxKind["ExportKeyword"] = 83] = "ExportKeyword"; + SyntaxKind[SyntaxKind["ExtendsKeyword"] = 84] = "ExtendsKeyword"; + SyntaxKind[SyntaxKind["FalseKeyword"] = 85] = "FalseKeyword"; + SyntaxKind[SyntaxKind["FinallyKeyword"] = 86] = "FinallyKeyword"; + SyntaxKind[SyntaxKind["ForKeyword"] = 87] = "ForKeyword"; + SyntaxKind[SyntaxKind["FunctionKeyword"] = 88] = "FunctionKeyword"; + SyntaxKind[SyntaxKind["IfKeyword"] = 89] = "IfKeyword"; + SyntaxKind[SyntaxKind["ImportKeyword"] = 90] = "ImportKeyword"; + SyntaxKind[SyntaxKind["InKeyword"] = 91] = "InKeyword"; + SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 92] = "InstanceOfKeyword"; + SyntaxKind[SyntaxKind["NewKeyword"] = 93] = "NewKeyword"; + SyntaxKind[SyntaxKind["NullKeyword"] = 94] = "NullKeyword"; + SyntaxKind[SyntaxKind["ReturnKeyword"] = 95] = "ReturnKeyword"; + SyntaxKind[SyntaxKind["SuperKeyword"] = 96] = "SuperKeyword"; + SyntaxKind[SyntaxKind["SwitchKeyword"] = 97] = "SwitchKeyword"; + SyntaxKind[SyntaxKind["ThisKeyword"] = 98] = "ThisKeyword"; + SyntaxKind[SyntaxKind["ThrowKeyword"] = 99] = "ThrowKeyword"; + SyntaxKind[SyntaxKind["TrueKeyword"] = 100] = "TrueKeyword"; + SyntaxKind[SyntaxKind["TryKeyword"] = 101] = "TryKeyword"; + SyntaxKind[SyntaxKind["TypeOfKeyword"] = 102] = "TypeOfKeyword"; + SyntaxKind[SyntaxKind["VarKeyword"] = 103] = "VarKeyword"; + SyntaxKind[SyntaxKind["VoidKeyword"] = 104] = "VoidKeyword"; + SyntaxKind[SyntaxKind["WhileKeyword"] = 105] = "WhileKeyword"; + SyntaxKind[SyntaxKind["WithKeyword"] = 106] = "WithKeyword"; + SyntaxKind[SyntaxKind["ImplementsKeyword"] = 107] = "ImplementsKeyword"; + SyntaxKind[SyntaxKind["InterfaceKeyword"] = 108] = "InterfaceKeyword"; + SyntaxKind[SyntaxKind["LetKeyword"] = 109] = "LetKeyword"; + SyntaxKind[SyntaxKind["PackageKeyword"] = 110] = "PackageKeyword"; + SyntaxKind[SyntaxKind["PrivateKeyword"] = 111] = "PrivateKeyword"; + SyntaxKind[SyntaxKind["ProtectedKeyword"] = 112] = "ProtectedKeyword"; + SyntaxKind[SyntaxKind["PublicKeyword"] = 113] = "PublicKeyword"; + SyntaxKind[SyntaxKind["StaticKeyword"] = 114] = "StaticKeyword"; + SyntaxKind[SyntaxKind["YieldKeyword"] = 115] = "YieldKeyword"; + SyntaxKind[SyntaxKind["AbstractKeyword"] = 116] = "AbstractKeyword"; + SyntaxKind[SyntaxKind["AsKeyword"] = 117] = "AsKeyword"; + SyntaxKind[SyntaxKind["AnyKeyword"] = 118] = "AnyKeyword"; + SyntaxKind[SyntaxKind["AsyncKeyword"] = 119] = "AsyncKeyword"; + SyntaxKind[SyntaxKind["AwaitKeyword"] = 120] = "AwaitKeyword"; + SyntaxKind[SyntaxKind["BooleanKeyword"] = 121] = "BooleanKeyword"; + SyntaxKind[SyntaxKind["ConstructorKeyword"] = 122] = "ConstructorKeyword"; + SyntaxKind[SyntaxKind["DeclareKeyword"] = 123] = "DeclareKeyword"; + SyntaxKind[SyntaxKind["GetKeyword"] = 124] = "GetKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 125] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 126] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 127] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 128] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 129] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 130] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 131] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 132] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 133] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 134] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 135] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 136] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 137] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 138] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 139] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 140] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 141] = "OfKeyword"; + SyntaxKind[SyntaxKind["QualifiedName"] = 142] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 143] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["TypeParameter"] = 144] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 145] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 146] = "Decorator"; + SyntaxKind[SyntaxKind["PropertySignature"] = 147] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 148] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 149] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 150] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 151] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 152] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 153] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 154] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 155] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 156] = "IndexSignature"; + SyntaxKind[SyntaxKind["TypePredicate"] = 157] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 158] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 159] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 160] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 161] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 162] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 163] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 164] = "TupleType"; + SyntaxKind[SyntaxKind["UnionType"] = 165] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 166] = "IntersectionType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 167] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 168] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 169] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 170] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 171] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 172] = "LiteralType"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 173] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 174] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 175] = "BindingElement"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 176] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 177] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 178] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 179] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 180] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 181] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 182] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 183] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 184] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 185] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 186] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 187] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 188] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 189] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 190] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 191] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 192] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 193] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 194] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 195] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 196] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 197] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 198] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 199] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 200] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 201] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 202] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 203] = "MetaProperty"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 204] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 205] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["Block"] = 206] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 207] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 208] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 209] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 210] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 211] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 212] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 213] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 214] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 215] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 216] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 217] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 218] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 219] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 220] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 221] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 222] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 223] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 224] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 225] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 226] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 227] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 228] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 229] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 230] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 231] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 232] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 233] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 234] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 235] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 236] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 237] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 238] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 239] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 240] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 241] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 242] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 243] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 244] = "NamedExports"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 245] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 246] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 247] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["JsxElement"] = 248] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 249] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 250] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 251] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 252] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 253] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 254] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 255] = "JsxExpression"; + SyntaxKind[SyntaxKind["CaseClause"] = 256] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 257] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 258] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 259] = "CatchClause"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 260] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 261] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 262] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["EnumMember"] = 263] = "EnumMember"; + SyntaxKind[SyntaxKind["SourceFile"] = 264] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 265] = "Bundle"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 266] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 267] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 268] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocArrayType"] = 269] = "JSDocArrayType"; + SyntaxKind[SyntaxKind["JSDocUnionType"] = 270] = "JSDocUnionType"; + SyntaxKind[SyntaxKind["JSDocTupleType"] = 271] = "JSDocTupleType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 272] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 273] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocRecordType"] = 274] = "JSDocRecordType"; + SyntaxKind[SyntaxKind["JSDocRecordMember"] = 275] = "JSDocRecordMember"; + SyntaxKind[SyntaxKind["JSDocTypeReference"] = 276] = "JSDocTypeReference"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 277] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 278] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 279] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocConstructorType"] = 280] = "JSDocConstructorType"; + SyntaxKind[SyntaxKind["JSDocThisType"] = 281] = "JSDocThisType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 282] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTag"] = 283] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 284] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 285] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 286] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 287] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 288] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 289] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 290] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 291] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocLiteralType"] = 292] = "JSDocLiteralType"; + SyntaxKind[SyntaxKind["SyntaxList"] = 293] = "SyntaxList"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 294] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 295] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 296] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 297] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["Count"] = 298] = "Count"; + SyntaxKind[SyntaxKind["FirstAssignment"] = 57] = "FirstAssignment"; + SyntaxKind[SyntaxKind["LastAssignment"] = 69] = "LastAssignment"; + SyntaxKind[SyntaxKind["FirstCompoundAssignment"] = 58] = "FirstCompoundAssignment"; + SyntaxKind[SyntaxKind["LastCompoundAssignment"] = 69] = "LastCompoundAssignment"; + SyntaxKind[SyntaxKind["FirstReservedWord"] = 71] = "FirstReservedWord"; + SyntaxKind[SyntaxKind["LastReservedWord"] = 106] = "LastReservedWord"; + SyntaxKind[SyntaxKind["FirstKeyword"] = 71] = "FirstKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 141] = "LastKeyword"; + SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 107] = "FirstFutureReservedWord"; + SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 115] = "LastFutureReservedWord"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 157] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 172] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstPunctuation"] = 16] = "FirstPunctuation"; + SyntaxKind[SyntaxKind["LastPunctuation"] = 69] = "LastPunctuation"; + SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; + SyntaxKind[SyntaxKind["LastToken"] = 141] = "LastToken"; + SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; + SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; + SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; + SyntaxKind[SyntaxKind["LastLiteralToken"] = 12] = "LastLiteralToken"; + SyntaxKind[SyntaxKind["FirstTemplateToken"] = 12] = "FirstTemplateToken"; + SyntaxKind[SyntaxKind["LastTemplateToken"] = 15] = "LastTemplateToken"; + SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 26] = "FirstBinaryOperator"; + SyntaxKind[SyntaxKind["LastBinaryOperator"] = 69] = "LastBinaryOperator"; + SyntaxKind[SyntaxKind["FirstNode"] = 142] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 266] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 292] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 282] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 292] = "LastJSDocTagNode"; + })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); + var NodeFlags; + (function (NodeFlags) { + NodeFlags[NodeFlags["None"] = 0] = "None"; + NodeFlags[NodeFlags["Let"] = 1] = "Let"; + NodeFlags[NodeFlags["Const"] = 2] = "Const"; + NodeFlags[NodeFlags["NestedNamespace"] = 4] = "NestedNamespace"; + NodeFlags[NodeFlags["Synthesized"] = 8] = "Synthesized"; + NodeFlags[NodeFlags["Namespace"] = 16] = "Namespace"; + NodeFlags[NodeFlags["ExportContext"] = 32] = "ExportContext"; + NodeFlags[NodeFlags["ContainsThis"] = 64] = "ContainsThis"; + NodeFlags[NodeFlags["HasImplicitReturn"] = 128] = "HasImplicitReturn"; + NodeFlags[NodeFlags["HasExplicitReturn"] = 256] = "HasExplicitReturn"; + NodeFlags[NodeFlags["GlobalAugmentation"] = 512] = "GlobalAugmentation"; + NodeFlags[NodeFlags["HasAsyncFunctions"] = 1024] = "HasAsyncFunctions"; + NodeFlags[NodeFlags["DisallowInContext"] = 2048] = "DisallowInContext"; + NodeFlags[NodeFlags["YieldContext"] = 4096] = "YieldContext"; + NodeFlags[NodeFlags["DecoratorContext"] = 8192] = "DecoratorContext"; + NodeFlags[NodeFlags["AwaitContext"] = 16384] = "AwaitContext"; + NodeFlags[NodeFlags["ThisNodeHasError"] = 32768] = "ThisNodeHasError"; + NodeFlags[NodeFlags["JavaScriptFile"] = 65536] = "JavaScriptFile"; + NodeFlags[NodeFlags["ThisNodeOrAnySubNodesHasError"] = 131072] = "ThisNodeOrAnySubNodesHasError"; + NodeFlags[NodeFlags["HasAggregatedChildData"] = 262144] = "HasAggregatedChildData"; + NodeFlags[NodeFlags["BlockScoped"] = 3] = "BlockScoped"; + NodeFlags[NodeFlags["ReachabilityCheckFlags"] = 384] = "ReachabilityCheckFlags"; + NodeFlags[NodeFlags["ReachabilityAndEmitFlags"] = 1408] = "ReachabilityAndEmitFlags"; + NodeFlags[NodeFlags["ContextFlags"] = 96256] = "ContextFlags"; + NodeFlags[NodeFlags["TypeExcludesFlags"] = 20480] = "TypeExcludesFlags"; + })(NodeFlags = ts.NodeFlags || (ts.NodeFlags = {})); + var ModifierFlags; + (function (ModifierFlags) { + ModifierFlags[ModifierFlags["None"] = 0] = "None"; + ModifierFlags[ModifierFlags["Export"] = 1] = "Export"; + ModifierFlags[ModifierFlags["Ambient"] = 2] = "Ambient"; + ModifierFlags[ModifierFlags["Public"] = 4] = "Public"; + ModifierFlags[ModifierFlags["Private"] = 8] = "Private"; + ModifierFlags[ModifierFlags["Protected"] = 16] = "Protected"; + ModifierFlags[ModifierFlags["Static"] = 32] = "Static"; + ModifierFlags[ModifierFlags["Readonly"] = 64] = "Readonly"; + ModifierFlags[ModifierFlags["Abstract"] = 128] = "Abstract"; + ModifierFlags[ModifierFlags["Async"] = 256] = "Async"; + ModifierFlags[ModifierFlags["Default"] = 512] = "Default"; + ModifierFlags[ModifierFlags["Const"] = 2048] = "Const"; + ModifierFlags[ModifierFlags["HasComputedFlags"] = 536870912] = "HasComputedFlags"; + ModifierFlags[ModifierFlags["AccessibilityModifier"] = 28] = "AccessibilityModifier"; + ModifierFlags[ModifierFlags["ParameterPropertyModifier"] = 92] = "ParameterPropertyModifier"; + ModifierFlags[ModifierFlags["NonPublicAccessibilityModifier"] = 24] = "NonPublicAccessibilityModifier"; + ModifierFlags[ModifierFlags["TypeScriptModifier"] = 2270] = "TypeScriptModifier"; + ModifierFlags[ModifierFlags["ExportDefault"] = 513] = "ExportDefault"; + })(ModifierFlags = ts.ModifierFlags || (ts.ModifierFlags = {})); + var JsxFlags; + (function (JsxFlags) { + JsxFlags[JsxFlags["None"] = 0] = "None"; + JsxFlags[JsxFlags["IntrinsicNamedElement"] = 1] = "IntrinsicNamedElement"; + JsxFlags[JsxFlags["IntrinsicIndexedElement"] = 2] = "IntrinsicIndexedElement"; + JsxFlags[JsxFlags["IntrinsicElement"] = 3] = "IntrinsicElement"; + })(JsxFlags = ts.JsxFlags || (ts.JsxFlags = {})); + var RelationComparisonResult; + (function (RelationComparisonResult) { + RelationComparisonResult[RelationComparisonResult["Succeeded"] = 1] = "Succeeded"; + RelationComparisonResult[RelationComparisonResult["Failed"] = 2] = "Failed"; + RelationComparisonResult[RelationComparisonResult["FailedAndReported"] = 3] = "FailedAndReported"; + })(RelationComparisonResult = ts.RelationComparisonResult || (ts.RelationComparisonResult = {})); + var GeneratedIdentifierKind; + (function (GeneratedIdentifierKind) { + GeneratedIdentifierKind[GeneratedIdentifierKind["None"] = 0] = "None"; + GeneratedIdentifierKind[GeneratedIdentifierKind["Auto"] = 1] = "Auto"; + GeneratedIdentifierKind[GeneratedIdentifierKind["Loop"] = 2] = "Loop"; + GeneratedIdentifierKind[GeneratedIdentifierKind["Unique"] = 3] = "Unique"; + GeneratedIdentifierKind[GeneratedIdentifierKind["Node"] = 4] = "Node"; + })(GeneratedIdentifierKind = ts.GeneratedIdentifierKind || (ts.GeneratedIdentifierKind = {})); + var NumericLiteralFlags; + (function (NumericLiteralFlags) { + NumericLiteralFlags[NumericLiteralFlags["None"] = 0] = "None"; + NumericLiteralFlags[NumericLiteralFlags["Scientific"] = 2] = "Scientific"; + NumericLiteralFlags[NumericLiteralFlags["Octal"] = 4] = "Octal"; + NumericLiteralFlags[NumericLiteralFlags["HexSpecifier"] = 8] = "HexSpecifier"; + NumericLiteralFlags[NumericLiteralFlags["BinarySpecifier"] = 16] = "BinarySpecifier"; + NumericLiteralFlags[NumericLiteralFlags["OctalSpecifier"] = 32] = "OctalSpecifier"; + NumericLiteralFlags[NumericLiteralFlags["BinaryOrOctalSpecifier"] = 48] = "BinaryOrOctalSpecifier"; + })(NumericLiteralFlags = ts.NumericLiteralFlags || (ts.NumericLiteralFlags = {})); + var FlowFlags; + (function (FlowFlags) { + FlowFlags[FlowFlags["Unreachable"] = 1] = "Unreachable"; + FlowFlags[FlowFlags["Start"] = 2] = "Start"; + FlowFlags[FlowFlags["BranchLabel"] = 4] = "BranchLabel"; + FlowFlags[FlowFlags["LoopLabel"] = 8] = "LoopLabel"; + FlowFlags[FlowFlags["Assignment"] = 16] = "Assignment"; + FlowFlags[FlowFlags["TrueCondition"] = 32] = "TrueCondition"; + FlowFlags[FlowFlags["FalseCondition"] = 64] = "FalseCondition"; + FlowFlags[FlowFlags["SwitchClause"] = 128] = "SwitchClause"; + FlowFlags[FlowFlags["ArrayMutation"] = 256] = "ArrayMutation"; + FlowFlags[FlowFlags["Referenced"] = 512] = "Referenced"; + FlowFlags[FlowFlags["Shared"] = 1024] = "Shared"; + FlowFlags[FlowFlags["PreFinally"] = 2048] = "PreFinally"; + FlowFlags[FlowFlags["AfterFinally"] = 4096] = "AfterFinally"; + FlowFlags[FlowFlags["Label"] = 12] = "Label"; + FlowFlags[FlowFlags["Condition"] = 96] = "Condition"; + })(FlowFlags = ts.FlowFlags || (ts.FlowFlags = {})); var OperationCanceledException = (function () { function OperationCanceledException() { } @@ -32,6 +474,55 @@ var ts; ExitStatus[ExitStatus["DiagnosticsPresent_OutputsSkipped"] = 1] = "DiagnosticsPresent_OutputsSkipped"; ExitStatus[ExitStatus["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated"; })(ExitStatus = ts.ExitStatus || (ts.ExitStatus = {})); + var NodeBuilderFlags; + (function (NodeBuilderFlags) { + NodeBuilderFlags[NodeBuilderFlags["None"] = 0] = "None"; + NodeBuilderFlags[NodeBuilderFlags["allowThisInObjectLiteral"] = 1] = "allowThisInObjectLiteral"; + NodeBuilderFlags[NodeBuilderFlags["allowQualifedNameInPlaceOfIdentifier"] = 2] = "allowQualifedNameInPlaceOfIdentifier"; + NodeBuilderFlags[NodeBuilderFlags["allowTypeParameterInQualifiedName"] = 4] = "allowTypeParameterInQualifiedName"; + NodeBuilderFlags[NodeBuilderFlags["allowAnonymousIdentifier"] = 8] = "allowAnonymousIdentifier"; + NodeBuilderFlags[NodeBuilderFlags["allowEmptyUnionOrIntersection"] = 16] = "allowEmptyUnionOrIntersection"; + NodeBuilderFlags[NodeBuilderFlags["allowEmptyTuple"] = 32] = "allowEmptyTuple"; + })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {})); + var TypeFormatFlags; + (function (TypeFormatFlags) { + TypeFormatFlags[TypeFormatFlags["None"] = 0] = "None"; + TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 1] = "WriteArrayAsGenericType"; + TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 2] = "UseTypeOfFunction"; + TypeFormatFlags[TypeFormatFlags["NoTruncation"] = 4] = "NoTruncation"; + TypeFormatFlags[TypeFormatFlags["WriteArrowStyleSignature"] = 8] = "WriteArrowStyleSignature"; + TypeFormatFlags[TypeFormatFlags["WriteOwnNameForAnyLike"] = 16] = "WriteOwnNameForAnyLike"; + TypeFormatFlags[TypeFormatFlags["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature"; + TypeFormatFlags[TypeFormatFlags["InElementType"] = 64] = "InElementType"; + TypeFormatFlags[TypeFormatFlags["UseFullyQualifiedType"] = 128] = "UseFullyQualifiedType"; + TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 256] = "InFirstTypeArgument"; + TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 512] = "InTypeAlias"; + TypeFormatFlags[TypeFormatFlags["UseTypeAliasValue"] = 1024] = "UseTypeAliasValue"; + TypeFormatFlags[TypeFormatFlags["SuppressAnyReturnType"] = 2048] = "SuppressAnyReturnType"; + TypeFormatFlags[TypeFormatFlags["AddUndefined"] = 4096] = "AddUndefined"; + })(TypeFormatFlags = ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); + var SymbolFormatFlags; + (function (SymbolFormatFlags) { + SymbolFormatFlags[SymbolFormatFlags["None"] = 0] = "None"; + SymbolFormatFlags[SymbolFormatFlags["WriteTypeParametersOrArguments"] = 1] = "WriteTypeParametersOrArguments"; + SymbolFormatFlags[SymbolFormatFlags["UseOnlyExternalAliasing"] = 2] = "UseOnlyExternalAliasing"; + })(SymbolFormatFlags = ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {})); + var SymbolAccessibility; + (function (SymbolAccessibility) { + SymbolAccessibility[SymbolAccessibility["Accessible"] = 0] = "Accessible"; + SymbolAccessibility[SymbolAccessibility["NotAccessible"] = 1] = "NotAccessible"; + SymbolAccessibility[SymbolAccessibility["CannotBeNamed"] = 2] = "CannotBeNamed"; + })(SymbolAccessibility = ts.SymbolAccessibility || (ts.SymbolAccessibility = {})); + var SyntheticSymbolKind; + (function (SyntheticSymbolKind) { + SyntheticSymbolKind[SyntheticSymbolKind["UnionOrIntersection"] = 0] = "UnionOrIntersection"; + SyntheticSymbolKind[SyntheticSymbolKind["Spread"] = 1] = "Spread"; + })(SyntheticSymbolKind = ts.SyntheticSymbolKind || (ts.SyntheticSymbolKind = {})); + var TypePredicateKind; + (function (TypePredicateKind) { + TypePredicateKind[TypePredicateKind["This"] = 0] = "This"; + TypePredicateKind[TypePredicateKind["Identifier"] = 1] = "Identifier"; + })(TypePredicateKind = ts.TypePredicateKind || (ts.TypePredicateKind = {})); var TypeReferenceSerializationKind; (function (TypeReferenceSerializationKind) { TypeReferenceSerializationKind[TypeReferenceSerializationKind["Unknown"] = 0] = "Unknown"; @@ -46,6 +537,191 @@ var ts; TypeReferenceSerializationKind[TypeReferenceSerializationKind["TypeWithCallSignature"] = 9] = "TypeWithCallSignature"; TypeReferenceSerializationKind[TypeReferenceSerializationKind["ObjectType"] = 10] = "ObjectType"; })(TypeReferenceSerializationKind = ts.TypeReferenceSerializationKind || (ts.TypeReferenceSerializationKind = {})); + var SymbolFlags; + (function (SymbolFlags) { + SymbolFlags[SymbolFlags["None"] = 0] = "None"; + SymbolFlags[SymbolFlags["FunctionScopedVariable"] = 1] = "FunctionScopedVariable"; + SymbolFlags[SymbolFlags["BlockScopedVariable"] = 2] = "BlockScopedVariable"; + SymbolFlags[SymbolFlags["Property"] = 4] = "Property"; + SymbolFlags[SymbolFlags["EnumMember"] = 8] = "EnumMember"; + SymbolFlags[SymbolFlags["Function"] = 16] = "Function"; + SymbolFlags[SymbolFlags["Class"] = 32] = "Class"; + SymbolFlags[SymbolFlags["Interface"] = 64] = "Interface"; + SymbolFlags[SymbolFlags["ConstEnum"] = 128] = "ConstEnum"; + SymbolFlags[SymbolFlags["RegularEnum"] = 256] = "RegularEnum"; + SymbolFlags[SymbolFlags["ValueModule"] = 512] = "ValueModule"; + SymbolFlags[SymbolFlags["NamespaceModule"] = 1024] = "NamespaceModule"; + SymbolFlags[SymbolFlags["TypeLiteral"] = 2048] = "TypeLiteral"; + SymbolFlags[SymbolFlags["ObjectLiteral"] = 4096] = "ObjectLiteral"; + SymbolFlags[SymbolFlags["Method"] = 8192] = "Method"; + SymbolFlags[SymbolFlags["Constructor"] = 16384] = "Constructor"; + SymbolFlags[SymbolFlags["GetAccessor"] = 32768] = "GetAccessor"; + SymbolFlags[SymbolFlags["SetAccessor"] = 65536] = "SetAccessor"; + SymbolFlags[SymbolFlags["Signature"] = 131072] = "Signature"; + SymbolFlags[SymbolFlags["TypeParameter"] = 262144] = "TypeParameter"; + SymbolFlags[SymbolFlags["TypeAlias"] = 524288] = "TypeAlias"; + SymbolFlags[SymbolFlags["ExportValue"] = 1048576] = "ExportValue"; + SymbolFlags[SymbolFlags["ExportType"] = 2097152] = "ExportType"; + SymbolFlags[SymbolFlags["ExportNamespace"] = 4194304] = "ExportNamespace"; + SymbolFlags[SymbolFlags["Alias"] = 8388608] = "Alias"; + SymbolFlags[SymbolFlags["Prototype"] = 16777216] = "Prototype"; + SymbolFlags[SymbolFlags["ExportStar"] = 33554432] = "ExportStar"; + SymbolFlags[SymbolFlags["Optional"] = 67108864] = "Optional"; + SymbolFlags[SymbolFlags["Transient"] = 134217728] = "Transient"; + SymbolFlags[SymbolFlags["Enum"] = 384] = "Enum"; + SymbolFlags[SymbolFlags["Variable"] = 3] = "Variable"; + SymbolFlags[SymbolFlags["Value"] = 107455] = "Value"; + SymbolFlags[SymbolFlags["Type"] = 793064] = "Type"; + SymbolFlags[SymbolFlags["Namespace"] = 1920] = "Namespace"; + SymbolFlags[SymbolFlags["Module"] = 1536] = "Module"; + SymbolFlags[SymbolFlags["Accessor"] = 98304] = "Accessor"; + SymbolFlags[SymbolFlags["FunctionScopedVariableExcludes"] = 107454] = "FunctionScopedVariableExcludes"; + SymbolFlags[SymbolFlags["BlockScopedVariableExcludes"] = 107455] = "BlockScopedVariableExcludes"; + SymbolFlags[SymbolFlags["ParameterExcludes"] = 107455] = "ParameterExcludes"; + SymbolFlags[SymbolFlags["PropertyExcludes"] = 0] = "PropertyExcludes"; + SymbolFlags[SymbolFlags["EnumMemberExcludes"] = 900095] = "EnumMemberExcludes"; + SymbolFlags[SymbolFlags["FunctionExcludes"] = 106927] = "FunctionExcludes"; + SymbolFlags[SymbolFlags["ClassExcludes"] = 899519] = "ClassExcludes"; + SymbolFlags[SymbolFlags["InterfaceExcludes"] = 792968] = "InterfaceExcludes"; + SymbolFlags[SymbolFlags["RegularEnumExcludes"] = 899327] = "RegularEnumExcludes"; + SymbolFlags[SymbolFlags["ConstEnumExcludes"] = 899967] = "ConstEnumExcludes"; + SymbolFlags[SymbolFlags["ValueModuleExcludes"] = 106639] = "ValueModuleExcludes"; + SymbolFlags[SymbolFlags["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes"; + SymbolFlags[SymbolFlags["MethodExcludes"] = 99263] = "MethodExcludes"; + SymbolFlags[SymbolFlags["GetAccessorExcludes"] = 41919] = "GetAccessorExcludes"; + SymbolFlags[SymbolFlags["SetAccessorExcludes"] = 74687] = "SetAccessorExcludes"; + SymbolFlags[SymbolFlags["TypeParameterExcludes"] = 530920] = "TypeParameterExcludes"; + SymbolFlags[SymbolFlags["TypeAliasExcludes"] = 793064] = "TypeAliasExcludes"; + SymbolFlags[SymbolFlags["AliasExcludes"] = 8388608] = "AliasExcludes"; + SymbolFlags[SymbolFlags["ModuleMember"] = 8914931] = "ModuleMember"; + SymbolFlags[SymbolFlags["ExportHasLocal"] = 944] = "ExportHasLocal"; + SymbolFlags[SymbolFlags["HasExports"] = 1952] = "HasExports"; + SymbolFlags[SymbolFlags["HasMembers"] = 6240] = "HasMembers"; + SymbolFlags[SymbolFlags["BlockScoped"] = 418] = "BlockScoped"; + SymbolFlags[SymbolFlags["PropertyOrAccessor"] = 98308] = "PropertyOrAccessor"; + SymbolFlags[SymbolFlags["Export"] = 7340032] = "Export"; + SymbolFlags[SymbolFlags["ClassMember"] = 106500] = "ClassMember"; + SymbolFlags[SymbolFlags["Classifiable"] = 788448] = "Classifiable"; + })(SymbolFlags = ts.SymbolFlags || (ts.SymbolFlags = {})); + var CheckFlags; + (function (CheckFlags) { + CheckFlags[CheckFlags["Instantiated"] = 1] = "Instantiated"; + CheckFlags[CheckFlags["SyntheticProperty"] = 2] = "SyntheticProperty"; + CheckFlags[CheckFlags["SyntheticMethod"] = 4] = "SyntheticMethod"; + CheckFlags[CheckFlags["Readonly"] = 8] = "Readonly"; + CheckFlags[CheckFlags["Partial"] = 16] = "Partial"; + CheckFlags[CheckFlags["HasNonUniformType"] = 32] = "HasNonUniformType"; + CheckFlags[CheckFlags["ContainsPublic"] = 64] = "ContainsPublic"; + CheckFlags[CheckFlags["ContainsProtected"] = 128] = "ContainsProtected"; + CheckFlags[CheckFlags["ContainsPrivate"] = 256] = "ContainsPrivate"; + CheckFlags[CheckFlags["ContainsStatic"] = 512] = "ContainsStatic"; + CheckFlags[CheckFlags["Synthetic"] = 6] = "Synthetic"; + })(CheckFlags = ts.CheckFlags || (ts.CheckFlags = {})); + var NodeCheckFlags; + (function (NodeCheckFlags) { + NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 1] = "TypeChecked"; + NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 2] = "LexicalThis"; + NodeCheckFlags[NodeCheckFlags["CaptureThis"] = 4] = "CaptureThis"; + NodeCheckFlags[NodeCheckFlags["CaptureNewTarget"] = 8] = "CaptureNewTarget"; + NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 256] = "SuperInstance"; + NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 512] = "SuperStatic"; + NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 1024] = "ContextChecked"; + NodeCheckFlags[NodeCheckFlags["AsyncMethodWithSuper"] = 2048] = "AsyncMethodWithSuper"; + NodeCheckFlags[NodeCheckFlags["AsyncMethodWithSuperBinding"] = 4096] = "AsyncMethodWithSuperBinding"; + NodeCheckFlags[NodeCheckFlags["CaptureArguments"] = 8192] = "CaptureArguments"; + NodeCheckFlags[NodeCheckFlags["EnumValuesComputed"] = 16384] = "EnumValuesComputed"; + NodeCheckFlags[NodeCheckFlags["LexicalModuleMergesWithClass"] = 32768] = "LexicalModuleMergesWithClass"; + NodeCheckFlags[NodeCheckFlags["LoopWithCapturedBlockScopedBinding"] = 65536] = "LoopWithCapturedBlockScopedBinding"; + NodeCheckFlags[NodeCheckFlags["CapturedBlockScopedBinding"] = 131072] = "CapturedBlockScopedBinding"; + NodeCheckFlags[NodeCheckFlags["BlockScopedBindingInLoop"] = 262144] = "BlockScopedBindingInLoop"; + NodeCheckFlags[NodeCheckFlags["ClassWithBodyScopedClassBinding"] = 524288] = "ClassWithBodyScopedClassBinding"; + NodeCheckFlags[NodeCheckFlags["BodyScopedClassBinding"] = 1048576] = "BodyScopedClassBinding"; + NodeCheckFlags[NodeCheckFlags["NeedsLoopOutParameter"] = 2097152] = "NeedsLoopOutParameter"; + NodeCheckFlags[NodeCheckFlags["AssignmentsMarked"] = 4194304] = "AssignmentsMarked"; + NodeCheckFlags[NodeCheckFlags["ClassWithConstructorReference"] = 8388608] = "ClassWithConstructorReference"; + NodeCheckFlags[NodeCheckFlags["ConstructorReferenceInClass"] = 16777216] = "ConstructorReferenceInClass"; + })(NodeCheckFlags = ts.NodeCheckFlags || (ts.NodeCheckFlags = {})); + var TypeFlags; + (function (TypeFlags) { + TypeFlags[TypeFlags["Any"] = 1] = "Any"; + TypeFlags[TypeFlags["String"] = 2] = "String"; + TypeFlags[TypeFlags["Number"] = 4] = "Number"; + TypeFlags[TypeFlags["Boolean"] = 8] = "Boolean"; + TypeFlags[TypeFlags["Enum"] = 16] = "Enum"; + TypeFlags[TypeFlags["StringLiteral"] = 32] = "StringLiteral"; + TypeFlags[TypeFlags["NumberLiteral"] = 64] = "NumberLiteral"; + TypeFlags[TypeFlags["BooleanLiteral"] = 128] = "BooleanLiteral"; + TypeFlags[TypeFlags["EnumLiteral"] = 256] = "EnumLiteral"; + TypeFlags[TypeFlags["ESSymbol"] = 512] = "ESSymbol"; + TypeFlags[TypeFlags["Void"] = 1024] = "Void"; + TypeFlags[TypeFlags["Undefined"] = 2048] = "Undefined"; + TypeFlags[TypeFlags["Null"] = 4096] = "Null"; + TypeFlags[TypeFlags["Never"] = 8192] = "Never"; + TypeFlags[TypeFlags["TypeParameter"] = 16384] = "TypeParameter"; + TypeFlags[TypeFlags["Object"] = 32768] = "Object"; + TypeFlags[TypeFlags["Union"] = 65536] = "Union"; + TypeFlags[TypeFlags["Intersection"] = 131072] = "Intersection"; + TypeFlags[TypeFlags["Index"] = 262144] = "Index"; + TypeFlags[TypeFlags["IndexedAccess"] = 524288] = "IndexedAccess"; + TypeFlags[TypeFlags["FreshLiteral"] = 1048576] = "FreshLiteral"; + TypeFlags[TypeFlags["ContainsWideningType"] = 2097152] = "ContainsWideningType"; + TypeFlags[TypeFlags["ContainsObjectLiteral"] = 4194304] = "ContainsObjectLiteral"; + TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 8388608] = "ContainsAnyFunctionType"; + TypeFlags[TypeFlags["NonPrimitive"] = 16777216] = "NonPrimitive"; + TypeFlags[TypeFlags["JsxAttributes"] = 33554432] = "JsxAttributes"; + TypeFlags[TypeFlags["Nullable"] = 6144] = "Nullable"; + TypeFlags[TypeFlags["Literal"] = 480] = "Literal"; + TypeFlags[TypeFlags["StringOrNumberLiteral"] = 96] = "StringOrNumberLiteral"; + TypeFlags[TypeFlags["DefinitelyFalsy"] = 7392] = "DefinitelyFalsy"; + TypeFlags[TypeFlags["PossiblyFalsy"] = 7406] = "PossiblyFalsy"; + TypeFlags[TypeFlags["Intrinsic"] = 16793231] = "Intrinsic"; + TypeFlags[TypeFlags["Primitive"] = 8190] = "Primitive"; + TypeFlags[TypeFlags["StringLike"] = 262178] = "StringLike"; + TypeFlags[TypeFlags["NumberLike"] = 340] = "NumberLike"; + TypeFlags[TypeFlags["BooleanLike"] = 136] = "BooleanLike"; + TypeFlags[TypeFlags["EnumLike"] = 272] = "EnumLike"; + TypeFlags[TypeFlags["UnionOrIntersection"] = 196608] = "UnionOrIntersection"; + TypeFlags[TypeFlags["StructuredType"] = 229376] = "StructuredType"; + TypeFlags[TypeFlags["StructuredOrTypeVariable"] = 1032192] = "StructuredOrTypeVariable"; + TypeFlags[TypeFlags["TypeVariable"] = 540672] = "TypeVariable"; + TypeFlags[TypeFlags["Narrowable"] = 17810431] = "Narrowable"; + TypeFlags[TypeFlags["NotUnionOrUnit"] = 16810497] = "NotUnionOrUnit"; + TypeFlags[TypeFlags["RequiresWidening"] = 6291456] = "RequiresWidening"; + TypeFlags[TypeFlags["PropagatingFlags"] = 14680064] = "PropagatingFlags"; + })(TypeFlags = ts.TypeFlags || (ts.TypeFlags = {})); + var ObjectFlags; + (function (ObjectFlags) { + ObjectFlags[ObjectFlags["Class"] = 1] = "Class"; + ObjectFlags[ObjectFlags["Interface"] = 2] = "Interface"; + ObjectFlags[ObjectFlags["Reference"] = 4] = "Reference"; + ObjectFlags[ObjectFlags["Tuple"] = 8] = "Tuple"; + ObjectFlags[ObjectFlags["Anonymous"] = 16] = "Anonymous"; + ObjectFlags[ObjectFlags["Mapped"] = 32] = "Mapped"; + ObjectFlags[ObjectFlags["Instantiated"] = 64] = "Instantiated"; + ObjectFlags[ObjectFlags["ObjectLiteral"] = 128] = "ObjectLiteral"; + ObjectFlags[ObjectFlags["EvolvingArray"] = 256] = "EvolvingArray"; + ObjectFlags[ObjectFlags["ObjectLiteralPatternWithComputedProperties"] = 512] = "ObjectLiteralPatternWithComputedProperties"; + ObjectFlags[ObjectFlags["ClassOrInterface"] = 3] = "ClassOrInterface"; + })(ObjectFlags = ts.ObjectFlags || (ts.ObjectFlags = {})); + var SignatureKind; + (function (SignatureKind) { + SignatureKind[SignatureKind["Call"] = 0] = "Call"; + SignatureKind[SignatureKind["Construct"] = 1] = "Construct"; + })(SignatureKind = ts.SignatureKind || (ts.SignatureKind = {})); + var IndexKind; + (function (IndexKind) { + IndexKind[IndexKind["String"] = 0] = "String"; + IndexKind[IndexKind["Number"] = 1] = "Number"; + })(IndexKind = ts.IndexKind || (ts.IndexKind = {})); + var SpecialPropertyAssignmentKind; + (function (SpecialPropertyAssignmentKind) { + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["None"] = 0] = "None"; + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ExportsProperty"] = 1] = "ExportsProperty"; + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ModuleExports"] = 2] = "ModuleExports"; + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["PrototypeProperty"] = 3] = "PrototypeProperty"; + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ThisProperty"] = 4] = "ThisProperty"; + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["Property"] = 5] = "Property"; + })(SpecialPropertyAssignmentKind = ts.SpecialPropertyAssignmentKind || (ts.SpecialPropertyAssignmentKind = {})); var DiagnosticCategory; (function (DiagnosticCategory) { DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; @@ -66,6 +742,179 @@ var ts; ModuleKind[ModuleKind["System"] = 4] = "System"; ModuleKind[ModuleKind["ES2015"] = 5] = "ES2015"; })(ModuleKind = ts.ModuleKind || (ts.ModuleKind = {})); + var JsxEmit; + (function (JsxEmit) { + JsxEmit[JsxEmit["None"] = 0] = "None"; + JsxEmit[JsxEmit["Preserve"] = 1] = "Preserve"; + JsxEmit[JsxEmit["React"] = 2] = "React"; + JsxEmit[JsxEmit["ReactNative"] = 3] = "ReactNative"; + })(JsxEmit = ts.JsxEmit || (ts.JsxEmit = {})); + var NewLineKind; + (function (NewLineKind) { + NewLineKind[NewLineKind["CarriageReturnLineFeed"] = 0] = "CarriageReturnLineFeed"; + NewLineKind[NewLineKind["LineFeed"] = 1] = "LineFeed"; + })(NewLineKind = ts.NewLineKind || (ts.NewLineKind = {})); + var ScriptKind; + (function (ScriptKind) { + ScriptKind[ScriptKind["Unknown"] = 0] = "Unknown"; + ScriptKind[ScriptKind["JS"] = 1] = "JS"; + ScriptKind[ScriptKind["JSX"] = 2] = "JSX"; + ScriptKind[ScriptKind["TS"] = 3] = "TS"; + ScriptKind[ScriptKind["TSX"] = 4] = "TSX"; + ScriptKind[ScriptKind["External"] = 5] = "External"; + })(ScriptKind = ts.ScriptKind || (ts.ScriptKind = {})); + var ScriptTarget; + (function (ScriptTarget) { + ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3"; + ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5"; + ScriptTarget[ScriptTarget["ES2015"] = 2] = "ES2015"; + ScriptTarget[ScriptTarget["ES2016"] = 3] = "ES2016"; + ScriptTarget[ScriptTarget["ES2017"] = 4] = "ES2017"; + ScriptTarget[ScriptTarget["ESNext"] = 5] = "ESNext"; + ScriptTarget[ScriptTarget["Latest"] = 5] = "Latest"; + })(ScriptTarget = ts.ScriptTarget || (ts.ScriptTarget = {})); + var LanguageVariant; + (function (LanguageVariant) { + LanguageVariant[LanguageVariant["Standard"] = 0] = "Standard"; + LanguageVariant[LanguageVariant["JSX"] = 1] = "JSX"; + })(LanguageVariant = ts.LanguageVariant || (ts.LanguageVariant = {})); + var DiagnosticStyle; + (function (DiagnosticStyle) { + DiagnosticStyle[DiagnosticStyle["Simple"] = 0] = "Simple"; + DiagnosticStyle[DiagnosticStyle["Pretty"] = 1] = "Pretty"; + })(DiagnosticStyle = ts.DiagnosticStyle || (ts.DiagnosticStyle = {})); + var WatchDirectoryFlags; + (function (WatchDirectoryFlags) { + WatchDirectoryFlags[WatchDirectoryFlags["None"] = 0] = "None"; + WatchDirectoryFlags[WatchDirectoryFlags["Recursive"] = 1] = "Recursive"; + })(WatchDirectoryFlags = ts.WatchDirectoryFlags || (ts.WatchDirectoryFlags = {})); + var CharacterCodes; + (function (CharacterCodes) { + CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter"; + CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 127] = "maxAsciiCharacter"; + CharacterCodes[CharacterCodes["lineFeed"] = 10] = "lineFeed"; + CharacterCodes[CharacterCodes["carriageReturn"] = 13] = "carriageReturn"; + CharacterCodes[CharacterCodes["lineSeparator"] = 8232] = "lineSeparator"; + CharacterCodes[CharacterCodes["paragraphSeparator"] = 8233] = "paragraphSeparator"; + CharacterCodes[CharacterCodes["nextLine"] = 133] = "nextLine"; + CharacterCodes[CharacterCodes["space"] = 32] = "space"; + CharacterCodes[CharacterCodes["nonBreakingSpace"] = 160] = "nonBreakingSpace"; + CharacterCodes[CharacterCodes["enQuad"] = 8192] = "enQuad"; + CharacterCodes[CharacterCodes["emQuad"] = 8193] = "emQuad"; + CharacterCodes[CharacterCodes["enSpace"] = 8194] = "enSpace"; + CharacterCodes[CharacterCodes["emSpace"] = 8195] = "emSpace"; + CharacterCodes[CharacterCodes["threePerEmSpace"] = 8196] = "threePerEmSpace"; + CharacterCodes[CharacterCodes["fourPerEmSpace"] = 8197] = "fourPerEmSpace"; + CharacterCodes[CharacterCodes["sixPerEmSpace"] = 8198] = "sixPerEmSpace"; + CharacterCodes[CharacterCodes["figureSpace"] = 8199] = "figureSpace"; + CharacterCodes[CharacterCodes["punctuationSpace"] = 8200] = "punctuationSpace"; + CharacterCodes[CharacterCodes["thinSpace"] = 8201] = "thinSpace"; + CharacterCodes[CharacterCodes["hairSpace"] = 8202] = "hairSpace"; + CharacterCodes[CharacterCodes["zeroWidthSpace"] = 8203] = "zeroWidthSpace"; + CharacterCodes[CharacterCodes["narrowNoBreakSpace"] = 8239] = "narrowNoBreakSpace"; + CharacterCodes[CharacterCodes["ideographicSpace"] = 12288] = "ideographicSpace"; + CharacterCodes[CharacterCodes["mathematicalSpace"] = 8287] = "mathematicalSpace"; + CharacterCodes[CharacterCodes["ogham"] = 5760] = "ogham"; + CharacterCodes[CharacterCodes["_"] = 95] = "_"; + CharacterCodes[CharacterCodes["$"] = 36] = "$"; + CharacterCodes[CharacterCodes["_0"] = 48] = "_0"; + CharacterCodes[CharacterCodes["_1"] = 49] = "_1"; + CharacterCodes[CharacterCodes["_2"] = 50] = "_2"; + CharacterCodes[CharacterCodes["_3"] = 51] = "_3"; + CharacterCodes[CharacterCodes["_4"] = 52] = "_4"; + CharacterCodes[CharacterCodes["_5"] = 53] = "_5"; + CharacterCodes[CharacterCodes["_6"] = 54] = "_6"; + CharacterCodes[CharacterCodes["_7"] = 55] = "_7"; + CharacterCodes[CharacterCodes["_8"] = 56] = "_8"; + CharacterCodes[CharacterCodes["_9"] = 57] = "_9"; + CharacterCodes[CharacterCodes["a"] = 97] = "a"; + CharacterCodes[CharacterCodes["b"] = 98] = "b"; + CharacterCodes[CharacterCodes["c"] = 99] = "c"; + CharacterCodes[CharacterCodes["d"] = 100] = "d"; + CharacterCodes[CharacterCodes["e"] = 101] = "e"; + CharacterCodes[CharacterCodes["f"] = 102] = "f"; + CharacterCodes[CharacterCodes["g"] = 103] = "g"; + CharacterCodes[CharacterCodes["h"] = 104] = "h"; + CharacterCodes[CharacterCodes["i"] = 105] = "i"; + CharacterCodes[CharacterCodes["j"] = 106] = "j"; + CharacterCodes[CharacterCodes["k"] = 107] = "k"; + CharacterCodes[CharacterCodes["l"] = 108] = "l"; + CharacterCodes[CharacterCodes["m"] = 109] = "m"; + CharacterCodes[CharacterCodes["n"] = 110] = "n"; + CharacterCodes[CharacterCodes["o"] = 111] = "o"; + CharacterCodes[CharacterCodes["p"] = 112] = "p"; + CharacterCodes[CharacterCodes["q"] = 113] = "q"; + CharacterCodes[CharacterCodes["r"] = 114] = "r"; + CharacterCodes[CharacterCodes["s"] = 115] = "s"; + CharacterCodes[CharacterCodes["t"] = 116] = "t"; + CharacterCodes[CharacterCodes["u"] = 117] = "u"; + CharacterCodes[CharacterCodes["v"] = 118] = "v"; + CharacterCodes[CharacterCodes["w"] = 119] = "w"; + CharacterCodes[CharacterCodes["x"] = 120] = "x"; + CharacterCodes[CharacterCodes["y"] = 121] = "y"; + CharacterCodes[CharacterCodes["z"] = 122] = "z"; + CharacterCodes[CharacterCodes["A"] = 65] = "A"; + CharacterCodes[CharacterCodes["B"] = 66] = "B"; + CharacterCodes[CharacterCodes["C"] = 67] = "C"; + CharacterCodes[CharacterCodes["D"] = 68] = "D"; + CharacterCodes[CharacterCodes["E"] = 69] = "E"; + CharacterCodes[CharacterCodes["F"] = 70] = "F"; + CharacterCodes[CharacterCodes["G"] = 71] = "G"; + CharacterCodes[CharacterCodes["H"] = 72] = "H"; + CharacterCodes[CharacterCodes["I"] = 73] = "I"; + CharacterCodes[CharacterCodes["J"] = 74] = "J"; + CharacterCodes[CharacterCodes["K"] = 75] = "K"; + CharacterCodes[CharacterCodes["L"] = 76] = "L"; + CharacterCodes[CharacterCodes["M"] = 77] = "M"; + CharacterCodes[CharacterCodes["N"] = 78] = "N"; + CharacterCodes[CharacterCodes["O"] = 79] = "O"; + CharacterCodes[CharacterCodes["P"] = 80] = "P"; + CharacterCodes[CharacterCodes["Q"] = 81] = "Q"; + CharacterCodes[CharacterCodes["R"] = 82] = "R"; + CharacterCodes[CharacterCodes["S"] = 83] = "S"; + CharacterCodes[CharacterCodes["T"] = 84] = "T"; + CharacterCodes[CharacterCodes["U"] = 85] = "U"; + CharacterCodes[CharacterCodes["V"] = 86] = "V"; + CharacterCodes[CharacterCodes["W"] = 87] = "W"; + CharacterCodes[CharacterCodes["X"] = 88] = "X"; + CharacterCodes[CharacterCodes["Y"] = 89] = "Y"; + CharacterCodes[CharacterCodes["Z"] = 90] = "Z"; + CharacterCodes[CharacterCodes["ampersand"] = 38] = "ampersand"; + CharacterCodes[CharacterCodes["asterisk"] = 42] = "asterisk"; + CharacterCodes[CharacterCodes["at"] = 64] = "at"; + CharacterCodes[CharacterCodes["backslash"] = 92] = "backslash"; + CharacterCodes[CharacterCodes["backtick"] = 96] = "backtick"; + CharacterCodes[CharacterCodes["bar"] = 124] = "bar"; + CharacterCodes[CharacterCodes["caret"] = 94] = "caret"; + CharacterCodes[CharacterCodes["closeBrace"] = 125] = "closeBrace"; + CharacterCodes[CharacterCodes["closeBracket"] = 93] = "closeBracket"; + CharacterCodes[CharacterCodes["closeParen"] = 41] = "closeParen"; + CharacterCodes[CharacterCodes["colon"] = 58] = "colon"; + CharacterCodes[CharacterCodes["comma"] = 44] = "comma"; + CharacterCodes[CharacterCodes["dot"] = 46] = "dot"; + CharacterCodes[CharacterCodes["doubleQuote"] = 34] = "doubleQuote"; + CharacterCodes[CharacterCodes["equals"] = 61] = "equals"; + CharacterCodes[CharacterCodes["exclamation"] = 33] = "exclamation"; + CharacterCodes[CharacterCodes["greaterThan"] = 62] = "greaterThan"; + CharacterCodes[CharacterCodes["hash"] = 35] = "hash"; + CharacterCodes[CharacterCodes["lessThan"] = 60] = "lessThan"; + CharacterCodes[CharacterCodes["minus"] = 45] = "minus"; + CharacterCodes[CharacterCodes["openBrace"] = 123] = "openBrace"; + CharacterCodes[CharacterCodes["openBracket"] = 91] = "openBracket"; + CharacterCodes[CharacterCodes["openParen"] = 40] = "openParen"; + CharacterCodes[CharacterCodes["percent"] = 37] = "percent"; + CharacterCodes[CharacterCodes["plus"] = 43] = "plus"; + CharacterCodes[CharacterCodes["question"] = 63] = "question"; + CharacterCodes[CharacterCodes["semicolon"] = 59] = "semicolon"; + CharacterCodes[CharacterCodes["singleQuote"] = 39] = "singleQuote"; + CharacterCodes[CharacterCodes["slash"] = 47] = "slash"; + CharacterCodes[CharacterCodes["tilde"] = 126] = "tilde"; + CharacterCodes[CharacterCodes["backspace"] = 8] = "backspace"; + CharacterCodes[CharacterCodes["formFeed"] = 12] = "formFeed"; + CharacterCodes[CharacterCodes["byteOrderMark"] = 65279] = "byteOrderMark"; + CharacterCodes[CharacterCodes["tab"] = 9] = "tab"; + CharacterCodes[CharacterCodes["verticalTab"] = 11] = "verticalTab"; + })(CharacterCodes = ts.CharacterCodes || (ts.CharacterCodes = {})); var Extension; (function (Extension) { Extension[Extension["Ts"] = 0] = "Ts"; @@ -75,6 +924,121 @@ var ts; Extension[Extension["Jsx"] = 4] = "Jsx"; Extension[Extension["LastTypeScriptExtension"] = 2] = "LastTypeScriptExtension"; })(Extension = ts.Extension || (ts.Extension = {})); + var TransformFlags; + (function (TransformFlags) { + TransformFlags[TransformFlags["None"] = 0] = "None"; + TransformFlags[TransformFlags["TypeScript"] = 1] = "TypeScript"; + TransformFlags[TransformFlags["ContainsTypeScript"] = 2] = "ContainsTypeScript"; + TransformFlags[TransformFlags["ContainsJsx"] = 4] = "ContainsJsx"; + TransformFlags[TransformFlags["ContainsESNext"] = 8] = "ContainsESNext"; + TransformFlags[TransformFlags["ContainsES2017"] = 16] = "ContainsES2017"; + TransformFlags[TransformFlags["ContainsES2016"] = 32] = "ContainsES2016"; + TransformFlags[TransformFlags["ES2015"] = 64] = "ES2015"; + TransformFlags[TransformFlags["ContainsES2015"] = 128] = "ContainsES2015"; + TransformFlags[TransformFlags["Generator"] = 256] = "Generator"; + TransformFlags[TransformFlags["ContainsGenerator"] = 512] = "ContainsGenerator"; + TransformFlags[TransformFlags["DestructuringAssignment"] = 1024] = "DestructuringAssignment"; + TransformFlags[TransformFlags["ContainsDestructuringAssignment"] = 2048] = "ContainsDestructuringAssignment"; + TransformFlags[TransformFlags["ContainsDecorators"] = 4096] = "ContainsDecorators"; + TransformFlags[TransformFlags["ContainsPropertyInitializer"] = 8192] = "ContainsPropertyInitializer"; + TransformFlags[TransformFlags["ContainsLexicalThis"] = 16384] = "ContainsLexicalThis"; + TransformFlags[TransformFlags["ContainsCapturedLexicalThis"] = 32768] = "ContainsCapturedLexicalThis"; + TransformFlags[TransformFlags["ContainsLexicalThisInComputedPropertyName"] = 65536] = "ContainsLexicalThisInComputedPropertyName"; + TransformFlags[TransformFlags["ContainsDefaultValueAssignments"] = 131072] = "ContainsDefaultValueAssignments"; + TransformFlags[TransformFlags["ContainsParameterPropertyAssignments"] = 262144] = "ContainsParameterPropertyAssignments"; + TransformFlags[TransformFlags["ContainsSpread"] = 524288] = "ContainsSpread"; + TransformFlags[TransformFlags["ContainsObjectSpread"] = 1048576] = "ContainsObjectSpread"; + TransformFlags[TransformFlags["ContainsRest"] = 524288] = "ContainsRest"; + TransformFlags[TransformFlags["ContainsObjectRest"] = 1048576] = "ContainsObjectRest"; + TransformFlags[TransformFlags["ContainsComputedPropertyName"] = 2097152] = "ContainsComputedPropertyName"; + TransformFlags[TransformFlags["ContainsBlockScopedBinding"] = 4194304] = "ContainsBlockScopedBinding"; + TransformFlags[TransformFlags["ContainsBindingPattern"] = 8388608] = "ContainsBindingPattern"; + TransformFlags[TransformFlags["ContainsYield"] = 16777216] = "ContainsYield"; + TransformFlags[TransformFlags["ContainsHoistedDeclarationOrCompletion"] = 33554432] = "ContainsHoistedDeclarationOrCompletion"; + TransformFlags[TransformFlags["HasComputedFlags"] = 536870912] = "HasComputedFlags"; + TransformFlags[TransformFlags["AssertTypeScript"] = 3] = "AssertTypeScript"; + TransformFlags[TransformFlags["AssertJsx"] = 4] = "AssertJsx"; + TransformFlags[TransformFlags["AssertESNext"] = 8] = "AssertESNext"; + TransformFlags[TransformFlags["AssertES2017"] = 16] = "AssertES2017"; + TransformFlags[TransformFlags["AssertES2016"] = 32] = "AssertES2016"; + TransformFlags[TransformFlags["AssertES2015"] = 192] = "AssertES2015"; + TransformFlags[TransformFlags["AssertGenerator"] = 768] = "AssertGenerator"; + TransformFlags[TransformFlags["AssertDestructuringAssignment"] = 3072] = "AssertDestructuringAssignment"; + TransformFlags[TransformFlags["NodeExcludes"] = 536872257] = "NodeExcludes"; + TransformFlags[TransformFlags["ArrowFunctionExcludes"] = 601249089] = "ArrowFunctionExcludes"; + TransformFlags[TransformFlags["FunctionExcludes"] = 601281857] = "FunctionExcludes"; + TransformFlags[TransformFlags["ConstructorExcludes"] = 601015617] = "ConstructorExcludes"; + TransformFlags[TransformFlags["MethodOrAccessorExcludes"] = 601015617] = "MethodOrAccessorExcludes"; + TransformFlags[TransformFlags["ClassExcludes"] = 539358529] = "ClassExcludes"; + TransformFlags[TransformFlags["ModuleExcludes"] = 574674241] = "ModuleExcludes"; + TransformFlags[TransformFlags["TypeExcludes"] = -3] = "TypeExcludes"; + TransformFlags[TransformFlags["ObjectLiteralExcludes"] = 540087617] = "ObjectLiteralExcludes"; + TransformFlags[TransformFlags["ArrayLiteralOrCallOrNewExcludes"] = 537396545] = "ArrayLiteralOrCallOrNewExcludes"; + TransformFlags[TransformFlags["VariableDeclarationListExcludes"] = 546309441] = "VariableDeclarationListExcludes"; + TransformFlags[TransformFlags["ParameterExcludes"] = 536872257] = "ParameterExcludes"; + TransformFlags[TransformFlags["CatchClauseExcludes"] = 537920833] = "CatchClauseExcludes"; + TransformFlags[TransformFlags["BindingPatternExcludes"] = 537396545] = "BindingPatternExcludes"; + TransformFlags[TransformFlags["TypeScriptClassSyntaxMask"] = 274432] = "TypeScriptClassSyntaxMask"; + TransformFlags[TransformFlags["ES2015FunctionSyntaxMask"] = 163840] = "ES2015FunctionSyntaxMask"; + })(TransformFlags = ts.TransformFlags || (ts.TransformFlags = {})); + var EmitFlags; + (function (EmitFlags) { + EmitFlags[EmitFlags["SingleLine"] = 1] = "SingleLine"; + EmitFlags[EmitFlags["AdviseOnEmitNode"] = 2] = "AdviseOnEmitNode"; + EmitFlags[EmitFlags["NoSubstitution"] = 4] = "NoSubstitution"; + EmitFlags[EmitFlags["CapturesThis"] = 8] = "CapturesThis"; + EmitFlags[EmitFlags["NoLeadingSourceMap"] = 16] = "NoLeadingSourceMap"; + EmitFlags[EmitFlags["NoTrailingSourceMap"] = 32] = "NoTrailingSourceMap"; + EmitFlags[EmitFlags["NoSourceMap"] = 48] = "NoSourceMap"; + EmitFlags[EmitFlags["NoNestedSourceMaps"] = 64] = "NoNestedSourceMaps"; + EmitFlags[EmitFlags["NoTokenLeadingSourceMaps"] = 128] = "NoTokenLeadingSourceMaps"; + EmitFlags[EmitFlags["NoTokenTrailingSourceMaps"] = 256] = "NoTokenTrailingSourceMaps"; + EmitFlags[EmitFlags["NoTokenSourceMaps"] = 384] = "NoTokenSourceMaps"; + EmitFlags[EmitFlags["NoLeadingComments"] = 512] = "NoLeadingComments"; + EmitFlags[EmitFlags["NoTrailingComments"] = 1024] = "NoTrailingComments"; + EmitFlags[EmitFlags["NoComments"] = 1536] = "NoComments"; + EmitFlags[EmitFlags["NoNestedComments"] = 2048] = "NoNestedComments"; + EmitFlags[EmitFlags["HelperName"] = 4096] = "HelperName"; + EmitFlags[EmitFlags["ExportName"] = 8192] = "ExportName"; + EmitFlags[EmitFlags["LocalName"] = 16384] = "LocalName"; + EmitFlags[EmitFlags["Indented"] = 32768] = "Indented"; + EmitFlags[EmitFlags["NoIndentation"] = 65536] = "NoIndentation"; + EmitFlags[EmitFlags["AsyncFunctionBody"] = 131072] = "AsyncFunctionBody"; + EmitFlags[EmitFlags["ReuseTempVariableScope"] = 262144] = "ReuseTempVariableScope"; + EmitFlags[EmitFlags["CustomPrologue"] = 524288] = "CustomPrologue"; + EmitFlags[EmitFlags["NoHoisting"] = 1048576] = "NoHoisting"; + EmitFlags[EmitFlags["HasEndOfDeclarationMarker"] = 2097152] = "HasEndOfDeclarationMarker"; + EmitFlags[EmitFlags["Iterator"] = 4194304] = "Iterator"; + })(EmitFlags = ts.EmitFlags || (ts.EmitFlags = {})); + var ExternalEmitHelpers; + (function (ExternalEmitHelpers) { + ExternalEmitHelpers[ExternalEmitHelpers["Extends"] = 1] = "Extends"; + ExternalEmitHelpers[ExternalEmitHelpers["Assign"] = 2] = "Assign"; + ExternalEmitHelpers[ExternalEmitHelpers["Rest"] = 4] = "Rest"; + ExternalEmitHelpers[ExternalEmitHelpers["Decorate"] = 8] = "Decorate"; + ExternalEmitHelpers[ExternalEmitHelpers["Metadata"] = 16] = "Metadata"; + ExternalEmitHelpers[ExternalEmitHelpers["Param"] = 32] = "Param"; + ExternalEmitHelpers[ExternalEmitHelpers["Awaiter"] = 64] = "Awaiter"; + ExternalEmitHelpers[ExternalEmitHelpers["Generator"] = 128] = "Generator"; + ExternalEmitHelpers[ExternalEmitHelpers["Values"] = 256] = "Values"; + ExternalEmitHelpers[ExternalEmitHelpers["Read"] = 512] = "Read"; + ExternalEmitHelpers[ExternalEmitHelpers["Spread"] = 1024] = "Spread"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncGenerator"] = 2048] = "AsyncGenerator"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncDelegator"] = 4096] = "AsyncDelegator"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncValues"] = 8192] = "AsyncValues"; + ExternalEmitHelpers[ExternalEmitHelpers["ForOfIncludes"] = 256] = "ForOfIncludes"; + ExternalEmitHelpers[ExternalEmitHelpers["ForAwaitOfIncludes"] = 8192] = "ForAwaitOfIncludes"; + ExternalEmitHelpers[ExternalEmitHelpers["SpreadIncludes"] = 1536] = "SpreadIncludes"; + ExternalEmitHelpers[ExternalEmitHelpers["FirstEmitHelper"] = 1] = "FirstEmitHelper"; + ExternalEmitHelpers[ExternalEmitHelpers["LastEmitHelper"] = 8192] = "LastEmitHelper"; + })(ExternalEmitHelpers = ts.ExternalEmitHelpers || (ts.ExternalEmitHelpers = {})); + var EmitHint; + (function (EmitHint) { + EmitHint[EmitHint["SourceFile"] = 0] = "SourceFile"; + EmitHint[EmitHint["Expression"] = 1] = "Expression"; + EmitHint[EmitHint["IdentifierName"] = 2] = "IdentifierName"; + EmitHint[EmitHint["Unspecified"] = 3] = "Unspecified"; + })(EmitHint = ts.EmitHint || (ts.EmitHint = {})); })(ts || (ts = {})); var ts; (function (ts) { @@ -93,32 +1057,32 @@ var ts; var measures; function mark(markName) { if (enabled) { - marks[markName] = ts.timestamp(); - counts[markName] = (counts[markName] || 0) + 1; + marks.set(markName, ts.timestamp()); + counts.set(markName, (counts.get(markName) || 0) + 1); profilerEvent(markName); } } performance.mark = mark; function measure(measureName, startMarkName, endMarkName) { if (enabled) { - var end = endMarkName && marks[endMarkName] || ts.timestamp(); - var start = startMarkName && marks[startMarkName] || profilerStart; - measures[measureName] = (measures[measureName] || 0) + (end - start); + var end = endMarkName && marks.get(endMarkName) || ts.timestamp(); + var start = startMarkName && marks.get(startMarkName) || profilerStart; + measures.set(measureName, (measures.get(measureName) || 0) + (end - start)); } } performance.measure = measure; function getCount(markName) { - return counts && counts[markName] || 0; + return counts && counts.get(markName) || 0; } performance.getCount = getCount; function getDuration(measureName) { - return measures && measures[measureName] || 0; + return measures && measures.get(measureName) || 0; } performance.getDuration = getDuration; function forEachMeasure(cb) { - for (var key in measures) { - cb(key, measures[key]); - } + measures.forEach(function (measure, key) { + cb(key, measure); + }); } performance.forEachMeasure = forEachMeasure; function enable() { @@ -137,22 +1101,102 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - ts.version = "2.2.0-dev.20161127"; + ts.version = "2.3.0-dev.20170419"; })(ts || (ts = {})); (function (ts) { - var createObject = Object.create; - ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined; - function createMap(template) { - var map = createObject(null); + var Ternary; + (function (Ternary) { + Ternary[Ternary["False"] = 0] = "False"; + Ternary[Ternary["Maybe"] = 1] = "Maybe"; + Ternary[Ternary["True"] = -1] = "True"; + })(Ternary = ts.Ternary || (ts.Ternary = {})); + ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator(undefined, { usage: "sort", sensitivity: "accent" }) : undefined; + ts.localeCompareIsCorrect = ts.collator && ts.collator.compare("a", "B") < 0; + function createDictionaryObject() { + var map = Object.create(null); map["__"] = undefined; delete map["__"]; + return map; + } + function createMap() { + return new MapCtr(); + } + ts.createMap = createMap; + function createMapFromTemplate(template) { + var map = new MapCtr(); for (var key in template) if (hasOwnProperty.call(template, key)) { - map[key] = template[key]; + map.set(key, template[key]); } return map; } - ts.createMap = createMap; + ts.createMapFromTemplate = createMapFromTemplate; + var MapCtr = typeof Map !== "undefined" && "entries" in Map.prototype ? Map : shimMap(); + function shimMap() { + var MapIterator = (function () { + function MapIterator(data, selector) { + this.index = 0; + this.data = data; + this.selector = selector; + this.keys = Object.keys(data); + } + MapIterator.prototype.next = function () { + var index = this.index; + if (index < this.keys.length) { + this.index++; + return { value: this.selector(this.data, this.keys[index]), done: false }; + } + return { value: undefined, done: true }; + }; + return MapIterator; + }()); + return (function () { + function class_1() { + this.data = createDictionaryObject(); + this.size = 0; + } + class_1.prototype.get = function (key) { + return this.data[key]; + }; + class_1.prototype.set = function (key, value) { + if (!this.has(key)) { + this.size++; + } + this.data[key] = value; + return this; + }; + class_1.prototype.has = function (key) { + return key in this.data; + }; + class_1.prototype.delete = function (key) { + if (this.has(key)) { + this.size--; + delete this.data[key]; + return true; + } + return false; + }; + class_1.prototype.clear = function () { + this.data = createDictionaryObject(); + this.size = 0; + }; + class_1.prototype.keys = function () { + return new MapIterator(this.data, function (_data, key) { return key; }); + }; + class_1.prototype.values = function () { + return new MapIterator(this.data, function (data, key) { return data[key]; }); + }; + class_1.prototype.entries = function () { + return new MapIterator(this.data, function (data, key) { return [key, data[key]]; }); + }; + class_1.prototype.forEach = function (action) { + for (var key in this.data) { + action(this.data[key], key); + } + }; + return class_1; + }()); + } function createFileMap(keyMapper) { var files = createMap(); return { @@ -165,32 +1209,27 @@ var ts; clear: clear, }; function forEachValueInMap(f) { - for (var key in files) { - f(key, files[key]); - } + files.forEach(function (file, key) { + f(key, file); + }); } function getKeys() { - var keys = []; - for (var key in files) { - keys.push(key); - } - return keys; + return arrayFrom(files.keys()); } function get(path) { - return files[toKey(path)]; + return files.get(toKey(path)); } function set(path, value) { - files[toKey(path)] = value; + files.set(toKey(path), value); } function contains(path) { - return toKey(path) in files; + return files.has(toKey(path)); } function remove(path) { - var key = toKey(path); - delete files[key]; + files.delete(toKey(path)); } function clear() { - files = createMap(); + files.clear(); } function toKey(path) { return keyMapper ? keyMapper(path) : path; @@ -204,9 +1243,19 @@ var ts; return getCanonicalFileName(nonCanonicalizedPath); } ts.toPath = toPath; + var Comparison; + (function (Comparison) { + Comparison[Comparison["LessThan"] = -1] = "LessThan"; + Comparison[Comparison["EqualTo"] = 0] = "EqualTo"; + Comparison[Comparison["GreaterThan"] = 1] = "GreaterThan"; + })(Comparison = ts.Comparison || (ts.Comparison = {})); + function length(array) { + return array ? array.length : 0; + } + ts.length = length; function forEach(array, callback) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { var result = callback(array[i], i); if (result) { return result; @@ -216,6 +1265,20 @@ var ts; return undefined; } ts.forEach = forEach; + function findAncestor(node, callback) { + while (node) { + var result = callback(node); + if (result === "quit") { + return undefined; + } + else if (result) { + return node; + } + node = node.parent; + } + return undefined; + } + ts.findAncestor = findAncestor; function zipWith(arrayA, arrayB, callback) { Debug.assert(arrayA.length === arrayB.length); for (var i = 0; i < arrayA.length; i++) { @@ -225,7 +1288,7 @@ var ts; ts.zipWith = zipWith; function every(array, callback) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { if (!callback(array[i], i)) { return false; } @@ -235,7 +1298,7 @@ var ts; } ts.every = every; function find(array, predicate) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { var value = array[i]; if (predicate(value, i)) { return value; @@ -244,8 +1307,17 @@ var ts; return undefined; } ts.find = find; + function findIndex(array, predicate) { + for (var i = 0; i < array.length; i++) { + if (predicate(array[i], i)) { + return i; + } + } + return -1; + } + ts.findIndex = findIndex; function findMap(array, callback) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { var result = callback(array[i], i); if (result) { return result; @@ -268,7 +1340,7 @@ var ts; ts.contains = contains; function indexOf(array, value) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { if (array[i] === value) { return i; } @@ -278,7 +1350,7 @@ var ts; } ts.indexOf = indexOf; function indexOfAnyCharCode(text, charCodes, start) { - for (var i = start || 0, len = text.length; i < len; i++) { + for (var i = start || 0; i < text.length; i++) { if (contains(charCodes, text.charCodeAt(i))) { return i; } @@ -465,21 +1537,18 @@ var ts; return result; } ts.spanMap = spanMap; - function mapObject(object, f) { - var result; - if (object) { - result = {}; - for (var _i = 0, _a = getOwnKeys(object); _i < _a.length; _i++) { - var v = _a[_i]; - var _b = f(v, object[v]) || [undefined, undefined], key = _b[0], value = _b[1]; - if (key !== undefined) { - result[key] = value; - } - } + function mapEntries(map, f) { + if (!map) { + return undefined; } + var result = createMap(); + map.forEach(function (value, key) { + var _a = f(key, value), newKey = _a[0], newValue = _a[1]; + result.set(newKey, newValue); + }); return result; } - ts.mapObject = mapObject; + ts.mapEntries = mapEntries; function some(array, predicate) { if (array) { if (predicate) { @@ -763,38 +1832,55 @@ var ts; return keys; } ts.getOwnKeys = getOwnKeys; - function forEachProperty(map, callback) { - var result; - for (var key in map) { - if (result = callback(map[key], key)) - break; + function arrayFrom(iterator, map) { + var result = []; + for (var _a = iterator.next(), value = _a.value, done = _a.done; !done; _b = iterator.next(), value = _b.value, done = _b.done, _b) { + result.push(map ? map(value) : value); } return result; + var _b; } - ts.forEachProperty = forEachProperty; - function someProperties(map, predicate) { - for (var key in map) { - if (!predicate || predicate(map[key], key)) - return true; + ts.arrayFrom = arrayFrom; + function convertToArray(iterator, f) { + var result = []; + for (var _a = iterator.next(), value = _a.value, done = _a.done; !done; _b = iterator.next(), value = _b.value, done = _b.done, _b) { + result.push(f(value)); } - return false; + return result; + var _b; } - ts.someProperties = someProperties; - function copyProperties(source, target) { - for (var key in source) { - target[key] = source[key]; + ts.convertToArray = convertToArray; + function forEachEntry(map, callback) { + var iterator = map.entries(); + for (var _a = iterator.next(), pair = _a.value, done = _a.done; !done; _b = iterator.next(), pair = _b.value, done = _b.done, _b) { + var key = pair[0], value = pair[1]; + var result = callback(value, key); + if (result) { + return result; + } } + return undefined; + var _b; } - ts.copyProperties = copyProperties; - function appendProperty(map, key, value) { - if (key === undefined || value === undefined) - return map; - if (map === undefined) - map = createMap(); - map[key] = value; - return map; + ts.forEachEntry = forEachEntry; + function forEachKey(map, callback) { + var iterator = map.keys(); + for (var _a = iterator.next(), key = _a.value, done = _a.done; !done; _b = iterator.next(), key = _b.value, done = _b.done, _b) { + var result = callback(key); + if (result) { + return result; + } + } + return undefined; + var _b; } - ts.appendProperty = appendProperty; + ts.forEachKey = forEachKey; + function copyEntries(source, target) { + source.forEach(function (value, key) { + target.set(key, value); + }); + } + ts.copyEntries = copyEntries; function assign(t) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { @@ -802,31 +1888,14 @@ var ts; } for (var _a = 0, args_1 = args; _a < args_1.length; _a++) { var arg = args_1[_a]; - for (var _b = 0, _c = getOwnKeys(arg); _b < _c.length; _b++) { - var p = _c[_b]; - t[p] = arg[p]; - } + for (var p in arg) + if (hasProperty(arg, p)) { + t[p] = arg[p]; + } } return t; } ts.assign = assign; - function reduceProperties(map, callback, initial) { - var result = initial; - for (var key in map) { - result = callback(result, map[key], String(key)); - } - return result; - } - ts.reduceProperties = reduceProperties; - function reduceOwnProperties(map, callback, initial) { - var result = initial; - for (var key in map) - if (hasOwnProperty.call(map, key)) { - result = callback(result, map[key], String(key)); - } - return result; - } - ts.reduceOwnProperties = reduceOwnProperties; function equalOwnProperties(left, right, equalityComparer) { if (left === right) return true; @@ -851,23 +1920,14 @@ var ts; var result = createMap(); for (var _i = 0, array_8 = array; _i < array_8.length; _i++) { var value = array_8[_i]; - result[makeKey(value)] = makeValue ? makeValue(value) : value; + result.set(makeKey(value), makeValue ? makeValue(value) : value); } return result; } ts.arrayToMap = arrayToMap; - function isEmpty(map) { - for (var id in map) { - if (hasProperty(map, id)) { - return false; - } - } - return true; - } - ts.isEmpty = isEmpty; function cloneMap(map) { var clone = createMap(); - copyProperties(map, clone); + copyEntries(map, clone); return clone; } ts.cloneMap = cloneMap; @@ -894,27 +1954,32 @@ var ts; return result; } ts.extend = extend; - function multiMapAdd(map, key, value) { - var values = map[key]; + function createMultiMap() { + var map = createMap(); + map.add = multiMapAdd; + map.remove = multiMapRemove; + return map; + } + ts.createMultiMap = createMultiMap; + function multiMapAdd(key, value) { + var values = this.get(key); if (values) { values.push(value); - return values; } else { - return map[key] = [value]; + this.set(key, values = [value]); } + return values; } - ts.multiMapAdd = multiMapAdd; - function multiMapRemove(map, key, value) { - var values = map[key]; + function multiMapRemove(key, value) { + var values = this.get(key); if (values) { unorderedRemoveItem(values, value); if (!values.length) { - delete map[key]; + this.delete(key); } } } - ts.multiMapRemove = multiMapRemove; function isArray(value) { return Array.isArray ? Array.isArray(value) : value instanceof Array; } @@ -990,6 +2055,7 @@ var ts; baseIndex = baseIndex || 0; return text.replace(/{(\d+)}/g, function (_match, index) { return args[+index + baseIndex]; }); } + ts.formatStringFromArgs = formatStringFromArgs; ts.localizedDiagnosticMessages = undefined; function getLocaleSpecificMessage(message) { return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message.key] || message.message; @@ -1091,8 +2157,10 @@ var ts; if (b === undefined) return 1; if (ignoreCase) { - if (ts.collator && String.prototype.localeCompare) { - var result = a.localeCompare(b, undefined, { usage: "sort", sensitivity: "accent" }); + if (ts.collator) { + var result = ts.localeCompareIsCorrect ? + ts.collator.compare(a, b) : + a.localeCompare(b, undefined, { usage: "sort", sensitivity: "accent" }); return result < 0 ? -1 : result > 0 ? 1 : 0; } a = a.toUpperCase(); @@ -1474,36 +2542,26 @@ var ts; var singleAsteriskRegexFragmentFiles = "([^./]|(\\.(?!min\\.js$))?)*"; var singleAsteriskRegexFragmentOther = "[^/]*"; function getRegularExpressionForWildcard(specs, basePath, usage) { + var patterns = getRegularExpressionsForWildcards(specs, basePath, usage); + if (!patterns || !patterns.length) { + return undefined; + } + var pattern = patterns.map(function (pattern) { return "(" + pattern + ")"; }).join("|"); + var terminator = usage === "exclude" ? "($|/)" : "$"; + return "^(" + pattern + ")" + terminator; + } + ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard; + function getRegularExpressionsForWildcards(specs, basePath, usage) { if (specs === undefined || specs.length === 0) { return undefined; } var replaceWildcardCharacter = usage === "files" ? replaceWildCardCharacterFiles : replaceWildCardCharacterOther; var singleAsteriskRegexFragment = usage === "files" ? singleAsteriskRegexFragmentFiles : singleAsteriskRegexFragmentOther; var doubleAsteriskRegexFragment = usage === "exclude" ? "(/.+?)?" : "(/[^/.][^/]*)*?"; - var pattern = ""; - var hasWrittenSubpattern = false; - for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) { - var spec = specs_1[_i]; - if (!spec) { - continue; - } - var subPattern = getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter); - if (subPattern === undefined) { - continue; - } - if (hasWrittenSubpattern) { - pattern += "|"; - } - pattern += "(" + subPattern + ")"; - hasWrittenSubpattern = true; - } - if (!pattern) { - return undefined; - } - var terminator = usage === "exclude" ? "($|/)" : "$"; - return "^(" + pattern + ")" + terminator; + return flatMap(specs, function (spec) { + return spec && getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter); + }); } - ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard; function isImplicitGlob(lastPathComponent) { return !/[.*?]/.test(lastPathComponent); } @@ -1573,6 +2631,7 @@ var ts; currentDirectory = normalizePath(currentDirectory); var absolutePath = combinePaths(currentDirectory, path); return { + includeFilePatterns: map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^" + pattern + "$"; }), includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"), includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"), excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"), @@ -1585,34 +2644,48 @@ var ts; currentDirectory = normalizePath(currentDirectory); var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory); var regexFlag = useCaseSensitiveFileNames ? "" : "i"; - var includeFileRegex = patterns.includeFilePattern && new RegExp(patterns.includeFilePattern, regexFlag); + var includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map(function (pattern) { return new RegExp(pattern, regexFlag); }); var includeDirectoryRegex = patterns.includeDirectoryPattern && new RegExp(patterns.includeDirectoryPattern, regexFlag); var excludeRegex = patterns.excludePattern && new RegExp(patterns.excludePattern, regexFlag); - var result = []; + var results = includeFileRegexes ? includeFileRegexes.map(function () { return []; }) : [[]]; + var comparer = useCaseSensitiveFileNames ? compareStrings : compareStringsCaseInsensitive; for (var _i = 0, _a = patterns.basePaths; _i < _a.length; _i++) { var basePath = _a[_i]; visitDirectory(basePath, combinePaths(currentDirectory, basePath)); } - return result; + return flatten(results); function visitDirectory(path, absolutePath) { var _a = getFileSystemEntries(path), files = _a.files, directories = _a.directories; + files = files.slice().sort(comparer); + directories = directories.slice().sort(comparer); + var _loop_1 = function (current) { + var name = combinePaths(path, current); + var absoluteName = combinePaths(absolutePath, current); + if (extensions && !fileExtensionIsAny(name, extensions)) + return "continue"; + if (excludeRegex && excludeRegex.test(absoluteName)) + return "continue"; + if (!includeFileRegexes) { + results[0].push(name); + } + else { + var includeIndex = findIndex(includeFileRegexes, function (re) { return re.test(absoluteName); }); + if (includeIndex !== -1) { + results[includeIndex].push(name); + } + } + }; for (var _i = 0, files_1 = files; _i < files_1.length; _i++) { var current = files_1[_i]; - var name_1 = combinePaths(path, current); - var absoluteName = combinePaths(absolutePath, current); - if ((!extensions || fileExtensionIsAny(name_1, extensions)) && - (!includeFileRegex || includeFileRegex.test(absoluteName)) && - (!excludeRegex || !excludeRegex.test(absoluteName))) { - result.push(name_1); - } + _loop_1(current); } for (var _b = 0, directories_1 = directories; _b < directories_1.length; _b++) { var current = directories_1[_b]; - var name_2 = combinePaths(path, current); + var name = combinePaths(path, current); var absoluteName = combinePaths(absolutePath, current); if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) && (!excludeRegex || !excludeRegex.test(absoluteName))) { - visitDirectory(name_2, absoluteName); + visitDirectory(name, absoluteName); } } } @@ -1628,14 +2701,14 @@ var ts; includeBasePaths.push(getIncludeBasePath(absolute)); } includeBasePaths.sort(useCaseSensitiveFileNames ? compareStrings : compareStringsCaseInsensitive); - var _loop_1 = function (includeBasePath) { + var _loop_2 = function (includeBasePath) { if (ts.every(basePaths, function (basePath) { return !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames); })) { basePaths.push(includeBasePath); } }; for (var _a = 0, includeBasePaths_1 = includeBasePaths; _a < includeBasePaths_1.length; _a++) { var includeBasePath = includeBasePaths_1[_a]; - _loop_1(includeBasePath); + _loop_2(includeBasePath); } } return basePaths; @@ -1673,8 +2746,19 @@ var ts; ts.supportedTypescriptExtensionsForExtractExtension = [".d.ts", ".ts", ".tsx"]; ts.supportedJavascriptExtensions = [".js", ".jsx"]; var allSupportedExtensions = ts.supportedTypeScriptExtensions.concat(ts.supportedJavascriptExtensions); - function getSupportedExtensions(options) { - return options && options.allowJs ? allSupportedExtensions : ts.supportedTypeScriptExtensions; + function getSupportedExtensions(options, extraFileExtensions) { + var needAllExtensions = options && options.allowJs; + if (!extraFileExtensions || extraFileExtensions.length === 0 || !needAllExtensions) { + return needAllExtensions ? allSupportedExtensions : ts.supportedTypeScriptExtensions; + } + var extensions = allSupportedExtensions.slice(0); + for (var _i = 0, extraFileExtensions_1 = extraFileExtensions; _i < extraFileExtensions_1.length; _i++) { + var extInfo = extraFileExtensions_1[_i]; + if (extensions.indexOf(extInfo.extension) === -1) { + extensions.push(extInfo.extension); + } + } + return extensions; } ts.getSupportedExtensions = getSupportedExtensions; function hasJavaScriptFileExtension(fileName) { @@ -1685,11 +2769,11 @@ var ts; return forEach(ts.supportedTypeScriptExtensions, function (extension) { return fileExtensionIs(fileName, extension); }); } ts.hasTypeScriptFileExtension = hasTypeScriptFileExtension; - function isSupportedSourceFileName(fileName, compilerOptions) { + function isSupportedSourceFileName(fileName, compilerOptions, extraFileExtensions) { if (!fileName) { return false; } - for (var _i = 0, _a = getSupportedExtensions(compilerOptions); _i < _a.length; _i++) { + for (var _i = 0, _a = getSupportedExtensions(compilerOptions, extraFileExtensions); _i < _a.length; _i++) { var extension = _a[_i]; if (fileExtensionIs(fileName, extension)) { return true; @@ -1698,33 +2782,40 @@ var ts; return false; } ts.isSupportedSourceFileName = isSupportedSourceFileName; + var ExtensionPriority; + (function (ExtensionPriority) { + ExtensionPriority[ExtensionPriority["TypeScriptFiles"] = 0] = "TypeScriptFiles"; + ExtensionPriority[ExtensionPriority["DeclarationAndJavaScriptFiles"] = 2] = "DeclarationAndJavaScriptFiles"; + ExtensionPriority[ExtensionPriority["Highest"] = 0] = "Highest"; + ExtensionPriority[ExtensionPriority["Lowest"] = 2] = "Lowest"; + })(ExtensionPriority = ts.ExtensionPriority || (ts.ExtensionPriority = {})); function getExtensionPriority(path, supportedExtensions) { for (var i = supportedExtensions.length - 1; i >= 0; i--) { if (fileExtensionIs(path, supportedExtensions[i])) { - return adjustExtensionPriority(i); + return adjustExtensionPriority(i, supportedExtensions); } } return 0; } ts.getExtensionPriority = getExtensionPriority; - function adjustExtensionPriority(extensionPriority) { + function adjustExtensionPriority(extensionPriority, supportedExtensions) { if (extensionPriority < 2) { return 0; } - else if (extensionPriority < 5) { + else if (extensionPriority < supportedExtensions.length) { return 2; } else { - return 5; + return supportedExtensions.length; } } ts.adjustExtensionPriority = adjustExtensionPriority; - function getNextLowestExtensionPriority(extensionPriority) { + function getNextLowestExtensionPriority(extensionPriority, supportedExtensions) { if (extensionPriority < 2) { return 2; } else { - return 5; + return supportedExtensions.length; } } ts.getNextLowestExtensionPriority = getNextLowestExtensionPriority; @@ -1782,6 +2873,13 @@ var ts; getTypeConstructor: function () { return Type; }, getSignatureConstructor: function () { return Signature; } }; + var AssertionLevel; + (function (AssertionLevel) { + AssertionLevel[AssertionLevel["None"] = 0] = "None"; + AssertionLevel[AssertionLevel["Normal"] = 1] = "Normal"; + AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive"; + AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive"; + })(AssertionLevel = ts.AssertionLevel || (ts.AssertionLevel = {})); var Debug; (function (Debug) { Debug.currentAssertionLevel = 0; @@ -1933,136 +3031,29 @@ var ts; } } ts.tryGetExtensionFromPath = tryGetExtensionFromPath; + function isCheckJsEnabledForFile(sourceFile, compilerOptions) { + return sourceFile.checkJsDirective ? sourceFile.checkJsDirective.enabled : compilerOptions.checkJs; + } + ts.isCheckJsEnabledForFile = isCheckJsEnabledForFile; })(ts || (ts = {})); var ts; (function (ts) { - ts.sys = (function () { - function getWScriptSystem() { - var fso = new ActiveXObject("Scripting.FileSystemObject"); - var shell = new ActiveXObject("WScript.Shell"); - var fileStream = new ActiveXObject("ADODB.Stream"); - fileStream.Type = 2; - var binaryStream = new ActiveXObject("ADODB.Stream"); - binaryStream.Type = 1; - var args = []; - for (var i = 0; i < WScript.Arguments.length; i++) { - args[i] = WScript.Arguments.Item(i); - } - function readFile(fileName, encoding) { - if (!fso.FileExists(fileName)) { - return undefined; - } - fileStream.Open(); - try { - if (encoding) { - fileStream.Charset = encoding; - fileStream.LoadFromFile(fileName); - } - else { - fileStream.Charset = "x-ansi"; - fileStream.LoadFromFile(fileName); - var bom = fileStream.ReadText(2) || ""; - fileStream.Position = 0; - fileStream.Charset = bom.length >= 2 && (bom.charCodeAt(0) === 0xFF && bom.charCodeAt(1) === 0xFE || bom.charCodeAt(0) === 0xFE && bom.charCodeAt(1) === 0xFF) ? "unicode" : "utf-8"; - } - return fileStream.ReadText(); - } - catch (e) { - throw e; - } - finally { - fileStream.Close(); - } - } - function writeFile(fileName, data, writeByteOrderMark) { - fileStream.Open(); - binaryStream.Open(); - try { - fileStream.Charset = "utf-8"; - fileStream.WriteText(data); - if (writeByteOrderMark) { - fileStream.Position = 0; - } - else { - fileStream.Position = 3; - } - fileStream.CopyTo(binaryStream); - binaryStream.SaveToFile(fileName, 2); - } - finally { - binaryStream.Close(); - fileStream.Close(); - } - } - function getNames(collection) { - var result = []; - for (var e = new Enumerator(collection); !e.atEnd(); e.moveNext()) { - result.push(e.item().Name); - } - return result.sort(); - } - function getDirectories(path) { - var folder = fso.GetFolder(path); - return getNames(folder.subfolders); - } - function getAccessibleFileSystemEntries(path) { - try { - var folder = fso.GetFolder(path || "."); - var files = getNames(folder.files); - var directories = getNames(folder.subfolders); - return { files: files, directories: directories }; - } - catch (e) { - return { files: [], directories: [] }; - } - } - function readDirectory(path, extensions, excludes, includes) { - return ts.matchFiles(path, extensions, excludes, includes, false, shell.CurrentDirectory, getAccessibleFileSystemEntries); - } - var wscriptSystem = { - args: args, - newLine: "\r\n", - useCaseSensitiveFileNames: false, - write: function (s) { - WScript.StdOut.Write(s); - }, - readFile: readFile, - writeFile: writeFile, - resolvePath: function (path) { - return fso.GetAbsolutePathName(path); - }, - fileExists: function (path) { - return fso.FileExists(path); - }, - directoryExists: function (path) { - return fso.FolderExists(path); - }, - createDirectory: function (directoryName) { - if (!wscriptSystem.directoryExists(directoryName)) { - fso.CreateFolder(directoryName); - } - }, - getExecutingFilePath: function () { - return WScript.ScriptFullName; - }, - getCurrentDirectory: function () { - return shell.CurrentDirectory; - }, - getDirectories: getDirectories, - getEnvironmentVariable: function (name) { - return new ActiveXObject("WScript.Shell").ExpandEnvironmentStrings("%" + name + "%"); - }, - readDirectory: readDirectory, - exit: function (exitCode) { - try { - WScript.Quit(exitCode); - } - catch (e) { - } - } - }; - return wscriptSystem; + function getNodeMajorVersion() { + if (typeof process === "undefined") { + return undefined; } + var version = process.version; + if (!version) { + return undefined; + } + var dot = version.indexOf("."); + if (dot === -1) { + return undefined; + } + return parseInt(version.substring(1, dot)); + } + ts.getNodeMajorVersion = getNodeMajorVersion; + ts.sys = (function () { function getNodeSystem() { var _fs = require("fs"); var _path = require("path"); @@ -2071,32 +3062,32 @@ var ts; var useNonPollingWatchers = process.env["TSC_NONPOLLING_WATCHER"]; function createWatchedFileSet() { var dirWatchers = ts.createMap(); - var fileWatcherCallbacks = ts.createMap(); + var fileWatcherCallbacks = ts.createMultiMap(); return { addFile: addFile, removeFile: removeFile }; function reduceDirWatcherRefCountForFile(fileName) { var dirName = ts.getDirectoryPath(fileName); - var watcher = dirWatchers[dirName]; + var watcher = dirWatchers.get(dirName); if (watcher) { watcher.referenceCount -= 1; if (watcher.referenceCount <= 0) { watcher.close(); - delete dirWatchers[dirName]; + dirWatchers.delete(dirName); } } } function addDirWatcher(dirPath) { - var watcher = dirWatchers[dirPath]; + var watcher = dirWatchers.get(dirPath); if (watcher) { watcher.referenceCount += 1; return; } watcher = _fs.watch(dirPath, { persistent: true }, function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); watcher.referenceCount = 1; - dirWatchers[dirPath] = watcher; + dirWatchers.set(dirPath, watcher); return; } function addFileWatcherCallback(filePath, callback) { - ts.multiMapAdd(fileWatcherCallbacks, filePath, callback); + fileWatcherCallbacks.add(filePath, callback); } function addFile(fileName, callback) { addFileWatcherCallback(fileName, callback); @@ -2108,24 +3099,26 @@ var ts; reduceDirWatcherRefCountForFile(watchedFile.fileName); } function removeFileWatcherCallback(filePath, callback) { - ts.multiMapRemove(fileWatcherCallbacks, filePath, callback); + fileWatcherCallbacks.remove(filePath, callback); } function fileEventHandler(eventName, relativeFileName, baseDirPath) { var fileName = typeof relativeFileName !== "string" ? undefined : ts.getNormalizedAbsolutePath(relativeFileName, baseDirPath); - if ((eventName === "change" || eventName === "rename") && fileWatcherCallbacks[fileName]) { - for (var _i = 0, _a = fileWatcherCallbacks[fileName]; _i < _a.length; _i++) { - var fileCallback = _a[_i]; - fileCallback(fileName); + if ((eventName === "change" || eventName === "rename")) { + var callbacks = fileWatcherCallbacks.get(fileName); + if (callbacks) { + for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) { + var fileCallback = callbacks_1[_i]; + fileCallback(fileName); + } } } } } var watchedFileSet = createWatchedFileSet(); - function isNode4OrLater() { - return parseInt(process.version.charAt(1)) >= 4; - } + var nodeVersion = getNodeMajorVersion(); + var isNode4OrLater = nodeVersion >= 4; function isFileSystemCaseSensitive() { if (platform === "win32" || platform === "win64") { return false; @@ -2182,10 +3175,10 @@ var ts; if (entry === "." || entry === "..") { continue; } - var name_3 = ts.combinePaths(path, entry); + var name = ts.combinePaths(path, entry); var stat = void 0; try { - stat = _fs.statSync(name_3); + stat = _fs.statSync(name); } catch (e) { continue; @@ -2206,6 +3199,11 @@ var ts; function readDirectory(path, extensions, excludes, includes) { return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), getAccessibleFileSystemEntries); } + var FileSystemEntryKind; + (function (FileSystemEntryKind) { + FileSystemEntryKind[FileSystemEntryKind["File"] = 0] = "File"; + FileSystemEntryKind[FileSystemEntryKind["Directory"] = 1] = "Directory"; + })(FileSystemEntryKind || (FileSystemEntryKind = {})); function fileSystemEntryExists(path, entryKind) { try { var stat = _fs.statSync(path); @@ -2262,7 +3260,7 @@ var ts; if (!directoryExists(directoryName)) { return noOpFileWatcher; } - if (isNode4OrLater() && (process.platform === "win32" || process.platform === "darwin")) { + if (isNode4OrLater && (process.platform === "win32" || process.platform === "darwin")) { options = { persistent: true, recursive: !!recursive }; } else { @@ -2272,7 +3270,6 @@ var ts; if (eventName === "rename") { callback(!relativeFileName ? relativeFileName : ts.normalizePath(ts.combinePaths(directoryName, relativeFileName))); } - ; }); }, resolvePath: function (path) { @@ -2389,9 +3386,6 @@ var ts; if (typeof ChakraHost !== "undefined") { sys = getChakraSystem(); } - else if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { - sys = getWScriptSystem(); - } else if (typeof process !== "undefined" && process.nextTick && !process.browser && typeof require !== "undefined") { sys = getNodeSystem(); } @@ -2460,11 +3454,11 @@ var ts; Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value: { code: 1055, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055", message: "Type '{0}' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value." }, Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: ts.DiagnosticCategory.Error, key: "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056", message: "Accessors are only available when targeting ECMAScript 5 and higher." }, An_async_function_or_method_must_have_a_valid_awaitable_return_type: { code: 1057, category: ts.DiagnosticCategory.Error, key: "An_async_function_or_method_must_have_a_valid_awaitable_return_type_1057", message: "An async function or method must have a valid awaitable return type." }, - Operand_for_await_does_not_have_a_valid_callable_then_member: { code: 1058, category: ts.DiagnosticCategory.Error, key: "Operand_for_await_does_not_have_a_valid_callable_then_member_1058", message: "Operand for 'await' does not have a valid callable 'then' member." }, - Return_expression_in_async_function_does_not_have_a_valid_callable_then_member: { code: 1059, category: ts.DiagnosticCategory.Error, key: "Return_expression_in_async_function_does_not_have_a_valid_callable_then_member_1059", message: "Return expression in async function does not have a valid callable 'then' member." }, - Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member: { code: 1060, category: ts.DiagnosticCategory.Error, key: "Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member_1060", message: "Expression body for async arrow function does not have a valid callable 'then' member." }, + The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1058, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058", message: "The return type of an async function must either be a valid promise or must not contain a callable 'then' member." }, + A_promise_must_have_a_then_method: { code: 1059, category: ts.DiagnosticCategory.Error, key: "A_promise_must_have_a_then_method_1059", message: "A promise must have a 'then' method." }, + The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback: { code: 1060, category: ts.DiagnosticCategory.Error, key: "The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060", message: "The first parameter of the 'then' method of a promise must be a callback." }, Enum_member_must_have_initializer: { code: 1061, category: ts.DiagnosticCategory.Error, key: "Enum_member_must_have_initializer_1061", message: "Enum member must have initializer." }, - _0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: { code: 1062, category: ts.DiagnosticCategory.Error, key: "_0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062", message: "{0} is referenced directly or indirectly in the fulfillment callback of its own 'then' method." }, + Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: { code: 1062, category: ts.DiagnosticCategory.Error, key: "Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062", message: "Type is referenced directly or indirectly in the fulfillment callback of its own 'then' method." }, An_export_assignment_cannot_be_used_in_a_namespace: { code: 1063, category: ts.DiagnosticCategory.Error, key: "An_export_assignment_cannot_be_used_in_a_namespace_1063", message: "An export assignment cannot be used in a namespace." }, The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type: { code: 1064, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1064", message: "The return type of an async function or method must be the global Promise type." }, In_ambient_enum_declarations_member_initializer_must_be_constant_expression: { code: 1066, category: ts.DiagnosticCategory.Error, key: "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066", message: "In ambient enum declarations member initializer must be constant expression." }, @@ -2473,7 +3467,7 @@ var ts; _0_modifier_cannot_appear_on_an_index_signature: { code: 1071, category: ts.DiagnosticCategory.Error, key: "_0_modifier_cannot_appear_on_an_index_signature_1071", message: "'{0}' modifier cannot appear on an index signature." }, A_0_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: ts.DiagnosticCategory.Error, key: "A_0_modifier_cannot_be_used_with_an_import_declaration_1079", message: "A '{0}' modifier cannot be used with an import declaration." }, Invalid_reference_directive_syntax: { code: 1084, category: ts.DiagnosticCategory.Error, key: "Invalid_reference_directive_syntax_1084", message: "Invalid 'reference' directive syntax." }, - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: ts.DiagnosticCategory.Error, key: "Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_1085", message: "Octal literals are not available when targeting ECMAScript 5 and higher." }, + Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0: { code: 1085, category: ts.DiagnosticCategory.Error, key: "Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0_1085", message: "Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '{0}'." }, An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: ts.DiagnosticCategory.Error, key: "An_accessor_cannot_be_declared_in_an_ambient_context_1086", message: "An accessor cannot be declared in an ambient context." }, _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: ts.DiagnosticCategory.Error, key: "_0_modifier_cannot_appear_on_a_constructor_declaration_1089", message: "'{0}' modifier cannot appear on a constructor declaration." }, _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: ts.DiagnosticCategory.Error, key: "_0_modifier_cannot_appear_on_a_parameter_1090", message: "'{0}' modifier cannot appear on a parameter." }, @@ -2489,6 +3483,7 @@ var ts; Invalid_use_of_0_in_strict_mode: { code: 1100, category: ts.DiagnosticCategory.Error, key: "Invalid_use_of_0_in_strict_mode_1100", message: "Invalid use of '{0}' in strict mode." }, with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: ts.DiagnosticCategory.Error, key: "with_statements_are_not_allowed_in_strict_mode_1101", message: "'with' statements are not allowed in strict mode." }, delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: ts.DiagnosticCategory.Error, key: "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102", message: "'delete' cannot be called on an identifier in strict mode." }, + A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator: { code: 1103, category: ts.DiagnosticCategory.Error, key: "A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator_1103", message: "A 'for-await-of' statement is only allowed within an async function or async generator." }, A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: ts.DiagnosticCategory.Error, key: "A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104", message: "A 'continue' statement can only be used within an enclosing iteration statement." }, A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: ts.DiagnosticCategory.Error, key: "A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105", message: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, Jump_target_cannot_cross_function_boundary: { code: 1107, category: ts.DiagnosticCategory.Error, key: "Jump_target_cannot_cross_function_boundary_1107", message: "Jump target cannot cross function boundary." }, @@ -2496,7 +3491,7 @@ var ts; Expression_expected: { code: 1109, category: ts.DiagnosticCategory.Error, key: "Expression_expected_1109", message: "Expression expected." }, Type_expected: { code: 1110, category: ts.DiagnosticCategory.Error, key: "Type_expected_1110", message: "Type expected." }, A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: ts.DiagnosticCategory.Error, key: "A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113", message: "A 'default' clause cannot appear more than once in a 'switch' statement." }, - Duplicate_label_0: { code: 1114, category: ts.DiagnosticCategory.Error, key: "Duplicate_label_0_1114", message: "Duplicate label '{0}'" }, + Duplicate_label_0: { code: 1114, category: ts.DiagnosticCategory.Error, key: "Duplicate_label_0_1114", message: "Duplicate label '{0}'." }, A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: ts.DiagnosticCategory.Error, key: "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", message: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: ts.DiagnosticCategory.Error, key: "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", message: "A 'break' statement can only jump to a label of an enclosing statement." }, An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: ts.DiagnosticCategory.Error, key: "An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode_1117", message: "An object literal cannot have multiple properties with the same name in strict mode." }, @@ -2528,9 +3523,9 @@ var ts; Declaration_expected: { code: 1146, category: ts.DiagnosticCategory.Error, key: "Declaration_expected_1146", message: "Declaration expected." }, Import_declarations_in_a_namespace_cannot_reference_a_module: { code: 1147, category: ts.DiagnosticCategory.Error, key: "Import_declarations_in_a_namespace_cannot_reference_a_module_1147", message: "Import declarations in a namespace cannot reference a module." }, Cannot_use_imports_exports_or_module_augmentations_when_module_is_none: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148", message: "Cannot use imports, exports, or module augmentations when '--module' is 'none'." }, - File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", message: "File name '{0}' differs from already included file name '{1}' only in casing" }, + File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", message: "File name '{0}' differs from already included file name '{1}' only in casing." }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: ts.DiagnosticCategory.Error, key: "new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead_1150", message: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "const_declarations_must_be_initialized_1155", message: "'const' declarations must be initialized" }, + const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "const_declarations_must_be_initialized_1155", message: "'const' declarations must be initialized." }, const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: ts.DiagnosticCategory.Error, key: "const_declarations_can_only_be_declared_inside_a_block_1156", message: "'const' declarations can only be declared inside a block." }, let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: ts.DiagnosticCategory.Error, key: "let_declarations_can_only_be_declared_inside_a_block_1157", message: "'let' declarations can only be declared inside a block." }, Unterminated_template_literal: { code: 1160, category: ts.DiagnosticCategory.Error, key: "Unterminated_template_literal_1160", message: "Unterminated template literal." }, @@ -2579,11 +3574,12 @@ var ts; Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided_1208", message: "Cannot compile namespaces when the '--isolatedModules' flag is provided." }, Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided_1209", message: "Ambient const enums are not allowed when the '--isolatedModules' flag is provided." }, Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode_1210", message: "Invalid use of '{0}'. Class definitions are automatically in strict mode." }, - A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", message: "A class declaration without the 'default' modifier must have a name" }, - Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", message: "Identifier expected. '{0}' is a reserved word in strict mode" }, + A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", message: "A class declaration without the 'default' modifier must have a name." }, + Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", message: "Identifier expected. '{0}' is a reserved word in strict mode." }, Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213", message: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode: { code: 1214, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214", message: "Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode." }, Invalid_use_of_0_Modules_are_automatically_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215", message: "Invalid use of '{0}'. Modules are automatically in strict mode." }, + Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216", message: "Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules." }, Export_assignment_is_not_supported_when_module_flag_is_system: { code: 1218, category: ts.DiagnosticCategory.Error, key: "Export_assignment_is_not_supported_when_module_flag_is_system_1218", message: "Export assignment is not supported when '--module' flag is 'system'." }, Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning: { code: 1219, category: ts.DiagnosticCategory.Error, key: "Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219", message: "Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning." }, Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher: { code: 1220, category: ts.DiagnosticCategory.Error, key: "Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher_1220", message: "Generators are only available when targeting ECMAScript 2015 or higher." }, @@ -2629,6 +3625,11 @@ var ts; Global_module_exports_may_only_appear_in_declaration_files: { code: 1315, category: ts.DiagnosticCategory.Error, key: "Global_module_exports_may_only_appear_in_declaration_files_1315", message: "Global module exports may only appear in declaration files." }, Global_module_exports_may_only_appear_at_top_level: { code: 1316, category: ts.DiagnosticCategory.Error, key: "Global_module_exports_may_only_appear_at_top_level_1316", message: "Global module exports may only appear at top level." }, A_parameter_property_cannot_be_declared_using_a_rest_parameter: { code: 1317, category: ts.DiagnosticCategory.Error, key: "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317", message: "A parameter property cannot be declared using a rest parameter." }, + An_abstract_accessor_cannot_have_an_implementation: { code: 1318, category: ts.DiagnosticCategory.Error, key: "An_abstract_accessor_cannot_have_an_implementation_1318", message: "An abstract accessor cannot have an implementation." }, + A_default_export_can_only_be_used_in_an_ECMAScript_style_module: { code: 1319, category: ts.DiagnosticCategory.Error, key: "A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319", message: "A default export can only be used in an ECMAScript-style module." }, + Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1320, category: ts.DiagnosticCategory.Error, key: "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320", message: "Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member." }, + Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1321, category: ts.DiagnosticCategory.Error, key: "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321", message: "Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member." }, + Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1322, category: ts.DiagnosticCategory.Error, key: "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322", message: "Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member." }, Duplicate_identifier_0: { code: 2300, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_2300", message: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: ts.DiagnosticCategory.Error, key: "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", message: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: ts.DiagnosticCategory.Error, key: "Static_members_cannot_reference_class_type_parameters_2302", message: "Static members cannot reference class type parameters." }, @@ -2672,6 +3673,7 @@ var ts; Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: ts.DiagnosticCategory.Error, key: "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340", message: "Only public and protected methods of the base class are accessible via the 'super' keyword." }, Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: ts.DiagnosticCategory.Error, key: "Property_0_is_private_and_only_accessible_within_class_1_2341", message: "Property '{0}' is private and only accessible within class '{1}'." }, An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { code: 2342, category: ts.DiagnosticCategory.Error, key: "An_index_expression_argument_must_be_of_type_string_number_symbol_or_any_2342", message: "An index expression argument must be of type 'string', 'number', 'symbol', or 'any'." }, + This_syntax_requires_an_imported_helper_named_1_but_module_0_has_no_exported_member_1: { code: 2343, category: ts.DiagnosticCategory.Error, key: "This_syntax_requires_an_imported_helper_named_1_but_module_0_has_no_exported_member_1_2343", message: "This syntax requires an imported helper named '{1}', but module '{0}' has no exported member '{1}'." }, Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: ts.DiagnosticCategory.Error, key: "Type_0_does_not_satisfy_the_constraint_1_2344", message: "Type '{0}' does not satisfy the constraint '{1}'." }, Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: ts.DiagnosticCategory.Error, key: "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345", message: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: ts.DiagnosticCategory.Error, key: "Supplied_parameters_do_not_match_any_signature_of_call_target_2346", message: "Supplied parameters do not match any signature of call target." }, @@ -2682,19 +3684,20 @@ var ts; Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: ts.DiagnosticCategory.Error, key: "Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature_2351", message: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, Type_0_cannot_be_converted_to_type_1: { code: 2352, category: ts.DiagnosticCategory.Error, key: "Type_0_cannot_be_converted_to_type_1_2352", message: "Type '{0}' cannot be converted to type '{1}'." }, Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1: { code: 2353, category: ts.DiagnosticCategory.Error, key: "Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353", message: "Object literal may only specify known properties, and '{0}' does not exist in type '{1}'." }, + This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found: { code: 2354, category: ts.DiagnosticCategory.Error, key: "This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354", message: "This syntax requires an imported helper but module '{0}' cannot be found." }, A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value: { code: 2355, category: ts.DiagnosticCategory.Error, key: "A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_2355", message: "A function whose declared type is neither 'void' nor 'any' must return a value." }, An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: ts.DiagnosticCategory.Error, key: "An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type_2356", message: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access: { code: 2357, category: ts.DiagnosticCategory.Error, key: "The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357", message: "The operand of an increment or decrement operator must be a variable or a property access." }, The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358", message: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359", message: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { code: 2360, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol_2360", message: "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'." }, - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter_2361", message: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter_2361", message: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter." }, The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2362", message: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2363", message: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access: { code: 2364, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364", message: "The left-hand side of an assignment expression must be a variable or a property access." }, Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: ts.DiagnosticCategory.Error, key: "Operator_0_cannot_be_applied_to_types_1_and_2_2365", message: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined: { code: 2366, category: ts.DiagnosticCategory.Error, key: "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366", message: "Function lacks ending return statement and return type does not include 'undefined'." }, - Type_parameter_name_cannot_be_0: { code: 2368, category: ts.DiagnosticCategory.Error, key: "Type_parameter_name_cannot_be_0_2368", message: "Type parameter name cannot be '{0}'" }, + Type_parameter_name_cannot_be_0: { code: 2368, category: ts.DiagnosticCategory.Error, key: "Type_parameter_name_cannot_be_0_2368", message: "Type parameter name cannot be '{0}'." }, A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: ts.DiagnosticCategory.Error, key: "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369", message: "A parameter property is only allowed in a constructor implementation." }, A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: ts.DiagnosticCategory.Error, key: "A_rest_parameter_must_be_of_an_array_type_2370", message: "A rest parameter must be of an array type." }, A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: ts.DiagnosticCategory.Error, key: "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371", message: "A parameter initializer is only allowed in a function or constructor implementation." }, @@ -2734,12 +3737,12 @@ var ts; The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access: { code: 2406, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406", message: "The left-hand side of a 'for...in' statement must be a variable or a property access." }, The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_2407", message: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, Setters_cannot_return_a_value: { code: 2408, category: ts.DiagnosticCategory.Error, key: "Setters_cannot_return_a_value_2408", message: "Setters cannot return a value." }, - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: ts.DiagnosticCategory.Error, key: "Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409", message: "Return type of constructor signature must be assignable to the instance type of the class" }, + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: ts.DiagnosticCategory.Error, key: "Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409", message: "Return type of constructor signature must be assignable to the instance type of the class." }, The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any: { code: 2410, category: ts.DiagnosticCategory.Error, key: "The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410", message: "The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'." }, Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: ts.DiagnosticCategory.Error, key: "Property_0_of_type_1_is_not_assignable_to_string_index_type_2_2411", message: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: ts.DiagnosticCategory.Error, key: "Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2_2412", message: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: ts.DiagnosticCategory.Error, key: "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413", message: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, - Class_name_cannot_be_0: { code: 2414, category: ts.DiagnosticCategory.Error, key: "Class_name_cannot_be_0_2414", message: "Class name cannot be '{0}'" }, + Class_name_cannot_be_0: { code: 2414, category: ts.DiagnosticCategory.Error, key: "Class_name_cannot_be_0_2414", message: "Class name cannot be '{0}'." }, Class_0_incorrectly_extends_base_class_1: { code: 2415, category: ts.DiagnosticCategory.Error, key: "Class_0_incorrectly_extends_base_class_1_2415", message: "Class '{0}' incorrectly extends base class '{1}'." }, Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: ts.DiagnosticCategory.Error, key: "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", message: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, Class_0_incorrectly_implements_interface_1: { code: 2420, category: ts.DiagnosticCategory.Error, key: "Class_0_incorrectly_implements_interface_1_2420", message: "Class '{0}' incorrectly implements interface '{1}'." }, @@ -2748,19 +3751,19 @@ var ts; Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: ts.DiagnosticCategory.Error, key: "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424", message: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: ts.DiagnosticCategory.Error, key: "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425", message: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: ts.DiagnosticCategory.Error, key: "Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426", message: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Interface_name_cannot_be_0: { code: 2427, category: ts.DiagnosticCategory.Error, key: "Interface_name_cannot_be_0_2427", message: "Interface name cannot be '{0}'" }, + Interface_name_cannot_be_0: { code: 2427, category: ts.DiagnosticCategory.Error, key: "Interface_name_cannot_be_0_2427", message: "Interface name cannot be '{0}'." }, All_declarations_of_0_must_have_identical_type_parameters: { code: 2428, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_0_must_have_identical_type_parameters_2428", message: "All declarations of '{0}' must have identical type parameters." }, Interface_0_incorrectly_extends_interface_1: { code: 2430, category: ts.DiagnosticCategory.Error, key: "Interface_0_incorrectly_extends_interface_1_2430", message: "Interface '{0}' incorrectly extends interface '{1}'." }, - Enum_name_cannot_be_0: { code: 2431, category: ts.DiagnosticCategory.Error, key: "Enum_name_cannot_be_0_2431", message: "Enum name cannot be '{0}'" }, + Enum_name_cannot_be_0: { code: 2431, category: ts.DiagnosticCategory.Error, key: "Enum_name_cannot_be_0_2431", message: "Enum name cannot be '{0}'." }, In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: ts.DiagnosticCategory.Error, key: "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432", message: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433", message: "A namespace declaration cannot be in a different file from a class or function with which it is merged" }, - A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434", message: "A namespace declaration cannot be located prior to a class or function with which it is merged" }, + A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433", message: "A namespace declaration cannot be in a different file from a class or function with which it is merged." }, + A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434", message: "A namespace declaration cannot be located prior to a class or function with which it is merged." }, Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces: { code: 2435, category: ts.DiagnosticCategory.Error, key: "Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435", message: "Ambient modules cannot be nested in other modules or namespaces." }, Ambient_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: ts.DiagnosticCategory.Error, key: "Ambient_module_declaration_cannot_specify_relative_module_name_2436", message: "Ambient module declaration cannot specify relative module name." }, - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: ts.DiagnosticCategory.Error, key: "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437", message: "Module '{0}' is hidden by a local declaration with the same name" }, - Import_name_cannot_be_0: { code: 2438, category: ts.DiagnosticCategory.Error, key: "Import_name_cannot_be_0_2438", message: "Import name cannot be '{0}'" }, + Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: ts.DiagnosticCategory.Error, key: "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437", message: "Module '{0}' is hidden by a local declaration with the same name." }, + Import_name_cannot_be_0: { code: 2438, category: ts.DiagnosticCategory.Error, key: "Import_name_cannot_be_0_2438", message: "Import name cannot be '{0}'." }, Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name: { code: 2439, category: ts.DiagnosticCategory.Error, key: "Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439", message: "Import or export declaration in an ambient module declaration cannot reference module through relative module name." }, - Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: ts.DiagnosticCategory.Error, key: "Import_declaration_conflicts_with_local_declaration_of_0_2440", message: "Import declaration conflicts with local declaration of '{0}'" }, + Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: ts.DiagnosticCategory.Error, key: "Import_declaration_conflicts_with_local_declaration_of_0_2440", message: "Import declaration conflicts with local declaration of '{0}'." }, Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module: { code: 2441, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441", message: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module." }, Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: ts.DiagnosticCategory.Error, key: "Types_have_separate_declarations_of_a_private_property_0_2442", message: "Types have separate declarations of a private property '{0}'." }, Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: ts.DiagnosticCategory.Error, key: "Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443", message: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, @@ -2769,18 +3772,20 @@ var ts; Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: ts.DiagnosticCategory.Error, key: "Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_2446", message: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: ts.DiagnosticCategory.Error, key: "The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447", message: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: ts.DiagnosticCategory.Error, key: "Block_scoped_variable_0_used_before_its_declaration_2448", message: "Block-scoped variable '{0}' used before its declaration." }, + Class_0_used_before_its_declaration: { code: 2449, category: ts.DiagnosticCategory.Error, key: "Class_0_used_before_its_declaration_2449", message: "Class '{0}' used before its declaration." }, + Enum_0_used_before_its_declaration: { code: 2450, category: ts.DiagnosticCategory.Error, key: "Enum_0_used_before_its_declaration_2450", message: "Enum '{0}' used before its declaration." }, Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_block_scoped_variable_0_2451", message: "Cannot redeclare block-scoped variable '{0}'." }, An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: ts.DiagnosticCategory.Error, key: "An_enum_member_cannot_have_a_numeric_name_2452", message: "An enum member cannot have a numeric name." }, The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: ts.DiagnosticCategory.Error, key: "The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_typ_2453", message: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, Variable_0_is_used_before_being_assigned: { code: 2454, category: ts.DiagnosticCategory.Error, key: "Variable_0_is_used_before_being_assigned_2454", message: "Variable '{0}' is used before being assigned." }, Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: ts.DiagnosticCategory.Error, key: "Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0_2455", message: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, Type_alias_0_circularly_references_itself: { code: 2456, category: ts.DiagnosticCategory.Error, key: "Type_alias_0_circularly_references_itself_2456", message: "Type alias '{0}' circularly references itself." }, - Type_alias_name_cannot_be_0: { code: 2457, category: ts.DiagnosticCategory.Error, key: "Type_alias_name_cannot_be_0_2457", message: "Type alias name cannot be '{0}'" }, + Type_alias_name_cannot_be_0: { code: 2457, category: ts.DiagnosticCategory.Error, key: "Type_alias_name_cannot_be_0_2457", message: "Type alias name cannot be '{0}'." }, An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: ts.DiagnosticCategory.Error, key: "An_AMD_module_cannot_have_multiple_name_assignments_2458", message: "An AMD module cannot have multiple name assignments." }, Type_0_has_no_property_1_and_no_string_index_signature: { code: 2459, category: ts.DiagnosticCategory.Error, key: "Type_0_has_no_property_1_and_no_string_index_signature_2459", message: "Type '{0}' has no property '{1}' and no string index signature." }, Type_0_has_no_property_1: { code: 2460, category: ts.DiagnosticCategory.Error, key: "Type_0_has_no_property_1_2460", message: "Type '{0}' has no property '{1}'." }, Type_0_is_not_an_array_type: { code: 2461, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_2461", message: "Type '{0}' is not an array type." }, - A_rest_element_must_be_last_in_a_destructuring_pattern: { code: 2462, category: ts.DiagnosticCategory.Error, key: "A_rest_element_must_be_last_in_a_destructuring_pattern_2462", message: "A rest element must be last in a destructuring pattern" }, + A_rest_element_must_be_last_in_a_destructuring_pattern: { code: 2462, category: ts.DiagnosticCategory.Error, key: "A_rest_element_must_be_last_in_a_destructuring_pattern_2462", message: "A rest element must be last in a destructuring pattern." }, A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { code: 2463, category: ts.DiagnosticCategory.Error, key: "A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463", message: "A binding pattern parameter cannot be optional in an implementation signature." }, A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { code: 2464, category: ts.DiagnosticCategory.Error, key: "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464", message: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." }, this_cannot_be_referenced_in_a_computed_property_name: { code: 2465, category: ts.DiagnosticCategory.Error, key: "this_cannot_be_referenced_in_a_computed_property_name_2465", message: "'this' cannot be referenced in a computed property name." }, @@ -2801,13 +3806,13 @@ var ts; let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2480, category: ts.DiagnosticCategory.Error, key: "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480", message: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2481, category: ts.DiagnosticCategory.Error, key: "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481", message: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." }, The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { code: 2483, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483", message: "The left-hand side of a 'for...of' statement cannot use a type annotation." }, - Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: ts.DiagnosticCategory.Error, key: "Export_declaration_conflicts_with_exported_declaration_of_0_2484", message: "Export declaration conflicts with exported declaration of '{0}'" }, + Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: ts.DiagnosticCategory.Error, key: "Export_declaration_conflicts_with_exported_declaration_of_0_2484", message: "Export declaration conflicts with exported declaration of '{0}'." }, The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access: { code: 2487, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487", message: "The left-hand side of a 'for...of' statement must be a variable or a property access." }, Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: ts.DiagnosticCategory.Error, key: "Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488", message: "Type must have a '[Symbol.iterator]()' method that returns an iterator." }, An_iterator_must_have_a_next_method: { code: 2489, category: ts.DiagnosticCategory.Error, key: "An_iterator_must_have_a_next_method_2489", message: "An iterator must have a 'next()' method." }, The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { code: 2490, category: ts.DiagnosticCategory.Error, key: "The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property_2490", message: "The type returned by the 'next()' method of an iterator must have a 'value' property." }, The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { code: 2491, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491", message: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." }, - Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_identifier_0_in_catch_clause_2492", message: "Cannot redeclare identifier '{0}' in catch clause" }, + Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_identifier_0_in_catch_clause_2492", message: "Cannot redeclare identifier '{0}' in catch clause." }, Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { code: 2493, category: ts.DiagnosticCategory.Error, key: "Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2_2493", message: "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'." }, Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { code: 2494, category: ts.DiagnosticCategory.Error, key: "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494", message: "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher." }, Type_0_is_not_an_array_type_or_a_string_type: { code: 2495, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_or_a_string_type_2495", message: "Type '{0}' is not an array type or a string type." }, @@ -2819,6 +3824,7 @@ var ts; A_rest_element_cannot_contain_a_binding_pattern: { code: 2501, category: ts.DiagnosticCategory.Error, key: "A_rest_element_cannot_contain_a_binding_pattern_2501", message: "A rest element cannot contain a binding pattern." }, _0_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 2502, category: ts.DiagnosticCategory.Error, key: "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502", message: "'{0}' is referenced directly or indirectly in its own type annotation." }, Cannot_find_namespace_0: { code: 2503, category: ts.DiagnosticCategory.Error, key: "Cannot_find_namespace_0_2503", message: "Cannot find namespace '{0}'." }, + Type_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator: { code: 2504, category: ts.DiagnosticCategory.Error, key: "Type_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504", message: "Type must have a '[Symbol.asyncIterator]()' method that returns an async iterator." }, A_generator_cannot_have_a_void_type_annotation: { code: 2505, category: ts.DiagnosticCategory.Error, key: "A_generator_cannot_have_a_void_type_annotation_2505", message: "A generator cannot have a 'void' type annotation." }, _0_is_referenced_directly_or_indirectly_in_its_own_base_expression: { code: 2506, category: ts.DiagnosticCategory.Error, key: "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506", message: "'{0}' is referenced directly or indirectly in its own base expression." }, Type_0_is_not_a_constructor_function_type: { code: 2507, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_a_constructor_function_type_2507", message: "Type '{0}' is not a constructor function type." }, @@ -2833,6 +3839,7 @@ var ts; All_declarations_of_an_abstract_method_must_be_consecutive: { code: 2516, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_an_abstract_method_must_be_consecutive_2516", message: "All declarations of an abstract method must be consecutive." }, Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: { code: 2517, category: ts.DiagnosticCategory.Error, key: "Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517", message: "Cannot assign an abstract constructor type to a non-abstract constructor type." }, A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: { code: 2518, category: ts.DiagnosticCategory.Error, key: "A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518", message: "A 'this'-based type guard is not compatible with a parameter-based type guard." }, + An_async_iterator_must_have_a_next_method: { code: 2519, category: ts.DiagnosticCategory.Error, key: "An_async_iterator_must_have_a_next_method_2519", message: "An async iterator must have a 'next()' method." }, Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: { code: 2520, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520", message: "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions." }, Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: { code: 2521, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions_2521", message: "Expression resolves to variable declaration '{0}' that compiler uses to support async functions." }, The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method: { code: 2522, category: ts.DiagnosticCategory.Error, key: "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522", message: "The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method." }, @@ -2856,23 +3863,33 @@ var ts; Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property: { code: 2540, category: ts.DiagnosticCategory.Error, key: "Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property_2540", message: "Cannot assign to '{0}' because it is a constant or a read-only property." }, The_target_of_an_assignment_must_be_a_variable_or_a_property_access: { code: 2541, category: ts.DiagnosticCategory.Error, key: "The_target_of_an_assignment_must_be_a_variable_or_a_property_access_2541", message: "The target of an assignment must be a variable or a property access." }, Index_signature_in_type_0_only_permits_reading: { code: 2542, category: ts.DiagnosticCategory.Error, key: "Index_signature_in_type_0_only_permits_reading_2542", message: "Index signature in type '{0}' only permits reading." }, + Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference: { code: 2543, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543", message: "Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference." }, + Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference: { code: 2544, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544", message: "Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference." }, + A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any: { code: 2545, category: ts.DiagnosticCategory.Error, key: "A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545", message: "A mixin class must have a constructor with a single rest parameter of type 'any[]'." }, + Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1: { code: 2546, category: ts.DiagnosticCategory.Error, key: "Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1_2546", message: "Property '{0}' has conflicting declarations and is inaccessible in type '{1}'." }, + The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property: { code: 2547, category: ts.DiagnosticCategory.Error, key: "The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value__2547", message: "The type returned by the 'next()' method of an async iterator must be a promise for a type with a 'value' property." }, + Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2548, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548", message: "Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator." }, + Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2549, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549", message: "Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator." }, + Generic_type_instantiation_is_excessively_deep_and_possibly_infinite: { code: 2550, category: ts.DiagnosticCategory.Error, key: "Generic_type_instantiation_is_excessively_deep_and_possibly_infinite_2550", message: "Generic type instantiation is excessively deep and possibly infinite." }, JSX_element_attributes_type_0_may_not_be_a_union_type: { code: 2600, category: ts.DiagnosticCategory.Error, key: "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", message: "JSX element attributes type '{0}' may not be a union type." }, The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: { code: 2601, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", message: "The return type of a JSX element constructor must return an object type." }, JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: { code: 2602, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", message: "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist." }, - Property_0_in_type_1_is_not_assignable_to_type_2: { code: 2603, category: ts.DiagnosticCategory.Error, key: "Property_0_in_type_1_is_not_assignable_to_type_2_2603", message: "Property '{0}' in type '{1}' is not assignable to type '{2}'" }, + Property_0_in_type_1_is_not_assignable_to_type_2: { code: 2603, category: ts.DiagnosticCategory.Error, key: "Property_0_in_type_1_is_not_assignable_to_type_2_2603", message: "Property '{0}' in type '{1}' is not assignable to type '{2}'." }, JSX_element_type_0_does_not_have_any_construct_or_call_signatures: { code: 2604, category: ts.DiagnosticCategory.Error, key: "JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604", message: "JSX element type '{0}' does not have any construct or call signatures." }, JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements: { code: 2605, category: ts.DiagnosticCategory.Error, key: "JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements_2605", message: "JSX element type '{0}' is not a constructor function for JSX elements." }, Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property: { code: 2606, category: ts.DiagnosticCategory.Error, key: "Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606", message: "Property '{0}' of JSX spread attribute is not assignable to target property." }, - JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property: { code: 2607, category: ts.DiagnosticCategory.Error, key: "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607", message: "JSX element class does not support attributes because it does not have a '{0}' property" }, - The_global_type_JSX_0_may_not_have_more_than_one_property: { code: 2608, category: ts.DiagnosticCategory.Error, key: "The_global_type_JSX_0_may_not_have_more_than_one_property_2608", message: "The global type 'JSX.{0}' may not have more than one property" }, - Cannot_emit_namespaced_JSX_elements_in_React: { code: 2650, category: ts.DiagnosticCategory.Error, key: "Cannot_emit_namespaced_JSX_elements_in_React_2650", message: "Cannot emit namespaced JSX elements in React" }, + JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property: { code: 2607, category: ts.DiagnosticCategory.Error, key: "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607", message: "JSX element class does not support attributes because it does not have a '{0}' property." }, + The_global_type_JSX_0_may_not_have_more_than_one_property: { code: 2608, category: ts.DiagnosticCategory.Error, key: "The_global_type_JSX_0_may_not_have_more_than_one_property_2608", message: "The global type 'JSX.{0}' may not have more than one property." }, + JSX_spread_child_must_be_an_array_type: { code: 2609, category: ts.DiagnosticCategory.Error, key: "JSX_spread_child_must_be_an_array_type_2609", message: "JSX spread child must be an array type." }, + Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: { code: 2649, category: ts.DiagnosticCategory.Error, key: "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", message: "Cannot augment module '{0}' with value exports because it resolves to a non-module entity." }, + Cannot_emit_namespaced_JSX_elements_in_React: { code: 2650, category: ts.DiagnosticCategory.Error, key: "Cannot_emit_namespaced_JSX_elements_in_React_2650", message: "Cannot emit namespaced JSX elements in React." }, A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: { code: 2651, category: ts.DiagnosticCategory.Error, key: "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", message: "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums." }, Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: { code: 2652, category: ts.DiagnosticCategory.Error, key: "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", message: "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead." }, Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1: { code: 2653, category: ts.DiagnosticCategory.Error, key: "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653", message: "Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'." }, Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_package_author_to_update_the_package_definition: { code: 2654, category: ts.DiagnosticCategory.Error, key: "Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_pack_2654", message: "Exported external package typings file cannot contain tripleslash references. Please contact the package author to update the package definition." }, Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition: { code: 2656, category: ts.DiagnosticCategory.Error, key: "Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_2656", message: "Exported external package typings file '{0}' is not a module. Please contact the package author to update the package definition." }, - JSX_expressions_must_have_one_parent_element: { code: 2657, category: ts.DiagnosticCategory.Error, key: "JSX_expressions_must_have_one_parent_element_2657", message: "JSX expressions must have one parent element" }, - Type_0_provides_no_match_for_the_signature_1: { code: 2658, category: ts.DiagnosticCategory.Error, key: "Type_0_provides_no_match_for_the_signature_1_2658", message: "Type '{0}' provides no match for the signature '{1}'" }, + JSX_expressions_must_have_one_parent_element: { code: 2657, category: ts.DiagnosticCategory.Error, key: "JSX_expressions_must_have_one_parent_element_2657", message: "JSX expressions must have one parent element." }, + Type_0_provides_no_match_for_the_signature_1: { code: 2658, category: ts.DiagnosticCategory.Error, key: "Type_0_provides_no_match_for_the_signature_1_2658", message: "Type '{0}' provides no match for the signature '{1}'." }, super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: { code: 2659, category: ts.DiagnosticCategory.Error, key: "super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659", message: "'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher." }, super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: { code: 2660, category: ts.DiagnosticCategory.Error, key: "super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660", message: "'super' can only be referenced in members of derived classes or object literal expressions." }, Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module: { code: 2661, category: ts.DiagnosticCategory.Error, key: "Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661", message: "Cannot export '{0}'. Only local declarations can be exported from a module." }, @@ -2904,7 +3921,6 @@ var ts; All_declarations_of_0_must_have_identical_modifiers: { code: 2687, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_0_must_have_identical_modifiers_2687", message: "All declarations of '{0}' must have identical modifiers." }, Cannot_find_type_definition_file_for_0: { code: 2688, category: ts.DiagnosticCategory.Error, key: "Cannot_find_type_definition_file_for_0_2688", message: "Cannot find type definition file for '{0}'." }, Cannot_extend_an_interface_0_Did_you_mean_implements: { code: 2689, category: ts.DiagnosticCategory.Error, key: "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", message: "Cannot extend an interface '{0}'. Did you mean 'implements'?" }, - A_class_must_be_declared_after_its_base_class: { code: 2690, category: ts.DiagnosticCategory.Error, key: "A_class_must_be_declared_after_its_base_class_2690", message: "A class must be declared after its base class." }, An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: { code: 2691, category: ts.DiagnosticCategory.Error, key: "An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691", message: "An import path cannot end with a '{0}' extension. Consider importing '{1}' instead." }, _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: { code: 2692, category: ts.DiagnosticCategory.Error, key: "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", message: "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible." }, _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: { code: 2693, category: ts.DiagnosticCategory.Error, key: "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", message: "'{0}' only refers to a type, but is being used as a value here." }, @@ -2913,9 +3929,17 @@ var ts; The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead: { code: 2696, category: ts.DiagnosticCategory.Error, key: "The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696", message: "The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?" }, An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: { code: 2697, category: ts.DiagnosticCategory.Error, key: "An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697", message: "An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your `--lib` option." }, Spread_types_may_only_be_created_from_object_types: { code: 2698, category: ts.DiagnosticCategory.Error, key: "Spread_types_may_only_be_created_from_object_types_2698", message: "Spread types may only be created from object types." }, + Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1: { code: 2699, category: ts.DiagnosticCategory.Error, key: "Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699", message: "Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'." }, Rest_types_may_only_be_created_from_object_types: { code: 2700, category: ts.DiagnosticCategory.Error, key: "Rest_types_may_only_be_created_from_object_types_2700", message: "Rest types may only be created from object types." }, The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access: { code: 2701, category: ts.DiagnosticCategory.Error, key: "The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701", message: "The target of an object rest assignment must be a variable or a property access." }, _0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here: { code: 2702, category: ts.DiagnosticCategory.Error, key: "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702", message: "'{0}' only refers to a type, but is being used as a namespace here." }, + The_operand_of_a_delete_operator_must_be_a_property_reference: { code: 2703, category: ts.DiagnosticCategory.Error, key: "The_operand_of_a_delete_operator_must_be_a_property_reference_2703", message: "The operand of a delete operator must be a property reference." }, + The_operand_of_a_delete_operator_cannot_be_a_read_only_property: { code: 2704, category: ts.DiagnosticCategory.Error, key: "The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704", message: "The operand of a delete operator cannot be a read-only property." }, + An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: { code: 2705, category: ts.DiagnosticCategory.Error, key: "An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705", message: "An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option." }, + Required_type_parameters_may_not_follow_optional_type_parameters: { code: 2706, category: ts.DiagnosticCategory.Error, key: "Required_type_parameters_may_not_follow_optional_type_parameters_2706", message: "Required type parameters may not follow optional type parameters." }, + Generic_type_0_requires_between_1_and_2_type_arguments: { code: 2707, category: ts.DiagnosticCategory.Error, key: "Generic_type_0_requires_between_1_and_2_type_arguments_2707", message: "Generic type '{0}' requires between {1} and {2} type arguments." }, + Cannot_use_namespace_0_as_a_value: { code: 2708, category: ts.DiagnosticCategory.Error, key: "Cannot_use_namespace_0_as_a_value_2708", message: "Cannot use namespace '{0}' as a value." }, + Cannot_use_namespace_0_as_a_type: { code: 2709, category: ts.DiagnosticCategory.Error, key: "Cannot_use_namespace_0_as_a_type_2709", message: "Cannot use namespace '{0}' as a type." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "Import_declaration_0_is_using_private_name_1_4000", message: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", message: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", message: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, @@ -2926,8 +3950,8 @@ var ts; Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014", message: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016", message: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: ts.DiagnosticCategory.Error, key: "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019", message: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: ts.DiagnosticCategory.Error, key: "Extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020", message: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: ts.DiagnosticCategory.Error, key: "Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022", message: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, + extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: ts.DiagnosticCategory.Error, key: "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020", message: "'extends' clause of exported class '{0}' has or is using private name '{1}'." }, + extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: ts.DiagnosticCategory.Error, key: "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022", message: "'extends' clause of exported interface '{0}' has or is using private name '{1}'." }, Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: ts.DiagnosticCategory.Error, key: "Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023", message: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: ts.DiagnosticCategory.Error, key: "Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024", message: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: ts.DiagnosticCategory.Error, key: "Exported_variable_0_has_or_is_using_private_name_1_4025", message: "Exported variable '{0}' has or is using private name '{1}'." }, @@ -2988,16 +4012,18 @@ var ts; Default_export_of_the_module_has_or_is_using_private_name_0: { code: 4082, category: ts.DiagnosticCategory.Error, key: "Default_export_of_the_module_has_or_is_using_private_name_0_4082", message: "Default export of the module has or is using private name '{0}'." }, Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: { code: 4083, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", message: "Type parameter '{0}' of exported type alias has or is using private name '{1}'." }, Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: { code: 4090, category: ts.DiagnosticCategory.Message, key: "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", message: "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict." }, + Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4091, category: ts.DiagnosticCategory.Error, key: "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", message: "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4092, category: ts.DiagnosticCategory.Error, key: "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", message: "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'." }, + extends_clause_of_exported_class_0_refers_to_a_type_whose_name_cannot_be_referenced: { code: 4093, category: ts.DiagnosticCategory.Error, key: "extends_clause_of_exported_class_0_refers_to_a_type_whose_name_cannot_be_referenced_4093", message: "'extends' clause of exported class '{0}' refers to a type whose name cannot be referenced." }, The_current_host_does_not_support_the_0_option: { code: 5001, category: ts.DiagnosticCategory.Error, key: "The_current_host_does_not_support_the_0_option_5001", message: "The current host does not support the '{0}' option." }, Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: ts.DiagnosticCategory.Error, key: "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", message: "Cannot find the common subdirectory path for the input files." }, File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: { code: 5010, category: ts.DiagnosticCategory.Error, key: "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", message: "File specification cannot end in a recursive directory wildcard ('**'): '{0}'." }, File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0: { code: 5011, category: ts.DiagnosticCategory.Error, key: "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011", message: "File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'." }, - Cannot_read_file_0_Colon_1: { code: 5012, category: ts.DiagnosticCategory.Error, key: "Cannot_read_file_0_Colon_1_5012", message: "Cannot read file '{0}': {1}" }, - Unsupported_file_encoding: { code: 5013, category: ts.DiagnosticCategory.Error, key: "Unsupported_file_encoding_5013", message: "Unsupported file encoding." }, + Cannot_read_file_0_Colon_1: { code: 5012, category: ts.DiagnosticCategory.Error, key: "Cannot_read_file_0_Colon_1_5012", message: "Cannot read file '{0}': {1}." }, Failed_to_parse_file_0_Colon_1: { code: 5014, category: ts.DiagnosticCategory.Error, key: "Failed_to_parse_file_0_Colon_1_5014", message: "Failed to parse file '{0}': {1}." }, Unknown_compiler_option_0: { code: 5023, category: ts.DiagnosticCategory.Error, key: "Unknown_compiler_option_0_5023", message: "Unknown compiler option '{0}'." }, Compiler_option_0_requires_a_value_of_type_1: { code: 5024, category: ts.DiagnosticCategory.Error, key: "Compiler_option_0_requires_a_value_of_type_1_5024", message: "Compiler option '{0}' requires a value of type {1}." }, - Could_not_write_file_0_Colon_1: { code: 5033, category: ts.DiagnosticCategory.Error, key: "Could_not_write_file_0_Colon_1_5033", message: "Could not write file '{0}': {1}" }, + Could_not_write_file_0_Colon_1: { code: 5033, category: ts.DiagnosticCategory.Error, key: "Could_not_write_file_0_Colon_1_5033", message: "Could not write file '{0}': {1}." }, Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: ts.DiagnosticCategory.Error, key: "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042", message: "Option 'project' cannot be mixed with source files on a command line." }, Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher: { code: 5047, category: ts.DiagnosticCategory.Error, key: "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047", message: "Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher." }, Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: { code: 5051, category: ts.DiagnosticCategory.Error, key: "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051", message: "Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided." }, @@ -3006,12 +4032,12 @@ var ts; A_tsconfig_json_file_is_already_defined_at_Colon_0: { code: 5054, category: ts.DiagnosticCategory.Error, key: "A_tsconfig_json_file_is_already_defined_at_Colon_0_5054", message: "A 'tsconfig.json' file is already defined at: '{0}'." }, Cannot_write_file_0_because_it_would_overwrite_input_file: { code: 5055, category: ts.DiagnosticCategory.Error, key: "Cannot_write_file_0_because_it_would_overwrite_input_file_5055", message: "Cannot write file '{0}' because it would overwrite input file." }, Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files: { code: 5056, category: ts.DiagnosticCategory.Error, key: "Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056", message: "Cannot write file '{0}' because it would be overwritten by multiple input files." }, - Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: { code: 5057, category: ts.DiagnosticCategory.Error, key: "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", message: "Cannot find a tsconfig.json file at the specified directory: '{0}'" }, - The_specified_path_does_not_exist_Colon_0: { code: 5058, category: ts.DiagnosticCategory.Error, key: "The_specified_path_does_not_exist_Colon_0_5058", message: "The specified path does not exist: '{0}'" }, + Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: { code: 5057, category: ts.DiagnosticCategory.Error, key: "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", message: "Cannot find a tsconfig.json file at the specified directory: '{0}'." }, + The_specified_path_does_not_exist_Colon_0: { code: 5058, category: ts.DiagnosticCategory.Error, key: "The_specified_path_does_not_exist_Colon_0_5058", message: "The specified path does not exist: '{0}'." }, Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: { code: 5059, category: ts.DiagnosticCategory.Error, key: "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", message: "Invalid value for '--reactNamespace'. '{0}' is not a valid identifier." }, Option_paths_cannot_be_used_without_specifying_baseUrl_option: { code: 5060, category: ts.DiagnosticCategory.Error, key: "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060", message: "Option 'paths' cannot be used without specifying '--baseUrl' option." }, - Pattern_0_can_have_at_most_one_Asterisk_character: { code: 5061, category: ts.DiagnosticCategory.Error, key: "Pattern_0_can_have_at_most_one_Asterisk_character_5061", message: "Pattern '{0}' can have at most one '*' character" }, - Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character: { code: 5062, category: ts.DiagnosticCategory.Error, key: "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062", message: "Substitution '{0}' in pattern '{1}' in can have at most one '*' character" }, + Pattern_0_can_have_at_most_one_Asterisk_character: { code: 5061, category: ts.DiagnosticCategory.Error, key: "Pattern_0_can_have_at_most_one_Asterisk_character_5061", message: "Pattern '{0}' can have at most one '*' character." }, + Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character: { code: 5062, category: ts.DiagnosticCategory.Error, key: "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062", message: "Substitution '{0}' in pattern '{1}' in can have at most one '*' character." }, Substitutions_for_pattern_0_should_be_an_array: { code: 5063, category: ts.DiagnosticCategory.Error, key: "Substitutions_for_pattern_0_should_be_an_array_5063", message: "Substitutions for pattern '{0}' should be an array." }, Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2: { code: 5064, category: ts.DiagnosticCategory.Error, key: "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064", message: "Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'." }, File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: { code: 5065, category: ts.DiagnosticCategory.Error, key: "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065", message: "File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'." }, @@ -3029,11 +4055,11 @@ var ts; Do_not_emit_outputs: { code: 6010, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_outputs_6010", message: "Do not emit outputs." }, Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: { code: 6011, category: ts.DiagnosticCategory.Message, key: "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", message: "Allow default imports from modules with no default export. This does not affect code emit, just typechecking." }, Skip_type_checking_of_declaration_files: { code: 6012, category: ts.DiagnosticCategory.Message, key: "Skip_type_checking_of_declaration_files_6012", message: "Skip type checking of declaration files." }, - Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015_6015", message: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES2015'" }, - Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015_6016", message: "Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'" }, + Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015", message: "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'." }, + Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015_6016", message: "Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'." }, Print_this_message: { code: 6017, category: ts.DiagnosticCategory.Message, key: "Print_this_message_6017", message: "Print this message." }, Print_the_compiler_s_version: { code: 6019, category: ts.DiagnosticCategory.Message, key: "Print_the_compiler_s_version_6019", message: "Print the compiler's version." }, - Compile_the_project_in_the_given_directory: { code: 6020, category: ts.DiagnosticCategory.Message, key: "Compile_the_project_in_the_given_directory_6020", message: "Compile the project in the given directory." }, + Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json: { code: 6020, category: ts.DiagnosticCategory.Message, key: "Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020", message: "Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'." }, Syntax_Colon_0: { code: 6023, category: ts.DiagnosticCategory.Message, key: "Syntax_Colon_0_6023", message: "Syntax: {0}" }, options: { code: 6024, category: ts.DiagnosticCategory.Message, key: "options_6024", message: "options" }, file: { code: 6025, category: ts.DiagnosticCategory.Message, key: "file_6025", message: "file" }, @@ -3048,11 +4074,12 @@ var ts; LOCATION: { code: 6037, category: ts.DiagnosticCategory.Message, key: "LOCATION_6037", message: "LOCATION" }, DIRECTORY: { code: 6038, category: ts.DiagnosticCategory.Message, key: "DIRECTORY_6038", message: "DIRECTORY" }, STRATEGY: { code: 6039, category: ts.DiagnosticCategory.Message, key: "STRATEGY_6039", message: "STRATEGY" }, + FILE_OR_DIRECTORY: { code: 6040, category: ts.DiagnosticCategory.Message, key: "FILE_OR_DIRECTORY_6040", message: "FILE OR DIRECTORY" }, Compilation_complete_Watching_for_file_changes: { code: 6042, category: ts.DiagnosticCategory.Message, key: "Compilation_complete_Watching_for_file_changes_6042", message: "Compilation complete. Watching for file changes." }, Generates_corresponding_map_file: { code: 6043, category: ts.DiagnosticCategory.Message, key: "Generates_corresponding_map_file_6043", message: "Generates corresponding '.map' file." }, Compiler_option_0_expects_an_argument: { code: 6044, category: ts.DiagnosticCategory.Error, key: "Compiler_option_0_expects_an_argument_6044", message: "Compiler option '{0}' expects an argument." }, Unterminated_quoted_string_in_response_file_0: { code: 6045, category: ts.DiagnosticCategory.Error, key: "Unterminated_quoted_string_in_response_file_0_6045", message: "Unterminated quoted string in response file '{0}'." }, - Argument_for_0_option_must_be_Colon_1: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument_for_0_option_must_be_Colon_1_6046", message: "Argument for '{0}' option must be: {1}" }, + Argument_for_0_option_must_be_Colon_1: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument_for_0_option_must_be_Colon_1_6046", message: "Argument for '{0}' option must be: {1}." }, Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: ts.DiagnosticCategory.Error, key: "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048", message: "Locale must be of the form or -. For example '{0}' or '{1}'." }, Unsupported_locale_0: { code: 6049, category: ts.DiagnosticCategory.Error, key: "Unsupported_locale_0_6049", message: "Unsupported locale '{0}'." }, Unable_to_open_file_0: { code: 6050, category: ts.DiagnosticCategory.Error, key: "Unable_to_open_file_0_6050", message: "Unable to open file '{0}'." }, @@ -3074,17 +4101,18 @@ var ts; Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file: { code: 6070, category: ts.DiagnosticCategory.Message, key: "Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070", message: "Initializes a TypeScript project and creates a tsconfig.json file." }, Successfully_created_a_tsconfig_json_file: { code: 6071, category: ts.DiagnosticCategory.Message, key: "Successfully_created_a_tsconfig_json_file_6071", message: "Successfully created a tsconfig.json file." }, Suppress_excess_property_checks_for_object_literals: { code: 6072, category: ts.DiagnosticCategory.Message, key: "Suppress_excess_property_checks_for_object_literals_6072", message: "Suppress excess property checks for object literals." }, - Stylize_errors_and_messages_using_color_and_context_experimental: { code: 6073, category: ts.DiagnosticCategory.Message, key: "Stylize_errors_and_messages_using_color_and_context_experimental_6073", message: "Stylize errors and messages using color and context. (experimental)" }, + Stylize_errors_and_messages_using_color_and_context_experimental: { code: 6073, category: ts.DiagnosticCategory.Message, key: "Stylize_errors_and_messages_using_color_and_context_experimental_6073", message: "Stylize errors and messages using color and context (experimental)." }, Do_not_report_errors_on_unused_labels: { code: 6074, category: ts.DiagnosticCategory.Message, key: "Do_not_report_errors_on_unused_labels_6074", message: "Do not report errors on unused labels." }, Report_error_when_not_all_code_paths_in_function_return_a_value: { code: 6075, category: ts.DiagnosticCategory.Message, key: "Report_error_when_not_all_code_paths_in_function_return_a_value_6075", message: "Report error when not all code paths in function return a value." }, Report_errors_for_fallthrough_cases_in_switch_statement: { code: 6076, category: ts.DiagnosticCategory.Message, key: "Report_errors_for_fallthrough_cases_in_switch_statement_6076", message: "Report errors for fallthrough cases in switch statement." }, Do_not_report_errors_on_unreachable_code: { code: 6077, category: ts.DiagnosticCategory.Message, key: "Do_not_report_errors_on_unreachable_code_6077", message: "Do not report errors on unreachable code." }, Disallow_inconsistently_cased_references_to_the_same_file: { code: 6078, category: ts.DiagnosticCategory.Message, key: "Disallow_inconsistently_cased_references_to_the_same_file_6078", message: "Disallow inconsistently-cased references to the same file." }, Specify_library_files_to_be_included_in_the_compilation_Colon: { code: 6079, category: ts.DiagnosticCategory.Message, key: "Specify_library_files_to_be_included_in_the_compilation_Colon_6079", message: "Specify library files to be included in the compilation: " }, - Specify_JSX_code_generation_Colon_preserve_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify_JSX_code_generation_Colon_preserve_or_react_6080", message: "Specify JSX code generation: 'preserve' or 'react'" }, + Specify_JSX_code_generation_Colon_preserve_react_native_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080", message: "Specify JSX code generation: 'preserve', 'react-native', or 'react'." }, + File_0_has_an_unsupported_extension_so_skipping_it: { code: 6081, category: ts.DiagnosticCategory.Message, key: "File_0_has_an_unsupported_extension_so_skipping_it_6081", message: "File '{0}' has an unsupported extension, so skipping it." }, Only_amd_and_system_modules_are_supported_alongside_0: { code: 6082, category: ts.DiagnosticCategory.Error, key: "Only_amd_and_system_modules_are_supported_alongside_0_6082", message: "Only 'amd' and 'system' modules are supported alongside --{0}." }, Base_directory_to_resolve_non_absolute_module_names: { code: 6083, category: ts.DiagnosticCategory.Message, key: "Base_directory_to_resolve_non_absolute_module_names_6083", message: "Base directory to resolve non-absolute module names." }, - Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit: { code: 6084, category: ts.DiagnosticCategory.Message, key: "Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit_6084", message: "Specify the object invoked for createElement and __spread when targeting 'react' JSX emit" }, + Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit: { code: 6084, category: ts.DiagnosticCategory.Message, key: "Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084", message: "[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit" }, Enable_tracing_of_the_name_resolution_process: { code: 6085, category: ts.DiagnosticCategory.Message, key: "Enable_tracing_of_the_name_resolution_process_6085", message: "Enable tracing of the name resolution process." }, Resolving_module_0_from_1: { code: 6086, category: ts.DiagnosticCategory.Message, key: "Resolving_module_0_from_1_6086", message: "======== Resolving module '{0}' from '{1}'. ========" }, Explicitly_specified_module_resolution_kind_Colon_0: { code: 6087, category: ts.DiagnosticCategory.Message, key: "Explicitly_specified_module_resolution_kind_Colon_0_6087", message: "Explicitly specified module resolution kind: '{0}'." }, @@ -3095,23 +4123,23 @@ var ts; Module_name_0_matched_pattern_1: { code: 6092, category: ts.DiagnosticCategory.Message, key: "Module_name_0_matched_pattern_1_6092", message: "Module name '{0}', matched pattern '{1}'." }, Trying_substitution_0_candidate_module_location_Colon_1: { code: 6093, category: ts.DiagnosticCategory.Message, key: "Trying_substitution_0_candidate_module_location_Colon_1_6093", message: "Trying substitution '{0}', candidate module location: '{1}'." }, Resolving_module_name_0_relative_to_base_url_1_2: { code: 6094, category: ts.DiagnosticCategory.Message, key: "Resolving_module_name_0_relative_to_base_url_1_2_6094", message: "Resolving module name '{0}' relative to base url '{1}' - '{2}'." }, - Loading_module_as_file_Slash_folder_candidate_module_location_0: { code: 6095, category: ts.DiagnosticCategory.Message, key: "Loading_module_as_file_Slash_folder_candidate_module_location_0_6095", message: "Loading module as file / folder, candidate module location '{0}'." }, + Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1: { code: 6095, category: ts.DiagnosticCategory.Message, key: "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1_6095", message: "Loading module as file / folder, candidate module location '{0}', target file type '{1}'." }, File_0_does_not_exist: { code: 6096, category: ts.DiagnosticCategory.Message, key: "File_0_does_not_exist_6096", message: "File '{0}' does not exist." }, File_0_exist_use_it_as_a_name_resolution_result: { code: 6097, category: ts.DiagnosticCategory.Message, key: "File_0_exist_use_it_as_a_name_resolution_result_6097", message: "File '{0}' exist - use it as a name resolution result." }, - Loading_module_0_from_node_modules_folder: { code: 6098, category: ts.DiagnosticCategory.Message, key: "Loading_module_0_from_node_modules_folder_6098", message: "Loading module '{0}' from 'node_modules' folder." }, + Loading_module_0_from_node_modules_folder_target_file_type_1: { code: 6098, category: ts.DiagnosticCategory.Message, key: "Loading_module_0_from_node_modules_folder_target_file_type_1_6098", message: "Loading module '{0}' from 'node_modules' folder, target file type '{1}'." }, Found_package_json_at_0: { code: 6099, category: ts.DiagnosticCategory.Message, key: "Found_package_json_at_0_6099", message: "Found 'package.json' at '{0}'." }, - package_json_does_not_have_a_types_or_main_field: { code: 6100, category: ts.DiagnosticCategory.Message, key: "package_json_does_not_have_a_types_or_main_field_6100", message: "'package.json' does not have a 'types' or 'main' field." }, + package_json_does_not_have_a_0_field: { code: 6100, category: ts.DiagnosticCategory.Message, key: "package_json_does_not_have_a_0_field_6100", message: "'package.json' does not have a '{0}' field." }, package_json_has_0_field_1_that_references_2: { code: 6101, category: ts.DiagnosticCategory.Message, key: "package_json_has_0_field_1_that_references_2_6101", message: "'package.json' has '{0}' field '{1}' that references '{2}'." }, Allow_javascript_files_to_be_compiled: { code: 6102, category: ts.DiagnosticCategory.Message, key: "Allow_javascript_files_to_be_compiled_6102", message: "Allow javascript files to be compiled." }, Option_0_should_have_array_of_strings_as_a_value: { code: 6103, category: ts.DiagnosticCategory.Error, key: "Option_0_should_have_array_of_strings_as_a_value_6103", message: "Option '{0}' should have array of strings as a value." }, Checking_if_0_is_the_longest_matching_prefix_for_1_2: { code: 6104, category: ts.DiagnosticCategory.Message, key: "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104", message: "Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'." }, Expected_type_of_0_field_in_package_json_to_be_string_got_1: { code: 6105, category: ts.DiagnosticCategory.Message, key: "Expected_type_of_0_field_in_package_json_to_be_string_got_1_6105", message: "Expected type of '{0}' field in 'package.json' to be 'string', got '{1}'." }, - baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1: { code: 6106, category: ts.DiagnosticCategory.Message, key: "baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106", message: "'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'" }, - rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0: { code: 6107, category: ts.DiagnosticCategory.Message, key: "rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107", message: "'rootDirs' option is set, using it to resolve relative module name '{0}'" }, - Longest_matching_prefix_for_0_is_1: { code: 6108, category: ts.DiagnosticCategory.Message, key: "Longest_matching_prefix_for_0_is_1_6108", message: "Longest matching prefix for '{0}' is '{1}'" }, - Loading_0_from_the_root_dir_1_candidate_location_2: { code: 6109, category: ts.DiagnosticCategory.Message, key: "Loading_0_from_the_root_dir_1_candidate_location_2_6109", message: "Loading '{0}' from the root dir '{1}', candidate location '{2}'" }, - Trying_other_entries_in_rootDirs: { code: 6110, category: ts.DiagnosticCategory.Message, key: "Trying_other_entries_in_rootDirs_6110", message: "Trying other entries in 'rootDirs'" }, - Module_resolution_using_rootDirs_has_failed: { code: 6111, category: ts.DiagnosticCategory.Message, key: "Module_resolution_using_rootDirs_has_failed_6111", message: "Module resolution using 'rootDirs' has failed" }, + baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1: { code: 6106, category: ts.DiagnosticCategory.Message, key: "baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106", message: "'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'." }, + rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0: { code: 6107, category: ts.DiagnosticCategory.Message, key: "rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107", message: "'rootDirs' option is set, using it to resolve relative module name '{0}'." }, + Longest_matching_prefix_for_0_is_1: { code: 6108, category: ts.DiagnosticCategory.Message, key: "Longest_matching_prefix_for_0_is_1_6108", message: "Longest matching prefix for '{0}' is '{1}'." }, + Loading_0_from_the_root_dir_1_candidate_location_2: { code: 6109, category: ts.DiagnosticCategory.Message, key: "Loading_0_from_the_root_dir_1_candidate_location_2_6109", message: "Loading '{0}' from the root dir '{1}', candidate location '{2}'." }, + Trying_other_entries_in_rootDirs: { code: 6110, category: ts.DiagnosticCategory.Message, key: "Trying_other_entries_in_rootDirs_6110", message: "Trying other entries in 'rootDirs'." }, + Module_resolution_using_rootDirs_has_failed: { code: 6111, category: ts.DiagnosticCategory.Message, key: "Module_resolution_using_rootDirs_has_failed_6111", message: "Module resolution using 'rootDirs' has failed." }, Do_not_emit_use_strict_directives_in_module_output: { code: 6112, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_use_strict_directives_in_module_output_6112", message: "Do not emit 'use strict' directives in module output." }, Enable_strict_null_checks: { code: 6113, category: ts.DiagnosticCategory.Message, key: "Enable_strict_null_checks_6113", message: "Enable strict null checks." }, Unknown_option_excludes_Did_you_mean_exclude: { code: 6114, category: ts.DiagnosticCategory.Error, key: "Unknown_option_excludes_Did_you_mean_exclude_6114", message: "Unknown option 'excludes'. Did you mean 'exclude'?" }, @@ -3121,32 +4149,67 @@ var ts; Resolving_from_node_modules_folder: { code: 6118, category: ts.DiagnosticCategory.Message, key: "Resolving_from_node_modules_folder_6118", message: "Resolving from node_modules folder..." }, Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2: { code: 6119, category: ts.DiagnosticCategory.Message, key: "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119", message: "======== Type reference directive '{0}' was successfully resolved to '{1}', primary: {2}. ========" }, Type_reference_directive_0_was_not_resolved: { code: 6120, category: ts.DiagnosticCategory.Message, key: "Type_reference_directive_0_was_not_resolved_6120", message: "======== Type reference directive '{0}' was not resolved. ========" }, - Resolving_with_primary_search_path_0: { code: 6121, category: ts.DiagnosticCategory.Message, key: "Resolving_with_primary_search_path_0_6121", message: "Resolving with primary search path '{0}'" }, + Resolving_with_primary_search_path_0: { code: 6121, category: ts.DiagnosticCategory.Message, key: "Resolving_with_primary_search_path_0_6121", message: "Resolving with primary search path '{0}'." }, Root_directory_cannot_be_determined_skipping_primary_search_paths: { code: 6122, category: ts.DiagnosticCategory.Message, key: "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122", message: "Root directory cannot be determined, skipping primary search paths." }, Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set: { code: 6123, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123", message: "======== Resolving type reference directive '{0}', containing file '{1}', root directory not set. ========" }, Type_declaration_files_to_be_included_in_compilation: { code: 6124, category: ts.DiagnosticCategory.Message, key: "Type_declaration_files_to_be_included_in_compilation_6124", message: "Type declaration files to be included in compilation." }, - Looking_up_in_node_modules_folder_initial_location_0: { code: 6125, category: ts.DiagnosticCategory.Message, key: "Looking_up_in_node_modules_folder_initial_location_0_6125", message: "Looking up in 'node_modules' folder, initial location '{0}'" }, + Looking_up_in_node_modules_folder_initial_location_0: { code: 6125, category: ts.DiagnosticCategory.Message, key: "Looking_up_in_node_modules_folder_initial_location_0_6125", message: "Looking up in 'node_modules' folder, initial location '{0}'." }, Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder: { code: 6126, category: ts.DiagnosticCategory.Message, key: "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126", message: "Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder." }, Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1: { code: 6127, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127", message: "======== Resolving type reference directive '{0}', containing file not set, root directory '{1}'. ========" }, Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set: { code: 6128, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128", message: "======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========" }, The_config_file_0_found_doesn_t_contain_any_source_files: { code: 6129, category: ts.DiagnosticCategory.Error, key: "The_config_file_0_found_doesn_t_contain_any_source_files_6129", message: "The config file '{0}' found doesn't contain any source files." }, - Resolving_real_path_for_0_result_1: { code: 6130, category: ts.DiagnosticCategory.Message, key: "Resolving_real_path_for_0_result_1_6130", message: "Resolving real path for '{0}', result '{1}'" }, + Resolving_real_path_for_0_result_1: { code: 6130, category: ts.DiagnosticCategory.Message, key: "Resolving_real_path_for_0_result_1_6130", message: "Resolving real path for '{0}', result '{1}'." }, Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system: { code: 6131, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131", message: "Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'." }, - File_name_0_has_a_1_extension_stripping_it: { code: 6132, category: ts.DiagnosticCategory.Message, key: "File_name_0_has_a_1_extension_stripping_it_6132", message: "File name '{0}' has a '{1}' extension - stripping it" }, + File_name_0_has_a_1_extension_stripping_it: { code: 6132, category: ts.DiagnosticCategory.Message, key: "File_name_0_has_a_1_extension_stripping_it_6132", message: "File name '{0}' has a '{1}' extension - stripping it." }, _0_is_declared_but_never_used: { code: 6133, category: ts.DiagnosticCategory.Error, key: "_0_is_declared_but_never_used_6133", message: "'{0}' is declared but never used." }, Report_errors_on_unused_locals: { code: 6134, category: ts.DiagnosticCategory.Message, key: "Report_errors_on_unused_locals_6134", message: "Report errors on unused locals." }, Report_errors_on_unused_parameters: { code: 6135, category: ts.DiagnosticCategory.Message, key: "Report_errors_on_unused_parameters_6135", message: "Report errors on unused parameters." }, - The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files: { code: 6136, category: ts.DiagnosticCategory.Message, key: "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136", message: "The maximum dependency depth to search under node_modules and load JavaScript files" }, - No_types_specified_in_package_json_so_returning_main_value_of_0: { code: 6137, category: ts.DiagnosticCategory.Message, key: "No_types_specified_in_package_json_so_returning_main_value_of_0_6137", message: "No types specified in 'package.json', so returning 'main' value of '{0}'" }, + The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files: { code: 6136, category: ts.DiagnosticCategory.Message, key: "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136", message: "The maximum dependency depth to search under node_modules and load JavaScript files." }, Property_0_is_declared_but_never_used: { code: 6138, category: ts.DiagnosticCategory.Error, key: "Property_0_is_declared_but_never_used_6138", message: "Property '{0}' is declared but never used." }, Import_emit_helpers_from_tslib: { code: 6139, category: ts.DiagnosticCategory.Message, key: "Import_emit_helpers_from_tslib_6139", message: "Import emit helpers from 'tslib'." }, Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2: { code: 6140, category: ts.DiagnosticCategory.Error, key: "Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140", message: "Auto discovery for typings is enabled in project '{0}'. Running extra resolution pass for module '{1}' using cache location '{2}'." }, - Parse_in_strict_mode_and_emit_use_strict_for_each_source_file: { code: 6141, category: ts.DiagnosticCategory.Message, key: "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141", message: "Parse in strict mode and emit \"use strict\" for each source file" }, + Parse_in_strict_mode_and_emit_use_strict_for_each_source_file: { code: 6141, category: ts.DiagnosticCategory.Message, key: "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141", message: "Parse in strict mode and emit \"use strict\" for each source file." }, Module_0_was_resolved_to_1_but_jsx_is_not_set: { code: 6142, category: ts.DiagnosticCategory.Error, key: "Module_0_was_resolved_to_1_but_jsx_is_not_set_6142", message: "Module '{0}' was resolved to '{1}', but '--jsx' is not set." }, Module_0_was_resolved_to_1_but_allowJs_is_not_set: { code: 6143, category: ts.DiagnosticCategory.Error, key: "Module_0_was_resolved_to_1_but_allowJs_is_not_set_6143", message: "Module '{0}' was resolved to '{1}', but '--allowJs' is not set." }, Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1: { code: 6144, category: ts.DiagnosticCategory.Message, key: "Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144", message: "Module '{0}' was resolved as locally declared ambient module in file '{1}'." }, Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified: { code: 6145, category: ts.DiagnosticCategory.Message, key: "Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified_6145", message: "Module '{0}' was resolved as ambient module declared in '{1}' since this file was not modified." }, Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h: { code: 6146, category: ts.DiagnosticCategory.Message, key: "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146", message: "Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'." }, + Resolution_for_module_0_was_found_in_cache: { code: 6147, category: ts.DiagnosticCategory.Message, key: "Resolution_for_module_0_was_found_in_cache_6147", message: "Resolution for module '{0}' was found in cache." }, + Directory_0_does_not_exist_skipping_all_lookups_in_it: { code: 6148, category: ts.DiagnosticCategory.Message, key: "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148", message: "Directory '{0}' does not exist, skipping all lookups in it." }, + Show_diagnostic_information: { code: 6149, category: ts.DiagnosticCategory.Message, key: "Show_diagnostic_information_6149", message: "Show diagnostic information." }, + Show_verbose_diagnostic_information: { code: 6150, category: ts.DiagnosticCategory.Message, key: "Show_verbose_diagnostic_information_6150", message: "Show verbose diagnostic information." }, + Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file: { code: 6151, category: ts.DiagnosticCategory.Message, key: "Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151", message: "Emit a single file with source maps instead of having a separate file." }, + Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set: { code: 6152, category: ts.DiagnosticCategory.Message, key: "Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152", message: "Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set." }, + Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule: { code: 6153, category: ts.DiagnosticCategory.Message, key: "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153", message: "Transpile each file as a separate module (similar to 'ts.transpileModule')." }, + Print_names_of_generated_files_part_of_the_compilation: { code: 6154, category: ts.DiagnosticCategory.Message, key: "Print_names_of_generated_files_part_of_the_compilation_6154", message: "Print names of generated files part of the compilation." }, + Print_names_of_files_part_of_the_compilation: { code: 6155, category: ts.DiagnosticCategory.Message, key: "Print_names_of_files_part_of_the_compilation_6155", message: "Print names of files part of the compilation." }, + The_locale_used_when_displaying_messages_to_the_user_e_g_en_us: { code: 6156, category: ts.DiagnosticCategory.Message, key: "The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156", message: "The locale used when displaying messages to the user (e.g. 'en-us')" }, + Do_not_generate_custom_helper_functions_like_extends_in_compiled_output: { code: 6157, category: ts.DiagnosticCategory.Message, key: "Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157", message: "Do not generate custom helper functions like '__extends' in compiled output." }, + Do_not_include_the_default_library_file_lib_d_ts: { code: 6158, category: ts.DiagnosticCategory.Message, key: "Do_not_include_the_default_library_file_lib_d_ts_6158", message: "Do not include the default library file (lib.d.ts)." }, + Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files: { code: 6159, category: ts.DiagnosticCategory.Message, key: "Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159", message: "Do not add triple-slash references or imported modules to the list of compiled files." }, + Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files: { code: 6160, category: ts.DiagnosticCategory.Message, key: "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160", message: "[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files." }, + List_of_folders_to_include_type_definitions_from: { code: 6161, category: ts.DiagnosticCategory.Message, key: "List_of_folders_to_include_type_definitions_from_6161", message: "List of folders to include type definitions from." }, + Disable_size_limitations_on_JavaScript_projects: { code: 6162, category: ts.DiagnosticCategory.Message, key: "Disable_size_limitations_on_JavaScript_projects_6162", message: "Disable size limitations on JavaScript projects." }, + The_character_set_of_the_input_files: { code: 6163, category: ts.DiagnosticCategory.Message, key: "The_character_set_of_the_input_files_6163", message: "The character set of the input files." }, + Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files: { code: 6164, category: ts.DiagnosticCategory.Message, key: "Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6164", message: "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files." }, + Do_not_truncate_error_messages: { code: 6165, category: ts.DiagnosticCategory.Message, key: "Do_not_truncate_error_messages_6165", message: "Do not truncate error messages." }, + Output_directory_for_generated_declaration_files: { code: 6166, category: ts.DiagnosticCategory.Message, key: "Output_directory_for_generated_declaration_files_6166", message: "Output directory for generated declaration files." }, + A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl: { code: 6167, category: ts.DiagnosticCategory.Message, key: "A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167", message: "A series of entries which re-map imports to lookup locations relative to the 'baseUrl'." }, + List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime: { code: 6168, category: ts.DiagnosticCategory.Message, key: "List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168", message: "List of root folders whose combined content represents the structure of the project at runtime." }, + Show_all_compiler_options: { code: 6169, category: ts.DiagnosticCategory.Message, key: "Show_all_compiler_options_6169", message: "Show all compiler options." }, + Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file: { code: 6170, category: ts.DiagnosticCategory.Message, key: "Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170", message: "[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file" }, + Command_line_Options: { code: 6171, category: ts.DiagnosticCategory.Message, key: "Command_line_Options_6171", message: "Command-line Options" }, + Basic_Options: { code: 6172, category: ts.DiagnosticCategory.Message, key: "Basic_Options_6172", message: "Basic Options" }, + Strict_Type_Checking_Options: { code: 6173, category: ts.DiagnosticCategory.Message, key: "Strict_Type_Checking_Options_6173", message: "Strict Type-Checking Options" }, + Module_Resolution_Options: { code: 6174, category: ts.DiagnosticCategory.Message, key: "Module_Resolution_Options_6174", message: "Module Resolution Options" }, + Source_Map_Options: { code: 6175, category: ts.DiagnosticCategory.Message, key: "Source_Map_Options_6175", message: "Source Map Options" }, + Additional_Checks: { code: 6176, category: ts.DiagnosticCategory.Message, key: "Additional_Checks_6176", message: "Additional Checks" }, + Experimental_Options: { code: 6177, category: ts.DiagnosticCategory.Message, key: "Experimental_Options_6177", message: "Experimental Options" }, + Advanced_Options: { code: 6178, category: ts.DiagnosticCategory.Message, key: "Advanced_Options_6178", message: "Advanced Options" }, + Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3: { code: 6179, category: ts.DiagnosticCategory.Message, key: "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179", message: "Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'." }, + Enable_all_strict_type_checking_options: { code: 6180, category: ts.DiagnosticCategory.Message, key: "Enable_all_strict_type_checking_options_6180", message: "Enable all strict type-checking options." }, + List_of_language_service_plugins: { code: 6181, category: ts.DiagnosticCategory.Message, key: "List_of_language_service_plugins_6181", message: "List of language service plugins." }, + Scoped_package_detected_looking_in_0: { code: 6182, category: ts.DiagnosticCategory.Message, key: "Scoped_package_detected_looking_in_0_6182", message: "Scoped package detected, looking in '{0}'" }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_an_1_type_7005", message: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter_0_implicitly_has_an_1_type_7006", message: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member_0_implicitly_has_an_1_type_7008", message: "Member '{0}' implicitly has an '{1}' type." }, @@ -3164,7 +4227,7 @@ var ts; _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7023, category: ts.DiagnosticCategory.Error, key: "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023", message: "'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7024, category: ts.DiagnosticCategory.Error, key: "Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024", message: "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type: { code: 7025, category: ts.DiagnosticCategory.Error, key: "Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_typ_7025", message: "Generator implicitly has type '{0}' because it does not yield any values. Consider supplying a return type." }, - JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: { code: 7026, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026", message: "JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists" }, + JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: { code: 7026, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026", message: "JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists." }, Unreachable_code_detected: { code: 7027, category: ts.DiagnosticCategory.Error, key: "Unreachable_code_detected_7027", message: "Unreachable code detected." }, Unused_label: { code: 7028, category: ts.DiagnosticCategory.Error, key: "Unused_label_7028", message: "Unused label." }, Fallthrough_case_in_switch: { code: 7029, category: ts.DiagnosticCategory.Error, key: "Fallthrough_case_in_switch_7029", message: "Fallthrough case in switch." }, @@ -3188,7 +4251,7 @@ var ts; parameter_modifiers_can_only_be_used_in_a_ts_file: { code: 8012, category: ts.DiagnosticCategory.Error, key: "parameter_modifiers_can_only_be_used_in_a_ts_file_8012", message: "'parameter modifiers' can only be used in a .ts file." }, enum_declarations_can_only_be_used_in_a_ts_file: { code: 8015, category: ts.DiagnosticCategory.Error, key: "enum_declarations_can_only_be_used_in_a_ts_file_8015", message: "'enum declarations' can only be used in a .ts file." }, type_assertion_expressions_can_only_be_used_in_a_ts_file: { code: 8016, category: ts.DiagnosticCategory.Error, key: "type_assertion_expressions_can_only_be_used_in_a_ts_file_8016", message: "'type assertion expressions' can only be used in a .ts file." }, - Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses: { code: 9002, category: ts.DiagnosticCategory.Error, key: "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002", message: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses." }, + Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clause: { code: 9002, category: ts.DiagnosticCategory.Error, key: "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002", message: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clause." }, class_expressions_are_not_currently_supported: { code: 9003, category: ts.DiagnosticCategory.Error, key: "class_expressions_are_not_currently_supported_9003", message: "'class' expressions are not currently supported." }, Language_service_is_disabled: { code: 9004, category: ts.DiagnosticCategory.Error, key: "Language_service_is_disabled_9004", message: "Language service is disabled." }, JSX_attributes_must_only_be_assigned_a_non_empty_expression: { code: 17000, category: ts.DiagnosticCategory.Error, key: "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", message: "JSX attributes must only be assigned a non-empty 'expression'." }, @@ -3196,28 +4259,40 @@ var ts; Expected_corresponding_JSX_closing_tag_for_0: { code: 17002, category: ts.DiagnosticCategory.Error, key: "Expected_corresponding_JSX_closing_tag_for_0_17002", message: "Expected corresponding JSX closing tag for '{0}'." }, JSX_attribute_expected: { code: 17003, category: ts.DiagnosticCategory.Error, key: "JSX_attribute_expected_17003", message: "JSX attribute expected." }, Cannot_use_JSX_unless_the_jsx_flag_is_provided: { code: 17004, category: ts.DiagnosticCategory.Error, key: "Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004", message: "Cannot use JSX unless the '--jsx' flag is provided." }, - A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: ts.DiagnosticCategory.Error, key: "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005", message: "A constructor cannot contain a 'super' call when its class extends 'null'" }, + A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: ts.DiagnosticCategory.Error, key: "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005", message: "A constructor cannot contain a 'super' call when its class extends 'null'." }, An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17006, category: ts.DiagnosticCategory.Error, key: "An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006", message: "An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17007, category: ts.DiagnosticCategory.Error, key: "A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007", message: "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, JSX_element_0_has_no_corresponding_closing_tag: { code: 17008, category: ts.DiagnosticCategory.Error, key: "JSX_element_0_has_no_corresponding_closing_tag_17008", message: "JSX element '{0}' has no corresponding closing tag." }, super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class: { code: 17009, category: ts.DiagnosticCategory.Error, key: "super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009", message: "'super' must be called before accessing 'this' in the constructor of a derived class." }, Unknown_type_acquisition_option_0: { code: 17010, category: ts.DiagnosticCategory.Error, key: "Unknown_type_acquisition_option_0_17010", message: "Unknown type acquisition option '{0}'." }, + super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class: { code: 17011, category: ts.DiagnosticCategory.Error, key: "super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011", message: "'super' must be called before accessing a property of 'super' in the constructor of a derived class." }, + _0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2: { code: 17012, category: ts.DiagnosticCategory.Error, key: "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012", message: "'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?" }, + Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor: { code: 17013, category: ts.DiagnosticCategory.Error, key: "Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013", message: "Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor." }, Circularity_detected_while_resolving_configuration_Colon_0: { code: 18000, category: ts.DiagnosticCategory.Error, key: "Circularity_detected_while_resolving_configuration_Colon_0_18000", message: "Circularity detected while resolving configuration: {0}" }, A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not: { code: 18001, category: ts.DiagnosticCategory.Error, key: "A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not_18001", message: "A path in an 'extends' option must be relative or rooted, but '{0}' is not." }, The_files_list_in_config_file_0_is_empty: { code: 18002, category: ts.DiagnosticCategory.Error, key: "The_files_list_in_config_file_0_is_empty_18002", message: "The 'files' list in config file '{0}' is empty." }, No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2: { code: 18003, category: ts.DiagnosticCategory.Error, key: "No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003", message: "No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'." }, Add_missing_super_call: { code: 90001, category: ts.DiagnosticCategory.Message, key: "Add_missing_super_call_90001", message: "Add missing 'super()' call." }, Make_super_call_the_first_statement_in_the_constructor: { code: 90002, category: ts.DiagnosticCategory.Message, key: "Make_super_call_the_first_statement_in_the_constructor_90002", message: "Make 'super()' call the first statement in the constructor." }, - Change_extends_to_implements: { code: 90003, category: ts.DiagnosticCategory.Message, key: "Change_extends_to_implements_90003", message: "Change 'extends' to 'implements'" }, - Remove_unused_identifiers: { code: 90004, category: ts.DiagnosticCategory.Message, key: "Remove_unused_identifiers_90004", message: "Remove unused identifiers" }, - Implement_interface_on_reference: { code: 90005, category: ts.DiagnosticCategory.Message, key: "Implement_interface_on_reference_90005", message: "Implement interface on reference" }, - Implement_interface_on_class: { code: 90006, category: ts.DiagnosticCategory.Message, key: "Implement_interface_on_class_90006", message: "Implement interface on class" }, - Implement_inherited_abstract_class: { code: 90007, category: ts.DiagnosticCategory.Message, key: "Implement_inherited_abstract_class_90007", message: "Implement inherited abstract class" }, - Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: { code: 90009, category: ts.DiagnosticCategory.Error, key: "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009", message: "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig" }, + Change_extends_to_implements: { code: 90003, category: ts.DiagnosticCategory.Message, key: "Change_extends_to_implements_90003", message: "Change 'extends' to 'implements'." }, + Remove_declaration_for_Colon_0: { code: 90004, category: ts.DiagnosticCategory.Message, key: "Remove_declaration_for_Colon_0_90004", message: "Remove declaration for: '{0}'." }, + Implement_interface_0: { code: 90006, category: ts.DiagnosticCategory.Message, key: "Implement_interface_0_90006", message: "Implement interface '{0}'." }, + Implement_inherited_abstract_class: { code: 90007, category: ts.DiagnosticCategory.Message, key: "Implement_inherited_abstract_class_90007", message: "Implement inherited abstract class." }, + Add_this_to_unresolved_variable: { code: 90008, category: ts.DiagnosticCategory.Message, key: "Add_this_to_unresolved_variable_90008", message: "Add 'this.' to unresolved variable." }, + Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: { code: 90009, category: ts.DiagnosticCategory.Error, key: "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009", message: "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig." }, Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: { code: 90010, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010", message: "Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated." }, - Import_0_from_1: { code: 90013, category: ts.DiagnosticCategory.Message, key: "Import_0_from_1_90013", message: "Import {0} from {1}" }, - Change_0_to_1: { code: 90014, category: ts.DiagnosticCategory.Message, key: "Change_0_to_1_90014", message: "Change {0} to {1}" }, - Add_0_to_existing_import_declaration_from_1: { code: 90015, category: ts.DiagnosticCategory.Message, key: "Add_0_to_existing_import_declaration_from_1_90015", message: "Add {0} to existing import declaration from {1}" }, + Import_0_from_1: { code: 90013, category: ts.DiagnosticCategory.Message, key: "Import_0_from_1_90013", message: "Import {0} from {1}." }, + Change_0_to_1: { code: 90014, category: ts.DiagnosticCategory.Message, key: "Change_0_to_1_90014", message: "Change {0} to {1}." }, + Add_0_to_existing_import_declaration_from_1: { code: 90015, category: ts.DiagnosticCategory.Message, key: "Add_0_to_existing_import_declaration_from_1_90015", message: "Add {0} to existing import declaration from {1}." }, + Add_declaration_for_missing_property_0: { code: 90016, category: ts.DiagnosticCategory.Message, key: "Add_declaration_for_missing_property_0_90016", message: "Add declaration for missing property '{0}'." }, + Add_index_signature_for_missing_property_0: { code: 90017, category: ts.DiagnosticCategory.Message, key: "Add_index_signature_for_missing_property_0_90017", message: "Add index signature for missing property '{0}'." }, + Disable_checking_for_this_file: { code: 90018, category: ts.DiagnosticCategory.Message, key: "Disable_checking_for_this_file_90018", message: "Disable checking for this file." }, + Ignore_this_error_message: { code: 90019, category: ts.DiagnosticCategory.Message, key: "Ignore_this_error_message_90019", message: "Ignore this error message." }, + Initialize_property_0_in_the_constructor: { code: 90020, category: ts.DiagnosticCategory.Message, key: "Initialize_property_0_in_the_constructor_90020", message: "Initialize property '{0}' in the constructor." }, + Initialize_static_property_0: { code: 90021, category: ts.DiagnosticCategory.Message, key: "Initialize_static_property_0_90021", message: "Initialize static property '{0}'." }, + Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0: { code: 8017, category: ts.DiagnosticCategory.Error, key: "Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0_8017", message: "Octal literal types must use ES2015 syntax. Use the syntax '{0}'." }, + Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0: { code: 8018, category: ts.DiagnosticCategory.Error, key: "Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0_8018", message: "Octal literals are not allowed in enums members initializer. Use the syntax '{0}'." }, + Report_errors_in_js_files: { code: 8019, category: ts.DiagnosticCategory.Message, key: "Report_errors_in_js_files_8019", message: "Report errors in .js files." }, }; })(ts || (ts = {})); var ts; @@ -3226,7 +4301,7 @@ var ts; return token >= 70; } ts.tokenIsIdentifierOrKeyword = tokenIsIdentifierOrKeyword; - var textToToken = ts.createMap({ + var textToToken = ts.createMapFromTemplate({ "abstract": 116, "any": 118, "as": 117, @@ -3250,7 +4325,7 @@ var ts; "false": 85, "finally": 86, "for": 87, - "from": 138, + "from": 139, "function": 88, "get": 124, "if": 89, @@ -3268,27 +4343,28 @@ var ts; "new": 93, "null": 94, "number": 132, + "object": 133, "package": 110, "private": 111, "protected": 112, "public": 113, "readonly": 130, "require": 131, - "global": 139, + "global": 140, "return": 95, - "set": 133, + "set": 134, "static": 114, - "string": 134, + "string": 135, "super": 96, "switch": 97, - "symbol": 135, + "symbol": 136, "this": 98, "throw": 99, "true": 100, "try": 101, - "type": 136, + "type": 137, "typeof": 102, - "undefined": 137, + "undefined": 138, "var": 103, "void": 104, "while": 105, @@ -3296,7 +4372,7 @@ var ts; "yield": 115, "async": 119, "await": 120, - "of": 140, + "of": 141, "{": 16, "}": 17, "(": 18, @@ -3391,9 +4467,9 @@ var ts; } function makeReverseMap(source) { var result = []; - for (var name_4 in source) { - result[source[name_4]] = name_4; - } + source.forEach(function (value, name) { + result[value] = name; + }); return result; } var tokenStrings = makeReverseMap(textToToken); @@ -3402,7 +4478,7 @@ var ts; } ts.tokenToString = tokenToString; function stringToToken(s) { - return textToToken[s]; + return textToToken.get(s); } ts.stringToToken = stringToToken; function computeLineStarts(text) { @@ -3462,7 +4538,6 @@ var ts; return computeLineAndCharacterOfPosition(getLineStarts(sourceFile), position); } ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; - var hasOwnProperty = Object.prototype.hasOwnProperty; function isWhiteSpace(ch) { return isWhiteSpaceSingleLine(ch) || isLineBreak(ch); } @@ -3598,7 +4673,7 @@ var ts; if (pos === 0 || isLineBreak(text.charCodeAt(pos - 1))) { var ch = text.charCodeAt(pos); if ((pos + mergeConflictMarkerLength) < text.length) { - for (var i = 0, n = mergeConflictMarkerLength; i < n; i++) { + for (var i = 0; i < mergeConflictMarkerLength; i++) { if (text.charCodeAt(pos + i) !== ch) { return false; } @@ -3751,7 +4826,7 @@ var ts; if (!comments) { comments = []; } - comments.push({ pos: pos, end: end, hasTrailingNewLine: hasTrailingNewLine, kind: kind }); + comments.push({ kind: kind, pos: pos, end: end, hasTrailingNewLine: hasTrailingNewLine }); return comments; } function getLeadingCommentRanges(text, pos) { @@ -3784,7 +4859,7 @@ var ts; if (!isIdentifierStart(name.charCodeAt(0), languageVersion)) { return false; } - for (var i = 1, n = name.length; i < n; i++) { + for (var i = 1; i < name.length; i++) { if (!isIdentifierPart(name.charCodeAt(i), languageVersion)) { return false; } @@ -3803,6 +4878,7 @@ var ts; var precedingLineBreak; var hasExtendedUnicodeEscape; var tokenIsUnterminated; + var numericLiteralFlags; setText(text, start, length); return { getStartPos: function () { return startPos; }, @@ -3816,6 +4892,7 @@ var ts; isIdentifier: function () { return token === 70 || token > 106; }, isReservedWord: function () { return token >= 71 && token <= 106; }, isUnterminated: function () { return tokenIsUnterminated; }, + getNumericLiteralFlags: function () { return numericLiteralFlags; }, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, reScanTemplateToken: reScanTemplateToken, @@ -3852,6 +4929,7 @@ var ts; var end = pos; if (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101) { pos++; + numericLiteralFlags = 2; if (text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) pos++; if (isDigit(text.charCodeAt(pos))) { @@ -4121,8 +5199,11 @@ var ts; var len = tokenValue.length; if (len >= 2 && len <= 11) { var ch = tokenValue.charCodeAt(0); - if (ch >= 97 && ch <= 122 && hasOwnProperty.call(textToToken, tokenValue)) { - return token = textToToken[tokenValue]; + if (ch >= 97 && ch <= 122) { + token = textToToken.get(tokenValue); + if (token !== undefined) { + return token; + } } } return token = 70; @@ -4151,6 +5232,7 @@ var ts; hasExtendedUnicodeEscape = false; precedingLineBreak = false; tokenIsUnterminated = false; + numericLiteralFlags = 0; while (true) { tokenPos = pos; if (pos >= end) { @@ -4332,6 +5414,7 @@ var ts; value = 0; } tokenValue = "" + value; + numericLiteralFlags = 8; return token = 8; } else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) { @@ -4342,6 +5425,7 @@ var ts; value = 0; } tokenValue = "" + value; + numericLiteralFlags = 16; return token = 8; } else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) { @@ -4352,10 +5436,12 @@ var ts; value = 0; } tokenValue = "" + value; + numericLiteralFlags = 32; return token = 8; } if (pos + 1 < end && isOctalDigit(text.charCodeAt(pos + 1))) { tokenValue = "" + scanOctalDigits(); + numericLiteralFlags = 4; return token = 8; } case 49: @@ -4602,7 +5688,14 @@ var ts; while (pos < end) { pos++; char = text.charCodeAt(pos); - if ((char === 123) || (char === 60)) { + if (char === 123) { + break; + } + if (char === 60) { + if (isConflictMarkerTrivia(text, pos)) { + pos = scanConflictMarkerTrivia(text, pos, error); + return token = 7; + } break; } } @@ -4776,40 +5869,12 @@ var ts; (function (ts) { ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean" }; ts.optionDeclarations = [ - { - name: "charset", - type: "string", - }, - ts.compileOnSaveCommandLineOption, - { - name: "declaration", - shortName: "d", - type: "boolean", - description: ts.Diagnostics.Generates_corresponding_d_ts_file, - }, - { - name: "declarationDir", - type: "string", - isFilePath: true, - paramType: ts.Diagnostics.DIRECTORY, - }, - { - name: "diagnostics", - type: "boolean", - }, - { - name: "extendedDiagnostics", - type: "boolean", - experimental: true - }, - { - name: "emitBOM", - type: "boolean" - }, { name: "help", shortName: "h", type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, description: ts.Diagnostics.Print_this_message, }, { @@ -4817,219 +5882,57 @@ var ts; shortName: "?", type: "boolean" }, + { + name: "all", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Show_all_compiler_options, + }, + { + name: "version", + shortName: "v", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Print_the_compiler_s_version, + }, { name: "init", type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, description: ts.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file, }, - { - name: "inlineSourceMap", - type: "boolean", - }, - { - name: "inlineSources", - type: "boolean", - }, - { - name: "jsx", - type: ts.createMap({ - "preserve": 1, - "react": 2 - }), - paramType: ts.Diagnostics.KIND, - description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_or_react, - }, - { - name: "reactNamespace", - type: "string", - description: ts.Diagnostics.Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit - }, - { - name: "jsxFactory", - type: "string", - description: ts.Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h - }, - { - name: "listFiles", - type: "boolean", - }, - { - name: "locale", - type: "string", - }, - { - name: "mapRoot", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, - paramType: ts.Diagnostics.LOCATION, - }, - { - name: "module", - shortName: "m", - type: ts.createMap({ - "none": ts.ModuleKind.None, - "commonjs": ts.ModuleKind.CommonJS, - "amd": ts.ModuleKind.AMD, - "system": ts.ModuleKind.System, - "umd": ts.ModuleKind.UMD, - "es6": ts.ModuleKind.ES2015, - "es2015": ts.ModuleKind.ES2015, - }), - description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015, - paramType: ts.Diagnostics.KIND, - }, - { - name: "newLine", - type: ts.createMap({ - "crlf": 0, - "lf": 1 - }), - description: ts.Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, - paramType: ts.Diagnostics.NEWLINE, - }, - { - name: "noEmit", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_outputs, - }, - { - name: "noEmitHelpers", - type: "boolean" - }, - { - name: "noEmitOnError", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported, - }, - { - name: "noErrorTruncation", - type: "boolean" - }, - { - name: "noImplicitAny", - type: "boolean", - description: ts.Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type, - }, - { - name: "noImplicitThis", - type: "boolean", - description: ts.Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type, - }, - { - name: "noUnusedLocals", - type: "boolean", - description: ts.Diagnostics.Report_errors_on_unused_locals, - }, - { - name: "noUnusedParameters", - type: "boolean", - description: ts.Diagnostics.Report_errors_on_unused_parameters, - }, - { - name: "noLib", - type: "boolean", - }, - { - name: "noResolve", - type: "boolean", - }, - { - name: "skipDefaultLibCheck", - type: "boolean", - }, - { - name: "skipLibCheck", - type: "boolean", - description: ts.Diagnostics.Skip_type_checking_of_declaration_files, - }, - { - name: "out", - type: "string", - isFilePath: false, - paramType: ts.Diagnostics.FILE, - }, - { - name: "outFile", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Concatenate_and_emit_output_to_single_file, - paramType: ts.Diagnostics.FILE, - }, - { - name: "outDir", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Redirect_output_structure_to_the_directory, - paramType: ts.Diagnostics.DIRECTORY, - }, - { - name: "preserveConstEnums", - type: "boolean", - description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code - }, - { - name: "pretty", - description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental, - type: "boolean" - }, { name: "project", shortName: "p", type: "string", isFilePath: true, - description: ts.Diagnostics.Compile_the_project_in_the_given_directory, - paramType: ts.Diagnostics.DIRECTORY + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + paramType: ts.Diagnostics.FILE_OR_DIRECTORY, + description: ts.Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json, }, { - name: "removeComments", + name: "pretty", type: "boolean", - description: ts.Diagnostics.Do_not_emit_comments_to_output, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental }, { - name: "rootDir", - type: "string", - isFilePath: true, - paramType: ts.Diagnostics.LOCATION, - description: ts.Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, - }, - { - name: "isolatedModules", + name: "watch", + shortName: "w", type: "boolean", - }, - { - name: "sourceMap", - type: "boolean", - description: ts.Diagnostics.Generates_corresponding_map_file, - }, - { - name: "sourceRoot", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, - paramType: ts.Diagnostics.LOCATION, - }, - { - name: "suppressExcessPropertyErrors", - type: "boolean", - description: ts.Diagnostics.Suppress_excess_property_checks_for_object_literals, - experimental: true - }, - { - name: "suppressImplicitAnyIndexErrors", - type: "boolean", - description: ts.Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures, - }, - { - name: "stripInternal", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, - experimental: true + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Watch_input_files, }, { name: "target", shortName: "t", - type: ts.createMap({ + type: ts.createMapFromTemplate({ "es3": 0, "es5": 1, "es6": 2, @@ -5038,146 +5941,41 @@ var ts; "es2017": 4, "esnext": 5, }), - description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015, paramType: ts.Diagnostics.VERSION, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT, }, { - name: "version", - shortName: "v", - type: "boolean", - description: ts.Diagnostics.Print_the_compiler_s_version, - }, - { - name: "watch", - shortName: "w", - type: "boolean", - description: ts.Diagnostics.Watch_input_files, - }, - { - name: "experimentalDecorators", - type: "boolean", - description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators - }, - { - name: "emitDecoratorMetadata", - type: "boolean", - experimental: true, - description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators - }, - { - name: "moduleResolution", - type: ts.createMap({ - "node": ts.ModuleResolutionKind.NodeJs, - "classic": ts.ModuleResolutionKind.Classic, + name: "module", + shortName: "m", + type: ts.createMapFromTemplate({ + "none": ts.ModuleKind.None, + "commonjs": ts.ModuleKind.CommonJS, + "amd": ts.ModuleKind.AMD, + "system": ts.ModuleKind.System, + "umd": ts.ModuleKind.UMD, + "es6": ts.ModuleKind.ES2015, + "es2015": ts.ModuleKind.ES2015, }), - description: ts.Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6, - paramType: ts.Diagnostics.STRATEGY, - }, - { - name: "allowUnusedLabels", - type: "boolean", - description: ts.Diagnostics.Do_not_report_errors_on_unused_labels - }, - { - name: "noImplicitReturns", - type: "boolean", - description: ts.Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value - }, - { - name: "noFallthroughCasesInSwitch", - type: "boolean", - description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement - }, - { - name: "allowUnreachableCode", - type: "boolean", - description: ts.Diagnostics.Do_not_report_errors_on_unreachable_code - }, - { - name: "forceConsistentCasingInFileNames", - type: "boolean", - description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file - }, - { - name: "baseUrl", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Base_directory_to_resolve_non_absolute_module_names - }, - { - name: "paths", - type: "object", - isTSConfigOnly: true - }, - { - name: "rootDirs", - type: "list", - isTSConfigOnly: true, - element: { - name: "rootDirs", - type: "string", - isFilePath: true - } - }, - { - name: "typeRoots", - type: "list", - element: { - name: "typeRoots", - type: "string", - isFilePath: true - } - }, - { - name: "types", - type: "list", - element: { - name: "types", - type: "string" - }, - description: ts.Diagnostics.Type_declaration_files_to_be_included_in_compilation - }, - { - name: "traceResolution", - type: "boolean", - description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process - }, - { - name: "allowJs", - type: "boolean", - description: ts.Diagnostics.Allow_javascript_files_to_be_compiled - }, - { - name: "allowSyntheticDefaultImports", - type: "boolean", - description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking - }, - { - name: "noImplicitUseStrict", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_use_strict_directives_in_module_output - }, - { - name: "maxNodeModuleJsDepth", - type: "number", - description: ts.Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files - }, - { - name: "listEmittedFiles", - type: "boolean" + paramType: ts.Diagnostics.KIND, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015, }, { name: "lib", type: "list", element: { name: "lib", - type: ts.createMap({ + type: ts.createMapFromTemplate({ "es5": "lib.es5.d.ts", "es6": "lib.es2015.d.ts", "es2015": "lib.es2015.d.ts", "es7": "lib.es2016.d.ts", "es2016": "lib.es2016.d.ts", "es2017": "lib.es2017.d.ts", + "esnext": "lib.esnext.d.ts", "dom": "lib.dom.d.ts", "dom.iterable": "lib.dom.iterable.d.ts", "webworker": "lib.webworker.d.ts", @@ -5195,28 +5993,475 @@ var ts; "es2017.object": "lib.es2017.object.d.ts", "es2017.sharedmemory": "lib.es2017.sharedmemory.d.ts", "es2017.string": "lib.es2017.string.d.ts", + "esnext.asynciterable": "lib.esnext.asynciterable.d.ts", }), }, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon }, { - name: "disableSizeLimit", - type: "boolean" + name: "allowJs", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Allow_javascript_files_to_be_compiled }, { - name: "strictNullChecks", + name: "checkJs", type: "boolean", - description: ts.Diagnostics.Enable_strict_null_checks + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Report_errors_in_js_files + }, + { + name: "jsx", + type: ts.createMapFromTemplate({ + "preserve": 1, + "react-native": 3, + "react": 2 + }), + paramType: ts.Diagnostics.KIND, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_react_native_or_react, + }, + { + name: "declaration", + shortName: "d", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Generates_corresponding_d_ts_file, + }, + { + name: "sourceMap", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Generates_corresponding_map_file, + }, + { + name: "outFile", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.FILE, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Concatenate_and_emit_output_to_single_file, + }, + { + name: "outDir", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.DIRECTORY, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Redirect_output_structure_to_the_directory, + }, + { + name: "rootDir", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.LOCATION, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, + }, + { + name: "removeComments", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Do_not_emit_comments_to_output, + }, + { + name: "noEmit", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Do_not_emit_outputs, }, { name: "importHelpers", type: "boolean", + category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Import_emit_helpers_from_tslib }, + { + name: "downlevelIteration", + type: "boolean", + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3 + }, + { + name: "isolatedModules", + type: "boolean", + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule + }, + { + name: "strict", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Enable_all_strict_type_checking_options + }, + { + name: "noImplicitAny", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type, + }, + { + name: "strictNullChecks", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Enable_strict_null_checks + }, + { + name: "noImplicitThis", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type, + }, { name: "alwaysStrict", type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, description: ts.Diagnostics.Parse_in_strict_mode_and_emit_use_strict_for_each_source_file + }, + { + name: "noUnusedLocals", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_errors_on_unused_locals, + }, + { + name: "noUnusedParameters", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_errors_on_unused_parameters, + }, + { + name: "noImplicitReturns", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value + }, + { + name: "noFallthroughCasesInSwitch", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement + }, + { + name: "moduleResolution", + type: ts.createMapFromTemplate({ + "node": ts.ModuleResolutionKind.NodeJs, + "classic": ts.ModuleResolutionKind.Classic, + }), + paramType: ts.Diagnostics.STRATEGY, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6, + }, + { + name: "baseUrl", + type: "string", + isFilePath: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Base_directory_to_resolve_non_absolute_module_names + }, + { + name: "paths", + type: "object", + isTSConfigOnly: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl + }, + { + name: "rootDirs", + type: "list", + isTSConfigOnly: true, + element: { + name: "rootDirs", + type: "string", + isFilePath: true + }, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime + }, + { + name: "typeRoots", + type: "list", + element: { + name: "typeRoots", + type: "string", + isFilePath: true + }, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.List_of_folders_to_include_type_definitions_from + }, + { + name: "types", + type: "list", + element: { + name: "types", + type: "string" + }, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Type_declaration_files_to_be_included_in_compilation + }, + { + name: "allowSyntheticDefaultImports", + type: "boolean", + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking + }, + { + name: "sourceRoot", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.LOCATION, + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, + }, + { + name: "mapRoot", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.LOCATION, + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, + }, + { + name: "inlineSourceMap", + type: "boolean", + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file + }, + { + name: "inlineSources", + type: "boolean", + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set + }, + { + name: "experimentalDecorators", + type: "boolean", + category: ts.Diagnostics.Experimental_Options, + description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators + }, + { + name: "emitDecoratorMetadata", + type: "boolean", + category: ts.Diagnostics.Experimental_Options, + description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators + }, + { + name: "jsxFactory", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h + }, + { + name: "diagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_diagnostic_information + }, + { + name: "extendedDiagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_verbose_diagnostic_information + }, + { + name: "traceResolution", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process + }, + { + name: "listFiles", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Print_names_of_files_part_of_the_compilation + }, + { + name: "listEmittedFiles", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Print_names_of_generated_files_part_of_the_compilation + }, + { + name: "out", + type: "string", + isFilePath: false, + category: ts.Diagnostics.Advanced_Options, + paramType: ts.Diagnostics.FILE, + description: ts.Diagnostics.Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file, + }, + { + name: "reactNamespace", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit + }, + { + name: "skipDefaultLibCheck", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files + }, + { + name: "charset", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.The_character_set_of_the_input_files + }, + { + name: "emitBOM", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files + }, + { + name: "locale", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.The_locale_used_when_displaying_messages_to_the_user_e_g_en_us + }, + { + name: "newLine", + type: ts.createMapFromTemplate({ + "crlf": 0, + "lf": 1 + }), + paramType: ts.Diagnostics.NEWLINE, + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, + }, + { + name: "noErrorTruncation", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_truncate_error_messages + }, + { + name: "noLib", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_include_the_default_library_file_lib_d_ts + }, + { + name: "noResolve", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files + }, + { + name: "stripInternal", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, + }, + { + name: "disableSizeLimit", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Disable_size_limitations_on_JavaScript_projects + }, + { + name: "noImplicitUseStrict", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_emit_use_strict_directives_in_module_output + }, + { + name: "noEmitHelpers", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_generate_custom_helper_functions_like_extends_in_compiled_output + }, + { + name: "noEmitOnError", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported, + }, + { + name: "preserveConstEnums", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code + }, + { + name: "declarationDir", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.DIRECTORY, + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Output_directory_for_generated_declaration_files + }, + { + name: "skipLibCheck", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Skip_type_checking_of_declaration_files, + }, + { + name: "allowUnusedLabels", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_report_errors_on_unused_labels + }, + { + name: "allowUnreachableCode", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_report_errors_on_unreachable_code + }, + { + name: "suppressExcessPropertyErrors", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Suppress_excess_property_checks_for_object_literals, + }, + { + name: "suppressImplicitAnyIndexErrors", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures, + }, + { + name: "forceConsistentCasingInFileNames", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file + }, + { + name: "maxNodeModuleJsDepth", + type: "number", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files + }, + { + name: "plugins", + type: "list", + isTSConfigOnly: true, + element: { + name: "plugin", + type: "object" + }, + description: ts.Diagnostics.List_of_language_service_plugins } ]; ts.typeAcquisitionDeclarations = [ @@ -5248,8 +6493,7 @@ var ts; ts.defaultInitCompilerOptions = { module: ts.ModuleKind.CommonJS, target: 1, - noImplicitAny: false, - sourceMap: false, + strict: true }; var optionNameMapCache; function convertEnableAutoDiscoveryToEnable(typeAcquisition) { @@ -5271,9 +6515,9 @@ var ts; var optionNameMap = ts.createMap(); var shortOptionNames = ts.createMap(); ts.forEach(ts.optionDeclarations, function (option) { - optionNameMap[option.name.toLowerCase()] = option; + optionNameMap.set(option.name.toLowerCase(), option); if (option.shortName) { - shortOptionNames[option.shortName] = option.name; + shortOptionNames.set(option.shortName, option.name); } }); optionNameMapCache = { optionNameMap: optionNameMap, shortOptionNames: shortOptionNames }; @@ -5281,19 +6525,12 @@ var ts; } ts.getOptionNameMap = getOptionNameMap; function createCompilerDiagnosticForInvalidCustomType(opt) { - var namesOfType = Object.keys(opt.type).map(function (key) { return "'" + key + "'"; }).join(", "); + var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'" + key + "'"; }).join(", "); return ts.createCompilerDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType); } ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType; function parseCustomTypeOption(opt, value, errors) { - var key = trimString((value || "")).toLowerCase(); - var map = opt.type; - if (key in map) { - return map[key]; - } - else { - errors.push(createCompilerDiagnosticForInvalidCustomType(opt)); - } + return convertJsonOptionOfCustomType(opt, trimString(value || ""), errors); } ts.parseCustomTypeOption = parseCustomTypeOption; function parseListTypeOption(opt, value, errors) { @@ -5337,11 +6574,12 @@ var ts; } else if (s.charCodeAt(0) === 45) { s = s.slice(s.charCodeAt(1) === 45 ? 2 : 1).toLowerCase(); - if (s in shortOptionNames) { - s = shortOptionNames[s]; + var short = shortOptionNames.get(s); + if (short !== undefined) { + s = short; } - if (s in optionNameMap) { - var opt = optionNameMap[s]; + var opt = optionNameMap.get(s); + if (opt) { if (opt.isTSConfigOnly) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file, opt.name)); } @@ -5446,7 +6684,7 @@ var ts; } } ts.parseConfigFileTextToJson = parseConfigFileTextToJson; - function generateTSConfig(options, fileNames) { + function generateTSConfig(options, fileNames, newLine) { var compilerOptions = ts.extend(options, ts.defaultInitCompilerOptions); var configurations = { compilerOptions: serializeCompilerOptions(compilerOptions) @@ -5454,7 +6692,7 @@ var ts; if (fileNames && fileNames.length) { configurations.files = fileNames; } - return configurations; + return writeConfigurations(); function getCustomTypeMapOfCommandLineOption(optionDefinition) { if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean") { return undefined; @@ -5467,53 +6705,121 @@ var ts; } } function getNameOfCompilerOptionValue(value, customTypeMap) { - for (var key in customTypeMap) { - if (customTypeMap[key] === value) { + return ts.forEachEntry(customTypeMap, function (mapValue, key) { + if (mapValue === value) { return key; } - } - return undefined; + }); } function serializeCompilerOptions(options) { - var result = ts.createMap(); + var result = {}; var optionsNameMap = getOptionNameMap().optionNameMap; - for (var name_5 in options) { - if (ts.hasProperty(options, name_5)) { - switch (name_5) { - case "init": - case "watch": - case "version": - case "help": - case "project": - break; - default: - var value = options[name_5]; - var optionDefinition = optionsNameMap[name_5.toLowerCase()]; - if (optionDefinition) { - var customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition); - if (!customTypeMap) { - result[name_5] = value; - } - else { - if (optionDefinition.type === "list") { - var convertedValue = []; - for (var _i = 0, _a = value; _i < _a.length; _i++) { - var element = _a[_i]; - convertedValue.push(getNameOfCompilerOptionValue(element, customTypeMap)); - } - result[name_5] = convertedValue; - } - else { - result[name_5] = getNameOfCompilerOptionValue(value, customTypeMap); - } + for (var name in options) { + if (ts.hasProperty(options, name)) { + if (optionsNameMap.has(name) && optionsNameMap.get(name).category === ts.Diagnostics.Command_line_Options) { + continue; + } + var value = options[name]; + var optionDefinition = optionsNameMap.get(name.toLowerCase()); + if (optionDefinition) { + var customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition); + if (!customTypeMap) { + result[name] = value; + } + else { + if (optionDefinition.type === "list") { + var convertedValue = []; + for (var _i = 0, _a = value; _i < _a.length; _i++) { + var element = _a[_i]; + convertedValue.push(getNameOfCompilerOptionValue(element, customTypeMap)); } + result[name] = convertedValue; } - break; + else { + result[name] = getNameOfCompilerOptionValue(value, customTypeMap); + } + } } } } return result; } + function getDefaultValueForOption(option) { + switch (option.type) { + case "number": + return 1; + case "boolean": + return true; + case "string": + return option.isFilePath ? "./" : ""; + case "list": + return []; + case "object": + return {}; + default: + return ts.arrayFrom(option.type.keys())[0]; + } + } + function makePadding(paddingLength) { + return Array(paddingLength + 1).join(" "); + } + function writeConfigurations() { + var categorizedOptions = ts.reduceLeft(ts.filter(ts.optionDeclarations, function (o) { return o.category !== ts.Diagnostics.Command_line_Options && o.category !== ts.Diagnostics.Advanced_Options; }), function (memo, value) { + if (value.category) { + var name = ts.getLocaleSpecificMessage(value.category); + (memo[name] || (memo[name] = [])).push(value); + } + return memo; + }, {}); + var marginLength = 0; + var seenKnownKeys = 0; + var nameColumn = []; + var descriptionColumn = []; + var knownKeysCount = ts.getOwnKeys(configurations.compilerOptions).length; + for (var category in categorizedOptions) { + if (nameColumn.length !== 0) { + nameColumn.push(""); + descriptionColumn.push(""); + } + nameColumn.push("/* " + category + " */"); + descriptionColumn.push(""); + for (var _i = 0, _a = categorizedOptions[category]; _i < _a.length; _i++) { + var option = _a[_i]; + var optionName = void 0; + if (ts.hasProperty(configurations.compilerOptions, option.name)) { + optionName = "\"" + option.name + "\": " + JSON.stringify(configurations.compilerOptions[option.name]) + ((seenKnownKeys += 1) === knownKeysCount ? "" : ","); + } + else { + optionName = "// \"" + option.name + "\": " + JSON.stringify(getDefaultValueForOption(option)) + ","; + } + nameColumn.push(optionName); + descriptionColumn.push("/* " + (option.description && ts.getLocaleSpecificMessage(option.description) || option.name) + " */"); + marginLength = Math.max(optionName.length, marginLength); + } + } + var tab = makePadding(2); + var result = []; + result.push("{"); + result.push(tab + "\"compilerOptions\": {"); + for (var i = 0; i < nameColumn.length; i++) { + var optionName = nameColumn[i]; + var description = descriptionColumn[i]; + result.push(tab + tab + optionName + makePadding(marginLength - optionName.length + 2) + description); + } + if (configurations.files && configurations.files.length) { + result.push(tab + "},"); + result.push(tab + "\"files\": ["); + for (var i = 0; i < configurations.files.length; i++) { + result.push("" + tab + tab + JSON.stringify(configurations.files[i]) + (i === configurations.files.length - 1 ? "" : ",")); + } + result.push(tab + "]"); + } + else { + result.push(tab + "}"); + } + result.push("}"); + return result.join(newLine); + } } ts.generateTSConfig = generateTSConfig; function removeComments(jsonText) { @@ -5533,10 +6839,12 @@ var ts; } return output; } - function parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack) { + function parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions) { if (existingOptions === void 0) { existingOptions = {}; } if (resolutionStack === void 0) { resolutionStack = []; } + if (extraFileExtensions === void 0) { extraFileExtensions = []; } var errors = []; + basePath = ts.normalizeSlashes(basePath); var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames); var resolvedPath = ts.toPath(configFileName || "", basePath, getCanonicalFileName); if (resolutionStack.indexOf(resolvedPath) >= 0) { @@ -5658,7 +6966,7 @@ var ts; if (fileNames === undefined && includeSpecs === undefined) { includeSpecs = ["**/*"]; } - var result = matchFileNames(fileNames, includeSpecs, excludeSpecs, basePath, options, host, errors); + var result = matchFileNames(fileNames, includeSpecs, excludeSpecs, basePath, options, host, errors, extraFileExtensions); if (result.fileNames.length === 0 && !ts.hasProperty(json, "files") && resolutionStack.length === 0) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, configFileName || "tsconfig.json", JSON.stringify(includeSpecs || []), JSON.stringify(excludeSpecs || []))); } @@ -5709,8 +7017,8 @@ var ts; } var optionNameMap = ts.arrayToMap(optionDeclarations, function (opt) { return opt.name; }); for (var id in jsonOptions) { - if (id in optionNameMap) { - var opt = optionNameMap[id]; + var opt = optionNameMap.get(id); + if (opt) { defaultOptions[opt.name] = convertJsonOption(opt, jsonOptions[id], basePath, errors); } else { @@ -5744,8 +7052,9 @@ var ts; } function convertJsonOptionOfCustomType(opt, value, errors) { var key = value.toLowerCase(); - if (key in opt.type) { - return opt.type[key]; + var val = opt.type.get(key); + if (val !== undefined) { + return val; } else { errors.push(createCompilerDiagnosticForInvalidCustomType(opt)); @@ -5762,7 +7071,7 @@ var ts; var invalidDotDotAfterRecursiveWildcardPattern = /(^|\/)\*\*\/(.*\/)?\.\.($|\/)/; var watchRecursivePattern = /\/[^/]*?[*?][^/]*\//; var wildcardDirectoryPattern = /^[^*?]*(?=\/[^/]*[*?])/; - function matchFileNames(fileNames, include, exclude, basePath, options, host, errors) { + function matchFileNames(fileNames, include, exclude, basePath, options, host, errors, extraFileExtensions) { basePath = ts.normalizePath(basePath); var keyMapper = host.useCaseSensitiveFileNames ? caseSensitiveKeyMapper : caseInsensitiveKeyMapper; var literalFileMap = ts.createMap(); @@ -5774,12 +7083,12 @@ var ts; exclude = validateSpecs(exclude, errors, true); } var wildcardDirectories = getWildcardDirectories(include, exclude, basePath, host.useCaseSensitiveFileNames); - var supportedExtensions = ts.getSupportedExtensions(options); + var supportedExtensions = ts.getSupportedExtensions(options, extraFileExtensions); if (fileNames) { for (var _i = 0, fileNames_1 = fileNames; _i < fileNames_1.length; _i++) { var fileName = fileNames_1[_i]; var file = ts.combinePaths(basePath, fileName); - literalFileMap[keyMapper(file)] = file; + literalFileMap.set(keyMapper(file), file); } } if (include && include.length > 0) { @@ -5790,14 +7099,13 @@ var ts; } removeWildcardFilesWithLowerPriorityExtension(file, wildcardFileMap, supportedExtensions, keyMapper); var key = keyMapper(file); - if (!(key in literalFileMap) && !(key in wildcardFileMap)) { - wildcardFileMap[key] = file; + if (!literalFileMap.has(key) && !wildcardFileMap.has(key)) { + wildcardFileMap.set(key, file); } } } - var literalFiles = ts.reduceProperties(literalFileMap, addFileToOutput, []); - var wildcardFiles = ts.reduceProperties(wildcardFileMap, addFileToOutput, []); - wildcardFiles.sort(host.useCaseSensitiveFileNames ? ts.compareStrings : ts.compareStringsCaseInsensitive); + var literalFiles = ts.arrayFrom(literalFileMap.values()); + var wildcardFiles = ts.arrayFrom(wildcardFileMap.values()); return { fileNames: literalFiles.concat(wildcardFiles), wildcardDirectories: wildcardDirectories @@ -5805,8 +7113,8 @@ var ts; } function validateSpecs(specs, errors, allowTrailingRecursion) { var validSpecs = []; - for (var _i = 0, specs_2 = specs; _i < specs_2.length; _i++) { - var spec = specs_2[_i]; + for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) { + var spec = specs_1[_i]; if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); } @@ -5825,7 +7133,7 @@ var ts; function getWildcardDirectories(include, exclude, path, useCaseSensitiveFileNames) { var rawExcludeRegex = ts.getRegularExpressionForWildcard(exclude, path, "exclude"); var excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames ? "" : "i"); - var wildcardDirectories = ts.createMap(); + var wildcardDirectories = {}; if (include !== undefined) { var recursiveKeys = []; for (var _i = 0, include_1 = include; _i < include_1.length; _i++) { @@ -5846,14 +7154,15 @@ var ts; } } } - for (var key in wildcardDirectories) { - for (var _a = 0, recursiveKeys_1 = recursiveKeys; _a < recursiveKeys_1.length; _a++) { - var recursiveKey = recursiveKeys_1[_a]; - if (key !== recursiveKey && ts.containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) { - delete wildcardDirectories[key]; + for (var key in wildcardDirectories) + if (ts.hasProperty(wildcardDirectories, key)) { + for (var _a = 0, recursiveKeys_1 = recursiveKeys; _a < recursiveKeys_1.length; _a++) { + var recursiveKey = recursiveKeys_1[_a]; + if (key !== recursiveKey && ts.containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) { + delete wildcardDirectories[key]; + } } } - } } return wildcardDirectories; } @@ -5872,11 +7181,11 @@ var ts; } function hasFileWithHigherPriorityExtension(file, literalFiles, wildcardFiles, extensions, keyMapper) { var extensionPriority = ts.getExtensionPriority(file, extensions); - var adjustedExtensionPriority = ts.adjustExtensionPriority(extensionPriority); + var adjustedExtensionPriority = ts.adjustExtensionPriority(extensionPriority, extensions); for (var i = 0; i < adjustedExtensionPriority; i++) { var higherPriorityExtension = extensions[i]; var higherPriorityPath = keyMapper(ts.changeExtension(file, higherPriorityExtension)); - if (higherPriorityPath in literalFiles || higherPriorityPath in wildcardFiles) { + if (literalFiles.has(higherPriorityPath) || wildcardFiles.has(higherPriorityPath)) { return true; } } @@ -5884,17 +7193,13 @@ var ts; } function removeWildcardFilesWithLowerPriorityExtension(file, wildcardFiles, extensions, keyMapper) { var extensionPriority = ts.getExtensionPriority(file, extensions); - var nextExtensionPriority = ts.getNextLowestExtensionPriority(extensionPriority); + var nextExtensionPriority = ts.getNextLowestExtensionPriority(extensionPriority, extensions); for (var i = nextExtensionPriority; i < extensions.length; i++) { var lowerPriorityExtension = extensions[i]; var lowerPriorityPath = keyMapper(ts.changeExtension(file, lowerPriorityExtension)); - delete wildcardFiles[lowerPriorityPath]; + wildcardFiles.delete(lowerPriorityPath); } } - function addFileToOutput(output, file) { - output.push(file); - return output; - } function caseSensitiveKeyMapper(key) { return key; } @@ -5903,384 +7208,6 @@ var ts; } })(ts || (ts = {})); var ts; -(function (ts) { - var JsTyping; - (function (JsTyping) { - ; - ; - var safeList; - var EmptySafeList = ts.createMap(); - JsTyping.nodeCoreModuleList = [ - "buffer", "querystring", "events", "http", "cluster", - "zlib", "os", "https", "punycode", "repl", "readline", - "vm", "child_process", "url", "dns", "net", - "dgram", "fs", "path", "string_decoder", "tls", - "crypto", "stream", "util", "assert", "tty", "domain", - "constants", "process", "v8", "timers", "console" - ]; - var nodeCoreModules = ts.arrayToMap(JsTyping.nodeCoreModuleList, function (x) { return x; }); - function discoverTypings(host, fileNames, projectRootPath, safeListPath, packageNameToTypingLocation, typeAcquisition, unresolvedImports) { - var inferredTypings = ts.createMap(); - if (!typeAcquisition || !typeAcquisition.enable) { - return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] }; - } - fileNames = ts.filter(ts.map(fileNames, ts.normalizePath), function (f) { - var kind = ts.ensureScriptKind(f, ts.getScriptKindFromFileName(f)); - return kind === 1 || kind === 2; - }); - if (!safeList) { - var result = ts.readConfigFile(safeListPath, function (path) { return host.readFile(path); }); - safeList = result.config ? ts.createMap(result.config) : EmptySafeList; - } - var filesToWatch = []; - var searchDirs = []; - var exclude = []; - mergeTypings(typeAcquisition.include); - exclude = typeAcquisition.exclude || []; - var possibleSearchDirs = ts.map(fileNames, ts.getDirectoryPath); - if (projectRootPath) { - possibleSearchDirs.push(projectRootPath); - } - searchDirs = ts.deduplicate(possibleSearchDirs); - for (var _i = 0, searchDirs_1 = searchDirs; _i < searchDirs_1.length; _i++) { - var searchDir = searchDirs_1[_i]; - var packageJsonPath = ts.combinePaths(searchDir, "package.json"); - getTypingNamesFromJson(packageJsonPath, filesToWatch); - var bowerJsonPath = ts.combinePaths(searchDir, "bower.json"); - getTypingNamesFromJson(bowerJsonPath, filesToWatch); - var nodeModulesPath = ts.combinePaths(searchDir, "node_modules"); - getTypingNamesFromNodeModuleFolder(nodeModulesPath); - } - getTypingNamesFromSourceFileNames(fileNames); - if (unresolvedImports) { - for (var _a = 0, unresolvedImports_1 = unresolvedImports; _a < unresolvedImports_1.length; _a++) { - var moduleId = unresolvedImports_1[_a]; - var typingName = moduleId in nodeCoreModules ? "node" : moduleId; - if (!(typingName in inferredTypings)) { - inferredTypings[typingName] = undefined; - } - } - } - for (var name_6 in packageNameToTypingLocation) { - if (name_6 in inferredTypings && !inferredTypings[name_6]) { - inferredTypings[name_6] = packageNameToTypingLocation[name_6]; - } - } - for (var _b = 0, exclude_1 = exclude; _b < exclude_1.length; _b++) { - var excludeTypingName = exclude_1[_b]; - delete inferredTypings[excludeTypingName]; - } - var newTypingNames = []; - var cachedTypingPaths = []; - for (var typing in inferredTypings) { - if (inferredTypings[typing] !== undefined) { - cachedTypingPaths.push(inferredTypings[typing]); - } - else { - newTypingNames.push(typing); - } - } - return { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch }; - function mergeTypings(typingNames) { - if (!typingNames) { - return; - } - for (var _i = 0, typingNames_1 = typingNames; _i < typingNames_1.length; _i++) { - var typing = typingNames_1[_i]; - if (!(typing in inferredTypings)) { - inferredTypings[typing] = undefined; - } - } - } - function getTypingNamesFromJson(jsonPath, filesToWatch) { - if (host.fileExists(jsonPath)) { - filesToWatch.push(jsonPath); - } - var result = ts.readConfigFile(jsonPath, function (path) { return host.readFile(path); }); - if (result.config) { - var jsonConfig = result.config; - if (jsonConfig.dependencies) { - mergeTypings(ts.getOwnKeys(jsonConfig.dependencies)); - } - if (jsonConfig.devDependencies) { - mergeTypings(ts.getOwnKeys(jsonConfig.devDependencies)); - } - if (jsonConfig.optionalDependencies) { - mergeTypings(ts.getOwnKeys(jsonConfig.optionalDependencies)); - } - if (jsonConfig.peerDependencies) { - mergeTypings(ts.getOwnKeys(jsonConfig.peerDependencies)); - } - } - } - function getTypingNamesFromSourceFileNames(fileNames) { - var jsFileNames = ts.filter(fileNames, ts.hasJavaScriptFileExtension); - var inferredTypingNames = ts.map(jsFileNames, function (f) { return ts.removeFileExtension(ts.getBaseFileName(f.toLowerCase())); }); - var cleanedTypingNames = ts.map(inferredTypingNames, function (f) { return f.replace(/((?:\.|-)min(?=\.|$))|((?:-|\.)\d+)/g, ""); }); - if (safeList !== EmptySafeList) { - mergeTypings(ts.filter(cleanedTypingNames, function (f) { return f in safeList; })); - } - var hasJsxFile = ts.forEach(fileNames, function (f) { return ts.ensureScriptKind(f, ts.getScriptKindFromFileName(f)) === 2; }); - if (hasJsxFile) { - mergeTypings(["react"]); - } - } - function getTypingNamesFromNodeModuleFolder(nodeModulesPath) { - if (!host.directoryExists(nodeModulesPath)) { - return; - } - var typingNames = []; - var fileNames = host.readDirectory(nodeModulesPath, [".json"], undefined, undefined, 2); - for (var _i = 0, fileNames_2 = fileNames; _i < fileNames_2.length; _i++) { - var fileName = fileNames_2[_i]; - var normalizedFileName = ts.normalizePath(fileName); - if (ts.getBaseFileName(normalizedFileName) !== "package.json") { - continue; - } - var result = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); }); - if (!result.config) { - continue; - } - var packageJson = result.config; - if (packageJson._requiredBy && - ts.filter(packageJson._requiredBy, function (r) { return r[0] === "#" || r === "/"; }).length === 0) { - continue; - } - if (!packageJson.name) { - continue; - } - if (packageJson.typings) { - var absolutePath = ts.getNormalizedAbsolutePath(packageJson.typings, ts.getDirectoryPath(normalizedFileName)); - inferredTypings[packageJson.name] = absolutePath; - } - else { - typingNames.push(packageJson.name); - } - } - mergeTypings(typingNames); - } - } - JsTyping.discoverTypings = discoverTypings; - })(JsTyping = ts.JsTyping || (ts.JsTyping = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var server; - (function (server) { - server.ActionSet = "action::set"; - server.ActionInvalidate = "action::invalidate"; - server.EventInstall = "event::install"; - var Arguments; - (function (Arguments) { - Arguments.GlobalCacheLocation = "--globalTypingsCacheLocation"; - Arguments.LogFile = "--logFile"; - Arguments.EnableTelemetry = "--enableTelemetry"; - })(Arguments = server.Arguments || (server.Arguments = {})); - function hasArgument(argumentName) { - return ts.sys.args.indexOf(argumentName) >= 0; - } - server.hasArgument = hasArgument; - function findArgument(argumentName) { - var index = ts.sys.args.indexOf(argumentName); - return index >= 0 && index < ts.sys.args.length - 1 - ? ts.sys.args[index + 1] - : undefined; - } - server.findArgument = findArgument; - })(server = ts.server || (ts.server = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var server; - (function (server) { - var LogLevel; - (function (LogLevel) { - LogLevel[LogLevel["terse"] = 0] = "terse"; - LogLevel[LogLevel["normal"] = 1] = "normal"; - LogLevel[LogLevel["requestTime"] = 2] = "requestTime"; - LogLevel[LogLevel["verbose"] = 3] = "verbose"; - })(LogLevel = server.LogLevel || (server.LogLevel = {})); - server.emptyArray = []; - var Msg; - (function (Msg) { - Msg.Err = "Err"; - Msg.Info = "Info"; - Msg.Perf = "Perf"; - })(Msg = server.Msg || (server.Msg = {})); - function getProjectRootPath(project) { - switch (project.projectKind) { - case server.ProjectKind.Configured: - return ts.getDirectoryPath(project.getProjectName()); - case server.ProjectKind.Inferred: - return ""; - case server.ProjectKind.External: - var projectName = ts.normalizeSlashes(project.getProjectName()); - return project.projectService.host.fileExists(projectName) ? ts.getDirectoryPath(projectName) : projectName; - } - } - function createInstallTypingsRequest(project, typeAcquisition, unresolvedImports, cachePath) { - return { - projectName: project.getProjectName(), - fileNames: project.getFileNames(true), - compilerOptions: project.getCompilerOptions(), - typeAcquisition: typeAcquisition, - unresolvedImports: unresolvedImports, - projectRootPath: getProjectRootPath(project), - cachePath: cachePath, - kind: "discover" - }; - } - server.createInstallTypingsRequest = createInstallTypingsRequest; - var Errors; - (function (Errors) { - function ThrowNoProject() { - throw new Error("No Project."); - } - Errors.ThrowNoProject = ThrowNoProject; - function ThrowProjectLanguageServiceDisabled() { - throw new Error("The project's language service is disabled."); - } - Errors.ThrowProjectLanguageServiceDisabled = ThrowProjectLanguageServiceDisabled; - function ThrowProjectDoesNotContainDocument(fileName, project) { - throw new Error("Project '" + project.getProjectName() + "' does not contain document '" + fileName + "'"); - } - Errors.ThrowProjectDoesNotContainDocument = ThrowProjectDoesNotContainDocument; - })(Errors = server.Errors || (server.Errors = {})); - function getDefaultFormatCodeSettings(host) { - return { - indentSize: 4, - tabSize: 4, - newLineCharacter: host.newLine || "\n", - convertTabsToSpaces: true, - indentStyle: ts.IndentStyle.Smart, - insertSpaceAfterCommaDelimiter: true, - insertSpaceAfterSemicolonInForStatements: true, - insertSpaceBeforeAndAfterBinaryOperators: true, - insertSpaceAfterKeywordsInControlFlowStatements: true, - insertSpaceAfterFunctionKeywordForAnonymousFunctions: false, - insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false, - insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false, - insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false, - insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false, - placeOpenBraceOnNewLineForFunctions: false, - placeOpenBraceOnNewLineForControlBlocks: false, - }; - } - server.getDefaultFormatCodeSettings = getDefaultFormatCodeSettings; - function mergeMaps(target, source) { - for (var key in source) { - if (ts.hasProperty(source, key)) { - target[key] = source[key]; - } - } - } - server.mergeMaps = mergeMaps; - function removeItemFromSet(items, itemToRemove) { - if (items.length === 0) { - return; - } - var index = items.indexOf(itemToRemove); - if (index < 0) { - return; - } - if (index === items.length - 1) { - items.pop(); - } - else { - items[index] = items.pop(); - } - } - server.removeItemFromSet = removeItemFromSet; - function toNormalizedPath(fileName) { - return ts.normalizePath(fileName); - } - server.toNormalizedPath = toNormalizedPath; - function normalizedPathToPath(normalizedPath, currentDirectory, getCanonicalFileName) { - var f = ts.isRootedDiskPath(normalizedPath) ? normalizedPath : ts.getNormalizedAbsolutePath(normalizedPath, currentDirectory); - return getCanonicalFileName(f); - } - server.normalizedPathToPath = normalizedPathToPath; - function asNormalizedPath(fileName) { - return fileName; - } - server.asNormalizedPath = asNormalizedPath; - function createNormalizedPathMap() { - var map = Object.create(null); - return { - get: function (path) { - return map[path]; - }, - set: function (path, value) { - map[path] = value; - }, - contains: function (path) { - return ts.hasProperty(map, path); - }, - remove: function (path) { - delete map[path]; - } - }; - } - server.createNormalizedPathMap = createNormalizedPathMap; - function isInferredProjectName(name) { - return /dev\/null\/inferredProject\d+\*/.test(name); - } - server.isInferredProjectName = isInferredProjectName; - function makeInferredProjectName(counter) { - return "/dev/null/inferredProject" + counter + "*"; - } - server.makeInferredProjectName = makeInferredProjectName; - function toSortedReadonlyArray(arr) { - arr.sort(); - return arr; - } - server.toSortedReadonlyArray = toSortedReadonlyArray; - var ThrottledOperations = (function () { - function ThrottledOperations(host) { - this.host = host; - this.pendingTimeouts = ts.createMap(); - } - ThrottledOperations.prototype.schedule = function (operationId, delay, cb) { - if (ts.hasProperty(this.pendingTimeouts, operationId)) { - this.host.clearTimeout(this.pendingTimeouts[operationId]); - } - this.pendingTimeouts[operationId] = this.host.setTimeout(ThrottledOperations.run, delay, this, operationId, cb); - }; - ThrottledOperations.run = function (self, operationId, cb) { - delete self.pendingTimeouts[operationId]; - cb(); - }; - return ThrottledOperations; - }()); - server.ThrottledOperations = ThrottledOperations; - var GcTimer = (function () { - function GcTimer(host, delay, logger) { - this.host = host; - this.delay = delay; - this.logger = logger; - } - GcTimer.prototype.scheduleCollect = function () { - if (!this.host.gc || this.timerId != undefined) { - return; - } - this.timerId = this.host.setTimeout(GcTimer.run, this.delay, this); - }; - GcTimer.run = function (self) { - self.timerId = undefined; - var log = self.logger.hasLevel(LogLevel.requestTime); - var before = log && self.host.getMemoryUsage(); - self.host.gc(); - if (log) { - var after = self.host.getMemoryUsage(); - self.logger.perftrc("GC::before " + before + ", after " + after); - } - }; - return GcTimer; - }()); - server.GcTimer = GcTimer; - })(server = ts.server || (ts.server = {})); -})(ts || (ts = {})); -var ts; (function (ts) { function trace(host) { host.trace(ts.formatMessage.apply(undefined, arguments)); @@ -6290,6 +7217,12 @@ var ts; return compilerOptions.traceResolution && host.trace !== undefined; } ts.isTraceEnabled = isTraceEnabled; + var Extensions; + (function (Extensions) { + Extensions[Extensions["TypeScript"] = 0] = "TypeScript"; + Extensions[Extensions["JavaScript"] = 1] = "JavaScript"; + Extensions[Extensions["DtsOnly"] = 2] = "DtsOnly"; + })(Extensions || (Extensions = {})); function resolvedTypeScriptOnly(resolved) { if (!resolved) { return undefined; @@ -6297,9 +7230,6 @@ var ts; ts.Debug.assert(ts.extensionIsTypeScript(resolved.extension)); return resolved.path; } - function resolvedFromAnyFile(path) { - return { path: path, extension: ts.extensionFromPath(path) }; - } function resolvedModuleFromResolved(_a, isExternalLibraryImport) { var path = _a.path, extension = _a.extension; return { resolvedFileName: path, extension: extension, isExternalLibraryImport: isExternalLibraryImport }; @@ -6311,37 +7241,28 @@ var ts; return !(ts.isRootedDiskPath(moduleName) || ts.isExternalModuleNameRelative(moduleName)); } ts.moduleHasNonRelativeName = moduleHasNonRelativeName; - function tryReadTypesSection(extensions, packageJsonPath, baseDirectory, state) { + function tryReadPackageJsonFields(readTypes, packageJsonPath, baseDirectory, state) { var jsonContent = readJson(packageJsonPath, state.host); - switch (extensions) { - case 2: - case 0: - return tryReadFromField("typings") || tryReadFromField("types"); - case 1: - if (typeof jsonContent.main === "string") { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.No_types_specified_in_package_json_so_returning_main_value_of_0, jsonContent.main); - } - return ts.normalizePath(ts.combinePaths(baseDirectory, jsonContent.main)); - } - return undefined; - } + return readTypes ? tryReadFromField("typings") || tryReadFromField("types") : tryReadFromField("main"); function tryReadFromField(fieldName) { - if (ts.hasProperty(jsonContent, fieldName)) { - var typesFile = jsonContent[fieldName]; - if (typeof typesFile === "string") { - var typesFilePath = ts.normalizePath(ts.combinePaths(baseDirectory, typesFile)); - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.package_json_has_0_field_1_that_references_2, fieldName, typesFile, typesFilePath); - } - return typesFilePath; - } - else { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_string_got_1, fieldName, typeof typesFile); - } + if (!ts.hasProperty(jsonContent, fieldName)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.package_json_does_not_have_a_0_field, fieldName); } + return; } + var fileName = jsonContent[fieldName]; + if (typeof fileName !== "string") { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_string_got_1, fieldName, typeof fileName); + } + return; + } + var path = ts.normalizePath(ts.combinePaths(baseDirectory, fileName)); + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.package_json_has_0_field_1_that_references_2, fieldName, fileName, path); + } + return path; } } function readJson(path, host) { @@ -6374,11 +7295,12 @@ var ts; return [ts.combinePaths(currentDirectory, nodeModulesAtTypes)]; } var typeRoots; - forEachAncestorDirectory(currentDirectory, function (directory) { + forEachAncestorDirectory(ts.normalizePath(currentDirectory), function (directory) { var atTypes = ts.combinePaths(directory, nodeModulesAtTypes); if (host.directoryExists(atTypes)) { (typeRoots || (typeRoots = [])).push(atTypes); } + return undefined; }); return typeRoots; } @@ -6433,7 +7355,11 @@ var ts; return ts.forEach(typeRoots, function (typeRoot) { var candidate = ts.combinePaths(typeRoot, typeReferenceDirectiveName); var candidateDirectory = ts.getDirectoryPath(candidate); - return resolvedTypeScriptOnly(loadNodeModuleFromDirectory(2, candidate, failedLookupLocations, !directoryProbablyExists(candidateDirectory, host), moduleResolutionState)); + var directoryExists = directoryProbablyExists(candidateDirectory, host); + if (!directoryExists && traceEnabled) { + trace(host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, candidateDirectory); + } + return resolvedTypeScriptOnly(loadNodeModuleFromDirectory(Extensions.DtsOnly, candidate, failedLookupLocations, !directoryExists, moduleResolutionState)); }); } else { @@ -6449,7 +7375,8 @@ var ts; if (traceEnabled) { trace(host, ts.Diagnostics.Looking_up_in_node_modules_folder_initial_location_0, initialLocationForSecondaryLookup); } - resolvedFile = resolvedTypeScriptOnly(loadModuleFromNodeModules(2, typeReferenceDirectiveName, initialLocationForSecondaryLookup, failedLookupLocations, moduleResolutionState)); + var result = loadModuleFromNodeModules(Extensions.DtsOnly, typeReferenceDirectiveName, initialLocationForSecondaryLookup, failedLookupLocations, moduleResolutionState, undefined); + resolvedFile = resolvedTypeScriptOnly(result && result.value); if (!resolvedFile && traceEnabled) { trace(host, ts.Diagnostics.Type_reference_directive_0_was_not_resolved, typeReferenceDirectiveName); } @@ -6490,31 +7417,116 @@ var ts; return result; } ts.getAutomaticTypeDirectiveNames = getAutomaticTypeDirectiveNames; - function resolveModuleName(moduleName, containingFile, compilerOptions, host) { + function createModuleResolutionCache(currentDirectory, getCanonicalFileName) { + var directoryToModuleNameMap = ts.createFileMap(); + var moduleNameToDirectoryMap = ts.createMap(); + return { getOrCreateCacheForDirectory: getOrCreateCacheForDirectory, getOrCreateCacheForModuleName: getOrCreateCacheForModuleName }; + function getOrCreateCacheForDirectory(directoryName) { + var path = ts.toPath(directoryName, currentDirectory, getCanonicalFileName); + var perFolderCache = directoryToModuleNameMap.get(path); + if (!perFolderCache) { + perFolderCache = ts.createMap(); + directoryToModuleNameMap.set(path, perFolderCache); + } + return perFolderCache; + } + function getOrCreateCacheForModuleName(nonRelativeModuleName) { + if (!moduleHasNonRelativeName(nonRelativeModuleName)) { + return undefined; + } + var perModuleNameCache = moduleNameToDirectoryMap.get(nonRelativeModuleName); + if (!perModuleNameCache) { + perModuleNameCache = createPerModuleNameCache(); + moduleNameToDirectoryMap.set(nonRelativeModuleName, perModuleNameCache); + } + return perModuleNameCache; + } + function createPerModuleNameCache() { + var directoryPathMap = ts.createFileMap(); + return { get: get, set: set }; + function get(directory) { + return directoryPathMap.get(ts.toPath(directory, currentDirectory, getCanonicalFileName)); + } + function set(directory, result) { + var path = ts.toPath(directory, currentDirectory, getCanonicalFileName); + if (directoryPathMap.contains(path)) { + return; + } + directoryPathMap.set(path, result); + var resolvedFileName = result.resolvedModule && result.resolvedModule.resolvedFileName; + var commonPrefix = getCommonPrefix(path, resolvedFileName); + var current = path; + while (true) { + var parent = ts.getDirectoryPath(current); + if (parent === current || directoryPathMap.contains(parent)) { + break; + } + directoryPathMap.set(parent, result); + current = parent; + if (current === commonPrefix) { + break; + } + } + } + function getCommonPrefix(directory, resolution) { + if (resolution === undefined) { + return undefined; + } + var resolutionDirectory = ts.toPath(ts.getDirectoryPath(resolution), currentDirectory, getCanonicalFileName); + var i = 0; + while (i < Math.min(directory.length, resolutionDirectory.length) && directory.charCodeAt(i) === resolutionDirectory.charCodeAt(i)) { + i++; + } + var sep = directory.lastIndexOf(ts.directorySeparator, i); + if (sep < 0) { + return undefined; + } + return directory.substr(0, sep); + } + } + } + ts.createModuleResolutionCache = createModuleResolutionCache; + function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache) { var traceEnabled = isTraceEnabled(compilerOptions, host); if (traceEnabled) { trace(host, ts.Diagnostics.Resolving_module_0_from_1, moduleName, containingFile); } - var moduleResolution = compilerOptions.moduleResolution; - if (moduleResolution === undefined) { - moduleResolution = ts.getEmitModuleKind(compilerOptions) === ts.ModuleKind.CommonJS ? ts.ModuleResolutionKind.NodeJs : ts.ModuleResolutionKind.Classic; + var containingDirectory = ts.getDirectoryPath(containingFile); + var perFolderCache = cache && cache.getOrCreateCacheForDirectory(containingDirectory); + var result = perFolderCache && perFolderCache.get(moduleName); + if (result) { if (traceEnabled) { - trace(host, ts.Diagnostics.Module_resolution_kind_is_not_specified_using_0, ts.ModuleResolutionKind[moduleResolution]); + trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); } } else { - if (traceEnabled) { - trace(host, ts.Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0, ts.ModuleResolutionKind[moduleResolution]); + var moduleResolution = compilerOptions.moduleResolution; + if (moduleResolution === undefined) { + moduleResolution = ts.getEmitModuleKind(compilerOptions) === ts.ModuleKind.CommonJS ? ts.ModuleResolutionKind.NodeJs : ts.ModuleResolutionKind.Classic; + if (traceEnabled) { + trace(host, ts.Diagnostics.Module_resolution_kind_is_not_specified_using_0, ts.ModuleResolutionKind[moduleResolution]); + } + } + else { + if (traceEnabled) { + trace(host, ts.Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0, ts.ModuleResolutionKind[moduleResolution]); + } + } + switch (moduleResolution) { + case ts.ModuleResolutionKind.NodeJs: + result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache); + break; + case ts.ModuleResolutionKind.Classic: + result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache); + break; + } + if (perFolderCache) { + perFolderCache.set(moduleName, result); + var perModuleNameCache = cache.getOrCreateCacheForModuleName(moduleName); + if (perModuleNameCache) { + perModuleNameCache.set(containingDirectory, result); + } } - } - var result; - switch (moduleResolution) { - case ts.ModuleResolutionKind.NodeJs: - result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host); - break; - case ts.ModuleResolutionKind.Classic: - result = classicNameResolver(moduleName, containingFile, compilerOptions, host); - break; } if (traceEnabled) { if (result.resolvedModule) { @@ -6639,37 +7651,43 @@ var ts; return loader(extensions, candidate, failedLookupLocations, !directoryProbablyExists(ts.getDirectoryPath(candidate), state.host), state); } } - function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host) { + function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache) { + return nodeModuleNameResolverWorker(moduleName, containingFile, compilerOptions, host, cache, false); + } + ts.nodeModuleNameResolver = nodeModuleNameResolver; + function nodeModuleNameResolverWorker(moduleName, containingFile, compilerOptions, host, cache, jsOnly) { + if (jsOnly === void 0) { jsOnly = false; } var containingDirectory = ts.getDirectoryPath(containingFile); var traceEnabled = isTraceEnabled(compilerOptions, host); var failedLookupLocations = []; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; - var result = tryResolve(0) || tryResolve(1); - if (result) { - var resolved = result.resolved, isExternalLibraryImport = result.isExternalLibraryImport; + var result = jsOnly ? tryResolve(Extensions.JavaScript) : (tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript)); + if (result && result.value) { + var _a = result.value, resolved = _a.resolved, isExternalLibraryImport = _a.isExternalLibraryImport; return createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations); } return { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; function tryResolve(extensions) { - var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, nodeLoadModuleByRelativeName, failedLookupLocations, state); + var loader = function (extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { return nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, true); }; + var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, failedLookupLocations, state); if (resolved) { - return { resolved: resolved, isExternalLibraryImport: false }; + return toSearchResult({ resolved: resolved, isExternalLibraryImport: false }); } if (moduleHasNonRelativeName(moduleName)) { if (traceEnabled) { - trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder, moduleName); + trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1, moduleName, Extensions[extensions]); } - var resolved_1 = loadModuleFromNodeModules(extensions, moduleName, containingDirectory, failedLookupLocations, state); - return resolved_1 && { resolved: { path: realpath(resolved_1.path, host, traceEnabled), extension: resolved_1.extension }, isExternalLibraryImport: true }; + var resolved_1 = loadModuleFromNodeModules(extensions, moduleName, containingDirectory, failedLookupLocations, state, cache); + return resolved_1 && { value: resolved_1.value && { resolved: { path: realpath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }, isExternalLibraryImport: true } }; } else { var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, false, state); - return resolved_2 && { resolved: resolved_2, isExternalLibraryImport: false }; + var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, false, state, true); + return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: false }); } } } - ts.nodeModuleNameResolver = nodeModuleNameResolver; + ts.nodeModuleNameResolverWorker = nodeModuleNameResolverWorker; function realpath(path, host, traceEnabled) { if (!host.realpath) { return path; @@ -6680,12 +7698,35 @@ var ts; } return real; } - function nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { + function nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson) { if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0, candidate); + trace(state.host, ts.Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1, candidate, Extensions[extensions]); } - var resolvedFromFile = !ts.pathEndsWithDirectorySeparator(candidate) && loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); - return resolvedFromFile || loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); + if (!ts.pathEndsWithDirectorySeparator(candidate)) { + if (!onlyRecordFailures) { + var parentOfCandidate = ts.getDirectoryPath(candidate); + if (!directoryProbablyExists(parentOfCandidate, state.host)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, parentOfCandidate); + } + onlyRecordFailures = true; + } + } + var resolvedFromFile = loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); + if (resolvedFromFile) { + return resolvedFromFile; + } + } + if (!onlyRecordFailures) { + var candidateExists = directoryProbablyExists(candidate, state.host); + if (!candidateExists) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, candidate); + } + onlyRecordFailures = true; + } + } + return loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson); } function directoryProbablyExists(directoryName, host) { return !host.directoryExists || host.directoryExists(directoryName); @@ -6713,11 +7754,11 @@ var ts; } } switch (extensions) { - case 2: + case Extensions.DtsOnly: return tryExtension(".d.ts", ts.Extension.Dts); - case 0: + case Extensions.TypeScript: return tryExtension(".ts", ts.Extension.Ts) || tryExtension(".tsx", ts.Extension.Tsx) || tryExtension(".d.ts", ts.Extension.Dts); - case 1: + case Extensions.JavaScript: return tryExtension(".js", ts.Extension.Js) || tryExtension(".jsx", ts.Extension.Jsx); } function tryExtension(ext, extension) { @@ -6726,113 +7767,181 @@ var ts; } } function tryFile(fileName, failedLookupLocations, onlyRecordFailures, state) { - if (!onlyRecordFailures && state.host.fileExists(fileName)) { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName); - } - return fileName; - } - else { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.File_0_does_not_exist, fileName); - } - failedLookupLocations.push(fileName); - return undefined; - } - } - function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { - var packageJsonPath = pathToPackageJson(candidate); - var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); - if (directoryExists && state.host.fileExists(packageJsonPath)) { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); - } - var typesFile = tryReadTypesSection(extensions, packageJsonPath, candidate, state); - if (typesFile) { - var onlyRecordFailures_1 = !directoryProbablyExists(ts.getDirectoryPath(typesFile), state.host); - var fromFile = tryFile(typesFile, failedLookupLocations, onlyRecordFailures_1, state); - if (fromFile) { - return resolvedFromAnyFile(fromFile); - } - var x = tryAddingExtensions(typesFile, 0, failedLookupLocations, onlyRecordFailures_1, state); - if (x) { - return x; + if (!onlyRecordFailures) { + if (state.host.fileExists(fileName)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName); } + return fileName; } else { if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.package_json_does_not_have_a_types_or_main_field); + trace(state.host, ts.Diagnostics.File_0_does_not_exist, fileName); } } } - else { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.File_0_does_not_exist, packageJsonPath); + failedLookupLocations.push(fileName); + return undefined; + } + function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson) { + if (considerPackageJson === void 0) { considerPackageJson = true; } + var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); + if (considerPackageJson) { + var packageJsonPath = pathToPackageJson(candidate); + if (directoryExists && state.host.fileExists(packageJsonPath)) { + var fromPackageJson = loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state); + if (fromPackageJson) { + return fromPackageJson; + } + } + else { + if (directoryExists && state.traceEnabled) { + trace(state.host, ts.Diagnostics.File_0_does_not_exist, packageJsonPath); + } + failedLookupLocations.push(packageJsonPath); } - failedLookupLocations.push(packageJsonPath); } return loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state); } + function loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); + } + var file = tryReadPackageJsonFields(extensions !== Extensions.JavaScript, packageJsonPath, candidate, state); + if (!file) { + return undefined; + } + var onlyRecordFailures = !directoryProbablyExists(ts.getDirectoryPath(file), state.host); + var fromFile = tryFile(file, failedLookupLocations, onlyRecordFailures, state); + if (fromFile) { + var resolved = fromFile && resolvedIfExtensionMatches(extensions, fromFile); + if (resolved) { + return resolved; + } + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromFile); + } + } + var nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions; + return nodeLoadModuleByRelativeName(nextExtensions, file, failedLookupLocations, onlyRecordFailures, state, false); + } + function resolvedIfExtensionMatches(extensions, path) { + var extension = ts.tryGetExtensionFromPath(path); + return extension !== undefined && extensionIsOk(extensions, extension) ? { path: path, extension: extension } : undefined; + } + function extensionIsOk(extensions, extension) { + switch (extensions) { + case Extensions.JavaScript: + return extension === ts.Extension.Js || extension === ts.Extension.Jsx; + case Extensions.TypeScript: + return extension === ts.Extension.Ts || extension === ts.Extension.Tsx || extension === ts.Extension.Dts; + case Extensions.DtsOnly: + return extension === ts.Extension.Dts; + } + } function pathToPackageJson(directory) { return ts.combinePaths(directory, "package.json"); } - function loadModuleFromNodeModulesFolder(extensions, moduleName, directory, failedLookupLocations, state) { - var nodeModulesFolder = ts.combinePaths(directory, "node_modules"); - var nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, state.host); + function loadModuleFromNodeModulesFolder(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, failedLookupLocations, state) { var candidate = ts.normalizePath(ts.combinePaths(nodeModulesFolder, moduleName)); return loadModuleFromFile(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state) || loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state); } - function loadModuleFromNodeModules(extensions, moduleName, directory, failedLookupLocations, state) { - return loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, false); + function loadModuleFromNodeModules(extensions, moduleName, directory, failedLookupLocations, state, cache) { + return loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, false, cache); } function loadModuleFromNodeModulesAtTypes(moduleName, directory, failedLookupLocations, state) { - return loadModuleFromNodeModulesWorker(2, moduleName, directory, failedLookupLocations, state, true); + return loadModuleFromNodeModulesWorker(Extensions.DtsOnly, moduleName, directory, failedLookupLocations, state, true, undefined); } - function loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, typesOnly) { + function loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, typesOnly, cache) { + var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName); return forEachAncestorDirectory(ts.normalizeSlashes(directory), function (ancestorDirectory) { if (ts.getBaseFileName(ancestorDirectory) !== "node_modules") { - return loadModuleFromNodeModulesOneLevel(extensions, moduleName, ancestorDirectory, failedLookupLocations, state, typesOnly); + var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, ancestorDirectory, state.traceEnabled, state.host); + if (resolutionFromCache) { + return resolutionFromCache; + } + return toSearchResult(loadModuleFromNodeModulesOneLevel(extensions, moduleName, ancestorDirectory, failedLookupLocations, state, typesOnly)); } }); } function loadModuleFromNodeModulesOneLevel(extensions, moduleName, directory, failedLookupLocations, state, typesOnly) { if (typesOnly === void 0) { typesOnly = false; } - var packageResult = typesOnly ? undefined : loadModuleFromNodeModulesFolder(extensions, moduleName, directory, failedLookupLocations, state); + var nodeModulesFolder = ts.combinePaths(directory, "node_modules"); + var nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, state.host); + if (!nodeModulesFolderExists && state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesFolder); + } + var packageResult = typesOnly ? undefined : loadModuleFromNodeModulesFolder(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, failedLookupLocations, state); if (packageResult) { return packageResult; } - if (extensions !== 1) { - return loadModuleFromNodeModulesFolder(2, ts.combinePaths("@types", moduleName), directory, failedLookupLocations, state); + if (extensions !== Extensions.JavaScript) { + var nodeModulesAtTypes_1 = ts.combinePaths(nodeModulesFolder, "@types"); + var nodeModulesAtTypesExists = nodeModulesFolderExists; + if (nodeModulesFolderExists && !directoryProbablyExists(nodeModulesAtTypes_1, state.host)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesAtTypes_1); + } + nodeModulesAtTypesExists = false; + } + return loadModuleFromNodeModulesFolder(Extensions.DtsOnly, mangleScopedPackage(moduleName, state), nodeModulesAtTypes_1, nodeModulesAtTypesExists, failedLookupLocations, state); } } - function classicNameResolver(moduleName, containingFile, compilerOptions, host) { + function mangleScopedPackage(moduleName, state) { + if (ts.startsWith(moduleName, "@")) { + var replaceSlash = moduleName.replace(ts.directorySeparator, "__"); + if (replaceSlash !== moduleName) { + var mangled = replaceSlash.slice(1); + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Scoped_package_detected_looking_in_0, mangled); + } + return mangled; + } + } + return moduleName; + } + function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, traceEnabled, host) { + var result = cache && cache.get(containingDirectory); + if (result) { + if (traceEnabled) { + trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); + } + return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension } }; + } + } + function classicNameResolver(moduleName, containingFile, compilerOptions, host, cache) { var traceEnabled = isTraceEnabled(compilerOptions, host); var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var failedLookupLocations = []; var containingDirectory = ts.getDirectoryPath(containingFile); - var resolved = tryResolve(0) || tryResolve(1); - return createResolvedModuleWithFailedLookupLocations(resolved, false, failedLookupLocations); + var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); + return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, false, failedLookupLocations); function tryResolve(extensions) { var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFile, failedLookupLocations, state); if (resolvedUsingSettings) { - return resolvedUsingSettings; + return { value: resolvedUsingSettings }; } + var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName); if (moduleHasNonRelativeName(moduleName)) { var resolved_3 = forEachAncestorDirectory(containingDirectory, function (directory) { + var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, directory, traceEnabled, host); + if (resolutionFromCache) { + return resolutionFromCache; + } var searchName = ts.normalizePath(ts.combinePaths(directory, moduleName)); - return loadModuleFromFile(extensions, searchName, failedLookupLocations, false, state); + return toSearchResult(loadModuleFromFile(extensions, searchName, failedLookupLocations, false, state)); }); if (resolved_3) { return resolved_3; } - if (extensions === 0) { + if (extensions === Extensions.TypeScript) { return loadModuleFromNodeModulesAtTypes(moduleName, containingDirectory, failedLookupLocations, state); } } else { var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - return loadModuleFromFile(extensions, candidate, failedLookupLocations, false, state); + return toSearchResult(loadModuleFromFile(extensions, candidate, failedLookupLocations, false, state)); } } } @@ -6844,10 +7953,13 @@ var ts; } var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var failedLookupLocations = []; - var resolved = loadModuleFromNodeModulesOneLevel(2, moduleName, globalCache, failedLookupLocations, state); + var resolved = loadModuleFromNodeModulesOneLevel(Extensions.DtsOnly, moduleName, globalCache, failedLookupLocations, state); return createResolvedModuleWithFailedLookupLocations(resolved, true, failedLookupLocations); } ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache; + function toSearchResult(value) { + return value !== undefined ? { value: value } : undefined; + } function forEachAncestorDirectory(directory, callback) { while (true) { var result = callback(directory); @@ -6878,6 +7990,19 @@ var ts; return undefined; } ts.getDeclarationOfKind = getDeclarationOfKind; + function findDeclaration(symbol, predicate) { + var declarations = symbol.declarations; + if (declarations) { + for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { + var declaration = declarations_2[_i]; + if (predicate(declaration)) { + return declaration; + } + } + } + return undefined; + } + ts.findDeclaration = findDeclaration; var stringWriters = []; function getSingleLineStringWriter() { if (stringWriters.length === 0) { @@ -6891,13 +8016,15 @@ var ts; writeSpace: writeText, writeStringLiteral: writeText, writeParameter: writeText, + writeProperty: writeText, writeSymbol: writeText, writeLine: function () { return str_1 += " "; }, increaseIndent: ts.noop, decreaseIndent: ts.noop, clear: function () { return str_1 = ""; }, trackSymbol: ts.noop, - reportInaccessibleThisError: ts.noop + reportInaccessibleThisError: ts.noop, + reportIllegalExtends: ts.noop }; } return stringWriters.pop(); @@ -6913,25 +8040,25 @@ var ts; } ts.getFullWidth = getFullWidth; function hasResolvedModule(sourceFile, moduleNameText) { - return !!(sourceFile && sourceFile.resolvedModules && sourceFile.resolvedModules[moduleNameText]); + return !!(sourceFile && sourceFile.resolvedModules && sourceFile.resolvedModules.get(moduleNameText)); } ts.hasResolvedModule = hasResolvedModule; function getResolvedModule(sourceFile, moduleNameText) { - return hasResolvedModule(sourceFile, moduleNameText) ? sourceFile.resolvedModules[moduleNameText] : undefined; + return hasResolvedModule(sourceFile, moduleNameText) ? sourceFile.resolvedModules.get(moduleNameText) : undefined; } ts.getResolvedModule = getResolvedModule; function setResolvedModule(sourceFile, moduleNameText, resolvedModule) { if (!sourceFile.resolvedModules) { sourceFile.resolvedModules = ts.createMap(); } - sourceFile.resolvedModules[moduleNameText] = resolvedModule; + sourceFile.resolvedModules.set(moduleNameText, resolvedModule); } ts.setResolvedModule = setResolvedModule; function setResolvedTypeReferenceDirective(sourceFile, typeReferenceDirectiveName, resolvedTypeReferenceDirective) { if (!sourceFile.resolvedTypeReferenceDirectiveNames) { sourceFile.resolvedTypeReferenceDirectiveNames = ts.createMap(); } - sourceFile.resolvedTypeReferenceDirectiveNames[typeReferenceDirectiveName] = resolvedTypeReferenceDirective; + sourceFile.resolvedTypeReferenceDirectiveNames.set(typeReferenceDirectiveName, resolvedTypeReferenceDirective); } ts.setResolvedTypeReferenceDirective = setResolvedTypeReferenceDirective; function moduleResolutionIsEqualTo(oldResolution, newResolution) { @@ -6950,7 +8077,7 @@ var ts; } for (var i = 0; i < names.length; i++) { var newResolution = newResolutions[i]; - var oldResolution = oldResolutions && oldResolutions[names[i]]; + var oldResolution = oldResolutions && oldResolutions.get(names[i]); var changed = oldResolution ? !newResolution || !comparer(oldResolution, newResolution) : newResolution; @@ -6963,21 +8090,21 @@ var ts; ts.hasChangesInResolutions = hasChangesInResolutions; function containsParseError(node) { aggregateChildData(node); - return (node.flags & 4194304) !== 0; + return (node.flags & 131072) !== 0; } ts.containsParseError = containsParseError; function aggregateChildData(node) { - if (!(node.flags & 8388608)) { - var thisNodeOrAnySubNodesHasError = ((node.flags & 1048576) !== 0) || + if (!(node.flags & 262144)) { + var thisNodeOrAnySubNodesHasError = ((node.flags & 32768) !== 0) || ts.forEachChild(node, containsParseError); if (thisNodeOrAnySubNodesHasError) { - node.flags |= 4194304; + node.flags |= 131072; } - node.flags |= 8388608; + node.flags |= 262144; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 261) { + while (node && node.kind !== 264) { node = node.parent; } return node; @@ -6985,11 +8112,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 204: - case 232: - case 211: - case 212: + case 206: + case 234: case 213: + case 214: + case 215: return true; } return false; @@ -7044,6 +8171,10 @@ var ts; return !nodeIsMissing(node); } ts.nodeIsPresent = nodeIsPresent; + function isToken(n) { + return n.kind >= 0 && n.kind <= 141; + } + ts.isToken = isToken; function getTokenPosOfNode(node, sourceFile, includeJsDoc) { if (nodeIsMissing(node)) { return node.pos; @@ -7054,18 +8185,18 @@ var ts; if (includeJsDoc && node.jsDoc && node.jsDoc.length > 0) { return getTokenPosOfNode(node.jsDoc[0]); } - if (node.kind === 292 && node._children.length > 0) { + if (node.kind === 293 && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); } ts.getTokenPosOfNode = getTokenPosOfNode; function isJSDocNode(node) { - return node.kind >= 262 && node.kind <= 288; + return node.kind >= 266 && node.kind <= 292; } ts.isJSDocNode = isJSDocNode; function isJSDocTag(node) { - return node.kind >= 278 && node.kind <= 291; + return node.kind >= 282 && node.kind <= 292; } ts.isJSDocTag = isJSDocTag; function getNonDecoratorTokenPosOfNode(node, sourceFile) { @@ -7096,16 +8227,9 @@ var ts; return getSourceTextOfNodeFromSourceFile(getSourceFileOfNode(node), node, includeTrivia); } ts.getTextOfNode = getTextOfNode; - function getLiteralText(node, sourceFile, languageVersion) { - if (languageVersion < 2 && (isTemplateLiteralKind(node.kind) || node.hasExtendedUnicodeEscape)) { - return getQuotedEscapedLiteralText('"', node.text, '"'); - } + function getLiteralText(node, sourceFile) { if (!nodeIsSynthesized(node) && node.parent) { - var text = getSourceTextOfNodeFromSourceFile(sourceFile, node); - if (languageVersion < 2 && isBinaryOrOctalIntegerLiteral(node, text)) { - return node.text; - } - return text; + return getSourceTextOfNodeFromSourceFile(sourceFile, node); } switch (node.kind) { case 9: @@ -7124,19 +8248,6 @@ var ts; ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for."); } ts.getLiteralText = getLiteralText; - function isBinaryOrOctalIntegerLiteral(node, text) { - if (node.kind === 8 && text.length > 1) { - switch (text.charCodeAt(1)) { - case 98: - case 66: - case 111: - case 79: - return true; - } - } - return false; - } - ts.isBinaryOrOctalIntegerLiteral = isBinaryOrOctalIntegerLiteral; function getQuotedEscapedLiteralText(leftQuote, text, rightQuote) { return leftQuote + escapeNonAsciiCharacters(escapeString(text)) + rightQuote; } @@ -7144,10 +8255,6 @@ var ts; return identifier.length >= 2 && identifier.charCodeAt(0) === 95 && identifier.charCodeAt(1) === 95 ? "_" + identifier : identifier; } ts.escapeIdentifier = escapeIdentifier; - function unescapeIdentifier(identifier) { - return identifier.length >= 3 && identifier.charCodeAt(0) === 95 && identifier.charCodeAt(1) === 95 && identifier.charCodeAt(2) === 95 ? identifier.substr(1) : identifier; - } - ts.unescapeIdentifier = unescapeIdentifier; function makeIdentifierFromModuleName(moduleName) { return ts.getBaseFileName(moduleName).replace(/^(\d)/, "_$1").replace(/\W/g, "_"); } @@ -7159,11 +8266,11 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 223 && node.parent.kind === 256; + return node.kind === 225 && node.parent.kind === 259; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { - return node && node.kind === 230 && + return node && node.kind === 232 && (node.name.kind === 9 || isGlobalScopeAugmentation(node)); } ts.isAmbientModule = isAmbientModule; @@ -7172,11 +8279,11 @@ var ts; } ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { - return node.kind === 230 && (!node.body); + return node && node.kind === 232 && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 261 || - node.kind === 230 || + return node.kind === 264 || + node.kind === 232 || isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -7189,32 +8296,36 @@ var ts; return false; } switch (node.parent.kind) { - case 261: + case 264: return ts.isExternalModule(node.parent); - case 231: + case 233: return isAmbientModule(node.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; } ts.isExternalModuleAugmentation = isExternalModuleAugmentation; + function isEffectiveExternalModule(node, compilerOptions) { + return ts.isExternalModule(node) || compilerOptions.isolatedModules; + } + ts.isEffectiveExternalModule = isEffectiveExternalModule; function isBlockScope(node, parentNode) { switch (node.kind) { - case 261: + case 264: + case 234: + case 259: case 232: - case 256: - case 230: - case 211: - case 212: case 213: - case 150: - case 149: + case 214: + case 215: case 151: + case 150: case 152: - case 225: - case 184: + case 153: + case 227: case 185: + case 186: return true; - case 204: + case 206: return parentNode && !isFunctionLike(parentNode); } return false; @@ -7234,6 +8345,10 @@ var ts; return getFullWidth(name) === 0 ? "(Missing)" : getTextOfNode(name); } ts.declarationNameToString = declarationNameToString; + function getNameFromIndexInfo(info) { + return info.declaration ? declarationNameToString(info.declaration.parameters[0].name) : undefined; + } + ts.getNameFromIndexInfo = getNameFromIndexInfo; function getTextOfPropertyName(name) { switch (name.kind) { case 70: @@ -7241,7 +8356,7 @@ var ts; case 9: case 8: return name.text; - case 142: + case 143: if (isStringOrNumericLiteral(name.expression)) { return name.expression.text; } @@ -7252,10 +8367,10 @@ var ts; function entityNameToString(name) { switch (name.kind) { case 70: - return getFullWidth(name) === 0 ? unescapeIdentifier(name.text) : getTextOfNode(name); - case 141: + return getFullWidth(name) === 0 ? ts.unescapeIdentifier(name.text) : getTextOfNode(name); + case 142: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 177: + case 178: return entityNameToString(name.expression) + "." + entityNameToString(name.name); } } @@ -7292,7 +8407,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 204) { + if (node.body && node.body.kind === 206) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -7304,29 +8419,29 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 261: + case 264: var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); if (pos_1 === sourceFile.text.length) { return ts.createTextSpan(0, 0); } return getSpanOfTokenAtPosition(sourceFile, pos_1); - case 223: - case 174: - case 226: - case 197: - case 227: - case 230: - case 229: - case 260: case 225: - case 184: - case 149: - case 151: - case 152: + case 175: case 228: + case 198: + case 229: + case 232: + case 231: + case 263: + case 227: + case 185: + case 150: + case 152: + case 153: + case 230: errorNode = node.name; break; - case 185: + case 186: return getErrorSpanForArrowFunction(sourceFile, node); } if (errorNode === undefined) { @@ -7347,7 +8462,7 @@ var ts; } ts.isDeclarationFile = isDeclarationFile; function isConstEnumDeclaration(node) { - return node.kind === 229 && isConst(node); + return node.kind === 231 && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function isConst(node) { @@ -7360,11 +8475,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 179 && n.expression.kind === 96; + return n.kind === 180 && n.expression.kind === 96; } ts.isSuperCall = isSuperCall; function isPrologueDirective(node) { - return node.kind === 207 + return node.kind === 209 && node.expression.kind === 9; } ts.isPrologueDirective = isPrologueDirective; @@ -7377,10 +8492,10 @@ var ts; } ts.getLeadingCommentRangesOfNodeFromText = getLeadingCommentRangesOfNodeFromText; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 144 || - node.kind === 143 || - node.kind === 184 || - node.kind === 185) ? + var commentRanges = (node.kind === 145 || + node.kind === 144 || + node.kind === 185 || + node.kind === 186) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRangesOfNodeFromText(node, text); return ts.filter(commentRanges, function (comment) { @@ -7394,96 +8509,110 @@ var ts; ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (156 <= node.kind && node.kind <= 171) { + if (157 <= node.kind && node.kind <= 172) { return true; } switch (node.kind) { case 118: case 132: - case 134: - case 121: case 135: - case 137: + case 121: + case 136: + case 138: case 129: return true; case 104: - return node.parent.kind !== 188; - case 199: + return node.parent.kind !== 189; + case 200: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); case 70: - if (node.parent.kind === 141 && node.parent.right === node) { + if (node.parent.kind === 142 && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 177 && node.parent.name === node) { + else if (node.parent.kind === 178 && node.parent.name === node) { node = node.parent; } - ts.Debug.assert(node.kind === 70 || node.kind === 141 || node.kind === 177, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); - case 141: - case 177: + ts.Debug.assert(node.kind === 70 || node.kind === 142 || node.kind === 178, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + case 142: + case 178: case 98: - var parent_1 = node.parent; - if (parent_1.kind === 160) { + var parent = node.parent; + if (parent.kind === 161) { return false; } - if (156 <= parent_1.kind && parent_1.kind <= 171) { + if (157 <= parent.kind && parent.kind <= 172) { return true; } - switch (parent_1.kind) { - case 199: - return !isExpressionWithTypeArgumentsInClassExtendsClause(parent_1); - case 143: - return node === parent_1.constraint; - case 147: - case 146: + switch (parent.kind) { + case 200: + return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); case 144: - case 223: - return node === parent_1.type; + return node === parent.constraint; + case 148: + case 147: + case 145: case 225: - case 184: + return node === parent.type; + case 227: case 185: + case 186: + case 151: case 150: case 149: - case 148: - case 151: case 152: - return node === parent_1.type; case 153: + return node === parent.type; case 154: case 155: - return node === parent_1.type; - case 182: - return node === parent_1.type; - case 179: + case 156: + return node === parent.type; + case 183: + return node === parent.type; case 180: - return parent_1.typeArguments && ts.indexOf(parent_1.typeArguments, node) >= 0; case 181: + return parent.typeArguments && ts.indexOf(parent.typeArguments, node) >= 0; + case 182: return false; } } return false; } ts.isPartOfTypeNode = isPartOfTypeNode; + function isChildOfNodeWithKind(node, kind) { + while (node) { + if (node.kind === kind) { + return true; + } + node = node.parent; + } + return false; + } + ts.isChildOfNodeWithKind = isChildOfNodeWithKind; + function isPrefixUnaryExpression(node) { + return node.kind === 191; + } + ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function forEachReturnStatement(body, visitor) { return traverse(body); function traverse(node) { switch (node.kind) { - case 216: + case 218: return visitor(node); - case 232: - case 204: - case 208: - case 209: + case 234: + case 206: case 210: case 211: case 212: case 213: - case 217: - case 218: - case 253: - case 254: + case 214: + case 215: case 219: - case 221: + case 220: case 256: + case 257: + case 221: + case 223: + case 259: return ts.forEachChild(node, traverse); } } @@ -7493,24 +8622,25 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 195: + case 196: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } + return; + case 231: case 229: - case 227: + case 232: case 230: case 228: - case 226: - case 197: + case 198: return; default: if (isFunctionLike(node)) { - var name_7 = node.name; - if (name_7 && name_7.kind === 142) { - traverse(name_7.expression); + var name = node.name; + if (name && name.kind === 143) { + traverse(name.expression); return; } } @@ -7521,17 +8651,29 @@ var ts; } } ts.forEachYieldExpression = forEachYieldExpression; + function getRestParameterElementType(node) { + if (node && node.kind === 163) { + return node.elementType; + } + else if (node && node.kind === 158) { + return ts.singleOrUndefined(node.typeArguments); + } + else { + return undefined; + } + } + ts.getRestParameterElementType = getRestParameterElementType; function isVariableLike(node) { if (node) { switch (node.kind) { - case 174: + case 175: + case 263: + case 145: case 260: - case 144: - case 257: + case 148: case 147: - case 146: - case 258: - case 223: + case 261: + case 225: return true; } } @@ -7539,11 +8681,11 @@ var ts; } ts.isVariableLike = isVariableLike; function isAccessor(node) { - return node && (node.kind === 151 || node.kind === 152); + return node && (node.kind === 152 || node.kind === 153); } ts.isAccessor = isAccessor; function isClassLike(node) { - return node && (node.kind === 226 || node.kind === 197); + return node && (node.kind === 228 || node.kind === 198); } ts.isClassLike = isClassLike; function isFunctionLike(node) { @@ -7552,19 +8694,19 @@ var ts; ts.isFunctionLike = isFunctionLike; function isFunctionLikeKind(kind) { switch (kind) { - case 150: - case 184: - case 225: - case 185: - case 149: - case 148: case 151: + case 185: + case 227: + case 186: + case 150: + case 149: case 152: case 153: case 154: case 155: - case 158: + case 156: case 159: + case 160: return true; } return false; @@ -7572,13 +8714,13 @@ var ts; ts.isFunctionLikeKind = isFunctionLikeKind; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 149: - case 148: case 150: + case 149: case 151: case 152: - case 225: - case 184: + case 153: + case 227: + case 185: return true; } return false; @@ -7586,30 +8728,42 @@ var ts; ts.introducesArgumentsExoticObject = introducesArgumentsExoticObject; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { + case 213: + case 214: + case 215: case 211: case 212: - case 213: - case 209: - case 210: return true; - case 219: + case 221: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; } ts.isIterationStatement = isIterationStatement; + function unwrapInnermostStatementOfLabel(node, beforeUnwrapLabelCallback) { + while (true) { + if (beforeUnwrapLabelCallback) { + beforeUnwrapLabelCallback(node); + } + if (node.statement.kind !== 221) { + return node.statement; + } + node = node.statement; + } + } + ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 204 && isFunctionLike(node.parent); + return node && node.kind === 206 && isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 149 && node.parent.kind === 176; + return node && node.kind === 150 && node.parent.kind === 177; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 149 && - (node.parent.kind === 176 || - node.parent.kind === 197); + return node.kind === 150 && + (node.parent.kind === 177 || + node.parent.kind === 198); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -7645,44 +8799,57 @@ var ts; return undefined; } switch (node.kind) { - case 142: + case 143: if (isClassLike(node.parent.parent)) { return node; } node = node.parent; break; - case 145: - if (node.parent.kind === 144 && isClassElement(node.parent.parent)) { + case 146: + if (node.parent.kind === 145 && isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (isClassElement(node.parent)) { node = node.parent; } break; - case 185: + case 186: if (!includeArrowFunctions) { continue; } - case 225: - case 184: - case 230: - case 147: - case 146: - case 149: + case 227: + case 185: + case 232: case 148: + case 147: case 150: + case 149: case 151: case 152: case 153: case 154: case 155: - case 229: - case 261: + case 156: + case 231: + case 264: return node; } } } ts.getThisContainer = getThisContainer; + function getNewTargetContainer(node) { + var container = getThisContainer(node, false); + if (container) { + switch (container.kind) { + case 151: + case 227: + case 185: + return container; + } + } + return undefined; + } + ts.getNewTargetContainer = getNewTargetContainer; function getSuperContainer(node, stopOnFunctions) { while (true) { node = node.parent; @@ -7690,25 +8857,25 @@ var ts; return node; } switch (node.kind) { - case 142: + case 143: node = node.parent; break; - case 225: - case 184: + case 227: case 185: + case 186: if (!stopOnFunctions) { continue; } - case 147: - case 146: - case 149: case 148: + case 147: case 150: + case 149: case 151: case 152: + case 153: return node; - case 145: - if (node.parent.kind === 144 && isClassElement(node.parent.parent)) { + case 146: + if (node.parent.kind === 145 && isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (isClassElement(node.parent)) { @@ -7720,36 +8887,36 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 184 || func.kind === 185) { + if (func.kind === 185 || func.kind === 186) { var prev = func; - var parent_2 = func.parent; - while (parent_2.kind === 183) { - prev = parent_2; - parent_2 = parent_2.parent; + var parent = func.parent; + while (parent.kind === 184) { + prev = parent; + parent = parent.parent; } - if (parent_2.kind === 179 && parent_2.expression === prev) { - return parent_2; + if (parent.kind === 180 && parent.expression === prev) { + return parent; } } } ts.getImmediatelyInvokedFunctionExpression = getImmediatelyInvokedFunctionExpression; function isSuperProperty(node) { var kind = node.kind; - return (kind === 177 || kind === 178) + return (kind === 178 || kind === 179) && node.expression.kind === 96; } ts.isSuperProperty = isSuperProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 157: - case 272: + case 158: + case 276: return node.typeName; - case 199: + case 200: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 70: - case 141: + case 142: return node; } return undefined; @@ -7757,10 +8924,12 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function isCallLikeExpression(node) { switch (node.kind) { - case 179: + case 250: + case 249: case 180: case 181: - case 145: + case 182: + case 146: return true; default: return false; @@ -7768,29 +8937,32 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function getInvokedExpression(node) { - if (node.kind === 181) { + if (node.kind === 182) { return node.tag; } + else if (isJsxOpeningLikeElement(node)) { + return node.tagName; + } return node.expression; } ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node) { switch (node.kind) { - case 226: + case 228: return true; - case 147: - return node.parent.kind === 226; - case 151: + case 148: + return node.parent.kind === 228; case 152: - case 149: + case 153: + case 150: return node.body !== undefined - && node.parent.kind === 226; - case 144: + && node.parent.kind === 228; + case 145: return node.parent.body !== undefined - && (node.parent.kind === 150 - || node.parent.kind === 149 - || node.parent.kind === 152) - && node.parent.parent.kind === 226; + && (node.parent.kind === 151 + || node.parent.kind === 150 + || node.parent.kind === 153) + && node.parent.parent.kind === 228; } return false; } @@ -7806,19 +8978,19 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node) { switch (node.kind) { - case 226: + case 228: return ts.forEach(node.members, nodeOrChildIsDecorated); - case 149: - case 152: + case 150: + case 153: return ts.forEach(node.parameters, nodeIsDecorated); } } ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 248 || - parent.kind === 247 || - parent.kind === 249) { + if (parent.kind === 250 || + parent.kind === 249 || + parent.kind === 251) { return parent.tagName === node; } return false; @@ -7832,95 +9004,96 @@ var ts; case 100: case 85: case 11: - case 175: case 176: case 177: case 178: case 179: case 180: case 181: - case 200: case 182: case 201: case 183: + case 202: case 184: - case 197: case 185: - case 188: + case 198: case 186: + case 189: case 187: - case 190: + case 188: case 191: case 192: case 193: - case 196: case 194: - case 12: - case 198: - case 246: - case 247: + case 197: case 195: - case 189: + case 12: + case 199: + case 248: + case 249: + case 196: + case 190: + case 203: return true; - case 141: - while (node.parent.kind === 141) { + case 142: + while (node.parent.kind === 142) { node = node.parent; } - return node.parent.kind === 160 || isJSXTagName(node); + return node.parent.kind === 161 || isJSXTagName(node); case 70: - if (node.parent.kind === 160 || isJSXTagName(node)) { + if (node.parent.kind === 161 || isJSXTagName(node)) { return true; } case 8: case 9: case 98: - var parent_3 = node.parent; - switch (parent_3.kind) { - case 223: - case 144: + var parent = node.parent; + switch (parent.kind) { + case 225: + case 145: + case 148: case 147: - case 146: + case 263: case 260: - case 257: - case 174: - return parent_3.initializer === node; - case 207: - case 208: + case 175: + return parent.initializer === node; case 209: case 210: - case 216: - case 217: - case 218: - case 253: - case 220: - case 218: - return parent_3.expression === node; case 211: - var forStatement = parent_3; - return (forStatement.initializer === node && forStatement.initializer.kind !== 224) || + case 212: + case 218: + case 219: + case 220: + case 256: + case 222: + case 220: + return parent.expression === node; + case 213: + var forStatement = parent; + return (forStatement.initializer === node && forStatement.initializer.kind !== 226) || forStatement.condition === node || forStatement.incrementor === node; - case 212: - case 213: - var forInStatement = parent_3; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 224) || + case 214: + case 215: + var forInStatement = parent; + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 226) || forInStatement.expression === node; - case 182: - case 200: - return node === parent_3.expression; - case 202: - return node === parent_3.expression; - case 142: - return node === parent_3.expression; - case 145: - case 252: - case 251: - case 259: + case 183: + case 201: + return node === parent.expression; + case 204: + return node === parent.expression; + case 143: + return node === parent.expression; + case 146: + case 255: + case 254: + case 262: return true; - case 199: - return parent_3.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent_3); + case 200: + return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); default: - if (isPartOfExpression(parent_3)) { + if (isPartOfExpression(parent)) { return true; } } @@ -7935,7 +9108,7 @@ var ts; } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 234 && node.moduleReference.kind === 245; + return node.kind === 236 && node.moduleReference.kind === 247; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -7944,7 +9117,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 234 && node.moduleReference.kind !== 245; + return node.kind === 236 && node.moduleReference.kind !== 247; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJavaScript(file) { @@ -7952,38 +9125,57 @@ var ts; } ts.isSourceFileJavaScript = isSourceFileJavaScript; function isInJavaScriptFile(node) { - return node && !!(node.flags & 2097152); + return node && !!(node.flags & 65536); } ts.isInJavaScriptFile = isInJavaScriptFile; - function isRequireCall(expression, checkArgumentIsStringLiteral) { - var isRequire = expression.kind === 179 && - expression.expression.kind === 70 && - expression.expression.text === "require" && - expression.arguments.length === 1; - return isRequire && (!checkArgumentIsStringLiteral || expression.arguments[0].kind === 9); + function isRequireCall(callExpression, checkArgumentIsStringLiteral) { + if (callExpression.kind !== 180) { + return false; + } + var _a = callExpression, expression = _a.expression, args = _a.arguments; + if (expression.kind !== 70 || expression.text !== "require") { + return false; + } + if (args.length !== 1) { + return false; + } + var arg = args[0]; + return !checkArgumentIsStringLiteral || arg.kind === 9 || arg.kind === 12; } ts.isRequireCall = isRequireCall; function isSingleOrDoubleQuote(charCode) { return charCode === 39 || charCode === 34; } ts.isSingleOrDoubleQuote = isSingleOrDoubleQuote; - function isDeclarationOfFunctionExpression(s) { - if (s.valueDeclaration && s.valueDeclaration.kind === 223) { + function isDeclarationOfFunctionOrClassExpression(s) { + if (s.valueDeclaration && s.valueDeclaration.kind === 225) { var declaration = s.valueDeclaration; - return declaration.initializer && declaration.initializer.kind === 184; + return declaration.initializer && (declaration.initializer.kind === 185 || declaration.initializer.kind === 198); } return false; } - ts.isDeclarationOfFunctionExpression = isDeclarationOfFunctionExpression; + ts.isDeclarationOfFunctionOrClassExpression = isDeclarationOfFunctionOrClassExpression; + function getRightMostAssignedExpression(node) { + while (isAssignmentExpression(node, true)) { + node = node.right; + } + return node; + } + ts.getRightMostAssignedExpression = getRightMostAssignedExpression; + function isExportsIdentifier(node) { + return isIdentifier(node) && node.text === "exports"; + } + ts.isExportsIdentifier = isExportsIdentifier; + function isModuleExportsPropertyAccessExpression(node) { + return isPropertyAccessExpression(node) && isIdentifier(node.expression) && node.expression.text === "module" && node.name.text === "exports"; + } + ts.isModuleExportsPropertyAccessExpression = isModuleExportsPropertyAccessExpression; function getSpecialPropertyAssignmentKind(expression) { if (!isInJavaScriptFile(expression)) { return 0; } - if (expression.kind !== 192) { - return 0; - } var expr = expression; - if (expr.operatorToken.kind !== 57 || expr.left.kind !== 177) { + if (expr.operatorToken.kind !== 57 || expr.left.kind !== 178) { return 0; } var lhs = expr.left; @@ -7995,11 +9187,14 @@ var ts; else if (lhsId.text === "module" && lhs.name.text === "exports") { return 2; } + else { + return 5; + } } else if (lhs.expression.kind === 98) { return 4; } - else if (lhs.expression.kind === 177) { + else if (lhs.expression.kind === 178) { var innerPropertyAccess = lhs.expression; if (innerPropertyAccess.expression.kind === 70) { var innerPropertyAccessIdentifier = innerPropertyAccess.expression; @@ -8015,35 +9210,35 @@ var ts; } ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind; function getExternalModuleName(node) { - if (node.kind === 235) { + if (node.kind === 237) { return node.moduleSpecifier; } - if (node.kind === 234) { + if (node.kind === 236) { var reference = node.moduleReference; - if (reference.kind === 245) { + if (reference.kind === 247) { return reference.expression; } } - if (node.kind === 241) { + if (node.kind === 243) { return node.moduleSpecifier; } - if (node.kind === 230 && node.name.kind === 9) { + if (node.kind === 232 && node.name.kind === 9) { return node.name; } } ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { - if (node.kind === 234) { + if (node.kind === 236) { return node; } var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 237) { + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 239) { return importClause.namedBindings; } } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 235 + return node.kind === 237 && node.importClause && !!node.importClause.name; } @@ -8051,13 +9246,13 @@ var ts; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 144: + case 145: + case 150: case 149: + case 261: + case 260: case 148: - case 258: - case 257: case 147: - case 146: return node.questionToken !== undefined; } } @@ -8065,28 +9260,36 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function isJSDocConstructSignature(node) { - return node.kind === 274 && + return node.kind === 278 && node.parameters.length > 0 && - node.parameters[0].type.kind === 276; + node.parameters[0].type.kind === 280; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function getCommentsFromJSDoc(node) { return ts.map(getJSDocs(node), function (doc) { return doc.comment; }); } ts.getCommentsFromJSDoc = getCommentsFromJSDoc; + function hasJSDocParameterTags(node) { + var parameterTags = getJSDocTags(node, 285); + return parameterTags && parameterTags.length > 0; + } + ts.hasJSDocParameterTags = hasJSDocParameterTags; function getJSDocTags(node, kind) { var docs = getJSDocs(node); if (docs) { var result = []; for (var _i = 0, docs_1 = docs; _i < docs_1.length; _i++) { var doc = docs_1[_i]; - if (doc.kind === 281) { + if (doc.kind === 285) { if (doc.kind === kind) { result.push(doc); } } else { - result.push.apply(result, ts.filter(doc.tags, function (tag) { return tag.kind === kind; })); + var tags = doc.tags; + if (tags) { + result.push.apply(result, ts.filter(tags, function (tag) { return tag.kind === kind; })); + } } } return result; @@ -8106,9 +9309,9 @@ var ts; var parent = node.parent; var isInitializerOfVariableDeclarationInStatement = isVariableLike(parent) && parent.initializer === node && - parent.parent.parent.kind === 205; + parent.parent.parent.kind === 207; var isVariableOfVariableDeclarationStatement = isVariableLike(node) && - parent.parent.kind === 205; + parent.parent.kind === 207; var variableStatementNode = isInitializerOfVariableDeclarationInStatement ? parent.parent.parent : isVariableOfVariableDeclarationStatement ? parent.parent : undefined; @@ -8116,19 +9319,19 @@ var ts; getJSDocsWorker(variableStatementNode); } var isSourceOfAssignmentExpressionStatement = parent && parent.parent && - parent.kind === 192 && + parent.kind === 193 && parent.operatorToken.kind === 57 && - parent.parent.kind === 207; + parent.parent.kind === 209; if (isSourceOfAssignmentExpressionStatement) { getJSDocsWorker(parent.parent); } - var isModuleDeclaration = node.kind === 230 && - parent && parent.kind === 230; - var isPropertyAssignmentExpression = parent && parent.kind === 257; + var isModuleDeclaration = node.kind === 232 && + parent && parent.kind === 232; + var isPropertyAssignmentExpression = parent && parent.kind === 260; if (isModuleDeclaration || isPropertyAssignmentExpression) { getJSDocsWorker(parent); } - if (node.kind === 144) { + if (node.kind === 145) { cache = ts.concatenate(cache, getJSDocParameterTags(node)); } if (isVariableLike(node) && node.initializer) { @@ -8137,22 +9340,23 @@ var ts; cache = ts.concatenate(cache, node.jsDoc); } } + ts.getJSDocs = getJSDocs; function getJSDocParameterTags(param) { if (!isParameter(param)) { return undefined; } var func = param.parent; - var tags = getJSDocTags(func, 281); + var tags = getJSDocTags(func, 285); if (!param.name) { var i = func.parameters.indexOf(param); - var paramTags = ts.filter(tags, function (tag) { return tag.kind === 281; }); + var paramTags = ts.filter(tags, function (tag) { return tag.kind === 285; }); if (paramTags && 0 <= i && i < paramTags.length) { return [paramTags[i]]; } } else if (param.name.kind === 70) { - var name_8 = param.name.text; - return ts.filter(tags, function (tag) { return tag.kind === 281 && tag.parameterName.text === name_8; }); + var name_1 = param.name.text; + return ts.filter(tags, function (tag) { return tag.kind === 285 && tag.parameterName.text === name_1; }); } else { return undefined; @@ -8160,8 +9364,8 @@ var ts; } ts.getJSDocParameterTags = getJSDocParameterTags; function getJSDocType(node) { - var tag = getFirstJSDocTag(node, 283); - if (!tag && node.kind === 144) { + var tag = getFirstJSDocTag(node, 287); + if (!tag && node.kind === 145) { var paramTags = getJSDocParameterTags(node); if (paramTags) { tag = ts.find(paramTags, function (tag) { return !!tag.typeExpression; }); @@ -8171,15 +9375,15 @@ var ts; } ts.getJSDocType = getJSDocType; function getJSDocAugmentsTag(node) { - return getFirstJSDocTag(node, 280); + return getFirstJSDocTag(node, 284); } ts.getJSDocAugmentsTag = getJSDocAugmentsTag; function getJSDocReturnTag(node) { - return getFirstJSDocTag(node, 282); + return getFirstJSDocTag(node, 286); } ts.getJSDocReturnTag = getJSDocReturnTag; function getJSDocTemplateTag(node) { - return getFirstJSDocTag(node, 284); + return getFirstJSDocTag(node, 288); } ts.getJSDocTemplateTag = getJSDocTemplateTag; function hasRestParameter(s) { @@ -8191,9 +9395,9 @@ var ts; } ts.hasDeclaredRestParameter = hasDeclaredRestParameter; function isRestParameter(node) { - if (node && (node.flags & 2097152)) { - if (node.type && node.type.kind === 275 || - ts.forEach(getJSDocParameterTags(node), function (t) { return t.typeExpression && t.typeExpression.type.kind === 275; })) { + if (node && (node.flags & 65536)) { + if (node.type && node.type.kind === 279 || + ts.forEach(getJSDocParameterTags(node), function (t) { return t.typeExpression && t.typeExpression.type.kind === 279; })) { return true; } } @@ -8204,32 +9408,43 @@ var ts; return node && node.dotDotDotToken !== undefined; } ts.isDeclaredRestParam = isDeclaredRestParam; + var AssignmentKind; + (function (AssignmentKind) { + AssignmentKind[AssignmentKind["None"] = 0] = "None"; + AssignmentKind[AssignmentKind["Definite"] = 1] = "Definite"; + AssignmentKind[AssignmentKind["Compound"] = 2] = "Compound"; + })(AssignmentKind = ts.AssignmentKind || (ts.AssignmentKind = {})); function getAssignmentTargetKind(node) { var parent = node.parent; while (true) { switch (parent.kind) { - case 192: + case 193: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 57 ? 1 : 2 : 0; - case 190: case 191: + case 192: var unaryOperator = parent.operator; return unaryOperator === 42 || unaryOperator === 43 ? 2 : 0; - case 212: - case 213: + case 214: + case 215: return parent.initializer === node ? 1 : 0; - case 183: - case 175: - case 196: + case 184: + case 176: + case 197: node = parent; break; - case 258: + case 261: if (parent.name !== node) { return 0; } - case 257: + node = parent.parent; + break; + case 260: + if (parent.name === node) { + return 0; + } node = parent.parent; break; default: @@ -8243,6 +9458,17 @@ var ts; return getAssignmentTargetKind(node) !== 0; } ts.isAssignmentTarget = isAssignmentTarget; + function isDeleteTarget(node) { + if (node.kind !== 178 && node.kind !== 179) { + return false; + } + node = node.parent; + while (node && node.kind === 184) { + node = node.parent; + } + return node && node.kind === 187; + } + ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { while (node) { if (node === ancestor) @@ -8254,7 +9480,7 @@ var ts; ts.isNodeDescendantOf = isNodeDescendantOf; function isInAmbientContext(node) { while (node) { - if (hasModifier(node, 2) || (node.kind === 261 && node.isDeclarationFile)) { + if (hasModifier(node, 2) || (node.kind === 264 && node.isDeclarationFile)) { return true; } node = node.parent; @@ -8267,7 +9493,7 @@ var ts; return false; } var parent = name.parent; - if (parent.kind === 239 || parent.kind === 243) { + if (parent.kind === 241 || parent.kind === 245) { if (parent.propertyName) { return true; } @@ -8280,48 +9506,48 @@ var ts; ts.isDeclarationName = isDeclarationName; function isLiteralComputedPropertyDeclarationName(node) { return (node.kind === 9 || node.kind === 8) && - node.parent.kind === 142 && + node.parent.kind === 143 && isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 147: - case 146: - case 149: case 148: - case 151: + case 147: + case 150: + case 149: case 152: + case 153: + case 263: case 260: - case 257: - case 177: + case 178: return parent.name === node; - case 141: + case 142: if (parent.right === node) { - while (parent.kind === 141) { + while (parent.kind === 142) { parent = parent.parent; } - return parent.kind === 160; + return parent.kind === 161; } return false; - case 174: - case 239: + case 175: + case 241: return parent.propertyName === node; - case 243: + case 245: return true; } return false; } ts.isIdentifierName = isIdentifierName; function isAliasSymbolDeclaration(node) { - return node.kind === 234 || - node.kind === 233 || - node.kind === 236 && !!node.name || - node.kind === 237 || + return node.kind === 236 || + node.kind === 235 || + node.kind === 238 && !!node.name || node.kind === 239 || - node.kind === 243 || - node.kind === 240 && exportAssignmentIsAlias(node); + node.kind === 241 || + node.kind === 245 || + node.kind === 242 && exportAssignmentIsAlias(node); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function exportAssignmentIsAlias(node) { @@ -8407,17 +9633,61 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 71 <= token && token <= 140; + return 71 <= token && token <= 141; } ts.isKeyword = isKeyword; function isTrivia(token) { return 2 <= token && token <= 7; } ts.isTrivia = isTrivia; - function isAsyncFunctionLike(node) { - return isFunctionLike(node) && hasModifier(node, 256) && !isAccessor(node); + var FunctionFlags; + (function (FunctionFlags) { + FunctionFlags[FunctionFlags["Normal"] = 0] = "Normal"; + FunctionFlags[FunctionFlags["Generator"] = 1] = "Generator"; + FunctionFlags[FunctionFlags["Async"] = 2] = "Async"; + FunctionFlags[FunctionFlags["AsyncOrAsyncGenerator"] = 3] = "AsyncOrAsyncGenerator"; + FunctionFlags[FunctionFlags["Invalid"] = 4] = "Invalid"; + FunctionFlags[FunctionFlags["InvalidAsyncOrAsyncGenerator"] = 7] = "InvalidAsyncOrAsyncGenerator"; + FunctionFlags[FunctionFlags["InvalidGenerator"] = 5] = "InvalidGenerator"; + })(FunctionFlags = ts.FunctionFlags || (ts.FunctionFlags = {})); + function getFunctionFlags(node) { + var flags = 0; + switch (node.kind) { + case 227: + case 185: + case 150: + if (node.asteriskToken) { + flags |= 1; + } + case 186: + if (hasModifier(node, 256)) { + flags |= 2; + } + break; + } + if (!node.body) { + flags |= 4; + } + return flags; } - ts.isAsyncFunctionLike = isAsyncFunctionLike; + ts.getFunctionFlags = getFunctionFlags; + function isAsyncFunction(node) { + switch (node.kind) { + case 227: + case 185: + case 186: + case 150: + return node.body !== undefined + && node.asteriskToken === undefined + && hasModifier(node, 256); + } + return false; + } + ts.isAsyncFunction = isAsyncFunction; + function isNumericLiteral(node) { + return node.kind === 8; + } + ts.isNumericLiteral = isNumericLiteral; function isStringOrNumericLiteral(node) { var kind = node.kind; return kind === 9 @@ -8429,7 +9699,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - return name.kind === 142 && + return name.kind === 143 && !isStringOrNumericLiteral(name.expression) && !isWellKnownSymbolSyntactically(name.expression); } @@ -8439,10 +9709,10 @@ var ts; } ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically; function getPropertyNameForPropertyNameNode(name) { - if (name.kind === 70 || name.kind === 9 || name.kind === 8 || name.kind === 144) { + if (name.kind === 70 || name.kind === 9 || name.kind === 8 || name.kind === 145) { return name.text; } - if (name.kind === 142) { + if (name.kind === 143) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { var rightHandSideName = nameExpression.name.text; @@ -8487,11 +9757,11 @@ var ts; ts.isModifierKind = isModifierKind; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 144; + return root.kind === 145; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 174) { + while (node.kind === 175) { node = node.parent.parent; } return node; @@ -8499,15 +9769,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 150 - || kind === 184 - || kind === 225 + return kind === 151 || kind === 185 - || kind === 149 - || kind === 151 + || kind === 227 + || kind === 186 + || kind === 150 || kind === 152 - || kind === 230 - || kind === 261; + || kind === 153 + || kind === 232 + || kind === 264; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(node) { @@ -8515,66 +9785,49 @@ var ts; || ts.positionIsSynthesized(node.end); } ts.nodeIsSynthesized = nodeIsSynthesized; - function getOriginalNode(node, nodeTest) { - if (node) { - while (node.original !== undefined) { - node = node.original; - } + function getOriginalSourceFileOrBundle(sourceFileOrBundle) { + if (sourceFileOrBundle.kind === 265) { + return ts.updateBundle(sourceFileOrBundle, ts.sameMap(sourceFileOrBundle.sourceFiles, getOriginalSourceFile)); } - return !nodeTest || nodeTest(node) ? node : undefined; + return getOriginalSourceFile(sourceFileOrBundle); } - ts.getOriginalNode = getOriginalNode; - function isParseTreeNode(node) { - return (node.flags & 8) === 0; + ts.getOriginalSourceFileOrBundle = getOriginalSourceFileOrBundle; + function getOriginalSourceFile(sourceFile) { + return ts.getParseTreeNode(sourceFile, isSourceFile) || sourceFile; } - ts.isParseTreeNode = isParseTreeNode; - function getParseTreeNode(node, nodeTest) { - if (isParseTreeNode(node)) { - return node; - } - node = getOriginalNode(node); - if (isParseTreeNode(node) && (!nodeTest || nodeTest(node))) { - return node; - } - return undefined; - } - ts.getParseTreeNode = getParseTreeNode; function getOriginalSourceFiles(sourceFiles) { - var originalSourceFiles = []; - for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { - var sourceFile = sourceFiles_1[_i]; - var originalSourceFile = getParseTreeNode(sourceFile, isSourceFile); - if (originalSourceFile) { - originalSourceFiles.push(originalSourceFile); - } - } - return originalSourceFiles; + return ts.sameMap(sourceFiles, getOriginalSourceFile); } ts.getOriginalSourceFiles = getOriginalSourceFiles; function getOriginalNodeId(node) { - node = getOriginalNode(node); + node = ts.getOriginalNode(node); return node ? ts.getNodeId(node) : 0; } ts.getOriginalNodeId = getOriginalNodeId; + var Associativity; + (function (Associativity) { + Associativity[Associativity["Left"] = 0] = "Left"; + Associativity[Associativity["Right"] = 1] = "Right"; + })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 180 && expression.arguments !== undefined; + var hasArguments = expression.kind === 181 && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 180: + case 181: return hasArguments ? 0 : 1; - case 190: - case 187: + case 191: case 188: - case 186: case 189: - case 193: - case 195: + case 187: + case 190: + case 194: + case 196: return 1; - case 192: + case 193: switch (operator) { case 39: case 57: @@ -8598,15 +9851,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 180 && expression.arguments !== undefined; + var hasArguments = expression.kind === 181 && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 192) { + if (expression.kind === 193) { return expression.operatorToken.kind; } - else if (expression.kind === 190 || expression.kind === 191) { + else if (expression.kind === 191 || expression.kind === 192) { return expression.operator; } else { @@ -8624,37 +9877,36 @@ var ts; case 85: case 8: case 9: - case 175: case 176: - case 184: + case 177: case 185: - case 197: - case 246: - case 247: + case 186: + case 198: + case 248: + case 249: case 11: case 12: - case 194: - case 183: - case 198: - case 297: + case 195: + case 184: + case 199: return 19; - case 181: - case 177: + case 182: case 178: - return 18; - case 180: - return hasArguments ? 18 : 17; case 179: + return 18; + case 181: + return hasArguments ? 18 : 17; + case 180: return 17; - case 191: - return 16; - case 190: - case 187: - case 188: - case 186: - case 189: - return 15; case 192: + return 16; + case 191: + case 188: + case 189: + case 187: + case 190: + return 15; + case 193: switch (operatorKind) { case 50: case 51: @@ -8712,11 +9964,11 @@ var ts; default: return -1; } - case 193: + case 194: return 4; - case 195: - return 2; case 196: + return 2; + case 197: return 1; default: return -1; @@ -8739,21 +9991,15 @@ var ts; return modificationCount; } function reattachFileDiagnostics(newFile) { - if (!ts.hasProperty(fileDiagnostics, newFile.fileName)) { - return; - } - for (var _i = 0, _a = fileDiagnostics[newFile.fileName]; _i < _a.length; _i++) { - var diagnostic = _a[_i]; - diagnostic.file = newFile; - } + ts.forEach(fileDiagnostics.get(newFile.fileName), function (diagnostic) { return diagnostic.file = newFile; }); } function add(diagnostic) { var diagnostics; if (diagnostic.file) { - diagnostics = fileDiagnostics[diagnostic.file.fileName]; + diagnostics = fileDiagnostics.get(diagnostic.file.fileName); if (!diagnostics) { diagnostics = []; - fileDiagnostics[diagnostic.file.fileName] = diagnostics; + fileDiagnostics.set(diagnostic.file.fileName, diagnostics); } } else { @@ -8770,16 +10016,16 @@ var ts; function getDiagnostics(fileName) { sortAndDeduplicate(); if (fileName) { - return fileDiagnostics[fileName] || []; + return fileDiagnostics.get(fileName) || []; } var allDiagnostics = []; function pushDiagnostic(d) { allDiagnostics.push(d); } ts.forEach(nonFileDiagnostics, pushDiagnostic); - for (var key in fileDiagnostics) { - ts.forEach(fileDiagnostics[key], pushDiagnostic); - } + fileDiagnostics.forEach(function (diagnostics) { + ts.forEach(diagnostics, pushDiagnostic); + }); return ts.sortAndDeduplicateDiagnostics(allDiagnostics); } function sortAndDeduplicate() { @@ -8788,14 +10034,14 @@ var ts; } diagnosticsModified = false; nonFileDiagnostics = ts.sortAndDeduplicateDiagnostics(nonFileDiagnostics); - for (var key in fileDiagnostics) { - fileDiagnostics[key] = ts.sortAndDeduplicateDiagnostics(fileDiagnostics[key]); - } + fileDiagnostics.forEach(function (diagnostics, key) { + fileDiagnostics.set(key, ts.sortAndDeduplicateDiagnostics(diagnostics)); + }); } } ts.createDiagnosticCollection = createDiagnosticCollection; var escapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; - var escapedCharsMap = ts.createMap({ + var escapedCharsMap = ts.createMapFromTemplate({ "\0": "\\0", "\t": "\\t", "\v": "\\v", @@ -8810,13 +10056,12 @@ var ts; "\u0085": "\\u0085" }); function escapeString(s) { - s = escapedCharsRegExp.test(s) ? s.replace(escapedCharsRegExp, getReplacement) : s; - return s; - function getReplacement(c) { - return escapedCharsMap[c] || get16BitUnicodeEscapeSequence(c.charCodeAt(0)); - } + return s.replace(escapedCharsRegExp, getReplacement); } ts.escapeString = escapeString; + function getReplacement(c) { + return escapedCharsMap.get(c) || get16BitUnicodeEscapeSequence(c.charCodeAt(0)); + } function isIntrinsicJsxName(name) { var ch = name.substr(0, 1); return ch.toLowerCase() === ch; @@ -8959,129 +10204,62 @@ var ts; ts.getDeclarationEmitOutputFilePath = getDeclarationEmitOutputFilePath; function getSourceFilesToEmit(host, targetSourceFile) { var options = host.getCompilerOptions(); + var isSourceFileFromExternalLibrary = function (file) { return host.isSourceFileFromExternalLibrary(file); }; if (options.outFile || options.out) { var moduleKind = ts.getEmitModuleKind(options); - var moduleEmitEnabled = moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System; - var sourceFiles = getAllEmittableSourceFiles(); - return ts.filter(sourceFiles, moduleEmitEnabled ? isNonDeclarationFile : isBundleEmitNonExternalModule); + var moduleEmitEnabled_1 = moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System; + return ts.filter(host.getSourceFiles(), function (sourceFile) { + return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) && sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary); + }); } else { - var sourceFiles = targetSourceFile === undefined ? getAllEmittableSourceFiles() : [targetSourceFile]; - return filterSourceFilesInDirectory(sourceFiles, function (file) { return host.isSourceFileFromExternalLibrary(file); }); - } - function getAllEmittableSourceFiles() { - return options.noEmitForJsFiles ? ts.filter(host.getSourceFiles(), function (sourceFile) { return !isSourceFileJavaScript(sourceFile); }) : host.getSourceFiles(); + var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile]; + return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary); }); } } ts.getSourceFilesToEmit = getSourceFilesToEmit; - function filterSourceFilesInDirectory(sourceFiles, isSourceFileFromExternalLibrary) { - return ts.filter(sourceFiles, function (file) { return shouldEmitInDirectory(file, isSourceFileFromExternalLibrary); }); + function sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary) { + return !(options.noEmitForJsFiles && isSourceFileJavaScript(sourceFile)) && !isDeclarationFile(sourceFile) && !isSourceFileFromExternalLibrary(sourceFile); } - ts.filterSourceFilesInDirectory = filterSourceFilesInDirectory; - function isNonDeclarationFile(sourceFile) { - return !isDeclarationFile(sourceFile); - } - function shouldEmitInDirectory(sourceFile, isSourceFileFromExternalLibrary) { - return isNonDeclarationFile(sourceFile) && !isSourceFileFromExternalLibrary(sourceFile); - } - function isBundleEmitNonExternalModule(sourceFile) { - return isNonDeclarationFile(sourceFile) && !ts.isExternalModule(sourceFile); - } - function forEachTransformedEmitFile(host, sourceFiles, action, emitOnlyDtsFiles) { + ts.sourceFileMayBeEmitted = sourceFileMayBeEmitted; + function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, emitOnlyDtsFiles) { + var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile); var options = host.getCompilerOptions(); if (options.outFile || options.out) { - onBundledEmit(sourceFiles); - } - else { - for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) { - var sourceFile = sourceFiles_2[_i]; - if (!isDeclarationFile(sourceFile) && !host.isSourceFileFromExternalLibrary(sourceFile)) { - onSingleFileEmit(host, sourceFile); - } - } - } - function onSingleFileEmit(host, sourceFile) { - var extension = ".js"; - if (options.jsx === 1) { - if (isSourceFileJavaScript(sourceFile)) { - if (ts.fileExtensionIs(sourceFile.fileName, ".jsx")) { - extension = ".jsx"; - } - } - else if (sourceFile.languageVariant === 1) { - extension = ".jsx"; - } - } - var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, extension); - var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); - var declarationFilePath = !isSourceFileJavaScript(sourceFile) && (options.declaration || emitOnlyDtsFiles) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; - action(jsFilePath, sourceMapFilePath, declarationFilePath, [sourceFile], false); - } - function onBundledEmit(sourceFiles) { if (sourceFiles.length) { var jsFilePath = options.outFile || options.out; var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); - var declarationFilePath = options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : undefined; - action(jsFilePath, sourceMapFilePath, declarationFilePath, sourceFiles, true); + var declarationFilePath = options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : ""; + action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, ts.createBundle(sourceFiles), emitOnlyDtsFiles); + } + } + else { + for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { + var sourceFile = sourceFiles_1[_i]; + var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, getOutputExtension(sourceFile, options)); + var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); + var declarationFilePath = !isSourceFileJavaScript(sourceFile) && (emitOnlyDtsFiles || options.declaration) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; + action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, sourceFile, emitOnlyDtsFiles); } } } - ts.forEachTransformedEmitFile = forEachTransformedEmitFile; + ts.forEachEmittedFile = forEachEmittedFile; function getSourceMapFilePath(jsFilePath, options) { return options.sourceMap ? jsFilePath + ".map" : undefined; } - function forEachExpectedEmitFile(host, action, targetSourceFile, emitOnlyDtsFiles) { - var options = host.getCompilerOptions(); - if (options.outFile || options.out) { - onBundledEmit(host); - } - else { - var sourceFiles = targetSourceFile === undefined ? getSourceFilesToEmit(host) : [targetSourceFile]; - for (var _i = 0, sourceFiles_3 = sourceFiles; _i < sourceFiles_3.length; _i++) { - var sourceFile = sourceFiles_3[_i]; - if (shouldEmitInDirectory(sourceFile, function (file) { return host.isSourceFileFromExternalLibrary(file); })) { - onSingleFileEmit(host, sourceFile); + function getOutputExtension(sourceFile, options) { + if (options.jsx === 1) { + if (isSourceFileJavaScript(sourceFile)) { + if (ts.fileExtensionIs(sourceFile.fileName, ".jsx")) { + return ".jsx"; } } - } - function onSingleFileEmit(host, sourceFile) { - var extension = ".js"; - if (options.jsx === 1) { - if (isSourceFileJavaScript(sourceFile)) { - if (ts.fileExtensionIs(sourceFile.fileName, ".jsx")) { - extension = ".jsx"; - } - } - else if (sourceFile.languageVariant === 1) { - extension = ".jsx"; - } - } - var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, extension); - var declarationFilePath = !isSourceFileJavaScript(sourceFile) && (emitOnlyDtsFiles || options.declaration) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; - var emitFileNames = { - jsFilePath: jsFilePath, - sourceMapFilePath: getSourceMapFilePath(jsFilePath, options), - declarationFilePath: declarationFilePath - }; - action(emitFileNames, [sourceFile], false, emitOnlyDtsFiles); - } - function onBundledEmit(host) { - var bundledSources = ts.filter(getSourceFilesToEmit(host), function (sourceFile) { return !isDeclarationFile(sourceFile) && - !host.isSourceFileFromExternalLibrary(sourceFile) && - (!ts.isExternalModule(sourceFile) || - !!ts.getEmitModuleKind(options)); }); - if (bundledSources.length) { - var jsFilePath = options.outFile || options.out; - var emitFileNames = { - jsFilePath: jsFilePath, - sourceMapFilePath: getSourceMapFilePath(jsFilePath, options), - declarationFilePath: options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : undefined - }; - action(emitFileNames, bundledSources, true, emitOnlyDtsFiles); + else if (sourceFile.languageVariant === 1) { + return ".jsx"; } } + return ".js"; } - ts.forEachExpectedEmitFile = forEachExpectedEmitFile; function getSourceFilePathInNewDir(sourceFile, host, newDirPath) { var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory()); var commonSourceDirectory = host.getCommonSourceDirectory(); @@ -9106,7 +10284,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 150 && nodeIsPresent(member.body)) { + if (member.kind === 151 && nodeIsPresent(member.body)) { return member; } }); @@ -9147,10 +10325,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 151) { + if (accessor.kind === 152) { getAccessor = accessor; } - else if (accessor.kind === 152) { + else if (accessor.kind === 153) { setAccessor = accessor; } else { @@ -9159,7 +10337,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 151 || member.kind === 152) + if ((member.kind === 152 || member.kind === 153) && hasModifier(member, 32) === hasModifier(accessor, 32)) { var memberName = getPropertyNameForPropertyNameNode(member.name); var accessorName = getPropertyNameForPropertyNameNode(accessor.name); @@ -9170,10 +10348,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 151 && !getAccessor) { + if (member.kind === 152 && !getAccessor) { getAccessor = member; } - if (member.kind === 152 && !setAccessor) { + if (member.kind === 153 && !setAccessor) { setAccessor = member; } } @@ -9391,7 +10569,7 @@ var ts; } ts.isAssignmentOperator = isAssignmentOperator; function tryGetClassExtendingExpressionWithTypeArguments(node) { - if (node.kind === 199 && + if (node.kind === 200 && node.parent.token === 84 && isClassLike(node.parent.parent)) { return node.parent.parent; @@ -9409,8 +10587,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, true)) { var kind = node.left.kind; - return kind === 176 - || kind === 175; + return kind === 177 + || kind === 176; } return false; } @@ -9434,31 +10612,42 @@ var ts; return tryGetClassExtendingExpressionWithTypeArguments(node) !== undefined; } ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause; + function isExpressionWithTypeArgumentsInClassImplementsClause(node) { + return node.kind === 200 + && isEntityNameExpression(node.expression) + && node.parent + && node.parent.token === 107 + && node.parent.parent + && isClassLike(node.parent.parent); + } + ts.isExpressionWithTypeArgumentsInClassImplementsClause = isExpressionWithTypeArgumentsInClassImplementsClause; function isEntityNameExpression(node) { return node.kind === 70 || - node.kind === 177 && isEntityNameExpression(node.expression); + node.kind === 178 && isEntityNameExpression(node.expression); } ts.isEntityNameExpression = isEntityNameExpression; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 141 && node.parent.right === node) || - (node.parent.kind === 177 && node.parent.name === node); + return (node.parent.kind === 142 && node.parent.right === node) || + (node.parent.kind === 178 && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; - function isEmptyObjectLiteralOrArrayLiteral(expression) { - var kind = expression.kind; - if (kind === 176) { - return expression.properties.length === 0; - } - if (kind === 175) { - return expression.elements.length === 0; - } - return false; + function isEmptyObjectLiteral(expression) { + return expression.kind === 177 && + expression.properties.length === 0; } - ts.isEmptyObjectLiteralOrArrayLiteral = isEmptyObjectLiteralOrArrayLiteral; + ts.isEmptyObjectLiteral = isEmptyObjectLiteral; + function isEmptyArrayLiteral(expression) { + return expression.kind === 176 && + expression.elements.length === 0; + } + ts.isEmptyArrayLiteral = isEmptyArrayLiteral; function getLocalSymbolForExportDefault(symbol) { - return symbol && symbol.valueDeclaration && hasModifier(symbol.valueDeclaration, 512) ? symbol.valueDeclaration.localSymbol : undefined; + return isExportDefaultSymbol(symbol) ? symbol.valueDeclaration.localSymbol : undefined; } ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; + function isExportDefaultSymbol(symbol) { + return symbol && symbol.valueDeclaration && hasModifier(symbol.valueDeclaration, 512); + } function tryExtractTypeScriptExtension(fileName) { return ts.find(ts.supportedTypescriptExtensionsForExtractExtension, function (extension) { return ts.fileExtensionIs(fileName, extension); }); } @@ -9492,39 +10681,6 @@ var ts; } return output; } - ts.stringify = typeof JSON !== "undefined" && JSON.stringify - ? JSON.stringify - : stringifyFallback; - function stringifyFallback(value) { - return value === undefined ? undefined : stringifyValue(value); - } - function stringifyValue(value) { - return typeof value === "string" ? "\"" + escapeString(value) + "\"" - : typeof value === "number" ? isFinite(value) ? String(value) : "null" - : typeof value === "boolean" ? value ? "true" : "false" - : typeof value === "object" && value ? ts.isArray(value) ? cycleCheck(stringifyArray, value) : cycleCheck(stringifyObject, value) - : "null"; - } - function cycleCheck(cb, value) { - ts.Debug.assert(!value.hasOwnProperty("__cycle"), "Converting circular structure to JSON"); - value.__cycle = true; - var result = cb(value); - delete value.__cycle; - return result; - } - function stringifyArray(value) { - return "[" + ts.reduceLeft(value, stringifyElement, "") + "]"; - } - function stringifyElement(memo, value) { - return (memo ? memo + "," : memo) + stringifyValue(value); - } - function stringifyObject(value) { - return "{" + ts.reduceOwnProperties(value, stringifyProperty, "") + "}"; - } - function stringifyProperty(memo, value, key) { - return value === undefined || typeof value === "function" || key === "__cycle" ? memo - : (memo ? memo + "," : memo) + ("\"" + escapeString(key) + "\":" + stringifyValue(value)); - } var base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; function convertToBase64(input) { var result = ""; @@ -9583,39 +10739,39 @@ var ts; || kind === 94) { return true; } - else if (kind === 177) { + else if (kind === 178) { return isSimpleExpressionWorker(node.expression, depth + 1); } - else if (kind === 178) { + else if (kind === 179) { return isSimpleExpressionWorker(node.expression, depth + 1) && isSimpleExpressionWorker(node.argumentExpression, depth + 1); } - else if (kind === 190 - || kind === 191) { + else if (kind === 191 + || kind === 192) { return isSimpleExpressionWorker(node.operand, depth + 1); } - else if (kind === 192) { + else if (kind === 193) { return node.operatorToken.kind !== 39 && isSimpleExpressionWorker(node.left, depth + 1) && isSimpleExpressionWorker(node.right, depth + 1); } - else if (kind === 193) { + else if (kind === 194) { return isSimpleExpressionWorker(node.condition, depth + 1) && isSimpleExpressionWorker(node.whenTrue, depth + 1) && isSimpleExpressionWorker(node.whenFalse, depth + 1); } - else if (kind === 188 - || kind === 187 - || kind === 186) { + else if (kind === 189 + || kind === 188 + || kind === 187) { return isSimpleExpressionWorker(node.expression, depth + 1); } - else if (kind === 175) { + else if (kind === 176) { return node.elements.length === 0; } - else if (kind === 176) { + else if (kind === 177) { return node.properties.length === 0; } - else if (kind === 179) { + else if (kind === 180) { if (!isSimpleExpressionWorker(node.expression, depth + 1)) { return false; } @@ -9630,16 +10786,19 @@ var ts; } return false; } - var syntaxKindCache = ts.createMap(); + var syntaxKindCache = []; function formatSyntaxKind(kind) { var syntaxKindEnum = ts.SyntaxKind; if (syntaxKindEnum) { - if (syntaxKindCache[kind]) { - return syntaxKindCache[kind]; + var cached = syntaxKindCache[kind]; + if (cached !== undefined) { + return cached; } - for (var name_9 in syntaxKindEnum) { - if (syntaxKindEnum[name_9] === kind) { - return syntaxKindCache[kind] = kind.toString() + " (" + name_9 + ")"; + for (var name in syntaxKindEnum) { + if (syntaxKindEnum[name] === kind) { + var result = kind + " (" + name + ")"; + syntaxKindCache[kind] = result; + return result; } } } @@ -9648,6 +10807,14 @@ var ts; } } ts.formatSyntaxKind = formatSyntaxKind; + function getRangePos(range) { + return range ? range.pos : -1; + } + ts.getRangePos = getRangePos; + function getRangeEnd(range) { + return range ? range.end : -1; + } + ts.getRangeEnd = getRangeEnd; function movePos(pos, value) { return ts.positionIsSynthesized(pos) ? -1 : pos + value; } @@ -9722,11 +10889,11 @@ var ts; } ts.getStartPositionOfRange = getStartPositionOfRange; function isDeclarationNameOfEnumOrNamespace(node) { - var parseNode = getParseTreeNode(node); + var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 229: - case 230: + case 231: + case 232: return parseNode === parseNode.parent.name; } } @@ -9744,7 +10911,7 @@ var ts; if (node.symbol) { for (var _i = 0, _a = node.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 226 && declaration !== node) { + if (declaration.kind === 228 && declaration !== node) { return true; } } @@ -9795,6 +10962,10 @@ var ts; return node.kind === 70; } ts.isIdentifier = isIdentifier; + function isVoidExpression(node) { + return node.kind === 189; + } + ts.isVoidExpression = isVoidExpression; function isGeneratedIdentifier(node) { return isIdentifier(node) && node.autoGenerateKind > 0; } @@ -9804,16 +10975,16 @@ var ts; } ts.isModifier = isModifier; function isQualifiedName(node) { - return node.kind === 141; + return node.kind === 142; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 142; + return node.kind === 143; } ts.isComputedPropertyName = isComputedPropertyName; function isEntityName(node) { var kind = node.kind; - return kind === 141 + return kind === 142 || kind === 70; } ts.isEntityName = isEntityName; @@ -9822,7 +10993,7 @@ var ts; return kind === 70 || kind === 9 || kind === 8 - || kind === 142; + || kind === 143; } ts.isPropertyName = isPropertyName; function isModuleName(node) { @@ -9834,101 +11005,105 @@ var ts; function isBindingName(node) { var kind = node.kind; return kind === 70 - || kind === 172 - || kind === 173; + || kind === 173 + || kind === 174; } ts.isBindingName = isBindingName; function isTypeParameter(node) { - return node.kind === 143; + return node.kind === 144; } ts.isTypeParameter = isTypeParameter; function isParameter(node) { - return node.kind === 144; + return node.kind === 145; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 145; + return node.kind === 146; } ts.isDecorator = isDecorator; function isMethodDeclaration(node) { - return node.kind === 149; + return node.kind === 150; } ts.isMethodDeclaration = isMethodDeclaration; function isClassElement(node) { var kind = node.kind; - return kind === 150 - || kind === 147 - || kind === 149 - || kind === 151 + return kind === 151 + || kind === 148 + || kind === 150 || kind === 152 - || kind === 155 - || kind === 203; + || kind === 153 + || kind === 156 + || kind === 205; } ts.isClassElement = isClassElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 257 - || kind === 258 - || kind === 259 - || kind === 149 - || kind === 151 + return kind === 260 + || kind === 261 + || kind === 262 + || kind === 150 || kind === 152 - || kind === 244; + || kind === 153 + || kind === 246; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; function isTypeNodeKind(kind) { - return (kind >= 156 && kind <= 171) + return (kind >= 157 && kind <= 172) || kind === 118 || kind === 132 + || kind === 133 || kind === 121 - || kind === 134 || kind === 135 + || kind === 136 + || kind === 98 || kind === 104 + || kind === 138 + || kind === 94 || kind === 129 - || kind === 199; + || kind === 200; } function isTypeNode(node) { return isTypeNodeKind(node.kind); } ts.isTypeNode = isTypeNode; function isArrayBindingPattern(node) { - return node.kind === 173; + return node.kind === 174; } ts.isArrayBindingPattern = isArrayBindingPattern; function isObjectBindingPattern(node) { - return node.kind === 172; + return node.kind === 173; } ts.isObjectBindingPattern = isObjectBindingPattern; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 173 - || kind === 172; + return kind === 174 + || kind === 173; } return false; } ts.isBindingPattern = isBindingPattern; function isAssignmentPattern(node) { var kind = node.kind; - return kind === 175 - || kind === 176; + return kind === 176 + || kind === 177; } ts.isAssignmentPattern = isAssignmentPattern; function isBindingElement(node) { - return node.kind === 174; + return node.kind === 175; } ts.isBindingElement = isBindingElement; function isArrayBindingElement(node) { var kind = node.kind; - return kind === 174 - || kind === 198; + return kind === 175 + || kind === 199; } ts.isArrayBindingElement = isArrayBindingElement; function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 223: - case 144: - case 174: + case 225: + case 145: + case 175: return true; } return false; @@ -9941,8 +11116,8 @@ var ts; ts.isBindingOrAssignmentPattern = isBindingOrAssignmentPattern; function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 172: - case 176: + case 173: + case 177: return true; } return false; @@ -9950,94 +11125,100 @@ var ts; ts.isObjectBindingOrAssignmentPattern = isObjectBindingOrAssignmentPattern; function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 173: - case 175: + case 174: + case 176: return true; } return false; } ts.isArrayBindingOrAssignmentPattern = isArrayBindingOrAssignmentPattern; function isArrayLiteralExpression(node) { - return node.kind === 175; + return node.kind === 176; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 176; + return node.kind === 177; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 177; + return node.kind === 178; } ts.isPropertyAccessExpression = isPropertyAccessExpression; + function isPropertyAccessOrQualifiedName(node) { + var kind = node.kind; + return kind === 178 + || kind === 142; + } + ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isElementAccessExpression(node) { - return node.kind === 178; + return node.kind === 179; } ts.isElementAccessExpression = isElementAccessExpression; function isBinaryExpression(node) { - return node.kind === 192; + return node.kind === 193; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 193; + return node.kind === 194; } ts.isConditionalExpression = isConditionalExpression; function isCallExpression(node) { - return node.kind === 179; + return node.kind === 180; } ts.isCallExpression = isCallExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 194 + return kind === 195 || kind === 12; } ts.isTemplateLiteral = isTemplateLiteral; function isSpreadExpression(node) { - return node.kind === 196; + return node.kind === 197; } ts.isSpreadExpression = isSpreadExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 199; + return node.kind === 200; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isLeftHandSideExpressionKind(kind) { - return kind === 177 - || kind === 178 - || kind === 180 + return kind === 178 || kind === 179 - || kind === 246 - || kind === 247 || kind === 181 - || kind === 175 - || kind === 183 + || kind === 180 + || kind === 248 + || kind === 249 + || kind === 182 || kind === 176 - || kind === 197 || kind === 184 + || kind === 177 + || kind === 198 + || kind === 185 || kind === 70 || kind === 11 || kind === 8 || kind === 9 || kind === 12 - || kind === 194 + || kind === 195 || kind === 85 || kind === 94 || kind === 98 || kind === 100 || kind === 96 - || kind === 201 - || kind === 297; + || kind === 202 + || kind === 203; } function isLeftHandSideExpression(node) { return isLeftHandSideExpressionKind(ts.skipPartiallyEmittedExpressions(node).kind); } ts.isLeftHandSideExpression = isLeftHandSideExpression; function isUnaryExpressionKind(kind) { - return kind === 190 - || kind === 191 - || kind === 186 + return kind === 191 + || kind === 192 || kind === 187 || kind === 188 || kind === 189 - || kind === 182 + || kind === 190 + || kind === 183 || isLeftHandSideExpressionKind(kind); } function isUnaryExpression(node) { @@ -10045,14 +11226,13 @@ var ts; } ts.isUnaryExpression = isUnaryExpression; function isExpressionKind(kind) { - return kind === 193 - || kind === 195 - || kind === 185 - || kind === 192 + return kind === 194 || kind === 196 - || kind === 200 - || kind === 198 - || kind === 297 + || kind === 186 + || kind === 193 + || kind === 197 + || kind === 201 + || kind === 199 || isUnaryExpressionKind(kind); } function isExpression(node) { @@ -10061,16 +11241,16 @@ var ts; ts.isExpression = isExpression; function isAssertionExpression(node) { var kind = node.kind; - return kind === 182 - || kind === 200; + return kind === 183 + || kind === 201; } ts.isAssertionExpression = isAssertionExpression; function isPartiallyEmittedExpression(node) { - return node.kind === 294; + return node.kind === 295; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; function isNotEmittedStatement(node) { - return node.kind === 293; + return node.kind === 294; } ts.isNotEmittedStatement = isNotEmittedStatement; function isNotEmittedOrPartiallyEmittedNode(node) { @@ -10079,15 +11259,15 @@ var ts; } ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isOmittedExpression(node) { - return node.kind === 198; + return node.kind === 199; } ts.isOmittedExpression = isOmittedExpression; function isTemplateSpan(node) { - return node.kind === 202; + return node.kind === 204; } ts.isTemplateSpan = isTemplateSpan; function isBlock(node) { - return node.kind === 204; + return node.kind === 206; } ts.isBlock = isBlock; function isConciseBody(node) { @@ -10105,121 +11285,135 @@ var ts; } ts.isForInitializer = isForInitializer; function isVariableDeclaration(node) { - return node.kind === 223; + return node.kind === 225; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 224; + return node.kind === 226; } ts.isVariableDeclarationList = isVariableDeclarationList; function isCaseBlock(node) { - return node.kind === 232; + return node.kind === 234; } ts.isCaseBlock = isCaseBlock; function isModuleBody(node) { var kind = node.kind; - return kind === 231 - || kind === 230; + return kind === 233 + || kind === 232 + || kind === 70; } ts.isModuleBody = isModuleBody; + function isNamespaceBody(node) { + var kind = node.kind; + return kind === 233 + || kind === 232; + } + ts.isNamespaceBody = isNamespaceBody; + function isJSDocNamespaceBody(node) { + var kind = node.kind; + return kind === 70 + || kind === 232; + } + ts.isJSDocNamespaceBody = isJSDocNamespaceBody; function isImportEqualsDeclaration(node) { - return node.kind === 234; + return node.kind === 236; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportClause(node) { - return node.kind === 236; + return node.kind === 238; } ts.isImportClause = isImportClause; function isNamedImportBindings(node) { var kind = node.kind; - return kind === 238 - || kind === 237; + return kind === 240 + || kind === 239; } ts.isNamedImportBindings = isNamedImportBindings; function isImportSpecifier(node) { - return node.kind === 239; + return node.kind === 241; } ts.isImportSpecifier = isImportSpecifier; function isNamedExports(node) { - return node.kind === 242; + return node.kind === 244; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 243; + return node.kind === 245; } ts.isExportSpecifier = isExportSpecifier; function isModuleOrEnumDeclaration(node) { - return node.kind === 230 || node.kind === 229; + return node.kind === 232 || node.kind === 231; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 185 - || kind === 174 - || kind === 226 - || kind === 197 - || kind === 150 - || kind === 229 - || kind === 260 - || kind === 243 - || kind === 225 - || kind === 184 - || kind === 151 - || kind === 236 - || kind === 234 - || kind === 239 - || kind === 227 - || kind === 149 - || kind === 148 - || kind === 230 - || kind === 233 - || kind === 237 - || kind === 144 - || kind === 257 - || kind === 147 - || kind === 146 - || kind === 152 - || kind === 258 + return kind === 186 + || kind === 175 || kind === 228 - || kind === 143 - || kind === 223 - || kind === 285; + || kind === 198 + || kind === 151 + || kind === 231 + || kind === 263 + || kind === 245 + || kind === 227 + || kind === 185 + || kind === 152 + || kind === 238 + || kind === 236 + || kind === 241 + || kind === 229 + || kind === 252 + || kind === 150 + || kind === 149 + || kind === 232 + || kind === 235 + || kind === 239 + || kind === 145 + || kind === 260 + || kind === 148 + || kind === 147 + || kind === 153 + || kind === 261 + || kind === 230 + || kind === 144 + || kind === 225 + || kind === 289; } function isDeclarationStatementKind(kind) { - return kind === 225 - || kind === 244 - || kind === 226 - || kind === 227 + return kind === 227 + || kind === 246 || kind === 228 || kind === 229 || kind === 230 - || kind === 235 - || kind === 234 - || kind === 241 - || kind === 240 - || kind === 233; + || kind === 231 + || kind === 232 + || kind === 237 + || kind === 236 + || kind === 243 + || kind === 242 + || kind === 235; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 215 - || kind === 214 - || kind === 222 - || kind === 209 - || kind === 207 - || kind === 206 - || kind === 212 - || kind === 213 - || kind === 211 - || kind === 208 - || kind === 219 + return kind === 217 || kind === 216 + || kind === 224 + || kind === 211 + || kind === 209 + || kind === 208 + || kind === 214 + || kind === 215 + || kind === 213 + || kind === 210 + || kind === 221 || kind === 218 || kind === 220 - || kind === 221 - || kind === 205 - || kind === 210 - || kind === 217 - || kind === 293 - || kind === 296 - || kind === 295; + || kind === 222 + || kind === 223 + || kind === 207 + || kind === 212 + || kind === 219 + || kind === 294 + || kind === 297 + || kind === 296; } function isDeclaration(node) { return isDeclarationKind(node.kind); @@ -10237,87 +11431,98 @@ var ts; var kind = node.kind; return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) - || kind === 204; + || kind === 206; } ts.isStatement = isStatement; function isModuleReference(node) { var kind = node.kind; - return kind === 245 - || kind === 141 + return kind === 247 + || kind === 142 || kind === 70; } ts.isModuleReference = isModuleReference; function isJsxOpeningElement(node) { - return node.kind === 248; + return node.kind === 250; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 249; + return node.kind === 251; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxTagNameExpression(node) { var kind = node.kind; return kind === 98 || kind === 70 - || kind === 177; + || kind === 178; } ts.isJsxTagNameExpression = isJsxTagNameExpression; function isJsxChild(node) { var kind = node.kind; - return kind === 246 - || kind === 252 - || kind === 247 + return kind === 248 + || kind === 255 + || kind === 249 || kind === 10; } ts.isJsxChild = isJsxChild; + function isJsxAttributes(node) { + var kind = node.kind; + return kind === 253; + } + ts.isJsxAttributes = isJsxAttributes; function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 250 - || kind === 251; + return kind === 252 + || kind === 254; } ts.isJsxAttributeLike = isJsxAttributeLike; function isJsxSpreadAttribute(node) { - return node.kind === 251; + return node.kind === 254; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxAttribute(node) { - return node.kind === 250; + return node.kind === 252; } ts.isJsxAttribute = isJsxAttribute; function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 9 - || kind === 252; + || kind === 255; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; + function isJsxOpeningLikeElement(node) { + var kind = node.kind; + return kind === 250 + || kind === 249; + } + ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 253 - || kind === 254; + return kind === 256 + || kind === 257; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; function isHeritageClause(node) { - return node.kind === 255; + return node.kind === 258; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 256; + return node.kind === 259; } ts.isCatchClause = isCatchClause; function isPropertyAssignment(node) { - return node.kind === 257; + return node.kind === 260; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 258; + return node.kind === 261; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isEnumMember(node) { - return node.kind === 260; + return node.kind === 263; } ts.isEnumMember = isEnumMember; function isSourceFile(node) { - return node.kind === 261; + return node.kind === 264; } ts.isSourceFile = isSourceFile; function isWatchSet(options) { @@ -10329,10 +11534,11 @@ var ts; function getDefaultLibFileName(options) { switch (options.target) { case 5: + return "lib.esnext.full.d.ts"; case 4: - return "lib.es2017.d.ts"; + return "lib.es2017.full.d.ts"; case 3: - return "lib.es2016.d.ts"; + return "lib.es2016.full.d.ts"; case 2: return "lib.es6.d.ts"; default: @@ -10456,9 +11662,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 143) { + if (d && d.kind === 144) { for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 227) { + if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 229) { return current; } } @@ -10466,11 +11672,11 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node) { - return ts.hasModifier(node, 92) && node.parent.kind === 150 && ts.isClassLike(node.parent.parent); + return ts.hasModifier(node, 92) && node.parent.kind === 151 && ts.isClassLike(node.parent.parent); } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 174 || ts.isBindingPattern(node))) { + while (node && (node.kind === 175 || ts.isBindingPattern(node))) { node = node.parent; } return node; @@ -10478,14 +11684,14 @@ var ts; function getCombinedModifierFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = ts.getModifierFlags(node); - if (node.kind === 223) { + if (node.kind === 225) { node = node.parent; } - if (node && node.kind === 224) { + if (node && node.kind === 226) { flags |= ts.getModifierFlags(node); node = node.parent; } - if (node && node.kind === 205) { + if (node && node.kind === 207) { flags |= ts.getModifierFlags(node); } return flags; @@ -10494,14 +11700,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 223) { + if (node.kind === 225) { node = node.parent; } - if (node && node.kind === 224) { + if (node && node.kind === 226) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 205) { + if (node && node.kind === 207) { flags |= node.flags; } return flags; @@ -10554,24 +11760,46 @@ var ts; } } ts.validateLocaleAndSetLanguage = validateLocaleAndSetLanguage; + function getOriginalNode(node, nodeTest) { + if (node) { + while (node.original !== undefined) { + node = node.original; + } + } + return !nodeTest || nodeTest(node) ? node : undefined; + } + ts.getOriginalNode = getOriginalNode; + function isParseTreeNode(node) { + return (node.flags & 8) === 0; + } + ts.isParseTreeNode = isParseTreeNode; + function getParseTreeNode(node, nodeTest) { + if (node === undefined || isParseTreeNode(node)) { + return node; + } + node = getOriginalNode(node); + if (isParseTreeNode(node) && (!nodeTest || nodeTest(node))) { + return node; + } + return undefined; + } + ts.getParseTreeNode = getParseTreeNode; + function unescapeIdentifier(identifier) { + return identifier.length >= 3 && identifier.charCodeAt(0) === 95 && identifier.charCodeAt(1) === 95 && identifier.charCodeAt(2) === 95 ? identifier.substr(1) : identifier; + } + ts.unescapeIdentifier = unescapeIdentifier; })(ts || (ts = {})); var ts; (function (ts) { - var NodeConstructor; - var SourceFileConstructor; - function createNode(kind, location, flags) { - var ConstructorForKind = kind === 261 - ? (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor())) - : (NodeConstructor || (NodeConstructor = ts.objectAllocator.getNodeConstructor())); - var node = location - ? new ConstructorForKind(kind, location.pos, location.end) - : new ConstructorForKind(kind, -1, -1); - node.flags = flags | 8; + function createSynthesizedNode(kind) { + var node = ts.createNode(kind, -1, -1); + node.flags |= 8; return node; } function updateNode(updated, original) { if (updated !== original) { setOriginalNode(updated, original); + setTextRange(updated, original); if (original.startsOnNewLine) { updated.startsOnNewLine = true; } @@ -10580,7 +11808,7 @@ var ts; return updated; } ts.updateNode = updateNode; - function createNodeArray(elements, location, hasTrailingComma) { + function createNodeArray(elements, hasTrailingComma) { if (elements) { if (ts.isNodeArray(elements)) { return elements; @@ -10590,32 +11818,15 @@ var ts; elements = []; } var array = elements; - if (location) { - array.pos = location.pos; - array.end = location.end; - } - else { - array.pos = -1; - array.end = -1; - } - if (hasTrailingComma) { - array.hasTrailingComma = true; - } + array.pos = -1; + array.end = -1; + array.hasTrailingComma = hasTrailingComma; return array; } ts.createNodeArray = createNodeArray; - function createSynthesizedNode(kind, startsOnNewLine) { - var node = createNode(kind, undefined); - node.startsOnNewLine = startsOnNewLine; - return node; - } - ts.createSynthesizedNode = createSynthesizedNode; - function createSynthesizedNodeArray(elements) { - return createNodeArray(elements, undefined); - } - ts.createSynthesizedNodeArray = createSynthesizedNodeArray; function getSynthesizedClone(node) { - var clone = createNode(node.kind, undefined, node.flags); + var clone = createSynthesizedNode(node.kind); + clone.flags |= node.flags; setOriginalNode(clone, node); for (var key in node) { if (clone.hasOwnProperty(key) || !node.hasOwnProperty(key)) { @@ -10626,50 +11837,48 @@ var ts; return clone; } ts.getSynthesizedClone = getSynthesizedClone; - function getMutableClone(node) { - var clone = getSynthesizedClone(node); - clone.pos = node.pos; - clone.end = node.end; - clone.parent = node.parent; - return clone; - } - ts.getMutableClone = getMutableClone; - function createLiteral(value, location) { + function createLiteral(value) { if (typeof value === "number") { - var node = createNode(8, location, undefined); - node.text = value.toString(); - return node; + return createNumericLiteral(value + ""); } - else if (typeof value === "boolean") { - return createNode(value ? 100 : 85, location, undefined); + if (typeof value === "boolean") { + return value ? createTrue() : createFalse(); } - else if (typeof value === "string") { - var node = createNode(9, location, undefined); - node.text = value; - return node; - } - else if (value) { - var node = createNode(9, location, undefined); - node.textSourceNode = value; - node.text = value.text; - return node; + if (typeof value === "string") { + return createStringLiteral(value); } + return createLiteralFromNode(value); } ts.createLiteral = createLiteral; - var nextAutoGenerateId = 0; - function createIdentifier(text, location) { - var node = createNode(70, location); + function createNumericLiteral(value) { + var node = createSynthesizedNode(8); + node.text = value; + node.numericLiteralFlags = 0; + return node; + } + ts.createNumericLiteral = createNumericLiteral; + function createStringLiteral(text) { + var node = createSynthesizedNode(9); + node.text = text; + return node; + } + function createLiteralFromNode(sourceNode) { + var node = createStringLiteral(sourceNode.text); + node.textSourceNode = sourceNode; + return node; + } + function createIdentifier(text) { + var node = createSynthesizedNode(70); node.text = ts.escapeIdentifier(text); - node.originalKeywordKind = ts.stringToToken(text); + node.originalKeywordKind = text ? ts.stringToToken(text) : 0; node.autoGenerateKind = 0; node.autoGenerateId = 0; return node; } ts.createIdentifier = createIdentifier; - function createTempVariable(recordTempVariable, location) { - var name = createNode(70, location); - name.text = ""; - name.originalKeywordKind = 0; + var nextAutoGenerateId = 0; + function createTempVariable(recordTempVariable) { + var name = createIdentifier(""); name.autoGenerateKind = 1; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; @@ -10679,93 +11888,387 @@ var ts; return name; } ts.createTempVariable = createTempVariable; - function createLoopVariable(location) { - var name = createNode(70, location); - name.text = ""; - name.originalKeywordKind = 0; + function createLoopVariable() { + var name = createIdentifier(""); name.autoGenerateKind = 2; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; return name; } ts.createLoopVariable = createLoopVariable; - function createUniqueName(text, location) { - var name = createNode(70, location); - name.text = text; - name.originalKeywordKind = 0; + function createUniqueName(text) { + var name = createIdentifier(text); name.autoGenerateKind = 3; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; return name; } ts.createUniqueName = createUniqueName; - function getGeneratedNameForNode(node, location) { - var name = createNode(70, location); - name.original = node; - name.text = ""; - name.originalKeywordKind = 0; + function getGeneratedNameForNode(node) { + var name = createIdentifier(""); name.autoGenerateKind = 4; name.autoGenerateId = nextAutoGenerateId; + name.original = node; nextAutoGenerateId++; return name; } ts.getGeneratedNameForNode = getGeneratedNameForNode; function createToken(token) { - return createNode(token); + return createSynthesizedNode(token); } ts.createToken = createToken; function createSuper() { - var node = createNode(96); - return node; + return createSynthesizedNode(96); } ts.createSuper = createSuper; - function createThis(location) { - var node = createNode(98, location); - return node; + function createThis() { + return createSynthesizedNode(98); } ts.createThis = createThis; function createNull() { - var node = createNode(94); - return node; + return createSynthesizedNode(94); } ts.createNull = createNull; - function createComputedPropertyName(expression, location) { - var node = createNode(142, location); + function createTrue() { + return createSynthesizedNode(100); + } + ts.createTrue = createTrue; + function createFalse() { + return createSynthesizedNode(85); + } + ts.createFalse = createFalse; + function createQualifiedName(left, right) { + var node = createSynthesizedNode(142); + node.left = left; + node.right = asName(right); + return node; + } + ts.createQualifiedName = createQualifiedName; + function updateQualifiedName(node, left, right) { + return node.left !== left + || node.right !== right + ? updateNode(createQualifiedName(left, right), node) + : node; + } + ts.updateQualifiedName = updateQualifiedName; + function createComputedPropertyName(expression) { + var node = createSynthesizedNode(143); node.expression = expression; return node; } ts.createComputedPropertyName = createComputedPropertyName; function updateComputedPropertyName(node, expression) { - if (node.expression !== expression) { - return updateNode(createComputedPropertyName(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createComputedPropertyName(expression), node) + : node; } ts.updateComputedPropertyName = updateComputedPropertyName; - function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer, location, flags) { - var node = createNode(144, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createSignatureDeclaration(kind, typeParameters, parameters, type) { + var signatureDeclaration = createSynthesizedNode(kind); + signatureDeclaration.typeParameters = asNodeArray(typeParameters); + signatureDeclaration.parameters = asNodeArray(parameters); + signatureDeclaration.type = type; + return signatureDeclaration; + } + ts.createSignatureDeclaration = createSignatureDeclaration; + function updateSignatureDeclaration(node, typeParameters, parameters, type) { + return node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + ? updateNode(createSignatureDeclaration(node.kind, typeParameters, parameters, type), node) + : node; + } + function createFunctionTypeNode(typeParameters, parameters, type) { + return createSignatureDeclaration(159, typeParameters, parameters, type); + } + ts.createFunctionTypeNode = createFunctionTypeNode; + function updateFunctionTypeNode(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateFunctionTypeNode = updateFunctionTypeNode; + function createConstructorTypeNode(typeParameters, parameters, type) { + return createSignatureDeclaration(160, typeParameters, parameters, type); + } + ts.createConstructorTypeNode = createConstructorTypeNode; + function updateConstructorTypeNode(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateConstructorTypeNode = updateConstructorTypeNode; + function createCallSignatureDeclaration(typeParameters, parameters, type) { + return createSignatureDeclaration(154, typeParameters, parameters, type); + } + ts.createCallSignatureDeclaration = createCallSignatureDeclaration; + function updateCallSignatureDeclaration(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateCallSignatureDeclaration = updateCallSignatureDeclaration; + function createConstructSignatureDeclaration(typeParameters, parameters, type) { + return createSignatureDeclaration(155, typeParameters, parameters, type); + } + ts.createConstructSignatureDeclaration = createConstructSignatureDeclaration; + function updateConstructSignatureDeclaration(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateConstructSignatureDeclaration = updateConstructSignatureDeclaration; + function createMethodSignature(typeParameters, parameters, type, name, questionToken) { + var methodSignature = createSignatureDeclaration(149, typeParameters, parameters, type); + methodSignature.name = asName(name); + methodSignature.questionToken = questionToken; + return methodSignature; + } + ts.createMethodSignature = createMethodSignature; + function updateMethodSignature(node, typeParameters, parameters, type, name, questionToken) { + return node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.name !== name + || node.questionToken !== questionToken + ? updateNode(createMethodSignature(typeParameters, parameters, type, name, questionToken), node) + : node; + } + ts.updateMethodSignature = updateMethodSignature; + function createKeywordTypeNode(kind) { + return createSynthesizedNode(kind); + } + ts.createKeywordTypeNode = createKeywordTypeNode; + function createThisTypeNode() { + return createSynthesizedNode(168); + } + ts.createThisTypeNode = createThisTypeNode; + function createLiteralTypeNode(literal) { + var literalTypeNode = createSynthesizedNode(172); + literalTypeNode.literal = literal; + return literalTypeNode; + } + ts.createLiteralTypeNode = createLiteralTypeNode; + function updateLiteralTypeNode(node, literal) { + return node.literal !== literal + ? updateNode(createLiteralTypeNode(literal), node) + : node; + } + ts.updateLiteralTypeNode = updateLiteralTypeNode; + function createTypeReferenceNode(typeName, typeArguments) { + var typeReference = createSynthesizedNode(158); + typeReference.typeName = asName(typeName); + typeReference.typeArguments = asNodeArray(typeArguments); + return typeReference; + } + ts.createTypeReferenceNode = createTypeReferenceNode; + function updateTypeReferenceNode(node, typeName, typeArguments) { + return node.typeName !== typeName + || node.typeArguments !== typeArguments + ? updateNode(createTypeReferenceNode(typeName, typeArguments), node) + : node; + } + ts.updateTypeReferenceNode = updateTypeReferenceNode; + function createTypePredicateNode(parameterName, type) { + var typePredicateNode = createSynthesizedNode(157); + typePredicateNode.parameterName = asName(parameterName); + typePredicateNode.type = type; + return typePredicateNode; + } + ts.createTypePredicateNode = createTypePredicateNode; + function updateTypePredicateNode(node, parameterName, type) { + return node.parameterName !== parameterName + || node.type !== type + ? updateNode(createTypePredicateNode(parameterName, type), node) + : node; + } + ts.updateTypePredicateNode = updateTypePredicateNode; + function createTypeQueryNode(exprName) { + var typeQueryNode = createSynthesizedNode(161); + typeQueryNode.exprName = exprName; + return typeQueryNode; + } + ts.createTypeQueryNode = createTypeQueryNode; + function updateTypeQueryNode(node, exprName) { + return node.exprName !== exprName ? updateNode(createTypeQueryNode(exprName), node) : node; + } + ts.updateTypeQueryNode = updateTypeQueryNode; + function createArrayTypeNode(elementType) { + var arrayTypeNode = createSynthesizedNode(163); + arrayTypeNode.elementType = elementType; + return arrayTypeNode; + } + ts.createArrayTypeNode = createArrayTypeNode; + function updateArrayTypeNode(node, elementType) { + return node.elementType !== elementType + ? updateNode(createArrayTypeNode(elementType), node) + : node; + } + ts.updateArrayTypeNode = updateArrayTypeNode; + function createUnionOrIntersectionTypeNode(kind, types) { + var unionTypeNode = createSynthesizedNode(kind); + unionTypeNode.types = createNodeArray(types); + return unionTypeNode; + } + ts.createUnionOrIntersectionTypeNode = createUnionOrIntersectionTypeNode; + function updateUnionOrIntersectionTypeNode(node, types) { + return node.types !== types + ? updateNode(createUnionOrIntersectionTypeNode(node.kind, types), node) + : node; + } + ts.updateUnionOrIntersectionTypeNode = updateUnionOrIntersectionTypeNode; + function createTypeLiteralNode(members) { + var typeLiteralNode = createSynthesizedNode(162); + typeLiteralNode.members = createNodeArray(members); + return typeLiteralNode; + } + ts.createTypeLiteralNode = createTypeLiteralNode; + function updateTypeLiteralNode(node, members) { + return node.members !== members + ? updateNode(createTypeLiteralNode(members), node) + : node; + } + ts.updateTypeLiteralNode = updateTypeLiteralNode; + function createTupleTypeNode(elementTypes) { + var tupleTypeNode = createSynthesizedNode(164); + tupleTypeNode.elementTypes = createNodeArray(elementTypes); + return tupleTypeNode; + } + ts.createTupleTypeNode = createTupleTypeNode; + function updateTypleTypeNode(node, elementTypes) { + return node.elementTypes !== elementTypes + ? updateNode(createTupleTypeNode(elementTypes), node) + : node; + } + ts.updateTypleTypeNode = updateTypleTypeNode; + function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { + var mappedTypeNode = createSynthesizedNode(171); + mappedTypeNode.readonlyToken = readonlyToken; + mappedTypeNode.typeParameter = typeParameter; + mappedTypeNode.questionToken = questionToken; + mappedTypeNode.type = type; + return mappedTypeNode; + } + ts.createMappedTypeNode = createMappedTypeNode; + function updateMappedTypeNode(node, readonlyToken, typeParameter, questionToken, type) { + return node.readonlyToken !== readonlyToken + || node.typeParameter !== typeParameter + || node.questionToken !== questionToken + || node.type !== type + ? updateNode(createMappedTypeNode(readonlyToken, typeParameter, questionToken, type), node) + : node; + } + ts.updateMappedTypeNode = updateMappedTypeNode; + function createTypeOperatorNode(type) { + var typeOperatorNode = createSynthesizedNode(169); + typeOperatorNode.operator = 126; + typeOperatorNode.type = type; + return typeOperatorNode; + } + ts.createTypeOperatorNode = createTypeOperatorNode; + function updateTypeOperatorNode(node, type) { + return node.type !== type ? updateNode(createTypeOperatorNode(type), node) : node; + } + ts.updateTypeOperatorNode = updateTypeOperatorNode; + function createIndexedAccessTypeNode(objectType, indexType) { + var indexedAccessTypeNode = createSynthesizedNode(170); + indexedAccessTypeNode.objectType = objectType; + indexedAccessTypeNode.indexType = indexType; + return indexedAccessTypeNode; + } + ts.createIndexedAccessTypeNode = createIndexedAccessTypeNode; + function updateIndexedAccessTypeNode(node, objectType, indexType) { + return node.objectType !== objectType + || node.indexType !== indexType + ? updateNode(createIndexedAccessTypeNode(objectType, indexType), node) + : node; + } + ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; + function createTypeParameterDeclaration(name, constraint, defaultType) { + var typeParameter = createSynthesizedNode(144); + typeParameter.name = asName(name); + typeParameter.constraint = constraint; + typeParameter.default = defaultType; + return typeParameter; + } + ts.createTypeParameterDeclaration = createTypeParameterDeclaration; + function updateTypeParameterDeclaration(node, name, constraint, defaultType) { + return node.name !== name + || node.constraint !== constraint + || node.default !== defaultType + ? updateNode(createTypeParameterDeclaration(name, constraint, defaultType), node) + : node; + } + ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; + function createPropertySignature(name, questionToken, type, initializer) { + var propertySignature = createSynthesizedNode(147); + propertySignature.name = asName(name); + propertySignature.questionToken = questionToken; + propertySignature.type = type; + propertySignature.initializer = initializer; + return propertySignature; + } + ts.createPropertySignature = createPropertySignature; + function updatePropertySignature(node, name, questionToken, type, initializer) { + return node.name !== name + || node.questionToken !== questionToken + || node.type !== type + || node.initializer !== initializer + ? updateNode(createPropertySignature(name, questionToken, type, initializer), node) + : node; + } + ts.updatePropertySignature = updatePropertySignature; + function createIndexSignatureDeclaration(decorators, modifiers, parameters, type) { + var indexSignature = createSynthesizedNode(156); + indexSignature.decorators = asNodeArray(decorators); + indexSignature.modifiers = asNodeArray(modifiers); + indexSignature.parameters = createNodeArray(parameters); + indexSignature.type = type; + return indexSignature; + } + ts.createIndexSignatureDeclaration = createIndexSignatureDeclaration; + function updateIndexSignatureDeclaration(node, decorators, modifiers, parameters, type) { + return node.parameters !== parameters + || node.type !== type + || node.decorators !== decorators + || node.modifiers !== modifiers + ? updateNode(createIndexSignatureDeclaration(decorators, modifiers, parameters, type), node) + : node; + } + ts.updateIndexSignatureDeclaration = updateIndexSignatureDeclaration; + function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { + var node = createSynthesizedNode(145); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; + node.name = asName(name); node.questionToken = questionToken; node.type = type; - node.initializer = initializer ? parenthesizeExpressionForList(initializer) : undefined; + node.initializer = initializer ? ts.parenthesizeExpressionForList(initializer) : undefined; return node; } ts.createParameter = createParameter; - function updateParameter(node, decorators, modifiers, dotDotDotToken, name, type, initializer) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.type !== type || node.initializer !== initializer) { - return updateNode(createParameter(decorators, modifiers, dotDotDotToken, name, node.questionToken, type, initializer, node, node.flags), node); - } - return node; + function updateParameter(node, decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.dotDotDotToken !== dotDotDotToken + || node.name !== name + || node.questionToken !== questionToken + || node.type !== type + || node.initializer !== initializer + ? updateNode(createParameter(decorators, modifiers, dotDotDotToken, name, node.questionToken, type, initializer), node) + : node; } ts.updateParameter = updateParameter; - function createProperty(decorators, modifiers, name, questionToken, type, initializer, location) { - var node = createNode(147, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createDecorator(expression) { + var node = createSynthesizedNode(146); + node.expression = ts.parenthesizeForAccess(expression); + return node; + } + ts.createDecorator = createDecorator; + function updateDecorator(node, expression) { + return node.expression !== expression + ? updateNode(createDecorator(expression), node) + : node; + } + ts.updateDecorator = updateDecorator; + function createProperty(decorators, modifiers, name, questionToken, type, initializer) { + var node = createSynthesizedNode(148); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); node.questionToken = questionToken; node.type = type; node.initializer = initializer; @@ -10773,36 +12276,46 @@ var ts; } ts.createProperty = createProperty; function updateProperty(node, decorators, modifiers, name, type, initializer) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.type !== type || node.initializer !== initializer) { - return updateNode(createProperty(decorators, modifiers, name, node.questionToken, type, initializer, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.type !== type + || node.initializer !== initializer + ? updateNode(createProperty(decorators, modifiers, name, node.questionToken, type, initializer), node) + : node; } ts.updateProperty = updateProperty; - function createMethod(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) { - var node = createNode(149, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createMethodDeclaration(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { + var node = createSynthesizedNode(150); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + node.name = asName(name); + node.questionToken = questionToken; + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.body = body; return node; } - ts.createMethod = createMethod; - function updateMethod(node, decorators, modifiers, name, typeParameters, parameters, type, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createMethod(decorators, modifiers, node.asteriskToken, name, typeParameters, parameters, type, body, node, node.flags), node); - } - return node; + ts.createMethodDeclaration = createMethodDeclaration; + function updateMethod(node, decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.asteriskToken !== asteriskToken + || node.name !== name + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createMethodDeclaration(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body), node) + : node; } ts.updateMethod = updateMethod; - function createConstructor(decorators, modifiers, parameters, body, location, flags) { - var node = createNode(150, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createConstructor(decorators, modifiers, parameters, body) { + var node = createSynthesizedNode(151); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; node.parameters = createNodeArray(parameters); node.type = undefined; @@ -10811,17 +12324,19 @@ var ts; } ts.createConstructor = createConstructor; function updateConstructor(node, decorators, modifiers, parameters, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.parameters !== parameters || node.body !== body) { - return updateNode(createConstructor(decorators, modifiers, parameters, body, node, node.flags), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.parameters !== parameters + || node.body !== body + ? updateNode(createConstructor(decorators, modifiers, parameters, body), node) + : node; } ts.updateConstructor = updateConstructor; - function createGetAccessor(decorators, modifiers, name, parameters, type, body, location, flags) { - var node = createNode(151, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createGetAccessor(decorators, modifiers, name, parameters, type, body) { + var node = createSynthesizedNode(152); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); node.typeParameters = undefined; node.parameters = createNodeArray(parameters); node.type = type; @@ -10830,17 +12345,21 @@ var ts; } ts.createGetAccessor = createGetAccessor; function updateGetAccessor(node, decorators, modifiers, name, parameters, type, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createGetAccessor(decorators, modifiers, name, parameters, type, body, node, node.flags), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createGetAccessor(decorators, modifiers, name, parameters, type, body), node) + : node; } ts.updateGetAccessor = updateGetAccessor; - function createSetAccessor(decorators, modifiers, name, parameters, body, location, flags) { - var node = createNode(152, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createSetAccessor(decorators, modifiers, name, parameters, body) { + var node = createSynthesizedNode(153); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); node.typeParameters = undefined; node.parameters = createNodeArray(parameters); node.body = body; @@ -10848,57 +12367,60 @@ var ts; } ts.createSetAccessor = createSetAccessor; function updateSetAccessor(node, decorators, modifiers, name, parameters, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.parameters !== parameters || node.body !== body) { - return updateNode(createSetAccessor(decorators, modifiers, name, parameters, body, node, node.flags), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.parameters !== parameters + || node.body !== body + ? updateNode(createSetAccessor(decorators, modifiers, name, parameters, body), node) + : node; } ts.updateSetAccessor = updateSetAccessor; - function createObjectBindingPattern(elements, location) { - var node = createNode(172, location); + function createObjectBindingPattern(elements) { + var node = createSynthesizedNode(173); node.elements = createNodeArray(elements); return node; } ts.createObjectBindingPattern = createObjectBindingPattern; function updateObjectBindingPattern(node, elements) { - if (node.elements !== elements) { - return updateNode(createObjectBindingPattern(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createObjectBindingPattern(elements), node) + : node; } ts.updateObjectBindingPattern = updateObjectBindingPattern; - function createArrayBindingPattern(elements, location) { - var node = createNode(173, location); + function createArrayBindingPattern(elements) { + var node = createSynthesizedNode(174); node.elements = createNodeArray(elements); return node; } ts.createArrayBindingPattern = createArrayBindingPattern; function updateArrayBindingPattern(node, elements) { - if (node.elements !== elements) { - return updateNode(createArrayBindingPattern(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createArrayBindingPattern(elements), node) + : node; } ts.updateArrayBindingPattern = updateArrayBindingPattern; - function createBindingElement(propertyName, dotDotDotToken, name, initializer, location) { - var node = createNode(174, location); - node.propertyName = typeof propertyName === "string" ? createIdentifier(propertyName) : propertyName; + function createBindingElement(dotDotDotToken, propertyName, name, initializer) { + var node = createSynthesizedNode(175); node.dotDotDotToken = dotDotDotToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; + node.propertyName = asName(propertyName); + node.name = asName(name); node.initializer = initializer; return node; } ts.createBindingElement = createBindingElement; function updateBindingElement(node, dotDotDotToken, propertyName, name, initializer) { - if (node.propertyName !== propertyName || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.initializer !== initializer) { - return updateNode(createBindingElement(propertyName, dotDotDotToken, name, initializer, node), node); - } - return node; + return node.propertyName !== propertyName + || node.dotDotDotToken !== dotDotDotToken + || node.name !== name + || node.initializer !== initializer + ? updateNode(createBindingElement(dotDotDotToken, propertyName, name, initializer), node) + : node; } ts.updateBindingElement = updateBindingElement; - function createArrayLiteral(elements, location, multiLine) { - var node = createNode(175, location); - node.elements = parenthesizeListElements(createNodeArray(elements)); + function createArrayLiteral(elements, multiLine) { + var node = createSynthesizedNode(176); + node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) { node.multiLine = true; } @@ -10906,14 +12428,13 @@ var ts; } ts.createArrayLiteral = createArrayLiteral; function updateArrayLiteral(node, elements) { - if (node.elements !== elements) { - return updateNode(createArrayLiteral(elements, node, node.multiLine), node); - } - return node; + return node.elements !== elements + ? updateNode(createArrayLiteral(elements, node.multiLine), node) + : node; } ts.updateArrayLiteral = updateArrayLiteral; - function createObjectLiteral(properties, location, multiLine) { - var node = createNode(176, location); + function createObjectLiteral(properties, multiLine) { + var node = createSynthesizedNode(177); node.properties = createNodeArray(properties); if (multiLine) { node.multiLine = true; @@ -10922,431 +12443,461 @@ var ts; } ts.createObjectLiteral = createObjectLiteral; function updateObjectLiteral(node, properties) { - if (node.properties !== properties) { - return updateNode(createObjectLiteral(properties, node, node.multiLine), node); - } - return node; + return node.properties !== properties + ? updateNode(createObjectLiteral(properties, node.multiLine), node) + : node; } ts.updateObjectLiteral = updateObjectLiteral; - function createPropertyAccess(expression, name, location, flags) { - var node = createNode(177, location, flags); - node.expression = parenthesizeForAccess(expression); - (node.emitNode || (node.emitNode = {})).flags |= 65536; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createPropertyAccess(expression, name) { + var node = createSynthesizedNode(178); + node.expression = ts.parenthesizeForAccess(expression); + node.name = asName(name); + setEmitFlags(node, 65536); return node; } ts.createPropertyAccess = createPropertyAccess; function updatePropertyAccess(node, expression, name) { - if (node.expression !== expression || node.name !== name) { - var propertyAccess = createPropertyAccess(expression, name, node, node.flags); - (propertyAccess.emitNode || (propertyAccess.emitNode = {})).flags = getEmitFlags(node); - return updateNode(propertyAccess, node); - } - return node; + return node.expression !== expression + || node.name !== name + ? updateNode(setEmitFlags(createPropertyAccess(expression, name), getEmitFlags(node)), node) + : node; } ts.updatePropertyAccess = updatePropertyAccess; - function createElementAccess(expression, index, location) { - var node = createNode(178, location); - node.expression = parenthesizeForAccess(expression); - node.argumentExpression = typeof index === "number" ? createLiteral(index) : index; + function createElementAccess(expression, index) { + var node = createSynthesizedNode(179); + node.expression = ts.parenthesizeForAccess(expression); + node.argumentExpression = asExpression(index); return node; } ts.createElementAccess = createElementAccess; function updateElementAccess(node, expression, argumentExpression) { - if (node.expression !== expression || node.argumentExpression !== argumentExpression) { - return updateNode(createElementAccess(expression, argumentExpression, node), node); - } - return node; + return node.expression !== expression + || node.argumentExpression !== argumentExpression + ? updateNode(createElementAccess(expression, argumentExpression), node) + : node; } ts.updateElementAccess = updateElementAccess; - function createCall(expression, typeArguments, argumentsArray, location, flags) { - var node = createNode(179, location, flags); - node.expression = parenthesizeForAccess(expression); - if (typeArguments) { - node.typeArguments = createNodeArray(typeArguments); - } - node.arguments = parenthesizeListElements(createNodeArray(argumentsArray)); + function createCall(expression, typeArguments, argumentsArray) { + var node = createSynthesizedNode(180); + node.expression = ts.parenthesizeForAccess(expression); + node.typeArguments = asNodeArray(typeArguments); + node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); return node; } ts.createCall = createCall; function updateCall(node, expression, typeArguments, argumentsArray) { - if (expression !== node.expression || typeArguments !== node.typeArguments || argumentsArray !== node.arguments) { - return updateNode(createCall(expression, typeArguments, argumentsArray, node, node.flags), node); - } - return node; + return expression !== node.expression + || typeArguments !== node.typeArguments + || argumentsArray !== node.arguments + ? updateNode(createCall(expression, typeArguments, argumentsArray), node) + : node; } ts.updateCall = updateCall; - function createNew(expression, typeArguments, argumentsArray, location, flags) { - var node = createNode(180, location, flags); - node.expression = parenthesizeForNew(expression); - node.typeArguments = typeArguments ? createNodeArray(typeArguments) : undefined; - node.arguments = argumentsArray ? parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; + function createNew(expression, typeArguments, argumentsArray) { + var node = createSynthesizedNode(181); + node.expression = ts.parenthesizeForNew(expression); + node.typeArguments = asNodeArray(typeArguments); + node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; return node; } ts.createNew = createNew; function updateNew(node, expression, typeArguments, argumentsArray) { - if (node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray) { - return updateNode(createNew(expression, typeArguments, argumentsArray, node, node.flags), node); - } - return node; + return node.expression !== expression + || node.typeArguments !== typeArguments + || node.arguments !== argumentsArray + ? updateNode(createNew(expression, typeArguments, argumentsArray), node) + : node; } ts.updateNew = updateNew; - function createTaggedTemplate(tag, template, location) { - var node = createNode(181, location); - node.tag = parenthesizeForAccess(tag); + function createTaggedTemplate(tag, template) { + var node = createSynthesizedNode(182); + node.tag = ts.parenthesizeForAccess(tag); node.template = template; return node; } ts.createTaggedTemplate = createTaggedTemplate; function updateTaggedTemplate(node, tag, template) { - if (node.tag !== tag || node.template !== template) { - return updateNode(createTaggedTemplate(tag, template, node), node); - } - return node; + return node.tag !== tag + || node.template !== template + ? updateNode(createTaggedTemplate(tag, template), node) + : node; } ts.updateTaggedTemplate = updateTaggedTemplate; - function createParen(expression, location) { - var node = createNode(183, location); + function createTypeAssertion(type, expression) { + var node = createSynthesizedNode(183); + node.type = type; + node.expression = ts.parenthesizePrefixOperand(expression); + return node; + } + ts.createTypeAssertion = createTypeAssertion; + function updateTypeAssertion(node, type, expression) { + return node.type !== type + || node.expression !== expression + ? updateNode(createTypeAssertion(type, expression), node) + : node; + } + ts.updateTypeAssertion = updateTypeAssertion; + function createParen(expression) { + var node = createSynthesizedNode(184); node.expression = expression; return node; } ts.createParen = createParen; function updateParen(node, expression) { - if (node.expression !== expression) { - return updateNode(createParen(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createParen(expression), node) + : node; } ts.updateParen = updateParen; - function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) { - var node = createNode(184, location, flags); - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + var node = createSynthesizedNode(185); + node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.body = body; return node; } ts.createFunctionExpression = createFunctionExpression; - function updateFunctionExpression(node, modifiers, name, typeParameters, parameters, type, body) { - if (node.name !== name || node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createFunctionExpression(modifiers, node.asteriskToken, name, typeParameters, parameters, type, body, node, node.flags), node); - } - return node; + function updateFunctionExpression(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + return node.name !== name + || node.modifiers !== modifiers + || node.asteriskToken !== asteriskToken + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) + : node; } ts.updateFunctionExpression = updateFunctionExpression; - function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body, location, flags) { - var node = createNode(185, location, flags); - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { + var node = createSynthesizedNode(186); + node.modifiers = asNodeArray(modifiers); + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.equalsGreaterThanToken = equalsGreaterThanToken || createToken(35); - node.body = parenthesizeConciseBody(body); + node.body = ts.parenthesizeConciseBody(body); return node; } ts.createArrowFunction = createArrowFunction; function updateArrowFunction(node, modifiers, typeParameters, parameters, type, body) { - if (node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createArrowFunction(modifiers, typeParameters, parameters, type, node.equalsGreaterThanToken, body, node, node.flags), node); - } - return node; + return node.modifiers !== modifiers + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createArrowFunction(modifiers, typeParameters, parameters, type, node.equalsGreaterThanToken, body), node) + : node; } ts.updateArrowFunction = updateArrowFunction; - function createDelete(expression, location) { - var node = createNode(186, location); - node.expression = parenthesizePrefixOperand(expression); + function createDelete(expression) { + var node = createSynthesizedNode(187); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createDelete = createDelete; function updateDelete(node, expression) { - if (node.expression !== expression) { - return updateNode(createDelete(expression, node), expression); - } - return node; + return node.expression !== expression + ? updateNode(createDelete(expression), node) + : node; } ts.updateDelete = updateDelete; - function createTypeOf(expression, location) { - var node = createNode(187, location); - node.expression = parenthesizePrefixOperand(expression); + function createTypeOf(expression) { + var node = createSynthesizedNode(188); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createTypeOf = createTypeOf; function updateTypeOf(node, expression) { - if (node.expression !== expression) { - return updateNode(createTypeOf(expression, node), expression); - } - return node; + return node.expression !== expression + ? updateNode(createTypeOf(expression), node) + : node; } ts.updateTypeOf = updateTypeOf; - function createVoid(expression, location) { - var node = createNode(188, location); - node.expression = parenthesizePrefixOperand(expression); + function createVoid(expression) { + var node = createSynthesizedNode(189); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createVoid = createVoid; function updateVoid(node, expression) { - if (node.expression !== expression) { - return updateNode(createVoid(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createVoid(expression), node) + : node; } ts.updateVoid = updateVoid; - function createAwait(expression, location) { - var node = createNode(189, location); - node.expression = parenthesizePrefixOperand(expression); + function createAwait(expression) { + var node = createSynthesizedNode(190); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createAwait = createAwait; function updateAwait(node, expression) { - if (node.expression !== expression) { - return updateNode(createAwait(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createAwait(expression), node) + : node; } ts.updateAwait = updateAwait; - function createPrefix(operator, operand, location) { - var node = createNode(190, location); + function createPrefix(operator, operand) { + var node = createSynthesizedNode(191); node.operator = operator; - node.operand = parenthesizePrefixOperand(operand); + node.operand = ts.parenthesizePrefixOperand(operand); return node; } ts.createPrefix = createPrefix; function updatePrefix(node, operand) { - if (node.operand !== operand) { - return updateNode(createPrefix(node.operator, operand, node), node); - } - return node; + return node.operand !== operand + ? updateNode(createPrefix(node.operator, operand), node) + : node; } ts.updatePrefix = updatePrefix; - function createPostfix(operand, operator, location) { - var node = createNode(191, location); - node.operand = parenthesizePostfixOperand(operand); + function createPostfix(operand, operator) { + var node = createSynthesizedNode(192); + node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; } ts.createPostfix = createPostfix; function updatePostfix(node, operand) { - if (node.operand !== operand) { - return updateNode(createPostfix(operand, node.operator, node), node); - } - return node; + return node.operand !== operand + ? updateNode(createPostfix(operand, node.operator), node) + : node; } ts.updatePostfix = updatePostfix; - function createBinary(left, operator, right, location) { - var operatorToken = typeof operator === "number" ? createToken(operator) : operator; + function createBinary(left, operator, right) { + var node = createSynthesizedNode(193); + var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; - var node = createNode(192, location); - node.left = parenthesizeBinaryOperand(operatorKind, left, true, undefined); + node.left = ts.parenthesizeBinaryOperand(operatorKind, left, true, undefined); node.operatorToken = operatorToken; - node.right = parenthesizeBinaryOperand(operatorKind, right, false, node.left); + node.right = ts.parenthesizeBinaryOperand(operatorKind, right, false, node.left); return node; } ts.createBinary = createBinary; function updateBinary(node, left, right) { - if (node.left !== left || node.right !== right) { - return updateNode(createBinary(left, node.operatorToken, right, node), node); - } - return node; + return node.left !== left + || node.right !== right + ? updateNode(createBinary(left, node.operatorToken, right), node) + : node; } ts.updateBinary = updateBinary; - function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonTokenOrLocation, whenFalse, location) { - var node = createNode(193, whenFalse ? location : colonTokenOrLocation); - node.condition = parenthesizeForConditionalHead(condition); - if (whenFalse) { - node.questionToken = questionTokenOrWhenTrue; - node.whenTrue = parenthesizeSubexpressionOfConditionalExpression(whenTrueOrWhenFalse); - node.colonToken = colonTokenOrLocation; - node.whenFalse = parenthesizeSubexpressionOfConditionalExpression(whenFalse); - } - else { - node.questionToken = createToken(54); - node.whenTrue = parenthesizeSubexpressionOfConditionalExpression(questionTokenOrWhenTrue); - node.colonToken = createToken(55); - node.whenFalse = parenthesizeSubexpressionOfConditionalExpression(whenTrueOrWhenFalse); - } + function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { + var node = createSynthesizedNode(194); + node.condition = ts.parenthesizeForConditionalHead(condition); + node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(54); + node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); + node.colonToken = whenFalse ? colonToken : createToken(55); + node.whenFalse = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenFalse : whenTrueOrWhenFalse); return node; } ts.createConditional = createConditional; function updateConditional(node, condition, whenTrue, whenFalse) { - if (node.condition !== condition || node.whenTrue !== whenTrue || node.whenFalse !== whenFalse) { - return updateNode(createConditional(condition, node.questionToken, whenTrue, node.colonToken, whenFalse, node), node); - } - return node; + return node.condition !== condition + || node.whenTrue !== whenTrue + || node.whenFalse !== whenFalse + ? updateNode(createConditional(condition, node.questionToken, whenTrue, node.colonToken, whenFalse), node) + : node; } ts.updateConditional = updateConditional; - function createTemplateExpression(head, templateSpans, location) { - var node = createNode(194, location); + function createTemplateExpression(head, templateSpans) { + var node = createSynthesizedNode(195); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; } ts.createTemplateExpression = createTemplateExpression; function updateTemplateExpression(node, head, templateSpans) { - if (node.head !== head || node.templateSpans !== templateSpans) { - return updateNode(createTemplateExpression(head, templateSpans, node), node); - } - return node; + return node.head !== head + || node.templateSpans !== templateSpans + ? updateNode(createTemplateExpression(head, templateSpans), node) + : node; } ts.updateTemplateExpression = updateTemplateExpression; - function createYield(asteriskToken, expression, location) { - var node = createNode(195, location); - node.asteriskToken = asteriskToken; - node.expression = expression; + function createYield(asteriskTokenOrExpression, expression) { + var node = createSynthesizedNode(196); + node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 38 ? asteriskTokenOrExpression : undefined; + node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 38 ? asteriskTokenOrExpression : expression; return node; } ts.createYield = createYield; - function updateYield(node, expression) { - if (node.expression !== expression) { - return updateNode(createYield(node.asteriskToken, expression, node), node); - } - return node; + function updateYield(node, asteriskToken, expression) { + return node.expression !== expression + || node.asteriskToken !== asteriskToken + ? updateNode(createYield(asteriskToken, expression), node) + : node; } ts.updateYield = updateYield; - function createSpread(expression, location) { - var node = createNode(196, location); - node.expression = parenthesizeExpressionForList(expression); + function createSpread(expression) { + var node = createSynthesizedNode(197); + node.expression = ts.parenthesizeExpressionForList(expression); return node; } ts.createSpread = createSpread; function updateSpread(node, expression) { - if (node.expression !== expression) { - return updateNode(createSpread(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createSpread(expression), node) + : node; } ts.updateSpread = updateSpread; - function createClassExpression(modifiers, name, typeParameters, heritageClauses, members, location) { - var node = createNode(197, location); + function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { + var node = createSynthesizedNode(198); node.decorators = undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; - node.heritageClauses = createNodeArray(heritageClauses); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); + node.heritageClauses = asNodeArray(heritageClauses); node.members = createNodeArray(members); return node; } ts.createClassExpression = createClassExpression; function updateClassExpression(node, modifiers, name, typeParameters, heritageClauses, members) { - if (node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members) { - return updateNode(createClassExpression(modifiers, name, typeParameters, heritageClauses, members, node), node); - } - return node; + return node.modifiers !== modifiers + || node.name !== name + || node.typeParameters !== typeParameters + || node.heritageClauses !== heritageClauses + || node.members !== members + ? updateNode(createClassExpression(modifiers, name, typeParameters, heritageClauses, members), node) + : node; } ts.updateClassExpression = updateClassExpression; - function createOmittedExpression(location) { - var node = createNode(198, location); - return node; + function createOmittedExpression() { + return createSynthesizedNode(199); } ts.createOmittedExpression = createOmittedExpression; - function createExpressionWithTypeArguments(typeArguments, expression, location) { - var node = createNode(199, location); - node.typeArguments = typeArguments ? createNodeArray(typeArguments) : undefined; - node.expression = parenthesizeForAccess(expression); + function createExpressionWithTypeArguments(typeArguments, expression) { + var node = createSynthesizedNode(200); + node.expression = ts.parenthesizeForAccess(expression); + node.typeArguments = asNodeArray(typeArguments); return node; } ts.createExpressionWithTypeArguments = createExpressionWithTypeArguments; function updateExpressionWithTypeArguments(node, typeArguments, expression) { - if (node.typeArguments !== typeArguments || node.expression !== expression) { - return updateNode(createExpressionWithTypeArguments(typeArguments, expression, node), node); - } - return node; + return node.typeArguments !== typeArguments + || node.expression !== expression + ? updateNode(createExpressionWithTypeArguments(typeArguments, expression), node) + : node; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; - function createTemplateSpan(expression, literal, location) { - var node = createNode(202, location); + function createAsExpression(expression, type) { + var node = createSynthesizedNode(201); + node.expression = expression; + node.type = type; + return node; + } + ts.createAsExpression = createAsExpression; + function updateAsExpression(node, expression, type) { + return node.expression !== expression + || node.type !== type + ? updateNode(createAsExpression(expression, type), node) + : node; + } + ts.updateAsExpression = updateAsExpression; + function createNonNullExpression(expression) { + var node = createSynthesizedNode(202); + node.expression = ts.parenthesizeForAccess(expression); + return node; + } + ts.createNonNullExpression = createNonNullExpression; + function updateNonNullExpression(node, expression) { + return node.expression !== expression + ? updateNode(createNonNullExpression(expression), node) + : node; + } + ts.updateNonNullExpression = updateNonNullExpression; + function createTemplateSpan(expression, literal) { + var node = createSynthesizedNode(204); node.expression = expression; node.literal = literal; return node; } ts.createTemplateSpan = createTemplateSpan; function updateTemplateSpan(node, expression, literal) { - if (node.expression !== expression || node.literal !== literal) { - return updateNode(createTemplateSpan(expression, literal, node), node); - } - return node; + return node.expression !== expression + || node.literal !== literal + ? updateNode(createTemplateSpan(expression, literal), node) + : node; } ts.updateTemplateSpan = updateTemplateSpan; - function createBlock(statements, location, multiLine, flags) { - var block = createNode(204, location, flags); + function createBlock(statements, multiLine) { + var block = createSynthesizedNode(206); block.statements = createNodeArray(statements); - if (multiLine) { - block.multiLine = true; - } + if (multiLine) + block.multiLine = multiLine; return block; } ts.createBlock = createBlock; function updateBlock(node, statements) { - if (statements !== node.statements) { - return updateNode(createBlock(statements, node, node.multiLine, node.flags), node); - } - return node; + return statements !== node.statements + ? updateNode(createBlock(statements, node.multiLine), node) + : node; } ts.updateBlock = updateBlock; - function createVariableStatement(modifiers, declarationList, location, flags) { - var node = createNode(205, location, flags); + function createVariableStatement(modifiers, declarationList) { + var node = createSynthesizedNode(207); node.decorators = undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; return node; } ts.createVariableStatement = createVariableStatement; function updateVariableStatement(node, modifiers, declarationList) { - if (node.modifiers !== modifiers || node.declarationList !== declarationList) { - return updateNode(createVariableStatement(modifiers, declarationList, node, node.flags), node); - } - return node; + return node.modifiers !== modifiers + || node.declarationList !== declarationList + ? updateNode(createVariableStatement(modifiers, declarationList), node) + : node; } ts.updateVariableStatement = updateVariableStatement; - function createVariableDeclarationList(declarations, location, flags) { - var node = createNode(224, location, flags); + function createVariableDeclarationList(declarations, flags) { + var node = createSynthesizedNode(226); + node.flags |= flags; node.declarations = createNodeArray(declarations); return node; } ts.createVariableDeclarationList = createVariableDeclarationList; function updateVariableDeclarationList(node, declarations) { - if (node.declarations !== declarations) { - return updateNode(createVariableDeclarationList(declarations, node, node.flags), node); - } - return node; + return node.declarations !== declarations + ? updateNode(createVariableDeclarationList(declarations, node.flags), node) + : node; } ts.updateVariableDeclarationList = updateVariableDeclarationList; - function createVariableDeclaration(name, type, initializer, location, flags) { - var node = createNode(223, location, flags); - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createVariableDeclaration(name, type, initializer) { + var node = createSynthesizedNode(225); + node.name = asName(name); node.type = type; - node.initializer = initializer !== undefined ? parenthesizeExpressionForList(initializer) : undefined; + node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; return node; } ts.createVariableDeclaration = createVariableDeclaration; function updateVariableDeclaration(node, name, type, initializer) { - if (node.name !== name || node.type !== type || node.initializer !== initializer) { - return updateNode(createVariableDeclaration(name, type, initializer, node, node.flags), node); - } - return node; + return node.name !== name + || node.type !== type + || node.initializer !== initializer + ? updateNode(createVariableDeclaration(name, type, initializer), node) + : node; } ts.updateVariableDeclaration = updateVariableDeclaration; - function createEmptyStatement(location) { - return createNode(206, location); + function createEmptyStatement() { + return createSynthesizedNode(208); } ts.createEmptyStatement = createEmptyStatement; - function createStatement(expression, location, flags) { - var node = createNode(207, location, flags); - node.expression = parenthesizeExpressionForExpressionStatement(expression); + function createStatement(expression) { + var node = createSynthesizedNode(209); + node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } ts.createStatement = createStatement; function updateStatement(node, expression) { - if (node.expression !== expression) { - return updateNode(createStatement(expression, node, node.flags), node); - } - return node; + return node.expression !== expression + ? updateNode(createStatement(expression), node) + : node; } ts.updateStatement = updateStatement; - function createIf(expression, thenStatement, elseStatement, location) { - var node = createNode(208, location); + function createIf(expression, thenStatement, elseStatement) { + var node = createSynthesizedNode(210); node.expression = expression; node.thenStatement = thenStatement; node.elseStatement = elseStatement; @@ -11354,42 +12905,43 @@ var ts; } ts.createIf = createIf; function updateIf(node, expression, thenStatement, elseStatement) { - if (node.expression !== expression || node.thenStatement !== thenStatement || node.elseStatement !== elseStatement) { - return updateNode(createIf(expression, thenStatement, elseStatement, node), node); - } - return node; + return node.expression !== expression + || node.thenStatement !== thenStatement + || node.elseStatement !== elseStatement + ? updateNode(createIf(expression, thenStatement, elseStatement), node) + : node; } ts.updateIf = updateIf; - function createDo(statement, expression, location) { - var node = createNode(209, location); + function createDo(statement, expression) { + var node = createSynthesizedNode(211); node.statement = statement; node.expression = expression; return node; } ts.createDo = createDo; function updateDo(node, statement, expression) { - if (node.statement !== statement || node.expression !== expression) { - return updateNode(createDo(statement, expression, node), node); - } - return node; + return node.statement !== statement + || node.expression !== expression + ? updateNode(createDo(statement, expression), node) + : node; } ts.updateDo = updateDo; - function createWhile(expression, statement, location) { - var node = createNode(210, location); + function createWhile(expression, statement) { + var node = createSynthesizedNode(212); node.expression = expression; node.statement = statement; return node; } ts.createWhile = createWhile; function updateWhile(node, expression, statement) { - if (node.expression !== expression || node.statement !== statement) { - return updateNode(createWhile(expression, statement, node), node); - } - return node; + return node.expression !== expression + || node.statement !== statement + ? updateNode(createWhile(expression, statement), node) + : node; } ts.updateWhile = updateWhile; - function createFor(initializer, condition, incrementor, statement, location) { - var node = createNode(211, location, undefined); + function createFor(initializer, condition, incrementor, statement) { + var node = createSynthesizedNode(213); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -11398,14 +12950,16 @@ var ts; } ts.createFor = createFor; function updateFor(node, initializer, condition, incrementor, statement) { - if (node.initializer !== initializer || node.condition !== condition || node.incrementor !== incrementor || node.statement !== statement) { - return updateNode(createFor(initializer, condition, incrementor, statement, node), node); - } - return node; + return node.initializer !== initializer + || node.condition !== condition + || node.incrementor !== incrementor + || node.statement !== statement + ? updateNode(createFor(initializer, condition, incrementor, statement), node) + : node; } ts.updateFor = updateFor; - function createForIn(initializer, expression, statement, location) { - var node = createNode(212, location); + function createForIn(initializer, expression, statement) { + var node = createSynthesizedNode(214); node.initializer = initializer; node.expression = expression; node.statement = statement; @@ -11413,127 +12967,123 @@ var ts; } ts.createForIn = createForIn; function updateForIn(node, initializer, expression, statement) { - if (node.initializer !== initializer || node.expression !== expression || node.statement !== statement) { - return updateNode(createForIn(initializer, expression, statement, node), node); - } - return node; + return node.initializer !== initializer + || node.expression !== expression + || node.statement !== statement + ? updateNode(createForIn(initializer, expression, statement), node) + : node; } ts.updateForIn = updateForIn; - function createForOf(initializer, expression, statement, location) { - var node = createNode(213, location); + function createForOf(awaitModifier, initializer, expression, statement) { + var node = createSynthesizedNode(215); + node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = expression; node.statement = statement; return node; } ts.createForOf = createForOf; - function updateForOf(node, initializer, expression, statement) { - if (node.initializer !== initializer || node.expression !== expression || node.statement !== statement) { - return updateNode(createForOf(initializer, expression, statement, node), node); - } - return node; + function updateForOf(node, awaitModifier, initializer, expression, statement) { + return node.awaitModifier !== awaitModifier + || node.initializer !== initializer + || node.expression !== expression + || node.statement !== statement + ? updateNode(createForOf(awaitModifier, initializer, expression, statement), node) + : node; } ts.updateForOf = updateForOf; - function createContinue(label, location) { - var node = createNode(214, location); - if (label) { - node.label = label; - } + function createContinue(label) { + var node = createSynthesizedNode(216); + node.label = asName(label); return node; } ts.createContinue = createContinue; function updateContinue(node, label) { - if (node.label !== label) { - return updateNode(createContinue(label, node), node); - } - return node; + return node.label !== label + ? updateNode(createContinue(label), node) + : node; } ts.updateContinue = updateContinue; - function createBreak(label, location) { - var node = createNode(215, location); - if (label) { - node.label = label; - } + function createBreak(label) { + var node = createSynthesizedNode(217); + node.label = asName(label); return node; } ts.createBreak = createBreak; function updateBreak(node, label) { - if (node.label !== label) { - return updateNode(createBreak(label, node), node); - } - return node; + return node.label !== label + ? updateNode(createBreak(label), node) + : node; } ts.updateBreak = updateBreak; - function createReturn(expression, location) { - var node = createNode(216, location); + function createReturn(expression) { + var node = createSynthesizedNode(218); node.expression = expression; return node; } ts.createReturn = createReturn; function updateReturn(node, expression) { - if (node.expression !== expression) { - return updateNode(createReturn(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createReturn(expression), node) + : node; } ts.updateReturn = updateReturn; - function createWith(expression, statement, location) { - var node = createNode(217, location); + function createWith(expression, statement) { + var node = createSynthesizedNode(219); node.expression = expression; node.statement = statement; return node; } ts.createWith = createWith; function updateWith(node, expression, statement) { - if (node.expression !== expression || node.statement !== statement) { - return updateNode(createWith(expression, statement, node), node); - } - return node; + return node.expression !== expression + || node.statement !== statement + ? updateNode(createWith(expression, statement), node) + : node; } ts.updateWith = updateWith; - function createSwitch(expression, caseBlock, location) { - var node = createNode(218, location); - node.expression = parenthesizeExpressionForList(expression); + function createSwitch(expression, caseBlock) { + var node = createSynthesizedNode(220); + node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; } ts.createSwitch = createSwitch; function updateSwitch(node, expression, caseBlock) { - if (node.expression !== expression || node.caseBlock !== caseBlock) { - return updateNode(createSwitch(expression, caseBlock, node), node); - } - return node; + return node.expression !== expression + || node.caseBlock !== caseBlock + ? updateNode(createSwitch(expression, caseBlock), node) + : node; } ts.updateSwitch = updateSwitch; - function createLabel(label, statement, location) { - var node = createNode(219, location); - node.label = typeof label === "string" ? createIdentifier(label) : label; + function createLabel(label, statement) { + var node = createSynthesizedNode(221); + node.label = asName(label); node.statement = statement; return node; } ts.createLabel = createLabel; function updateLabel(node, label, statement) { - if (node.label !== label || node.statement !== statement) { - return updateNode(createLabel(label, statement, node), node); - } - return node; + return node.label !== label + || node.statement !== statement + ? updateNode(createLabel(label, statement), node) + : node; } ts.updateLabel = updateLabel; - function createThrow(expression, location) { - var node = createNode(220, location); + function createThrow(expression) { + var node = createSynthesizedNode(222); node.expression = expression; return node; } ts.createThrow = createThrow; function updateThrow(node, expression) { - if (node.expression !== expression) { - return updateNode(createThrow(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createThrow(expression), node) + : node; } ts.updateThrow = updateThrow; - function createTry(tryBlock, catchClause, finallyBlock, location) { - var node = createNode(221, location); + function createTry(tryBlock, catchClause, finallyBlock) { + var node = createSynthesizedNode(223); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -11541,194 +13091,284 @@ var ts; } ts.createTry = createTry; function updateTry(node, tryBlock, catchClause, finallyBlock) { - if (node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock) { - return updateNode(createTry(tryBlock, catchClause, finallyBlock, node), node); - } - return node; + return node.tryBlock !== tryBlock + || node.catchClause !== catchClause + || node.finallyBlock !== finallyBlock + ? updateNode(createTry(tryBlock, catchClause, finallyBlock), node) + : node; } ts.updateTry = updateTry; - function createCaseBlock(clauses, location) { - var node = createNode(232, location); - node.clauses = createNodeArray(clauses); - return node; - } - ts.createCaseBlock = createCaseBlock; - function updateCaseBlock(node, clauses) { - if (node.clauses !== clauses) { - return updateNode(createCaseBlock(clauses, node), node); - } - return node; - } - ts.updateCaseBlock = updateCaseBlock; - function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) { - var node = createNode(225, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + var node = createSynthesizedNode(227); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.body = body; return node; } ts.createFunctionDeclaration = createFunctionDeclaration; - function updateFunctionDeclaration(node, decorators, modifiers, name, typeParameters, parameters, type, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createFunctionDeclaration(decorators, modifiers, node.asteriskToken, name, typeParameters, parameters, type, body, node, node.flags), node); - } - return node; + function updateFunctionDeclaration(node, decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.asteriskToken !== asteriskToken + || node.name !== name + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) + : node; } ts.updateFunctionDeclaration = updateFunctionDeclaration; - function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members, location) { - var node = createNode(226, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; - node.heritageClauses = createNodeArray(heritageClauses); + function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { + var node = createSynthesizedNode(228); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); + node.heritageClauses = asNodeArray(heritageClauses); node.members = createNodeArray(members); return node; } ts.createClassDeclaration = createClassDeclaration; function updateClassDeclaration(node, decorators, modifiers, name, typeParameters, heritageClauses, members) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members) { - return updateNode(createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.typeParameters !== typeParameters + || node.heritageClauses !== heritageClauses + || node.members !== members + ? updateNode(createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members), node) + : node; } ts.updateClassDeclaration = updateClassDeclaration; - function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier, location) { - var node = createNode(235, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createEnumDeclaration(decorators, modifiers, name, members) { + var node = createSynthesizedNode(231); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.members = createNodeArray(members); + return node; + } + ts.createEnumDeclaration = createEnumDeclaration; + function updateEnumDeclaration(node, decorators, modifiers, name, members) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.members !== members + ? updateNode(createEnumDeclaration(decorators, modifiers, name, members), node) + : node; + } + ts.updateEnumDeclaration = updateEnumDeclaration; + function createModuleDeclaration(decorators, modifiers, name, body, flags) { + var node = createSynthesizedNode(232); + node.flags |= flags; + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = name; + node.body = body; + return node; + } + ts.createModuleDeclaration = createModuleDeclaration; + function updateModuleDeclaration(node, decorators, modifiers, name, body) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.body !== body + ? updateNode(createModuleDeclaration(decorators, modifiers, name, body, node.flags), node) + : node; + } + ts.updateModuleDeclaration = updateModuleDeclaration; + function createModuleBlock(statements) { + var node = createSynthesizedNode(233); + node.statements = createNodeArray(statements); + return node; + } + ts.createModuleBlock = createModuleBlock; + function updateModuleBlock(node, statements) { + return node.statements !== statements + ? updateNode(createModuleBlock(statements), node) + : node; + } + ts.updateModuleBlock = updateModuleBlock; + function createCaseBlock(clauses) { + var node = createSynthesizedNode(234); + node.clauses = createNodeArray(clauses); + return node; + } + ts.createCaseBlock = createCaseBlock; + function updateCaseBlock(node, clauses) { + return node.clauses !== clauses + ? updateNode(createCaseBlock(clauses), node) + : node; + } + ts.updateCaseBlock = updateCaseBlock; + function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { + var node = createSynthesizedNode(236); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.moduleReference = moduleReference; + return node; + } + ts.createImportEqualsDeclaration = createImportEqualsDeclaration; + function updateImportEqualsDeclaration(node, decorators, modifiers, name, moduleReference) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.moduleReference !== moduleReference + ? updateNode(createImportEqualsDeclaration(decorators, modifiers, name, moduleReference), node) + : node; + } + ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; + function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { + var node = createSynthesizedNode(237); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.importClause = importClause; node.moduleSpecifier = moduleSpecifier; return node; } ts.createImportDeclaration = createImportDeclaration; function updateImportDeclaration(node, decorators, modifiers, importClause, moduleSpecifier) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier) { - return updateNode(createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier + ? updateNode(createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier), node) + : node; } ts.updateImportDeclaration = updateImportDeclaration; - function createImportClause(name, namedBindings, location) { - var node = createNode(236, location); + function createImportClause(name, namedBindings) { + var node = createSynthesizedNode(238); node.name = name; node.namedBindings = namedBindings; return node; } ts.createImportClause = createImportClause; function updateImportClause(node, name, namedBindings) { - if (node.name !== name || node.namedBindings !== namedBindings) { - return updateNode(createImportClause(name, namedBindings, node), node); - } - return node; + return node.name !== name + || node.namedBindings !== namedBindings + ? updateNode(createImportClause(name, namedBindings), node) + : node; } ts.updateImportClause = updateImportClause; - function createNamespaceImport(name, location) { - var node = createNode(237, location); + function createNamespaceImport(name) { + var node = createSynthesizedNode(239); node.name = name; return node; } ts.createNamespaceImport = createNamespaceImport; function updateNamespaceImport(node, name) { - if (node.name !== name) { - return updateNode(createNamespaceImport(name, node), node); - } - return node; + return node.name !== name + ? updateNode(createNamespaceImport(name), node) + : node; } ts.updateNamespaceImport = updateNamespaceImport; - function createNamedImports(elements, location) { - var node = createNode(238, location); + function createNamedImports(elements) { + var node = createSynthesizedNode(240); node.elements = createNodeArray(elements); return node; } ts.createNamedImports = createNamedImports; function updateNamedImports(node, elements) { - if (node.elements !== elements) { - return updateNode(createNamedImports(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createNamedImports(elements), node) + : node; } ts.updateNamedImports = updateNamedImports; - function createImportSpecifier(propertyName, name, location) { - var node = createNode(239, location); + function createImportSpecifier(propertyName, name) { + var node = createSynthesizedNode(241); node.propertyName = propertyName; node.name = name; return node; } ts.createImportSpecifier = createImportSpecifier; function updateImportSpecifier(node, propertyName, name) { - if (node.propertyName !== propertyName || node.name !== name) { - return updateNode(createImportSpecifier(propertyName, name, node), node); - } - return node; + return node.propertyName !== propertyName + || node.name !== name + ? updateNode(createImportSpecifier(propertyName, name), node) + : node; } ts.updateImportSpecifier = updateImportSpecifier; - function createExportAssignment(decorators, modifiers, isExportEquals, expression, location) { - var node = createNode(240, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createExportAssignment(decorators, modifiers, isExportEquals, expression) { + var node = createSynthesizedNode(242); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; node.expression = expression; return node; } ts.createExportAssignment = createExportAssignment; function updateExportAssignment(node, decorators, modifiers, expression) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.expression !== expression) { - return updateNode(createExportAssignment(decorators, modifiers, node.isExportEquals, expression, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.expression !== expression + ? updateNode(createExportAssignment(decorators, modifiers, node.isExportEquals, expression), node) + : node; } ts.updateExportAssignment = updateExportAssignment; - function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, location) { - var node = createNode(241, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier) { + var node = createSynthesizedNode(243); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.exportClause = exportClause; node.moduleSpecifier = moduleSpecifier; return node; } ts.createExportDeclaration = createExportDeclaration; function updateExportDeclaration(node, decorators, modifiers, exportClause, moduleSpecifier) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier) { - return updateNode(createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.exportClause !== exportClause + || node.moduleSpecifier !== moduleSpecifier + ? updateNode(createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier), node) + : node; } ts.updateExportDeclaration = updateExportDeclaration; - function createNamedExports(elements, location) { - var node = createNode(242, location); + function createNamedExports(elements) { + var node = createSynthesizedNode(244); node.elements = createNodeArray(elements); return node; } ts.createNamedExports = createNamedExports; function updateNamedExports(node, elements) { - if (node.elements !== elements) { - return updateNode(createNamedExports(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createNamedExports(elements), node) + : node; } ts.updateNamedExports = updateNamedExports; - function createExportSpecifier(name, propertyName, location) { - var node = createNode(243, location); - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.propertyName = typeof propertyName === "string" ? createIdentifier(propertyName) : propertyName; + function createExportSpecifier(propertyName, name) { + var node = createSynthesizedNode(245); + node.propertyName = asName(propertyName); + node.name = asName(name); return node; } ts.createExportSpecifier = createExportSpecifier; - function updateExportSpecifier(node, name, propertyName) { - if (node.name !== name || node.propertyName !== propertyName) { - return updateNode(createExportSpecifier(name, propertyName, node), node); - } - return node; + function updateExportSpecifier(node, propertyName, name) { + return node.propertyName !== propertyName + || node.name !== name + ? updateNode(createExportSpecifier(propertyName, name), node) + : node; } ts.updateExportSpecifier = updateExportSpecifier; - function createJsxElement(openingElement, children, closingElement, location) { - var node = createNode(246, location); + function createExternalModuleReference(expression) { + var node = createSynthesizedNode(247); + node.expression = expression; + return node; + } + ts.createExternalModuleReference = createExternalModuleReference; + function updateExternalModuleReference(node, expression) { + return node.expression !== expression + ? updateNode(createExternalModuleReference(expression), node) + : node; + } + ts.updateExternalModuleReference = updateExternalModuleReference; + function createJsxElement(openingElement, children, closingElement) { + var node = createSynthesizedNode(248); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -11736,95 +13376,107 @@ var ts; } ts.createJsxElement = createJsxElement; function updateJsxElement(node, openingElement, children, closingElement) { - if (node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement) { - return updateNode(createJsxElement(openingElement, children, closingElement, node), node); - } - return node; + return node.openingElement !== openingElement + || node.children !== children + || node.closingElement !== closingElement + ? updateNode(createJsxElement(openingElement, children, closingElement), node) + : node; } ts.updateJsxElement = updateJsxElement; - function createJsxSelfClosingElement(tagName, attributes, location) { - var node = createNode(247, location); + function createJsxSelfClosingElement(tagName, attributes) { + var node = createSynthesizedNode(249); node.tagName = tagName; - node.attributes = createNodeArray(attributes); + node.attributes = attributes; return node; } ts.createJsxSelfClosingElement = createJsxSelfClosingElement; function updateJsxSelfClosingElement(node, tagName, attributes) { - if (node.tagName !== tagName || node.attributes !== attributes) { - return updateNode(createJsxSelfClosingElement(tagName, attributes, node), node); - } - return node; + return node.tagName !== tagName + || node.attributes !== attributes + ? updateNode(createJsxSelfClosingElement(tagName, attributes), node) + : node; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; - function createJsxOpeningElement(tagName, attributes, location) { - var node = createNode(248, location); + function createJsxOpeningElement(tagName, attributes) { + var node = createSynthesizedNode(250); node.tagName = tagName; - node.attributes = createNodeArray(attributes); + node.attributes = attributes; return node; } ts.createJsxOpeningElement = createJsxOpeningElement; function updateJsxOpeningElement(node, tagName, attributes) { - if (node.tagName !== tagName || node.attributes !== attributes) { - return updateNode(createJsxOpeningElement(tagName, attributes, node), node); - } - return node; + return node.tagName !== tagName + || node.attributes !== attributes + ? updateNode(createJsxOpeningElement(tagName, attributes), node) + : node; } ts.updateJsxOpeningElement = updateJsxOpeningElement; - function createJsxClosingElement(tagName, location) { - var node = createNode(249, location); + function createJsxClosingElement(tagName) { + var node = createSynthesizedNode(251); node.tagName = tagName; return node; } ts.createJsxClosingElement = createJsxClosingElement; function updateJsxClosingElement(node, tagName) { - if (node.tagName !== tagName) { - return updateNode(createJsxClosingElement(tagName, node), node); - } - return node; + return node.tagName !== tagName + ? updateNode(createJsxClosingElement(tagName), node) + : node; } ts.updateJsxClosingElement = updateJsxClosingElement; - function createJsxAttribute(name, initializer, location) { - var node = createNode(250, location); + function createJsxAttributes(properties) { + var jsxAttributes = createSynthesizedNode(253); + jsxAttributes.properties = createNodeArray(properties); + return jsxAttributes; + } + ts.createJsxAttributes = createJsxAttributes; + function updateJsxAttributes(jsxAttributes, properties) { + if (jsxAttributes.properties !== properties) { + return updateNode(createJsxAttributes(properties), jsxAttributes); + } + return jsxAttributes; + } + ts.updateJsxAttributes = updateJsxAttributes; + function createJsxAttribute(name, initializer) { + var node = createSynthesizedNode(252); node.name = name; node.initializer = initializer; return node; } ts.createJsxAttribute = createJsxAttribute; function updateJsxAttribute(node, name, initializer) { - if (node.name !== name || node.initializer !== initializer) { - return updateNode(createJsxAttribute(name, initializer, node), node); - } - return node; + return node.name !== name + || node.initializer !== initializer + ? updateNode(createJsxAttribute(name, initializer), node) + : node; } ts.updateJsxAttribute = updateJsxAttribute; - function createJsxSpreadAttribute(expression, location) { - var node = createNode(251, location); + function createJsxSpreadAttribute(expression) { + var node = createSynthesizedNode(254); node.expression = expression; return node; } ts.createJsxSpreadAttribute = createJsxSpreadAttribute; function updateJsxSpreadAttribute(node, expression) { - if (node.expression !== expression) { - return updateNode(createJsxSpreadAttribute(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createJsxSpreadAttribute(expression), node) + : node; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; - function createJsxExpression(expression, location) { - var node = createNode(252, location); + function createJsxExpression(dotDotDotToken, expression) { + var node = createSynthesizedNode(255); + node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; } ts.createJsxExpression = createJsxExpression; function updateJsxExpression(node, expression) { - if (node.expression !== expression) { - return updateNode(createJsxExpression(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createJsxExpression(node.dotDotDotToken, expression), node) + : node; } ts.updateJsxExpression = updateJsxExpression; - function createHeritageClause(token, types, location) { - var node = createNode(255, location); + function createHeritageClause(token, types) { + var node = createSynthesizedNode(258); node.token = token; node.types = createNodeArray(types); return node; @@ -11832,40 +13484,40 @@ var ts; ts.createHeritageClause = createHeritageClause; function updateHeritageClause(node, types) { if (node.types !== types) { - return updateNode(createHeritageClause(node.token, types, node), node); + return updateNode(createHeritageClause(node.token, types), node); } return node; } ts.updateHeritageClause = updateHeritageClause; - function createCaseClause(expression, statements, location) { - var node = createNode(253, location); - node.expression = parenthesizeExpressionForList(expression); + function createCaseClause(expression, statements) { + var node = createSynthesizedNode(256); + node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; } ts.createCaseClause = createCaseClause; function updateCaseClause(node, expression, statements) { if (node.expression !== expression || node.statements !== statements) { - return updateNode(createCaseClause(expression, statements, node), node); + return updateNode(createCaseClause(expression, statements), node); } return node; } ts.updateCaseClause = updateCaseClause; - function createDefaultClause(statements, location) { - var node = createNode(254, location); + function createDefaultClause(statements) { + var node = createSynthesizedNode(257); node.statements = createNodeArray(statements); return node; } ts.createDefaultClause = createDefaultClause; function updateDefaultClause(node, statements) { if (node.statements !== statements) { - return updateNode(createDefaultClause(statements, node), node); + return updateNode(createDefaultClause(statements), node); } return node; } ts.updateDefaultClause = updateDefaultClause; - function createCatchClause(variableDeclaration, block, location) { - var node = createNode(256, location); + function createCatchClause(variableDeclaration, block) { + var node = createSynthesizedNode(259); node.variableDeclaration = typeof variableDeclaration === "string" ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -11873,56 +13525,71 @@ var ts; ts.createCatchClause = createCatchClause; function updateCatchClause(node, variableDeclaration, block) { if (node.variableDeclaration !== variableDeclaration || node.block !== block) { - return updateNode(createCatchClause(variableDeclaration, block, node), node); + return updateNode(createCatchClause(variableDeclaration, block), node); } return node; } ts.updateCatchClause = updateCatchClause; - function createPropertyAssignment(name, initializer, location) { - var node = createNode(257, location); - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createPropertyAssignment(name, initializer) { + var node = createSynthesizedNode(260); + node.name = asName(name); node.questionToken = undefined; - node.initializer = initializer !== undefined ? parenthesizeExpressionForList(initializer) : undefined; + node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; return node; } ts.createPropertyAssignment = createPropertyAssignment; function updatePropertyAssignment(node, name, initializer) { if (node.name !== name || node.initializer !== initializer) { - return updateNode(createPropertyAssignment(name, initializer, node), node); + return updateNode(createPropertyAssignment(name, initializer), node); } return node; } ts.updatePropertyAssignment = updatePropertyAssignment; - function createShorthandPropertyAssignment(name, objectAssignmentInitializer, location) { - var node = createNode(258, location); - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; + function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { + var node = createSynthesizedNode(261); + node.name = asName(name); + node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; } ts.createShorthandPropertyAssignment = createShorthandPropertyAssignment; - function createSpreadAssignment(expression, location) { - var node = createNode(259, location); - node.expression = expression !== undefined ? parenthesizeExpressionForList(expression) : undefined; - return node; - } - ts.createSpreadAssignment = createSpreadAssignment; function updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer) { if (node.name !== name || node.objectAssignmentInitializer !== objectAssignmentInitializer) { - return updateNode(createShorthandPropertyAssignment(name, objectAssignmentInitializer, node), node); + return updateNode(createShorthandPropertyAssignment(name, objectAssignmentInitializer), node); } return node; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; + function createSpreadAssignment(expression) { + var node = createSynthesizedNode(262); + node.expression = expression !== undefined ? ts.parenthesizeExpressionForList(expression) : undefined; + return node; + } + ts.createSpreadAssignment = createSpreadAssignment; function updateSpreadAssignment(node, expression) { if (node.expression !== expression) { - return updateNode(createSpreadAssignment(expression, node), node); + return updateNode(createSpreadAssignment(expression), node); } return node; } ts.updateSpreadAssignment = updateSpreadAssignment; + function createEnumMember(name, initializer) { + var node = createSynthesizedNode(263); + node.name = asName(name); + node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); + return node; + } + ts.createEnumMember = createEnumMember; + function updateEnumMember(node, name, initializer) { + return node.name !== name + || node.initializer !== initializer + ? updateNode(createEnumMember(name, initializer), node) + : node; + } + ts.updateEnumMember = updateEnumMember; function updateSourceFileNode(node, statements) { if (node.statements !== statements) { - var updated = createNode(261, node, node.flags); + var updated = createSynthesizedNode(264); + updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; updated.fileName = node.fileName; @@ -11981,56 +13648,73 @@ var ts; return node; } ts.updateSourceFileNode = updateSourceFileNode; + function getMutableClone(node) { + var clone = getSynthesizedClone(node); + clone.pos = node.pos; + clone.end = node.end; + clone.parent = node.parent; + return clone; + } + ts.getMutableClone = getMutableClone; function createNotEmittedStatement(original) { - var node = createNode(293, original); + var node = createSynthesizedNode(294); node.original = original; + setTextRange(node, original); return node; } ts.createNotEmittedStatement = createNotEmittedStatement; function createEndOfDeclarationMarker(original) { - var node = createNode(296); + var node = createSynthesizedNode(297); node.emitNode = {}; node.original = original; return node; } ts.createEndOfDeclarationMarker = createEndOfDeclarationMarker; function createMergeDeclarationMarker(original) { - var node = createNode(295); + var node = createSynthesizedNode(296); node.emitNode = {}; node.original = original; return node; } ts.createMergeDeclarationMarker = createMergeDeclarationMarker; - function createPartiallyEmittedExpression(expression, original, location) { - var node = createNode(294, location || original); + function createPartiallyEmittedExpression(expression, original) { + var node = createSynthesizedNode(295); node.expression = expression; node.original = original; + setTextRange(node, original); return node; } ts.createPartiallyEmittedExpression = createPartiallyEmittedExpression; function updatePartiallyEmittedExpression(node, expression) { if (node.expression !== expression) { - return updateNode(createPartiallyEmittedExpression(expression, node.original, node), node); + return updateNode(createPartiallyEmittedExpression(expression, node.original), node); } return node; } ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; - function createRawExpression(text) { - var node = createNode(297); - node.text = text; + function createBundle(sourceFiles) { + var node = ts.createNode(265); + node.sourceFiles = sourceFiles; return node; } - ts.createRawExpression = createRawExpression; + ts.createBundle = createBundle; + function updateBundle(node, sourceFiles) { + if (node.sourceFiles !== sourceFiles) { + return createBundle(sourceFiles); + } + return node; + } + ts.updateBundle = updateBundle; function createComma(left, right) { return createBinary(left, 25, right); } ts.createComma = createComma; - function createLessThan(left, right, location) { - return createBinary(left, 26, right, location); + function createLessThan(left, right) { + return createBinary(left, 26, right); } ts.createLessThan = createLessThan; - function createAssignment(left, right, location) { - return createBinary(left, 57, right, location); + function createAssignment(left, right) { + return createBinary(left, 57, right); } ts.createAssignment = createAssignment; function createStrictEquality(left, right) { @@ -12049,8 +13733,8 @@ var ts; return createBinary(left, 37, right); } ts.createSubtract = createSubtract; - function createPostfixIncrement(operand, location) { - return createPostfix(operand, 42, location); + function createPostfixIncrement(operand) { + return createPostfix(operand, 42); } ts.createPostfixIncrement = createPostfixIncrement; function createLogicalAnd(left, right) { @@ -12069,672 +13753,25 @@ var ts; return createVoid(createLiteral(0)); } ts.createVoidZero = createVoidZero; - function createTypeCheck(value, tag) { - return tag === "undefined" - ? createStrictEquality(value, createVoidZero()) - : createStrictEquality(createTypeOf(value), createLiteral(tag)); - } - ts.createTypeCheck = createTypeCheck; - function createMemberAccessForPropertyName(target, memberName, location) { - if (ts.isComputedPropertyName(memberName)) { - return createElementAccess(target, memberName.expression, location); - } - else { - var expression = ts.isIdentifier(memberName) ? createPropertyAccess(target, memberName, location) : createElementAccess(target, memberName, location); - (expression.emitNode || (expression.emitNode = {})).flags |= 64; - return expression; - } - } - ts.createMemberAccessForPropertyName = createMemberAccessForPropertyName; - function createFunctionCall(func, thisArg, argumentsList, location) { - return createCall(createPropertyAccess(func, "call"), undefined, [ - thisArg - ].concat(argumentsList), location); - } - ts.createFunctionCall = createFunctionCall; - function createFunctionApply(func, thisArg, argumentsExpression, location) { - return createCall(createPropertyAccess(func, "apply"), undefined, [ - thisArg, - argumentsExpression - ], location); - } - ts.createFunctionApply = createFunctionApply; - function createArraySlice(array, start) { - var argumentsList = []; - if (start !== undefined) { - argumentsList.push(typeof start === "number" ? createLiteral(start) : start); - } - return createCall(createPropertyAccess(array, "slice"), undefined, argumentsList); - } - ts.createArraySlice = createArraySlice; - function createArrayConcat(array, values) { - return createCall(createPropertyAccess(array, "concat"), undefined, values); - } - ts.createArrayConcat = createArrayConcat; - function createMathPow(left, right, location) { - return createCall(createPropertyAccess(createIdentifier("Math"), "pow"), undefined, [left, right], location); - } - ts.createMathPow = createMathPow; - function createReactNamespace(reactNamespace, parent) { - var react = createIdentifier(reactNamespace || "React"); - react.flags &= ~8; - react.parent = ts.getParseTreeNode(parent); - return react; - } - function createJsxFactoryExpressionFromEntityName(jsxFactory, parent) { - if (ts.isQualifiedName(jsxFactory)) { - var left = createJsxFactoryExpressionFromEntityName(jsxFactory.left, parent); - var right = createSynthesizedNode(70); - right.text = jsxFactory.right.text; - return createPropertyAccess(left, right); - } - else { - return createReactNamespace(jsxFactory.text, parent); - } - } - function createJsxFactoryExpression(jsxFactoryEntity, reactNamespace, parent) { - return jsxFactoryEntity ? - createJsxFactoryExpressionFromEntityName(jsxFactoryEntity, parent) : - createPropertyAccess(createReactNamespace(reactNamespace, parent), "createElement"); - } - function createExpressionForJsxElement(jsxFactoryEntity, reactNamespace, tagName, props, children, parentElement, location) { - var argumentsList = [tagName]; - if (props) { - argumentsList.push(props); - } - if (children && children.length > 0) { - if (!props) { - argumentsList.push(createNull()); - } - if (children.length > 1) { - for (var _i = 0, children_1 = children; _i < children_1.length; _i++) { - var child = children_1[_i]; - child.startsOnNewLine = true; - argumentsList.push(child); - } - } - else { - argumentsList.push(children[0]); - } - } - return createCall(createJsxFactoryExpression(jsxFactoryEntity, reactNamespace, parentElement), undefined, argumentsList, location); - } - ts.createExpressionForJsxElement = createExpressionForJsxElement; function createExportDefault(expression) { return createExportAssignment(undefined, undefined, false, expression); } ts.createExportDefault = createExportDefault; function createExternalModuleExport(exportName) { - return createExportDeclaration(undefined, undefined, createNamedExports([createExportSpecifier(exportName)])); + return createExportDeclaration(undefined, undefined, createNamedExports([createExportSpecifier(undefined, exportName)])); } ts.createExternalModuleExport = createExternalModuleExport; - function createLetStatement(name, initializer, location) { - return createVariableStatement(undefined, createLetDeclarationList([createVariableDeclaration(name, undefined, initializer)]), location); + function asName(name) { + return typeof name === "string" ? createIdentifier(name) : name; } - ts.createLetStatement = createLetStatement; - function createLetDeclarationList(declarations, location) { - return createVariableDeclarationList(declarations, location, 1); + function asExpression(value) { + return typeof value === "string" || typeof value === "number" ? createLiteral(value) : value; } - ts.createLetDeclarationList = createLetDeclarationList; - function createConstDeclarationList(declarations, location) { - return createVariableDeclarationList(declarations, location, 2); + function asNodeArray(array) { + return array ? createNodeArray(array) : undefined; } - ts.createConstDeclarationList = createConstDeclarationList; - function getHelperName(name) { - return setEmitFlags(createIdentifier(name), 4096 | 2); - } - ts.getHelperName = getHelperName; - function shouldBeCapturedInTempVariable(node, cacheIdentifiers) { - var target = skipParentheses(node); - switch (target.kind) { - case 70: - return cacheIdentifiers; - case 98: - case 8: - case 9: - return false; - case 175: - var elements = target.elements; - if (elements.length === 0) { - return false; - } - return true; - case 176: - return target.properties.length > 0; - default: - return true; - } - } - function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers) { - var callee = skipOuterExpressions(expression, 7); - var thisArg; - var target; - if (ts.isSuperProperty(callee)) { - thisArg = createThis(); - target = callee; - } - else if (callee.kind === 96) { - thisArg = createThis(); - target = languageVersion < 2 ? createIdentifier("_super", callee) : callee; - } - else { - switch (callee.kind) { - case 177: { - if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { - thisArg = createTempVariable(recordTempVariable); - target = createPropertyAccess(createAssignment(thisArg, callee.expression, callee.expression), callee.name, callee); - } - else { - thisArg = callee.expression; - target = callee; - } - break; - } - case 178: { - if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { - thisArg = createTempVariable(recordTempVariable); - target = createElementAccess(createAssignment(thisArg, callee.expression, callee.expression), callee.argumentExpression, callee); - } - else { - thisArg = callee.expression; - target = callee; - } - break; - } - default: { - thisArg = createVoidZero(); - target = parenthesizeForAccess(expression); - break; - } - } - } - return { target: target, thisArg: thisArg }; - } - ts.createCallBinding = createCallBinding; - function inlineExpressions(expressions) { - return ts.reduceLeft(expressions, createComma); - } - ts.inlineExpressions = inlineExpressions; - function createExpressionFromEntityName(node) { - if (ts.isQualifiedName(node)) { - var left = createExpressionFromEntityName(node.left); - var right = getMutableClone(node.right); - return createPropertyAccess(left, right, node); - } - else { - return getMutableClone(node); - } - } - ts.createExpressionFromEntityName = createExpressionFromEntityName; - function createExpressionForPropertyName(memberName) { - if (ts.isIdentifier(memberName)) { - return createLiteral(memberName, undefined); - } - else if (ts.isComputedPropertyName(memberName)) { - return getMutableClone(memberName.expression); - } - else { - return getMutableClone(memberName); - } - } - ts.createExpressionForPropertyName = createExpressionForPropertyName; - function createExpressionForObjectLiteralElementLike(node, property, receiver) { - switch (property.kind) { - case 151: - case 152: - return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine); - case 257: - return createExpressionForPropertyAssignment(property, receiver); - case 258: - return createExpressionForShorthandPropertyAssignment(property, receiver); - case 149: - return createExpressionForMethodDeclaration(property, receiver); - } - } - ts.createExpressionForObjectLiteralElementLike = createExpressionForObjectLiteralElementLike; - function createExpressionForAccessorDeclaration(properties, property, receiver, multiLine) { - var _a = ts.getAllAccessorDeclarations(properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; - if (property === firstAccessor) { - var properties_1 = []; - if (getAccessor) { - var getterFunction = createFunctionExpression(getAccessor.modifiers, undefined, undefined, undefined, getAccessor.parameters, undefined, getAccessor.body, getAccessor); - setOriginalNode(getterFunction, getAccessor); - var getter = createPropertyAssignment("get", getterFunction); - properties_1.push(getter); - } - if (setAccessor) { - var setterFunction = createFunctionExpression(setAccessor.modifiers, undefined, undefined, undefined, setAccessor.parameters, undefined, setAccessor.body, setAccessor); - setOriginalNode(setterFunction, setAccessor); - var setter = createPropertyAssignment("set", setterFunction); - properties_1.push(setter); - } - properties_1.push(createPropertyAssignment("enumerable", createLiteral(true))); - properties_1.push(createPropertyAssignment("configurable", createLiteral(true))); - var expression = createCall(createPropertyAccess(createIdentifier("Object"), "defineProperty"), undefined, [ - receiver, - createExpressionForPropertyName(property.name), - createObjectLiteral(properties_1, undefined, multiLine) - ], firstAccessor); - return ts.aggregateTransformFlags(expression); - } - return undefined; - } - function createExpressionForPropertyAssignment(property, receiver) { - return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, property.name, property.name), property.initializer, property), property)); - } - function createExpressionForShorthandPropertyAssignment(property, receiver) { - return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, property.name, property.name), getSynthesizedClone(property.name), property), property)); - } - function createExpressionForMethodDeclaration(method, receiver) { - return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, method.name, method.name), setOriginalNode(createFunctionExpression(method.modifiers, method.asteriskToken, undefined, undefined, method.parameters, undefined, method.body, method), method), method), method)); - } - function getLocalName(node, allowComments, allowSourceMaps) { - return getName(node, allowComments, allowSourceMaps, 16384); - } - ts.getLocalName = getLocalName; - function isLocalName(node) { - return (getEmitFlags(node) & 16384) !== 0; - } - ts.isLocalName = isLocalName; - function getExportName(node, allowComments, allowSourceMaps) { - return getName(node, allowComments, allowSourceMaps, 8192); - } - ts.getExportName = getExportName; - function isExportName(node) { - return (getEmitFlags(node) & 8192) !== 0; - } - ts.isExportName = isExportName; - function getDeclarationName(node, allowComments, allowSourceMaps) { - return getName(node, allowComments, allowSourceMaps); - } - ts.getDeclarationName = getDeclarationName; - function getName(node, allowComments, allowSourceMaps, emitFlags) { - if (node.name && ts.isIdentifier(node.name) && !ts.isGeneratedIdentifier(node.name)) { - var name_10 = getMutableClone(node.name); - emitFlags |= getEmitFlags(node.name); - if (!allowSourceMaps) - emitFlags |= 48; - if (!allowComments) - emitFlags |= 1536; - if (emitFlags) - setEmitFlags(name_10, emitFlags); - return name_10; - } - return getGeneratedNameForNode(node); - } - function getExternalModuleOrNamespaceExportName(ns, node, allowComments, allowSourceMaps) { - if (ns && ts.hasModifier(node, 1)) { - return getNamespaceMemberName(ns, getName(node), allowComments, allowSourceMaps); - } - return getExportName(node, allowComments, allowSourceMaps); - } - ts.getExternalModuleOrNamespaceExportName = getExternalModuleOrNamespaceExportName; - function getNamespaceMemberName(ns, name, allowComments, allowSourceMaps) { - var qualifiedName = createPropertyAccess(ns, ts.nodeIsSynthesized(name) ? name : getSynthesizedClone(name), name); - var emitFlags; - if (!allowSourceMaps) - emitFlags |= 48; - if (!allowComments) - emitFlags |= 1536; - if (emitFlags) - setEmitFlags(qualifiedName, emitFlags); - return qualifiedName; - } - ts.getNamespaceMemberName = getNamespaceMemberName; - function convertToFunctionBody(node, multiLine) { - return ts.isBlock(node) ? node : createBlock([createReturn(node, node)], node, multiLine); - } - ts.convertToFunctionBody = convertToFunctionBody; - function isUseStrictPrologue(node) { - return node.expression.text === "use strict"; - } - function addPrologueDirectives(target, source, ensureUseStrict, visitor) { - ts.Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array"); - var foundUseStrict = false; - var statementOffset = 0; - var numStatements = source.length; - while (statementOffset < numStatements) { - var statement = source[statementOffset]; - if (ts.isPrologueDirective(statement)) { - if (isUseStrictPrologue(statement)) { - foundUseStrict = true; - } - target.push(statement); - } - else { - break; - } - statementOffset++; - } - if (ensureUseStrict && !foundUseStrict) { - target.push(startOnNewLine(createStatement(createLiteral("use strict")))); - } - while (statementOffset < numStatements) { - var statement = source[statementOffset]; - if (getEmitFlags(statement) & 524288) { - target.push(visitor ? ts.visitNode(statement, visitor, ts.isStatement) : statement); - } - else { - break; - } - statementOffset++; - } - return statementOffset; - } - ts.addPrologueDirectives = addPrologueDirectives; - function startsWithUseStrict(statements) { - var firstStatement = ts.firstOrUndefined(statements); - return firstStatement !== undefined - && ts.isPrologueDirective(firstStatement) - && isUseStrictPrologue(firstStatement); - } - ts.startsWithUseStrict = startsWithUseStrict; - function ensureUseStrict(statements) { - var foundUseStrict = false; - for (var _i = 0, statements_1 = statements; _i < statements_1.length; _i++) { - var statement = statements_1[_i]; - if (ts.isPrologueDirective(statement)) { - if (isUseStrictPrologue(statement)) { - foundUseStrict = true; - break; - } - } - else { - break; - } - } - if (!foundUseStrict) { - return createNodeArray([ - startOnNewLine(createStatement(createLiteral("use strict"))) - ].concat(statements), statements); - } - return statements; - } - ts.ensureUseStrict = ensureUseStrict; - function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { - var skipped = skipPartiallyEmittedExpressions(operand); - if (skipped.kind === 183) { - return operand; - } - return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) - ? createParen(operand) - : operand; - } - ts.parenthesizeBinaryOperand = parenthesizeBinaryOperand; - function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { - var binaryOperatorPrecedence = ts.getOperatorPrecedence(192, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(192, binaryOperator); - var emittedOperand = skipPartiallyEmittedExpressions(operand); - var operandPrecedence = ts.getExpressionPrecedence(emittedOperand); - switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) { - case -1: - if (!isLeftSideOfBinary - && binaryOperatorAssociativity === 1 - && operand.kind === 195) { - return false; - } - return true; - case 1: - return false; - case 0: - if (isLeftSideOfBinary) { - return binaryOperatorAssociativity === 1; - } - else { - if (ts.isBinaryExpression(emittedOperand) - && emittedOperand.operatorToken.kind === binaryOperator) { - if (operatorHasAssociativeProperty(binaryOperator)) { - return false; - } - if (binaryOperator === 36) { - var leftKind = leftOperand ? getLiteralKindOfBinaryPlusOperand(leftOperand) : 0; - if (ts.isLiteralKind(leftKind) && leftKind === getLiteralKindOfBinaryPlusOperand(emittedOperand)) { - return false; - } - } - } - var operandAssociativity = ts.getExpressionAssociativity(emittedOperand); - return operandAssociativity === 0; - } - } - } - function operatorHasAssociativeProperty(binaryOperator) { - return binaryOperator === 38 - || binaryOperator === 48 - || binaryOperator === 47 - || binaryOperator === 49; - } - function getLiteralKindOfBinaryPlusOperand(node) { - node = skipPartiallyEmittedExpressions(node); - if (ts.isLiteralKind(node.kind)) { - return node.kind; - } - if (node.kind === 192 && node.operatorToken.kind === 36) { - if (node.cachedLiteralKind !== undefined) { - return node.cachedLiteralKind; - } - var leftKind = getLiteralKindOfBinaryPlusOperand(node.left); - var literalKind = ts.isLiteralKind(leftKind) - && leftKind === getLiteralKindOfBinaryPlusOperand(node.right) - ? leftKind - : 0; - node.cachedLiteralKind = literalKind; - return literalKind; - } - return 0; - } - function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(193, 54); - var emittedCondition = skipPartiallyEmittedExpressions(condition); - var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); - if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1) { - return createParen(condition); - } - return condition; - } - ts.parenthesizeForConditionalHead = parenthesizeForConditionalHead; - function parenthesizeSubexpressionOfConditionalExpression(e) { - return e.kind === 192 && e.operatorToken.kind === 25 - ? createParen(e) - : e; - } - function parenthesizeForNew(expression) { - var emittedExpression = skipPartiallyEmittedExpressions(expression); - switch (emittedExpression.kind) { - case 179: - return createParen(expression); - case 180: - return emittedExpression.arguments - ? expression - : createParen(expression); - } - return parenthesizeForAccess(expression); - } - ts.parenthesizeForNew = parenthesizeForNew; - function parenthesizeForAccess(expression) { - var emittedExpression = skipPartiallyEmittedExpressions(expression); - if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 180 || emittedExpression.arguments) - && emittedExpression.kind !== 8) { - return expression; - } - return createParen(expression, expression); - } - ts.parenthesizeForAccess = parenthesizeForAccess; - function parenthesizePostfixOperand(operand) { - return ts.isLeftHandSideExpression(operand) - ? operand - : createParen(operand, operand); - } - ts.parenthesizePostfixOperand = parenthesizePostfixOperand; - function parenthesizePrefixOperand(operand) { - return ts.isUnaryExpression(operand) - ? operand - : createParen(operand, operand); - } - ts.parenthesizePrefixOperand = parenthesizePrefixOperand; - function parenthesizeListElements(elements) { - var result; - for (var i = 0; i < elements.length; i++) { - var element = parenthesizeExpressionForList(elements[i]); - if (result !== undefined || element !== elements[i]) { - if (result === undefined) { - result = elements.slice(0, i); - } - result.push(element); - } - } - if (result !== undefined) { - return createNodeArray(result, elements, elements.hasTrailingComma); - } - return elements; - } - function parenthesizeExpressionForList(expression) { - var emittedExpression = skipPartiallyEmittedExpressions(expression); - var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(192, 25); - return expressionPrecedence > commaPrecedence - ? expression - : createParen(expression, expression); - } - ts.parenthesizeExpressionForList = parenthesizeExpressionForList; - function parenthesizeExpressionForExpressionStatement(expression) { - var emittedExpression = skipPartiallyEmittedExpressions(expression); - if (ts.isCallExpression(emittedExpression)) { - var callee = emittedExpression.expression; - var kind = skipPartiallyEmittedExpressions(callee).kind; - if (kind === 184 || kind === 185) { - var mutableCall = getMutableClone(emittedExpression); - mutableCall.expression = createParen(callee, callee); - return recreatePartiallyEmittedExpressions(expression, mutableCall); - } - } - else { - var leftmostExpressionKind = getLeftmostExpression(emittedExpression).kind; - if (leftmostExpressionKind === 176 || leftmostExpressionKind === 184) { - return createParen(expression, expression); - } - } - return expression; - } - ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; - function recreatePartiallyEmittedExpressions(originalOuterExpression, newInnerExpression) { - if (ts.isPartiallyEmittedExpression(originalOuterExpression)) { - var clone_1 = getMutableClone(originalOuterExpression); - clone_1.expression = recreatePartiallyEmittedExpressions(clone_1.expression, newInnerExpression); - return clone_1; - } - return newInnerExpression; - } - function getLeftmostExpression(node) { - while (true) { - switch (node.kind) { - case 191: - node = node.operand; - continue; - case 192: - node = node.left; - continue; - case 193: - node = node.condition; - continue; - case 179: - case 178: - case 177: - node = node.expression; - continue; - case 294: - node = node.expression; - continue; - } - return node; - } - } - function parenthesizeConciseBody(body) { - var emittedBody = skipPartiallyEmittedExpressions(body); - if (emittedBody.kind === 176) { - return createParen(body, body); - } - return body; - } - ts.parenthesizeConciseBody = parenthesizeConciseBody; - function skipOuterExpressions(node, kinds) { - if (kinds === void 0) { kinds = 7; } - var previousNode; - do { - previousNode = node; - if (kinds & 1) { - node = skipParentheses(node); - } - if (kinds & 2) { - node = skipAssertions(node); - } - if (kinds & 4) { - node = skipPartiallyEmittedExpressions(node); - } - } while (previousNode !== node); - return node; - } - ts.skipOuterExpressions = skipOuterExpressions; - function skipParentheses(node) { - while (node.kind === 183) { - node = node.expression; - } - return node; - } - ts.skipParentheses = skipParentheses; - function skipAssertions(node) { - while (ts.isAssertionExpression(node)) { - node = node.expression; - } - return node; - } - ts.skipAssertions = skipAssertions; - function skipPartiallyEmittedExpressions(node) { - while (node.kind === 294) { - node = node.expression; - } - return node; - } - ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; - function startOnNewLine(node) { - node.startsOnNewLine = true; - return node; - } - ts.startOnNewLine = startOnNewLine; - function setOriginalNode(node, original) { - node.original = original; - if (original) { - var emitNode = original.emitNode; - if (emitNode) - node.emitNode = mergeEmitNode(emitNode, node.emitNode); - } - return node; - } - ts.setOriginalNode = setOriginalNode; - function mergeEmitNode(sourceEmitNode, destEmitNode) { - var flags = sourceEmitNode.flags, commentRange = sourceEmitNode.commentRange, sourceMapRange = sourceEmitNode.sourceMapRange, tokenSourceMapRanges = sourceEmitNode.tokenSourceMapRanges, constantValue = sourceEmitNode.constantValue, helpers = sourceEmitNode.helpers; - if (!destEmitNode) - destEmitNode = {}; - if (flags) - destEmitNode.flags = flags; - if (commentRange) - destEmitNode.commentRange = commentRange; - if (sourceMapRange) - destEmitNode.sourceMapRange = sourceMapRange; - if (tokenSourceMapRanges) - destEmitNode.tokenSourceMapRanges = mergeTokenSourceMapRanges(tokenSourceMapRanges, destEmitNode.tokenSourceMapRanges); - if (constantValue !== undefined) - destEmitNode.constantValue = constantValue; - if (helpers) - destEmitNode.helpers = ts.addRange(destEmitNode.helpers, helpers); - return destEmitNode; - } - function mergeTokenSourceMapRanges(sourceRanges, destRanges) { - if (!destRanges) - destRanges = ts.createMap(); - ts.copyProperties(sourceRanges, destRanges); - return destRanges; + function asToken(value) { + return typeof value === "number" ? createToken(value) : value; } function disposeEmitNodes(sourceFile) { sourceFile = ts.getSourceFileOfNode(ts.getParseTreeNode(sourceFile)); @@ -12751,7 +13788,7 @@ var ts; function getOrCreateEmitNode(node) { if (!node.emitNode) { if (ts.isParseTreeNode(node)) { - if (node.kind === 261) { + if (node.kind === 264) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(node); @@ -12762,6 +13799,14 @@ var ts; return node.emitNode; } ts.getOrCreateEmitNode = getOrCreateEmitNode; + function setTextRange(range, location) { + if (location) { + range.pos = location.pos; + range.end = location.end; + } + return range; + } + ts.setTextRange = setTextRange; function getEmitFlags(node) { var emitNode = node.emitNode; return emitNode && emitNode.flags; @@ -12790,7 +13835,7 @@ var ts; ts.getTokenSourceMapRange = getTokenSourceMapRange; function setTokenSourceMapRange(node, token, range) { var emitNode = getOrCreateEmitNode(node); - var tokenSourceMapRanges = emitNode.tokenSourceMapRanges || (emitNode.tokenSourceMapRanges = ts.createMap()); + var tokenSourceMapRanges = emitNode.tokenSourceMapRanges || (emitNode.tokenSourceMapRanges = []); tokenSourceMapRanges[token] = range; return node; } @@ -12805,6 +13850,34 @@ var ts; return node; } ts.setCommentRange = setCommentRange; + function getSyntheticLeadingComments(node) { + var emitNode = node.emitNode; + return emitNode && emitNode.leadingComments; + } + ts.getSyntheticLeadingComments = getSyntheticLeadingComments; + function setSyntheticLeadingComments(node, comments) { + getOrCreateEmitNode(node).leadingComments = comments; + return node; + } + ts.setSyntheticLeadingComments = setSyntheticLeadingComments; + function addSyntheticLeadingComment(node, kind, text, hasTrailingNewLine) { + return setSyntheticLeadingComments(node, ts.append(getSyntheticLeadingComments(node), { kind: kind, pos: -1, end: -1, hasTrailingNewLine: hasTrailingNewLine, text: text })); + } + ts.addSyntheticLeadingComment = addSyntheticLeadingComment; + function getSyntheticTrailingComments(node) { + var emitNode = node.emitNode; + return emitNode && emitNode.trailingComments; + } + ts.getSyntheticTrailingComments = getSyntheticTrailingComments; + function setSyntheticTrailingComments(node, comments) { + getOrCreateEmitNode(node).trailingComments = comments; + return node; + } + ts.setSyntheticTrailingComments = setSyntheticTrailingComments; + function addSyntheticTrailingComment(node, kind, text, hasTrailingNewLine) { + return setSyntheticTrailingComments(node, ts.append(getSyntheticTrailingComments(node), { kind: kind, pos: -1, end: -1, hasTrailingNewLine: hasTrailingNewLine, text: text })); + } + ts.addSyntheticTrailingComment = addSyntheticTrailingComment; function getConstantValue(node) { var emitNode = node.emitNode; return emitNode && emitNode.constantValue; @@ -12816,32 +13889,6 @@ var ts; return node; } ts.setConstantValue = setConstantValue; - function getExternalHelpersModuleName(node) { - var parseNode = ts.getOriginalNode(node, ts.isSourceFile); - var emitNode = parseNode && parseNode.emitNode; - return emitNode && emitNode.externalHelpersModuleName; - } - ts.getExternalHelpersModuleName = getExternalHelpersModuleName; - function getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions) { - if (compilerOptions.importHelpers && (ts.isExternalModule(node) || compilerOptions.isolatedModules)) { - var externalHelpersModuleName = getExternalHelpersModuleName(node); - if (externalHelpersModuleName) { - return externalHelpersModuleName; - } - var helpers = getEmitHelpers(node); - if (helpers) { - for (var _i = 0, helpers_1 = helpers; _i < helpers_1.length; _i++) { - var helper = helpers_1[_i]; - if (!helper.scoped) { - var parseNode = ts.getOriginalNode(node, ts.isSourceFile); - var emitNode = getOrCreateEmitNode(parseNode); - return emitNode.externalHelpersModuleName || (emitNode.externalHelpersModuleName = createUniqueName(ts.externalHelpersModuleNameText)); - } - } - } - } - } - ts.getOrCreateExternalHelpersModuleNameIfNeeded = getOrCreateExternalHelpersModuleNameIfNeeded; function addEmitHelper(node, helper) { var emitNode = getOrCreateEmitNode(node); emitNode.helpers = ts.append(emitNode.helpers, helper); @@ -12851,8 +13898,8 @@ var ts; function addEmitHelpers(node, helpers) { if (ts.some(helpers)) { var emitNode = getOrCreateEmitNode(node); - for (var _i = 0, helpers_2 = helpers; _i < helpers_2.length; _i++) { - var helper = helpers_2[_i]; + for (var _i = 0, helpers_1 = helpers; _i < helpers_1.length; _i++) { + var helper = helpers_1[_i]; if (!ts.contains(emitNode.helpers, helper)) { emitNode.helpers = ts.append(emitNode.helpers, helper); } @@ -12913,40 +13960,805 @@ var ts; return ts.compareValues(x.priority, y.priority); } ts.compareEmitHelpers = compareEmitHelpers; - function setTextRange(node, location) { - if (location) { - node.pos = location.pos; - node.end = location.end; + function setOriginalNode(node, original) { + node.original = original; + if (original) { + var emitNode = original.emitNode; + if (emitNode) + node.emitNode = mergeEmitNode(emitNode, node.emitNode); } return node; } - ts.setTextRange = setTextRange; - function setNodeFlags(node, flags) { - node.flags = flags; + ts.setOriginalNode = setOriginalNode; + function mergeEmitNode(sourceEmitNode, destEmitNode) { + var flags = sourceEmitNode.flags, leadingComments = sourceEmitNode.leadingComments, trailingComments = sourceEmitNode.trailingComments, commentRange = sourceEmitNode.commentRange, sourceMapRange = sourceEmitNode.sourceMapRange, tokenSourceMapRanges = sourceEmitNode.tokenSourceMapRanges, constantValue = sourceEmitNode.constantValue, helpers = sourceEmitNode.helpers; + if (!destEmitNode) + destEmitNode = {}; + if (leadingComments) + destEmitNode.leadingComments = ts.addRange(leadingComments.slice(), destEmitNode.leadingComments); + if (trailingComments) + destEmitNode.trailingComments = ts.addRange(trailingComments.slice(), destEmitNode.trailingComments); + if (flags) + destEmitNode.flags = flags; + if (commentRange) + destEmitNode.commentRange = commentRange; + if (sourceMapRange) + destEmitNode.sourceMapRange = sourceMapRange; + if (tokenSourceMapRanges) + destEmitNode.tokenSourceMapRanges = mergeTokenSourceMapRanges(tokenSourceMapRanges, destEmitNode.tokenSourceMapRanges); + if (constantValue !== undefined) + destEmitNode.constantValue = constantValue; + if (helpers) + destEmitNode.helpers = ts.addRange(destEmitNode.helpers, helpers); + return destEmitNode; + } + function mergeTokenSourceMapRanges(sourceRanges, destRanges) { + if (!destRanges) + destRanges = []; + for (var key in sourceRanges) { + destRanges[key] = sourceRanges[key]; + } + return destRanges; + } +})(ts || (ts = {})); +(function (ts) { + function createTypeCheck(value, tag) { + return tag === "undefined" + ? ts.createStrictEquality(value, ts.createVoidZero()) + : ts.createStrictEquality(ts.createTypeOf(value), ts.createLiteral(tag)); + } + ts.createTypeCheck = createTypeCheck; + function createMemberAccessForPropertyName(target, memberName, location) { + if (ts.isComputedPropertyName(memberName)) { + return ts.setTextRange(ts.createElementAccess(target, memberName.expression), location); + } + else { + var expression = ts.setTextRange(ts.isIdentifier(memberName) + ? ts.createPropertyAccess(target, memberName) + : ts.createElementAccess(target, memberName), memberName); + ts.getOrCreateEmitNode(expression).flags |= 64; + return expression; + } + } + ts.createMemberAccessForPropertyName = createMemberAccessForPropertyName; + function createFunctionCall(func, thisArg, argumentsList, location) { + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(func, "call"), undefined, [ + thisArg + ].concat(argumentsList)), location); + } + ts.createFunctionCall = createFunctionCall; + function createFunctionApply(func, thisArg, argumentsExpression, location) { + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(func, "apply"), undefined, [ + thisArg, + argumentsExpression + ]), location); + } + ts.createFunctionApply = createFunctionApply; + function createArraySlice(array, start) { + var argumentsList = []; + if (start !== undefined) { + argumentsList.push(typeof start === "number" ? ts.createLiteral(start) : start); + } + return ts.createCall(ts.createPropertyAccess(array, "slice"), undefined, argumentsList); + } + ts.createArraySlice = createArraySlice; + function createArrayConcat(array, values) { + return ts.createCall(ts.createPropertyAccess(array, "concat"), undefined, values); + } + ts.createArrayConcat = createArrayConcat; + function createMathPow(left, right, location) { + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Math"), "pow"), undefined, [left, right]), location); + } + ts.createMathPow = createMathPow; + function createReactNamespace(reactNamespace, parent) { + var react = ts.createIdentifier(reactNamespace || "React"); + react.flags &= ~8; + react.parent = ts.getParseTreeNode(parent); + return react; + } + function createJsxFactoryExpressionFromEntityName(jsxFactory, parent) { + if (ts.isQualifiedName(jsxFactory)) { + var left = createJsxFactoryExpressionFromEntityName(jsxFactory.left, parent); + var right = ts.createIdentifier(jsxFactory.right.text); + right.text = jsxFactory.right.text; + return ts.createPropertyAccess(left, right); + } + else { + return createReactNamespace(jsxFactory.text, parent); + } + } + function createJsxFactoryExpression(jsxFactoryEntity, reactNamespace, parent) { + return jsxFactoryEntity ? + createJsxFactoryExpressionFromEntityName(jsxFactoryEntity, parent) : + ts.createPropertyAccess(createReactNamespace(reactNamespace, parent), "createElement"); + } + function createExpressionForJsxElement(jsxFactoryEntity, reactNamespace, tagName, props, children, parentElement, location) { + var argumentsList = [tagName]; + if (props) { + argumentsList.push(props); + } + if (children && children.length > 0) { + if (!props) { + argumentsList.push(ts.createNull()); + } + if (children.length > 1) { + for (var _i = 0, children_1 = children; _i < children_1.length; _i++) { + var child = children_1[_i]; + child.startsOnNewLine = true; + argumentsList.push(child); + } + } + else { + argumentsList.push(children[0]); + } + } + return ts.setTextRange(ts.createCall(createJsxFactoryExpression(jsxFactoryEntity, reactNamespace, parentElement), undefined, argumentsList), location); + } + ts.createExpressionForJsxElement = createExpressionForJsxElement; + function getHelperName(name) { + return ts.setEmitFlags(ts.createIdentifier(name), 4096 | 2); + } + ts.getHelperName = getHelperName; + var valuesHelper = { + name: "typescript:values", + scoped: false, + text: "\n var __values = (this && this.__values) || function (o) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\n if (m) return m.call(o);\n return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n };\n " + }; + function createValuesHelper(context, expression, location) { + context.requestEmitHelper(valuesHelper); + return ts.setTextRange(ts.createCall(getHelperName("__values"), undefined, [expression]), location); + } + ts.createValuesHelper = createValuesHelper; + var readHelper = { + name: "typescript:read", + scoped: false, + text: "\n var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n };\n " + }; + function createReadHelper(context, iteratorRecord, count, location) { + context.requestEmitHelper(readHelper); + return ts.setTextRange(ts.createCall(getHelperName("__read"), undefined, count !== undefined + ? [iteratorRecord, ts.createLiteral(count)] + : [iteratorRecord]), location); + } + ts.createReadHelper = createReadHelper; + var spreadHelper = { + name: "typescript:spread", + scoped: false, + text: "\n var __spread = (this && this.__spread) || function () {\n for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));\n return ar;\n };" + }; + function createSpreadHelper(context, argumentList, location) { + context.requestEmitHelper(readHelper); + context.requestEmitHelper(spreadHelper); + return ts.setTextRange(ts.createCall(getHelperName("__spread"), undefined, argumentList), location); + } + ts.createSpreadHelper = createSpreadHelper; + function createForOfBindingStatement(node, boundValue) { + if (ts.isVariableDeclarationList(node)) { + var firstDeclaration = ts.firstOrUndefined(node.declarations); + var updatedDeclaration = ts.updateVariableDeclaration(firstDeclaration, firstDeclaration.name, undefined, boundValue); + return ts.setTextRange(ts.createVariableStatement(undefined, ts.updateVariableDeclarationList(node, [updatedDeclaration])), node); + } + else { + var updatedExpression = ts.setTextRange(ts.createAssignment(node, boundValue), node); + return ts.setTextRange(ts.createStatement(updatedExpression), node); + } + } + ts.createForOfBindingStatement = createForOfBindingStatement; + function insertLeadingStatement(dest, source) { + if (ts.isBlock(dest)) { + return ts.updateBlock(dest, ts.setTextRange(ts.createNodeArray([source].concat(dest.statements)), dest.statements)); + } + else { + return ts.createBlock(ts.createNodeArray([dest, source]), true); + } + } + ts.insertLeadingStatement = insertLeadingStatement; + function restoreEnclosingLabel(node, outermostLabeledStatement, afterRestoreLabelCallback) { + if (!outermostLabeledStatement) { + return node; + } + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 221 + ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) + : node); + if (afterRestoreLabelCallback) { + afterRestoreLabelCallback(outermostLabeledStatement); + } + return updated; + } + ts.restoreEnclosingLabel = restoreEnclosingLabel; + function shouldBeCapturedInTempVariable(node, cacheIdentifiers) { + var target = skipParentheses(node); + switch (target.kind) { + case 70: + return cacheIdentifiers; + case 98: + case 8: + case 9: + return false; + case 176: + var elements = target.elements; + if (elements.length === 0) { + return false; + } + return true; + case 177: + return target.properties.length > 0; + default: + return true; + } + } + function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers) { + var callee = skipOuterExpressions(expression, 7); + var thisArg; + var target; + if (ts.isSuperProperty(callee)) { + thisArg = ts.createThis(); + target = callee; + } + else if (callee.kind === 96) { + thisArg = ts.createThis(); + target = languageVersion < 2 + ? ts.setTextRange(ts.createIdentifier("_super"), callee) + : callee; + } + else if (ts.getEmitFlags(callee) & 4096) { + thisArg = ts.createVoidZero(); + target = parenthesizeForAccess(callee); + } + else { + switch (callee.kind) { + case 178: { + if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { + thisArg = ts.createTempVariable(recordTempVariable); + target = ts.createPropertyAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.name); + ts.setTextRange(target, callee); + } + else { + thisArg = callee.expression; + target = callee; + } + break; + } + case 179: { + if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { + thisArg = ts.createTempVariable(recordTempVariable); + target = ts.createElementAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.argumentExpression); + ts.setTextRange(target, callee); + } + else { + thisArg = callee.expression; + target = callee; + } + break; + } + default: { + thisArg = ts.createVoidZero(); + target = parenthesizeForAccess(expression); + break; + } + } + } + return { target: target, thisArg: thisArg }; + } + ts.createCallBinding = createCallBinding; + function inlineExpressions(expressions) { + return ts.reduceLeft(expressions, ts.createComma); + } + ts.inlineExpressions = inlineExpressions; + function createExpressionFromEntityName(node) { + if (ts.isQualifiedName(node)) { + var left = createExpressionFromEntityName(node.left); + var right = ts.getMutableClone(node.right); + return ts.setTextRange(ts.createPropertyAccess(left, right), node); + } + else { + return ts.getMutableClone(node); + } + } + ts.createExpressionFromEntityName = createExpressionFromEntityName; + function createExpressionForPropertyName(memberName) { + if (ts.isIdentifier(memberName)) { + return ts.createLiteral(memberName); + } + else if (ts.isComputedPropertyName(memberName)) { + return ts.getMutableClone(memberName.expression); + } + else { + return ts.getMutableClone(memberName); + } + } + ts.createExpressionForPropertyName = createExpressionForPropertyName; + function createExpressionForObjectLiteralElementLike(node, property, receiver) { + switch (property.kind) { + case 152: + case 153: + return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine); + case 260: + return createExpressionForPropertyAssignment(property, receiver); + case 261: + return createExpressionForShorthandPropertyAssignment(property, receiver); + case 150: + return createExpressionForMethodDeclaration(property, receiver); + } + } + ts.createExpressionForObjectLiteralElementLike = createExpressionForObjectLiteralElementLike; + function createExpressionForAccessorDeclaration(properties, property, receiver, multiLine) { + var _a = ts.getAllAccessorDeclarations(properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; + if (property === firstAccessor) { + var properties_1 = []; + if (getAccessor) { + var getterFunction = ts.createFunctionExpression(getAccessor.modifiers, undefined, undefined, undefined, getAccessor.parameters, undefined, getAccessor.body); + ts.setTextRange(getterFunction, getAccessor); + ts.setOriginalNode(getterFunction, getAccessor); + var getter = ts.createPropertyAssignment("get", getterFunction); + properties_1.push(getter); + } + if (setAccessor) { + var setterFunction = ts.createFunctionExpression(setAccessor.modifiers, undefined, undefined, undefined, setAccessor.parameters, undefined, setAccessor.body); + ts.setTextRange(setterFunction, setAccessor); + ts.setOriginalNode(setterFunction, setAccessor); + var setter = ts.createPropertyAssignment("set", setterFunction); + properties_1.push(setter); + } + properties_1.push(ts.createPropertyAssignment("enumerable", ts.createTrue())); + properties_1.push(ts.createPropertyAssignment("configurable", ts.createTrue())); + var expression = ts.setTextRange(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), undefined, [ + receiver, + createExpressionForPropertyName(property.name), + ts.createObjectLiteral(properties_1, multiLine) + ]), firstAccessor); + return ts.aggregateTransformFlags(expression); + } + return undefined; + } + function createExpressionForPropertyAssignment(property, receiver) { + return ts.aggregateTransformFlags(ts.setOriginalNode(ts.setTextRange(ts.createAssignment(createMemberAccessForPropertyName(receiver, property.name, property.name), property.initializer), property), property)); + } + function createExpressionForShorthandPropertyAssignment(property, receiver) { + return ts.aggregateTransformFlags(ts.setOriginalNode(ts.setTextRange(ts.createAssignment(createMemberAccessForPropertyName(receiver, property.name, property.name), ts.getSynthesizedClone(property.name)), property), property)); + } + function createExpressionForMethodDeclaration(method, receiver) { + return ts.aggregateTransformFlags(ts.setOriginalNode(ts.setTextRange(ts.createAssignment(createMemberAccessForPropertyName(receiver, method.name, method.name), ts.setOriginalNode(ts.setTextRange(ts.createFunctionExpression(method.modifiers, method.asteriskToken, undefined, undefined, method.parameters, undefined, method.body), method), method)), method), method)); + } + function getLocalName(node, allowComments, allowSourceMaps) { + return getName(node, allowComments, allowSourceMaps, 16384); + } + ts.getLocalName = getLocalName; + function isLocalName(node) { + return (ts.getEmitFlags(node) & 16384) !== 0; + } + ts.isLocalName = isLocalName; + function getExportName(node, allowComments, allowSourceMaps) { + return getName(node, allowComments, allowSourceMaps, 8192); + } + ts.getExportName = getExportName; + function isExportName(node) { + return (ts.getEmitFlags(node) & 8192) !== 0; + } + ts.isExportName = isExportName; + function getDeclarationName(node, allowComments, allowSourceMaps) { + return getName(node, allowComments, allowSourceMaps); + } + ts.getDeclarationName = getDeclarationName; + function getName(node, allowComments, allowSourceMaps, emitFlags) { + if (node.name && ts.isIdentifier(node.name) && !ts.isGeneratedIdentifier(node.name)) { + var name = ts.getMutableClone(node.name); + emitFlags |= ts.getEmitFlags(node.name); + if (!allowSourceMaps) + emitFlags |= 48; + if (!allowComments) + emitFlags |= 1536; + if (emitFlags) + ts.setEmitFlags(name, emitFlags); + return name; + } + return ts.getGeneratedNameForNode(node); + } + function getExternalModuleOrNamespaceExportName(ns, node, allowComments, allowSourceMaps) { + if (ns && ts.hasModifier(node, 1)) { + return getNamespaceMemberName(ns, getName(node), allowComments, allowSourceMaps); + } + return getExportName(node, allowComments, allowSourceMaps); + } + ts.getExternalModuleOrNamespaceExportName = getExternalModuleOrNamespaceExportName; + function getNamespaceMemberName(ns, name, allowComments, allowSourceMaps) { + var qualifiedName = ts.createPropertyAccess(ns, ts.nodeIsSynthesized(name) ? name : ts.getSynthesizedClone(name)); + ts.setTextRange(qualifiedName, name); + var emitFlags; + if (!allowSourceMaps) + emitFlags |= 48; + if (!allowComments) + emitFlags |= 1536; + if (emitFlags) + ts.setEmitFlags(qualifiedName, emitFlags); + return qualifiedName; + } + ts.getNamespaceMemberName = getNamespaceMemberName; + function convertToFunctionBody(node, multiLine) { + return ts.isBlock(node) ? node : ts.setTextRange(ts.createBlock([ts.setTextRange(ts.createReturn(node), node)], multiLine), node); + } + ts.convertToFunctionBody = convertToFunctionBody; + function isUseStrictPrologue(node) { + return node.expression.text === "use strict"; + } + function addPrologue(target, source, ensureUseStrict, visitor) { + var offset = addStandardPrologue(target, source, ensureUseStrict); + return addCustomPrologue(target, source, offset, visitor); + } + ts.addPrologue = addPrologue; + function addStandardPrologue(target, source, ensureUseStrict) { + ts.Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array"); + var foundUseStrict = false; + var statementOffset = 0; + var numStatements = source.length; + while (statementOffset < numStatements) { + var statement = source[statementOffset]; + if (ts.isPrologueDirective(statement)) { + if (isUseStrictPrologue(statement)) { + foundUseStrict = true; + } + target.push(statement); + } + else { + break; + } + statementOffset++; + } + if (ensureUseStrict && !foundUseStrict) { + target.push(startOnNewLine(ts.createStatement(ts.createLiteral("use strict")))); + } + return statementOffset; + } + ts.addStandardPrologue = addStandardPrologue; + function addCustomPrologue(target, source, statementOffset, visitor) { + var numStatements = source.length; + while (statementOffset < numStatements) { + var statement = source[statementOffset]; + if (ts.getEmitFlags(statement) & 524288) { + target.push(visitor ? ts.visitNode(statement, visitor, ts.isStatement) : statement); + } + else { + break; + } + statementOffset++; + } + return statementOffset; + } + ts.addCustomPrologue = addCustomPrologue; + function startsWithUseStrict(statements) { + var firstStatement = ts.firstOrUndefined(statements); + return firstStatement !== undefined + && ts.isPrologueDirective(firstStatement) + && isUseStrictPrologue(firstStatement); + } + ts.startsWithUseStrict = startsWithUseStrict; + function ensureUseStrict(statements) { + var foundUseStrict = false; + for (var _i = 0, statements_1 = statements; _i < statements_1.length; _i++) { + var statement = statements_1[_i]; + if (ts.isPrologueDirective(statement)) { + if (isUseStrictPrologue(statement)) { + foundUseStrict = true; + break; + } + } + else { + break; + } + } + if (!foundUseStrict) { + return ts.setTextRange(ts.createNodeArray([ + startOnNewLine(ts.createStatement(ts.createLiteral("use strict"))) + ].concat(statements)), statements); + } + return statements; + } + ts.ensureUseStrict = ensureUseStrict; + function parenthesizeConditionalHead(condition) { + var conditionalPrecedence = ts.getOperatorPrecedence(194, 54); + var emittedCondition = skipPartiallyEmittedExpressions(condition); + var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); + if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1) { + return ts.createParen(condition); + } + return condition; + } + ts.parenthesizeConditionalHead = parenthesizeConditionalHead; + function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { + var skipped = skipPartiallyEmittedExpressions(operand); + if (skipped.kind === 184) { + return operand; + } + return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) + ? ts.createParen(operand) + : operand; + } + ts.parenthesizeBinaryOperand = parenthesizeBinaryOperand; + function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { + var binaryOperatorPrecedence = ts.getOperatorPrecedence(193, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(193, binaryOperator); + var emittedOperand = skipPartiallyEmittedExpressions(operand); + var operandPrecedence = ts.getExpressionPrecedence(emittedOperand); + switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) { + case -1: + if (!isLeftSideOfBinary + && binaryOperatorAssociativity === 1 + && operand.kind === 196) { + return false; + } + return true; + case 1: + return false; + case 0: + if (isLeftSideOfBinary) { + return binaryOperatorAssociativity === 1; + } + else { + if (ts.isBinaryExpression(emittedOperand) + && emittedOperand.operatorToken.kind === binaryOperator) { + if (operatorHasAssociativeProperty(binaryOperator)) { + return false; + } + if (binaryOperator === 36) { + var leftKind = leftOperand ? getLiteralKindOfBinaryPlusOperand(leftOperand) : 0; + if (ts.isLiteralKind(leftKind) && leftKind === getLiteralKindOfBinaryPlusOperand(emittedOperand)) { + return false; + } + } + } + var operandAssociativity = ts.getExpressionAssociativity(emittedOperand); + return operandAssociativity === 0; + } + } + } + function operatorHasAssociativeProperty(binaryOperator) { + return binaryOperator === 38 + || binaryOperator === 48 + || binaryOperator === 47 + || binaryOperator === 49; + } + function getLiteralKindOfBinaryPlusOperand(node) { + node = skipPartiallyEmittedExpressions(node); + if (ts.isLiteralKind(node.kind)) { + return node.kind; + } + if (node.kind === 193 && node.operatorToken.kind === 36) { + if (node.cachedLiteralKind !== undefined) { + return node.cachedLiteralKind; + } + var leftKind = getLiteralKindOfBinaryPlusOperand(node.left); + var literalKind = ts.isLiteralKind(leftKind) + && leftKind === getLiteralKindOfBinaryPlusOperand(node.right) + ? leftKind + : 0; + node.cachedLiteralKind = literalKind; + return literalKind; + } + return 0; + } + function parenthesizeForConditionalHead(condition) { + var conditionalPrecedence = ts.getOperatorPrecedence(194, 54); + var emittedCondition = skipPartiallyEmittedExpressions(condition); + var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); + if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1) { + return ts.createParen(condition); + } + return condition; + } + ts.parenthesizeForConditionalHead = parenthesizeForConditionalHead; + function parenthesizeSubexpressionOfConditionalExpression(e) { + return e.kind === 193 && e.operatorToken.kind === 25 + ? ts.createParen(e) + : e; + } + ts.parenthesizeSubexpressionOfConditionalExpression = parenthesizeSubexpressionOfConditionalExpression; + function parenthesizeForNew(expression) { + var emittedExpression = skipPartiallyEmittedExpressions(expression); + switch (emittedExpression.kind) { + case 180: + return ts.createParen(expression); + case 181: + return emittedExpression.arguments + ? expression + : ts.createParen(expression); + } + return parenthesizeForAccess(expression); + } + ts.parenthesizeForNew = parenthesizeForNew; + function parenthesizeForAccess(expression) { + var emittedExpression = skipPartiallyEmittedExpressions(expression); + if (ts.isLeftHandSideExpression(emittedExpression) + && (emittedExpression.kind !== 181 || emittedExpression.arguments)) { + return expression; + } + return ts.setTextRange(ts.createParen(expression), expression); + } + ts.parenthesizeForAccess = parenthesizeForAccess; + function parenthesizePostfixOperand(operand) { + return ts.isLeftHandSideExpression(operand) + ? operand + : ts.setTextRange(ts.createParen(operand), operand); + } + ts.parenthesizePostfixOperand = parenthesizePostfixOperand; + function parenthesizePrefixOperand(operand) { + return ts.isUnaryExpression(operand) + ? operand + : ts.setTextRange(ts.createParen(operand), operand); + } + ts.parenthesizePrefixOperand = parenthesizePrefixOperand; + function parenthesizeListElements(elements) { + var result; + for (var i = 0; i < elements.length; i++) { + var element = parenthesizeExpressionForList(elements[i]); + if (result !== undefined || element !== elements[i]) { + if (result === undefined) { + result = elements.slice(0, i); + } + result.push(element); + } + } + if (result !== undefined) { + return ts.setTextRange(ts.createNodeArray(result, elements.hasTrailingComma), elements); + } + return elements; + } + ts.parenthesizeListElements = parenthesizeListElements; + function parenthesizeExpressionForList(expression) { + var emittedExpression = skipPartiallyEmittedExpressions(expression); + var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); + var commaPrecedence = ts.getOperatorPrecedence(193, 25); + return expressionPrecedence > commaPrecedence + ? expression + : ts.setTextRange(ts.createParen(expression), expression); + } + ts.parenthesizeExpressionForList = parenthesizeExpressionForList; + function parenthesizeExpressionForExpressionStatement(expression) { + var emittedExpression = skipPartiallyEmittedExpressions(expression); + if (ts.isCallExpression(emittedExpression)) { + var callee = emittedExpression.expression; + var kind = skipPartiallyEmittedExpressions(callee).kind; + if (kind === 185 || kind === 186) { + var mutableCall = ts.getMutableClone(emittedExpression); + mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); + return recreatePartiallyEmittedExpressions(expression, mutableCall); + } + } + else { + var leftmostExpressionKind = getLeftmostExpression(emittedExpression).kind; + if (leftmostExpressionKind === 177 || leftmostExpressionKind === 185) { + return ts.setTextRange(ts.createParen(expression), expression); + } + } + return expression; + } + ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; + function recreatePartiallyEmittedExpressions(originalOuterExpression, newInnerExpression) { + if (ts.isPartiallyEmittedExpression(originalOuterExpression)) { + var clone_1 = ts.getMutableClone(originalOuterExpression); + clone_1.expression = recreatePartiallyEmittedExpressions(clone_1.expression, newInnerExpression); + return clone_1; + } + return newInnerExpression; + } + function getLeftmostExpression(node) { + while (true) { + switch (node.kind) { + case 192: + node = node.operand; + continue; + case 193: + node = node.left; + continue; + case 194: + node = node.condition; + continue; + case 180: + case 179: + case 178: + node = node.expression; + continue; + case 295: + node = node.expression; + continue; + } + return node; + } + } + function parenthesizeConciseBody(body) { + if (!ts.isBlock(body) && getLeftmostExpression(body).kind === 177) { + return ts.setTextRange(ts.createParen(body), body); + } + return body; + } + ts.parenthesizeConciseBody = parenthesizeConciseBody; + var OuterExpressionKinds; + (function (OuterExpressionKinds) { + OuterExpressionKinds[OuterExpressionKinds["Parentheses"] = 1] = "Parentheses"; + OuterExpressionKinds[OuterExpressionKinds["Assertions"] = 2] = "Assertions"; + OuterExpressionKinds[OuterExpressionKinds["PartiallyEmittedExpressions"] = 4] = "PartiallyEmittedExpressions"; + OuterExpressionKinds[OuterExpressionKinds["All"] = 7] = "All"; + })(OuterExpressionKinds = ts.OuterExpressionKinds || (ts.OuterExpressionKinds = {})); + function skipOuterExpressions(node, kinds) { + if (kinds === void 0) { kinds = 7; } + var previousNode; + do { + previousNode = node; + if (kinds & 1) { + node = skipParentheses(node); + } + if (kinds & 2) { + node = skipAssertions(node); + } + if (kinds & 4) { + node = skipPartiallyEmittedExpressions(node); + } + } while (previousNode !== node); return node; } - ts.setNodeFlags = setNodeFlags; - function setMultiLine(node, multiLine) { - node.multiLine = multiLine; + ts.skipOuterExpressions = skipOuterExpressions; + function skipParentheses(node) { + while (node.kind === 184) { + node = node.expression; + } return node; } - ts.setMultiLine = setMultiLine; - function setHasTrailingComma(nodes, hasTrailingComma) { - nodes.hasTrailingComma = hasTrailingComma; - return nodes; + ts.skipParentheses = skipParentheses; + function skipAssertions(node) { + while (ts.isAssertionExpression(node)) { + node = node.expression; + } + return node; } - ts.setHasTrailingComma = setHasTrailingComma; + ts.skipAssertions = skipAssertions; + function skipPartiallyEmittedExpressions(node) { + while (node.kind === 295) { + node = node.expression; + } + return node; + } + ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; + function startOnNewLine(node) { + node.startsOnNewLine = true; + return node; + } + ts.startOnNewLine = startOnNewLine; + function getExternalHelpersModuleName(node) { + var parseNode = ts.getOriginalNode(node, ts.isSourceFile); + var emitNode = parseNode && parseNode.emitNode; + return emitNode && emitNode.externalHelpersModuleName; + } + ts.getExternalHelpersModuleName = getExternalHelpersModuleName; + function getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions) { + if (compilerOptions.importHelpers && (ts.isExternalModule(node) || compilerOptions.isolatedModules)) { + var externalHelpersModuleName = getExternalHelpersModuleName(node); + if (externalHelpersModuleName) { + return externalHelpersModuleName; + } + var helpers = ts.getEmitHelpers(node); + if (helpers) { + for (var _i = 0, helpers_2 = helpers; _i < helpers_2.length; _i++) { + var helper = helpers_2[_i]; + if (!helper.scoped) { + var parseNode = ts.getOriginalNode(node, ts.isSourceFile); + var emitNode = ts.getOrCreateEmitNode(parseNode); + return emitNode.externalHelpersModuleName || (emitNode.externalHelpersModuleName = ts.createUniqueName(ts.externalHelpersModuleNameText)); + } + } + } + } + } + ts.getOrCreateExternalHelpersModuleNameIfNeeded = getOrCreateExternalHelpersModuleNameIfNeeded; function getLocalNameForExternalImport(node, sourceFile) { var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); if (namespaceDeclaration && !ts.isDefaultImport(node)) { - var name_11 = namespaceDeclaration.name; - return ts.isGeneratedIdentifier(name_11) ? name_11 : createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, namespaceDeclaration.name)); + var name = namespaceDeclaration.name; + return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, namespaceDeclaration.name)); } - if (node.kind === 235 && node.importClause) { - return getGeneratedNameForNode(node); + if (node.kind === 237 && node.importClause) { + return ts.getGeneratedNameForNode(node); } - if (node.kind === 241 && node.moduleSpecifier) { - return getGeneratedNameForNode(node); + if (node.kind === 243 && node.moduleSpecifier) { + return ts.getGeneratedNameForNode(node); } return undefined; } @@ -12956,26 +14768,24 @@ var ts; if (moduleName.kind === 9) { return tryGetModuleNameFromDeclaration(importNode, host, resolver, compilerOptions) || tryRenameExternalModule(moduleName, sourceFile) - || getSynthesizedClone(moduleName); + || ts.getSynthesizedClone(moduleName); } return undefined; } ts.getExternalModuleNameLiteral = getExternalModuleNameLiteral; function tryRenameExternalModule(moduleName, sourceFile) { - if (sourceFile.renamedDependencies && ts.hasProperty(sourceFile.renamedDependencies, moduleName.text)) { - return createLiteral(sourceFile.renamedDependencies[moduleName.text]); - } - return undefined; + var rename = sourceFile.renamedDependencies && sourceFile.renamedDependencies.get(moduleName.text); + return rename && ts.createLiteral(rename); } function tryGetModuleNameFromFile(file, host, options) { if (!file) { return undefined; } if (file.moduleName) { - return createLiteral(file.moduleName); + return ts.createLiteral(file.moduleName); } if (!ts.isDeclarationFile(file) && (options.out || options.outFile)) { - return createLiteral(ts.getExternalModuleNameFromPath(host, file.fileName)); + return ts.createLiteral(ts.getExternalModuleNameFromPath(host, file.fileName)); } return undefined; } @@ -13009,11 +14819,11 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 257: + case 260: return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 258: + case 261: return bindingElement.name; - case 259: + case 262: return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } return undefined; @@ -13029,11 +14839,11 @@ var ts; ts.getTargetOfBindingOrAssignmentElement = getTargetOfBindingOrAssignmentElement; function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 144: - case 174: + case 145: + case 175: return bindingElement.dotDotDotToken; - case 196: - case 259: + case 197: + case 262: return bindingElement; } return undefined; @@ -13041,7 +14851,7 @@ var ts; ts.getRestIndicatorOfBindingOrAssignmentElement = getRestIndicatorOfBindingOrAssignmentElement; function getPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 174: + case 175: if (bindingElement.propertyName) { var propertyName = bindingElement.propertyName; return ts.isComputedPropertyName(propertyName) && ts.isStringOrNumericLiteral(propertyName.expression) @@ -13049,7 +14859,7 @@ var ts; : propertyName; } break; - case 257: + case 260: if (bindingElement.name) { var propertyName = bindingElement.name; return ts.isComputedPropertyName(propertyName) && ts.isStringOrNumericLiteral(propertyName.expression) @@ -13057,7 +14867,7 @@ var ts; : propertyName; } break; - case 259: + case 262: return bindingElement.name; } var target = getTargetOfBindingOrAssignmentElement(bindingElement); @@ -13071,11 +14881,11 @@ var ts; ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 172: case 173: - case 175: - return name.elements; + case 174: case 176: + return name.elements; + case 177: return name.properties; } } @@ -13084,10 +14894,12 @@ var ts; if (ts.isBindingElement(element)) { if (element.dotDotDotToken) { ts.Debug.assertNode(element.name, ts.isIdentifier); - return setOriginalNode(createSpread(element.name, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createSpread(element.name), element), element); } var expression = convertToAssignmentElementTarget(element.name); - return element.initializer ? setOriginalNode(createAssignment(expression, element.initializer, element), element) : expression; + return element.initializer + ? ts.setOriginalNode(ts.setTextRange(ts.createAssignment(expression, element.initializer), element), element) + : expression; } ts.Debug.assertNode(element, ts.isExpression); return element; @@ -13097,14 +14909,14 @@ var ts; if (ts.isBindingElement(element)) { if (element.dotDotDotToken) { ts.Debug.assertNode(element.name, ts.isIdentifier); - return setOriginalNode(createSpreadAssignment(element.name, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createSpreadAssignment(element.name), element), element); } if (element.propertyName) { var expression = convertToAssignmentElementTarget(element.name); - return setOriginalNode(createPropertyAssignment(element.propertyName, element.initializer ? createAssignment(expression, element.initializer) : expression, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createPropertyAssignment(element.propertyName, element.initializer ? ts.createAssignment(expression, element.initializer) : expression), element), element); } ts.Debug.assertNode(element.name, ts.isIdentifier); - return setOriginalNode(createShorthandPropertyAssignment(element.name, element.initializer, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createShorthandPropertyAssignment(element.name, element.initializer), element), element); } ts.Debug.assertNode(element, ts.isObjectLiteralElementLike); return element; @@ -13112,18 +14924,18 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 173: - case 175: - return convertToArrayAssignmentPattern(node); - case 172: + case 174: case 176: + return convertToArrayAssignmentPattern(node); + case 173: + case 177: return convertToObjectAssignmentPattern(node); } } ts.convertToAssignmentPattern = convertToAssignmentPattern; function convertToObjectAssignmentPattern(node) { if (ts.isObjectBindingPattern(node)) { - return setOriginalNode(createObjectLiteral(ts.map(node.elements, convertToObjectAssignmentElement), node), node); + return ts.setOriginalNode(ts.setTextRange(ts.createObjectLiteral(ts.map(node.elements, convertToObjectAssignmentElement)), node), node); } ts.Debug.assertNode(node, ts.isObjectLiteralExpression); return node; @@ -13131,7 +14943,7 @@ var ts; ts.convertToObjectAssignmentPattern = convertToObjectAssignmentPattern; function convertToArrayAssignmentPattern(node) { if (ts.isArrayBindingPattern(node)) { - return setOriginalNode(createArrayLiteral(ts.map(node.elements, convertToArrayAssignmentElement), node), node); + return ts.setOriginalNode(ts.setTextRange(ts.createArrayLiteral(ts.map(node.elements, convertToArrayAssignmentElement)), node), node); } ts.Debug.assertNode(node, ts.isArrayLiteralExpression); return node; @@ -13147,30 +14959,30 @@ var ts; ts.convertToAssignmentElementTarget = convertToAssignmentElementTarget; function collectExternalModuleInfo(sourceFile, resolver, compilerOptions) { var externalImports = []; - var exportSpecifiers = ts.createMap(); - var exportedBindings = ts.createMap(); + var exportSpecifiers = ts.createMultiMap(); + var exportedBindings = []; var uniqueExports = ts.createMap(); var exportedNames; var hasExportDefault = false; var exportEquals = undefined; var hasExportStarsToExportValues = false; var externalHelpersModuleName = getOrCreateExternalHelpersModuleNameIfNeeded(sourceFile, compilerOptions); - var externalHelpersImportDeclaration = externalHelpersModuleName && createImportDeclaration(undefined, undefined, createImportClause(undefined, createNamespaceImport(externalHelpersModuleName)), createLiteral(ts.externalHelpersModuleNameText)); + var externalHelpersImportDeclaration = externalHelpersModuleName && ts.createImportDeclaration(undefined, undefined, ts.createImportClause(undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText)); if (externalHelpersImportDeclaration) { externalImports.push(externalHelpersImportDeclaration); } for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 235: + case 237: externalImports.push(node); break; - case 234: - if (node.moduleReference.kind === 245) { + case 236: + if (node.moduleReference.kind === 247) { externalImports.push(node); } break; - case 241: + case 243: if (node.moduleSpecifier) { if (!node.exportClause) { externalImports.push(node); @@ -13183,26 +14995,26 @@ var ts; else { for (var _b = 0, _c = node.exportClause.elements; _b < _c.length; _b++) { var specifier = _c[_b]; - if (!uniqueExports[specifier.name.text]) { - var name_12 = specifier.propertyName || specifier.name; - ts.multiMapAdd(exportSpecifiers, name_12.text, specifier); - var decl = resolver.getReferencedImportDeclaration(name_12) - || resolver.getReferencedValueDeclaration(name_12); + if (!uniqueExports.get(specifier.name.text)) { + var name = specifier.propertyName || specifier.name; + exportSpecifiers.add(name.text, specifier); + var decl = resolver.getReferencedImportDeclaration(name) + || resolver.getReferencedValueDeclaration(name); if (decl) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(decl), specifier.name); + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(decl), specifier.name); } - uniqueExports[specifier.name.text] = true; + uniqueExports.set(specifier.name.text, true); exportedNames = ts.append(exportedNames, specifier.name); } } } break; - case 240: + case 242: if (node.isExportEquals && !exportEquals) { exportEquals = node; } break; - case 205: + case 207: if (ts.hasModifier(node, 1)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -13210,38 +15022,38 @@ var ts; } } break; - case 225: + case 227: if (ts.hasModifier(node, 1)) { if (ts.hasModifier(node, 512)) { if (!hasExportDefault) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); hasExportDefault = true; } } else { - var name_13 = node.name; - if (!uniqueExports[name_13.text]) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), name_13); - uniqueExports[name_13.text] = true; - exportedNames = ts.append(exportedNames, name_13); + var name = node.name; + if (!uniqueExports.get(name.text)) { + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), name); + uniqueExports.set(name.text, true); + exportedNames = ts.append(exportedNames, name); } } } break; - case 226: + case 228: if (ts.hasModifier(node, 1)) { if (ts.hasModifier(node, 512)) { if (!hasExportDefault) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); hasExportDefault = true; } } else { - var name_14 = node.name; - if (!uniqueExports[name_14.text]) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), name_14); - uniqueExports[name_14.text] = true; - exportedNames = ts.append(exportedNames, name_14); + var name = node.name; + if (!uniqueExports.get(name.text)) { + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), name); + uniqueExports.set(name.text, true); + exportedNames = ts.append(exportedNames, name); } } } @@ -13261,13 +15073,23 @@ var ts; } } else if (!ts.isGeneratedIdentifier(decl.name)) { - if (!uniqueExports[decl.name.text]) { - uniqueExports[decl.name.text] = true; + if (!uniqueExports.get(decl.name.text)) { + uniqueExports.set(decl.name.text, true); exportedNames = ts.append(exportedNames, decl.name); } } return exportedNames; } + function multiMapSparseArrayAdd(map, key, value) { + var values = map[key]; + if (values) { + values.push(value); + } + else { + map[key] = values = [value]; + } + return values; + } })(ts || (ts = {})); var ts; (function (ts) { @@ -13276,13 +15098,13 @@ var ts; var IdentifierConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 261) { + if (kind === 264) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 70) { return new (IdentifierConstructor || (IdentifierConstructor = ts.objectAllocator.getIdentifierConstructor()))(kind, pos, end); } - else if (kind < 141) { + else if (kind < 142) { return new (TokenConstructor || (TokenConstructor = ts.objectAllocator.getTokenConstructor()))(kind, pos, end); } else { @@ -13318,28 +15140,29 @@ var ts; var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode; var cbNodes = cbNodeArray || cbNode; switch (node.kind) { - case 141: + case 142: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 143: + case 144: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || + visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 258: + case 261: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 259: + case 262: return visitNode(cbNode, node.expression); - case 144: + case 145: + case 148: case 147: - case 146: - case 257: - case 223: - case 174: + case 260: + case 225: + case 175: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || @@ -13348,24 +15171,24 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 158: case 159: - case 153: + case 160: case 154: case 155: + case 156: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 149: - case 148: case 150: + case 149: case 151: case 152: - case 184: - case 225: + case 153: case 185: + case 227: + case 186: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -13376,320 +15199,326 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 157: + case 158: return visitNode(cbNode, node.typeName) || visitNodes(cbNodes, node.typeArguments); - case 156: + case 157: return visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 160: - return visitNode(cbNode, node.exprName); case 161: - return visitNodes(cbNodes, node.members); + return visitNode(cbNode, node.exprName); case 162: - return visitNode(cbNode, node.elementType); + return visitNodes(cbNodes, node.members); case 163: - return visitNodes(cbNodes, node.elementTypes); + return visitNode(cbNode, node.elementType); case 164: + return visitNodes(cbNodes, node.elementTypes); case 165: - return visitNodes(cbNodes, node.types); case 166: - case 168: - return visitNode(cbNode, node.type); + return visitNodes(cbNodes, node.types); + case 167: case 169: + return visitNode(cbNode, node.type); + case 170: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 170: + case 171: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 171: - return visitNode(cbNode, node.literal); case 172: + return visitNode(cbNode, node.literal); case 173: - return visitNodes(cbNodes, node.elements); - case 175: + case 174: return visitNodes(cbNodes, node.elements); case 176: - return visitNodes(cbNodes, node.properties); + return visitNodes(cbNodes, node.elements); case 177: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.name); + return visitNodes(cbNodes, node.properties); case 178: return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.argumentExpression); + visitNode(cbNode, node.name); case 179: + return visitNode(cbNode, node.expression) || + visitNode(cbNode, node.argumentExpression); case 180: + case 181: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); - case 181: + case 182: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 182: + case 183: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 183: - return visitNode(cbNode, node.expression); - case 186: + case 184: return visitNode(cbNode, node.expression); case 187: return visitNode(cbNode, node.expression); case 188: return visitNode(cbNode, node.expression); - case 190: - return visitNode(cbNode, node.operand); - case 195: - return visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.expression); case 189: return visitNode(cbNode, node.expression); case 191: return visitNode(cbNode, node.operand); + case 196: + return visitNode(cbNode, node.asteriskToken) || + visitNode(cbNode, node.expression); + case 190: + return visitNode(cbNode, node.expression); case 192: + return visitNode(cbNode, node.operand); + case 193: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 200: + case 201: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 201: + case 202: return visitNode(cbNode, node.expression); - case 193: + case 203: + return visitNode(cbNode, node.name); + case 194: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 196: + case 197: return visitNode(cbNode, node.expression); - case 204: - case 231: + case 206: + case 233: return visitNodes(cbNodes, node.statements); - case 261: + case 264: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 205: + case 207: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 224: + case 226: return visitNodes(cbNodes, node.declarations); - case 207: + case 209: return visitNode(cbNode, node.expression); - case 208: + case 210: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 209: + case 211: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 210: + case 212: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 211: + case 213: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 212: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); - case 213: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); case 214: - case 215: - return visitNode(cbNode, node.label); - case 216: - return visitNode(cbNode, node.expression); - case 217: - return visitNode(cbNode, node.expression) || + return visitNode(cbNode, node.initializer) || + visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); + case 215: + return visitNode(cbNode, node.awaitModifier) || + visitNode(cbNode, node.initializer) || + visitNode(cbNode, node.expression) || + visitNode(cbNode, node.statement); + case 216: + case 217: + return visitNode(cbNode, node.label); case 218: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.caseBlock); - case 232: - return visitNodes(cbNodes, node.clauses); - case 253: - return visitNode(cbNode, node.expression) || - visitNodes(cbNodes, node.statements); - case 254: - return visitNodes(cbNodes, node.statements); + return visitNode(cbNode, node.expression); case 219: - return visitNode(cbNode, node.label) || + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 220: - return visitNode(cbNode, node.expression); + return visitNode(cbNode, node.expression) || + visitNode(cbNode, node.caseBlock); + case 234: + return visitNodes(cbNodes, node.clauses); + case 256: + return visitNode(cbNode, node.expression) || + visitNodes(cbNodes, node.statements); + case 257: + return visitNodes(cbNodes, node.statements); case 221: + return visitNode(cbNode, node.label) || + visitNode(cbNode, node.statement); + case 222: + return visitNode(cbNode, node.expression); + case 223: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 256: + case 259: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 145: + case 146: return visitNode(cbNode, node.expression); - case 226: - case 197: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.heritageClauses) || - visitNodes(cbNodes, node.members); - case 227: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.heritageClauses) || - visitNodes(cbNodes, node.members); case 228: + case 198: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || - visitNode(cbNode, node.type); + visitNodes(cbNodes, node.heritageClauses) || + visitNodes(cbNodes, node.members); case 229: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.typeParameters) || + visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); - case 260: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.initializer); case 230: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.typeParameters) || + visitNode(cbNode, node.type); + case 231: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.members); + case 263: + return visitNode(cbNode, node.name) || + visitNode(cbNode, node.initializer); + case 232: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 234: + case 236: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 235: + case 237: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 236: + case 238: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 233: + case 235: return visitNode(cbNode, node.name); - case 237: + case 239: return visitNode(cbNode, node.name); - case 238: - case 242: + case 240: + case 244: return visitNodes(cbNodes, node.elements); - case 241: + case 243: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 239: - case 243: + case 241: + case 245: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 240: + case 242: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 194: + case 195: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 202: + case 204: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 142: + case 143: return visitNode(cbNode, node.expression); - case 255: + case 258: return visitNodes(cbNodes, node.types); - case 199: + case 200: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments); - case 245: + case 247: return visitNode(cbNode, node.expression); - case 244: - return visitNodes(cbNodes, node.decorators); case 246: + return visitNodes(cbNodes, node.decorators); + case 248: return visitNode(cbNode, node.openingElement) || visitNodes(cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 247: - case 248: - return visitNode(cbNode, node.tagName) || - visitNodes(cbNodes, node.attributes); + case 249: case 250: + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.attributes); + case 253: + return visitNodes(cbNodes, node.properties); + case 252: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); + case 254: + return visitNode(cbNode, node.expression); + case 255: + return visitNode(cbNode, node.dotDotDotToken) || + visitNode(cbNode, node.expression); case 251: - return visitNode(cbNode, node.expression); - case 252: - return visitNode(cbNode, node.expression); - case 249: return visitNode(cbNode, node.tagName); - case 262: - return visitNode(cbNode, node.type); case 266: - return visitNodes(cbNodes, node.types); - case 267: - return visitNodes(cbNodes, node.types); - case 265: - return visitNode(cbNode, node.elementType); - case 269: - return visitNode(cbNode, node.type); - case 268: return visitNode(cbNode, node.type); case 270: - return visitNode(cbNode, node.literal); - case 272: - return visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeArguments); + return visitNodes(cbNodes, node.types); + case 271: + return visitNodes(cbNodes, node.types); + case 269: + return visitNode(cbNode, node.elementType); case 273: return visitNode(cbNode, node.type); + case 272: + return visitNode(cbNode, node.type); case 274: - return visitNodes(cbNodes, node.parameters) || - visitNode(cbNode, node.type); - case 275: - return visitNode(cbNode, node.type); + return visitNode(cbNode, node.literal); case 276: - return visitNode(cbNode, node.type); + return visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.typeArguments); case 277: return visitNode(cbNode, node.type); - case 271: + case 278: + return visitNodes(cbNodes, node.parameters) || + visitNode(cbNode, node.type); + case 279: + return visitNode(cbNode, node.type); + case 280: + return visitNode(cbNode, node.type); + case 281: + return visitNode(cbNode, node.type); + case 275: return visitNode(cbNode, node.name) || visitNode(cbNode, node.type); - case 278: + case 282: return visitNodes(cbNodes, node.tags); - case 281: + case 285: return visitNode(cbNode, node.preParameterName) || visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.postParameterName); - case 282: + case 286: return visitNode(cbNode, node.typeExpression); - case 283: - return visitNode(cbNode, node.typeExpression); - case 280: + case 287: return visitNode(cbNode, node.typeExpression); case 284: + return visitNode(cbNode, node.typeExpression); + case 288: return visitNodes(cbNodes, node.typeParameters); - case 285: + case 289: return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.jsDocTypeLiteral); - case 287: + case 291: return visitNodes(cbNodes, node.jsDocPropertyTags); - case 286: + case 290: return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name); - case 294: + case 295: return visitNode(cbNode, node.expression); - case 288: + case 292: return visitNode(cbNode, node.literal); } } @@ -13730,7 +15559,7 @@ var ts; var Parser; (function (Parser) { var scanner = ts.createScanner(5, true); - var disallowInAndDecoratorContext = 65536 | 262144; + var disallowInAndDecoratorContext = 2048 | 8192; var NodeConstructor; var TokenConstructor; var IdentifierConstructor; @@ -13778,7 +15607,7 @@ var ts; identifiers = ts.createMap(); identifierCount = 0; nodeCount = 0; - contextFlags = scriptKind === 1 || scriptKind === 2 ? 2097152 : 0; + contextFlags = scriptKind === 1 || scriptKind === 2 ? 65536 : 0; parseErrorBeforeNextFinishedNode = false; scanner.setText(sourceText); scanner.setOnError(scanError); @@ -13853,7 +15682,7 @@ var ts; } Parser.fixupParentReferences = fixupParentReferences; function createSourceFile(fileName, languageVersion, scriptKind) { - var sourceFile = new SourceFileConstructor(261, 0, sourceText.length); + var sourceFile = new SourceFileConstructor(264, 0, sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -13873,16 +15702,16 @@ var ts; } } function setDisallowInContext(val) { - setContextFlag(val, 65536); + setContextFlag(val, 2048); } function setYieldContext(val) { - setContextFlag(val, 131072); + setContextFlag(val, 4096); } function setDecoratorContext(val) { - setContextFlag(val, 262144); + setContextFlag(val, 8192); } function setAwaitContext(val) { - setContextFlag(val, 524288); + setContextFlag(val, 16384); } function doOutsideOfContext(context, func) { var contextFlagsToClear = context & contextFlags; @@ -13905,40 +15734,40 @@ var ts; return func(); } function allowInAnd(func) { - return doOutsideOfContext(65536, func); + return doOutsideOfContext(2048, func); } function disallowInAnd(func) { - return doInsideOfContext(65536, func); + return doInsideOfContext(2048, func); } function doInYieldContext(func) { - return doInsideOfContext(131072, func); + return doInsideOfContext(4096, func); } function doInDecoratorContext(func) { - return doInsideOfContext(262144, func); + return doInsideOfContext(8192, func); } function doInAwaitContext(func) { - return doInsideOfContext(524288, func); + return doInsideOfContext(16384, func); } function doOutsideOfAwaitContext(func) { - return doOutsideOfContext(524288, func); + return doOutsideOfContext(16384, func); } function doInYieldAndAwaitContext(func) { - return doInsideOfContext(131072 | 524288, func); + return doInsideOfContext(4096 | 16384, func); } function inContext(flags) { return (contextFlags & flags) !== 0; } function inYieldContext() { - return inContext(131072); + return inContext(4096); } function inDisallowInContext() { - return inContext(65536); + return inContext(2048); } function inDecoratorContext() { - return inContext(262144); + return inContext(8192); } function inAwaitContext() { - return inContext(524288); + return inContext(16384); } function parseErrorAtCurrentToken(message, arg0) { var start = scanner.getTokenPos(); @@ -14080,7 +15909,7 @@ var ts; if (!(pos >= 0)) { pos = scanner.getStartPos(); } - return kind >= 141 ? new NodeConstructor(kind, pos, pos) : + return kind >= 142 ? new NodeConstructor(kind, pos, pos) : kind === 70 ? new IdentifierConstructor(kind, pos, pos) : new TokenConstructor(kind, pos, pos); } @@ -14100,7 +15929,7 @@ var ts; } if (parseErrorBeforeNextFinishedNode) { parseErrorBeforeNextFinishedNode = false; - node.flags |= 1048576; + node.flags |= 32768; } return node; } @@ -14117,7 +15946,11 @@ var ts; } function internIdentifier(text) { text = ts.escapeIdentifier(text); - return identifiers[text] || (identifiers[text] = text); + var identifier = identifiers.get(text); + if (identifier === undefined) { + identifiers.set(text, identifier = text); + } + return identifier; } function createIdentifier(isIdentifier, diagnosticMessage) { identifierCount++; @@ -14162,7 +15995,7 @@ var ts; return token() === 9 || token() === 8 || ts.tokenIsIdentifierOrKeyword(token()); } function parseComputedPropertyName() { - var node = createNode(142); + var node = createNode(143); parseExpected(20); node.expression = allowInAnd(parseExpression); parseExpected(21); @@ -14211,6 +16044,7 @@ var ts; function nextTokenIsClassOrFunctionOrAsync() { nextToken(); return token() === 74 || token() === 88 || + (token() === 116 && lookAhead(nextTokenIsClassKeywordOnSameLine)) || (token() === 119 && lookAhead(nextTokenIsFunctionKeywordOnSameLine)); } function isListElement(parsingContext, inErrorRecovery) { @@ -14418,7 +16252,7 @@ var ts; if (ts.containsParseError(node)) { return undefined; } - var nodeContextFlags = node.flags & 3080192; + var nodeContextFlags = node.flags & 96256; if (nodeContextFlags !== contextFlags) { return undefined; } @@ -14467,14 +16301,14 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 150: - case 155: case 151: + case 156: case 152: - case 147: - case 203: + case 153: + case 148: + case 205: return true; - case 149: + case 150: var methodDeclaration = node; var nameIsConstructor = methodDeclaration.name.kind === 70 && methodDeclaration.name.originalKeywordKind === 122; @@ -14486,8 +16320,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 253: - case 254: + case 256: + case 257: return true; } } @@ -14496,65 +16330,65 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 225: - case 205: - case 204: - case 208: + case 227: case 207: - case 220: - case 216: - case 218: - case 215: - case 214: - case 212: - case 213: - case 211: - case 210: - case 217: case 206: - case 221: - case 219: + case 210: case 209: case 222: - case 235: - case 234: - case 241: - case 240: - case 230: - case 226: - case 227: - case 229: + case 218: + case 220: + case 217: + case 216: + case 214: + case 215: + case 213: + case 212: + case 219: + case 208: + case 223: + case 221: + case 211: + case 224: + case 237: + case 236: + case 243: + case 242: + case 232: case 228: + case 229: + case 231: + case 230: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 260; + return node.kind === 263; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 154: - case 148: case 155: - case 146: - case 153: + case 149: + case 156: + case 147: + case 154: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 223) { + if (node.kind !== 225) { return false; } var variableDeclarator = node; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 144) { + if (node.kind !== 145) { return false; } var parameter = node; @@ -14599,7 +16433,6 @@ var ts; case 25: return ts.Diagnostics.Property_assignment_expected; } } - ; function parseDelimitedList(kind, parseElement, considerSemicolonAsDelimiter) { var saveParsingContext = parsingContext; parsingContext |= 1 << kind; @@ -14650,7 +16483,7 @@ var ts; function parseEntityName(allowReservedWords, diagnosticMessage) { var entity = parseIdentifier(diagnosticMessage); while (parseOptional(22)) { - var node = createNode(141, entity.pos); + var node = createNode(142, entity.pos); node.left = entity; node.right = parseRightSideOfDot(allowReservedWords); entity = finishNode(node); @@ -14667,7 +16500,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(194); + var template = createNode(195); template.head = parseTemplateHead(); ts.Debug.assert(template.head.kind === 13, "Template head has wrong token kind"); var templateSpans = createNodeArray(); @@ -14679,7 +16512,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(202); + var span = createNode(204); span.expression = allowInAnd(parseExpression); var literal; if (token() === 17) { @@ -14715,20 +16548,16 @@ var ts; if (scanner.isUnterminated()) { node.isUnterminated = true; } - var tokenPos = scanner.getTokenPos(); + if (node.kind === 8) { + node.numericLiteralFlags = scanner.getNumericLiteralFlags(); + } nextToken(); finishNode(node); - if (node.kind === 8 - && sourceText.charCodeAt(tokenPos) === 48 - && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { - node.isOctalLiteral = true; - } return node; } function parseTypeReference() { - var typeName = parseEntityName(false, ts.Diagnostics.Type_expected); - var node = createNode(157, typeName.pos); - node.typeName = typeName; + var node = createNode(158); + node.typeName = parseEntityName(false, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && token() === 26) { node.typeArguments = parseBracketedList(19, parseType, 26, 28); } @@ -14736,24 +16565,24 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(156, lhs.pos); + var node = createNode(157, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(167); + var node = createNode(168); nextToken(); return finishNode(node); } function parseTypeQuery() { - var node = createNode(160); + var node = createNode(161); parseExpected(102); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(143); + var node = createNode(144); node.name = parseIdentifier(); if (parseOptional(84)) { if (isStartOfType() || !isStartOfExpression()) { @@ -14763,6 +16592,9 @@ var ts; node.expression = parseUnaryExpressionOrHigher(); } } + if (parseOptional(57)) { + node.default = parseType(); + } return finishNode(node); } function parseTypeParameters() { @@ -14780,9 +16612,9 @@ var ts; return token() === 23 || isIdentifierOrPattern() || ts.isModifierKind(token()) || token() === 56 || token() === 98; } function parseParameter() { - var node = createNode(144); + var node = createNode(145); if (token() === 98) { - node.name = createIdentifier(true, undefined); + node.name = createIdentifier(true); node.type = parseParameterType(); return finishNode(node); } @@ -14840,7 +16672,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNode(kind); - if (kind === 154) { + if (kind === 155) { parseExpected(93); } fillSignature(55, false, false, false, node); @@ -14880,7 +16712,7 @@ var ts; return token() === 55 || token() === 25 || token() === 21; } function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) { - var node = createNode(155, fullStart); + var node = createNode(156, fullStart); node.decorators = decorators; node.modifiers = modifiers; node.parameters = parseBracketedList(16, parseParameter, 20, 21); @@ -14892,7 +16724,7 @@ var ts; var name = parsePropertyName(); var questionToken = parseOptionalToken(54); if (token() === 18 || token() === 26) { - var method = createNode(148, fullStart); + var method = createNode(149, fullStart); method.modifiers = modifiers; method.name = name; method.questionToken = questionToken; @@ -14901,7 +16733,7 @@ var ts; return addJSDocComment(finishNode(method)); } else { - var property = createNode(146, fullStart); + var property = createNode(147, fullStart); property.modifiers = modifiers; property.name = name; property.questionToken = questionToken; @@ -14914,19 +16746,19 @@ var ts; } } function isTypeMemberStart() { - var idToken; if (token() === 18 || token() === 26) { return true; } + var idToken; while (ts.isModifierKind(token())) { - idToken = token(); + idToken = true; nextToken(); } if (token() === 20) { return true; } if (isLiteralPropertyName()) { - idToken = token(); + idToken = true; nextToken(); } if (idToken) { @@ -14941,10 +16773,10 @@ var ts; } function parseTypeMember() { if (token() === 18 || token() === 26) { - return parseSignatureMember(153); + return parseSignatureMember(154); } if (token() === 93 && lookAhead(isStartOfConstructSignature)) { - return parseSignatureMember(154); + return parseSignatureMember(155); } var fullStart = getNodePos(); var modifiers = parseModifiers(); @@ -14958,7 +16790,7 @@ var ts; return token() === 18 || token() === 26; } function parseTypeLiteral() { - var node = createNode(161); + var node = createNode(162); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -14981,14 +16813,14 @@ var ts; return token() === 20 && nextTokenIsIdentifier() && nextToken() === 91; } function parseMappedTypeParameter() { - var node = createNode(143); + var node = createNode(144); node.name = parseIdentifier(); parseExpected(91); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(170); + var node = createNode(171); parseExpected(16); node.readonlyToken = parseOptionalToken(130); parseExpected(20); @@ -15001,12 +16833,12 @@ var ts; return finishNode(node); } function parseTupleType() { - var node = createNode(163); + var node = createNode(164); node.elementTypes = parseBracketedList(20, parseType, 20, 21); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(166); + var node = createNode(167); parseExpected(18); node.type = parseType(); parseExpected(19); @@ -15014,7 +16846,7 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNode(kind); - if (kind === 159) { + if (kind === 160) { parseExpected(93); } fillSignature(35, false, false, false, node); @@ -15025,7 +16857,7 @@ var ts; return token() === 22 ? undefined : node; } function parseLiteralTypeNode() { - var node = createNode(171); + var node = createNode(172); node.literal = parseSimpleUnaryExpression(); finishNode(node); return node; @@ -15036,12 +16868,13 @@ var ts; function parseNonArrayType() { switch (token()) { case 118: - case 134: + case 135: case 132: case 121: - case 135: - case 137: + case 136: + case 138: case 129: + case 133: var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReference(); case 9: @@ -15078,12 +16911,12 @@ var ts; function isStartOfType() { switch (token()) { case 118: - case 134: + case 135: case 132: case 121: - case 135: + case 136: case 104: - case 137: + case 138: case 94: case 98: case 102: @@ -15091,11 +16924,14 @@ var ts; case 16: case 20: case 26: + case 48: + case 47: case 93: case 9: case 8: case 100: case 85: + case 133: return true; case 37: return lookAhead(nextTokenIsNumericLiteral); @@ -15113,14 +16949,14 @@ var ts; var type = parseNonArrayType(); while (!scanner.hasPrecedingLineBreak() && parseOptional(20)) { if (isStartOfType()) { - var node = createNode(169, type.pos); + var node = createNode(170, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(21); type = finishNode(node); } else { - var node = createNode(162, type.pos); + var node = createNode(163, type.pos); node.elementType = type; parseExpected(21); type = finishNode(node); @@ -15129,7 +16965,7 @@ var ts; return type; } function parseTypeOperator(operator) { - var node = createNode(168); + var node = createNode(169); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); @@ -15143,6 +16979,7 @@ var ts; return parseArrayTypeOrHigher(); } function parseUnionOrIntersectionType(kind, parseConstituentType, operator) { + parseOptional(operator); var type = parseConstituentType(); if (token() === operator) { var types = createNodeArray([type], type.pos); @@ -15157,10 +16994,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(165, parseTypeOperatorOrHigher, 47); + return parseUnionOrIntersectionType(166, parseTypeOperatorOrHigher, 47); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(164, parseIntersectionTypeOrHigher, 48); + return parseUnionOrIntersectionType(165, parseIntersectionTypeOrHigher, 48); } function isStartOfFunctionType() { if (token() === 26) { @@ -15206,7 +17043,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(156, typePredicateVariable.pos); + var node = createNode(157, typePredicateVariable.pos); node.parameterName = typePredicateVariable; node.type = type; return finishNode(node); @@ -15223,14 +17060,14 @@ var ts; } } function parseType() { - return doOutsideOfContext(655360, parseTypeWorker); + return doOutsideOfContext(20480, parseTypeWorker); } function parseTypeWorker() { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(158); + return parseFunctionOrConstructorType(159); } if (token() === 93) { - return parseFunctionOrConstructorType(159); + return parseFunctionOrConstructorType(160); } return parseUnionTypeOrHigher(); } @@ -15349,7 +17186,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(195); + var node = createNode(196); nextToken(); if (!scanner.hasPrecedingLineBreak() && (token() === 38 || isStartOfExpression())) { @@ -15365,13 +17202,13 @@ var ts; ts.Debug.assert(token() === 35, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(185, asyncModifier.pos); + node = createNode(186, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(185, identifier.pos); + node = createNode(186, identifier.pos); } - var parameter = createNode(144, identifier.pos); + var parameter = createNode(145, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos); @@ -15505,7 +17342,7 @@ var ts; return 0; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(185); + var node = createNode(186); node.modifiers = parseModifiersForArrowFunction(); var isAsync = !!(ts.getModifierFlags(node) & 256); fillSignature(55, false, isAsync, !allowAmbiguity, node); @@ -15537,7 +17374,7 @@ var ts; if (!questionToken) { return leftOperand; } - var node = createNode(193, leftOperand.pos); + var node = createNode(194, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -15550,7 +17387,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 91 || t === 140; + return t === 91 || t === 141; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -15628,43 +17465,43 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(192, left.pos); + var node = createNode(193, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(200, left.pos); + var node = createNode(201, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(190); + var node = createNode(191); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(186); - nextToken(); - node.expression = parseSimpleUnaryExpression(); - return finishNode(node); - } - function parseTypeOfExpression() { var node = createNode(187); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } - function parseVoidExpression() { + function parseTypeOfExpression() { var node = createNode(188); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } + function parseVoidExpression() { + var node = createNode(189); + nextToken(); + node.expression = parseSimpleUnaryExpression(); + return finishNode(node); + } function isAwaitExpression() { if (token() === 120) { if (inAwaitContext()) { @@ -15675,7 +17512,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(189); + var node = createNode(190); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -15691,7 +17528,7 @@ var ts; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token() === 39) { var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); - if (simpleUnaryExpression.kind === 182) { + if (simpleUnaryExpression.kind === 183) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -15744,7 +17581,7 @@ var ts; } function parseIncrementExpression() { if (token() === 42 || token() === 43) { - var node = createNode(190); + var node = createNode(191); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -15756,7 +17593,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 42 || token() === 43) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(191, expression.pos); + var node = createNode(192, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -15779,7 +17616,7 @@ var ts; if (token() === 18 || token() === 22 || token() === 20) { return expression; } - var node = createNode(177, expression.pos); + var node = createNode(178, expression.pos); node.expression = expression; parseExpectedToken(22, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(true); @@ -15801,8 +17638,8 @@ var ts; function parseJsxElementOrSelfClosingElement(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElement(inExpressionContext); var result; - if (opening.kind === 248) { - var node = createNode(246, opening.pos); + if (opening.kind === 250) { + var node = createNode(248, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement.tagName); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -15812,14 +17649,14 @@ var ts; result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 247); + ts.Debug.assert(opening.kind === 249); result = opening; } if (inExpressionContext && token() === 26) { var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElement(true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(192, result.pos); + var badNode = createNode(193, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -15859,20 +17696,28 @@ var ts; parseErrorAtPosition(openingTagName.pos, openingTagName.end - openingTagName.pos, ts.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, ts.getTextOfNodeFromSourceText(sourceText, openingTagName)); break; } + else if (token() === 7) { + break; + } result.push(parseJsxChild()); } result.end = scanner.getTokenPos(); parsingContext = saveParsingContext; return result; } + function parseJsxAttributes() { + var jsxAttributes = createNode(253); + jsxAttributes.properties = parseList(13, parseJsxAttribute); + return finishNode(jsxAttributes); + } function parseJsxOpeningOrSelfClosingElement(inExpressionContext) { var fullStart = scanner.getStartPos(); parseExpected(26); var tagName = parseJsxElementName(); - var attributes = parseList(13, parseJsxAttribute); + var attributes = parseJsxAttributes(); var node; if (token() === 28) { - node = createNode(248, fullStart); + node = createNode(250, fullStart); scanJsxText(); } else { @@ -15884,7 +17729,7 @@ var ts; parseExpected(28, undefined, false); scanJsxText(); } - node = createNode(247, fullStart); + node = createNode(249, fullStart); } node.tagName = tagName; node.attributes = attributes; @@ -15895,7 +17740,7 @@ var ts; var expression = token() === 98 ? parseTokenNode() : parseIdentifierName(); while (parseOptional(22)) { - var propertyAccess = createNode(177, expression.pos); + var propertyAccess = createNode(178, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(true); expression = finishNode(propertyAccess); @@ -15903,9 +17748,10 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(252); + var node = createNode(255); parseExpected(16); if (token() !== 17) { + node.dotDotDotToken = parseOptionalToken(23); node.expression = parseAssignmentExpressionOrHigher(); } if (inExpressionContext) { @@ -15922,7 +17768,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(250); + var node = createNode(252); node.name = parseIdentifierName(); if (token() === 57) { switch (scanJsxAttributeValue()) { @@ -15937,7 +17783,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(251); + var node = createNode(254); parseExpected(16); parseExpected(23); node.expression = parseExpression(); @@ -15945,7 +17791,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(249); + var node = createNode(251); parseExpected(27); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -15958,7 +17804,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(182); + var node = createNode(183); parseExpected(26); node.type = parseType(); parseExpected(28); @@ -15969,7 +17815,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(22); if (dotToken) { - var propertyAccess = createNode(177, expression.pos); + var propertyAccess = createNode(178, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(true); expression = finishNode(propertyAccess); @@ -15977,13 +17823,13 @@ var ts; } if (token() === 50 && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(201, expression.pos); + var nonNullExpression = createNode(202, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; } if (!inDecoratorContext() && parseOptional(20)) { - var indexedAccess = createNode(178, expression.pos); + var indexedAccess = createNode(179, expression.pos); indexedAccess.expression = expression; if (token() !== 21) { indexedAccess.argumentExpression = allowInAnd(parseExpression); @@ -15997,7 +17843,7 @@ var ts; continue; } if (token() === 12 || token() === 13) { - var tagExpression = createNode(181, expression.pos); + var tagExpression = createNode(182, expression.pos); tagExpression.tag = expression; tagExpression.template = token() === 12 ? parseLiteralNode() @@ -16016,7 +17862,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(179, expression.pos); + var callExpr = createNode(180, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -16024,7 +17870,7 @@ var ts; continue; } else if (token() === 18) { - var callExpr = createNode(179, expression.pos); + var callExpr = createNode(180, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -16119,28 +17965,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(183); + var node = createNode(184); parseExpected(18); node.expression = allowInAnd(parseExpression); parseExpected(19); return finishNode(node); } function parseSpreadElement() { - var node = createNode(196); + var node = createNode(197); parseExpected(23); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 23 ? parseSpreadElement() : - token() === 25 ? createNode(198) : + token() === 25 ? createNode(199) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(175); + var node = createNode(176); parseExpected(20); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -16151,18 +17997,18 @@ var ts; } function tryParseAccessorDeclaration(fullStart, decorators, modifiers) { if (parseContextualModifier(124)) { - return parseAccessorDeclaration(151, fullStart, decorators, modifiers); - } - else if (parseContextualModifier(133)) { return parseAccessorDeclaration(152, fullStart, decorators, modifiers); } + else if (parseContextualModifier(134)) { + return parseAccessorDeclaration(153, fullStart, decorators, modifiers); + } return undefined; } function parseObjectLiteralElement() { var fullStart = scanner.getStartPos(); var dotDotDotToken = parseOptionalToken(23); if (dotDotDotToken) { - var spreadElement = createNode(259, fullStart); + var spreadElement = createNode(262, fullStart); spreadElement.expression = parseAssignmentExpressionOrHigher(); return addJSDocComment(finishNode(spreadElement)); } @@ -16181,7 +18027,7 @@ var ts; } var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 25 || token() === 17 || token() === 57); if (isShorthandPropertyAssignment) { - var shorthandDeclaration = createNode(258, fullStart); + var shorthandDeclaration = createNode(261, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; var equalsToken = parseOptionalToken(57); @@ -16192,7 +18038,7 @@ var ts; return addJSDocComment(finishNode(shorthandDeclaration)); } else { - var propertyAssignment = createNode(257, fullStart); + var propertyAssignment = createNode(260, fullStart); propertyAssignment.modifiers = modifiers; propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; @@ -16202,7 +18048,7 @@ var ts; } } function parseObjectLiteralExpression() { - var node = createNode(176); + var node = createNode(177); parseExpected(16); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -16216,7 +18062,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(false); } - var node = createNode(184); + var node = createNode(185); node.modifiers = parseModifiers(); parseExpected(88); node.asteriskToken = parseOptionalToken(38); @@ -16238,8 +18084,15 @@ var ts; return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(180); + var fullStart = scanner.getStartPos(); parseExpected(93); + if (parseOptional(22)) { + var node_1 = createNode(203, fullStart); + node_1.keywordToken = 93; + node_1.name = parseIdentifierName(); + return finishNode(node_1); + } + var node = createNode(181, fullStart); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); if (node.typeArguments || token() === 18) { @@ -16248,7 +18101,7 @@ var ts; return finishNode(node); } function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(204); + var node = createNode(206); if (parseExpected(16, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -16279,12 +18132,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(206); + var node = createNode(208); parseExpected(24); return finishNode(node); } function parseIfStatement() { - var node = createNode(208); + var node = createNode(210); parseExpected(89); parseExpected(18); node.expression = allowInAnd(parseExpression); @@ -16294,7 +18147,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(209); + var node = createNode(211); parseExpected(80); node.statement = parseStatement(); parseExpected(105); @@ -16305,7 +18158,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(210); + var node = createNode(212); parseExpected(105); parseExpected(18); node.expression = allowInAnd(parseExpression); @@ -16316,6 +18169,7 @@ var ts; function parseForOrForInOrForOfStatement() { var pos = getNodePos(); parseExpected(87); + var awaitToken = parseOptionalToken(120); parseExpected(18); var initializer = undefined; if (token() !== 24) { @@ -16327,22 +18181,23 @@ var ts; } } var forOrForInOrForOfStatement; - if (parseOptional(91)) { - var forInStatement = createNode(212, pos); - forInStatement.initializer = initializer; - forInStatement.expression = allowInAnd(parseExpression); - parseExpected(19); - forOrForInOrForOfStatement = forInStatement; - } - else if (parseOptional(140)) { - var forOfStatement = createNode(213, pos); + if (awaitToken ? parseExpected(141) : parseOptional(141)) { + var forOfStatement = createNode(215, pos); + forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(19); forOrForInOrForOfStatement = forOfStatement; } + else if (parseOptional(91)) { + var forInStatement = createNode(214, pos); + forInStatement.initializer = initializer; + forInStatement.expression = allowInAnd(parseExpression); + parseExpected(19); + forOrForInOrForOfStatement = forInStatement; + } else { - var forStatement = createNode(211, pos); + var forStatement = createNode(213, pos); forStatement.initializer = initializer; parseExpected(24); if (token() !== 24 && token() !== 19) { @@ -16360,7 +18215,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 215 ? 71 : 76); + parseExpected(kind === 217 ? 71 : 76); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -16368,7 +18223,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(216); + var node = createNode(218); parseExpected(95); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -16377,7 +18232,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(217); + var node = createNode(219); parseExpected(106); parseExpected(18); node.expression = allowInAnd(parseExpression); @@ -16386,7 +18241,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(253); + var node = createNode(256); parseExpected(72); node.expression = allowInAnd(parseExpression); parseExpected(55); @@ -16394,7 +18249,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(254); + var node = createNode(257); parseExpected(78); parseExpected(55); node.statements = parseList(3, parseStatement); @@ -16404,12 +18259,12 @@ var ts; return token() === 72 ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(218); + var node = createNode(220); parseExpected(97); parseExpected(18); node.expression = allowInAnd(parseExpression); parseExpected(19); - var caseBlock = createNode(232, scanner.getStartPos()); + var caseBlock = createNode(234, scanner.getStartPos()); parseExpected(16); caseBlock.clauses = parseList(2, parseCaseOrDefaultClause); parseExpected(17); @@ -16417,14 +18272,14 @@ var ts; return finishNode(node); } function parseThrowStatement() { - var node = createNode(220); + var node = createNode(222); parseExpected(99); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } function parseTryStatement() { - var node = createNode(221); + var node = createNode(223); parseExpected(101); node.tryBlock = parseBlock(false); node.catchClause = token() === 73 ? parseCatchClause() : undefined; @@ -16435,7 +18290,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(256); + var result = createNode(259); parseExpected(73); if (parseExpected(18)) { result.variableDeclaration = parseVariableDeclaration(); @@ -16445,7 +18300,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(222); + var node = createNode(224); parseExpected(77); parseSemicolon(); return finishNode(node); @@ -16454,13 +18309,13 @@ var ts; var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); if (expression.kind === 70 && parseOptional(55)) { - var labeledStatement = createNode(219, fullStart); + var labeledStatement = createNode(221, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return addJSDocComment(finishNode(labeledStatement)); } else { - var expressionStatement = createNode(207, fullStart); + var expressionStatement = createNode(209, fullStart); expressionStatement.expression = expression; parseSemicolon(); return addJSDocComment(finishNode(expressionStatement)); @@ -16470,6 +18325,10 @@ var ts; nextToken(); return ts.tokenIsIdentifierOrKeyword(token()) && !scanner.hasPrecedingLineBreak(); } + function nextTokenIsClassKeywordOnSameLine() { + nextToken(); + return token() === 74 && !scanner.hasPrecedingLineBreak(); + } function nextTokenIsFunctionKeywordOnSameLine() { nextToken(); return token() === 88 && !scanner.hasPrecedingLineBreak(); @@ -16489,7 +18348,7 @@ var ts; case 82: return true; case 108: - case 136: + case 137: return nextTokenIsIdentifierOnSameLine(); case 127: case 128: @@ -16506,7 +18365,7 @@ var ts; return false; } continue; - case 139: + case 140: nextToken(); return token() === 16 || token() === 70 || token() === 83; case 90: @@ -16566,8 +18425,8 @@ var ts; case 108: case 127: case 128: - case 136: - case 139: + case 137: + case 140: return true; case 113: case 111: @@ -16612,9 +18471,9 @@ var ts; case 87: return parseForOrForInOrForOfStatement(); case 76: - return parseBreakOrContinueStatement(214); + return parseBreakOrContinueStatement(216); case 71: - return parseBreakOrContinueStatement(215); + return parseBreakOrContinueStatement(217); case 95: return parseReturnStatement(); case 106: @@ -16633,7 +18492,7 @@ var ts; return parseDeclaration(); case 119: case 108: - case 136: + case 137: case 127: case 128: case 123: @@ -16647,7 +18506,7 @@ var ts; case 116: case 114: case 130: - case 139: + case 140: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -16670,11 +18529,11 @@ var ts; return parseClassDeclaration(fullStart, decorators, modifiers); case 108: return parseInterfaceDeclaration(fullStart, decorators, modifiers); - case 136: + case 137: return parseTypeAliasDeclaration(fullStart, decorators, modifiers); case 82: return parseEnumDeclaration(fullStart, decorators, modifiers); - case 139: + case 140: case 127: case 128: return parseModuleDeclaration(fullStart, decorators, modifiers); @@ -16693,7 +18552,7 @@ var ts; } default: if (decorators || modifiers) { - var node = createMissingNode(244, true, ts.Diagnostics.Declaration_expected); + var node = createMissingNode(246, true, ts.Diagnostics.Declaration_expected); node.pos = fullStart; node.decorators = decorators; node.modifiers = modifiers; @@ -16714,16 +18573,16 @@ var ts; } function parseArrayBindingElement() { if (token() === 25) { - return createNode(198); + return createNode(199); } - var node = createNode(174); + var node = createNode(175); node.dotDotDotToken = parseOptionalToken(23); node.name = parseIdentifierOrPattern(); node.initializer = parseBindingElementInitializer(false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(174); + var node = createNode(175); node.dotDotDotToken = parseOptionalToken(23); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -16739,14 +18598,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(172); + var node = createNode(173); parseExpected(16); node.elements = parseDelimitedList(9, parseObjectBindingElement); parseExpected(17); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(173); + var node = createNode(174); parseExpected(20); node.elements = parseDelimitedList(10, parseArrayBindingElement); parseExpected(21); @@ -16765,7 +18624,7 @@ var ts; return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(223); + var node = createNode(225); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token())) { @@ -16774,7 +18633,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(224); + var node = createNode(226); switch (token()) { case 103: break; @@ -16788,7 +18647,7 @@ var ts; ts.Debug.fail(); } nextToken(); - if (token() === 140 && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 141 && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -16803,7 +18662,7 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 19; } function parseVariableStatement(fullStart, decorators, modifiers) { - var node = createNode(205, fullStart); + var node = createNode(207, fullStart); node.decorators = decorators; node.modifiers = modifiers; node.declarationList = parseVariableDeclarationList(false); @@ -16811,7 +18670,7 @@ var ts; return addJSDocComment(finishNode(node)); } function parseFunctionDeclaration(fullStart, decorators, modifiers) { - var node = createNode(225, fullStart); + var node = createNode(227, fullStart); node.decorators = decorators; node.modifiers = modifiers; parseExpected(88); @@ -16824,7 +18683,7 @@ var ts; return addJSDocComment(finishNode(node)); } function parseConstructorDeclaration(pos, decorators, modifiers) { - var node = createNode(150, pos); + var node = createNode(151, pos); node.decorators = decorators; node.modifiers = modifiers; parseExpected(122); @@ -16833,7 +18692,7 @@ var ts; return addJSDocComment(finishNode(node)); } function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { - var method = createNode(149, fullStart); + var method = createNode(150, fullStart); method.decorators = decorators; method.modifiers = modifiers; method.asteriskToken = asteriskToken; @@ -16846,7 +18705,7 @@ var ts; return addJSDocComment(finishNode(method)); } function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) { - var property = createNode(147, fullStart); + var property = createNode(148, fullStart); property.decorators = decorators; property.modifiers = modifiers; property.name = name; @@ -16854,7 +18713,7 @@ var ts; property.type = parseTypeAnnotation(); property.initializer = ts.hasModifier(property, 32) ? allowInAnd(parseNonParameterInitializer) - : doOutsideOfContext(131072 | 65536, parseNonParameterInitializer); + : doOutsideOfContext(4096 | 2048, parseNonParameterInitializer); parseSemicolon(); return addJSDocComment(finishNode(property)); } @@ -16916,7 +18775,7 @@ var ts; return true; } if (idToken !== undefined) { - if (!ts.isKeyword(idToken) || idToken === 133 || idToken === 124) { + if (!ts.isKeyword(idToken) || idToken === 134 || idToken === 124) { return true; } switch (token()) { @@ -16939,7 +18798,7 @@ var ts; if (!parseOptional(56)) { break; } - var decorator = createNode(145, decoratorStart); + var decorator = createNode(146, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); if (!decorators) { @@ -16996,7 +18855,7 @@ var ts; } function parseClassElement() { if (token() === 24) { - var result = createNode(203); + var result = createNode(205); nextToken(); return finishNode(result); } @@ -17021,16 +18880,16 @@ var ts; return parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers); } if (decorators || modifiers) { - var name_15 = createMissingNode(70, true, ts.Diagnostics.Declaration_expected); - return parsePropertyDeclaration(fullStart, decorators, modifiers, name_15, undefined); + var name = createMissingNode(70, true, ts.Diagnostics.Declaration_expected); + return parsePropertyDeclaration(fullStart, decorators, modifiers, name, undefined); } ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 197); + return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 198); } function parseClassDeclaration(fullStart, decorators, modifiers) { - return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 226); + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 228); } function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { var node = createNode(kind, fullStart); @@ -17064,9 +18923,10 @@ var ts; return undefined; } function parseHeritageClause() { - if (token() === 84 || token() === 107) { - var node = createNode(255); - node.token = token(); + var tok = token(); + if (tok === 84 || tok === 107) { + var node = createNode(258); + node.token = tok; nextToken(); node.types = parseDelimitedList(7, parseExpressionWithTypeArguments); return finishNode(node); @@ -17074,7 +18934,7 @@ var ts; return undefined; } function parseExpressionWithTypeArguments() { - var node = createNode(199); + var node = createNode(200); node.expression = parseLeftHandSideExpressionOrHigher(); if (token() === 26) { node.typeArguments = parseBracketedList(19, parseType, 26, 28); @@ -17088,7 +18948,7 @@ var ts; return parseList(5, parseClassElement); } function parseInterfaceDeclaration(fullStart, decorators, modifiers) { - var node = createNode(227, fullStart); + var node = createNode(229, fullStart); node.decorators = decorators; node.modifiers = modifiers; parseExpected(108); @@ -17099,10 +18959,10 @@ var ts; return addJSDocComment(finishNode(node)); } function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { - var node = createNode(228, fullStart); + var node = createNode(230, fullStart); node.decorators = decorators; node.modifiers = modifiers; - parseExpected(136); + parseExpected(137); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(57); @@ -17111,13 +18971,13 @@ var ts; return addJSDocComment(finishNode(node)); } function parseEnumMember() { - var node = createNode(260, scanner.getStartPos()); + var node = createNode(263, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return addJSDocComment(finishNode(node)); } function parseEnumDeclaration(fullStart, decorators, modifiers) { - var node = createNode(229, fullStart); + var node = createNode(231, fullStart); node.decorators = decorators; node.modifiers = modifiers; parseExpected(82); @@ -17132,7 +18992,7 @@ var ts; return addJSDocComment(finishNode(node)); } function parseModuleBlock() { - var node = createNode(231, scanner.getStartPos()); + var node = createNode(233, scanner.getStartPos()); if (parseExpected(16)) { node.statements = parseList(1, parseStatement); parseExpected(17); @@ -17143,7 +19003,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags) { - var node = createNode(230, fullStart); + var node = createNode(232, fullStart); var namespaceFlag = flags & 16; node.decorators = decorators; node.modifiers = modifiers; @@ -17155,10 +19015,10 @@ var ts; return addJSDocComment(finishNode(node)); } function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { - var node = createNode(230, fullStart); + var node = createNode(232, fullStart); node.decorators = decorators; node.modifiers = modifiers; - if (token() === 139) { + if (token() === 140) { node.name = parseIdentifier(); node.flags |= 512; } @@ -17175,7 +19035,7 @@ var ts; } function parseModuleDeclaration(fullStart, decorators, modifiers) { var flags = 0; - if (token() === 139) { + if (token() === 140) { return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers); } else if (parseOptional(128)) { @@ -17200,7 +19060,7 @@ var ts; return nextToken() === 40; } function parseNamespaceExportDeclaration(fullStart, decorators, modifiers) { - var exportDeclaration = createNode(233, fullStart); + var exportDeclaration = createNode(235, fullStart); exportDeclaration.decorators = decorators; exportDeclaration.modifiers = modifiers; parseExpected(117); @@ -17215,38 +19075,41 @@ var ts; var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token() !== 25 && token() !== 138) { - var importEqualsDeclaration = createNode(234, fullStart); - importEqualsDeclaration.decorators = decorators; - importEqualsDeclaration.modifiers = modifiers; - importEqualsDeclaration.name = identifier; - parseExpected(57); - importEqualsDeclaration.moduleReference = parseModuleReference(); - parseSemicolon(); - return addJSDocComment(finishNode(importEqualsDeclaration)); + if (token() !== 25 && token() !== 139) { + return parseImportEqualsDeclaration(fullStart, decorators, modifiers, identifier); } } - var importDeclaration = createNode(235, fullStart); + var importDeclaration = createNode(237, fullStart); importDeclaration.decorators = decorators; importDeclaration.modifiers = modifiers; if (identifier || token() === 38 || token() === 16) { importDeclaration.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(138); + parseExpected(139); } importDeclaration.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); return finishNode(importDeclaration); } + function parseImportEqualsDeclaration(fullStart, decorators, modifiers, identifier) { + var importEqualsDeclaration = createNode(236, fullStart); + importEqualsDeclaration.decorators = decorators; + importEqualsDeclaration.modifiers = modifiers; + importEqualsDeclaration.name = identifier; + parseExpected(57); + importEqualsDeclaration.moduleReference = parseModuleReference(); + parseSemicolon(); + return addJSDocComment(finishNode(importEqualsDeclaration)); + } function parseImportClause(identifier, fullStart) { - var importClause = createNode(236, fullStart); + var importClause = createNode(238, fullStart); if (identifier) { importClause.name = identifier; } if (!importClause.name || parseOptional(25)) { - importClause.namedBindings = token() === 38 ? parseNamespaceImport() : parseNamedImportsOrExports(238); + importClause.namedBindings = token() === 38 ? parseNamespaceImport() : parseNamedImportsOrExports(240); } return finishNode(importClause); } @@ -17256,7 +19119,7 @@ var ts; : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(245); + var node = createNode(247); parseExpected(131); parseExpected(18); node.expression = parseModuleSpecifier(); @@ -17274,7 +19137,7 @@ var ts; } } function parseNamespaceImport() { - var namespaceImport = createNode(237); + var namespaceImport = createNode(239); parseExpected(38); parseExpected(117); namespaceImport.name = parseIdentifier(); @@ -17282,14 +19145,14 @@ var ts; } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(22, kind === 238 ? parseImportSpecifier : parseExportSpecifier, 16, 17); + node.elements = parseBracketedList(22, kind === 240 ? parseImportSpecifier : parseExportSpecifier, 16, 17); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(243); + return parseImportOrExportSpecifier(245); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(239); + return parseImportOrExportSpecifier(241); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -17308,23 +19171,23 @@ var ts; else { node.name = identifierName; } - if (kind === 239 && checkIdentifierIsKeyword) { + if (kind === 241 && checkIdentifierIsKeyword) { parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(fullStart, decorators, modifiers) { - var node = createNode(241, fullStart); + var node = createNode(243, fullStart); node.decorators = decorators; node.modifiers = modifiers; if (parseOptional(38)) { - parseExpected(138); + parseExpected(139); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(242); - if (token() === 138 || (token() === 9 && !scanner.hasPrecedingLineBreak())) { - parseExpected(138); + node.exportClause = parseNamedImportsOrExports(244); + if (token() === 139 || (token() === 9 && !scanner.hasPrecedingLineBreak())) { + parseExpected(139); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -17332,7 +19195,7 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, decorators, modifiers) { - var node = createNode(240, fullStart); + var node = createNode(242, fullStart); node.decorators = decorators; node.modifiers = modifiers; if (parseOptional(57)) { @@ -17351,6 +19214,7 @@ var ts; var typeReferenceDirectives = []; var amdDependencies = []; var amdModuleName; + var checkJsDirective = undefined; while (true) { var kind = triviaScanner.scan(); if (kind !== 2) { @@ -17361,7 +19225,11 @@ var ts; break; } } - var range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos(), kind: triviaScanner.getToken() }; + var range = { + kind: triviaScanner.getToken(), + pos: triviaScanner.getTokenPos(), + end: triviaScanner.getTextPos(), + }; var comment = sourceText.substring(range.pos, range.end); var referencePathMatchResult = ts.getFileReferenceFromReferencePath(comment, range); if (referencePathMatchResult) { @@ -17401,24 +19269,71 @@ var ts; amdDependencies.push(amdDependency); } } + var checkJsDirectiveRegEx = /^\/\/\/?\s*(@ts-check|@ts-nocheck)\s*$/gim; + var checkJsDirectiveMatchResult = checkJsDirectiveRegEx.exec(comment); + if (checkJsDirectiveMatchResult) { + checkJsDirective = { + enabled: ts.compareStrings(checkJsDirectiveMatchResult[1], "@ts-check", true) === 0, + end: range.end, + pos: range.pos + }; + } } } sourceFile.referencedFiles = referencedFiles; sourceFile.typeReferenceDirectives = typeReferenceDirectives; sourceFile.amdDependencies = amdDependencies; sourceFile.moduleName = amdModuleName; + sourceFile.checkJsDirective = checkJsDirective; } function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return ts.hasModifier(node, 1) - || node.kind === 234 && node.moduleReference.kind === 245 - || node.kind === 235 - || node.kind === 240 - || node.kind === 241 + || node.kind === 236 && node.moduleReference.kind === 247 + || node.kind === 237 + || node.kind === 242 + || node.kind === 243 ? node : undefined; }); } + var ParsingContext; + (function (ParsingContext) { + ParsingContext[ParsingContext["SourceElements"] = 0] = "SourceElements"; + ParsingContext[ParsingContext["BlockStatements"] = 1] = "BlockStatements"; + ParsingContext[ParsingContext["SwitchClauses"] = 2] = "SwitchClauses"; + ParsingContext[ParsingContext["SwitchClauseStatements"] = 3] = "SwitchClauseStatements"; + ParsingContext[ParsingContext["TypeMembers"] = 4] = "TypeMembers"; + ParsingContext[ParsingContext["ClassMembers"] = 5] = "ClassMembers"; + ParsingContext[ParsingContext["EnumMembers"] = 6] = "EnumMembers"; + ParsingContext[ParsingContext["HeritageClauseElement"] = 7] = "HeritageClauseElement"; + ParsingContext[ParsingContext["VariableDeclarations"] = 8] = "VariableDeclarations"; + ParsingContext[ParsingContext["ObjectBindingElements"] = 9] = "ObjectBindingElements"; + ParsingContext[ParsingContext["ArrayBindingElements"] = 10] = "ArrayBindingElements"; + ParsingContext[ParsingContext["ArgumentExpressions"] = 11] = "ArgumentExpressions"; + ParsingContext[ParsingContext["ObjectLiteralMembers"] = 12] = "ObjectLiteralMembers"; + ParsingContext[ParsingContext["JsxAttributes"] = 13] = "JsxAttributes"; + ParsingContext[ParsingContext["JsxChildren"] = 14] = "JsxChildren"; + ParsingContext[ParsingContext["ArrayLiteralMembers"] = 15] = "ArrayLiteralMembers"; + ParsingContext[ParsingContext["Parameters"] = 16] = "Parameters"; + ParsingContext[ParsingContext["RestProperties"] = 17] = "RestProperties"; + ParsingContext[ParsingContext["TypeParameters"] = 18] = "TypeParameters"; + ParsingContext[ParsingContext["TypeArguments"] = 19] = "TypeArguments"; + ParsingContext[ParsingContext["TupleElementTypes"] = 20] = "TupleElementTypes"; + ParsingContext[ParsingContext["HeritageClauses"] = 21] = "HeritageClauses"; + ParsingContext[ParsingContext["ImportOrExportSpecifiers"] = 22] = "ImportOrExportSpecifiers"; + ParsingContext[ParsingContext["JSDocFunctionParameters"] = 23] = "JSDocFunctionParameters"; + ParsingContext[ParsingContext["JSDocTypeArguments"] = 24] = "JSDocTypeArguments"; + ParsingContext[ParsingContext["JSDocRecordMembers"] = 25] = "JSDocRecordMembers"; + ParsingContext[ParsingContext["JSDocTupleTypes"] = 26] = "JSDocTupleTypes"; + ParsingContext[ParsingContext["Count"] = 27] = "Count"; + })(ParsingContext || (ParsingContext = {})); + var Tristate; + (function (Tristate) { + Tristate[Tristate["False"] = 0] = "False"; + Tristate[Tristate["True"] = 1] = "True"; + Tristate[Tristate["Unknown"] = 2] = "Unknown"; + })(Tristate || (Tristate = {})); var JSDocParser; (function (JSDocParser) { function isJSDocType() { @@ -17450,7 +19365,7 @@ var ts; } JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; function parseJSDocTypeExpression() { - var result = createNode(262, scanner.getTokenPos()); + var result = createNode(266, scanner.getTokenPos()); parseExpected(16); result.type = parseJSDocTopLevelType(); parseExpected(17); @@ -17461,12 +19376,12 @@ var ts; function parseJSDocTopLevelType() { var type = parseJSDocType(); if (token() === 48) { - var unionType = createNode(266, type.pos); + var unionType = createNode(270, type.pos); unionType.types = parseJSDocTypeList(type); type = finishNode(unionType); } if (token() === 57) { - var optionalType = createNode(273, type.pos); + var optionalType = createNode(277, type.pos); nextToken(); optionalType.type = type; type = finishNode(optionalType); @@ -17477,20 +19392,20 @@ var ts; var type = parseBasicTypeExpression(); while (true) { if (token() === 20) { - var arrayType = createNode(265, type.pos); + var arrayType = createNode(269, type.pos); arrayType.elementType = type; nextToken(); parseExpected(21); type = finishNode(arrayType); } else if (token() === 54) { - var nullableType = createNode(268, type.pos); + var nullableType = createNode(272, type.pos); nullableType.type = type; nextToken(); type = finishNode(nullableType); } else if (token() === 50) { - var nonNullableType = createNode(269, type.pos); + var nonNullableType = createNode(273, type.pos); nonNullableType.type = type; nextToken(); type = finishNode(nonNullableType); @@ -17524,14 +19439,15 @@ var ts; case 98: return parseJSDocThisType(); case 118: - case 134: + case 135: case 132: case 121: - case 135: + case 136: case 104: case 94: - case 137: + case 138: case 129: + case 133: return parseTokenNode(); case 9: case 8: @@ -17542,27 +19458,27 @@ var ts; return parseJSDocTypeReference(); } function parseJSDocThisType() { - var result = createNode(277); + var result = createNode(281); nextToken(); parseExpected(55); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocConstructorType() { - var result = createNode(276); + var result = createNode(280); nextToken(); parseExpected(55); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocVariadicType() { - var result = createNode(275); + var result = createNode(279); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocFunctionType() { - var result = createNode(274); + var result = createNode(278); nextToken(); parseExpected(18); result.parameters = parseDelimitedList(23, parseJSDocParameter); @@ -17575,7 +19491,7 @@ var ts; return finishNode(result); } function parseJSDocParameter() { - var parameter = createNode(144); + var parameter = createNode(145); parameter.type = parseJSDocType(); if (parseOptional(57)) { parameter.questionToken = createNode(57); @@ -17583,7 +19499,7 @@ var ts; return finishNode(parameter); } function parseJSDocTypeReference() { - var result = createNode(272); + var result = createNode(276); result.name = parseSimplePropertyName(); if (token() === 26) { result.typeArguments = parseTypeArguments(); @@ -17617,24 +19533,24 @@ var ts; } } function parseQualifiedName(left) { - var result = createNode(141, left.pos); + var result = createNode(142, left.pos); result.left = left; result.right = parseIdentifierName(); return finishNode(result); } function parseJSDocRecordType() { - var result = createNode(270); + var result = createNode(274); result.literal = parseTypeLiteral(); return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(269); + var result = createNode(273); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocTupleType() { - var result = createNode(267); + var result = createNode(271); nextToken(); result.types = parseDelimitedList(26, parseJSDocType); checkForTrailingComma(result.types); @@ -17648,7 +19564,7 @@ var ts; } } function parseJSDocUnionType() { - var result = createNode(266); + var result = createNode(270); nextToken(); result.types = parseJSDocTypeList(parseJSDocType()); parseExpected(19); @@ -17664,12 +19580,12 @@ var ts; return types; } function parseJSDocAllType() { - var result = createNode(263); + var result = createNode(267); nextToken(); return finishNode(result); } function parseJSDocLiteralType() { - var result = createNode(288); + var result = createNode(292); result.literal = parseLiteralTypeNode(); return finishNode(result); } @@ -17682,11 +19598,11 @@ var ts; token() === 28 || token() === 57 || token() === 48) { - var result = createNode(264, pos); + var result = createNode(268, pos); return finishNode(result); } else { - var result = createNode(268, pos); + var result = createNode(272, pos); result.type = parseJSDocType(); return finishNode(result); } @@ -17714,6 +19630,12 @@ var ts; return comment; } JSDocParser.parseJSDocComment = parseJSDocComment; + var JSDocState; + (function (JSDocState) { + JSDocState[JSDocState["BeginningOfLine"] = 0] = "BeginningOfLine"; + JSDocState[JSDocState["SawAsterisk"] = 1] = "SawAsterisk"; + JSDocState[JSDocState["SavingComments"] = 2] = "SavingComments"; + })(JSDocState || (JSDocState = {})); function parseJSDocCommentWorker(start, length) { var content = sourceText; start = start || 0; @@ -17771,7 +19693,7 @@ var ts; break; case 38: var asterisk = scanner.getTokenText(); - if (state === 1) { + if (state === 1 || state === 2) { state = 2; pushComment(asterisk); } @@ -17786,7 +19708,10 @@ var ts; break; case 5: var whitespace = scanner.getTokenText(); - if (state === 2 || margin !== undefined && indent + whitespace.length > margin) { + if (state === 2) { + comments.push(whitespace); + } + else if (margin !== undefined && indent + whitespace.length > margin) { comments.push(whitespace.slice(margin - indent - 1)); } indent += whitespace.length; @@ -17794,6 +19719,7 @@ var ts; case 1: break; default: + state = 2; pushComment(scanner.getTokenText()); break; } @@ -17826,7 +19752,7 @@ var ts; content.charCodeAt(start + 3) !== 42; } function createJSDocComment() { - var result = createNode(278, start); + var result = createNode(282, start); result.tags = tags; result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -17883,7 +19809,7 @@ var ts; } function parseTagComments(indent) { var comments = []; - var state = 1; + var state = 0; var margin; function pushComment(text) { if (!margin) { @@ -17936,7 +19862,7 @@ var ts; return comments; } function parseUnknownTag(atToken, tagName) { - var result = createNode(279, atToken.pos); + var result = createNode(283, atToken.pos); result.atToken = atToken; result.tagName = tagName; return finishNode(result); @@ -17991,7 +19917,7 @@ var ts; if (!typeExpression) { typeExpression = tryParseTypeExpression(); } - var result = createNode(281, atToken.pos); + var result = createNode(285, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.preParameterName = preName; @@ -18002,20 +19928,20 @@ var ts; return finishNode(result); } function parseReturnTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 282; })) { + if (ts.forEach(tags, function (t) { return t.kind === 286; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(282, atToken.pos); + var result = createNode(286, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); } function parseTypeTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 283; })) { + if (ts.forEach(tags, function (t) { return t.kind === 287; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(283, atToken.pos); + var result = createNode(287, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); @@ -18030,7 +19956,7 @@ var ts; parseErrorAtPosition(scanner.getStartPos(), 0, ts.Diagnostics.Identifier_expected); return undefined; } - var result = createNode(286, atToken.pos); + var result = createNode(290, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.name = name; @@ -18039,7 +19965,7 @@ var ts; } function parseAugmentsTag(atToken, tagName) { var typeExpression = tryParseTypeExpression(); - var result = createNode(280, atToken.pos); + var result = createNode(284, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = typeExpression; @@ -18048,25 +19974,28 @@ var ts; function parseTypedefTag(atToken, tagName) { var typeExpression = tryParseTypeExpression(); skipWhitespace(); - var typedefTag = createNode(285, atToken.pos); + var typedefTag = createNode(289, atToken.pos); typedefTag.atToken = atToken; typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(0); if (typedefTag.fullName) { var rightNode = typedefTag.fullName; - while (rightNode.kind !== 70) { + while (true) { + if (rightNode.kind === 70 || !rightNode.body) { + typedefTag.name = rightNode.kind === 70 ? rightNode : rightNode.name; + break; + } rightNode = rightNode.body; } - typedefTag.name = rightNode; } typedefTag.typeExpression = typeExpression; skipWhitespace(); if (typeExpression) { - if (typeExpression.type.kind === 272) { + if (typeExpression.type.kind === 276) { var jsDocTypeReference = typeExpression.type; if (jsDocTypeReference.name.kind === 70) { - var name_16 = jsDocTypeReference.name; - if (name_16.text === "Object") { + var name = jsDocTypeReference.name; + if (name.text === "Object") { typedefTag.jsDocTypeLiteral = scanChildTags(); } } @@ -18080,7 +20009,7 @@ var ts; } return finishNode(typedefTag); function scanChildTags() { - var jsDocTypeLiteral = createNode(287, scanner.getStartPos()); + var jsDocTypeLiteral = createNode(291, scanner.getStartPos()); var resumePos = scanner.getStartPos(); var canParseTag = true; var seenAsterisk = false; @@ -18110,6 +20039,7 @@ var ts; break; case 70: canParseTag = false; + break; case 1: break; } @@ -18121,7 +20051,7 @@ var ts; var pos = scanner.getTokenPos(); var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (typeNameOrNamespaceName && parseOptional(22)) { - var jsDocNamespaceNode = createNode(230, pos); + var jsDocNamespaceNode = createNode(232, pos); jsDocNamespaceNode.flags |= flags; jsDocNamespaceNode.name = typeNameOrNamespaceName; jsDocNamespaceNode.body = parseJSDocTypeNameWithNamespace(4); @@ -18165,19 +20095,19 @@ var ts; return false; } function parseTemplateTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 284; })) { + if (ts.forEach(tags, function (t) { return t.kind === 288; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } var typeParameters = createNodeArray(); while (true) { - var name_17 = parseJSDocIdentifierName(); + var name = parseJSDocIdentifierName(); skipWhitespace(); - if (!name_17) { + if (!name) { parseErrorAtPosition(scanner.getStartPos(), 0, ts.Diagnostics.Identifier_expected); return undefined; } - var typeParameter = createNode(143, name_17.pos); - typeParameter.name = name_17; + var typeParameter = createNode(144, name.pos); + typeParameter.name = name; finishNode(typeParameter); typeParameters.push(typeParameter); if (token() === 25) { @@ -18188,7 +20118,7 @@ var ts; break; } } - var result = createNode(284, atToken.pos); + var result = createNode(288, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeParameters = typeParameters; @@ -18480,7 +20410,7 @@ var ts; } function visitArray(array) { if (position >= array.pos && position < array.end) { - for (var i = 0, n = array.length; i < n; i++) { + for (var i = 0; i < array.length; i++) { var child = array[i]; if (child) { if (child.pos === position) { @@ -18502,21 +20432,31 @@ var ts; } } } + var InvalidPosition; + (function (InvalidPosition) { + InvalidPosition[InvalidPosition["Value"] = -1] = "Value"; + })(InvalidPosition || (InvalidPosition = {})); })(IncrementalParser || (IncrementalParser = {})); })(ts || (ts = {})); var ts; (function (ts) { + var ModuleInstanceState; + (function (ModuleInstanceState) { + ModuleInstanceState[ModuleInstanceState["NonInstantiated"] = 0] = "NonInstantiated"; + ModuleInstanceState[ModuleInstanceState["Instantiated"] = 1] = "Instantiated"; + ModuleInstanceState[ModuleInstanceState["ConstEnumOnly"] = 2] = "ConstEnumOnly"; + })(ModuleInstanceState = ts.ModuleInstanceState || (ts.ModuleInstanceState = {})); function getModuleInstanceState(node) { - if (node.kind === 227 || node.kind === 228) { + if (node.kind === 229 || node.kind === 230) { return 0; } else if (ts.isConstEnumDeclaration(node)) { return 2; } - else if ((node.kind === 235 || node.kind === 234) && !(ts.hasModifier(node, 1))) { + else if ((node.kind === 237 || node.kind === 236) && !(ts.hasModifier(node, 1))) { return 0; } - else if (node.kind === 231) { + else if (node.kind === 233) { var state_1 = 0; ts.forEachChild(node, function (n) { switch (getModuleInstanceState(n)) { @@ -18532,7 +20472,7 @@ var ts; }); return state_1; } - else if (node.kind === 230) { + else if (node.kind === 232) { var body = node.body; return body ? getModuleInstanceState(body) : 1; } @@ -18544,6 +20484,18 @@ var ts; } } ts.getModuleInstanceState = getModuleInstanceState; + var ContainerFlags; + (function (ContainerFlags) { + ContainerFlags[ContainerFlags["None"] = 0] = "None"; + ContainerFlags[ContainerFlags["IsContainer"] = 1] = "IsContainer"; + ContainerFlags[ContainerFlags["IsBlockScopedContainer"] = 2] = "IsBlockScopedContainer"; + ContainerFlags[ContainerFlags["IsControlFlowContainer"] = 4] = "IsControlFlowContainer"; + ContainerFlags[ContainerFlags["IsFunctionLike"] = 8] = "IsFunctionLike"; + ContainerFlags[ContainerFlags["IsFunctionExpression"] = 16] = "IsFunctionExpression"; + ContainerFlags[ContainerFlags["HasLocals"] = 32] = "HasLocals"; + ContainerFlags[ContainerFlags["IsInterface"] = 64] = "IsInterface"; + ContainerFlags[ContainerFlags["IsObjectLiteralOrClassExpressionMethod"] = 128] = "IsObjectLiteralOrClassExpressionMethod"; + })(ContainerFlags || (ContainerFlags = {})); var binder = createBinder(); function bindSourceFile(file, options) { ts.performance.mark("beforeBind"); @@ -18614,7 +20566,7 @@ var ts; } return bindSourceFile; function bindInStrictMode(file, opts) { - if (opts.alwaysStrict && !ts.isDeclarationFile(file)) { + if ((opts.alwaysStrict === undefined ? opts.strict : opts.alwaysStrict) && !ts.isDeclarationFile(file)) { return true; } else { @@ -18641,7 +20593,7 @@ var ts; if (symbolFlags & 107455) { var valueDeclaration = symbol.valueDeclaration; if (!valueDeclaration || - (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 230)) { + (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 232)) { symbol.valueDeclaration = node; } } @@ -18651,7 +20603,7 @@ var ts; if (ts.isAmbientModule(node)) { return ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + node.name.text + "\""; } - if (node.name.kind === 142) { + if (node.name.kind === 143) { var nameExpression = node.name.expression; if (ts.isStringOrNumericLiteral(nameExpression)) { return nameExpression.text; @@ -18662,46 +20614,47 @@ var ts; return node.name.text; } switch (node.kind) { - case 150: + case 151: return "__constructor"; - case 158: - case 153: - return "__call"; case 159: case 154: - return "__new"; + return "__call"; + case 160: case 155: + return "__new"; + case 156: return "__index"; - case 241: + case 243: return "__export"; - case 240: + case 242: return node.isExportEquals ? "export=" : "default"; - case 192: + case 193: switch (ts.getSpecialPropertyAssignmentKind(node)) { case 2: return "export="; case 1: case 4: + case 5: return node.left.name.text; case 3: return node.left.expression.name.text; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 225: - case 226: + case 227: + case 228: return ts.hasModifier(node, 512) ? "default" : undefined; - case 274: + case 278: return ts.isJSDocConstructSignature(node) ? "__new" : "__call"; - case 144: - ts.Debug.assert(node.parent.kind === 274); + case 145: + ts.Debug.assert(node.parent.kind === 278); var functionType = node.parent; var index = ts.indexOf(functionType.parameters, node); return "arg" + index; - case 285: + case 289: var parentNode = node.parent && node.parent.parent; var nameFromParentNode = void 0; - if (parentNode && parentNode.kind === 205) { + if (parentNode && parentNode.kind === 207) { if (parentNode.declarationList.declarations.length > 0) { var nameIdentifier = parentNode.declarationList.declarations[0].name; if (nameIdentifier.kind === 70) { @@ -18724,13 +20677,16 @@ var ts; symbol = createSymbol(0, "__missing"); } else { - symbol = symbolTable[name] || (symbolTable[name] = createSymbol(0, name)); + symbol = symbolTable.get(name); + if (!symbol) { + symbolTable.set(name, symbol = createSymbol(0, name)); + } if (name && (includes & 788448)) { - classifiableNames[name] = name; + classifiableNames.set(name, name); } if (symbol.flags & excludes) { if (symbol.isReplaceableByMethod) { - symbol = symbolTable[name] = createSymbol(0, name); + symbolTable.set(name, symbol = createSymbol(0, name)); } else { if (node.name) { @@ -18745,7 +20701,7 @@ var ts; } else { if (symbol.declarations && symbol.declarations.length && - (isDefaultExport || (node.kind === 240 && !node.isExportEquals))) { + (isDefaultExport || (node.kind === 242 && !node.isExportEquals))) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; } } @@ -18765,7 +20721,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1; if (symbolFlags & 8388608) { - if (node.kind === 243 || (node.kind === 234 && hasExportModifier)) { + if (node.kind === 245 || (node.kind === 236 && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -18773,7 +20729,7 @@ var ts; } } else { - var isJSDocTypedefInJSDocNamespace = node.kind === 285 && + var isJSDocTypedefInJSDocNamespace = node.kind === 289 && node.name && node.name.kind === 70 && node.name.isInJSDocNamespace; @@ -18828,13 +20784,13 @@ var ts; activeLabels = undefined; hasExplicitReturn = false; bindChildren(node); - node.flags &= ~64896; + node.flags &= ~1408; if (!(currentFlow.flags & 1) && containerFlags & 8 && ts.nodeIsPresent(node.body)) { node.flags |= 128; if (hasExplicitReturn) node.flags |= 256; } - if (node.kind === 261) { + if (node.kind === 264) { node.flags |= emitFlags; } if (isIIFE) { @@ -18910,66 +20866,72 @@ var ts; return; } switch (node.kind) { - case 210: + case 212: bindWhileStatement(node); break; - case 209: + case 211: bindDoStatement(node); break; - case 211: + case 213: bindForStatement(node); break; - case 212: - case 213: + case 214: + case 215: bindForInOrForOfStatement(node); break; - case 208: + case 210: bindIfStatement(node); break; - case 216: - case 220: + case 218: + case 222: bindReturnOrThrow(node); break; - case 215: - case 214: + case 217: + case 216: bindBreakOrContinueStatement(node); break; - case 221: + case 223: bindTryStatement(node); break; - case 218: + case 220: bindSwitchStatement(node); break; - case 232: + case 234: bindCaseBlock(node); break; - case 253: + case 256: bindCaseClause(node); break; - case 219: + case 221: bindLabeledStatement(node); break; - case 190: + case 191: bindPrefixUnaryExpressionFlow(node); break; - case 191: + case 192: bindPostfixUnaryExpressionFlow(node); break; - case 192: + case 193: bindBinaryExpressionFlow(node); break; - case 186: + case 187: bindDeleteExpressionFlow(node); break; - case 193: + case 194: bindConditionalExpressionFlow(node); break; - case 223: + case 225: bindVariableDeclarationFlow(node); break; - case 179: + case 180: bindCallExpressionFlow(node); break; + case 282: + bindJSDocComment(node); + break; + case 289: + bindJSDocTypedefTag(node); + break; default: bindEachChild(node); break; @@ -18979,15 +20941,15 @@ var ts; switch (expr.kind) { case 70: case 98: - case 177: + case 178: return isNarrowableReference(expr); - case 179: + case 180: return hasNarrowableArgument(expr); - case 183: + case 184: return isNarrowingExpression(expr.expression); - case 192: + case 193: return isNarrowingBinaryExpression(expr); - case 190: + case 191: return expr.operator === 50 && isNarrowingExpression(expr.operand); } return false; @@ -18995,7 +20957,8 @@ var ts; function isNarrowableReference(expr) { return expr.kind === 70 || expr.kind === 98 || - expr.kind === 177 && isNarrowableReference(expr.expression); + expr.kind === 96 || + expr.kind === 178 && isNarrowableReference(expr.expression); } function hasNarrowableArgument(expr) { if (expr.arguments) { @@ -19006,14 +20969,14 @@ var ts; } } } - if (expr.expression.kind === 177 && + if (expr.expression.kind === 178 && isNarrowableReference(expr.expression.expression)) { return true; } return false; } function isNarrowingTypeofOperands(expr1, expr2) { - return expr1.kind === 187 && isNarrowableOperand(expr1.expression) && expr2.kind === 9; + return expr1.kind === 188 && isNarrowableOperand(expr1.expression) && expr2.kind === 9; } function isNarrowingBinaryExpression(expr) { switch (expr.operatorToken.kind) { @@ -19034,9 +20997,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 183: + case 184: return isNarrowableOperand(expr.expression); - case 192: + case 193: switch (expr.operatorToken.kind) { case 57: return isNarrowableOperand(expr.left); @@ -19130,33 +21093,33 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 208: case 210: - case 209: - return parent.expression === node; + case 212: case 211: - case 193: + return parent.expression === node; + case 213: + case 194: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 183) { + if (node.kind === 184) { node = node.expression; } - else if (node.kind === 190 && node.operator === 50) { + else if (node.kind === 191 && node.operator === 50) { node = node.operand; } else { - return node.kind === 192 && (node.operatorToken.kind === 52 || + return node.kind === 193 && (node.operatorToken.kind === 52 || node.operatorToken.kind === 53); } } } function isTopLevelLogicalExpression(node) { - while (node.parent.kind === 183 || - node.parent.kind === 190 && + while (node.parent.kind === 184 || + node.parent.kind === 191 && node.parent.operator === 50) { node = node.parent; } @@ -19198,7 +21161,7 @@ var ts; } function bindDoStatement(node) { var preDoLabel = createLoopLabel(); - var enclosingLabeledStatement = node.parent.kind === 219 + var enclosingLabeledStatement = node.parent.kind === 221 ? ts.lastOrUndefined(activeLabels) : undefined; var preConditionLabel = enclosingLabeledStatement ? enclosingLabeledStatement.continueTarget : createBranchLabel(); @@ -19230,10 +21193,13 @@ var ts; var postLoopLabel = createBranchLabel(); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; + if (node.kind === 215) { + bind(node.awaitModifier); + } bind(node.expression); addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 224) { + if (node.initializer.kind !== 226) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -19255,7 +21221,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 216) { + if (node.kind === 218) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -19275,7 +21241,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 215 ? breakTarget : continueTarget; + var flowLabel = node.kind === 217 ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -19308,7 +21274,8 @@ var ts; flowAfterCatch = currentFlow; } if (node.finallyBlock) { - addAntecedent(preFinallyLabel, preTryFlow); + var preFinallyFlow = { flags: 2048, antecedent: preTryFlow, lock: {} }; + addAntecedent(preFinallyLabel, preFinallyFlow); currentFlow = finishFlowLabel(preFinallyLabel); bind(node.finallyBlock); if (!(currentFlow.flags & 1)) { @@ -19318,6 +21285,11 @@ var ts; : unreachableFlow; } } + if (!(currentFlow.flags & 1)) { + var afterFinallyFlow = { flags: 4096, antecedent: currentFlow }; + preFinallyFlow.lock = afterFinallyFlow; + currentFlow = afterFinallyFlow; + } } else { currentFlow = finishFlowLabel(preFinallyLabel); @@ -19332,7 +21304,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 254; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 257; }); node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents; if (!hasDefault) { addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0)); @@ -19397,13 +21369,13 @@ var ts; if (!activeLabel.referenced && !options.allowUnusedLabels) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node.label, ts.Diagnostics.Unused_label)); } - if (!node.statement || node.statement.kind !== 209) { + if (!node.statement || node.statement.kind !== 211) { addAntecedent(postStatementLabel, currentFlow); currentFlow = finishFlowLabel(postStatementLabel); } } function bindDestructuringTargetFlow(node) { - if (node.kind === 192 && node.operatorToken.kind === 57) { + if (node.kind === 193 && node.operatorToken.kind === 57) { bindAssignmentTargetFlow(node.left); } else { @@ -19414,10 +21386,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowAssignment(currentFlow, node); } - else if (node.kind === 175) { + else if (node.kind === 176) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 196) { + if (e.kind === 197) { bindAssignmentTargetFlow(e.expression); } else { @@ -19425,16 +21397,16 @@ var ts; } } } - else if (node.kind === 176) { + else if (node.kind === 177) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 257) { + if (p.kind === 260) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 258) { + else if (p.kind === 261) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 259) { + else if (p.kind === 262) { bindAssignmentTargetFlow(p.expression); } } @@ -19490,7 +21462,7 @@ var ts; bindEachChild(node); if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 57 && node.left.kind === 178) { + if (operator === 57 && node.left.kind === 179) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -19501,7 +21473,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 177) { + if (node.expression.kind === 178) { bindAssignmentTargetFlow(node.expression); } } @@ -19534,16 +21506,31 @@ var ts; } function bindVariableDeclarationFlow(node) { bindEachChild(node); - if (node.initializer || node.parent.parent.kind === 212 || node.parent.parent.kind === 213) { + if (node.initializer || node.parent.parent.kind === 214 || node.parent.parent.kind === 215) { bindInitializedVariableFlow(node); } } + function bindJSDocComment(node) { + ts.forEachChild(node, function (n) { + if (n.kind !== 289) { + bind(n); + } + }); + } + function bindJSDocTypedefTag(node) { + ts.forEachChild(node, function (n) { + if (node.fullName && n === node.name && node.fullName.kind !== 70) { + return; + } + bind(n); + }); + } function bindCallExpressionFlow(node) { var expr = node.expression; - while (expr.kind === 183) { + while (expr.kind === 184) { expr = expr.expression; } - if (expr.kind === 184 || expr.kind === 185) { + if (expr.kind === 185 || expr.kind === 186) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -19551,7 +21538,7 @@ var ts; else { bindEachChild(node); } - if (node.expression.kind === 177) { + if (node.expression.kind === 178) { var propertyAccess = node.expression; if (isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -19560,52 +21547,53 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 197: - case 226: - case 229: - case 176: - case 161: - case 287: - case 270: - return 1; - case 227: - return 1 | 64; - case 274: - case 230: + case 198: case 228: - case 170: + case 231: + case 177: + case 162: + case 291: + case 274: + case 253: + return 1; + case 229: + return 1 | 64; + case 278: + case 232: + case 230: + case 171: return 1 | 32; - case 261: + case 264: return 1 | 4 | 32; - case 149: + case 150: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 | 4 | 32 | 8 | 128; } - case 150: - case 225: - case 148: case 151: + case 227: + case 149: case 152: case 153: case 154: case 155: - case 158: + case 156: case 159: + case 160: return 1 | 4 | 32 | 8; - case 184: case 185: + case 186: return 1 | 4 | 32 | 8 | 16; - case 231: + case 233: return 4; - case 147: + case 148: return node.initializer ? 4 : 0; - case 256: - case 211: - case 212: + case 259: case 213: - case 232: + case 214: + case 215: + case 234: return 2; - case 204: + case 206: return ts.isFunctionLike(node.parent) ? 0 : 2; } return 0; @@ -19621,37 +21609,38 @@ var ts; } function declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes) { switch (container.kind) { - case 230: + case 232: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 261: + case 264: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 197: - case 226: + case 198: + case 228: return declareClassMember(node, symbolFlags, symbolExcludes); - case 229: + case 231: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 161: - case 176: - case 227: - case 270: - case 287: + case 162: + case 177: + case 229: + case 274: + case 291: + case 253: return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 158: case 159: - case 153: + case 160: case 154: case 155: - case 149: - case 148: + case 156: case 150: + case 149: case 151: case 152: - case 225: - case 184: + case 153: + case 227: case 185: - case 274: - case 228: - case 170: + case 186: + case 278: + case 230: + case 171: return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); } } @@ -19666,11 +21655,11 @@ var ts; : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); } function hasExportDeclarations(node) { - var body = node.kind === 261 ? node : node.body; - if (body && (body.kind === 261 || body.kind === 231)) { + var body = node.kind === 264 ? node : node.body; + if (body && (body.kind === 264 || body.kind === 233)) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 241 || stat.kind === 240) { + if (stat.kind === 243 || stat.kind === 242) { return true; } } @@ -19692,7 +21681,7 @@ var ts; errorOnFirstToken(node, ts.Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible); } if (ts.isExternalModuleAugmentation(node)) { - declareSymbolAndAddToSymbolTable(node, 1024, 0); + declareModuleSymbol(node); } else { var pattern = void 0; @@ -19712,12 +21701,8 @@ var ts; } } else { - var state = getModuleInstanceState(node); - if (state === 0) { - declareSymbolAndAddToSymbolTable(node, 1024, 0); - } - else { - declareSymbolAndAddToSymbolTable(node, 512, 106639); + var state = declareModuleSymbol(node); + if (state !== 0) { if (node.symbol.flags & (16 | 32 | 256)) { node.symbol.constEnumOnlyModule = false; } @@ -19733,29 +21718,40 @@ var ts; } } } + function declareModuleSymbol(node) { + var state = getModuleInstanceState(node); + var instantiated = state !== 0; + declareSymbolAndAddToSymbolTable(node, instantiated ? 512 : 1024, instantiated ? 106639 : 0); + return state; + } function bindFunctionOrConstructorType(node) { var symbol = createSymbol(131072, getDeclarationName(node)); addDeclarationToSymbol(symbol, node, 131072); var typeLiteralSymbol = createSymbol(2048, "__type"); addDeclarationToSymbol(typeLiteralSymbol, node, 2048); typeLiteralSymbol.members = ts.createMap(); - typeLiteralSymbol.members[symbol.name] = symbol; + typeLiteralSymbol.members.set(symbol.name, symbol); } function bindObjectLiteralExpression(node) { + var ElementKind; + (function (ElementKind) { + ElementKind[ElementKind["Property"] = 1] = "Property"; + ElementKind[ElementKind["Accessor"] = 2] = "Accessor"; + })(ElementKind || (ElementKind = {})); if (inStrictMode) { var seen = ts.createMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 259 || prop.name.kind !== 70) { + if (prop.kind === 262 || prop.name.kind !== 70) { continue; } var identifier = prop.name; - var currentKind = prop.kind === 257 || prop.kind === 258 || prop.kind === 149 + var currentKind = prop.kind === 260 || prop.kind === 261 || prop.kind === 150 ? 1 : 2; - var existingKind = seen[identifier.text]; + var existingKind = seen.get(identifier.text); if (!existingKind) { - seen[identifier.text] = currentKind; + seen.set(identifier.text, currentKind); continue; } if (currentKind === 1 && existingKind === 1) { @@ -19766,16 +21762,22 @@ var ts; } return bindAnonymousDeclaration(node, 4096, "__object"); } + function bindJsxAttributes(node) { + return bindAnonymousDeclaration(node, 4096, "__jsxAttributes"); + } + function bindJsxAttribute(node, symbolFlags, symbolExcludes) { + return declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); + } function bindAnonymousDeclaration(node, symbolFlags, name) { var symbol = createSymbol(symbolFlags, name); addDeclarationToSymbol(symbol, node, symbolFlags); } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 230: + case 232: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 261: + case 264: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -19865,8 +21867,8 @@ var ts; } function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2) { - if (blockScopeContainer.kind !== 261 && - blockScopeContainer.kind !== 230 && + if (blockScopeContainer.kind !== 264 && + blockScopeContainer.kind !== 232 && !ts.isFunctionLike(blockScopeContainer)) { var errorSpan = ts.getErrorSpanForNode(file, node); file.bindDiagnostics.push(ts.createFileDiagnostic(file, errorSpan.start, errorSpan.length, getStrictModeBlockScopeFunctionDeclarationMessage(node))); @@ -19874,7 +21876,7 @@ var ts; } } function checkStrictModeNumericLiteral(node) { - if (inStrictMode && node.isOctalLiteral) { + if (inStrictMode && node.numericLiteralFlags & 4) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode)); } } @@ -19908,8 +21910,11 @@ var ts; } node.parent = parent; var saveInStrictMode = inStrictMode; + if (ts.isInJavaScriptFile(node)) { + bindJSDocTypedefTagIfAny(node); + } bindWorker(node); - if (node.kind > 140) { + if (node.kind > 141) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -19926,6 +21931,26 @@ var ts; } inStrictMode = saveInStrictMode; } + function bindJSDocTypedefTagIfAny(node) { + if (!node.jsDoc) { + return; + } + for (var _i = 0, _a = node.jsDoc; _i < _a.length; _i++) { + var jsDoc = _a[_i]; + if (!jsDoc.tags) { + continue; + } + for (var _b = 0, _c = jsDoc.tags; _b < _c.length; _b++) { + var tag = _c[_b]; + if (tag.kind === 289) { + var savedParent = parent; + parent = jsDoc; + bind(tag); + parent = savedParent; + } + } + } + } function updateStrictModeStatementList(statements) { if (!inStrictMode) { for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) { @@ -19949,90 +21974,88 @@ var ts; case 70: if (node.isInJSDocNamespace) { var parentNode = node.parent; - while (parentNode && parentNode.kind !== 285) { + while (parentNode && parentNode.kind !== 289) { parentNode = parentNode.parent; } bindBlockScopedDeclaration(parentNode, 524288, 793064); break; } case 98: - if (currentFlow && (ts.isExpression(node) || parent.kind === 258)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 261)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); - case 177: + case 178: if (currentFlow && isNarrowableReference(node)) { node.flowNode = currentFlow; } break; - case 192: - if (ts.isInJavaScriptFile(node)) { - var specialKind = ts.getSpecialPropertyAssignmentKind(node); - switch (specialKind) { - case 1: - bindExportsPropertyAssignment(node); - break; - case 2: - bindModuleExportsAssignment(node); - break; - case 3: - bindPrototypePropertyAssignment(node); - break; - case 4: - bindThisPropertyAssignment(node); - break; - case 0: - break; - default: - ts.Debug.fail("Unknown special property assignment kind"); - } + case 193: + var specialKind = ts.getSpecialPropertyAssignmentKind(node); + switch (specialKind) { + case 1: + bindExportsPropertyAssignment(node); + break; + case 2: + bindModuleExportsAssignment(node); + break; + case 3: + bindPrototypePropertyAssignment(node); + break; + case 4: + bindThisPropertyAssignment(node); + break; + case 5: + bindStaticPropertyAssignment(node); + break; + case 0: + break; + default: + ts.Debug.fail("Unknown special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 256: + case 259: return checkStrictModeCatchClause(node); - case 186: + case 187: return checkStrictModeDeleteExpression(node); case 8: return checkStrictModeNumericLiteral(node); - case 191: + case 192: return checkStrictModePostfixUnaryExpression(node); - case 190: + case 191: return checkStrictModePrefixUnaryExpression(node); - case 217: + case 219: return checkStrictModeWithStatement(node); - case 167: + case 168: seenThisKeyword = true; return; - case 156: + case 157: return checkTypePredicate(node); - case 143: - return declareSymbolAndAddToSymbolTable(node, 262144, 530920); case 144: + return declareSymbolAndAddToSymbolTable(node, 262144, 530920); + case 145: return bindParameter(node); - case 223: - case 174: - if (node.dotDotDotToken && node.parent.kind === 172) { - emitFlags |= 32768; - } + case 225: + case 175: return bindVariableDeclarationOrBindingElement(node); + case 148: case 147: - case 146: - case 271: - return bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 0); - case 286: + case 275: + return bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 67108864 : 0), 0); + case 290: return bindJSDocProperty(node); - case 257: - case 258: - return bindPropertyOrMethodOrAccessor(node, 4, 0); case 260: + case 261: + return bindPropertyOrMethodOrAccessor(node, 4, 0); + case 263: return bindPropertyOrMethodOrAccessor(node, 8, 900095); - case 259: - case 251: + case 262: + case 254: var root = container; var hasRest = false; while (root.parent) { - if (root.kind === 176 && - root.parent.kind === 192 && + if (root.kind === 177 && + root.parent.kind === 193 && root.parent.operatorToken.kind === 57 && root.parent.left === root) { hasRest = true; @@ -20040,80 +22063,83 @@ var ts; } root = root.parent; } - emitFlags |= hasRest ? 32768 : 16384; return; - case 153: case 154: case 155: + case 156: return declareSymbolAndAddToSymbolTable(node, 131072, 0); - case 149: - case 148: - return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 0 : 99263); - case 225: - return bindFunctionDeclaration(node); case 150: - return declareSymbolAndAddToSymbolTable(node, 16384, 0); + case 149: + return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 67108864 : 0), ts.isObjectLiteralMethod(node) ? 0 : 99263); + case 227: + return bindFunctionDeclaration(node); case 151: - return bindPropertyOrMethodOrAccessor(node, 32768, 41919); + return declareSymbolAndAddToSymbolTable(node, 16384, 0); case 152: + return bindPropertyOrMethodOrAccessor(node, 32768, 41919); + case 153: return bindPropertyOrMethodOrAccessor(node, 65536, 74687); - case 158: case 159: - case 274: + case 160: + case 278: return bindFunctionOrConstructorType(node); - case 161: - case 170: - case 287: - case 270: + case 162: + case 171: + case 291: + case 274: return bindAnonymousDeclaration(node, 2048, "__type"); - case 176: + case 177: return bindObjectLiteralExpression(node); - case 184: case 185: + case 186: return bindFunctionExpression(node); - case 179: + case 180: if (ts.isInJavaScriptFile(node)) { bindCallExpression(node); } break; - case 197: - case 226: + case 198: + case 228: inStrictMode = true; return bindClassLikeDeclaration(node); - case 227: + case 229: return bindBlockScopedDeclaration(node, 64, 792968); - case 285: + case 289: if (!node.fullName || node.fullName.kind === 70) { return bindBlockScopedDeclaration(node, 524288, 793064); } break; - case 228: - return bindBlockScopedDeclaration(node, 524288, 793064); - case 229: - return bindEnumDeclaration(node); case 230: + return bindBlockScopedDeclaration(node, 524288, 793064); + case 231: + return bindEnumDeclaration(node); + case 232: return bindModuleDeclaration(node); - case 234: - case 237: - case 239: - case 243: - return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608); - case 233: - return bindNamespaceExportDeclaration(node); + case 253: + return bindJsxAttributes(node); + case 252: + return bindJsxAttribute(node, 4, 0); case 236: - return bindImportClause(node); + case 239: case 241: + case 245: + return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608); + case 235: + return bindNamespaceExportDeclaration(node); + case 238: + return bindImportClause(node); + case 243: return bindExportDeclaration(node); - case 240: + case 242: return bindExportAssignment(node); - case 261: + case 264: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 204: + case 206: if (!ts.isFunctionLike(node.parent)) { return; } - case 231: + case 233: return updateStrictModeStatementList(node.statements); } } @@ -20122,7 +22148,7 @@ var ts; if (parameterName && parameterName.kind === 70) { checkStrictModeIdentifier(parameterName); } - if (parameterName && parameterName.kind === 167) { + if (parameterName && parameterName.kind === 168) { seenThisKeyword = true; } bind(type); @@ -20141,7 +22167,7 @@ var ts; bindAnonymousDeclaration(node, 8388608, getDeclarationName(node)); } else { - var flags = node.kind === 240 && ts.exportAssignmentIsAlias(node) + var flags = node.kind === 242 && ts.exportAssignmentIsAlias(node) ? 8388608 : 4; declareSymbol(container.symbol.exports, container.symbol, node, flags, 4 | 8388608 | 32 | 16); @@ -20151,17 +22177,17 @@ var ts; if (node.modifiers && node.modifiers.length) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Modifiers_cannot_appear_here)); } - if (node.parent.kind !== 261) { + if (node.parent.kind !== 264) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_at_top_level)); return; } else { - var parent_4 = node.parent; - if (!ts.isExternalModule(parent_4)) { + var parent_1 = node.parent; + if (!ts.isExternalModule(parent_1)) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_in_module_files)); return; } - if (!parent_4.isDeclarationFile) { + if (!parent_1.isDeclarationFile) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_in_declaration_files)); return; } @@ -20171,10 +22197,10 @@ var ts; } function bindExportDeclaration(node) { if (!container.symbol || !container.symbol.exports) { - bindAnonymousDeclaration(node, 1073741824, getDeclarationName(node)); + bindAnonymousDeclaration(node, 33554432, getDeclarationName(node)); } else if (!node.exportClause) { - declareSymbol(container.symbol.exports, container.symbol, node, 1073741824, 0); + declareSymbol(container.symbol.exports, container.symbol, node, 33554432, 0); } } function bindImportClause(node) { @@ -20194,24 +22220,56 @@ var ts; setCommonJsModuleIndicator(node); declareSymbol(file.symbol.exports, file.symbol, node.left, 4 | 7340032, 0); } + function isExportsOrModuleExportsOrAlias(node) { + return ts.isExportsIdentifier(node) || + ts.isModuleExportsPropertyAccessExpression(node) || + isNameOfExportsOrModuleExportsAliasDeclaration(node); + } + function isNameOfExportsOrModuleExportsAliasDeclaration(node) { + if (node.kind === 70) { + var symbol = lookupSymbolForName(node.text); + if (symbol && symbol.valueDeclaration && symbol.valueDeclaration.kind === 225) { + var declaration = symbol.valueDeclaration; + if (declaration.initializer) { + return isExportsOrModuleExportsOrAliasOrAssignemnt(declaration.initializer); + } + } + } + return false; + } + function isExportsOrModuleExportsOrAliasOrAssignemnt(node) { + return isExportsOrModuleExportsOrAlias(node) || + (ts.isAssignmentExpression(node, true) && (isExportsOrModuleExportsOrAliasOrAssignemnt(node.left) || isExportsOrModuleExportsOrAliasOrAssignemnt(node.right))); + } function bindModuleExportsAssignment(node) { + var assignedExpression = ts.getRightMostAssignedExpression(node.right); + if (ts.isEmptyObjectLiteral(assignedExpression) || isExportsOrModuleExportsOrAlias(assignedExpression)) { + setCommonJsModuleIndicator(node); + return; + } setCommonJsModuleIndicator(node); declareSymbol(file.symbol.exports, file.symbol, node, 4 | 7340032 | 512, 0); } function bindThisPropertyAssignment(node) { ts.Debug.assert(ts.isInJavaScriptFile(node)); - if (container.kind === 225 || container.kind === 184) { - container.symbol.members = container.symbol.members || ts.createMap(); - declareSymbol(container.symbol.members, container.symbol, node, 4, 0 & ~4); - } - else if (container.kind === 150) { - var saveContainer = container; - container = container.parent; - var symbol = bindPropertyOrMethodOrAccessor(node, 4, 0); - if (symbol) { - symbol.isReplaceableByMethod = true; - } - container = saveContainer; + var container = ts.getThisContainer(node, false); + switch (container.kind) { + case 227: + case 185: + container.symbol.members = container.symbol.members || ts.createMap(); + declareSymbol(container.symbol.members, container.symbol, node, 4, 0 & ~4); + break; + case 151: + case 148: + case 150: + case 152: + case 153: + var containingClass = container.parent; + var symbol = declareSymbol(ts.hasModifier(container, 32) ? containingClass.symbol.exports : containingClass.symbol.members, containingClass.symbol, node, 4, 0); + if (symbol) { + symbol.isReplaceableByMethod = true; + } + break; } } function bindPrototypePropertyAssignment(node) { @@ -20221,14 +22279,35 @@ var ts; leftSideOfAssignment.parent = node; constructorFunction.parent = classPrototype; classPrototype.parent = leftSideOfAssignment; - var funcSymbol = container.locals[constructorFunction.text]; - if (!funcSymbol || !(funcSymbol.flags & 16 || ts.isDeclarationOfFunctionExpression(funcSymbol))) { + bindPropertyAssignment(constructorFunction.text, leftSideOfAssignment, true); + } + function bindStaticPropertyAssignment(node) { + var leftSideOfAssignment = node.left; + var target = leftSideOfAssignment.expression; + leftSideOfAssignment.parent = node; + target.parent = leftSideOfAssignment; + if (isNameOfExportsOrModuleExportsAliasDeclaration(target)) { + bindExportsPropertyAssignment(node); + } + else { + bindPropertyAssignment(target.text, leftSideOfAssignment, false); + } + } + function lookupSymbolForName(name) { + return (container.symbol && container.symbol.exports && container.symbol.exports.get(name)) || (container.locals && container.locals.get(name)); + } + function bindPropertyAssignment(functionName, propertyAccessExpression, isPrototypeProperty) { + var targetSymbol = lookupSymbolForName(functionName); + if (targetSymbol && ts.isDeclarationOfFunctionOrClassExpression(targetSymbol)) { + targetSymbol = targetSymbol.valueDeclaration.initializer.symbol; + } + if (!targetSymbol || !(targetSymbol.flags & (16 | 32))) { return; } - if (!funcSymbol.members) { - funcSymbol.members = ts.createMap(); - } - declareSymbol(funcSymbol.members, funcSymbol, leftSideOfAssignment, 4, 0); + var symbolTable = isPrototypeProperty ? + (targetSymbol.members || (targetSymbol.members = ts.createMap())) : + (targetSymbol.exports || (targetSymbol.exports = ts.createMap())); + declareSymbol(symbolTable, targetSymbol, propertyAccessExpression, 4, 0); } function bindCallExpression(node) { if (!file.commonJsModuleIndicator && ts.isRequireCall(node, false)) { @@ -20236,33 +22315,26 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { - if (ts.getClassExtendsHeritageClauseElement(node) !== undefined) { - emitFlags |= 1024; - } - if (ts.nodeIsDecorated(node)) { - emitFlags |= 2048; - } - } - if (node.kind === 226) { + if (node.kind === 228) { bindBlockScopedDeclaration(node, 32, 899519); } else { var bindingName = node.name ? node.name.text : "__class"; bindAnonymousDeclaration(node, 32, bindingName); if (node.name) { - classifiableNames[node.name.text] = node.name.text; + classifiableNames.set(node.name.text, node.name.text); } } var symbol = node.symbol; - var prototypeSymbol = createSymbol(4 | 134217728, "prototype"); - if (symbol.exports[prototypeSymbol.name]) { + var prototypeSymbol = createSymbol(4 | 16777216, "prototype"); + var symbolExport = symbol.exports.get(prototypeSymbol.name); + if (symbolExport) { if (node.name) { node.name.parent = node; } - file.bindDiagnostics.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); + file.bindDiagnostics.push(ts.createDiagnosticForNode(symbolExport.declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); } - symbol.exports[prototypeSymbol.name] = prototypeSymbol; + symbol.exports.set(prototypeSymbol.name, prototypeSymbol); prototypeSymbol.parent = symbol; } function bindEnumDeclaration(node) { @@ -20287,11 +22359,6 @@ var ts; } } function bindParameter(node) { - if (!ts.isDeclarationFile(file) && - !ts.isInAmbientContext(node) && - ts.nodeIsDecorated(node)) { - emitFlags |= (2048 | 4096); - } if (inStrictMode) { checkStrictModeEvalOrArguments(node, node.name); } @@ -20303,13 +22370,13 @@ var ts; } if (ts.isParameterPropertyDeclaration(node)) { var classDeclaration = node.parent.parent; - declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 | (node.questionToken ? 536870912 : 0), 0); + declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 | (node.questionToken ? 67108864 : 0), 0); } } function bindFunctionDeclaration(node) { if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { - if (ts.isAsyncFunctionLike(node)) { - emitFlags |= 8192; + if (ts.isAsyncFunction(node)) { + emitFlags |= 1024; } } checkStrictModeFunctionName(node); @@ -20323,8 +22390,8 @@ var ts; } function bindFunctionExpression(node) { if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { - if (ts.isAsyncFunctionLike(node)) { - emitFlags |= 8192; + if (ts.isAsyncFunction(node)) { + emitFlags |= 1024; } } if (currentFlow) { @@ -20336,11 +22403,8 @@ var ts; } function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) { if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { - if (ts.isAsyncFunctionLike(node)) { - emitFlags |= 8192; - } - if (ts.nodeIsDecorated(node)) { - emitFlags |= 2048; + if (ts.isAsyncFunction(node)) { + emitFlags |= 1024; } } if (currentFlow && ts.isObjectLiteralOrClassExpressionMethod(node)) { @@ -20362,15 +22426,15 @@ var ts; return false; } if (currentFlow === unreachableFlow) { - var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 206) || - node.kind === 226 || - (node.kind === 230 && shouldReportErrorOnModuleDeclaration(node)) || - (node.kind === 229 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 208) || + node.kind === 228 || + (node.kind === 232 && shouldReportErrorOnModuleDeclaration(node)) || + (node.kind === 231 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); if (reportError) { currentFlow = reportedUnreachableFlow; var reportUnreachableCode = !options.allowUnreachableCode && !ts.isInAmbientContext(node) && - (node.kind !== 205 || + (node.kind !== 207 || ts.getCombinedNodeFlags(node.declarationList) & 3 || ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); if (reportUnreachableCode) { @@ -20384,56 +22448,56 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 179: - return computeCallExpression(node, subtreeFlags); case 180: + return computeCallExpression(node, subtreeFlags); + case 181: return computeNewExpression(node, subtreeFlags); - case 230: + case 232: return computeModuleDeclaration(node, subtreeFlags); - case 183: - return computeParenthesizedExpression(node, subtreeFlags); - case 192: - return computeBinaryExpression(node, subtreeFlags); - case 207: - return computeExpressionStatement(node, subtreeFlags); - case 144: - return computeParameter(node, subtreeFlags); - case 185: - return computeArrowFunction(node, subtreeFlags); case 184: + return computeParenthesizedExpression(node, subtreeFlags); + case 193: + return computeBinaryExpression(node, subtreeFlags); + case 209: + return computeExpressionStatement(node, subtreeFlags); + case 145: + return computeParameter(node, subtreeFlags); + case 186: + return computeArrowFunction(node, subtreeFlags); + case 185: return computeFunctionExpression(node, subtreeFlags); - case 225: + case 227: return computeFunctionDeclaration(node, subtreeFlags); - case 223: + case 225: return computeVariableDeclaration(node, subtreeFlags); - case 224: - return computeVariableDeclarationList(node, subtreeFlags); - case 205: - return computeVariableStatement(node, subtreeFlags); - case 219: - return computeLabeledStatement(node, subtreeFlags); case 226: + return computeVariableDeclarationList(node, subtreeFlags); + case 207: + return computeVariableStatement(node, subtreeFlags); + case 221: + return computeLabeledStatement(node, subtreeFlags); + case 228: return computeClassDeclaration(node, subtreeFlags); - case 197: + case 198: return computeClassExpression(node, subtreeFlags); - case 255: + case 258: return computeHeritageClause(node, subtreeFlags); - case 256: + case 259: return computeCatchClause(node, subtreeFlags); - case 199: + case 200: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 150: - return computeConstructor(node, subtreeFlags); - case 147: - return computePropertyDeclaration(node, subtreeFlags); - case 149: - return computeMethod(node, subtreeFlags); case 151: + return computeConstructor(node, subtreeFlags); + case 148: + return computePropertyDeclaration(node, subtreeFlags); + case 150: + return computeMethod(node, subtreeFlags); case 152: + case 153: return computeAccessor(node, subtreeFlags); - case 234: + case 236: return computeImportEquals(node, subtreeFlags); - case 177: + case 178: return computePropertyAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); @@ -20458,8 +22522,8 @@ var ts; switch (kind) { case 96: return true; - case 177: case 178: + case 179: var expression = node.expression; var expressionKind = expression.kind; return expressionKind === 96; @@ -20481,10 +22545,10 @@ var ts; var transformFlags = subtreeFlags; var operatorTokenKind = node.operatorToken.kind; var leftKind = node.left.kind; - if (operatorTokenKind === 57 && leftKind === 176) { + if (operatorTokenKind === 57 && leftKind === 177) { transformFlags |= 8 | 192 | 3072; } - else if (operatorTokenKind === 57 && leftKind === 175) { + else if (operatorTokenKind === 57 && leftKind === 176) { transformFlags |= 192 | 3072; } else if (operatorTokenKind === 39 @@ -20523,8 +22587,8 @@ var ts; var expression = node.expression; var expressionKind = expression.kind; var expressionTransformFlags = expression.transformFlags; - if (expressionKind === 200 - || expressionKind === 182) { + if (expressionKind === 201 + || expressionKind === 183) { transformFlags |= 3; } if (expressionTransformFlags & 1024) { @@ -20621,9 +22685,9 @@ var ts; transformFlags |= 8; } if (ts.hasModifier(node, 256)) { - transformFlags |= 16; + transformFlags |= node.asteriskToken ? 8 : 16; } - if (node.asteriskToken && ts.getEmitFlags(node) & 131072) { + if (node.asteriskToken) { transformFlags |= 768; } node.transformFlags = transformFlags | 536870912; @@ -20666,7 +22730,7 @@ var ts; transformFlags |= 3; } if (modifierFlags & 256) { - transformFlags |= 16; + transformFlags |= node.asteriskToken ? 8 : 16; } if (subtreeFlags & 1048576) { transformFlags |= 8; @@ -20674,7 +22738,7 @@ var ts; if (subtreeFlags & 163840) { transformFlags |= 192; } - if (node.asteriskToken && ts.getEmitFlags(node) & 131072) { + if (node.asteriskToken) { transformFlags |= 768; } } @@ -20689,7 +22753,7 @@ var ts; transformFlags |= 3; } if (ts.hasModifier(node, 256)) { - transformFlags |= 16; + transformFlags |= node.asteriskToken ? 8 : 16; } if (subtreeFlags & 1048576) { transformFlags |= 8; @@ -20697,7 +22761,7 @@ var ts; if (subtreeFlags & 163840) { transformFlags |= 192; } - if (node.asteriskToken && ts.getEmitFlags(node) & 131072) { + if (node.asteriskToken) { transformFlags |= 768; } node.transformFlags = transformFlags | 536870912; @@ -20810,8 +22874,8 @@ var ts; var excludeFlags = 536872257; switch (kind) { case 119: - case 189: - transformFlags |= 16; + case 190: + transformFlags |= 8 | 16; break; case 113: case 111: @@ -20819,50 +22883,66 @@ var ts; case 116: case 123: case 75: - case 229: - case 260: - case 182: - case 200: + case 231: + case 263: + case 183: case 201: + case 202: case 130: transformFlags |= 3; break; - case 246: - case 247: case 248: - case 10: case 249: case 250: + case 10: case 251: case 252: + case 253: + case 254: + case 255: transformFlags |= 4; break; - case 213: - transformFlags |= 8; case 12: case 13: case 14: case 15: - case 194: - case 181: - case 258: + case 195: + case 182: + case 261: case 114: + case 203: transformFlags |= 192; break; - case 195: - transformFlags |= 192 | 16777216; + case 9: + if (node.hasExtendedUnicodeEscape) { + transformFlags |= 192; + } + break; + case 8: + if (node.numericLiteralFlags & 48) { + transformFlags |= 192; + } + break; + case 215: + if (node.awaitModifier) { + transformFlags |= 8; + } + transformFlags |= 192; + break; + case 196: + transformFlags |= 8 | 192 | 16777216; break; case 118: case 132: case 129: - case 134: - case 121: + case 133: case 135: + case 121: + case 136: case 104: - case 143: - case 146: - case 148: - case 153: + case 144: + case 147: + case 149: case 154: case 155: case 156: @@ -20876,26 +22956,27 @@ var ts; case 164: case 165: case 166: - case 227: - case 228: case 167: + case 229: + case 230: case 168: case 169: case 170: case 171: + case 172: transformFlags = 3; excludeFlags = -3; break; - case 142: + case 143: transformFlags |= 2097152; if (subtreeFlags & 16384) { transformFlags |= 65536; } break; - case 196: + case 197: transformFlags |= 192 | 524288; break; - case 259: + case 262: transformFlags |= 8 | 1048576; break; case 96: @@ -20904,27 +22985,27 @@ var ts; case 98: transformFlags |= 16384; break; - case 172: + case 173: transformFlags |= 192 | 8388608; if (subtreeFlags & 524288) { transformFlags |= 8 | 1048576; } excludeFlags = 537396545; break; - case 173: + case 174: transformFlags |= 192 | 8388608; excludeFlags = 537396545; break; - case 174: + case 175: transformFlags |= 192; if (node.dotDotDotToken) { transformFlags |= 524288; } break; - case 145: + case 146: transformFlags |= 3 | 4096; break; - case 176: + case 177: excludeFlags = 540087617; if (subtreeFlags & 2097152) { transformFlags |= 192; @@ -20936,29 +23017,29 @@ var ts; transformFlags |= 8; } break; - case 175: - case 180: + case 176: + case 181: excludeFlags = 537396545; if (subtreeFlags & 524288) { transformFlags |= 192; } break; - case 209: - case 210: case 211: case 212: + case 213: + case 214: if (subtreeFlags & 4194304) { transformFlags |= 192; } break; - case 261: + case 264: if (subtreeFlags & 32768) { transformFlags |= 192; } break; + case 218: case 216: - case 214: - case 215: + case 217: transformFlags |= 33554432; break; } @@ -20966,56 +23047,57 @@ var ts; return transformFlags & ~excludeFlags; } function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 156 && kind <= 171) { + if (kind >= 157 && kind <= 172) { return -3; } switch (kind) { - case 179: case 180: - case 175: + case 181: + case 176: return 537396545; - case 230: + case 232: return 574674241; - case 144: + case 145: return 536872257; - case 185: + case 186: return 601249089; - case 184: - case 225: + case 185: + case 227: return 601281857; - case 224: - return 546309441; case 226: - case 197: + return 546309441; + case 228: + case 198: return 539358529; - case 150: - return 601015617; - case 149: case 151: + return 601015617; + case 150: case 152: + case 153: return 601015617; case 118: case 132: case 129: - case 134: - case 121: case 135: + case 133: + case 121: + case 136: case 104: - case 143: - case 146: - case 148: - case 153: + case 144: + case 147: + case 149: case 154: case 155: - case 227: - case 228: + case 156: + case 229: + case 230: return -3; - case 176: + case 177: return 540087617; - case 256: + case 259: return 537920833; - case 172: case 173: + case 174: return 537396545; default: return 536872257; @@ -21048,23 +23130,29 @@ var ts; ts.getSymbolId = getSymbolId; function createTypeChecker(host, produceDiagnostics) { var cancellationToken; + var requestedExternalEmitHelpers; + var externalHelpersModule; var Symbol = ts.objectAllocator.getSymbolConstructor(); var Type = ts.objectAllocator.getTypeConstructor(); var Signature = ts.objectAllocator.getSignatureConstructor(); var typeCount = 0; var symbolCount = 0; + var symbolInstantiationDepth = 0; var emptyArray = []; var emptySymbols = ts.createMap(); var compilerOptions = host.getCompilerOptions(); - var languageVersion = compilerOptions.target || 0; + var languageVersion = ts.getEmitScriptTarget(compilerOptions); var modulekind = ts.getEmitModuleKind(compilerOptions); var noUnusedIdentifiers = !!compilerOptions.noUnusedLocals || !!compilerOptions.noUnusedParameters; var allowSyntheticDefaultImports = typeof compilerOptions.allowSyntheticDefaultImports !== "undefined" ? compilerOptions.allowSyntheticDefaultImports : modulekind === ts.ModuleKind.System; - var strictNullChecks = compilerOptions.strictNullChecks; + var strictNullChecks = compilerOptions.strictNullChecks === undefined ? compilerOptions.strict : compilerOptions.strictNullChecks; + var noImplicitAny = compilerOptions.noImplicitAny === undefined ? compilerOptions.strict : compilerOptions.noImplicitAny; + var noImplicitThis = compilerOptions.noImplicitThis === undefined ? compilerOptions.strict : compilerOptions.noImplicitThis; var emitResolver = createResolver(); - var undefinedSymbol = createSymbol(4 | 67108864, "undefined"); + var nodeBuilder = createNodeBuilder(); + var undefinedSymbol = createSymbol(4, "undefined"); undefinedSymbol.declarations = []; - var argumentsSymbol = createSymbol(4 | 67108864, "arguments"); + var argumentsSymbol = createSymbol(4, "arguments"); var checker = { getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), "identifierCount"); }, @@ -21073,47 +23161,127 @@ var ts; isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, isUnknownSymbol: function (symbol) { return symbol === unknownSymbol; }, + getMergedSymbol: getMergedSymbol, getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, - getTypeOfSymbolAtLocation: getTypeOfSymbolAtLocation, - getSymbolsOfParameterPropertyDeclaration: getSymbolsOfParameterPropertyDeclaration, + getTypeOfSymbolAtLocation: function (symbol, location) { + location = ts.getParseTreeNode(location); + return location ? getTypeOfSymbolAtLocation(symbol, location) : unknownType; + }, + getSymbolsOfParameterPropertyDeclaration: function (parameter, parameterName) { + parameter = ts.getParseTreeNode(parameter, ts.isParameter); + ts.Debug.assert(parameter !== undefined, "Cannot get symbols of a synthetic parameter that cannot be resolved to a parse-tree node."); + return getSymbolsOfParameterPropertyDeclaration(parameter, parameterName); + }, getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, getPropertiesOfType: getPropertiesOfType, getPropertyOfType: getPropertyOfType, + getIndexInfoOfType: getIndexInfoOfType, getSignaturesOfType: getSignaturesOfType, getIndexTypeOfType: getIndexTypeOfType, getBaseTypes: getBaseTypes, + getBaseTypeOfLiteralType: getBaseTypeOfLiteralType, + getWidenedType: getWidenedType, + getTypeFromTypeNode: function (node) { + node = ts.getParseTreeNode(node, ts.isTypeNode); + return node ? getTypeFromTypeNode(node) : unknownType; + }, + getParameterType: getTypeAtPosition, getReturnTypeOfSignature: getReturnTypeOfSignature, getNonNullableType: getNonNullableType, - getSymbolsInScope: getSymbolsInScope, - getSymbolAtLocation: getSymbolAtLocation, - getShorthandAssignmentValueSymbol: getShorthandAssignmentValueSymbol, - getExportSpecifierLocalTargetSymbol: getExportSpecifierLocalTargetSymbol, - getTypeAtLocation: getTypeOfNode, - getPropertySymbolOfDestructuringAssignment: getPropertySymbolOfDestructuringAssignment, - typeToString: typeToString, + typeToTypeNode: nodeBuilder.typeToTypeNode, + indexInfoToIndexSignatureDeclaration: nodeBuilder.indexInfoToIndexSignatureDeclaration, + signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration, + getSymbolsInScope: function (location, meaning) { + location = ts.getParseTreeNode(location); + return location ? getSymbolsInScope(location, meaning) : []; + }, + getSymbolAtLocation: function (node) { + node = ts.getParseTreeNode(node); + return node ? getSymbolAtLocation(node) : undefined; + }, + getShorthandAssignmentValueSymbol: function (node) { + node = ts.getParseTreeNode(node); + return node ? getShorthandAssignmentValueSymbol(node) : undefined; + }, + getExportSpecifierLocalTargetSymbol: function (node) { + node = ts.getParseTreeNode(node, ts.isExportSpecifier); + return node ? getExportSpecifierLocalTargetSymbol(node) : undefined; + }, + getTypeAtLocation: function (node) { + node = ts.getParseTreeNode(node); + return node ? getTypeOfNode(node) : unknownType; + }, + getPropertySymbolOfDestructuringAssignment: function (location) { + location = ts.getParseTreeNode(location, ts.isIdentifier); + return location ? getPropertySymbolOfDestructuringAssignment(location) : undefined; + }, + signatureToString: function (signature, enclosingDeclaration, flags, kind) { + return signatureToString(signature, ts.getParseTreeNode(enclosingDeclaration), flags, kind); + }, + typeToString: function (type, enclosingDeclaration, flags) { + return typeToString(type, ts.getParseTreeNode(enclosingDeclaration), flags); + }, getSymbolDisplayBuilder: getSymbolDisplayBuilder, - symbolToString: symbolToString, + symbolToString: function (symbol, enclosingDeclaration, meaning) { + return symbolToString(symbol, ts.getParseTreeNode(enclosingDeclaration), meaning); + }, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, - getContextualType: getContextualType, + getContextualType: function (node) { + node = ts.getParseTreeNode(node, ts.isExpression); + return node ? getContextualType(node) : undefined; + }, getFullyQualifiedName: getFullyQualifiedName, - getResolvedSignature: getResolvedSignature, - getConstantValue: getConstantValue, - isValidPropertyAccess: isValidPropertyAccess, - getSignatureFromDeclaration: getSignatureFromDeclaration, - isImplementationOfOverload: isImplementationOfOverload, + getResolvedSignature: function (node, candidatesOutArray) { + node = ts.getParseTreeNode(node, ts.isCallLikeExpression); + return node ? getResolvedSignature(node, candidatesOutArray) : undefined; + }, + getConstantValue: function (node) { + node = ts.getParseTreeNode(node, canHaveConstantValue); + return node ? getConstantValue(node) : undefined; + }, + isValidPropertyAccess: function (node, propertyName) { + node = ts.getParseTreeNode(node, ts.isPropertyAccessOrQualifiedName); + return node ? isValidPropertyAccess(node, propertyName) : false; + }, + getSignatureFromDeclaration: function (declaration) { + declaration = ts.getParseTreeNode(declaration, ts.isFunctionLike); + return declaration ? getSignatureFromDeclaration(declaration) : undefined; + }, + isImplementationOfOverload: function (node) { + node = ts.getParseTreeNode(node, ts.isFunctionLike); + return node ? isImplementationOfOverload(node) : undefined; + }, + getImmediateAliasedSymbol: function (symbol) { + ts.Debug.assert((symbol.flags & 8388608) !== 0, "Should only get Alias here."); + var links = getSymbolLinks(symbol); + if (!links.immediateTarget) { + var node = getDeclarationOfAliasSymbol(symbol); + ts.Debug.assert(!!node); + links.immediateTarget = getTargetOfAliasDeclaration(node, true); + } + return links.immediateTarget; + }, getAliasedSymbol: resolveAlias, getEmitResolver: getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, + getExportsAndPropertiesOfModule: getExportsAndPropertiesOfModule, getAmbientModules: getAmbientModules, - getJsxElementAttributesType: getJsxElementAttributesType, + getAllAttributesTypeFromJsxOpeningLikeElement: function (node) { + node = ts.getParseTreeNode(node, ts.isJsxOpeningLikeElement); + return node ? getAllAttributesTypeFromJsxOpeningLikeElement(node) : undefined; + }, getJsxIntrinsicTagNames: getJsxIntrinsicTagNames, - isOptionalParameter: isOptionalParameter, + isOptionalParameter: function (node) { + node = ts.getParseTreeNode(node, ts.isParameter); + return node ? isOptionalParameter(node) : false; + }, tryGetMemberInModuleExports: tryGetMemberInModuleExports, tryFindAmbientModuleWithoutAugmentations: function (moduleName) { return tryFindAmbientModule(moduleName, false); - } + }, + getApparentType: getApparentType }; var tupleTypes = []; var unionTypes = ts.createMap(); @@ -21122,8 +23290,8 @@ var ts; var numericLiteralTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); var evolvingArrayTypes = []; - var unknownSymbol = createSymbol(4 | 67108864, "unknown"); - var resolvingSymbol = createSymbol(67108864, "__resolving__"); + var unknownSymbol = createSymbol(4, "unknown"); + var resolvingSymbol = createSymbol(0, "__resolving__"); var anyType = createIntrinsicType(1, "any"); var autoType = createIntrinsicType(1, "any"); var unknownType = createIntrinsicType(1, "unknown"); @@ -21140,8 +23308,9 @@ var ts; var voidType = createIntrinsicType(1024, "void"); var neverType = createIntrinsicType(8192, "never"); var silentNeverType = createIntrinsicType(8192, "never"); + var nonPrimitiveType = createIntrinsicType(16777216, "object"); var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); - var emptyTypeLiteralSymbol = createSymbol(2048 | 67108864, "__type"); + var emptyTypeLiteralSymbol = createSymbol(2048, "__type"); emptyTypeLiteralSymbol.members = ts.createMap(); var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, undefined, undefined); var emptyGenericType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); @@ -21149,16 +23318,15 @@ var ts; var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); anyFunctionType.flags |= 8388608; var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var circularConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anySignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, undefined, 0, false, false); var unknownSignature = createSignature(undefined, undefined, undefined, emptyArray, unknownType, undefined, 0, false, false); var resolvingSignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, undefined, 0, false, false); var silentNeverSignature = createSignature(undefined, undefined, undefined, emptyArray, silentNeverType, undefined, 0, false, false); var enumNumberIndexInfo = createIndexInfo(stringType, true); + var jsObjectLiteralIndexInfo = createIndexInfo(anyType, false); var globals = ts.createMap(); var patternAmbientModules; - var getGlobalESSymbolConstructorSymbol; - var getGlobalPromiseConstructorSymbol; - var tryGetGlobalPromiseConstructorSymbol; var globalObjectType; var globalFunctionType; var globalArrayType; @@ -21167,26 +23335,26 @@ var ts; var globalNumberType; var globalBooleanType; var globalRegExpType; + var globalThisType; var anyArrayType; var autoArrayType; var anyReadonlyArrayType; - var getGlobalTemplateStringsArrayType; - var getGlobalESSymbolType; - var getGlobalIterableType; - var getGlobalIteratorType; - var getGlobalIterableIteratorType; - var getGlobalClassDecoratorType; - var getGlobalParameterDecoratorType; - var getGlobalPropertyDecoratorType; - var getGlobalMethodDecoratorType; - var getGlobalTypedPropertyDescriptorType; - var getGlobalPromiseType; - var tryGetGlobalPromiseType; - var getGlobalPromiseLikeType; - var getInstantiatedGlobalPromiseLikeType; - var getGlobalPromiseConstructorLikeType; - var getGlobalThenableType; - var jsxElementClassType; + var deferredGlobalESSymbolConstructorSymbol; + var deferredGlobalESSymbolType; + var deferredGlobalTypedPropertyDescriptorType; + var deferredGlobalPromiseType; + var deferredGlobalPromiseConstructorSymbol; + var deferredGlobalPromiseConstructorLikeType; + var deferredGlobalIterableType; + var deferredGlobalIteratorType; + var deferredGlobalIterableIteratorType; + var deferredGlobalAsyncIterableType; + var deferredGlobalAsyncIteratorType; + var deferredGlobalAsyncIterableIteratorType; + var deferredGlobalTemplateStringsArrayType; + var deferredJsxElementClassType; + var deferredJsxElementType; + var deferredJsxStatelessElementType; var deferredNodes; var deferredUnusedIdentifierNodes; var flowLoopStart = 0; @@ -21207,9 +23375,70 @@ var ts; var visitedFlowNodes = []; var visitedFlowTypes = []; var potentialThisCollisions = []; + var potentialNewTargetCollisions = []; var awaitedTypeStack = []; var diagnostics = ts.createDiagnosticCollection(); - var typeofEQFacts = ts.createMap({ + var TypeFacts; + (function (TypeFacts) { + TypeFacts[TypeFacts["None"] = 0] = "None"; + TypeFacts[TypeFacts["TypeofEQString"] = 1] = "TypeofEQString"; + TypeFacts[TypeFacts["TypeofEQNumber"] = 2] = "TypeofEQNumber"; + TypeFacts[TypeFacts["TypeofEQBoolean"] = 4] = "TypeofEQBoolean"; + TypeFacts[TypeFacts["TypeofEQSymbol"] = 8] = "TypeofEQSymbol"; + TypeFacts[TypeFacts["TypeofEQObject"] = 16] = "TypeofEQObject"; + TypeFacts[TypeFacts["TypeofEQFunction"] = 32] = "TypeofEQFunction"; + TypeFacts[TypeFacts["TypeofEQHostObject"] = 64] = "TypeofEQHostObject"; + TypeFacts[TypeFacts["TypeofNEString"] = 128] = "TypeofNEString"; + TypeFacts[TypeFacts["TypeofNENumber"] = 256] = "TypeofNENumber"; + TypeFacts[TypeFacts["TypeofNEBoolean"] = 512] = "TypeofNEBoolean"; + TypeFacts[TypeFacts["TypeofNESymbol"] = 1024] = "TypeofNESymbol"; + TypeFacts[TypeFacts["TypeofNEObject"] = 2048] = "TypeofNEObject"; + TypeFacts[TypeFacts["TypeofNEFunction"] = 4096] = "TypeofNEFunction"; + TypeFacts[TypeFacts["TypeofNEHostObject"] = 8192] = "TypeofNEHostObject"; + TypeFacts[TypeFacts["EQUndefined"] = 16384] = "EQUndefined"; + TypeFacts[TypeFacts["EQNull"] = 32768] = "EQNull"; + TypeFacts[TypeFacts["EQUndefinedOrNull"] = 65536] = "EQUndefinedOrNull"; + TypeFacts[TypeFacts["NEUndefined"] = 131072] = "NEUndefined"; + TypeFacts[TypeFacts["NENull"] = 262144] = "NENull"; + TypeFacts[TypeFacts["NEUndefinedOrNull"] = 524288] = "NEUndefinedOrNull"; + TypeFacts[TypeFacts["Truthy"] = 1048576] = "Truthy"; + TypeFacts[TypeFacts["Falsy"] = 2097152] = "Falsy"; + TypeFacts[TypeFacts["Discriminatable"] = 4194304] = "Discriminatable"; + TypeFacts[TypeFacts["All"] = 8388607] = "All"; + TypeFacts[TypeFacts["BaseStringStrictFacts"] = 933633] = "BaseStringStrictFacts"; + TypeFacts[TypeFacts["BaseStringFacts"] = 3145473] = "BaseStringFacts"; + TypeFacts[TypeFacts["StringStrictFacts"] = 4079361] = "StringStrictFacts"; + TypeFacts[TypeFacts["StringFacts"] = 4194049] = "StringFacts"; + TypeFacts[TypeFacts["EmptyStringStrictFacts"] = 3030785] = "EmptyStringStrictFacts"; + TypeFacts[TypeFacts["EmptyStringFacts"] = 3145473] = "EmptyStringFacts"; + TypeFacts[TypeFacts["NonEmptyStringStrictFacts"] = 1982209] = "NonEmptyStringStrictFacts"; + TypeFacts[TypeFacts["NonEmptyStringFacts"] = 4194049] = "NonEmptyStringFacts"; + TypeFacts[TypeFacts["BaseNumberStrictFacts"] = 933506] = "BaseNumberStrictFacts"; + TypeFacts[TypeFacts["BaseNumberFacts"] = 3145346] = "BaseNumberFacts"; + TypeFacts[TypeFacts["NumberStrictFacts"] = 4079234] = "NumberStrictFacts"; + TypeFacts[TypeFacts["NumberFacts"] = 4193922] = "NumberFacts"; + TypeFacts[TypeFacts["ZeroStrictFacts"] = 3030658] = "ZeroStrictFacts"; + TypeFacts[TypeFacts["ZeroFacts"] = 3145346] = "ZeroFacts"; + TypeFacts[TypeFacts["NonZeroStrictFacts"] = 1982082] = "NonZeroStrictFacts"; + TypeFacts[TypeFacts["NonZeroFacts"] = 4193922] = "NonZeroFacts"; + TypeFacts[TypeFacts["BaseBooleanStrictFacts"] = 933252] = "BaseBooleanStrictFacts"; + TypeFacts[TypeFacts["BaseBooleanFacts"] = 3145092] = "BaseBooleanFacts"; + TypeFacts[TypeFacts["BooleanStrictFacts"] = 4078980] = "BooleanStrictFacts"; + TypeFacts[TypeFacts["BooleanFacts"] = 4193668] = "BooleanFacts"; + TypeFacts[TypeFacts["FalseStrictFacts"] = 3030404] = "FalseStrictFacts"; + TypeFacts[TypeFacts["FalseFacts"] = 3145092] = "FalseFacts"; + TypeFacts[TypeFacts["TrueStrictFacts"] = 1981828] = "TrueStrictFacts"; + TypeFacts[TypeFacts["TrueFacts"] = 4193668] = "TrueFacts"; + TypeFacts[TypeFacts["SymbolStrictFacts"] = 1981320] = "SymbolStrictFacts"; + TypeFacts[TypeFacts["SymbolFacts"] = 4193160] = "SymbolFacts"; + TypeFacts[TypeFacts["ObjectStrictFacts"] = 6166480] = "ObjectStrictFacts"; + TypeFacts[TypeFacts["ObjectFacts"] = 8378320] = "ObjectFacts"; + TypeFacts[TypeFacts["FunctionStrictFacts"] = 6164448] = "FunctionStrictFacts"; + TypeFacts[TypeFacts["FunctionFacts"] = 8376288] = "FunctionFacts"; + TypeFacts[TypeFacts["UndefinedFacts"] = 2457472] = "UndefinedFacts"; + TypeFacts[TypeFacts["NullFacts"] = 2340752] = "NullFacts"; + })(TypeFacts || (TypeFacts = {})); + var typeofEQFacts = ts.createMapFromTemplate({ "string": 1, "number": 2, "boolean": 4, @@ -21218,7 +23447,7 @@ var ts; "object": 16, "function": 32 }); - var typeofNEFacts = ts.createMap({ + var typeofNEFacts = ts.createMapFromTemplate({ "string": 128, "number": 256, "boolean": 512, @@ -21227,14 +23456,14 @@ var ts; "object": 2048, "function": 4096 }); - var typeofTypesByName = ts.createMap({ + var typeofTypesByName = ts.createMapFromTemplate({ "string": stringType, "number": numberType, "boolean": booleanType, "symbol": esSymbolType, "undefined": undefinedType }); - var jsxElementType; + var typeofType = createTypeofType(); var _jsxNamespace; var _jsxFactoryEntity; var jsxTypes = ts.createMap(); @@ -21253,8 +23482,21 @@ var ts; var identityRelation = ts.createMap(); var enumRelation = ts.createMap(); var _displayBuilder; + var TypeSystemPropertyName; + (function (TypeSystemPropertyName) { + TypeSystemPropertyName[TypeSystemPropertyName["Type"] = 0] = "Type"; + TypeSystemPropertyName[TypeSystemPropertyName["ResolvedBaseConstructorType"] = 1] = "ResolvedBaseConstructorType"; + TypeSystemPropertyName[TypeSystemPropertyName["DeclaredType"] = 2] = "DeclaredType"; + TypeSystemPropertyName[TypeSystemPropertyName["ResolvedReturnType"] = 3] = "ResolvedReturnType"; + })(TypeSystemPropertyName || (TypeSystemPropertyName = {})); + var CheckMode; + (function (CheckMode) { + CheckMode[CheckMode["Normal"] = 0] = "Normal"; + CheckMode[CheckMode["SkipContextSensitive"] = 1] = "SkipContextSensitive"; + CheckMode[CheckMode["Inferential"] = 2] = "Inferential"; + })(CheckMode || (CheckMode = {})); var builtinGlobals = ts.createMap(); - builtinGlobals[undefinedSymbol.name] = undefinedSymbol; + builtinGlobals.set(undefinedSymbol.name, undefinedSymbol); initializeTypeChecker(); return checker; function getJsxNamespace() { @@ -21284,7 +23526,12 @@ var ts; } function createSymbol(flags, name) { symbolCount++; - return new Symbol(flags, name); + var symbol = (new Symbol(flags | 134217728, name)); + symbol.checkFlags = 0; + return symbol; + } + function isTransientSymbol(symbol) { + return (symbol.flags & 134217728) !== 0; } function getExcludedSymbolFlags(flags) { var result = 0; @@ -21330,7 +23577,7 @@ var ts; mergedSymbols[source.mergeId] = target; } function cloneSymbol(symbol) { - var result = createSymbol(symbol.flags | 33554432, symbol.name); + var result = createSymbol(symbol.flags, symbol.name); result.declarations = symbol.declarations.slice(0); result.parent = symbol.parent; if (symbol.valueDeclaration) @@ -21352,12 +23599,10 @@ var ts; target.flags |= source.flags; if (source.valueDeclaration && (!target.valueDeclaration || - (target.valueDeclaration.kind === 230 && source.valueDeclaration.kind !== 230))) { + (target.valueDeclaration.kind === 232 && source.valueDeclaration.kind !== 232))) { target.valueDeclaration = source.valueDeclaration; } - ts.forEach(source.declarations, function (node) { - target.declarations.push(node); - }); + ts.addRange(target.declarations, source.declarations); if (source.members) { if (!target.members) target.members = ts.createMap(); @@ -21370,6 +23615,9 @@ var ts; } recordMergedSymbol(target, source); } + else if (target.flags & 1024) { + error(source.valueDeclaration.name, ts.Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target)); + } else { var message_2 = target.flags & 2 || source.flags & 2 ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; @@ -21382,18 +23630,19 @@ var ts; } } function mergeSymbolTable(target, source) { - for (var id in source) { - var targetSymbol = target[id]; + source.forEach(function (sourceSymbol, id) { + var targetSymbol = target.get(id); if (!targetSymbol) { - target[id] = source[id]; + target.set(id, sourceSymbol); } else { - if (!(targetSymbol.flags & 33554432)) { - target[id] = targetSymbol = cloneSymbol(targetSymbol); + if (!(targetSymbol.flags & 134217728)) { + targetSymbol = cloneSymbol(targetSymbol); + target.set(id, targetSymbol); } - mergeSymbol(targetSymbol, source[id]); + mergeSymbol(targetSymbol, sourceSymbol); } - } + }); } function mergeModuleAugmentation(moduleName) { var moduleAugmentation = moduleName.parent; @@ -21414,7 +23663,7 @@ var ts; } mainModule = resolveExternalModuleSymbol(mainModule); if (mainModule.flags & 1920) { - mainModule = mainModule.flags & 33554432 ? mainModule : cloneSymbol(mainModule); + mainModule = mainModule.flags & 134217728 ? mainModule : cloneSymbol(mainModule); mergeSymbol(mainModule, moduleAugmentation.symbol); } else { @@ -21423,20 +23672,21 @@ var ts; } } function addToSymbolTable(target, source, message) { - for (var id in source) { - if (target[id]) { - ts.forEach(target[id].declarations, addDeclarationDiagnostic(id, message)); + source.forEach(function (sourceSymbol, id) { + var targetSymbol = target.get(id); + if (targetSymbol) { + ts.forEach(targetSymbol.declarations, addDeclarationDiagnostic(id, message)); } else { - target[id] = source[id]; + target.set(id, sourceSymbol); } - } + }); function addDeclarationDiagnostic(id, message) { return function (declaration) { return diagnostics.add(ts.createDiagnosticForNode(declaration, message, id)); }; } } function getSymbolLinks(symbol) { - if (symbol.flags & 67108864) + if (symbol.flags & 134217728) return symbol; var id = getSymbolId(symbol); return symbolLinks[id] || (symbolLinks[id] = {}); @@ -21448,14 +23698,17 @@ var ts; function getObjectFlags(type) { return type.flags & 32768 ? type.objectFlags : 0; } + function getCheckFlags(symbol) { + return symbol.flags & 134217728 ? symbol.checkFlags : 0; + } function isGlobalSourceFile(node) { - return node.kind === 261 && !ts.isExternalOrCommonJsModule(node); + return node.kind === 264 && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { - var symbol = symbols[name]; + var symbol = symbols.get(name); if (symbol) { - ts.Debug.assert((symbol.flags & 16777216) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((getCheckFlags(symbol) & 1) === 0, "Should never get an instantiated symbol here."); if (symbol.flags & meaning) { return symbol; } @@ -21486,57 +23739,76 @@ var ts; (!compilerOptions.outFile && !compilerOptions.out)) { return true; } - if (isUsedInFunctionOrNonStaticProperty(usage)) { + if (isUsedInFunctionOrInstanceProperty(usage, declaration)) { return true; } var sourceFiles = host.getSourceFiles(); return ts.indexOf(sourceFiles, declarationFile) <= ts.indexOf(sourceFiles, useFile); } if (declaration.pos <= usage.pos) { - return declaration.kind !== 223 || - !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); + if (declaration.kind === 175) { + var errorBindingElement = ts.getAncestor(usage, 175); + if (errorBindingElement) { + return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || + declaration.pos < errorBindingElement.pos; + } + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 225), usage); + } + else if (declaration.kind === 225) { + return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); + } + return true; + } + if (usage.parent.kind === 245) { + return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); - return isUsedInFunctionOrNonStaticProperty(usage, container); + return isInTypeQuery(usage) || isUsedInFunctionOrInstanceProperty(usage, declaration, container); function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 205: - case 211: + case 207: case 213: + case 215: if (isSameScopeDescendentOf(usage, declaration, container)) { return true; } break; } switch (declaration.parent.parent.kind) { - case 212: - case 213: + case 214: + case 215: if (isSameScopeDescendentOf(usage, declaration.parent.parent.expression, container)) { return true; } } return false; } - function isUsedInFunctionOrNonStaticProperty(usage, container) { - var current = usage; - while (current) { + function isUsedInFunctionOrInstanceProperty(usage, declaration, container) { + return !!ts.findAncestor(usage, function (current) { if (current === container) { - return false; + return "quit"; } if (ts.isFunctionLike(current)) { return true; } - var initializerOfNonStaticProperty = current.parent && - current.parent.kind === 147 && - (ts.getModifierFlags(current.parent) & 32) === 0 && + var initializerOfProperty = current.parent && + current.parent.kind === 148 && current.parent.initializer === current; - if (initializerOfNonStaticProperty) { - return true; + if (initializerOfProperty) { + if (ts.getModifierFlags(current.parent) & 32) { + if (declaration.kind === 150) { + return true; + } + } + else { + var isDeclarationInstanceProperty = declaration.kind === 148 && !(ts.getModifierFlags(declaration) & 32); + if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { + return true; + } + } } - current = current.parent; - } - return false; + }); } } function resolveName(location, name, meaning, nameNotFoundMessage, nameArg) { @@ -21551,18 +23823,18 @@ var ts; if (result = getSymbol(location.locals, name, meaning)) { var useResult = true; if (ts.isFunctionLike(location) && lastLocation && lastLocation !== location.body) { - if (meaning & result.flags & 793064 && lastLocation.kind !== 278) { + if (meaning & result.flags & 793064 && lastLocation.kind !== 282) { useResult = result.flags & 262144 ? lastLocation === location.type || - lastLocation.kind === 144 || - lastLocation.kind === 143 + lastLocation.kind === 145 || + lastLocation.kind === 144 : false; } if (meaning & 107455 && result.flags & 1) { useResult = - lastLocation.kind === 144 || + lastLocation.kind === 145 || (lastLocation === location.type && - result.valueDeclaration.kind === 144); + result.valueDeclaration.kind === 145); } } if (useResult) { @@ -21574,23 +23846,24 @@ var ts; } } switch (location.kind) { - case 261: + case 264: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; - case 230: + case 232: var moduleExports = getSymbolOfNode(location).exports; - if (location.kind === 261 || ts.isAmbientModule(location)) { - if (result = moduleExports["default"]) { + if (location.kind === 264 || ts.isAmbientModule(location)) { + if (result = moduleExports.get("default")) { var localSymbol = ts.getLocalSymbolForExportDefault(result); if (localSymbol && (result.flags & meaning) && localSymbol.name === name) { break loop; } result = undefined; } - if (moduleExports[name] && - moduleExports[name].flags === 8388608 && - ts.getDeclarationOfKind(moduleExports[name], 243)) { + var moduleExport = moduleExports.get(name); + if (moduleExport && + moduleExport.flags === 8388608 && + ts.getDeclarationOfKind(moduleExport, 245)) { break; } } @@ -21598,13 +23871,13 @@ var ts; break loop; } break; - case 229: + case 231: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8)) { break loop; } break; + case 148: case 147: - case 146: if (ts.isClassLike(location.parent) && !(ts.getModifierFlags(location) & 32)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { @@ -21614,17 +23887,21 @@ var ts; } } break; - case 226: - case 197: - case 227: + case 228: + case 198: + case 229: if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793064)) { + if (!isTypeParameterSymbolDeclaredInContainer(result, location)) { + result = undefined; + break; + } if (lastLocation && ts.getModifierFlags(lastLocation) & 32) { error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); return undefined; } break loop; } - if (location.kind === 197 && meaning & 32) { + if (location.kind === 198 && meaning & 32) { var className = location.name; if (className && name === className.text) { result = location.symbol; @@ -21632,28 +23909,28 @@ var ts; } } break; - case 142: + case 143: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 227) { + if (ts.isClassLike(grandparent) || grandparent.kind === 229) { if (result = getSymbol(getSymbolOfNode(grandparent).members, name, meaning & 793064)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); return undefined; } } break; - case 149: - case 148: case 150: + case 149: case 151: case 152: - case 225: - case 185: + case 153: + case 227: + case 186: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 184: + case 185: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; @@ -21666,8 +23943,8 @@ var ts; } } break; - case 145: - if (location.parent && location.parent.kind === 144) { + case 146: + if (location.parent && location.parent.kind === 145) { location = location.parent; } if (location.parent && ts.isClassElement(location.parent)) { @@ -21690,7 +23967,8 @@ var ts; !checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && !checkAndReportErrorForExtendingInterface(errorLocation) && !checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) && - !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning)) { + !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) && + !checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning)) { error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); } } @@ -21702,21 +23980,31 @@ var ts; error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.declarationNameToString(propertyName), typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); return undefined; } - if (meaning & 2) { + if (meaning & 2 || + ((meaning & 32 || meaning & 384) && (meaning & 107455) === 107455)) { var exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result); - if (exportOrLocalSymbol.flags & 2) { + if (exportOrLocalSymbol.flags & 2 || exportOrLocalSymbol.flags & 32 || exportOrLocalSymbol.flags & 384) { checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation); } } if (result && isInExternalModule && (meaning & 107455) === 107455) { var decls = result.declarations; - if (decls && decls.length === 1 && decls[0].kind === 233) { + if (decls && decls.length === 1 && decls[0].kind === 235) { error(errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, name); } } } return result; } + function isTypeParameterSymbolDeclaredInContainer(symbol, container) { + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + if (decl.kind === 144 && decl.parent === container) { + return true; + } + } + return false; + } function checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) { if ((errorLocation.kind === 70 && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) { return false; @@ -21757,9 +24045,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 70: - case 177: + case 178: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 199: + case 200: ts.Debug.assert(ts.isEntityNameExpression(node.expression)); return node.expression; default: @@ -21786,65 +24074,84 @@ var ts; } return false; } - function checkResolvedBlockScopedVariable(result, errorLocation) { - ts.Debug.assert((result.flags & 2) !== 0); - var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; }); - ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); - if (!ts.isInAmbientContext(declaration) && !isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 223), errorLocation)) { - error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + function checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) { + if (meaning & (107455 & ~1024 & ~793064)) { + var symbol = resolveSymbol(resolveName(errorLocation, name, 1024 & ~107455, undefined, undefined)); + if (symbol) { + error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_value, name); + return true; + } } - } - function isSameScopeDescendentOf(initial, parent, stopAt) { - if (!parent) { - return false; - } - for (var current = initial; current && current !== stopAt && !ts.isFunctionLike(current); current = current.parent) { - if (current === parent) { + else if (meaning & (793064 & ~1024 & ~107455)) { + var symbol = resolveSymbol(resolveName(errorLocation, name, 1024 & ~793064, undefined, undefined)); + if (symbol) { + error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_type, name); return true; } } return false; } + function checkResolvedBlockScopedVariable(result, errorLocation) { + ts.Debug.assert(!!(result.flags & 2 || result.flags & 32 || result.flags & 384)); + var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 231) ? d : undefined; }); + ts.Debug.assert(declaration !== undefined, "Declaration to checkResolvedBlockScopedVariable is undefined"); + if (!ts.isInAmbientContext(declaration) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { + if (result.flags & 2) { + error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + } + else if (result.flags & 32) { + error(errorLocation, ts.Diagnostics.Class_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + } + else if (result.flags & 384) { + error(errorLocation, ts.Diagnostics.Enum_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + } + } + } + function isSameScopeDescendentOf(initial, parent, stopAt) { + return parent && !!ts.findAncestor(initial, function (n) { return n === stopAt || ts.isFunctionLike(n) ? "quit" : n === parent; }); + } function getAnyImportSyntax(node) { if (ts.isAliasSymbolDeclaration(node)) { - if (node.kind === 234) { + if (node.kind === 236) { return node; } - while (node && node.kind !== 235) { - node = node.parent; - } - return node; + return ts.findAncestor(node, function (n) { return n.kind === 237; }); } } function getDeclarationOfAliasSymbol(symbol) { - return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); + return ts.find(symbol.declarations, ts.isAliasSymbolDeclaration); } - function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 245) { + function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { + if (node.moduleReference.kind === 247) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } - return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference); + return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias); } - function getTargetOfImportClause(node) { + function getTargetOfImportClause(node, dontResolveAlias) { var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { - var exportDefaultSymbol = ts.isShorthandAmbientModuleSymbol(moduleSymbol) ? - moduleSymbol : - moduleSymbol.exports["export="] ? - getPropertyOfType(getTypeOfSymbol(moduleSymbol.exports["export="]), "default") : - resolveSymbol(moduleSymbol.exports["default"]); + var exportDefaultSymbol = void 0; + if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { + exportDefaultSymbol = moduleSymbol; + } + else { + var exportValue = moduleSymbol.exports.get("export="); + exportDefaultSymbol = exportValue + ? getPropertyOfType(getTypeOfSymbol(exportValue), "default") + : resolveSymbol(moduleSymbol.exports.get("default"), dontResolveAlias); + } if (!exportDefaultSymbol && !allowSyntheticDefaultImports) { error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); } else if (!exportDefaultSymbol && allowSyntheticDefaultImports) { - return resolveExternalModuleSymbol(moduleSymbol) || resolveSymbol(moduleSymbol); + return resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); } return exportDefaultSymbol; } } - function getTargetOfNamespaceImport(node) { + function getTargetOfNamespaceImport(node, dontResolveAlias) { var moduleSpecifier = node.parent.parent.moduleSpecifier; - return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier); + return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier, dontResolveAlias); } function combineValueAndTypeSymbols(valueSymbol, typeSymbol) { if (valueSymbol.flags & (793064 | 1920)) { @@ -21861,12 +24168,9 @@ var ts; result.exports = valueSymbol.exports; return result; } - function getExportOfModule(symbol, name) { + function getExportOfModule(symbol, name, dontResolveAlias) { if (symbol.flags & 1536) { - var exportedSymbol = getExportsOfSymbol(symbol)[name]; - if (exportedSymbol) { - return resolveSymbol(exportedSymbol); - } + return resolveSymbol(getExportsOfSymbol(symbol).get(name), dontResolveAlias); } } function getPropertyOfVariable(symbol, name) { @@ -21877,71 +24181,72 @@ var ts; } } } - function getExternalModuleMember(node, specifier) { + function getExternalModuleMember(node, specifier, dontResolveAlias) { var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); - var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier); + var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier, dontResolveAlias); if (targetSymbol) { - var name_18 = specifier.propertyName || specifier.name; - if (name_18.text) { + var name = specifier.propertyName || specifier.name; + if (name.text) { if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { return moduleSymbol; } var symbolFromVariable = void 0; - if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports["export="]) { - symbolFromVariable = getPropertyOfType(getTypeOfSymbol(targetSymbol), name_18.text); + if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports.get("export=")) { + symbolFromVariable = getPropertyOfType(getTypeOfSymbol(targetSymbol), name.text); } else { - symbolFromVariable = getPropertyOfVariable(targetSymbol, name_18.text); + symbolFromVariable = getPropertyOfVariable(targetSymbol, name.text); } - symbolFromVariable = resolveSymbol(symbolFromVariable); - var symbolFromModule = getExportOfModule(targetSymbol, name_18.text); - if (!symbolFromModule && allowSyntheticDefaultImports && name_18.text === "default") { - symbolFromModule = resolveExternalModuleSymbol(moduleSymbol) || resolveSymbol(moduleSymbol); + symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias); + var symbolFromModule = getExportOfModule(targetSymbol, name.text, dontResolveAlias); + if (!symbolFromModule && allowSyntheticDefaultImports && name.text === "default") { + symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); } var symbol = symbolFromModule && symbolFromVariable ? combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) : symbolFromModule || symbolFromVariable; if (!symbol) { - error(name_18, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name_18)); + error(name, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name)); } return symbol; } } } - function getTargetOfImportSpecifier(node) { - return getExternalModuleMember(node.parent.parent.parent, node); + function getTargetOfImportSpecifier(node, dontResolveAlias) { + return getExternalModuleMember(node.parent.parent.parent, node, dontResolveAlias); } - function getTargetOfNamespaceExportDeclaration(node) { - return resolveExternalModuleSymbol(node.parent.symbol); + function getTargetOfNamespaceExportDeclaration(node, dontResolveAlias) { + return resolveExternalModuleSymbol(node.parent.symbol, dontResolveAlias); } - function getTargetOfExportSpecifier(node) { + function getTargetOfExportSpecifier(node, dontResolveAlias) { return node.parent.parent.moduleSpecifier ? - getExternalModuleMember(node.parent.parent, node) : - resolveEntityName(node.propertyName || node.name, 107455 | 793064 | 1920); + getExternalModuleMember(node.parent.parent, node, dontResolveAlias) : + resolveEntityName(node.propertyName || node.name, 107455 | 793064 | 1920, false, dontResolveAlias); } - function getTargetOfExportAssignment(node) { - return resolveEntityName(node.expression, 107455 | 793064 | 1920); + function getTargetOfExportAssignment(node, dontResolveAlias) { + return resolveEntityName(node.expression, 107455 | 793064 | 1920, false, dontResolveAlias); } - function getTargetOfAliasDeclaration(node) { + function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { switch (node.kind) { - case 234: - return getTargetOfImportEqualsDeclaration(node); case 236: - return getTargetOfImportClause(node); - case 237: - return getTargetOfNamespaceImport(node); + return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); + case 238: + return getTargetOfImportClause(node, dontRecursivelyResolve); case 239: - return getTargetOfImportSpecifier(node); - case 243: - return getTargetOfExportSpecifier(node); - case 240: - return getTargetOfExportAssignment(node); - case 233: - return getTargetOfNamespaceExportDeclaration(node); + return getTargetOfNamespaceImport(node, dontRecursivelyResolve); + case 241: + return getTargetOfImportSpecifier(node, dontRecursivelyResolve); + case 245: + return getTargetOfExportSpecifier(node, dontRecursivelyResolve); + case 242: + return getTargetOfExportAssignment(node, dontRecursivelyResolve); + case 235: + return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); } } - function resolveSymbol(symbol) { - return symbol && symbol.flags & 8388608 && !(symbol.flags & (107455 | 793064 | 1920)) ? resolveAlias(symbol) : symbol; + function resolveSymbol(symbol, dontResolveAlias) { + var shouldResolve = !dontResolveAlias && symbol && symbol.flags & 8388608 && !(symbol.flags & (107455 | 793064 | 1920)); + return shouldResolve ? resolveAlias(symbol) : symbol; } function resolveAlias(symbol) { ts.Debug.assert((symbol.flags & 8388608) !== 0, "Should only get Alias here."); @@ -21980,10 +24285,10 @@ var ts; links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); ts.Debug.assert(!!node); - if (node.kind === 240) { + if (node.kind === 242) { checkExpressionCached(node.expression); } - else if (node.kind === 243) { + else if (node.kind === 245) { checkExpressionCached(node.propertyName || node.name); } else if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -21995,11 +24300,11 @@ var ts; if (entityName.kind === 70 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 70 || entityName.parent.kind === 141) { + if (entityName.kind === 70 || entityName.parent.kind === 142) { return resolveEntityName(entityName, 1920, false, dontResolveAlias); } else { - ts.Debug.assert(entityName.parent.kind === 234); + ts.Debug.assert(entityName.parent.kind === 236); return resolveEntityName(entityName, 107455 | 793064 | 1920, false, dontResolveAlias); } } @@ -22018,9 +24323,19 @@ var ts; return undefined; } } - else if (name.kind === 141 || name.kind === 177) { - var left = name.kind === 141 ? name.left : name.expression; - var right = name.kind === 141 ? name.right : name.name; + else if (name.kind === 142 || name.kind === 178) { + var left = void 0; + if (name.kind === 142) { + left = name.left; + } + else if (name.kind === 178 && + (name.expression.kind === 184 || ts.isEntityNameExpression(name.expression))) { + left = name.expression; + } + else { + return undefined; + } + var right = name.kind === 142 ? name.right : name.name; var namespace = resolveEntityName(left, 1920, ignoreErrors, false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -22036,10 +24351,15 @@ var ts; return undefined; } } + else if (name.kind === 184) { + return ts.isEntityNameExpression(name.expression) ? + resolveEntityName(name.expression, meaning, ignoreErrors, dontResolveAlias, location) : + undefined; + } else { ts.Debug.fail("Unknown entity name kind."); } - ts.Debug.assert((symbol.flags & 16777216) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((getCheckFlags(symbol) & 1) === 0, "Should never get an instantiated symbol here."); return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); } function resolveExternalModuleName(location, moduleReferenceExpression) { @@ -22047,7 +24367,7 @@ var ts; } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } - if (moduleReferenceExpression.kind !== 9) { + if (moduleReferenceExpression.kind !== 9 && moduleReferenceExpression.kind !== 12) { return; } var moduleReferenceLiteral = moduleReferenceExpression; @@ -22084,11 +24404,10 @@ var ts; } if (!isRelative && resolvedModule && !ts.extensionIsTypeScript(resolvedModule.extension)) { if (isForAugmentation) { - ts.Debug.assert(!!moduleNotFoundError); var diag = ts.Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented; - error(errorNode, diag, moduleName, resolvedModule.resolvedFileName); + error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName); } - else if (compilerOptions.noImplicitAny && moduleNotFoundError) { + else if (noImplicitAny && moduleNotFoundError) { error(errorNode, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedModule.resolvedFileName); } return undefined; @@ -22110,27 +24429,35 @@ var ts; } return undefined; } - function resolveExternalModuleSymbol(moduleSymbol) { - return moduleSymbol && getMergedSymbol(resolveSymbol(moduleSymbol.exports["export="])) || moduleSymbol; + function resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) { + return moduleSymbol && getMergedSymbol(resolveSymbol(moduleSymbol.exports.get("export="), dontResolveAlias)) || moduleSymbol; } - function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression) { - var symbol = resolveExternalModuleSymbol(moduleSymbol); - if (symbol && !(symbol.flags & (1536 | 3))) { + function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression, dontResolveAlias) { + var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); + if (!dontResolveAlias && symbol && !(symbol.flags & (1536 | 3))) { error(moduleReferenceExpression, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); symbol = undefined; } return symbol; } function hasExportAssignmentSymbol(moduleSymbol) { - return moduleSymbol.exports["export="] !== undefined; + return moduleSymbol.exports.get("export=") !== undefined; } function getExportsOfModuleAsArray(moduleSymbol) { return symbolsToArray(getExportsOfModule(moduleSymbol)); } + function getExportsAndPropertiesOfModule(moduleSymbol) { + var exports = getExportsOfModuleAsArray(moduleSymbol); + var exportEquals = resolveExternalModuleSymbol(moduleSymbol); + if (exportEquals !== moduleSymbol) { + ts.addRange(exports, getPropertiesOfType(getTypeOfSymbol(exportEquals))); + } + return exports; + } function tryGetMemberInModuleExports(memberName, moduleSymbol) { var symbolTable = getExportsOfModule(moduleSymbol); if (symbolTable) { - return symbolTable[memberName]; + return symbolTable.get(memberName); } } function getExportsOfSymbol(symbol) { @@ -22141,24 +24468,28 @@ var ts; return links.resolvedExports || (links.resolvedExports = getExportsForModule(moduleSymbol)); } function extendExportSymbols(target, source, lookupTable, exportNode) { - for (var id in source) { - if (id !== "default" && !target[id]) { - target[id] = source[id]; + source && source.forEach(function (sourceSymbol, id) { + if (id === "default") + return; + var targetSymbol = target.get(id); + if (!targetSymbol) { + target.set(id, sourceSymbol); if (lookupTable && exportNode) { - lookupTable[id] = { + lookupTable.set(id, { specifierText: ts.getTextOfNode(exportNode.moduleSpecifier) - }; + }); } } - else if (lookupTable && exportNode && id !== "default" && target[id] && resolveSymbol(target[id]) !== resolveSymbol(source[id])) { - if (!lookupTable[id].exportsWithDuplicate) { - lookupTable[id].exportsWithDuplicate = [exportNode]; + else if (lookupTable && exportNode && targetSymbol && resolveSymbol(targetSymbol) !== resolveSymbol(sourceSymbol)) { + var collisionTracker = lookupTable.get(id); + if (!collisionTracker.exportsWithDuplicate) { + collisionTracker.exportsWithDuplicate = [exportNode]; } else { - lookupTable[id].exportsWithDuplicate.push(exportNode); + collisionTracker.exportsWithDuplicate.push(exportNode); } } - } + }); } function getExportsForModule(moduleSymbol) { var visitedSymbols = []; @@ -22170,26 +24501,26 @@ var ts; } visitedSymbols.push(symbol); var symbols = ts.cloneMap(symbol.exports); - var exportStars = symbol.exports["__export"]; + var exportStars = symbol.exports.get("__export"); if (exportStars) { var nestedSymbols = ts.createMap(); - var lookupTable = ts.createMap(); + var lookupTable_1 = ts.createMap(); for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) { var node = _a[_i]; var resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier); var exportedSymbols = visit(resolvedModule); - extendExportSymbols(nestedSymbols, exportedSymbols, lookupTable, node); + extendExportSymbols(nestedSymbols, exportedSymbols, lookupTable_1, node); } - for (var id in lookupTable) { - var exportsWithDuplicate = lookupTable[id].exportsWithDuplicate; - if (id === "export=" || !(exportsWithDuplicate && exportsWithDuplicate.length) || symbols[id]) { - continue; + lookupTable_1.forEach(function (_a, id) { + var exportsWithDuplicate = _a.exportsWithDuplicate; + if (id === "export=" || !(exportsWithDuplicate && exportsWithDuplicate.length) || symbols.has(id)) { + return; } - for (var _b = 0, exportsWithDuplicate_1 = exportsWithDuplicate; _b < exportsWithDuplicate_1.length; _b++) { - var node = exportsWithDuplicate_1[_b]; - diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity, lookupTable[id].specifierText, id)); + for (var _i = 0, exportsWithDuplicate_1 = exportsWithDuplicate; _i < exportsWithDuplicate_1.length; _i++) { + var node = exportsWithDuplicate_1[_i]; + diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity, lookupTable_1.get(id).specifierText, id)); } - } + }); extendExportSymbols(symbols, nestedSymbols); } return symbols; @@ -22211,22 +24542,13 @@ var ts; : symbol; } function symbolIsValue(symbol) { - if (symbol.flags & 16777216) { - return symbolIsValue(getSymbolLinks(symbol).target); - } - if (symbol.flags & 107455) { - return true; - } - if (symbol.flags & 8388608) { - return (resolveAlias(symbol).flags & 107455) !== 0; - } - return false; + return !!(symbol.flags & 107455 || symbol.flags & 8388608 && resolveAlias(symbol).flags & 107455); } function findConstructorDeclaration(node) { var members = node.members; for (var _i = 0, members_1 = members; _i < members_1.length; _i++) { var member = members_1[_i]; - if (member.kind === 150 && ts.nodeIsPresent(member.body)) { + if (member.kind === 151 && ts.nodeIsPresent(member.body)) { return member; } } @@ -22254,6 +24576,9 @@ var ts; type.symbol = symbol; return type; } + function createTypeofType() { + return getUnionType(ts.convertToArray(typeofEQFacts.keys(), function (s) { return getLiteralTypeForText(32, s); })); + } function isReservedMemberName(name) { return name.charCodeAt(0) === 95 && name.charCodeAt(1) === 95 && @@ -22262,16 +24587,15 @@ var ts; } function getNamedMembers(members) { var result; - for (var id in members) { + members.forEach(function (symbol, id) { if (!isReservedMemberName(id)) { if (!result) result = []; - var symbol = members[id]; if (symbolIsValue(symbol)) { result.push(symbol); } } - } + }); return result || emptyArray; } function setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) { @@ -22290,19 +24614,19 @@ var ts; } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; - for (var location_1 = enclosingDeclaration; location_1; location_1 = location_1.parent) { - if (location_1.locals && !isGlobalSourceFile(location_1)) { - if (result = callback(location_1.locals)) { + for (var location = enclosingDeclaration; location; location = location.parent) { + if (location.locals && !isGlobalSourceFile(location)) { + if (result = callback(location.locals)) { return result; } } - switch (location_1.kind) { - case 261: - if (!ts.isExternalOrCommonJsModule(location_1)) { + switch (location.kind) { + case 264: + if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 230: - if (result = callback(getSymbolOfNode(location_1).exports)) { + case 232: + if (result = callback(getSymbolOfNode(location).exports)) { return result; } break; @@ -22315,6 +24639,16 @@ var ts; } function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing) { function getAccessibleSymbolChainFromSymbolTable(symbols) { + return getAccessibleSymbolChainFromSymbolTableWorker(symbols, []); + } + function getAccessibleSymbolChainFromSymbolTableWorker(symbols, visitedSymbolTables) { + if (ts.contains(visitedSymbolTables, symbols)) { + return undefined; + } + visitedSymbolTables.push(symbols); + var result = trySymbolTable(symbols); + visitedSymbolTables.pop(); + return result; function canQualifySymbol(symbolFromSymbolTable, meaning) { if (!needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning)) { return true; @@ -22328,26 +24662,28 @@ var ts; canQualifySymbol(symbolFromSymbolTable, meaning); } } - if (isAccessible(symbols[symbol.name])) { - return [symbol]; - } - return ts.forEachProperty(symbols, function (symbolFromSymbolTable) { - if (symbolFromSymbolTable.flags & 8388608 - && symbolFromSymbolTable.name !== "export=" - && !ts.getDeclarationOfKind(symbolFromSymbolTable, 243)) { - if (!useOnlyExternalAliasing || - ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { - var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); - if (isAccessible(symbolFromSymbolTable, resolveAlias(symbolFromSymbolTable))) { - return [symbolFromSymbolTable]; - } - var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; - if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { - return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); + function trySymbolTable(symbols) { + if (isAccessible(symbols.get(symbol.name))) { + return [symbol]; + } + return ts.forEachEntry(symbols, function (symbolFromSymbolTable) { + if (symbolFromSymbolTable.flags & 8388608 + && symbolFromSymbolTable.name !== "export=" + && !ts.getDeclarationOfKind(symbolFromSymbolTable, 245)) { + if (!useOnlyExternalAliasing || + ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { + var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); + if (isAccessible(symbolFromSymbolTable, resolveAlias(symbolFromSymbolTable))) { + return [symbolFromSymbolTable]; + } + var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTableWorker(resolvedImportedSymbol.exports, visitedSymbolTables) : undefined; + if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { + return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); + } } } - } - }); + }); + } } if (symbol) { if (!(isPropertyOrMethodDeclarationSymbol(symbol))) { @@ -22358,14 +24694,14 @@ var ts; function needsQualification(symbol, enclosingDeclaration, meaning) { var qualify = false; forEachSymbolTableInScope(enclosingDeclaration, function (symbolTable) { - var symbolFromSymbolTable = symbolTable[symbol.name]; + var symbolFromSymbolTable = symbolTable.get(symbol.name); if (!symbolFromSymbolTable) { return false; } if (symbolFromSymbolTable === symbol) { return true; } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 243)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 245)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -22379,10 +24715,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 147: - case 149: - case 151: + case 148: + case 150: case 152: + case 153: continue; default: return false; @@ -22430,15 +24766,12 @@ var ts; } return { accessibility: 0 }; function getExternalModuleContainer(declaration) { - for (; declaration; declaration = declaration.parent) { - if (hasExternalModuleSymbol(declaration)) { - return getSymbolOfNode(declaration); - } - } + var node = ts.findAncestor(declaration, hasExternalModuleSymbol); + return node && getSymbolOfNode(node); } } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 261 && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 264 && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -22472,11 +24805,11 @@ var ts; } function isEntityNameVisible(entityName, enclosingDeclaration) { var meaning; - if (entityName.parent.kind === 160 || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { + if (entityName.parent.kind === 161 || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { meaning = 107455 | 1048576; } - else if (entityName.kind === 141 || entityName.kind === 177 || - entityName.parent.kind === 234) { + else if (entityName.kind === 142 || entityName.kind === 178 || + entityName.parent.kind === 236) { meaning = 1920; } else { @@ -22524,6 +24857,483 @@ var ts; } return result; } + function createNodeBuilder() { + var context; + return { + typeToTypeNode: function (type, enclosingDeclaration, flags) { + context = createNodeBuilderContext(enclosingDeclaration, flags); + var resultingNode = typeToTypeNodeHelper(type); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + indexInfoToIndexSignatureDeclaration: function (indexInfo, kind, enclosingDeclaration, flags) { + context = createNodeBuilderContext(enclosingDeclaration, flags); + var resultingNode = indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + signatureToSignatureDeclaration: function (signature, kind, enclosingDeclaration, flags) { + context = createNodeBuilderContext(enclosingDeclaration, flags); + var resultingNode = signatureToSignatureDeclarationHelper(signature, kind); + var result = context.encounteredError ? undefined : resultingNode; + return result; + } + }; + function createNodeBuilderContext(enclosingDeclaration, flags) { + return { + enclosingDeclaration: enclosingDeclaration, + flags: flags, + encounteredError: false, + inObjectTypeLiteral: false, + checkAlias: true, + symbolStack: undefined + }; + } + function typeToTypeNodeHelper(type) { + if (!type) { + context.encounteredError = true; + return undefined; + } + if (type.flags & 1) { + return ts.createKeywordTypeNode(118); + } + if (type.flags & 2) { + return ts.createKeywordTypeNode(135); + } + if (type.flags & 4) { + return ts.createKeywordTypeNode(132); + } + if (type.flags & 8) { + return ts.createKeywordTypeNode(121); + } + if (type.flags & 16) { + var name = symbolToName(type.symbol, false); + return ts.createTypeReferenceNode(name, undefined); + } + if (type.flags & (32)) { + return ts.createLiteralTypeNode((ts.createLiteral(type.text))); + } + if (type.flags & (64)) { + return ts.createLiteralTypeNode((ts.createNumericLiteral(type.text))); + } + if (type.flags & 128) { + return type.intrinsicName === "true" ? ts.createTrue() : ts.createFalse(); + } + if (type.flags & 256) { + var name = symbolToName(type.symbol, false); + return ts.createTypeReferenceNode(name, undefined); + } + if (type.flags & 1024) { + return ts.createKeywordTypeNode(104); + } + if (type.flags & 2048) { + return ts.createKeywordTypeNode(138); + } + if (type.flags & 4096) { + return ts.createKeywordTypeNode(94); + } + if (type.flags & 8192) { + return ts.createKeywordTypeNode(129); + } + if (type.flags & 512) { + return ts.createKeywordTypeNode(136); + } + if (type.flags & 16777216) { + return ts.createKeywordTypeNode(133); + } + if (type.flags & 16384 && type.isThisType) { + if (context.inObjectTypeLiteral) { + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowThisInObjectLiteral)) { + context.encounteredError = true; + } + } + return ts.createThis(); + } + var objectFlags = getObjectFlags(type); + if (objectFlags & 4) { + ts.Debug.assert(!!(type.flags & 32768)); + return typeReferenceToTypeNode(type); + } + if (objectFlags & 3) { + ts.Debug.assert(!!(type.flags & 32768)); + var name = symbolToName(type.symbol, false); + return ts.createTypeReferenceNode(name, undefined); + } + if (type.flags & 16384) { + var name = symbolToName(type.symbol, false); + return ts.createTypeReferenceNode(name, undefined); + } + if (context.checkAlias && type.aliasSymbol) { + var name = symbolToName(type.aliasSymbol, false); + var typeArgumentNodes = type.aliasTypeArguments && mapToTypeNodeArray(type.aliasTypeArguments); + return ts.createTypeReferenceNode(name, typeArgumentNodes); + } + context.checkAlias = false; + if (type.flags & 65536) { + var formattedUnionTypes = formatUnionTypes(type.types); + var unionTypeNodes = formattedUnionTypes && mapToTypeNodeArray(formattedUnionTypes); + if (unionTypeNodes && unionTypeNodes.length > 0) { + return ts.createUnionOrIntersectionTypeNode(165, unionTypeNodes); + } + else { + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowEmptyUnionOrIntersection)) { + context.encounteredError = true; + } + return undefined; + } + } + if (type.flags & 131072) { + return ts.createUnionOrIntersectionTypeNode(166, mapToTypeNodeArray(type.types)); + } + if (objectFlags & (16 | 32)) { + ts.Debug.assert(!!(type.flags & 32768)); + return createAnonymousTypeNode(type); + } + if (type.flags & 262144) { + var indexedType = type.type; + var indexTypeNode = typeToTypeNodeHelper(indexedType); + return ts.createTypeOperatorNode(indexTypeNode); + } + if (type.flags & 524288) { + var objectTypeNode = typeToTypeNodeHelper(type.objectType); + var indexTypeNode = typeToTypeNodeHelper(type.indexType); + return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); + } + ts.Debug.fail("Should be unreachable."); + function mapToTypeNodeArray(types) { + var result = []; + for (var _i = 0, types_1 = types; _i < types_1.length; _i++) { + var type_1 = types_1[_i]; + var typeNode = typeToTypeNodeHelper(type_1); + if (typeNode) { + result.push(typeNode); + } + } + return result; + } + function createMappedTypeNodeFromType(type) { + ts.Debug.assert(!!(type.flags & 32768)); + var typeParameter = getTypeParameterFromMappedType(type); + var typeParameterNode = typeParameterToDeclaration(typeParameter); + var templateType = getTemplateTypeFromMappedType(type); + var templateTypeNode = typeToTypeNodeHelper(templateType); + var readonlyToken = type.declaration && type.declaration.readonlyToken ? ts.createToken(130) : undefined; + var questionToken = type.declaration && type.declaration.questionToken ? ts.createToken(54) : undefined; + return ts.createMappedTypeNode(readonlyToken, typeParameterNode, questionToken, templateTypeNode); + } + function createAnonymousTypeNode(type) { + var symbol = type.symbol; + if (symbol) { + if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) || + symbol.flags & (384 | 512) || + shouldWriteTypeOfFunctionSymbol()) { + return createTypeQueryNodeFromSymbol(symbol); + } + else if (ts.contains(context.symbolStack, symbol)) { + var typeAlias = getTypeAliasForTypeLiteral(type); + if (typeAlias) { + var entityName = symbolToName(typeAlias, false); + return ts.createTypeReferenceNode(entityName, undefined); + } + else { + return ts.createKeywordTypeNode(118); + } + } + else { + if (!context.symbolStack) { + context.symbolStack = []; + } + context.symbolStack.push(symbol); + var result = createTypeNodeFromObjectType(type); + context.symbolStack.pop(); + return result; + } + } + else { + return createTypeNodeFromObjectType(type); + } + function shouldWriteTypeOfFunctionSymbol() { + var isStaticMethodSymbol = !!(symbol.flags & 8192 && + ts.forEach(symbol.declarations, function (declaration) { return ts.getModifierFlags(declaration) & 32; })); + var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && + (symbol.parent || + ts.forEach(symbol.declarations, function (declaration) { + return declaration.parent.kind === 264 || declaration.parent.kind === 233; + })); + if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { + return ts.contains(context.symbolStack, symbol); + } + } + } + function createTypeNodeFromObjectType(type) { + if (type.objectFlags & 32) { + if (getConstraintTypeFromMappedType(type).flags & (16384 | 262144)) { + return createMappedTypeNodeFromType(type); + } + } + var resolved = resolveStructuredTypeMembers(type); + if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { + if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { + return ts.createTypeLiteralNode(undefined); + } + if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { + var signature = resolved.callSignatures[0]; + return signatureToSignatureDeclarationHelper(signature, 159); + } + if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { + var signature = resolved.constructSignatures[0]; + return signatureToSignatureDeclarationHelper(signature, 160); + } + } + var saveInObjectTypeLiteral = context.inObjectTypeLiteral; + context.inObjectTypeLiteral = true; + var members = createTypeNodesFromResolvedType(resolved); + context.inObjectTypeLiteral = saveInObjectTypeLiteral; + return ts.createTypeLiteralNode(members); + } + function createTypeQueryNodeFromSymbol(symbol) { + var entityName = symbolToName(symbol, false); + return ts.createTypeQueryNode(entityName); + } + function typeReferenceToTypeNode(type) { + var typeArguments = type.typeArguments || emptyArray; + if (type.target === globalArrayType) { + var elementType = typeToTypeNodeHelper(typeArguments[0]); + return ts.createArrayTypeNode(elementType); + } + else if (type.target.objectFlags & 8) { + if (typeArguments.length > 0) { + var tupleConstituentNodes = mapToTypeNodeArray(typeArguments.slice(0, getTypeReferenceArity(type))); + if (tupleConstituentNodes && tupleConstituentNodes.length > 0) { + return ts.createTupleTypeNode(tupleConstituentNodes); + } + } + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowEmptyTuple)) { + context.encounteredError = true; + } + return undefined; + } + else { + var outerTypeParameters = type.target.outerTypeParameters; + var i = 0; + var qualifiedName = undefined; + if (outerTypeParameters) { + var length_1 = outerTypeParameters.length; + while (i < length_1) { + var start = i; + var parent = getParentSymbolOfTypeParameter(outerTypeParameters[i]); + do { + i++; + } while (i < length_1 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent); + if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { + var qualifiedNamePart = symbolToName(parent, true); + if (!qualifiedName) { + qualifiedName = ts.createQualifiedName(qualifiedNamePart, undefined); + } + else { + ts.Debug.assert(!qualifiedName.right); + qualifiedName.right = qualifiedNamePart; + qualifiedName = ts.createQualifiedName(qualifiedName, undefined); + } + } + } + } + var entityName = undefined; + var nameIdentifier = symbolToName(type.symbol, true); + if (qualifiedName) { + ts.Debug.assert(!qualifiedName.right); + qualifiedName.right = nameIdentifier; + entityName = qualifiedName; + } + else { + entityName = nameIdentifier; + } + var typeParameterCount = (type.target.typeParameters || emptyArray).length; + var typeArgumentNodes = ts.some(typeArguments) ? mapToTypeNodeArray(typeArguments.slice(i, typeParameterCount - i)) : undefined; + return ts.createTypeReferenceNode(entityName, typeArgumentNodes); + } + } + function createTypeNodesFromResolvedType(resolvedType) { + var typeElements = []; + for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { + var signature = _a[_i]; + typeElements.push(signatureToSignatureDeclarationHelper(signature, 154)); + } + for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { + var signature = _c[_b]; + typeElements.push(signatureToSignatureDeclarationHelper(signature, 155)); + } + if (resolvedType.stringIndexInfo) { + typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.stringIndexInfo, 0)); + } + if (resolvedType.numberIndexInfo) { + typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.numberIndexInfo, 1)); + } + var properties = resolvedType.properties; + if (!properties) { + return typeElements; + } + for (var _d = 0, properties_2 = properties; _d < properties_2.length; _d++) { + var propertySymbol = properties_2[_d]; + var propertyType = getTypeOfSymbol(propertySymbol); + var oldDeclaration = propertySymbol.declarations && propertySymbol.declarations[0]; + if (!oldDeclaration) { + return; + } + var propertyName = oldDeclaration.name; + var optionalToken = propertySymbol.flags & 67108864 ? ts.createToken(54) : undefined; + if (propertySymbol.flags & (16 | 8192) && !getPropertiesOfObjectType(propertyType).length) { + var signatures = getSignaturesOfType(propertyType, 0); + for (var _e = 0, signatures_1 = signatures; _e < signatures_1.length; _e++) { + var signature = signatures_1[_e]; + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 149); + methodDeclaration.name = propertyName; + methodDeclaration.questionToken = optionalToken; + typeElements.push(methodDeclaration); + } + } + else { + var propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType) : ts.createKeywordTypeNode(118); + typeElements.push(ts.createPropertySignature(propertyName, optionalToken, propertyTypeNode, undefined)); + } + } + return typeElements.length ? typeElements : undefined; + } + } + function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind) { + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 ? 135 : 132); + var name = ts.getNameFromIndexInfo(indexInfo); + var indexingParameter = ts.createParameter(undefined, undefined, undefined, name, undefined, indexerTypeNode, undefined); + var typeNode = typeToTypeNodeHelper(indexInfo.type); + return ts.createIndexSignatureDeclaration(undefined, indexInfo.isReadonly ? [ts.createToken(130)] : undefined, [indexingParameter], typeNode); + } + function signatureToSignatureDeclarationHelper(signature, kind) { + var typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter); }); + var parameters = signature.parameters.map(function (parameter) { return symbolToParameterDeclaration(parameter); }); + var returnTypeNode; + if (signature.typePredicate) { + var typePredicate = signature.typePredicate; + var parameterName = typePredicate.kind === 1 ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(); + var typeNode = typeToTypeNodeHelper(typePredicate.type); + returnTypeNode = ts.createTypePredicateNode(parameterName, typeNode); + } + else { + var returnType = getReturnTypeOfSignature(signature); + returnTypeNode = returnType && typeToTypeNodeHelper(returnType); + } + var returnTypeNodeExceptAny = returnTypeNode && returnTypeNode.kind !== 118 ? returnTypeNode : undefined; + return ts.createSignatureDeclaration(kind, typeParameters, parameters, returnTypeNodeExceptAny); + } + function typeParameterToDeclaration(type) { + var constraint = getConstraintFromTypeParameter(type); + var constraintNode = constraint && typeToTypeNodeHelper(constraint); + var defaultParameter = getDefaultFromTypeParameter(type); + var defaultParameterNode = defaultParameter && typeToTypeNodeHelper(defaultParameter); + var name = symbolToName(type.symbol, true); + return ts.createTypeParameterDeclaration(name, constraintNode, defaultParameterNode); + } + function symbolToParameterDeclaration(parameterSymbol) { + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 145); + var parameterType = getTypeOfSymbol(parameterSymbol); + var parameterTypeNode = typeToTypeNodeHelper(parameterType); + var parameterNode = ts.createParameter(parameterDeclaration.decorators, parameterDeclaration.modifiers, parameterDeclaration.dotDotDotToken && ts.createToken(23), ts.getSynthesizedClone(parameterDeclaration.name), parameterDeclaration.questionToken && ts.createToken(54), parameterTypeNode, parameterDeclaration.initializer); + return parameterNode; + } + function symbolToName(symbol, expectsIdentifier) { + var chain; + var isTypeParameter = symbol.flags & 262144; + if (!isTypeParameter && context.enclosingDeclaration) { + chain = getSymbolChain(symbol, 0, true); + ts.Debug.assert(chain && chain.length > 0); + } + else { + chain = [symbol]; + } + if (expectsIdentifier && chain.length !== 1 + && !context.encounteredError + && !(context.flags & ts.NodeBuilderFlags.allowQualifedNameInPlaceOfIdentifier)) { + context.encounteredError = true; + } + return createEntityNameFromSymbolChain(chain, chain.length - 1); + function createEntityNameFromSymbolChain(chain, index) { + ts.Debug.assert(chain && 0 <= index && index < chain.length); + var symbol = chain[index]; + var typeParameterString = ""; + if (index > 0) { + var parentSymbol = chain[index - 1]; + var typeParameters = void 0; + if (getCheckFlags(symbol) & 1) { + typeParameters = getTypeParametersOfClassOrInterface(parentSymbol); + } + else { + var targetSymbol = getTargetSymbol(parentSymbol); + if (targetSymbol.flags & (32 | 64 | 524288)) { + typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); + } + } + if (typeParameters && typeParameters.length > 0) { + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowTypeParameterInQualifiedName)) { + context.encounteredError = true; + } + var writer = ts.getSingleLineStringWriter(); + var displayBuilder = getSymbolDisplayBuilder(); + displayBuilder.buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, context.enclosingDeclaration, 0); + typeParameterString = writer.string(); + ts.releaseStringWriter(writer); + } + } + var symbolName = getNameOfSymbol(symbol); + var symbolNameWithTypeParameters = typeParameterString.length > 0 ? symbolName + "<" + typeParameterString + ">" : symbolName; + var identifier = ts.createIdentifier(symbolNameWithTypeParameters); + return index > 0 ? ts.createQualifiedName(createEntityNameFromSymbolChain(chain, index - 1), identifier) : identifier; + } + function getSymbolChain(symbol, meaning, endOfChain) { + var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, false); + var parentSymbol; + if (!accessibleSymbolChain || + needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { + var parent = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); + if (parent) { + var parentChain = getSymbolChain(parent, getQualifiedLeftMeaning(meaning), false); + if (parentChain) { + parentSymbol = parent; + accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [symbol]); + } + } + } + if (accessibleSymbolChain) { + return accessibleSymbolChain; + } + if (endOfChain || + !(!parentSymbol && ts.forEach(symbol.declarations, hasExternalModuleSymbol)) && + !(symbol.flags & (2048 | 4096))) { + return [symbol]; + } + } + function getNameOfSymbol(symbol) { + var declaration = ts.firstOrUndefined(symbol.declarations); + if (declaration) { + if (declaration.name) { + return ts.declarationNameToString(declaration.name); + } + if (declaration.parent && declaration.parent.kind === 225) { + return ts.declarationNameToString(declaration.parent.name); + } + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowAnonymousIdentifier)) { + context.encounteredError = true; + } + switch (declaration.kind) { + case 198: + return "(Anonymous class)"; + case 185: + case 186: + return "(Anonymous function)"; + } + } + return symbol.name; + } + } + } function typePredicateToString(typePredicate, enclosingDeclaration, flags) { var writer = ts.getSingleLineStringWriter(); getSymbolDisplayBuilder().buildTypePredicateDisplay(typePredicate, writer, enclosingDeclaration, flags); @@ -22567,11 +25377,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048) { - var node = type.symbol.declarations[0].parent; - while (node.kind === 166) { - node = node.parent; - } - if (node.kind === 228) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 167; }); + if (node.kind === 230) { return getSymbolOfNode(node); } } @@ -22579,29 +25386,32 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 231 && + node.parent.kind === 233 && ts.isExternalModuleAugmentation(node.parent.parent); } function literalTypeToString(type) { return type.flags & 32 ? "\"" + ts.escapeString(type.text) + "\"" : type.text; } - function getSymbolDisplayBuilder() { - function getNameOfSymbol(symbol) { - if (symbol.declarations && symbol.declarations.length) { - var declaration = symbol.declarations[0]; - if (declaration.name) { - return ts.declarationNameToString(declaration.name); - } - switch (declaration.kind) { - case 197: - return "(Anonymous class)"; - case 184: - case 185: - return "(Anonymous function)"; - } + function getNameOfSymbol(symbol) { + if (symbol.declarations && symbol.declarations.length) { + var declaration = symbol.declarations[0]; + if (declaration.name) { + return ts.declarationNameToString(declaration.name); + } + if (declaration.parent && declaration.parent.kind === 225) { + return ts.declarationNameToString(declaration.parent.name); + } + switch (declaration.kind) { + case 198: + return "(Anonymous class)"; + case 185: + case 186: + return "(Anonymous function)"; } - return symbol.name; } + return symbol.name; + } + function getSymbolDisplayBuilder() { function appendSymbolNameOnly(symbol, writer) { writer.writeSymbol(getNameOfSymbol(symbol), symbol); } @@ -22629,7 +25439,7 @@ var ts; function appendParentTypeArgumentsAndSymbolName(symbol) { if (parentSymbol) { if (flags & 1) { - if (symbol.flags & 16777216) { + if (getCheckFlags(symbol) & 1) { buildDisplayForTypeArgumentsAndDelimiters(getTypeParametersOfClassOrInterface(parentSymbol), symbol.mapper, writer, enclosingDeclaration); } else { @@ -22648,9 +25458,9 @@ var ts; var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & 2)); if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { - var parent_5 = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); - if (parent_5) { - walkSymbol(parent_5, getQualifiedLeftMeaning(meaning), false); + var parent = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); + if (parent) { + walkSymbol(parent, getQualifiedLeftMeaning(meaning), false); } } if (accessibleSymbolChain) { @@ -22680,7 +25490,7 @@ var ts; return writeType(type, globalFlags); function writeType(type, flags) { var nextFlags = flags & ~512; - if (type.flags & 16015) { + if (type.flags & 16793231) { writer.writeKeyword(!(globalFlags & 16) && isTypeAny(type) ? "any" : type.intrinsicName); @@ -22705,7 +25515,7 @@ var ts; else if (!(flags & 512) && type.aliasSymbol && isSymbolAccessible(type.aliasSymbol, enclosingDeclaration, 793064, false).accessibility === 0) { var typeArguments = type.aliasTypeArguments; - writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, typeArguments ? typeArguments.length : 0, nextFlags); + writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, ts.length(typeArguments), nextFlags); } else if (type.flags & 196608) { writeUnionOrIntersectionType(type, nextFlags); @@ -22780,15 +25590,15 @@ var ts; var outerTypeParameters = type.target.outerTypeParameters; var i = 0; if (outerTypeParameters) { - var length_1 = outerTypeParameters.length; - while (i < length_1) { + var length_2 = outerTypeParameters.length; + while (i < length_2) { var start = i; - var parent_6 = getParentSymbolOfTypeParameter(outerTypeParameters[i]); + var parent = getParentSymbolOfTypeParameter(outerTypeParameters[i]); do { i++; - } while (i < length_1 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent_6); + } while (i < length_2 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent); if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { - writeSymbolTypeReference(parent_6, typeArguments, start, i, flags); + writeSymbolTypeReference(parent, typeArguments, start, i, flags); writePunctuation(writer, 22); } } @@ -22814,7 +25624,8 @@ var ts; function writeAnonymousType(type, flags) { var symbol = type.symbol; if (symbol) { - if (symbol.flags & (32 | 384 | 512)) { + if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) || + symbol.flags & (384 | 512)) { writeTypeOfSymbol(type, flags); } else if (shouldWriteTypeOfFunctionSymbol()) { @@ -22847,7 +25658,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && (symbol.parent || ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 261 || declaration.parent.kind === 231; + return declaration.parent.kind === 264 || declaration.parent.kind === 233; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 2) || @@ -22860,32 +25671,13 @@ var ts; writeSpace(writer); buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455, 0, typeFormatFlags); } - function writeIndexSignature(info, keyword) { - if (info) { - if (info.isReadonly) { - writeKeyword(writer, 130); - writeSpace(writer); - } - writePunctuation(writer, 20); - writer.writeParameter(info.declaration ? ts.declarationNameToString(info.declaration.parameters[0].name) : "x"); - writePunctuation(writer, 55); - writeSpace(writer); - writeKeyword(writer, keyword); - writePunctuation(writer, 21); - writePunctuation(writer, 55); - writeSpace(writer); - writeType(info.type, 0); - writePunctuation(writer, 24); - writer.writeLine(); - } - } function writePropertyWithModifiers(prop) { if (isReadonlySymbol(prop)) { writeKeyword(writer, 130); writeSpace(writer); } buildSymbolDisplay(prop, writer); - if (prop.flags & 536870912) { + if (prop.flags & 67108864) { writePunctuation(writer, 54); } } @@ -22961,15 +25753,15 @@ var ts; writePunctuation(writer, 24); writer.writeLine(); } - writeIndexSignature(resolved.stringIndexInfo, 134); - writeIndexSignature(resolved.numberIndexInfo, 132); + buildIndexSignatureDisplay(resolved.stringIndexInfo, writer, 0, enclosingDeclaration, globalFlags, symbolStack); + buildIndexSignatureDisplay(resolved.numberIndexInfo, writer, 1, enclosingDeclaration, globalFlags, symbolStack); for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) { var p = _e[_d]; var t = getTypeOfSymbol(p); if (p.flags & (16 | 8192) && !getPropertiesOfObjectType(t).length) { var signatures = getSignaturesOfType(t, 0); - for (var _f = 0, signatures_1 = signatures; _f < signatures_1.length; _f++) { - var signature = signatures_1[_f]; + for (var _f = 0, signatures_2 = signatures; _f < signatures_2.length; _f++) { + var signature = signatures_2[_f]; writePropertyWithModifiers(p); buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, undefined, symbolStack); writePunctuation(writer, 24); @@ -23028,32 +25820,43 @@ var ts; writeSpace(writer); buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, symbolStack); } + var defaultType = getDefaultFromTypeParameter(tp); + if (defaultType) { + writeSpace(writer); + writePunctuation(writer, 57); + writeSpace(writer); + buildTypeDisplay(defaultType, writer, enclosingDeclaration, flags, symbolStack); + } } function buildParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack) { var parameterNode = p.valueDeclaration; - if (ts.isRestParameter(parameterNode)) { + if (parameterNode ? ts.isRestParameter(parameterNode) : isTransientSymbol(p) && p.isRestParameter) { writePunctuation(writer, 23); } - if (ts.isBindingPattern(parameterNode.name)) { + if (parameterNode && ts.isBindingPattern(parameterNode.name)) { buildBindingPatternDisplay(parameterNode.name, writer, enclosingDeclaration, flags, symbolStack); } else { appendSymbolNameOnly(p, writer); } - if (isOptionalParameter(parameterNode)) { + if (parameterNode && isOptionalParameter(parameterNode)) { writePunctuation(writer, 54); } writePunctuation(writer, 55); writeSpace(writer); - buildTypeDisplay(getTypeOfSymbol(p), writer, enclosingDeclaration, flags, symbolStack); + var type = getTypeOfSymbol(p); + if (parameterNode && isRequiredInitializedParameter(parameterNode)) { + type = includeFalsyTypes(type, 2048); + } + buildTypeDisplay(type, writer, enclosingDeclaration, flags, symbolStack); } function buildBindingPatternDisplay(bindingPattern, writer, enclosingDeclaration, flags, symbolStack) { - if (bindingPattern.kind === 172) { + if (bindingPattern.kind === 173) { writePunctuation(writer, 16); buildDisplayForCommaSeparatedList(bindingPattern.elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); }); writePunctuation(writer, 17); } - else if (bindingPattern.kind === 173) { + else if (bindingPattern.kind === 174) { writePunctuation(writer, 20); var elements = bindingPattern.elements; buildDisplayForCommaSeparatedList(elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); }); @@ -23067,9 +25870,9 @@ var ts; if (ts.isOmittedExpression(bindingElement)) { return; } - ts.Debug.assert(bindingElement.kind === 174); + ts.Debug.assert(bindingElement.kind === 175); if (bindingElement.propertyName) { - writer.writeSymbol(ts.getTextOfNode(bindingElement.propertyName), bindingElement.symbol); + writer.writeProperty(ts.getTextOfNode(bindingElement.propertyName)); writePunctuation(writer, 55); writeSpace(writer); } @@ -23141,6 +25944,10 @@ var ts; buildTypeDisplay(predicate.type, writer, enclosingDeclaration, flags, symbolStack); } function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) { + var returnType = getReturnTypeOfSignature(signature); + if (flags & 2048 && isTypeAny(returnType)) { + return; + } if (flags & 8) { writeSpace(writer); writePunctuation(writer, 35); @@ -23153,7 +25960,6 @@ var ts; buildTypePredicateDisplay(signature.typePredicate, writer, enclosingDeclaration, flags, symbolStack); } else { - var returnType = getReturnTypeOfSignature(signature); buildTypeDisplay(returnType, writer, enclosingDeclaration, flags, symbolStack); } } @@ -23171,6 +25977,32 @@ var ts; buildDisplayForParametersAndDelimiters(signature.thisParameter, signature.parameters, writer, enclosingDeclaration, flags, symbolStack); buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack); } + function buildIndexSignatureDisplay(info, writer, kind, enclosingDeclaration, globalFlags, symbolStack) { + if (info) { + if (info.isReadonly) { + writeKeyword(writer, 130); + writeSpace(writer); + } + writePunctuation(writer, 20); + writer.writeParameter(info.declaration ? ts.declarationNameToString(info.declaration.parameters[0].name) : "x"); + writePunctuation(writer, 55); + writeSpace(writer); + switch (kind) { + case 1: + writeKeyword(writer, 132); + break; + case 0: + writeKeyword(writer, 135); + break; + } + writePunctuation(writer, 21); + writePunctuation(writer, 55); + writeSpace(writer); + buildTypeDisplay(info.type, writer, enclosingDeclaration, globalFlags, symbolStack); + writePunctuation(writer, 24); + writer.writeLine(); + } + } return _displayBuilder || (_displayBuilder = { buildSymbolDisplay: buildSymbolDisplay, buildTypeDisplay: buildTypeDisplay, @@ -23181,6 +26013,7 @@ var ts; buildDisplayForTypeParametersAndDelimiters: buildDisplayForTypeParametersAndDelimiters, buildTypeParameterDisplayFromSymbol: buildTypeParameterDisplayFromSymbol, buildSignatureDisplay: buildSignatureDisplay, + buildIndexSignatureDisplay: buildIndexSignatureDisplay, buildReturnTypeDisplay: buildReturnTypeDisplay }); } @@ -23195,63 +26028,63 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 174: + case 175: return isDeclarationVisible(node.parent.parent); - case 223: + case 225: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { return false; } - case 230: - case 226: - case 227: + case 232: case 228: - case 225: case 229: - case 234: + case 230: + case 227: + case 231: + case 236: if (ts.isExternalModuleAugmentation(node)) { return true; } - var parent_7 = getDeclarationContainer(node); + var parent = getDeclarationContainer(node); if (!(ts.getCombinedModifierFlags(node) & 1) && - !(node.kind !== 234 && parent_7.kind !== 261 && ts.isInAmbientContext(parent_7))) { - return isGlobalSourceFile(parent_7); + !(node.kind !== 236 && parent.kind !== 264 && ts.isInAmbientContext(parent))) { + return isGlobalSourceFile(parent); } - return isDeclarationVisible(parent_7); - case 147: - case 146: - case 151: - case 152: - case 149: + return isDeclarationVisible(parent); case 148: + case 147: + case 152: + case 153: + case 150: + case 149: if (ts.getModifierFlags(node) & (8 | 16)) { return false; } - case 150: - case 154: - case 153: + case 151: case 155: - case 144: - case 231: - case 158: + case 154: + case 156: + case 145: + case 233: case 159: - case 161: - case 157: + case 160: case 162: + case 158: case 163: case 164: case 165: case 166: + case 167: return isDeclarationVisible(node.parent); - case 236: - case 237: + case 238: case 239: + case 241: return false; - case 143: - case 261: - case 233: + case 144: + case 264: + case 235: return true; - case 240: + case 242: return false; default: return false; @@ -23260,10 +26093,10 @@ var ts; } function collectLinkedAliases(node) { var exportSymbol; - if (node.parent && node.parent.kind === 240) { + if (node.parent && node.parent.kind === 242) { exportSymbol = resolveName(node.parent, node.text, 107455 | 793064 | 1920 | 8388608, ts.Diagnostics.Cannot_find_name_0, node); } - else if (node.parent.kind === 243) { + else if (node.parent.kind === 245) { var exportSpecifier = node.parent; exportSymbol = exportSpecifier.parent.parent.moduleSpecifier ? getExternalModuleMember(exportSpecifier.parent.parent, exportSpecifier) : @@ -23295,8 +26128,8 @@ var ts; function pushTypeResolution(target, propertyName) { var resolutionCycleStartIndex = findResolutionCycleStartIndex(target, propertyName); if (resolutionCycleStartIndex >= 0) { - var length_2 = resolutionTargets.length; - for (var i = resolutionCycleStartIndex; i < length_2; i++) { + var length_3 = resolutionTargets.length; + for (var i = resolutionCycleStartIndex; i < length_3; i++) { resolutionResults[i] = false; } return false; @@ -23338,21 +26171,20 @@ var ts; return resolutionResults.pop(); } function getDeclarationContainer(node) { - node = ts.getRootDeclaration(node); - while (node) { + node = ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 223: - case 224: + case 225: + case 226: + case 241: + case 240: case 239: case 238: - case 237: - case 236: - node = node.parent; - break; + return false; default: - return node.parent; + return true; } - } + }); + return node && node.parent; } function getTypeOfPrototypeProperty(prototype) { var classType = getDeclaredTypeOfSymbol(getParentOfSymbol(prototype)); @@ -23365,32 +26197,34 @@ var ts; function isTypeAny(type) { return type && (type.flags & 1) !== 0; } - function isTypeNever(type) { - return type && (type.flags & 8192) !== 0; - } function getTypeForBindingElementParent(node) { var symbol = getSymbolOfNode(node); return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, false); } function isComputedNonLiteralName(name) { - return name.kind === 142 && !ts.isStringOrNumericLiteral(name.expression); + return name.kind === 143 && !ts.isStringOrNumericLiteral(name.expression); } function getRestType(source, properties, symbol) { - ts.Debug.assert(!!(source.flags & 32768), "Rest types only support object types right now."); + source = filterType(source, function (t) { return !(t.flags & 6144); }); + if (source.flags & 8192) { + return emptyObjectType; + } + if (source.flags & 65536) { + return mapType(source, function (t) { return getRestType(t, properties, symbol); }); + } var members = ts.createMap(); var names = ts.createMap(); - for (var _i = 0, properties_2 = properties; _i < properties_2.length; _i++) { - var name_19 = properties_2[_i]; - names[ts.getTextOfPropertyName(name_19)] = true; + for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { + var name = properties_3[_i]; + names.set(ts.getTextOfPropertyName(name), true); } for (var _a = 0, _b = getPropertiesOfType(source); _a < _b.length; _a++) { var prop = _b[_a]; - var inNamesToRemove = prop.name in names; + var inNamesToRemove = names.has(prop.name); var isPrivate = getDeclarationModifierFlagsFromSymbol(prop) & (8 | 16); - var isMethod = prop.flags & 8192; var isSetOnlyAccessor = prop.flags & 65536 && !(prop.flags & 32768); - if (!inNamesToRemove && !isPrivate && !isMethod && !isSetOnlyAccessor) { - members[prop.name] = prop; + if (!inNamesToRemove && !isPrivate && !isClassMethod(prop) && !isSetOnlyAccessor) { + members.set(prop.name, prop); } } var stringIndexInfo = getIndexInfoOfType(source, 0); @@ -23410,9 +26244,9 @@ var ts; return parentType; } var type; - if (pattern.kind === 172) { + if (pattern.kind === 173) { if (declaration.dotDotDotToken) { - if (!(parentType.flags & 32768)) { + if (!isValidSpreadType(parentType)) { error(declaration, ts.Diagnostics.Rest_types_may_only_be_created_from_object_types); return unknownType; } @@ -23426,25 +26260,25 @@ var ts; type = getRestType(parentType, literalMembers, declaration.symbol); } else { - var name_20 = declaration.propertyName || declaration.name; - if (isComputedNonLiteralName(name_20)) { + var name = declaration.propertyName || declaration.name; + if (isComputedNonLiteralName(name)) { return anyType; } if (declaration.initializer) { getContextualType(declaration.initializer); } - var text = ts.getTextOfPropertyName(name_20); + var text = ts.getTextOfPropertyName(name); type = getTypeOfPropertyOfType(parentType, text) || isNumericLiteralName(text) && getIndexTypeOfType(parentType, 1) || getIndexTypeOfType(parentType, 0); if (!type) { - error(name_20, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_20)); + error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name)); return unknownType; } } } else { - var elementType = checkIteratedTypeOrElementType(parentType, pattern, false); + var elementType = checkIteratedTypeOrElementType(parentType, pattern, false, false); if (declaration.dotDotDotToken) { type = createArrayType(elementType); } @@ -23471,7 +26305,7 @@ var ts; getUnionType([type, checkExpressionCached(declaration.initializer)], true) : type; } - function getTypeForVariableLikeDeclarationFromJSDocComment(declaration) { + function getTypeForDeclarationFromJSDocComment(declaration) { var jsdocType = ts.getJSDocType(declaration); if (jsdocType) { return getTypeFromTypeNode(jsdocType); @@ -23484,33 +26318,35 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 175 && expr.elements.length === 0; + return expr.kind === 176 && expr.elements.length === 0; } function addOptionality(type, optional) { return strictNullChecks && optional ? includeFalsyTypes(type, 2048) : type; } function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { - if (declaration.flags & 2097152) { - var type = getTypeForVariableLikeDeclarationFromJSDocComment(declaration); + if (declaration.flags & 65536) { + var type = getTypeForDeclarationFromJSDocComment(declaration); if (type && type !== unknownType) { return type; } } - if (declaration.parent.parent.kind === 212) { + if (declaration.parent.parent.kind === 214) { var indexType = getIndexType(checkNonNullExpression(declaration.parent.parent.expression)); return indexType.flags & (16384 | 262144) ? indexType : stringType; } - if (declaration.parent.parent.kind === 213) { - return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType; + if (declaration.parent.parent.kind === 215) { + var forOfStatement = declaration.parent.parent; + return checkRightHandSideOfForOf(forOfStatement.expression, forOfStatement.awaitModifier) || anyType; } if (ts.isBindingPattern(declaration.parent)) { return getTypeForBindingElement(declaration); } if (declaration.type) { - return addOptionality(getTypeFromTypeNode(declaration.type), declaration.questionToken && includeOptionality); + var declaredType = getTypeFromTypeNode(declaration.type); + return addOptionality(declaredType, declaration.questionToken && includeOptionality); } - if ((compilerOptions.noImplicitAny || declaration.flags & 2097152) && - declaration.kind === 223 && !ts.isBindingPattern(declaration.name) && + if ((noImplicitAny || declaration.flags & 65536) && + declaration.kind === 225 && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1) && !ts.isInAmbientContext(declaration)) { if (!(ts.getCombinedNodeFlags(declaration) & 2) && (!declaration.initializer || isNullOrUndefined(declaration.initializer))) { return autoType; @@ -23519,10 +26355,10 @@ var ts; return autoArrayType; } } - if (declaration.kind === 144) { + if (declaration.kind === 145) { var func = declaration.parent; - if (func.kind === 152 && !ts.hasDynamicName(func)) { - var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 151); + if (func.kind === 153 && !ts.hasDynamicName(func)) { + var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 152); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -23548,7 +26384,10 @@ var ts; var type = checkDeclarationInitializer(declaration); return addOptionality(type, declaration.questionToken && includeOptionality); } - if (declaration.kind === 258) { + if (ts.isJsxAttribute(declaration)) { + return trueType; + } + if (declaration.kind === 261) { return checkIdentifier(declaration.name); } if (ts.isBindingPattern(declaration.name)) { @@ -23556,6 +26395,37 @@ var ts; } return undefined; } + function getWidenedTypeFromJSSpecialPropertyDeclarations(symbol) { + var types = []; + var definedInConstructor = false; + var definedInMethod = false; + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + var expression = declaration.kind === 193 ? declaration : + declaration.kind === 178 ? ts.getAncestor(declaration, 193) : + undefined; + if (!expression) { + return unknownType; + } + if (ts.isPropertyAccessExpression(expression.left) && expression.left.expression.kind === 98) { + if (ts.getThisContainer(expression, false).kind === 151) { + definedInConstructor = true; + } + else { + definedInMethod = true; + } + } + if (expression.flags & 65536) { + var type = getTypeForDeclarationFromJSDocComment(expression.parent); + if (type && type !== unknownType) { + types.push(getWidenedType(type)); + continue; + } + } + types.push(getWidenedLiteralType(checkExpressionCached(expression.right))); + } + return getWidenedType(addOptionality(getUnionType(types, true), definedInMethod && !definedInConstructor)); + } function getTypeFromBindingElement(element, includePatternInType, reportErrors) { if (element.initializer) { return checkDeclarationInitializer(element); @@ -23563,28 +26433,33 @@ var ts; if (ts.isBindingPattern(element.name)) { return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors); } - if (reportErrors && compilerOptions.noImplicitAny && !declarationBelongsToPrivateAmbientMember(element)) { + if (reportErrors && noImplicitAny && !declarationBelongsToPrivateAmbientMember(element)) { reportImplicitAnyError(element, anyType); } return anyType; } function getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) { var members = ts.createMap(); + var stringIndexInfo; var hasComputedProperties = false; ts.forEach(pattern.elements, function (e) { var name = e.propertyName || e.name; - if (isComputedNonLiteralName(name) || e.dotDotDotToken) { + if (isComputedNonLiteralName(name)) { hasComputedProperties = true; return; } + if (e.dotDotDotToken) { + stringIndexInfo = createIndexInfo(anyType, false); + return; + } var text = ts.getTextOfPropertyName(name); - var flags = 4 | 67108864 | (e.initializer ? 536870912 : 0); + var flags = 4 | (e.initializer ? 67108864 : 0); var symbol = createSymbol(flags, text); symbol.type = getTypeFromBindingElement(e, includePatternInType, reportErrors); symbol.bindingElement = e; - members[symbol.name] = symbol; + members.set(symbol.name, symbol); }); - var result = createAnonymousType(undefined, members, emptyArray, emptyArray, undefined, undefined); + var result = createAnonymousType(undefined, members, emptyArray, emptyArray, stringIndexInfo, undefined); if (includePatternInType) { result.pattern = pattern; } @@ -23608,7 +26483,7 @@ var ts; return result; } function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { - return pattern.kind === 172 + return pattern.kind === 173 ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -23618,13 +26493,13 @@ var ts; if (reportErrors) { reportErrorsFromWidening(declaration, type); } - if (declaration.kind === 257) { + if (declaration.kind === 260) { return type; } return getWidenedType(type); } type = declaration.dotDotDotToken ? anyArrayType : anyType; - if (reportErrors && compilerOptions.noImplicitAny) { + if (reportErrors && noImplicitAny) { if (!declarationBelongsToPrivateAmbientMember(declaration)) { reportImplicitAnyError(declaration, type); } @@ -23633,56 +26508,38 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 144 ? root.parent : root; + var memberDeclaration = root.kind === 145 ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function getTypeOfVariableOrParameterOrProperty(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - if (symbol.flags & 134217728) { + if (symbol.flags & 16777216) { return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; if (ts.isCatchClauseVariableDeclarationOrBindingElement(declaration)) { return links.type = anyType; } - if (declaration.kind === 240) { + if (declaration.kind === 242) { return links.type = checkExpression(declaration.expression); } - if (declaration.flags & 2097152 && declaration.kind === 286 && declaration.typeExpression) { + if (declaration.flags & 65536 && declaration.kind === 290 && declaration.typeExpression) { return links.type = getTypeFromTypeNode(declaration.typeExpression.type); } if (!pushTypeResolution(symbol, 0)) { return unknownType; } var type = void 0; - if (declaration.kind === 192 || - declaration.kind === 177 && declaration.parent.kind === 192) { - if (declaration.flags & 2097152) { - var jsdocType = ts.getJSDocType(declaration.parent); - if (jsdocType) { - return links.type = getTypeFromTypeNode(jsdocType); - } - } - var declaredTypes = ts.map(symbol.declarations, function (decl) { return decl.kind === 192 ? - checkExpressionCached(decl.right) : - checkExpressionCached(decl.parent.right); }); - type = getUnionType(declaredTypes, true); + if (declaration.kind === 193 || + declaration.kind === 178 && declaration.parent.kind === 193) { + type = getWidenedTypeFromJSSpecialPropertyDeclarations(symbol); } else { type = getWidenedTypeForVariableLikeDeclaration(declaration, true); } if (!popTypeResolution()) { - if (symbol.valueDeclaration.type) { - type = unknownType; - error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); - } - else { - type = anyType; - if (compilerOptions.noImplicitAny) { - error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); - } - } + type = reportCircularityError(symbol); } links.type = type; } @@ -23690,7 +26547,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 151) { + if (accessor.kind === 152) { return accessor.type && getTypeFromTypeNode(accessor.type); } else { @@ -23710,10 +26567,10 @@ var ts; function getTypeOfAccessors(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - var getter = ts.getDeclarationOfKind(symbol, 151); - var setter = ts.getDeclarationOfKind(symbol, 152); - if (getter && getter.flags & 2097152) { - var jsDocType = getTypeForVariableLikeDeclarationFromJSDocComment(getter); + var getter = ts.getDeclarationOfKind(symbol, 152); + var setter = ts.getDeclarationOfKind(symbol, 153); + if (getter && getter.flags & 65536) { + var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { return links.type = jsDocType; } @@ -23736,7 +26593,7 @@ var ts; type = getReturnTypeFromBody(getter); } else { - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { if (setter) { error(setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation, symbolToString(symbol)); } @@ -23751,8 +26608,8 @@ var ts; } if (!popTypeResolution()) { type = anyType; - if (compilerOptions.noImplicitAny) { - var getter_1 = ts.getDeclarationOfKind(symbol, 151); + if (noImplicitAny) { + var getter_1 = ts.getDeclarationOfKind(symbol, 152); error(getter_1, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -23760,6 +26617,10 @@ var ts; } return links.type; } + function getBaseTypeVariableOfClass(symbol) { + var baseConstructorType = getBaseConstructorTypeOfClass(getDeclaredTypeOfClassOrInterface(symbol)); + return baseConstructorType.flags & 540672 ? baseConstructorType : undefined; + } function getTypeOfFuncClassEnumModule(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { @@ -23768,8 +26629,13 @@ var ts; } else { var type = createObjectType(16, symbol); - links.type = strictNullChecks && symbol.flags & 536870912 ? - includeFalsyTypes(type, 2048) : type; + if (symbol.flags & 32) { + var baseTypeVariable = getBaseTypeVariableOfClass(symbol); + links.type = baseTypeVariable ? getIntersectionType([type, baseTypeVariable]) : type; + } + else { + links.type = strictNullChecks && symbol.flags & 67108864 ? includeFalsyTypes(type, 2048) : type; + } } } return links.type; @@ -23794,12 +26660,37 @@ var ts; function getTypeOfInstantiatedSymbol(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - links.type = instantiateType(getTypeOfSymbol(links.target), links.mapper); + if (symbolInstantiationDepth === 100) { + error(symbol.valueDeclaration, ts.Diagnostics.Generic_type_instantiation_is_excessively_deep_and_possibly_infinite); + links.type = unknownType; + } + else { + if (!pushTypeResolution(symbol, 0)) { + return unknownType; + } + symbolInstantiationDepth++; + var type = instantiateType(getTypeOfSymbol(links.target), links.mapper); + symbolInstantiationDepth--; + if (!popTypeResolution()) { + type = reportCircularityError(symbol); + } + links.type = type; + } } return links.type; } + function reportCircularityError(symbol) { + if (symbol.valueDeclaration.type) { + error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); + return unknownType; + } + if (noImplicitAny) { + error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); + } + return anyType; + } function getTypeOfSymbol(symbol) { - if (symbol.flags & 16777216) { + if (getCheckFlags(symbol) & 1) { return getTypeOfInstantiatedSymbol(symbol); } if (symbol.flags & (3 | 4)) { @@ -23819,19 +26710,30 @@ var ts; } return unknownType; } + function isReferenceToType(type, target) { + return type !== undefined + && target !== undefined + && (getObjectFlags(type) & 4) !== 0 + && type.target === target; + } function getTargetType(type) { return getObjectFlags(type) & 4 ? type.target : type; } function hasBaseType(type, checkBase) { return check(type); function check(type) { - var target = getTargetType(type); - return target === checkBase || ts.forEach(getBaseTypes(target), check); + if (getObjectFlags(type) & (3 | 4)) { + var target = getTargetType(type); + return target === checkBase || ts.forEach(getBaseTypes(target), check); + } + else if (type.flags & 131072) { + return ts.forEach(type.types, check); + } } } function appendTypeParameters(typeParameters, declarations) { - for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { - var declaration = declarations_2[_i]; + for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { + var declaration = declarations_3[_i]; var tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(declaration)); if (!typeParameters) { typeParameters = [tp]; @@ -23848,9 +26750,9 @@ var ts; if (!node) { return typeParameters; } - if (node.kind === 226 || node.kind === 197 || - node.kind === 225 || node.kind === 184 || - node.kind === 149 || node.kind === 185) { + if (node.kind === 228 || node.kind === 198 || + node.kind === 227 || node.kind === 185 || + node.kind === 150 || node.kind === 186) { var declarations = node.typeParameters; if (declarations) { return appendTypeParameters(appendOuterTypeParameters(typeParameters, node), declarations); @@ -23859,15 +26761,15 @@ var ts; } } function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 227); + var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 229); return appendOuterTypeParameters(undefined, declaration); } function getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) { var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 227 || node.kind === 226 || - node.kind === 197 || node.kind === 228) { + if (node.kind === 229 || node.kind === 228 || + node.kind === 198 || node.kind === 230) { var declaration = node; if (declaration.typeParameters) { result = appendTypeParameters(result, declaration.typeParameters); @@ -23879,18 +26781,34 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { return ts.concatenate(getOuterTypeParametersOfClassOrInterface(symbol), getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol)); } + function isMixinConstructorType(type) { + var signatures = getSignaturesOfType(type, 1); + if (signatures.length === 1) { + var s = signatures[0]; + return !s.typeParameters && s.parameters.length === 1 && s.hasRestParameter && getTypeOfParameter(s.parameters[0]) === anyArrayType; + } + return false; + } function isConstructorType(type) { - return type.flags & 32768 && getSignaturesOfType(type, 1).length > 0; + if (isValidBaseType(type) && getSignaturesOfType(type, 1).length > 0) { + return true; + } + if (type.flags & 540672) { + var constraint = getBaseConstraintOfType(type); + return constraint && isValidBaseType(constraint) && isMixinConstructorType(constraint); + } + return false; } function getBaseTypeNodeOfClass(type) { return ts.getClassExtendsHeritageClauseElement(type.symbol.valueDeclaration); } - function getConstructorsForTypeArguments(type, typeArgumentNodes) { - var typeArgCount = typeArgumentNodes ? typeArgumentNodes.length : 0; - return ts.filter(getSignaturesOfType(type, 1), function (sig) { return (sig.typeParameters ? sig.typeParameters.length : 0) === typeArgCount; }); + function getConstructorsForTypeArguments(type, typeArgumentNodes, location) { + var typeArgCount = ts.length(typeArgumentNodes); + var isJavaScript = ts.isInJavaScriptFile(location); + return ts.filter(getSignaturesOfType(type, 1), function (sig) { return (isJavaScript || typeArgCount >= getMinTypeArgumentCount(sig.typeParameters)) && typeArgCount <= ts.length(sig.typeParameters); }); } - function getInstantiatedConstructorsForTypeArguments(type, typeArgumentNodes) { - var signatures = getConstructorsForTypeArguments(type, typeArgumentNodes); + function getInstantiatedConstructorsForTypeArguments(type, typeArgumentNodes, location) { + var signatures = getConstructorsForTypeArguments(type, typeArgumentNodes, location); if (typeArgumentNodes) { var typeArguments_1 = ts.map(typeArgumentNodes, getTypeFromTypeNode); signatures = ts.map(signatures, function (sig) { return getSignatureInstantiation(sig, typeArguments_1); }); @@ -23907,14 +26825,14 @@ var ts; return unknownType; } var baseConstructorType = checkExpression(baseTypeNode.expression); - if (baseConstructorType.flags & 32768) { + if (baseConstructorType.flags & (32768 | 131072)) { resolveStructuredTypeMembers(baseConstructorType); } if (!popTypeResolution()) { error(type.symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_base_expression, symbolToString(type.symbol)); return type.resolvedBaseConstructorType = unknownType; } - if (baseConstructorType !== unknownType && baseConstructorType !== nullWideningType && !isConstructorType(baseConstructorType)) { + if (!(baseConstructorType.flags & 1) && baseConstructorType !== nullWideningType && !isConstructorType(baseConstructorType)) { error(baseTypeNode.expression, ts.Diagnostics.Type_0_is_not_a_constructor_function_type, typeToString(baseConstructorType)); return type.resolvedBaseConstructorType = unknownType; } @@ -23943,8 +26861,8 @@ var ts; } function resolveBaseTypesOfClass(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; - var baseConstructorType = getBaseConstructorTypeOfClass(type); - if (!(baseConstructorType.flags & 32768)) { + var baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type)); + if (!(baseConstructorType.flags & (32768 | 131072 | 1))) { return; } var baseTypeNode = getBaseTypeNodeOfClass(type); @@ -23954,8 +26872,11 @@ var ts; areAllOuterTypeParametersApplied(originalBaseType)) { baseType = getTypeFromClassOrInterfaceReference(baseTypeNode, baseConstructorType.symbol); } + else if (baseConstructorType.flags & 1) { + baseType = baseConstructorType; + } else { - var constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments); + var constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments, baseTypeNode); if (!constructors.length) { error(baseTypeNode.expression, ts.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments); return; @@ -23972,7 +26893,7 @@ var ts; if (baseType === unknownType) { return; } - if (!(getObjectFlags(getTargetType(baseType)) & 3)) { + if (!isValidBaseType(baseType)) { error(baseTypeNode.expression, ts.Diagnostics.Base_constructor_return_type_0_is_not_a_class_or_interface_type, typeToString(baseType)); return; } @@ -23996,16 +26917,20 @@ var ts; } return true; } + function isValidBaseType(type) { + return type.flags & (32768 | 16777216 | 1) && !isGenericMappedType(type) || + type.flags & 131072 && !ts.forEach(type.types, function (t) { return !isValidBaseType(t); }); + } function resolveBaseTypesOfInterface(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 227 && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 229 && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getTypeFromTypeNode(node); if (baseType !== unknownType) { - if (getObjectFlags(getTargetType(baseType)) & 3) { + if (isValidBaseType(baseType)) { if (type !== baseType && !hasBaseType(baseType, type)) { if (type.resolvedBaseTypes === emptyArray) { type.resolvedBaseTypes = [baseType]; @@ -24029,7 +26954,7 @@ var ts; function isIndependentInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 227) { + if (declaration.kind === 229) { if (declaration.flags & 64) { return false; } @@ -24062,7 +26987,7 @@ var ts; type.outerTypeParameters = outerTypeParameters; type.localTypeParameters = localTypeParameters; type.instantiations = ts.createMap(); - type.instantiations[getTypeListId(type.typeParameters)] = type; + type.instantiations.set(getTypeListId(type.typeParameters), type); type.target = type; type.typeArguments = type.typeParameters; type.thisType = createType(16384); @@ -24079,7 +27004,7 @@ var ts; if (!pushTypeResolution(symbol, 2)) { return unknownType; } - var declaration = ts.getDeclarationOfKind(symbol, 285); + var declaration = ts.getDeclarationOfKind(symbol, 289); var type = void 0; if (declaration) { if (declaration.jsDocTypeLiteral) { @@ -24090,7 +27015,7 @@ var ts; } } else { - declaration = ts.getDeclarationOfKind(symbol, 228); + declaration = ts.getDeclarationOfKind(symbol, 230); type = getTypeFromTypeNode(declaration.type); } if (popTypeResolution()) { @@ -24098,7 +27023,7 @@ var ts; if (typeParameters) { links.typeParameters = typeParameters; links.instantiations = ts.createMap(); - links.instantiations[getTypeListId(typeParameters)] = type; + links.instantiations.set(getTypeListId(typeParameters), type); } } else { @@ -24115,14 +27040,14 @@ var ts; return !ts.isInAmbientContext(member); } return expr.kind === 8 || - expr.kind === 190 && expr.operator === 37 && + expr.kind === 191 && expr.operator === 37 && expr.operand.kind === 8 || - expr.kind === 70 && !!symbol.exports[expr.text]; + expr.kind === 70 && !!symbol.exports.get(expr.text); } function enumHasLiteralMembers(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 229) { + if (declaration.kind === 231) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (!isLiteralEnumMember(symbol, member)) { @@ -24147,10 +27072,10 @@ var ts; enumType.symbol = symbol; if (enumHasLiteralMembers(symbol)) { var memberTypeList = []; - var memberTypes = ts.createMap(); + var memberTypes = []; for (var _i = 0, _a = enumType.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 229) { + if (declaration.kind === 231) { computeEnumMemberValues(declaration); for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; @@ -24167,7 +27092,7 @@ var ts; if (memberTypeList.length > 1) { enumType.flags |= 65536; enumType.types = memberTypeList; - unionTypes[getTypeListId(memberTypeList)] = enumType; + unionTypes.set(getTypeListId(memberTypeList), enumType); } } } @@ -24188,9 +27113,6 @@ var ts; if (!links.declaredType) { var type = createType(16384); type.symbol = symbol; - if (!ts.getDeclarationOfKind(symbol, 143).constraint) { - type.constraint = noConstraintType; - } links.declaredType = type; } return links.declaredType; @@ -24203,7 +27125,6 @@ var ts; return links.declaredType; } function getDeclaredTypeOfSymbol(symbol) { - ts.Debug.assert((symbol.flags & 16777216) === 0); if (symbol.flags & (32 | 64)) { return getDeclaredTypeOfClassOrInterface(symbol); } @@ -24238,19 +27159,20 @@ var ts; function isIndependentType(node) { switch (node.kind) { case 118: - case 134: + case 135: case 132: case 121: - case 135: + case 136: + case 133: case 104: - case 137: + case 138: case 94: case 129: - case 171: + case 172: return true; - case 162: + case 163: return isIndependentType(node.elementType); - case 157: + case 158: return isIndependentTypeReference(node); } return false; @@ -24259,7 +27181,7 @@ var ts; return node.type && isIndependentType(node.type) || !node.type && !node.initializer; } function isIndependentFunctionLikeDeclaration(node) { - if (node.kind !== 150 && (!node.type || !isIndependentType(node.type))) { + if (node.kind !== 151 && (!node.type || !isIndependentType(node.type))) { return false; } for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { @@ -24275,12 +27197,12 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 147: - case 146: - return isIndependentVariableLikeDeclaration(declaration); - case 149: case 148: + case 147: + return isIndependentVariableLikeDeclaration(declaration); case 150: + case 149: + case 151: return isIndependentFunctionLikeDeclaration(declaration); } } @@ -24291,7 +27213,7 @@ var ts; var result = ts.createMap(); for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) { var symbol = symbols_1[_i]; - result[symbol.name] = symbol; + result.set(symbol.name, symbol); } return result; } @@ -24299,15 +27221,15 @@ var ts; var result = ts.createMap(); for (var _i = 0, symbols_2 = symbols; _i < symbols_2.length; _i++) { var symbol = symbols_2[_i]; - result[symbol.name] = mappingThisOnly && isIndependentMember(symbol) ? symbol : instantiateSymbol(symbol, mapper); + result.set(symbol.name, mappingThisOnly && isIndependentMember(symbol) ? symbol : instantiateSymbol(symbol, mapper)); } return result; } function addInheritedMembers(symbols, baseSymbols) { for (var _i = 0, baseSymbols_1 = baseSymbols; _i < baseSymbols_1.length; _i++) { var s = baseSymbols_1[_i]; - if (!symbols[s.name]) { - symbols[s.name] = s; + if (!symbols.has(s.name)) { + symbols.set(s.name, s); } } } @@ -24315,8 +27237,8 @@ var ts; if (!type.declaredProperties) { var symbol = type.symbol; type.declaredProperties = getNamedMembers(symbol.members); - type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); - type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); + type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members.get("__call")); + type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members.get("__new")); type.declaredStringIndexInfo = getIndexInfoOfSymbol(symbol, 0); type.declaredNumberIndexInfo = getIndexInfoOfSymbol(symbol, 1); } @@ -24324,7 +27246,14 @@ var ts; } function getTypeWithThisArgument(type, thisArgument) { if (getObjectFlags(type) & 4) { - return createTypeReference(type.target, ts.concatenate(type.typeArguments, [thisArgument || type.target.thisType])); + var target = type.target; + var typeArguments = type.typeArguments; + if (ts.length(target.typeParameters) === ts.length(typeArguments)) { + return createTypeReference(target, ts.concatenate(typeArguments, [thisArgument || target.thisType])); + } + } + else if (type.flags & 131072) { + return getIntersectionType(ts.map(type.types, function (t) { return getTypeWithThisArgument(t, thisArgument); })); } return type; } @@ -24360,10 +27289,14 @@ var ts; for (var _i = 0, baseTypes_1 = baseTypes; _i < baseTypes_1.length; _i++) { var baseType = baseTypes_1[_i]; var instantiatedBaseType = thisArgument ? getTypeWithThisArgument(instantiateType(baseType, mapper), thisArgument) : baseType; - addInheritedMembers(members, getPropertiesOfObjectType(instantiatedBaseType)); + addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType)); callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0)); constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1)); - stringIndexInfo = stringIndexInfo || getIndexInfoOfType(instantiatedBaseType, 0); + if (!stringIndexInfo) { + stringIndexInfo = instantiatedBaseType === anyType ? + createIndexInfo(anyType, false) : + getIndexInfoOfType(instantiatedBaseType, 0); + } numberIndexInfo = numberIndexInfo || getIndexInfoOfType(instantiatedBaseType, 1); } } @@ -24402,14 +27335,16 @@ var ts; return [createSignature(undefined, classType.localTypeParameters, undefined, emptyArray, classType, undefined, 0, false, false)]; } var baseTypeNode = getBaseTypeNodeOfClass(classType); + var isJavaScript = ts.isInJavaScriptFile(baseTypeNode); var typeArguments = ts.map(baseTypeNode.typeArguments, getTypeFromTypeNode); - var typeArgCount = typeArguments ? typeArguments.length : 0; + var typeArgCount = ts.length(typeArguments); var result = []; for (var _i = 0, baseSignatures_1 = baseSignatures; _i < baseSignatures_1.length; _i++) { var baseSig = baseSignatures_1[_i]; - var typeParamCount = baseSig.typeParameters ? baseSig.typeParameters.length : 0; - if (typeParamCount === typeArgCount) { - var sig = typeParamCount ? createSignatureInstantiation(baseSig, typeArguments) : cloneSignature(baseSig); + var minTypeArgumentCount = getMinTypeArgumentCount(baseSig.typeParameters); + var typeParamCount = ts.length(baseSig.typeParameters); + if ((isJavaScript || typeArgCount >= minTypeArgumentCount) && typeArgCount <= typeParamCount) { + var sig = typeParamCount ? createSignatureInstantiation(baseSig, fillMissingTypeArguments(typeArguments, baseSig.typeParameters, minTypeArgumentCount, baseTypeNode)) : cloneSignature(baseSig); sig.typeParameters = classType.localTypeParameters; sig.resolvedReturnType = classType; result.push(sig); @@ -24463,7 +27398,7 @@ var ts; s = cloneSignature(signature); if (ts.forEach(unionSignatures, function (sig) { return sig.thisParameter; })) { var thisType = getUnionType(ts.map(unionSignatures, function (sig) { return getTypeOfSymbol(sig.thisParameter) || anyType; }), true); - s.thisParameter = createTransientSymbol(signature.thisParameter, thisType); + s.thisParameter = createSymbolWithType(signature.thisParameter, thisType); } s.resolvedReturnType = undefined; s.unionSignatures = unionSignatures; @@ -24478,8 +27413,8 @@ var ts; function getUnionIndexInfo(types, kind) { var indexTypes = []; var isAnyReadonly = false; - for (var _i = 0, types_1 = types; _i < types_1.length; _i++) { - var type = types_1[_i]; + for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { + var type = types_2[_i]; var indexInfo = getIndexInfoOfType(type, kind); if (!indexInfo) { return undefined; @@ -24505,17 +27440,44 @@ var ts; function unionSpreadIndexInfos(info1, info2) { return info1 && info2 && createIndexInfo(getUnionType([info1.type, info2.type]), info1.isReadonly || info2.isReadonly); } + function includeMixinType(type, types, index) { + var mixedTypes = []; + for (var i = 0; i < types.length; i++) { + if (i === index) { + mixedTypes.push(type); + } + else if (isMixinConstructorType(types[i])) { + mixedTypes.push(getReturnTypeOfSignature(getSignaturesOfType(types[i], 1)[0])); + } + } + return getIntersectionType(mixedTypes); + } function resolveIntersectionTypeMembers(type) { var callSignatures = emptyArray; var constructSignatures = emptyArray; - var stringIndexInfo = undefined; - var numberIndexInfo = undefined; - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var t = _a[_i]; + var stringIndexInfo; + var numberIndexInfo; + var types = type.types; + var mixinCount = ts.countWhere(types, isMixinConstructorType); + var _loop_3 = function (i) { + var t = type.types[i]; + if (mixinCount === 0 || mixinCount === types.length && i === 0 || !isMixinConstructorType(t)) { + var signatures = getSignaturesOfType(t, 1); + if (signatures.length && mixinCount > 0) { + signatures = ts.map(signatures, function (s) { + var clone = cloneSignature(s); + clone.resolvedReturnType = includeMixinType(getReturnTypeOfSignature(s), types, i); + return clone; + }); + } + constructSignatures = ts.concatenate(constructSignatures, signatures); + } callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(t, 0)); - constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(t, 1)); stringIndexInfo = intersectIndexInfos(stringIndexInfo, getIndexInfoOfType(t, 0)); numberIndexInfo = intersectIndexInfos(numberIndexInfo, getIndexInfoOfType(t, 1)); + }; + for (var i = 0; i < types.length; i++) { + _loop_3(i); } setStructuredTypeMembers(type, emptySymbols, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo); } @@ -24531,8 +27493,8 @@ var ts; } else if (symbol.flags & 2048) { var members = symbol.members; - var callSignatures = getSignaturesOfSymbol(members["__call"]); - var constructSignatures = getSignaturesOfSymbol(members["__new"]); + var callSignatures = getSignaturesOfSymbol(members.get("__call")); + var constructSignatures = getSignaturesOfSymbol(members.get("__new")); var stringIndexInfo = getIndexInfoOfSymbol(symbol, 0); var numberIndexInfo = getIndexInfoOfSymbol(symbol, 1); setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo); @@ -24540,23 +27502,27 @@ var ts; else { var members = emptySymbols; var constructSignatures = emptyArray; - if (symbol.flags & 1952) { + var stringIndexInfo = undefined; + if (symbol.exports) { members = getExportsOfSymbol(symbol); } if (symbol.flags & 32) { var classType = getDeclaredTypeOfClassOrInterface(symbol); - constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); + constructSignatures = getSignaturesOfSymbol(symbol.members.get("__constructor")); if (!constructSignatures.length) { constructSignatures = getDefaultConstructSignatures(classType); } var baseConstructorType = getBaseConstructorTypeOfClass(classType); - if (baseConstructorType.flags & 32768) { + if (baseConstructorType.flags & (32768 | 131072 | 540672)) { members = createSymbolTable(getNamedMembers(members)); - addInheritedMembers(members, getPropertiesOfObjectType(baseConstructorType)); + addInheritedMembers(members, getPropertiesOfType(baseConstructorType)); + } + else if (baseConstructorType === anyType) { + stringIndexInfo = createIndexInfo(anyType, false); } } var numberIndexInfo = symbol.flags & 384 ? enumNumberIndexInfo : undefined; - setStructuredTypeMembers(type, members, emptyArray, constructSignatures, undefined, numberIndexInfo); + setStructuredTypeMembers(type, members, emptyArray, constructSignatures, stringIndexInfo, numberIndexInfo); if (symbol.flags & (16 | 8192)) { type.callSignatures = getSignaturesOfSymbol(symbol); } @@ -24565,37 +27531,48 @@ var ts; function resolveMappedTypeMembers(type) { var members = ts.createMap(); var stringIndexInfo; - var numberIndexInfo; setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, undefined, undefined); var typeParameter = getTypeParameterFromMappedType(type); var constraintType = getConstraintTypeFromMappedType(type); var templateType = getTemplateTypeFromMappedType(type); - var isReadonly = !!type.declaration.readonlyToken; - var isOptional = !!type.declaration.questionToken; - var keyType = constraintType.flags & 16384 ? getApparentType(constraintType) : constraintType; - var iterationType = keyType.flags & 262144 ? getIndexType(getApparentType(keyType.type)) : keyType; - forEachType(iterationType, function (t) { - var iterationMapper = createUnaryTypeMapper(typeParameter, t); + var modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); + var templateReadonly = !!type.declaration.readonlyToken; + var templateOptional = !!type.declaration.questionToken; + if (type.declaration.typeParameter.constraint.kind === 169) { + for (var _i = 0, _a = getPropertiesOfType(modifiersType); _i < _a.length; _i++) { + var propertySymbol = _a[_i]; + addMemberForKeyType(getLiteralTypeFromPropertyName(propertySymbol), propertySymbol); + } + if (getIndexInfoOfType(modifiersType, 0)) { + addMemberForKeyType(stringType); + } + } + else { + var keyType = constraintType.flags & 540672 ? getApparentType(constraintType) : constraintType; + var iterationType = keyType.flags & 262144 ? getIndexType(getApparentType(keyType.type)) : keyType; + forEachType(iterationType, addMemberForKeyType); + } + setStructuredTypeMembers(type, members, emptyArray, emptyArray, stringIndexInfo, undefined); + function addMemberForKeyType(t, propertySymbol) { + var iterationMapper = createTypeMapper([typeParameter], [t]); var templateMapper = type.mapper ? combineTypeMappers(type.mapper, iterationMapper) : iterationMapper; var propType = instantiateType(templateType, templateMapper); - if (t.flags & (32 | 64 | 256)) { + if (t.flags & 32) { var propName = t.text; - var prop = createSymbol(4 | 67108864 | (isOptional ? 536870912 : 0), propName); - prop.type = addOptionality(propType, isOptional); - prop.isReadonly = isReadonly; - members[propName] = prop; + var modifiersProp = getPropertyOfType(modifiersType, propName); + var isOptional = templateOptional || !!(modifiersProp && modifiersProp.flags & 67108864); + var prop = createSymbol(4 | (isOptional ? 67108864 : 0), propName); + prop.checkFlags = templateReadonly || modifiersProp && isReadonlySymbol(modifiersProp) ? 8 : 0; + prop.type = propType; + if (propertySymbol) { + prop.syntheticOrigin = propertySymbol; + } + members.set(propName, prop); } else if (t.flags & 2) { - stringIndexInfo = createIndexInfo(propType, isReadonly); + stringIndexInfo = createIndexInfo(propType, templateReadonly); } - else if (t.flags & 4) { - numberIndexInfo = createIndexInfo(propType, isReadonly); - } - }); - if (stringIndexInfo && numberIndexInfo && isTypeIdenticalTo(stringIndexInfo.type, numberIndexInfo.type)) { - numberIndexInfo = undefined; } - setStructuredTypeMembers(type, members, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo); } function getTypeParameterFromMappedType(type) { return type.typeParameter || @@ -24608,16 +27585,28 @@ var ts; function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? - instantiateType(getTypeFromTypeNode(type.declaration.type), type.mapper || identityMapper) : + instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!type.declaration.questionToken), type.mapper || identityMapper) : unknownType); } - function getErasedTemplateTypeFromMappedType(type) { - return instantiateType(getTemplateTypeFromMappedType(type), createUnaryTypeMapper(getTypeParameterFromMappedType(type), anyType)); + function getModifiersTypeFromMappedType(type) { + if (!type.modifiersType) { + var constraintDeclaration = type.declaration.typeParameter.constraint; + if (constraintDeclaration.kind === 169) { + type.modifiersType = instantiateType(getTypeFromTypeNode(constraintDeclaration.type), type.mapper || identityMapper); + } + else { + var declaredType = getTypeFromMappedTypeNode(type.declaration); + var constraint = getConstraintTypeFromMappedType(declaredType); + var extendedConstraint = constraint && constraint.flags & 16384 ? getConstraintOfTypeParameter(constraint) : constraint; + type.modifiersType = extendedConstraint && extendedConstraint.flags & 262144 ? instantiateType(extendedConstraint.type, type.mapper || identityMapper) : emptyObjectType; + } + } + return type.modifiersType; } function isGenericMappedType(type) { if (getObjectFlags(type) & 32) { var constraintType = getConstraintTypeFromMappedType(type); - return !!(constraintType.flags & (16384 | 262144)); + return maybeTypeOfKind(constraintType, 540672 | 262144); } return false; } @@ -24655,35 +27644,33 @@ var ts; function getPropertyOfObjectType(type, name) { if (type.flags & 32768) { var resolved = resolveStructuredTypeMembers(type); - var symbol = resolved.members[name]; + var symbol = resolved.members.get(name); if (symbol && symbolIsValue(symbol)) { return symbol; } } } function getPropertiesOfUnionOrIntersectionType(type) { - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var current = _a[_i]; - for (var _b = 0, _c = getPropertiesOfType(current); _b < _c.length; _b++) { - var prop = _c[_b]; - getUnionOrIntersectionProperty(type, prop.name); - } - if (type.flags & 65536) { - break; - } - } - var props = type.resolvedProperties; - if (props) { - var result = []; - for (var key in props) { - var prop = props[key]; - if (!(prop.flags & 268435456 && prop.isPartial)) { - result.push(prop); + if (!type.resolvedProperties) { + var members = ts.createMap(); + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var current = _a[_i]; + for (var _b = 0, _c = getPropertiesOfType(current); _b < _c.length; _b++) { + var prop = _c[_b]; + if (!members.has(prop.name)) { + var combinedProp = getPropertyOfUnionOrIntersectionType(type, prop.name); + if (combinedProp) { + members.set(prop.name, combinedProp); + } + } + } + if (type.flags & 65536) { + break; } } - return result; + type.resolvedProperties = getNamedMembers(members); } - return emptyArray; + return type.resolvedProperties; } function getPropertiesOfType(type) { type = getApparentType(type); @@ -24691,41 +27678,126 @@ var ts; getPropertiesOfUnionOrIntersectionType(type) : getPropertiesOfObjectType(type); } - function getApparentTypeOfTypeParameter(type) { - if (!type.resolvedApparentType) { - var constraintType = getConstraintOfTypeParameter(type); - while (constraintType && constraintType.flags & 16384) { - constraintType = getConstraintOfTypeParameter(constraintType); - } - type.resolvedApparentType = getTypeWithThisArgument(constraintType || emptyObjectType, type); - } - return type.resolvedApparentType; + function getConstraintOfType(type) { + return type.flags & 16384 ? getConstraintOfTypeParameter(type) : + type.flags & 524288 ? getConstraintOfIndexedAccess(type) : + getBaseConstraintOfType(type); } - function getApparentTypeOfIndexedAccess(type) { - return getIndexTypeOfType(getApparentType(type.objectType), 0) || type; + function getConstraintOfTypeParameter(typeParameter) { + return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : undefined; + } + function getConstraintOfIndexedAccess(type) { + var baseObjectType = getBaseConstraintOfType(type.objectType); + var baseIndexType = getBaseConstraintOfType(type.indexType); + return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined; + } + function getBaseConstraintOfType(type) { + if (type.flags & (540672 | 196608)) { + var constraint = getResolvedBaseConstraint(type); + if (constraint !== noConstraintType && constraint !== circularConstraintType) { + return constraint; + } + } + else if (type.flags & 262144) { + return stringType; + } + return undefined; + } + function hasNonCircularBaseConstraint(type) { + return getResolvedBaseConstraint(type) !== circularConstraintType; + } + function getResolvedBaseConstraint(type) { + var typeStack; + var circular; + if (!type.resolvedBaseConstraint) { + typeStack = []; + var constraint = getBaseConstraint(type); + type.resolvedBaseConstraint = circular ? circularConstraintType : getTypeWithThisArgument(constraint || noConstraintType, type); + } + return type.resolvedBaseConstraint; + function getBaseConstraint(t) { + if (ts.contains(typeStack, t)) { + circular = true; + return undefined; + } + typeStack.push(t); + var result = computeBaseConstraint(t); + typeStack.pop(); + return result; + } + function computeBaseConstraint(t) { + if (t.flags & 16384) { + var constraint = getConstraintFromTypeParameter(t); + return t.isThisType ? constraint : + constraint ? getBaseConstraint(constraint) : undefined; + } + if (t.flags & 196608) { + var types = t.types; + var baseTypes = []; + for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { + var type_2 = types_3[_i]; + var baseType = getBaseConstraint(type_2); + if (baseType) { + baseTypes.push(baseType); + } + } + return t.flags & 65536 && baseTypes.length === types.length ? getUnionType(baseTypes) : + t.flags & 131072 && baseTypes.length ? getIntersectionType(baseTypes) : + undefined; + } + if (t.flags & 262144) { + return stringType; + } + if (t.flags & 524288) { + var baseObjectType = getBaseConstraint(t.objectType); + var baseIndexType = getBaseConstraint(t.indexType); + var baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined; + return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined; + } + return t; + } + } + function getApparentTypeOfIntersectionType(type) { + return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument(type, type)); + } + function getDefaultFromTypeParameter(typeParameter) { + if (!typeParameter.default) { + if (typeParameter.target) { + var targetDefault = getDefaultFromTypeParameter(typeParameter.target); + typeParameter.default = targetDefault ? instantiateType(targetDefault, typeParameter.mapper) : noConstraintType; + } + else { + var defaultDeclaration = typeParameter.symbol && ts.forEach(typeParameter.symbol.declarations, function (decl) { return ts.isTypeParameter(decl) && decl.default; }); + typeParameter.default = defaultDeclaration ? getTypeFromTypeNode(defaultDeclaration) : noConstraintType; + } + } + return typeParameter.default === noConstraintType ? undefined : typeParameter.default; } function getApparentType(type) { - var t = type.flags & 16384 ? getApparentTypeOfTypeParameter(type) : - type.flags & 524288 ? getApparentTypeOfIndexedAccess(type) : - type; - return t.flags & 262178 ? globalStringType : - t.flags & 340 ? globalNumberType : - t.flags & 136 ? globalBooleanType : - t.flags & 512 ? getGlobalESSymbolType() : - t; + var t = type.flags & 540672 ? getBaseConstraintOfType(type) || emptyObjectType : type; + return t.flags & 131072 ? getApparentTypeOfIntersectionType(t) : + t.flags & 262178 ? globalStringType : + t.flags & 340 ? globalNumberType : + t.flags & 136 ? globalBooleanType : + t.flags & 512 ? getGlobalESSymbolType(languageVersion >= 2) : + t.flags & 16777216 ? emptyObjectType : + t; } function createUnionOrIntersectionProperty(containingType, name) { - var types = containingType.types; var props; - var commonFlags = (containingType.flags & 131072) ? 536870912 : 0; - var isReadonly = false; - var isPartial = false; - for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { - var current = types_2[_i]; + var types = containingType.types; + var isUnion = containingType.flags & 65536; + var excludeModifiers = isUnion ? 24 : 0; + var commonFlags = isUnion ? 0 : 67108864; + var syntheticFlag = 4; + var checkFlags = 0; + for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { + var current = types_4[_i]; var type = getApparentType(current); if (type !== unknownType) { var prop = getPropertyOfType(type, name); - if (prop && !(getDeclarationModifierFlagsFromSymbol(prop) & (8 | 16))) { + var modifiers = prop ? getDeclarationModifierFlagsFromSymbol(prop) : 0; + if (prop && !(modifiers & excludeModifiers)) { commonFlags &= prop.flags; if (!props) { props = [prop]; @@ -24733,25 +27805,29 @@ var ts; else if (!ts.contains(props, prop)) { props.push(prop); } - if (isReadonlySymbol(prop)) { - isReadonly = true; + checkFlags |= (isReadonlySymbol(prop) ? 8 : 0) | + (!(modifiers & 24) ? 64 : 0) | + (modifiers & 16 ? 128 : 0) | + (modifiers & 8 ? 256 : 0) | + (modifiers & 32 ? 512 : 0); + if (!isMethodLike(prop)) { + syntheticFlag = 2; } } - else if (containingType.flags & 65536) { - isPartial = true; + else if (isUnion) { + checkFlags |= 16; } } } if (!props) { return undefined; } - if (props.length === 1 && !isPartial) { + if (props.length === 1 && !(checkFlags & 16)) { return props[0]; } var propTypes = []; var declarations = []; var commonType = undefined; - var hasNonUniformType = false; for (var _a = 0, props_1 = props; _a < props_1.length; _a++) { var prop = props_1[_a]; if (prop.declarations) { @@ -24762,39 +27838,37 @@ var ts; commonType = type; } else if (type !== commonType) { - hasNonUniformType = true; + checkFlags |= 32; } propTypes.push(type); } - var result = createSymbol(4 | 67108864 | 268435456 | commonFlags, name); + var result = createSymbol(4 | commonFlags, name); + result.checkFlags = syntheticFlag | checkFlags; result.containingType = containingType; - result.hasNonUniformType = hasNonUniformType; - result.isPartial = isPartial; result.declarations = declarations; - result.isReadonly = isReadonly; - result.type = containingType.flags & 65536 ? getUnionType(propTypes) : getIntersectionType(propTypes); + result.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes); return result; } function getUnionOrIntersectionProperty(type, name) { - var properties = type.resolvedProperties || (type.resolvedProperties = ts.createMap()); - var property = properties[name]; + var properties = type.propertyCache || (type.propertyCache = ts.createMap()); + var property = properties.get(name); if (!property) { property = createUnionOrIntersectionProperty(type, name); if (property) { - properties[name] = property; + properties.set(name, property); } } return property; } function getPropertyOfUnionOrIntersectionType(type, name) { var property = getUnionOrIntersectionProperty(type, name); - return property && !(property.flags & 268435456 && property.isPartial) ? property : undefined; + return property && !(getCheckFlags(property) & 16) ? property : undefined; } function getPropertyOfType(type, name) { type = getApparentType(type); if (type.flags & 32768) { var resolved = resolveStructuredTypeMembers(type); - var symbol = resolved.members[name]; + var symbol = resolved.members.get(name); if (symbol && symbolIsValue(symbol)) { return symbol; } @@ -24853,7 +27927,7 @@ var ts; return undefined; } function getTypeParametersFromJSDocTemplate(declaration) { - if (declaration.flags & 2097152) { + if (declaration.flags & 65536) { var templateTag = ts.getJSDocTemplateTag(declaration); if (templateTag) { return getTypeParametersFromDeclaration(templateTag.typeParameters); @@ -24873,16 +27947,16 @@ var ts; } function symbolsToArray(symbols) { var result = []; - for (var id in symbols) { + symbols.forEach(function (symbol, id) { if (!isReservedMemberName(id)) { - result.push(symbols[id]); + result.push(symbol); } - } + }); return result; } function isJSDocOptionalParameter(node) { - if (node.flags & 2097152) { - if (node.type && node.type.kind === 273) { + if (node.flags & 65536) { + if (node.type && node.type.kind === 277) { return true; } var paramTags = ts.getJSDocParameterTags(node); @@ -24893,7 +27967,7 @@ var ts; return true; } if (paramTag.typeExpression) { - return paramTag.typeExpression.type.kind === 273; + return paramTag.typeExpression.type.kind === 277; } } } @@ -24917,6 +27991,12 @@ var ts; ts.Debug.assert(parameterIndex >= 0); return parameterIndex >= signature.minArgumentCount; } + var iife = ts.getImmediatelyInvokedFunctionExpression(node.parent); + if (iife) { + return !node.type && + !node.dotDotDotToken && + ts.indexOf(node.parent.parameters, node) >= iife.arguments.length; + } return false; } function createTypePredicateFromTypePredicateNode(node) { @@ -24936,16 +28016,50 @@ var ts; }; } } + function getMinTypeArgumentCount(typeParameters) { + var minTypeArgumentCount = 0; + if (typeParameters) { + for (var i = 0; i < typeParameters.length; i++) { + if (!getDefaultFromTypeParameter(typeParameters[i])) { + minTypeArgumentCount = i + 1; + } + } + } + return minTypeArgumentCount; + } + function fillMissingTypeArguments(typeArguments, typeParameters, minTypeArgumentCount, location) { + var numTypeParameters = ts.length(typeParameters); + if (numTypeParameters) { + var numTypeArguments = ts.length(typeArguments); + var isJavaScript = ts.isInJavaScriptFile(location); + if ((isJavaScript || numTypeArguments >= minTypeArgumentCount) && numTypeArguments <= numTypeParameters) { + if (!typeArguments) { + typeArguments = []; + } + for (var i = numTypeArguments; i < numTypeParameters; i++) { + typeArguments[i] = isJavaScript ? anyType : emptyObjectType; + } + for (var i = numTypeArguments; i < numTypeParameters; i++) { + var mapper = createTypeMapper(typeParameters, typeArguments); + var defaultType = getDefaultFromTypeParameter(typeParameters[i]); + typeArguments[i] = defaultType ? instantiateType(defaultType, mapper) : isJavaScript ? anyType : emptyObjectType; + } + } + } + return typeArguments; + } function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { var parameters = []; var hasLiteralTypes = false; - var minArgumentCount = -1; + var minArgumentCount = 0; var thisParameter = undefined; var hasThisParameter = void 0; + var iife = ts.getImmediatelyInvokedFunctionExpression(declaration); var isJSConstructSignature = ts.isJSDocConstructSignature(declaration); - for (var i = isJSConstructSignature ? 1 : 0, n = declaration.parameters.length; i < n; i++) { + var isUntypedSignatureInJSFile = !iife && !isJSConstructSignature && ts.isInJavaScriptFile(declaration) && !ts.hasJSDocParameterTags(declaration); + for (var i = isJSConstructSignature ? 1 : 0; i < declaration.parameters.length; i++) { var param = declaration.parameters[i]; var paramSymbol = param.symbol; if (paramSymbol && !!(paramSymbol.flags & 4) && !ts.isBindingPattern(param.name)) { @@ -24959,41 +28073,34 @@ var ts; else { parameters.push(paramSymbol); } - if (param.type && param.type.kind === 171) { + if (param.type && param.type.kind === 172) { hasLiteralTypes = true; } - if (param.initializer || param.questionToken || param.dotDotDotToken || isJSDocOptionalParameter(param)) { - if (minArgumentCount < 0) { - minArgumentCount = i - (hasThisParameter ? 1 : 0); - } - } - else { - minArgumentCount = -1; + var isOptionalParameter_1 = param.initializer || param.questionToken || param.dotDotDotToken || + iife && parameters.length > iife.arguments.length && !param.type || + isJSDocOptionalParameter(param) || + isUntypedSignatureInJSFile; + if (!isOptionalParameter_1) { + minArgumentCount = parameters.length; } } - if ((declaration.kind === 151 || declaration.kind === 152) && + if ((declaration.kind === 152 || declaration.kind === 153) && !ts.hasDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 151 ? 152 : 151; + var otherKind = declaration.kind === 152 ? 153 : 152; var other = ts.getDeclarationOfKind(declaration.symbol, otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - if (minArgumentCount < 0) { - minArgumentCount = declaration.parameters.length - (hasThisParameter ? 1 : 0); - } - if (isJSConstructSignature) { - minArgumentCount--; - } - var classType = declaration.kind === 150 ? + var classType = declaration.kind === 151 ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : getTypeParametersFromJSDocTemplate(declaration); var returnType = getSignatureReturnTypeFromDeclaration(declaration, isJSConstructSignature, classType); - var typePredicate = declaration.type && declaration.type.kind === 156 ? + var typePredicate = declaration.type && declaration.type.kind === 157 ? createTypePredicateFromTypePredicateNode(declaration.type) : undefined; links.resolvedSignature = createSignature(declaration, typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, ts.hasRestParameter(declaration), hasLiteralTypes); @@ -25010,41 +28117,69 @@ var ts; else if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.flags & 2097152) { + if (declaration.flags & 65536) { var type = getReturnTypeFromJSDocComment(declaration); if (type && type !== unknownType) { return type; } } - if (declaration.kind === 151 && !ts.hasDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(declaration.symbol, 152); + if (declaration.kind === 152 && !ts.hasDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(declaration.symbol, 153); return getAnnotatedAccessorType(setter); } if (ts.nodeIsMissing(declaration.body)) { return anyType; } } + function containsArgumentsReference(declaration) { + var links = getNodeLinks(declaration); + if (links.containsArgumentsReference === undefined) { + if (links.flags & 8192) { + links.containsArgumentsReference = true; + } + else { + links.containsArgumentsReference = traverse(declaration.body); + } + } + return links.containsArgumentsReference; + function traverse(node) { + if (!node) + return false; + switch (node.kind) { + case 70: + return node.text === "arguments" && ts.isPartOfExpression(node); + case 148: + case 150: + case 152: + case 153: + return node.name.kind === 143 + && traverse(node.name); + default: + return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && ts.forEachChild(node, traverse); + } + } + } function getSignaturesOfSymbol(symbol) { if (!symbol) return emptyArray; var result = []; - for (var i = 0, len = symbol.declarations.length; i < len; i++) { + for (var i = 0; i < symbol.declarations.length; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 158: case 159: - case 225: - case 149: - case 148: + case 160: + case 227: case 150: - case 153: + case 149: + case 151: case 154: case 155: - case 151: + case 156: case 152: - case 184: + case 153: case 185: - case 274: + case 186: + case 278: if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -25088,7 +28223,7 @@ var ts; } if (!popTypeResolution()) { type = anyType; - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { var declaration = signature.declaration; if (declaration.name) { error(declaration.name, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, ts.declarationNameToString(declaration.name)); @@ -25112,9 +28247,14 @@ var ts; return anyType; } function getSignatureInstantiation(signature, typeArguments) { + typeArguments = fillMissingTypeArguments(typeArguments, signature.typeParameters, getMinTypeArgumentCount(signature.typeParameters)); var instantiations = signature.instantiations || (signature.instantiations = ts.createMap()); var id = getTypeListId(typeArguments); - return instantiations[id] || (instantiations[id] = createSignatureInstantiation(signature, typeArguments)); + var instantiation = instantiations.get(id); + if (!instantiation) { + instantiations.set(id, instantiation = createSignatureInstantiation(signature, typeArguments)); + } + return instantiation; } function createSignatureInstantiation(signature, typeArguments) { return instantiateSignature(signature, createTypeMapper(signature.typeParameters, typeArguments), true); @@ -25129,7 +28269,7 @@ var ts; } function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 150 || signature.declaration.kind === 154; + var isConstructor = signature.declaration.kind === 151 || signature.declaration.kind === 155; var type = createObjectType(16); type.members = emptySymbols; type.properties = emptyArray; @@ -25140,10 +28280,10 @@ var ts; return signature.isolatedSignatureType; } function getIndexSymbol(symbol) { - return symbol.members["__index"]; + return symbol.members.get("__index"); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 ? 132 : 134; + var syntaxKind = kind === 1 ? 132 : 135; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -25170,21 +28310,9 @@ var ts; return undefined; } function getConstraintDeclaration(type) { - return ts.getDeclarationOfKind(type.symbol, 143).constraint; + return ts.getDeclarationOfKind(type.symbol, 144).constraint; } - function hasConstraintReferenceTo(type, target) { - var checked; - while (type && type.flags & 16384 && !(type.isThisType) && !ts.contains(checked, type)) { - if (type === target) { - return true; - } - (checked || (checked = [])).push(type); - var constraintDeclaration = getConstraintDeclaration(type); - type = constraintDeclaration && getTypeFromTypeNode(constraintDeclaration); - } - return false; - } - function getConstraintOfTypeParameter(typeParameter) { + function getConstraintFromTypeParameter(typeParameter) { if (!typeParameter.constraint) { if (typeParameter.target) { var targetConstraint = getConstraintOfTypeParameter(typeParameter.target); @@ -25192,28 +28320,23 @@ var ts; } else { var constraintDeclaration = getConstraintDeclaration(typeParameter); - var constraint = getTypeFromTypeNode(constraintDeclaration); - if (hasConstraintReferenceTo(constraint, typeParameter)) { - error(constraintDeclaration, ts.Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(typeParameter)); - constraint = unknownType; - } - typeParameter.constraint = constraint; + typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : noConstraintType; } } return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 143).parent); + return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 144).parent); } function getTypeListId(types) { var result = ""; if (types) { - var length_3 = types.length; + var length_4 = types.length; var i = 0; - while (i < length_3) { + while (i < length_4) { var startId = types[i].id; var count = 1; - while (i + count < length_3 && types[i + count].id === startId + count) { + while (i + count < length_4 && types[i + count].id === startId + count) { count++; } if (result.length) { @@ -25230,8 +28353,8 @@ var ts; } function getPropagatingFlagsOfTypes(types, excludeKinds) { var result = 0; - for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { - var type = types_3[_i]; + for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { + var type = types_5[_i]; if (!(type.flags & excludeKinds)) { result |= type.flags; } @@ -25240,9 +28363,10 @@ var ts; } function createTypeReference(target, typeArguments) { var id = getTypeListId(typeArguments); - var type = target.instantiations[id]; + var type = target.instantiations.get(id); if (!type) { - type = target.instantiations[id] = createObjectType(4, target.symbol); + type = createObjectType(4, target.symbol); + target.instantiations.set(id, type); type.flags |= typeArguments ? getPropagatingFlagsOfTypes(typeArguments, 0) : 0; type.target = target; type.typeArguments = typeArguments; @@ -25258,17 +28382,22 @@ var ts; return type; } function getTypeReferenceArity(type) { - return type.target.typeParameters ? type.target.typeParameters.length : 0; + return ts.length(type.target.typeParameters); } function getTypeFromClassOrInterfaceReference(node, symbol) { var type = getDeclaredTypeOfSymbol(getMergedSymbol(symbol)); var typeParameters = type.localTypeParameters; if (typeParameters) { - if (!node.typeArguments || node.typeArguments.length !== typeParameters.length) { - error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, undefined, 1), typeParameters.length); + var numTypeArguments = ts.length(node.typeArguments); + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + if (!ts.isInJavaScriptFile(node) && (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length)) { + error(node, minTypeArgumentCount === typeParameters.length + ? ts.Diagnostics.Generic_type_0_requires_1_type_argument_s + : ts.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments, typeToString(type, undefined, 1), minTypeArgumentCount, typeParameters.length); return unknownType; } - return createTypeReference(type, ts.concatenate(type.outerTypeParameters, ts.map(node.typeArguments, getTypeFromTypeNode))); + var typeArguments = ts.concatenate(type.outerTypeParameters, fillMissingTypeArguments(ts.map(node.typeArguments, getTypeFromTypeNode), typeParameters, minTypeArgumentCount, node)); + return createTypeReference(type, typeArguments); } if (node.typeArguments) { error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); @@ -25281,14 +28410,22 @@ var ts; var links = getSymbolLinks(symbol); var typeParameters = links.typeParameters; var id = getTypeListId(typeArguments); - return links.instantiations[id] || (links.instantiations[id] = instantiateTypeNoAlias(type, createTypeMapper(typeParameters, typeArguments))); + var instantiation = links.instantiations.get(id); + if (!instantiation) { + links.instantiations.set(id, instantiation = instantiateTypeNoAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters))))); + } + return instantiation; } function getTypeFromTypeAliasReference(node, symbol) { var type = getDeclaredTypeOfSymbol(symbol); var typeParameters = getSymbolLinks(symbol).typeParameters; if (typeParameters) { - if (!node.typeArguments || node.typeArguments.length !== typeParameters.length) { - error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, symbolToString(symbol), typeParameters.length); + var numTypeArguments = ts.length(node.typeArguments); + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + if (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length) { + error(node, minTypeArgumentCount === typeParameters.length + ? ts.Diagnostics.Generic_type_0_requires_1_type_argument_s + : ts.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments, symbolToString(symbol), minTypeArgumentCount, typeParameters.length); return unknownType; } var typeArguments = ts.map(node.typeArguments, getTypeFromTypeNode); @@ -25309,11 +28446,11 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 157: + case 158: return node.typeName; - case 272: + case 276: return node.name; - case 199: + case 200: var expr = node.expression; if (ts.isEntityNameExpression(expr)) { return expr; @@ -25337,23 +28474,58 @@ var ts; if (symbol.flags & 524288) { return getTypeFromTypeAliasReference(node, symbol); } - if (symbol.flags & 107455 && node.kind === 272) { + if (symbol.flags & 107455 && node.kind === 276) { return getTypeOfSymbol(symbol); } return getTypeFromNonGenericTypeReference(node, symbol); } + function getPrimitiveTypeFromJSDocTypeReference(node) { + if (ts.isIdentifier(node.name)) { + switch (node.name.text) { + case "String": + return stringType; + case "Number": + return numberType; + case "Boolean": + return booleanType; + case "Void": + return voidType; + case "Undefined": + return undefinedType; + case "Null": + return nullType; + case "Object": + return anyType; + case "Function": + return anyFunctionType; + case "Array": + case "array": + return !node.typeArguments || !node.typeArguments.length ? createArrayType(anyType) : undefined; + case "Promise": + case "promise": + return !node.typeArguments || !node.typeArguments.length ? createPromiseType(anyType) : undefined; + } + } + } + function getTypeFromJSDocNullableTypeNode(node) { + var type = getTypeFromTypeNode(node.type); + return strictNullChecks ? getUnionType([type, nullType]) : type; + } function getTypeFromTypeReference(node) { var links = getNodeLinks(node); if (!links.resolvedType) { var symbol = void 0; var type = void 0; - if (node.kind === 272) { - var typeReferenceName = getTypeReferenceName(node); - symbol = resolveTypeReferenceName(typeReferenceName); - type = getTypeReferenceType(node, symbol); + if (node.kind === 276) { + type = getPrimitiveTypeFromJSDocTypeReference(node); + if (!type) { + var typeReferenceName = getTypeReferenceName(node); + symbol = resolveTypeReferenceName(typeReferenceName); + type = getTypeReferenceType(node, symbol); + } } else { - var typeNameOrExpression = node.kind === 157 + var typeNameOrExpression = node.kind === 158 ? node.typeName : ts.isEntityNameExpression(node.expression) ? node.expression @@ -25379,12 +28551,12 @@ var ts; function getTypeOfGlobalSymbol(symbol, arity) { function getTypeDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { - var declaration = declarations_3[_i]; + for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { + var declaration = declarations_4[_i]; switch (declaration.kind) { - case 226: - case 227: + case 228: case 229: + case 231: return declaration; } } @@ -25397,44 +28569,91 @@ var ts; error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbol.name); return arity ? emptyGenericType : emptyObjectType; } - if ((type.typeParameters ? type.typeParameters.length : 0) !== arity) { + if (ts.length(type.typeParameters) !== arity) { error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_have_1_type_parameter_s, symbol.name, arity); return arity ? emptyGenericType : emptyObjectType; } return type; } - function getGlobalValueSymbol(name) { - return getGlobalSymbol(name, 107455, ts.Diagnostics.Cannot_find_global_value_0); + function getGlobalValueSymbol(name, reportErrors) { + return getGlobalSymbol(name, 107455, reportErrors ? ts.Diagnostics.Cannot_find_global_value_0 : undefined); } - function getGlobalTypeSymbol(name) { - return getGlobalSymbol(name, 793064, ts.Diagnostics.Cannot_find_global_type_0); + function getGlobalTypeSymbol(name, reportErrors) { + return getGlobalSymbol(name, 793064, reportErrors ? ts.Diagnostics.Cannot_find_global_type_0 : undefined); } function getGlobalSymbol(name, meaning, diagnostic) { return resolveName(undefined, name, meaning, diagnostic, name); } - function getGlobalType(name, arity) { + function getGlobalType(name, arity, reportErrors) { + var symbol = getGlobalTypeSymbol(name, reportErrors); + return symbol || reportErrors ? getTypeOfGlobalSymbol(symbol, arity) : undefined; + } + function getGlobalTypedPropertyDescriptorType() { + return deferredGlobalTypedPropertyDescriptorType || (deferredGlobalTypedPropertyDescriptorType = getGlobalType("TypedPropertyDescriptor", 1, true)) || emptyGenericType; + } + function getGlobalTemplateStringsArrayType() { + return deferredGlobalTemplateStringsArrayType || (deferredGlobalTemplateStringsArrayType = getGlobalType("TemplateStringsArray", 0, true)) || emptyObjectType; + } + function getGlobalESSymbolConstructorSymbol(reportErrors) { + return deferredGlobalESSymbolConstructorSymbol || (deferredGlobalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol", reportErrors)); + } + function getGlobalESSymbolType(reportErrors) { + return deferredGlobalESSymbolType || (deferredGlobalESSymbolType = getGlobalType("Symbol", 0, reportErrors)) || emptyObjectType; + } + function getGlobalPromiseType(reportErrors) { + return deferredGlobalPromiseType || (deferredGlobalPromiseType = getGlobalType("Promise", 1, reportErrors)) || emptyGenericType; + } + function getGlobalPromiseConstructorSymbol(reportErrors) { + return deferredGlobalPromiseConstructorSymbol || (deferredGlobalPromiseConstructorSymbol = getGlobalValueSymbol("Promise", reportErrors)); + } + function getGlobalPromiseConstructorLikeType(reportErrors) { + return deferredGlobalPromiseConstructorLikeType || (deferredGlobalPromiseConstructorLikeType = getGlobalType("PromiseConstructorLike", 0, reportErrors)) || emptyObjectType; + } + function getGlobalAsyncIterableType(reportErrors) { + return deferredGlobalAsyncIterableType || (deferredGlobalAsyncIterableType = getGlobalType("AsyncIterable", 1, reportErrors)) || emptyGenericType; + } + function getGlobalAsyncIteratorType(reportErrors) { + return deferredGlobalAsyncIteratorType || (deferredGlobalAsyncIteratorType = getGlobalType("AsyncIterator", 1, reportErrors)) || emptyGenericType; + } + function getGlobalAsyncIterableIteratorType(reportErrors) { + return deferredGlobalAsyncIterableIteratorType || (deferredGlobalAsyncIterableIteratorType = getGlobalType("AsyncIterableIterator", 1, reportErrors)) || emptyGenericType; + } + function getGlobalIterableType(reportErrors) { + return deferredGlobalIterableType || (deferredGlobalIterableType = getGlobalType("Iterable", 1, reportErrors)) || emptyGenericType; + } + function getGlobalIteratorType(reportErrors) { + return deferredGlobalIteratorType || (deferredGlobalIteratorType = getGlobalType("Iterator", 1, reportErrors)) || emptyGenericType; + } + function getGlobalIterableIteratorType(reportErrors) { + return deferredGlobalIterableIteratorType || (deferredGlobalIterableIteratorType = getGlobalType("IterableIterator", 1, reportErrors)) || emptyGenericType; + } + function getGlobalTypeOrUndefined(name, arity) { if (arity === void 0) { arity = 0; } - return getTypeOfGlobalSymbol(getGlobalTypeSymbol(name), arity); + var symbol = getGlobalSymbol(name, 793064, undefined); + return symbol && getTypeOfGlobalSymbol(symbol, arity); } function getExportedTypeFromNamespace(namespace, name) { var namespaceSymbol = getGlobalSymbol(namespace, 1920, undefined); var typeSymbol = namespaceSymbol && getSymbol(namespaceSymbol.exports, name, 793064); return typeSymbol && getDeclaredTypeOfSymbol(typeSymbol); } - function createTypedPropertyDescriptorType(propertyType) { - var globalTypedPropertyDescriptorType = getGlobalTypedPropertyDescriptorType(); - return globalTypedPropertyDescriptorType !== emptyGenericType - ? createTypeReference(globalTypedPropertyDescriptorType, [propertyType]) - : emptyObjectType; - } function createTypeFromGenericGlobalType(genericGlobalType, typeArguments) { return genericGlobalType !== emptyGenericType ? createTypeReference(genericGlobalType, typeArguments) : emptyObjectType; } - function createIterableType(elementType) { - return createTypeFromGenericGlobalType(getGlobalIterableType(), [elementType]); + function createTypedPropertyDescriptorType(propertyType) { + return createTypeFromGenericGlobalType(getGlobalTypedPropertyDescriptorType(), [propertyType]); } - function createIterableIteratorType(elementType) { - return createTypeFromGenericGlobalType(getGlobalIterableIteratorType(), [elementType]); + function createAsyncIterableType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalAsyncIterableType(true), [iteratedType]); + } + function createAsyncIterableIteratorType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalAsyncIterableIteratorType(true), [iteratedType]); + } + function createIterableType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalIterableType(true), [iteratedType]); + } + function createIterableIteratorType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalIterableIteratorType(true), [iteratedType]); } function createArrayType(elementType) { return createTypeFromGenericGlobalType(globalArrayType, [elementType]); @@ -25452,7 +28671,7 @@ var ts; for (var i = 0; i < arity; i++) { var typeParameter = createType(16384); typeParameters.push(typeParameter); - var property = createSymbol(4 | 67108864, "" + i); + var property = createSymbol(4, "" + i); property.type = typeParameter; properties.push(property); } @@ -25461,7 +28680,7 @@ var ts; type.outerTypeParameters = undefined; type.localTypeParameters = typeParameters; type.instantiations = ts.createMap(); - type.instantiations[getTypeListId(type.typeParameters)] = type; + type.instantiations.set(getTypeListId(type.typeParameters), type); type.target = type; type.typeArguments = type.typeParameters; type.thisType = createType(16384); @@ -25543,14 +28762,14 @@ var ts; } } function addTypesToUnion(typeSet, types) { - for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { - var type = types_4[_i]; + for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { + var type = types_6[_i]; addTypeToUnion(typeSet, type); } } function containsIdenticalType(types, type) { - for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { - var t = types_5[_i]; + for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { + var t = types_7[_i]; if (isTypeIdenticalTo(t, type)) { return true; } @@ -25558,8 +28777,9 @@ var ts; return false; } function isSubtypeOfAny(candidate, types) { - for (var i = 0, len = types.length; i < len; i++) { - if (candidate !== types[i] && isTypeSubtypeOf(candidate, types[i])) { + for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { + var type = types_8[_i]; + if (candidate !== type && isTypeSubtypeOf(candidate, type)) { return true; } } @@ -25637,10 +28857,11 @@ var ts; return types[0]; } var id = getTypeListId(types); - var type = unionTypes[id]; + var type = unionTypes.get(id); if (!type) { var propagatedFlags = getPropagatingFlagsOfTypes(types, 6144); - type = unionTypes[id] = createType(65536 | propagatedFlags); + type = createType(65536 | propagatedFlags); + unionTypes.set(id, type); type.types = types; type.aliasSymbol = aliasSymbol; type.aliasTypeArguments = aliasTypeArguments; @@ -25661,13 +28882,25 @@ var ts; else if (type.flags & 1) { typeSet.containsAny = true; } + else if (getObjectFlags(type) & 16 && isEmptyObjectType(type)) { + typeSet.containsEmptyObject = true; + } else if (!(type.flags & 8192) && (strictNullChecks || !(type.flags & 6144)) && !ts.contains(typeSet, type)) { - typeSet.push(type); + if (type.flags & 32768) { + typeSet.containsObjectType = true; + } + if (type.flags & 65536 && typeSet.unionIndex === undefined) { + typeSet.unionIndex = typeSet.length; + } + if (!(type.flags & 32768 && type.objectFlags & 16 && + type.symbol && type.symbol.flags & (16 | 8192) && containsIdenticalType(typeSet, type))) { + typeSet.push(type); + } } } function addTypesToIntersection(typeSet, types) { - for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { - var type = types_6[_i]; + for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { + var type = types_9[_i]; addTypeToIntersection(typeSet, type); } } @@ -25675,30 +28908,28 @@ var ts; if (types.length === 0) { return emptyObjectType; } - var _loop_2 = function (i) { - var type_1 = types[i]; - if (type_1.flags & 65536) { - return { value: getUnionType(ts.map(type_1.types, function (t) { return getIntersectionType(ts.replaceElement(types, i, t)); }), false, aliasSymbol, aliasTypeArguments) }; - } - }; - for (var i = 0; i < types.length; i++) { - var state_2 = _loop_2(i); - if (typeof state_2 === "object") - return state_2.value; - } var typeSet = []; addTypesToIntersection(typeSet, types); if (typeSet.containsAny) { return anyType; } + if (typeSet.containsEmptyObject && !typeSet.containsObjectType) { + typeSet.push(emptyObjectType); + } if (typeSet.length === 1) { return typeSet[0]; } + var unionIndex = typeSet.unionIndex; + if (unionIndex !== undefined) { + var unionType = typeSet[unionIndex]; + return getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex, t)); }), false, aliasSymbol, aliasTypeArguments); + } var id = getTypeListId(typeSet); - var type = intersectionTypes[id]; + var type = intersectionTypes.get(id); if (!type) { var propagatedFlags = getPropagatingFlagsOfTypes(typeSet, 6144); - type = intersectionTypes[id] = createType(131072 | propagatedFlags); + type = createType(131072 | propagatedFlags); + intersectionTypes.set(id, type); type.types = typeSet; type.aliasSymbol = aliasSymbol; type.aliasTypeArguments = aliasTypeArguments; @@ -25712,7 +28943,7 @@ var ts; } return links.resolvedType; } - function getIndexTypeForTypeParameter(type) { + function getIndexTypeForGenericType(type) { if (!type.resolvedIndexType) { type.resolvedIndexType = createType(262144); type.resolvedIndexType.type = type; @@ -25728,7 +28959,7 @@ var ts; return getUnionType(ts.map(getPropertiesOfType(type), getLiteralTypeFromPropertyName)); } function getIndexType(type) { - return type.flags & 16384 ? getIndexTypeForTypeParameter(type) : + return maybeTypeOfKind(type, 540672) ? getIndexTypeForGenericType(type) : getObjectFlags(type) & 32 ? getConstraintTypeFromMappedType(type) : type.flags & 1 || getIndexInfoOfType(type, 0) ? stringType : getLiteralTypeFromPropertyNames(type); @@ -25751,7 +28982,7 @@ var ts; return type; } function getPropertyTypeForIndexType(objectType, indexType, accessNode, cacheSymbol) { - var accessExpression = accessNode && accessNode.kind === 178 ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 179 ? accessNode : undefined; var propName = indexType.flags & (32 | 64 | 256) ? indexType.text : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, false) ? @@ -25780,14 +29011,14 @@ var ts; getIndexInfoOfType(objectType, 0) || undefined; if (indexInfo) { - if (accessExpression && ts.isAssignmentTarget(accessExpression) && indexInfo.isReadonly) { + if (accessExpression && indexInfo.isReadonly && (ts.isAssignmentTarget(accessExpression) || ts.isDeleteTarget(accessExpression))) { error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); return unknownType; } return indexInfo.type; } if (accessExpression && !isConstEnumObjectType(objectType)) { - if (compilerOptions.noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors) { + if (noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors) { if (getIndexTypeOfType(objectType, 1)) { error(accessExpression.argumentExpression, ts.Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number); } @@ -25799,7 +29030,7 @@ var ts; } } if (accessNode) { - var indexNode = accessNode.kind === 178 ? accessNode.argumentExpression : accessNode.indexType; + var indexNode = accessNode.kind === 179 ? accessNode.argumentExpression : accessNode.indexType; if (indexType.flags & (32 | 64)) { error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, indexType.text, typeToString(objectType)); } @@ -25809,34 +29040,36 @@ var ts; else { error(indexNode, ts.Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType)); } + return unknownType; } - return unknownType; + return anyType; } function getIndexedAccessForMappedType(type, indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 178 ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 179 ? accessNode : undefined; if (accessExpression && ts.isAssignmentTarget(accessExpression) && type.declaration.readonlyToken) { error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(type)); return unknownType; } - var mapper = createUnaryTypeMapper(getTypeParameterFromMappedType(type), indexType); + var mapper = createTypeMapper([getTypeParameterFromMappedType(type)], [indexType]); var templateMapper = type.mapper ? combineTypeMappers(type.mapper, mapper) : mapper; - return addOptionality(instantiateType(getTemplateTypeFromMappedType(type), templateMapper), !!type.declaration.questionToken); + return instantiateType(getTemplateTypeFromMappedType(type), templateMapper); } function getIndexedAccessType(objectType, indexType, accessNode) { - if (indexType.flags & 16384 || - objectType.flags & 16384 && indexType.flags & 262144 || + if (maybeTypeOfKind(indexType, 540672 | 262144) || + maybeTypeOfKind(objectType, 540672) && !(accessNode && accessNode.kind === 179) || isGenericMappedType(objectType)) { - if (accessNode) { - if (!isTypeAssignableTo(indexType, getIndexType(objectType))) { - error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); - return unknownType; - } + if (objectType.flags & 1) { + return objectType; } if (isGenericMappedType(objectType)) { return getIndexedAccessForMappedType(objectType, indexType, accessNode); } var id = objectType.id + "," + indexType.id; - return indexedAccessTypes[id] || (indexedAccessTypes[id] = createIndexedAccessType(objectType, indexType)); + var type = indexedAccessTypes.get(id); + if (!type) { + indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType)); + } + return type; } var apparentObjectType = getApparentType(objectType); if (indexType.flags & 65536 && !(indexType.flags & 8190)) { @@ -25876,7 +29109,7 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { var aliasSymbol = getAliasSymbolForTypeNode(node); - if (ts.isEmpty(node.symbol.members) && !aliasSymbol) { + if (node.symbol.members.size === 0 && !aliasSymbol) { links.resolvedType = emptyTypeLiteralType; } else { @@ -25889,17 +29122,33 @@ var ts; return links.resolvedType; } function getAliasSymbolForTypeNode(node) { - return node.parent.kind === 228 ? getSymbolOfNode(node.parent) : undefined; + return node.parent.kind === 230 ? getSymbolOfNode(node.parent) : undefined; } function getAliasTypeArgumentsForTypeNode(node) { var symbol = getAliasSymbolForTypeNode(node); return symbol ? getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) : undefined; } - function getSpreadType(left, right, isFromObjectLiteral) { - ts.Debug.assert(!!(left.flags & (32768 | 1)) && !!(right.flags & (32768 | 1)), "Only object types may be spread."); + function getSpreadType(left, right) { if (left.flags & 1 || right.flags & 1) { return anyType; } + left = filterType(left, function (t) { return !(t.flags & 6144); }); + if (left.flags & 8192) { + return right; + } + right = filterType(right, function (t) { return !(t.flags & 6144); }); + if (right.flags & 8192) { + return left; + } + if (left.flags & 65536) { + return mapType(left, function (t) { return getSpreadType(t, right); }); + } + if (right.flags & 65536) { + return mapType(right, function (t) { return getSpreadType(left, t); }); + } + if (right.flags & 16777216) { + return emptyObjectType; + } var members = ts.createMap(); var skippedPrivateMembers = ts.createMap(); var stringIndexInfo; @@ -25914,42 +29163,55 @@ var ts; } for (var _i = 0, _a = getPropertiesOfType(right); _i < _a.length; _i++) { var rightProp = _a[_i]; - var isOwnProperty = !(rightProp.flags & 8192) || isFromObjectLiteral; var isSetterWithoutGetter = rightProp.flags & 65536 && !(rightProp.flags & 32768); if (getDeclarationModifierFlagsFromSymbol(rightProp) & (8 | 16)) { - skippedPrivateMembers[rightProp.name] = true; + skippedPrivateMembers.set(rightProp.name, true); } - else if (isOwnProperty && !isSetterWithoutGetter) { - members[rightProp.name] = rightProp; + else if (!isClassMethod(rightProp) && !isSetterWithoutGetter) { + members.set(rightProp.name, getNonReadonlySymbol(rightProp)); } } for (var _b = 0, _c = getPropertiesOfType(left); _b < _c.length; _b++) { var leftProp = _c[_b]; if (leftProp.flags & 65536 && !(leftProp.flags & 32768) - || leftProp.name in skippedPrivateMembers) { + || skippedPrivateMembers.has(leftProp.name) + || isClassMethod(leftProp)) { continue; } - if (leftProp.name in members) { - var rightProp = members[leftProp.name]; + if (members.has(leftProp.name)) { + var rightProp = members.get(leftProp.name); var rightType = getTypeOfSymbol(rightProp); - if (maybeTypeOfKind(rightType, 2048) || rightProp.flags & 536870912) { + if (maybeTypeOfKind(rightType, 2048) || rightProp.flags & 67108864) { var declarations = ts.concatenate(leftProp.declarations, rightProp.declarations); - var flags = 4 | 67108864 | (leftProp.flags & 536870912); + var flags = 4 | (leftProp.flags & 67108864); var result = createSymbol(flags, leftProp.name); result.type = getUnionType([getTypeOfSymbol(leftProp), getTypeWithFacts(rightType, 131072)]); result.leftSpread = leftProp; result.rightSpread = rightProp; result.declarations = declarations; - result.isReadonly = isReadonlySymbol(leftProp) || isReadonlySymbol(rightProp); - members[leftProp.name] = result; + members.set(leftProp.name, result); } } else { - members[leftProp.name] = leftProp; + members.set(leftProp.name, getNonReadonlySymbol(leftProp)); } } return createAnonymousType(undefined, members, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo); } + function getNonReadonlySymbol(prop) { + if (!isReadonlySymbol(prop)) { + return prop; + } + var flags = 4 | (prop.flags & 67108864); + var result = createSymbol(flags, prop.name); + result.type = getTypeOfSymbol(prop); + result.declarations = prop.declarations; + result.syntheticOrigin = prop; + return result; + } + function isClassMethod(prop) { + return prop.flags & 8192 && ts.find(prop.declarations, function (decl) { return ts.isClassLike(decl.parent); }); + } function createLiteralType(flags, text) { var type = createType(flags); type.text = text; @@ -25971,7 +29233,11 @@ var ts; } function getLiteralTypeForText(flags, text) { var map = flags & 32 ? stringLiteralTypes : numericLiteralTypes; - return map[text] || (map[text] = createLiteralType(flags, text)); + var type = map.get(text); + if (!type) { + map.set(text, type = createLiteralType(flags, text)); + } + return type; } function getTypeFromLiteralTypeNode(node) { var links = getNodeLinks(node); @@ -25999,9 +29265,9 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 227)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 229)) { if (!(ts.getModifierFlags(container) & 32) && - (container.kind !== 150 || ts.isNodeDescendantOf(node, container.body))) { + (container.kind !== 151 || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } } @@ -26018,85 +29284,82 @@ var ts; function getTypeFromTypeNode(node) { switch (node.kind) { case 118: - case 263: - case 264: + case 267: + case 268: return anyType; - case 134: + case 135: return stringType; case 132: return numberType; case 121: return booleanType; - case 135: + case 136: return esSymbolType; case 104: return voidType; - case 137: + case 138: return undefinedType; case 94: return nullType; case 129: return neverType; - case 289: - return nullType; - case 290: - return undefinedType; - case 291: - return neverType; - case 167: + case 133: + return nonPrimitiveType; + case 168: case 98: return getTypeFromThisTypeNode(node); - case 171: + case 172: return getTypeFromLiteralTypeNode(node); - case 288: + case 292: return getTypeFromLiteralTypeNode(node.literal); - case 157: - case 272: - return getTypeFromTypeReference(node); - case 156: - return booleanType; - case 199: - return getTypeFromTypeReference(node); - case 160: - return getTypeFromTypeQueryNode(node); - case 162: - case 265: - return getTypeFromArrayTypeNode(node); - case 163: - return getTypeFromTupleTypeNode(node); - case 164: - case 266: - return getTypeFromUnionTypeNode(node); - case 165: - return getTypeFromIntersectionTypeNode(node); - case 166: - case 268: - case 269: - case 276: - case 277: - case 273: - return getTypeFromTypeNode(node.type); - case 270: - return getTypeFromTypeNode(node.literal); case 158: - case 159: + case 276: + return getTypeFromTypeReference(node); + case 157: + return booleanType; + case 200: + return getTypeFromTypeReference(node); case 161: - case 287: + return getTypeFromTypeQueryNode(node); + case 163: + case 269: + return getTypeFromArrayTypeNode(node); + case 164: + return getTypeFromTupleTypeNode(node); + case 165: + case 270: + return getTypeFromUnionTypeNode(node); + case 166: + return getTypeFromIntersectionTypeNode(node); + case 272: + return getTypeFromJSDocNullableTypeNode(node); + case 167: + case 273: + case 280: + case 281: + case 277: + return getTypeFromTypeNode(node.type); case 274: + return getTypeFromTypeNode(node.literal); + case 159: + case 160: + case 162: + case 291: + case 278: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 168: - return getTypeFromTypeOperatorNode(node); case 169: - return getTypeFromIndexedAccessTypeNode(node); + return getTypeFromTypeOperatorNode(node); case 170: + return getTypeFromIndexedAccessTypeNode(node); + case 171: return getTypeFromMappedTypeNode(node); case 70: - case 141: + case 142: var symbol = getSymbolAtLocation(node); return symbol && getDeclaredTypeOfSymbol(symbol); - case 267: + case 271: return getTypeFromJSDocTupleType(node); - case 275: + case 279: return getTypeFromJSDocVariadicType(node); default: return unknownType; @@ -26123,13 +29386,13 @@ var ts; var instantiations = mapper.instantiations || (mapper.instantiations = []); return instantiations[type.id] || (instantiations[type.id] = instantiator(type, mapper)); } - function createUnaryTypeMapper(source, target) { + function makeUnaryTypeMapper(source, target) { return function (t) { return t === source ? target : t; }; } - function createBinaryTypeMapper(source1, target1, source2, target2) { + function makeBinaryTypeMapper(source1, target1, source2, target2) { return function (t) { return t === source1 ? target1 : t === source2 ? target2 : t; }; } - function createArrayTypeMapper(sources, targets) { + function makeArrayTypeMapper(sources, targets) { return function (t) { for (var i = 0; i < sources.length; i++) { if (t === sources[i]) { @@ -26140,16 +29403,20 @@ var ts; }; } function createTypeMapper(sources, targets) { - var count = sources.length; - var mapper = count == 1 ? createUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : - count == 2 ? createBinaryTypeMapper(sources[0], targets ? targets[0] : anyType, sources[1], targets ? targets[1] : anyType) : - createArrayTypeMapper(sources, targets); + var mapper = sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : + sources.length === 2 ? makeBinaryTypeMapper(sources[0], targets ? targets[0] : anyType, sources[1], targets ? targets[1] : anyType) : + makeArrayTypeMapper(sources, targets); mapper.mappedTypes = sources; return mapper; } function createTypeEraser(sources) { return createTypeMapper(sources, undefined); } + function createBackreferenceMapper(typeParameters, index) { + var mapper = function (t) { return ts.indexOf(typeParameters, t) >= index ? emptyObjectType : t; }; + mapper.mappedTypes = typeParameters; + return mapper; + } function getInferenceMapper(context) { if (!context.mapper) { var mapper = function (t) { @@ -26173,7 +29440,12 @@ var ts; } function combineTypeMappers(mapper1, mapper2) { var mapper = function (t) { return instantiateType(mapper1(t), mapper2); }; - mapper.mappedTypes = mapper1.mappedTypes; + mapper.mappedTypes = ts.concatenate(mapper1.mappedTypes, mapper2.mappedTypes); + return mapper; + } + function createReplacementMapper(source, target, baseMapper) { + var mapper = function (t) { return t === source ? target : baseMapper(t); }; + mapper.mappedTypes = baseMapper.mappedTypes; return mapper; } function cloneTypeParameter(typeParameter) { @@ -26218,12 +29490,13 @@ var ts; return result; } function instantiateSymbol(symbol, mapper) { - if (symbol.flags & 16777216) { + if (getCheckFlags(symbol) & 1) { var links = getSymbolLinks(symbol); symbol = links.target; mapper = combineTypeMappers(links.mapper, mapper); } - var result = createSymbol(16777216 | 67108864 | symbol.flags, symbol.name); + var result = createSymbol(symbol.flags, symbol.name); + result.checkFlags = 1; result.declarations = symbol.declarations; result.parent = symbol.parent; result.target = symbol; @@ -26244,18 +29517,17 @@ var ts; function instantiateMappedType(type, mapper) { var constraintType = getConstraintTypeFromMappedType(type); if (constraintType.flags & 262144) { - var typeParameter_1 = constraintType.type; - var mappedTypeParameter = mapper(typeParameter_1); - if (typeParameter_1 !== mappedTypeParameter) { - return mapType(mappedTypeParameter, function (t) { - if (isMappableType(t)) { - var replacementMapper = createUnaryTypeMapper(typeParameter_1, t); - var combinedMapper = mapper.mappedTypes && mapper.mappedTypes.length === 1 ? replacementMapper : combineTypeMappers(replacementMapper, mapper); - combinedMapper.mappedTypes = mapper.mappedTypes; - return instantiateMappedObjectType(type, combinedMapper); - } - return t; - }); + var typeVariable_1 = constraintType.type; + if (typeVariable_1.flags & 16384) { + var mappedTypeVariable = instantiateType(typeVariable_1, mapper); + if (typeVariable_1 !== mappedTypeVariable) { + return mapType(mappedTypeVariable, function (t) { + if (isMappableType(t)) { + return instantiateMappedObjectType(type, createReplacementMapper(typeVariable_1, t, mapper)); + } + return t; + }); + } } } return instantiateMappedObjectType(type, mapper); @@ -26276,26 +29548,28 @@ var ts; return false; } var mappedTypes = mapper.mappedTypes; - var node = symbol.declarations[0].parent; - while (node) { + return !!ts.findAncestor(symbol.declarations[0], function (node) { + if (node.kind === 232 || node.kind === 264) { + return "quit"; + } switch (node.kind) { - case 158: case 159: - case 225: - case 149: - case 148: + case 160: + case 227: case 150: - case 153: + case 149: + case 151: case 154: case 155: - case 151: + case 156: case 152: - case 184: + case 153: case 185: - case 226: - case 197: - case 227: + case 186: case 228: + case 198: + case 229: + case 230: var declaration = node; if (declaration.typeParameters) { for (var _i = 0, _a = declaration.typeParameters; _i < _a.length; _i++) { @@ -26305,25 +29579,34 @@ var ts; } } } - if (ts.isClassLike(node) || node.kind === 227) { + if (ts.isClassLike(node) || node.kind === 229) { var thisType = getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; if (thisType && ts.contains(mappedTypes, thisType)) { return true; } } break; - case 230: - case 261: - return false; + case 171: + if (ts.contains(mappedTypes, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter)))) { + return true; + } + break; + case 278: + var func = node; + for (var _b = 0, _c = func.parameters; _b < _c.length; _b++) { + var p = _c[_b]; + if (ts.contains(mappedTypes, getTypeOfNode(p))) { + return true; + } + } + break; } - node = node.parent; - } - return false; + }); } function isTopLevelTypeAlias(symbol) { if (symbol.declarations && symbol.declarations.length) { var parentKind = symbol.declarations[0].parent.kind; - return parentKind === 261 || parentKind === 231; + return parentKind === 264 || parentKind === 233; } return false; } @@ -26375,28 +29658,34 @@ var ts; return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration); } function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 149 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 150 || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 184: case 185: + case 186: return isContextSensitiveFunctionLikeDeclaration(node); - case 176: + case 177: return ts.forEach(node.properties, isContextSensitive); - case 175: + case 176: return ts.forEach(node.elements, isContextSensitive); - case 193: + case 194: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 192: + case 193: return node.operatorToken.kind === 53 && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 257: + case 260: return isContextSensitive(node.initializer); + case 150: case 149: - case 148: return isContextSensitiveFunctionLikeDeclaration(node); - case 183: + case 184: return isContextSensitive(node.expression); + case 253: + return ts.forEach(node.properties, isContextSensitive); + case 252: + return node.initializer && isContextSensitive(node.initializer); + case 255: + return node.expression && isContextSensitive(node.expression); } return false; } @@ -26407,7 +29696,7 @@ var ts; if (ts.forEach(node.parameters, function (p) { return !p.type; })) { return true; } - if (node.kind === 185) { + if (node.kind === 186) { return false; } var parameter = ts.firstOrUndefined(node.parameters); @@ -26425,9 +29714,12 @@ var ts; result.properties = resolved.properties; result.callSignatures = emptyArray; result.constructSignatures = emptyArray; - type = result; + return result; } } + else if (type.flags & 131072) { + return getIntersectionType(ts.map(type.types, getTypeWithoutSignatures)); + } return type; } function isTypeIdenticalTo(source, target) { @@ -26446,7 +29738,7 @@ var ts; return isTypeRelatedTo(source, target, assignableRelation); } function isTypeInstanceOf(source, target) { - return source === target || isTypeSubtypeOf(source, target) && !isTypeIdenticalTo(source, target); + return getTargetType(source) === getTargetType(target) || isTypeSubtypeOf(source, target) && !isTypeIdenticalTo(source, target); } function isTypeComparableTo(source, target) { return isTypeRelatedTo(source, target, comparableRelation); @@ -26464,9 +29756,9 @@ var ts; return checkTypeRelatedTo(source, target, comparableRelation, errorNode, headMessage, containingMessageChain); } function isSignatureAssignableTo(source, target, ignoreReturnTypes) { - return compareSignaturesRelated(source, target, ignoreReturnTypes, false, undefined, compareTypesAssignable) !== 0; + return compareSignaturesRelated(source, target, false, ignoreReturnTypes, false, undefined, compareTypesAssignable) !== 0; } - function compareSignaturesRelated(source, target, ignoreReturnTypes, reportErrors, errorReporter, compareTypes) { + function compareSignaturesRelated(source, target, checkAsCallback, ignoreReturnTypes, reportErrors, errorReporter, compareTypes) { if (source === target) { return -1; } @@ -26497,9 +29789,15 @@ var ts; var sourceParams = source.parameters; var targetParams = target.parameters; for (var i = 0; i < checkCount; i++) { - var s = i < sourceMax ? getTypeOfParameter(sourceParams[i]) : getRestTypeOfSignature(source); - var t = i < targetMax ? getTypeOfParameter(targetParams[i]) : getRestTypeOfSignature(target); - var related = compareTypes(s, t, false) || compareTypes(t, s, reportErrors); + var sourceType = i < sourceMax ? getTypeOfParameter(sourceParams[i]) : getRestTypeOfSignature(source); + var targetType = i < targetMax ? getTypeOfParameter(targetParams[i]) : getRestTypeOfSignature(target); + var sourceSig = getSingleCallSignature(getNonNullableType(sourceType)); + var targetSig = getSingleCallSignature(getNonNullableType(targetType)); + var callbacks = sourceSig && targetSig && !sourceSig.typePredicate && !targetSig.typePredicate && + (getFalsyFlags(sourceType) & 6144) === (getFalsyFlags(targetType) & 6144); + var related = callbacks ? + compareSignaturesRelated(targetSig, sourceSig, true, false, reportErrors, errorReporter, compareTypes) : + !checkAsCallback && compareTypes(sourceType, targetType, false) || compareTypes(targetType, sourceType, reportErrors); if (!related) { if (reportErrors) { errorReporter(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, sourceParams[i < sourceMax ? i : sourceMax].name, targetParams[i < targetMax ? i : targetMax].name); @@ -26526,7 +29824,8 @@ var ts; } } else { - result &= compareTypes(sourceReturnType, targetReturnType, reportErrors); + result &= checkAsCallback && compareTypes(targetReturnType, sourceReturnType, false) || + compareTypes(sourceReturnType, targetReturnType, reportErrors); } } return result; @@ -26589,18 +29888,33 @@ var ts; sourceNonRestParamCount; } } + function isEmptyResolvedType(t) { + return t.properties.length === 0 && + t.callSignatures.length === 0 && + t.constructSignatures.length === 0 && + !t.stringIndexInfo && + !t.numberIndexInfo; + } + function isEmptyObjectType(type) { + return type.flags & 32768 ? isEmptyResolvedType(resolveStructuredTypeMembers(type)) : + type.flags & 65536 ? ts.forEach(type.types, isEmptyObjectType) : + type.flags & 131072 ? !ts.forEach(type.types, function (t) { return !isEmptyObjectType(t); }) : + false; + } function isEnumTypeRelatedTo(source, target, errorReporter) { if (source === target) { return true; } var id = source.id + "," + target.id; - if (enumRelation[id] !== undefined) { - return enumRelation[id]; + var relation = enumRelation.get(id); + if (relation !== undefined) { + return relation; } if (source.symbol.name !== target.symbol.name || !(source.symbol.flags & 256) || !(target.symbol.flags & 256) || (source.flags & 65536) !== (target.flags & 65536)) { - return enumRelation[id] = false; + enumRelation.set(id, false); + return false; } var targetEnumType = getTypeOfSymbol(target.symbol); for (var _i = 0, _a = getPropertiesOfType(getTypeOfSymbol(source.symbol)); _i < _a.length; _i++) { @@ -26611,11 +29925,13 @@ var ts; if (errorReporter) { errorReporter(ts.Diagnostics.Property_0_is_missing_in_type_1, property.name, typeToString(target, undefined, 128)); } - return enumRelation[id] = false; + enumRelation.set(id, false); + return false; } } } - return enumRelation[id] = true; + enumRelation.set(id, true); + return true; } function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { if (target.flags & 8192) @@ -26636,6 +29952,8 @@ var ts; return true; if (source.flags & 4096 && (!strictNullChecks || target.flags & 4096)) return true; + if (source.flags & 32768 && target.flags & 16777216) + return true; if (relation === assignableRelation || relation === comparableRelation) { if (source.flags & 1) return true; @@ -26667,13 +29985,13 @@ var ts; } if (source.flags & 32768 && target.flags & 32768) { var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; - var related = relation[id]; + var related = relation.get(id); if (related !== undefined) { return related === 1; } } - if (source.flags & 507904 || target.flags & 507904) { - return checkTypeRelatedTo(source, target, relation, undefined, undefined, undefined); + if (source.flags & 1032192 || target.flags & 1032192) { + return checkTypeRelatedTo(source, target, relation, undefined); } return false; } @@ -26727,10 +30045,27 @@ var ts; if ((globalStringType === source && stringType === target) || (globalNumberType === source && numberType === target) || (globalBooleanType === source && booleanType === target) || - (getGlobalESSymbolType() === source && esSymbolType === target)) { + (getGlobalESSymbolType(false) === source && esSymbolType === target)) { reportError(ts.Diagnostics._0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible, targetType, sourceType); } } + function isUnionOrIntersectionTypeWithoutNullableConstituents(type) { + if (!(type.flags & 196608)) { + return false; + } + var seenNonNullable = false; + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (t.flags & 6144) { + continue; + } + if (seenNonNullable) { + return true; + } + seenNonNullable = true; + } + return false; + } function isRelatedTo(source, target, reportErrors, headMessage) { var result; if (source.flags & 96 && source.flags & 1048576) { @@ -26753,7 +30088,7 @@ var ts; } return 0; } - if (target.flags & 196608) { + if (isUnionOrIntersectionTypeWithoutNullableConstituents(target)) { source = getRegularTypeOfObjectLiteral(source); } } @@ -26769,91 +30104,24 @@ var ts; return result; } } - else if (target.flags & 65536) { - if (result = typeRelatedToSomeType(source, target, reportErrors && !(source.flags & 8190) && !(target.flags & 8190))) { - return result; - } - } - else if (target.flags & 131072) { - if (result = typeRelatedToEachType(source, target, reportErrors)) { - return result; - } - } - else if (source.flags & 131072) { - if (result = someTypeRelatedToType(source, target, false)) { - return result; - } - } - if (target.flags & 16384) { - if (getObjectFlags(source) & 32 && getConstraintTypeFromMappedType(source) === getIndexType(target)) { - if (!source.declaration.questionToken) { - var templateType = getTemplateTypeFromMappedType(source); - var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); - if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) { - return result; - } - } - } - else { - var constraint = getConstraintOfTypeParameter(target); - if (constraint && constraint.flags & 262144) { - if (result = isRelatedTo(source, constraint, reportErrors)) { - return result; - } - } - } - } - else if (target.flags & 262144) { - if (source.flags & 262144) { - if (result = isRelatedTo(target.type, source.type, false)) { - return result; - } - } - var constraint = getConstraintOfTypeParameter(target.type); - if (constraint) { - if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) { - return result; - } - } - } - else if (target.flags & 524288) { - if (source.flags & 524288 && source.indexType === target.indexType) { - if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) { - return result; - } - } - } - if (source.flags & 16384) { - if (getObjectFlags(target) & 32 && getConstraintTypeFromMappedType(target) === getIndexType(source)) { - var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); - var templateType = getTemplateTypeFromMappedType(target); - if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { - return result; - } - } - else { - var constraint = getConstraintOfTypeParameter(source); - if (!constraint || constraint.flags & 1) { - constraint = emptyObjectType; - } - constraint = getTypeWithThisArgument(constraint, source); - var reportConstraintErrors = reportErrors && constraint !== emptyObjectType; - if (result = isRelatedTo(constraint, target, reportConstraintErrors)) { - errorInfo = saveErrorInfo; - return result; - } - } - } else { - if (getObjectFlags(source) & 4 && getObjectFlags(target) & 4 && source.target === target.target) { - if (result = typeArgumentsRelatedTo(source, target, reportErrors)) { + if (target.flags & 65536) { + if (result = typeRelatedToSomeType(source, target, reportErrors && !(source.flags & 8190) && !(target.flags & 8190))) { return result; } } - var apparentSource = getApparentType(source); - if (apparentSource.flags & (32768 | 131072) && target.flags & 32768) { - var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !(source.flags & 8190); - if (result = objectTypeRelatedTo(apparentSource, source, target, reportStructuralErrors)) { + else if (target.flags & 131072) { + if (result = typeRelatedToEachType(source, target, reportErrors)) { + return result; + } + } + else if (source.flags & 131072) { + if (result = someTypeRelatedToType(source, target, false)) { + return result; + } + } + if (source.flags & 1032192 || target.flags & 1032192) { + if (result = recursiveTypeRelatedTo(source, target, reportErrors)) { errorInfo = saveErrorInfo; return result; } @@ -26873,12 +30141,7 @@ var ts; function isIdenticalTo(source, target) { var result; if (source.flags & 32768 && target.flags & 32768) { - if (getObjectFlags(source) & 4 && getObjectFlags(target) & 4 && source.target === target.target) { - if (result = typeArgumentsRelatedTo(source, target, false)) { - return result; - } - } - return objectTypeRelatedTo(source, source, target, false); + return recursiveTypeRelatedTo(source, target, false); } if (source.flags & 65536 && target.flags & 65536 || source.flags & 131072 && target.flags & 131072) { @@ -26890,42 +30153,43 @@ var ts; } return 0; } - function isKnownProperty(type, name) { + function isKnownProperty(type, name, isComparingJsxAttributes) { if (type.flags & 32768) { var resolved = resolveStructuredTypeMembers(type); - if ((relation === assignableRelation || relation === comparableRelation) && (type === globalObjectType || isEmptyObjectType(resolved)) || - resolved.stringIndexInfo || - (resolved.numberIndexInfo && isNumericLiteralName(name)) || - getPropertyOfType(type, name)) { + if (resolved.stringIndexInfo || resolved.numberIndexInfo && isNumericLiteralName(name) || + getPropertyOfType(type, name) || isComparingJsxAttributes && !isUnhyphenatedJsxName(name)) { return true; } } else if (type.flags & 196608) { for (var _i = 0, _a = type.types; _i < _a.length; _i++) { var t = _a[_i]; - if (isKnownProperty(t, name)) { + if (isKnownProperty(t, name, isComparingJsxAttributes)) { return true; } } } return false; } - function isEmptyObjectType(t) { - return t.properties.length === 0 && - t.callSignatures.length === 0 && - t.constructSignatures.length === 0 && - !t.stringIndexInfo && - !t.numberIndexInfo; - } function hasExcessProperties(source, target, reportErrors) { if (maybeTypeOfKind(target, 32768) && !(getObjectFlags(target) & 512)) { + var isComparingJsxAttributes = !!(source.flags & 33554432); + if ((relation === assignableRelation || relation === comparableRelation) && + (isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) { + return false; + } for (var _i = 0, _a = getPropertiesOfObjectType(source); _i < _a.length; _i++) { var prop = _a[_i]; - if (!isKnownProperty(target, prop.name)) { + if (!isKnownProperty(target, prop.name, isComparingJsxAttributes)) { if (reportErrors) { ts.Debug.assert(!!errorNode); - errorNode = prop.valueDeclaration; - reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target)); + if (ts.isJsxAttributes(errorNode)) { + reportError(ts.Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(target)); + } + else { + errorNode = prop.valueDeclaration; + reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target)); + } } return true; } @@ -26951,20 +30215,42 @@ var ts; if (target.flags & 65536 && containsType(targetTypes, source)) { return -1; } - var len = targetTypes.length; - for (var i = 0; i < len; i++) { - var related = isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1); + for (var _i = 0, targetTypes_1 = targetTypes; _i < targetTypes_1.length; _i++) { + var type = targetTypes_1[_i]; + var related = isRelatedTo(source, type, false); if (related) { return related; } } + if (reportErrors) { + var discriminantType = findMatchingDiscriminantType(source, target); + isRelatedTo(source, discriminantType || targetTypes[targetTypes.length - 1], true); + } return 0; } + function findMatchingDiscriminantType(source, target) { + var sourceProperties = getPropertiesOfObjectType(source); + if (sourceProperties) { + for (var _i = 0, sourceProperties_1 = sourceProperties; _i < sourceProperties_1.length; _i++) { + var sourceProperty = sourceProperties_1[_i]; + if (isDiscriminantProperty(target, sourceProperty.name)) { + var sourceType = getTypeOfSymbol(sourceProperty); + for (var _a = 0, _b = target.types; _a < _b.length; _a++) { + var type = _b[_a]; + var targetType = getTypeOfPropertyOfType(type, sourceProperty.name); + if (targetType && isRelatedTo(sourceType, targetType)) { + return type; + } + } + } + } + } + } function typeRelatedToEachType(source, target, reportErrors) { var result = -1; var targetTypes = target.types; - for (var _i = 0, targetTypes_1 = targetTypes; _i < targetTypes_1.length; _i++) { - var targetType = targetTypes_1[_i]; + for (var _i = 0, targetTypes_2 = targetTypes; _i < targetTypes_2.length; _i++) { + var targetType = targetTypes_2[_i]; var related = isRelatedTo(source, targetType, reportErrors); if (!related) { return 0; @@ -27017,15 +30303,15 @@ var ts; } return result; } - function objectTypeRelatedTo(source, originalSource, target, reportErrors) { + function recursiveTypeRelatedTo(source, target, reportErrors) { if (overflow) { return 0; } var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; - var related = relation[id]; + var related = relation.get(id); if (related !== undefined) { if (reportErrors && related === 2) { - relation[id] = 3; + relation.set(id, 3); } else { return related === 1 ? -1 : 0; @@ -27033,7 +30319,7 @@ var ts; } if (depth > 0) { for (var i = 0; i < depth; i++) { - if (maybeStack[i][id]) { + if (maybeStack[i].get(id)) { return 1; } } @@ -27051,71 +30337,165 @@ var ts; sourceStack[depth] = source; targetStack[depth] = target; maybeStack[depth] = ts.createMap(); - maybeStack[depth][id] = 1; + maybeStack[depth].set(id, 1); depth++; var saveExpandingFlags = expandingFlags; - if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack, depth)) + if (!(expandingFlags & 1) && isDeeplyNestedType(source, sourceStack, depth)) expandingFlags |= 1; - if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack, depth)) + if (!(expandingFlags & 2) && isDeeplyNestedType(target, targetStack, depth)) expandingFlags |= 2; - var result; - if (expandingFlags === 3) { - result = 1; - } - else if (isGenericMappedType(source) || isGenericMappedType(target)) { - result = mappedTypeRelatedTo(source, target, reportErrors); - } - else { - result = propertiesRelatedTo(source, target, reportErrors); - if (result) { - result &= signaturesRelatedTo(source, target, 0, reportErrors); - if (result) { - result &= signaturesRelatedTo(source, target, 1, reportErrors); - if (result) { - result &= indexTypesRelatedTo(source, originalSource, target, 0, reportErrors); - if (result) { - result &= indexTypesRelatedTo(source, originalSource, target, 1, reportErrors); - } - } - } - } - } + var result = expandingFlags !== 3 ? structuredTypeRelatedTo(source, target, reportErrors) : 1; expandingFlags = saveExpandingFlags; depth--; if (result) { var maybeCache = maybeStack[depth]; var destinationCache = (result === -1 || depth === 0) ? relation : maybeStack[depth - 1]; - ts.copyProperties(maybeCache, destinationCache); + ts.copyEntries(maybeCache, destinationCache); } else { - relation[id] = reportErrors ? 3 : 2; + relation.set(id, reportErrors ? 3 : 2); } return result; } - function mappedTypeRelatedTo(source, target, reportErrors) { - if (isGenericMappedType(target)) { - if (isGenericMappedType(source)) { - var result_2; - if (relation === identityRelation) { - var readonlyMatches = !source.declaration.readonlyToken === !target.declaration.readonlyToken; - var optionalMatches = !source.declaration.questionToken === !target.declaration.questionToken; - if (readonlyMatches && optionalMatches) { - if (result_2 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { - return result_2 & isRelatedTo(getErasedTemplateTypeFromMappedType(source), getErasedTemplateTypeFromMappedType(target), reportErrors); - } - } - } - else { - if (relation === comparableRelation || !source.declaration.questionToken || target.declaration.questionToken) { - if (result_2 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { - return result_2 & isRelatedTo(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target), reportErrors); - } + function structuredTypeRelatedTo(source, target, reportErrors) { + var result; + var saveErrorInfo = errorInfo; + if (target.flags & 16384) { + if (getObjectFlags(source) & 32 && getConstraintTypeFromMappedType(source) === getIndexType(target)) { + if (!source.declaration.questionToken) { + var templateType = getTemplateTypeFromMappedType(source); + var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); + if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) { + return result; } } } } - else if (relation !== identityRelation && isEmptyObjectType(resolveStructuredTypeMembers(target))) { - return -1; + else if (target.flags & 262144) { + if (source.flags & 262144) { + if (result = isRelatedTo(target.type, source.type, false)) { + return result; + } + } + var constraint = getConstraintOfType(target.type); + if (constraint) { + if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) { + return result; + } + } + } + else if (target.flags & 524288) { + var constraint = getConstraintOfType(target); + if (constraint) { + if (result = isRelatedTo(source, constraint, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + } + if (source.flags & 16384) { + if (getObjectFlags(target) & 32 && getConstraintTypeFromMappedType(target) === getIndexType(source)) { + var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); + var templateType = getTemplateTypeFromMappedType(target); + if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + else { + var constraint = getConstraintOfTypeParameter(source); + if (constraint || !(target.flags & 16777216)) { + if (!constraint || constraint.flags & 1) { + constraint = emptyObjectType; + } + constraint = getTypeWithThisArgument(constraint, source); + var reportConstraintErrors = reportErrors && constraint !== emptyObjectType; + if (result = isRelatedTo(constraint, target, reportConstraintErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + } + } + else if (source.flags & 524288) { + var constraint = getConstraintOfType(source); + if (constraint) { + if (result = isRelatedTo(constraint, target, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + else if (target.flags & 524288 && source.indexType === target.indexType) { + if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) { + return result; + } + } + } + else { + if (getObjectFlags(source) & 4 && getObjectFlags(target) & 4 && source.target === target.target) { + if (result = typeArgumentsRelatedTo(source, target, reportErrors)) { + return result; + } + } + var sourceIsPrimitive = !!(source.flags & 8190); + if (relation !== identityRelation) { + source = getApparentType(source); + } + if (source.flags & (32768 | 131072) && target.flags & 32768) { + var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !sourceIsPrimitive; + if (isGenericMappedType(source) || isGenericMappedType(target)) { + result = mappedTypeRelatedTo(source, target, reportStructuralErrors); + } + else { + result = propertiesRelatedTo(source, target, reportStructuralErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 0, reportStructuralErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 1, reportStructuralErrors); + if (result) { + result &= indexTypesRelatedTo(source, target, 0, sourceIsPrimitive, reportStructuralErrors); + if (result) { + result &= indexTypesRelatedTo(source, target, 1, sourceIsPrimitive, reportStructuralErrors); + } + } + } + } + } + if (result) { + errorInfo = saveErrorInfo; + return result; + } + } + } + return 0; + } + function mappedTypeRelatedTo(source, target, reportErrors) { + if (isGenericMappedType(target)) { + if (isGenericMappedType(source)) { + var sourceReadonly = !!source.declaration.readonlyToken; + var sourceOptional = !!source.declaration.questionToken; + var targetReadonly = !!target.declaration.readonlyToken; + var targetOptional = !!target.declaration.questionToken; + var modifiersRelated = relation === identityRelation ? + sourceReadonly === targetReadonly && sourceOptional === targetOptional : + relation === comparableRelation || !sourceOptional || targetOptional; + if (modifiersRelated) { + var result_2; + if (result_2 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { + var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); + return result_2 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); + } + } + } + else if (target.declaration.questionToken && isEmptyObjectType(source)) { + return -1; + } + } + else if (relation !== identityRelation) { + var resolved = resolveStructuredTypeMembers(target); + if (isEmptyResolvedType(resolved) || resolved.stringIndexInfo && resolved.stringIndexInfo.type.flags & 1) { + return -1; + } } return 0; } @@ -27126,22 +30506,28 @@ var ts; var result = -1; var properties = getPropertiesOfObjectType(target); var requireOptionalProperties = relation === subtypeRelation && !(getObjectFlags(source) & 128); - for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { - var targetProp = properties_3[_i]; + for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) { + var targetProp = properties_4[_i]; var sourceProp = getPropertyOfType(source, targetProp.name); if (sourceProp !== targetProp) { if (!sourceProp) { - if (!(targetProp.flags & 536870912) || requireOptionalProperties) { + if (!(targetProp.flags & 67108864) || requireOptionalProperties) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source)); } return 0; } } - else if (!(targetProp.flags & 134217728)) { + else if (!(targetProp.flags & 16777216)) { var sourcePropFlags = getDeclarationModifierFlagsFromSymbol(sourceProp); var targetPropFlags = getDeclarationModifierFlagsFromSymbol(targetProp); if (sourcePropFlags & 8 || targetPropFlags & 8) { + if (getCheckFlags(sourceProp) & 256) { + if (reportErrors) { + reportError(ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(sourceProp), typeToString(source)); + } + return 0; + } if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) { if (reportErrors) { if (sourcePropFlags & 8 && targetPropFlags & 8) { @@ -27155,12 +30541,9 @@ var ts; } } else if (targetPropFlags & 16) { - var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 32; - var sourceClass = sourceDeclaredInClass ? getDeclaredTypeOfSymbol(getParentOfSymbol(sourceProp)) : undefined; - var targetClass = getDeclaredTypeOfSymbol(getParentOfSymbol(targetProp)); - if (!sourceClass || !hasBaseType(sourceClass, targetClass)) { + if (!isValidOverrideOf(sourceProp, targetProp)) { if (reportErrors) { - reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(sourceClass || source), typeToString(targetClass)); + reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(getDeclaringClass(sourceProp) || source), typeToString(getDeclaringClass(targetProp) || target)); } return 0; } @@ -27179,7 +30562,7 @@ var ts; return 0; } result &= related; - if (relation !== comparableRelation && sourceProp.flags & 536870912 && !(targetProp.flags & 536870912)) { + if (relation !== comparableRelation && sourceProp.flags & 67108864 && !(targetProp.flags & 67108864)) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); } @@ -27200,8 +30583,8 @@ var ts; return 0; } var result = -1; - for (var _i = 0, sourceProperties_1 = sourceProperties; _i < sourceProperties_1.length; _i++) { - var sourceProp = sourceProperties_1[_i]; + for (var _i = 0, sourceProperties_2 = sourceProperties; _i < sourceProperties_2.length; _i++) { + var sourceProp = sourceProperties_2[_i]; var targetProp = getPropertyOfObjectType(target, sourceProp.name); if (!targetProp) { return 0; @@ -27257,7 +30640,7 @@ var ts; return result; } function signatureRelatedTo(source, target, reportErrors) { - return compareSignaturesRelated(source, target, false, reportErrors, reportError, isRelatedTo); + return compareSignaturesRelated(source, target, false, false, reportErrors, reportError, isRelatedTo); } function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); @@ -27266,7 +30649,7 @@ var ts; return 0; } var result = -1; - for (var i = 0, len = sourceSignatures.length; i < len; i++) { + for (var i = 0; i < sourceSignatures.length; i++) { var related = compareSignaturesIdentical(sourceSignatures[i], targetSignatures[i], false, false, false, isRelatedTo); if (!related) { return 0; @@ -27299,12 +30682,12 @@ var ts; } return related; } - function indexTypesRelatedTo(source, originalSource, target, kind, reportErrors) { + function indexTypesRelatedTo(source, target, kind, sourceIsPrimitive, reportErrors) { if (relation === identityRelation) { return indexTypesIdenticalTo(source, target, kind); } var targetInfo = getIndexInfoOfType(target, kind); - if (!targetInfo || ((targetInfo.type.flags & 1) && !(originalSource.flags & 8190))) { + if (!targetInfo || targetInfo.type.flags & 1 && !sourceIsPrimitive) { return -1; } var sourceInfo = getIndexInfoOfType(source, kind) || @@ -27362,6 +30745,37 @@ var ts; return false; } } + function forEachProperty(prop, callback) { + if (getCheckFlags(prop) & 6) { + for (var _i = 0, _a = prop.containingType.types; _i < _a.length; _i++) { + var t = _a[_i]; + var p = getPropertyOfType(t, prop.name); + var result = p && forEachProperty(p, callback); + if (result) { + return result; + } + } + return undefined; + } + return callback(prop); + } + function getDeclaringClass(prop) { + return prop.parent && prop.parent.flags & 32 ? getDeclaredTypeOfSymbol(getParentOfSymbol(prop)) : undefined; + } + function isPropertyInClassDerivedFrom(prop, baseClass) { + return forEachProperty(prop, function (sp) { + var sourceClass = getDeclaringClass(sp); + return sourceClass ? hasBaseType(sourceClass, baseClass) : false; + }); + } + function isValidOverrideOf(sourceProp, targetProp) { + return !forEachProperty(targetProp, function (tp) { return getDeclarationModifierFlagsFromSymbol(tp) & 16 ? + !isPropertyInClassDerivedFrom(sourceProp, getDeclaringClass(tp)) : false; }); + } + function isClassDerivedFromDeclaringClasses(checkClass, prop) { + return forEachProperty(prop, function (p) { return getDeclarationModifierFlagsFromSymbol(p) & 16 ? + !hasBaseType(checkClass, getDeclaringClass(p)) : false; }) ? undefined : checkClass; + } function isAbstractConstructorType(type) { if (getObjectFlags(type) & 16) { var symbol = type.symbol; @@ -27374,16 +30788,18 @@ var ts; } return false; } - function isDeeplyNestedGeneric(type, stack, depth) { - if (getObjectFlags(type) & (4 | 64) && depth >= 5) { + function isDeeplyNestedType(type, stack, depth) { + if (depth >= 5 && type.flags & 32768) { var symbol = type.symbol; - var count = 0; - for (var i = 0; i < depth; i++) { - var t = stack[i]; - if (getObjectFlags(t) & (4 | 64) && t.symbol === symbol) { - count++; - if (count >= 5) - return true; + if (symbol) { + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (t.flags & 32768 && t.symbol === symbol) { + count++; + if (count >= 5) + return true; + } } } } @@ -27407,7 +30823,7 @@ var ts; } } else { - if ((sourceProp.flags & 536870912) !== (targetProp.flags & 536870912)) { + if ((sourceProp.flags & 67108864) !== (targetProp.flags & 67108864)) { return 0; } } @@ -27437,7 +30853,7 @@ var ts; if (!(isMatchingSignature(source, target, partialMatch))) { return 0; } - if ((source.typeParameters ? source.typeParameters.length : 0) !== (target.typeParameters ? target.typeParameters.length : 0)) { + if (ts.length(source.typeParameters) !== ts.length(target.typeParameters)) { return 0; } source = getErasedSignature(source); @@ -27475,8 +30891,8 @@ var ts; return signature.hasRestParameter && parameterIndex >= signature.parameters.length - 1; } function isSupertypeOfEach(candidate, types) { - for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { - var t = types_7[_i]; + for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { + var t = types_10[_i]; if (candidate !== t && !isTypeSubtypeOf(t, candidate)) return false; } @@ -27484,8 +30900,8 @@ var ts; } function literalTypesWithSameBaseType(types) { var commonBaseType; - for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { - var t = types_8[_i]; + for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { + var t = types_11[_i]; var baseType = getBaseTypeOfLiteralType(t); if (!commonBaseType) { commonBaseType = baseType; @@ -27576,8 +30992,8 @@ var ts; } function getFalsyFlagsOfTypes(types) { var result = 0; - for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { - var t = types_9[_i]; + for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { + var t = types_12[_i]; result |= getFalsyFlags(t); } return result; @@ -27606,7 +31022,7 @@ var ts; types.push(undefinedType); if (flags & 4096) types.push(nullType); - return getUnionType(types, true); + return getUnionType(types); } function removeDefinitelyFalsyTypes(type) { return getFalsyFlags(type) & 7392 ? @@ -27621,8 +31037,8 @@ var ts; getSignaturesOfType(type, 0).length === 0 && getSignaturesOfType(type, 1).length === 0; } - function createTransientSymbol(source, type) { - var symbol = createSymbol(source.flags | 67108864, source.name); + function createSymbolWithType(source, type) { + var symbol = createSymbol(source.flags, source.name); symbol.declarations = source.declarations; symbol.parent = source.parent; symbol.type = type; @@ -27638,9 +31054,8 @@ var ts; var property = _a[_i]; var original = getTypeOfSymbol(property); var updated = f(original); - members[property.name] = updated === original ? property : createTransientSymbol(property, updated); + members.set(property.name, updated === original ? property : createSymbolWithType(property, updated)); } - ; return members; } function getRegularTypeOfObjectLiteral(type) { @@ -27659,11 +31074,17 @@ var ts; type.regularType = regularNew; return regularNew; } + function getWidenedProperty(prop) { + var original = getTypeOfSymbol(prop); + var widened = getWidenedType(original); + return widened === original ? prop : createSymbolWithType(prop, widened); + } function getWidenedTypeOfObjectLiteral(type) { - var members = transformTypeOfMembers(type, function (prop) { - var widened = getWidenedType(prop); - return prop === widened ? prop : widened; - }); + var members = ts.createMap(); + for (var _i = 0, _a = getPropertiesOfObjectType(type); _i < _a.length; _i++) { + var prop = _a[_i]; + members.set(prop.name, prop.flags & 4 ? getWidenedProperty(prop) : prop); + } var stringIndexInfo = getIndexInfoOfType(type, 0); var numberIndexInfo = getIndexInfoOfType(type, 1); return createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexInfo && createIndexInfo(getWidenedType(stringIndexInfo.type), stringIndexInfo.isReadonly), numberIndexInfo && createIndexInfo(getWidenedType(numberIndexInfo.type), numberIndexInfo.isReadonly)); @@ -27724,25 +31145,25 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { + case 148: case 147: - case 146: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 144: + case 145: diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 174: + case 175: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; break; - case 225: + case 227: + case 150: case 149: - case 148: - case 151: case 152: - case 184: + case 153: case 185: + case 186: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -27755,7 +31176,7 @@ var ts; error(declaration, diagnostic, ts.declarationNameToString(declaration.name), typeAsString); } function reportErrorsFromWidening(declaration, type) { - if (produceDiagnostics && compilerOptions.noImplicitAny && type.flags & 2097152) { + if (produceDiagnostics && noImplicitAny && type.flags & 2097152) { if (!reportWideningErrorsInType(type)) { reportImplicitAnyError(declaration, type); } @@ -27781,13 +31202,14 @@ var ts; callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i)); } } - function createInferenceContext(signature, inferUnionTypes) { + function createInferenceContext(signature, inferUnionTypes, useAnyForNoInferences) { var inferences = ts.map(signature.typeParameters, createTypeInferencesObject); return { signature: signature, inferUnionTypes: inferUnionTypes, inferences: inferences, inferredTypes: new Array(signature.typeParameters.length), + useAnyForNoInferences: useAnyForNoInferences }; } function createTypeInferencesObject() { @@ -27798,25 +31220,69 @@ var ts; isFixed: false, }; } - function couldContainTypeParameters(type) { + function couldContainTypeVariables(type) { var objectFlags = getObjectFlags(type); - return !!(type.flags & 16384 || - objectFlags & 4 && ts.forEach(type.typeArguments, couldContainTypeParameters) || + return !!(type.flags & 540672 || + objectFlags & 4 && ts.forEach(type.typeArguments, couldContainTypeVariables) || objectFlags & 16 && type.symbol && type.symbol.flags & (8192 | 2048 | 32) || objectFlags & 32 || - type.flags & 196608 && couldUnionOrIntersectionContainTypeParameters(type)); + type.flags & 196608 && couldUnionOrIntersectionContainTypeVariables(type)); } - function couldUnionOrIntersectionContainTypeParameters(type) { - if (type.couldContainTypeParameters === undefined) { - type.couldContainTypeParameters = ts.forEach(type.types, couldContainTypeParameters); + function couldUnionOrIntersectionContainTypeVariables(type) { + if (type.couldContainTypeVariables === undefined) { + type.couldContainTypeVariables = ts.forEach(type.types, couldContainTypeVariables); } - return type.couldContainTypeParameters; + return type.couldContainTypeVariables; } function isTypeParameterAtTopLevel(type, typeParameter) { return type === typeParameter || type.flags & 196608 && ts.forEach(type.types, function (t) { return isTypeParameterAtTopLevel(t, typeParameter); }); } - function inferTypes(context, originalSource, originalTarget) { - var typeParameters = context.signature.typeParameters; + function inferTypeForHomomorphicMappedType(source, target) { + var properties = getPropertiesOfType(source); + var indexInfo = getIndexInfoOfType(source, 0); + if (properties.length === 0 && !indexInfo) { + return undefined; + } + var typeVariable = getIndexedAccessType(getConstraintTypeFromMappedType(target).type, getTypeParameterFromMappedType(target)); + var typeVariableArray = [typeVariable]; + var typeInferences = createTypeInferencesObject(); + var typeInferencesArray = [typeInferences]; + var templateType = getTemplateTypeFromMappedType(target); + var readonlyMask = target.declaration.readonlyToken ? false : true; + var optionalMask = target.declaration.questionToken ? 0 : 67108864; + var members = createSymbolTable(properties); + for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) { + var prop = properties_5[_i]; + var inferredPropType = inferTargetType(getTypeOfSymbol(prop)); + if (!inferredPropType) { + return undefined; + } + var inferredProp = createSymbol(4 | prop.flags & optionalMask, prop.name); + inferredProp.checkFlags = readonlyMask && isReadonlySymbol(prop) ? 8 : 0; + inferredProp.declarations = prop.declarations; + inferredProp.type = inferredPropType; + members.set(prop.name, inferredProp); + } + if (indexInfo) { + var inferredIndexType = inferTargetType(indexInfo.type); + if (!inferredIndexType) { + return undefined; + } + indexInfo = createIndexInfo(inferredIndexType, readonlyMask && indexInfo.isReadonly); + } + return createAnonymousType(undefined, members, emptyArray, emptyArray, indexInfo, undefined); + function inferTargetType(sourceType) { + typeInferences.primary = undefined; + typeInferences.secondary = undefined; + inferTypes(typeVariableArray, typeInferencesArray, sourceType, templateType); + var inferences = typeInferences.primary || typeInferences.secondary; + return inferences && getUnionType(inferences, true); + } + } + function inferTypesWithContext(context, originalSource, originalTarget) { + inferTypes(context.signature.typeParameters, context.inferences, originalSource, originalTarget); + } + function inferTypes(typeVariables, typeInferences, originalSource, originalTarget) { var sourceStack; var targetStack; var depth = 0; @@ -27832,7 +31298,7 @@ var ts; return false; } function inferFromTypes(source, target) { - if (!couldContainTypeParameters(target)) { + if (!couldContainTypeVariables(target)) { return; } if (source.aliasSymbol && source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol) { @@ -27871,13 +31337,13 @@ var ts; target = removeTypesFromUnionOrIntersection(target, matchingTypes); } } - if (target.flags & 16384) { + if (target.flags & 540672) { if (source.flags & 8388608) { return; } - for (var i = 0; i < typeParameters.length; i++) { - if (target === typeParameters[i]) { - var inferences = context.inferences[i]; + for (var i = 0; i < typeVariables.length; i++) { + if (target === typeVariables[i]) { + var inferences = typeInferences[i]; if (!inferences.isFixed) { var candidates = inferiority ? inferences.secondary || (inferences.secondary = []) : @@ -27885,7 +31351,7 @@ var ts; if (!ts.contains(candidates, source)) { candidates.push(source); } - if (!isTypeParameterAtTopLevel(originalTarget, target)) { + if (target.flags & 16384 && !isTypeParameterAtTopLevel(originalTarget, target)) { inferences.topLevel = false; } } @@ -27903,21 +31369,21 @@ var ts; } else if (target.flags & 196608) { var targetTypes = target.types; - var typeParameterCount = 0; - var typeParameter = void 0; - for (var _d = 0, targetTypes_2 = targetTypes; _d < targetTypes_2.length; _d++) { - var t = targetTypes_2[_d]; - if (t.flags & 16384 && ts.contains(typeParameters, t)) { - typeParameter = t; - typeParameterCount++; + var typeVariableCount = 0; + var typeVariable = void 0; + for (var _d = 0, targetTypes_3 = targetTypes; _d < targetTypes_3.length; _d++) { + var t = targetTypes_3[_d]; + if (t.flags & 540672 && ts.contains(typeVariables, t)) { + typeVariable = t; + typeVariableCount++; } else { inferFromTypes(source, t); } } - if (typeParameterCount === 1) { + if (typeVariableCount === 1) { inferiority++; - inferFromTypes(source, typeParameter); + inferFromTypes(source, typeVariable); inferiority--; } } @@ -27934,14 +31400,14 @@ var ts; if (isInProcess(source, target)) { return; } - if (isDeeplyNestedGeneric(source, sourceStack, depth) && isDeeplyNestedGeneric(target, targetStack, depth)) { + if (isDeeplyNestedType(source, sourceStack, depth) && isDeeplyNestedType(target, targetStack, depth)) { return; } var key = source.id + "," + target.id; - if (visited[key]) { + if (visited.get(key)) { return; } - visited[key] = true; + visited.set(key, true); if (depth === 0) { sourceStack = []; targetStack = []; @@ -27957,9 +31423,16 @@ var ts; function inferFromObjectTypes(source, target) { if (getObjectFlags(target) & 32) { var constraintType = getConstraintTypeFromMappedType(target); - if (getObjectFlags(source) & 32) { - inferFromTypes(getConstraintTypeFromMappedType(source), constraintType); - inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target)); + if (constraintType.flags & 262144) { + var index = ts.indexOf(typeVariables, constraintType.type); + if (index >= 0 && !typeInferences[index].isFixed) { + var inferredType = inferTypeForHomomorphicMappedType(source, target); + if (inferredType) { + inferiority++; + inferFromTypes(inferredType, typeVariables[index]); + inferiority--; + } + } return; } if (constraintType.flags & 16384) { @@ -27975,8 +31448,8 @@ var ts; } function inferFromProperties(source, target) { var properties = getPropertiesOfObjectType(target); - for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) { - var targetProp = properties_4[_i]; + for (var _i = 0, properties_6 = properties; _i < properties_6.length; _i++) { + var targetProp = properties_6[_i]; var sourceProp = getPropertyOfObjectType(source, targetProp.name); if (sourceProp) { inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); @@ -28026,8 +31499,8 @@ var ts; } } function typeIdenticalToSomeType(type, types) { - for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { - var t = types_10[_i]; + for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { + var t = types_13[_i]; if (isTypeIdenticalTo(t, type)) { return true; } @@ -28068,7 +31541,13 @@ var ts; inferenceSucceeded = !!unionOrSuperType; } else { - inferredType = emptyObjectType; + var defaultType = getDefaultFromTypeParameter(context.signature.typeParameters[index]); + if (defaultType) { + inferredType = instantiateType(defaultType, combineTypeMappers(createBackreferenceMapper(context.signature.typeParameters, index), getInferenceMapper(context))); + } + else { + inferredType = context.useAnyForNoInferences ? anyType : emptyObjectType; + } inferenceSucceeded = true; } context.inferredTypes[index] = inferredType; @@ -28101,19 +31580,7 @@ var ts; return links.resolvedSymbol; } function isInTypeQuery(node) { - while (node) { - switch (node.kind) { - case 160: - return true; - case 70: - case 141: - node = node.parent; - continue; - default: - return false; - } - } - ts.Debug.fail("should not get here"); + return !!ts.findAncestor(node, function (n) { return n.kind === 161 ? true : n.kind === 70 || n.kind === 142 ? false : "quit"; }); } function getFlowCacheKey(node) { if (node.kind === 70) { @@ -28123,7 +31590,7 @@ var ts; if (node.kind === 98) { return "0"; } - if (node.kind === 177) { + if (node.kind === 178) { var key = getFlowCacheKey(node.expression); return key && key + "." + node.name.text; } @@ -28134,7 +31601,7 @@ var ts; case 70: case 98: return node; - case 177: + case 178: return getLeftmostIdentifierOrThis(node.expression); } return undefined; @@ -28143,19 +31610,21 @@ var ts; switch (source.kind) { case 70: return target.kind === 70 && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 223 || target.kind === 174) && + (target.kind === 225 || target.kind === 175) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 98: return target.kind === 98; - case 177: - return target.kind === 177 && + case 96: + return target.kind === 96; + case 178: + return target.kind === 178 && source.name.text === target.name.text && isMatchingReference(source.expression, target.expression); } return false; } function containsMatchingReference(source, target) { - while (source.kind === 177) { + while (source.kind === 178) { source = source.expression; if (isMatchingReference(source, target)) { return true; @@ -28164,7 +31633,7 @@ var ts; return false; } function containsMatchingReferenceDiscriminant(source, target) { - return target.kind === 177 && + return target.kind === 178 && containsMatchingReference(source, target.expression) && isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.text); } @@ -28172,7 +31641,7 @@ var ts; if (expr.kind === 70) { return getTypeOfSymbol(getResolvedSymbol(expr)); } - if (expr.kind === 177) { + if (expr.kind === 178) { var type = getDeclaredTypeOfReference(expr.expression); return type && getTypeOfPropertyOfType(type, expr.name.text); } @@ -28181,9 +31650,9 @@ var ts; function isDiscriminantProperty(type, name) { if (type && type.flags & 65536) { var prop = getUnionOrIntersectionProperty(type, name); - if (prop && prop.flags & 268435456) { + if (prop && getCheckFlags(prop) & 2) { if (prop.isDiscriminantProperty === undefined) { - prop.isDiscriminantProperty = prop.hasNonUniformType && isLiteralType(getTypeOfSymbol(prop)); + prop.isDiscriminantProperty = prop.checkFlags & 32 && isLiteralType(getTypeOfSymbol(prop)); } return prop.isDiscriminantProperty; } @@ -28202,7 +31671,7 @@ var ts; } } } - if (callExpression.expression.kind === 177 && + if (callExpression.expression.kind === 178 && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -28241,8 +31710,8 @@ var ts; } function getTypeFactsOfTypes(types) { var result = 0; - for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { - var t = types_11[_i]; + for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { + var t = types_14[_i]; result |= getTypeFacts(t); } return result; @@ -28250,7 +31719,7 @@ var ts; function isFunctionObjectType(type) { var resolved = resolveStructuredTypeMembers(type); return !!(resolved.callSignatures.length || resolved.constructSignatures.length || - resolved.members["bind"] && isTypeSubtypeOf(type, globalFunctionType)); + resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType)); } function getTypeFacts(type) { var flags = type.flags; @@ -28293,9 +31762,11 @@ var ts; if (flags & 512) { return strictNullChecks ? 1981320 : 4193160; } - if (flags & 16384) { - var constraint = getConstraintOfTypeParameter(type); - return getTypeFacts(constraint || emptyObjectType); + if (flags & 16777216) { + return strictNullChecks ? 6166480 : 8378320; + } + if (flags & 540672) { + return getTypeFacts(getBaseConstraintOfType(type) || emptyObjectType); } if (flags & 196608) { return getTypeFactsOfTypes(type.types); @@ -28321,17 +31792,23 @@ var ts; } function getTypeOfDestructuredArrayElement(type, index) { return isTupleLikeType(type) && getTypeOfPropertyOfType(type, "" + index) || - checkIteratedTypeOrElementType(type, undefined, false) || + checkIteratedTypeOrElementType(type, undefined, false, false) || unknownType; } function getTypeOfDestructuredSpreadExpression(type) { - return createArrayType(checkIteratedTypeOrElementType(type, undefined, false) || unknownType); + return createArrayType(checkIteratedTypeOrElementType(type, undefined, false, false) || unknownType); } function getAssignedTypeOfBinaryExpression(node) { - return node.parent.kind === 175 || node.parent.kind === 257 ? + var isDestructuringDefaultAssignment = node.parent.kind === 176 && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 260 && isDestructuringAssignmentTarget(node.parent.parent); + return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } + function isDestructuringAssignmentTarget(parent) { + return parent.parent.kind === 193 && parent.parent.left === parent || + parent.parent.kind === 215 && parent.parent.initializer === parent; + } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), ts.indexOf(node.elements, element)); } @@ -28347,21 +31824,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 212: + case 214: return stringType; - case 213: - return checkRightHandSideOfForOf(parent.expression) || unknownType; - case 192: + case 215: + return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || unknownType; + case 193: return getAssignedTypeOfBinaryExpression(parent); - case 186: + case 187: return undefinedType; - case 175: + case 176: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 196: + case 197: return getAssignedTypeOfSpreadExpression(parent); - case 257: + case 260: return getAssignedTypeOfPropertyAssignment(parent); - case 258: + case 261: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return unknownType; @@ -28369,7 +31846,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 172 ? + var type = pattern.kind === 173 ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, ts.indexOf(pattern.elements, node)) : @@ -28384,35 +31861,35 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 212) { + if (node.parent.parent.kind === 214) { return stringType; } - if (node.parent.parent.kind === 213) { - return checkRightHandSideOfForOf(node.parent.parent.expression) || unknownType; + if (node.parent.parent.kind === 215) { + return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || unknownType; } return unknownType; } function getInitialType(node) { - return node.kind === 223 ? + return node.kind === 225 ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function getInitialOrAssignedType(node) { - return node.kind === 223 || node.kind === 174 ? + return node.kind === 225 || node.kind === 175 ? getInitialType(node) : getAssignedType(node); } function isEmptyArrayAssignment(node) { - return node.kind === 223 && node.initializer && + return node.kind === 225 && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 174 && node.parent.kind === 192 && + node.kind !== 175 && node.parent.kind === 193 && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 183: + case 184: return getReferenceCandidate(node.expression); - case 192: + case 193: switch (node.operatorToken.kind) { case 57: return getReferenceCandidate(node.left); @@ -28424,13 +31901,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 183 || - parent.kind === 192 && parent.operatorToken.kind === 57 && parent.left === node || - parent.kind === 192 && parent.operatorToken.kind === 25 && parent.right === node ? + return parent.kind === 184 || + parent.kind === 193 && parent.operatorToken.kind === 57 && parent.left === node || + parent.kind === 193 && parent.operatorToken.kind === 25 && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 253) { + if (clause.kind === 256) { var caseType = getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); return isUnitType(caseType) ? caseType : undefined; } @@ -28476,8 +31953,29 @@ var ts; } return f(type) ? type : neverType; } - function mapType(type, f) { - return type.flags & 65536 ? getUnionType(ts.map(type.types, f)) : f(type); + function mapType(type, mapper) { + if (!(type.flags & 65536)) { + return mapper(type); + } + var types = type.types; + var mappedType; + var mappedTypes; + for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { + var current = types_15[_i]; + var t = mapper(current); + if (t) { + if (!mappedType) { + mappedType = t; + } + else if (!mappedTypes) { + mappedTypes = [mappedType, t]; + } + else { + mappedTypes.push(t); + } + } + } + return mappedTypes ? getUnionType(mappedTypes) : mappedType; } function extractTypesOfKind(type, kind) { return filterType(type, function (t) { return (t.flags & kind) !== 0; }); @@ -28511,7 +32009,7 @@ var ts; return evolvingArrayTypes[elementType.id] || (evolvingArrayTypes[elementType.id] = createEvolvingArrayType(elementType)); } function addEvolvingArrayElementType(evolvingArrayType, node) { - var elementType = getBaseTypeOfLiteralType(getTypeOfExpression(node)); + var elementType = getBaseTypeOfLiteralType(getContextFreeTypeOfExpression(node)); return isTypeSubsetOf(elementType, evolvingArrayType.elementType) ? evolvingArrayType : getEvolvingArrayType(getUnionType([evolvingArrayType.elementType, elementType])); } function createFinalArrayType(elementType) { @@ -28532,8 +32030,8 @@ var ts; } function isEvolvingArrayTypeList(types) { var hasEvolvingArrayType = false; - for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { - var t = types_12[_i]; + for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { + var t = types_16[_i]; if (!(t.flags & 8192)) { if (!(getObjectFlags(t) & 256)) { return false; @@ -28551,11 +32049,11 @@ var ts; function isEvolvingArrayOperationTarget(node) { var root = getReferenceRoot(node); var parent = root.parent; - var isLengthPushOrUnshift = parent.kind === 177 && (parent.name.text === "length" || - parent.parent.kind === 179 && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 178 && + var isLengthPushOrUnshift = parent.kind === 178 && (parent.name.text === "length" || + parent.parent.kind === 180 && ts.isPushOrUnshiftIdentifier(parent.name)); + var isElementAssignment = parent.kind === 179 && parent.expression === root && - parent.parent.kind === 192 && + parent.parent.kind === 193 && parent.parent.operatorToken.kind === 57 && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -28582,19 +32080,17 @@ var ts; } return false; } - function getFlowTypeOfReference(reference, declaredType, assumeInitialized, flowContainer) { + function getFlowTypeOfReference(reference, declaredType, initialType, flowContainer, couldBeUninitialized) { + if (initialType === void 0) { initialType = declaredType; } var key; - if (!reference.flowNode || assumeInitialized && !(declaredType.flags & 1033215)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 17810431)) { return declaredType; } - var initialType = assumeInitialized ? declaredType : - declaredType === autoType || declaredType === autoArrayType ? undefinedType : - includeFalsyTypes(declaredType, 2048); var visitedFlowStart = visitedFlowCount; var evolvedType = getTypeFromFlowType(getTypeAtFlowNode(reference.flowNode)); visitedFlowCount = visitedFlowStart; var resultType = getObjectFlags(evolvedType) & 256 && isEvolvingArrayOperationTarget(reference) ? anyArrayType : finalizeEvolvingArrayType(evolvedType); - if (reference.parent.kind === 201 && getTypeWithFacts(resultType, 524288).flags & 8192) { + if (reference.parent.kind === 202 && getTypeWithFacts(resultType, 524288).flags & 8192) { return declaredType; } return resultType; @@ -28608,7 +32104,16 @@ var ts; } } var type = void 0; - if (flow.flags & 16) { + if (flow.flags & 4096) { + flow.locked = true; + type = getTypeAtFlowNode(flow.antecedent); + flow.locked = false; + } + else if (flow.flags & 2048) { + flow = flow.antecedent; + continue; + } + else if (flow.flags & 16) { type = getTypeAtFlowAssignment(flow); if (!type) { flow = flow.antecedent; @@ -28639,7 +32144,7 @@ var ts; } else if (flow.flags & 2) { var container = flow.container; - if (container && container !== flowContainer && reference.kind !== 177) { + if (container && container !== flowContainer && reference.kind !== 178 && reference.kind !== 98) { flow = container.flowNode; continue; } @@ -28682,7 +32187,7 @@ var ts; } function getTypeAtFlowArrayMutation(flow) { var node = flow.node; - var expr = node.kind === 179 ? + var expr = node.kind === 180 ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -28690,7 +32195,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (getObjectFlags(type) & 256) { var evolvedType_1 = type; - if (node.kind === 179) { + if (node.kind === 180) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -28742,6 +32247,9 @@ var ts; var seenIncomplete = false; for (var _i = 0, _a = flow.antecedents; _i < _a.length; _i++) { var antecedent = _a[_i]; + if (antecedent.flags & 2048 && antecedent.lock.locked) { + continue; + } var flowType = getTypeAtFlowNode(antecedent); var type = getTypeFromFlowType(flowType); if (type === declaredType && declaredType === initialType) { @@ -28765,8 +32273,9 @@ var ts; if (!key) { key = getFlowCacheKey(reference); } - if (cache[key]) { - return cache[key]; + var cached = cache.get(key); + if (cached) { + return cached; } for (var i = flowLoopStart; i < flowLoopCount; i++) { if (flowLoopNodes[i] === flow && flowLoopKeys[i] === key && flowLoopTypes[i].length) { @@ -28788,8 +32297,9 @@ var ts; firstAntecedentType = flowType; } var type = getTypeFromFlowType(flowType); - if (cache[key]) { - return cache[key]; + var cached_1 = cache.get(key); + if (cached_1) { + return cached_1; } if (!ts.contains(antecedentTypes, type)) { antecedentTypes.push(type); @@ -28805,10 +32315,11 @@ var ts; if (isIncomplete(firstAntecedentType)) { return createFlowType(result, true); } - return cache[key] = result; + cache.set(key, result); + return result; } function isMatchingReferenceDiscriminant(expr) { - return expr.kind === 177 && + return expr.kind === 178 && declaredType.flags & 65536 && isMatchingReference(reference, expr.expression) && isDiscriminantProperty(declaredType, expr.name.text); @@ -28842,10 +32353,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 187 && right_1.kind === 9) { + if (left_1.kind === 188 && right_1.kind === 9) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 187 && left_1.kind === 9) { + if (right_1.kind === 188 && left_1.kind === 9) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (isMatchingReference(reference, left_1)) { @@ -28891,7 +32402,7 @@ var ts; assumeTrue ? 16384 : 131072; return getTypeWithFacts(type, facts); } - if (type.flags & 33281) { + if (type.flags & 16810497) { return type; } if (assumeTrue) { @@ -28916,14 +32427,22 @@ var ts; assumeTrue = !assumeTrue; } if (assumeTrue && !(type.flags & 65536)) { - var targetType = typeofTypesByName[literal.text]; - if (targetType && isTypeSubtypeOf(targetType, type)) { - return targetType; + var targetType = typeofTypesByName.get(literal.text); + if (targetType) { + if (isTypeSubtypeOf(targetType, type)) { + return targetType; + } + if (type.flags & 540672) { + var constraint = getBaseConstraintOfType(type) || anyType; + if (isTypeSubtypeOf(targetType, constraint)) { + return getIntersectionType([type, targetType]); + } + } } } var facts = assumeTrue ? - typeofEQFacts[literal.text] || 64 : - typeofNEFacts[literal.text] || 8192; + typeofEQFacts.get(literal.text) || 64 : + typeofNEFacts.get(literal.text) || 8192; return getTypeWithFacts(type, facts); } function narrowTypeBySwitchOnDiscriminant(type, switchStatement, clauseStart, clauseEnd) { @@ -28992,10 +32511,9 @@ var ts; return assignableType; } } - var targetType = type.flags & 16384 ? getApparentType(type) : type; return isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : - isTypeAssignableTo(candidate, targetType) ? candidate : + isTypeAssignableTo(candidate, type) ? candidate : getIntersectionType([type, candidate]); } function narrowTypeByTypePredicate(type, callExpression, assumeTrue) { @@ -29023,7 +32541,7 @@ var ts; } else { var invokedExpression = ts.skipParentheses(callExpression.expression); - if (invokedExpression.kind === 178 || invokedExpression.kind === 177) { + if (invokedExpression.kind === 179 || invokedExpression.kind === 178) { var accessExpression = invokedExpression; var possibleReference = ts.skipParentheses(accessExpression.expression); if (isMatchingReference(reference, possibleReference)) { @@ -29040,15 +32558,16 @@ var ts; switch (expr.kind) { case 70: case 98: - case 177: + case 96: + case 178: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 179: + case 180: return narrowTypeByTypePredicate(type, expr, assumeTrue); - case 183: + case 184: return narrowType(type, expr.expression, assumeTrue); - case 192: + case 193: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 190: + case 191: if (expr.operator === 50) { return narrowType(type, expr.operand, !assumeTrue); } @@ -29072,15 +32591,12 @@ var ts; return getTypeOfSymbol(symbol); } function getControlFlowContainer(node) { - while (true) { - node = node.parent; - if (ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 231 || - node.kind === 261 || - node.kind === 147) { - return node; - } - } + return ts.findAncestor(node.parent, function (node) { + return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || + node.kind === 233 || + node.kind === 264 || + node.kind === 148; + }); } function isParameterAssigned(symbol) { var func = ts.getRootDeclaration(symbol.valueDeclaration).parent; @@ -29094,21 +32610,13 @@ var ts; return symbol.isAssigned || false; } function hasParentWithAssignmentsMarked(node) { - while (true) { - node = node.parent; - if (!node) { - return false; - } - if (ts.isFunctionLike(node) && getNodeLinks(node).flags & 4194304) { - return true; - } - } + return !!ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !!(getNodeLinks(node).flags & 4194304); }); } function markParameterAssignments(node) { if (node.kind === 70) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 144) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 145) { symbol.isAssigned = true; } } @@ -29120,6 +32628,14 @@ var ts; function isConstVariable(symbol) { return symbol.flags & 3 && (getDeclarationNodeFlagsFromSymbol(symbol) & 2) !== 0 && getTypeOfSymbol(symbol) !== autoArrayType; } + function removeOptionalityFromDeclaredType(declaredType, declaration) { + var annotationIncludesUndefined = strictNullChecks && + declaration.kind === 145 && + declaration.initializer && + getFalsyFlags(declaredType) & 2048 && + !(getFalsyFlags(checkExpression(declaration.initializer)) & 2048); + return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 131072) : declaredType; + } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); if (symbol === unknownSymbol) { @@ -29128,16 +32644,14 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2) { - if (container.kind === 185) { + if (container.kind === 186) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasModifier(container, 256)) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method); } } - if (node.flags & 524288) { - getNodeLinks(container).flags |= 8192; - } + getNodeLinks(container).flags |= 8192; return getTypeOfSymbol(symbol); } if (symbol.flags & 8388608 && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { @@ -29146,7 +32660,7 @@ var ts; var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); if (localOrExportSymbol.flags & 32) { var declaration_1 = localOrExportSymbol.valueDeclaration; - if (declaration_1.kind === 226 + if (declaration_1.kind === 228 && ts.nodeIsDecorated(declaration_1)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -29158,11 +32672,11 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration_1.kind === 197) { + else if (declaration_1.kind === 198) { var container = ts.getThisContainer(node, false); while (container !== undefined) { if (container.parent === declaration_1) { - if (container.kind === 147 && ts.hasModifier(container, 32)) { + if (container.kind === 148 && ts.hasModifier(container, 32)) { getNodeLinks(declaration_1).flags |= 8388608; getNodeLinks(node).flags |= 16777216; } @@ -29174,6 +32688,7 @@ var ts; } checkCollisionWithCapturedSuperVariable(node, node); checkCollisionWithCapturedThisVariable(node, node); + checkCollisionWithCapturedNewTargetVariable(node, node); checkNestedBlockScopedBinding(node, symbol); var type = getTypeOfSymbol(localOrExportSymbol); var declaration = localOrExportSymbol.valueDeclaration; @@ -29191,22 +32706,25 @@ var ts; if (!(localOrExportSymbol.flags & 3) || assignmentKind === 1 || !declaration) { return type; } - var isParameter = ts.getRootDeclaration(declaration).kind === 144; + var isParameter = ts.getRootDeclaration(declaration).kind === 145; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; - while (flowContainer !== declarationContainer && (flowContainer.kind === 184 || - flowContainer.kind === 185 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 185 || + flowContainer.kind === 186 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } var assumeInitialized = isParameter || isOuterVariable || - type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1) !== 0) || + type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1) !== 0 || isInTypeQuery(node)) || ts.isInAmbientContext(declaration); - var flowType = getFlowTypeOfReference(node, type, assumeInitialized, flowContainer); + var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, ts.getRootDeclaration(declaration)) : type) : + type === autoType || type === autoArrayType ? undefinedType : + includeFalsyTypes(type, 2048); + var flowType = getFlowTypeOfReference(node, type, initialType, flowContainer, !assumeInitialized); if (type === autoType || type === autoArrayType) { if (flowType === autoType || flowType === autoArrayType) { - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { error(declaration.name, ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined, symbolToString(symbol), typeToString(flowType)); error(node, ts.Diagnostics.Variable_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType)); } @@ -29220,19 +32738,12 @@ var ts; return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType; } function isInsideFunction(node, threshold) { - var current = node; - while (current && current !== threshold) { - if (ts.isFunctionLike(current)) { - return true; - } - current = current.parent; - } - return false; + return !!ts.findAncestor(node, function (n) { return n === threshold ? "quit" : ts.isFunctionLike(n); }); } function checkNestedBlockScopedBinding(node, symbol) { if (languageVersion >= 2 || (symbol.flags & (2 | 32)) === 0 || - symbol.valueDeclaration.parent.kind === 256) { + symbol.valueDeclaration.parent.kind === 259) { return; } var container = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); @@ -29250,8 +32761,8 @@ var ts; if (usedInFunction) { getNodeLinks(current).flags |= 65536; } - if (container.kind === 211 && - ts.getAncestor(symbol.valueDeclaration, 224).parent === container && + if (container.kind === 213 && + ts.getAncestor(symbol.valueDeclaration, 226).parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 2097152; } @@ -29263,33 +32774,25 @@ var ts; } function isAssignedInBodyOfForStatement(node, container) { var current = node; - while (current.parent.kind === 183) { + while (current.parent.kind === 184) { current = current.parent; } var isAssigned = false; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 190 || current.parent.kind === 191)) { + else if ((current.parent.kind === 191 || current.parent.kind === 192)) { var expr = current.parent; isAssigned = expr.operator === 42 || expr.operator === 43; } if (!isAssigned) { return false; } - while (current !== container) { - if (current === container.statement) { - return true; - } - else { - current = current.parent; - } - } - return false; + return !!ts.findAncestor(current, function (n) { return n === container ? "quit" : n === container.statement; }); } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2; - if (container.kind === 147 || container.kind === 150) { + if (container.kind === 148 || container.kind === 151) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4; } @@ -29320,42 +32823,45 @@ var ts; var baseConstructorType = getBaseConstructorTypeOfClass(classInstanceType); return baseConstructorType === nullWideningType; } + function checkThisBeforeSuper(node, container, diagnosticMessage) { + var containingClassDecl = container.parent; + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(containingClassDecl); + if (baseTypeNode && !classDeclarationExtendsNull(containingClassDecl)) { + var superCall = getSuperCallInConstructor(container); + if (!superCall || superCall.end > node.pos) { + error(node, diagnosticMessage); + } + } + } function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 150) { - var containingClassDecl = container.parent; - var baseTypeNode = ts.getClassExtendsHeritageClauseElement(containingClassDecl); - if (baseTypeNode && !classDeclarationExtendsNull(containingClassDecl)) { - var superCall = getSuperCallInConstructor(container); - if (!superCall || superCall.end > node.pos) { - error(node, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); - } - } + if (container.kind === 151) { + checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } - if (container.kind === 185) { + if (container.kind === 186) { container = ts.getThisContainer(container, false); needToCaptureLexicalThis = (languageVersion < 2); } switch (container.kind) { - case 230: + case 232: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); break; - case 229: + case 231: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 150: + case 151: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; + case 148: case 147: - case 146: if (ts.getModifierFlags(container) & 32) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; - case 142: + case 143: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -29364,8 +32870,8 @@ var ts; } if (ts.isFunctionLike(container) && (!isInParameterInitializerBeforeContainingFunction(node) || ts.getThisParameter(container))) { - if (container.kind === 184 && - ts.isInJavaScriptFile(container.parent) && + if (container.kind === 185 && + container.parent.kind === 193 && ts.getSpecialPropertyAssignmentKind(container.parent) === 3) { var className = container.parent .left @@ -29384,7 +32890,7 @@ var ts; if (ts.isClassLike(container.parent)) { var symbol = getSymbolOfNode(container.parent); var type = ts.hasModifier(container, 32) ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType; - return getFlowTypeOfReference(node, type, true, undefined); + return getFlowTypeOfReference(node, type); } if (ts.isInJavaScriptFile(node)) { var type = getTypeForThisExpressionFromJSDoc(container); @@ -29392,34 +32898,29 @@ var ts; return type; } } - if (compilerOptions.noImplicitThis) { + if (noImplicitThis) { error(node, ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation); } return anyType; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 274) { + if (jsdocType && jsdocType.kind === 278) { var jsDocFunctionType = jsdocType; - if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].type.kind === 277) { + if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].type.kind === 281) { return getTypeFromTypeNode(jsDocFunctionType.parameters[0].type); } } } function isInConstructorArgumentInitializer(node, constructorDecl) { - for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 144) { - return true; - } - } - return false; + return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 145; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 179 && node.parent.expression === node; + var isCallExpression = node.parent.kind === 180 && node.parent.expression === node; var container = ts.getSuperContainer(node, true); var needToCaptureLexicalThis = false; if (!isCallExpression) { - while (container && container.kind === 185) { + while (container && container.kind === 186) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = languageVersion < 2; } @@ -29427,17 +32928,14 @@ var ts; var canUseSuperExpression = isLegalUsageOfSuperExpression(container); var nodeCheckFlag = 0; if (!canUseSuperExpression) { - var current = node; - while (current && current !== container && current.kind !== 142) { - current = current.parent; - } - if (current && current.kind === 142) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 143; }); + if (current && current.kind === 143) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 176)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 177)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -29445,6 +32943,9 @@ var ts; } return unknownType; } + if (!isCallExpression && container.kind === 151) { + checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); + } if ((ts.getModifierFlags(container) & 32) || isCallExpression) { nodeCheckFlag = 512; } @@ -29452,7 +32953,7 @@ var ts; nodeCheckFlag = 256; } getNodeLinks(node).flags |= nodeCheckFlag; - if (container.kind === 149 && ts.getModifierFlags(container) & 256) { + if (container.kind === 150 && ts.getModifierFlags(container) & 256) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096; } @@ -29463,7 +32964,7 @@ var ts; if (needToCaptureLexicalThis) { captureLexicalThis(node.parent, container); } - if (container.parent.kind === 176) { + if (container.parent.kind === 177) { if (languageVersion < 2) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return unknownType; @@ -29481,7 +32982,7 @@ var ts; } return unknownType; } - if (container.kind === 150 && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 151 && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return unknownType; } @@ -29493,32 +32994,50 @@ var ts; return false; } if (isCallExpression) { - return container.kind === 150; + return container.kind === 151; } else { - if (ts.isClassLike(container.parent) || container.parent.kind === 176) { + if (ts.isClassLike(container.parent) || container.parent.kind === 177) { if (ts.getModifierFlags(container) & 32) { - return container.kind === 149 || - container.kind === 148 || - container.kind === 151 || - container.kind === 152; + return container.kind === 150 || + container.kind === 149 || + container.kind === 152 || + container.kind === 153; } else { - return container.kind === 149 || - container.kind === 148 || - container.kind === 151 || + return container.kind === 150 || + container.kind === 149 || container.kind === 152 || + container.kind === 153 || + container.kind === 148 || container.kind === 147 || - container.kind === 146 || - container.kind === 150; + container.kind === 151; } } } return false; } } + function getContainingObjectLiteral(func) { + return (func.kind === 150 || + func.kind === 152 || + func.kind === 153) && func.parent.kind === 177 ? func.parent : + func.kind === 185 && func.parent.kind === 260 ? func.parent.parent : + undefined; + } + function getThisTypeArgument(type) { + return getObjectFlags(type) & 4 && type.target === globalThisType ? type.typeArguments[0] : undefined; + } + function getThisTypeFromContextualType(type) { + return mapType(type, function (t) { + return t.flags & 131072 ? ts.forEach(t.types, getThisTypeArgument) : getThisTypeArgument(t); + }); + } function getContextualThisParameterType(func) { - if (isContextSensitiveFunctionOrObjectLiteralMethod(func) && func.kind !== 185) { + if (func.kind === 186) { + return undefined; + } + if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { var contextualSignature = getContextualSignature(func); if (contextualSignature) { var thisParameter = contextualSignature.thisParameter; @@ -29527,29 +33046,55 @@ var ts; } } } + if (noImplicitThis) { + var containingLiteral = getContainingObjectLiteral(func); + if (containingLiteral) { + var contextualType = getApparentTypeOfContextualType(containingLiteral); + var literal = containingLiteral; + var type = contextualType; + while (type) { + var thisType = getThisTypeFromContextualType(type); + if (thisType) { + return instantiateType(thisType, getContextualMapper(containingLiteral)); + } + if (literal.parent.kind !== 260) { + break; + } + literal = literal.parent.parent; + type = getApparentTypeOfContextualType(literal); + } + return contextualType ? getNonNullableType(contextualType) : checkExpressionCached(containingLiteral); + } + if (func.parent.kind === 193 && func.parent.operatorToken.kind === 57) { + var target = func.parent.left; + if (target.kind === 178 || target.kind === 179) { + return checkExpressionCached(target.expression); + } + } + } return undefined; } function getContextuallyTypedParameterType(parameter) { var func = parameter.parent; if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { var iife = ts.getImmediatelyInvokedFunctionExpression(func); - if (iife) { + if (iife && iife.arguments) { var indexOfParameter = ts.indexOf(func.parameters, parameter); - if (iife.arguments && indexOfParameter < iife.arguments.length) { - if (parameter.dotDotDotToken) { - var restTypes = []; - for (var i = indexOfParameter; i < iife.arguments.length; i++) { - restTypes.push(getWidenedLiteralType(checkExpression(iife.arguments[i]))); - } - return createArrayType(getUnionType(restTypes)); + if (parameter.dotDotDotToken) { + var restTypes = []; + for (var i = indexOfParameter; i < iife.arguments.length; i++) { + restTypes.push(getWidenedLiteralType(checkExpression(iife.arguments[i]))); } - var links = getNodeLinks(iife); - var cached = links.resolvedSignature; - links.resolvedSignature = anySignature; - var type = getWidenedLiteralType(checkExpression(iife.arguments[indexOfParameter])); - links.resolvedSignature = cached; - return type; + return restTypes.length ? createArrayType(getUnionType(restTypes)) : undefined; } + var links = getNodeLinks(iife); + var cached = links.resolvedSignature; + links.resolvedSignature = anySignature; + var type = indexOfParameter < iife.arguments.length ? + getWidenedLiteralType(checkExpression(iife.arguments[indexOfParameter])) : + parameter.initializer ? undefined : undefinedWideningType; + links.resolvedSignature = cached; + return type; } var contextualSignature = getContextualSignature(func); if (contextualSignature) { @@ -29574,7 +33119,7 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 144) { + if (declaration.kind === 145) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -29585,11 +33130,11 @@ var ts; } if (ts.isBindingPattern(declaration.parent)) { var parentDeclaration = declaration.parent.parent; - var name_21 = declaration.propertyName || declaration.name; - if (ts.isVariableLike(parentDeclaration) && + var name = declaration.propertyName || declaration.name; + if (parentDeclaration.kind !== 175 && parentDeclaration.type && - !ts.isBindingPattern(name_21)) { - var text = ts.getTextOfPropertyName(name_21); + !ts.isBindingPattern(name)) { + var text = ts.getTextOfPropertyName(name); if (text) { return getTypeOfPropertyOfType(getTypeFromTypeNode(parentDeclaration.type), text); } @@ -29600,33 +33145,34 @@ var ts; } function getContextualTypeForReturnExpression(node) { var func = ts.getContainingFunction(node); - if (ts.isAsyncFunctionLike(func)) { - var contextualReturnType = getContextualReturnType(func); - if (contextualReturnType) { - return getPromisedType(contextualReturnType); + if (func) { + var functionFlags = ts.getFunctionFlags(func); + if (functionFlags & 1) { + return undefined; } - return undefined; - } - if (func && !func.asteriskToken) { - return getContextualReturnType(func); + var contextualReturnType = getContextualReturnType(func); + return functionFlags & 2 + ? contextualReturnType && getAwaitedTypeOfPromise(contextualReturnType) + : contextualReturnType; } return undefined; } function getContextualTypeForYieldOperand(node) { var func = ts.getContainingFunction(node); if (func) { + var functionFlags = ts.getFunctionFlags(func); var contextualReturnType = getContextualReturnType(func); if (contextualReturnType) { return node.asteriskToken ? contextualReturnType - : getElementTypeOfIterableIterator(contextualReturnType); + : getIteratedTypeOfGenerator(contextualReturnType, (functionFlags & 2) !== 0); } } return undefined; } function isInParameterInitializerBeforeContainingFunction(node) { while (node.parent && !ts.isFunctionLike(node.parent)) { - if (node.parent.kind === 144 && node.parent.initializer === node) { + if (node.parent.kind === 145 && node.parent.initializer === node) { return true; } node = node.parent; @@ -29635,8 +33181,8 @@ var ts; } function getContextualReturnType(functionDecl) { if (functionDecl.type || - functionDecl.kind === 150 || - functionDecl.kind === 151 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 152))) { + functionDecl.kind === 151 || + functionDecl.kind === 152 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 153))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl)); } var signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl); @@ -29655,7 +33201,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 181) { + if (template.parent.kind === 182) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -29685,38 +33231,14 @@ var ts; } return undefined; } - function applyToContextualType(type, mapper) { - if (!(type.flags & 65536)) { - return mapper(type); - } - var types = type.types; - var mappedType; - var mappedTypes; - for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { - var current = types_13[_i]; - var t = mapper(current); - if (t) { - if (!mappedType) { - mappedType = t; - } - else if (!mappedTypes) { - mappedTypes = [mappedType, t]; - } - else { - mappedTypes.push(t); - } - } - } - return mappedTypes ? getUnionType(mappedTypes) : mappedType; - } function getTypeOfPropertyOfContextualType(type, name) { - return applyToContextualType(type, function (t) { + return mapType(type, function (t) { var prop = t.flags & 229376 ? getPropertyOfType(t, name) : undefined; return prop ? getTypeOfSymbol(prop) : undefined; }); } function getIndexTypeOfContextualType(type, kind) { - return applyToContextualType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }); + return mapType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }); } function contextualTypeIsTupleLikeType(type) { return !!(type.flags & 65536 ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type)); @@ -29751,7 +33273,7 @@ var ts; var index = ts.indexOf(arrayLiteral.elements, node); return getTypeOfPropertyOfContextualType(type, "" + index) || getIndexTypeOfContextualType(type, 1) - || (languageVersion >= 2 ? getElementTypeOfIterable(type, undefined) : undefined); + || getIteratedTypeOrElementType(type, undefined, false, false, false); } return undefined; } @@ -29760,19 +33282,16 @@ var ts; return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; } function getContextualTypeForJsxAttribute(attribute) { - var kind = attribute.kind; - var jsxElement = attribute.parent; - var attrsType = getJsxElementAttributesType(jsxElement); - if (attribute.kind === 250) { - if (!attrsType || isTypeAny(attrsType)) { + var attributesType = getContextualType(attribute.parent); + if (ts.isJsxAttribute(attribute)) { + if (!attributesType || isTypeAny(attributesType)) { return undefined; } - return getTypeOfPropertyOfType(attrsType, attribute.name.text); + return getTypeOfPropertyOfType(attributesType, attribute.name.text); } - else if (attribute.kind === 251) { - return attrsType; + else { + return attributesType; } - ts.Debug.fail("Expected JsxAttribute or JsxSpreadAttribute, got ts.SyntaxKind[" + kind + "]"); } function getApparentTypeOfContextualType(node) { var type = getContextualType(node); @@ -29787,45 +33306,52 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 223: - case 144: + case 225: + case 145: + case 148: case 147: - case 146: - case 174: - return getContextualTypeForInitializerExpression(node); - case 185: - case 216: - return getContextualTypeForReturnExpression(node); - case 195: - return getContextualTypeForYieldOperand(parent); - case 179: - case 180: - return getContextualTypeForArgument(parent, node); - case 182: - case 200: - return getTypeFromTypeNode(parent.type); - case 192: - return getContextualTypeForBinaryOperand(node); - case 257: - case 258: - return getContextualTypeForObjectLiteralElement(parent); case 175: - return getContextualTypeForElementExpression(node); - case 193: - return getContextualTypeForConditionalOperand(node); - case 202: - ts.Debug.assert(parent.parent.kind === 194); - return getContextualTypeForSubstitutionExpression(parent.parent, node); + return getContextualTypeForInitializerExpression(node); + case 186: + case 218: + return getContextualTypeForReturnExpression(node); + case 196: + return getContextualTypeForYieldOperand(parent); + case 180: + case 181: + return getContextualTypeForArgument(parent, node); case 183: + case 201: + return getTypeFromTypeNode(parent.type); + case 193: + return getContextualTypeForBinaryOperand(node); + case 260: + case 261: + return getContextualTypeForObjectLiteralElement(parent); + case 176: + return getContextualTypeForElementExpression(node); + case 194: + return getContextualTypeForConditionalOperand(node); + case 204: + ts.Debug.assert(parent.parent.kind === 195); + return getContextualTypeForSubstitutionExpression(parent.parent, node); + case 184: + return getContextualType(parent); + case 255: return getContextualType(parent); case 252: - return getContextualType(parent); - case 250: - case 251: + case 254: return getContextualTypeForJsxAttribute(parent); + case 250: + case 249: + return getAttributesTypeFromJsxOpeningLikeElement(parent); } return undefined; } + function getContextualMapper(node) { + node = ts.findAncestor(node, function (n) { return !!n.contextualMapper; }); + return node ? node.contextualMapper : identityMapper; + } function getNonGenericSignature(type, node) { var signatures = getSignaturesOfStructuredType(type, 0); if (signatures.length === 1) { @@ -29850,7 +33376,7 @@ var ts; return sourceLength < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 184 || node.kind === 185; + return node.kind === 185 || node.kind === 186; } function getContextualSignatureForFunctionLikeDeclaration(node) { return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node) @@ -29863,7 +33389,7 @@ var ts; getApparentTypeOfContextualType(node); } function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 149 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 150 || ts.isObjectLiteralMethod(node)); var type = getContextualTypeForFunctionLikeDeclaration(node); if (!type) { return undefined; @@ -29873,8 +33399,8 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { - var current = types_14[_i]; + for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { + var current = types_17[_i]; var signature = getNonGenericSignature(current, node); if (signature) { if (!signatureList) { @@ -29896,37 +33422,37 @@ var ts; } return result; } - function isInferentialContext(mapper) { - return mapper && mapper.context; - } - function checkSpreadExpression(node, contextualMapper) { - var arrayOrIterableType = checkExpressionCached(node.expression, contextualMapper); - return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, false); + function checkSpreadExpression(node, checkMode) { + if (languageVersion < 2 && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 1536); + } + var arrayOrIterableType = checkExpression(node.expression, checkMode); + return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, false, false); } function hasDefaultValue(node) { - return (node.kind === 174 && !!node.initializer) || - (node.kind === 192 && node.operatorToken.kind === 57); + return (node.kind === 175 && !!node.initializer) || + (node.kind === 193 && node.operatorToken.kind === 57); } - function checkArrayLiteral(node, contextualMapper) { + function checkArrayLiteral(node, checkMode) { var elements = node.elements; var hasSpreadElement = false; var elementTypes = []; var inDestructuringPattern = ts.isAssignmentTarget(node); for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) { var e = elements_1[_i]; - if (inDestructuringPattern && e.kind === 196) { - var restArrayType = checkExpression(e.expression, contextualMapper); + if (inDestructuringPattern && e.kind === 197) { + var restArrayType = checkExpression(e.expression, checkMode); var restElementType = getIndexTypeOfType(restArrayType, 1) || - (languageVersion >= 2 ? getElementTypeOfIterable(restArrayType, undefined) : undefined); + getIteratedTypeOrElementType(restArrayType, undefined, false, false, false); if (restElementType) { elementTypes.push(restElementType); } } else { - var type = checkExpressionForMutableLocation(e, contextualMapper); + var type = checkExpressionForMutableLocation(e, checkMode); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 196; + hasSpreadElement = hasSpreadElement || e.kind === 197; } if (!hasSpreadElement) { if (inDestructuringPattern && elementTypes.length) { @@ -29937,7 +33463,7 @@ var ts; var contextualType = getApparentTypeOfContextualType(node); if (contextualType && contextualTypeIsTupleLikeType(contextualType)) { var pattern = contextualType.pattern; - if (pattern && (pattern.kind === 173 || pattern.kind === 175)) { + if (pattern && (pattern.kind === 174 || pattern.kind === 176)) { var patternElements = pattern.elements; for (var i = elementTypes.length; i < patternElements.length; i++) { var patternElement = patternElements[i]; @@ -29945,7 +33471,7 @@ var ts; elementTypes.push(contextualType.typeArguments[i]); } else { - if (patternElement.kind !== 198) { + if (patternElement.kind !== 199) { error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } elementTypes.push(unknownType); @@ -29962,7 +33488,7 @@ var ts; strictNullChecks ? neverType : undefinedWideningType); } function isNumericName(name) { - return name.kind === 142 ? isNumericComputedName(name) : isNumericLiteralName(name.text); + return name.kind === 143 ? isNumericComputedName(name) : isNumericLiteralName(name.text); } function isNumericComputedName(name) { return isTypeAnyOrAllConstituentTypesHaveKind(checkComputedPropertyName(name), 340); @@ -29999,7 +33525,7 @@ var ts; var unionType = propTypes.length ? getUnionType(propTypes, true) : undefinedType; return createIndexInfo(unionType, false); } - function checkObjectLiteral(node, contextualMapper) { + function checkObjectLiteral(node, checkMode) { var inDestructuringPattern = ts.isAssignmentTarget(node); checkGrammarObjectLiteralExpression(node, inDestructuringPattern); var propertiesTable = ts.createMap(); @@ -30008,7 +33534,8 @@ var ts; var propagatedFlags = 0; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 172 || contextualType.pattern.kind === 176); + (contextualType.pattern.kind === 173 || contextualType.pattern.kind === 177); + var isJSObjectLiteral = !contextualType && ts.isInJavaScriptFile(node); var typeFlags = 0; var patternWithComputedProperties = false; var hasComputedStringProperty = false; @@ -30017,27 +33544,27 @@ var ts; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = memberDecl.symbol; - if (memberDecl.kind === 257 || - memberDecl.kind === 258 || + if (memberDecl.kind === 260 || + memberDecl.kind === 261 || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 257) { - type = checkPropertyAssignment(memberDecl, contextualMapper); + if (memberDecl.kind === 260) { + type = checkPropertyAssignment(memberDecl, checkMode); } - else if (memberDecl.kind === 149) { - type = checkObjectLiteralMethod(memberDecl, contextualMapper); + else if (memberDecl.kind === 150) { + type = checkObjectLiteralMethod(memberDecl, checkMode); } else { - ts.Debug.assert(memberDecl.kind === 258); - type = checkExpressionForMutableLocation(memberDecl.name, contextualMapper); + ts.Debug.assert(memberDecl.kind === 261); + type = checkExpressionForMutableLocation(memberDecl.name, checkMode); } typeFlags |= type.flags; - var prop = createSymbol(4 | 67108864 | member.flags, member.name); + var prop = createSymbol(4 | member.flags, member.name); if (inDestructuringPattern) { - var isOptional = (memberDecl.kind === 257 && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 258 && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 260 && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 261 && memberDecl.objectAssignmentInitializer); if (isOptional) { - prop.flags |= 536870912; + prop.flags |= 67108864; } if (ts.hasDynamicName(memberDecl)) { patternWithComputedProperties = true; @@ -30046,9 +33573,9 @@ var ts; else if (contextualTypeHasPattern && !(getObjectFlags(contextualType) & 512)) { var impliedProp = getPropertyOfType(contextualType, member.name); if (impliedProp) { - prop.flags |= impliedProp.flags & 536870912; + prop.flags |= impliedProp.flags & 67108864; } - else if (!compilerOptions.suppressExcessPropertyErrors) { + else if (!compilerOptions.suppressExcessPropertyErrors && !getIndexInfoOfType(contextualType, 0)) { error(memberDecl.name, ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(member), typeToString(contextualType)); } } @@ -30061,9 +33588,12 @@ var ts; prop.target = member; member = prop; } - else if (memberDecl.kind === 259) { + else if (memberDecl.kind === 262) { + if (languageVersion < 2) { + checkExternalEmitHelpers(memberDecl, 2); + } if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), true); + spread = getSpreadType(spread, createObjectLiteralType()); propertiesArray = []; propertiesTable = ts.createMap(); hasComputedStringProperty = false; @@ -30071,17 +33601,17 @@ var ts; typeFlags = 0; } var type = checkExpression(memberDecl.expression); - if (!(type.flags & (32768 | 1))) { + if (!isValidSpreadType(type)) { error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); return unknownType; } - spread = getSpreadType(spread, type, false); + spread = getSpreadType(spread, type); offset = i + 1; continue; } else { - ts.Debug.assert(memberDecl.kind === 151 || memberDecl.kind === 152); - checkAccessorDeclaration(memberDecl); + ts.Debug.assert(memberDecl.kind === 152 || memberDecl.kind === 153); + checkNodeDeferred(memberDecl); } if (ts.hasDynamicName(memberDecl)) { if (isNumericName(memberDecl.name)) { @@ -30092,34 +33622,36 @@ var ts; } } else { - propertiesTable[member.name] = member; + propertiesTable.set(member.name, member); } propertiesArray.push(member); } if (contextualTypeHasPattern) { for (var _i = 0, _a = getPropertiesOfType(contextualType); _i < _a.length; _i++) { var prop = _a[_i]; - if (!propertiesTable[prop.name]) { - if (!(prop.flags & 536870912)) { + if (!propertiesTable.get(prop.name)) { + if (!(prop.flags & 67108864)) { error(prop.valueDeclaration || prop.bindingElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } - propertiesTable[prop.name] = prop; + propertiesTable.set(prop.name, prop); propertiesArray.push(prop); } } } if (spread !== emptyObjectType) { if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), true); + spread = getSpreadType(spread, createObjectLiteralType()); + } + if (spread.flags & 32768) { + spread.flags |= propagatedFlags; + spread.symbol = node.symbol; } - spread.flags |= propagatedFlags; - spread.symbol = node.symbol; return spread; } return createObjectLiteralType(); function createObjectLiteralType() { - var stringIndexInfo = hasComputedStringProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 0) : undefined; - var numberIndexInfo = hasComputedNumberProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 1) : undefined; + var stringIndexInfo = isJSObjectLiteral ? jsObjectLiteralIndexInfo : hasComputedStringProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 0) : undefined; + var numberIndexInfo = hasComputedNumberProperty && !isJSObjectLiteral ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 1) : undefined; var result = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo); var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 1048576; result.flags |= 4194304 | freshObjectLiteralFlag | (typeFlags & 14680064); @@ -30136,9 +33668,14 @@ var ts; return result; } } + function isValidSpreadType(type) { + return !!(type.flags & (1 | 4096 | 2048 | 16777216) || + type.flags & 32768 && !isGenericMappedType(type) || + type.flags & 196608 && !ts.forEach(type.types, function (t) { return !isValidSpreadType(t); })); + } function checkJsxSelfClosingElement(node) { checkJsxOpeningLikeElement(node); - return jsxElementType || anyType; + return getJsxGlobalElementType() || anyType; } function checkJsxElement(node) { checkJsxOpeningLikeElement(node.openingElement); @@ -30151,85 +33688,105 @@ var ts; for (var _i = 0, _a = node.children; _i < _a.length; _i++) { var child = _a[_i]; switch (child.kind) { - case 252: + case 255: checkJsxExpression(child); break; - case 246: + case 248: checkJsxElement(child); break; - case 247: + case 249: checkJsxSelfClosingElement(child); break; } } - return jsxElementType || anyType; + return getJsxGlobalElementType() || anyType; } function isUnhyphenatedJsxName(name) { return name.indexOf("-") < 0; } function isJsxIntrinsicIdentifier(tagName) { - if (tagName.kind === 177 || tagName.kind === 98) { + if (tagName.kind === 178 || tagName.kind === 98) { return false; } else { return ts.isIntrinsicJsxName(tagName.text); } } - function checkJsxAttribute(node, elementAttributesType, nameTable) { - var correspondingPropType = undefined; - if (elementAttributesType === emptyObjectType && isUnhyphenatedJsxName(node.name.text)) { - error(node.parent, ts.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, getJsxElementPropertiesName()); - } - else if (elementAttributesType && !isTypeAny(elementAttributesType)) { - var correspondingPropSymbol = getPropertyOfType(elementAttributesType, node.name.text); - correspondingPropType = correspondingPropSymbol && getTypeOfSymbol(correspondingPropSymbol); - if (isUnhyphenatedJsxName(node.name.text)) { - var attributeType = getTypeOfPropertyOfType(elementAttributesType, ts.getTextOfPropertyName(node.name)) || getIndexTypeOfType(elementAttributesType, 0); - if (attributeType) { - correspondingPropType = attributeType; + function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, filter, checkMode) { + var attributes = openingLikeElement.attributes; + var attributesTable = ts.createMap(); + var spread = emptyObjectType; + var attributesArray = []; + for (var _i = 0, _a = attributes.properties; _i < _a.length; _i++) { + var attributeDecl = _a[_i]; + var member = attributeDecl.symbol; + if (ts.isJsxAttribute(attributeDecl)) { + var exprType = attributeDecl.initializer ? + checkExpression(attributeDecl.initializer, checkMode) : + trueType; + var attributeSymbol = createSymbol(4 | 134217728 | member.flags, member.name); + attributeSymbol.declarations = member.declarations; + attributeSymbol.parent = member.parent; + if (member.valueDeclaration) { + attributeSymbol.valueDeclaration = member.valueDeclaration; } - else { - if (!correspondingPropType) { - error(node.name, ts.Diagnostics.Property_0_does_not_exist_on_type_1, node.name.text, typeToString(elementAttributesType)); - return unknownType; - } + attributeSymbol.type = exprType; + attributeSymbol.target = member; + attributesTable.set(attributeSymbol.name, attributeSymbol); + attributesArray.push(attributeSymbol); + } + else { + ts.Debug.assert(attributeDecl.kind === 254); + if (attributesArray.length > 0) { + spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable)); + attributesArray = []; + attributesTable = ts.createMap(); } + var exprType = checkExpression(attributeDecl.expression); + if (!isValidSpreadType(exprType)) { + error(attributeDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); + return anyType; + } + if (isTypeAny(exprType)) { + return anyType; + } + spread = getSpreadType(spread, exprType); } } - var exprType; - if (node.initializer) { - exprType = checkExpression(node.initializer); + if (spread !== emptyObjectType) { + if (attributesArray.length > 0) { + spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable)); + attributesArray = []; + attributesTable = ts.createMap(); + } + attributesArray = getPropertiesOfType(spread); } - else { - exprType = booleanType; + attributesTable = ts.createMap(); + if (attributesArray) { + ts.forEach(attributesArray, function (attr) { + if (!filter || filter(attr)) { + attributesTable.set(attr.name, attr); + } + }); } - if (correspondingPropType) { - checkTypeAssignableTo(exprType, correspondingPropType, node); + return createJsxAttributesType(attributes.symbol, attributesTable); + function createJsxAttributesType(symbol, attributesTable) { + var result = createAnonymousType(symbol, attributesTable, emptyArray, emptyArray, undefined, undefined); + var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 1048576; + result.flags |= 33554432 | 4194304 | freshObjectLiteralFlag; + result.objectFlags |= 128; + return result; } - nameTable[node.name.text] = true; - return exprType; } - function checkJsxSpreadAttribute(node, elementAttributesType, nameTable) { - var type = checkExpression(node.expression); - var props = getPropertiesOfType(type); - for (var _i = 0, props_2 = props; _i < props_2.length; _i++) { - var prop = props_2[_i]; - if (!nameTable[prop.name]) { - var targetPropSym = getPropertyOfType(elementAttributesType, prop.name); - if (targetPropSym) { - var msg = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property, prop.name); - checkTypeAssignableTo(getTypeOfSymbol(prop), getTypeOfSymbol(targetPropSym), node, undefined, msg); - } - nameTable[prop.name] = true; - } - } - return type; + function checkJsxAttributes(node, checkMode) { + return createJsxAttributesTypeFromAttributesProperty(node.parent, undefined, checkMode); } function getJsxType(name) { - if (jsxTypes[name] === undefined) { - return jsxTypes[name] = getExportedTypeFromNamespace(JsxNames.JSX, name) || unknownType; + var jsxType = jsxTypes.get(name); + if (jsxType === undefined) { + jsxTypes.set(name, jsxType = getExportedTypeFromNamespace(JsxNames.JSX, name) || unknownType); } - return jsxTypes[name]; + return jsxType; } function getIntrinsicTagSymbol(node) { var links = getNodeLinks(node); @@ -30250,7 +33807,7 @@ var ts; return links.resolvedSymbol = unknownSymbol; } else { - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { error(node, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists, JsxNames.IntrinsicElements); } return links.resolvedSymbol = unknownSymbol; @@ -30294,23 +33851,86 @@ var ts; return undefined; } } - function getResolvedJsxType(node, elemType, elemClassType) { - if (!elemType) { - elemType = checkExpression(node.tagName); + function defaultTryGetJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) { + ts.Debug.assert(!(elementType.flags & 65536)); + if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) { + var jsxStatelessElementType = getJsxGlobalStatelessElementType(); + if (jsxStatelessElementType) { + var callSignature = getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, undefined); + if (callSignature !== unknownSignature) { + var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); + var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); + if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) { + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttributes !== unknownType) { + paramType = intersectTypes(intrinsicAttributes, paramType); + } + return paramType; + } + } + } } - if (elemType.flags & 65536) { - var types = elemType.types; - return getUnionType(ts.map(types, function (type) { - return getResolvedJsxType(node, type, elemClassType); + return undefined; + } + function tryGetAllJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) { + ts.Debug.assert(!(elementType.flags & 65536)); + if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) { + var jsxStatelessElementType = getJsxGlobalStatelessElementType(); + if (jsxStatelessElementType) { + var candidatesOutArray = []; + getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, candidatesOutArray); + var result = void 0; + var allMatchingAttributesType = void 0; + for (var _i = 0, candidatesOutArray_1 = candidatesOutArray; _i < candidatesOutArray_1.length; _i++) { + var candidate = candidatesOutArray_1[_i]; + var callReturnType = getReturnTypeOfSignature(candidate); + var paramType = callReturnType && (candidate.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(candidate.parameters[0])); + if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) { + var shouldBeCandidate = true; + for (var _a = 0, _b = openingLikeElement.attributes.properties; _a < _b.length; _a++) { + var attribute = _b[_a]; + if (ts.isJsxAttribute(attribute) && + isUnhyphenatedJsxName(attribute.name.text) && + !getPropertyOfType(paramType, attribute.name.text)) { + shouldBeCandidate = false; + break; + } + } + if (shouldBeCandidate) { + result = intersectTypes(result, paramType); + } + allMatchingAttributesType = intersectTypes(allMatchingAttributesType, paramType); + } + } + if (!result) { + result = allMatchingAttributesType; + } + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttributes !== unknownType) { + result = intersectTypes(intrinsicAttributes, result); + } + return result; + } + } + return undefined; + } + function resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, elementType, elementClassType) { + if (!elementType) { + elementType = checkExpression(openingLikeElement.tagName); + } + if (elementType.flags & 65536) { + var types = elementType.types; + return getUnionType(types.map(function (type) { + return resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, type, elementClassType); }), true); } - if (elemType.flags & 2) { + if (elementType.flags & 2) { return anyType; } - else if (elemType.flags & 32) { + else if (elementType.flags & 32) { var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); if (intrinsicElementsType !== unknownType) { - var stringLiteralTypeName = elemType.text; + var stringLiteralTypeName = elementType.text; var intrinsicProp = getPropertyOfType(intrinsicElementsType, stringLiteralTypeName); if (intrinsicProp) { return getTypeOfSymbol(intrinsicProp); @@ -30319,28 +33939,19 @@ var ts; if (indexSignatureType) { return indexSignatureType; } - error(node, ts.Diagnostics.Property_0_does_not_exist_on_type_1, stringLiteralTypeName, "JSX." + JsxNames.IntrinsicElements); + error(openingLikeElement, ts.Diagnostics.Property_0_does_not_exist_on_type_1, stringLiteralTypeName, "JSX." + JsxNames.IntrinsicElements); } return anyType; } - var elemInstanceType = getJsxElementInstanceType(node, elemType); - if (!elemClassType || !isTypeAssignableTo(elemInstanceType, elemClassType)) { - if (jsxElementType) { - var callSignatures = elemType && getSignaturesOfType(elemType, 0); - var callSignature = callSignatures && callSignatures.length > 0 && callSignatures[0]; - var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); - var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); - if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType)) { - var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); - if (intrinsicAttributes !== unknownType) { - paramType = intersectTypes(intrinsicAttributes, paramType); - } - return paramType; - } - } + var elemInstanceType = getJsxElementInstanceType(openingLikeElement, elementType); + var statelessAttributesType = shouldIncludeAllStatelessAttributesType ? + tryGetAllJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) : + defaultTryGetJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType); + if (statelessAttributesType) { + return statelessAttributesType; } - if (elemClassType) { - checkTypeRelatedTo(elemInstanceType, elemClassType, assignableRelation, node, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); + if (elementClassType) { + checkTypeRelatedTo(elemInstanceType, elementClassType, assignableRelation, openingLikeElement, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); } if (isTypeAny(elemInstanceType)) { return elemInstanceType; @@ -30360,10 +33971,6 @@ var ts; else if (isTypeAny(attributesType) || (attributesType === unknownType)) { return attributesType; } - else if (attributesType.flags & 65536) { - error(node.tagName, ts.Diagnostics.JSX_element_attributes_type_0_may_not_be_a_union_type, typeToString(attributesType)); - return anyType; - } else { var apparentAttributesType = attributesType; var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes); @@ -30386,38 +33993,72 @@ var ts; } } } - function getJsxElementAttributesType(node) { + function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) { + ts.Debug.assert(isJsxIntrinsicIdentifier(node.tagName)); var links = getNodeLinks(node); - if (!links.resolvedJsxType) { - if (isJsxIntrinsicIdentifier(node.tagName)) { - var symbol = getIntrinsicTagSymbol(node); - if (links.jsxFlags & 1) { - return links.resolvedJsxType = getTypeOfSymbol(symbol); - } - else if (links.jsxFlags & 2) { - return links.resolvedJsxType = getIndexInfoOfSymbol(symbol, 0).type; - } - else { - return links.resolvedJsxType = unknownType; - } + if (!links.resolvedJsxElementAttributesType) { + var symbol = getIntrinsicTagSymbol(node); + if (links.jsxFlags & 1) { + return links.resolvedJsxElementAttributesType = getTypeOfSymbol(symbol); + } + else if (links.jsxFlags & 2) { + return links.resolvedJsxElementAttributesType = getIndexInfoOfSymbol(symbol, 0).type; } else { - var elemClassType = getJsxGlobalElementClassType(); - return links.resolvedJsxType = getResolvedJsxType(node, undefined, elemClassType); + return links.resolvedJsxElementAttributesType = unknownType; } } - return links.resolvedJsxType; + return links.resolvedJsxElementAttributesType; + } + function getCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType) { + var links = getNodeLinks(node); + if (!links.resolvedJsxElementAttributesType) { + var elemClassType = getJsxGlobalElementClassType(); + return links.resolvedJsxElementAttributesType = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, undefined, elemClassType); + } + return links.resolvedJsxElementAttributesType; + } + function getAllAttributesTypeFromJsxOpeningLikeElement(node) { + if (isJsxIntrinsicIdentifier(node.tagName)) { + return getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); + } + else { + return getCustomJsxElementAttributesType(node, true); + } + } + function getAttributesTypeFromJsxOpeningLikeElement(node) { + if (isJsxIntrinsicIdentifier(node.tagName)) { + return getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); + } + else { + return getCustomJsxElementAttributesType(node, false); + } } function getJsxAttributePropertySymbol(attrib) { - var attributesType = getJsxElementAttributesType(attrib.parent); + var attributesType = getAttributesTypeFromJsxOpeningLikeElement(attrib.parent.parent); var prop = getPropertyOfType(attributesType, attrib.name.text); return prop || unknownSymbol; } function getJsxGlobalElementClassType() { - if (!jsxElementClassType) { - jsxElementClassType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.ElementClass); + if (!deferredJsxElementClassType) { + deferredJsxElementClassType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.ElementClass); } - return jsxElementClassType; + return deferredJsxElementClassType; + } + function getJsxGlobalElementType() { + if (!deferredJsxElementType) { + deferredJsxElementType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.Element); + } + return deferredJsxElementType; + } + function getJsxGlobalStatelessElementType() { + if (!deferredJsxStatelessElementType) { + var jsxElementType = getJsxGlobalElementType(); + if (jsxElementType) { + deferredJsxStatelessElementType = getUnionType([jsxElementType, nullType]); + } + } + return deferredJsxStatelessElementType; } function getJsxIntrinsicTagNames() { var intrinsics = getJsxType(JsxNames.IntrinsicElements); @@ -30427,8 +34068,8 @@ var ts; if ((compilerOptions.jsx || 0) === 0) { error(errorNode, ts.Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided); } - if (jsxElementType === undefined) { - if (compilerOptions.noImplicitAny) { + if (getJsxGlobalElementType() === undefined) { + if (noImplicitAny) { error(errorNode, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist); } } @@ -30445,61 +34086,83 @@ var ts; markAliasSymbolAsReferenced(reactSym); } } - var targetAttributesType = getJsxElementAttributesType(node); - var nameTable = ts.createMap(); - var sawSpreadedAny = false; - for (var i = node.attributes.length - 1; i >= 0; i--) { - if (node.attributes[i].kind === 250) { - checkJsxAttribute((node.attributes[i]), targetAttributesType, nameTable); - } - else { - ts.Debug.assert(node.attributes[i].kind === 251); - var spreadType = checkJsxSpreadAttribute((node.attributes[i]), targetAttributesType, nameTable); - if (isTypeAny(spreadType)) { - sawSpreadedAny = true; - } - } + checkJsxAttributesAssignableToTagNameAttributes(node); + } + function checkJsxAttributesAssignableToTagNameAttributes(openingLikeElement) { + var targetAttributesType = isJsxIntrinsicIdentifier(openingLikeElement.tagName) ? + getIntrinsicAttributesTypeFromJsxOpeningLikeElement(openingLikeElement) : + getCustomJsxElementAttributesType(openingLikeElement, false); + var sourceAttributesType = createJsxAttributesTypeFromAttributesProperty(openingLikeElement, function (attribute) { + return isUnhyphenatedJsxName(attribute.name) || !!(getPropertyOfType(targetAttributesType, attribute.name)); + }); + if (targetAttributesType === emptyObjectType && (isTypeAny(sourceAttributesType) || sourceAttributesType.properties.length > 0)) { + error(openingLikeElement, ts.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, getJsxElementPropertiesName()); } - if (targetAttributesType && !sawSpreadedAny) { - var targetProperties = getPropertiesOfType(targetAttributesType); - for (var i = 0; i < targetProperties.length; i++) { - if (!(targetProperties[i].flags & 536870912) && - !nameTable[targetProperties[i].name]) { - error(node, ts.Diagnostics.Property_0_is_missing_in_type_1, targetProperties[i].name, typeToString(targetAttributesType)); - } - } + else { + checkTypeAssignableTo(sourceAttributesType, targetAttributesType, openingLikeElement.attributes.properties.length > 0 ? openingLikeElement.attributes : openingLikeElement); } } - function checkJsxExpression(node) { + function checkJsxExpression(node, checkMode) { if (node.expression) { - return checkExpression(node.expression); + var type = checkExpression(node.expression, checkMode); + if (node.dotDotDotToken && type !== anyType && !isArrayType(type)) { + error(node, ts.Diagnostics.JSX_spread_child_must_be_an_array_type, node.toString(), typeToString(type)); + } + return type; } else { return unknownType; } } function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 147; + return s.valueDeclaration ? s.valueDeclaration.kind : 148; } function getDeclarationModifierFlagsFromSymbol(s) { - return s.valueDeclaration ? ts.getCombinedModifierFlags(s.valueDeclaration) : s.flags & 134217728 ? 4 | 32 : 0; + if (s.valueDeclaration) { + var flags = ts.getCombinedModifierFlags(s.valueDeclaration); + return s.parent && s.parent.flags & 32 ? flags : flags & ~28; + } + if (getCheckFlags(s) & 6) { + var checkFlags = s.checkFlags; + var accessModifier = checkFlags & 256 ? 8 : + checkFlags & 64 ? 4 : + 16; + var staticModifier = checkFlags & 512 ? 32 : 0; + return accessModifier | staticModifier; + } + if (s.flags & 16777216) { + return 4 | 32; + } + return 0; } function getDeclarationNodeFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : 0; } - function checkClassPropertyAccess(node, left, type, prop) { + function isMethodLike(symbol) { + return !!(symbol.flags & 8192 || getCheckFlags(symbol) & 4); + } + function checkPropertyAccessibility(node, left, type, prop) { var flags = getDeclarationModifierFlagsFromSymbol(prop); - var declaringClass = getDeclaredTypeOfSymbol(getParentOfSymbol(prop)); - var errorNode = node.kind === 177 || node.kind === 223 ? + var errorNode = node.kind === 178 || node.kind === 225 ? node.name : node.right; + if (getCheckFlags(prop) & 256) { + error(errorNode, ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(prop), typeToString(type)); + return false; + } if (left.kind === 96) { - if (languageVersion < 2 && getDeclarationKindFromSymbol(prop) !== 149) { - error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); - return false; + if (languageVersion < 2) { + var hasNonMethodDeclaration = forEachProperty(prop, function (p) { + var propKind = getDeclarationKindFromSymbol(p); + return propKind !== 150 && propKind !== 149; + }); + if (hasNonMethodDeclaration) { + error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); + return false; + } } if (flags & 128) { - error(errorNode, ts.Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString(prop), typeToString(declaringClass)); + error(errorNode, ts.Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString(prop), typeToString(getDeclaringClass(prop))); return false; } } @@ -30509,7 +34172,7 @@ var ts; if (flags & 8) { var declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop)); if (!isNodeWithinClass(node, declaringClassDeclaration)) { - error(errorNode, ts.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(declaringClass)); + error(errorNode, ts.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(getDeclaringClass(prop))); return false; } return true; @@ -30519,10 +34182,10 @@ var ts; } var enclosingClass = forEachEnclosingClass(node, function (enclosingDeclaration) { var enclosingClass = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingDeclaration)); - return hasBaseType(enclosingClass, declaringClass) ? enclosingClass : undefined; + return isClassDerivedFromDeclaringClasses(enclosingClass, prop) ? enclosingClass : undefined; }); if (!enclosingClass) { - error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(declaringClass)); + error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(getDeclaringClass(prop) || type)); return false; } if (flags & 32) { @@ -30538,16 +34201,17 @@ var ts; return true; } function checkNonNullExpression(node) { - var type = checkExpression(node); - if (strictNullChecks) { - var kind = getFalsyFlags(type) & 6144; - if (kind) { - error(node, kind & 2048 ? kind & 4096 ? - ts.Diagnostics.Object_is_possibly_null_or_undefined : - ts.Diagnostics.Object_is_possibly_undefined : - ts.Diagnostics.Object_is_possibly_null); - } - return getNonNullableType(type); + return checkNonNullType(checkExpression(node), node); + } + function checkNonNullType(type, errorNode) { + var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 6144; + if (kind) { + error(errorNode, kind & 2048 ? kind & 4096 ? + ts.Diagnostics.Object_is_possibly_null_or_undefined : + ts.Diagnostics.Object_is_possibly_undefined : + ts.Diagnostics.Object_is_possibly_null); + var t = getNonNullableType(type); + return t.flags & (6144 | 8192) ? unknownType : t; } return type; } @@ -30576,7 +34240,7 @@ var ts; noUnusedIdentifiers && (prop.flags & 106500) && prop.valueDeclaration && (ts.getModifierFlags(prop.valueDeclaration) & 8)) { - if (prop.flags & 16777216) { + if (getCheckFlags(prop) & 1) { getSymbolLinks(prop).target.isReferenced = true; } else { @@ -30584,6 +34248,15 @@ var ts; } } } + function isInPropertyInitializer(node) { + while (node) { + if (node.parent && node.parent.kind === 148 && node.parent.initializer === node) { + return true; + } + node = node.parent; + } + return false; + } function checkPropertyAccessExpressionOrQualifiedName(node, left, right) { var type = checkNonNullExpression(left); if (isTypeAny(type) || type === silentNeverType) { @@ -30595,16 +34268,30 @@ var ts; } var prop = getPropertyOfType(apparentType, right.text); if (!prop) { + var stringIndexType = getIndexTypeOfType(apparentType, 0); + if (stringIndexType) { + return stringIndexType; + } if (right.text && !checkAndReportErrorForExtendingInterface(node)) { reportNonexistentProperty(right, type.flags & 16384 && type.isThisType ? apparentType : type); } return unknownType; } + if (prop.valueDeclaration) { + if (isInPropertyInitializer(node) && + !isBlockScopedNameDeclaredBeforeUse(prop.valueDeclaration, right)) { + error(right, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, right.text); + } + if (prop.valueDeclaration.kind === 228 && + node.parent && node.parent.kind !== 158 && + !ts.isInAmbientContext(prop.valueDeclaration) && + !isBlockScopedNameDeclaredBeforeUse(prop.valueDeclaration, right)) { + error(right, ts.Diagnostics.Class_0_used_before_its_declaration, right.text); + } + } markPropertyAsReferenced(prop); getNodeLinks(node).resolvedSymbol = prop; - if (prop.parent && prop.parent.flags & 32) { - checkClassPropertyAccess(node, left, apparentType, prop); - } + checkPropertyAccessibility(node, left, apparentType, prop); var propType = getTypeOfSymbol(prop); var assignmentKind = ts.getAssignmentTargetKind(node); if (assignmentKind) { @@ -30613,30 +34300,30 @@ var ts; return unknownType; } } - if (node.kind !== 177 || assignmentKind === 1 || + if (node.kind !== 178 || assignmentKind === 1 || !(prop.flags & (3 | 4 | 98304)) && !(prop.flags & 8192 && propType.flags & 65536)) { return propType; } - var flowType = getFlowTypeOfReference(node, propType, true, undefined); + var flowType = getFlowTypeOfReference(node, propType); return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 177 + var left = node.kind === 178 ? node.expression : node.left; var type = checkExpression(left); if (type !== unknownType && !isTypeAny(type)) { var prop = getPropertyOfType(getWidenedType(type), propertyName); - if (prop && prop.parent && prop.parent.flags & 32) { - return checkClassPropertyAccess(node, left, type, prop); + if (prop) { + return checkPropertyAccessibility(node, left, type, prop); } } return true; } function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 224) { + if (initializer.kind === 226) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -30658,7 +34345,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 212 && + if (node.kind === 214 && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -30676,7 +34363,7 @@ var ts; var indexExpression = node.argumentExpression; if (!indexExpression) { var sourceFile = ts.getSourceFileOfNode(node); - if (node.parent.kind === 180 && node.parent.expression === node) { + if (node.parent.kind === 181 && node.parent.expression === node) { var start = ts.skipTrivia(sourceFile.text, node.expression.end); var end = node.end; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); @@ -30696,7 +34383,7 @@ var ts; error(indexExpression, ts.Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal); return unknownType; } - return getIndexedAccessType(objectType, indexType, node); + return checkIndexedAccessIndexType(getIndexedAccessType(objectType, indexType, node), node); } function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) { if (expressionType === unknownType) { @@ -30716,7 +34403,7 @@ var ts; if (!leftHandSideSymbol) { return false; } - var globalESSymbol = getGlobalESSymbolConstructorSymbol(); + var globalESSymbol = getGlobalESSymbolConstructorSymbol(true); if (!globalESSymbol) { return false; } @@ -30729,10 +34416,10 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 181) { + if (node.kind === 182) { checkExpression(node.template); } - else if (node.kind !== 145) { + else if (node.kind !== 146) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -30751,22 +34438,22 @@ var ts; var specializedIndex = -1; var spliceIndex; ts.Debug.assert(!result.length); - for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { - var signature = signatures_2[_i]; + for (var _i = 0, signatures_3 = signatures; _i < signatures_3.length; _i++) { + var signature = signatures_3[_i]; var symbol = signature.declaration && getSymbolOfNode(signature.declaration); - var parent_8 = signature.declaration && signature.declaration.parent; + var parent = signature.declaration && signature.declaration.parent; if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && parent_8 === lastParent) { + if (lastParent && parent === lastParent) { index++; } else { - lastParent = parent_8; + lastParent = parent; index = cutoffIndex; } } else { index = cutoffIndex = result.length; - lastParent = parent_8; + lastParent = parent; } lastSymbol = symbol; if (signature.hasLiteralTypes) { @@ -30783,7 +34470,7 @@ var ts; function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg && arg.kind === 196) { + if (arg && arg.kind === 197) { return i; } } @@ -30796,11 +34483,14 @@ var ts; var callIsIncomplete; var isDecorator; var spreadArgIndex = -1; - if (node.kind === 181) { + if (ts.isJsxOpeningLikeElement(node)) { + return true; + } + if (node.kind === 182) { var tagExpression = node; argCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 194) { + if (tagExpression.template.kind === 195) { var templateExpression = tagExpression.template; var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); ts.Debug.assert(lastSpan !== undefined); @@ -30812,7 +34502,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 145) { + else if (node.kind === 146) { isDecorator = true; typeArguments = undefined; argCount = getEffectiveArgumentCount(node, undefined, signature); @@ -30820,7 +34510,7 @@ var ts; else { var callExpression = node; if (!callExpression.arguments) { - ts.Debug.assert(callExpression.kind === 180); + ts.Debug.assert(callExpression.kind === 181); return signature.minArgumentCount === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; @@ -30828,8 +34518,10 @@ var ts; typeArguments = callExpression.typeArguments; spreadArgIndex = getSpreadArgumentIndex(args); } + var numTypeParameters = ts.length(signature.typeParameters); + var minTypeArgumentCount = getMinTypeArgumentCount(signature.typeParameters); var hasRightNumberOfTypeArgs = !typeArguments || - (signature.typeParameters && typeArguments.length === signature.typeParameters.length); + (typeArguments.length >= minTypeArgumentCount && typeArguments.length <= numTypeParameters); if (!hasRightNumberOfTypeArgs) { return false; } @@ -30853,9 +34545,9 @@ var ts; return undefined; } function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper) { - var context = createInferenceContext(signature, true); + var context = createInferenceContext(signature, true, false); forEachMatchingParameterType(contextualSignature, signature, function (source, target) { - inferTypes(context, instantiateType(source, contextualMapper), target); + inferTypesWithContext(context, instantiateType(source, contextualMapper), target); }); return getSignatureInstantiation(signature, getInferredTypes(context)); } @@ -30874,19 +34566,19 @@ var ts; if (thisType) { var thisArgumentNode = getThisArgumentOfCall(node); var thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType; - inferTypes(context, thisArgumentType, thisType); + inferTypesWithContext(context, thisArgumentType, thisType); } var argCount = getEffectiveArgumentCount(node, args, signature); for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); - if (arg === undefined || arg.kind !== 198) { + if (arg === undefined || arg.kind !== 199) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i); if (argType === undefined) { var mapper = excludeArgument && excludeArgument[i] !== undefined ? identityMapper : inferenceMapper; argType = checkExpressionWithContextualType(arg, paramType, mapper); } - inferTypes(context, argType, paramType); + inferTypesWithContext(context, argType, paramType); } } if (excludeArgument) { @@ -30894,7 +34586,7 @@ var ts; if (excludeArgument[i] === false) { var arg = args[i]; var paramType = getTypeAtPosition(signature, i); - inferTypes(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); + inferTypesWithContext(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); } } } @@ -30904,7 +34596,7 @@ var ts; var typeParameters = signature.typeParameters; var typeArgumentsAreAssignable = true; var mapper; - for (var i = 0; i < typeParameters.length; i++) { + for (var i = 0; i < typeArgumentNodes.length; i++) { if (typeArgumentsAreAssignable) { var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { @@ -30924,9 +34616,29 @@ var ts; } return typeArgumentsAreAssignable; } + function checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation) { + var callIsIncomplete = node.attributes.end === node.end; + if (callIsIncomplete) { + return true; + } + var headMessage = ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1; + var paramType = getTypeAtPosition(signature, 0); + var attributesType = checkExpressionWithContextualType(node.attributes, paramType, undefined); + var argProperties = getPropertiesOfType(attributesType); + for (var _i = 0, argProperties_1 = argProperties; _i < argProperties_1.length; _i++) { + var arg = argProperties_1[_i]; + if (!getPropertyOfType(paramType, arg.name) && isUnhyphenatedJsxName(arg.name)) { + return false; + } + } + return checkTypeRelatedTo(attributesType, paramType, relation, undefined, headMessage); + } function checkApplicableSignature(node, args, signature, relation, excludeArgument, reportErrors) { + if (ts.isJsxOpeningLikeElement(node)) { + return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation); + } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 180) { + if (thisType && thisType !== voidType && node.kind !== 181) { var thisArgumentNode = getThisArgumentOfCall(node); var thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType; var errorNode = reportErrors ? (thisArgumentNode || node) : undefined; @@ -30939,7 +34651,7 @@ var ts; var argCount = getEffectiveArgumentCount(node, args, signature); for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); - if (arg === undefined || arg.kind !== 198) { + if (arg === undefined || arg.kind !== 199) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i); if (argType === undefined) { @@ -30954,51 +34666,54 @@ var ts; return true; } function getThisArgumentOfCall(node) { - if (node.kind === 179) { + if (node.kind === 180) { var callee = node.expression; - if (callee.kind === 177) { + if (callee.kind === 178) { return callee.expression; } - else if (callee.kind === 178) { + else if (callee.kind === 179) { return callee.expression; } } } function getEffectiveCallArguments(node) { var args; - if (node.kind === 181) { + if (node.kind === 182) { var template = node.template; args = [undefined]; - if (template.kind === 194) { + if (template.kind === 195) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); } } - else if (node.kind === 145) { + else if (node.kind === 146) { return undefined; } + else if (ts.isJsxOpeningLikeElement(node)) { + args = node.attributes.properties.length > 0 ? [node.attributes] : emptyArray; + } else { args = node.arguments || emptyArray; } return args; } function getEffectiveArgumentCount(node, args, signature) { - if (node.kind === 145) { + if (node.kind === 146) { switch (node.parent.kind) { - case 226: - case 197: + case 228: + case 198: return 1; - case 147: + case 148: return 2; - case 149: - case 151: + case 150: case 152: + case 153: if (languageVersion === 0) { return 2; } return signature.parameters.length >= 3 ? 3 : 2; - case 144: + case 145: return 3; } } @@ -31007,48 +34722,48 @@ var ts; } } function getEffectiveDecoratorFirstArgumentType(node) { - if (node.kind === 226) { + if (node.kind === 228) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } - if (node.kind === 144) { + if (node.kind === 145) { node = node.parent; - if (node.kind === 150) { + if (node.kind === 151) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } } - if (node.kind === 147 || - node.kind === 149 || - node.kind === 151 || - node.kind === 152) { + if (node.kind === 148 || + node.kind === 150 || + node.kind === 152 || + node.kind === 153) { return getParentTypeOfClassElement(node); } ts.Debug.fail("Unsupported decorator target."); return unknownType; } function getEffectiveDecoratorSecondArgumentType(node) { - if (node.kind === 226) { + if (node.kind === 228) { ts.Debug.fail("Class decorators should not have a second synthetic argument."); return unknownType; } - if (node.kind === 144) { + if (node.kind === 145) { node = node.parent; - if (node.kind === 150) { + if (node.kind === 151) { return anyType; } } - if (node.kind === 147 || - node.kind === 149 || - node.kind === 151 || - node.kind === 152) { + if (node.kind === 148 || + node.kind === 150 || + node.kind === 152 || + node.kind === 153) { var element = node; switch (element.name.kind) { case 70: case 8: case 9: return getLiteralTypeForText(32, element.name.text); - case 142: + case 143: var nameType = checkComputedPropertyName(element.name); if (isTypeOfKind(nameType, 512)) { return nameType; @@ -31065,20 +34780,20 @@ var ts; return unknownType; } function getEffectiveDecoratorThirdArgumentType(node) { - if (node.kind === 226) { + if (node.kind === 228) { ts.Debug.fail("Class decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 144) { + if (node.kind === 145) { return numberType; } - if (node.kind === 147) { + if (node.kind === 148) { ts.Debug.fail("Property decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 149 || - node.kind === 151 || - node.kind === 152) { + if (node.kind === 150 || + node.kind === 152 || + node.kind === 153) { var propertyType = getTypeOfNode(node); return createTypedPropertyDescriptorType(propertyType); } @@ -31099,26 +34814,26 @@ var ts; return unknownType; } function getEffectiveArgumentType(node, argIndex) { - if (node.kind === 145) { + if (node.kind === 146) { return getEffectiveDecoratorArgumentType(node, argIndex); } - else if (argIndex === 0 && node.kind === 181) { + else if (argIndex === 0 && node.kind === 182) { return getGlobalTemplateStringsArrayType(); } return undefined; } function getEffectiveArgument(node, args, argIndex) { - if (node.kind === 145 || - (argIndex === 0 && node.kind === 181)) { + if (node.kind === 146 || + (argIndex === 0 && node.kind === 182)) { return undefined; } return args[argIndex]; } function getEffectiveArgumentErrorNode(node, argIndex, arg) { - if (node.kind === 145) { + if (node.kind === 146) { return node.expression; } - else if (argIndex === 0 && node.kind === 181) { + else if (argIndex === 0 && node.kind === 182) { return node.template; } else { @@ -31126,15 +34841,30 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray, headMessage) { - var isTaggedTemplate = node.kind === 181; - var isDecorator = node.kind === 145; + var isTaggedTemplate = node.kind === 182; + var isDecorator = node.kind === 146; + var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var typeArguments; - if (!isTaggedTemplate && !isDecorator) { + if (!isTaggedTemplate && !isDecorator && !isJsxOpeningOrSelfClosingElement) { typeArguments = node.typeArguments; if (node.expression.kind !== 96) { ts.forEach(typeArguments, checkSourceElement); } } + if (signatures.length === 1) { + var declaration = signatures[0].declaration; + if (declaration && ts.isInJavaScriptFile(declaration) && !ts.hasJSDocParameterTags(declaration)) { + if (containsArgumentsReference(declaration)) { + var signatureWithRest = cloneSignature(signatures[0]); + var syntheticArgsSymbol = createSymbol(3, "args"); + syntheticArgsSymbol.type = anyArrayType; + syntheticArgsSymbol.isRestParameter = true; + signatureWithRest.parameters = ts.concatenate(signatureWithRest.parameters, [syntheticArgsSymbol]); + signatureWithRest.hasRestParameter = true; + signatures = [signatureWithRest]; + } + } + } var candidates = candidatesOutArray || []; reorderCandidates(signatures, candidates); if (!candidates.length) { @@ -31157,7 +34887,7 @@ var ts; var candidateForTypeArgumentError; var resultOfFailedInference; var result; - var signatureHelpTrailingComma = candidatesOutArray && node.kind === 179 && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = candidatesOutArray && node.kind === 180 && node.arguments.hasTrailingComma; if (candidates.length > 1) { result = chooseOverload(candidates, subtypeRelation, signatureHelpTrailingComma); } @@ -31171,6 +34901,9 @@ var ts; return result; } if (candidateForArgumentError) { + if (isJsxOpeningOrSelfClosingElement) { + return candidateForArgumentError; + } checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, undefined, true); } else if (candidateForTypeArgumentError) { @@ -31186,7 +34919,7 @@ var ts; if (headMessage) { diagnosticChainHead = ts.chainDiagnosticMessages(diagnosticChainHead, headMessage); } - reportNoCommonSupertypeError(inferenceCandidates, node.expression || node.tag, diagnosticChainHead); + reportNoCommonSupertypeError(inferenceCandidates, node.tagName || node.expression || node.tag, diagnosticChainHead); } } else { @@ -31222,20 +34955,20 @@ var ts; var candidate = void 0; var typeArgumentsAreValid = void 0; var inferenceContext = originalCandidate.typeParameters - ? createInferenceContext(originalCandidate, false) + ? createInferenceContext(originalCandidate, false, ts.isInJavaScriptFile(node)) : undefined; while (true) { candidate = originalCandidate; if (candidate.typeParameters) { var typeArgumentTypes = void 0; if (typeArguments) { - typeArgumentTypes = ts.map(typeArguments, getTypeFromTypeNode); + typeArgumentTypes = fillMissingTypeArguments(ts.map(typeArguments, getTypeFromTypeNode), candidate.typeParameters, getMinTypeArgumentCount(candidate.typeParameters)); typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, false); } else { inferTypeArguments(node, candidate, args, excludeArgument, inferenceContext); - typeArgumentsAreValid = inferenceContext.failedTypeParameterIndex === undefined; typeArgumentTypes = inferenceContext.inferredTypes; + typeArgumentsAreValid = inferenceContext.failedTypeParameterIndex === undefined; } if (!typeArgumentsAreValid) { break; @@ -31277,7 +35010,7 @@ var ts; if (superType !== unknownType) { var baseTypeNode = ts.getClassExtendsHeritageClauseElement(ts.getContainingClass(node)); if (baseTypeNode) { - var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments); + var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments, baseTypeNode); return resolveCall(node, baseConstructors, candidatesOutArray); } } @@ -31388,12 +35121,13 @@ var ts; if (containingClass) { var containingType = getTypeOfNode(containingClass); var baseTypes = getBaseTypes(containingType); - if (baseTypes.length) { + while (baseTypes.length) { var baseType = baseTypes[0]; if (modifiers & 16 && baseType.symbol === declaration.parent.symbol) { return true; } + baseTypes = getBaseTypes(baseType); } } if (modifiers & 8) { @@ -31425,16 +35159,16 @@ var ts; } function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 226: - case 197: + case 228: + case 198: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 144: + case 145: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 147: + case 148: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 149: - case 151: + case 150: case 152: + case 153: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; } } @@ -31459,16 +35193,42 @@ var ts; } return resolveCall(node, callSignatures, candidatesOutArray, headMessage); } + function getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, candidatesOutArray) { + ts.Debug.assert(!(elementType.flags & 65536)); + var callSignature = resolveStatelessJsxOpeningLikeElement(openingLikeElement, elementType, candidatesOutArray); + return callSignature; + } + function resolveStatelessJsxOpeningLikeElement(openingLikeElement, elementType, candidatesOutArray) { + if (elementType.flags & 65536) { + var types = elementType.types; + var result = void 0; + for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { + var type = types_18[_i]; + result = result || resolveStatelessJsxOpeningLikeElement(openingLikeElement, type, candidatesOutArray); + } + return result; + } + var callSignatures = elementType && getSignaturesOfType(elementType, 0); + if (callSignatures && callSignatures.length > 0) { + var callSignature = void 0; + callSignature = resolveCall(openingLikeElement, callSignatures, candidatesOutArray); + return callSignature; + } + return undefined; + } function resolveSignature(node, candidatesOutArray) { switch (node.kind) { - case 179: - return resolveCallExpression(node, candidatesOutArray); case 180: - return resolveNewExpression(node, candidatesOutArray); + return resolveCallExpression(node, candidatesOutArray); case 181: + return resolveNewExpression(node, candidatesOutArray); + case 182: return resolveTaggedTemplateExpression(node, candidatesOutArray); - case 145: + case 146: return resolveDecorator(node, candidatesOutArray); + case 250: + case 249: + return resolveStatelessJsxOpeningLikeElement(node, checkExpression(node.tagName), candidatesOutArray); } ts.Debug.fail("Branch in 'resolveSignature' should be unreachable."); } @@ -31499,20 +35259,23 @@ var ts; if (node.expression.kind === 96) { return voidType; } - if (node.kind === 180) { + if (node.kind === 181) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 150 && - declaration.kind !== 154 && - declaration.kind !== 159 && + declaration.kind !== 151 && + declaration.kind !== 155 && + declaration.kind !== 160 && !ts.isJSDocConstructSignature(declaration)) { var funcSymbol = node.expression.kind === 70 ? getResolvedSymbol(node.expression) : checkExpression(node.expression).symbol; - if (funcSymbol && funcSymbol.members && (funcSymbol.flags & 16 || ts.isDeclarationOfFunctionExpression(funcSymbol))) { + if (funcSymbol && ts.isDeclarationOfFunctionOrClassExpression(funcSymbol)) { + funcSymbol = getSymbolOfNode(funcSymbol.valueDeclaration.initializer); + } + if (funcSymbol && funcSymbol.members && funcSymbol.flags & 16) { return getInferredClassType(funcSymbol); } - else if (compilerOptions.noImplicitAny) { + else if (noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } return anyType; @@ -31535,9 +35298,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 - ? 225 + ? 227 : resolvedRequire.flags & 3 - ? 223 + ? 225 : 0; if (targetDeclarationKind !== 0) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -31563,6 +35326,22 @@ var ts; function checkNonNullAssertion(node) { return getNonNullableType(checkExpression(node.expression)); } + function checkMetaProperty(node) { + checkGrammarMetaProperty(node); + var container = ts.getNewTargetContainer(node); + if (!container) { + error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); + return unknownType; + } + else if (container.kind === 151) { + var symbol = getSymbolOfNode(container.parent); + return getTypeOfSymbol(symbol); + } + else { + var symbol = getSymbolOfNode(container); + return getTypeOfSymbol(symbol); + } + } function getTypeOfParameter(symbol) { var type = getTypeOfSymbol(symbol); if (strictNullChecks) { @@ -31578,13 +35357,16 @@ var ts; pos < signature.parameters.length - 1 ? getTypeOfParameter(signature.parameters[pos]) : getRestTypeOfSignature(signature) : pos < signature.parameters.length ? getTypeOfParameter(signature.parameters[pos]) : anyType; } - function assignContextualParameterTypes(signature, context, mapper) { + function getTypeOfFirstParameterOfSignature(signature) { + return signature.parameters.length > 0 ? getTypeAtPosition(signature, 0) : neverType; + } + function assignContextualParameterTypes(signature, context, mapper, checkMode) { var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0); - if (isInferentialContext(mapper)) { + if (checkMode === 2) { for (var i = 0; i < len; i++) { var declaration = signature.parameters[i].valueDeclaration; if (declaration.type) { - inferTypes(mapper.context, getTypeFromTypeNode(declaration.type), getTypeAtPosition(context, i)); + inferTypesWithContext(mapper.context, getTypeFromTypeNode(declaration.type), getTypeAtPosition(context, i)); } } } @@ -31592,23 +35374,23 @@ var ts; var parameter = signature.thisParameter; if (!parameter || parameter.valueDeclaration && !parameter.valueDeclaration.type) { if (!parameter) { - signature.thisParameter = createTransientSymbol(context.thisParameter, undefined); + signature.thisParameter = createSymbolWithType(context.thisParameter, undefined); } - assignTypeToParameterAndFixTypeParameters(signature.thisParameter, getTypeOfSymbol(context.thisParameter), mapper); + assignTypeToParameterAndFixTypeParameters(signature.thisParameter, getTypeOfSymbol(context.thisParameter), mapper, checkMode); } } for (var i = 0; i < len; i++) { var parameter = signature.parameters[i]; if (!parameter.valueDeclaration.type) { var contextualParameterType = getTypeAtPosition(context, i); - assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper); + assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper, checkMode); } } if (signature.hasRestParameter && isRestParameterIndex(context, signature.parameters.length - 1)) { var parameter = ts.lastOrUndefined(signature.parameters); if (!parameter.valueDeclaration.type) { var contextualParameterType = getTypeOfSymbol(ts.lastOrUndefined(context.parameters)); - assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper); + assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper, checkMode); } } } @@ -31625,19 +35407,19 @@ var ts; } } } - function assignTypeToParameterAndFixTypeParameters(parameter, contextualType, mapper) { + function assignTypeToParameterAndFixTypeParameters(parameter, contextualType, mapper, checkMode) { var links = getSymbolLinks(parameter); if (!links.type) { links.type = instantiateType(contextualType, mapper); if (links.type === emptyObjectType && - (parameter.valueDeclaration.name.kind === 172 || - parameter.valueDeclaration.name.kind === 173)) { + (parameter.valueDeclaration.name.kind === 173 || + parameter.valueDeclaration.name.kind === 174)) { links.type = getTypeFromBindingPattern(parameter.valueDeclaration.name); } assignBindingElementTypes(parameter.valueDeclaration); } - else if (isInferentialContext(mapper)) { - inferTypes(mapper.context, links.type, instantiateType(contextualType, mapper)); + else if (checkMode === 2) { + inferTypesWithContext(mapper.context, links.type, instantiateType(contextualType, mapper)); } } function getReturnTypeFromJSDocComment(func) { @@ -31648,9 +35430,9 @@ var ts; return undefined; } function createPromiseType(promisedType) { - var globalPromiseType = getGlobalPromiseType(); + var globalPromiseType = getGlobalPromiseType(true); if (globalPromiseType !== emptyGenericType) { - promisedType = getAwaitedType(promisedType); + promisedType = getAwaitedType(promisedType) || emptyObjectType; return createTypeReference(globalPromiseType, [promisedType]); } return emptyObjectType; @@ -31661,46 +35443,56 @@ var ts; error(func, ts.Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option); return unknownType; } + else if (!getGlobalPromiseConstructorSymbol(true)) { + error(func, ts.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option); + } return promiseType; } - function getReturnTypeFromBody(func, contextualMapper) { + function getReturnTypeFromBody(func, checkMode) { var contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func); if (!func.body) { return unknownType; } - var isAsync = ts.isAsyncFunctionLike(func); + var functionFlags = ts.getFunctionFlags(func); var type; - if (func.body.kind !== 204) { - type = checkExpressionCached(func.body, contextualMapper); - if (isAsync) { - type = checkAwaitedType(type, func, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); + if (func.body.kind !== 206) { + type = checkExpressionCached(func.body, checkMode); + if (functionFlags & 2) { + type = checkAwaitedType(type, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } } else { var types = void 0; - var funcIsGenerator = !!func.asteriskToken; - if (funcIsGenerator) { - types = checkAndAggregateYieldOperandTypes(func, contextualMapper); - if (types.length === 0) { - var iterableIteratorAny = createIterableIteratorType(anyType); - if (compilerOptions.noImplicitAny) { + if (functionFlags & 1) { + types = ts.concatenate(checkAndAggregateYieldOperandTypes(func, checkMode), checkAndAggregateReturnExpressionTypes(func, checkMode)); + if (!types || types.length === 0) { + var iterableIteratorAny = functionFlags & 2 + ? createAsyncIterableIteratorType(anyType) + : createIterableIteratorType(anyType); + if (noImplicitAny) { error(func.asteriskToken, ts.Diagnostics.Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type, typeToString(iterableIteratorAny)); } return iterableIteratorAny; } } else { - types = checkAndAggregateReturnExpressionTypes(func, contextualMapper); + types = checkAndAggregateReturnExpressionTypes(func, checkMode); if (!types) { - return isAsync ? createPromiseReturnType(func, neverType) : neverType; + return functionFlags & 2 + ? createPromiseReturnType(func, neverType) + : neverType; } if (types.length === 0) { - return isAsync ? createPromiseReturnType(func, voidType) : voidType; + return functionFlags & 2 + ? createPromiseReturnType(func, voidType) + : voidType; } } type = getUnionType(types, true); - if (funcIsGenerator) { - type = createIterableIteratorType(type); + if (functionFlags & 1) { + type = functionFlags & 2 + ? createAsyncIterableIteratorType(type) + : createIterableIteratorType(type); } } if (!contextualSignature) { @@ -31712,16 +35504,24 @@ var ts; type = getWidenedLiteralType(type); } var widenedType = getWidenedType(type); - return isAsync ? createPromiseReturnType(func, widenedType) : widenedType; + return (functionFlags & 3) === 2 + ? createPromiseReturnType(func, widenedType) + : widenedType; } - function checkAndAggregateYieldOperandTypes(func, contextualMapper) { + function checkAndAggregateYieldOperandTypes(func, checkMode) { var aggregatedTypes = []; + var functionFlags = ts.getFunctionFlags(func); ts.forEachYieldExpression(func.body, function (yieldExpression) { var expr = yieldExpression.expression; if (expr) { - var type = checkExpressionCached(expr, contextualMapper); + var type = checkExpressionCached(expr, checkMode); if (yieldExpression.asteriskToken) { - type = checkElementTypeOfIterable(type, yieldExpression.expression); + type = checkIteratedTypeOrElementType(type, yieldExpression.expression, false, (functionFlags & 2) !== 0); + } + if (functionFlags & 2) { + type = checkAwaitedType(type, expr, yieldExpression.asteriskToken + ? ts.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + : ts.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } if (!ts.contains(aggregatedTypes, type)) { aggregatedTypes.push(type); @@ -31742,29 +35542,29 @@ var ts; if (!switchTypes.length) { return false; } - return eachTypeContainedIn(type, switchTypes); + return eachTypeContainedIn(mapType(type, getRegularTypeOfLiteralType), switchTypes); } function functionHasImplicitReturn(func) { if (!(func.flags & 128)) { return false; } var lastStatement = ts.lastOrUndefined(func.body.statements); - if (lastStatement && lastStatement.kind === 218 && isExhaustiveSwitchStatement(lastStatement)) { + if (lastStatement && lastStatement.kind === 220 && isExhaustiveSwitchStatement(lastStatement)) { return false; } return true; } - function checkAndAggregateReturnExpressionTypes(func, contextualMapper) { - var isAsync = ts.isAsyncFunctionLike(func); + function checkAndAggregateReturnExpressionTypes(func, checkMode) { + var functionFlags = ts.getFunctionFlags(func); var aggregatedTypes = []; var hasReturnWithNoExpression = functionHasImplicitReturn(func); var hasReturnOfTypeNever = false; ts.forEachReturnStatement(func.body, function (returnStatement) { var expr = returnStatement.expression; if (expr) { - var type = checkExpressionCached(expr, contextualMapper); - if (isAsync) { - type = checkAwaitedType(type, func, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); + var type = checkExpressionCached(expr, checkMode); + if (functionFlags & 2) { + type = checkAwaitedType(type, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } if (type.flags & 8192) { hasReturnOfTypeNever = true; @@ -31778,7 +35578,7 @@ var ts; } }); if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever || - func.kind === 184 || func.kind === 185)) { + func.kind === 185 || func.kind === 186)) { return undefined; } if (strictNullChecks && aggregatedTypes.length && hasReturnWithNoExpression) { @@ -31795,7 +35595,7 @@ var ts; if (returnType && maybeTypeOfKind(returnType, 1 | 1024)) { return; } - if (ts.nodeIsMissing(func.body) || func.body.kind !== 204 || !functionHasImplicitReturn(func)) { + if (ts.nodeIsMissing(func.body) || func.body.kind !== 206 || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 256; @@ -31821,20 +35621,20 @@ var ts; error(func.type || func, ts.Diagnostics.Not_all_code_paths_return_a_value); } } - function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) { - ts.Debug.assert(node.kind !== 149 || ts.isObjectLiteralMethod(node)); + function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { + ts.Debug.assert(node.kind !== 150 || ts.isObjectLiteralMethod(node)); var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 184) { + if (!hasGrammarError && node.kind === 185) { checkGrammarForGenerator(node); } - if (contextualMapper === identityMapper && isContextSensitive(node)) { + if (checkMode === 1 && isContextSensitive(node)) { checkNodeDeferred(node); return anyFunctionType; } var links = getNodeLinks(node); var type = getTypeOfSymbol(node.symbol); var contextSensitive = isContextSensitive(node); - var mightFixTypeParameters = contextSensitive && isInferentialContext(contextualMapper); + var mightFixTypeParameters = contextSensitive && checkMode === 2; if (mightFixTypeParameters || !(links.flags & 1024)) { var contextualSignature = getContextualSignature(node); var contextChecked = !!(links.flags & 1024); @@ -31843,10 +35643,10 @@ var ts; if (contextualSignature) { var signature = getSignaturesOfType(type, 0)[0]; if (contextSensitive) { - assignContextualParameterTypes(signature, contextualSignature, contextualMapper || identityMapper); + assignContextualParameterTypes(signature, contextualSignature, getContextualMapper(node), checkMode); } if (mightFixTypeParameters || !node.type && !signature.resolvedReturnType) { - var returnType = getReturnTypeFromBody(node, contextualMapper); + var returnType = getReturnTypeFromBody(node, checkMode); if (!signature.resolvedReturnType) { signature.resolvedReturnType = returnType; } @@ -31858,31 +35658,35 @@ var ts; } } } - if (produceDiagnostics && node.kind !== 149) { + if (produceDiagnostics && node.kind !== 150) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); } return type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 149 || ts.isObjectLiteralMethod(node)); - var isAsync = ts.isAsyncFunctionLike(node); - var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); - if (!node.asteriskToken) { + ts.Debug.assert(node.kind !== 150 || ts.isObjectLiteralMethod(node)); + var functionFlags = ts.getFunctionFlags(node); + var returnOrPromisedType = node.type && + ((functionFlags & 3) === 2 ? + checkAsyncFunctionReturnType(node) : + getTypeFromTypeNode(node.type)); + if ((functionFlags & 1) === 0) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } if (node.body) { if (!node.type) { getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 204) { + if (node.body.kind === 206) { checkSourceElement(node.body); } else { var exprType = checkExpression(node.body); if (returnOrPromisedType) { - if (isAsync) { - var awaitedType = checkAwaitedType(exprType, node.body, ts.Diagnostics.Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member); + if ((functionFlags & 3) === 2) { + var awaitedType = checkAwaitedType(exprType, node.body, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); checkTypeAssignableTo(awaitedType, returnOrPromisedType, node.body); } else { @@ -31901,19 +35705,19 @@ var ts; return true; } function isReadonlySymbol(symbol) { - return symbol.isReadonly || - symbol.flags & 4 && (getDeclarationModifierFlagsFromSymbol(symbol) & 64) !== 0 || - symbol.flags & 3 && (getDeclarationNodeFlagsFromSymbol(symbol) & 2) !== 0 || + return !!(getCheckFlags(symbol) & 8 || + symbol.flags & 4 && getDeclarationModifierFlagsFromSymbol(symbol) & 64 || + symbol.flags & 3 && getDeclarationNodeFlagsFromSymbol(symbol) & 2 || symbol.flags & 98304 && !(symbol.flags & 65536) || - (symbol.flags & 8) !== 0; + symbol.flags & 8); } function isReferenceToReadonlyEntity(expr, symbol) { if (isReadonlySymbol(symbol)) { if (symbol.flags & 4 && - (expr.kind === 177 || expr.kind === 178) && + (expr.kind === 178 || expr.kind === 179) && expr.expression.kind === 98) { var func = ts.getContainingFunction(expr); - if (!(func && func.kind === 150)) + if (!(func && func.kind === 151)) return true; return !(func.parent === symbol.valueDeclaration.parent || func === symbol.valueDeclaration.parent); } @@ -31922,13 +35726,13 @@ var ts; return false; } function isReferenceThroughNamespaceImport(expr) { - if (expr.kind === 177 || expr.kind === 178) { + if (expr.kind === 178 || expr.kind === 179) { var node = ts.skipParentheses(expr.expression); if (node.kind === 70) { var symbol = getNodeLinks(node).resolvedSymbol; if (symbol.flags & 8388608) { var declaration = getDeclarationOfAliasSymbol(symbol); - return declaration && declaration.kind === 237; + return declaration && declaration.kind === 239; } } } @@ -31936,7 +35740,7 @@ var ts; } function checkReferenceExpression(expr, invalidReferenceMessage) { var node = ts.skipParentheses(expr); - if (node.kind !== 70 && node.kind !== 177 && node.kind !== 178) { + if (node.kind !== 70 && node.kind !== 178 && node.kind !== 179) { error(expr, invalidReferenceMessage); return false; } @@ -31944,11 +35748,21 @@ var ts; } function checkDeleteExpression(node) { checkExpression(node.expression); + var expr = ts.skipParentheses(node.expression); + if (expr.kind !== 178 && expr.kind !== 179) { + error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); + return booleanType; + } + var links = getNodeLinks(expr); + var symbol = getExportSymbolOfValueSymbolIfExported(links.resolvedSymbol); + if (symbol && isReadonlySymbol(symbol)) { + error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_read_only_property); + } return booleanType; } function checkTypeOfExpression(node) { checkExpression(node.expression); - return stringType; + return typeofType; } function checkVoidExpression(node) { checkExpression(node.expression); @@ -31956,7 +35770,7 @@ var ts; } function checkAwaitExpression(node) { if (produceDiagnostics) { - if (!(node.flags & 524288)) { + if (!(node.flags & 16384)) { grammarErrorOnFirstToken(node, ts.Diagnostics.await_expression_is_only_allowed_within_an_async_function); } if (isInParameterInitializerBeforeContainingFunction(node)) { @@ -31964,7 +35778,7 @@ var ts; } } var operandType = checkExpression(node.expression); - return checkAwaitedType(operandType, node); + return checkAwaitedType(operandType, node, ts.Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } function checkPrefixUnaryExpression(node) { var operandType = checkExpression(node.operand); @@ -31978,6 +35792,7 @@ var ts; case 36: case 37: case 51: + checkNonNullType(operandType, node.operand); if (maybeTypeOfKind(operandType, 512)) { error(node.operand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(node.operator)); } @@ -31989,7 +35804,7 @@ var ts; booleanType; case 42: case 43: - var ok = checkArithmeticOperandType(node.operand, getNonNullableType(operandType), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); + var ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access); } @@ -32002,7 +35817,7 @@ var ts; if (operandType === silentNeverType) { return silentNeverType; } - var ok = checkArithmeticOperandType(node.operand, getNonNullableType(operandType), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); + var ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access); } @@ -32014,8 +35829,8 @@ var ts; } if (type.flags & 196608) { var types = type.types; - for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { - var t = types_15[_i]; + for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { + var t = types_19[_i]; if (maybeTypeOfKind(t, kind)) { return true; } @@ -32029,8 +35844,8 @@ var ts; } if (type.flags & 65536) { var types = type.types; - for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { - var t = types_16[_i]; + for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { + var t = types_20[_i]; if (!isTypeOfKind(t, kind)) { return false; } @@ -32039,8 +35854,8 @@ var ts; } if (type.flags & 131072) { var types = type.types; - for (var _a = 0, types_17 = types; _a < types_17.length; _a++) { - var t = types_17[_a]; + for (var _a = 0, types_21 = types; _a < types_21.length; _a++) { + var t = types_21[_a]; if (isTypeOfKind(t, kind)) { return true; } @@ -32061,7 +35876,10 @@ var ts; if (isTypeOfKind(leftType, 8190)) { error(left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } - if (!(isTypeAny(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) { + if (!(isTypeAny(rightType) || + getSignaturesOfType(rightType, 0).length || + getSignaturesOfType(rightType, 1).length || + isTypeSubtypeOf(rightType, globalFunctionType))) { error(right, ts.Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); } return booleanType; @@ -32070,39 +35888,41 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } + leftType = checkNonNullType(leftType, left); + rightType = checkNonNullType(rightType, right); if (!(isTypeComparableTo(leftType, stringType) || isTypeOfKind(leftType, 340 | 512))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 | 16384 | 524288)) { + if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 | 540672 | 16777216)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; } function checkObjectLiteralAssignment(node, sourceType) { var properties = node.properties; - for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) { - var p = properties_5[_i]; + for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) { + var p = properties_7[_i]; checkObjectLiteralDestructuringPropertyAssignment(sourceType, p, properties); } return sourceType; } function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property, allProperties) { - if (property.kind === 257 || property.kind === 258) { - var name_22 = property.name; - if (name_22.kind === 142) { - checkComputedPropertyName(name_22); + if (property.kind === 260 || property.kind === 261) { + var name = property.name; + if (name.kind === 143) { + checkComputedPropertyName(name); } - if (isComputedNonLiteralName(name_22)) { + if (isComputedNonLiteralName(name)) { return undefined; } - var text = ts.getTextOfPropertyName(name_22); + var text = ts.getTextOfPropertyName(name); var type = isTypeAny(objectLiteralType) ? objectLiteralType : getTypeOfPropertyOfType(objectLiteralType, text) || isNumericLiteralName(text) && getIndexTypeOfType(objectLiteralType, 1) || getIndexTypeOfType(objectLiteralType, 0); if (type) { - if (property.kind === 258) { + if (property.kind === 261) { return checkDestructuringAssignment(property, type); } else { @@ -32110,10 +35930,13 @@ var ts; } } else { - error(name_22, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name_22)); + error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name)); } } - else if (property.kind === 259) { + else if (property.kind === 262) { + if (languageVersion < 5) { + checkExternalEmitHelpers(property, 4); + } var nonRestNames = []; if (allProperties) { for (var i = 0; i < allProperties.length - 1; i++) { @@ -32127,19 +35950,22 @@ var ts; error(property, ts.Diagnostics.Property_assignment_expected); } } - function checkArrayLiteralAssignment(node, sourceType, contextualMapper) { - var elementType = checkIteratedTypeOrElementType(sourceType, node, false) || unknownType; + function checkArrayLiteralAssignment(node, sourceType, checkMode) { + if (languageVersion < 2 && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 512); + } + var elementType = checkIteratedTypeOrElementType(sourceType, node, false, false) || unknownType; var elements = node.elements; for (var i = 0; i < elements.length; i++) { - checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, elementType, contextualMapper); + checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, elementType, checkMode); } return sourceType; } - function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, contextualMapper) { + function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 198) { - if (element.kind !== 196) { + if (element.kind !== 199) { + if (element.kind !== 197) { var propName = "" + elementIndex; var type = isTypeAny(sourceType) ? sourceType @@ -32147,7 +35973,7 @@ var ts; ? getTypeOfPropertyOfType(sourceType, propName) : elementType; if (type) { - return checkDestructuringAssignment(element, type, contextualMapper); + return checkDestructuringAssignment(element, type, checkMode); } else { checkExpression(element); @@ -32165,48 +35991,48 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 192 && restExpression.operatorToken.kind === 57) { + if (restExpression.kind === 193 && restExpression.operatorToken.kind === 57) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { - return checkDestructuringAssignment(restExpression, createArrayType(elementType), contextualMapper); + return checkDestructuringAssignment(restExpression, createArrayType(elementType), checkMode); } } } } return undefined; } - function checkDestructuringAssignment(exprOrAssignment, sourceType, contextualMapper) { + function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode) { var target; - if (exprOrAssignment.kind === 258) { + if (exprOrAssignment.kind === 261) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { if (strictNullChecks && !(getFalsyFlags(checkExpression(prop.objectAssignmentInitializer)) & 2048)) { sourceType = getTypeWithFacts(sourceType, 131072); } - checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, contextualMapper); + checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode); } target = exprOrAssignment.name; } else { target = exprOrAssignment; } - if (target.kind === 192 && target.operatorToken.kind === 57) { - checkBinaryExpression(target, contextualMapper); + if (target.kind === 193 && target.operatorToken.kind === 57) { + checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 176) { + if (target.kind === 177) { return checkObjectLiteralAssignment(target, sourceType); } - if (target.kind === 175) { - return checkArrayLiteralAssignment(target, sourceType, contextualMapper); + if (target.kind === 176) { + return checkArrayLiteralAssignment(target, sourceType, checkMode); } - return checkReferenceAssignment(target, sourceType, contextualMapper); + return checkReferenceAssignment(target, sourceType, checkMode); } - function checkReferenceAssignment(target, sourceType, contextualMapper) { - var targetType = checkExpression(target, contextualMapper); - var error = target.parent.kind === 259 ? + function checkReferenceAssignment(target, sourceType, checkMode) { + var targetType = checkExpression(target, checkMode); + var error = target.parent.kind === 262 ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; if (checkReferenceExpression(target, error)) { @@ -32220,35 +36046,35 @@ var ts; case 70: case 9: case 11: - case 181: - case 194: + case 182: + case 195: case 12: case 8: case 100: case 85: case 94: - case 137: - case 184: - case 197: + case 138: case 185: - case 175: + case 198: + case 186: case 176: - case 187: - case 201: - case 247: - case 246: + case 177: + case 188: + case 202: + case 249: + case 248: return true; - case 193: + case 194: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 192: + case 193: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 190: case 191: + case 192: switch (node.operator) { case 50: case 36: @@ -32257,9 +36083,9 @@ var ts; return true; } return false; - case 188: - case 182: - case 200: + case 189: + case 183: + case 201: default: return false; } @@ -32274,16 +36100,16 @@ var ts; firstAssignableToSecond && !secondAssignableToFirst ? type2 : getUnionType([type1, type2], true); } - function checkBinaryExpression(node, contextualMapper) { - return checkBinaryLikeExpression(node.left, node.operatorToken, node.right, contextualMapper, node); + function checkBinaryExpression(node, checkMode) { + return checkBinaryLikeExpression(node.left, node.operatorToken, node.right, checkMode, node); } - function checkBinaryLikeExpression(left, operatorToken, right, contextualMapper, errorNode) { + function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 57 && (left.kind === 176 || left.kind === 175)) { - return checkDestructuringAssignment(left, checkExpression(right, contextualMapper), contextualMapper); + if (operator === 57 && (left.kind === 177 || left.kind === 176)) { + return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode); } - var leftType = checkExpression(left, contextualMapper); - var rightType = checkExpression(right, contextualMapper); + var leftType = checkExpression(left, checkMode); + var rightType = checkExpression(right, checkMode); switch (operator) { case 38: case 39: @@ -32310,12 +36136,8 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (leftType.flags & 6144) - leftType = rightType; - if (rightType.flags & 6144) - rightType = leftType; - leftType = getNonNullableType(leftType); - rightType = getNonNullableType(rightType); + leftType = checkNonNullType(leftType, left); + rightType = checkNonNullType(rightType, right); var suggestedOperator = void 0; if ((leftType.flags & 136) && (rightType.flags & 136) && @@ -32335,12 +36157,10 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (leftType.flags & 6144) - leftType = rightType; - if (rightType.flags & 6144) - rightType = leftType; - leftType = getNonNullableType(leftType); - rightType = getNonNullableType(rightType); + if (!isTypeOfKind(leftType, 1 | 262178) && !isTypeOfKind(rightType, 1 | 262178)) { + leftType = checkNonNullType(leftType, left); + rightType = checkNonNullType(rightType, right); + } var resultType = void 0; if (isTypeOfKind(leftType, 340) && isTypeOfKind(rightType, 340)) { resultType = numberType; @@ -32369,8 +36189,8 @@ var ts; case 29: case 30: if (checkForDisallowedESSymbolOperand(operator)) { - leftType = getBaseTypeOfLiteralType(leftType); - rightType = getBaseTypeOfLiteralType(rightType); + leftType = getBaseTypeOfLiteralType(checkNonNullType(leftType, left)); + rightType = getBaseTypeOfLiteralType(checkNonNullType(rightType, right)); if (!isTypeComparableTo(leftType, rightType) && !isTypeComparableTo(rightType, leftType)) { reportOperatorError(); } @@ -32406,11 +36226,14 @@ var ts; checkAssignmentOperator(rightType); return getRegularTypeOfObjectLiteral(rightType); case 25: - if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left)) { + if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isEvalNode(right)) { error(left, ts.Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects); } return rightType; } + function isEvalNode(node) { + return node.kind === 70 && node.text === "eval"; + } function checkForDisallowedESSymbolOperand(operator) { var offendingSymbolOperand = maybeTypeOfKind(leftType, 512) ? left : maybeTypeOfKind(rightType, 512) ? right : @@ -32464,7 +36287,7 @@ var ts; } function checkYieldExpression(node) { if (produceDiagnostics) { - if (!(node.flags & 131072) || isYieldExpressionInClass(node)) { + if (!(node.flags & 4096) || isYieldExpressionInClass(node)) { grammarErrorOnFirstToken(node, ts.Diagnostics.A_yield_expression_is_only_allowed_in_a_generator_body); } if (isInParameterInitializerBeforeContainingFunction(node)) { @@ -32473,30 +36296,45 @@ var ts; } if (node.expression) { var func = ts.getContainingFunction(node); - if (func && func.asteriskToken) { + var functionFlags = func && ts.getFunctionFlags(func); + if (node.asteriskToken) { + if (functionFlags & 2) { + if (languageVersion < 4) { + checkExternalEmitHelpers(node, 4096); + } + } + else if (languageVersion < 2 && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 256); + } + } + if (functionFlags & 1) { var expressionType = checkExpressionCached(node.expression, undefined); var expressionElementType = void 0; var nodeIsYieldStar = !!node.asteriskToken; if (nodeIsYieldStar) { - expressionElementType = checkElementTypeOfIterable(expressionType, node.expression); + expressionElementType = checkIteratedTypeOrElementType(expressionType, node.expression, false, (functionFlags & 2) !== 0); } if (func.type) { - var signatureElementType = getElementTypeOfIterableIterator(getTypeFromTypeNode(func.type)) || anyType; + var signatureElementType = getIteratedTypeOfGenerator(getTypeFromTypeNode(func.type), (functionFlags & 2) !== 0) || anyType; if (nodeIsYieldStar) { - checkTypeAssignableTo(expressionElementType, signatureElementType, node.expression, undefined); + checkTypeAssignableTo(functionFlags & 2 + ? getAwaitedType(expressionElementType, node.expression, ts.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) + : expressionElementType, signatureElementType, node.expression, undefined); } else { - checkTypeAssignableTo(expressionType, signatureElementType, node.expression, undefined); + checkTypeAssignableTo(functionFlags & 2 + ? getAwaitedType(expressionType, node.expression, ts.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) + : expressionType, signatureElementType, node.expression, undefined); } } } } return anyType; } - function checkConditionalExpression(node, contextualMapper) { + function checkConditionalExpression(node, checkMode) { checkExpression(node.condition); - var type1 = checkExpression(node.whenTrue, contextualMapper); - var type2 = checkExpression(node.whenFalse, contextualMapper); + var type1 = checkExpression(node.whenTrue, checkMode); + var type2 = checkExpression(node.whenFalse, checkMode); return getBestChoiceType(type1, type2); } function checkLiteralExpression(node) { @@ -32522,107 +36360,119 @@ var ts; } function checkExpressionWithContextualType(node, contextualType, contextualMapper) { var saveContextualType = node.contextualType; + var saveContextualMapper = node.contextualMapper; node.contextualType = contextualType; - var result = checkExpression(node, contextualMapper); + node.contextualMapper = contextualMapper; + var checkMode = contextualMapper === identityMapper ? 1 : + contextualMapper ? 2 : 0; + var result = checkExpression(node, checkMode); node.contextualType = saveContextualType; + node.contextualMapper = saveContextualMapper; return result; } - function checkExpressionCached(node, contextualMapper) { + function checkExpressionCached(node, checkMode) { var links = getNodeLinks(node); if (!links.resolvedType) { var saveFlowLoopStart = flowLoopStart; flowLoopStart = flowLoopCount; - links.resolvedType = checkExpression(node, contextualMapper); + links.resolvedType = checkExpression(node, checkMode); flowLoopStart = saveFlowLoopStart; } return links.resolvedType; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 182 || node.kind === 200; + return node.kind === 183 || node.kind === 201; } function checkDeclarationInitializer(declaration) { - var type = checkExpressionCached(declaration.initializer); + var type = getTypeOfExpression(declaration.initializer, true); return ts.getCombinedNodeFlags(declaration) & 2 || ts.getCombinedModifierFlags(declaration) & 64 && !ts.isParameterPropertyDeclaration(declaration) || isTypeAssertion(declaration.initializer) ? type : getWidenedLiteralType(type); } function isLiteralContextualType(contextualType) { if (contextualType) { - if (contextualType.flags & 16384) { - var apparentType = getApparentTypeOfTypeParameter(contextualType); - if (apparentType.flags & (2 | 4 | 8 | 16)) { + if (contextualType.flags & 540672) { + var constraint = getBaseConstraintOfType(contextualType) || emptyObjectType; + if (constraint.flags & (2 | 4 | 8 | 16)) { return true; } - contextualType = apparentType; + contextualType = constraint; } return maybeTypeOfKind(contextualType, (480 | 262144)); } return false; } - function checkExpressionForMutableLocation(node, contextualMapper) { - var type = checkExpression(node, contextualMapper); + function checkExpressionForMutableLocation(node, checkMode) { + var type = checkExpression(node, checkMode); return isTypeAssertion(node) || isLiteralContextualType(getContextualType(node)) ? type : getWidenedLiteralType(type); } - function checkPropertyAssignment(node, contextualMapper) { - if (node.name.kind === 142) { + function checkPropertyAssignment(node, checkMode) { + if (node.name.kind === 143) { checkComputedPropertyName(node.name); } - return checkExpressionForMutableLocation(node.initializer, contextualMapper); + return checkExpressionForMutableLocation(node.initializer, checkMode); } - function checkObjectLiteralMethod(node, contextualMapper) { + function checkObjectLiteralMethod(node, checkMode) { checkGrammarMethod(node); - if (node.name.kind === 142) { + if (node.name.kind === 143) { checkComputedPropertyName(node.name); } - var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - return instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); + var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); + return instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode); } - function instantiateTypeWithSingleGenericCallSignature(node, type, contextualMapper) { - if (isInferentialContext(contextualMapper)) { + function instantiateTypeWithSingleGenericCallSignature(node, type, checkMode) { + if (checkMode === 2) { var signature = getSingleCallSignature(type); if (signature && signature.typeParameters) { var contextualType = getApparentTypeOfContextualType(node); if (contextualType) { var contextualSignature = getSingleCallSignature(contextualType); if (contextualSignature && !contextualSignature.typeParameters) { - return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper)); + return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, getContextualMapper(node))); } } } } return type; } - function getTypeOfExpression(node) { - if (node.kind === 179 && node.expression.kind !== 96) { + function getTypeOfExpression(node, cache) { + if (node.kind === 180 && node.expression.kind !== 96 && !ts.isRequireCall(node, true)) { var funcType = checkNonNullExpression(node.expression); var signature = getSingleCallSignature(funcType); if (signature && !signature.typeParameters) { return getReturnTypeOfSignature(signature); } } - return checkExpression(node); + return cache ? checkExpressionCached(node) : checkExpression(node); } - function checkExpression(node, contextualMapper) { + function getContextFreeTypeOfExpression(node) { + var saveContextualType = node.contextualType; + node.contextualType = anyType; + var type = getTypeOfExpression(node); + node.contextualType = saveContextualType; + return type; + } + function checkExpression(node, checkMode) { var type; - if (node.kind === 141) { + if (node.kind === 142) { type = checkQualifiedName(node); } else { - var uninstantiatedType = checkExpressionWorker(node, contextualMapper); - type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); + var uninstantiatedType = checkExpressionWorker(node, checkMode); + type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode); } if (isConstEnumObjectType(type)) { - var ok = (node.parent.kind === 177 && node.parent.expression === node) || - (node.parent.kind === 178 && node.parent.expression === node) || - ((node.kind === 70 || node.kind === 141) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 178 && node.parent.expression === node) || + (node.parent.kind === 179 && node.parent.expression === node) || + ((node.kind === 70 || node.kind === 142) && isInRightSideOfImportOrExportAssignment(node)); if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); } } return type; } - function checkExpressionWorker(node, contextualMapper) { + function checkExpressionWorker(node, checkMode) { switch (node.kind) { case 70: return checkIdentifier(node); @@ -32637,66 +36487,70 @@ var ts; case 100: case 85: return checkLiteralExpression(node); - case 194: + case 195: return checkTemplateExpression(node); case 12: return stringType; case 11: return globalRegExpType; - case 175: - return checkArrayLiteral(node, contextualMapper); case 176: - return checkObjectLiteral(node, contextualMapper); + return checkArrayLiteral(node, checkMode); case 177: - return checkPropertyAccessExpression(node); + return checkObjectLiteral(node, checkMode); case 178: - return checkIndexedAccess(node); + return checkPropertyAccessExpression(node); case 179: + return checkIndexedAccess(node); case 180: - return checkCallExpression(node); case 181: - return checkTaggedTemplateExpression(node); - case 183: - return checkExpression(node.expression, contextualMapper); - case 197: - return checkClassExpression(node); - case 184: - case 185: - return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 187: - return checkTypeOfExpression(node); + return checkCallExpression(node); case 182: - case 200: - return checkAssertion(node); - case 201: - return checkNonNullAssertion(node); - case 186: - return checkDeleteExpression(node); - case 188: - return checkVoidExpression(node); - case 189: - return checkAwaitExpression(node); - case 190: - return checkPrefixUnaryExpression(node); - case 191: - return checkPostfixUnaryExpression(node); - case 192: - return checkBinaryExpression(node, contextualMapper); - case 193: - return checkConditionalExpression(node, contextualMapper); - case 196: - return checkSpreadExpression(node, contextualMapper); + return checkTaggedTemplateExpression(node); + case 184: + return checkExpression(node.expression, checkMode); case 198: + return checkClassExpression(node); + case 185: + case 186: + return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); + case 188: + return checkTypeOfExpression(node); + case 183: + case 201: + return checkAssertion(node); + case 202: + return checkNonNullAssertion(node); + case 203: + return checkMetaProperty(node); + case 187: + return checkDeleteExpression(node); + case 189: + return checkVoidExpression(node); + case 190: + return checkAwaitExpression(node); + case 191: + return checkPrefixUnaryExpression(node); + case 192: + return checkPostfixUnaryExpression(node); + case 193: + return checkBinaryExpression(node, checkMode); + case 194: + return checkConditionalExpression(node, checkMode); + case 197: + return checkSpreadExpression(node, checkMode); + case 199: return undefinedWideningType; - case 195: + case 196: return checkYieldExpression(node); - case 252: - return checkJsxExpression(node); - case 246: - return checkJsxElement(node); - case 247: - return checkJsxSelfClosingElement(node); + case 255: + return checkJsxExpression(node, checkMode); case 248: + return checkJsxElement(node); + case 249: + return checkJsxSelfClosingElement(node); + case 253: + return checkJsxAttributes(node, checkMode); + case 250: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return unknownType; @@ -32706,7 +36560,16 @@ var ts; grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected); } checkSourceElement(node.constraint); - getConstraintOfTypeParameter(getDeclaredTypeOfTypeParameter(getSymbolOfNode(node))); + checkSourceElement(node.default); + var typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node)); + if (!hasNonCircularBaseConstraint(typeParameter)) { + error(node.constraint, ts.Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(typeParameter)); + } + var constraintType = getConstraintOfTypeParameter(typeParameter); + var defaultType = getDefaultFromTypeParameter(typeParameter); + if (constraintType && defaultType) { + checkTypeAssignableTo(defaultType, getTypeWithThisArgument(constraintType, defaultType), node.default, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + } if (produceDiagnostics) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); } @@ -32717,7 +36580,7 @@ var ts; var func = ts.getContainingFunction(node); if (ts.getModifierFlags(node) & 92) { func = ts.getContainingFunction(node); - if (!(func.kind === 150 && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 151 && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -32728,7 +36591,7 @@ var ts; if (ts.indexOf(func.parameters, node) !== 0) { error(node, ts.Diagnostics.A_this_parameter_must_be_the_first_parameter); } - if (func.kind === 150 || func.kind === 154 || func.kind === 159) { + if (func.kind === 151 || func.kind === 155 || func.kind === 160) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } } @@ -32736,14 +36599,6 @@ var ts; error(node, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); } } - function isSyntacticallyValidGenerator(node) { - if (!node.asteriskToken || !node.body) { - return false; - } - return node.kind === 149 || - node.kind === 225 || - node.kind === 184; - } function getTypePredicateParameterIndex(parameterList, parameter) { if (parameterList) { for (var i = 0; i < parameterList.length; i++) { @@ -32783,9 +36638,9 @@ var ts; else if (parameterName) { var hasReportedError = false; for (var _i = 0, _a = parent.parameters; _i < _a.length; _i++) { - var name_23 = _a[_i].name; - if (ts.isBindingPattern(name_23) && - checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_23, parameterName, typePredicate.parameterName)) { + var name = _a[_i].name; + if (ts.isBindingPattern(name) && + checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, parameterName, typePredicate.parameterName)) { hasReportedError = true; break; } @@ -32798,16 +36653,16 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { + case 186: + case 154: + case 227: case 185: - case 153: - case 225: - case 184: - case 158: + case 159: + case 150: case 149: - case 148: - var parent_9 = node.parent; - if (node === parent_9.type) { - return parent_9; + var parent = node.parent; + if (node === parent.type) { + return parent; } } } @@ -32817,29 +36672,44 @@ var ts; if (ts.isOmittedExpression(element)) { continue; } - var name_24 = element.name; - if (name_24.kind === 70 && - name_24.text === predicateVariableName) { + var name = element.name; + if (name.kind === 70 && + name.text === predicateVariableName) { error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name_24.kind === 173 || - name_24.kind === 172) { - if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_24, predicateVariableNode, predicateVariableName)) { + else if (name.kind === 174 || + name.kind === 173) { + if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } } } } function checkSignatureDeclaration(node) { - if (node.kind === 155) { + if (node.kind === 156) { checkGrammarIndexSignature(node); } - else if (node.kind === 158 || node.kind === 225 || node.kind === 159 || - node.kind === 153 || node.kind === 150 || - node.kind === 154) { + else if (node.kind === 159 || node.kind === 227 || node.kind === 160 || + node.kind === 154 || node.kind === 151 || + node.kind === 155) { checkGrammarFunctionLikeDeclaration(node); } + var functionFlags = ts.getFunctionFlags(node); + if ((functionFlags & 7) === 2 && languageVersion < 4) { + checkExternalEmitHelpers(node, 64); + if (languageVersion < 2) { + checkExternalEmitHelpers(node, 128); + } + } + if ((functionFlags & 5) === 1) { + if (functionFlags & 2 && languageVersion < 4) { + checkExternalEmitHelpers(node, 2048); + } + else if (languageVersion < 2) { + checkExternalEmitHelpers(node, 128); + } + } checkTypeParameters(node.typeParameters); ts.forEach(node.parameters, checkParameter); if (node.type) { @@ -32847,29 +36717,32 @@ var ts; } if (produceDiagnostics) { checkCollisionWithArgumentsInGeneratedCode(node); - if (compilerOptions.noImplicitAny && !node.type) { + if (noImplicitAny && !node.type) { switch (node.kind) { - case 154: + case 155: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 153: + case 154: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } } if (node.type) { - if (languageVersion >= 2 && isSyntacticallyValidGenerator(node)) { + var functionFlags_1 = ts.getFunctionFlags(node); + if ((functionFlags_1 & 5) === 1) { var returnType = getTypeFromTypeNode(node.type); if (returnType === voidType) { error(node.type, ts.Diagnostics.A_generator_cannot_have_a_void_type_annotation); } else { - var generatorElementType = getElementTypeOfIterableIterator(returnType) || anyType; - var iterableIteratorInstantiation = createIterableIteratorType(generatorElementType); + var generatorElementType = getIteratedTypeOfGenerator(returnType, (functionFlags_1 & 2) !== 0) || anyType; + var iterableIteratorInstantiation = functionFlags_1 & 2 + ? createAsyncIterableIteratorType(generatorElementType) + : createIterableIteratorType(generatorElementType); checkTypeAssignableTo(iterableIteratorInstantiation, returnType, node.type); } } - else if (ts.isAsyncFunctionLike(node)) { + else if ((functionFlags_1 & 3) === 2) { checkAsyncFunctionReturnType(node); } } @@ -32879,11 +36752,18 @@ var ts; } } function checkClassForDuplicateDeclarations(node) { + var Declaration; + (function (Declaration) { + Declaration[Declaration["Getter"] = 1] = "Getter"; + Declaration[Declaration["Setter"] = 2] = "Setter"; + Declaration[Declaration["Method"] = 4] = "Method"; + Declaration[Declaration["Property"] = 3] = "Property"; + })(Declaration || (Declaration = {})); var instanceNames = ts.createMap(); var staticNames = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 150) { + if (member.kind === 151) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param)) { @@ -32892,36 +36772,65 @@ var ts; } } else { - var isStatic = ts.forEach(member.modifiers, function (m) { return m.kind === 114; }); + var isStatic = ts.getModifierFlags(member) & 32; var names = isStatic ? staticNames : instanceNames; var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name); if (memberName) { switch (member.kind) { - case 151: + case 152: addName(names, member.name, memberName, 1); break; - case 152: + case 153: addName(names, member.name, memberName, 2); break; - case 147: + case 148: addName(names, member.name, memberName, 3); break; + case 150: + addName(names, member.name, memberName, 4); + break; } } } } function addName(names, location, name, meaning) { - var prev = names[name]; + var prev = names.get(name); if (prev) { - if (prev & meaning) { + if (prev & 4) { + if (meaning !== 4) { + error(location, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(location)); + } + } + else if (prev & meaning) { error(location, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(location)); } else { - names[name] = prev | meaning; + names.set(name, prev | meaning); } } else { - names[name] = meaning; + names.set(name, meaning); + } + } + } + function checkClassForStaticPropertyNameConflicts(node) { + for (var _i = 0, _a = node.members; _i < _a.length; _i++) { + var member = _a[_i]; + var memberNameNode = member.name; + var isStatic = ts.getModifierFlags(member) & 32; + if (isStatic && memberNameNode) { + var memberName = ts.getPropertyNameForPropertyNameNode(memberNameNode); + switch (memberName) { + case "name": + case "length": + case "caller": + case "arguments": + case "prototype": + var message = ts.Diagnostics.Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1; + var className = getNameOfSymbol(getSymbolOfNode(node)); + error(memberNameNode, message, memberName, className); + break; + } } } } @@ -32929,7 +36838,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind == 146) { + if (member.kind === 147) { var memberName = void 0; switch (member.name.kind) { case 9: @@ -32940,18 +36849,18 @@ var ts; default: continue; } - if (names[memberName]) { + if (names.get(memberName)) { error(member.symbol.valueDeclaration.name, ts.Diagnostics.Duplicate_identifier_0, memberName); error(member.name, ts.Diagnostics.Duplicate_identifier_0, memberName); } else { - names[memberName] = true; + names.set(memberName, true); } } } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 227) { + if (node.kind === 229) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -32966,7 +36875,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 134: + case 135: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -33033,12 +36942,12 @@ var ts; if (n.kind === 98) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 184 && n.kind !== 225) { + else if (n.kind !== 185 && n.kind !== 227) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 147 && + return n.kind === 148 && !(ts.getModifierFlags(n) & 32) && !!n.initializer; } @@ -33058,7 +36967,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_3 = statements; _i < statements_3.length; _i++) { var statement = statements_3[_i]; - if (statement.kind === 207 && ts.isSuperCall(statement.expression)) { + if (statement.kind === 209 && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -33081,18 +36990,18 @@ var ts; checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 151) { + if (node.kind === 152) { if (!ts.isInAmbientContext(node) && ts.nodeIsPresent(node.body) && (node.flags & 128)) { if (!(node.flags & 256)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); } } } - if (node.name.kind === 142) { + if (node.name.kind === 143) { checkComputedPropertyName(node.name); } if (!ts.hasDynamicName(node)) { - var otherKind = node.kind === 151 ? 152 : 151; + var otherKind = node.kind === 152 ? 153 : 152; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { if ((ts.getModifierFlags(node) & 28) !== (ts.getModifierFlags(otherAccessor) & 28)) { @@ -33106,17 +37015,12 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 151) { + if (node.kind === 152) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } - if (node.parent.kind !== 176) { - checkSourceElement(node.body); - registerForUnusedIdentifiersCheck(node); - } - else { - checkNodeDeferred(node); - } + checkSourceElement(node.body); + registerForUnusedIdentifiersCheck(node); } function checkAccessorDeclarationTypesIdentical(first, second, getAnnotatedType, message) { var firstType = getAnnotatedType(first); @@ -33125,14 +37029,11 @@ var ts; error(first, message); } } - function checkAccessorDeferred(node) { - checkSourceElement(node.body); - registerForUnusedIdentifiersCheck(node); - } function checkMissingDeclaration(node) { checkDecorators(node); } function checkTypeArgumentConstraints(typeParameters, typeArgumentNodes) { + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); var typeArguments; var mapper; var result = true; @@ -33140,7 +37041,7 @@ var ts; var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { if (!typeArguments) { - typeArguments = ts.map(typeArgumentNodes, getTypeFromTypeNode); + typeArguments = fillMissingTypeArguments(ts.map(typeArgumentNodes, getTypeFromTypeNode), typeParameters, minTypeArgumentCount); mapper = createTypeMapper(typeParameters, typeArguments); } var typeArgument = typeArguments[i]; @@ -33191,25 +37092,42 @@ var ts; function checkUnionOrIntersectionType(node) { ts.forEach(node.types, checkSourceElement); } + function checkIndexedAccessIndexType(type, accessNode) { + if (!(type.flags & 524288)) { + return type; + } + var objectType = type.objectType; + var indexType = type.indexType; + if (isTypeAssignableTo(indexType, getIndexType(objectType))) { + return type; + } + if (maybeTypeOfKind(objectType, 540672) && isTypeOfKind(indexType, 340)) { + var constraint = getBaseConstraintOfType(objectType); + if (constraint && getIndexInfoOfType(constraint, 1)) { + return type; + } + } + error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); + return type; + } function checkIndexedAccessType(node) { - getTypeFromIndexedAccessTypeNode(node); + checkIndexedAccessIndexType(getTypeFromIndexedAccessTypeNode(node), node); } function checkMappedType(node) { checkSourceElement(node.typeParameter); checkSourceElement(node.type); var type = getTypeFromMappedTypeNode(node); var constraintType = getConstraintTypeFromMappedType(type); - var keyType = constraintType.flags & 16384 ? getApparentTypeOfTypeParameter(constraintType) : constraintType; - checkTypeAssignableTo(keyType, stringType, node.typeParameter.constraint); + checkTypeAssignableTo(constraintType, stringType, node.typeParameter.constraint); } function isPrivateWithinAmbient(node) { return (ts.getModifierFlags(node) & 8) && ts.isInAmbientContext(node); } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedModifierFlags(n); - if (n.parent.kind !== 227 && - n.parent.kind !== 226 && - n.parent.kind !== 197 && + if (n.parent.kind !== 229 && + n.parent.kind !== 228 && + n.parent.kind !== 198 && ts.isInAmbientContext(n)) { if (!(flags & 2)) { flags |= 1; @@ -33286,7 +37204,7 @@ var ts; if (subsequentNode.kind === node.kind) { var errorNode_1 = subsequentNode.name || subsequentNode; if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - var reportError = (node.kind === 149 || node.kind === 148) && + var reportError = (node.kind === 150 || node.kind === 149) && (ts.getModifierFlags(node) & 32) !== (ts.getModifierFlags(subsequentNode) & 32); if (reportError) { var diagnostic = ts.getModifierFlags(node) & 32 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; @@ -33315,15 +37233,15 @@ var ts; } var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; - for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { - var current = declarations_4[_i]; + for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { + var current = declarations_5[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 227 || node.parent.kind === 161 || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 229 || node.parent.kind === 162 || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 225 || node.kind === 149 || node.kind === 148 || node.kind === 150) { + if (node.kind === 227 || node.kind === 150 || node.kind === 149 || node.kind === 151) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -33374,8 +37292,8 @@ var ts; if (bodyDeclaration) { var signatures = getSignaturesOfSymbol(symbol); var bodySignature = getSignatureFromDeclaration(bodyDeclaration); - for (var _a = 0, signatures_3 = signatures; _a < signatures_3.length; _a++) { - var signature = signatures_3[_a]; + for (var _a = 0, signatures_4 = signatures; _a < signatures_4.length; _a++) { + var signature = signatures_4[_a]; if (!isImplementationCompatibleWithOverload(bodySignature, signature)) { error(signature.declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); break; @@ -33434,16 +37352,16 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 227: + case 229: return 2097152; - case 230: + case 232: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 ? 4194304 | 1048576 : 4194304; - case 226: - case 229: + case 228: + case 231: return 2097152 | 1048576; - case 234: + case 236: var result_3 = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_3 |= getDeclarationSpaces(d); }); @@ -33453,87 +37371,92 @@ var ts; } } } - function checkNonThenableType(type, location, message) { - type = getWidenedType(type); - if (!isTypeAny(type) && !isTypeNever(type) && isTypeAssignableTo(type, getGlobalThenableType())) { - if (location) { - if (!message) { - message = ts.Diagnostics.Operand_for_await_does_not_have_a_valid_callable_then_member; - } - error(location, message); - } - return unknownType; - } - return type; + function getAwaitedTypeOfPromise(type, errorNode, diagnosticMessage) { + var promisedType = getPromisedTypeOfPromise(type, errorNode); + return promisedType && getAwaitedType(promisedType, errorNode, diagnosticMessage); } - function getPromisedType(promise) { + function getPromisedTypeOfPromise(promise, errorNode) { if (isTypeAny(promise)) { return undefined; } - if (getObjectFlags(promise) & 4) { - if (promise.target === tryGetGlobalPromiseType() - || promise.target === getGlobalPromiseLikeType()) { - return promise.typeArguments[0]; - } + var typeAsPromise = promise; + if (typeAsPromise.promisedTypeOfPromise) { + return typeAsPromise.promisedTypeOfPromise; } - var globalPromiseLikeType = getInstantiatedGlobalPromiseLikeType(); - if (globalPromiseLikeType === emptyObjectType || !isTypeAssignableTo(promise, globalPromiseLikeType)) { - return undefined; + if (isReferenceToType(promise, getGlobalPromiseType(false))) { + return typeAsPromise.promisedTypeOfPromise = promise.typeArguments[0]; } var thenFunction = getTypeOfPropertyOfType(promise, "then"); - if (!thenFunction || isTypeAny(thenFunction)) { + if (isTypeAny(thenFunction)) { return undefined; } - var thenSignatures = getSignaturesOfType(thenFunction, 0); + var thenSignatures = thenFunction ? getSignaturesOfType(thenFunction, 0) : emptyArray; if (thenSignatures.length === 0) { + if (errorNode) { + error(errorNode, ts.Diagnostics.A_promise_must_have_a_then_method); + } return undefined; } - var onfulfilledParameterType = getTypeWithFacts(getUnionType(ts.map(thenSignatures, getTypeOfFirstParameterOfSignature)), 131072); + var onfulfilledParameterType = getTypeWithFacts(getUnionType(ts.map(thenSignatures, getTypeOfFirstParameterOfSignature)), 524288); if (isTypeAny(onfulfilledParameterType)) { return undefined; } var onfulfilledParameterSignatures = getSignaturesOfType(onfulfilledParameterType, 0); if (onfulfilledParameterSignatures.length === 0) { + if (errorNode) { + error(errorNode, ts.Diagnostics.The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback); + } return undefined; } - return getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), true); + return typeAsPromise.promisedTypeOfPromise = getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), true); } - function getTypeOfFirstParameterOfSignature(signature) { - return signature.parameters.length > 0 ? getTypeAtPosition(signature, 0) : neverType; + function checkAwaitedType(type, errorNode, diagnosticMessage) { + return getAwaitedType(type, errorNode, diagnosticMessage) || unknownType; } - function getAwaitedType(type) { - return checkAwaitedType(type, undefined, undefined); - } - function checkAwaitedType(type, location, message) { - return checkAwaitedTypeWorker(type); - function checkAwaitedTypeWorker(type) { - if (type.flags & 65536) { - var types = []; - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var constituentType = _a[_i]; - types.push(checkAwaitedTypeWorker(constituentType)); - } - return getUnionType(types, true); - } - else { - var promisedType = getPromisedType(type); - if (promisedType === undefined) { - return checkNonThenableType(type, location, message); - } - else { - if (type.id === promisedType.id || ts.indexOf(awaitedTypeStack, promisedType.id) >= 0) { - if (location) { - error(location, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method, symbolToString(type.symbol)); - } - return unknownType; - } - awaitedTypeStack.push(type.id); - var awaitedType = checkAwaitedTypeWorker(promisedType); - awaitedTypeStack.pop(); - return awaitedType; - } - } + function getAwaitedType(type, errorNode, diagnosticMessage) { + var typeAsAwaitable = type; + if (typeAsAwaitable.awaitedTypeOfType) { + return typeAsAwaitable.awaitedTypeOfType; } + if (isTypeAny(type)) { + return typeAsAwaitable.awaitedTypeOfType = type; + } + if (type.flags & 65536) { + var types = void 0; + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var constituentType = _a[_i]; + types = ts.append(types, getAwaitedType(constituentType, errorNode, diagnosticMessage)); + } + if (!types) { + return undefined; + } + return typeAsAwaitable.awaitedTypeOfType = getUnionType(types, true); + } + var promisedType = getPromisedTypeOfPromise(type); + if (promisedType) { + if (type.id === promisedType.id || ts.indexOf(awaitedTypeStack, promisedType.id) >= 0) { + if (errorNode) { + error(errorNode, ts.Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method); + } + return undefined; + } + awaitedTypeStack.push(type.id); + var awaitedType = getAwaitedType(promisedType, errorNode, diagnosticMessage); + awaitedTypeStack.pop(); + if (!awaitedType) { + return undefined; + } + return typeAsAwaitable.awaitedTypeOfType = awaitedType; + } + var thenFunction = getTypeOfPropertyOfType(type, "then"); + if (thenFunction && getSignaturesOfType(thenFunction, 0).length > 0) { + if (errorNode) { + ts.Debug.assert(!!diagnosticMessage); + error(errorNode, diagnosticMessage); + } + return undefined; + } + return typeAsAwaitable.awaitedTypeOfType = type; } function checkAsyncFunctionReturnType(node) { var returnType = getTypeFromTypeNode(node.type); @@ -33541,8 +37464,8 @@ var ts; if (returnType === unknownType) { return unknownType; } - var globalPromiseType = getGlobalPromiseType(); - if (globalPromiseType !== emptyGenericType && globalPromiseType !== getTargetType(returnType)) { + var globalPromiseType = getGlobalPromiseType(true); + if (globalPromiseType !== emptyGenericType && !isReferenceToType(returnType, globalPromiseType)) { error(node.type, ts.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type); return unknownType; } @@ -33560,10 +37483,15 @@ var ts; var promiseConstructorSymbol = resolveEntityName(promiseConstructorName, 107455, true); var promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : unknownType; if (promiseConstructorType === unknownType) { - error(node.type, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, ts.entityNameToString(promiseConstructorName)); + if (promiseConstructorName.kind === 70 && promiseConstructorName.text === "Promise" && getTargetType(returnType) === getGlobalPromiseType(false)) { + error(node.type, ts.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option); + } + else { + error(node.type, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, ts.entityNameToString(promiseConstructorName)); + } return unknownType; } - var globalPromiseConstructorLikeType = getGlobalPromiseConstructorLikeType(); + var globalPromiseConstructorLikeType = getGlobalPromiseConstructorLikeType(true); if (globalPromiseConstructorLikeType === emptyObjectType) { error(node.type, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, ts.entityNameToString(promiseConstructorName)); return unknownType; @@ -33578,7 +37506,7 @@ var ts; return unknownType; } } - return checkAwaitedType(returnType, node, ts.Diagnostics.An_async_function_or_method_must_have_a_valid_awaitable_return_type); + return checkAwaitedType(returnType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } function checkDecorator(node) { var signature = getResolvedSignature(node); @@ -33590,22 +37518,22 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 226: + case 228: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 144: + case 145: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 147: + case 148: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 149: - case 151: + case 150: case 152: + case 153: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -33624,6 +37552,9 @@ var ts; markAliasSymbolAsReferenced(rootSymbol); } } + function getParameterTypeNodeForDecoratorCheck(node) { + return node.dotDotDotToken ? ts.getRestParameterElementType(node.type) : node.type; + } function checkDecorators(node) { if (!node.decorators) { return; @@ -33634,28 +37565,36 @@ var ts; if (!compilerOptions.experimentalDecorators) { error(node, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning); } + var firstDecorator = node.decorators[0]; + checkExternalEmitHelpers(firstDecorator, 8); + if (node.kind === 145) { + checkExternalEmitHelpers(firstDecorator, 32); + } if (compilerOptions.emitDecoratorMetadata) { + checkExternalEmitHelpers(firstDecorator, 16); switch (node.kind) { - case 226: + case 228: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { var parameter = _a[_i]; - markTypeNodeAsReferenced(parameter.type); + markTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } } break; - case 149: - case 151: + case 150: case 152: + case 153: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; - markTypeNodeAsReferenced(parameter.type); + markTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markTypeNodeAsReferenced(node.type); break; - case 147: - case 144: + case 148: + markTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); + break; + case 145: markTypeNodeAsReferenced(node.type); break; } @@ -33667,6 +37606,7 @@ var ts; checkFunctionOrMethodDeclaration(node) || checkGrammarForGenerator(node); checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); } @@ -33674,8 +37614,8 @@ var ts; function checkFunctionOrMethodDeclaration(node) { checkDecorators(node); checkSignatureDeclaration(node); - var isAsync = ts.isAsyncFunctionLike(node); - if (node.name && node.name.kind === 142) { + var functionFlags = ts.getFunctionFlags(node); + if (node.name && node.name.kind === 143) { checkComputedPropertyName(node.name); } if (!ts.hasDynamicName(node)) { @@ -33693,15 +37633,17 @@ var ts; } } checkSourceElement(node.body); - if (!node.asteriskToken) { - var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); + if ((functionFlags & 1) === 0) { + var returnOrPromisedType = node.type && (functionFlags & 2 + ? checkAsyncFunctionReturnType(node) + : getTypeFromTypeNode(node.type)); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } if (produceDiagnostics && !node.type) { - if (compilerOptions.noImplicitAny && ts.nodeIsMissing(node.body) && !isPrivateWithinAmbient(node)) { + if (noImplicitAny && ts.nodeIsMissing(node.body) && !isPrivateWithinAmbient(node)) { reportImplicitAnyError(node, anyType); } - if (node.asteriskToken && ts.nodeIsPresent(node.body)) { + if (functionFlags & 1 && ts.nodeIsPresent(node.body)) { getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } } @@ -33717,56 +37659,54 @@ var ts; for (var _i = 0, deferredUnusedIdentifierNodes_1 = deferredUnusedIdentifierNodes; _i < deferredUnusedIdentifierNodes_1.length; _i++) { var node = deferredUnusedIdentifierNodes_1[_i]; switch (node.kind) { - case 261: - case 230: + case 264: + case 232: checkUnusedModuleMembers(node); break; - case 226: - case 197: + case 228: + case 198: checkUnusedClassMembers(node); checkUnusedTypeParameters(node); break; - case 227: + case 229: checkUnusedTypeParameters(node); break; - case 204: - case 232: - case 211: - case 212: + case 206: + case 234: case 213: + case 214: + case 215: checkUnusedLocalsAndParameters(node); break; - case 150: - case 184: - case 225: - case 185: - case 149: case 151: + case 185: + case 227: + case 186: + case 150: case 152: + case 153: if (node.body) { checkUnusedLocalsAndParameters(node); } checkUnusedTypeParameters(node); break; - case 148: - case 153: + case 149: case 154: case 155: - case 158: + case 156: case 159: + case 160: checkUnusedTypeParameters(node); break; } - ; } } } function checkUnusedLocalsAndParameters(node) { - if (node.parent.kind !== 227 && noUnusedIdentifiers && !ts.isInAmbientContext(node)) { - var _loop_3 = function (key) { - var local = node.locals[key]; + if (node.parent.kind !== 229 && noUnusedIdentifiers && !ts.isInAmbientContext(node)) { + node.locals.forEach(function (local) { if (!local.isReferenced) { - if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 144) { + if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 145) { var parameter = ts.getRootDeclaration(local.valueDeclaration); if (compilerOptions.noUnusedParameters && !ts.isParameterPropertyDeclaration(parameter) && @@ -33779,22 +37719,28 @@ var ts; ts.forEach(local.declarations, function (d) { return errorUnusedLocal(d.name || d, local.name); }); } } - }; - for (var key in node.locals) { - _loop_3(key); - } + }); } } + function isRemovedPropertyFromObjectSpread(node) { + if (ts.isBindingElement(node) && ts.isObjectBindingPattern(node.parent)) { + var lastElement = ts.lastOrUndefined(node.parent.elements); + return lastElement !== node && !!lastElement.dotDotDotToken; + } + return false; + } function errorUnusedLocal(node, name) { if (isIdentifierThatStartsWithUnderScore(node)) { var declaration = ts.getRootDeclaration(node.parent); - if (declaration.kind === 223 && - (declaration.parent.parent.kind === 212 || - declaration.parent.parent.kind === 213)) { + if (declaration.kind === 225 && + (declaration.parent.parent.kind === 214 || + declaration.parent.parent.kind === 215)) { return; } } - error(node, ts.Diagnostics._0_is_declared_but_never_used, name); + if (!isRemovedPropertyFromObjectSpread(node.kind === 70 ? node.parent : node)) { + error(node, ts.Diagnostics._0_is_declared_but_never_used, name); + } } function parameterNameStartsWithUnderscore(parameterName) { return parameterName && isIdentifierThatStartsWithUnderScore(parameterName); @@ -33807,12 +37753,12 @@ var ts; if (node.members) { for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 149 || member.kind === 147) { + if (member.kind === 150 || member.kind === 148) { if (!member.symbol.isReferenced && ts.getModifierFlags(member) & 8) { error(member.name, ts.Diagnostics._0_is_declared_but_never_used, member.symbol.name); } } - else if (member.kind === 150) { + else if (member.kind === 151) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.getModifierFlags(parameter) & 8) { @@ -33843,21 +37789,20 @@ var ts; } function checkUnusedModuleMembers(node) { if (compilerOptions.noUnusedLocals && !ts.isInAmbientContext(node)) { - for (var key in node.locals) { - var local = node.locals[key]; + node.locals.forEach(function (local) { if (!local.isReferenced && !local.exportSymbol) { for (var _i = 0, _a = local.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; if (!ts.isAmbientModule(declaration)) { - error(declaration.name, ts.Diagnostics._0_is_declared_but_never_used, local.name); + errorUnusedLocal(declaration.name, local.name); } } } - } + }); } } function checkBlock(node) { - if (node.kind === 204) { + if (node.kind === 206) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); @@ -33879,19 +37824,19 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 147 || - node.kind === 146 || + if (node.kind === 148 || + node.kind === 147 || + node.kind === 150 || node.kind === 149 || - node.kind === 148 || - node.kind === 151 || - node.kind === 152) { + node.kind === 152 || + node.kind === 153) { return false; } if (ts.isInAmbientContext(node)) { return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 144 && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 145 && ts.nodeIsMissing(root.parent.body)) { return false; } return true; @@ -33901,9 +37846,13 @@ var ts; potentialThisCollisions.push(node); } } + function checkCollisionWithCapturedNewTargetVariable(node, name) { + if (needCollisionCheckForIdentifier(node, name, "_newTarget")) { + potentialNewTargetCollisions.push(node); + } + } function checkIfThisIsCapturedInEnclosingScope(node) { - var current = node; - while (current) { + ts.findAncestor(node, function (current) { if (getNodeCheckFlags(current) & 4) { var isDeclaration_1 = node.kind !== 70; if (isDeclaration_1) { @@ -33912,10 +37861,23 @@ var ts; else { error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference); } - return; + return true; } - current = current.parent; - } + }); + } + function checkIfNewTargetIsCapturedInEnclosingScope(node) { + ts.findAncestor(node, function (current) { + if (getNodeCheckFlags(current) & 8) { + var isDeclaration_2 = node.kind !== 70; + if (isDeclaration_2) { + error(node.name, ts.Diagnostics.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference); + } + else { + error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference); + } + return true; + } + }); } function checkCollisionWithCapturedSuperVariable(node, name) { if (!needCollisionCheckForIdentifier(node, name, "_super")) { @@ -33926,8 +37888,8 @@ var ts; return; } if (ts.getClassExtendsHeritageClauseElement(enclosingClass)) { - var isDeclaration_2 = node.kind !== 70; - if (isDeclaration_2) { + var isDeclaration_3 = node.kind !== 70; + if (isDeclaration_3) { error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); } else { @@ -33942,23 +37904,23 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } - if (node.kind === 230 && ts.getModuleInstanceState(node) !== 1) { + if (node.kind === 232 && ts.getModuleInstanceState(node) !== 1) { return; } var parent = getDeclarationContainer(node); - if (parent.kind === 261 && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 264 && ts.isExternalOrCommonJsModule(parent)) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } function checkCollisionWithGlobalPromiseInGeneratedCode(node, name) { - if (!needCollisionCheckForIdentifier(node, name, "Promise")) { + if (languageVersion >= 4 || !needCollisionCheckForIdentifier(node, name, "Promise")) { return; } - if (node.kind === 230 && ts.getModuleInstanceState(node) !== 1) { + if (node.kind === 232 && ts.getModuleInstanceState(node) !== 1) { return; } var parent = getDeclarationContainer(node); - if (parent.kind === 261 && ts.isExternalOrCommonJsModule(parent) && parent.flags & 8192) { + if (parent.kind === 264 && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -33966,7 +37928,7 @@ var ts; if ((ts.getCombinedNodeFlags(node) & 3) !== 0 || ts.isParameterDeclaration(node)) { return; } - if (node.kind === 223 && !node.initializer) { + if (node.kind === 225 && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -33976,25 +37938,25 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 224); - var container = varDeclList.parent.kind === 205 && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 226); + var container = varDeclList.parent.kind === 207 && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; var namesShareScope = container && - (container.kind === 204 && ts.isFunctionLike(container.parent) || - container.kind === 231 || - container.kind === 230 || - container.kind === 261); + (container.kind === 206 && ts.isFunctionLike(container.parent) || + container.kind === 233 || + container.kind === 232 || + container.kind === 264); if (!namesShareScope) { - var name_25 = symbolToString(localDeclarationSymbol); - error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_25, name_25); + var name = symbolToString(localDeclarationSymbol); + error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name); } } } } } function checkParameterInitializer(node) { - if (ts.getRootDeclaration(node).kind !== 144) { + if (ts.getRootDeclaration(node).kind !== 145) { return; } var func = ts.getContainingFunction(node); @@ -34003,7 +37965,7 @@ var ts; if (ts.isTypeNode(n) || ts.isDeclarationName(n)) { return; } - if (n.kind === 177) { + if (n.kind === 178) { return visit(n.expression); } else if (n.kind === 70) { @@ -34017,21 +37979,21 @@ var ts; } var enclosingContainer = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); if (enclosingContainer === func) { - if (symbol.valueDeclaration.kind === 144) { + if (symbol.valueDeclaration.kind === 145 || + symbol.valueDeclaration.kind === 175) { if (symbol.valueDeclaration.pos < node.pos) { return; } - var current = n; - while (current !== node.initializer) { - if (ts.isFunctionLike(current.parent)) { - return; + if (ts.findAncestor(n, function (current) { + if (current === node.initializer) { + return "quit"; } - if (current.parent.kind === 147 && - !(ts.hasModifier(current.parent, 32)) && - ts.isClassLike(current.parent.parent)) { - return; - } - current = current.parent; + return ts.isFunctionLike(current.parent) || + (current.parent.kind === 148 && + !(ts.hasModifier(current.parent, 32)) && + ts.isClassLike(current.parent.parent)); + })) { + return; } } error(n, ts.Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, ts.declarationNameToString(node.name), ts.declarationNameToString(n)); @@ -34048,34 +38010,40 @@ var ts; function checkVariableLikeDeclaration(node) { checkDecorators(node); checkSourceElement(node.type); - if (node.name.kind === 142) { + if (node.name.kind === 143) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 174) { - if (node.propertyName && node.propertyName.kind === 142) { + if (node.kind === 175) { + if (node.parent.kind === 173 && languageVersion < 5) { + checkExternalEmitHelpers(node, 4); + } + if (node.propertyName && node.propertyName.kind === 143) { checkComputedPropertyName(node.propertyName); } - var parent_10 = node.parent.parent; - var parentType = getTypeForBindingElementParent(parent_10); - var name_26 = node.propertyName || node.name; - var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name_26)); + var parent = node.parent.parent; + var parentType = getTypeForBindingElementParent(parent); + var name = node.propertyName || node.name; + var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name)); markPropertyAsReferenced(property); - if (parent_10.initializer && property && getParentOfSymbol(property)) { - checkClassPropertyAccess(parent_10, parent_10.initializer, parentType, property); + if (parent.initializer && property) { + checkPropertyAccessibility(parent, parent.initializer, parentType, property); } } if (ts.isBindingPattern(node.name)) { + if (node.name.kind === 174 && languageVersion < 2 && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 512); + } ts.forEach(node.name.elements, checkSourceElement); } - if (node.initializer && ts.getRootDeclaration(node).kind === 144 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 145 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } if (ts.isBindingPattern(node.name)) { - if (node.initializer && node.parent.parent.kind !== 212) { + if (node.initializer && node.parent.parent.kind !== 214) { checkTypeAssignableTo(checkExpressionCached(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, undefined); checkParameterInitializer(node); } @@ -34084,7 +38052,7 @@ var ts; var symbol = getSymbolOfNode(node); var type = convertAutoToAny(getTypeOfVariableOrParameterOrProperty(symbol)); if (node === symbol.valueDeclaration) { - if (node.initializer && node.parent.parent.kind !== 212) { + if (node.initializer && node.parent.parent.kind !== 214) { checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, undefined); checkParameterInitializer(node); } @@ -34102,20 +38070,21 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 147 && node.kind !== 146) { + if (node.kind !== 148 && node.kind !== 147) { checkExportsOnMergedDeclarations(node); - if (node.kind === 223 || node.kind === 174) { + if (node.kind === 225 || node.kind === 175) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 144 && right.kind === 223) || - (left.kind === 223 && right.kind === 144)) { + if ((left.kind === 145 && right.kind === 225) || + (left.kind === 225 && right.kind === 145)) { return true; } if (ts.hasQuestionToken(left) !== ts.hasQuestionToken(right)) { @@ -34142,8 +38111,8 @@ var ts; ts.forEach(node.declarationList.declarations, checkSourceElement); } function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) { - if (node.modifiers && node.parent.kind === 176) { - if (ts.isAsyncFunctionLike(node)) { + if (node.modifiers && node.parent.kind === 177) { + if (ts.getFunctionFlags(node) & 2) { if (node.modifiers.length > 1) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } @@ -34161,7 +38130,7 @@ var ts; checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 206) { + if (node.thenStatement.kind === 208) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -34178,12 +38147,12 @@ var ts; } function checkForStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 224) { + if (node.initializer && node.initializer.kind === 226) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 224) { + if (node.initializer.kind === 226) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -34201,13 +38170,23 @@ var ts; } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 224) { + if (node.kind === 215) { + if (node.awaitModifier) { + if (languageVersion < 4) { + checkExternalEmitHelpers(node, 8192); + } + } + else if (languageVersion < 2 && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 256); + } + } + if (node.initializer.kind === 226) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; - var iteratedType = checkRightHandSideOfForOf(node.expression); - if (varExpr.kind === 175 || varExpr.kind === 176) { + var iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier); + if (varExpr.kind === 176 || varExpr.kind === 177) { checkDestructuringAssignment(varExpr, iteratedType || unknownType); } else { @@ -34226,7 +38205,7 @@ var ts; function checkForInStatement(node) { checkGrammarForInOrForOfStatement(node); var rightType = checkNonNullExpression(node.expression); - if (node.initializer.kind === 224) { + if (node.initializer.kind === 226) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -34236,7 +38215,7 @@ var ts; else { var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 175 || varExpr.kind === 176) { + if (varExpr.kind === 176 || varExpr.kind === 177) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -34246,7 +38225,7 @@ var ts; checkReferenceExpression(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access); } } - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 | 16384 | 524288)) { + if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 | 540672 | 16777216)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } checkSourceElement(node.statement); @@ -34261,146 +38240,67 @@ var ts; checkVariableDeclaration(decl); } } - function checkRightHandSideOfForOf(rhsExpression) { + function checkRightHandSideOfForOf(rhsExpression, awaitModifier) { var expressionType = checkNonNullExpression(rhsExpression); - return checkIteratedTypeOrElementType(expressionType, rhsExpression, true); + return checkIteratedTypeOrElementType(expressionType, rhsExpression, true, awaitModifier !== undefined); } - function checkIteratedTypeOrElementType(inputType, errorNode, allowStringInput) { + function checkIteratedTypeOrElementType(inputType, errorNode, allowStringInput, allowAsyncIterable) { if (isTypeAny(inputType)) { return inputType; } - if (languageVersion >= 2) { - return checkElementTypeOfIterable(inputType, errorNode); - } - if (allowStringInput) { - return checkElementTypeOfArrayOrString(inputType, errorNode); - } - if (isArrayLikeType(inputType)) { - var indexType = getIndexTypeOfType(inputType, 1); - if (indexType) { - return indexType; - } - } - if (errorNode) { - error(errorNode, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(inputType)); - } - return unknownType; + return getIteratedTypeOrElementType(inputType, errorNode, allowStringInput, allowAsyncIterable, true) || anyType; } - function checkElementTypeOfIterable(iterable, errorNode) { - var elementType = getElementTypeOfIterable(iterable, errorNode); - if (errorNode && elementType) { - checkTypeAssignableTo(iterable, createIterableType(elementType), errorNode); - } - return elementType || anyType; - } - function getElementTypeOfIterable(type, errorNode) { - if (isTypeAny(type)) { - return undefined; - } - var typeAsIterable = type; - if (!typeAsIterable.iterableElementType) { - if ((getObjectFlags(type) & 4) && type.target === getGlobalIterableType()) { - typeAsIterable.iterableElementType = type.typeArguments[0]; - } - else { - var iteratorFunction = getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("iterator")); - if (isTypeAny(iteratorFunction)) { - return undefined; - } - var iteratorFunctionSignatures = iteratorFunction ? getSignaturesOfType(iteratorFunction, 0) : emptyArray; - if (iteratorFunctionSignatures.length === 0) { - if (errorNode) { - error(errorNode, ts.Diagnostics.Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator); - } - return undefined; - } - typeAsIterable.iterableElementType = getElementTypeOfIterator(getUnionType(ts.map(iteratorFunctionSignatures, getReturnTypeOfSignature), true), errorNode); + function getIteratedTypeOrElementType(inputType, errorNode, allowStringInput, allowAsyncIterable, checkAssignability) { + var uplevelIteration = languageVersion >= 2; + var downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration; + if (uplevelIteration || downlevelIteration || allowAsyncIterable) { + var iteratedType = getIteratedTypeOfIterable(inputType, uplevelIteration ? errorNode : undefined, allowAsyncIterable, allowAsyncIterable, checkAssignability); + if (iteratedType || uplevelIteration) { + return iteratedType; } } - return typeAsIterable.iterableElementType; - } - function getElementTypeOfIterator(type, errorNode) { - if (isTypeAny(type)) { - return undefined; - } - var typeAsIterator = type; - if (!typeAsIterator.iteratorElementType) { - if ((getObjectFlags(type) & 4) && type.target === getGlobalIteratorType()) { - typeAsIterator.iteratorElementType = type.typeArguments[0]; - } - else { - var iteratorNextFunction = getTypeOfPropertyOfType(type, "next"); - if (isTypeAny(iteratorNextFunction)) { - return undefined; - } - var iteratorNextFunctionSignatures = iteratorNextFunction ? getSignaturesOfType(iteratorNextFunction, 0) : emptyArray; - if (iteratorNextFunctionSignatures.length === 0) { - if (errorNode) { - error(errorNode, ts.Diagnostics.An_iterator_must_have_a_next_method); - } - return undefined; - } - var iteratorNextResult = getUnionType(ts.map(iteratorNextFunctionSignatures, getReturnTypeOfSignature), true); - if (isTypeAny(iteratorNextResult)) { - return undefined; - } - var iteratorNextValue = getTypeOfPropertyOfType(iteratorNextResult, "value"); - if (!iteratorNextValue) { - if (errorNode) { - error(errorNode, ts.Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); - } - return undefined; - } - typeAsIterator.iteratorElementType = iteratorNextValue; - } - } - return typeAsIterator.iteratorElementType; - } - function getElementTypeOfIterableIterator(type) { - if (isTypeAny(type)) { - return undefined; - } - if ((getObjectFlags(type) & 4) && type.target === getGlobalIterableIteratorType()) { - return type.typeArguments[0]; - } - return getElementTypeOfIterable(type, undefined) || - getElementTypeOfIterator(type, undefined); - } - function checkElementTypeOfArrayOrString(arrayOrStringType, errorNode) { - ts.Debug.assert(languageVersion < 2); - var arrayType = arrayOrStringType; - if (arrayOrStringType.flags & 65536) { - var arrayTypes = arrayOrStringType.types; - var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 262178); }); - if (filteredTypes !== arrayTypes) { - arrayType = getUnionType(filteredTypes, true); - } - } - else if (arrayOrStringType.flags & 262178) { - arrayType = neverType; - } - var hasStringConstituent = arrayOrStringType !== arrayType; + var arrayType = inputType; var reportedError = false; - if (hasStringConstituent) { - if (languageVersion < 1) { - error(errorNode, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); - reportedError = true; + var hasStringConstituent = false; + if (allowStringInput) { + if (arrayType.flags & 65536) { + var arrayTypes = inputType.types; + var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 262178); }); + if (filteredTypes !== arrayTypes) { + arrayType = getUnionType(filteredTypes, true); + } } - if (arrayType.flags & 8192) { - return stringType; + else if (arrayType.flags & 262178) { + arrayType = neverType; + } + hasStringConstituent = arrayType !== inputType; + if (hasStringConstituent) { + if (languageVersion < 1) { + if (errorNode) { + error(errorNode, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); + reportedError = true; + } + } + if (arrayType.flags & 8192) { + return stringType; + } } } if (!isArrayLikeType(arrayType)) { - if (!reportedError) { - var diagnostic = hasStringConstituent - ? ts.Diagnostics.Type_0_is_not_an_array_type - : ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type; + if (errorNode && !reportedError) { + var diagnostic = !allowStringInput || hasStringConstituent + ? downlevelIteration + ? ts.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator + : ts.Diagnostics.Type_0_is_not_an_array_type + : downlevelIteration + ? ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator + : ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type; error(errorNode, diagnostic, typeToString(arrayType)); } - return hasStringConstituent ? stringType : unknownType; + return hasStringConstituent ? stringType : undefined; } - var arrayElementType = getIndexTypeOfType(arrayType, 1) || unknownType; - if (hasStringConstituent) { + var arrayElementType = getIndexTypeOfType(arrayType, 1); + if (hasStringConstituent && arrayElementType) { if (arrayElementType.flags & 262178) { return stringType; } @@ -34408,14 +38308,131 @@ var ts; } return arrayElementType; } + function getIteratedTypeOfIterable(type, errorNode, isAsyncIterable, allowNonAsyncIterables, checkAssignability) { + if (isTypeAny(type)) { + return undefined; + } + var typeAsIterable = type; + if (isAsyncIterable ? typeAsIterable.iteratedTypeOfAsyncIterable : typeAsIterable.iteratedTypeOfIterable) { + return isAsyncIterable ? typeAsIterable.iteratedTypeOfAsyncIterable : typeAsIterable.iteratedTypeOfIterable; + } + if (isAsyncIterable) { + if (isReferenceToType(type, getGlobalAsyncIterableType(false)) || + isReferenceToType(type, getGlobalAsyncIterableIteratorType(false))) { + return typeAsIterable.iteratedTypeOfAsyncIterable = type.typeArguments[0]; + } + } + if (!isAsyncIterable || allowNonAsyncIterables) { + if (isReferenceToType(type, getGlobalIterableType(false)) || + isReferenceToType(type, getGlobalIterableIteratorType(false))) { + return isAsyncIterable + ? typeAsIterable.iteratedTypeOfAsyncIterable = type.typeArguments[0] + : typeAsIterable.iteratedTypeOfIterable = type.typeArguments[0]; + } + } + var iteratorMethodSignatures; + var mayBeIterable = false; + if (isAsyncIterable) { + var iteratorMethod = getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("asyncIterator")); + if (isTypeAny(iteratorMethod)) { + return undefined; + } + iteratorMethodSignatures = iteratorMethod && getSignaturesOfType(iteratorMethod, 0); + } + if (!isAsyncIterable || (allowNonAsyncIterables && !ts.some(iteratorMethodSignatures))) { + var iteratorMethod = getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("iterator")); + if (isTypeAny(iteratorMethod)) { + return undefined; + } + iteratorMethodSignatures = iteratorMethod && getSignaturesOfType(iteratorMethod, 0); + mayBeIterable = true; + } + if (ts.some(iteratorMethodSignatures)) { + var iteratorMethodReturnType = getUnionType(ts.map(iteratorMethodSignatures, getReturnTypeOfSignature), true); + var iteratedType = getIteratedTypeOfIterator(iteratorMethodReturnType, errorNode, false); + if (checkAssignability && errorNode && iteratedType) { + checkTypeAssignableTo(type, mayBeIterable + ? createIterableType(iteratedType) + : createAsyncIterableType(iteratedType), errorNode); + } + return isAsyncIterable + ? typeAsIterable.iteratedTypeOfAsyncIterable = iteratedType + : typeAsIterable.iteratedTypeOfIterable = iteratedType; + } + if (errorNode) { + error(errorNode, isAsyncIterable + ? ts.Diagnostics.Type_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator + : ts.Diagnostics.Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator); + } + return undefined; + } + function getIteratedTypeOfIterator(type, errorNode, isAsyncIterator) { + if (isTypeAny(type)) { + return undefined; + } + var typeAsIterator = type; + if (isAsyncIterator ? typeAsIterator.iteratedTypeOfAsyncIterator : typeAsIterator.iteratedTypeOfIterator) { + return isAsyncIterator ? typeAsIterator.iteratedTypeOfAsyncIterator : typeAsIterator.iteratedTypeOfIterator; + } + var getIteratorType = isAsyncIterator ? getGlobalAsyncIteratorType : getGlobalIteratorType; + if (isReferenceToType(type, getIteratorType(false))) { + return isAsyncIterator + ? typeAsIterator.iteratedTypeOfAsyncIterator = type.typeArguments[0] + : typeAsIterator.iteratedTypeOfIterator = type.typeArguments[0]; + } + var nextMethod = getTypeOfPropertyOfType(type, "next"); + if (isTypeAny(nextMethod)) { + return undefined; + } + var nextMethodSignatures = nextMethod ? getSignaturesOfType(nextMethod, 0) : emptyArray; + if (nextMethodSignatures.length === 0) { + if (errorNode) { + error(errorNode, isAsyncIterator + ? ts.Diagnostics.An_async_iterator_must_have_a_next_method + : ts.Diagnostics.An_iterator_must_have_a_next_method); + } + return undefined; + } + var nextResult = getUnionType(ts.map(nextMethodSignatures, getReturnTypeOfSignature), true); + if (isTypeAny(nextResult)) { + return undefined; + } + if (isAsyncIterator) { + nextResult = getAwaitedTypeOfPromise(nextResult, errorNode, ts.Diagnostics.The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property); + if (isTypeAny(nextResult)) { + return undefined; + } + } + var nextValue = nextResult && getTypeOfPropertyOfType(nextResult, "value"); + if (!nextValue) { + if (errorNode) { + error(errorNode, isAsyncIterator + ? ts.Diagnostics.The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property + : ts.Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); + } + return undefined; + } + return isAsyncIterator + ? typeAsIterator.iteratedTypeOfAsyncIterator = nextValue + : typeAsIterator.iteratedTypeOfIterator = nextValue; + } + function getIteratedTypeOfGenerator(returnType, isAsyncGenerator) { + if (isTypeAny(returnType)) { + return undefined; + } + return getIteratedTypeOfIterable(returnType, undefined, isAsyncGenerator, false, false) + || getIteratedTypeOfIterator(returnType, undefined, isAsyncGenerator); + } function checkBreakOrContinueStatement(node) { checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node); } function isGetAccessorWithAnnotatedSetAccessor(node) { - return !!(node.kind === 151 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 152))); + return !!(node.kind === 152 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 153))); } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { - var unwrappedReturnType = ts.isAsyncFunctionLike(func) ? getPromisedType(returnType) : returnType; + var unwrappedReturnType = (ts.getFunctionFlags(func) & 3) === 2 + ? getPromisedTypeOfPromise(returnType) + : returnType; return unwrappedReturnType && maybeTypeOfKind(unwrappedReturnType, 1024 | 1); } function checkReturnStatement(node) { @@ -34431,40 +38448,41 @@ var ts; var returnType = getReturnTypeOfSignature(signature); if (strictNullChecks || node.expression || returnType.flags & 8192) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.asteriskToken) { + var functionFlags = ts.getFunctionFlags(func); + if (functionFlags & 1) { return; } - if (func.kind === 152) { + if (func.kind === 153) { if (node.expression) { - error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); + error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 150) { - if (node.expression && !checkTypeAssignableTo(exprType, returnType, node.expression)) { - error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); + else if (func.kind === 151) { + if (node.expression && !checkTypeAssignableTo(exprType, returnType, node)) { + error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } } else if (func.type || isGetAccessorWithAnnotatedSetAccessor(func)) { - if (ts.isAsyncFunctionLike(func)) { - var promisedType = getPromisedType(returnType); - var awaitedType = checkAwaitedType(exprType, node.expression || node, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); + if (functionFlags & 2) { + var promisedType = getPromisedTypeOfPromise(returnType); + var awaitedType = checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); if (promisedType) { - checkTypeAssignableTo(awaitedType, promisedType, node.expression || node); + checkTypeAssignableTo(awaitedType, promisedType, node); } } else { - checkTypeAssignableTo(exprType, returnType, node.expression || node); + checkTypeAssignableTo(exprType, returnType, node); } } } - else if (func.kind !== 150 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 151 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } } } function checkWithStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.flags & 524288) { + if (node.flags & 16384) { grammarErrorOnFirstToken(node, ts.Diagnostics.with_statements_are_not_allowed_in_an_async_function_block); } } @@ -34483,7 +38501,7 @@ var ts; var expressionType = checkExpression(node.expression); var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { - if (clause.kind === 254 && !hasDuplicateDefaultClause) { + if (clause.kind === 257 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -34495,7 +38513,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 253) { + if (produceDiagnostics && clause.kind === 256) { var caseClause = clause; var caseType = checkExpression(caseClause.expression); var caseIsLiteral = isLiteralType(caseType); @@ -34516,18 +38534,16 @@ var ts; } function checkLabeledStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - var current = node.parent; - while (current) { + ts.findAncestor(node.parent, function (current) { if (ts.isFunctionLike(current)) { - break; + return "quit"; } - if (current.kind === 219 && current.label.text === node.label.text) { + if (current.kind === 221 && current.label.text === node.label.text) { var sourceFile = ts.getSourceFileOfNode(node); grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); - break; + return true; } - current = current.parent; - } + }); } checkSourceElement(node.statement); } @@ -34554,14 +38570,14 @@ var ts; grammarErrorOnFirstToken(catchClause.variableDeclaration.initializer, ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer); } else { - var blockLocals = catchClause.block.locals; - if (blockLocals) { - for (var caughtName in catchClause.locals) { - var blockLocal = blockLocals[caughtName]; + var blockLocals_1 = catchClause.block.locals; + if (blockLocals_1) { + ts.forEachKey(catchClause.locals, function (caughtName) { + var blockLocal = blockLocals_1.get(caughtName); if (blockLocal && (blockLocal.flags & 2) !== 0) { grammarErrorOnNode(blockLocal.valueDeclaration, ts.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause, caughtName); } - } + }); } } } @@ -34609,12 +38625,13 @@ var ts; if (!indexType) { return; } - if (indexKind === 1 && !isNumericName(prop.valueDeclaration.name)) { + var propDeclaration = prop.valueDeclaration; + if (indexKind === 1 && !(propDeclaration ? isNumericName(propDeclaration.name) : isNumericLiteralName(prop.name))) { return; } var errorNode; - if (prop.valueDeclaration.name.kind === 142 || prop.parent === containingType.symbol) { - errorNode = prop.valueDeclaration; + if (propDeclaration && (propDeclaration.name.kind === 143 || prop.parent === containingType.symbol)) { + errorNode = propDeclaration; } else if (indexDeclaration) { errorNode = indexDeclaration; @@ -34639,15 +38656,23 @@ var ts; case "string": case "symbol": case "void": + case "object": error(name, message, name.text); } } function checkTypeParameters(typeParameterDeclarations) { if (typeParameterDeclarations) { - for (var i = 0, n = typeParameterDeclarations.length; i < n; i++) { + var seenDefault = false; + for (var i = 0; i < typeParameterDeclarations.length; i++) { var node = typeParameterDeclarations[i]; checkTypeParameter(node); if (produceDiagnostics) { + if (node.default) { + seenDefault = true; + } + else if (seenDefault) { + error(node, ts.Diagnostics.Required_type_parameters_may_not_follow_optional_type_parameters); + } for (var j = 0; j < i; j++) { if (typeParameterDeclarations[j].symbol === node.symbol) { error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.declarationNameToString(node.name)); @@ -34657,23 +38682,57 @@ var ts; } } } - function checkTypeParameterListsIdentical(node, symbol) { + function checkTypeParameterListsIdentical(symbol) { if (symbol.declarations.length === 1) { return; } - var firstDecl; - for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { - var declaration = _a[_i]; - if (declaration.kind === 226 || declaration.kind === 227) { - if (!firstDecl) { - firstDecl = declaration; - } - else if (!areTypeParametersIdentical(firstDecl.typeParameters, node.typeParameters)) { - error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, node.name.text); + var links = getSymbolLinks(symbol); + if (!links.typeParametersChecked) { + links.typeParametersChecked = true; + var declarations = getClassOrInterfaceDeclarationsOfSymbol(symbol); + if (declarations.length <= 1) { + return; + } + var type = getDeclaredTypeOfSymbol(symbol); + if (!areTypeParametersIdentical(declarations, type.localTypeParameters)) { + var name = symbolToString(symbol); + for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { + var declaration = declarations_6[_i]; + error(declaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name); } } } } + function areTypeParametersIdentical(declarations, typeParameters) { + var maxTypeArgumentCount = ts.length(typeParameters); + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { + var declaration = declarations_7[_i]; + var numTypeParameters = ts.length(declaration.typeParameters); + if (numTypeParameters < minTypeArgumentCount || numTypeParameters > maxTypeArgumentCount) { + return false; + } + for (var i = 0; i < numTypeParameters; i++) { + var source = declaration.typeParameters[i]; + var target = typeParameters[i]; + if (source.name.text !== target.symbol.name) { + return false; + } + var sourceConstraint = source.constraint && getTypeFromTypeNode(source.constraint); + var targetConstraint = getConstraintFromTypeParameter(target); + if ((sourceConstraint || targetConstraint) && + (!sourceConstraint || !targetConstraint || !isTypeIdenticalTo(sourceConstraint, targetConstraint))) { + return false; + } + var sourceDefault = source.default && getTypeFromTypeNode(source.default); + var targetDefault = getDefaultFromTypeParameter(target); + if (sourceDefault && targetDefault && !isTypeIdenticalTo(sourceDefault, targetDefault)) { + return false; + } + } + } + return true; + } function checkClassExpression(node) { checkClassLikeDeclaration(node); checkNodeDeferred(node); @@ -34692,11 +38751,12 @@ var ts; registerForUnusedIdentifiersCheck(node); } function checkClassLikeDeclaration(node) { - checkGrammarClassDeclarationHeritageClauses(node); + checkGrammarClassLikeDeclaration(node); checkDecorators(node); if (node.name) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Class_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); } @@ -34706,19 +38766,26 @@ var ts; var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); var staticType = getTypeOfSymbol(symbol); - checkTypeParameterListsIdentical(node, symbol); + checkTypeParameterListsIdentical(symbol); checkClassForDuplicateDeclarations(node); + if (!ts.isInAmbientContext(node)) { + checkClassForStaticPropertyNameConflicts(node); + } var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { + if (languageVersion < 2) { + checkExternalEmitHelpers(baseTypeNode.parent, 1); + } var baseTypes = getBaseTypes(type); if (baseTypes.length && produceDiagnostics) { var baseType_1 = baseTypes[0]; - var staticBaseType = getBaseConstructorTypeOfClass(type); + var baseConstructorType = getBaseConstructorTypeOfClass(type); + var staticBaseType = getApparentType(baseConstructorType); checkBaseTypeAccessibility(staticBaseType, baseTypeNode); checkSourceElement(baseTypeNode.expression); if (baseTypeNode.typeArguments) { ts.forEach(baseTypeNode.typeArguments, checkSourceElement); - for (var _i = 0, _a = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments); _i < _a.length; _i++) { + for (var _i = 0, _a = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); _i < _a.length; _i++) { var constructor = _a[_i]; if (!checkTypeArgumentConstraints(constructor.typeParameters, baseTypeNode.typeArguments)) { break; @@ -34727,15 +38794,11 @@ var ts; } checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(baseType_1, type.thisType), node.name || node, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); checkTypeAssignableTo(staticType, getTypeWithoutSignatures(staticBaseType), node.name || node, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); - if (baseType_1.symbol.valueDeclaration && - !ts.isInAmbientContext(baseType_1.symbol.valueDeclaration) && - baseType_1.symbol.valueDeclaration.kind === 226) { - if (!isBlockScopedNameDeclaredBeforeUse(baseType_1.symbol.valueDeclaration, node)) { - error(baseTypeNode, ts.Diagnostics.A_class_must_be_declared_after_its_base_class); - } + if (baseConstructorType.flags & 540672 && !isMixinConstructorType(staticType)) { + error(node.name || node, ts.Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any); } - if (!(staticBaseType.symbol && staticBaseType.symbol.flags & 32)) { - var constructors = getInstantiatedConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments); + if (!(staticBaseType.symbol && staticBaseType.symbol.flags & 32) && !(baseConstructorType.flags & 540672)) { + var constructors = getInstantiatedConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); if (ts.forEach(constructors, function (sig) { return getReturnTypeOfSignature(sig) !== baseType_1; })) { error(baseTypeNode.expression, ts.Diagnostics.Base_constructors_must_all_have_the_same_return_type); } @@ -34754,8 +38817,7 @@ var ts; if (produceDiagnostics) { var t = getTypeFromTypeNode(typeRefNode); if (t !== unknownType) { - var declaredType = getObjectFlags(t) & 4 ? t.target : t; - if (getObjectFlags(declaredType) & 3) { + if (isValidBaseType(t)) { checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(t, type.thisType), node.name || node, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); } else { @@ -34783,17 +38845,22 @@ var ts; } } function getTargetSymbol(s) { - return s.flags & 16777216 ? getSymbolLinks(s).target : s; + return getCheckFlags(s) & 1 ? s.target : s; } function getClassLikeDeclarationOfSymbol(symbol) { return ts.forEach(symbol.declarations, function (d) { return ts.isClassLike(d) ? d : undefined; }); } + function getClassOrInterfaceDeclarationsOfSymbol(symbol) { + return ts.filter(symbol.declarations, function (d) { + return d.kind === 228 || d.kind === 229; + }); + } function checkKindsOfPropertyMemberOverrides(type, baseType) { - var baseProperties = getPropertiesOfObjectType(baseType); + var baseProperties = getPropertiesOfType(baseType); for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) { var baseProperty = baseProperties_1[_i]; var base = getTargetSymbol(baseProperty); - if (base.flags & 134217728) { + if (base.flags & 16777216) { continue; } var derived = getTargetSymbol(getPropertyOfObjectType(type, base.name)); @@ -34803,7 +38870,7 @@ var ts; if (derived === base) { var derivedClassDecl = getClassLikeDeclarationOfSymbol(type.symbol); if (baseDeclarationFlags & 128 && (!derivedClassDecl || !(ts.getModifierFlags(derivedClassDecl) & 128))) { - if (derivedClassDecl.kind === 197) { + if (derivedClassDecl.kind === 198) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -34813,66 +38880,37 @@ var ts; } else { var derivedDeclarationFlags = getDeclarationModifierFlagsFromSymbol(derived); - if ((baseDeclarationFlags & 8) || (derivedDeclarationFlags & 8)) { + if (baseDeclarationFlags & 8 || derivedDeclarationFlags & 8) { continue; } if ((baseDeclarationFlags & 32) !== (derivedDeclarationFlags & 32)) { continue; } - if ((base.flags & derived.flags & 8192) || ((base.flags & 98308) && (derived.flags & 98308))) { + if (isMethodLike(base) && isMethodLike(derived) || base.flags & 98308 && derived.flags & 98308) { continue; } var errorMessage = void 0; - if (base.flags & 8192) { + if (isMethodLike(base)) { if (derived.flags & 98304) { errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; } else { - ts.Debug.assert((derived.flags & 4) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; } } else if (base.flags & 4) { - ts.Debug.assert((derived.flags & 8192) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; } else { - ts.Debug.assert((base.flags & 98304) !== 0); - ts.Debug.assert((derived.flags & 8192) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; } - error(derived.valueDeclaration.name, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); + error(derived.valueDeclaration.name || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); } } } } function isAccessor(kind) { - return kind === 151 || kind === 152; - } - function areTypeParametersIdentical(list1, list2) { - if (!list1 && !list2) { - return true; - } - if (!list1 || !list2 || list1.length !== list2.length) { - return false; - } - for (var i = 0, len = list1.length; i < len; i++) { - var tp1 = list1[i]; - var tp2 = list2[i]; - if (tp1.name.text !== tp2.name.text) { - return false; - } - if (!tp1.constraint && !tp2.constraint) { - continue; - } - if (!tp1.constraint || !tp2.constraint) { - return false; - } - if (!isTypeIdenticalTo(getTypeFromTypeNode(tp1.constraint), getTypeFromTypeNode(tp2.constraint))) { - return false; - } - } - return true; + return kind === 152 || kind === 153; } function checkInheritedPropertiesAreIdentical(type, typeNode) { var baseTypes = getBaseTypes(type); @@ -34880,16 +38918,16 @@ var ts; return true; } var seen = ts.createMap(); - ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; }); + ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen.set(p.name, { prop: p, containingType: type }); }); var ok = true; for (var _i = 0, baseTypes_2 = baseTypes; _i < baseTypes_2.length; _i++) { var base = baseTypes_2[_i]; - var properties = getPropertiesOfObjectType(getTypeWithThisArgument(base, type.thisType)); - for (var _a = 0, properties_6 = properties; _a < properties_6.length; _a++) { - var prop = properties_6[_a]; - var existing = seen[prop.name]; + var properties = getPropertiesOfType(getTypeWithThisArgument(base, type.thisType)); + for (var _a = 0, properties_8 = properties; _a < properties_8.length; _a++) { + var prop = properties_8[_a]; + var existing = seen.get(prop.name); if (!existing) { - seen[prop.name] = { prop: prop, containingType: base }; + seen.set(prop.name, { prop: prop, containingType: base }); } else { var isInheritedProperty = existing.containingType !== type; @@ -34913,8 +38951,8 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - checkTypeParameterListsIdentical(node, symbol); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 227); + checkTypeParameterListsIdentical(symbol); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 229); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -35010,7 +39048,7 @@ var ts; return value; function evalConstant(e) { switch (e.kind) { - case 190: + case 191: var value_1 = evalConstant(e.operand); if (value_1 === undefined) { return undefined; @@ -35021,7 +39059,7 @@ var ts; case 51: return ~value_1; } return undefined; - case 192: + case 193: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -35045,12 +39083,13 @@ var ts; } return undefined; case 8: + checkGrammarNumericLiteral(e); return +e.text; - case 183: + case 184: return evalConstant(e.expression); case 70: + case 179: case 178: - case 177: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); var enumType_1; @@ -35061,7 +39100,7 @@ var ts; } else { var expression = void 0; - if (e.kind === 178) { + if (e.kind === 179) { if (e.argumentExpression === undefined || e.argumentExpression.kind !== 9) { return undefined; @@ -35078,7 +39117,7 @@ var ts; if (current.kind === 70) { break; } - else if (current.kind === 177) { + else if (current.kind === 178) { current = current.expression; } else { @@ -35118,6 +39157,7 @@ var ts; checkGrammarDecorators(node) || checkGrammarModifiers(node); checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); @@ -35138,7 +39178,7 @@ var ts; } var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 229) { + if (declaration.kind !== 231) { return false; } var enumDeclaration = declaration; @@ -35159,10 +39199,10 @@ var ts; } function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { - var declaration = declarations_5[_i]; - if ((declaration.kind === 226 || - (declaration.kind === 225 && ts.nodeIsPresent(declaration.body))) && + for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { + var declaration = declarations_8[_i]; + if ((declaration.kind === 228 || + (declaration.kind === 227 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } @@ -35221,7 +39261,7 @@ var ts; error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); } } - var mergedClass = ts.getDeclarationOfKind(symbol, 226); + var mergedClass = ts.getDeclarationOfKind(symbol, 228); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768; @@ -35229,7 +39269,7 @@ var ts; } if (isAmbientExternalModule) { if (ts.isExternalModuleAugmentation(node)) { - var checkBody = isGlobalAugmentation || (getSymbolOfNode(node).flags & 33554432); + var checkBody = isGlobalAugmentation || (getSymbolOfNode(node).flags & 134217728); if (checkBody && node.body) { for (var _i = 0, _a = node.body.statements; _i < _a.length; _i++) { var statement = _a[_i]; @@ -35264,42 +39304,42 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 205: + case 207: for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 240: - case 241: + case 242: + case 243: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 234: - case 235: + case 236: + case 237: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 174: - case 223: - var name_27 = node.name; - if (ts.isBindingPattern(name_27)) { - for (var _b = 0, _c = name_27.elements; _b < _c.length; _b++) { + case 175: + case 225: + var name = node.name; + if (ts.isBindingPattern(name)) { + for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { var el = _c[_b]; checkModuleAugmentationElement(el, isGlobalAugmentation); } break; } - case 226: - case 229: - case 225: - case 227: - case 230: case 228: + case 231: + case 227: + case 229: + case 232: + case 230: if (isGlobalAugmentation) { return; } var symbol = getSymbolOfNode(node); if (symbol) { - var reportError = !(symbol.flags & 33554432); + var reportError = !(symbol.flags & 134217728); if (!reportError) { reportError = ts.isExternalModuleAugmentation(symbol.parent.declarations[0]); } @@ -35311,12 +39351,12 @@ var ts; switch (node.kind) { case 70: return node; - case 141: + case 142: do { node = node.left; } while (node.kind !== 70); return node; - case 177: + case 178: do { node = node.expression; } while (node.kind !== 70); @@ -35329,9 +39369,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 231 && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 261 && !inAmbientExternalModule) { - error(moduleName, node.kind === 241 ? + var inAmbientExternalModule = node.parent.kind === 233 && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 264 && !inAmbientExternalModule) { + error(moduleName, node.kind === 243 ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -35352,7 +39392,7 @@ var ts; (symbol.flags & 793064 ? 793064 : 0) | (symbol.flags & 1920 ? 1920 : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 243 ? + var message = node.kind === 245 ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); @@ -35379,7 +39419,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 237) { + if (importClause.namedBindings.kind === 239) { checkImportBinding(importClause.namedBindings); } else { @@ -35430,8 +39470,10 @@ var ts; if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { if (node.exportClause) { ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 231 && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 261 && !inAmbientExternalModule) { + var inAmbientExternalModule = node.parent.kind === 233 && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 233 && + !node.moduleSpecifier && ts.isInAmbientContext(node); + if (node.parent.kind !== 264 && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -35444,7 +39486,7 @@ var ts; } } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 261 || node.parent.kind === 231 || node.parent.kind === 230; + var isInAppropriateContext = node.parent.kind === 264 || node.parent.kind === 233 || node.parent.kind === 232; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -35467,9 +39509,14 @@ var ts; if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_assignment_can_only_be_used_in_a_module)) { return; } - var container = node.parent.kind === 261 ? node.parent : node.parent.parent; - if (container.kind === 230 && !ts.isAmbientModule(container)) { - error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); + var container = node.parent.kind === 264 ? node.parent : node.parent.parent; + if (container.kind === 232 && !ts.isAmbientModule(container)) { + if (node.isExportEquals) { + error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); + } + else { + error(node, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); + } return; } if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.getModifierFlags(node) !== 0) { @@ -35492,50 +39539,45 @@ var ts; } } function hasExportedMembers(moduleSymbol) { - for (var id in moduleSymbol.exports) { - if (id !== "export=") { - return true; - } - } - return false; + return ts.forEachEntry(moduleSymbol.exports, function (_, id) { return id !== "export="; }); } function checkExternalModuleExports(node) { var moduleSymbol = getSymbolOfNode(node); var links = getSymbolLinks(moduleSymbol); if (!links.exportsChecked) { - var exportEqualsSymbol = moduleSymbol.exports["export="]; + var exportEqualsSymbol = moduleSymbol.exports.get("export="); if (exportEqualsSymbol && hasExportedMembers(moduleSymbol)) { var declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; if (!isTopLevelInExternalModuleAugmentation(declaration)) { error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); } } - var exports_1 = getExportsOfModule(moduleSymbol); - for (var id in exports_1) { + var exports = getExportsOfModule(moduleSymbol); + exports && exports.forEach(function (_a, id) { + var declarations = _a.declarations, flags = _a.flags; if (id === "__export") { - continue; + return; } - var _a = exports_1[id], declarations = _a.declarations, flags = _a.flags; if (flags & (1920 | 64 | 384)) { - continue; + return; } var exportedDeclarationsCount = ts.countWhere(declarations, isNotOverload); if (flags & 524288 && exportedDeclarationsCount <= 2) { - continue; + return; } if (exportedDeclarationsCount > 1) { - for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { - var declaration = declarations_6[_i]; + for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) { + var declaration = declarations_9[_i]; if (isNotOverload(declaration)) { diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Cannot_redeclare_exported_variable_0, id)); } } } - } + }); links.exportsChecked = true; } function isNotOverload(declaration) { - return (declaration.kind !== 225 && declaration.kind !== 149) || + return (declaration.kind !== 227 && declaration.kind !== 150) || !!declaration.body; } } @@ -35546,123 +39588,123 @@ var ts; var kind = node.kind; if (cancellationToken) { switch (kind) { - case 230: - case 226: + case 232: + case 228: + case 229: case 227: - case 225: cancellationToken.throwIfCancellationRequested(); } } switch (kind) { - case 143: - return checkTypeParameter(node); case 144: + return checkTypeParameter(node); + case 145: return checkParameter(node); + case 148: case 147: - case 146: return checkPropertyDeclaration(node); - case 158: case 159: - case 153: + case 160: case 154: - return checkSignatureDeclaration(node); case 155: return checkSignatureDeclaration(node); - case 149: - case 148: - return checkMethodDeclaration(node); - case 150: - return checkConstructorDeclaration(node); - case 151: - case 152: - return checkAccessorDeclaration(node); - case 157: - return checkTypeReferenceNode(node); case 156: + return checkSignatureDeclaration(node); + case 150: + case 149: + return checkMethodDeclaration(node); + case 151: + return checkConstructorDeclaration(node); + case 152: + case 153: + return checkAccessorDeclaration(node); + case 158: + return checkTypeReferenceNode(node); + case 157: return checkTypePredicate(node); - case 160: - return checkTypeQuery(node); case 161: - return checkTypeLiteral(node); + return checkTypeQuery(node); case 162: - return checkArrayType(node); + return checkTypeLiteral(node); case 163: - return checkTupleType(node); + return checkArrayType(node); case 164: + return checkTupleType(node); case 165: - return checkUnionOrIntersectionType(node); case 166: - case 168: - return checkSourceElement(node.type); + return checkUnionOrIntersectionType(node); + case 167: case 169: - return checkIndexedAccessType(node); + return checkSourceElement(node.type); case 170: + return checkIndexedAccessType(node); + case 171: return checkMappedType(node); - case 225: - return checkFunctionDeclaration(node); - case 204: - case 231: - return checkBlock(node); - case 205: - return checkVariableStatement(node); - case 207: - return checkExpressionStatement(node); - case 208: - return checkIfStatement(node); - case 209: - return checkDoStatement(node); - case 210: - return checkWhileStatement(node); - case 211: - return checkForStatement(node); - case 212: - return checkForInStatement(node); - case 213: - return checkForOfStatement(node); - case 214: - case 215: - return checkBreakOrContinueStatement(node); - case 216: - return checkReturnStatement(node); - case 217: - return checkWithStatement(node); - case 218: - return checkSwitchStatement(node); - case 219: - return checkLabeledStatement(node); - case 220: - return checkThrowStatement(node); - case 221: - return checkTryStatement(node); - case 223: - return checkVariableDeclaration(node); - case 174: - return checkBindingElement(node); - case 226: - return checkClassDeclaration(node); case 227: - return checkInterfaceDeclaration(node); - case 228: - return checkTypeAliasDeclaration(node); - case 229: - return checkEnumDeclaration(node); - case 230: - return checkModuleDeclaration(node); - case 235: - return checkImportDeclaration(node); - case 234: - return checkImportEqualsDeclaration(node); - case 241: - return checkExportDeclaration(node); - case 240: - return checkExportAssignment(node); + return checkFunctionDeclaration(node); case 206: - checkGrammarStatementInAmbientContext(node); - return; + case 233: + return checkBlock(node); + case 207: + return checkVariableStatement(node); + case 209: + return checkExpressionStatement(node); + case 210: + return checkIfStatement(node); + case 211: + return checkDoStatement(node); + case 212: + return checkWhileStatement(node); + case 213: + return checkForStatement(node); + case 214: + return checkForInStatement(node); + case 215: + return checkForOfStatement(node); + case 216: + case 217: + return checkBreakOrContinueStatement(node); + case 218: + return checkReturnStatement(node); + case 219: + return checkWithStatement(node); + case 220: + return checkSwitchStatement(node); + case 221: + return checkLabeledStatement(node); case 222: + return checkThrowStatement(node); + case 223: + return checkTryStatement(node); + case 225: + return checkVariableDeclaration(node); + case 175: + return checkBindingElement(node); + case 228: + return checkClassDeclaration(node); + case 229: + return checkInterfaceDeclaration(node); + case 230: + return checkTypeAliasDeclaration(node); + case 231: + return checkEnumDeclaration(node); + case 232: + return checkModuleDeclaration(node); + case 237: + return checkImportDeclaration(node); + case 236: + return checkImportEqualsDeclaration(node); + case 243: + return checkExportDeclaration(node); + case 242: + return checkExportAssignment(node); + case 208: checkGrammarStatementInAmbientContext(node); return; - case 244: + case 224: + checkGrammarStatementInAmbientContext(node); + return; + case 246: return checkMissingDeclaration(node); } } @@ -35675,17 +39717,17 @@ var ts; for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) { var node = deferredNodes_1[_i]; switch (node.kind) { - case 184: case 185: + case 186: + case 150: case 149: - case 148: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 151: case 152: - checkAccessorDeferred(node); + case 153: + checkAccessorDeclaration(node); break; - case 197: + case 198: checkClassExpressionDeferred(node); break; } @@ -35705,6 +39747,7 @@ var ts; } checkGrammarSourceFile(node); potentialThisCollisions.length = 0; + potentialNewTargetCollisions.length = 0; deferredNodes = []; deferredUnusedIdentifierNodes = produceDiagnostics && noUnusedIdentifiers ? [] : undefined; ts.forEach(node.statements, checkSourceElement); @@ -35724,6 +39767,10 @@ var ts; ts.forEach(potentialThisCollisions, checkIfThisIsCapturedInEnclosingScope); potentialThisCollisions.length = 0; } + if (potentialNewTargetCollisions.length) { + ts.forEach(potentialNewTargetCollisions, checkIfNewTargetIsCapturedInEnclosingScope); + potentialNewTargetCollisions.length = 0; + } links.flags |= 1; } } @@ -35768,7 +39815,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 217 && node.parent.statement === node) { + if (node.parent.kind === 219 && node.parent.statement === node) { return true; } node = node.parent; @@ -35777,11 +39824,11 @@ var ts; return false; } function getSymbolsInScope(location, meaning) { - var symbols = ts.createMap(); - var memberFlags = 0; if (isInsideWithStatementBody(location)) { return []; } + var symbols = ts.createMap(); + var memberFlags = 0; populateSymbols(); return symbolsToArray(symbols); function populateSymbols() { @@ -35790,28 +39837,28 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 261: + case 264: if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 230: + case 232: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931); break; - case 229: + case 231: copySymbols(getSymbolOfNode(location).exports, meaning & 8); break; - case 197: + case 198: var className = location.name; if (className) { copySymbol(location.symbol, meaning); } - case 226: - case 227: + case 228: + case 229: if (!(memberFlags & 32)) { copySymbols(getSymbolOfNode(location).members, meaning & 793064); } break; - case 184: + case 185: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -35829,17 +39876,16 @@ var ts; function copySymbol(symbol, meaning) { if (symbol.flags & meaning) { var id = symbol.name; - if (!symbols[id]) { - symbols[id] = symbol; + if (!symbols.has(id)) { + symbols.set(id, symbol); } } } function copySymbols(source, meaning) { if (meaning) { - for (var id in source) { - var symbol = source[id]; + source.forEach(function (symbol) { copySymbol(symbol, meaning); - } + }); } } } @@ -35850,27 +39896,27 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 143: - case 226: - case 227: + case 144: case 228: case 229: + case 230: + case 231: return true; } } function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 141) { + while (node.parent && node.parent.kind === 142) { node = node.parent; } - return node.parent && (node.parent.kind === 157 || node.parent.kind === 272); + return node.parent && (node.parent.kind === 158 || node.parent.kind === 276); } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 177) { + while (node.parent && node.parent.kind === 178) { node = node.parent; } - return node.parent && node.parent.kind === 199; + return node.parent && node.parent.kind === 200; } function forEachEnclosingClass(node, callback) { var result; @@ -35887,13 +39933,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 141) { + while (nodeOnRightSide.parent.kind === 142) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 234) { + if (nodeOnRightSide.parent.kind === 236) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 240) { + if (nodeOnRightSide.parent.kind === 242) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -35901,27 +39947,35 @@ var ts; function isInRightSideOfImportOrExportAssignment(node) { return getLeftSideOfImportEqualsOrExportAssignment(node) !== undefined; } + function getSpecialPropertyAssignmentSymbolFromEntityName(entityName) { + var specialPropertyAssignmentKind = ts.getSpecialPropertyAssignmentKind(entityName.parent.parent); + switch (specialPropertyAssignmentKind) { + case 1: + case 3: + return getSymbolOfNode(entityName.parent); + case 4: + case 2: + case 5: + return getSymbolOfNode(entityName.parent.parent); + } + } function getSymbolOfEntityNameOrPropertyAccessExpression(entityName) { if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (ts.isInJavaScriptFile(entityName) && entityName.parent.kind === 177) { - var specialPropertyAssignmentKind = ts.getSpecialPropertyAssignmentKind(entityName.parent.parent); - switch (specialPropertyAssignmentKind) { - case 1: - case 3: - return getSymbolOfNode(entityName.parent); - case 4: - case 2: - return getSymbolOfNode(entityName.parent.parent); - default: + if (ts.isInJavaScriptFile(entityName) && + entityName.parent.kind === 178 && + entityName.parent === entityName.parent.parent.left) { + var specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(entityName); + if (specialPropertyAssignmentSymbol) { + return specialPropertyAssignmentSymbol; } } - if (entityName.parent.kind === 240 && ts.isEntityNameExpression(entityName)) { + if (entityName.parent.kind === 242 && ts.isEntityNameExpression(entityName)) { return resolveEntityName(entityName, 107455 | 793064 | 1920 | 8388608); } - if (entityName.kind !== 177 && isInRightSideOfImportOrExportAssignment(entityName)) { - var importEqualsDeclaration = ts.getAncestor(entityName, 234); + if (entityName.kind !== 178 && isInRightSideOfImportOrExportAssignment(entityName)) { + var importEqualsDeclaration = ts.getAncestor(entityName, 236); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, true); } @@ -35930,7 +39984,7 @@ var ts; } if (isHeritageClauseElementIdentifier(entityName)) { var meaning = 0; - if (entityName.parent.kind === 199) { + if (entityName.parent.kind === 200) { meaning = 793064; if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { meaning |= 107455; @@ -35940,9 +39994,12 @@ var ts; meaning = 1920; } meaning |= 8388608; - return resolveEntityName(entityName, meaning); + var entityNameSymbol = resolveEntityName(entityName, meaning); + if (entityNameSymbol) { + return entityNameSymbol; + } } - else if (ts.isPartOfExpression(entityName)) { + if (ts.isPartOfExpression(entityName)) { if (ts.nodeIsMissing(entityName)) { return undefined; } @@ -35952,14 +40009,14 @@ var ts; } return resolveEntityName(entityName, 107455, false, true); } - else if (entityName.kind === 177) { + else if (entityName.kind === 178) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); } return getNodeLinks(entityName).resolvedSymbol; } - else if (entityName.kind === 141) { + else if (entityName.kind === 142) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkQualifiedName(entityName); @@ -35968,19 +40025,19 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = (entityName.parent.kind === 157 || entityName.parent.kind === 272) ? 793064 : 1920; + var meaning = (entityName.parent.kind === 158 || entityName.parent.kind === 276) ? 793064 : 1920; return resolveEntityName(entityName, meaning, false, true); } - else if (entityName.parent.kind === 250) { + else if (entityName.parent.kind === 252) { return getJsxAttributePropertySymbol(entityName.parent); } - if (entityName.parent.kind === 156) { + if (entityName.parent.kind === 157) { return resolveEntityName(entityName, 1); } return undefined; } function getSymbolAtLocation(node) { - if (node.kind === 261) { + if (node.kind === 264) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } if (isInsideWithStatementBody(node)) { @@ -35996,8 +40053,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfEntityNameOrPropertyAccessExpression(node); } - else if (node.parent.kind === 174 && - node.parent.parent.kind === 172 && + else if (node.parent.kind === 175 && + node.parent.parent.kind === 173 && node === node.parent.propertyName) { var typeOfPattern = getTypeOfNode(node.parent.parent); var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.text); @@ -36008,8 +40065,8 @@ var ts; } switch (node.kind) { case 70: - case 177: - case 141: + case 178: + case 142: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 98: var container = ts.getThisContainer(node, false); @@ -36022,18 +40079,18 @@ var ts; case 96: var type = ts.isPartOfExpression(node) ? getTypeOfExpression(node) : getTypeFromTypeNode(node); return type.symbol; - case 167: + case 168: return getTypeFromTypeNode(node).symbol; case 122: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 150) { + if (constructorDeclaration && constructorDeclaration.kind === 151) { return constructorDeclaration.parent.symbol; } return undefined; case 9: if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 235 || node.parent.kind === 241) && + ((node.parent.kind === 237 || node.parent.kind === 243) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } @@ -36041,7 +40098,7 @@ var ts; return resolveExternalModuleName(node, node); } case 8: - if (node.parent.kind === 178 && node.parent.argumentExpression === node) { + if (node.parent.kind === 179 && node.parent.argumentExpression === node) { var objectType = getTypeOfExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -36055,7 +40112,7 @@ var ts; return undefined; } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 258) { + if (location && location.kind === 261) { return resolveEntityName(location.name, 107455 | 8388608); } return undefined; @@ -36070,13 +40127,22 @@ var ts; return unknownType; } if (ts.isPartOfTypeNode(node)) { - return getTypeFromTypeNode(node); + var typeFromTypeNode = getTypeFromTypeNode(node); + if (typeFromTypeNode && ts.isExpressionWithTypeArgumentsInClassImplementsClause(node)) { + var containingClass = ts.getContainingClass(node); + var classType = getTypeOfNode(containingClass); + typeFromTypeNode = getTypeWithThisArgument(typeFromTypeNode, classType.thisType); + } + return typeFromTypeNode; } if (ts.isPartOfExpression(node)) { return getRegularTypeOfExpression(node); } if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(node)) { - return getBaseTypes(getDeclaredTypeOfSymbol(getSymbolOfNode(node.parent.parent)))[0]; + var classNode = ts.getContainingClass(node); + var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(classNode)); + var baseType = getBaseTypes(classType)[0]; + return baseType && getTypeWithThisArgument(baseType, classType.thisType); } if (isTypeDeclaration(node)) { var symbol = getSymbolOfNode(node); @@ -36105,22 +40171,22 @@ var ts; return unknownType; } function getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr) { - ts.Debug.assert(expr.kind === 176 || expr.kind === 175); - if (expr.parent.kind === 213) { - var iteratedType = checkRightHandSideOfForOf(expr.parent.expression); + ts.Debug.assert(expr.kind === 177 || expr.kind === 176); + if (expr.parent.kind === 215) { + var iteratedType = checkRightHandSideOfForOf(expr.parent.expression, expr.parent.awaitModifier); return checkDestructuringAssignment(expr, iteratedType || unknownType); } - if (expr.parent.kind === 192) { + if (expr.parent.kind === 193) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || unknownType); } - if (expr.parent.kind === 257) { + if (expr.parent.kind === 260) { var typeOfParentObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent.parent); return checkObjectLiteralDestructuringPropertyAssignment(typeOfParentObjectLiteral || unknownType, expr.parent); } - ts.Debug.assert(expr.parent.kind === 175); + ts.Debug.assert(expr.parent.kind === 176); var typeOfArrayLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent); - var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, false) || unknownType; + var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, false, false) || unknownType; return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, ts.indexOf(expr.parent.elements, expr), elementType || unknownType); } function getPropertySymbolOfDestructuringAssignment(location) { @@ -36144,29 +40210,32 @@ var ts; var propsByName = createSymbolTable(getPropertiesOfType(type)); if (getSignaturesOfType(type, 0).length || getSignaturesOfType(type, 1).length) { ts.forEach(getPropertiesOfType(globalFunctionType), function (p) { - if (!propsByName[p.name]) { - propsByName[p.name] = p; + if (!propsByName.has(p.name)) { + propsByName.set(p.name, p); } }); } return getNamedMembers(propsByName); } function getRootSymbols(symbol) { - if (symbol.flags & 268435456) { + if (getCheckFlags(symbol) & 6) { var symbols_3 = []; - var name_28 = symbol.name; + var name_2 = symbol.name; ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) { - var symbol = getPropertyOfType(t, name_28); + var symbol = getPropertyOfType(t, name_2); if (symbol) { symbols_3.push(symbol); } }); return symbols_3; } - else if (symbol.flags & 67108864) { + else if (symbol.flags & 134217728) { if (symbol.leftSpread) { var links = symbol; - return [links.leftSpread, links.rightSpread]; + return getRootSymbols(links.leftSpread).concat(getRootSymbols(links.rightSpread)); + } + if (symbol.syntheticOrigin) { + return getRootSymbols(symbol.syntheticOrigin); } var target = void 0; var next = symbol; @@ -36183,7 +40252,8 @@ var ts; if (!ts.isGeneratedIdentifier(node)) { node = ts.getParseTreeNode(node, ts.isIdentifier); if (node) { - return getReferencedValueSymbol(node) === argumentsSymbol; + var isPropertyName_1 = node.parent.kind === 178 && node.parent.name === node; + return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } return false; @@ -36199,7 +40269,7 @@ var ts; if (symbolLinks.exportsSomeValue === undefined) { symbolLinks.exportsSomeValue = hasExportAssignment ? !!(moduleSymbol.flags & 107455) - : ts.forEachProperty(getExportsOfModule(moduleSymbol), isValue); + : ts.forEachEntry(getExportsOfModule(moduleSymbol), isValue); } return symbolLinks.exportsSomeValue; function isValue(s) { @@ -36223,19 +40293,15 @@ var ts; } symbol = exportSymbol; } - var parentSymbol = getParentOfSymbol(symbol); - if (parentSymbol) { - if (parentSymbol.flags & 512 && parentSymbol.valueDeclaration.kind === 261) { - var symbolFile = parentSymbol.valueDeclaration; + var parentSymbol_1 = getParentOfSymbol(symbol); + if (parentSymbol_1) { + if (parentSymbol_1.flags & 512 && parentSymbol_1.valueDeclaration.kind === 264) { + var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); var symbolIsUmdExport = symbolFile !== referenceFile; return symbolIsUmdExport ? undefined : symbolFile; } - for (var n = node.parent; n; n = n.parent) { - if (ts.isModuleOrEnumDeclaration(n) && getSymbolOfNode(n) === parentSymbol) { - return n; - } - } + return ts.findAncestor(node.parent, function (n) { return ts.isModuleOrEnumDeclaration(n) && getSymbolOfNode(n) === parentSymbol_1; }); } } } @@ -36263,7 +40329,7 @@ var ts; else if (nodeLinks_1.flags & 131072) { var isDeclaredInLoop = nodeLinks_1.flags & 262144; var inLoopInitializer = ts.isIterationStatement(container, false); - var inLoopBodyBlock = container.kind === 204 && ts.isIterationStatement(container.parent, false); + var inLoopBodyBlock = container.kind === 206 && ts.isIterationStatement(container.parent, false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -36298,21 +40364,17 @@ var ts; return false; } function isValueAliasDeclaration(node) { - node = ts.getParseTreeNode(node); - if (node === undefined) { - return true; - } switch (node.kind) { - case 234: case 236: - case 237: + case 238: case 239: - case 243: - return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); case 241: + case 245: + return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); + case 243: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 240: + case 242: return node.expression && node.expression.kind === 70 ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) @@ -36322,7 +40384,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(node) { node = ts.getParseTreeNode(node, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 261 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 264 || !ts.isInternalModuleImportEqualsDeclaration(node)) { return false; } var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); @@ -36340,10 +40402,6 @@ var ts; return isConstEnumSymbol(s) || s.constEnumOnlyModule; } function isReferencedAliasDeclaration(node, checkChildren) { - node = ts.getParseTreeNode(node); - if (node === undefined) { - return true; - } if (ts.isAliasSymbolDeclaration(node)) { var symbol = getSymbolOfNode(node); if (symbol && getSymbolLinks(symbol).referenced) { @@ -36364,16 +40422,30 @@ var ts; } return false; } + function isRequiredInitializedParameter(parameter) { + return strictNullChecks && + !isOptionalParameter(parameter) && + parameter.initializer && + !(ts.getModifierFlags(parameter) & 92); + } function getNodeCheckFlags(node) { - node = ts.getParseTreeNode(node); - return node ? getNodeLinks(node).flags : undefined; + return getNodeLinks(node).flags; } function getEnumMemberValue(node) { computeEnumMemberValues(node.parent); return getNodeLinks(node).enumMemberValue; } + function canHaveConstantValue(node) { + switch (node.kind) { + case 263: + case 178: + case 179: + return true; + } + return false; + } function getConstantValue(node) { - if (node.kind === 260) { + if (node.kind === 263) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -36389,15 +40461,17 @@ var ts; } function getTypeReferenceSerializationKind(typeName, location) { var valueSymbol = resolveEntityName(typeName, 107455, true, false, location); - var globalPromiseSymbol = tryGetGlobalPromiseConstructorSymbol(); - if (globalPromiseSymbol && valueSymbol === globalPromiseSymbol) { - return ts.TypeReferenceSerializationKind.Promise; - } - var constructorType = valueSymbol ? getTypeOfSymbol(valueSymbol) : undefined; - if (constructorType && isConstructorType(constructorType)) { - return ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue; - } var typeSymbol = resolveEntityName(typeName, 793064, true, false, location); + if (valueSymbol && valueSymbol === typeSymbol) { + var globalPromiseSymbol = getGlobalPromiseConstructorSymbol(false); + if (globalPromiseSymbol && valueSymbol === globalPromiseSymbol) { + return ts.TypeReferenceSerializationKind.Promise; + } + var constructorType = getTypeOfSymbol(valueSymbol); + if (constructorType && isConstructorType(constructorType)) { + return ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue; + } + } if (!typeSymbol) { return ts.TypeReferenceSerializationKind.ObjectType; } @@ -36441,6 +40515,9 @@ var ts; var type = symbol && !(symbol.flags & (2048 | 131072)) ? getWidenedLiteralType(getTypeOfSymbol(symbol)) : unknownType; + if (flags & 4096) { + type = includeFalsyTypes(type, 2048); + } getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { @@ -36455,10 +40532,13 @@ var ts; var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(node)); resolveBaseTypesOfClass(classType); var baseType = classType.resolvedBaseTypes.length ? classType.resolvedBaseTypes[0] : unknownType; + if (!baseType.symbol) { + writer.reportIllegalExtends(); + } getSymbolDisplayBuilder().buildTypeDisplay(baseType, writer, enclosingDeclaration, flags); } function hasGlobalName(name) { - return !!globals[name]; + return globals.has(name); } function getReferencedValueSymbol(reference, startInDeclarationContainer) { var resolvedSymbol = getNodeLinks(reference).resolvedSymbol; @@ -36467,9 +40547,9 @@ var ts; } var location = reference; if (startInDeclarationContainer) { - var parent_11 = reference.parent; - if (ts.isDeclaration(parent_11) && reference === parent_11.name) { - location = getDeclarationContainer(parent_11); + var parent = reference.parent; + if (ts.isDeclaration(parent) && reference === parent.name) { + location = getDeclarationContainer(parent); } } return resolveName(location, reference.text, 107455 | 1048576 | 8388608, undefined, undefined); @@ -36502,34 +40582,46 @@ var ts; var fileToDirective; if (resolvedTypeReferenceDirectives) { fileToDirective = ts.createFileMap(); - for (var key in resolvedTypeReferenceDirectives) { - var resolvedDirective = resolvedTypeReferenceDirectives[key]; + resolvedTypeReferenceDirectives.forEach(function (resolvedDirective, key) { if (!resolvedDirective) { - continue; + return; } var file = host.getSourceFile(resolvedDirective.resolvedFileName); fileToDirective.set(file.path, key); - } + }); } return { getReferencedExportContainer: getReferencedExportContainer, getReferencedImportDeclaration: getReferencedImportDeclaration, getReferencedDeclarationWithCollidingName: getReferencedDeclarationWithCollidingName, isDeclarationWithCollidingName: isDeclarationWithCollidingName, - isValueAliasDeclaration: isValueAliasDeclaration, + isValueAliasDeclaration: function (node) { + node = ts.getParseTreeNode(node); + return node ? isValueAliasDeclaration(node) : true; + }, hasGlobalName: hasGlobalName, - isReferencedAliasDeclaration: isReferencedAliasDeclaration, - getNodeCheckFlags: getNodeCheckFlags, + isReferencedAliasDeclaration: function (node, checkChildren) { + node = ts.getParseTreeNode(node); + return node ? isReferencedAliasDeclaration(node, checkChildren) : true; + }, + getNodeCheckFlags: function (node) { + node = ts.getParseTreeNode(node); + return node ? getNodeCheckFlags(node) : undefined; + }, isTopLevelValueImportEqualsWithEntityName: isTopLevelValueImportEqualsWithEntityName, isDeclarationVisible: isDeclarationVisible, isImplementationOfOverload: isImplementationOfOverload, + isRequiredInitializedParameter: isRequiredInitializedParameter, writeTypeOfDeclaration: writeTypeOfDeclaration, writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration, writeTypeOfExpression: writeTypeOfExpression, writeBaseConstructorTypeOfClass: writeBaseConstructorTypeOfClass, isSymbolAccessible: isSymbolAccessible, isEntityNameVisible: isEntityNameVisible, - getConstantValue: getConstantValue, + getConstantValue: function (node) { + node = ts.getParseTreeNode(node, canHaveConstantValue); + return node ? getConstantValue(node) : undefined; + }, collectLinkedAliases: collectLinkedAliases, getReferencedValueDeclaration: getReferencedValueDeclaration, getTypeReferenceSerializationKind: getTypeReferenceSerializationKind, @@ -36547,7 +40639,7 @@ var ts; if (!fileToDirective) { return undefined; } - var meaning = (node.kind === 177) || (node.kind === 70 && isInTypeQuery(node)) + var meaning = (node.kind === 178) || (node.kind === 70 && isInTypeQuery(node)) ? 107455 | 1048576 : 793064 | 1920; var symbol = resolveEntityName(node, meaning, true); @@ -36582,15 +40674,15 @@ var ts; } var current = symbol; while (true) { - var parent_12 = getParentOfSymbol(current); - if (parent_12) { - current = parent_12; + var parent = getParentOfSymbol(current); + if (parent) { + current = parent; } else { break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 261 && current.flags & 512) { + if (current.valueDeclaration && current.valueDeclaration.kind === 264 && current.flags & 512) { return false; } for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { @@ -36609,7 +40701,7 @@ var ts; if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 261); + return ts.getDeclarationOfKind(moduleSymbol, 264); } function initializeTypeChecker() { for (var _i = 0, _a = host.getSourceFiles(); _i < _a.length; _i++) { @@ -36617,8 +40709,6 @@ var ts; ts.bindSourceFile(file, compilerOptions); } var augmentations; - var requestedExternalEmitHelpers = 0; - var firstFileRequestingExternalHelpers; for (var _b = 0, _c = host.getSourceFiles(); _b < _c.length; _b++) { var file = _c[_b]; if (!ts.isExternalOrCommonJsModule(file)) { @@ -36632,20 +40722,11 @@ var ts; } if (file.symbol && file.symbol.globalExports) { var source = file.symbol.globalExports; - for (var id in source) { - if (!(id in globals)) { - globals[id] = source[id]; + source.forEach(function (sourceSymbol, id) { + if (!globals.has(id)) { + globals.set(id, sourceSymbol); } - } - } - if ((compilerOptions.isolatedModules || ts.isExternalModule(file)) && !file.isDeclarationFile) { - var fileRequestedExternalEmitHelpers = file.flags & 64512; - if (fileRequestedExternalEmitHelpers) { - requestedExternalEmitHelpers |= fileRequestedExternalEmitHelpers; - if (firstFileRequestingExternalHelpers === undefined) { - firstFileRequestingExternalHelpers = file; - } - } + }); } } if (augmentations) { @@ -36659,116 +40740,80 @@ var ts; } addToSymbolTable(globals, builtinGlobals, ts.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0); getSymbolLinks(undefinedSymbol).type = undefinedWideningType; - getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments"); + getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments", 0, true); getSymbolLinks(unknownSymbol).type = unknownType; - globalArrayType = getGlobalType("Array", 1); - globalObjectType = getGlobalType("Object"); - globalFunctionType = getGlobalType("Function"); - globalStringType = getGlobalType("String"); - globalNumberType = getGlobalType("Number"); - globalBooleanType = getGlobalType("Boolean"); - globalRegExpType = getGlobalType("RegExp"); - jsxElementType = getExportedTypeFromNamespace("JSX", JsxNames.Element); - getGlobalClassDecoratorType = ts.memoize(function () { return getGlobalType("ClassDecorator"); }); - getGlobalPropertyDecoratorType = ts.memoize(function () { return getGlobalType("PropertyDecorator"); }); - getGlobalMethodDecoratorType = ts.memoize(function () { return getGlobalType("MethodDecorator"); }); - getGlobalParameterDecoratorType = ts.memoize(function () { return getGlobalType("ParameterDecorator"); }); - getGlobalTypedPropertyDescriptorType = ts.memoize(function () { return getGlobalType("TypedPropertyDescriptor", 1); }); - getGlobalESSymbolConstructorSymbol = ts.memoize(function () { return getGlobalValueSymbol("Symbol"); }); - getGlobalPromiseType = ts.memoize(function () { return getGlobalType("Promise", 1); }); - tryGetGlobalPromiseType = ts.memoize(function () { return getGlobalSymbol("Promise", 793064, undefined) && getGlobalPromiseType(); }); - getGlobalPromiseLikeType = ts.memoize(function () { return getGlobalType("PromiseLike", 1); }); - getInstantiatedGlobalPromiseLikeType = ts.memoize(createInstantiatedPromiseLikeType); - getGlobalPromiseConstructorSymbol = ts.memoize(function () { return getGlobalValueSymbol("Promise"); }); - tryGetGlobalPromiseConstructorSymbol = ts.memoize(function () { return getGlobalSymbol("Promise", 107455, undefined) && getGlobalPromiseConstructorSymbol(); }); - getGlobalPromiseConstructorLikeType = ts.memoize(function () { return getGlobalType("PromiseConstructorLike"); }); - getGlobalThenableType = ts.memoize(createThenableType); - getGlobalTemplateStringsArrayType = ts.memoize(function () { return getGlobalType("TemplateStringsArray"); }); - if (languageVersion >= 2) { - getGlobalESSymbolType = ts.memoize(function () { return getGlobalType("Symbol"); }); - getGlobalIterableType = ts.memoize(function () { return getGlobalType("Iterable", 1); }); - getGlobalIteratorType = ts.memoize(function () { return getGlobalType("Iterator", 1); }); - getGlobalIterableIteratorType = ts.memoize(function () { return getGlobalType("IterableIterator", 1); }); - } - else { - getGlobalESSymbolType = ts.memoize(function () { return emptyObjectType; }); - getGlobalIterableType = ts.memoize(function () { return emptyGenericType; }); - getGlobalIteratorType = ts.memoize(function () { return emptyGenericType; }); - getGlobalIterableIteratorType = ts.memoize(function () { return emptyGenericType; }); - } + globalArrayType = getGlobalType("Array", 1, true); + globalObjectType = getGlobalType("Object", 0, true); + globalFunctionType = getGlobalType("Function", 0, true); + globalStringType = getGlobalType("String", 0, true); + globalNumberType = getGlobalType("Number", 0, true); + globalBooleanType = getGlobalType("Boolean", 0, true); + globalRegExpType = getGlobalType("RegExp", 0, true); anyArrayType = createArrayType(anyType); autoArrayType = createArrayType(autoType); - var symbol = getGlobalSymbol("ReadonlyArray", 793064, undefined); - globalReadonlyArrayType = symbol && getTypeOfGlobalSymbol(symbol, 1); + globalReadonlyArrayType = getGlobalTypeOrUndefined("ReadonlyArray", 1); anyReadonlyArrayType = globalReadonlyArrayType ? createTypeFromGenericGlobalType(globalReadonlyArrayType, [anyType]) : anyArrayType; - if (compilerOptions.importHelpers && firstFileRequestingExternalHelpers) { - var helpersModule = resolveExternalModule(firstFileRequestingExternalHelpers, ts.externalHelpersModuleNameText, ts.Diagnostics.Cannot_find_module_0, undefined); - if (helpersModule) { - var exports_2 = helpersModule.exports; - if (requestedExternalEmitHelpers & 1024 && languageVersion < 2) { - verifyHelperSymbol(exports_2, "__extends", 107455); - } - if (requestedExternalEmitHelpers & 16384 && - (languageVersion < 5 || compilerOptions.jsx === 2)) { - verifyHelperSymbol(exports_2, "__assign", 107455); - } - if (languageVersion < 5 && requestedExternalEmitHelpers & 32768) { - verifyHelperSymbol(exports_2, "__rest", 107455); - } - if (requestedExternalEmitHelpers & 2048) { - verifyHelperSymbol(exports_2, "__decorate", 107455); - if (compilerOptions.emitDecoratorMetadata) { - verifyHelperSymbol(exports_2, "__metadata", 107455); - } - } - if (requestedExternalEmitHelpers & 4096) { - verifyHelperSymbol(exports_2, "__param", 107455); - } - if (requestedExternalEmitHelpers & 8192) { - verifyHelperSymbol(exports_2, "__awaiter", 107455); - if (languageVersion < 2) { - verifyHelperSymbol(exports_2, "__generator", 107455); + globalThisType = getGlobalTypeOrUndefined("ThisType", 1); + } + function checkExternalEmitHelpers(location, helpers) { + if ((requestedExternalEmitHelpers & helpers) !== helpers && compilerOptions.importHelpers) { + var sourceFile = ts.getSourceFileOfNode(location); + if (ts.isEffectiveExternalModule(sourceFile, compilerOptions) && !ts.isInAmbientContext(location)) { + var helpersModule = resolveHelpersModule(sourceFile, location); + if (helpersModule !== unknownSymbol) { + var uncheckedHelpers = helpers & ~requestedExternalEmitHelpers; + for (var helper = 1; helper <= 8192; helper <<= 1) { + if (uncheckedHelpers & helper) { + var name = getHelperName(helper); + var symbol = getSymbol(helpersModule.exports, ts.escapeIdentifier(name), 107455); + if (!symbol) { + error(location, ts.Diagnostics.This_syntax_requires_an_imported_helper_named_1_but_module_0_has_no_exported_member_1, ts.externalHelpersModuleNameText, name); + } + } } } + requestedExternalEmitHelpers |= helpers; } } } - function verifyHelperSymbol(symbols, name, meaning) { - var symbol = getSymbol(symbols, ts.escapeIdentifier(name), meaning); - if (!symbol) { - error(undefined, ts.Diagnostics.Module_0_has_no_exported_member_1, ts.externalHelpersModuleNameText, name); + function getHelperName(helper) { + switch (helper) { + case 1: return "__extends"; + case 2: return "__assign"; + case 4: return "__rest"; + case 8: return "__decorate"; + case 16: return "__metadata"; + case 32: return "__param"; + case 64: return "__awaiter"; + case 128: return "__generator"; + case 256: return "__values"; + case 512: return "__read"; + case 1024: return "__spread"; + case 2048: return "__asyncGenerator"; + case 4096: return "__asyncDelegator"; + case 8192: return "__asyncValues"; + default: ts.Debug.fail("Unrecognized helper."); } } - function createInstantiatedPromiseLikeType() { - var promiseLikeType = getGlobalPromiseLikeType(); - if (promiseLikeType !== emptyGenericType) { - return createTypeReference(promiseLikeType, [anyType]); + function resolveHelpersModule(node, errorNode) { + if (!externalHelpersModule) { + externalHelpersModule = resolveExternalModule(node, ts.externalHelpersModuleNameText, ts.Diagnostics.This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found, errorNode) || unknownSymbol; } - return emptyObjectType; - } - function createThenableType() { - var thenPropertySymbol = createSymbol(67108864 | 4, "then"); - getSymbolLinks(thenPropertySymbol).type = globalFunctionType; - var thenableType = createObjectType(16); - thenableType.properties = [thenPropertySymbol]; - thenableType.members = createSymbolTable(thenableType.properties); - thenableType.callSignatures = []; - thenableType.constructSignatures = []; - return thenableType; + return externalHelpersModule; } function checkGrammarDecorators(node) { if (!node.decorators) { return false; } if (!ts.nodeCanBeDecorated(node)) { - if (node.kind === 149 && !ts.nodeIsPresent(node.body)) { + if (node.kind === 150 && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 151 || node.kind === 152) { + else if (node.kind === 152 || node.kind === 153) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -36786,16 +40831,16 @@ var ts; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; if (modifier.kind !== 130) { - if (node.kind === 146 || node.kind === 148) { + if (node.kind === 147 || node.kind === 149) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 155) { + if (node.kind === 156) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 75: - if (node.kind !== 229 && node.parent.kind === 226) { + if (node.kind !== 231 && node.parent.kind === 228) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(75)); } break; @@ -36821,7 +40866,7 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 231 || node.parent.kind === 261) { + else if (node.parent.kind === 233 || node.parent.kind === 264) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128) { @@ -36844,10 +40889,10 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 231 || node.parent.kind === 261) { + else if (node.parent.kind === 233 || node.parent.kind === 264) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 144) { + else if (node.kind === 145) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128) { @@ -36860,7 +40905,7 @@ var ts; if (flags & 64) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 147 && node.kind !== 146 && node.kind !== 155 && node.kind !== 144) { + else if (node.kind !== 148 && node.kind !== 147 && node.kind !== 156 && node.kind !== 145) { return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } flags |= 64; @@ -36879,10 +40924,10 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } - else if (node.parent.kind === 226) { + else if (node.parent.kind === 228) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 144) { + else if (node.kind === 145) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1; @@ -36894,13 +40939,13 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.parent.kind === 226) { + else if (node.parent.kind === 228) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 144) { + else if (node.kind === 145) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 231) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 233) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 2; @@ -36910,14 +40955,14 @@ var ts; if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 226) { - if (node.kind !== 149 && - node.kind !== 147 && - node.kind !== 151 && - node.kind !== 152) { + if (node.kind !== 228) { + if (node.kind !== 150 && + node.kind !== 148 && + node.kind !== 152 && + node.kind !== 153) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 226 && ts.getModifierFlags(node.parent) & 128)) { + if (!(node.parent.kind === 228 && ts.getModifierFlags(node.parent) & 128)) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32) { @@ -36936,7 +40981,7 @@ var ts; else if (flags & 2 || ts.isInAmbientContext(node.parent)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 144) { + else if (node.kind === 145) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256; @@ -36944,7 +40989,7 @@ var ts; break; } } - if (node.kind === 150) { + if (node.kind === 151) { if (flags & 32) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -36959,13 +41004,13 @@ var ts; } return; } - else if ((node.kind === 235 || node.kind === 234) && flags & 2) { + else if ((node.kind === 237 || node.kind === 236) && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 144 && (flags & 92) && ts.isBindingPattern(node.name)) { + else if (node.kind === 145 && (flags & 92) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 144 && (flags & 92) && node.dotDotDotToken) { + else if (node.kind === 145 && (flags & 92) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256) { @@ -36981,37 +41026,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 151: case 152: - case 150: - case 147: - case 146: - case 149: + case 153: + case 151: case 148: - case 155: - case 230: - case 235: - case 234: - case 241: - case 240: - case 184: + case 147: + case 150: + case 149: + case 156: + case 232: + case 237: + case 236: + case 243: + case 242: case 185: - case 144: + case 186: + case 145: return false; default: - if (node.parent.kind === 231 || node.parent.kind === 261) { + if (node.parent.kind === 233 || node.parent.kind === 264) { return false; } switch (node.kind) { - case 225: - return nodeHasAnyModifiersExcept(node, 119); - case 226: - return nodeHasAnyModifiersExcept(node, 116); case 227: - case 205: + return nodeHasAnyModifiersExcept(node, 119); case 228: - return true; + return nodeHasAnyModifiersExcept(node, 116); case 229: + case 207: + case 230: + return true; + case 231: return nodeHasAnyModifiersExcept(node, 75); default: ts.Debug.fail(); @@ -37024,14 +41069,11 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 149: - case 225: - case 184: + case 150: + case 227: case 185: - if (!node.asteriskToken) { - return false; - } - break; + case 186: + return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); } @@ -37088,8 +41130,12 @@ var ts; return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarTypeParameterList(node.typeParameters, file) || checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); } + function checkGrammarClassLikeDeclaration(node) { + var file = ts.getSourceFileOfNode(node); + return checkGrammarClassDeclarationHeritageClauses(node) || checkGrammarTypeParameterList(node.typeParameters, file); + } function checkGrammarArrowFunction(node, file) { - if (node.kind === 185) { + if (node.kind === 186) { var arrowFunction = node; var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; @@ -37124,7 +41170,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 134 && parameter.type.kind !== 132) { + if (parameter.type.kind !== 135 && parameter.type.kind !== 132) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); } if (!node.type) { @@ -37151,7 +41197,7 @@ var ts; var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 198) { + if (arg.kind === 199) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -37221,28 +41267,25 @@ var ts; return false; } function checkGrammarComputedPropertyName(node) { - if (node.kind !== 142) { + if (node.kind !== 143) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 192 && computedPropertyName.expression.operatorToken.kind === 25) { + if (computedPropertyName.expression.kind === 193 && computedPropertyName.expression.operatorToken.kind === 25) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 225 || - node.kind === 184 || - node.kind === 149); + ts.Debug.assert(node.kind === 227 || + node.kind === 185 || + node.kind === 150); if (ts.isInAmbientContext(node)) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } if (!node.body) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.An_overload_signature_cannot_be_declared_as_a_generator); } - if (languageVersion < 2) { - return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher); - } } } function checkGrammarForInvalidQuestionMark(questionToken, message) { @@ -37258,87 +41301,87 @@ var ts; var GetOrSetAccessor = GetAccessor | SetAccessor; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 259) { + if (prop.kind === 262) { continue; } - var name_29 = prop.name; - if (name_29.kind === 142) { - checkGrammarComputedPropertyName(name_29); + var name = prop.name; + if (name.kind === 143) { + checkGrammarComputedPropertyName(name); } - if (prop.kind === 258 && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 261 && !inDestructuring && prop.objectAssignmentInitializer) { return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); } if (prop.modifiers) { for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { var mod = _c[_b]; - if (mod.kind !== 119 || prop.kind !== 149) { + if (mod.kind !== 119 || prop.kind !== 150) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } } var currentKind = void 0; - if (prop.kind === 257 || prop.kind === 258) { + if (prop.kind === 260 || prop.kind === 261) { checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); - if (name_29.kind === 8) { - checkGrammarNumericLiteral(name_29); + if (name.kind === 8) { + checkGrammarNumericLiteral(name); } currentKind = Property; } - else if (prop.kind === 149) { + else if (prop.kind === 150) { currentKind = Property; } - else if (prop.kind === 151) { + else if (prop.kind === 152) { currentKind = GetAccessor; } - else if (prop.kind === 152) { + else if (prop.kind === 153) { currentKind = SetAccessor; } else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - var effectiveName = ts.getPropertyNameForPropertyNameNode(name_29); + var effectiveName = ts.getPropertyNameForPropertyNameNode(name); if (effectiveName === undefined) { continue; } - if (!seen[effectiveName]) { - seen[effectiveName] = currentKind; + var existingKind = seen.get(effectiveName); + if (!existingKind) { + seen.set(effectiveName, currentKind); } else { - var existingKind = seen[effectiveName]; if (currentKind === Property && existingKind === Property) { - grammarErrorOnNode(name_29, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name_29)); + grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name)); } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[effectiveName] = currentKind | existingKind; + seen.set(effectiveName, currentKind | existingKind); } else { - return grammarErrorOnNode(name_29, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); } } else { - return grammarErrorOnNode(name_29, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); } } } } function checkGrammarJsxElement(node) { var seen = ts.createMap(); - for (var _i = 0, _a = node.attributes; _i < _a.length; _i++) { + for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 251) { + if (attr.kind === 254) { continue; } var jsxAttr = attr; - var name_30 = jsxAttr.name; - if (!seen[name_30.text]) { - seen[name_30.text] = true; + var name = jsxAttr.name; + if (!seen.get(name.text)) { + seen.set(name.text, true); } else { - return grammarErrorOnNode(name_30, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); + return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } var initializer = jsxAttr.initializer; - if (initializer && initializer.kind === 252 && !initializer.expression) { + if (initializer && initializer.kind === 255 && !initializer.expression) { return grammarErrorOnNode(jsxAttr.initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -37347,7 +41390,12 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 224) { + if (forInOrOfStatement.kind === 215 && forInOrOfStatement.awaitModifier) { + if ((forInOrOfStatement.flags & 16384) === 0) { + return grammarErrorOnNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); + } + } + if (forInOrOfStatement.initializer.kind === 226) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -37355,20 +41403,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 212 + var diagnostic = forInOrOfStatement.kind === 214 ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 212 + var diagnostic = forInOrOfStatement.kind === 214 ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 212 + var diagnostic = forInOrOfStatement.kind === 214 ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -37388,15 +41436,18 @@ var ts; else if (accessor.body === undefined && !(ts.getModifierFlags(accessor) & 128)) { return grammarErrorAtPos(ts.getSourceFileOfNode(accessor), accessor.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } + else if (accessor.body && ts.getModifierFlags(accessor) & 128) { + return grammarErrorOnNode(accessor, ts.Diagnostics.An_abstract_accessor_cannot_have_an_implementation); + } else if (accessor.typeParameters) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } else if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, kind === 151 ? + return grammarErrorOnNode(accessor.name, kind === 152 ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - else if (kind === 152) { + else if (kind === 153) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -37415,10 +41466,10 @@ var ts; } } function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 151 ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 152 ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 151 ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 152 ? 1 : 2)) { return ts.getThisParameter(accessor); } } @@ -37433,7 +41484,7 @@ var ts; checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 176) { + if (node.parent.kind === 177) { if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) { return true; } @@ -37449,10 +41500,10 @@ var ts; return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol); } } - else if (node.parent.kind === 227) { + else if (node.parent.kind === 229) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol); } - else if (node.parent.kind === 161) { + else if (node.parent.kind === 162) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol); } } @@ -37463,9 +41514,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 219: + case 221: if (node.label && current.label.text === node.label.text) { - var isMisplacedContinueLabel = node.kind === 214 + var isMisplacedContinueLabel = node.kind === 216 && !ts.isIterationStatement(current.statement, true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -37473,8 +41524,8 @@ var ts; return false; } break; - case 218: - if (node.kind === 215 && !node.label) { + case 220: + if (node.kind === 217 && !node.label) { return false; } break; @@ -37487,13 +41538,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 215 + var message = node.kind === 217 ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 215 + var message = node.kind === 217 ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -37505,7 +41556,7 @@ var ts; if (node !== ts.lastOrUndefined(elements)) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } - if (node.name.kind === 173 || node.name.kind === 172) { + if (node.name.kind === 174 || node.name.kind === 173) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } if (node.initializer) { @@ -37515,11 +41566,11 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return expr.kind === 9 || expr.kind === 8 || - expr.kind === 190 && expr.operator === 37 && + expr.kind === 191 && expr.operator === 37 && expr.operand.kind === 8; } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 212 && node.parent.parent.kind !== 213) { + if (node.parent.parent.kind !== 214 && node.parent.parent.kind !== 215) { if (ts.isInAmbientContext(node)) { if (node.initializer) { if (ts.isConst(node) && !node.type) { @@ -37546,9 +41597,29 @@ var ts; } } } + if (compilerOptions.module !== ts.ModuleKind.ES2015 && compilerOptions.module !== ts.ModuleKind.System && !compilerOptions.noEmit && + !ts.isInAmbientContext(node.parent.parent) && ts.hasModifier(node.parent.parent, 1)) { + checkESModuleMarker(node.name); + } var checkLetConstNames = (ts.isLet(node) || ts.isConst(node)); return checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name); } + function checkESModuleMarker(name) { + if (name.kind === 70) { + if (ts.unescapeIdentifier(name.text) === "__esModule") { + return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules); + } + } + else { + var elements = name.elements; + for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) { + var element = elements_2[_i]; + if (!ts.isOmittedExpression(element)) { + return checkESModuleMarker(element.name); + } + } + } + } function checkGrammarNameInLetOrConstDeclarations(name) { if (name.kind === 70) { if (name.originalKeywordKind === 109) { @@ -37557,8 +41628,8 @@ var ts; } else { var elements = name.elements; - for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) { - var element = elements_2[_i]; + for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) { + var element = elements_3[_i]; if (!ts.isOmittedExpression(element)) { checkGrammarNameInLetOrConstDeclarations(element.name); } @@ -37576,15 +41647,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 208: - case 209: case 210: - case 217: case 211: case 212: - case 213: - return false; case 219: + case 213: + case 214: + case 215: + return false; + case 221: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -37599,6 +41670,13 @@ var ts; } } } + function checkGrammarMetaProperty(node) { + if (node.keywordToken === 93) { + if (node.name.text !== "target") { + return grammarErrorOnNode(node.name, ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, node.name.text, ts.tokenToString(node.keywordToken), "target"); + } + } + } function hasParseDiagnostics(sourceFile) { return sourceFile.parseDiagnostics.length > 0; } @@ -37639,7 +41717,7 @@ var ts; return true; } } - else if (node.parent.kind === 227) { + else if (node.parent.kind === 229) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -37647,7 +41725,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 161) { + else if (node.parent.kind === 162) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -37660,13 +41738,13 @@ var ts; } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 227 || - node.kind === 228 || + if (node.kind === 229 || + node.kind === 230 || + node.kind === 237 || + node.kind === 236 || + node.kind === 243 || + node.kind === 242 || node.kind === 235 || - node.kind === 234 || - node.kind === 241 || - node.kind === 240 || - node.kind === 233 || ts.getModifierFlags(node) & (2 | 1 | 512)) { return false; } @@ -37675,7 +41753,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 205) { + if (ts.isDeclaration(decl) || decl.kind === 207) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -37694,7 +41772,7 @@ var ts; if (!links.hasReportedStatementInAmbientContext && ts.isFunctionLike(node.parent)) { return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } - if (node.parent.kind === 204 || node.parent.kind === 231 || node.parent.kind === 261) { + if (node.parent.kind === 206 || node.parent.kind === 233 || node.parent.kind === 264) { var links_1 = getNodeLinks(node.parent); if (!links_1.hasReportedStatementInAmbientContext) { return links_1.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); @@ -37705,8 +41783,22 @@ var ts; } } function checkGrammarNumericLiteral(node) { - if (node.isOctalLiteral && languageVersion >= 1) { - return grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); + if (node.numericLiteralFlags & 4) { + var diagnosticMessage = void 0; + if (languageVersion >= 1) { + diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; + } + else if (ts.isChildOfNodeWithKind(node, 172)) { + diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; + } + else if (ts.isChildOfNodeWithKind(node, 263)) { + diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; + } + if (diagnosticMessage) { + var withMinus = ts.isPrefixUnaryExpression(node.parent) && node.parent.operator === 37; + var literal = (withMinus ? "-" : "") + "0o" + node.text; + return grammarErrorOnNode(withMinus ? node.parent : node, diagnosticMessage, literal); + } } } function grammarErrorAfterFirstToken(node, message, arg0, arg1, arg2) { @@ -37719,11 +41811,11 @@ var ts; } function getAmbientModules() { var result = []; - for (var sym in globals) { + globals.forEach(function (global, sym) { if (ambientModuleSymbolRegex.test(sym)) { - result.push(globals[sym]); + result.push(global); } - } + }); return result; } } @@ -37731,55 +41823,359 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - ; - var nodeEdgeTraversalMap = ts.createMap((_a = {}, - _a[141] = [ - { name: "left", test: ts.isEntityName }, - { name: "right", test: ts.isIdentifier } - ], - _a[145] = [ - { name: "expression", test: ts.isLeftHandSideExpression } - ], - _a[182] = [ - { name: "type", test: ts.isTypeNode }, - { name: "expression", test: ts.isUnaryExpression } - ], - _a[200] = [ - { name: "expression", test: ts.isExpression }, - { name: "type", test: ts.isTypeNode } - ], - _a[201] = [ - { name: "expression", test: ts.isLeftHandSideExpression } - ], - _a[229] = [ - { name: "decorators", test: ts.isDecorator }, - { name: "modifiers", test: ts.isModifier }, - { name: "name", test: ts.isIdentifier }, - { name: "members", test: ts.isEnumMember } - ], - _a[230] = [ - { name: "decorators", test: ts.isDecorator }, - { name: "modifiers", test: ts.isModifier }, - { name: "name", test: ts.isModuleName }, - { name: "body", test: ts.isModuleBody } - ], - _a[231] = [ - { name: "statements", test: ts.isStatement } - ], - _a[234] = [ - { name: "decorators", test: ts.isDecorator }, - { name: "modifiers", test: ts.isModifier }, - { name: "name", test: ts.isIdentifier }, - { name: "moduleReference", test: ts.isModuleReference } - ], - _a[245] = [ - { name: "expression", test: ts.isExpression, optional: true } - ], - _a[260] = [ - { name: "name", test: ts.isPropertyName }, - { name: "initializer", test: ts.isExpression, optional: true, parenthesize: ts.parenthesizeExpressionForList } - ], - _a)); + function visitNode(node, visitor, test, lift) { + if (node === undefined || visitor === undefined) { + return node; + } + ts.aggregateTransformFlags(node); + var visited = visitor(node); + if (visited === node) { + return node; + } + var visitedNode; + if (visited === undefined) { + return undefined; + } + else if (ts.isArray(visited)) { + visitedNode = (lift || extractSingleNode)(visited); + } + else { + visitedNode = visited; + } + ts.Debug.assertNode(visitedNode, test); + ts.aggregateTransformFlags(visitedNode); + return visitedNode; + } + ts.visitNode = visitNode; + function visitNodes(nodes, visitor, test, start, count) { + if (nodes === undefined || visitor === undefined) { + return nodes; + } + var updated; + var length = nodes.length; + if (start === undefined || start < 0) { + start = 0; + } + if (count === undefined || count > length - start) { + count = length - start; + } + if (start > 0 || count < length) { + updated = ts.createNodeArray([], nodes.hasTrailingComma && start + count === length); + } + for (var i = 0; i < count; i++) { + var node = nodes[i + start]; + ts.aggregateTransformFlags(node); + var visited = node !== undefined ? visitor(node) : undefined; + if (updated !== undefined || visited === undefined || visited !== node) { + if (updated === undefined) { + updated = ts.createNodeArray(nodes.slice(0, i), nodes.hasTrailingComma); + ts.setTextRange(updated, nodes); + } + if (visited) { + if (ts.isArray(visited)) { + for (var _i = 0, visited_1 = visited; _i < visited_1.length; _i++) { + var visitedNode = visited_1[_i]; + ts.Debug.assertNode(visitedNode, test); + ts.aggregateTransformFlags(visitedNode); + updated.push(visitedNode); + } + } + else { + ts.Debug.assertNode(visited, test); + ts.aggregateTransformFlags(visited); + updated.push(visited); + } + } + } + } + return updated || nodes; + } + ts.visitNodes = visitNodes; + function visitLexicalEnvironment(statements, visitor, context, start, ensureUseStrict) { + context.startLexicalEnvironment(); + statements = visitNodes(statements, visitor, ts.isStatement, start); + if (ensureUseStrict && !ts.startsWithUseStrict(statements)) { + statements = ts.setTextRange(ts.createNodeArray([ts.createStatement(ts.createLiteral("use strict"))].concat(statements)), statements); + } + var declarations = context.endLexicalEnvironment(); + return ts.setTextRange(ts.createNodeArray(ts.concatenate(statements, declarations)), statements); + } + ts.visitLexicalEnvironment = visitLexicalEnvironment; + function visitParameterList(nodes, visitor, context, nodesVisitor) { + if (nodesVisitor === void 0) { nodesVisitor = visitNodes; } + context.startLexicalEnvironment(); + var updated = nodesVisitor(nodes, visitor, ts.isParameterDeclaration); + context.suspendLexicalEnvironment(); + return updated; + } + ts.visitParameterList = visitParameterList; + function visitFunctionBody(node, visitor, context) { + context.resumeLexicalEnvironment(); + var updated = visitNode(node, visitor, ts.isConciseBody); + var declarations = context.endLexicalEnvironment(); + if (ts.some(declarations)) { + var block = ts.convertToFunctionBody(updated); + var statements = ts.mergeLexicalEnvironment(block.statements, declarations); + return ts.updateBlock(block, statements); + } + return updated; + } + ts.visitFunctionBody = visitFunctionBody; + function visitEachChild(node, visitor, context, nodesVisitor, tokenVisitor) { + if (nodesVisitor === void 0) { nodesVisitor = visitNodes; } + if (node === undefined) { + return undefined; + } + var kind = node.kind; + if ((kind > 0 && kind <= 141) || kind === 168) { + return node; + } + switch (node.kind) { + case 205: + case 208: + case 199: + case 224: + case 297: + case 246: + return node; + case 142: + return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); + case 143: + return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); + case 159: + return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 160: + return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 154: + return ts.updateCallSignatureDeclaration(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 155: + return ts.updateConstructSignatureDeclaration(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 149: + return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); + case 156: + return ts.updateIndexSignatureDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 145: + return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + case 146: + return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); + case 158: + return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); + case 157: + return ts.updateTypePredicateNode(node, visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 161: + return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); + case 162: + return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor)); + case 163: + return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); + case 164: + return ts.updateTypleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); + case 165: + case 166: + return ts.updateUnionOrIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); + case 167: + throw ts.Debug.fail("not implemented."); + case 169: + return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); + case 170: + return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); + case 171: + return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameter), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); + case 172: + return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); + case 144: + return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); + case 147: + return ts.updatePropertySignature(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + case 148: + return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + case 150: + return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 151: + return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); + case 152: + return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 153: + return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); + case 173: + return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); + case 174: + return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); + case 175: + return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); + case 176: + return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); + case 177: + return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); + case 178: + return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier)); + case 179: + return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); + case 180: + return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); + case 181: + return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); + case 182: + return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); + case 183: + return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); + case 184: + return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); + case 185: + return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 186: + return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 187: + return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); + case 188: + return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); + case 189: + return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); + case 190: + return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); + case 193: + return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression)); + case 191: + return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); + case 192: + return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); + case 194: + return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.whenFalse, visitor, ts.isExpression)); + case 195: + return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); + case 196: + return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); + case 197: + return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); + case 198: + return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); + case 200: + return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); + case 201: + return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); + case 202: + return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); + case 204: + return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); + case 206: + return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + case 207: + return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); + case 209: + return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression)); + case 210: + return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); + case 211: + return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); + case 212: + return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 213: + return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 214: + return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 215: + return ts.updateForOf(node, node.awaitModifier, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 216: + return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); + case 217: + return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); + case 218: + return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); + case 219: + return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 220: + return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); + case 221: + return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 222: + return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); + case 223: + return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); + case 225: + return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + case 226: + return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); + case 227: + return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 228: + return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); + case 231: + return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); + case 232: + return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); + case 233: + return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + case 234: + return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); + case 236: + return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); + case 237: + return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); + case 238: + return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings)); + case 239: + return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); + case 240: + return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); + case 241: + return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); + case 242: + return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); + case 243: + return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); + case 244: + return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); + case 245: + return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); + case 247: + return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); + case 248: + return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); + case 253: + return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); + case 249: + return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); + case 250: + return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); + case 251: + return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); + case 252: + return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); + case 254: + return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); + case 255: + return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); + case 256: + return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); + case 257: + return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + case 258: + return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); + case 259: + return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); + case 260: + return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); + case 261: + return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); + case 262: + return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); + case 263: + return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); + case 264: + return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); + case 295: + return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); + default: + return node; + } + } + ts.visitEachChild = visitEachChild; + function extractSingleNode(nodes) { + ts.Debug.assert(nodes.length <= 1, "Too many nodes written to output."); + return ts.singleOrUndefined(nodes); + } +})(ts || (ts = {})); +(function (ts) { function reduceNode(node, f, initial) { return node ? f(initial, node) : initial; } @@ -37793,41 +42189,45 @@ var ts; var reduceNodes = cbNodeArray ? reduceNodeArray : ts.reduceLeft; var cbNodes = cbNodeArray || cbNode; var kind = node.kind; - if ((kind > 0 && kind <= 140)) { + if ((kind > 0 && kind <= 141)) { return initial; } - if ((kind >= 156 && kind <= 171)) { + if ((kind >= 157 && kind <= 172)) { return initial; } var result = initial; switch (node.kind) { - case 203: - case 206: - case 198: - case 222: - case 293: + case 205: + case 208: + case 199: + case 224: + case 294: break; case 142: - result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.left, cbNode, result); + result = reduceNode(node.right, cbNode, result); break; - case 144: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.type, cbNode, result); - result = reduceNode(node.initializer, cbNode, result); + case 143: + result = reduceNode(node.expression, cbNode, result); break; case 145: - result = reduceNode(node.expression, cbNode, result); - break; - case 147: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 149: + case 146: + result = reduceNode(node.expression, cbNode, result); + break; + case 148: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + case 150: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -37836,53 +42236,48 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 150: - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.body, cbNode, result); - break; case 151: - result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; case 152: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.body, cbNode, result); + break; + case 153: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.body, cbNode, result); break; - case 172: case 173: + case 174: result = reduceNodes(node.elements, cbNodes, result); break; - case 174: + case 175: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 175: + case 176: result = reduceNodes(node.elements, cbNodes, result); break; - case 176: - result = reduceNodes(node.properties, cbNodes, result); - break; case 177: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.properties, cbNodes, result); break; case 178: result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.argumentExpression, cbNode, result); + result = reduceNode(node.name, cbNode, result); break; case 179: result = reduceNode(node.expression, cbNode, result); - result = reduceNodes(node.typeArguments, cbNodes, result); - result = reduceNodes(node.arguments, cbNodes, result); + result = reduceNode(node.argumentExpression, cbNode, result); break; case 180: result = reduceNode(node.expression, cbNode, result); @@ -37890,10 +42285,19 @@ var ts; result = reduceNodes(node.arguments, cbNodes, result); break; case 181: + result = reduceNode(node.expression, cbNode, result); + result = reduceNodes(node.typeArguments, cbNodes, result); + result = reduceNodes(node.arguments, cbNodes, result); + break; + case 182: result = reduceNode(node.tag, cbNode, result); result = reduceNode(node.template, cbNode, result); break; - case 184: + case 183: + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.expression, cbNode, result); + break; + case 185: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); @@ -37901,117 +42305,124 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 185: + case 186: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 183: - case 186: + case 184: case 187: case 188: case 189: - case 195: + case 190: case 196: - case 201: + case 197: + case 202: result = reduceNode(node.expression, cbNode, result); break; - case 190: case 191: + case 192: result = reduceNode(node.operand, cbNode, result); break; - case 192: + case 193: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 193: + case 194: result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.whenTrue, cbNode, result); result = reduceNode(node.whenFalse, cbNode, result); break; - case 194: + case 195: result = reduceNode(node.head, cbNode, result); result = reduceNodes(node.templateSpans, cbNodes, result); break; - case 197: + case 198: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 199: + case 200: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); break; + case 201: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.type, cbNode, result); + break; case 202: + result = reduceNode(node.expression, cbNode, result); + break; + case 204: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.literal, cbNode, result); break; - case 204: + case 206: result = reduceNodes(node.statements, cbNodes, result); break; - case 205: + case 207: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.declarationList, cbNode, result); break; - case 207: + case 209: result = reduceNode(node.expression, cbNode, result); break; - case 208: + case 210: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.thenStatement, cbNode, result); result = reduceNode(node.elseStatement, cbNode, result); break; - case 209: - result = reduceNode(node.statement, cbNode, result); - result = reduceNode(node.expression, cbNode, result); - break; - case 210: - case 217: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.statement, cbNode, result); - break; case 211: + result = reduceNode(node.statement, cbNode, result); + result = reduceNode(node.expression, cbNode, result); + break; + case 212: + case 219: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.statement, cbNode, result); + break; + case 213: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.incrementor, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 212: - case 213: + case 214: + case 215: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 216: - case 220: + case 218: + case 222: result = reduceNode(node.expression, cbNode, result); break; - case 218: + case 220: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.caseBlock, cbNode, result); break; - case 219: + case 221: result = reduceNode(node.label, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 221: + case 223: result = reduceNode(node.tryBlock, cbNode, result); result = reduceNode(node.catchClause, cbNode, result); result = reduceNode(node.finallyBlock, cbNode, result); break; - case 223: + case 225: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 224: + case 226: result = reduceNodes(node.declarations, cbNodes, result); break; - case 225: + case 227: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -38020,7 +42431,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 226: + case 228: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -38028,455 +42439,145 @@ var ts; result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; + case 231: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.members, cbNodes, result); + break; case 232: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.body, cbNode, result); + break; + case 233: + result = reduceNodes(node.statements, cbNodes, result); + break; + case 234: result = reduceNodes(node.clauses, cbNodes, result); break; - case 235: + case 236: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.moduleReference, cbNode, result); + break; + case 237: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.importClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 236: + case 238: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.namedBindings, cbNode, result); break; - case 237: - result = reduceNode(node.name, cbNode, result); - break; - case 238: - case 242: - result = reduceNodes(node.elements, cbNodes, result); - break; case 239: - case 243: - result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); break; case 240: + case 244: + result = reduceNodes(node.elements, cbNodes, result); + break; + case 241: + case 245: + result = reduceNode(node.propertyName, cbNode, result); + result = reduceNode(node.name, cbNode, result); + break; + case 242: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 241: + case 243: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.exportClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 246: + case 247: + result = reduceNode(node.expression, cbNode, result); + break; + case 248: result = reduceNode(node.openingElement, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingElement, cbNode, result); break; - case 247: - case 248: - result = reduceNode(node.tagName, cbNode, result); - result = reduceNodes(node.attributes, cbNodes, result); - break; case 249: + case 250: + result = reduceNode(node.tagName, cbNode, result); + result = reduceNode(node.attributes, cbNode, result); + break; + case 253: + result = reduceNodes(node.properties, cbNodes, result); + break; + case 251: result = reduceNode(node.tagName, cbNode, result); break; - case 250: + case 252: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 251: - result = reduceNode(node.expression, cbNode, result); - break; - case 252: - result = reduceNode(node.expression, cbNode, result); - break; - case 253: - result = reduceNode(node.expression, cbNode, result); case 254: - result = reduceNodes(node.statements, cbNodes, result); + result = reduceNode(node.expression, cbNode, result); break; case 255: - result = reduceNodes(node.types, cbNodes, result); + result = reduceNode(node.expression, cbNode, result); break; case 256: + result = reduceNode(node.expression, cbNode, result); + case 257: + result = reduceNodes(node.statements, cbNodes, result); + break; + case 258: + result = reduceNodes(node.types, cbNodes, result); + break; + case 259: result = reduceNode(node.variableDeclaration, cbNode, result); result = reduceNode(node.block, cbNode, result); break; - case 257: + case 260: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 258: + case 261: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.objectAssignmentInitializer, cbNode, result); break; - case 259: + case 262: result = reduceNode(node.expression, cbNode, result); break; - case 261: + case 263: + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + case 264: result = reduceNodes(node.statements, cbNodes, result); break; - case 294: + case 295: result = reduceNode(node.expression, cbNode, result); break; default: - var edgeTraversalPath = nodeEdgeTraversalMap[kind]; - if (edgeTraversalPath) { - for (var _i = 0, edgeTraversalPath_1 = edgeTraversalPath; _i < edgeTraversalPath_1.length; _i++) { - var edge = edgeTraversalPath_1[_i]; - var value = node[edge.name]; - if (value !== undefined) { - result = ts.isArray(value) - ? reduceNodes(value, cbNodes, result) - : cbNode(result, value); - } - } - } break; } return result; } ts.reduceEachChild = reduceEachChild; - function visitNode(node, visitor, test, optional, lift, parenthesize, parentNode) { - if (node === undefined || visitor === undefined) { - return node; - } - aggregateTransformFlags(node); - var visited = visitor(node); - if (visited === node) { - return node; - } - var visitedNode; - if (visited === undefined) { - if (!optional) { - Debug.failNotOptional(); - } - return undefined; - } - else if (ts.isArray(visited)) { - visitedNode = (lift || extractSingleNode)(visited); - } - else { - visitedNode = visited; - } - if (parenthesize !== undefined) { - visitedNode = parenthesize(visitedNode, parentNode); - } - Debug.assertNode(visitedNode, test); - aggregateTransformFlags(visitedNode); - return visitedNode; - } - ts.visitNode = visitNode; - function visitNodes(nodes, visitor, test, start, count, parenthesize, parentNode) { - if (nodes === undefined) { - return undefined; - } - var updated; - var length = nodes.length; - if (start === undefined || start < 0) { - start = 0; - } - if (count === undefined || count > length - start) { - count = length - start; - } - if (start > 0 || count < length) { - updated = ts.createNodeArray([], undefined, nodes.hasTrailingComma && start + count === length); - } - for (var i = 0; i < count; i++) { - var node = nodes[i + start]; - aggregateTransformFlags(node); - var visited = node !== undefined ? visitor(node) : undefined; - if (updated !== undefined || visited === undefined || visited !== node) { - if (updated === undefined) { - updated = ts.createNodeArray(nodes.slice(0, i), nodes, nodes.hasTrailingComma); - } - if (visited) { - if (ts.isArray(visited)) { - for (var _i = 0, visited_1 = visited; _i < visited_1.length; _i++) { - var visitedNode = visited_1[_i]; - visitedNode = parenthesize - ? parenthesize(visitedNode, parentNode) - : visitedNode; - Debug.assertNode(visitedNode, test); - aggregateTransformFlags(visitedNode); - updated.push(visitedNode); - } - } - else { - var visitedNode = parenthesize - ? parenthesize(visited, parentNode) - : visited; - Debug.assertNode(visitedNode, test); - aggregateTransformFlags(visitedNode); - updated.push(visitedNode); - } - } - } - } - return updated || nodes; - } - ts.visitNodes = visitNodes; - function visitLexicalEnvironment(statements, visitor, context, start, ensureUseStrict) { - context.startLexicalEnvironment(); - statements = visitNodes(statements, visitor, ts.isStatement, start); - if (ensureUseStrict && !ts.startsWithUseStrict(statements)) { - statements = ts.createNodeArray([ts.createStatement(ts.createLiteral("use strict"))].concat(statements), statements); - } - var declarations = context.endLexicalEnvironment(); - return ts.createNodeArray(ts.concatenate(statements, declarations), statements); - } - ts.visitLexicalEnvironment = visitLexicalEnvironment; - function visitParameterList(nodes, visitor, context) { - context.startLexicalEnvironment(); - var updated = visitNodes(nodes, visitor, ts.isParameterDeclaration); - context.suspendLexicalEnvironment(); - return updated; - } - ts.visitParameterList = visitParameterList; - function visitFunctionBody(node, visitor, context) { - context.resumeLexicalEnvironment(); - var updated = visitNode(node, visitor, ts.isConciseBody); - var declarations = context.endLexicalEnvironment(); - if (ts.some(declarations)) { - var block = ts.convertToFunctionBody(updated); - var statements = mergeLexicalEnvironment(block.statements, declarations); - return ts.updateBlock(block, statements); - } - return updated; - } - ts.visitFunctionBody = visitFunctionBody; - function visitEachChild(node, visitor, context) { - if (node === undefined) { - return undefined; - } - var kind = node.kind; - if ((kind > 0 && kind <= 140)) { - return node; - } - if ((kind >= 156 && kind <= 171)) { - return node; - } - switch (node.kind) { - case 203: - case 206: - case 198: - case 222: - return node; - case 142: - return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); - case 144: - return ts.updateParameter(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), node.dotDotDotToken, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true)); - case 147: - return ts.updateProperty(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true)); - case 149: - return ts.updateMethod(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, true), visitFunctionBody(node.body, visitor, context)); - case 150: - return ts.updateConstructor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context), visitFunctionBody(node.body, visitor, context)); - case 151: - return ts.updateGetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, true), visitFunctionBody(node.body, visitor, context)); - case 152: - return ts.updateSetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context), visitFunctionBody(node.body, visitor, context)); - case 172: - return ts.updateObjectBindingPattern(node, visitNodes(node.elements, visitor, ts.isBindingElement)); - case 173: - return ts.updateArrayBindingPattern(node, visitNodes(node.elements, visitor, ts.isArrayBindingElement)); - case 174: - return ts.updateBindingElement(node, node.dotDotDotToken, visitNode(node.propertyName, visitor, ts.isPropertyName, true), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression, true)); - case 175: - return ts.updateArrayLiteral(node, visitNodes(node.elements, visitor, ts.isExpression)); - case 176: - return ts.updateObjectLiteral(node, visitNodes(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 177: - return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier)); - case 178: - return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 179: - return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression)); - case 180: - return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression)); - case 181: - return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); - case 183: - return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); - case 184: - return ts.updateFunctionExpression(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, true), visitFunctionBody(node.body, visitor, context)); - case 185: - return ts.updateArrowFunction(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, true), visitFunctionBody(node.body, visitor, context)); - case 186: - return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); - case 187: - return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); - case 188: - return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); - case 189: - return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); - case 192: - return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression)); - case 190: - return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 191: - return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 193: - return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.whenFalse, visitor, ts.isExpression)); - case 194: - return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), visitNodes(node.templateSpans, visitor, ts.isTemplateSpan)); - case 195: - return ts.updateYield(node, visitNode(node.expression, visitor, ts.isExpression)); - case 196: - return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); - case 197: - return ts.updateClassExpression(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier, true), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), visitNodes(node.members, visitor, ts.isClassElement)); - case 199: - return ts.updateExpressionWithTypeArguments(node, visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 202: - return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); - case 204: - return ts.updateBlock(node, visitNodes(node.statements, visitor, ts.isStatement)); - case 205: - return ts.updateVariableStatement(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 207: - return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression)); - case 208: - return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, false, liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, true, liftToBlock)); - case 209: - return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); - case 210: - return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock)); - case 211: - return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock)); - case 212: - return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock)); - case 213: - return ts.updateForOf(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock)); - case 214: - return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier, true)); - case 215: - return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier, true)); - case 216: - return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression, true)); - case 217: - return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock)); - case 218: - return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); - case 219: - return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock)); - case 220: - return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); - case 221: - return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause, true), visitNode(node.finallyBlock, visitor, ts.isBlock, true)); - case 223: - return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true)); - case 224: - return ts.updateVariableDeclarationList(node, visitNodes(node.declarations, visitor, ts.isVariableDeclaration)); - case 225: - return ts.updateFunctionDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, true), visitFunctionBody(node.body, visitor, context)); - case 226: - return ts.updateClassDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier, true), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), visitNodes(node.members, visitor, ts.isClassElement)); - case 232: - return ts.updateCaseBlock(node, visitNodes(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 235: - return ts.updateImportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause, true), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 236: - return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier, true), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings, true)); - case 237: - return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 238: - return ts.updateNamedImports(node, visitNodes(node.elements, visitor, ts.isImportSpecifier)); - case 239: - return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier, true), visitNode(node.name, visitor, ts.isIdentifier)); - case 240: - return ts.updateExportAssignment(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); - case 241: - return ts.updateExportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports, true), visitNode(node.moduleSpecifier, visitor, ts.isExpression, true)); - case 242: - return ts.updateNamedExports(node, visitNodes(node.elements, visitor, ts.isExportSpecifier)); - case 243: - return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier, true), visitNode(node.name, visitor, ts.isIdentifier)); - case 246: - return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), visitNodes(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 247: - return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNodes(node.attributes, visitor, ts.isJsxAttributeLike)); - case 248: - return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNodes(node.attributes, visitor, ts.isJsxAttributeLike)); - case 249: - return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 250: - return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 251: - return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); - case 252: - return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 253: - return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.statements, visitor, ts.isStatement)); - case 254: - return ts.updateDefaultClause(node, visitNodes(node.statements, visitor, ts.isStatement)); - case 255: - return ts.updateHeritageClause(node, visitNodes(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 256: - return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); - case 257: - return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 258: - return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 259: - return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); - case 261: - return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); - case 294: - return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - default: - var updated = void 0; - var edgeTraversalPath = nodeEdgeTraversalMap[kind]; - if (edgeTraversalPath) { - for (var _i = 0, edgeTraversalPath_2 = edgeTraversalPath; _i < edgeTraversalPath_2.length; _i++) { - var edge = edgeTraversalPath_2[_i]; - var value = node[edge.name]; - if (value !== undefined) { - var visited = ts.isArray(value) - ? visitNodes(value, visitor, edge.test, 0, value.length, edge.parenthesize, node) - : visitNode(value, visitor, edge.test, edge.optional, edge.lift, edge.parenthesize, node); - if (updated !== undefined || visited !== value) { - if (updated === undefined) { - updated = ts.getMutableClone(node); - } - if (visited !== value) { - updated[edge.name] = visited; - } - } - } - } - } - return updated ? ts.updateNode(updated, node) : node; - } - } - ts.visitEachChild = visitEachChild; function mergeLexicalEnvironment(statements, declarations) { if (!ts.some(declarations)) { return statements; } return ts.isNodeArray(statements) - ? ts.createNodeArray(ts.concatenate(statements, declarations), statements) + ? ts.setTextRange(ts.createNodeArray(ts.concatenate(statements, declarations)), statements) : ts.addRange(statements, declarations); } ts.mergeLexicalEnvironment = mergeLexicalEnvironment; - function mergeFunctionBodyLexicalEnvironment(body, declarations) { - if (body && declarations !== undefined && declarations.length > 0) { - if (ts.isBlock(body)) { - return ts.updateBlock(body, ts.createNodeArray(ts.concatenate(body.statements, declarations), body.statements)); - } - else { - return ts.createBlock(ts.createNodeArray([ts.createReturn(body, body)].concat(declarations), body), body, true); - } - } - return body; - } - ts.mergeFunctionBodyLexicalEnvironment = mergeFunctionBodyLexicalEnvironment; function liftToBlock(nodes) { Debug.assert(ts.every(nodes, ts.isStatement), "Cannot lift nodes to a Block."); return ts.singleOrUndefined(nodes) || ts.createBlock(nodes); } ts.liftToBlock = liftToBlock; - function extractSingleNode(nodes) { - Debug.assert(nodes.length <= 1, "Too many nodes written to output."); - return ts.singleOrUndefined(nodes); - } function aggregateTransformFlags(node) { aggregateTransformFlagsForNode(node); return node; @@ -38507,7 +42608,7 @@ var ts; return subtreeFlags; } function aggregateTransformFlagsForSubtree(node) { - if (ts.hasModifier(node, 2) || ts.isTypeNode(node)) { + if (ts.hasModifier(node, 2) || (ts.isTypeNode(node) && node.kind !== 200)) { return 0; } return reduceEachChild(node, 0, aggregateTransformFlagsForChildNode, aggregateTransformFlagsForChildNodes); @@ -38520,9 +42621,6 @@ var ts; } var Debug; (function (Debug) { - Debug.failNotOptional = Debug.shouldAssert(1) - ? function (message) { return Debug.assert(false, message || "Node not optional."); } - : ts.noop; Debug.failBadSyntaxKind = Debug.shouldAssert(1) ? function (node, message) { return Debug.assert(false, message || "Unexpected node.", function () { return "Node " + ts.formatSyntaxKind(node.kind) + " was unexpected."; }); } : ts.noop; @@ -38555,16 +42653,20 @@ var ts; } } })(Debug = ts.Debug || (ts.Debug = {})); - var _a; })(ts || (ts = {})); var ts; (function (ts) { + var FlattenLevel; + (function (FlattenLevel) { + FlattenLevel[FlattenLevel["All"] = 0] = "All"; + FlattenLevel[FlattenLevel["ObjectRest"] = 1] = "ObjectRest"; + })(FlattenLevel = ts.FlattenLevel || (ts.FlattenLevel = {})); function flattenDestructuringAssignment(node, visitor, context, level, needsValue, createAssignmentCallback) { var location = node; var value; if (ts.isDestructuringAssignment(node)) { value = node.right; - while (ts.isEmptyObjectLiteralOrArrayLiteral(node.left)) { + while (ts.isEmptyArrayLiteral(node.left) || ts.isEmptyObjectLiteral(node.left)) { if (ts.isDestructuringAssignment(value)) { location = node = value; value = node.right; @@ -38578,6 +42680,7 @@ var ts; var flattenContext = { context: context, level: level, + downlevelIteration: context.getCompilerOptions().downlevelIteration, hoistTempVariables: true, emitExpression: emitExpression, emitBindingOrAssignment: emitBindingOrAssignment, @@ -38612,7 +42715,7 @@ var ts; ts.Debug.assertNode(target, createAssignmentCallback ? ts.isIdentifier : ts.isExpression); var expression = createAssignmentCallback ? createAssignmentCallback(target, value, location) - : ts.createAssignment(ts.visitNode(target, visitor, ts.isExpression), value, location); + : ts.setTextRange(ts.createAssignment(ts.visitNode(target, visitor, ts.isExpression), value), location); expression.original = original; emitExpression(expression); } @@ -38625,6 +42728,7 @@ var ts; var flattenContext = { context: context, level: level, + downlevelIteration: context.getCompilerOptions().downlevelIteration, hoistTempVariables: hoistTempVariables, emitExpression: emitExpression, emitBindingOrAssignment: emitBindingOrAssignment, @@ -38650,10 +42754,11 @@ var ts; } } for (var _i = 0, pendingDeclarations_1 = pendingDeclarations; _i < pendingDeclarations_1.length; _i++) { - var _a = pendingDeclarations_1[_i], pendingExpressions_1 = _a.pendingExpressions, name_31 = _a.name, value = _a.value, location_2 = _a.location, original = _a.original; - var variable = ts.createVariableDeclaration(name_31, undefined, pendingExpressions_1 ? ts.inlineExpressions(ts.append(pendingExpressions_1, value)) : value, location_2); + var _a = pendingDeclarations_1[_i], pendingExpressions_1 = _a.pendingExpressions, name = _a.name, value = _a.value, location = _a.location, original = _a.original; + var variable = ts.createVariableDeclaration(name, undefined, pendingExpressions_1 ? ts.inlineExpressions(ts.append(pendingExpressions_1, value)) : value); variable.original = original; - if (ts.isIdentifier(name_31)) { + ts.setTextRange(variable, location); + if (ts.isIdentifier(name)) { ts.setEmitFlags(variable, 64); } ts.aggregateTransformFlags(variable); @@ -38741,7 +42846,12 @@ var ts; function flattenArrayBindingOrAssignmentPattern(flattenContext, parent, pattern, value, location) { var elements = ts.getElementsOfBindingOrAssignmentPattern(pattern); var numElements = elements.length; - if (numElements !== 1 && (flattenContext.level < 1 || numElements === 0)) { + if (flattenContext.level < 1 && flattenContext.downlevelIteration) { + value = ensureIdentifier(flattenContext, ts.createReadHelper(flattenContext.context, value, numElements > 0 && ts.getRestIndicatorOfBindingOrAssignmentElement(elements[numElements - 1]) + ? undefined + : numElements, location), false, location); + } + else if (numElements !== 1 && (flattenContext.level < 1 || numElements === 0)) { var reuseIdentifierExpressions = !ts.isDeclarationBindingElement(parent) || numElements !== 0; value = ensureIdentifier(flattenContext, value, reuseIdentifierExpressions, location); } @@ -38799,8 +42909,8 @@ var ts; return ts.createElementAccess(value, argumentExpression); } else { - var name_32 = ts.createIdentifier(ts.unescapeIdentifier(propertyName.text)); - return ts.createPropertyAccess(value, name_32); + var name = ts.createIdentifier(ts.unescapeIdentifier(propertyName.text)); + return ts.createPropertyAccess(value, name); } } function ensureIdentifier(flattenContext, value, reuseIdentifierExpressions, location) { @@ -38811,7 +42921,7 @@ var ts; var temp = ts.createTempVariable(undefined); if (flattenContext.hoistTempVariables) { flattenContext.context.hoistVariableDeclaration(temp); - flattenContext.emitExpression(ts.createAssignment(temp, value, location)); + flattenContext.emitExpression(ts.setTextRange(ts.createAssignment(temp, value), location)); } else { flattenContext.emitBindingOrAssignment(temp, value, location, undefined); @@ -38842,7 +42952,7 @@ var ts; var restHelper = { name: "typescript:rest", scoped: false, - text: "\n var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\n t[p[i]] = s[p[i]];\n return t;\n };" + text: "\n var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\n t[p[i]] = s[p[i]];\n return t;\n };" }; function createRestCall(context, value, elements, computedTempVariables, location) { context.requestEmitHelper(restHelper); @@ -38861,12 +42971,21 @@ var ts; } } } - return ts.createCall(ts.getHelperName("__rest"), undefined, [value, ts.createArrayLiteral(propertyNames, location)]); + return ts.createCall(ts.getHelperName("__rest"), undefined, [ + value, + ts.setTextRange(ts.createArrayLiteral(propertyNames), location) + ]); } })(ts || (ts = {})); var ts; (function (ts) { var USE_NEW_TYPE_METADATA_FORMAT = false; + var TypeScriptSubstitutionFlags; + (function (TypeScriptSubstitutionFlags) { + TypeScriptSubstitutionFlags[TypeScriptSubstitutionFlags["ClassAliases"] = 1] = "ClassAliases"; + TypeScriptSubstitutionFlags[TypeScriptSubstitutionFlags["NamespaceExports"] = 2] = "NamespaceExports"; + TypeScriptSubstitutionFlags[TypeScriptSubstitutionFlags["NonQualifiedEnumMembers"] = 8] = "NonQualifiedEnumMembers"; + })(TypeScriptSubstitutionFlags || (TypeScriptSubstitutionFlags = {})); function transformTypeScript(context) { var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration; var resolver = context.getEmitResolver(); @@ -38877,8 +42996,8 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(177); context.enableSubstitution(178); + context.enableSubstitution(179); var currentSourceFile; var currentNamespace; var currentNamespaceContainerName; @@ -38911,15 +43030,15 @@ var ts; } function onBeforeVisitNode(node) { switch (node.kind) { - case 261: - case 232: - case 231: - case 204: + case 264: + case 234: + case 233: + case 206: currentScope = node; currentScopeFirstDeclarationsOfName = undefined; break; - case 226: - case 225: + case 228: + case 227: if (ts.hasModifier(node, 2)) { break; } @@ -38944,13 +43063,13 @@ var ts; } function sourceElementVisitorWorker(node) { switch (node.kind) { - case 235: + case 237: return visitImportDeclaration(node); - case 234: + case 236: return visitImportEqualsDeclaration(node); - case 240: + case 242: return visitExportAssignment(node); - case 241: + case 243: return visitExportDeclaration(node); default: return visitorWorker(node); @@ -38960,11 +43079,11 @@ var ts; return saveStateAndInvoke(node, namespaceElementVisitorWorker); } function namespaceElementVisitorWorker(node) { - if (node.kind === 241 || - node.kind === 235 || - node.kind === 236 || - (node.kind === 234 && - node.moduleReference.kind === 245)) { + if (node.kind === 243 || + node.kind === 237 || + node.kind === 238 || + (node.kind === 236 && + node.moduleReference.kind === 247)) { return undefined; } else if (node.transformFlags & 1 || ts.hasModifier(node, 1)) { @@ -38980,15 +43099,15 @@ var ts; } function classElementVisitorWorker(node) { switch (node.kind) { - case 150: - return undefined; - case 147: - case 155: case 151: + return undefined; + case 148: + case 156: case 152: - case 149: + case 153: + case 150: return visitorWorker(node); - case 203: + case 205: return node; default: ts.Debug.failBadSyntaxKind(node); @@ -39019,23 +43138,22 @@ var ts; case 75: case 123: case 130: - case 162: case 163: - case 161: - case 156: - case 143: + case 164: + case 162: + case 157: + case 144: case 118: case 121: - case 134: + case 135: case 132: case 129: case 104: - case 135: - case 159: - case 158: + case 136: case 160: - case 157: - case 164: + case 159: + case 161: + case 158: case 165: case 166: case 167: @@ -39043,56 +43161,58 @@ var ts; case 169: case 170: case 171: - case 155: - case 145: - case 228: - case 147: - case 150: - return visitConstructor(node); - case 227: - return ts.createNotEmittedStatement(node); - case 226: - return visitClassDeclaration(node); - case 197: - return visitClassExpression(node); - case 255: - return visitHeritageClause(node); - case 199: - return visitExpressionWithTypeArguments(node); - case 149: - return visitMethodDeclaration(node); - case 151: - return visitGetAccessor(node); - case 152: - return visitSetAccessor(node); - case 225: - return visitFunctionDeclaration(node); - case 184: - return visitFunctionExpression(node); - case 185: - return visitArrowFunction(node); - case 144: - return visitParameter(node); - case 183: - return visitParenthesizedExpression(node); - case 182: - case 200: - return visitAssertionExpression(node); - case 179: - return visitCallExpression(node); - case 180: - return visitNewExpression(node); - case 201: - return visitNonNullExpression(node); - case 229: - return visitEnumDeclaration(node); - case 205: - return visitVariableStatement(node); - case 223: - return visitVariableDeclaration(node); + case 172: + case 156: + case 146: case 230: + case 148: + return undefined; + case 151: + return visitConstructor(node); + case 229: + return ts.createNotEmittedStatement(node); + case 228: + return visitClassDeclaration(node); + case 198: + return visitClassExpression(node); + case 258: + return visitHeritageClause(node); + case 200: + return visitExpressionWithTypeArguments(node); + case 150: + return visitMethodDeclaration(node); + case 152: + return visitGetAccessor(node); + case 153: + return visitSetAccessor(node); + case 227: + return visitFunctionDeclaration(node); + case 185: + return visitFunctionExpression(node); + case 186: + return visitArrowFunction(node); + case 145: + return visitParameter(node); + case 184: + return visitParenthesizedExpression(node); + case 183: + case 201: + return visitAssertionExpression(node); + case 180: + return visitCallExpression(node); + case 181: + return visitNewExpression(node); + case 202: + return visitNonNullExpression(node); + case 231: + return visitEnumDeclaration(node); + case 207: + return visitVariableStatement(node); + case 225: + return visitVariableDeclaration(node); + case 232: return visitModuleDeclaration(node); - case 234: + case 236: return visitImportEqualsDeclaration(node); default: ts.Debug.failBadSyntaxKind(node); @@ -39100,7 +43220,8 @@ var ts; } } function visitSourceFile(node) { - var alwaysStrict = compilerOptions.alwaysStrict && !(ts.isExternalModule(node) && moduleKind === ts.ModuleKind.ES2015); + var alwaysStrict = (compilerOptions.alwaysStrict === undefined ? compilerOptions.strict : compilerOptions.alwaysStrict) && + !(ts.isExternalModule(node) && moduleKind === ts.ModuleKind.ES2015); return ts.updateSourceFileNode(node, ts.visitLexicalEnvironment(node.statements, sourceElementVisitor, context, 0, alwaysStrict)); } function shouldEmitDecorateCallForClass(node) { @@ -39152,11 +43273,12 @@ var ts; return ts.singleOrMany(statements); } function createClassDeclarationHeadWithoutDecorators(node, name, hasExtendsClause, hasStaticProperties) { - var classDeclaration = ts.createClassDeclaration(undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), name, undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), transformClassMembers(node, hasExtendsClause), node); + var classDeclaration = ts.createClassDeclaration(undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), name, undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), transformClassMembers(node, hasExtendsClause)); var emitFlags = ts.getEmitFlags(node); if (hasStaticProperties) { emitFlags |= 32; } + ts.setTextRange(classDeclaration, node); ts.setOriginalNode(classDeclaration, node); ts.setEmitFlags(classDeclaration, emitFlags); return classDeclaration; @@ -39167,10 +43289,14 @@ var ts; var declName = ts.getLocalName(node, false, true); var heritageClauses = ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause); var members = transformClassMembers(node, hasExtendsClause); - var classExpression = ts.createClassExpression(undefined, name, undefined, heritageClauses, members, location); + var classExpression = ts.createClassExpression(undefined, name, undefined, heritageClauses, members); ts.setOriginalNode(classExpression, node); - var statement = ts.createLetStatement(declName, classAlias ? ts.createAssignment(classAlias, classExpression) : classExpression, location); + ts.setTextRange(classExpression, location); + var statement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration(declName, undefined, classAlias ? ts.createAssignment(classAlias, classExpression) : classExpression) + ], 1)); ts.setOriginalNode(statement, node); + ts.setTextRange(statement, location); ts.setCommentRange(statement, node); return statement; } @@ -39178,7 +43304,9 @@ var ts; var staticProperties = getInitializedProperties(node, true); var heritageClauses = ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause); var members = transformClassMembers(node, ts.some(heritageClauses, function (c) { return c.token === 84; })); - var classExpression = ts.setOriginalNode(ts.createClassExpression(undefined, node.name, undefined, heritageClauses, members, node), node); + var classExpression = ts.createClassExpression(undefined, node.name, undefined, heritageClauses, members); + ts.setOriginalNode(classExpression, node); + ts.setTextRange(classExpression, node); if (staticProperties.length > 0) { var expressions = []; var temp = ts.createTempVariable(hoistVariableDeclaration); @@ -39201,7 +43329,7 @@ var ts; members.push(constructor); } ts.addRange(members, ts.visitNodes(node.members, classElementVisitor, ts.isClassElement)); - return ts.createNodeArray(members, node.members); + return ts.setTextRange(ts.createNodeArray(members), node.members); } function transformConstructor(node, hasExtendsClause) { var hasInstancePropertyWithInitializer = ts.forEach(node.members, isInstanceInitializedProperty); @@ -39212,7 +43340,7 @@ var ts; } var parameters = transformConstructorParameters(constructor); var body = transformConstructorBody(node, constructor, hasExtendsClause); - return ts.startOnNewLine(ts.setOriginalNode(ts.createConstructor(undefined, undefined, parameters, body, constructor || node), constructor)); + return ts.startOnNewLine(ts.setOriginalNode(ts.setTextRange(ts.createConstructor(undefined, undefined, parameters, body), constructor || node), constructor)); } function transformConstructorParameters(constructor) { return ts.visitParameterList(constructor && constructor.parameters, visitor, context) @@ -39235,18 +43363,18 @@ var ts; if (constructor) { ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, indexOfFirstStatement)); } - ts.addRange(statements, endLexicalEnvironment()); - return ts.createBlock(ts.createNodeArray(statements, constructor ? constructor.body.statements : node.members), constructor ? constructor.body : undefined, true); + statements = ts.mergeLexicalEnvironment(statements, endLexicalEnvironment()); + return ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), constructor ? constructor.body.statements : node.members), true), constructor ? constructor.body : undefined); } function addPrologueDirectivesAndInitialSuperCall(ctor, result) { if (ctor.body) { var statements = ctor.body.statements; - var index = ts.addPrologueDirectives(result, statements, false, visitor); + var index = ts.addPrologue(result, statements, false, visitor); if (index === statements.length) { return index; } var statement = statements[index]; - if (statement.kind === 207 && ts.isSuperCall(statement.expression)) { + if (statement.kind === 209 && ts.isSuperCall(statement.expression)) { result.push(ts.visitNode(statement, visitor, ts.isStatement)); return index + 1; } @@ -39268,7 +43396,7 @@ var ts; ts.setEmitFlags(propertyName, 1536 | 48); var localName = ts.getMutableClone(name); ts.setEmitFlags(localName, 1536); - return ts.startOnNewLine(ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createThis(), propertyName, node.name), localName), ts.moveRangePos(node, -1))); + return ts.startOnNewLine(ts.setTextRange(ts.createStatement(ts.createAssignment(ts.setTextRange(ts.createPropertyAccess(ts.createThis(), propertyName), node.name), localName)), ts.moveRangePos(node, -1))); } function getInitializedProperties(node, isStatic) { return ts.filter(node.members, isStatic ? isStaticInitializedProperty : isInstanceInitializedProperty); @@ -39280,13 +43408,13 @@ var ts; return isInitializedProperty(member, false); } function isInitializedProperty(member, isStatic) { - return member.kind === 147 + return member.kind === 148 && isStatic === ts.hasModifier(member, 32) && member.initializer !== undefined; } function addInitializedPropertyStatements(statements, properties, receiver) { - for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) { - var property = properties_7[_i]; + for (var _i = 0, properties_9 = properties; _i < properties_9.length; _i++) { + var property = properties_9[_i]; var statement = ts.createStatement(transformInitializedProperty(property, receiver)); ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property)); ts.setCommentRange(statement, property); @@ -39295,8 +43423,8 @@ var ts; } function generateInitializedPropertyExpressions(properties, receiver) { var expressions = []; - for (var _i = 0, properties_8 = properties; _i < properties_8.length; _i++) { - var property = properties_8[_i]; + for (var _i = 0, properties_10 = properties; _i < properties_10.length; _i++) { + var property = properties_10[_i]; var expression = transformInitializedProperty(property, receiver); expression.startsOnNewLine = true; ts.setSourceMapRange(expression, ts.moveRangePastModifiers(property)); @@ -39353,12 +43481,12 @@ var ts; } function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 151: case 152: + case 153: return getAllDecoratorsOfAccessors(node, member); - case 149: + case 150: return getAllDecoratorsOfMethod(member); - case 147: + case 148: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -39369,10 +43497,11 @@ var ts; return undefined; } var _a = ts.getAllAccessorDeclarations(node.members, accessor), firstAccessor = _a.firstAccessor, secondAccessor = _a.secondAccessor, setAccessor = _a.setAccessor; - if (accessor !== firstAccessor) { + var firstAccessorWithDecorators = firstAccessor.decorators ? firstAccessor : secondAccessor && secondAccessor.decorators ? secondAccessor : undefined; + if (!firstAccessorWithDecorators || accessor !== firstAccessorWithDecorators) { return undefined; } - var decorators = firstAccessor.decorators || (secondAccessor && secondAccessor.decorators); + var decorators = firstAccessorWithDecorators.decorators; var parameters = getDecoratorsOfParameters(setAccessor); if (!decorators && !parameters) { return undefined; @@ -39397,14 +43526,14 @@ var ts; } return { decorators: decorators }; } - function transformAllDecoratorsOfDeclaration(node, allDecorators) { + function transformAllDecoratorsOfDeclaration(node, container, allDecorators) { if (!allDecorators) { return undefined; } var decoratorExpressions = []; ts.addRange(decoratorExpressions, ts.map(allDecorators.decorators, transformDecorator)); ts.addRange(decoratorExpressions, ts.flatMap(allDecorators.parameters, transformDecoratorsOfParameter)); - addTypeMetadata(node, decoratorExpressions); + addTypeMetadata(node, container, decoratorExpressions); return decoratorExpressions; } function addClassElementDecorationStatements(statements, node, isStatic) { @@ -39429,14 +43558,14 @@ var ts; } function generateClassElementDecorationExpression(node, member) { var allDecorators = getAllDecoratorsOfClassElement(node, member); - var decoratorExpressions = transformAllDecoratorsOfDeclaration(member, allDecorators); + var decoratorExpressions = transformAllDecoratorsOfDeclaration(member, node, allDecorators); if (!decoratorExpressions) { return undefined; } var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, true); var descriptor = languageVersion > 0 - ? member.kind === 147 + ? member.kind === 148 ? ts.createVoidZero() : ts.createNull() : undefined; @@ -39452,7 +43581,7 @@ var ts; } function generateConstructorDecorationExpression(node) { var allDecorators = getAllDecoratorsOfConstructor(node); - var decoratorExpressions = transformAllDecoratorsOfDeclaration(node, allDecorators); + var decoratorExpressions = transformAllDecoratorsOfDeclaration(node, node, allDecorators); if (!decoratorExpressions) { return undefined; } @@ -39480,90 +43609,83 @@ var ts; } return expressions; } - function addTypeMetadata(node, decoratorExpressions) { + function addTypeMetadata(node, container, decoratorExpressions) { if (USE_NEW_TYPE_METADATA_FORMAT) { - addNewTypeMetadata(node, decoratorExpressions); + addNewTypeMetadata(node, container, decoratorExpressions); } else { - addOldTypeMetadata(node, decoratorExpressions); + addOldTypeMetadata(node, container, decoratorExpressions); } } - function addOldTypeMetadata(node, decoratorExpressions) { + function addOldTypeMetadata(node, container, decoratorExpressions) { if (compilerOptions.emitDecoratorMetadata) { if (shouldAddTypeMetadata(node)) { decoratorExpressions.push(createMetadataHelper(context, "design:type", serializeTypeOfNode(node))); } if (shouldAddParamTypesMetadata(node)) { - decoratorExpressions.push(createMetadataHelper(context, "design:paramtypes", serializeParameterTypesOfNode(node))); + decoratorExpressions.push(createMetadataHelper(context, "design:paramtypes", serializeParameterTypesOfNode(node, container))); } if (shouldAddReturnTypeMetadata(node)) { decoratorExpressions.push(createMetadataHelper(context, "design:returntype", serializeReturnTypeOfNode(node))); } } } - function addNewTypeMetadata(node, decoratorExpressions) { + function addNewTypeMetadata(node, container, decoratorExpressions) { if (compilerOptions.emitDecoratorMetadata) { var properties = void 0; if (shouldAddTypeMetadata(node)) { (properties || (properties = [])).push(ts.createPropertyAssignment("type", ts.createArrowFunction(undefined, undefined, [], undefined, ts.createToken(35), serializeTypeOfNode(node)))); } if (shouldAddParamTypesMetadata(node)) { - (properties || (properties = [])).push(ts.createPropertyAssignment("paramTypes", ts.createArrowFunction(undefined, undefined, [], undefined, ts.createToken(35), serializeParameterTypesOfNode(node)))); + (properties || (properties = [])).push(ts.createPropertyAssignment("paramTypes", ts.createArrowFunction(undefined, undefined, [], undefined, ts.createToken(35), serializeParameterTypesOfNode(node, container)))); } if (shouldAddReturnTypeMetadata(node)) { (properties || (properties = [])).push(ts.createPropertyAssignment("returnType", ts.createArrowFunction(undefined, undefined, [], undefined, ts.createToken(35), serializeReturnTypeOfNode(node)))); } if (properties) { - decoratorExpressions.push(createMetadataHelper(context, "design:typeinfo", ts.createObjectLiteral(properties, undefined, true))); + decoratorExpressions.push(createMetadataHelper(context, "design:typeinfo", ts.createObjectLiteral(properties, true))); } } } function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 149 - || kind === 151 + return kind === 150 || kind === 152 - || kind === 147; + || kind === 153 + || kind === 148; } function shouldAddReturnTypeMetadata(node) { - return node.kind === 149; + return node.kind === 150; } function shouldAddParamTypesMetadata(node) { - var kind = node.kind; - return kind === 226 - || kind === 197 - || kind === 149 - || kind === 151 - || kind === 152; + switch (node.kind) { + case 228: + case 198: + return ts.getFirstConstructorWithBody(node) !== undefined; + case 150: + case 152: + case 153: + return true; + } + return false; } function serializeTypeOfNode(node) { switch (node.kind) { - case 147: - case 144: - case 151: - return serializeTypeNode(node.type); + case 148: + case 145: case 152: + return serializeTypeNode(node.type); + case 153: return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node)); - case 226: - case 197: - case 149: + case 228: + case 198: + case 150: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); } } - function getRestParameterElementType(node) { - if (node && node.kind === 162) { - return node.elementType; - } - else if (node && node.kind === 157) { - return ts.singleOrUndefined(node.typeArguments); - } - else { - return undefined; - } - } - function serializeParameterTypesOfNode(node) { + function serializeParameterTypesOfNode(node, container) { var valueDeclaration = ts.isClassLike(node) ? ts.getFirstConstructorWithBody(node) : ts.isFunctionLike(node) && ts.nodeIsPresent(node.body) @@ -39571,7 +43693,7 @@ var ts; : undefined; var expressions = []; if (valueDeclaration) { - var parameters = valueDeclaration.parameters; + var parameters = getParametersOfDecoratedDeclaration(valueDeclaration, container); var numParameters = parameters.length; for (var i = 0; i < numParameters; i++) { var parameter = parameters[i]; @@ -39579,7 +43701,7 @@ var ts; continue; } if (parameter.dotDotDotToken) { - expressions.push(serializeTypeNode(getRestParameterElementType(parameter.type))); + expressions.push(serializeTypeNode(ts.getRestParameterElementType(parameter.type))); } else { expressions.push(serializeTypeOfNode(parameter)); @@ -39588,11 +43710,20 @@ var ts; } return ts.createArrayLiteral(expressions); } + function getParametersOfDecoratedDeclaration(node, container) { + if (container && node.kind === 152) { + var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; + if (setAccessor) { + return setAccessor.parameters; + } + } + return node.parameters; + } function serializeReturnTypeOfNode(node) { if (ts.isFunctionLike(node) && node.type) { return serializeTypeNode(node.type); } - else if (ts.isAsyncFunctionLike(node)) { + else if (ts.isAsyncFunction(node)) { return ts.createIdentifier("Promise"); } return ts.createVoidZero(); @@ -39603,21 +43734,26 @@ var ts; } switch (node.kind) { case 104: + case 138: + case 94: + case 129: return ts.createVoidZero(); - case 166: + case 167: return serializeTypeNode(node.type); - case 158: case 159: + case 160: return ts.createIdentifier("Function"); - case 162: case 163: + case 164: return ts.createIdentifier("Array"); - case 156: + case 157: case 121: return ts.createIdentifier("Boolean"); - case 134: + case 135: return ts.createIdentifier("String"); - case 171: + case 133: + return ts.createIdentifier("Object"); + case 172: switch (node.literal.kind) { case 9: return ts.createIdentifier("String"); @@ -39633,44 +43769,22 @@ var ts; break; case 132: return ts.createIdentifier("Number"); - case 135: + case 136: return languageVersion < 2 ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 157: + case 158: return serializeTypeReferenceNode(node); + case 166: case 165: - case 164: - { - var unionOrIntersection = node; - var serializedUnion = void 0; - for (var _i = 0, _a = unionOrIntersection.types; _i < _a.length; _i++) { - var typeNode = _a[_i]; - var serializedIndividual = serializeTypeNode(typeNode); - if (serializedIndividual.kind !== 70) { - serializedUnion = undefined; - break; - } - if (serializedIndividual.text === "Object") { - return serializedIndividual; - } - if (serializedUnion && serializedUnion.text !== serializedIndividual.text) { - serializedUnion = undefined; - break; - } - serializedUnion = serializedIndividual; - } - if (serializedUnion) { - return serializedUnion; - } - } - case 160: - case 168: + return serializeUnionOrIntersectionType(node); + case 161: case 169: case 170: - case 161: + case 171: + case 162: case 118: - case 167: + case 168: break; default: ts.Debug.failBadSyntaxKind(node); @@ -39678,6 +43792,32 @@ var ts; } return ts.createIdentifier("Object"); } + function serializeUnionOrIntersectionType(node) { + var serializedUnion; + for (var _i = 0, _a = node.types; _i < _a.length; _i++) { + var typeNode = _a[_i]; + var serializedIndividual = serializeTypeNode(typeNode); + if (ts.isVoidExpression(serializedIndividual)) { + if (!serializedUnion) { + serializedUnion = serializedIndividual; + } + } + else if (ts.isIdentifier(serializedIndividual) && serializedIndividual.text === "Object") { + return serializedIndividual; + } + else if (serializedUnion && !ts.isVoidExpression(serializedUnion)) { + if (!ts.isIdentifier(serializedUnion) || + !ts.isIdentifier(serializedIndividual) || + serializedUnion.text !== serializedIndividual.text) { + return ts.createIdentifier("Object"); + } + } + else { + serializedUnion = serializedIndividual; + } + } + return serializedUnion; + } function serializeTypeReferenceNode(node) { switch (resolver.getTypeReferenceSerializationKind(node.typeName, currentScope)) { case ts.TypeReferenceSerializationKind.Unknown: @@ -39712,15 +43852,15 @@ var ts; function serializeEntityNameAsExpression(node, useFallback) { switch (node.kind) { case 70: - var name_33 = ts.getMutableClone(node); - name_33.flags &= ~8; - name_33.original = undefined; - name_33.parent = currentScope; + var name = ts.getMutableClone(node); + name.flags &= ~8; + name.original = undefined; + name.parent = currentScope; if (useFallback) { - return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name_33), ts.createLiteral("undefined")), name_33); + return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name), ts.createLiteral("undefined")), name); } - return name_33; - case 141: + return name; + case 142: return serializeQualifiedNameAsExpression(node, useFallback); } } @@ -39749,7 +43889,7 @@ var ts; : name.expression; } else if (ts.isIdentifier(name)) { - return ts.createLiteral(name.text); + return ts.createLiteral(ts.unescapeIdentifier(name.text)); } else { return ts.getSynthesizedClone(name); @@ -39764,7 +43904,7 @@ var ts; hoistVariableDeclaration(generatedName); expression = ts.createAssignment(generatedName, expression); } - return ts.setOriginalNode(ts.createComputedPropertyName(expression, name), name); + return ts.updateComputedPropertyName(name, expression); } else { return name; @@ -39773,13 +43913,12 @@ var ts; function visitHeritageClause(node) { if (node.token === 84) { var types = ts.visitNodes(node.types, visitor, ts.isExpressionWithTypeArguments, 0, 1); - return ts.createHeritageClause(84, types, node); + return ts.setTextRange(ts.createHeritageClause(84, types), node); } return undefined; } function visitExpressionWithTypeArguments(node) { - var expression = ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression); - return ts.createExpressionWithTypeArguments(undefined, expression, node); + return ts.updateExpressionWithTypeArguments(node, undefined, ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression)); } function shouldEmitFunctionLikeDeclaration(node) { return !ts.nodeIsMissing(node.body); @@ -39788,13 +43927,13 @@ var ts; if (!shouldEmitFunctionLikeDeclaration(node)) { return undefined; } - return ts.visitEachChild(node, visitor, context); + return ts.updateConstructor(node, ts.visitNodes(node.decorators, visitor, ts.isDecorator), ts.visitNodes(node.modifiers, visitor, ts.isModifier), ts.visitParameterList(node.parameters, visitor, context), ts.visitFunctionBody(node.body, visitor, context)); } function visitMethodDeclaration(node) { if (!shouldEmitFunctionLikeDeclaration(node)) { return undefined; } - var updated = ts.updateMethod(node, undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), visitPropertyNameOfClassElement(node), undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.visitFunctionBody(node.body, visitor, context)); + var updated = ts.updateMethod(node, undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, visitPropertyNameOfClassElement(node), undefined, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.visitFunctionBody(node.body, visitor, context)); if (updated !== node) { ts.setCommentRange(updated, node); ts.setSourceMapRange(updated, ts.moveRangePastDecorators(node)); @@ -39830,7 +43969,7 @@ var ts; if (!shouldEmitFunctionLikeDeclaration(node)) { return ts.createNotEmittedStatement(node); } - var updated = ts.updateFunctionDeclaration(node, undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.visitFunctionBody(node.body, visitor, context) || ts.createBlock([])); + var updated = ts.updateFunctionDeclaration(node, undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.visitFunctionBody(node.body, visitor, context) || ts.createBlock([])); if (isNamespaceExport(node)) { var statements = [updated]; addExportMemberAssignment(statements, node); @@ -39839,10 +43978,10 @@ var ts; return updated; } function visitFunctionExpression(node) { - if (ts.nodeIsMissing(node.body)) { + if (!shouldEmitFunctionLikeDeclaration(node)) { return ts.createOmittedExpression(); } - var updated = ts.updateFunctionExpression(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.visitFunctionBody(node.body, visitor, context)); + var updated = ts.updateFunctionExpression(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.visitFunctionBody(node.body, visitor, context) || ts.createBlock([])); return updated; } function visitArrowFunction(node) { @@ -39853,8 +43992,9 @@ var ts; if (ts.parameterIsThisKeyword(node)) { return undefined; } - var parameter = ts.createParameter(undefined, undefined, node.dotDotDotToken, ts.visitNode(node.name, visitor, ts.isBindingName), undefined, undefined, ts.visitNode(node.initializer, visitor, ts.isExpression), ts.moveRangePastModifiers(node)); + var parameter = ts.createParameter(undefined, undefined, node.dotDotDotToken, ts.visitNode(node.name, visitor, ts.isBindingName), undefined, undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)); ts.setOriginalNode(parameter, node); + ts.setTextRange(parameter, ts.moveRangePastModifiers(node)); ts.setCommentRange(parameter, node); ts.setSourceMapRange(parameter, ts.moveRangePastModifiers(node)); ts.setEmitFlags(parameter.name, 32); @@ -39866,7 +44006,7 @@ var ts; if (variables.length === 0) { return undefined; } - return ts.createStatement(ts.inlineExpressions(ts.map(variables, transformInitializedVariable)), node); + return ts.setTextRange(ts.createStatement(ts.inlineExpressions(ts.map(variables, transformInitializedVariable))), node); } else { return ts.visitEachChild(node, visitor, context); @@ -39878,7 +44018,7 @@ var ts; return ts.flattenDestructuringAssignment(node, visitor, context, 0, false, createNamespaceExportExpression); } else { - return ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(name), ts.visitNode(node.initializer, visitor, ts.isExpression), node); + return ts.setTextRange(ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(name), ts.visitNode(node.initializer, visitor, ts.isExpression)), node); } } function visitVariableDeclaration(node) { @@ -39932,8 +44072,9 @@ var ts; var localName = ts.getLocalName(node, false, true); moduleArg = ts.createAssignment(localName, moduleArg); } - var enumStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, parameterName)], undefined, transformEnumBody(node, containerName)), undefined, [moduleArg]), node); + var enumStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, parameterName)], undefined, transformEnumBody(node, containerName)), undefined, [moduleArg])); ts.setOriginalNode(enumStatement, node); + ts.setTextRange(enumStatement, node); ts.setEmitFlags(enumStatement, emitFlags); statements.push(enumStatement); statements.push(ts.createEndOfDeclarationMarker(node)); @@ -39947,11 +44088,11 @@ var ts; ts.addRange(statements, ts.map(node.members, transformEnumMember)); ts.addRange(statements, endLexicalEnvironment()); currentNamespaceContainerName = savedCurrentNamespaceLocalName; - return ts.createBlock(ts.createNodeArray(statements, node.members), undefined, true); + return ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), node.members), true); } function transformEnumMember(member) { var name = getExpressionForPropertyName(member, false); - return ts.createStatement(ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, name), transformEnumMemberDeclarationValue(member))), name, member), member); + return ts.setTextRange(ts.createStatement(ts.setTextRange(ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, name), transformEnumMemberDeclarationValue(member))), name), member)), member); } function transformEnumMemberDeclarationValue(member) { var value = resolver.getConstantValue(member); @@ -39983,16 +44124,16 @@ var ts; if (!currentScopeFirstDeclarationsOfName) { currentScopeFirstDeclarationsOfName = ts.createMap(); } - if (!(name in currentScopeFirstDeclarationsOfName)) { - currentScopeFirstDeclarationsOfName[name] = node; + if (!currentScopeFirstDeclarationsOfName.has(name)) { + currentScopeFirstDeclarationsOfName.set(name, node); } } } function isFirstEmittedDeclarationInScope(node) { if (currentScopeFirstDeclarationsOfName) { - var name_34 = node.symbol && node.symbol.name; - if (name_34) { - return currentScopeFirstDeclarationsOfName[name_34] === node; + var name = node.symbol && node.symbol.name; + if (name) { + return currentScopeFirstDeclarationsOfName.get(name) === node; } } return false; @@ -40004,7 +44145,7 @@ var ts; ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { - if (node.kind === 229) { + if (node.kind === 231) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -40045,8 +44186,9 @@ var ts; var localName = ts.getLocalName(node, false, true); moduleArg = ts.createAssignment(localName, moduleArg); } - var moduleStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, parameterName)], undefined, transformModuleBody(node, containerName)), undefined, [moduleArg]), node); + var moduleStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, parameterName)], undefined, transformModuleBody(node, containerName)), undefined, [moduleArg])); ts.setOriginalNode(moduleStatement, node); + ts.setTextRange(moduleStatement, node); ts.setEmitFlags(moduleStatement, emitFlags); statements.push(moduleStatement); statements.push(ts.createEndOfDeclarationMarker(node)); @@ -40064,8 +44206,8 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 231) { - ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); + if (body.kind === 233) { + saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; } @@ -40086,14 +44228,15 @@ var ts; currentNamespaceContainerName = savedCurrentNamespaceContainerName; currentNamespace = savedCurrentNamespace; currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName; - var block = ts.createBlock(ts.createNodeArray(statements, statementsLocation), blockLocation, true); - if (body.kind !== 231) { + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), true); + ts.setTextRange(block, blockLocation); + if (body.kind !== 233) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 230) { + if (moduleDeclaration.body.kind === 232) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -40102,18 +44245,18 @@ var ts; if (!node.importClause) { return node; } - var importClause = ts.visitNode(node.importClause, visitImportClause, ts.isImportClause, true); + var importClause = ts.visitNode(node.importClause, visitImportClause, ts.isImportClause); return importClause ? ts.updateImportDeclaration(node, undefined, undefined, importClause, node.moduleSpecifier) : undefined; } function visitImportClause(node) { var name = resolver.isReferencedAliasDeclaration(node) ? node.name : undefined; - var namedBindings = ts.visitNode(node.namedBindings, visitNamedImportBindings, ts.isNamedImportBindings, true); + var namedBindings = ts.visitNode(node.namedBindings, visitNamedImportBindings, ts.isNamedImportBindings); return (name || namedBindings) ? ts.updateImportClause(node, name, namedBindings) : undefined; } function visitNamedImportBindings(node) { - if (node.kind === 237) { + if (node.kind === 239) { return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } else { @@ -40136,7 +44279,7 @@ var ts; if (!resolver.isValueAliasDeclaration(node)) { return undefined; } - var exportClause = ts.visitNode(node.exportClause, visitNamedExports, ts.isNamedExports, true); + var exportClause = ts.visitNode(node.exportClause, visitNamedExports, ts.isNamedExports); return exportClause ? ts.updateExportDeclaration(node, undefined, undefined, exportClause, node.moduleSpecifier) : undefined; @@ -40165,9 +44308,9 @@ var ts; var moduleReference = ts.createExpressionFromEntityName(node.moduleReference); ts.setEmitFlags(moduleReference, 1536 | 2048); if (isNamedExternalModuleExport(node) || !isNamespaceExport(node)) { - return ts.setOriginalNode(ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ + return ts.setOriginalNode(ts.setTextRange(ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.setOriginalNode(ts.createVariableDeclaration(node.name, undefined, moduleReference), node) - ]), node), node); + ])), node), node); } else { return ts.setOriginalNode(createNamespaceExport(node.name, moduleReference, node), node); @@ -40188,7 +44331,7 @@ var ts; && ts.hasModifier(node, 512); } function expressionToStatement(expression) { - return ts.createStatement(expression, undefined); + return ts.createStatement(expression); } function addExportMemberAssignment(statements, node) { var expression = ts.createAssignment(ts.getExternalModuleOrNamespaceExportName(currentNamespaceContainerName, node, false, true), ts.getLocalName(node)); @@ -40198,10 +44341,10 @@ var ts; statements.push(statement); } function createNamespaceExport(exportName, exportValue, location) { - return ts.createStatement(ts.createAssignment(ts.getNamespaceMemberName(currentNamespaceContainerName, exportName, false, true), exportValue), location); + return ts.setTextRange(ts.createStatement(ts.createAssignment(ts.getNamespaceMemberName(currentNamespaceContainerName, exportName, false, true), exportValue)), location); } function createNamespaceExportExpression(exportName, exportValue, location) { - return ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(exportName), exportValue, location); + return ts.setTextRange(ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(exportName), exportValue), location); } function getNamespaceMemberNameWithSourceMapsAndWithoutComments(name) { return ts.getNamespaceMemberName(currentNamespaceContainerName, name, false, true); @@ -40217,7 +44360,7 @@ var ts; function getClassAliasIfNeeded(node) { if (resolver.getNodeCheckFlags(node) & 8388608) { enableSubstitutionForClassAliases(); - var classAlias = ts.createUniqueName(node.name && !ts.isGeneratedIdentifier(node.name) ? node.name.text : "default"); + var classAlias = ts.createUniqueName(node.name && !ts.isGeneratedIdentifier(node.name) ? ts.unescapeIdentifier(node.name.text) : "default"); classAliases[ts.getOriginalNodeId(node)] = classAlias; hoistVariableDeclaration(classAlias); return classAlias; @@ -40241,37 +44384,42 @@ var ts; if ((enabledSubstitutions & 1) === 0) { enabledSubstitutions |= 1; context.enableSubstitution(70); - classAliases = ts.createMap(); + classAliases = []; } } function enableSubstitutionForNamespaceExports() { if ((enabledSubstitutions & 2) === 0) { enabledSubstitutions |= 2; context.enableSubstitution(70); - context.enableSubstitution(258); - context.enableEmitNotification(230); + context.enableSubstitution(261); + context.enableEmitNotification(232); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 230; + return ts.getOriginalNode(node).kind === 232; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 229; + return ts.getOriginalNode(node).kind === 231; } - function onEmitNode(emitContext, node, emitCallback) { + function onEmitNode(hint, node, emitCallback) { var savedApplicableSubstitutions = applicableSubstitutions; + var savedCurrentSourceFile = currentSourceFile; + if (ts.isSourceFile(node)) { + currentSourceFile = node; + } if (enabledSubstitutions & 2 && isTransformedModuleDeclaration(node)) { applicableSubstitutions |= 2; } if (enabledSubstitutions & 8 && isTransformedEnumDeclaration(node)) { applicableSubstitutions |= 8; } - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); applicableSubstitutions = savedApplicableSubstitutions; + currentSourceFile = savedCurrentSourceFile; } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1) { + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1) { return substituteExpression(node); } else if (ts.isShorthandPropertyAssignment(node)) { @@ -40281,14 +44429,14 @@ var ts; } function substituteShorthandPropertyAssignment(node) { if (enabledSubstitutions & 2) { - var name_35 = node.name; - var exportedName = trySubstituteNamespaceExportedName(name_35); + var name = node.name; + var exportedName = trySubstituteNamespaceExportedName(name); if (exportedName) { if (node.objectAssignmentInitializer) { var initializer = ts.createAssignment(exportedName, node.objectAssignmentInitializer); - return ts.createPropertyAssignment(name_35, initializer, node); + return ts.setTextRange(ts.createPropertyAssignment(name, initializer), node); } - return ts.createPropertyAssignment(name_35, exportedName, node); + return ts.setTextRange(ts.createPropertyAssignment(name, exportedName), node); } } return node; @@ -40297,9 +44445,9 @@ var ts; switch (node.kind) { case 70: return substituteExpressionIdentifier(node); - case 177: - return substitutePropertyAccessExpression(node); case 178: + return substitutePropertyAccessExpression(node); + case 179: return substituteElementAccessExpression(node); } return node; @@ -40329,11 +44477,11 @@ var ts; function trySubstituteNamespaceExportedName(node) { if (enabledSubstitutions & applicableSubstitutions && !ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var container = resolver.getReferencedExportContainer(node, false); - if (container && container.kind !== 261) { - var substitute = (applicableSubstitutions & 2 && container.kind === 230) || - (applicableSubstitutions & 8 && container.kind === 229); + if (container && container.kind !== 264) { + var substitute = (applicableSubstitutions & 2 && container.kind === 232) || + (applicableSubstitutions & 8 && container.kind === 231); if (substitute) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node, node); + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), node); } } } @@ -40348,16 +44496,14 @@ var ts; function substituteConstantValue(node) { var constantValue = tryGetConstEnumValue(node); if (constantValue !== undefined) { + ts.setConstantValue(node, constantValue); var substitute = ts.createLiteral(constantValue); - ts.setSourceMapRange(substitute, node); - ts.setCommentRange(substitute, node); if (!compilerOptions.removeComments) { var propertyName = ts.isPropertyAccessExpression(node) ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); - substitute.trailingComment = " " + propertyName + " "; + ts.addSyntheticTrailingComment(substitute, 3, " " + propertyName + " "); } - ts.setConstantValue(node, constantValue); return substitute; } return node; @@ -40372,24 +44518,24 @@ var ts; } } ts.transformTypeScript = transformTypeScript; - var paramHelper = { - name: "typescript:param", - scoped: false, - priority: 4, - text: "\n var __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n };" - }; - function createParamHelper(context, expression, parameterOffset, location) { - context.requestEmitHelper(paramHelper); - return ts.createCall(ts.getHelperName("__param"), undefined, [ - ts.createLiteral(parameterOffset), - expression - ], location); + function createDecorateHelper(context, decoratorExpressions, target, memberName, descriptor, location) { + var argumentsArray = []; + argumentsArray.push(ts.createArrayLiteral(decoratorExpressions, true)); + argumentsArray.push(target); + if (memberName) { + argumentsArray.push(memberName); + if (descriptor) { + argumentsArray.push(descriptor); + } + } + context.requestEmitHelper(decorateHelper); + return ts.setTextRange(ts.createCall(ts.getHelperName("__decorate"), undefined, argumentsArray), location); } - var metadataHelper = { - name: "typescript:metadata", + var decorateHelper = { + name: "typescript:decorate", scoped: false, - priority: 3, - text: "\n var __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n };" + priority: 2, + text: "\n var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };" }; function createMetadataHelper(context, metadataKey, metadataValue) { context.requestEmitHelper(metadataHelper); @@ -40398,30 +44544,289 @@ var ts; metadataValue ]); } - var decorateHelper = { - name: "typescript:decorate", + var metadataHelper = { + name: "typescript:metadata", scoped: false, - priority: 2, - text: "\n var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };" + priority: 3, + text: "\n var __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n };" }; - function createDecorateHelper(context, decoratorExpressions, target, memberName, descriptor, location) { - context.requestEmitHelper(decorateHelper); - var argumentsArray = []; - argumentsArray.push(ts.createArrayLiteral(decoratorExpressions, undefined, true)); - argumentsArray.push(target); - if (memberName) { - argumentsArray.push(memberName); - if (descriptor) { - argumentsArray.push(descriptor); - } - } - return ts.createCall(ts.getHelperName("__decorate"), undefined, argumentsArray, location); + function createParamHelper(context, expression, parameterOffset, location) { + context.requestEmitHelper(paramHelper); + return ts.setTextRange(ts.createCall(ts.getHelperName("__param"), undefined, [ + ts.createLiteral(parameterOffset), + expression + ]), location); } + var paramHelper = { + name: "typescript:param", + scoped: false, + priority: 4, + text: "\n var __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n };" + }; })(ts || (ts = {})); var ts; (function (ts) { + var ES2017SubstitutionFlags; + (function (ES2017SubstitutionFlags) { + ES2017SubstitutionFlags[ES2017SubstitutionFlags["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper"; + })(ES2017SubstitutionFlags || (ES2017SubstitutionFlags = {})); + function transformES2017(context) { + var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; + var resolver = context.getEmitResolver(); + var compilerOptions = context.getCompilerOptions(); + var languageVersion = ts.getEmitScriptTarget(compilerOptions); + var currentSourceFile; + var enabledSubstitutions; + var enclosingSuperContainerFlags = 0; + var previousOnEmitNode = context.onEmitNode; + var previousOnSubstituteNode = context.onSubstituteNode; + context.onEmitNode = onEmitNode; + context.onSubstituteNode = onSubstituteNode; + return transformSourceFile; + function transformSourceFile(node) { + if (ts.isDeclarationFile(node)) { + return node; + } + currentSourceFile = node; + var visited = ts.visitEachChild(node, visitor, context); + ts.addEmitHelpers(visited, context.readEmitHelpers()); + currentSourceFile = undefined; + return visited; + } + function visitor(node) { + if ((node.transformFlags & 16) === 0) { + return node; + } + switch (node.kind) { + case 119: + return undefined; + case 190: + return visitAwaitExpression(node); + case 150: + return visitMethodDeclaration(node); + case 227: + return visitFunctionDeclaration(node); + case 185: + return visitFunctionExpression(node); + case 186: + return visitArrowFunction(node); + default: + return ts.visitEachChild(node, visitor, context); + } + } + function visitAwaitExpression(node) { + return ts.setOriginalNode(ts.setTextRange(ts.createYield(undefined, ts.visitNode(node.expression, visitor, ts.isExpression)), node), node); + } + function visitMethodDeclaration(node) { + return ts.updateMethod(node, undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, undefined, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.getFunctionFlags(node) & 2 + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + function visitFunctionDeclaration(node) { + return ts.updateFunctionDeclaration(node, undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.getFunctionFlags(node) & 2 + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + function visitFunctionExpression(node) { + return ts.updateFunctionExpression(node, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.getFunctionFlags(node) & 2 + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + function visitArrowFunction(node) { + return ts.updateArrowFunction(node, ts.visitNodes(node.modifiers, visitor, ts.isModifier), undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.getFunctionFlags(node) & 2 + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + function transformAsyncFunctionBody(node) { + resumeLexicalEnvironment(); + var original = ts.getOriginalNode(node, ts.isFunctionLike); + var nodeType = original.type; + var promiseConstructor = languageVersion < 2 ? getPromiseConstructor(nodeType) : undefined; + var isArrowFunction = node.kind === 186; + var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192) !== 0; + if (!isArrowFunction) { + var statements = []; + var statementOffset = ts.addPrologue(statements, node.body.statements, false, visitor); + statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body, statementOffset)))); + ts.addRange(statements, endLexicalEnvironment()); + var block = ts.createBlock(statements, true); + ts.setTextRange(block, node.body); + if (languageVersion >= 2) { + if (resolver.getNodeCheckFlags(node) & 4096) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.advancedAsyncSuperHelper); + } + else if (resolver.getNodeCheckFlags(node) & 2048) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.asyncSuperHelper); + } + } + return block; + } + else { + var expression = createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body)); + var declarations = endLexicalEnvironment(); + if (ts.some(declarations)) { + var block = ts.convertToFunctionBody(expression); + return ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(ts.concatenate(block.statements, declarations)), block.statements)); + } + return expression; + } + } + function transformFunctionBodyWorker(body, start) { + if (ts.isBlock(body)) { + return ts.updateBlock(body, ts.visitLexicalEnvironment(body.statements, visitor, context, start)); + } + else { + startLexicalEnvironment(); + var visited = ts.convertToFunctionBody(ts.visitNode(body, visitor, ts.isConciseBody)); + var declarations = endLexicalEnvironment(); + return ts.updateBlock(visited, ts.setTextRange(ts.createNodeArray(ts.concatenate(visited.statements, declarations)), visited.statements)); + } + } + function getPromiseConstructor(type) { + var typeName = type && ts.getEntityNameFromTypeNode(type); + if (typeName && ts.isEntityName(typeName)) { + var serializationKind = resolver.getTypeReferenceSerializationKind(typeName); + if (serializationKind === ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue + || serializationKind === ts.TypeReferenceSerializationKind.Unknown) { + return typeName; + } + } + return undefined; + } + function enableSubstitutionForAsyncMethodsWithSuper() { + if ((enabledSubstitutions & 1) === 0) { + enabledSubstitutions |= 1; + context.enableSubstitution(180); + context.enableSubstitution(178); + context.enableSubstitution(179); + context.enableEmitNotification(228); + context.enableEmitNotification(150); + context.enableEmitNotification(152); + context.enableEmitNotification(153); + context.enableEmitNotification(151); + } + } + function onEmitNode(hint, node, emitCallback) { + if (enabledSubstitutions & 1 && isSuperContainer(node)) { + var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 | 4096); + if (superContainerFlags !== enclosingSuperContainerFlags) { + var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; + enclosingSuperContainerFlags = superContainerFlags; + previousOnEmitNode(hint, node, emitCallback); + enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; + return; + } + } + previousOnEmitNode(hint, node, emitCallback); + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 && enclosingSuperContainerFlags) { + return substituteExpression(node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 178: + return substitutePropertyAccessExpression(node); + case 179: + return substituteElementAccessExpression(node); + case 180: + return substituteCallExpression(node); + } + return node; + } + function substitutePropertyAccessExpression(node) { + if (node.expression.kind === 96) { + return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), node); + } + return node; + } + function substituteElementAccessExpression(node) { + if (node.expression.kind === 96) { + return createSuperAccessInAsyncMethod(node.argumentExpression, node); + } + return node; + } + function substituteCallExpression(node) { + var expression = node.expression; + if (ts.isSuperProperty(expression)) { + var argumentExpression = ts.isPropertyAccessExpression(expression) + ? substitutePropertyAccessExpression(expression) + : substituteElementAccessExpression(expression); + return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), undefined, [ + ts.createThis() + ].concat(node.arguments)); + } + return node; + } + function isSuperContainer(node) { + var kind = node.kind; + return kind === 228 + || kind === 151 + || kind === 150 + || kind === 152 + || kind === 153; + } + function createSuperAccessInAsyncMethod(argumentExpression, location) { + if (enclosingSuperContainerFlags & 4096) { + return ts.setTextRange(ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression]), "value"), location); + } + else { + return ts.setTextRange(ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression]), location); + } + } + } + ts.transformES2017 = transformES2017; + var awaiterHelper = { + name: "typescript:awaiter", + scoped: false, + priority: 5, + text: "\n var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n };" + }; + function createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, body) { + context.requestEmitHelper(awaiterHelper); + var generatorFunc = ts.createFunctionExpression(undefined, ts.createToken(38), undefined, undefined, [], undefined, body); + (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 131072; + return ts.createCall(ts.getHelperName("__awaiter"), undefined, [ + ts.createThis(), + hasLexicalArguments ? ts.createIdentifier("arguments") : ts.createVoidZero(), + promiseConstructor ? ts.createExpressionFromEntityName(promiseConstructor) : ts.createVoidZero(), + generatorFunc + ]); + } + ts.asyncSuperHelper = { + name: "typescript:async-super", + scoped: true, + text: "\n const _super = name => super[name];\n " + }; + ts.advancedAsyncSuperHelper = { + name: "typescript:advanced-async-super", + scoped: true, + text: "\n const _super = (function (geti, seti) {\n const cache = Object.create(null);\n return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n })(name => super[name], (name, value) => super[name] = value);\n " + }; +})(ts || (ts = {})); +var ts; +(function (ts) { + var ESNextSubstitutionFlags; + (function (ESNextSubstitutionFlags) { + ESNextSubstitutionFlags[ESNextSubstitutionFlags["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper"; + })(ESNextSubstitutionFlags || (ESNextSubstitutionFlags = {})); function transformESNext(context) { - var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; + var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration; + var resolver = context.getEmitResolver(); + var compilerOptions = context.getCompilerOptions(); + var languageVersion = ts.getEmitScriptTarget(compilerOptions); + var previousOnEmitNode = context.onEmitNode; + context.onEmitNode = onEmitNode; + var previousOnSubstituteNode = context.onSubstituteNode; + context.onSubstituteNode = onSubstituteNode; + var enabledSubstitutions; + var enclosingFunctionFlags; + var enclosingSuperContainerFlags = 0; return transformSourceFile; function transformSourceFile(node) { if (ts.isDeclarationFile(node)) { @@ -40437,53 +44842,93 @@ var ts; function visitorNoDestructuringValue(node) { return visitorWorker(node, true); } + function visitorNoAsyncModifier(node) { + if (node.kind === 119) { + return undefined; + } + return node; + } function visitorWorker(node, noDestructuringValue) { if ((node.transformFlags & 8) === 0) { return node; } switch (node.kind) { - case 176: + case 190: + return visitAwaitExpression(node); + case 196: + return visitYieldExpression(node); + case 221: + return visitLabeledStatement(node); + case 177: return visitObjectLiteralExpression(node); - case 192: + case 193: return visitBinaryExpression(node, noDestructuringValue); - case 223: - return visitVariableDeclaration(node); - case 213: - return visitForOfStatement(node); - case 211: - return visitForStatement(node); - case 188: - return visitVoidExpression(node); - case 150: - return visitConstructorDeclaration(node); - case 149: - return visitMethodDeclaration(node); - case 151: - return visitGetAccessorDeclaration(node); - case 152: - return visitSetAccessorDeclaration(node); case 225: + return visitVariableDeclaration(node); + case 215: + return visitForOfStatement(node, undefined); + case 213: + return visitForStatement(node); + case 189: + return visitVoidExpression(node); + case 151: + return visitConstructorDeclaration(node); + case 150: + return visitMethodDeclaration(node); + case 152: + return visitGetAccessorDeclaration(node); + case 153: + return visitSetAccessorDeclaration(node); + case 227: return visitFunctionDeclaration(node); - case 184: - return visitFunctionExpression(node); case 185: + return visitFunctionExpression(node); + case 186: return visitArrowFunction(node); - case 144: + case 145: return visitParameter(node); - case 207: + case 209: return visitExpressionStatement(node); - case 183: + case 184: return visitParenthesizedExpression(node, noDestructuringValue); default: return ts.visitEachChild(node, visitor, context); } } + function visitAwaitExpression(node) { + if (enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + return ts.setOriginalNode(ts.setTextRange(ts.createYield(undefined, ts.createArrayLiteral([ts.createLiteral("await"), expression])), node), node); + } + return ts.visitEachChild(node, visitor, context); + } + function visitYieldExpression(node) { + if (enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + return ts.updateYield(node, node.asteriskToken, node.asteriskToken + ? createAsyncDelegatorHelper(context, expression, expression) + : ts.createArrayLiteral(expression + ? [ts.createLiteral("yield"), expression] + : [ts.createLiteral("yield")])); + } + return ts.visitEachChild(node, visitor, context); + } + function visitLabeledStatement(node) { + if (enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1) { + var statement = ts.unwrapInnermostStatementOfLabel(node); + if (statement.kind === 215 && statement.awaitModifier) { + return visitForOfStatement(statement, node); + } + return ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), node); + } + return ts.visitEachChild(node, visitor, context); + } function chunkObjectLiteralElements(elements) { var chunkObject; var objects = []; - for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) { - var e = elements_3[_i]; - if (e.kind === 259) { + for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { + var e = elements_4[_i]; + if (e.kind === 262) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -40495,7 +44940,7 @@ var ts; if (!chunkObject) { chunkObject = []; } - if (e.kind === 257) { + if (e.kind === 260) { var p = e; chunkObject.push(ts.createPropertyAssignment(p.name, ts.visitNode(p.initializer, visitor, ts.isExpression))); } @@ -40512,7 +44957,7 @@ var ts; function visitObjectLiteralExpression(node) { if (node.transformFlags & 1048576) { var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 176) { + if (objects.length && objects[0].kind !== 177) { objects.unshift(ts.createObjectLiteral()); } return createAssignHelper(context, objects); @@ -40546,68 +44991,202 @@ var ts; function visitVoidExpression(node) { return ts.visitEachChild(node, visitorNoDestructuringValue, context); } - function visitForOfStatement(node) { - var leadingStatements; - var temp; - var initializer = ts.skipParentheses(node.initializer); - if (initializer.transformFlags & 1048576) { - if (ts.isVariableDeclarationList(initializer)) { - temp = ts.createTempVariable(undefined); - var firstDeclaration = ts.firstOrUndefined(initializer.declarations); - var declarations = ts.flattenDestructuringBinding(firstDeclaration, visitor, context, 1, temp, false, true); - if (ts.some(declarations)) { - var statement = ts.createVariableStatement(undefined, ts.updateVariableDeclarationList(initializer, declarations), initializer); - leadingStatements = ts.append(leadingStatements, statement); - } - } - else if (ts.isAssignmentPattern(initializer)) { - temp = ts.createTempVariable(undefined); - var expression = ts.flattenDestructuringAssignment(ts.aggregateTransformFlags(ts.createAssignment(initializer, temp, node.initializer)), visitor, context, 1); - leadingStatements = ts.append(leadingStatements, ts.createStatement(expression, node.initializer)); - } + function visitForOfStatement(node, outermostLabeledStatement) { + if (node.initializer.transformFlags & 1048576) { + node = transformForOfStatementWithObjectRest(node); } - if (temp) { - var expression = ts.visitNode(node.expression, visitor, ts.isExpression); - var statement = ts.visitNode(node.statement, visitor, ts.isStatement); - var block = ts.isBlock(statement) - ? ts.updateBlock(statement, ts.createNodeArray(ts.concatenate(leadingStatements, statement.statements), statement.statements)) - : ts.createBlock(ts.append(leadingStatements, statement), statement, true); - return ts.updateForOf(node, ts.createVariableDeclarationList([ - ts.createVariableDeclaration(temp, undefined, undefined, node.initializer) - ], node.initializer, 1), expression, block); + if (node.awaitModifier) { + return transformForAwaitOfStatement(node, outermostLabeledStatement); } - return ts.visitEachChild(node, visitor, context); + else { + return ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), outermostLabeledStatement); + } + } + function transformForOfStatementWithObjectRest(node) { + var initializerWithoutParens = ts.skipParentheses(node.initializer); + if (ts.isVariableDeclarationList(initializerWithoutParens) || ts.isAssignmentPattern(initializerWithoutParens)) { + var bodyLocation = void 0; + var statementsLocation = void 0; + var temp = ts.createTempVariable(undefined); + var statements = [ts.createForOfBindingStatement(initializerWithoutParens, temp)]; + if (ts.isBlock(node.statement)) { + ts.addRange(statements, node.statement.statements); + bodyLocation = node.statement; + statementsLocation = node.statement.statements; + } + return ts.updateForOf(node, node.awaitModifier, ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(temp), node.initializer) + ], 1), node.initializer), node.expression, ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), true), bodyLocation)); + } + return node; + } + function convertForOfStatementHead(node, boundValue) { + var binding = ts.createForOfBindingStatement(node.initializer, boundValue); + var bodyLocation; + var statementsLocation; + var statements = [ts.visitNode(binding, visitor, ts.isStatement)]; + var statement = ts.visitNode(node.statement, visitor, ts.isStatement); + if (ts.isBlock(statement)) { + ts.addRange(statements, statement.statements); + bodyLocation = statement; + statementsLocation = statement.statements; + } + else { + statements.push(statement); + } + return ts.setEmitFlags(ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), true), bodyLocation), 48 | 384); + } + function transformForAwaitOfStatement(node, outermostLabeledStatement) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + var iterator = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(expression) : ts.createTempVariable(undefined); + var result = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(iterator) : ts.createTempVariable(undefined); + var errorRecord = ts.createUniqueName("e"); + var catchVariable = ts.getGeneratedNameForNode(errorRecord); + var returnMethod = ts.createTempVariable(undefined); + var values = createAsyncValuesHelper(context, expression, node.expression); + var next = ts.createYield(undefined, enclosingFunctionFlags & 1 + ? ts.createArrayLiteral([ + ts.createLiteral("await"), + ts.createCall(ts.createPropertyAccess(iterator, "next"), undefined, []) + ]) + : ts.createCall(ts.createPropertyAccess(iterator, "next"), undefined, [])); + hoistVariableDeclaration(errorRecord); + hoistVariableDeclaration(returnMethod); + var forStatement = ts.setEmitFlags(ts.setTextRange(ts.createFor(ts.setEmitFlags(ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(iterator, undefined, values), node.expression), + ts.createVariableDeclaration(result, undefined, next) + ]), node.expression), 1048576), ts.createLogicalNot(ts.createPropertyAccess(result, "done")), ts.createAssignment(result, next), convertForOfStatementHead(node, ts.createPropertyAccess(result, "value"))), node), 256); + return ts.createTry(ts.createBlock([ + ts.restoreEnclosingLabel(forStatement, outermostLabeledStatement) + ]), ts.createCatchClause(ts.createVariableDeclaration(catchVariable), ts.setEmitFlags(ts.createBlock([ + ts.createStatement(ts.createAssignment(errorRecord, ts.createObjectLiteral([ + ts.createPropertyAssignment("error", catchVariable) + ]))) + ]), 1)), ts.createBlock([ + ts.createTry(ts.createBlock([ + ts.setEmitFlags(ts.createIf(ts.createLogicalAnd(ts.createLogicalAnd(result, ts.createLogicalNot(ts.createPropertyAccess(result, "done"))), ts.createAssignment(returnMethod, ts.createPropertyAccess(iterator, "return"))), ts.createStatement(ts.createYield(undefined, enclosingFunctionFlags & 1 + ? ts.createArrayLiteral([ + ts.createLiteral("await"), + ts.createFunctionCall(returnMethod, iterator, []) + ]) + : ts.createFunctionCall(returnMethod, iterator, [])))), 1) + ]), undefined, ts.setEmitFlags(ts.createBlock([ + ts.setEmitFlags(ts.createIf(errorRecord, ts.createThrow(ts.createPropertyAccess(errorRecord, "error"))), 1) + ]), 1)) + ])); } function visitParameter(node) { if (node.transformFlags & 1048576) { - return ts.updateParameter(node, undefined, undefined, node.dotDotDotToken, ts.getGeneratedNameForNode(node), undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)); + return ts.updateParameter(node, undefined, undefined, node.dotDotDotToken, ts.getGeneratedNameForNode(node), undefined, undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)); } return ts.visitEachChild(node, visitor, context); } function visitConstructorDeclaration(node) { - return ts.updateConstructor(node, undefined, node.modifiers, ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node)); + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = 0; + var updated = ts.updateConstructor(node, undefined, node.modifiers, ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitGetAccessorDeclaration(node) { - return ts.updateGetAccessor(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = 0; + var updated = ts.updateGetAccessor(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitSetAccessorDeclaration(node) { - return ts.updateSetAccessor(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node)); + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = 0; + var updated = ts.updateSetAccessor(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitMethodDeclaration(node) { - return ts.updateMethod(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateMethod(node, undefined, enclosingFunctionFlags & 1 + ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier) + : node.modifiers, enclosingFunctionFlags & 2 + ? undefined + : node.asteriskToken, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNode(undefined, visitor, ts.isToken), undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1 + ? transformAsyncGeneratorFunctionBody(node) + : transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitFunctionDeclaration(node) { - return ts.updateFunctionDeclaration(node, undefined, node.modifiers, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateFunctionDeclaration(node, undefined, enclosingFunctionFlags & 1 + ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier) + : node.modifiers, enclosingFunctionFlags & 2 + ? undefined + : node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1 + ? transformAsyncGeneratorFunctionBody(node) + : transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitArrowFunction(node) { - return ts.updateArrowFunction(node, node.modifiers, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateArrowFunction(node, node.modifiers, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitFunctionExpression(node) { - return ts.updateFunctionExpression(node, node.modifiers, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateFunctionExpression(node, enclosingFunctionFlags & 1 + ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier) + : node.modifiers, enclosingFunctionFlags & 2 + ? undefined + : node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1 + ? transformAsyncGeneratorFunctionBody(node) + : transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; + } + function transformAsyncGeneratorFunctionBody(node) { + resumeLexicalEnvironment(); + var statements = []; + var statementOffset = ts.addPrologue(statements, node.body.statements, false, visitor); + appendObjectRestAssignmentsIfNeeded(statements, node); + statements.push(ts.createReturn(createAsyncGeneratorHelper(context, ts.createFunctionExpression(undefined, ts.createToken(38), node.name && ts.getGeneratedNameForNode(node.name), undefined, [], undefined, ts.updateBlock(node.body, ts.visitLexicalEnvironment(node.body.statements, visitor, context, statementOffset)))))); + ts.addRange(statements, endLexicalEnvironment()); + var block = ts.updateBlock(node.body, statements); + if (languageVersion >= 2) { + if (resolver.getNodeCheckFlags(node) & 4096) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.advancedAsyncSuperHelper); + } + else if (resolver.getNodeCheckFlags(node) & 2048) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.asyncSuperHelper); + } + } + return block; } function transformFunctionBody(node) { resumeLexicalEnvironment(); - var leadingStatements; + var statementOffset = 0; + var statements = []; + var body = ts.visitNode(node.body, visitor, ts.isConciseBody); + if (ts.isBlock(body)) { + statementOffset = ts.addPrologue(statements, body.statements, false, visitor); + } + ts.addRange(statements, appendObjectRestAssignmentsIfNeeded(undefined, node)); + var trailingStatements = endLexicalEnvironment(); + if (statementOffset > 0 || ts.some(statements) || ts.some(trailingStatements)) { + var block = ts.convertToFunctionBody(body, true); + ts.addRange(statements, block.statements.slice(statementOffset)); + ts.addRange(statements, trailingStatements); + return ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(statements), block.statements)); + } + return body; + } + function appendObjectRestAssignmentsIfNeeded(statements, node) { for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { var parameter = _a[_i]; if (parameter.transformFlags & 1048576) { @@ -40616,17 +45195,95 @@ var ts; if (ts.some(declarations)) { var statement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList(declarations)); ts.setEmitFlags(statement, 524288); - leadingStatements = ts.append(leadingStatements, statement); + statements = ts.append(statements, statement); } } } - var body = ts.visitNode(node.body, visitor, ts.isConciseBody); - var trailingStatements = endLexicalEnvironment(); - if (ts.some(leadingStatements) || ts.some(trailingStatements)) { - var block = ts.convertToFunctionBody(body, true); - return ts.updateBlock(block, ts.createNodeArray(ts.concatenate(ts.concatenate(leadingStatements, block.statements), trailingStatements), block.statements)); + return statements; + } + function enableSubstitutionForAsyncMethodsWithSuper() { + if ((enabledSubstitutions & 1) === 0) { + enabledSubstitutions |= 1; + context.enableSubstitution(180); + context.enableSubstitution(178); + context.enableSubstitution(179); + context.enableEmitNotification(228); + context.enableEmitNotification(150); + context.enableEmitNotification(152); + context.enableEmitNotification(153); + context.enableEmitNotification(151); + } + } + function onEmitNode(hint, node, emitCallback) { + if (enabledSubstitutions & 1 && isSuperContainer(node)) { + var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 | 4096); + if (superContainerFlags !== enclosingSuperContainerFlags) { + var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; + enclosingSuperContainerFlags = superContainerFlags; + previousOnEmitNode(hint, node, emitCallback); + enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; + return; + } + } + previousOnEmitNode(hint, node, emitCallback); + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 && enclosingSuperContainerFlags) { + return substituteExpression(node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 178: + return substitutePropertyAccessExpression(node); + case 179: + return substituteElementAccessExpression(node); + case 180: + return substituteCallExpression(node); + } + return node; + } + function substitutePropertyAccessExpression(node) { + if (node.expression.kind === 96) { + return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), node); + } + return node; + } + function substituteElementAccessExpression(node) { + if (node.expression.kind === 96) { + return createSuperAccessInAsyncMethod(node.argumentExpression, node); + } + return node; + } + function substituteCallExpression(node) { + var expression = node.expression; + if (ts.isSuperProperty(expression)) { + var argumentExpression = ts.isPropertyAccessExpression(expression) + ? substitutePropertyAccessExpression(expression) + : substituteElementAccessExpression(expression); + return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), undefined, [ + ts.createThis() + ].concat(node.arguments)); + } + return node; + } + function isSuperContainer(node) { + var kind = node.kind; + return kind === 228 + || kind === 151 + || kind === 150 + || kind === 152 + || kind === 153; + } + function createSuperAccessInAsyncMethod(argumentExpression, location) { + if (enclosingSuperContainerFlags & 4096) { + return ts.setTextRange(ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression]), "value"), location); + } + else { + return ts.setTextRange(ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression]), location); } - return body; } } ts.transformESNext = transformESNext; @@ -40637,25 +45294,57 @@ var ts; text: "\n var __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };" }; function createAssignHelper(context, attributesSegments) { + if (context.getCompilerOptions().target >= 2) { + return ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "assign"), undefined, attributesSegments); + } context.requestEmitHelper(assignHelper); return ts.createCall(ts.getHelperName("__assign"), undefined, attributesSegments); } ts.createAssignHelper = createAssignHelper; + var asyncGeneratorHelper = { + name: "typescript:asyncGenerator", + scoped: false, + text: "\n var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), q = [], c, i;\n return i = { next: verb(\"next\"), \"throw\": verb(\"throw\"), \"return\": verb(\"return\") }, i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }\n function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }\n function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === \"yield\" ? _yield : r.value[0] === \"delegate\" ? delegate : fulfill, reject); }\n function _yield(value) { settle(c[2], { value: value, done: false }); }\n function delegate(r) { step(r.done ? r : { value: [\"yield\", r.value], done: false }); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { c = void 0, f(v), next(); }\n };\n " + }; + function createAsyncGeneratorHelper(context, generatorFunc) { + context.requestEmitHelper(asyncGeneratorHelper); + (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 131072; + return ts.createCall(ts.getHelperName("__asyncGenerator"), undefined, [ + ts.createThis(), + ts.createIdentifier("arguments"), + generatorFunc + ]); + } + var asyncDelegator = { + name: "typescript:asyncDelegator", + scoped: false, + text: "\n var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {\n var i = { next: verb(\"next\"), \"throw\": verb(\"throw\", function (e) { throw e; }), \"return\": verb(\"return\", function (v) { return { value: v, done: true }; }) };\n return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { return function (v) { return { value: [\"delegate\", (o[n] || f).call(o, v)], done: false }; }; }\n };\n " + }; + function createAsyncDelegatorHelper(context, expression, location) { + context.requestEmitHelper(asyncDelegator); + return ts.setTextRange(ts.createCall(ts.getHelperName("__asyncDelegator"), undefined, [expression]), location); + } + var asyncValues = { + name: "typescript:asyncValues", + scoped: false, + text: "\n var __asyncValues = (this && this.__asyncIterator) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator];\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\n };\n " + }; + function createAsyncValuesHelper(context, expression, location) { + context.requestEmitHelper(asyncValues); + return ts.setTextRange(ts.createCall(ts.getHelperName("__asyncValues"), undefined, [expression]), location); + } })(ts || (ts = {})); var ts; (function (ts) { function transformJsx(context) { var compilerOptions = context.getCompilerOptions(); - var currentSourceFile; return transformSourceFile; function transformSourceFile(node) { if (ts.isDeclarationFile(node)) { return node; } - currentSourceFile = node; var visited = ts.visitEachChild(node, visitor, context); ts.addEmitHelpers(visited, context.readEmitHelpers()); - currentSourceFile = undefined; return visited; } function visitor(node) { @@ -40668,11 +45357,11 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 246: + case 248: return visitJsxElement(node, false); - case 247: + case 249: return visitJsxSelfClosingElement(node, false); - case 252: + case 255: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -40682,11 +45371,11 @@ var ts; switch (node.kind) { case 10: return visitJsxText(node); - case 252: + case 255: return visitJsxExpression(node); - case 246: + case 248: return visitJsxElement(node, true); - case 247: + case 249: return visitJsxSelfClosingElement(node, true); default: ts.Debug.failBadSyntaxKind(node); @@ -40702,7 +45391,7 @@ var ts; function visitJsxOpeningLikeElement(node, children, isChild, location) { var tagName = getTagName(node); var objectProperties; - var attrs = node.attributes; + var attrs = node.attributes.properties; if (attrs.length === 0) { objectProperties = ts.createNull(); } @@ -40734,13 +45423,16 @@ var ts; } function transformJsxAttributeInitializer(node) { if (node === undefined) { - return ts.createLiteral(true); + return ts.createTrue(); } else if (node.kind === 9) { var decoded = tryDecodeEntities(node.text); - return decoded ? ts.createLiteral(decoded, node) : node; + return decoded ? ts.setTextRange(ts.createLiteral(decoded), node) : node; } - else if (node.kind === 252) { + else if (node.kind === 255) { + if (node.expression === undefined) { + return ts.createTrue(); + } return visitJsxExpression(node); } else { @@ -40748,43 +45440,35 @@ var ts; } } function visitJsxText(node) { - var text = ts.getTextOfNode(node, true); - var parts; + var fixed = fixupWhitespaceAndDecodeEntities(ts.getTextOfNode(node, true)); + return fixed === undefined ? undefined : ts.createLiteral(fixed); + } + function fixupWhitespaceAndDecodeEntities(text) { + var acc; var firstNonWhitespace = 0; var lastNonWhitespace = -1; for (var i = 0; i < text.length; i++) { var c = text.charCodeAt(i); if (ts.isLineBreak(c)) { - if (firstNonWhitespace !== -1 && (lastNonWhitespace - firstNonWhitespace + 1 > 0)) { - var part = text.substr(firstNonWhitespace, lastNonWhitespace - firstNonWhitespace + 1); - if (!parts) { - parts = []; - } - parts.push(ts.createLiteral(decodeEntities(part))); + if (firstNonWhitespace !== -1 && lastNonWhitespace !== -1) { + acc = addLineOfJsxText(acc, text.substr(firstNonWhitespace, lastNonWhitespace - firstNonWhitespace + 1)); } firstNonWhitespace = -1; } - else if (!ts.isWhiteSpace(c)) { + else if (!ts.isWhiteSpaceSingleLine(c)) { lastNonWhitespace = i; if (firstNonWhitespace === -1) { firstNonWhitespace = i; } } } - if (firstNonWhitespace !== -1) { - var part = text.substr(firstNonWhitespace); - if (!parts) { - parts = []; - } - parts.push(ts.createLiteral(decodeEntities(part))); - } - if (parts) { - return ts.reduceLeft(parts, aggregateJsxTextParts); - } - return undefined; + return firstNonWhitespace !== -1 + ? addLineOfJsxText(acc, text.substr(firstNonWhitespace)) + : acc; } - function aggregateJsxTextParts(left, right) { - return ts.createAdd(ts.createAdd(left, ts.createLiteral(" ")), right); + function addLineOfJsxText(acc, trimmedLine) { + var decoded = decodeEntities(trimmedLine); + return acc === undefined ? decoded : acc + " " + decoded; } function decodeEntities(text) { return text.replace(/&((#((\d+)|x([\da-fA-F]+)))|(\w+));/g, function (match, _all, _number, _digits, decimal, hex, word) { @@ -40795,7 +45479,7 @@ var ts; return String.fromCharCode(parseInt(hex, 16)); } else { - var ch = entities[word]; + var ch = entities.get(word); return ch ? String.fromCharCode(ch) : match; } }); @@ -40805,16 +45489,16 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 246) { + if (node.kind === 248) { return getTagName(node.openingElement); } else { - var name_36 = node.tagName; - if (ts.isIdentifier(name_36) && ts.isIntrinsicJsxName(name_36.text)) { - return ts.createLiteral(name_36.text); + var name = node.tagName; + if (ts.isIdentifier(name) && ts.isIntrinsicJsxName(name.text)) { + return ts.createLiteral(name.text); } else { - return ts.createExpressionFromEntityName(name_36); + return ts.createExpressionFromEntityName(name); } } } @@ -40832,7 +45516,7 @@ var ts; } } ts.transformJsx = transformJsx; - var entities = ts.createMap({ + var entities = ts.createMapFromTemplate({ "quot": 0x0022, "amp": 0x0026, "apos": 0x0027, @@ -41089,263 +45773,6 @@ var ts; }); })(ts || (ts = {})); var ts; -(function (ts) { - function transformES2017(context) { - var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; - var resolver = context.getEmitResolver(); - var compilerOptions = context.getCompilerOptions(); - var languageVersion = ts.getEmitScriptTarget(compilerOptions); - var currentSourceFile; - var enabledSubstitutions; - var currentSuperContainer; - var previousOnEmitNode = context.onEmitNode; - var previousOnSubstituteNode = context.onSubstituteNode; - context.onEmitNode = onEmitNode; - context.onSubstituteNode = onSubstituteNode; - return transformSourceFile; - function transformSourceFile(node) { - if (ts.isDeclarationFile(node)) { - return node; - } - currentSourceFile = node; - var visited = ts.visitEachChild(node, visitor, context); - ts.addEmitHelpers(visited, context.readEmitHelpers()); - currentSourceFile = undefined; - return visited; - } - function visitor(node) { - if ((node.transformFlags & 16) === 0) { - return node; - } - switch (node.kind) { - case 119: - return undefined; - case 189: - return visitAwaitExpression(node); - case 149: - return visitMethodDeclaration(node); - case 225: - return visitFunctionDeclaration(node); - case 184: - return visitFunctionExpression(node); - case 185: - return visitArrowFunction(node); - default: - return ts.visitEachChild(node, visitor, context); - } - } - function visitAwaitExpression(node) { - return ts.setOriginalNode(ts.createYield(undefined, ts.visitNode(node.expression, visitor, ts.isExpression), node), node); - } - function visitMethodDeclaration(node) { - return ts.updateMethod(node, undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - function visitFunctionDeclaration(node) { - return ts.updateFunctionDeclaration(node, undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - function visitFunctionExpression(node) { - if (ts.nodeIsMissing(node.body)) { - return ts.createOmittedExpression(); - } - return ts.updateFunctionExpression(node, undefined, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - function visitArrowFunction(node) { - return ts.updateArrowFunction(node, ts.visitNodes(node.modifiers, visitor, ts.isModifier), undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - function transformAsyncFunctionBody(node) { - resumeLexicalEnvironment(); - var original = ts.getOriginalNode(node, ts.isFunctionLike); - var nodeType = original.type; - var promiseConstructor = languageVersion < 2 ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 185; - var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192) !== 0; - if (!isArrowFunction) { - var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.body.statements, false, visitor); - statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body, statementOffset)))); - ts.addRange(statements, endLexicalEnvironment()); - var block = ts.createBlock(statements, node.body, true); - if (languageVersion >= 2) { - if (resolver.getNodeCheckFlags(node) & 4096) { - enableSubstitutionForAsyncMethodsWithSuper(); - ts.addEmitHelper(block, advancedAsyncSuperHelper); - } - else if (resolver.getNodeCheckFlags(node) & 2048) { - enableSubstitutionForAsyncMethodsWithSuper(); - ts.addEmitHelper(block, asyncSuperHelper); - } - } - return block; - } - else { - var expression = createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body)); - var declarations = endLexicalEnvironment(); - if (ts.some(declarations)) { - var block = ts.convertToFunctionBody(expression); - return ts.updateBlock(block, ts.createNodeArray(ts.concatenate(block.statements, declarations), block.statements)); - } - return expression; - } - } - function transformFunctionBodyWorker(body, start) { - if (ts.isBlock(body)) { - return ts.updateBlock(body, ts.visitLexicalEnvironment(body.statements, visitor, context, start)); - } - else { - startLexicalEnvironment(); - var visited = ts.convertToFunctionBody(ts.visitNode(body, visitor, ts.isConciseBody)); - var declarations = endLexicalEnvironment(); - return ts.updateBlock(visited, ts.createNodeArray(ts.concatenate(visited.statements, declarations), visited.statements)); - } - } - function getPromiseConstructor(type) { - var typeName = type && ts.getEntityNameFromTypeNode(type); - if (typeName && ts.isEntityName(typeName)) { - var serializationKind = resolver.getTypeReferenceSerializationKind(typeName); - if (serializationKind === ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue - || serializationKind === ts.TypeReferenceSerializationKind.Unknown) { - return typeName; - } - } - return undefined; - } - function enableSubstitutionForAsyncMethodsWithSuper() { - if ((enabledSubstitutions & 1) === 0) { - enabledSubstitutions |= 1; - context.enableSubstitution(179); - context.enableSubstitution(177); - context.enableSubstitution(178); - context.enableEmitNotification(226); - context.enableEmitNotification(149); - context.enableEmitNotification(151); - context.enableEmitNotification(152); - context.enableEmitNotification(150); - } - } - function substituteExpression(node) { - switch (node.kind) { - case 177: - return substitutePropertyAccessExpression(node); - case 178: - return substituteElementAccessExpression(node); - case 179: - if (enabledSubstitutions & 1) { - return substituteCallExpression(node); - } - break; - } - return node; - } - function substitutePropertyAccessExpression(node) { - if (enabledSubstitutions & 1 && node.expression.kind === 96) { - var flags = getSuperContainerAsyncMethodFlags(); - if (flags) { - return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), flags, node); - } - } - return node; - } - function substituteElementAccessExpression(node) { - if (enabledSubstitutions & 1 && node.expression.kind === 96) { - var flags = getSuperContainerAsyncMethodFlags(); - if (flags) { - return createSuperAccessInAsyncMethod(node.argumentExpression, flags, node); - } - } - return node; - } - function substituteCallExpression(node) { - var expression = node.expression; - if (ts.isSuperProperty(expression)) { - var flags = getSuperContainerAsyncMethodFlags(); - if (flags) { - var argumentExpression = ts.isPropertyAccessExpression(expression) - ? substitutePropertyAccessExpression(expression) - : substituteElementAccessExpression(expression); - return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), undefined, [ - ts.createThis() - ].concat(node.arguments)); - } - } - return node; - } - function isSuperContainer(node) { - var kind = node.kind; - return kind === 226 - || kind === 150 - || kind === 149 - || kind === 151 - || kind === 152; - } - function onEmitNode(emitContext, node, emitCallback) { - if (enabledSubstitutions & 1 && isSuperContainer(node)) { - var savedCurrentSuperContainer = currentSuperContainer; - currentSuperContainer = node; - previousOnEmitNode(emitContext, node, emitCallback); - currentSuperContainer = savedCurrentSuperContainer; - } - else { - previousOnEmitNode(emitContext, node, emitCallback); - } - } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1) { - return substituteExpression(node); - } - return node; - } - function createSuperAccessInAsyncMethod(argumentExpression, flags, location) { - if (flags & 4096) { - return ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression]), "value", location); - } - else { - return ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression], location); - } - } - function getSuperContainerAsyncMethodFlags() { - return currentSuperContainer !== undefined - && resolver.getNodeCheckFlags(currentSuperContainer) & (2048 | 4096); - } - } - ts.transformES2017 = transformES2017; - function createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, body) { - context.requestEmitHelper(awaiterHelper); - var generatorFunc = ts.createFunctionExpression(undefined, ts.createToken(38), undefined, undefined, [], undefined, body); - (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 131072; - return ts.createCall(ts.getHelperName("__awaiter"), undefined, [ - ts.createThis(), - hasLexicalArguments ? ts.createIdentifier("arguments") : ts.createVoidZero(), - promiseConstructor ? ts.createExpressionFromEntityName(promiseConstructor) : ts.createVoidZero(), - generatorFunc - ]); - } - var awaiterHelper = { - name: "typescript:awaiter", - scoped: false, - priority: 5, - text: "\n var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments)).next());\n });\n };" - }; - var asyncSuperHelper = { - name: "typescript:async-super", - scoped: true, - text: "\n const _super = name => super[name];" - }; - var advancedAsyncSuperHelper = { - name: "typescript:advanced-async-super", - scoped: true, - text: "\n const _super = (function (geti, seti) {\n const cache = Object.create(null);\n return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n })(name => super[name], (name, value) => super[name] = value);" - }; -})(ts || (ts = {})); -var ts; (function (ts) { function transformES2016(context) { var hoistVariableDeclaration = context.hoistVariableDeclaration; @@ -41361,7 +45788,7 @@ var ts; return node; } switch (node.kind) { - case 192: + case 193: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -41385,19 +45812,19 @@ var ts; if (ts.isElementAccessExpression(left)) { var expressionTemp = ts.createTempVariable(hoistVariableDeclaration); var argumentExpressionTemp = ts.createTempVariable(hoistVariableDeclaration); - target = ts.createElementAccess(ts.createAssignment(expressionTemp, left.expression, left.expression), ts.createAssignment(argumentExpressionTemp, left.argumentExpression, left.argumentExpression), left); - value = ts.createElementAccess(expressionTemp, argumentExpressionTemp, left); + target = ts.setTextRange(ts.createElementAccess(ts.setTextRange(ts.createAssignment(expressionTemp, left.expression), left.expression), ts.setTextRange(ts.createAssignment(argumentExpressionTemp, left.argumentExpression), left.argumentExpression)), left); + value = ts.setTextRange(ts.createElementAccess(expressionTemp, argumentExpressionTemp), left); } else if (ts.isPropertyAccessExpression(left)) { var expressionTemp = ts.createTempVariable(hoistVariableDeclaration); - target = ts.createPropertyAccess(ts.createAssignment(expressionTemp, left.expression, left.expression), left.name, left); - value = ts.createPropertyAccess(expressionTemp, left.name, left); + target = ts.setTextRange(ts.createPropertyAccess(ts.setTextRange(ts.createAssignment(expressionTemp, left.expression), left.expression), left.name), left); + value = ts.setTextRange(ts.createPropertyAccess(expressionTemp, left.name), left); } else { target = left; value = left; } - return ts.createAssignment(target, ts.createMathPow(value, right, node), node); + return ts.setTextRange(ts.createAssignment(target, ts.createMathPow(value, right, node)), node); } function visitExponentiationExpression(node) { var left = ts.visitNode(node.left, visitor, ts.isExpression); @@ -41409,8 +45836,78 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { + var ES2015SubstitutionFlags; + (function (ES2015SubstitutionFlags) { + ES2015SubstitutionFlags[ES2015SubstitutionFlags["CapturedThis"] = 1] = "CapturedThis"; + ES2015SubstitutionFlags[ES2015SubstitutionFlags["BlockScopedBindings"] = 2] = "BlockScopedBindings"; + })(ES2015SubstitutionFlags || (ES2015SubstitutionFlags = {})); + var CopyDirection; + (function (CopyDirection) { + CopyDirection[CopyDirection["ToOriginal"] = 0] = "ToOriginal"; + CopyDirection[CopyDirection["ToOutParameter"] = 1] = "ToOutParameter"; + })(CopyDirection || (CopyDirection = {})); + var Jump; + (function (Jump) { + Jump[Jump["Break"] = 2] = "Break"; + Jump[Jump["Continue"] = 4] = "Continue"; + Jump[Jump["Return"] = 8] = "Return"; + })(Jump || (Jump = {})); + var SuperCaptureResult; + (function (SuperCaptureResult) { + SuperCaptureResult[SuperCaptureResult["NoReplacement"] = 0] = "NoReplacement"; + SuperCaptureResult[SuperCaptureResult["ReplaceSuperCapture"] = 1] = "ReplaceSuperCapture"; + SuperCaptureResult[SuperCaptureResult["ReplaceWithReturn"] = 2] = "ReplaceWithReturn"; + })(SuperCaptureResult || (SuperCaptureResult = {})); + var HierarchyFacts; + (function (HierarchyFacts) { + HierarchyFacts[HierarchyFacts["None"] = 0] = "None"; + HierarchyFacts[HierarchyFacts["Function"] = 1] = "Function"; + HierarchyFacts[HierarchyFacts["ArrowFunction"] = 2] = "ArrowFunction"; + HierarchyFacts[HierarchyFacts["AsyncFunctionBody"] = 4] = "AsyncFunctionBody"; + HierarchyFacts[HierarchyFacts["NonStaticClassElement"] = 8] = "NonStaticClassElement"; + HierarchyFacts[HierarchyFacts["CapturesThis"] = 16] = "CapturesThis"; + HierarchyFacts[HierarchyFacts["ExportedVariableStatement"] = 32] = "ExportedVariableStatement"; + HierarchyFacts[HierarchyFacts["TopLevel"] = 64] = "TopLevel"; + HierarchyFacts[HierarchyFacts["Block"] = 128] = "Block"; + HierarchyFacts[HierarchyFacts["IterationStatement"] = 256] = "IterationStatement"; + HierarchyFacts[HierarchyFacts["IterationStatementBlock"] = 512] = "IterationStatementBlock"; + HierarchyFacts[HierarchyFacts["ForStatement"] = 1024] = "ForStatement"; + HierarchyFacts[HierarchyFacts["ForInOrForOfStatement"] = 2048] = "ForInOrForOfStatement"; + HierarchyFacts[HierarchyFacts["ConstructorWithCapturedSuper"] = 4096] = "ConstructorWithCapturedSuper"; + HierarchyFacts[HierarchyFacts["ComputedPropertyName"] = 8192] = "ComputedPropertyName"; + HierarchyFacts[HierarchyFacts["AncestorFactsMask"] = 16383] = "AncestorFactsMask"; + HierarchyFacts[HierarchyFacts["BlockScopeIncludes"] = 0] = "BlockScopeIncludes"; + HierarchyFacts[HierarchyFacts["BlockScopeExcludes"] = 4032] = "BlockScopeExcludes"; + HierarchyFacts[HierarchyFacts["SourceFileIncludes"] = 64] = "SourceFileIncludes"; + HierarchyFacts[HierarchyFacts["SourceFileExcludes"] = 3968] = "SourceFileExcludes"; + HierarchyFacts[HierarchyFacts["FunctionIncludes"] = 65] = "FunctionIncludes"; + HierarchyFacts[HierarchyFacts["FunctionExcludes"] = 16286] = "FunctionExcludes"; + HierarchyFacts[HierarchyFacts["AsyncFunctionBodyIncludes"] = 69] = "AsyncFunctionBodyIncludes"; + HierarchyFacts[HierarchyFacts["AsyncFunctionBodyExcludes"] = 16278] = "AsyncFunctionBodyExcludes"; + HierarchyFacts[HierarchyFacts["ArrowFunctionIncludes"] = 66] = "ArrowFunctionIncludes"; + HierarchyFacts[HierarchyFacts["ArrowFunctionExcludes"] = 16256] = "ArrowFunctionExcludes"; + HierarchyFacts[HierarchyFacts["ConstructorIncludes"] = 73] = "ConstructorIncludes"; + HierarchyFacts[HierarchyFacts["ConstructorExcludes"] = 16278] = "ConstructorExcludes"; + HierarchyFacts[HierarchyFacts["DoOrWhileStatementIncludes"] = 256] = "DoOrWhileStatementIncludes"; + HierarchyFacts[HierarchyFacts["DoOrWhileStatementExcludes"] = 0] = "DoOrWhileStatementExcludes"; + HierarchyFacts[HierarchyFacts["ForStatementIncludes"] = 1280] = "ForStatementIncludes"; + HierarchyFacts[HierarchyFacts["ForStatementExcludes"] = 3008] = "ForStatementExcludes"; + HierarchyFacts[HierarchyFacts["ForInOrForOfStatementIncludes"] = 2304] = "ForInOrForOfStatementIncludes"; + HierarchyFacts[HierarchyFacts["ForInOrForOfStatementExcludes"] = 1984] = "ForInOrForOfStatementExcludes"; + HierarchyFacts[HierarchyFacts["BlockIncludes"] = 128] = "BlockIncludes"; + HierarchyFacts[HierarchyFacts["BlockExcludes"] = 3904] = "BlockExcludes"; + HierarchyFacts[HierarchyFacts["IterationStatementBlockIncludes"] = 512] = "IterationStatementBlockIncludes"; + HierarchyFacts[HierarchyFacts["IterationStatementBlockExcludes"] = 4032] = "IterationStatementBlockExcludes"; + HierarchyFacts[HierarchyFacts["ComputedPropertyNameIncludes"] = 8192] = "ComputedPropertyNameIncludes"; + HierarchyFacts[HierarchyFacts["ComputedPropertyNameExcludes"] = 0] = "ComputedPropertyNameExcludes"; + HierarchyFacts[HierarchyFacts["NewTarget"] = 16384] = "NewTarget"; + HierarchyFacts[HierarchyFacts["NewTargetInComputedPropertyName"] = 32768] = "NewTargetInComputedPropertyName"; + HierarchyFacts[HierarchyFacts["SubtreeFactsMask"] = -16384] = "SubtreeFactsMask"; + HierarchyFacts[HierarchyFacts["PropagateNewTargetMask"] = 49152] = "PropagateNewTargetMask"; + })(HierarchyFacts || (HierarchyFacts = {})); function transformES2015(context) { var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration; + var compilerOptions = context.getCompilerOptions(); var resolver = context.getEmitResolver(); var previousOnSubstituteNode = context.onSubstituteNode; var previousOnEmitNode = context.onEmitNode; @@ -41418,15 +45915,7 @@ var ts; context.onSubstituteNode = onSubstituteNode; var currentSourceFile; var currentText; - var currentParent; - var currentNode; - var enclosingVariableStatement; - var enclosingBlockScopeContainer; - var enclosingBlockScopeContainerParent; - var enclosingFunction; - var enclosingNonArrowFunction; - var enclosingNonAsyncFunctionBody; - var isInConstructorWithCapturedSuper; + var hierarchyFacts; var convertedLoopState; var enabledSubstitutions; return transformSourceFile; @@ -41436,247 +45925,207 @@ var ts; } currentSourceFile = node; currentText = node.text; - var visited = saveStateAndInvoke(node, visitSourceFile); + var visited = visitSourceFile(node); ts.addEmitHelpers(visited, context.readEmitHelpers()); currentSourceFile = undefined; currentText = undefined; + hierarchyFacts = 0; return visited; } - function visitor(node) { - return saveStateAndInvoke(node, dispatcher); + function enterSubtree(excludeFacts, includeFacts) { + var ancestorFacts = hierarchyFacts; + hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & 16383; + return ancestorFacts; } - function dispatcher(node) { - return convertedLoopState - ? visitorForConvertedLoopWorker(node) - : visitorWorker(node); - } - function saveStateAndInvoke(node, f) { - var savedEnclosingFunction = enclosingFunction; - var savedEnclosingNonArrowFunction = enclosingNonArrowFunction; - var savedEnclosingNonAsyncFunctionBody = enclosingNonAsyncFunctionBody; - var savedEnclosingBlockScopeContainer = enclosingBlockScopeContainer; - var savedEnclosingBlockScopeContainerParent = enclosingBlockScopeContainerParent; - var savedEnclosingVariableStatement = enclosingVariableStatement; - var savedCurrentParent = currentParent; - var savedCurrentNode = currentNode; - var savedConvertedLoopState = convertedLoopState; - var savedIsInConstructorWithCapturedSuper = isInConstructorWithCapturedSuper; - if (ts.nodeStartsNewLexicalEnvironment(node)) { - isInConstructorWithCapturedSuper = false; - convertedLoopState = undefined; - } - onBeforeVisitNode(node); - var visited = f(node); - isInConstructorWithCapturedSuper = savedIsInConstructorWithCapturedSuper; - convertedLoopState = savedConvertedLoopState; - enclosingFunction = savedEnclosingFunction; - enclosingNonArrowFunction = savedEnclosingNonArrowFunction; - enclosingNonAsyncFunctionBody = savedEnclosingNonAsyncFunctionBody; - enclosingBlockScopeContainer = savedEnclosingBlockScopeContainer; - enclosingBlockScopeContainerParent = savedEnclosingBlockScopeContainerParent; - enclosingVariableStatement = savedEnclosingVariableStatement; - currentParent = savedCurrentParent; - currentNode = savedCurrentNode; - return visited; - } - function onBeforeVisitNode(node) { - if (currentNode) { - if (ts.isBlockScope(currentNode, currentParent)) { - enclosingBlockScopeContainer = currentNode; - enclosingBlockScopeContainerParent = currentParent; - } - if (ts.isFunctionLike(currentNode)) { - enclosingFunction = currentNode; - if (currentNode.kind !== 185) { - enclosingNonArrowFunction = currentNode; - if (!(ts.getEmitFlags(currentNode) & 131072)) { - enclosingNonAsyncFunctionBody = currentNode; - } - } - } - switch (currentNode.kind) { - case 205: - enclosingVariableStatement = currentNode; - break; - case 224: - case 223: - case 174: - case 172: - case 173: - break; - default: - enclosingVariableStatement = undefined; - } - } - currentParent = currentNode; - currentNode = node; - } - function returnCapturedThis(node) { - return ts.setOriginalNode(ts.createReturn(ts.createIdentifier("_this")), node); + function exitSubtree(ancestorFacts, excludeFacts, includeFacts) { + hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & -16384 | ancestorFacts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { - return isInConstructorWithCapturedSuper && node.kind === 216 && !node.expression; + return hierarchyFacts & 4096 + && node.kind === 218 + && !node.expression; } - function shouldCheckNode(node) { - return (node.transformFlags & 64) !== 0 || - node.kind === 219 || - (ts.isIterationStatement(node, false) && shouldConvertIterationStatementBody(node)); + function shouldVisitNode(node) { + return (node.transformFlags & 128) !== 0 + || convertedLoopState !== undefined + || (hierarchyFacts & 4096 && ts.isStatement(node)) + || (ts.isIterationStatement(node, false) && shouldConvertIterationStatementBody(node)); } - function visitorWorker(node) { - if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { - return returnCapturedThis(node); - } - else if (shouldCheckNode(node)) { + function visitor(node) { + if (shouldVisitNode(node)) { return visitJavaScript(node); } - else if (node.transformFlags & 128 || (isInConstructorWithCapturedSuper && !ts.isExpression(node))) { - return ts.visitEachChild(node, visitor, context); - } else { return node; } } - function visitorForConvertedLoopWorker(node) { - var result; - if (shouldCheckNode(node)) { - result = visitJavaScript(node); + function functionBodyVisitor(node) { + if (shouldVisitNode(node)) { + return visitBlock(node, true); } - else { - result = visitNodesInConvertedLoop(node); - } - return result; + return node; } - function visitNodesInConvertedLoop(node) { - switch (node.kind) { - case 216: - node = isReturnVoidStatementInConstructorWithCapturedSuper(node) ? returnCapturedThis(node) : node; - return visitReturnStatement(node); - case 205: - return visitVariableStatement(node); - case 218: - return visitSwitchStatement(node); - case 215: - case 214: - return visitBreakOrContinueStatement(node); - case 98: - return visitThisKeyword(node); - case 70: - return visitIdentifier(node); - default: - return ts.visitEachChild(node, visitor, context); + function callExpressionVisitor(node) { + if (node.kind === 96) { + return visitSuperKeyword(true); } + return visitor(node); } function visitJavaScript(node) { switch (node.kind) { case 114: return undefined; - case 226: + case 228: return visitClassDeclaration(node); - case 197: + case 198: return visitClassExpression(node); - case 144: + case 145: return visitParameter(node); - case 225: + case 227: return visitFunctionDeclaration(node); - case 185: + case 186: return visitArrowFunction(node); - case 184: + case 185: return visitFunctionExpression(node); - case 223: + case 225: return visitVariableDeclaration(node); case 70: return visitIdentifier(node); - case 224: + case 226: return visitVariableDeclarationList(node); - case 219: + case 220: + return visitSwitchStatement(node); + case 234: + return visitCaseBlock(node); + case 206: + return visitBlock(node, false); + case 217: + case 216: + return visitBreakOrContinueStatement(node); + case 221: return visitLabeledStatement(node); - case 209: - return visitDoStatement(node); - case 210: - return visitWhileStatement(node); case 211: - return visitForStatement(node); case 212: - return visitForInStatement(node); + return visitDoOrWhileStatement(node, undefined); case 213: - return visitForOfStatement(node); - case 207: + return visitForStatement(node, undefined); + case 214: + return visitForInStatement(node, undefined); + case 215: + return visitForOfStatement(node, undefined); + case 209: return visitExpressionStatement(node); - case 176: + case 177: return visitObjectLiteralExpression(node); - case 256: + case 259: return visitCatchClause(node); - case 258: + case 261: return visitShorthandPropertyAssignment(node); - case 175: + case 143: + return visitComputedPropertyName(node); + case 176: return visitArrayLiteralExpression(node); - case 179: - return visitCallExpression(node); case 180: + return visitCallExpression(node); + case 181: return visitNewExpression(node); - case 183: + case 184: return visitParenthesizedExpression(node, true); - case 192: + case 193: return visitBinaryExpression(node, true); case 12: case 13: case 14: case 15: return visitTemplateLiteral(node); - case 181: + case 9: + return visitStringLiteral(node); + case 8: + return visitNumericLiteral(node); + case 182: return visitTaggedTemplateExpression(node); - case 194: - return visitTemplateExpression(node); case 195: - return visitYieldExpression(node); + return visitTemplateExpression(node); case 196: + return visitYieldExpression(node); + case 197: return visitSpreadElement(node); case 96: - return visitSuperKeyword(); - case 195: - return ts.visitEachChild(node, visitor, context); - case 149: + return visitSuperKeyword(false); + case 98: + return visitThisKeyword(node); + case 203: + return visitMetaProperty(node); + case 150: return visitMethodDeclaration(node); - case 205: + case 152: + case 153: + return visitAccessorDeclaration(node); + case 207: return visitVariableStatement(node); + case 218: + return visitReturnStatement(node); default: - ts.Debug.failBadSyntaxKind(node); return ts.visitEachChild(node, visitor, context); } } function visitSourceFile(node) { + var ancestorFacts = enterSubtree(3968, 64); var statements = []; startLexicalEnvironment(); - var statementOffset = ts.addPrologueDirectives(statements, node.statements, false, visitor); + var statementOffset = ts.addStandardPrologue(statements, node.statements, false); addCaptureThisForNodeIfNeeded(statements, node); + statementOffset = ts.addCustomPrologue(statements, node.statements, statementOffset, visitor); ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset)); ts.addRange(statements, endLexicalEnvironment()); - return ts.updateSourceFileNode(node, ts.createNodeArray(statements, node.statements)); + exitSubtree(ancestorFacts, 0, 0); + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements)); } function visitSwitchStatement(node) { - ts.Debug.assert(convertedLoopState !== undefined); - var savedAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; - convertedLoopState.allowedNonLabeledJumps |= 2; - var result = ts.visitEachChild(node, visitor, context); - convertedLoopState.allowedNonLabeledJumps = savedAllowedNonLabeledJumps; - return result; + if (convertedLoopState !== undefined) { + var savedAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; + convertedLoopState.allowedNonLabeledJumps |= 2; + var result = ts.visitEachChild(node, visitor, context); + convertedLoopState.allowedNonLabeledJumps = savedAllowedNonLabeledJumps; + return result; + } + return ts.visitEachChild(node, visitor, context); + } + function visitCaseBlock(node) { + var ancestorFacts = enterSubtree(4032, 0); + var updated = ts.visitEachChild(node, visitor, context); + exitSubtree(ancestorFacts, 0, 0); + return updated; + } + function returnCapturedThis(node) { + return ts.setOriginalNode(ts.createReturn(ts.createIdentifier("_this")), node); } function visitReturnStatement(node) { - ts.Debug.assert(convertedLoopState !== undefined); - convertedLoopState.nonLocalJumps |= 8; - return ts.createReturn(ts.createObjectLiteral([ - ts.createPropertyAssignment(ts.createIdentifier("value"), node.expression - ? ts.visitNode(node.expression, visitor, ts.isExpression) - : ts.createVoidZero()) - ])); + if (convertedLoopState) { + convertedLoopState.nonLocalJumps |= 8; + if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { + node = returnCapturedThis(node); + } + return ts.createReturn(ts.createObjectLiteral([ + ts.createPropertyAssignment(ts.createIdentifier("value"), node.expression + ? ts.visitNode(node.expression, visitor, ts.isExpression) + : ts.createVoidZero()) + ])); + } + else if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { + return returnCapturedThis(node); + } + return ts.visitEachChild(node, visitor, context); } function visitThisKeyword(node) { - ts.Debug.assert(convertedLoopState !== undefined); - if (enclosingFunction && enclosingFunction.kind === 185) { - convertedLoopState.containsLexicalThis = true; - return node; + if (convertedLoopState) { + if (hierarchyFacts & 2) { + convertedLoopState.containsLexicalThis = true; + return node; + } + return convertedLoopState.thisName || (convertedLoopState.thisName = ts.createUniqueName("this")); } - return convertedLoopState.thisName || (convertedLoopState.thisName = ts.createUniqueName("this")); + return node; } function visitIdentifier(node) { if (!convertedLoopState) { @@ -41685,20 +46134,20 @@ var ts; if (ts.isGeneratedIdentifier(node)) { return node; } - if (node.text !== "arguments" && !resolver.isArgumentsLocalBinding(node)) { + if (node.text !== "arguments" || !resolver.isArgumentsLocalBinding(node)) { return node; } return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = ts.createUniqueName("arguments")); } function visitBreakOrContinueStatement(node) { if (convertedLoopState) { - var jump = node.kind === 215 ? 2 : 4; - var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels[node.label.text]) || + var jump = node.kind === 217 ? 2 : 4; + var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(node.label.text)) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; if (!node.label) { - if (node.kind === 215) { + if (node.kind === 217) { convertedLoopState.nonLocalJumps |= 2; labelMarker = "break"; } @@ -41708,7 +46157,7 @@ var ts; } } else { - if (node.kind === 215) { + if (node.kind === 217) { labelMarker = "break-" + node.label.text; setLabeledJump(convertedLoopState, true, node.label.text, labelMarker); } @@ -41741,8 +46190,9 @@ var ts; var variable = ts.createVariableDeclaration(ts.getLocalName(node, true), undefined, transformClassLikeDeclarationToExpression(node)); ts.setOriginalNode(variable, node); var statements = []; - var statement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([variable]), node); + var statement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([variable])); ts.setOriginalNode(statement, node); + ts.setTextRange(statement, node); ts.startOnNewLine(statement); statements.push(statement); if (ts.hasModifier(node, 1)) { @@ -41797,23 +46247,29 @@ var ts; ts.setEmitFlags(statement, 1536 | 384); statements.push(statement); ts.addRange(statements, endLexicalEnvironment()); - var block = ts.createBlock(ts.createNodeArray(statements, node.members), undefined, true); + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), node.members), true); ts.setEmitFlags(block, 1536); return block; } function addExtendsHelperIfNeeded(statements, node, extendsClauseElement) { if (extendsClauseElement) { - statements.push(ts.createStatement(createExtendsHelper(context, ts.getLocalName(node)), extendsClauseElement)); + statements.push(ts.setTextRange(ts.createStatement(createExtendsHelper(context, ts.getLocalName(node))), extendsClauseElement)); } } function addConstructor(statements, node, extendsClauseElement) { + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16278, 73); var constructor = ts.getFirstConstructorWithBody(node); var hasSynthesizedSuper = hasSynthesizedDefaultSuperCall(constructor, extendsClauseElement !== undefined); - var constructorFunction = ts.createFunctionDeclaration(undefined, undefined, undefined, ts.getDeclarationName(node), undefined, transformConstructorParameters(constructor, hasSynthesizedSuper), undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper), constructor || node); + var constructorFunction = ts.createFunctionDeclaration(undefined, undefined, undefined, ts.getDeclarationName(node), undefined, transformConstructorParameters(constructor, hasSynthesizedSuper), undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper)); + ts.setTextRange(constructorFunction, constructor || node); if (extendsClauseElement) { ts.setEmitFlags(constructorFunction, 8); } statements.push(constructorFunction); + exitSubtree(ancestorFacts, 49152, 0); + convertedLoopState = savedConvertedLoopState; } function transformConstructorParameters(constructor, hasSynthesizedSuper) { return ts.visitParameterList(constructor && !hasSynthesizedSuper && constructor.parameters, visitor, context) @@ -41827,48 +46283,55 @@ var ts; statementOffset = 0; } else if (constructor) { - statementOffset = ts.addPrologueDirectives(statements, constructor.body.statements, false, visitor); + statementOffset = ts.addStandardPrologue(statements, constructor.body.statements, false); } if (constructor) { addDefaultValueAssignmentsIfNeeded(statements, constructor); addRestParameterIfNeeded(statements, constructor, hasSynthesizedSuper); + if (!hasSynthesizedSuper) { + statementOffset = ts.addCustomPrologue(statements, constructor.body.statements, statementOffset, visitor); + } ts.Debug.assert(statementOffset >= 0, "statementOffset not initialized correctly!"); } - var superCaptureStatus = declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, constructor, !!extendsClauseElement, hasSynthesizedSuper, statementOffset); + var isDerivedClass = extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 94; + var superCaptureStatus = declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, constructor, isDerivedClass, hasSynthesizedSuper, statementOffset); if (superCaptureStatus === 1 || superCaptureStatus === 2) { statementOffset++; } if (constructor) { - var body = saveStateAndInvoke(constructor, function (constructor) { - isInConstructorWithCapturedSuper = superCaptureStatus === 1; - return ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, statementOffset); - }); - ts.addRange(statements, body); + if (superCaptureStatus === 1) { + hierarchyFacts |= 4096; + } + ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, statementOffset)); } - if (extendsClauseElement + if (isDerivedClass && superCaptureStatus !== 2 && !(constructor && isSufficientlyCoveredByReturnStatements(constructor.body))) { statements.push(ts.createReturn(ts.createIdentifier("_this"))); } ts.addRange(statements, endLexicalEnvironment()); - var block = ts.createBlock(ts.createNodeArray(statements, constructor ? constructor.body.statements : node.members), constructor ? constructor.body : node, true); + if (constructor) { + prependCaptureNewTargetIfNeeded(statements, constructor, false); + } + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), constructor ? constructor.body.statements : node.members), true); + ts.setTextRange(block, constructor ? constructor.body : node); if (!constructor) { ts.setEmitFlags(block, 1536); } return block; } function isSufficientlyCoveredByReturnStatements(statement) { - if (statement.kind === 216) { + if (statement.kind === 218) { return true; } - else if (statement.kind === 208) { + else if (statement.kind === 210) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement); } } - else if (statement.kind === 204) { + else if (statement.kind === 206) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -41876,8 +46339,8 @@ var ts; } return false; } - function declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, ctor, hasExtendsClause, hasSynthesizedSuper, statementOffset) { - if (!hasExtendsClause) { + function declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, ctor, isDerivedClass, hasSynthesizedSuper, statementOffset) { + if (!isDerivedClass) { if (ctor) { addCaptureThisForNodeIfNeeded(statements, ctor); } @@ -41897,42 +46360,43 @@ var ts; var ctorStatements = ctor.body.statements; if (statementOffset < ctorStatements.length) { firstStatement = ctorStatements[statementOffset]; - if (firstStatement.kind === 207 && ts.isSuperCall(firstStatement.expression)) { - var superCall = firstStatement.expression; - superCallExpression = ts.setOriginalNode(saveStateAndInvoke(superCall, visitImmediateSuperCallInBody), superCall); + if (firstStatement.kind === 209 && ts.isSuperCall(firstStatement.expression)) { + superCallExpression = visitImmediateSuperCallInBody(firstStatement.expression); } } - if (superCallExpression && statementOffset === ctorStatements.length - 1) { + if (superCallExpression + && statementOffset === ctorStatements.length - 1 + && !(ctor.transformFlags & (16384 | 32768))) { var returnStatement = ts.createReturn(superCallExpression); - if (superCallExpression.kind !== 192 - || superCallExpression.left.kind !== 179) { + if (superCallExpression.kind !== 193 + || superCallExpression.left.kind !== 180) { ts.Debug.fail("Assumed generated super call would have form 'super.call(...) || this'."); } ts.setCommentRange(returnStatement, ts.getCommentRange(ts.setEmitFlags(superCallExpression.left, 1536))); statements.push(returnStatement); return 2; } - captureThisForNode(statements, ctor, superCallExpression, firstStatement); + captureThisForNode(statements, ctor, superCallExpression || createActualThis(), firstStatement); if (superCallExpression) { return 1; } return 0; } + function createActualThis() { + return ts.setEmitFlags(ts.createThis(), 4); + } function createDefaultSuperCallOrThis() { - var actualThis = ts.createThis(); - ts.setEmitFlags(actualThis, 4); - var superCall = ts.createFunctionApply(ts.createIdentifier("_super"), actualThis, ts.createIdentifier("arguments")); - return ts.createLogicalOr(superCall, actualThis); + return ts.createLogicalOr(ts.createLogicalAnd(ts.createStrictInequality(ts.createIdentifier("_super"), ts.createNull()), ts.createFunctionApply(ts.createIdentifier("_super"), createActualThis(), ts.createIdentifier("arguments"))), createActualThis()); } function visitParameter(node) { if (node.dotDotDotToken) { return undefined; } else if (ts.isBindingPattern(node.name)) { - return ts.setOriginalNode(ts.createParameter(undefined, undefined, undefined, ts.getGeneratedNameForNode(node), undefined, undefined, undefined, node), node); + return ts.setOriginalNode(ts.setTextRange(ts.createParameter(undefined, undefined, undefined, ts.getGeneratedNameForNode(node), undefined, undefined, undefined), node), node); } else if (node.initializer) { - return ts.setOriginalNode(ts.createParameter(undefined, undefined, undefined, node.name, undefined, undefined, undefined, node), node); + return ts.setOriginalNode(ts.setTextRange(ts.createParameter(undefined, undefined, undefined, node.name, undefined, undefined, undefined), node), node); } else { return node; @@ -41947,15 +46411,15 @@ var ts; } for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { var parameter = _a[_i]; - var name_37 = parameter.name, initializer = parameter.initializer, dotDotDotToken = parameter.dotDotDotToken; + var name = parameter.name, initializer = parameter.initializer, dotDotDotToken = parameter.dotDotDotToken; if (dotDotDotToken) { continue; } - if (ts.isBindingPattern(name_37)) { - addDefaultValueAssignmentForBindingPattern(statements, parameter, name_37, initializer); + if (ts.isBindingPattern(name)) { + addDefaultValueAssignmentForBindingPattern(statements, parameter, name, initializer); } else if (initializer) { - addDefaultValueAssignmentForInitializer(statements, parameter, name_37, initializer); + addDefaultValueAssignmentForInitializer(statements, parameter, name, initializer); } } } @@ -41970,10 +46434,11 @@ var ts; } function addDefaultValueAssignmentForInitializer(statements, parameter, name, initializer) { initializer = ts.visitNode(initializer, visitor, ts.isExpression); - var statement = ts.createIf(ts.createTypeCheck(ts.getSynthesizedClone(name), "undefined"), ts.setEmitFlags(ts.createBlock([ - ts.createStatement(ts.createAssignment(ts.setEmitFlags(ts.getMutableClone(name), 48), ts.setEmitFlags(initializer, 48 | ts.getEmitFlags(initializer)), parameter)) - ], parameter), 1 | 32 | 384), undefined, parameter); + var statement = ts.createIf(ts.createTypeCheck(ts.getSynthesizedClone(name), "undefined"), ts.setEmitFlags(ts.setTextRange(ts.createBlock([ + ts.createStatement(ts.setTextRange(ts.createAssignment(ts.setEmitFlags(ts.getMutableClone(name), 48), ts.setEmitFlags(initializer, 48 | ts.getEmitFlags(initializer))), parameter)) + ]), parameter), 1 | 32 | 384)); statement.startsOnNewLine = true; + ts.setTextRange(statement, parameter); ts.setEmitFlags(statement, 384 | 32 | 524288); statements.push(statement); } @@ -41990,22 +46455,22 @@ var ts; var expressionName = ts.getSynthesizedClone(parameter.name); var restIndex = node.parameters.length - 1; var temp = ts.createLoopVariable(); - statements.push(ts.setEmitFlags(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ + statements.push(ts.setEmitFlags(ts.setTextRange(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ ts.createVariableDeclaration(declarationName, undefined, ts.createArrayLiteral([])) - ]), parameter), 524288)); - var forStatement = ts.createFor(ts.createVariableDeclarationList([ + ])), parameter), 524288)); + var forStatement = ts.createFor(ts.setTextRange(ts.createVariableDeclarationList([ ts.createVariableDeclaration(temp, undefined, ts.createLiteral(restIndex)) - ], parameter), ts.createLessThan(temp, ts.createPropertyAccess(ts.createIdentifier("arguments"), "length"), parameter), ts.createPostfixIncrement(temp, parameter), ts.createBlock([ - ts.startOnNewLine(ts.createStatement(ts.createAssignment(ts.createElementAccess(expressionName, restIndex === 0 + ]), parameter), ts.setTextRange(ts.createLessThan(temp, ts.createPropertyAccess(ts.createIdentifier("arguments"), "length")), parameter), ts.setTextRange(ts.createPostfixIncrement(temp), parameter), ts.createBlock([ + ts.startOnNewLine(ts.setTextRange(ts.createStatement(ts.createAssignment(ts.createElementAccess(expressionName, restIndex === 0 ? temp - : ts.createSubtract(temp, ts.createLiteral(restIndex))), ts.createElementAccess(ts.createIdentifier("arguments"), temp)), parameter)) + : ts.createSubtract(temp, ts.createLiteral(restIndex))), ts.createElementAccess(ts.createIdentifier("arguments"), temp))), parameter)) ])); ts.setEmitFlags(forStatement, 524288); ts.startOnNewLine(forStatement); statements.push(forStatement); } function addCaptureThisForNodeIfNeeded(statements, node) { - if (node.transformFlags & 32768 && node.kind !== 185) { + if (node.transformFlags & 32768 && node.kind !== 186) { captureThisForNode(statements, node, ts.createThis()); } } @@ -42013,29 +46478,62 @@ var ts; enableSubstitutionsForCapturedThis(); var captureThisStatement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ ts.createVariableDeclaration("_this", undefined, initializer) - ]), originalStatement); + ])); ts.setEmitFlags(captureThisStatement, 1536 | 524288); + ts.setTextRange(captureThisStatement, originalStatement); ts.setSourceMapRange(captureThisStatement, node); statements.push(captureThisStatement); } + function prependCaptureNewTargetIfNeeded(statements, node, copyOnWrite) { + if (hierarchyFacts & 16384) { + var newTarget = void 0; + switch (node.kind) { + case 186: + return statements; + case 150: + case 152: + case 153: + newTarget = ts.createVoidZero(); + break; + case 151: + newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4), "constructor"); + break; + case 227: + case 185: + newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4), 92, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4), "constructor"), ts.createVoidZero()); + break; + default: + ts.Debug.failBadSyntaxKind(node); + break; + } + var captureNewTargetStatement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration("_newTarget", undefined, newTarget) + ])); + if (copyOnWrite) { + return [captureNewTargetStatement].concat(statements); + } + statements.unshift(captureNewTargetStatement); + } + return statements; + } function addClassMembers(statements, node) { for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 203: + case 205: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 149: - statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member)); + case 150: + statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 151: case 152: + case 153: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { - statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors)); + statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 150: + case 151: break; default: ts.Debug.failBadSyntaxKind(node); @@ -42044,28 +46542,32 @@ var ts; } } function transformSemicolonClassElementToStatement(member) { - return ts.createEmptyStatement(member); + return ts.setTextRange(ts.createEmptyStatement(), member); } - function transformClassMethodDeclarationToStatement(receiver, member) { + function transformClassMethodDeclarationToStatement(receiver, member, container) { + var ancestorFacts = enterSubtree(0, 0); var commentRange = ts.getCommentRange(member); var sourceMapRange = ts.getSourceMapRange(member); var memberName = ts.createMemberAccessForPropertyName(receiver, ts.visitNode(member.name, visitor, ts.isPropertyName), member.name); - var memberFunction = transformFunctionLikeToExpression(member, member, undefined); + var memberFunction = transformFunctionLikeToExpression(member, member, undefined, container); ts.setEmitFlags(memberFunction, 1536); ts.setSourceMapRange(memberFunction, sourceMapRange); - var statement = ts.createStatement(ts.createAssignment(memberName, memberFunction), member); + var statement = ts.setTextRange(ts.createStatement(ts.createAssignment(memberName, memberFunction)), member); ts.setOriginalNode(statement, member); ts.setCommentRange(statement, commentRange); ts.setEmitFlags(statement, 48); + exitSubtree(ancestorFacts, 49152, hierarchyFacts & 49152 ? 16384 : 0); return statement; } - function transformAccessorsToStatement(receiver, accessors) { - var statement = ts.createStatement(transformAccessorsToExpression(receiver, accessors, false), ts.getSourceMapRange(accessors.firstAccessor)); + function transformAccessorsToStatement(receiver, accessors, container) { + var statement = ts.createStatement(transformAccessorsToExpression(receiver, accessors, container, false)); ts.setEmitFlags(statement, 1536); + ts.setSourceMapRange(statement, ts.getSourceMapRange(accessors.firstAccessor)); return statement; } - function transformAccessorsToExpression(receiver, _a, startsOnNewLine) { + function transformAccessorsToExpression(receiver, _a, container, startsOnNewLine) { var firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; + var ancestorFacts = enterSubtree(0, 0); var target = ts.getMutableClone(receiver); ts.setEmitFlags(target, 1536 | 32); ts.setSourceMapRange(target, firstAccessor.name); @@ -42074,7 +46576,7 @@ var ts; ts.setSourceMapRange(propertyName, firstAccessor.name); var properties = []; if (getAccessor) { - var getterFunction = transformFunctionLikeToExpression(getAccessor, undefined, undefined); + var getterFunction = transformFunctionLikeToExpression(getAccessor, undefined, undefined, container); ts.setSourceMapRange(getterFunction, ts.getSourceMapRange(getAccessor)); ts.setEmitFlags(getterFunction, 512); var getter = ts.createPropertyAssignment("get", getterFunction); @@ -42082,51 +46584,86 @@ var ts; properties.push(getter); } if (setAccessor) { - var setterFunction = transformFunctionLikeToExpression(setAccessor, undefined, undefined); + var setterFunction = transformFunctionLikeToExpression(setAccessor, undefined, undefined, container); ts.setSourceMapRange(setterFunction, ts.getSourceMapRange(setAccessor)); ts.setEmitFlags(setterFunction, 512); var setter = ts.createPropertyAssignment("set", setterFunction); ts.setCommentRange(setter, ts.getCommentRange(setAccessor)); properties.push(setter); } - properties.push(ts.createPropertyAssignment("enumerable", ts.createLiteral(true)), ts.createPropertyAssignment("configurable", ts.createLiteral(true))); + properties.push(ts.createPropertyAssignment("enumerable", ts.createTrue()), ts.createPropertyAssignment("configurable", ts.createTrue())); var call = ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), undefined, [ target, propertyName, - ts.createObjectLiteral(properties, undefined, true) + ts.createObjectLiteral(properties, true) ]); if (startsOnNewLine) { call.startsOnNewLine = true; } + exitSubtree(ancestorFacts, 49152, hierarchyFacts & 49152 ? 16384 : 0); return call; } function visitArrowFunction(node) { if (node.transformFlags & 16384) { enableSubstitutionsForCapturedThis(); } - var func = ts.createFunctionExpression(undefined, undefined, undefined, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node), node); + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16256, 66); + var func = ts.createFunctionExpression(undefined, undefined, undefined, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node)); + ts.setTextRange(func, node); ts.setOriginalNode(func, node); ts.setEmitFlags(func, 8); + exitSubtree(ancestorFacts, 0, 0); + convertedLoopState = savedConvertedLoopState; return func; } function visitFunctionExpression(node) { - return ts.updateFunctionExpression(node, undefined, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, node.transformFlags & 64 + var ancestorFacts = ts.getEmitFlags(node) & 131072 + ? enterSubtree(16278, 69) + : enterSubtree(16286, 65); + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var parameters = ts.visitParameterList(node.parameters, visitor, context); + var body = node.transformFlags & 64 ? transformFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); + : visitFunctionBodyDownLevel(node); + var name = hierarchyFacts & 16384 + ? ts.getLocalName(node) + : node.name; + exitSubtree(ancestorFacts, 49152, 0); + convertedLoopState = savedConvertedLoopState; + return ts.updateFunctionExpression(node, undefined, node.asteriskToken, name, undefined, parameters, undefined, body); } function visitFunctionDeclaration(node) { - return ts.updateFunctionDeclaration(node, undefined, node.modifiers, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, node.transformFlags & 64 + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16286, 65); + var parameters = ts.visitParameterList(node.parameters, visitor, context); + var body = node.transformFlags & 64 ? transformFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); + : visitFunctionBodyDownLevel(node); + var name = hierarchyFacts & 16384 + ? ts.getLocalName(node) + : node.name; + exitSubtree(ancestorFacts, 49152, 0); + convertedLoopState = savedConvertedLoopState; + return ts.updateFunctionDeclaration(node, undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, name, undefined, parameters, undefined, body); } - function transformFunctionLikeToExpression(node, location, name) { - var savedContainingNonArrowFunction = enclosingNonArrowFunction; - if (node.kind !== 185) { - enclosingNonArrowFunction = node; + function transformFunctionLikeToExpression(node, location, name, container) { + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = container && ts.isClassLike(container) && !ts.hasModifier(node, 32) + ? enterSubtree(16286, 65 | 8) + : enterSubtree(16286, 65); + var parameters = ts.visitParameterList(node.parameters, visitor, context); + var body = transformFunctionBody(node); + if (hierarchyFacts & 16384 && !name && (node.kind === 227 || node.kind === 185)) { + name = ts.getGeneratedNameForNode(node); } - var expression = ts.setOriginalNode(ts.createFunctionExpression(undefined, node.asteriskToken, name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, saveStateAndInvoke(node, transformFunctionBody), location), node); - enclosingNonArrowFunction = savedContainingNonArrowFunction; - return expression; + exitSubtree(ancestorFacts, 49152, 0); + convertedLoopState = savedConvertedLoopState; + return ts.setOriginalNode(ts.setTextRange(ts.createFunctionExpression(undefined, node.asteriskToken, name, undefined, parameters, undefined, body), location), node); } function transformFunctionBody(node) { var multiLine = false; @@ -42138,7 +46675,7 @@ var ts; var statementOffset; resumeLexicalEnvironment(); if (ts.isBlock(body)) { - statementOffset = ts.addPrologueDirectives(statements, body.statements, false, visitor); + statementOffset = ts.addStandardPrologue(statements, body.statements, false); } addCaptureThisForNodeIfNeeded(statements, node); addDefaultValueAssignmentsIfNeeded(statements, node); @@ -42147,6 +46684,7 @@ var ts; multiLine = true; } if (ts.isBlock(body)) { + statementOffset = ts.addCustomPrologue(statements, body.statements, statementOffset, visitor); statementsLocation = body.statements; ts.addRange(statements, ts.visitNodes(body.statements, visitor, ts.isStatement, statementOffset)); if (!multiLine && body.multiLine) { @@ -42154,7 +46692,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 185); + ts.Debug.assert(node.kind === 186); statementsLocation = ts.moveRangeEnd(body, -1); var equalsGreaterThanToken = node.equalsGreaterThanToken; if (!ts.nodeIsSynthesized(equalsGreaterThanToken) && !ts.nodeIsSynthesized(body)) { @@ -42166,17 +46704,20 @@ var ts; } } var expression = ts.visitNode(body, visitor, ts.isExpression); - var returnStatement = ts.createReturn(expression, body); + var returnStatement = ts.createReturn(expression); + ts.setTextRange(returnStatement, body); ts.setEmitFlags(returnStatement, 384 | 32 | 1024); statements.push(returnStatement); closeBraceLocation = body; } var lexicalEnvironment = context.endLexicalEnvironment(); ts.addRange(statements, lexicalEnvironment); + prependCaptureNewTargetIfNeeded(statements, node, false); if (!multiLine && lexicalEnvironment && lexicalEnvironment.length) { multiLine = true; } - var block = ts.createBlock(ts.createNodeArray(statements, statementsLocation), node.body, multiLine); + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), multiLine); + ts.setTextRange(block, node.body); if (!multiLine && singleLine) { ts.setEmitFlags(block, 1); } @@ -42186,11 +46727,26 @@ var ts; ts.setOriginalNode(block, node.body); return block; } + function visitFunctionBodyDownLevel(node) { + var updated = ts.visitFunctionBody(node.body, functionBodyVisitor, context); + return ts.updateBlock(updated, ts.setTextRange(ts.createNodeArray(prependCaptureNewTargetIfNeeded(updated.statements, node, true)), updated.statements)); + } + function visitBlock(node, isFunctionBody) { + if (isFunctionBody) { + return ts.visitEachChild(node, visitor, context); + } + var ancestorFacts = hierarchyFacts & 256 + ? enterSubtree(4032, 512) + : enterSubtree(3904, 128); + var updated = ts.visitEachChild(node, visitor, context); + exitSubtree(ancestorFacts, 0, 0); + return updated; + } function visitExpressionStatement(node) { switch (node.expression.kind) { - case 183: + case 184: return ts.updateStatement(node, visitParenthesizedExpression(node.expression, false)); - case 192: + case 193: return ts.updateStatement(node, visitBinaryExpression(node.expression, false)); } return ts.visitEachChild(node, visitor, context); @@ -42198,9 +46754,9 @@ var ts; function visitParenthesizedExpression(node, needsDestructuringValue) { if (!needsDestructuringValue) { switch (node.expression.kind) { - case 183: + case 184: return ts.updateParen(node, visitParenthesizedExpression(node.expression, false)); - case 192: + case 193: return ts.updateParen(node, visitBinaryExpression(node.expression, false)); } } @@ -42210,9 +46766,12 @@ var ts; if (ts.isDestructuringAssignment(node)) { return ts.flattenDestructuringAssignment(node, visitor, context, 0, needsDestructuringValue); } + return ts.visitEachChild(node, visitor, context); } function visitVariableStatement(node) { - if (convertedLoopState && (ts.getCombinedNodeFlags(node.declarationList) & 3) == 0) { + var ancestorFacts = enterSubtree(0, ts.hasModifier(node, 1) ? 32 : 0); + var updated; + if (convertedLoopState && (node.declarationList.flags & 3) === 0) { var assignments = void 0; for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; @@ -42225,53 +46784,59 @@ var ts; else { assignment = ts.createBinary(decl.name, 57, ts.visitNode(decl.initializer, visitor, ts.isExpression)); } - (assignments || (assignments = [])).push(assignment); + assignments = ts.append(assignments, assignment); } } if (assignments) { - return ts.createStatement(ts.reduceLeft(assignments, function (acc, v) { return ts.createBinary(v, 25, acc); }), node); + updated = ts.setTextRange(ts.createStatement(ts.reduceLeft(assignments, function (acc, v) { return ts.createBinary(v, 25, acc); })), node); } else { - return undefined; + updated = undefined; } } - return ts.visitEachChild(node, visitor, context); + else { + updated = ts.visitEachChild(node, visitor, context); + } + exitSubtree(ancestorFacts, 0, 0); + return updated; } function visitVariableDeclarationList(node) { - if (node.flags & 3) { - enableSubstitutionsForBlockScopedBindings(); + if (node.transformFlags & 64) { + if (node.flags & 3) { + enableSubstitutionsForBlockScopedBindings(); + } + var declarations = ts.flatten(ts.map(node.declarations, node.flags & 1 + ? visitVariableDeclarationInLetDeclarationList + : visitVariableDeclaration)); + var declarationList = ts.createVariableDeclarationList(declarations); + ts.setOriginalNode(declarationList, node); + ts.setTextRange(declarationList, node); + ts.setCommentRange(declarationList, node); + if (node.transformFlags & 8388608 + && (ts.isBindingPattern(node.declarations[0].name) + || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) { + var firstDeclaration = ts.firstOrUndefined(declarations); + var lastDeclaration = ts.lastOrUndefined(declarations); + ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); + } + return declarationList; } - var declarations = ts.flatten(ts.map(node.declarations, node.flags & 1 - ? visitVariableDeclarationInLetDeclarationList - : visitVariableDeclaration)); - var declarationList = ts.createVariableDeclarationList(declarations, node); - ts.setOriginalNode(declarationList, node); - ts.setCommentRange(declarationList, node); - if (node.transformFlags & 8388608 - && (ts.isBindingPattern(node.declarations[0].name) - || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) { - var firstDeclaration = ts.firstOrUndefined(declarations); - var lastDeclaration = ts.lastOrUndefined(declarations); - ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); - } - return declarationList; + return ts.visitEachChild(node, visitor, context); } function shouldEmitExplicitInitializerForLetDeclaration(node) { var flags = resolver.getNodeCheckFlags(node); var isCapturedInFunction = flags & 131072; var isDeclaredInLoop = flags & 262144; - var emittedAsTopLevel = ts.isBlockScopedContainerTopLevel(enclosingBlockScopeContainer) + var emittedAsTopLevel = (hierarchyFacts & 64) !== 0 || (isCapturedInFunction && isDeclaredInLoop - && ts.isBlock(enclosingBlockScopeContainer) - && ts.isIterationStatement(enclosingBlockScopeContainerParent, false)); + && (hierarchyFacts & 512) !== 0); var emitExplicitInitializer = !emittedAsTopLevel - && enclosingBlockScopeContainer.kind !== 212 - && enclosingBlockScopeContainer.kind !== 213 + && (hierarchyFacts & 2048) === 0 && (!resolver.isDeclarationWithCollidingName(node) || (isDeclaredInLoop && !isCapturedInFunction - && !ts.isIterationStatement(enclosingBlockScopeContainer, false))); + && (hierarchyFacts & (1024 | 2048)) === 0)); return emitExplicitInitializer; } function visitVariableDeclarationInLetDeclarationList(node) { @@ -42287,84 +46852,94 @@ var ts; return ts.visitEachChild(node, visitor, context); } function visitVariableDeclaration(node) { + var ancestorFacts = enterSubtree(32, 0); + var updated; if (ts.isBindingPattern(node.name)) { - var hoistTempVariables = enclosingVariableStatement - && ts.hasModifier(enclosingVariableStatement, 1); - return ts.flattenDestructuringBinding(node, visitor, context, 0, undefined, hoistTempVariables); - } - return ts.visitEachChild(node, visitor, context); - } - function visitLabeledStatement(node) { - if (convertedLoopState) { - if (!convertedLoopState.labels) { - convertedLoopState.labels = ts.createMap(); - } - convertedLoopState.labels[node.label.text] = node.label.text; - } - var result; - if (ts.isIterationStatement(node.statement, false) && shouldConvertIterationStatementBody(node.statement)) { - result = ts.visitNodes(ts.createNodeArray([node.statement]), visitor, ts.isStatement); + updated = ts.flattenDestructuringBinding(node, visitor, context, 0, undefined, (ancestorFacts & 32) !== 0); } else { - result = ts.visitEachChild(node, visitor, context); + updated = ts.visitEachChild(node, visitor, context); } - if (convertedLoopState) { - convertedLoopState.labels[node.label.text] = undefined; + exitSubtree(ancestorFacts, 0, 0); + return updated; + } + function recordLabel(node) { + convertedLoopState.labels.set(node.label.text, node.label.text); + } + function resetLabel(node) { + convertedLoopState.labels.set(node.label.text, undefined); + } + function visitLabeledStatement(node) { + if (convertedLoopState && !convertedLoopState.labels) { + convertedLoopState.labels = ts.createMap(); } - return result; + var statement = ts.unwrapInnermostStatementOfLabel(node, convertedLoopState && recordLabel); + return ts.isIterationStatement(statement, false) + ? visitIterationStatement(statement, node) + : ts.restoreEnclosingLabel(ts.visitNode(statement, visitor, ts.isStatement), node, convertedLoopState && resetLabel); } - function visitDoStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitIterationStatement(node, outermostLabeledStatement) { + switch (node.kind) { + case 211: + case 212: + return visitDoOrWhileStatement(node, outermostLabeledStatement); + case 213: + return visitForStatement(node, outermostLabeledStatement); + case 214: + return visitForInStatement(node, outermostLabeledStatement); + case 215: + return visitForOfStatement(node, outermostLabeledStatement); + } } - function visitWhileStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitIterationStatementWithFacts(excludeFacts, includeFacts, node, outermostLabeledStatement, convert) { + var ancestorFacts = enterSubtree(excludeFacts, includeFacts); + var updated = convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, convert); + exitSubtree(ancestorFacts, 0, 0); + return updated; } - function visitForStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitDoOrWhileStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(0, 256, node, outermostLabeledStatement); } - function visitForInStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitForStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(3008, 1280, node, outermostLabeledStatement); } - function visitForOfStatement(node) { - return convertIterationStatementBodyIfNecessary(node, convertForOfToFor); + function visitForInStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(1984, 2304, node, outermostLabeledStatement); } - function convertForOfToFor(node, convertedLoopBodyStatements) { - var expression = ts.visitNode(node.expression, visitor, ts.isExpression); - var initializer = node.initializer; + function visitForOfStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(1984, 2304, node, outermostLabeledStatement, compilerOptions.downlevelIteration ? convertForOfStatementForIterable : convertForOfStatementForArray); + } + function convertForOfStatementHead(node, boundValue, convertedLoopBodyStatements) { var statements = []; - var counter = ts.createLoopVariable(); - var rhsReference = expression.kind === 70 - ? ts.createUniqueName(expression.text) - : ts.createTempVariable(undefined); - var elementAccess = ts.createElementAccess(rhsReference, counter); - if (ts.isVariableDeclarationList(initializer)) { - if (initializer.flags & 3) { + if (ts.isVariableDeclarationList(node.initializer)) { + if (node.initializer.flags & 3) { enableSubstitutionsForBlockScopedBindings(); } - var firstOriginalDeclaration = ts.firstOrUndefined(initializer.declarations); + var firstOriginalDeclaration = ts.firstOrUndefined(node.initializer.declarations); if (firstOriginalDeclaration && ts.isBindingPattern(firstOriginalDeclaration.name)) { - var declarations = ts.flattenDestructuringBinding(firstOriginalDeclaration, visitor, context, 0, elementAccess); - var declarationList = ts.createVariableDeclarationList(declarations, initializer); - ts.setOriginalNode(declarationList, initializer); + var declarations = ts.flattenDestructuringBinding(firstOriginalDeclaration, visitor, context, 0, boundValue); + var declarationList = ts.setTextRange(ts.createVariableDeclarationList(declarations), node.initializer); + ts.setOriginalNode(declarationList, node.initializer); var firstDeclaration = declarations[0]; var lastDeclaration = ts.lastOrUndefined(declarations); ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); statements.push(ts.createVariableStatement(undefined, declarationList)); } else { - statements.push(ts.createVariableStatement(undefined, ts.setOriginalNode(ts.createVariableDeclarationList([ - ts.createVariableDeclaration(firstOriginalDeclaration ? firstOriginalDeclaration.name : ts.createTempVariable(undefined), undefined, ts.createElementAccess(rhsReference, counter)) - ], ts.moveRangePos(initializer, -1)), initializer), ts.moveRangeEnd(initializer, -1))); + statements.push(ts.setTextRange(ts.createVariableStatement(undefined, ts.setOriginalNode(ts.setTextRange(ts.createVariableDeclarationList([ + ts.createVariableDeclaration(firstOriginalDeclaration ? firstOriginalDeclaration.name : ts.createTempVariable(undefined), undefined, boundValue) + ]), ts.moveRangePos(node.initializer, -1)), node.initializer)), ts.moveRangeEnd(node.initializer, -1))); } } else { - var assignment = ts.createAssignment(initializer, elementAccess); + var assignment = ts.createAssignment(node.initializer, boundValue); if (ts.isDestructuringAssignment(assignment)) { - statements.push(ts.createStatement(ts.flattenDestructuringAssignment(assignment, visitor, context, 0))); + ts.aggregateTransformFlags(assignment); + statements.push(ts.createStatement(visitBinaryExpression(assignment, false))); } else { - assignment.end = initializer.end; - statements.push(ts.createStatement(assignment, ts.moveRangeEnd(initializer, -1))); + assignment.end = node.initializer.end; + statements.push(ts.setTextRange(ts.createStatement(ts.visitNode(assignment, visitor, ts.isExpression)), ts.moveRangeEnd(node.initializer, -1))); } } var bodyLocation; @@ -42373,7 +46948,7 @@ var ts; ts.addRange(statements, convertedLoopBodyStatements); } else { - var statement = ts.visitNode(node.statement, visitor, ts.isStatement); + var statement = ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock); if (ts.isBlock(statement)) { ts.addRange(statements, statement.statements); bodyLocation = statement; @@ -42383,39 +46958,82 @@ var ts; statements.push(statement); } } + return ts.setEmitFlags(ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), true), bodyLocation), 48 | 384); + } + function convertForOfStatementForArray(node, outermostLabeledStatement, convertedLoopBodyStatements) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + var counter = ts.createLoopVariable(); + var rhsReference = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(expression) : ts.createTempVariable(undefined); ts.setEmitFlags(expression, 48 | ts.getEmitFlags(expression)); - var body = ts.createBlock(ts.createNodeArray(statements, statementsLocation), bodyLocation); - ts.setEmitFlags(body, 48 | 384); - var forStatement = ts.createFor(ts.setEmitFlags(ts.createVariableDeclarationList([ - ts.createVariableDeclaration(counter, undefined, ts.createLiteral(0), ts.moveRangePos(node.expression, -1)), - ts.createVariableDeclaration(rhsReference, undefined, expression, node.expression) - ], node.expression), 1048576), ts.createLessThan(counter, ts.createPropertyAccess(rhsReference, "length"), node.expression), ts.createPostfixIncrement(counter, node.expression), body, node); + var forStatement = ts.setTextRange(ts.createFor(ts.setEmitFlags(ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(counter, undefined, ts.createLiteral(0)), ts.moveRangePos(node.expression, -1)), + ts.setTextRange(ts.createVariableDeclaration(rhsReference, undefined, expression), node.expression) + ]), node.expression), 1048576), ts.setTextRange(ts.createLessThan(counter, ts.createPropertyAccess(rhsReference, "length")), node.expression), ts.setTextRange(ts.createPostfixIncrement(counter), node.expression), convertForOfStatementHead(node, ts.createElementAccess(rhsReference, counter), convertedLoopBodyStatements)), node); ts.setEmitFlags(forStatement, 256); - return forStatement; + ts.setTextRange(forStatement, node); + return ts.restoreEnclosingLabel(forStatement, outermostLabeledStatement, convertedLoopState && resetLabel); + } + function convertForOfStatementForIterable(node, outermostLabeledStatement, convertedLoopBodyStatements) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + var iterator = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(expression) : ts.createTempVariable(undefined); + var result = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(iterator) : ts.createTempVariable(undefined); + var errorRecord = ts.createUniqueName("e"); + var catchVariable = ts.getGeneratedNameForNode(errorRecord); + var returnMethod = ts.createTempVariable(undefined); + var values = ts.createValuesHelper(context, expression, node.expression); + var next = ts.createCall(ts.createPropertyAccess(iterator, "next"), undefined, []); + hoistVariableDeclaration(errorRecord); + hoistVariableDeclaration(returnMethod); + var forStatement = ts.setEmitFlags(ts.setTextRange(ts.createFor(ts.setEmitFlags(ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(iterator, undefined, values), node.expression), + ts.createVariableDeclaration(result, undefined, next) + ]), node.expression), 1048576), ts.createLogicalNot(ts.createPropertyAccess(result, "done")), ts.createAssignment(result, next), convertForOfStatementHead(node, ts.createPropertyAccess(result, "value"), convertedLoopBodyStatements)), node), 256); + return ts.createTry(ts.createBlock([ + ts.restoreEnclosingLabel(forStatement, outermostLabeledStatement, convertedLoopState && resetLabel) + ]), ts.createCatchClause(ts.createVariableDeclaration(catchVariable), ts.setEmitFlags(ts.createBlock([ + ts.createStatement(ts.createAssignment(errorRecord, ts.createObjectLiteral([ + ts.createPropertyAssignment("error", catchVariable) + ]))) + ]), 1)), ts.createBlock([ + ts.createTry(ts.createBlock([ + ts.setEmitFlags(ts.createIf(ts.createLogicalAnd(ts.createLogicalAnd(result, ts.createLogicalNot(ts.createPropertyAccess(result, "done"))), ts.createAssignment(returnMethod, ts.createPropertyAccess(iterator, "return"))), ts.createStatement(ts.createFunctionCall(returnMethod, iterator, []))), 1), + ]), undefined, ts.setEmitFlags(ts.createBlock([ + ts.setEmitFlags(ts.createIf(errorRecord, ts.createThrow(ts.createPropertyAccess(errorRecord, "error"))), 1) + ]), 1)) + ])); } function visitObjectLiteralExpression(node) { var properties = node.properties; var numProperties = properties.length; var numInitialProperties = numProperties; + var numInitialPropertiesWithoutYield = numProperties; for (var i = 0; i < numProperties; i++) { var property = properties[i]; - if (property.transformFlags & 16777216 - || property.name.kind === 142) { + if ((property.transformFlags & 16777216 && hierarchyFacts & 4) + && i < numInitialPropertiesWithoutYield) { + numInitialPropertiesWithoutYield = i; + } + if (property.name.kind === 143) { numInitialProperties = i; break; } } - ts.Debug.assert(numInitialProperties !== numProperties); - var temp = ts.createTempVariable(hoistVariableDeclaration); - var expressions = []; - var assignment = ts.createAssignment(temp, ts.setEmitFlags(ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), undefined, node.multiLine), 32768)); - if (node.multiLine) { - assignment.startsOnNewLine = true; + if (numInitialProperties !== numProperties) { + if (numInitialPropertiesWithoutYield < numInitialProperties) { + numInitialProperties = numInitialPropertiesWithoutYield; + } + var temp = ts.createTempVariable(hoistVariableDeclaration); + var expressions = []; + var assignment = ts.createAssignment(temp, ts.setEmitFlags(ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), node.multiLine), 32768)); + if (node.multiLine) { + assignment.startsOnNewLine = true; + } + expressions.push(assignment); + addObjectLiteralMembers(expressions, node, temp, numInitialProperties); + expressions.push(node.multiLine ? ts.startOnNewLine(ts.getMutableClone(temp)) : temp); + return ts.inlineExpressions(expressions); } - expressions.push(assignment); - addObjectLiteralMembers(expressions, node, temp, numInitialProperties); - expressions.push(node.multiLine ? ts.startOnNewLine(ts.getMutableClone(temp)) : temp); - return ts.inlineExpressions(expressions); + return ts.visitEachChild(node, visitor, context); } function shouldConvertIterationStatementBody(node) { return (resolver.getNodeCheckFlags(node) & 65536) !== 0; @@ -42439,14 +47057,16 @@ var ts; } } } - function convertIterationStatementBodyIfNecessary(node, convert) { + function convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, convert) { if (!shouldConvertIterationStatementBody(node)) { var saveAllowedNonLabeledJumps = void 0; if (convertedLoopState) { saveAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; convertedLoopState.allowedNonLabeledJumps = 2 | 4; } - var result = convert ? convert(node, undefined) : ts.visitEachChild(node, visitor, context); + var result = convert + ? convert(node, outermostLabeledStatement, undefined) + : ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), outermostLabeledStatement, convertedLoopState && resetLabel); if (convertedLoopState) { convertedLoopState.allowedNonLabeledJumps = saveAllowedNonLabeledJumps; } @@ -42455,11 +47075,11 @@ var ts; var functionName = ts.createUniqueName("_loop"); var loopInitializer; switch (node.kind) { - case 211: - case 212: case 213: + case 214: + case 215: var initializer = node.initializer; - if (initializer && initializer.kind === 224) { + if (initializer && initializer.kind === 226) { loopInitializer = initializer; } break; @@ -42485,19 +47105,26 @@ var ts; convertedLoopState.hoistedLocalVariables = outerConvertedLoopState.hoistedLocalVariables; } } - var loopBody = ts.visitNode(node.statement, visitor, ts.isStatement); + startLexicalEnvironment(); + var loopBody = ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock); + var lexicalEnvironment = endLexicalEnvironment(); var currentState = convertedLoopState; convertedLoopState = outerConvertedLoopState; - if (loopOutParameters.length) { + if (loopOutParameters.length || lexicalEnvironment) { var statements_4 = ts.isBlock(loopBody) ? loopBody.statements.slice() : [loopBody]; - copyOutParameters(loopOutParameters, 1, statements_4); - loopBody = ts.createBlock(statements_4, undefined, true); + if (loopOutParameters.length) { + copyOutParameters(loopOutParameters, 1, statements_4); + } + ts.addRange(statements_4, lexicalEnvironment); + loopBody = ts.createBlock(statements_4, true); } - if (!ts.isBlock(loopBody)) { - loopBody = ts.createBlock([loopBody], undefined, true); + if (ts.isBlock(loopBody)) { + loopBody.multiLine = true; } - var isAsyncBlockContainingAwait = enclosingNonArrowFunction - && (ts.getEmitFlags(enclosingNonArrowFunction) & 131072) !== 0 + else { + loopBody = ts.createBlock([loopBody], true); + } + var isAsyncBlockContainingAwait = hierarchyFacts & 4 && (node.statement.transformFlags & 16777216) !== 0; var loopBodyFlags = 0; if (currentState.containsLexicalThis) { @@ -42556,19 +47183,18 @@ var ts; var convertedLoopBodyStatements = generateCallToConvertedLoop(functionName, loopParameters, currentState, isAsyncBlockContainingAwait); var loop; if (convert) { - loop = convert(node, convertedLoopBodyStatements); + loop = convert(node, outermostLabeledStatement, convertedLoopBodyStatements); } else { - loop = ts.getMutableClone(node); - loop.statement = undefined; - loop = ts.visitEachChild(loop, visitor, context); - loop.statement = ts.createBlock(convertedLoopBodyStatements, undefined, true); - loop.transformFlags = 0; - ts.aggregateTransformFlags(loop); + var clone_4 = ts.getMutableClone(node); + clone_4.statement = undefined; + clone_4 = ts.visitEachChild(clone_4, visitor, context); + clone_4.statement = ts.createBlock(convertedLoopBodyStatements, true); + clone_4.transformFlags = 0; + ts.aggregateTransformFlags(clone_4); + loop = ts.restoreEnclosingLabel(clone_4, outermostLabeledStatement, convertedLoopState && resetLabel); } - statements.push(currentParent.kind === 219 - ? ts.createLabel(currentParent.label, loop) - : loop); + statements.push(loop); return statements; } function copyOutParameter(outParam, copyDirection) { @@ -42589,7 +47215,9 @@ var ts; !state.labeledNonLocalBreaks && !state.labeledNonLocalContinues; var call = ts.createCall(loopFunctionExpressionName, undefined, ts.map(parameters, function (p) { return p.name; })); - var callResult = isAsyncBlockContainingAwait ? ts.createYield(ts.createToken(38), call) : call; + var callResult = isAsyncBlockContainingAwait + ? ts.createYield(ts.createToken(38), ts.setEmitFlags(call, 4194304)) + : call; if (isSimpleLoop) { statements.push(ts.createStatement(callResult)); copyOutParameters(state.loopOutParameters, 0, statements); @@ -42627,23 +47255,22 @@ var ts; if (!state.labeledNonLocalBreaks) { state.labeledNonLocalBreaks = ts.createMap(); } - state.labeledNonLocalBreaks[labelText] = labelMarker; + state.labeledNonLocalBreaks.set(labelText, labelMarker); } else { if (!state.labeledNonLocalContinues) { state.labeledNonLocalContinues = ts.createMap(); } - state.labeledNonLocalContinues[labelText] = labelMarker; + state.labeledNonLocalContinues.set(labelText, labelMarker); } } function processLabeledJumps(table, isBreak, loopResultName, outerLoop, caseClauses) { if (!table) { return; } - for (var labelText in table) { - var labelMarker = table[labelText]; + table.forEach(function (labelMarker, labelText) { var statements = []; - if (!outerLoop || (outerLoop.labels && outerLoop.labels[labelText])) { + if (!outerLoop || (outerLoop.labels && outerLoop.labels.get(labelText))) { var label = ts.createIdentifier(labelText); statements.push(isBreak ? ts.createBreak(label) : ts.createContinue(label)); } @@ -42652,7 +47279,7 @@ var ts; statements.push(ts.createReturn(loopResultName)); } caseClauses.push(ts.createCaseClause(ts.createLiteral(labelMarker), statements)); - } + }); } function processLoopVariableDeclaration(decl, loopParameters, loopOutParameters) { var name = decl.name; @@ -42667,7 +47294,7 @@ var ts; else { loopParameters.push(ts.createParameter(undefined, undefined, undefined, name)); if (resolver.getNodeCheckFlags(decl) & 2097152) { - var outParamName = ts.createUniqueName("out_" + name.text); + var outParamName = ts.createUniqueName("out_" + ts.unescapeIdentifier(name.text)); loopOutParameters.push({ originalName: name, outParamName: outParamName }); } } @@ -42678,22 +47305,22 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 151: case 152: + case 153: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { - expressions.push(transformAccessorsToExpression(receiver, accessors, node.multiLine)); + expressions.push(transformAccessorsToExpression(receiver, accessors, node, node.multiLine)); } break; - case 257: + case 150: + expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); + break; + case 260: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 258: + case 261: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 149: - expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node.multiLine)); - break; default: ts.Debug.failBadSyntaxKind(node); break; @@ -42701,34 +47328,49 @@ var ts; } } function transformPropertyAssignmentToExpression(property, receiver, startsOnNewLine) { - var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.visitNode(property.initializer, visitor, ts.isExpression), property); + var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.visitNode(property.initializer, visitor, ts.isExpression)); + ts.setTextRange(expression, property); if (startsOnNewLine) { expression.startsOnNewLine = true; } return expression; } function transformShorthandPropertyAssignmentToExpression(property, receiver, startsOnNewLine) { - var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.getSynthesizedClone(property.name), property); + var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.getSynthesizedClone(property.name)); + ts.setTextRange(expression, property); if (startsOnNewLine) { expression.startsOnNewLine = true; } return expression; } - function transformObjectLiteralMethodDeclarationToExpression(method, receiver, startsOnNewLine) { - var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(method.name, visitor, ts.isPropertyName)), transformFunctionLikeToExpression(method, method, undefined), method); + function transformObjectLiteralMethodDeclarationToExpression(method, receiver, container, startsOnNewLine) { + var ancestorFacts = enterSubtree(0, 0); + var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(method.name, visitor, ts.isPropertyName)), transformFunctionLikeToExpression(method, method, undefined, container)); + ts.setTextRange(expression, method); if (startsOnNewLine) { expression.startsOnNewLine = true; } + exitSubtree(ancestorFacts, 49152, hierarchyFacts & 49152 ? 16384 : 0); return expression; } function visitCatchClause(node) { - ts.Debug.assert(ts.isBindingPattern(node.variableDeclaration.name)); - var temp = ts.createTempVariable(undefined); - var newVariableDeclaration = ts.createVariableDeclaration(temp, undefined, undefined, node.variableDeclaration); - var vars = ts.flattenDestructuringBinding(node.variableDeclaration, visitor, context, 0, temp); - var list = ts.createVariableDeclarationList(vars, node.variableDeclaration, node.variableDeclaration.flags); - var destructure = ts.createVariableStatement(undefined, list); - return ts.updateCatchClause(node, newVariableDeclaration, addStatementToStartOfBlock(node.block, destructure)); + var ancestorFacts = enterSubtree(4032, 0); + var updated; + if (ts.isBindingPattern(node.variableDeclaration.name)) { + var temp = ts.createTempVariable(undefined); + var newVariableDeclaration = ts.createVariableDeclaration(temp); + ts.setTextRange(newVariableDeclaration, node.variableDeclaration); + var vars = ts.flattenDestructuringBinding(node.variableDeclaration, visitor, context, 0, temp); + var list = ts.createVariableDeclarationList(vars); + ts.setTextRange(list, node.variableDeclaration); + var destructure = ts.createVariableStatement(undefined, list); + updated = ts.updateCatchClause(node, newVariableDeclaration, addStatementToStartOfBlock(node.block, destructure)); + } + else { + updated = ts.visitEachChild(node, visitor, context); + } + exitSubtree(ancestorFacts, 0, 0); + return updated; } function addStatementToStartOfBlock(block, statement) { var transformedStatements = ts.visitNodes(block.statements, visitor, ts.isStatement); @@ -42736,21 +47378,43 @@ var ts; } function visitMethodDeclaration(node) { ts.Debug.assert(!ts.isComputedPropertyName(node.name)); - var functionExpression = transformFunctionLikeToExpression(node, ts.moveRangePos(node, -1), undefined); + var functionExpression = transformFunctionLikeToExpression(node, ts.moveRangePos(node, -1), undefined, undefined); ts.setEmitFlags(functionExpression, 512 | ts.getEmitFlags(functionExpression)); - return ts.createPropertyAssignment(node.name, functionExpression, node); + return ts.setTextRange(ts.createPropertyAssignment(node.name, functionExpression), node); + } + function visitAccessorDeclaration(node) { + ts.Debug.assert(!ts.isComputedPropertyName(node.name)); + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16286, 65); + var updated = ts.visitEachChild(node, visitor, context); + exitSubtree(ancestorFacts, 49152, 0); + convertedLoopState = savedConvertedLoopState; + return updated; } function visitShorthandPropertyAssignment(node) { - return ts.createPropertyAssignment(node.name, ts.getSynthesizedClone(node.name), node); + return ts.setTextRange(ts.createPropertyAssignment(node.name, ts.getSynthesizedClone(node.name)), node); + } + function visitComputedPropertyName(node) { + var ancestorFacts = enterSubtree(0, 8192); + var updated = ts.visitEachChild(node, visitor, context); + exitSubtree(ancestorFacts, 49152, hierarchyFacts & 49152 ? 32768 : 0); + return updated; } function visitYieldExpression(node) { return ts.visitEachChild(node, visitor, context); } function visitArrayLiteralExpression(node) { - return transformAndSpreadElements(node.elements, true, node.multiLine, node.elements.hasTrailingComma); + if (node.transformFlags & 64) { + return transformAndSpreadElements(node.elements, true, node.multiLine, node.elements.hasTrailingComma); + } + return ts.visitEachChild(node, visitor, context); } function visitCallExpression(node) { - return visitCallExpressionWithPotentialCapturedThisAssignment(node, true); + if (node.transformFlags & 64) { + return visitCallExpressionWithPotentialCapturedThisAssignment(node, true); + } + return ts.updateCall(node, ts.visitNode(node.expression, callExpressionVisitor, ts.isExpression), undefined, ts.visitNodes(node.arguments, visitor, ts.isExpression)); } function visitImmediateSuperCallInBody(node) { return visitCallExpressionWithPotentialCapturedThisAssignment(node, false); @@ -42762,38 +47426,54 @@ var ts; } var resultingCall; if (node.transformFlags & 524288) { - resultingCall = ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, false, false, false)); + resultingCall = ts.createFunctionApply(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, false, false, false)); } else { - resultingCall = ts.createFunctionCall(ts.visitNode(target, visitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), node); + resultingCall = ts.createFunctionCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), node); } if (node.expression.kind === 96) { var actualThis = ts.createThis(); ts.setEmitFlags(actualThis, 4); var initializer = ts.createLogicalOr(resultingCall, actualThis); - return assignToCapturedThis + resultingCall = assignToCapturedThis ? ts.createAssignment(ts.createIdentifier("_this"), initializer) : initializer; } - return resultingCall; + return ts.setOriginalNode(resultingCall, node); } function visitNewExpression(node) { - ts.Debug.assert((node.transformFlags & 524288) !== 0); - var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; - return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray([ts.createVoidZero()].concat(node.arguments)), false, false, false)), undefined, []); + if (node.transformFlags & 524288) { + var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; + return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray([ts.createVoidZero()].concat(node.arguments)), false, false, false)), undefined, []); + } + return ts.visitEachChild(node, visitor, context); } function transformAndSpreadElements(elements, needsUniqueCopy, multiLine, hasTrailingComma) { var numElements = elements.length; var segments = ts.flatten(ts.spanMap(elements, partitionSpread, function (partition, visitPartition, _start, end) { return visitPartition(partition, multiLine, hasTrailingComma && end === numElements); })); - if (segments.length === 1) { - var firstElement = elements[0]; - return needsUniqueCopy && ts.isSpreadExpression(firstElement) && firstElement.expression.kind !== 175 - ? ts.createArraySlice(segments[0]) - : segments[0]; + if (compilerOptions.downlevelIteration) { + if (segments.length === 1) { + var firstSegment = segments[0]; + if (ts.isCallExpression(firstSegment) + && ts.isIdentifier(firstSegment.expression) + && (ts.getEmitFlags(firstSegment.expression) & 4096) + && firstSegment.expression.text === "___spread") { + return segments[0]; + } + } + return ts.createSpreadHelper(context, segments); + } + else { + if (segments.length === 1) { + var firstElement = elements[0]; + return needsUniqueCopy && ts.isSpreadExpression(firstElement) && firstElement.expression.kind !== 176 + ? ts.createArraySlice(segments[0]) + : segments[0]; + } + return ts.createArrayConcat(segments.shift(), segments); } - return ts.createArrayConcat(segments.shift(), segments); } function partitionSpread(node) { return ts.isSpreadExpression(node) @@ -42804,7 +47484,7 @@ var ts; return ts.map(chunk, visitExpressionOfSpread); } function visitSpanOfNonSpreads(chunk, multiLine, hasTrailingComma) { - return ts.createArrayLiteral(ts.visitNodes(ts.createNodeArray(chunk, undefined, hasTrailingComma), visitor, ts.isExpression), undefined, multiLine); + return ts.createArrayLiteral(ts.visitNodes(ts.createNodeArray(chunk, hasTrailingComma), visitor, ts.isExpression), multiLine); } function visitSpreadElement(node) { return ts.visitNode(node.expression, visitor, ts.isExpression); @@ -42813,7 +47493,19 @@ var ts; return ts.visitNode(node.expression, visitor, ts.isExpression); } function visitTemplateLiteral(node) { - return ts.createLiteral(node.text, node); + return ts.setTextRange(ts.createLiteral(node.text), node); + } + function visitStringLiteral(node) { + if (node.hasExtendedUnicodeEscape) { + return ts.setTextRange(ts.createLiteral(node.text), node); + } + return node; + } + function visitNumericLiteral(node) { + if (node.numericLiteralFlags & 48) { + return ts.setTextRange(ts.createNumericLiteral(node.text), node); + } + return node; } function visitTaggedTemplateExpression(node) { var tag = ts.visitNode(node.tag, visitor, ts.isExpression); @@ -42847,7 +47539,7 @@ var ts; var isLast = node.kind === 12 || node.kind === 15; text = text.substring(1, text.length - (isLast ? 1 : 2)); text = text.replace(/\r\n?/g, "\n"); - return ts.createLiteral(text, node); + return ts.setTextRange(ts.createLiteral(text), node); } function visitTemplateExpression(node) { var expressions = []; @@ -42855,7 +47547,8 @@ var ts; addTemplateSpans(expressions, node); var expression = ts.reduceLeft(expressions, ts.createAdd); if (ts.nodeIsSynthesized(expression)) { - ts.setTextRange(expression, node); + expression.pos = node.pos; + expression.end = node.end; } return expression; } @@ -42878,21 +47571,34 @@ var ts; } } } - function visitSuperKeyword() { - return enclosingNonAsyncFunctionBody - && ts.isClassElement(enclosingNonAsyncFunctionBody) - && !ts.hasModifier(enclosingNonAsyncFunctionBody, 32) - && currentParent.kind !== 179 + function visitSuperKeyword(isExpressionOfCall) { + return hierarchyFacts & 8 + && !isExpressionOfCall ? ts.createPropertyAccess(ts.createIdentifier("_super"), "prototype") : ts.createIdentifier("_super"); } - function onEmitNode(emitContext, node, emitCallback) { - var savedEnclosingFunction = enclosingFunction; - if (enabledSubstitutions & 1 && ts.isFunctionLike(node)) { - enclosingFunction = node; + function visitMetaProperty(node) { + if (node.keywordToken === 93 && node.name.text === "target") { + if (hierarchyFacts & 8192) { + hierarchyFacts |= 32768; + } + else { + hierarchyFacts |= 16384; + } + return ts.createIdentifier("_newTarget"); } - previousOnEmitNode(emitContext, node, emitCallback); - enclosingFunction = savedEnclosingFunction; + return node; + } + function onEmitNode(hint, node, emitCallback) { + if (enabledSubstitutions & 1 && ts.isFunctionLike(node)) { + var ancestorFacts = enterSubtree(16286, ts.getEmitFlags(node) & 8 + ? 65 | 16 + : 65); + previousOnEmitNode(hint, node, emitCallback); + exitSubtree(ancestorFacts, 0, 0); + return; + } + previousOnEmitNode(hint, node, emitCallback); } function enableSubstitutionsForBlockScopedBindings() { if ((enabledSubstitutions & 2) === 0) { @@ -42904,18 +47610,18 @@ var ts; if ((enabledSubstitutions & 1) === 0) { enabledSubstitutions |= 1; context.enableSubstitution(98); - context.enableEmitNotification(150); - context.enableEmitNotification(149); context.enableEmitNotification(151); + context.enableEmitNotification(150); context.enableEmitNotification(152); + context.enableEmitNotification(153); + context.enableEmitNotification(186); context.enableEmitNotification(185); - context.enableEmitNotification(184); - context.enableEmitNotification(225); + context.enableEmitNotification(227); } } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1) { + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1) { return substituteExpression(node); } if (ts.isIdentifier(node)) { @@ -42927,7 +47633,7 @@ var ts; if (enabledSubstitutions & 2) { var original = ts.getParseTreeNode(node, ts.isIdentifier); if (original && isNameOfDeclarationWithCollidingName(original)) { - return ts.getGeneratedNameForNode(original); + return ts.setTextRange(ts.getGeneratedNameForNode(original), node); } } return node; @@ -42935,10 +47641,10 @@ var ts; function isNameOfDeclarationWithCollidingName(node) { var parent = node.parent; switch (parent.kind) { - case 174: - case 226: - case 229: - case 223: + case 175: + case 228: + case 231: + case 225: return parent.name === node && resolver.isDeclarationWithCollidingName(parent); } @@ -42957,16 +47663,15 @@ var ts; if (enabledSubstitutions & 2) { var declaration = resolver.getReferencedDeclarationWithCollidingName(node); if (declaration) { - return ts.getGeneratedNameForNode(declaration.name); + return ts.setTextRange(ts.getGeneratedNameForNode(declaration.name), node); } } return node; } function substituteThisKeyword(node) { if (enabledSubstitutions & 1 - && enclosingFunction - && ts.getEmitFlags(enclosingFunction) & 8) { - return ts.createIdentifier("_this", node); + && hierarchyFacts & 16) { + return ts.setTextRange(ts.createIdentifier("_this"), node); } return node; } @@ -42982,11 +47687,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 207) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 209) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 179) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 180) { return false; } var callTarget = statementExpression.expression; @@ -42994,7 +47699,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 196) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 197) { return false; } var expression = callArgument.expression; @@ -43013,18 +47718,65 @@ var ts; name: "typescript:extends", scoped: false, priority: 0, - text: "\n var __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };" + text: "\n var __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n })();" }; })(ts || (ts = {})); var ts; (function (ts) { - var instructionNames = ts.createMap((_a = {}, - _a[2] = "return", - _a[3] = "break", - _a[4] = "yield", - _a[5] = "yield*", - _a[7] = "endfinally", - _a)); + var OpCode; + (function (OpCode) { + OpCode[OpCode["Nop"] = 0] = "Nop"; + OpCode[OpCode["Statement"] = 1] = "Statement"; + OpCode[OpCode["Assign"] = 2] = "Assign"; + OpCode[OpCode["Break"] = 3] = "Break"; + OpCode[OpCode["BreakWhenTrue"] = 4] = "BreakWhenTrue"; + OpCode[OpCode["BreakWhenFalse"] = 5] = "BreakWhenFalse"; + OpCode[OpCode["Yield"] = 6] = "Yield"; + OpCode[OpCode["YieldStar"] = 7] = "YieldStar"; + OpCode[OpCode["Return"] = 8] = "Return"; + OpCode[OpCode["Throw"] = 9] = "Throw"; + OpCode[OpCode["Endfinally"] = 10] = "Endfinally"; + })(OpCode || (OpCode = {})); + var BlockAction; + (function (BlockAction) { + BlockAction[BlockAction["Open"] = 0] = "Open"; + BlockAction[BlockAction["Close"] = 1] = "Close"; + })(BlockAction || (BlockAction = {})); + var CodeBlockKind; + (function (CodeBlockKind) { + CodeBlockKind[CodeBlockKind["Exception"] = 0] = "Exception"; + CodeBlockKind[CodeBlockKind["With"] = 1] = "With"; + CodeBlockKind[CodeBlockKind["Switch"] = 2] = "Switch"; + CodeBlockKind[CodeBlockKind["Loop"] = 3] = "Loop"; + CodeBlockKind[CodeBlockKind["Labeled"] = 4] = "Labeled"; + })(CodeBlockKind || (CodeBlockKind = {})); + var ExceptionBlockState; + (function (ExceptionBlockState) { + ExceptionBlockState[ExceptionBlockState["Try"] = 0] = "Try"; + ExceptionBlockState[ExceptionBlockState["Catch"] = 1] = "Catch"; + ExceptionBlockState[ExceptionBlockState["Finally"] = 2] = "Finally"; + ExceptionBlockState[ExceptionBlockState["Done"] = 3] = "Done"; + })(ExceptionBlockState || (ExceptionBlockState = {})); + var Instruction; + (function (Instruction) { + Instruction[Instruction["Next"] = 0] = "Next"; + Instruction[Instruction["Throw"] = 1] = "Throw"; + Instruction[Instruction["Return"] = 2] = "Return"; + Instruction[Instruction["Break"] = 3] = "Break"; + Instruction[Instruction["Yield"] = 4] = "Yield"; + Instruction[Instruction["YieldStar"] = 5] = "YieldStar"; + Instruction[Instruction["Catch"] = 6] = "Catch"; + Instruction[Instruction["Endfinally"] = 7] = "Endfinally"; + })(Instruction || (Instruction = {})); + function getInstructionName(instruction) { + switch (instruction) { + case 2: return "return"; + case 3: return "break"; + case 4: return "yield"; + case 5: return "yield*"; + case 7: return "endfinally"; + } + } function transformGenerators(context) { var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistFunctionDeclaration = context.hoistFunctionDeclaration, hoistVariableDeclaration = context.hoistVariableDeclaration; var compilerOptions = context.getCompilerOptions(); @@ -43090,13 +47842,13 @@ var ts; } function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 209: + case 211: return visitDoStatement(node); - case 210: + case 212: return visitWhileStatement(node); - case 218: + case 220: return visitSwitchStatement(node); - case 219: + case 221: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -43104,24 +47856,24 @@ var ts; } function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 225: + case 227: return visitFunctionDeclaration(node); - case 184: + case 185: return visitFunctionExpression(node); - case 151: case 152: + case 153: return visitAccessorDeclaration(node); - case 205: + case 207: return visitVariableStatement(node); - case 211: + case 213: return visitForStatement(node); - case 212: - return visitForInStatement(node); - case 215: - return visitBreakStatement(node); case 214: - return visitContinueStatement(node); + return visitForInStatement(node); + case 217: + return visitBreakStatement(node); case 216: + return visitContinueStatement(node); + case 218: return visitReturnStatement(node); default: if (node.transformFlags & 16777216) { @@ -43137,21 +47889,21 @@ var ts; } function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 192: - return visitBinaryExpression(node); case 193: + return visitBinaryExpression(node); + case 194: return visitConditionalExpression(node); - case 195: + case 196: return visitYieldExpression(node); - case 175: - return visitArrayLiteralExpression(node); case 176: + return visitArrayLiteralExpression(node); + case 177: return visitObjectLiteralExpression(node); - case 178: - return visitElementAccessExpression(node); case 179: - return visitCallExpression(node); + return visitElementAccessExpression(node); case 180: + return visitCallExpression(node); + case 181: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -43159,9 +47911,9 @@ var ts; } function visitGenerator(node) { switch (node.kind) { - case 225: + case 227: return visitFunctionDeclaration(node); - case 184: + case 185: return visitFunctionExpression(node); default: ts.Debug.failBadSyntaxKind(node); @@ -43169,8 +47921,8 @@ var ts; } } function visitFunctionDeclaration(node) { - if (node.asteriskToken && ts.getEmitFlags(node) & 131072) { - node = ts.setOriginalNode(ts.createFunctionDeclaration(undefined, node.modifiers, undefined, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformGeneratorFunctionBody(node.body), node), node); + if (node.asteriskToken) { + node = ts.setOriginalNode(ts.setTextRange(ts.createFunctionDeclaration(undefined, node.modifiers, undefined, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformGeneratorFunctionBody(node.body)), node), node); } else { var savedInGeneratorFunctionBody = inGeneratorFunctionBody; @@ -43190,8 +47942,8 @@ var ts; } } function visitFunctionExpression(node) { - if (node.asteriskToken && ts.getEmitFlags(node) & 131072) { - node = ts.setOriginalNode(ts.createFunctionExpression(undefined, undefined, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformGeneratorFunctionBody(node.body), node), node); + if (node.asteriskToken) { + node = ts.setOriginalNode(ts.setTextRange(ts.createFunctionExpression(undefined, undefined, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, transformGeneratorFunctionBody(node.body)), node), node); } else { var savedInGeneratorFunctionBody = inGeneratorFunctionBody; @@ -43243,7 +47995,7 @@ var ts; operationLocations = undefined; state = ts.createTempVariable(undefined); resumeLexicalEnvironment(); - var statementOffset = ts.addPrologueDirectives(statements, body.statements, false, visitor); + var statementOffset = ts.addPrologue(statements, body.statements, false, visitor); transformAndEmitStatements(body.statements, statementOffset); var buildResult = build(); ts.addRange(statements, endLexicalEnvironment()); @@ -43261,7 +48013,7 @@ var ts; operationArguments = savedOperationArguments; operationLocations = savedOperationLocations; state = savedState; - return ts.createBlock(statements, body, body.multiLine); + return ts.setTextRange(ts.createBlock(statements, body.multiLine), body); } function visitVariableStatement(node) { if (node.transformFlags & 16777216) { @@ -43318,10 +48070,10 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 177: + case 178: target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 178: + case 179: target = ts.updateElementAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), cacheExpression(ts.visitNode(left.argumentExpression, visitor, ts.isExpression))); break; default: @@ -43330,7 +48082,7 @@ var ts; } var operator = node.operatorToken.kind; if (isCompoundAssignment(operator)) { - return ts.createBinary(target, 57, ts.createBinary(cacheExpression(target), getOperatorForCompoundAssignment(operator), ts.visitNode(right, visitor, ts.isExpression), node), node); + return ts.setTextRange(ts.createAssignment(target, ts.setTextRange(ts.createBinary(cacheExpression(target), getOperatorForCompoundAssignment(operator), ts.visitNode(right, visitor, ts.isExpression)), node)), node); } else { return ts.updateBinary(node, target, ts.visitNode(right, visitor, ts.isExpression)); @@ -43346,10 +48098,10 @@ var ts; else if (node.operatorToken.kind === 25) { return visitCommaExpression(node); } - var clone_4 = ts.getMutableClone(node); - clone_4.left = cacheExpression(ts.visitNode(node.left, visitor, ts.isExpression)); - clone_4.right = ts.visitNode(node.right, visitor, ts.isExpression); - return clone_4; + var clone_5 = ts.getMutableClone(node); + clone_5.left = cacheExpression(ts.visitNode(node.left, visitor, ts.isExpression)); + clone_5.right = ts.visitNode(node.right, visitor, ts.isExpression); + return clone_5; } return ts.visitEachChild(node, visitor, context); } @@ -43405,38 +48157,43 @@ var ts; var resumeLabel = defineLabel(); var expression = ts.visitNode(node.expression, visitor, ts.isExpression); if (node.asteriskToken) { - emitYieldStar(expression, node); + var iterator = (ts.getEmitFlags(node.expression) & 4194304) === 0 + ? ts.createValuesHelper(context, expression, node) + : expression; + emitYieldStar(iterator, node); } else { emitYield(expression, node); } markLabel(resumeLabel); - return createGeneratorResume(); + return createGeneratorResume(node); } function visitArrayLiteralExpression(node) { return visitElements(node.elements, undefined, undefined, node.multiLine); } function visitElements(elements, leadingElement, location, multiLine) { var numInitialElements = countInitialNodesWithoutYield(elements); - var temp = declareLocal(); - var hasAssignedTemp = false; + var temp; if (numInitialElements > 0) { + temp = declareLocal(); var initialElements = ts.visitNodes(elements, visitor, ts.isExpression, 0, numInitialElements); emitAssignment(temp, ts.createArrayLiteral(leadingElement ? [leadingElement].concat(initialElements) : initialElements)); leadingElement = undefined; - hasAssignedTemp = true; } var expressions = ts.reduceLeft(elements, reduceElement, [], numInitialElements); - return hasAssignedTemp - ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, undefined, multiLine)]) - : ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, location, multiLine); + return temp + ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)]) + : ts.setTextRange(ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine), location); function reduceElement(expressions, element) { if (containsYield(element) && expressions.length > 0) { + var hasAssignedTemp = temp !== undefined; + if (!temp) { + temp = declareLocal(); + } emitAssignment(temp, hasAssignedTemp - ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, undefined, multiLine)]) - : ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, undefined, multiLine)); - hasAssignedTemp = true; + ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)]) + : ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine)); leadingElement = undefined; expressions = []; } @@ -43449,7 +48206,7 @@ var ts; var multiLine = node.multiLine; var numInitialProperties = countInitialNodesWithoutYield(properties); var temp = declareLocal(); - emitAssignment(temp, ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), undefined, multiLine)); + emitAssignment(temp, ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), multiLine)); var expressions = ts.reduceLeft(properties, reduceProperty, [], numInitialProperties); expressions.push(multiLine ? ts.startOnNewLine(ts.getMutableClone(temp)) : temp); return ts.inlineExpressions(expressions); @@ -43471,10 +48228,10 @@ var ts; } function visitElementAccessExpression(node) { if (containsYield(node.argumentExpression)) { - var clone_5 = ts.getMutableClone(node); - clone_5.expression = cacheExpression(ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression)); - clone_5.argumentExpression = ts.visitNode(node.argumentExpression, visitor, ts.isExpression); - return clone_5; + var clone_6 = ts.getMutableClone(node); + clone_6.expression = cacheExpression(ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression)); + clone_6.argumentExpression = ts.visitNode(node.argumentExpression, visitor, ts.isExpression); + return clone_6; } return ts.visitEachChild(node, visitor, context); } @@ -43488,7 +48245,7 @@ var ts; function visitNewExpression(node) { if (ts.forEach(node.arguments, containsYield)) { var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; - return ts.setOriginalNode(ts.createNew(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isExpression)), thisArg, visitElements(node.arguments, ts.createVoidZero())), undefined, [], node), node); + return ts.setOriginalNode(ts.setTextRange(ts.createNew(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isExpression)), thisArg, visitElements(node.arguments, ts.createVoidZero())), undefined, []), node), node); } return ts.visitEachChild(node, visitor, context); } @@ -43517,38 +48274,38 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 204: + case 206: return transformAndEmitBlock(node); - case 207: - return transformAndEmitExpressionStatement(node); - case 208: - return transformAndEmitIfStatement(node); case 209: - return transformAndEmitDoStatement(node); + return transformAndEmitExpressionStatement(node); case 210: - return transformAndEmitWhileStatement(node); + return transformAndEmitIfStatement(node); case 211: - return transformAndEmitForStatement(node); + return transformAndEmitDoStatement(node); case 212: - return transformAndEmitForInStatement(node); + return transformAndEmitWhileStatement(node); + case 213: + return transformAndEmitForStatement(node); case 214: - return transformAndEmitContinueStatement(node); - case 215: - return transformAndEmitBreakStatement(node); + return transformAndEmitForInStatement(node); case 216: - return transformAndEmitReturnStatement(node); + return transformAndEmitContinueStatement(node); case 217: - return transformAndEmitWithStatement(node); + return transformAndEmitBreakStatement(node); case 218: - return transformAndEmitSwitchStatement(node); + return transformAndEmitReturnStatement(node); case 219: - return transformAndEmitLabeledStatement(node); + return transformAndEmitWithStatement(node); case 220: - return transformAndEmitThrowStatement(node); + return transformAndEmitSwitchStatement(node); case 221: + return transformAndEmitLabeledStatement(node); + case 222: + return transformAndEmitThrowStatement(node); + case 223: return transformAndEmitTryStatement(node); default: - return emitStatement(ts.visitNode(node, visitor, ts.isStatement, true)); + return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); } } function transformAndEmitBlock(node) { @@ -43565,7 +48322,9 @@ var ts; function transformAndEmitVariableDeclarationList(node) { for (var _i = 0, _a = node.declarations; _i < _a.length; _i++) { var variable = _a[_i]; - hoistVariableDeclaration(variable.name); + var name = ts.getSynthesizedClone(variable.name); + ts.setCommentRange(name, variable.name); + hoistVariableDeclaration(name); } var variables = ts.getInitializedVariables(node); var numVariables = variables.length; @@ -43595,7 +48354,7 @@ var ts; if (containsYield(node.thenStatement) || containsYield(node.elseStatement)) { var endLabel = defineLabel(); var elseLabel = node.elseStatement ? defineLabel() : undefined; - emitBreakWhenFalse(node.elseStatement ? elseLabel : endLabel, ts.visitNode(node.expression, visitor, ts.isExpression)); + emitBreakWhenFalse(node.elseStatement ? elseLabel : endLabel, ts.visitNode(node.expression, visitor, ts.isExpression), node.expression); transformAndEmitEmbeddedStatement(node.thenStatement); if (node.elseStatement) { emitBreak(endLabel); @@ -43674,7 +48433,7 @@ var ts; transformAndEmitVariableDeclarationList(initializer); } else { - emitStatement(ts.createStatement(ts.visitNode(initializer, visitor, ts.isExpression), initializer)); + emitStatement(ts.setTextRange(ts.createStatement(ts.visitNode(initializer, visitor, ts.isExpression)), initializer)); } } markLabel(conditionLabel); @@ -43684,7 +48443,7 @@ var ts; transformAndEmitEmbeddedStatement(node.statement); markLabel(incrementLabel); if (node.incrementor) { - emitStatement(ts.createStatement(ts.visitNode(node.incrementor, visitor, ts.isExpression), node.incrementor)); + emitStatement(ts.setTextRange(ts.createStatement(ts.visitNode(node.incrementor, visitor, ts.isExpression)), node.incrementor)); } emitBreak(conditionLabel); endLoopBlock(); @@ -43698,7 +48457,7 @@ var ts; beginScriptLoopBlock(); } var initializer = node.initializer; - if (ts.isVariableDeclarationList(initializer)) { + if (initializer && ts.isVariableDeclarationList(initializer)) { for (var _i = 0, _a = initializer.declarations; _i < _a.length; _i++) { var variable = _a[_i]; hoistVariableDeclaration(variable.name); @@ -43706,7 +48465,7 @@ var ts; var variables = ts.getInitializedVariables(initializer); node = ts.updateFor(node, variables.length > 0 ? ts.inlineExpressions(ts.map(variables, transformInitializedVariable)) - : undefined, ts.visitNode(node.condition, visitor, ts.isExpression, true), ts.visitNode(node.incrementor, visitor, ts.isExpression, true), ts.visitNode(node.statement, visitor, ts.isStatement, false, ts.liftToBlock)); + : undefined, ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); } else { node = ts.visitEachChild(node, visitor, context); @@ -43764,7 +48523,7 @@ var ts; var variable = _a[_i]; hoistVariableDeclaration(variable.name); } - node = ts.updateForIn(node, initializer.declarations[0].name, ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, false, ts.liftToBlock)); + node = ts.updateForIn(node, initializer.declarations[0].name, ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); } else { node = ts.visitEachChild(node, visitor, context); @@ -43803,10 +48562,10 @@ var ts; return ts.visitEachChild(node, visitor, context); } function transformAndEmitReturnStatement(node) { - emitReturn(ts.visitNode(node.expression, visitor, ts.isExpression, true), node); + emitReturn(ts.visitNode(node.expression, visitor, ts.isExpression), node); } function visitReturnStatement(node) { - return createInlineReturn(ts.visitNode(node.expression, visitor, ts.isExpression, true), node); + return createInlineReturn(ts.visitNode(node.expression, visitor, ts.isExpression), node); } function transformAndEmitWithStatement(node) { if (containsYield(node)) { @@ -43829,7 +48588,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 254 && defaultClauseIndex === -1) { + if (clause.kind === 257 && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -43839,7 +48598,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 253) { + if (clause.kind === 256) { var caseClause = clause; if (containsYield(caseClause.expression) && pendingClauses.length > 0) { break; @@ -43941,9 +48700,9 @@ var ts; } return -1; } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1) { + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1) { return substituteExpression(node); } return node; @@ -43955,17 +48714,17 @@ var ts; return node; } function substituteExpressionIdentifier(node) { - if (renamedCatchVariables && ts.hasProperty(renamedCatchVariables, node.text)) { + if (!ts.isGeneratedIdentifier(node) && renamedCatchVariables && renamedCatchVariables.has(node.text)) { var original = ts.getOriginalNode(node); if (ts.isIdentifier(original) && original.parent) { var declaration = resolver.getReferencedValueDeclaration(original); if (declaration) { - var name_38 = ts.getProperty(renamedCatchVariableDeclarations, String(ts.getOriginalNodeId(declaration))); - if (name_38) { - var clone_6 = ts.getMutableClone(name_38); - ts.setSourceMapRange(clone_6, node); - ts.setCommentRange(clone_6, node); - return clone_6; + var name = renamedCatchVariableDeclarations[ts.getOriginalNodeId(declaration)]; + if (name) { + var clone_7 = ts.getMutableClone(name); + ts.setSourceMapRange(clone_7, node); + ts.setCommentRange(clone_7, node); + return clone_7; } } } @@ -43974,7 +48733,7 @@ var ts; } function cacheExpression(node) { var temp; - if (ts.isGeneratedIdentifier(node)) { + if (ts.isGeneratedIdentifier(node) || ts.getEmitFlags(node) & 4096) { return node; } temp = ts.createTempVariable(hoistVariableDeclaration); @@ -44066,15 +48825,22 @@ var ts; } function beginCatchBlock(variable) { ts.Debug.assert(peekBlockKind() === 0); - var text = variable.name.text; - var name = declareLocal(text); - if (!renamedCatchVariables) { - renamedCatchVariables = ts.createMap(); - renamedCatchVariableDeclarations = ts.createMap(); - context.enableSubstitution(70); + var name; + if (ts.isGeneratedIdentifier(variable.name)) { + name = variable.name; + hoistVariableDeclaration(variable.name); + } + else { + var text = variable.name.text; + name = declareLocal(text); + if (!renamedCatchVariables) { + renamedCatchVariables = ts.createMap(); + renamedCatchVariableDeclarations = []; + context.enableSubstitution(70); + } + renamedCatchVariables.set(text, true); + renamedCatchVariableDeclarations[ts.getOriginalNodeId(variable)] = name; } - renamedCatchVariables[text] = true; - renamedCatchVariableDeclarations[ts.getOriginalNodeId(variable)] = name; var exception = peekBlock(); ts.Debug.assert(exception.state < 1); var endLabel = exception.endLabel; @@ -44274,23 +49040,23 @@ var ts; } function createInstruction(instruction) { var literal = ts.createLiteral(instruction); - literal.trailingComment = instructionNames[instruction]; + ts.addSyntheticTrailingComment(literal, 3, getInstructionName(instruction)); return literal; } function createInlineBreak(label, location) { ts.Debug.assert(label > 0, "Invalid label: " + label); - return ts.createReturn(ts.createArrayLiteral([ + return ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3), createLabel(label) - ]), location); + ])), location); } function createInlineReturn(expression, location) { - return ts.createReturn(ts.createArrayLiteral(expression + return ts.setTextRange(ts.createReturn(ts.createArrayLiteral(expression ? [createInstruction(2), expression] - : [createInstruction(2)]), location); + : [createInstruction(2)])), location); } function createGeneratorResume(location) { - return ts.createCall(ts.createPropertyAccess(state, "sent"), undefined, [], location); + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(state, "sent"), undefined, []), location); } function emitNop() { emitWorker(0); @@ -44356,7 +49122,7 @@ var ts; currentExceptionBlock = undefined; withBlockStack = undefined; var buildResult = buildStatements(); - return createGeneratorHelper(context, ts.setEmitFlags(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, state)], undefined, ts.createBlock(buildResult, undefined, buildResult.length > 0)), 262144)); + return createGeneratorHelper(context, ts.setEmitFlags(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, state)], undefined, ts.createBlock(buildResult, buildResult.length > 0)), 262144)); } function buildStatements() { if (operations) { @@ -44565,51 +49331,51 @@ var ts; } } function writeAssign(left, right, operationLocation) { - writeStatement(ts.createStatement(ts.createAssignment(left, right), operationLocation)); + writeStatement(ts.setTextRange(ts.createStatement(ts.createAssignment(left, right)), operationLocation)); } function writeThrow(expression, operationLocation) { lastOperationWasAbrupt = true; lastOperationWasCompletion = true; - writeStatement(ts.createThrow(expression, operationLocation)); + writeStatement(ts.setTextRange(ts.createThrow(expression), operationLocation)); } function writeReturn(expression, operationLocation) { lastOperationWasAbrupt = true; lastOperationWasCompletion = true; - writeStatement(ts.createReturn(ts.createArrayLiteral(expression + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral(expression ? [createInstruction(2), expression] - : [createInstruction(2)]), operationLocation)); + : [createInstruction(2)])), operationLocation), 384)); } function writeBreak(label, operationLocation) { lastOperationWasAbrupt = true; - writeStatement(ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3), createLabel(label) - ]), operationLocation)); + ])), operationLocation), 384)); } function writeBreakWhenTrue(label, condition, operationLocation) { - writeStatement(ts.createIf(condition, ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.createIf(condition, ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3), createLabel(label) - ]), operationLocation))); + ])), operationLocation), 384)), 1)); } function writeBreakWhenFalse(label, condition, operationLocation) { - writeStatement(ts.createIf(ts.createLogicalNot(condition), ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.createIf(ts.createLogicalNot(condition), ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3), createLabel(label) - ]), operationLocation))); + ])), operationLocation), 384)), 1)); } function writeYield(expression, operationLocation) { lastOperationWasAbrupt = true; - writeStatement(ts.createReturn(ts.createArrayLiteral(expression + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral(expression ? [createInstruction(4), expression] - : [createInstruction(4)]), operationLocation)); + : [createInstruction(4)])), operationLocation), 384)); } function writeYieldStar(expression, operationLocation) { lastOperationWasAbrupt = true; - writeStatement(ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(5), expression - ]), operationLocation)); + ])), operationLocation), 384)); } function writeEndfinally() { lastOperationWasAbrupt = true; @@ -44627,23 +49393,47 @@ var ts; name: "typescript:generator", scoped: false, priority: 6, - text: "\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;\n return { next: verb(0), \"throw\": verb(1), \"return\": verb(2) };\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [0, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };" + text: "\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [0, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };" }; - var _a; })(ts || (ts = {})); var ts; (function (ts) { function transformES5(context) { + var compilerOptions = context.getCompilerOptions(); + var previousOnEmitNode; + var noSubstitution; + if (compilerOptions.jsx === 1 || compilerOptions.jsx === 3) { + previousOnEmitNode = context.onEmitNode; + context.onEmitNode = onEmitNode; + context.enableEmitNotification(250); + context.enableEmitNotification(251); + context.enableEmitNotification(249); + noSubstitution = []; + } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(177); - context.enableSubstitution(257); + context.enableSubstitution(178); + context.enableSubstitution(260); return transformSourceFile; function transformSourceFile(node) { return node; } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); + function onEmitNode(hint, node, emitCallback) { + switch (node.kind) { + case 250: + case 251: + case 249: + var tagName = node.tagName; + noSubstitution[ts.getOriginalNodeId(tagName)] = true; + break; + } + previousOnEmitNode(hint, node, emitCallback); + } + function onSubstituteNode(hint, node) { + if (node.id && noSubstitution && noSubstitution[node.id]) { + return previousOnSubstituteNode(hint, node); + } + node = previousOnSubstituteNode(hint, node); if (ts.isPropertyAccessExpression(node)) { return substitutePropertyAccessExpression(node); } @@ -44655,7 +49445,7 @@ var ts; function substitutePropertyAccessExpression(node) { var literalName = trySubstituteReservedName(node.name); if (literalName) { - return ts.createElementAccess(node.expression, literalName, node); + return ts.setTextRange(ts.createElementAccess(node.expression, literalName), node); } return node; } @@ -44669,7 +49459,7 @@ var ts; function trySubstituteReservedName(name) { var token = name.originalKeywordKind || (ts.nodeIsSynthesized(name) ? ts.stringToToken(name.text) : undefined); if (token >= 71 && token <= 106) { - return ts.createLiteral(name, name); + return ts.setTextRange(ts.createLiteral(name), name); } return undefined; } @@ -44679,12 +49469,13 @@ var ts; var ts; (function (ts) { function transformModule(context) { - var transformModuleDelegates = ts.createMap((_a = {}, - _a[ts.ModuleKind.None] = transformCommonJSModule, - _a[ts.ModuleKind.CommonJS] = transformCommonJSModule, - _a[ts.ModuleKind.AMD] = transformAMDModule, - _a[ts.ModuleKind.UMD] = transformUMDModule, - _a)); + function getTransformModuleDelegate(moduleKind) { + switch (moduleKind) { + case ts.ModuleKind.AMD: return transformAMDModule; + case ts.ModuleKind.UMD: return transformUMDModule; + default: return transformCommonJSModule; + } + } var startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; var compilerOptions = context.getCompilerOptions(); var resolver = context.getEmitResolver(); @@ -44696,40 +49487,49 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(70); - context.enableSubstitution(192); - context.enableSubstitution(190); + context.enableSubstitution(193); context.enableSubstitution(191); - context.enableSubstitution(258); - context.enableEmitNotification(261); - var moduleInfoMap = ts.createMap(); - var deferredExports = ts.createMap(); + context.enableSubstitution(192); + context.enableSubstitution(261); + context.enableEmitNotification(264); + var moduleInfoMap = []; + var deferredExports = []; var currentSourceFile; var currentModuleInfo; var noSubstitution; return transformSourceFile; function transformSourceFile(node) { - if (ts.isDeclarationFile(node) - || !(ts.isExternalModule(node) - || compilerOptions.isolatedModules)) { + if (ts.isDeclarationFile(node) || !(ts.isExternalModule(node) || compilerOptions.isolatedModules)) { return node; } currentSourceFile = node; - currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(node)] = ts.collectExternalModuleInfo(node, resolver, compilerOptions); - var transformModule = transformModuleDelegates[moduleKind] || transformModuleDelegates[ts.ModuleKind.None]; + currentModuleInfo = ts.collectExternalModuleInfo(node, resolver, compilerOptions); + moduleInfoMap[ts.getOriginalNodeId(node)] = currentModuleInfo; + var transformModule = getTransformModuleDelegate(moduleKind); var updated = transformModule(node); currentSourceFile = undefined; currentModuleInfo = undefined; return ts.aggregateTransformFlags(updated); } + function shouldEmitUnderscoreUnderscoreESModule() { + if (!currentModuleInfo.exportEquals && ts.isExternalModule(currentSourceFile)) { + return true; + } + return false; + } function transformCommonJSModule(node) { startLexicalEnvironment(); var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.statements, !compilerOptions.noImplicitUseStrict, sourceElementVisitor); - ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement, true)); + var ensureUseStrict = compilerOptions.alwaysStrict || (!compilerOptions.noImplicitUseStrict && ts.isExternalModule(currentSourceFile)); + var statementOffset = ts.addPrologue(statements, node.statements, ensureUseStrict, sourceElementVisitor); + if (shouldEmitUnderscoreUnderscoreESModule()) { + ts.append(statements, createUnderscoreUnderscoreESModule()); + } + ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement)); ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); - ts.addRange(statements, endLexicalEnvironment()); addExportEqualsIfNeeded(statements, false); - var updated = ts.updateSourceFileNode(node, ts.createNodeArray(statements, node.statements)); + ts.addRange(statements, endLexicalEnvironment()); + var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements)); if (currentModuleInfo.hasExportStarsToExportValues) { ts.addEmitHelper(updated, exportStarHelper); } @@ -44738,15 +49538,8 @@ var ts; function transformAMDModule(node) { var define = ts.createIdentifier("define"); var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions); - return transformAsynchronousModule(node, define, moduleName, true); - } - function transformUMDModule(node) { - var define = ts.createRawExpression(umdHelper); - return transformAsynchronousModule(node, define, undefined, false); - } - function transformAsynchronousModule(node, define, moduleName, includeNonAmdDependencies) { - var _a = collectAsynchronousDependencies(node, includeNonAmdDependencies), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames; - return ts.updateSourceFileNode(node, ts.createNodeArray([ + var _a = collectAsynchronousDependencies(node, true), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames; + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ ts.createStatement(ts.createCall(define, undefined, (moduleName ? [moduleName] : []).concat([ ts.createArrayLiteral([ ts.createLiteral("require"), @@ -44757,7 +49550,37 @@ var ts; ts.createParameter(undefined, undefined, undefined, "exports") ].concat(importAliasNames), undefined, transformAsynchronousModuleBody(node)) ]))) - ], node.statements)); + ]), node.statements)); + } + function transformUMDModule(node) { + var _a = collectAsynchronousDependencies(node, false), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames; + var umdHeader = ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, "factory")], undefined, ts.setTextRange(ts.createBlock([ + ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier("module"), "object"), ts.createTypeCheck(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), "object")), ts.createBlock([ + ts.createVariableStatement(undefined, [ + ts.createVariableDeclaration("v", undefined, ts.createCall(ts.createIdentifier("factory"), undefined, [ + ts.createIdentifier("require"), + ts.createIdentifier("exports") + ])) + ]), + ts.setEmitFlags(ts.createIf(ts.createStrictInequality(ts.createIdentifier("v"), ts.createIdentifier("undefined")), ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), ts.createIdentifier("v")))), 1) + ]), ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier("define"), "function"), ts.createPropertyAccess(ts.createIdentifier("define"), "amd")), ts.createBlock([ + ts.createStatement(ts.createCall(ts.createIdentifier("define"), undefined, [ + ts.createArrayLiteral([ + ts.createLiteral("require"), + ts.createLiteral("exports") + ].concat(aliasedModuleNames, unaliasedModuleNames)), + ts.createIdentifier("factory") + ])) + ]))) + ], true), undefined)); + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ + ts.createStatement(ts.createCall(umdHeader, undefined, [ + ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ + ts.createParameter(undefined, undefined, undefined, "require"), + ts.createParameter(undefined, undefined, undefined, "exports") + ].concat(importAliasNames), undefined, transformAsynchronousModuleBody(node)) + ])) + ]), node.statements)); } function collectAsynchronousDependencies(node, includeNonAmdDependencies) { var aliasedModuleNames = []; @@ -44777,13 +49600,15 @@ var ts; var importNode = _c[_b]; var externalModuleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions); var importAliasName = ts.getLocalNameForExternalImport(importNode, currentSourceFile); - if (includeNonAmdDependencies && importAliasName) { - ts.setEmitFlags(importAliasName, 4); - aliasedModuleNames.push(externalModuleName); - importAliasNames.push(ts.createParameter(undefined, undefined, undefined, importAliasName)); - } - else { - unaliasedModuleNames.push(externalModuleName); + if (externalModuleName) { + if (includeNonAmdDependencies && importAliasName) { + ts.setEmitFlags(importAliasName, 4); + aliasedModuleNames.push(externalModuleName); + importAliasNames.push(ts.createParameter(undefined, undefined, undefined, importAliasName)); + } + else { + unaliasedModuleNames.push(externalModuleName); + } } } return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames }; @@ -44791,12 +49616,15 @@ var ts; function transformAsynchronousModuleBody(node) { startLexicalEnvironment(); var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.statements, !compilerOptions.noImplicitUseStrict, sourceElementVisitor); - ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement, true)); + var statementOffset = ts.addPrologue(statements, node.statements, !compilerOptions.noImplicitUseStrict, sourceElementVisitor); + if (shouldEmitUnderscoreUnderscoreESModule()) { + ts.append(statements, createUnderscoreUnderscoreESModule()); + } + ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement)); ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); - ts.addRange(statements, endLexicalEnvironment()); addExportEqualsIfNeeded(statements, true); - var body = ts.createBlock(statements, undefined, true); + ts.addRange(statements, endLexicalEnvironment()); + var body = ts.createBlock(statements, true); if (currentModuleInfo.hasExportStarsToExportValues) { ts.addEmitHelper(body, exportStarHelper); } @@ -44805,12 +49633,14 @@ var ts; function addExportEqualsIfNeeded(statements, emitAsReturn) { if (currentModuleInfo.exportEquals) { if (emitAsReturn) { - var statement = ts.createReturn(currentModuleInfo.exportEquals.expression, currentModuleInfo.exportEquals); + var statement = ts.createReturn(currentModuleInfo.exportEquals.expression); + ts.setTextRange(statement, currentModuleInfo.exportEquals); ts.setEmitFlags(statement, 384 | 1536); statements.push(statement); } else { - var statement = ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), currentModuleInfo.exportEquals.expression), currentModuleInfo.exportEquals); + var statement = ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), currentModuleInfo.exportEquals.expression)); + ts.setTextRange(statement, currentModuleInfo.exportEquals); ts.setEmitFlags(statement, 1536); statements.push(statement); } @@ -44818,23 +49648,23 @@ var ts; } function sourceElementVisitor(node) { switch (node.kind) { - case 235: + case 237: return visitImportDeclaration(node); - case 234: + case 236: return visitImportEqualsDeclaration(node); - case 241: + case 243: return visitExportDeclaration(node); - case 240: + case 242: return visitExportAssignment(node); - case 205: + case 207: return visitVariableStatement(node); - case 225: + case 227: return visitFunctionDeclaration(node); - case 226: + case 228: return visitClassDeclaration(node); - case 295: - return visitMergeDeclarationMarker(node); case 296: + return visitMergeDeclarationMarker(node); + case 297: return visitEndOfDeclarationMarker(node); default: return node; @@ -44845,7 +49675,7 @@ var ts; var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); if (moduleKind !== ts.ModuleKind.AMD) { if (!node.importClause) { - return ts.createStatement(createRequireCall(node), node); + return ts.setTextRange(ts.createStatement(createRequireCall(node)), node); } else { var variables = []; @@ -44858,13 +49688,13 @@ var ts; variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, ts.getGeneratedNameForNode(node))); } } - statements = ts.append(statements, ts.createVariableStatement(undefined, ts.createVariableDeclarationList(variables, undefined, languageVersion >= 2 ? 2 : 0), node)); + statements = ts.append(statements, ts.setTextRange(ts.createVariableStatement(undefined, ts.createVariableDeclarationList(variables, languageVersion >= 2 ? 2 : 0)), node)); } } else if (namespaceDeclaration && ts.isDefaultImport(node)) { statements = ts.append(statements, ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ - ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, ts.getGeneratedNameForNode(node), node) - ], undefined, languageVersion >= 2 ? 2 : 0))); + ts.setTextRange(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, ts.getGeneratedNameForNode(node)), node) + ], languageVersion >= 2 ? 2 : 0))); } if (hasAssociatedEndOfDeclarationMarker(node)) { var id = ts.getOriginalNodeId(node); @@ -44888,17 +49718,17 @@ var ts; var statements; if (moduleKind !== ts.ModuleKind.AMD) { if (ts.hasModifier(node, 1)) { - statements = ts.append(statements, ts.createStatement(createExportExpression(node.name, createRequireCall(node)), node)); + statements = ts.append(statements, ts.setTextRange(ts.createStatement(createExportExpression(node.name, createRequireCall(node))), node)); } else { - statements = ts.append(statements, ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ + statements = ts.append(statements, ts.setTextRange(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ ts.createVariableDeclaration(ts.getSynthesizedClone(node.name), undefined, createRequireCall(node)) - ], undefined, languageVersion >= 2 ? 2 : 0), node)); + ], languageVersion >= 2 ? 2 : 0)), node)); } } else { if (ts.hasModifier(node, 1)) { - statements = ts.append(statements, ts.createStatement(createExportExpression(ts.getExportName(node), ts.getLocalName(node)), node)); + statements = ts.append(statements, ts.setTextRange(ts.createStatement(createExportExpression(ts.getExportName(node), ts.getLocalName(node))), node)); } } if (hasAssociatedEndOfDeclarationMarker(node)) { @@ -44918,23 +49748,23 @@ var ts; if (node.exportClause) { var statements = []; if (moduleKind !== ts.ModuleKind.AMD) { - statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ + statements.push(ts.setTextRange(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ ts.createVariableDeclaration(generatedName, undefined, createRequireCall(node)) - ]), node)); + ])), node)); } for (var _i = 0, _a = node.exportClause.elements; _i < _a.length; _i++) { var specifier = _a[_i]; var exportedValue = ts.createPropertyAccess(generatedName, specifier.propertyName || specifier.name); - statements.push(ts.createStatement(createExportExpression(ts.getExportName(specifier), exportedValue), specifier)); + statements.push(ts.setTextRange(ts.createStatement(createExportExpression(ts.getExportName(specifier), exportedValue)), specifier)); } return ts.singleOrMany(statements); } else { - return ts.createStatement(ts.createCall(ts.createIdentifier("__export"), undefined, [ + return ts.setTextRange(ts.createStatement(ts.createCall(ts.createIdentifier("__export"), undefined, [ moduleKind !== ts.ModuleKind.AMD ? createRequireCall(node) : generatedName - ]), node); + ])), node); } } function visitExportAssignment(node) { @@ -44955,7 +49785,7 @@ var ts; function visitFunctionDeclaration(node) { var statements; if (ts.hasModifier(node, 1)) { - statements = ts.append(statements, ts.setOriginalNode(ts.createFunctionDeclaration(undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, ts.getDeclarationName(node, true, true), undefined, node.parameters, undefined, node.body, node), node)); + statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(ts.createFunctionDeclaration(undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, ts.getDeclarationName(node, true, true), undefined, node.parameters, undefined, node.body), node), node)); } else { statements = ts.append(statements, node); @@ -44972,7 +49802,7 @@ var ts; function visitClassDeclaration(node) { var statements; if (ts.hasModifier(node, 1)) { - statements = ts.append(statements, ts.setOriginalNode(ts.createClassDeclaration(undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.getDeclarationName(node, true, true), undefined, node.heritageClauses, node.members, node), node)); + statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(ts.createClassDeclaration(undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.getDeclarationName(node, true, true), undefined, node.heritageClauses, node.members), node), node)); } else { statements = ts.append(statements, node); @@ -45008,7 +49838,7 @@ var ts; statements = ts.append(statements, ts.updateVariableStatement(node, modifiers, ts.updateVariableDeclarationList(node.declarationList, variables))); } if (expressions) { - statements = ts.append(statements, ts.createStatement(ts.inlineExpressions(expressions), node)); + statements = ts.append(statements, ts.setTextRange(ts.createStatement(ts.inlineExpressions(expressions)), node)); } } else { @@ -45028,11 +49858,11 @@ var ts; return ts.flattenDestructuringAssignment(node, undefined, context, 0, false, createExportExpression); } else { - return ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("exports"), node.name, node.name), node.initializer); + return ts.createAssignment(ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), node.name), node.name), node.initializer); } } function visitMergeDeclarationMarker(node) { - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 205) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 207) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -45064,10 +49894,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 237: + case 239: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 238: + case 240: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -45125,7 +49955,7 @@ var ts; } function appendExportsOfDeclaration(statements, decl) { var name = ts.getDeclarationName(decl); - var exportSpecifiers = currentModuleInfo.exportSpecifiers[name.text]; + var exportSpecifiers = currentModuleInfo.exportSpecifiers.get(name.text); if (exportSpecifiers) { for (var _i = 0, exportSpecifiers_1 = exportSpecifiers; _i < exportSpecifiers_1.length; _i++) { var exportSpecifier = exportSpecifiers_1[_i]; @@ -45135,28 +49965,28 @@ var ts; return statements; } function appendExportStatement(statements, exportName, expression, location, allowComments) { - if (exportName.text === "default") { - var sourceFile = ts.getOriginalNode(currentSourceFile, ts.isSourceFile); - if (sourceFile && !sourceFile.symbol.exports["___esModule"]) { - if (languageVersion === 0) { - statements = ts.append(statements, ts.createStatement(createExportExpression(ts.createIdentifier("__esModule"), ts.createLiteral(true)))); - } - else { - statements = ts.append(statements, ts.createStatement(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), undefined, [ - ts.createIdentifier("exports"), - ts.createLiteral("__esModule"), - ts.createObjectLiteral([ - ts.createPropertyAssignment("value", ts.createLiteral(true)) - ]) - ]))); - } - } - } statements = ts.append(statements, createExportStatement(exportName, expression, location, allowComments)); return statements; } + function createUnderscoreUnderscoreESModule() { + var statement; + if (languageVersion === 0) { + statement = ts.createStatement(createExportExpression(ts.createIdentifier("__esModule"), ts.createLiteral(true))); + } + else { + statement = ts.createStatement(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), undefined, [ + ts.createIdentifier("exports"), + ts.createLiteral("__esModule"), + ts.createObjectLiteral([ + ts.createPropertyAssignment("value", ts.createLiteral(true)) + ]) + ])); + } + ts.setEmitFlags(statement, 524288); + return statement; + } function createExportStatement(name, value, location, allowComments) { - var statement = ts.createStatement(createExportExpression(name, value), location); + var statement = ts.setTextRange(ts.createStatement(createExportExpression(name, value)), location); ts.startOnNewLine(statement); if (!allowComments) { ts.setEmitFlags(statement, 1536); @@ -45164,7 +49994,7 @@ var ts; return statement; } function createExportExpression(name, value, location) { - return ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(name)), value, location); + return ts.setTextRange(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(name)), value), location); } function modifierVisitor(node) { switch (node.kind) { @@ -45174,26 +50004,26 @@ var ts; } return node; } - function onEmitNode(emitContext, node, emitCallback) { - if (node.kind === 261) { + function onEmitNode(hint, node, emitCallback) { + if (node.kind === 264) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; - noSubstitution = ts.createMap(); - previousOnEmitNode(emitContext, node, emitCallback); + noSubstitution = []; + previousOnEmitNode(hint, node, emitCallback); currentSourceFile = undefined; currentModuleInfo = undefined; noSubstitution = undefined; } else { - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); } } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); if (node.id && noSubstitution[node.id]) { return node; } - if (emitContext === 1) { + if (hint === 1) { return substituteExpression(node); } else if (ts.isShorthandPropertyAssignment(node)) { @@ -45207,9 +50037,9 @@ var ts; if (exportedOrImportedName !== name) { if (node.objectAssignmentInitializer) { var initializer = ts.createAssignment(exportedOrImportedName, node.objectAssignmentInitializer); - return ts.createPropertyAssignment(name, initializer, node); + return ts.setTextRange(ts.createPropertyAssignment(name, initializer), node); } - return ts.createPropertyAssignment(name, exportedOrImportedName, node); + return ts.setTextRange(ts.createPropertyAssignment(name, exportedOrImportedName), node); } return node; } @@ -45217,10 +50047,10 @@ var ts; switch (node.kind) { case 70: return substituteExpressionIdentifier(node); - case 192: + case 193: return substituteBinaryExpression(node); + case 192: case 191: - case 190: return substituteUnaryExpression(node); } return node; @@ -45235,17 +50065,17 @@ var ts; } if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 261) { - return ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node), node); + if (exportContainer && exportContainer.kind === 264) { + return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), node); } var importDeclaration = resolver.getReferencedImportDeclaration(node); if (importDeclaration) { if (ts.isImportClause(importDeclaration)) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default"), node); + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default")), node); } else if (ts.isImportSpecifier(importDeclaration)) { - var name_39 = importDeclaration.propertyName || importDeclaration.name; - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(name_39), node); + var name = importDeclaration.propertyName || importDeclaration.name; + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(name)), node); } } } @@ -45278,8 +50108,8 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 191 - ? ts.createBinary(node.operand, ts.createToken(node.operator === 42 ? 58 : 59), ts.createLiteral(1), node) + var expression = node.kind === 192 + ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 42 ? 58 : 59), ts.createLiteral(1)), node) : node; for (var _i = 0, exportedNames_2 = exportedNames; _i < exportedNames_2.length; _i++) { var exportName = exportedNames_2[_i]; @@ -45301,7 +50131,6 @@ var ts; } } } - var _a; } ts.transformModule = transformModule; var exportStarHelper = { @@ -45309,7 +50138,6 @@ var ts; scoped: true, text: "\n function __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n }" }; - var umdHelper = "\n (function (dependencies, factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define(dependencies, factory);\n }\n })"; })(ts || (ts = {})); var ts; (function (ts) { @@ -45323,14 +50151,14 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(70); - context.enableSubstitution(192); - context.enableSubstitution(190); + context.enableSubstitution(193); context.enableSubstitution(191); - context.enableEmitNotification(261); - var moduleInfoMap = ts.createMap(); - var deferredExports = ts.createMap(); - var exportFunctionsMap = ts.createMap(); - var noSubstitutionMap = ts.createMap(); + context.enableSubstitution(192); + context.enableEmitNotification(264); + var moduleInfoMap = []; + var deferredExports = []; + var exportFunctionsMap = []; + var noSubstitutionMap = []; var currentSourceFile; var moduleInfo; var exportFunction; @@ -45349,7 +50177,8 @@ var ts; currentSourceFile = node; enclosingBlockScopedContainer = node; moduleInfo = moduleInfoMap[id] = ts.collectExternalModuleInfo(node, resolver, compilerOptions); - exportFunction = exportFunctionsMap[id] = ts.createUniqueName("exports"); + exportFunction = ts.createUniqueName("exports"); + exportFunctionsMap[id] = exportFunction; contextObject = ts.createUniqueName("context"); var dependencyGroups = collectDependencyGroups(moduleInfo.externalImports); var moduleBodyBlock = createSystemModuleBody(node, dependencyGroups); @@ -45359,11 +50188,11 @@ var ts; ], undefined, moduleBodyBlock); var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions); var dependencies = ts.createArrayLiteral(ts.map(dependencyGroups, function (dependencyGroup) { return dependencyGroup.name; })); - var updated = ts.updateSourceFileNode(node, ts.createNodeArray([ + var updated = ts.setEmitFlags(ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ ts.createStatement(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("System"), "register"), undefined, moduleName ? [moduleName, dependencies, moduleBodyFunction] : [dependencies, moduleBodyFunction])) - ], node.statements)); + ]), node.statements)), 1024); if (!(compilerOptions.outFile || compilerOptions.out)) { ts.moveEmitHelpers(updated, moduleBodyBlock, function (helper) { return !helper.scoped; }); } @@ -45385,17 +50214,19 @@ var ts; for (var i = 0; i < externalImports.length; i++) { var externalImport = externalImports[i]; var externalModuleName = ts.getExternalModuleNameLiteral(externalImport, currentSourceFile, host, resolver, compilerOptions); - var text = externalModuleName.text; - if (ts.hasProperty(groupIndices, text)) { - var groupIndex = groupIndices[text]; - dependencyGroups[groupIndex].externalImports.push(externalImport); - } - else { - groupIndices[text] = dependencyGroups.length; - dependencyGroups.push({ - name: externalModuleName, - externalImports: [externalImport] - }); + if (externalModuleName) { + var text = externalModuleName.text; + var groupIndex = groupIndices.get(text); + if (groupIndex !== undefined) { + dependencyGroups[groupIndex].externalImports.push(externalImport); + } + else { + groupIndices.set(text, dependencyGroups.length); + dependencyGroups.push({ + name: externalModuleName, + externalImports: [externalImport] + }); + } } } return dependencyGroups; @@ -45403,30 +50234,33 @@ var ts; function createSystemModuleBody(node, dependencyGroups) { var statements = []; startLexicalEnvironment(); - var statementOffset = ts.addPrologueDirectives(statements, node.statements, !compilerOptions.noImplicitUseStrict, sourceElementVisitor); + var ensureUseStrict = compilerOptions.alwaysStrict || (!compilerOptions.noImplicitUseStrict && ts.isExternalModule(currentSourceFile)); + var statementOffset = ts.addPrologue(statements, node.statements, ensureUseStrict, sourceElementVisitor); statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ ts.createVariableDeclaration("__moduleName", undefined, ts.createLogicalAnd(contextObject, ts.createPropertyAccess(contextObject, "id"))) ]))); - ts.visitNode(moduleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement, true); + ts.visitNode(moduleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement); var executeStatements = ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset); ts.addRange(statements, hoistedStatements); ts.addRange(statements, endLexicalEnvironment()); var exportStarFunction = addExportStarIfNeeded(statements); - statements.push(ts.createReturn(ts.setMultiLine(ts.createObjectLiteral([ + var moduleObject = ts.createObjectLiteral([ ts.createPropertyAssignment("setters", createSettersArray(exportStarFunction, dependencyGroups)), - ts.createPropertyAssignment("execute", ts.createFunctionExpression(undefined, undefined, undefined, undefined, [], undefined, ts.createBlock(executeStatements, undefined, true))) - ]), true))); - return ts.createBlock(statements, undefined, true); + ts.createPropertyAssignment("execute", ts.createFunctionExpression(undefined, undefined, undefined, undefined, [], undefined, ts.createBlock(executeStatements, true))) + ]); + moduleObject.multiLine = true; + statements.push(ts.createReturn(moduleObject)); + return ts.createBlock(statements, true); } function addExportStarIfNeeded(statements) { if (!moduleInfo.hasExportStarsToExportValues) { return; } - if (!moduleInfo.exportedNames && ts.isEmpty(moduleInfo.exportSpecifiers)) { + if (!moduleInfo.exportedNames && moduleInfo.exportSpecifiers.size === 0) { var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 241 && externalImport.exportClause) { + if (externalImport.kind === 243 && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -45444,12 +50278,12 @@ var ts; if (exportedLocalName.text === "default") { continue; } - exportedNames.push(ts.createPropertyAssignment(ts.createLiteral(exportedLocalName), ts.createLiteral(true))); + exportedNames.push(ts.createPropertyAssignment(ts.createLiteral(exportedLocalName), ts.createTrue())); } } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 241) { + if (externalImport.kind !== 243) { continue; } var exportDecl = externalImport; @@ -45458,12 +50292,12 @@ var ts; } for (var _f = 0, _g = exportDecl.exportClause.elements; _f < _g.length; _f++) { var element = _g[_f]; - exportedNames.push(ts.createPropertyAssignment(ts.createLiteral((element.name || element.propertyName).text), ts.createLiteral(true))); + exportedNames.push(ts.createPropertyAssignment(ts.createLiteral((element.name || element.propertyName).text), ts.createTrue())); } } var exportedNamesStorageRef = ts.createUniqueName("exportedNames"); statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ - ts.createVariableDeclaration(exportedNamesStorageRef, undefined, ts.createObjectLiteral(exportedNames, undefined, true)) + ts.createVariableDeclaration(exportedNamesStorageRef, undefined, ts.createObjectLiteral(exportedNames, true)) ]))); var exportStarFunction = createExportStarFunction(exportedNamesStorageRef); statements.push(exportStarFunction); @@ -45488,7 +50322,7 @@ var ts; ts.setEmitFlags(ts.createIf(condition, ts.createStatement(ts.createAssignment(ts.createElementAccess(exports, n), ts.createElementAccess(m, n)))), 1) ])), ts.createStatement(ts.createCall(exportFunction, undefined, [exports])) - ], undefined, true)); + ], true)); } function createSettersArray(exportStarFunction, dependencyGroups) { var setters = []; @@ -45501,15 +50335,15 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); switch (entry.kind) { - case 235: + case 237: if (!entry.importClause) { break; } - case 234: + case 236: ts.Debug.assert(importVariableName !== undefined); statements.push(ts.createStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 241: + case 243: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { var properties = []; @@ -45517,7 +50351,7 @@ var ts; var e = _d[_c]; properties.push(ts.createPropertyAssignment(ts.createLiteral(e.name.text), ts.createElementAccess(parameterName, ts.createLiteral((e.propertyName || e.name).text)))); } - statements.push(ts.createStatement(ts.createCall(exportFunction, undefined, [ts.createObjectLiteral(properties, undefined, true)]))); + statements.push(ts.createStatement(ts.createCall(exportFunction, undefined, [ts.createObjectLiteral(properties, true)]))); } else { statements.push(ts.createStatement(ts.createCall(exportStarFunction, undefined, [parameterName]))); @@ -45525,19 +50359,19 @@ var ts; break; } } - setters.push(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, parameterName)], undefined, ts.createBlock(statements, undefined, true))); + setters.push(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(undefined, undefined, undefined, parameterName)], undefined, ts.createBlock(statements, true))); } - return ts.createArrayLiteral(setters, undefined, true); + return ts.createArrayLiteral(setters, true); } function sourceElementVisitor(node) { switch (node.kind) { - case 235: + case 237: return visitImportDeclaration(node); - case 234: + case 236: return visitImportEqualsDeclaration(node); - case 241: + case 243: return undefined; - case 240: + case 242: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -45586,7 +50420,7 @@ var ts; } function visitFunctionDeclaration(node) { if (ts.hasModifier(node, 1)) { - hoistedStatements = ts.append(hoistedStatements, ts.updateFunctionDeclaration(node, node.decorators, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.getDeclarationName(node, true, true), undefined, ts.visitNodes(node.parameters, destructuringVisitor, ts.isParameterDeclaration), undefined, ts.visitNode(node.body, destructuringVisitor, ts.isBlock))); + hoistedStatements = ts.append(hoistedStatements, ts.updateFunctionDeclaration(node, node.decorators, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, ts.getDeclarationName(node, true, true), undefined, ts.visitNodes(node.parameters, destructuringVisitor, ts.isParameterDeclaration), undefined, ts.visitNode(node.body, destructuringVisitor, ts.isBlock))); } else { hoistedStatements = ts.append(hoistedStatements, node); @@ -45604,7 +50438,7 @@ var ts; var statements; var name = ts.getLocalName(node); hoistVariableDeclaration(name); - statements = ts.append(statements, ts.createStatement(ts.createAssignment(name, ts.createClassExpression(undefined, node.name, undefined, ts.visitNodes(node.heritageClauses, destructuringVisitor, ts.isHeritageClause), ts.visitNodes(node.members, destructuringVisitor, ts.isClassElement), node)), node)); + statements = ts.append(statements, ts.setTextRange(ts.createStatement(ts.createAssignment(name, ts.setTextRange(ts.createClassExpression(undefined, node.name, undefined, ts.visitNodes(node.heritageClauses, destructuringVisitor, ts.isHeritageClause), ts.visitNodes(node.members, destructuringVisitor, ts.isClassElement)), node))), node)); if (hasAssociatedEndOfDeclarationMarker(node)) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node); @@ -45632,7 +50466,7 @@ var ts; } var statements; if (expressions) { - statements = ts.append(statements, ts.createStatement(ts.inlineExpressions(expressions), node)); + statements = ts.append(statements, ts.setTextRange(ts.createStatement(ts.inlineExpressions(expressions)), node)); } if (isMarkedDeclaration) { var id = ts.getOriginalNodeId(node); @@ -45658,7 +50492,7 @@ var ts; } function shouldHoistVariableDeclarationList(node) { return (ts.getEmitFlags(node) & 1048576) === 0 - && (enclosingBlockScopedContainer.kind === 261 + && (enclosingBlockScopedContainer.kind === 264 || (ts.getOriginalNode(node).flags & 3) === 0); } function transformInitializedVariable(node, isExportedDeclaration) { @@ -45676,11 +50510,11 @@ var ts; function createVariableAssignment(name, value, location, isExportedDeclaration) { hoistVariableDeclaration(ts.getSynthesizedClone(name)); return isExportedDeclaration - ? createExportExpression(name, preventSubstitution(ts.createAssignment(name, value, location))) - : preventSubstitution(ts.createAssignment(name, value, location)); + ? createExportExpression(name, preventSubstitution(ts.setTextRange(ts.createAssignment(name, value), location))) + : preventSubstitution(ts.setTextRange(ts.createAssignment(name, value), location)); } function visitMergeDeclarationMarker(node) { - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 205) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 207) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -45713,10 +50547,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 237: + case 239: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 238: + case 240: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -45786,7 +50620,7 @@ var ts; return statements; } var name = ts.getDeclarationName(decl); - var exportSpecifiers = moduleInfo.exportSpecifiers[name.text]; + var exportSpecifiers = moduleInfo.exportSpecifiers.get(name.text); if (exportSpecifiers) { for (var _i = 0, exportSpecifiers_2 = exportSpecifiers; _i < exportSpecifiers_2.length; _i++) { var exportSpecifier = exportSpecifiers_2[_i]; @@ -45815,43 +50649,43 @@ var ts; } function nestedElementVisitor(node) { switch (node.kind) { - case 205: + case 207: return visitVariableStatement(node); - case 225: + case 227: return visitFunctionDeclaration(node); - case 226: + case 228: return visitClassDeclaration(node); - case 211: - return visitForStatement(node); - case 212: - return visitForInStatement(node); case 213: + return visitForStatement(node); + case 214: + return visitForInStatement(node); + case 215: return visitForOfStatement(node); - case 209: + case 211: return visitDoStatement(node); - case 210: + case 212: return visitWhileStatement(node); - case 219: - return visitLabeledStatement(node); - case 217: - return visitWithStatement(node); - case 218: - return visitSwitchStatement(node); - case 232: - return visitCaseBlock(node); - case 253: - return visitCaseClause(node); - case 254: - return visitDefaultClause(node); case 221: - return visitTryStatement(node); + return visitLabeledStatement(node); + case 219: + return visitWithStatement(node); + case 220: + return visitSwitchStatement(node); + case 234: + return visitCaseBlock(node); case 256: + return visitCaseClause(node); + case 257: + return visitDefaultClause(node); + case 223: + return visitTryStatement(node); + case 259: return visitCatchClause(node); - case 204: + case 206: return visitBlock(node); - case 295: - return visitMergeDeclarationMarker(node); case 296: + return visitMergeDeclarationMarker(node); + case 297: return visitEndOfDeclarationMarker(node); default: return destructuringVisitor(node); @@ -45860,21 +50694,21 @@ var ts; function visitForStatement(node) { var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; enclosingBlockScopedContainer = node; - node = ts.updateFor(node, visitForInitializer(node.initializer), ts.visitNode(node.condition, destructuringVisitor, ts.isExpression, true), ts.visitNode(node.incrementor, destructuringVisitor, ts.isExpression, true), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement)); + node = ts.updateFor(node, visitForInitializer(node.initializer), ts.visitNode(node.condition, destructuringVisitor, ts.isExpression), ts.visitNode(node.incrementor, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement)); enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; return node; } function visitForInStatement(node) { var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; enclosingBlockScopedContainer = node; - node = ts.updateForIn(node, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, false, ts.liftToBlock)); + node = ts.updateForIn(node, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; return node; } function visitForOfStatement(node) { var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; enclosingBlockScopedContainer = node; - node = ts.updateForOf(node, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, false, ts.liftToBlock)); + node = ts.updateForOf(node, node.awaitModifier, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; return node; } @@ -45883,6 +50717,9 @@ var ts; && shouldHoistVariableDeclarationList(node); } function visitForInitializer(node) { + if (!node) { + return node; + } if (shouldHoistForInitializer(node)) { var expressions = void 0; for (var _i = 0, _a = node.declarations; _i < _a.length; _i++) { @@ -45896,16 +50733,16 @@ var ts; } } function visitDoStatement(node) { - return ts.updateDo(node, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, false, ts.liftToBlock), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression)); + return ts.updateDo(node, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression)); } function visitWhileStatement(node) { - return ts.updateWhile(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, false, ts.liftToBlock)); + return ts.updateWhile(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); } function visitLabeledStatement(node) { - return ts.updateLabel(node, node.label, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, false, ts.liftToBlock)); + return ts.updateLabel(node, node.label, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); } function visitWithStatement(node) { - return ts.updateWith(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, false, ts.liftToBlock)); + return ts.updateWith(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); } function visitSwitchStatement(node) { return ts.updateSwitch(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.caseBlock, nestedElementVisitor, ts.isCaseBlock)); @@ -45942,7 +50779,7 @@ var ts; } function destructuringVisitor(node) { if (node.transformFlags & 1024 - && node.kind === 192) { + && node.kind === 193) { return visitDestructuringAssignment(node); } else if (node.transformFlags & 2048) { @@ -45959,7 +50796,7 @@ var ts; return ts.visitEachChild(node, destructuringVisitor, context); } function hasExportedReferenceInDestructuringTarget(node) { - if (ts.isAssignmentExpression(node)) { + if (ts.isAssignmentExpression(node, true)) { return hasExportedReferenceInDestructuringTarget(node.left); } else if (ts.isSpreadExpression(node)) { @@ -45979,7 +50816,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 261; + return container !== undefined && container.kind === 264; } else { return false; @@ -45993,8 +50830,8 @@ var ts; } return node; } - function onEmitNode(emitContext, node, emitCallback) { - if (node.kind === 261) { + function onEmitNode(hint, node, emitCallback) { + if (node.kind === 264) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -46003,22 +50840,22 @@ var ts; if (noSubstitution) { delete noSubstitutionMap[id]; } - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); currentSourceFile = undefined; moduleInfo = undefined; exportFunction = undefined; noSubstitution = undefined; } else { - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); } } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); if (isSubstitutionPrevented(node)) { return node; } - if (emitContext === 1) { + if (hint === 1) { return substituteExpression(node); } return node; @@ -46027,10 +50864,10 @@ var ts; switch (node.kind) { case 70: return substituteExpressionIdentifier(node); - case 192: + case 193: return substituteBinaryExpression(node); - case 190: case 191: + case 192: return substituteUnaryExpression(node); } return node; @@ -46047,10 +50884,10 @@ var ts; var importDeclaration = resolver.getReferencedImportDeclaration(node); if (importDeclaration) { if (ts.isImportClause(importDeclaration)) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default"), node); + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default")), node); } else if (ts.isImportSpecifier(importDeclaration)) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(importDeclaration.propertyName || importDeclaration.name), node); + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(importDeclaration.propertyName || importDeclaration.name)), node); } } } @@ -46082,14 +50919,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 191 - ? ts.createPrefix(node.operator, node.operand, node) + var expression = node.kind === 192 + ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_4 = exportedNames; _i < exportedNames_4.length; _i++) { var exportName = exportedNames_4[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 191) { + if (node.kind === 192) { expression = node.operator === 42 ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); @@ -46106,7 +50943,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, false); - if (exportContainer && exportContainer.kind === 261) { + if (exportContainer && exportContainer.kind === 264) { exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -46116,7 +50953,7 @@ var ts; } function preventSubstitution(node) { if (noSubstitution === undefined) - noSubstitution = ts.createMap(); + noSubstitution = []; noSubstitution[ts.getNodeId(node)] = true; return node; } @@ -46134,7 +50971,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(261); + context.enableEmitNotification(264); context.enableSubstitution(70); var currentSourceFile; return transformSourceFile; @@ -46146,10 +50983,10 @@ var ts; var externalHelpersModuleName = ts.getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions); if (externalHelpersModuleName) { var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.statements); + var statementOffset = ts.addPrologue(statements, node.statements); ts.append(statements, ts.createImportDeclaration(undefined, undefined, ts.createImportClause(undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText))); ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset)); - return ts.updateSourceFileNode(node, ts.createNodeArray(statements, node.statements)); + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements)); } else { return ts.visitEachChild(node, visitor, context); @@ -46159,9 +50996,9 @@ var ts; } function visitor(node) { switch (node.kind) { - case 234: + case 236: return undefined; - case 240: + case 242: return visitExportAssignment(node); } return node; @@ -46169,19 +51006,19 @@ var ts; function visitExportAssignment(node) { return node.isExportEquals ? undefined : node; } - function onEmitNode(emitContext, node, emitCallback) { + function onEmitNode(hint, node, emitCallback) { if (ts.isSourceFile(node)) { currentSourceFile = node; - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); currentSourceFile = undefined; } else { - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); } } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (ts.isIdentifier(node) && emitContext === 1) { + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (ts.isIdentifier(node) && hint === 1) { return substituteExpressionIdentifier(node); } return node; @@ -46200,19 +51037,34 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var moduleTransformerMap = ts.createMap((_a = {}, - _a[ts.ModuleKind.ES2015] = ts.transformES2015Module, - _a[ts.ModuleKind.System] = ts.transformSystemModule, - _a[ts.ModuleKind.AMD] = ts.transformModule, - _a[ts.ModuleKind.CommonJS] = ts.transformModule, - _a[ts.ModuleKind.UMD] = ts.transformModule, - _a[ts.ModuleKind.None] = ts.transformModule, - _a)); - function getTransformers(compilerOptions) { + function getModuleTransformer(moduleKind) { + switch (moduleKind) { + case ts.ModuleKind.ES2015: + return ts.transformES2015Module; + case ts.ModuleKind.System: + return ts.transformSystemModule; + default: + return ts.transformModule; + } + } + var TransformationState; + (function (TransformationState) { + TransformationState[TransformationState["Uninitialized"] = 0] = "Uninitialized"; + TransformationState[TransformationState["Initialized"] = 1] = "Initialized"; + TransformationState[TransformationState["Completed"] = 2] = "Completed"; + TransformationState[TransformationState["Disposed"] = 3] = "Disposed"; + })(TransformationState || (TransformationState = {})); + var SyntaxKindFeatureFlags; + (function (SyntaxKindFeatureFlags) { + SyntaxKindFeatureFlags[SyntaxKindFeatureFlags["Substitution"] = 1] = "Substitution"; + SyntaxKindFeatureFlags[SyntaxKindFeatureFlags["EmitNotifications"] = 2] = "EmitNotifications"; + })(SyntaxKindFeatureFlags || (SyntaxKindFeatureFlags = {})); + function getTransformers(compilerOptions, customTransformers) { var jsx = compilerOptions.jsx; var languageVersion = ts.getEmitScriptTarget(compilerOptions); var moduleKind = ts.getEmitModuleKind(compilerOptions); var transformers = []; + ts.addRange(transformers, customTransformers && customTransformers.before); transformers.push(ts.transformTypeScript); if (jsx === 2) { transformers.push(ts.transformJsx); @@ -46230,16 +51082,16 @@ var ts; transformers.push(ts.transformES2015); transformers.push(ts.transformGenerators); } - transformers.push(moduleTransformerMap[moduleKind] || moduleTransformerMap[ts.ModuleKind.None]); + transformers.push(getModuleTransformer(moduleKind)); if (languageVersion < 1) { transformers.push(ts.transformES5); } + ts.addRange(transformers, customTransformers && customTransformers.after); return transformers; } ts.getTransformers = getTransformers; - function transformFiles(resolver, host, sourceFiles, transformers) { + function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { var enabledSyntaxKindFeatures = new Array(298); - var lexicalEnvironmentDisabled = false; var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -46247,8 +51099,11 @@ var ts; var lexicalEnvironmentStackOffset = 0; var lexicalEnvironmentSuspended = false; var emitHelpers; + var onSubstituteNode = function (_, node) { return node; }; + var onEmitNode = function (hint, node, callback) { return callback(hint, node); }; + var state = 0; var context = { - getCompilerOptions: function () { return host.getCompilerOptions(); }, + getCompilerOptions: function () { return options; }, getEmitResolver: function () { return resolver; }, getEmitHost: function () { return host; }, startLexicalEnvironment: startLexicalEnvironment, @@ -46259,65 +51114,77 @@ var ts; hoistFunctionDeclaration: hoistFunctionDeclaration, requestEmitHelper: requestEmitHelper, readEmitHelpers: readEmitHelpers, - onSubstituteNode: function (_emitContext, node) { return node; }, enableSubstitution: enableSubstitution, - isSubstitutionEnabled: isSubstitutionEnabled, - onEmitNode: function (node, emitContext, emitCallback) { return emitCallback(node, emitContext); }, enableEmitNotification: enableEmitNotification, - isEmitNotificationEnabled: isEmitNotificationEnabled + isSubstitutionEnabled: isSubstitutionEnabled, + isEmitNotificationEnabled: isEmitNotificationEnabled, + get onSubstituteNode() { return onSubstituteNode; }, + set onSubstituteNode(value) { + ts.Debug.assert(state < 1, "Cannot modify transformation hooks after initialization has completed."); + ts.Debug.assert(value !== undefined, "Value must not be 'undefined'"); + onSubstituteNode = value; + }, + get onEmitNode() { return onEmitNode; }, + set onEmitNode(value) { + ts.Debug.assert(state < 1, "Cannot modify transformation hooks after initialization has completed."); + ts.Debug.assert(value !== undefined, "Value must not be 'undefined'"); + onEmitNode = value; + } }; + for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { + var node = nodes_4[_i]; + ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node))); + } + ts.performance.mark("beforeTransform"); var transformation = ts.chain.apply(void 0, transformers)(context); - var transformed = ts.map(sourceFiles, transformSourceFile); - lexicalEnvironmentDisabled = true; + state = 1; + var transformed = ts.map(nodes, allowDtsFiles ? transformation : transformRoot); + state = 2; + ts.performance.mark("afterTransform"); + ts.performance.measure("transformTime", "beforeTransform", "afterTransform"); return { transformed: transformed, - emitNodeWithSubstitution: emitNodeWithSubstitution, - emitNodeWithNotification: emitNodeWithNotification + substituteNode: substituteNode, + emitNodeWithNotification: emitNodeWithNotification, + dispose: dispose }; - function transformSourceFile(sourceFile) { - if (ts.isDeclarationFile(sourceFile)) { - return sourceFile; - } - return transformation(sourceFile); + function transformRoot(node) { + return node && (!ts.isSourceFile(node) || !ts.isDeclarationFile(node)) ? transformation(node) : node; } function enableSubstitution(kind) { + ts.Debug.assert(state < 2, "Cannot modify the transformation context after transformation has completed."); enabledSyntaxKindFeatures[kind] |= 1; } function isSubstitutionEnabled(node) { return (enabledSyntaxKindFeatures[node.kind] & 1) !== 0 && (ts.getEmitFlags(node) & 4) === 0; } - function emitNodeWithSubstitution(emitContext, node, emitCallback) { - if (node) { - if (isSubstitutionEnabled(node)) { - var substitute = context.onSubstituteNode(emitContext, node); - if (substitute && substitute !== node) { - emitCallback(emitContext, substitute); - return; - } - } - emitCallback(emitContext, node); - } + function substituteNode(hint, node) { + ts.Debug.assert(state < 3, "Cannot substitute a node after the result is disposed."); + return node && isSubstitutionEnabled(node) && onSubstituteNode(hint, node) || node; } function enableEmitNotification(kind) { + ts.Debug.assert(state < 2, "Cannot modify the transformation context after transformation has completed."); enabledSyntaxKindFeatures[kind] |= 2; } function isEmitNotificationEnabled(node) { return (enabledSyntaxKindFeatures[node.kind] & 2) !== 0 || (ts.getEmitFlags(node) & 2) !== 0; } - function emitNodeWithNotification(emitContext, node, emitCallback) { + function emitNodeWithNotification(hint, node, emitCallback) { + ts.Debug.assert(state < 3, "Cannot invoke TransformationResult callbacks after the result is disposed."); if (node) { if (isEmitNotificationEnabled(node)) { - context.onEmitNode(emitContext, node, emitCallback); + onEmitNode(hint, node, emitCallback); } else { - emitCallback(emitContext, node); + emitCallback(hint, node); } } } function hoistVariableDeclaration(name) { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); var decl = ts.createVariableDeclaration(name); if (!lexicalEnvironmentVariableDeclarations) { lexicalEnvironmentVariableDeclarations = [decl]; @@ -46327,7 +51194,8 @@ var ts; } } function hoistFunctionDeclaration(func) { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); if (!lexicalEnvironmentFunctionDeclarations) { lexicalEnvironmentFunctionDeclarations = [func]; } @@ -46336,7 +51204,8 @@ var ts; } } function startLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot start a lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is suspended."); lexicalEnvironmentVariableDeclarationsStack[lexicalEnvironmentStackOffset] = lexicalEnvironmentVariableDeclarations; lexicalEnvironmentFunctionDeclarationsStack[lexicalEnvironmentStackOffset] = lexicalEnvironmentFunctionDeclarations; @@ -46345,17 +51214,20 @@ var ts; lexicalEnvironmentFunctionDeclarations = undefined; } function suspendLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot suspend a lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is already suspended."); lexicalEnvironmentSuspended = true; } function resumeLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot resume a lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(lexicalEnvironmentSuspended, "Lexical environment is not suspended."); lexicalEnvironmentSuspended = false; } function endLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot end a lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is suspended."); var statements; if (lexicalEnvironmentVariableDeclarations || lexicalEnvironmentFunctionDeclarations) { @@ -46382,33 +51254,52 @@ var ts; return statements; } function requestEmitHelper(helper) { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the transformation context during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the transformation context after transformation has completed."); ts.Debug.assert(!helper.scoped, "Cannot request a scoped emit helper."); emitHelpers = ts.append(emitHelpers, helper); } function readEmitHelpers() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0, "Cannot modify the transformation context during initialization."); + ts.Debug.assert(state < 2, "Cannot modify the transformation context after transformation has completed."); var helpers = emitHelpers; emitHelpers = undefined; return helpers; } + function dispose() { + if (state < 3) { + for (var _i = 0, nodes_5 = nodes; _i < nodes_5.length; _i++) { + var node = nodes_5[_i]; + ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node))); + } + lexicalEnvironmentVariableDeclarations = undefined; + lexicalEnvironmentVariableDeclarationsStack = undefined; + lexicalEnvironmentFunctionDeclarations = undefined; + lexicalEnvironmentFunctionDeclarationsStack = undefined; + onSubstituteNode = undefined; + onEmitNode = undefined; + emitHelpers = undefined; + state = 3; + } + } } - ts.transformFiles = transformFiles; - var _a; + ts.transformNodes = transformNodes; })(ts || (ts = {})); var ts; (function (ts) { function getDeclarationDiagnostics(host, resolver, targetSourceFile) { var declarationDiagnostics = ts.createDiagnosticCollection(); - ts.forEachExpectedEmitFile(host, getDeclarationDiagnosticsFromFile, targetSourceFile); + ts.forEachEmittedFile(host, getDeclarationDiagnosticsFromFile, targetSourceFile); return declarationDiagnostics.getDiagnostics(targetSourceFile ? targetSourceFile.fileName : undefined); - function getDeclarationDiagnosticsFromFile(_a, sources, isBundledEmit) { + function getDeclarationDiagnosticsFromFile(_a, sourceFileOrBundle) { var declarationFilePath = _a.declarationFilePath; - emitDeclarations(host, resolver, declarationDiagnostics, declarationFilePath, sources, isBundledEmit, false); + emitDeclarations(host, resolver, declarationDiagnostics, declarationFilePath, sourceFileOrBundle, false); } } ts.getDeclarationDiagnostics = getDeclarationDiagnostics; - function emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFiles, isBundledEmit, emitOnlyDtsFiles) { + function emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles) { + var sourceFiles = sourceFileOrBundle.kind === 265 ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; + var isBundledEmit = sourceFileOrBundle.kind === 265; var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); var write; @@ -46470,7 +51361,7 @@ var ts; var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { - ts.Debug.assert(aliasEmitInfo.node.kind === 235); + ts.Debug.assert(aliasEmitInfo.node.kind === 237); createAndSetNewTextWriterWithSymbolWriter(); ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit)); for (var i = 0; i < aliasEmitInfo.indent; i++) { @@ -46493,9 +51384,9 @@ var ts; } }); if (usedTypeDirectiveReferences) { - for (var directive in usedTypeDirectiveReferences) { + ts.forEachKey(usedTypeDirectiveReferences, function (directive) { referencesOutput += "/// " + newLine; - } + }); } return { reportedDeclarationError: reportedDeclarationError, @@ -46520,12 +51411,14 @@ var ts; var writer = ts.createTextWriter(newLine); writer.trackSymbol = trackSymbol; writer.reportInaccessibleThisError = reportInaccessibleThisError; + writer.reportIllegalExtends = reportIllegalExtends; writer.writeKeyword = writer.write; writer.writeOperator = writer.write; writer.writePunctuation = writer.write; writer.writeSpace = writer.write; writer.writeStringLiteral = writer.writeLiteral; writer.writeParameter = writer.write; + writer.writeProperty = writer.write; writer.writeSymbol = writer.write; setWriter(writer); } @@ -46541,10 +51434,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 223) { + if (declaration.kind === 225) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 238 || declaration.kind === 239 || declaration.kind === 236) { + else if (declaration.kind === 240 || declaration.kind === 241 || declaration.kind === 238) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -46555,7 +51448,7 @@ var ts; moduleElementEmitInfo = ts.forEach(asynchronousSubModuleDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; }); } if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 235) { + if (moduleElementEmitInfo.node.kind === 237) { moduleElementEmitInfo.isVisible = true; } else { @@ -46563,12 +51456,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 230) { + if (nodeToCheck.kind === 232) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 230) { + if (nodeToCheck.kind === 232) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -46587,8 +51480,8 @@ var ts; } for (var _i = 0, typeReferenceDirectives_1 = typeReferenceDirectives; _i < typeReferenceDirectives_1.length; _i++) { var directive = typeReferenceDirectives_1[_i]; - if (!(directive in usedTypeDirectiveReferences)) { - usedTypeDirectiveReferences[directive] = directive; + if (!usedTypeDirectiveReferences.has(directive)) { + usedTypeDirectiveReferences.set(directive, directive); } } } @@ -46615,6 +51508,12 @@ var ts; handleSymbolAccessibilityError(resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning, true)); recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForSymbol(symbol, meaning)); } + function reportIllegalExtends() { + if (errorNameNode) { + reportedDeclarationError = true; + emitterDiagnostics.add(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.extends_clause_of_exported_class_0_refers_to_a_type_whose_name_cannot_be_referenced, ts.declarationNameToString(errorNameNode))); + } + } function reportInaccessibleThisError() { if (errorNameNode) { reportedDeclarationError = true; @@ -46624,12 +51523,16 @@ var ts; function writeTypeOfDeclaration(declaration, type, getSymbolAccessibilityDiagnostic) { writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; write(": "); - if (type) { + var shouldUseResolverType = declaration.kind === 145 && + resolver.isRequiredInitializedParameter(declaration); + if (type && !shouldUseResolverType) { emitType(type); } else { errorNameNode = declaration.name; - resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, 2 | 1024, writer); + var format = 2 | 1024 | + (shouldUseResolverType ? 4096 : 0); + resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, format, writer); errorNameNode = undefined; } } @@ -46646,15 +51549,15 @@ var ts; } } function emitLines(nodes) { - for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { - var node = nodes_4[_i]; + for (var _i = 0, nodes_6 = nodes; _i < nodes_6.length; _i++) { + var node = nodes_6[_i]; emit(node); } } function emitSeparatedList(nodes, separator, eachNodeEmitFn, canEmitFn) { var currentWriterPos = writer.getTextPos(); - for (var _i = 0, nodes_5 = nodes; _i < nodes_5.length; _i++) { - var node = nodes_5[_i]; + for (var _i = 0, nodes_7 = nodes; _i < nodes_7.length; _i++) { + var node = nodes_7[_i]; if (!canEmitFn || canEmitFn(node)) { if (currentWriterPos !== writer.getTextPos()) { write(separator); @@ -46681,49 +51584,50 @@ var ts; function emitType(type) { switch (type.kind) { case 118: - case 134: + case 135: case 132: case 121: - case 135: + case 133: + case 136: case 104: - case 137: + case 138: case 94: case 129: - case 167: - case 171: - return writeTextOfNode(currentText, type); - case 199: - return emitExpressionWithTypeArguments(type); - case 157: - return emitTypeReference(type); - case 160: - return emitTypeQuery(type); - case 162: - return emitArrayType(type); - case 163: - return emitTupleType(type); - case 164: - return emitUnionType(type); - case 165: - return emitIntersectionType(type); - case 166: - return emitParenType(type); case 168: - return emitTypeOperator(type); - case 169: - return emitIndexedAccessType(type); - case 170: - return emitMappedType(type); + case 172: + return writeTextOfNode(currentText, type); + case 200: + return emitExpressionWithTypeArguments(type); case 158: - case 159: - return emitSignatureDeclarationWithJsDocComments(type); + return emitTypeReference(type); case 161: + return emitTypeQuery(type); + case 163: + return emitArrayType(type); + case 164: + return emitTupleType(type); + case 165: + return emitUnionType(type); + case 166: + return emitIntersectionType(type); + case 167: + return emitParenType(type); + case 169: + return emitTypeOperator(type); + case 170: + return emitIndexedAccessType(type); + case 171: + return emitMappedType(type); + case 159: + case 160: + return emitSignatureDeclarationWithJsDocComments(type); + case 162: return emitTypeLiteral(type); case 70: return emitEntityName(type); - case 141: + case 142: return emitEntityName(type); - case 156: + case 157: return emitTypePredicate(type); } function writeEntityName(entityName) { @@ -46731,22 +51635,22 @@ var ts; writeTextOfNode(currentText, entityName); } else { - var left = entityName.kind === 141 ? entityName.left : entityName.expression; - var right = entityName.kind === 141 ? entityName.right : entityName.name; + var left = entityName.kind === 142 ? entityName.left : entityName.expression; + var right = entityName.kind === 142 ? entityName.right : entityName.name; writeEntityName(left); write("."); writeTextOfNode(currentText, right); } } function emitEntityName(entityName) { - var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 234 ? entityName.parent : enclosingDeclaration); + var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 236 ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForEntityName(entityName)); writeEntityName(entityName); } function emitExpressionWithTypeArguments(node) { if (ts.isEntityNameExpression(node.expression)) { - ts.Debug.assert(node.expression.kind === 70 || node.expression.kind === 177); + ts.Debug.assert(node.expression.kind === 70 || node.expression.kind === 178); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -46850,15 +51754,15 @@ var ts; } function getExportDefaultTempVariableName() { var baseName = "_default"; - if (!(baseName in currentIdentifiers)) { + if (!currentIdentifiers.has(baseName)) { return baseName; } var count = 0; while (true) { count++; - var name_40 = baseName + "_" + count; - if (!(name_40 in currentIdentifiers)) { - return name_40; + var name = baseName + "_" + count; + if (!currentIdentifiers.has(name)) { + return name; } } } @@ -46902,10 +51806,10 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 234 || - (node.parent.kind === 261 && isCurrentFileExternalModule)) { + else if (node.kind === 236 || + (node.parent.kind === 264 && isCurrentFileExternalModule)) { var isVisible = void 0; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 261) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 264) { asynchronousSubModuleDeclarationEmitInfo.push({ node: node, outputPos: writer.getTextPos(), @@ -46914,7 +51818,7 @@ var ts; }); } else { - if (node.kind === 235) { + if (node.kind === 237) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -46932,30 +51836,30 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 225: - return writeFunctionDeclaration(node); - case 205: - return writeVariableStatement(node); case 227: - return writeInterfaceDeclaration(node); - case 226: - return writeClassDeclaration(node); - case 228: - return writeTypeAliasDeclaration(node); + return writeFunctionDeclaration(node); + case 207: + return writeVariableStatement(node); case 229: - return writeEnumDeclaration(node); + return writeInterfaceDeclaration(node); + case 228: + return writeClassDeclaration(node); case 230: + return writeTypeAliasDeclaration(node); + case 231: + return writeEnumDeclaration(node); + case 232: return writeModuleDeclaration(node); - case 234: + case 236: return writeImportEqualsDeclaration(node); - case 235: + case 237: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); } } function emitModuleElementDeclarationFlags(node) { - if (node.parent.kind === 261) { + if (node.parent.kind === 264) { var modifiers = ts.getModifierFlags(node); if (modifiers & 1) { write("export "); @@ -46963,7 +51867,7 @@ var ts; if (modifiers & 512) { write("default "); } - else if (node.kind !== 227 && !noDeclare) { + else if (node.kind !== 229 && !noDeclare) { write("declare "); } } @@ -47013,7 +51917,7 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 237) { + if (namedBindings.kind === 239) { return resolver.isDeclarationVisible(namedBindings); } else { @@ -47036,7 +51940,7 @@ var ts; if (currentWriterPos !== writer.getTextPos()) { write(", "); } - if (node.importClause.namedBindings.kind === 237) { + if (node.importClause.namedBindings.kind === 239) { write("* as "); writeTextOfNode(currentText, node.importClause.namedBindings.name); } @@ -47053,13 +51957,13 @@ var ts; writer.writeLine(); } function emitExternalModuleSpecifier(parent) { - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 230; + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 232; var moduleSpecifier; - if (parent.kind === 234) { + if (parent.kind === 236) { var node = parent; moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node); } - else if (parent.kind === 230) { + else if (parent.kind === 232) { moduleSpecifier = parent.name; } else { @@ -47127,7 +52031,7 @@ var ts; writeTextOfNode(currentText, node.name); } } - while (node.body && node.body.kind !== 231) { + while (node.body && node.body.kind !== 233) { node = node.body; write("."); writeTextOfNode(currentText, node.name); @@ -47197,7 +52101,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 149 && ts.hasModifier(node.parent, 8); + return node.parent.kind === 150 && ts.hasModifier(node.parent, 8); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -47207,52 +52111,69 @@ var ts; writeTextOfNode(currentText, node.name); if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 158 || - node.parent.kind === 159 || - (node.parent.parent && node.parent.parent.kind === 161)) { - ts.Debug.assert(node.parent.kind === 149 || - node.parent.kind === 148 || - node.parent.kind === 158 || + if (node.parent.kind === 159 || + node.parent.kind === 160 || + (node.parent.parent && node.parent.parent.kind === 162)) { + ts.Debug.assert(node.parent.kind === 150 || + node.parent.kind === 149 || node.parent.kind === 159 || - node.parent.kind === 153 || - node.parent.kind === 154); + node.parent.kind === 160 || + node.parent.kind === 154 || + node.parent.kind === 155); emitType(node.constraint); } else { emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.constraint, getTypeParameterConstraintVisibilityError); } } + if (node.default && !isPrivateMethodTypeParameter(node)) { + write(" = "); + if (node.parent.kind === 159 || + node.parent.kind === 160 || + (node.parent.parent && node.parent.parent.kind === 162)) { + ts.Debug.assert(node.parent.kind === 150 || + node.parent.kind === 149 || + node.parent.kind === 159 || + node.parent.kind === 160 || + node.parent.kind === 154 || + node.parent.kind === 155); + emitType(node.default); + } + else { + emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.default, getTypeParameterConstraintVisibilityError); + } + } function getTypeParameterConstraintVisibilityError() { var diagnosticMessage; switch (node.parent.kind) { - case 226: + case 228: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 227: + case 229: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 154: + case 155: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 153: + case 154: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; + case 150: case 149: - case 148: if (ts.hasModifier(node.parent, 32)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 226) { + else if (node.parent.parent.kind === 228) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 225: + case 227: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 228: + case 230: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -47271,7 +52192,7 @@ var ts; write(">"); } } - function emitHeritageClause(typeReferences, isImplementsList) { + function emitHeritageClause(className, typeReferences, isImplementsList) { if (typeReferences) { write(isImplementsList ? " implements " : " extends "); emitCommaList(typeReferences, emitTypeOfTypeReference); @@ -47285,17 +52206,19 @@ var ts; } else { writer.getSymbolAccessibilityDiagnostic = getHeritageClauseVisibilityError; + errorNameNode = className; resolver.writeBaseConstructorTypeOfClass(enclosingDeclaration, enclosingDeclaration, 2 | 1024, writer); + errorNameNode = undefined; } function getHeritageClauseVisibilityError() { var diagnosticMessage; - if (node.parent.parent.kind === 226) { + if (node.parent.parent.kind === 228) { diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : - ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; + ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1; } else { - diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; + diagnosticMessage = ts.Diagnostics.extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; } return { diagnosticMessage: diagnosticMessage, @@ -47327,9 +52250,10 @@ var ts; emitTypeParameters(node.typeParameters); var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { - emitHeritageClause([baseTypeNode], false); + node.name; + emitHeritageClause(node.name, [baseTypeNode], false); } - emitHeritageClause(ts.getClassImplementsHeritageClauseElements(node), true); + emitHeritageClause(node.name, ts.getClassImplementsHeritageClauseElements(node), true); write(" {"); writeLine(); increaseIndent(); @@ -47350,7 +52274,7 @@ var ts; emitTypeParameters(node.typeParameters); var interfaceExtendsTypes = ts.filter(ts.getInterfaceBaseTypeNodes(node), function (base) { return ts.isEntityNameExpression(base.expression); }); if (interfaceExtendsTypes && interfaceExtendsTypes.length) { - emitHeritageClause(interfaceExtendsTypes, false); + emitHeritageClause(node.name, interfaceExtendsTypes, false); } write(" {"); writeLine(); @@ -47372,17 +52296,17 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 223 || resolver.isDeclarationVisible(node)) { + if (node.kind !== 225 || resolver.isDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } else { writeTextOfNode(currentText, node.name); - if ((node.kind === 147 || node.kind === 146 || - (node.kind === 144 && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { + if ((node.kind === 148 || node.kind === 147 || + (node.kind === 145 && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { write("?"); } - if ((node.kind === 147 || node.kind === 146) && node.parent.kind === 161) { + if ((node.kind === 148 || node.kind === 147) && node.parent.kind === 162) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (resolver.isLiteralConstDeclaration(node)) { @@ -47395,14 +52319,14 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 223) { + if (node.kind === 225) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 147 || node.kind === 146) { + else if (node.kind === 148 || node.kind === 147) { if (ts.hasModifier(node, 32)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -47410,7 +52334,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 226) { + else if (node.parent.kind === 228) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -47436,7 +52360,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 198) { + if (element.kind !== 199) { elements.push(element); } } @@ -47502,7 +52426,7 @@ var ts; accessorWithTypeAnnotation = node; var type = getTypeAnnotationFromAccessor(node); if (!type) { - var anotherAccessor = node.kind === 151 ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 152 ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -47515,7 +52439,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 151 + return accessor.kind === 152 ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type @@ -47524,7 +52448,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 152) { + if (accessorWithTypeAnnotation.kind === 153) { if (ts.hasModifier(accessorWithTypeAnnotation.parent, 32)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : @@ -47570,17 +52494,17 @@ var ts; } if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 225) { + if (node.kind === 227) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 149 || node.kind === 150) { + else if (node.kind === 150 || node.kind === 151) { emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); } - if (node.kind === 225) { + if (node.kind === 227) { write("function "); writeTextOfNode(currentText, node.name); } - else if (node.kind === 150) { + else if (node.kind === 151) { write("constructor"); } else { @@ -47600,15 +52524,15 @@ var ts; var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; var closeParenthesizedFunctionType = false; - if (node.kind === 155) { + if (node.kind === 156) { emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); write("["); } else { - if (node.kind === 154 || node.kind === 159) { + if (node.kind === 155 || node.kind === 160) { write("new "); } - else if (node.kind === 158) { + else if (node.kind === 159) { var currentOutput = writer.getText(); if (node.typeParameters && currentOutput.charAt(currentOutput.length - 1) === "<") { closeParenthesizedFunctionType = true; @@ -47619,20 +52543,20 @@ var ts; write("("); } emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 155) { + if (node.kind === 156) { write("]"); } else { write(")"); } - var isFunctionTypeOrConstructorType = node.kind === 158 || node.kind === 159; - if (isFunctionTypeOrConstructorType || node.parent.kind === 161) { + var isFunctionTypeOrConstructorType = node.kind === 159 || node.kind === 160; + if (isFunctionTypeOrConstructorType || node.parent.kind === 162) { if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 150 && !ts.hasModifier(node, 8)) { + else if (node.kind !== 151 && !ts.hasModifier(node, 8)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -47646,23 +52570,23 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 154: + case 155: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 153: + case 154: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 155: + case 156: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; + case 150: case 149: - case 148: if (ts.hasModifier(node, 32)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -47670,7 +52594,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 226) { + else if (node.parent.kind === 228) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -47683,7 +52607,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 225: + case 227: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -47715,9 +52639,9 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 158 || - node.parent.kind === 159 || - node.parent.parent.kind === 161) { + if (node.parent.kind === 159 || + node.parent.kind === 160 || + node.parent.parent.kind === 162) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!ts.hasModifier(node.parent, 8)) { @@ -47733,22 +52657,26 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 150: + case 151: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 154: + case 155: return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 153: + case 154: return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; + case 156: + return symbolAccessibilityResult.errorModuleName ? + ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : + ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; + case 150: case 149: - case 148: if (ts.hasModifier(node.parent, 32)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -47756,7 +52684,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 226) { + else if (node.parent.parent.kind === 228) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -47768,7 +52696,7 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 225: + case 227: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -47779,12 +52707,12 @@ var ts; } } function emitBindingPattern(bindingPattern) { - if (bindingPattern.kind === 172) { + if (bindingPattern.kind === 173) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 173) { + else if (bindingPattern.kind === 174) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -47795,10 +52723,10 @@ var ts; } } function emitBindingElement(bindingElement) { - if (bindingElement.kind === 198) { + if (bindingElement.kind === 199) { write(" "); } - else if (bindingElement.kind === 174) { + else if (bindingElement.kind === 175) { if (bindingElement.propertyName) { writeTextOfNode(currentText, bindingElement.propertyName); write(": "); @@ -47820,39 +52748,39 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 225: - case 230: - case 234: case 227: - case 226: - case 228: + case 232: + case 236: case 229: + case 228: + case 230: + case 231: return emitModuleElement(node, isModuleElementVisible(node)); - case 205: + case 207: return emitModuleElement(node, isVariableStatementVisible(node)); - case 235: + case 237: return emitModuleElement(node, !node.importClause); - case 241: + case 243: return emitExportDeclaration(node); + case 151: case 150: case 149: - case 148: return writeFunctionDeclaration(node); - case 154: - case 153: case 155: + case 154: + case 156: return emitSignatureDeclarationWithJsDocComments(node); - case 151: case 152: + case 153: return emitAccessorDeclaration(node); + case 148: case 147: - case 146: return emitPropertyDeclaration(node); - case 260: + case 263: return emitEnumMemberDeclaration(node); - case 240: + case 242: return emitExportAssignment(node); - case 261: + case 264: return emitSourceFile(node); } } @@ -47863,14 +52791,15 @@ var ts; declFileName = referencedFile.fileName; } else { - ts.forEachExpectedEmitFile(host, getDeclFileName, referencedFile, emitOnlyDtsFiles); + ts.forEachEmittedFile(host, getDeclFileName, referencedFile, emitOnlyDtsFiles); } if (declFileName) { declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(declarationFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, false); referencesOutput += "/// " + newLine; } return addedBundledEmitReference; - function getDeclFileName(emitFileNames, _sourceFiles, isBundledEmit) { + function getDeclFileName(emitFileNames, sourceFileOrBundle) { + var isBundledEmit = sourceFileOrBundle.kind === 265; if (isBundledEmit && !addBundledFileReference) { return; } @@ -47880,10 +52809,11 @@ var ts; } } } - function writeDeclarationFile(declarationFilePath, sourceFiles, isBundledEmit, host, resolver, emitterDiagnostics, emitOnlyDtsFiles) { - var emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFiles, isBundledEmit, emitOnlyDtsFiles); + function writeDeclarationFile(declarationFilePath, sourceFileOrBundle, host, resolver, emitterDiagnostics, emitOnlyDtsFiles) { + var emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles); var emitSkipped = emitDeclarationResult.reportedDeclarationError || host.isEmitBlocked(declarationFilePath) || host.getCompilerOptions().noEmit; if (!emitSkipped) { + var sourceFiles = sourceFileOrBundle.kind === 265 ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; var declarationOutput = emitDeclarationResult.referencesOutput + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); ts.writeFile(host, emitterDiagnostics, declarationFilePath, declarationOutput, host.getCompilerOptions().emitBOM, sourceFiles); @@ -47937,7 +52867,7 @@ var ts; getText: getText, getSourceMappingURL: getSourceMappingURL, }; - function initialize(filePath, sourceMapFilePath, sourceFiles, isBundledEmit) { + function initialize(filePath, sourceMapFilePath, sourceFileOrBundle) { if (disabled) { return; } @@ -47968,9 +52898,8 @@ var ts; } if (compilerOptions.mapRoot) { sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); - if (!isBundledEmit) { - ts.Debug.assert(sourceFiles.length === 1); - sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFiles[0], host, sourceMapDir)); + if (sourceFileOrBundle.kind === 264) { + sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFileOrBundle, host, sourceMapDir)); } if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); @@ -48061,28 +52990,28 @@ var ts; ts.performance.measure("Source Map", "beforeSourcemap", "afterSourcemap"); } } - function emitNodeWithSourceMap(emitContext, node, emitCallback) { + function emitNodeWithSourceMap(hint, node, emitCallback) { if (disabled) { - return emitCallback(emitContext, node); + return emitCallback(hint, node); } if (node) { var emitNode = node.emitNode; var emitFlags = emitNode && emitNode.flags; var _a = emitNode && emitNode.sourceMapRange || node, pos = _a.pos, end = _a.end; - if (node.kind !== 293 + if (node.kind !== 294 && (emitFlags & 16) === 0 && pos >= 0) { emitPos(ts.skipTrivia(currentSourceText, pos)); } if (emitFlags & 64) { disabled = true; - emitCallback(emitContext, node); + emitCallback(hint, node); disabled = false; } else { - emitCallback(emitContext, node); + emitCallback(hint, node); } - if (node.kind !== 293 + if (node.kind !== 294 && (emitFlags & 32) === 0 && end >= 0) { emitPos(end); @@ -48131,7 +53060,7 @@ var ts; return; } encodeLastRecordedSourceMapSpan(); - return ts.stringify({ + return JSON.stringify({ version: 3, file: sourceMapData.sourceMapFile, sourceRoot: sourceMapData.sourceMapSourceRoot, @@ -48183,11 +53112,10 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - function createCommentWriter(host, writer, sourceMap) { - var compilerOptions = host.getCompilerOptions(); - var extendedDiagnostics = compilerOptions.extendedDiagnostics; - var newLine = host.getNewLine(); - var emitPos = sourceMap.emitPos; + function createCommentWriter(printerOptions, emitPos) { + var extendedDiagnostics = printerOptions.extendedDiagnostics; + var newLine = ts.getNewLineCharacter(printerOptions); + var writer; var containerPos = -1; var containerEnd = -1; var declarationListContainerEnd = -1; @@ -48196,37 +53124,34 @@ var ts; var currentLineMap; var detachedCommentsInfo; var hasWrittenComment = false; - var disabled = compilerOptions.removeComments; + var disabled = printerOptions.removeComments; return { reset: reset, + setWriter: setWriter, setSourceFile: setSourceFile, emitNodeWithComments: emitNodeWithComments, emitBodyWithDetachedComments: emitBodyWithDetachedComments, emitTrailingCommentsOfPosition: emitTrailingCommentsOfPosition, + emitLeadingCommentsOfPosition: emitLeadingCommentsOfPosition, }; - function emitNodeWithComments(emitContext, node, emitCallback) { + function emitNodeWithComments(hint, node, emitCallback) { if (disabled) { - emitCallback(emitContext, node); + emitCallback(hint, node); return; } if (node) { - var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var emitFlags = ts.getEmitFlags(node); + hasWrittenComment = false; + var emitNode = node.emitNode; + var emitFlags = emitNode && emitNode.flags; + var _a = emitNode && emitNode.commentRange || node, pos = _a.pos, end = _a.end; if ((pos < 0 && end < 0) || (pos === end)) { - if (emitFlags & 2048) { - disabled = true; - emitCallback(emitContext, node); - disabled = false; - } - else { - emitCallback(emitContext, node); - } + emitNodeWithSynthesizedComments(hint, node, emitNode, emitFlags, emitCallback); } else { if (extendedDiagnostics) { ts.performance.mark("preEmitNodeWithComment"); } - var isEmittedNode = node.kind !== 293; + var isEmittedNode = node.kind !== 294; var skipLeadingComments = pos < 0 || (emitFlags & 512) !== 0; var skipTrailingComments = end < 0 || (emitFlags & 1024) !== 0; if (!skipLeadingComments) { @@ -48240,23 +53165,16 @@ var ts; } if (!skipTrailingComments) { containerEnd = end; - if (node.kind === 224) { + if (node.kind === 226) { declarationListContainerEnd = end; } } if (extendedDiagnostics) { ts.performance.measure("commentTime", "preEmitNodeWithComment"); } - if (emitFlags & 2048) { - disabled = true; - emitCallback(emitContext, node); - disabled = false; - } - else { - emitCallback(emitContext, node); - } + emitNodeWithSynthesizedComments(hint, node, emitNode, emitFlags, emitCallback); if (extendedDiagnostics) { - ts.performance.mark("beginEmitNodeWithComment"); + ts.performance.mark("postEmitNodeWithComment"); } containerPos = savedContainerPos; containerEnd = savedContainerEnd; @@ -48265,11 +53183,75 @@ var ts; emitTrailingComments(end); } if (extendedDiagnostics) { - ts.performance.measure("commentTime", "beginEmitNodeWithComment"); + ts.performance.measure("commentTime", "postEmitNodeWithComment"); } } } } + function emitNodeWithSynthesizedComments(hint, node, emitNode, emitFlags, emitCallback) { + var leadingComments = emitNode && emitNode.leadingComments; + if (ts.some(leadingComments)) { + if (extendedDiagnostics) { + ts.performance.mark("preEmitNodeWithSynthesizedComments"); + } + ts.forEach(leadingComments, emitLeadingSynthesizedComment); + if (extendedDiagnostics) { + ts.performance.measure("commentTime", "preEmitNodeWithSynthesizedComments"); + } + } + emitNodeWithNestedComments(hint, node, emitFlags, emitCallback); + var trailingComments = emitNode && emitNode.trailingComments; + if (ts.some(trailingComments)) { + if (extendedDiagnostics) { + ts.performance.mark("postEmitNodeWithSynthesizedComments"); + } + ts.forEach(trailingComments, emitTrailingSynthesizedComment); + if (extendedDiagnostics) { + ts.performance.measure("commentTime", "postEmitNodeWithSynthesizedComments"); + } + } + } + function emitLeadingSynthesizedComment(comment) { + if (comment.kind === 2) { + writer.writeLine(); + } + writeSynthesizedComment(comment); + if (comment.hasTrailingNewLine || comment.kind === 2) { + writer.writeLine(); + } + else { + writer.write(" "); + } + } + function emitTrailingSynthesizedComment(comment) { + if (!writer.isAtStartOfLine()) { + writer.write(" "); + } + writeSynthesizedComment(comment); + if (comment.hasTrailingNewLine) { + writer.writeLine(); + } + } + function writeSynthesizedComment(comment) { + var text = formatSynthesizedComment(comment); + var lineMap = comment.kind === 3 ? ts.computeLineStarts(text) : undefined; + ts.writeCommentRange(text, lineMap, writer, 0, text.length, newLine); + } + function formatSynthesizedComment(comment) { + return comment.kind === 3 + ? "/*" + comment.text + "*/" + : "//" + comment.text; + } + function emitNodeWithNestedComments(hint, node, emitFlags, emitCallback) { + if (emitFlags & 2048) { + disabled = true; + emitCallback(hint, node); + disabled = false; + } + else { + emitCallback(hint, node); + } + } function emitBodyWithDetachedComments(node, detachedRange, emitCallback) { if (extendedDiagnostics) { ts.performance.mark("preEmitBodyWithDetachedComments"); @@ -48297,6 +53279,9 @@ var ts; } if (!skipTrailingComments) { emitLeadingComments(detachedRange.end, true); + if (hasWrittenComment && !writer.isAtStartOfLine()) { + writer.writeLine(); + } } if (extendedDiagnostics) { ts.performance.measure("commentTime", "beginEmitBodyWithDetachedCommetns"); @@ -48321,9 +53306,11 @@ var ts; ts.emitNewLineBeforeLeadingCommentOfPosition(currentLineMap, writer, rangePos, commentPos); hasWrittenComment = true; } - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); if (hasTrailingNewLine) { writer.writeLine(); } @@ -48331,6 +53318,12 @@ var ts; writer.write(" "); } } + function emitLeadingCommentsOfPosition(pos) { + if (disabled || pos === -1) { + return; + } + emitLeadingComments(pos, true); + } function emitTrailingComments(pos) { forEachTrailingCommentToEmit(pos, emitTrailingComment); } @@ -48338,9 +53331,11 @@ var ts; if (!writer.isAtStartOfLine()) { writer.write(" "); } - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); if (hasTrailingNewLine) { writer.writeLine(); } @@ -48358,9 +53353,11 @@ var ts; } } function emitTrailingCommentOfPosition(commentPos, commentEnd, _kind, hasTrailingNewLine) { - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); if (hasTrailingNewLine) { writer.writeLine(); } @@ -48389,6 +53386,9 @@ var ts; currentLineMap = undefined; detachedCommentsInfo = undefined; } + function setWriter(output) { + writer = output; + } function setSourceFile(sourceFile) { currentSourceFile = sourceFile; currentText = currentSourceFile.text; @@ -48420,9 +53420,11 @@ var ts; } } function writeComment(text, lineMap, writer, commentPos, commentEnd, newLine) { - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(text, lineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); } function isTripleSlashComment(commentPos, commentEnd) { if (currentText.charCodeAt(commentPos + 1) === 47 && @@ -48440,63 +53442,55 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var id = function (s) { return s; }; - var nullTransformers = [function (_) { return id; }]; - function emitFiles(resolver, host, targetSourceFile, emitOnlyDtsFiles) { - var delimiters = createDelimiterMap(); - var brackets = createBracketsMap(); + var delimiters = createDelimiterMap(); + var brackets = createBracketsMap(); + function emitFiles(resolver, host, targetSourceFile, emitOnlyDtsFiles, transformers) { var compilerOptions = host.getCompilerOptions(); - var languageVersion = ts.getEmitScriptTarget(compilerOptions); var moduleKind = ts.getEmitModuleKind(compilerOptions); var sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? [] : undefined; var emittedFilesList = compilerOptions.listEmittedFiles ? [] : undefined; var emitterDiagnostics = ts.createDiagnosticCollection(); var newLine = host.getNewLine(); - var transformers = emitOnlyDtsFiles ? nullTransformers : ts.getTransformers(compilerOptions); var writer = ts.createTextWriter(newLine); - var write = writer.write, writeLine = writer.writeLine, increaseIndent = writer.increaseIndent, decreaseIndent = writer.decreaseIndent; var sourceMap = ts.createSourceMapWriter(host, writer); - var emitNodeWithSourceMap = sourceMap.emitNodeWithSourceMap, emitTokenWithSourceMap = sourceMap.emitTokenWithSourceMap; - var comments = ts.createCommentWriter(host, writer, sourceMap); - var emitNodeWithComments = comments.emitNodeWithComments, emitBodyWithDetachedComments = comments.emitBodyWithDetachedComments, emitTrailingCommentsOfPosition = comments.emitTrailingCommentsOfPosition; - var nodeIdToGeneratedName; - var autoGeneratedIdToGeneratedName; - var generatedNameSet; - var tempFlags; var currentSourceFile; - var currentText; - var currentFileIdentifiers; var bundledHelpers; var isOwnFileEmit; var emitSkipped = false; var sourceFiles = ts.getSourceFilesToEmit(host, targetSourceFile); - ts.performance.mark("beforeTransform"); - var _a = ts.transformFiles(resolver, host, sourceFiles, transformers), transformed = _a.transformed, emitNodeWithSubstitution = _a.emitNodeWithSubstitution, emitNodeWithNotification = _a.emitNodeWithNotification; - ts.performance.measure("transformTime", "beforeTransform"); + var transform = ts.transformNodes(resolver, host, compilerOptions, sourceFiles, transformers, false); + var printer = createPrinter(compilerOptions, { + hasGlobalName: resolver.hasGlobalName, + onEmitNode: transform.emitNodeWithNotification, + substituteNode: transform.substituteNode, + onEmitSourceMapOfNode: sourceMap.emitNodeWithSourceMap, + onEmitSourceMapOfToken: sourceMap.emitTokenWithSourceMap, + onEmitSourceMapOfPosition: sourceMap.emitPos, + onEmitHelpers: emitHelpers, + onSetSourceFile: setSourceFile, + }); ts.performance.mark("beforePrint"); - ts.forEachTransformedEmitFile(host, transformed, emitFile, emitOnlyDtsFiles); + ts.forEachEmittedFile(host, emitSourceFileOrBundle, transform.transformed, emitOnlyDtsFiles); ts.performance.measure("printTime", "beforePrint"); - for (var _b = 0, sourceFiles_4 = sourceFiles; _b < sourceFiles_4.length; _b++) { - var sourceFile = sourceFiles_4[_b]; - ts.disposeEmitNodes(sourceFile); - } + transform.dispose(); return { emitSkipped: emitSkipped, diagnostics: emitterDiagnostics.getDiagnostics(), emittedFiles: emittedFilesList, sourceMaps: sourceMapDataList }; - function emitFile(jsFilePath, sourceMapFilePath, declarationFilePath, sourceFiles, isBundledEmit) { + function emitSourceFileOrBundle(_a, sourceFileOrBundle) { + var jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath; if (!host.isEmitBlocked(jsFilePath) && !compilerOptions.noEmit) { if (!emitOnlyDtsFiles) { - printFile(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit); + printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle); } } else { emitSkipped = true; } if (declarationFilePath) { - emitSkipped = ts.writeDeclarationFile(declarationFilePath, ts.getOriginalSourceFiles(sourceFiles), isBundledEmit, host, resolver, emitterDiagnostics, emitOnlyDtsFiles) || emitSkipped; + emitSkipped = ts.writeDeclarationFile(declarationFilePath, ts.getOriginalSourceFileOrBundle(sourceFileOrBundle), host, resolver, emitterDiagnostics, emitOnlyDtsFiles) || emitSkipped; } if (!emitSkipped && emittedFilesList) { if (!emitOnlyDtsFiles) { @@ -48510,24 +53504,24 @@ var ts; } } } - function printFile(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit) { - sourceMap.initialize(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit); - nodeIdToGeneratedName = []; - autoGeneratedIdToGeneratedName = []; - generatedNameSet = ts.createMap(); - bundledHelpers = isBundledEmit ? ts.createMap() : undefined; - isOwnFileEmit = !isBundledEmit; - if (isBundledEmit && moduleKind) { - for (var _a = 0, sourceFiles_5 = sourceFiles; _a < sourceFiles_5.length; _a++) { - var sourceFile = sourceFiles_5[_a]; - emitHelpers(sourceFile, true); - } + function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle) { + var bundle = sourceFileOrBundle.kind === 265 ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 264 ? sourceFileOrBundle : undefined; + var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; + sourceMap.initialize(jsFilePath, sourceMapFilePath, sourceFileOrBundle); + if (bundle) { + bundledHelpers = ts.createMap(); + isOwnFileEmit = false; + printer.writeBundle(bundle, writer); } - ts.forEach(sourceFiles, printSourceFile); - writeLine(); + else { + isOwnFileEmit = true; + printer.writeFile(sourceFile, writer); + } + writer.writeLine(); var sourceMappingURL = sourceMap.getSourceMappingURL(); if (sourceMappingURL) { - write("//# " + "sourceMappingURL" + "=" + sourceMappingURL); + writer.write("//# " + "sourceMappingURL" + "=" + sourceMappingURL); } if (compilerOptions.sourceMap && !compilerOptions.inlineSourceMap) { ts.writeFile(host, emitterDiagnostics, sourceMapFilePath, sourceMap.getText(), false, sourceFiles); @@ -48537,20 +53531,164 @@ var ts; } ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), compilerOptions.emitBOM, sourceFiles); sourceMap.reset(); - comments.reset(); writer.reset(); - tempFlags = 0; currentSourceFile = undefined; - currentText = undefined; + bundledHelpers = undefined; isOwnFileEmit = false; } - function printSourceFile(node) { + function setSourceFile(node) { currentSourceFile = node; - currentText = node.text; - currentFileIdentifiers = node.identifiers; sourceMap.setSourceFile(node); - comments.setSourceFile(node); - pipelineEmitWithNotification(0, node); + } + function emitHelpers(node, writeLines) { + var helpersEmitted = false; + var bundle = node.kind === 265 ? node : undefined; + if (bundle && moduleKind === ts.ModuleKind.None) { + return; + } + var numNodes = bundle ? bundle.sourceFiles.length : 1; + for (var i = 0; i < numNodes; i++) { + var currentNode = bundle ? bundle.sourceFiles[i] : node; + var sourceFile = ts.isSourceFile(currentNode) ? currentNode : currentSourceFile; + var shouldSkip = compilerOptions.noEmitHelpers || (sourceFile && ts.getExternalHelpersModuleName(sourceFile) !== undefined); + var shouldBundle = ts.isSourceFile(currentNode) && !isOwnFileEmit; + var helpers = ts.getEmitHelpers(currentNode); + if (helpers) { + for (var _a = 0, _b = ts.stableSort(helpers, ts.compareEmitHelpers); _a < _b.length; _a++) { + var helper = _b[_a]; + if (!helper.scoped) { + if (shouldSkip) + continue; + if (shouldBundle) { + if (bundledHelpers.get(helper.name)) { + continue; + } + bundledHelpers.set(helper.name, true); + } + } + else if (bundle) { + continue; + } + writeLines(helper.text); + helpersEmitted = true; + } + } + } + return helpersEmitted; + } + } + ts.emitFiles = emitFiles; + function createPrinter(printerOptions, handlers) { + if (printerOptions === void 0) { printerOptions = {}; } + if (handlers === void 0) { handlers = {}; } + var hasGlobalName = handlers.hasGlobalName, onEmitSourceMapOfNode = handlers.onEmitSourceMapOfNode, onEmitSourceMapOfToken = handlers.onEmitSourceMapOfToken, onEmitSourceMapOfPosition = handlers.onEmitSourceMapOfPosition, onEmitNode = handlers.onEmitNode, onEmitHelpers = handlers.onEmitHelpers, onSetSourceFile = handlers.onSetSourceFile, substituteNode = handlers.substituteNode, onBeforeEmitNodeArray = handlers.onBeforeEmitNodeArray, onAfterEmitNodeArray = handlers.onAfterEmitNodeArray; + var newLine = ts.getNewLineCharacter(printerOptions); + var comments = ts.createCommentWriter(printerOptions, onEmitSourceMapOfPosition); + var emitNodeWithComments = comments.emitNodeWithComments, emitBodyWithDetachedComments = comments.emitBodyWithDetachedComments, emitTrailingCommentsOfPosition = comments.emitTrailingCommentsOfPosition, emitLeadingCommentsOfPosition = comments.emitLeadingCommentsOfPosition; + var currentSourceFile; + var nodeIdToGeneratedName; + var autoGeneratedIdToGeneratedName; + var generatedNames; + var tempFlagsStack; + var tempFlags; + var writer; + var ownWriter; + reset(); + return { + printNode: printNode, + printFile: printFile, + printBundle: printBundle, + writeNode: writeNode, + writeFile: writeFile, + writeBundle: writeBundle + }; + function printNode(hint, node, sourceFile) { + switch (hint) { + case 0: + ts.Debug.assert(ts.isSourceFile(node), "Expected a SourceFile node."); + break; + case 2: + ts.Debug.assert(ts.isIdentifier(node), "Expected an Identifier node."); + break; + case 1: + ts.Debug.assert(ts.isExpression(node), "Expected an Expression node."); + break; + } + switch (node.kind) { + case 264: return printFile(node); + case 265: return printBundle(node); + } + writeNode(hint, node, sourceFile, beginPrint()); + return endPrint(); + } + function printBundle(bundle) { + writeBundle(bundle, beginPrint()); + return endPrint(); + } + function printFile(sourceFile) { + writeFile(sourceFile, beginPrint()); + return endPrint(); + } + function writeNode(hint, node, sourceFile, output) { + var previousWriter = writer; + setWriter(output); + print(hint, node, sourceFile); + reset(); + writer = previousWriter; + } + function writeBundle(bundle, output) { + var previousWriter = writer; + setWriter(output); + emitShebangIfNeeded(bundle); + emitPrologueDirectivesIfNeeded(bundle); + emitHelpersIndirect(bundle); + for (var _a = 0, _b = bundle.sourceFiles; _a < _b.length; _a++) { + var sourceFile = _b[_a]; + print(0, sourceFile, sourceFile); + } + reset(); + writer = previousWriter; + } + function writeFile(sourceFile, output) { + var previousWriter = writer; + setWriter(output); + emitShebangIfNeeded(sourceFile); + emitPrologueDirectivesIfNeeded(sourceFile); + print(0, sourceFile, sourceFile); + reset(); + writer = previousWriter; + } + function beginPrint() { + return ownWriter || (ownWriter = ts.createTextWriter(newLine)); + } + function endPrint() { + var text = ownWriter.getText(); + ownWriter.reset(); + return text; + } + function print(hint, node, sourceFile) { + setSourceFile(sourceFile); + pipelineEmitWithNotification(hint, node); + } + function setSourceFile(sourceFile) { + currentSourceFile = sourceFile; + comments.setSourceFile(sourceFile); + if (onSetSourceFile) { + onSetSourceFile(sourceFile); + } + } + function setWriter(output) { + writer = output; + comments.setWriter(output); + } + function reset() { + nodeIdToGeneratedName = []; + autoGeneratedIdToGeneratedName = []; + generatedNames = ts.createMap(); + tempFlagsStack = []; + tempFlags = 0; + comments.reset(); + setWriter(undefined); } function emit(node) { pipelineEmitWithNotification(3, node); @@ -48561,51 +53699,53 @@ var ts; function emitExpression(node) { pipelineEmitWithNotification(1, node); } - function pipelineEmitWithNotification(emitContext, node) { - emitNodeWithNotification(emitContext, node, pipelineEmitWithComments); + function pipelineEmitWithNotification(hint, node) { + if (onEmitNode) { + onEmitNode(hint, node, pipelineEmitWithComments); + } + else { + pipelineEmitWithComments(hint, node); + } } - function pipelineEmitWithComments(emitContext, node) { - if (emitContext === 0) { - pipelineEmitWithSourceMap(emitContext, node); + function pipelineEmitWithComments(hint, node) { + node = trySubstituteNode(hint, node); + if (emitNodeWithComments && hint !== 0) { + emitNodeWithComments(hint, node, pipelineEmitWithSourceMap); + } + else { + pipelineEmitWithSourceMap(hint, node); + } + } + function pipelineEmitWithSourceMap(hint, node) { + if (onEmitSourceMapOfNode && hint !== 0 && hint !== 2) { + onEmitSourceMapOfNode(hint, node, pipelineEmitWithHint); + } + else { + pipelineEmitWithHint(hint, node); + } + } + function pipelineEmitWithHint(hint, node) { + switch (hint) { + case 0: return pipelineEmitSourceFile(node); + case 2: return pipelineEmitIdentifierName(node); + case 1: return pipelineEmitExpression(node); + case 3: return pipelineEmitUnspecified(node); + } + } + function pipelineEmitSourceFile(node) { + ts.Debug.assertNode(node, ts.isSourceFile); + emitSourceFile(node); + } + function pipelineEmitIdentifierName(node) { + ts.Debug.assertNode(node, ts.isIdentifier); + emitIdentifier(node); + } + function pipelineEmitUnspecified(node) { + var kind = node.kind; + if (ts.isKeyword(kind)) { + writeTokenText(kind); return; } - emitNodeWithComments(emitContext, node, pipelineEmitWithSourceMap); - } - function pipelineEmitWithSourceMap(emitContext, node) { - if (emitContext === 0 - || emitContext === 2) { - pipelineEmitWithSubstitution(emitContext, node); - return; - } - emitNodeWithSourceMap(emitContext, node, pipelineEmitWithSubstitution); - } - function pipelineEmitWithSubstitution(emitContext, node) { - emitNodeWithSubstitution(emitContext, node, pipelineEmitForContext); - } - function pipelineEmitForContext(emitContext, node) { - switch (emitContext) { - case 0: return pipelineEmitInSourceFileContext(node); - case 2: return pipelineEmitInIdentifierNameContext(node); - case 3: return pipelineEmitInUnspecifiedContext(node); - case 1: return pipelineEmitInExpressionContext(node); - } - } - function pipelineEmitInSourceFileContext(node) { - var kind = node.kind; - switch (kind) { - case 261: - return emitSourceFile(node); - } - } - function pipelineEmitInIdentifierNameContext(node) { - var kind = node.kind; - switch (kind) { - case 70: - return emitIdentifier(node); - } - } - function pipelineEmitInUnspecifiedContext(node) { - var kind = node.kind; switch (kind) { case 13: case 14: @@ -48613,229 +53753,201 @@ var ts; return emitLiteral(node); case 70: return emitIdentifier(node); - case 75: - case 78: - case 83: - case 104: - case 111: - case 112: - case 113: - case 114: - case 116: - case 117: - case 118: - case 119: - case 120: - case 121: - case 122: - case 123: - case 124: - case 125: - case 127: - case 128: - case 129: - case 130: - case 131: - case 132: - case 133: - case 134: - case 135: - case 136: - case 137: - case 138: - case 139: - case 140: - writeTokenText(kind); - return; - case 141: - return emitQualifiedName(node); case 142: - return emitComputedPropertyName(node); + return emitQualifiedName(node); case 143: - return emitTypeParameter(node); + return emitComputedPropertyName(node); case 144: - return emitParameter(node); + return emitTypeParameter(node); case 145: - return emitDecorator(node); + return emitParameter(node); case 146: - return emitPropertySignature(node); + return emitDecorator(node); case 147: - return emitPropertyDeclaration(node); + return emitPropertySignature(node); case 148: - return emitMethodSignature(node); + return emitPropertyDeclaration(node); case 149: - return emitMethodDeclaration(node); + return emitMethodSignature(node); case 150: - return emitConstructor(node); + return emitMethodDeclaration(node); case 151: + return emitConstructor(node); case 152: - return emitAccessorDeclaration(node); case 153: - return emitCallSignature(node); + return emitAccessorDeclaration(node); case 154: - return emitConstructSignature(node); + return emitCallSignature(node); case 155: - return emitIndexSignature(node); + return emitConstructSignature(node); case 156: - return emitTypePredicate(node); + return emitIndexSignature(node); case 157: - return emitTypeReference(node); + return emitTypePredicate(node); case 158: - return emitFunctionType(node); + return emitTypeReference(node); case 159: - return emitConstructorType(node); + return emitFunctionType(node); case 160: - return emitTypeQuery(node); + return emitConstructorType(node); case 161: - return emitTypeLiteral(node); + return emitTypeQuery(node); case 162: - return emitArrayType(node); + return emitTypeLiteral(node); case 163: - return emitTupleType(node); + return emitArrayType(node); case 164: - return emitUnionType(node); + return emitTupleType(node); case 165: - return emitIntersectionType(node); + return emitUnionType(node); case 166: - return emitParenthesizedType(node); - case 199: - return emitExpressionWithTypeArguments(node); + return emitIntersectionType(node); case 167: - return emitThisType(); + return emitParenthesizedType(node); + case 200: + return emitExpressionWithTypeArguments(node); case 168: - return emitTypeOperator(node); + return emitThisType(); case 169: - return emitIndexedAccessType(node); + return emitTypeOperator(node); case 170: - return emitMappedType(node); + return emitIndexedAccessType(node); case 171: - return emitLiteralType(node); + return emitMappedType(node); case 172: - return emitObjectBindingPattern(node); + return emitLiteralType(node); case 173: - return emitArrayBindingPattern(node); + return emitObjectBindingPattern(node); case 174: + return emitArrayBindingPattern(node); + case 175: return emitBindingElement(node); - case 202: - return emitTemplateSpan(node); - case 203: - return emitSemicolonClassElement(); case 204: - return emitBlock(node); + return emitTemplateSpan(node); case 205: - return emitVariableStatement(node); + return emitSemicolonClassElement(); case 206: - return emitEmptyStatement(); + return emitBlock(node); case 207: - return emitExpressionStatement(node); + return emitVariableStatement(node); case 208: - return emitIfStatement(node); + return emitEmptyStatement(); case 209: - return emitDoStatement(node); + return emitExpressionStatement(node); case 210: - return emitWhileStatement(node); + return emitIfStatement(node); case 211: - return emitForStatement(node); + return emitDoStatement(node); case 212: - return emitForInStatement(node); + return emitWhileStatement(node); case 213: - return emitForOfStatement(node); + return emitForStatement(node); case 214: - return emitContinueStatement(node); + return emitForInStatement(node); case 215: - return emitBreakStatement(node); + return emitForOfStatement(node); case 216: - return emitReturnStatement(node); + return emitContinueStatement(node); case 217: - return emitWithStatement(node); + return emitBreakStatement(node); case 218: - return emitSwitchStatement(node); + return emitReturnStatement(node); case 219: - return emitLabeledStatement(node); + return emitWithStatement(node); case 220: - return emitThrowStatement(node); + return emitSwitchStatement(node); case 221: - return emitTryStatement(node); + return emitLabeledStatement(node); case 222: - return emitDebuggerStatement(node); + return emitThrowStatement(node); case 223: - return emitVariableDeclaration(node); + return emitTryStatement(node); case 224: - return emitVariableDeclarationList(node); + return emitDebuggerStatement(node); case 225: - return emitFunctionDeclaration(node); + return emitVariableDeclaration(node); case 226: - return emitClassDeclaration(node); + return emitVariableDeclarationList(node); case 227: - return emitInterfaceDeclaration(node); + return emitFunctionDeclaration(node); case 228: - return emitTypeAliasDeclaration(node); + return emitClassDeclaration(node); case 229: - return emitEnumDeclaration(node); + return emitInterfaceDeclaration(node); case 230: - return emitModuleDeclaration(node); + return emitTypeAliasDeclaration(node); case 231: - return emitModuleBlock(node); + return emitEnumDeclaration(node); case 232: - return emitCaseBlock(node); + return emitModuleDeclaration(node); + case 233: + return emitModuleBlock(node); case 234: - return emitImportEqualsDeclaration(node); - case 235: - return emitImportDeclaration(node); + return emitCaseBlock(node); case 236: - return emitImportClause(node); + return emitImportEqualsDeclaration(node); case 237: - return emitNamespaceImport(node); + return emitImportDeclaration(node); case 238: - return emitNamedImports(node); + return emitImportClause(node); case 239: - return emitImportSpecifier(node); + return emitNamespaceImport(node); case 240: - return emitExportAssignment(node); + return emitNamedImports(node); case 241: - return emitExportDeclaration(node); + return emitImportSpecifier(node); case 242: - return emitNamedExports(node); + return emitExportAssignment(node); case 243: - return emitExportSpecifier(node); + return emitExportDeclaration(node); case 244: - return; + return emitNamedExports(node); case 245: + return emitExportSpecifier(node); + case 246: + return; + case 247: return emitExternalModuleReference(node); case 10: return emitJsxText(node); - case 248: - return emitJsxOpeningElement(node); - case 249: - return emitJsxClosingElement(node); case 250: - return emitJsxAttribute(node); + return emitJsxOpeningElement(node); case 251: - return emitJsxSpreadAttribute(node); + return emitJsxClosingElement(node); case 252: - return emitJsxExpression(node); + return emitJsxAttribute(node); case 253: - return emitCaseClause(node); + return emitJsxAttributes(node); case 254: - return emitDefaultClause(node); + return emitJsxSpreadAttribute(node); case 255: - return emitHeritageClause(node); + return emitJsxExpression(node); case 256: - return emitCatchClause(node); + return emitCaseClause(node); case 257: - return emitPropertyAssignment(node); + return emitDefaultClause(node); case 258: - return emitShorthandPropertyAssignment(node); + return emitHeritageClause(node); case 259: - return emitSpreadAssignment(node); + return emitCatchClause(node); case 260: + return emitPropertyAssignment(node); + case 261: + return emitShorthandPropertyAssignment(node); + case 262: + return emitSpreadAssignment(node); + case 263: return emitEnumMember(node); } if (ts.isExpression(node)) { - return pipelineEmitWithSubstitution(1, node); + return pipelineEmitExpression(trySubstituteNode(1, node)); + } + if (ts.isToken(node)) { + writeTokenText(kind); + return; } } - function pipelineEmitInExpressionContext(node) { + function pipelineEmitExpression(node) { var kind = node.kind; switch (kind) { case 8: @@ -48853,77 +53965,82 @@ var ts; case 98: writeTokenText(kind); return; - case 175: - return emitArrayLiteralExpression(node); case 176: - return emitObjectLiteralExpression(node); + return emitArrayLiteralExpression(node); case 177: - return emitPropertyAccessExpression(node); + return emitObjectLiteralExpression(node); case 178: - return emitElementAccessExpression(node); + return emitPropertyAccessExpression(node); case 179: - return emitCallExpression(node); + return emitElementAccessExpression(node); case 180: - return emitNewExpression(node); + return emitCallExpression(node); case 181: - return emitTaggedTemplateExpression(node); + return emitNewExpression(node); case 182: - return emitTypeAssertionExpression(node); + return emitTaggedTemplateExpression(node); case 183: - return emitParenthesizedExpression(node); + return emitTypeAssertionExpression(node); case 184: - return emitFunctionExpression(node); + return emitParenthesizedExpression(node); case 185: - return emitArrowFunction(node); + return emitFunctionExpression(node); case 186: - return emitDeleteExpression(node); + return emitArrowFunction(node); case 187: - return emitTypeOfExpression(node); + return emitDeleteExpression(node); case 188: - return emitVoidExpression(node); + return emitTypeOfExpression(node); case 189: - return emitAwaitExpression(node); + return emitVoidExpression(node); case 190: - return emitPrefixUnaryExpression(node); + return emitAwaitExpression(node); case 191: - return emitPostfixUnaryExpression(node); + return emitPrefixUnaryExpression(node); case 192: - return emitBinaryExpression(node); + return emitPostfixUnaryExpression(node); case 193: - return emitConditionalExpression(node); + return emitBinaryExpression(node); case 194: - return emitTemplateExpression(node); + return emitConditionalExpression(node); case 195: - return emitYieldExpression(node); + return emitTemplateExpression(node); case 196: - return emitSpreadExpression(node); + return emitYieldExpression(node); case 197: - return emitClassExpression(node); + return emitSpreadExpression(node); case 198: + return emitClassExpression(node); + case 199: return; - case 200: - return emitAsExpression(node); case 201: + return emitAsExpression(node); + case 202: return emitNonNullExpression(node); - case 246: + case 203: + return emitMetaProperty(node); + case 248: return emitJsxElement(node); - case 247: + case 249: return emitJsxSelfClosingElement(node); - case 294: + case 295: return emitPartiallyEmittedExpression(node); - case 297: - return writeLines(node.text); + } + } + function trySubstituteNode(hint, node) { + return node && substituteNode && substituteNode(hint, node) || node; + } + function emitHelpersIndirect(node) { + if (onEmitHelpers) { + onEmitHelpers(node, writeLines); } } function emitNumericLiteral(node) { emitLiteral(node); - if (node.trailingComment) { - write(" /*" + node.trailingComment + "*/"); - } } function emitLiteral(node) { var text = getLiteralTextOfNode(node); - if ((compilerOptions.sourceMap || compilerOptions.inlineSourceMap) + if ((printerOptions.sourceMap || printerOptions.inlineSourceMap) && (node.kind === 9 || ts.isTemplateLiteralKind(node.kind))) { writer.writeLiteral(text); } @@ -48962,8 +54079,8 @@ var ts; writeIfPresent(node.dotDotDotToken, "..."); emit(node.name); writeIfPresent(node.questionToken, "?"); - emitExpressionWithPrefix(" = ", node.initializer); emitWithPrefix(": ", node.type); + emitExpressionWithPrefix(" = ", node.initializer); } function emitDecorator(decorator) { write("@"); @@ -49010,7 +54127,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write(node.kind === 151 ? "get " : "set "); + write(node.kind === 152 ? "get " : "set "); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); } @@ -49110,17 +54227,13 @@ var ts; write("{"); writeLine(); increaseIndent(); - if (node.readonlyToken) { - write("readonly "); - } + writeIfPresent(node.readonlyToken, "readonly "); write("["); emit(node.typeParameter.name); write(" in "); emit(node.typeParameter.constraint); write("]"); - if (node.questionToken) { - write("?"); - } + writeIfPresent(node.questionToken, "?"); write(": "); emit(node.type); write(";"); @@ -49180,7 +54293,7 @@ var ts; increaseIndent(); } var preferNewLine = node.multiLine ? 32768 : 0; - var allowTrailingComma = languageVersion >= 1 ? 32 : 0; + var allowTrailingComma = currentSourceFile.languageVersion >= 1 ? 32 : 0; emitList(node, properties, 978 | allowTrailingComma | preferNewLine); if (indentedFlag) { decreaseIndent(); @@ -49192,7 +54305,7 @@ var ts; var indentAfterDot = false; if (!(ts.getEmitFlags(node) & 65536)) { var dotRangeStart = node.expression.end; - var dotRangeEnd = ts.skipTrivia(currentText, node.expression.end) + 1; + var dotRangeEnd = ts.skipTrivia(currentSourceFile.text, node.expression.end) + 1; var dotToken = { kind: 22, pos: dotRangeStart, end: dotRangeEnd }; indentBeforeDot = needsIndentation(node, node.expression, dotToken); indentAfterDot = needsIndentation(node, dotToken, node.name); @@ -49206,15 +54319,17 @@ var ts; decreaseIndentIf(indentBeforeDot, indentAfterDot); } function needsDotDotForPropertyAccess(expression) { - if (expression.kind === 8) { + expression = ts.skipPartiallyEmittedExpressions(expression); + if (ts.isNumericLiteral(expression)) { var text = getLiteralTextOfNode(expression); - return text.indexOf(ts.tokenToString(22)) < 0; + return !expression.numericLiteralFlags + && text.indexOf(ts.tokenToString(22)) < 0; } else if (ts.isPropertyAccessExpression(expression) || ts.isElementAccessExpression(expression)) { var constantValue = ts.getConstantValue(expression); return isFinite(constantValue) && Math.floor(constantValue) === constantValue - && compilerOptions.removeComments; + && printerOptions.removeComments; } } function emitElementAccessExpression(node) { @@ -49240,11 +54355,9 @@ var ts; emitExpression(node.template); } function emitTypeAssertionExpression(node) { - if (node.type) { - write("<"); - emit(node.type); - write(">"); - } + write("<"); + emit(node.type); + write(">"); emitExpression(node.expression); } function emitParenthesizedExpression(node) { @@ -49291,7 +54404,7 @@ var ts; } function shouldEmitWhitespaceBeforeOperand(node) { var operand = node.operand; - return operand.kind === 190 + return operand.kind === 191 && ((node.operator === 36 && (operand.operator === 36 || operand.operator === 42)) || (node.operator === 37 && (operand.operator === 37 || operand.operator === 43))); } @@ -49357,6 +54470,11 @@ var ts; emitExpression(node.expression); write("!"); } + function emitMetaProperty(node) { + writeToken(node.keywordToken, node.pos); + write("."); + emit(node.name); + } function emitTemplateSpan(node) { emitExpression(node.expression); emit(node.literal); @@ -49370,6 +54488,9 @@ var ts; else { writeToken(16, node.pos, node); emitBlockStatements(node); + increaseIndent(); + emitLeadingCommentsOfPosition(node.statements.end); + decreaseIndent(); writeToken(17, node.statements.end, node); } } @@ -49399,27 +54520,27 @@ var ts; writeToken(18, openParenPos, node); emitExpression(node.expression); writeToken(19, node.expression.end, node); - emitEmbeddedStatement(node.thenStatement); + emitEmbeddedStatement(node, node.thenStatement); if (node.elseStatement) { - writeLine(); + writeLineOrSpace(node); writeToken(81, node.thenStatement.end, node); - if (node.elseStatement.kind === 208) { + if (node.elseStatement.kind === 210) { write(" "); emit(node.elseStatement); } else { - emitEmbeddedStatement(node.elseStatement); + emitEmbeddedStatement(node, node.elseStatement); } } } function emitDoStatement(node) { write("do"); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); if (ts.isBlock(node.statement)) { write(" "); } else { - writeLine(); + writeLineOrSpace(node); } write("while ("); emitExpression(node.expression); @@ -49429,7 +54550,7 @@ var ts; write("while ("); emitExpression(node.expression); write(")"); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitForStatement(node) { var openParenPos = writeToken(87, node.pos); @@ -49441,7 +54562,7 @@ var ts; write(";"); emitExpressionWithPrefix(" ", node.incrementor); write(")"); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitForInStatement(node) { var openParenPos = writeToken(87, node.pos); @@ -49451,21 +54572,22 @@ var ts; write(" in "); emitExpression(node.expression); writeToken(19, node.expression.end); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitForOfStatement(node) { var openParenPos = writeToken(87, node.pos); write(" "); + emitWithSuffix(node.awaitModifier, " "); writeToken(18, openParenPos); emitForBinding(node.initializer); write(" of "); emitExpression(node.expression); writeToken(19, node.expression.end); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 224) { + if (node.kind === 226) { emit(node); } else { @@ -49492,7 +54614,7 @@ var ts; write("with ("); emitExpression(node.expression); write(")"); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitSwitchStatement(node) { var openParenPos = writeToken(97, node.pos); @@ -49516,9 +54638,12 @@ var ts; function emitTryStatement(node) { write("try "); emit(node.tryBlock); - emit(node.catchClause); + if (node.catchClause) { + writeLineOrSpace(node); + emit(node.catchClause); + } if (node.finallyBlock) { - writeLine(); + writeLineOrSpace(node); write("finally "); emit(node.finallyBlock); } @@ -49546,6 +54671,9 @@ var ts; emitIdentifierName(node.name); emitSignatureAndBody(node, emitSignatureHead); } + function emitBlockCallback(_hint, body) { + emitBlockFunctionBody(body); + } function emitSignatureAndBody(node, emitSignatureHead) { var body = node.body; if (body) { @@ -49556,14 +54684,23 @@ var ts; } if (ts.getEmitFlags(node) & 262144) { emitSignatureHead(node); - emitBlockFunctionBody(body); + if (onEmitNode) { + onEmitNode(3, body, emitBlockCallback); + } + else { + emitBlockFunctionBody(body); + } } else { - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); emitSignatureHead(node); - emitBlockFunctionBody(body); - tempFlags = savedTempFlags; + if (onEmitNode) { + onEmitNode(3, body, emitBlockCallback); + } + else { + emitBlockFunctionBody(body); + } + popNameGenerationScope(); } if (indentedFlag) { decreaseIndent(); @@ -49612,9 +54749,15 @@ var ts; function emitBlockFunctionBody(body) { write(" {"); increaseIndent(); - emitBodyWithDetachedComments(body, body.statements, shouldEmitBlockFunctionBodyOnSingleLine(body) + var emitBlockFunctionBody = shouldEmitBlockFunctionBodyOnSingleLine(body) ? emitBlockFunctionBodyOnSingleLine - : emitBlockFunctionBodyWorker); + : emitBlockFunctionBodyWorker; + if (emitBodyWithDetachedComments) { + emitBodyWithDetachedComments(body, body.statements, emitBlockFunctionBody); + } + else { + emitBlockFunctionBody(body); + } decreaseIndent(); writeToken(17, body.statements.end, body); } @@ -49623,8 +54766,9 @@ var ts; } function emitBlockFunctionBodyWorker(body, emitBlockFunctionBodyOnSingleLine) { var statementOffset = emitPrologueDirectives(body.statements, true); - var helpersEmitted = emitHelpers(body); - if (statementOffset === 0 && !helpersEmitted && emitBlockFunctionBodyOnSingleLine) { + var pos = writer.getTextPos(); + emitHelpersIndirect(body); + if (statementOffset === 0 && pos === writer.getTextPos() && emitBlockFunctionBodyOnSingleLine) { decreaseIndent(); emitList(body, body.statements, 384); increaseIndent(); @@ -49647,15 +54791,14 @@ var ts; } emitTypeParameters(node, node.typeParameters); emitList(node, node.heritageClauses, 256); - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); write(" {"); emitList(node, node.members, 65); write("}"); + popNameGenerationScope(); if (indentedFlag) { decreaseIndent(); } - tempFlags = savedTempFlags; } function emitInterfaceDeclaration(node) { emitDecorators(node, node.decorators); @@ -49682,19 +54825,18 @@ var ts; emitModifiers(node, node.modifiers); write("enum "); emit(node.name); - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); write(" {"); emitList(node, node.members, 81); write("}"); - tempFlags = savedTempFlags; + popNameGenerationScope(); } function emitModuleDeclaration(node) { emitModifiers(node, node.modifiers); write(node.flags & 16 ? "namespace " : "module "); emit(node.name); var body = node.body; - while (body.kind === 230) { + while (body.kind === 232) { write("."); emit(body.name); body = body.body; @@ -49707,13 +54849,11 @@ var ts; write("{ }"); } else { - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); write("{"); - increaseIndent(); emitBlockStatements(node); write("}"); - tempFlags = savedTempFlags; + popNameGenerationScope(); } } function emitCaseBlock(node) { @@ -49815,14 +54955,18 @@ var ts; write("<"); emitJsxTagName(node.tagName); write(" "); - emitList(node, node.attributes, 131328); + if (node.attributes.properties && node.attributes.properties.length > 0) { + emit(node.attributes); + } write("/>"); } function emitJsxOpeningElement(node) { write("<"); emitJsxTagName(node.tagName); - writeIfAny(node.attributes, " "); - emitList(node, node.attributes, 131328); + writeIfAny(node.attributes.properties, " "); + if (node.attributes.properties && node.attributes.properties.length > 0) { + emit(node.attributes); + } write(">"); } function emitJsxText(node) { @@ -49833,6 +54977,9 @@ var ts; emitJsxTagName(node.tagName); write(">"); } + function emitJsxAttributes(node) { + emitList(node, node.properties, 131328); + } function emitJsxAttribute(node) { emit(node.name); emitWithPrefix("=", node.initializer); @@ -49845,6 +54992,9 @@ var ts; function emitJsxExpression(node) { if (node.expression) { write("{"); + if (node.dotDotDotToken) { + write("..."); + } emitExpression(node.expression); write("}"); } @@ -49887,7 +55037,6 @@ var ts; emitList(node, node.types, 272); } function emitCatchClause(node) { - writeLine(); var openParenPos = writeToken(73, node.pos); write(" "); writeToken(18, openParenPos); @@ -49900,7 +55049,7 @@ var ts; emit(node.name); write(": "); var initializer = node.initializer; - if ((ts.getEmitFlags(initializer) & 512) === 0) { + if (emitTrailingCommentsOfPosition && (ts.getEmitFlags(initializer) & 512) === 0) { var commentRange = ts.getCommentRange(initializer); emitTrailingCommentsOfPosition(commentRange.pos); } @@ -49925,28 +55074,43 @@ var ts; } function emitSourceFile(node) { writeLine(); - emitShebang(); - emitBodyWithDetachedComments(node, node.statements, emitSourceFileWorker); + var statements = node.statements; + if (emitBodyWithDetachedComments) { + var shouldEmitDetachedComment = statements.length === 0 || + !ts.isPrologueDirective(statements[0]) || + ts.nodeIsSynthesized(statements[0]); + if (shouldEmitDetachedComment) { + emitBodyWithDetachedComments(node, statements, emitSourceFileWorker); + return; + } + } + emitSourceFileWorker(node); } function emitSourceFileWorker(node) { var statements = node.statements; - var statementOffset = emitPrologueDirectives(statements); - var savedTempFlags = tempFlags; - tempFlags = 0; - emitHelpers(node); - emitList(node, statements, 1, statementOffset); - tempFlags = savedTempFlags; + pushNameGenerationScope(); + emitHelpersIndirect(node); + var index = ts.findIndex(statements, function (statement) { return !ts.isPrologueDirective(statement); }); + emitList(node, statements, 1, index === -1 ? statements.length : index); + popNameGenerationScope(); } function emitPartiallyEmittedExpression(node) { emitExpression(node.expression); } - function emitPrologueDirectives(statements, startWithNewLine) { + function emitPrologueDirectives(statements, startWithNewLine, seenPrologueDirectives) { for (var i = 0; i < statements.length; i++) { - if (ts.isPrologueDirective(statements[i])) { - if (startWithNewLine || i > 0) { - writeLine(); + var statement = statements[i]; + if (ts.isPrologueDirective(statement)) { + var shouldEmitPrologueDirective = seenPrologueDirectives ? !seenPrologueDirectives.has(statement.expression.text) : true; + if (shouldEmitPrologueDirective) { + if (startWithNewLine || i > 0) { + writeLine(); + } + emit(statement); + if (seenPrologueDirectives) { + seenPrologueDirectives.set(statement.expression.text, statement.expression.text); + } } - emit(statements[i]); } else { return i; @@ -49954,70 +55118,36 @@ var ts; } return statements.length; } - function emitHelpers(node, isBundle) { - var sourceFile = ts.isSourceFile(node) ? node : currentSourceFile; - var shouldSkip = compilerOptions.noEmitHelpers || (sourceFile && ts.getExternalHelpersModuleName(sourceFile) !== undefined); - var shouldBundle = ts.isSourceFile(node) && !isOwnFileEmit; - var helpersEmitted = false; - var helpers = ts.getEmitHelpers(node); - if (helpers) { - for (var _a = 0, _b = ts.stableSort(helpers, ts.compareEmitHelpers); _a < _b.length; _a++) { - var helper = _b[_a]; - if (!helper.scoped) { - if (shouldSkip) - continue; - if (shouldBundle) { - if (bundledHelpers[helper.name]) { - continue; - } - bundledHelpers[helper.name] = true; - } - } - else if (isBundle) { - continue; - } - writeLines(helper.text); - helpersEmitted = true; - } + function emitPrologueDirectivesIfNeeded(sourceFileOrBundle) { + if (ts.isSourceFile(sourceFileOrBundle)) { + setSourceFile(sourceFileOrBundle); + emitPrologueDirectives(sourceFileOrBundle.statements); } - if (helpersEmitted) { - writeLine(); - } - return helpersEmitted; - } - function writeLines(text) { - var lines = text.split(/\r\n?|\n/g); - var indentation = guessIndentation(lines); - for (var i = 0; i < lines.length; i++) { - var line = indentation ? lines[i].slice(indentation) : lines[i]; - if (line.length) { - if (i > 0) { - writeLine(); - } - write(line); + else { + var seenPrologueDirectives = ts.createMap(); + for (var _a = 0, _b = sourceFileOrBundle.sourceFiles; _a < _b.length; _a++) { + var sourceFile = _b[_a]; + setSourceFile(sourceFile); + emitPrologueDirectives(sourceFile.statements, true, seenPrologueDirectives); } } } - function guessIndentation(lines) { - var indentation; - for (var _a = 0, lines_1 = lines; _a < lines_1.length; _a++) { - var line = lines_1[_a]; - for (var i = 0; i < line.length && (indentation === undefined || i < indentation); i++) { - if (!ts.isWhiteSpace(line.charCodeAt(i))) { - if (indentation === undefined || i < indentation) { - indentation = i; - break; - } - } + function emitShebangIfNeeded(sourceFileOrBundle) { + if (ts.isSourceFile(sourceFileOrBundle)) { + var shebang = ts.getShebang(sourceFileOrBundle.text); + if (shebang) { + write(shebang); + writeLine(); + return true; } } - return indentation; - } - function emitShebang() { - var shebang = ts.getShebang(currentText); - if (shebang) { - write(shebang); - writeLine(); + else { + for (var _a = 0, _b = sourceFileOrBundle.sourceFiles; _a < _b.length; _a++) { + var sourceFile = _b[_a]; + if (emitShebangIfNeeded(sourceFile)) { + break; + } + } } } function emitModifiers(node, modifiers) { @@ -50044,8 +55174,8 @@ var ts; write(suffix); } } - function emitEmbeddedStatement(node) { - if (ts.isBlock(node)) { + function emitEmbeddedStatement(parent, node) { + if (ts.isBlock(node) || ts.getEmitFlags(parent) & 1) { write(" "); emit(node); } @@ -50102,6 +55232,9 @@ var ts; if (format & 7680) { write(getOpeningBracket(format)); } + if (onBeforeEmitNodeArray) { + onBeforeEmitNodeArray(children); + } if (isEmpty) { if (format & 1) { writeLine(); @@ -50129,6 +55262,9 @@ var ts; for (var i = 0; i < count; i++) { var child = children[start + i]; if (previousSibling) { + if (delimiter && previousSibling.end !== parentNode.end) { + emitLeadingCommentsOfPosition(previousSibling.end); + } write(delimiter); if (shouldWriteSeparatingLineTerminator(previousSibling, child, format)) { if ((format & (3 | 64)) === 0) { @@ -50143,8 +55279,10 @@ var ts; } } if (shouldEmitInterveningComments) { - var commentRange = ts.getCommentRange(child); - emitTrailingCommentsOfPosition(commentRange.pos); + if (emitTrailingCommentsOfPosition) { + var commentRange = ts.getCommentRange(child); + emitTrailingCommentsOfPosition(commentRange.pos); + } } else { shouldEmitInterveningComments = mayEmitInterveningComments; @@ -50160,6 +55298,9 @@ var ts; if (format & 16 && hasTrailingComma) { write(","); } + if (previousSibling && delimiter && previousSibling.end !== parentNode.end) { + emitLeadingCommentsOfPosition(previousSibling.end); + } if (format & 64) { decreaseIndent(); } @@ -50170,28 +55311,80 @@ var ts; write(" "); } } + if (onAfterEmitNodeArray) { + onAfterEmitNodeArray(children); + } if (format & 7680) { write(getClosingBracket(format)); } } + function write(s) { + writer.write(s); + } + function writeLine() { + writer.writeLine(); + } + function increaseIndent() { + writer.increaseIndent(); + } + function decreaseIndent() { + writer.decreaseIndent(); + } function writeIfAny(nodes, text) { - if (nodes && nodes.length > 0) { + if (ts.some(nodes)) { write(text); } } function writeIfPresent(node, text) { - if (node !== undefined) { + if (node) { write(text); } } function writeToken(token, pos, contextNode) { - return emitTokenWithSourceMap(contextNode, token, pos, writeTokenText); + return onEmitSourceMapOfToken + ? onEmitSourceMapOfToken(contextNode, token, pos, writeTokenText) + : writeTokenText(token, pos); } function writeTokenText(token, pos) { var tokenString = ts.tokenToString(token); write(tokenString); return pos < 0 ? pos : pos + tokenString.length; } + function writeLineOrSpace(node) { + if (ts.getEmitFlags(node) & 1) { + write(" "); + } + else { + writeLine(); + } + } + function writeLines(text) { + var lines = text.split(/\r\n?|\n/g); + var indentation = guessIndentation(lines); + for (var i = 0; i < lines.length; i++) { + var line = indentation ? lines[i].slice(indentation) : lines[i]; + if (line.length) { + writeLine(); + write(line); + writeLine(); + } + } + } + function guessIndentation(lines) { + var indentation; + for (var _a = 0, lines_1 = lines; _a < lines_1.length; _a++) { + var line = lines_1[_a]; + for (var i = 0; i < line.length && (indentation === undefined || i < indentation); i++) { + if (!ts.isWhiteSpace(line.charCodeAt(i))) { + if (indentation === undefined || i < indentation) { + indentation = i; + break; + } + } + } + } + return indentation; + } function increaseIndentIf(value, valueToWriteWhenNotIndenting) { if (value) { increaseIndent(); @@ -50296,15 +55489,23 @@ var ts; && !ts.nodeIsSynthesized(node2) && !ts.rangeEndIsOnSameLineAsRangeStart(node1, node2, currentSourceFile); } + function isSingleLineEmptyBlock(block) { + return !block.multiLine + && isEmptyBlock(block); + } + function isEmptyBlock(block) { + return block.statements.length === 0 + && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); + } function skipSynthesizedParentheses(node) { - while (node.kind === 183 && ts.nodeIsSynthesized(node)) { + while (node.kind === 184 && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; } function getTextOfNode(node, includeTrivia) { if (ts.isGeneratedIdentifier(node)) { - return getGeneratedIdentifier(node); + return generateName(node); } else if (ts.isIdentifier(node) && (ts.nodeIsSynthesized(node) || !node.parent)) { return ts.unescapeIdentifier(node.text); @@ -50327,25 +55528,39 @@ var ts; return getLiteralTextOfNode(textSourceNode); } } - return ts.getLiteralText(node, currentSourceFile, languageVersion); + return ts.getLiteralText(node, currentSourceFile); } - function isSingleLineEmptyBlock(block) { - return !block.multiLine - && isEmptyBlock(block); + function pushNameGenerationScope() { + tempFlagsStack.push(tempFlags); + tempFlags = 0; } - function isEmptyBlock(block) { - return block.statements.length === 0 - && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); + function popNameGenerationScope() { + tempFlags = tempFlagsStack.pop(); + } + function generateName(name) { + if (name.autoGenerateKind === 4) { + var node = getNodeForGeneratedName(name); + return generateNameCached(node); + } + else { + var autoGenerateId = name.autoGenerateId; + return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = ts.unescapeIdentifier(makeName(name))); + } + } + function generateNameCached(node) { + var nodeId = ts.getNodeId(node); + return nodeIdToGeneratedName[nodeId] || (nodeIdToGeneratedName[nodeId] = ts.unescapeIdentifier(generateNameForNode(node))); } function isUniqueName(name) { - return !resolver.hasGlobalName(name) && - !ts.hasProperty(currentFileIdentifiers, name) && - !ts.hasProperty(generatedNameSet, name); + return !(hasGlobalName && hasGlobalName(name)) + && !currentSourceFile.identifiers.has(name) + && !generatedNames.has(name); } function isUniqueLocalName(name, container) { for (var node = container; ts.isNodeDescendantOf(node, container); node = node.nextContainer) { - if (node.locals && ts.hasProperty(node.locals, name)) { - if (node.locals[name].flags & (107455 | 1048576 | 8388608)) { + if (node.locals) { + var local = node.locals.get(name); + if (local && local.flags & (107455 | 1048576 | 8388608)) { return false; } } @@ -50354,21 +55569,21 @@ var ts; } function makeTempVariableName(flags) { if (flags && !(tempFlags & flags)) { - var name_41 = flags === 268435456 ? "_i" : "_n"; - if (isUniqueName(name_41)) { + var name = flags === 268435456 ? "_i" : "_n"; + if (isUniqueName(name)) { tempFlags |= flags; - return name_41; + return name; } } while (true) { var count = tempFlags & 268435455; tempFlags++; if (count !== 8 && count !== 13) { - var name_42 = count < 26 + var name = count < 26 ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26); - if (isUniqueName(name_42)) { - return name_42; + if (isUniqueName(name)) { + return name; } } } @@ -50381,7 +55596,8 @@ var ts; while (true) { var generatedName = baseName + i; if (isUniqueName(generatedName)) { - return generatedNameSet[generatedName] = generatedName; + generatedNames.set(generatedName, generatedName); + return generatedName; } i++; } @@ -50402,34 +55618,44 @@ var ts; function generateNameForClassExpression() { return makeUniqueName("class"); } + function generateNameForMethodOrAccessor(node) { + if (ts.isIdentifier(node.name)) { + return generateNameCached(node.name); + } + return makeTempVariableName(0); + } function generateNameForNode(node) { switch (node.kind) { case 70: return makeUniqueName(getTextOfNode(node)); - case 230: - case 229: + case 232: + case 231: return generateNameForModuleOrEnum(node); - case 235: - case 241: + case 237: + case 243: return generateNameForImportOrExportDeclaration(node); - case 225: - case 226: - case 240: + case 227: + case 228: + case 242: return generateNameForExportDefault(); - case 197: + case 198: return generateNameForClassExpression(); + case 150: + case 152: + case 153: + return generateNameForMethodOrAccessor(node); default: return makeTempVariableName(0); } } - function generateName(name) { + function makeName(name) { switch (name.autoGenerateKind) { case 1: return makeTempVariableName(0); case 2: return makeTempVariableName(268435456); case 3: - return makeUniqueName(name.text); + return makeUniqueName(ts.unescapeIdentifier(name.text)); } ts.Debug.fail("Unsupported GeneratedIdentifierKind."); } @@ -50448,48 +55674,106 @@ var ts; } return node; } - function getGeneratedIdentifier(name) { - if (name.autoGenerateKind === 4) { - var node = getNodeForGeneratedName(name); - var nodeId = ts.getNodeId(node); - return nodeIdToGeneratedName[nodeId] || (nodeIdToGeneratedName[nodeId] = ts.unescapeIdentifier(generateNameForNode(node))); - } - else { - var autoGenerateId = name.autoGenerateId; - return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = ts.unescapeIdentifier(generateName(name))); - } - } - function createDelimiterMap() { - var delimiters = []; - delimiters[0] = ""; - delimiters[16] = ","; - delimiters[4] = " |"; - delimiters[8] = " &"; - return delimiters; - } - function getDelimiter(format) { - return delimiters[format & 28]; - } - function createBracketsMap() { - var brackets = []; - brackets[512] = ["{", "}"]; - brackets[1024] = ["(", ")"]; - brackets[2048] = ["<", ">"]; - brackets[4096] = ["[", "]"]; - return brackets; - } - function getOpeningBracket(format) { - return brackets[format & 7680][0]; - } - function getClosingBracket(format) { - return brackets[format & 7680][1]; - } } - ts.emitFiles = emitFiles; + ts.createPrinter = createPrinter; + function createDelimiterMap() { + var delimiters = []; + delimiters[0] = ""; + delimiters[16] = ","; + delimiters[4] = " |"; + delimiters[8] = " &"; + return delimiters; + } + function getDelimiter(format) { + return delimiters[format & 28]; + } + function createBracketsMap() { + var brackets = []; + brackets[512] = ["{", "}"]; + brackets[1024] = ["(", ")"]; + brackets[2048] = ["<", ">"]; + brackets[4096] = ["[", "]"]; + return brackets; + } + function getOpeningBracket(format) { + return brackets[format & 7680][0]; + } + function getClosingBracket(format) { + return brackets[format & 7680][1]; + } + var TempFlags; + (function (TempFlags) { + TempFlags[TempFlags["Auto"] = 0] = "Auto"; + TempFlags[TempFlags["CountMask"] = 268435455] = "CountMask"; + TempFlags[TempFlags["_i"] = 268435456] = "_i"; + })(TempFlags || (TempFlags = {})); + var ListFormat; + (function (ListFormat) { + ListFormat[ListFormat["None"] = 0] = "None"; + ListFormat[ListFormat["SingleLine"] = 0] = "SingleLine"; + ListFormat[ListFormat["MultiLine"] = 1] = "MultiLine"; + ListFormat[ListFormat["PreserveLines"] = 2] = "PreserveLines"; + ListFormat[ListFormat["LinesMask"] = 3] = "LinesMask"; + ListFormat[ListFormat["NotDelimited"] = 0] = "NotDelimited"; + ListFormat[ListFormat["BarDelimited"] = 4] = "BarDelimited"; + ListFormat[ListFormat["AmpersandDelimited"] = 8] = "AmpersandDelimited"; + ListFormat[ListFormat["CommaDelimited"] = 16] = "CommaDelimited"; + ListFormat[ListFormat["DelimitersMask"] = 28] = "DelimitersMask"; + ListFormat[ListFormat["AllowTrailingComma"] = 32] = "AllowTrailingComma"; + ListFormat[ListFormat["Indented"] = 64] = "Indented"; + ListFormat[ListFormat["SpaceBetweenBraces"] = 128] = "SpaceBetweenBraces"; + ListFormat[ListFormat["SpaceBetweenSiblings"] = 256] = "SpaceBetweenSiblings"; + ListFormat[ListFormat["Braces"] = 512] = "Braces"; + ListFormat[ListFormat["Parenthesis"] = 1024] = "Parenthesis"; + ListFormat[ListFormat["AngleBrackets"] = 2048] = "AngleBrackets"; + ListFormat[ListFormat["SquareBrackets"] = 4096] = "SquareBrackets"; + ListFormat[ListFormat["BracketsMask"] = 7680] = "BracketsMask"; + ListFormat[ListFormat["OptionalIfUndefined"] = 8192] = "OptionalIfUndefined"; + ListFormat[ListFormat["OptionalIfEmpty"] = 16384] = "OptionalIfEmpty"; + ListFormat[ListFormat["Optional"] = 24576] = "Optional"; + ListFormat[ListFormat["PreferNewLine"] = 32768] = "PreferNewLine"; + ListFormat[ListFormat["NoTrailingNewLine"] = 65536] = "NoTrailingNewLine"; + ListFormat[ListFormat["NoInterveningComments"] = 131072] = "NoInterveningComments"; + ListFormat[ListFormat["Modifiers"] = 256] = "Modifiers"; + ListFormat[ListFormat["HeritageClauses"] = 256] = "HeritageClauses"; + ListFormat[ListFormat["TypeLiteralMembers"] = 65] = "TypeLiteralMembers"; + ListFormat[ListFormat["TupleTypeElements"] = 336] = "TupleTypeElements"; + ListFormat[ListFormat["UnionTypeConstituents"] = 260] = "UnionTypeConstituents"; + ListFormat[ListFormat["IntersectionTypeConstituents"] = 264] = "IntersectionTypeConstituents"; + ListFormat[ListFormat["ObjectBindingPatternElements"] = 432] = "ObjectBindingPatternElements"; + ListFormat[ListFormat["ArrayBindingPatternElements"] = 304] = "ArrayBindingPatternElements"; + ListFormat[ListFormat["ObjectLiteralExpressionProperties"] = 978] = "ObjectLiteralExpressionProperties"; + ListFormat[ListFormat["ArrayLiteralExpressionElements"] = 4466] = "ArrayLiteralExpressionElements"; + ListFormat[ListFormat["CallExpressionArguments"] = 1296] = "CallExpressionArguments"; + ListFormat[ListFormat["NewExpressionArguments"] = 9488] = "NewExpressionArguments"; + ListFormat[ListFormat["TemplateExpressionSpans"] = 131072] = "TemplateExpressionSpans"; + ListFormat[ListFormat["SingleLineBlockStatements"] = 384] = "SingleLineBlockStatements"; + ListFormat[ListFormat["MultiLineBlockStatements"] = 65] = "MultiLineBlockStatements"; + ListFormat[ListFormat["VariableDeclarationList"] = 272] = "VariableDeclarationList"; + ListFormat[ListFormat["SingleLineFunctionBodyStatements"] = 384] = "SingleLineFunctionBodyStatements"; + ListFormat[ListFormat["MultiLineFunctionBodyStatements"] = 1] = "MultiLineFunctionBodyStatements"; + ListFormat[ListFormat["ClassHeritageClauses"] = 256] = "ClassHeritageClauses"; + ListFormat[ListFormat["ClassMembers"] = 65] = "ClassMembers"; + ListFormat[ListFormat["InterfaceMembers"] = 65] = "InterfaceMembers"; + ListFormat[ListFormat["EnumMembers"] = 81] = "EnumMembers"; + ListFormat[ListFormat["CaseBlockClauses"] = 65] = "CaseBlockClauses"; + ListFormat[ListFormat["NamedImportsOrExportsElements"] = 432] = "NamedImportsOrExportsElements"; + ListFormat[ListFormat["JsxElementChildren"] = 131072] = "JsxElementChildren"; + ListFormat[ListFormat["JsxElementAttributes"] = 131328] = "JsxElementAttributes"; + ListFormat[ListFormat["CaseOrDefaultClauseStatements"] = 81985] = "CaseOrDefaultClauseStatements"; + ListFormat[ListFormat["HeritageClauseTypes"] = 272] = "HeritageClauseTypes"; + ListFormat[ListFormat["SourceFileStatements"] = 65537] = "SourceFileStatements"; + ListFormat[ListFormat["Decorators"] = 24577] = "Decorators"; + ListFormat[ListFormat["TypeArguments"] = 26960] = "TypeArguments"; + ListFormat[ListFormat["TypeParameters"] = 26960] = "TypeParameters"; + ListFormat[ListFormat["Parameters"] = 1360] = "Parameters"; + ListFormat[ListFormat["IndexSignatureParameters"] = 4432] = "IndexSignatureParameters"; + })(ListFormat || (ListFormat = {})); })(ts || (ts = {})); var ts; (function (ts) { var emptyArray = []; + var ignoreDiagnosticCommentRegEx = /(^\s*$)|(^\s*\/\/\/?\s*(@ts-ignore)?)/; function findConfigFile(searchPath, fileExists, configName) { if (configName === void 0) { configName = "tsconfig.json"; } while (true) { @@ -50521,7 +55805,8 @@ var ts; commonPathComponents = sourcePathComponents; return; } - for (var i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) { + var n = Math.min(commonPathComponents.length, sourcePathComponents.length); + for (var i = 0; i < n; i++) { if (getCanonicalFileName(commonPathComponents[i]) !== getCanonicalFileName(sourcePathComponents[i])) { if (i === 0) { return true; @@ -50548,7 +55833,6 @@ var ts; function getCanonicalFileName(fileName) { return ts.sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(); } - var unsupportedFileEncodingErrorCode = -2147024809; function getSourceFile(fileName, languageVersion, onError) { var text; try { @@ -50559,20 +55843,18 @@ var ts; } catch (e) { if (onError) { - onError(e.number === unsupportedFileEncodingErrorCode - ? ts.createCompilerDiagnostic(ts.Diagnostics.Unsupported_file_encoding).messageText - : e.message); + onError(e.message); } text = ""; } return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion, setParentNodes) : undefined; } function directoryExists(directoryPath) { - if (directoryPath in existingDirectories) { + if (existingDirectories.has(directoryPath)) { return true; } if (ts.sys.directoryExists(directoryPath)) { - existingDirectories[directoryPath] = true; + existingDirectories.set(directoryPath, true); return true; } return false; @@ -50591,9 +55873,10 @@ var ts; } var hash = ts.sys.createHash(data); var mtimeBefore = ts.sys.getModifiedTime(fileName); - if (mtimeBefore && fileName in outputFingerprints) { - var fingerprint = outputFingerprints[fileName]; - if (fingerprint.byteOrderMark === writeByteOrderMark && + if (mtimeBefore) { + var fingerprint = outputFingerprints.get(fileName); + if (fingerprint && + fingerprint.byteOrderMark === writeByteOrderMark && fingerprint.hash === hash && fingerprint.mtime.getTime() === mtimeBefore.getTime()) { return; @@ -50601,11 +55884,11 @@ var ts; } ts.sys.writeFile(fileName, data, writeByteOrderMark); var mtimeAfter = ts.sys.getModifiedTime(fileName); - outputFingerprints[fileName] = { + outputFingerprints.set(fileName, { hash: hash, byteOrderMark: writeByteOrderMark, mtime: mtimeAfter - }; + }); } function writeFile(fileName, data, writeByteOrderMark, onError) { try { @@ -50704,10 +55987,14 @@ var ts; var resolutions = []; var cache = ts.createMap(); for (var _i = 0, names_1 = names; _i < names_1.length; _i++) { - var name_43 = names_1[_i]; - var result = name_43 in cache - ? cache[name_43] - : cache[name_43] = loader(name_43, containingFile); + var name = names_1[_i]; + var result = void 0; + if (cache.has(name)) { + result = cache.get(name); + } + else { + cache.set(name, result = loader(name, containingFile)); + } resolutions.push(result); } return resolutions; @@ -50719,6 +56006,8 @@ var ts; var diagnosticsProducingTypeChecker; var noDiagnosticsTypeChecker; var classifiableNames; + var cachedSemanticDiagnosticsForFile = {}; + var cachedDeclarationDiagnosticsForFile = {}; var resolvedTypeReferenceDirectives = ts.createMap(); var fileProcessingDiagnostics = ts.createDiagnosticCollection(); var maxNodeModuleJsDepth = typeof options.maxNodeModuleJsDepth === "number" ? options.maxNodeModuleJsDepth : 0; @@ -50732,6 +56021,7 @@ var ts; var currentDirectory = host.getCurrentDirectory(); var supportedExtensions = ts.getSupportedExtensions(options); var hasEmitBlockingDiagnostics = ts.createFileMap(getCanonicalFileName); + var moduleResolutionCache; var resolveModuleNamesWorker; if (host.resolveModuleNames) { resolveModuleNamesWorker = function (moduleNames, containingFile) { return host.resolveModuleNames(moduleNames, containingFile).map(function (resolved) { @@ -50744,7 +56034,8 @@ var ts; }); }; } else { - var loader_1 = function (moduleName, containingFile) { return ts.resolveModuleName(moduleName, containingFile, options, host).resolvedModule; }; + moduleResolutionCache = ts.createModuleResolutionCache(currentDirectory, function (x) { return host.getCanonicalFileName(x); }); + var loader_1 = function (moduleName, containingFile) { return ts.resolveModuleName(moduleName, containingFile, options, host, moduleResolutionCache).resolvedModule; }; resolveModuleNamesWorker = function (moduleNames, containingFile) { return loadWithLocalCache(moduleNames, containingFile, loader_1); }; } var resolveTypeReferenceDirectiveNamesWorker; @@ -50780,6 +56071,7 @@ var ts; } } } + moduleResolutionCache = undefined; oldProgram = undefined; program = { getRootFileNames: function () { return rootNames; }, @@ -50813,7 +56105,7 @@ var ts; return program; function getCommonSourceDirectory() { if (commonSourceDirectory === undefined) { - var emittedFiles = ts.filterSourceFilesInDirectory(files, isSourceFileFromExternalLibrary); + var emittedFiles = ts.filter(files, function (file) { return ts.sourceFileMayBeEmitted(file, options, isSourceFileFromExternalLibrary); }); if (options.rootDir && checkSourceFilesBelongToPath(emittedFiles, options.rootDir)) { commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory); } @@ -50832,7 +56124,7 @@ var ts; classifiableNames = ts.createMap(); for (var _i = 0, files_2 = files; _i < files_2.length; _i++) { var sourceFile = files_2[_i]; - ts.copyProperties(sourceFile.classifiableNames, classifiableNames); + ts.copyEntries(sourceFile.classifiableNames, classifiableNames); } } return classifiableNames; @@ -50875,7 +56167,7 @@ var ts; : emptyArray; var j = 0; for (var i = 0; i < result.length; i++) { - if (result[i] == predictedToResolveToAmbientModuleMarker) { + if (result[i] === predictedToResolveToAmbientModuleMarker) { result[i] = undefined; } else { @@ -50986,7 +56278,7 @@ var ts; newSourceFile.resolvedModules = oldSourceFile.resolvedModules; newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames; } - for (var i = 0, len = newSourceFiles.length; i < len; i++) { + for (var i = 0; i < newSourceFiles.length; i++) { filesByName.set(filePaths[i], newSourceFiles[i]); } files = newSourceFiles; @@ -51015,7 +56307,7 @@ var ts; }; } function isSourceFileFromExternalLibrary(file) { - return sourceFilesFoundSearchingNodeModules[file.path]; + return sourceFilesFoundSearchingNodeModules.get(file.path); } function getDiagnosticsProducingTypeChecker() { return diagnosticsProducingTypeChecker || (diagnosticsProducingTypeChecker = ts.createTypeChecker(program, true)); @@ -51026,13 +56318,13 @@ var ts; function getTypeChecker() { return noDiagnosticsTypeChecker || (noDiagnosticsTypeChecker = ts.createTypeChecker(program, false)); } - function emit(sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles) { - return runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles); }); + function emit(sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers) { + return runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers); }); } function isEmitBlocked(emitFileName) { return hasEmitBlockingDiagnostics.contains(ts.toPath(emitFileName, currentDirectory, getCanonicalFileName)); } - function emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles) { + function emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, customTransformers) { var declarationDiagnostics = []; if (options.noEmit) { return { diagnostics: declarationDiagnostics, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true }; @@ -51053,7 +56345,8 @@ var ts; } var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile); ts.performance.mark("beforeEmit"); - var emitResult = ts.emitFiles(emitResolver, getEmitHost(writeFileCallback), sourceFile, emitOnlyDtsFiles); + var transformers = emitOnlyDtsFiles ? [] : ts.getTransformers(options, customTransformers); + var emitResult = ts.emitFiles(emitResolver, getEmitHost(writeFileCallback), sourceFile, emitOnlyDtsFiles, transformers); ts.performance.mark("afterEmit"); ts.performance.measure("Emit", "beforeEmit", "afterEmit"); return emitResult; @@ -51114,16 +56407,42 @@ var ts; } } function getSemanticDiagnosticsForFile(sourceFile, cancellationToken) { + return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedSemanticDiagnosticsForFile, getSemanticDiagnosticsForFileNoCache); + } + function getSemanticDiagnosticsForFileNoCache(sourceFile, cancellationToken) { return runWithCancellationToken(function () { var typeChecker = getDiagnosticsProducingTypeChecker(); ts.Debug.assert(!!sourceFile.bindDiagnostics); var bindDiagnostics = sourceFile.bindDiagnostics; - var checkDiagnostics = ts.isSourceFileJavaScript(sourceFile) ? [] : typeChecker.getDiagnostics(sourceFile, cancellationToken); + var includeCheckDiagnostics = !ts.isSourceFileJavaScript(sourceFile) || ts.isCheckJsEnabledForFile(sourceFile, options); + var checkDiagnostics = includeCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : []; var fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName); var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName); - return bindDiagnostics.concat(checkDiagnostics, fileProcessingDiagnosticsInFile, programDiagnosticsInFile); + var diagnostics = bindDiagnostics.concat(checkDiagnostics, fileProcessingDiagnosticsInFile, programDiagnosticsInFile); + return ts.isSourceFileJavaScript(sourceFile) + ? ts.filter(diagnostics, shouldReportDiagnostic) + : diagnostics; }); } + function shouldReportDiagnostic(diagnostic) { + var file = diagnostic.file, start = diagnostic.start; + if (file) { + var lineStarts = ts.getLineStarts(file); + var line = ts.computeLineAndCharacterOfPosition(lineStarts, start).line; + while (line > 0) { + var previousLineText = file.text.slice(lineStarts[line - 1], lineStarts[line]); + var result = ignoreDiagnosticCommentRegEx.exec(previousLineText); + if (!result) { + return true; + } + if (result[3]) { + return false; + } + line--; + } + } + return true; + } function getJavaScriptSyntacticDiagnosticsForFile(sourceFile) { return runWithCancellationToken(function () { var diagnostics = []; @@ -51132,57 +56451,57 @@ var ts; return diagnostics; function walk(node) { switch (parent.kind) { - case 144: - case 147: + case 145: + case 148: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, "?")); return; } - case 149: - case 148: case 150: + case 149: case 151: case 152: - case 184: - case 225: + case 153: case 185: + case 227: + case 186: + case 227: case 225: - case 223: if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); return; } } switch (node.kind) { - case 234: + case 236: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); return; - case 240: + case 242: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); return; } break; - case 255: + case 258: var heritageClause = node; if (heritageClause.token === 107) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); return; } break; - case 227: + case 229: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); return; - case 230: + case 232: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); return; - case 228: + case 230: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); return; - case 229: + case 231: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); return; - case 182: + case 183: var typeAssertionExpression = node; diagnostics.push(createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); return; @@ -51197,26 +56516,26 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning)); } switch (parent.kind) { - case 226: - case 149: - case 148: + case 228: case 150: + case 149: case 151: case 152: - case 184: - case 225: + case 153: case 185: - case 225: + case 227: + case 186: + case 227: if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); return; } - case 205: + case 207: if (nodes === parent.modifiers) { - return checkModifiers(nodes, parent.kind === 205); + return checkModifiers(nodes, parent.kind === 207); } break; - case 147: + case 148: if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { var modifier = _a[_i]; @@ -51227,23 +56546,23 @@ var ts; return; } break; - case 144: + case 145: if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); return; } break; - case 179: case 180: - case 199: + case 181: + case 200: if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); return; } break; } - for (var _b = 0, nodes_6 = nodes; _b < nodes_6.length; _b++) { - var node = nodes_6[_b]; + for (var _b = 0, nodes_8 = nodes; _b < nodes_8.length; _b++) { + var node = nodes_8[_b]; walk(node); } } @@ -51279,11 +56598,33 @@ var ts; }); } function getDeclarationDiagnosticsWorker(sourceFile, cancellationToken) { + return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedDeclarationDiagnosticsForFile, getDeclarationDiagnosticsForFileNoCache); + } + function getDeclarationDiagnosticsForFileNoCache(sourceFile, cancellationToken) { return runWithCancellationToken(function () { var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile, cancellationToken); return ts.getDeclarationDiagnostics(getEmitHost(ts.noop), resolver, sourceFile); }); } + function getAndCacheDiagnostics(sourceFile, cancellationToken, cache, getDiagnostics) { + var cachedResult = sourceFile + ? cache.perFile && cache.perFile.get(sourceFile.path) + : cache.allDiagnostics; + if (cachedResult) { + return cachedResult; + } + var result = getDiagnostics(sourceFile, cancellationToken) || emptyArray; + if (sourceFile) { + if (!cache.perFile) { + cache.perFile = ts.createFileMap(); + } + cache.perFile.set(sourceFile.path, result); + } + else { + cache.allDiagnostics = result; + } + return result; + } function getDeclarationDiagnosticsForFile(sourceFile, cancellationToken) { return ts.isDeclarationFile(sourceFile) ? [] : getDeclarationDiagnosticsWorker(sourceFile, cancellationToken); } @@ -51323,11 +56664,10 @@ var ts; if (options.importHelpers && (options.isolatedModules || isExternalModuleFile) && !file.isDeclarationFile) { - var externalHelpersModuleReference = ts.createSynthesizedNode(9); - externalHelpersModuleReference.text = ts.externalHelpersModuleNameText; - var importDecl = ts.createSynthesizedNode(235); - importDecl.parent = file; + var externalHelpersModuleReference = ts.createLiteral(ts.externalHelpersModuleNameText); + var importDecl = ts.createImportDeclaration(undefined, undefined, undefined); externalHelpersModuleReference.parent = importDecl; + importDecl.parent = file; imports = [externalHelpersModuleReference]; } for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { @@ -51343,9 +56683,9 @@ var ts; return; function collectModuleReferences(node, inAmbientModule) { switch (node.kind) { - case 235: - case 234: - case 241: + case 237: + case 236: + case 243: var moduleNameExpr = ts.getExternalModuleName(node); if (!moduleNameExpr || moduleNameExpr.kind !== 9) { break; @@ -51357,7 +56697,7 @@ var ts; (imports || (imports = [])).push(moduleNameExpr); } break; - case 230: + case 232: if (ts.isAmbientModule(node) && (inAmbientModule || ts.hasModifier(node, 2) || ts.isDeclarationFile(file))) { var moduleName = node.name; if (isExternalModuleFile || (inAmbientModule && !ts.isExternalModuleNameRelative(moduleName.text))) { @@ -51441,18 +56781,18 @@ var ts; if (file_1 && options.forceConsistentCasingInFileNames && ts.getNormalizedAbsolutePath(file_1.fileName, currentDirectory) !== ts.getNormalizedAbsolutePath(fileName, currentDirectory)) { reportFileNamesDifferOnlyInCasingError(fileName, file_1.fileName, refFile, refPos, refEnd); } - if (file_1 && sourceFilesFoundSearchingNodeModules[file_1.path] && currentNodeModulesDepth == 0) { - sourceFilesFoundSearchingNodeModules[file_1.path] = false; + if (file_1 && sourceFilesFoundSearchingNodeModules.get(file_1.path) && currentNodeModulesDepth === 0) { + sourceFilesFoundSearchingNodeModules.set(file_1.path, false); if (!options.noResolve) { processReferencedFiles(file_1, isDefaultLib); processTypeReferenceDirectives(file_1); } - modulesWithElidedImports[file_1.path] = false; + modulesWithElidedImports.set(file_1.path, false); processImportedModules(file_1); } - else if (file_1 && modulesWithElidedImports[file_1.path]) { + else if (file_1 && modulesWithElidedImports.get(file_1.path)) { if (currentNodeModulesDepth < maxNodeModuleJsDepth) { - modulesWithElidedImports[file_1.path] = false; + modulesWithElidedImports.set(file_1.path, false); processImportedModules(file_1); } } @@ -51468,7 +56808,7 @@ var ts; }); filesByName.set(path, file); if (file) { - sourceFilesFoundSearchingNodeModules[path] = (currentNodeModulesDepth > 0); + sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0); file.path = path; if (host.useCaseSensitiveFileNames()) { var existingFile = filesByNameIgnoreCase.get(path); @@ -51512,7 +56852,7 @@ var ts; } } function processTypeReferenceDirective(typeReferenceDirective, resolvedTypeReferenceDirective, refFile, refPos, refEnd) { - var previousResolution = resolvedTypeReferenceDirectives[typeReferenceDirective]; + var previousResolution = resolvedTypeReferenceDirectives.get(typeReferenceDirective); if (previousResolution && previousResolution.primary) { return; } @@ -51540,7 +56880,7 @@ var ts; fileProcessingDiagnostics.add(createDiagnostic(refFile, refPos, refEnd, ts.Diagnostics.Cannot_find_type_definition_file_for_0, typeReferenceDirective)); } if (saveResolution) { - resolvedTypeReferenceDirectives[typeReferenceDirective] = resolvedTypeReferenceDirective; + resolvedTypeReferenceDirectives.set(typeReferenceDirective, resolvedTypeReferenceDirective); } } function createDiagnostic(refFile, refPos, refEnd, message) { @@ -51581,7 +56921,7 @@ var ts; var elideImport = isJsFileFromNodeModules && currentNodeModulesDepth > maxNodeModuleJsDepth; var shouldAddFile = resolvedFileName && !getResolutionDiagnostic(options, resolution) && !options.noResolve && i < file.imports.length && !elideImport; if (elideImport) { - modulesWithElidedImports[file.path] = true; + modulesWithElidedImports.set(file.path, true); } else if (shouldAddFile) { var path = ts.toPath(resolvedFileName, currentDirectory, getCanonicalFileName); @@ -51599,8 +56939,8 @@ var ts; } function computeCommonSourceDirectory(sourceFiles) { var fileNames = []; - for (var _i = 0, sourceFiles_6 = sourceFiles; _i < sourceFiles_6.length; _i++) { - var file = sourceFiles_6[_i]; + for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) { + var file = sourceFiles_2[_i]; if (!file.isDeclarationFile) { fileNames.push(file.fileName); } @@ -51611,8 +56951,8 @@ var ts; var allFilesBelongToPath = true; if (sourceFiles) { var absoluteRootDirectoryPath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(rootDirectory, currentDirectory)); - for (var _i = 0, sourceFiles_7 = sourceFiles; _i < sourceFiles_7.length; _i++) { - var sourceFile = sourceFiles_7[_i]; + for (var _i = 0, sourceFiles_3 = sourceFiles; _i < sourceFiles_3.length; _i++) { + var sourceFile = sourceFiles_3[_i]; if (!ts.isDeclarationFile(sourceFile)) { var absoluteSourceFilePath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { @@ -51705,7 +57045,7 @@ var ts; if (options.lib && options.noLib) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "lib", "noLib")); } - if (options.noImplicitUseStrict && options.alwaysStrict) { + if (options.noImplicitUseStrict && (options.alwaysStrict === undefined ? options.strict : options.alwaysStrict)) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "noImplicitUseStrict", "alwaysStrict")); } var languageVersion = options.target || 0; @@ -51745,6 +57085,9 @@ var ts; if (!options.noEmit && options.allowJs && options.declaration) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "allowJs", "declaration")); } + if (options.checkJs && !options.allowJs) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "checkJs", "allowJs")); + } if (options.emitDecoratorMetadata && !options.experimentalDecorators) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators")); @@ -51763,7 +57106,7 @@ var ts; if (!options.noEmit && !options.suppressOutputPathCheck) { var emitHost = getEmitHost(); var emitFilesSeen_1 = ts.createFileMap(!host.useCaseSensitiveFileNames() ? function (key) { return key.toLocaleLowerCase(); } : undefined); - ts.forEachExpectedEmitFile(emitHost, function (emitFileNames) { + ts.forEachEmittedFile(emitHost, function (emitFileNames) { verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen_1); verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen_1); }); @@ -51825,7 +57168,9 @@ var ts; this.text = text; } StringScriptSnapshot.prototype.getText = function (start, end) { - return this.text.substring(start, end); + return start === 0 && end === this.text.length + ? this.text + : this.text.substring(start, end); }; StringScriptSnapshot.prototype.getLength = function () { return this.text.length; @@ -51884,6 +57229,22 @@ var ts; SymbolDisplayPartKind[SymbolDisplayPartKind["functionName"] = 20] = "functionName"; SymbolDisplayPartKind[SymbolDisplayPartKind["regularExpressionLiteral"] = 21] = "regularExpressionLiteral"; })(SymbolDisplayPartKind = ts.SymbolDisplayPartKind || (ts.SymbolDisplayPartKind = {})); + var OutputFileType; + (function (OutputFileType) { + OutputFileType[OutputFileType["JavaScript"] = 0] = "JavaScript"; + OutputFileType[OutputFileType["SourceMap"] = 1] = "SourceMap"; + OutputFileType[OutputFileType["Declaration"] = 2] = "Declaration"; + })(OutputFileType = ts.OutputFileType || (ts.OutputFileType = {})); + var EndOfLineState; + (function (EndOfLineState) { + EndOfLineState[EndOfLineState["None"] = 0] = "None"; + EndOfLineState[EndOfLineState["InMultiLineCommentTrivia"] = 1] = "InMultiLineCommentTrivia"; + EndOfLineState[EndOfLineState["InSingleQuoteStringLiteral"] = 2] = "InSingleQuoteStringLiteral"; + EndOfLineState[EndOfLineState["InDoubleQuoteStringLiteral"] = 3] = "InDoubleQuoteStringLiteral"; + EndOfLineState[EndOfLineState["InTemplateHeadOrNoSubstitutionTemplate"] = 4] = "InTemplateHeadOrNoSubstitutionTemplate"; + EndOfLineState[EndOfLineState["InTemplateMiddleOrTail"] = 5] = "InTemplateMiddleOrTail"; + EndOfLineState[EndOfLineState["InTemplateSubstitutionPosition"] = 6] = "InTemplateSubstitutionPosition"; + })(EndOfLineState = ts.EndOfLineState || (ts.EndOfLineState = {})); var TokenClass; (function (TokenClass) { TokenClass[TokenClass["Punctuation"] = 0] = "Punctuation"; @@ -51908,7 +57269,7 @@ var ts; ScriptElementKind.interfaceElement = "interface"; ScriptElementKind.typeElement = "type"; ScriptElementKind.enumElement = "enum"; - ScriptElementKind.enumMemberElement = "const"; + ScriptElementKind.enumMemberElement = "enum member"; ScriptElementKind.variableElement = "var"; ScriptElementKind.localVariableElement = "local var"; ScriptElementKind.functionElement = "function"; @@ -51930,6 +57291,7 @@ var ts; ScriptElementKind.letElement = "let"; ScriptElementKind.directory = "directory"; ScriptElementKind.externalModuleName = "external module name"; + ScriptElementKind.jsxAttribute = "JSX attribute"; })(ScriptElementKind = ts.ScriptElementKind || (ts.ScriptElementKind = {})); var ScriptElementKindModifier; (function (ScriptElementKindModifier) { @@ -51971,40 +57333,76 @@ var ts; ClassificationTypeNames.jsxText = "jsx text"; ClassificationTypeNames.jsxAttributeStringLiteralValue = "jsx attribute string literal value"; ts.ClassificationTypeNames = ClassificationTypeNames; + var ClassificationType; + (function (ClassificationType) { + ClassificationType[ClassificationType["comment"] = 1] = "comment"; + ClassificationType[ClassificationType["identifier"] = 2] = "identifier"; + ClassificationType[ClassificationType["keyword"] = 3] = "keyword"; + ClassificationType[ClassificationType["numericLiteral"] = 4] = "numericLiteral"; + ClassificationType[ClassificationType["operator"] = 5] = "operator"; + ClassificationType[ClassificationType["stringLiteral"] = 6] = "stringLiteral"; + ClassificationType[ClassificationType["regularExpressionLiteral"] = 7] = "regularExpressionLiteral"; + ClassificationType[ClassificationType["whiteSpace"] = 8] = "whiteSpace"; + ClassificationType[ClassificationType["text"] = 9] = "text"; + ClassificationType[ClassificationType["punctuation"] = 10] = "punctuation"; + ClassificationType[ClassificationType["className"] = 11] = "className"; + ClassificationType[ClassificationType["enumName"] = 12] = "enumName"; + ClassificationType[ClassificationType["interfaceName"] = 13] = "interfaceName"; + ClassificationType[ClassificationType["moduleName"] = 14] = "moduleName"; + ClassificationType[ClassificationType["typeParameterName"] = 15] = "typeParameterName"; + ClassificationType[ClassificationType["typeAliasName"] = 16] = "typeAliasName"; + ClassificationType[ClassificationType["parameterName"] = 17] = "parameterName"; + ClassificationType[ClassificationType["docCommentTagName"] = 18] = "docCommentTagName"; + ClassificationType[ClassificationType["jsxOpenTagName"] = 19] = "jsxOpenTagName"; + ClassificationType[ClassificationType["jsxCloseTagName"] = 20] = "jsxCloseTagName"; + ClassificationType[ClassificationType["jsxSelfClosingTagName"] = 21] = "jsxSelfClosingTagName"; + ClassificationType[ClassificationType["jsxAttribute"] = 22] = "jsxAttribute"; + ClassificationType[ClassificationType["jsxText"] = 23] = "jsxText"; + ClassificationType[ClassificationType["jsxAttributeStringLiteralValue"] = 24] = "jsxAttributeStringLiteralValue"; + })(ClassificationType = ts.ClassificationType || (ts.ClassificationType = {})); })(ts || (ts = {})); var ts; (function (ts) { ts.scanner = ts.createScanner(5, true); ts.emptyArray = []; + var SemanticMeaning; + (function (SemanticMeaning) { + SemanticMeaning[SemanticMeaning["None"] = 0] = "None"; + SemanticMeaning[SemanticMeaning["Value"] = 1] = "Value"; + SemanticMeaning[SemanticMeaning["Type"] = 2] = "Type"; + SemanticMeaning[SemanticMeaning["Namespace"] = 4] = "Namespace"; + SemanticMeaning[SemanticMeaning["All"] = 7] = "All"; + })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 144: - case 223: - case 174: - case 147: - case 146: - case 257: - case 258: - case 260: - case 149: + case 145: + case 225: + case 175: case 148: + case 147: + case 260: + case 261: + case 263: case 150: + case 149: case 151: case 152: - case 225: - case 184: - case 185: - case 256: - return 1; - case 143: + case 153: case 227: - case 228: - case 161: - return 2; - case 226: + case 185: + case 186: + case 259: + case 252: + return 1; + case 144: case 229: - return 1 | 2; case 230: + case 162: + return 2; + case 228: + case 231: + return 1 | 2; + case 232: if (ts.isAmbientModule(node)) { return 4 | 1; } @@ -52014,21 +57412,24 @@ var ts; else { return 4; } - case 238: - case 239: - case 234: - case 235: case 240: case 241: + case 236: + case 237: + case 242: + case 243: return 1 | 2 | 4; - case 261: + case 264: return 4 | 1; } return 1 | 2 | 4; } ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { - if (node.parent.kind === 240) { + if (node.kind === 264) { + return 1; + } + else if (node.parent.kind === 242) { return 1 | 2 | 4; } else if (isInRightSideOfImport(node)) { @@ -52050,15 +57451,15 @@ var ts; ts.getMeaningFromLocation = getMeaningFromLocation; function getMeaningFromRightHandSideOfImportEquals(node) { ts.Debug.assert(node.kind === 70); - if (node.parent.kind === 141 && + if (node.parent.kind === 142 && node.parent.right === node && - node.parent.parent.kind === 234) { + node.parent.parent.kind === 236) { return 1 | 2 | 4; } return 4; } function isInRightSideOfImport(node) { - while (node.parent.kind === 141) { + while (node.parent.kind === 142) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -52069,27 +57470,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 141) { - while (root.parent && root.parent.kind === 141) { + if (root.parent.kind === 142) { + while (root.parent && root.parent.kind === 142) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 157 && !isLastClause; + return root.parent.kind === 158 && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 177) { - while (root.parent && root.parent.kind === 177) { + if (root.parent.kind === 178) { + while (root.parent && root.parent.kind === 178) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 199 && root.parent.parent.kind === 255) { + if (!isLastClause && root.parent.kind === 200 && root.parent.parent.kind === 258) { var decl = root.parent.parent.parent; - return (decl.kind === 226 && root.parent.parent.token === 107) || - (decl.kind === 227 && root.parent.parent.token === 84); + return (decl.kind === 228 && root.parent.parent.token === 107) || + (decl.kind === 229 && root.parent.parent.token === 84); } return false; } @@ -52097,17 +57498,17 @@ var ts; if (ts.isRightSideOfQualifiedNameOrPropertyAccess(node)) { node = node.parent; } - return node.parent.kind === 157 || - (node.parent.kind === 199 && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || + return node.parent.kind === 158 || + (node.parent.kind === 200 && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || (node.kind === 98 && !ts.isPartOfExpression(node)) || - node.kind === 167; + node.kind === 168; } function isCallExpressionTarget(node) { - return isCallOrNewExpressionTarget(node, 179); + return isCallOrNewExpressionTarget(node, 180); } ts.isCallExpressionTarget = isCallExpressionTarget; function isNewExpressionTarget(node) { - return isCallOrNewExpressionTarget(node, 180); + return isCallOrNewExpressionTarget(node, 181); } ts.isNewExpressionTarget = isNewExpressionTarget; function isCallOrNewExpressionTarget(node, kind) { @@ -52120,7 +57521,7 @@ var ts; ts.climbPastPropertyAccess = climbPastPropertyAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 219 && referenceNode.label.text === labelName) { + if (referenceNode.kind === 221 && referenceNode.label.text === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -52130,13 +57531,13 @@ var ts; ts.getTargetLabel = getTargetLabel; function isJumpStatementTarget(node) { return node.kind === 70 && - (node.parent.kind === 215 || node.parent.kind === 214) && + (node.parent.kind === 217 || node.parent.kind === 216) && node.parent.label === node; } ts.isJumpStatementTarget = isJumpStatementTarget; function isLabelOfLabeledStatement(node) { return node.kind === 70 && - node.parent.kind === 219 && + node.parent.kind === 221 && node.parent.label === node; } function isLabelName(node) { @@ -52144,15 +57545,15 @@ var ts; } ts.isLabelName = isLabelName; function isRightSideOfQualifiedName(node) { - return node.parent.kind === 141 && node.parent.right === node; + return node.parent.kind === 142 && node.parent.right === node; } ts.isRightSideOfQualifiedName = isRightSideOfQualifiedName; function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 177 && node.parent.name === node; + return node && node.parent && node.parent.kind === 178 && node.parent.name === node; } ts.isRightSideOfPropertyAccess = isRightSideOfPropertyAccess; function isNameOfModuleDeclaration(node) { - return node.parent.kind === 230 && node.parent.name === node; + return node.parent.kind === 232 && node.parent.name === node; } ts.isNameOfModuleDeclaration = isNameOfModuleDeclaration; function isNameOfFunctionDeclaration(node) { @@ -52163,19 +57564,19 @@ var ts; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 9 || node.kind === 8) { switch (node.parent.kind) { - case 147: - case 146: - case 257: - case 260: - case 149: case 148: - case 151: + case 147: + case 260: + case 263: + case 150: + case 149: case 152: - case 230: + case 153: + case 232: return node.parent.name === node; - case 178: + case 179: return node.parent.argumentExpression === node; - case 142: + case 143: return true; } } @@ -52219,17 +57620,17 @@ var ts; return undefined; } switch (node.kind) { - case 261: + case 264: + case 150: case 149: - case 148: - case 225: - case 184: - case 151: - case 152: - case 226: case 227: + case 185: + case 152: + case 153: + case 228: case 229: - case 230: + case 231: + case 232: return node; } } @@ -52237,46 +57638,46 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 261: + case 264: return ts.isExternalModule(node) ? ts.ScriptElementKind.moduleElement : ts.ScriptElementKind.scriptElement; - case 230: + case 232: return ts.ScriptElementKind.moduleElement; - case 226: - case 197: + case 228: + case 198: return ts.ScriptElementKind.classElement; - case 227: return ts.ScriptElementKind.interfaceElement; - case 228: return ts.ScriptElementKind.typeElement; - case 229: return ts.ScriptElementKind.enumElement; - case 223: - return getKindOfVariableDeclaration(node); - case 174: - return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 185: + case 229: return ts.ScriptElementKind.interfaceElement; + case 230: return ts.ScriptElementKind.typeElement; + case 231: return ts.ScriptElementKind.enumElement; case 225: - case 184: + return getKindOfVariableDeclaration(node); + case 175: + return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); + case 186: + case 227: + case 185: return ts.ScriptElementKind.functionElement; - case 151: return ts.ScriptElementKind.memberGetAccessorElement; - case 152: return ts.ScriptElementKind.memberSetAccessorElement; + case 152: return ts.ScriptElementKind.memberGetAccessorElement; + case 153: return ts.ScriptElementKind.memberSetAccessorElement; + case 150: case 149: - case 148: return ts.ScriptElementKind.memberFunctionElement; + case 148: case 147: - case 146: return ts.ScriptElementKind.memberVariableElement; - case 155: return ts.ScriptElementKind.indexSignatureElement; - case 154: return ts.ScriptElementKind.constructSignatureElement; - case 153: return ts.ScriptElementKind.callSignatureElement; - case 150: return ts.ScriptElementKind.constructorImplementationElement; - case 143: return ts.ScriptElementKind.typeParameterElement; - case 260: return ts.ScriptElementKind.enumMemberElement; - case 144: return ts.hasModifier(node, 92) ? ts.ScriptElementKind.memberVariableElement : ts.ScriptElementKind.parameterElement; - case 234: - case 239: + case 156: return ts.ScriptElementKind.indexSignatureElement; + case 155: return ts.ScriptElementKind.constructSignatureElement; + case 154: return ts.ScriptElementKind.callSignatureElement; + case 151: return ts.ScriptElementKind.constructorImplementationElement; + case 144: return ts.ScriptElementKind.typeParameterElement; + case 263: return ts.ScriptElementKind.enumMemberElement; + case 145: return ts.hasModifier(node, 92) ? ts.ScriptElementKind.memberVariableElement : ts.ScriptElementKind.parameterElement; case 236: - case 243: - case 237: + case 241: + case 238: + case 245: + case 239: return ts.ScriptElementKind.alias; - case 285: + case 289: return ts.ScriptElementKind.typeElement; default: return ts.ScriptElementKind.unknown; @@ -52290,21 +57691,12 @@ var ts; } } ts.getNodeKind = getNodeKind; - function getStringLiteralTypeForNode(node, typeChecker) { - var searchNode = node.parent.kind === 171 ? node.parent : node; - var type = typeChecker.getTypeAtLocation(searchNode); - if (type && type.flags & 32) { - return type; - } - return undefined; - } - ts.getStringLiteralTypeForNode = getStringLiteralTypeForNode; function isThis(node) { switch (node.kind) { case 98: return true; case 70: - return ts.identifierIsThisKeyword(node) && node.parent.kind === 144; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 145; default: return false; } @@ -52312,7 +57704,7 @@ var ts; ts.isThis = isThis; var tripleSlashDirectivePrefixRegex = /^\/\/\/\s*= node.end) { + if (c.kind === 293 && c.pos <= node.pos && c.end >= node.end) { return c; } }); @@ -52523,7 +57915,7 @@ var ts; if (includeJsDocComment === void 0) { includeJsDocComment = false; } var current = sourceFile; outer: while (true) { - if (isToken(current)) { + if (ts.isToken(current)) { return current; } if (includeJsDocComment) { @@ -52546,8 +57938,8 @@ var ts; } } } - for (var i = 0, n = current.getChildCount(sourceFile); i < n; i++) { - var child = current.getChildAt(i); + for (var _a = 0, _b = current.getChildren(); _a < _b.length; _a++) { + var child = _b[_a]; if (ts.isJSDocNode(child)) { continue; } @@ -52571,7 +57963,7 @@ var ts; } function findTokenOnLeftOfPosition(file, position) { var tokenAtPosition = getTokenAtPosition(file, position); - if (isToken(tokenAtPosition) && position > tokenAtPosition.getStart(file) && position < tokenAtPosition.getEnd()) { + if (ts.isToken(tokenAtPosition) && position > tokenAtPosition.getStart(file) && position < tokenAtPosition.getEnd()) { return tokenAtPosition; } return findPrecedingToken(position, file); @@ -52580,7 +57972,7 @@ var ts; function findNextToken(previousToken, parent) { return find(parent); function find(n) { - if (isToken(n) && n.pos === previousToken.end) { + if (ts.isToken(n) && n.pos === previousToken.end) { return n; } var children = n.getChildren(); @@ -52599,7 +57991,7 @@ var ts; function findPrecedingToken(position, sourceFile, startNode) { return find(startNode || sourceFile); function findRightmostToken(n) { - if (isToken(n)) { + if (ts.isToken(n)) { return n; } var children = n.getChildren(); @@ -52607,11 +57999,11 @@ var ts; return candidate && findRightmostToken(candidate); } function find(n) { - if (isToken(n)) { + if (ts.isToken(n)) { return n; } var children = n.getChildren(); - for (var i = 0, len = children.length; i < len; i++) { + for (var i = 0; i < children.length; i++) { var child = children[i]; if (position < child.end && (nodeHasTokens(child) || child.kind === 10)) { var start = child.getStart(sourceFile); @@ -52626,7 +58018,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 261); + ts.Debug.assert(startNode !== undefined || n.kind === 264); if (children.length) { var candidate = findRightmostChildNodeWithTokens(children, children.length); return candidate && findRightmostToken(candidate); @@ -52671,13 +58063,13 @@ var ts; if (token.kind === 26 && token.parent.kind === 10) { return true; } - if (token.kind === 26 && token.parent.kind === 252) { + if (token.kind === 26 && token.parent.kind === 255) { return true; } - if (token && token.kind === 17 && token.parent.kind === 252) { + if (token && token.kind === 17 && token.parent.kind === 255) { return true; } - if (token.kind === 26 && token.parent.kind === 249) { + if (token.kind === 26 && token.parent.kind === 251) { return true; } return false; @@ -52694,10 +58086,10 @@ var ts; var commentRanges = ts.getLeadingCommentRanges(sourceFile.text, token.pos); return predicate ? ts.forEach(commentRanges, function (c) { return c.pos < position && - (c.kind == 2 ? position <= c.end : position < c.end) && + (c.kind === 2 ? position <= c.end : position < c.end) && predicate(c); }) : ts.forEach(commentRanges, function (c) { return c.pos < position && - (c.kind == 2 ? position <= c.end : position < c.end); }); + (c.kind === 2 ? position <= c.end : position < c.end); }); } return false; } @@ -52714,7 +58106,7 @@ var ts; ts.hasDocComment = hasDocComment; function getJsDocTagAtPosition(sourceFile, position) { var node = ts.getTokenAtPosition(sourceFile, position); - if (isToken(node)) { + if (ts.isToken(node)) { switch (node.kind) { case 103: case 109: @@ -52768,19 +58160,15 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 157 || node.kind === 179) { + if (node.kind === 158 || node.kind === 180) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 226 || node.kind === 227) { + if (ts.isFunctionLike(node) || node.kind === 228 || node.kind === 229) { return node.typeParameters; } return undefined; } ts.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList; - function isToken(n) { - return n.kind >= 0 && n.kind <= 140; - } - ts.isToken = isToken; function isWord(kind) { return kind === 70 || ts.isKeyword(kind); } @@ -52837,18 +58225,18 @@ var ts; } ts.compareDataObjects = compareDataObjects; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 175 || - node.kind === 176) { - if (node.parent.kind === 192 && + if (node.kind === 176 || + node.kind === 177) { + if (node.parent.kind === 193 && node.parent.left === node && node.parent.operatorToken.kind === 57) { return true; } - if (node.parent.kind === 213 && + if (node.parent.kind === 215 && node.parent.initializer === node) { return true; } - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 257 ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 260 ? node.parent.parent : node.parent)) { return true; } } @@ -52876,10 +58264,43 @@ var ts; } } ts.isInNonReferenceComment = isInNonReferenceComment; + function createTextSpanFromNode(node, sourceFile) { + return ts.createTextSpanFromBounds(node.getStart(sourceFile), node.getEnd()); + } + ts.createTextSpanFromNode = createTextSpanFromNode; + function isTypeKeyword(kind) { + switch (kind) { + case 118: + case 121: + case 129: + case 132: + case 133: + case 135: + case 136: + case 104: + return true; + default: + return false; + } + } + ts.isTypeKeyword = isTypeKeyword; + function isExternalModuleSymbol(moduleSymbol) { + ts.Debug.assert(!!(moduleSymbol.flags & 1536)); + return moduleSymbol.name.charCodeAt(0) === 34; + } + ts.isExternalModuleSymbol = isExternalModuleSymbol; + function nodeSeenTracker() { + var seen = []; + return function (node) { + var id = ts.getNodeId(node); + return !seen[id] && (seen[id] = true); + }; + } + ts.nodeSeenTracker = nodeSeenTracker; })(ts || (ts = {})); (function (ts) { function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 144; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 145; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -52896,13 +58317,15 @@ var ts; writeSpace: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.space); }, writeStringLiteral: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.stringLiteral); }, writeParameter: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.parameterName); }, + writeProperty: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.propertyName); }, writeSymbol: writeSymbol, writeLine: writeLine, increaseIndent: function () { indent++; }, decreaseIndent: function () { indent--; }, clear: resetWriter, trackSymbol: ts.noop, - reportInaccessibleThisError: ts.noop + reportInaccessibleThisError: ts.noop, + reportIllegalExtends: ts.noop }; function writeIndent() { if (lineStart) { @@ -53050,21 +58473,16 @@ var ts; } ts.signatureToDisplayParts = signatureToDisplayParts; function getDeclaredName(typeChecker, symbol, location) { - if (isImportOrExportSpecifierName(location)) { - return location.getText(); - } - else if (ts.isStringOrNumericLiteral(location) && - location.parent.kind === 142) { + if (isImportOrExportSpecifierName(location) || ts.isStringOrNumericLiteral(location) && location.parent.kind === 143) { return location.text; } var localExportDefaultSymbol = ts.getLocalSymbolForExportDefault(symbol); - var name = typeChecker.symbolToString(localExportDefaultSymbol || symbol); - return name; + return typeChecker.symbolToString(localExportDefaultSymbol || symbol); } ts.getDeclaredName = getDeclaredName; function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 239 || location.parent.kind === 243) && + (location.parent.kind === 241 || location.parent.kind === 245) && location.parent.propertyName === location; } ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName; @@ -53075,7 +58493,6 @@ var ts; (name.charCodeAt(0) === 34 || name.charCodeAt(0) === 39)) { return name.substring(1, length - 1); } - ; return name; } ts.stripQuotes = stripQuotes; @@ -53121,6 +58538,21 @@ var ts; }; } ts.sanitizeConfigFile = sanitizeConfigFile; + function getFirstNonSpaceCharacterPosition(text, position) { + while (ts.isWhiteSpace(text.charCodeAt(position))) { + position += 1; + } + return position; + } + ts.getFirstNonSpaceCharacterPosition = getFirstNonSpaceCharacterPosition; + function getOpenBrace(constructor, sourceFile) { + return constructor.body.getFirstToken(sourceFile); + } + ts.getOpenBrace = getOpenBrace; + function getOpenBraceOfClassLike(declaration, sourceFile) { + return ts.getTokenAtPosition(sourceFile, declaration.members.pos - 1); + } + ts.getOpenBraceOfClassLike = getOpenBraceOfClassLike; })(ts || (ts = {})); var ts; (function (ts) { @@ -53169,89 +58601,89 @@ var ts; function spanInNode(node) { if (node) { switch (node.kind) { - case 205: + case 207: return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 223: - case 147: - case 146: - return spanInVariableDeclaration(node); - case 144: - return spanInParameterDeclaration(node); case 225: - case 149: case 148: - case 151: - case 152: + case 147: + return spanInVariableDeclaration(node); + case 145: + return spanInParameterDeclaration(node); + case 227: case 150: - case 184: + case 149: + case 152: + case 153: + case 151: case 185: + case 186: return spanInFunctionDeclaration(node); - case 204: + case 206: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } - case 231: + case 233: return spanInBlock(node); - case 256: + case 259: return spanInBlock(node.block); - case 207: - return textSpan(node.expression); - case 216: - return textSpan(node.getChildAt(0), node.expression); - case 210: - return textSpanEndingAtNextToken(node, node.expression); case 209: - return spanInNode(node.statement); - case 222: - return textSpan(node.getChildAt(0)); - case 208: - return textSpanEndingAtNextToken(node, node.expression); - case 219: - return spanInNode(node.statement); - case 215: - case 214: - return textSpan(node.getChildAt(0), node.label); - case 211: - return spanInForStatement(node); + return textSpan(node.expression); + case 218: + return textSpan(node.getChildAt(0), node.expression); case 212: return textSpanEndingAtNextToken(node, node.expression); - case 213: - return spanInInitializerOfForLike(node); - case 218: + case 211: + return spanInNode(node.statement); + case 224: + return textSpan(node.getChildAt(0)); + case 210: return textSpanEndingAtNextToken(node, node.expression); - case 253: - case 254: - return spanInNode(node.statements[0]); case 221: - return spanInBlock(node.tryBlock); + return spanInNode(node.statement); + case 217: + case 216: + return textSpan(node.getChildAt(0), node.label); + case 213: + return spanInForStatement(node); + case 214: + return textSpanEndingAtNextToken(node, node.expression); + case 215: + return spanInInitializerOfForLike(node); case 220: + return textSpanEndingAtNextToken(node, node.expression); + case 256: + case 257: + return spanInNode(node.statements[0]); + case 223: + return spanInBlock(node.tryBlock); + case 222: return textSpan(node, node.expression); - case 240: + case 242: return textSpan(node, node.expression); - case 234: + case 236: return textSpan(node, node.moduleReference); - case 235: + case 237: return textSpan(node, node.moduleSpecifier); - case 241: + case 243: return textSpan(node, node.moduleSpecifier); - case 230: + case 232: if (ts.getModuleInstanceState(node) !== 1) { return undefined; } - case 226: - case 229: - case 260: - case 174: - return textSpan(node); - case 217: - return spanInNode(node.statement); - case 145: - return spanInNodeArray(node.parent.decorators); - case 172: - case 173: - return spanInBindingPattern(node); - case 227: case 228: + case 231: + case 263: + case 175: + return textSpan(node); + case 219: + return spanInNode(node.statement); + case 146: + return spanInNodeArray(node.parent.decorators); + case 173: + case 174: + return spanInBindingPattern(node); + case 229: + case 230: return undefined; case 24: case 1: @@ -53279,20 +58711,20 @@ var ts; case 73: case 86: return spanInNextNode(node); - case 140: + case 141: return spanInOfKeyword(node); default: if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node)) { return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node); } if ((node.kind === 70 || - node.kind == 196 || - node.kind === 257 || - node.kind === 258) && + node.kind === 197 || + node.kind === 260 || + node.kind === 261) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { return textSpan(node); } - if (node.kind === 192) { + if (node.kind === 193) { var binaryExpression = node; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left)) { return spanInArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left); @@ -53307,38 +58739,38 @@ var ts; } if (ts.isPartOfExpression(node)) { switch (node.parent.kind) { - case 209: - return spanInPreviousNode(node); - case 145: - return spanInNode(node.parent); case 211: + return spanInPreviousNode(node); + case 146: + return spanInNode(node.parent); case 213: + case 215: return textSpan(node); - case 192: + case 193: if (node.parent.operatorToken.kind === 25) { return textSpan(node); } break; - case 185: + case 186: if (node.parent.body === node) { return textSpan(node); } break; } } - if (node.parent.kind === 257 && + if (node.parent.kind === 260 && node.parent.name === node && !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } - if (node.parent.kind === 182 && node.parent.type === node) { + if (node.parent.kind === 183 && node.parent.type === node) { return spanInNextNode(node.parent.type); } if (ts.isFunctionLike(node.parent) && node.parent.type === node) { return spanInPreviousNode(node); } - if ((node.parent.kind === 223 || - node.parent.kind === 144)) { + if ((node.parent.kind === 225 || + node.parent.kind === 145)) { var paramOrVarDecl = node.parent; if (paramOrVarDecl.initializer === node || paramOrVarDecl.type === node || @@ -53346,7 +58778,7 @@ var ts; return spanInPreviousNode(node); } } - if (node.parent.kind === 192) { + if (node.parent.kind === 193) { var binaryExpression = node.parent; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left) && (binaryExpression.right === node || @@ -53358,8 +58790,8 @@ var ts; } } function textSpanFromVariableDeclaration(variableDeclaration) { - var declarations = variableDeclaration.parent.declarations; - if (declarations && declarations[0] === variableDeclaration) { + if (variableDeclaration.parent.kind === 226 && + variableDeclaration.parent.declarations[0] === variableDeclaration) { return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); } else { @@ -53367,7 +58799,7 @@ var ts; } } function spanInVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.parent.kind === 212) { + if (variableDeclaration.parent.parent.kind === 214) { return spanInNode(variableDeclaration.parent.parent); } if (ts.isBindingPattern(variableDeclaration.name)) { @@ -53375,11 +58807,11 @@ var ts; } if (variableDeclaration.initializer || ts.hasModifier(variableDeclaration, 1) || - variableDeclaration.parent.parent.kind === 213) { + variableDeclaration.parent.parent.kind === 215) { return textSpanFromVariableDeclaration(variableDeclaration); } - var declarations = variableDeclaration.parent.declarations; - if (declarations && declarations[0] !== variableDeclaration) { + if (variableDeclaration.parent.kind === 226 && + variableDeclaration.parent.declarations[0] !== variableDeclaration) { return spanInNode(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent)); } } @@ -53407,7 +58839,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasModifier(functionDeclaration, 1) || - (functionDeclaration.parent.kind === 226 && functionDeclaration.kind !== 150); + (functionDeclaration.parent.kind === 228 && functionDeclaration.kind !== 151); } function spanInFunctionDeclaration(functionDeclaration) { if (!functionDeclaration.body) { @@ -53427,22 +58859,22 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 230: + case 232: if (ts.getModuleInstanceState(block.parent) !== 1) { return undefined; } - case 210: - case 208: case 212: + case 210: + case 214: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); - case 211: case 213: + case 215: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 224) { + if (forLikeStatement.initializer.kind === 226) { var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { return spanInNode(variableDeclarationList.declarations[0]); @@ -53464,62 +58896,62 @@ var ts; } } function spanInBindingPattern(bindingPattern) { - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 198 ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 199 ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } - if (bindingPattern.parent.kind === 174) { + if (bindingPattern.parent.kind === 175) { return textSpan(bindingPattern.parent); } return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 173 && node.kind !== 172); - var elements = node.kind === 175 ? + ts.Debug.assert(node.kind !== 174 && node.kind !== 173); + var elements = node.kind === 176 ? node.elements : node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 198 ? element : undefined; }); + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 199 ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } - return textSpan(node.parent.kind === 192 ? node.parent : node); + return textSpan(node.parent.kind === 193 ? node.parent : node); } function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 229: + case 231: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 226: + case 228: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 232: + case 234: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } return spanInNode(node.parent); } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 231: + case 233: if (ts.getModuleInstanceState(node.parent.parent) !== 1) { return undefined; } - case 229: - case 226: + case 231: + case 228: return textSpan(node); - case 204: + case 206: if (ts.isFunctionBlock(node.parent)) { return textSpan(node); } - case 256: + case 259: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 232: + case 234: var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); if (lastClause) { return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 172: + case 173: var bindingPattern = node.parent; return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); default: @@ -53532,7 +58964,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 173: + case 174: var bindingPattern = node.parent; return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); default: @@ -53544,33 +58976,33 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 209 || - node.parent.kind === 179 || - node.parent.kind === 180) { + if (node.parent.kind === 211 || + node.parent.kind === 180 || + node.parent.kind === 181) { return spanInPreviousNode(node); } - if (node.parent.kind === 183) { + if (node.parent.kind === 184) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInCloseParenToken(node) { switch (node.parent.kind) { - case 184: - case 225: case 185: - case 149: - case 148: - case 151: - case 152: + case 227: + case 186: case 150: - case 210: - case 209: + case 149: + case 152: + case 153: + case 151: + case 212: case 211: case 213: - case 179: + case 215: case 180: - case 183: + case 181: + case 184: return spanInPreviousNode(node); default: return spanInNode(node.parent); @@ -53578,26 +59010,26 @@ var ts; } function spanInColonToken(node) { if (ts.isFunctionLike(node.parent) || - node.parent.kind === 257 || - node.parent.kind === 144) { + node.parent.kind === 260 || + node.parent.kind === 145) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 182) { + if (node.parent.kind === 183) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 209) { + if (node.parent.kind === 211) { return textSpanEndingAtNextToken(node, node.parent.expression); } return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 213) { + if (node.parent.kind === 215) { return spanInNextNode(node); } return spanInNode(node.parent); @@ -53628,7 +59060,7 @@ var ts; function canFollow(keyword1, keyword2) { if (ts.isAccessibilityModifier(keyword1)) { if (keyword2 === 124 || - keyword2 === 133 || + keyword2 === 134 || keyword2 === 122 || keyword2 === 114) { return true; @@ -53641,9 +59073,9 @@ var ts; var entries = []; var dense = classifications.spans; var lastEnd = 0; - for (var i = 0, n = dense.length; i < n; i += 3) { + for (var i = 0; i < dense.length; i += 3) { var start = dense[i]; - var length_4 = dense[i + 1]; + var length_5 = dense[i + 1]; var type = dense[i + 2]; if (lastEnd >= 0) { var whitespaceLength_1 = start - lastEnd; @@ -53651,8 +59083,8 @@ var ts; entries.push({ length: whitespaceLength_1, classification: ts.TokenClass.Whitespace }); } } - entries.push({ length: length_4, classification: convertClassification(type) }); - lastEnd = start + length_4; + entries.push({ length: length_5, classification: convertClassification(type) }); + lastEnd = start + length_5; } var whitespaceLength = text.length - lastEnd; if (whitespaceLength > 0) { @@ -53744,10 +59176,10 @@ var ts; angleBracketStack--; } else if (token === 118 || - token === 134 || + token === 135 || token === 132 || token === 121 || - token === 135) { + token === 136) { if (angleBracketStack > 0 && !syntacticClassifierAbsent) { token = 70; } @@ -53902,7 +59334,7 @@ var ts; } } function isKeyword(token) { - return token >= 71 && token <= 140; + return token >= 71 && token <= 141; } function classFromKind(token) { if (isKeyword(token)) { @@ -53948,10 +59380,10 @@ var ts; ts.getSemanticClassifications = getSemanticClassifications; function checkForClassificationCancellation(cancellationToken, kind) { switch (kind) { - case 230: - case 226: + case 232: + case 228: + case 229: case 227: - case 225: cancellationToken.throwIfCancellationRequested(); } } @@ -53995,7 +59427,7 @@ var ts; return undefined; function hasValueSideModule(symbol) { return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 230 && + return declaration.kind === 232 && ts.getModuleInstanceState(declaration) === 1; }); } @@ -54006,7 +59438,7 @@ var ts; checkForClassificationCancellation(cancellationToken, kind); if (kind === 70 && !ts.nodeIsMissing(node)) { var identifier = node; - if (classifiableNames[identifier.text]) { + if (classifiableNames.get(identifier.text)) { var symbol = typeChecker.getSymbolAtLocation(node); if (symbol) { var type = classifySymbol(symbol, ts.getMeaningFromLocation(node)); @@ -54052,7 +59484,7 @@ var ts; ts.Debug.assert(classifications.spans.length % 3 === 0); var dense = classifications.spans; var result = []; - for (var i = 0, n = dense.length; i < n; i += 3) { + for (var i = 0; i < dense.length; i += 3) { result.push({ textSpan: ts.createTextSpan(dense[i], dense[i + 1]), classificationType: getClassificationTypeName(dense[i + 2]) @@ -54136,16 +59568,16 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18); pos = tag.tagName.end; switch (tag.kind) { - case 281: + case 285: processJSDocParameterTag(tag); break; - case 284: + case 288: processJSDocTemplateTag(tag); break; - case 283: + case 287: processElement(tag.typeExpression); break; - case 282: + case 286: processElement(tag.typeExpression); break; } @@ -54226,22 +59658,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 248: + case 250: if (token.parent.tagName === token) { return 19; } break; - case 249: + case 251: if (token.parent.tagName === token) { return 20; } break; - case 247: + case 249: if (token.parent.tagName === token) { return 21; } break; - case 250: + case 252: if (token.parent.name === token) { return 22; } @@ -54261,17 +59693,17 @@ var ts; if (ts.isPunctuation(tokenKind)) { if (token) { if (tokenKind === 57) { - if (token.parent.kind === 223 || - token.parent.kind === 147 || - token.parent.kind === 144 || - token.parent.kind === 250) { + if (token.parent.kind === 225 || + token.parent.kind === 148 || + token.parent.kind === 145 || + token.parent.kind === 252) { return 5; } } - if (token.parent.kind === 192 || - token.parent.kind === 190 || + if (token.parent.kind === 193 || token.parent.kind === 191 || - token.parent.kind === 193) { + token.parent.kind === 192 || + token.parent.kind === 194) { return 5; } } @@ -54281,7 +59713,7 @@ var ts; return 4; } else if (tokenKind === 9) { - return token.parent.kind === 250 ? 24 : 6; + return token.parent.kind === 252 ? 24 : 6; } else if (tokenKind === 11) { return 6; @@ -54295,32 +59727,32 @@ var ts; else if (tokenKind === 70) { if (token) { switch (token.parent.kind) { - case 226: + case 228: if (token.parent.name === token) { return 11; } return; - case 143: + case 144: if (token.parent.name === token) { return 15; } return; - case 227: + case 229: if (token.parent.name === token) { return 13; } return; - case 229: + case 231: if (token.parent.name === token) { return 12; } return; - case 230: + case 232: if (token.parent.name === token) { return 14; } return; - case 144: + case 145: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 : 17; } @@ -54336,9 +59768,8 @@ var ts; } if (ts.decodedTextSpanIntersectsWith(spanStart, spanLength, element.pos, element.getFullWidth())) { checkForClassificationCancellation(cancellationToken, element.kind); - var children = element.getChildren(sourceFile); - for (var i = 0, n = children.length; i < n; i++) { - var child = children[i]; + for (var _i = 0, _a = element.getChildren(sourceFile); _i < _a.length; _i++) { + var child = _a[_i]; if (!tryClassifyNode(child)) { processElement(child); } @@ -54352,208 +59783,25 @@ var ts; (function (ts) { var Completions; (function (Completions) { - function getCompletionsAtPosition(host, typeChecker, log, compilerOptions, sourceFile, position) { - if (ts.isInReferenceComment(sourceFile, position)) { - return getTripleSlashReferenceCompletion(sourceFile, position); - } - if (ts.isInString(sourceFile, position)) { - return getStringLiteralCompletionEntries(sourceFile, position); - } - var completionData = getCompletionData(typeChecker, log, sourceFile, position); - if (!completionData) { - return undefined; - } - var symbols = completionData.symbols, isGlobalCompletion = completionData.isGlobalCompletion, isMemberCompletion = completionData.isMemberCompletion, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, isJsDocTagName = completionData.isJsDocTagName; - if (isJsDocTagName) { - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: ts.JsDoc.getAllJsDocCompletionEntries() }; - } - var entries = []; - if (ts.isSourceFileJavaScript(sourceFile)) { - var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, location, true); - ts.addRange(entries, getJavaScriptCompletionEntries(sourceFile, location.pos, uniqueNames)); - } - else { - if (!symbols || symbols.length === 0) { - if (sourceFile.languageVariant === 1 && - location.parent && location.parent.kind === 249) { - var tagName = location.parent.parent.openingElement.tagName; - entries.push({ - name: tagName.text, - kind: undefined, - kindModifiers: undefined, - sortText: "0", - }); - } - else { - return undefined; - } - } - getCompletionEntriesFromSymbols(symbols, entries, location, true); - } - if (!isMemberCompletion && !isJsDocTagName) { - ts.addRange(entries, keywordCompletions); - } - return { isGlobalCompletion: isGlobalCompletion, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; - function getJavaScriptCompletionEntries(sourceFile, position, uniqueNames) { - var entries = []; - var nameTable = ts.getNameTable(sourceFile); - for (var name_44 in nameTable) { - if (nameTable[name_44] === position) { - continue; - } - if (!uniqueNames[name_44]) { - uniqueNames[name_44] = name_44; - var displayName = getCompletionEntryDisplayName(ts.unescapeIdentifier(name_44), compilerOptions.target, true); - if (displayName) { - var entry = { - name: displayName, - kind: ts.ScriptElementKind.warning, - kindModifiers: "", - sortText: "1" - }; - entries.push(entry); - } - } - } - return entries; - } - function createCompletionEntry(symbol, location, performCharacterChecks) { - var displayName = getCompletionEntryDisplayNameForSymbol(typeChecker, symbol, compilerOptions.target, performCharacterChecks, location); - if (!displayName) { - return undefined; - } - return { - name: displayName, - kind: ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location), - kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), - sortText: "0", - }; - } - function getCompletionEntriesFromSymbols(symbols, entries, location, performCharacterChecks) { - var start = ts.timestamp(); - var uniqueNames = ts.createMap(); - if (symbols) { - for (var _i = 0, symbols_4 = symbols; _i < symbols_4.length; _i++) { - var symbol = symbols_4[_i]; - var entry = createCompletionEntry(symbol, location, performCharacterChecks); - if (entry) { - var id = ts.escapeIdentifier(entry.name); - if (!uniqueNames[id]) { - entries.push(entry); - uniqueNames[id] = id; - } - } - } - } - log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (ts.timestamp() - start)); - return uniqueNames; - } - function getStringLiteralCompletionEntries(sourceFile, position) { - var node = ts.findPrecedingToken(position, sourceFile); - if (!node || node.kind !== 9) { - return undefined; - } - if (node.parent.kind === 257 && - node.parent.parent.kind === 176 && - node.parent.name === node) { - return getStringLiteralCompletionEntriesFromPropertyAssignment(node.parent); - } - else if (ts.isElementAccessExpression(node.parent) && node.parent.argumentExpression === node) { - return getStringLiteralCompletionEntriesFromElementAccess(node.parent); - } - else if (node.parent.kind === 235 || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node) || ts.isRequireCall(node.parent, false)) { - return getStringLiteralCompletionEntriesFromModuleNames(node); - } - else { - var argumentInfo = ts.SignatureHelp.getContainingArgumentInfo(node, position, sourceFile); - if (argumentInfo) { - return getStringLiteralCompletionEntriesFromCallExpression(argumentInfo); - } - return getStringLiteralCompletionEntriesFromContextualType(node); - } - } - function getStringLiteralCompletionEntriesFromPropertyAssignment(element) { - var type = typeChecker.getContextualType(element.parent); - var entries = []; - if (type) { - getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, element, false); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; - } - } - } - function getStringLiteralCompletionEntriesFromCallExpression(argumentInfo) { - var candidates = []; - var entries = []; - typeChecker.getResolvedSignature(argumentInfo.invocation, candidates); - for (var _i = 0, candidates_3 = candidates; _i < candidates_3.length; _i++) { - var candidate = candidates_3[_i]; - if (candidate.parameters.length > argumentInfo.argumentIndex) { - var parameter = candidate.parameters[argumentInfo.argumentIndex]; - addStringLiteralCompletionsFromType(typeChecker.getTypeAtLocation(parameter.valueDeclaration), entries); - } - } - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: true, entries: entries }; - } - return undefined; - } - function getStringLiteralCompletionEntriesFromElementAccess(node) { - var type = typeChecker.getTypeAtLocation(node.expression); - var entries = []; - if (type) { - getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, node, false); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; - } - } - return undefined; - } - function getStringLiteralCompletionEntriesFromContextualType(node) { - var type = typeChecker.getContextualType(node); - if (type) { - var entries_2 = []; - addStringLiteralCompletionsFromType(type, entries_2); - if (entries_2.length) { - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries_2 }; - } - } - return undefined; - } - function addStringLiteralCompletionsFromType(type, result) { - if (!type) { - return; - } - if (type.flags & 65536) { - ts.forEach(type.types, function (t) { return addStringLiteralCompletionsFromType(t, result); }); - } - else { - if (type.flags & 32) { - result.push({ - name: type.text, - kindModifiers: ts.ScriptElementKindModifier.none, - kind: ts.ScriptElementKind.variableElement, - sortText: "0" - }); - } - } - } - function getStringLiteralCompletionEntriesFromModuleNames(node) { + var PathCompletions; + (function (PathCompletions) { + function getStringLiteralCompletionEntriesFromModuleNames(node, compilerOptions, host, typeChecker) { var literalValue = ts.normalizeSlashes(node.text); var scriptPath = node.getSourceFile().path; var scriptDirectory = ts.getDirectoryPath(scriptPath); var span = getDirectoryFragmentTextSpan(node.text, node.getStart() + 1); var entries; if (isPathRelativeToScript(literalValue) || ts.isRootedDiskPath(literalValue)) { + var extensions = ts.getSupportedExtensions(compilerOptions); if (compilerOptions.rootDirs) { - entries = getCompletionEntriesForDirectoryFragmentWithRootDirs(compilerOptions.rootDirs, literalValue, scriptDirectory, ts.getSupportedExtensions(compilerOptions), false, span, scriptPath); + entries = getCompletionEntriesForDirectoryFragmentWithRootDirs(compilerOptions.rootDirs, literalValue, scriptDirectory, extensions, false, span, compilerOptions, host, scriptPath); } else { - entries = getCompletionEntriesForDirectoryFragment(literalValue, scriptDirectory, ts.getSupportedExtensions(compilerOptions), false, span, scriptPath); + entries = getCompletionEntriesForDirectoryFragment(literalValue, scriptDirectory, extensions, false, span, host, scriptPath); } } else { - entries = getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, span); + entries = getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, span, compilerOptions, host, typeChecker); } return { isGlobalCompletion: false, @@ -54562,6 +59810,7 @@ var ts; entries: entries }; } + PathCompletions.getStringLiteralCompletionEntriesFromModuleNames = getStringLiteralCompletionEntriesFromModuleNames; function getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptPath, ignoreCase) { rootDirs = ts.map(rootDirs, function (rootDirectory) { return ts.normalizePath(ts.isRootedDiskPath(rootDirectory) ? rootDirectory : ts.combinePaths(basePath, rootDirectory)); }); var relativeDirectory; @@ -54574,18 +59823,18 @@ var ts; } return ts.deduplicate(ts.map(rootDirs, function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); })); } - function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptPath, extensions, includeExtensions, span, exclude) { + function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptPath, extensions, includeExtensions, span, compilerOptions, host, exclude) { var basePath = compilerOptions.project || host.getCurrentDirectory(); var ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); var baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptPath, ignoreCase); var result = []; for (var _i = 0, baseDirectories_1 = baseDirectories; _i < baseDirectories_1.length; _i++) { var baseDirectory = baseDirectories_1[_i]; - getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensions, includeExtensions, span, exclude, result); + getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensions, includeExtensions, span, host, exclude, result); } return result; } - function getCompletionEntriesForDirectoryFragment(fragment, scriptPath, extensions, includeExtensions, span, exclude, result) { + function getCompletionEntriesForDirectoryFragment(fragment, scriptPath, extensions, includeExtensions, span, host, exclude, result) { if (result === void 0) { result = []; } if (fragment === undefined) { fragment = ""; @@ -54610,13 +59859,13 @@ var ts; continue; } var foundFileName = includeExtensions ? ts.getBaseFileName(filePath) : ts.removeFileExtension(ts.getBaseFileName(filePath)); - if (!foundFiles[foundFileName]) { - foundFiles[foundFileName] = true; + if (!foundFiles.get(foundFileName)) { + foundFiles.set(foundFileName, true); } } - for (var foundFile in foundFiles) { + ts.forEachKey(foundFiles, function (foundFile) { result.push(createCompletionEntryForModule(foundFile, ts.ScriptElementKind.scriptElement, span)); - } + }); } var directories = tryGetDirectories(host, baseDirectory); if (directories) { @@ -54629,14 +59878,14 @@ var ts; } return result; } - function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, span) { + function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, span, compilerOptions, host, typeChecker) { var baseUrl = compilerOptions.baseUrl, paths = compilerOptions.paths; var result; if (baseUrl) { var fileExtensions = ts.getSupportedExtensions(compilerOptions); var projectDir = compilerOptions.project || host.getCurrentDirectory(); var absolute = ts.isRootedDiskPath(baseUrl) ? baseUrl : ts.combinePaths(projectDir, baseUrl); - result = getCompletionEntriesForDirectoryFragment(fragment, ts.normalizePath(absolute), fileExtensions, false, span); + result = getCompletionEntriesForDirectoryFragment(fragment, ts.normalizePath(absolute), fileExtensions, false, span, host); if (paths) { for (var path in paths) { if (paths.hasOwnProperty(path)) { @@ -54644,7 +59893,7 @@ var ts; if (paths[path]) { for (var _i = 0, _a = paths[path]; _i < _a.length; _i++) { var pattern = _a[_i]; - for (var _b = 0, _c = getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions); _b < _c.length; _b++) { + for (var _b = 0, _c = getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host); _b < _c.length; _b++) { var match = _c[_b]; result.push(createCompletionEntryForModule(match, ts.ScriptElementKind.externalModuleName, span)); } @@ -54665,13 +59914,13 @@ var ts; result = []; } getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, span, result); - for (var _d = 0, _e = enumeratePotentialNonRelativeModules(fragment, scriptPath, compilerOptions); _d < _e.length; _d++) { + for (var _d = 0, _e = enumeratePotentialNonRelativeModules(fragment, scriptPath, compilerOptions, typeChecker, host); _d < _e.length; _d++) { var moduleName = _e[_d]; result.push(createCompletionEntryForModule(moduleName, ts.ScriptElementKind.externalModuleName, span)); } return result; } - function getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions) { + function getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host) { if (host.readDirectory) { var parsed = ts.hasZeroOrOneAsteriskCharacter(pattern) ? ts.tryParsePattern(pattern) : undefined; if (parsed) { @@ -54694,8 +59943,8 @@ var ts; continue; } var start = completePrefix.length; - var length_5 = normalizedMatch.length - start - normalizedSuffix.length; - result.push(ts.removeFileExtension(normalizedMatch.substr(start, length_5))); + var length_6 = normalizedMatch.length - start - normalizedSuffix.length; + result.push(ts.removeFileExtension(normalizedMatch.substr(start, length_6))); } return result; } @@ -54703,7 +59952,7 @@ var ts; } return undefined; } - function enumeratePotentialNonRelativeModules(fragment, scriptPath, options) { + function enumeratePotentialNonRelativeModules(fragment, scriptPath, options, typeChecker, host) { var isNestedModule = fragment.indexOf(ts.directorySeparator) !== -1; var moduleNameFragment = isNestedModule ? fragment.substr(0, fragment.lastIndexOf(ts.directorySeparator)) : undefined; var ambientModules = ts.map(typeChecker.getAmbientModules(), function (sym) { return ts.stripQuotes(sym.name); }); @@ -54738,7 +59987,7 @@ var ts; } return ts.deduplicate(nonRelativeModules); } - function getTripleSlashReferenceCompletion(sourceFile, position) { + function getTripleSlashReferenceCompletion(sourceFile, position, compilerOptions, host) { var token = ts.getTokenAtPosition(sourceFile, position); if (!token) { return undefined; @@ -54766,7 +60015,7 @@ var ts; var scriptPath = ts.getDirectoryPath(sourceFile.path); if (kind === "path") { var span_10 = getDirectoryFragmentTextSpan(toComplete, range.pos + prefix.length); - completionInfo.entries = getCompletionEntriesForDirectoryFragment(toComplete, scriptPath, ts.getSupportedExtensions(compilerOptions), true, span_10, sourceFile.path); + completionInfo.entries = getCompletionEntriesForDirectoryFragment(toComplete, scriptPath, ts.getSupportedExtensions(compilerOptions), true, span_10, host, sourceFile.path); } else { var span_11 = { start: range.pos + prefix.length, length: match[0].length - prefix.length }; @@ -54775,6 +60024,7 @@ var ts; } return completionInfo; } + PathCompletions.getTripleSlashReferenceCompletion = getTripleSlashReferenceCompletion; function getCompletionEntriesFromTypings(host, options, scriptPath, span, result) { if (result === void 0) { result = []; } if (options.types) { @@ -54797,7 +60047,7 @@ var ts; } } if (host.getDirectories) { - for (var _c = 0, _d = findPackageJsons(scriptPath); _c < _d.length; _c++) { + for (var _c = 0, _d = findPackageJsons(scriptPath, host); _c < _d.length; _c++) { var packageJson = _d[_c]; var typesDir = ts.combinePaths(ts.getDirectoryPath(packageJson), "node_modules/@types"); getCompletionEntriesFromDirectories(host, typesDir, span, result); @@ -54817,7 +60067,7 @@ var ts; } } } - function findPackageJsons(currentDir) { + function findPackageJsons(currentDir, host) { var paths = []; var currentConfigPath; while (true) { @@ -54825,11 +60075,11 @@ var ts; if (currentConfigPath) { paths.push(currentConfigPath); currentDir = ts.getDirectoryPath(currentConfigPath); - var parent_13 = ts.getDirectoryPath(currentDir); - if (currentDir === parent_13) { + var parent = ts.getDirectoryPath(currentDir); + if (currentDir === parent) { break; } - currentDir = parent_13; + currentDir = parent; } else { break; @@ -54840,7 +60090,7 @@ var ts; function enumerateNodeModulesVisibleToScript(host, scriptPath) { var result = []; if (host.readFile && host.fileExists) { - for (var _i = 0, _a = findPackageJsons(scriptPath); _i < _a.length; _i++) { + for (var _i = 0, _a = findPackageJsons(scriptPath, host); _i < _a.length; _i++) { var packageJson = _a[_i]; var contents = tryReadingPackageJson(packageJson); if (!contents) { @@ -54901,21 +60151,256 @@ var ts; function normalizeAndPreserveTrailingSlash(path) { return ts.hasTrailingDirectorySeparator(path) ? ts.ensureTrailingDirectorySeparator(ts.normalizePath(path)) : ts.normalizePath(path); } + var tripleSlashDirectiveFragmentRegex = /^(\/\/\/\s*= 0; i--) { - if (pushKeywordIf(keywords, loopTokens[i], 105)) { - break; - } - } - } - } - var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); - ts.forEach(breaksAndContinues, function (statement) { - if (ownsBreakOrContinueStatement(loopNode, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 71, 76); - } - }); - return ts.map(keywords, getHighlightSpanForNode); - } - function getBreakOrContinueStatementOccurrences(breakOrContinueStatement) { - var owner = getBreakOrContinueOwner(breakOrContinueStatement); - if (owner) { - switch (owner.kind) { - case 211: - case 212: - case 213: - case 209: - case 210: - return getLoopBreakContinueOccurrences(owner); - case 218: - return getSwitchCaseDefaultOccurrences(owner); - } - } - return undefined; - } - function getSwitchCaseDefaultOccurrences(switchStatement) { - var keywords = []; - pushKeywordIf(keywords, switchStatement.getFirstToken(), 97); - ts.forEach(switchStatement.caseBlock.clauses, function (clause) { - pushKeywordIf(keywords, clause.getFirstToken(), 72, 78); - var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); - ts.forEach(breaksAndContinues, function (statement) { - if (ownsBreakOrContinueStatement(switchStatement, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 71); - } - }); - }); - return ts.map(keywords, getHighlightSpanForNode); - } - function getTryCatchFinallyOccurrences(tryStatement) { - var keywords = []; - pushKeywordIf(keywords, tryStatement.getFirstToken(), 101); - if (tryStatement.catchClause) { - pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 73); + aggregate(tryStatement.tryBlock); } if (tryStatement.finallyBlock) { - var finallyKeyword = ts.findChildOfKind(tryStatement, 86, sourceFile); - pushKeywordIf(keywords, finallyKeyword, 86); + aggregate(tryStatement.finallyBlock); } - return ts.map(keywords, getHighlightSpanForNode); } - function getThrowOccurrences(throwStatement) { - var owner = getThrowStatementOwner(throwStatement); - if (!owner) { - return undefined; - } - var keywords = []; - ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 99); - }); - if (ts.isFunctionBlock(owner)) { - ts.forEachReturnStatement(owner, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 95); - }); - } - return ts.map(keywords, getHighlightSpanForNode); - } - function getReturnOccurrences(returnStatement) { - var func = ts.getContainingFunction(returnStatement); - if (!(func && hasKind(func.body, 204))) { - return undefined; - } - var keywords = []; - ts.forEachReturnStatement(func.body, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 95); - }); - ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 99); - }); - return ts.map(keywords, getHighlightSpanForNode); - } - function getIfElseOccurrences(ifStatement) { - var keywords = []; - while (hasKind(ifStatement.parent, 208) && ifStatement.parent.elseStatement === ifStatement) { - ifStatement = ifStatement.parent; - } - while (ifStatement) { - var children = ifStatement.getChildren(); - pushKeywordIf(keywords, children[0], 89); - for (var i = children.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, children[i], 81)) { - break; - } - } - if (!hasKind(ifStatement.elseStatement, 208)) { - break; - } - ifStatement = ifStatement.elseStatement; - } - var result = []; - for (var i = 0; i < keywords.length; i++) { - if (keywords[i].kind === 81 && i < keywords.length - 1) { - var elseKeyword = keywords[i]; - var ifKeyword = keywords[i + 1]; - var shouldCombindElseAndIf = true; - for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { - if (!ts.isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(j))) { - shouldCombindElseAndIf = false; - break; - } - } - if (shouldCombindElseAndIf) { - result.push({ - fileName: fileName, - textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), - kind: ts.HighlightSpanKind.reference - }); - i++; - continue; - } - } - result.push(getHighlightSpanForNode(keywords[i])); - } - return result; + else if (!ts.isFunctionLike(node)) { + ts.forEachChild(node, aggregate); } } } - DocumentHighlights.getDocumentHighlights = getDocumentHighlights; + function getThrowStatementOwner(throwStatement) { + var child = throwStatement; + while (child.parent) { + var parent_2 = child.parent; + if (ts.isFunctionBlock(parent_2) || parent_2.kind === 264) { + return parent_2; + } + if (parent_2.kind === 223) { + var tryStatement = parent_2; + if (tryStatement.tryBlock === child && tryStatement.catchClause) { + return child; + } + } + child = parent_2; + } + return undefined; + } + function aggregateAllBreakAndContinueStatements(node) { + var statementAccumulator = []; + aggregate(node); + return statementAccumulator; + function aggregate(node) { + if (node.kind === 217 || node.kind === 216) { + statementAccumulator.push(node); + } + else if (!ts.isFunctionLike(node)) { + ts.forEachChild(node, aggregate); + } + } + } + function ownsBreakOrContinueStatement(owner, statement) { + var actualOwner = getBreakOrContinueOwner(statement); + return actualOwner && actualOwner === owner; + } + function getBreakOrContinueOwner(statement) { + for (var node = statement.parent; node; node = node.parent) { + switch (node.kind) { + case 220: + if (statement.kind === 216) { + continue; + } + case 213: + case 214: + case 215: + case 212: + case 211: + if (!statement.label || isLabeledBy(node, statement.label.text)) { + return node; + } + break; + default: + if (ts.isFunctionLike(node)) { + return undefined; + } + break; + } + } + return undefined; + } + function getModifierOccurrences(modifier, declaration) { + var container = declaration.parent; + if (ts.isAccessibilityModifier(modifier)) { + if (!(container.kind === 228 || + container.kind === 198 || + (declaration.kind === 145 && hasKind(container, 151)))) { + return undefined; + } + } + else if (modifier === 114) { + if (!(container.kind === 228 || container.kind === 198)) { + return undefined; + } + } + else if (modifier === 83 || modifier === 123) { + if (!(container.kind === 233 || container.kind === 264)) { + return undefined; + } + } + else if (modifier === 116) { + if (!(container.kind === 228 || declaration.kind === 228)) { + return undefined; + } + } + else { + return undefined; + } + var keywords = []; + var modifierFlag = getFlagFromModifier(modifier); + var nodes; + switch (container.kind) { + case 233: + case 264: + if (modifierFlag & 128) { + nodes = declaration.members.concat(declaration); + } + else { + nodes = container.statements; + } + break; + case 151: + nodes = container.parameters.concat(container.parent.members); + break; + case 228: + case 198: + nodes = container.members; + if (modifierFlag & 28) { + var constructor = ts.forEach(container.members, function (member) { + return member.kind === 151 && member; + }); + if (constructor) { + nodes = nodes.concat(constructor.parameters); + } + } + else if (modifierFlag & 128) { + nodes = nodes.concat(container); + } + break; + default: + ts.Debug.fail("Invalid container kind."); + } + ts.forEach(nodes, function (node) { + if (ts.getModifierFlags(node) & modifierFlag) { + ts.forEach(node.modifiers, function (child) { return pushKeywordIf(keywords, child, modifier); }); + } + }); + return keywords; + function getFlagFromModifier(modifier) { + switch (modifier) { + case 113: + return 4; + case 111: + return 8; + case 112: + return 16; + case 114: + return 32; + case 83: + return 1; + case 123: + return 2; + case 116: + return 128; + default: + ts.Debug.fail(); + } + } + } + function pushKeywordIf(keywordList, token) { + var expected = []; + for (var _i = 2; _i < arguments.length; _i++) { + expected[_i - 2] = arguments[_i]; + } + if (token && ts.contains(expected, token.kind)) { + keywordList.push(token); + return true; + } + return false; + } + function getGetAndSetOccurrences(accessorDeclaration) { + var keywords = []; + tryPushAccessorKeyword(accessorDeclaration.symbol, 152); + tryPushAccessorKeyword(accessorDeclaration.symbol, 153); + return keywords; + function tryPushAccessorKeyword(accessorSymbol, accessorKind) { + var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); + if (accessor) { + ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 124, 134); }); + } + } + } + function getConstructorOccurrences(constructorDeclaration) { + var declarations = constructorDeclaration.symbol.getDeclarations(); + var keywords = []; + ts.forEach(declarations, function (declaration) { + ts.forEach(declaration.getChildren(), function (token) { + return pushKeywordIf(keywords, token, 122); + }); + }); + return keywords; + } + function getLoopBreakContinueOccurrences(loopNode) { + var keywords = []; + if (pushKeywordIf(keywords, loopNode.getFirstToken(), 87, 105, 80)) { + if (loopNode.kind === 211) { + var loopTokens = loopNode.getChildren(); + for (var i = loopTokens.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, loopTokens[i], 105)) { + break; + } + } + } + } + var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); + ts.forEach(breaksAndContinues, function (statement) { + if (ownsBreakOrContinueStatement(loopNode, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), 71, 76); + } + }); + return keywords; + } + function getBreakOrContinueStatementOccurrences(breakOrContinueStatement) { + var owner = getBreakOrContinueOwner(breakOrContinueStatement); + if (owner) { + switch (owner.kind) { + case 213: + case 214: + case 215: + case 211: + case 212: + return getLoopBreakContinueOccurrences(owner); + case 220: + return getSwitchCaseDefaultOccurrences(owner); + } + } + return undefined; + } + function getSwitchCaseDefaultOccurrences(switchStatement) { + var keywords = []; + pushKeywordIf(keywords, switchStatement.getFirstToken(), 97); + ts.forEach(switchStatement.caseBlock.clauses, function (clause) { + pushKeywordIf(keywords, clause.getFirstToken(), 72, 78); + var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); + ts.forEach(breaksAndContinues, function (statement) { + if (ownsBreakOrContinueStatement(switchStatement, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), 71); + } + }); + }); + return keywords; + } + function getTryCatchFinallyOccurrences(tryStatement, sourceFile) { + var keywords = []; + pushKeywordIf(keywords, tryStatement.getFirstToken(), 101); + if (tryStatement.catchClause) { + pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 73); + } + if (tryStatement.finallyBlock) { + var finallyKeyword = ts.findChildOfKind(tryStatement, 86, sourceFile); + pushKeywordIf(keywords, finallyKeyword, 86); + } + return keywords; + } + function getThrowOccurrences(throwStatement) { + var owner = getThrowStatementOwner(throwStatement); + if (!owner) { + return undefined; + } + var keywords = []; + ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { + pushKeywordIf(keywords, throwStatement.getFirstToken(), 99); + }); + if (ts.isFunctionBlock(owner)) { + ts.forEachReturnStatement(owner, function (returnStatement) { + pushKeywordIf(keywords, returnStatement.getFirstToken(), 95); + }); + } + return keywords; + } + function getReturnOccurrences(returnStatement) { + var func = ts.getContainingFunction(returnStatement); + if (!(func && hasKind(func.body, 206))) { + return undefined; + } + var keywords = []; + ts.forEachReturnStatement(func.body, function (returnStatement) { + pushKeywordIf(keywords, returnStatement.getFirstToken(), 95); + }); + ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { + pushKeywordIf(keywords, throwStatement.getFirstToken(), 99); + }); + return keywords; + } + function getIfElseOccurrences(ifStatement, sourceFile) { + var keywords = []; + while (hasKind(ifStatement.parent, 210) && ifStatement.parent.elseStatement === ifStatement) { + ifStatement = ifStatement.parent; + } + while (ifStatement) { + var children = ifStatement.getChildren(); + pushKeywordIf(keywords, children[0], 89); + for (var i = children.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, children[i], 81)) { + break; + } + } + if (!hasKind(ifStatement.elseStatement, 210)) { + break; + } + ifStatement = ifStatement.elseStatement; + } + var result = []; + for (var i = 0; i < keywords.length; i++) { + if (keywords[i].kind === 81 && i < keywords.length - 1) { + var elseKeyword = keywords[i]; + var ifKeyword = keywords[i + 1]; + var shouldCombindElseAndIf = true; + for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { + if (!ts.isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(j))) { + shouldCombindElseAndIf = false; + break; + } + } + if (shouldCombindElseAndIf) { + result.push({ + fileName: sourceFile.fileName, + textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), + kind: ts.HighlightSpanKind.reference + }); + i++; + continue; + } + } + result.push(getHighlightSpanForNode(keywords[i], sourceFile)); + } + return result; + } function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 219; owner = owner.parent) { + for (var owner = node.parent; owner.kind === 221; owner = owner.parent) { if (owner.label.text === labelName) { return true; } @@ -56110,15 +61574,15 @@ var ts; return "_" + settings.target + "|" + settings.module + "|" + settings.noResolve + "|" + settings.jsx + "|" + settings.allowJs + "|" + settings.baseUrl + "|" + JSON.stringify(settings.typeRoots) + "|" + JSON.stringify(settings.rootDirs) + "|" + JSON.stringify(settings.paths); } function getBucketForCompilationSettings(key, createIfMissing) { - var bucket = buckets[key]; + var bucket = buckets.get(key); if (!bucket && createIfMissing) { - buckets[key] = bucket = ts.createFileMap(); + buckets.set(key, bucket = ts.createFileMap()); } return bucket; } function reportStats() { - var bucketInfoArray = Object.keys(buckets).filter(function (name) { return name && name.charAt(0) === "_"; }).map(function (name) { - var entries = buckets[name]; + var bucketInfoArray = ts.arrayFrom(buckets.keys()).filter(function (name) { return name && name.charAt(0) === "_"; }).map(function (name) { + var entries = buckets.get(name); var sourceFiles = []; entries.forEachValue(function (key, entry) { sourceFiles.push({ @@ -56206,179 +61670,871 @@ var ts; (function (ts) { var FindAllReferences; (function (FindAllReferences) { - function findReferencedSymbols(typeChecker, cancellationToken, sourceFiles, sourceFile, position, findInStrings, findInComments) { - var node = ts.getTouchingPropertyName(sourceFile, position, true); - if (node === sourceFile) { + function createImportTracker(sourceFiles, checker, cancellationToken) { + var allDirectImports = getDirectImportsMap(sourceFiles, checker, cancellationToken); + return function (exportSymbol, exportInfo, isForRename) { + var _a = getImportersForExport(sourceFiles, allDirectImports, exportInfo, checker, cancellationToken), directImports = _a.directImports, indirectUsers = _a.indirectUsers; + return __assign({ indirectUsers: indirectUsers }, getSearchesFromDirectImports(directImports, exportSymbol, exportInfo.exportKind, checker, isForRename)); + }; + } + FindAllReferences.createImportTracker = createImportTracker; + var ExportKind; + (function (ExportKind) { + ExportKind[ExportKind["Named"] = 0] = "Named"; + ExportKind[ExportKind["Default"] = 1] = "Default"; + ExportKind[ExportKind["ExportEquals"] = 2] = "ExportEquals"; + })(ExportKind = FindAllReferences.ExportKind || (FindAllReferences.ExportKind = {})); + var ImportExport; + (function (ImportExport) { + ImportExport[ImportExport["Import"] = 0] = "Import"; + ImportExport[ImportExport["Export"] = 1] = "Export"; + })(ImportExport = FindAllReferences.ImportExport || (FindAllReferences.ImportExport = {})); + function getImportersForExport(sourceFiles, allDirectImports, _a, checker, cancellationToken) { + var exportingModuleSymbol = _a.exportingModuleSymbol, exportKind = _a.exportKind; + var markSeenDirectImport = ts.nodeSeenTracker(); + var markSeenIndirectUser = ts.nodeSeenTracker(); + var directImports = []; + var isAvailableThroughGlobal = !!exportingModuleSymbol.globalExports; + var indirectUserDeclarations = isAvailableThroughGlobal ? undefined : []; + handleDirectImports(exportingModuleSymbol); + return { directImports: directImports, indirectUsers: getIndirectUsers() }; + function getIndirectUsers() { + if (isAvailableThroughGlobal) { + return sourceFiles; + } + for (var _i = 0, _a = exportingModuleSymbol.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + if (ts.isExternalModuleAugmentation(decl)) { + addIndirectUser(decl); + } + } + return indirectUserDeclarations.map(ts.getSourceFileOfNode); + } + function handleDirectImports(exportingModuleSymbol) { + var theseDirectImports = getDirectImports(exportingModuleSymbol); + if (theseDirectImports) + for (var _i = 0, theseDirectImports_1 = theseDirectImports; _i < theseDirectImports_1.length; _i++) { + var direct = theseDirectImports_1[_i]; + if (!markSeenDirectImport(direct)) { + continue; + } + cancellationToken.throwIfCancellationRequested(); + switch (direct.kind) { + case 180: + if (!isAvailableThroughGlobal) { + var parent = direct.parent; + if (exportKind === 2 && parent.kind === 225) { + var name = parent.name; + if (name.kind === 70) { + directImports.push(name); + break; + } + } + addIndirectUser(direct.getSourceFile()); + } + break; + case 236: + handleNamespaceImport(direct, direct.name, ts.hasModifier(direct, 1)); + break; + case 237: + var namedBindings = direct.importClause && direct.importClause.namedBindings; + if (namedBindings && namedBindings.kind === 239) { + handleNamespaceImport(direct, namedBindings.name); + } + else { + directImports.push(direct); + } + break; + case 243: + if (!direct.exportClause) { + handleDirectImports(getContainingModuleSymbol(direct, checker)); + } + else { + directImports.push(direct); + } + break; + } + } + } + function handleNamespaceImport(importDeclaration, name, isReExport) { + if (exportKind === 2) { + directImports.push(importDeclaration); + } + else if (!isAvailableThroughGlobal) { + var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); + ts.Debug.assert(sourceFileLike.kind === 264 || sourceFileLike.kind === 232); + if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { + addIndirectUsers(sourceFileLike); + } + else { + addIndirectUser(sourceFileLike); + } + } + } + function addIndirectUser(sourceFileLike) { + ts.Debug.assert(!isAvailableThroughGlobal); + var isNew = markSeenIndirectUser(sourceFileLike); + if (isNew) { + indirectUserDeclarations.push(sourceFileLike); + } + return isNew; + } + function addIndirectUsers(sourceFileLike) { + if (!addIndirectUser(sourceFileLike)) { + return; + } + var moduleSymbol = checker.getMergedSymbol(sourceFileLike.symbol); + ts.Debug.assert(!!(moduleSymbol.flags & 1536)); + var directImports = getDirectImports(moduleSymbol); + if (directImports) + for (var _i = 0, directImports_1 = directImports; _i < directImports_1.length; _i++) { + var directImport = directImports_1[_i]; + addIndirectUsers(getSourceFileLikeForImportDeclaration(directImport)); + } + } + function getDirectImports(moduleSymbol) { + return allDirectImports.get(ts.getSymbolId(moduleSymbol).toString()); + } + } + function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, checker, isForRename) { + var exportName = exportSymbol.name; + var importSearches = []; + var singleReferences = []; + function addSearch(location, symbol) { + importSearches.push([location, symbol]); + } + if (directImports) + for (var _i = 0, directImports_2 = directImports; _i < directImports_2.length; _i++) { + var decl = directImports_2[_i]; + handleImport(decl); + } + return { importSearches: importSearches, singleReferences: singleReferences }; + function handleImport(decl) { + if (decl.kind === 236) { + if (isExternalModuleImportEquals(decl)) { + handleNamespaceImportLike(decl.name); + } + return; + } + if (decl.kind === 70) { + handleNamespaceImportLike(decl); + return; + } + if (decl.moduleSpecifier.kind !== 9) { + return; + } + if (decl.kind === 243) { + searchForNamedImport(decl.exportClause); + return; + } + var importClause = decl.importClause; + var namedBindings = importClause.namedBindings; + if (namedBindings && namedBindings.kind === 239) { + handleNamespaceImportLike(namedBindings.name); + return; + } + if (exportKind === 0) { + searchForNamedImport(namedBindings); + } + else { + var name = importClause.name; + if (name && (!isForRename || name.text === symbolName(exportSymbol))) { + var defaultImportAlias = checker.getSymbolAtLocation(name); + addSearch(name, defaultImportAlias); + } + if (!isForRename && exportKind === 1) { + ts.Debug.assert(exportName === "default"); + searchForNamedImport(namedBindings); + } + } + } + function handleNamespaceImportLike(importName) { + if (exportKind === 2 && (!isForRename || importName.text === exportName)) { + addSearch(importName, checker.getSymbolAtLocation(importName)); + } + } + function searchForNamedImport(namedBindings) { + if (namedBindings) + for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { + var element = _a[_i]; + var name = element.name, propertyName = element.propertyName; + if ((propertyName || name).text !== exportName) { + continue; + } + if (propertyName) { + singleReferences.push(propertyName); + if (!isForRename) { + addSearch(name, checker.getSymbolAtLocation(name)); + } + } + else { + var localSymbol = element.kind === 245 && element.propertyName + ? checker.getExportSpecifierLocalTargetSymbol(element) + : checker.getSymbolAtLocation(name); + addSearch(name, localSymbol); + } + } + } + } + function findNamespaceReExports(sourceFileLike, name, checker) { + var namespaceImportSymbol = checker.getSymbolAtLocation(name); + return forEachPossibleImportOrExportStatement(sourceFileLike, function (statement) { + if (statement.kind !== 243) + return; + var _a = statement, exportClause = _a.exportClause, moduleSpecifier = _a.moduleSpecifier; + if (moduleSpecifier || !exportClause) + return; + for (var _i = 0, _b = exportClause.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (checker.getExportSpecifierLocalTargetSymbol(element) === namespaceImportSymbol) { + return true; + } + } + }); + } + function getDirectImportsMap(sourceFiles, checker, cancellationToken) { + var map = ts.createMap(); + for (var _i = 0, sourceFiles_4 = sourceFiles; _i < sourceFiles_4.length; _i++) { + var sourceFile = sourceFiles_4[_i]; + cancellationToken.throwIfCancellationRequested(); + forEachImport(sourceFile, function (importDecl, moduleSpecifier) { + var moduleSymbol = checker.getSymbolAtLocation(moduleSpecifier); + if (moduleSymbol) { + var id = ts.getSymbolId(moduleSymbol).toString(); + var imports = map.get(id); + if (!imports) { + map.set(id, imports = []); + } + imports.push(importDecl); + } + }); + } + return map; + } + function forEachPossibleImportOrExportStatement(sourceFileLike, action) { + return ts.forEach(sourceFileLike.kind === 264 ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); + }); + } + function forEachImport(sourceFile, action) { + if (sourceFile.externalModuleIndicator) { + for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { + var moduleSpecifier = _a[_i]; + action(importerFromModuleSpecifier(moduleSpecifier), moduleSpecifier); + } + } + else { + forEachPossibleImportOrExportStatement(sourceFile, function (statement) { + switch (statement.kind) { + case 243: + case 237: { + var decl = statement; + if (decl.moduleSpecifier && decl.moduleSpecifier.kind === 9) { + action(decl, decl.moduleSpecifier); + } + break; + } + case 236: { + var decl = statement; + var moduleReference = decl.moduleReference; + if (moduleReference.kind === 247 && + moduleReference.expression.kind === 9) { + action(decl, moduleReference.expression); + } + break; + } + } + }); + if (sourceFile.flags & 65536) { + sourceFile.forEachChild(function recur(node) { + if (ts.isRequireCall(node, true)) { + action(node, node.arguments[0]); + } + else { + node.forEachChild(recur); + } + }); + } + } + } + function importerFromModuleSpecifier(moduleSpecifier) { + var decl = moduleSpecifier.parent; + if (decl.kind === 237 || decl.kind === 243) { + return decl; + } + ts.Debug.assert(decl.kind === 247); + return decl.parent; + } + function getImportOrExportSymbol(node, symbol, checker, comingFromExport) { + return comingFromExport ? getExport() : getExport() || getImport(); + function getExport() { + var parent = node.parent; + if (symbol.flags & 7340032) { + if (parent.kind === 178) { + return symbol.declarations.some(function (d) { return d === parent; }) && parent.parent.kind === 193 + ? getSpecialPropertyExport(parent.parent, false) + : undefined; + } + else { + var exportSymbol = symbol.exportSymbol; + ts.Debug.assert(!!exportSymbol); + return exportInfo(exportSymbol, getExportKindForDeclaration(parent)); + } + } + else { + var exportNode = parent.kind === 225 ? ts.getAncestor(parent, 207) : parent; + if (ts.hasModifier(exportNode, 1)) { + if (exportNode.kind === 236 && exportNode.moduleReference === node) { + if (comingFromExport) { + return undefined; + } + var lhsSymbol = checker.getSymbolAtLocation(exportNode.name); + return { kind: 0, symbol: lhsSymbol, isNamedImport: false }; + } + else { + return exportInfo(symbol, getExportKindForDeclaration(exportNode)); + } + } + else if (parent.kind === 242) { + var exportingModuleSymbol = parent.symbol.parent; + ts.Debug.assert(!!exportingModuleSymbol); + return { kind: 1, symbol: symbol, exportInfo: { exportingModuleSymbol: exportingModuleSymbol, exportKind: 2 } }; + } + else if (parent.kind === 193) { + return getSpecialPropertyExport(parent, true); + } + else if (parent.parent.kind === 193) { + return getSpecialPropertyExport(parent.parent, true); + } + } + function getSpecialPropertyExport(node, useLhsSymbol) { + var kind; + switch (ts.getSpecialPropertyAssignmentKind(node)) { + case 1: + kind = 0; + break; + case 2: + kind = 2; + break; + default: + return undefined; + } + var sym = useLhsSymbol ? checker.getSymbolAtLocation(node.left.name) : symbol; + return sym && exportInfo(sym, kind); + } + } + function getImport() { + var isImport = isNodeImport(node); + if (!isImport) + return; + var importedSymbol = checker.getImmediateAliasedSymbol(symbol); + if (importedSymbol) { + importedSymbol = skipExportSpecifierSymbol(importedSymbol, checker); + if (importedSymbol.name === "export=") { + importedSymbol = checker.getImmediateAliasedSymbol(importedSymbol); + } + if (symbolName(importedSymbol) === symbol.name) { + return __assign({ kind: 0, symbol: importedSymbol }, isImport); + } + } + } + function exportInfo(symbol, kind) { + var exportInfo = getExportInfo(symbol, kind, checker); + return exportInfo && { kind: 1, symbol: symbol, exportInfo: exportInfo }; + } + function getExportKindForDeclaration(node) { + return ts.hasModifier(node, 512) ? 1 : 0; + } + } + FindAllReferences.getImportOrExportSymbol = getImportOrExportSymbol; + function isNodeImport(node) { + var parent = node.parent; + switch (parent.kind) { + case 236: + return parent.name === node && isExternalModuleImportEquals(parent) + ? { isNamedImport: false } + : undefined; + case 241: + return parent.propertyName ? undefined : { isNamedImport: true }; + case 238: + case 239: + ts.Debug.assert(parent.name === node); + return { isNamedImport: false }; + default: + return undefined; + } + } + function getExportInfo(exportSymbol, exportKind, checker) { + var exportingModuleSymbol = checker.getMergedSymbol(exportSymbol.parent); + return ts.isExternalModuleSymbol(exportingModuleSymbol) ? { exportingModuleSymbol: exportingModuleSymbol, exportKind: exportKind } : undefined; + } + FindAllReferences.getExportInfo = getExportInfo; + function symbolName(symbol) { + if (symbol.name !== "default") { + return symbol.name; + } + var name = ts.forEach(symbol.declarations, function (_a) { + var name = _a.name; + return name && name.kind === 70 && name.text; + }); + ts.Debug.assert(!!name); + return name; + } + function skipExportSpecifierSymbol(symbol, checker) { + if (symbol.declarations) + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + if (ts.isExportSpecifier(declaration) && !declaration.propertyName && !declaration.parent.parent.moduleSpecifier) { + return checker.getExportSpecifierLocalTargetSymbol(declaration); + } + } + return symbol; + } + function getContainingModuleSymbol(importer, checker) { + return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); + } + function getSourceFileLikeForImportDeclaration(node) { + if (node.kind === 180) { + return node.getSourceFile(); + } + var parent = node.parent; + if (parent.kind === 264) { + return parent; + } + ts.Debug.assert(parent.kind === 233 && isAmbientModuleDeclaration(parent.parent)); + return parent.parent; + } + function isAmbientModuleDeclaration(node) { + return node.kind === 232 && node.name.kind === 9; + } + function isExternalModuleImportEquals(_a) { + var moduleReference = _a.moduleReference; + return moduleReference.kind === 247 && moduleReference.expression.kind === 9; + } + })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var FindAllReferences; + (function (FindAllReferences) { + function nodeEntry(node, isInString) { + return { type: "node", node: node, isInString: isInString }; + } + FindAllReferences.nodeEntry = nodeEntry; + function findReferencedSymbols(checker, cancellationToken, sourceFiles, sourceFile, position) { + var referencedSymbols = findAllReferencedSymbols(checker, cancellationToken, sourceFiles, sourceFile, position); + if (!referencedSymbols || !referencedSymbols.length) { return undefined; } - switch (node.kind) { - case 8: - if (!ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) { - break; - } - case 70: - case 98: - case 122: - case 9: - return getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFiles, findInStrings, findInComments, false); + var out = []; + for (var _i = 0, referencedSymbols_1 = referencedSymbols; _i < referencedSymbols_1.length; _i++) { + var _a = referencedSymbols_1[_i], definition = _a.definition, references = _a.references; + if (definition) { + out.push({ definition: definitionToReferencedSymbolDefinitionInfo(definition, checker), references: references.map(toReferenceEntry) }); + } } - return undefined; + return out; } FindAllReferences.findReferencedSymbols = findReferencedSymbols; - function getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFiles, findInStrings, findInComments, implementations) { - if (!implementations) { + function getImplementationsAtPosition(checker, cancellationToken, sourceFiles, sourceFile, position) { + var node = ts.getTouchingPropertyName(sourceFile, position); + var referenceEntries = getImplementationReferenceEntries(checker, cancellationToken, sourceFiles, node); + return ts.map(referenceEntries, function (entry) { return toImplementationLocation(entry, checker); }); + } + FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; + function getImplementationReferenceEntries(typeChecker, cancellationToken, sourceFiles, node) { + if (node.parent.kind === 261) { + var result_4 = []; + FindAllReferences.Core.getReferenceEntriesForShorthandPropertyAssignment(node, typeChecker, function (node) { return result_4.push(nodeEntry(node)); }); + return result_4; + } + else if (node.kind === 96 || ts.isSuperProperty(node.parent)) { + var symbol = typeChecker.getSymbolAtLocation(node); + return symbol.valueDeclaration && [nodeEntry(symbol.valueDeclaration)]; + } + else { + return getReferenceEntriesForNode(node, sourceFiles, typeChecker, cancellationToken, { implementations: true }); + } + } + function findReferencedEntries(checker, cancellationToken, sourceFiles, sourceFile, position, options) { + var x = flattenEntries(findAllReferencedSymbols(checker, cancellationToken, sourceFiles, sourceFile, position, options)); + return ts.map(x, toReferenceEntry); + } + FindAllReferences.findReferencedEntries = findReferencedEntries; + function getReferenceEntriesForNode(node, sourceFiles, checker, cancellationToken, options) { + if (options === void 0) { options = {}; } + return flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(node, sourceFiles, checker, cancellationToken, options)); + } + FindAllReferences.getReferenceEntriesForNode = getReferenceEntriesForNode; + function findAllReferencedSymbols(checker, cancellationToken, sourceFiles, sourceFile, position, options) { + var node = ts.getTouchingPropertyName(sourceFile, position, true); + return FindAllReferences.Core.getReferencedSymbolsForNode(node, sourceFiles, checker, cancellationToken, options); + } + function flattenEntries(referenceSymbols) { + return referenceSymbols && ts.flatMap(referenceSymbols, function (r) { return r.references; }); + } + function definitionToReferencedSymbolDefinitionInfo(def, checker) { + var info = (function () { + switch (def.type) { + case "symbol": { + var symbol = def.symbol, node_2 = def.node; + var declarations = symbol.declarations; + if (!declarations || declarations.length === 0) { + return undefined; + } + var _a = getDefinitionKindAndDisplayParts(symbol, node_2, checker), displayParts_1 = _a.displayParts, kind_1 = _a.kind; + var name_3 = displayParts_1.map(function (p) { return p.text; }).join(""); + return { node: node_2, name: name_3, kind: kind_1, displayParts: displayParts_1 }; + } + case "label": { + var node_3 = def.node; + return { node: node_3, name: node_3.text, kind: ts.ScriptElementKind.label, displayParts: [ts.displayPart(node_3.text, ts.SymbolDisplayPartKind.text)] }; + } + case "keyword": { + var node_4 = def.node; + var name_4 = ts.tokenToString(node_4.kind); + return { node: node_4, name: name_4, kind: ts.ScriptElementKind.keyword, displayParts: [{ text: name_4, kind: ts.ScriptElementKind.keyword }] }; + } + case "this": { + var node_5 = def.node; + var symbol = checker.getSymbolAtLocation(node_5); + var displayParts_2 = symbol && ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, node_5.getSourceFile(), ts.getContainerNode(node_5), node_5).displayParts; + return { node: node_5, name: "this", kind: ts.ScriptElementKind.variableElement, displayParts: displayParts_2 }; + } + case "string": { + var node_6 = def.node; + return { node: node_6, name: node_6.text, kind: ts.ScriptElementKind.variableElement, displayParts: [ts.displayPart(ts.getTextOfNode(node_6), ts.SymbolDisplayPartKind.stringLiteral)] }; + } + } + })(); + if (!info) { + return undefined; + } + var node = info.node, name = info.name, kind = info.kind, displayParts = info.displayParts; + var sourceFile = node.getSourceFile(); + return { + containerKind: "", + containerName: "", + fileName: sourceFile.fileName, + kind: kind, + name: name, + textSpan: ts.createTextSpanFromNode(node, sourceFile), + displayParts: displayParts + }; + } + function getDefinitionKindAndDisplayParts(symbol, node, checker) { + var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, node.getSourceFile(), ts.getContainerNode(node), node), displayParts = _a.displayParts, symbolKind = _a.symbolKind; + return { displayParts: displayParts, kind: symbolKind }; + } + function toReferenceEntry(entry) { + if (entry.type === "span") { + return { textSpan: entry.textSpan, fileName: entry.fileName, isWriteAccess: false, isDefinition: false }; + } + var node = entry.node, isInString = entry.isInString; + return { + fileName: node.getSourceFile().fileName, + textSpan: getTextSpan(node), + isWriteAccess: isWriteAccess(node), + isDefinition: ts.isDeclarationName(node) || ts.isLiteralComputedPropertyDeclarationName(node), + isInString: isInString + }; + } + function toImplementationLocation(entry, checker) { + if (entry.type === "node") { + var node = entry.node; + return __assign({ textSpan: getTextSpan(node), fileName: node.getSourceFile().fileName }, implementationKindDisplayParts(node, checker)); + } + else { + var textSpan = entry.textSpan, fileName = entry.fileName; + return { textSpan: textSpan, fileName: fileName, kind: ts.ScriptElementKind.unknown, displayParts: [] }; + } + } + function implementationKindDisplayParts(node, checker) { + var symbol = checker.getSymbolAtLocation(ts.isDeclaration(node) && node.name ? node.name : node); + if (symbol) { + return getDefinitionKindAndDisplayParts(symbol, node, checker); + } + else if (node.kind === 177) { + return { + kind: ts.ScriptElementKind.interfaceElement, + displayParts: [ts.punctuationPart(18), ts.textPart("object literal"), ts.punctuationPart(19)] + }; + } + else if (node.kind === 198) { + return { + kind: ts.ScriptElementKind.localClassElement, + displayParts: [ts.punctuationPart(18), ts.textPart("anonymous local class"), ts.punctuationPart(19)] + }; + } + else { + return { kind: ts.getNodeKind(node), displayParts: [] }; + } + } + function toHighlightSpan(entry) { + if (entry.type === "span") { + var fileName_1 = entry.fileName, textSpan = entry.textSpan; + return { fileName: fileName_1, span: { textSpan: textSpan, kind: ts.HighlightSpanKind.reference } }; + } + var node = entry.node, isInString = entry.isInString; + var fileName = entry.node.getSourceFile().fileName; + var writeAccess = isWriteAccess(node); + var span = { + textSpan: getTextSpan(node), + kind: writeAccess ? ts.HighlightSpanKind.writtenReference : ts.HighlightSpanKind.reference, + isInString: isInString + }; + return { fileName: fileName, span: span }; + } + FindAllReferences.toHighlightSpan = toHighlightSpan; + function getTextSpan(node) { + var start = node.getStart(); + var end = node.getEnd(); + if (node.kind === 9) { + start += 1; + end -= 1; + } + return ts.createTextSpanFromBounds(start, end); + } + function isWriteAccess(node) { + if (node.kind === 70 && ts.isDeclarationName(node)) { + return true; + } + var parent = node.parent; + if (parent) { + if (parent.kind === 192 || parent.kind === 191) { + return true; + } + else if (parent.kind === 193 && parent.left === node) { + var operator = parent.operatorToken.kind; + return 57 <= operator && operator <= 69; + } + } + return false; + } + })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); +})(ts || (ts = {})); +(function (ts) { + var FindAllReferences; + (function (FindAllReferences) { + var Core; + (function (Core) { + function getReferencedSymbolsForNode(node, sourceFiles, checker, cancellationToken, options) { + if (options === void 0) { options = {}; } + if (node.kind === 264) { + return undefined; + } + if (!options.implementations) { + var special = getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken); + if (special) { + return special; + } + } + var symbol = checker.getSymbolAtLocation(node); + if (!symbol) { + if (!options.implementations && node.kind === 9) { + return getReferencesForStringLiteral(node, sourceFiles, cancellationToken); + } + return undefined; + } + if (!symbol.declarations || !symbol.declarations.length) { + return undefined; + } + return getReferencedSymbolsForSymbol(symbol, node, sourceFiles, checker, cancellationToken, options); + } + Core.getReferencedSymbolsForNode = getReferencedSymbolsForNode; + function getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken) { + if (ts.isTypeKeyword(node.kind)) { + return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken); + } if (ts.isLabelName(node)) { if (ts.isJumpStatementTarget(node)) { var labelDefinition = ts.getTargetLabel(node.parent, node.text); - return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : undefined; + return labelDefinition && getLabelReferencesInNode(labelDefinition.parent, labelDefinition); } else { return getLabelReferencesInNode(node.parent, node); } } if (ts.isThis(node)) { - return getReferencesForThisKeyword(node, sourceFiles); + return getReferencesForThisKeyword(node, sourceFiles, cancellationToken); } if (node.kind === 96) { return getReferencesForSuperKeyword(node); } - } - var symbol = typeChecker.getSymbolAtLocation(node); - if (!implementations && !symbol && node.kind === 9) { - return getReferencesForStringLiteral(node, sourceFiles); - } - if (!symbol) { return undefined; } - var declarations = symbol.declarations; - if (!declarations || !declarations.length) { - return undefined; + function getReferencedSymbolsForSymbol(symbol, node, sourceFiles, checker, cancellationToken, options) { + symbol = skipPastExportOrImportSpecifier(symbol, node, checker); + var searchMeaning = getIntersectingMeaningFromDeclarations(ts.getMeaningFromLocation(node), symbol.declarations); + var result = []; + var state = createState(sourceFiles, node, checker, cancellationToken, searchMeaning, options, result); + var search = state.createSearch(node, symbol, undefined, { allSearchSymbols: populateSearchSymbolSet(symbol, node, checker, options.implementations) }); + var scope = getSymbolScope(symbol); + if (scope) { + getReferencesInContainer(scope, scope.getSourceFile(), search, state); + } + else { + for (var _i = 0, _a = state.sourceFiles; _i < _a.length; _i++) { + var sourceFile = _a[_i]; + state.cancellationToken.throwIfCancellationRequested(); + searchForName(sourceFile, search, state); + } + } + return result; } - var result; - var searchMeaning = getIntersectingMeaningFromDeclarations(ts.getMeaningFromLocation(node), declarations); - var declaredName = ts.stripQuotes(ts.getDeclaredName(typeChecker, symbol, node)); - var scope = getSymbolScope(symbol); - var symbolToIndex = []; - if (scope) { - result = []; - getReferencesInNode(scope, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); + function skipPastExportOrImportSpecifier(symbol, node, checker) { + var parent = node.parent; + if (ts.isExportSpecifier(parent)) { + return getLocalSymbolForExportSpecifier(node, symbol, parent, checker); + } + if (ts.isImportSpecifier(parent) && parent.propertyName === node) { + return checker.getImmediateAliasedSymbol(symbol); + } + return symbol; } - else { - var internedName = getInternedName(symbol, node); - for (var _i = 0, sourceFiles_8 = sourceFiles; _i < sourceFiles_8.length; _i++) { - var sourceFile = sourceFiles_8[_i]; - cancellationToken.throwIfCancellationRequested(); - var nameTable = ts.getNameTable(sourceFile); - if (nameTable[internedName] !== undefined) { - result = result || []; - getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); + function createState(sourceFiles, originalLocation, checker, cancellationToken, searchMeaning, options, result) { + var symbolIdToReferences = []; + var inheritsFromCache = ts.createMap(); + var sourceFileToSeenSymbols = []; + var isForConstructor = originalLocation.kind === 122; + var importTracker; + return __assign({}, options, { sourceFiles: sourceFiles, isForConstructor: isForConstructor, checker: checker, cancellationToken: cancellationToken, searchMeaning: searchMeaning, inheritsFromCache: inheritsFromCache, getImportSearches: getImportSearches, createSearch: createSearch, referenceAdder: referenceAdder, addStringOrCommentReference: addStringOrCommentReference, + markSearchedSymbol: markSearchedSymbol, markSeenContainingTypeReference: ts.nodeSeenTracker(), markSeenReExportRHS: ts.nodeSeenTracker() }); + function getImportSearches(exportSymbol, exportInfo) { + if (!importTracker) + importTracker = FindAllReferences.createImportTracker(sourceFiles, checker, cancellationToken); + return importTracker(exportSymbol, exportInfo, options.isForRename); + } + function createSearch(location, symbol, comingFrom, searchOptions) { + if (searchOptions === void 0) { searchOptions = {}; } + var _a = searchOptions.text, text = _a === void 0 ? ts.stripQuotes(ts.getDeclaredName(checker, symbol, location)) : _a, _b = searchOptions.allSearchSymbols, allSearchSymbols = _b === void 0 ? undefined : _b; + var escapedText = ts.escapeIdentifier(text); + var parents = options.implementations && getParentSymbolsOfPropertyAccess(location, symbol, checker); + return { location: location, symbol: symbol, comingFrom: comingFrom, text: text, escapedText: escapedText, parents: parents, includes: includes }; + function includes(referenceSymbol) { + return allSearchSymbols ? ts.contains(allSearchSymbols, referenceSymbol) : referenceSymbol === symbol; + } + } + function referenceAdder(referenceSymbol, searchLocation) { + var symbolId = ts.getSymbolId(referenceSymbol); + var references = symbolIdToReferences[symbolId]; + if (!references) { + references = symbolIdToReferences[symbolId] = []; + result.push({ definition: { type: "symbol", symbol: referenceSymbol, node: searchLocation }, references: references }); + } + return function (node) { return references.push(FindAllReferences.nodeEntry(node)); }; + } + function addStringOrCommentReference(fileName, textSpan) { + result.push({ + definition: undefined, + references: [{ type: "span", fileName: fileName, textSpan: textSpan }] + }); + } + function markSearchedSymbol(sourceFile, symbol) { + var sourceId = ts.getNodeId(sourceFile); + var symbolId = ts.getSymbolId(symbol); + var seenSymbols = sourceFileToSeenSymbols[sourceId] || (sourceFileToSeenSymbols[sourceId] = []); + return !seenSymbols[symbolId] && (seenSymbols[symbolId] = true); + } + } + function searchForImportsOfExport(exportLocation, exportSymbol, exportInfo, state) { + var _a = state.getImportSearches(exportSymbol, exportInfo), importSearches = _a.importSearches, singleReferences = _a.singleReferences, indirectUsers = _a.indirectUsers; + if (singleReferences.length) { + var addRef = state.referenceAdder(exportSymbol, exportLocation); + for (var _i = 0, singleReferences_1 = singleReferences; _i < singleReferences_1.length; _i++) { + var singleRef = singleReferences_1[_i]; + addRef(singleRef); + } + } + for (var _b = 0, importSearches_1 = importSearches; _b < importSearches_1.length; _b++) { + var _c = importSearches_1[_b], importLocation = _c[0], importSymbol = _c[1]; + getReferencesInSourceFile(importLocation.getSourceFile(), state.createSearch(importLocation, importSymbol, 1), state); + } + if (indirectUsers.length) { + var indirectSearch = void 0; + switch (exportInfo.exportKind) { + case 0: + indirectSearch = state.createSearch(exportLocation, exportSymbol, 1); + break; + case 1: + indirectSearch = state.isForRename ? undefined : state.createSearch(exportLocation, exportSymbol, 1, { text: "default" }); + break; + case 2: + break; + } + if (indirectSearch) { + for (var _d = 0, indirectUsers_1 = indirectUsers; _d < indirectUsers_1.length; _d++) { + var indirectUser = indirectUsers_1[_d]; + searchForName(indirectUser, indirectSearch, state); + } } } } - return result; - function getDefinition(symbol) { - var info = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, node.getSourceFile(), ts.getContainerNode(node), node); - var name = ts.map(info.displayParts, function (p) { return p.text; }).join(""); - var declarations = symbol.declarations; - if (!declarations || declarations.length === 0) { - return undefined; + function searchForImportedSymbol(symbol, state) { + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + getReferencesInSourceFile(declaration.getSourceFile(), state.createSearch(declaration, symbol, 0), state); } - return { - containerKind: "", - containerName: "", - name: name, - kind: info.symbolKind, - fileName: declarations[0].getSourceFile().fileName, - textSpan: ts.createTextSpan(declarations[0].getStart(), 0), - displayParts: info.displayParts - }; } - function getAliasSymbolForPropertyNameSymbol(symbol, location) { - if (symbol.flags & 8388608) { - var defaultImport = ts.getDeclarationOfKind(symbol, 236); - if (defaultImport) { - return typeChecker.getAliasedSymbol(symbol); - } - var importOrExportSpecifier = ts.forEach(symbol.declarations, function (declaration) { return (declaration.kind === 239 || - declaration.kind === 243) ? declaration : undefined; }); - if (importOrExportSpecifier && - (!importOrExportSpecifier.propertyName || - importOrExportSpecifier.propertyName === location)) { - return importOrExportSpecifier.kind === 239 ? - typeChecker.getAliasedSymbol(symbol) : - typeChecker.getExportSpecifierLocalTargetSymbol(importOrExportSpecifier); - } + function searchForName(sourceFile, search, state) { + if (ts.getNameTable(sourceFile).get(search.escapedText) !== undefined) { + getReferencesInSourceFile(sourceFile, search, state); } - return undefined; } - function followAliasIfNecessary(symbol, location) { - return getAliasSymbolForPropertyNameSymbol(symbol, location) || symbol; - } - function getPropertySymbolOfDestructuringAssignment(location) { + function getPropertySymbolOfDestructuringAssignment(location, checker) { return ts.isArrayLiteralOrObjectLiteralDestructuringPattern(location.parent.parent) && - typeChecker.getPropertySymbolOfDestructuringAssignment(location); + checker.getPropertySymbolOfDestructuringAssignment(location); } function isObjectBindingPatternElementWithoutPropertyName(symbol) { - var bindingElement = ts.getDeclarationOfKind(symbol, 174); + var bindingElement = ts.getDeclarationOfKind(symbol, 175); return bindingElement && - bindingElement.parent.kind === 172 && + bindingElement.parent.kind === 173 && !bindingElement.propertyName; } - function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol) { + function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker) { if (isObjectBindingPatternElementWithoutPropertyName(symbol)) { - var bindingElement = ts.getDeclarationOfKind(symbol, 174); - var typeOfPattern = typeChecker.getTypeAtLocation(bindingElement.parent); - return typeOfPattern && typeChecker.getPropertyOfType(typeOfPattern, bindingElement.name.text); + var bindingElement = ts.getDeclarationOfKind(symbol, 175); + var typeOfPattern = checker.getTypeAtLocation(bindingElement.parent); + return typeOfPattern && checker.getPropertyOfType(typeOfPattern, bindingElement.name.text); } return undefined; } - function getInternedName(symbol, location) { - if (ts.isImportOrExportSpecifierName(location)) { - return location.getText(); - } - var localExportDefaultSymbol = ts.getLocalSymbolForExportDefault(symbol); - symbol = localExportDefaultSymbol || symbol; - return ts.stripQuotes(symbol.name); - } function getSymbolScope(symbol) { - var valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 184 || valueDeclaration.kind === 197)) { + var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; + if (valueDeclaration && (valueDeclaration.kind === 185 || valueDeclaration.kind === 198)) { return valueDeclaration; } - if (symbol.flags & (4 | 8192)) { - var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (ts.getModifierFlags(d) & 8) ? d : undefined; }); - if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 226); - } - } - if (symbol.flags & 8388608) { + if (!declarations) { return undefined; } + if (flags & (4 | 8192)) { + var privateDeclaration = ts.find(declarations, function (d) { return !!(ts.getModifierFlags(d) & 8); }); + if (privateDeclaration) { + return ts.getAncestor(privateDeclaration, 228); + } + } if (isObjectBindingPatternElementWithoutPropertyName(symbol)) { return undefined; } - if (symbol.parent || (symbol.flags & 268435456)) { + if (parent && !((parent.flags & 1536) && ts.isExternalModuleSymbol(parent) && !parent.globalExports)) { + return undefined; + } + if ((flags & 134217728 && symbol.checkFlags & 6)) { return undefined; } var scope; - var declarations = symbol.getDeclarations(); - if (declarations) { - for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { - var declaration = declarations_7[_i]; - var container = ts.getContainerNode(declaration); - if (!container) { - return undefined; - } - if (scope && scope !== container) { - return undefined; - } - if (container.kind === 261 && !ts.isExternalModule(container)) { - return undefined; - } - scope = container; + for (var _i = 0, declarations_10 = declarations; _i < declarations_10.length; _i++) { + var declaration = declarations_10[_i]; + var container = ts.getContainerNode(declaration); + if (scope && scope !== container) { + return undefined; } + if (!container || container.kind === 264 && !ts.isExternalOrCommonJsModule(container)) { + return undefined; + } + scope = container; } - return scope; + return parent ? scope.getSourceFile() : scope; } function getPossibleSymbolReferencePositions(sourceFile, symbolName, start, end) { var positions = []; @@ -56390,7 +62546,6 @@ var ts; var symbolNameLength = symbolName.length; var position = text.indexOf(symbolName, start); while (position >= 0) { - cancellationToken.throwIfCancellationRequested(); if (position > end) break; var endPosition = position + symbolNameLength; @@ -56407,242 +62562,277 @@ var ts; var sourceFile = container.getSourceFile(); var labelName = targetLabel.text; var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, labelName, container.getStart(), container.getEnd()); - ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); + for (var _i = 0, possiblePositions_1 = possiblePositions; _i < possiblePositions_1.length; _i++) { + var position = possiblePositions_1[_i]; var node = ts.getTouchingWord(sourceFile, position); if (!node || node.getWidth() !== labelName.length) { - return; + continue; } if (node === targetLabel || (ts.isJumpStatementTarget(node) && ts.getTargetLabel(node, labelName) === targetLabel)) { - references.push(getReferenceEntryFromNode(node)); + references.push(FindAllReferences.nodeEntry(node)); } - }); - var definition = { - containerKind: "", - containerName: "", - fileName: targetLabel.getSourceFile().fileName, - kind: ts.ScriptElementKind.label, - name: labelName, - textSpan: ts.createTextSpanFromBounds(targetLabel.getStart(), targetLabel.getEnd()), - displayParts: [ts.displayPart(labelName, ts.SymbolDisplayPartKind.text)] - }; - return [{ definition: definition, references: references }]; + } + return [{ definition: { type: "label", node: targetLabel }, references: references }]; } function isValidReferencePosition(node, searchSymbolName) { - if (node) { - switch (node.kind) { - case 70: - return node.getWidth() === searchSymbolName.length; - case 9: - if (ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || - isNameOfExternalModuleImportOrDeclaration(node)) { - return node.getWidth() === searchSymbolName.length + 2; - } - break; - case 8: - if (ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) { - return node.getWidth() === searchSymbolName.length; - } - break; - } + switch (node && node.kind) { + case 70: + return node.getWidth() === searchSymbolName.length; + case 9: + return (ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) && + node.getWidth() === searchSymbolName.length + 2; + case 8: + return ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && node.getWidth() === searchSymbolName.length; + default: + return false; } - return false; } - function getReferencesInNode(container, searchSymbol, searchText, searchLocation, searchMeaning, findInStrings, findInComments, result, symbolToIndex) { - var sourceFile = container.getSourceFile(); - var start = findInComments ? container.getFullStart() : container.getStart(); - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, searchText, start, container.getEnd()); - var parents = getParentSymbolsOfPropertyAccess(); - var inheritsFromCache = ts.createMap(); - if (possiblePositions.length) { - var searchSymbols_1 = populateSearchSymbolSet(searchSymbol, searchLocation); - ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); - var referenceLocation = ts.getTouchingPropertyName(sourceFile, position); - if (!isValidReferencePosition(referenceLocation, searchText)) { - if (!implementations && ((findInStrings && ts.isInString(sourceFile, position)) || - (findInComments && ts.isInNonReferenceComment(sourceFile, position)))) { - result.push({ - definition: undefined, - references: [{ - fileName: sourceFile.fileName, - textSpan: ts.createTextSpan(position, searchText.length), - isWriteAccess: false, - isDefinition: false - }] - }); - } - return; - } - if (!(ts.getMeaningFromLocation(referenceLocation) & searchMeaning)) { - return; - } - var referenceSymbol = typeChecker.getSymbolAtLocation(referenceLocation); - if (referenceSymbol) { - var referenceSymbolDeclaration = referenceSymbol.valueDeclaration; - var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration); - var relatedSymbol = getRelatedSymbol(searchSymbols_1, referenceSymbol, referenceLocation, searchLocation.kind === 122, parents, inheritsFromCache); - if (relatedSymbol) { - addReferenceToRelatedSymbol(referenceLocation, relatedSymbol); - } - else if (!(referenceSymbol.flags & 67108864) && searchSymbols_1.indexOf(shorthandValueSymbol) >= 0) { - addReferenceToRelatedSymbol(referenceSymbolDeclaration.name, shorthandValueSymbol); - } - else if (searchLocation.kind === 122) { - findAdditionalConstructorReferences(referenceSymbol, referenceLocation); - } - } - }); + function getAllReferencesForKeyword(sourceFiles, keywordKind, cancellationToken) { + var references = []; + for (var _i = 0, sourceFiles_5 = sourceFiles; _i < sourceFiles_5.length; _i++) { + var sourceFile = sourceFiles_5[_i]; + cancellationToken.throwIfCancellationRequested(); + addReferencesForKeywordInFile(sourceFile, keywordKind, ts.tokenToString(keywordKind), references); } - return; - function getParentSymbolsOfPropertyAccess() { - if (implementations) { - var propertyAccessExpression = getPropertyAccessExpressionFromRightHandSide(searchLocation); - if (propertyAccessExpression) { - var localParentType = typeChecker.getTypeAtLocation(propertyAccessExpression.expression); - if (localParentType) { - if (localParentType.symbol && localParentType.symbol.flags & (32 | 64) && localParentType.symbol !== searchSymbol.parent) { - return [localParentType.symbol]; - } - else if (localParentType.flags & 196608) { - return getSymbolsForClassAndInterfaceComponents(localParentType); - } - } - } + return references.length ? [{ definition: { type: "keyword", node: references[0].node }, references: references }] : undefined; + } + function addReferencesForKeywordInFile(sourceFile, kind, searchText, references) { + var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, searchText, sourceFile.getStart(), sourceFile.getEnd()); + for (var _i = 0, possiblePositions_2 = possiblePositions; _i < possiblePositions_2.length; _i++) { + var position = possiblePositions_2[_i]; + var referenceLocation = ts.getTouchingPropertyName(sourceFile, position); + if (referenceLocation.kind === kind) { + references.push(FindAllReferences.nodeEntry(referenceLocation)); } } - function getPropertyAccessExpressionFromRightHandSide(node) { - return ts.isRightSideOfPropertyAccess(node) && node.parent; + } + function getReferencesInSourceFile(sourceFile, search, state) { + state.cancellationToken.throwIfCancellationRequested(); + return getReferencesInContainer(sourceFile, sourceFile, search, state); + } + function getReferencesInContainer(container, sourceFile, search, state) { + if (!state.markSearchedSymbol(sourceFile, search.symbol)) { + return; } - function findAdditionalConstructorReferences(referenceSymbol, referenceLocation) { - ts.Debug.assert(ts.isClassLike(searchSymbol.valueDeclaration)); - var referenceClass = referenceLocation.parent; - if (referenceSymbol === searchSymbol && ts.isClassLike(referenceClass)) { - ts.Debug.assert(referenceClass.name === referenceLocation); - addReferences(findOwnConstructorCalls(searchSymbol)); + var start = state.findInComments ? container.getFullStart() : container.getStart(); + var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, search.text, start, container.getEnd()); + for (var _i = 0, possiblePositions_3 = possiblePositions; _i < possiblePositions_3.length; _i++) { + var position = possiblePositions_3[_i]; + getReferencesAtLocation(sourceFile, position, search, state); + } + } + function getReferencesAtLocation(sourceFile, position, search, state) { + var referenceLocation = ts.getTouchingPropertyName(sourceFile, position); + if (!isValidReferencePosition(referenceLocation, search.text)) { + if (!state.implementations && (state.findInStrings && ts.isInString(sourceFile, position) || state.findInComments && ts.isInNonReferenceComment(sourceFile, position))) { + state.addStringOrCommentReference(sourceFile.fileName, ts.createTextSpan(position, search.text.length)); } - else { - var classExtending = tryGetClassByExtendingIdentifier(referenceLocation); - if (classExtending && ts.isClassLike(classExtending) && followAliasIfNecessary(referenceSymbol, referenceLocation) === searchSymbol) { - addReferences(superConstructorAccesses(classExtending)); - } + return; + } + if (!(ts.getMeaningFromLocation(referenceLocation) & state.searchMeaning)) { + return; + } + var referenceSymbol = state.checker.getSymbolAtLocation(referenceLocation); + if (!referenceSymbol) { + return; + } + var parent = referenceLocation.parent; + if (ts.isImportSpecifier(parent) && parent.propertyName === referenceLocation) { + return; + } + if (ts.isExportSpecifier(parent)) { + ts.Debug.assert(referenceLocation.kind === 70); + getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, parent, search, state); + return; + } + var relatedSymbol = getRelatedSymbol(search, referenceSymbol, referenceLocation, state); + if (!relatedSymbol) { + getReferenceForShorthandProperty(referenceSymbol, search, state); + return; + } + if (state.isForConstructor) { + findConstructorReferences(referenceLocation, sourceFile, search, state); + } + else { + addReference(referenceLocation, relatedSymbol, search.location, state); + } + getImportOrExportReferences(referenceLocation, referenceSymbol, search, state); + } + function getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, search, state) { + var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name; + var exportDeclaration = parent.parent; + var localSymbol = getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, state.checker); + if (!search.includes(localSymbol)) { + return; + } + if (!propertyName) { + addRef(); + } + else if (referenceLocation === propertyName) { + if (!exportDeclaration.moduleSpecifier) { + addRef(); + } + if (!state.isForRename && state.markSeenReExportRHS(name)) { + addReference(name, referenceSymbol, name, state); } } - function addReferences(references) { - if (references.length) { - var referencedSymbol = getReferencedSymbol(searchSymbol); - ts.addRange(referencedSymbol.references, ts.map(references, getReferenceEntryFromNode)); + else { + if (state.markSeenReExportRHS(referenceLocation)) { + addRef(); } } - function findOwnConstructorCalls(classSymbol) { - var result = []; - for (var _i = 0, _a = classSymbol.members["__constructor"].declarations; _i < _a.length; _i++) { - var decl = _a[_i]; - ts.Debug.assert(decl.kind === 150); - var ctrKeyword = decl.getChildAt(0); - ts.Debug.assert(ctrKeyword.kind === 122); - result.push(ctrKeyword); - } - ts.forEachProperty(classSymbol.exports, function (member) { - var decl = member.valueDeclaration; - if (decl && decl.kind === 149) { - var body = decl.body; - if (body) { - forEachDescendantOfKind(body, 98, function (thisKeyword) { - if (ts.isNewExpressionTarget(thisKeyword)) { - result.push(thisKeyword); - } - }); - } - } - }); - return result; + if (!(referenceLocation === propertyName && state.isForRename)) { + var exportKind = referenceLocation.originalKeywordKind === 78 ? 1 : 0; + var exportInfo = FindAllReferences.getExportInfo(referenceSymbol, exportKind, state.checker); + ts.Debug.assert(!!exportInfo); + searchForImportsOfExport(referenceLocation, referenceSymbol, exportInfo, state); } - function superConstructorAccesses(cls) { - var symbol = cls.symbol; - var ctr = symbol.members["__constructor"]; - if (!ctr) { - return []; + if (search.comingFrom !== 1 && exportDeclaration.moduleSpecifier && !propertyName) { + searchForImportedSymbol(state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier), state); + } + function addRef() { + addReference(referenceLocation, localSymbol, search.location, state); + } + } + function getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, checker) { + return isExportSpecifierAlias(referenceLocation, exportSpecifier) ? checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) : referenceSymbol; + } + function isExportSpecifierAlias(referenceLocation, exportSpecifier) { + var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name; + ts.Debug.assert(propertyName === referenceLocation || name === referenceLocation); + if (propertyName) { + return propertyName === referenceLocation; + } + else { + return !parent.parent.moduleSpecifier; + } + } + function getImportOrExportReferences(referenceLocation, referenceSymbol, search, state) { + var importOrExport = FindAllReferences.getImportOrExportSymbol(referenceLocation, referenceSymbol, state.checker, search.comingFrom === 1); + if (!importOrExport) + return; + var symbol = importOrExport.symbol; + if (importOrExport.kind === 0) { + if (!state.isForRename || importOrExport.isNamedImport) { + searchForImportedSymbol(symbol, state); } - var result = []; - for (var _i = 0, _a = ctr.declarations; _i < _a.length; _i++) { - var decl = _a[_i]; - ts.Debug.assert(decl.kind === 150); + } + else { + searchForImportsOfExport(referenceLocation, symbol, importOrExport.exportInfo, state); + } + } + function getReferenceForShorthandProperty(_a, search, state) { + var flags = _a.flags, valueDeclaration = _a.valueDeclaration; + var shorthandValueSymbol = state.checker.getShorthandAssignmentValueSymbol(valueDeclaration); + if (!(flags & 134217728) && search.includes(shorthandValueSymbol)) { + addReference(valueDeclaration.name, shorthandValueSymbol, search.location, state); + } + } + function addReference(referenceLocation, relatedSymbol, searchLocation, state) { + var addRef = state.referenceAdder(relatedSymbol, searchLocation); + if (state.implementations) { + addImplementationReferences(referenceLocation, addRef, state); + } + else { + addRef(referenceLocation); + } + } + function findConstructorReferences(referenceLocation, sourceFile, search, state) { + if (ts.isNewExpressionTarget(referenceLocation)) { + addReference(referenceLocation, search.symbol, search.location, state); + } + var pusher = state.referenceAdder(search.symbol, search.location); + if (ts.isClassLike(referenceLocation.parent)) { + ts.Debug.assert(referenceLocation.parent.name === referenceLocation); + findOwnConstructorReferences(search.symbol, sourceFile, pusher); + } + else { + var classExtending = tryGetClassByExtendingIdentifier(referenceLocation); + if (classExtending && ts.isClassLike(classExtending)) { + findSuperConstructorAccesses(classExtending, pusher); + } + } + } + function getPropertyAccessExpressionFromRightHandSide(node) { + return ts.isRightSideOfPropertyAccess(node) && node.parent; + } + function findOwnConstructorReferences(classSymbol, sourceFile, addNode) { + for (var _i = 0, _a = classSymbol.members.get("__constructor").declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + var ctrKeyword = ts.findChildOfKind(decl, 122, sourceFile); + ts.Debug.assert(decl.kind === 151 && !!ctrKeyword); + addNode(ctrKeyword); + } + classSymbol.exports.forEach(function (member) { + var decl = member.valueDeclaration; + if (decl && decl.kind === 150) { var body = decl.body; if (body) { - forEachDescendantOfKind(body, 96, function (node) { - if (ts.isCallExpressionTarget(node)) { - result.push(node); + forEachDescendantOfKind(body, 98, function (thisKeyword) { + if (ts.isNewExpressionTarget(thisKeyword)) { + addNode(thisKeyword); } }); } } - ; - return result; + }); + } + function findSuperConstructorAccesses(cls, addNode) { + var symbol = cls.symbol; + var ctr = symbol.members.get("__constructor"); + if (!ctr) { + return; } - function getReferencedSymbol(symbol) { - var symbolId = ts.getSymbolId(symbol); - var index = symbolToIndex[symbolId]; - if (index === undefined) { - index = result.length; - symbolToIndex[symbolId] = index; - result.push({ - definition: getDefinition(symbol), - references: [] + for (var _i = 0, _a = ctr.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + ts.Debug.assert(decl.kind === 151); + var body = decl.body; + if (body) { + forEachDescendantOfKind(body, 96, function (node) { + if (ts.isCallExpressionTarget(node)) { + addNode(node); + } }); } - return result[index]; - } - function addReferenceToRelatedSymbol(node, relatedSymbol) { - var references = getReferencedSymbol(relatedSymbol).references; - if (implementations) { - getImplementationReferenceEntryForNode(node, references); - } - else { - references.push(getReferenceEntryFromNode(node)); - } } } - function getImplementationReferenceEntryForNode(refNode, result) { + function addImplementationReferences(refNode, addReference, state) { if (ts.isDeclarationName(refNode) && isImplementation(refNode.parent)) { - result.push(getReferenceEntryFromNode(refNode.parent)); + addReference(refNode.parent); + return; } - else if (refNode.kind === 70) { - if (refNode.parent.kind === 258) { - getReferenceEntriesForShorthandPropertyAssignment(refNode, typeChecker, result); - } - var containingClass = getContainingClassIfInHeritageClause(refNode); - if (containingClass) { - result.push(getReferenceEntryFromNode(containingClass)); - return; - } - var containingTypeReference = getContainingTypeReference(refNode); - if (containingTypeReference) { - var parent_18 = containingTypeReference.parent; - if (ts.isVariableLike(parent_18) && parent_18.type === containingTypeReference && parent_18.initializer && isImplementationExpression(parent_18.initializer)) { - maybeAdd(getReferenceEntryFromNode(parent_18.initializer)); - } - else if (ts.isFunctionLike(parent_18) && parent_18.type === containingTypeReference && parent_18.body) { - if (parent_18.body.kind === 204) { - ts.forEachReturnStatement(parent_18.body, function (returnStatement) { - if (returnStatement.expression && isImplementationExpression(returnStatement.expression)) { - maybeAdd(getReferenceEntryFromNode(returnStatement.expression)); - } - }); - } - else if (isImplementationExpression(parent_18.body)) { - maybeAdd(getReferenceEntryFromNode(parent_18.body)); - } - } - else if (ts.isAssertionExpression(parent_18) && isImplementationExpression(parent_18.expression)) { - maybeAdd(getReferenceEntryFromNode(parent_18.expression)); - } - } + if (refNode.kind !== 70) { + return; } - function maybeAdd(a) { - if (!ts.forEach(result, function (b) { return a.fileName === b.fileName && a.textSpan.start === b.textSpan.start && a.textSpan.length === b.textSpan.length; })) { - result.push(a); + if (refNode.parent.kind === 261) { + getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); + } + var containingClass = getContainingClassIfInHeritageClause(refNode); + if (containingClass) { + addReference(containingClass); + return; + } + var containingTypeReference = getContainingTypeReference(refNode); + if (containingTypeReference && state.markSeenContainingTypeReference(containingTypeReference)) { + var parent = containingTypeReference.parent; + if (ts.isVariableLike(parent) && parent.type === containingTypeReference && parent.initializer && isImplementationExpression(parent.initializer)) { + addReference(parent.initializer); + } + else if (ts.isFunctionLike(parent) && parent.type === containingTypeReference && parent.body) { + if (parent.body.kind === 206) { + ts.forEachReturnStatement(parent.body, function (returnStatement) { + if (returnStatement.expression && isImplementationExpression(returnStatement.expression)) { + addReference(returnStatement.expression); + } + }); + } + else if (isImplementationExpression(parent.body)) { + addReference(parent.body); + } + } + else if (ts.isAssertionExpression(parent) && isImplementationExpression(parent.expression)) { + addReference(parent.expression); } } } @@ -56671,28 +62861,32 @@ var ts; } function getContainingClassIfInHeritageClause(node) { if (node && node.parent) { - if (node.kind === 199 - && node.parent.kind === 255 + if (node.kind === 200 + && node.parent.kind === 258 && ts.isClassLike(node.parent.parent)) { return node.parent.parent; } - else if (node.kind === 70 || node.kind === 177) { + else if (node.kind === 70 || node.kind === 178) { return getContainingClassIfInHeritageClause(node.parent); } } return undefined; } function isImplementationExpression(node) { - if (node.kind === 183) { - return isImplementationExpression(node.expression); + switch (node.kind) { + case 184: + return isImplementationExpression(node.expression); + case 186: + case 185: + case 177: + case 198: + case 176: + return true; + default: + return false; } - return node.kind === 185 || - node.kind === 184 || - node.kind === 176 || - node.kind === 197 || - node.kind === 175; } - function explicitlyInheritsFrom(child, parent, cachedResults) { + function explicitlyInheritsFrom(child, parent, cachedResults, checker) { var parentIsInterface = parent.getFlags() & 64; return searchHierarchy(child); function searchHierarchy(symbol) { @@ -56700,10 +62894,11 @@ var ts; return true; } var key = ts.getSymbolId(symbol) + "," + ts.getSymbolId(parent); - if (key in cachedResults) { - return cachedResults[key]; + var cached = cachedResults.get(key); + if (cached !== undefined) { + return cached; } - cachedResults[key] = false; + cachedResults.set(key, false); var inherits = ts.forEach(symbol.getDeclarations(), function (declaration) { if (ts.isClassLike(declaration)) { if (parentIsInterface) { @@ -56719,19 +62914,19 @@ var ts; } return searchTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); } - else if (declaration.kind === 227) { + else if (declaration.kind === 229) { if (parentIsInterface) { return ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), searchTypeReference); } } return false; }); - cachedResults[key] = inherits; + cachedResults.set(key, inherits); return inherits; } function searchTypeReference(typeReference) { if (typeReference) { - var type = typeChecker.getTypeAtLocation(typeReference); + var type = checker.getTypeAtLocation(typeReference); if (type && type.symbol) { return searchHierarchy(type.symbol); } @@ -56746,13 +62941,13 @@ var ts; } var staticFlag = 32; switch (searchSpaceNode.kind) { - case 147: - case 146: - case 149: case 148: + case 147: case 150: + case 149: case 151: case 152: + case 153: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; break; @@ -56762,51 +62957,51 @@ var ts; var references = []; var sourceFile = searchSpaceNode.getSourceFile(); var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); - ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); + for (var _i = 0, possiblePositions_4 = possiblePositions; _i < possiblePositions_4.length; _i++) { + var position = possiblePositions_4[_i]; var node = ts.getTouchingWord(sourceFile, position); if (!node || node.kind !== 96) { - return; + continue; } var container = ts.getSuperContainer(node, false); if (container && (32 & ts.getModifierFlags(container)) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) { - references.push(getReferenceEntryFromNode(node)); + references.push(FindAllReferences.nodeEntry(node)); } - }); - var definition = getDefinition(searchSpaceNode.symbol); - return [{ definition: definition, references: references }]; + } + return [{ definition: { type: "symbol", symbol: searchSpaceNode.symbol, node: superKeyword }, references: references }]; } - function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles) { + function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, false); var staticFlag = 32; switch (searchSpaceNode.kind) { + case 150: case 149: - case 148: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } + case 148: case 147: - case 146: - case 150: case 151: case 152: + case 153: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; break; - case 261: + case 264: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } - case 225: - case 184: + case 227: + case 185: break; default: return undefined; } var references = []; var possiblePositions; - if (searchSpaceNode.kind === 261) { + if (searchSpaceNode.kind === 264) { ts.forEach(sourceFiles, function (sourceFile) { + cancellationToken.throwIfCancellationRequested(); possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); }); @@ -56816,139 +63011,109 @@ var ts; possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, references); } - var thisOrSuperSymbol = typeChecker.getSymbolAtLocation(thisOrSuperKeyword); - var displayParts = thisOrSuperSymbol && ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, thisOrSuperSymbol, thisOrSuperKeyword.getSourceFile(), ts.getContainerNode(thisOrSuperKeyword), thisOrSuperKeyword).displayParts; return [{ - definition: { - containerKind: "", - containerName: "", - fileName: node.getSourceFile().fileName, - kind: ts.ScriptElementKind.variableElement, - name: "this", - textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()), - displayParts: displayParts - }, + definition: { type: "this", node: thisOrSuperKeyword }, references: references }]; function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result) { ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); var node = ts.getTouchingWord(sourceFile, position); if (!node || !ts.isThis(node)) { return; } var container = ts.getThisContainer(node, false); switch (searchSpaceNode.kind) { - case 184: - case 225: + case 185: + case 227: if (searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(node)); + result.push(FindAllReferences.nodeEntry(node)); } break; + case 150: case 149: - case 148: if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(node)); + result.push(FindAllReferences.nodeEntry(node)); } break; - case 197: - case 226: + case 198: + case 228: if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32) === staticFlag) { - result.push(getReferenceEntryFromNode(node)); + result.push(FindAllReferences.nodeEntry(node)); } break; - case 261: - if (container.kind === 261 && !ts.isExternalModule(container)) { - result.push(getReferenceEntryFromNode(node)); + case 264: + if (container.kind === 264 && !ts.isExternalModule(container)) { + result.push(FindAllReferences.nodeEntry(node)); } break; } }); } } - function getReferencesForStringLiteral(node, sourceFiles) { - var type = ts.getStringLiteralTypeForNode(node, typeChecker); - if (!type) { - return undefined; - } + function getReferencesForStringLiteral(node, sourceFiles, cancellationToken) { var references = []; - for (var _i = 0, sourceFiles_9 = sourceFiles; _i < sourceFiles_9.length; _i++) { - var sourceFile = sourceFiles_9[_i]; - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, type.text, sourceFile.getStart(), sourceFile.getEnd()); - getReferencesForStringLiteralInFile(sourceFile, type, possiblePositions, references); + for (var _i = 0, sourceFiles_6 = sourceFiles; _i < sourceFiles_6.length; _i++) { + var sourceFile = sourceFiles_6[_i]; + cancellationToken.throwIfCancellationRequested(); + var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, node.text, sourceFile.getStart(), sourceFile.getEnd()); + getReferencesForStringLiteralInFile(sourceFile, node.text, possiblePositions, references); } return [{ - definition: { - containerKind: "", - containerName: "", - fileName: node.getSourceFile().fileName, - kind: ts.ScriptElementKind.variableElement, - name: type.text, - textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()), - displayParts: [ts.displayPart(ts.getTextOfNode(node), ts.SymbolDisplayPartKind.stringLiteral)] - }, + definition: { type: "string", node: node }, references: references }]; - function getReferencesForStringLiteralInFile(sourceFile, searchType, possiblePositions, references) { - for (var _i = 0, possiblePositions_1 = possiblePositions; _i < possiblePositions_1.length; _i++) { - var position = possiblePositions_1[_i]; - cancellationToken.throwIfCancellationRequested(); - var node_2 = ts.getTouchingWord(sourceFile, position); - if (!node_2 || node_2.kind !== 9) { - return; - } - var type_2 = ts.getStringLiteralTypeForNode(node_2, typeChecker); - if (type_2 === searchType) { - references.push(getReferenceEntryFromNode(node_2)); + function getReferencesForStringLiteralInFile(sourceFile, searchText, possiblePositions, references) { + for (var _i = 0, possiblePositions_5 = possiblePositions; _i < possiblePositions_5.length; _i++) { + var position = possiblePositions_5[_i]; + var node_7 = ts.getTouchingWord(sourceFile, position); + if (node_7 && node_7.kind === 9 && node_7.text === searchText) { + references.push(FindAllReferences.nodeEntry(node_7, true)); } } } } - function populateSearchSymbolSet(symbol, location) { + function populateSearchSymbolSet(symbol, location, checker, implementations) { var result = [symbol]; - var containingObjectLiteralElement = getContainingObjectLiteralElement(location); - if (containingObjectLiteralElement && containingObjectLiteralElement.kind !== 258) { - var propertySymbol = getPropertySymbolOfDestructuringAssignment(location); - if (propertySymbol) { - result.push(propertySymbol); - } - } - var aliasSymbol = getAliasSymbolForPropertyNameSymbol(symbol, location); - if (aliasSymbol) { - result = result.concat(populateSearchSymbolSet(aliasSymbol, location)); - } + var containingObjectLiteralElement = ts.getContainingObjectLiteralElement(location); if (containingObjectLiteralElement) { - ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement), function (contextualSymbol) { - ts.addRange(result, typeChecker.getRootSymbols(contextualSymbol)); + if (containingObjectLiteralElement.kind !== 261) { + var propertySymbol = getPropertySymbolOfDestructuringAssignment(location, checker); + if (propertySymbol) { + result.push(propertySymbol); + } + } + ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker), function (contextualSymbol) { + ts.addRange(result, checker.getRootSymbols(contextualSymbol)); }); - var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(location.parent); + var shorthandValueSymbol = checker.getShorthandAssignmentValueSymbol(location.parent); if (shorthandValueSymbol) { result.push(shorthandValueSymbol); } } - if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 144 && + if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 145 && ts.isParameterPropertyDeclaration(symbol.valueDeclaration)) { - result = result.concat(typeChecker.getSymbolsOfParameterPropertyDeclaration(symbol.valueDeclaration, symbol.name)); + ts.addRange(result, checker.getSymbolsOfParameterPropertyDeclaration(symbol.valueDeclaration, symbol.name)); } - var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol); + var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker); if (bindingElementPropertySymbol) { result.push(bindingElementPropertySymbol); } - ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) { + for (var _i = 0, _a = checker.getRootSymbols(symbol); _i < _a.length; _i++) { + var rootSymbol = _a[_i]; if (rootSymbol !== symbol) { result.push(rootSymbol); } if (!implementations && rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, ts.createMap()); + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, ts.createMap(), checker); } - }); + } return result; } - function getPropertySymbolsFromBaseTypes(symbol, propertyName, result, previousIterationSymbolsCache) { + function getPropertySymbolsFromBaseTypes(symbol, propertyName, result, previousIterationSymbolsCache, checker) { if (!symbol) { return; } - if (symbol.name in previousIterationSymbolsCache) { + if (previousIterationSymbolsCache.has(symbol.name)) { return; } if (symbol.flags & (32 | 64)) { @@ -56957,7 +63122,7 @@ var ts; getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 227) { + else if (declaration.kind === 229) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -56965,62 +63130,56 @@ var ts; return; function getPropertySymbolFromTypeReference(typeReference) { if (typeReference) { - var type = typeChecker.getTypeAtLocation(typeReference); + var type = checker.getTypeAtLocation(typeReference); if (type) { - var propertySymbol = typeChecker.getPropertyOfType(type, propertyName); + var propertySymbol = checker.getPropertyOfType(type, propertyName); if (propertySymbol) { - result.push.apply(result, typeChecker.getRootSymbols(propertySymbol)); + result.push.apply(result, checker.getRootSymbols(propertySymbol)); } - previousIterationSymbolsCache[symbol.name] = symbol; - getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result, previousIterationSymbolsCache); + previousIterationSymbolsCache.set(symbol.name, symbol); + getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result, previousIterationSymbolsCache, checker); } } } } - function getRelatedSymbol(searchSymbols, referenceSymbol, referenceLocation, searchLocationIsConstructor, parents, cache) { - if (ts.contains(searchSymbols, referenceSymbol)) { - return (!searchLocationIsConstructor || ts.isNewExpressionTarget(referenceLocation)) && referenceSymbol; + function getRelatedSymbol(search, referenceSymbol, referenceLocation, state) { + if (search.includes(referenceSymbol)) { + return referenceSymbol; } - var aliasSymbol = getAliasSymbolForPropertyNameSymbol(referenceSymbol, referenceLocation); - if (aliasSymbol) { - return getRelatedSymbol(searchSymbols, aliasSymbol, referenceLocation, searchLocationIsConstructor, parents, cache); - } - var containingObjectLiteralElement = getContainingObjectLiteralElement(referenceLocation); + var containingObjectLiteralElement = ts.getContainingObjectLiteralElement(referenceLocation); if (containingObjectLiteralElement) { - var contextualSymbol = ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement), function (contextualSymbol) { - return ts.forEach(typeChecker.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); + var contextualSymbol = ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement, state.checker), function (contextualSymbol) { + return ts.find(state.checker.getRootSymbols(contextualSymbol), search.includes); }); if (contextualSymbol) { return contextualSymbol; } - var propertySymbol = getPropertySymbolOfDestructuringAssignment(referenceLocation); - if (propertySymbol && searchSymbols.indexOf(propertySymbol) >= 0) { + var propertySymbol = getPropertySymbolOfDestructuringAssignment(referenceLocation, state.checker); + if (propertySymbol && search.includes(propertySymbol)) { return propertySymbol; } } - var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(referenceSymbol); - if (bindingElementPropertySymbol && searchSymbols.indexOf(bindingElementPropertySymbol) >= 0) { + var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(referenceSymbol, state.checker); + if (bindingElementPropertySymbol && search.includes(bindingElementPropertySymbol)) { return bindingElementPropertySymbol; } - return ts.forEach(typeChecker.getRootSymbols(referenceSymbol), function (rootSymbol) { - if (searchSymbols.indexOf(rootSymbol) >= 0) { + return ts.forEach(state.checker.getRootSymbols(referenceSymbol), function (rootSymbol) { + if (search.includes(rootSymbol)) { return rootSymbol; } if (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { - if (parents) { - if (!ts.forEach(parents, function (parent) { return explicitlyInheritsFrom(rootSymbol.parent, parent, cache); })) { - return undefined; - } + if (search.parents && !ts.some(search.parents, function (parent) { return explicitlyInheritsFrom(rootSymbol.parent, parent, state.inheritsFromCache, state.checker); })) { + return undefined; } - var result_4 = []; - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_4, ts.createMap()); - return ts.forEach(result_4, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); + var result = []; + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, ts.createMap(), state.checker); + return ts.find(result, search.includes); } return undefined; }); } function getNameFromObjectLiteralElement(node) { - if (node.name.kind === 142) { + if (node.name.kind === 143) { var nameExpression = node.name.expression; if (ts.isStringOrNumericLiteral(nameExpression)) { return nameExpression.text; @@ -57029,15 +63188,15 @@ var ts; } return node.name.text; } - function getPropertySymbolsFromContextualType(node) { + function getPropertySymbolsFromContextualType(node, checker) { var objectLiteral = node.parent; - var contextualType = typeChecker.getContextualType(objectLiteral); + var contextualType = checker.getContextualType(objectLiteral); var name = getNameFromObjectLiteralElement(node); if (name && contextualType) { var result_5 = []; - var symbol_2 = contextualType.getProperty(name); - if (symbol_2) { - result_5.push(symbol_2); + var symbol = contextualType.getProperty(name); + if (symbol) { + result_5.push(symbol); } if (contextualType.flags & 65536) { ts.forEach(contextualType.types, function (t) { @@ -57056,8 +63215,8 @@ var ts; var lastIterationMeaning = void 0; do { lastIterationMeaning = meaning; - for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { - var declaration = declarations_8[_i]; + for (var _i = 0, declarations_11 = declarations; _i < declarations_11.length; _i++) { + var declaration = declarations_11[_i]; var declarationMeaning = ts.getMeaningFromDeclaration(declaration); if (declarationMeaning & meaning) { meaning |= declarationMeaning; @@ -57067,137 +63226,86 @@ var ts; } return meaning; } - } - FindAllReferences.getReferencedSymbolsForNode = getReferencedSymbolsForNode; - function convertReferences(referenceSymbols) { - if (!referenceSymbols) { - return undefined; - } - var referenceEntries = []; - for (var _i = 0, referenceSymbols_1 = referenceSymbols; _i < referenceSymbols_1.length; _i++) { - var referenceSymbol = referenceSymbols_1[_i]; - ts.addRange(referenceEntries, referenceSymbol.references); - } - return referenceEntries; - } - FindAllReferences.convertReferences = convertReferences; - function isImplementation(node) { - if (!node) { + function isImplementation(node) { + if (!node) { + return false; + } + else if (ts.isVariableLike(node)) { + if (node.initializer) { + return true; + } + else if (node.kind === 225) { + var parentStatement = getParentStatementOfVariableDeclaration(node); + return parentStatement && ts.hasModifier(parentStatement, 2); + } + } + else if (ts.isFunctionLike(node)) { + return !!node.body || ts.hasModifier(node, 2); + } + else { + switch (node.kind) { + case 228: + case 198: + case 231: + case 232: + return true; + } + } return false; } - else if (ts.isVariableLike(node)) { - if (node.initializer) { - return true; - } - else if (node.kind === 223) { - var parentStatement = getParentStatementOfVariableDeclaration(node); - return parentStatement && ts.hasModifier(parentStatement, 2); + function getParentStatementOfVariableDeclaration(node) { + if (node.parent && node.parent.parent && node.parent.parent.kind === 207) { + ts.Debug.assert(node.parent.kind === 226); + return node.parent.parent; } } - else if (ts.isFunctionLike(node)) { - return !!node.body || ts.hasModifier(node, 2); - } - else { - switch (node.kind) { - case 226: - case 197: - case 229: - case 230: - return true; - } - } - return false; - } - function getParentStatementOfVariableDeclaration(node) { - if (node.parent && node.parent.parent && node.parent.parent.kind === 205) { - ts.Debug.assert(node.parent.kind === 224); - return node.parent.parent; - } - } - function getReferenceEntriesForShorthandPropertyAssignment(node, typeChecker, result) { - var refSymbol = typeChecker.getSymbolAtLocation(node); - var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(refSymbol.valueDeclaration); - if (shorthandSymbol) { - for (var _i = 0, _a = shorthandSymbol.getDeclarations(); _i < _a.length; _i++) { - var declaration = _a[_i]; - if (ts.getMeaningFromDeclaration(declaration) & 1) { - result.push(getReferenceEntryFromNode(declaration)); + function getReferenceEntriesForShorthandPropertyAssignment(node, checker, addReference) { + var refSymbol = checker.getSymbolAtLocation(node); + var shorthandSymbol = checker.getShorthandAssignmentValueSymbol(refSymbol.valueDeclaration); + if (shorthandSymbol) { + for (var _i = 0, _a = shorthandSymbol.getDeclarations(); _i < _a.length; _i++) { + var declaration = _a[_i]; + if (ts.getMeaningFromDeclaration(declaration) & 1) { + addReference(declaration); + } } } } - } - FindAllReferences.getReferenceEntriesForShorthandPropertyAssignment = getReferenceEntriesForShorthandPropertyAssignment; - function getReferenceEntryFromNode(node) { - var start = node.getStart(); - var end = node.getEnd(); - if (node.kind === 9) { - start += 1; - end -= 1; - } - return { - fileName: node.getSourceFile().fileName, - textSpan: ts.createTextSpanFromBounds(start, end), - isWriteAccess: isWriteAccess(node), - isDefinition: ts.isDeclarationName(node) || ts.isLiteralComputedPropertyDeclarationName(node) - }; - } - FindAllReferences.getReferenceEntryFromNode = getReferenceEntryFromNode; - function isWriteAccess(node) { - if (node.kind === 70 && ts.isDeclarationName(node)) { - return true; - } - var parent = node.parent; - if (parent) { - if (parent.kind === 191 || parent.kind === 190) { - return true; - } - else if (parent.kind === 192 && parent.left === node) { - var operator = parent.operatorToken.kind; - return 57 <= operator && operator <= 69; - } - } - return false; - } - function forEachDescendantOfKind(node, kind, action) { - ts.forEachChild(node, function (child) { - if (child.kind === kind) { - action(child); - } - forEachDescendantOfKind(child, kind, action); - }); - } - function getContainingObjectLiteralElement(node) { - switch (node.kind) { - case 9: - case 8: - if (node.parent.kind === 142) { - return isObjectLiteralPropertyDeclaration(node.parent.parent) ? node.parent.parent : undefined; + Core.getReferenceEntriesForShorthandPropertyAssignment = getReferenceEntriesForShorthandPropertyAssignment; + function forEachDescendantOfKind(node, kind, action) { + ts.forEachChild(node, function (child) { + if (child.kind === kind) { + action(child); } - case 70: - return isObjectLiteralPropertyDeclaration(node.parent) && node.parent.name === node ? node.parent : undefined; + forEachDescendantOfKind(child, kind, action); + }); } - return undefined; - } - function isObjectLiteralPropertyDeclaration(node) { - switch (node.kind) { - case 257: - case 258: - case 149: - case 151: - case 152: - return true; + function tryGetClassByExtendingIdentifier(node) { + return ts.tryGetClassExtendingExpressionWithTypeArguments(ts.climbPastPropertyAccess(node).parent); } - return false; - } - function tryGetClassByExtendingIdentifier(node) { - return ts.tryGetClassExtendingExpressionWithTypeArguments(ts.climbPastPropertyAccess(node).parent); - } - function isNameOfExternalModuleImportOrDeclaration(node) { - if (node.kind === 9) { - return ts.isNameOfModuleDeclaration(node) || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node); + function isNameOfExternalModuleImportOrDeclaration(node) { + if (node.kind === 9) { + return ts.isNameOfModuleDeclaration(node) || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node); + } + return false; } - return false; - } + function getParentSymbolsOfPropertyAccess(location, symbol, checker) { + var propertyAccessExpression = getPropertyAccessExpressionFromRightHandSide(location); + if (!propertyAccessExpression) { + return undefined; + } + var localParentType = checker.getTypeAtLocation(propertyAccessExpression.expression); + if (!localParentType) { + return undefined; + } + if (localParentType.symbol && localParentType.symbol.flags & (32 | 64) && localParentType.symbol !== symbol.parent) { + return [localParentType.symbol]; + } + else if (localParentType.flags & 196608) { + return getSymbolsForClassAndInterfaceComponents(localParentType); + } + } + })(Core = FindAllReferences.Core || (FindAllReferences.Core = {})); })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); var ts; @@ -57215,11 +63323,9 @@ var ts; } var typeReferenceDirective = findReferenceInPosition(sourceFile.typeReferenceDirectives, position); if (typeReferenceDirective) { - var referenceFile = program.getResolvedTypeReferenceDirectives()[typeReferenceDirective.fileName]; - if (referenceFile && referenceFile.resolvedFileName) { - return [getDefinitionInfoForFileReference(typeReferenceDirective.fileName, referenceFile.resolvedFileName)]; - } - return undefined; + var referenceFile = program.getResolvedTypeReferenceDirectives().get(typeReferenceDirective.fileName); + return referenceFile && referenceFile.resolvedFileName && + [getDefinitionInfoForFileReference(typeReferenceDirective.fileName, referenceFile.resolvedFileName)]; } var node = ts.getTouchingPropertyName(sourceFile, position); if (node === sourceFile) { @@ -57228,7 +63334,7 @@ var ts; if (ts.isJumpStatementTarget(node)) { var labelName = node.text; var label = ts.getTargetLabel(node.parent, node.text); - return label ? [createDefinitionInfo(label, ts.ScriptElementKind.label, labelName, undefined)] : undefined; + return label ? [createDefinitionInfoFromName(label, ts.ScriptElementKind.label, labelName, undefined)] : undefined; } var typeChecker = program.getTypeChecker(); var calledDeclaration = tryGetSignatureDeclaration(typeChecker, node); @@ -57243,11 +63349,11 @@ var ts; var declaration = symbol.declarations[0]; if (node.kind === 70 && (node.parent === declaration || - (declaration.kind === 239 && declaration.parent && declaration.parent.kind === 238))) { + (declaration.kind === 241 && declaration.parent && declaration.parent.kind === 240))) { symbol = typeChecker.getAliasedSymbol(symbol); } } - if (node.parent.kind === 258) { + if (node.parent.kind === 261) { var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); if (!shorthandSymbol) { return []; @@ -57258,6 +63364,22 @@ var ts; var shorthandContainerName_1 = typeChecker.symbolToString(symbol.parent, node); return ts.map(shorthandDeclarations, function (declaration) { return createDefinitionInfo(declaration, shorthandSymbolKind_1, shorthandSymbolName_1, shorthandContainerName_1); }); } + if (ts.isJsxOpeningLikeElement(node.parent)) { + var _a = getSymbolInfo(typeChecker, symbol, node), symbolName = _a.symbolName, symbolKind = _a.symbolKind, containerName = _a.containerName; + return [createDefinitionInfo(symbol.valueDeclaration, symbolKind, symbolName, containerName)]; + } + var element = ts.getContainingObjectLiteralElement(node); + if (element) { + if (typeChecker.getContextualType(element.parent)) { + var result = []; + var propertySymbols = ts.getPropertySymbolsFromContextualType(typeChecker, element); + for (var _i = 0, propertySymbols_1 = propertySymbols; _i < propertySymbols_1.length; _i++) { + var propertySymbol = propertySymbols_1[_i]; + result.push.apply(result, getDefinitionFromSymbol(typeChecker, propertySymbol, node)); + } + return result; + } + } return getDefinitionFromSymbol(typeChecker, symbol, node); } GoToDefinition.getDefinitionAtPosition = getDefinitionAtPosition; @@ -57321,31 +63443,45 @@ var ts; return false; } function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { + if (!signatureDeclarations) { + return false; + } var declarations = []; var definition; - ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 150) || - (!selectConstructors && (d.kind === 225 || d.kind === 149 || d.kind === 148))) { + for (var _i = 0, signatureDeclarations_1 = signatureDeclarations; _i < signatureDeclarations_1.length; _i++) { + var d = signatureDeclarations_1[_i]; + if (selectConstructors ? d.kind === 151 : isSignatureDeclaration(d)) { declarations.push(d); if (d.body) definition = d; } - }); - if (definition) { - result.push(createDefinitionInfo(definition, symbolKind, symbolName, containerName)); - return true; } - else if (declarations.length) { - result.push(createDefinitionInfo(ts.lastOrUndefined(declarations), symbolKind, symbolName, containerName)); + if (declarations.length) { + result.push(createDefinitionInfo(definition || ts.lastOrUndefined(declarations), symbolKind, symbolName, containerName)); return true; } return false; } } + function isSignatureDeclaration(node) { + switch (node.kind) { + case 151: + case 227: + case 150: + case 149: + return true; + default: + return false; + } + } function createDefinitionInfo(node, symbolKind, symbolName, containerName) { + return createDefinitionInfoFromName(node.name || node, symbolKind, symbolName, containerName); + } + function createDefinitionInfoFromName(name, symbolKind, symbolName, containerName) { + var sourceFile = name.getSourceFile(); return { - fileName: node.getSourceFile().fileName, - textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()), + fileName: sourceFile.fileName, + textSpan: ts.createTextSpanFromNode(name, sourceFile), kind: symbolKind, name: symbolName, containerKind: undefined, @@ -57392,39 +63528,18 @@ var ts; } function tryGetSignatureDeclaration(typeChecker, node) { var callLike = getAncestorCallLikeExpression(node); - return callLike && typeChecker.getResolvedSignature(callLike).declaration; + var signature = callLike && typeChecker.getResolvedSignature(callLike); + if (signature) { + var decl = signature.declaration; + if (decl && isSignatureDeclaration(decl)) { + return decl; + } + } + return undefined; } })(GoToDefinition = ts.GoToDefinition || (ts.GoToDefinition = {})); })(ts || (ts = {})); var ts; -(function (ts) { - var GoToImplementation; - (function (GoToImplementation) { - function getImplementationAtPosition(typeChecker, cancellationToken, sourceFiles, node) { - if (node.parent.kind === 258) { - var result = []; - ts.FindAllReferences.getReferenceEntriesForShorthandPropertyAssignment(node, typeChecker, result); - return result.length > 0 ? result : undefined; - } - else if (node.kind === 96 || ts.isSuperProperty(node.parent)) { - var symbol = typeChecker.getSymbolAtLocation(node); - return symbol.valueDeclaration && [ts.FindAllReferences.getReferenceEntryFromNode(symbol.valueDeclaration)]; - } - else { - var referencedSymbols = ts.FindAllReferences.getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFiles, false, false, true); - var result = ts.flatMap(referencedSymbols, function (symbol) { - return ts.map(symbol.references, function (_a) { - var textSpan = _a.textSpan, fileName = _a.fileName; - return ({ textSpan: textSpan, fileName: fileName }); - }); - }); - return result && result.length > 0 ? result : undefined; - } - } - GoToImplementation.getImplementationAtPosition = getImplementationAtPosition; - })(GoToImplementation = ts.GoToImplementation || (ts.GoToImplementation = {})); -})(ts || (ts = {})); -var ts; (function (ts) { var JsDoc; (function (JsDoc) { @@ -57451,6 +63566,7 @@ var ts; "lends", "link", "memberOf", + "method", "name", "namespace", "param", @@ -57469,7 +63585,8 @@ var ts; "prop", "version" ]; - var jsDocCompletionEntries; + var jsDocTagNameCompletionEntries; + var jsDocTagCompletionEntries; function getJsDocCommentsFromDeclarations(declarations) { var documentationComment = []; forEachUnique(declarations, function (declaration) { @@ -57490,9 +63607,32 @@ var ts; return documentationComment; } JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; + function getJsDocTagsFromDeclarations(declarations) { + var tags = []; + forEachUnique(declarations, function (declaration) { + var jsDocs = ts.getJSDocs(declaration); + if (!jsDocs) { + return; + } + for (var _i = 0, jsDocs_1 = jsDocs; _i < jsDocs_1.length; _i++) { + var doc = jsDocs_1[_i]; + var tagsForDoc = doc.tags; + if (tagsForDoc) { + tags.push.apply(tags, tagsForDoc.filter(function (tag) { return tag.kind === 283; }).map(function (jsDocTag) { + return { + name: jsDocTag.tagName.text, + text: jsDocTag.comment + }; + })); + } + } + }); + return tags; + } + JsDoc.getJsDocTagsFromDeclarations = getJsDocTagsFromDeclarations; function forEachUnique(array, callback) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { if (ts.indexOf(array, array[i]) === i) { var result = callback(array[i], i); if (result) { @@ -57503,8 +63643,8 @@ var ts; } return undefined; } - function getAllJsDocCompletionEntries() { - return jsDocCompletionEntries || (jsDocCompletionEntries = ts.map(jsDocTagNames, function (tagName) { + function getJSDocTagNameCompletions() { + return jsDocTagNameCompletionEntries || (jsDocTagNameCompletionEntries = ts.map(jsDocTagNames, function (tagName) { return { name: tagName, kind: ts.ScriptElementKind.keyword, @@ -57513,7 +63653,18 @@ var ts; }; })); } - JsDoc.getAllJsDocCompletionEntries = getAllJsDocCompletionEntries; + JsDoc.getJSDocTagNameCompletions = getJSDocTagNameCompletions; + function getJSDocTagCompletions() { + return jsDocTagCompletionEntries || (jsDocTagCompletionEntries = ts.map(jsDocTagNames, function (tagName) { + return { + name: "@" + tagName, + kind: ts.ScriptElementKind.keyword, + kindModifiers: "", + sortText: "0" + }; + })); + } + JsDoc.getJSDocTagCompletions = getJSDocTagCompletions; function getDocCommentTemplateAtPosition(newLine, sourceFile, position) { if (ts.isInString(sourceFile, position) || ts.isInComment(sourceFile, position) || ts.hasDocComment(sourceFile, position)) { return undefined; @@ -57526,16 +63677,16 @@ var ts; var commentOwner; findOwner: for (commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) { switch (commentOwner.kind) { - case 225: - case 149: + case 227: case 150: - case 226: - case 205: + case 151: + case 228: + case 207: break findOwner; - case 261: + case 264: return undefined; - case 230: - if (commentOwner.parent.kind === 230) { + case 232: + if (commentOwner.parent.kind === 232) { return undefined; } break findOwner; @@ -57547,14 +63698,20 @@ var ts; var parameters = getParametersForJsDocOwningNode(commentOwner); var posLineAndChar = sourceFile.getLineAndCharacterOfPosition(position); var lineStart = sourceFile.getLineStarts()[posLineAndChar.line]; - var indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character); + var indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character).replace(/\S/i, function () { return " "; }); + var isJavaScriptFile = ts.hasJavaScriptFileExtension(sourceFile.fileName); var docParams = ""; - for (var i = 0, numParams = parameters.length; i < numParams; i++) { + for (var i = 0; i < parameters.length; i++) { var currentName = parameters[i].name; var paramName = currentName.kind === 70 ? currentName.text : "param" + i; - docParams += indentationStr + " * @param " + paramName + newLine; + if (isJavaScriptFile) { + docParams += indentationStr + " * @param {any} " + paramName + newLine; + } + else { + docParams += indentationStr + " * @param " + paramName + newLine; + } } var preamble = "/**" + newLine + indentationStr + " * "; @@ -57569,7 +63726,7 @@ var ts; if (ts.isFunctionLike(commentOwner)) { return commentOwner.parameters; } - if (commentOwner.kind === 205) { + if (commentOwner.kind === 207) { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; if (varDeclarations.length === 1 && varDeclarations[0].initializer) { @@ -57579,17 +63736,17 @@ var ts; return ts.emptyArray; } function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 183) { + while (rightHandSide.kind === 184) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 184: case 185: + case 186: return rightHandSide.parameters; - case 197: + case 198: for (var _i = 0, _a = rightHandSide.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 150) { + if (member.kind === 151) { return member.parameters; } } @@ -57600,47 +63757,212 @@ var ts; })(JsDoc = ts.JsDoc || (ts.JsDoc = {})); })(ts || (ts = {})); var ts; +(function (ts) { + var JsTyping; + (function (JsTyping) { + var safeList; + var EmptySafeList = ts.createMap(); + JsTyping.nodeCoreModuleList = [ + "buffer", "querystring", "events", "http", "cluster", + "zlib", "os", "https", "punycode", "repl", "readline", + "vm", "child_process", "url", "dns", "net", + "dgram", "fs", "path", "string_decoder", "tls", + "crypto", "stream", "util", "assert", "tty", "domain", + "constants", "process", "v8", "timers", "console" + ]; + var nodeCoreModules = ts.arrayToMap(JsTyping.nodeCoreModuleList, function (x) { return x; }); + function discoverTypings(host, fileNames, projectRootPath, safeListPath, packageNameToTypingLocation, typeAcquisition, unresolvedImports) { + var inferredTypings = ts.createMap(); + if (!typeAcquisition || !typeAcquisition.enable) { + return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] }; + } + fileNames = ts.filter(ts.map(fileNames, ts.normalizePath), function (f) { + var kind = ts.ensureScriptKind(f, ts.getScriptKindFromFileName(f)); + return kind === 1 || kind === 2; + }); + if (!safeList) { + var result = ts.readConfigFile(safeListPath, function (path) { return host.readFile(path); }); + safeList = result.config ? ts.createMapFromTemplate(result.config) : EmptySafeList; + } + var filesToWatch = []; + var searchDirs = []; + var exclude = []; + mergeTypings(typeAcquisition.include); + exclude = typeAcquisition.exclude || []; + var possibleSearchDirs = ts.map(fileNames, ts.getDirectoryPath); + if (projectRootPath) { + possibleSearchDirs.push(projectRootPath); + } + searchDirs = ts.deduplicate(possibleSearchDirs); + for (var _i = 0, searchDirs_1 = searchDirs; _i < searchDirs_1.length; _i++) { + var searchDir = searchDirs_1[_i]; + var packageJsonPath = ts.combinePaths(searchDir, "package.json"); + getTypingNamesFromJson(packageJsonPath, filesToWatch); + var bowerJsonPath = ts.combinePaths(searchDir, "bower.json"); + getTypingNamesFromJson(bowerJsonPath, filesToWatch); + var bowerComponentsPath = ts.combinePaths(searchDir, "bower_components"); + getTypingNamesFromPackagesFolder(bowerComponentsPath); + var nodeModulesPath = ts.combinePaths(searchDir, "node_modules"); + getTypingNamesFromPackagesFolder(nodeModulesPath); + } + getTypingNamesFromSourceFileNames(fileNames); + if (unresolvedImports) { + for (var _a = 0, unresolvedImports_1 = unresolvedImports; _a < unresolvedImports_1.length; _a++) { + var moduleId = unresolvedImports_1[_a]; + var typingName = nodeCoreModules.has(moduleId) ? "node" : moduleId; + if (!inferredTypings.has(typingName)) { + inferredTypings.set(typingName, undefined); + } + } + } + packageNameToTypingLocation.forEach(function (typingLocation, name) { + if (inferredTypings.has(name) && inferredTypings.get(name) === undefined) { + inferredTypings.set(name, typingLocation); + } + }); + for (var _b = 0, exclude_1 = exclude; _b < exclude_1.length; _b++) { + var excludeTypingName = exclude_1[_b]; + inferredTypings.delete(excludeTypingName); + } + var newTypingNames = []; + var cachedTypingPaths = []; + inferredTypings.forEach(function (inferred, typing) { + if (inferred !== undefined) { + cachedTypingPaths.push(inferred); + } + else { + newTypingNames.push(typing); + } + }); + return { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch }; + function mergeTypings(typingNames) { + if (!typingNames) { + return; + } + for (var _i = 0, typingNames_1 = typingNames; _i < typingNames_1.length; _i++) { + var typing = typingNames_1[_i]; + if (!inferredTypings.has(typing)) { + inferredTypings.set(typing, undefined); + } + } + } + function getTypingNamesFromJson(jsonPath, filesToWatch) { + if (host.fileExists(jsonPath)) { + filesToWatch.push(jsonPath); + } + var result = ts.readConfigFile(jsonPath, function (path) { return host.readFile(path); }); + if (result.config) { + var jsonConfig = result.config; + if (jsonConfig.dependencies) { + mergeTypings(ts.getOwnKeys(jsonConfig.dependencies)); + } + if (jsonConfig.devDependencies) { + mergeTypings(ts.getOwnKeys(jsonConfig.devDependencies)); + } + if (jsonConfig.optionalDependencies) { + mergeTypings(ts.getOwnKeys(jsonConfig.optionalDependencies)); + } + if (jsonConfig.peerDependencies) { + mergeTypings(ts.getOwnKeys(jsonConfig.peerDependencies)); + } + } + } + function getTypingNamesFromSourceFileNames(fileNames) { + var jsFileNames = ts.filter(fileNames, ts.hasJavaScriptFileExtension); + var inferredTypingNames = ts.map(jsFileNames, function (f) { return ts.removeFileExtension(ts.getBaseFileName(f.toLowerCase())); }); + var cleanedTypingNames = ts.map(inferredTypingNames, function (f) { return f.replace(/((?:\.|-)min(?=\.|$))|((?:-|\.)\d+)/g, ""); }); + if (safeList !== EmptySafeList) { + mergeTypings(ts.filter(cleanedTypingNames, function (f) { return safeList.has(f); })); + } + var hasJsxFile = ts.forEach(fileNames, function (f) { return ts.ensureScriptKind(f, ts.getScriptKindFromFileName(f)) === 2; }); + if (hasJsxFile) { + mergeTypings(["react"]); + } + } + function getTypingNamesFromPackagesFolder(packagesFolderPath) { + filesToWatch.push(packagesFolderPath); + if (!host.directoryExists(packagesFolderPath)) { + return; + } + var typingNames = []; + var fileNames = host.readDirectory(packagesFolderPath, [".json"], undefined, undefined, 2); + for (var _i = 0, fileNames_2 = fileNames; _i < fileNames_2.length; _i++) { + var fileName = fileNames_2[_i]; + var normalizedFileName = ts.normalizePath(fileName); + var baseFileName = ts.getBaseFileName(normalizedFileName); + if (baseFileName !== "package.json" && baseFileName !== "bower.json") { + continue; + } + var result = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); }); + if (!result.config) { + continue; + } + var packageJson = result.config; + if (baseFileName === "package.json" && packageJson._requiredBy && + ts.filter(packageJson._requiredBy, function (r) { return r[0] === "#" || r === "/"; }).length === 0) { + continue; + } + if (!packageJson.name) { + continue; + } + if (packageJson.typings) { + var absolutePath = ts.getNormalizedAbsolutePath(packageJson.typings, ts.getDirectoryPath(normalizedFileName)); + inferredTypings.set(packageJson.name, absolutePath); + } + else { + typingNames.push(packageJson.name); + } + } + mergeTypings(typingNames); + } + } + JsTyping.discoverTypings = discoverTypings; + })(JsTyping = ts.JsTyping || (ts.JsTyping = {})); +})(ts || (ts = {})); +var ts; (function (ts) { var NavigateTo; (function (NavigateTo) { function getNavigateToItems(sourceFiles, checker, cancellationToken, searchValue, maxResultCount, excludeDtsFiles) { var patternMatcher = ts.createPatternMatcher(searchValue); var rawItems = []; - ts.forEach(sourceFiles, function (sourceFile) { + var _loop_4 = function (sourceFile) { cancellationToken.throwIfCancellationRequested(); if (excludeDtsFiles && ts.fileExtensionIs(sourceFile.fileName, ".d.ts")) { - return; + return "continue"; } - var nameToDeclarations = sourceFile.getNamedDeclarations(); - for (var name_46 in nameToDeclarations) { - var declarations = nameToDeclarations[name_46]; + ts.forEachEntry(sourceFile.getNamedDeclarations(), function (declarations, name) { if (declarations) { - var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_46); + var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name); if (!matches) { - continue; + return; } - for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) { - var declaration = declarations_9[_i]; + for (var _i = 0, declarations_12 = declarations; _i < declarations_12.length; _i++) { + var declaration = declarations_12[_i]; if (patternMatcher.patternContainsDots) { var containers = getContainers(declaration); if (!containers) { - return undefined; + return true; } - matches = patternMatcher.getMatches(containers, name_46); + matches = patternMatcher.getMatches(containers, name); if (!matches) { - continue; + return; } } var fileName = sourceFile.fileName; var matchKind = bestMatchKind(matches); - rawItems.push({ name: name_46, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); + rawItems.push({ name: name, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); } } - } - }); + }); + }; + for (var _i = 0, sourceFiles_7 = sourceFiles; _i < sourceFiles_7.length; _i++) { + var sourceFile = sourceFiles_7[_i]; + _loop_4(sourceFile); + } rawItems = ts.filter(rawItems, function (item) { var decl = item.declaration; - if (decl.kind === 236 || decl.kind === 239 || decl.kind === 234) { + if (decl.kind === 238 || decl.kind === 241 || decl.kind === 236) { var importer = checker.getSymbolAtLocation(decl.name); var imported = checker.getAliasedSymbol(importer); return importer.name !== imported.name; @@ -57681,7 +64003,7 @@ var ts; if (text !== undefined) { containers.unshift(text); } - else if (declaration.name.kind === 142) { + else if (declaration.name.kind === 143) { return tryAddComputedPropertyName(declaration.name.expression, containers, true); } else { @@ -57698,7 +64020,7 @@ var ts; } return true; } - if (expression.kind === 177) { + if (expression.kind === 178) { var propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); @@ -57709,7 +64031,7 @@ var ts; } function getContainers(declaration) { var containers = []; - if (declaration.name.kind === 142) { + if (declaration.name.kind === 143) { if (!tryAddComputedPropertyName(declaration.name.expression, containers, false)) { return undefined; } @@ -57750,7 +64072,7 @@ var ts; matchKind: ts.PatternMatchKind[rawItem.matchKind], isCaseSensitive: rawItem.isCaseSensitive, fileName: rawItem.fileName, - textSpan: ts.createTextSpanFromBounds(declaration.getStart(), declaration.getEnd()), + textSpan: ts.createTextSpanFromNode(declaration), containerName: container && container.name ? container.name.text : "", containerKind: container && container.name ? ts.getNodeKind(container) : "" }; @@ -57763,21 +64085,41 @@ var ts; (function (ts) { var NavigationBar; (function (NavigationBar) { - function getNavigationBarItems(sourceFile) { + var whiteSpaceRegex = /\s+/g; + var curCancellationToken; + var curSourceFile; + var parentsStack = []; + var parent; + var emptyChildItemArray = []; + function getNavigationBarItems(sourceFile, cancellationToken) { + curCancellationToken = cancellationToken; curSourceFile = sourceFile; - var result = ts.map(topLevelItems(rootNavigationBarNode(sourceFile)), convertToTopLevelItem); - curSourceFile = undefined; - return result; + try { + return ts.map(topLevelItems(rootNavigationBarNode(sourceFile)), convertToTopLevelItem); + } + finally { + reset(); + } } NavigationBar.getNavigationBarItems = getNavigationBarItems; - function getNavigationTree(sourceFile) { + function getNavigationTree(sourceFile, cancellationToken) { + curCancellationToken = cancellationToken; curSourceFile = sourceFile; - var result = convertToTree(rootNavigationBarNode(sourceFile)); - curSourceFile = undefined; - return result; + try { + return convertToTree(rootNavigationBarNode(sourceFile)); + } + finally { + reset(); + } } NavigationBar.getNavigationTree = getNavigationTree; - var curSourceFile; + function reset() { + curSourceFile = undefined; + curCancellationToken = undefined; + parentsStack = []; + parent = undefined; + emptyChildItemArray = []; + } function nodeText(node) { return node.getText(curSourceFile); } @@ -57792,8 +64134,6 @@ var ts; parent.children = [child]; } } - var parentsStack = []; - var parent; function rootNavigationBarNode(sourceFile) { ts.Debug.assert(!parentsStack.length); var root = { node: sourceFile, additionalNodes: undefined, parent: undefined, children: undefined, indent: 0 }; @@ -57837,11 +64177,12 @@ var ts; endNode(); } function addChildrenRecursively(node) { + curCancellationToken.throwIfCancellationRequested(); if (!node || ts.isToken(node)) { return; } switch (node.kind) { - case 150: + case 151: var ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); for (var _i = 0, _a = ctr.parameters; _i < _a.length; _i++) { @@ -57851,28 +64192,28 @@ var ts; } } break; - case 149: - case 151: + case 150: case 152: - case 148: + case 153: + case 149: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; + case 148: case 147: - case 146: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 236: + case 238: var importClause = node; if (importClause.name) { addLeafNode(importClause); } var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 237) { + if (namedBindings.kind === 239) { addLeafNode(namedBindings); } else { @@ -57883,12 +64224,12 @@ var ts; } } break; - case 174: - case 223: + case 175: + case 225: var decl = node; - var name_47 = decl.name; - if (ts.isBindingPattern(name_47)) { - addChildrenRecursively(name_47); + var name = decl.name; + if (ts.isBindingPattern(name)) { + addChildrenRecursively(name); } else if (decl.initializer && isFunctionOrClassExpression(decl.initializer)) { addChildrenRecursively(decl.initializer); @@ -57897,12 +64238,12 @@ var ts; addNodeWithRecursiveChild(decl, decl.initializer); } break; + case 186: + case 227: case 185: - case 225: - case 184: addNodeWithRecursiveChild(node, node.body); break; - case 229: + case 231: startNode(node); for (var _d = 0, _e = node.members; _d < _e.length; _d++) { var member = _e[_d]; @@ -57912,9 +64253,9 @@ var ts; } endNode(); break; - case 226: - case 197: - case 227: + case 228: + case 198: + case 229: startNode(node); for (var _f = 0, _g = node.members; _f < _g.length; _f++) { var member = _g[_f]; @@ -57922,21 +64263,21 @@ var ts; } endNode(); break; - case 230: + case 232: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 243: - case 234: - case 155: - case 153: + case 245: + case 236: + case 156: case 154: - case 228: + case 155: + case 230: addLeafNode(node); break; default: ts.forEach(node.jsDoc, function (jsDoc) { ts.forEach(jsDoc.tags, function (tag) { - if (tag.kind === 285) { + if (tag.kind === 289) { addLeafNode(tag); } }); @@ -57952,9 +64293,9 @@ var ts; if (!name) { return true; } - var itemsWithSameName = nameToItems[name]; + var itemsWithSameName = nameToItems.get(name); if (!itemsWithSameName) { - nameToItems[name] = child; + nameToItems.set(name, child); return true; } if (itemsWithSameName instanceof Array) { @@ -57972,7 +64313,7 @@ var ts; if (tryMerge(itemWithSameName, child)) { return false; } - nameToItems[name] = [itemWithSameName, child]; + nameToItems.set(name, [itemWithSameName, child]); return true; } function tryMerge(a, b) { @@ -57984,12 +64325,12 @@ var ts; } }); function shouldReallyMerge(a, b) { - return a.kind === b.kind && (a.kind !== 230 || areSameModule(a, b)); + return a.kind === b.kind && (a.kind !== 232 || areSameModule(a, b)); function areSameModule(a, b) { if (a.body.kind !== b.body.kind) { return false; } - if (a.body.kind !== 230) { + if (a.body.kind !== 232) { return true; } return areSameModule(a.body, b.body); @@ -58015,32 +64356,15 @@ var ts; function compareChildren(child1, child2) { var name1 = tryGetName(child1.node), name2 = tryGetName(child2.node); if (name1 && name2) { - var cmp = localeCompareFix(name1, name2); + var cmp = ts.compareStringsCaseInsensitive(name1, name2); return cmp !== 0 ? cmp : navigationBarNodeKind(child1) - navigationBarNodeKind(child2); } else { return name1 ? 1 : name2 ? -1 : navigationBarNodeKind(child1) - navigationBarNodeKind(child2); } } - var localeCompareIsCorrect = ts.collator && ts.collator.compare("a", "B") < 0; - var localeCompareFix = localeCompareIsCorrect ? ts.collator.compare : function (a, b) { - for (var i = 0; i < Math.min(a.length, b.length); i++) { - var chA = a.charAt(i), chB = b.charAt(i); - if (chA === "\"" && chB === "'") { - return 1; - } - if (chA === "'" && chB === "\"") { - return -1; - } - var cmp = ts.compareStrings(chA.toLocaleLowerCase(), chB.toLocaleLowerCase()); - if (cmp !== 0) { - return cmp; - } - } - return a.length - b.length; - }; function tryGetName(node) { - if (node.kind === 230) { + if (node.kind === 232) { return getModuleName(node); } var decl = node; @@ -58048,18 +64372,18 @@ var ts; return ts.getPropertyNameForPropertyNameNode(decl.name); } switch (node.kind) { - case 184: case 185: - case 197: + case 186: + case 198: return getFunctionOrClassName(node); - case 285: + case 289: return getJSDocTypedefTagName(node); default: return undefined; } } function getItemName(node) { - if (node.kind === 230) { + if (node.kind === 232) { return getModuleName(node); } var name = node.name; @@ -58070,29 +64394,29 @@ var ts; } } switch (node.kind) { - case 261: + case 264: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : ""; + case 186: + case 227: case 185: - case 225: - case 184: - case 226: - case 197: + case 228: + case 198: if (ts.getModifierFlags(node) & 512) { return "default"; } return getFunctionOrClassName(node); - case 150: + case 151: return "constructor"; - case 154: - return "new()"; - case 153: - return "()"; case 155: + return "new()"; + case 154: + return "()"; + case 156: return "[]"; - case 285: + case 289: return getJSDocTypedefTagName(node); default: return ""; @@ -58104,7 +64428,7 @@ var ts; } else { var parentNode = node.parent && node.parent.parent; - if (parentNode && parentNode.kind === 205) { + if (parentNode && parentNode.kind === 207) { if (parentNode.declarationList.declarations.length > 0) { var nameIdentifier = parentNode.declarationList.declarations[0].name; if (nameIdentifier.kind === 70) { @@ -58132,24 +64456,24 @@ var ts; return topLevel; function isTopLevel(item) { switch (navigationBarNodeKind(item)) { - case 226: - case 197: - case 229: - case 227: - case 230: - case 261: case 228: - case 285: + case 198: + case 231: + case 229: + case 232: + case 264: + case 230: + case 289: return true; - case 150: - case 149: case 151: + case 150: case 152: - case 223: - return hasSomeImportantChild(item); - case 185: + case 153: case 225: - case 184: + return hasSomeImportantChild(item); + case 186: + case 227: + case 185: return isTopLevelFunctionDeclaration(item); default: return false; @@ -58159,10 +64483,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 231: - case 261: - case 149: + case 233: + case 264: case 150: + case 151: return true; default: return hasSomeImportantChild(item); @@ -58171,17 +64495,16 @@ var ts; function hasSomeImportantChild(item) { return ts.forEach(item.children, function (child) { var childKind = navigationBarNodeKind(child); - return childKind !== 223 && childKind !== 174; + return childKind !== 225 && childKind !== 175; }); } } } - var emptyChildItemArray = []; function convertToTree(n) { return { text: getItemName(n.node), kind: ts.getNodeKind(n.node), - kindModifiers: ts.getNodeModifiers(n.node), + kindModifiers: getModifiers(n.node), spans: getSpans(n), childItems: ts.map(n.children, convertToTree) }; @@ -58190,7 +64513,7 @@ var ts; return { text: getItemName(n.node), kind: ts.getNodeKind(n.node), - kindModifiers: ts.getNodeModifiers(n.node), + kindModifiers: getModifiers(n.node), spans: getSpans(n), childItems: ts.map(n.children, convertToChildItem) || emptyChildItemArray, indent: n.indent, @@ -58226,35 +64549,41 @@ var ts; } var result = []; result.push(moduleDeclaration.name.text); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 230) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 232) { moduleDeclaration = moduleDeclaration.body; result.push(moduleDeclaration.name.text); } return result.join("."); } function getInteriorModule(decl) { - return decl.body.kind === 230 ? getInteriorModule(decl.body) : decl; + return decl.body.kind === 232 ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 142; + return !member.name || member.name.kind === 143; } function getNodeSpan(node) { - return node.kind === 261 + return node.kind === 264 ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) - : ts.createTextSpanFromBounds(node.getStart(curSourceFile), node.getEnd()); + : ts.createTextSpanFromNode(node, curSourceFile); + } + function getModifiers(node) { + if (node.parent && node.parent.kind === 225) { + node = node.parent; + } + return ts.getNodeModifiers(node); } function getFunctionOrClassName(node) { if (node.name && ts.getFullWidth(node.name) > 0) { return ts.declarationNameToString(node.name); } - else if (node.parent.kind === 223) { + else if (node.parent.kind === 225) { return ts.declarationNameToString(node.parent.name); } - else if (node.parent.kind === 192 && + else if (node.parent.kind === 193 && node.parent.operatorToken.kind === 57) { return nodeText(node.parent.left).replace(whiteSpaceRegex, ""); } - else if (node.parent.kind === 257 && node.parent.name) { + else if (node.parent.kind === 260 && node.parent.name) { return nodeText(node.parent.name); } else if (ts.getModifierFlags(node) & 512) { @@ -58265,38 +64594,37 @@ var ts; } } function isFunctionOrClassExpression(node) { - return node.kind === 184 || node.kind === 185 || node.kind === 197; + return node.kind === 185 || node.kind === 186 || node.kind === 198; } - var whiteSpaceRegex = /\s+/g; })(NavigationBar = ts.NavigationBar || (ts.NavigationBar = {})); })(ts || (ts = {})); var ts; (function (ts) { var OutliningElementsCollector; (function (OutliningElementsCollector) { - function collectElements(sourceFile) { + function collectElements(sourceFile, cancellationToken) { var elements = []; var collapseText = "..."; function addOutliningSpan(hintSpanNode, startElement, endElement, autoCollapse) { if (hintSpanNode && startElement && endElement) { - var span_12 = { + var span_13 = { textSpan: ts.createTextSpanFromBounds(startElement.pos, endElement.end), - hintSpan: ts.createTextSpanFromBounds(hintSpanNode.getStart(), hintSpanNode.end), + hintSpan: ts.createTextSpanFromNode(hintSpanNode, sourceFile), bannerText: collapseText, autoCollapse: autoCollapse }; - elements.push(span_12); + elements.push(span_13); } } function addOutliningSpanComments(commentSpan, autoCollapse) { if (commentSpan) { - var span_13 = { + var span_14 = { textSpan: ts.createTextSpanFromBounds(commentSpan.pos, commentSpan.end), hintSpan: ts.createTextSpanFromBounds(commentSpan.pos, commentSpan.end), bannerText: collapseText, autoCollapse: autoCollapse }; - elements.push(span_13); + elements.push(span_14); } } function addOutliningForLeadingCommentsForNode(n) { @@ -58308,6 +64636,7 @@ var ts; var singleLineCommentCount = 0; for (var _i = 0, comments_4 = comments; _i < comments_4.length; _i++) { var currentComment = comments_4[_i]; + cancellationToken.throwIfCancellationRequested(); if (currentComment.kind === 2) { if (isFirstSingleLineComment) { firstSingleLineCommentStart = currentComment.pos; @@ -58330,19 +64659,20 @@ var ts; function combineAndAddMultipleSingleLineComments(count, start, end) { if (count > 1) { var multipleSingleLineComments = { + kind: 2, pos: start, end: end, - kind: 2 }; addOutliningSpanComments(multipleSingleLineComments, false); } } function autoCollapse(node) { - return ts.isFunctionBlock(node) && node.parent.kind !== 185; + return ts.isFunctionBlock(node) && node.parent.kind !== 186; } var depth = 0; var maxDepth = 20; function walk(n) { + cancellationToken.throwIfCancellationRequested(); if (depth > maxDepth) { return; } @@ -58350,26 +64680,26 @@ var ts; addOutliningForLeadingCommentsForNode(n); } switch (n.kind) { - case 204: + case 206: if (!ts.isFunctionBlock(n)) { - var parent_19 = n.parent; + var parent = n.parent; var openBrace = ts.findChildOfKind(n, 16, sourceFile); var closeBrace = ts.findChildOfKind(n, 17, sourceFile); - if (parent_19.kind === 209 || - parent_19.kind === 212 || - parent_19.kind === 213 || - parent_19.kind === 211 || - parent_19.kind === 208 || - parent_19.kind === 210 || - parent_19.kind === 217 || - parent_19.kind === 256) { - addOutliningSpan(parent_19, openBrace, closeBrace, autoCollapse(n)); + if (parent.kind === 211 || + parent.kind === 214 || + parent.kind === 215 || + parent.kind === 213 || + parent.kind === 210 || + parent.kind === 212 || + parent.kind === 219 || + parent.kind === 259) { + addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); break; } - if (parent_19.kind === 221) { - var tryStatement = parent_19; + if (parent.kind === 223) { + var tryStatement = parent; if (tryStatement.tryBlock === n) { - addOutliningSpan(parent_19, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); break; } else if (tryStatement.finallyBlock === n) { @@ -58380,32 +64710,32 @@ var ts; } } } - var span_14 = ts.createTextSpanFromBounds(n.getStart(), n.end); + var span_15 = ts.createTextSpanFromNode(n); elements.push({ - textSpan: span_14, - hintSpan: span_14, + textSpan: span_15, + hintSpan: span_15, bannerText: collapseText, autoCollapse: autoCollapse(n) }); break; } - case 231: { + case 233: { var openBrace = ts.findChildOfKind(n, 16, sourceFile); var closeBrace = ts.findChildOfKind(n, 17, sourceFile); addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); break; } - case 226: - case 227: + case 228: case 229: - case 176: - case 232: { + case 231: + case 177: + case 234: { var openBrace = ts.findChildOfKind(n, 16, sourceFile); var closeBrace = ts.findChildOfKind(n, 17, sourceFile); addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); break; } - case 175: + case 176: var openBracket = ts.findChildOfKind(n, 20, sourceFile); var closeBracket = ts.findChildOfKind(n, 21, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); @@ -58482,10 +64812,11 @@ var ts; return totalMatch; } function getWordSpans(word) { - if (!(word in stringToWordSpans)) { - stringToWordSpans[word] = breakIntoWordSpans(word); + var spans = stringToWordSpans.get(word); + if (!spans) { + stringToWordSpans.set(word, spans = breakIntoWordSpans(word)); } - return stringToWordSpans[word]; + return spans; } function matchTextChunk(candidate, chunk, punctuationStripped) { var index = indexOfIgnoringCase(candidate, chunk.textLowerCase); @@ -58502,9 +64833,9 @@ var ts; if (index > 0) { var wordSpans = getWordSpans(candidate); for (var _i = 0, wordSpans_1 = wordSpans; _i < wordSpans_1.length; _i++) { - var span_15 = wordSpans_1[_i]; - if (partStartsWith(candidate, span_15, chunk.text, true)) { - return createPatternMatch(PatternMatchKind.substring, punctuationStripped, partStartsWith(candidate, span_15, chunk.text, false)); + var span_16 = wordSpans_1[_i]; + if (partStartsWith(candidate, span_16, chunk.text, true)) { + return createPatternMatch(PatternMatchKind.substring, punctuationStripped, partStartsWith(candidate, span_16, chunk.text, false)); } } } @@ -58667,7 +64998,8 @@ var ts; return str === str.toLowerCase(); } function indexOfIgnoringCase(string, value) { - for (var i = 0, n = string.length - value.length; i <= n; i++) { + var n = string.length - value.length; + for (var i = 0; i <= n; i++) { if (startsWithIgnoringCase(string, value, i)) { return i; } @@ -58675,7 +65007,7 @@ var ts; return -1; } function startsWithIgnoringCase(string, value, start) { - for (var i = 0, n = value.length; i < n; i++) { + for (var i = 0; i < value.length; i++) { var ch1 = toLowerCase(string.charCodeAt(i + start)); var ch2 = value.charCodeAt(i); if (ch1 !== ch2) { @@ -58743,7 +65075,7 @@ var ts; function breakIntoSpans(identifier, word) { var result = []; var wordStart = 0; - for (var i = 1, n = identifier.length; i < n; i++) { + for (var i = 1; i < identifier.length; i++) { var lastIsDigit = isDigit(identifier.charCodeAt(i - 1)); var currentIsDigit = isDigit(identifier.charCodeAt(i)); var hasTransitionFromLowerToUpper = transitionFromLowerToUpper(identifier, word, i); @@ -58917,7 +65249,7 @@ var ts; else { if (token === 70 || ts.isKeyword(token)) { token = nextToken(); - if (token === 138) { + if (token === 139) { token = nextToken(); if (token === 9) { recordModuleName(); @@ -58943,7 +65275,7 @@ var ts; } if (token === 17) { token = nextToken(); - if (token === 138) { + if (token === 139) { token = nextToken(); if (token === 9) { recordModuleName(); @@ -58957,7 +65289,7 @@ var ts; token = nextToken(); if (token === 70 || ts.isKeyword(token)) { token = nextToken(); - if (token === 138) { + if (token === 139) { token = nextToken(); if (token === 9) { recordModuleName(); @@ -58983,7 +65315,7 @@ var ts; } if (token === 17) { token = nextToken(); - if (token === 138) { + if (token === 139) { token = nextToken(); if (token === 9) { recordModuleName(); @@ -58993,7 +65325,7 @@ var ts; } else if (token === 38) { token = nextToken(); - if (token === 138) { + if (token === 139) { token = nextToken(); if (token === 9) { recordModuleName(); @@ -59120,90 +65452,85 @@ var ts; var Rename; (function (Rename) { function getRenameInfo(typeChecker, defaultLibFileName, getCanonicalFileName, sourceFile, position) { - var canonicalDefaultLibName = getCanonicalFileName(ts.normalizePath(defaultLibFileName)); + var getCanonicalDefaultLibName = ts.memoize(function () { return getCanonicalFileName(ts.normalizePath(defaultLibFileName)); }); var node = ts.getTouchingWord(sourceFile, position, true); - if (node) { - if (node.kind === 70 || - node.kind === 9 || - ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || - ts.isThis(node)) { - var symbol = typeChecker.getSymbolAtLocation(node); - if (symbol) { - var declarations = symbol.getDeclarations(); - if (declarations && declarations.length > 0) { - if (ts.forEach(declarations, isDefinedInLibraryFile)) { - return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library)); - } - var displayName = ts.stripQuotes(ts.getDeclaredName(typeChecker, symbol, node)); - var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - if (kind) { - return { - canRename: true, - kind: kind, - displayName: displayName, - localizedErrorMessage: undefined, - fullDisplayName: typeChecker.getFullyQualifiedName(symbol), - kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), - triggerSpan: createTriggerSpanForNode(node, sourceFile) - }; - } - } - } - else if (node.kind === 9) { - var type = ts.getStringLiteralTypeForNode(node, typeChecker); - if (type) { - if (isDefinedInLibraryFile(node)) { - return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library)); - } - else { - var displayName = ts.stripQuotes(type.text); - return { - canRename: true, - kind: ts.ScriptElementKind.variableElement, - displayName: displayName, - localizedErrorMessage: undefined, - fullDisplayName: displayName, - kindModifiers: ts.ScriptElementKindModifier.none, - triggerSpan: createTriggerSpanForNode(node, sourceFile) - }; - } - } - } - } - } - return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_this_element)); - function getRenameInfoError(localizedErrorMessage) { - return { - canRename: false, - localizedErrorMessage: localizedErrorMessage, - displayName: undefined, - fullDisplayName: undefined, - kind: undefined, - kindModifiers: undefined, - triggerSpan: undefined - }; - } + var renameInfo = node && nodeIsEligibleForRename(node) + ? getRenameInfoForNode(node, typeChecker, sourceFile, isDefinedInLibraryFile) + : undefined; + return renameInfo || getRenameInfoError(ts.Diagnostics.You_cannot_rename_this_element); function isDefinedInLibraryFile(declaration) { - if (defaultLibFileName) { - var sourceFile_1 = declaration.getSourceFile(); - var canonicalName = getCanonicalFileName(ts.normalizePath(sourceFile_1.fileName)); - if (canonicalName === canonicalDefaultLibName) { - return true; - } + if (!defaultLibFileName) { + return false; } - return false; - } - function createTriggerSpanForNode(node, sourceFile) { - var start = node.getStart(sourceFile); - var width = node.getWidth(sourceFile); - if (node.kind === 9) { - start += 1; - width -= 2; - } - return ts.createTextSpan(start, width); + var sourceFile = declaration.getSourceFile(); + var canonicalName = getCanonicalFileName(ts.normalizePath(sourceFile.fileName)); + return canonicalName === getCanonicalDefaultLibName(); } } Rename.getRenameInfo = getRenameInfo; + function getRenameInfoForNode(node, typeChecker, sourceFile, isDefinedInLibraryFile) { + var symbol = typeChecker.getSymbolAtLocation(node); + if (symbol) { + var declarations = symbol.getDeclarations(); + if (declarations && declarations.length > 0) { + if (ts.some(declarations, isDefinedInLibraryFile)) { + return getRenameInfoError(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); + } + if (node.kind === 70 && + node.originalKeywordKind === 78 && + symbol.parent.flags & 1536) { + return undefined; + } + var displayName = ts.stripQuotes(ts.getDeclaredName(typeChecker, symbol, node)); + var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); + return kind ? getRenameInfoSuccess(displayName, typeChecker.getFullyQualifiedName(symbol), kind, ts.SymbolDisplay.getSymbolModifiers(symbol), node, sourceFile) : undefined; + } + } + else if (node.kind === 9) { + if (isDefinedInLibraryFile(node)) { + return getRenameInfoError(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); + } + var displayName = ts.stripQuotes(node.text); + return getRenameInfoSuccess(displayName, displayName, ts.ScriptElementKind.variableElement, ts.ScriptElementKindModifier.none, node, sourceFile); + } + } + function getRenameInfoSuccess(displayName, fullDisplayName, kind, kindModifiers, node, sourceFile) { + return { + canRename: true, + kind: kind, + displayName: displayName, + localizedErrorMessage: undefined, + fullDisplayName: fullDisplayName, + kindModifiers: kindModifiers, + triggerSpan: createTriggerSpanForNode(node, sourceFile) + }; + } + function getRenameInfoError(diagnostic) { + return { + canRename: false, + localizedErrorMessage: ts.getLocaleSpecificMessage(diagnostic), + displayName: undefined, + fullDisplayName: undefined, + kind: undefined, + kindModifiers: undefined, + triggerSpan: undefined + }; + } + function createTriggerSpanForNode(node, sourceFile) { + var start = node.getStart(sourceFile); + var width = node.getWidth(sourceFile); + if (node.kind === 9) { + start += 1; + width -= 2; + } + return ts.createTextSpan(start, width); + } + function nodeIsEligibleForRename(node) { + return node.kind === 70 || + node.kind === 9 || + ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || + ts.isThis(node); + } })(Rename = ts.Rename || (ts.Rename = {})); })(ts || (ts = {})); var ts; @@ -59211,6 +65538,13 @@ var ts; var SignatureHelp; (function (SignatureHelp) { var emptyArray = []; + var ArgumentListKind; + (function (ArgumentListKind) { + ArgumentListKind[ArgumentListKind["TypeArguments"] = 0] = "TypeArguments"; + ArgumentListKind[ArgumentListKind["CallArguments"] = 1] = "CallArguments"; + ArgumentListKind[ArgumentListKind["TaggedTemplateArguments"] = 2] = "TaggedTemplateArguments"; + ArgumentListKind[ArgumentListKind["JSXAttributesArguments"] = 3] = "JSXAttributesArguments"; + })(ArgumentListKind = SignatureHelp.ArgumentListKind || (SignatureHelp.ArgumentListKind = {})); function getSignatureHelpItems(program, sourceFile, position, cancellationToken) { var typeChecker = program.getTypeChecker(); var startingToken = ts.findTokenOnLeftOfPosition(sourceFile, position); @@ -59236,14 +65570,14 @@ var ts; } SignatureHelp.getSignatureHelpItems = getSignatureHelpItems; function createJavaScriptSignatureHelpItems(argumentInfo, program) { - if (argumentInfo.invocation.kind !== 179) { + if (argumentInfo.invocation.kind !== 180) { return undefined; } var callExpression = argumentInfo.invocation; var expression = callExpression.expression; var name = expression.kind === 70 ? expression - : expression.kind === 177 + : expression.kind === 178 ? expression.name : undefined; if (!name || !name.text) { @@ -59253,10 +65587,10 @@ var ts; for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { var sourceFile = _a[_i]; var nameToDeclarations = sourceFile.getNamedDeclarations(); - var declarations = nameToDeclarations[name.text]; + var declarations = nameToDeclarations.get(name.text); if (declarations) { - for (var _b = 0, declarations_10 = declarations; _b < declarations_10.length; _b++) { - var declaration = declarations_10[_b]; + for (var _b = 0, declarations_13 = declarations; _b < declarations_13.length; _b++) { + var declaration = declarations_13[_b]; var symbol = declaration.symbol; if (symbol) { var type = typeChecker.getTypeOfSymbolAtLocation(symbol, declaration); @@ -59272,7 +65606,7 @@ var ts; } } function getImmediatelyContainingArgumentInfo(node, position, sourceFile) { - if (node.parent.kind === 179 || node.parent.kind === 180) { + if (node.parent.kind === 180 || node.parent.kind === 181) { var callExpression = node.parent; if (node.kind === 26 || node.kind === 18) { @@ -59304,23 +65638,23 @@ var ts; } return undefined; } - else if (node.kind === 12 && node.parent.kind === 181) { + else if (node.kind === 12 && node.parent.kind === 182) { if (ts.isInsideTemplateLiteral(node, position)) { return getArgumentListInfoForTemplate(node.parent, 0, sourceFile); } } - else if (node.kind === 13 && node.parent.parent.kind === 181) { + else if (node.kind === 13 && node.parent.parent.kind === 182) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 194); + ts.Debug.assert(templateExpression.kind === 195); var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } - else if (node.parent.kind === 202 && node.parent.parent.parent.kind === 181) { + else if (node.parent.kind === 204 && node.parent.parent.parent.kind === 182) { var templateSpan = node.parent; var templateExpression = templateSpan.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 194); + ts.Debug.assert(templateExpression.kind === 195); if (node.kind === 15 && !ts.isInsideTemplateLiteral(node, position)) { return undefined; } @@ -59328,8 +65662,20 @@ var ts; var argumentIndex = getArgumentIndexForTemplatePiece(spanIndex, node, position); return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } + else if (node.parent && ts.isJsxOpeningLikeElement(node.parent)) { + var attributeSpanStart = node.parent.attributes.getFullStart(); + var attributeSpanEnd = ts.skipTrivia(sourceFile.text, node.parent.attributes.getEnd(), false); + return { + kind: 3, + invocation: node.parent, + argumentsSpan: ts.createTextSpan(attributeSpanStart, attributeSpanEnd - attributeSpanStart), + argumentIndex: 0, + argumentCount: 1 + }; + } return undefined; } + SignatureHelp.getImmediatelyContainingArgumentInfo = getImmediatelyContainingArgumentInfo; function getArgumentIndex(argumentsList, node) { var argumentIndex = 0; var listChildren = argumentsList.getChildren(); @@ -59384,7 +65730,7 @@ var ts; var template = taggedTemplate.template; var applicableSpanStart = template.getStart(); var applicableSpanEnd = template.getEnd(); - if (template.kind === 194) { + if (template.kind === 195) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, false); @@ -59393,7 +65739,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node, position, sourceFile) { - for (var n = node; n.kind !== 261; n = n.parent) { + for (var n = node; n.kind !== 264; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } @@ -59476,7 +65822,8 @@ var ts; suffixDisplayParts: suffixDisplayParts, separatorDisplayParts: [ts.punctuationPart(25), ts.spacePart()], parameters: signatureHelpParameters, - documentation: candidateSignature.getDocumentationComment() + documentation: candidateSignature.getDocumentationComment(), + tags: candidateSignature.getJsDocTags() }; }); var argumentIndex = argumentListInfo.argumentIndex; @@ -59523,9 +65870,9 @@ var ts; var SymbolDisplay; (function (SymbolDisplay) { function getSymbolKind(typeChecker, symbol, location) { - var flags = symbol.getFlags(); + var flags = symbol.flags; if (flags & 32) - return ts.getDeclarationOfKind(symbol, 197) ? + return ts.getDeclarationOfKind(symbol, 198) ? ts.ScriptElementKind.localClassElement : ts.ScriptElementKind.classElement; if (flags & 384) return ts.ScriptElementKind.enumElement; @@ -59535,12 +65882,12 @@ var ts; return ts.ScriptElementKind.interfaceElement; if (flags & 262144) return ts.ScriptElementKind.typeParameterElement; - var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, flags, location); + var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location); if (result === ts.ScriptElementKind.unknown) { if (flags & 262144) return ts.ScriptElementKind.typeParameterElement; if (flags & 8) - return ts.ScriptElementKind.variableElement; + return ts.ScriptElementKind.enumMemberElement; if (flags & 8388608) return ts.ScriptElementKind.alias; if (flags & 1536) @@ -59549,7 +65896,7 @@ var ts; return result; } SymbolDisplay.getSymbolKind = getSymbolKind; - function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, flags, location) { + function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location) { if (typeChecker.isUndefinedSymbol(symbol)) { return ts.ScriptElementKind.variableElement; } @@ -59559,6 +65906,7 @@ var ts; if (location.kind === 98 && ts.isExpression(location)) { return ts.ScriptElementKind.parameterElement; } + var flags = symbol.flags; if (flags & 3) { if (ts.isFirstDeclarationOfSymbolParameter(symbol)) { return ts.ScriptElementKind.parameterElement; @@ -59582,7 +65930,7 @@ var ts; if (flags & 16384) return ts.ScriptElementKind.constructorImplementationElement; if (flags & 4) { - if (flags & 268435456) { + if (flags & 134217728 && symbol.checkFlags & 6) { var unionPropertyKind = ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) { var rootSymbolFlags = rootSymbol.getFlags(); if (rootSymbolFlags & (98308 | 3)) { @@ -59599,6 +65947,9 @@ var ts; } return unionPropertyKind; } + if (location.parent && ts.isJsxAttribute(location.parent)) { + return ts.ScriptElementKind.jsxAttribute; + } return ts.ScriptElementKind.memberVariableElement; } return ts.ScriptElementKind.unknown; @@ -59613,8 +65964,9 @@ var ts; if (semanticMeaning === void 0) { semanticMeaning = ts.getMeaningFromLocation(location); } var displayParts = []; var documentation; + var tags; var symbolFlags = symbol.flags; - var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, symbolFlags, location); + var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location); var hasAddedSymbolInfo; var isThisExpression = location.kind === 98 && ts.isExpression(location); var type; @@ -59625,26 +65977,29 @@ var ts; var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (type) { - if (location.parent && location.parent.kind === 177) { + if (location.parent && location.parent.kind === 178) { var right = location.parent.name; if (right === location || (right && right.getFullWidth() === 0)) { location = location.parent; } } - var callExpression = void 0; - if (location.kind === 179 || location.kind === 180) { - callExpression = location; + var callExpressionLike = void 0; + if (location.kind === 180 || location.kind === 181) { + callExpressionLike = location; } else if (ts.isCallExpressionTarget(location) || ts.isNewExpressionTarget(location)) { - callExpression = location.parent; + callExpressionLike = location.parent; } - if (callExpression) { + else if (location.parent && ts.isJsxOpeningLikeElement(location.parent) && ts.isFunctionLike(symbol.valueDeclaration)) { + callExpressionLike = location.parent; + } + if (callExpressionLike) { var candidateSignatures = []; - signature = typeChecker.getResolvedSignature(callExpression, candidateSignatures); + signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures); if (!signature && candidateSignatures.length) { signature = candidateSignatures[0]; } - var useConstructSignatures = callExpression.kind === 180 || callExpression.expression.kind === 96; + var useConstructSignatures = callExpressionLike.kind === 181 || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 96); var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { signature = allSignatures.length ? allSignatures[0] : undefined; @@ -59668,6 +66023,7 @@ var ts; addPrefixForAnyFunctionOrVar(symbol, symbolKind); } switch (symbolKind) { + case ts.ScriptElementKind.jsxAttribute: case ts.ScriptElementKind.memberVariableElement: case ts.ScriptElementKind.variableElement: case ts.ScriptElementKind.constElement: @@ -59692,21 +66048,21 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304)) || - (location.kind === 122 && location.parent.kind === 150)) { + (location.kind === 122 && location.parent.kind === 151)) { var functionDeclaration = location.parent; - var allSignatures = functionDeclaration.kind === 150 ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration.kind === 151 ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); } else { signature = allSignatures[0]; } - if (functionDeclaration.kind === 150) { + if (functionDeclaration.kind === 151) { symbolKind = ts.ScriptElementKind.constructorImplementationElement; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 153 && + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 154 && !(type.symbol.flags & 2048 || type.symbol.flags & 4096) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -59715,7 +66071,7 @@ var ts; } } if (symbolFlags & 32 && !hasAddedSymbolInfo && !isThisExpression) { - if (ts.getDeclarationOfKind(symbol, 197)) { + if (ts.getDeclarationOfKind(symbol, 198)) { pushTypePart(ts.ScriptElementKind.localClassElement); } else { @@ -59734,7 +66090,7 @@ var ts; } if (symbolFlags & 524288) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(136)); + displayParts.push(ts.keywordPart(137)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); @@ -59755,7 +66111,7 @@ var ts; } if (symbolFlags & 1536) { addNewLineIfDisplayPartsExist(); - var declaration = ts.getDeclarationOfKind(symbol, 230); + var declaration = ts.getDeclarationOfKind(symbol, 232); var isNamespace = declaration && declaration.name && declaration.name.kind === 70; displayParts.push(ts.keywordPart(isNamespace ? 128 : 127)); displayParts.push(ts.spacePart()); @@ -59774,25 +66130,25 @@ var ts; writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); } else { - var declaration = ts.getDeclarationOfKind(symbol, 143); + var declaration = ts.getDeclarationOfKind(symbol, 144); ts.Debug.assert(declaration !== undefined); declaration = declaration.parent; if (declaration) { if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); - if (declaration.kind === 154) { + if (declaration.kind === 155) { displayParts.push(ts.keywordPart(93)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 153 && declaration.name) { + else if (declaration.kind !== 154 && declaration.name) { addFullSymbolName(declaration.symbol); } ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32)); } - else if (declaration.kind === 228) { + else if (declaration.kind === 230) { addInPrefix(); - displayParts.push(ts.keywordPart(136)); + displayParts.push(ts.keywordPart(137)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -59801,9 +66157,10 @@ var ts; } } if (symbolFlags & 8) { + symbolKind = ts.ScriptElementKind.enumMemberElement; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 260) { + if (declaration.kind === 263) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -59815,7 +66172,7 @@ var ts; } if (symbolFlags & 8388608) { addNewLineIfDisplayPartsExist(); - if (symbol.declarations[0].kind === 233) { + if (symbol.declarations[0].kind === 235) { displayParts.push(ts.keywordPart(83)); displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(128)); @@ -59826,7 +66183,7 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 234) { + if (declaration.kind === 236) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); @@ -59861,6 +66218,7 @@ var ts; addPrefixForAnyFunctionOrVar(symbol, symbolKind); } if (symbolKind === ts.ScriptElementKind.memberVariableElement || + symbolKind === ts.ScriptElementKind.jsxAttribute || symbolFlags & 3 || symbolKind === ts.ScriptElementKind.localVariableElement || isThisExpression) { @@ -59893,11 +66251,12 @@ var ts; } if (!documentation) { documentation = symbol.getDocumentationComment(); + tags = symbol.getJsDocTags(); if (documentation.length === 0 && symbol.flags & 4) { - if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 261; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 264; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 192) { + if (!declaration.parent || declaration.parent.kind !== 193) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -59905,6 +66264,7 @@ var ts; continue; } documentation = rhsSymbol.getDocumentationComment(); + tags = rhsSymbol.getJsDocTags(); if (documentation.length > 0) { break; } @@ -59912,7 +66272,7 @@ var ts; } } } - return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind }; + return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind, tags: tags }; function addNewLineIfDisplayPartsExist() { if (displayParts.length) { displayParts.push(ts.lineBreakPart()); @@ -59963,6 +66323,7 @@ var ts; displayParts.push(ts.punctuationPart(19)); } documentation = signature.getDocumentationComment(); + tags = signature.getJsDocTags(); } function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) { var typeParameterParts = ts.mapToDisplayParts(function (writer) { @@ -59977,14 +66338,14 @@ var ts; return false; } return ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 184) { + if (declaration.kind === 185) { return true; } - if (declaration.kind !== 223 && declaration.kind !== 225) { + if (declaration.kind !== 225 && declaration.kind !== 227) { return false; } - for (var parent_20 = declaration.parent; !ts.isFunctionBlock(parent_20); parent_20 = parent_20.parent) { - if (parent_20.kind === 261 || parent_20.kind === 231) { + for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { + if (parent.kind === 264 || parent.kind === 233) { return false; } } @@ -60019,7 +66380,7 @@ var ts; sourceFile.moduleName = transpileOptions.moduleName; } if (transpileOptions.renamedDependencies) { - sourceFile.renamedDependencies = ts.createMap(transpileOptions.renamedDependencies); + sourceFile.renamedDependencies = ts.createMapFromTemplate(transpileOptions.renamedDependencies); } var newLine = ts.getNewLineCharacter(options); var outputText; @@ -60065,10 +66426,10 @@ var ts; var commandLineOptionsStringToEnum; function fixupCompilerOptions(options, diagnostics) { commandLineOptionsStringToEnum = commandLineOptionsStringToEnum || ts.filter(ts.optionDeclarations, function (o) { - return typeof o.type === "object" && !ts.forEachProperty(o.type, function (v) { return typeof v !== "number"; }); + return typeof o.type === "object" && !ts.forEachEntry(o.type, function (v) { return typeof v !== "number"; }); }); options = ts.clone(options); - var _loop_4 = function (opt) { + var _loop_5 = function (opt) { if (!ts.hasProperty(options, opt.name)) { return "continue"; } @@ -60077,17 +66438,18 @@ var ts; options[opt.name] = ts.parseCustomTypeOption(opt, value, diagnostics); } else { - if (!ts.forEachProperty(opt.type, function (v) { return v === value; })) { + if (!ts.forEachEntry(opt.type, function (v) { return v === value; })) { diagnostics.push(ts.createCompilerDiagnosticForInvalidCustomType(opt)); } } }; for (var _i = 0, commandLineOptionsStringToEnum_1 = commandLineOptionsStringToEnum; _i < commandLineOptionsStringToEnum_1.length; _i++) { var opt = commandLineOptionsStringToEnum_1[_i]; - _loop_4(opt); + _loop_5(opt); } return options; } + ts.fixupCompilerOptions = fixupCompilerOptions; })(ts || (ts = {})); var ts; (function (ts) { @@ -60096,10 +66458,19 @@ var ts; var standardScanner = ts.createScanner(5, false, 0); var jsxScanner = ts.createScanner(5, false, 1); var scanner; - function getFormattingScanner(sourceFile, startPos, endPos) { + var ScanAction; + (function (ScanAction) { + ScanAction[ScanAction["Scan"] = 0] = "Scan"; + ScanAction[ScanAction["RescanGreaterThanToken"] = 1] = "RescanGreaterThanToken"; + ScanAction[ScanAction["RescanSlashToken"] = 2] = "RescanSlashToken"; + ScanAction[ScanAction["RescanTemplateToken"] = 3] = "RescanTemplateToken"; + ScanAction[ScanAction["RescanJsxIdentifier"] = 4] = "RescanJsxIdentifier"; + ScanAction[ScanAction["RescanJsxText"] = 5] = "RescanJsxText"; + })(ScanAction || (ScanAction = {})); + function getFormattingScanner(text, languageVariant, startPos, endPos) { ts.Debug.assert(scanner === undefined, "Scanner should be undefined"); - scanner = sourceFile.languageVariant === 1 ? jsxScanner : standardScanner; - scanner.setText(sourceFile.text); + scanner = languageVariant === 1 ? jsxScanner : standardScanner; + scanner.setText(text); scanner.setTextPos(startPos); var wasNewLine = true; var leadingTrivia; @@ -60175,10 +66546,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { + case 252: case 250: - case 248: + case 251: case 249: - case 247: return node.kind === 70; } } @@ -60287,8 +66658,8 @@ var ts; } function isOnToken() { ts.Debug.assert(scanner !== undefined); - var current = (lastTokenInfo && lastTokenInfo.token.kind) || scanner.getToken(); - var startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); + var current = lastTokenInfo ? lastTokenInfo.token.kind : scanner.getToken(); + var startPos = lastTokenInfo ? lastTokenInfo.token.pos : scanner.getStartPos(); return startPos < endPos && current !== 1 && !ts.isTrivia(current); } function fixTokenKind(tokenInfo, container) { @@ -60389,6 +66760,20 @@ var ts; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); var ts; +(function (ts) { + var formatting; + (function (formatting) { + var FormattingRequestKind; + (function (FormattingRequestKind) { + FormattingRequestKind[FormattingRequestKind["FormatDocument"] = 0] = "FormatDocument"; + FormattingRequestKind[FormattingRequestKind["FormatSelection"] = 1] = "FormatSelection"; + FormattingRequestKind[FormattingRequestKind["FormatOnEnter"] = 2] = "FormatOnEnter"; + FormattingRequestKind[FormattingRequestKind["FormatOnSemicolon"] = 3] = "FormatOnSemicolon"; + FormattingRequestKind[FormattingRequestKind["FormatOnClosingCurlyBrace"] = 4] = "FormatOnClosingCurlyBrace"; + })(FormattingRequestKind = formatting.FormattingRequestKind || (formatting.FormattingRequestKind = {})); + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; (function (ts) { var formatting; (function (formatting) { @@ -60410,6 +66795,19 @@ var ts; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); var ts; +(function (ts) { + var formatting; + (function (formatting) { + var RuleAction; + (function (RuleAction) { + RuleAction[RuleAction["Ignore"] = 1] = "Ignore"; + RuleAction[RuleAction["Space"] = 2] = "Space"; + RuleAction[RuleAction["NewLine"] = 4] = "NewLine"; + RuleAction[RuleAction["Delete"] = 8] = "Delete"; + })(RuleAction = formatting.RuleAction || (formatting.RuleAction = {})); + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; (function (ts) { var formatting; (function (formatting) { @@ -60440,6 +66838,17 @@ var ts; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); var ts; +(function (ts) { + var formatting; + (function (formatting) { + var RuleFlags; + (function (RuleFlags) { + RuleFlags[RuleFlags["None"] = 0] = "None"; + RuleFlags[RuleFlags["CanDeleteNewLines"] = 1] = "CanDeleteNewLines"; + })(RuleFlags = formatting.RuleFlags || (formatting.RuleFlags = {})); + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; (function (ts) { var formatting; (function (formatting) { @@ -60511,10 +66920,10 @@ var ts; this.SpaceAfterQuestionMarkInConditionalOperator = new formatting.Rule(formatting.RuleDescriptor.create3(54, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsConditionalOperatorContext), 2)); this.NoSpaceAfterQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create3(54, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); this.SpaceAfterSemicolon = new formatting.Rule(formatting.RuleDescriptor.create3(24, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); - this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2)); + this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17, formatting.Shared.TokenRange.FromRange(0, 141, [19])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2)); this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(17, 81), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(17, 105), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); - this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17, formatting.Shared.TokenRange.FromTokens([19, 21, 25, 24])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); + this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17, formatting.Shared.TokenRange.FromTokens([21, 25, 24])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); this.NoSpaceBeforeDot = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 22), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); this.NoSpaceAfterDot = new formatting.Rule(formatting.RuleDescriptor.create3(22, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); this.NoSpaceBeforeOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); @@ -60525,10 +66934,10 @@ var ts; this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1); this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([19, 3, 80, 101, 86, 81]); this.SpaceBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1); - this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2)); - this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2)); - this.NoSpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 8)); - this.NoSpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 8)); + this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsBraceWrappedContext), 2)); + this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsBraceWrappedContext), 2)); + this.NoSpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); + this.NoSpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); this.NoSpaceBetweenEmptyBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(16, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsObjectContext), 8)); this.NewLineAfterOpenBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4)); this.NewLineBeforeCloseBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.AnyIncludingMultilineComments, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4)); @@ -60548,18 +66957,20 @@ var ts; this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([109, 75]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2)); this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionCallOrNewContext, Rules.IsPreviousTokenNotComma), 8)); this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(88, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); + this.SpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionDeclContext), 2)); this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionDeclContext), 8)); this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(104, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsVoidOpContext), 2)); this.NoSpaceBetweenReturnAndSemicolon = new formatting.Rule(formatting.RuleDescriptor.create1(95, 24), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); this.SpaceBetweenStatements = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([19, 80, 81, 72]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonJsxElementContext, Rules.IsNotForContext), 2)); this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([101, 86]), 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); - this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([124, 133]), 70), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); + this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([124, 134]), 70), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); this.SpaceBeforeBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryKeywordOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.SpaceAfterBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryKeywordOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2)); + this.SpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(122, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); this.NoSpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(122, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([127, 131]), 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); - this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([116, 74, 123, 78, 82, 83, 84, 124, 107, 90, 108, 127, 128, 111, 113, 112, 133, 114, 136, 138]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); - this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([84, 107, 138])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); + this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([116, 74, 123, 78, 82, 83, 84, 124, 107, 90, 108, 127, 128, 111, 113, 112, 130, 134, 114, 137, 139, 126]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); + this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([84, 107, 139])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(9, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2)); this.SpaceBeforeArrow = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 35), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); this.SpaceAfterArrow = new formatting.Rule(formatting.RuleDescriptor.create3(35, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); @@ -60573,7 +66984,7 @@ var ts; this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(16, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsObjectTypeContext), 8)); this.SpaceBeforeAt = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 56), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2)); this.NoSpaceAfterAt = new formatting.Rule(formatting.RuleDescriptor.create3(56, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); - this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([116, 70, 83, 78, 74, 114, 113, 111, 112, 124, 133, 20, 38])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2)); + this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([116, 70, 83, 78, 74, 114, 113, 111, 112, 124, 134, 20, 38])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2)); this.NoSpaceBetweenFunctionKeywordAndStar = new formatting.Rule(formatting.RuleDescriptor.create1(88, 38), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), 8)); this.SpaceAfterStarInGeneratorDeclaration = new formatting.Rule(formatting.RuleDescriptor.create3(38, formatting.Shared.TokenRange.FromTokens([70, 18])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), 2)); this.NoSpaceBetweenYieldKeywordAndStar = new formatting.Rule(formatting.RuleDescriptor.create1(115, 38), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsYieldOrYieldStarWithOperand), 8)); @@ -60586,6 +66997,7 @@ var ts; this.NoSpaceBeforeGreaterThanTokenInJsxOpeningElement = new formatting.Rule(formatting.RuleDescriptor.create1(40, 28), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxSelfClosingElementContext, Rules.IsNonJsxSameLineTokenContext), 8)); this.NoSpaceBeforeEqualInJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 57), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxAttributeContext, Rules.IsNonJsxSameLineTokenContext), 8)); this.NoSpaceAfterEqualInJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create3(57, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxAttributeContext, Rules.IsNonJsxSameLineTokenContext), 8)); + this.NoSpaceBeforeNonNullAssertionOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 50), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonNullAssertionContext), 8)); this.HighPriorityCommonRules = [ this.IgnoreBeforeComment, this.IgnoreAfterLineComment, this.NoSpaceBeforeColon, this.SpaceAfterColon, this.NoSpaceBeforeQuestionMark, this.SpaceAfterQuestionMarkInConditionalOperator, @@ -60614,7 +67026,7 @@ var ts; this.NoSpaceBetweenTagAndTemplateString, this.SpaceBeforeJsxAttribute, this.SpaceBeforeSlashInJsxOpeningElement, this.NoSpaceBeforeGreaterThanTokenInJsxOpeningElement, this.NoSpaceBeforeEqualInJsxAttribute, this.NoSpaceAfterEqualInJsxAttribute, - this.NoSpaceAfterConstructor, this.NoSpaceAfterModuleImport, + this.NoSpaceAfterModuleImport, this.SpaceAfterCertainTypeScriptKeywords, this.SpaceBeforeCertainTypeScriptKeywords, this.SpaceAfterModuleName, this.SpaceBeforeArrow, this.SpaceAfterArrow, @@ -60629,6 +67041,7 @@ var ts; this.SpaceBeforeAt, this.NoSpaceAfterAt, this.SpaceAfterDecorator, + this.NoSpaceBeforeNonNullAssertionOperator ]; this.LowPriorityCommonRules = [ this.NoSpaceBeforeSemicolon, @@ -60637,7 +67050,6 @@ var ts; this.NoSpaceBeforeOpenBracket, this.NoSpaceAfterCloseBracket, this.SpaceAfterSemicolon, - this.NoSpaceBeforeOpenParenInFuncDecl, this.SpaceBetweenStatements, this.SpaceAfterTryFinally ]; this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(25, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonJsxElementContext, Rules.IsNextTokenNotCloseBracket), 2)); @@ -60678,43 +67090,44 @@ var ts; } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name_48 in o) { - if (o[name_48] === rule) { - return name_48; + for (var name in o) { + if (o[name] === rule) { + return name; } } throw new Error("Unknown rule"); }; Rules.IsForContext = function (context) { - return context.contextNode.kind === 211; + return context.contextNode.kind === 213; }; Rules.IsNotForContext = function (context) { return !Rules.IsForContext(context); }; Rules.IsBinaryOpContext = function (context) { switch (context.contextNode.kind) { - case 192: case 193: - case 200: - case 243: - case 239: - case 156: - case 164: + case 194: + case 201: + case 245: + case 241: + case 157: case 165: + case 166: return true; - case 174: - case 228: - case 234: - case 223: - case 144: - case 260: + case 175: + case 230: + case 236: + case 225: + case 145: + case 263: + case 148: case 147: - case 146: return context.currentTokenSpan.kind === 57 || context.nextTokenSpan.kind === 57; - case 212: + case 214: + case 144: return context.currentTokenSpan.kind === 91 || context.nextTokenSpan.kind === 91; - case 213: - return context.currentTokenSpan.kind === 140 || context.nextTokenSpan.kind === 140; + case 215: + return context.currentTokenSpan.kind === 141 || context.nextTokenSpan.kind === 141; } return false; }; @@ -60722,11 +67135,14 @@ var ts; return !Rules.IsBinaryOpContext(context); }; Rules.IsConditionalOperatorContext = function (context) { - return context.contextNode.kind === 193; + return context.contextNode.kind === 194; }; Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { return context.TokensAreOnSameLine() || Rules.IsBeforeMultilineBlockContext(context); }; + Rules.IsBraceWrappedContext = function (context) { + return context.contextNode.kind === 173 || Rules.IsSingleLineBlockContext(context); + }; Rules.IsBeforeMultilineBlockContext = function (context) { return Rules.IsBeforeBlockContext(context) && !(context.NextNodeAllOnSameLine() || context.NextNodeBlockIsOnOneLine()); }; @@ -60747,90 +67163,96 @@ var ts; return true; } switch (node.kind) { - case 204: - case 232: - case 176: - case 231: + case 206: + case 234: + case 177: + case 233: return true; } return false; }; Rules.IsFunctionDeclContext = function (context) { switch (context.contextNode.kind) { - case 225: + case 227: + case 150: case 149: - case 148: - case 151: case 152: case 153: - case 184: - case 150: + case 154: case 185: - case 227: + case 151: + case 186: + case 229: return true; } return false; }; Rules.IsFunctionDeclarationOrFunctionExpressionContext = function (context) { - return context.contextNode.kind === 225 || context.contextNode.kind === 184; + return context.contextNode.kind === 227 || context.contextNode.kind === 185; }; Rules.IsTypeScriptDeclWithBlockContext = function (context) { return Rules.NodeIsTypeScriptDeclWithBlockContext(context.contextNode); }; Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { switch (node.kind) { - case 226: - case 197: - case 227: + case 228: + case 198: case 229: - case 161: - case 230: - case 241: - case 242: - case 235: - case 238: + case 231: + case 162: + case 232: + case 243: + case 244: + case 237: + case 240: return true; } return false; }; Rules.IsAfterCodeBlockContext = function (context) { switch (context.currentTokenParent.kind) { - case 226: - case 230: - case 229: - case 204: - case 256: + case 228: + case 232: case 231: - case 218: + case 259: + case 233: + case 220: return true; + case 206: { + var blockParent = context.currentTokenParent.parent; + if (blockParent.kind !== 186 && + blockParent.kind !== 185) { + return true; + } + } } return false; }; Rules.IsControlDeclContext = function (context) { switch (context.contextNode.kind) { - case 208: - case 218: - case 211: - case 212: - case 213: case 210: - case 221: - case 209: - case 217: - case 256: + case 220: + case 213: + case 214: + case 215: + case 212: + case 223: + case 211: + case 219: + case 259: return true; default: return false; } }; Rules.IsObjectContext = function (context) { - return context.contextNode.kind === 176; + return context.contextNode.kind === 177; }; Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind === 179; + return context.contextNode.kind === 180; }; Rules.IsNewContext = function (context) { - return context.contextNode.kind === 180; + return context.contextNode.kind === 181; }; Rules.IsFunctionCallOrNewContext = function (context) { return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); @@ -60842,25 +67264,25 @@ var ts; return context.nextTokenSpan.kind !== 21; }; Rules.IsArrowFunctionContext = function (context) { - return context.contextNode.kind === 185; + return context.contextNode.kind === 186; }; Rules.IsNonJsxSameLineTokenContext = function (context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 10; }; Rules.IsNonJsxElementContext = function (context) { - return context.contextNode.kind !== 246; + return context.contextNode.kind !== 248; }; Rules.IsJsxExpressionContext = function (context) { - return context.contextNode.kind === 252; + return context.contextNode.kind === 255; }; Rules.IsNextTokenParentJsxAttribute = function (context) { - return context.nextTokenParent.kind === 250; + return context.nextTokenParent.kind === 252; }; Rules.IsJsxAttributeContext = function (context) { - return context.contextNode.kind === 250; + return context.contextNode.kind === 252; }; Rules.IsJsxSelfClosingElementContext = function (context) { - return context.contextNode.kind === 247; + return context.contextNode.kind === 249; }; Rules.IsNotBeforeBlockInFunctionDeclarationContext = function (context) { return !Rules.IsFunctionDeclContext(context) && !Rules.IsBeforeBlockContext(context); @@ -60875,41 +67297,42 @@ var ts; while (ts.isPartOfExpression(node)) { node = node.parent; } - return node.kind === 145; + return node.kind === 146; }; Rules.IsStartOfVariableDeclarationList = function (context) { - return context.currentTokenParent.kind === 224 && + return context.currentTokenParent.kind === 226 && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; }; Rules.IsNotFormatOnEnter = function (context) { return context.formattingRequestKind !== 2; }; Rules.IsModuleDeclContext = function (context) { - return context.contextNode.kind === 230; + return context.contextNode.kind === 232; }; Rules.IsObjectTypeContext = function (context) { - return context.contextNode.kind === 161; + return context.contextNode.kind === 162; }; Rules.IsTypeArgumentOrParameterOrAssertion = function (token, parent) { if (token.kind !== 26 && token.kind !== 28) { return false; } switch (parent.kind) { - case 157: - case 182: - case 226: - case 197: + case 158: + case 183: + case 230: + case 228: + case 198: + case 229: case 227: - case 225: - case 184: case 185: + case 186: + case 150: case 149: - case 148: - case 153: case 154: - case 179: + case 155: case 180: - case 199: + case 181: + case 200: return true; default: return false; @@ -60920,13 +67343,16 @@ var ts; Rules.IsTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); }; Rules.IsTypeAssertionContext = function (context) { - return context.contextNode.kind === 182; + return context.contextNode.kind === 183; }; Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 104 && context.currentTokenParent.kind === 188; + return context.currentTokenSpan.kind === 104 && context.currentTokenParent.kind === 189; }; Rules.IsYieldOrYieldStarWithOperand = function (context) { - return context.contextNode.kind === 195 && context.contextNode.expression !== undefined; + return context.contextNode.kind === 196 && context.contextNode.expression !== undefined; + }; + Rules.IsNonNullAssertionContext = function (context) { + return context.contextNode.kind === 202; }; return Rules; }()); @@ -60948,7 +67374,7 @@ var ts; return result; }; RulesMap.prototype.Initialize = function (rules) { - this.mapRowLength = 140 + 1; + this.mapRowLength = 141 + 1; this.map = new Array(this.mapRowLength * this.mapRowLength); var rulesBucketConstructionStateList = new Array(this.map.length); this.FillRules(rules, rulesBucketConstructionStateList); @@ -60961,7 +67387,7 @@ var ts; }); }; RulesMap.prototype.GetRuleBucketIndex = function (row, column) { - ts.Debug.assert(row <= 140 && column <= 140, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 141 && column <= 141, "Must compute formatting context from tokens"); var rulesBucketIndex = (row * this.mapRowLength) + column; return rulesBucketIndex; }; @@ -61125,7 +67551,7 @@ var ts; } TokenAllAccess.prototype.GetTokens = function () { var result = []; - for (var token = 0; token <= 140; token++) { + for (var token = 0; token <= 141; token++) { result.push(token); } return result; @@ -61169,9 +67595,9 @@ var ts; }()); TokenRange.Any = TokenRange.AllTokens(); TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3])); - TokenRange.Keywords = TokenRange.FromRange(71, 140); + TokenRange.Keywords = TokenRange.FromRange(71, 141); TokenRange.BinaryOperators = TokenRange.FromRange(26, 69); - TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([91, 92, 140, 117, 125]); + TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([91, 92, 141, 117, 125]); TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([42, 43, 51, 50]); TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([8, 70, 18, 20, 16, 98, 93]); TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([70, 18, 98, 93]); @@ -61179,7 +67605,7 @@ var ts; TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([70, 18, 98, 93]); TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([70, 19, 21, 93]); TokenRange.Comments = TokenRange.FromTokens([2, 3]); - TokenRange.TypeNames = TokenRange.FromTokens([70, 132, 134, 121, 135, 104, 118]); + TokenRange.TypeNames = TokenRange.FromTokens([70, 132, 135, 121, 136, 104, 118]); Shared.TokenRange = TokenRange; })(Shared = formatting.Shared || (formatting.Shared = {})); })(formatting = ts.formatting || (ts.formatting = {})); @@ -61201,6 +67627,9 @@ var ts; RulesProvider.prototype.getRulesMap = function () { return this.rulesMap; }; + RulesProvider.prototype.getFormatOptions = function () { + return this.options; + }; RulesProvider.prototype.ensureUpToDate = function (options) { if (!this.options || !ts.compareDataObjects(this.options, options)) { var activeRules = this.createActiveRules(options); @@ -61212,6 +67641,12 @@ var ts; }; RulesProvider.prototype.createActiveRules = function (options) { var rules = this.globalRules.HighPriorityCommonRules.slice(0); + if (options.insertSpaceAfterConstructor) { + rules.push(this.globalRules.SpaceAfterConstructor); + } + else { + rules.push(this.globalRules.NoSpaceAfterConstructor); + } if (options.insertSpaceAfterCommaDelimiter) { rules.push(this.globalRules.SpaceAfterComma); } @@ -61290,6 +67725,12 @@ var ts; rules.push(this.globalRules.NoSpaceBeforeBinaryOperator); rules.push(this.globalRules.NoSpaceAfterBinaryOperator); } + if (options.insertSpaceBeforeFunctionParenthesis) { + rules.push(this.globalRules.SpaceBeforeOpenParenInFuncDecl); + } + else { + rules.push(this.globalRules.NoSpaceBeforeOpenParenInFuncDecl); + } if (options.placeOpenBraceOnNewLineForControlBlocks) { rules.push(this.globalRules.NewLineBeforeOpenBraceInControl); } @@ -61315,6 +67756,10 @@ var ts; (function (ts) { var formatting; (function (formatting) { + var Constants; + (function (Constants) { + Constants[Constants["Unknown"] = -1] = "Unknown"; + })(Constants || (Constants = {})); function formatOnEnter(position, sourceFile, rulesProvider, options) { var line = sourceFile.getLineAndCharacterOfPosition(position).line; if (line === 0) { @@ -61387,17 +67832,17 @@ var ts; } function isListElement(parent, node) { switch (parent.kind) { - case 226: - case 227: + case 228: + case 229: return ts.rangeContainsRange(parent.members, node); - case 230: + case 232: var body = parent.body; - return body && body.kind === 231 && ts.rangeContainsRange(body.statements, node); - case 261: - case 204: - case 231: + return body && body.kind === 233 && ts.rangeContainsRange(body.statements, node); + case 264: + case 206: + case 233: return ts.rangeContainsRange(parent.statements, node); - case 256: + case 259: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -61476,12 +67921,17 @@ var ts; } return 0; } + function formatNode(node, sourceFileLike, languageVariant, initialIndentation, delta, rulesProvider) { + var range = { pos: 0, end: sourceFileLike.text.length }; + return formatSpanWorker(range, node, initialIndentation, delta, formatting.getFormattingScanner(sourceFileLike.text, languageVariant, range.pos, range.end), rulesProvider.getFormatOptions(), rulesProvider, 1, function (_) { return false; }, sourceFileLike); + } + formatting.formatNode = formatNode; function formatSpan(originalRange, sourceFile, options, rulesProvider, requestKind) { - var rangeContainsError = prepareRangeContainsErrorFunction(sourceFile.parseDiagnostics, originalRange); - var formattingContext = new formatting.FormattingContext(sourceFile, requestKind); var enclosingNode = findEnclosingNode(originalRange, sourceFile); - var formattingScanner = formatting.getFormattingScanner(sourceFile, getScanStartPosition(enclosingNode, originalRange, sourceFile), originalRange.end); - var initialIndentation = formatting.SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, options); + return formatSpanWorker(originalRange, enclosingNode, formatting.SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, options), getOwnOrInheritedDelta(enclosingNode, options, sourceFile), formatting.getFormattingScanner(sourceFile.text, sourceFile.languageVariant, getScanStartPosition(enclosingNode, originalRange, sourceFile), originalRange.end), options, rulesProvider, requestKind, prepareRangeContainsErrorFunction(sourceFile.parseDiagnostics, originalRange), sourceFile); + } + function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delta, formattingScanner, options, rulesProvider, requestKind, rangeContainsError, sourceFile) { + var formattingContext = new formatting.FormattingContext(sourceFile, requestKind); var previousRangeHasError; var previousRange; var previousParent; @@ -61496,7 +67946,6 @@ var ts; if (enclosingNode.decorators) { undecoratedStartLine = sourceFile.getLineAndCharacterOfPosition(ts.getNonDecoratorTokenPosOfNode(enclosingNode, sourceFile)).line; } - var delta = getOwnOrInheritedDelta(enclosingNode, options, sourceFile); processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta); } if (!formattingScanner.isOnToken()) { @@ -61553,18 +68002,18 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 226: return 74; - case 227: return 108; - case 225: return 88; - case 229: return 229; - case 151: return 124; - case 152: return 133; - case 149: + case 228: return 74; + case 229: return 108; + case 227: return 88; + case 231: return 231; + case 152: return 124; + case 153: return 134; + case 150: if (node.asteriskToken) { return 38; } - case 147: - case 144: + case 148: + case 145: return node.name.kind; } } @@ -61588,17 +68037,30 @@ var ts; switch (kind) { case 16: case 17: - case 20: - case 21: case 18: case 19: case 81: case 105: case 56: return indentation; - default: - return nodeStartLine !== line ? indentation + getEffectiveDelta(delta, container) : indentation; + case 40: + case 28: { + if (container.kind === 250 || + container.kind === 251 || + container.kind === 249) { + return indentation; + } + break; + } + case 20: + case 21: { + if (container.kind !== 171) { + return indentation; + } + break; + } } + return nodeStartLine !== line ? indentation + getEffectiveDelta(delta, container) : indentation; }, getIndentation: function () { return indentation; }, getDelta: function (child) { return getEffectiveDelta(delta, child); }, @@ -61639,7 +68101,7 @@ var ts; if (tokenInfo.token.end > node.end) { break; } - consumeTokenAndAdvanceScanner(tokenInfo, node, nodeDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, node, nodeDynamicIndentation, node); } function processChildNode(child, inheritedIndentation, parent, parentDynamicIndentation, parentStartLine, undecoratedParentStartLine, isListItem, isFirstListItem) { var childStartPos = child.getStart(sourceFile); @@ -61669,7 +68131,7 @@ var ts; if (tokenInfo.token.end > childStartPos) { break; } - consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, node); } if (!formattingScanner.isOnToken()) { return inheritedIndentation; @@ -61680,11 +68142,11 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 145 ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 146 ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); childContextNode = node; - if (isFirstListItem && parent.kind === 175 && inheritedIndentation === -1) { + if (isFirstListItem && parent.kind === 176 && inheritedIndentation === -1) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -61704,10 +68166,10 @@ var ts; startLine = sourceFile.getLineAndCharacterOfPosition(tokenInfo.token.pos).line; var indentation_1 = computeIndentation(tokenInfo.token, startLine, -1, parent, parentDynamicIndentation, parentStartLine); listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, indentation_1.indentation, indentation_1.delta); - consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation, parent); } else { - consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation, parent); } } } @@ -61720,7 +68182,7 @@ var ts; if (formattingScanner.isOnToken()) { var tokenInfo = formattingScanner.readTokenInfo(parent); if (tokenInfo.token.kind === listEndToken && ts.rangeContainsRange(parent, tokenInfo.token)) { - consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation, parent); } } } @@ -61910,7 +68372,7 @@ var ts; startLine++; } var delta = indentation - nonWhitespaceColumnInFirstPart.column; - for (var i = startIndex, len = parts.length; i < len; i++, startLine++) { + for (var i = startIndex; i < parts.length; i++, startLine++) { var startLinePos_1 = ts.getStartPositionOfLine(startLine, sourceFile); var nonWhitespaceCharacterAndColumn = i === 0 ? nonWhitespaceColumnInFirstPart @@ -62000,12 +68462,12 @@ var ts; } function getOpenTokenForList(node, list) { switch (node.kind) { - case 150: - case 225: - case 184: - case 149: - case 148: + case 151: + case 227: case 185: + case 150: + case 149: + case 186: if (node.typeParameters === list) { return 26; } @@ -62013,8 +68475,8 @@ var ts; return 18; } break; - case 179: case 180: + case 181: if (node.typeArguments === list) { return 26; } @@ -62022,7 +68484,7 @@ var ts; return 18; } break; - case 157: + case 158: if (node.typeArguments === list) { return 26; } @@ -62095,7 +68557,12 @@ var ts; (function (formatting) { var SmartIndenter; (function (SmartIndenter) { - function getIndentation(position, sourceFile, options) { + var Value; + (function (Value) { + Value[Value["Unknown"] = -1] = "Unknown"; + })(Value || (Value = {})); + function getIndentation(position, sourceFile, options, assumeNewLineBeforeCloseBrace) { + if (assumeNewLineBeforeCloseBrace === void 0) { assumeNewLineBeforeCloseBrace = false; } if (position > sourceFile.text.length) { return getBaseIndentation(options); } @@ -62123,7 +68590,7 @@ var ts; var lineStart = ts.getLineStartPositionForPosition(current_1, sourceFile); return SmartIndenter.findFirstNonWhitespaceColumn(lineStart, current_1, sourceFile, options); } - if (precedingToken.kind === 25 && precedingToken.parent.kind !== 192) { + if (precedingToken.kind === 25 && precedingToken.parent.kind !== 193) { var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1) { return actualIndentation; @@ -62136,8 +68603,9 @@ var ts; while (current) { if (ts.positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current, previous)) { currentStart = getStartLineAndCharacterForNode(current, sourceFile); - if (nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile)) { - indentationDelta = 0; + var nextTokenKind = nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile); + if (nextTokenKind !== 0) { + indentationDelta = assumeNewLineBeforeCloseBrace && nextTokenKind === 2 ? options.indentSize : 0; } else { indentationDelta = lineAtPosition !== currentStart.line ? options.indentSize : 0; @@ -62225,31 +68693,37 @@ var ts; } function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) && - (parent.kind === 261 || !parentAndChildShareLine); + (parent.kind === 264 || !parentAndChildShareLine); if (!useActualIndentation) { return -1; } return findColumnForFirstNonWhitespaceCharacterInLine(currentLineAndChar, sourceFile, options); } + var NextTokenKind; + (function (NextTokenKind) { + NextTokenKind[NextTokenKind["Unknown"] = 0] = "Unknown"; + NextTokenKind[NextTokenKind["OpenBrace"] = 1] = "OpenBrace"; + NextTokenKind[NextTokenKind["CloseBrace"] = 2] = "CloseBrace"; + })(NextTokenKind || (NextTokenKind = {})); function nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile) { var nextToken = ts.findNextToken(precedingToken, current); if (!nextToken) { - return false; + return 0; } if (nextToken.kind === 16) { - return true; + return 1; } else if (nextToken.kind === 17) { var nextTokenStartLine = getStartLineAndCharacterForNode(nextToken, sourceFile).line; - return lineAtPosition === nextTokenStartLine; + return lineAtPosition === nextTokenStartLine ? 2 : 0; } - return false; + return 0; } function getStartLineAndCharacterForNode(n, sourceFile) { return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); } function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 208 && parent.elseStatement === child) { + if (parent.kind === 210 && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 81, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -62258,53 +68732,49 @@ var ts; return false; } SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement = childStartsOnTheSameLineWithElseInIfStatement; + function getListIfStartEndIsInListRange(list, start, end) { + return list && ts.rangeContainsStartEnd(list, start, end) ? list : undefined; + } function getContainingList(node, sourceFile) { if (node.parent) { switch (node.parent.kind) { - case 157: - if (node.parent.typeArguments && - ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { - return node.parent.typeArguments; - } - break; - case 176: + case 158: + return getListIfStartEndIsInListRange(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd()); + case 177: return node.parent.properties; - case 175: + case 176: return node.parent.elements; - case 225: - case 184: + case 227: case 185: + case 186: + case 150: case 149: - case 148: - case 153: - case 154: { + case 154: + case 151: + case 160: + case 155: { var start = node.getStart(sourceFile); - if (node.parent.typeParameters && - ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { - return node.parent.typeParameters; - } - if (ts.rangeContainsStartEnd(node.parent.parameters, start, node.getEnd())) { - return node.parent.parameters; - } - break; + return getListIfStartEndIsInListRange(node.parent.typeParameters, start, node.getEnd()) || + getListIfStartEndIsInListRange(node.parent.parameters, start, node.getEnd()); } - case 180: - case 179: { + case 228: + return getListIfStartEndIsInListRange(node.parent.typeParameters, node.getStart(sourceFile), node.getEnd()); + case 181: + case 180: { var start = node.getStart(sourceFile); - if (node.parent.typeArguments && - ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { - return node.parent.typeArguments; - } - if (node.parent.arguments && - ts.rangeContainsStartEnd(node.parent.arguments, start, node.getEnd())) { - return node.parent.arguments; - } - break; + return getListIfStartEndIsInListRange(node.parent.typeArguments, start, node.getEnd()) || + getListIfStartEndIsInListRange(node.parent.arguments, start, node.getEnd()); } + case 226: + return getListIfStartEndIsInListRange(node.parent.declarations, node.getStart(sourceFile), node.getEnd()); + case 240: + case 244: + return getListIfStartEndIsInListRange(node.parent.elements, node.getStart(sourceFile), node.getEnd()); } } return undefined; } + SmartIndenter.getContainingList = getContainingList; function getActualIndentationForListItem(node, sourceFile, options) { var containingList = getContainingList(node, sourceFile); return containingList ? getActualIndentationFromList(containingList) : -1; @@ -62317,8 +68787,8 @@ var ts; if (node.kind === 19) { return -1; } - if (node.parent && (node.parent.kind === 179 || - node.parent.kind === 180) && + if (node.parent && (node.parent.kind === 180 || + node.parent.kind === 181) && node.parent.expression !== node) { var fullCallOrNewExpression = node.parent.expression; var startingExpression = getStartingExpression(fullCallOrNewExpression); @@ -62336,10 +68806,10 @@ var ts; function getStartingExpression(node) { while (true) { switch (node.kind) { - case 179: case 180: - case 177: + case 181: case 178: + case 179: node = node.expression; break; default: @@ -62393,48 +68863,49 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 207: - case 226: - case 197: - case 227: - case 229: + case 209: case 228: - case 175: - case 204: + case 198: + case 229: case 231: + case 230: case 176: - case 161: - case 163: - case 232: - case 254: - case 253: - case 183: + case 206: + case 233: case 177: - case 179: + case 162: + case 171: + case 164: + case 234: + case 257: + case 256: + case 184: + case 178: case 180: - case 205: - case 223: - case 240: - case 216: - case 193: - case 173: - case 172: - case 248: - case 247: - case 252: - case 148: - case 153: - case 154: - case 144: - case 158: - case 159: - case 166: case 181: - case 189: + case 207: + case 225: case 242: - case 238: - case 243: - case 239: + case 218: + case 194: + case 174: + case 173: + case 250: + case 249: + case 255: + case 149: + case 154: + case 155: + case 145: + case 159: + case 160: + case 167: + case 182: + case 190: + case 244: + case 240: + case 245: + case 241: return true; } return false; @@ -62442,27 +68913,27 @@ var ts; function nodeWillIndentChild(parent, child, indentByDefault) { var childKind = child ? child.kind : 0; switch (parent.kind) { - case 209: - case 210: - case 212: - case 213: case 211: - case 208: - case 225: - case 184: - case 149: + case 212: + case 214: + case 215: + case 213: + case 210: + case 227: case 185: case 150: + case 186: case 151: case 152: - return childKind !== 204; - case 241: - return childKind !== 242; - case 235: - return childKind !== 236 || - (child.namedBindings && child.namedBindings.kind !== 238); - case 246: - return childKind !== 249; + case 153: + return childKind !== 206; + case 243: + return childKind !== 244; + case 237: + return childKind !== 238 || + (child.namedBindings && child.namedBindings.kind !== 240); + case 248: + return childKind !== 251; } return indentByDefault; } @@ -62475,10 +68946,503 @@ var ts; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); var ts; +(function (ts) { + var textChanges; + (function (textChanges) { + function getPos(n) { + return n["__pos"]; + } + function setPos(n, pos) { + n["__pos"] = pos; + } + function getEnd(n) { + return n["__end"]; + } + function setEnd(n, end) { + n["__end"] = end; + } + var Position; + (function (Position) { + Position[Position["FullStart"] = 0] = "FullStart"; + Position[Position["Start"] = 1] = "Start"; + })(Position = textChanges.Position || (textChanges.Position = {})); + function skipWhitespacesAndLineBreaks(text, start) { + return ts.skipTrivia(text, start, false, true); + } + function hasCommentsBeforeLineBreak(text, start) { + var i = start; + while (i < text.length) { + var ch = text.charCodeAt(i); + if (ts.isWhiteSpaceSingleLine(ch)) { + i++; + continue; + } + return ch === 47; + } + return false; + } + function getSeparatorCharacter(separator) { + return ts.tokenToString(separator.kind); + } + textChanges.getSeparatorCharacter = getSeparatorCharacter; + function getAdjustedStartPosition(sourceFile, node, options, position) { + if (options.useNonAdjustedStartPosition) { + return node.getFullStart(); + } + var fullStart = node.getFullStart(); + var start = node.getStart(sourceFile); + if (fullStart === start) { + return start; + } + var fullStartLine = ts.getLineStartPositionForPosition(fullStart, sourceFile); + var startLine = ts.getLineStartPositionForPosition(start, sourceFile); + if (startLine === fullStartLine) { + return position === Position.Start ? start : fullStart; + } + var adjustedStartPosition = ts.getStartPositionOfLine(ts.getLineOfLocalPosition(sourceFile, fullStartLine) + 1, sourceFile); + adjustedStartPosition = skipWhitespacesAndLineBreaks(sourceFile.text, adjustedStartPosition); + return ts.getStartPositionOfLine(ts.getLineOfLocalPosition(sourceFile, adjustedStartPosition), sourceFile); + } + textChanges.getAdjustedStartPosition = getAdjustedStartPosition; + function getAdjustedEndPosition(sourceFile, node, options) { + if (options.useNonAdjustedEndPosition) { + return node.getEnd(); + } + var end = node.getEnd(); + var newEnd = ts.skipTrivia(sourceFile.text, end, true); + return newEnd !== end && ts.isLineBreak(sourceFile.text.charCodeAt(newEnd - 1)) + ? newEnd + : end; + } + textChanges.getAdjustedEndPosition = getAdjustedEndPosition; + function isSeparator(node, candidate) { + return candidate && node.parent && (candidate.kind === 25 || (candidate.kind === 24 && node.parent.kind === 177)); + } + function spaces(count) { + var s = ""; + for (var i = 0; i < count; i++) { + s += " "; + } + return s; + } + var ChangeTracker = (function () { + function ChangeTracker(newLine, rulesProvider, validator) { + this.newLine = newLine; + this.rulesProvider = rulesProvider; + this.validator = validator; + this.changes = []; + this.newLineCharacter = ts.getNewLineCharacter({ newLine: newLine }); + } + ChangeTracker.fromCodeFixContext = function (context) { + return new ChangeTracker(context.newLineCharacter === "\n" ? 1 : 0, context.rulesProvider); + }; + ChangeTracker.prototype.deleteNode = function (sourceFile, node, options) { + if (options === void 0) { options = {}; } + var startPosition = getAdjustedStartPosition(sourceFile, node, options, Position.FullStart); + var endPosition = getAdjustedEndPosition(sourceFile, node, options); + this.changes.push({ sourceFile: sourceFile, options: options, range: { pos: startPosition, end: endPosition } }); + return this; + }; + ChangeTracker.prototype.deleteRange = function (sourceFile, range) { + this.changes.push({ sourceFile: sourceFile, range: range }); + return this; + }; + ChangeTracker.prototype.deleteNodeRange = function (sourceFile, startNode, endNode, options) { + if (options === void 0) { options = {}; } + var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.FullStart); + var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); + this.changes.push({ sourceFile: sourceFile, options: options, range: { pos: startPosition, end: endPosition } }); + return this; + }; + ChangeTracker.prototype.deleteNodeInList = function (sourceFile, node) { + var containingList = ts.formatting.SmartIndenter.getContainingList(node, sourceFile); + if (!containingList) { + ts.Debug.fail("node is not a list element"); + return this; + } + var index = containingList.indexOf(node); + if (index < 0) { + return this; + } + if (containingList.length === 1) { + this.deleteNode(sourceFile, node); + return this; + } + if (index !== containingList.length - 1) { + var nextToken = ts.getTokenAtPosition(sourceFile, node.end); + if (nextToken && isSeparator(node, nextToken)) { + var startPosition = ts.skipTrivia(sourceFile.text, getAdjustedStartPosition(sourceFile, node, {}, Position.FullStart), false, true); + var nextElement = containingList[index + 1]; + var endPosition = ts.skipTrivia(sourceFile.text, getAdjustedStartPosition(sourceFile, nextElement, {}, Position.FullStart), false, true); + this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); + } + } + else { + var previousToken = ts.getTokenAtPosition(sourceFile, containingList[index - 1].end); + if (previousToken && isSeparator(node, previousToken)) { + this.deleteNodeRange(sourceFile, previousToken, node); + } + } + return this; + }; + ChangeTracker.prototype.replaceRange = function (sourceFile, range, newNode, options) { + if (options === void 0) { options = {}; } + this.changes.push({ sourceFile: sourceFile, range: range, options: options, node: newNode }); + return this; + }; + ChangeTracker.prototype.replaceNode = function (sourceFile, oldNode, newNode, options) { + if (options === void 0) { options = {}; } + var startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); + var endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); + this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: endPosition } }); + return this; + }; + ChangeTracker.prototype.replaceNodeRange = function (sourceFile, startNode, endNode, newNode, options) { + if (options === void 0) { options = {}; } + var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); + var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); + this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: endPosition } }); + return this; + }; + ChangeTracker.prototype.insertNodeAt = function (sourceFile, pos, newNode, options) { + if (options === void 0) { options = {}; } + this.changes.push({ sourceFile: sourceFile, options: options, node: newNode, range: { pos: pos, end: pos } }); + return this; + }; + ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, options) { + if (options === void 0) { options = {}; } + var startPosition = getAdjustedStartPosition(sourceFile, before, options, Position.Start); + this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: startPosition } }); + return this; + }; + ChangeTracker.prototype.insertNodeAfter = function (sourceFile, after, newNode, options) { + if (options === void 0) { options = {}; } + if ((ts.isStatementButNotDeclaration(after)) || + after.kind === 148 || + after.kind === 147 || + after.kind === 149) { + if (sourceFile.text.charCodeAt(after.end - 1) !== 59) { + this.changes.push({ + sourceFile: sourceFile, + options: {}, + range: { pos: after.end, end: after.end }, + node: ts.createToken(24) + }); + } + } + var endPosition = getAdjustedEndPosition(sourceFile, after, options); + this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: endPosition, end: endPosition } }); + return this; + }; + ChangeTracker.prototype.insertNodeInListAfter = function (sourceFile, after, newNode) { + var containingList = ts.formatting.SmartIndenter.getContainingList(after, sourceFile); + if (!containingList) { + ts.Debug.fail("node is not a list element"); + return this; + } + var index = containingList.indexOf(after); + if (index < 0) { + return this; + } + var end = after.getEnd(); + if (index !== containingList.length - 1) { + var nextToken = ts.getTokenAtPosition(sourceFile, after.end); + if (nextToken && isSeparator(after, nextToken)) { + var lineAndCharOfNextElement = ts.getLineAndCharacterOfPosition(sourceFile, skipWhitespacesAndLineBreaks(sourceFile.text, containingList[index + 1].getFullStart())); + var lineAndCharOfNextToken = ts.getLineAndCharacterOfPosition(sourceFile, nextToken.end); + var prefix = void 0; + var startPos = void 0; + if (lineAndCharOfNextToken.line === lineAndCharOfNextElement.line) { + startPos = nextToken.end; + prefix = spaces(lineAndCharOfNextElement.character - lineAndCharOfNextToken.character); + } + else { + startPos = ts.getStartPositionOfLine(lineAndCharOfNextElement.line, sourceFile); + } + this.changes.push({ + sourceFile: sourceFile, + range: { pos: startPos, end: containingList[index + 1].getStart(sourceFile) }, + node: newNode, + useIndentationFromFile: true, + options: { + prefix: prefix, + suffix: "" + ts.tokenToString(nextToken.kind) + sourceFile.text.substring(nextToken.end, containingList[index + 1].getStart(sourceFile)) + } + }); + } + } + else { + var afterStart = after.getStart(sourceFile); + var afterStartLinePosition = ts.getLineStartPositionForPosition(afterStart, sourceFile); + var separator = void 0; + var multilineList = false; + if (containingList.length === 1) { + separator = 25; + } + else { + var tokenBeforeInsertPosition = ts.findPrecedingToken(after.pos, sourceFile); + separator = isSeparator(after, tokenBeforeInsertPosition) ? tokenBeforeInsertPosition.kind : 25; + var afterMinusOneStartLinePosition = ts.getLineStartPositionForPosition(containingList[index - 1].getStart(sourceFile), sourceFile); + multilineList = afterMinusOneStartLinePosition !== afterStartLinePosition; + } + if (hasCommentsBeforeLineBreak(sourceFile.text, after.end)) { + multilineList = true; + } + if (multilineList) { + this.changes.push({ + sourceFile: sourceFile, + range: { pos: end, end: end }, + node: ts.createToken(separator), + options: {} + }); + var indentation = ts.formatting.SmartIndenter.findFirstNonWhitespaceColumn(afterStartLinePosition, afterStart, sourceFile, this.rulesProvider.getFormatOptions()); + var insertPos = ts.skipTrivia(sourceFile.text, end, true, false); + if (insertPos !== end && ts.isLineBreak(sourceFile.text.charCodeAt(insertPos - 1))) { + insertPos--; + } + this.changes.push({ + sourceFile: sourceFile, + range: { pos: insertPos, end: insertPos }, + node: newNode, + options: { indentation: indentation, prefix: this.newLineCharacter } + }); + } + else { + this.changes.push({ + sourceFile: sourceFile, + range: { pos: end, end: end }, + node: newNode, + options: { prefix: ts.tokenToString(separator) + " " } + }); + } + } + return this; + }; + ChangeTracker.prototype.getChanges = function () { + var _this = this; + var changesPerFile = ts.createFileMap(); + for (var _i = 0, _a = this.changes; _i < _a.length; _i++) { + var c = _a[_i]; + var changesInFile = changesPerFile.get(c.sourceFile.path); + if (!changesInFile) { + changesPerFile.set(c.sourceFile.path, changesInFile = []); + } + changesInFile.push(c); + } + var fileChangesList = []; + changesPerFile.forEachValue(function (path) { + var changesInFile = changesPerFile.get(path); + var sourceFile = changesInFile[0].sourceFile; + var fileTextChanges = { fileName: sourceFile.fileName, textChanges: [] }; + for (var _i = 0, _a = ChangeTracker.normalize(changesInFile); _i < _a.length; _i++) { + var c = _a[_i]; + fileTextChanges.textChanges.push({ + span: _this.computeSpan(c, sourceFile), + newText: _this.computeNewText(c, sourceFile) + }); + } + fileChangesList.push(fileTextChanges); + }); + return fileChangesList; + }; + ChangeTracker.prototype.computeSpan = function (change, _sourceFile) { + return ts.createTextSpanFromBounds(change.range.pos, change.range.end); + }; + ChangeTracker.prototype.computeNewText = function (change, sourceFile) { + if (!change.node) { + return ""; + } + var options = change.options || {}; + var nonFormattedText = getNonformattedText(change.node, sourceFile, this.newLine); + if (this.validator) { + this.validator(nonFormattedText); + } + var formatOptions = this.rulesProvider.getFormatOptions(); + var pos = change.range.pos; + var posStartsLine = ts.getLineStartPositionForPosition(pos, sourceFile) === pos; + var initialIndentation = change.options.indentation !== undefined + ? change.options.indentation + : change.useIndentationFromFile + ? ts.formatting.SmartIndenter.getIndentation(change.range.pos, sourceFile, formatOptions, posStartsLine || (change.options.prefix === this.newLineCharacter)) + : 0; + var delta = change.options.delta !== undefined + ? change.options.delta + : ts.formatting.SmartIndenter.shouldIndentChildNode(change.node) + ? formatOptions.indentSize + : 0; + var text = applyFormatting(nonFormattedText, sourceFile, initialIndentation, delta, this.rulesProvider); + text = posStartsLine || change.options.indentation !== undefined ? text : text.replace(/^\s+/, ""); + return (options.prefix || "") + text + (options.suffix || ""); + }; + ChangeTracker.normalize = function (changes) { + var normalized = ts.stableSort(changes, function (a, b) { return a.range.pos - b.range.pos; }); + for (var i = 0; i < normalized.length - 2; i++) { + ts.Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos); + } + return normalized; + }; + return ChangeTracker; + }()); + textChanges.ChangeTracker = ChangeTracker; + function getNonformattedText(node, sourceFile, newLine) { + var options = { newLine: newLine, target: sourceFile.languageVersion }; + var writer = new Writer(ts.getNewLineCharacter(options)); + var printer = ts.createPrinter(options, writer); + printer.writeNode(3, node, sourceFile, writer); + return { text: writer.getText(), node: assignPositionsToNode(node) }; + } + textChanges.getNonformattedText = getNonformattedText; + function applyFormatting(nonFormattedText, sourceFile, initialIndentation, delta, rulesProvider) { + var lineMap = ts.computeLineStarts(nonFormattedText.text); + var file = { + text: nonFormattedText.text, + lineMap: lineMap, + getLineAndCharacterOfPosition: function (pos) { return ts.computeLineAndCharacterOfPosition(lineMap, pos); } + }; + var changes = ts.formatting.formatNode(nonFormattedText.node, file, sourceFile.languageVariant, initialIndentation, delta, rulesProvider); + return applyChanges(nonFormattedText.text, changes); + } + textChanges.applyFormatting = applyFormatting; + function applyChanges(text, changes) { + for (var i = changes.length - 1; i >= 0; i--) { + var change = changes[i]; + text = "" + text.substring(0, change.span.start) + change.newText + text.substring(ts.textSpanEnd(change.span)); + } + return text; + } + textChanges.applyChanges = applyChanges; + function isTrivia(s) { + return ts.skipTrivia(s, 0) === s.length; + } + var nullTransformationContext = { + enableEmitNotification: ts.noop, + enableSubstitution: ts.noop, + endLexicalEnvironment: function () { return undefined; }, + getCompilerOptions: ts.notImplemented, + getEmitHost: ts.notImplemented, + getEmitResolver: ts.notImplemented, + hoistFunctionDeclaration: ts.noop, + hoistVariableDeclaration: ts.noop, + isEmitNotificationEnabled: ts.notImplemented, + isSubstitutionEnabled: ts.notImplemented, + onEmitNode: ts.noop, + onSubstituteNode: ts.notImplemented, + readEmitHelpers: ts.notImplemented, + requestEmitHelper: ts.noop, + resumeLexicalEnvironment: ts.noop, + startLexicalEnvironment: ts.noop, + suspendLexicalEnvironment: ts.noop + }; + function assignPositionsToNode(node) { + var visited = ts.visitEachChild(node, assignPositionsToNode, nullTransformationContext, assignPositionsToNodeArray, assignPositionsToNode); + var newNode = ts.nodeIsSynthesized(visited) + ? visited + : (Proxy.prototype = visited, new Proxy()); + newNode.pos = getPos(node); + newNode.end = getEnd(node); + return newNode; + function Proxy() { } + } + function assignPositionsToNodeArray(nodes, visitor, test, start, count) { + var visited = ts.visitNodes(nodes, visitor, test, start, count); + if (!visited) { + return visited; + } + var nodeArray = visited === nodes ? ts.createNodeArray(visited.slice(0)) : visited; + nodeArray.pos = getPos(nodes); + nodeArray.end = getEnd(nodes); + return nodeArray; + } + var Writer = (function () { + function Writer(newLine) { + var _this = this; + this.lastNonTriviaPosition = 0; + this.writer = ts.createTextWriter(newLine); + this.onEmitNode = function (hint, node, printCallback) { + if (node) { + setPos(node, _this.lastNonTriviaPosition); + } + printCallback(hint, node); + if (node) { + setEnd(node, _this.lastNonTriviaPosition); + } + }; + this.onBeforeEmitNodeArray = function (nodes) { + if (nodes) { + setPos(nodes, _this.lastNonTriviaPosition); + } + }; + this.onAfterEmitNodeArray = function (nodes) { + if (nodes) { + setEnd(nodes, _this.lastNonTriviaPosition); + } + }; + } + Writer.prototype.setLastNonTriviaPosition = function (s, force) { + if (force || !isTrivia(s)) { + this.lastNonTriviaPosition = this.writer.getTextPos(); + var i = 0; + while (ts.isWhiteSpace(s.charCodeAt(s.length - i - 1))) { + i++; + } + this.lastNonTriviaPosition -= i; + } + }; + Writer.prototype.write = function (s) { + this.writer.write(s); + this.setLastNonTriviaPosition(s, false); + }; + Writer.prototype.writeTextOfNode = function (text, node) { + this.writer.writeTextOfNode(text, node); + }; + Writer.prototype.writeLine = function () { + this.writer.writeLine(); + }; + Writer.prototype.increaseIndent = function () { + this.writer.increaseIndent(); + }; + Writer.prototype.decreaseIndent = function () { + this.writer.decreaseIndent(); + }; + Writer.prototype.getText = function () { + return this.writer.getText(); + }; + Writer.prototype.rawWrite = function (s) { + this.writer.rawWrite(s); + this.setLastNonTriviaPosition(s, false); + }; + Writer.prototype.writeLiteral = function (s) { + this.writer.writeLiteral(s); + this.setLastNonTriviaPosition(s, true); + }; + Writer.prototype.getTextPos = function () { + return this.writer.getTextPos(); + }; + Writer.prototype.getLine = function () { + return this.writer.getLine(); + }; + Writer.prototype.getColumn = function () { + return this.writer.getColumn(); + }; + Writer.prototype.getIndent = function () { + return this.writer.getIndent(); + }; + Writer.prototype.isAtStartOfLine = function () { + return this.writer.isAtStartOfLine(); + }; + Writer.prototype.reset = function () { + this.writer.reset(); + this.lastNonTriviaPosition = 0; + }; + return Writer; + }()); + })(textChanges = ts.textChanges || (ts.textChanges = {})); +})(ts || (ts = {})); +var ts; (function (ts) { var codefix; (function (codefix) { - var codeFixes = ts.createMap(); + var codeFixes = []; function registerCodeFix(action) { ts.forEach(action.errorCodes, function (error) { var fixes = codeFixes[error]; @@ -62512,24 +69476,203 @@ var ts; (function (ts) { var codefix; (function (codefix) { - function getOpenBraceEnd(constructor, sourceFile) { - return constructor.body.getFirstToken(sourceFile).getEnd(); - } codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code], - getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start); - if (token.kind !== 122) { - return undefined; - } - var newPosition = getOpenBraceEnd(token.parent, sourceFile); - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_missing_super_call), - changes: [{ fileName: sourceFile.fileName, textChanges: [{ newText: "super();", span: { start: newPosition, length: 0 } }] }] - }]; - } + errorCodes: [ts.Diagnostics.Class_0_incorrectly_implements_interface_1.code], + getCodeActions: getActionForClassLikeIncorrectImplementsInterface }); + function getActionForClassLikeIncorrectImplementsInterface(context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + var token = ts.getTokenAtPosition(sourceFile, start); + var checker = context.program.getTypeChecker(); + var classDeclaration = ts.getContainingClass(token); + if (!classDeclaration) { + return undefined; + } + var openBrace = ts.getOpenBraceOfClassLike(classDeclaration, sourceFile); + var classType = checker.getTypeAtLocation(classDeclaration); + var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(classDeclaration); + var hasNumericIndexSignature = !!checker.getIndexTypeOfType(classType, 1); + var hasStringIndexSignature = !!checker.getIndexTypeOfType(classType, 0); + var result = []; + for (var _i = 0, implementedTypeNodes_2 = implementedTypeNodes; _i < implementedTypeNodes_2.length; _i++) { + var implementedTypeNode = implementedTypeNodes_2[_i]; + var implementedType = checker.getTypeAtLocation(implementedTypeNode); + var implementedTypeSymbols = checker.getPropertiesOfType(implementedType); + var nonPrivateMembers = implementedTypeSymbols.filter(function (symbol) { return !(ts.getModifierFlags(symbol.valueDeclaration) & 8); }); + var newNodes = []; + createAndAddMissingIndexSignatureDeclaration(implementedType, 1, hasNumericIndexSignature, newNodes); + createAndAddMissingIndexSignatureDeclaration(implementedType, 0, hasStringIndexSignature, newNodes); + newNodes = newNodes.concat(codefix.createMissingMemberNodes(classDeclaration, nonPrivateMembers, checker)); + var message = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_interface_0), [implementedTypeNode.getText()]); + if (newNodes.length > 0) { + pushAction(result, newNodes, message); + } + } + return result; + function createAndAddMissingIndexSignatureDeclaration(type, kind, hasIndexSigOfKind, newNodes) { + if (hasIndexSigOfKind) { + return; + } + var indexInfoOfKind = checker.getIndexInfoOfType(type, kind); + if (!indexInfoOfKind) { + return; + } + var newIndexSignatureDeclaration = checker.indexInfoToIndexSignatureDeclaration(indexInfoOfKind, kind, classDeclaration); + newNodes.push(newIndexSignatureDeclaration); + } + function pushAction(result, newNodes, description) { + var newAction = { + description: description, + changes: codefix.newNodesToChanges(newNodes, openBrace, context) + }; + result.push(newAction); + } + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Property_0_does_not_exist_on_type_1.code], + getCodeActions: getActionsForAddMissingMember + }); + function getActionsForAddMissingMember(context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + var token = ts.getTokenAtPosition(sourceFile, start); + if (token.kind !== 70) { + return undefined; + } + if (!ts.isPropertyAccessExpression(token.parent) || token.parent.expression.kind !== 98) { + return undefined; + } + var classMemberDeclaration = ts.getThisContainer(token, false); + if (!ts.isClassElement(classMemberDeclaration)) { + return undefined; + } + var classDeclaration = classMemberDeclaration.parent; + if (!classDeclaration || !ts.isClassLike(classDeclaration)) { + return undefined; + } + var isStatic = ts.hasModifier(classMemberDeclaration, 32); + return ts.isInJavaScriptFile(sourceFile) ? getActionsForAddMissingMemberInJavaScriptFile() : getActionsForAddMissingMemberInTypeScriptFile(); + function getActionsForAddMissingMemberInJavaScriptFile() { + var memberName = token.getText(); + if (isStatic) { + if (classDeclaration.kind === 198) { + return undefined; + } + var className = classDeclaration.name.getText(); + return [{ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Initialize_static_property_0), [memberName]), + changes: [{ + fileName: sourceFile.fileName, + textChanges: [{ + span: { start: classDeclaration.getEnd(), length: 0 }, + newText: "" + context.newLineCharacter + className + "." + memberName + " = undefined;" + context.newLineCharacter + }] + }] + }]; + } + else { + var classConstructor = ts.getFirstConstructorWithBody(classDeclaration); + if (!classConstructor) { + return undefined; + } + return [{ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Initialize_property_0_in_the_constructor), [memberName]), + changes: [{ + fileName: sourceFile.fileName, + textChanges: [{ + span: { start: classConstructor.body.getEnd() - 1, length: 0 }, + newText: "this." + memberName + " = undefined;" + context.newLineCharacter + }] + }] + }]; + } + } + function getActionsForAddMissingMemberInTypeScriptFile() { + var typeNode; + if (token.parent.parent.kind === 193) { + var binaryExpression = token.parent.parent; + var checker = context.program.getTypeChecker(); + var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(binaryExpression.right))); + typeNode = checker.typeToTypeNode(widenedType, classDeclaration); + } + typeNode = typeNode || ts.createKeywordTypeNode(118); + var openBrace = ts.getOpenBraceOfClassLike(classDeclaration, sourceFile); + var property = ts.createProperty(undefined, isStatic ? [ts.createToken(114)] : undefined, token.getText(sourceFile), undefined, typeNode, undefined); + var propertyChangeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + propertyChangeTracker.insertNodeAfter(sourceFile, openBrace, property, { suffix: context.newLineCharacter }); + var actions = [{ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_declaration_for_missing_property_0), [token.getText()]), + changes: propertyChangeTracker.getChanges() + }]; + if (!isStatic) { + var stringTypeNode = ts.createKeywordTypeNode(135); + var indexingParameter = ts.createParameter(undefined, undefined, undefined, "x", undefined, stringTypeNode, undefined); + var indexSignature = ts.createIndexSignatureDeclaration(undefined, undefined, [indexingParameter], typeNode); + var indexSignatureChangeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + indexSignatureChangeTracker.insertNodeAfter(sourceFile, openBrace, indexSignature, { suffix: context.newLineCharacter }); + actions.push({ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_index_signature_for_missing_property_0), [token.getText()]), + changes: indexSignatureChangeTracker.getChanges() + }); + } + return actions; + } + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code], + getCodeActions: getActionForClassLikeMissingAbstractMember + }); + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code], + getCodeActions: getActionForClassLikeMissingAbstractMember + }); + function getActionForClassLikeMissingAbstractMember(context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + var token = ts.getTokenAtPosition(sourceFile, start); + var checker = context.program.getTypeChecker(); + if (ts.isClassLike(token.parent)) { + var classDeclaration = token.parent; + var extendsNode = ts.getClassExtendsHeritageClauseElement(classDeclaration); + var instantiatedExtendsType = checker.getTypeAtLocation(extendsNode); + var extendsSymbols = checker.getPropertiesOfType(instantiatedExtendsType); + var abstractAndNonPrivateExtendsSymbols = extendsSymbols.filter(symbolPointsToNonPrivateAndAbstractMember); + var newNodes = codefix.createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, checker); + var changes = codefix.newNodesToChanges(newNodes, ts.getOpenBraceOfClassLike(classDeclaration, sourceFile), context); + if (changes && changes.length > 0) { + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_inherited_abstract_class), + changes: changes + }]; + } + } + return undefined; + } + function symbolPointsToNonPrivateAndAbstractMember(symbol) { + var decls = symbol.getDeclarations(); + ts.Debug.assert(!!(decls && decls.length > 0)); + var flags = ts.getModifierFlags(decls[0]); + return !(flags & 8) && !!(flags & 128); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var codefix; + (function (codefix) { codefix.registerCodeFix({ errorCodes: [ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code], getCodeActions: function (context) { @@ -62543,7 +69686,7 @@ var ts; if (!superCall) { return undefined; } - if (superCall.expression && superCall.expression.kind == 179) { + if (superCall.expression && superCall.expression.kind === 180) { var arguments_1 = superCall.expression.arguments; for (var i = 0; i < arguments_1.length; i++) { if (arguments_1[i].expression === token) { @@ -62551,23 +69694,15 @@ var ts; } } } - var newPosition = getOpenBraceEnd(constructor, sourceFile); - var changes = [{ - fileName: sourceFile.fileName, textChanges: [{ - newText: superCall.getText(sourceFile), - span: { start: newPosition, length: 0 } - }, - { - newText: "", - span: { start: superCall.getStart(sourceFile), length: superCall.getWidth(sourceFile) } - }] - }]; + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + changeTracker.insertNodeAfter(sourceFile, ts.getOpenBrace(constructor, sourceFile), superCall, { suffix: context.newLineCharacter }); + changeTracker.deleteNode(sourceFile, superCall); return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Make_super_call_the_first_statement_in_the_constructor), - changes: changes + changes: changeTracker.getChanges() }]; function findSuperCall(n) { - if (n.kind === 207 && ts.isSuperCall(n.expression)) { + if (n.kind === 209 && ts.isSuperCall(n.expression)) { return n; } if (ts.isFunctionLike(n)) { @@ -62580,6 +69715,248 @@ var ts; })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code], + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var token = ts.getTokenAtPosition(sourceFile, context.span.start); + if (token.kind !== 122) { + return undefined; + } + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + var superCall = ts.createStatement(ts.createCall(ts.createSuper(), undefined, ts.emptyArray)); + changeTracker.insertNodeAfter(sourceFile, ts.getOpenBrace(token.parent, sourceFile), superCall, { suffix: context.newLineCharacter }); + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_missing_super_call), + changes: changeTracker.getChanges() + }]; + } + }); + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code], + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + var token = ts.getTokenAtPosition(sourceFile, start); + var classDeclNode = ts.getContainingClass(token); + if (!(token.kind === 70 && ts.isClassLike(classDeclNode))) { + return undefined; + } + var heritageClauses = classDeclNode.heritageClauses; + if (!(heritageClauses && heritageClauses.length > 0)) { + return undefined; + } + var extendsToken = heritageClauses[0].getFirstToken(); + if (!(extendsToken && extendsToken.kind === 84)) { + return undefined; + } + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + changeTracker.replaceNode(sourceFile, extendsToken, ts.createToken(107)); + for (var i = 1; i < heritageClauses.length; i++) { + var keywordToken = heritageClauses[i].getFirstToken(); + if (keywordToken) { + changeTracker.replaceNode(sourceFile, keywordToken, ts.createToken(25)); + } + } + var result = [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Change_extends_to_implements), + changes: changeTracker.getChanges() + }]; + return result; + } + }); + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code], + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var token = ts.getTokenAtPosition(sourceFile, context.span.start); + if (token.kind !== 70) { + return undefined; + } + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + changeTracker.replaceNode(sourceFile, token, ts.createPropertyAccess(ts.createThis(), token)); + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_this_to_unresolved_variable), + changes: changeTracker.getChanges() + }]; + } + }); + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ + ts.Diagnostics._0_is_declared_but_never_used.code, + ts.Diagnostics.Property_0_is_declared_but_never_used.code + ], + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + var token = ts.getTokenAtPosition(sourceFile, start); + if (token.kind === 20) { + token = ts.getTokenAtPosition(sourceFile, start + 1); + } + switch (token.kind) { + case 70: + switch (token.parent.kind) { + case 225: + switch (token.parent.parent.parent.kind) { + case 213: + var forStatement = token.parent.parent.parent; + var forInitializer = forStatement.initializer; + if (forInitializer.declarations.length === 1) { + return deleteNode(forInitializer); + } + else { + return deleteNodeInList(token.parent); + } + case 215: + var forOfStatement = token.parent.parent.parent; + if (forOfStatement.initializer.kind === 226) { + var forOfInitializer = forOfStatement.initializer; + return replaceNode(forOfInitializer.declarations[0], ts.createObjectLiteral()); + } + break; + case 214: + return undefined; + case 259: + var catchClause = token.parent.parent; + var parameter = catchClause.variableDeclaration.getChildren()[0]; + return deleteNode(parameter); + default: + var variableStatement = token.parent.parent.parent; + if (variableStatement.declarationList.declarations.length === 1) { + return deleteNode(variableStatement); + } + else { + return deleteNodeInList(token.parent); + } + } + case 144: + var typeParameters = token.parent.parent.typeParameters; + if (typeParameters.length === 1) { + var previousToken = ts.getTokenAtPosition(sourceFile, typeParameters.pos - 1); + if (!previousToken || previousToken.kind !== 26) { + return deleteRange(typeParameters); + } + var nextToken = ts.getTokenAtPosition(sourceFile, typeParameters.end); + if (!nextToken || nextToken.kind !== 28) { + return deleteRange(typeParameters); + } + return deleteNodeRange(previousToken, nextToken); + } + else { + return deleteNodeInList(token.parent); + } + case 145: + var functionDeclaration = token.parent.parent; + if (functionDeclaration.parameters.length === 1) { + return deleteNode(token.parent); + } + else { + return deleteNodeInList(token.parent); + } + case 236: + var importEquals = ts.getAncestor(token, 236); + return deleteNode(importEquals); + case 241: + var namedImports = token.parent.parent; + if (namedImports.elements.length === 1) { + var importSpec = ts.getAncestor(token, 237); + return deleteNode(importSpec); + } + else { + return deleteNodeInList(token.parent); + } + case 238: + var importClause = token.parent; + if (!importClause.namedBindings) { + var importDecl = ts.getAncestor(importClause, 237); + return deleteNode(importDecl); + } + else { + var start_4 = importClause.name.getStart(sourceFile); + var nextToken = ts.getTokenAtPosition(sourceFile, importClause.name.end); + if (nextToken && nextToken.kind === 25) { + return deleteRange({ pos: start_4, end: ts.skipTrivia(sourceFile.text, nextToken.end, false, true) }); + } + else { + return deleteNode(importClause.name); + } + } + case 239: + var namespaceImport = token.parent; + if (namespaceImport.name === token && !namespaceImport.parent.name) { + var importDecl = ts.getAncestor(namespaceImport, 237); + return deleteNode(importDecl); + } + else { + var previousToken = ts.getTokenAtPosition(sourceFile, namespaceImport.pos - 1); + if (previousToken && previousToken.kind === 25) { + var startPosition = ts.textChanges.getAdjustedStartPosition(sourceFile, previousToken, {}, ts.textChanges.Position.FullStart); + return deleteRange({ pos: startPosition, end: namespaceImport.end }); + } + return deleteRange(namespaceImport); + } + } + break; + case 148: + case 239: + return deleteNode(token.parent); + } + if (ts.isDeclarationName(token)) { + return deleteNode(token.parent); + } + else if (ts.isLiteralComputedPropertyDeclarationName(token)) { + return deleteNode(token.parent.parent); + } + else { + return undefined; + } + function deleteNode(n) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).deleteNode(sourceFile, n)); + } + function deleteRange(range) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).deleteRange(sourceFile, range)); + } + function deleteNodeInList(n) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).deleteNodeInList(sourceFile, n)); + } + function deleteNodeRange(start, end) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).deleteNodeRange(sourceFile, start, end)); + } + function replaceNode(n, newNode) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).replaceNode(sourceFile, n, newNode)); + } + function makeChange(changeTracker) { + return [{ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Remove_declaration_for_Colon_0), { 0: token.getText() }), + changes: changeTracker.getChanges() + }]; + } + } + }); + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +var ts; (function (ts) { var codefix; (function (codefix) { @@ -62591,18 +69968,19 @@ var ts; })(ModuleSpecifierComparison || (ModuleSpecifierComparison = {})); var ImportCodeActionMap = (function () { function ImportCodeActionMap() { - this.symbolIdToActionMap = ts.createMap(); + this.symbolIdToActionMap = []; } ImportCodeActionMap.prototype.addAction = function (symbolId, newAction) { if (!newAction) { return; } - if (!this.symbolIdToActionMap[symbolId]) { + var actions = this.symbolIdToActionMap[symbolId]; + if (!actions) { this.symbolIdToActionMap[symbolId] = [newAction]; return; } if (newAction.kind === "CodeChange") { - this.symbolIdToActionMap[symbolId].push(newAction); + actions.push(newAction); return; } var updatedNewImports = []; @@ -62635,8 +70013,8 @@ var ts; }; ImportCodeActionMap.prototype.getAllActions = function () { var result = []; - for (var symbolId in this.symbolIdToActionMap) { - result = ts.concatenate(result, this.symbolIdToActionMap[symbolId]); + for (var key in this.symbolIdToActionMap) { + result = ts.concatenate(result, this.symbolIdToActionMap[key]); } return result; }; @@ -62665,7 +70043,11 @@ var ts; return ImportCodeActionMap; }()); codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Cannot_find_name_0.code], + errorCodes: [ + ts.Diagnostics.Cannot_find_name_0.code, + ts.Diagnostics.Cannot_find_namespace_0.code, + ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code + ], getCodeActions: function (context) { var sourceFile = context.sourceFile; var checker = context.program.getTypeChecker(); @@ -62674,18 +70056,22 @@ var ts; var token = ts.getTokenAtPosition(sourceFile, context.span.start); var name = token.getText(); var symbolIdActionMap = new ImportCodeActionMap(); - var cachedImportDeclarations = ts.createMap(); - var cachedNewImportInsertPosition; - var allPotentialModules = checker.getAmbientModules(); + var cachedImportDeclarations = []; + var lastImportDeclaration; + var currentTokenMeaning = ts.getMeaningFromLocation(token); + if (context.errorCode === ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code) { + var symbol = checker.getAliasedSymbol(checker.getSymbolAtLocation(token)); + return getCodeActionForImport(symbol, false, true); + } + var candidateModules = checker.getAmbientModules(); for (var _i = 0, allSourceFiles_1 = allSourceFiles; _i < allSourceFiles_1.length; _i++) { var otherSourceFile = allSourceFiles_1[_i]; if (otherSourceFile !== sourceFile && ts.isExternalOrCommonJsModule(otherSourceFile)) { - allPotentialModules.push(otherSourceFile.symbol); + candidateModules.push(otherSourceFile.symbol); } } - var currentTokenMeaning = ts.getMeaningFromLocation(token); - for (var _a = 0, allPotentialModules_1 = allPotentialModules; _a < allPotentialModules_1.length; _a++) { - var moduleSymbol = allPotentialModules_1[_a]; + for (var _a = 0, candidateModules_1 = candidateModules; _a < candidateModules_1.length; _a++) { + var moduleSymbol = candidateModules_1[_a]; context.cancellationToken.throwIfCancellationRequested(); var defaultExport = checker.tryGetMemberInModuleExports("default", moduleSymbol); if (defaultExport) { @@ -62704,8 +70090,9 @@ var ts; return symbolIdActionMap.getAllActions(); function getImportDeclarations(moduleSymbol) { var moduleSymbolId = getUniqueSymbolId(moduleSymbol); - if (cachedImportDeclarations[moduleSymbolId]) { - return cachedImportDeclarations[moduleSymbolId]; + var cached = cachedImportDeclarations[moduleSymbolId]; + if (cached) { + return cached; } var existingDeclarations = []; for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { @@ -62720,10 +70107,10 @@ var ts; function getImportDeclaration(moduleSpecifier) { var node = moduleSpecifier; while (node) { - if (node.kind === 235) { + if (node.kind === 237) { return node; } - if (node.kind === 234) { + if (node.kind === 236) { return node; } node = node.parent; @@ -62741,7 +70128,7 @@ var ts; var declarations = symbol.getDeclarations(); return declarations ? ts.some(symbol.declarations, function (decl) { return !!(ts.getMeaningFromDeclaration(decl) & meaning); }) : false; } - function getCodeActionForImport(moduleSymbol, isDefault) { + function getCodeActionForImport(moduleSymbol, isDefault, isNamespaceImport) { var existingDeclarations = getImportDeclarations(moduleSymbol); if (existingDeclarations.length > 0) { return getCodeActionsForExistingImport(existingDeclarations); @@ -62754,11 +70141,11 @@ var ts; var namespaceImportDeclaration; var namedImportDeclaration; var existingModuleSpecifier; - for (var _i = 0, declarations_11 = declarations; _i < declarations_11.length; _i++) { - var declaration = declarations_11[_i]; - if (declaration.kind === 235) { + for (var _i = 0, declarations_14 = declarations; _i < declarations_14.length; _i++) { + var declaration = declarations_14[_i]; + if (declaration.kind === 237) { var namedBindings = declaration.importClause && declaration.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 237) { + if (namedBindings && namedBindings.kind === 239) { namespaceImportDeclaration = declaration; } else { @@ -62774,94 +70161,82 @@ var ts; if (namespaceImportDeclaration) { actions.push(getCodeActionForNamespaceImport(namespaceImportDeclaration)); } - if (namedImportDeclaration && namedImportDeclaration.importClause && + if (!isNamespaceImport && namedImportDeclaration && namedImportDeclaration.importClause && (namedImportDeclaration.importClause.name || namedImportDeclaration.importClause.namedBindings)) { - var textChange = getTextChangeForImportClause(namedImportDeclaration.importClause); + var fileTextChanges = getTextChangeForImportClause(namedImportDeclaration.importClause); var moduleSpecifierWithoutQuotes = ts.stripQuotes(namedImportDeclaration.moduleSpecifier.getText()); - actions.push(createCodeAction(ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, [name, moduleSpecifierWithoutQuotes], textChange.newText, textChange.span, sourceFile.fileName, "InsertingIntoExistingImport", moduleSpecifierWithoutQuotes)); + actions.push(createCodeAction(ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, [name, moduleSpecifierWithoutQuotes], fileTextChanges, "InsertingIntoExistingImport", moduleSpecifierWithoutQuotes)); } else { actions.push(getCodeActionForNewImport(existingModuleSpecifier)); } return actions; function getModuleSpecifierFromImportEqualsDeclaration(declaration) { - if (declaration.moduleReference && declaration.moduleReference.kind === 245) { + if (declaration.moduleReference && declaration.moduleReference.kind === 247) { return declaration.moduleReference.expression.getText(); } return declaration.moduleReference.getText(); } function getTextChangeForImportClause(importClause) { - var newImportText = isDefault ? "default as " + name : name; var importList = importClause.namedBindings; - if (!importList && importClause.name) { - var start = importClause.name.getEnd(); - return { - newText: ", { " + newImportText + " }", - span: { start: start, length: 0 } - }; + var newImportSpecifier = ts.createImportSpecifier(undefined, ts.createIdentifier(name)); + if (!importList || importList.elements.length === 0) { + var newImportClause = ts.createImportClause(importClause.name, ts.createNamedImports([newImportSpecifier])); + return createChangeTracker().replaceNode(sourceFile, importClause, newImportClause).getChanges(); } - if (importList.elements.length === 0) { - var start = importList.getStart(); - return { - newText: "{ " + newImportText + " }", - span: { start: start, length: importList.getEnd() - start } - }; - } - var insertPoint = importList.elements[importList.elements.length - 1].getEnd(); - var startLine = ts.getLineOfLocalPosition(sourceFile, importList.getStart()); - var endLine = ts.getLineOfLocalPosition(sourceFile, importList.getEnd()); - var oneImportPerLine = endLine - startLine > importList.elements.length; - return { - newText: "," + (oneImportPerLine ? context.newLineCharacter : " ") + newImportText, - span: { start: insertPoint, length: 0 } - }; + return createChangeTracker().insertNodeInListAfter(sourceFile, importList.elements[importList.elements.length - 1], newImportSpecifier).getChanges(); } function getCodeActionForNamespaceImport(declaration) { var namespacePrefix; - if (declaration.kind === 235) { + if (declaration.kind === 237) { namespacePrefix = declaration.importClause.namedBindings.name.getText(); } else { namespacePrefix = declaration.name.getText(); } namespacePrefix = ts.stripQuotes(namespacePrefix); - return createCodeAction(ts.Diagnostics.Change_0_to_1, [name, namespacePrefix + "." + name], namespacePrefix + ".", { start: token.getStart(), length: 0 }, sourceFile.fileName, "CodeChange"); + return createCodeAction(ts.Diagnostics.Change_0_to_1, [name, namespacePrefix + "." + name], createChangeTracker().replaceNode(sourceFile, token, ts.createPropertyAccess(ts.createIdentifier(namespacePrefix), name)).getChanges(), "CodeChange"); } } function getCodeActionForNewImport(moduleSpecifier) { - if (!cachedNewImportInsertPosition) { - var lastModuleSpecifierEnd = -1; - for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { - var moduleSpecifier_1 = _a[_i]; - var end = moduleSpecifier_1.getEnd(); - if (!lastModuleSpecifierEnd || end > lastModuleSpecifierEnd) { - lastModuleSpecifierEnd = end; + if (!lastImportDeclaration) { + for (var i = sourceFile.statements.length - 1; i >= 0; i--) { + var statement = sourceFile.statements[i]; + if (statement.kind === 236 || statement.kind === 237) { + lastImportDeclaration = statement; + break; } } - cachedNewImportInsertPosition = lastModuleSpecifierEnd > 0 ? sourceFile.getLineEndOfPosition(lastModuleSpecifierEnd) : sourceFile.getStart(); } var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); var moduleSpecifierWithoutQuotes = ts.stripQuotes(moduleSpecifier || getModuleSpecifierForNewImport()); - var importStatementText = isDefault - ? "import " + name + " from \"" + moduleSpecifierWithoutQuotes + "\"" - : "import { " + name + " } from \"" + moduleSpecifierWithoutQuotes + "\""; - var newText = cachedNewImportInsertPosition === sourceFile.getStart() - ? importStatementText + ";" + context.newLineCharacter + context.newLineCharacter - : "" + context.newLineCharacter + importStatementText + ";"; - return createCodeAction(ts.Diagnostics.Import_0_from_1, [name, "\"" + moduleSpecifierWithoutQuotes + "\""], newText, { start: cachedNewImportInsertPosition, length: 0 }, sourceFile.fileName, "NewImport", moduleSpecifierWithoutQuotes); + var changeTracker = createChangeTracker(); + var importClause = isDefault + ? ts.createImportClause(ts.createIdentifier(name), undefined) + : isNamespaceImport + ? ts.createImportClause(undefined, ts.createNamespaceImport(ts.createIdentifier(name))) + : ts.createImportClause(undefined, ts.createNamedImports([ts.createImportSpecifier(undefined, ts.createIdentifier(name))])); + var importDecl = ts.createImportDeclaration(undefined, undefined, importClause, ts.createLiteral(moduleSpecifierWithoutQuotes)); + if (!lastImportDeclaration) { + changeTracker.insertNodeAt(sourceFile, sourceFile.getStart(), importDecl, { suffix: "" + context.newLineCharacter + context.newLineCharacter }); + } + else { + changeTracker.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl, { suffix: context.newLineCharacter }); + } + return createCodeAction(ts.Diagnostics.Import_0_from_1, [name, "\"" + moduleSpecifierWithoutQuotes + "\""], changeTracker.getChanges(), "NewImport", moduleSpecifierWithoutQuotes); function getModuleSpecifierForNewImport() { - var fileName = sourceFile.path; - var moduleFileName = moduleSymbol.valueDeclaration.getSourceFile().path; + var fileName = sourceFile.fileName; + var moduleFileName = moduleSymbol.valueDeclaration.getSourceFile().fileName; var sourceDirectory = ts.getDirectoryPath(fileName); var options = context.program.getCompilerOptions(); return tryGetModuleNameFromAmbientModule() || - tryGetModuleNameFromBaseUrl() || - tryGetModuleNameFromRootDirs() || tryGetModuleNameFromTypeRoots() || tryGetModuleNameAsNodeModule() || + tryGetModuleNameFromBaseUrl() || + tryGetModuleNameFromRootDirs() || ts.removeFileExtension(getRelativePath(moduleFileName, sourceDirectory)); function tryGetModuleNameFromAmbientModule() { - if (moduleSymbol.valueDeclaration.kind !== 261) { + if (moduleSymbol.valueDeclaration.kind !== 264) { return moduleSymbol.name; } } @@ -62869,11 +70244,11 @@ var ts; if (!options.baseUrl) { return undefined; } - var normalizedBaseUrl = ts.toPath(options.baseUrl, ts.getDirectoryPath(options.baseUrl), getCanonicalFileName); - var relativeName = tryRemoveParentDirectoryName(moduleFileName, normalizedBaseUrl); + var relativeName = getRelativePathIfInDirectory(moduleFileName, options.baseUrl); if (!relativeName) { return undefined; } + var relativeNameWithIndex = ts.removeFileExtension(relativeName); relativeName = removeExtensionAndIndexPostFix(relativeName); if (options.paths) { for (var key in options.paths) { @@ -62893,7 +70268,7 @@ var ts; return key.replace("\*", matchedStar); } } - else if (pattern === relativeName) { + else if (pattern === relativeName || pattern === relativeNameWithIndex) { return key; } } @@ -62903,9 +70278,8 @@ var ts; } function tryGetModuleNameFromRootDirs() { if (options.rootDirs) { - var normalizedRootDirs = ts.map(options.rootDirs, function (rootDir) { return ts.toPath(rootDir, undefined, getCanonicalFileName); }); - var normalizedTargetPath = getPathRelativeToRootDirs(moduleFileName, normalizedRootDirs); - var normalizedSourcePath = getPathRelativeToRootDirs(sourceDirectory, normalizedRootDirs); + var normalizedTargetPath = getPathRelativeToRootDirs(moduleFileName, options.rootDirs); + var normalizedSourcePath = getPathRelativeToRootDirs(sourceDirectory, options.rootDirs); if (normalizedTargetPath !== undefined) { var relativePath = normalizedSourcePath !== undefined ? getRelativePath(normalizedTargetPath, normalizedSourcePath) : normalizedTargetPath; return ts.removeFileExtension(relativePath); @@ -62967,7 +70341,7 @@ var ts; function getPathRelativeToRootDirs(path, rootDirs) { for (var _i = 0, rootDirs_2 = rootDirs; _i < rootDirs_2.length; _i++) { var rootDir = rootDirs_2[_i]; - var relativeName = tryRemoveParentDirectoryName(path, rootDir); + var relativeName = getRelativePathIfInDirectory(path, rootDir); if (relativeName !== undefined) { return relativeName; } @@ -62981,25 +70355,23 @@ var ts; } return fileName; } + function getRelativePathIfInDirectory(path, directoryPath) { + var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, false); + return ts.isRootedDiskPath(relativePath) || ts.startsWith(relativePath, "..") ? undefined : relativePath; + } function getRelativePath(path, directoryPath) { var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, false); return ts.moduleHasNonRelativeName(relativePath) ? "./" + relativePath : relativePath; } - function tryRemoveParentDirectoryName(path, parentDirectory) { - var index = path.indexOf(parentDirectory); - if (index === 0) { - return ts.endsWith(parentDirectory, ts.directorySeparator) - ? path.substring(parentDirectory.length) - : path.substring(parentDirectory.length + 1); - } - return undefined; - } } } - function createCodeAction(description, diagnosticArgs, newText, span, fileName, kind, moduleSpecifier) { + function createChangeTracker() { + return ts.textChanges.ChangeTracker.fromCodeFixContext(context); + } + function createCodeAction(description, diagnosticArgs, changes, kind, moduleSpecifier) { return { description: ts.formatMessage.apply(undefined, [undefined, description].concat(diagnosticArgs)), - changes: [{ fileName: fileName, textChanges: [{ newText: newText, span: span }] }], + changes: changes, kind: kind, moduleSpecifier: moduleSpecifier }; @@ -63013,150 +70385,225 @@ var ts; var codefix; (function (codefix) { codefix.registerCodeFix({ - errorCodes: [ - ts.Diagnostics._0_is_declared_but_never_used.code, - ts.Diagnostics.Property_0_is_declared_but_never_used.code - ], - getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var start = context.span.start; - var token = ts.getTokenAtPosition(sourceFile, start); - if (token.kind === 20) { - token = ts.getTokenAtPosition(sourceFile, start + 1); + errorCodes: getApplicableDiagnosticCodes(), + getCodeActions: getDisableJsDiagnosticsCodeActions + }); + function getApplicableDiagnosticCodes() { + var allDiagnostcs = ts.Diagnostics; + return Object.keys(allDiagnostcs) + .filter(function (d) { return allDiagnostcs[d] && allDiagnostcs[d].category === ts.DiagnosticCategory.Error; }) + .map(function (d) { return allDiagnostcs[d].code; }); + } + function getIgnoreCommentLocationForLocation(sourceFile, position, newLineCharacter) { + var line = ts.getLineAndCharacterOfPosition(sourceFile, position).line; + var lineStartPosition = ts.getStartPositionOfLine(line, sourceFile); + var startPosition = ts.getFirstNonSpaceCharacterPosition(sourceFile.text, lineStartPosition); + if (!ts.isInComment(sourceFile, startPosition) && !ts.isInString(sourceFile, startPosition) && !ts.isInTemplateString(sourceFile, startPosition)) { + var token = ts.getTouchingToken(sourceFile, startPosition); + var tokenLeadingCommnets = ts.getLeadingCommentRangesOfNode(token, sourceFile); + if (!tokenLeadingCommnets || !tokenLeadingCommnets.length || tokenLeadingCommnets[0].pos >= startPosition) { + return { + span: { start: startPosition, length: 0 }, + newText: "// @ts-ignore" + newLineCharacter + }; } - switch (token.kind) { - case 70: - switch (token.parent.kind) { - case 223: - switch (token.parent.parent.parent.kind) { - case 211: - var forStatement = token.parent.parent.parent; - var forInitializer = forStatement.initializer; - if (forInitializer.declarations.length === 1) { - return createCodeFix("", forInitializer.pos, forInitializer.end - forInitializer.pos); - } - else { - return removeSingleItem(forInitializer.declarations, token); - } - case 213: - var forOfStatement = token.parent.parent.parent; - if (forOfStatement.initializer.kind === 224) { - var forOfInitializer = forOfStatement.initializer; - return createCodeFix("{}", forOfInitializer.declarations[0].pos, forOfInitializer.declarations[0].end - forOfInitializer.declarations[0].pos); - } - break; - case 212: - return undefined; - case 256: - var catchClause = token.parent.parent; - var parameter = catchClause.variableDeclaration.getChildren()[0]; - return createCodeFix("", parameter.pos, parameter.end - parameter.pos); - default: - var variableStatement = token.parent.parent.parent; - if (variableStatement.declarationList.declarations.length === 1) { - return createCodeFix("", variableStatement.pos, variableStatement.end - variableStatement.pos); - } - else { - var declarations = variableStatement.declarationList.declarations; - return removeSingleItem(declarations, token); - } - } - case 143: - var typeParameters = token.parent.parent.typeParameters; - if (typeParameters.length === 1) { - return createCodeFix("", token.parent.pos - 1, token.parent.end - token.parent.pos + 2); - } - else { - return removeSingleItem(typeParameters, token); - } - case 144: - var functionDeclaration = token.parent.parent; - if (functionDeclaration.parameters.length === 1) { - return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos); - } - else { - return removeSingleItem(functionDeclaration.parameters, token); - } - case 234: - var importEquals = findImportDeclaration(token); - return createCodeFix("", importEquals.pos, importEquals.end - importEquals.pos); - case 239: - var namedImports = token.parent.parent; - if (namedImports.elements.length === 1) { - var importSpec = findImportDeclaration(token); - return createCodeFix("", importSpec.pos, importSpec.end - importSpec.pos); - } - else { - return removeSingleItem(namedImports.elements, token); - } - case 236: - var importClause = token.parent; - if (!importClause.namedBindings) { - var importDecl = findImportDeclaration(importClause); - return createCodeFix("", importDecl.pos, importDecl.end - importDecl.pos); - } - else { - return createCodeFix("", importClause.name.pos, importClause.namedBindings.pos - importClause.name.pos); - } - case 237: - var namespaceImport = token.parent; - if (namespaceImport.name == token && !namespaceImport.parent.name) { - var importDecl = findImportDeclaration(namespaceImport); - return createCodeFix("", importDecl.pos, importDecl.end - importDecl.pos); - } - else { - var start_4 = namespaceImport.parent.name.end; - return createCodeFix("", start_4, namespaceImport.parent.namedBindings.end - start_4); - } - } - break; - case 147: - return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos); - case 237: - return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos); - } - if (ts.isDeclarationName(token)) { - return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos); - } - else if (ts.isLiteralComputedPropertyDeclarationName(token)) { - return createCodeFix("", token.parent.parent.pos, token.parent.parent.end - token.parent.parent.pos); - } - else { - return undefined; - } - function findImportDeclaration(token) { - var importDecl = token; - while (importDecl.kind != 235 && importDecl.parent) { - importDecl = importDecl.parent; - } - return importDecl; - } - function createCodeFix(newText, start, length) { - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Remove_unused_identifiers), - changes: [{ - fileName: sourceFile.fileName, - textChanges: [{ newText: newText, span: { start: start, length: length } }] + } + return { + span: { start: position, length: 0 }, + newText: (position === startPosition ? "" : newLineCharacter) + "// @ts-ignore" + newLineCharacter + }; + } + function getDisableJsDiagnosticsCodeActions(context) { + var sourceFile = context.sourceFile, program = context.program, newLineCharacter = context.newLineCharacter, span = context.span; + if (!ts.isInJavaScriptFile(sourceFile) || !ts.isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) { + return undefined; + } + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Ignore_this_error_message), + changes: [{ + fileName: sourceFile.fileName, + textChanges: [getIgnoreCommentLocationForLocation(sourceFile, span.start, newLineCharacter)] + }] + }, + { + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Disable_checking_for_this_file), + changes: [{ + fileName: sourceFile.fileName, + textChanges: [{ + span: { + start: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.pos : 0, + length: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.end - sourceFile.checkJsDirective.pos : 0 + }, + newText: "// @ts-nocheck" + newLineCharacter }] - }]; - } - function removeSingleItem(elements, token) { - if (elements[0] === token.parent) { - return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos + 1); + }] + }]; + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var codefix; + (function (codefix) { + function newNodesToChanges(newNodes, insertAfter, context) { + var sourceFile = context.sourceFile; + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + for (var _i = 0, newNodes_1 = newNodes; _i < newNodes_1.length; _i++) { + var newNode = newNodes_1[_i]; + changeTracker.insertNodeAfter(sourceFile, insertAfter, newNode, { suffix: context.newLineCharacter }); + } + var changes = changeTracker.getChanges(); + if (!ts.some(changes)) { + return changes; + } + ts.Debug.assert(changes.length === 1); + var consolidatedChanges = [{ + fileName: changes[0].fileName, + textChanges: [{ + span: changes[0].textChanges[0].span, + newText: changes[0].textChanges.reduce(function (prev, cur) { return prev + cur.newText; }, "") + }] + }]; + return consolidatedChanges; + } + codefix.newNodesToChanges = newNodesToChanges; + function createMissingMemberNodes(classDeclaration, possiblyMissingSymbols, checker) { + var classMembers = classDeclaration.symbol.members; + var missingMembers = possiblyMissingSymbols.filter(function (symbol) { return !classMembers.has(symbol.getName()); }); + var newNodes = []; + for (var _i = 0, missingMembers_1 = missingMembers; _i < missingMembers_1.length; _i++) { + var symbol = missingMembers_1[_i]; + var newNode = createNewNodeForMemberSymbol(symbol, classDeclaration, checker); + if (newNode) { + if (Array.isArray(newNode)) { + newNodes = newNodes.concat(newNode); } else { - return createCodeFix("", token.parent.pos - 1, token.parent.end - token.parent.pos + 1); + newNodes.push(newNode); } } } - }); + return newNodes; + } + codefix.createMissingMemberNodes = createMissingMemberNodes; + function createNewNodeForMemberSymbol(symbol, enclosingDeclaration, checker) { + var declarations = symbol.getDeclarations(); + if (!(declarations && declarations.length)) { + return undefined; + } + var declaration = declarations[0]; + var name = ts.getSynthesizedClone(declaration.name); + var visibilityModifier = createVisibilityModifier(ts.getModifierFlags(declaration)); + var modifiers = visibilityModifier ? ts.createNodeArray([visibilityModifier]) : undefined; + var type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration)); + var optional = !!(symbol.flags & 67108864); + switch (declaration.kind) { + case 152: + case 153: + case 147: + case 148: + var typeNode = checker.typeToTypeNode(type, enclosingDeclaration); + var property = ts.createProperty(undefined, modifiers, name, optional ? ts.createToken(54) : undefined, typeNode, undefined); + return property; + case 149: + case 150: + var signatures = checker.getSignaturesOfType(type, 0); + if (!ts.some(signatures)) { + return undefined; + } + if (declarations.length === 1) { + ts.Debug.assert(signatures.length === 1); + var signature = signatures[0]; + return signatureToMethodDeclaration(signature, enclosingDeclaration, createStubbedMethodBody()); + } + var signatureDeclarations = []; + for (var i = 0; i < signatures.length; i++) { + var signature = signatures[i]; + var methodDeclaration = signatureToMethodDeclaration(signature, enclosingDeclaration); + if (methodDeclaration) { + signatureDeclarations.push(methodDeclaration); + } + } + if (declarations.length > signatures.length) { + var signature = checker.getSignatureFromDeclaration(declarations[declarations.length - 1]); + var methodDeclaration = signatureToMethodDeclaration(signature, enclosingDeclaration, createStubbedMethodBody()); + if (methodDeclaration) { + signatureDeclarations.push(methodDeclaration); + } + } + else { + ts.Debug.assert(declarations.length === signatures.length); + var methodImplementingSignatures = createMethodImplementingSignatures(signatures, name, optional, modifiers); + signatureDeclarations.push(methodImplementingSignatures); + } + return signatureDeclarations; + default: + return undefined; + } + function signatureToMethodDeclaration(signature, enclosingDeclaration, body) { + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 150, enclosingDeclaration); + if (signatureDeclaration) { + signatureDeclaration.decorators = undefined; + signatureDeclaration.modifiers = modifiers; + signatureDeclaration.name = name; + signatureDeclaration.questionToken = optional ? ts.createToken(54) : undefined; + signatureDeclaration.body = body; + } + return signatureDeclaration; + } + } + function createMethodImplementingSignatures(signatures, name, optional, modifiers) { + var maxArgsSignature = signatures[0]; + var minArgumentCount = signatures[0].minArgumentCount; + var someSigHasRestParameter = false; + for (var i = 0; i < signatures.length; i++) { + var sig = signatures[i]; + minArgumentCount = Math.min(sig.minArgumentCount, minArgumentCount); + if (sig.hasRestParameter) { + someSigHasRestParameter = true; + } + if (sig.parameters.length >= maxArgsSignature.parameters.length && (!sig.hasRestParameter || maxArgsSignature.hasRestParameter)) { + maxArgsSignature = sig; + } + } + var maxNonRestArgs = maxArgsSignature.parameters.length - (maxArgsSignature.hasRestParameter ? 1 : 0); + var maxArgsParameterSymbolNames = maxArgsSignature.parameters.map(function (symbol) { return symbol.getName(); }); + var parameters = []; + for (var i = 0; i < maxNonRestArgs; i++) { + var anyType = ts.createKeywordTypeNode(118); + var newParameter = ts.createParameter(undefined, undefined, undefined, maxArgsParameterSymbolNames[i], i >= minArgumentCount ? ts.createToken(54) : undefined, anyType, undefined); + parameters.push(newParameter); + } + if (someSigHasRestParameter) { + var anyArrayType = ts.createArrayTypeNode(ts.createKeywordTypeNode(118)); + var restParameter = ts.createParameter(undefined, undefined, ts.createToken(23), maxArgsParameterSymbolNames[maxNonRestArgs] || "rest", maxNonRestArgs >= minArgumentCount ? ts.createToken(54) : undefined, anyArrayType, undefined); + parameters.push(restParameter); + } + return createStubbedMethod(modifiers, name, optional, undefined, parameters, undefined); + } + function createStubbedMethod(modifiers, name, optional, typeParameters, parameters, returnType) { + return ts.createMethodDeclaration(undefined, modifiers, undefined, name, optional ? ts.createToken(54) : undefined, typeParameters, parameters, returnType, createStubbedMethodBody()); + } + codefix.createStubbedMethod = createStubbedMethod; + function createStubbedMethodBody() { + return ts.createBlock([ts.createThrow(ts.createNew(ts.createIdentifier("Error"), undefined, [ts.createLiteral("Method not implemented.")]))], true); + } + function createVisibilityModifier(flags) { + if (flags & 4) { + return ts.createToken(113); + } + else if (flags & 16) { + return ts.createToken(112); + } + return undefined; + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); var ts; (function (ts) { ts.servicesVersion = "0.5"; function createNode(kind, pos, end, parent) { - var node = kind >= 141 ? new NodeObject(kind, pos, end) : + var node = kind >= 142 ? new NodeObject(kind, pos, end) : kind === 70 ? new IdentifierObject(70, pos, end) : new TokenObject(kind, pos, end); node.parent = parent; @@ -63214,11 +70661,11 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(292, nodes.pos, nodes.end, this); + var list = createNode(293, nodes.pos, nodes.end, this); list._children = []; var pos = nodes.pos; - for (var _i = 0, nodes_7 = nodes; _i < nodes_7.length; _i++) { - var node = nodes_7[_i]; + for (var _i = 0, nodes_9 = nodes; _i < nodes_9.length; _i++) { + var node = nodes_9[_i]; if (pos < node.pos) { pos = this.addSyntheticNodes(list._children, pos, node.pos); } @@ -63233,11 +70680,11 @@ var ts; NodeObject.prototype.createChildren = function (sourceFile) { var _this = this; var children; - if (this.kind >= 141) { + if (this.kind >= 142) { ts.scanner.setText((sourceFile || this.getSourceFile()).text); children = []; var pos_3 = this.pos; - var useJSDocScanner_1 = this.kind >= 278 && this.kind <= 291; + var useJSDocScanner_1 = this.kind >= 282 && this.kind <= 292; var processNode = function (node) { var isJSDocTagNode = ts.isJSDocTag(node); if (!isJSDocTagNode && pos_3 < node.pos) { @@ -63290,8 +70737,10 @@ var ts; if (!children.length) { return undefined; } - var child = children[0]; - return child.kind < 141 ? child : child.getFirstToken(sourceFile); + var child = ts.find(children, function (kid) { return kid.kind < 266 || kid.kind > 292; }); + return child.kind < 142 ? + child : + child.getFirstToken(sourceFile); }; NodeObject.prototype.getLastToken = function (sourceFile) { var children = this.getChildren(sourceFile); @@ -63299,7 +70748,10 @@ var ts; if (!child) { return undefined; } - return child.kind < 141 ? child : child.getLastToken(sourceFile); + return child.kind < 142 ? child : child.getLastToken(sourceFile); + }; + NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { + return ts.forEachChild(this, cbNode, cbNodeArray); }; return NodeObject; }()); @@ -63352,6 +70804,9 @@ var ts; TokenOrIdentifierObject.prototype.getLastToken = function () { return undefined; }; + TokenOrIdentifierObject.prototype.forEachChild = function () { + return undefined; + }; return TokenOrIdentifierObject; }()); var SymbolObject = (function () { @@ -63374,6 +70829,12 @@ var ts; } return this.documentationComment; }; + SymbolObject.prototype.getJsDocTags = function () { + if (this.tags === undefined) { + this.tags = ts.JsDoc.getJsDocTagsFromDeclarations(this.declarations); + } + return this.tags; + }; return SymbolObject; }()); var TokenObject = (function (_super) { @@ -63457,6 +70918,12 @@ var ts; } return this.documentationComment; }; + SignatureObject.prototype.getJsDocTags = function () { + if (this.jsDocTags === undefined) { + this.jsDocTags = this.declaration ? ts.JsDoc.getJsDocTagsFromDeclarations([this.declaration]) : []; + } + return this.jsDocTags; + }; return SignatureObject; }()); var SourceFileObject = (function (_super) { @@ -63496,17 +70963,21 @@ var ts; return this.namedDeclarations; }; SourceFileObject.prototype.computeNamedDeclarations = function () { - var result = ts.createMap(); + var result = ts.createMultiMap(); ts.forEachChild(this, visit); return result; function addDeclaration(declaration) { var name = getDeclarationName(declaration); if (name) { - ts.multiMapAdd(result, name, declaration); + result.add(name, declaration); } } function getDeclarations(name) { - return result[name] || (result[name] = []); + var declarations = result.get(name); + if (!declarations) { + result.set(name, declarations = []); + } + return declarations; } function getDeclarationName(declaration) { if (declaration.name) { @@ -63514,9 +70985,9 @@ var ts; if (result_7 !== undefined) { return result_7; } - if (declaration.name.kind === 142) { + if (declaration.name.kind === 143) { var expr = declaration.name.expression; - if (expr.kind === 177) { + if (expr.kind === 178) { return expr.name.text; } return getTextOfIdentifierOrLiteral(expr); @@ -63536,10 +71007,10 @@ var ts; } function visit(node) { switch (node.kind) { - case 225: - case 184: + case 227: + case 185: + case 150: case 149: - case 148: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -63553,33 +71024,33 @@ var ts; else { declarations.push(functionDeclaration); } - ts.forEachChild(node, visit); } + ts.forEachChild(node, visit); break; - case 226: - case 197: - case 227: case 228: + case 198: case 229: case 230: - case 234: - case 243: - case 239: - case 234: + case 231: + case 232: case 236: - case 237: - case 151: + case 245: + case 241: + case 236: + case 238: + case 239: case 152: - case 161: + case 153: + case 162: addDeclaration(node); ts.forEachChild(node, visit); break; - case 144: + case 145: if (!ts.hasModifier(node, 92)) { break; } - case 223: - case 174: { + case 225: + case 175: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -63588,24 +71059,24 @@ var ts; if (decl.initializer) visit(decl.initializer); } - case 260: + case 263: + case 148: case 147: - case 146: addDeclaration(node); break; - case 241: + case 243: if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 235: + case 237: var importClause = node.importClause; if (importClause) { if (importClause.name) { addDeclaration(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 237) { + if (importClause.namedBindings.kind === 239) { addDeclaration(importClause.namedBindings); } else { @@ -63831,6 +71302,30 @@ var ts; }; return CancellationTokenObject; }()); + var ThrottledCancellationToken = (function () { + function ThrottledCancellationToken(hostCancellationToken, throttleWaitMilliseconds) { + if (throttleWaitMilliseconds === void 0) { throttleWaitMilliseconds = 20; } + this.hostCancellationToken = hostCancellationToken; + this.throttleWaitMilliseconds = throttleWaitMilliseconds; + this.lastCancellationCheckTime = 0; + } + ThrottledCancellationToken.prototype.isCancellationRequested = function () { + var time = ts.timestamp(); + var duration = Math.abs(time - this.lastCancellationCheckTime); + if (duration >= this.throttleWaitMilliseconds) { + this.lastCancellationCheckTime = time; + return this.hostCancellationToken.isCancellationRequested(); + } + return false; + }; + ThrottledCancellationToken.prototype.throwIfCancellationRequested = function () { + if (this.isCancellationRequested()) { + throw new ts.OperationCanceledException(); + } + }; + return ThrottledCancellationToken; + }()); + ts.ThrottledCancellationToken = ThrottledCancellationToken; function createLanguageService(host, documentRegistry) { if (documentRegistry === void 0) { documentRegistry = ts.createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory()); } var syntaxTreeCache = new SyntaxTreeCache(host); @@ -64048,10 +71543,10 @@ var ts; if (!symbol || typeChecker.isUnknownSymbol(symbol)) { switch (node.kind) { case 70: - case 177: - case 141: + case 178: + case 142: case 98: - case 167: + case 168: case 96: var type = typeChecker.getTypeAtLocation(node); if (type) { @@ -64060,7 +71555,8 @@ var ts; kindModifiers: ts.ScriptElementKindModifier.none, textSpan: ts.createTextSpan(node.getStart(), node.getWidth()), displayParts: ts.typeToDisplayParts(typeChecker, type, ts.getContainerNode(node)), - documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined + documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined, + tags: type.symbol ? type.symbol.getJsDocTags() : undefined }; } } @@ -64072,26 +71568,27 @@ var ts; kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), textSpan: ts.createTextSpan(node.getStart(), node.getWidth()), displayParts: displayPartsDocumentationsAndKind.displayParts, - documentation: displayPartsDocumentationsAndKind.documentation + documentation: displayPartsDocumentationsAndKind.documentation, + tags: displayPartsDocumentationsAndKind.tags }; } function getDefinitionAtPosition(fileName, position) { synchronizeHostData(); return ts.GoToDefinition.getDefinitionAtPosition(program, getValidSourceFile(fileName), position); } - function getImplementationAtPosition(fileName, position) { - synchronizeHostData(); - return ts.GoToImplementation.getImplementationAtPosition(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), ts.getTouchingPropertyName(getValidSourceFile(fileName), position)); - } function getTypeDefinitionAtPosition(fileName, position) { synchronizeHostData(); return ts.GoToDefinition.getTypeDefinitionAtPosition(program.getTypeChecker(), getValidSourceFile(fileName), position); } + function getImplementationAtPosition(fileName, position) { + synchronizeHostData(); + return ts.FindAllReferences.getImplementationsAtPosition(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position); + } function getOccurrencesAtPosition(fileName, position) { var results = getOccurrencesAtPositionCore(fileName, position); if (results) { - var sourceFile_2 = getCanonicalFileName(ts.normalizeSlashes(fileName)); - results = ts.filter(results, function (r) { return getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile_2; }); + var sourceFile_1 = getCanonicalFileName(ts.normalizeSlashes(fileName)); + results = ts.filter(results, function (r) { return getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile_1; }); } return results; } @@ -64102,7 +71599,6 @@ var ts; return ts.DocumentHighlights.getDocumentHighlights(program.getTypeChecker(), cancellationToken, sourceFile, position, sourceFilesToSearch); } function getOccurrencesAtPositionCore(fileName, position) { - synchronizeHostData(); return convertDocumentHighlights(getDocumentHighlights(fileName, position, [fileName])); function convertDocumentHighlights(documentHighlights) { if (!documentHighlights) { @@ -64117,7 +71613,8 @@ var ts; fileName: entry.fileName, textSpan: highlightSpan.textSpan, isWriteAccess: highlightSpan.kind === ts.HighlightSpanKind.writtenReference, - isDefinition: false + isDefinition: false, + isInString: highlightSpan.isInString, }); } } @@ -64125,20 +71622,18 @@ var ts; } } function findRenameLocations(fileName, position, findInStrings, findInComments) { - var referencedSymbols = findReferencedSymbols(fileName, position, findInStrings, findInComments); - return ts.FindAllReferences.convertReferences(referencedSymbols); + return getReferences(fileName, position, { findInStrings: findInStrings, findInComments: findInComments, isForRename: true }); } function getReferencesAtPosition(fileName, position) { - var referencedSymbols = findReferencedSymbols(fileName, position, false, false); - return ts.FindAllReferences.convertReferences(referencedSymbols); + return getReferences(fileName, position); + } + function getReferences(fileName, position, options) { + synchronizeHostData(); + return ts.FindAllReferences.findReferencedEntries(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position, options); } function findReferences(fileName, position) { - var referencedSymbols = findReferencedSymbols(fileName, position, false, false); - return ts.filter(referencedSymbols, function (rs) { return !!rs.definition; }); - } - function findReferencedSymbols(fileName, position, findInStrings, findInComments) { synchronizeHostData(); - return ts.FindAllReferences.findReferencedSymbols(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position, findInStrings, findInComments); + return ts.FindAllReferences.findReferencedSymbols(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position); } function getNavigateToItems(searchValue, maxResultCount, fileName, excludeDtsFiles) { synchronizeHostData(); @@ -64156,7 +71651,8 @@ var ts; text: data }); } - var emitOutput = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles); + var customTransformers = host.getCustomTransformers && host.getCustomTransformers(); + var emitOutput = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); return { outputFiles: outputFiles, emitSkipped: emitOutput.emitSkipped @@ -64180,15 +71676,15 @@ var ts; return; } switch (node.kind) { - case 177: - case 141: + case 178: + case 142: case 9: case 85: case 100: case 94: case 96: case 98: - case 167: + case 168: case 70: break; default: @@ -64200,7 +71696,7 @@ var ts; nodeForStartPos = nodeForStartPos.parent; } else if (ts.isNameOfModuleDeclaration(nodeForStartPos)) { - if (nodeForStartPos.parent.parent.kind === 230 && + if (nodeForStartPos.parent.parent.kind === 232 && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { nodeForStartPos = nodeForStartPos.parent.parent.name; } @@ -64219,10 +71715,10 @@ var ts; return ts.BreakpointResolver.spanInSourceFileAtLocation(sourceFile, position); } function getNavigationBarItems(fileName) { - return ts.NavigationBar.getNavigationBarItems(syntaxTreeCache.getCurrentSourceFile(fileName)); + return ts.NavigationBar.getNavigationBarItems(syntaxTreeCache.getCurrentSourceFile(fileName), cancellationToken); } function getNavigationTree(fileName) { - return ts.NavigationBar.getNavigationTree(syntaxTreeCache.getCurrentSourceFile(fileName)); + return ts.NavigationBar.getNavigationTree(syntaxTreeCache.getCurrentSourceFile(fileName), cancellationToken); } function isTsOrTsxFile(fileName) { var kind = ts.getScriptKind(fileName, host); @@ -64250,7 +71746,7 @@ var ts; } function getOutliningSpans(fileName) { var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - return ts.OutliningElementsCollector.collectElements(sourceFile); + return ts.OutliningElementsCollector.collectElements(sourceFile, cancellationToken); } function getBraceMatchingAtPosition(fileName, position) { var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); @@ -64326,13 +71822,13 @@ var ts; } return []; } - function getCodeFixesAtPosition(fileName, start, end, errorCodes) { + function getCodeFixesAtPosition(fileName, start, end, errorCodes, formatOptions) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); var span = { start: start, length: end - start }; var newLineChar = ts.getNewLineOrDefaultFromHost(host); var allFixes = []; - ts.forEach(errorCodes, function (error) { + ts.forEach(ts.deduplicate(errorCodes), function (error) { cancellationToken.throwIfCancellationRequested(); var context = { errorCode: error, @@ -64341,7 +71837,8 @@ var ts; program: program, newLineCharacter: newLineChar, host: host, - cancellationToken: cancellationToken + cancellationToken: cancellationToken, + rulesProvider: getRuleProvider(formatOptions) }; var fixes = ts.codefix.getFixes(context); if (fixes) { @@ -64358,7 +71855,7 @@ var ts; return false; } var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - if (ts.isInString(sourceFile, position) || ts.isInComment(sourceFile, position)) { + if (ts.isInString(sourceFile, position)) { return false; } if (ts.isInsideJsxElementOrAttribute(sourceFile, position)) { @@ -64389,7 +71886,7 @@ var ts; continue; } var descriptor = undefined; - for (var i = 0, n = descriptors.length; i < n; i++) { + for (var i = 0; i < descriptors.length; i++) { if (matchArray[i + firstDescriptorCaptureIndex]) { descriptor = descriptors[i]; } @@ -64493,15 +71990,15 @@ var ts; function walk(node) { switch (node.kind) { case 70: - nameTable[node.text] = nameTable[node.text] === undefined ? node.pos : -1; + setNameTable(node.text, node); break; case 9: case 8: if (ts.isDeclarationName(node) || - node.parent.kind === 245 || + node.parent.kind === 247 || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node)) { - nameTable[node.text] = nameTable[node.text] === undefined ? node.pos : -1; + setNameTable(node.text, node); } break; default: @@ -64514,11 +72011,66 @@ var ts; } } } + function setNameTable(text, node) { + nameTable.set(text, nameTable.get(text) === undefined ? node.pos : -1); + } } + function isObjectLiteralElement(node) { + switch (node.kind) { + case 252: + case 254: + case 260: + case 261: + case 150: + case 152: + case 153: + return true; + } + return false; + } + function getContainingObjectLiteralElement(node) { + switch (node.kind) { + case 9: + case 8: + if (node.parent.kind === 143) { + return isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; + } + case 70: + return isObjectLiteralElement(node.parent) && + (node.parent.parent.kind === 177 || node.parent.parent.kind === 253) && + node.parent.name === node ? node.parent : undefined; + } + return undefined; + } + ts.getContainingObjectLiteralElement = getContainingObjectLiteralElement; + function getPropertySymbolsFromContextualType(typeChecker, node) { + var objectLiteral = node.parent; + var contextualType = typeChecker.getContextualType(objectLiteral); + var name = ts.getTextOfPropertyName(node.name); + if (name && contextualType) { + var result_8 = []; + var symbol = contextualType.getProperty(name); + if (contextualType.flags & 65536) { + ts.forEach(contextualType.types, function (t) { + var symbol = t.getProperty(name); + if (symbol) { + result_8.push(symbol); + } + }); + return result_8; + } + if (symbol) { + result_8.push(symbol); + return result_8; + } + } + return undefined; + } + ts.getPropertySymbolsFromContextualType = getPropertySymbolsFromContextualType; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 178 && + node.parent.kind === 179 && node.parent.argumentExpression === node; } function getDefaultLibFilePath(options) { @@ -64528,2662 +72080,254 @@ var ts; throw new Error("getDefaultLibFilePath is only supported when consumed as a node module. "); } ts.getDefaultLibFilePath = getDefaultLibFilePath; - function initializeServices() { - ts.objectAllocator = getServicesObjectAllocator(); - } - initializeServices(); + ts.objectAllocator = getServicesObjectAllocator(); })(ts || (ts = {})); var ts; (function (ts) { var server; (function (server) { - var ScriptInfo = (function () { - function ScriptInfo(host, fileName, content, scriptKind, isOpen, hasMixedContent) { - if (isOpen === void 0) { isOpen = false; } - if (hasMixedContent === void 0) { hasMixedContent = false; } - this.host = host; - this.fileName = fileName; - this.scriptKind = scriptKind; - this.isOpen = isOpen; - this.hasMixedContent = hasMixedContent; - this.containingProjects = []; - this.path = ts.toPath(fileName, host.getCurrentDirectory(), ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames)); - this.svc = server.ScriptVersionCache.fromString(host, content); - this.scriptKind = scriptKind - ? scriptKind - : ts.getScriptKindFromFileName(fileName); - } - ScriptInfo.prototype.getFormatCodeSettings = function () { - return this.formatCodeSettings; - }; - ScriptInfo.prototype.attachToProject = function (project) { - var isNew = !this.isAttached(project); - if (isNew) { - this.containingProjects.push(project); - } - return isNew; - }; - ScriptInfo.prototype.isAttached = function (project) { - switch (this.containingProjects.length) { - case 0: return false; - case 1: return this.containingProjects[0] === project; - case 2: return this.containingProjects[0] === project || this.containingProjects[1] === project; - default: return ts.contains(this.containingProjects, project); - } - }; - ScriptInfo.prototype.detachFromProject = function (project) { - switch (this.containingProjects.length) { - case 0: - return; - case 1: - if (this.containingProjects[0] === project) { - this.containingProjects.pop(); - } - break; - case 2: - if (this.containingProjects[0] === project) { - this.containingProjects[0] = this.containingProjects.pop(); - } - else if (this.containingProjects[1] === project) { - this.containingProjects.pop(); - } - break; - default: - server.removeItemFromSet(this.containingProjects, project); - break; - } - }; - ScriptInfo.prototype.detachAllProjects = function () { - for (var _i = 0, _a = this.containingProjects; _i < _a.length; _i++) { - var p = _a[_i]; - p.removeFile(this, false); - } - this.containingProjects.length = 0; - }; - ScriptInfo.prototype.getDefaultProject = function () { - if (this.containingProjects.length === 0) { - return server.Errors.ThrowNoProject(); - } - return this.containingProjects[0]; - }; - ScriptInfo.prototype.setFormatOptions = function (formatSettings) { - if (formatSettings) { - if (!this.formatCodeSettings) { - this.formatCodeSettings = server.getDefaultFormatCodeSettings(this.host); - } - server.mergeMaps(this.formatCodeSettings, formatSettings); - } - }; - ScriptInfo.prototype.setWatcher = function (watcher) { - this.stopWatcher(); - this.fileWatcher = watcher; - }; - ScriptInfo.prototype.stopWatcher = function () { - if (this.fileWatcher) { - this.fileWatcher.close(); - this.fileWatcher = undefined; - } - }; - ScriptInfo.prototype.getLatestVersion = function () { - return this.svc.latestVersion().toString(); - }; - ScriptInfo.prototype.reload = function (script) { - this.svc.reload(script); - this.markContainingProjectsAsDirty(); - }; - ScriptInfo.prototype.saveTo = function (fileName) { - var snap = this.snap(); - this.host.writeFile(fileName, snap.getText(0, snap.getLength())); - }; - ScriptInfo.prototype.reloadFromFile = function (tempFileName) { - if (this.hasMixedContent) { - this.reload(""); - } - else { - this.svc.reloadFromFile(tempFileName || this.fileName); - this.markContainingProjectsAsDirty(); - } - }; - ScriptInfo.prototype.snap = function () { - return this.svc.getSnapshot(); - }; - ScriptInfo.prototype.getLineInfo = function (line) { - var snap = this.snap(); - return snap.index.lineNumberToInfo(line); - }; - ScriptInfo.prototype.editContent = function (start, end, newText) { - this.svc.edit(start, end - start, newText); - this.markContainingProjectsAsDirty(); - }; - ScriptInfo.prototype.markContainingProjectsAsDirty = function () { - for (var _i = 0, _a = this.containingProjects; _i < _a.length; _i++) { - var p = _a[_i]; - p.markAsDirty(); - } - }; - ScriptInfo.prototype.lineToTextSpan = function (line) { - var index = this.snap().index; - var lineInfo = index.lineNumberToInfo(line + 1); - var len; - if (lineInfo.leaf) { - len = lineInfo.leaf.text.length; - } - else { - var nextLineInfo = index.lineNumberToInfo(line + 2); - len = nextLineInfo.offset - lineInfo.offset; - } - return ts.createTextSpan(lineInfo.offset, len); - }; - ScriptInfo.prototype.lineOffsetToPosition = function (line, offset) { - var index = this.snap().index; - var lineInfo = index.lineNumberToInfo(line); - return (lineInfo.offset + offset - 1); - }; - ScriptInfo.prototype.positionToLineOffset = function (position) { - var index = this.snap().index; - var lineOffset = index.charOffsetToLineNumberAndPos(position); - return { line: lineOffset.line, offset: lineOffset.offset + 1 }; - }; - return ScriptInfo; - }()); - server.ScriptInfo = ScriptInfo; + server.ActionSet = "action::set"; + server.ActionInvalidate = "action::invalidate"; + server.EventBeginInstallTypes = "event::beginInstallTypes"; + server.EventEndInstallTypes = "event::endInstallTypes"; + server.EventInitializationFailed = "event::initializationFailed"; + var Arguments; + (function (Arguments) { + Arguments.GlobalCacheLocation = "--globalTypingsCacheLocation"; + Arguments.LogFile = "--logFile"; + Arguments.EnableTelemetry = "--enableTelemetry"; + Arguments.TypingSafeListLocation = "--typingSafeListLocation"; + })(Arguments = server.Arguments || (server.Arguments = {})); + function hasArgument(argumentName) { + return ts.sys.args.indexOf(argumentName) >= 0; + } + server.hasArgument = hasArgument; + function findArgument(argumentName) { + var index = ts.sys.args.indexOf(argumentName); + return index >= 0 && index < ts.sys.args.length - 1 + ? ts.sys.args[index + 1] + : undefined; + } + server.findArgument = findArgument; })(server = ts.server || (ts.server = {})); })(ts || (ts = {})); var ts; (function (ts) { var server; (function (server) { - var LSHost = (function () { - function LSHost(host, project, cancellationToken) { - var _this = this; - this.host = host; - this.project = project; - this.cancellationToken = cancellationToken; - this.resolvedModuleNames = ts.createFileMap(); - this.resolvedTypeReferenceDirectives = ts.createFileMap(); - this.getCanonicalFileName = ts.createGetCanonicalFileName(this.host.useCaseSensitiveFileNames); - if (host.trace) { - this.trace = function (s) { return host.trace(s); }; - } - this.resolveModuleName = function (moduleName, containingFile, compilerOptions, host) { - var globalCache = _this.project.getTypeAcquisition().enable - ? _this.project.projectService.typingsInstaller.globalTypingsCacheLocation - : undefined; - var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host); - if (!(primaryResult.resolvedModule && ts.extensionIsTypeScript(primaryResult.resolvedModule.extension)) && globalCache !== undefined) { - var _a = ts.loadModuleFromGlobalCache(moduleName, _this.project.getProjectName(), compilerOptions, host, globalCache), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations; - if (resolvedModule) { - return { resolvedModule: resolvedModule, failedLookupLocations: primaryResult.failedLookupLocations.concat(failedLookupLocations) }; - } - } - return primaryResult; - }; - if (this.host.realpath) { - this.realpath = function (path) { return _this.host.realpath(path); }; - } - } - LSHost.prototype.startRecordingFilesWithChangedResolutions = function () { - this.filesWithChangedSetOfUnresolvedImports = []; - }; - LSHost.prototype.finishRecordingFilesWithChangedResolutions = function () { - var collected = this.filesWithChangedSetOfUnresolvedImports; - this.filesWithChangedSetOfUnresolvedImports = undefined; - return collected; - }; - LSHost.prototype.resolveNamesWithLocalCache = function (names, containingFile, cache, loader, getResult, getResultFileName, logChanges) { - var path = ts.toPath(containingFile, this.host.getCurrentDirectory(), this.getCanonicalFileName); - var currentResolutionsInFile = cache.get(path); - var newResolutions = ts.createMap(); - var resolvedModules = []; - var compilerOptions = this.getCompilationSettings(); - var lastDeletedFileName = this.project.projectService.lastDeletedFile && this.project.projectService.lastDeletedFile.fileName; - for (var _i = 0, names_2 = names; _i < names_2.length; _i++) { - var name_49 = names_2[_i]; - var resolution = newResolutions[name_49]; - if (!resolution) { - var existingResolution = currentResolutionsInFile && currentResolutionsInFile[name_49]; - if (moduleResolutionIsValid(existingResolution)) { - resolution = existingResolution; - } - else { - newResolutions[name_49] = resolution = loader(name_49, containingFile, compilerOptions, this); - } - if (logChanges && this.filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) { - this.filesWithChangedSetOfUnresolvedImports.push(path); - logChanges = false; - } - } - ts.Debug.assert(resolution !== undefined); - resolvedModules.push(getResult(resolution)); - } - cache.set(path, newResolutions); - return resolvedModules; - function resolutionIsEqualTo(oldResolution, newResolution) { - if (oldResolution === newResolution) { - return true; - } - if (!oldResolution || !newResolution) { - return false; - } - var oldResult = getResult(oldResolution); - var newResult = getResult(newResolution); - if (oldResult === newResult) { - return true; - } - if (!oldResult || !newResult) { - return false; - } - return getResultFileName(oldResult) === getResultFileName(newResult); - } - function moduleResolutionIsValid(resolution) { - if (!resolution) { - return false; - } - var result = getResult(resolution); - if (result) { - return getResultFileName(result) !== lastDeletedFileName; - } - return resolution.failedLookupLocations.length === 0; - } - }; - LSHost.prototype.getProjectVersion = function () { - return this.project.getProjectVersion(); - }; - LSHost.prototype.getCompilationSettings = function () { - return this.compilationSettings; - }; - LSHost.prototype.useCaseSensitiveFileNames = function () { - return this.host.useCaseSensitiveFileNames; - }; - LSHost.prototype.getCancellationToken = function () { - return this.cancellationToken; - }; - LSHost.prototype.resolveTypeReferenceDirectives = function (typeDirectiveNames, containingFile) { - return this.resolveNamesWithLocalCache(typeDirectiveNames, containingFile, this.resolvedTypeReferenceDirectives, ts.resolveTypeReferenceDirective, function (m) { return m.resolvedTypeReferenceDirective; }, function (r) { return r.resolvedFileName; }, false); - }; - LSHost.prototype.resolveModuleNames = function (moduleNames, containingFile) { - return this.resolveNamesWithLocalCache(moduleNames, containingFile, this.resolvedModuleNames, this.resolveModuleName, function (m) { return m.resolvedModule; }, function (r) { return r.resolvedFileName; }, true); - }; - LSHost.prototype.getDefaultLibFileName = function () { - var nodeModuleBinDir = ts.getDirectoryPath(ts.normalizePath(this.host.getExecutingFilePath())); - return ts.combinePaths(nodeModuleBinDir, ts.getDefaultLibFileName(this.compilationSettings)); - }; - LSHost.prototype.getScriptSnapshot = function (filename) { - var scriptInfo = this.project.getScriptInfoLSHost(filename); - if (scriptInfo) { - return scriptInfo.snap(); - } - }; - LSHost.prototype.getScriptFileNames = function () { - return this.project.getRootFilesLSHost(); - }; - LSHost.prototype.getTypeRootsVersion = function () { - return this.project.typesVersion; - }; - LSHost.prototype.getScriptKind = function (fileName) { - var info = this.project.getScriptInfoLSHost(fileName); - return info && info.scriptKind; - }; - LSHost.prototype.getScriptVersion = function (filename) { - var info = this.project.getScriptInfoLSHost(filename); - return info && info.getLatestVersion(); - }; - LSHost.prototype.getCurrentDirectory = function () { - return this.host.getCurrentDirectory(); - }; - LSHost.prototype.resolvePath = function (path) { - return this.host.resolvePath(path); - }; - LSHost.prototype.fileExists = function (path) { - return this.host.fileExists(path); - }; - LSHost.prototype.readFile = function (fileName) { - return this.host.readFile(fileName); - }; - LSHost.prototype.directoryExists = function (path) { - return this.host.directoryExists(path); - }; - LSHost.prototype.readDirectory = function (path, extensions, exclude, include) { - return this.host.readDirectory(path, extensions, exclude, include); - }; - LSHost.prototype.getDirectories = function (path) { - return this.host.getDirectories(path); - }; - LSHost.prototype.notifyFileRemoved = function (info) { - this.resolvedModuleNames.remove(info.path); - this.resolvedTypeReferenceDirectives.remove(info.path); - }; - LSHost.prototype.setCompilationSettings = function (opt) { - if (ts.changesAffectModuleResolution(this.compilationSettings, opt)) { - this.resolvedModuleNames.clear(); - this.resolvedTypeReferenceDirectives.clear(); - } - this.compilationSettings = opt; - }; - return LSHost; - }()); - server.LSHost = LSHost; - })(server = ts.server || (ts.server = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var server; - (function (server) { - server.nullTypingsInstaller = { - enqueueInstallTypingsRequest: ts.noop, - attach: ts.noop, - onProjectClosed: ts.noop, - globalTypingsCacheLocation: undefined - }; - var TypingsCacheEntry = (function () { - function TypingsCacheEntry() { - } - return TypingsCacheEntry; - }()); - function setIsEqualTo(arr1, arr2) { - if (arr1 === arr2) { - return true; - } - if ((arr1 || server.emptyArray).length === 0 && (arr2 || server.emptyArray).length === 0) { - return true; - } - var set = ts.createMap(); - var unique = 0; - for (var _i = 0, arr1_1 = arr1; _i < arr1_1.length; _i++) { - var v = arr1_1[_i]; - if (set[v] !== true) { - set[v] = true; - unique++; - } - } - for (var _a = 0, arr2_1 = arr2; _a < arr2_1.length; _a++) { - var v = arr2_1[_a]; - if (!ts.hasProperty(set, v)) { - return false; - } - if (set[v] === true) { - set[v] = false; - unique--; - } - } - return unique === 0; - } - function typeAcquisitionChanged(opt1, opt2) { - return opt1.enable !== opt2.enable || - !setIsEqualTo(opt1.include, opt2.include) || - !setIsEqualTo(opt1.exclude, opt2.exclude); - } - function compilerOptionsChanged(opt1, opt2) { - return opt1.allowJs != opt2.allowJs; - } - function unresolvedImportsChanged(imports1, imports2) { - if (imports1 === imports2) { - return false; - } - return !ts.arrayIsEqualTo(imports1, imports2); - } - var TypingsCache = (function () { - function TypingsCache(installer) { - this.installer = installer; - this.perProjectCache = ts.createMap(); - } - TypingsCache.prototype.getTypingsForProject = function (project, unresolvedImports, forceRefresh) { - var typeAcquisition = project.getTypeAcquisition(); - if (!typeAcquisition || !typeAcquisition.enable) { - return server.emptyArray; - } - var entry = this.perProjectCache[project.getProjectName()]; - var result = entry ? entry.typings : server.emptyArray; - if (forceRefresh || - !entry || - typeAcquisitionChanged(typeAcquisition, entry.typeAcquisition) || - compilerOptionsChanged(project.getCompilerOptions(), entry.compilerOptions) || - unresolvedImportsChanged(unresolvedImports, entry.unresolvedImports)) { - this.perProjectCache[project.getProjectName()] = { - compilerOptions: project.getCompilerOptions(), - typeAcquisition: typeAcquisition, - typings: result, - unresolvedImports: unresolvedImports, - poisoned: true - }; - this.installer.enqueueInstallTypingsRequest(project, typeAcquisition, unresolvedImports); - } - return result; - }; - TypingsCache.prototype.updateTypingsForProject = function (projectName, compilerOptions, typeAcquisition, unresolvedImports, newTypings) { - this.perProjectCache[projectName] = { - compilerOptions: compilerOptions, - typeAcquisition: typeAcquisition, - typings: server.toSortedReadonlyArray(newTypings), - unresolvedImports: unresolvedImports, - poisoned: false - }; - }; - TypingsCache.prototype.deleteTypingsForProject = function (projectName) { - delete this.perProjectCache[projectName]; - }; - TypingsCache.prototype.onProjectClosed = function (project) { - delete this.perProjectCache[project.getProjectName()]; - this.installer.onProjectClosed(project); - }; - return TypingsCache; - }()); - server.TypingsCache = TypingsCache; - })(server = ts.server || (ts.server = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var server; - (function (server) { - function shouldEmitFile(scriptInfo) { - return !scriptInfo.hasMixedContent; - } - server.shouldEmitFile = shouldEmitFile; - var BuilderFileInfo = (function () { - function BuilderFileInfo(scriptInfo, project) { - this.scriptInfo = scriptInfo; - this.project = project; - } - BuilderFileInfo.prototype.isExternalModuleOrHasOnlyAmbientExternalModules = function () { - var sourceFile = this.getSourceFile(); - return ts.isExternalModule(sourceFile) || this.containsOnlyAmbientModules(sourceFile); - }; - BuilderFileInfo.prototype.containsOnlyAmbientModules = function (sourceFile) { - for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { - var statement = _a[_i]; - if (statement.kind !== 230 || statement.name.kind !== 9) { - return false; - } - } - return true; - }; - BuilderFileInfo.prototype.computeHash = function (text) { - return this.project.projectService.host.createHash(text); - }; - BuilderFileInfo.prototype.getSourceFile = function () { - return this.project.getSourceFile(this.scriptInfo.path); - }; - BuilderFileInfo.prototype.updateShapeSignature = function () { - var sourceFile = this.getSourceFile(); - if (!sourceFile) { - return true; - } - var lastSignature = this.lastCheckedShapeSignature; - if (sourceFile.isDeclarationFile) { - this.lastCheckedShapeSignature = this.computeHash(sourceFile.text); - } - else { - var emitOutput = this.project.getFileEmitOutput(this.scriptInfo, true); - if (emitOutput.outputFiles && emitOutput.outputFiles.length > 0) { - this.lastCheckedShapeSignature = this.computeHash(emitOutput.outputFiles[0].text); - } - } - return !lastSignature || this.lastCheckedShapeSignature !== lastSignature; - }; - return BuilderFileInfo; - }()); - server.BuilderFileInfo = BuilderFileInfo; - var AbstractBuilder = (function () { - function AbstractBuilder(project, ctor) { - this.project = project; - this.ctor = ctor; - this.fileInfos = ts.createFileMap(); - } - AbstractBuilder.prototype.getFileInfo = function (path) { - return this.fileInfos.get(path); - }; - AbstractBuilder.prototype.getOrCreateFileInfo = function (path) { - var fileInfo = this.getFileInfo(path); - if (!fileInfo) { - var scriptInfo = this.project.getScriptInfo(path); - fileInfo = new this.ctor(scriptInfo, this.project); - this.setFileInfo(path, fileInfo); - } - return fileInfo; - }; - AbstractBuilder.prototype.getFileInfoPaths = function () { - return this.fileInfos.getKeys(); - }; - AbstractBuilder.prototype.setFileInfo = function (path, info) { - this.fileInfos.set(path, info); - }; - AbstractBuilder.prototype.removeFileInfo = function (path) { - this.fileInfos.remove(path); - }; - AbstractBuilder.prototype.forEachFileInfo = function (action) { - this.fileInfos.forEachValue(function (_path, value) { return action(value); }); - }; - AbstractBuilder.prototype.emitFile = function (scriptInfo, writeFile) { - var fileInfo = this.getFileInfo(scriptInfo.path); - if (!fileInfo) { - return false; - } - var _a = this.project.getFileEmitOutput(fileInfo.scriptInfo, false), emitSkipped = _a.emitSkipped, outputFiles = _a.outputFiles; - if (!emitSkipped) { - var projectRootPath = this.project.getProjectRootPath(); - for (var _i = 0, outputFiles_1 = outputFiles; _i < outputFiles_1.length; _i++) { - var outputFile = outputFiles_1[_i]; - var outputFileAbsoluteFileName = ts.getNormalizedAbsolutePath(outputFile.name, projectRootPath ? projectRootPath : ts.getDirectoryPath(scriptInfo.fileName)); - writeFile(outputFileAbsoluteFileName, outputFile.text, outputFile.writeByteOrderMark); - } - } - return !emitSkipped; - }; - return AbstractBuilder; - }()); - var NonModuleBuilder = (function (_super) { - __extends(NonModuleBuilder, _super); - function NonModuleBuilder(project) { - var _this = _super.call(this, project, BuilderFileInfo) || this; - _this.project = project; - return _this; - } - NonModuleBuilder.prototype.onProjectUpdateGraph = function () { - }; - NonModuleBuilder.prototype.getFilesAffectedBy = function (scriptInfo) { - var info = this.getOrCreateFileInfo(scriptInfo.path); - var singleFileResult = scriptInfo.hasMixedContent ? [] : [scriptInfo.fileName]; - if (info.updateShapeSignature()) { - var options = this.project.getCompilerOptions(); - if (options && (options.out || options.outFile)) { - return singleFileResult; - } - return this.project.getAllEmittableFiles(); - } - return singleFileResult; - }; - return NonModuleBuilder; - }(AbstractBuilder)); - var ModuleBuilderFileInfo = (function (_super) { - __extends(ModuleBuilderFileInfo, _super); - function ModuleBuilderFileInfo() { - var _this = _super.apply(this, arguments) || this; - _this.references = []; - _this.referencedBy = []; - return _this; - } - ModuleBuilderFileInfo.compareFileInfos = function (lf, rf) { - var l = lf.scriptInfo.fileName; - var r = rf.scriptInfo.fileName; - return (l < r ? -1 : (l > r ? 1 : 0)); - }; - ; - ModuleBuilderFileInfo.addToReferenceList = function (array, fileInfo) { - if (array.length === 0) { - array.push(fileInfo); - return; - } - var insertIndex = ts.binarySearch(array, fileInfo, ModuleBuilderFileInfo.compareFileInfos); - if (insertIndex < 0) { - array.splice(~insertIndex, 0, fileInfo); - } - }; - ModuleBuilderFileInfo.removeFromReferenceList = function (array, fileInfo) { - if (!array || array.length === 0) { - return; - } - if (array[0] === fileInfo) { - array.splice(0, 1); - return; - } - var removeIndex = ts.binarySearch(array, fileInfo, ModuleBuilderFileInfo.compareFileInfos); - if (removeIndex >= 0) { - array.splice(removeIndex, 1); - } - }; - ModuleBuilderFileInfo.prototype.addReferencedBy = function (fileInfo) { - ModuleBuilderFileInfo.addToReferenceList(this.referencedBy, fileInfo); - }; - ModuleBuilderFileInfo.prototype.removeReferencedBy = function (fileInfo) { - ModuleBuilderFileInfo.removeFromReferenceList(this.referencedBy, fileInfo); - }; - ModuleBuilderFileInfo.prototype.removeFileReferences = function () { - for (var _i = 0, _a = this.references; _i < _a.length; _i++) { - var reference = _a[_i]; - reference.removeReferencedBy(this); - } - this.references = []; - }; - return ModuleBuilderFileInfo; - }(BuilderFileInfo)); - var ModuleBuilder = (function (_super) { - __extends(ModuleBuilder, _super); - function ModuleBuilder(project) { - var _this = _super.call(this, project, ModuleBuilderFileInfo) || this; - _this.project = project; - return _this; - } - ModuleBuilder.prototype.getReferencedFileInfos = function (fileInfo) { - var _this = this; - if (!fileInfo.isExternalModuleOrHasOnlyAmbientExternalModules()) { - return []; - } - var referencedFilePaths = this.project.getReferencedFiles(fileInfo.scriptInfo.path); - if (referencedFilePaths.length > 0) { - return ts.map(referencedFilePaths, function (f) { return _this.getOrCreateFileInfo(f); }).sort(ModuleBuilderFileInfo.compareFileInfos); - } - return []; - }; - ModuleBuilder.prototype.onProjectUpdateGraph = function () { - this.ensureProjectDependencyGraphUpToDate(); - }; - ModuleBuilder.prototype.ensureProjectDependencyGraphUpToDate = function () { - var _this = this; - if (!this.projectVersionForDependencyGraph || this.project.getProjectVersion() !== this.projectVersionForDependencyGraph) { - var currentScriptInfos = this.project.getScriptInfos(); - for (var _i = 0, currentScriptInfos_1 = currentScriptInfos; _i < currentScriptInfos_1.length; _i++) { - var scriptInfo = currentScriptInfos_1[_i]; - var fileInfo = this.getOrCreateFileInfo(scriptInfo.path); - this.updateFileReferences(fileInfo); - } - this.forEachFileInfo(function (fileInfo) { - if (!_this.project.containsScriptInfo(fileInfo.scriptInfo)) { - fileInfo.removeFileReferences(); - _this.removeFileInfo(fileInfo.scriptInfo.path); - } - }); - this.projectVersionForDependencyGraph = this.project.getProjectVersion(); - } - }; - ModuleBuilder.prototype.updateFileReferences = function (fileInfo) { - if (fileInfo.scriptVersionForReferences === fileInfo.scriptInfo.getLatestVersion()) { - return; - } - var newReferences = this.getReferencedFileInfos(fileInfo); - var oldReferences = fileInfo.references; - var oldIndex = 0; - var newIndex = 0; - while (oldIndex < oldReferences.length && newIndex < newReferences.length) { - var oldReference = oldReferences[oldIndex]; - var newReference = newReferences[newIndex]; - var compare = ModuleBuilderFileInfo.compareFileInfos(oldReference, newReference); - if (compare < 0) { - oldReference.removeReferencedBy(fileInfo); - oldIndex++; - } - else if (compare > 0) { - newReference.addReferencedBy(fileInfo); - newIndex++; - } - else { - oldIndex++; - newIndex++; - } - } - for (var i = oldIndex; i < oldReferences.length; i++) { - oldReferences[i].removeReferencedBy(fileInfo); - } - for (var i = newIndex; i < newReferences.length; i++) { - newReferences[i].addReferencedBy(fileInfo); - } - fileInfo.references = newReferences; - fileInfo.scriptVersionForReferences = fileInfo.scriptInfo.getLatestVersion(); - }; - ModuleBuilder.prototype.getFilesAffectedBy = function (scriptInfo) { - this.ensureProjectDependencyGraphUpToDate(); - var singleFileResult = scriptInfo.hasMixedContent ? [] : [scriptInfo.fileName]; - var fileInfo = this.getFileInfo(scriptInfo.path); - if (!fileInfo || !fileInfo.updateShapeSignature()) { - return singleFileResult; - } - if (!fileInfo.isExternalModuleOrHasOnlyAmbientExternalModules()) { - return this.project.getAllEmittableFiles(); - } - var options = this.project.getCompilerOptions(); - if (options && (options.isolatedModules || options.out || options.outFile)) { - return singleFileResult; - } - var queue = fileInfo.referencedBy.slice(0); - var fileNameSet = ts.createMap(); - fileNameSet[scriptInfo.fileName] = scriptInfo; - while (queue.length > 0) { - var processingFileInfo = queue.pop(); - if (processingFileInfo.updateShapeSignature() && processingFileInfo.referencedBy.length > 0) { - for (var _i = 0, _a = processingFileInfo.referencedBy; _i < _a.length; _i++) { - var potentialFileInfo = _a[_i]; - if (!fileNameSet[potentialFileInfo.scriptInfo.fileName]) { - queue.push(potentialFileInfo); - } - } - } - fileNameSet[processingFileInfo.scriptInfo.fileName] = processingFileInfo.scriptInfo; - } - var result = []; - for (var fileName in fileNameSet) { - if (shouldEmitFile(fileNameSet[fileName])) { - result.push(fileName); - } - } - return result; - }; - return ModuleBuilder; - }(AbstractBuilder)); - function createBuilder(project) { - var moduleKind = project.getCompilerOptions().module; - switch (moduleKind) { - case ts.ModuleKind.None: - return new NonModuleBuilder(project); - default: - return new ModuleBuilder(project); - } - } - server.createBuilder = createBuilder; - })(server = ts.server || (ts.server = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var server; - (function (server) { - var ProjectKind; - (function (ProjectKind) { - ProjectKind[ProjectKind["Inferred"] = 0] = "Inferred"; - ProjectKind[ProjectKind["Configured"] = 1] = "Configured"; - ProjectKind[ProjectKind["External"] = 2] = "External"; - })(ProjectKind = server.ProjectKind || (server.ProjectKind = {})); - function remove(items, item) { - var index = items.indexOf(item); - if (index >= 0) { - items.splice(index, 1); - } - } - function countEachFileTypes(infos) { - var result = { js: 0, jsx: 0, ts: 0, tsx: 0, dts: 0 }; - for (var _i = 0, infos_1 = infos; _i < infos_1.length; _i++) { - var info = infos_1[_i]; - switch (info.scriptKind) { - case 1: - result.js += 1; - break; - case 2: - result.jsx += 1; - break; - case 3: - ts.fileExtensionIs(info.fileName, ".d.ts") - ? result.dts += 1 - : result.ts += 1; - break; - case 4: - result.tsx += 1; - break; - } - } - return result; - } - function hasOneOrMoreJsAndNoTsFiles(project) { - var counts = countEachFileTypes(project.getScriptInfos()); - return counts.js > 0 && counts.ts === 0 && counts.tsx === 0; - } - function allRootFilesAreJsOrDts(project) { - var counts = countEachFileTypes(project.getRootScriptInfos()); - return counts.ts === 0 && counts.tsx === 0; - } - server.allRootFilesAreJsOrDts = allRootFilesAreJsOrDts; - function allFilesAreJsOrDts(project) { - var counts = countEachFileTypes(project.getScriptInfos()); - return counts.ts === 0 && counts.tsx === 0; - } - server.allFilesAreJsOrDts = allFilesAreJsOrDts; - var UnresolvedImportsMap = (function () { - function UnresolvedImportsMap() { - this.perFileMap = ts.createFileMap(); - this.version = 0; - } - UnresolvedImportsMap.prototype.clear = function () { - this.perFileMap.clear(); - this.version = 0; - }; - UnresolvedImportsMap.prototype.getVersion = function () { - return this.version; - }; - UnresolvedImportsMap.prototype.remove = function (path) { - this.perFileMap.remove(path); - this.version++; - }; - UnresolvedImportsMap.prototype.get = function (path) { - return this.perFileMap.get(path); - }; - UnresolvedImportsMap.prototype.set = function (path, value) { - this.perFileMap.set(path, value); - this.version++; - }; - return UnresolvedImportsMap; - }()); - server.UnresolvedImportsMap = UnresolvedImportsMap; - var emptyResult = []; - var getEmptyResult = function () { return emptyResult; }; - var getUndefined = function () { return undefined; }; - var emptyEncodedSemanticClassifications = { spans: emptyResult, endOfLineState: 0 }; - function createNoSemanticFeaturesWrapper(realLanguageService) { - return { - cleanupSemanticCache: ts.noop, - getSyntacticDiagnostics: function (fileName) { - return fileName ? realLanguageService.getSyntacticDiagnostics(fileName) : emptyResult; - }, - getSemanticDiagnostics: getEmptyResult, - getCompilerOptionsDiagnostics: function () { - return realLanguageService.getCompilerOptionsDiagnostics(); - }, - getSyntacticClassifications: function (fileName, span) { - return realLanguageService.getSyntacticClassifications(fileName, span); - }, - getEncodedSyntacticClassifications: function (fileName, span) { - return realLanguageService.getEncodedSyntacticClassifications(fileName, span); - }, - getSemanticClassifications: getEmptyResult, - getEncodedSemanticClassifications: function () { - return emptyEncodedSemanticClassifications; - }, - getCompletionsAtPosition: getUndefined, - findReferences: getEmptyResult, - getCompletionEntryDetails: getUndefined, - getQuickInfoAtPosition: getUndefined, - findRenameLocations: getEmptyResult, - getNameOrDottedNameSpan: function (fileName, startPos, endPos) { - return realLanguageService.getNameOrDottedNameSpan(fileName, startPos, endPos); - }, - getBreakpointStatementAtPosition: function (fileName, position) { - return realLanguageService.getBreakpointStatementAtPosition(fileName, position); - }, - getBraceMatchingAtPosition: function (fileName, position) { - return realLanguageService.getBraceMatchingAtPosition(fileName, position); - }, - getSignatureHelpItems: getUndefined, - getDefinitionAtPosition: getEmptyResult, - getRenameInfo: function () { return ({ - canRename: false, - localizedErrorMessage: ts.getLocaleSpecificMessage(ts.Diagnostics.Language_service_is_disabled), - displayName: undefined, - fullDisplayName: undefined, - kind: undefined, - kindModifiers: undefined, - triggerSpan: undefined - }); }, - getTypeDefinitionAtPosition: getUndefined, - getReferencesAtPosition: getEmptyResult, - getDocumentHighlights: getEmptyResult, - getOccurrencesAtPosition: getEmptyResult, - getNavigateToItems: getEmptyResult, - getNavigationBarItems: function (fileName) { - return realLanguageService.getNavigationBarItems(fileName); - }, - getNavigationTree: function (fileName) { - return realLanguageService.getNavigationTree(fileName); - }, - getOutliningSpans: function (fileName) { - return realLanguageService.getOutliningSpans(fileName); - }, - getTodoComments: getEmptyResult, - getIndentationAtPosition: function (fileName, position, options) { - return realLanguageService.getIndentationAtPosition(fileName, position, options); - }, - getFormattingEditsForRange: function (fileName, start, end, options) { - return realLanguageService.getFormattingEditsForRange(fileName, start, end, options); - }, - getFormattingEditsForDocument: function (fileName, options) { - return realLanguageService.getFormattingEditsForDocument(fileName, options); - }, - getFormattingEditsAfterKeystroke: function (fileName, position, key, options) { - return realLanguageService.getFormattingEditsAfterKeystroke(fileName, position, key, options); - }, - getDocCommentTemplateAtPosition: function (fileName, position) { - return realLanguageService.getDocCommentTemplateAtPosition(fileName, position); - }, - isValidBraceCompletionAtPosition: function (fileName, position, openingBrace) { - return realLanguageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace); - }, - getEmitOutput: getUndefined, - getProgram: function () { - return realLanguageService.getProgram(); - }, - getNonBoundSourceFile: function (fileName) { - return realLanguageService.getNonBoundSourceFile(fileName); - }, - dispose: function () { - return realLanguageService.dispose(); - }, - getCompletionEntrySymbol: getUndefined, - getImplementationAtPosition: getEmptyResult, - getSourceFile: function (fileName) { - return realLanguageService.getSourceFile(fileName); - }, - getCodeFixesAtPosition: getEmptyResult - }; - } - server.createNoSemanticFeaturesWrapper = createNoSemanticFeaturesWrapper; - var Project = (function () { - function Project(projectName, projectKind, projectService, documentRegistry, hasExplicitListOfFiles, languageServiceEnabled, compilerOptions, compileOnSaveEnabled) { - this.projectName = projectName; - this.projectKind = projectKind; - this.projectService = projectService; - this.documentRegistry = documentRegistry; - this.compilerOptions = compilerOptions; - this.compileOnSaveEnabled = compileOnSaveEnabled; - this.rootFiles = []; - this.rootFilesMap = ts.createFileMap(); - this.cachedUnresolvedImportsPerFile = new UnresolvedImportsMap(); - this.languageServiceEnabled = true; - this.lastReportedVersion = 0; - this.projectStructureVersion = 0; - this.projectStateVersion = 0; - this.typesVersion = 0; - if (!this.compilerOptions) { - this.compilerOptions = ts.getDefaultCompilerOptions(); - this.compilerOptions.allowNonTsExtensions = true; - this.compilerOptions.allowJs = true; - } - else if (hasExplicitListOfFiles) { - this.compilerOptions.allowNonTsExtensions = true; - } - if (this.projectKind === ProjectKind.Inferred || this.projectKind === ProjectKind.External) { - this.compilerOptions.noEmitForJsFiles = true; - } - this.lsHost = new server.LSHost(this.projectService.host, this, this.projectService.cancellationToken); - this.lsHost.setCompilationSettings(this.compilerOptions); - this.languageService = ts.createLanguageService(this.lsHost, this.documentRegistry); - this.noSemanticFeaturesLanguageService = createNoSemanticFeaturesWrapper(this.languageService); - if (!languageServiceEnabled) { - this.disableLanguageService(); - } - this.builder = server.createBuilder(this); - this.markAsDirty(); - } - Project.prototype.isNonTsProject = function () { - this.updateGraph(); - return allFilesAreJsOrDts(this); - }; - Project.prototype.isJsOnlyProject = function () { - this.updateGraph(); - return hasOneOrMoreJsAndNoTsFiles(this); - }; - Project.prototype.getCachedUnresolvedImportsPerFile_TestOnly = function () { - return this.cachedUnresolvedImportsPerFile; - }; - Project.prototype.getProjectErrors = function () { - return this.projectErrors; - }; - Project.prototype.getLanguageService = function (ensureSynchronized) { - if (ensureSynchronized === void 0) { ensureSynchronized = true; } - if (ensureSynchronized) { - this.updateGraph(); - } - return this.languageServiceEnabled - ? this.languageService - : this.noSemanticFeaturesLanguageService; - }; - Project.prototype.getCompileOnSaveAffectedFileList = function (scriptInfo) { - if (!this.languageServiceEnabled) { - return []; - } - this.updateGraph(); - return this.builder.getFilesAffectedBy(scriptInfo); - }; - Project.prototype.getProjectVersion = function () { - return this.projectStateVersion.toString(); - }; - Project.prototype.enableLanguageService = function () { - if (this.languageServiceEnabled) { - return; - } - this.languageServiceEnabled = true; - this.projectService.onUpdateLanguageServiceStateForProject(this, true); - }; - Project.prototype.disableLanguageService = function () { - if (!this.languageServiceEnabled) { - return; - } - this.languageService.cleanupSemanticCache(); - this.languageServiceEnabled = false; - this.projectService.onUpdateLanguageServiceStateForProject(this, false); - }; - Project.prototype.getProjectName = function () { - return this.projectName; - }; - Project.prototype.getSourceFile = function (path) { - if (!this.program) { - return undefined; - } - return this.program.getSourceFileByPath(path); - }; - Project.prototype.updateTypes = function () { - this.typesVersion++; - this.markAsDirty(); - this.updateGraph(); - }; - Project.prototype.close = function () { - if (this.program) { - for (var _i = 0, _a = this.program.getSourceFiles(); _i < _a.length; _i++) { - var f = _a[_i]; - var info = this.projectService.getScriptInfo(f.fileName); - info.detachFromProject(this); - } - } - else { - for (var _b = 0, _c = this.rootFiles; _b < _c.length; _b++) { - var root = _c[_b]; - root.detachFromProject(this); - } - } - this.rootFiles = undefined; - this.rootFilesMap = undefined; - this.program = undefined; - this.languageService.dispose(); - }; - Project.prototype.getCompilerOptions = function () { - return this.compilerOptions; - }; - Project.prototype.hasRoots = function () { - return this.rootFiles && this.rootFiles.length > 0; - }; - Project.prototype.getRootFiles = function () { - return this.rootFiles && this.rootFiles.map(function (info) { return info.fileName; }); - }; - Project.prototype.getRootFilesLSHost = function () { - var result = []; - if (this.rootFiles) { - for (var _i = 0, _a = this.rootFiles; _i < _a.length; _i++) { - var f = _a[_i]; - result.push(f.fileName); - } - if (this.typingFiles) { - for (var _b = 0, _c = this.typingFiles; _b < _c.length; _b++) { - var f = _c[_b]; - result.push(f); - } - } - } - return result; - }; - Project.prototype.getRootScriptInfos = function () { - return this.rootFiles; - }; - Project.prototype.getScriptInfos = function () { - var _this = this; - return ts.map(this.program.getSourceFiles(), function (sourceFile) { - var scriptInfo = _this.projectService.getScriptInfoForPath(sourceFile.path); - if (!scriptInfo) { - ts.Debug.assert(false, "scriptInfo for a file '" + sourceFile.fileName + "' is missing."); - } - return scriptInfo; - }); - }; - Project.prototype.getFileEmitOutput = function (info, emitOnlyDtsFiles) { - if (!this.languageServiceEnabled) { - return undefined; - } - return this.getLanguageService().getEmitOutput(info.fileName, emitOnlyDtsFiles); - }; - Project.prototype.getFileNames = function (excludeFilesFromExternalLibraries) { - if (!this.program) { - return []; - } - if (!this.languageServiceEnabled) { - var rootFiles = this.getRootFiles(); - if (this.compilerOptions) { - var defaultLibrary = ts.getDefaultLibFilePath(this.compilerOptions); - if (defaultLibrary) { - (rootFiles || (rootFiles = [])).push(server.asNormalizedPath(defaultLibrary)); - } - } - return rootFiles; - } - var result = []; - for (var _i = 0, _a = this.program.getSourceFiles(); _i < _a.length; _i++) { - var f = _a[_i]; - if (excludeFilesFromExternalLibraries && this.program.isSourceFileFromExternalLibrary(f)) { - continue; - } - result.push(server.asNormalizedPath(f.fileName)); - } - return result; - }; - Project.prototype.getAllEmittableFiles = function () { - if (!this.languageServiceEnabled) { - return []; - } - var defaultLibraryFileName = ts.getDefaultLibFileName(this.compilerOptions); - var infos = this.getScriptInfos(); - var result = []; - for (var _i = 0, infos_2 = infos; _i < infos_2.length; _i++) { - var info = infos_2[_i]; - if (ts.getBaseFileName(info.fileName) !== defaultLibraryFileName && server.shouldEmitFile(info)) { - result.push(info.fileName); - } - } - return result; - }; - Project.prototype.containsScriptInfo = function (info) { - return this.isRoot(info) || (this.program && this.program.getSourceFileByPath(info.path) !== undefined); - }; - Project.prototype.containsFile = function (filename, requireOpen) { - var info = this.projectService.getScriptInfoForNormalizedPath(filename); - if (info && (info.isOpen || !requireOpen)) { - return this.containsScriptInfo(info); - } - }; - Project.prototype.isRoot = function (info) { - return this.rootFilesMap && this.rootFilesMap.contains(info.path); - }; - Project.prototype.addRoot = function (info) { - if (!this.isRoot(info)) { - this.rootFiles.push(info); - this.rootFilesMap.set(info.path, info); - info.attachToProject(this); - this.markAsDirty(); - } - }; - Project.prototype.removeFile = function (info, detachFromProject) { - if (detachFromProject === void 0) { detachFromProject = true; } - this.removeRootFileIfNecessary(info); - this.lsHost.notifyFileRemoved(info); - this.cachedUnresolvedImportsPerFile.remove(info.path); - if (detachFromProject) { - info.detachFromProject(this); - } - this.markAsDirty(); - }; - Project.prototype.markAsDirty = function () { - this.projectStateVersion++; - }; - Project.prototype.extractUnresolvedImportsFromSourceFile = function (file, result) { - var cached = this.cachedUnresolvedImportsPerFile.get(file.path); - if (cached) { - for (var _i = 0, cached_1 = cached; _i < cached_1.length; _i++) { - var f = cached_1[_i]; - result.push(f); - } - return; - } - var unresolvedImports; - if (file.resolvedModules) { - for (var name_50 in file.resolvedModules) { - if (!file.resolvedModules[name_50] && !ts.isExternalModuleNameRelative(name_50)) { - var trimmed = name_50.trim(); - var i = trimmed.indexOf("/"); - if (i !== -1 && trimmed.charCodeAt(0) === 64) { - i = trimmed.indexOf("/", i + 1); - } - if (i !== -1) { - trimmed = trimmed.substr(0, i); - } - (unresolvedImports || (unresolvedImports = [])).push(trimmed); - result.push(trimmed); - } - } - } - this.cachedUnresolvedImportsPerFile.set(file.path, unresolvedImports || server.emptyArray); - }; - Project.prototype.updateGraph = function () { - if (!this.languageServiceEnabled) { - return true; - } - this.lsHost.startRecordingFilesWithChangedResolutions(); - var hasChanges = this.updateGraphWorker(); - var changedFiles = this.lsHost.finishRecordingFilesWithChangedResolutions() || server.emptyArray; - for (var _i = 0, changedFiles_1 = changedFiles; _i < changedFiles_1.length; _i++) { - var file = changedFiles_1[_i]; - this.cachedUnresolvedImportsPerFile.remove(file); - } - var unresolvedImports; - if (hasChanges || changedFiles.length) { - var result = []; - for (var _a = 0, _b = this.program.getSourceFiles(); _a < _b.length; _a++) { - var sourceFile = _b[_a]; - this.extractUnresolvedImportsFromSourceFile(sourceFile, result); - } - this.lastCachedUnresolvedImportsList = server.toSortedReadonlyArray(result); - } - unresolvedImports = this.lastCachedUnresolvedImportsList; - var cachedTypings = this.projectService.typingsCache.getTypingsForProject(this, unresolvedImports, hasChanges); - if (this.setTypings(cachedTypings)) { - hasChanges = this.updateGraphWorker() || hasChanges; - } - if (hasChanges) { - this.projectStructureVersion++; - } - return !hasChanges; - }; - Project.prototype.setTypings = function (typings) { - if (ts.arrayIsEqualTo(this.typingFiles, typings)) { - return false; - } - this.typingFiles = typings; - this.markAsDirty(); - return true; - }; - Project.prototype.updateGraphWorker = function () { - var oldProgram = this.program; - this.program = this.languageService.getProgram(); - var hasChanges = false; - if (!oldProgram || (this.program !== oldProgram && !oldProgram.structureIsReused)) { - hasChanges = true; - if (oldProgram) { - for (var _i = 0, _a = oldProgram.getSourceFiles(); _i < _a.length; _i++) { - var f = _a[_i]; - if (this.program.getSourceFileByPath(f.path)) { - continue; - } - var scriptInfoToDetach = this.projectService.getScriptInfo(f.fileName); - if (scriptInfoToDetach) { - scriptInfoToDetach.detachFromProject(this); - } - } - } - } - this.builder.onProjectUpdateGraph(); - return hasChanges; - }; - Project.prototype.getScriptInfoLSHost = function (fileName) { - var scriptInfo = this.projectService.getOrCreateScriptInfo(fileName, false); - if (scriptInfo) { - scriptInfo.attachToProject(this); - } - return scriptInfo; - }; - Project.prototype.getScriptInfoForNormalizedPath = function (fileName) { - var scriptInfo = this.projectService.getOrCreateScriptInfoForNormalizedPath(fileName, false); - if (scriptInfo && !scriptInfo.isAttached(this)) { - return server.Errors.ThrowProjectDoesNotContainDocument(fileName, this); - } - return scriptInfo; - }; - Project.prototype.getScriptInfo = function (uncheckedFileName) { - return this.getScriptInfoForNormalizedPath(server.toNormalizedPath(uncheckedFileName)); - }; - Project.prototype.filesToString = function () { - if (!this.program) { + var LogLevel; + (function (LogLevel) { + LogLevel[LogLevel["terse"] = 0] = "terse"; + LogLevel[LogLevel["normal"] = 1] = "normal"; + LogLevel[LogLevel["requestTime"] = 2] = "requestTime"; + LogLevel[LogLevel["verbose"] = 3] = "verbose"; + })(LogLevel = server.LogLevel || (server.LogLevel = {})); + server.emptyArray = []; + var Msg; + (function (Msg) { + Msg.Err = "Err"; + Msg.Info = "Info"; + Msg.Perf = "Perf"; + })(Msg = server.Msg || (server.Msg = {})); + function getProjectRootPath(project) { + switch (project.projectKind) { + case server.ProjectKind.Configured: + return ts.getDirectoryPath(project.getProjectName()); + case server.ProjectKind.Inferred: return ""; - } - var strBuilder = ""; - for (var _i = 0, _a = this.program.getSourceFiles(); _i < _a.length; _i++) { - var file = _a[_i]; - strBuilder += file.fileName + "\n"; - } - return strBuilder; - }; - Project.prototype.setCompilerOptions = function (compilerOptions) { - if (compilerOptions) { - if (this.projectKind === ProjectKind.Inferred) { - compilerOptions.allowJs = true; - } - compilerOptions.allowNonTsExtensions = true; - if (ts.changesAffectModuleResolution(this.compilerOptions, compilerOptions)) { - this.cachedUnresolvedImportsPerFile.clear(); - this.lastCachedUnresolvedImportsList = undefined; - } - this.compilerOptions = compilerOptions; - this.lsHost.setCompilationSettings(compilerOptions); - this.markAsDirty(); - } - }; - Project.prototype.reloadScript = function (filename, tempFileName) { - var script = this.projectService.getScriptInfoForNormalizedPath(filename); - if (script) { - ts.Debug.assert(script.isAttached(this)); - script.reloadFromFile(tempFileName); - return true; - } - return false; - }; - Project.prototype.getChangesSinceVersion = function (lastKnownVersion) { - this.updateGraph(); - var info = { - projectName: this.getProjectName(), - version: this.projectStructureVersion, - isInferred: this.projectKind === ProjectKind.Inferred, - options: this.getCompilerOptions() - }; - if (this.lastReportedFileNames && lastKnownVersion === this.lastReportedVersion) { - if (this.projectStructureVersion == this.lastReportedVersion) { - return { info: info, projectErrors: this.projectErrors }; - } - var lastReportedFileNames = this.lastReportedFileNames; - var currentFiles = ts.arrayToMap(this.getFileNames(), function (x) { return x; }); - var added = []; - var removed = []; - for (var id in currentFiles) { - if (!ts.hasProperty(lastReportedFileNames, id)) { - added.push(id); - } - } - for (var id in lastReportedFileNames) { - if (!ts.hasProperty(currentFiles, id)) { - removed.push(id); - } - } - this.lastReportedFileNames = currentFiles; - this.lastReportedVersion = this.projectStructureVersion; - return { info: info, changes: { added: added, removed: removed }, projectErrors: this.projectErrors }; - } - else { - var projectFileNames = this.getFileNames(); - this.lastReportedFileNames = ts.arrayToMap(projectFileNames, function (x) { return x; }); - this.lastReportedVersion = this.projectStructureVersion; - return { info: info, files: projectFileNames, projectErrors: this.projectErrors }; - } - }; - Project.prototype.getReferencedFiles = function (path) { - var _this = this; - if (!this.languageServiceEnabled) { - return []; - } - var sourceFile = this.getSourceFile(path); - if (!sourceFile) { - return []; - } - var referencedFiles = ts.createMap(); - if (sourceFile.imports && sourceFile.imports.length > 0) { - var checker = this.program.getTypeChecker(); - for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { - var importName = _a[_i]; - var symbol = checker.getSymbolAtLocation(importName); - if (symbol && symbol.declarations && symbol.declarations[0]) { - var declarationSourceFile = symbol.declarations[0].getSourceFile(); - if (declarationSourceFile) { - referencedFiles[declarationSourceFile.path] = true; - } - } - } - } - var currentDirectory = ts.getDirectoryPath(path); - var getCanonicalFileName = ts.createGetCanonicalFileName(this.projectService.host.useCaseSensitiveFileNames); - if (sourceFile.referencedFiles && sourceFile.referencedFiles.length > 0) { - for (var _b = 0, _c = sourceFile.referencedFiles; _b < _c.length; _b++) { - var referencedFile = _c[_b]; - var referencedPath = ts.toPath(referencedFile.fileName, currentDirectory, getCanonicalFileName); - referencedFiles[referencedPath] = true; - } - } - if (sourceFile.resolvedTypeReferenceDirectiveNames) { - for (var typeName in sourceFile.resolvedTypeReferenceDirectiveNames) { - var resolvedTypeReferenceDirective = sourceFile.resolvedTypeReferenceDirectiveNames[typeName]; - if (!resolvedTypeReferenceDirective) { - continue; - } - var fileName = resolvedTypeReferenceDirective.resolvedFileName; - var typeFilePath = ts.toPath(fileName, currentDirectory, getCanonicalFileName); - referencedFiles[typeFilePath] = true; - } - } - var allFileNames = ts.map(Object.keys(referencedFiles), function (key) { return key; }); - return ts.filter(allFileNames, function (file) { return _this.projectService.host.fileExists(file); }); - }; - Project.prototype.removeRootFileIfNecessary = function (info) { - if (this.isRoot(info)) { - remove(this.rootFiles, info); - this.rootFilesMap.remove(info.path); - } - }; - return Project; - }()); - server.Project = Project; - var InferredProject = (function (_super) { - __extends(InferredProject, _super); - function InferredProject(projectService, documentRegistry, compilerOptions) { - var _this = _super.call(this, InferredProject.newName(), ProjectKind.Inferred, projectService, documentRegistry, undefined, true, compilerOptions, false) || this; - _this.directoriesWatchedForTsconfig = []; - return _this; + case server.ProjectKind.External: + var projectName = ts.normalizeSlashes(project.getProjectName()); + return project.projectService.host.fileExists(projectName) ? ts.getDirectoryPath(projectName) : projectName; } - InferredProject.prototype.getProjectRootPath = function () { - if (this.projectService.useSingleInferredProject) { - return undefined; - } - var rootFiles = this.getRootFiles(); - return ts.getDirectoryPath(rootFiles[0]); + } + function createInstallTypingsRequest(project, typeAcquisition, unresolvedImports, cachePath) { + return { + projectName: project.getProjectName(), + fileNames: project.getFileNames(true), + compilerOptions: project.getCompilerOptions(), + typeAcquisition: typeAcquisition, + unresolvedImports: unresolvedImports, + projectRootPath: getProjectRootPath(project), + cachePath: cachePath, + kind: "discover" }; - InferredProject.prototype.close = function () { - _super.prototype.close.call(this); - for (var _i = 0, _a = this.directoriesWatchedForTsconfig; _i < _a.length; _i++) { - var directory = _a[_i]; - this.projectService.stopWatchingDirectory(directory); - } - }; - InferredProject.prototype.getTypeAcquisition = function () { - return { - enable: allRootFilesAreJsOrDts(this), - include: [], - exclude: [] - }; - }; - return InferredProject; - }(Project)); - InferredProject.newName = (function () { - var nextId = 1; - return function () { - var id = nextId; - nextId++; - return server.makeInferredProjectName(id); - }; - })(); - server.InferredProject = InferredProject; - var ConfiguredProject = (function (_super) { - __extends(ConfiguredProject, _super); - function ConfiguredProject(configFileName, projectService, documentRegistry, hasExplicitListOfFiles, compilerOptions, wildcardDirectories, languageServiceEnabled, compileOnSaveEnabled) { - var _this = _super.call(this, configFileName, ProjectKind.Configured, projectService, documentRegistry, hasExplicitListOfFiles, languageServiceEnabled, compilerOptions, compileOnSaveEnabled) || this; - _this.wildcardDirectories = wildcardDirectories; - _this.compileOnSaveEnabled = compileOnSaveEnabled; - _this.openRefCount = 0; - _this.canonicalConfigFilePath = server.asNormalizedPath(projectService.toCanonicalFileName(configFileName)); - return _this; + } + server.createInstallTypingsRequest = createInstallTypingsRequest; + var Errors; + (function (Errors) { + function ThrowNoProject() { + throw new Error("No Project."); } - ConfiguredProject.prototype.getConfigFilePath = function () { - return this.getProjectName(); - }; - ConfiguredProject.prototype.getProjectRootPath = function () { - return ts.getDirectoryPath(this.getConfigFilePath()); - }; - ConfiguredProject.prototype.setProjectErrors = function (projectErrors) { - this.projectErrors = projectErrors; - }; - ConfiguredProject.prototype.setTypeAcquisition = function (newTypeAcquisition) { - this.typeAcquisition = newTypeAcquisition; - }; - ConfiguredProject.prototype.getTypeAcquisition = function () { - return this.typeAcquisition; - }; - ConfiguredProject.prototype.watchConfigFile = function (callback) { - var _this = this; - this.projectFileWatcher = this.projectService.host.watchFile(this.getConfigFilePath(), function (_) { return callback(_this); }); - }; - ConfiguredProject.prototype.watchTypeRoots = function (callback) { - var _this = this; - var roots = this.getEffectiveTypeRoots(); - var watchers = []; - for (var _i = 0, roots_1 = roots; _i < roots_1.length; _i++) { - var root = roots_1[_i]; - this.projectService.logger.info("Add type root watcher for: " + root); - watchers.push(this.projectService.host.watchDirectory(root, function (path) { return callback(_this, path); }, false)); - } - this.typeRootsWatchers = watchers; - }; - ConfiguredProject.prototype.watchConfigDirectory = function (callback) { - var _this = this; - if (this.directoryWatcher) { - return; - } - var directoryToWatch = ts.getDirectoryPath(this.getConfigFilePath()); - this.projectService.logger.info("Add recursive watcher for: " + directoryToWatch); - this.directoryWatcher = this.projectService.host.watchDirectory(directoryToWatch, function (path) { return callback(_this, path); }, true); - }; - ConfiguredProject.prototype.watchWildcards = function (callback) { - var _this = this; - if (!this.wildcardDirectories) { - return; - } - var configDirectoryPath = ts.getDirectoryPath(this.getConfigFilePath()); - this.directoriesWatchedForWildcards = ts.reduceProperties(this.wildcardDirectories, function (watchers, flag, directory) { - if (ts.comparePaths(configDirectoryPath, directory, ".", !_this.projectService.host.useCaseSensitiveFileNames) !== 0) { - var recursive = (flag & 1) !== 0; - _this.projectService.logger.info("Add " + (recursive ? "recursive " : "") + "watcher for: " + directory); - watchers[directory] = _this.projectService.host.watchDirectory(directory, function (path) { return callback(_this, path); }, recursive); - } - return watchers; - }, {}); - }; - ConfiguredProject.prototype.stopWatchingDirectory = function () { - if (this.directoryWatcher) { - this.directoryWatcher.close(); - this.directoryWatcher = undefined; - } - }; - ConfiguredProject.prototype.close = function () { - _super.prototype.close.call(this); - if (this.projectFileWatcher) { - this.projectFileWatcher.close(); - } - if (this.typeRootsWatchers) { - for (var _i = 0, _a = this.typeRootsWatchers; _i < _a.length; _i++) { - var watcher = _a[_i]; - watcher.close(); - } - this.typeRootsWatchers = undefined; - } - for (var id in this.directoriesWatchedForWildcards) { - this.directoriesWatchedForWildcards[id].close(); - } - this.directoriesWatchedForWildcards = undefined; - this.stopWatchingDirectory(); - }; - ConfiguredProject.prototype.addOpenRef = function () { - this.openRefCount++; - }; - ConfiguredProject.prototype.deleteOpenRef = function () { - this.openRefCount--; - return this.openRefCount; - }; - ConfiguredProject.prototype.getEffectiveTypeRoots = function () { - return ts.getEffectiveTypeRoots(this.getCompilerOptions(), this.projectService.host) || []; - }; - return ConfiguredProject; - }(Project)); - server.ConfiguredProject = ConfiguredProject; - var ExternalProject = (function (_super) { - __extends(ExternalProject, _super); - function ExternalProject(externalProjectName, projectService, documentRegistry, compilerOptions, languageServiceEnabled, compileOnSaveEnabled, projectFilePath) { - var _this = _super.call(this, externalProjectName, ProjectKind.External, projectService, documentRegistry, true, languageServiceEnabled, compilerOptions, compileOnSaveEnabled) || this; - _this.compileOnSaveEnabled = compileOnSaveEnabled; - _this.projectFilePath = projectFilePath; - return _this; + Errors.ThrowNoProject = ThrowNoProject; + function ThrowProjectLanguageServiceDisabled() { + throw new Error("The project's language service is disabled."); } - ExternalProject.prototype.getProjectRootPath = function () { - if (this.projectFilePath) { - return ts.getDirectoryPath(this.projectFilePath); + Errors.ThrowProjectLanguageServiceDisabled = ThrowProjectLanguageServiceDisabled; + function ThrowProjectDoesNotContainDocument(fileName, project) { + throw new Error("Project '" + project.getProjectName() + "' does not contain document '" + fileName + "'"); + } + Errors.ThrowProjectDoesNotContainDocument = ThrowProjectDoesNotContainDocument; + })(Errors = server.Errors || (server.Errors = {})); + function getDefaultFormatCodeSettings(host) { + return { + indentSize: 4, + tabSize: 4, + newLineCharacter: host.newLine || "\n", + convertTabsToSpaces: true, + indentStyle: ts.IndentStyle.Smart, + insertSpaceAfterConstructor: false, + insertSpaceAfterCommaDelimiter: true, + insertSpaceAfterSemicolonInForStatements: true, + insertSpaceBeforeAndAfterBinaryOperators: true, + insertSpaceAfterKeywordsInControlFlowStatements: true, + insertSpaceAfterFunctionKeywordForAnonymousFunctions: false, + insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false, + insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false, + insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: true, + insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false, + insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false, + insertSpaceBeforeFunctionParenthesis: false, + placeOpenBraceOnNewLineForFunctions: false, + placeOpenBraceOnNewLineForControlBlocks: false, + }; + } + server.getDefaultFormatCodeSettings = getDefaultFormatCodeSettings; + function mergeMapLikes(target, source) { + for (var key in source) { + if (ts.hasProperty(source, key)) { + target[key] = source[key]; } - return ts.getDirectoryPath(ts.normalizeSlashes(this.getProjectName())); - }; - ExternalProject.prototype.getTypeAcquisition = function () { - return this.typeAcquisition; - }; - ExternalProject.prototype.setProjectErrors = function (projectErrors) { - this.projectErrors = projectErrors; - }; - ExternalProject.prototype.setTypeAcquisition = function (newTypeAcquisition) { - if (!newTypeAcquisition) { - newTypeAcquisition = { - enable: allRootFilesAreJsOrDts(this), - include: [], - exclude: [] - }; - } - else { - if (newTypeAcquisition.enable === undefined) { - newTypeAcquisition.enable = allRootFilesAreJsOrDts(this); - } - if (!newTypeAcquisition.include) { - newTypeAcquisition.include = []; - } - if (!newTypeAcquisition.exclude) { - newTypeAcquisition.exclude = []; - } - } - this.typeAcquisition = newTypeAcquisition; - }; - return ExternalProject; - }(Project)); - server.ExternalProject = ExternalProject; - })(server = ts.server || (ts.server = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var server; - (function (server) { - server.maxProgramSizeForNonTsFiles = 20 * 1024 * 1024; - server.ContextEvent = "context"; - server.ConfigFileDiagEvent = "configFileDiag"; - server.ProjectLanguageServiceStateEvent = "projectLanguageServiceState"; - function prepareConvertersForEnumLikeCompilerOptions(commandLineOptions) { + } + } + server.mergeMapLikes = mergeMapLikes; + function removeItemFromSet(items, itemToRemove) { + if (items.length === 0) { + return; + } + var index = items.indexOf(itemToRemove); + if (index < 0) { + return; + } + if (index === items.length - 1) { + items.pop(); + } + else { + items[index] = items.pop(); + } + } + server.removeItemFromSet = removeItemFromSet; + function toNormalizedPath(fileName) { + return ts.normalizePath(fileName); + } + server.toNormalizedPath = toNormalizedPath; + function normalizedPathToPath(normalizedPath, currentDirectory, getCanonicalFileName) { + var f = ts.isRootedDiskPath(normalizedPath) ? normalizedPath : ts.getNormalizedAbsolutePath(normalizedPath, currentDirectory); + return getCanonicalFileName(f); + } + server.normalizedPathToPath = normalizedPathToPath; + function asNormalizedPath(fileName) { + return fileName; + } + server.asNormalizedPath = asNormalizedPath; + function createNormalizedPathMap() { var map = ts.createMap(); - for (var _i = 0, commandLineOptions_1 = commandLineOptions; _i < commandLineOptions_1.length; _i++) { - var option = commandLineOptions_1[_i]; - if (typeof option.type === "object") { - var optionMap = option.type; - for (var id in optionMap) { - ts.Debug.assert(typeof optionMap[id] === "number"); - } - map[option.name] = optionMap; - } - } - return map; - } - var compilerOptionConverters = prepareConvertersForEnumLikeCompilerOptions(ts.optionDeclarations); - var indentStyle = ts.createMap({ - "none": ts.IndentStyle.None, - "block": ts.IndentStyle.Block, - "smart": ts.IndentStyle.Smart - }); - function convertFormatOptions(protocolOptions) { - if (typeof protocolOptions.indentStyle === "string") { - protocolOptions.indentStyle = indentStyle[protocolOptions.indentStyle.toLowerCase()]; - ts.Debug.assert(protocolOptions.indentStyle !== undefined); - } - return protocolOptions; - } - server.convertFormatOptions = convertFormatOptions; - function convertCompilerOptions(protocolOptions) { - for (var id in compilerOptionConverters) { - var propertyValue = protocolOptions[id]; - if (typeof propertyValue === "string") { - var mappedValues = compilerOptionConverters[id]; - protocolOptions[id] = mappedValues[propertyValue.toLowerCase()]; - } - } - return protocolOptions; - } - server.convertCompilerOptions = convertCompilerOptions; - function tryConvertScriptKindName(scriptKindName) { - return typeof scriptKindName === "string" - ? convertScriptKindName(scriptKindName) - : scriptKindName; - } - server.tryConvertScriptKindName = tryConvertScriptKindName; - function convertScriptKindName(scriptKindName) { - switch (scriptKindName) { - case "JS": - return 1; - case "JSX": - return 2; - case "TS": - return 3; - case "TSX": - return 4; - default: - return 0; - } - } - server.convertScriptKindName = convertScriptKindName; - function combineProjectOutput(projects, action, comparer, areEqual) { - var result = projects.reduce(function (previous, current) { return ts.concatenate(previous, action(current)); }, []).sort(comparer); - return projects.length > 1 ? ts.deduplicate(result, areEqual) : result; - } - server.combineProjectOutput = combineProjectOutput; - var fileNamePropertyReader = { - getFileName: function (x) { return x; }, - getScriptKind: function (_) { return undefined; }, - hasMixedContent: function (_) { return false; } - }; - var externalFilePropertyReader = { - getFileName: function (x) { return x.fileName; }, - getScriptKind: function (x) { return tryConvertScriptKindName(x.scriptKind); }, - hasMixedContent: function (x) { return x.hasMixedContent; } - }; - function findProjectByName(projectName, projects) { - for (var _i = 0, projects_1 = projects; _i < projects_1.length; _i++) { - var proj = projects_1[_i]; - if (proj.getProjectName() === projectName) { - return proj; - } - } - } - function createFileNotFoundDiagnostic(fileName) { - return ts.createCompilerDiagnostic(ts.Diagnostics.File_0_not_found, fileName); - } - function isRootFileInInferredProject(info) { - if (info.containingProjects.length === 0) { - return false; - } - return info.containingProjects[0].projectKind === server.ProjectKind.Inferred && info.containingProjects[0].isRoot(info); - } - var DirectoryWatchers = (function () { - function DirectoryWatchers(projectService) { - this.projectService = projectService; - this.directoryWatchersForTsconfig = ts.createMap(); - this.directoryWatchersRefCount = ts.createMap(); - } - DirectoryWatchers.prototype.stopWatchingDirectory = function (directory) { - this.directoryWatchersRefCount[directory]--; - if (this.directoryWatchersRefCount[directory] === 0) { - this.projectService.logger.info("Close directory watcher for: " + directory); - this.directoryWatchersForTsconfig[directory].close(); - delete this.directoryWatchersForTsconfig[directory]; + return { + get: function (path) { + return map.get(path); + }, + set: function (path, value) { + map.set(path, value); + }, + contains: function (path) { + return map.has(path); + }, + remove: function (path) { + map.delete(path); } }; - DirectoryWatchers.prototype.startWatchingContainingDirectoriesForFile = function (fileName, project, callback) { - var currentPath = ts.getDirectoryPath(fileName); - var parentPath = ts.getDirectoryPath(currentPath); - while (currentPath != parentPath) { - if (!this.directoryWatchersForTsconfig[currentPath]) { - this.projectService.logger.info("Add watcher for: " + currentPath); - this.directoryWatchersForTsconfig[currentPath] = this.projectService.host.watchDirectory(currentPath, callback); - this.directoryWatchersRefCount[currentPath] = 1; - } - else { - this.directoryWatchersRefCount[currentPath] += 1; - } - project.directoriesWatchedForTsconfig.push(currentPath); - currentPath = parentPath; - parentPath = ts.getDirectoryPath(parentPath); - } - }; - return DirectoryWatchers; - }()); - var ProjectService = (function () { - function ProjectService(host, logger, cancellationToken, useSingleInferredProject, typingsInstaller, eventHandler) { - if (typingsInstaller === void 0) { typingsInstaller = server.nullTypingsInstaller; } + } + server.createNormalizedPathMap = createNormalizedPathMap; + function isInferredProjectName(name) { + return /dev\/null\/inferredProject\d+\*/.test(name); + } + server.isInferredProjectName = isInferredProjectName; + function makeInferredProjectName(counter) { + return "/dev/null/inferredProject" + counter + "*"; + } + server.makeInferredProjectName = makeInferredProjectName; + function toSortedReadonlyArray(arr) { + arr.sort(); + return arr; + } + server.toSortedReadonlyArray = toSortedReadonlyArray; + var ThrottledOperations = (function () { + function ThrottledOperations(host) { this.host = host; - this.logger = logger; - this.cancellationToken = cancellationToken; - this.useSingleInferredProject = useSingleInferredProject; - this.typingsInstaller = typingsInstaller; - this.eventHandler = eventHandler; - this.filenameToScriptInfo = ts.createFileMap(); - this.externalProjectToConfiguredProjectMap = ts.createMap(); - this.externalProjects = []; - this.inferredProjects = []; - this.configuredProjects = []; - this.openFiles = []; - ts.Debug.assert(!!host.createHash, "'ServerHost.createHash' is required for ProjectService"); - this.toCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames); - this.directoryWatchers = new DirectoryWatchers(this); - this.throttledOperations = new server.ThrottledOperations(host); - this.typingsInstaller.attach(this); - this.typingsCache = new server.TypingsCache(this.typingsInstaller); - this.hostConfiguration = { - formatCodeOptions: server.getDefaultFormatCodeSettings(this.host), - hostInfo: "Unknown host" - }; - this.documentRegistry = ts.createDocumentRegistry(host.useCaseSensitiveFileNames, host.getCurrentDirectory()); + this.pendingTimeouts = ts.createMap(); } - ProjectService.prototype.getChangedFiles_TestOnly = function () { - return this.changedFiles; + ThrottledOperations.prototype.schedule = function (operationId, delay, cb) { + var pendingTimeout = this.pendingTimeouts.get(operationId); + if (pendingTimeout) { + this.host.clearTimeout(pendingTimeout); + } + this.pendingTimeouts.set(operationId, this.host.setTimeout(ThrottledOperations.run, delay, this, operationId, cb)); }; - ProjectService.prototype.ensureInferredProjectsUpToDate_TestOnly = function () { - this.ensureInferredProjectsUpToDate(); + ThrottledOperations.run = function (self, operationId, cb) { + self.pendingTimeouts.delete(operationId); + cb(); }; - ProjectService.prototype.getCompilerOptionsForInferredProjects = function () { - return this.compilerOptionsForInferredProjects; - }; - ProjectService.prototype.onUpdateLanguageServiceStateForProject = function (project, languageServiceEnabled) { - if (!this.eventHandler) { - return; - } - this.eventHandler({ - eventName: server.ProjectLanguageServiceStateEvent, - data: { project: project, languageServiceEnabled: languageServiceEnabled } - }); - }; - ProjectService.prototype.updateTypingsForProject = function (response) { - var project = this.findProject(response.projectName); - if (!project) { - return; - } - switch (response.kind) { - case server.ActionSet: - this.typingsCache.updateTypingsForProject(response.projectName, response.compilerOptions, response.typeAcquisition, response.unresolvedImports, response.typings); - break; - case server.ActionInvalidate: - this.typingsCache.deleteTypingsForProject(response.projectName); - break; - } - project.updateGraph(); - }; - ProjectService.prototype.setCompilerOptionsForInferredProjects = function (projectCompilerOptions) { - this.compilerOptionsForInferredProjects = convertCompilerOptions(projectCompilerOptions); - this.compilerOptionsForInferredProjects.allowNonTsExtensions = true; - this.compileOnSaveForInferredProjects = projectCompilerOptions.compileOnSave; - for (var _i = 0, _a = this.inferredProjects; _i < _a.length; _i++) { - var proj = _a[_i]; - proj.setCompilerOptions(this.compilerOptionsForInferredProjects); - proj.compileOnSaveEnabled = projectCompilerOptions.compileOnSave; - } - this.updateProjectGraphs(this.inferredProjects); - }; - ProjectService.prototype.stopWatchingDirectory = function (directory) { - this.directoryWatchers.stopWatchingDirectory(directory); - }; - ProjectService.prototype.findProject = function (projectName) { - if (projectName === undefined) { - return undefined; - } - if (server.isInferredProjectName(projectName)) { - this.ensureInferredProjectsUpToDate(); - return findProjectByName(projectName, this.inferredProjects); - } - return this.findExternalProjectByProjectName(projectName) || this.findConfiguredProjectByProjectName(server.toNormalizedPath(projectName)); - }; - ProjectService.prototype.getDefaultProjectForFile = function (fileName, refreshInferredProjects) { - if (refreshInferredProjects) { - this.ensureInferredProjectsUpToDate(); - } - var scriptInfo = this.getScriptInfoForNormalizedPath(fileName); - return scriptInfo && scriptInfo.getDefaultProject(); - }; - ProjectService.prototype.ensureInferredProjectsUpToDate = function () { - if (this.changedFiles) { - var projectsToUpdate = void 0; - if (this.changedFiles.length === 1) { - projectsToUpdate = this.changedFiles[0].containingProjects; - } - else { - projectsToUpdate = []; - for (var _i = 0, _a = this.changedFiles; _i < _a.length; _i++) { - var f = _a[_i]; - projectsToUpdate = projectsToUpdate.concat(f.containingProjects); - } - } - this.updateProjectGraphs(projectsToUpdate); - this.changedFiles = undefined; - } - }; - ProjectService.prototype.findContainingExternalProject = function (fileName) { - for (var _i = 0, _a = this.externalProjects; _i < _a.length; _i++) { - var proj = _a[_i]; - if (proj.containsFile(fileName)) { - return proj; - } - } - return undefined; - }; - ProjectService.prototype.getFormatCodeOptions = function (file) { - var formatCodeSettings; - if (file) { - var info = this.getScriptInfoForNormalizedPath(file); - if (info) { - formatCodeSettings = info.getFormatCodeSettings(); - } - } - return formatCodeSettings || this.hostConfiguration.formatCodeOptions; - }; - ProjectService.prototype.updateProjectGraphs = function (projects) { - var shouldRefreshInferredProjects = false; - for (var _i = 0, projects_2 = projects; _i < projects_2.length; _i++) { - var p = projects_2[_i]; - if (!p.updateGraph()) { - shouldRefreshInferredProjects = true; - } - } - if (shouldRefreshInferredProjects) { - this.refreshInferredProjects(); - } - }; - ProjectService.prototype.onSourceFileChanged = function (fileName) { - var info = this.getScriptInfoForNormalizedPath(fileName); - if (!info) { - this.logger.info("Error: got watch notification for unknown file: " + fileName); - return; - } - if (!this.host.fileExists(fileName)) { - this.handleDeletedFile(info); - } - else { - if (info && (!info.isOpen)) { - info.reloadFromFile(); - this.updateProjectGraphs(info.containingProjects); - } - } - }; - ProjectService.prototype.handleDeletedFile = function (info) { - this.logger.info(info.fileName + " deleted"); - info.stopWatcher(); - if (!info.isOpen) { - this.filenameToScriptInfo.remove(info.path); - this.lastDeletedFile = info; - var containingProjects = info.containingProjects.slice(); - info.detachAllProjects(); - this.updateProjectGraphs(containingProjects); - this.lastDeletedFile = undefined; - if (!this.eventHandler) { - return; - } - for (var _i = 0, _a = this.openFiles; _i < _a.length; _i++) { - var openFile = _a[_i]; - this.eventHandler({ - eventName: server.ContextEvent, - data: { project: openFile.getDefaultProject(), fileName: openFile.fileName } - }); - } - } - this.printProjects(); - }; - ProjectService.prototype.onTypeRootFileChanged = function (project, fileName) { - var _this = this; - this.logger.info("Type root file " + fileName + " changed"); - this.throttledOperations.schedule(project.getConfigFilePath() + " * type root", 250, function () { - project.updateTypes(); - _this.updateConfiguredProject(project); - _this.refreshInferredProjects(); - }); - }; - ProjectService.prototype.onSourceFileInDirectoryChangedForConfiguredProject = function (project, fileName) { - var _this = this; - if (fileName && !ts.isSupportedSourceFileName(fileName, project.getCompilerOptions())) { - return; - } - this.logger.info("Detected source file changes: " + fileName); - this.throttledOperations.schedule(project.getConfigFilePath(), 250, function () { return _this.handleChangeInSourceFileForConfiguredProject(project, fileName); }); - }; - ProjectService.prototype.handleChangeInSourceFileForConfiguredProject = function (project, triggerFile) { - var _this = this; - var _a = this.convertConfigFileContentToProjectOptions(project.getConfigFilePath()), projectOptions = _a.projectOptions, configFileErrors = _a.configFileErrors; - this.reportConfigFileDiagnostics(project.getProjectName(), configFileErrors, triggerFile); - var newRootFiles = projectOptions.files.map((function (f) { return _this.getCanonicalFileName(f); })); - var currentRootFiles = project.getRootFiles().map((function (f) { return _this.getCanonicalFileName(f); })); - if (!ts.arrayIsEqualTo(currentRootFiles.sort(), newRootFiles.sort())) { - this.logger.info("Updating configured project"); - this.updateConfiguredProject(project); - this.refreshInferredProjects(); - } - }; - ProjectService.prototype.onConfigChangedForConfiguredProject = function (project) { - var configFileName = project.getConfigFilePath(); - this.logger.info("Config file changed: " + configFileName); - var configFileErrors = this.updateConfiguredProject(project); - this.reportConfigFileDiagnostics(configFileName, configFileErrors, configFileName); - this.refreshInferredProjects(); - }; - ProjectService.prototype.onConfigFileAddedForInferredProject = function (fileName) { - if (ts.getBaseFileName(fileName) != "tsconfig.json") { - this.logger.info(fileName + " is not tsconfig.json"); - return; - } - var configFileErrors = this.convertConfigFileContentToProjectOptions(fileName).configFileErrors; - this.reportConfigFileDiagnostics(fileName, configFileErrors, fileName); - this.logger.info("Detected newly added tsconfig file: " + fileName); - this.reloadProjects(); - }; - ProjectService.prototype.getCanonicalFileName = function (fileName) { - var name = this.host.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(); - return ts.normalizePath(name); - }; - ProjectService.prototype.removeProject = function (project) { - this.logger.info("remove project: " + project.getRootFiles().toString()); - project.close(); - switch (project.projectKind) { - case server.ProjectKind.External: - server.removeItemFromSet(this.externalProjects, project); - break; - case server.ProjectKind.Configured: - server.removeItemFromSet(this.configuredProjects, project); - break; - case server.ProjectKind.Inferred: - server.removeItemFromSet(this.inferredProjects, project); - break; - } - }; - ProjectService.prototype.assignScriptInfoToInferredProjectIfNecessary = function (info, addToListOfOpenFiles) { - var externalProject = this.findContainingExternalProject(info.fileName); - if (externalProject) { - if (addToListOfOpenFiles) { - this.openFiles.push(info); - } - return; - } - var foundConfiguredProject = false; - for (var _i = 0, _a = info.containingProjects; _i < _a.length; _i++) { - var p = _a[_i]; - if (p.projectKind === server.ProjectKind.Configured) { - foundConfiguredProject = true; - if (addToListOfOpenFiles) { - (p).addOpenRef(); - } - } - } - if (foundConfiguredProject) { - if (addToListOfOpenFiles) { - this.openFiles.push(info); - } - return; - } - if (info.containingProjects.length === 0) { - var inferredProject = this.createInferredProjectWithRootFileIfNecessary(info); - if (!this.useSingleInferredProject) { - for (var _b = 0, _c = this.openFiles; _b < _c.length; _b++) { - var f = _c[_b]; - if (f.containingProjects.length === 0) { - continue; - } - var defaultProject = f.getDefaultProject(); - if (isRootFileInInferredProject(info) && defaultProject !== inferredProject && inferredProject.containsScriptInfo(f)) { - this.removeProject(defaultProject); - f.attachToProject(inferredProject); - } - } - } - } - if (addToListOfOpenFiles) { - this.openFiles.push(info); - } - }; - ProjectService.prototype.closeOpenFile = function (info) { - info.reloadFromFile(); - server.removeItemFromSet(this.openFiles, info); - info.isOpen = false; - var projectsToRemove; - for (var _i = 0, _a = info.containingProjects; _i < _a.length; _i++) { - var p = _a[_i]; - if (p.projectKind === server.ProjectKind.Configured) { - if (p.deleteOpenRef() === 0) { - (projectsToRemove || (projectsToRemove = [])).push(p); - } - } - else if (p.projectKind === server.ProjectKind.Inferred && p.isRoot(info)) { - (projectsToRemove || (projectsToRemove = [])).push(p); - } - } - if (projectsToRemove) { - for (var _b = 0, projectsToRemove_1 = projectsToRemove; _b < projectsToRemove_1.length; _b++) { - var project = projectsToRemove_1[_b]; - this.removeProject(project); - } - var orphanFiles = void 0; - for (var _c = 0, _d = this.openFiles; _c < _d.length; _c++) { - var f = _d[_c]; - if (f.containingProjects.length === 0) { - (orphanFiles || (orphanFiles = [])).push(f); - } - } - if (orphanFiles) { - for (var _e = 0, orphanFiles_1 = orphanFiles; _e < orphanFiles_1.length; _e++) { - var f = orphanFiles_1[_e]; - this.assignScriptInfoToInferredProjectIfNecessary(f, false); - } - } - } - if (info.containingProjects.length === 0) { - this.filenameToScriptInfo.remove(info.path); - } - }; - ProjectService.prototype.openOrUpdateConfiguredProjectForFile = function (fileName) { - var searchPath = ts.getDirectoryPath(fileName); - this.logger.info("Search path: " + searchPath); - var configFileName = this.findConfigFile(server.asNormalizedPath(searchPath)); - if (!configFileName) { - this.logger.info("No config files found."); - return {}; - } - this.logger.info("Config file name: " + configFileName); - var project = this.findConfiguredProjectByProjectName(configFileName); - if (!project) { - var _a = this.openConfigFile(configFileName, fileName), success = _a.success, errors = _a.errors; - if (!success) { - return { configFileName: configFileName, configFileErrors: errors }; - } - this.logger.info("Opened configuration file " + configFileName); - if (errors && errors.length > 0) { - return { configFileName: configFileName, configFileErrors: errors }; - } - } - else { - this.updateConfiguredProject(project); - } - return { configFileName: configFileName }; - }; - ProjectService.prototype.findConfigFile = function (searchPath) { - while (true) { - var tsconfigFileName = server.asNormalizedPath(ts.combinePaths(searchPath, "tsconfig.json")); - if (this.host.fileExists(tsconfigFileName)) { - return tsconfigFileName; - } - var jsconfigFileName = server.asNormalizedPath(ts.combinePaths(searchPath, "jsconfig.json")); - if (this.host.fileExists(jsconfigFileName)) { - return jsconfigFileName; - } - var parentPath = server.asNormalizedPath(ts.getDirectoryPath(searchPath)); - if (parentPath === searchPath) { - break; - } - searchPath = parentPath; - } - return undefined; - }; - ProjectService.prototype.printProjects = function () { - if (!this.logger.hasLevel(server.LogLevel.verbose)) { - return; - } - this.logger.startGroup(); - var counter = 0; - counter = printProjects(this.logger, this.externalProjects, counter); - counter = printProjects(this.logger, this.configuredProjects, counter); - counter = printProjects(this.logger, this.inferredProjects, counter); - this.logger.info("Open files: "); - for (var _i = 0, _a = this.openFiles; _i < _a.length; _i++) { - var rootFile = _a[_i]; - this.logger.info(rootFile.fileName); - } - this.logger.endGroup(); - function printProjects(logger, projects, counter) { - for (var _i = 0, projects_3 = projects; _i < projects_3.length; _i++) { - var project = projects_3[_i]; - project.updateGraph(); - logger.info("Project '" + project.getProjectName() + "' (" + server.ProjectKind[project.projectKind] + ") " + counter); - logger.info(project.filesToString()); - logger.info("-----------------------------------------------"); - counter++; - } - return counter; - } - }; - ProjectService.prototype.findConfiguredProjectByProjectName = function (configFileName) { - configFileName = server.asNormalizedPath(this.toCanonicalFileName(configFileName)); - for (var _i = 0, _a = this.configuredProjects; _i < _a.length; _i++) { - var proj = _a[_i]; - if (proj.canonicalConfigFilePath === configFileName) { - return proj; - } - } - }; - ProjectService.prototype.findExternalProjectByProjectName = function (projectFileName) { - return findProjectByName(projectFileName, this.externalProjects); - }; - ProjectService.prototype.convertConfigFileContentToProjectOptions = function (configFilename) { - configFilename = ts.normalizePath(configFilename); - var configFileContent = this.host.readFile(configFilename); - var errors; - var result = ts.parseConfigFileTextToJson(configFilename, configFileContent); - var config = result.config; - if (result.error) { - var _a = ts.sanitizeConfigFile(configFilename, configFileContent), sanitizedConfig = _a.configJsonObject, diagnostics = _a.diagnostics; - config = sanitizedConfig; - errors = diagnostics.length ? diagnostics : [result.error]; - } - var parsedCommandLine = ts.parseJsonConfigFileContent(config, this.host, ts.getDirectoryPath(configFilename), {}, configFilename); - if (parsedCommandLine.errors.length) { - errors = ts.concatenate(errors, parsedCommandLine.errors); - } - ts.Debug.assert(!!parsedCommandLine.fileNames); - if (parsedCommandLine.fileNames.length === 0) { - (errors || (errors = [])).push(ts.createCompilerDiagnostic(ts.Diagnostics.The_config_file_0_found_doesn_t_contain_any_source_files, configFilename)); - return { success: false, configFileErrors: errors }; - } - var projectOptions = { - files: parsedCommandLine.fileNames, - compilerOptions: parsedCommandLine.options, - configHasFilesProperty: config["files"] !== undefined, - wildcardDirectories: ts.createMap(parsedCommandLine.wildcardDirectories), - typeAcquisition: parsedCommandLine.typeAcquisition, - compileOnSave: parsedCommandLine.compileOnSave - }; - return { success: true, projectOptions: projectOptions, configFileErrors: errors }; - }; - ProjectService.prototype.exceededTotalSizeLimitForNonTsFiles = function (options, fileNames, propertyReader) { - if (options && options.disableSizeLimit || !this.host.getFileSize) { - return false; - } - var totalNonTsFileSize = 0; - for (var _i = 0, fileNames_3 = fileNames; _i < fileNames_3.length; _i++) { - var f = fileNames_3[_i]; - var fileName = propertyReader.getFileName(f); - if (ts.hasTypeScriptFileExtension(fileName)) { - continue; - } - totalNonTsFileSize += this.host.getFileSize(fileName); - if (totalNonTsFileSize > server.maxProgramSizeForNonTsFiles) { - return true; - } - } - return false; - }; - ProjectService.prototype.createAndAddExternalProject = function (projectFileName, files, options, typeAcquisition) { - var compilerOptions = convertCompilerOptions(options); - var project = new server.ExternalProject(projectFileName, this, this.documentRegistry, compilerOptions, !this.exceededTotalSizeLimitForNonTsFiles(compilerOptions, files, externalFilePropertyReader), options.compileOnSave === undefined ? true : options.compileOnSave); - this.addFilesToProjectAndUpdateGraph(project, files, externalFilePropertyReader, undefined, typeAcquisition, undefined); - this.externalProjects.push(project); - return project; - }; - ProjectService.prototype.reportConfigFileDiagnostics = function (configFileName, diagnostics, triggerFile) { - if (!this.eventHandler) { - return; - } - this.eventHandler({ - eventName: server.ConfigFileDiagEvent, - data: { configFileName: configFileName, diagnostics: diagnostics || [], triggerFile: triggerFile } - }); - }; - ProjectService.prototype.createAndAddConfiguredProject = function (configFileName, projectOptions, configFileErrors, clientFileName) { - var _this = this; - var sizeLimitExceeded = this.exceededTotalSizeLimitForNonTsFiles(projectOptions.compilerOptions, projectOptions.files, fileNamePropertyReader); - var project = new server.ConfiguredProject(configFileName, this, this.documentRegistry, projectOptions.configHasFilesProperty, projectOptions.compilerOptions, projectOptions.wildcardDirectories, !sizeLimitExceeded, projectOptions.compileOnSave === undefined ? false : projectOptions.compileOnSave); - this.addFilesToProjectAndUpdateGraph(project, projectOptions.files, fileNamePropertyReader, clientFileName, projectOptions.typeAcquisition, configFileErrors); - project.watchConfigFile(function (project) { return _this.onConfigChangedForConfiguredProject(project); }); - if (!sizeLimitExceeded) { - this.watchConfigDirectoryForProject(project, projectOptions); - } - project.watchWildcards(function (project, path) { return _this.onSourceFileInDirectoryChangedForConfiguredProject(project, path); }); - project.watchTypeRoots(function (project, path) { return _this.onTypeRootFileChanged(project, path); }); - this.configuredProjects.push(project); - return project; - }; - ProjectService.prototype.watchConfigDirectoryForProject = function (project, options) { - var _this = this; - if (!options.configHasFilesProperty) { - project.watchConfigDirectory(function (project, path) { return _this.onSourceFileInDirectoryChangedForConfiguredProject(project, path); }); - } - }; - ProjectService.prototype.addFilesToProjectAndUpdateGraph = function (project, files, propertyReader, clientFileName, typeAcquisition, configFileErrors) { - var errors; - for (var _i = 0, files_4 = files; _i < files_4.length; _i++) { - var f = files_4[_i]; - var rootFilename = propertyReader.getFileName(f); - var scriptKind = propertyReader.getScriptKind(f); - var hasMixedContent = propertyReader.hasMixedContent(f); - if (this.host.fileExists(rootFilename)) { - var info = this.getOrCreateScriptInfoForNormalizedPath(server.toNormalizedPath(rootFilename), clientFileName == rootFilename, undefined, scriptKind, hasMixedContent); - project.addRoot(info); - } - else { - (errors || (errors = [])).push(createFileNotFoundDiagnostic(rootFilename)); - } - } - project.setProjectErrors(ts.concatenate(configFileErrors, errors)); - project.setTypeAcquisition(typeAcquisition); - project.updateGraph(); - }; - ProjectService.prototype.openConfigFile = function (configFileName, clientFileName) { - var conversionResult = this.convertConfigFileContentToProjectOptions(configFileName); - var projectOptions = conversionResult.success - ? conversionResult.projectOptions - : { files: [], compilerOptions: {} }; - var project = this.createAndAddConfiguredProject(configFileName, projectOptions, conversionResult.configFileErrors, clientFileName); - return { - success: conversionResult.success, - project: project, - errors: project.getProjectErrors() - }; - }; - ProjectService.prototype.updateNonInferredProject = function (project, newUncheckedFiles, propertyReader, newOptions, newTypeAcquisition, compileOnSave, configFileErrors) { - var oldRootScriptInfos = project.getRootScriptInfos(); - var newRootScriptInfos = []; - var newRootScriptInfoMap = server.createNormalizedPathMap(); - var projectErrors; - var rootFilesChanged = false; - for (var _i = 0, newUncheckedFiles_1 = newUncheckedFiles; _i < newUncheckedFiles_1.length; _i++) { - var f = newUncheckedFiles_1[_i]; - var newRootFile = propertyReader.getFileName(f); - if (!this.host.fileExists(newRootFile)) { - (projectErrors || (projectErrors = [])).push(createFileNotFoundDiagnostic(newRootFile)); - continue; - } - var normalizedPath = server.toNormalizedPath(newRootFile); - var scriptInfo = this.getScriptInfoForNormalizedPath(normalizedPath); - if (!scriptInfo || !project.isRoot(scriptInfo)) { - rootFilesChanged = true; - if (!scriptInfo) { - var scriptKind = propertyReader.getScriptKind(f); - var hasMixedContent = propertyReader.hasMixedContent(f); - scriptInfo = this.getOrCreateScriptInfoForNormalizedPath(normalizedPath, false, undefined, scriptKind, hasMixedContent); - } - } - newRootScriptInfos.push(scriptInfo); - newRootScriptInfoMap.set(scriptInfo.fileName, scriptInfo); - } - if (rootFilesChanged || newRootScriptInfos.length !== oldRootScriptInfos.length) { - var toAdd = void 0; - var toRemove = void 0; - for (var _a = 0, oldRootScriptInfos_1 = oldRootScriptInfos; _a < oldRootScriptInfos_1.length; _a++) { - var oldFile = oldRootScriptInfos_1[_a]; - if (!newRootScriptInfoMap.contains(oldFile.fileName)) { - (toRemove || (toRemove = [])).push(oldFile); - } - } - for (var _b = 0, newRootScriptInfos_1 = newRootScriptInfos; _b < newRootScriptInfos_1.length; _b++) { - var newFile = newRootScriptInfos_1[_b]; - if (!project.isRoot(newFile)) { - (toAdd || (toAdd = [])).push(newFile); - } - } - if (toRemove) { - for (var _c = 0, toRemove_1 = toRemove; _c < toRemove_1.length; _c++) { - var f = toRemove_1[_c]; - project.removeFile(f); - } - } - if (toAdd) { - for (var _d = 0, toAdd_1 = toAdd; _d < toAdd_1.length; _d++) { - var f = toAdd_1[_d]; - if (f.isOpen && isRootFileInInferredProject(f)) { - var inferredProject = f.containingProjects[0]; - inferredProject.removeFile(f); - if (!inferredProject.hasRoots()) { - this.removeProject(inferredProject); - } - } - project.addRoot(f); - } - } - } - project.setCompilerOptions(newOptions); - project.setTypeAcquisition(newTypeAcquisition); - if (compileOnSave !== undefined) { - project.compileOnSaveEnabled = compileOnSave; - } - project.setProjectErrors(ts.concatenate(configFileErrors, projectErrors)); - project.updateGraph(); - }; - ProjectService.prototype.updateConfiguredProject = function (project) { - if (!this.host.fileExists(project.getConfigFilePath())) { - this.logger.info("Config file deleted"); - this.removeProject(project); - return; - } - var _a = this.convertConfigFileContentToProjectOptions(project.getConfigFilePath()), success = _a.success, projectOptions = _a.projectOptions, configFileErrors = _a.configFileErrors; - if (!success) { - this.updateNonInferredProject(project, [], fileNamePropertyReader, {}, {}, false, configFileErrors); - return configFileErrors; - } - if (this.exceededTotalSizeLimitForNonTsFiles(projectOptions.compilerOptions, projectOptions.files, fileNamePropertyReader)) { - project.setCompilerOptions(projectOptions.compilerOptions); - if (!project.languageServiceEnabled) { - return configFileErrors; - } - project.disableLanguageService(); - project.stopWatchingDirectory(); - } - else { - if (!project.languageServiceEnabled) { - project.enableLanguageService(); - } - this.watchConfigDirectoryForProject(project, projectOptions); - this.updateNonInferredProject(project, projectOptions.files, fileNamePropertyReader, projectOptions.compilerOptions, projectOptions.typeAcquisition, projectOptions.compileOnSave, configFileErrors); - } - return configFileErrors; - }; - ProjectService.prototype.createInferredProjectWithRootFileIfNecessary = function (root) { - var _this = this; - var useExistingProject = this.useSingleInferredProject && this.inferredProjects.length; - var project = useExistingProject - ? this.inferredProjects[0] - : new server.InferredProject(this, this.documentRegistry, this.compilerOptionsForInferredProjects); - project.addRoot(root); - this.directoryWatchers.startWatchingContainingDirectoriesForFile(root.fileName, project, function (fileName) { return _this.onConfigFileAddedForInferredProject(fileName); }); - project.updateGraph(); - if (!useExistingProject) { - this.inferredProjects.push(project); - } - return project; - }; - ProjectService.prototype.getOrCreateScriptInfo = function (uncheckedFileName, openedByClient, fileContent, scriptKind) { - return this.getOrCreateScriptInfoForNormalizedPath(server.toNormalizedPath(uncheckedFileName), openedByClient, fileContent, scriptKind); - }; - ProjectService.prototype.getScriptInfo = function (uncheckedFileName) { - return this.getScriptInfoForNormalizedPath(server.toNormalizedPath(uncheckedFileName)); - }; - ProjectService.prototype.getOrCreateScriptInfoForNormalizedPath = function (fileName, openedByClient, fileContent, scriptKind, hasMixedContent) { - var _this = this; - var info = this.getScriptInfoForNormalizedPath(fileName); - if (!info) { - var content = void 0; - if (this.host.fileExists(fileName)) { - content = fileContent || (hasMixedContent ? "" : this.host.readFile(fileName)); - } - if (!content) { - if (openedByClient) { - content = ""; - } - } - if (content !== undefined) { - info = new server.ScriptInfo(this.host, fileName, content, scriptKind, openedByClient, hasMixedContent); - this.filenameToScriptInfo.set(info.path, info); - if (!info.isOpen && !hasMixedContent) { - info.setWatcher(this.host.watchFile(fileName, function (_) { return _this.onSourceFileChanged(fileName); })); - } - } - } - if (info) { - if (fileContent !== undefined) { - info.reload(fileContent); - } - if (openedByClient) { - info.isOpen = true; - } - } - return info; - }; - ProjectService.prototype.getScriptInfoForNormalizedPath = function (fileName) { - return this.getScriptInfoForPath(server.normalizedPathToPath(fileName, this.host.getCurrentDirectory(), this.toCanonicalFileName)); - }; - ProjectService.prototype.getScriptInfoForPath = function (fileName) { - return this.filenameToScriptInfo.get(fileName); - }; - ProjectService.prototype.setHostConfiguration = function (args) { - if (args.file) { - var info = this.getScriptInfoForNormalizedPath(server.toNormalizedPath(args.file)); - if (info) { - info.setFormatOptions(convertFormatOptions(args.formatOptions)); - this.logger.info("Host configuration update for file " + args.file); - } - } - else { - if (args.hostInfo !== undefined) { - this.hostConfiguration.hostInfo = args.hostInfo; - this.logger.info("Host information " + args.hostInfo); - } - if (args.formatOptions) { - server.mergeMaps(this.hostConfiguration.formatCodeOptions, convertFormatOptions(args.formatOptions)); - this.logger.info("Format host information updated"); - } - } - }; - ProjectService.prototype.closeLog = function () { - this.logger.close(); - }; - ProjectService.prototype.reloadProjects = function () { - this.logger.info("reload projects."); - for (var _i = 0, _a = this.openFiles; _i < _a.length; _i++) { - var info = _a[_i]; - this.openOrUpdateConfiguredProjectForFile(info.fileName); - } - this.refreshInferredProjects(); - }; - ProjectService.prototype.refreshInferredProjects = function () { - this.logger.info("updating project structure from ..."); - this.printProjects(); - var orphantedFiles = []; - for (var _i = 0, _a = this.openFiles; _i < _a.length; _i++) { - var info = _a[_i]; - if (info.containingProjects.length === 0) { - orphantedFiles.push(info); - } - else { - if (isRootFileInInferredProject(info) && info.containingProjects.length > 1) { - var inferredProject = info.containingProjects[0]; - ts.Debug.assert(inferredProject.projectKind === server.ProjectKind.Inferred); - inferredProject.removeFile(info); - if (!inferredProject.hasRoots()) { - this.removeProject(inferredProject); - } - } - } - } - for (var _b = 0, orphantedFiles_1 = orphantedFiles; _b < orphantedFiles_1.length; _b++) { - var f = orphantedFiles_1[_b]; - this.assignScriptInfoToInferredProjectIfNecessary(f, false); - } - for (var _c = 0, _d = this.inferredProjects; _c < _d.length; _c++) { - var p = _d[_c]; - p.updateGraph(); - } - this.printProjects(); - }; - ProjectService.prototype.openClientFile = function (fileName, fileContent, scriptKind) { - return this.openClientFileWithNormalizedPath(server.toNormalizedPath(fileName), fileContent, scriptKind); - }; - ProjectService.prototype.openClientFileWithNormalizedPath = function (fileName, fileContent, scriptKind, hasMixedContent) { - var _a = this.findContainingExternalProject(fileName) - ? {} - : this.openOrUpdateConfiguredProjectForFile(fileName), _b = _a.configFileName, configFileName = _b === void 0 ? undefined : _b, _c = _a.configFileErrors, configFileErrors = _c === void 0 ? undefined : _c; - var info = this.getOrCreateScriptInfoForNormalizedPath(fileName, true, fileContent, scriptKind, hasMixedContent); - this.assignScriptInfoToInferredProjectIfNecessary(info, true); - this.printProjects(); - return { configFileName: configFileName, configFileErrors: configFileErrors }; - }; - ProjectService.prototype.closeClientFile = function (uncheckedFileName) { - var info = this.getScriptInfoForNormalizedPath(server.toNormalizedPath(uncheckedFileName)); - if (info) { - this.closeOpenFile(info); - info.isOpen = false; - } - this.printProjects(); - }; - ProjectService.prototype.collectChanges = function (lastKnownProjectVersions, currentProjects, result) { - var _loop_5 = function (proj) { - var knownProject = ts.forEach(lastKnownProjectVersions, function (p) { return p.projectName === proj.getProjectName() && p; }); - result.push(proj.getChangesSinceVersion(knownProject && knownProject.version)); - }; - for (var _i = 0, currentProjects_1 = currentProjects; _i < currentProjects_1.length; _i++) { - var proj = currentProjects_1[_i]; - _loop_5(proj); - } - }; - ProjectService.prototype.synchronizeProjectList = function (knownProjects) { - var files = []; - this.collectChanges(knownProjects, this.externalProjects, files); - this.collectChanges(knownProjects, this.configuredProjects, files); - this.collectChanges(knownProjects, this.inferredProjects, files); - return files; - }; - ProjectService.prototype.applyChangesInOpenFiles = function (openFiles, changedFiles, closedFiles) { - var recordChangedFiles = changedFiles && !openFiles && !closedFiles; - if (openFiles) { - for (var _i = 0, openFiles_1 = openFiles; _i < openFiles_1.length; _i++) { - var file = openFiles_1[_i]; - var scriptInfo = this.getScriptInfo(file.fileName); - ts.Debug.assert(!scriptInfo || !scriptInfo.isOpen); - var normalizedPath = scriptInfo ? scriptInfo.fileName : server.toNormalizedPath(file.fileName); - this.openClientFileWithNormalizedPath(normalizedPath, file.content, tryConvertScriptKindName(file.scriptKind), file.hasMixedContent); - } - } - if (changedFiles) { - for (var _a = 0, changedFiles_2 = changedFiles; _a < changedFiles_2.length; _a++) { - var file = changedFiles_2[_a]; - var scriptInfo = this.getScriptInfo(file.fileName); - ts.Debug.assert(!!scriptInfo); - for (var i = file.changes.length - 1; i >= 0; i--) { - var change = file.changes[i]; - scriptInfo.editContent(change.span.start, change.span.start + change.span.length, change.newText); - } - if (recordChangedFiles) { - if (!this.changedFiles) { - this.changedFiles = [scriptInfo]; - } - else if (this.changedFiles.indexOf(scriptInfo) < 0) { - this.changedFiles.push(scriptInfo); - } - } - } - } - if (closedFiles) { - for (var _b = 0, closedFiles_1 = closedFiles; _b < closedFiles_1.length; _b++) { - var file = closedFiles_1[_b]; - this.closeClientFile(file); - } - } - if (openFiles || closedFiles) { - this.refreshInferredProjects(); - } - }; - ProjectService.prototype.closeConfiguredProject = function (configFile) { - var configuredProject = this.findConfiguredProjectByProjectName(configFile); - if (configuredProject && configuredProject.deleteOpenRef() === 0) { - this.removeProject(configuredProject); - } - }; - ProjectService.prototype.closeExternalProject = function (uncheckedFileName, suppressRefresh) { - if (suppressRefresh === void 0) { suppressRefresh = false; } - var fileName = server.toNormalizedPath(uncheckedFileName); - var configFiles = this.externalProjectToConfiguredProjectMap[fileName]; - if (configFiles) { - var shouldRefreshInferredProjects = false; - for (var _i = 0, configFiles_1 = configFiles; _i < configFiles_1.length; _i++) { - var configFile = configFiles_1[_i]; - if (this.closeConfiguredProject(configFile)) { - shouldRefreshInferredProjects = true; - } - } - delete this.externalProjectToConfiguredProjectMap[fileName]; - if (shouldRefreshInferredProjects && !suppressRefresh) { - this.refreshInferredProjects(); - } - } - else { - var externalProject = this.findExternalProjectByProjectName(uncheckedFileName); - if (externalProject) { - this.removeProject(externalProject); - if (!suppressRefresh) { - this.refreshInferredProjects(); - } - } - } - }; - ProjectService.prototype.openExternalProject = function (proj) { - if (proj.typingOptions && !proj.typeAcquisition) { - var typeAcquisition = ts.convertEnableAutoDiscoveryToEnable(proj.typingOptions); - proj.typeAcquisition = typeAcquisition; - } - var tsConfigFiles; - var rootFiles = []; - for (var _i = 0, _a = proj.rootFiles; _i < _a.length; _i++) { - var file = _a[_i]; - var normalized = server.toNormalizedPath(file.fileName); - if (ts.getBaseFileName(normalized) === "tsconfig.json") { - if (this.host.fileExists(normalized)) { - (tsConfigFiles || (tsConfigFiles = [])).push(normalized); - } - } - else { - rootFiles.push(file); - } - } - if (tsConfigFiles) { - tsConfigFiles.sort(); - } - var externalProject = this.findExternalProjectByProjectName(proj.projectFileName); - var exisingConfigFiles; - if (externalProject) { - if (!tsConfigFiles) { - this.updateNonInferredProject(externalProject, proj.rootFiles, externalFilePropertyReader, convertCompilerOptions(proj.options), proj.typeAcquisition, proj.options.compileOnSave, undefined); - return; - } - this.closeExternalProject(proj.projectFileName, true); - } - else if (this.externalProjectToConfiguredProjectMap[proj.projectFileName]) { - if (!tsConfigFiles) { - this.closeExternalProject(proj.projectFileName, true); - } - else { - var oldConfigFiles = this.externalProjectToConfiguredProjectMap[proj.projectFileName]; - var iNew = 0; - var iOld = 0; - while (iNew < tsConfigFiles.length && iOld < oldConfigFiles.length) { - var newConfig = tsConfigFiles[iNew]; - var oldConfig = oldConfigFiles[iOld]; - if (oldConfig < newConfig) { - this.closeConfiguredProject(oldConfig); - iOld++; - } - else if (oldConfig > newConfig) { - iNew++; - } - else { - (exisingConfigFiles || (exisingConfigFiles = [])).push(oldConfig); - iOld++; - iNew++; - } - } - for (var i = iOld; i < oldConfigFiles.length; i++) { - this.closeConfiguredProject(oldConfigFiles[i]); - } - } - } - if (tsConfigFiles) { - this.externalProjectToConfiguredProjectMap[proj.projectFileName] = tsConfigFiles; - for (var _b = 0, tsConfigFiles_1 = tsConfigFiles; _b < tsConfigFiles_1.length; _b++) { - var tsconfigFile = tsConfigFiles_1[_b]; - var project = this.findConfiguredProjectByProjectName(tsconfigFile); - if (!project) { - var result = this.openConfigFile(tsconfigFile); - project = result.success && result.project; - } - if (project && !ts.contains(exisingConfigFiles, tsconfigFile)) { - project.addOpenRef(); - } - } - } - else { - delete this.externalProjectToConfiguredProjectMap[proj.projectFileName]; - this.createAndAddExternalProject(proj.projectFileName, rootFiles, proj.options, proj.typeAcquisition); - } - this.refreshInferredProjects(); - }; - return ProjectService; + return ThrottledOperations; }()); - server.ProjectService = ProjectService; + server.ThrottledOperations = ThrottledOperations; + var GcTimer = (function () { + function GcTimer(host, delay, logger) { + this.host = host; + this.delay = delay; + this.logger = logger; + } + GcTimer.prototype.scheduleCollect = function () { + if (!this.host.gc || this.timerId !== undefined) { + return; + } + this.timerId = this.host.setTimeout(GcTimer.run, this.delay, this); + }; + GcTimer.run = function (self) { + self.timerId = undefined; + var log = self.logger.hasLevel(LogLevel.requestTime); + var before = log && self.host.getMemoryUsage(); + self.host.gc(); + if (log) { + var after = self.host.getMemoryUsage(); + self.logger.perftrc("GC::before " + before + ", after " + after); + } + }; + return GcTimer; + }()); + server.GcTimer = GcTimer; })(server = ts.server || (ts.server = {})); })(ts || (ts = {})); var ts; (function (ts) { var server; (function (server) { + server.nullCancellationToken = { + isCancellationRequested: function () { return false; }, + setRequest: function () { return void 0; }, + resetRequest: function () { return void 0; } + }; function hrTimeToMilliseconds(time) { var seconds = time[0]; var nanoseconds = time[1]; return ((1e9 * seconds) + nanoseconds) / 1000000.0; } - function shouldSkipSematicCheck(project) { - if (project.getCompilerOptions().skipLibCheck !== undefined) { - return false; + function shouldSkipSemanticCheck(project) { + if (project.projectKind === server.ProjectKind.Inferred || project.projectKind === server.ProjectKind.External) { + return project.isJsOnlyProject(); } - if ((project.projectKind === server.ProjectKind.Inferred || project.projectKind === server.ProjectKind.External) && project.isJsOnlyProject()) { - return true; + else { + var options = project.getCompilerOptions(); + return options.skipLibCheck && !options.checkJs && project.isJsOnlyProject(); } - return false; } function compareNumber(a, b) { return a - b; @@ -67192,7 +72336,7 @@ var ts; if (a.file < b.file) { return -1; } - else if (a.file == b.file) { + else if (a.file === b.file) { var n = compareNumber(a.start.line, b.start.line); if (n === 0) { return compareNumber(a.start.offset, b.start.offset); @@ -67310,26 +72454,98 @@ var ts; return "Content-Length: " + (1 + len) + "\r\n\r\n" + json + newLine; } server.formatMessage = formatMessage; - var Session = (function () { - function Session(host, cancellationToken, useSingleInferredProject, typingsInstaller, byteLength, hrtime, logger, canUseEvents, eventHandler) { + var MultistepOperation = (function () { + function MultistepOperation(operationHost) { + var _this = this; + this.operationHost = operationHost; + this.completed = true; + this.next = { + immediate: function (action) { return _this.immediate(action); }, + delay: function (ms, action) { return _this.delay(ms, action); } + }; + } + MultistepOperation.prototype.startNew = function (action) { + this.complete(); + this.requestId = this.operationHost.getCurrentRequestId(); + this.completed = false; + this.executeAction(action); + }; + MultistepOperation.prototype.complete = function () { + if (!this.completed) { + if (this.requestId) { + this.operationHost.sendRequestCompletedEvent(this.requestId); + } + this.completed = true; + } + this.setTimerHandle(undefined); + this.setImmediateId(undefined); + }; + MultistepOperation.prototype.immediate = function (action) { + var _this = this; + var requestId = this.requestId; + ts.Debug.assert(requestId === this.operationHost.getCurrentRequestId(), "immediate: incorrect request id"); + this.setImmediateId(this.operationHost.getServerHost().setImmediate(function () { + _this.immediateId = undefined; + _this.operationHost.executeWithRequestId(requestId, function () { return _this.executeAction(action); }); + })); + }; + MultistepOperation.prototype.delay = function (ms, action) { + var _this = this; + var requestId = this.requestId; + ts.Debug.assert(requestId === this.operationHost.getCurrentRequestId(), "delay: incorrect request id"); + this.setTimerHandle(this.operationHost.getServerHost().setTimeout(function () { + _this.timerHandle = undefined; + _this.operationHost.executeWithRequestId(requestId, function () { return _this.executeAction(action); }); + }, ms)); + }; + MultistepOperation.prototype.executeAction = function (action) { + var stop = false; + try { + if (this.operationHost.isCancellationRequested()) { + stop = true; + } + else { + action(this.next); + } + } + catch (e) { + stop = true; + if (!(e instanceof ts.OperationCanceledException)) { + this.operationHost.logError(e, "delayed processing of request " + this.requestId); + } + } + if (stop || !this.hasPendingWork()) { + this.complete(); + } + }; + MultistepOperation.prototype.setTimerHandle = function (timerHandle) { + if (this.timerHandle !== undefined) { + this.operationHost.getServerHost().clearTimeout(this.timerHandle); + } + this.timerHandle = timerHandle; + }; + MultistepOperation.prototype.setImmediateId = function (immediateId) { + if (this.immediateId !== undefined) { + this.operationHost.getServerHost().clearImmediate(this.immediateId); + } + this.immediateId = immediateId; + }; + MultistepOperation.prototype.hasPendingWork = function () { + return !!this.timerHandle || !!this.immediateId; + }; + return MultistepOperation; + }()); + var Session = (function () { + function Session(opts) { var _this = this; - this.host = host; - this.typingsInstaller = typingsInstaller; - this.byteLength = byteLength; - this.hrtime = hrtime; - this.logger = logger; - this.canUseEvents = canUseEvents; this.changeSeq = 0; - this.handlers = ts.createMap((_a = {}, + this.handlers = ts.createMapFromTemplate((_a = {}, _a[CommandNames.OpenExternalProject] = function (request) { - _this.projectService.openExternalProject(request.arguments); + _this.projectService.openExternalProject(request.arguments, false); return _this.requiredResponse(true); }, _a[CommandNames.OpenExternalProjects] = function (request) { - for (var _i = 0, _a = request.arguments.projects; _i < _a.length; _i++) { - var proj = _a[_i]; - _this.projectService.openExternalProject(proj); - } + _this.projectService.openExternalProjects(request.arguments.projects); return _this.requiredResponse(true); }, _a[CommandNames.CloseExternalProject] = function (request) { @@ -67477,12 +72693,12 @@ var ts; return _this.requiredResponse(_this.getSyntacticDiagnosticsSync(request.arguments)); }, _a[CommandNames.Geterr] = function (request) { - var geterrArgs = request.arguments; - return { response: _this.getDiagnostics(geterrArgs.delay, geterrArgs.files), responseRequired: false }; + _this.errorCheck.startNew(function (next) { return _this.getDiagnostics(next, request.arguments.delay, request.arguments.files); }); + return _this.notRequired(); }, _a[CommandNames.GeterrForProject] = function (request) { - var _a = request.arguments, file = _a.file, delay = _a.delay; - return { response: _this.getDiagnosticsForProject(delay, file), responseRequired: false }; + _this.errorCheck.startNew(function (next) { return _this.getDiagnosticsForProject(next, request.arguments.delay, request.arguments.file); }); + return _this.notRequired(); }, _a[CommandNames.Change] = function (request) { _this.change(request.arguments); @@ -67561,20 +72777,57 @@ var ts; return _this.requiredResponse(_this.getSupportedCodeFixes()); }, _a)); - this.eventHander = canUseEvents - ? eventHandler || (function (event) { return _this.defaultEventHandler(event); }) + this.host = opts.host; + this.cancellationToken = opts.cancellationToken; + this.typingsInstaller = opts.typingsInstaller; + this.byteLength = opts.byteLength; + this.hrtime = opts.hrtime; + this.logger = opts.logger; + this.canUseEvents = opts.canUseEvents; + var throttleWaitMilliseconds = opts.throttleWaitMilliseconds; + this.eventHandler = this.canUseEvents + ? opts.eventHandler || (function (event) { return _this.defaultEventHandler(event); }) : undefined; - this.projectService = new server.ProjectService(host, logger, cancellationToken, useSingleInferredProject, typingsInstaller, this.eventHander); - this.gcTimer = new server.GcTimer(host, 7000, logger); + var multistepOperationHost = { + executeWithRequestId: function (requestId, action) { return _this.executeWithRequestId(requestId, action); }, + getCurrentRequestId: function () { return _this.currentRequestId; }, + getServerHost: function () { return _this.host; }, + logError: function (err, cmd) { return _this.logError(err, cmd); }, + sendRequestCompletedEvent: function (requestId) { return _this.sendRequestCompletedEvent(requestId); }, + isCancellationRequested: function () { return _this.cancellationToken.isCancellationRequested(); } + }; + this.errorCheck = new MultistepOperation(multistepOperationHost); + var settings = { + host: this.host, + logger: this.logger, + cancellationToken: this.cancellationToken, + useSingleInferredProject: opts.useSingleInferredProject, + typingsInstaller: this.typingsInstaller, + throttleWaitMilliseconds: throttleWaitMilliseconds, + eventHandler: this.eventHandler, + globalPlugins: opts.globalPlugins, + pluginProbeLocations: opts.pluginProbeLocations + }; + this.projectService = new server.ProjectService(settings); + this.gcTimer = new server.GcTimer(this.host, 7000, this.logger); var _a; } + Session.prototype.sendRequestCompletedEvent = function (requestId) { + var event = { + seq: 0, + type: "event", + event: "requestCompleted", + body: { request_seq: requestId } + }; + this.send(event); + }; Session.prototype.defaultEventHandler = function (event) { var _this = this; switch (event.eventName) { case server.ContextEvent: - var _a = event.data, project = _a.project, fileName = _a.fileName; - this.projectService.logger.info("got context event, updating diagnostics for " + fileName); - this.updateErrorCheck([{ fileName: fileName, project: project }], this.changeSeq, function (n) { return n === _this.changeSeq; }, 100); + var _a = event.data, project_1 = _a.project, fileName_2 = _a.fileName; + this.projectService.logger.info("got context event, updating diagnostics for " + fileName_2); + this.errorCheck.startNew(function (next) { return _this.updateErrorCheck(next, [{ fileName: fileName_2, project: project_1 }], _this.changeSeq, function (n) { return n === _this.changeSeq; }, 100); }); break; case server.ConfigFileDiagEvent: var _b = event.data, triggerFile = _b.triggerFile, configFileName = _b.configFileName, diagnostics = _b.diagnostics; @@ -67627,7 +72880,7 @@ var ts; seq: 0, type: "event", event: eventName, - body: info, + body: info }; this.send(ev); }; @@ -67651,7 +72904,7 @@ var ts; Session.prototype.semanticCheck = function (file, project) { try { var diags = []; - if (!shouldSkipSematicCheck(project)) { + if (!shouldSkipSemanticCheck(project)) { diags = project.getLanguageService().getSemanticDiagnostics(file); } var bakedDiags = diags.map(function (diag) { return formatDiag(file, project, diag); }); @@ -67682,7 +72935,7 @@ var ts; } }, ms); }; - Session.prototype.updateErrorCheck = function (checkList, seq, matchSeq, ms, followMs, requireOpen) { + Session.prototype.updateErrorCheck = function (next, checkList, seq, matchSeq, ms, followMs, requireOpen) { var _this = this; if (ms === void 0) { ms = 1500; } if (followMs === void 0) { followMs = 200; } @@ -67690,13 +72943,6 @@ var ts; if (followMs > ms) { followMs = ms; } - if (this.errorTimer) { - this.host.clearTimeout(this.errorTimer); - } - if (this.immediateId) { - this.host.clearImmediate(this.immediateId); - this.immediateId = undefined; - } var index = 0; var checkOne = function () { if (matchSeq(seq)) { @@ -67704,21 +72950,17 @@ var ts; index++; if (checkSpec_1.project.containsFile(checkSpec_1.fileName, requireOpen)) { _this.syntacticCheck(checkSpec_1.fileName, checkSpec_1.project); - _this.immediateId = _this.host.setImmediate(function () { + next.immediate(function () { _this.semanticCheck(checkSpec_1.fileName, checkSpec_1.project); - _this.immediateId = undefined; if (checkList.length > index) { - _this.errorTimer = _this.host.setTimeout(checkOne, followMs); - } - else { - _this.errorTimer = undefined; + next.delay(followMs, checkOne); } }); } } }; if ((checkList.length > index) && (matchSeq(seq))) { - this.errorTimer = this.host.setTimeout(checkOne, ms); + next.delay(ms, checkOne); } }; Session.prototype.cleanProjects = function (caption, projects) { @@ -67726,8 +72968,8 @@ var ts; return; } this.logger.info("cleaning " + caption); - for (var _i = 0, projects_4 = projects; _i < projects_4.length; _i++) { - var p = projects_4[_i]; + for (var _i = 0, projects_1 = projects; _i < projects_1.length; _i++) { + var p = projects_1[_i]; p.getLanguageService(false).cleanupSemanticCache(); } }; @@ -67765,7 +73007,7 @@ var ts; }; Session.prototype.getDiagnosticsWorker = function (args, isSemantic, selector, includeLinePosition) { var _a = this.getFileAndProject(args), project = _a.project, file = _a.file; - if (isSemantic && shouldSkipSematicCheck(project)) { + if (isSemantic && shouldSkipSemanticCheck(project)) { return []; } var scriptInfo = project.getScriptInfoForNormalizedPath(file); @@ -67815,18 +73057,21 @@ var ts; }; Session.prototype.getImplementation = function (args, simplifiedResult) { var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; - var scriptInfo = project.getScriptInfoForNormalizedPath(file); - var position = this.getPosition(args, scriptInfo); + var position = this.getPosition(args, project.getScriptInfoForNormalizedPath(file)); var implementations = project.getLanguageService().getImplementationAtPosition(file, position); if (!implementations) { return []; } if (simplifiedResult) { - return implementations.map(function (impl) { return ({ - file: impl.fileName, - start: scriptInfo.positionToLineOffset(impl.textSpan.start), - end: scriptInfo.positionToLineOffset(ts.textSpanEnd(impl.textSpan)) - }); }); + return implementations.map(function (_a) { + var fileName = _a.fileName, textSpan = _a.textSpan; + var scriptInfo = project.getScriptInfo(fileName); + return { + file: fileName, + start: scriptInfo.positionToLineOffset(textSpan.start), + end: scriptInfo.positionToLineOffset(ts.textSpanEnd(textSpan)) + }; + }); } else { return implementations; @@ -67841,16 +73086,20 @@ var ts; return undefined; } return occurrences.map(function (occurrence) { - var fileName = occurrence.fileName, isWriteAccess = occurrence.isWriteAccess, textSpan = occurrence.textSpan; + var fileName = occurrence.fileName, isWriteAccess = occurrence.isWriteAccess, textSpan = occurrence.textSpan, isInString = occurrence.isInString; var scriptInfo = project.getScriptInfo(fileName); var start = scriptInfo.positionToLineOffset(textSpan.start); var end = scriptInfo.positionToLineOffset(ts.textSpanEnd(textSpan)); - return { + var result = { start: start, end: end, file: fileName, isWriteAccess: isWriteAccess, }; + if (isInString) { + result.isInString = isInString; + } + return result; }); }; Session.prototype.getSyntacticDiagnosticsSync = function (args) { @@ -67927,13 +73176,23 @@ var ts; } return projects; }; + Session.prototype.getDefaultProject = function (args) { + if (args.projectFileName) { + var project = this.getProject(args.projectFileName); + if (project) { + return project; + } + } + var info = this.projectService.getScriptInfo(args.file); + return info.getDefaultProject(); + }; Session.prototype.getRenameLocations = function (args, simplifiedResult) { var file = server.toNormalizedPath(args.file); var info = this.projectService.getScriptInfoForNormalizedPath(file); var position = this.getPosition(args, info); var projects = this.getProjects(args); if (simplifiedResult) { - var defaultProject = projects[0]; + var defaultProject = this.getDefaultProject(args); var renameInfo = defaultProject.getLanguageService().getRenameInfo(file, position); if (!renameInfo) { return undefined; @@ -68012,7 +73271,7 @@ var ts; Session.prototype.getReferences = function (args, simplifiedResult) { var file = server.toNormalizedPath(args.file); var projects = this.getProjects(args); - var defaultProject = projects[0]; + var defaultProject = this.getDefaultProject(args); var scriptInfo = defaultProject.getScriptInfoForNormalizedPath(file); var position = this.getPosition(args, scriptInfo); if (simplifiedResult) { @@ -68023,7 +73282,7 @@ var ts; var displayString = ts.displayPartsToString(nameInfo.displayParts); var nameSpan = nameInfo.textSpan; var nameColStart = scriptInfo.positionToLineOffset(nameSpan.start).offset; - var nameText = scriptInfo.snap().getText(nameSpan.start, ts.textSpanEnd(nameSpan)); + var nameText = scriptInfo.getSnapshot().getText(nameSpan.start, ts.textSpanEnd(nameSpan)); var refs = server.combineProjectOutput(projects, function (project) { var references = project.getLanguageService().getReferencesAtPosition(file, position); if (!references) { @@ -68033,7 +73292,7 @@ var ts; var refScriptInfo = project.getScriptInfo(ref.fileName); var start = refScriptInfo.positionToLineOffset(ref.textSpan.start); var refLineSpan = refScriptInfo.lineToTextSpan(start.line - 1); - var lineText = refScriptInfo.snap().getText(refLineSpan.start, ts.textSpanEnd(refLineSpan)).replace(/\r|\n/g, ""); + var lineText = refScriptInfo.getSnapshot().getText(refLineSpan.start, ts.textSpanEnd(refLineSpan)).replace(/\r|\n/g, ""); return { file: ref.fileName, start: start, @@ -68065,8 +73324,8 @@ var ts; }; Session.prototype.openClientFile = function (fileName, fileContent, scriptKind) { var _a = this.projectService.openClientFileWithNormalizedPath(fileName, fileContent, scriptKind), configFileName = _a.configFileName, configFileErrors = _a.configFileErrors; - if (this.eventHander) { - this.eventHander({ + if (this.eventHandler) { + this.eventHandler({ eventName: "configFileDiag", data: { triggerFile: fileName, configFileName: configFileName, diagnostics: configFileErrors || [] } }); @@ -68144,6 +73403,7 @@ var ts; end: scriptInfo.positionToLineOffset(ts.textSpanEnd(quickInfo.textSpan)), displayString: displayString, documentation: docString, + tags: quickInfo.tags || [] }; } else { @@ -68183,7 +73443,7 @@ var ts; var position = scriptInfo.lineOffsetToPosition(args.line, args.offset); var formatOptions = this.projectService.getFormatCodeOptions(file); var edits = project.getLanguageService(false).getFormattingEditsAfterKeystroke(file, position, args.key, formatOptions); - if ((args.key == "\n") && ((!edits) || (edits.length === 0) || allEditsBeforePos(edits, position))) { + if ((args.key === "\n") && ((!edits) || (edits.length === 0) || allEditsBeforePos(edits, position))) { var lineInfo = scriptInfo.getLineInfo(args.line); if (lineInfo && (lineInfo.leaf) && (lineInfo.leaf.text)) { var lineText = lineInfo.leaf.text; @@ -68192,10 +73452,10 @@ var ts; var hasIndent = 0; var i = void 0, len = void 0; for (i = 0, len = lineText.length; i < len; i++) { - if (lineText.charAt(i) == " ") { + if (lineText.charAt(i) === " ") { hasIndent++; } - else if (lineText.charAt(i) == "\t") { + else if (lineText.charAt(i) === "\t") { hasIndent += formatOptions.tabSize; } else { @@ -68236,9 +73496,9 @@ var ts; if (simplifiedResult) { return completions.entries.reduce(function (result, entry) { if (completions.isMemberCompletion || (entry.name.toLowerCase().indexOf(prefix.toLowerCase()) === 0)) { - var name_51 = entry.name, kind = entry.kind, kindModifiers = entry.kindModifiers, sortText = entry.sortText, replacementSpan = entry.replacementSpan; + var name = entry.name, kind = entry.kind, kindModifiers = entry.kindModifiers, sortText = entry.sortText, replacementSpan = entry.replacementSpan; var convertedSpan = replacementSpan ? _this.decorateSpan(replacementSpan, scriptInfo) : undefined; - result.push({ name: name_51, kind: kind, kindModifiers: kindModifiers, sortText: sortText, replacementSpan: convertedSpan }); + result.push({ name: name, kind: kind, kindModifiers: kindModifiers, sortText: sortText, replacementSpan: convertedSpan }); } return result; }, []).sort(function (a, b) { return ts.compareStrings(a.name, b.name); }); @@ -68271,7 +73531,8 @@ var ts; if (project.compileOnSaveEnabled && project.languageServiceEnabled) { result.push({ projectFileName: project.getProjectName(), - fileNames: project.getCompileOnSaveAffectedFileList(info) + fileNames: project.getCompileOnSaveAffectedFileList(info), + projectUsesOutFile: !!project.getCompilerOptions().outFile || !!project.getCompilerOptions().out }); } } @@ -68283,6 +73544,9 @@ var ts; if (!project) { server.Errors.ThrowNoProject(); } + if (!project.languageServiceEnabled) { + return false; + } var scriptInfo = project.getScriptInfo(file); return project.builder.emitFile(scriptInfo, function (path, data, writeByteOrderMark) { return _this.host.writeFile(path, data, writeByteOrderMark); }); }; @@ -68295,12 +73559,12 @@ var ts; return undefined; } if (simplifiedResult) { - var span_16 = helpItems.applicableSpan; + var span_17 = helpItems.applicableSpan; return { items: helpItems.items, applicableSpan: { - start: scriptInfo.positionToLineOffset(span_16.start), - end: scriptInfo.positionToLineOffset(span_16.start + span_16.length) + start: scriptInfo.positionToLineOffset(span_17.start), + end: scriptInfo.positionToLineOffset(span_17.start + span_17.length) }, selectedItemIndex: helpItems.selectedItemIndex, argumentIndex: helpItems.argumentIndex, @@ -68311,7 +73575,7 @@ var ts; return helpItems; } }; - Session.prototype.getDiagnostics = function (delay, fileNames) { + Session.prototype.getDiagnostics = function (next, delay, fileNames) { var _this = this; var checkList = fileNames.reduce(function (accum, uncheckedFileName) { var fileName = server.toNormalizedPath(uncheckedFileName); @@ -68322,7 +73586,7 @@ var ts; return accum; }, []); if (checkList.length > 0) { - this.updateErrorCheck(checkList, this.changeSeq, function (n) { return n === _this.changeSeq; }, delay); + this.updateErrorCheck(next, checkList, this.changeSeq, function (n) { return n === _this.changeSeq; }, delay); } }; Session.prototype.change = function (args) { @@ -68479,11 +73743,15 @@ var ts; }; Session.prototype.getCodeFixes = function (args, simplifiedResult) { var _this = this; + if (args.errorCodes.length === 0) { + return undefined; + } var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; var scriptInfo = project.getScriptInfoForNormalizedPath(file); var startPosition = getStartPosition(); var endPosition = getEndPosition(); - var codeActions = project.getLanguageService().getCodeFixesAtPosition(file, startPosition, endPosition, args.errorCodes); + var formatOptions = this.projectService.getFormatCodeOptions(file); + var codeActions = project.getLanguageService().getCodeFixesAtPosition(file, startPosition, endPosition, args.errorCodes, formatOptions); if (!codeActions) { return undefined; } @@ -68529,7 +73797,7 @@ var ts; ? spans.map(function (span) { return _this.decorateSpan(span, scriptInfo); }) : spans; }; - Session.prototype.getDiagnosticsForProject = function (delay, fileName) { + Session.prototype.getDiagnosticsForProject = function (next, delay, fileName) { var _this = this; var _a = this.getProjectInfoWorker(fileName, undefined, true), fileNames = _a.fileNames, languageServiceDisabled = _a.languageServiceDisabled; if (languageServiceDisabled) { @@ -68544,11 +73812,11 @@ var ts; var project = this.projectService.getDefaultProjectForFile(normalizedFileName, true); for (var _i = 0, fileNamesInProject_1 = fileNamesInProject; _i < fileNamesInProject_1.length; _i++) { var fileNameInProject = fileNamesInProject_1[_i]; - if (this.getCanonicalFileName(fileNameInProject) == this.getCanonicalFileName(fileName)) + if (this.getCanonicalFileName(fileNameInProject) === this.getCanonicalFileName(fileName)) highPriorityFiles.push(fileNameInProject); else { var info = this.projectService.getScriptInfo(fileNameInProject); - if (!info.isOpen) { + if (!info.isScriptOpen()) { if (fileNameInProject.indexOf(".d.ts") > 0) veryLowPriorityFiles.push(fileNameInProject); else @@ -68561,7 +73829,7 @@ var ts; fileNamesInProject = highPriorityFiles.concat(mediumPriorityFiles).concat(lowPriorityFiles).concat(veryLowPriorityFiles); if (fileNamesInProject.length > 0) { var checkList = fileNamesInProject.map(function (fileName) { return ({ fileName: fileName, project: project }); }); - this.updateErrorCheck(checkList, this.changeSeq, function (n) { return n == _this.changeSeq; }, delay, 200, false); + this.updateErrorCheck(next, checkList, this.changeSeq, function (n) { return n === _this.changeSeq; }, delay, 200, false); } }; Session.prototype.getCanonicalFileName = function (fileName) { @@ -68577,15 +73845,34 @@ var ts; return { response: response, responseRequired: true }; }; Session.prototype.addProtocolHandler = function (command, handler) { - if (command in this.handlers) { + if (this.handlers.has(command)) { throw new Error("Protocol handler already exists for command \"" + command + "\""); } - this.handlers[command] = handler; + this.handlers.set(command, handler); + }; + Session.prototype.setCurrentRequest = function (requestId) { + ts.Debug.assert(this.currentRequestId === undefined); + this.currentRequestId = requestId; + this.cancellationToken.setRequest(requestId); + }; + Session.prototype.resetCurrentRequest = function (requestId) { + ts.Debug.assert(this.currentRequestId === requestId); + this.currentRequestId = undefined; + this.cancellationToken.resetRequest(requestId); + }; + Session.prototype.executeWithRequestId = function (requestId, f) { + try { + this.setCurrentRequest(requestId); + return f(); + } + finally { + this.resetCurrentRequest(requestId); + } }; Session.prototype.executeCommand = function (request) { - var handler = this.handlers[request.command]; + var handler = this.handlers.get(request.command); if (handler) { - return handler(request); + return this.executeWithRequestId(request.seq, function () { return handler(request); }); } else { this.logger.msg("Unrecognized JSON command: " + JSON.stringify(request), server.Msg.Err); @@ -68687,7 +73974,7 @@ var ts; var lm = LineIndex.linesFromText(insertedText); var lines = lm.lines; if (lines.length > 1) { - if (lines[lines.length - 1] == "") { + if (lines[lines.length - 1] === "") { lines.length--; } } @@ -68716,7 +74003,7 @@ var ts; if (len > 1) { var insertedNodes = new Array(len - 1); var startNode = leafNode; - for (var i = 1, len_1 = lines.length; i < len_1; i++) { + for (var i = 1; i < lines.length; i++) { insertedNodes[i - 1] = new LineLeaf(lines[i]); } var pathIndex = this.startPath.length - 2; @@ -68913,8 +74200,8 @@ var ts; var snap = this.versions[this.currentVersionToIndex()]; if (this.changes.length > 0) { var snapIndex = snap.index; - for (var i = 0, len = this.changes.length; i < len; i++) { - var change = this.changes[i]; + for (var _i = 0, _a = this.changes; _i < _a.length; _i++) { + var change = _a[_i]; snapIndex = snapIndex.edit(change.pos, change.deleteLen, change.insertedText); } snap = new LineIndexSnapshot(this.currentVersion + 1, this); @@ -68935,8 +74222,8 @@ var ts; var textChangeRanges = []; for (var i = oldVersion + 1; i <= newVersion; i++) { var snap = this.versions[this.versionToIndex(i)]; - for (var j = 0, len = snap.changesSincePreviousVersion.length; j < len; j++) { - var textChange = snap.changesSincePreviousVersion[j]; + for (var _i = 0, _a = snap.changesSincePreviousVersion; _i < _a.length; _i++) { + var textChange = _a[_i]; textChangeRanges[textChangeRanges.length] = textChange.getTextChangeRange(); } } @@ -69005,8 +74292,9 @@ var ts; } }; LineIndexSnapshot.prototype.getChangeRange = function (oldSnapshot) { - var oldSnap = oldSnapshot; - return this.getTextChangeRangeSinceVersion(oldSnap.version); + if (oldSnapshot instanceof LineIndexSnapshot && this.cache === oldSnapshot.cache) { + return this.getTextChangeRangeSinceVersion(oldSnapshot.version); + } }; return LineIndexSnapshot; }()); @@ -69035,7 +74323,7 @@ var ts; LineIndex.prototype.load = function (lines) { if (lines.length > 0) { var leaves = []; - for (var i = 0, len = lines.length; i < len; i++) { + for (var i = 0; i < lines.length; i++) { leaves[i] = new LineLeaf(lines[i]); } this.root = LineIndex.buildTreeFromBottom(leaves); @@ -69127,7 +74415,7 @@ var ts; } if (this.checkEdits) { var updatedText = this.getText(0, this.root.charCount()); - ts.Debug.assert(checkText == updatedText, "buffer edit mismatch"); + ts.Debug.assert(checkText === updatedText, "buffer edit mismatch"); } return walker.lineIndex; } @@ -69195,8 +74483,8 @@ var ts; LineNode.prototype.updateCounts = function () { this.totalChars = 0; this.totalLines = 0; - for (var i = 0, len = this.children.length; i < len; i++) { - var child = this.children[i]; + for (var _i = 0, _a = this.children; _i < _a.length; _i++) { + var child = _a[_i]; this.totalChars += child.charCount(); this.totalLines += child.lineCount(); } @@ -69482,6 +74770,3009 @@ var ts; server.LineLeaf = LineLeaf; })(server = ts.server || (ts.server = {})); })(ts || (ts = {})); +var ts; +(function (ts) { + var server; + (function (server) { + var TextStorage = (function () { + function TextStorage(host, fileName) { + this.host = host; + this.fileName = fileName; + this.svcVersion = 0; + this.textVersion = 0; + } + TextStorage.prototype.getVersion = function () { + return this.svc + ? "SVC-" + this.svcVersion + "-" + this.svc.getSnapshot().version + : "Text-" + this.textVersion; + }; + TextStorage.prototype.hasScriptVersionCache = function () { + return this.svc !== undefined; + }; + TextStorage.prototype.useScriptVersionCache = function (newText) { + this.switchToScriptVersionCache(newText); + }; + TextStorage.prototype.useText = function (newText) { + this.svc = undefined; + this.setText(newText); + }; + TextStorage.prototype.edit = function (start, end, newText) { + this.switchToScriptVersionCache().edit(start, end - start, newText); + }; + TextStorage.prototype.reload = function (text) { + if (this.svc) { + this.svc.reload(text); + } + else { + this.setText(text); + } + }; + TextStorage.prototype.reloadFromFile = function (tempFileName) { + if (this.svc || (tempFileName !== this.fileName)) { + this.reload(this.getFileText(tempFileName)); + } + else { + this.setText(undefined); + } + }; + TextStorage.prototype.getSnapshot = function () { + return this.svc + ? this.svc.getSnapshot() + : ts.ScriptSnapshot.fromString(this.getOrLoadText()); + }; + TextStorage.prototype.getLineInfo = function (line) { + return this.switchToScriptVersionCache().getSnapshot().index.lineNumberToInfo(line); + }; + TextStorage.prototype.lineToTextSpan = function (line) { + if (!this.svc) { + var lineMap = this.getLineMap(); + var start = lineMap[line]; + var end = line + 1 < lineMap.length ? lineMap[line + 1] : this.text.length; + return ts.createTextSpanFromBounds(start, end); + } + var index = this.svc.getSnapshot().index; + var lineInfo = index.lineNumberToInfo(line + 1); + var len; + if (lineInfo.leaf) { + len = lineInfo.leaf.text.length; + } + else { + var nextLineInfo = index.lineNumberToInfo(line + 2); + len = nextLineInfo.offset - lineInfo.offset; + } + return ts.createTextSpan(lineInfo.offset, len); + }; + TextStorage.prototype.lineOffsetToPosition = function (line, offset) { + if (!this.svc) { + return ts.computePositionOfLineAndCharacter(this.getLineMap(), line - 1, offset - 1); + } + var index = this.svc.getSnapshot().index; + var lineInfo = index.lineNumberToInfo(line); + return (lineInfo.offset + offset - 1); + }; + TextStorage.prototype.positionToLineOffset = function (position) { + if (!this.svc) { + var _a = ts.computeLineAndCharacterOfPosition(this.getLineMap(), position), line = _a.line, character = _a.character; + return { line: line + 1, offset: character + 1 }; + } + var index = this.svc.getSnapshot().index; + var lineOffset = index.charOffsetToLineNumberAndPos(position); + return { line: lineOffset.line, offset: lineOffset.offset + 1 }; + }; + TextStorage.prototype.getFileText = function (tempFileName) { + return this.host.readFile(tempFileName || this.fileName) || ""; + }; + TextStorage.prototype.ensureNoScriptVersionCache = function () { + ts.Debug.assert(!this.svc, "ScriptVersionCache should not be set"); + }; + TextStorage.prototype.switchToScriptVersionCache = function (newText) { + if (!this.svc) { + this.svc = server.ScriptVersionCache.fromString(this.host, newText !== undefined ? newText : this.getOrLoadText()); + this.svcVersion++; + this.text = undefined; + } + return this.svc; + }; + TextStorage.prototype.getOrLoadText = function () { + this.ensureNoScriptVersionCache(); + if (this.text === undefined) { + this.setText(this.getFileText()); + } + return this.text; + }; + TextStorage.prototype.getLineMap = function () { + this.ensureNoScriptVersionCache(); + return this.lineMap || (this.lineMap = ts.computeLineStarts(this.getOrLoadText())); + }; + TextStorage.prototype.setText = function (newText) { + this.ensureNoScriptVersionCache(); + if (newText === undefined || this.text !== newText) { + this.text = newText; + this.lineMap = undefined; + this.textVersion++; + } + }; + return TextStorage; + }()); + server.TextStorage = TextStorage; + var ScriptInfo = (function () { + function ScriptInfo(host, fileName, scriptKind, hasMixedContent) { + if (hasMixedContent === void 0) { hasMixedContent = false; } + this.host = host; + this.fileName = fileName; + this.scriptKind = scriptKind; + this.hasMixedContent = hasMixedContent; + this.containingProjects = []; + this.path = ts.toPath(fileName, host.getCurrentDirectory(), ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames)); + this.textStorage = new TextStorage(host, fileName); + if (hasMixedContent) { + this.textStorage.reload(""); + } + this.scriptKind = scriptKind + ? scriptKind + : ts.getScriptKindFromFileName(fileName); + } + ScriptInfo.prototype.isScriptOpen = function () { + return this.isOpen; + }; + ScriptInfo.prototype.open = function (newText) { + this.isOpen = true; + this.textStorage.useScriptVersionCache(newText); + this.markContainingProjectsAsDirty(); + }; + ScriptInfo.prototype.close = function () { + this.isOpen = false; + this.textStorage.useText(this.hasMixedContent ? "" : undefined); + this.markContainingProjectsAsDirty(); + }; + ScriptInfo.prototype.getSnapshot = function () { + return this.textStorage.getSnapshot(); + }; + ScriptInfo.prototype.getFormatCodeSettings = function () { + return this.formatCodeSettings; + }; + ScriptInfo.prototype.attachToProject = function (project) { + var isNew = !this.isAttached(project); + if (isNew) { + this.containingProjects.push(project); + } + return isNew; + }; + ScriptInfo.prototype.isAttached = function (project) { + switch (this.containingProjects.length) { + case 0: return false; + case 1: return this.containingProjects[0] === project; + case 2: return this.containingProjects[0] === project || this.containingProjects[1] === project; + default: return ts.contains(this.containingProjects, project); + } + }; + ScriptInfo.prototype.detachFromProject = function (project) { + switch (this.containingProjects.length) { + case 0: + return; + case 1: + if (this.containingProjects[0] === project) { + this.containingProjects.pop(); + } + break; + case 2: + if (this.containingProjects[0] === project) { + this.containingProjects[0] = this.containingProjects.pop(); + } + else if (this.containingProjects[1] === project) { + this.containingProjects.pop(); + } + break; + default: + server.removeItemFromSet(this.containingProjects, project); + break; + } + }; + ScriptInfo.prototype.detachAllProjects = function () { + for (var _i = 0, _a = this.containingProjects; _i < _a.length; _i++) { + var p = _a[_i]; + p.removeFile(this, false); + } + this.containingProjects.length = 0; + }; + ScriptInfo.prototype.getDefaultProject = function () { + switch (this.containingProjects.length) { + case 0: + return server.Errors.ThrowNoProject(); + case 1: + return this.containingProjects[0]; + default: + var firstExternalProject = void 0; + for (var _i = 0, _a = this.containingProjects; _i < _a.length; _i++) { + var project = _a[_i]; + if (project.projectKind === server.ProjectKind.Configured) { + return project; + } + else if (project.projectKind === server.ProjectKind.External && !firstExternalProject) { + firstExternalProject = project; + } + } + return firstExternalProject || this.containingProjects[0]; + } + }; + ScriptInfo.prototype.registerFileUpdate = function () { + for (var _i = 0, _a = this.containingProjects; _i < _a.length; _i++) { + var p = _a[_i]; + p.registerFileUpdate(this.path); + } + }; + ScriptInfo.prototype.setFormatOptions = function (formatSettings) { + if (formatSettings) { + if (!this.formatCodeSettings) { + this.formatCodeSettings = server.getDefaultFormatCodeSettings(this.host); + } + server.mergeMapLikes(this.formatCodeSettings, formatSettings); + } + }; + ScriptInfo.prototype.setWatcher = function (watcher) { + this.stopWatcher(); + this.fileWatcher = watcher; + }; + ScriptInfo.prototype.stopWatcher = function () { + if (this.fileWatcher) { + this.fileWatcher.close(); + this.fileWatcher = undefined; + } + }; + ScriptInfo.prototype.getLatestVersion = function () { + return this.textStorage.getVersion(); + }; + ScriptInfo.prototype.reload = function (script) { + this.textStorage.reload(script); + this.markContainingProjectsAsDirty(); + }; + ScriptInfo.prototype.saveTo = function (fileName) { + var snap = this.textStorage.getSnapshot(); + this.host.writeFile(fileName, snap.getText(0, snap.getLength())); + }; + ScriptInfo.prototype.reloadFromFile = function (tempFileName) { + if (this.hasMixedContent) { + this.reload(""); + } + else { + this.textStorage.reloadFromFile(tempFileName); + this.markContainingProjectsAsDirty(); + } + }; + ScriptInfo.prototype.getLineInfo = function (line) { + return this.textStorage.getLineInfo(line); + }; + ScriptInfo.prototype.editContent = function (start, end, newText) { + this.textStorage.edit(start, end, newText); + this.markContainingProjectsAsDirty(); + }; + ScriptInfo.prototype.markContainingProjectsAsDirty = function () { + for (var _i = 0, _a = this.containingProjects; _i < _a.length; _i++) { + var p = _a[_i]; + p.markAsDirty(); + } + }; + ScriptInfo.prototype.lineToTextSpan = function (line) { + return this.textStorage.lineToTextSpan(line); + }; + ScriptInfo.prototype.lineOffsetToPosition = function (line, offset) { + return this.textStorage.lineOffsetToPosition(line, offset); + }; + ScriptInfo.prototype.positionToLineOffset = function (position) { + return this.textStorage.positionToLineOffset(position); + }; + ScriptInfo.prototype.isJavaScript = function () { + return this.scriptKind === 1 || this.scriptKind === 2; + }; + return ScriptInfo; + }()); + server.ScriptInfo = ScriptInfo; + })(server = ts.server || (ts.server = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var server; + (function (server) { + var LSHost = (function () { + function LSHost(host, project, cancellationToken) { + var _this = this; + this.host = host; + this.project = project; + this.cancellationToken = cancellationToken; + this.resolvedModuleNames = ts.createFileMap(); + this.resolvedTypeReferenceDirectives = ts.createFileMap(); + this.cancellationToken = new ts.ThrottledCancellationToken(cancellationToken, project.projectService.throttleWaitMilliseconds); + this.getCanonicalFileName = ts.createGetCanonicalFileName(this.host.useCaseSensitiveFileNames); + if (host.trace) { + this.trace = function (s) { return host.trace(s); }; + } + this.resolveModuleName = function (moduleName, containingFile, compilerOptions, host) { + var globalCache = _this.project.getTypeAcquisition().enable + ? _this.project.projectService.typingsInstaller.globalTypingsCacheLocation + : undefined; + var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host); + if (ts.moduleHasNonRelativeName(moduleName) && !(primaryResult.resolvedModule && ts.extensionIsTypeScript(primaryResult.resolvedModule.extension)) && globalCache !== undefined) { + var _a = ts.loadModuleFromGlobalCache(moduleName, _this.project.getProjectName(), compilerOptions, host, globalCache), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations; + if (resolvedModule) { + return { resolvedModule: resolvedModule, failedLookupLocations: primaryResult.failedLookupLocations.concat(failedLookupLocations) }; + } + } + return primaryResult; + }; + if (this.host.realpath) { + this.realpath = function (path) { return _this.host.realpath(path); }; + } + } + LSHost.prototype.startRecordingFilesWithChangedResolutions = function () { + this.filesWithChangedSetOfUnresolvedImports = []; + }; + LSHost.prototype.finishRecordingFilesWithChangedResolutions = function () { + var collected = this.filesWithChangedSetOfUnresolvedImports; + this.filesWithChangedSetOfUnresolvedImports = undefined; + return collected; + }; + LSHost.prototype.resolveNamesWithLocalCache = function (names, containingFile, cache, loader, getResult, getResultFileName, logChanges) { + var path = ts.toPath(containingFile, this.host.getCurrentDirectory(), this.getCanonicalFileName); + var currentResolutionsInFile = cache.get(path); + var newResolutions = ts.createMap(); + var resolvedModules = []; + var compilerOptions = this.getCompilationSettings(); + var lastDeletedFileName = this.project.projectService.lastDeletedFile && this.project.projectService.lastDeletedFile.fileName; + for (var _i = 0, names_2 = names; _i < names_2.length; _i++) { + var name = names_2[_i]; + var resolution = newResolutions.get(name); + if (!resolution) { + var existingResolution = currentResolutionsInFile && currentResolutionsInFile.get(name); + if (moduleResolutionIsValid(existingResolution)) { + resolution = existingResolution; + } + else { + resolution = loader(name, containingFile, compilerOptions, this); + newResolutions.set(name, resolution); + } + if (logChanges && this.filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) { + this.filesWithChangedSetOfUnresolvedImports.push(path); + logChanges = false; + } + } + ts.Debug.assert(resolution !== undefined); + resolvedModules.push(getResult(resolution)); + } + cache.set(path, newResolutions); + return resolvedModules; + function resolutionIsEqualTo(oldResolution, newResolution) { + if (oldResolution === newResolution) { + return true; + } + if (!oldResolution || !newResolution) { + return false; + } + var oldResult = getResult(oldResolution); + var newResult = getResult(newResolution); + if (oldResult === newResult) { + return true; + } + if (!oldResult || !newResult) { + return false; + } + return getResultFileName(oldResult) === getResultFileName(newResult); + } + function moduleResolutionIsValid(resolution) { + if (!resolution) { + return false; + } + var result = getResult(resolution); + if (result) { + return getResultFileName(result) !== lastDeletedFileName; + } + return resolution.failedLookupLocations.length === 0; + } + }; + LSHost.prototype.getNewLine = function () { + return this.host.newLine; + }; + LSHost.prototype.getProjectVersion = function () { + return this.project.getProjectVersion(); + }; + LSHost.prototype.getCompilationSettings = function () { + return this.compilationSettings; + }; + LSHost.prototype.useCaseSensitiveFileNames = function () { + return this.host.useCaseSensitiveFileNames; + }; + LSHost.prototype.getCancellationToken = function () { + return this.cancellationToken; + }; + LSHost.prototype.resolveTypeReferenceDirectives = function (typeDirectiveNames, containingFile) { + return this.resolveNamesWithLocalCache(typeDirectiveNames, containingFile, this.resolvedTypeReferenceDirectives, ts.resolveTypeReferenceDirective, function (m) { return m.resolvedTypeReferenceDirective; }, function (r) { return r.resolvedFileName; }, false); + }; + LSHost.prototype.resolveModuleNames = function (moduleNames, containingFile) { + return this.resolveNamesWithLocalCache(moduleNames, containingFile, this.resolvedModuleNames, this.resolveModuleName, function (m) { return m.resolvedModule; }, function (r) { return r.resolvedFileName; }, true); + }; + LSHost.prototype.getDefaultLibFileName = function () { + var nodeModuleBinDir = ts.getDirectoryPath(ts.normalizePath(this.host.getExecutingFilePath())); + return ts.combinePaths(nodeModuleBinDir, ts.getDefaultLibFileName(this.compilationSettings)); + }; + LSHost.prototype.getScriptSnapshot = function (filename) { + var scriptInfo = this.project.getScriptInfoLSHost(filename); + if (scriptInfo) { + return scriptInfo.getSnapshot(); + } + }; + LSHost.prototype.getScriptFileNames = function () { + return this.project.getRootFilesLSHost(); + }; + LSHost.prototype.getTypeRootsVersion = function () { + return this.project.typesVersion; + }; + LSHost.prototype.getScriptKind = function (fileName) { + var info = this.project.getScriptInfoLSHost(fileName); + return info && info.scriptKind; + }; + LSHost.prototype.getScriptVersion = function (filename) { + var info = this.project.getScriptInfoLSHost(filename); + return info && info.getLatestVersion(); + }; + LSHost.prototype.getCurrentDirectory = function () { + return this.host.getCurrentDirectory(); + }; + LSHost.prototype.resolvePath = function (path) { + return this.host.resolvePath(path); + }; + LSHost.prototype.fileExists = function (path) { + return this.host.fileExists(path); + }; + LSHost.prototype.readFile = function (fileName) { + return this.host.readFile(fileName); + }; + LSHost.prototype.directoryExists = function (path) { + return this.host.directoryExists(path); + }; + LSHost.prototype.readDirectory = function (path, extensions, exclude, include) { + return this.host.readDirectory(path, extensions, exclude, include); + }; + LSHost.prototype.getDirectories = function (path) { + return this.host.getDirectories(path); + }; + LSHost.prototype.notifyFileRemoved = function (info) { + this.resolvedModuleNames.remove(info.path); + this.resolvedTypeReferenceDirectives.remove(info.path); + }; + LSHost.prototype.setCompilationSettings = function (opt) { + if (ts.changesAffectModuleResolution(this.compilationSettings, opt)) { + this.resolvedModuleNames.clear(); + this.resolvedTypeReferenceDirectives.clear(); + } + this.compilationSettings = opt; + }; + return LSHost; + }()); + server.LSHost = LSHost; + })(server = ts.server || (ts.server = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var server; + (function (server) { + server.nullTypingsInstaller = { + enqueueInstallTypingsRequest: ts.noop, + attach: ts.noop, + onProjectClosed: ts.noop, + globalTypingsCacheLocation: undefined + }; + var TypingsCacheEntry = (function () { + function TypingsCacheEntry() { + } + return TypingsCacheEntry; + }()); + function setIsEqualTo(arr1, arr2) { + if (arr1 === arr2) { + return true; + } + if ((arr1 || server.emptyArray).length === 0 && (arr2 || server.emptyArray).length === 0) { + return true; + } + var set = ts.createMap(); + var unique = 0; + for (var _i = 0, arr1_1 = arr1; _i < arr1_1.length; _i++) { + var v = arr1_1[_i]; + if (set.get(v) !== true) { + set.set(v, true); + unique++; + } + } + for (var _a = 0, arr2_1 = arr2; _a < arr2_1.length; _a++) { + var v = arr2_1[_a]; + var isSet = set.get(v); + if (isSet === undefined) { + return false; + } + if (isSet === true) { + set.set(v, false); + unique--; + } + } + return unique === 0; + } + function typeAcquisitionChanged(opt1, opt2) { + return opt1.enable !== opt2.enable || + !setIsEqualTo(opt1.include, opt2.include) || + !setIsEqualTo(opt1.exclude, opt2.exclude); + } + function compilerOptionsChanged(opt1, opt2) { + return opt1.allowJs !== opt2.allowJs; + } + function unresolvedImportsChanged(imports1, imports2) { + if (imports1 === imports2) { + return false; + } + return !ts.arrayIsEqualTo(imports1, imports2); + } + var TypingsCache = (function () { + function TypingsCache(installer) { + this.installer = installer; + this.perProjectCache = ts.createMap(); + } + TypingsCache.prototype.getTypingsForProject = function (project, unresolvedImports, forceRefresh) { + var typeAcquisition = project.getTypeAcquisition(); + if (!typeAcquisition || !typeAcquisition.enable) { + return server.emptyArray; + } + var entry = this.perProjectCache.get(project.getProjectName()); + var result = entry ? entry.typings : server.emptyArray; + if (forceRefresh || + !entry || + typeAcquisitionChanged(typeAcquisition, entry.typeAcquisition) || + compilerOptionsChanged(project.getCompilerOptions(), entry.compilerOptions) || + unresolvedImportsChanged(unresolvedImports, entry.unresolvedImports)) { + this.perProjectCache.set(project.getProjectName(), { + compilerOptions: project.getCompilerOptions(), + typeAcquisition: typeAcquisition, + typings: result, + unresolvedImports: unresolvedImports, + poisoned: true + }); + this.installer.enqueueInstallTypingsRequest(project, typeAcquisition, unresolvedImports); + } + return result; + }; + TypingsCache.prototype.updateTypingsForProject = function (projectName, compilerOptions, typeAcquisition, unresolvedImports, newTypings) { + this.perProjectCache.set(projectName, { + compilerOptions: compilerOptions, + typeAcquisition: typeAcquisition, + typings: server.toSortedReadonlyArray(newTypings), + unresolvedImports: unresolvedImports, + poisoned: false + }); + }; + TypingsCache.prototype.deleteTypingsForProject = function (projectName) { + this.perProjectCache.delete(projectName); + }; + TypingsCache.prototype.onProjectClosed = function (project) { + this.perProjectCache.delete(project.getProjectName()); + this.installer.onProjectClosed(project); + }; + return TypingsCache; + }()); + server.TypingsCache = TypingsCache; + })(server = ts.server || (ts.server = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var server; + (function (server) { + function shouldEmitFile(scriptInfo) { + return !scriptInfo.hasMixedContent; + } + server.shouldEmitFile = shouldEmitFile; + var BuilderFileInfo = (function () { + function BuilderFileInfo(scriptInfo, project) { + this.scriptInfo = scriptInfo; + this.project = project; + } + BuilderFileInfo.prototype.isExternalModuleOrHasOnlyAmbientExternalModules = function () { + var sourceFile = this.getSourceFile(); + return ts.isExternalModule(sourceFile) || this.containsOnlyAmbientModules(sourceFile); + }; + BuilderFileInfo.prototype.containsOnlyAmbientModules = function (sourceFile) { + for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + if (statement.kind !== 232 || statement.name.kind !== 9) { + return false; + } + } + return true; + }; + BuilderFileInfo.prototype.computeHash = function (text) { + return this.project.projectService.host.createHash(text); + }; + BuilderFileInfo.prototype.getSourceFile = function () { + return this.project.getSourceFile(this.scriptInfo.path); + }; + BuilderFileInfo.prototype.updateShapeSignature = function () { + var sourceFile = this.getSourceFile(); + if (!sourceFile) { + return true; + } + var lastSignature = this.lastCheckedShapeSignature; + if (sourceFile.isDeclarationFile) { + this.lastCheckedShapeSignature = this.computeHash(sourceFile.text); + } + else { + var emitOutput = this.project.getFileEmitOutput(this.scriptInfo, true); + if (emitOutput.outputFiles && emitOutput.outputFiles.length > 0) { + this.lastCheckedShapeSignature = this.computeHash(emitOutput.outputFiles[0].text); + } + } + return !lastSignature || this.lastCheckedShapeSignature !== lastSignature; + }; + return BuilderFileInfo; + }()); + server.BuilderFileInfo = BuilderFileInfo; + var AbstractBuilder = (function () { + function AbstractBuilder(project, ctor) { + this.project = project; + this.ctor = ctor; + } + AbstractBuilder.prototype.getFileInfos = function () { + return this.fileInfos_doNotAccessDirectly || (this.fileInfos_doNotAccessDirectly = ts.createFileMap()); + }; + AbstractBuilder.prototype.clear = function () { + this.fileInfos_doNotAccessDirectly = undefined; + }; + AbstractBuilder.prototype.getFileInfo = function (path) { + return this.getFileInfos().get(path); + }; + AbstractBuilder.prototype.getOrCreateFileInfo = function (path) { + var fileInfo = this.getFileInfo(path); + if (!fileInfo) { + var scriptInfo = this.project.getScriptInfo(path); + fileInfo = new this.ctor(scriptInfo, this.project); + this.setFileInfo(path, fileInfo); + } + return fileInfo; + }; + AbstractBuilder.prototype.getFileInfoPaths = function () { + return this.getFileInfos().getKeys(); + }; + AbstractBuilder.prototype.setFileInfo = function (path, info) { + this.getFileInfos().set(path, info); + }; + AbstractBuilder.prototype.removeFileInfo = function (path) { + this.getFileInfos().remove(path); + }; + AbstractBuilder.prototype.forEachFileInfo = function (action) { + this.getFileInfos().forEachValue(function (_path, value) { return action(value); }); + }; + AbstractBuilder.prototype.emitFile = function (scriptInfo, writeFile) { + var fileInfo = this.getFileInfo(scriptInfo.path); + if (!fileInfo) { + return false; + } + var _a = this.project.getFileEmitOutput(fileInfo.scriptInfo, false), emitSkipped = _a.emitSkipped, outputFiles = _a.outputFiles; + if (!emitSkipped) { + var projectRootPath = this.project.getProjectRootPath(); + for (var _i = 0, outputFiles_1 = outputFiles; _i < outputFiles_1.length; _i++) { + var outputFile = outputFiles_1[_i]; + var outputFileAbsoluteFileName = ts.getNormalizedAbsolutePath(outputFile.name, projectRootPath ? projectRootPath : ts.getDirectoryPath(scriptInfo.fileName)); + writeFile(outputFileAbsoluteFileName, outputFile.text, outputFile.writeByteOrderMark); + } + } + return !emitSkipped; + }; + return AbstractBuilder; + }()); + var NonModuleBuilder = (function (_super) { + __extends(NonModuleBuilder, _super); + function NonModuleBuilder(project) { + var _this = _super.call(this, project, BuilderFileInfo) || this; + _this.project = project; + return _this; + } + NonModuleBuilder.prototype.onProjectUpdateGraph = function () { + }; + NonModuleBuilder.prototype.getFilesAffectedBy = function (scriptInfo) { + var info = this.getOrCreateFileInfo(scriptInfo.path); + var singleFileResult = scriptInfo.hasMixedContent ? [] : [scriptInfo.fileName]; + if (info.updateShapeSignature()) { + var options = this.project.getCompilerOptions(); + if (options && (options.out || options.outFile)) { + return singleFileResult; + } + return this.project.getAllEmittableFiles(); + } + return singleFileResult; + }; + return NonModuleBuilder; + }(AbstractBuilder)); + var ModuleBuilderFileInfo = (function (_super) { + __extends(ModuleBuilderFileInfo, _super); + function ModuleBuilderFileInfo() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.references = []; + _this.referencedBy = []; + return _this; + } + ModuleBuilderFileInfo.compareFileInfos = function (lf, rf) { + var l = lf.scriptInfo.fileName; + var r = rf.scriptInfo.fileName; + return (l < r ? -1 : (l > r ? 1 : 0)); + }; + ModuleBuilderFileInfo.addToReferenceList = function (array, fileInfo) { + if (array.length === 0) { + array.push(fileInfo); + return; + } + var insertIndex = ts.binarySearch(array, fileInfo, ModuleBuilderFileInfo.compareFileInfos); + if (insertIndex < 0) { + array.splice(~insertIndex, 0, fileInfo); + } + }; + ModuleBuilderFileInfo.removeFromReferenceList = function (array, fileInfo) { + if (!array || array.length === 0) { + return; + } + if (array[0] === fileInfo) { + array.splice(0, 1); + return; + } + var removeIndex = ts.binarySearch(array, fileInfo, ModuleBuilderFileInfo.compareFileInfos); + if (removeIndex >= 0) { + array.splice(removeIndex, 1); + } + }; + ModuleBuilderFileInfo.prototype.addReferencedBy = function (fileInfo) { + ModuleBuilderFileInfo.addToReferenceList(this.referencedBy, fileInfo); + }; + ModuleBuilderFileInfo.prototype.removeReferencedBy = function (fileInfo) { + ModuleBuilderFileInfo.removeFromReferenceList(this.referencedBy, fileInfo); + }; + ModuleBuilderFileInfo.prototype.removeFileReferences = function () { + for (var _i = 0, _a = this.references; _i < _a.length; _i++) { + var reference = _a[_i]; + reference.removeReferencedBy(this); + } + this.references = []; + }; + return ModuleBuilderFileInfo; + }(BuilderFileInfo)); + var ModuleBuilder = (function (_super) { + __extends(ModuleBuilder, _super); + function ModuleBuilder(project) { + var _this = _super.call(this, project, ModuleBuilderFileInfo) || this; + _this.project = project; + return _this; + } + ModuleBuilder.prototype.clear = function () { + this.projectVersionForDependencyGraph = undefined; + _super.prototype.clear.call(this); + }; + ModuleBuilder.prototype.getReferencedFileInfos = function (fileInfo) { + var _this = this; + if (!fileInfo.isExternalModuleOrHasOnlyAmbientExternalModules()) { + return []; + } + var referencedFilePaths = this.project.getReferencedFiles(fileInfo.scriptInfo.path); + if (referencedFilePaths.length > 0) { + return ts.map(referencedFilePaths, function (f) { return _this.getOrCreateFileInfo(f); }).sort(ModuleBuilderFileInfo.compareFileInfos); + } + return []; + }; + ModuleBuilder.prototype.onProjectUpdateGraph = function () { + this.ensureProjectDependencyGraphUpToDate(); + }; + ModuleBuilder.prototype.ensureProjectDependencyGraphUpToDate = function () { + var _this = this; + if (!this.projectVersionForDependencyGraph || this.project.getProjectVersion() !== this.projectVersionForDependencyGraph) { + var currentScriptInfos = this.project.getScriptInfos(); + for (var _i = 0, currentScriptInfos_1 = currentScriptInfos; _i < currentScriptInfos_1.length; _i++) { + var scriptInfo = currentScriptInfos_1[_i]; + var fileInfo = this.getOrCreateFileInfo(scriptInfo.path); + this.updateFileReferences(fileInfo); + } + this.forEachFileInfo(function (fileInfo) { + if (!_this.project.containsScriptInfo(fileInfo.scriptInfo)) { + fileInfo.removeFileReferences(); + _this.removeFileInfo(fileInfo.scriptInfo.path); + } + }); + this.projectVersionForDependencyGraph = this.project.getProjectVersion(); + } + }; + ModuleBuilder.prototype.updateFileReferences = function (fileInfo) { + if (fileInfo.scriptVersionForReferences === fileInfo.scriptInfo.getLatestVersion()) { + return; + } + var newReferences = this.getReferencedFileInfos(fileInfo); + var oldReferences = fileInfo.references; + var oldIndex = 0; + var newIndex = 0; + while (oldIndex < oldReferences.length && newIndex < newReferences.length) { + var oldReference = oldReferences[oldIndex]; + var newReference = newReferences[newIndex]; + var compare = ModuleBuilderFileInfo.compareFileInfos(oldReference, newReference); + if (compare < 0) { + oldReference.removeReferencedBy(fileInfo); + oldIndex++; + } + else if (compare > 0) { + newReference.addReferencedBy(fileInfo); + newIndex++; + } + else { + oldIndex++; + newIndex++; + } + } + for (var i = oldIndex; i < oldReferences.length; i++) { + oldReferences[i].removeReferencedBy(fileInfo); + } + for (var i = newIndex; i < newReferences.length; i++) { + newReferences[i].addReferencedBy(fileInfo); + } + fileInfo.references = newReferences; + fileInfo.scriptVersionForReferences = fileInfo.scriptInfo.getLatestVersion(); + }; + ModuleBuilder.prototype.getFilesAffectedBy = function (scriptInfo) { + this.ensureProjectDependencyGraphUpToDate(); + var singleFileResult = scriptInfo.hasMixedContent ? [] : [scriptInfo.fileName]; + var fileInfo = this.getFileInfo(scriptInfo.path); + if (!fileInfo || !fileInfo.updateShapeSignature()) { + return singleFileResult; + } + if (!fileInfo.isExternalModuleOrHasOnlyAmbientExternalModules()) { + return this.project.getAllEmittableFiles(); + } + var options = this.project.getCompilerOptions(); + if (options && (options.isolatedModules || options.out || options.outFile)) { + return singleFileResult; + } + var queue = fileInfo.referencedBy.slice(0); + var fileNameSet = ts.createMap(); + fileNameSet.set(scriptInfo.fileName, scriptInfo); + while (queue.length > 0) { + var processingFileInfo = queue.pop(); + if (processingFileInfo.updateShapeSignature() && processingFileInfo.referencedBy.length > 0) { + for (var _i = 0, _a = processingFileInfo.referencedBy; _i < _a.length; _i++) { + var potentialFileInfo = _a[_i]; + if (!fileNameSet.has(potentialFileInfo.scriptInfo.fileName)) { + queue.push(potentialFileInfo); + } + } + } + fileNameSet.set(processingFileInfo.scriptInfo.fileName, processingFileInfo.scriptInfo); + } + var result = []; + fileNameSet.forEach(function (scriptInfo, fileName) { + if (shouldEmitFile(scriptInfo)) { + result.push(fileName); + } + }); + return result; + }; + return ModuleBuilder; + }(AbstractBuilder)); + function createBuilder(project) { + var moduleKind = project.getCompilerOptions().module; + switch (moduleKind) { + case ts.ModuleKind.None: + return new NonModuleBuilder(project); + default: + return new ModuleBuilder(project); + } + } + server.createBuilder = createBuilder; + })(server = ts.server || (ts.server = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var server; + (function (server) { + var ProjectKind; + (function (ProjectKind) { + ProjectKind[ProjectKind["Inferred"] = 0] = "Inferred"; + ProjectKind[ProjectKind["Configured"] = 1] = "Configured"; + ProjectKind[ProjectKind["External"] = 2] = "External"; + })(ProjectKind = server.ProjectKind || (server.ProjectKind = {})); + function remove(items, item) { + var index = items.indexOf(item); + if (index >= 0) { + items.splice(index, 1); + } + } + function countEachFileTypes(infos) { + var result = { js: 0, jsx: 0, ts: 0, tsx: 0, dts: 0 }; + for (var _i = 0, infos_1 = infos; _i < infos_1.length; _i++) { + var info = infos_1[_i]; + switch (info.scriptKind) { + case 1: + result.js += 1; + break; + case 2: + result.jsx += 1; + break; + case 3: + ts.fileExtensionIs(info.fileName, ".d.ts") + ? result.dts += 1 + : result.ts += 1; + break; + case 4: + result.tsx += 1; + break; + } + } + return result; + } + function hasOneOrMoreJsAndNoTsFiles(project) { + var counts = countEachFileTypes(project.getScriptInfos()); + return counts.js > 0 && counts.ts === 0 && counts.tsx === 0; + } + function allRootFilesAreJsOrDts(project) { + var counts = countEachFileTypes(project.getRootScriptInfos()); + return counts.ts === 0 && counts.tsx === 0; + } + server.allRootFilesAreJsOrDts = allRootFilesAreJsOrDts; + function allFilesAreJsOrDts(project) { + var counts = countEachFileTypes(project.getScriptInfos()); + return counts.ts === 0 && counts.tsx === 0; + } + server.allFilesAreJsOrDts = allFilesAreJsOrDts; + var UnresolvedImportsMap = (function () { + function UnresolvedImportsMap() { + this.perFileMap = ts.createFileMap(); + this.version = 0; + } + UnresolvedImportsMap.prototype.clear = function () { + this.perFileMap.clear(); + this.version = 0; + }; + UnresolvedImportsMap.prototype.getVersion = function () { + return this.version; + }; + UnresolvedImportsMap.prototype.remove = function (path) { + this.perFileMap.remove(path); + this.version++; + }; + UnresolvedImportsMap.prototype.get = function (path) { + return this.perFileMap.get(path); + }; + UnresolvedImportsMap.prototype.set = function (path, value) { + this.perFileMap.set(path, value); + this.version++; + }; + return UnresolvedImportsMap; + }()); + server.UnresolvedImportsMap = UnresolvedImportsMap; + var Project = (function () { + function Project(projectName, projectKind, projectService, documentRegistry, hasExplicitListOfFiles, languageServiceEnabled, compilerOptions, compileOnSaveEnabled) { + this.projectName = projectName; + this.projectKind = projectKind; + this.projectService = projectService; + this.documentRegistry = documentRegistry; + this.compilerOptions = compilerOptions; + this.compileOnSaveEnabled = compileOnSaveEnabled; + this.rootFiles = []; + this.rootFilesMap = ts.createFileMap(); + this.cachedUnresolvedImportsPerFile = new UnresolvedImportsMap(); + this.languageServiceEnabled = true; + this.lastReportedVersion = 0; + this.projectStructureVersion = 0; + this.projectStateVersion = 0; + this.typesVersion = 0; + if (!this.compilerOptions) { + this.compilerOptions = ts.getDefaultCompilerOptions(); + this.compilerOptions.allowNonTsExtensions = true; + this.compilerOptions.allowJs = true; + } + else if (hasExplicitListOfFiles || this.compilerOptions.allowJs) { + this.compilerOptions.allowNonTsExtensions = true; + } + this.setInternalCompilerOptionsForEmittingJsFiles(); + this.lsHost = new server.LSHost(this.projectService.host, this, this.projectService.cancellationToken); + this.lsHost.setCompilationSettings(this.compilerOptions); + this.languageService = ts.createLanguageService(this.lsHost, this.documentRegistry); + if (!languageServiceEnabled) { + this.disableLanguageService(); + } + this.builder = server.createBuilder(this); + this.markAsDirty(); + } + Project.prototype.isNonTsProject = function () { + this.updateGraph(); + return allFilesAreJsOrDts(this); + }; + Project.prototype.isJsOnlyProject = function () { + this.updateGraph(); + return hasOneOrMoreJsAndNoTsFiles(this); + }; + Project.prototype.getCachedUnresolvedImportsPerFile_TestOnly = function () { + return this.cachedUnresolvedImportsPerFile; + }; + Project.resolveModule = function (moduleName, initialDir, host, log) { + var resolvedPath = ts.normalizeSlashes(host.resolvePath(ts.combinePaths(initialDir, "node_modules"))); + log("Loading " + moduleName + " from " + initialDir + " (resolved to " + resolvedPath + ")"); + var result = host.require(resolvedPath, moduleName); + if (result.error) { + log("Failed to load module: " + JSON.stringify(result.error)); + return undefined; + } + return result.module; + }; + Project.prototype.setInternalCompilerOptionsForEmittingJsFiles = function () { + if (this.projectKind === ProjectKind.Inferred || this.projectKind === ProjectKind.External) { + this.compilerOptions.noEmitForJsFiles = true; + } + }; + Project.prototype.getProjectErrors = function () { + return this.projectErrors; + }; + Project.prototype.getLanguageService = function (ensureSynchronized) { + if (ensureSynchronized === void 0) { ensureSynchronized = true; } + if (ensureSynchronized) { + this.updateGraph(); + } + return this.languageService; + }; + Project.prototype.getCompileOnSaveAffectedFileList = function (scriptInfo) { + if (!this.languageServiceEnabled) { + return []; + } + this.updateGraph(); + return this.builder.getFilesAffectedBy(scriptInfo); + }; + Project.prototype.getProjectVersion = function () { + return this.projectStateVersion.toString(); + }; + Project.prototype.enableLanguageService = function () { + if (this.languageServiceEnabled) { + return; + } + this.languageServiceEnabled = true; + this.projectService.onUpdateLanguageServiceStateForProject(this, true); + }; + Project.prototype.disableLanguageService = function () { + if (!this.languageServiceEnabled) { + return; + } + this.languageService.cleanupSemanticCache(); + this.languageServiceEnabled = false; + this.projectService.onUpdateLanguageServiceStateForProject(this, false); + }; + Project.prototype.getProjectName = function () { + return this.projectName; + }; + Project.prototype.getExternalFiles = function () { + return []; + }; + Project.prototype.getSourceFile = function (path) { + if (!this.program) { + return undefined; + } + return this.program.getSourceFileByPath(path); + }; + Project.prototype.updateTypes = function () { + this.typesVersion++; + this.markAsDirty(); + this.updateGraph(); + }; + Project.prototype.close = function () { + if (this.program) { + for (var _i = 0, _a = this.program.getSourceFiles(); _i < _a.length; _i++) { + var f = _a[_i]; + var info = this.projectService.getScriptInfo(f.fileName); + info.detachFromProject(this); + } + } + if (!this.program || !this.languageServiceEnabled) { + for (var _b = 0, _c = this.rootFiles; _b < _c.length; _b++) { + var root = _c[_b]; + root.detachFromProject(this); + } + } + this.rootFiles = undefined; + this.rootFilesMap = undefined; + this.program = undefined; + this.languageService.dispose(); + }; + Project.prototype.getCompilerOptions = function () { + return this.compilerOptions; + }; + Project.prototype.hasRoots = function () { + return this.rootFiles && this.rootFiles.length > 0; + }; + Project.prototype.getRootFiles = function () { + return this.rootFiles && this.rootFiles.map(function (info) { return info.fileName; }); + }; + Project.prototype.getRootFilesLSHost = function () { + var result = []; + if (this.rootFiles) { + for (var _i = 0, _a = this.rootFiles; _i < _a.length; _i++) { + var f = _a[_i]; + if (this.languageServiceEnabled || f.isScriptOpen()) { + result.push(f.fileName); + } + } + if (this.typingFiles) { + for (var _b = 0, _c = this.typingFiles; _b < _c.length; _b++) { + var f = _c[_b]; + result.push(f); + } + } + } + return result; + }; + Project.prototype.getRootScriptInfos = function () { + return this.rootFiles; + }; + Project.prototype.getScriptInfos = function () { + var _this = this; + if (!this.languageServiceEnabled) { + return this.rootFiles; + } + return ts.map(this.program.getSourceFiles(), function (sourceFile) { + var scriptInfo = _this.projectService.getScriptInfoForPath(sourceFile.path); + if (!scriptInfo) { + ts.Debug.assert(false, "scriptInfo for a file '" + sourceFile.fileName + "' is missing."); + } + return scriptInfo; + }); + }; + Project.prototype.getFileEmitOutput = function (info, emitOnlyDtsFiles) { + if (!this.languageServiceEnabled) { + return undefined; + } + return this.getLanguageService().getEmitOutput(info.fileName, emitOnlyDtsFiles); + }; + Project.prototype.getFileNames = function (excludeFilesFromExternalLibraries) { + if (!this.program) { + return []; + } + if (!this.languageServiceEnabled) { + var rootFiles = this.getRootFiles(); + if (this.compilerOptions) { + var defaultLibrary = ts.getDefaultLibFilePath(this.compilerOptions); + if (defaultLibrary) { + (rootFiles || (rootFiles = [])).push(server.asNormalizedPath(defaultLibrary)); + } + } + return rootFiles; + } + var result = []; + for (var _i = 0, _a = this.program.getSourceFiles(); _i < _a.length; _i++) { + var f = _a[_i]; + if (excludeFilesFromExternalLibraries && this.program.isSourceFileFromExternalLibrary(f)) { + continue; + } + result.push(server.asNormalizedPath(f.fileName)); + } + return result; + }; + Project.prototype.getAllEmittableFiles = function () { + if (!this.languageServiceEnabled) { + return []; + } + var defaultLibraryFileName = ts.getDefaultLibFileName(this.compilerOptions); + var infos = this.getScriptInfos(); + var result = []; + for (var _i = 0, infos_2 = infos; _i < infos_2.length; _i++) { + var info = infos_2[_i]; + if (ts.getBaseFileName(info.fileName) !== defaultLibraryFileName && server.shouldEmitFile(info)) { + result.push(info.fileName); + } + } + return result; + }; + Project.prototype.containsScriptInfo = function (info) { + return this.isRoot(info) || (this.program && this.program.getSourceFileByPath(info.path) !== undefined); + }; + Project.prototype.containsFile = function (filename, requireOpen) { + var info = this.projectService.getScriptInfoForNormalizedPath(filename); + if (info && (info.isScriptOpen() || !requireOpen)) { + return this.containsScriptInfo(info); + } + }; + Project.prototype.isRoot = function (info) { + return this.rootFilesMap && this.rootFilesMap.contains(info.path); + }; + Project.prototype.addRoot = function (info) { + if (!this.isRoot(info)) { + this.rootFiles.push(info); + this.rootFilesMap.set(info.path, info); + info.attachToProject(this); + this.markAsDirty(); + } + }; + Project.prototype.removeFile = function (info, detachFromProject) { + if (detachFromProject === void 0) { detachFromProject = true; } + if (this.isRoot(info)) { + this.removeRoot(info); + } + this.lsHost.notifyFileRemoved(info); + this.cachedUnresolvedImportsPerFile.remove(info.path); + if (detachFromProject) { + info.detachFromProject(this); + } + this.markAsDirty(); + }; + Project.prototype.registerFileUpdate = function (fileName) { + (this.updatedFileNames || (this.updatedFileNames = ts.createMap())).set(fileName, fileName); + }; + Project.prototype.markAsDirty = function () { + this.projectStateVersion++; + }; + Project.prototype.extractUnresolvedImportsFromSourceFile = function (file, result) { + var cached = this.cachedUnresolvedImportsPerFile.get(file.path); + if (cached) { + for (var _i = 0, cached_2 = cached; _i < cached_2.length; _i++) { + var f = cached_2[_i]; + result.push(f); + } + return; + } + var unresolvedImports; + if (file.resolvedModules) { + file.resolvedModules.forEach(function (resolvedModule, name) { + if (!resolvedModule && !ts.isExternalModuleNameRelative(name)) { + var trimmed = name.trim(); + var i = trimmed.indexOf("/"); + if (i !== -1 && trimmed.charCodeAt(0) === 64) { + i = trimmed.indexOf("/", i + 1); + } + if (i !== -1) { + trimmed = trimmed.substr(0, i); + } + (unresolvedImports || (unresolvedImports = [])).push(trimmed); + result.push(trimmed); + } + }); + } + this.cachedUnresolvedImportsPerFile.set(file.path, unresolvedImports || server.emptyArray); + }; + Project.prototype.updateGraph = function () { + this.lsHost.startRecordingFilesWithChangedResolutions(); + var hasChanges = this.updateGraphWorker(); + var changedFiles = this.lsHost.finishRecordingFilesWithChangedResolutions() || server.emptyArray; + for (var _i = 0, changedFiles_1 = changedFiles; _i < changedFiles_1.length; _i++) { + var file = changedFiles_1[_i]; + this.cachedUnresolvedImportsPerFile.remove(file); + } + var unresolvedImports; + if (hasChanges || changedFiles.length) { + var result = []; + for (var _a = 0, _b = this.program.getSourceFiles(); _a < _b.length; _a++) { + var sourceFile = _b[_a]; + this.extractUnresolvedImportsFromSourceFile(sourceFile, result); + } + this.lastCachedUnresolvedImportsList = server.toSortedReadonlyArray(result); + } + unresolvedImports = this.lastCachedUnresolvedImportsList; + var cachedTypings = this.projectService.typingsCache.getTypingsForProject(this, unresolvedImports, hasChanges); + if (this.setTypings(cachedTypings)) { + hasChanges = this.updateGraphWorker() || hasChanges; + } + if (this.languageServiceEnabled) { + this.builder.onProjectUpdateGraph(); + } + else { + this.builder.clear(); + } + if (hasChanges) { + this.projectStructureVersion++; + } + return !hasChanges; + }; + Project.prototype.setTypings = function (typings) { + if (ts.arrayIsEqualTo(this.typingFiles, typings)) { + return false; + } + this.typingFiles = typings; + this.markAsDirty(); + return true; + }; + Project.prototype.updateGraphWorker = function () { + var oldProgram = this.program; + this.program = this.languageService.getProgram(); + var hasChanges = false; + if (!oldProgram || (this.program !== oldProgram && !oldProgram.structureIsReused)) { + hasChanges = true; + if (oldProgram) { + for (var _i = 0, _a = oldProgram.getSourceFiles(); _i < _a.length; _i++) { + var f = _a[_i]; + if (this.program.getSourceFileByPath(f.path)) { + continue; + } + var scriptInfoToDetach = this.projectService.getScriptInfo(f.fileName); + if (scriptInfoToDetach) { + scriptInfoToDetach.detachFromProject(this); + } + } + } + } + return hasChanges; + }; + Project.prototype.getScriptInfoLSHost = function (fileName) { + var scriptInfo = this.projectService.getOrCreateScriptInfo(fileName, false); + if (scriptInfo) { + scriptInfo.attachToProject(this); + } + return scriptInfo; + }; + Project.prototype.getScriptInfoForNormalizedPath = function (fileName) { + var scriptInfo = this.projectService.getOrCreateScriptInfoForNormalizedPath(fileName, false); + if (scriptInfo && !scriptInfo.isAttached(this)) { + return server.Errors.ThrowProjectDoesNotContainDocument(fileName, this); + } + return scriptInfo; + }; + Project.prototype.getScriptInfo = function (uncheckedFileName) { + return this.getScriptInfoForNormalizedPath(server.toNormalizedPath(uncheckedFileName)); + }; + Project.prototype.filesToString = function () { + if (!this.program) { + return ""; + } + var strBuilder = ""; + for (var _i = 0, _a = this.program.getSourceFiles(); _i < _a.length; _i++) { + var file = _a[_i]; + strBuilder += file.fileName + "\n"; + } + return strBuilder; + }; + Project.prototype.setCompilerOptions = function (compilerOptions) { + if (compilerOptions) { + compilerOptions.allowNonTsExtensions = true; + if (ts.changesAffectModuleResolution(this.compilerOptions, compilerOptions)) { + this.cachedUnresolvedImportsPerFile.clear(); + this.lastCachedUnresolvedImportsList = undefined; + } + this.compilerOptions = compilerOptions; + this.setInternalCompilerOptionsForEmittingJsFiles(); + this.lsHost.setCompilationSettings(compilerOptions); + this.markAsDirty(); + } + }; + Project.prototype.reloadScript = function (filename, tempFileName) { + var script = this.projectService.getScriptInfoForNormalizedPath(filename); + if (script) { + ts.Debug.assert(script.isAttached(this)); + script.reloadFromFile(tempFileName); + return true; + } + return false; + }; + Project.prototype.getChangesSinceVersion = function (lastKnownVersion) { + this.updateGraph(); + var info = { + projectName: this.getProjectName(), + version: this.projectStructureVersion, + isInferred: this.projectKind === ProjectKind.Inferred, + options: this.getCompilerOptions(), + languageServiceDisabled: !this.languageServiceEnabled + }; + var updatedFileNames = this.updatedFileNames; + this.updatedFileNames = undefined; + if (this.lastReportedFileNames && lastKnownVersion === this.lastReportedVersion) { + if (this.projectStructureVersion === this.lastReportedVersion && !updatedFileNames) { + return { info: info, projectErrors: this.projectErrors }; + } + var lastReportedFileNames_1 = this.lastReportedFileNames; + var currentFiles_1 = ts.arrayToMap(this.getFileNames(), function (x) { return x; }); + var added_1 = []; + var removed_1 = []; + var updated = ts.arrayFrom(updatedFileNames.keys()); + ts.forEachKey(currentFiles_1, function (id) { + if (!lastReportedFileNames_1.has(id)) { + added_1.push(id); + } + }); + ts.forEachKey(lastReportedFileNames_1, function (id) { + if (!currentFiles_1.has(id)) { + removed_1.push(id); + } + }); + this.lastReportedFileNames = currentFiles_1; + this.lastReportedVersion = this.projectStructureVersion; + return { info: info, changes: { added: added_1, removed: removed_1, updated: updated }, projectErrors: this.projectErrors }; + } + else { + var projectFileNames = this.getFileNames(); + this.lastReportedFileNames = ts.arrayToMap(projectFileNames, function (x) { return x; }); + this.lastReportedVersion = this.projectStructureVersion; + return { info: info, files: projectFileNames, projectErrors: this.projectErrors }; + } + }; + Project.prototype.getReferencedFiles = function (path) { + var _this = this; + if (!this.languageServiceEnabled) { + return []; + } + var sourceFile = this.getSourceFile(path); + if (!sourceFile) { + return []; + } + var referencedFiles = ts.createMap(); + if (sourceFile.imports && sourceFile.imports.length > 0) { + var checker = this.program.getTypeChecker(); + for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { + var importName = _a[_i]; + var symbol = checker.getSymbolAtLocation(importName); + if (symbol && symbol.declarations && symbol.declarations[0]) { + var declarationSourceFile = symbol.declarations[0].getSourceFile(); + if (declarationSourceFile) { + referencedFiles.set(declarationSourceFile.path, true); + } + } + } + } + var currentDirectory = ts.getDirectoryPath(path); + var getCanonicalFileName = ts.createGetCanonicalFileName(this.projectService.host.useCaseSensitiveFileNames); + if (sourceFile.referencedFiles && sourceFile.referencedFiles.length > 0) { + for (var _b = 0, _c = sourceFile.referencedFiles; _b < _c.length; _b++) { + var referencedFile = _c[_b]; + var referencedPath = ts.toPath(referencedFile.fileName, currentDirectory, getCanonicalFileName); + referencedFiles.set(referencedPath, true); + } + } + if (sourceFile.resolvedTypeReferenceDirectiveNames) { + sourceFile.resolvedTypeReferenceDirectiveNames.forEach(function (resolvedTypeReferenceDirective) { + if (!resolvedTypeReferenceDirective) { + return; + } + var fileName = resolvedTypeReferenceDirective.resolvedFileName; + var typeFilePath = ts.toPath(fileName, currentDirectory, getCanonicalFileName); + referencedFiles.set(typeFilePath, true); + }); + } + var allFileNames = ts.arrayFrom(referencedFiles.keys()); + return ts.filter(allFileNames, function (file) { return _this.projectService.host.fileExists(file); }); + }; + Project.prototype.removeRoot = function (info) { + remove(this.rootFiles, info); + this.rootFilesMap.remove(info.path); + }; + return Project; + }()); + server.Project = Project; + var InferredProject = (function (_super) { + __extends(InferredProject, _super); + function InferredProject(projectService, documentRegistry, compilerOptions) { + var _this = _super.call(this, InferredProject.newName(), ProjectKind.Inferred, projectService, documentRegistry, undefined, true, compilerOptions, false) || this; + _this._isJsInferredProject = false; + _this.directoriesWatchedForTsconfig = []; + return _this; + } + InferredProject.prototype.toggleJsInferredProject = function (isJsInferredProject) { + if (isJsInferredProject !== this._isJsInferredProject) { + this._isJsInferredProject = isJsInferredProject; + this.setCompilerOptions(); + } + }; + InferredProject.prototype.setCompilerOptions = function (options) { + var newOptions = options ? ts.clone(options) : this.getCompilerOptions(); + if (!newOptions) { + return; + } + if (this._isJsInferredProject && typeof newOptions.maxNodeModuleJsDepth !== "number") { + newOptions.maxNodeModuleJsDepth = 2; + } + else if (!this._isJsInferredProject) { + newOptions.maxNodeModuleJsDepth = undefined; + } + newOptions.allowJs = true; + _super.prototype.setCompilerOptions.call(this, newOptions); + }; + InferredProject.prototype.addRoot = function (info) { + if (!this._isJsInferredProject && info.isJavaScript()) { + this.toggleJsInferredProject(true); + } + _super.prototype.addRoot.call(this, info); + }; + InferredProject.prototype.removeRoot = function (info) { + if (this._isJsInferredProject && info.isJavaScript()) { + if (ts.filter(this.getRootScriptInfos(), function (info) { return info.isJavaScript(); }).length === 0) { + this.toggleJsInferredProject(false); + } + } + _super.prototype.removeRoot.call(this, info); + }; + InferredProject.prototype.getProjectRootPath = function () { + if (this.projectService.useSingleInferredProject) { + return undefined; + } + var rootFiles = this.getRootFiles(); + return ts.getDirectoryPath(rootFiles[0]); + }; + InferredProject.prototype.close = function () { + _super.prototype.close.call(this); + for (var _i = 0, _a = this.directoriesWatchedForTsconfig; _i < _a.length; _i++) { + var directory = _a[_i]; + this.projectService.stopWatchingDirectory(directory); + } + }; + InferredProject.prototype.getTypeAcquisition = function () { + return { + enable: allRootFilesAreJsOrDts(this), + include: [], + exclude: [] + }; + }; + return InferredProject; + }(Project)); + InferredProject.newName = (function () { + var nextId = 1; + return function () { + var id = nextId; + nextId++; + return server.makeInferredProjectName(id); + }; + })(); + server.InferredProject = InferredProject; + var ConfiguredProject = (function (_super) { + __extends(ConfiguredProject, _super); + function ConfiguredProject(configFileName, projectService, documentRegistry, hasExplicitListOfFiles, compilerOptions, wildcardDirectories, languageServiceEnabled, compileOnSaveEnabled) { + var _this = _super.call(this, configFileName, ProjectKind.Configured, projectService, documentRegistry, hasExplicitListOfFiles, languageServiceEnabled, compilerOptions, compileOnSaveEnabled) || this; + _this.wildcardDirectories = wildcardDirectories; + _this.compileOnSaveEnabled = compileOnSaveEnabled; + _this.plugins = []; + _this.openRefCount = 0; + _this.canonicalConfigFilePath = server.asNormalizedPath(projectService.toCanonicalFileName(configFileName)); + _this.enablePlugins(); + return _this; + } + ConfiguredProject.prototype.getConfigFilePath = function () { + return this.getProjectName(); + }; + ConfiguredProject.prototype.enablePlugins = function () { + var host = this.projectService.host; + var options = this.getCompilerOptions(); + if (!host.require) { + this.projectService.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded"); + return; + } + var searchPaths = [ts.combinePaths(host.getExecutingFilePath(), "../../..")].concat(this.projectService.pluginProbeLocations); + if (options.plugins) { + for (var _i = 0, _a = options.plugins; _i < _a.length; _i++) { + var pluginConfigEntry = _a[_i]; + this.enablePlugin(pluginConfigEntry, searchPaths); + } + } + if (this.projectService.globalPlugins) { + var _loop_6 = function (globalPluginName) { + if (options.plugins && options.plugins.some(function (p) { return p.name === globalPluginName; })) + return "continue"; + this_1.enablePlugin({ name: globalPluginName, global: true }, searchPaths); + }; + var this_1 = this; + for (var _b = 0, _c = this.projectService.globalPlugins; _b < _c.length; _b++) { + var globalPluginName = _c[_b]; + _loop_6(globalPluginName); + } + } + }; + ConfiguredProject.prototype.enablePlugin = function (pluginConfigEntry, searchPaths) { + var _this = this; + var log = function (message) { + _this.projectService.logger.info(message); + }; + for (var _i = 0, searchPaths_1 = searchPaths; _i < searchPaths_1.length; _i++) { + var searchPath = searchPaths_1[_i]; + var resolvedModule = Project.resolveModule(pluginConfigEntry.name, searchPath, this.projectService.host, log); + if (resolvedModule) { + this.enableProxy(resolvedModule, pluginConfigEntry); + return; + } + } + this.projectService.logger.info("Couldn't find " + pluginConfigEntry.name + " anywhere in paths: " + searchPaths.join(",")); + }; + ConfiguredProject.prototype.enableProxy = function (pluginModuleFactory, configEntry) { + try { + if (typeof pluginModuleFactory !== "function") { + this.projectService.logger.info("Skipped loading plugin " + configEntry.name + " because it did expose a proper factory function"); + return; + } + var info = { + config: configEntry, + project: this, + languageService: this.languageService, + languageServiceHost: this.lsHost, + serverHost: this.projectService.host + }; + var pluginModule = pluginModuleFactory({ typescript: ts }); + this.languageService = pluginModule.create(info); + this.plugins.push(pluginModule); + } + catch (e) { + this.projectService.logger.info("Plugin activation failed: " + e); + } + }; + ConfiguredProject.prototype.getProjectRootPath = function () { + return ts.getDirectoryPath(this.getConfigFilePath()); + }; + ConfiguredProject.prototype.setProjectErrors = function (projectErrors) { + this.projectErrors = projectErrors; + }; + ConfiguredProject.prototype.setTypeAcquisition = function (newTypeAcquisition) { + this.typeAcquisition = newTypeAcquisition; + }; + ConfiguredProject.prototype.getTypeAcquisition = function () { + return this.typeAcquisition; + }; + ConfiguredProject.prototype.getExternalFiles = function () { + var items = []; + for (var _i = 0, _a = this.plugins; _i < _a.length; _i++) { + var plugin = _a[_i]; + if (typeof plugin.getExternalFiles === "function") { + try { + items.push.apply(items, plugin.getExternalFiles(this)); + } + catch (e) { + this.projectService.logger.info("A plugin threw an exception in getExternalFiles: " + e); + } + } + } + return items; + }; + ConfiguredProject.prototype.watchConfigFile = function (callback) { + var _this = this; + this.projectFileWatcher = this.projectService.host.watchFile(this.getConfigFilePath(), function (_) { return callback(_this); }); + }; + ConfiguredProject.prototype.watchTypeRoots = function (callback) { + var _this = this; + var roots = this.getEffectiveTypeRoots(); + var watchers = []; + for (var _i = 0, roots_1 = roots; _i < roots_1.length; _i++) { + var root = roots_1[_i]; + this.projectService.logger.info("Add type root watcher for: " + root); + watchers.push(this.projectService.host.watchDirectory(root, function (path) { return callback(_this, path); }, false)); + } + this.typeRootsWatchers = watchers; + }; + ConfiguredProject.prototype.watchConfigDirectory = function (callback) { + var _this = this; + if (this.directoryWatcher) { + return; + } + var directoryToWatch = ts.getDirectoryPath(this.getConfigFilePath()); + this.projectService.logger.info("Add recursive watcher for: " + directoryToWatch); + this.directoryWatcher = this.projectService.host.watchDirectory(directoryToWatch, function (path) { return callback(_this, path); }, true); + }; + ConfiguredProject.prototype.watchWildcards = function (callback) { + var _this = this; + if (!this.wildcardDirectories) { + return; + } + var configDirectoryPath = ts.getDirectoryPath(this.getConfigFilePath()); + this.directoriesWatchedForWildcards = ts.createMap(); + this.wildcardDirectories.forEach(function (flag, directory) { + if (ts.comparePaths(configDirectoryPath, directory, ".", !_this.projectService.host.useCaseSensitiveFileNames) !== 0) { + var recursive = (flag & 1) !== 0; + _this.projectService.logger.info("Add " + (recursive ? "recursive " : "") + "watcher for: " + directory); + _this.directoriesWatchedForWildcards.set(directory, _this.projectService.host.watchDirectory(directory, function (path) { return callback(_this, path); }, recursive)); + } + }); + }; + ConfiguredProject.prototype.stopWatchingDirectory = function () { + if (this.directoryWatcher) { + this.directoryWatcher.close(); + this.directoryWatcher = undefined; + } + }; + ConfiguredProject.prototype.close = function () { + _super.prototype.close.call(this); + if (this.projectFileWatcher) { + this.projectFileWatcher.close(); + } + if (this.typeRootsWatchers) { + for (var _i = 0, _a = this.typeRootsWatchers; _i < _a.length; _i++) { + var watcher = _a[_i]; + watcher.close(); + } + this.typeRootsWatchers = undefined; + } + this.directoriesWatchedForWildcards.forEach(function (watcher) { + watcher.close(); + }); + this.directoriesWatchedForWildcards = undefined; + this.stopWatchingDirectory(); + }; + ConfiguredProject.prototype.addOpenRef = function () { + this.openRefCount++; + }; + ConfiguredProject.prototype.deleteOpenRef = function () { + this.openRefCount--; + return this.openRefCount; + }; + ConfiguredProject.prototype.getEffectiveTypeRoots = function () { + return ts.getEffectiveTypeRoots(this.getCompilerOptions(), this.projectService.host) || []; + }; + return ConfiguredProject; + }(Project)); + server.ConfiguredProject = ConfiguredProject; + var ExternalProject = (function (_super) { + __extends(ExternalProject, _super); + function ExternalProject(externalProjectName, projectService, documentRegistry, compilerOptions, languageServiceEnabled, compileOnSaveEnabled, projectFilePath) { + var _this = _super.call(this, externalProjectName, ProjectKind.External, projectService, documentRegistry, true, languageServiceEnabled, compilerOptions, compileOnSaveEnabled) || this; + _this.externalProjectName = externalProjectName; + _this.compileOnSaveEnabled = compileOnSaveEnabled; + _this.projectFilePath = projectFilePath; + return _this; + } + ExternalProject.prototype.getProjectRootPath = function () { + if (this.projectFilePath) { + return ts.getDirectoryPath(this.projectFilePath); + } + return ts.getDirectoryPath(ts.normalizeSlashes(this.getProjectName())); + }; + ExternalProject.prototype.getTypeAcquisition = function () { + return this.typeAcquisition; + }; + ExternalProject.prototype.setProjectErrors = function (projectErrors) { + this.projectErrors = projectErrors; + }; + ExternalProject.prototype.setTypeAcquisition = function (newTypeAcquisition) { + if (!newTypeAcquisition) { + newTypeAcquisition = { + enable: allRootFilesAreJsOrDts(this), + include: [], + exclude: [] + }; + } + else { + if (newTypeAcquisition.enable === undefined) { + newTypeAcquisition.enable = allRootFilesAreJsOrDts(this); + } + if (!newTypeAcquisition.include) { + newTypeAcquisition.include = []; + } + if (!newTypeAcquisition.exclude) { + newTypeAcquisition.exclude = []; + } + } + this.typeAcquisition = newTypeAcquisition; + }; + return ExternalProject; + }(Project)); + server.ExternalProject = ExternalProject; + })(server = ts.server || (ts.server = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var server; + (function (server) { + server.maxProgramSizeForNonTsFiles = 20 * 1024 * 1024; + server.ContextEvent = "context"; + server.ConfigFileDiagEvent = "configFileDiag"; + server.ProjectLanguageServiceStateEvent = "projectLanguageServiceState"; + function prepareConvertersForEnumLikeCompilerOptions(commandLineOptions) { + var map = ts.createMap(); + for (var _i = 0, commandLineOptions_1 = commandLineOptions; _i < commandLineOptions_1.length; _i++) { + var option = commandLineOptions_1[_i]; + if (typeof option.type === "object") { + var optionMap = option.type; + optionMap.forEach(function (value) { + ts.Debug.assert(typeof value === "number"); + }); + map.set(option.name, optionMap); + } + } + return map; + } + var compilerOptionConverters = prepareConvertersForEnumLikeCompilerOptions(ts.optionDeclarations); + var indentStyle = ts.createMapFromTemplate({ + "none": ts.IndentStyle.None, + "block": ts.IndentStyle.Block, + "smart": ts.IndentStyle.Smart + }); + var defaultTypeSafeList = { + "jquery": { + "match": /jquery(-(\.?\d+)+)?(\.intellisense)?(\.min)?\.js$/i, + "types": ["jquery"] + }, + "WinJS": { + "match": /^(.*\/winjs-[.\d]+)\/js\/base\.js$/i, + "exclude": [["^", 1, "/.*"]], + "types": ["winjs"] + }, + "Kendo": { + "match": /^(.*\/kendo)\/kendo\.all\.min\.js$/i, + "exclude": [["^", 1, "/.*"]], + "types": ["kendo-ui"] + }, + "Office Nuget": { + "match": /^(.*\/office\/1)\/excel-\d+\.debug\.js$/i, + "exclude": [["^", 1, "/.*"]], + "types": ["office"] + }, + "Minified files": { + "match": /^(.+\.min\.js)$/i, + "exclude": [["^", 1, "$"]] + } + }; + function convertFormatOptions(protocolOptions) { + if (typeof protocolOptions.indentStyle === "string") { + protocolOptions.indentStyle = indentStyle.get(protocolOptions.indentStyle.toLowerCase()); + ts.Debug.assert(protocolOptions.indentStyle !== undefined); + } + return protocolOptions; + } + server.convertFormatOptions = convertFormatOptions; + function convertCompilerOptions(protocolOptions) { + compilerOptionConverters.forEach(function (mappedValues, id) { + var propertyValue = protocolOptions[id]; + if (typeof propertyValue === "string") { + protocolOptions[id] = mappedValues.get(propertyValue.toLowerCase()); + } + }); + return protocolOptions; + } + server.convertCompilerOptions = convertCompilerOptions; + function tryConvertScriptKindName(scriptKindName) { + return typeof scriptKindName === "string" + ? convertScriptKindName(scriptKindName) + : scriptKindName; + } + server.tryConvertScriptKindName = tryConvertScriptKindName; + function convertScriptKindName(scriptKindName) { + switch (scriptKindName) { + case "JS": + return 1; + case "JSX": + return 2; + case "TS": + return 3; + case "TSX": + return 4; + default: + return 0; + } + } + server.convertScriptKindName = convertScriptKindName; + function combineProjectOutput(projects, action, comparer, areEqual) { + var result = projects.reduce(function (previous, current) { return ts.concatenate(previous, action(current)); }, []).sort(comparer); + return projects.length > 1 ? ts.deduplicate(result, areEqual) : result; + } + server.combineProjectOutput = combineProjectOutput; + var fileNamePropertyReader = { + getFileName: function (x) { return x; }, + getScriptKind: function (_) { return undefined; }, + hasMixedContent: function (fileName, extraFileExtensions) { + var mixedContentExtensions = ts.map(ts.filter(extraFileExtensions, function (item) { return item.isMixedContent; }), function (item) { return item.extension; }); + return ts.forEach(mixedContentExtensions, function (extension) { return ts.fileExtensionIs(fileName, extension); }); + } + }; + var externalFilePropertyReader = { + getFileName: function (x) { return x.fileName; }, + getScriptKind: function (x) { return tryConvertScriptKindName(x.scriptKind); }, + hasMixedContent: function (x) { return x.hasMixedContent; } + }; + function findProjectByName(projectName, projects) { + for (var _i = 0, projects_2 = projects; _i < projects_2.length; _i++) { + var proj = projects_2[_i]; + if (proj.getProjectName() === projectName) { + return proj; + } + } + } + function createFileNotFoundDiagnostic(fileName) { + return ts.createCompilerDiagnostic(ts.Diagnostics.File_0_not_found, fileName); + } + function isRootFileInInferredProject(info) { + if (info.containingProjects.length === 0) { + return false; + } + return info.containingProjects[0].projectKind === server.ProjectKind.Inferred && info.containingProjects[0].isRoot(info); + } + var DirectoryWatchers = (function () { + function DirectoryWatchers(projectService) { + this.projectService = projectService; + this.directoryWatchersForTsconfig = ts.createMap(); + this.directoryWatchersRefCount = ts.createMap(); + } + DirectoryWatchers.prototype.stopWatchingDirectory = function (directory) { + var refCount = this.directoryWatchersRefCount.get(directory) - 1; + this.directoryWatchersRefCount.set(directory, refCount); + if (refCount === 0) { + this.projectService.logger.info("Close directory watcher for: " + directory); + this.directoryWatchersForTsconfig.get(directory).close(); + this.directoryWatchersForTsconfig.delete(directory); + } + }; + DirectoryWatchers.prototype.startWatchingContainingDirectoriesForFile = function (fileName, project, callback) { + var currentPath = ts.getDirectoryPath(fileName); + var parentPath = ts.getDirectoryPath(currentPath); + while (currentPath !== parentPath) { + if (!this.directoryWatchersForTsconfig.has(currentPath)) { + this.projectService.logger.info("Add watcher for: " + currentPath); + this.directoryWatchersForTsconfig.set(currentPath, this.projectService.host.watchDirectory(currentPath, callback)); + this.directoryWatchersRefCount.set(currentPath, 1); + } + else { + this.directoryWatchersRefCount.set(currentPath, this.directoryWatchersRefCount.get(currentPath) + 1); + } + project.directoriesWatchedForTsconfig.push(currentPath); + currentPath = parentPath; + parentPath = ts.getDirectoryPath(parentPath); + } + }; + return DirectoryWatchers; + }()); + var ProjectService = (function () { + function ProjectService(opts) { + this.filenameToScriptInfo = ts.createFileMap(); + this.externalProjectToConfiguredProjectMap = ts.createMap(); + this.externalProjects = []; + this.inferredProjects = []; + this.configuredProjects = []; + this.openFiles = []; + this.projectToSizeMap = ts.createMap(); + this.host = opts.host; + this.logger = opts.logger; + this.cancellationToken = opts.cancellationToken; + this.useSingleInferredProject = opts.useSingleInferredProject; + this.typingsInstaller = opts.typingsInstaller || server.nullTypingsInstaller; + this.throttleWaitMilliseconds = opts.throttleWaitMilliseconds; + this.eventHandler = opts.eventHandler; + this.globalPlugins = opts.globalPlugins || server.emptyArray; + this.pluginProbeLocations = opts.pluginProbeLocations || server.emptyArray; + ts.Debug.assert(!!this.host.createHash, "'ServerHost.createHash' is required for ProjectService"); + this.toCanonicalFileName = ts.createGetCanonicalFileName(this.host.useCaseSensitiveFileNames); + this.directoryWatchers = new DirectoryWatchers(this); + this.throttledOperations = new server.ThrottledOperations(this.host); + this.typingsInstaller.attach(this); + this.typingsCache = new server.TypingsCache(this.typingsInstaller); + this.hostConfiguration = { + formatCodeOptions: server.getDefaultFormatCodeSettings(this.host), + hostInfo: "Unknown host", + extraFileExtensions: [] + }; + this.documentRegistry = ts.createDocumentRegistry(this.host.useCaseSensitiveFileNames, this.host.getCurrentDirectory()); + } + ProjectService.prototype.getChangedFiles_TestOnly = function () { + return this.changedFiles; + }; + ProjectService.prototype.ensureInferredProjectsUpToDate_TestOnly = function () { + this.ensureInferredProjectsUpToDate(); + }; + ProjectService.prototype.getCompilerOptionsForInferredProjects = function () { + return this.compilerOptionsForInferredProjects; + }; + ProjectService.prototype.onUpdateLanguageServiceStateForProject = function (project, languageServiceEnabled) { + if (!this.eventHandler) { + return; + } + this.eventHandler({ + eventName: server.ProjectLanguageServiceStateEvent, + data: { project: project, languageServiceEnabled: languageServiceEnabled } + }); + }; + ProjectService.prototype.updateTypingsForProject = function (response) { + var project = this.findProject(response.projectName); + if (!project) { + return; + } + switch (response.kind) { + case server.ActionSet: + this.typingsCache.updateTypingsForProject(response.projectName, response.compilerOptions, response.typeAcquisition, response.unresolvedImports, response.typings); + break; + case server.ActionInvalidate: + this.typingsCache.deleteTypingsForProject(response.projectName); + break; + } + project.updateGraph(); + }; + ProjectService.prototype.setCompilerOptionsForInferredProjects = function (projectCompilerOptions) { + this.compilerOptionsForInferredProjects = convertCompilerOptions(projectCompilerOptions); + this.compilerOptionsForInferredProjects.allowNonTsExtensions = true; + this.compileOnSaveForInferredProjects = projectCompilerOptions.compileOnSave; + for (var _i = 0, _a = this.inferredProjects; _i < _a.length; _i++) { + var proj = _a[_i]; + proj.setCompilerOptions(this.compilerOptionsForInferredProjects); + proj.compileOnSaveEnabled = projectCompilerOptions.compileOnSave; + } + this.updateProjectGraphs(this.inferredProjects); + }; + ProjectService.prototype.stopWatchingDirectory = function (directory) { + this.directoryWatchers.stopWatchingDirectory(directory); + }; + ProjectService.prototype.findProject = function (projectName) { + if (projectName === undefined) { + return undefined; + } + if (server.isInferredProjectName(projectName)) { + this.ensureInferredProjectsUpToDate(); + return findProjectByName(projectName, this.inferredProjects); + } + return this.findExternalProjectByProjectName(projectName) || this.findConfiguredProjectByProjectName(server.toNormalizedPath(projectName)); + }; + ProjectService.prototype.getDefaultProjectForFile = function (fileName, refreshInferredProjects) { + if (refreshInferredProjects) { + this.ensureInferredProjectsUpToDate(); + } + var scriptInfo = this.getScriptInfoForNormalizedPath(fileName); + return scriptInfo && scriptInfo.getDefaultProject(); + }; + ProjectService.prototype.ensureInferredProjectsUpToDate = function () { + if (this.changedFiles) { + var projectsToUpdate = void 0; + if (this.changedFiles.length === 1) { + projectsToUpdate = this.changedFiles[0].containingProjects; + } + else { + projectsToUpdate = []; + for (var _i = 0, _a = this.changedFiles; _i < _a.length; _i++) { + var f = _a[_i]; + projectsToUpdate = projectsToUpdate.concat(f.containingProjects); + } + } + this.updateProjectGraphs(projectsToUpdate); + this.changedFiles = undefined; + } + }; + ProjectService.prototype.findContainingExternalProject = function (fileName) { + for (var _i = 0, _a = this.externalProjects; _i < _a.length; _i++) { + var proj = _a[_i]; + if (proj.containsFile(fileName)) { + return proj; + } + } + return undefined; + }; + ProjectService.prototype.getFormatCodeOptions = function (file) { + var formatCodeSettings; + if (file) { + var info = this.getScriptInfoForNormalizedPath(file); + if (info) { + formatCodeSettings = info.getFormatCodeSettings(); + } + } + return formatCodeSettings || this.hostConfiguration.formatCodeOptions; + }; + ProjectService.prototype.updateProjectGraphs = function (projects) { + var shouldRefreshInferredProjects = false; + for (var _i = 0, projects_3 = projects; _i < projects_3.length; _i++) { + var p = projects_3[_i]; + if (!p.updateGraph()) { + shouldRefreshInferredProjects = true; + } + } + if (shouldRefreshInferredProjects) { + this.refreshInferredProjects(); + } + }; + ProjectService.prototype.onSourceFileChanged = function (fileName) { + var info = this.getScriptInfoForNormalizedPath(fileName); + if (!info) { + this.logger.info("Error: got watch notification for unknown file: " + fileName); + return; + } + if (!this.host.fileExists(fileName)) { + this.handleDeletedFile(info); + } + else { + if (info && (!info.isScriptOpen())) { + info.reloadFromFile(); + this.updateProjectGraphs(info.containingProjects); + } + } + }; + ProjectService.prototype.handleDeletedFile = function (info) { + this.logger.info(info.fileName + " deleted"); + info.stopWatcher(); + if (!info.isScriptOpen()) { + this.filenameToScriptInfo.remove(info.path); + this.lastDeletedFile = info; + var containingProjects = info.containingProjects.slice(); + info.detachAllProjects(); + this.updateProjectGraphs(containingProjects); + this.lastDeletedFile = undefined; + if (!this.eventHandler) { + return; + } + for (var _i = 0, _a = this.openFiles; _i < _a.length; _i++) { + var openFile = _a[_i]; + this.eventHandler({ + eventName: server.ContextEvent, + data: { project: openFile.getDefaultProject(), fileName: openFile.fileName } + }); + } + } + this.printProjects(); + }; + ProjectService.prototype.onTypeRootFileChanged = function (project, fileName) { + var _this = this; + this.logger.info("Type root file " + fileName + " changed"); + this.throttledOperations.schedule(project.getConfigFilePath() + " * type root", 250, function () { + project.updateTypes(); + _this.updateConfiguredProject(project); + _this.refreshInferredProjects(); + }); + }; + ProjectService.prototype.onSourceFileInDirectoryChangedForConfiguredProject = function (project, fileName) { + var _this = this; + if (fileName && !ts.isSupportedSourceFileName(fileName, project.getCompilerOptions(), this.hostConfiguration.extraFileExtensions)) { + return; + } + this.logger.info("Detected source file changes: " + fileName); + this.throttledOperations.schedule(project.getConfigFilePath(), 250, function () { return _this.handleChangeInSourceFileForConfiguredProject(project, fileName); }); + }; + ProjectService.prototype.handleChangeInSourceFileForConfiguredProject = function (project, triggerFile) { + var _this = this; + var _a = this.convertConfigFileContentToProjectOptions(project.getConfigFilePath()), projectOptions = _a.projectOptions, configFileErrors = _a.configFileErrors; + this.reportConfigFileDiagnostics(project.getProjectName(), configFileErrors, triggerFile); + var newRootFiles = projectOptions.files.map((function (f) { return _this.getCanonicalFileName(f); })); + var currentRootFiles = project.getRootFiles().map((function (f) { return _this.getCanonicalFileName(f); })); + if (!ts.arrayIsEqualTo(currentRootFiles.sort(), newRootFiles.sort())) { + this.logger.info("Updating configured project"); + this.updateConfiguredProject(project); + this.refreshInferredProjects(); + } + }; + ProjectService.prototype.onConfigChangedForConfiguredProject = function (project) { + var configFileName = project.getConfigFilePath(); + this.logger.info("Config file changed: " + configFileName); + var configFileErrors = this.updateConfiguredProject(project); + this.reportConfigFileDiagnostics(configFileName, configFileErrors, configFileName); + this.refreshInferredProjects(); + }; + ProjectService.prototype.onConfigFileAddedForInferredProject = function (fileName) { + if (ts.getBaseFileName(fileName) !== "tsconfig.json") { + this.logger.info(fileName + " is not tsconfig.json"); + return; + } + var configFileErrors = this.convertConfigFileContentToProjectOptions(fileName).configFileErrors; + this.reportConfigFileDiagnostics(fileName, configFileErrors, fileName); + this.logger.info("Detected newly added tsconfig file: " + fileName); + this.reloadProjects(); + }; + ProjectService.prototype.getCanonicalFileName = function (fileName) { + var name = this.host.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(); + return ts.normalizePath(name); + }; + ProjectService.prototype.removeProject = function (project) { + this.logger.info("remove project: " + project.getRootFiles().toString()); + project.close(); + switch (project.projectKind) { + case server.ProjectKind.External: + server.removeItemFromSet(this.externalProjects, project); + this.projectToSizeMap.delete(project.externalProjectName); + break; + case server.ProjectKind.Configured: + server.removeItemFromSet(this.configuredProjects, project); + this.projectToSizeMap.delete(project.canonicalConfigFilePath); + break; + case server.ProjectKind.Inferred: + server.removeItemFromSet(this.inferredProjects, project); + break; + } + }; + ProjectService.prototype.assignScriptInfoToInferredProjectIfNecessary = function (info, addToListOfOpenFiles) { + var externalProject = this.findContainingExternalProject(info.fileName); + if (externalProject) { + if (addToListOfOpenFiles) { + this.openFiles.push(info); + } + return; + } + var foundConfiguredProject = false; + for (var _i = 0, _a = info.containingProjects; _i < _a.length; _i++) { + var p = _a[_i]; + if (p.projectKind === server.ProjectKind.Configured) { + foundConfiguredProject = true; + if (addToListOfOpenFiles) { + (p).addOpenRef(); + } + } + } + if (foundConfiguredProject) { + if (addToListOfOpenFiles) { + this.openFiles.push(info); + } + return; + } + if (info.containingProjects.length === 0) { + var inferredProject = this.createInferredProjectWithRootFileIfNecessary(info); + if (!this.useSingleInferredProject) { + for (var _b = 0, _c = this.openFiles; _b < _c.length; _b++) { + var f = _c[_b]; + if (f.containingProjects.length === 0 || !inferredProject.containsScriptInfo(f)) { + continue; + } + for (var _d = 0, _e = f.containingProjects; _d < _e.length; _d++) { + var fContainingProject = _e[_d]; + if (fContainingProject.projectKind === server.ProjectKind.Inferred && + fContainingProject.isRoot(f) && + fContainingProject !== inferredProject) { + this.removeProject(fContainingProject); + f.attachToProject(inferredProject); + } + } + } + } + } + if (addToListOfOpenFiles) { + this.openFiles.push(info); + } + }; + ProjectService.prototype.closeOpenFile = function (info) { + info.close(); + server.removeItemFromSet(this.openFiles, info); + var projectsToRemove; + for (var _i = 0, _a = info.containingProjects; _i < _a.length; _i++) { + var p = _a[_i]; + if (p.projectKind === server.ProjectKind.Configured) { + if (info.hasMixedContent) { + info.registerFileUpdate(); + } + if (p.deleteOpenRef() === 0) { + (projectsToRemove || (projectsToRemove = [])).push(p); + } + } + else if (p.projectKind === server.ProjectKind.Inferred && p.isRoot(info)) { + (projectsToRemove || (projectsToRemove = [])).push(p); + } + if (!p.languageServiceEnabled) { + p.markAsDirty(); + } + } + if (projectsToRemove) { + for (var _b = 0, projectsToRemove_1 = projectsToRemove; _b < projectsToRemove_1.length; _b++) { + var project = projectsToRemove_1[_b]; + this.removeProject(project); + } + var orphanFiles = void 0; + for (var _c = 0, _d = this.openFiles; _c < _d.length; _c++) { + var f = _d[_c]; + if (f.containingProjects.length === 0) { + (orphanFiles || (orphanFiles = [])).push(f); + } + } + if (orphanFiles) { + for (var _e = 0, orphanFiles_1 = orphanFiles; _e < orphanFiles_1.length; _e++) { + var f = orphanFiles_1[_e]; + this.assignScriptInfoToInferredProjectIfNecessary(f, false); + } + } + } + if (info.containingProjects.length === 0) { + this.filenameToScriptInfo.remove(info.path); + } + }; + ProjectService.prototype.openOrUpdateConfiguredProjectForFile = function (fileName) { + var searchPath = ts.getDirectoryPath(fileName); + this.logger.info("Search path: " + searchPath); + var configFileName = this.findConfigFile(server.asNormalizedPath(searchPath)); + if (!configFileName) { + this.logger.info("No config files found."); + return {}; + } + this.logger.info("Config file name: " + configFileName); + var project = this.findConfiguredProjectByProjectName(configFileName); + if (!project) { + var _a = this.openConfigFile(configFileName, fileName), success = _a.success, errors = _a.errors; + if (!success) { + return { configFileName: configFileName, configFileErrors: errors }; + } + this.logger.info("Opened configuration file " + configFileName); + if (errors && errors.length > 0) { + return { configFileName: configFileName, configFileErrors: errors }; + } + } + else { + this.updateConfiguredProject(project); + } + return { configFileName: configFileName }; + }; + ProjectService.prototype.findConfigFile = function (searchPath) { + while (true) { + var tsconfigFileName = server.asNormalizedPath(ts.combinePaths(searchPath, "tsconfig.json")); + if (this.host.fileExists(tsconfigFileName)) { + return tsconfigFileName; + } + var jsconfigFileName = server.asNormalizedPath(ts.combinePaths(searchPath, "jsconfig.json")); + if (this.host.fileExists(jsconfigFileName)) { + return jsconfigFileName; + } + var parentPath = server.asNormalizedPath(ts.getDirectoryPath(searchPath)); + if (parentPath === searchPath) { + break; + } + searchPath = parentPath; + } + return undefined; + }; + ProjectService.prototype.printProjects = function () { + if (!this.logger.hasLevel(server.LogLevel.verbose)) { + return; + } + this.logger.startGroup(); + var counter = 0; + counter = printProjects(this.logger, this.externalProjects, counter); + counter = printProjects(this.logger, this.configuredProjects, counter); + counter = printProjects(this.logger, this.inferredProjects, counter); + this.logger.info("Open files: "); + for (var _i = 0, _a = this.openFiles; _i < _a.length; _i++) { + var rootFile = _a[_i]; + this.logger.info(rootFile.fileName); + } + this.logger.endGroup(); + function printProjects(logger, projects, counter) { + for (var _i = 0, projects_4 = projects; _i < projects_4.length; _i++) { + var project = projects_4[_i]; + project.updateGraph(); + logger.info("Project '" + project.getProjectName() + "' (" + server.ProjectKind[project.projectKind] + ") " + counter); + logger.info(project.filesToString()); + logger.info("-----------------------------------------------"); + counter++; + } + return counter; + } + }; + ProjectService.prototype.findConfiguredProjectByProjectName = function (configFileName) { + configFileName = server.asNormalizedPath(this.toCanonicalFileName(configFileName)); + for (var _i = 0, _a = this.configuredProjects; _i < _a.length; _i++) { + var proj = _a[_i]; + if (proj.canonicalConfigFilePath === configFileName) { + return proj; + } + } + }; + ProjectService.prototype.findExternalProjectByProjectName = function (projectFileName) { + return findProjectByName(projectFileName, this.externalProjects); + }; + ProjectService.prototype.convertConfigFileContentToProjectOptions = function (configFilename) { + configFilename = ts.normalizePath(configFilename); + var configFileContent = this.host.readFile(configFilename); + var errors; + var result = ts.parseConfigFileTextToJson(configFilename, configFileContent); + var config = result.config; + if (result.error) { + var _a = ts.sanitizeConfigFile(configFilename, configFileContent), sanitizedConfig = _a.configJsonObject, diagnostics = _a.diagnostics; + config = sanitizedConfig; + errors = diagnostics.length ? diagnostics : [result.error]; + } + var parsedCommandLine = ts.parseJsonConfigFileContent(config, this.host, ts.getDirectoryPath(configFilename), {}, configFilename, [], this.hostConfiguration.extraFileExtensions); + if (parsedCommandLine.errors.length) { + errors = ts.concatenate(errors, parsedCommandLine.errors); + } + ts.Debug.assert(!!parsedCommandLine.fileNames); + if (parsedCommandLine.fileNames.length === 0) { + (errors || (errors = [])).push(ts.createCompilerDiagnostic(ts.Diagnostics.The_config_file_0_found_doesn_t_contain_any_source_files, configFilename)); + return { success: false, configFileErrors: errors }; + } + var projectOptions = { + files: parsedCommandLine.fileNames, + compilerOptions: parsedCommandLine.options, + configHasFilesProperty: config["files"] !== undefined, + wildcardDirectories: ts.createMapFromTemplate(parsedCommandLine.wildcardDirectories), + typeAcquisition: parsedCommandLine.typeAcquisition, + compileOnSave: parsedCommandLine.compileOnSave + }; + return { success: true, projectOptions: projectOptions, configFileErrors: errors }; + }; + ProjectService.prototype.exceededTotalSizeLimitForNonTsFiles = function (name, options, fileNames, propertyReader) { + if (options && options.disableSizeLimit || !this.host.getFileSize) { + return false; + } + var availableSpace = server.maxProgramSizeForNonTsFiles; + this.projectToSizeMap.set(name, 0); + this.projectToSizeMap.forEach(function (val) { return (availableSpace -= (val || 0)); }); + var totalNonTsFileSize = 0; + for (var _i = 0, fileNames_3 = fileNames; _i < fileNames_3.length; _i++) { + var f = fileNames_3[_i]; + var fileName = propertyReader.getFileName(f); + if (ts.hasTypeScriptFileExtension(fileName)) { + continue; + } + totalNonTsFileSize += this.host.getFileSize(fileName); + if (totalNonTsFileSize > server.maxProgramSizeForNonTsFiles) { + return true; + } + } + if (totalNonTsFileSize > availableSpace) { + return true; + } + this.projectToSizeMap.set(name, totalNonTsFileSize); + return false; + }; + ProjectService.prototype.createAndAddExternalProject = function (projectFileName, files, options, typeAcquisition) { + var compilerOptions = convertCompilerOptions(options); + var project = new server.ExternalProject(projectFileName, this, this.documentRegistry, compilerOptions, !this.exceededTotalSizeLimitForNonTsFiles(projectFileName, compilerOptions, files, externalFilePropertyReader), options.compileOnSave === undefined ? true : options.compileOnSave); + this.addFilesToProjectAndUpdateGraph(project, files, externalFilePropertyReader, undefined, typeAcquisition, undefined); + this.externalProjects.push(project); + return project; + }; + ProjectService.prototype.reportConfigFileDiagnostics = function (configFileName, diagnostics, triggerFile) { + if (!this.eventHandler) { + return; + } + this.eventHandler({ + eventName: server.ConfigFileDiagEvent, + data: { configFileName: configFileName, diagnostics: diagnostics || [], triggerFile: triggerFile } + }); + }; + ProjectService.prototype.createAndAddConfiguredProject = function (configFileName, projectOptions, configFileErrors, clientFileName) { + var _this = this; + var sizeLimitExceeded = this.exceededTotalSizeLimitForNonTsFiles(configFileName, projectOptions.compilerOptions, projectOptions.files, fileNamePropertyReader); + var project = new server.ConfiguredProject(configFileName, this, this.documentRegistry, projectOptions.configHasFilesProperty, projectOptions.compilerOptions, projectOptions.wildcardDirectories, !sizeLimitExceeded, projectOptions.compileOnSave === undefined ? false : projectOptions.compileOnSave); + this.addFilesToProjectAndUpdateGraph(project, projectOptions.files, fileNamePropertyReader, clientFileName, projectOptions.typeAcquisition, configFileErrors); + project.watchConfigFile(function (project) { return _this.onConfigChangedForConfiguredProject(project); }); + if (!sizeLimitExceeded) { + this.watchConfigDirectoryForProject(project, projectOptions); + } + project.watchWildcards(function (project, path) { return _this.onSourceFileInDirectoryChangedForConfiguredProject(project, path); }); + project.watchTypeRoots(function (project, path) { return _this.onTypeRootFileChanged(project, path); }); + this.configuredProjects.push(project); + return project; + }; + ProjectService.prototype.watchConfigDirectoryForProject = function (project, options) { + var _this = this; + if (!options.configHasFilesProperty) { + project.watchConfigDirectory(function (project, path) { return _this.onSourceFileInDirectoryChangedForConfiguredProject(project, path); }); + } + }; + ProjectService.prototype.addFilesToProjectAndUpdateGraph = function (project, files, propertyReader, clientFileName, typeAcquisition, configFileErrors) { + var errors; + for (var _i = 0, files_4 = files; _i < files_4.length; _i++) { + var f = files_4[_i]; + var rootFilename = propertyReader.getFileName(f); + var scriptKind = propertyReader.getScriptKind(f); + var hasMixedContent = propertyReader.hasMixedContent(f, this.hostConfiguration.extraFileExtensions); + if (this.host.fileExists(rootFilename)) { + var info = this.getOrCreateScriptInfoForNormalizedPath(server.toNormalizedPath(rootFilename), clientFileName === rootFilename, undefined, scriptKind, hasMixedContent); + project.addRoot(info); + } + else { + (errors || (errors = [])).push(createFileNotFoundDiagnostic(rootFilename)); + } + } + project.setProjectErrors(ts.concatenate(configFileErrors, errors)); + project.setTypeAcquisition(typeAcquisition); + project.updateGraph(); + }; + ProjectService.prototype.openConfigFile = function (configFileName, clientFileName) { + var conversionResult = this.convertConfigFileContentToProjectOptions(configFileName); + var projectOptions = conversionResult.success + ? conversionResult.projectOptions + : { files: [], compilerOptions: {}, typeAcquisition: { enable: false } }; + var project = this.createAndAddConfiguredProject(configFileName, projectOptions, conversionResult.configFileErrors, clientFileName); + return { + success: conversionResult.success, + project: project, + errors: project.getProjectErrors() + }; + }; + ProjectService.prototype.updateNonInferredProject = function (project, newUncheckedFiles, propertyReader, newOptions, newTypeAcquisition, compileOnSave, configFileErrors) { + var oldRootScriptInfos = project.getRootScriptInfos(); + var newRootScriptInfos = []; + var newRootScriptInfoMap = server.createNormalizedPathMap(); + var projectErrors; + var rootFilesChanged = false; + for (var _i = 0, newUncheckedFiles_1 = newUncheckedFiles; _i < newUncheckedFiles_1.length; _i++) { + var f = newUncheckedFiles_1[_i]; + var newRootFile = propertyReader.getFileName(f); + if (!this.host.fileExists(newRootFile)) { + (projectErrors || (projectErrors = [])).push(createFileNotFoundDiagnostic(newRootFile)); + continue; + } + var normalizedPath = server.toNormalizedPath(newRootFile); + var scriptInfo = this.getScriptInfoForNormalizedPath(normalizedPath); + if (!scriptInfo || !project.isRoot(scriptInfo)) { + rootFilesChanged = true; + if (!scriptInfo) { + var scriptKind = propertyReader.getScriptKind(f); + var hasMixedContent = propertyReader.hasMixedContent(f, this.hostConfiguration.extraFileExtensions); + scriptInfo = this.getOrCreateScriptInfoForNormalizedPath(normalizedPath, false, undefined, scriptKind, hasMixedContent); + } + } + newRootScriptInfos.push(scriptInfo); + newRootScriptInfoMap.set(scriptInfo.fileName, scriptInfo); + } + if (rootFilesChanged || newRootScriptInfos.length !== oldRootScriptInfos.length) { + var toAdd = void 0; + var toRemove = void 0; + for (var _a = 0, oldRootScriptInfos_1 = oldRootScriptInfos; _a < oldRootScriptInfos_1.length; _a++) { + var oldFile = oldRootScriptInfos_1[_a]; + if (!newRootScriptInfoMap.contains(oldFile.fileName)) { + (toRemove || (toRemove = [])).push(oldFile); + } + } + for (var _b = 0, newRootScriptInfos_1 = newRootScriptInfos; _b < newRootScriptInfos_1.length; _b++) { + var newFile = newRootScriptInfos_1[_b]; + if (!project.isRoot(newFile)) { + (toAdd || (toAdd = [])).push(newFile); + } + } + if (toRemove) { + for (var _c = 0, toRemove_1 = toRemove; _c < toRemove_1.length; _c++) { + var f = toRemove_1[_c]; + project.removeFile(f); + } + } + if (toAdd) { + for (var _d = 0, toAdd_1 = toAdd; _d < toAdd_1.length; _d++) { + var f = toAdd_1[_d]; + if (f.isScriptOpen() && isRootFileInInferredProject(f)) { + var inferredProject = f.containingProjects[0]; + inferredProject.removeFile(f); + if (!inferredProject.hasRoots()) { + this.removeProject(inferredProject); + } + } + project.addRoot(f); + } + } + } + project.setCompilerOptions(newOptions); + project.setTypeAcquisition(newTypeAcquisition); + if (compileOnSave !== undefined) { + project.compileOnSaveEnabled = compileOnSave; + } + project.setProjectErrors(ts.concatenate(configFileErrors, projectErrors)); + project.updateGraph(); + }; + ProjectService.prototype.updateConfiguredProject = function (project) { + if (!this.host.fileExists(project.getConfigFilePath())) { + this.logger.info("Config file deleted"); + this.removeProject(project); + return; + } + var _a = this.convertConfigFileContentToProjectOptions(project.getConfigFilePath()), success = _a.success, projectOptions = _a.projectOptions, configFileErrors = _a.configFileErrors; + if (!success) { + this.updateNonInferredProject(project, [], fileNamePropertyReader, {}, {}, false, configFileErrors); + return configFileErrors; + } + if (this.exceededTotalSizeLimitForNonTsFiles(project.canonicalConfigFilePath, projectOptions.compilerOptions, projectOptions.files, fileNamePropertyReader)) { + project.setCompilerOptions(projectOptions.compilerOptions); + if (!project.languageServiceEnabled) { + return configFileErrors; + } + project.disableLanguageService(); + project.stopWatchingDirectory(); + } + else { + project.enableLanguageService(); + this.watchConfigDirectoryForProject(project, projectOptions); + this.updateNonInferredProject(project, projectOptions.files, fileNamePropertyReader, projectOptions.compilerOptions, projectOptions.typeAcquisition, projectOptions.compileOnSave, configFileErrors); + } + return configFileErrors; + }; + ProjectService.prototype.createInferredProjectWithRootFileIfNecessary = function (root) { + var _this = this; + var useExistingProject = this.useSingleInferredProject && this.inferredProjects.length; + var project = useExistingProject + ? this.inferredProjects[0] + : new server.InferredProject(this, this.documentRegistry, this.compilerOptionsForInferredProjects); + project.addRoot(root); + this.directoryWatchers.startWatchingContainingDirectoriesForFile(root.fileName, project, function (fileName) { return _this.onConfigFileAddedForInferredProject(fileName); }); + project.updateGraph(); + if (!useExistingProject) { + this.inferredProjects.push(project); + } + return project; + }; + ProjectService.prototype.getOrCreateScriptInfo = function (uncheckedFileName, openedByClient, fileContent, scriptKind) { + return this.getOrCreateScriptInfoForNormalizedPath(server.toNormalizedPath(uncheckedFileName), openedByClient, fileContent, scriptKind); + }; + ProjectService.prototype.getScriptInfo = function (uncheckedFileName) { + return this.getScriptInfoForNormalizedPath(server.toNormalizedPath(uncheckedFileName)); + }; + ProjectService.prototype.getOrCreateScriptInfoForNormalizedPath = function (fileName, openedByClient, fileContent, scriptKind, hasMixedContent) { + var _this = this; + var info = this.getScriptInfoForNormalizedPath(fileName); + if (!info) { + if (openedByClient || this.host.fileExists(fileName)) { + info = new server.ScriptInfo(this.host, fileName, scriptKind, hasMixedContent); + this.filenameToScriptInfo.set(info.path, info); + if (openedByClient) { + if (fileContent === undefined) { + fileContent = this.host.readFile(fileName) || ""; + } + } + else { + if (!hasMixedContent) { + info.setWatcher(this.host.watchFile(fileName, function (_) { return _this.onSourceFileChanged(fileName); })); + } + } + } + } + if (info) { + if (openedByClient && !info.isScriptOpen()) { + info.open(fileContent); + if (hasMixedContent) { + info.registerFileUpdate(); + } + } + else if (fileContent !== undefined) { + info.reload(fileContent); + } + } + return info; + }; + ProjectService.prototype.getScriptInfoForNormalizedPath = function (fileName) { + return this.getScriptInfoForPath(server.normalizedPathToPath(fileName, this.host.getCurrentDirectory(), this.toCanonicalFileName)); + }; + ProjectService.prototype.getScriptInfoForPath = function (fileName) { + return this.filenameToScriptInfo.get(fileName); + }; + ProjectService.prototype.setHostConfiguration = function (args) { + if (args.file) { + var info = this.getScriptInfoForNormalizedPath(server.toNormalizedPath(args.file)); + if (info) { + info.setFormatOptions(convertFormatOptions(args.formatOptions)); + this.logger.info("Host configuration update for file " + args.file); + } + } + else { + if (args.hostInfo !== undefined) { + this.hostConfiguration.hostInfo = args.hostInfo; + this.logger.info("Host information " + args.hostInfo); + } + if (args.formatOptions) { + server.mergeMapLikes(this.hostConfiguration.formatCodeOptions, convertFormatOptions(args.formatOptions)); + this.logger.info("Format host information updated"); + } + if (args.extraFileExtensions) { + this.hostConfiguration.extraFileExtensions = args.extraFileExtensions; + this.logger.info("Host file extension mappings updated"); + } + } + }; + ProjectService.prototype.closeLog = function () { + this.logger.close(); + }; + ProjectService.prototype.reloadProjects = function () { + this.logger.info("reload projects."); + for (var _i = 0, _a = this.openFiles; _i < _a.length; _i++) { + var info = _a[_i]; + this.openOrUpdateConfiguredProjectForFile(info.fileName); + } + this.refreshInferredProjects(); + }; + ProjectService.prototype.refreshInferredProjects = function () { + this.logger.info("updating project structure from ..."); + this.printProjects(); + var orphantedFiles = []; + for (var _i = 0, _a = this.openFiles; _i < _a.length; _i++) { + var info = _a[_i]; + if (info.containingProjects.length === 0) { + orphantedFiles.push(info); + } + else { + if (isRootFileInInferredProject(info) && info.containingProjects.length > 1) { + var inferredProject = info.containingProjects[0]; + ts.Debug.assert(inferredProject.projectKind === server.ProjectKind.Inferred); + inferredProject.removeFile(info); + if (!inferredProject.hasRoots()) { + this.removeProject(inferredProject); + } + } + } + } + for (var _b = 0, orphantedFiles_1 = orphantedFiles; _b < orphantedFiles_1.length; _b++) { + var f = orphantedFiles_1[_b]; + this.assignScriptInfoToInferredProjectIfNecessary(f, false); + } + for (var _c = 0, _d = this.inferredProjects; _c < _d.length; _c++) { + var p = _d[_c]; + p.updateGraph(); + } + this.printProjects(); + }; + ProjectService.prototype.openClientFile = function (fileName, fileContent, scriptKind) { + return this.openClientFileWithNormalizedPath(server.toNormalizedPath(fileName), fileContent, scriptKind); + }; + ProjectService.prototype.openClientFileWithNormalizedPath = function (fileName, fileContent, scriptKind, hasMixedContent) { + var configFileName; + var configFileErrors; + var project = this.findContainingExternalProject(fileName); + if (!project) { + (_a = this.openOrUpdateConfiguredProjectForFile(fileName), configFileName = _a.configFileName, configFileErrors = _a.configFileErrors); + if (configFileName) { + project = this.findConfiguredProjectByProjectName(configFileName); + } + } + if (project && !project.languageServiceEnabled) { + project.markAsDirty(); + } + var info = this.getOrCreateScriptInfoForNormalizedPath(fileName, true, fileContent, scriptKind, hasMixedContent); + this.assignScriptInfoToInferredProjectIfNecessary(info, true); + this.printProjects(); + return { configFileName: configFileName, configFileErrors: configFileErrors }; + var _a; + }; + ProjectService.prototype.closeClientFile = function (uncheckedFileName) { + var info = this.getScriptInfoForNormalizedPath(server.toNormalizedPath(uncheckedFileName)); + if (info) { + this.closeOpenFile(info); + } + this.printProjects(); + }; + ProjectService.prototype.collectChanges = function (lastKnownProjectVersions, currentProjects, result) { + var _loop_7 = function (proj) { + var knownProject = ts.forEach(lastKnownProjectVersions, function (p) { return p.projectName === proj.getProjectName() && p; }); + result.push(proj.getChangesSinceVersion(knownProject && knownProject.version)); + }; + for (var _i = 0, currentProjects_1 = currentProjects; _i < currentProjects_1.length; _i++) { + var proj = currentProjects_1[_i]; + _loop_7(proj); + } + }; + ProjectService.prototype.synchronizeProjectList = function (knownProjects) { + var files = []; + this.collectChanges(knownProjects, this.externalProjects, files); + this.collectChanges(knownProjects, this.configuredProjects, files); + this.collectChanges(knownProjects, this.inferredProjects, files); + return files; + }; + ProjectService.prototype.applyChangesInOpenFiles = function (openFiles, changedFiles, closedFiles) { + var recordChangedFiles = changedFiles && !openFiles && !closedFiles; + if (openFiles) { + for (var _i = 0, openFiles_1 = openFiles; _i < openFiles_1.length; _i++) { + var file = openFiles_1[_i]; + var scriptInfo = this.getScriptInfo(file.fileName); + ts.Debug.assert(!scriptInfo || !scriptInfo.isScriptOpen()); + var normalizedPath = scriptInfo ? scriptInfo.fileName : server.toNormalizedPath(file.fileName); + this.openClientFileWithNormalizedPath(normalizedPath, file.content, tryConvertScriptKindName(file.scriptKind), file.hasMixedContent); + } + } + if (changedFiles) { + for (var _a = 0, changedFiles_2 = changedFiles; _a < changedFiles_2.length; _a++) { + var file = changedFiles_2[_a]; + var scriptInfo = this.getScriptInfo(file.fileName); + ts.Debug.assert(!!scriptInfo); + for (var i = file.changes.length - 1; i >= 0; i--) { + var change = file.changes[i]; + scriptInfo.editContent(change.span.start, change.span.start + change.span.length, change.newText); + } + if (recordChangedFiles) { + if (!this.changedFiles) { + this.changedFiles = [scriptInfo]; + } + else if (this.changedFiles.indexOf(scriptInfo) < 0) { + this.changedFiles.push(scriptInfo); + } + } + } + } + if (closedFiles) { + for (var _b = 0, closedFiles_1 = closedFiles; _b < closedFiles_1.length; _b++) { + var file = closedFiles_1[_b]; + this.closeClientFile(file); + } + } + if (openFiles || closedFiles) { + this.refreshInferredProjects(); + } + }; + ProjectService.prototype.closeConfiguredProject = function (configFile) { + var configuredProject = this.findConfiguredProjectByProjectName(configFile); + if (configuredProject && configuredProject.deleteOpenRef() === 0) { + this.removeProject(configuredProject); + } + }; + ProjectService.prototype.closeExternalProject = function (uncheckedFileName, suppressRefresh) { + if (suppressRefresh === void 0) { suppressRefresh = false; } + var fileName = server.toNormalizedPath(uncheckedFileName); + var configFiles = this.externalProjectToConfiguredProjectMap.get(fileName); + if (configFiles) { + var shouldRefreshInferredProjects = false; + for (var _i = 0, configFiles_1 = configFiles; _i < configFiles_1.length; _i++) { + var configFile = configFiles_1[_i]; + if (this.closeConfiguredProject(configFile)) { + shouldRefreshInferredProjects = true; + } + } + this.externalProjectToConfiguredProjectMap.delete(fileName); + if (shouldRefreshInferredProjects && !suppressRefresh) { + this.refreshInferredProjects(); + } + } + else { + var externalProject = this.findExternalProjectByProjectName(uncheckedFileName); + if (externalProject) { + this.removeProject(externalProject); + if (!suppressRefresh) { + this.refreshInferredProjects(); + } + } + } + }; + ProjectService.prototype.openExternalProjects = function (projects) { + var _this = this; + var projectsToClose = ts.arrayToMap(this.externalProjects, function (p) { return p.getProjectName(); }, function (_) { return true; }); + ts.forEachKey(this.externalProjectToConfiguredProjectMap, function (externalProjectName) { + projectsToClose.set(externalProjectName, true); + }); + for (var _i = 0, projects_5 = projects; _i < projects_5.length; _i++) { + var externalProject = projects_5[_i]; + this.openExternalProject(externalProject, true); + projectsToClose.delete(externalProject.projectFileName); + } + ts.forEachKey(projectsToClose, function (externalProjectName) { + _this.closeExternalProject(externalProjectName, true); + }); + this.refreshInferredProjects(); + }; + ProjectService.escapeFilenameForRegex = function (filename) { + return filename.replace(this.filenameEscapeRegexp, "\\$&"); + }; + ProjectService.prototype.resetSafeList = function () { + ProjectService.safelist = defaultTypeSafeList; + }; + ProjectService.prototype.loadSafeList = function (fileName) { + var raw = JSON.parse(this.host.readFile(fileName, "utf-8")); + for (var _i = 0, _a = Object.keys(raw); _i < _a.length; _i++) { + var k = _a[_i]; + raw[k].match = new RegExp(raw[k].match, "i"); + } + ProjectService.safelist = raw; + }; + ProjectService.prototype.applySafeList = function (proj) { + var _this = this; + var rootFiles = proj.rootFiles, typeAcquisition = proj.typeAcquisition; + var types = (typeAcquisition && typeAcquisition.include) || []; + var excludeRules = []; + var normalizedNames = rootFiles.map(function (f) { return ts.normalizeSlashes(f.fileName); }); + var _loop_8 = function (name) { + var rule = ProjectService.safelist[name]; + for (var _i = 0, normalizedNames_1 = normalizedNames; _i < normalizedNames_1.length; _i++) { + var root = normalizedNames_1[_i]; + if (rule.match.test(root)) { + this_2.logger.info("Excluding files based on rule " + name); + if (rule.types) { + for (var _a = 0, _b = rule.types; _a < _b.length; _a++) { + var type = _b[_a]; + if (types.indexOf(type) < 0) { + types.push(type); + } + } + } + if (rule.exclude) { + var _loop_9 = function (exclude) { + var processedRule = root.replace(rule.match, function () { + var groups = []; + for (var _i = 0; _i < arguments.length; _i++) { + groups[_i] = arguments[_i]; + } + return exclude.map(function (groupNumberOrString) { + if (typeof groupNumberOrString === "number") { + if (typeof groups[groupNumberOrString] !== "string") { + _this.logger.info("Incorrect RegExp specification in safelist rule " + name + " - not enough groups"); + return "\\*"; + } + return ProjectService.escapeFilenameForRegex(groups[groupNumberOrString]); + } + return groupNumberOrString; + }).join(""); + }); + if (excludeRules.indexOf(processedRule) === -1) { + excludeRules.push(processedRule); + } + }; + for (var _c = 0, _d = rule.exclude; _c < _d.length; _c++) { + var exclude = _d[_c]; + _loop_9(exclude); + } + } + else { + var escaped = ProjectService.escapeFilenameForRegex(root); + if (excludeRules.indexOf(escaped) < 0) { + excludeRules.push(escaped); + } + } + } + } + if (types.length > 0) { + proj.typeAcquisition = proj.typeAcquisition || {}; + proj.typeAcquisition.include = types; + } + }; + var this_2 = this; + for (var _i = 0, _a = Object.keys(ProjectService.safelist); _i < _a.length; _i++) { + var name = _a[_i]; + _loop_8(name); + } + var excludeRegexes = excludeRules.map(function (e) { return new RegExp(e, "i"); }); + proj.rootFiles = proj.rootFiles.filter(function (_file, index) { return !excludeRegexes.some(function (re) { return re.test(normalizedNames[index]); }); }); + }; + ProjectService.prototype.openExternalProject = function (proj, suppressRefreshOfInferredProjects) { + if (suppressRefreshOfInferredProjects === void 0) { suppressRefreshOfInferredProjects = false; } + if (proj.typingOptions && !proj.typeAcquisition) { + var typeAcquisition = ts.convertEnableAutoDiscoveryToEnable(proj.typingOptions); + proj.typeAcquisition = typeAcquisition; + } + this.applySafeList(proj); + var tsConfigFiles; + var rootFiles = []; + for (var _i = 0, _a = proj.rootFiles; _i < _a.length; _i++) { + var file = _a[_i]; + var normalized = server.toNormalizedPath(file.fileName); + if (ts.getBaseFileName(normalized) === "tsconfig.json") { + if (this.host.fileExists(normalized)) { + (tsConfigFiles || (tsConfigFiles = [])).push(normalized); + } + } + else { + rootFiles.push(file); + } + } + if (tsConfigFiles) { + tsConfigFiles.sort(); + } + var externalProject = this.findExternalProjectByProjectName(proj.projectFileName); + var exisingConfigFiles; + if (externalProject) { + if (!tsConfigFiles) { + var compilerOptions = convertCompilerOptions(proj.options); + if (this.exceededTotalSizeLimitForNonTsFiles(proj.projectFileName, compilerOptions, proj.rootFiles, externalFilePropertyReader)) { + externalProject.disableLanguageService(); + } + else { + externalProject.enableLanguageService(); + } + this.updateNonInferredProject(externalProject, proj.rootFiles, externalFilePropertyReader, compilerOptions, proj.typeAcquisition, proj.options.compileOnSave, undefined); + return; + } + this.closeExternalProject(proj.projectFileName, true); + } + else if (this.externalProjectToConfiguredProjectMap.get(proj.projectFileName)) { + if (!tsConfigFiles) { + this.closeExternalProject(proj.projectFileName, true); + } + else { + var oldConfigFiles = this.externalProjectToConfiguredProjectMap.get(proj.projectFileName); + var iNew = 0; + var iOld = 0; + while (iNew < tsConfigFiles.length && iOld < oldConfigFiles.length) { + var newConfig = tsConfigFiles[iNew]; + var oldConfig = oldConfigFiles[iOld]; + if (oldConfig < newConfig) { + this.closeConfiguredProject(oldConfig); + iOld++; + } + else if (oldConfig > newConfig) { + iNew++; + } + else { + (exisingConfigFiles || (exisingConfigFiles = [])).push(oldConfig); + iOld++; + iNew++; + } + } + for (var i = iOld; i < oldConfigFiles.length; i++) { + this.closeConfiguredProject(oldConfigFiles[i]); + } + } + } + if (tsConfigFiles) { + this.externalProjectToConfiguredProjectMap.set(proj.projectFileName, tsConfigFiles); + for (var _b = 0, tsConfigFiles_1 = tsConfigFiles; _b < tsConfigFiles_1.length; _b++) { + var tsconfigFile = tsConfigFiles_1[_b]; + var project = this.findConfiguredProjectByProjectName(tsconfigFile); + if (!project) { + var result = this.openConfigFile(tsconfigFile); + project = result.success && result.project; + } + if (project && !ts.contains(exisingConfigFiles, tsconfigFile)) { + project.addOpenRef(); + } + } + } + else { + this.externalProjectToConfiguredProjectMap.delete(proj.projectFileName); + this.createAndAddExternalProject(proj.projectFileName, rootFiles, proj.options, proj.typeAcquisition); + } + if (!suppressRefreshOfInferredProjects) { + this.refreshInferredProjects(); + } + }; + return ProjectService; + }()); + ProjectService.safelist = defaultTypeSafeList; + ProjectService.filenameEscapeRegexp = /[-\/\\^$*+?.()|[\]{}]/g; + server.ProjectService = ProjectService; + })(server = ts.server || (ts.server = {})); +})(ts || (ts = {})); var debugObjectHost = (function () { return this; })(); var ts; (function (ts) { @@ -69503,7 +77794,7 @@ var ts; ScriptSnapshotShimAdapter.prototype.getChangeRange = function (oldSnapshot) { var oldSnapshotShim = oldSnapshot; var encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim); - if (encoded == null) { + if (encoded === null) { return null; } var decoded = JSON.parse(encoded); @@ -69571,10 +77862,12 @@ var ts; }; LanguageServiceShimHostAdapter.prototype.getCompilationSettings = function () { var settingsJson = this.shimHost.getCompilationSettings(); - if (settingsJson == null || settingsJson == "") { + if (settingsJson === null || settingsJson === "") { throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings"); } - return JSON.parse(settingsJson); + var compilerOptions = JSON.parse(settingsJson); + compilerOptions.allowNonTsExtensions = true; + return compilerOptions; }; LanguageServiceShimHostAdapter.prototype.getScriptFileNames = function () { var encoded = this.shimHost.getScriptFileNames(); @@ -69597,7 +77890,7 @@ var ts; }; LanguageServiceShimHostAdapter.prototype.getLocalizedDiagnosticMessages = function () { var diagnosticMessagesJson = this.shimHost.getLocalizedDiagnosticMessages(); - if (diagnosticMessagesJson == null || diagnosticMessagesJson == "") { + if (diagnosticMessagesJson === null || diagnosticMessagesJson === "") { return null; } try { @@ -69610,7 +77903,7 @@ var ts; }; LanguageServiceShimHostAdapter.prototype.getCancellationToken = function () { var hostCancellationToken = this.shimHost.getCancellationToken(); - return new ThrottledCancellationToken(hostCancellationToken); + return new ts.ThrottledCancellationToken(hostCancellationToken); }; LanguageServiceShimHostAdapter.prototype.getCurrentDirectory = function () { return this.shimHost.getCurrentDirectory(); @@ -69634,22 +77927,6 @@ var ts; return LanguageServiceShimHostAdapter; }()); ts.LanguageServiceShimHostAdapter = LanguageServiceShimHostAdapter; - var ThrottledCancellationToken = (function () { - function ThrottledCancellationToken(hostCancellationToken) { - this.hostCancellationToken = hostCancellationToken; - this.lastCancellationCheckTime = 0; - } - ThrottledCancellationToken.prototype.isCancellationRequested = function () { - var time = ts.timestamp(); - var duration = Math.abs(time - this.lastCancellationCheckTime); - if (duration > 10) { - this.lastCancellationCheckTime = time; - return this.hostCancellationToken.isCancellationRequested(); - } - return false; - }; - return ThrottledCancellationToken; - }()); var CoreServicesShimHostAdapter = (function () { function CoreServicesShimHostAdapter(shimHost) { var _this = this; @@ -70012,12 +78289,6 @@ var ts; var compilerOptions = JSON.parse(compilerOptionsJson); var result = ts.resolveModuleName(moduleName, ts.normalizeSlashes(fileName), compilerOptions, _this.host); var resolvedFileName = result.resolvedModule ? result.resolvedModule.resolvedFileName : undefined; - if (resolvedFileName && !compilerOptions.allowJs && ts.fileExtensionIs(resolvedFileName, ".js")) { - return { - resolvedFileName: undefined, - failedLookupLocations: [] - }; - } return { resolvedFileName: resolvedFileName, failedLookupLocations: result.failedLookupLocations @@ -70157,7 +78428,7 @@ var ts; this._shims.push(shim); }; TypeScriptServicesFactory.prototype.unregisterShim = function (shim) { - for (var i = 0, n = this._shims.length; i < n; i++) { + for (var i = 0; i < this._shims.length; i++) { if (this._shims[i] === shim) { delete this._shims[i]; return; @@ -70179,4 +78450,4 @@ var TypeScript; Services.TypeScriptServicesFactory = ts.TypeScriptServicesFactory; })(Services = TypeScript.Services || (TypeScript.Services = {})); })(TypeScript || (TypeScript = {})); -var toolsVersion = "2.2"; +var toolsVersion = "2.3"; diff --git a/node_modules/typescript/lib/typescript.d.ts b/node_modules/typescript/lib/typescript.d.ts index cec498e41..7e6fac11b 100644 --- a/node_modules/typescript/lib/typescript.d.ts +++ b/node_modules/typescript/lib/typescript.d.ts @@ -14,11 +14,36 @@ and limitations under the License. ***************************************************************************** */ declare namespace ts { + /** + * Type of objects whose values are all of the same type. + * The `in` and `for-in` operators can *not* be safely used, + * since `Object.prototype` may be modified by outside code. + */ interface MapLike { [index: string]: T; } - interface Map extends MapLike { - __mapBrand: any; + /** ES6 Map interface. */ + interface Map { + get(key: string): T; + has(key: string): boolean; + set(key: string, value: T): this; + delete(key: string): boolean; + clear(): void; + forEach(action: (value: T, key: string) => void): void; + readonly size: number; + keys(): Iterator; + values(): Iterator; + entries(): Iterator<[string, T]>; + } + /** ES6 Iterator type. */ + interface Iterator { + next(): { + value: T; + done: false; + } | { + value: never; + done: true; + }; } type Path = string & { __pathBrand: any; @@ -170,171 +195,171 @@ declare namespace ts { ReadonlyKeyword = 130, RequireKeyword = 131, NumberKeyword = 132, - SetKeyword = 133, - StringKeyword = 134, - SymbolKeyword = 135, - TypeKeyword = 136, - UndefinedKeyword = 137, - FromKeyword = 138, - GlobalKeyword = 139, - OfKeyword = 140, - QualifiedName = 141, - ComputedPropertyName = 142, - TypeParameter = 143, - Parameter = 144, - Decorator = 145, - PropertySignature = 146, - PropertyDeclaration = 147, - MethodSignature = 148, - MethodDeclaration = 149, - Constructor = 150, - GetAccessor = 151, - SetAccessor = 152, - CallSignature = 153, - ConstructSignature = 154, - IndexSignature = 155, - TypePredicate = 156, - TypeReference = 157, - FunctionType = 158, - ConstructorType = 159, - TypeQuery = 160, - TypeLiteral = 161, - ArrayType = 162, - TupleType = 163, - UnionType = 164, - IntersectionType = 165, - ParenthesizedType = 166, - ThisType = 167, - TypeOperator = 168, - IndexedAccessType = 169, - MappedType = 170, - LiteralType = 171, - ObjectBindingPattern = 172, - ArrayBindingPattern = 173, - BindingElement = 174, - ArrayLiteralExpression = 175, - ObjectLiteralExpression = 176, - PropertyAccessExpression = 177, - ElementAccessExpression = 178, - CallExpression = 179, - NewExpression = 180, - TaggedTemplateExpression = 181, - TypeAssertionExpression = 182, - ParenthesizedExpression = 183, - FunctionExpression = 184, - ArrowFunction = 185, - DeleteExpression = 186, - TypeOfExpression = 187, - VoidExpression = 188, - AwaitExpression = 189, - PrefixUnaryExpression = 190, - PostfixUnaryExpression = 191, - BinaryExpression = 192, - ConditionalExpression = 193, - TemplateExpression = 194, - YieldExpression = 195, - SpreadElement = 196, - ClassExpression = 197, - OmittedExpression = 198, - ExpressionWithTypeArguments = 199, - AsExpression = 200, - NonNullExpression = 201, - TemplateSpan = 202, - SemicolonClassElement = 203, - Block = 204, - VariableStatement = 205, - EmptyStatement = 206, - ExpressionStatement = 207, - IfStatement = 208, - DoStatement = 209, - WhileStatement = 210, - ForStatement = 211, - ForInStatement = 212, - ForOfStatement = 213, - ContinueStatement = 214, - BreakStatement = 215, - ReturnStatement = 216, - WithStatement = 217, - SwitchStatement = 218, - LabeledStatement = 219, - ThrowStatement = 220, - TryStatement = 221, - DebuggerStatement = 222, - VariableDeclaration = 223, - VariableDeclarationList = 224, - FunctionDeclaration = 225, - ClassDeclaration = 226, - InterfaceDeclaration = 227, - TypeAliasDeclaration = 228, - EnumDeclaration = 229, - ModuleDeclaration = 230, - ModuleBlock = 231, - CaseBlock = 232, - NamespaceExportDeclaration = 233, - ImportEqualsDeclaration = 234, - ImportDeclaration = 235, - ImportClause = 236, - NamespaceImport = 237, - NamedImports = 238, - ImportSpecifier = 239, - ExportAssignment = 240, - ExportDeclaration = 241, - NamedExports = 242, - ExportSpecifier = 243, - MissingDeclaration = 244, - ExternalModuleReference = 245, - JsxElement = 246, - JsxSelfClosingElement = 247, - JsxOpeningElement = 248, - JsxClosingElement = 249, - JsxAttribute = 250, - JsxSpreadAttribute = 251, - JsxExpression = 252, - CaseClause = 253, - DefaultClause = 254, - HeritageClause = 255, - CatchClause = 256, - PropertyAssignment = 257, - ShorthandPropertyAssignment = 258, - SpreadAssignment = 259, - EnumMember = 260, - SourceFile = 261, - JSDocTypeExpression = 262, - JSDocAllType = 263, - JSDocUnknownType = 264, - JSDocArrayType = 265, - JSDocUnionType = 266, - JSDocTupleType = 267, - JSDocNullableType = 268, - JSDocNonNullableType = 269, - JSDocRecordType = 270, - JSDocRecordMember = 271, - JSDocTypeReference = 272, - JSDocOptionalType = 273, - JSDocFunctionType = 274, - JSDocVariadicType = 275, - JSDocConstructorType = 276, - JSDocThisType = 277, - JSDocComment = 278, - JSDocTag = 279, - JSDocAugmentsTag = 280, - JSDocParameterTag = 281, - JSDocReturnTag = 282, - JSDocTypeTag = 283, - JSDocTemplateTag = 284, - JSDocTypedefTag = 285, - JSDocPropertyTag = 286, - JSDocTypeLiteral = 287, - JSDocLiteralType = 288, - JSDocNullKeyword = 289, - JSDocUndefinedKeyword = 290, - JSDocNeverKeyword = 291, - SyntaxList = 292, - NotEmittedStatement = 293, - PartiallyEmittedExpression = 294, - MergeDeclarationMarker = 295, - EndOfDeclarationMarker = 296, - RawExpression = 297, + ObjectKeyword = 133, + SetKeyword = 134, + StringKeyword = 135, + SymbolKeyword = 136, + TypeKeyword = 137, + UndefinedKeyword = 138, + FromKeyword = 139, + GlobalKeyword = 140, + OfKeyword = 141, + QualifiedName = 142, + ComputedPropertyName = 143, + TypeParameter = 144, + Parameter = 145, + Decorator = 146, + PropertySignature = 147, + PropertyDeclaration = 148, + MethodSignature = 149, + MethodDeclaration = 150, + Constructor = 151, + GetAccessor = 152, + SetAccessor = 153, + CallSignature = 154, + ConstructSignature = 155, + IndexSignature = 156, + TypePredicate = 157, + TypeReference = 158, + FunctionType = 159, + ConstructorType = 160, + TypeQuery = 161, + TypeLiteral = 162, + ArrayType = 163, + TupleType = 164, + UnionType = 165, + IntersectionType = 166, + ParenthesizedType = 167, + ThisType = 168, + TypeOperator = 169, + IndexedAccessType = 170, + MappedType = 171, + LiteralType = 172, + ObjectBindingPattern = 173, + ArrayBindingPattern = 174, + BindingElement = 175, + ArrayLiteralExpression = 176, + ObjectLiteralExpression = 177, + PropertyAccessExpression = 178, + ElementAccessExpression = 179, + CallExpression = 180, + NewExpression = 181, + TaggedTemplateExpression = 182, + TypeAssertionExpression = 183, + ParenthesizedExpression = 184, + FunctionExpression = 185, + ArrowFunction = 186, + DeleteExpression = 187, + TypeOfExpression = 188, + VoidExpression = 189, + AwaitExpression = 190, + PrefixUnaryExpression = 191, + PostfixUnaryExpression = 192, + BinaryExpression = 193, + ConditionalExpression = 194, + TemplateExpression = 195, + YieldExpression = 196, + SpreadElement = 197, + ClassExpression = 198, + OmittedExpression = 199, + ExpressionWithTypeArguments = 200, + AsExpression = 201, + NonNullExpression = 202, + MetaProperty = 203, + TemplateSpan = 204, + SemicolonClassElement = 205, + Block = 206, + VariableStatement = 207, + EmptyStatement = 208, + ExpressionStatement = 209, + IfStatement = 210, + DoStatement = 211, + WhileStatement = 212, + ForStatement = 213, + ForInStatement = 214, + ForOfStatement = 215, + ContinueStatement = 216, + BreakStatement = 217, + ReturnStatement = 218, + WithStatement = 219, + SwitchStatement = 220, + LabeledStatement = 221, + ThrowStatement = 222, + TryStatement = 223, + DebuggerStatement = 224, + VariableDeclaration = 225, + VariableDeclarationList = 226, + FunctionDeclaration = 227, + ClassDeclaration = 228, + InterfaceDeclaration = 229, + TypeAliasDeclaration = 230, + EnumDeclaration = 231, + ModuleDeclaration = 232, + ModuleBlock = 233, + CaseBlock = 234, + NamespaceExportDeclaration = 235, + ImportEqualsDeclaration = 236, + ImportDeclaration = 237, + ImportClause = 238, + NamespaceImport = 239, + NamedImports = 240, + ImportSpecifier = 241, + ExportAssignment = 242, + ExportDeclaration = 243, + NamedExports = 244, + ExportSpecifier = 245, + MissingDeclaration = 246, + ExternalModuleReference = 247, + JsxElement = 248, + JsxSelfClosingElement = 249, + JsxOpeningElement = 250, + JsxClosingElement = 251, + JsxAttribute = 252, + JsxAttributes = 253, + JsxSpreadAttribute = 254, + JsxExpression = 255, + CaseClause = 256, + DefaultClause = 257, + HeritageClause = 258, + CatchClause = 259, + PropertyAssignment = 260, + ShorthandPropertyAssignment = 261, + SpreadAssignment = 262, + EnumMember = 263, + SourceFile = 264, + Bundle = 265, + JSDocTypeExpression = 266, + JSDocAllType = 267, + JSDocUnknownType = 268, + JSDocArrayType = 269, + JSDocUnionType = 270, + JSDocTupleType = 271, + JSDocNullableType = 272, + JSDocNonNullableType = 273, + JSDocRecordType = 274, + JSDocRecordMember = 275, + JSDocTypeReference = 276, + JSDocOptionalType = 277, + JSDocFunctionType = 278, + JSDocVariadicType = 279, + JSDocConstructorType = 280, + JSDocThisType = 281, + JSDocComment = 282, + JSDocTag = 283, + JSDocAugmentsTag = 284, + JSDocParameterTag = 285, + JSDocReturnTag = 286, + JSDocTypeTag = 287, + JSDocTemplateTag = 288, + JSDocTypedefTag = 289, + JSDocPropertyTag = 290, + JSDocTypeLiteral = 291, + JSDocLiteralType = 292, + SyntaxList = 293, + NotEmittedStatement = 294, + PartiallyEmittedExpression = 295, + MergeDeclarationMarker = 296, + EndOfDeclarationMarker = 297, Count = 298, FirstAssignment = 57, LastAssignment = 69, @@ -343,15 +368,15 @@ declare namespace ts { FirstReservedWord = 71, LastReservedWord = 106, FirstKeyword = 71, - LastKeyword = 140, + LastKeyword = 141, FirstFutureReservedWord = 107, LastFutureReservedWord = 115, - FirstTypeNode = 156, - LastTypeNode = 171, + FirstTypeNode = 157, + LastTypeNode = 172, FirstPunctuation = 16, LastPunctuation = 69, FirstToken = 0, - LastToken = 140, + LastToken = 141, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -360,11 +385,11 @@ declare namespace ts { LastTemplateToken = 15, FirstBinaryOperator = 26, LastBinaryOperator = 69, - FirstNode = 141, - FirstJSDocNode = 262, - LastJSDocNode = 288, - FirstJSDocTagNode = 278, - LastJSDocTagNode = 291, + FirstNode = 142, + FirstJSDocNode = 266, + LastJSDocNode = 292, + FirstJSDocTagNode = 282, + LastJSDocTagNode = 292, } enum NodeFlags { None = 0, @@ -378,26 +403,20 @@ declare namespace ts { HasImplicitReturn = 128, HasExplicitReturn = 256, GlobalAugmentation = 512, - HasClassExtends = 1024, - HasDecorators = 2048, - HasParamDecorators = 4096, - HasAsyncFunctions = 8192, - HasSpreadAttribute = 16384, - HasRestAttribute = 32768, - DisallowInContext = 65536, - YieldContext = 131072, - DecoratorContext = 262144, - AwaitContext = 524288, - ThisNodeHasError = 1048576, - JavaScriptFile = 2097152, - ThisNodeOrAnySubNodesHasError = 4194304, - HasAggregatedChildData = 8388608, + HasAsyncFunctions = 1024, + DisallowInContext = 2048, + YieldContext = 4096, + DecoratorContext = 8192, + AwaitContext = 16384, + ThisNodeHasError = 32768, + JavaScriptFile = 65536, + ThisNodeOrAnySubNodesHasError = 131072, + HasAggregatedChildData = 262144, BlockScoped = 3, ReachabilityCheckFlags = 384, - EmitHelperFlags = 64512, - ReachabilityAndEmitFlags = 64896, - ContextFlags = 3080192, - TypeExcludesFlags = 655360, + ReachabilityAndEmitFlags = 1408, + ContextFlags = 96256, + TypeExcludesFlags = 20480, } enum ModifierFlags { None = 0, @@ -449,6 +468,7 @@ declare namespace ts { type EndOfFileToken = Token; type AtToken = Token; type ReadonlyToken = Token; + type AwaitKeywordToken = Token; type Modifier = Token | Token | Token | Token | Token | Token | Token | Token | Token | Token | Token; type ModifiersArray = NodeArray; interface Identifier extends PrimaryExpression { @@ -485,8 +505,10 @@ declare namespace ts { } interface TypeParameterDeclaration extends Declaration { kind: SyntaxKind.TypeParameter; + parent?: DeclarationWithTypeParameters; name: Identifier; constraint?: TypeNode; + default?: TypeNode; expression?: Expression; } interface SignatureDeclaration extends Declaration { @@ -504,17 +526,19 @@ declare namespace ts { type BindingName = Identifier | BindingPattern; interface VariableDeclaration extends Declaration { kind: SyntaxKind.VariableDeclaration; - parent?: VariableDeclarationList; + parent?: VariableDeclarationList | CatchClause; name: BindingName; type?: TypeNode; initializer?: Expression; } interface VariableDeclarationList extends Node { kind: SyntaxKind.VariableDeclarationList; + parent?: VariableStatement | ForStatement | ForOfStatement | ForInStatement; declarations: NodeArray; } interface ParameterDeclaration extends Declaration { kind: SyntaxKind.Parameter; + parent?: SignatureDeclaration; dotDotDotToken?: DotDotDotToken; name: BindingName; questionToken?: QuestionToken; @@ -523,6 +547,7 @@ declare namespace ts { } interface BindingElement extends Declaration { kind: SyntaxKind.BindingElement; + parent?: BindingPattern; propertyName?: PropertyName; dotDotDotToken?: DotDotDotToken; name: BindingName; @@ -546,7 +571,7 @@ declare namespace ts { _objectLiteralBrandBrand: any; name?: PropertyName; } - type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | MethodDeclaration | AccessorDeclaration | SpreadAssignment; + type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | MethodDeclaration | AccessorDeclaration; interface PropertyAssignment extends ObjectLiteralElement { kind: SyntaxKind.PropertyAssignment; name: PropertyName; @@ -577,10 +602,12 @@ declare namespace ts { } interface ObjectBindingPattern extends Node { kind: SyntaxKind.ObjectBindingPattern; + parent?: VariableDeclaration | ParameterDeclaration | BindingElement; elements: NodeArray; } interface ArrayBindingPattern extends Node { kind: SyntaxKind.ArrayBindingPattern; + parent?: VariableDeclaration | ParameterDeclaration | BindingElement; elements: NodeArray; } type BindingPattern = ObjectBindingPattern | ArrayBindingPattern; @@ -615,41 +642,45 @@ declare namespace ts { } interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { kind: SyntaxKind.Constructor; + parent?: ClassDeclaration | ClassExpression; body?: FunctionBody; } + /** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */ interface SemicolonClassElement extends ClassElement { kind: SyntaxKind.SemicolonClassElement; + parent?: ClassDeclaration | ClassExpression; } interface GetAccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { kind: SyntaxKind.GetAccessor; + parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression; name: PropertyName; body: FunctionBody; } interface SetAccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { kind: SyntaxKind.SetAccessor; + parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression; name: PropertyName; body: FunctionBody; } type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration; interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement, TypeElement { kind: SyntaxKind.IndexSignature; + parent?: ClassDeclaration | ClassExpression | InterfaceDeclaration | TypeLiteralNode; } interface TypeNode extends Node { _typeNodeBrand: any; } interface KeywordTypeNode extends TypeNode { - kind: SyntaxKind.AnyKeyword | SyntaxKind.NumberKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.VoidKeyword; + kind: SyntaxKind.AnyKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.VoidKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.NullKeyword | SyntaxKind.NeverKeyword; } interface ThisTypeNode extends TypeNode { kind: SyntaxKind.ThisType; } - interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { - kind: SyntaxKind.FunctionType | SyntaxKind.ConstructorType; - } - interface FunctionTypeNode extends FunctionOrConstructorTypeNode { + type FunctionOrConstructorTypeNode = FunctionTypeNode | ConstructorTypeNode; + interface FunctionTypeNode extends TypeNode, SignatureDeclaration { kind: SyntaxKind.FunctionType; } - interface ConstructorTypeNode extends FunctionOrConstructorTypeNode { + interface ConstructorTypeNode extends TypeNode, SignatureDeclaration { kind: SyntaxKind.ConstructorType; } interface TypeReferenceNode extends TypeNode { @@ -678,15 +709,14 @@ declare namespace ts { kind: SyntaxKind.TupleType; elementTypes: NodeArray; } - interface UnionOrIntersectionTypeNode extends TypeNode { - kind: SyntaxKind.UnionType | SyntaxKind.IntersectionType; + type UnionOrIntersectionTypeNode = UnionTypeNode | IntersectionTypeNode; + interface UnionTypeNode extends TypeNode { + kind: SyntaxKind.UnionType; types: NodeArray; } - interface UnionTypeNode extends UnionOrIntersectionTypeNode { - kind: SyntaxKind.UnionType; - } - interface IntersectionTypeNode extends UnionOrIntersectionTypeNode { + interface IntersectionTypeNode extends TypeNode { kind: SyntaxKind.IntersectionType; + types: NodeArray; } interface ParenthesizedTypeNode extends TypeNode { kind: SyntaxKind.ParenthesizedType; @@ -704,6 +734,7 @@ declare namespace ts { } interface MappedTypeNode extends TypeNode, Declaration { kind: SyntaxKind.MappedType; + parent?: TypeAliasDeclaration; readonlyToken?: ReadonlyToken; typeParameter: TypeParameterDeclaration; questionToken?: QuestionToken; @@ -718,11 +749,14 @@ declare namespace ts { } interface Expression extends Node { _expressionBrand: any; - contextualType?: Type; } interface OmittedExpression extends Expression { kind: SyntaxKind.OmittedExpression; } + interface PartiallyEmittedExpression extends LeftHandSideExpression { + kind: SyntaxKind.PartiallyEmittedExpression; + expression: Expression; + } interface UnaryExpression extends Expression { _unaryExpressionBrand: any; } @@ -750,13 +784,13 @@ declare namespace ts { interface PrimaryExpression extends MemberExpression { _primaryExpressionBrand: any; } - interface NullLiteral extends PrimaryExpression { + interface NullLiteral extends PrimaryExpression, TypeNode { kind: SyntaxKind.NullKeyword; } - interface BooleanLiteral extends PrimaryExpression { + interface BooleanLiteral extends PrimaryExpression, TypeNode { kind: SyntaxKind.TrueKeyword | SyntaxKind.FalseKeyword; } - interface ThisExpression extends PrimaryExpression { + interface ThisExpression extends PrimaryExpression, KeywordTypeNode { kind: SyntaxKind.ThisKeyword; } interface SuperExpression extends PrimaryExpression { @@ -864,16 +898,18 @@ declare namespace ts { } interface NumericLiteral extends LiteralExpression { kind: SyntaxKind.NumericLiteral; - trailingComment?: string; } interface TemplateHead extends LiteralLikeNode { kind: SyntaxKind.TemplateHead; + parent?: TemplateExpression; } interface TemplateMiddle extends LiteralLikeNode { kind: SyntaxKind.TemplateMiddle; + parent?: TemplateSpan; } interface TemplateTail extends LiteralLikeNode { kind: SyntaxKind.TemplateTail; + parent?: TemplateSpan; } type TemplateLiteral = TemplateExpression | NoSubstitutionTemplateLiteral; interface TemplateExpression extends PrimaryExpression { @@ -883,6 +919,7 @@ declare namespace ts { } interface TemplateSpan extends Node { kind: SyntaxKind.TemplateSpan; + parent?: TemplateExpression; expression: Expression; literal: TemplateMiddle | TemplateTail; } @@ -899,18 +936,18 @@ declare namespace ts { expression: Expression; } /** - * This interface is a base interface for ObjectLiteralExpression and JSXAttributes to extend from. JSXAttributes is similar to - * ObjectLiteralExpression in that it contains array of properties; however, JSXAttributes' properties can only be - * JSXAttribute or JSXSpreadAttribute. ObjectLiteralExpression, on the other hand, can only have properties of type - * ObjectLiteralElement (e.g. PropertyAssignment, ShorthandPropertyAssignment etc.) - **/ + * This interface is a base interface for ObjectLiteralExpression and JSXAttributes to extend from. JSXAttributes is similar to + * ObjectLiteralExpression in that it contains array of properties; however, JSXAttributes' properties can only be + * JSXAttribute or JSXSpreadAttribute. ObjectLiteralExpression, on the other hand, can only have properties of type + * ObjectLiteralElement (e.g. PropertyAssignment, ShorthandPropertyAssignment etc.) + */ interface ObjectLiteralExpressionBase extends PrimaryExpression, Declaration { properties: NodeArray; } interface ObjectLiteralExpression extends ObjectLiteralExpressionBase { kind: SyntaxKind.ObjectLiteralExpression; } - type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression; + type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression | ParenthesizedExpression; type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression; interface PropertyAccessExpression extends MemberExpression, Declaration { kind: SyntaxKind.PropertyAccessExpression; @@ -945,6 +982,7 @@ declare namespace ts { } interface ExpressionWithTypeArguments extends TypeNode { kind: SyntaxKind.ExpressionWithTypeArguments; + parent?: HeritageClause; expression: LeftHandSideExpression; typeArguments?: NodeArray; } @@ -952,14 +990,14 @@ declare namespace ts { kind: SyntaxKind.NewExpression; expression: LeftHandSideExpression; typeArguments?: NodeArray; - arguments: NodeArray; + arguments?: NodeArray; } interface TaggedTemplateExpression extends MemberExpression { kind: SyntaxKind.TaggedTemplateExpression; tag: LeftHandSideExpression; template: TemplateLiteral; } - type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression | Decorator; + type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression | Decorator | JsxOpeningLikeElement; interface AsExpression extends Expression { kind: SyntaxKind.AsExpression; expression: Expression; @@ -975,49 +1013,67 @@ declare namespace ts { kind: SyntaxKind.NonNullExpression; expression: Expression; } + interface MetaProperty extends PrimaryExpression { + kind: SyntaxKind.MetaProperty; + keywordToken: SyntaxKind; + name: Identifier; + } interface JsxElement extends PrimaryExpression { kind: SyntaxKind.JsxElement; openingElement: JsxOpeningElement; children: NodeArray; closingElement: JsxClosingElement; } + type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement; + type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute; type JsxTagNameExpression = PrimaryExpression | PropertyAccessExpression; + interface JsxAttributes extends ObjectLiteralExpressionBase { + parent?: JsxOpeningLikeElement; + } interface JsxOpeningElement extends Expression { kind: SyntaxKind.JsxOpeningElement; + parent?: JsxElement; tagName: JsxTagNameExpression; - attributes: NodeArray; + attributes: JsxAttributes; } interface JsxSelfClosingElement extends PrimaryExpression { kind: SyntaxKind.JsxSelfClosingElement; tagName: JsxTagNameExpression; - attributes: NodeArray; + attributes: JsxAttributes; } - type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement; - type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute; - interface JsxAttribute extends Node { + interface JsxAttribute extends ObjectLiteralElement { kind: SyntaxKind.JsxAttribute; + parent?: JsxAttributes; name: Identifier; initializer?: StringLiteral | JsxExpression; } - interface JsxSpreadAttribute extends Node { + interface JsxSpreadAttribute extends ObjectLiteralElement { kind: SyntaxKind.JsxSpreadAttribute; + parent?: JsxAttributes; expression: Expression; } interface JsxClosingElement extends Node { kind: SyntaxKind.JsxClosingElement; + parent?: JsxElement; tagName: JsxTagNameExpression; } interface JsxExpression extends Expression { kind: SyntaxKind.JsxExpression; + parent?: JsxElement | JsxAttributeLike; + dotDotDotToken?: Token; expression?: Expression; } interface JsxText extends Node { kind: SyntaxKind.JsxText; + parent?: JsxElement; } type JsxChild = JsxText | JsxExpression | JsxElement | JsxSelfClosingElement; interface Statement extends Node { _statementBrand: any; } + interface NotEmittedStatement extends Statement { + kind: SyntaxKind.NotEmittedStatement; + } interface EmptyStatement extends Statement { kind: SyntaxKind.EmptyStatement; } @@ -1028,7 +1084,7 @@ declare namespace ts { kind: SyntaxKind.MissingDeclaration; name?: Identifier; } - type BlockLike = SourceFile | Block | ModuleBlock | CaseClause; + type BlockLike = SourceFile | Block | ModuleBlock | CaseOrDefaultClause; interface Block extends Statement { kind: SyntaxKind.Block; statements: NodeArray; @@ -1072,6 +1128,7 @@ declare namespace ts { } interface ForOfStatement extends IterationStatement { kind: SyntaxKind.ForOfStatement; + awaitModifier?: AwaitKeywordToken; initializer: ForInitializer; expression: Expression; } @@ -1101,15 +1158,18 @@ declare namespace ts { } interface CaseBlock extends Node { kind: SyntaxKind.CaseBlock; + parent?: SwitchStatement; clauses: NodeArray; } interface CaseClause extends Node { kind: SyntaxKind.CaseClause; + parent?: CaseBlock; expression: Expression; statements: NodeArray; } interface DefaultClause extends Node { kind: SyntaxKind.DefaultClause; + parent?: CaseBlock; statements: NodeArray; } type CaseOrDefaultClause = CaseClause | DefaultClause; @@ -1130,6 +1190,7 @@ declare namespace ts { } interface CatchClause extends Node { kind: SyntaxKind.CatchClause; + parent?: TryStatement; variableDeclaration: VariableDeclaration; block: Block; } @@ -1165,8 +1226,9 @@ declare namespace ts { } interface HeritageClause extends Node { kind: SyntaxKind.HeritageClause; - token: SyntaxKind; - types?: NodeArray; + parent?: InterfaceDeclaration | ClassDeclaration | ClassExpression; + token: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword; + types: NodeArray; } interface TypeAliasDeclaration extends DeclarationStatement { kind: SyntaxKind.TypeAliasDeclaration; @@ -1176,6 +1238,7 @@ declare namespace ts { } interface EnumMember extends Declaration { kind: SyntaxKind.EnumMember; + parent?: EnumDeclaration; name: PropertyName; initializer?: Expression; } @@ -1184,91 +1247,121 @@ declare namespace ts { name: Identifier; members: NodeArray; } - type ModuleBody = ModuleBlock | ModuleDeclaration; type ModuleName = Identifier | StringLiteral; + type ModuleBody = NamespaceBody | JSDocNamespaceBody; interface ModuleDeclaration extends DeclarationStatement { kind: SyntaxKind.ModuleDeclaration; - name: Identifier | StringLiteral; - body?: ModuleBlock | NamespaceDeclaration | JSDocNamespaceDeclaration | Identifier; + parent?: ModuleBody | SourceFile; + name: ModuleName; + body?: ModuleBody | JSDocNamespaceDeclaration; } + type NamespaceBody = ModuleBlock | NamespaceDeclaration; interface NamespaceDeclaration extends ModuleDeclaration { name: Identifier; - body: ModuleBlock | NamespaceDeclaration; + body: NamespaceBody; } + type JSDocNamespaceBody = Identifier | JSDocNamespaceDeclaration; interface JSDocNamespaceDeclaration extends ModuleDeclaration { name: Identifier; - body: JSDocNamespaceDeclaration | Identifier; + body: JSDocNamespaceBody; } interface ModuleBlock extends Node, Statement { kind: SyntaxKind.ModuleBlock; + parent?: ModuleDeclaration; statements: NodeArray; } type ModuleReference = EntityName | ExternalModuleReference; + /** + * One of: + * - import x = require("mod"); + * - import x = M.x; + */ interface ImportEqualsDeclaration extends DeclarationStatement { kind: SyntaxKind.ImportEqualsDeclaration; + parent?: SourceFile | ModuleBlock; name: Identifier; moduleReference: ModuleReference; } interface ExternalModuleReference extends Node { kind: SyntaxKind.ExternalModuleReference; + parent?: ImportEqualsDeclaration; expression?: Expression; } interface ImportDeclaration extends Statement { kind: SyntaxKind.ImportDeclaration; + parent?: SourceFile | ModuleBlock; importClause?: ImportClause; + /** If this is not a StringLiteral it will be a grammar error. */ moduleSpecifier: Expression; } type NamedImportBindings = NamespaceImport | NamedImports; interface ImportClause extends Declaration { kind: SyntaxKind.ImportClause; + parent?: ImportDeclaration; name?: Identifier; namedBindings?: NamedImportBindings; } interface NamespaceImport extends Declaration { kind: SyntaxKind.NamespaceImport; + parent?: ImportClause; name: Identifier; } interface NamespaceExportDeclaration extends DeclarationStatement { kind: SyntaxKind.NamespaceExportDeclaration; name: Identifier; - moduleReference: LiteralLikeNode; } interface ExportDeclaration extends DeclarationStatement { kind: SyntaxKind.ExportDeclaration; + parent?: SourceFile | ModuleBlock; exportClause?: NamedExports; + /** If this is not a StringLiteral it will be a grammar error. */ moduleSpecifier?: Expression; } interface NamedImports extends Node { kind: SyntaxKind.NamedImports; + parent?: ImportClause; elements: NodeArray; } interface NamedExports extends Node { kind: SyntaxKind.NamedExports; + parent?: ExportDeclaration; elements: NodeArray; } type NamedImportsOrExports = NamedImports | NamedExports; interface ImportSpecifier extends Declaration { kind: SyntaxKind.ImportSpecifier; + parent?: NamedImports; propertyName?: Identifier; name: Identifier; } interface ExportSpecifier extends Declaration { kind: SyntaxKind.ExportSpecifier; + parent?: NamedExports; propertyName?: Identifier; name: Identifier; } type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier; interface ExportAssignment extends DeclarationStatement { kind: SyntaxKind.ExportAssignment; + parent?: SourceFile; isExportEquals?: boolean; expression: Expression; } interface FileReference extends TextRange { fileName: string; } + interface CheckJsDirective extends TextRange { + enabled: boolean; + } + type CommentKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia; interface CommentRange extends TextRange { hasTrailingNewLine?: boolean; - kind: SyntaxKind; + kind: CommentKind; + } + interface SynthesizedComment extends CommentRange { + text: string; + pos: -1; + end: -1; } interface JSDocTypeExpression extends Node { kind: SyntaxKind.JSDocTypeExpression; @@ -1412,9 +1505,21 @@ declare namespace ts { ArrayMutation = 256, Referenced = 512, Shared = 1024, + PreFinally = 2048, + AfterFinally = 4096, Label = 12, Condition = 96, } + interface FlowLock { + locked?: boolean; + } + interface AfterFinallyFlow extends FlowNode, FlowLock { + antecedent: FlowNode; + } + interface PreFinallyFlow extends FlowNode { + antecedent: FlowNode; + lock: FlowLock; + } interface FlowNode { flags: FlowFlags; id?: number; @@ -1457,7 +1562,6 @@ declare namespace ts { statements: NodeArray; endOfFileToken: Token; fileName: string; - path: Path; text: string; amdDependencies: AmdDependency[]; moduleName: string; @@ -1476,6 +1580,10 @@ declare namespace ts { hasNoDefaultLib: boolean; languageVersion: ScriptTarget; } + interface Bundle extends Node { + kind: SyntaxKind.Bundle; + sourceFiles: SourceFile[]; + } interface ScriptReferenceHost { getCompilerOptions(): CompilerOptions; getSourceFile(fileName: string): SourceFile; @@ -1486,9 +1594,9 @@ declare namespace ts { useCaseSensitiveFileNames: boolean; readDirectory(rootDir: string, extensions: string[], excludes: string[], includes: string[]): string[]; /** - * Gets a value indicating whether the specified path exists and is a file. - * @param path The path to test. - */ + * Gets a value indicating whether the specified path exists and is a file. + * @param path The path to test. + */ fileExists(path: string): boolean; readFile(path: string): string; } @@ -1521,7 +1629,7 @@ declare namespace ts { * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter * will be invoked when writing the JavaScript and declaration files. */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean): EmitResult; + emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult; getOptionsDiagnostics(cancellationToken?: CancellationToken): Diagnostic[]; getGlobalDiagnostics(cancellationToken?: CancellationToken): Diagnostic[]; getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[]; @@ -1532,6 +1640,12 @@ declare namespace ts { */ getTypeChecker(): TypeChecker; } + interface CustomTransformers { + /** Custom transformers to evaluate before built-in transformations. */ + before?: TransformerFactory[]; + /** Custom transformers to evaluate after built-in transformations. */ + after?: TransformerFactory[]; + } interface SourceMapSpan { /** Line number in the .js file. */ emittedLine: number; @@ -1575,11 +1689,20 @@ declare namespace ts { getDeclaredTypeOfSymbol(symbol: Symbol): Type; getPropertiesOfType(type: Type): Symbol[]; getPropertyOfType(type: Type, propertyName: string): Symbol; + getIndexInfoOfType(type: Type, kind: IndexKind): IndexInfo; getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; getIndexTypeOfType(type: Type, kind: IndexKind): Type; - getBaseTypes(type: InterfaceType): ObjectType[]; + getBaseTypes(type: InterfaceType): BaseType[]; + getBaseTypeOfLiteralType(type: Type): Type; + getWidenedType(type: Type): Type; getReturnTypeOfSignature(signature: Signature): Type; getNonNullableType(type: Type): Type; + /** Note that the resulting nodes cannot be checked. */ + typeToTypeNode(type: Type, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): TypeNode; + /** Note that the resulting nodes cannot be checked. */ + signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): SignatureDeclaration; + /** Note that the resulting nodes cannot be checked. */ + indexInfoToIndexSignatureDeclaration(indexInfo: IndexInfo, kind: IndexKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): IndexSignatureDeclaration; getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; getSymbolAtLocation(node: Node): Symbol; getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[]; @@ -1587,6 +1710,8 @@ declare namespace ts { getExportSpecifierLocalTargetSymbol(location: ExportSpecifier): Symbol; getPropertySymbolOfDestructuringAssignment(location: Identifier): Symbol; getTypeAtLocation(node: Node): Type; + getTypeFromTypeNode(node: TypeNode): Type; + signatureToString(signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): string; typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; getSymbolDisplayBuilder(): SymbolDisplayBuilder; @@ -1602,18 +1727,30 @@ declare namespace ts { isUnknownSymbol(symbol: Symbol): boolean; getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; + /** Follow all aliases to get the original symbol. */ getAliasedSymbol(symbol: Symbol): Symbol; getExportsOfModule(moduleSymbol: Symbol): Symbol[]; - getJsxElementAttributesType(elementNode: JsxOpeningLikeElement): Type; + getAllAttributesTypeFromJsxOpeningLikeElement(elementNode: JsxOpeningLikeElement): Type; getJsxIntrinsicTagNames(): Symbol[]; isOptionalParameter(node: ParameterDeclaration): boolean; getAmbientModules(): Symbol[]; tryGetMemberInModuleExports(memberName: string, moduleSymbol: Symbol): Symbol | undefined; + getApparentType(type: Type): Type; + } + enum NodeBuilderFlags { + None = 0, + allowThisInObjectLiteral = 1, + allowQualifedNameInPlaceOfIdentifier = 2, + allowTypeParameterInQualifiedName = 4, + allowAnonymousIdentifier = 8, + allowEmptyUnionOrIntersection = 16, + allowEmptyTuple = 32, } interface SymbolDisplayBuilder { buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): void; + buildIndexSignatureDisplay(info: IndexInfo, writer: SymbolWriter, kind: IndexKind, enclosingDeclaration?: Node, globalFlags?: TypeFormatFlags, symbolStack?: Symbol[]): void; buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; buildTypePredicateDisplay(predicate: TypePredicate, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; @@ -1629,6 +1766,7 @@ declare namespace ts { writeSpace(text: string): void; writeStringLiteral(text: string): void; writeParameter(text: string): void; + writeProperty(text: string): void; writeSymbol(text: string, symbol: Symbol): void; writeLine(): void; increaseIndent(): void; @@ -1636,6 +1774,7 @@ declare namespace ts { clear(): void; trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; reportInaccessibleThisError(): void; + reportIllegalExtends(): void; } enum TypeFormatFlags { None = 0, @@ -1650,6 +1789,8 @@ declare namespace ts { InFirstTypeArgument = 256, InTypeAlias = 512, UseTypeAliasValue = 1024, + SuppressAnyReturnType = 2048, + AddUndefined = 4096, } enum SymbolFormatFlags { None = 0, @@ -1699,13 +1840,10 @@ declare namespace ts { ExportType = 2097152, ExportNamespace = 4194304, Alias = 8388608, - Instantiated = 16777216, - Merged = 33554432, - Transient = 67108864, - Prototype = 134217728, - SyntheticProperty = 268435456, - Optional = 536870912, - ExportStar = 1073741824, + Prototype = 16777216, + ExportStar = 33554432, + Optional = 67108864, + Transient = 134217728, Enum = 384, Variable = 3, Value = 107455, @@ -1771,6 +1909,7 @@ declare namespace ts { Intersection = 131072, Index = 262144, IndexedAccess = 524288, + NonPrimitive = 16777216, Literal = 480, StringOrNumberLiteral = 96, PossiblyFalsy = 7406, @@ -1780,9 +1919,10 @@ declare namespace ts { EnumLike = 272, UnionOrIntersection = 196608, StructuredType = 229376, - StructuredOrTypeParameter = 507904, - Narrowable = 1033215, - NotUnionOrUnit = 33281, + StructuredOrTypeVariable = 1032192, + TypeVariable = 540672, + Narrowable = 17810431, + NotUnionOrUnit = 16810497, } type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; interface Type { @@ -1798,7 +1938,7 @@ declare namespace ts { regularType?: LiteralType; } interface EnumType extends Type { - memberTypes: Map; + memberTypes: EnumLiteralType[]; } interface EnumLiteralType extends LiteralType { baseType: EnumType & UnionType; @@ -1819,12 +1959,14 @@ declare namespace ts { interface ObjectType extends Type { objectFlags: ObjectFlags; } + /** Class and interface types (TypeFlags.Class and TypeFlags.Interface). */ interface InterfaceType extends ObjectType { typeParameters: TypeParameter[]; outerTypeParameters: TypeParameter[]; localTypeParameters: TypeParameter[]; thisType: TypeParameter; } + type BaseType = ObjectType | IntersectionType; interface InterfaceTypeWithDeclaredMembers extends InterfaceType { declaredProperties: Symbol[]; declaredCallSignatures: Signature[]; @@ -1832,6 +1974,16 @@ declare namespace ts { declaredStringIndexInfo: IndexInfo; declaredNumberIndexInfo: IndexInfo; } + /** + * Type references (TypeFlags.Reference). When a class or interface has type parameters or + * a "this" type, references to the class or interface are made using type references. The + * typeArguments property specifies the types to substitute for the type parameters of the + * class or interface and optionally includes an extra element that specifies the type to + * substitute for "this" in the resulting instantiation. When no extra argument is present, + * the type reference itself is substituted for "this". The typeArguments property is undefined + * if the class or interface has no type parameters and the reference isn't specifying an + * explicit "this" argument. + */ interface TypeReference extends ObjectType { target: GenericType; typeArguments: Type[]; @@ -1850,15 +2002,19 @@ declare namespace ts { elementType: Type; finalArrayType?: Type; } - interface TypeParameter extends Type { + interface TypeVariable extends Type { + } + interface TypeParameter extends TypeVariable { constraint: Type; + default?: Type; } - interface IndexType extends Type { - type: TypeParameter; - } - interface IndexedAccessType extends Type { + interface IndexedAccessType extends TypeVariable { objectType: Type; indexType: Type; + constraint?: Type; + } + interface IndexType extends Type { + type: TypeVariable | UnionOrIntersectionType; } enum SignatureKind { Call = 0, @@ -1878,6 +2034,10 @@ declare namespace ts { isReadonly: boolean; declaration?: SignatureDeclaration; } + interface JsFileExtensionInfo { + extension: string; + isMixedContent: boolean; + } interface DiagnosticMessage { key: string; category: DiagnosticCategory; @@ -1913,7 +2073,10 @@ declare namespace ts { Classic = 1, NodeJs = 2, } - type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike; + interface PluginImport { + name: string; + } + type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike | PluginImport[]; interface CompilerOptions { allowJs?: boolean; allowSyntheticDefaultImports?: boolean; @@ -1922,9 +2085,11 @@ declare namespace ts { alwaysStrict?: boolean; baseUrl?: string; charset?: string; + checkJs?: boolean; declaration?: boolean; declarationDir?: string; disableSizeLimit?: boolean; + downlevelIteration?: boolean; emitBOM?: boolean; emitDecoratorMetadata?: boolean; experimentalDecorators?: boolean; @@ -1969,6 +2134,7 @@ declare namespace ts { skipDefaultLibCheck?: boolean; sourceMap?: boolean; sourceRoot?: string; + strict?: boolean; strictNullChecks?: boolean; suppressExcessPropertyErrors?: boolean; suppressImplicitAnyIndexErrors?: boolean; @@ -2007,6 +2173,7 @@ declare namespace ts { None = 0, Preserve = 1, React = 2, + ReactNative = 3, } enum NewLineKind { CarriageReturnLineFeed = 0, @@ -2022,6 +2189,7 @@ declare namespace ts { JSX = 2, TS = 3, TSX = 4, + External = 5, } enum ScriptTarget { ES3 = 0, @@ -2102,7 +2270,6 @@ declare namespace ts { } interface ResolvedModuleWithFailedLookupLocations { resolvedModule: ResolvedModuleFull | undefined; - failedLookupLocations: string[]; } interface ResolvedTypeReferenceDirective { primary: boolean; @@ -2131,6 +2298,206 @@ declare namespace ts { resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[]; getEnvironmentVariable?(name: string): string; } + enum EmitFlags { + SingleLine = 1, + AdviseOnEmitNode = 2, + NoSubstitution = 4, + CapturesThis = 8, + NoLeadingSourceMap = 16, + NoTrailingSourceMap = 32, + NoSourceMap = 48, + NoNestedSourceMaps = 64, + NoTokenLeadingSourceMaps = 128, + NoTokenTrailingSourceMaps = 256, + NoTokenSourceMaps = 384, + NoLeadingComments = 512, + NoTrailingComments = 1024, + NoComments = 1536, + NoNestedComments = 2048, + HelperName = 4096, + ExportName = 8192, + LocalName = 16384, + Indented = 32768, + NoIndentation = 65536, + AsyncFunctionBody = 131072, + ReuseTempVariableScope = 262144, + CustomPrologue = 524288, + NoHoisting = 1048576, + HasEndOfDeclarationMarker = 2097152, + Iterator = 4194304, + } + interface EmitHelper { + readonly name: string; + readonly scoped: boolean; + readonly text: string; + readonly priority?: number; + } + enum EmitHint { + SourceFile = 0, + Expression = 1, + IdentifierName = 2, + Unspecified = 3, + } + interface TransformationContext { + /** Gets the compiler options supplied to the transformer. */ + getCompilerOptions(): CompilerOptions; + /** Starts a new lexical environment. */ + startLexicalEnvironment(): void; + /** Suspends the current lexical environment, usually after visiting a parameter list. */ + suspendLexicalEnvironment(): void; + /** Resumes a suspended lexical environment, usually before visiting a function body. */ + resumeLexicalEnvironment(): void; + /** Ends a lexical environment, returning any declarations. */ + endLexicalEnvironment(): Statement[]; + /** Hoists a function declaration to the containing scope. */ + hoistFunctionDeclaration(node: FunctionDeclaration): void; + /** Hoists a variable declaration to the containing scope. */ + hoistVariableDeclaration(node: Identifier): void; + /** Records a request for a non-scoped emit helper in the current context. */ + requestEmitHelper(helper: EmitHelper): void; + /** Gets and resets the requested non-scoped emit helpers. */ + readEmitHelpers(): EmitHelper[] | undefined; + /** Enables expression substitutions in the pretty printer for the provided SyntaxKind. */ + enableSubstitution(kind: SyntaxKind): void; + /** Determines whether expression substitutions are enabled for the provided node. */ + isSubstitutionEnabled(node: Node): boolean; + /** + * Hook used by transformers to substitute expressions just before they + * are emitted by the pretty printer. + * + * NOTE: Transformation hooks should only be modified during `Transformer` initialization, + * before returning the `NodeTransformer` callback. + */ + onSubstituteNode: (hint: EmitHint, node: Node) => Node; + /** + * Enables before/after emit notifications in the pretty printer for the provided + * SyntaxKind. + */ + enableEmitNotification(kind: SyntaxKind): void; + /** + * Determines whether before/after emit notifications should be raised in the pretty + * printer when it emits a node. + */ + isEmitNotificationEnabled(node: Node): boolean; + /** + * Hook used to allow transformers to capture state before or after + * the printer emits a node. + * + * NOTE: Transformation hooks should only be modified during `Transformer` initialization, + * before returning the `NodeTransformer` callback. + */ + onEmitNode: (hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void) => void; + } + interface TransformationResult { + /** Gets the transformed source files. */ + transformed: T[]; + /** Gets diagnostics for the transformation. */ + diagnostics?: Diagnostic[]; + /** + * Gets a substitute for a node, if one is available; otherwise, returns the original node. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to substitute. + */ + substituteNode(hint: EmitHint, node: Node): Node; + /** + * Emits a node with possible notification. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to emit. + * @param emitCallback A callback used to emit the node. + */ + emitNodeWithNotification(hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void): void; + /** + * Clean up EmitNode entries on any parse-tree nodes. + */ + dispose(): void; + } + /** + * A function that is used to initialize and return a `Transformer` callback, which in turn + * will be used to transform one or more nodes. + */ + type TransformerFactory = (context: TransformationContext) => Transformer; + /** + * A function that transforms a node. + */ + type Transformer = (node: T) => T; + /** + * A function that accepts and possibly transforms a node. + */ + type Visitor = (node: Node) => VisitResult; + type VisitResult = T | T[]; + interface Printer { + /** + * Print a node and its subtree as-is, without any emit transformations. + * @param hint A value indicating the purpose of a node. This is primarily used to + * distinguish between an `Identifier` used in an expression position, versus an + * `Identifier` used as an `IdentifierName` as part of a declaration. For most nodes you + * should just pass `Unspecified`. + * @param node The node to print. The node and its subtree are printed as-is, without any + * emit transformations. + * @param sourceFile A source file that provides context for the node. The source text of + * the file is used to emit the original source content for literals and identifiers, while + * the identifiers of the source file are used when generating unique names to avoid + * collisions. + */ + printNode(hint: EmitHint, node: Node, sourceFile: SourceFile): string; + /** + * Prints a source file as-is, without any emit transformations. + */ + printFile(sourceFile: SourceFile): string; + /** + * Prints a bundle of source files as-is, without any emit transformations. + */ + printBundle(bundle: Bundle): string; + } + interface PrintHandlers { + /** + * A hook used by the Printer when generating unique names to avoid collisions with + * globally defined names that exist outside of the current source file. + */ + hasGlobalName?(name: string): boolean; + /** + * A hook used by the Printer to provide notifications prior to emitting a node. A + * compatible implementation **must** invoke `emitCallback` with the provided `hint` and + * `node` values. + * @param hint A hint indicating the intended purpose of the node. + * @param node The node to emit. + * @param emitCallback A callback that, when invoked, will emit the node. + * @example + * ```ts + * var printer = createPrinter(printerOptions, { + * onEmitNode(hint, node, emitCallback) { + * // set up or track state prior to emitting the node... + * emitCallback(hint, node); + * // restore state after emitting the node... + * } + * }); + * ``` + */ + onEmitNode?(hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void): void; + /** + * A hook used by the Printer to perform just-in-time substitution of a node. This is + * primarily used by node transformations that need to substitute one node for another, + * such as replacing `myExportedVar` with `exports.myExportedVar`. + * @param hint A hint indicating the intended purpose of the node. + * @param node The node to emit. + * @example + * ```ts + * var printer = createPrinter(printerOptions, { + * substituteNode(hint, node) { + * // perform substitution if necessary... + * return node; + * } + * }); + * ``` + */ + substituteNode?(hint: EmitHint, node: Node): Node; + } + interface PrinterOptions { + removeComments?: boolean; + newLine?: NewLineKind; + } interface TextSpan { start: number; length: number; @@ -2145,8 +2512,10 @@ declare namespace ts { } declare namespace ts { /** The version of the TypeScript compiler release */ - const version = "2.2.0-dev.20161127"; + const version = "2.3.0-dev.20170419"; } +declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any; +declare function clearTimeout(handle: any): void; declare namespace ts { type FileWatcherCallback = (fileName: string, removed?: boolean) => void; type DirectoryWatcherCallback = (fileName: string) => void; @@ -2192,6 +2561,7 @@ declare namespace ts { directoryName: string; referenceCount: number; } + function getNodeMajorVersion(): number; let sys: System; } declare namespace ts { @@ -2237,12 +2607,12 @@ declare namespace ts { function isWhiteSpaceSingleLine(ch: number): boolean; function isLineBreak(ch: number): boolean; function couldStartTrivia(text: string, pos: number): boolean; - function forEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: SyntaxKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U; - function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: SyntaxKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U; - function reduceEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: SyntaxKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; - function reduceEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: SyntaxKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; - function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; - function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; + function forEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U; + function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U; + function reduceEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; + function reduceEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; + function getLeadingCommentRanges(text: string, pos: number): CommentRange[] | undefined; + function getTrailingCommentRanges(text: string, pos: number): CommentRange[] | undefined; /** Optionally, get the shebang */ function getShebang(text: string): string; function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; @@ -2282,15 +2652,414 @@ declare namespace ts { function getCombinedModifierFlags(node: Node): ModifierFlags; function getCombinedNodeFlags(node: Node): NodeFlags; /** - * Checks to see if the locale is in the appropriate format, - * and if it is, attempts to set the appropriate language. - */ + * Checks to see if the locale is in the appropriate format, + * and if it is, attempts to set the appropriate language. + */ function validateLocaleAndSetLanguage(locale: string, sys: { getExecutingFilePath(): string; resolvePath(path: string): string; fileExists(fileName: string): boolean; readFile(fileName: string): string; }, errors?: Diagnostic[]): void; + function getOriginalNode(node: Node): Node; + function getOriginalNode(node: Node, nodeTest: (node: Node) => node is T): T; + /** + * Gets a value indicating whether a node originated in the parse tree. + * + * @param node The node to test. + */ + function isParseTreeNode(node: Node): boolean; + /** + * Gets the original parse tree node for a node. + * + * @param node The original node. + * @returns The original parse tree node if found; otherwise, undefined. + */ + function getParseTreeNode(node: Node): Node; + /** + * Gets the original parse tree node for a node. + * + * @param node The original node. + * @param nodeTest A callback used to ensure the correct type of parse tree node is returned. + * @returns The original parse tree node if found; otherwise, undefined. + */ + function getParseTreeNode(node: Node, nodeTest?: (node: Node) => node is T): T; + /** + * Remove extra underscore from escaped identifier text content. + * + * @param identifier The escaped identifier text. + * @returns The unescaped identifier text. + */ + function unescapeIdentifier(identifier: string): string; +} +declare namespace ts { + /** + * Make `elements` into a `NodeArray`. If `elements` is `undefined`, returns an empty `NodeArray`. + */ + function createNodeArray(elements?: T[], hasTrailingComma?: boolean): NodeArray; + function createLiteral(value: string): StringLiteral; + function createLiteral(value: number): NumericLiteral; + function createLiteral(value: boolean): BooleanLiteral; + /** Create a string literal whose source text is read from a source node during emit. */ + function createLiteral(sourceNode: StringLiteral | NumericLiteral | Identifier): StringLiteral; + function createLiteral(value: string | number | boolean): PrimaryExpression; + function createNumericLiteral(value: string): NumericLiteral; + function createIdentifier(text: string): Identifier; + /** Create a unique temporary variable. */ + function createTempVariable(recordTempVariable: ((node: Identifier) => void) | undefined): Identifier; + /** Create a unique temporary variable for use in a loop. */ + function createLoopVariable(): Identifier; + /** Create a unique name based on the supplied text. */ + function createUniqueName(text: string): Identifier; + /** Create a unique name generated for a node. */ + function getGeneratedNameForNode(node: Node): Identifier; + function createToken(token: TKind): Token; + function createSuper(): SuperExpression; + function createThis(): ThisExpression & Token; + function createNull(): NullLiteral & Token; + function createTrue(): BooleanLiteral & Token; + function createFalse(): BooleanLiteral & Token; + function createQualifiedName(left: EntityName, right: string | Identifier): QualifiedName; + function updateQualifiedName(node: QualifiedName, left: EntityName, right: Identifier): QualifiedName; + function createComputedPropertyName(expression: Expression): ComputedPropertyName; + function updateComputedPropertyName(node: ComputedPropertyName, expression: Expression): ComputedPropertyName; + function createSignatureDeclaration(kind: SyntaxKind, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): SignatureDeclaration; + function createFunctionTypeNode(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): FunctionTypeNode; + function updateFunctionTypeNode(node: FunctionTypeNode, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): FunctionTypeNode; + function createConstructorTypeNode(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): ConstructorTypeNode; + function updateConstructorTypeNode(node: ConstructorTypeNode, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): ConstructorTypeNode; + function createCallSignatureDeclaration(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): CallSignatureDeclaration; + function updateCallSignatureDeclaration(node: CallSignatureDeclaration, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): CallSignatureDeclaration; + function createConstructSignatureDeclaration(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): ConstructSignatureDeclaration; + function updateConstructSignatureDeclaration(node: ConstructSignatureDeclaration, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): ConstructSignatureDeclaration; + function createMethodSignature(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined): MethodSignature; + function updateMethodSignature(node: MethodSignature, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined, name: PropertyName, questionToken: QuestionToken | undefined): MethodSignature; + function createKeywordTypeNode(kind: KeywordTypeNode["kind"]): KeywordTypeNode; + function createThisTypeNode(): ThisTypeNode; + function createLiteralTypeNode(literal: Expression): LiteralTypeNode; + function updateLiteralTypeNode(node: LiteralTypeNode, literal: Expression): LiteralTypeNode; + function createTypeReferenceNode(typeName: string | EntityName, typeArguments: TypeNode[] | undefined): TypeReferenceNode; + function updateTypeReferenceNode(node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray | undefined): TypeReferenceNode; + function createTypePredicateNode(parameterName: Identifier | ThisTypeNode | string, type: TypeNode): TypePredicateNode; + function updateTypePredicateNode(node: TypePredicateNode, parameterName: Identifier | ThisTypeNode, type: TypeNode): TypePredicateNode; + function createTypeQueryNode(exprName: EntityName): TypeQueryNode; + function updateTypeQueryNode(node: TypeQueryNode, exprName: EntityName): TypeQueryNode; + function createArrayTypeNode(elementType: TypeNode): ArrayTypeNode; + function updateArrayTypeNode(node: ArrayTypeNode, elementType: TypeNode): ArrayTypeNode; + function createUnionOrIntersectionTypeNode(kind: SyntaxKind.UnionType, types: TypeNode[]): UnionTypeNode; + function createUnionOrIntersectionTypeNode(kind: SyntaxKind.IntersectionType, types: TypeNode[]): IntersectionTypeNode; + function createUnionOrIntersectionTypeNode(kind: SyntaxKind.UnionType | SyntaxKind.IntersectionType, types: TypeNode[]): UnionOrIntersectionTypeNode; + function updateUnionOrIntersectionTypeNode(node: UnionOrIntersectionTypeNode, types: NodeArray): UnionOrIntersectionTypeNode; + function createTypeLiteralNode(members: TypeElement[]): TypeLiteralNode; + function updateTypeLiteralNode(node: TypeLiteralNode, members: NodeArray): TypeLiteralNode; + function createTupleTypeNode(elementTypes: TypeNode[]): TupleTypeNode; + function updateTypleTypeNode(node: TupleTypeNode, elementTypes: TypeNode[]): TupleTypeNode; + function createMappedTypeNode(readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; + function updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; + function createTypeOperatorNode(type: TypeNode): TypeOperatorNode; + function updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; + function createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; + function updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; + function createTypeParameterDeclaration(name: string | Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined): TypeParameterDeclaration; + function updateTypeParameterDeclaration(node: TypeParameterDeclaration, name: Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined): TypeParameterDeclaration; + function createPropertySignature(name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertySignature; + function updatePropertySignature(node: PropertySignature, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertySignature; + function createIndexSignatureDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, parameters: ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; + function updateIndexSignatureDeclaration(node: IndexSignatureDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, parameters: ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; + function createParameter(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken?: QuestionToken, type?: TypeNode, initializer?: Expression): ParameterDeclaration; + function updateParameter(node: ParameterDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): ParameterDeclaration; + function createDecorator(expression: Expression): Decorator; + function updateDecorator(node: Decorator, expression: Expression): Decorator; + function createProperty(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression): PropertyDeclaration; + function updateProperty(node: PropertyDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: PropertyName, type: TypeNode | undefined, initializer: Expression): PropertyDeclaration; + function createMethodDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; + function updateMethod(node: MethodDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; + function createConstructor(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, parameters: ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; + function updateConstructor(node: ConstructorDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, parameters: ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; + function createGetAccessor(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | PropertyName, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration; + function updateGetAccessor(node: GetAccessorDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: PropertyName, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration; + function createSetAccessor(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | PropertyName, parameters: ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration; + function updateSetAccessor(node: SetAccessorDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: PropertyName, parameters: ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration; + function createObjectBindingPattern(elements: BindingElement[]): ObjectBindingPattern; + function updateObjectBindingPattern(node: ObjectBindingPattern, elements: BindingElement[]): ObjectBindingPattern; + function createArrayBindingPattern(elements: ArrayBindingElement[]): ArrayBindingPattern; + function updateArrayBindingPattern(node: ArrayBindingPattern, elements: ArrayBindingElement[]): ArrayBindingPattern; + function createBindingElement(dotDotDotToken: DotDotDotToken | undefined, propertyName: string | PropertyName | undefined, name: string | BindingName, initializer?: Expression): BindingElement; + function updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken | undefined, propertyName: PropertyName | undefined, name: BindingName, initializer: Expression | undefined): BindingElement; + function createArrayLiteral(elements?: Expression[], multiLine?: boolean): ArrayLiteralExpression; + function updateArrayLiteral(node: ArrayLiteralExpression, elements: Expression[]): ArrayLiteralExpression; + function createObjectLiteral(properties?: ObjectLiteralElementLike[], multiLine?: boolean): ObjectLiteralExpression; + function updateObjectLiteral(node: ObjectLiteralExpression, properties: ObjectLiteralElementLike[]): ObjectLiteralExpression; + function createPropertyAccess(expression: Expression, name: string | Identifier): PropertyAccessExpression; + function updatePropertyAccess(node: PropertyAccessExpression, expression: Expression, name: Identifier): PropertyAccessExpression; + function createElementAccess(expression: Expression, index: number | Expression): ElementAccessExpression; + function updateElementAccess(node: ElementAccessExpression, expression: Expression, argumentExpression: Expression): ElementAccessExpression; + function createCall(expression: Expression, typeArguments: TypeNode[] | undefined, argumentsArray: Expression[]): CallExpression; + function updateCall(node: CallExpression, expression: Expression, typeArguments: TypeNode[] | undefined, argumentsArray: Expression[]): CallExpression; + function createNew(expression: Expression, typeArguments: TypeNode[] | undefined, argumentsArray: Expression[] | undefined): NewExpression; + function updateNew(node: NewExpression, expression: Expression, typeArguments: TypeNode[] | undefined, argumentsArray: Expression[] | undefined): NewExpression; + function createTaggedTemplate(tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; + function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; + function createTypeAssertion(type: TypeNode, expression: Expression): TypeAssertion; + function updateTypeAssertion(node: TypeAssertion, type: TypeNode, expression: Expression): TypeAssertion; + function createParen(expression: Expression): ParenthesizedExpression; + function updateParen(node: ParenthesizedExpression, expression: Expression): ParenthesizedExpression; + function createFunctionExpression(modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block): FunctionExpression; + function updateFunctionExpression(node: FunctionExpression, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block): FunctionExpression; + function createArrowFunction(modifiers: Modifier[] | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction; + function updateArrowFunction(node: ArrowFunction, modifiers: Modifier[] | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: ConciseBody): ArrowFunction; + function createDelete(expression: Expression): DeleteExpression; + function updateDelete(node: DeleteExpression, expression: Expression): DeleteExpression; + function createTypeOf(expression: Expression): TypeOfExpression; + function updateTypeOf(node: TypeOfExpression, expression: Expression): TypeOfExpression; + function createVoid(expression: Expression): VoidExpression; + function updateVoid(node: VoidExpression, expression: Expression): VoidExpression; + function createAwait(expression: Expression): AwaitExpression; + function updateAwait(node: AwaitExpression, expression: Expression): AwaitExpression; + function createPrefix(operator: PrefixUnaryOperator, operand: Expression): PrefixUnaryExpression; + function updatePrefix(node: PrefixUnaryExpression, operand: Expression): PrefixUnaryExpression; + function createPostfix(operand: Expression, operator: PostfixUnaryOperator): PostfixUnaryExpression; + function updatePostfix(node: PostfixUnaryExpression, operand: Expression): PostfixUnaryExpression; + function createBinary(left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression): BinaryExpression; + function updateBinary(node: BinaryExpression, left: Expression, right: Expression): BinaryExpression; + function createConditional(condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression; + function createConditional(condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression; + function updateConditional(node: ConditionalExpression, condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression; + function createTemplateExpression(head: TemplateHead, templateSpans: TemplateSpan[]): TemplateExpression; + function updateTemplateExpression(node: TemplateExpression, head: TemplateHead, templateSpans: TemplateSpan[]): TemplateExpression; + function createYield(expression?: Expression): YieldExpression; + function createYield(asteriskToken: AsteriskToken, expression: Expression): YieldExpression; + function updateYield(node: YieldExpression, asteriskToken: AsteriskToken | undefined, expression: Expression): YieldExpression; + function createSpread(expression: Expression): SpreadElement; + function updateSpread(node: SpreadElement, expression: Expression): SpreadElement; + function createClassExpression(modifiers: Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, heritageClauses: HeritageClause[], members: ClassElement[]): ClassExpression; + function updateClassExpression(node: ClassExpression, modifiers: Modifier[] | undefined, name: Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, heritageClauses: HeritageClause[], members: ClassElement[]): ClassExpression; + function createOmittedExpression(): OmittedExpression; + function createExpressionWithTypeArguments(typeArguments: TypeNode[], expression: Expression): ExpressionWithTypeArguments; + function updateExpressionWithTypeArguments(node: ExpressionWithTypeArguments, typeArguments: TypeNode[], expression: Expression): ExpressionWithTypeArguments; + function createAsExpression(expression: Expression, type: TypeNode): AsExpression; + function updateAsExpression(node: AsExpression, expression: Expression, type: TypeNode): AsExpression; + function createNonNullExpression(expression: Expression): NonNullExpression; + function updateNonNullExpression(node: NonNullExpression, expression: Expression): NonNullExpression; + function createTemplateSpan(expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan; + function updateTemplateSpan(node: TemplateSpan, expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan; + function createBlock(statements: Statement[], multiLine?: boolean): Block; + function updateBlock(node: Block, statements: Statement[]): Block; + function createVariableStatement(modifiers: Modifier[] | undefined, declarationList: VariableDeclarationList | VariableDeclaration[]): VariableStatement; + function updateVariableStatement(node: VariableStatement, modifiers: Modifier[] | undefined, declarationList: VariableDeclarationList): VariableStatement; + function createVariableDeclarationList(declarations: VariableDeclaration[], flags?: NodeFlags): VariableDeclarationList; + function updateVariableDeclarationList(node: VariableDeclarationList, declarations: VariableDeclaration[]): VariableDeclarationList; + function createVariableDeclaration(name: string | BindingName, type?: TypeNode, initializer?: Expression): VariableDeclaration; + function updateVariableDeclaration(node: VariableDeclaration, name: BindingName, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration; + function createEmptyStatement(): EmptyStatement; + function createStatement(expression: Expression): ExpressionStatement; + function updateStatement(node: ExpressionStatement, expression: Expression): ExpressionStatement; + function createIf(expression: Expression, thenStatement: Statement, elseStatement?: Statement): IfStatement; + function updateIf(node: IfStatement, expression: Expression, thenStatement: Statement, elseStatement: Statement | undefined): IfStatement; + function createDo(statement: Statement, expression: Expression): DoStatement; + function updateDo(node: DoStatement, statement: Statement, expression: Expression): DoStatement; + function createWhile(expression: Expression, statement: Statement): WhileStatement; + function updateWhile(node: WhileStatement, expression: Expression, statement: Statement): WhileStatement; + function createFor(initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement): ForStatement; + function updateFor(node: ForStatement, initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement): ForStatement; + function createForIn(initializer: ForInitializer, expression: Expression, statement: Statement): ForInStatement; + function updateForIn(node: ForInStatement, initializer: ForInitializer, expression: Expression, statement: Statement): ForInStatement; + function createForOf(awaitModifier: AwaitKeywordToken, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement; + function updateForOf(node: ForOfStatement, awaitModifier: AwaitKeywordToken, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement; + function createContinue(label?: string | Identifier): ContinueStatement; + function updateContinue(node: ContinueStatement, label: Identifier | undefined): ContinueStatement; + function createBreak(label?: string | Identifier): BreakStatement; + function updateBreak(node: BreakStatement, label: Identifier | undefined): BreakStatement; + function createReturn(expression?: Expression): ReturnStatement; + function updateReturn(node: ReturnStatement, expression: Expression | undefined): ReturnStatement; + function createWith(expression: Expression, statement: Statement): WithStatement; + function updateWith(node: WithStatement, expression: Expression, statement: Statement): WithStatement; + function createSwitch(expression: Expression, caseBlock: CaseBlock): SwitchStatement; + function updateSwitch(node: SwitchStatement, expression: Expression, caseBlock: CaseBlock): SwitchStatement; + function createLabel(label: string | Identifier, statement: Statement): LabeledStatement; + function updateLabel(node: LabeledStatement, label: Identifier, statement: Statement): LabeledStatement; + function createThrow(expression: Expression): ThrowStatement; + function updateThrow(node: ThrowStatement, expression: Expression): ThrowStatement; + function createTry(tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined): TryStatement; + function updateTry(node: TryStatement, tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined): TryStatement; + function createFunctionDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration; + function updateFunctionDeclaration(node: FunctionDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration; + function createClassDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, heritageClauses: HeritageClause[], members: ClassElement[]): ClassDeclaration; + function updateClassDeclaration(node: ClassDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, heritageClauses: HeritageClause[], members: ClassElement[]): ClassDeclaration; + function createEnumDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | Identifier, members: EnumMember[]): EnumDeclaration; + function updateEnumDeclaration(node: EnumDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: Identifier, members: EnumMember[]): EnumDeclaration; + function createModuleDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration; + function updateModuleDeclaration(node: ModuleDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined): ModuleDeclaration; + function createModuleBlock(statements: Statement[]): ModuleBlock; + function updateModuleBlock(node: ModuleBlock, statements: Statement[]): ModuleBlock; + function createCaseBlock(clauses: CaseOrDefaultClause[]): CaseBlock; + function updateCaseBlock(node: CaseBlock, clauses: CaseOrDefaultClause[]): CaseBlock; + function createImportEqualsDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; + function updateImportEqualsDeclaration(node: ImportEqualsDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; + function createImportDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier?: Expression): ImportDeclaration; + function updateImportDeclaration(node: ImportDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression | undefined): ImportDeclaration; + function createImportClause(name: Identifier, namedBindings: NamedImportBindings): ImportClause; + function updateImportClause(node: ImportClause, name: Identifier, namedBindings: NamedImportBindings): ImportClause; + function createNamespaceImport(name: Identifier): NamespaceImport; + function updateNamespaceImport(node: NamespaceImport, name: Identifier): NamespaceImport; + function createNamedImports(elements: ImportSpecifier[]): NamedImports; + function updateNamedImports(node: NamedImports, elements: ImportSpecifier[]): NamedImports; + function createImportSpecifier(propertyName: Identifier | undefined, name: Identifier): ImportSpecifier; + function updateImportSpecifier(node: ImportSpecifier, propertyName: Identifier | undefined, name: Identifier): ImportSpecifier; + function createExportAssignment(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, isExportEquals: boolean, expression: Expression): ExportAssignment; + function updateExportAssignment(node: ExportAssignment, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, expression: Expression): ExportAssignment; + function createExportDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, exportClause: NamedExports | undefined, moduleSpecifier?: Expression): ExportDeclaration; + function updateExportDeclaration(node: ExportDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, exportClause: NamedExports | undefined, moduleSpecifier: Expression | undefined): ExportDeclaration; + function createNamedExports(elements: ExportSpecifier[]): NamedExports; + function updateNamedExports(node: NamedExports, elements: ExportSpecifier[]): NamedExports; + function createExportSpecifier(propertyName: string | Identifier | undefined, name: string | Identifier): ExportSpecifier; + function updateExportSpecifier(node: ExportSpecifier, propertyName: Identifier | undefined, name: Identifier): ExportSpecifier; + function createExternalModuleReference(expression: Expression): ExternalModuleReference; + function updateExternalModuleReference(node: ExternalModuleReference, expression: Expression): ExternalModuleReference; + function createJsxElement(openingElement: JsxOpeningElement, children: JsxChild[], closingElement: JsxClosingElement): JsxElement; + function updateJsxElement(node: JsxElement, openingElement: JsxOpeningElement, children: JsxChild[], closingElement: JsxClosingElement): JsxElement; + function createJsxSelfClosingElement(tagName: JsxTagNameExpression, attributes: JsxAttributes): JsxSelfClosingElement; + function updateJsxSelfClosingElement(node: JsxSelfClosingElement, tagName: JsxTagNameExpression, attributes: JsxAttributes): JsxSelfClosingElement; + function createJsxOpeningElement(tagName: JsxTagNameExpression, attributes: JsxAttributes): JsxOpeningElement; + function updateJsxOpeningElement(node: JsxOpeningElement, tagName: JsxTagNameExpression, attributes: JsxAttributes): JsxOpeningElement; + function createJsxClosingElement(tagName: JsxTagNameExpression): JsxClosingElement; + function updateJsxClosingElement(node: JsxClosingElement, tagName: JsxTagNameExpression): JsxClosingElement; + function createJsxAttributes(properties: JsxAttributeLike[]): JsxAttributes; + function updateJsxAttributes(jsxAttributes: JsxAttributes, properties: JsxAttributeLike[]): JsxAttributes; + function createJsxAttribute(name: Identifier, initializer: StringLiteral | JsxExpression): JsxAttribute; + function updateJsxAttribute(node: JsxAttribute, name: Identifier, initializer: StringLiteral | JsxExpression): JsxAttribute; + function createJsxSpreadAttribute(expression: Expression): JsxSpreadAttribute; + function updateJsxSpreadAttribute(node: JsxSpreadAttribute, expression: Expression): JsxSpreadAttribute; + function createJsxExpression(dotDotDotToken: DotDotDotToken | undefined, expression: Expression | undefined): JsxExpression; + function updateJsxExpression(node: JsxExpression, expression: Expression | undefined): JsxExpression; + function createHeritageClause(token: HeritageClause["token"], types: ExpressionWithTypeArguments[]): HeritageClause; + function updateHeritageClause(node: HeritageClause, types: ExpressionWithTypeArguments[]): HeritageClause; + function createCaseClause(expression: Expression, statements: Statement[]): CaseClause; + function updateCaseClause(node: CaseClause, expression: Expression, statements: Statement[]): CaseClause; + function createDefaultClause(statements: Statement[]): DefaultClause; + function updateDefaultClause(node: DefaultClause, statements: Statement[]): DefaultClause; + function createCatchClause(variableDeclaration: string | VariableDeclaration, block: Block): CatchClause; + function updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration, block: Block): CatchClause; + function createPropertyAssignment(name: string | PropertyName, initializer: Expression): PropertyAssignment; + function updatePropertyAssignment(node: PropertyAssignment, name: PropertyName, initializer: Expression): PropertyAssignment; + function createShorthandPropertyAssignment(name: string | Identifier, objectAssignmentInitializer?: Expression): ShorthandPropertyAssignment; + function updateShorthandPropertyAssignment(node: ShorthandPropertyAssignment, name: Identifier, objectAssignmentInitializer: Expression | undefined): ShorthandPropertyAssignment; + function createSpreadAssignment(expression: Expression): SpreadAssignment; + function updateSpreadAssignment(node: SpreadAssignment, expression: Expression): SpreadAssignment; + function createEnumMember(name: string | PropertyName, initializer?: Expression): EnumMember; + function updateEnumMember(node: EnumMember, name: PropertyName, initializer: Expression | undefined): EnumMember; + function updateSourceFileNode(node: SourceFile, statements: Statement[]): SourceFile; + /** + * Creates a shallow, memberwise clone of a node for mutation. + */ + function getMutableClone(node: T): T; + /** + * Creates a synthetic statement to act as a placeholder for a not-emitted statement in + * order to preserve comments. + * + * @param original The original statement. + */ + function createNotEmittedStatement(original: Node): NotEmittedStatement; + /** + * Creates a synthetic expression to act as a placeholder for a not-emitted expression in + * order to preserve comments or sourcemap positions. + * + * @param expression The inner expression to emit. + * @param original The original outer expression. + * @param location The location for the expression. Defaults to the positions from "original" if provided. + */ + function createPartiallyEmittedExpression(expression: Expression, original?: Node): PartiallyEmittedExpression; + function updatePartiallyEmittedExpression(node: PartiallyEmittedExpression, expression: Expression): PartiallyEmittedExpression; + function createBundle(sourceFiles: SourceFile[]): Bundle; + function updateBundle(node: Bundle, sourceFiles: SourceFile[]): Bundle; + function createComma(left: Expression, right: Expression): Expression; + function createLessThan(left: Expression, right: Expression): Expression; + function createAssignment(left: ObjectLiteralExpression | ArrayLiteralExpression, right: Expression): DestructuringAssignment; + function createAssignment(left: Expression, right: Expression): BinaryExpression; + function createStrictEquality(left: Expression, right: Expression): BinaryExpression; + function createStrictInequality(left: Expression, right: Expression): BinaryExpression; + function createAdd(left: Expression, right: Expression): BinaryExpression; + function createSubtract(left: Expression, right: Expression): BinaryExpression; + function createPostfixIncrement(operand: Expression): PostfixUnaryExpression; + function createLogicalAnd(left: Expression, right: Expression): BinaryExpression; + function createLogicalOr(left: Expression, right: Expression): BinaryExpression; + function createLogicalNot(operand: Expression): PrefixUnaryExpression; + function createVoidZero(): VoidExpression; + function createExportDefault(expression: Expression): ExportAssignment; + function createExternalModuleExport(exportName: Identifier): ExportDeclaration; + /** + * Clears any EmitNode entries from parse-tree nodes. + * @param sourceFile A source file. + */ + function disposeEmitNodes(sourceFile: SourceFile): void; + function setTextRange(range: T, location: TextRange | undefined): T; + /** + * Gets flags that control emit behavior of a node. + */ + function getEmitFlags(node: Node): EmitFlags | undefined; + /** + * Sets flags that control emit behavior of a node. + */ + function setEmitFlags(node: T, emitFlags: EmitFlags): T; + /** + * Gets a custom text range to use when emitting source maps. + */ + function getSourceMapRange(node: Node): TextRange; + /** + * Sets a custom text range to use when emitting source maps. + */ + function setSourceMapRange(node: T, range: TextRange | undefined): T; + /** + * Gets the TextRange to use for source maps for a token of a node. + */ + function getTokenSourceMapRange(node: Node, token: SyntaxKind): TextRange | undefined; + /** + * Sets the TextRange to use for source maps for a token of a node. + */ + function setTokenSourceMapRange(node: T, token: SyntaxKind, range: TextRange | undefined): T; + /** + * Gets a custom text range to use when emitting comments. + */ + function getCommentRange(node: Node): TextRange; + /** + * Sets a custom text range to use when emitting comments. + */ + function setCommentRange(node: T, range: TextRange): T; + function getSyntheticLeadingComments(node: Node): SynthesizedComment[] | undefined; + function setSyntheticLeadingComments(node: T, comments: SynthesizedComment[]): T; + function addSyntheticLeadingComment(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean): T; + function getSyntheticTrailingComments(node: Node): SynthesizedComment[] | undefined; + function setSyntheticTrailingComments(node: T, comments: SynthesizedComment[]): T; + function addSyntheticTrailingComment(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean): T; + /** + * Gets the constant value to emit for an expression. + */ + function getConstantValue(node: PropertyAccessExpression | ElementAccessExpression): number; + /** + * Sets the constant value to emit for an expression. + */ + function setConstantValue(node: PropertyAccessExpression | ElementAccessExpression, value: number): PropertyAccessExpression | ElementAccessExpression; + /** + * Adds an EmitHelper to a node. + */ + function addEmitHelper(node: T, helper: EmitHelper): T; + /** + * Add EmitHelpers to a node. + */ + function addEmitHelpers(node: T, helpers: EmitHelper[] | undefined): T; + /** + * Removes an EmitHelper from a node. + */ + function removeEmitHelper(node: Node, helper: EmitHelper): boolean; + /** + * Gets the EmitHelpers of a node. + */ + function getEmitHelpers(node: Node): EmitHelper[] | undefined; + /** + * Moves matching emit helpers from a source node to a target node. + */ + function moveEmitHelpers(source: Node, target: Node, predicate: (helper: EmitHelper) => boolean): void; + function setOriginalNode(node: T, original: Node | undefined): T; } declare namespace ts { function createNode(kind: SyntaxKind, pos?: number, end?: number): Node; @@ -2301,6 +3070,10 @@ declare namespace ts { function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; } declare namespace ts { + /** Array that is only intended to be pushed to, never read. */ + interface Push { + push(value: T): void; + } function moduleHasNonRelativeName(moduleName: string): boolean; function getEffectiveTypeRoots(options: CompilerOptions, host: { directoryExists?: (directoryName: string) => boolean; @@ -2313,17 +3086,120 @@ declare namespace ts { */ function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost): ResolvedTypeReferenceDirectiveWithFailedLookupLocations; /** - * Given a set of options, returns the set of type directive names - * that should be included for this program automatically. - * This list could either come from the config file, - * or from enumerating the types root + initial secondary types lookup location. - * More type directives might appear in the program later as a result of loading actual source files; - * this list is only the set of defaults that are implicitly included. - */ + * Given a set of options, returns the set of type directive names + * that should be included for this program automatically. + * This list could either come from the config file, + * or from enumerating the types root + initial secondary types lookup location. + * More type directives might appear in the program later as a result of loading actual source files; + * this list is only the set of defaults that are implicitly included. + */ function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): string[]; - function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations; - function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations; - function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations; + /** + * Cached module resolutions per containing directory. + * This assumes that any module id will have the same resolution for sibling files located in the same folder. + */ + interface ModuleResolutionCache extends NonRelativeModuleNameResolutionCache { + getOrCreateCacheForDirectory(directoryName: string): Map; + } + /** + * Stored map from non-relative module name to a table: directory -> result of module lookup in this directory + * We support only non-relative module names because resolution of relative module names is usually more deterministic and thus less expensive. + */ + interface NonRelativeModuleNameResolutionCache { + getOrCreateCacheForModuleName(nonRelativeModuleName: string): PerModuleNameCache; + } + interface PerModuleNameCache { + get(directory: string): ResolvedModuleWithFailedLookupLocations; + set(directory: string, result: ResolvedModuleWithFailedLookupLocations): void; + } + function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string): ModuleResolutionCache; + function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations; + function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations; + function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache): ResolvedModuleWithFailedLookupLocations; +} +declare namespace ts { + /** + * Visits a Node using the supplied visitor, possibly returning a new Node in its place. + * + * @param node The Node to visit. + * @param visitor The callback used to visit the Node. + * @param test A callback to execute to verify the Node is valid. + * @param lift An optional callback to execute to lift a NodeArray into a valid Node. + */ + function visitNode(node: T, visitor: Visitor, test?: (node: Node) => boolean, lift?: (node: NodeArray) => T): T; + /** + * Visits a Node using the supplied visitor, possibly returning a new Node in its place. + * + * @param node The Node to visit. + * @param visitor The callback used to visit the Node. + * @param test A callback to execute to verify the Node is valid. + * @param lift An optional callback to execute to lift a NodeArray into a valid Node. + */ + function visitNode(node: T | undefined, visitor: Visitor, test?: (node: Node) => boolean, lift?: (node: NodeArray) => T): T | undefined; + /** + * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place. + * + * @param nodes The NodeArray to visit. + * @param visitor The callback used to visit a Node. + * @param test A node test to execute for each node. + * @param start An optional value indicating the starting offset at which to start visiting. + * @param count An optional value indicating the maximum number of nodes to visit. + */ + function visitNodes(nodes: NodeArray, visitor: Visitor, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray; + /** + * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place. + * + * @param nodes The NodeArray to visit. + * @param visitor The callback used to visit a Node. + * @param test A node test to execute for each node. + * @param start An optional value indicating the starting offset at which to start visiting. + * @param count An optional value indicating the maximum number of nodes to visit. + */ + function visitNodes(nodes: NodeArray | undefined, visitor: Visitor, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray | undefined; + /** + * Starts a new lexical environment and visits a statement list, ending the lexical environment + * and merging hoisted declarations upon completion. + */ + function visitLexicalEnvironment(statements: NodeArray, visitor: Visitor, context: TransformationContext, start?: number, ensureUseStrict?: boolean): NodeArray; + /** + * Starts a new lexical environment and visits a parameter list, suspending the lexical + * environment upon completion. + */ + function visitParameterList(nodes: NodeArray, visitor: Visitor, context: TransformationContext, nodesVisitor?: typeof visitNodes): NodeArray; + /** + * Resumes a suspended lexical environment and visits a function body, ending the lexical + * environment and merging hoisted declarations upon completion. + */ + function visitFunctionBody(node: FunctionBody, visitor: Visitor, context: TransformationContext): FunctionBody; + /** + * Resumes a suspended lexical environment and visits a function body, ending the lexical + * environment and merging hoisted declarations upon completion. + */ + function visitFunctionBody(node: FunctionBody | undefined, visitor: Visitor, context: TransformationContext): FunctionBody | undefined; + /** + * Resumes a suspended lexical environment and visits a concise body, ending the lexical + * environment and merging hoisted declarations upon completion. + */ + function visitFunctionBody(node: ConciseBody, visitor: Visitor, context: TransformationContext): ConciseBody; + /** + * Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place. + * + * @param node The Node whose children will be visited. + * @param visitor The callback used to visit each child. + * @param context A lexical environment context for the visitor. + */ + function visitEachChild(node: T, visitor: Visitor, context: TransformationContext): T; + /** + * Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place. + * + * @param node The Node whose children will be visited. + * @param visitor The callback used to visit each child. + * @param context A lexical environment context for the visitor. + */ + function visitEachChild(node: T | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: typeof visitNodes, tokenVisitor?: Visitor): T | undefined; +} +declare namespace ts { + function createPrinter(printerOptions?: PrinterOptions, handlers?: PrintHandlers): Printer; } declare namespace ts { function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string; @@ -2340,31 +3216,32 @@ declare namespace ts { function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost, oldProgram?: Program): Program; } declare namespace ts { + function parseCommandLine(commandLine: string[], readFile?: (path: string) => string): ParsedCommandLine; /** - * Read tsconfig.json file - * @param fileName The path to the config file - */ + * Read tsconfig.json file + * @param fileName The path to the config file + */ function readConfigFile(fileName: string, readFile: (path: string) => string): { config?: any; error?: Diagnostic; }; /** - * Parse the text of the tsconfig.json file - * @param fileName The path to the config file - * @param jsonText The text of the config file - */ + * Parse the text of the tsconfig.json file + * @param fileName The path to the config file + * @param jsonText The text of the config file + */ function parseConfigFileTextToJson(fileName: string, jsonText: string, stripComments?: boolean): { config?: any; error?: Diagnostic; }; /** - * Parse the contents of a config file (tsconfig.json). - * @param json The contents of the config file to parse - * @param host Instance of ParseConfigHost used to enumerate files in folder. - * @param basePath A root directory to resolve relative path entries in the config - * file to. e.g. outDir - */ - function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[]): ParsedCommandLine; + * Parse the contents of a config file (tsconfig.json). + * @param json The contents of the config file to parse + * @param host Instance of ParseConfigHost used to enumerate files in folder. + * @param basePath A root directory to resolve relative path entries in the config + * file to. e.g. outDir + */ + function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: JsFileExtensionInfo[]): ParsedCommandLine; function convertCompileOnSaveOptionFromJson(jsonOption: any, basePath: string, errors: Diagnostic[]): boolean; function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): { options: CompilerOptions; @@ -2391,12 +3268,14 @@ declare namespace ts { getText(sourceFile?: SourceFile): string; getFirstToken(sourceFile?: SourceFile): Node; getLastToken(sourceFile?: SourceFile): Node; + forEachChild(cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; } interface Symbol { getFlags(): SymbolFlags; getName(): string; getDeclarations(): Declaration[]; getDocumentationComment(): SymbolDisplayPart[]; + getJsDocTags(): JSDocTagInfo[]; } interface Type { getFlags(): TypeFlags; @@ -2408,15 +3287,16 @@ declare namespace ts { getConstructSignatures(): Signature[]; getStringIndexType(): Type; getNumberIndexType(): Type; - getBaseTypes(): ObjectType[]; + getBaseTypes(): BaseType[]; getNonNullableType(): Type; } interface Signature { getDeclaration(): SignatureDeclaration; - getTypeParameters(): Type[]; + getTypeParameters(): TypeParameter[]; getParameters(): Symbol[]; getReturnType(): Type; getDocumentationComment(): SymbolDisplayPart[]; + getJsDocTags(): JSDocTagInfo[]; } interface SourceFile { getLineAndCharacterOfPosition(pos: number): LineAndCharacter; @@ -2425,6 +3305,9 @@ declare namespace ts { getPositionOfLineAndCharacter(line: number, character: number): number; update(newText: string, textChangeRange: TextChangeRange): SourceFile; } + interface SourceFileLike { + getLineAndCharacterOfPosition(pos: number): LineAndCharacter; + } /** * Represents an immutable snapshot of a script at a specified time.Once acquired, the * snapshot is observably immutable. i.e. the same calls with the same parameters will return @@ -2483,6 +3366,10 @@ declare namespace ts { resolveTypeReferenceDirectives?(typeDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[]; directoryExists?(directoryName: string): boolean; getDirectories?(directoryName: string): string[]; + /** + * Gets a set of custom transformers to use during emit. + */ + getCustomTransformers?(): CustomTransformers | undefined; } interface LanguageService { cleanupSemanticCache(): void; @@ -2528,7 +3415,7 @@ declare namespace ts { getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; getDocCommentTemplateAtPosition(fileName: string, position: number): TextInsertion; isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean; - getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[]): CodeAction[]; + getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[]; getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput; getProgram(): Program; dispose(): void; @@ -2604,19 +3491,20 @@ declare namespace ts { /** The position in newText the caret should point to after the insertion. */ caretOffset: number; } - interface RenameLocation { + interface DocumentSpan { textSpan: TextSpan; fileName: string; } - interface ReferenceEntry { - textSpan: TextSpan; - fileName: string; + interface RenameLocation extends DocumentSpan { + } + interface ReferenceEntry extends DocumentSpan { isWriteAccess: boolean; isDefinition: boolean; + isInString?: true; } - interface ImplementationLocation { - textSpan: TextSpan; - fileName: string; + interface ImplementationLocation extends DocumentSpan { + kind: string; + displayParts: SymbolDisplayPart[]; } interface DocumentHighlights { fileName: string; @@ -2630,6 +3518,7 @@ declare namespace ts { } interface HighlightSpan { fileName?: string; + isInString?: true; textSpan: TextSpan; kind: string; } @@ -2669,6 +3558,7 @@ declare namespace ts { InsertSpaceAfterCommaDelimiter: boolean; InsertSpaceAfterSemicolonInForStatements: boolean; InsertSpaceBeforeAndAfterBinaryOperators: boolean; + InsertSpaceAfterConstructor?: boolean; InsertSpaceAfterKeywordsInControlFlowStatements: boolean; InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; @@ -2677,6 +3567,7 @@ declare namespace ts { InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: boolean; InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean; InsertSpaceAfterTypeAssertion?: boolean; + InsertSpaceBeforeFunctionParenthesis?: boolean; PlaceOpenBraceOnNewLineForFunctions: boolean; PlaceOpenBraceOnNewLineForControlBlocks: boolean; } @@ -2684,6 +3575,7 @@ declare namespace ts { insertSpaceAfterCommaDelimiter?: boolean; insertSpaceAfterSemicolonInForStatements?: boolean; insertSpaceBeforeAndAfterBinaryOperators?: boolean; + insertSpaceAfterConstructor?: boolean; insertSpaceAfterKeywordsInControlFlowStatements?: boolean; insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean; insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean; @@ -2692,6 +3584,7 @@ declare namespace ts { insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean; insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean; insertSpaceAfterTypeAssertion?: boolean; + insertSpaceBeforeFunctionParenthesis?: boolean; placeOpenBraceOnNewLineForFunctions?: boolean; placeOpenBraceOnNewLineForControlBlocks?: boolean; } @@ -2738,12 +3631,17 @@ declare namespace ts { text: string; kind: string; } + interface JSDocTagInfo { + name: string; + text?: string; + } interface QuickInfo { kind: string; kindModifiers: string; textSpan: TextSpan; displayParts: SymbolDisplayPart[]; documentation: SymbolDisplayPart[]; + tags: JSDocTagInfo[]; } interface RenameInfo { canRename: boolean; @@ -2774,6 +3672,7 @@ declare namespace ts { separatorDisplayParts: SymbolDisplayPart[]; parameters: SignatureHelpParameter[]; documentation: SymbolDisplayPart[]; + tags: JSDocTagInfo[]; } /** * Represents a set of signature help items, and the preferred item that should be selected. @@ -2800,10 +3699,10 @@ declare namespace ts { kindModifiers: string; sortText: string; /** - * An optional span that indicates the text to be replaced by this completion item. It will be - * set if the required span differs from the one generated by the default replacement behavior and should - * be used in that case - */ + * An optional span that indicates the text to be replaced by this completion item. It will be + * set if the required span differs from the one generated by the default replacement behavior and should + * be used in that case + */ replacementSpan?: TextSpan; } interface CompletionEntryDetails { @@ -2812,6 +3711,7 @@ declare namespace ts { kindModifiers: string; displayParts: SymbolDisplayPart[]; documentation: SymbolDisplayPart[]; + tags: JSDocTagInfo[]; } interface OutliningSpan { /** The span of the document to actually collapse. */ @@ -2821,9 +3721,9 @@ declare namespace ts { /** The text to display in the editor for the collapsed region. */ bannerText: string; /** - * Whether or not this region should be automatically collapsed when - * the 'Collapse to Definitions' command is invoked. - */ + * Whether or not this region should be automatically collapsed when + * the 'Collapse to Definitions' command is invoked. + */ autoCollapse: boolean; } interface EmitOutput { @@ -2911,7 +3811,7 @@ declare namespace ts { const typeElement = "type"; /** enum E */ const enumElement = "enum"; - const enumMemberElement = "const"; + const enumMemberElement = "enum member"; /** * Inside module and script only * const v = .. @@ -2954,6 +3854,10 @@ declare namespace ts { const letElement = "let"; const directory = "directory"; const externalModuleName = "external module name"; + /** + * + */ + const jsxAttribute = "JSX attribute"; } namespace ScriptElementKindModifier { const none = ""; @@ -3022,61 +3926,61 @@ declare namespace ts { } declare namespace ts { /** - * The document registry represents a store of SourceFile objects that can be shared between - * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) - * of files in the context. - * SourceFile objects account for most of the memory usage by the language service. Sharing - * the same DocumentRegistry instance between different instances of LanguageService allow - * for more efficient memory utilization since all projects will share at least the library - * file (lib.d.ts). - * - * A more advanced use of the document registry is to serialize sourceFile objects to disk - * and re-hydrate them when needed. - * - * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it - * to all subsequent createLanguageService calls. - */ + * The document registry represents a store of SourceFile objects that can be shared between + * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) + * of files in the context. + * SourceFile objects account for most of the memory usage by the language service. Sharing + * the same DocumentRegistry instance between different instances of LanguageService allow + * for more efficient memory utilization since all projects will share at least the library + * file (lib.d.ts). + * + * A more advanced use of the document registry is to serialize sourceFile objects to disk + * and re-hydrate them when needed. + * + * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it + * to all subsequent createLanguageService calls. + */ interface DocumentRegistry { /** - * Request a stored SourceFile with a given fileName and compilationSettings. - * The first call to acquire will call createLanguageServiceSourceFile to generate - * the SourceFile if was not found in the registry. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @parm scriptSnapshot Text of the file. Only used if the file was not found - * in the registry and a new one was created. - * @parm version Current version of the file. Only used if the file was not found - * in the registry and a new one was created. - */ + * Request a stored SourceFile with a given fileName and compilationSettings. + * The first call to acquire will call createLanguageServiceSourceFile to generate + * the SourceFile if was not found in the registry. + * + * @param fileName The name of the file requested + * @param compilationSettings Some compilation settings like target affects the + * shape of a the resulting SourceFile. This allows the DocumentRegistry to store + * multiple copies of the same file for different compilation settings. + * @parm scriptSnapshot Text of the file. Only used if the file was not found + * in the registry and a new one was created. + * @parm version Current version of the file. Only used if the file was not found + * in the registry and a new one was created. + */ acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile; acquireDocumentWithKey(fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile; /** - * Request an updated version of an already existing SourceFile with a given fileName - * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile - * to get an updated SourceFile. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @param scriptSnapshot Text of the file. - * @param version Current version of the file. - */ + * Request an updated version of an already existing SourceFile with a given fileName + * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile + * to get an updated SourceFile. + * + * @param fileName The name of the file requested + * @param compilationSettings Some compilation settings like target affects the + * shape of a the resulting SourceFile. This allows the DocumentRegistry to store + * multiple copies of the same file for different compilation settings. + * @param scriptSnapshot Text of the file. + * @param version Current version of the file. + */ updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile; updateDocumentWithKey(fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile; getKeyForCompilationSettings(settings: CompilerOptions): DocumentRegistryBucketKey; /** - * Informs the DocumentRegistry that a file is not needed any longer. - * - * Note: It is not allowed to call release on a SourceFile that was not acquired from - * this registry originally. - * - * @param fileName The name of the file to be released - * @param compilationSettings The compilation settings used to acquire the file - */ + * Informs the DocumentRegistry that a file is not needed any longer. + * + * Note: It is not allowed to call release on a SourceFile that was not acquired from + * this registry originally. + * + * @param fileName The name of the file to be released + * @param compilationSettings The compilation settings used to acquire the file + */ releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey): void; reportStats(): string; @@ -3120,11 +4024,20 @@ declare namespace ts { function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; /** - * Get the path of the default library files (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ + * Get the path of the default library files (lib.d.ts) as distributed with the typescript + * node package. + * The functionality is not supported if the ts module is consumed outside of a node module. + */ function getDefaultLibFilePath(options: CompilerOptions): string; } +declare namespace ts { + /** + * Transform one or more nodes using the supplied transformers. + * @param source A single `Node` or an array of `Node` objects. + * @param transformers An array of `TransformerFactory` callbacks used to process the transformation. + * @param compilerOptions Optional compiler options. + */ + function transform(source: T | T[], transformers: TransformerFactory[], compilerOptions?: CompilerOptions): TransformationResult; +} export = ts; \ No newline at end of file diff --git a/node_modules/typescript/lib/typescript.js b/node_modules/typescript/lib/typescript.js index d4ad545cf..ad7cbabef 100644 --- a/node_modules/typescript/lib/typescript.js +++ b/node_modules/typescript/lib/typescript.js @@ -13,11 +13,24 @@ See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; }; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var ts; (function (ts) { // token > SyntaxKind.Identifer => token is a keyword @@ -168,191 +181,191 @@ var ts; SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 130] = "ReadonlyKeyword"; SyntaxKind[SyntaxKind["RequireKeyword"] = 131] = "RequireKeyword"; SyntaxKind[SyntaxKind["NumberKeyword"] = 132] = "NumberKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 133] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 134] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 135] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 136] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 137] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 138] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 139] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 140] = "OfKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 133] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 134] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 135] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 136] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 137] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 138] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 139] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 140] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 141] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 141] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 142] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 142] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 143] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 143] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 144] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 145] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 144] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 145] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 146] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 146] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 147] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 148] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 149] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 150] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 151] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 152] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 153] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 154] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 155] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 147] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 148] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 149] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 150] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 151] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 152] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 153] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 154] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 155] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 156] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 156] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 157] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 158] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 159] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 160] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 161] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 162] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 163] = "TupleType"; - SyntaxKind[SyntaxKind["UnionType"] = 164] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 165] = "IntersectionType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 166] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 167] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 168] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 169] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 170] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 171] = "LiteralType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 157] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 158] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 159] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 160] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 161] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 162] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 163] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 164] = "TupleType"; + SyntaxKind[SyntaxKind["UnionType"] = 165] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 166] = "IntersectionType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 167] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 168] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 169] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 170] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 171] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 172] = "LiteralType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 172] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 173] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 174] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 173] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 174] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 175] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 175] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 176] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 177] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 178] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 179] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 180] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 181] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 182] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 183] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 184] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 185] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 186] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 187] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 188] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 189] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 190] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 191] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 192] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 193] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 194] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 195] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 196] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 197] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 198] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 199] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 200] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 201] = "NonNullExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 176] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 177] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 178] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 179] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 180] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 181] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 182] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 183] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 184] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 185] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 186] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 187] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 188] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 189] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 190] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 191] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 192] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 193] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 194] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 195] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 196] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 197] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 198] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 199] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 200] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 201] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 202] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 203] = "MetaProperty"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 202] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 203] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 204] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 205] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 204] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 205] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 206] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 207] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 208] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 209] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 210] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 211] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 212] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 213] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 214] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 215] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 216] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 217] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 218] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 219] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 220] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 221] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 222] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 223] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 224] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 225] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 226] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 227] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 228] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 229] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 230] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 231] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 232] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 233] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 234] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 235] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 236] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 237] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 238] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 239] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 240] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 241] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 242] = "NamedExports"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 243] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 244] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 206] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 207] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 208] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 209] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 210] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 211] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 212] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 213] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 214] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 215] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 216] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 217] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 218] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 219] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 220] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 221] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 222] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 223] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 224] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 225] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 226] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 227] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 228] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 229] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 230] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 231] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 232] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 233] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 234] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 235] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 236] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 237] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 238] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 239] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 240] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 241] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 242] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 243] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 244] = "NamedExports"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 245] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 246] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 245] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 247] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 246] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 247] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 248] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 249] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 250] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 251] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 252] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 248] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 249] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 250] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 251] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 252] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 253] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 254] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 255] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 253] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 254] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 255] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 256] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 256] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 257] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 258] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 259] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 257] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 258] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 259] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 260] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 261] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 262] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 260] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 263] = "EnumMember"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 261] = "SourceFile"; + SyntaxKind[SyntaxKind["SourceFile"] = 264] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 265] = "Bundle"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 262] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 266] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 263] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 267] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 264] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocArrayType"] = 265] = "JSDocArrayType"; - SyntaxKind[SyntaxKind["JSDocUnionType"] = 266] = "JSDocUnionType"; - SyntaxKind[SyntaxKind["JSDocTupleType"] = 267] = "JSDocTupleType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 268] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 269] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocRecordType"] = 270] = "JSDocRecordType"; - SyntaxKind[SyntaxKind["JSDocRecordMember"] = 271] = "JSDocRecordMember"; - SyntaxKind[SyntaxKind["JSDocTypeReference"] = 272] = "JSDocTypeReference"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 273] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 274] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 275] = "JSDocVariadicType"; - SyntaxKind[SyntaxKind["JSDocConstructorType"] = 276] = "JSDocConstructorType"; - SyntaxKind[SyntaxKind["JSDocThisType"] = 277] = "JSDocThisType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 278] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTag"] = 279] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 280] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 281] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 282] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 283] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 284] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 285] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 286] = "JSDocPropertyTag"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 287] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocLiteralType"] = 288] = "JSDocLiteralType"; - SyntaxKind[SyntaxKind["JSDocNullKeyword"] = 289] = "JSDocNullKeyword"; - SyntaxKind[SyntaxKind["JSDocUndefinedKeyword"] = 290] = "JSDocUndefinedKeyword"; - SyntaxKind[SyntaxKind["JSDocNeverKeyword"] = 291] = "JSDocNeverKeyword"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 268] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocArrayType"] = 269] = "JSDocArrayType"; + SyntaxKind[SyntaxKind["JSDocUnionType"] = 270] = "JSDocUnionType"; + SyntaxKind[SyntaxKind["JSDocTupleType"] = 271] = "JSDocTupleType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 272] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 273] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocRecordType"] = 274] = "JSDocRecordType"; + SyntaxKind[SyntaxKind["JSDocRecordMember"] = 275] = "JSDocRecordMember"; + SyntaxKind[SyntaxKind["JSDocTypeReference"] = 276] = "JSDocTypeReference"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 277] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 278] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 279] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocConstructorType"] = 280] = "JSDocConstructorType"; + SyntaxKind[SyntaxKind["JSDocThisType"] = 281] = "JSDocThisType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 282] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTag"] = 283] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 284] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 285] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 286] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 287] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 288] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 289] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 290] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 291] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocLiteralType"] = 292] = "JSDocLiteralType"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 292] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 293] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 293] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 294] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 295] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 296] = "EndOfDeclarationMarker"; - SyntaxKind[SyntaxKind["RawExpression"] = 297] = "RawExpression"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 294] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 295] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 296] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 297] = "EndOfDeclarationMarker"; // Enum value count SyntaxKind[SyntaxKind["Count"] = 298] = "Count"; // Markers @@ -363,15 +376,15 @@ var ts; SyntaxKind[SyntaxKind["FirstReservedWord"] = 71] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 106] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 71] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 140] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 141] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 107] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 115] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 156] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 171] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 157] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 172] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 16] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 69] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 140] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 141] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -380,11 +393,11 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 15] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 26] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 69] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstNode"] = 141] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 262] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 288] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 278] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 291] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["FirstNode"] = 142] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 266] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 292] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 282] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 292] = "LastJSDocTagNode"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -399,28 +412,22 @@ var ts; NodeFlags[NodeFlags["HasImplicitReturn"] = 128] = "HasImplicitReturn"; NodeFlags[NodeFlags["HasExplicitReturn"] = 256] = "HasExplicitReturn"; NodeFlags[NodeFlags["GlobalAugmentation"] = 512] = "GlobalAugmentation"; - NodeFlags[NodeFlags["HasClassExtends"] = 1024] = "HasClassExtends"; - NodeFlags[NodeFlags["HasDecorators"] = 2048] = "HasDecorators"; - NodeFlags[NodeFlags["HasParamDecorators"] = 4096] = "HasParamDecorators"; - NodeFlags[NodeFlags["HasAsyncFunctions"] = 8192] = "HasAsyncFunctions"; - NodeFlags[NodeFlags["HasSpreadAttribute"] = 16384] = "HasSpreadAttribute"; - NodeFlags[NodeFlags["HasRestAttribute"] = 32768] = "HasRestAttribute"; - NodeFlags[NodeFlags["DisallowInContext"] = 65536] = "DisallowInContext"; - NodeFlags[NodeFlags["YieldContext"] = 131072] = "YieldContext"; - NodeFlags[NodeFlags["DecoratorContext"] = 262144] = "DecoratorContext"; - NodeFlags[NodeFlags["AwaitContext"] = 524288] = "AwaitContext"; - NodeFlags[NodeFlags["ThisNodeHasError"] = 1048576] = "ThisNodeHasError"; - NodeFlags[NodeFlags["JavaScriptFile"] = 2097152] = "JavaScriptFile"; - NodeFlags[NodeFlags["ThisNodeOrAnySubNodesHasError"] = 4194304] = "ThisNodeOrAnySubNodesHasError"; - NodeFlags[NodeFlags["HasAggregatedChildData"] = 8388608] = "HasAggregatedChildData"; + NodeFlags[NodeFlags["HasAsyncFunctions"] = 1024] = "HasAsyncFunctions"; + NodeFlags[NodeFlags["DisallowInContext"] = 2048] = "DisallowInContext"; + NodeFlags[NodeFlags["YieldContext"] = 4096] = "YieldContext"; + NodeFlags[NodeFlags["DecoratorContext"] = 8192] = "DecoratorContext"; + NodeFlags[NodeFlags["AwaitContext"] = 16384] = "AwaitContext"; + NodeFlags[NodeFlags["ThisNodeHasError"] = 32768] = "ThisNodeHasError"; + NodeFlags[NodeFlags["JavaScriptFile"] = 65536] = "JavaScriptFile"; + NodeFlags[NodeFlags["ThisNodeOrAnySubNodesHasError"] = 131072] = "ThisNodeOrAnySubNodesHasError"; + NodeFlags[NodeFlags["HasAggregatedChildData"] = 262144] = "HasAggregatedChildData"; NodeFlags[NodeFlags["BlockScoped"] = 3] = "BlockScoped"; NodeFlags[NodeFlags["ReachabilityCheckFlags"] = 384] = "ReachabilityCheckFlags"; - NodeFlags[NodeFlags["EmitHelperFlags"] = 64512] = "EmitHelperFlags"; - NodeFlags[NodeFlags["ReachabilityAndEmitFlags"] = 64896] = "ReachabilityAndEmitFlags"; + NodeFlags[NodeFlags["ReachabilityAndEmitFlags"] = 1408] = "ReachabilityAndEmitFlags"; // Parsing context flags - NodeFlags[NodeFlags["ContextFlags"] = 3080192] = "ContextFlags"; + NodeFlags[NodeFlags["ContextFlags"] = 96256] = "ContextFlags"; // Exclude these flags when parsing a Type - NodeFlags[NodeFlags["TypeExcludesFlags"] = 655360] = "TypeExcludesFlags"; + NodeFlags[NodeFlags["TypeExcludesFlags"] = 20480] = "TypeExcludesFlags"; })(NodeFlags = ts.NodeFlags || (ts.NodeFlags = {})); var ModifierFlags; (function (ModifierFlags) { @@ -469,6 +476,17 @@ var ts; GeneratedIdentifierKind[GeneratedIdentifierKind["Unique"] = 3] = "Unique"; GeneratedIdentifierKind[GeneratedIdentifierKind["Node"] = 4] = "Node"; })(GeneratedIdentifierKind = ts.GeneratedIdentifierKind || (ts.GeneratedIdentifierKind = {})); + /* @internal */ + var NumericLiteralFlags; + (function (NumericLiteralFlags) { + NumericLiteralFlags[NumericLiteralFlags["None"] = 0] = "None"; + NumericLiteralFlags[NumericLiteralFlags["Scientific"] = 2] = "Scientific"; + NumericLiteralFlags[NumericLiteralFlags["Octal"] = 4] = "Octal"; + NumericLiteralFlags[NumericLiteralFlags["HexSpecifier"] = 8] = "HexSpecifier"; + NumericLiteralFlags[NumericLiteralFlags["BinarySpecifier"] = 16] = "BinarySpecifier"; + NumericLiteralFlags[NumericLiteralFlags["OctalSpecifier"] = 32] = "OctalSpecifier"; + NumericLiteralFlags[NumericLiteralFlags["BinaryOrOctalSpecifier"] = 48] = "BinaryOrOctalSpecifier"; + })(NumericLiteralFlags = ts.NumericLiteralFlags || (ts.NumericLiteralFlags = {})); var FlowFlags; (function (FlowFlags) { FlowFlags[FlowFlags["Unreachable"] = 1] = "Unreachable"; @@ -482,6 +500,8 @@ var ts; FlowFlags[FlowFlags["ArrayMutation"] = 256] = "ArrayMutation"; FlowFlags[FlowFlags["Referenced"] = 512] = "Referenced"; FlowFlags[FlowFlags["Shared"] = 1024] = "Shared"; + FlowFlags[FlowFlags["PreFinally"] = 2048] = "PreFinally"; + FlowFlags[FlowFlags["AfterFinally"] = 4096] = "AfterFinally"; FlowFlags[FlowFlags["Label"] = 12] = "Label"; FlowFlags[FlowFlags["Condition"] = 96] = "Condition"; })(FlowFlags = ts.FlowFlags || (ts.FlowFlags = {})); @@ -503,6 +523,16 @@ var ts; // Diagnostics were produced and outputs were generated in spite of them. ExitStatus[ExitStatus["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated"; })(ExitStatus = ts.ExitStatus || (ts.ExitStatus = {})); + var NodeBuilderFlags; + (function (NodeBuilderFlags) { + NodeBuilderFlags[NodeBuilderFlags["None"] = 0] = "None"; + NodeBuilderFlags[NodeBuilderFlags["allowThisInObjectLiteral"] = 1] = "allowThisInObjectLiteral"; + NodeBuilderFlags[NodeBuilderFlags["allowQualifedNameInPlaceOfIdentifier"] = 2] = "allowQualifedNameInPlaceOfIdentifier"; + NodeBuilderFlags[NodeBuilderFlags["allowTypeParameterInQualifiedName"] = 4] = "allowTypeParameterInQualifiedName"; + NodeBuilderFlags[NodeBuilderFlags["allowAnonymousIdentifier"] = 8] = "allowAnonymousIdentifier"; + NodeBuilderFlags[NodeBuilderFlags["allowEmptyUnionOrIntersection"] = 16] = "allowEmptyUnionOrIntersection"; + NodeBuilderFlags[NodeBuilderFlags["allowEmptyTuple"] = 32] = "allowEmptyTuple"; + })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {})); var TypeFormatFlags; (function (TypeFormatFlags) { TypeFormatFlags[TypeFormatFlags["None"] = 0] = "None"; @@ -517,6 +547,8 @@ var ts; TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 256] = "InFirstTypeArgument"; TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 512] = "InTypeAlias"; TypeFormatFlags[TypeFormatFlags["UseTypeAliasValue"] = 1024] = "UseTypeAliasValue"; + TypeFormatFlags[TypeFormatFlags["SuppressAnyReturnType"] = 2048] = "SuppressAnyReturnType"; + TypeFormatFlags[TypeFormatFlags["AddUndefined"] = 4096] = "AddUndefined"; })(TypeFormatFlags = ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); var SymbolFormatFlags; (function (SymbolFormatFlags) { @@ -549,8 +581,7 @@ var ts; TypePredicateKind[TypePredicateKind["This"] = 0] = "This"; TypePredicateKind[TypePredicateKind["Identifier"] = 1] = "Identifier"; })(TypePredicateKind = ts.TypePredicateKind || (ts.TypePredicateKind = {})); - /** Indicates how to serialize the name for a TypeReferenceNode when emitting decorator - * metadata */ + /** Indicates how to serialize the name for a TypeReferenceNode when emitting decorator metadata */ /* @internal */ var TypeReferenceSerializationKind; (function (TypeReferenceSerializationKind) { @@ -598,13 +629,10 @@ var ts; SymbolFlags[SymbolFlags["ExportType"] = 2097152] = "ExportType"; SymbolFlags[SymbolFlags["ExportNamespace"] = 4194304] = "ExportNamespace"; SymbolFlags[SymbolFlags["Alias"] = 8388608] = "Alias"; - SymbolFlags[SymbolFlags["Instantiated"] = 16777216] = "Instantiated"; - SymbolFlags[SymbolFlags["Merged"] = 33554432] = "Merged"; - SymbolFlags[SymbolFlags["Transient"] = 67108864] = "Transient"; - SymbolFlags[SymbolFlags["Prototype"] = 134217728] = "Prototype"; - SymbolFlags[SymbolFlags["SyntheticProperty"] = 268435456] = "SyntheticProperty"; - SymbolFlags[SymbolFlags["Optional"] = 536870912] = "Optional"; - SymbolFlags[SymbolFlags["ExportStar"] = 1073741824] = "ExportStar"; + SymbolFlags[SymbolFlags["Prototype"] = 16777216] = "Prototype"; + SymbolFlags[SymbolFlags["ExportStar"] = 33554432] = "ExportStar"; + SymbolFlags[SymbolFlags["Optional"] = 67108864] = "Optional"; + SymbolFlags[SymbolFlags["Transient"] = 134217728] = "Transient"; SymbolFlags[SymbolFlags["Enum"] = 384] = "Enum"; SymbolFlags[SymbolFlags["Variable"] = 3] = "Variable"; SymbolFlags[SymbolFlags["Value"] = 107455] = "Value"; @@ -648,11 +676,27 @@ var ts; SymbolFlags[SymbolFlags["Classifiable"] = 788448] = "Classifiable"; })(SymbolFlags = ts.SymbolFlags || (ts.SymbolFlags = {})); /* @internal */ + var CheckFlags; + (function (CheckFlags) { + CheckFlags[CheckFlags["Instantiated"] = 1] = "Instantiated"; + CheckFlags[CheckFlags["SyntheticProperty"] = 2] = "SyntheticProperty"; + CheckFlags[CheckFlags["SyntheticMethod"] = 4] = "SyntheticMethod"; + CheckFlags[CheckFlags["Readonly"] = 8] = "Readonly"; + CheckFlags[CheckFlags["Partial"] = 16] = "Partial"; + CheckFlags[CheckFlags["HasNonUniformType"] = 32] = "HasNonUniformType"; + CheckFlags[CheckFlags["ContainsPublic"] = 64] = "ContainsPublic"; + CheckFlags[CheckFlags["ContainsProtected"] = 128] = "ContainsProtected"; + CheckFlags[CheckFlags["ContainsPrivate"] = 256] = "ContainsPrivate"; + CheckFlags[CheckFlags["ContainsStatic"] = 512] = "ContainsStatic"; + CheckFlags[CheckFlags["Synthetic"] = 6] = "Synthetic"; + })(CheckFlags = ts.CheckFlags || (ts.CheckFlags = {})); + /* @internal */ var NodeCheckFlags; (function (NodeCheckFlags) { NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 1] = "TypeChecked"; NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 2] = "LexicalThis"; NodeCheckFlags[NodeCheckFlags["CaptureThis"] = 4] = "CaptureThis"; + NodeCheckFlags[NodeCheckFlags["CaptureNewTarget"] = 8] = "CaptureNewTarget"; NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 256] = "SuperInstance"; NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 512] = "SuperStatic"; NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 1024] = "ContextChecked"; @@ -701,6 +745,9 @@ var ts; TypeFlags[TypeFlags["ContainsObjectLiteral"] = 4194304] = "ContainsObjectLiteral"; /* @internal */ TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 8388608] = "ContainsAnyFunctionType"; + TypeFlags[TypeFlags["NonPrimitive"] = 16777216] = "NonPrimitive"; + /* @internal */ + TypeFlags[TypeFlags["JsxAttributes"] = 33554432] = "JsxAttributes"; /* @internal */ TypeFlags[TypeFlags["Nullable"] = 6144] = "Nullable"; TypeFlags[TypeFlags["Literal"] = 480] = "Literal"; @@ -709,7 +756,7 @@ var ts; TypeFlags[TypeFlags["DefinitelyFalsy"] = 7392] = "DefinitelyFalsy"; TypeFlags[TypeFlags["PossiblyFalsy"] = 7406] = "PossiblyFalsy"; /* @internal */ - TypeFlags[TypeFlags["Intrinsic"] = 16015] = "Intrinsic"; + TypeFlags[TypeFlags["Intrinsic"] = 16793231] = "Intrinsic"; /* @internal */ TypeFlags[TypeFlags["Primitive"] = 8190] = "Primitive"; TypeFlags[TypeFlags["StringLike"] = 262178] = "StringLike"; @@ -718,11 +765,12 @@ var ts; TypeFlags[TypeFlags["EnumLike"] = 272] = "EnumLike"; TypeFlags[TypeFlags["UnionOrIntersection"] = 196608] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 229376] = "StructuredType"; - TypeFlags[TypeFlags["StructuredOrTypeParameter"] = 507904] = "StructuredOrTypeParameter"; + TypeFlags[TypeFlags["StructuredOrTypeVariable"] = 1032192] = "StructuredOrTypeVariable"; + TypeFlags[TypeFlags["TypeVariable"] = 540672] = "TypeVariable"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never - TypeFlags[TypeFlags["Narrowable"] = 1033215] = "Narrowable"; - TypeFlags[TypeFlags["NotUnionOrUnit"] = 33281] = "NotUnionOrUnit"; + TypeFlags[TypeFlags["Narrowable"] = 17810431] = "Narrowable"; + TypeFlags[TypeFlags["NotUnionOrUnit"] = 16810497] = "NotUnionOrUnit"; /* @internal */ TypeFlags[TypeFlags["RequiresWidening"] = 6291456] = "RequiresWidening"; /* @internal */ @@ -764,6 +812,8 @@ var ts; SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["PrototypeProperty"] = 3] = "PrototypeProperty"; /// this.name = expr SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ThisProperty"] = 4] = "ThisProperty"; + // F.name = expr + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["Property"] = 5] = "Property"; })(SpecialPropertyAssignmentKind = ts.SpecialPropertyAssignmentKind || (ts.SpecialPropertyAssignmentKind = {})); var DiagnosticCategory; (function (DiagnosticCategory) { @@ -790,6 +840,7 @@ var ts; JsxEmit[JsxEmit["None"] = 0] = "None"; JsxEmit[JsxEmit["Preserve"] = 1] = "Preserve"; JsxEmit[JsxEmit["React"] = 2] = "React"; + JsxEmit[JsxEmit["ReactNative"] = 3] = "ReactNative"; })(JsxEmit = ts.JsxEmit || (ts.JsxEmit = {})); var NewLineKind; (function (NewLineKind) { @@ -803,6 +854,7 @@ var ts; ScriptKind[ScriptKind["JSX"] = 2] = "JSX"; ScriptKind[ScriptKind["TS"] = 3] = "TS"; ScriptKind[ScriptKind["TSX"] = 4] = "TSX"; + ScriptKind[ScriptKind["External"] = 5] = "External"; })(ScriptKind = ts.ScriptKind || (ts.ScriptKind = {})); var ScriptTarget; (function (ScriptTarget) { @@ -1037,7 +1089,6 @@ var ts; TransformFlags[TransformFlags["TypeScriptClassSyntaxMask"] = 274432] = "TypeScriptClassSyntaxMask"; TransformFlags[TransformFlags["ES2015FunctionSyntaxMask"] = 163840] = "ES2015FunctionSyntaxMask"; })(TransformFlags = ts.TransformFlags || (ts.TransformFlags = {})); - /* @internal */ var EmitFlags; (function (EmitFlags) { EmitFlags[EmitFlags["SingleLine"] = 1] = "SingleLine"; @@ -1065,15 +1116,45 @@ var ts; EmitFlags[EmitFlags["CustomPrologue"] = 524288] = "CustomPrologue"; EmitFlags[EmitFlags["NoHoisting"] = 1048576] = "NoHoisting"; EmitFlags[EmitFlags["HasEndOfDeclarationMarker"] = 2097152] = "HasEndOfDeclarationMarker"; + EmitFlags[EmitFlags["Iterator"] = 4194304] = "Iterator"; })(EmitFlags = ts.EmitFlags || (ts.EmitFlags = {})); + /** + * Used by the checker, this enum keeps track of external emit helpers that should be type + * checked. + */ /* @internal */ - var EmitContext; - (function (EmitContext) { - EmitContext[EmitContext["SourceFile"] = 0] = "SourceFile"; - EmitContext[EmitContext["Expression"] = 1] = "Expression"; - EmitContext[EmitContext["IdentifierName"] = 2] = "IdentifierName"; - EmitContext[EmitContext["Unspecified"] = 3] = "Unspecified"; - })(EmitContext = ts.EmitContext || (ts.EmitContext = {})); + var ExternalEmitHelpers; + (function (ExternalEmitHelpers) { + ExternalEmitHelpers[ExternalEmitHelpers["Extends"] = 1] = "Extends"; + ExternalEmitHelpers[ExternalEmitHelpers["Assign"] = 2] = "Assign"; + ExternalEmitHelpers[ExternalEmitHelpers["Rest"] = 4] = "Rest"; + ExternalEmitHelpers[ExternalEmitHelpers["Decorate"] = 8] = "Decorate"; + ExternalEmitHelpers[ExternalEmitHelpers["Metadata"] = 16] = "Metadata"; + ExternalEmitHelpers[ExternalEmitHelpers["Param"] = 32] = "Param"; + ExternalEmitHelpers[ExternalEmitHelpers["Awaiter"] = 64] = "Awaiter"; + ExternalEmitHelpers[ExternalEmitHelpers["Generator"] = 128] = "Generator"; + ExternalEmitHelpers[ExternalEmitHelpers["Values"] = 256] = "Values"; + ExternalEmitHelpers[ExternalEmitHelpers["Read"] = 512] = "Read"; + ExternalEmitHelpers[ExternalEmitHelpers["Spread"] = 1024] = "Spread"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncGenerator"] = 2048] = "AsyncGenerator"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncDelegator"] = 4096] = "AsyncDelegator"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncValues"] = 8192] = "AsyncValues"; + // Helpers included by ES2015 for..of + ExternalEmitHelpers[ExternalEmitHelpers["ForOfIncludes"] = 256] = "ForOfIncludes"; + // Helpers included by ES2017 for..await..of + ExternalEmitHelpers[ExternalEmitHelpers["ForAwaitOfIncludes"] = 8192] = "ForAwaitOfIncludes"; + // Helpers included by ES2015 spread + ExternalEmitHelpers[ExternalEmitHelpers["SpreadIncludes"] = 1536] = "SpreadIncludes"; + ExternalEmitHelpers[ExternalEmitHelpers["FirstEmitHelper"] = 1] = "FirstEmitHelper"; + ExternalEmitHelpers[ExternalEmitHelpers["LastEmitHelper"] = 8192] = "LastEmitHelper"; + })(ExternalEmitHelpers = ts.ExternalEmitHelpers || (ts.ExternalEmitHelpers = {})); + var EmitHint; + (function (EmitHint) { + EmitHint[EmitHint["SourceFile"] = 0] = "SourceFile"; + EmitHint[EmitHint["Expression"] = 1] = "Expression"; + EmitHint[EmitHint["IdentifierName"] = 2] = "IdentifierName"; + EmitHint[EmitHint["Unspecified"] = 3] = "Unspecified"; + })(EmitHint = ts.EmitHint || (ts.EmitHint = {})); })(ts || (ts = {})); /*@internal*/ var ts; @@ -1101,8 +1182,8 @@ var ts; */ function mark(markName) { if (enabled) { - marks[markName] = ts.timestamp(); - counts[markName] = (counts[markName] || 0) + 1; + marks.set(markName, ts.timestamp()); + counts.set(markName, (counts.get(markName) || 0) + 1); profilerEvent(markName); } } @@ -1118,9 +1199,9 @@ var ts; */ function measure(measureName, startMarkName, endMarkName) { if (enabled) { - var end = endMarkName && marks[endMarkName] || ts.timestamp(); - var start = startMarkName && marks[startMarkName] || profilerStart; - measures[measureName] = (measures[measureName] || 0) + (end - start); + var end = endMarkName && marks.get(endMarkName) || ts.timestamp(); + var start = startMarkName && marks.get(startMarkName) || profilerStart; + measures.set(measureName, (measures.get(measureName) || 0) + (end - start)); } } performance.measure = measure; @@ -1130,7 +1211,7 @@ var ts; * @param markName The name of the mark. */ function getCount(markName) { - return counts && counts[markName] || 0; + return counts && counts.get(markName) || 0; } performance.getCount = getCount; /** @@ -1139,7 +1220,7 @@ var ts; * @param measureName The name of the measure whose durations should be accumulated. */ function getDuration(measureName) { - return measures && measures[measureName] || 0; + return measures && measures.get(measureName) || 0; } performance.getDuration = getDuration; /** @@ -1148,9 +1229,9 @@ var ts; * @param cb The action to perform for each measure */ function forEachMeasure(cb) { - for (var key in measures) { - cb(key, measures[key]); - } + measures.forEach(function (measure, key) { + cb(key, measure); + }); } performance.forEachMeasure = forEachMeasure; /** Enables (and resets) performance measurements for the compiler. */ @@ -1174,7 +1255,7 @@ var ts; var ts; (function (ts) { /** The version of the TypeScript compiler release */ - ts.version = "2.2.0-dev.20161127"; + ts.version = "2.3.0-dev.20170419"; })(ts || (ts = {})); /* @internal */ (function (ts) { @@ -1193,25 +1274,106 @@ var ts; Ternary[Ternary["Maybe"] = 1] = "Maybe"; Ternary[Ternary["True"] = -1] = "True"; })(Ternary = ts.Ternary || (ts.Ternary = {})); - var createObject = Object.create; // More efficient to create a collator once and use its `compare` than to call `a.localeCompare(b)` many times. - ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined; - function createMap(template) { - var map = createObject(null); // tslint:disable-line:no-null-keyword + ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator(/*locales*/ undefined, { usage: "sort", sensitivity: "accent" }) : undefined; + // Intl is missing in Safari, and node 0.10 treats "a" as greater than "B". + ts.localeCompareIsCorrect = ts.collator && ts.collator.compare("a", "B") < 0; + /** Create a MapLike with good performance. */ + function createDictionaryObject() { + var map = Object.create(/*prototype*/ null); // tslint:disable-line:no-null-keyword // Using 'delete' on an object causes V8 to put the object in dictionary mode. // This disables creation of hidden classes, which are expensive when an object is // constantly changing shape. map["__"] = undefined; delete map["__"]; + return map; + } + /** Create a new map. If a template object is provided, the map will copy entries from it. */ + function createMap() { + return new MapCtr(); + } + ts.createMap = createMap; + function createMapFromTemplate(template) { + var map = new MapCtr(); // Copies keys/values from template. Note that for..in will not throw if // template is undefined, and instead will just exit the loop. for (var key in template) if (hasOwnProperty.call(template, key)) { - map[key] = template[key]; + map.set(key, template[key]); } return map; } - ts.createMap = createMap; + ts.createMapFromTemplate = createMapFromTemplate; + // Internet Explorer's Map doesn't support iteration, so don't use it. + // tslint:disable-next-line:no-in-operator + var MapCtr = typeof Map !== "undefined" && "entries" in Map.prototype ? Map : shimMap(); + // Keep the class inside a function so it doesn't get compiled if it's not used. + function shimMap() { + var MapIterator = (function () { + function MapIterator(data, selector) { + this.index = 0; + this.data = data; + this.selector = selector; + this.keys = Object.keys(data); + } + MapIterator.prototype.next = function () { + var index = this.index; + if (index < this.keys.length) { + this.index++; + return { value: this.selector(this.data, this.keys[index]), done: false }; + } + return { value: undefined, done: true }; + }; + return MapIterator; + }()); + return (function () { + function class_1() { + this.data = createDictionaryObject(); + this.size = 0; + } + class_1.prototype.get = function (key) { + return this.data[key]; + }; + class_1.prototype.set = function (key, value) { + if (!this.has(key)) { + this.size++; + } + this.data[key] = value; + return this; + }; + class_1.prototype.has = function (key) { + // tslint:disable-next-line:no-in-operator + return key in this.data; + }; + class_1.prototype.delete = function (key) { + if (this.has(key)) { + this.size--; + delete this.data[key]; + return true; + } + return false; + }; + class_1.prototype.clear = function () { + this.data = createDictionaryObject(); + this.size = 0; + }; + class_1.prototype.keys = function () { + return new MapIterator(this.data, function (_data, key) { return key; }); + }; + class_1.prototype.values = function () { + return new MapIterator(this.data, function (data, key) { return data[key]; }); + }; + class_1.prototype.entries = function () { + return new MapIterator(this.data, function (data, key) { return [key, data[key]]; }); + }; + class_1.prototype.forEach = function (action) { + for (var key in this.data) { + action(this.data[key], key); + } + }; + return class_1; + }()); + } function createFileMap(keyMapper) { var files = createMap(); return { @@ -1224,33 +1386,28 @@ var ts; clear: clear, }; function forEachValueInMap(f) { - for (var key in files) { - f(key, files[key]); - } + files.forEach(function (file, key) { + f(key, file); + }); } function getKeys() { - var keys = []; - for (var key in files) { - keys.push(key); - } - return keys; + return arrayFrom(files.keys()); } // path should already be well-formed so it does not need to be normalized function get(path) { - return files[toKey(path)]; + return files.get(toKey(path)); } function set(path, value) { - files[toKey(path)] = value; + files.set(toKey(path), value); } function contains(path) { - return toKey(path) in files; + return files.has(toKey(path)); } function remove(path) { - var key = toKey(path); - delete files[key]; + files.delete(toKey(path)); } function clear() { - files = createMap(); + files.clear(); } function toKey(path) { return keyMapper ? keyMapper(path) : path; @@ -1270,6 +1427,10 @@ var ts; Comparison[Comparison["EqualTo"] = 0] = "EqualTo"; Comparison[Comparison["GreaterThan"] = 1] = "GreaterThan"; })(Comparison = ts.Comparison || (ts.Comparison = {})); + function length(array) { + return array ? array.length : 0; + } + ts.length = length; /** * Iterates through 'array' by index and performs the callback on each element of array until the callback * returns a truthy value, then returns that value. @@ -1277,7 +1438,7 @@ var ts; */ function forEach(array, callback) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { var result = callback(array[i], i); if (result) { return result; @@ -1287,6 +1448,26 @@ var ts; return undefined; } ts.forEach = forEach; + /** + * Iterates through the parent chain of a node and performs the callback on each parent until the callback + * returns a truthy value, then returns that value. + * If no such value is found, it applies the callback until the parent pointer is undefined or the callback returns "quit" + * At that point findAncestor returns undefined. + */ + function findAncestor(node, callback) { + while (node) { + var result = callback(node); + if (result === "quit") { + return undefined; + } + else if (result) { + return node; + } + node = node.parent; + } + return undefined; + } + ts.findAncestor = findAncestor; function zipWith(arrayA, arrayB, callback) { Debug.assert(arrayA.length === arrayB.length); for (var i = 0; i < arrayA.length; i++) { @@ -1301,7 +1482,7 @@ var ts; */ function every(array, callback) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { if (!callback(array[i], i)) { return false; } @@ -1312,7 +1493,7 @@ var ts; ts.every = every; /** Works like Array.prototype.find, returning `undefined` if no element satisfying the predicate is found. */ function find(array, predicate) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { var value = array[i]; if (predicate(value, i)) { return value; @@ -1321,12 +1502,22 @@ var ts; return undefined; } ts.find = find; + /** Works like Array.prototype.findIndex, returning `-1` if no element satisfying the predicate is found. */ + function findIndex(array, predicate) { + for (var i = 0; i < array.length; i++) { + if (predicate(array[i], i)) { + return i; + } + } + return -1; + } + ts.findIndex = findIndex; /** * Returns the first truthy result of `callback`, or else fails. * This is like `forEach`, but never returns undefined. */ function findMap(array, callback) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { var result = callback(array[i], i); if (result) { return result; @@ -1349,7 +1540,7 @@ var ts; ts.contains = contains; function indexOf(array, value) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { if (array[i] === value) { return i; } @@ -1359,7 +1550,7 @@ var ts; } ts.indexOf = indexOf; function indexOfAnyCharCode(text, charCodes, start) { - for (var i = start || 0, len = text.length; i < len; i++) { + for (var i = start || 0; i < text.length; i++) { if (contains(charCodes, text.charCodeAt(i))) { return i; } @@ -1569,21 +1760,18 @@ var ts; return result; } ts.spanMap = spanMap; - function mapObject(object, f) { - var result; - if (object) { - result = {}; - for (var _i = 0, _a = getOwnKeys(object); _i < _a.length; _i++) { - var v = _a[_i]; - var _b = f(v, object[v]) || [undefined, undefined], key = _b[0], value = _b[1]; - if (key !== undefined) { - result[key] = value; - } - } + function mapEntries(map, f) { + if (!map) { + return undefined; } + var result = createMap(); + map.forEach(function (value, key) { + var _a = f(key, value), newKey = _a[0], newValue = _a[1]; + result.set(newKey, newValue); + }); return result; } - ts.mapObject = mapObject; + ts.mapEntries = mapEntries; function some(array, predicate) { if (array) { if (predicate) { @@ -1901,9 +2089,6 @@ var ts; /** * Indicates whether a map-like contains an own property with the specified key. * - * NOTE: This is intended for use only with MapLike objects. For Map objects, use - * the 'in' operator. - * * @param map A map-like. * @param key A property key. */ @@ -1914,9 +2099,6 @@ var ts; /** * Gets the value of an owned property in a map-like. * - * NOTE: This is intended for use only with MapLike objects. For Map objects, use - * an indexer. - * * @param map A map-like. * @param key A property key. */ @@ -1941,56 +2123,61 @@ var ts; return keys; } ts.getOwnKeys = getOwnKeys; - /** - * Enumerates the properties of a Map, invoking a callback and returning the first truthy result. - * - * @param map A map for which properties should be enumerated. - * @param callback A callback to invoke for each property. - */ - function forEachProperty(map, callback) { - var result; - for (var key in map) { - if (result = callback(map[key], key)) - break; + function arrayFrom(iterator, map) { + var result = []; + for (var _a = iterator.next(), value = _a.value, done = _a.done; !done; _b = iterator.next(), value = _b.value, done = _b.done, _b) { + result.push(map ? map(value) : value); } return result; + var _b; } - ts.forEachProperty = forEachProperty; - /** - * Returns true if a Map has some matching property. - * - * @param map A map whose properties should be tested. - * @param predicate An optional callback used to test each property. - */ - function someProperties(map, predicate) { - for (var key in map) { - if (!predicate || predicate(map[key], key)) - return true; + ts.arrayFrom = arrayFrom; + function convertToArray(iterator, f) { + var result = []; + for (var _a = iterator.next(), value = _a.value, done = _a.done; !done; _b = iterator.next(), value = _b.value, done = _b.done, _b) { + result.push(f(value)); } - return false; + return result; + var _b; } - ts.someProperties = someProperties; + ts.convertToArray = convertToArray; /** - * Performs a shallow copy of the properties from a source Map to a target MapLike - * - * @param source A map from which properties should be copied. - * @param target A map to which properties should be copied. + * Calls `callback` for each entry in the map, returning the first truthy result. + * Use `map.forEach` instead for normal iteration. */ - function copyProperties(source, target) { - for (var key in source) { - target[key] = source[key]; + function forEachEntry(map, callback) { + var iterator = map.entries(); + for (var _a = iterator.next(), pair = _a.value, done = _a.done; !done; _b = iterator.next(), pair = _b.value, done = _b.done, _b) { + var key = pair[0], value = pair[1]; + var result = callback(value, key); + if (result) { + return result; + } } + return undefined; + var _b; } - ts.copyProperties = copyProperties; - function appendProperty(map, key, value) { - if (key === undefined || value === undefined) - return map; - if (map === undefined) - map = createMap(); - map[key] = value; - return map; + ts.forEachEntry = forEachEntry; + /** `forEachEntry` for just keys. */ + function forEachKey(map, callback) { + var iterator = map.keys(); + for (var _a = iterator.next(), key = _a.value, done = _a.done; !done; _b = iterator.next(), key = _b.value, done = _b.done, _b) { + var result = callback(key); + if (result) { + return result; + } + } + return undefined; + var _b; } - ts.appendProperty = appendProperty; + ts.forEachKey = forEachKey; + /** Copy entries from `source` to `target`. */ + function copyEntries(source, target) { + source.forEach(function (value, key) { + target.set(key, value); + }); + } + ts.copyEntries = copyEntries; function assign(t) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { @@ -1998,51 +2185,14 @@ var ts; } for (var _a = 0, args_1 = args; _a < args_1.length; _a++) { var arg = args_1[_a]; - for (var _b = 0, _c = getOwnKeys(arg); _b < _c.length; _b++) { - var p = _c[_b]; - t[p] = arg[p]; - } + for (var p in arg) + if (hasProperty(arg, p)) { + t[p] = arg[p]; + } } return t; } ts.assign = assign; - /** - * Reduce the properties of a map. - * - * NOTE: This is intended for use with Map objects. For MapLike objects, use - * reduceOwnProperties instead as it offers better runtime safety. - * - * @param map The map to reduce - * @param callback An aggregation function that is called for each entry in the map - * @param initial The initial value for the reduction. - */ - function reduceProperties(map, callback, initial) { - var result = initial; - for (var key in map) { - result = callback(result, map[key], String(key)); - } - return result; - } - ts.reduceProperties = reduceProperties; - /** - * Reduce the properties defined on a map-like (but not from its prototype chain). - * - * NOTE: This is intended for use with MapLike objects. For Map objects, use - * reduceProperties instead as it offers better performance. - * - * @param map The map-like to reduce - * @param callback An aggregation function that is called for each entry in the map - * @param initial The initial value for the reduction. - */ - function reduceOwnProperties(map, callback, initial) { - var result = initial; - for (var key in map) - if (hasOwnProperty.call(map, key)) { - result = callback(result, map[key], String(key)); - } - return result; - } - ts.reduceOwnProperties = reduceOwnProperties; /** * Performs a shallow equality comparison of the contents of two map-likes. * @@ -2073,23 +2223,14 @@ var ts; var result = createMap(); for (var _i = 0, array_8 = array; _i < array_8.length; _i++) { var value = array_8[_i]; - result[makeKey(value)] = makeValue ? makeValue(value) : value; + result.set(makeKey(value), makeValue ? makeValue(value) : value); } return result; } ts.arrayToMap = arrayToMap; - function isEmpty(map) { - for (var id in map) { - if (hasProperty(map, id)) { - return false; - } - } - return true; - } - ts.isEmpty = isEmpty; function cloneMap(map) { var clone = createMap(); - copyProperties(map, clone); + copyEntries(map, clone); return clone; } ts.cloneMap = cloneMap; @@ -2116,36 +2257,32 @@ var ts; return result; } ts.extend = extend; - /** - * Adds the value to an array of values associated with the key, and returns the array. - * Creates the array if it does not already exist. - */ - function multiMapAdd(map, key, value) { - var values = map[key]; + function createMultiMap() { + var map = createMap(); + map.add = multiMapAdd; + map.remove = multiMapRemove; + return map; + } + ts.createMultiMap = createMultiMap; + function multiMapAdd(key, value) { + var values = this.get(key); if (values) { values.push(value); - return values; } else { - return map[key] = [value]; + this.set(key, values = [value]); } + return values; } - ts.multiMapAdd = multiMapAdd; - /** - * Removes a value from an array of values associated with the key. - * Does not preserve the order of those values. - * Does nothing if `key` is not in `map`, or `value` is not in `map[key]`. - */ - function multiMapRemove(map, key, value) { - var values = map[key]; + function multiMapRemove(key, value) { + var values = this.get(key); if (values) { unorderedRemoveItem(values, value); if (!values.length) { - delete map[key]; + this.delete(key); } } } - ts.multiMapRemove = multiMapRemove; /** * Tests whether a value is an array. */ @@ -2226,6 +2363,7 @@ var ts; baseIndex = baseIndex || 0; return text.replace(/{(\d+)}/g, function (_match, index) { return args[+index + baseIndex]; }); } + ts.formatStringFromArgs = formatStringFromArgs; ts.localizedDiagnosticMessages = undefined; function getLocaleSpecificMessage(message) { return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message.key] || message.message; @@ -2328,9 +2466,12 @@ var ts; if (b === undefined) return 1 /* GreaterThan */; if (ignoreCase) { - if (ts.collator && String.prototype.localeCompare) { - // accent means a ≠ b, a ≠ aÌ, a = A - var result = a.localeCompare(b, /*locales*/ undefined, { usage: "sort", sensitivity: "accent" }); + // Checking if "collator exists indicates that Intl is available. + // We still have to check if "collator.compare" is correct. If it is not, use "String.localeComapre" + if (ts.collator) { + var result = ts.localeCompareIsCorrect ? + ts.collator.compare(a, b) : + a.localeCompare(b, /*locales*/ undefined, { usage: "sort", sensitivity: "accent" }); // accent means a ≠ b, a ≠ aÌ, a = A return result < 0 ? -1 /* LessThan */ : result > 0 ? 1 /* GreaterThan */ : 0 /* EqualTo */; } a = a.toUpperCase(); @@ -2403,7 +2544,7 @@ var ts; ts.normalizeSlashes = normalizeSlashes; /** * Returns length of path root (i.e. length of "/", "x:/", "//server/share/, file:///user/files") - */ + */ function getRootLength(path) { if (path.charCodeAt(0) === 47 /* slash */) { if (path.charCodeAt(1) !== 47 /* slash */) @@ -2775,6 +2916,17 @@ var ts; var singleAsteriskRegexFragmentFiles = "([^./]|(\\.(?!min\\.js$))?)*"; var singleAsteriskRegexFragmentOther = "[^/]*"; function getRegularExpressionForWildcard(specs, basePath, usage) { + var patterns = getRegularExpressionsForWildcards(specs, basePath, usage); + if (!patterns || !patterns.length) { + return undefined; + } + var pattern = patterns.map(function (pattern) { return "(" + pattern + ")"; }).join("|"); + // If excluding, match "foo/bar/baz...", but if including, only allow "foo". + var terminator = usage === "exclude" ? "($|/)" : "$"; + return "^(" + pattern + ")" + terminator; + } + ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard; + function getRegularExpressionsForWildcards(specs, basePath, usage) { if (specs === undefined || specs.length === 0) { return undefined; } @@ -2785,31 +2937,10 @@ var ts; * files or directories, does not match subdirectories that start with a . character */ var doubleAsteriskRegexFragment = usage === "exclude" ? "(/.+?)?" : "(/[^/.][^/]*)*?"; - var pattern = ""; - var hasWrittenSubpattern = false; - for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) { - var spec = specs_1[_i]; - if (!spec) { - continue; - } - var subPattern = getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter); - if (subPattern === undefined) { - continue; - } - if (hasWrittenSubpattern) { - pattern += "|"; - } - pattern += "(" + subPattern + ")"; - hasWrittenSubpattern = true; - } - if (!pattern) { - return undefined; - } - // If excluding, match "foo/bar/baz...", but if including, only allow "foo". - var terminator = usage === "exclude" ? "($|/)" : "$"; - return "^(" + pattern + ")" + terminator; + return flatMap(specs, function (spec) { + return spec && getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter); + }); } - ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard; /** * An "includes" path "foo" is implicitly a glob "foo/** /*" (without the space) if its last component has no extension, * and does not contain any glob characters itself. @@ -2888,6 +3019,7 @@ var ts; currentDirectory = normalizePath(currentDirectory); var absolutePath = combinePaths(currentDirectory, path); return { + includeFilePatterns: map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^" + pattern + "$"; }), includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"), includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"), excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"), @@ -2900,34 +3032,50 @@ var ts; currentDirectory = normalizePath(currentDirectory); var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory); var regexFlag = useCaseSensitiveFileNames ? "" : "i"; - var includeFileRegex = patterns.includeFilePattern && new RegExp(patterns.includeFilePattern, regexFlag); + var includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map(function (pattern) { return new RegExp(pattern, regexFlag); }); var includeDirectoryRegex = patterns.includeDirectoryPattern && new RegExp(patterns.includeDirectoryPattern, regexFlag); var excludeRegex = patterns.excludePattern && new RegExp(patterns.excludePattern, regexFlag); - var result = []; + // Associate an array of results with each include regex. This keeps results in order of the "include" order. + // If there are no "includes", then just put everything in results[0]. + var results = includeFileRegexes ? includeFileRegexes.map(function () { return []; }) : [[]]; + var comparer = useCaseSensitiveFileNames ? compareStrings : compareStringsCaseInsensitive; for (var _i = 0, _a = patterns.basePaths; _i < _a.length; _i++) { var basePath = _a[_i]; visitDirectory(basePath, combinePaths(currentDirectory, basePath)); } - return result; + return flatten(results); function visitDirectory(path, absolutePath) { var _a = getFileSystemEntries(path), files = _a.files, directories = _a.directories; + files = files.slice().sort(comparer); + directories = directories.slice().sort(comparer); + var _loop_1 = function (current) { + var name = combinePaths(path, current); + var absoluteName = combinePaths(absolutePath, current); + if (extensions && !fileExtensionIsAny(name, extensions)) + return "continue"; + if (excludeRegex && excludeRegex.test(absoluteName)) + return "continue"; + if (!includeFileRegexes) { + results[0].push(name); + } + else { + var includeIndex = findIndex(includeFileRegexes, function (re) { return re.test(absoluteName); }); + if (includeIndex !== -1) { + results[includeIndex].push(name); + } + } + }; for (var _i = 0, files_1 = files; _i < files_1.length; _i++) { var current = files_1[_i]; - var name_1 = combinePaths(path, current); - var absoluteName = combinePaths(absolutePath, current); - if ((!extensions || fileExtensionIsAny(name_1, extensions)) && - (!includeFileRegex || includeFileRegex.test(absoluteName)) && - (!excludeRegex || !excludeRegex.test(absoluteName))) { - result.push(name_1); - } + _loop_1(current); } for (var _b = 0, directories_1 = directories; _b < directories_1.length; _b++) { var current = directories_1[_b]; - var name_2 = combinePaths(path, current); + var name = combinePaths(path, current); var absoluteName = combinePaths(absolutePath, current); if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) && (!excludeRegex || !excludeRegex.test(absoluteName))) { - visitDirectory(name_2, absoluteName); + visitDirectory(name, absoluteName); } } } @@ -2952,7 +3100,7 @@ var ts; } // Sort the offsets array using either the literal or canonical path representations. includeBasePaths.sort(useCaseSensitiveFileNames ? compareStrings : compareStringsCaseInsensitive); - var _loop_1 = function (includeBasePath) { + var _loop_2 = function (includeBasePath) { if (ts.every(basePaths, function (basePath) { return !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames); })) { basePaths.push(includeBasePath); } @@ -2961,7 +3109,7 @@ var ts; // subpath of an existing base path for (var _a = 0, includeBasePaths_1 = includeBasePaths; _a < includeBasePaths_1.length; _a++) { var includeBasePath = includeBasePaths_1[_a]; - _loop_1(includeBasePath); + _loop_2(includeBasePath); } } return basePaths; @@ -3010,8 +3158,19 @@ var ts; ts.supportedTypescriptExtensionsForExtractExtension = [".d.ts", ".ts", ".tsx"]; ts.supportedJavascriptExtensions = [".js", ".jsx"]; var allSupportedExtensions = ts.supportedTypeScriptExtensions.concat(ts.supportedJavascriptExtensions); - function getSupportedExtensions(options) { - return options && options.allowJs ? allSupportedExtensions : ts.supportedTypeScriptExtensions; + function getSupportedExtensions(options, extraFileExtensions) { + var needAllExtensions = options && options.allowJs; + if (!extraFileExtensions || extraFileExtensions.length === 0 || !needAllExtensions) { + return needAllExtensions ? allSupportedExtensions : ts.supportedTypeScriptExtensions; + } + var extensions = allSupportedExtensions.slice(0); + for (var _i = 0, extraFileExtensions_1 = extraFileExtensions; _i < extraFileExtensions_1.length; _i++) { + var extInfo = extraFileExtensions_1[_i]; + if (extensions.indexOf(extInfo.extension) === -1) { + extensions.push(extInfo.extension); + } + } + return extensions; } ts.getSupportedExtensions = getSupportedExtensions; function hasJavaScriptFileExtension(fileName) { @@ -3022,11 +3181,11 @@ var ts; return forEach(ts.supportedTypeScriptExtensions, function (extension) { return fileExtensionIs(fileName, extension); }); } ts.hasTypeScriptFileExtension = hasTypeScriptFileExtension; - function isSupportedSourceFileName(fileName, compilerOptions) { + function isSupportedSourceFileName(fileName, compilerOptions, extraFileExtensions) { if (!fileName) { return false; } - for (var _i = 0, _a = getSupportedExtensions(compilerOptions); _i < _a.length; _i++) { + for (var _i = 0, _a = getSupportedExtensions(compilerOptions, extraFileExtensions); _i < _a.length; _i++) { var extension = _a[_i]; if (fileExtensionIs(fileName, extension)) { return true; @@ -3044,14 +3203,13 @@ var ts; (function (ExtensionPriority) { ExtensionPriority[ExtensionPriority["TypeScriptFiles"] = 0] = "TypeScriptFiles"; ExtensionPriority[ExtensionPriority["DeclarationAndJavaScriptFiles"] = 2] = "DeclarationAndJavaScriptFiles"; - ExtensionPriority[ExtensionPriority["Limit"] = 5] = "Limit"; ExtensionPriority[ExtensionPriority["Highest"] = 0] = "Highest"; ExtensionPriority[ExtensionPriority["Lowest"] = 2] = "Lowest"; })(ExtensionPriority = ts.ExtensionPriority || (ts.ExtensionPriority = {})); function getExtensionPriority(path, supportedExtensions) { for (var i = supportedExtensions.length - 1; i >= 0; i--) { if (fileExtensionIs(path, supportedExtensions[i])) { - return adjustExtensionPriority(i); + return adjustExtensionPriority(i, supportedExtensions); } } // If its not in the list of supported extensions, this is likely a @@ -3062,27 +3220,27 @@ var ts; /** * Adjusts an extension priority to be the highest priority within the same range. */ - function adjustExtensionPriority(extensionPriority) { + function adjustExtensionPriority(extensionPriority, supportedExtensions) { if (extensionPriority < 2 /* DeclarationAndJavaScriptFiles */) { return 0 /* TypeScriptFiles */; } - else if (extensionPriority < 5 /* Limit */) { + else if (extensionPriority < supportedExtensions.length) { return 2 /* DeclarationAndJavaScriptFiles */; } else { - return 5 /* Limit */; + return supportedExtensions.length; } } ts.adjustExtensionPriority = adjustExtensionPriority; /** * Gets the next lowest extension priority for a given priority. */ - function getNextLowestExtensionPriority(extensionPriority) { + function getNextLowestExtensionPriority(extensionPriority, supportedExtensions) { if (extensionPriority < 2 /* DeclarationAndJavaScriptFiles */) { return 2 /* DeclarationAndJavaScriptFiles */; } else { - return 5 /* Limit */; + return supportedExtensions.length; } } ts.getNextLowestExtensionPriority = getNextLowestExtensionPriority; @@ -3329,144 +3487,30 @@ var ts; } } ts.tryGetExtensionFromPath = tryGetExtensionFromPath; + function isCheckJsEnabledForFile(sourceFile, compilerOptions) { + return sourceFile.checkJsDirective ? sourceFile.checkJsDirective.enabled : compilerOptions.checkJs; + } + ts.isCheckJsEnabledForFile = isCheckJsEnabledForFile; })(ts || (ts = {})); /// var ts; (function (ts) { - ts.sys = (function () { - function getWScriptSystem() { - var fso = new ActiveXObject("Scripting.FileSystemObject"); - var shell = new ActiveXObject("WScript.Shell"); - var fileStream = new ActiveXObject("ADODB.Stream"); - fileStream.Type = 2 /*text*/; - var binaryStream = new ActiveXObject("ADODB.Stream"); - binaryStream.Type = 1 /*binary*/; - var args = []; - for (var i = 0; i < WScript.Arguments.length; i++) { - args[i] = WScript.Arguments.Item(i); - } - function readFile(fileName, encoding) { - if (!fso.FileExists(fileName)) { - return undefined; - } - fileStream.Open(); - try { - if (encoding) { - fileStream.Charset = encoding; - fileStream.LoadFromFile(fileName); - } - else { - // Load file and read the first two bytes into a string with no interpretation - fileStream.Charset = "x-ansi"; - fileStream.LoadFromFile(fileName); - var bom = fileStream.ReadText(2) || ""; - // Position must be at 0 before encoding can be changed - fileStream.Position = 0; - // [0xFF,0xFE] and [0xFE,0xFF] mean utf-16 (little or big endian), otherwise default to utf-8 - fileStream.Charset = bom.length >= 2 && (bom.charCodeAt(0) === 0xFF && bom.charCodeAt(1) === 0xFE || bom.charCodeAt(0) === 0xFE && bom.charCodeAt(1) === 0xFF) ? "unicode" : "utf-8"; - } - // ReadText method always strips byte order mark from resulting string - return fileStream.ReadText(); - } - catch (e) { - throw e; - } - finally { - fileStream.Close(); - } - } - function writeFile(fileName, data, writeByteOrderMark) { - fileStream.Open(); - binaryStream.Open(); - try { - // Write characters in UTF-8 encoding - fileStream.Charset = "utf-8"; - fileStream.WriteText(data); - // If we don't want the BOM, then skip it by setting the starting location to 3 (size of BOM). - // If not, start from position 0, as the BOM will be added automatically when charset==utf8. - if (writeByteOrderMark) { - fileStream.Position = 0; - } - else { - fileStream.Position = 3; - } - fileStream.CopyTo(binaryStream); - binaryStream.SaveToFile(fileName, 2 /*overwrite*/); - } - finally { - binaryStream.Close(); - fileStream.Close(); - } - } - function getNames(collection) { - var result = []; - for (var e = new Enumerator(collection); !e.atEnd(); e.moveNext()) { - result.push(e.item().Name); - } - return result.sort(); - } - function getDirectories(path) { - var folder = fso.GetFolder(path); - return getNames(folder.subfolders); - } - function getAccessibleFileSystemEntries(path) { - try { - var folder = fso.GetFolder(path || "."); - var files = getNames(folder.files); - var directories = getNames(folder.subfolders); - return { files: files, directories: directories }; - } - catch (e) { - return { files: [], directories: [] }; - } - } - function readDirectory(path, extensions, excludes, includes) { - return ts.matchFiles(path, extensions, excludes, includes, /*useCaseSensitiveFileNames*/ false, shell.CurrentDirectory, getAccessibleFileSystemEntries); - } - var wscriptSystem = { - args: args, - newLine: "\r\n", - useCaseSensitiveFileNames: false, - write: function (s) { - WScript.StdOut.Write(s); - }, - readFile: readFile, - writeFile: writeFile, - resolvePath: function (path) { - return fso.GetAbsolutePathName(path); - }, - fileExists: function (path) { - return fso.FileExists(path); - }, - directoryExists: function (path) { - return fso.FolderExists(path); - }, - createDirectory: function (directoryName) { - if (!wscriptSystem.directoryExists(directoryName)) { - fso.CreateFolder(directoryName); - } - }, - getExecutingFilePath: function () { - return WScript.ScriptFullName; - }, - getCurrentDirectory: function () { - return shell.CurrentDirectory; - }, - getDirectories: getDirectories, - getEnvironmentVariable: function (name) { - return new ActiveXObject("WScript.Shell").ExpandEnvironmentStrings("%" + name + "%"); - }, - readDirectory: readDirectory, - exit: function (exitCode) { - try { - WScript.Quit(exitCode); - } - catch (e) { - } - } - }; - return wscriptSystem; + function getNodeMajorVersion() { + if (typeof process === "undefined") { + return undefined; } + var version = process.version; + if (!version) { + return undefined; + } + var dot = version.indexOf("."); + if (dot === -1) { + return undefined; + } + return parseInt(version.substring(1, dot)); + } + ts.getNodeMajorVersion = getNodeMajorVersion; + ts.sys = (function () { function getNodeSystem() { var _fs = require("fs"); var _path = require("path"); @@ -3476,32 +3520,32 @@ var ts; function createWatchedFileSet() { var dirWatchers = ts.createMap(); // One file can have multiple watchers - var fileWatcherCallbacks = ts.createMap(); + var fileWatcherCallbacks = ts.createMultiMap(); return { addFile: addFile, removeFile: removeFile }; function reduceDirWatcherRefCountForFile(fileName) { var dirName = ts.getDirectoryPath(fileName); - var watcher = dirWatchers[dirName]; + var watcher = dirWatchers.get(dirName); if (watcher) { watcher.referenceCount -= 1; if (watcher.referenceCount <= 0) { watcher.close(); - delete dirWatchers[dirName]; + dirWatchers.delete(dirName); } } } function addDirWatcher(dirPath) { - var watcher = dirWatchers[dirPath]; + var watcher = dirWatchers.get(dirPath); if (watcher) { watcher.referenceCount += 1; return; } watcher = _fs.watch(dirPath, { persistent: true }, function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); watcher.referenceCount = 1; - dirWatchers[dirPath] = watcher; + dirWatchers.set(dirPath, watcher); return; } function addFileWatcherCallback(filePath, callback) { - ts.multiMapAdd(fileWatcherCallbacks, filePath, callback); + fileWatcherCallbacks.add(filePath, callback); } function addFile(fileName, callback) { addFileWatcherCallback(fileName, callback); @@ -3513,7 +3557,7 @@ var ts; reduceDirWatcherRefCountForFile(watchedFile.fileName); } function removeFileWatcherCallback(filePath, callback) { - ts.multiMapRemove(fileWatcherCallbacks, filePath, callback); + fileWatcherCallbacks.remove(filePath, callback); } function fileEventHandler(eventName, relativeFileName, baseDirPath) { // When files are deleted from disk, the triggered "rename" event would have a relativefileName of "undefined" @@ -3521,18 +3565,20 @@ var ts; ? undefined : ts.getNormalizedAbsolutePath(relativeFileName, baseDirPath); // Some applications save a working file via rename operations - if ((eventName === "change" || eventName === "rename") && fileWatcherCallbacks[fileName]) { - for (var _i = 0, _a = fileWatcherCallbacks[fileName]; _i < _a.length; _i++) { - var fileCallback = _a[_i]; - fileCallback(fileName); + if ((eventName === "change" || eventName === "rename")) { + var callbacks = fileWatcherCallbacks.get(fileName); + if (callbacks) { + for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) { + var fileCallback = callbacks_1[_i]; + fileCallback(fileName); + } } } } } var watchedFileSet = createWatchedFileSet(); - function isNode4OrLater() { - return parseInt(process.version.charAt(1)) >= 4; - } + var nodeVersion = getNodeMajorVersion(); + var isNode4OrLater = nodeVersion >= 4; function isFileSystemCaseSensitive() { // win32\win64 are case insensitive platforms if (platform === "win32" || platform === "win64") { @@ -3553,7 +3599,7 @@ var ts; if (len >= 2 && buffer[0] === 0xFE && buffer[1] === 0xFF) { // Big endian UTF-16 byte order mark detected. Since big endian is not supported by node.js, // flip all byte pairs and treat as little endian. - len &= ~1; + len &= ~1; // Round down to a multiple of 2 for (var i = 0; i < len; i += 2) { var temp = buffer[i]; buffer[i] = buffer[i + 1]; @@ -3580,7 +3626,7 @@ var ts; var fd; try { fd = _fs.openSync(fileName, "w"); - _fs.writeSync(fd, data, undefined, "utf8"); + _fs.writeSync(fd, data, /*position*/ undefined, "utf8"); } finally { if (fd !== undefined) { @@ -3600,10 +3646,10 @@ var ts; if (entry === "." || entry === "..") { continue; } - var name_3 = ts.combinePaths(path, entry); + var name = ts.combinePaths(path, entry); var stat = void 0; try { - stat = _fs.statSync(name_3); + stat = _fs.statSync(name); } catch (e) { continue; @@ -3685,9 +3731,10 @@ var ts; // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643) var options; if (!directoryExists(directoryName)) { + // do nothing if target folder does not exist return noOpFileWatcher; } - if (isNode4OrLater() && (process.platform === "win32" || process.platform === "darwin")) { + if (isNode4OrLater && (process.platform === "win32" || process.platform === "darwin")) { options = { persistent: true, recursive: !!recursive }; } else { @@ -3701,7 +3748,6 @@ var ts; // When deleting a file, the passed baseFileName is null callback(!relativeFileName ? relativeFileName : ts.normalizePath(ts.combinePaths(directoryName, relativeFileName))); } - ; }); }, resolvePath: function (path) { @@ -3765,6 +3811,7 @@ var ts; require("source-map-support").install(); } catch (e) { + // Could not enable source maps. } }, setTimeout: setTimeout, @@ -3820,9 +3867,6 @@ var ts; if (typeof ChakraHost !== "undefined") { sys = getChakraSystem(); } - else if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { - sys = getWScriptSystem(); - } else if (typeof process !== "undefined" && process.nextTick && !process.browser && typeof require !== "undefined") { // process and process.nextTick checks if current environment is node-like // process.browser check excludes webpack and browserify @@ -3897,11 +3941,11 @@ var ts; Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value: { code: 1055, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055", message: "Type '{0}' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value." }, Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: ts.DiagnosticCategory.Error, key: "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056", message: "Accessors are only available when targeting ECMAScript 5 and higher." }, An_async_function_or_method_must_have_a_valid_awaitable_return_type: { code: 1057, category: ts.DiagnosticCategory.Error, key: "An_async_function_or_method_must_have_a_valid_awaitable_return_type_1057", message: "An async function or method must have a valid awaitable return type." }, - Operand_for_await_does_not_have_a_valid_callable_then_member: { code: 1058, category: ts.DiagnosticCategory.Error, key: "Operand_for_await_does_not_have_a_valid_callable_then_member_1058", message: "Operand for 'await' does not have a valid callable 'then' member." }, - Return_expression_in_async_function_does_not_have_a_valid_callable_then_member: { code: 1059, category: ts.DiagnosticCategory.Error, key: "Return_expression_in_async_function_does_not_have_a_valid_callable_then_member_1059", message: "Return expression in async function does not have a valid callable 'then' member." }, - Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member: { code: 1060, category: ts.DiagnosticCategory.Error, key: "Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member_1060", message: "Expression body for async arrow function does not have a valid callable 'then' member." }, + The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1058, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058", message: "The return type of an async function must either be a valid promise or must not contain a callable 'then' member." }, + A_promise_must_have_a_then_method: { code: 1059, category: ts.DiagnosticCategory.Error, key: "A_promise_must_have_a_then_method_1059", message: "A promise must have a 'then' method." }, + The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback: { code: 1060, category: ts.DiagnosticCategory.Error, key: "The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060", message: "The first parameter of the 'then' method of a promise must be a callback." }, Enum_member_must_have_initializer: { code: 1061, category: ts.DiagnosticCategory.Error, key: "Enum_member_must_have_initializer_1061", message: "Enum member must have initializer." }, - _0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: { code: 1062, category: ts.DiagnosticCategory.Error, key: "_0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062", message: "{0} is referenced directly or indirectly in the fulfillment callback of its own 'then' method." }, + Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: { code: 1062, category: ts.DiagnosticCategory.Error, key: "Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062", message: "Type is referenced directly or indirectly in the fulfillment callback of its own 'then' method." }, An_export_assignment_cannot_be_used_in_a_namespace: { code: 1063, category: ts.DiagnosticCategory.Error, key: "An_export_assignment_cannot_be_used_in_a_namespace_1063", message: "An export assignment cannot be used in a namespace." }, The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type: { code: 1064, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1064", message: "The return type of an async function or method must be the global Promise type." }, In_ambient_enum_declarations_member_initializer_must_be_constant_expression: { code: 1066, category: ts.DiagnosticCategory.Error, key: "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066", message: "In ambient enum declarations member initializer must be constant expression." }, @@ -3910,7 +3954,7 @@ var ts; _0_modifier_cannot_appear_on_an_index_signature: { code: 1071, category: ts.DiagnosticCategory.Error, key: "_0_modifier_cannot_appear_on_an_index_signature_1071", message: "'{0}' modifier cannot appear on an index signature." }, A_0_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: ts.DiagnosticCategory.Error, key: "A_0_modifier_cannot_be_used_with_an_import_declaration_1079", message: "A '{0}' modifier cannot be used with an import declaration." }, Invalid_reference_directive_syntax: { code: 1084, category: ts.DiagnosticCategory.Error, key: "Invalid_reference_directive_syntax_1084", message: "Invalid 'reference' directive syntax." }, - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: ts.DiagnosticCategory.Error, key: "Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_1085", message: "Octal literals are not available when targeting ECMAScript 5 and higher." }, + Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0: { code: 1085, category: ts.DiagnosticCategory.Error, key: "Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0_1085", message: "Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '{0}'." }, An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: ts.DiagnosticCategory.Error, key: "An_accessor_cannot_be_declared_in_an_ambient_context_1086", message: "An accessor cannot be declared in an ambient context." }, _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: ts.DiagnosticCategory.Error, key: "_0_modifier_cannot_appear_on_a_constructor_declaration_1089", message: "'{0}' modifier cannot appear on a constructor declaration." }, _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: ts.DiagnosticCategory.Error, key: "_0_modifier_cannot_appear_on_a_parameter_1090", message: "'{0}' modifier cannot appear on a parameter." }, @@ -3926,6 +3970,7 @@ var ts; Invalid_use_of_0_in_strict_mode: { code: 1100, category: ts.DiagnosticCategory.Error, key: "Invalid_use_of_0_in_strict_mode_1100", message: "Invalid use of '{0}' in strict mode." }, with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: ts.DiagnosticCategory.Error, key: "with_statements_are_not_allowed_in_strict_mode_1101", message: "'with' statements are not allowed in strict mode." }, delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: ts.DiagnosticCategory.Error, key: "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102", message: "'delete' cannot be called on an identifier in strict mode." }, + A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator: { code: 1103, category: ts.DiagnosticCategory.Error, key: "A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator_1103", message: "A 'for-await-of' statement is only allowed within an async function or async generator." }, A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: ts.DiagnosticCategory.Error, key: "A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104", message: "A 'continue' statement can only be used within an enclosing iteration statement." }, A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: ts.DiagnosticCategory.Error, key: "A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105", message: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, Jump_target_cannot_cross_function_boundary: { code: 1107, category: ts.DiagnosticCategory.Error, key: "Jump_target_cannot_cross_function_boundary_1107", message: "Jump target cannot cross function boundary." }, @@ -3933,7 +3978,7 @@ var ts; Expression_expected: { code: 1109, category: ts.DiagnosticCategory.Error, key: "Expression_expected_1109", message: "Expression expected." }, Type_expected: { code: 1110, category: ts.DiagnosticCategory.Error, key: "Type_expected_1110", message: "Type expected." }, A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: ts.DiagnosticCategory.Error, key: "A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113", message: "A 'default' clause cannot appear more than once in a 'switch' statement." }, - Duplicate_label_0: { code: 1114, category: ts.DiagnosticCategory.Error, key: "Duplicate_label_0_1114", message: "Duplicate label '{0}'" }, + Duplicate_label_0: { code: 1114, category: ts.DiagnosticCategory.Error, key: "Duplicate_label_0_1114", message: "Duplicate label '{0}'." }, A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: ts.DiagnosticCategory.Error, key: "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", message: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: ts.DiagnosticCategory.Error, key: "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", message: "A 'break' statement can only jump to a label of an enclosing statement." }, An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: ts.DiagnosticCategory.Error, key: "An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode_1117", message: "An object literal cannot have multiple properties with the same name in strict mode." }, @@ -3965,9 +4010,9 @@ var ts; Declaration_expected: { code: 1146, category: ts.DiagnosticCategory.Error, key: "Declaration_expected_1146", message: "Declaration expected." }, Import_declarations_in_a_namespace_cannot_reference_a_module: { code: 1147, category: ts.DiagnosticCategory.Error, key: "Import_declarations_in_a_namespace_cannot_reference_a_module_1147", message: "Import declarations in a namespace cannot reference a module." }, Cannot_use_imports_exports_or_module_augmentations_when_module_is_none: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148", message: "Cannot use imports, exports, or module augmentations when '--module' is 'none'." }, - File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", message: "File name '{0}' differs from already included file name '{1}' only in casing" }, + File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", message: "File name '{0}' differs from already included file name '{1}' only in casing." }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: ts.DiagnosticCategory.Error, key: "new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead_1150", message: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "const_declarations_must_be_initialized_1155", message: "'const' declarations must be initialized" }, + const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "const_declarations_must_be_initialized_1155", message: "'const' declarations must be initialized." }, const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: ts.DiagnosticCategory.Error, key: "const_declarations_can_only_be_declared_inside_a_block_1156", message: "'const' declarations can only be declared inside a block." }, let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: ts.DiagnosticCategory.Error, key: "let_declarations_can_only_be_declared_inside_a_block_1157", message: "'let' declarations can only be declared inside a block." }, Unterminated_template_literal: { code: 1160, category: ts.DiagnosticCategory.Error, key: "Unterminated_template_literal_1160", message: "Unterminated template literal." }, @@ -4016,11 +4061,12 @@ var ts; Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided_1208", message: "Cannot compile namespaces when the '--isolatedModules' flag is provided." }, Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided_1209", message: "Ambient const enums are not allowed when the '--isolatedModules' flag is provided." }, Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode_1210", message: "Invalid use of '{0}'. Class definitions are automatically in strict mode." }, - A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", message: "A class declaration without the 'default' modifier must have a name" }, - Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", message: "Identifier expected. '{0}' is a reserved word in strict mode" }, + A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", message: "A class declaration without the 'default' modifier must have a name." }, + Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", message: "Identifier expected. '{0}' is a reserved word in strict mode." }, Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213", message: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode: { code: 1214, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214", message: "Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode." }, Invalid_use_of_0_Modules_are_automatically_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215", message: "Invalid use of '{0}'. Modules are automatically in strict mode." }, + Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216", message: "Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules." }, Export_assignment_is_not_supported_when_module_flag_is_system: { code: 1218, category: ts.DiagnosticCategory.Error, key: "Export_assignment_is_not_supported_when_module_flag_is_system_1218", message: "Export assignment is not supported when '--module' flag is 'system'." }, Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning: { code: 1219, category: ts.DiagnosticCategory.Error, key: "Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219", message: "Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning." }, Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher: { code: 1220, category: ts.DiagnosticCategory.Error, key: "Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher_1220", message: "Generators are only available when targeting ECMAScript 2015 or higher." }, @@ -4066,6 +4112,11 @@ var ts; Global_module_exports_may_only_appear_in_declaration_files: { code: 1315, category: ts.DiagnosticCategory.Error, key: "Global_module_exports_may_only_appear_in_declaration_files_1315", message: "Global module exports may only appear in declaration files." }, Global_module_exports_may_only_appear_at_top_level: { code: 1316, category: ts.DiagnosticCategory.Error, key: "Global_module_exports_may_only_appear_at_top_level_1316", message: "Global module exports may only appear at top level." }, A_parameter_property_cannot_be_declared_using_a_rest_parameter: { code: 1317, category: ts.DiagnosticCategory.Error, key: "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317", message: "A parameter property cannot be declared using a rest parameter." }, + An_abstract_accessor_cannot_have_an_implementation: { code: 1318, category: ts.DiagnosticCategory.Error, key: "An_abstract_accessor_cannot_have_an_implementation_1318", message: "An abstract accessor cannot have an implementation." }, + A_default_export_can_only_be_used_in_an_ECMAScript_style_module: { code: 1319, category: ts.DiagnosticCategory.Error, key: "A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319", message: "A default export can only be used in an ECMAScript-style module." }, + Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1320, category: ts.DiagnosticCategory.Error, key: "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320", message: "Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member." }, + Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1321, category: ts.DiagnosticCategory.Error, key: "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321", message: "Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member." }, + Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1322, category: ts.DiagnosticCategory.Error, key: "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322", message: "Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member." }, Duplicate_identifier_0: { code: 2300, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_2300", message: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: ts.DiagnosticCategory.Error, key: "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", message: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: ts.DiagnosticCategory.Error, key: "Static_members_cannot_reference_class_type_parameters_2302", message: "Static members cannot reference class type parameters." }, @@ -4109,6 +4160,7 @@ var ts; Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: ts.DiagnosticCategory.Error, key: "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340", message: "Only public and protected methods of the base class are accessible via the 'super' keyword." }, Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: ts.DiagnosticCategory.Error, key: "Property_0_is_private_and_only_accessible_within_class_1_2341", message: "Property '{0}' is private and only accessible within class '{1}'." }, An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { code: 2342, category: ts.DiagnosticCategory.Error, key: "An_index_expression_argument_must_be_of_type_string_number_symbol_or_any_2342", message: "An index expression argument must be of type 'string', 'number', 'symbol', or 'any'." }, + This_syntax_requires_an_imported_helper_named_1_but_module_0_has_no_exported_member_1: { code: 2343, category: ts.DiagnosticCategory.Error, key: "This_syntax_requires_an_imported_helper_named_1_but_module_0_has_no_exported_member_1_2343", message: "This syntax requires an imported helper named '{1}', but module '{0}' has no exported member '{1}'." }, Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: ts.DiagnosticCategory.Error, key: "Type_0_does_not_satisfy_the_constraint_1_2344", message: "Type '{0}' does not satisfy the constraint '{1}'." }, Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: ts.DiagnosticCategory.Error, key: "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345", message: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: ts.DiagnosticCategory.Error, key: "Supplied_parameters_do_not_match_any_signature_of_call_target_2346", message: "Supplied parameters do not match any signature of call target." }, @@ -4119,19 +4171,20 @@ var ts; Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: ts.DiagnosticCategory.Error, key: "Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature_2351", message: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, Type_0_cannot_be_converted_to_type_1: { code: 2352, category: ts.DiagnosticCategory.Error, key: "Type_0_cannot_be_converted_to_type_1_2352", message: "Type '{0}' cannot be converted to type '{1}'." }, Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1: { code: 2353, category: ts.DiagnosticCategory.Error, key: "Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353", message: "Object literal may only specify known properties, and '{0}' does not exist in type '{1}'." }, + This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found: { code: 2354, category: ts.DiagnosticCategory.Error, key: "This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354", message: "This syntax requires an imported helper but module '{0}' cannot be found." }, A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value: { code: 2355, category: ts.DiagnosticCategory.Error, key: "A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_2355", message: "A function whose declared type is neither 'void' nor 'any' must return a value." }, An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: ts.DiagnosticCategory.Error, key: "An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type_2356", message: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access: { code: 2357, category: ts.DiagnosticCategory.Error, key: "The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357", message: "The operand of an increment or decrement operator must be a variable or a property access." }, The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358", message: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359", message: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { code: 2360, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol_2360", message: "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'." }, - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter_2361", message: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter_2361", message: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter." }, The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2362", message: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2363", message: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access: { code: 2364, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364", message: "The left-hand side of an assignment expression must be a variable or a property access." }, Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: ts.DiagnosticCategory.Error, key: "Operator_0_cannot_be_applied_to_types_1_and_2_2365", message: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined: { code: 2366, category: ts.DiagnosticCategory.Error, key: "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366", message: "Function lacks ending return statement and return type does not include 'undefined'." }, - Type_parameter_name_cannot_be_0: { code: 2368, category: ts.DiagnosticCategory.Error, key: "Type_parameter_name_cannot_be_0_2368", message: "Type parameter name cannot be '{0}'" }, + Type_parameter_name_cannot_be_0: { code: 2368, category: ts.DiagnosticCategory.Error, key: "Type_parameter_name_cannot_be_0_2368", message: "Type parameter name cannot be '{0}'." }, A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: ts.DiagnosticCategory.Error, key: "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369", message: "A parameter property is only allowed in a constructor implementation." }, A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: ts.DiagnosticCategory.Error, key: "A_rest_parameter_must_be_of_an_array_type_2370", message: "A rest parameter must be of an array type." }, A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: ts.DiagnosticCategory.Error, key: "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371", message: "A parameter initializer is only allowed in a function or constructor implementation." }, @@ -4171,12 +4224,12 @@ var ts; The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access: { code: 2406, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406", message: "The left-hand side of a 'for...in' statement must be a variable or a property access." }, The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_2407", message: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, Setters_cannot_return_a_value: { code: 2408, category: ts.DiagnosticCategory.Error, key: "Setters_cannot_return_a_value_2408", message: "Setters cannot return a value." }, - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: ts.DiagnosticCategory.Error, key: "Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409", message: "Return type of constructor signature must be assignable to the instance type of the class" }, + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: ts.DiagnosticCategory.Error, key: "Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409", message: "Return type of constructor signature must be assignable to the instance type of the class." }, The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any: { code: 2410, category: ts.DiagnosticCategory.Error, key: "The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410", message: "The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'." }, Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: ts.DiagnosticCategory.Error, key: "Property_0_of_type_1_is_not_assignable_to_string_index_type_2_2411", message: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: ts.DiagnosticCategory.Error, key: "Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2_2412", message: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: ts.DiagnosticCategory.Error, key: "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413", message: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, - Class_name_cannot_be_0: { code: 2414, category: ts.DiagnosticCategory.Error, key: "Class_name_cannot_be_0_2414", message: "Class name cannot be '{0}'" }, + Class_name_cannot_be_0: { code: 2414, category: ts.DiagnosticCategory.Error, key: "Class_name_cannot_be_0_2414", message: "Class name cannot be '{0}'." }, Class_0_incorrectly_extends_base_class_1: { code: 2415, category: ts.DiagnosticCategory.Error, key: "Class_0_incorrectly_extends_base_class_1_2415", message: "Class '{0}' incorrectly extends base class '{1}'." }, Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: ts.DiagnosticCategory.Error, key: "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", message: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, Class_0_incorrectly_implements_interface_1: { code: 2420, category: ts.DiagnosticCategory.Error, key: "Class_0_incorrectly_implements_interface_1_2420", message: "Class '{0}' incorrectly implements interface '{1}'." }, @@ -4185,19 +4238,19 @@ var ts; Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: ts.DiagnosticCategory.Error, key: "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424", message: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: ts.DiagnosticCategory.Error, key: "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425", message: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: ts.DiagnosticCategory.Error, key: "Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426", message: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Interface_name_cannot_be_0: { code: 2427, category: ts.DiagnosticCategory.Error, key: "Interface_name_cannot_be_0_2427", message: "Interface name cannot be '{0}'" }, + Interface_name_cannot_be_0: { code: 2427, category: ts.DiagnosticCategory.Error, key: "Interface_name_cannot_be_0_2427", message: "Interface name cannot be '{0}'." }, All_declarations_of_0_must_have_identical_type_parameters: { code: 2428, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_0_must_have_identical_type_parameters_2428", message: "All declarations of '{0}' must have identical type parameters." }, Interface_0_incorrectly_extends_interface_1: { code: 2430, category: ts.DiagnosticCategory.Error, key: "Interface_0_incorrectly_extends_interface_1_2430", message: "Interface '{0}' incorrectly extends interface '{1}'." }, - Enum_name_cannot_be_0: { code: 2431, category: ts.DiagnosticCategory.Error, key: "Enum_name_cannot_be_0_2431", message: "Enum name cannot be '{0}'" }, + Enum_name_cannot_be_0: { code: 2431, category: ts.DiagnosticCategory.Error, key: "Enum_name_cannot_be_0_2431", message: "Enum name cannot be '{0}'." }, In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: ts.DiagnosticCategory.Error, key: "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432", message: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433", message: "A namespace declaration cannot be in a different file from a class or function with which it is merged" }, - A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434", message: "A namespace declaration cannot be located prior to a class or function with which it is merged" }, + A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433", message: "A namespace declaration cannot be in a different file from a class or function with which it is merged." }, + A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434", message: "A namespace declaration cannot be located prior to a class or function with which it is merged." }, Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces: { code: 2435, category: ts.DiagnosticCategory.Error, key: "Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435", message: "Ambient modules cannot be nested in other modules or namespaces." }, Ambient_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: ts.DiagnosticCategory.Error, key: "Ambient_module_declaration_cannot_specify_relative_module_name_2436", message: "Ambient module declaration cannot specify relative module name." }, - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: ts.DiagnosticCategory.Error, key: "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437", message: "Module '{0}' is hidden by a local declaration with the same name" }, - Import_name_cannot_be_0: { code: 2438, category: ts.DiagnosticCategory.Error, key: "Import_name_cannot_be_0_2438", message: "Import name cannot be '{0}'" }, + Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: ts.DiagnosticCategory.Error, key: "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437", message: "Module '{0}' is hidden by a local declaration with the same name." }, + Import_name_cannot_be_0: { code: 2438, category: ts.DiagnosticCategory.Error, key: "Import_name_cannot_be_0_2438", message: "Import name cannot be '{0}'." }, Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name: { code: 2439, category: ts.DiagnosticCategory.Error, key: "Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439", message: "Import or export declaration in an ambient module declaration cannot reference module through relative module name." }, - Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: ts.DiagnosticCategory.Error, key: "Import_declaration_conflicts_with_local_declaration_of_0_2440", message: "Import declaration conflicts with local declaration of '{0}'" }, + Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: ts.DiagnosticCategory.Error, key: "Import_declaration_conflicts_with_local_declaration_of_0_2440", message: "Import declaration conflicts with local declaration of '{0}'." }, Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module: { code: 2441, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441", message: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module." }, Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: ts.DiagnosticCategory.Error, key: "Types_have_separate_declarations_of_a_private_property_0_2442", message: "Types have separate declarations of a private property '{0}'." }, Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: ts.DiagnosticCategory.Error, key: "Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443", message: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, @@ -4206,18 +4259,20 @@ var ts; Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: ts.DiagnosticCategory.Error, key: "Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_2446", message: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: ts.DiagnosticCategory.Error, key: "The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447", message: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: ts.DiagnosticCategory.Error, key: "Block_scoped_variable_0_used_before_its_declaration_2448", message: "Block-scoped variable '{0}' used before its declaration." }, + Class_0_used_before_its_declaration: { code: 2449, category: ts.DiagnosticCategory.Error, key: "Class_0_used_before_its_declaration_2449", message: "Class '{0}' used before its declaration." }, + Enum_0_used_before_its_declaration: { code: 2450, category: ts.DiagnosticCategory.Error, key: "Enum_0_used_before_its_declaration_2450", message: "Enum '{0}' used before its declaration." }, Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_block_scoped_variable_0_2451", message: "Cannot redeclare block-scoped variable '{0}'." }, An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: ts.DiagnosticCategory.Error, key: "An_enum_member_cannot_have_a_numeric_name_2452", message: "An enum member cannot have a numeric name." }, The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: ts.DiagnosticCategory.Error, key: "The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_typ_2453", message: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, Variable_0_is_used_before_being_assigned: { code: 2454, category: ts.DiagnosticCategory.Error, key: "Variable_0_is_used_before_being_assigned_2454", message: "Variable '{0}' is used before being assigned." }, Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: ts.DiagnosticCategory.Error, key: "Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0_2455", message: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, Type_alias_0_circularly_references_itself: { code: 2456, category: ts.DiagnosticCategory.Error, key: "Type_alias_0_circularly_references_itself_2456", message: "Type alias '{0}' circularly references itself." }, - Type_alias_name_cannot_be_0: { code: 2457, category: ts.DiagnosticCategory.Error, key: "Type_alias_name_cannot_be_0_2457", message: "Type alias name cannot be '{0}'" }, + Type_alias_name_cannot_be_0: { code: 2457, category: ts.DiagnosticCategory.Error, key: "Type_alias_name_cannot_be_0_2457", message: "Type alias name cannot be '{0}'." }, An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: ts.DiagnosticCategory.Error, key: "An_AMD_module_cannot_have_multiple_name_assignments_2458", message: "An AMD module cannot have multiple name assignments." }, Type_0_has_no_property_1_and_no_string_index_signature: { code: 2459, category: ts.DiagnosticCategory.Error, key: "Type_0_has_no_property_1_and_no_string_index_signature_2459", message: "Type '{0}' has no property '{1}' and no string index signature." }, Type_0_has_no_property_1: { code: 2460, category: ts.DiagnosticCategory.Error, key: "Type_0_has_no_property_1_2460", message: "Type '{0}' has no property '{1}'." }, Type_0_is_not_an_array_type: { code: 2461, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_2461", message: "Type '{0}' is not an array type." }, - A_rest_element_must_be_last_in_a_destructuring_pattern: { code: 2462, category: ts.DiagnosticCategory.Error, key: "A_rest_element_must_be_last_in_a_destructuring_pattern_2462", message: "A rest element must be last in a destructuring pattern" }, + A_rest_element_must_be_last_in_a_destructuring_pattern: { code: 2462, category: ts.DiagnosticCategory.Error, key: "A_rest_element_must_be_last_in_a_destructuring_pattern_2462", message: "A rest element must be last in a destructuring pattern." }, A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { code: 2463, category: ts.DiagnosticCategory.Error, key: "A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463", message: "A binding pattern parameter cannot be optional in an implementation signature." }, A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { code: 2464, category: ts.DiagnosticCategory.Error, key: "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464", message: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." }, this_cannot_be_referenced_in_a_computed_property_name: { code: 2465, category: ts.DiagnosticCategory.Error, key: "this_cannot_be_referenced_in_a_computed_property_name_2465", message: "'this' cannot be referenced in a computed property name." }, @@ -4238,13 +4293,13 @@ var ts; let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2480, category: ts.DiagnosticCategory.Error, key: "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480", message: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2481, category: ts.DiagnosticCategory.Error, key: "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481", message: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." }, The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { code: 2483, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483", message: "The left-hand side of a 'for...of' statement cannot use a type annotation." }, - Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: ts.DiagnosticCategory.Error, key: "Export_declaration_conflicts_with_exported_declaration_of_0_2484", message: "Export declaration conflicts with exported declaration of '{0}'" }, + Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: ts.DiagnosticCategory.Error, key: "Export_declaration_conflicts_with_exported_declaration_of_0_2484", message: "Export declaration conflicts with exported declaration of '{0}'." }, The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access: { code: 2487, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487", message: "The left-hand side of a 'for...of' statement must be a variable or a property access." }, Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: ts.DiagnosticCategory.Error, key: "Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488", message: "Type must have a '[Symbol.iterator]()' method that returns an iterator." }, An_iterator_must_have_a_next_method: { code: 2489, category: ts.DiagnosticCategory.Error, key: "An_iterator_must_have_a_next_method_2489", message: "An iterator must have a 'next()' method." }, The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { code: 2490, category: ts.DiagnosticCategory.Error, key: "The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property_2490", message: "The type returned by the 'next()' method of an iterator must have a 'value' property." }, The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { code: 2491, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491", message: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." }, - Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_identifier_0_in_catch_clause_2492", message: "Cannot redeclare identifier '{0}' in catch clause" }, + Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_identifier_0_in_catch_clause_2492", message: "Cannot redeclare identifier '{0}' in catch clause." }, Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { code: 2493, category: ts.DiagnosticCategory.Error, key: "Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2_2493", message: "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'." }, Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { code: 2494, category: ts.DiagnosticCategory.Error, key: "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494", message: "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher." }, Type_0_is_not_an_array_type_or_a_string_type: { code: 2495, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_or_a_string_type_2495", message: "Type '{0}' is not an array type or a string type." }, @@ -4256,6 +4311,7 @@ var ts; A_rest_element_cannot_contain_a_binding_pattern: { code: 2501, category: ts.DiagnosticCategory.Error, key: "A_rest_element_cannot_contain_a_binding_pattern_2501", message: "A rest element cannot contain a binding pattern." }, _0_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 2502, category: ts.DiagnosticCategory.Error, key: "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502", message: "'{0}' is referenced directly or indirectly in its own type annotation." }, Cannot_find_namespace_0: { code: 2503, category: ts.DiagnosticCategory.Error, key: "Cannot_find_namespace_0_2503", message: "Cannot find namespace '{0}'." }, + Type_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator: { code: 2504, category: ts.DiagnosticCategory.Error, key: "Type_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504", message: "Type must have a '[Symbol.asyncIterator]()' method that returns an async iterator." }, A_generator_cannot_have_a_void_type_annotation: { code: 2505, category: ts.DiagnosticCategory.Error, key: "A_generator_cannot_have_a_void_type_annotation_2505", message: "A generator cannot have a 'void' type annotation." }, _0_is_referenced_directly_or_indirectly_in_its_own_base_expression: { code: 2506, category: ts.DiagnosticCategory.Error, key: "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506", message: "'{0}' is referenced directly or indirectly in its own base expression." }, Type_0_is_not_a_constructor_function_type: { code: 2507, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_a_constructor_function_type_2507", message: "Type '{0}' is not a constructor function type." }, @@ -4270,6 +4326,7 @@ var ts; All_declarations_of_an_abstract_method_must_be_consecutive: { code: 2516, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_an_abstract_method_must_be_consecutive_2516", message: "All declarations of an abstract method must be consecutive." }, Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: { code: 2517, category: ts.DiagnosticCategory.Error, key: "Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517", message: "Cannot assign an abstract constructor type to a non-abstract constructor type." }, A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: { code: 2518, category: ts.DiagnosticCategory.Error, key: "A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518", message: "A 'this'-based type guard is not compatible with a parameter-based type guard." }, + An_async_iterator_must_have_a_next_method: { code: 2519, category: ts.DiagnosticCategory.Error, key: "An_async_iterator_must_have_a_next_method_2519", message: "An async iterator must have a 'next()' method." }, Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: { code: 2520, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520", message: "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions." }, Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: { code: 2521, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions_2521", message: "Expression resolves to variable declaration '{0}' that compiler uses to support async functions." }, The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method: { code: 2522, category: ts.DiagnosticCategory.Error, key: "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522", message: "The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method." }, @@ -4293,23 +4350,33 @@ var ts; Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property: { code: 2540, category: ts.DiagnosticCategory.Error, key: "Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property_2540", message: "Cannot assign to '{0}' because it is a constant or a read-only property." }, The_target_of_an_assignment_must_be_a_variable_or_a_property_access: { code: 2541, category: ts.DiagnosticCategory.Error, key: "The_target_of_an_assignment_must_be_a_variable_or_a_property_access_2541", message: "The target of an assignment must be a variable or a property access." }, Index_signature_in_type_0_only_permits_reading: { code: 2542, category: ts.DiagnosticCategory.Error, key: "Index_signature_in_type_0_only_permits_reading_2542", message: "Index signature in type '{0}' only permits reading." }, + Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference: { code: 2543, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543", message: "Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference." }, + Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference: { code: 2544, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544", message: "Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference." }, + A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any: { code: 2545, category: ts.DiagnosticCategory.Error, key: "A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545", message: "A mixin class must have a constructor with a single rest parameter of type 'any[]'." }, + Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1: { code: 2546, category: ts.DiagnosticCategory.Error, key: "Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1_2546", message: "Property '{0}' has conflicting declarations and is inaccessible in type '{1}'." }, + The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property: { code: 2547, category: ts.DiagnosticCategory.Error, key: "The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value__2547", message: "The type returned by the 'next()' method of an async iterator must be a promise for a type with a 'value' property." }, + Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2548, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548", message: "Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator." }, + Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2549, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549", message: "Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator." }, + Generic_type_instantiation_is_excessively_deep_and_possibly_infinite: { code: 2550, category: ts.DiagnosticCategory.Error, key: "Generic_type_instantiation_is_excessively_deep_and_possibly_infinite_2550", message: "Generic type instantiation is excessively deep and possibly infinite." }, JSX_element_attributes_type_0_may_not_be_a_union_type: { code: 2600, category: ts.DiagnosticCategory.Error, key: "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", message: "JSX element attributes type '{0}' may not be a union type." }, The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: { code: 2601, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", message: "The return type of a JSX element constructor must return an object type." }, JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: { code: 2602, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", message: "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist." }, - Property_0_in_type_1_is_not_assignable_to_type_2: { code: 2603, category: ts.DiagnosticCategory.Error, key: "Property_0_in_type_1_is_not_assignable_to_type_2_2603", message: "Property '{0}' in type '{1}' is not assignable to type '{2}'" }, + Property_0_in_type_1_is_not_assignable_to_type_2: { code: 2603, category: ts.DiagnosticCategory.Error, key: "Property_0_in_type_1_is_not_assignable_to_type_2_2603", message: "Property '{0}' in type '{1}' is not assignable to type '{2}'." }, JSX_element_type_0_does_not_have_any_construct_or_call_signatures: { code: 2604, category: ts.DiagnosticCategory.Error, key: "JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604", message: "JSX element type '{0}' does not have any construct or call signatures." }, JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements: { code: 2605, category: ts.DiagnosticCategory.Error, key: "JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements_2605", message: "JSX element type '{0}' is not a constructor function for JSX elements." }, Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property: { code: 2606, category: ts.DiagnosticCategory.Error, key: "Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606", message: "Property '{0}' of JSX spread attribute is not assignable to target property." }, - JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property: { code: 2607, category: ts.DiagnosticCategory.Error, key: "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607", message: "JSX element class does not support attributes because it does not have a '{0}' property" }, - The_global_type_JSX_0_may_not_have_more_than_one_property: { code: 2608, category: ts.DiagnosticCategory.Error, key: "The_global_type_JSX_0_may_not_have_more_than_one_property_2608", message: "The global type 'JSX.{0}' may not have more than one property" }, - Cannot_emit_namespaced_JSX_elements_in_React: { code: 2650, category: ts.DiagnosticCategory.Error, key: "Cannot_emit_namespaced_JSX_elements_in_React_2650", message: "Cannot emit namespaced JSX elements in React" }, + JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property: { code: 2607, category: ts.DiagnosticCategory.Error, key: "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607", message: "JSX element class does not support attributes because it does not have a '{0}' property." }, + The_global_type_JSX_0_may_not_have_more_than_one_property: { code: 2608, category: ts.DiagnosticCategory.Error, key: "The_global_type_JSX_0_may_not_have_more_than_one_property_2608", message: "The global type 'JSX.{0}' may not have more than one property." }, + JSX_spread_child_must_be_an_array_type: { code: 2609, category: ts.DiagnosticCategory.Error, key: "JSX_spread_child_must_be_an_array_type_2609", message: "JSX spread child must be an array type." }, + Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: { code: 2649, category: ts.DiagnosticCategory.Error, key: "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", message: "Cannot augment module '{0}' with value exports because it resolves to a non-module entity." }, + Cannot_emit_namespaced_JSX_elements_in_React: { code: 2650, category: ts.DiagnosticCategory.Error, key: "Cannot_emit_namespaced_JSX_elements_in_React_2650", message: "Cannot emit namespaced JSX elements in React." }, A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: { code: 2651, category: ts.DiagnosticCategory.Error, key: "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", message: "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums." }, Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: { code: 2652, category: ts.DiagnosticCategory.Error, key: "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", message: "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead." }, Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1: { code: 2653, category: ts.DiagnosticCategory.Error, key: "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653", message: "Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'." }, Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_package_author_to_update_the_package_definition: { code: 2654, category: ts.DiagnosticCategory.Error, key: "Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_pack_2654", message: "Exported external package typings file cannot contain tripleslash references. Please contact the package author to update the package definition." }, Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition: { code: 2656, category: ts.DiagnosticCategory.Error, key: "Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_2656", message: "Exported external package typings file '{0}' is not a module. Please contact the package author to update the package definition." }, - JSX_expressions_must_have_one_parent_element: { code: 2657, category: ts.DiagnosticCategory.Error, key: "JSX_expressions_must_have_one_parent_element_2657", message: "JSX expressions must have one parent element" }, - Type_0_provides_no_match_for_the_signature_1: { code: 2658, category: ts.DiagnosticCategory.Error, key: "Type_0_provides_no_match_for_the_signature_1_2658", message: "Type '{0}' provides no match for the signature '{1}'" }, + JSX_expressions_must_have_one_parent_element: { code: 2657, category: ts.DiagnosticCategory.Error, key: "JSX_expressions_must_have_one_parent_element_2657", message: "JSX expressions must have one parent element." }, + Type_0_provides_no_match_for_the_signature_1: { code: 2658, category: ts.DiagnosticCategory.Error, key: "Type_0_provides_no_match_for_the_signature_1_2658", message: "Type '{0}' provides no match for the signature '{1}'." }, super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: { code: 2659, category: ts.DiagnosticCategory.Error, key: "super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659", message: "'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher." }, super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: { code: 2660, category: ts.DiagnosticCategory.Error, key: "super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660", message: "'super' can only be referenced in members of derived classes or object literal expressions." }, Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module: { code: 2661, category: ts.DiagnosticCategory.Error, key: "Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661", message: "Cannot export '{0}'. Only local declarations can be exported from a module." }, @@ -4341,7 +4408,6 @@ var ts; All_declarations_of_0_must_have_identical_modifiers: { code: 2687, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_0_must_have_identical_modifiers_2687", message: "All declarations of '{0}' must have identical modifiers." }, Cannot_find_type_definition_file_for_0: { code: 2688, category: ts.DiagnosticCategory.Error, key: "Cannot_find_type_definition_file_for_0_2688", message: "Cannot find type definition file for '{0}'." }, Cannot_extend_an_interface_0_Did_you_mean_implements: { code: 2689, category: ts.DiagnosticCategory.Error, key: "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", message: "Cannot extend an interface '{0}'. Did you mean 'implements'?" }, - A_class_must_be_declared_after_its_base_class: { code: 2690, category: ts.DiagnosticCategory.Error, key: "A_class_must_be_declared_after_its_base_class_2690", message: "A class must be declared after its base class." }, An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: { code: 2691, category: ts.DiagnosticCategory.Error, key: "An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691", message: "An import path cannot end with a '{0}' extension. Consider importing '{1}' instead." }, _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: { code: 2692, category: ts.DiagnosticCategory.Error, key: "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", message: "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible." }, _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: { code: 2693, category: ts.DiagnosticCategory.Error, key: "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", message: "'{0}' only refers to a type, but is being used as a value here." }, @@ -4350,9 +4416,17 @@ var ts; The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead: { code: 2696, category: ts.DiagnosticCategory.Error, key: "The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696", message: "The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?" }, An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: { code: 2697, category: ts.DiagnosticCategory.Error, key: "An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697", message: "An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your `--lib` option." }, Spread_types_may_only_be_created_from_object_types: { code: 2698, category: ts.DiagnosticCategory.Error, key: "Spread_types_may_only_be_created_from_object_types_2698", message: "Spread types may only be created from object types." }, + Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1: { code: 2699, category: ts.DiagnosticCategory.Error, key: "Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699", message: "Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'." }, Rest_types_may_only_be_created_from_object_types: { code: 2700, category: ts.DiagnosticCategory.Error, key: "Rest_types_may_only_be_created_from_object_types_2700", message: "Rest types may only be created from object types." }, The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access: { code: 2701, category: ts.DiagnosticCategory.Error, key: "The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701", message: "The target of an object rest assignment must be a variable or a property access." }, _0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here: { code: 2702, category: ts.DiagnosticCategory.Error, key: "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702", message: "'{0}' only refers to a type, but is being used as a namespace here." }, + The_operand_of_a_delete_operator_must_be_a_property_reference: { code: 2703, category: ts.DiagnosticCategory.Error, key: "The_operand_of_a_delete_operator_must_be_a_property_reference_2703", message: "The operand of a delete operator must be a property reference." }, + The_operand_of_a_delete_operator_cannot_be_a_read_only_property: { code: 2704, category: ts.DiagnosticCategory.Error, key: "The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704", message: "The operand of a delete operator cannot be a read-only property." }, + An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: { code: 2705, category: ts.DiagnosticCategory.Error, key: "An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705", message: "An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option." }, + Required_type_parameters_may_not_follow_optional_type_parameters: { code: 2706, category: ts.DiagnosticCategory.Error, key: "Required_type_parameters_may_not_follow_optional_type_parameters_2706", message: "Required type parameters may not follow optional type parameters." }, + Generic_type_0_requires_between_1_and_2_type_arguments: { code: 2707, category: ts.DiagnosticCategory.Error, key: "Generic_type_0_requires_between_1_and_2_type_arguments_2707", message: "Generic type '{0}' requires between {1} and {2} type arguments." }, + Cannot_use_namespace_0_as_a_value: { code: 2708, category: ts.DiagnosticCategory.Error, key: "Cannot_use_namespace_0_as_a_value_2708", message: "Cannot use namespace '{0}' as a value." }, + Cannot_use_namespace_0_as_a_type: { code: 2709, category: ts.DiagnosticCategory.Error, key: "Cannot_use_namespace_0_as_a_type_2709", message: "Cannot use namespace '{0}' as a type." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "Import_declaration_0_is_using_private_name_1_4000", message: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", message: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", message: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, @@ -4363,8 +4437,8 @@ var ts; Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014", message: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016", message: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: ts.DiagnosticCategory.Error, key: "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019", message: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: ts.DiagnosticCategory.Error, key: "Extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020", message: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: ts.DiagnosticCategory.Error, key: "Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022", message: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, + extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: ts.DiagnosticCategory.Error, key: "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020", message: "'extends' clause of exported class '{0}' has or is using private name '{1}'." }, + extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: ts.DiagnosticCategory.Error, key: "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022", message: "'extends' clause of exported interface '{0}' has or is using private name '{1}'." }, Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: ts.DiagnosticCategory.Error, key: "Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023", message: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: ts.DiagnosticCategory.Error, key: "Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024", message: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: ts.DiagnosticCategory.Error, key: "Exported_variable_0_has_or_is_using_private_name_1_4025", message: "Exported variable '{0}' has or is using private name '{1}'." }, @@ -4425,16 +4499,18 @@ var ts; Default_export_of_the_module_has_or_is_using_private_name_0: { code: 4082, category: ts.DiagnosticCategory.Error, key: "Default_export_of_the_module_has_or_is_using_private_name_0_4082", message: "Default export of the module has or is using private name '{0}'." }, Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: { code: 4083, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", message: "Type parameter '{0}' of exported type alias has or is using private name '{1}'." }, Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: { code: 4090, category: ts.DiagnosticCategory.Message, key: "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", message: "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict." }, + Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4091, category: ts.DiagnosticCategory.Error, key: "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", message: "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4092, category: ts.DiagnosticCategory.Error, key: "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", message: "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'." }, + extends_clause_of_exported_class_0_refers_to_a_type_whose_name_cannot_be_referenced: { code: 4093, category: ts.DiagnosticCategory.Error, key: "extends_clause_of_exported_class_0_refers_to_a_type_whose_name_cannot_be_referenced_4093", message: "'extends' clause of exported class '{0}' refers to a type whose name cannot be referenced." }, The_current_host_does_not_support_the_0_option: { code: 5001, category: ts.DiagnosticCategory.Error, key: "The_current_host_does_not_support_the_0_option_5001", message: "The current host does not support the '{0}' option." }, Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: ts.DiagnosticCategory.Error, key: "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", message: "Cannot find the common subdirectory path for the input files." }, File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: { code: 5010, category: ts.DiagnosticCategory.Error, key: "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", message: "File specification cannot end in a recursive directory wildcard ('**'): '{0}'." }, File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0: { code: 5011, category: ts.DiagnosticCategory.Error, key: "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011", message: "File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'." }, - Cannot_read_file_0_Colon_1: { code: 5012, category: ts.DiagnosticCategory.Error, key: "Cannot_read_file_0_Colon_1_5012", message: "Cannot read file '{0}': {1}" }, - Unsupported_file_encoding: { code: 5013, category: ts.DiagnosticCategory.Error, key: "Unsupported_file_encoding_5013", message: "Unsupported file encoding." }, + Cannot_read_file_0_Colon_1: { code: 5012, category: ts.DiagnosticCategory.Error, key: "Cannot_read_file_0_Colon_1_5012", message: "Cannot read file '{0}': {1}." }, Failed_to_parse_file_0_Colon_1: { code: 5014, category: ts.DiagnosticCategory.Error, key: "Failed_to_parse_file_0_Colon_1_5014", message: "Failed to parse file '{0}': {1}." }, Unknown_compiler_option_0: { code: 5023, category: ts.DiagnosticCategory.Error, key: "Unknown_compiler_option_0_5023", message: "Unknown compiler option '{0}'." }, Compiler_option_0_requires_a_value_of_type_1: { code: 5024, category: ts.DiagnosticCategory.Error, key: "Compiler_option_0_requires_a_value_of_type_1_5024", message: "Compiler option '{0}' requires a value of type {1}." }, - Could_not_write_file_0_Colon_1: { code: 5033, category: ts.DiagnosticCategory.Error, key: "Could_not_write_file_0_Colon_1_5033", message: "Could not write file '{0}': {1}" }, + Could_not_write_file_0_Colon_1: { code: 5033, category: ts.DiagnosticCategory.Error, key: "Could_not_write_file_0_Colon_1_5033", message: "Could not write file '{0}': {1}." }, Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: ts.DiagnosticCategory.Error, key: "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042", message: "Option 'project' cannot be mixed with source files on a command line." }, Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher: { code: 5047, category: ts.DiagnosticCategory.Error, key: "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047", message: "Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher." }, Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: { code: 5051, category: ts.DiagnosticCategory.Error, key: "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051", message: "Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided." }, @@ -4443,12 +4519,12 @@ var ts; A_tsconfig_json_file_is_already_defined_at_Colon_0: { code: 5054, category: ts.DiagnosticCategory.Error, key: "A_tsconfig_json_file_is_already_defined_at_Colon_0_5054", message: "A 'tsconfig.json' file is already defined at: '{0}'." }, Cannot_write_file_0_because_it_would_overwrite_input_file: { code: 5055, category: ts.DiagnosticCategory.Error, key: "Cannot_write_file_0_because_it_would_overwrite_input_file_5055", message: "Cannot write file '{0}' because it would overwrite input file." }, Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files: { code: 5056, category: ts.DiagnosticCategory.Error, key: "Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056", message: "Cannot write file '{0}' because it would be overwritten by multiple input files." }, - Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: { code: 5057, category: ts.DiagnosticCategory.Error, key: "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", message: "Cannot find a tsconfig.json file at the specified directory: '{0}'" }, - The_specified_path_does_not_exist_Colon_0: { code: 5058, category: ts.DiagnosticCategory.Error, key: "The_specified_path_does_not_exist_Colon_0_5058", message: "The specified path does not exist: '{0}'" }, + Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: { code: 5057, category: ts.DiagnosticCategory.Error, key: "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", message: "Cannot find a tsconfig.json file at the specified directory: '{0}'." }, + The_specified_path_does_not_exist_Colon_0: { code: 5058, category: ts.DiagnosticCategory.Error, key: "The_specified_path_does_not_exist_Colon_0_5058", message: "The specified path does not exist: '{0}'." }, Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: { code: 5059, category: ts.DiagnosticCategory.Error, key: "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", message: "Invalid value for '--reactNamespace'. '{0}' is not a valid identifier." }, Option_paths_cannot_be_used_without_specifying_baseUrl_option: { code: 5060, category: ts.DiagnosticCategory.Error, key: "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060", message: "Option 'paths' cannot be used without specifying '--baseUrl' option." }, - Pattern_0_can_have_at_most_one_Asterisk_character: { code: 5061, category: ts.DiagnosticCategory.Error, key: "Pattern_0_can_have_at_most_one_Asterisk_character_5061", message: "Pattern '{0}' can have at most one '*' character" }, - Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character: { code: 5062, category: ts.DiagnosticCategory.Error, key: "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062", message: "Substitution '{0}' in pattern '{1}' in can have at most one '*' character" }, + Pattern_0_can_have_at_most_one_Asterisk_character: { code: 5061, category: ts.DiagnosticCategory.Error, key: "Pattern_0_can_have_at_most_one_Asterisk_character_5061", message: "Pattern '{0}' can have at most one '*' character." }, + Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character: { code: 5062, category: ts.DiagnosticCategory.Error, key: "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062", message: "Substitution '{0}' in pattern '{1}' in can have at most one '*' character." }, Substitutions_for_pattern_0_should_be_an_array: { code: 5063, category: ts.DiagnosticCategory.Error, key: "Substitutions_for_pattern_0_should_be_an_array_5063", message: "Substitutions for pattern '{0}' should be an array." }, Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2: { code: 5064, category: ts.DiagnosticCategory.Error, key: "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064", message: "Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'." }, File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: { code: 5065, category: ts.DiagnosticCategory.Error, key: "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065", message: "File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'." }, @@ -4466,11 +4542,11 @@ var ts; Do_not_emit_outputs: { code: 6010, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_outputs_6010", message: "Do not emit outputs." }, Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: { code: 6011, category: ts.DiagnosticCategory.Message, key: "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", message: "Allow default imports from modules with no default export. This does not affect code emit, just typechecking." }, Skip_type_checking_of_declaration_files: { code: 6012, category: ts.DiagnosticCategory.Message, key: "Skip_type_checking_of_declaration_files_6012", message: "Skip type checking of declaration files." }, - Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015_6015", message: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES2015'" }, - Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015_6016", message: "Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'" }, + Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015", message: "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'." }, + Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015_6016", message: "Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'." }, Print_this_message: { code: 6017, category: ts.DiagnosticCategory.Message, key: "Print_this_message_6017", message: "Print this message." }, Print_the_compiler_s_version: { code: 6019, category: ts.DiagnosticCategory.Message, key: "Print_the_compiler_s_version_6019", message: "Print the compiler's version." }, - Compile_the_project_in_the_given_directory: { code: 6020, category: ts.DiagnosticCategory.Message, key: "Compile_the_project_in_the_given_directory_6020", message: "Compile the project in the given directory." }, + Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json: { code: 6020, category: ts.DiagnosticCategory.Message, key: "Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020", message: "Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'." }, Syntax_Colon_0: { code: 6023, category: ts.DiagnosticCategory.Message, key: "Syntax_Colon_0_6023", message: "Syntax: {0}" }, options: { code: 6024, category: ts.DiagnosticCategory.Message, key: "options_6024", message: "options" }, file: { code: 6025, category: ts.DiagnosticCategory.Message, key: "file_6025", message: "file" }, @@ -4485,11 +4561,12 @@ var ts; LOCATION: { code: 6037, category: ts.DiagnosticCategory.Message, key: "LOCATION_6037", message: "LOCATION" }, DIRECTORY: { code: 6038, category: ts.DiagnosticCategory.Message, key: "DIRECTORY_6038", message: "DIRECTORY" }, STRATEGY: { code: 6039, category: ts.DiagnosticCategory.Message, key: "STRATEGY_6039", message: "STRATEGY" }, + FILE_OR_DIRECTORY: { code: 6040, category: ts.DiagnosticCategory.Message, key: "FILE_OR_DIRECTORY_6040", message: "FILE OR DIRECTORY" }, Compilation_complete_Watching_for_file_changes: { code: 6042, category: ts.DiagnosticCategory.Message, key: "Compilation_complete_Watching_for_file_changes_6042", message: "Compilation complete. Watching for file changes." }, Generates_corresponding_map_file: { code: 6043, category: ts.DiagnosticCategory.Message, key: "Generates_corresponding_map_file_6043", message: "Generates corresponding '.map' file." }, Compiler_option_0_expects_an_argument: { code: 6044, category: ts.DiagnosticCategory.Error, key: "Compiler_option_0_expects_an_argument_6044", message: "Compiler option '{0}' expects an argument." }, Unterminated_quoted_string_in_response_file_0: { code: 6045, category: ts.DiagnosticCategory.Error, key: "Unterminated_quoted_string_in_response_file_0_6045", message: "Unterminated quoted string in response file '{0}'." }, - Argument_for_0_option_must_be_Colon_1: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument_for_0_option_must_be_Colon_1_6046", message: "Argument for '{0}' option must be: {1}" }, + Argument_for_0_option_must_be_Colon_1: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument_for_0_option_must_be_Colon_1_6046", message: "Argument for '{0}' option must be: {1}." }, Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: ts.DiagnosticCategory.Error, key: "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048", message: "Locale must be of the form or -. For example '{0}' or '{1}'." }, Unsupported_locale_0: { code: 6049, category: ts.DiagnosticCategory.Error, key: "Unsupported_locale_0_6049", message: "Unsupported locale '{0}'." }, Unable_to_open_file_0: { code: 6050, category: ts.DiagnosticCategory.Error, key: "Unable_to_open_file_0_6050", message: "Unable to open file '{0}'." }, @@ -4511,17 +4588,18 @@ var ts; Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file: { code: 6070, category: ts.DiagnosticCategory.Message, key: "Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070", message: "Initializes a TypeScript project and creates a tsconfig.json file." }, Successfully_created_a_tsconfig_json_file: { code: 6071, category: ts.DiagnosticCategory.Message, key: "Successfully_created_a_tsconfig_json_file_6071", message: "Successfully created a tsconfig.json file." }, Suppress_excess_property_checks_for_object_literals: { code: 6072, category: ts.DiagnosticCategory.Message, key: "Suppress_excess_property_checks_for_object_literals_6072", message: "Suppress excess property checks for object literals." }, - Stylize_errors_and_messages_using_color_and_context_experimental: { code: 6073, category: ts.DiagnosticCategory.Message, key: "Stylize_errors_and_messages_using_color_and_context_experimental_6073", message: "Stylize errors and messages using color and context. (experimental)" }, + Stylize_errors_and_messages_using_color_and_context_experimental: { code: 6073, category: ts.DiagnosticCategory.Message, key: "Stylize_errors_and_messages_using_color_and_context_experimental_6073", message: "Stylize errors and messages using color and context (experimental)." }, Do_not_report_errors_on_unused_labels: { code: 6074, category: ts.DiagnosticCategory.Message, key: "Do_not_report_errors_on_unused_labels_6074", message: "Do not report errors on unused labels." }, Report_error_when_not_all_code_paths_in_function_return_a_value: { code: 6075, category: ts.DiagnosticCategory.Message, key: "Report_error_when_not_all_code_paths_in_function_return_a_value_6075", message: "Report error when not all code paths in function return a value." }, Report_errors_for_fallthrough_cases_in_switch_statement: { code: 6076, category: ts.DiagnosticCategory.Message, key: "Report_errors_for_fallthrough_cases_in_switch_statement_6076", message: "Report errors for fallthrough cases in switch statement." }, Do_not_report_errors_on_unreachable_code: { code: 6077, category: ts.DiagnosticCategory.Message, key: "Do_not_report_errors_on_unreachable_code_6077", message: "Do not report errors on unreachable code." }, Disallow_inconsistently_cased_references_to_the_same_file: { code: 6078, category: ts.DiagnosticCategory.Message, key: "Disallow_inconsistently_cased_references_to_the_same_file_6078", message: "Disallow inconsistently-cased references to the same file." }, Specify_library_files_to_be_included_in_the_compilation_Colon: { code: 6079, category: ts.DiagnosticCategory.Message, key: "Specify_library_files_to_be_included_in_the_compilation_Colon_6079", message: "Specify library files to be included in the compilation: " }, - Specify_JSX_code_generation_Colon_preserve_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify_JSX_code_generation_Colon_preserve_or_react_6080", message: "Specify JSX code generation: 'preserve' or 'react'" }, + Specify_JSX_code_generation_Colon_preserve_react_native_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080", message: "Specify JSX code generation: 'preserve', 'react-native', or 'react'." }, + File_0_has_an_unsupported_extension_so_skipping_it: { code: 6081, category: ts.DiagnosticCategory.Message, key: "File_0_has_an_unsupported_extension_so_skipping_it_6081", message: "File '{0}' has an unsupported extension, so skipping it." }, Only_amd_and_system_modules_are_supported_alongside_0: { code: 6082, category: ts.DiagnosticCategory.Error, key: "Only_amd_and_system_modules_are_supported_alongside_0_6082", message: "Only 'amd' and 'system' modules are supported alongside --{0}." }, Base_directory_to_resolve_non_absolute_module_names: { code: 6083, category: ts.DiagnosticCategory.Message, key: "Base_directory_to_resolve_non_absolute_module_names_6083", message: "Base directory to resolve non-absolute module names." }, - Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit: { code: 6084, category: ts.DiagnosticCategory.Message, key: "Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit_6084", message: "Specify the object invoked for createElement and __spread when targeting 'react' JSX emit" }, + Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit: { code: 6084, category: ts.DiagnosticCategory.Message, key: "Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084", message: "[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit" }, Enable_tracing_of_the_name_resolution_process: { code: 6085, category: ts.DiagnosticCategory.Message, key: "Enable_tracing_of_the_name_resolution_process_6085", message: "Enable tracing of the name resolution process." }, Resolving_module_0_from_1: { code: 6086, category: ts.DiagnosticCategory.Message, key: "Resolving_module_0_from_1_6086", message: "======== Resolving module '{0}' from '{1}'. ========" }, Explicitly_specified_module_resolution_kind_Colon_0: { code: 6087, category: ts.DiagnosticCategory.Message, key: "Explicitly_specified_module_resolution_kind_Colon_0_6087", message: "Explicitly specified module resolution kind: '{0}'." }, @@ -4532,23 +4610,23 @@ var ts; Module_name_0_matched_pattern_1: { code: 6092, category: ts.DiagnosticCategory.Message, key: "Module_name_0_matched_pattern_1_6092", message: "Module name '{0}', matched pattern '{1}'." }, Trying_substitution_0_candidate_module_location_Colon_1: { code: 6093, category: ts.DiagnosticCategory.Message, key: "Trying_substitution_0_candidate_module_location_Colon_1_6093", message: "Trying substitution '{0}', candidate module location: '{1}'." }, Resolving_module_name_0_relative_to_base_url_1_2: { code: 6094, category: ts.DiagnosticCategory.Message, key: "Resolving_module_name_0_relative_to_base_url_1_2_6094", message: "Resolving module name '{0}' relative to base url '{1}' - '{2}'." }, - Loading_module_as_file_Slash_folder_candidate_module_location_0: { code: 6095, category: ts.DiagnosticCategory.Message, key: "Loading_module_as_file_Slash_folder_candidate_module_location_0_6095", message: "Loading module as file / folder, candidate module location '{0}'." }, + Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1: { code: 6095, category: ts.DiagnosticCategory.Message, key: "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1_6095", message: "Loading module as file / folder, candidate module location '{0}', target file type '{1}'." }, File_0_does_not_exist: { code: 6096, category: ts.DiagnosticCategory.Message, key: "File_0_does_not_exist_6096", message: "File '{0}' does not exist." }, File_0_exist_use_it_as_a_name_resolution_result: { code: 6097, category: ts.DiagnosticCategory.Message, key: "File_0_exist_use_it_as_a_name_resolution_result_6097", message: "File '{0}' exist - use it as a name resolution result." }, - Loading_module_0_from_node_modules_folder: { code: 6098, category: ts.DiagnosticCategory.Message, key: "Loading_module_0_from_node_modules_folder_6098", message: "Loading module '{0}' from 'node_modules' folder." }, + Loading_module_0_from_node_modules_folder_target_file_type_1: { code: 6098, category: ts.DiagnosticCategory.Message, key: "Loading_module_0_from_node_modules_folder_target_file_type_1_6098", message: "Loading module '{0}' from 'node_modules' folder, target file type '{1}'." }, Found_package_json_at_0: { code: 6099, category: ts.DiagnosticCategory.Message, key: "Found_package_json_at_0_6099", message: "Found 'package.json' at '{0}'." }, - package_json_does_not_have_a_types_or_main_field: { code: 6100, category: ts.DiagnosticCategory.Message, key: "package_json_does_not_have_a_types_or_main_field_6100", message: "'package.json' does not have a 'types' or 'main' field." }, + package_json_does_not_have_a_0_field: { code: 6100, category: ts.DiagnosticCategory.Message, key: "package_json_does_not_have_a_0_field_6100", message: "'package.json' does not have a '{0}' field." }, package_json_has_0_field_1_that_references_2: { code: 6101, category: ts.DiagnosticCategory.Message, key: "package_json_has_0_field_1_that_references_2_6101", message: "'package.json' has '{0}' field '{1}' that references '{2}'." }, Allow_javascript_files_to_be_compiled: { code: 6102, category: ts.DiagnosticCategory.Message, key: "Allow_javascript_files_to_be_compiled_6102", message: "Allow javascript files to be compiled." }, Option_0_should_have_array_of_strings_as_a_value: { code: 6103, category: ts.DiagnosticCategory.Error, key: "Option_0_should_have_array_of_strings_as_a_value_6103", message: "Option '{0}' should have array of strings as a value." }, Checking_if_0_is_the_longest_matching_prefix_for_1_2: { code: 6104, category: ts.DiagnosticCategory.Message, key: "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104", message: "Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'." }, Expected_type_of_0_field_in_package_json_to_be_string_got_1: { code: 6105, category: ts.DiagnosticCategory.Message, key: "Expected_type_of_0_field_in_package_json_to_be_string_got_1_6105", message: "Expected type of '{0}' field in 'package.json' to be 'string', got '{1}'." }, - baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1: { code: 6106, category: ts.DiagnosticCategory.Message, key: "baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106", message: "'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'" }, - rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0: { code: 6107, category: ts.DiagnosticCategory.Message, key: "rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107", message: "'rootDirs' option is set, using it to resolve relative module name '{0}'" }, - Longest_matching_prefix_for_0_is_1: { code: 6108, category: ts.DiagnosticCategory.Message, key: "Longest_matching_prefix_for_0_is_1_6108", message: "Longest matching prefix for '{0}' is '{1}'" }, - Loading_0_from_the_root_dir_1_candidate_location_2: { code: 6109, category: ts.DiagnosticCategory.Message, key: "Loading_0_from_the_root_dir_1_candidate_location_2_6109", message: "Loading '{0}' from the root dir '{1}', candidate location '{2}'" }, - Trying_other_entries_in_rootDirs: { code: 6110, category: ts.DiagnosticCategory.Message, key: "Trying_other_entries_in_rootDirs_6110", message: "Trying other entries in 'rootDirs'" }, - Module_resolution_using_rootDirs_has_failed: { code: 6111, category: ts.DiagnosticCategory.Message, key: "Module_resolution_using_rootDirs_has_failed_6111", message: "Module resolution using 'rootDirs' has failed" }, + baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1: { code: 6106, category: ts.DiagnosticCategory.Message, key: "baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106", message: "'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'." }, + rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0: { code: 6107, category: ts.DiagnosticCategory.Message, key: "rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107", message: "'rootDirs' option is set, using it to resolve relative module name '{0}'." }, + Longest_matching_prefix_for_0_is_1: { code: 6108, category: ts.DiagnosticCategory.Message, key: "Longest_matching_prefix_for_0_is_1_6108", message: "Longest matching prefix for '{0}' is '{1}'." }, + Loading_0_from_the_root_dir_1_candidate_location_2: { code: 6109, category: ts.DiagnosticCategory.Message, key: "Loading_0_from_the_root_dir_1_candidate_location_2_6109", message: "Loading '{0}' from the root dir '{1}', candidate location '{2}'." }, + Trying_other_entries_in_rootDirs: { code: 6110, category: ts.DiagnosticCategory.Message, key: "Trying_other_entries_in_rootDirs_6110", message: "Trying other entries in 'rootDirs'." }, + Module_resolution_using_rootDirs_has_failed: { code: 6111, category: ts.DiagnosticCategory.Message, key: "Module_resolution_using_rootDirs_has_failed_6111", message: "Module resolution using 'rootDirs' has failed." }, Do_not_emit_use_strict_directives_in_module_output: { code: 6112, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_use_strict_directives_in_module_output_6112", message: "Do not emit 'use strict' directives in module output." }, Enable_strict_null_checks: { code: 6113, category: ts.DiagnosticCategory.Message, key: "Enable_strict_null_checks_6113", message: "Enable strict null checks." }, Unknown_option_excludes_Did_you_mean_exclude: { code: 6114, category: ts.DiagnosticCategory.Error, key: "Unknown_option_excludes_Did_you_mean_exclude_6114", message: "Unknown option 'excludes'. Did you mean 'exclude'?" }, @@ -4558,32 +4636,67 @@ var ts; Resolving_from_node_modules_folder: { code: 6118, category: ts.DiagnosticCategory.Message, key: "Resolving_from_node_modules_folder_6118", message: "Resolving from node_modules folder..." }, Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2: { code: 6119, category: ts.DiagnosticCategory.Message, key: "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119", message: "======== Type reference directive '{0}' was successfully resolved to '{1}', primary: {2}. ========" }, Type_reference_directive_0_was_not_resolved: { code: 6120, category: ts.DiagnosticCategory.Message, key: "Type_reference_directive_0_was_not_resolved_6120", message: "======== Type reference directive '{0}' was not resolved. ========" }, - Resolving_with_primary_search_path_0: { code: 6121, category: ts.DiagnosticCategory.Message, key: "Resolving_with_primary_search_path_0_6121", message: "Resolving with primary search path '{0}'" }, + Resolving_with_primary_search_path_0: { code: 6121, category: ts.DiagnosticCategory.Message, key: "Resolving_with_primary_search_path_0_6121", message: "Resolving with primary search path '{0}'." }, Root_directory_cannot_be_determined_skipping_primary_search_paths: { code: 6122, category: ts.DiagnosticCategory.Message, key: "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122", message: "Root directory cannot be determined, skipping primary search paths." }, Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set: { code: 6123, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123", message: "======== Resolving type reference directive '{0}', containing file '{1}', root directory not set. ========" }, Type_declaration_files_to_be_included_in_compilation: { code: 6124, category: ts.DiagnosticCategory.Message, key: "Type_declaration_files_to_be_included_in_compilation_6124", message: "Type declaration files to be included in compilation." }, - Looking_up_in_node_modules_folder_initial_location_0: { code: 6125, category: ts.DiagnosticCategory.Message, key: "Looking_up_in_node_modules_folder_initial_location_0_6125", message: "Looking up in 'node_modules' folder, initial location '{0}'" }, + Looking_up_in_node_modules_folder_initial_location_0: { code: 6125, category: ts.DiagnosticCategory.Message, key: "Looking_up_in_node_modules_folder_initial_location_0_6125", message: "Looking up in 'node_modules' folder, initial location '{0}'." }, Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder: { code: 6126, category: ts.DiagnosticCategory.Message, key: "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126", message: "Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder." }, Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1: { code: 6127, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127", message: "======== Resolving type reference directive '{0}', containing file not set, root directory '{1}'. ========" }, Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set: { code: 6128, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128", message: "======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========" }, The_config_file_0_found_doesn_t_contain_any_source_files: { code: 6129, category: ts.DiagnosticCategory.Error, key: "The_config_file_0_found_doesn_t_contain_any_source_files_6129", message: "The config file '{0}' found doesn't contain any source files." }, - Resolving_real_path_for_0_result_1: { code: 6130, category: ts.DiagnosticCategory.Message, key: "Resolving_real_path_for_0_result_1_6130", message: "Resolving real path for '{0}', result '{1}'" }, + Resolving_real_path_for_0_result_1: { code: 6130, category: ts.DiagnosticCategory.Message, key: "Resolving_real_path_for_0_result_1_6130", message: "Resolving real path for '{0}', result '{1}'." }, Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system: { code: 6131, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131", message: "Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'." }, - File_name_0_has_a_1_extension_stripping_it: { code: 6132, category: ts.DiagnosticCategory.Message, key: "File_name_0_has_a_1_extension_stripping_it_6132", message: "File name '{0}' has a '{1}' extension - stripping it" }, + File_name_0_has_a_1_extension_stripping_it: { code: 6132, category: ts.DiagnosticCategory.Message, key: "File_name_0_has_a_1_extension_stripping_it_6132", message: "File name '{0}' has a '{1}' extension - stripping it." }, _0_is_declared_but_never_used: { code: 6133, category: ts.DiagnosticCategory.Error, key: "_0_is_declared_but_never_used_6133", message: "'{0}' is declared but never used." }, Report_errors_on_unused_locals: { code: 6134, category: ts.DiagnosticCategory.Message, key: "Report_errors_on_unused_locals_6134", message: "Report errors on unused locals." }, Report_errors_on_unused_parameters: { code: 6135, category: ts.DiagnosticCategory.Message, key: "Report_errors_on_unused_parameters_6135", message: "Report errors on unused parameters." }, - The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files: { code: 6136, category: ts.DiagnosticCategory.Message, key: "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136", message: "The maximum dependency depth to search under node_modules and load JavaScript files" }, - No_types_specified_in_package_json_so_returning_main_value_of_0: { code: 6137, category: ts.DiagnosticCategory.Message, key: "No_types_specified_in_package_json_so_returning_main_value_of_0_6137", message: "No types specified in 'package.json', so returning 'main' value of '{0}'" }, + The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files: { code: 6136, category: ts.DiagnosticCategory.Message, key: "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136", message: "The maximum dependency depth to search under node_modules and load JavaScript files." }, Property_0_is_declared_but_never_used: { code: 6138, category: ts.DiagnosticCategory.Error, key: "Property_0_is_declared_but_never_used_6138", message: "Property '{0}' is declared but never used." }, Import_emit_helpers_from_tslib: { code: 6139, category: ts.DiagnosticCategory.Message, key: "Import_emit_helpers_from_tslib_6139", message: "Import emit helpers from 'tslib'." }, Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2: { code: 6140, category: ts.DiagnosticCategory.Error, key: "Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140", message: "Auto discovery for typings is enabled in project '{0}'. Running extra resolution pass for module '{1}' using cache location '{2}'." }, - Parse_in_strict_mode_and_emit_use_strict_for_each_source_file: { code: 6141, category: ts.DiagnosticCategory.Message, key: "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141", message: "Parse in strict mode and emit \"use strict\" for each source file" }, + Parse_in_strict_mode_and_emit_use_strict_for_each_source_file: { code: 6141, category: ts.DiagnosticCategory.Message, key: "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141", message: "Parse in strict mode and emit \"use strict\" for each source file." }, Module_0_was_resolved_to_1_but_jsx_is_not_set: { code: 6142, category: ts.DiagnosticCategory.Error, key: "Module_0_was_resolved_to_1_but_jsx_is_not_set_6142", message: "Module '{0}' was resolved to '{1}', but '--jsx' is not set." }, Module_0_was_resolved_to_1_but_allowJs_is_not_set: { code: 6143, category: ts.DiagnosticCategory.Error, key: "Module_0_was_resolved_to_1_but_allowJs_is_not_set_6143", message: "Module '{0}' was resolved to '{1}', but '--allowJs' is not set." }, Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1: { code: 6144, category: ts.DiagnosticCategory.Message, key: "Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144", message: "Module '{0}' was resolved as locally declared ambient module in file '{1}'." }, Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified: { code: 6145, category: ts.DiagnosticCategory.Message, key: "Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified_6145", message: "Module '{0}' was resolved as ambient module declared in '{1}' since this file was not modified." }, Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h: { code: 6146, category: ts.DiagnosticCategory.Message, key: "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146", message: "Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'." }, + Resolution_for_module_0_was_found_in_cache: { code: 6147, category: ts.DiagnosticCategory.Message, key: "Resolution_for_module_0_was_found_in_cache_6147", message: "Resolution for module '{0}' was found in cache." }, + Directory_0_does_not_exist_skipping_all_lookups_in_it: { code: 6148, category: ts.DiagnosticCategory.Message, key: "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148", message: "Directory '{0}' does not exist, skipping all lookups in it." }, + Show_diagnostic_information: { code: 6149, category: ts.DiagnosticCategory.Message, key: "Show_diagnostic_information_6149", message: "Show diagnostic information." }, + Show_verbose_diagnostic_information: { code: 6150, category: ts.DiagnosticCategory.Message, key: "Show_verbose_diagnostic_information_6150", message: "Show verbose diagnostic information." }, + Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file: { code: 6151, category: ts.DiagnosticCategory.Message, key: "Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151", message: "Emit a single file with source maps instead of having a separate file." }, + Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set: { code: 6152, category: ts.DiagnosticCategory.Message, key: "Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152", message: "Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set." }, + Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule: { code: 6153, category: ts.DiagnosticCategory.Message, key: "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153", message: "Transpile each file as a separate module (similar to 'ts.transpileModule')." }, + Print_names_of_generated_files_part_of_the_compilation: { code: 6154, category: ts.DiagnosticCategory.Message, key: "Print_names_of_generated_files_part_of_the_compilation_6154", message: "Print names of generated files part of the compilation." }, + Print_names_of_files_part_of_the_compilation: { code: 6155, category: ts.DiagnosticCategory.Message, key: "Print_names_of_files_part_of_the_compilation_6155", message: "Print names of files part of the compilation." }, + The_locale_used_when_displaying_messages_to_the_user_e_g_en_us: { code: 6156, category: ts.DiagnosticCategory.Message, key: "The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156", message: "The locale used when displaying messages to the user (e.g. 'en-us')" }, + Do_not_generate_custom_helper_functions_like_extends_in_compiled_output: { code: 6157, category: ts.DiagnosticCategory.Message, key: "Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157", message: "Do not generate custom helper functions like '__extends' in compiled output." }, + Do_not_include_the_default_library_file_lib_d_ts: { code: 6158, category: ts.DiagnosticCategory.Message, key: "Do_not_include_the_default_library_file_lib_d_ts_6158", message: "Do not include the default library file (lib.d.ts)." }, + Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files: { code: 6159, category: ts.DiagnosticCategory.Message, key: "Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159", message: "Do not add triple-slash references or imported modules to the list of compiled files." }, + Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files: { code: 6160, category: ts.DiagnosticCategory.Message, key: "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160", message: "[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files." }, + List_of_folders_to_include_type_definitions_from: { code: 6161, category: ts.DiagnosticCategory.Message, key: "List_of_folders_to_include_type_definitions_from_6161", message: "List of folders to include type definitions from." }, + Disable_size_limitations_on_JavaScript_projects: { code: 6162, category: ts.DiagnosticCategory.Message, key: "Disable_size_limitations_on_JavaScript_projects_6162", message: "Disable size limitations on JavaScript projects." }, + The_character_set_of_the_input_files: { code: 6163, category: ts.DiagnosticCategory.Message, key: "The_character_set_of_the_input_files_6163", message: "The character set of the input files." }, + Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files: { code: 6164, category: ts.DiagnosticCategory.Message, key: "Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6164", message: "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files." }, + Do_not_truncate_error_messages: { code: 6165, category: ts.DiagnosticCategory.Message, key: "Do_not_truncate_error_messages_6165", message: "Do not truncate error messages." }, + Output_directory_for_generated_declaration_files: { code: 6166, category: ts.DiagnosticCategory.Message, key: "Output_directory_for_generated_declaration_files_6166", message: "Output directory for generated declaration files." }, + A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl: { code: 6167, category: ts.DiagnosticCategory.Message, key: "A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167", message: "A series of entries which re-map imports to lookup locations relative to the 'baseUrl'." }, + List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime: { code: 6168, category: ts.DiagnosticCategory.Message, key: "List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168", message: "List of root folders whose combined content represents the structure of the project at runtime." }, + Show_all_compiler_options: { code: 6169, category: ts.DiagnosticCategory.Message, key: "Show_all_compiler_options_6169", message: "Show all compiler options." }, + Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file: { code: 6170, category: ts.DiagnosticCategory.Message, key: "Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170", message: "[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file" }, + Command_line_Options: { code: 6171, category: ts.DiagnosticCategory.Message, key: "Command_line_Options_6171", message: "Command-line Options" }, + Basic_Options: { code: 6172, category: ts.DiagnosticCategory.Message, key: "Basic_Options_6172", message: "Basic Options" }, + Strict_Type_Checking_Options: { code: 6173, category: ts.DiagnosticCategory.Message, key: "Strict_Type_Checking_Options_6173", message: "Strict Type-Checking Options" }, + Module_Resolution_Options: { code: 6174, category: ts.DiagnosticCategory.Message, key: "Module_Resolution_Options_6174", message: "Module Resolution Options" }, + Source_Map_Options: { code: 6175, category: ts.DiagnosticCategory.Message, key: "Source_Map_Options_6175", message: "Source Map Options" }, + Additional_Checks: { code: 6176, category: ts.DiagnosticCategory.Message, key: "Additional_Checks_6176", message: "Additional Checks" }, + Experimental_Options: { code: 6177, category: ts.DiagnosticCategory.Message, key: "Experimental_Options_6177", message: "Experimental Options" }, + Advanced_Options: { code: 6178, category: ts.DiagnosticCategory.Message, key: "Advanced_Options_6178", message: "Advanced Options" }, + Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3: { code: 6179, category: ts.DiagnosticCategory.Message, key: "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179", message: "Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'." }, + Enable_all_strict_type_checking_options: { code: 6180, category: ts.DiagnosticCategory.Message, key: "Enable_all_strict_type_checking_options_6180", message: "Enable all strict type-checking options." }, + List_of_language_service_plugins: { code: 6181, category: ts.DiagnosticCategory.Message, key: "List_of_language_service_plugins_6181", message: "List of language service plugins." }, + Scoped_package_detected_looking_in_0: { code: 6182, category: ts.DiagnosticCategory.Message, key: "Scoped_package_detected_looking_in_0_6182", message: "Scoped package detected, looking in '{0}'" }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_an_1_type_7005", message: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter_0_implicitly_has_an_1_type_7006", message: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member_0_implicitly_has_an_1_type_7008", message: "Member '{0}' implicitly has an '{1}' type." }, @@ -4601,7 +4714,7 @@ var ts; _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7023, category: ts.DiagnosticCategory.Error, key: "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023", message: "'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7024, category: ts.DiagnosticCategory.Error, key: "Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024", message: "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type: { code: 7025, category: ts.DiagnosticCategory.Error, key: "Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_typ_7025", message: "Generator implicitly has type '{0}' because it does not yield any values. Consider supplying a return type." }, - JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: { code: 7026, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026", message: "JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists" }, + JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: { code: 7026, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026", message: "JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists." }, Unreachable_code_detected: { code: 7027, category: ts.DiagnosticCategory.Error, key: "Unreachable_code_detected_7027", message: "Unreachable code detected." }, Unused_label: { code: 7028, category: ts.DiagnosticCategory.Error, key: "Unused_label_7028", message: "Unused label." }, Fallthrough_case_in_switch: { code: 7029, category: ts.DiagnosticCategory.Error, key: "Fallthrough_case_in_switch_7029", message: "Fallthrough case in switch." }, @@ -4625,7 +4738,7 @@ var ts; parameter_modifiers_can_only_be_used_in_a_ts_file: { code: 8012, category: ts.DiagnosticCategory.Error, key: "parameter_modifiers_can_only_be_used_in_a_ts_file_8012", message: "'parameter modifiers' can only be used in a .ts file." }, enum_declarations_can_only_be_used_in_a_ts_file: { code: 8015, category: ts.DiagnosticCategory.Error, key: "enum_declarations_can_only_be_used_in_a_ts_file_8015", message: "'enum declarations' can only be used in a .ts file." }, type_assertion_expressions_can_only_be_used_in_a_ts_file: { code: 8016, category: ts.DiagnosticCategory.Error, key: "type_assertion_expressions_can_only_be_used_in_a_ts_file_8016", message: "'type assertion expressions' can only be used in a .ts file." }, - Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses: { code: 9002, category: ts.DiagnosticCategory.Error, key: "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002", message: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses." }, + Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clause: { code: 9002, category: ts.DiagnosticCategory.Error, key: "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002", message: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clause." }, class_expressions_are_not_currently_supported: { code: 9003, category: ts.DiagnosticCategory.Error, key: "class_expressions_are_not_currently_supported_9003", message: "'class' expressions are not currently supported." }, Language_service_is_disabled: { code: 9004, category: ts.DiagnosticCategory.Error, key: "Language_service_is_disabled_9004", message: "Language service is disabled." }, JSX_attributes_must_only_be_assigned_a_non_empty_expression: { code: 17000, category: ts.DiagnosticCategory.Error, key: "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", message: "JSX attributes must only be assigned a non-empty 'expression'." }, @@ -4633,28 +4746,40 @@ var ts; Expected_corresponding_JSX_closing_tag_for_0: { code: 17002, category: ts.DiagnosticCategory.Error, key: "Expected_corresponding_JSX_closing_tag_for_0_17002", message: "Expected corresponding JSX closing tag for '{0}'." }, JSX_attribute_expected: { code: 17003, category: ts.DiagnosticCategory.Error, key: "JSX_attribute_expected_17003", message: "JSX attribute expected." }, Cannot_use_JSX_unless_the_jsx_flag_is_provided: { code: 17004, category: ts.DiagnosticCategory.Error, key: "Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004", message: "Cannot use JSX unless the '--jsx' flag is provided." }, - A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: ts.DiagnosticCategory.Error, key: "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005", message: "A constructor cannot contain a 'super' call when its class extends 'null'" }, + A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: ts.DiagnosticCategory.Error, key: "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005", message: "A constructor cannot contain a 'super' call when its class extends 'null'." }, An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17006, category: ts.DiagnosticCategory.Error, key: "An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006", message: "An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17007, category: ts.DiagnosticCategory.Error, key: "A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007", message: "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, JSX_element_0_has_no_corresponding_closing_tag: { code: 17008, category: ts.DiagnosticCategory.Error, key: "JSX_element_0_has_no_corresponding_closing_tag_17008", message: "JSX element '{0}' has no corresponding closing tag." }, super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class: { code: 17009, category: ts.DiagnosticCategory.Error, key: "super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009", message: "'super' must be called before accessing 'this' in the constructor of a derived class." }, Unknown_type_acquisition_option_0: { code: 17010, category: ts.DiagnosticCategory.Error, key: "Unknown_type_acquisition_option_0_17010", message: "Unknown type acquisition option '{0}'." }, + super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class: { code: 17011, category: ts.DiagnosticCategory.Error, key: "super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011", message: "'super' must be called before accessing a property of 'super' in the constructor of a derived class." }, + _0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2: { code: 17012, category: ts.DiagnosticCategory.Error, key: "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012", message: "'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?" }, + Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor: { code: 17013, category: ts.DiagnosticCategory.Error, key: "Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013", message: "Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor." }, Circularity_detected_while_resolving_configuration_Colon_0: { code: 18000, category: ts.DiagnosticCategory.Error, key: "Circularity_detected_while_resolving_configuration_Colon_0_18000", message: "Circularity detected while resolving configuration: {0}" }, A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not: { code: 18001, category: ts.DiagnosticCategory.Error, key: "A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not_18001", message: "A path in an 'extends' option must be relative or rooted, but '{0}' is not." }, The_files_list_in_config_file_0_is_empty: { code: 18002, category: ts.DiagnosticCategory.Error, key: "The_files_list_in_config_file_0_is_empty_18002", message: "The 'files' list in config file '{0}' is empty." }, No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2: { code: 18003, category: ts.DiagnosticCategory.Error, key: "No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003", message: "No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'." }, Add_missing_super_call: { code: 90001, category: ts.DiagnosticCategory.Message, key: "Add_missing_super_call_90001", message: "Add missing 'super()' call." }, Make_super_call_the_first_statement_in_the_constructor: { code: 90002, category: ts.DiagnosticCategory.Message, key: "Make_super_call_the_first_statement_in_the_constructor_90002", message: "Make 'super()' call the first statement in the constructor." }, - Change_extends_to_implements: { code: 90003, category: ts.DiagnosticCategory.Message, key: "Change_extends_to_implements_90003", message: "Change 'extends' to 'implements'" }, - Remove_unused_identifiers: { code: 90004, category: ts.DiagnosticCategory.Message, key: "Remove_unused_identifiers_90004", message: "Remove unused identifiers" }, - Implement_interface_on_reference: { code: 90005, category: ts.DiagnosticCategory.Message, key: "Implement_interface_on_reference_90005", message: "Implement interface on reference" }, - Implement_interface_on_class: { code: 90006, category: ts.DiagnosticCategory.Message, key: "Implement_interface_on_class_90006", message: "Implement interface on class" }, - Implement_inherited_abstract_class: { code: 90007, category: ts.DiagnosticCategory.Message, key: "Implement_inherited_abstract_class_90007", message: "Implement inherited abstract class" }, - Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: { code: 90009, category: ts.DiagnosticCategory.Error, key: "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009", message: "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig" }, + Change_extends_to_implements: { code: 90003, category: ts.DiagnosticCategory.Message, key: "Change_extends_to_implements_90003", message: "Change 'extends' to 'implements'." }, + Remove_declaration_for_Colon_0: { code: 90004, category: ts.DiagnosticCategory.Message, key: "Remove_declaration_for_Colon_0_90004", message: "Remove declaration for: '{0}'." }, + Implement_interface_0: { code: 90006, category: ts.DiagnosticCategory.Message, key: "Implement_interface_0_90006", message: "Implement interface '{0}'." }, + Implement_inherited_abstract_class: { code: 90007, category: ts.DiagnosticCategory.Message, key: "Implement_inherited_abstract_class_90007", message: "Implement inherited abstract class." }, + Add_this_to_unresolved_variable: { code: 90008, category: ts.DiagnosticCategory.Message, key: "Add_this_to_unresolved_variable_90008", message: "Add 'this.' to unresolved variable." }, + Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: { code: 90009, category: ts.DiagnosticCategory.Error, key: "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009", message: "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig." }, Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: { code: 90010, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010", message: "Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated." }, - Import_0_from_1: { code: 90013, category: ts.DiagnosticCategory.Message, key: "Import_0_from_1_90013", message: "Import {0} from {1}" }, - Change_0_to_1: { code: 90014, category: ts.DiagnosticCategory.Message, key: "Change_0_to_1_90014", message: "Change {0} to {1}" }, - Add_0_to_existing_import_declaration_from_1: { code: 90015, category: ts.DiagnosticCategory.Message, key: "Add_0_to_existing_import_declaration_from_1_90015", message: "Add {0} to existing import declaration from {1}" }, + Import_0_from_1: { code: 90013, category: ts.DiagnosticCategory.Message, key: "Import_0_from_1_90013", message: "Import {0} from {1}." }, + Change_0_to_1: { code: 90014, category: ts.DiagnosticCategory.Message, key: "Change_0_to_1_90014", message: "Change {0} to {1}." }, + Add_0_to_existing_import_declaration_from_1: { code: 90015, category: ts.DiagnosticCategory.Message, key: "Add_0_to_existing_import_declaration_from_1_90015", message: "Add {0} to existing import declaration from {1}." }, + Add_declaration_for_missing_property_0: { code: 90016, category: ts.DiagnosticCategory.Message, key: "Add_declaration_for_missing_property_0_90016", message: "Add declaration for missing property '{0}'." }, + Add_index_signature_for_missing_property_0: { code: 90017, category: ts.DiagnosticCategory.Message, key: "Add_index_signature_for_missing_property_0_90017", message: "Add index signature for missing property '{0}'." }, + Disable_checking_for_this_file: { code: 90018, category: ts.DiagnosticCategory.Message, key: "Disable_checking_for_this_file_90018", message: "Disable checking for this file." }, + Ignore_this_error_message: { code: 90019, category: ts.DiagnosticCategory.Message, key: "Ignore_this_error_message_90019", message: "Ignore this error message." }, + Initialize_property_0_in_the_constructor: { code: 90020, category: ts.DiagnosticCategory.Message, key: "Initialize_property_0_in_the_constructor_90020", message: "Initialize property '{0}' in the constructor." }, + Initialize_static_property_0: { code: 90021, category: ts.DiagnosticCategory.Message, key: "Initialize_static_property_0_90021", message: "Initialize static property '{0}'." }, + Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0: { code: 8017, category: ts.DiagnosticCategory.Error, key: "Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0_8017", message: "Octal literal types must use ES2015 syntax. Use the syntax '{0}'." }, + Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0: { code: 8018, category: ts.DiagnosticCategory.Error, key: "Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0_8018", message: "Octal literals are not allowed in enums members initializer. Use the syntax '{0}'." }, + Report_errors_in_js_files: { code: 8019, category: ts.DiagnosticCategory.Message, key: "Report_errors_in_js_files_8019", message: "Report errors in .js files." }, }; })(ts || (ts = {})); /// @@ -4666,7 +4791,7 @@ var ts; return token >= 70 /* Identifier */; } ts.tokenIsIdentifierOrKeyword = tokenIsIdentifierOrKeyword; - var textToToken = ts.createMap({ + var textToToken = ts.createMapFromTemplate({ "abstract": 116 /* AbstractKeyword */, "any": 118 /* AnyKeyword */, "as": 117 /* AsKeyword */, @@ -4690,7 +4815,7 @@ var ts; "false": 85 /* FalseKeyword */, "finally": 86 /* FinallyKeyword */, "for": 87 /* ForKeyword */, - "from": 138 /* FromKeyword */, + "from": 139 /* FromKeyword */, "function": 88 /* FunctionKeyword */, "get": 124 /* GetKeyword */, "if": 89 /* IfKeyword */, @@ -4708,27 +4833,28 @@ var ts; "new": 93 /* NewKeyword */, "null": 94 /* NullKeyword */, "number": 132 /* NumberKeyword */, + "object": 133 /* ObjectKeyword */, "package": 110 /* PackageKeyword */, "private": 111 /* PrivateKeyword */, "protected": 112 /* ProtectedKeyword */, "public": 113 /* PublicKeyword */, "readonly": 130 /* ReadonlyKeyword */, "require": 131 /* RequireKeyword */, - "global": 139 /* GlobalKeyword */, + "global": 140 /* GlobalKeyword */, "return": 95 /* ReturnKeyword */, - "set": 133 /* SetKeyword */, + "set": 134 /* SetKeyword */, "static": 114 /* StaticKeyword */, - "string": 134 /* StringKeyword */, + "string": 135 /* StringKeyword */, "super": 96 /* SuperKeyword */, "switch": 97 /* SwitchKeyword */, - "symbol": 135 /* SymbolKeyword */, + "symbol": 136 /* SymbolKeyword */, "this": 98 /* ThisKeyword */, "throw": 99 /* ThrowKeyword */, "true": 100 /* TrueKeyword */, "try": 101 /* TryKeyword */, - "type": 136 /* TypeKeyword */, + "type": 137 /* TypeKeyword */, "typeof": 102 /* TypeOfKeyword */, - "undefined": 137 /* UndefinedKeyword */, + "undefined": 138 /* UndefinedKeyword */, "var": 103 /* VarKeyword */, "void": 104 /* VoidKeyword */, "while": 105 /* WhileKeyword */, @@ -4736,7 +4862,7 @@ var ts; "yield": 115 /* YieldKeyword */, "async": 119 /* AsyncKeyword */, "await": 120 /* AwaitKeyword */, - "of": 140 /* OfKeyword */, + "of": 141 /* OfKeyword */, "{": 16 /* OpenBraceToken */, "}": 17 /* CloseBraceToken */, "(": 18 /* OpenParenToken */, @@ -4876,9 +5002,9 @@ var ts; } function makeReverseMap(source) { var result = []; - for (var name_4 in source) { - result[source[name_4]] = name_4; - } + source.forEach(function (value, name) { + result[value] = name; + }); return result; } var tokenStrings = makeReverseMap(textToToken); @@ -4888,7 +5014,7 @@ var ts; ts.tokenToString = tokenToString; /* @internal */ function stringToToken(s) { - return textToToken[s]; + return textToToken.get(s); } ts.stringToToken = stringToToken; /* @internal */ @@ -4904,6 +5030,7 @@ var ts; if (text.charCodeAt(pos) === 10 /* lineFeed */) { pos++; } + // falls through case 10 /* lineFeed */: result.push(lineStart); lineStart = pos; @@ -4962,7 +5089,6 @@ var ts; return computeLineAndCharacterOfPosition(getLineStarts(sourceFile), position); } ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; - var hasOwnProperty = Object.prototype.hasOwnProperty; function isWhiteSpace(ch) { return isWhiteSpaceSingleLine(ch) || isLineBreak(ch); } @@ -5049,6 +5175,7 @@ var ts; if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) { pos++; } + // falls through case 10 /* lineFeed */: pos++; if (stopAfterLineBreak) { @@ -5121,7 +5248,7 @@ var ts; if (pos === 0 || isLineBreak(text.charCodeAt(pos - 1))) { var ch = text.charCodeAt(pos); if ((pos + mergeConflictMarkerLength) < text.length) { - for (var i = 0, n = mergeConflictMarkerLength; i < n; i++) { + for (var i = 0; i < mergeConflictMarkerLength; i++) { if (text.charCodeAt(pos + i) !== ch) { return false; } @@ -5203,6 +5330,7 @@ var ts; if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) { pos++; } + // falls through case 10 /* lineFeed */: pos++; if (trailing) { @@ -5298,15 +5426,15 @@ var ts; if (!comments) { comments = []; } - comments.push({ pos: pos, end: end, hasTrailingNewLine: hasTrailingNewLine, kind: kind }); + comments.push({ kind: kind, pos: pos, end: end, hasTrailingNewLine: hasTrailingNewLine }); return comments; } function getLeadingCommentRanges(text, pos) { - return reduceEachLeadingCommentRange(text, pos, appendCommentRange, undefined, undefined); + return reduceEachLeadingCommentRange(text, pos, appendCommentRange, /*state*/ undefined, /*initial*/ undefined); } ts.getLeadingCommentRanges = getLeadingCommentRanges; function getTrailingCommentRanges(text, pos) { - return reduceEachTrailingCommentRange(text, pos, appendCommentRange, undefined, undefined); + return reduceEachTrailingCommentRange(text, pos, appendCommentRange, /*state*/ undefined, /*initial*/ undefined); } ts.getTrailingCommentRanges = getTrailingCommentRanges; /** Optionally, get the shebang */ @@ -5333,7 +5461,7 @@ var ts; if (!isIdentifierStart(name.charCodeAt(0), languageVersion)) { return false; } - for (var i = 1, n = name.length; i < n; i++) { + for (var i = 1; i < name.length; i++) { if (!isIdentifierPart(name.charCodeAt(i), languageVersion)) { return false; } @@ -5357,6 +5485,7 @@ var ts; var precedingLineBreak; var hasExtendedUnicodeEscape; var tokenIsUnterminated; + var numericLiteralFlags; setText(text, start, length); return { getStartPos: function () { return startPos; }, @@ -5370,6 +5499,7 @@ var ts; isIdentifier: function () { return token === 70 /* Identifier */ || token > 106 /* LastReservedWord */; }, isReservedWord: function () { return token >= 71 /* FirstReservedWord */ && token <= 106 /* LastReservedWord */; }, isUnterminated: function () { return tokenIsUnterminated; }, + getNumericLiteralFlags: function () { return numericLiteralFlags; }, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, reScanTemplateToken: reScanTemplateToken, @@ -5406,6 +5536,7 @@ var ts; var end = pos; if (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */) { pos++; + numericLiteralFlags = 2 /* Scientific */; if (text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) pos++; if (isDigit(text.charCodeAt(pos))) { @@ -5604,7 +5735,7 @@ var ts; if (pos < end && text.charCodeAt(pos) === 10 /* lineFeed */) { pos++; } - // fall through + // falls through case 10 /* lineFeed */: case 8232 /* lineSeparator */: case 8233 /* paragraphSeparator */: @@ -5705,8 +5836,11 @@ var ts; var len = tokenValue.length; if (len >= 2 && len <= 11) { var ch = tokenValue.charCodeAt(0); - if (ch >= 97 /* a */ && ch <= 122 /* z */ && hasOwnProperty.call(textToToken, tokenValue)) { - return token = textToToken[tokenValue]; + if (ch >= 97 /* a */ && ch <= 122 /* z */) { + token = textToToken.get(tokenValue); + if (token !== undefined) { + return token; + } } } return token = 70 /* Identifier */; @@ -5738,6 +5872,7 @@ var ts; hasExtendedUnicodeEscape = false; precedingLineBreak = false; tokenIsUnterminated = false; + numericLiteralFlags = 0; while (true) { tokenPos = pos; if (pos >= end) { @@ -5923,6 +6058,7 @@ var ts; value = 0; } tokenValue = "" + value; + numericLiteralFlags = 8 /* HexSpecifier */; return token = 8 /* NumericLiteral */; } else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 66 /* B */ || text.charCodeAt(pos + 1) === 98 /* b */)) { @@ -5933,6 +6069,7 @@ var ts; value = 0; } tokenValue = "" + value; + numericLiteralFlags = 16 /* BinarySpecifier */; return token = 8 /* NumericLiteral */; } else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 79 /* O */ || text.charCodeAt(pos + 1) === 111 /* o */)) { @@ -5943,16 +6080,19 @@ var ts; value = 0; } tokenValue = "" + value; + numericLiteralFlags = 32 /* OctalSpecifier */; return token = 8 /* NumericLiteral */; } // Try to parse as an octal if (pos + 1 < end && isOctalDigit(text.charCodeAt(pos + 1))) { tokenValue = "" + scanOctalDigits(); + numericLiteralFlags = 4 /* Octal */; return token = 8 /* NumericLiteral */; } // This fall-through is a deviation from the EcmaScript grammar. The grammar says that a leading zero // can only be followed by an octal digit, a dot, or the end of the number literal. However, we are being // permissive and allowing decimal digits of the form 08* and 09* (which many browsers also do). + // falls through case 49 /* _1 */: case 50 /* _2 */: case 51 /* _3 */: @@ -6206,7 +6346,14 @@ var ts; while (pos < end) { pos++; char = text.charCodeAt(pos); - if ((char === 123 /* openBrace */) || (char === 60 /* lessThan */)) { + if (char === 123 /* openBrace */) { + break; + } + if (char === 60 /* lessThan */) { + if (isConflictMarkerTrivia(text, pos)) { + pos = scanConflictMarkerTrivia(text, pos, error); + return token = 7 /* ConflictMarkerTrivia */; + } break; } } @@ -6399,6 +6546,19 @@ var ts; return undefined; } ts.getDeclarationOfKind = getDeclarationOfKind; + function findDeclaration(symbol, predicate) { + var declarations = symbol.declarations; + if (declarations) { + for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { + var declaration = declarations_2[_i]; + if (predicate(declaration)) { + return declaration; + } + } + } + return undefined; + } + ts.findDeclaration = findDeclaration; // Pool writers to avoid needing to allocate them for every symbol we write. var stringWriters = []; function getSingleLineStringWriter() { @@ -6413,6 +6573,7 @@ var ts; writeSpace: writeText, writeStringLiteral: writeText, writeParameter: writeText, + writeProperty: writeText, writeSymbol: writeText, // Completely ignore indentation for string writers. And map newlines to // a single space. @@ -6421,7 +6582,8 @@ var ts; decreaseIndent: ts.noop, clear: function () { return str_1 = ""; }, trackSymbol: ts.noop, - reportInaccessibleThisError: ts.noop + reportInaccessibleThisError: ts.noop, + reportIllegalExtends: ts.noop }; } return stringWriters.pop(); @@ -6437,25 +6599,25 @@ var ts; } ts.getFullWidth = getFullWidth; function hasResolvedModule(sourceFile, moduleNameText) { - return !!(sourceFile && sourceFile.resolvedModules && sourceFile.resolvedModules[moduleNameText]); + return !!(sourceFile && sourceFile.resolvedModules && sourceFile.resolvedModules.get(moduleNameText)); } ts.hasResolvedModule = hasResolvedModule; function getResolvedModule(sourceFile, moduleNameText) { - return hasResolvedModule(sourceFile, moduleNameText) ? sourceFile.resolvedModules[moduleNameText] : undefined; + return hasResolvedModule(sourceFile, moduleNameText) ? sourceFile.resolvedModules.get(moduleNameText) : undefined; } ts.getResolvedModule = getResolvedModule; function setResolvedModule(sourceFile, moduleNameText, resolvedModule) { if (!sourceFile.resolvedModules) { sourceFile.resolvedModules = ts.createMap(); } - sourceFile.resolvedModules[moduleNameText] = resolvedModule; + sourceFile.resolvedModules.set(moduleNameText, resolvedModule); } ts.setResolvedModule = setResolvedModule; function setResolvedTypeReferenceDirective(sourceFile, typeReferenceDirectiveName, resolvedTypeReferenceDirective) { if (!sourceFile.resolvedTypeReferenceDirectiveNames) { sourceFile.resolvedTypeReferenceDirectiveNames = ts.createMap(); } - sourceFile.resolvedTypeReferenceDirectiveNames[typeReferenceDirectiveName] = resolvedTypeReferenceDirective; + sourceFile.resolvedTypeReferenceDirectiveNames.set(typeReferenceDirectiveName, resolvedTypeReferenceDirective); } ts.setResolvedTypeReferenceDirective = setResolvedTypeReferenceDirective; /* @internal */ @@ -6477,7 +6639,7 @@ var ts; } for (var i = 0; i < names.length; i++) { var newResolution = newResolutions[i]; - var oldResolution = oldResolutions && oldResolutions[names[i]]; + var oldResolution = oldResolutions && oldResolutions.get(names[i]); var changed = oldResolution ? !newResolution || !comparer(oldResolution, newResolution) : newResolution; @@ -6491,28 +6653,28 @@ var ts; // Returns true if this node contains a parse error anywhere underneath it. function containsParseError(node) { aggregateChildData(node); - return (node.flags & 4194304 /* ThisNodeOrAnySubNodesHasError */) !== 0; + return (node.flags & 131072 /* ThisNodeOrAnySubNodesHasError */) !== 0; } ts.containsParseError = containsParseError; function aggregateChildData(node) { - if (!(node.flags & 8388608 /* HasAggregatedChildData */)) { + if (!(node.flags & 262144 /* HasAggregatedChildData */)) { // A node is considered to contain a parse error if: // a) the parser explicitly marked that it had an error // b) any of it's children reported that it had an error. - var thisNodeOrAnySubNodesHasError = ((node.flags & 1048576 /* ThisNodeHasError */) !== 0) || + var thisNodeOrAnySubNodesHasError = ((node.flags & 32768 /* ThisNodeHasError */) !== 0) || ts.forEachChild(node, containsParseError); // If so, mark ourselves accordingly. if (thisNodeOrAnySubNodesHasError) { - node.flags |= 4194304 /* ThisNodeOrAnySubNodesHasError */; + node.flags |= 131072 /* ThisNodeOrAnySubNodesHasError */; } // Also mark that we've propagated the child information to this node. This way we can // always consult the bit directly on this node without needing to check its children // again. - node.flags |= 8388608 /* HasAggregatedChildData */; + node.flags |= 262144 /* HasAggregatedChildData */; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 261 /* SourceFile */) { + while (node && node.kind !== 264 /* SourceFile */) { node = node.parent; } return node; @@ -6520,11 +6682,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 204 /* Block */: - case 232 /* CaseBlock */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: + case 206 /* Block */: + case 234 /* CaseBlock */: + case 213 /* ForStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: return true; } return false; @@ -6599,6 +6761,10 @@ var ts; return !nodeIsMissing(node); } ts.nodeIsPresent = nodeIsPresent; + function isToken(n) { + return n.kind >= 0 /* FirstToken */ && n.kind <= 141 /* LastToken */; + } + ts.isToken = isToken; function getTokenPosOfNode(node, sourceFile, includeJsDoc) { // With nodes that have no width (i.e. 'Missing' nodes), we actually *don't* // want to skip trivia because this will launch us forward to the next token. @@ -6615,18 +6781,18 @@ var ts; // the syntax list itself considers them as normal trivia. Therefore if we simply skip // trivia for the list, we may have skipped the JSDocComment as well. So we should process its // first child to determine the actual position of its first token. - if (node.kind === 292 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 293 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); } ts.getTokenPosOfNode = getTokenPosOfNode; function isJSDocNode(node) { - return node.kind >= 262 /* FirstJSDocNode */ && node.kind <= 288 /* LastJSDocNode */; + return node.kind >= 266 /* FirstJSDocNode */ && node.kind <= 292 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; function isJSDocTag(node) { - return node.kind >= 278 /* FirstJSDocTagNode */ && node.kind <= 291 /* LastJSDocTagNode */; + return node.kind >= 282 /* FirstJSDocTagNode */ && node.kind <= 292 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function getNonDecoratorTokenPosOfNode(node, sourceFile) { @@ -6657,20 +6823,11 @@ var ts; return getSourceTextOfNodeFromSourceFile(getSourceFileOfNode(node), node, includeTrivia); } ts.getTextOfNode = getTextOfNode; - function getLiteralText(node, sourceFile, languageVersion) { - // Any template literal or string literal with an extended escape - // (e.g. "\u{0067}") will need to be downleveled as a escaped string literal. - if (languageVersion < 2 /* ES2015 */ && (isTemplateLiteralKind(node.kind) || node.hasExtendedUnicodeEscape)) { - return getQuotedEscapedLiteralText('"', node.text, '"'); - } + function getLiteralText(node, sourceFile) { // If we don't need to downlevel and we can reach the original source text using // the node's parent reference, then simply get the text as it was originally written. if (!nodeIsSynthesized(node) && node.parent) { - var text = getSourceTextOfNodeFromSourceFile(sourceFile, node); - if (languageVersion < 2 /* ES2015 */ && isBinaryOrOctalIntegerLiteral(node, text)) { - return node.text; - } - return text; + return getSourceTextOfNodeFromSourceFile(sourceFile, node); } // If we can't reach the original source text, use the canonical form if it's a number, // or an escaped quoted form of the original text if it's string-like. @@ -6691,19 +6848,6 @@ var ts; ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for."); } ts.getLiteralText = getLiteralText; - function isBinaryOrOctalIntegerLiteral(node, text) { - if (node.kind === 8 /* NumericLiteral */ && text.length > 1) { - switch (text.charCodeAt(1)) { - case 98 /* b */: - case 66 /* B */: - case 111 /* o */: - case 79 /* O */: - return true; - } - } - return false; - } - ts.isBinaryOrOctalIntegerLiteral = isBinaryOrOctalIntegerLiteral; function getQuotedEscapedLiteralText(leftQuote, text, rightQuote) { return leftQuote + escapeNonAsciiCharacters(escapeString(text)) + rightQuote; } @@ -6712,11 +6856,6 @@ var ts; return identifier.length >= 2 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ ? "_" + identifier : identifier; } ts.escapeIdentifier = escapeIdentifier; - // Remove extra underscore from escaped identifier - function unescapeIdentifier(identifier) { - return identifier.length >= 3 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ && identifier.charCodeAt(2) === 95 /* _ */ ? identifier.substr(1) : identifier; - } - ts.unescapeIdentifier = unescapeIdentifier; // Make an identifier from an external module name by extracting the string after the last "/" and replacing // all non-alphanumeric characters with underscores function makeIdentifierFromModuleName(moduleName) { @@ -6730,26 +6869,26 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 223 /* VariableDeclaration */ && node.parent.kind === 256 /* CatchClause */; + return node.kind === 225 /* VariableDeclaration */ && node.parent.kind === 259 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { - return node && node.kind === 230 /* ModuleDeclaration */ && + return node && node.kind === 232 /* ModuleDeclaration */ && (node.name.kind === 9 /* StringLiteral */ || isGlobalScopeAugmentation(node)); } ts.isAmbientModule = isAmbientModule; - /** Given a symbol for a module, checks that it is either an untyped import or a shorthand ambient module. */ + /** Given a symbol for a module, checks that it is a shorthand ambient module. */ function isShorthandAmbientModuleSymbol(moduleSymbol) { return isShorthandAmbientModule(moduleSymbol.valueDeclaration); } ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { // The only kind of module that can be missing a body is a shorthand ambient module. - return node.kind === 230 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 232 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 261 /* SourceFile */ || - node.kind === 230 /* ModuleDeclaration */ || + return node.kind === 264 /* SourceFile */ || + node.kind === 232 /* ModuleDeclaration */ || isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -6765,32 +6904,36 @@ var ts; return false; } switch (node.parent.kind) { - case 261 /* SourceFile */: + case 264 /* SourceFile */: return ts.isExternalModule(node.parent); - case 231 /* ModuleBlock */: + case 233 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; } ts.isExternalModuleAugmentation = isExternalModuleAugmentation; + function isEffectiveExternalModule(node, compilerOptions) { + return ts.isExternalModule(node) || compilerOptions.isolatedModules; + } + ts.isEffectiveExternalModule = isEffectiveExternalModule; function isBlockScope(node, parentNode) { switch (node.kind) { - case 261 /* SourceFile */: - case 232 /* CaseBlock */: - case 256 /* CatchClause */: - case 230 /* ModuleDeclaration */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 150 /* Constructor */: - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 264 /* SourceFile */: + case 234 /* CaseBlock */: + case 259 /* CatchClause */: + case 232 /* ModuleDeclaration */: + case 213 /* ForStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: + case 151 /* Constructor */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: return true; - case 204 /* Block */: + case 206 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return parentNode && !isFunctionLike(parentNode); @@ -6817,6 +6960,10 @@ var ts; return getFullWidth(name) === 0 ? "(Missing)" : getTextOfNode(name); } ts.declarationNameToString = declarationNameToString; + function getNameFromIndexInfo(info) { + return info.declaration ? declarationNameToString(info.declaration.parameters[0].name) : undefined; + } + ts.getNameFromIndexInfo = getNameFromIndexInfo; function getTextOfPropertyName(name) { switch (name.kind) { case 70 /* Identifier */: @@ -6824,7 +6971,7 @@ var ts; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: return name.text; - case 142 /* ComputedPropertyName */: + case 143 /* ComputedPropertyName */: if (isStringOrNumericLiteral(name.expression)) { return name.expression.text; } @@ -6835,10 +6982,10 @@ var ts; function entityNameToString(name) { switch (name.kind) { case 70 /* Identifier */: - return getFullWidth(name) === 0 ? unescapeIdentifier(name.text) : getTextOfNode(name); - case 141 /* QualifiedName */: + return getFullWidth(name) === 0 ? ts.unescapeIdentifier(name.text) : getTextOfNode(name); + case 142 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 177 /* PropertyAccessExpression */: + case 178 /* PropertyAccessExpression */: return entityNameToString(name.expression) + "." + entityNameToString(name.name); } } @@ -6875,7 +7022,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 204 /* Block */) { + if (node.body && node.body.kind === 206 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -6889,7 +7036,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 261 /* SourceFile */: + case 264 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -6898,23 +7045,23 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 223 /* VariableDeclaration */: - case 174 /* BindingElement */: - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: - case 230 /* ModuleDeclaration */: - case 229 /* EnumDeclaration */: - case 260 /* EnumMember */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 228 /* TypeAliasDeclaration */: + case 225 /* VariableDeclaration */: + case 175 /* BindingElement */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 229 /* InterfaceDeclaration */: + case 232 /* ModuleDeclaration */: + case 231 /* EnumDeclaration */: + case 263 /* EnumMember */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 230 /* TypeAliasDeclaration */: errorNode = node.name; break; - case 185 /* ArrowFunction */: + case 186 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); } if (errorNode === undefined) { @@ -6937,7 +7084,7 @@ var ts; } ts.isDeclarationFile = isDeclarationFile; function isConstEnumDeclaration(node) { - return node.kind === 229 /* EnumDeclaration */ && isConst(node); + return node.kind === 231 /* EnumDeclaration */ && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function isConst(node) { @@ -6950,11 +7097,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 179 /* CallExpression */ && n.expression.kind === 96 /* SuperKeyword */; + return n.kind === 180 /* CallExpression */ && n.expression.kind === 96 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isPrologueDirective(node) { - return node.kind === 207 /* ExpressionStatement */ + return node.kind === 209 /* ExpressionStatement */ && node.expression.kind === 9 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -6967,10 +7114,10 @@ var ts; } ts.getLeadingCommentRangesOfNodeFromText = getLeadingCommentRangesOfNodeFromText; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 144 /* Parameter */ || - node.kind === 143 /* TypeParameter */ || - node.kind === 184 /* FunctionExpression */ || - node.kind === 185 /* ArrowFunction */) ? + var commentRanges = (node.kind === 145 /* Parameter */ || + node.kind === 144 /* TypeParameter */ || + node.kind === 185 /* FunctionExpression */ || + node.kind === 186 /* ArrowFunction */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRangesOfNodeFromText(node, text); // True if the comment starts with '/**' but not if it is '/**/' @@ -6985,79 +7132,80 @@ var ts; ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (156 /* FirstTypeNode */ <= node.kind && node.kind <= 171 /* LastTypeNode */) { + if (157 /* FirstTypeNode */ <= node.kind && node.kind <= 172 /* LastTypeNode */) { return true; } switch (node.kind) { case 118 /* AnyKeyword */: case 132 /* NumberKeyword */: - case 134 /* StringKeyword */: + case 135 /* StringKeyword */: case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: - case 137 /* UndefinedKeyword */: + case 136 /* SymbolKeyword */: + case 138 /* UndefinedKeyword */: case 129 /* NeverKeyword */: return true; case 104 /* VoidKeyword */: - return node.parent.kind !== 188 /* VoidExpression */; - case 199 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 189 /* VoidExpression */; + case 200 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 70 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 141 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 142 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 177 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 178 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 70 /* Identifier */ || node.kind === 141 /* QualifiedName */ || node.kind === 177 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); - case 141 /* QualifiedName */: - case 177 /* PropertyAccessExpression */: + ts.Debug.assert(node.kind === 70 /* Identifier */ || node.kind === 142 /* QualifiedName */ || node.kind === 178 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + // falls through + case 142 /* QualifiedName */: + case 178 /* PropertyAccessExpression */: case 98 /* ThisKeyword */: - var parent_1 = node.parent; - if (parent_1.kind === 160 /* TypeQuery */) { + var parent = node.parent; + if (parent.kind === 161 /* TypeQuery */) { return false; } // Do not recursively call isPartOfTypeNode on the parent. In the example: // // let a: A.B.C; // - // Calling isPartOfTypeNode would consider the qualified name A.B a type node. Only C or - // A.B.C is a type node. - if (156 /* FirstTypeNode */ <= parent_1.kind && parent_1.kind <= 171 /* LastTypeNode */) { + // Calling isPartOfTypeNode would consider the qualified name A.B a type node. + // Only C and A.B.C are type nodes. + if (157 /* FirstTypeNode */ <= parent.kind && parent.kind <= 172 /* LastTypeNode */) { return true; } - switch (parent_1.kind) { - case 199 /* ExpressionWithTypeArguments */: - return !isExpressionWithTypeArgumentsInClassExtendsClause(parent_1); - case 143 /* TypeParameter */: - return node === parent_1.constraint; - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 144 /* Parameter */: - case 223 /* VariableDeclaration */: - return node === parent_1.type; - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 150 /* Constructor */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - return node === parent_1.type; - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - return node === parent_1.type; - case 182 /* TypeAssertionExpression */: - return node === parent_1.type; - case 179 /* CallExpression */: - case 180 /* NewExpression */: - return parent_1.typeArguments && ts.indexOf(parent_1.typeArguments, node) >= 0; - case 181 /* TaggedTemplateExpression */: + switch (parent.kind) { + case 200 /* ExpressionWithTypeArguments */: + return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); + case 144 /* TypeParameter */: + return node === parent.constraint; + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 145 /* Parameter */: + case 225 /* VariableDeclaration */: + return node === parent.type; + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 151 /* Constructor */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + return node === parent.type; + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: + return node === parent.type; + case 183 /* TypeAssertionExpression */: + return node === parent.type; + case 180 /* CallExpression */: + case 181 /* NewExpression */: + return parent.typeArguments && ts.indexOf(parent.typeArguments, node) >= 0; + case 182 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -7065,29 +7213,43 @@ var ts; return false; } ts.isPartOfTypeNode = isPartOfTypeNode; + function isChildOfNodeWithKind(node, kind) { + while (node) { + if (node.kind === kind) { + return true; + } + node = node.parent; + } + return false; + } + ts.isChildOfNodeWithKind = isChildOfNodeWithKind; + function isPrefixUnaryExpression(node) { + return node.kind === 191 /* PrefixUnaryExpression */; + } + ts.isPrefixUnaryExpression = isPrefixUnaryExpression; // Warning: This has the same semantics as the forEach family of functions, // in that traversal terminates in the event that 'visitor' supplies a truthy value. function forEachReturnStatement(body, visitor) { return traverse(body); function traverse(node) { switch (node.kind) { - case 216 /* ReturnStatement */: + case 218 /* ReturnStatement */: return visitor(node); - case 232 /* CaseBlock */: - case 204 /* Block */: - case 208 /* IfStatement */: - case 209 /* DoStatement */: - case 210 /* WhileStatement */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 217 /* WithStatement */: - case 218 /* SwitchStatement */: - case 253 /* CaseClause */: - case 254 /* DefaultClause */: - case 219 /* LabeledStatement */: - case 221 /* TryStatement */: - case 256 /* CatchClause */: + case 234 /* CaseBlock */: + case 206 /* Block */: + case 210 /* IfStatement */: + case 211 /* DoStatement */: + case 212 /* WhileStatement */: + case 213 /* ForStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: + case 219 /* WithStatement */: + case 220 /* SwitchStatement */: + case 256 /* CaseClause */: + case 257 /* DefaultClause */: + case 221 /* LabeledStatement */: + case 223 /* TryStatement */: + case 259 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -7097,29 +7259,30 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 195 /* YieldExpression */: + case 196 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } - case 229 /* EnumDeclaration */: - case 227 /* InterfaceDeclaration */: - case 230 /* ModuleDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + return; + case 231 /* EnumDeclaration */: + case 229 /* InterfaceDeclaration */: + case 232 /* ModuleDeclaration */: + case 230 /* TypeAliasDeclaration */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, any yield statements contained within them should be // skipped in this traversal. return; default: if (isFunctionLike(node)) { - var name_5 = node.name; - if (name_5 && name_5.kind === 142 /* ComputedPropertyName */) { + var name = node.name; + if (name && name.kind === 143 /* ComputedPropertyName */) { // Note that we will not include methods/accessors of a class because they would require // first descending into the class. This is by design. - traverse(name_5.expression); + traverse(name.expression); return; } } @@ -7132,17 +7295,35 @@ var ts; } } ts.forEachYieldExpression = forEachYieldExpression; + /** + * Gets the most likely element type for a TypeNode. This is not an exhaustive test + * as it assumes a rest argument can only be an array type (either T[], or Array). + * + * @param node The type node. + */ + function getRestParameterElementType(node) { + if (node && node.kind === 163 /* ArrayType */) { + return node.elementType; + } + else if (node && node.kind === 158 /* TypeReference */) { + return ts.singleOrUndefined(node.typeArguments); + } + else { + return undefined; + } + } + ts.getRestParameterElementType = getRestParameterElementType; function isVariableLike(node) { if (node) { switch (node.kind) { - case 174 /* BindingElement */: - case 260 /* EnumMember */: - case 144 /* Parameter */: - case 257 /* PropertyAssignment */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 258 /* ShorthandPropertyAssignment */: - case 223 /* VariableDeclaration */: + case 175 /* BindingElement */: + case 263 /* EnumMember */: + case 145 /* Parameter */: + case 260 /* PropertyAssignment */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 261 /* ShorthandPropertyAssignment */: + case 225 /* VariableDeclaration */: return true; } } @@ -7150,11 +7331,11 @@ var ts; } ts.isVariableLike = isVariableLike; function isAccessor(node) { - return node && (node.kind === 151 /* GetAccessor */ || node.kind === 152 /* SetAccessor */); + return node && (node.kind === 152 /* GetAccessor */ || node.kind === 153 /* SetAccessor */); } ts.isAccessor = isAccessor; function isClassLike(node) { - return node && (node.kind === 226 /* ClassDeclaration */ || node.kind === 197 /* ClassExpression */); + return node && (node.kind === 228 /* ClassDeclaration */ || node.kind === 198 /* ClassExpression */); } ts.isClassLike = isClassLike; function isFunctionLike(node) { @@ -7163,19 +7344,19 @@ var ts; ts.isFunctionLike = isFunctionLike; function isFunctionLikeKind(kind) { switch (kind) { - case 150 /* Constructor */: - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: - case 185 /* ArrowFunction */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 158 /* FunctionType */: - case 159 /* ConstructorType */: + case 151 /* Constructor */: + case 185 /* FunctionExpression */: + case 227 /* FunctionDeclaration */: + case 186 /* ArrowFunction */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: return true; } return false; @@ -7183,13 +7364,13 @@ var ts; ts.isFunctionLikeKind = isFunctionLikeKind; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: return true; } return false; @@ -7197,30 +7378,42 @@ var ts; ts.introducesArgumentsExoticObject = introducesArgumentsExoticObject; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 209 /* DoStatement */: - case 210 /* WhileStatement */: + case 213 /* ForStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: + case 211 /* DoStatement */: + case 212 /* WhileStatement */: return true; - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; } ts.isIterationStatement = isIterationStatement; + function unwrapInnermostStatementOfLabel(node, beforeUnwrapLabelCallback) { + while (true) { + if (beforeUnwrapLabelCallback) { + beforeUnwrapLabelCallback(node); + } + if (node.statement.kind !== 221 /* LabeledStatement */) { + return node.statement; + } + node = node.statement; + } + } + ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 204 /* Block */ && isFunctionLike(node.parent); + return node && node.kind === 206 /* Block */ && isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 149 /* MethodDeclaration */ && node.parent.kind === 176 /* ObjectLiteralExpression */; + return node && node.kind === 150 /* MethodDeclaration */ && node.parent.kind === 177 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 149 /* MethodDeclaration */ && - (node.parent.kind === 176 /* ObjectLiteralExpression */ || - node.parent.kind === 197 /* ClassExpression */); + return node.kind === 150 /* MethodDeclaration */ && + (node.parent.kind === 177 /* ObjectLiteralExpression */ || + node.parent.kind === 198 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -7256,7 +7449,7 @@ var ts; return undefined; } switch (node.kind) { - case 142 /* ComputedPropertyName */: + case 143 /* ComputedPropertyName */: // If the grandparent node is an object literal (as opposed to a class), // then the computed property is not a 'this' container. // A computed property name in a class needs to be a this container @@ -7271,9 +7464,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 145 /* Decorator */: + case 146 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 144 /* Parameter */ && isClassElement(node.parent.parent)) { + if (node.parent.kind === 145 /* Parameter */ && isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -7284,39 +7477,52 @@ var ts; node = node.parent; } break; - case 185 /* ArrowFunction */: + case 186 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } - // Fall through - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 230 /* ModuleDeclaration */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 229 /* EnumDeclaration */: - case 261 /* SourceFile */: + // falls through + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 232 /* ModuleDeclaration */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: + case 231 /* EnumDeclaration */: + case 264 /* SourceFile */: return node; } } } ts.getThisContainer = getThisContainer; + function getNewTargetContainer(node) { + var container = getThisContainer(node, /*includeArrowFunctions*/ false); + if (container) { + switch (container.kind) { + case 151 /* Constructor */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + return container; + } + } + return undefined; + } + ts.getNewTargetContainer = getNewTargetContainer; /** - * Given an super call/property node, returns the closest node where - * - a super call/property access is legal in the node and not legal in the parent node the node. - * i.e. super call is legal in constructor but not legal in the class body. - * - the container is an arrow function (so caller might need to call getSuperContainer again in case it needs to climb higher) - * - a super call/property is definitely illegal in the container (but might be legal in some subnode) - * i.e. super property access is illegal in function declaration but can be legal in the statement list - */ + * Given an super call/property node, returns the closest node where + * - a super call/property access is legal in the node and not legal in the parent node the node. + * i.e. super call is legal in constructor but not legal in the class body. + * - the container is an arrow function (so caller might need to call getSuperContainer again in case it needs to climb higher) + * - a super call/property is definitely illegal in the container (but might be legal in some subnode) + * i.e. super property access is illegal in function declaration but can be legal in the statement list + */ function getSuperContainer(node, stopOnFunctions) { while (true) { node = node.parent; @@ -7324,26 +7530,27 @@ var ts; return node; } switch (node.kind) { - case 142 /* ComputedPropertyName */: + case 143 /* ComputedPropertyName */: node = node.parent; break; - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: if (!stopOnFunctions) { continue; } - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + // falls through + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: return node; - case 145 /* Decorator */: + case 146 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 144 /* Parameter */ && isClassElement(node.parent.parent)) { + if (node.parent.kind === 145 /* Parameter */ && isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -7359,15 +7566,15 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 184 /* FunctionExpression */ || func.kind === 185 /* ArrowFunction */) { + if (func.kind === 185 /* FunctionExpression */ || func.kind === 186 /* ArrowFunction */) { var prev = func; - var parent_2 = func.parent; - while (parent_2.kind === 183 /* ParenthesizedExpression */) { - prev = parent_2; - parent_2 = parent_2.parent; + var parent = func.parent; + while (parent.kind === 184 /* ParenthesizedExpression */) { + prev = parent; + parent = parent.parent; } - if (parent_2.kind === 179 /* CallExpression */ && parent_2.expression === prev) { - return parent_2; + if (parent.kind === 180 /* CallExpression */ && parent.expression === prev) { + return parent; } } } @@ -7377,21 +7584,21 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 177 /* PropertyAccessExpression */ || kind === 178 /* ElementAccessExpression */) + return (kind === 178 /* PropertyAccessExpression */ || kind === 179 /* ElementAccessExpression */) && node.expression.kind === 96 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 157 /* TypeReference */: - case 272 /* JSDocTypeReference */: + case 158 /* TypeReference */: + case 276 /* JSDocTypeReference */: return node.typeName; - case 199 /* ExpressionWithTypeArguments */: + case 200 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 70 /* Identifier */: - case 141 /* QualifiedName */: + case 142 /* QualifiedName */: return node; } return undefined; @@ -7399,10 +7606,12 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function isCallLikeExpression(node) { switch (node.kind) { - case 179 /* CallExpression */: - case 180 /* NewExpression */: - case 181 /* TaggedTemplateExpression */: - case 145 /* Decorator */: + case 250 /* JsxOpeningElement */: + case 249 /* JsxSelfClosingElement */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: + case 182 /* TaggedTemplateExpression */: + case 146 /* Decorator */: return true; default: return false; @@ -7410,34 +7619,37 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function getInvokedExpression(node) { - if (node.kind === 181 /* TaggedTemplateExpression */) { + if (node.kind === 182 /* TaggedTemplateExpression */) { return node.tag; } + else if (isJsxOpeningLikeElement(node)) { + return node.tagName; + } // Will either be a CallExpression, NewExpression, or Decorator. return node.expression; } ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node) { switch (node.kind) { - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: // classes are valid targets return true; - case 147 /* PropertyDeclaration */: + case 148 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return node.parent.kind === 226 /* ClassDeclaration */; - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 149 /* MethodDeclaration */: + return node.parent.kind === 228 /* ClassDeclaration */; + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 150 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. return node.body !== undefined - && node.parent.kind === 226 /* ClassDeclaration */; - case 144 /* Parameter */: + && node.parent.kind === 228 /* ClassDeclaration */; + case 145 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; return node.parent.body !== undefined - && (node.parent.kind === 150 /* Constructor */ - || node.parent.kind === 149 /* MethodDeclaration */ - || node.parent.kind === 152 /* SetAccessor */) - && node.parent.parent.kind === 226 /* ClassDeclaration */; + && (node.parent.kind === 151 /* Constructor */ + || node.parent.kind === 150 /* MethodDeclaration */ + || node.parent.kind === 153 /* SetAccessor */) + && node.parent.parent.kind === 228 /* ClassDeclaration */; } return false; } @@ -7453,19 +7665,19 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node) { switch (node.kind) { - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: return ts.forEach(node.members, nodeOrChildIsDecorated); - case 149 /* MethodDeclaration */: - case 152 /* SetAccessor */: + case 150 /* MethodDeclaration */: + case 153 /* SetAccessor */: return ts.forEach(node.parameters, nodeIsDecorated); } } ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 248 /* JsxOpeningElement */ || - parent.kind === 247 /* JsxSelfClosingElement */ || - parent.kind === 249 /* JsxClosingElement */) { + if (parent.kind === 250 /* JsxOpeningElement */ || + parent.kind === 249 /* JsxSelfClosingElement */ || + parent.kind === 251 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -7479,96 +7691,97 @@ var ts; case 100 /* TrueKeyword */: case 85 /* FalseKeyword */: case 11 /* RegularExpressionLiteral */: - case 175 /* ArrayLiteralExpression */: - case 176 /* ObjectLiteralExpression */: - case 177 /* PropertyAccessExpression */: - case 178 /* ElementAccessExpression */: - case 179 /* CallExpression */: - case 180 /* NewExpression */: - case 181 /* TaggedTemplateExpression */: - case 200 /* AsExpression */: - case 182 /* TypeAssertionExpression */: - case 201 /* NonNullExpression */: - case 183 /* ParenthesizedExpression */: - case 184 /* FunctionExpression */: - case 197 /* ClassExpression */: - case 185 /* ArrowFunction */: - case 188 /* VoidExpression */: - case 186 /* DeleteExpression */: - case 187 /* TypeOfExpression */: - case 190 /* PrefixUnaryExpression */: - case 191 /* PostfixUnaryExpression */: - case 192 /* BinaryExpression */: - case 193 /* ConditionalExpression */: - case 196 /* SpreadElement */: - case 194 /* TemplateExpression */: + case 176 /* ArrayLiteralExpression */: + case 177 /* ObjectLiteralExpression */: + case 178 /* PropertyAccessExpression */: + case 179 /* ElementAccessExpression */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: + case 182 /* TaggedTemplateExpression */: + case 201 /* AsExpression */: + case 183 /* TypeAssertionExpression */: + case 202 /* NonNullExpression */: + case 184 /* ParenthesizedExpression */: + case 185 /* FunctionExpression */: + case 198 /* ClassExpression */: + case 186 /* ArrowFunction */: + case 189 /* VoidExpression */: + case 187 /* DeleteExpression */: + case 188 /* TypeOfExpression */: + case 191 /* PrefixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: + case 193 /* BinaryExpression */: + case 194 /* ConditionalExpression */: + case 197 /* SpreadElement */: + case 195 /* TemplateExpression */: case 12 /* NoSubstitutionTemplateLiteral */: - case 198 /* OmittedExpression */: - case 246 /* JsxElement */: - case 247 /* JsxSelfClosingElement */: - case 195 /* YieldExpression */: - case 189 /* AwaitExpression */: + case 199 /* OmittedExpression */: + case 248 /* JsxElement */: + case 249 /* JsxSelfClosingElement */: + case 196 /* YieldExpression */: + case 190 /* AwaitExpression */: + case 203 /* MetaProperty */: return true; - case 141 /* QualifiedName */: - while (node.parent.kind === 141 /* QualifiedName */) { + case 142 /* QualifiedName */: + while (node.parent.kind === 142 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 160 /* TypeQuery */ || isJSXTagName(node); + return node.parent.kind === 161 /* TypeQuery */ || isJSXTagName(node); case 70 /* Identifier */: - if (node.parent.kind === 160 /* TypeQuery */ || isJSXTagName(node)) { + if (node.parent.kind === 161 /* TypeQuery */ || isJSXTagName(node)) { return true; } - // fall through + // falls through case 8 /* NumericLiteral */: case 9 /* StringLiteral */: case 98 /* ThisKeyword */: - var parent_3 = node.parent; - switch (parent_3.kind) { - case 223 /* VariableDeclaration */: - case 144 /* Parameter */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 260 /* EnumMember */: - case 257 /* PropertyAssignment */: - case 174 /* BindingElement */: - return parent_3.initializer === node; - case 207 /* ExpressionStatement */: - case 208 /* IfStatement */: - case 209 /* DoStatement */: - case 210 /* WhileStatement */: - case 216 /* ReturnStatement */: - case 217 /* WithStatement */: - case 218 /* SwitchStatement */: - case 253 /* CaseClause */: - case 220 /* ThrowStatement */: - case 218 /* SwitchStatement */: - return parent_3.expression === node; - case 211 /* ForStatement */: - var forStatement = parent_3; - return (forStatement.initializer === node && forStatement.initializer.kind !== 224 /* VariableDeclarationList */) || + var parent = node.parent; + switch (parent.kind) { + case 225 /* VariableDeclaration */: + case 145 /* Parameter */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 263 /* EnumMember */: + case 260 /* PropertyAssignment */: + case 175 /* BindingElement */: + return parent.initializer === node; + case 209 /* ExpressionStatement */: + case 210 /* IfStatement */: + case 211 /* DoStatement */: + case 212 /* WhileStatement */: + case 218 /* ReturnStatement */: + case 219 /* WithStatement */: + case 220 /* SwitchStatement */: + case 256 /* CaseClause */: + case 222 /* ThrowStatement */: + case 220 /* SwitchStatement */: + return parent.expression === node; + case 213 /* ForStatement */: + var forStatement = parent; + return (forStatement.initializer === node && forStatement.initializer.kind !== 226 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - var forInStatement = parent_3; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 224 /* VariableDeclarationList */) || + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: + var forInStatement = parent; + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 226 /* VariableDeclarationList */) || forInStatement.expression === node; - case 182 /* TypeAssertionExpression */: - case 200 /* AsExpression */: - return node === parent_3.expression; - case 202 /* TemplateSpan */: - return node === parent_3.expression; - case 142 /* ComputedPropertyName */: - return node === parent_3.expression; - case 145 /* Decorator */: - case 252 /* JsxExpression */: - case 251 /* JsxSpreadAttribute */: - case 259 /* SpreadAssignment */: + case 183 /* TypeAssertionExpression */: + case 201 /* AsExpression */: + return node === parent.expression; + case 204 /* TemplateSpan */: + return node === parent.expression; + case 143 /* ComputedPropertyName */: + return node === parent.expression; + case 146 /* Decorator */: + case 255 /* JsxExpression */: + case 254 /* JsxSpreadAttribute */: + case 262 /* SpreadAssignment */: return true; - case 199 /* ExpressionWithTypeArguments */: - return parent_3.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent_3); + case 200 /* ExpressionWithTypeArguments */: + return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); default: - if (isPartOfExpression(parent_3)) { + if (isPartOfExpression(parent)) { return true; } } @@ -7583,7 +7796,7 @@ var ts; } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 234 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 245 /* ExternalModuleReference */; + return node.kind === 236 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 247 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -7592,7 +7805,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 234 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 245 /* ExternalModuleReference */; + return node.kind === 236 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 247 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJavaScript(file) { @@ -7600,21 +7813,27 @@ var ts; } ts.isSourceFileJavaScript = isSourceFileJavaScript; function isInJavaScriptFile(node) { - return node && !!(node.flags & 2097152 /* JavaScriptFile */); + return node && !!(node.flags & 65536 /* JavaScriptFile */); } ts.isInJavaScriptFile = isInJavaScriptFile; /** * Returns true if the node is a CallExpression to the identifier 'require' with - * exactly one argument. + * exactly one argument (of the form 'require("name")'). * This function does not test if the node is in a JavaScript file or not. - */ - function isRequireCall(expression, checkArgumentIsStringLiteral) { - // of the form 'require("name")' - var isRequire = expression.kind === 179 /* CallExpression */ && - expression.expression.kind === 70 /* Identifier */ && - expression.expression.text === "require" && - expression.arguments.length === 1; - return isRequire && (!checkArgumentIsStringLiteral || expression.arguments[0].kind === 9 /* StringLiteral */); + */ + function isRequireCall(callExpression, checkArgumentIsStringLiteral) { + if (callExpression.kind !== 180 /* CallExpression */) { + return false; + } + var _a = callExpression, expression = _a.expression, args = _a.arguments; + if (expression.kind !== 70 /* Identifier */ || expression.text !== "require") { + return false; + } + if (args.length !== 1) { + return false; + } + var arg = args[0]; + return !checkArgumentIsStringLiteral || arg.kind === 9 /* StringLiteral */ || arg.kind === 12 /* NoSubstitutionTemplateLiteral */; } ts.isRequireCall = isRequireCall; function isSingleOrDoubleQuote(charCode) { @@ -7625,25 +7844,37 @@ var ts; * Returns true if the node is a variable declaration whose initializer is a function expression. * This function does not test if the node is in a JavaScript file or not. */ - function isDeclarationOfFunctionExpression(s) { - if (s.valueDeclaration && s.valueDeclaration.kind === 223 /* VariableDeclaration */) { + function isDeclarationOfFunctionOrClassExpression(s) { + if (s.valueDeclaration && s.valueDeclaration.kind === 225 /* VariableDeclaration */) { var declaration = s.valueDeclaration; - return declaration.initializer && declaration.initializer.kind === 184 /* FunctionExpression */; + return declaration.initializer && (declaration.initializer.kind === 185 /* FunctionExpression */ || declaration.initializer.kind === 198 /* ClassExpression */); } return false; } - ts.isDeclarationOfFunctionExpression = isDeclarationOfFunctionExpression; + ts.isDeclarationOfFunctionOrClassExpression = isDeclarationOfFunctionOrClassExpression; + function getRightMostAssignedExpression(node) { + while (isAssignmentExpression(node, /*excludeCompoundAssignements*/ true)) { + node = node.right; + } + return node; + } + ts.getRightMostAssignedExpression = getRightMostAssignedExpression; + function isExportsIdentifier(node) { + return isIdentifier(node) && node.text === "exports"; + } + ts.isExportsIdentifier = isExportsIdentifier; + function isModuleExportsPropertyAccessExpression(node) { + return isPropertyAccessExpression(node) && isIdentifier(node.expression) && node.expression.text === "module" && node.name.text === "exports"; + } + ts.isModuleExportsPropertyAccessExpression = isModuleExportsPropertyAccessExpression; /// Given a BinaryExpression, returns SpecialPropertyAssignmentKind for the various kinds of property /// assignments we treat as special in the binder function getSpecialPropertyAssignmentKind(expression) { if (!isInJavaScriptFile(expression)) { return 0 /* None */; } - if (expression.kind !== 192 /* BinaryExpression */) { - return 0 /* None */; - } var expr = expression; - if (expr.operatorToken.kind !== 57 /* EqualsToken */ || expr.left.kind !== 177 /* PropertyAccessExpression */) { + if (expr.operatorToken.kind !== 57 /* EqualsToken */ || expr.left.kind !== 178 /* PropertyAccessExpression */) { return 0 /* None */; } var lhs = expr.left; @@ -7657,11 +7888,15 @@ var ts; // module.exports = expr return 2 /* ModuleExports */; } + else { + // F.x = expr + return 5 /* Property */; + } } else if (lhs.expression.kind === 98 /* ThisKeyword */) { return 4 /* ThisProperty */; } - else if (lhs.expression.kind === 177 /* PropertyAccessExpression */) { + else if (lhs.expression.kind === 178 /* PropertyAccessExpression */) { // chained dot, e.g. x.y.z = expr; this var is the 'x.y' part var innerPropertyAccess = lhs.expression; if (innerPropertyAccess.expression.kind === 70 /* Identifier */) { @@ -7679,35 +7914,35 @@ var ts; } ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind; function getExternalModuleName(node) { - if (node.kind === 235 /* ImportDeclaration */) { + if (node.kind === 237 /* ImportDeclaration */) { return node.moduleSpecifier; } - if (node.kind === 234 /* ImportEqualsDeclaration */) { + if (node.kind === 236 /* ImportEqualsDeclaration */) { var reference = node.moduleReference; - if (reference.kind === 245 /* ExternalModuleReference */) { + if (reference.kind === 247 /* ExternalModuleReference */) { return reference.expression; } } - if (node.kind === 241 /* ExportDeclaration */) { + if (node.kind === 243 /* ExportDeclaration */) { return node.moduleSpecifier; } - if (node.kind === 230 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */) { + if (node.kind === 232 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */) { return node.name; } } ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { - if (node.kind === 234 /* ImportEqualsDeclaration */) { + if (node.kind === 236 /* ImportEqualsDeclaration */) { return node; } var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 237 /* NamespaceImport */) { + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 239 /* NamespaceImport */) { return importClause.namedBindings; } } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 235 /* ImportDeclaration */ + return node.kind === 237 /* ImportDeclaration */ && node.importClause && !!node.importClause.name; } @@ -7715,13 +7950,13 @@ var ts; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 144 /* Parameter */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 258 /* ShorthandPropertyAssignment */: - case 257 /* PropertyAssignment */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 145 /* Parameter */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 261 /* ShorthandPropertyAssignment */: + case 260 /* PropertyAssignment */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -7729,28 +7964,36 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function isJSDocConstructSignature(node) { - return node.kind === 274 /* JSDocFunctionType */ && + return node.kind === 278 /* JSDocFunctionType */ && node.parameters.length > 0 && - node.parameters[0].type.kind === 276 /* JSDocConstructorType */; + node.parameters[0].type.kind === 280 /* JSDocConstructorType */; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function getCommentsFromJSDoc(node) { return ts.map(getJSDocs(node), function (doc) { return doc.comment; }); } ts.getCommentsFromJSDoc = getCommentsFromJSDoc; + function hasJSDocParameterTags(node) { + var parameterTags = getJSDocTags(node, 285 /* JSDocParameterTag */); + return parameterTags && parameterTags.length > 0; + } + ts.hasJSDocParameterTags = hasJSDocParameterTags; function getJSDocTags(node, kind) { var docs = getJSDocs(node); if (docs) { var result = []; for (var _i = 0, docs_1 = docs; _i < docs_1.length; _i++) { var doc = docs_1[_i]; - if (doc.kind === 281 /* JSDocParameterTag */) { + if (doc.kind === 285 /* JSDocParameterTag */) { if (doc.kind === kind) { result.push(doc); } } else { - result.push.apply(result, ts.filter(doc.tags, function (tag) { return tag.kind === kind; })); + var tags = doc.tags; + if (tags) { + result.push.apply(result, ts.filter(tags, function (tag) { return tag.kind === kind; })); + } } } return result; @@ -7776,9 +8019,9 @@ var ts; // var x = function(name) { return name.length; } var isInitializerOfVariableDeclarationInStatement = isVariableLike(parent) && parent.initializer === node && - parent.parent.parent.kind === 205 /* VariableStatement */; + parent.parent.parent.kind === 207 /* VariableStatement */; var isVariableOfVariableDeclarationStatement = isVariableLike(node) && - parent.parent.kind === 205 /* VariableStatement */; + parent.parent.kind === 207 /* VariableStatement */; var variableStatementNode = isInitializerOfVariableDeclarationInStatement ? parent.parent.parent : isVariableOfVariableDeclarationStatement ? parent.parent : undefined; @@ -7787,20 +8030,20 @@ var ts; } // Also recognize when the node is the RHS of an assignment expression var isSourceOfAssignmentExpressionStatement = parent && parent.parent && - parent.kind === 192 /* BinaryExpression */ && + parent.kind === 193 /* BinaryExpression */ && parent.operatorToken.kind === 57 /* EqualsToken */ && - parent.parent.kind === 207 /* ExpressionStatement */; + parent.parent.kind === 209 /* ExpressionStatement */; if (isSourceOfAssignmentExpressionStatement) { getJSDocsWorker(parent.parent); } - var isModuleDeclaration = node.kind === 230 /* ModuleDeclaration */ && - parent && parent.kind === 230 /* ModuleDeclaration */; - var isPropertyAssignmentExpression = parent && parent.kind === 257 /* PropertyAssignment */; + var isModuleDeclaration = node.kind === 232 /* ModuleDeclaration */ && + parent && parent.kind === 232 /* ModuleDeclaration */; + var isPropertyAssignmentExpression = parent && parent.kind === 260 /* PropertyAssignment */; if (isModuleDeclaration || isPropertyAssignmentExpression) { getJSDocsWorker(parent); } // Pull parameter comments from declaring function as well - if (node.kind === 144 /* Parameter */) { + if (node.kind === 145 /* Parameter */) { cache = ts.concatenate(cache, getJSDocParameterTags(node)); } if (isVariableLike(node) && node.initializer) { @@ -7809,23 +8052,24 @@ var ts; cache = ts.concatenate(cache, node.jsDoc); } } + ts.getJSDocs = getJSDocs; function getJSDocParameterTags(param) { if (!isParameter(param)) { return undefined; } var func = param.parent; - var tags = getJSDocTags(func, 281 /* JSDocParameterTag */); + var tags = getJSDocTags(func, 285 /* JSDocParameterTag */); if (!param.name) { // this is an anonymous jsdoc param from a `function(type1, type2): type3` specification var i = func.parameters.indexOf(param); - var paramTags = ts.filter(tags, function (tag) { return tag.kind === 281 /* JSDocParameterTag */; }); + var paramTags = ts.filter(tags, function (tag) { return tag.kind === 285 /* JSDocParameterTag */; }); if (paramTags && 0 <= i && i < paramTags.length) { return [paramTags[i]]; } } else if (param.name.kind === 70 /* Identifier */) { - var name_6 = param.name.text; - return ts.filter(tags, function (tag) { return tag.kind === 281 /* JSDocParameterTag */ && tag.parameterName.text === name_6; }); + var name_1 = param.name.text; + return ts.filter(tags, function (tag) { return tag.kind === 285 /* JSDocParameterTag */ && tag.parameterName.text === name_1; }); } else { // TODO: it's a destructured parameter, so it should look up an "object type" series of multiple lines @@ -7835,8 +8079,8 @@ var ts; } ts.getJSDocParameterTags = getJSDocParameterTags; function getJSDocType(node) { - var tag = getFirstJSDocTag(node, 283 /* JSDocTypeTag */); - if (!tag && node.kind === 144 /* Parameter */) { + var tag = getFirstJSDocTag(node, 287 /* JSDocTypeTag */); + if (!tag && node.kind === 145 /* Parameter */) { var paramTags = getJSDocParameterTags(node); if (paramTags) { tag = ts.find(paramTags, function (tag) { return !!tag.typeExpression; }); @@ -7846,15 +8090,15 @@ var ts; } ts.getJSDocType = getJSDocType; function getJSDocAugmentsTag(node) { - return getFirstJSDocTag(node, 280 /* JSDocAugmentsTag */); + return getFirstJSDocTag(node, 284 /* JSDocAugmentsTag */); } ts.getJSDocAugmentsTag = getJSDocAugmentsTag; function getJSDocReturnTag(node) { - return getFirstJSDocTag(node, 282 /* JSDocReturnTag */); + return getFirstJSDocTag(node, 286 /* JSDocReturnTag */); } ts.getJSDocReturnTag = getJSDocReturnTag; function getJSDocTemplateTag(node) { - return getFirstJSDocTag(node, 284 /* JSDocTemplateTag */); + return getFirstJSDocTag(node, 288 /* JSDocTemplateTag */); } ts.getJSDocTemplateTag = getJSDocTemplateTag; function hasRestParameter(s) { @@ -7866,9 +8110,9 @@ var ts; } ts.hasDeclaredRestParameter = hasDeclaredRestParameter; function isRestParameter(node) { - if (node && (node.flags & 2097152 /* JavaScriptFile */)) { - if (node.type && node.type.kind === 275 /* JSDocVariadicType */ || - ts.forEach(getJSDocParameterTags(node), function (t) { return t.typeExpression && t.typeExpression.type.kind === 275 /* JSDocVariadicType */; })) { + if (node && (node.flags & 65536 /* JavaScriptFile */)) { + if (node.type && node.type.kind === 279 /* JSDocVariadicType */ || + ts.forEach(getJSDocParameterTags(node), function (t) { return t.typeExpression && t.typeExpression.type.kind === 279 /* JSDocVariadicType */; })) { return true; } } @@ -7889,29 +8133,33 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 57 /* EqualsToken */ ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 190 /* PrefixUnaryExpression */: - case 191 /* PostfixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; return unaryOperator === 42 /* PlusPlusToken */ || unaryOperator === 43 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 183 /* ParenthesizedExpression */: - case 175 /* ArrayLiteralExpression */: - case 196 /* SpreadElement */: + case 184 /* ParenthesizedExpression */: + case 176 /* ArrayLiteralExpression */: + case 197 /* SpreadElement */: node = parent; break; - case 258 /* ShorthandPropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } - // Fall through - case 257 /* PropertyAssignment */: + node = parent.parent; + break; + case 260 /* PropertyAssignment */: + if (parent.name === node) { + return 0 /* None */; + } node = parent.parent; break; default: @@ -7923,11 +8171,24 @@ var ts; ts.getAssignmentTargetKind = getAssignmentTargetKind; // A node is an assignment target if it is on the left hand side of an '=' token, if it is parented by a property // assignment in an object literal that is an assignment target, or if it is parented by an array literal that is - // an assignment target. Examples include 'a = xxx', '{ p: a } = xxx', '[{ p: a}] = xxx'. + // an assignment target. Examples include 'a = xxx', '{ p: a } = xxx', '[{ a }] = xxx'. + // (Note that `p` is not a target in the above examples, only `a`.) function isAssignmentTarget(node) { return getAssignmentTargetKind(node) !== 0 /* None */; } ts.isAssignmentTarget = isAssignmentTarget; + // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped + function isDeleteTarget(node) { + if (node.kind !== 178 /* PropertyAccessExpression */ && node.kind !== 179 /* ElementAccessExpression */) { + return false; + } + node = node.parent; + while (node && node.kind === 184 /* ParenthesizedExpression */) { + node = node.parent; + } + return node && node.kind === 187 /* DeleteExpression */; + } + ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { while (node) { if (node === ancestor) @@ -7939,7 +8200,7 @@ var ts; ts.isNodeDescendantOf = isNodeDescendantOf; function isInAmbientContext(node) { while (node) { - if (hasModifier(node, 2 /* Ambient */) || (node.kind === 261 /* SourceFile */ && node.isDeclarationFile)) { + if (hasModifier(node, 2 /* Ambient */) || (node.kind === 264 /* SourceFile */ && node.isDeclarationFile)) { return true; } node = node.parent; @@ -7953,7 +8214,7 @@ var ts; return false; } var parent = name.parent; - if (parent.kind === 239 /* ImportSpecifier */ || parent.kind === 243 /* ExportSpecifier */) { + if (parent.kind === 241 /* ImportSpecifier */ || parent.kind === 245 /* ExportSpecifier */) { if (parent.propertyName) { return true; } @@ -7966,7 +8227,7 @@ var ts; ts.isDeclarationName = isDeclarationName; function isLiteralComputedPropertyDeclarationName(node) { return (node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) && - node.parent.kind === 142 /* ComputedPropertyName */ && + node.parent.kind === 143 /* ComputedPropertyName */ && isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -7974,31 +8235,31 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 260 /* EnumMember */: - case 257 /* PropertyAssignment */: - case 177 /* PropertyAccessExpression */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 263 /* EnumMember */: + case 260 /* PropertyAssignment */: + case 178 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 141 /* QualifiedName */: + case 142 /* QualifiedName */: // Name on right hand side of dot in a type query if (parent.right === node) { - while (parent.kind === 141 /* QualifiedName */) { + while (parent.kind === 142 /* QualifiedName */) { parent = parent.parent; } - return parent.kind === 160 /* TypeQuery */; + return parent.kind === 161 /* TypeQuery */; } return false; - case 174 /* BindingElement */: - case 239 /* ImportSpecifier */: + case 175 /* BindingElement */: + case 241 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 243 /* ExportSpecifier */: + case 245 /* ExportSpecifier */: // Any name in an export specifier return true; } @@ -8014,13 +8275,13 @@ var ts; // export = // export default function isAliasSymbolDeclaration(node) { - return node.kind === 234 /* ImportEqualsDeclaration */ || - node.kind === 233 /* NamespaceExportDeclaration */ || - node.kind === 236 /* ImportClause */ && !!node.name || - node.kind === 237 /* NamespaceImport */ || - node.kind === 239 /* ImportSpecifier */ || - node.kind === 243 /* ExportSpecifier */ || - node.kind === 240 /* ExportAssignment */ && exportAssignmentIsAlias(node); + return node.kind === 236 /* ImportEqualsDeclaration */ || + node.kind === 235 /* NamespaceExportDeclaration */ || + node.kind === 238 /* ImportClause */ && !!node.name || + node.kind === 239 /* NamespaceImport */ || + node.kind === 241 /* ImportSpecifier */ || + node.kind === 245 /* ExportSpecifier */ || + node.kind === 242 /* ExportAssignment */ && exportAssignmentIsAlias(node); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function exportAssignmentIsAlias(node) { @@ -8106,17 +8367,62 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 71 /* FirstKeyword */ <= token && token <= 140 /* LastKeyword */; + return 71 /* FirstKeyword */ <= token && token <= 141 /* LastKeyword */; } ts.isKeyword = isKeyword; function isTrivia(token) { return 2 /* FirstTriviaToken */ <= token && token <= 7 /* LastTriviaToken */; } ts.isTrivia = isTrivia; - function isAsyncFunctionLike(node) { - return isFunctionLike(node) && hasModifier(node, 256 /* Async */) && !isAccessor(node); + var FunctionFlags; + (function (FunctionFlags) { + FunctionFlags[FunctionFlags["Normal"] = 0] = "Normal"; + FunctionFlags[FunctionFlags["Generator"] = 1] = "Generator"; + FunctionFlags[FunctionFlags["Async"] = 2] = "Async"; + FunctionFlags[FunctionFlags["AsyncOrAsyncGenerator"] = 3] = "AsyncOrAsyncGenerator"; + FunctionFlags[FunctionFlags["Invalid"] = 4] = "Invalid"; + FunctionFlags[FunctionFlags["InvalidAsyncOrAsyncGenerator"] = 7] = "InvalidAsyncOrAsyncGenerator"; + FunctionFlags[FunctionFlags["InvalidGenerator"] = 5] = "InvalidGenerator"; + })(FunctionFlags = ts.FunctionFlags || (ts.FunctionFlags = {})); + function getFunctionFlags(node) { + var flags = 0 /* Normal */; + switch (node.kind) { + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 150 /* MethodDeclaration */: + if (node.asteriskToken) { + flags |= 1 /* Generator */; + } + // falls through + case 186 /* ArrowFunction */: + if (hasModifier(node, 256 /* Async */)) { + flags |= 2 /* Async */; + } + break; + } + if (!node.body) { + flags |= 4 /* Invalid */; + } + return flags; } - ts.isAsyncFunctionLike = isAsyncFunctionLike; + ts.getFunctionFlags = getFunctionFlags; + function isAsyncFunction(node) { + switch (node.kind) { + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 150 /* MethodDeclaration */: + return node.body !== undefined + && node.asteriskToken === undefined + && hasModifier(node, 256 /* Async */); + } + return false; + } + ts.isAsyncFunction = isAsyncFunction; + function isNumericLiteral(node) { + return node.kind === 8 /* NumericLiteral */; + } + ts.isNumericLiteral = isNumericLiteral; function isStringOrNumericLiteral(node) { var kind = node.kind; return kind === 9 /* StringLiteral */ @@ -8135,7 +8441,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - return name.kind === 142 /* ComputedPropertyName */ && + return name.kind === 143 /* ComputedPropertyName */ && !isStringOrNumericLiteral(name.expression) && !isWellKnownSymbolSyntactically(name.expression); } @@ -8150,10 +8456,10 @@ var ts; } ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically; function getPropertyNameForPropertyNameNode(name) { - if (name.kind === 70 /* Identifier */ || name.kind === 9 /* StringLiteral */ || name.kind === 8 /* NumericLiteral */ || name.kind === 144 /* Parameter */) { + if (name.kind === 70 /* Identifier */ || name.kind === 9 /* StringLiteral */ || name.kind === 8 /* NumericLiteral */ || name.kind === 145 /* Parameter */) { return name.text; } - if (name.kind === 142 /* ComputedPropertyName */) { + if (name.kind === 143 /* ComputedPropertyName */) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { var rightHandSideName = nameExpression.name.text; @@ -8201,11 +8507,11 @@ var ts; ts.isModifierKind = isModifierKind; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 144 /* Parameter */; + return root.kind === 145 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 174 /* BindingElement */) { + while (node.kind === 175 /* BindingElement */) { node = node.parent.parent; } return node; @@ -8213,15 +8519,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 150 /* Constructor */ - || kind === 184 /* FunctionExpression */ - || kind === 225 /* FunctionDeclaration */ - || kind === 185 /* ArrowFunction */ - || kind === 149 /* MethodDeclaration */ - || kind === 151 /* GetAccessor */ - || kind === 152 /* SetAccessor */ - || kind === 230 /* ModuleDeclaration */ - || kind === 261 /* SourceFile */; + return kind === 151 /* Constructor */ + || kind === 185 /* FunctionExpression */ + || kind === 227 /* FunctionDeclaration */ + || kind === 186 /* ArrowFunction */ + || kind === 150 /* MethodDeclaration */ + || kind === 152 /* GetAccessor */ + || kind === 153 /* SetAccessor */ + || kind === 232 /* ModuleDeclaration */ + || kind === 264 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(node) { @@ -8229,49 +8535,22 @@ var ts; || ts.positionIsSynthesized(node.end); } ts.nodeIsSynthesized = nodeIsSynthesized; - function getOriginalNode(node, nodeTest) { - if (node) { - while (node.original !== undefined) { - node = node.original; - } + function getOriginalSourceFileOrBundle(sourceFileOrBundle) { + if (sourceFileOrBundle.kind === 265 /* Bundle */) { + return ts.updateBundle(sourceFileOrBundle, ts.sameMap(sourceFileOrBundle.sourceFiles, getOriginalSourceFile)); } - return !nodeTest || nodeTest(node) ? node : undefined; + return getOriginalSourceFile(sourceFileOrBundle); } - ts.getOriginalNode = getOriginalNode; - /** - * Gets a value indicating whether a node originated in the parse tree. - * - * @param node The node to test. - */ - function isParseTreeNode(node) { - return (node.flags & 8 /* Synthesized */) === 0; + ts.getOriginalSourceFileOrBundle = getOriginalSourceFileOrBundle; + function getOriginalSourceFile(sourceFile) { + return ts.getParseTreeNode(sourceFile, isSourceFile) || sourceFile; } - ts.isParseTreeNode = isParseTreeNode; - function getParseTreeNode(node, nodeTest) { - if (isParseTreeNode(node)) { - return node; - } - node = getOriginalNode(node); - if (isParseTreeNode(node) && (!nodeTest || nodeTest(node))) { - return node; - } - return undefined; - } - ts.getParseTreeNode = getParseTreeNode; function getOriginalSourceFiles(sourceFiles) { - var originalSourceFiles = []; - for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { - var sourceFile = sourceFiles_1[_i]; - var originalSourceFile = getParseTreeNode(sourceFile, isSourceFile); - if (originalSourceFile) { - originalSourceFiles.push(originalSourceFile); - } - } - return originalSourceFiles; + return ts.sameMap(sourceFiles, getOriginalSourceFile); } ts.getOriginalSourceFiles = getOriginalSourceFiles; function getOriginalNodeId(node) { - node = getOriginalNode(node); + node = ts.getOriginalNode(node); return node ? ts.getNodeId(node) : 0; } ts.getOriginalNodeId = getOriginalNodeId; @@ -8282,23 +8561,23 @@ var ts; })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 180 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 181 /* NewExpression */ && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 180 /* NewExpression */: + case 181 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 190 /* PrefixUnaryExpression */: - case 187 /* TypeOfExpression */: - case 188 /* VoidExpression */: - case 186 /* DeleteExpression */: - case 189 /* AwaitExpression */: - case 193 /* ConditionalExpression */: - case 195 /* YieldExpression */: + case 191 /* PrefixUnaryExpression */: + case 188 /* TypeOfExpression */: + case 189 /* VoidExpression */: + case 187 /* DeleteExpression */: + case 190 /* AwaitExpression */: + case 194 /* ConditionalExpression */: + case 196 /* YieldExpression */: return 1 /* Right */; - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: switch (operator) { case 39 /* AsteriskAsteriskToken */: case 57 /* EqualsToken */: @@ -8322,15 +8601,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 180 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 181 /* NewExpression */ && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 192 /* BinaryExpression */) { + if (expression.kind === 193 /* BinaryExpression */) { return expression.operatorToken.kind; } - else if (expression.kind === 190 /* PrefixUnaryExpression */ || expression.kind === 191 /* PostfixUnaryExpression */) { + else if (expression.kind === 191 /* PrefixUnaryExpression */ || expression.kind === 192 /* PostfixUnaryExpression */) { return expression.operator; } else { @@ -8348,37 +8627,36 @@ var ts; case 85 /* FalseKeyword */: case 8 /* NumericLiteral */: case 9 /* StringLiteral */: - case 175 /* ArrayLiteralExpression */: - case 176 /* ObjectLiteralExpression */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 197 /* ClassExpression */: - case 246 /* JsxElement */: - case 247 /* JsxSelfClosingElement */: + case 176 /* ArrayLiteralExpression */: + case 177 /* ObjectLiteralExpression */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 198 /* ClassExpression */: + case 248 /* JsxElement */: + case 249 /* JsxSelfClosingElement */: case 11 /* RegularExpressionLiteral */: case 12 /* NoSubstitutionTemplateLiteral */: - case 194 /* TemplateExpression */: - case 183 /* ParenthesizedExpression */: - case 198 /* OmittedExpression */: - case 297 /* RawExpression */: + case 195 /* TemplateExpression */: + case 184 /* ParenthesizedExpression */: + case 199 /* OmittedExpression */: return 19; - case 181 /* TaggedTemplateExpression */: - case 177 /* PropertyAccessExpression */: - case 178 /* ElementAccessExpression */: + case 182 /* TaggedTemplateExpression */: + case 178 /* PropertyAccessExpression */: + case 179 /* ElementAccessExpression */: return 18; - case 180 /* NewExpression */: + case 181 /* NewExpression */: return hasArguments ? 18 : 17; - case 179 /* CallExpression */: + case 180 /* CallExpression */: return 17; - case 191 /* PostfixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: return 16; - case 190 /* PrefixUnaryExpression */: - case 187 /* TypeOfExpression */: - case 188 /* VoidExpression */: - case 186 /* DeleteExpression */: - case 189 /* AwaitExpression */: + case 191 /* PrefixUnaryExpression */: + case 188 /* TypeOfExpression */: + case 189 /* VoidExpression */: + case 187 /* DeleteExpression */: + case 190 /* AwaitExpression */: return 15; - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: switch (operatorKind) { case 50 /* ExclamationToken */: case 51 /* TildeToken */: @@ -8436,11 +8714,11 @@ var ts; default: return -1; } - case 193 /* ConditionalExpression */: + case 194 /* ConditionalExpression */: return 4; - case 195 /* YieldExpression */: + case 196 /* YieldExpression */: return 2; - case 196 /* SpreadElement */: + case 197 /* SpreadElement */: return 1; default: return -1; @@ -8463,21 +8741,15 @@ var ts; return modificationCount; } function reattachFileDiagnostics(newFile) { - if (!ts.hasProperty(fileDiagnostics, newFile.fileName)) { - return; - } - for (var _i = 0, _a = fileDiagnostics[newFile.fileName]; _i < _a.length; _i++) { - var diagnostic = _a[_i]; - diagnostic.file = newFile; - } + ts.forEach(fileDiagnostics.get(newFile.fileName), function (diagnostic) { return diagnostic.file = newFile; }); } function add(diagnostic) { var diagnostics; if (diagnostic.file) { - diagnostics = fileDiagnostics[diagnostic.file.fileName]; + diagnostics = fileDiagnostics.get(diagnostic.file.fileName); if (!diagnostics) { diagnostics = []; - fileDiagnostics[diagnostic.file.fileName] = diagnostics; + fileDiagnostics.set(diagnostic.file.fileName, diagnostics); } } else { @@ -8494,16 +8766,16 @@ var ts; function getDiagnostics(fileName) { sortAndDeduplicate(); if (fileName) { - return fileDiagnostics[fileName] || []; + return fileDiagnostics.get(fileName) || []; } var allDiagnostics = []; function pushDiagnostic(d) { allDiagnostics.push(d); } ts.forEach(nonFileDiagnostics, pushDiagnostic); - for (var key in fileDiagnostics) { - ts.forEach(fileDiagnostics[key], pushDiagnostic); - } + fileDiagnostics.forEach(function (diagnostics) { + ts.forEach(diagnostics, pushDiagnostic); + }); return ts.sortAndDeduplicateDiagnostics(allDiagnostics); } function sortAndDeduplicate() { @@ -8512,9 +8784,9 @@ var ts; } diagnosticsModified = false; nonFileDiagnostics = ts.sortAndDeduplicateDiagnostics(nonFileDiagnostics); - for (var key in fileDiagnostics) { - fileDiagnostics[key] = ts.sortAndDeduplicateDiagnostics(fileDiagnostics[key]); - } + fileDiagnostics.forEach(function (diagnostics, key) { + fileDiagnostics.set(key, ts.sortAndDeduplicateDiagnostics(diagnostics)); + }); } } ts.createDiagnosticCollection = createDiagnosticCollection; @@ -8524,7 +8796,7 @@ var ts; // the map below must be updated. Note that this regexp *does not* include the 'delete' character. // There is no reason for this other than that JSON.stringify does not handle it either. var escapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; - var escapedCharsMap = ts.createMap({ + var escapedCharsMap = ts.createMapFromTemplate({ "\0": "\\0", "\t": "\\t", "\v": "\\v", @@ -8544,13 +8816,12 @@ var ts; * Note that this doesn't actually wrap the input in double quotes. */ function escapeString(s) { - s = escapedCharsRegExp.test(s) ? s.replace(escapedCharsRegExp, getReplacement) : s; - return s; - function getReplacement(c) { - return escapedCharsMap[c] || get16BitUnicodeEscapeSequence(c.charCodeAt(0)); - } + return s.replace(escapedCharsRegExp, getReplacement); } ts.escapeString = escapeString; + function getReplacement(c) { + return escapedCharsMap.get(c) || get16BitUnicodeEscapeSequence(c.charCodeAt(0)); + } function isIntrinsicJsxName(name) { var ch = name.substr(0, 1); return ch.toLowerCase() === ch; @@ -8707,168 +8978,77 @@ var ts; */ function getSourceFilesToEmit(host, targetSourceFile) { var options = host.getCompilerOptions(); + var isSourceFileFromExternalLibrary = function (file) { return host.isSourceFileFromExternalLibrary(file); }; if (options.outFile || options.out) { var moduleKind = ts.getEmitModuleKind(options); - var moduleEmitEnabled = moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System; - var sourceFiles = getAllEmittableSourceFiles(); + var moduleEmitEnabled_1 = moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System; // Can emit only sources that are not declaration file and are either non module code or module with --module or --target es6 specified - return ts.filter(sourceFiles, moduleEmitEnabled ? isNonDeclarationFile : isBundleEmitNonExternalModule); + return ts.filter(host.getSourceFiles(), function (sourceFile) { + return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) && sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary); + }); } else { - var sourceFiles = targetSourceFile === undefined ? getAllEmittableSourceFiles() : [targetSourceFile]; - return filterSourceFilesInDirectory(sourceFiles, function (file) { return host.isSourceFileFromExternalLibrary(file); }); - } - function getAllEmittableSourceFiles() { - return options.noEmitForJsFiles ? ts.filter(host.getSourceFiles(), function (sourceFile) { return !isSourceFileJavaScript(sourceFile); }) : host.getSourceFiles(); + var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile]; + return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary); }); } } ts.getSourceFilesToEmit = getSourceFilesToEmit; - /** Don't call this for `--outFile`, just for `--outDir` or plain emit. */ - function filterSourceFilesInDirectory(sourceFiles, isSourceFileFromExternalLibrary) { - return ts.filter(sourceFiles, function (file) { return shouldEmitInDirectory(file, isSourceFileFromExternalLibrary); }); - } - ts.filterSourceFilesInDirectory = filterSourceFilesInDirectory; - function isNonDeclarationFile(sourceFile) { - return !isDeclarationFile(sourceFile); + /** Don't call this for `--outFile`, just for `--outDir` or plain emit. `--outFile` needs additional checks. */ + function sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary) { + return !(options.noEmitForJsFiles && isSourceFileJavaScript(sourceFile)) && !isDeclarationFile(sourceFile) && !isSourceFileFromExternalLibrary(sourceFile); } + ts.sourceFileMayBeEmitted = sourceFileMayBeEmitted; /** - * Whether a file should be emitted in a non-`--outFile` case. - * Don't emit if source file is a declaration file, or was located under node_modules - */ - function shouldEmitInDirectory(sourceFile, isSourceFileFromExternalLibrary) { - return isNonDeclarationFile(sourceFile) && !isSourceFileFromExternalLibrary(sourceFile); - } - function isBundleEmitNonExternalModule(sourceFile) { - return isNonDeclarationFile(sourceFile) && !ts.isExternalModule(sourceFile); - } - /** - * Iterates over each source file to emit. The source files are expected to have been - * transformed for use by the pretty printer. - * - * Originally part of `forEachExpectedEmitFile`, this functionality was extracted to support - * transformations. + * Iterates over the source files that are expected to have an emit output. * * @param host An EmitHost. - * @param sourceFiles The transformed source files to emit. * @param action The action to execute. + * @param sourceFilesOrTargetSourceFile + * If an array, the full list of source files to emit. + * Else, calls `getSourceFilesToEmit` with the (optional) target source file to determine the list of source files to emit. */ - function forEachTransformedEmitFile(host, sourceFiles, action, emitOnlyDtsFiles) { + function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, emitOnlyDtsFiles) { + var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile); var options = host.getCompilerOptions(); - // Emit on each source file if (options.outFile || options.out) { - onBundledEmit(sourceFiles); - } - else { - for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) { - var sourceFile = sourceFiles_2[_i]; - // Don't emit if source file is a declaration file, or was located under node_modules - if (!isDeclarationFile(sourceFile) && !host.isSourceFileFromExternalLibrary(sourceFile)) { - onSingleFileEmit(host, sourceFile); - } - } - } - function onSingleFileEmit(host, sourceFile) { - // JavaScript files are always LanguageVariant.JSX, as JSX syntax is allowed in .js files also. - // So for JavaScript files, '.jsx' is only emitted if the input was '.jsx', and JsxEmit.Preserve. - // For TypeScript, the only time to emit with a '.jsx' extension, is on JSX input, and JsxEmit.Preserve - var extension = ".js"; - if (options.jsx === 1 /* Preserve */) { - if (isSourceFileJavaScript(sourceFile)) { - if (ts.fileExtensionIs(sourceFile.fileName, ".jsx")) { - extension = ".jsx"; - } - } - else if (sourceFile.languageVariant === 1 /* JSX */) { - // TypeScript source file preserving JSX syntax - extension = ".jsx"; - } - } - var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, extension); - var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); - var declarationFilePath = !isSourceFileJavaScript(sourceFile) && (options.declaration || emitOnlyDtsFiles) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; - action(jsFilePath, sourceMapFilePath, declarationFilePath, [sourceFile], /*isBundledEmit*/ false); - } - function onBundledEmit(sourceFiles) { if (sourceFiles.length) { var jsFilePath = options.outFile || options.out; var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); - var declarationFilePath = options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : undefined; - action(jsFilePath, sourceMapFilePath, declarationFilePath, sourceFiles, /*isBundledEmit*/ true); + var declarationFilePath = options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : ""; + action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, ts.createBundle(sourceFiles), emitOnlyDtsFiles); + } + } + else { + for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { + var sourceFile = sourceFiles_1[_i]; + var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, getOutputExtension(sourceFile, options)); + var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); + var declarationFilePath = !isSourceFileJavaScript(sourceFile) && (emitOnlyDtsFiles || options.declaration) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; + action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, sourceFile, emitOnlyDtsFiles); } } } - ts.forEachTransformedEmitFile = forEachTransformedEmitFile; + ts.forEachEmittedFile = forEachEmittedFile; function getSourceMapFilePath(jsFilePath, options) { return options.sourceMap ? jsFilePath + ".map" : undefined; } - /** - * Iterates over the source files that are expected to have an emit output. This function - * is used by the legacy emitter and the declaration emitter and should not be used by - * the tree transforming emitter. - * - * @param host An EmitHost. - * @param action The action to execute. - * @param targetSourceFile An optional target source file to emit. - */ - function forEachExpectedEmitFile(host, action, targetSourceFile, emitOnlyDtsFiles) { - var options = host.getCompilerOptions(); - // Emit on each source file - if (options.outFile || options.out) { - onBundledEmit(host); - } - else { - var sourceFiles = targetSourceFile === undefined ? getSourceFilesToEmit(host) : [targetSourceFile]; - for (var _i = 0, sourceFiles_3 = sourceFiles; _i < sourceFiles_3.length; _i++) { - var sourceFile = sourceFiles_3[_i]; - if (shouldEmitInDirectory(sourceFile, function (file) { return host.isSourceFileFromExternalLibrary(file); })) { - onSingleFileEmit(host, sourceFile); + // JavaScript files are always LanguageVariant.JSX, as JSX syntax is allowed in .js files also. + // So for JavaScript files, '.jsx' is only emitted if the input was '.jsx', and JsxEmit.Preserve. + // For TypeScript, the only time to emit with a '.jsx' extension, is on JSX input, and JsxEmit.Preserve + function getOutputExtension(sourceFile, options) { + if (options.jsx === 1 /* Preserve */) { + if (isSourceFileJavaScript(sourceFile)) { + if (ts.fileExtensionIs(sourceFile.fileName, ".jsx")) { + return ".jsx"; } } - } - function onSingleFileEmit(host, sourceFile) { - // JavaScript files are always LanguageVariant.JSX, as JSX syntax is allowed in .js files also. - // So for JavaScript files, '.jsx' is only emitted if the input was '.jsx', and JsxEmit.Preserve. - // For TypeScript, the only time to emit with a '.jsx' extension, is on JSX input, and JsxEmit.Preserve - var extension = ".js"; - if (options.jsx === 1 /* Preserve */) { - if (isSourceFileJavaScript(sourceFile)) { - if (ts.fileExtensionIs(sourceFile.fileName, ".jsx")) { - extension = ".jsx"; - } - } - else if (sourceFile.languageVariant === 1 /* JSX */) { - // TypeScript source file preserving JSX syntax - extension = ".jsx"; - } - } - var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, extension); - var declarationFilePath = !isSourceFileJavaScript(sourceFile) && (emitOnlyDtsFiles || options.declaration) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; - var emitFileNames = { - jsFilePath: jsFilePath, - sourceMapFilePath: getSourceMapFilePath(jsFilePath, options), - declarationFilePath: declarationFilePath - }; - action(emitFileNames, [sourceFile], /*isBundledEmit*/ false, emitOnlyDtsFiles); - } - function onBundledEmit(host) { - // Can emit only sources that are not declaration file and are either non module code or module with - // --module or --target es6 specified. Files included by searching under node_modules are also not emitted. - var bundledSources = ts.filter(getSourceFilesToEmit(host), function (sourceFile) { return !isDeclarationFile(sourceFile) && - !host.isSourceFileFromExternalLibrary(sourceFile) && - (!ts.isExternalModule(sourceFile) || - !!ts.getEmitModuleKind(options)); }); - if (bundledSources.length) { - var jsFilePath = options.outFile || options.out; - var emitFileNames = { - jsFilePath: jsFilePath, - sourceMapFilePath: getSourceMapFilePath(jsFilePath, options), - declarationFilePath: options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : undefined - }; - action(emitFileNames, bundledSources, /*isBundledEmit*/ true, emitOnlyDtsFiles); + else if (sourceFile.languageVariant === 1 /* JSX */) { + // TypeScript source file preserving JSX syntax + return ".jsx"; } } + return ".js"; } - ts.forEachExpectedEmitFile = forEachExpectedEmitFile; function getSourceFilePathInNewDir(sourceFile, host, newDirPath) { var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory()); var commonSourceDirectory = host.getCommonSourceDirectory(); @@ -8893,7 +9073,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 150 /* Constructor */ && nodeIsPresent(member.body)) { + if (member.kind === 151 /* Constructor */ && nodeIsPresent(member.body)) { return member; } }); @@ -8935,10 +9115,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 151 /* GetAccessor */) { + if (accessor.kind === 152 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 152 /* SetAccessor */) { + else if (accessor.kind === 153 /* SetAccessor */) { setAccessor = accessor; } else { @@ -8947,7 +9127,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 151 /* GetAccessor */ || member.kind === 152 /* SetAccessor */) + if ((member.kind === 152 /* GetAccessor */ || member.kind === 153 /* SetAccessor */) && hasModifier(member, 32 /* Static */) === hasModifier(accessor, 32 /* Static */)) { var memberName = getPropertyNameForPropertyNameNode(member.name); var accessorName = getPropertyNameForPropertyNameNode(accessor.name); @@ -8958,10 +9138,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 151 /* GetAccessor */ && !getAccessor) { + if (member.kind === 152 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 152 /* SetAccessor */ && !setAccessor) { + if (member.kind === 153 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -9224,7 +9404,7 @@ var ts; ts.isAssignmentOperator = isAssignmentOperator; /** Get `C` given `N` if `N` is in the position `class C extends N` where `N` is an ExpressionWithTypeArguments. */ function tryGetClassExtendingExpressionWithTypeArguments(node) { - if (node.kind === 199 /* ExpressionWithTypeArguments */ && + if (node.kind === 200 /* ExpressionWithTypeArguments */ && node.parent.token === 84 /* ExtendsKeyword */ && isClassLike(node.parent.parent)) { return node.parent.parent; @@ -9242,8 +9422,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 176 /* ObjectLiteralExpression */ - || kind === 175 /* ArrayLiteralExpression */; + return kind === 177 /* ObjectLiteralExpression */ + || kind === 176 /* ArrayLiteralExpression */; } return false; } @@ -9269,31 +9449,42 @@ var ts; return tryGetClassExtendingExpressionWithTypeArguments(node) !== undefined; } ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause; + function isExpressionWithTypeArgumentsInClassImplementsClause(node) { + return node.kind === 200 /* ExpressionWithTypeArguments */ + && isEntityNameExpression(node.expression) + && node.parent + && node.parent.token === 107 /* ImplementsKeyword */ + && node.parent.parent + && isClassLike(node.parent.parent); + } + ts.isExpressionWithTypeArgumentsInClassImplementsClause = isExpressionWithTypeArgumentsInClassImplementsClause; function isEntityNameExpression(node) { return node.kind === 70 /* Identifier */ || - node.kind === 177 /* PropertyAccessExpression */ && isEntityNameExpression(node.expression); + node.kind === 178 /* PropertyAccessExpression */ && isEntityNameExpression(node.expression); } ts.isEntityNameExpression = isEntityNameExpression; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 141 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 177 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 142 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 178 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; - function isEmptyObjectLiteralOrArrayLiteral(expression) { - var kind = expression.kind; - if (kind === 176 /* ObjectLiteralExpression */) { - return expression.properties.length === 0; - } - if (kind === 175 /* ArrayLiteralExpression */) { - return expression.elements.length === 0; - } - return false; + function isEmptyObjectLiteral(expression) { + return expression.kind === 177 /* ObjectLiteralExpression */ && + expression.properties.length === 0; } - ts.isEmptyObjectLiteralOrArrayLiteral = isEmptyObjectLiteralOrArrayLiteral; + ts.isEmptyObjectLiteral = isEmptyObjectLiteral; + function isEmptyArrayLiteral(expression) { + return expression.kind === 176 /* ArrayLiteralExpression */ && + expression.elements.length === 0; + } + ts.isEmptyArrayLiteral = isEmptyArrayLiteral; function getLocalSymbolForExportDefault(symbol) { - return symbol && symbol.valueDeclaration && hasModifier(symbol.valueDeclaration, 512 /* Default */) ? symbol.valueDeclaration.localSymbol : undefined; + return isExportDefaultSymbol(symbol) ? symbol.valueDeclaration.localSymbol : undefined; } ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; + function isExportDefaultSymbol(symbol) { + return symbol && symbol.valueDeclaration && hasModifier(symbol.valueDeclaration, 512 /* Default */); + } /** Return ".ts", ".d.ts", or ".tsx", if that is the extension. */ function tryExtractTypeScriptExtension(fileName) { return ts.find(ts.supportedTypescriptExtensionsForExtractExtension, function (extension) { return ts.fileExtensionIs(fileName, extension); }); @@ -9333,47 +9524,6 @@ var ts; } return output; } - /** - * Serialize an object graph into a JSON string. This is intended only for use on an acyclic graph - * as the fallback implementation does not check for circular references by default. - */ - ts.stringify = typeof JSON !== "undefined" && JSON.stringify - ? JSON.stringify - : stringifyFallback; - /** - * Serialize an object graph into a JSON string. - */ - function stringifyFallback(value) { - // JSON.stringify returns `undefined` here, instead of the string "undefined". - return value === undefined ? undefined : stringifyValue(value); - } - function stringifyValue(value) { - return typeof value === "string" ? "\"" + escapeString(value) + "\"" - : typeof value === "number" ? isFinite(value) ? String(value) : "null" - : typeof value === "boolean" ? value ? "true" : "false" - : typeof value === "object" && value ? ts.isArray(value) ? cycleCheck(stringifyArray, value) : cycleCheck(stringifyObject, value) - : "null"; - } - function cycleCheck(cb, value) { - ts.Debug.assert(!value.hasOwnProperty("__cycle"), "Converting circular structure to JSON"); - value.__cycle = true; - var result = cb(value); - delete value.__cycle; - return result; - } - function stringifyArray(value) { - return "[" + ts.reduceLeft(value, stringifyElement, "") + "]"; - } - function stringifyElement(memo, value) { - return (memo ? memo + "," : memo) + stringifyValue(value); - } - function stringifyObject(value) { - return "{" + ts.reduceOwnProperties(value, stringifyProperty, "") + "}"; - } - function stringifyProperty(memo, value, key) { - return value === undefined || typeof value === "function" || key === "__cycle" ? memo - : (memo ? memo + "," : memo) + ("\"" + escapeString(key) + "\":" + stringifyValue(value)); - } var base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; /** * Converts a string to a base-64 encoded ASCII string. @@ -9446,39 +9596,39 @@ var ts; || kind === 94 /* NullKeyword */) { return true; } - else if (kind === 177 /* PropertyAccessExpression */) { + else if (kind === 178 /* PropertyAccessExpression */) { return isSimpleExpressionWorker(node.expression, depth + 1); } - else if (kind === 178 /* ElementAccessExpression */) { + else if (kind === 179 /* ElementAccessExpression */) { return isSimpleExpressionWorker(node.expression, depth + 1) && isSimpleExpressionWorker(node.argumentExpression, depth + 1); } - else if (kind === 190 /* PrefixUnaryExpression */ - || kind === 191 /* PostfixUnaryExpression */) { + else if (kind === 191 /* PrefixUnaryExpression */ + || kind === 192 /* PostfixUnaryExpression */) { return isSimpleExpressionWorker(node.operand, depth + 1); } - else if (kind === 192 /* BinaryExpression */) { + else if (kind === 193 /* BinaryExpression */) { return node.operatorToken.kind !== 39 /* AsteriskAsteriskToken */ && isSimpleExpressionWorker(node.left, depth + 1) && isSimpleExpressionWorker(node.right, depth + 1); } - else if (kind === 193 /* ConditionalExpression */) { + else if (kind === 194 /* ConditionalExpression */) { return isSimpleExpressionWorker(node.condition, depth + 1) && isSimpleExpressionWorker(node.whenTrue, depth + 1) && isSimpleExpressionWorker(node.whenFalse, depth + 1); } - else if (kind === 188 /* VoidExpression */ - || kind === 187 /* TypeOfExpression */ - || kind === 186 /* DeleteExpression */) { + else if (kind === 189 /* VoidExpression */ + || kind === 188 /* TypeOfExpression */ + || kind === 187 /* DeleteExpression */) { return isSimpleExpressionWorker(node.expression, depth + 1); } - else if (kind === 175 /* ArrayLiteralExpression */) { + else if (kind === 176 /* ArrayLiteralExpression */) { return node.elements.length === 0; } - else if (kind === 176 /* ObjectLiteralExpression */) { + else if (kind === 177 /* ObjectLiteralExpression */) { return node.properties.length === 0; } - else if (kind === 179 /* CallExpression */) { + else if (kind === 180 /* CallExpression */) { if (!isSimpleExpressionWorker(node.expression, depth + 1)) { return false; } @@ -9493,16 +9643,19 @@ var ts; } return false; } - var syntaxKindCache = ts.createMap(); + var syntaxKindCache = []; function formatSyntaxKind(kind) { var syntaxKindEnum = ts.SyntaxKind; if (syntaxKindEnum) { - if (syntaxKindCache[kind]) { - return syntaxKindCache[kind]; + var cached = syntaxKindCache[kind]; + if (cached !== undefined) { + return cached; } - for (var name_7 in syntaxKindEnum) { - if (syntaxKindEnum[name_7] === kind) { - return syntaxKindCache[kind] = kind.toString() + " (" + name_7 + ")"; + for (var name in syntaxKindEnum) { + if (syntaxKindEnum[name] === kind) { + var result = kind + " (" + name + ")"; + syntaxKindCache[kind] = result; + return result; } } } @@ -9511,6 +9664,14 @@ var ts; } } ts.formatSyntaxKind = formatSyntaxKind; + function getRangePos(range) { + return range ? range.pos : -1; + } + ts.getRangePos = getRangePos; + function getRangeEnd(range) { + return range ? range.end : -1; + } + ts.getRangeEnd = getRangeEnd; /** * Increases (or decreases) a position by the provided amount. * @@ -9642,11 +9803,11 @@ var ts; * declaration. */ function isDeclarationNameOfEnumOrNamespace(node) { - var parseNode = getParseTreeNode(node); + var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 229 /* EnumDeclaration */: - case 230 /* ModuleDeclaration */: + case 231 /* EnumDeclaration */: + case 232 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -9667,7 +9828,7 @@ var ts; if (node.symbol) { for (var _i = 0, _a = node.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 226 /* ClassDeclaration */ && declaration !== node) { + if (declaration.kind === 228 /* ClassDeclaration */ && declaration !== node) { return true; } } @@ -9732,6 +9893,10 @@ var ts; return node.kind === 70 /* Identifier */; } ts.isIdentifier = isIdentifier; + function isVoidExpression(node) { + return node.kind === 189 /* VoidExpression */; + } + ts.isVoidExpression = isVoidExpression; function isGeneratedIdentifier(node) { // Using `>` here catches both `GeneratedIdentifierKind.None` and `undefined`. return isIdentifier(node) && node.autoGenerateKind > 0 /* None */; @@ -9744,16 +9909,16 @@ var ts; ts.isModifier = isModifier; // Names function isQualifiedName(node) { - return node.kind === 141 /* QualifiedName */; + return node.kind === 142 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 142 /* ComputedPropertyName */; + return node.kind === 143 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; function isEntityName(node) { var kind = node.kind; - return kind === 141 /* QualifiedName */ + return kind === 142 /* QualifiedName */ || kind === 70 /* Identifier */; } ts.isEntityName = isEntityName; @@ -9762,7 +9927,7 @@ var ts; return kind === 70 /* Identifier */ || kind === 9 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 142 /* ComputedPropertyName */; + || kind === 143 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isModuleName(node) { @@ -9774,61 +9939,65 @@ var ts; function isBindingName(node) { var kind = node.kind; return kind === 70 /* Identifier */ - || kind === 172 /* ObjectBindingPattern */ - || kind === 173 /* ArrayBindingPattern */; + || kind === 173 /* ObjectBindingPattern */ + || kind === 174 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Signature elements function isTypeParameter(node) { - return node.kind === 143 /* TypeParameter */; + return node.kind === 144 /* TypeParameter */; } ts.isTypeParameter = isTypeParameter; function isParameter(node) { - return node.kind === 144 /* Parameter */; + return node.kind === 145 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 145 /* Decorator */; + return node.kind === 146 /* Decorator */; } ts.isDecorator = isDecorator; // Type members function isMethodDeclaration(node) { - return node.kind === 149 /* MethodDeclaration */; + return node.kind === 150 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isClassElement(node) { var kind = node.kind; - return kind === 150 /* Constructor */ - || kind === 147 /* PropertyDeclaration */ - || kind === 149 /* MethodDeclaration */ - || kind === 151 /* GetAccessor */ - || kind === 152 /* SetAccessor */ - || kind === 155 /* IndexSignature */ - || kind === 203 /* SemicolonClassElement */; + return kind === 151 /* Constructor */ + || kind === 148 /* PropertyDeclaration */ + || kind === 150 /* MethodDeclaration */ + || kind === 152 /* GetAccessor */ + || kind === 153 /* SetAccessor */ + || kind === 156 /* IndexSignature */ + || kind === 205 /* SemicolonClassElement */; } ts.isClassElement = isClassElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 257 /* PropertyAssignment */ - || kind === 258 /* ShorthandPropertyAssignment */ - || kind === 259 /* SpreadAssignment */ - || kind === 149 /* MethodDeclaration */ - || kind === 151 /* GetAccessor */ - || kind === 152 /* SetAccessor */ - || kind === 244 /* MissingDeclaration */; + return kind === 260 /* PropertyAssignment */ + || kind === 261 /* ShorthandPropertyAssignment */ + || kind === 262 /* SpreadAssignment */ + || kind === 150 /* MethodDeclaration */ + || kind === 152 /* GetAccessor */ + || kind === 153 /* SetAccessor */ + || kind === 246 /* MissingDeclaration */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type function isTypeNodeKind(kind) { - return (kind >= 156 /* FirstTypeNode */ && kind <= 171 /* LastTypeNode */) + return (kind >= 157 /* FirstTypeNode */ && kind <= 172 /* LastTypeNode */) || kind === 118 /* AnyKeyword */ || kind === 132 /* NumberKeyword */ + || kind === 133 /* ObjectKeyword */ || kind === 121 /* BooleanKeyword */ - || kind === 134 /* StringKeyword */ - || kind === 135 /* SymbolKeyword */ + || kind === 135 /* StringKeyword */ + || kind === 136 /* SymbolKeyword */ + || kind === 98 /* ThisKeyword */ || kind === 104 /* VoidKeyword */ + || kind === 138 /* UndefinedKeyword */ + || kind === 94 /* NullKeyword */ || kind === 129 /* NeverKeyword */ - || kind === 199 /* ExpressionWithTypeArguments */; + || kind === 200 /* ExpressionWithTypeArguments */; } /** * Node test that determines whether a node is a valid type node. @@ -9841,36 +10010,36 @@ var ts; ts.isTypeNode = isTypeNode; // Binding patterns function isArrayBindingPattern(node) { - return node.kind === 173 /* ArrayBindingPattern */; + return node.kind === 174 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isObjectBindingPattern(node) { - return node.kind === 172 /* ObjectBindingPattern */; + return node.kind === 173 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 173 /* ArrayBindingPattern */ - || kind === 172 /* ObjectBindingPattern */; + return kind === 174 /* ArrayBindingPattern */ + || kind === 173 /* ObjectBindingPattern */; } return false; } ts.isBindingPattern = isBindingPattern; function isAssignmentPattern(node) { var kind = node.kind; - return kind === 175 /* ArrayLiteralExpression */ - || kind === 176 /* ObjectLiteralExpression */; + return kind === 176 /* ArrayLiteralExpression */ + || kind === 177 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; function isBindingElement(node) { - return node.kind === 174 /* BindingElement */; + return node.kind === 175 /* BindingElement */; } ts.isBindingElement = isBindingElement; function isArrayBindingElement(node) { var kind = node.kind; - return kind === 174 /* BindingElement */ - || kind === 198 /* OmittedExpression */; + return kind === 175 /* BindingElement */ + || kind === 199 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -9878,9 +10047,9 @@ var ts; */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 223 /* VariableDeclaration */: - case 144 /* Parameter */: - case 174 /* BindingElement */: + case 225 /* VariableDeclaration */: + case 145 /* Parameter */: + case 175 /* BindingElement */: return true; } return false; @@ -9899,8 +10068,8 @@ var ts; */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 172 /* ObjectBindingPattern */: - case 176 /* ObjectLiteralExpression */: + case 173 /* ObjectBindingPattern */: + case 177 /* ObjectLiteralExpression */: return true; } return false; @@ -9911,8 +10080,8 @@ var ts; */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 173 /* ArrayBindingPattern */: - case 175 /* ArrayLiteralExpression */: + case 174 /* ArrayBindingPattern */: + case 176 /* ArrayLiteralExpression */: return true; } return false; @@ -9920,86 +10089,92 @@ var ts; ts.isArrayBindingOrAssignmentPattern = isArrayBindingOrAssignmentPattern; // Expression function isArrayLiteralExpression(node) { - return node.kind === 175 /* ArrayLiteralExpression */; + return node.kind === 176 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 176 /* ObjectLiteralExpression */; + return node.kind === 177 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 177 /* PropertyAccessExpression */; + return node.kind === 178 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; + function isPropertyAccessOrQualifiedName(node) { + var kind = node.kind; + return kind === 178 /* PropertyAccessExpression */ + || kind === 142 /* QualifiedName */; + } + ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isElementAccessExpression(node) { - return node.kind === 178 /* ElementAccessExpression */; + return node.kind === 179 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isBinaryExpression(node) { - return node.kind === 192 /* BinaryExpression */; + return node.kind === 193 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 193 /* ConditionalExpression */; + return node.kind === 194 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isCallExpression(node) { - return node.kind === 179 /* CallExpression */; + return node.kind === 180 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 194 /* TemplateExpression */ + return kind === 195 /* TemplateExpression */ || kind === 12 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; function isSpreadExpression(node) { - return node.kind === 196 /* SpreadElement */; + return node.kind === 197 /* SpreadElement */; } ts.isSpreadExpression = isSpreadExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 199 /* ExpressionWithTypeArguments */; + return node.kind === 200 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isLeftHandSideExpressionKind(kind) { - return kind === 177 /* PropertyAccessExpression */ - || kind === 178 /* ElementAccessExpression */ - || kind === 180 /* NewExpression */ - || kind === 179 /* CallExpression */ - || kind === 246 /* JsxElement */ - || kind === 247 /* JsxSelfClosingElement */ - || kind === 181 /* TaggedTemplateExpression */ - || kind === 175 /* ArrayLiteralExpression */ - || kind === 183 /* ParenthesizedExpression */ - || kind === 176 /* ObjectLiteralExpression */ - || kind === 197 /* ClassExpression */ - || kind === 184 /* FunctionExpression */ + return kind === 178 /* PropertyAccessExpression */ + || kind === 179 /* ElementAccessExpression */ + || kind === 181 /* NewExpression */ + || kind === 180 /* CallExpression */ + || kind === 248 /* JsxElement */ + || kind === 249 /* JsxSelfClosingElement */ + || kind === 182 /* TaggedTemplateExpression */ + || kind === 176 /* ArrayLiteralExpression */ + || kind === 184 /* ParenthesizedExpression */ + || kind === 177 /* ObjectLiteralExpression */ + || kind === 198 /* ClassExpression */ + || kind === 185 /* FunctionExpression */ || kind === 70 /* Identifier */ || kind === 11 /* RegularExpressionLiteral */ || kind === 8 /* NumericLiteral */ || kind === 9 /* StringLiteral */ || kind === 12 /* NoSubstitutionTemplateLiteral */ - || kind === 194 /* TemplateExpression */ + || kind === 195 /* TemplateExpression */ || kind === 85 /* FalseKeyword */ || kind === 94 /* NullKeyword */ || kind === 98 /* ThisKeyword */ || kind === 100 /* TrueKeyword */ || kind === 96 /* SuperKeyword */ - || kind === 201 /* NonNullExpression */ - || kind === 297 /* RawExpression */; + || kind === 202 /* NonNullExpression */ + || kind === 203 /* MetaProperty */; } function isLeftHandSideExpression(node) { return isLeftHandSideExpressionKind(ts.skipPartiallyEmittedExpressions(node).kind); } ts.isLeftHandSideExpression = isLeftHandSideExpression; function isUnaryExpressionKind(kind) { - return kind === 190 /* PrefixUnaryExpression */ - || kind === 191 /* PostfixUnaryExpression */ - || kind === 186 /* DeleteExpression */ - || kind === 187 /* TypeOfExpression */ - || kind === 188 /* VoidExpression */ - || kind === 189 /* AwaitExpression */ - || kind === 182 /* TypeAssertionExpression */ + return kind === 191 /* PrefixUnaryExpression */ + || kind === 192 /* PostfixUnaryExpression */ + || kind === 187 /* DeleteExpression */ + || kind === 188 /* TypeOfExpression */ + || kind === 189 /* VoidExpression */ + || kind === 190 /* AwaitExpression */ + || kind === 183 /* TypeAssertionExpression */ || isLeftHandSideExpressionKind(kind); } function isUnaryExpression(node) { @@ -10007,14 +10182,13 @@ var ts; } ts.isUnaryExpression = isUnaryExpression; function isExpressionKind(kind) { - return kind === 193 /* ConditionalExpression */ - || kind === 195 /* YieldExpression */ - || kind === 185 /* ArrowFunction */ - || kind === 192 /* BinaryExpression */ - || kind === 196 /* SpreadElement */ - || kind === 200 /* AsExpression */ - || kind === 198 /* OmittedExpression */ - || kind === 297 /* RawExpression */ + return kind === 194 /* ConditionalExpression */ + || kind === 196 /* YieldExpression */ + || kind === 186 /* ArrowFunction */ + || kind === 193 /* BinaryExpression */ + || kind === 197 /* SpreadElement */ + || kind === 201 /* AsExpression */ + || kind === 199 /* OmittedExpression */ || isUnaryExpressionKind(kind); } function isExpression(node) { @@ -10023,16 +10197,16 @@ var ts; ts.isExpression = isExpression; function isAssertionExpression(node) { var kind = node.kind; - return kind === 182 /* TypeAssertionExpression */ - || kind === 200 /* AsExpression */; + return kind === 183 /* TypeAssertionExpression */ + || kind === 201 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; function isPartiallyEmittedExpression(node) { - return node.kind === 294 /* PartiallyEmittedExpression */; + return node.kind === 295 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; function isNotEmittedStatement(node) { - return node.kind === 293 /* NotEmittedStatement */; + return node.kind === 294 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; function isNotEmittedOrPartiallyEmittedNode(node) { @@ -10041,17 +10215,17 @@ var ts; } ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isOmittedExpression(node) { - return node.kind === 198 /* OmittedExpression */; + return node.kind === 199 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; // Misc function isTemplateSpan(node) { - return node.kind === 202 /* TemplateSpan */; + return node.kind === 204 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; // Element function isBlock(node) { - return node.kind === 204 /* Block */; + return node.kind === 206 /* Block */; } ts.isBlock = isBlock; function isConciseBody(node) { @@ -10069,121 +10243,135 @@ var ts; } ts.isForInitializer = isForInitializer; function isVariableDeclaration(node) { - return node.kind === 223 /* VariableDeclaration */; + return node.kind === 225 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 224 /* VariableDeclarationList */; + return node.kind === 226 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isCaseBlock(node) { - return node.kind === 232 /* CaseBlock */; + return node.kind === 234 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isModuleBody(node) { var kind = node.kind; - return kind === 231 /* ModuleBlock */ - || kind === 230 /* ModuleDeclaration */; + return kind === 233 /* ModuleBlock */ + || kind === 232 /* ModuleDeclaration */ + || kind === 70 /* Identifier */; } ts.isModuleBody = isModuleBody; + function isNamespaceBody(node) { + var kind = node.kind; + return kind === 233 /* ModuleBlock */ + || kind === 232 /* ModuleDeclaration */; + } + ts.isNamespaceBody = isNamespaceBody; + function isJSDocNamespaceBody(node) { + var kind = node.kind; + return kind === 70 /* Identifier */ + || kind === 232 /* ModuleDeclaration */; + } + ts.isJSDocNamespaceBody = isJSDocNamespaceBody; function isImportEqualsDeclaration(node) { - return node.kind === 234 /* ImportEqualsDeclaration */; + return node.kind === 236 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportClause(node) { - return node.kind === 236 /* ImportClause */; + return node.kind === 238 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamedImportBindings(node) { var kind = node.kind; - return kind === 238 /* NamedImports */ - || kind === 237 /* NamespaceImport */; + return kind === 240 /* NamedImports */ + || kind === 239 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; function isImportSpecifier(node) { - return node.kind === 239 /* ImportSpecifier */; + return node.kind === 241 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isNamedExports(node) { - return node.kind === 242 /* NamedExports */; + return node.kind === 244 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 243 /* ExportSpecifier */; + return node.kind === 245 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isModuleOrEnumDeclaration(node) { - return node.kind === 230 /* ModuleDeclaration */ || node.kind === 229 /* EnumDeclaration */; + return node.kind === 232 /* ModuleDeclaration */ || node.kind === 231 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 185 /* ArrowFunction */ - || kind === 174 /* BindingElement */ - || kind === 226 /* ClassDeclaration */ - || kind === 197 /* ClassExpression */ - || kind === 150 /* Constructor */ - || kind === 229 /* EnumDeclaration */ - || kind === 260 /* EnumMember */ - || kind === 243 /* ExportSpecifier */ - || kind === 225 /* FunctionDeclaration */ - || kind === 184 /* FunctionExpression */ - || kind === 151 /* GetAccessor */ - || kind === 236 /* ImportClause */ - || kind === 234 /* ImportEqualsDeclaration */ - || kind === 239 /* ImportSpecifier */ - || kind === 227 /* InterfaceDeclaration */ - || kind === 149 /* MethodDeclaration */ - || kind === 148 /* MethodSignature */ - || kind === 230 /* ModuleDeclaration */ - || kind === 233 /* NamespaceExportDeclaration */ - || kind === 237 /* NamespaceImport */ - || kind === 144 /* Parameter */ - || kind === 257 /* PropertyAssignment */ - || kind === 147 /* PropertyDeclaration */ - || kind === 146 /* PropertySignature */ - || kind === 152 /* SetAccessor */ - || kind === 258 /* ShorthandPropertyAssignment */ - || kind === 228 /* TypeAliasDeclaration */ - || kind === 143 /* TypeParameter */ - || kind === 223 /* VariableDeclaration */ - || kind === 285 /* JSDocTypedefTag */; + return kind === 186 /* ArrowFunction */ + || kind === 175 /* BindingElement */ + || kind === 228 /* ClassDeclaration */ + || kind === 198 /* ClassExpression */ + || kind === 151 /* Constructor */ + || kind === 231 /* EnumDeclaration */ + || kind === 263 /* EnumMember */ + || kind === 245 /* ExportSpecifier */ + || kind === 227 /* FunctionDeclaration */ + || kind === 185 /* FunctionExpression */ + || kind === 152 /* GetAccessor */ + || kind === 238 /* ImportClause */ + || kind === 236 /* ImportEqualsDeclaration */ + || kind === 241 /* ImportSpecifier */ + || kind === 229 /* InterfaceDeclaration */ + || kind === 252 /* JsxAttribute */ + || kind === 150 /* MethodDeclaration */ + || kind === 149 /* MethodSignature */ + || kind === 232 /* ModuleDeclaration */ + || kind === 235 /* NamespaceExportDeclaration */ + || kind === 239 /* NamespaceImport */ + || kind === 145 /* Parameter */ + || kind === 260 /* PropertyAssignment */ + || kind === 148 /* PropertyDeclaration */ + || kind === 147 /* PropertySignature */ + || kind === 153 /* SetAccessor */ + || kind === 261 /* ShorthandPropertyAssignment */ + || kind === 230 /* TypeAliasDeclaration */ + || kind === 144 /* TypeParameter */ + || kind === 225 /* VariableDeclaration */ + || kind === 289 /* JSDocTypedefTag */; } function isDeclarationStatementKind(kind) { - return kind === 225 /* FunctionDeclaration */ - || kind === 244 /* MissingDeclaration */ - || kind === 226 /* ClassDeclaration */ - || kind === 227 /* InterfaceDeclaration */ - || kind === 228 /* TypeAliasDeclaration */ - || kind === 229 /* EnumDeclaration */ - || kind === 230 /* ModuleDeclaration */ - || kind === 235 /* ImportDeclaration */ - || kind === 234 /* ImportEqualsDeclaration */ - || kind === 241 /* ExportDeclaration */ - || kind === 240 /* ExportAssignment */ - || kind === 233 /* NamespaceExportDeclaration */; + return kind === 227 /* FunctionDeclaration */ + || kind === 246 /* MissingDeclaration */ + || kind === 228 /* ClassDeclaration */ + || kind === 229 /* InterfaceDeclaration */ + || kind === 230 /* TypeAliasDeclaration */ + || kind === 231 /* EnumDeclaration */ + || kind === 232 /* ModuleDeclaration */ + || kind === 237 /* ImportDeclaration */ + || kind === 236 /* ImportEqualsDeclaration */ + || kind === 243 /* ExportDeclaration */ + || kind === 242 /* ExportAssignment */ + || kind === 235 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 215 /* BreakStatement */ - || kind === 214 /* ContinueStatement */ - || kind === 222 /* DebuggerStatement */ - || kind === 209 /* DoStatement */ - || kind === 207 /* ExpressionStatement */ - || kind === 206 /* EmptyStatement */ - || kind === 212 /* ForInStatement */ - || kind === 213 /* ForOfStatement */ - || kind === 211 /* ForStatement */ - || kind === 208 /* IfStatement */ - || kind === 219 /* LabeledStatement */ - || kind === 216 /* ReturnStatement */ - || kind === 218 /* SwitchStatement */ - || kind === 220 /* ThrowStatement */ - || kind === 221 /* TryStatement */ - || kind === 205 /* VariableStatement */ - || kind === 210 /* WhileStatement */ - || kind === 217 /* WithStatement */ - || kind === 293 /* NotEmittedStatement */ - || kind === 296 /* EndOfDeclarationMarker */ - || kind === 295 /* MergeDeclarationMarker */; + return kind === 217 /* BreakStatement */ + || kind === 216 /* ContinueStatement */ + || kind === 224 /* DebuggerStatement */ + || kind === 211 /* DoStatement */ + || kind === 209 /* ExpressionStatement */ + || kind === 208 /* EmptyStatement */ + || kind === 214 /* ForInStatement */ + || kind === 215 /* ForOfStatement */ + || kind === 213 /* ForStatement */ + || kind === 210 /* IfStatement */ + || kind === 221 /* LabeledStatement */ + || kind === 218 /* ReturnStatement */ + || kind === 220 /* SwitchStatement */ + || kind === 222 /* ThrowStatement */ + || kind === 223 /* TryStatement */ + || kind === 207 /* VariableStatement */ + || kind === 212 /* WhileStatement */ + || kind === 219 /* WithStatement */ + || kind === 294 /* NotEmittedStatement */ + || kind === 297 /* EndOfDeclarationMarker */ + || kind === 296 /* MergeDeclarationMarker */; } function isDeclaration(node) { return isDeclarationKind(node.kind); @@ -10204,93 +10392,104 @@ var ts; var kind = node.kind; return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) - || kind === 204 /* Block */; + || kind === 206 /* Block */; } ts.isStatement = isStatement; // Module references function isModuleReference(node) { var kind = node.kind; - return kind === 245 /* ExternalModuleReference */ - || kind === 141 /* QualifiedName */ + return kind === 247 /* ExternalModuleReference */ + || kind === 142 /* QualifiedName */ || kind === 70 /* Identifier */; } ts.isModuleReference = isModuleReference; // JSX function isJsxOpeningElement(node) { - return node.kind === 248 /* JsxOpeningElement */; + return node.kind === 250 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 249 /* JsxClosingElement */; + return node.kind === 251 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxTagNameExpression(node) { var kind = node.kind; return kind === 98 /* ThisKeyword */ || kind === 70 /* Identifier */ - || kind === 177 /* PropertyAccessExpression */; + || kind === 178 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; function isJsxChild(node) { var kind = node.kind; - return kind === 246 /* JsxElement */ - || kind === 252 /* JsxExpression */ - || kind === 247 /* JsxSelfClosingElement */ + return kind === 248 /* JsxElement */ + || kind === 255 /* JsxExpression */ + || kind === 249 /* JsxSelfClosingElement */ || kind === 10 /* JsxText */; } ts.isJsxChild = isJsxChild; + function isJsxAttributes(node) { + var kind = node.kind; + return kind === 253 /* JsxAttributes */; + } + ts.isJsxAttributes = isJsxAttributes; function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 250 /* JsxAttribute */ - || kind === 251 /* JsxSpreadAttribute */; + return kind === 252 /* JsxAttribute */ + || kind === 254 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; function isJsxSpreadAttribute(node) { - return node.kind === 251 /* JsxSpreadAttribute */; + return node.kind === 254 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxAttribute(node) { - return node.kind === 250 /* JsxAttribute */; + return node.kind === 252 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 9 /* StringLiteral */ - || kind === 252 /* JsxExpression */; + || kind === 255 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; + function isJsxOpeningLikeElement(node) { + var kind = node.kind; + return kind === 250 /* JsxOpeningElement */ + || kind === 249 /* JsxSelfClosingElement */; + } + ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 253 /* CaseClause */ - || kind === 254 /* DefaultClause */; + return kind === 256 /* CaseClause */ + || kind === 257 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; function isHeritageClause(node) { - return node.kind === 255 /* HeritageClause */; + return node.kind === 258 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 256 /* CatchClause */; + return node.kind === 259 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 257 /* PropertyAssignment */; + return node.kind === 260 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 258 /* ShorthandPropertyAssignment */; + return node.kind === 261 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; // Enum function isEnumMember(node) { - return node.kind === 260 /* EnumMember */; + return node.kind === 263 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Top-level nodes function isSourceFile(node) { - return node.kind === 261 /* SourceFile */; + return node.kind === 264 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isWatchSet(options) { @@ -10303,12 +10502,13 @@ var ts; function getDefaultLibFileName(options) { switch (options.target) { case 5 /* ESNext */: + return "lib.esnext.full.d.ts"; case 4 /* ES2017 */: - return "lib.es2017.d.ts"; + return "lib.es2017.full.d.ts"; case 3 /* ES2016 */: - return "lib.es2016.d.ts"; + return "lib.es2016.full.d.ts"; case 2 /* ES2015 */: - return "lib.es6.d.ts"; + return "lib.es6.d.ts"; // We don't use lib.es2015.full.d.ts due to breaking change. default: return "lib.d.ts"; } @@ -10516,13 +10716,13 @@ var ts; oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); } - return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), /*newLength:*/ newEndN - oldStartN); + return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), /*newLength*/ newEndN - oldStartN); } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 143 /* TypeParameter */) { + if (d && d.kind === 144 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 227 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 229 /* InterfaceDeclaration */) { return current; } } @@ -10530,11 +10730,11 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node) { - return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 150 /* Constructor */ && ts.isClassLike(node.parent.parent); + return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 151 /* Constructor */ && ts.isClassLike(node.parent.parent); } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 174 /* BindingElement */ || ts.isBindingPattern(node))) { + while (node && (node.kind === 175 /* BindingElement */ || ts.isBindingPattern(node))) { node = node.parent; } return node; @@ -10542,14 +10742,14 @@ var ts; function getCombinedModifierFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = ts.getModifierFlags(node); - if (node.kind === 223 /* VariableDeclaration */) { + if (node.kind === 225 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 224 /* VariableDeclarationList */) { + if (node && node.kind === 226 /* VariableDeclarationList */) { flags |= ts.getModifierFlags(node); node = node.parent; } - if (node && node.kind === 205 /* VariableStatement */) { + if (node && node.kind === 207 /* VariableStatement */) { flags |= ts.getModifierFlags(node); } return flags; @@ -10565,23 +10765,23 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 223 /* VariableDeclaration */) { + if (node.kind === 225 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 224 /* VariableDeclarationList */) { + if (node && node.kind === 226 /* VariableDeclarationList */) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 205 /* VariableStatement */) { + if (node && node.kind === 207 /* VariableStatement */) { flags |= node.flags; } return flags; } ts.getCombinedNodeFlags = getCombinedNodeFlags; /** - * Checks to see if the locale is in the appropriate format, - * and if it is, attempts to set the appropriate language. - */ + * Checks to see if the locale is in the appropriate format, + * and if it is, attempts to set the appropriate language. + */ function validateLocaleAndSetLanguage(locale, sys, errors) { var matchResult = /^([a-z]+)([_\-]([a-z]+))?$/.exec(locale.toLowerCase()); if (!matchResult) { @@ -10632,27 +10832,60 @@ var ts; } } ts.validateLocaleAndSetLanguage = validateLocaleAndSetLanguage; + function getOriginalNode(node, nodeTest) { + if (node) { + while (node.original !== undefined) { + node = node.original; + } + } + return !nodeTest || nodeTest(node) ? node : undefined; + } + ts.getOriginalNode = getOriginalNode; + /** + * Gets a value indicating whether a node originated in the parse tree. + * + * @param node The node to test. + */ + function isParseTreeNode(node) { + return (node.flags & 8 /* Synthesized */) === 0; + } + ts.isParseTreeNode = isParseTreeNode; + function getParseTreeNode(node, nodeTest) { + if (node === undefined || isParseTreeNode(node)) { + return node; + } + node = getOriginalNode(node); + if (isParseTreeNode(node) && (!nodeTest || nodeTest(node))) { + return node; + } + return undefined; + } + ts.getParseTreeNode = getParseTreeNode; + /** + * Remove extra underscore from escaped identifier text content. + * + * @param identifier The escaped identifier text. + * @returns The unescaped identifier text. + */ + function unescapeIdentifier(identifier) { + return identifier.length >= 3 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ && identifier.charCodeAt(2) === 95 /* _ */ ? identifier.substr(1) : identifier; + } + ts.unescapeIdentifier = unescapeIdentifier; })(ts || (ts = {})); /// /// -/* @internal */ var ts; (function (ts) { - var NodeConstructor; - var SourceFileConstructor; - function createNode(kind, location, flags) { - var ConstructorForKind = kind === 261 /* SourceFile */ - ? (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor())) - : (NodeConstructor || (NodeConstructor = ts.objectAllocator.getNodeConstructor())); - var node = location - ? new ConstructorForKind(kind, location.pos, location.end) - : new ConstructorForKind(kind, /*pos*/ -1, /*end*/ -1); - node.flags = flags | 8 /* Synthesized */; + function createSynthesizedNode(kind) { + var node = ts.createNode(kind, -1, -1); + node.flags |= 8 /* Synthesized */; return node; } + /* @internal */ function updateNode(updated, original) { if (updated !== original) { setOriginalNode(updated, original); + setTextRange(updated, original); if (original.startsOnNewLine) { updated.startsOnNewLine = true; } @@ -10661,7 +10894,10 @@ var ts; return updated; } ts.updateNode = updateNode; - function createNodeArray(elements, location, hasTrailingComma) { + /** + * Make `elements` into a `NodeArray`. If `elements` is `undefined`, returns an empty `NodeArray`. + */ + function createNodeArray(elements, hasTrailingComma) { if (elements) { if (ts.isNodeArray(elements)) { return elements; @@ -10671,38 +10907,22 @@ var ts; elements = []; } var array = elements; - if (location) { - array.pos = location.pos; - array.end = location.end; - } - else { - array.pos = -1; - array.end = -1; - } - if (hasTrailingComma) { - array.hasTrailingComma = true; - } + array.pos = -1; + array.end = -1; + array.hasTrailingComma = hasTrailingComma; return array; } ts.createNodeArray = createNodeArray; - function createSynthesizedNode(kind, startsOnNewLine) { - var node = createNode(kind, /*location*/ undefined); - node.startsOnNewLine = startsOnNewLine; - return node; - } - ts.createSynthesizedNode = createSynthesizedNode; - function createSynthesizedNodeArray(elements) { - return createNodeArray(elements, /*location*/ undefined); - } - ts.createSynthesizedNodeArray = createSynthesizedNodeArray; /** * Creates a shallow, memberwise clone of a node with no source map location. */ + /* @internal */ function getSynthesizedClone(node) { // We don't use "clone" from core.ts here, as we need to preserve the prototype chain of // the original node. We also need to exclude specific properties and only include own- // properties (to skip members already defined on the shared prototype). - var clone = createNode(node.kind, /*location*/ undefined, node.flags); + var clone = createSynthesizedNode(node.kind); + clone.flags |= node.flags; setOriginalNode(clone, node); for (var key in node) { if (clone.hasOwnProperty(key) || !node.hasOwnProperty(key)) { @@ -10713,54 +10933,50 @@ var ts; return clone; } ts.getSynthesizedClone = getSynthesizedClone; - /** - * Creates a shallow, memberwise clone of a node for mutation. - */ - function getMutableClone(node) { - var clone = getSynthesizedClone(node); - clone.pos = node.pos; - clone.end = node.end; - clone.parent = node.parent; - return clone; - } - ts.getMutableClone = getMutableClone; - function createLiteral(value, location) { + function createLiteral(value) { if (typeof value === "number") { - var node = createNode(8 /* NumericLiteral */, location, /*flags*/ undefined); - node.text = value.toString(); - return node; + return createNumericLiteral(value + ""); } - else if (typeof value === "boolean") { - return createNode(value ? 100 /* TrueKeyword */ : 85 /* FalseKeyword */, location, /*flags*/ undefined); + if (typeof value === "boolean") { + return value ? createTrue() : createFalse(); } - else if (typeof value === "string") { - var node = createNode(9 /* StringLiteral */, location, /*flags*/ undefined); - node.text = value; - return node; - } - else if (value) { - var node = createNode(9 /* StringLiteral */, location, /*flags*/ undefined); - node.textSourceNode = value; - node.text = value.text; - return node; + if (typeof value === "string") { + return createStringLiteral(value); } + return createLiteralFromNode(value); } ts.createLiteral = createLiteral; + function createNumericLiteral(value) { + var node = createSynthesizedNode(8 /* NumericLiteral */); + node.text = value; + node.numericLiteralFlags = 0; + return node; + } + ts.createNumericLiteral = createNumericLiteral; + function createStringLiteral(text) { + var node = createSynthesizedNode(9 /* StringLiteral */); + node.text = text; + return node; + } + function createLiteralFromNode(sourceNode) { + var node = createStringLiteral(sourceNode.text); + node.textSourceNode = sourceNode; + return node; + } // Identifiers - var nextAutoGenerateId = 0; - function createIdentifier(text, location) { - var node = createNode(70 /* Identifier */, location); + function createIdentifier(text) { + var node = createSynthesizedNode(70 /* Identifier */); node.text = ts.escapeIdentifier(text); - node.originalKeywordKind = ts.stringToToken(text); + node.originalKeywordKind = text ? ts.stringToToken(text) : 0 /* Unknown */; node.autoGenerateKind = 0 /* None */; node.autoGenerateId = 0; return node; } ts.createIdentifier = createIdentifier; - function createTempVariable(recordTempVariable, location) { - var name = createNode(70 /* Identifier */, location); - name.text = ""; - name.originalKeywordKind = 0 /* Unknown */; + var nextAutoGenerateId = 0; + /** Create a unique temporary variable. */ + function createTempVariable(recordTempVariable) { + var name = createIdentifier(""); name.autoGenerateKind = 1 /* Auto */; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; @@ -10770,98 +10986,399 @@ var ts; return name; } ts.createTempVariable = createTempVariable; - function createLoopVariable(location) { - var name = createNode(70 /* Identifier */, location); - name.text = ""; - name.originalKeywordKind = 0 /* Unknown */; + /** Create a unique temporary variable for use in a loop. */ + function createLoopVariable() { + var name = createIdentifier(""); name.autoGenerateKind = 2 /* Loop */; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; return name; } ts.createLoopVariable = createLoopVariable; - function createUniqueName(text, location) { - var name = createNode(70 /* Identifier */, location); - name.text = text; - name.originalKeywordKind = 0 /* Unknown */; + /** Create a unique name based on the supplied text. */ + function createUniqueName(text) { + var name = createIdentifier(text); name.autoGenerateKind = 3 /* Unique */; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; return name; } ts.createUniqueName = createUniqueName; - function getGeneratedNameForNode(node, location) { - var name = createNode(70 /* Identifier */, location); - name.original = node; - name.text = ""; - name.originalKeywordKind = 0 /* Unknown */; + /** Create a unique name generated for a node. */ + function getGeneratedNameForNode(node) { + var name = createIdentifier(""); name.autoGenerateKind = 4 /* Node */; name.autoGenerateId = nextAutoGenerateId; + name.original = node; nextAutoGenerateId++; return name; } ts.getGeneratedNameForNode = getGeneratedNameForNode; // Punctuation function createToken(token) { - return createNode(token); + return createSynthesizedNode(token); } ts.createToken = createToken; // Reserved words function createSuper() { - var node = createNode(96 /* SuperKeyword */); - return node; + return createSynthesizedNode(96 /* SuperKeyword */); } ts.createSuper = createSuper; - function createThis(location) { - var node = createNode(98 /* ThisKeyword */, location); - return node; + function createThis() { + return createSynthesizedNode(98 /* ThisKeyword */); } ts.createThis = createThis; function createNull() { - var node = createNode(94 /* NullKeyword */); - return node; + return createSynthesizedNode(94 /* NullKeyword */); } ts.createNull = createNull; + function createTrue() { + return createSynthesizedNode(100 /* TrueKeyword */); + } + ts.createTrue = createTrue; + function createFalse() { + return createSynthesizedNode(85 /* FalseKeyword */); + } + ts.createFalse = createFalse; // Names - function createComputedPropertyName(expression, location) { - var node = createNode(142 /* ComputedPropertyName */, location); + function createQualifiedName(left, right) { + var node = createSynthesizedNode(142 /* QualifiedName */); + node.left = left; + node.right = asName(right); + return node; + } + ts.createQualifiedName = createQualifiedName; + function updateQualifiedName(node, left, right) { + return node.left !== left + || node.right !== right + ? updateNode(createQualifiedName(left, right), node) + : node; + } + ts.updateQualifiedName = updateQualifiedName; + function createComputedPropertyName(expression) { + var node = createSynthesizedNode(143 /* ComputedPropertyName */); node.expression = expression; return node; } ts.createComputedPropertyName = createComputedPropertyName; function updateComputedPropertyName(node, expression) { - if (node.expression !== expression) { - return updateNode(createComputedPropertyName(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createComputedPropertyName(expression), node) + : node; } ts.updateComputedPropertyName = updateComputedPropertyName; + // Type Elements + function createSignatureDeclaration(kind, typeParameters, parameters, type) { + var signatureDeclaration = createSynthesizedNode(kind); + signatureDeclaration.typeParameters = asNodeArray(typeParameters); + signatureDeclaration.parameters = asNodeArray(parameters); + signatureDeclaration.type = type; + return signatureDeclaration; + } + ts.createSignatureDeclaration = createSignatureDeclaration; + function updateSignatureDeclaration(node, typeParameters, parameters, type) { + return node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + ? updateNode(createSignatureDeclaration(node.kind, typeParameters, parameters, type), node) + : node; + } + function createFunctionTypeNode(typeParameters, parameters, type) { + return createSignatureDeclaration(159 /* FunctionType */, typeParameters, parameters, type); + } + ts.createFunctionTypeNode = createFunctionTypeNode; + function updateFunctionTypeNode(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateFunctionTypeNode = updateFunctionTypeNode; + function createConstructorTypeNode(typeParameters, parameters, type) { + return createSignatureDeclaration(160 /* ConstructorType */, typeParameters, parameters, type); + } + ts.createConstructorTypeNode = createConstructorTypeNode; + function updateConstructorTypeNode(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateConstructorTypeNode = updateConstructorTypeNode; + function createCallSignatureDeclaration(typeParameters, parameters, type) { + return createSignatureDeclaration(154 /* CallSignature */, typeParameters, parameters, type); + } + ts.createCallSignatureDeclaration = createCallSignatureDeclaration; + function updateCallSignatureDeclaration(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateCallSignatureDeclaration = updateCallSignatureDeclaration; + function createConstructSignatureDeclaration(typeParameters, parameters, type) { + return createSignatureDeclaration(155 /* ConstructSignature */, typeParameters, parameters, type); + } + ts.createConstructSignatureDeclaration = createConstructSignatureDeclaration; + function updateConstructSignatureDeclaration(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateConstructSignatureDeclaration = updateConstructSignatureDeclaration; + function createMethodSignature(typeParameters, parameters, type, name, questionToken) { + var methodSignature = createSignatureDeclaration(149 /* MethodSignature */, typeParameters, parameters, type); + methodSignature.name = asName(name); + methodSignature.questionToken = questionToken; + return methodSignature; + } + ts.createMethodSignature = createMethodSignature; + function updateMethodSignature(node, typeParameters, parameters, type, name, questionToken) { + return node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.name !== name + || node.questionToken !== questionToken + ? updateNode(createMethodSignature(typeParameters, parameters, type, name, questionToken), node) + : node; + } + ts.updateMethodSignature = updateMethodSignature; + // Types + function createKeywordTypeNode(kind) { + return createSynthesizedNode(kind); + } + ts.createKeywordTypeNode = createKeywordTypeNode; + function createThisTypeNode() { + return createSynthesizedNode(168 /* ThisType */); + } + ts.createThisTypeNode = createThisTypeNode; + function createLiteralTypeNode(literal) { + var literalTypeNode = createSynthesizedNode(172 /* LiteralType */); + literalTypeNode.literal = literal; + return literalTypeNode; + } + ts.createLiteralTypeNode = createLiteralTypeNode; + function updateLiteralTypeNode(node, literal) { + return node.literal !== literal + ? updateNode(createLiteralTypeNode(literal), node) + : node; + } + ts.updateLiteralTypeNode = updateLiteralTypeNode; + function createTypeReferenceNode(typeName, typeArguments) { + var typeReference = createSynthesizedNode(158 /* TypeReference */); + typeReference.typeName = asName(typeName); + typeReference.typeArguments = asNodeArray(typeArguments); + return typeReference; + } + ts.createTypeReferenceNode = createTypeReferenceNode; + function updateTypeReferenceNode(node, typeName, typeArguments) { + return node.typeName !== typeName + || node.typeArguments !== typeArguments + ? updateNode(createTypeReferenceNode(typeName, typeArguments), node) + : node; + } + ts.updateTypeReferenceNode = updateTypeReferenceNode; + function createTypePredicateNode(parameterName, type) { + var typePredicateNode = createSynthesizedNode(157 /* TypePredicate */); + typePredicateNode.parameterName = asName(parameterName); + typePredicateNode.type = type; + return typePredicateNode; + } + ts.createTypePredicateNode = createTypePredicateNode; + function updateTypePredicateNode(node, parameterName, type) { + return node.parameterName !== parameterName + || node.type !== type + ? updateNode(createTypePredicateNode(parameterName, type), node) + : node; + } + ts.updateTypePredicateNode = updateTypePredicateNode; + function createTypeQueryNode(exprName) { + var typeQueryNode = createSynthesizedNode(161 /* TypeQuery */); + typeQueryNode.exprName = exprName; + return typeQueryNode; + } + ts.createTypeQueryNode = createTypeQueryNode; + function updateTypeQueryNode(node, exprName) { + return node.exprName !== exprName ? updateNode(createTypeQueryNode(exprName), node) : node; + } + ts.updateTypeQueryNode = updateTypeQueryNode; + function createArrayTypeNode(elementType) { + var arrayTypeNode = createSynthesizedNode(163 /* ArrayType */); + arrayTypeNode.elementType = elementType; + return arrayTypeNode; + } + ts.createArrayTypeNode = createArrayTypeNode; + function updateArrayTypeNode(node, elementType) { + return node.elementType !== elementType + ? updateNode(createArrayTypeNode(elementType), node) + : node; + } + ts.updateArrayTypeNode = updateArrayTypeNode; + function createUnionOrIntersectionTypeNode(kind, types) { + var unionTypeNode = createSynthesizedNode(kind); + unionTypeNode.types = createNodeArray(types); + return unionTypeNode; + } + ts.createUnionOrIntersectionTypeNode = createUnionOrIntersectionTypeNode; + function updateUnionOrIntersectionTypeNode(node, types) { + return node.types !== types + ? updateNode(createUnionOrIntersectionTypeNode(node.kind, types), node) + : node; + } + ts.updateUnionOrIntersectionTypeNode = updateUnionOrIntersectionTypeNode; + function createTypeLiteralNode(members) { + var typeLiteralNode = createSynthesizedNode(162 /* TypeLiteral */); + typeLiteralNode.members = createNodeArray(members); + return typeLiteralNode; + } + ts.createTypeLiteralNode = createTypeLiteralNode; + function updateTypeLiteralNode(node, members) { + return node.members !== members + ? updateNode(createTypeLiteralNode(members), node) + : node; + } + ts.updateTypeLiteralNode = updateTypeLiteralNode; + function createTupleTypeNode(elementTypes) { + var tupleTypeNode = createSynthesizedNode(164 /* TupleType */); + tupleTypeNode.elementTypes = createNodeArray(elementTypes); + return tupleTypeNode; + } + ts.createTupleTypeNode = createTupleTypeNode; + function updateTypleTypeNode(node, elementTypes) { + return node.elementTypes !== elementTypes + ? updateNode(createTupleTypeNode(elementTypes), node) + : node; + } + ts.updateTypleTypeNode = updateTypleTypeNode; + function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { + var mappedTypeNode = createSynthesizedNode(171 /* MappedType */); + mappedTypeNode.readonlyToken = readonlyToken; + mappedTypeNode.typeParameter = typeParameter; + mappedTypeNode.questionToken = questionToken; + mappedTypeNode.type = type; + return mappedTypeNode; + } + ts.createMappedTypeNode = createMappedTypeNode; + function updateMappedTypeNode(node, readonlyToken, typeParameter, questionToken, type) { + return node.readonlyToken !== readonlyToken + || node.typeParameter !== typeParameter + || node.questionToken !== questionToken + || node.type !== type + ? updateNode(createMappedTypeNode(readonlyToken, typeParameter, questionToken, type), node) + : node; + } + ts.updateMappedTypeNode = updateMappedTypeNode; + function createTypeOperatorNode(type) { + var typeOperatorNode = createSynthesizedNode(169 /* TypeOperator */); + typeOperatorNode.operator = 126 /* KeyOfKeyword */; + typeOperatorNode.type = type; + return typeOperatorNode; + } + ts.createTypeOperatorNode = createTypeOperatorNode; + function updateTypeOperatorNode(node, type) { + return node.type !== type ? updateNode(createTypeOperatorNode(type), node) : node; + } + ts.updateTypeOperatorNode = updateTypeOperatorNode; + function createIndexedAccessTypeNode(objectType, indexType) { + var indexedAccessTypeNode = createSynthesizedNode(170 /* IndexedAccessType */); + indexedAccessTypeNode.objectType = objectType; + indexedAccessTypeNode.indexType = indexType; + return indexedAccessTypeNode; + } + ts.createIndexedAccessTypeNode = createIndexedAccessTypeNode; + function updateIndexedAccessTypeNode(node, objectType, indexType) { + return node.objectType !== objectType + || node.indexType !== indexType + ? updateNode(createIndexedAccessTypeNode(objectType, indexType), node) + : node; + } + ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; + // Type Declarations + function createTypeParameterDeclaration(name, constraint, defaultType) { + var typeParameter = createSynthesizedNode(144 /* TypeParameter */); + typeParameter.name = asName(name); + typeParameter.constraint = constraint; + typeParameter.default = defaultType; + return typeParameter; + } + ts.createTypeParameterDeclaration = createTypeParameterDeclaration; + function updateTypeParameterDeclaration(node, name, constraint, defaultType) { + return node.name !== name + || node.constraint !== constraint + || node.default !== defaultType + ? updateNode(createTypeParameterDeclaration(name, constraint, defaultType), node) + : node; + } + ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; // Signature elements - function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer, location, flags) { - var node = createNode(144 /* Parameter */, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createPropertySignature(name, questionToken, type, initializer) { + var propertySignature = createSynthesizedNode(147 /* PropertySignature */); + propertySignature.name = asName(name); + propertySignature.questionToken = questionToken; + propertySignature.type = type; + propertySignature.initializer = initializer; + return propertySignature; + } + ts.createPropertySignature = createPropertySignature; + function updatePropertySignature(node, name, questionToken, type, initializer) { + return node.name !== name + || node.questionToken !== questionToken + || node.type !== type + || node.initializer !== initializer + ? updateNode(createPropertySignature(name, questionToken, type, initializer), node) + : node; + } + ts.updatePropertySignature = updatePropertySignature; + function createIndexSignatureDeclaration(decorators, modifiers, parameters, type) { + var indexSignature = createSynthesizedNode(156 /* IndexSignature */); + indexSignature.decorators = asNodeArray(decorators); + indexSignature.modifiers = asNodeArray(modifiers); + indexSignature.parameters = createNodeArray(parameters); + indexSignature.type = type; + return indexSignature; + } + ts.createIndexSignatureDeclaration = createIndexSignatureDeclaration; + function updateIndexSignatureDeclaration(node, decorators, modifiers, parameters, type) { + return node.parameters !== parameters + || node.type !== type + || node.decorators !== decorators + || node.modifiers !== modifiers + ? updateNode(createIndexSignatureDeclaration(decorators, modifiers, parameters, type), node) + : node; + } + ts.updateIndexSignatureDeclaration = updateIndexSignatureDeclaration; + // Signature elements + function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { + var node = createSynthesizedNode(145 /* Parameter */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; + node.name = asName(name); node.questionToken = questionToken; node.type = type; - node.initializer = initializer ? parenthesizeExpressionForList(initializer) : undefined; + node.initializer = initializer ? ts.parenthesizeExpressionForList(initializer) : undefined; return node; } ts.createParameter = createParameter; - function updateParameter(node, decorators, modifiers, dotDotDotToken, name, type, initializer) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.type !== type || node.initializer !== initializer) { - return updateNode(createParameter(decorators, modifiers, dotDotDotToken, name, node.questionToken, type, initializer, /*location*/ node, /*flags*/ node.flags), node); - } - return node; + function updateParameter(node, decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.dotDotDotToken !== dotDotDotToken + || node.name !== name + || node.questionToken !== questionToken + || node.type !== type + || node.initializer !== initializer + ? updateNode(createParameter(decorators, modifiers, dotDotDotToken, name, node.questionToken, type, initializer), node) + : node; } ts.updateParameter = updateParameter; + function createDecorator(expression) { + var node = createSynthesizedNode(146 /* Decorator */); + node.expression = ts.parenthesizeForAccess(expression); + return node; + } + ts.createDecorator = createDecorator; + function updateDecorator(node, expression) { + return node.expression !== expression + ? updateNode(createDecorator(expression), node) + : node; + } + ts.updateDecorator = updateDecorator; // Type members - function createProperty(decorators, modifiers, name, questionToken, type, initializer, location) { - var node = createNode(147 /* PropertyDeclaration */, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createProperty(decorators, modifiers, name, questionToken, type, initializer) { + var node = createSynthesizedNode(148 /* PropertyDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); node.questionToken = questionToken; node.type = type; node.initializer = initializer; @@ -10869,36 +11386,46 @@ var ts; } ts.createProperty = createProperty; function updateProperty(node, decorators, modifiers, name, type, initializer) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.type !== type || node.initializer !== initializer) { - return updateNode(createProperty(decorators, modifiers, name, node.questionToken, type, initializer, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.type !== type + || node.initializer !== initializer + ? updateNode(createProperty(decorators, modifiers, name, node.questionToken, type, initializer), node) + : node; } ts.updateProperty = updateProperty; - function createMethod(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) { - var node = createNode(149 /* MethodDeclaration */, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createMethodDeclaration(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { + var node = createSynthesizedNode(150 /* MethodDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + node.name = asName(name); + node.questionToken = questionToken; + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.body = body; return node; } - ts.createMethod = createMethod; - function updateMethod(node, decorators, modifiers, name, typeParameters, parameters, type, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createMethod(decorators, modifiers, node.asteriskToken, name, typeParameters, parameters, type, body, /*location*/ node, node.flags), node); - } - return node; + ts.createMethodDeclaration = createMethodDeclaration; + function updateMethod(node, decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.asteriskToken !== asteriskToken + || node.name !== name + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createMethodDeclaration(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body), node) + : node; } ts.updateMethod = updateMethod; - function createConstructor(decorators, modifiers, parameters, body, location, flags) { - var node = createNode(150 /* Constructor */, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createConstructor(decorators, modifiers, parameters, body) { + var node = createSynthesizedNode(151 /* Constructor */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; node.parameters = createNodeArray(parameters); node.type = undefined; @@ -10907,17 +11434,19 @@ var ts; } ts.createConstructor = createConstructor; function updateConstructor(node, decorators, modifiers, parameters, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.parameters !== parameters || node.body !== body) { - return updateNode(createConstructor(decorators, modifiers, parameters, body, /*location*/ node, node.flags), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.parameters !== parameters + || node.body !== body + ? updateNode(createConstructor(decorators, modifiers, parameters, body), node) + : node; } ts.updateConstructor = updateConstructor; - function createGetAccessor(decorators, modifiers, name, parameters, type, body, location, flags) { - var node = createNode(151 /* GetAccessor */, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createGetAccessor(decorators, modifiers, name, parameters, type, body) { + var node = createSynthesizedNode(152 /* GetAccessor */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); node.typeParameters = undefined; node.parameters = createNodeArray(parameters); node.type = type; @@ -10926,17 +11455,21 @@ var ts; } ts.createGetAccessor = createGetAccessor; function updateGetAccessor(node, decorators, modifiers, name, parameters, type, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createGetAccessor(decorators, modifiers, name, parameters, type, body, /*location*/ node, node.flags), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createGetAccessor(decorators, modifiers, name, parameters, type, body), node) + : node; } ts.updateGetAccessor = updateGetAccessor; - function createSetAccessor(decorators, modifiers, name, parameters, body, location, flags) { - var node = createNode(152 /* SetAccessor */, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createSetAccessor(decorators, modifiers, name, parameters, body) { + var node = createSynthesizedNode(153 /* SetAccessor */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); node.typeParameters = undefined; node.parameters = createNodeArray(parameters); node.body = body; @@ -10944,59 +11477,62 @@ var ts; } ts.createSetAccessor = createSetAccessor; function updateSetAccessor(node, decorators, modifiers, name, parameters, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.parameters !== parameters || node.body !== body) { - return updateNode(createSetAccessor(decorators, modifiers, name, parameters, body, /*location*/ node, node.flags), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.parameters !== parameters + || node.body !== body + ? updateNode(createSetAccessor(decorators, modifiers, name, parameters, body), node) + : node; } ts.updateSetAccessor = updateSetAccessor; // Binding Patterns - function createObjectBindingPattern(elements, location) { - var node = createNode(172 /* ObjectBindingPattern */, location); + function createObjectBindingPattern(elements) { + var node = createSynthesizedNode(173 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); return node; } ts.createObjectBindingPattern = createObjectBindingPattern; function updateObjectBindingPattern(node, elements) { - if (node.elements !== elements) { - return updateNode(createObjectBindingPattern(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createObjectBindingPattern(elements), node) + : node; } ts.updateObjectBindingPattern = updateObjectBindingPattern; - function createArrayBindingPattern(elements, location) { - var node = createNode(173 /* ArrayBindingPattern */, location); + function createArrayBindingPattern(elements) { + var node = createSynthesizedNode(174 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); return node; } ts.createArrayBindingPattern = createArrayBindingPattern; function updateArrayBindingPattern(node, elements) { - if (node.elements !== elements) { - return updateNode(createArrayBindingPattern(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createArrayBindingPattern(elements), node) + : node; } ts.updateArrayBindingPattern = updateArrayBindingPattern; - function createBindingElement(propertyName, dotDotDotToken, name, initializer, location) { - var node = createNode(174 /* BindingElement */, location); - node.propertyName = typeof propertyName === "string" ? createIdentifier(propertyName) : propertyName; + function createBindingElement(dotDotDotToken, propertyName, name, initializer) { + var node = createSynthesizedNode(175 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; + node.propertyName = asName(propertyName); + node.name = asName(name); node.initializer = initializer; return node; } ts.createBindingElement = createBindingElement; function updateBindingElement(node, dotDotDotToken, propertyName, name, initializer) { - if (node.propertyName !== propertyName || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.initializer !== initializer) { - return updateNode(createBindingElement(propertyName, dotDotDotToken, name, initializer, node), node); - } - return node; + return node.propertyName !== propertyName + || node.dotDotDotToken !== dotDotDotToken + || node.name !== name + || node.initializer !== initializer + ? updateNode(createBindingElement(dotDotDotToken, propertyName, name, initializer), node) + : node; } ts.updateBindingElement = updateBindingElement; // Expression - function createArrayLiteral(elements, location, multiLine) { - var node = createNode(175 /* ArrayLiteralExpression */, location); - node.elements = parenthesizeListElements(createNodeArray(elements)); + function createArrayLiteral(elements, multiLine) { + var node = createSynthesizedNode(176 /* ArrayLiteralExpression */); + node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) { node.multiLine = true; } @@ -11004,14 +11540,13 @@ var ts; } ts.createArrayLiteral = createArrayLiteral; function updateArrayLiteral(node, elements) { - if (node.elements !== elements) { - return updateNode(createArrayLiteral(elements, node, node.multiLine), node); - } - return node; + return node.elements !== elements + ? updateNode(createArrayLiteral(elements, node.multiLine), node) + : node; } ts.updateArrayLiteral = updateArrayLiteral; - function createObjectLiteral(properties, location, multiLine) { - var node = createNode(176 /* ObjectLiteralExpression */, location); + function createObjectLiteral(properties, multiLine) { + var node = createSynthesizedNode(177 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); if (multiLine) { node.multiLine = true; @@ -11020,436 +11555,465 @@ var ts; } ts.createObjectLiteral = createObjectLiteral; function updateObjectLiteral(node, properties) { - if (node.properties !== properties) { - return updateNode(createObjectLiteral(properties, node, node.multiLine), node); - } - return node; + return node.properties !== properties + ? updateNode(createObjectLiteral(properties, node.multiLine), node) + : node; } ts.updateObjectLiteral = updateObjectLiteral; - function createPropertyAccess(expression, name, location, flags) { - var node = createNode(177 /* PropertyAccessExpression */, location, flags); - node.expression = parenthesizeForAccess(expression); - (node.emitNode || (node.emitNode = {})).flags |= 65536 /* NoIndentation */; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createPropertyAccess(expression, name) { + var node = createSynthesizedNode(178 /* PropertyAccessExpression */); + node.expression = ts.parenthesizeForAccess(expression); + node.name = asName(name); + setEmitFlags(node, 65536 /* NoIndentation */); return node; } ts.createPropertyAccess = createPropertyAccess; function updatePropertyAccess(node, expression, name) { - if (node.expression !== expression || node.name !== name) { - var propertyAccess = createPropertyAccess(expression, name, /*location*/ node, node.flags); - // Because we are updating existed propertyAccess we want to inherit its emitFlags instead of using default from createPropertyAccess - (propertyAccess.emitNode || (propertyAccess.emitNode = {})).flags = getEmitFlags(node); - return updateNode(propertyAccess, node); - } - return node; + // Because we are updating existed propertyAccess we want to inherit its emitFlags + // instead of using the default from createPropertyAccess + return node.expression !== expression + || node.name !== name + ? updateNode(setEmitFlags(createPropertyAccess(expression, name), getEmitFlags(node)), node) + : node; } ts.updatePropertyAccess = updatePropertyAccess; - function createElementAccess(expression, index, location) { - var node = createNode(178 /* ElementAccessExpression */, location); - node.expression = parenthesizeForAccess(expression); - node.argumentExpression = typeof index === "number" ? createLiteral(index) : index; + function createElementAccess(expression, index) { + var node = createSynthesizedNode(179 /* ElementAccessExpression */); + node.expression = ts.parenthesizeForAccess(expression); + node.argumentExpression = asExpression(index); return node; } ts.createElementAccess = createElementAccess; function updateElementAccess(node, expression, argumentExpression) { - if (node.expression !== expression || node.argumentExpression !== argumentExpression) { - return updateNode(createElementAccess(expression, argumentExpression, node), node); - } - return node; + return node.expression !== expression + || node.argumentExpression !== argumentExpression + ? updateNode(createElementAccess(expression, argumentExpression), node) + : node; } ts.updateElementAccess = updateElementAccess; - function createCall(expression, typeArguments, argumentsArray, location, flags) { - var node = createNode(179 /* CallExpression */, location, flags); - node.expression = parenthesizeForAccess(expression); - if (typeArguments) { - node.typeArguments = createNodeArray(typeArguments); - } - node.arguments = parenthesizeListElements(createNodeArray(argumentsArray)); + function createCall(expression, typeArguments, argumentsArray) { + var node = createSynthesizedNode(180 /* CallExpression */); + node.expression = ts.parenthesizeForAccess(expression); + node.typeArguments = asNodeArray(typeArguments); + node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); return node; } ts.createCall = createCall; function updateCall(node, expression, typeArguments, argumentsArray) { - if (expression !== node.expression || typeArguments !== node.typeArguments || argumentsArray !== node.arguments) { - return updateNode(createCall(expression, typeArguments, argumentsArray, /*location*/ node, node.flags), node); - } - return node; + return expression !== node.expression + || typeArguments !== node.typeArguments + || argumentsArray !== node.arguments + ? updateNode(createCall(expression, typeArguments, argumentsArray), node) + : node; } ts.updateCall = updateCall; - function createNew(expression, typeArguments, argumentsArray, location, flags) { - var node = createNode(180 /* NewExpression */, location, flags); - node.expression = parenthesizeForNew(expression); - node.typeArguments = typeArguments ? createNodeArray(typeArguments) : undefined; - node.arguments = argumentsArray ? parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; + function createNew(expression, typeArguments, argumentsArray) { + var node = createSynthesizedNode(181 /* NewExpression */); + node.expression = ts.parenthesizeForNew(expression); + node.typeArguments = asNodeArray(typeArguments); + node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; return node; } ts.createNew = createNew; function updateNew(node, expression, typeArguments, argumentsArray) { - if (node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray) { - return updateNode(createNew(expression, typeArguments, argumentsArray, /*location*/ node, node.flags), node); - } - return node; + return node.expression !== expression + || node.typeArguments !== typeArguments + || node.arguments !== argumentsArray + ? updateNode(createNew(expression, typeArguments, argumentsArray), node) + : node; } ts.updateNew = updateNew; - function createTaggedTemplate(tag, template, location) { - var node = createNode(181 /* TaggedTemplateExpression */, location); - node.tag = parenthesizeForAccess(tag); + function createTaggedTemplate(tag, template) { + var node = createSynthesizedNode(182 /* TaggedTemplateExpression */); + node.tag = ts.parenthesizeForAccess(tag); node.template = template; return node; } ts.createTaggedTemplate = createTaggedTemplate; function updateTaggedTemplate(node, tag, template) { - if (node.tag !== tag || node.template !== template) { - return updateNode(createTaggedTemplate(tag, template, node), node); - } - return node; + return node.tag !== tag + || node.template !== template + ? updateNode(createTaggedTemplate(tag, template), node) + : node; } ts.updateTaggedTemplate = updateTaggedTemplate; - function createParen(expression, location) { - var node = createNode(183 /* ParenthesizedExpression */, location); + function createTypeAssertion(type, expression) { + var node = createSynthesizedNode(183 /* TypeAssertionExpression */); + node.type = type; + node.expression = ts.parenthesizePrefixOperand(expression); + return node; + } + ts.createTypeAssertion = createTypeAssertion; + function updateTypeAssertion(node, type, expression) { + return node.type !== type + || node.expression !== expression + ? updateNode(createTypeAssertion(type, expression), node) + : node; + } + ts.updateTypeAssertion = updateTypeAssertion; + function createParen(expression) { + var node = createSynthesizedNode(184 /* ParenthesizedExpression */); node.expression = expression; return node; } ts.createParen = createParen; function updateParen(node, expression) { - if (node.expression !== expression) { - return updateNode(createParen(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createParen(expression), node) + : node; } ts.updateParen = updateParen; - function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) { - var node = createNode(184 /* FunctionExpression */, location, flags); - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + var node = createSynthesizedNode(185 /* FunctionExpression */); + node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.body = body; return node; } ts.createFunctionExpression = createFunctionExpression; - function updateFunctionExpression(node, modifiers, name, typeParameters, parameters, type, body) { - if (node.name !== name || node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createFunctionExpression(modifiers, node.asteriskToken, name, typeParameters, parameters, type, body, /*location*/ node, node.flags), node); - } - return node; + function updateFunctionExpression(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + return node.name !== name + || node.modifiers !== modifiers + || node.asteriskToken !== asteriskToken + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) + : node; } ts.updateFunctionExpression = updateFunctionExpression; - function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body, location, flags) { - var node = createNode(185 /* ArrowFunction */, location, flags); - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { + var node = createSynthesizedNode(186 /* ArrowFunction */); + node.modifiers = asNodeArray(modifiers); + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.equalsGreaterThanToken = equalsGreaterThanToken || createToken(35 /* EqualsGreaterThanToken */); - node.body = parenthesizeConciseBody(body); + node.body = ts.parenthesizeConciseBody(body); return node; } ts.createArrowFunction = createArrowFunction; function updateArrowFunction(node, modifiers, typeParameters, parameters, type, body) { - if (node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createArrowFunction(modifiers, typeParameters, parameters, type, node.equalsGreaterThanToken, body, /*location*/ node, node.flags), node); - } - return node; + return node.modifiers !== modifiers + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createArrowFunction(modifiers, typeParameters, parameters, type, node.equalsGreaterThanToken, body), node) + : node; } ts.updateArrowFunction = updateArrowFunction; - function createDelete(expression, location) { - var node = createNode(186 /* DeleteExpression */, location); - node.expression = parenthesizePrefixOperand(expression); + function createDelete(expression) { + var node = createSynthesizedNode(187 /* DeleteExpression */); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createDelete = createDelete; function updateDelete(node, expression) { - if (node.expression !== expression) { - return updateNode(createDelete(expression, node), expression); - } - return node; + return node.expression !== expression + ? updateNode(createDelete(expression), node) + : node; } ts.updateDelete = updateDelete; - function createTypeOf(expression, location) { - var node = createNode(187 /* TypeOfExpression */, location); - node.expression = parenthesizePrefixOperand(expression); + function createTypeOf(expression) { + var node = createSynthesizedNode(188 /* TypeOfExpression */); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createTypeOf = createTypeOf; function updateTypeOf(node, expression) { - if (node.expression !== expression) { - return updateNode(createTypeOf(expression, node), expression); - } - return node; + return node.expression !== expression + ? updateNode(createTypeOf(expression), node) + : node; } ts.updateTypeOf = updateTypeOf; - function createVoid(expression, location) { - var node = createNode(188 /* VoidExpression */, location); - node.expression = parenthesizePrefixOperand(expression); + function createVoid(expression) { + var node = createSynthesizedNode(189 /* VoidExpression */); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createVoid = createVoid; function updateVoid(node, expression) { - if (node.expression !== expression) { - return updateNode(createVoid(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createVoid(expression), node) + : node; } ts.updateVoid = updateVoid; - function createAwait(expression, location) { - var node = createNode(189 /* AwaitExpression */, location); - node.expression = parenthesizePrefixOperand(expression); + function createAwait(expression) { + var node = createSynthesizedNode(190 /* AwaitExpression */); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createAwait = createAwait; function updateAwait(node, expression) { - if (node.expression !== expression) { - return updateNode(createAwait(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createAwait(expression), node) + : node; } ts.updateAwait = updateAwait; - function createPrefix(operator, operand, location) { - var node = createNode(190 /* PrefixUnaryExpression */, location); + function createPrefix(operator, operand) { + var node = createSynthesizedNode(191 /* PrefixUnaryExpression */); node.operator = operator; - node.operand = parenthesizePrefixOperand(operand); + node.operand = ts.parenthesizePrefixOperand(operand); return node; } ts.createPrefix = createPrefix; function updatePrefix(node, operand) { - if (node.operand !== operand) { - return updateNode(createPrefix(node.operator, operand, node), node); - } - return node; + return node.operand !== operand + ? updateNode(createPrefix(node.operator, operand), node) + : node; } ts.updatePrefix = updatePrefix; - function createPostfix(operand, operator, location) { - var node = createNode(191 /* PostfixUnaryExpression */, location); - node.operand = parenthesizePostfixOperand(operand); + function createPostfix(operand, operator) { + var node = createSynthesizedNode(192 /* PostfixUnaryExpression */); + node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; } ts.createPostfix = createPostfix; function updatePostfix(node, operand) { - if (node.operand !== operand) { - return updateNode(createPostfix(operand, node.operator, node), node); - } - return node; + return node.operand !== operand + ? updateNode(createPostfix(operand, node.operator), node) + : node; } ts.updatePostfix = updatePostfix; - function createBinary(left, operator, right, location) { - var operatorToken = typeof operator === "number" ? createToken(operator) : operator; + function createBinary(left, operator, right) { + var node = createSynthesizedNode(193 /* BinaryExpression */); + var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; - var node = createNode(192 /* BinaryExpression */, location); - node.left = parenthesizeBinaryOperand(operatorKind, left, /*isLeftSideOfBinary*/ true, /*leftOperand*/ undefined); + node.left = ts.parenthesizeBinaryOperand(operatorKind, left, /*isLeftSideOfBinary*/ true, /*leftOperand*/ undefined); node.operatorToken = operatorToken; - node.right = parenthesizeBinaryOperand(operatorKind, right, /*isLeftSideOfBinary*/ false, node.left); + node.right = ts.parenthesizeBinaryOperand(operatorKind, right, /*isLeftSideOfBinary*/ false, node.left); return node; } ts.createBinary = createBinary; function updateBinary(node, left, right) { - if (node.left !== left || node.right !== right) { - return updateNode(createBinary(left, node.operatorToken, right, /*location*/ node), node); - } - return node; + return node.left !== left + || node.right !== right + ? updateNode(createBinary(left, node.operatorToken, right), node) + : node; } ts.updateBinary = updateBinary; - function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonTokenOrLocation, whenFalse, location) { - var node = createNode(193 /* ConditionalExpression */, whenFalse ? location : colonTokenOrLocation); - node.condition = parenthesizeForConditionalHead(condition); - if (whenFalse) { - // second overload - node.questionToken = questionTokenOrWhenTrue; - node.whenTrue = parenthesizeSubexpressionOfConditionalExpression(whenTrueOrWhenFalse); - node.colonToken = colonTokenOrLocation; - node.whenFalse = parenthesizeSubexpressionOfConditionalExpression(whenFalse); - } - else { - // first overload - node.questionToken = createToken(54 /* QuestionToken */); - node.whenTrue = parenthesizeSubexpressionOfConditionalExpression(questionTokenOrWhenTrue); - node.colonToken = createToken(55 /* ColonToken */); - node.whenFalse = parenthesizeSubexpressionOfConditionalExpression(whenTrueOrWhenFalse); - } + function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { + var node = createSynthesizedNode(194 /* ConditionalExpression */); + node.condition = ts.parenthesizeForConditionalHead(condition); + node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(54 /* QuestionToken */); + node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); + node.colonToken = whenFalse ? colonToken : createToken(55 /* ColonToken */); + node.whenFalse = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenFalse : whenTrueOrWhenFalse); return node; } ts.createConditional = createConditional; function updateConditional(node, condition, whenTrue, whenFalse) { - if (node.condition !== condition || node.whenTrue !== whenTrue || node.whenFalse !== whenFalse) { - return updateNode(createConditional(condition, node.questionToken, whenTrue, node.colonToken, whenFalse, node), node); - } - return node; + return node.condition !== condition + || node.whenTrue !== whenTrue + || node.whenFalse !== whenFalse + ? updateNode(createConditional(condition, node.questionToken, whenTrue, node.colonToken, whenFalse), node) + : node; } ts.updateConditional = updateConditional; - function createTemplateExpression(head, templateSpans, location) { - var node = createNode(194 /* TemplateExpression */, location); + function createTemplateExpression(head, templateSpans) { + var node = createSynthesizedNode(195 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; } ts.createTemplateExpression = createTemplateExpression; function updateTemplateExpression(node, head, templateSpans) { - if (node.head !== head || node.templateSpans !== templateSpans) { - return updateNode(createTemplateExpression(head, templateSpans, node), node); - } - return node; + return node.head !== head + || node.templateSpans !== templateSpans + ? updateNode(createTemplateExpression(head, templateSpans), node) + : node; } ts.updateTemplateExpression = updateTemplateExpression; - function createYield(asteriskToken, expression, location) { - var node = createNode(195 /* YieldExpression */, location); - node.asteriskToken = asteriskToken; - node.expression = expression; + function createYield(asteriskTokenOrExpression, expression) { + var node = createSynthesizedNode(196 /* YieldExpression */); + node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 38 /* AsteriskToken */ ? asteriskTokenOrExpression : undefined; + node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 38 /* AsteriskToken */ ? asteriskTokenOrExpression : expression; return node; } ts.createYield = createYield; - function updateYield(node, expression) { - if (node.expression !== expression) { - return updateNode(createYield(node.asteriskToken, expression, node), node); - } - return node; + function updateYield(node, asteriskToken, expression) { + return node.expression !== expression + || node.asteriskToken !== asteriskToken + ? updateNode(createYield(asteriskToken, expression), node) + : node; } ts.updateYield = updateYield; - function createSpread(expression, location) { - var node = createNode(196 /* SpreadElement */, location); - node.expression = parenthesizeExpressionForList(expression); + function createSpread(expression) { + var node = createSynthesizedNode(197 /* SpreadElement */); + node.expression = ts.parenthesizeExpressionForList(expression); return node; } ts.createSpread = createSpread; function updateSpread(node, expression) { - if (node.expression !== expression) { - return updateNode(createSpread(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createSpread(expression), node) + : node; } ts.updateSpread = updateSpread; - function createClassExpression(modifiers, name, typeParameters, heritageClauses, members, location) { - var node = createNode(197 /* ClassExpression */, location); + function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { + var node = createSynthesizedNode(198 /* ClassExpression */); node.decorators = undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; - node.heritageClauses = createNodeArray(heritageClauses); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); + node.heritageClauses = asNodeArray(heritageClauses); node.members = createNodeArray(members); return node; } ts.createClassExpression = createClassExpression; function updateClassExpression(node, modifiers, name, typeParameters, heritageClauses, members) { - if (node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members) { - return updateNode(createClassExpression(modifiers, name, typeParameters, heritageClauses, members, node), node); - } - return node; + return node.modifiers !== modifiers + || node.name !== name + || node.typeParameters !== typeParameters + || node.heritageClauses !== heritageClauses + || node.members !== members + ? updateNode(createClassExpression(modifiers, name, typeParameters, heritageClauses, members), node) + : node; } ts.updateClassExpression = updateClassExpression; - function createOmittedExpression(location) { - var node = createNode(198 /* OmittedExpression */, location); - return node; + function createOmittedExpression() { + return createSynthesizedNode(199 /* OmittedExpression */); } ts.createOmittedExpression = createOmittedExpression; - function createExpressionWithTypeArguments(typeArguments, expression, location) { - var node = createNode(199 /* ExpressionWithTypeArguments */, location); - node.typeArguments = typeArguments ? createNodeArray(typeArguments) : undefined; - node.expression = parenthesizeForAccess(expression); + function createExpressionWithTypeArguments(typeArguments, expression) { + var node = createSynthesizedNode(200 /* ExpressionWithTypeArguments */); + node.expression = ts.parenthesizeForAccess(expression); + node.typeArguments = asNodeArray(typeArguments); return node; } ts.createExpressionWithTypeArguments = createExpressionWithTypeArguments; function updateExpressionWithTypeArguments(node, typeArguments, expression) { - if (node.typeArguments !== typeArguments || node.expression !== expression) { - return updateNode(createExpressionWithTypeArguments(typeArguments, expression, node), node); - } - return node; + return node.typeArguments !== typeArguments + || node.expression !== expression + ? updateNode(createExpressionWithTypeArguments(typeArguments, expression), node) + : node; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; + function createAsExpression(expression, type) { + var node = createSynthesizedNode(201 /* AsExpression */); + node.expression = expression; + node.type = type; + return node; + } + ts.createAsExpression = createAsExpression; + function updateAsExpression(node, expression, type) { + return node.expression !== expression + || node.type !== type + ? updateNode(createAsExpression(expression, type), node) + : node; + } + ts.updateAsExpression = updateAsExpression; + function createNonNullExpression(expression) { + var node = createSynthesizedNode(202 /* NonNullExpression */); + node.expression = ts.parenthesizeForAccess(expression); + return node; + } + ts.createNonNullExpression = createNonNullExpression; + function updateNonNullExpression(node, expression) { + return node.expression !== expression + ? updateNode(createNonNullExpression(expression), node) + : node; + } + ts.updateNonNullExpression = updateNonNullExpression; // Misc - function createTemplateSpan(expression, literal, location) { - var node = createNode(202 /* TemplateSpan */, location); + function createTemplateSpan(expression, literal) { + var node = createSynthesizedNode(204 /* TemplateSpan */); node.expression = expression; node.literal = literal; return node; } ts.createTemplateSpan = createTemplateSpan; function updateTemplateSpan(node, expression, literal) { - if (node.expression !== expression || node.literal !== literal) { - return updateNode(createTemplateSpan(expression, literal, node), node); - } - return node; + return node.expression !== expression + || node.literal !== literal + ? updateNode(createTemplateSpan(expression, literal), node) + : node; } ts.updateTemplateSpan = updateTemplateSpan; // Element - function createBlock(statements, location, multiLine, flags) { - var block = createNode(204 /* Block */, location, flags); + function createBlock(statements, multiLine) { + var block = createSynthesizedNode(206 /* Block */); block.statements = createNodeArray(statements); - if (multiLine) { - block.multiLine = true; - } + if (multiLine) + block.multiLine = multiLine; return block; } ts.createBlock = createBlock; function updateBlock(node, statements) { - if (statements !== node.statements) { - return updateNode(createBlock(statements, /*location*/ node, node.multiLine, node.flags), node); - } - return node; + return statements !== node.statements + ? updateNode(createBlock(statements, node.multiLine), node) + : node; } ts.updateBlock = updateBlock; - function createVariableStatement(modifiers, declarationList, location, flags) { - var node = createNode(205 /* VariableStatement */, location, flags); + function createVariableStatement(modifiers, declarationList) { + var node = createSynthesizedNode(207 /* VariableStatement */); node.decorators = undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; return node; } ts.createVariableStatement = createVariableStatement; function updateVariableStatement(node, modifiers, declarationList) { - if (node.modifiers !== modifiers || node.declarationList !== declarationList) { - return updateNode(createVariableStatement(modifiers, declarationList, /*location*/ node, node.flags), node); - } - return node; + return node.modifiers !== modifiers + || node.declarationList !== declarationList + ? updateNode(createVariableStatement(modifiers, declarationList), node) + : node; } ts.updateVariableStatement = updateVariableStatement; - function createVariableDeclarationList(declarations, location, flags) { - var node = createNode(224 /* VariableDeclarationList */, location, flags); + function createVariableDeclarationList(declarations, flags) { + var node = createSynthesizedNode(226 /* VariableDeclarationList */); + node.flags |= flags; node.declarations = createNodeArray(declarations); return node; } ts.createVariableDeclarationList = createVariableDeclarationList; function updateVariableDeclarationList(node, declarations) { - if (node.declarations !== declarations) { - return updateNode(createVariableDeclarationList(declarations, /*location*/ node, node.flags), node); - } - return node; + return node.declarations !== declarations + ? updateNode(createVariableDeclarationList(declarations, node.flags), node) + : node; } ts.updateVariableDeclarationList = updateVariableDeclarationList; - function createVariableDeclaration(name, type, initializer, location, flags) { - var node = createNode(223 /* VariableDeclaration */, location, flags); - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createVariableDeclaration(name, type, initializer) { + var node = createSynthesizedNode(225 /* VariableDeclaration */); + node.name = asName(name); node.type = type; - node.initializer = initializer !== undefined ? parenthesizeExpressionForList(initializer) : undefined; + node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; return node; } ts.createVariableDeclaration = createVariableDeclaration; function updateVariableDeclaration(node, name, type, initializer) { - if (node.name !== name || node.type !== type || node.initializer !== initializer) { - return updateNode(createVariableDeclaration(name, type, initializer, /*location*/ node, node.flags), node); - } - return node; + return node.name !== name + || node.type !== type + || node.initializer !== initializer + ? updateNode(createVariableDeclaration(name, type, initializer), node) + : node; } ts.updateVariableDeclaration = updateVariableDeclaration; - function createEmptyStatement(location) { - return createNode(206 /* EmptyStatement */, location); + function createEmptyStatement() { + return createSynthesizedNode(208 /* EmptyStatement */); } ts.createEmptyStatement = createEmptyStatement; - function createStatement(expression, location, flags) { - var node = createNode(207 /* ExpressionStatement */, location, flags); - node.expression = parenthesizeExpressionForExpressionStatement(expression); + function createStatement(expression) { + var node = createSynthesizedNode(209 /* ExpressionStatement */); + node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } ts.createStatement = createStatement; function updateStatement(node, expression) { - if (node.expression !== expression) { - return updateNode(createStatement(expression, /*location*/ node, node.flags), node); - } - return node; + return node.expression !== expression + ? updateNode(createStatement(expression), node) + : node; } ts.updateStatement = updateStatement; - function createIf(expression, thenStatement, elseStatement, location) { - var node = createNode(208 /* IfStatement */, location); + function createIf(expression, thenStatement, elseStatement) { + var node = createSynthesizedNode(210 /* IfStatement */); node.expression = expression; node.thenStatement = thenStatement; node.elseStatement = elseStatement; @@ -11457,42 +12021,43 @@ var ts; } ts.createIf = createIf; function updateIf(node, expression, thenStatement, elseStatement) { - if (node.expression !== expression || node.thenStatement !== thenStatement || node.elseStatement !== elseStatement) { - return updateNode(createIf(expression, thenStatement, elseStatement, /*location*/ node), node); - } - return node; + return node.expression !== expression + || node.thenStatement !== thenStatement + || node.elseStatement !== elseStatement + ? updateNode(createIf(expression, thenStatement, elseStatement), node) + : node; } ts.updateIf = updateIf; - function createDo(statement, expression, location) { - var node = createNode(209 /* DoStatement */, location); + function createDo(statement, expression) { + var node = createSynthesizedNode(211 /* DoStatement */); node.statement = statement; node.expression = expression; return node; } ts.createDo = createDo; function updateDo(node, statement, expression) { - if (node.statement !== statement || node.expression !== expression) { - return updateNode(createDo(statement, expression, node), node); - } - return node; + return node.statement !== statement + || node.expression !== expression + ? updateNode(createDo(statement, expression), node) + : node; } ts.updateDo = updateDo; - function createWhile(expression, statement, location) { - var node = createNode(210 /* WhileStatement */, location); + function createWhile(expression, statement) { + var node = createSynthesizedNode(212 /* WhileStatement */); node.expression = expression; node.statement = statement; return node; } ts.createWhile = createWhile; function updateWhile(node, expression, statement) { - if (node.expression !== expression || node.statement !== statement) { - return updateNode(createWhile(expression, statement, node), node); - } - return node; + return node.expression !== expression + || node.statement !== statement + ? updateNode(createWhile(expression, statement), node) + : node; } ts.updateWhile = updateWhile; - function createFor(initializer, condition, incrementor, statement, location) { - var node = createNode(211 /* ForStatement */, location, /*flags*/ undefined); + function createFor(initializer, condition, incrementor, statement) { + var node = createSynthesizedNode(213 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -11501,14 +12066,16 @@ var ts; } ts.createFor = createFor; function updateFor(node, initializer, condition, incrementor, statement) { - if (node.initializer !== initializer || node.condition !== condition || node.incrementor !== incrementor || node.statement !== statement) { - return updateNode(createFor(initializer, condition, incrementor, statement, node), node); - } - return node; + return node.initializer !== initializer + || node.condition !== condition + || node.incrementor !== incrementor + || node.statement !== statement + ? updateNode(createFor(initializer, condition, incrementor, statement), node) + : node; } ts.updateFor = updateFor; - function createForIn(initializer, expression, statement, location) { - var node = createNode(212 /* ForInStatement */, location); + function createForIn(initializer, expression, statement) { + var node = createSynthesizedNode(214 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = statement; @@ -11516,127 +12083,123 @@ var ts; } ts.createForIn = createForIn; function updateForIn(node, initializer, expression, statement) { - if (node.initializer !== initializer || node.expression !== expression || node.statement !== statement) { - return updateNode(createForIn(initializer, expression, statement, node), node); - } - return node; + return node.initializer !== initializer + || node.expression !== expression + || node.statement !== statement + ? updateNode(createForIn(initializer, expression, statement), node) + : node; } ts.updateForIn = updateForIn; - function createForOf(initializer, expression, statement, location) { - var node = createNode(213 /* ForOfStatement */, location); + function createForOf(awaitModifier, initializer, expression, statement) { + var node = createSynthesizedNode(215 /* ForOfStatement */); + node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = expression; node.statement = statement; return node; } ts.createForOf = createForOf; - function updateForOf(node, initializer, expression, statement) { - if (node.initializer !== initializer || node.expression !== expression || node.statement !== statement) { - return updateNode(createForOf(initializer, expression, statement, node), node); - } - return node; + function updateForOf(node, awaitModifier, initializer, expression, statement) { + return node.awaitModifier !== awaitModifier + || node.initializer !== initializer + || node.expression !== expression + || node.statement !== statement + ? updateNode(createForOf(awaitModifier, initializer, expression, statement), node) + : node; } ts.updateForOf = updateForOf; - function createContinue(label, location) { - var node = createNode(214 /* ContinueStatement */, location); - if (label) { - node.label = label; - } + function createContinue(label) { + var node = createSynthesizedNode(216 /* ContinueStatement */); + node.label = asName(label); return node; } ts.createContinue = createContinue; function updateContinue(node, label) { - if (node.label !== label) { - return updateNode(createContinue(label, node), node); - } - return node; + return node.label !== label + ? updateNode(createContinue(label), node) + : node; } ts.updateContinue = updateContinue; - function createBreak(label, location) { - var node = createNode(215 /* BreakStatement */, location); - if (label) { - node.label = label; - } + function createBreak(label) { + var node = createSynthesizedNode(217 /* BreakStatement */); + node.label = asName(label); return node; } ts.createBreak = createBreak; function updateBreak(node, label) { - if (node.label !== label) { - return updateNode(createBreak(label, node), node); - } - return node; + return node.label !== label + ? updateNode(createBreak(label), node) + : node; } ts.updateBreak = updateBreak; - function createReturn(expression, location) { - var node = createNode(216 /* ReturnStatement */, location); + function createReturn(expression) { + var node = createSynthesizedNode(218 /* ReturnStatement */); node.expression = expression; return node; } ts.createReturn = createReturn; function updateReturn(node, expression) { - if (node.expression !== expression) { - return updateNode(createReturn(expression, /*location*/ node), node); - } - return node; + return node.expression !== expression + ? updateNode(createReturn(expression), node) + : node; } ts.updateReturn = updateReturn; - function createWith(expression, statement, location) { - var node = createNode(217 /* WithStatement */, location); + function createWith(expression, statement) { + var node = createSynthesizedNode(219 /* WithStatement */); node.expression = expression; node.statement = statement; return node; } ts.createWith = createWith; function updateWith(node, expression, statement) { - if (node.expression !== expression || node.statement !== statement) { - return updateNode(createWith(expression, statement, node), node); - } - return node; + return node.expression !== expression + || node.statement !== statement + ? updateNode(createWith(expression, statement), node) + : node; } ts.updateWith = updateWith; - function createSwitch(expression, caseBlock, location) { - var node = createNode(218 /* SwitchStatement */, location); - node.expression = parenthesizeExpressionForList(expression); + function createSwitch(expression, caseBlock) { + var node = createSynthesizedNode(220 /* SwitchStatement */); + node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; } ts.createSwitch = createSwitch; function updateSwitch(node, expression, caseBlock) { - if (node.expression !== expression || node.caseBlock !== caseBlock) { - return updateNode(createSwitch(expression, caseBlock, node), node); - } - return node; + return node.expression !== expression + || node.caseBlock !== caseBlock + ? updateNode(createSwitch(expression, caseBlock), node) + : node; } ts.updateSwitch = updateSwitch; - function createLabel(label, statement, location) { - var node = createNode(219 /* LabeledStatement */, location); - node.label = typeof label === "string" ? createIdentifier(label) : label; + function createLabel(label, statement) { + var node = createSynthesizedNode(221 /* LabeledStatement */); + node.label = asName(label); node.statement = statement; return node; } ts.createLabel = createLabel; function updateLabel(node, label, statement) { - if (node.label !== label || node.statement !== statement) { - return updateNode(createLabel(label, statement, node), node); - } - return node; + return node.label !== label + || node.statement !== statement + ? updateNode(createLabel(label, statement), node) + : node; } ts.updateLabel = updateLabel; - function createThrow(expression, location) { - var node = createNode(220 /* ThrowStatement */, location); + function createThrow(expression) { + var node = createSynthesizedNode(222 /* ThrowStatement */); node.expression = expression; return node; } ts.createThrow = createThrow; function updateThrow(node, expression) { - if (node.expression !== expression) { - return updateNode(createThrow(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createThrow(expression), node) + : node; } ts.updateThrow = updateThrow; - function createTry(tryBlock, catchClause, finallyBlock, location) { - var node = createNode(221 /* TryStatement */, location); + function createTry(tryBlock, catchClause, finallyBlock) { + var node = createSynthesizedNode(223 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -11644,195 +12207,286 @@ var ts; } ts.createTry = createTry; function updateTry(node, tryBlock, catchClause, finallyBlock) { - if (node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock) { - return updateNode(createTry(tryBlock, catchClause, finallyBlock, node), node); - } - return node; + return node.tryBlock !== tryBlock + || node.catchClause !== catchClause + || node.finallyBlock !== finallyBlock + ? updateNode(createTry(tryBlock, catchClause, finallyBlock), node) + : node; } ts.updateTry = updateTry; - function createCaseBlock(clauses, location) { - var node = createNode(232 /* CaseBlock */, location); - node.clauses = createNodeArray(clauses); - return node; - } - ts.createCaseBlock = createCaseBlock; - function updateCaseBlock(node, clauses) { - if (node.clauses !== clauses) { - return updateNode(createCaseBlock(clauses, node), node); - } - return node; - } - ts.updateCaseBlock = updateCaseBlock; - function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) { - var node = createNode(225 /* FunctionDeclaration */, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + var node = createSynthesizedNode(227 /* FunctionDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.body = body; return node; } ts.createFunctionDeclaration = createFunctionDeclaration; - function updateFunctionDeclaration(node, decorators, modifiers, name, typeParameters, parameters, type, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createFunctionDeclaration(decorators, modifiers, node.asteriskToken, name, typeParameters, parameters, type, body, /*location*/ node, node.flags), node); - } - return node; + function updateFunctionDeclaration(node, decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.asteriskToken !== asteriskToken + || node.name !== name + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) + : node; } ts.updateFunctionDeclaration = updateFunctionDeclaration; - function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members, location) { - var node = createNode(226 /* ClassDeclaration */, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; - node.heritageClauses = createNodeArray(heritageClauses); + function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { + var node = createSynthesizedNode(228 /* ClassDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); + node.heritageClauses = asNodeArray(heritageClauses); node.members = createNodeArray(members); return node; } ts.createClassDeclaration = createClassDeclaration; function updateClassDeclaration(node, decorators, modifiers, name, typeParameters, heritageClauses, members) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members) { - return updateNode(createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.typeParameters !== typeParameters + || node.heritageClauses !== heritageClauses + || node.members !== members + ? updateNode(createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members), node) + : node; } ts.updateClassDeclaration = updateClassDeclaration; - function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier, location) { - var node = createNode(235 /* ImportDeclaration */, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createEnumDeclaration(decorators, modifiers, name, members) { + var node = createSynthesizedNode(231 /* EnumDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.members = createNodeArray(members); + return node; + } + ts.createEnumDeclaration = createEnumDeclaration; + function updateEnumDeclaration(node, decorators, modifiers, name, members) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.members !== members + ? updateNode(createEnumDeclaration(decorators, modifiers, name, members), node) + : node; + } + ts.updateEnumDeclaration = updateEnumDeclaration; + function createModuleDeclaration(decorators, modifiers, name, body, flags) { + var node = createSynthesizedNode(232 /* ModuleDeclaration */); + node.flags |= flags; + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = name; + node.body = body; + return node; + } + ts.createModuleDeclaration = createModuleDeclaration; + function updateModuleDeclaration(node, decorators, modifiers, name, body) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.body !== body + ? updateNode(createModuleDeclaration(decorators, modifiers, name, body, node.flags), node) + : node; + } + ts.updateModuleDeclaration = updateModuleDeclaration; + function createModuleBlock(statements) { + var node = createSynthesizedNode(233 /* ModuleBlock */); + node.statements = createNodeArray(statements); + return node; + } + ts.createModuleBlock = createModuleBlock; + function updateModuleBlock(node, statements) { + return node.statements !== statements + ? updateNode(createModuleBlock(statements), node) + : node; + } + ts.updateModuleBlock = updateModuleBlock; + function createCaseBlock(clauses) { + var node = createSynthesizedNode(234 /* CaseBlock */); + node.clauses = createNodeArray(clauses); + return node; + } + ts.createCaseBlock = createCaseBlock; + function updateCaseBlock(node, clauses) { + return node.clauses !== clauses + ? updateNode(createCaseBlock(clauses), node) + : node; + } + ts.updateCaseBlock = updateCaseBlock; + function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { + var node = createSynthesizedNode(236 /* ImportEqualsDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.moduleReference = moduleReference; + return node; + } + ts.createImportEqualsDeclaration = createImportEqualsDeclaration; + function updateImportEqualsDeclaration(node, decorators, modifiers, name, moduleReference) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.moduleReference !== moduleReference + ? updateNode(createImportEqualsDeclaration(decorators, modifiers, name, moduleReference), node) + : node; + } + ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; + function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { + var node = createSynthesizedNode(237 /* ImportDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.importClause = importClause; node.moduleSpecifier = moduleSpecifier; return node; } ts.createImportDeclaration = createImportDeclaration; function updateImportDeclaration(node, decorators, modifiers, importClause, moduleSpecifier) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier) { - return updateNode(createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier + ? updateNode(createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier), node) + : node; } ts.updateImportDeclaration = updateImportDeclaration; - function createImportClause(name, namedBindings, location) { - var node = createNode(236 /* ImportClause */, location); + function createImportClause(name, namedBindings) { + var node = createSynthesizedNode(238 /* ImportClause */); node.name = name; node.namedBindings = namedBindings; return node; } ts.createImportClause = createImportClause; function updateImportClause(node, name, namedBindings) { - if (node.name !== name || node.namedBindings !== namedBindings) { - return updateNode(createImportClause(name, namedBindings, node), node); - } - return node; + return node.name !== name + || node.namedBindings !== namedBindings + ? updateNode(createImportClause(name, namedBindings), node) + : node; } ts.updateImportClause = updateImportClause; - function createNamespaceImport(name, location) { - var node = createNode(237 /* NamespaceImport */, location); + function createNamespaceImport(name) { + var node = createSynthesizedNode(239 /* NamespaceImport */); node.name = name; return node; } ts.createNamespaceImport = createNamespaceImport; function updateNamespaceImport(node, name) { - if (node.name !== name) { - return updateNode(createNamespaceImport(name, node), node); - } - return node; + return node.name !== name + ? updateNode(createNamespaceImport(name), node) + : node; } ts.updateNamespaceImport = updateNamespaceImport; - function createNamedImports(elements, location) { - var node = createNode(238 /* NamedImports */, location); + function createNamedImports(elements) { + var node = createSynthesizedNode(240 /* NamedImports */); node.elements = createNodeArray(elements); return node; } ts.createNamedImports = createNamedImports; function updateNamedImports(node, elements) { - if (node.elements !== elements) { - return updateNode(createNamedImports(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createNamedImports(elements), node) + : node; } ts.updateNamedImports = updateNamedImports; - function createImportSpecifier(propertyName, name, location) { - var node = createNode(239 /* ImportSpecifier */, location); + function createImportSpecifier(propertyName, name) { + var node = createSynthesizedNode(241 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; return node; } ts.createImportSpecifier = createImportSpecifier; function updateImportSpecifier(node, propertyName, name) { - if (node.propertyName !== propertyName || node.name !== name) { - return updateNode(createImportSpecifier(propertyName, name, node), node); - } - return node; + return node.propertyName !== propertyName + || node.name !== name + ? updateNode(createImportSpecifier(propertyName, name), node) + : node; } ts.updateImportSpecifier = updateImportSpecifier; - function createExportAssignment(decorators, modifiers, isExportEquals, expression, location) { - var node = createNode(240 /* ExportAssignment */, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createExportAssignment(decorators, modifiers, isExportEquals, expression) { + var node = createSynthesizedNode(242 /* ExportAssignment */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; node.expression = expression; return node; } ts.createExportAssignment = createExportAssignment; function updateExportAssignment(node, decorators, modifiers, expression) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.expression !== expression) { - return updateNode(createExportAssignment(decorators, modifiers, node.isExportEquals, expression, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.expression !== expression + ? updateNode(createExportAssignment(decorators, modifiers, node.isExportEquals, expression), node) + : node; } ts.updateExportAssignment = updateExportAssignment; - function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, location) { - var node = createNode(241 /* ExportDeclaration */, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier) { + var node = createSynthesizedNode(243 /* ExportDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.exportClause = exportClause; node.moduleSpecifier = moduleSpecifier; return node; } ts.createExportDeclaration = createExportDeclaration; function updateExportDeclaration(node, decorators, modifiers, exportClause, moduleSpecifier) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier) { - return updateNode(createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.exportClause !== exportClause + || node.moduleSpecifier !== moduleSpecifier + ? updateNode(createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier), node) + : node; } ts.updateExportDeclaration = updateExportDeclaration; - function createNamedExports(elements, location) { - var node = createNode(242 /* NamedExports */, location); + function createNamedExports(elements) { + var node = createSynthesizedNode(244 /* NamedExports */); node.elements = createNodeArray(elements); return node; } ts.createNamedExports = createNamedExports; function updateNamedExports(node, elements) { - if (node.elements !== elements) { - return updateNode(createNamedExports(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createNamedExports(elements), node) + : node; } ts.updateNamedExports = updateNamedExports; - function createExportSpecifier(name, propertyName, location) { - var node = createNode(243 /* ExportSpecifier */, location); - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.propertyName = typeof propertyName === "string" ? createIdentifier(propertyName) : propertyName; + function createExportSpecifier(propertyName, name) { + var node = createSynthesizedNode(245 /* ExportSpecifier */); + node.propertyName = asName(propertyName); + node.name = asName(name); return node; } ts.createExportSpecifier = createExportSpecifier; - function updateExportSpecifier(node, name, propertyName) { - if (node.name !== name || node.propertyName !== propertyName) { - return updateNode(createExportSpecifier(name, propertyName, node), node); - } - return node; + function updateExportSpecifier(node, propertyName, name) { + return node.propertyName !== propertyName + || node.name !== name + ? updateNode(createExportSpecifier(propertyName, name), node) + : node; } ts.updateExportSpecifier = updateExportSpecifier; + // Module references + function createExternalModuleReference(expression) { + var node = createSynthesizedNode(247 /* ExternalModuleReference */); + node.expression = expression; + return node; + } + ts.createExternalModuleReference = createExternalModuleReference; + function updateExternalModuleReference(node, expression) { + return node.expression !== expression + ? updateNode(createExternalModuleReference(expression), node) + : node; + } + ts.updateExternalModuleReference = updateExternalModuleReference; // JSX - function createJsxElement(openingElement, children, closingElement, location) { - var node = createNode(246 /* JsxElement */, location); + function createJsxElement(openingElement, children, closingElement) { + var node = createSynthesizedNode(248 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -11840,96 +12494,108 @@ var ts; } ts.createJsxElement = createJsxElement; function updateJsxElement(node, openingElement, children, closingElement) { - if (node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement) { - return updateNode(createJsxElement(openingElement, children, closingElement, node), node); - } - return node; + return node.openingElement !== openingElement + || node.children !== children + || node.closingElement !== closingElement + ? updateNode(createJsxElement(openingElement, children, closingElement), node) + : node; } ts.updateJsxElement = updateJsxElement; - function createJsxSelfClosingElement(tagName, attributes, location) { - var node = createNode(247 /* JsxSelfClosingElement */, location); + function createJsxSelfClosingElement(tagName, attributes) { + var node = createSynthesizedNode(249 /* JsxSelfClosingElement */); node.tagName = tagName; - node.attributes = createNodeArray(attributes); + node.attributes = attributes; return node; } ts.createJsxSelfClosingElement = createJsxSelfClosingElement; function updateJsxSelfClosingElement(node, tagName, attributes) { - if (node.tagName !== tagName || node.attributes !== attributes) { - return updateNode(createJsxSelfClosingElement(tagName, attributes, node), node); - } - return node; + return node.tagName !== tagName + || node.attributes !== attributes + ? updateNode(createJsxSelfClosingElement(tagName, attributes), node) + : node; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; - function createJsxOpeningElement(tagName, attributes, location) { - var node = createNode(248 /* JsxOpeningElement */, location); + function createJsxOpeningElement(tagName, attributes) { + var node = createSynthesizedNode(250 /* JsxOpeningElement */); node.tagName = tagName; - node.attributes = createNodeArray(attributes); + node.attributes = attributes; return node; } ts.createJsxOpeningElement = createJsxOpeningElement; function updateJsxOpeningElement(node, tagName, attributes) { - if (node.tagName !== tagName || node.attributes !== attributes) { - return updateNode(createJsxOpeningElement(tagName, attributes, node), node); - } - return node; + return node.tagName !== tagName + || node.attributes !== attributes + ? updateNode(createJsxOpeningElement(tagName, attributes), node) + : node; } ts.updateJsxOpeningElement = updateJsxOpeningElement; - function createJsxClosingElement(tagName, location) { - var node = createNode(249 /* JsxClosingElement */, location); + function createJsxClosingElement(tagName) { + var node = createSynthesizedNode(251 /* JsxClosingElement */); node.tagName = tagName; return node; } ts.createJsxClosingElement = createJsxClosingElement; function updateJsxClosingElement(node, tagName) { - if (node.tagName !== tagName) { - return updateNode(createJsxClosingElement(tagName, node), node); - } - return node; + return node.tagName !== tagName + ? updateNode(createJsxClosingElement(tagName), node) + : node; } ts.updateJsxClosingElement = updateJsxClosingElement; - function createJsxAttribute(name, initializer, location) { - var node = createNode(250 /* JsxAttribute */, location); + function createJsxAttributes(properties) { + var jsxAttributes = createSynthesizedNode(253 /* JsxAttributes */); + jsxAttributes.properties = createNodeArray(properties); + return jsxAttributes; + } + ts.createJsxAttributes = createJsxAttributes; + function updateJsxAttributes(jsxAttributes, properties) { + if (jsxAttributes.properties !== properties) { + return updateNode(createJsxAttributes(properties), jsxAttributes); + } + return jsxAttributes; + } + ts.updateJsxAttributes = updateJsxAttributes; + function createJsxAttribute(name, initializer) { + var node = createSynthesizedNode(252 /* JsxAttribute */); node.name = name; node.initializer = initializer; return node; } ts.createJsxAttribute = createJsxAttribute; function updateJsxAttribute(node, name, initializer) { - if (node.name !== name || node.initializer !== initializer) { - return updateNode(createJsxAttribute(name, initializer, node), node); - } - return node; + return node.name !== name + || node.initializer !== initializer + ? updateNode(createJsxAttribute(name, initializer), node) + : node; } ts.updateJsxAttribute = updateJsxAttribute; - function createJsxSpreadAttribute(expression, location) { - var node = createNode(251 /* JsxSpreadAttribute */, location); + function createJsxSpreadAttribute(expression) { + var node = createSynthesizedNode(254 /* JsxSpreadAttribute */); node.expression = expression; return node; } ts.createJsxSpreadAttribute = createJsxSpreadAttribute; function updateJsxSpreadAttribute(node, expression) { - if (node.expression !== expression) { - return updateNode(createJsxSpreadAttribute(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createJsxSpreadAttribute(expression), node) + : node; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; - function createJsxExpression(expression, location) { - var node = createNode(252 /* JsxExpression */, location); + function createJsxExpression(dotDotDotToken, expression) { + var node = createSynthesizedNode(255 /* JsxExpression */); + node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; } ts.createJsxExpression = createJsxExpression; function updateJsxExpression(node, expression) { - if (node.expression !== expression) { - return updateNode(createJsxExpression(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createJsxExpression(node.dotDotDotToken, expression), node) + : node; } ts.updateJsxExpression = updateJsxExpression; // Clauses - function createHeritageClause(token, types, location) { - var node = createNode(255 /* HeritageClause */, location); + function createHeritageClause(token, types) { + var node = createSynthesizedNode(258 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); return node; @@ -11937,40 +12603,40 @@ var ts; ts.createHeritageClause = createHeritageClause; function updateHeritageClause(node, types) { if (node.types !== types) { - return updateNode(createHeritageClause(node.token, types, node), node); + return updateNode(createHeritageClause(node.token, types), node); } return node; } ts.updateHeritageClause = updateHeritageClause; - function createCaseClause(expression, statements, location) { - var node = createNode(253 /* CaseClause */, location); - node.expression = parenthesizeExpressionForList(expression); + function createCaseClause(expression, statements) { + var node = createSynthesizedNode(256 /* CaseClause */); + node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; } ts.createCaseClause = createCaseClause; function updateCaseClause(node, expression, statements) { if (node.expression !== expression || node.statements !== statements) { - return updateNode(createCaseClause(expression, statements, node), node); + return updateNode(createCaseClause(expression, statements), node); } return node; } ts.updateCaseClause = updateCaseClause; - function createDefaultClause(statements, location) { - var node = createNode(254 /* DefaultClause */, location); + function createDefaultClause(statements) { + var node = createSynthesizedNode(257 /* DefaultClause */); node.statements = createNodeArray(statements); return node; } ts.createDefaultClause = createDefaultClause; function updateDefaultClause(node, statements) { if (node.statements !== statements) { - return updateNode(createDefaultClause(statements, node), node); + return updateNode(createDefaultClause(statements), node); } return node; } ts.updateDefaultClause = updateDefaultClause; - function createCatchClause(variableDeclaration, block, location) { - var node = createNode(256 /* CatchClause */, location); + function createCatchClause(variableDeclaration, block) { + var node = createSynthesizedNode(259 /* CatchClause */); node.variableDeclaration = typeof variableDeclaration === "string" ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -11978,58 +12644,74 @@ var ts; ts.createCatchClause = createCatchClause; function updateCatchClause(node, variableDeclaration, block) { if (node.variableDeclaration !== variableDeclaration || node.block !== block) { - return updateNode(createCatchClause(variableDeclaration, block, node), node); + return updateNode(createCatchClause(variableDeclaration, block), node); } return node; } ts.updateCatchClause = updateCatchClause; // Property assignments - function createPropertyAssignment(name, initializer, location) { - var node = createNode(257 /* PropertyAssignment */, location); - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createPropertyAssignment(name, initializer) { + var node = createSynthesizedNode(260 /* PropertyAssignment */); + node.name = asName(name); node.questionToken = undefined; - node.initializer = initializer !== undefined ? parenthesizeExpressionForList(initializer) : undefined; + node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; return node; } ts.createPropertyAssignment = createPropertyAssignment; function updatePropertyAssignment(node, name, initializer) { if (node.name !== name || node.initializer !== initializer) { - return updateNode(createPropertyAssignment(name, initializer, node), node); + return updateNode(createPropertyAssignment(name, initializer), node); } return node; } ts.updatePropertyAssignment = updatePropertyAssignment; - function createShorthandPropertyAssignment(name, objectAssignmentInitializer, location) { - var node = createNode(258 /* ShorthandPropertyAssignment */, location); - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; + function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { + var node = createSynthesizedNode(261 /* ShorthandPropertyAssignment */); + node.name = asName(name); + node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; } ts.createShorthandPropertyAssignment = createShorthandPropertyAssignment; - function createSpreadAssignment(expression, location) { - var node = createNode(259 /* SpreadAssignment */, location); - node.expression = expression !== undefined ? parenthesizeExpressionForList(expression) : undefined; - return node; - } - ts.createSpreadAssignment = createSpreadAssignment; function updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer) { if (node.name !== name || node.objectAssignmentInitializer !== objectAssignmentInitializer) { - return updateNode(createShorthandPropertyAssignment(name, objectAssignmentInitializer, node), node); + return updateNode(createShorthandPropertyAssignment(name, objectAssignmentInitializer), node); } return node; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; + function createSpreadAssignment(expression) { + var node = createSynthesizedNode(262 /* SpreadAssignment */); + node.expression = expression !== undefined ? ts.parenthesizeExpressionForList(expression) : undefined; + return node; + } + ts.createSpreadAssignment = createSpreadAssignment; function updateSpreadAssignment(node, expression) { if (node.expression !== expression) { - return updateNode(createSpreadAssignment(expression, node), node); + return updateNode(createSpreadAssignment(expression), node); } return node; } ts.updateSpreadAssignment = updateSpreadAssignment; + // Enum + function createEnumMember(name, initializer) { + var node = createSynthesizedNode(263 /* EnumMember */); + node.name = asName(name); + node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); + return node; + } + ts.createEnumMember = createEnumMember; + function updateEnumMember(node, name, initializer) { + return node.name !== name + || node.initializer !== initializer + ? updateNode(createEnumMember(name, initializer), node) + : node; + } + ts.updateEnumMember = updateEnumMember; // Top-level nodes function updateSourceFileNode(node, statements) { if (node.statements !== statements) { - var updated = createNode(261 /* SourceFile */, /*location*/ node, node.flags); + var updated = createSynthesizedNode(264 /* SourceFile */); + updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; updated.fileName = node.fileName; @@ -12088,6 +12770,17 @@ var ts; return node; } ts.updateSourceFileNode = updateSourceFileNode; + /** + * Creates a shallow, memberwise clone of a node for mutation. + */ + function getMutableClone(node) { + var clone = getSynthesizedClone(node); + clone.pos = node.pos; + clone.end = node.end; + clone.parent = node.parent; + return clone; + } + ts.getMutableClone = getMutableClone; // Transformation nodes /** * Creates a synthetic statement to act as a placeholder for a not-emitted statement in @@ -12096,8 +12789,9 @@ var ts; * @param original The original statement. */ function createNotEmittedStatement(original) { - var node = createNode(293 /* NotEmittedStatement */, /*location*/ original); + var node = createSynthesizedNode(294 /* NotEmittedStatement */); node.original = original; + setTextRange(node, original); return node; } ts.createNotEmittedStatement = createNotEmittedStatement; @@ -12105,8 +12799,9 @@ var ts; * Creates a synthetic element to act as a placeholder for the end of an emitted declaration in * order to properly emit exports. */ + /* @internal */ function createEndOfDeclarationMarker(original) { - var node = createNode(296 /* EndOfDeclarationMarker */); + var node = createSynthesizedNode(297 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -12116,8 +12811,9 @@ var ts; * Creates a synthetic element to act as a placeholder for the beginning of a merged declaration in * order to properly emit exports. */ + /* @internal */ function createMergeDeclarationMarker(original) { - var node = createNode(295 /* MergeDeclarationMarker */); + var node = createSynthesizedNode(296 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -12131,44 +12827,45 @@ var ts; * @param original The original outer expression. * @param location The location for the expression. Defaults to the positions from "original" if provided. */ - function createPartiallyEmittedExpression(expression, original, location) { - var node = createNode(294 /* PartiallyEmittedExpression */, /*location*/ location || original); + function createPartiallyEmittedExpression(expression, original) { + var node = createSynthesizedNode(295 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; + setTextRange(node, original); return node; } ts.createPartiallyEmittedExpression = createPartiallyEmittedExpression; function updatePartiallyEmittedExpression(node, expression) { if (node.expression !== expression) { - return updateNode(createPartiallyEmittedExpression(expression, node.original, node), node); + return updateNode(createPartiallyEmittedExpression(expression, node.original), node); } return node; } ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; - /** - * Creates a node that emits a string of raw text in an expression position. Raw text is never - * transformed, should be ES3 compliant, and should have the same precedence as - * PrimaryExpression. - * - * @param text The raw text of the node. - */ - function createRawExpression(text) { - var node = createNode(297 /* RawExpression */); - node.text = text; + function createBundle(sourceFiles) { + var node = ts.createNode(265 /* Bundle */); + node.sourceFiles = sourceFiles; return node; } - ts.createRawExpression = createRawExpression; + ts.createBundle = createBundle; + function updateBundle(node, sourceFiles) { + if (node.sourceFiles !== sourceFiles) { + return createBundle(sourceFiles); + } + return node; + } + ts.updateBundle = updateBundle; // Compound nodes function createComma(left, right) { return createBinary(left, 25 /* CommaToken */, right); } ts.createComma = createComma; - function createLessThan(left, right, location) { - return createBinary(left, 26 /* LessThanToken */, right, location); + function createLessThan(left, right) { + return createBinary(left, 26 /* LessThanToken */, right); } ts.createLessThan = createLessThan; - function createAssignment(left, right, location) { - return createBinary(left, 57 /* EqualsToken */, right, location); + function createAssignment(left, right) { + return createBinary(left, 57 /* EqualsToken */, right); } ts.createAssignment = createAssignment; function createStrictEquality(left, right) { @@ -12187,8 +12884,8 @@ var ts; return createBinary(left, 37 /* MinusToken */, right); } ts.createSubtract = createSubtract; - function createPostfixIncrement(operand, location) { - return createPostfix(operand, 42 /* PlusPlusToken */, location); + function createPostfixIncrement(operand) { + return createPostfix(operand, 42 /* PlusPlusToken */); } ts.createPostfixIncrement = createPostfixIncrement; function createLogicalAnd(left, right) { @@ -12207,61 +12904,378 @@ var ts; return createVoid(createLiteral(0)); } ts.createVoidZero = createVoidZero; + function createExportDefault(expression) { + return createExportAssignment(/*decorators*/ undefined, /*modifiers*/ undefined, /*isExportEquals*/ false, expression); + } + ts.createExportDefault = createExportDefault; + function createExternalModuleExport(exportName) { + return createExportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, createNamedExports([createExportSpecifier(/*propertyName*/ undefined, exportName)])); + } + ts.createExternalModuleExport = createExternalModuleExport; + function asName(name) { + return typeof name === "string" ? createIdentifier(name) : name; + } + function asExpression(value) { + return typeof value === "string" || typeof value === "number" ? createLiteral(value) : value; + } + function asNodeArray(array) { + return array ? createNodeArray(array) : undefined; + } + function asToken(value) { + return typeof value === "number" ? createToken(value) : value; + } + /** + * Clears any EmitNode entries from parse-tree nodes. + * @param sourceFile A source file. + */ + function disposeEmitNodes(sourceFile) { + // During transformation we may need to annotate a parse tree node with transient + // transformation properties. As parse tree nodes live longer than transformation + // nodes, we need to make sure we reclaim any memory allocated for custom ranges + // from these nodes to ensure we do not hold onto entire subtrees just for position + // information. We also need to reset these nodes to a pre-transformation state + // for incremental parsing scenarios so that we do not impact later emit. + sourceFile = ts.getSourceFileOfNode(ts.getParseTreeNode(sourceFile)); + var emitNode = sourceFile && sourceFile.emitNode; + var annotatedNodes = emitNode && emitNode.annotatedNodes; + if (annotatedNodes) { + for (var _i = 0, annotatedNodes_1 = annotatedNodes; _i < annotatedNodes_1.length; _i++) { + var node = annotatedNodes_1[_i]; + node.emitNode = undefined; + } + } + } + ts.disposeEmitNodes = disposeEmitNodes; + /** + * Associates a node with the current transformation, initializing + * various transient transformation properties. + */ + /* @internal */ + function getOrCreateEmitNode(node) { + if (!node.emitNode) { + if (ts.isParseTreeNode(node)) { + // To avoid holding onto transformation artifacts, we keep track of any + // parse tree node we are annotating. This allows us to clean them up after + // all transformations have completed. + if (node.kind === 264 /* SourceFile */) { + return node.emitNode = { annotatedNodes: [node] }; + } + var sourceFile = ts.getSourceFileOfNode(node); + getOrCreateEmitNode(sourceFile).annotatedNodes.push(node); + } + node.emitNode = {}; + } + return node.emitNode; + } + ts.getOrCreateEmitNode = getOrCreateEmitNode; + function setTextRange(range, location) { + if (location) { + range.pos = location.pos; + range.end = location.end; + } + return range; + } + ts.setTextRange = setTextRange; + /** + * Gets flags that control emit behavior of a node. + */ + function getEmitFlags(node) { + var emitNode = node.emitNode; + return emitNode && emitNode.flags; + } + ts.getEmitFlags = getEmitFlags; + /** + * Sets flags that control emit behavior of a node. + */ + function setEmitFlags(node, emitFlags) { + getOrCreateEmitNode(node).flags = emitFlags; + return node; + } + ts.setEmitFlags = setEmitFlags; + /** + * Gets a custom text range to use when emitting source maps. + */ + function getSourceMapRange(node) { + var emitNode = node.emitNode; + return (emitNode && emitNode.sourceMapRange) || node; + } + ts.getSourceMapRange = getSourceMapRange; + /** + * Sets a custom text range to use when emitting source maps. + */ + function setSourceMapRange(node, range) { + getOrCreateEmitNode(node).sourceMapRange = range; + return node; + } + ts.setSourceMapRange = setSourceMapRange; + /** + * Gets the TextRange to use for source maps for a token of a node. + */ + function getTokenSourceMapRange(node, token) { + var emitNode = node.emitNode; + var tokenSourceMapRanges = emitNode && emitNode.tokenSourceMapRanges; + return tokenSourceMapRanges && tokenSourceMapRanges[token]; + } + ts.getTokenSourceMapRange = getTokenSourceMapRange; + /** + * Sets the TextRange to use for source maps for a token of a node. + */ + function setTokenSourceMapRange(node, token, range) { + var emitNode = getOrCreateEmitNode(node); + var tokenSourceMapRanges = emitNode.tokenSourceMapRanges || (emitNode.tokenSourceMapRanges = []); + tokenSourceMapRanges[token] = range; + return node; + } + ts.setTokenSourceMapRange = setTokenSourceMapRange; + /** + * Gets a custom text range to use when emitting comments. + */ + function getCommentRange(node) { + var emitNode = node.emitNode; + return (emitNode && emitNode.commentRange) || node; + } + ts.getCommentRange = getCommentRange; + /** + * Sets a custom text range to use when emitting comments. + */ + function setCommentRange(node, range) { + getOrCreateEmitNode(node).commentRange = range; + return node; + } + ts.setCommentRange = setCommentRange; + function getSyntheticLeadingComments(node) { + var emitNode = node.emitNode; + return emitNode && emitNode.leadingComments; + } + ts.getSyntheticLeadingComments = getSyntheticLeadingComments; + function setSyntheticLeadingComments(node, comments) { + getOrCreateEmitNode(node).leadingComments = comments; + return node; + } + ts.setSyntheticLeadingComments = setSyntheticLeadingComments; + function addSyntheticLeadingComment(node, kind, text, hasTrailingNewLine) { + return setSyntheticLeadingComments(node, ts.append(getSyntheticLeadingComments(node), { kind: kind, pos: -1, end: -1, hasTrailingNewLine: hasTrailingNewLine, text: text })); + } + ts.addSyntheticLeadingComment = addSyntheticLeadingComment; + function getSyntheticTrailingComments(node) { + var emitNode = node.emitNode; + return emitNode && emitNode.trailingComments; + } + ts.getSyntheticTrailingComments = getSyntheticTrailingComments; + function setSyntheticTrailingComments(node, comments) { + getOrCreateEmitNode(node).trailingComments = comments; + return node; + } + ts.setSyntheticTrailingComments = setSyntheticTrailingComments; + function addSyntheticTrailingComment(node, kind, text, hasTrailingNewLine) { + return setSyntheticTrailingComments(node, ts.append(getSyntheticTrailingComments(node), { kind: kind, pos: -1, end: -1, hasTrailingNewLine: hasTrailingNewLine, text: text })); + } + ts.addSyntheticTrailingComment = addSyntheticTrailingComment; + /** + * Gets the constant value to emit for an expression. + */ + function getConstantValue(node) { + var emitNode = node.emitNode; + return emitNode && emitNode.constantValue; + } + ts.getConstantValue = getConstantValue; + /** + * Sets the constant value to emit for an expression. + */ + function setConstantValue(node, value) { + var emitNode = getOrCreateEmitNode(node); + emitNode.constantValue = value; + return node; + } + ts.setConstantValue = setConstantValue; + /** + * Adds an EmitHelper to a node. + */ + function addEmitHelper(node, helper) { + var emitNode = getOrCreateEmitNode(node); + emitNode.helpers = ts.append(emitNode.helpers, helper); + return node; + } + ts.addEmitHelper = addEmitHelper; + /** + * Add EmitHelpers to a node. + */ + function addEmitHelpers(node, helpers) { + if (ts.some(helpers)) { + var emitNode = getOrCreateEmitNode(node); + for (var _i = 0, helpers_1 = helpers; _i < helpers_1.length; _i++) { + var helper = helpers_1[_i]; + if (!ts.contains(emitNode.helpers, helper)) { + emitNode.helpers = ts.append(emitNode.helpers, helper); + } + } + } + return node; + } + ts.addEmitHelpers = addEmitHelpers; + /** + * Removes an EmitHelper from a node. + */ + function removeEmitHelper(node, helper) { + var emitNode = node.emitNode; + if (emitNode) { + var helpers = emitNode.helpers; + if (helpers) { + return ts.orderedRemoveItem(helpers, helper); + } + } + return false; + } + ts.removeEmitHelper = removeEmitHelper; + /** + * Gets the EmitHelpers of a node. + */ + function getEmitHelpers(node) { + var emitNode = node.emitNode; + return emitNode && emitNode.helpers; + } + ts.getEmitHelpers = getEmitHelpers; + /** + * Moves matching emit helpers from a source node to a target node. + */ + function moveEmitHelpers(source, target, predicate) { + var sourceEmitNode = source.emitNode; + var sourceEmitHelpers = sourceEmitNode && sourceEmitNode.helpers; + if (!ts.some(sourceEmitHelpers)) + return; + var targetEmitNode = getOrCreateEmitNode(target); + var helpersRemoved = 0; + for (var i = 0; i < sourceEmitHelpers.length; i++) { + var helper = sourceEmitHelpers[i]; + if (predicate(helper)) { + helpersRemoved++; + if (!ts.contains(targetEmitNode.helpers, helper)) { + targetEmitNode.helpers = ts.append(targetEmitNode.helpers, helper); + } + } + else if (helpersRemoved > 0) { + sourceEmitHelpers[i - helpersRemoved] = helper; + } + } + if (helpersRemoved > 0) { + sourceEmitHelpers.length -= helpersRemoved; + } + } + ts.moveEmitHelpers = moveEmitHelpers; + /* @internal */ + function compareEmitHelpers(x, y) { + if (x === y) + return 0 /* EqualTo */; + if (x.priority === y.priority) + return 0 /* EqualTo */; + if (x.priority === undefined) + return 1 /* GreaterThan */; + if (y.priority === undefined) + return -1 /* LessThan */; + return ts.compareValues(x.priority, y.priority); + } + ts.compareEmitHelpers = compareEmitHelpers; + function setOriginalNode(node, original) { + node.original = original; + if (original) { + var emitNode = original.emitNode; + if (emitNode) + node.emitNode = mergeEmitNode(emitNode, node.emitNode); + } + return node; + } + ts.setOriginalNode = setOriginalNode; + function mergeEmitNode(sourceEmitNode, destEmitNode) { + var flags = sourceEmitNode.flags, leadingComments = sourceEmitNode.leadingComments, trailingComments = sourceEmitNode.trailingComments, commentRange = sourceEmitNode.commentRange, sourceMapRange = sourceEmitNode.sourceMapRange, tokenSourceMapRanges = sourceEmitNode.tokenSourceMapRanges, constantValue = sourceEmitNode.constantValue, helpers = sourceEmitNode.helpers; + if (!destEmitNode) + destEmitNode = {}; + if (leadingComments) + destEmitNode.leadingComments = ts.addRange(leadingComments.slice(), destEmitNode.leadingComments); + if (trailingComments) + destEmitNode.trailingComments = ts.addRange(trailingComments.slice(), destEmitNode.trailingComments); + if (flags) + destEmitNode.flags = flags; + if (commentRange) + destEmitNode.commentRange = commentRange; + if (sourceMapRange) + destEmitNode.sourceMapRange = sourceMapRange; + if (tokenSourceMapRanges) + destEmitNode.tokenSourceMapRanges = mergeTokenSourceMapRanges(tokenSourceMapRanges, destEmitNode.tokenSourceMapRanges); + if (constantValue !== undefined) + destEmitNode.constantValue = constantValue; + if (helpers) + destEmitNode.helpers = ts.addRange(destEmitNode.helpers, helpers); + return destEmitNode; + } + function mergeTokenSourceMapRanges(sourceRanges, destRanges) { + if (!destRanges) + destRanges = []; + for (var key in sourceRanges) { + destRanges[key] = sourceRanges[key]; + } + return destRanges; + } +})(ts || (ts = {})); +/* @internal */ +(function (ts) { + // Compound nodes function createTypeCheck(value, tag) { return tag === "undefined" - ? createStrictEquality(value, createVoidZero()) - : createStrictEquality(createTypeOf(value), createLiteral(tag)); + ? ts.createStrictEquality(value, ts.createVoidZero()) + : ts.createStrictEquality(ts.createTypeOf(value), ts.createLiteral(tag)); } ts.createTypeCheck = createTypeCheck; function createMemberAccessForPropertyName(target, memberName, location) { if (ts.isComputedPropertyName(memberName)) { - return createElementAccess(target, memberName.expression, location); + return ts.setTextRange(ts.createElementAccess(target, memberName.expression), location); } else { - var expression = ts.isIdentifier(memberName) ? createPropertyAccess(target, memberName, location) : createElementAccess(target, memberName, location); - (expression.emitNode || (expression.emitNode = {})).flags |= 64 /* NoNestedSourceMaps */; + var expression = ts.setTextRange(ts.isIdentifier(memberName) + ? ts.createPropertyAccess(target, memberName) + : ts.createElementAccess(target, memberName), memberName); + ts.getOrCreateEmitNode(expression).flags |= 64 /* NoNestedSourceMaps */; return expression; } } ts.createMemberAccessForPropertyName = createMemberAccessForPropertyName; function createFunctionCall(func, thisArg, argumentsList, location) { - return createCall(createPropertyAccess(func, "call"), + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(func, "call"), /*typeArguments*/ undefined, [ thisArg - ].concat(argumentsList), location); + ].concat(argumentsList)), location); } ts.createFunctionCall = createFunctionCall; function createFunctionApply(func, thisArg, argumentsExpression, location) { - return createCall(createPropertyAccess(func, "apply"), + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(func, "apply"), /*typeArguments*/ undefined, [ thisArg, argumentsExpression - ], location); + ]), location); } ts.createFunctionApply = createFunctionApply; function createArraySlice(array, start) { var argumentsList = []; if (start !== undefined) { - argumentsList.push(typeof start === "number" ? createLiteral(start) : start); + argumentsList.push(typeof start === "number" ? ts.createLiteral(start) : start); } - return createCall(createPropertyAccess(array, "slice"), /*typeArguments*/ undefined, argumentsList); + return ts.createCall(ts.createPropertyAccess(array, "slice"), /*typeArguments*/ undefined, argumentsList); } ts.createArraySlice = createArraySlice; function createArrayConcat(array, values) { - return createCall(createPropertyAccess(array, "concat"), + return ts.createCall(ts.createPropertyAccess(array, "concat"), /*typeArguments*/ undefined, values); } ts.createArrayConcat = createArrayConcat; function createMathPow(left, right, location) { - return createCall(createPropertyAccess(createIdentifier("Math"), "pow"), - /*typeArguments*/ undefined, [left, right], location); + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Math"), "pow"), + /*typeArguments*/ undefined, [left, right]), location); } ts.createMathPow = createMathPow; function createReactNamespace(reactNamespace, parent) { // To ensure the emit resolver can properly resolve the namespace, we need to // treat this identifier as if it were a source tree node by clearing the `Synthesized` // flag and setting a parent node. - var react = createIdentifier(reactNamespace || "React"); + var react = ts.createIdentifier(reactNamespace || "React"); react.flags &= ~8 /* Synthesized */; // Set the parent that is in parse tree // this makes sure that parent chain is intact for checker to traverse complete scope tree @@ -12271,9 +13285,9 @@ var ts; function createJsxFactoryExpressionFromEntityName(jsxFactory, parent) { if (ts.isQualifiedName(jsxFactory)) { var left = createJsxFactoryExpressionFromEntityName(jsxFactory.left, parent); - var right = createSynthesizedNode(70 /* Identifier */); + var right = ts.createIdentifier(jsxFactory.right.text); right.text = jsxFactory.right.text; - return createPropertyAccess(left, right); + return ts.createPropertyAccess(left, right); } else { return createReactNamespace(jsxFactory.text, parent); @@ -12282,7 +13296,7 @@ var ts; function createJsxFactoryExpression(jsxFactoryEntity, reactNamespace, parent) { return jsxFactoryEntity ? createJsxFactoryExpressionFromEntityName(jsxFactoryEntity, parent) : - createPropertyAccess(createReactNamespace(reactNamespace, parent), "createElement"); + ts.createPropertyAccess(createReactNamespace(reactNamespace, parent), "createElement"); } function createExpressionForJsxElement(jsxFactoryEntity, reactNamespace, tagName, props, children, parentElement, location) { var argumentsList = [tagName]; @@ -12291,7 +13305,7 @@ var ts; } if (children && children.length > 0) { if (!props) { - argumentsList.push(createNull()); + argumentsList.push(ts.createNull()); } if (children.length > 1) { for (var _i = 0, children_1 = children; _i < children_1.length; _i++) { @@ -12304,35 +13318,89 @@ var ts; argumentsList.push(children[0]); } } - return createCall(createJsxFactoryExpression(jsxFactoryEntity, reactNamespace, parentElement), - /*typeArguments*/ undefined, argumentsList, location); + return ts.setTextRange(ts.createCall(createJsxFactoryExpression(jsxFactoryEntity, reactNamespace, parentElement), + /*typeArguments*/ undefined, argumentsList), location); } ts.createExpressionForJsxElement = createExpressionForJsxElement; - function createExportDefault(expression) { - return createExportAssignment(/*decorators*/ undefined, /*modifiers*/ undefined, /*isExportEquals*/ false, expression); - } - ts.createExportDefault = createExportDefault; - function createExternalModuleExport(exportName) { - return createExportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, createNamedExports([createExportSpecifier(exportName)])); - } - ts.createExternalModuleExport = createExternalModuleExport; - function createLetStatement(name, initializer, location) { - return createVariableStatement(/*modifiers*/ undefined, createLetDeclarationList([createVariableDeclaration(name, /*type*/ undefined, initializer)]), location); - } - ts.createLetStatement = createLetStatement; - function createLetDeclarationList(declarations, location) { - return createVariableDeclarationList(declarations, location, 1 /* Let */); - } - ts.createLetDeclarationList = createLetDeclarationList; - function createConstDeclarationList(declarations, location) { - return createVariableDeclarationList(declarations, location, 2 /* Const */); - } - ts.createConstDeclarationList = createConstDeclarationList; // Helpers function getHelperName(name) { - return setEmitFlags(createIdentifier(name), 4096 /* HelperName */ | 2 /* AdviseOnEmitNode */); + return ts.setEmitFlags(ts.createIdentifier(name), 4096 /* HelperName */ | 2 /* AdviseOnEmitNode */); } ts.getHelperName = getHelperName; + var valuesHelper = { + name: "typescript:values", + scoped: false, + text: "\n var __values = (this && this.__values) || function (o) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\n if (m) return m.call(o);\n return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n };\n " + }; + function createValuesHelper(context, expression, location) { + context.requestEmitHelper(valuesHelper); + return ts.setTextRange(ts.createCall(getHelperName("__values"), + /*typeArguments*/ undefined, [expression]), location); + } + ts.createValuesHelper = createValuesHelper; + var readHelper = { + name: "typescript:read", + scoped: false, + text: "\n var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n };\n " + }; + function createReadHelper(context, iteratorRecord, count, location) { + context.requestEmitHelper(readHelper); + return ts.setTextRange(ts.createCall(getHelperName("__read"), + /*typeArguments*/ undefined, count !== undefined + ? [iteratorRecord, ts.createLiteral(count)] + : [iteratorRecord]), location); + } + ts.createReadHelper = createReadHelper; + var spreadHelper = { + name: "typescript:spread", + scoped: false, + text: "\n var __spread = (this && this.__spread) || function () {\n for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));\n return ar;\n };" + }; + function createSpreadHelper(context, argumentList, location) { + context.requestEmitHelper(readHelper); + context.requestEmitHelper(spreadHelper); + return ts.setTextRange(ts.createCall(getHelperName("__spread"), + /*typeArguments*/ undefined, argumentList), location); + } + ts.createSpreadHelper = createSpreadHelper; + // Utilities + function createForOfBindingStatement(node, boundValue) { + if (ts.isVariableDeclarationList(node)) { + var firstDeclaration = ts.firstOrUndefined(node.declarations); + var updatedDeclaration = ts.updateVariableDeclaration(firstDeclaration, firstDeclaration.name, + /*typeNode*/ undefined, boundValue); + return ts.setTextRange(ts.createVariableStatement( + /*modifiers*/ undefined, ts.updateVariableDeclarationList(node, [updatedDeclaration])), + /*location*/ node); + } + else { + var updatedExpression = ts.setTextRange(ts.createAssignment(node, boundValue), /*location*/ node); + return ts.setTextRange(ts.createStatement(updatedExpression), /*location*/ node); + } + } + ts.createForOfBindingStatement = createForOfBindingStatement; + function insertLeadingStatement(dest, source) { + if (ts.isBlock(dest)) { + return ts.updateBlock(dest, ts.setTextRange(ts.createNodeArray([source].concat(dest.statements)), dest.statements)); + } + else { + return ts.createBlock(ts.createNodeArray([dest, source]), /*multiLine*/ true); + } + } + ts.insertLeadingStatement = insertLeadingStatement; + function restoreEnclosingLabel(node, outermostLabeledStatement, afterRestoreLabelCallback) { + if (!outermostLabeledStatement) { + return node; + } + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 221 /* LabeledStatement */ + ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) + : node); + if (afterRestoreLabelCallback) { + afterRestoreLabelCallback(outermostLabeledStatement); + } + return updated; + } + ts.restoreEnclosingLabel = restoreEnclosingLabel; function shouldBeCapturedInTempVariable(node, cacheIdentifiers) { var target = skipParentheses(node); switch (target.kind) { @@ -12342,13 +13410,13 @@ var ts; case 8 /* NumericLiteral */: case 9 /* StringLiteral */: return false; - case 175 /* ArrayLiteralExpression */: + case 176 /* ArrayLiteralExpression */: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 176 /* ObjectLiteralExpression */: + case 177 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -12359,22 +13427,27 @@ var ts; var thisArg; var target; if (ts.isSuperProperty(callee)) { - thisArg = createThis(); + thisArg = ts.createThis(); target = callee; } else if (callee.kind === 96 /* SuperKeyword */) { - thisArg = createThis(); - target = languageVersion < 2 /* ES2015 */ ? createIdentifier("_super", /*location*/ callee) : callee; + thisArg = ts.createThis(); + target = languageVersion < 2 /* ES2015 */ + ? ts.setTextRange(ts.createIdentifier("_super"), callee) + : callee; + } + else if (ts.getEmitFlags(callee) & 4096 /* HelperName */) { + thisArg = ts.createVoidZero(); + target = parenthesizeForAccess(callee); } else { switch (callee.kind) { - case 177 /* PropertyAccessExpression */: { + case 178 /* PropertyAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a.b()` target is `(_a = a).b` and thisArg is `_a` - thisArg = createTempVariable(recordTempVariable); - target = createPropertyAccess(createAssignment(thisArg, callee.expression, - /*location*/ callee.expression), callee.name, - /*location*/ callee); + thisArg = ts.createTempVariable(recordTempVariable); + target = ts.createPropertyAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.name); + ts.setTextRange(target, callee); } else { thisArg = callee.expression; @@ -12382,13 +13455,12 @@ var ts; } break; } - case 178 /* ElementAccessExpression */: { + case 179 /* ElementAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a[b]()` target is `(_a = a)[b]` and thisArg is `_a` - thisArg = createTempVariable(recordTempVariable); - target = createElementAccess(createAssignment(thisArg, callee.expression, - /*location*/ callee.expression), callee.argumentExpression, - /*location*/ callee); + thisArg = ts.createTempVariable(recordTempVariable); + target = ts.createElementAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.argumentExpression); + ts.setTextRange(target, callee); } else { thisArg = callee.expression; @@ -12398,7 +13470,7 @@ var ts; } default: { // for `a()` target is `a` and thisArg is `void 0` - thisArg = createVoidZero(); + thisArg = ts.createVoidZero(); target = parenthesizeForAccess(expression); break; } @@ -12408,42 +13480,42 @@ var ts; } ts.createCallBinding = createCallBinding; function inlineExpressions(expressions) { - return ts.reduceLeft(expressions, createComma); + return ts.reduceLeft(expressions, ts.createComma); } ts.inlineExpressions = inlineExpressions; function createExpressionFromEntityName(node) { if (ts.isQualifiedName(node)) { var left = createExpressionFromEntityName(node.left); - var right = getMutableClone(node.right); - return createPropertyAccess(left, right, /*location*/ node); + var right = ts.getMutableClone(node.right); + return ts.setTextRange(ts.createPropertyAccess(left, right), node); } else { - return getMutableClone(node); + return ts.getMutableClone(node); } } ts.createExpressionFromEntityName = createExpressionFromEntityName; function createExpressionForPropertyName(memberName) { if (ts.isIdentifier(memberName)) { - return createLiteral(memberName, /*location*/ undefined); + return ts.createLiteral(memberName); } else if (ts.isComputedPropertyName(memberName)) { - return getMutableClone(memberName.expression); + return ts.getMutableClone(memberName.expression); } else { - return getMutableClone(memberName); + return ts.getMutableClone(memberName); } } ts.createExpressionForPropertyName = createExpressionForPropertyName; function createExpressionForObjectLiteralElementLike(node, property, receiver) { switch (property.kind) { - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine); - case 257 /* PropertyAssignment */: + case 260 /* PropertyAssignment */: return createExpressionForPropertyAssignment(property, receiver); - case 258 /* ShorthandPropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(property, receiver); - case 149 /* MethodDeclaration */: + case 150 /* MethodDeclaration */: return createExpressionForMethodDeclaration(property, receiver); } } @@ -12453,57 +13525,55 @@ var ts; if (property === firstAccessor) { var properties_1 = []; if (getAccessor) { - var getterFunction = createFunctionExpression(getAccessor.modifiers, + var getterFunction = ts.createFunctionExpression(getAccessor.modifiers, /*asteriskToken*/ undefined, /*name*/ undefined, /*typeParameters*/ undefined, getAccessor.parameters, - /*type*/ undefined, getAccessor.body, - /*location*/ getAccessor); - setOriginalNode(getterFunction, getAccessor); - var getter = createPropertyAssignment("get", getterFunction); + /*type*/ undefined, getAccessor.body); + ts.setTextRange(getterFunction, getAccessor); + ts.setOriginalNode(getterFunction, getAccessor); + var getter = ts.createPropertyAssignment("get", getterFunction); properties_1.push(getter); } if (setAccessor) { - var setterFunction = createFunctionExpression(setAccessor.modifiers, + var setterFunction = ts.createFunctionExpression(setAccessor.modifiers, /*asteriskToken*/ undefined, /*name*/ undefined, /*typeParameters*/ undefined, setAccessor.parameters, - /*type*/ undefined, setAccessor.body, - /*location*/ setAccessor); - setOriginalNode(setterFunction, setAccessor); - var setter = createPropertyAssignment("set", setterFunction); + /*type*/ undefined, setAccessor.body); + ts.setTextRange(setterFunction, setAccessor); + ts.setOriginalNode(setterFunction, setAccessor); + var setter = ts.createPropertyAssignment("set", setterFunction); properties_1.push(setter); } - properties_1.push(createPropertyAssignment("enumerable", createLiteral(true))); - properties_1.push(createPropertyAssignment("configurable", createLiteral(true))); - var expression = createCall(createPropertyAccess(createIdentifier("Object"), "defineProperty"), + properties_1.push(ts.createPropertyAssignment("enumerable", ts.createTrue())); + properties_1.push(ts.createPropertyAssignment("configurable", ts.createTrue())); + var expression = ts.setTextRange(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), /*typeArguments*/ undefined, [ receiver, createExpressionForPropertyName(property.name), - createObjectLiteral(properties_1, /*location*/ undefined, multiLine) - ], + ts.createObjectLiteral(properties_1, multiLine) + ]), /*location*/ firstAccessor); return ts.aggregateTransformFlags(expression); } return undefined; } function createExpressionForPropertyAssignment(property, receiver) { - return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, property.name, /*location*/ property.name), property.initializer, - /*location*/ property), - /*original*/ property)); + return ts.aggregateTransformFlags(ts.setOriginalNode(ts.setTextRange(ts.createAssignment(createMemberAccessForPropertyName(receiver, property.name, /*location*/ property.name), property.initializer), property), property)); } function createExpressionForShorthandPropertyAssignment(property, receiver) { - return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, property.name, /*location*/ property.name), getSynthesizedClone(property.name), + return ts.aggregateTransformFlags(ts.setOriginalNode(ts.setTextRange(ts.createAssignment(createMemberAccessForPropertyName(receiver, property.name, /*location*/ property.name), ts.getSynthesizedClone(property.name)), /*location*/ property), /*original*/ property)); } function createExpressionForMethodDeclaration(method, receiver) { - return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, method.name, /*location*/ method.name), setOriginalNode(createFunctionExpression(method.modifiers, method.asteriskToken, + return ts.aggregateTransformFlags(ts.setOriginalNode(ts.setTextRange(ts.createAssignment(createMemberAccessForPropertyName(receiver, method.name, /*location*/ method.name), ts.setOriginalNode(ts.setTextRange(ts.createFunctionExpression(method.modifiers, method.asteriskToken, /*name*/ undefined, /*typeParameters*/ undefined, method.parameters, - /*type*/ undefined, method.body, + /*type*/ undefined, method.body), /*location*/ method), - /*original*/ method), + /*original*/ method)), /*location*/ method), /*original*/ method)); } @@ -12525,7 +13595,7 @@ var ts; * Gets whether an identifier should only be referred to by its local name. */ function isLocalName(node) { - return (getEmitFlags(node) & 16384 /* LocalName */) !== 0; + return (ts.getEmitFlags(node) & 16384 /* LocalName */) !== 0; } ts.isLocalName = isLocalName; /** @@ -12547,7 +13617,7 @@ var ts; * name points to an exported symbol. */ function isExportName(node) { - return (getEmitFlags(node) & 8192 /* ExportName */) !== 0; + return (ts.getEmitFlags(node) & 8192 /* ExportName */) !== 0; } ts.isExportName = isExportName; /** @@ -12563,17 +13633,17 @@ var ts; ts.getDeclarationName = getDeclarationName; function getName(node, allowComments, allowSourceMaps, emitFlags) { if (node.name && ts.isIdentifier(node.name) && !ts.isGeneratedIdentifier(node.name)) { - var name_8 = getMutableClone(node.name); - emitFlags |= getEmitFlags(node.name); + var name = ts.getMutableClone(node.name); + emitFlags |= ts.getEmitFlags(node.name); if (!allowSourceMaps) emitFlags |= 48 /* NoSourceMap */; if (!allowComments) emitFlags |= 1536 /* NoComments */; if (emitFlags) - setEmitFlags(name_8, emitFlags); - return name_8; + ts.setEmitFlags(name, emitFlags); + return name; } - return getGeneratedNameForNode(node); + return ts.getGeneratedNameForNode(node); } /** * Gets the exported name of a declaration for use in expressions. @@ -12602,19 +13672,20 @@ var ts; * @param allowSourceMaps A value indicating whether source maps may be emitted for the name. */ function getNamespaceMemberName(ns, name, allowComments, allowSourceMaps) { - var qualifiedName = createPropertyAccess(ns, ts.nodeIsSynthesized(name) ? name : getSynthesizedClone(name), /*location*/ name); + var qualifiedName = ts.createPropertyAccess(ns, ts.nodeIsSynthesized(name) ? name : ts.getSynthesizedClone(name)); + ts.setTextRange(qualifiedName, name); var emitFlags; if (!allowSourceMaps) emitFlags |= 48 /* NoSourceMap */; if (!allowComments) emitFlags |= 1536 /* NoComments */; if (emitFlags) - setEmitFlags(qualifiedName, emitFlags); + ts.setEmitFlags(qualifiedName, emitFlags); return qualifiedName; } ts.getNamespaceMemberName = getNamespaceMemberName; function convertToFunctionBody(node, multiLine) { - return ts.isBlock(node) ? node : createBlock([createReturn(node, /*location*/ node)], /*location*/ node, multiLine); + return ts.isBlock(node) ? node : ts.setTextRange(ts.createBlock([ts.setTextRange(ts.createReturn(node), node)], multiLine), node); } ts.convertToFunctionBody = convertToFunctionBody; function isUseStrictPrologue(node) { @@ -12631,7 +13702,18 @@ var ts; * @param ensureUseStrict: boolean determining whether the function need to add prologue-directives * @param visitor: Optional callback used to visit any custom prologue directives. */ - function addPrologueDirectives(target, source, ensureUseStrict, visitor) { + function addPrologue(target, source, ensureUseStrict, visitor) { + var offset = addStandardPrologue(target, source, ensureUseStrict); + return addCustomPrologue(target, source, offset, visitor); + } + ts.addPrologue = addPrologue; + /** + * Add just the standard (string-expression) prologue-directives into target statement-array. + * The function needs to be called during each transformation step. + * This function needs to be called whenever we transform the statement + * list of a source file, namespace, or function-like body. + */ + function addStandardPrologue(target, source, ensureUseStrict) { ts.Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array"); var foundUseStrict = false; var statementOffset = 0; @@ -12650,11 +13732,22 @@ var ts; statementOffset++; } if (ensureUseStrict && !foundUseStrict) { - target.push(startOnNewLine(createStatement(createLiteral("use strict")))); + target.push(startOnNewLine(ts.createStatement(ts.createLiteral("use strict")))); } + return statementOffset; + } + ts.addStandardPrologue = addStandardPrologue; + /** + * Add just the custom prologue-directives into target statement-array. + * The function needs to be called during each transformation step. + * This function needs to be called whenever we transform the statement + * list of a source file, namespace, or function-like body. + */ + function addCustomPrologue(target, source, statementOffset, visitor) { + var numStatements = source.length; while (statementOffset < numStatements) { var statement = source[statementOffset]; - if (getEmitFlags(statement) & 524288 /* CustomPrologue */) { + if (ts.getEmitFlags(statement) & 524288 /* CustomPrologue */) { target.push(visitor ? ts.visitNode(statement, visitor, ts.isStatement) : statement); } else { @@ -12664,7 +13757,7 @@ var ts; } return statementOffset; } - ts.addPrologueDirectives = addPrologueDirectives; + ts.addCustomPrologue = addCustomPrologue; function startsWithUseStrict(statements) { var firstStatement = ts.firstOrUndefined(statements); return firstStatement !== undefined @@ -12692,13 +13785,23 @@ var ts; } } if (!foundUseStrict) { - return createNodeArray([ - startOnNewLine(createStatement(createLiteral("use strict"))) - ].concat(statements), statements); + return ts.setTextRange(ts.createNodeArray([ + startOnNewLine(ts.createStatement(ts.createLiteral("use strict"))) + ].concat(statements)), statements); } return statements; } ts.ensureUseStrict = ensureUseStrict; + function parenthesizeConditionalHead(condition) { + var conditionalPrecedence = ts.getOperatorPrecedence(194 /* ConditionalExpression */, 54 /* QuestionToken */); + var emittedCondition = skipPartiallyEmittedExpressions(condition); + var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); + if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1 /* LessThan */) { + return ts.createParen(condition); + } + return condition; + } + ts.parenthesizeConditionalHead = parenthesizeConditionalHead; /** * Wraps the operand to a BinaryExpression in parentheses if they are needed to preserve the intended * order of operations. @@ -12711,11 +13814,11 @@ var ts; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = skipPartiallyEmittedExpressions(operand); // If the resulting expression is already parenthesized, we do not need to do any further processing. - if (skipped.kind === 183 /* ParenthesizedExpression */) { + if (skipped.kind === 184 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) - ? createParen(operand) + ? ts.createParen(operand) : operand; } ts.parenthesizeBinaryOperand = parenthesizeBinaryOperand; @@ -12745,8 +13848,8 @@ var ts; // // If `a ** d` is on the left of operator `**`, we need to parenthesize to preserve // the intended order of operations: `(a ** b) ** c` - var binaryOperatorPrecedence = ts.getOperatorPrecedence(192 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(192 /* BinaryExpression */, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(193 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(193 /* BinaryExpression */, binaryOperator); var emittedOperand = skipPartiallyEmittedExpressions(operand); var operandPrecedence = ts.getExpressionPrecedence(emittedOperand); switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) { @@ -12755,7 +13858,7 @@ var ts; // and is a yield expression, then we do not need parentheses. if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 195 /* YieldExpression */) { + && operand.kind === 196 /* YieldExpression */) { return false; } return true; @@ -12843,7 +13946,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 192 /* BinaryExpression */ && node.operatorToken.kind === 36 /* PlusToken */) { + if (node.kind === 193 /* BinaryExpression */ && node.operatorToken.kind === 36 /* PlusToken */) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -12858,11 +13961,11 @@ var ts; return 0 /* Unknown */; } function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(193 /* ConditionalExpression */, 54 /* QuestionToken */); + var conditionalPrecedence = ts.getOperatorPrecedence(194 /* ConditionalExpression */, 54 /* QuestionToken */); var emittedCondition = skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1 /* LessThan */) { - return createParen(condition); + return ts.createParen(condition); } return condition; } @@ -12871,10 +13974,11 @@ var ts; // per ES grammar both 'whenTrue' and 'whenFalse' parts of conditional expression are assignment expressions // so in case when comma expression is introduced as a part of previous transformations // if should be wrapped in parens since comma operator has the lowest precedence - return e.kind === 192 /* BinaryExpression */ && e.operatorToken.kind === 25 /* CommaToken */ - ? createParen(e) + return e.kind === 193 /* BinaryExpression */ && e.operatorToken.kind === 25 /* CommaToken */ + ? ts.createParen(e) : e; } + ts.parenthesizeSubexpressionOfConditionalExpression = parenthesizeSubexpressionOfConditionalExpression; /** * Wraps an expression in parentheses if it is needed in order to use the expression * as the expression of a NewExpression node. @@ -12884,12 +13988,12 @@ var ts; function parenthesizeForNew(expression) { var emittedExpression = skipPartiallyEmittedExpressions(expression); switch (emittedExpression.kind) { - case 179 /* CallExpression */: - return createParen(expression); - case 180 /* NewExpression */: + case 180 /* CallExpression */: + return ts.createParen(expression); + case 181 /* NewExpression */: return emittedExpression.arguments ? expression - : createParen(expression); + : ts.createParen(expression); } return parenthesizeForAccess(expression); } @@ -12902,32 +14006,29 @@ var ts; */ function parenthesizeForAccess(expression) { // isLeftHandSideExpression is almost the correct criterion for when it is not necessary - // to parenthesize the expression before a dot. The known exceptions are: + // to parenthesize the expression before a dot. The known exception is: // // NewExpression: // new C.x -> not the same as (new C).x - // NumericLiteral - // 1.x -> not the same as (1).x // var emittedExpression = skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 180 /* NewExpression */ || emittedExpression.arguments) - && emittedExpression.kind !== 8 /* NumericLiteral */) { + && (emittedExpression.kind !== 181 /* NewExpression */ || emittedExpression.arguments)) { return expression; } - return createParen(expression, /*location*/ expression); + return ts.setTextRange(ts.createParen(expression), expression); } ts.parenthesizeForAccess = parenthesizeForAccess; function parenthesizePostfixOperand(operand) { return ts.isLeftHandSideExpression(operand) ? operand - : createParen(operand, /*location*/ operand); + : ts.setTextRange(ts.createParen(operand), operand); } ts.parenthesizePostfixOperand = parenthesizePostfixOperand; function parenthesizePrefixOperand(operand) { return ts.isUnaryExpression(operand) ? operand - : createParen(operand, /*location*/ operand); + : ts.setTextRange(ts.createParen(operand), operand); } ts.parenthesizePrefixOperand = parenthesizePrefixOperand; function parenthesizeListElements(elements) { @@ -12942,17 +14043,18 @@ var ts; } } if (result !== undefined) { - return createNodeArray(result, elements, elements.hasTrailingComma); + return ts.setTextRange(ts.createNodeArray(result, elements.hasTrailingComma), elements); } return elements; } + ts.parenthesizeListElements = parenthesizeListElements; function parenthesizeExpressionForList(expression) { var emittedExpression = skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(192 /* BinaryExpression */, 25 /* CommaToken */); + var commaPrecedence = ts.getOperatorPrecedence(193 /* BinaryExpression */, 25 /* CommaToken */); return expressionPrecedence > commaPrecedence ? expression - : createParen(expression, /*location*/ expression); + : ts.setTextRange(ts.createParen(expression), expression); } ts.parenthesizeExpressionForList = parenthesizeExpressionForList; function parenthesizeExpressionForExpressionStatement(expression) { @@ -12960,16 +14062,16 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = skipPartiallyEmittedExpressions(callee).kind; - if (kind === 184 /* FunctionExpression */ || kind === 185 /* ArrowFunction */) { - var mutableCall = getMutableClone(emittedExpression); - mutableCall.expression = createParen(callee, /*location*/ callee); + if (kind === 185 /* FunctionExpression */ || kind === 186 /* ArrowFunction */) { + var mutableCall = ts.getMutableClone(emittedExpression); + mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); return recreatePartiallyEmittedExpressions(expression, mutableCall); } } else { var leftmostExpressionKind = getLeftmostExpression(emittedExpression).kind; - if (leftmostExpressionKind === 176 /* ObjectLiteralExpression */ || leftmostExpressionKind === 184 /* FunctionExpression */) { - return createParen(expression, /*location*/ expression); + if (leftmostExpressionKind === 177 /* ObjectLiteralExpression */ || leftmostExpressionKind === 185 /* FunctionExpression */) { + return ts.setTextRange(ts.createParen(expression), expression); } } return expression; @@ -12983,7 +14085,7 @@ var ts; */ function recreatePartiallyEmittedExpressions(originalOuterExpression, newInnerExpression) { if (ts.isPartiallyEmittedExpression(originalOuterExpression)) { - var clone_1 = getMutableClone(originalOuterExpression); + var clone_1 = ts.getMutableClone(originalOuterExpression); clone_1.expression = recreatePartiallyEmittedExpressions(clone_1.expression, newInnerExpression); return clone_1; } @@ -12992,21 +14094,21 @@ var ts; function getLeftmostExpression(node) { while (true) { switch (node.kind) { - case 191 /* PostfixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: node = node.operand; continue; - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: node = node.left; continue; - case 193 /* ConditionalExpression */: + case 194 /* ConditionalExpression */: node = node.condition; continue; - case 179 /* CallExpression */: - case 178 /* ElementAccessExpression */: - case 177 /* PropertyAccessExpression */: + case 180 /* CallExpression */: + case 179 /* ElementAccessExpression */: + case 178 /* PropertyAccessExpression */: node = node.expression; continue; - case 294 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: node = node.expression; continue; } @@ -13014,9 +14116,8 @@ var ts; } } function parenthesizeConciseBody(body) { - var emittedBody = skipPartiallyEmittedExpressions(body); - if (emittedBody.kind === 176 /* ObjectLiteralExpression */) { - return createParen(body, /*location*/ body); + if (!ts.isBlock(body) && getLeftmostExpression(body).kind === 177 /* ObjectLiteralExpression */) { + return ts.setTextRange(ts.createParen(body), body); } return body; } @@ -13047,7 +14148,7 @@ var ts; } ts.skipOuterExpressions = skipOuterExpressions; function skipParentheses(node) { - while (node.kind === 183 /* ParenthesizedExpression */) { + while (node.kind === 184 /* ParenthesizedExpression */) { node = node.expression; } return node; @@ -13061,7 +14162,7 @@ var ts; } ts.skipAssertions = skipAssertions; function skipPartiallyEmittedExpressions(node) { - while (node.kind === 294 /* PartiallyEmittedExpression */) { + while (node.kind === 295 /* PartiallyEmittedExpression */) { node = node.expression; } return node; @@ -13072,188 +14173,6 @@ var ts; return node; } ts.startOnNewLine = startOnNewLine; - function setOriginalNode(node, original) { - node.original = original; - if (original) { - var emitNode = original.emitNode; - if (emitNode) - node.emitNode = mergeEmitNode(emitNode, node.emitNode); - } - return node; - } - ts.setOriginalNode = setOriginalNode; - function mergeEmitNode(sourceEmitNode, destEmitNode) { - var flags = sourceEmitNode.flags, commentRange = sourceEmitNode.commentRange, sourceMapRange = sourceEmitNode.sourceMapRange, tokenSourceMapRanges = sourceEmitNode.tokenSourceMapRanges, constantValue = sourceEmitNode.constantValue, helpers = sourceEmitNode.helpers; - if (!destEmitNode) - destEmitNode = {}; - if (flags) - destEmitNode.flags = flags; - if (commentRange) - destEmitNode.commentRange = commentRange; - if (sourceMapRange) - destEmitNode.sourceMapRange = sourceMapRange; - if (tokenSourceMapRanges) - destEmitNode.tokenSourceMapRanges = mergeTokenSourceMapRanges(tokenSourceMapRanges, destEmitNode.tokenSourceMapRanges); - if (constantValue !== undefined) - destEmitNode.constantValue = constantValue; - if (helpers) - destEmitNode.helpers = ts.addRange(destEmitNode.helpers, helpers); - return destEmitNode; - } - function mergeTokenSourceMapRanges(sourceRanges, destRanges) { - if (!destRanges) - destRanges = ts.createMap(); - ts.copyProperties(sourceRanges, destRanges); - return destRanges; - } - /** - * Clears any EmitNode entries from parse-tree nodes. - * @param sourceFile A source file. - */ - function disposeEmitNodes(sourceFile) { - // During transformation we may need to annotate a parse tree node with transient - // transformation properties. As parse tree nodes live longer than transformation - // nodes, we need to make sure we reclaim any memory allocated for custom ranges - // from these nodes to ensure we do not hold onto entire subtrees just for position - // information. We also need to reset these nodes to a pre-transformation state - // for incremental parsing scenarios so that we do not impact later emit. - sourceFile = ts.getSourceFileOfNode(ts.getParseTreeNode(sourceFile)); - var emitNode = sourceFile && sourceFile.emitNode; - var annotatedNodes = emitNode && emitNode.annotatedNodes; - if (annotatedNodes) { - for (var _i = 0, annotatedNodes_1 = annotatedNodes; _i < annotatedNodes_1.length; _i++) { - var node = annotatedNodes_1[_i]; - node.emitNode = undefined; - } - } - } - ts.disposeEmitNodes = disposeEmitNodes; - /** - * Associates a node with the current transformation, initializing - * various transient transformation properties. - * - * @param node The node. - */ - function getOrCreateEmitNode(node) { - if (!node.emitNode) { - if (ts.isParseTreeNode(node)) { - // To avoid holding onto transformation artifacts, we keep track of any - // parse tree node we are annotating. This allows us to clean them up after - // all transformations have completed. - if (node.kind === 261 /* SourceFile */) { - return node.emitNode = { annotatedNodes: [node] }; - } - var sourceFile = ts.getSourceFileOfNode(node); - getOrCreateEmitNode(sourceFile).annotatedNodes.push(node); - } - node.emitNode = {}; - } - return node.emitNode; - } - ts.getOrCreateEmitNode = getOrCreateEmitNode; - /** - * Gets flags that control emit behavior of a node. - * - * @param node The node. - */ - function getEmitFlags(node) { - var emitNode = node.emitNode; - return emitNode && emitNode.flags; - } - ts.getEmitFlags = getEmitFlags; - /** - * Sets flags that control emit behavior of a node. - * - * @param node The node. - * @param emitFlags The NodeEmitFlags for the node. - */ - function setEmitFlags(node, emitFlags) { - getOrCreateEmitNode(node).flags = emitFlags; - return node; - } - ts.setEmitFlags = setEmitFlags; - /** - * Gets a custom text range to use when emitting source maps. - * - * @param node The node. - */ - function getSourceMapRange(node) { - var emitNode = node.emitNode; - return (emitNode && emitNode.sourceMapRange) || node; - } - ts.getSourceMapRange = getSourceMapRange; - /** - * Sets a custom text range to use when emitting source maps. - * - * @param node The node. - * @param range The text range. - */ - function setSourceMapRange(node, range) { - getOrCreateEmitNode(node).sourceMapRange = range; - return node; - } - ts.setSourceMapRange = setSourceMapRange; - /** - * Gets the TextRange to use for source maps for a token of a node. - * - * @param node The node. - * @param token The token. - */ - function getTokenSourceMapRange(node, token) { - var emitNode = node.emitNode; - var tokenSourceMapRanges = emitNode && emitNode.tokenSourceMapRanges; - return tokenSourceMapRanges && tokenSourceMapRanges[token]; - } - ts.getTokenSourceMapRange = getTokenSourceMapRange; - /** - * Sets the TextRange to use for source maps for a token of a node. - * - * @param node The node. - * @param token The token. - * @param range The text range. - */ - function setTokenSourceMapRange(node, token, range) { - var emitNode = getOrCreateEmitNode(node); - var tokenSourceMapRanges = emitNode.tokenSourceMapRanges || (emitNode.tokenSourceMapRanges = ts.createMap()); - tokenSourceMapRanges[token] = range; - return node; - } - ts.setTokenSourceMapRange = setTokenSourceMapRange; - /** - * Gets a custom text range to use when emitting comments. - * - * @param node The node. - */ - function getCommentRange(node) { - var emitNode = node.emitNode; - return (emitNode && emitNode.commentRange) || node; - } - ts.getCommentRange = getCommentRange; - /** - * Sets a custom text range to use when emitting comments. - */ - function setCommentRange(node, range) { - getOrCreateEmitNode(node).commentRange = range; - return node; - } - ts.setCommentRange = setCommentRange; - /** - * Gets the constant value to emit for an expression. - */ - function getConstantValue(node) { - var emitNode = node.emitNode; - return emitNode && emitNode.constantValue; - } - ts.getConstantValue = getConstantValue; - /** - * Sets the constant value to emit for an expression. - */ - function setConstantValue(node, value) { - var emitNode = getOrCreateEmitNode(node); - emitNode.constantValue = value; - return node; - } - ts.setConstantValue = setConstantValue; function getExternalHelpersModuleName(node) { var parseNode = ts.getOriginalNode(node, ts.isSourceFile); var emitNode = parseNode && parseNode.emitNode; @@ -13266,143 +14185,34 @@ var ts; if (externalHelpersModuleName) { return externalHelpersModuleName; } - var helpers = getEmitHelpers(node); + var helpers = ts.getEmitHelpers(node); if (helpers) { - for (var _i = 0, helpers_1 = helpers; _i < helpers_1.length; _i++) { - var helper = helpers_1[_i]; + for (var _i = 0, helpers_2 = helpers; _i < helpers_2.length; _i++) { + var helper = helpers_2[_i]; if (!helper.scoped) { var parseNode = ts.getOriginalNode(node, ts.isSourceFile); - var emitNode = getOrCreateEmitNode(parseNode); - return emitNode.externalHelpersModuleName || (emitNode.externalHelpersModuleName = createUniqueName(ts.externalHelpersModuleNameText)); + var emitNode = ts.getOrCreateEmitNode(parseNode); + return emitNode.externalHelpersModuleName || (emitNode.externalHelpersModuleName = ts.createUniqueName(ts.externalHelpersModuleNameText)); } } } } } ts.getOrCreateExternalHelpersModuleNameIfNeeded = getOrCreateExternalHelpersModuleNameIfNeeded; - /** - * Adds an EmitHelper to a node. - */ - function addEmitHelper(node, helper) { - var emitNode = getOrCreateEmitNode(node); - emitNode.helpers = ts.append(emitNode.helpers, helper); - return node; - } - ts.addEmitHelper = addEmitHelper; - /** - * Adds an EmitHelper to a node. - */ - function addEmitHelpers(node, helpers) { - if (ts.some(helpers)) { - var emitNode = getOrCreateEmitNode(node); - for (var _i = 0, helpers_2 = helpers; _i < helpers_2.length; _i++) { - var helper = helpers_2[_i]; - if (!ts.contains(emitNode.helpers, helper)) { - emitNode.helpers = ts.append(emitNode.helpers, helper); - } - } - } - return node; - } - ts.addEmitHelpers = addEmitHelpers; - /** - * Removes an EmitHelper from a node. - */ - function removeEmitHelper(node, helper) { - var emitNode = node.emitNode; - if (emitNode) { - var helpers = emitNode.helpers; - if (helpers) { - return ts.orderedRemoveItem(helpers, helper); - } - } - return false; - } - ts.removeEmitHelper = removeEmitHelper; - /** - * Gets the EmitHelpers of a node. - */ - function getEmitHelpers(node) { - var emitNode = node.emitNode; - return emitNode && emitNode.helpers; - } - ts.getEmitHelpers = getEmitHelpers; - /** - * Moves matching emit helpers from a source node to a target node. - */ - function moveEmitHelpers(source, target, predicate) { - var sourceEmitNode = source.emitNode; - var sourceEmitHelpers = sourceEmitNode && sourceEmitNode.helpers; - if (!ts.some(sourceEmitHelpers)) - return; - var targetEmitNode = getOrCreateEmitNode(target); - var helpersRemoved = 0; - for (var i = 0; i < sourceEmitHelpers.length; i++) { - var helper = sourceEmitHelpers[i]; - if (predicate(helper)) { - helpersRemoved++; - if (!ts.contains(targetEmitNode.helpers, helper)) { - targetEmitNode.helpers = ts.append(targetEmitNode.helpers, helper); - } - } - else if (helpersRemoved > 0) { - sourceEmitHelpers[i - helpersRemoved] = helper; - } - } - if (helpersRemoved > 0) { - sourceEmitHelpers.length -= helpersRemoved; - } - } - ts.moveEmitHelpers = moveEmitHelpers; - function compareEmitHelpers(x, y) { - if (x === y) - return 0 /* EqualTo */; - if (x.priority === y.priority) - return 0 /* EqualTo */; - if (x.priority === undefined) - return 1 /* GreaterThan */; - if (y.priority === undefined) - return -1 /* LessThan */; - return ts.compareValues(x.priority, y.priority); - } - ts.compareEmitHelpers = compareEmitHelpers; - function setTextRange(node, location) { - if (location) { - node.pos = location.pos; - node.end = location.end; - } - return node; - } - ts.setTextRange = setTextRange; - function setNodeFlags(node, flags) { - node.flags = flags; - return node; - } - ts.setNodeFlags = setNodeFlags; - function setMultiLine(node, multiLine) { - node.multiLine = multiLine; - return node; - } - ts.setMultiLine = setMultiLine; - function setHasTrailingComma(nodes, hasTrailingComma) { - nodes.hasTrailingComma = hasTrailingComma; - return nodes; - } - ts.setHasTrailingComma = setHasTrailingComma; /** * Get the name of that target module from an import or export declaration */ function getLocalNameForExternalImport(node, sourceFile) { var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); if (namespaceDeclaration && !ts.isDefaultImport(node)) { - var name_9 = namespaceDeclaration.name; - return ts.isGeneratedIdentifier(name_9) ? name_9 : createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, namespaceDeclaration.name)); + var name = namespaceDeclaration.name; + return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, namespaceDeclaration.name)); } - if (node.kind === 235 /* ImportDeclaration */ && node.importClause) { - return getGeneratedNameForNode(node); + if (node.kind === 237 /* ImportDeclaration */ && node.importClause) { + return ts.getGeneratedNameForNode(node); } - if (node.kind === 241 /* ExportDeclaration */ && node.moduleSpecifier) { - return getGeneratedNameForNode(node); + if (node.kind === 243 /* ExportDeclaration */ && node.moduleSpecifier) { + return ts.getGeneratedNameForNode(node); } return undefined; } @@ -13420,7 +14230,7 @@ var ts; if (moduleName.kind === 9 /* StringLiteral */) { return tryGetModuleNameFromDeclaration(importNode, host, resolver, compilerOptions) || tryRenameExternalModule(moduleName, sourceFile) - || getSynthesizedClone(moduleName); + || ts.getSynthesizedClone(moduleName); } return undefined; } @@ -13430,10 +14240,8 @@ var ts; * Here we check if alternative name was provided for a given moduleName and return it if possible. */ function tryRenameExternalModule(moduleName, sourceFile) { - if (sourceFile.renamedDependencies && ts.hasProperty(sourceFile.renamedDependencies, moduleName.text)) { - return createLiteral(sourceFile.renamedDependencies[moduleName.text]); - } - return undefined; + var rename = sourceFile.renamedDependencies && sourceFile.renamedDependencies.get(moduleName.text); + return rename && ts.createLiteral(rename); } /** * Get the name of a module as should be written in the emitted output. @@ -13447,10 +14255,10 @@ var ts; return undefined; } if (file.moduleName) { - return createLiteral(file.moduleName); + return ts.createLiteral(file.moduleName); } if (!ts.isDeclarationFile(file) && (options.out || options.outFile)) { - return createLiteral(ts.getExternalModuleNameFromPath(host, file.fileName)); + return ts.createLiteral(ts.getExternalModuleNameFromPath(host, file.fileName)); } return undefined; } @@ -13521,7 +14329,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 257 /* PropertyAssignment */: + case 260 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -13533,11 +14341,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 258 /* ShorthandPropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 259 /* SpreadAssignment */: + case 262 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -13569,12 +14377,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 144 /* Parameter */: - case 174 /* BindingElement */: + case 145 /* Parameter */: + case 175 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 196 /* SpreadElement */: - case 259 /* SpreadAssignment */: + case 197 /* SpreadElement */: + case 262 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -13586,7 +14394,7 @@ var ts; */ function getPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 174 /* BindingElement */: + case 175 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -13598,7 +14406,7 @@ var ts; : propertyName; } break; - case 257 /* PropertyAssignment */: + case 260 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -13610,7 +14418,7 @@ var ts; : propertyName; } break; - case 259 /* SpreadAssignment */: + case 262 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return bindingElement.name; } @@ -13628,13 +14436,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 172 /* ObjectBindingPattern */: - case 173 /* ArrayBindingPattern */: - case 175 /* ArrayLiteralExpression */: + case 173 /* ObjectBindingPattern */: + case 174 /* ArrayBindingPattern */: + case 176 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 176 /* ObjectLiteralExpression */: + case 177 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -13644,10 +14452,12 @@ var ts; if (ts.isBindingElement(element)) { if (element.dotDotDotToken) { ts.Debug.assertNode(element.name, ts.isIdentifier); - return setOriginalNode(createSpread(element.name, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createSpread(element.name), element), element); } var expression = convertToAssignmentElementTarget(element.name); - return element.initializer ? setOriginalNode(createAssignment(expression, element.initializer, element), element) : expression; + return element.initializer + ? ts.setOriginalNode(ts.setTextRange(ts.createAssignment(expression, element.initializer), element), element) + : expression; } ts.Debug.assertNode(element, ts.isExpression); return element; @@ -13657,14 +14467,14 @@ var ts; if (ts.isBindingElement(element)) { if (element.dotDotDotToken) { ts.Debug.assertNode(element.name, ts.isIdentifier); - return setOriginalNode(createSpreadAssignment(element.name, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createSpreadAssignment(element.name), element), element); } if (element.propertyName) { var expression = convertToAssignmentElementTarget(element.name); - return setOriginalNode(createPropertyAssignment(element.propertyName, element.initializer ? createAssignment(expression, element.initializer) : expression, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createPropertyAssignment(element.propertyName, element.initializer ? ts.createAssignment(expression, element.initializer) : expression), element), element); } ts.Debug.assertNode(element.name, ts.isIdentifier); - return setOriginalNode(createShorthandPropertyAssignment(element.name, element.initializer, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createShorthandPropertyAssignment(element.name, element.initializer), element), element); } ts.Debug.assertNode(element, ts.isObjectLiteralElementLike); return element; @@ -13672,18 +14482,18 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 173 /* ArrayBindingPattern */: - case 175 /* ArrayLiteralExpression */: + case 174 /* ArrayBindingPattern */: + case 176 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 172 /* ObjectBindingPattern */: - case 176 /* ObjectLiteralExpression */: + case 173 /* ObjectBindingPattern */: + case 177 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } ts.convertToAssignmentPattern = convertToAssignmentPattern; function convertToObjectAssignmentPattern(node) { if (ts.isObjectBindingPattern(node)) { - return setOriginalNode(createObjectLiteral(ts.map(node.elements, convertToObjectAssignmentElement), node), node); + return ts.setOriginalNode(ts.setTextRange(ts.createObjectLiteral(ts.map(node.elements, convertToObjectAssignmentElement)), node), node); } ts.Debug.assertNode(node, ts.isObjectLiteralExpression); return node; @@ -13691,7 +14501,7 @@ var ts; ts.convertToObjectAssignmentPattern = convertToObjectAssignmentPattern; function convertToArrayAssignmentPattern(node) { if (ts.isArrayBindingPattern(node)) { - return setOriginalNode(createArrayLiteral(ts.map(node.elements, convertToArrayAssignmentElement), node), node); + return ts.setOriginalNode(ts.setTextRange(ts.createArrayLiteral(ts.map(node.elements, convertToArrayAssignmentElement)), node), node); } ts.Debug.assertNode(node, ts.isArrayLiteralExpression); return node; @@ -13707,37 +14517,37 @@ var ts; ts.convertToAssignmentElementTarget = convertToAssignmentElementTarget; function collectExternalModuleInfo(sourceFile, resolver, compilerOptions) { var externalImports = []; - var exportSpecifiers = ts.createMap(); - var exportedBindings = ts.createMap(); + var exportSpecifiers = ts.createMultiMap(); + var exportedBindings = []; var uniqueExports = ts.createMap(); var exportedNames; var hasExportDefault = false; var exportEquals = undefined; var hasExportStarsToExportValues = false; var externalHelpersModuleName = getOrCreateExternalHelpersModuleNameIfNeeded(sourceFile, compilerOptions); - var externalHelpersImportDeclaration = externalHelpersModuleName && createImportDeclaration( + var externalHelpersImportDeclaration = externalHelpersModuleName && ts.createImportDeclaration( /*decorators*/ undefined, - /*modifiers*/ undefined, createImportClause(/*name*/ undefined, createNamespaceImport(externalHelpersModuleName)), createLiteral(ts.externalHelpersModuleNameText)); + /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText)); if (externalHelpersImportDeclaration) { externalImports.push(externalHelpersImportDeclaration); } for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 235 /* ImportDeclaration */: + case 237 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" // import { x, y } from "mod" externalImports.push(node); break; - case 234 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 245 /* ExternalModuleReference */) { + case 236 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 247 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -13753,27 +14563,27 @@ var ts; // export { x, y } for (var _b = 0, _c = node.exportClause.elements; _b < _c.length; _b++) { var specifier = _c[_b]; - if (!uniqueExports[specifier.name.text]) { - var name_10 = specifier.propertyName || specifier.name; - ts.multiMapAdd(exportSpecifiers, name_10.text, specifier); - var decl = resolver.getReferencedImportDeclaration(name_10) - || resolver.getReferencedValueDeclaration(name_10); + if (!uniqueExports.get(specifier.name.text)) { + var name = specifier.propertyName || specifier.name; + exportSpecifiers.add(name.text, specifier); + var decl = resolver.getReferencedImportDeclaration(name) + || resolver.getReferencedValueDeclaration(name); if (decl) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(decl), specifier.name); + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(decl), specifier.name); } - uniqueExports[specifier.name.text] = true; + uniqueExports.set(specifier.name.text, true); exportedNames = ts.append(exportedNames, specifier.name); } } } break; - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: if (ts.hasModifier(node, 1 /* Export */)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -13781,42 +14591,42 @@ var ts; } } break; - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default function() { } if (!hasExportDefault) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); hasExportDefault = true; } } else { // export function x() { } - var name_11 = node.name; - if (!uniqueExports[name_11.text]) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), name_11); - uniqueExports[name_11.text] = true; - exportedNames = ts.append(exportedNames, name_11); + var name = node.name; + if (!uniqueExports.get(name.text)) { + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), name); + uniqueExports.set(name.text, true); + exportedNames = ts.append(exportedNames, name); } } } break; - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default class { } if (!hasExportDefault) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); hasExportDefault = true; } } else { // export class x { } - var name_12 = node.name; - if (!uniqueExports[name_12.text]) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), name_12); - uniqueExports[name_12.text] = true; - exportedNames = ts.append(exportedNames, name_12); + var name = node.name; + if (!uniqueExports.get(name.text)) { + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), name); + uniqueExports.set(name.text, true); + exportedNames = ts.append(exportedNames, name); } } } @@ -13836,13 +14646,24 @@ var ts; } } else if (!ts.isGeneratedIdentifier(decl.name)) { - if (!uniqueExports[decl.name.text]) { - uniqueExports[decl.name.text] = true; + if (!uniqueExports.get(decl.name.text)) { + uniqueExports.set(decl.name.text, true); exportedNames = ts.append(exportedNames, decl.name); } } return exportedNames; } + /** Use a sparse array as a multi-map. */ + function multiMapSparseArrayAdd(map, key, value) { + var values = map[key]; + if (values) { + values.push(value); + } + else { + map[key] = values = [value]; + } + return values; + } })(ts || (ts = {})); /// /// @@ -13854,13 +14675,13 @@ var ts; var IdentifierConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 261 /* SourceFile */) { + if (kind === 264 /* SourceFile */) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 70 /* Identifier */) { return new (IdentifierConstructor || (IdentifierConstructor = ts.objectAllocator.getIdentifierConstructor()))(kind, pos, end); } - else if (kind < 141 /* FirstNode */) { + else if (kind < 142 /* FirstNode */) { return new (TokenConstructor || (TokenConstructor = ts.objectAllocator.getTokenConstructor()))(kind, pos, end); } else { @@ -13903,28 +14724,29 @@ var ts; var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode; var cbNodes = cbNodeArray || cbNode; switch (node.kind) { - case 141 /* QualifiedName */: + case 142 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 143 /* TypeParameter */: + case 144 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || + visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 258 /* ShorthandPropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 259 /* SpreadAssignment */: + case 262 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 144 /* Parameter */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 257 /* PropertyAssignment */: - case 223 /* VariableDeclaration */: - case 174 /* BindingElement */: + case 145 /* Parameter */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 260 /* PropertyAssignment */: + case 225 /* VariableDeclaration */: + case 175 /* BindingElement */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || @@ -13933,24 +14755,24 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: - case 185 /* ArrowFunction */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 185 /* FunctionExpression */: + case 227 /* FunctionDeclaration */: + case 186 /* ArrowFunction */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -13961,320 +14783,326 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 157 /* TypeReference */: + case 158 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNodes, node.typeArguments); - case 156 /* TypePredicate */: + case 157 /* TypePredicate */: return visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 160 /* TypeQuery */: + case 161 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 161 /* TypeLiteral */: + case 162 /* TypeLiteral */: return visitNodes(cbNodes, node.members); - case 162 /* ArrayType */: + case 163 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 163 /* TupleType */: + case 164 /* TupleType */: return visitNodes(cbNodes, node.elementTypes); - case 164 /* UnionType */: - case 165 /* IntersectionType */: + case 165 /* UnionType */: + case 166 /* IntersectionType */: return visitNodes(cbNodes, node.types); - case 166 /* ParenthesizedType */: - case 168 /* TypeOperator */: + case 167 /* ParenthesizedType */: + case 169 /* TypeOperator */: return visitNode(cbNode, node.type); - case 169 /* IndexedAccessType */: + case 170 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 170 /* MappedType */: + case 171 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 171 /* LiteralType */: + case 172 /* LiteralType */: return visitNode(cbNode, node.literal); - case 172 /* ObjectBindingPattern */: - case 173 /* ArrayBindingPattern */: + case 173 /* ObjectBindingPattern */: + case 174 /* ArrayBindingPattern */: return visitNodes(cbNodes, node.elements); - case 175 /* ArrayLiteralExpression */: + case 176 /* ArrayLiteralExpression */: return visitNodes(cbNodes, node.elements); - case 176 /* ObjectLiteralExpression */: + case 177 /* ObjectLiteralExpression */: return visitNodes(cbNodes, node.properties); - case 177 /* PropertyAccessExpression */: + case 178 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.name); - case 178 /* ElementAccessExpression */: + case 179 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 179 /* CallExpression */: - case 180 /* NewExpression */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); - case 181 /* TaggedTemplateExpression */: + case 182 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 182 /* TypeAssertionExpression */: + case 183 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 186 /* DeleteExpression */: + case 187 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 187 /* TypeOfExpression */: + case 188 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 188 /* VoidExpression */: + case 189 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 190 /* PrefixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 195 /* YieldExpression */: + case 196 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 189 /* AwaitExpression */: + case 190 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 191 /* PostfixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 200 /* AsExpression */: + case 201 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 201 /* NonNullExpression */: + case 202 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 193 /* ConditionalExpression */: + case 203 /* MetaProperty */: + return visitNode(cbNode, node.name); + case 194 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 196 /* SpreadElement */: + case 197 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 204 /* Block */: - case 231 /* ModuleBlock */: + case 206 /* Block */: + case 233 /* ModuleBlock */: return visitNodes(cbNodes, node.statements); - case 261 /* SourceFile */: + case 264 /* SourceFile */: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 224 /* VariableDeclarationList */: + case 226 /* VariableDeclarationList */: return visitNodes(cbNodes, node.declarations); - case 207 /* ExpressionStatement */: + case 209 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 208 /* IfStatement */: + case 210 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 209 /* DoStatement */: + case 211 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 210 /* WhileStatement */: + case 212 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 211 /* ForStatement */: + case 213 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 212 /* ForInStatement */: + case 214 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 213 /* ForOfStatement */: - return visitNode(cbNode, node.initializer) || + case 215 /* ForOfStatement */: + return visitNode(cbNode, node.awaitModifier) || + visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 214 /* ContinueStatement */: - case 215 /* BreakStatement */: + case 216 /* ContinueStatement */: + case 217 /* BreakStatement */: return visitNode(cbNode, node.label); - case 216 /* ReturnStatement */: + case 218 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 217 /* WithStatement */: + case 219 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 218 /* SwitchStatement */: + case 220 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 232 /* CaseBlock */: + case 234 /* CaseBlock */: return visitNodes(cbNodes, node.clauses); - case 253 /* CaseClause */: + case 256 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.statements); - case 254 /* DefaultClause */: + case 257 /* DefaultClause */: return visitNodes(cbNodes, node.statements); - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 220 /* ThrowStatement */: + case 222 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 221 /* TryStatement */: + case 223 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 256 /* CatchClause */: + case 259 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 145 /* Decorator */: + case 146 /* Decorator */: return visitNode(cbNode, node.expression); - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); - case 228 /* TypeAliasDeclaration */: + case 230 /* TypeAliasDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.members); - case 260 /* EnumMember */: + case 263 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 235 /* ImportDeclaration */: + case 237 /* ImportDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 236 /* ImportClause */: + case 238 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 233 /* NamespaceExportDeclaration */: + case 235 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 237 /* NamespaceImport */: + case 239 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 238 /* NamedImports */: - case 242 /* NamedExports */: + case 240 /* NamedImports */: + case 244 /* NamedExports */: return visitNodes(cbNodes, node.elements); - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 239 /* ImportSpecifier */: - case 243 /* ExportSpecifier */: + case 241 /* ImportSpecifier */: + case 245 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 194 /* TemplateExpression */: + case 195 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 202 /* TemplateSpan */: + case 204 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 142 /* ComputedPropertyName */: + case 143 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 255 /* HeritageClause */: + case 258 /* HeritageClause */: return visitNodes(cbNodes, node.types); - case 199 /* ExpressionWithTypeArguments */: + case 200 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments); - case 245 /* ExternalModuleReference */: + case 247 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 244 /* MissingDeclaration */: + case 246 /* MissingDeclaration */: return visitNodes(cbNodes, node.decorators); - case 246 /* JsxElement */: + case 248 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 247 /* JsxSelfClosingElement */: - case 248 /* JsxOpeningElement */: + case 249 /* JsxSelfClosingElement */: + case 250 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || - visitNodes(cbNodes, node.attributes); - case 250 /* JsxAttribute */: + visitNode(cbNode, node.attributes); + case 253 /* JsxAttributes */: + return visitNodes(cbNodes, node.properties); + case 252 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 251 /* JsxSpreadAttribute */: + case 254 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 252 /* JsxExpression */: - return visitNode(cbNode, node.expression); - case 249 /* JsxClosingElement */: + case 255 /* JsxExpression */: + return visitNode(cbNode, node.dotDotDotToken) || + visitNode(cbNode, node.expression); + case 251 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 262 /* JSDocTypeExpression */: + case 266 /* JSDocTypeExpression */: return visitNode(cbNode, node.type); - case 266 /* JSDocUnionType */: + case 270 /* JSDocUnionType */: return visitNodes(cbNodes, node.types); - case 267 /* JSDocTupleType */: + case 271 /* JSDocTupleType */: return visitNodes(cbNodes, node.types); - case 265 /* JSDocArrayType */: + case 269 /* JSDocArrayType */: return visitNode(cbNode, node.elementType); - case 269 /* JSDocNonNullableType */: + case 273 /* JSDocNonNullableType */: return visitNode(cbNode, node.type); - case 268 /* JSDocNullableType */: + case 272 /* JSDocNullableType */: return visitNode(cbNode, node.type); - case 270 /* JSDocRecordType */: + case 274 /* JSDocRecordType */: return visitNode(cbNode, node.literal); - case 272 /* JSDocTypeReference */: + case 276 /* JSDocTypeReference */: return visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeArguments); - case 273 /* JSDocOptionalType */: + case 277 /* JSDocOptionalType */: return visitNode(cbNode, node.type); - case 274 /* JSDocFunctionType */: + case 278 /* JSDocFunctionType */: return visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 275 /* JSDocVariadicType */: + case 279 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 276 /* JSDocConstructorType */: + case 280 /* JSDocConstructorType */: return visitNode(cbNode, node.type); - case 277 /* JSDocThisType */: + case 281 /* JSDocThisType */: return visitNode(cbNode, node.type); - case 271 /* JSDocRecordMember */: + case 275 /* JSDocRecordMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.type); - case 278 /* JSDocComment */: + case 282 /* JSDocComment */: return visitNodes(cbNodes, node.tags); - case 281 /* JSDocParameterTag */: + case 285 /* JSDocParameterTag */: return visitNode(cbNode, node.preParameterName) || visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.postParameterName); - case 282 /* JSDocReturnTag */: + case 286 /* JSDocReturnTag */: return visitNode(cbNode, node.typeExpression); - case 283 /* JSDocTypeTag */: + case 287 /* JSDocTypeTag */: return visitNode(cbNode, node.typeExpression); - case 280 /* JSDocAugmentsTag */: + case 284 /* JSDocAugmentsTag */: return visitNode(cbNode, node.typeExpression); - case 284 /* JSDocTemplateTag */: + case 288 /* JSDocTemplateTag */: return visitNodes(cbNodes, node.typeParameters); - case 285 /* JSDocTypedefTag */: + case 289 /* JSDocTypedefTag */: return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.jsDocTypeLiteral); - case 287 /* JSDocTypeLiteral */: + case 291 /* JSDocTypeLiteral */: return visitNodes(cbNodes, node.jsDocPropertyTags); - case 286 /* JSDocPropertyTag */: + case 290 /* JSDocPropertyTag */: return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name); - case 294 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); - case 288 /* JSDocLiteralType */: + case 292 /* JSDocLiteralType */: return visitNode(cbNode, node.literal); } } @@ -14292,6 +15120,7 @@ var ts; return Parser.parseIsolatedEntityName(text, languageVersion); } ts.parseIsolatedEntityName = parseIsolatedEntityName; + // See also `isExternalOrCommonJsModule` in utilities.ts function isExternalModule(file) { return file.externalModuleIndicator !== undefined; } @@ -14334,7 +15163,7 @@ var ts; // Share a single scanner across all calls to parse a source file. This helps speed things // up by avoiding the cost of creating/compiling scanners over and over again. var scanner = ts.createScanner(5 /* Latest */, /*skipTrivia*/ true); - var disallowInAndDecoratorContext = 65536 /* DisallowInContext */ | 262144 /* DecoratorContext */; + var disallowInAndDecoratorContext = 2048 /* DisallowInContext */ | 8192 /* DecoratorContext */; // capture constructors in 'initializeState' to avoid null checks var NodeConstructor; var TokenConstructor; @@ -14458,7 +15287,7 @@ var ts; identifiers = ts.createMap(); identifierCount = 0; nodeCount = 0; - contextFlags = scriptKind === 1 /* JS */ || scriptKind === 2 /* JSX */ ? 2097152 /* JavaScriptFile */ : 0 /* None */; + contextFlags = scriptKind === 1 /* JS */ || scriptKind === 2 /* JSX */ ? 65536 /* JavaScriptFile */ : 0 /* None */; parseErrorBeforeNextFinishedNode = false; // Initialize and prime the scanner before parsing the source elements. scanner.setText(sourceText); @@ -14546,7 +15375,7 @@ var ts; function createSourceFile(fileName, languageVersion, scriptKind) { // code from createNode is inlined here so createNode won't have to deal with special case of creating source files // this is quite rare comparing to other nodes and createNode should be as fast as possible - var sourceFile = new SourceFileConstructor(261 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + var sourceFile = new SourceFileConstructor(264 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -14566,16 +15395,16 @@ var ts; } } function setDisallowInContext(val) { - setContextFlag(val, 65536 /* DisallowInContext */); + setContextFlag(val, 2048 /* DisallowInContext */); } function setYieldContext(val) { - setContextFlag(val, 131072 /* YieldContext */); + setContextFlag(val, 4096 /* YieldContext */); } function setDecoratorContext(val) { - setContextFlag(val, 262144 /* DecoratorContext */); + setContextFlag(val, 8192 /* DecoratorContext */); } function setAwaitContext(val) { - setContextFlag(val, 524288 /* AwaitContext */); + setContextFlag(val, 16384 /* AwaitContext */); } function doOutsideOfContext(context, func) { // contextFlagsToClear will contain only the context flags that are @@ -14616,40 +15445,40 @@ var ts; return func(); } function allowInAnd(func) { - return doOutsideOfContext(65536 /* DisallowInContext */, func); + return doOutsideOfContext(2048 /* DisallowInContext */, func); } function disallowInAnd(func) { - return doInsideOfContext(65536 /* DisallowInContext */, func); + return doInsideOfContext(2048 /* DisallowInContext */, func); } function doInYieldContext(func) { - return doInsideOfContext(131072 /* YieldContext */, func); + return doInsideOfContext(4096 /* YieldContext */, func); } function doInDecoratorContext(func) { - return doInsideOfContext(262144 /* DecoratorContext */, func); + return doInsideOfContext(8192 /* DecoratorContext */, func); } function doInAwaitContext(func) { - return doInsideOfContext(524288 /* AwaitContext */, func); + return doInsideOfContext(16384 /* AwaitContext */, func); } function doOutsideOfAwaitContext(func) { - return doOutsideOfContext(524288 /* AwaitContext */, func); + return doOutsideOfContext(16384 /* AwaitContext */, func); } function doInYieldAndAwaitContext(func) { - return doInsideOfContext(131072 /* YieldContext */ | 524288 /* AwaitContext */, func); + return doInsideOfContext(4096 /* YieldContext */ | 16384 /* AwaitContext */, func); } function inContext(flags) { return (contextFlags & flags) !== 0; } function inYieldContext() { - return inContext(131072 /* YieldContext */); + return inContext(4096 /* YieldContext */); } function inDisallowInContext() { - return inContext(65536 /* DisallowInContext */); + return inContext(2048 /* DisallowInContext */); } function inDecoratorContext() { - return inContext(262144 /* DecoratorContext */); + return inContext(8192 /* DecoratorContext */); } function inAwaitContext() { - return inContext(524288 /* AwaitContext */); + return inContext(16384 /* AwaitContext */); } function parseErrorAtCurrentToken(message, arg0) { var start = scanner.getTokenPos(); @@ -14830,7 +15659,7 @@ var ts; if (!(pos >= 0)) { pos = scanner.getStartPos(); } - return kind >= 141 /* FirstNode */ ? new NodeConstructor(kind, pos, pos) : + return kind >= 142 /* FirstNode */ ? new NodeConstructor(kind, pos, pos) : kind === 70 /* Identifier */ ? new IdentifierConstructor(kind, pos, pos) : new TokenConstructor(kind, pos, pos); } @@ -14853,7 +15682,7 @@ var ts; // flag so that we don't mark any subsequent nodes. if (parseErrorBeforeNextFinishedNode) { parseErrorBeforeNextFinishedNode = false; - node.flags |= 1048576 /* ThisNodeHasError */; + node.flags |= 32768 /* ThisNodeHasError */; } return node; } @@ -14870,7 +15699,11 @@ var ts; } function internIdentifier(text) { text = ts.escapeIdentifier(text); - return identifiers[text] || (identifiers[text] = text); + var identifier = identifiers.get(text); + if (identifier === undefined) { + identifiers.set(text, identifier = text); + } + return identifier; } // An identifier that starts with two underscores has an extra underscore character prepended to it to avoid issues // with magic property names like '__proto__'. The 'identifiers' object is used to share a single string instance for @@ -14922,7 +15755,7 @@ var ts; // PropertyName [Yield]: // LiteralPropertyName // ComputedPropertyName[?Yield] - var node = createNode(142 /* ComputedPropertyName */); + var node = createNode(143 /* ComputedPropertyName */); parseExpected(20 /* OpenBracketToken */); // We parse any expression (including a comma expression). But the grammar // says that only an assignment expression is allowed, so the grammar checker @@ -14975,6 +15808,7 @@ var ts; function nextTokenIsClassOrFunctionOrAsync() { nextToken(); return token() === 74 /* ClassKeyword */ || token() === 88 /* FunctionKeyword */ || + (token() === 116 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine)) || (token() === 119 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine)); } // True if positioned at the start of a list element @@ -15015,7 +15849,7 @@ var ts; case 9 /* ObjectBindingElements */: return token() === 20 /* OpenBracketToken */ || token() === 23 /* DotDotDotToken */ || isLiteralPropertyName(); case 7 /* HeritageClauseElement */: - // If we see { } then only consume it as an expression if it is followed by , or { + // If we see `{ ... }` then only consume it as an expression if it is followed by `,` or `{` // That way we won't consume the body of a class in its heritage clause. if (token() === 16 /* OpenBraceToken */) { return lookAhead(isValidHeritageClauseObjectLiteral); @@ -15247,7 +16081,7 @@ var ts; // differently depending on what mode it is in. // // This also applies to all our other context flags as well. - var nodeContextFlags = node.flags & 3080192 /* ContextFlags */; + var nodeContextFlags = node.flags & 96256 /* ContextFlags */; if (nodeContextFlags !== contextFlags) { return undefined; } @@ -15329,14 +16163,14 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 150 /* Constructor */: - case 155 /* IndexSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 147 /* PropertyDeclaration */: - case 203 /* SemicolonClassElement */: + case 151 /* Constructor */: + case 156 /* IndexSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 148 /* PropertyDeclaration */: + case 205 /* SemicolonClassElement */: return true; - case 149 /* MethodDeclaration */: + case 150 /* MethodDeclaration */: // Method declarations are not necessarily reusable. An object-literal // may have a method calls "constructor(...)" and we must reparse that // into an actual .ConstructorDeclaration. @@ -15351,8 +16185,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 253 /* CaseClause */: - case 254 /* DefaultClause */: + case 256 /* CaseClause */: + case 257 /* DefaultClause */: return true; } } @@ -15361,58 +16195,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 225 /* FunctionDeclaration */: - case 205 /* VariableStatement */: - case 204 /* Block */: - case 208 /* IfStatement */: - case 207 /* ExpressionStatement */: - case 220 /* ThrowStatement */: - case 216 /* ReturnStatement */: - case 218 /* SwitchStatement */: - case 215 /* BreakStatement */: - case 214 /* ContinueStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 211 /* ForStatement */: - case 210 /* WhileStatement */: - case 217 /* WithStatement */: - case 206 /* EmptyStatement */: - case 221 /* TryStatement */: - case 219 /* LabeledStatement */: - case 209 /* DoStatement */: - case 222 /* DebuggerStatement */: - case 235 /* ImportDeclaration */: - case 234 /* ImportEqualsDeclaration */: - case 241 /* ExportDeclaration */: - case 240 /* ExportAssignment */: - case 230 /* ModuleDeclaration */: - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 229 /* EnumDeclaration */: - case 228 /* TypeAliasDeclaration */: + case 227 /* FunctionDeclaration */: + case 207 /* VariableStatement */: + case 206 /* Block */: + case 210 /* IfStatement */: + case 209 /* ExpressionStatement */: + case 222 /* ThrowStatement */: + case 218 /* ReturnStatement */: + case 220 /* SwitchStatement */: + case 217 /* BreakStatement */: + case 216 /* ContinueStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: + case 213 /* ForStatement */: + case 212 /* WhileStatement */: + case 219 /* WithStatement */: + case 208 /* EmptyStatement */: + case 223 /* TryStatement */: + case 221 /* LabeledStatement */: + case 211 /* DoStatement */: + case 224 /* DebuggerStatement */: + case 237 /* ImportDeclaration */: + case 236 /* ImportEqualsDeclaration */: + case 243 /* ExportDeclaration */: + case 242 /* ExportAssignment */: + case 232 /* ModuleDeclaration */: + case 228 /* ClassDeclaration */: + case 229 /* InterfaceDeclaration */: + case 231 /* EnumDeclaration */: + case 230 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 260 /* EnumMember */; + return node.kind === 263 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 154 /* ConstructSignature */: - case 148 /* MethodSignature */: - case 155 /* IndexSignature */: - case 146 /* PropertySignature */: - case 153 /* CallSignature */: + case 155 /* ConstructSignature */: + case 149 /* MethodSignature */: + case 156 /* IndexSignature */: + case 147 /* PropertySignature */: + case 154 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 223 /* VariableDeclaration */) { + if (node.kind !== 225 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -15433,7 +16267,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 144 /* Parameter */) { + if (node.kind !== 145 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -15480,7 +16314,6 @@ var ts; case 25 /* JSDocRecordMembers */: return ts.Diagnostics.Property_assignment_expected; } } - ; // Parses a comma-delimited list of elements function parseDelimitedList(kind, parseElement, considerSemicolonAsDelimiter) { var saveParsingContext = parsingContext; @@ -15546,7 +16379,7 @@ var ts; function parseEntityName(allowReservedWords, diagnosticMessage) { var entity = parseIdentifier(diagnosticMessage); while (parseOptional(22 /* DotToken */)) { - var node = createNode(141 /* QualifiedName */, entity.pos); // !!! + var node = createNode(142 /* QualifiedName */, entity.pos); // !!! node.left = entity; node.right = parseRightSideOfDot(allowReservedWords); entity = finishNode(node); @@ -15585,7 +16418,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(194 /* TemplateExpression */); + var template = createNode(195 /* TemplateExpression */); template.head = parseTemplateHead(); ts.Debug.assert(template.head.kind === 13 /* TemplateHead */, "Template head has wrong token kind"); var templateSpans = createNodeArray(); @@ -15597,7 +16430,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(202 /* TemplateSpan */); + var span = createNode(204 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token() === 17 /* CloseBraceToken */) { @@ -15633,27 +16466,23 @@ var ts; if (scanner.isUnterminated()) { node.isUnterminated = true; } - var tokenPos = scanner.getTokenPos(); - nextToken(); - finishNode(node); // Octal literals are not allowed in strict mode or ES5 // Note that theoretically the following condition would hold true literals like 009, // which is not octal.But because of how the scanner separates the tokens, we would // never get a token like this. Instead, we would get 00 and 9 as two separate tokens. // We also do not need to check for negatives because any prefix operator would be part of a // parent unary expression. - if (node.kind === 8 /* NumericLiteral */ - && sourceText.charCodeAt(tokenPos) === 48 /* _0 */ - && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { - node.isOctalLiteral = true; + if (node.kind === 8 /* NumericLiteral */) { + node.numericLiteralFlags = scanner.getNumericLiteralFlags(); } + nextToken(); + finishNode(node); return node; } // TYPES function parseTypeReference() { - var typeName = parseEntityName(/*allowReservedWords*/ false, ts.Diagnostics.Type_expected); - var node = createNode(157 /* TypeReference */, typeName.pos); - node.typeName = typeName; + var node = createNode(158 /* TypeReference */); + node.typeName = parseEntityName(/*allowReservedWords*/ false, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && token() === 26 /* LessThanToken */) { node.typeArguments = parseBracketedList(19 /* TypeArguments */, parseType, 26 /* LessThanToken */, 28 /* GreaterThanToken */); } @@ -15661,24 +16490,24 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(156 /* TypePredicate */, lhs.pos); + var node = createNode(157 /* TypePredicate */, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(167 /* ThisType */); + var node = createNode(168 /* ThisType */); nextToken(); return finishNode(node); } function parseTypeQuery() { - var node = createNode(160 /* TypeQuery */); + var node = createNode(161 /* TypeQuery */); parseExpected(102 /* TypeOfKeyword */); node.exprName = parseEntityName(/*allowReservedWords*/ true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(143 /* TypeParameter */); + var node = createNode(144 /* TypeParameter */); node.name = parseIdentifier(); if (parseOptional(84 /* ExtendsKeyword */)) { // It's not uncommon for people to write improper constraints to a generic. If the @@ -15699,6 +16528,9 @@ var ts; node.expression = parseUnaryExpressionOrHigher(); } } + if (parseOptional(57 /* EqualsToken */)) { + node.default = parseType(); + } return finishNode(node); } function parseTypeParameters() { @@ -15716,9 +16548,9 @@ var ts; return token() === 23 /* DotDotDotToken */ || isIdentifierOrPattern() || ts.isModifierKind(token()) || token() === 56 /* AtToken */ || token() === 98 /* ThisKeyword */; } function parseParameter() { - var node = createNode(144 /* Parameter */); + var node = createNode(145 /* Parameter */); if (token() === 98 /* ThisKeyword */) { - node.name = createIdentifier(/*isIdentifier*/ true, undefined); + node.name = createIdentifier(/*isIdentifier*/ true); node.type = parseParameterType(); return finishNode(node); } @@ -15815,7 +16647,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNode(kind); - if (kind === 154 /* ConstructSignature */) { + if (kind === 155 /* ConstructSignature */) { parseExpected(93 /* NewKeyword */); } fillSignature(55 /* ColonToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, node); @@ -15879,7 +16711,7 @@ var ts; return token() === 55 /* ColonToken */ || token() === 25 /* CommaToken */ || token() === 21 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) { - var node = createNode(155 /* IndexSignature */, fullStart); + var node = createNode(156 /* IndexSignature */, fullStart); node.decorators = decorators; node.modifiers = modifiers; node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 20 /* OpenBracketToken */, 21 /* CloseBracketToken */); @@ -15891,7 +16723,7 @@ var ts; var name = parsePropertyName(); var questionToken = parseOptionalToken(54 /* QuestionToken */); if (token() === 18 /* OpenParenToken */ || token() === 26 /* LessThanToken */) { - var method = createNode(148 /* MethodSignature */, fullStart); + var method = createNode(149 /* MethodSignature */, fullStart); method.modifiers = modifiers; method.name = name; method.questionToken = questionToken; @@ -15902,7 +16734,7 @@ var ts; return addJSDocComment(finishNode(method)); } else { - var property = createNode(146 /* PropertySignature */, fullStart); + var property = createNode(147 /* PropertySignature */, fullStart); property.modifiers = modifiers; property.name = name; property.questionToken = questionToken; @@ -15918,14 +16750,14 @@ var ts; } } function isTypeMemberStart() { - var idToken; // Return true if we have the start of a signature member if (token() === 18 /* OpenParenToken */ || token() === 26 /* LessThanToken */) { return true; } + var idToken; // Eat up all modifiers, but hold on to the last one in case it is actually an identifier while (ts.isModifierKind(token())) { - idToken = token(); + idToken = true; nextToken(); } // Index signatures and computed property names are type members @@ -15934,7 +16766,7 @@ var ts; } // Try to get the first property-like token following all modifiers if (isLiteralPropertyName()) { - idToken = token(); + idToken = true; nextToken(); } // If we were able to get any potential identifier, check that it is @@ -15951,10 +16783,10 @@ var ts; } function parseTypeMember() { if (token() === 18 /* OpenParenToken */ || token() === 26 /* LessThanToken */) { - return parseSignatureMember(153 /* CallSignature */); + return parseSignatureMember(154 /* CallSignature */); } if (token() === 93 /* NewKeyword */ && lookAhead(isStartOfConstructSignature)) { - return parseSignatureMember(154 /* ConstructSignature */); + return parseSignatureMember(155 /* ConstructSignature */); } var fullStart = getNodePos(); var modifiers = parseModifiers(); @@ -15968,7 +16800,7 @@ var ts; return token() === 18 /* OpenParenToken */ || token() === 26 /* LessThanToken */; } function parseTypeLiteral() { - var node = createNode(161 /* TypeLiteral */); + var node = createNode(162 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -15991,14 +16823,14 @@ var ts; return token() === 20 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 91 /* InKeyword */; } function parseMappedTypeParameter() { - var node = createNode(143 /* TypeParameter */); + var node = createNode(144 /* TypeParameter */); node.name = parseIdentifier(); parseExpected(91 /* InKeyword */); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(170 /* MappedType */); + var node = createNode(171 /* MappedType */); parseExpected(16 /* OpenBraceToken */); node.readonlyToken = parseOptionalToken(130 /* ReadonlyKeyword */); parseExpected(20 /* OpenBracketToken */); @@ -16011,12 +16843,12 @@ var ts; return finishNode(node); } function parseTupleType() { - var node = createNode(163 /* TupleType */); + var node = createNode(164 /* TupleType */); node.elementTypes = parseBracketedList(20 /* TupleElementTypes */, parseType, 20 /* OpenBracketToken */, 21 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(166 /* ParenthesizedType */); + var node = createNode(167 /* ParenthesizedType */); parseExpected(18 /* OpenParenToken */); node.type = parseType(); parseExpected(19 /* CloseParenToken */); @@ -16024,7 +16856,7 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNode(kind); - if (kind === 159 /* ConstructorType */) { + if (kind === 160 /* ConstructorType */) { parseExpected(93 /* NewKeyword */); } fillSignature(35 /* EqualsGreaterThanToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, node); @@ -16035,7 +16867,7 @@ var ts; return token() === 22 /* DotToken */ ? undefined : node; } function parseLiteralTypeNode() { - var node = createNode(171 /* LiteralType */); + var node = createNode(172 /* LiteralType */); node.literal = parseSimpleUnaryExpression(); finishNode(node); return node; @@ -16046,12 +16878,13 @@ var ts; function parseNonArrayType() { switch (token()) { case 118 /* AnyKeyword */: - case 134 /* StringKeyword */: + case 135 /* StringKeyword */: case 132 /* NumberKeyword */: case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: - case 137 /* UndefinedKeyword */: + case 136 /* SymbolKeyword */: + case 138 /* UndefinedKeyword */: case 129 /* NeverKeyword */: + case 133 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReference(); @@ -16089,12 +16922,12 @@ var ts; function isStartOfType() { switch (token()) { case 118 /* AnyKeyword */: - case 134 /* StringKeyword */: + case 135 /* StringKeyword */: case 132 /* NumberKeyword */: case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: + case 136 /* SymbolKeyword */: case 104 /* VoidKeyword */: - case 137 /* UndefinedKeyword */: + case 138 /* UndefinedKeyword */: case 94 /* NullKeyword */: case 98 /* ThisKeyword */: case 102 /* TypeOfKeyword */: @@ -16102,11 +16935,14 @@ var ts; case 16 /* OpenBraceToken */: case 20 /* OpenBracketToken */: case 26 /* LessThanToken */: + case 48 /* BarToken */: + case 47 /* AmpersandToken */: case 93 /* NewKeyword */: case 9 /* StringLiteral */: case 8 /* NumericLiteral */: case 100 /* TrueKeyword */: case 85 /* FalseKeyword */: + case 133 /* ObjectKeyword */: return true; case 37 /* MinusToken */: return lookAhead(nextTokenIsNumericLiteral); @@ -16126,14 +16962,14 @@ var ts; var type = parseNonArrayType(); while (!scanner.hasPrecedingLineBreak() && parseOptional(20 /* OpenBracketToken */)) { if (isStartOfType()) { - var node = createNode(169 /* IndexedAccessType */, type.pos); + var node = createNode(170 /* IndexedAccessType */, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(21 /* CloseBracketToken */); type = finishNode(node); } else { - var node = createNode(162 /* ArrayType */, type.pos); + var node = createNode(163 /* ArrayType */, type.pos); node.elementType = type; parseExpected(21 /* CloseBracketToken */); type = finishNode(node); @@ -16142,7 +16978,7 @@ var ts; return type; } function parseTypeOperator(operator) { - var node = createNode(168 /* TypeOperator */); + var node = createNode(169 /* TypeOperator */); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); @@ -16156,6 +16992,7 @@ var ts; return parseArrayTypeOrHigher(); } function parseUnionOrIntersectionType(kind, parseConstituentType, operator) { + parseOptional(operator); var type = parseConstituentType(); if (token() === operator) { var types = createNodeArray([type], type.pos); @@ -16170,10 +17007,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(165 /* IntersectionType */, parseTypeOperatorOrHigher, 47 /* AmpersandToken */); + return parseUnionOrIntersectionType(166 /* IntersectionType */, parseTypeOperatorOrHigher, 47 /* AmpersandToken */); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(164 /* UnionType */, parseIntersectionTypeOrHigher, 48 /* BarToken */); + return parseUnionOrIntersectionType(165 /* UnionType */, parseIntersectionTypeOrHigher, 48 /* BarToken */); } function isStartOfFunctionType() { if (token() === 26 /* LessThanToken */) { @@ -16230,7 +17067,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(156 /* TypePredicate */, typePredicateVariable.pos); + var node = createNode(157 /* TypePredicate */, typePredicateVariable.pos); node.parameterName = typePredicateVariable; node.type = type; return finishNode(node); @@ -16249,14 +17086,14 @@ var ts; function parseType() { // The rules about 'yield' only apply to actual code/expression contexts. They don't // apply to 'type' contexts. So we disable these parameters here before moving on. - return doOutsideOfContext(655360 /* TypeExcludesFlags */, parseTypeWorker); + return doOutsideOfContext(20480 /* TypeExcludesFlags */, parseTypeWorker); } function parseTypeWorker() { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(158 /* FunctionType */); + return parseFunctionOrConstructorType(159 /* FunctionType */); } if (token() === 93 /* NewKeyword */) { - return parseFunctionOrConstructorType(159 /* ConstructorType */); + return parseFunctionOrConstructorType(160 /* ConstructorType */); } return parseUnionTypeOrHigher(); } @@ -16457,7 +17294,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(195 /* YieldExpression */); + var node = createNode(196 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -16479,13 +17316,13 @@ var ts; ts.Debug.assert(token() === 35 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(185 /* ArrowFunction */, asyncModifier.pos); + node = createNode(186 /* ArrowFunction */, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(185 /* ArrowFunction */, identifier.pos); + node = createNode(186 /* ArrowFunction */, identifier.pos); } - var parameter = createNode(144 /* Parameter */, identifier.pos); + var parameter = createNode(145 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos); @@ -16667,7 +17504,7 @@ var ts; return 0 /* False */; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(185 /* ArrowFunction */); + var node = createNode(186 /* ArrowFunction */); node.modifiers = parseModifiersForArrowFunction(); var isAsync = !!(ts.getModifierFlags(node) & 256 /* Async */); // Arrow functions are never generators. @@ -16733,7 +17570,7 @@ var ts; } // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - var node = createNode(193 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(194 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -16746,7 +17583,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 91 /* InKeyword */ || t === 140 /* OfKeyword */; + return t === 91 /* InKeyword */ || t === 141 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -16854,39 +17691,39 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(192 /* BinaryExpression */, left.pos); + var node = createNode(193 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(200 /* AsExpression */, left.pos); + var node = createNode(201 /* AsExpression */, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(190 /* PrefixUnaryExpression */); + var node = createNode(191 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(186 /* DeleteExpression */); + var node = createNode(187 /* DeleteExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(187 /* TypeOfExpression */); + var node = createNode(188 /* TypeOfExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(188 /* VoidExpression */); + var node = createNode(189 /* VoidExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -16902,7 +17739,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(189 /* AwaitExpression */); + var node = createNode(190 /* AwaitExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -16945,7 +17782,7 @@ var ts; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token() === 39 /* AsteriskAsteriskToken */) { var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); - if (simpleUnaryExpression.kind === 182 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 183 /* TypeAssertionExpression */) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -16990,6 +17827,7 @@ var ts; if (isAwaitExpression()) { return parseAwaitExpression(); } + // falls through default: return parseIncrementExpression(); } @@ -17023,7 +17861,7 @@ var ts; return false; } // We are in JSX context and the token is part of JSXElement. - // Fall through + // falls through default: return true; } @@ -17041,7 +17879,7 @@ var ts; */ function parseIncrementExpression() { if (token() === 42 /* PlusPlusToken */ || token() === 43 /* MinusMinusToken */) { - var node = createNode(190 /* PrefixUnaryExpression */); + var node = createNode(191 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -17054,7 +17892,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 42 /* PlusPlusToken */ || token() === 43 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(191 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(192 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -17158,7 +17996,7 @@ var ts; } // If we have seen "super" it must be followed by '(' or '.'. // If it wasn't then just try to parse out a '.' and report an error. - var node = createNode(177 /* PropertyAccessExpression */, expression.pos); + var node = createNode(178 /* PropertyAccessExpression */, expression.pos); node.expression = expression; parseExpectedToken(22 /* DotToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); @@ -17183,8 +18021,8 @@ var ts; function parseJsxElementOrSelfClosingElement(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElement(inExpressionContext); var result; - if (opening.kind === 248 /* JsxOpeningElement */) { - var node = createNode(246 /* JsxElement */, opening.pos); + if (opening.kind === 250 /* JsxOpeningElement */) { + var node = createNode(248 /* JsxElement */, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement.tagName); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -17194,7 +18032,7 @@ var ts; result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 247 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 249 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -17209,7 +18047,7 @@ var ts; var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElement(/*inExpressionContext*/ true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(192 /* BinaryExpression */, result.pos); + var badNode = createNode(193 /* BinaryExpression */, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -17252,23 +18090,31 @@ var ts; parseErrorAtPosition(openingTagName.pos, openingTagName.end - openingTagName.pos, ts.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, ts.getTextOfNodeFromSourceText(sourceText, openingTagName)); break; } + else if (token() === 7 /* ConflictMarkerTrivia */) { + break; + } result.push(parseJsxChild()); } result.end = scanner.getTokenPos(); parsingContext = saveParsingContext; return result; } + function parseJsxAttributes() { + var jsxAttributes = createNode(253 /* JsxAttributes */); + jsxAttributes.properties = parseList(13 /* JsxAttributes */, parseJsxAttribute); + return finishNode(jsxAttributes); + } function parseJsxOpeningOrSelfClosingElement(inExpressionContext) { var fullStart = scanner.getStartPos(); parseExpected(26 /* LessThanToken */); var tagName = parseJsxElementName(); - var attributes = parseList(13 /* JsxAttributes */, parseJsxAttribute); + var attributes = parseJsxAttributes(); var node; if (token() === 28 /* GreaterThanToken */) { // Closing tag, so scan the immediately-following text with the JSX scanning instead // of regular scanning to avoid treating illegal characters (e.g. '#') as immediate // scanning errors - node = createNode(248 /* JsxOpeningElement */, fullStart); + node = createNode(250 /* JsxOpeningElement */, fullStart); scanJsxText(); } else { @@ -17280,7 +18126,7 @@ var ts; parseExpected(28 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } - node = createNode(247 /* JsxSelfClosingElement */, fullStart); + node = createNode(249 /* JsxSelfClosingElement */, fullStart); } node.tagName = tagName; node.attributes = attributes; @@ -17296,7 +18142,7 @@ var ts; var expression = token() === 98 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); while (parseOptional(22 /* DotToken */)) { - var propertyAccess = createNode(177 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(178 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); expression = finishNode(propertyAccess); @@ -17304,9 +18150,10 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(252 /* JsxExpression */); + var node = createNode(255 /* JsxExpression */); parseExpected(16 /* OpenBraceToken */); if (token() !== 17 /* CloseBraceToken */) { + node.dotDotDotToken = parseOptionalToken(23 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); } if (inExpressionContext) { @@ -17323,7 +18170,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(250 /* JsxAttribute */); + var node = createNode(252 /* JsxAttribute */); node.name = parseIdentifierName(); if (token() === 57 /* EqualsToken */) { switch (scanJsxAttributeValue()) { @@ -17338,7 +18185,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(251 /* JsxSpreadAttribute */); + var node = createNode(254 /* JsxSpreadAttribute */); parseExpected(16 /* OpenBraceToken */); parseExpected(23 /* DotDotDotToken */); node.expression = parseExpression(); @@ -17346,7 +18193,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(249 /* JsxClosingElement */); + var node = createNode(251 /* JsxClosingElement */); parseExpected(27 /* LessThanSlashToken */); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -17359,7 +18206,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(182 /* TypeAssertionExpression */); + var node = createNode(183 /* TypeAssertionExpression */); parseExpected(26 /* LessThanToken */); node.type = parseType(); parseExpected(28 /* GreaterThanToken */); @@ -17370,7 +18217,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(22 /* DotToken */); if (dotToken) { - var propertyAccess = createNode(177 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(178 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); expression = finishNode(propertyAccess); @@ -17378,14 +18225,14 @@ var ts; } if (token() === 50 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(201 /* NonNullExpression */, expression.pos); + var nonNullExpression = createNode(202 /* NonNullExpression */, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; } // when in the [Decorator] context, we do not parse ElementAccess as it could be part of a ComputedPropertyName if (!inDecoratorContext() && parseOptional(20 /* OpenBracketToken */)) { - var indexedAccess = createNode(178 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(179 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; // It's not uncommon for a user to write: "new Type[]". // Check for that common pattern and report a better error message. @@ -17401,7 +18248,7 @@ var ts; continue; } if (token() === 12 /* NoSubstitutionTemplateLiteral */ || token() === 13 /* TemplateHead */) { - var tagExpression = createNode(181 /* TaggedTemplateExpression */, expression.pos); + var tagExpression = createNode(182 /* TaggedTemplateExpression */, expression.pos); tagExpression.tag = expression; tagExpression.template = token() === 12 /* NoSubstitutionTemplateLiteral */ ? parseLiteralNode() @@ -17424,7 +18271,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(179 /* CallExpression */, expression.pos); + var callExpr = createNode(180 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -17432,7 +18279,7 @@ var ts; continue; } else if (token() === 18 /* OpenParenToken */) { - var callExpr = createNode(179 /* CallExpression */, expression.pos); + var callExpr = createNode(180 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -17542,28 +18389,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(183 /* ParenthesizedExpression */); + var node = createNode(184 /* ParenthesizedExpression */); parseExpected(18 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(19 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(196 /* SpreadElement */); + var node = createNode(197 /* SpreadElement */); parseExpected(23 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 23 /* DotDotDotToken */ ? parseSpreadElement() : - token() === 25 /* CommaToken */ ? createNode(198 /* OmittedExpression */) : + token() === 25 /* CommaToken */ ? createNode(199 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(175 /* ArrayLiteralExpression */); + var node = createNode(176 /* ArrayLiteralExpression */); parseExpected(20 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -17574,10 +18421,10 @@ var ts; } function tryParseAccessorDeclaration(fullStart, decorators, modifiers) { if (parseContextualModifier(124 /* GetKeyword */)) { - return parseAccessorDeclaration(151 /* GetAccessor */, fullStart, decorators, modifiers); + return parseAccessorDeclaration(152 /* GetAccessor */, fullStart, decorators, modifiers); } - else if (parseContextualModifier(133 /* SetKeyword */)) { - return parseAccessorDeclaration(152 /* SetAccessor */, fullStart, decorators, modifiers); + else if (parseContextualModifier(134 /* SetKeyword */)) { + return parseAccessorDeclaration(153 /* SetAccessor */, fullStart, decorators, modifiers); } return undefined; } @@ -17585,7 +18432,7 @@ var ts; var fullStart = scanner.getStartPos(); var dotDotDotToken = parseOptionalToken(23 /* DotDotDotToken */); if (dotDotDotToken) { - var spreadElement = createNode(259 /* SpreadAssignment */, fullStart); + var spreadElement = createNode(262 /* SpreadAssignment */, fullStart); spreadElement.expression = parseAssignmentExpressionOrHigher(); return addJSDocComment(finishNode(spreadElement)); } @@ -17610,7 +18457,7 @@ var ts; // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 25 /* CommaToken */ || token() === 17 /* CloseBraceToken */ || token() === 57 /* EqualsToken */); if (isShorthandPropertyAssignment) { - var shorthandDeclaration = createNode(258 /* ShorthandPropertyAssignment */, fullStart); + var shorthandDeclaration = createNode(261 /* ShorthandPropertyAssignment */, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; var equalsToken = parseOptionalToken(57 /* EqualsToken */); @@ -17621,7 +18468,7 @@ var ts; return addJSDocComment(finishNode(shorthandDeclaration)); } else { - var propertyAssignment = createNode(257 /* PropertyAssignment */, fullStart); + var propertyAssignment = createNode(260 /* PropertyAssignment */, fullStart); propertyAssignment.modifiers = modifiers; propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; @@ -17631,7 +18478,7 @@ var ts; } } function parseObjectLiteralExpression() { - var node = createNode(176 /* ObjectLiteralExpression */); + var node = createNode(177 /* ObjectLiteralExpression */); parseExpected(16 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -17650,7 +18497,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(/*val*/ false); } - var node = createNode(184 /* FunctionExpression */); + var node = createNode(185 /* FunctionExpression */); node.modifiers = parseModifiers(); parseExpected(88 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(38 /* AsteriskToken */); @@ -17672,8 +18519,15 @@ var ts; return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(180 /* NewExpression */); + var fullStart = scanner.getStartPos(); parseExpected(93 /* NewKeyword */); + if (parseOptional(22 /* DotToken */)) { + var node_1 = createNode(203 /* MetaProperty */, fullStart); + node_1.keywordToken = 93 /* NewKeyword */; + node_1.name = parseIdentifierName(); + return finishNode(node_1); + } + var node = createNode(181 /* NewExpression */, fullStart); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); if (node.typeArguments || token() === 18 /* OpenParenToken */) { @@ -17683,7 +18537,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(204 /* Block */); + var node = createNode(206 /* Block */); if (parseExpected(16 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -17716,12 +18570,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(206 /* EmptyStatement */); + var node = createNode(208 /* EmptyStatement */); parseExpected(24 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(208 /* IfStatement */); + var node = createNode(210 /* IfStatement */); parseExpected(89 /* IfKeyword */); parseExpected(18 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -17731,7 +18585,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(209 /* DoStatement */); + var node = createNode(211 /* DoStatement */); parseExpected(80 /* DoKeyword */); node.statement = parseStatement(); parseExpected(105 /* WhileKeyword */); @@ -17746,7 +18600,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(210 /* WhileStatement */); + var node = createNode(212 /* WhileStatement */); parseExpected(105 /* WhileKeyword */); parseExpected(18 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -17757,6 +18611,7 @@ var ts; function parseForOrForInOrForOfStatement() { var pos = getNodePos(); parseExpected(87 /* ForKeyword */); + var awaitToken = parseOptionalToken(120 /* AwaitKeyword */); parseExpected(18 /* OpenParenToken */); var initializer = undefined; if (token() !== 24 /* SemicolonToken */) { @@ -17768,22 +18623,23 @@ var ts; } } var forOrForInOrForOfStatement; - if (parseOptional(91 /* InKeyword */)) { - var forInStatement = createNode(212 /* ForInStatement */, pos); - forInStatement.initializer = initializer; - forInStatement.expression = allowInAnd(parseExpression); - parseExpected(19 /* CloseParenToken */); - forOrForInOrForOfStatement = forInStatement; - } - else if (parseOptional(140 /* OfKeyword */)) { - var forOfStatement = createNode(213 /* ForOfStatement */, pos); + if (awaitToken ? parseExpected(141 /* OfKeyword */) : parseOptional(141 /* OfKeyword */)) { + var forOfStatement = createNode(215 /* ForOfStatement */, pos); + forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(19 /* CloseParenToken */); forOrForInOrForOfStatement = forOfStatement; } + else if (parseOptional(91 /* InKeyword */)) { + var forInStatement = createNode(214 /* ForInStatement */, pos); + forInStatement.initializer = initializer; + forInStatement.expression = allowInAnd(parseExpression); + parseExpected(19 /* CloseParenToken */); + forOrForInOrForOfStatement = forInStatement; + } else { - var forStatement = createNode(211 /* ForStatement */, pos); + var forStatement = createNode(213 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(24 /* SemicolonToken */); if (token() !== 24 /* SemicolonToken */ && token() !== 19 /* CloseParenToken */) { @@ -17801,7 +18657,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 215 /* BreakStatement */ ? 71 /* BreakKeyword */ : 76 /* ContinueKeyword */); + parseExpected(kind === 217 /* BreakStatement */ ? 71 /* BreakKeyword */ : 76 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -17809,7 +18665,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(216 /* ReturnStatement */); + var node = createNode(218 /* ReturnStatement */); parseExpected(95 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -17818,7 +18674,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(217 /* WithStatement */); + var node = createNode(219 /* WithStatement */); parseExpected(106 /* WithKeyword */); parseExpected(18 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -17827,7 +18683,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(253 /* CaseClause */); + var node = createNode(256 /* CaseClause */); parseExpected(72 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(55 /* ColonToken */); @@ -17835,7 +18691,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(254 /* DefaultClause */); + var node = createNode(257 /* DefaultClause */); parseExpected(78 /* DefaultKeyword */); parseExpected(55 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); @@ -17845,12 +18701,12 @@ var ts; return token() === 72 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(218 /* SwitchStatement */); + var node = createNode(220 /* SwitchStatement */); parseExpected(97 /* SwitchKeyword */); parseExpected(18 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(19 /* CloseParenToken */); - var caseBlock = createNode(232 /* CaseBlock */, scanner.getStartPos()); + var caseBlock = createNode(234 /* CaseBlock */, scanner.getStartPos()); parseExpected(16 /* OpenBraceToken */); caseBlock.clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(17 /* CloseBraceToken */); @@ -17865,7 +18721,7 @@ var ts; // directly as that might consume an expression on the following line. // We just return 'undefined' in that case. The actual error will be reported in the // grammar walker. - var node = createNode(220 /* ThrowStatement */); + var node = createNode(222 /* ThrowStatement */); parseExpected(99 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); @@ -17873,7 +18729,7 @@ var ts; } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(221 /* TryStatement */); + var node = createNode(223 /* TryStatement */); parseExpected(101 /* TryKeyword */); node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); node.catchClause = token() === 73 /* CatchKeyword */ ? parseCatchClause() : undefined; @@ -17886,7 +18742,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(256 /* CatchClause */); + var result = createNode(259 /* CatchClause */); parseExpected(73 /* CatchKeyword */); if (parseExpected(18 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); @@ -17896,7 +18752,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(222 /* DebuggerStatement */); + var node = createNode(224 /* DebuggerStatement */); parseExpected(77 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -17908,13 +18764,13 @@ var ts; var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); if (expression.kind === 70 /* Identifier */ && parseOptional(55 /* ColonToken */)) { - var labeledStatement = createNode(219 /* LabeledStatement */, fullStart); + var labeledStatement = createNode(221 /* LabeledStatement */, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return addJSDocComment(finishNode(labeledStatement)); } else { - var expressionStatement = createNode(207 /* ExpressionStatement */, fullStart); + var expressionStatement = createNode(209 /* ExpressionStatement */, fullStart); expressionStatement.expression = expression; parseSemicolon(); return addJSDocComment(finishNode(expressionStatement)); @@ -17924,6 +18780,10 @@ var ts; nextToken(); return ts.tokenIsIdentifierOrKeyword(token()) && !scanner.hasPrecedingLineBreak(); } + function nextTokenIsClassKeywordOnSameLine() { + nextToken(); + return token() === 74 /* ClassKeyword */ && !scanner.hasPrecedingLineBreak(); + } function nextTokenIsFunctionKeywordOnSameLine() { nextToken(); return token() === 88 /* FunctionKeyword */ && !scanner.hasPrecedingLineBreak(); @@ -17964,7 +18824,7 @@ var ts; // // could be legal, it would add complexity for very little gain. case 108 /* InterfaceKeyword */: - case 136 /* TypeKeyword */: + case 137 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); case 127 /* ModuleKeyword */: case 128 /* NamespaceKeyword */: @@ -17982,7 +18842,7 @@ var ts; return false; } continue; - case 139 /* GlobalKeyword */: + case 140 /* GlobalKeyword */: nextToken(); return token() === 16 /* OpenBraceToken */ || token() === 70 /* Identifier */ || token() === 83 /* ExportKeyword */; case 90 /* ImportKeyword */: @@ -18044,8 +18904,8 @@ var ts; case 108 /* InterfaceKeyword */: case 127 /* ModuleKeyword */: case 128 /* NamespaceKeyword */: - case 136 /* TypeKeyword */: - case 139 /* GlobalKeyword */: + case 137 /* TypeKeyword */: + case 140 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 113 /* PublicKeyword */: @@ -18095,9 +18955,9 @@ var ts; case 87 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 76 /* ContinueKeyword */: - return parseBreakOrContinueStatement(214 /* ContinueStatement */); + return parseBreakOrContinueStatement(216 /* ContinueStatement */); case 71 /* BreakKeyword */: - return parseBreakOrContinueStatement(215 /* BreakStatement */); + return parseBreakOrContinueStatement(217 /* BreakStatement */); case 95 /* ReturnKeyword */: return parseReturnStatement(); case 106 /* WithKeyword */: @@ -18117,7 +18977,7 @@ var ts; return parseDeclaration(); case 119 /* AsyncKeyword */: case 108 /* InterfaceKeyword */: - case 136 /* TypeKeyword */: + case 137 /* TypeKeyword */: case 127 /* ModuleKeyword */: case 128 /* NamespaceKeyword */: case 123 /* DeclareKeyword */: @@ -18131,7 +18991,7 @@ var ts; case 116 /* AbstractKeyword */: case 114 /* StaticKeyword */: case 130 /* ReadonlyKeyword */: - case 139 /* GlobalKeyword */: + case 140 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -18154,11 +19014,11 @@ var ts; return parseClassDeclaration(fullStart, decorators, modifiers); case 108 /* InterfaceKeyword */: return parseInterfaceDeclaration(fullStart, decorators, modifiers); - case 136 /* TypeKeyword */: + case 137 /* TypeKeyword */: return parseTypeAliasDeclaration(fullStart, decorators, modifiers); case 82 /* EnumKeyword */: return parseEnumDeclaration(fullStart, decorators, modifiers); - case 139 /* GlobalKeyword */: + case 140 /* GlobalKeyword */: case 127 /* ModuleKeyword */: case 128 /* NamespaceKeyword */: return parseModuleDeclaration(fullStart, decorators, modifiers); @@ -18179,7 +19039,7 @@ var ts; if (decorators || modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var node = createMissingNode(244 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var node = createMissingNode(246 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); node.pos = fullStart; node.decorators = decorators; node.modifiers = modifiers; @@ -18201,16 +19061,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token() === 25 /* CommaToken */) { - return createNode(198 /* OmittedExpression */); + return createNode(199 /* OmittedExpression */); } - var node = createNode(174 /* BindingElement */); + var node = createNode(175 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(23 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseBindingElementInitializer(/*inParameter*/ false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(174 /* BindingElement */); + var node = createNode(175 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(23 /* DotDotDotToken */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -18226,14 +19086,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(172 /* ObjectBindingPattern */); + var node = createNode(173 /* ObjectBindingPattern */); parseExpected(16 /* OpenBraceToken */); node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(17 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(173 /* ArrayBindingPattern */); + var node = createNode(174 /* ArrayBindingPattern */); parseExpected(20 /* OpenBracketToken */); node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(21 /* CloseBracketToken */); @@ -18252,7 +19112,7 @@ var ts; return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(223 /* VariableDeclaration */); + var node = createNode(225 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token())) { @@ -18261,7 +19121,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(224 /* VariableDeclarationList */); + var node = createNode(226 /* VariableDeclarationList */); switch (token()) { case 103 /* VarKeyword */: break; @@ -18284,7 +19144,7 @@ var ts; // So we need to look ahead to determine if 'of' should be treated as a keyword in // this context. // The checker will then give an error that there is an empty declaration list. - if (token() === 140 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 141 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -18299,7 +19159,7 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 19 /* CloseParenToken */; } function parseVariableStatement(fullStart, decorators, modifiers) { - var node = createNode(205 /* VariableStatement */, fullStart); + var node = createNode(207 /* VariableStatement */, fullStart); node.decorators = decorators; node.modifiers = modifiers; node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); @@ -18307,7 +19167,7 @@ var ts; return addJSDocComment(finishNode(node)); } function parseFunctionDeclaration(fullStart, decorators, modifiers) { - var node = createNode(225 /* FunctionDeclaration */, fullStart); + var node = createNode(227 /* FunctionDeclaration */, fullStart); node.decorators = decorators; node.modifiers = modifiers; parseExpected(88 /* FunctionKeyword */); @@ -18320,7 +19180,7 @@ var ts; return addJSDocComment(finishNode(node)); } function parseConstructorDeclaration(pos, decorators, modifiers) { - var node = createNode(150 /* Constructor */, pos); + var node = createNode(151 /* Constructor */, pos); node.decorators = decorators; node.modifiers = modifiers; parseExpected(122 /* ConstructorKeyword */); @@ -18329,7 +19189,7 @@ var ts; return addJSDocComment(finishNode(node)); } function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { - var method = createNode(149 /* MethodDeclaration */, fullStart); + var method = createNode(150 /* MethodDeclaration */, fullStart); method.decorators = decorators; method.modifiers = modifiers; method.asteriskToken = asteriskToken; @@ -18342,7 +19202,7 @@ var ts; return addJSDocComment(finishNode(method)); } function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) { - var property = createNode(147 /* PropertyDeclaration */, fullStart); + var property = createNode(148 /* PropertyDeclaration */, fullStart); property.decorators = decorators; property.modifiers = modifiers; property.name = name; @@ -18359,7 +19219,7 @@ var ts; // The checker may still error in the static case to explicitly disallow the yield expression. property.initializer = ts.hasModifier(property, 32 /* Static */) ? allowInAnd(parseNonParameterInitializer) - : doOutsideOfContext(131072 /* YieldContext */ | 65536 /* DisallowInContext */, parseNonParameterInitializer); + : doOutsideOfContext(4096 /* YieldContext */ | 2048 /* DisallowInContext */, parseNonParameterInitializer); parseSemicolon(); return addJSDocComment(finishNode(property)); } @@ -18435,7 +19295,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 133 /* SetKeyword */ || idToken === 124 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 134 /* SetKeyword */ || idToken === 124 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -18465,7 +19325,7 @@ var ts; if (!parseOptional(56 /* AtToken */)) { break; } - var decorator = createNode(145 /* Decorator */, decoratorStart); + var decorator = createNode(146 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); if (!decorators) { @@ -18531,7 +19391,7 @@ var ts; } function parseClassElement() { if (token() === 24 /* SemicolonToken */) { - var result = createNode(203 /* SemicolonClassElement */); + var result = createNode(205 /* SemicolonClassElement */); nextToken(); return finishNode(result); } @@ -18559,8 +19419,8 @@ var ts; } if (decorators || modifiers) { // treat this as a property declaration with a missing name. - var name_13 = createMissingNode(70 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); - return parsePropertyDeclaration(fullStart, decorators, modifiers, name_13, /*questionToken*/ undefined); + var name = createMissingNode(70 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + return parsePropertyDeclaration(fullStart, decorators, modifiers, name, /*questionToken*/ undefined); } // 'isClassMemberStart' should have hinted not to attempt parsing. ts.Debug.fail("Should not have attempted to parse class member declaration."); @@ -18569,10 +19429,10 @@ var ts; return parseClassDeclarationOrExpression( /*fullStart*/ scanner.getStartPos(), /*decorators*/ undefined, - /*modifiers*/ undefined, 197 /* ClassExpression */); + /*modifiers*/ undefined, 198 /* ClassExpression */); } function parseClassDeclaration(fullStart, decorators, modifiers) { - return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 226 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 228 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { var node = createNode(kind, fullStart); @@ -18615,9 +19475,10 @@ var ts; return undefined; } function parseHeritageClause() { - if (token() === 84 /* ExtendsKeyword */ || token() === 107 /* ImplementsKeyword */) { - var node = createNode(255 /* HeritageClause */); - node.token = token(); + var tok = token(); + if (tok === 84 /* ExtendsKeyword */ || tok === 107 /* ImplementsKeyword */) { + var node = createNode(258 /* HeritageClause */); + node.token = tok; nextToken(); node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); return finishNode(node); @@ -18625,7 +19486,7 @@ var ts; return undefined; } function parseExpressionWithTypeArguments() { - var node = createNode(199 /* ExpressionWithTypeArguments */); + var node = createNode(200 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); if (token() === 26 /* LessThanToken */) { node.typeArguments = parseBracketedList(19 /* TypeArguments */, parseType, 26 /* LessThanToken */, 28 /* GreaterThanToken */); @@ -18639,7 +19500,7 @@ var ts; return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(fullStart, decorators, modifiers) { - var node = createNode(227 /* InterfaceDeclaration */, fullStart); + var node = createNode(229 /* InterfaceDeclaration */, fullStart); node.decorators = decorators; node.modifiers = modifiers; parseExpected(108 /* InterfaceKeyword */); @@ -18650,10 +19511,10 @@ var ts; return addJSDocComment(finishNode(node)); } function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { - var node = createNode(228 /* TypeAliasDeclaration */, fullStart); + var node = createNode(230 /* TypeAliasDeclaration */, fullStart); node.decorators = decorators; node.modifiers = modifiers; - parseExpected(136 /* TypeKeyword */); + parseExpected(137 /* TypeKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(57 /* EqualsToken */); @@ -18666,13 +19527,13 @@ var ts; // ConstantEnumMemberSection, which starts at the beginning of an enum declaration // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNode(260 /* EnumMember */, scanner.getStartPos()); + var node = createNode(263 /* EnumMember */, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return addJSDocComment(finishNode(node)); } function parseEnumDeclaration(fullStart, decorators, modifiers) { - var node = createNode(229 /* EnumDeclaration */, fullStart); + var node = createNode(231 /* EnumDeclaration */, fullStart); node.decorators = decorators; node.modifiers = modifiers; parseExpected(82 /* EnumKeyword */); @@ -18687,7 +19548,7 @@ var ts; return addJSDocComment(finishNode(node)); } function parseModuleBlock() { - var node = createNode(231 /* ModuleBlock */, scanner.getStartPos()); + var node = createNode(233 /* ModuleBlock */, scanner.getStartPos()); if (parseExpected(16 /* OpenBraceToken */)) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(17 /* CloseBraceToken */); @@ -18698,7 +19559,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags) { - var node = createNode(230 /* ModuleDeclaration */, fullStart); + var node = createNode(232 /* ModuleDeclaration */, fullStart); // If we are parsing a dotted namespace name, we want to // propagate the 'Namespace' flag across the names if set. var namespaceFlag = flags & 16 /* Namespace */; @@ -18712,10 +19573,10 @@ var ts; return addJSDocComment(finishNode(node)); } function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { - var node = createNode(230 /* ModuleDeclaration */, fullStart); + var node = createNode(232 /* ModuleDeclaration */, fullStart); node.decorators = decorators; node.modifiers = modifiers; - if (token() === 139 /* GlobalKeyword */) { + if (token() === 140 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation node.name = parseIdentifier(); node.flags |= 512 /* GlobalAugmentation */; @@ -18733,7 +19594,7 @@ var ts; } function parseModuleDeclaration(fullStart, decorators, modifiers) { var flags = 0; - if (token() === 139 /* GlobalKeyword */) { + if (token() === 140 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers); } @@ -18759,7 +19620,7 @@ var ts; return nextToken() === 40 /* SlashToken */; } function parseNamespaceExportDeclaration(fullStart, decorators, modifiers) { - var exportDeclaration = createNode(233 /* NamespaceExportDeclaration */, fullStart); + var exportDeclaration = createNode(235 /* NamespaceExportDeclaration */, fullStart); exportDeclaration.decorators = decorators; exportDeclaration.modifiers = modifiers; parseExpected(117 /* AsKeyword */); @@ -18774,22 +19635,12 @@ var ts; var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token() !== 25 /* CommaToken */ && token() !== 138 /* FromKeyword */) { - // ImportEquals declaration of type: - // import x = require("mod"); or - // import x = M.x; - var importEqualsDeclaration = createNode(234 /* ImportEqualsDeclaration */, fullStart); - importEqualsDeclaration.decorators = decorators; - importEqualsDeclaration.modifiers = modifiers; - importEqualsDeclaration.name = identifier; - parseExpected(57 /* EqualsToken */); - importEqualsDeclaration.moduleReference = parseModuleReference(); - parseSemicolon(); - return addJSDocComment(finishNode(importEqualsDeclaration)); + if (token() !== 25 /* CommaToken */ && token() !== 139 /* FromKeyword */) { + return parseImportEqualsDeclaration(fullStart, decorators, modifiers, identifier); } } // Import statement - var importDeclaration = createNode(235 /* ImportDeclaration */, fullStart); + var importDeclaration = createNode(237 /* ImportDeclaration */, fullStart); importDeclaration.decorators = decorators; importDeclaration.modifiers = modifiers; // ImportDeclaration: @@ -18799,12 +19650,22 @@ var ts; token() === 38 /* AsteriskToken */ || token() === 16 /* OpenBraceToken */) { importDeclaration.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(138 /* FromKeyword */); + parseExpected(139 /* FromKeyword */); } importDeclaration.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); return finishNode(importDeclaration); } + function parseImportEqualsDeclaration(fullStart, decorators, modifiers, identifier) { + var importEqualsDeclaration = createNode(236 /* ImportEqualsDeclaration */, fullStart); + importEqualsDeclaration.decorators = decorators; + importEqualsDeclaration.modifiers = modifiers; + importEqualsDeclaration.name = identifier; + parseExpected(57 /* EqualsToken */); + importEqualsDeclaration.moduleReference = parseModuleReference(); + parseSemicolon(); + return addJSDocComment(finishNode(importEqualsDeclaration)); + } function parseImportClause(identifier, fullStart) { // ImportClause: // ImportedDefaultBinding @@ -18812,7 +19673,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(236 /* ImportClause */, fullStart); + var importClause = createNode(238 /* ImportClause */, fullStart); if (identifier) { // ImportedDefaultBinding: // ImportedBinding @@ -18822,7 +19683,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(25 /* CommaToken */)) { - importClause.namedBindings = token() === 38 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(238 /* NamedImports */); + importClause.namedBindings = token() === 38 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(240 /* NamedImports */); } return finishNode(importClause); } @@ -18832,7 +19693,7 @@ var ts; : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { - var node = createNode(245 /* ExternalModuleReference */); + var node = createNode(247 /* ExternalModuleReference */); parseExpected(131 /* RequireKeyword */); parseExpected(18 /* OpenParenToken */); node.expression = parseModuleSpecifier(); @@ -18855,7 +19716,7 @@ var ts; function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(237 /* NamespaceImport */); + var namespaceImport = createNode(239 /* NamespaceImport */); parseExpected(38 /* AsteriskToken */); parseExpected(117 /* AsKeyword */); namespaceImport.name = parseIdentifier(); @@ -18870,14 +19731,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(22 /* ImportOrExportSpecifiers */, kind === 238 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 16 /* OpenBraceToken */, 17 /* CloseBraceToken */); + node.elements = parseBracketedList(22 /* ImportOrExportSpecifiers */, kind === 240 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 16 /* OpenBraceToken */, 17 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(243 /* ExportSpecifier */); + return parseImportOrExportSpecifier(245 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(239 /* ImportSpecifier */); + return parseImportOrExportSpecifier(241 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -18902,27 +19763,27 @@ var ts; else { node.name = identifierName; } - if (kind === 239 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 241 /* ImportSpecifier */ && checkIdentifierIsKeyword) { // Report error identifier expected parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(fullStart, decorators, modifiers) { - var node = createNode(241 /* ExportDeclaration */, fullStart); + var node = createNode(243 /* ExportDeclaration */, fullStart); node.decorators = decorators; node.modifiers = modifiers; if (parseOptional(38 /* AsteriskToken */)) { - parseExpected(138 /* FromKeyword */); + parseExpected(139 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(242 /* NamedExports */); + node.exportClause = parseNamedImportsOrExports(244 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. - if (token() === 138 /* FromKeyword */ || (token() === 9 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(138 /* FromKeyword */); + if (token() === 139 /* FromKeyword */ || (token() === 9 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(139 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -18930,7 +19791,7 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, decorators, modifiers) { - var node = createNode(240 /* ExportAssignment */, fullStart); + var node = createNode(242 /* ExportAssignment */, fullStart); node.decorators = decorators; node.modifiers = modifiers; if (parseOptional(57 /* EqualsToken */)) { @@ -18949,6 +19810,7 @@ var ts; var typeReferenceDirectives = []; var amdDependencies = []; var amdModuleName; + var checkJsDirective = undefined; // Keep scanning all the leading trivia in the file until we get to something that // isn't trivia. Any single line comment will be analyzed to see if it is a // reference comment. @@ -18962,7 +19824,11 @@ var ts; break; } } - var range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos(), kind: triviaScanner.getToken() }; + var range = { + kind: triviaScanner.getToken(), + pos: triviaScanner.getTokenPos(), + end: triviaScanner.getTextPos(), + }; var comment = sourceText.substring(range.pos, range.end); var referencePathMatchResult = ts.getFileReferenceFromReferencePath(comment, range); if (referencePathMatchResult) { @@ -19002,20 +19868,30 @@ var ts; amdDependencies.push(amdDependency); } } + var checkJsDirectiveRegEx = /^\/\/\/?\s*(@ts-check|@ts-nocheck)\s*$/gim; + var checkJsDirectiveMatchResult = checkJsDirectiveRegEx.exec(comment); + if (checkJsDirectiveMatchResult) { + checkJsDirective = { + enabled: ts.compareStrings(checkJsDirectiveMatchResult[1], "@ts-check", /*ignoreCase*/ true) === 0 /* EqualTo */, + end: range.end, + pos: range.pos + }; + } } } sourceFile.referencedFiles = referencedFiles; sourceFile.typeReferenceDirectives = typeReferenceDirectives; sourceFile.amdDependencies = amdDependencies; sourceFile.moduleName = amdModuleName; + sourceFile.checkJsDirective = checkJsDirective; } function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return ts.hasModifier(node, 1 /* Export */) - || node.kind === 234 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 245 /* ExternalModuleReference */ - || node.kind === 235 /* ImportDeclaration */ - || node.kind === 240 /* ExportAssignment */ - || node.kind === 241 /* ExportDeclaration */ + || node.kind === 236 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 247 /* ExternalModuleReference */ + || node.kind === 237 /* ImportDeclaration */ + || node.kind === 242 /* ExportAssignment */ + || node.kind === 243 /* ExportDeclaration */ ? node : undefined; }); @@ -19090,7 +19966,7 @@ var ts; // Parses out a JSDoc type expression. /* @internal */ function parseJSDocTypeExpression() { - var result = createNode(262 /* JSDocTypeExpression */, scanner.getTokenPos()); + var result = createNode(266 /* JSDocTypeExpression */, scanner.getTokenPos()); parseExpected(16 /* OpenBraceToken */); result.type = parseJSDocTopLevelType(); parseExpected(17 /* CloseBraceToken */); @@ -19101,12 +19977,12 @@ var ts; function parseJSDocTopLevelType() { var type = parseJSDocType(); if (token() === 48 /* BarToken */) { - var unionType = createNode(266 /* JSDocUnionType */, type.pos); + var unionType = createNode(270 /* JSDocUnionType */, type.pos); unionType.types = parseJSDocTypeList(type); type = finishNode(unionType); } if (token() === 57 /* EqualsToken */) { - var optionalType = createNode(273 /* JSDocOptionalType */, type.pos); + var optionalType = createNode(277 /* JSDocOptionalType */, type.pos); nextToken(); optionalType.type = type; type = finishNode(optionalType); @@ -19117,20 +19993,20 @@ var ts; var type = parseBasicTypeExpression(); while (true) { if (token() === 20 /* OpenBracketToken */) { - var arrayType = createNode(265 /* JSDocArrayType */, type.pos); + var arrayType = createNode(269 /* JSDocArrayType */, type.pos); arrayType.elementType = type; nextToken(); parseExpected(21 /* CloseBracketToken */); type = finishNode(arrayType); } else if (token() === 54 /* QuestionToken */) { - var nullableType = createNode(268 /* JSDocNullableType */, type.pos); + var nullableType = createNode(272 /* JSDocNullableType */, type.pos); nullableType.type = type; nextToken(); type = finishNode(nullableType); } else if (token() === 50 /* ExclamationToken */) { - var nonNullableType = createNode(269 /* JSDocNonNullableType */, type.pos); + var nonNullableType = createNode(273 /* JSDocNonNullableType */, type.pos); nonNullableType.type = type; nextToken(); type = finishNode(nonNullableType); @@ -19164,14 +20040,15 @@ var ts; case 98 /* ThisKeyword */: return parseJSDocThisType(); case 118 /* AnyKeyword */: - case 134 /* StringKeyword */: + case 135 /* StringKeyword */: case 132 /* NumberKeyword */: case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: + case 136 /* SymbolKeyword */: case 104 /* VoidKeyword */: case 94 /* NullKeyword */: - case 137 /* UndefinedKeyword */: + case 138 /* UndefinedKeyword */: case 129 /* NeverKeyword */: + case 133 /* ObjectKeyword */: return parseTokenNode(); case 9 /* StringLiteral */: case 8 /* NumericLiteral */: @@ -19182,27 +20059,27 @@ var ts; return parseJSDocTypeReference(); } function parseJSDocThisType() { - var result = createNode(277 /* JSDocThisType */); + var result = createNode(281 /* JSDocThisType */); nextToken(); parseExpected(55 /* ColonToken */); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocConstructorType() { - var result = createNode(276 /* JSDocConstructorType */); + var result = createNode(280 /* JSDocConstructorType */); nextToken(); parseExpected(55 /* ColonToken */); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocVariadicType() { - var result = createNode(275 /* JSDocVariadicType */); + var result = createNode(279 /* JSDocVariadicType */); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocFunctionType() { - var result = createNode(274 /* JSDocFunctionType */); + var result = createNode(278 /* JSDocFunctionType */); nextToken(); parseExpected(18 /* OpenParenToken */); result.parameters = parseDelimitedList(23 /* JSDocFunctionParameters */, parseJSDocParameter); @@ -19215,7 +20092,7 @@ var ts; return finishNode(result); } function parseJSDocParameter() { - var parameter = createNode(144 /* Parameter */); + var parameter = createNode(145 /* Parameter */); parameter.type = parseJSDocType(); if (parseOptional(57 /* EqualsToken */)) { // TODO(rbuckton): Can this be changed to SyntaxKind.QuestionToken? @@ -19224,7 +20101,7 @@ var ts; return finishNode(parameter); } function parseJSDocTypeReference() { - var result = createNode(272 /* JSDocTypeReference */); + var result = createNode(276 /* JSDocTypeReference */); result.name = parseSimplePropertyName(); if (token() === 26 /* LessThanToken */) { result.typeArguments = parseTypeArguments(); @@ -19259,24 +20136,24 @@ var ts; } } function parseQualifiedName(left) { - var result = createNode(141 /* QualifiedName */, left.pos); + var result = createNode(142 /* QualifiedName */, left.pos); result.left = left; result.right = parseIdentifierName(); return finishNode(result); } function parseJSDocRecordType() { - var result = createNode(270 /* JSDocRecordType */); + var result = createNode(274 /* JSDocRecordType */); result.literal = parseTypeLiteral(); return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(269 /* JSDocNonNullableType */); + var result = createNode(273 /* JSDocNonNullableType */); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocTupleType() { - var result = createNode(267 /* JSDocTupleType */); + var result = createNode(271 /* JSDocTupleType */); nextToken(); result.types = parseDelimitedList(26 /* JSDocTupleTypes */, parseJSDocType); checkForTrailingComma(result.types); @@ -19290,7 +20167,7 @@ var ts; } } function parseJSDocUnionType() { - var result = createNode(266 /* JSDocUnionType */); + var result = createNode(270 /* JSDocUnionType */); nextToken(); result.types = parseJSDocTypeList(parseJSDocType()); parseExpected(19 /* CloseParenToken */); @@ -19306,12 +20183,12 @@ var ts; return types; } function parseJSDocAllType() { - var result = createNode(263 /* JSDocAllType */); + var result = createNode(267 /* JSDocAllType */); nextToken(); return finishNode(result); } function parseJSDocLiteralType() { - var result = createNode(288 /* JSDocLiteralType */); + var result = createNode(292 /* JSDocLiteralType */); result.literal = parseLiteralTypeNode(); return finishNode(result); } @@ -19334,11 +20211,11 @@ var ts; token() === 28 /* GreaterThanToken */ || token() === 57 /* EqualsToken */ || token() === 48 /* BarToken */) { - var result = createNode(264 /* JSDocUnknownType */, pos); + var result = createNode(268 /* JSDocUnknownType */, pos); return finishNode(result); } else { - var result = createNode(268 /* JSDocNullableType */, pos); + var result = createNode(272 /* JSDocNullableType */, pos); result.type = parseJSDocType(); return finishNode(result); } @@ -19437,7 +20314,7 @@ var ts; break; case 38 /* AsteriskToken */: var asterisk = scanner.getTokenText(); - if (state === 1 /* SawAsterisk */) { + if (state === 1 /* SawAsterisk */ || state === 2 /* SavingComments */) { // If we've already seen an asterisk, then we can no longer parse a tag on this line state = 2 /* SavingComments */; pushComment(asterisk); @@ -19458,7 +20335,10 @@ var ts; case 5 /* WhitespaceTrivia */: // only collect whitespace if we're already saving comments or have just crossed the comment indent margin var whitespace = scanner.getTokenText(); - if (state === 2 /* SavingComments */ || margin !== undefined && indent + whitespace.length > margin) { + if (state === 2 /* SavingComments */) { + comments.push(whitespace); + } + else if (margin !== undefined && indent + whitespace.length > margin) { comments.push(whitespace.slice(margin - indent - 1)); } indent += whitespace.length; @@ -19466,6 +20346,8 @@ var ts; case 1 /* EndOfFileToken */: break; default: + // anything other than whitespace or asterisk at the beginning of the line starts the comment text + state = 2 /* SavingComments */; pushComment(scanner.getTokenText()); break; } @@ -19498,7 +20380,7 @@ var ts; content.charCodeAt(start + 3) !== 42 /* asterisk */; } function createJSDocComment() { - var result = createNode(278 /* JSDocComment */, start); + var result = createNode(282 /* JSDocComment */, start); result.tags = tags; result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -19556,7 +20438,7 @@ var ts; } function parseTagComments(indent) { var comments = []; - var state = 1 /* SawAsterisk */; + var state = 0 /* BeginningOfLine */; var margin; function pushComment(text) { if (!margin) { @@ -19597,7 +20479,8 @@ var ts; indent += scanner.getTokenText().length; break; } - // FALLTHROUGH otherwise to record the * as a comment + // record the * as a comment + // falls through default: state = 2 /* SavingComments */; // leading identifiers start recording as well pushComment(scanner.getTokenText()); @@ -19614,7 +20497,7 @@ var ts; return comments; } function parseUnknownTag(atToken, tagName) { - var result = createNode(279 /* JSDocTag */, atToken.pos); + var result = createNode(283 /* JSDocTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; return finishNode(result); @@ -19671,7 +20554,7 @@ var ts; if (!typeExpression) { typeExpression = tryParseTypeExpression(); } - var result = createNode(281 /* JSDocParameterTag */, atToken.pos); + var result = createNode(285 /* JSDocParameterTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.preParameterName = preName; @@ -19682,20 +20565,20 @@ var ts; return finishNode(result); } function parseReturnTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 282 /* JSDocReturnTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 286 /* JSDocReturnTag */; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(282 /* JSDocReturnTag */, atToken.pos); + var result = createNode(286 /* JSDocReturnTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); } function parseTypeTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 283 /* JSDocTypeTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 287 /* JSDocTypeTag */; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(283 /* JSDocTypeTag */, atToken.pos); + var result = createNode(287 /* JSDocTypeTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); @@ -19710,7 +20593,7 @@ var ts; parseErrorAtPosition(scanner.getStartPos(), /*length*/ 0, ts.Diagnostics.Identifier_expected); return undefined; } - var result = createNode(286 /* JSDocPropertyTag */, atToken.pos); + var result = createNode(290 /* JSDocPropertyTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.name = name; @@ -19719,7 +20602,7 @@ var ts; } function parseAugmentsTag(atToken, tagName) { var typeExpression = tryParseTypeExpression(); - var result = createNode(280 /* JSDocAugmentsTag */, atToken.pos); + var result = createNode(284 /* JSDocAugmentsTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = typeExpression; @@ -19728,25 +20611,30 @@ var ts; function parseTypedefTag(atToken, tagName) { var typeExpression = tryParseTypeExpression(); skipWhitespace(); - var typedefTag = createNode(285 /* JSDocTypedefTag */, atToken.pos); + var typedefTag = createNode(289 /* JSDocTypedefTag */, atToken.pos); typedefTag.atToken = atToken; typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(/*flags*/ 0); if (typedefTag.fullName) { var rightNode = typedefTag.fullName; - while (rightNode.kind !== 70 /* Identifier */) { + while (true) { + if (rightNode.kind === 70 /* Identifier */ || !rightNode.body) { + // if node is identifier - use it as name + // otherwise use name of the rightmost part that we were able to parse + typedefTag.name = rightNode.kind === 70 /* Identifier */ ? rightNode : rightNode.name; + break; + } rightNode = rightNode.body; } - typedefTag.name = rightNode; } typedefTag.typeExpression = typeExpression; skipWhitespace(); if (typeExpression) { - if (typeExpression.type.kind === 272 /* JSDocTypeReference */) { + if (typeExpression.type.kind === 276 /* JSDocTypeReference */) { var jsDocTypeReference = typeExpression.type; if (jsDocTypeReference.name.kind === 70 /* Identifier */) { - var name_14 = jsDocTypeReference.name; - if (name_14.text === "Object") { + var name = jsDocTypeReference.name; + if (name.text === "Object") { typedefTag.jsDocTypeLiteral = scanChildTags(); } } @@ -19760,7 +20648,7 @@ var ts; } return finishNode(typedefTag); function scanChildTags() { - var jsDocTypeLiteral = createNode(287 /* JSDocTypeLiteral */, scanner.getStartPos()); + var jsDocTypeLiteral = createNode(291 /* JSDocTypeLiteral */, scanner.getStartPos()); var resumePos = scanner.getStartPos(); var canParseTag = true; var seenAsterisk = false; @@ -19790,6 +20678,7 @@ var ts; break; case 70 /* Identifier */: canParseTag = false; + break; case 1 /* EndOfFileToken */: break; } @@ -19801,7 +20690,7 @@ var ts; var pos = scanner.getTokenPos(); var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (typeNameOrNamespaceName && parseOptional(22 /* DotToken */)) { - var jsDocNamespaceNode = createNode(230 /* ModuleDeclaration */, pos); + var jsDocNamespaceNode = createNode(232 /* ModuleDeclaration */, pos); jsDocNamespaceNode.flags |= flags; jsDocNamespaceNode.name = typeNameOrNamespaceName; jsDocNamespaceNode.body = parseJSDocTypeNameWithNamespace(4 /* NestedNamespace */); @@ -19847,20 +20736,20 @@ var ts; return false; } function parseTemplateTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 284 /* JSDocTemplateTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 288 /* JSDocTemplateTag */; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } // Type parameter list looks like '@template T,U,V' var typeParameters = createNodeArray(); while (true) { - var name_15 = parseJSDocIdentifierName(); + var name = parseJSDocIdentifierName(); skipWhitespace(); - if (!name_15) { + if (!name) { parseErrorAtPosition(scanner.getStartPos(), 0, ts.Diagnostics.Identifier_expected); return undefined; } - var typeParameter = createNode(143 /* TypeParameter */, name_15.pos); - typeParameter.name = name_15; + var typeParameter = createNode(144 /* TypeParameter */, name.pos); + typeParameter.name = name; finishNode(typeParameter); typeParameters.push(typeParameter); if (token() === 25 /* CommaToken */) { @@ -19871,7 +20760,7 @@ var ts; break; } } - var result = createNode(284 /* JSDocTemplateTag */, atToken.pos); + var result = createNode(288 /* JSDocTemplateTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeParameters = typeParameters; @@ -20345,7 +21234,7 @@ var ts; if (position >= array.pos && position < array.end) { // position was in this array. Search through this array to see if we find a // viable element. - for (var i = 0, n = array.length; i < n; i++) { + for (var i = 0; i < array.length; i++) { var child = array[i]; if (child) { if (child.pos === position) { @@ -20391,16 +21280,16 @@ var ts; function getModuleInstanceState(node) { // A module is uninstantiated if it contains only // 1. interface declarations, type alias declarations - if (node.kind === 227 /* InterfaceDeclaration */ || node.kind === 228 /* TypeAliasDeclaration */) { + if (node.kind === 229 /* InterfaceDeclaration */ || node.kind === 230 /* TypeAliasDeclaration */) { return 0 /* NonInstantiated */; } else if (ts.isConstEnumDeclaration(node)) { return 2 /* ConstEnumOnly */; } - else if ((node.kind === 235 /* ImportDeclaration */ || node.kind === 234 /* ImportEqualsDeclaration */) && !(ts.hasModifier(node, 1 /* Export */))) { + else if ((node.kind === 237 /* ImportDeclaration */ || node.kind === 236 /* ImportEqualsDeclaration */) && !(ts.hasModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } - else if (node.kind === 231 /* ModuleBlock */) { + else if (node.kind === 233 /* ModuleBlock */) { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { switch (getModuleInstanceState(n)) { @@ -20419,7 +21308,7 @@ var ts; }); return state_1; } - else if (node.kind === 230 /* ModuleDeclaration */) { + else if (node.kind === 232 /* ModuleDeclaration */) { var body = node.body; return body ? getModuleInstanceState(body) : 1 /* Instantiated */; } @@ -20532,7 +21421,7 @@ var ts; } return bindSourceFile; function bindInStrictMode(file, opts) { - if (opts.alwaysStrict && !ts.isDeclarationFile(file)) { + if ((opts.alwaysStrict === undefined ? opts.strict : opts.alwaysStrict) && !ts.isDeclarationFile(file)) { // bind in strict mode source files with alwaysStrict option return true; } @@ -20560,7 +21449,7 @@ var ts; if (symbolFlags & 107455 /* Value */) { var valueDeclaration = symbol.valueDeclaration; if (!valueDeclaration || - (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 230 /* ModuleDeclaration */)) { + (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 232 /* ModuleDeclaration */)) { // other kinds of value declarations take precedence over modules symbol.valueDeclaration = node; } @@ -20573,7 +21462,7 @@ var ts; if (ts.isAmbientModule(node)) { return ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + node.name.text + "\""; } - if (node.name.kind === 142 /* ComputedPropertyName */) { + if (node.name.kind === 143 /* ComputedPropertyName */) { var nameExpression = node.name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteral(nameExpression)) { @@ -20585,27 +21474,28 @@ var ts; return node.name.text; } switch (node.kind) { - case 150 /* Constructor */: + case 151 /* Constructor */: return "__constructor"; - case 158 /* FunctionType */: - case 153 /* CallSignature */: + case 159 /* FunctionType */: + case 154 /* CallSignature */: return "__call"; - case 159 /* ConstructorType */: - case 154 /* ConstructSignature */: + case 160 /* ConstructorType */: + case 155 /* ConstructSignature */: return "__new"; - case 155 /* IndexSignature */: + case 156 /* IndexSignature */: return "__index"; - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: return "__export"; - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: return node.isExportEquals ? "export=" : "default"; - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: switch (ts.getSpecialPropertyAssignmentKind(node)) { case 2 /* ModuleExports */: // module.exports = ... return "export="; case 1 /* ExportsProperty */: case 4 /* ThisProperty */: + case 5 /* Property */: // exports.x = ... or this.y = ... return node.left.name.text; case 3 /* PrototypeProperty */: @@ -20614,22 +21504,22 @@ var ts; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 225 /* FunctionDeclaration */: - case 226 /* ClassDeclaration */: + case 227 /* FunctionDeclaration */: + case 228 /* ClassDeclaration */: return ts.hasModifier(node, 512 /* Default */) ? "default" : undefined; - case 274 /* JSDocFunctionType */: + case 278 /* JSDocFunctionType */: return ts.isJSDocConstructSignature(node) ? "__new" : "__call"; - case 144 /* Parameter */: + case 145 /* Parameter */: // Parameters with names are handled at the top of this function. Parameters // without names can only come from JSDocFunctionTypes. - ts.Debug.assert(node.parent.kind === 274 /* JSDocFunctionType */); + ts.Debug.assert(node.parent.kind === 278 /* JSDocFunctionType */); var functionType = node.parent; var index = ts.indexOf(functionType.parameters, node); return "arg" + index; - case 285 /* JSDocTypedefTag */: + case 289 /* JSDocTypedefTag */: var parentNode = node.parent && node.parent.parent; var nameFromParentNode = void 0; - if (parentNode && parentNode.kind === 205 /* VariableStatement */) { + if (parentNode && parentNode.kind === 207 /* VariableStatement */) { if (parentNode.declarationList.declarations.length > 0) { var nameIdentifier = parentNode.declarationList.declarations[0].name; if (nameIdentifier.kind === 70 /* Identifier */) { @@ -20684,15 +21574,18 @@ var ts; // Otherwise, we'll be merging into a compatible existing symbol (for example when // you have multiple 'vars' with the same name in the same container). In this case // just add this node into the declarations list of the symbol. - symbol = symbolTable[name] || (symbolTable[name] = createSymbol(0 /* None */, name)); + symbol = symbolTable.get(name); + if (!symbol) { + symbolTable.set(name, symbol = createSymbol(0 /* None */, name)); + } if (name && (includes & 788448 /* Classifiable */)) { - classifiableNames[name] = name; + classifiableNames.set(name, name); } if (symbol.flags & excludes) { if (symbol.isReplaceableByMethod) { // Javascript constructor-declared symbols can be discarded in favor of // prototype symbols like methods. - symbol = symbolTable[name] = createSymbol(0 /* None */, name); + symbolTable.set(name, symbol = createSymbol(0 /* None */, name)); } else { if (node.name) { @@ -20716,7 +21609,7 @@ var ts; // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers) if (symbol.declarations && symbol.declarations.length && - (isDefaultExport || (node.kind === 240 /* ExportAssignment */ && !node.isExportEquals))) { + (isDefaultExport || (node.kind === 242 /* ExportAssignment */ && !node.isExportEquals))) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; } } @@ -20736,11 +21629,11 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 8388608 /* Alias */) { - if (node.kind === 243 /* ExportSpecifier */ || (node.kind === 234 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 245 /* ExportSpecifier */ || (node.kind === 236 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { - return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); + return declareSymbol(container.locals, /*parent*/ undefined, node, symbolFlags, symbolExcludes); } } else { @@ -20759,7 +21652,7 @@ var ts; // during global merging in the checker. Why? The only case when ambient module is permitted inside another module is module augmentation // and this case is specially handled. Module augmentations should only be merged with original module definition // and should never be merged directly with other augmentation, and the latter case would be possible if automatic merge is allowed. - var isJSDocTypedefInJSDocNamespace = node.kind === 285 /* JSDocTypedefTag */ && + var isJSDocTypedefInJSDocNamespace = node.kind === 289 /* JSDocTypedefTag */ && node.name && node.name.kind === 70 /* Identifier */ && node.name.isInJSDocNamespace; @@ -20767,13 +21660,13 @@ var ts; var exportKind = (symbolFlags & 107455 /* Value */ ? 1048576 /* ExportValue */ : 0) | (symbolFlags & 793064 /* Type */ ? 2097152 /* ExportType */ : 0) | (symbolFlags & 1920 /* Namespace */ ? 4194304 /* ExportNamespace */ : 0); - var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); + var local = declareSymbol(container.locals, /*parent*/ undefined, node, exportKind, symbolExcludes); local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); node.localSymbol = local; return local; } else { - return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); + return declareSymbol(container.locals, /*parent*/ undefined, node, symbolFlags, symbolExcludes); } } } @@ -20840,14 +21733,13 @@ var ts; hasExplicitReturn = false; bindChildren(node); // Reset all reachability check related flags on node (for incremental scenarios) - // Reset all emit helper flags on node (for incremental scenarios) - node.flags &= ~64896 /* ReachabilityAndEmitFlags */; + node.flags &= ~1408 /* ReachabilityAndEmitFlags */; if (!(currentFlow.flags & 1 /* Unreachable */) && containerFlags & 8 /* IsFunctionLike */ && ts.nodeIsPresent(node.body)) { node.flags |= 128 /* HasImplicitReturn */; if (hasExplicitReturn) node.flags |= 256 /* HasExplicitReturn */; } - if (node.kind === 261 /* SourceFile */) { + if (node.kind === 264 /* SourceFile */) { node.flags |= emitFlags; } if (isIIFE) { @@ -20926,66 +21818,72 @@ var ts; return; } switch (node.kind) { - case 210 /* WhileStatement */: + case 212 /* WhileStatement */: bindWhileStatement(node); break; - case 209 /* DoStatement */: + case 211 /* DoStatement */: bindDoStatement(node); break; - case 211 /* ForStatement */: + case 213 /* ForStatement */: bindForStatement(node); break; - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 208 /* IfStatement */: + case 210 /* IfStatement */: bindIfStatement(node); break; - case 216 /* ReturnStatement */: - case 220 /* ThrowStatement */: + case 218 /* ReturnStatement */: + case 222 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 215 /* BreakStatement */: - case 214 /* ContinueStatement */: + case 217 /* BreakStatement */: + case 216 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 221 /* TryStatement */: + case 223 /* TryStatement */: bindTryStatement(node); break; - case 218 /* SwitchStatement */: + case 220 /* SwitchStatement */: bindSwitchStatement(node); break; - case 232 /* CaseBlock */: + case 234 /* CaseBlock */: bindCaseBlock(node); break; - case 253 /* CaseClause */: + case 256 /* CaseClause */: bindCaseClause(node); break; - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: bindLabeledStatement(node); break; - case 190 /* PrefixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 191 /* PostfixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 186 /* DeleteExpression */: + case 187 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 193 /* ConditionalExpression */: + case 194 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 223 /* VariableDeclaration */: + case 225 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 179 /* CallExpression */: + case 180 /* CallExpression */: bindCallExpressionFlow(node); break; + case 282 /* JSDocComment */: + bindJSDocComment(node); + break; + case 289 /* JSDocTypedefTag */: + bindJSDocTypedefTag(node); + break; default: bindEachChild(node); break; @@ -20995,15 +21893,15 @@ var ts; switch (expr.kind) { case 70 /* Identifier */: case 98 /* ThisKeyword */: - case 177 /* PropertyAccessExpression */: + case 178 /* PropertyAccessExpression */: return isNarrowableReference(expr); - case 179 /* CallExpression */: + case 180 /* CallExpression */: return hasNarrowableArgument(expr); - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 190 /* PrefixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: return expr.operator === 50 /* ExclamationToken */ && isNarrowingExpression(expr.operand); } return false; @@ -21011,7 +21909,8 @@ var ts; function isNarrowableReference(expr) { return expr.kind === 70 /* Identifier */ || expr.kind === 98 /* ThisKeyword */ || - expr.kind === 177 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression); + expr.kind === 96 /* SuperKeyword */ || + expr.kind === 178 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression); } function hasNarrowableArgument(expr) { if (expr.arguments) { @@ -21022,14 +21921,14 @@ var ts; } } } - if (expr.expression.kind === 177 /* PropertyAccessExpression */ && + if (expr.expression.kind === 178 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression.expression)) { return true; } return false; } function isNarrowingTypeofOperands(expr1, expr2) { - return expr1.kind === 187 /* TypeOfExpression */ && isNarrowableOperand(expr1.expression) && expr2.kind === 9 /* StringLiteral */; + return expr1.kind === 188 /* TypeOfExpression */ && isNarrowableOperand(expr1.expression) && expr2.kind === 9 /* StringLiteral */; } function isNarrowingBinaryExpression(expr) { switch (expr.operatorToken.kind) { @@ -21050,9 +21949,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 57 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -21147,33 +22046,33 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 208 /* IfStatement */: - case 210 /* WhileStatement */: - case 209 /* DoStatement */: + case 210 /* IfStatement */: + case 212 /* WhileStatement */: + case 211 /* DoStatement */: return parent.expression === node; - case 211 /* ForStatement */: - case 193 /* ConditionalExpression */: + case 213 /* ForStatement */: + case 194 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 183 /* ParenthesizedExpression */) { + if (node.kind === 184 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 190 /* PrefixUnaryExpression */ && node.operator === 50 /* ExclamationToken */) { + else if (node.kind === 191 /* PrefixUnaryExpression */ && node.operator === 50 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 192 /* BinaryExpression */ && (node.operatorToken.kind === 52 /* AmpersandAmpersandToken */ || + return node.kind === 193 /* BinaryExpression */ && (node.operatorToken.kind === 52 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 53 /* BarBarToken */); } } } function isTopLevelLogicalExpression(node) { - while (node.parent.kind === 183 /* ParenthesizedExpression */ || - node.parent.kind === 190 /* PrefixUnaryExpression */ && + while (node.parent.kind === 184 /* ParenthesizedExpression */ || + node.parent.kind === 191 /* PrefixUnaryExpression */ && node.parent.operator === 50 /* ExclamationToken */) { node = node.parent; } @@ -21215,7 +22114,7 @@ var ts; } function bindDoStatement(node) { var preDoLabel = createLoopLabel(); - var enclosingLabeledStatement = node.parent.kind === 219 /* LabeledStatement */ + var enclosingLabeledStatement = node.parent.kind === 221 /* LabeledStatement */ ? ts.lastOrUndefined(activeLabels) : undefined; // if do statement is wrapped in labeled statement then target labels for break/continue with or without @@ -21249,10 +22148,13 @@ var ts; var postLoopLabel = createBranchLabel(); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; + if (node.kind === 215 /* ForOfStatement */) { + bind(node.awaitModifier); + } bind(node.expression); addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 224 /* VariableDeclarationList */) { + if (node.initializer.kind !== 226 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -21274,7 +22176,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 216 /* ReturnStatement */) { + if (node.kind === 218 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -21294,7 +22196,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 215 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 217 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -21330,7 +22232,32 @@ var ts; if (node.finallyBlock) { // in finally flow is combined from pre-try/flow from try/flow from catch // pre-flow is necessary to make sure that finally is reachable even if finally flows in both try and finally blocks are unreachable - addAntecedent(preFinallyLabel, preTryFlow); + // also for finally blocks we inject two extra edges into the flow graph. + // first -> edge that connects pre-try flow with the label at the beginning of the finally block, it has lock associated with it + // second -> edge that represents post-finally flow. + // these edges are used in following scenario: + // let a; (1) + // try { a = someOperation(); (2)} + // finally { (3) console.log(a) } (4) + // (5) a + // flow graph for this case looks roughly like this (arrows show ): + // (1-pre-try-flow) <--.. <-- (2-post-try-flow) + // ^ ^ + // |*****(3-pre-finally-label) -----| + // ^ + // |-- ... <-- (4-post-finally-label) <--- (5) + // In case when we walk the flow starting from inside the finally block we want to take edge '*****' into account + // since it ensures that finally is always reachable. However when we start outside the finally block and go through label (5) + // then edge '*****' should be discarded because label 4 is only reachable if post-finally label-4 is reachable + // Simply speaking code inside finally block is treated as reachable as pre-try-flow + // since we conservatively assume that any line in try block can throw or return in which case we'll enter finally. + // However code after finally is reachable only if control flow was not abrupted in try/catch or finally blocks - it should be composed from + // final flows of these blocks without taking pre-try flow into account. + // + // extra edges that we inject allows to control this behavior + // if when walking the flow we step on post-finally edge - we can mark matching pre-finally edge as locked so it will be skipped. + var preFinallyFlow = { flags: 2048 /* PreFinally */, antecedent: preTryFlow, lock: {} }; + addAntecedent(preFinallyLabel, preFinallyFlow); currentFlow = finishFlowLabel(preFinallyLabel); bind(node.finallyBlock); // if flow after finally is unreachable - keep it @@ -21346,6 +22273,11 @@ var ts; : unreachableFlow; } } + if (!(currentFlow.flags & 1 /* Unreachable */)) { + var afterFinallyFlow = { flags: 4096 /* AfterFinally */, antecedent: currentFlow }; + preFinallyFlow.lock = afterFinallyFlow; + currentFlow = afterFinallyFlow; + } } else { currentFlow = finishFlowLabel(preFinallyLabel); @@ -21360,7 +22292,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 254 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 257 /* DefaultClause */; }); // We mark a switch statement as possibly exhaustive if it has no default clause and if all // case clauses have unreachable end points (e.g. they all return). node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents; @@ -21427,14 +22359,14 @@ var ts; if (!activeLabel.referenced && !options.allowUnusedLabels) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node.label, ts.Diagnostics.Unused_label)); } - if (!node.statement || node.statement.kind !== 209 /* DoStatement */) { + if (!node.statement || node.statement.kind !== 211 /* DoStatement */) { // do statement sets current flow inside bindDoStatement addAntecedent(postStatementLabel, currentFlow); currentFlow = finishFlowLabel(postStatementLabel); } } function bindDestructuringTargetFlow(node) { - if (node.kind === 192 /* BinaryExpression */ && node.operatorToken.kind === 57 /* EqualsToken */) { + if (node.kind === 193 /* BinaryExpression */ && node.operatorToken.kind === 57 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -21445,10 +22377,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowAssignment(currentFlow, node); } - else if (node.kind === 175 /* ArrayLiteralExpression */) { + else if (node.kind === 176 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 196 /* SpreadElement */) { + if (e.kind === 197 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -21456,16 +22388,16 @@ var ts; } } } - else if (node.kind === 176 /* ObjectLiteralExpression */) { + else if (node.kind === 177 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 257 /* PropertyAssignment */) { + if (p.kind === 260 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 258 /* ShorthandPropertyAssignment */) { + else if (p.kind === 261 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 259 /* SpreadAssignment */) { + else if (p.kind === 262 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -21521,7 +22453,7 @@ var ts; bindEachChild(node); if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 57 /* EqualsToken */ && node.left.kind === 178 /* ElementAccessExpression */) { + if (operator === 57 /* EqualsToken */ && node.left.kind === 179 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -21532,7 +22464,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 177 /* PropertyAccessExpression */) { + if (node.expression.kind === 178 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -21565,19 +22497,37 @@ var ts; } function bindVariableDeclarationFlow(node) { bindEachChild(node); - if (node.initializer || node.parent.parent.kind === 212 /* ForInStatement */ || node.parent.parent.kind === 213 /* ForOfStatement */) { + if (node.initializer || node.parent.parent.kind === 214 /* ForInStatement */ || node.parent.parent.kind === 215 /* ForOfStatement */) { bindInitializedVariableFlow(node); } } + function bindJSDocComment(node) { + ts.forEachChild(node, function (n) { + if (n.kind !== 289 /* JSDocTypedefTag */) { + bind(n); + } + }); + } + function bindJSDocTypedefTag(node) { + ts.forEachChild(node, function (n) { + // if the node has a fullName "A.B.C", that means symbol "C" was already bound + // when we visit "fullName"; so when we visit the name "C" as the next child of + // the jsDocTypedefTag, we should skip binding it. + if (node.fullName && n === node.name && node.fullName.kind !== 70 /* Identifier */) { + return; + } + bind(n); + }); + } function bindCallExpressionFlow(node) { // If the target of the call expression is a function expression or arrow function we have // an immediately invoked function expression (IIFE). Initialize the flowNode property to // the current control flow (which includes evaluation of the IIFE arguments). var expr = node.expression; - while (expr.kind === 183 /* ParenthesizedExpression */) { + while (expr.kind === 184 /* ParenthesizedExpression */) { expr = expr.expression; } - if (expr.kind === 184 /* FunctionExpression */ || expr.kind === 185 /* ArrowFunction */) { + if (expr.kind === 185 /* FunctionExpression */ || expr.kind === 186 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -21585,7 +22535,7 @@ var ts; else { bindEachChild(node); } - if (node.expression.kind === 177 /* PropertyAccessExpression */) { + if (node.expression.kind === 178 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -21594,52 +22544,54 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 197 /* ClassExpression */: - case 226 /* ClassDeclaration */: - case 229 /* EnumDeclaration */: - case 176 /* ObjectLiteralExpression */: - case 161 /* TypeLiteral */: - case 287 /* JSDocTypeLiteral */: - case 270 /* JSDocRecordType */: + case 198 /* ClassExpression */: + case 228 /* ClassDeclaration */: + case 231 /* EnumDeclaration */: + case 177 /* ObjectLiteralExpression */: + case 162 /* TypeLiteral */: + case 291 /* JSDocTypeLiteral */: + case 274 /* JSDocRecordType */: + case 253 /* JsxAttributes */: return 1 /* IsContainer */; - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 274 /* JSDocFunctionType */: - case 230 /* ModuleDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 170 /* MappedType */: + case 278 /* JSDocFunctionType */: + case 232 /* ModuleDeclaration */: + case 230 /* TypeAliasDeclaration */: + case 171 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 261 /* SourceFile */: + case 264 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 149 /* MethodDeclaration */: + case 150 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } - case 150 /* Constructor */: - case 225 /* FunctionDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 158 /* FunctionType */: - case 159 /* ConstructorType */: + // falls through + case 151 /* Constructor */: + case 227 /* FunctionDeclaration */: + case 149 /* MethodSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 231 /* ModuleBlock */: + case 233 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 147 /* PropertyDeclaration */: + case 148 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 256 /* CatchClause */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 232 /* CaseBlock */: + case 259 /* CatchClause */: + case 213 /* ForStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: + case 234 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 204 /* Block */: + case 206 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Otherwise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -21676,42 +22628,43 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 261 /* SourceFile */: + case 264 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 197 /* ClassExpression */: - case 226 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 228 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 161 /* TypeLiteral */: - case 176 /* ObjectLiteralExpression */: - case 227 /* InterfaceDeclaration */: - case 270 /* JSDocRecordType */: - case 287 /* JSDocTypeLiteral */: + case 162 /* TypeLiteral */: + case 177 /* ObjectLiteralExpression */: + case 229 /* InterfaceDeclaration */: + case 274 /* JSDocRecordType */: + case 291 /* JSDocTypeLiteral */: + case 253 /* JsxAttributes */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 274 /* JSDocFunctionType */: - case 228 /* TypeAliasDeclaration */: - case 170 /* MappedType */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 278 /* JSDocFunctionType */: + case 230 /* TypeAliasDeclaration */: + case 171 /* MappedType */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -21729,14 +22682,14 @@ var ts; function declareSourceFileMember(node, symbolFlags, symbolExcludes) { return ts.isExternalModule(file) ? declareModuleMember(node, symbolFlags, symbolExcludes) - : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); + : declareSymbol(file.locals, /*parent*/ undefined, node, symbolFlags, symbolExcludes); } function hasExportDeclarations(node) { - var body = node.kind === 261 /* SourceFile */ ? node : node.body; - if (body && (body.kind === 261 /* SourceFile */ || body.kind === 231 /* ModuleBlock */)) { + var body = node.kind === 264 /* SourceFile */ ? node : node.body; + if (body && (body.kind === 264 /* SourceFile */ || body.kind === 233 /* ModuleBlock */)) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 241 /* ExportDeclaration */ || stat.kind === 240 /* ExportAssignment */) { + if (stat.kind === 243 /* ExportDeclaration */ || stat.kind === 242 /* ExportAssignment */) { return true; } } @@ -21760,7 +22713,7 @@ var ts; errorOnFirstToken(node, ts.Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible); } if (ts.isExternalModuleAugmentation(node)) { - declareSymbolAndAddToSymbolTable(node, 1024 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */); + declareModuleSymbol(node); } else { var pattern = void 0; @@ -21780,12 +22733,8 @@ var ts; } } else { - var state = getModuleInstanceState(node); - if (state === 0 /* NonInstantiated */) { - declareSymbolAndAddToSymbolTable(node, 1024 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */); - } - else { - declareSymbolAndAddToSymbolTable(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */); + var state = declareModuleSymbol(node); + if (state !== 0 /* NonInstantiated */) { if (node.symbol.flags & (16 /* Function */ | 32 /* Class */ | 256 /* RegularEnum */)) { // if module was already merged with some function, class or non-const enum // treat is a non-const-enum-only @@ -21805,6 +22754,12 @@ var ts; } } } + function declareModuleSymbol(node) { + var state = getModuleInstanceState(node); + var instantiated = state !== 0 /* NonInstantiated */; + declareSymbolAndAddToSymbolTable(node, instantiated ? 512 /* ValueModule */ : 1024 /* NamespaceModule */, instantiated ? 106639 /* ValueModuleExcludes */ : 0 /* NamespaceModuleExcludes */); + return state; + } function bindFunctionOrConstructorType(node) { // For a given function symbol "<...>(...) => T" we want to generate a symbol identical // to the one we would get for: { <...>(...): T } @@ -21817,7 +22772,7 @@ var ts; var typeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type"); addDeclarationToSymbol(typeLiteralSymbol, node, 2048 /* TypeLiteral */); typeLiteralSymbol.members = ts.createMap(); - typeLiteralSymbol.members[symbol.name] = symbol; + typeLiteralSymbol.members.set(symbol.name, symbol); } function bindObjectLiteralExpression(node) { var ElementKind; @@ -21829,7 +22784,7 @@ var ts; var seen = ts.createMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 259 /* SpreadAssignment */ || prop.name.kind !== 70 /* Identifier */) { + if (prop.kind === 262 /* SpreadAssignment */ || prop.name.kind !== 70 /* Identifier */) { continue; } var identifier = prop.name; @@ -21841,12 +22796,12 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 257 /* PropertyAssignment */ || prop.kind === 258 /* ShorthandPropertyAssignment */ || prop.kind === 149 /* MethodDeclaration */ + var currentKind = prop.kind === 260 /* PropertyAssignment */ || prop.kind === 261 /* ShorthandPropertyAssignment */ || prop.kind === 150 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; - var existingKind = seen[identifier.text]; + var existingKind = seen.get(identifier.text); if (!existingKind) { - seen[identifier.text] = currentKind; + seen.set(identifier.text, currentKind); continue; } if (currentKind === 1 /* Property */ && existingKind === 1 /* Property */) { @@ -21857,27 +22812,33 @@ var ts; } return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object"); } + function bindJsxAttributes(node) { + return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__jsxAttributes"); + } + function bindJsxAttribute(node, symbolFlags, symbolExcludes) { + return declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); + } function bindAnonymousDeclaration(node, symbolFlags, name) { var symbol = createSymbol(symbolFlags, name); addDeclarationToSymbol(symbol, node, symbolFlags); } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 261 /* SourceFile */: + case 264 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; } - // fall through. + // falls through default: if (!blockScopeContainer.locals) { blockScopeContainer.locals = ts.createMap(); addToContainerChain(blockScopeContainer); } - declareSymbol(blockScopeContainer.locals, undefined, node, symbolFlags, symbolExcludes); + declareSymbol(blockScopeContainer.locals, /*parent*/ undefined, node, symbolFlags, symbolExcludes); } } function bindBlockScopedVariableDeclaration(node) { @@ -21977,8 +22938,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 261 /* SourceFile */ && - blockScopeContainer.kind !== 230 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 264 /* SourceFile */ && + blockScopeContainer.kind !== 232 /* ModuleDeclaration */ && !ts.isFunctionLike(blockScopeContainer)) { // We check first if the name is inside class declaration or class expression; if so give explicit message // otherwise report generic error message. @@ -21988,7 +22949,7 @@ var ts; } } function checkStrictModeNumericLiteral(node) { - if (inStrictMode && node.isOctalLiteral) { + if (inStrictMode && node.numericLiteralFlags & 4 /* Octal */) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode)); } } @@ -22028,6 +22989,18 @@ var ts; } node.parent = parent; var saveInStrictMode = inStrictMode; + // Even though in the AST the jsdoc @typedef node belongs to the current node, + // its symbol might be in the same scope with the current node's symbol. Consider: + // + // /** @typedef {string | number} MyType */ + // function foo(); + // + // Here the current node is "foo", which is a container, but the scope of "MyType" should + // not be inside "foo". Therefore we always bind @typedef before bind the parent node, + // and skip binding this tag later when binding all the other jsdoc tags. + if (ts.isInJavaScriptFile(node)) { + bindJSDocTypedefTagIfAny(node); + } // First we bind declaration nodes to a symbol if possible. We'll both create a symbol // and then potentially add the symbol to an appropriate symbol table. Possible // destination symbol tables are: @@ -22044,7 +23017,7 @@ var ts; // the current 'container' node when it changes. This helps us know which symbol table // a local should go into for example. Since terminal nodes are known not to have // children, as an optimization we don't process those. - if (node.kind > 140 /* LastToken */) { + if (node.kind > 141 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -22061,6 +23034,26 @@ var ts; } inStrictMode = saveInStrictMode; } + function bindJSDocTypedefTagIfAny(node) { + if (!node.jsDoc) { + return; + } + for (var _i = 0, _a = node.jsDoc; _i < _a.length; _i++) { + var jsDoc = _a[_i]; + if (!jsDoc.tags) { + continue; + } + for (var _b = 0, _c = jsDoc.tags; _b < _c.length; _b++) { + var tag = _c[_b]; + if (tag.kind === 289 /* JSDocTypedefTag */) { + var savedParent = parent; + parent = jsDoc; + bind(tag); + parent = savedParent; + } + } + } + } function updateStrictModeStatementList(statements) { if (!inStrictMode) { for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) { @@ -22091,91 +23084,90 @@ var ts; // current "blockScopeContainer" needs to be set to its immediate namespace parent. if (node.isInJSDocNamespace) { var parentNode = node.parent; - while (parentNode && parentNode.kind !== 285 /* JSDocTypedefTag */) { + while (parentNode && parentNode.kind !== 289 /* JSDocTypedefTag */) { parentNode = parentNode.parent; } bindBlockScopedDeclaration(parentNode, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); break; } + // falls through case 98 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 258 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 261 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); - case 177 /* PropertyAccessExpression */: + case 178 /* PropertyAccessExpression */: if (currentFlow && isNarrowableReference(node)) { node.flowNode = currentFlow; } break; - case 192 /* BinaryExpression */: - if (ts.isInJavaScriptFile(node)) { - var specialKind = ts.getSpecialPropertyAssignmentKind(node); - switch (specialKind) { - case 1 /* ExportsProperty */: - bindExportsPropertyAssignment(node); - break; - case 2 /* ModuleExports */: - bindModuleExportsAssignment(node); - break; - case 3 /* PrototypeProperty */: - bindPrototypePropertyAssignment(node); - break; - case 4 /* ThisProperty */: - bindThisPropertyAssignment(node); - break; - case 0 /* None */: - // Nothing to do - break; - default: - ts.Debug.fail("Unknown special property assignment kind"); - } + case 193 /* BinaryExpression */: + var specialKind = ts.getSpecialPropertyAssignmentKind(node); + switch (specialKind) { + case 1 /* ExportsProperty */: + bindExportsPropertyAssignment(node); + break; + case 2 /* ModuleExports */: + bindModuleExportsAssignment(node); + break; + case 3 /* PrototypeProperty */: + bindPrototypePropertyAssignment(node); + break; + case 4 /* ThisProperty */: + bindThisPropertyAssignment(node); + break; + case 5 /* Property */: + bindStaticPropertyAssignment(node); + break; + case 0 /* None */: + // Nothing to do + break; + default: + ts.Debug.fail("Unknown special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 256 /* CatchClause */: + case 259 /* CatchClause */: return checkStrictModeCatchClause(node); - case 186 /* DeleteExpression */: + case 187 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 191 /* PostfixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 190 /* PrefixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 217 /* WithStatement */: + case 219 /* WithStatement */: return checkStrictModeWithStatement(node); - case 167 /* ThisType */: + case 168 /* ThisType */: seenThisKeyword = true; return; - case 156 /* TypePredicate */: + case 157 /* TypePredicate */: return checkTypePredicate(node); - case 143 /* TypeParameter */: + case 144 /* TypeParameter */: return declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530920 /* TypeParameterExcludes */); - case 144 /* Parameter */: + case 145 /* Parameter */: return bindParameter(node); - case 223 /* VariableDeclaration */: - case 174 /* BindingElement */: - if (node.dotDotDotToken && node.parent.kind === 172 /* ObjectBindingPattern */) { - emitFlags |= 32768 /* HasRestAttribute */; - } + case 225 /* VariableDeclaration */: + case 175 /* BindingElement */: return bindVariableDeclarationOrBindingElement(node); - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 271 /* JSDocRecordMember */: - return bindPropertyOrMethodOrAccessor(node, 4 /* Property */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), 0 /* PropertyExcludes */); - case 286 /* JSDocPropertyTag */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 275 /* JSDocRecordMember */: + return bindPropertyOrMethodOrAccessor(node, 4 /* Property */ | (node.questionToken ? 67108864 /* Optional */ : 0 /* None */), 0 /* PropertyExcludes */); + case 290 /* JSDocPropertyTag */: return bindJSDocProperty(node); - case 257 /* PropertyAssignment */: - case 258 /* ShorthandPropertyAssignment */: + case 260 /* PropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 260 /* EnumMember */: + case 263 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 259 /* SpreadAssignment */: - case 251 /* JsxSpreadAttribute */: + case 262 /* SpreadAssignment */: + case 254 /* JsxSpreadAttribute */: var root = container; var hasRest = false; while (root.parent) { - if (root.kind === 176 /* ObjectLiteralExpression */ && - root.parent.kind === 192 /* BinaryExpression */ && + if (root.kind === 177 /* ObjectLiteralExpression */ && + root.parent.kind === 193 /* BinaryExpression */ && root.parent.operatorToken.kind === 57 /* EqualsToken */ && root.parent.left === root) { hasRest = true; @@ -22183,88 +23175,92 @@ var ts; } root = root.parent; } - emitFlags |= hasRest ? 32768 /* HasRestAttribute */ : 16384 /* HasSpreadAttribute */; return; - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. - return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 99263 /* MethodExcludes */); - case 225 /* FunctionDeclaration */: + return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 67108864 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 99263 /* MethodExcludes */); + case 227 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 150 /* Constructor */: + case 151 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 151 /* GetAccessor */: + case 152 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */); - case 152 /* SetAccessor */: + case 153 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */); - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 274 /* JSDocFunctionType */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: + case 278 /* JSDocFunctionType */: return bindFunctionOrConstructorType(node); - case 161 /* TypeLiteral */: - case 170 /* MappedType */: - case 287 /* JSDocTypeLiteral */: - case 270 /* JSDocRecordType */: + case 162 /* TypeLiteral */: + case 171 /* MappedType */: + case 291 /* JSDocTypeLiteral */: + case 274 /* JSDocRecordType */: return bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type"); - case 176 /* ObjectLiteralExpression */: + case 177 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: return bindFunctionExpression(node); - case 179 /* CallExpression */: + case 180 /* CallExpression */: if (ts.isInJavaScriptFile(node)) { bindCallExpression(node); } break; // Members of classes, interfaces, and modules - case 197 /* ClassExpression */: - case 226 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 228 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 792968 /* InterfaceExcludes */); - case 285 /* JSDocTypedefTag */: + case 289 /* JSDocTypedefTag */: if (!node.fullName || node.fullName.kind === 70 /* Identifier */) { return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); } break; - case 228 /* TypeAliasDeclaration */: + case 230 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: return bindModuleDeclaration(node); + // Jsx-attributes + case 253 /* JsxAttributes */: + return bindJsxAttributes(node); + case 252 /* JsxAttribute */: + return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 234 /* ImportEqualsDeclaration */: - case 237 /* NamespaceImport */: - case 239 /* ImportSpecifier */: - case 243 /* ExportSpecifier */: + case 236 /* ImportEqualsDeclaration */: + case 239 /* NamespaceImport */: + case 241 /* ImportSpecifier */: + case 245 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */); - case 233 /* NamespaceExportDeclaration */: + case 235 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 236 /* ImportClause */: + case 238 /* ImportClause */: return bindImportClause(node); - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: return bindExportDeclaration(node); - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: return bindExportAssignment(node); - case 261 /* SourceFile */: + case 264 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 204 /* Block */: + case 206 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } - // Fall through - case 231 /* ModuleBlock */: + // falls through + case 233 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); } } @@ -22273,7 +23269,7 @@ var ts; if (parameterName && parameterName.kind === 70 /* Identifier */) { checkStrictModeIdentifier(parameterName); } - if (parameterName && parameterName.kind === 167 /* ThisType */) { + if (parameterName && parameterName.kind === 168 /* ThisType */) { seenThisKeyword = true; } bind(type); @@ -22296,7 +23292,7 @@ var ts; // An export default clause with an expression exports a value // We want to exclude both class and function here, this is necessary to issue an error when there are both // default export-assignment and default export function and class declaration. - var flags = node.kind === 240 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) + var flags = node.kind === 242 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) ? 8388608 /* Alias */ : 4 /* Property */; declareSymbol(container.symbol.exports, container.symbol, node, flags, 4 /* Property */ | 8388608 /* AliasExcludes */ | 32 /* Class */ | 16 /* Function */); @@ -22306,17 +23302,17 @@ var ts; if (node.modifiers && node.modifiers.length) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Modifiers_cannot_appear_here)); } - if (node.parent.kind !== 261 /* SourceFile */) { + if (node.parent.kind !== 264 /* SourceFile */) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_at_top_level)); return; } else { - var parent_4 = node.parent; - if (!ts.isExternalModule(parent_4)) { + var parent_1 = node.parent; + if (!ts.isExternalModule(parent_1)) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_in_module_files)); return; } - if (!parent_4.isDeclarationFile) { + if (!parent_1.isDeclarationFile) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_in_declaration_files)); return; } @@ -22327,11 +23323,11 @@ var ts; function bindExportDeclaration(node) { if (!container.symbol || !container.symbol.exports) { // Export * in some sort of block construct - bindAnonymousDeclaration(node, 1073741824 /* ExportStar */, getDeclarationName(node)); + bindAnonymousDeclaration(node, 33554432 /* ExportStar */, getDeclarationName(node)); } else if (!node.exportClause) { // All export * declarations are collected in an __export symbol - declareSymbol(container.symbol.exports, container.symbol, node, 1073741824 /* ExportStar */, 0 /* None */); + declareSymbol(container.symbol.exports, container.symbol, node, 33554432 /* ExportStar */, 0 /* None */); } } function bindImportClause(node) { @@ -22353,30 +23349,67 @@ var ts; setCommonJsModuleIndicator(node); declareSymbol(file.symbol.exports, file.symbol, node.left, 4 /* Property */ | 7340032 /* Export */, 0 /* None */); } + function isExportsOrModuleExportsOrAlias(node) { + return ts.isExportsIdentifier(node) || + ts.isModuleExportsPropertyAccessExpression(node) || + isNameOfExportsOrModuleExportsAliasDeclaration(node); + } + function isNameOfExportsOrModuleExportsAliasDeclaration(node) { + if (node.kind === 70 /* Identifier */) { + var symbol = lookupSymbolForName(node.text); + if (symbol && symbol.valueDeclaration && symbol.valueDeclaration.kind === 225 /* VariableDeclaration */) { + var declaration = symbol.valueDeclaration; + if (declaration.initializer) { + return isExportsOrModuleExportsOrAliasOrAssignemnt(declaration.initializer); + } + } + } + return false; + } + function isExportsOrModuleExportsOrAliasOrAssignemnt(node) { + return isExportsOrModuleExportsOrAlias(node) || + (ts.isAssignmentExpression(node, /*excludeCompoundAssignements*/ true) && (isExportsOrModuleExportsOrAliasOrAssignemnt(node.left) || isExportsOrModuleExportsOrAliasOrAssignemnt(node.right))); + } function bindModuleExportsAssignment(node) { + // A common practice in node modules is to set 'export = module.exports = {}', this ensures that 'exports' + // is still pointing to 'module.exports'. + // We do not want to consider this as 'export=' since a module can have only one of these. + // Similarlly we do not want to treat 'module.exports = exports' as an 'export='. + var assignedExpression = ts.getRightMostAssignedExpression(node.right); + if (ts.isEmptyObjectLiteral(assignedExpression) || isExportsOrModuleExportsOrAlias(assignedExpression)) { + // Mark it as a module in case there are no other exports in the file + setCommonJsModuleIndicator(node); + return; + } // 'module.exports = expr' assignment setCommonJsModuleIndicator(node); declareSymbol(file.symbol.exports, file.symbol, node, 4 /* Property */ | 7340032 /* Export */ | 512 /* ValueModule */, 0 /* None */); } function bindThisPropertyAssignment(node) { ts.Debug.assert(ts.isInJavaScriptFile(node)); - // Declare a 'member' if the container is an ES5 class or ES6 constructor - if (container.kind === 225 /* FunctionDeclaration */ || container.kind === 184 /* FunctionExpression */) { - container.symbol.members = container.symbol.members || ts.createMap(); - // It's acceptable for multiple 'this' assignments of the same identifier to occur - declareSymbol(container.symbol.members, container.symbol, node, 4 /* Property */, 0 /* PropertyExcludes */ & ~4 /* Property */); - } - else if (container.kind === 150 /* Constructor */) { - // this.foo assignment in a JavaScript class - // Bind this property to the containing class - var saveContainer = container; - container = container.parent; - var symbol = bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* None */); - if (symbol) { - // constructor-declared symbols can be overwritten by subsequent method declarations - symbol.isReplaceableByMethod = true; - } - container = saveContainer; + var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); + switch (container.kind) { + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + // Declare a 'member' if the container is an ES5 class or ES6 constructor + container.symbol.members = container.symbol.members || ts.createMap(); + // It's acceptable for multiple 'this' assignments of the same identifier to occur + declareSymbol(container.symbol.members, container.symbol, node, 4 /* Property */, 0 /* PropertyExcludes */ & ~4 /* Property */); + break; + case 151 /* Constructor */: + case 148 /* PropertyDeclaration */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + // this.foo assignment in a JavaScript class + // Bind this property to the containing class + var containingClass = container.parent; + var symbol = declareSymbol(ts.hasModifier(container, 32 /* Static */) ? containingClass.symbol.exports : containingClass.symbol.members, containingClass.symbol, node, 4 /* Property */, 0 /* None */); + if (symbol) { + // symbols declared through 'this' property assignements can be overwritten by subsequent method declarations + symbol.isReplaceableByMethod = true; + } + break; } } function bindPrototypePropertyAssignment(node) { @@ -22390,16 +23423,44 @@ var ts; leftSideOfAssignment.parent = node; constructorFunction.parent = classPrototype; classPrototype.parent = leftSideOfAssignment; - var funcSymbol = container.locals[constructorFunction.text]; - if (!funcSymbol || !(funcSymbol.flags & 16 /* Function */ || ts.isDeclarationOfFunctionExpression(funcSymbol))) { + bindPropertyAssignment(constructorFunction.text, leftSideOfAssignment, /*isPrototypeProperty*/ true); + } + function bindStaticPropertyAssignment(node) { + // We saw a node of the form 'x.y = z'. Declare a 'member' y on x if x was a function. + // Look up the function in the local scope, since prototype assignments should + // follow the function declaration + var leftSideOfAssignment = node.left; + var target = leftSideOfAssignment.expression; + // Fix up parent pointers since we're going to use these nodes before we bind into them + leftSideOfAssignment.parent = node; + target.parent = leftSideOfAssignment; + if (isNameOfExportsOrModuleExportsAliasDeclaration(target)) { + // This can be an alias for the 'exports' or 'module.exports' names, e.g. + // var util = module.exports; + // util.property = function ... + bindExportsPropertyAssignment(node); + } + else { + bindPropertyAssignment(target.text, leftSideOfAssignment, /*isPrototypeProperty*/ false); + } + } + function lookupSymbolForName(name) { + return (container.symbol && container.symbol.exports && container.symbol.exports.get(name)) || (container.locals && container.locals.get(name)); + } + function bindPropertyAssignment(functionName, propertyAccessExpression, isPrototypeProperty) { + var targetSymbol = lookupSymbolForName(functionName); + if (targetSymbol && ts.isDeclarationOfFunctionOrClassExpression(targetSymbol)) { + targetSymbol = targetSymbol.valueDeclaration.initializer.symbol; + } + if (!targetSymbol || !(targetSymbol.flags & (16 /* Function */ | 32 /* Class */))) { return; } // Set up the members collection if it doesn't exist already - if (!funcSymbol.members) { - funcSymbol.members = ts.createMap(); - } + var symbolTable = isPrototypeProperty ? + (targetSymbol.members || (targetSymbol.members = ts.createMap())) : + (targetSymbol.exports || (targetSymbol.exports = ts.createMap())); // Declare the method/property - declareSymbol(funcSymbol.members, funcSymbol, leftSideOfAssignment, 4 /* Property */, 0 /* PropertyExcludes */); + declareSymbol(symbolTable, targetSymbol, propertyAccessExpression, 4 /* Property */, 0 /* PropertyExcludes */); } function bindCallExpression(node) { // We're only inspecting call expressions to detect CommonJS modules, so we can skip @@ -22409,15 +23470,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { - if (ts.getClassExtendsHeritageClauseElement(node) !== undefined) { - emitFlags |= 1024 /* HasClassExtends */; - } - if (ts.nodeIsDecorated(node)) { - emitFlags |= 2048 /* HasDecorators */; - } - } - if (node.kind === 226 /* ClassDeclaration */) { + if (node.kind === 228 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899519 /* ClassExcludes */); } else { @@ -22425,7 +23478,7 @@ var ts; bindAnonymousDeclaration(node, 32 /* Class */, bindingName); // Add name of class expression into the map for semantic classifier if (node.name) { - classifiableNames[node.name.text] = node.name.text; + classifiableNames.set(node.name.text, node.name.text); } } var symbol = node.symbol; @@ -22438,14 +23491,15 @@ var ts; // Note: we check for this here because this class may be merging into a module. The // module might have an exported variable called 'prototype'. We can't allow that as // that would clash with the built-in 'prototype' for the class. - var prototypeSymbol = createSymbol(4 /* Property */ | 134217728 /* Prototype */, "prototype"); - if (symbol.exports[prototypeSymbol.name]) { + var prototypeSymbol = createSymbol(4 /* Property */ | 16777216 /* Prototype */, "prototype"); + var symbolExport = symbol.exports.get(prototypeSymbol.name); + if (symbolExport) { if (node.name) { node.name.parent = node; } - file.bindDiagnostics.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); + file.bindDiagnostics.push(ts.createDiagnosticForNode(symbolExport.declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); } - symbol.exports[prototypeSymbol.name] = prototypeSymbol; + symbol.exports.set(prototypeSymbol.name, prototypeSymbol); prototypeSymbol.parent = symbol; } function bindEnumDeclaration(node) { @@ -22479,11 +23533,6 @@ var ts; } } function bindParameter(node) { - if (!ts.isDeclarationFile(file) && - !ts.isInAmbientContext(node) && - ts.nodeIsDecorated(node)) { - emitFlags |= (2048 /* HasDecorators */ | 4096 /* HasParamDecorators */); - } if (inStrictMode) { // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a // strict mode FunctionLikeDeclaration or FunctionExpression(13.1) @@ -22499,13 +23548,13 @@ var ts; // containing class. if (ts.isParameterPropertyDeclaration(node)) { var classDeclaration = node.parent.parent; - declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 /* Property */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), 0 /* PropertyExcludes */); + declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 /* Property */ | (node.questionToken ? 67108864 /* Optional */ : 0 /* None */), 0 /* PropertyExcludes */); } } function bindFunctionDeclaration(node) { if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { - if (ts.isAsyncFunctionLike(node)) { - emitFlags |= 8192 /* HasAsyncFunctions */; + if (ts.isAsyncFunction(node)) { + emitFlags |= 1024 /* HasAsyncFunctions */; } } checkStrictModeFunctionName(node); @@ -22519,8 +23568,8 @@ var ts; } function bindFunctionExpression(node) { if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { - if (ts.isAsyncFunctionLike(node)) { - emitFlags |= 8192 /* HasAsyncFunctions */; + if (ts.isAsyncFunction(node)) { + emitFlags |= 1024 /* HasAsyncFunctions */; } } if (currentFlow) { @@ -22532,11 +23581,8 @@ var ts; } function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) { if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { - if (ts.isAsyncFunctionLike(node)) { - emitFlags |= 8192 /* HasAsyncFunctions */; - } - if (ts.nodeIsDecorated(node)) { - emitFlags |= 2048 /* HasDecorators */; + if (ts.isAsyncFunction(node)) { + emitFlags |= 1024 /* HasAsyncFunctions */; } } if (currentFlow && ts.isObjectLiteralOrClassExpressionMethod(node)) { @@ -22561,13 +23607,13 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 206 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 208 /* EmptyStatement */) || // report error on class declarations - node.kind === 226 /* ClassDeclaration */ || + node.kind === 228 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 230 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || + (node.kind === 232 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || // report error on regular enums and const enums if preserveConstEnums is set - (node.kind === 229 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + (node.kind === 231 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); if (reportError) { currentFlow = reportedUnreachableFlow; // unreachable code is reported if @@ -22581,7 +23627,7 @@ var ts; // On the other side we do want to report errors on non-initialized 'lets' because of TDZ var reportUnreachableCode = !options.allowUnreachableCode && !ts.isInAmbientContext(node) && - (node.kind !== 205 /* VariableStatement */ || + (node.kind !== 207 /* VariableStatement */ || ts.getCombinedNodeFlags(node.declarationList) & 3 /* BlockScoped */ || ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); if (reportUnreachableCode) { @@ -22601,56 +23647,56 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 179 /* CallExpression */: + case 180 /* CallExpression */: return computeCallExpression(node, subtreeFlags); - case 180 /* NewExpression */: + case 181 /* NewExpression */: return computeNewExpression(node, subtreeFlags); - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: return computeModuleDeclaration(node, subtreeFlags); - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return computeParenthesizedExpression(node, subtreeFlags); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return computeBinaryExpression(node, subtreeFlags); - case 207 /* ExpressionStatement */: + case 209 /* ExpressionStatement */: return computeExpressionStatement(node, subtreeFlags); - case 144 /* Parameter */: + case 145 /* Parameter */: return computeParameter(node, subtreeFlags); - case 185 /* ArrowFunction */: + case 186 /* ArrowFunction */: return computeArrowFunction(node, subtreeFlags); - case 184 /* FunctionExpression */: + case 185 /* FunctionExpression */: return computeFunctionExpression(node, subtreeFlags); - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: return computeFunctionDeclaration(node, subtreeFlags); - case 223 /* VariableDeclaration */: + case 225 /* VariableDeclaration */: return computeVariableDeclaration(node, subtreeFlags); - case 224 /* VariableDeclarationList */: + case 226 /* VariableDeclarationList */: return computeVariableDeclarationList(node, subtreeFlags); - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: return computeVariableStatement(node, subtreeFlags); - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: return computeLabeledStatement(node, subtreeFlags); - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: return computeClassDeclaration(node, subtreeFlags); - case 197 /* ClassExpression */: + case 198 /* ClassExpression */: return computeClassExpression(node, subtreeFlags); - case 255 /* HeritageClause */: + case 258 /* HeritageClause */: return computeHeritageClause(node, subtreeFlags); - case 256 /* CatchClause */: + case 259 /* CatchClause */: return computeCatchClause(node, subtreeFlags); - case 199 /* ExpressionWithTypeArguments */: + case 200 /* ExpressionWithTypeArguments */: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 150 /* Constructor */: + case 151 /* Constructor */: return computeConstructor(node, subtreeFlags); - case 147 /* PropertyDeclaration */: + case 148 /* PropertyDeclaration */: return computePropertyDeclaration(node, subtreeFlags); - case 149 /* MethodDeclaration */: + case 150 /* MethodDeclaration */: return computeMethod(node, subtreeFlags); - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: return computeAccessor(node, subtreeFlags); - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: return computeImportEquals(node, subtreeFlags); - case 177 /* PropertyAccessExpression */: + case 178 /* PropertyAccessExpression */: return computePropertyAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); @@ -22677,8 +23723,8 @@ var ts; switch (kind) { case 96 /* SuperKeyword */: return true; - case 177 /* PropertyAccessExpression */: - case 178 /* ElementAccessExpression */: + case 178 /* PropertyAccessExpression */: + case 179 /* ElementAccessExpression */: var expression = node.expression; var expressionKind = expression.kind; return expressionKind === 96 /* SuperKeyword */; @@ -22702,12 +23748,12 @@ var ts; var transformFlags = subtreeFlags; var operatorTokenKind = node.operatorToken.kind; var leftKind = node.left.kind; - if (operatorTokenKind === 57 /* EqualsToken */ && leftKind === 176 /* ObjectLiteralExpression */) { + if (operatorTokenKind === 57 /* EqualsToken */ && leftKind === 177 /* ObjectLiteralExpression */) { // Destructuring object assignments with are ES2015 syntax // and possibly ESNext if they contain rest transformFlags |= 8 /* AssertESNext */ | 192 /* AssertES2015 */ | 3072 /* AssertDestructuringAssignment */; } - else if (operatorTokenKind === 57 /* EqualsToken */ && leftKind === 175 /* ArrayLiteralExpression */) { + else if (operatorTokenKind === 57 /* EqualsToken */ && leftKind === 176 /* ArrayLiteralExpression */) { // Destructuring assignments are ES2015 syntax. transformFlags |= 192 /* AssertES2015 */ | 3072 /* AssertDestructuringAssignment */; } @@ -22757,8 +23803,8 @@ var ts; // If the node is synthesized, it means the emitter put the parentheses there, // not the user. If we didn't want them, the emitter would not have put them // there. - if (expressionKind === 200 /* AsExpression */ - || expressionKind === 182 /* TypeAssertionExpression */) { + if (expressionKind === 201 /* AsExpression */ + || expressionKind === 183 /* TypeAssertionExpression */) { transformFlags |= 3 /* AssertTypeScript */; } // If the expression of a ParenthesizedExpression is a destructuring assignment, @@ -22883,10 +23929,9 @@ var ts; } // An async method declaration is ES2017 syntax. if (ts.hasModifier(node, 256 /* Async */)) { - transformFlags |= 16 /* AssertES2017 */; + transformFlags |= node.asteriskToken ? 8 /* AssertESNext */ : 16 /* AssertES2017 */; } - // Currently, we only support generators that were originally async function bodies. - if (node.asteriskToken && ts.getEmitFlags(node) & 131072 /* AsyncFunctionBody */) { + if (node.asteriskToken) { transformFlags |= 768 /* AssertGenerator */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; @@ -22940,7 +23985,7 @@ var ts; } // An async function declaration is ES2017 syntax. if (modifierFlags & 256 /* Async */) { - transformFlags |= 16 /* AssertES2017 */; + transformFlags |= node.asteriskToken ? 8 /* AssertESNext */ : 16 /* AssertES2017 */; } // function declarations with object rest destructuring are ES Next syntax if (subtreeFlags & 1048576 /* ContainsObjectRest */) { @@ -22957,7 +24002,7 @@ var ts; // down-level generator. // Currently we do not support transforming any other generator fucntions // down level. - if (node.asteriskToken && ts.getEmitFlags(node) & 131072 /* AsyncFunctionBody */) { + if (node.asteriskToken) { transformFlags |= 768 /* AssertGenerator */; } } @@ -22975,7 +24020,7 @@ var ts; } // An async function expression is ES2017 syntax. if (ts.hasModifier(node, 256 /* Async */)) { - transformFlags |= 16 /* AssertES2017 */; + transformFlags |= node.asteriskToken ? 8 /* AssertESNext */ : 16 /* AssertES2017 */; } // function expressions with object rest destructuring are ES Next syntax if (subtreeFlags & 1048576 /* ContainsObjectRest */) { @@ -22990,9 +24035,7 @@ var ts; // If a FunctionExpression is generator function and is the body of a // transformed async function, then this node can be transformed to a // down-level generator. - // Currently we do not support transforming any other generator fucntions - // down level. - if (node.asteriskToken && ts.getEmitFlags(node) & 131072 /* AsyncFunctionBody */) { + if (node.asteriskToken) { transformFlags |= 768 /* AssertGenerator */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; @@ -23123,9 +24166,9 @@ var ts; var excludeFlags = 536872257 /* NodeExcludes */; switch (kind) { case 119 /* AsyncKeyword */: - case 189 /* AwaitExpression */: - // async/await is ES2017 syntax - transformFlags |= 16 /* AssertES2017 */; + case 190 /* AwaitExpression */: + // async/await is ES2017 syntax, but may be ESNext syntax (for async generators) + transformFlags |= 8 /* AssertESNext */ | 16 /* AssertES2017 */; break; case 113 /* PublicKeyword */: case 111 /* PrivateKeyword */: @@ -23133,81 +24176,98 @@ var ts; case 116 /* AbstractKeyword */: case 123 /* DeclareKeyword */: case 75 /* ConstKeyword */: - case 229 /* EnumDeclaration */: - case 260 /* EnumMember */: - case 182 /* TypeAssertionExpression */: - case 200 /* AsExpression */: - case 201 /* NonNullExpression */: + case 231 /* EnumDeclaration */: + case 263 /* EnumMember */: + case 183 /* TypeAssertionExpression */: + case 201 /* AsExpression */: + case 202 /* NonNullExpression */: case 130 /* ReadonlyKeyword */: // These nodes are TypeScript syntax. transformFlags |= 3 /* AssertTypeScript */; break; - case 246 /* JsxElement */: - case 247 /* JsxSelfClosingElement */: - case 248 /* JsxOpeningElement */: + case 248 /* JsxElement */: + case 249 /* JsxSelfClosingElement */: + case 250 /* JsxOpeningElement */: case 10 /* JsxText */: - case 249 /* JsxClosingElement */: - case 250 /* JsxAttribute */: - case 251 /* JsxSpreadAttribute */: - case 252 /* JsxExpression */: + case 251 /* JsxClosingElement */: + case 252 /* JsxAttribute */: + case 253 /* JsxAttributes */: + case 254 /* JsxSpreadAttribute */: + case 255 /* JsxExpression */: // These nodes are Jsx syntax. transformFlags |= 4 /* AssertJsx */; break; - case 213 /* ForOfStatement */: - // for-of might be ESNext if it has a rest destructuring - transformFlags |= 8 /* AssertESNext */; - // FALLTHROUGH case 12 /* NoSubstitutionTemplateLiteral */: case 13 /* TemplateHead */: case 14 /* TemplateMiddle */: case 15 /* TemplateTail */: - case 194 /* TemplateExpression */: - case 181 /* TaggedTemplateExpression */: - case 258 /* ShorthandPropertyAssignment */: + case 195 /* TemplateExpression */: + case 182 /* TaggedTemplateExpression */: + case 261 /* ShorthandPropertyAssignment */: case 114 /* StaticKeyword */: + case 203 /* MetaProperty */: // These nodes are ES6 syntax. transformFlags |= 192 /* AssertES2015 */; break; - case 195 /* YieldExpression */: - // This node is ES6 syntax. - transformFlags |= 192 /* AssertES2015 */ | 16777216 /* ContainsYield */; + case 9 /* StringLiteral */: + if (node.hasExtendedUnicodeEscape) { + transformFlags |= 192 /* AssertES2015 */; + } + break; + case 8 /* NumericLiteral */: + if (node.numericLiteralFlags & 48 /* BinaryOrOctalSpecifier */) { + transformFlags |= 192 /* AssertES2015 */; + } + break; + case 215 /* ForOfStatement */: + // This node is either ES2015 syntax or ES2017 syntax (if it is a for-await-of). + if (node.awaitModifier) { + transformFlags |= 8 /* AssertESNext */; + } + transformFlags |= 192 /* AssertES2015 */; + break; + case 196 /* YieldExpression */: + // This node is either ES2015 syntax (in a generator) or ES2017 syntax (in an async + // generator). + transformFlags |= 8 /* AssertESNext */ | 192 /* AssertES2015 */ | 16777216 /* ContainsYield */; break; case 118 /* AnyKeyword */: case 132 /* NumberKeyword */: case 129 /* NeverKeyword */: - case 134 /* StringKeyword */: + case 133 /* ObjectKeyword */: + case 135 /* StringKeyword */: case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: + case 136 /* SymbolKeyword */: case 104 /* VoidKeyword */: - case 143 /* TypeParameter */: - case 146 /* PropertySignature */: - case 148 /* MethodSignature */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 156 /* TypePredicate */: - case 157 /* TypeReference */: - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 160 /* TypeQuery */: - case 161 /* TypeLiteral */: - case 162 /* ArrayType */: - case 163 /* TupleType */: - case 164 /* UnionType */: - case 165 /* IntersectionType */: - case 166 /* ParenthesizedType */: - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 167 /* ThisType */: - case 168 /* TypeOperator */: - case 169 /* IndexedAccessType */: - case 170 /* MappedType */: - case 171 /* LiteralType */: + case 144 /* TypeParameter */: + case 147 /* PropertySignature */: + case 149 /* MethodSignature */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: + case 157 /* TypePredicate */: + case 158 /* TypeReference */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: + case 161 /* TypeQuery */: + case 162 /* TypeLiteral */: + case 163 /* ArrayType */: + case 164 /* TupleType */: + case 165 /* UnionType */: + case 166 /* IntersectionType */: + case 167 /* ParenthesizedType */: + case 229 /* InterfaceDeclaration */: + case 230 /* TypeAliasDeclaration */: + case 168 /* ThisType */: + case 169 /* TypeOperator */: + case 170 /* IndexedAccessType */: + case 171 /* MappedType */: + case 172 /* LiteralType */: // Types and signatures are TypeScript syntax, and exclude all other facts. transformFlags = 3 /* AssertTypeScript */; excludeFlags = -3 /* TypeExcludes */; break; - case 142 /* ComputedPropertyName */: + case 143 /* ComputedPropertyName */: // Even though computed property names are ES6, we don't treat them as such. // This is so that they can flow through PropertyName transforms unaffected. // Instead, we mark the container as ES6, so that it can properly handle the transform. @@ -23224,10 +24284,10 @@ var ts; transformFlags |= 65536 /* ContainsLexicalThisInComputedPropertyName */; } break; - case 196 /* SpreadElement */: + case 197 /* SpreadElement */: transformFlags |= 192 /* AssertES2015 */ | 524288 /* ContainsSpread */; break; - case 259 /* SpreadAssignment */: + case 262 /* SpreadAssignment */: transformFlags |= 8 /* AssertESNext */ | 1048576 /* ContainsObjectSpread */; break; case 96 /* SuperKeyword */: @@ -23238,28 +24298,28 @@ var ts; // Mark this node and its ancestors as containing a lexical `this` keyword. transformFlags |= 16384 /* ContainsLexicalThis */; break; - case 172 /* ObjectBindingPattern */: + case 173 /* ObjectBindingPattern */: transformFlags |= 192 /* AssertES2015 */ | 8388608 /* ContainsBindingPattern */; if (subtreeFlags & 524288 /* ContainsRest */) { transformFlags |= 8 /* AssertESNext */ | 1048576 /* ContainsObjectRest */; } excludeFlags = 537396545 /* BindingPatternExcludes */; break; - case 173 /* ArrayBindingPattern */: + case 174 /* ArrayBindingPattern */: transformFlags |= 192 /* AssertES2015 */ | 8388608 /* ContainsBindingPattern */; excludeFlags = 537396545 /* BindingPatternExcludes */; break; - case 174 /* BindingElement */: + case 175 /* BindingElement */: transformFlags |= 192 /* AssertES2015 */; if (node.dotDotDotToken) { transformFlags |= 524288 /* ContainsRest */; } break; - case 145 /* Decorator */: + case 146 /* Decorator */: // This node is TypeScript syntax, and marks its container as also being TypeScript syntax. transformFlags |= 3 /* AssertTypeScript */ | 4096 /* ContainsDecorators */; break; - case 176 /* ObjectLiteralExpression */: + case 177 /* ObjectLiteralExpression */: excludeFlags = 540087617 /* ObjectLiteralExcludes */; if (subtreeFlags & 2097152 /* ContainsComputedPropertyName */) { // If an ObjectLiteralExpression contains a ComputedPropertyName, then it @@ -23277,8 +24337,8 @@ var ts; transformFlags |= 8 /* AssertESNext */; } break; - case 175 /* ArrayLiteralExpression */: - case 180 /* NewExpression */: + case 176 /* ArrayLiteralExpression */: + case 181 /* NewExpression */: excludeFlags = 537396545 /* ArrayLiteralOrCallOrNewExcludes */; if (subtreeFlags & 524288 /* ContainsSpread */) { // If the this node contains a SpreadExpression, then it is an ES6 @@ -23286,23 +24346,23 @@ var ts; transformFlags |= 192 /* AssertES2015 */; } break; - case 209 /* DoStatement */: - case 210 /* WhileStatement */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: + case 211 /* DoStatement */: + case 212 /* WhileStatement */: + case 213 /* ForStatement */: + case 214 /* ForInStatement */: // A loop containing a block scoped binding *may* need to be transformed from ES6. if (subtreeFlags & 4194304 /* ContainsBlockScopedBinding */) { transformFlags |= 192 /* AssertES2015 */; } break; - case 261 /* SourceFile */: + case 264 /* SourceFile */: if (subtreeFlags & 32768 /* ContainsCapturedLexicalThis */) { transformFlags |= 192 /* AssertES2015 */; } break; - case 216 /* ReturnStatement */: - case 214 /* ContinueStatement */: - case 215 /* BreakStatement */: + case 218 /* ReturnStatement */: + case 216 /* ContinueStatement */: + case 217 /* BreakStatement */: transformFlags |= 33554432 /* ContainsHoistedDeclarationOrCompletion */; break; } @@ -23318,56 +24378,57 @@ var ts; */ /* @internal */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 156 /* FirstTypeNode */ && kind <= 171 /* LastTypeNode */) { + if (kind >= 157 /* FirstTypeNode */ && kind <= 172 /* LastTypeNode */) { return -3 /* TypeExcludes */; } switch (kind) { - case 179 /* CallExpression */: - case 180 /* NewExpression */: - case 175 /* ArrayLiteralExpression */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: + case 176 /* ArrayLiteralExpression */: return 537396545 /* ArrayLiteralOrCallOrNewExcludes */; - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: return 574674241 /* ModuleExcludes */; - case 144 /* Parameter */: + case 145 /* Parameter */: return 536872257 /* ParameterExcludes */; - case 185 /* ArrowFunction */: + case 186 /* ArrowFunction */: return 601249089 /* ArrowFunctionExcludes */; - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 227 /* FunctionDeclaration */: return 601281857 /* FunctionExcludes */; - case 224 /* VariableDeclarationList */: + case 226 /* VariableDeclarationList */: return 546309441 /* VariableDeclarationListExcludes */; - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: return 539358529 /* ClassExcludes */; - case 150 /* Constructor */: + case 151 /* Constructor */: return 601015617 /* ConstructorExcludes */; - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: return 601015617 /* MethodOrAccessorExcludes */; case 118 /* AnyKeyword */: case 132 /* NumberKeyword */: case 129 /* NeverKeyword */: - case 134 /* StringKeyword */: + case 135 /* StringKeyword */: + case 133 /* ObjectKeyword */: case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: + case 136 /* SymbolKeyword */: case 104 /* VoidKeyword */: - case 143 /* TypeParameter */: - case 146 /* PropertySignature */: - case 148 /* MethodSignature */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: + case 144 /* TypeParameter */: + case 147 /* PropertySignature */: + case 149 /* MethodSignature */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: + case 229 /* InterfaceDeclaration */: + case 230 /* TypeAliasDeclaration */: return -3 /* TypeExcludes */; - case 176 /* ObjectLiteralExpression */: + case 177 /* ObjectLiteralExpression */: return 540087617 /* ObjectLiteralExcludes */; - case 256 /* CatchClause */: + case 259 /* CatchClause */: return 537920833 /* CatchClauseExcludes */; - case 172 /* ObjectBindingPattern */: - case 173 /* ArrayBindingPattern */: + case 173 /* ObjectBindingPattern */: + case 174 /* ArrayBindingPattern */: return 537396545 /* BindingPatternExcludes */; default: return 536872257 /* NodeExcludes */; @@ -23406,10 +24467,6 @@ var ts; ts.Debug.assert(ts.extensionIsTypeScript(resolved.extension)); return resolved.path; } - /** Create Resolved from a file with unknown extension. */ - function resolvedFromAnyFile(path) { - return { path: path, extension: ts.extensionFromPath(path) }; - } /** Adds `isExernalLibraryImport` to a Resolved to get a ResolvedModule. */ function resolvedModuleFromResolved(_a, isExternalLibraryImport) { var path = _a.path, extension = _a.extension; @@ -23422,37 +24479,29 @@ var ts; return !(ts.isRootedDiskPath(moduleName) || ts.isExternalModuleNameRelative(moduleName)); } ts.moduleHasNonRelativeName = moduleHasNonRelativeName; - function tryReadTypesSection(extensions, packageJsonPath, baseDirectory, state) { + /** Reads from "main" or "types"/"typings" depending on `extensions`. */ + function tryReadPackageJsonFields(readTypes, packageJsonPath, baseDirectory, state) { var jsonContent = readJson(packageJsonPath, state.host); - switch (extensions) { - case 2 /* DtsOnly */: - case 0 /* TypeScript */: - return tryReadFromField("typings") || tryReadFromField("types"); - case 1 /* JavaScript */: - if (typeof jsonContent.main === "string") { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.No_types_specified_in_package_json_so_returning_main_value_of_0, jsonContent.main); - } - return ts.normalizePath(ts.combinePaths(baseDirectory, jsonContent.main)); - } - return undefined; - } + return readTypes ? tryReadFromField("typings") || tryReadFromField("types") : tryReadFromField("main"); function tryReadFromField(fieldName) { - if (ts.hasProperty(jsonContent, fieldName)) { - var typesFile = jsonContent[fieldName]; - if (typeof typesFile === "string") { - var typesFilePath = ts.normalizePath(ts.combinePaths(baseDirectory, typesFile)); - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.package_json_has_0_field_1_that_references_2, fieldName, typesFile, typesFilePath); - } - return typesFilePath; - } - else { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_string_got_1, fieldName, typeof typesFile); - } + if (!ts.hasProperty(jsonContent, fieldName)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.package_json_does_not_have_a_0_field, fieldName); } + return; } + var fileName = jsonContent[fieldName]; + if (typeof fileName !== "string") { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_string_got_1, fieldName, typeof fileName); + } + return; + } + var path = ts.normalizePath(ts.combinePaths(baseDirectory, fileName)); + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.package_json_has_0_field_1_that_references_2, fieldName, fileName, path); + } + return path; } } function readJson(path, host) { @@ -23488,13 +24537,15 @@ var ts; function getDefaultTypeRoots(currentDirectory, host) { if (!host.directoryExists) { return [ts.combinePaths(currentDirectory, nodeModulesAtTypes)]; + // And if it doesn't exist, tough. } var typeRoots; - forEachAncestorDirectory(currentDirectory, function (directory) { + forEachAncestorDirectory(ts.normalizePath(currentDirectory), function (directory) { var atTypes = ts.combinePaths(directory, nodeModulesAtTypes); if (host.directoryExists(atTypes)) { (typeRoots || (typeRoots = [])).push(atTypes); } + return undefined; }); return typeRoots; } @@ -23555,7 +24606,11 @@ var ts; return ts.forEach(typeRoots, function (typeRoot) { var candidate = ts.combinePaths(typeRoot, typeReferenceDirectiveName); var candidateDirectory = ts.getDirectoryPath(candidate); - return resolvedTypeScriptOnly(loadNodeModuleFromDirectory(2 /* DtsOnly */, candidate, failedLookupLocations, !directoryProbablyExists(candidateDirectory, host), moduleResolutionState)); + var directoryExists = directoryProbablyExists(candidateDirectory, host); + if (!directoryExists && traceEnabled) { + trace(host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, candidateDirectory); + } + return resolvedTypeScriptOnly(loadNodeModuleFromDirectory(Extensions.DtsOnly, candidate, failedLookupLocations, !directoryExists, moduleResolutionState)); }); } else { @@ -23572,7 +24627,8 @@ var ts; if (traceEnabled) { trace(host, ts.Diagnostics.Looking_up_in_node_modules_folder_initial_location_0, initialLocationForSecondaryLookup); } - resolvedFile = resolvedTypeScriptOnly(loadModuleFromNodeModules(2 /* DtsOnly */, typeReferenceDirectiveName, initialLocationForSecondaryLookup, failedLookupLocations, moduleResolutionState)); + var result = loadModuleFromNodeModules(Extensions.DtsOnly, typeReferenceDirectiveName, initialLocationForSecondaryLookup, failedLookupLocations, moduleResolutionState, /*cache*/ undefined); + resolvedFile = resolvedTypeScriptOnly(result && result.value); if (!resolvedFile && traceEnabled) { trace(host, ts.Diagnostics.Type_reference_directive_0_was_not_resolved, typeReferenceDirectiveName); } @@ -23587,13 +24643,13 @@ var ts; } ts.resolveTypeReferenceDirective = resolveTypeReferenceDirective; /** - * Given a set of options, returns the set of type directive names - * that should be included for this program automatically. - * This list could either come from the config file, - * or from enumerating the types root + initial secondary types lookup location. - * More type directives might appear in the program later as a result of loading actual source files; - * this list is only the set of defaults that are implicitly included. - */ + * Given a set of options, returns the set of type directive names + * that should be included for this program automatically. + * This list could either come from the config file, + * or from enumerating the types root + initial secondary types lookup location. + * More type directives might appear in the program later as a result of loading actual source files; + * this list is only the set of defaults that are implicitly included. + */ function getAutomaticTypeDirectiveNames(options, host) { // Use explicit type list from tsconfig.json if (options.types) { @@ -23625,31 +24681,135 @@ var ts; return result; } ts.getAutomaticTypeDirectiveNames = getAutomaticTypeDirectiveNames; - function resolveModuleName(moduleName, containingFile, compilerOptions, host) { + function createModuleResolutionCache(currentDirectory, getCanonicalFileName) { + var directoryToModuleNameMap = ts.createFileMap(); + var moduleNameToDirectoryMap = ts.createMap(); + return { getOrCreateCacheForDirectory: getOrCreateCacheForDirectory, getOrCreateCacheForModuleName: getOrCreateCacheForModuleName }; + function getOrCreateCacheForDirectory(directoryName) { + var path = ts.toPath(directoryName, currentDirectory, getCanonicalFileName); + var perFolderCache = directoryToModuleNameMap.get(path); + if (!perFolderCache) { + perFolderCache = ts.createMap(); + directoryToModuleNameMap.set(path, perFolderCache); + } + return perFolderCache; + } + function getOrCreateCacheForModuleName(nonRelativeModuleName) { + if (!moduleHasNonRelativeName(nonRelativeModuleName)) { + return undefined; + } + var perModuleNameCache = moduleNameToDirectoryMap.get(nonRelativeModuleName); + if (!perModuleNameCache) { + perModuleNameCache = createPerModuleNameCache(); + moduleNameToDirectoryMap.set(nonRelativeModuleName, perModuleNameCache); + } + return perModuleNameCache; + } + function createPerModuleNameCache() { + var directoryPathMap = ts.createFileMap(); + return { get: get, set: set }; + function get(directory) { + return directoryPathMap.get(ts.toPath(directory, currentDirectory, getCanonicalFileName)); + } + /** + * At first this function add entry directory -> module resolution result to the table. + * Then it computes the set of parent folders for 'directory' that should have the same module resolution result + * and for every parent folder in set it adds entry: parent -> module resolution. . + * Lets say we first directory name: /a/b/c/d/e and resolution result is: /a/b/bar.ts. + * Set of parent folders that should have the same result will be: + * [ + * /a/b/c/d, /a/b/c, /a/b + * ] + * this means that request for module resolution from file in any of these folder will be immediately found in cache. + */ + function set(directory, result) { + var path = ts.toPath(directory, currentDirectory, getCanonicalFileName); + // if entry is already in cache do nothing + if (directoryPathMap.contains(path)) { + return; + } + directoryPathMap.set(path, result); + var resolvedFileName = result.resolvedModule && result.resolvedModule.resolvedFileName; + // find common prefix between directory and resolved file name + // this common prefix should be the shorted path that has the same resolution + // directory: /a/b/c/d/e + // resolvedFileName: /a/b/foo.d.ts + var commonPrefix = getCommonPrefix(path, resolvedFileName); + var current = path; + while (true) { + var parent = ts.getDirectoryPath(current); + if (parent === current || directoryPathMap.contains(parent)) { + break; + } + directoryPathMap.set(parent, result); + current = parent; + if (current === commonPrefix) { + break; + } + } + } + function getCommonPrefix(directory, resolution) { + if (resolution === undefined) { + return undefined; + } + var resolutionDirectory = ts.toPath(ts.getDirectoryPath(resolution), currentDirectory, getCanonicalFileName); + // find first position where directory and resolution differs + var i = 0; + while (i < Math.min(directory.length, resolutionDirectory.length) && directory.charCodeAt(i) === resolutionDirectory.charCodeAt(i)) { + i++; + } + // find last directory separator before position i + var sep = directory.lastIndexOf(ts.directorySeparator, i); + if (sep < 0) { + return undefined; + } + return directory.substr(0, sep); + } + } + } + ts.createModuleResolutionCache = createModuleResolutionCache; + function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache) { var traceEnabled = isTraceEnabled(compilerOptions, host); if (traceEnabled) { trace(host, ts.Diagnostics.Resolving_module_0_from_1, moduleName, containingFile); } - var moduleResolution = compilerOptions.moduleResolution; - if (moduleResolution === undefined) { - moduleResolution = ts.getEmitModuleKind(compilerOptions) === ts.ModuleKind.CommonJS ? ts.ModuleResolutionKind.NodeJs : ts.ModuleResolutionKind.Classic; + var containingDirectory = ts.getDirectoryPath(containingFile); + var perFolderCache = cache && cache.getOrCreateCacheForDirectory(containingDirectory); + var result = perFolderCache && perFolderCache.get(moduleName); + if (result) { if (traceEnabled) { - trace(host, ts.Diagnostics.Module_resolution_kind_is_not_specified_using_0, ts.ModuleResolutionKind[moduleResolution]); + trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); } } else { - if (traceEnabled) { - trace(host, ts.Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0, ts.ModuleResolutionKind[moduleResolution]); + var moduleResolution = compilerOptions.moduleResolution; + if (moduleResolution === undefined) { + moduleResolution = ts.getEmitModuleKind(compilerOptions) === ts.ModuleKind.CommonJS ? ts.ModuleResolutionKind.NodeJs : ts.ModuleResolutionKind.Classic; + if (traceEnabled) { + trace(host, ts.Diagnostics.Module_resolution_kind_is_not_specified_using_0, ts.ModuleResolutionKind[moduleResolution]); + } + } + else { + if (traceEnabled) { + trace(host, ts.Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0, ts.ModuleResolutionKind[moduleResolution]); + } + } + switch (moduleResolution) { + case ts.ModuleResolutionKind.NodeJs: + result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache); + break; + case ts.ModuleResolutionKind.Classic: + result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache); + break; + } + if (perFolderCache) { + perFolderCache.set(moduleName, result); + // put result in per-module name cache + var perModuleNameCache = cache.getOrCreateCacheForModuleName(moduleName); + if (perModuleNameCache) { + perModuleNameCache.set(containingDirectory, result); + } } - } - var result; - switch (moduleResolution) { - case ts.ModuleResolutionKind.NodeJs: - result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host); - break; - case ts.ModuleResolutionKind.Classic: - result = classicNameResolver(moduleName, containingFile, compilerOptions, host); - break; } if (traceEnabled) { if (result.resolvedModule) { @@ -23842,38 +25002,45 @@ var ts; return loader(extensions, candidate, failedLookupLocations, !directoryProbablyExists(ts.getDirectoryPath(candidate), state.host), state); } } - function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host) { + function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache) { + return nodeModuleNameResolverWorker(moduleName, containingFile, compilerOptions, host, cache, /*jsOnly*/ false); + } + ts.nodeModuleNameResolver = nodeModuleNameResolver; + /* @internal */ + function nodeModuleNameResolverWorker(moduleName, containingFile, compilerOptions, host, cache, jsOnly) { + if (jsOnly === void 0) { jsOnly = false; } var containingDirectory = ts.getDirectoryPath(containingFile); var traceEnabled = isTraceEnabled(compilerOptions, host); var failedLookupLocations = []; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; - var result = tryResolve(0 /* TypeScript */) || tryResolve(1 /* JavaScript */); - if (result) { - var resolved = result.resolved, isExternalLibraryImport = result.isExternalLibraryImport; + var result = jsOnly ? tryResolve(Extensions.JavaScript) : (tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript)); + if (result && result.value) { + var _a = result.value, resolved = _a.resolved, isExternalLibraryImport = _a.isExternalLibraryImport; return createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations); } return { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; function tryResolve(extensions) { - var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, nodeLoadModuleByRelativeName, failedLookupLocations, state); + var loader = function (extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { return nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, /*considerPackageJson*/ true); }; + var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, failedLookupLocations, state); if (resolved) { - return { resolved: resolved, isExternalLibraryImport: false }; + return toSearchResult({ resolved: resolved, isExternalLibraryImport: false }); } if (moduleHasNonRelativeName(moduleName)) { if (traceEnabled) { - trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder, moduleName); + trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1, moduleName, Extensions[extensions]); } - var resolved_1 = loadModuleFromNodeModules(extensions, moduleName, containingDirectory, failedLookupLocations, state); + var resolved_1 = loadModuleFromNodeModules(extensions, moduleName, containingDirectory, failedLookupLocations, state, cache); // For node_modules lookups, get the real path so that multiple accesses to an `npm link`-ed module do not create duplicate files. - return resolved_1 && { resolved: { path: realpath(resolved_1.path, host, traceEnabled), extension: resolved_1.extension }, isExternalLibraryImport: true }; + return resolved_1 && { value: resolved_1.value && { resolved: { path: realpath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }, isExternalLibraryImport: true } }; } else { var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, state); - return resolved_2 && { resolved: resolved_2, isExternalLibraryImport: false }; + var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, state, /*considerPackageJson*/ true); + return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: false }); } } } - ts.nodeModuleNameResolver = nodeModuleNameResolver; + ts.nodeModuleNameResolverWorker = nodeModuleNameResolverWorker; function realpath(path, host, traceEnabled) { if (!host.realpath) { return path; @@ -23884,12 +25051,35 @@ var ts; } return real; } - function nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { + function nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson) { if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0, candidate); + trace(state.host, ts.Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1, candidate, Extensions[extensions]); } - var resolvedFromFile = !ts.pathEndsWithDirectorySeparator(candidate) && loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); - return resolvedFromFile || loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); + if (!ts.pathEndsWithDirectorySeparator(candidate)) { + if (!onlyRecordFailures) { + var parentOfCandidate = ts.getDirectoryPath(candidate); + if (!directoryProbablyExists(parentOfCandidate, state.host)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, parentOfCandidate); + } + onlyRecordFailures = true; + } + } + var resolvedFromFile = loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); + if (resolvedFromFile) { + return resolvedFromFile; + } + } + if (!onlyRecordFailures) { + var candidateExists = directoryProbablyExists(candidate, state.host); + if (!candidateExists) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, candidate); + } + onlyRecordFailures = true; + } + } + return loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson); } /* @internal */ function directoryProbablyExists(directoryName, host) { @@ -23928,11 +25118,11 @@ var ts; } } switch (extensions) { - case 2 /* DtsOnly */: + case Extensions.DtsOnly: return tryExtension(".d.ts", ts.Extension.Dts); - case 0 /* TypeScript */: + case Extensions.TypeScript: return tryExtension(".ts", ts.Extension.Ts) || tryExtension(".tsx", ts.Extension.Tsx) || tryExtension(".d.ts", ts.Extension.Dts); - case 1 /* JavaScript */: + case Extensions.JavaScript: return tryExtension(".js", ts.Extension.Js) || tryExtension(".jsx", ts.Extension.Jsx); } function tryExtension(ext, extension) { @@ -23942,120 +25132,191 @@ var ts; } /** Return the file if it exists. */ function tryFile(fileName, failedLookupLocations, onlyRecordFailures, state) { - if (!onlyRecordFailures && state.host.fileExists(fileName)) { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName); - } - return fileName; - } - else { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.File_0_does_not_exist, fileName); - } - failedLookupLocations.push(fileName); - return undefined; - } - } - function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { - var packageJsonPath = pathToPackageJson(candidate); - var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); - if (directoryExists && state.host.fileExists(packageJsonPath)) { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); - } - var typesFile = tryReadTypesSection(extensions, packageJsonPath, candidate, state); - if (typesFile) { - var onlyRecordFailures_1 = !directoryProbablyExists(ts.getDirectoryPath(typesFile), state.host); - // A package.json "typings" may specify an exact filename, or may choose to omit an extension. - var fromFile = tryFile(typesFile, failedLookupLocations, onlyRecordFailures_1, state); - if (fromFile) { - // Note: this would allow a package.json to specify a ".js" file as typings. Maybe that should be forbidden. - return resolvedFromAnyFile(fromFile); - } - var x = tryAddingExtensions(typesFile, 0 /* TypeScript */, failedLookupLocations, onlyRecordFailures_1, state); - if (x) { - return x; + if (!onlyRecordFailures) { + if (state.host.fileExists(fileName)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName); } + return fileName; } else { if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.package_json_does_not_have_a_types_or_main_field); + trace(state.host, ts.Diagnostics.File_0_does_not_exist, fileName); } } } - else { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.File_0_does_not_exist, packageJsonPath); + failedLookupLocations.push(fileName); + return undefined; + } + function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson) { + if (considerPackageJson === void 0) { considerPackageJson = true; } + var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); + if (considerPackageJson) { + var packageJsonPath = pathToPackageJson(candidate); + if (directoryExists && state.host.fileExists(packageJsonPath)) { + var fromPackageJson = loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state); + if (fromPackageJson) { + return fromPackageJson; + } + } + else { + if (directoryExists && state.traceEnabled) { + trace(state.host, ts.Diagnostics.File_0_does_not_exist, packageJsonPath); + } + // record package json as one of failed lookup locations - in the future if this file will appear it will invalidate resolution results + failedLookupLocations.push(packageJsonPath); } - // record package json as one of failed lookup locations - in the future if this file will appear it will invalidate resolution results - failedLookupLocations.push(packageJsonPath); } return loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state); } + function loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); + } + var file = tryReadPackageJsonFields(extensions !== Extensions.JavaScript, packageJsonPath, candidate, state); + if (!file) { + return undefined; + } + var onlyRecordFailures = !directoryProbablyExists(ts.getDirectoryPath(file), state.host); + var fromFile = tryFile(file, failedLookupLocations, onlyRecordFailures, state); + if (fromFile) { + var resolved = fromFile && resolvedIfExtensionMatches(extensions, fromFile); + if (resolved) { + return resolved; + } + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromFile); + } + } + // Even if extensions is DtsOnly, we can still look up a .ts file as a result of package.json "types" + var nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions; + // Don't do package.json lookup recursively, because Node.js' package lookup doesn't. + return nodeLoadModuleByRelativeName(nextExtensions, file, failedLookupLocations, onlyRecordFailures, state, /*considerPackageJson*/ false); + } + /** Resolve from an arbitrarily specified file. Return `undefined` if it has an unsupported extension. */ + function resolvedIfExtensionMatches(extensions, path) { + var extension = ts.tryGetExtensionFromPath(path); + return extension !== undefined && extensionIsOk(extensions, extension) ? { path: path, extension: extension } : undefined; + } + /** True if `extension` is one of the supported `extensions`. */ + function extensionIsOk(extensions, extension) { + switch (extensions) { + case Extensions.JavaScript: + return extension === ts.Extension.Js || extension === ts.Extension.Jsx; + case Extensions.TypeScript: + return extension === ts.Extension.Ts || extension === ts.Extension.Tsx || extension === ts.Extension.Dts; + case Extensions.DtsOnly: + return extension === ts.Extension.Dts; + } + } function pathToPackageJson(directory) { return ts.combinePaths(directory, "package.json"); } - function loadModuleFromNodeModulesFolder(extensions, moduleName, directory, failedLookupLocations, state) { - var nodeModulesFolder = ts.combinePaths(directory, "node_modules"); - var nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, state.host); + function loadModuleFromNodeModulesFolder(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, failedLookupLocations, state) { var candidate = ts.normalizePath(ts.combinePaths(nodeModulesFolder, moduleName)); return loadModuleFromFile(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state) || loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state); } - function loadModuleFromNodeModules(extensions, moduleName, directory, failedLookupLocations, state) { - return loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, /*typesOnly*/ false); + function loadModuleFromNodeModules(extensions, moduleName, directory, failedLookupLocations, state, cache) { + return loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, /*typesOnly*/ false, cache); } function loadModuleFromNodeModulesAtTypes(moduleName, directory, failedLookupLocations, state) { // Extensions parameter here doesn't actually matter, because typesOnly ensures we're just doing @types lookup, which is always DtsOnly. - return loadModuleFromNodeModulesWorker(2 /* DtsOnly */, moduleName, directory, failedLookupLocations, state, /*typesOnly*/ true); + return loadModuleFromNodeModulesWorker(Extensions.DtsOnly, moduleName, directory, failedLookupLocations, state, /*typesOnly*/ true, /*cache*/ undefined); } - function loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, typesOnly) { + function loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, typesOnly, cache) { + var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName); return forEachAncestorDirectory(ts.normalizeSlashes(directory), function (ancestorDirectory) { if (ts.getBaseFileName(ancestorDirectory) !== "node_modules") { - return loadModuleFromNodeModulesOneLevel(extensions, moduleName, ancestorDirectory, failedLookupLocations, state, typesOnly); + var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, ancestorDirectory, state.traceEnabled, state.host); + if (resolutionFromCache) { + return resolutionFromCache; + } + return toSearchResult(loadModuleFromNodeModulesOneLevel(extensions, moduleName, ancestorDirectory, failedLookupLocations, state, typesOnly)); } }); } /** Load a module from a single node_modules directory, but not from any ancestors' node_modules directories. */ function loadModuleFromNodeModulesOneLevel(extensions, moduleName, directory, failedLookupLocations, state, typesOnly) { if (typesOnly === void 0) { typesOnly = false; } - var packageResult = typesOnly ? undefined : loadModuleFromNodeModulesFolder(extensions, moduleName, directory, failedLookupLocations, state); + var nodeModulesFolder = ts.combinePaths(directory, "node_modules"); + var nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, state.host); + if (!nodeModulesFolderExists && state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesFolder); + } + var packageResult = typesOnly ? undefined : loadModuleFromNodeModulesFolder(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, failedLookupLocations, state); if (packageResult) { return packageResult; } - if (extensions !== 1 /* JavaScript */) { - return loadModuleFromNodeModulesFolder(2 /* DtsOnly */, ts.combinePaths("@types", moduleName), directory, failedLookupLocations, state); + if (extensions !== Extensions.JavaScript) { + var nodeModulesAtTypes_1 = ts.combinePaths(nodeModulesFolder, "@types"); + var nodeModulesAtTypesExists = nodeModulesFolderExists; + if (nodeModulesFolderExists && !directoryProbablyExists(nodeModulesAtTypes_1, state.host)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesAtTypes_1); + } + nodeModulesAtTypesExists = false; + } + return loadModuleFromNodeModulesFolder(Extensions.DtsOnly, mangleScopedPackage(moduleName, state), nodeModulesAtTypes_1, nodeModulesAtTypesExists, failedLookupLocations, state); } } - function classicNameResolver(moduleName, containingFile, compilerOptions, host) { + /** For a scoped package, we must look in `@types/foo__bar` instead of `@types/@foo/bar`. */ + function mangleScopedPackage(moduleName, state) { + if (ts.startsWith(moduleName, "@")) { + var replaceSlash = moduleName.replace(ts.directorySeparator, "__"); + if (replaceSlash !== moduleName) { + var mangled = replaceSlash.slice(1); // Take off the "@" + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Scoped_package_detected_looking_in_0, mangled); + } + return mangled; + } + } + return moduleName; + } + function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, traceEnabled, host) { + var result = cache && cache.get(containingDirectory); + if (result) { + if (traceEnabled) { + trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); + } + return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension } }; + } + } + function classicNameResolver(moduleName, containingFile, compilerOptions, host, cache) { var traceEnabled = isTraceEnabled(compilerOptions, host); var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var failedLookupLocations = []; var containingDirectory = ts.getDirectoryPath(containingFile); - var resolved = tryResolve(0 /* TypeScript */) || tryResolve(1 /* JavaScript */); - return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ false, failedLookupLocations); + var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); + return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations); function tryResolve(extensions) { var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFile, failedLookupLocations, state); if (resolvedUsingSettings) { - return resolvedUsingSettings; + return { value: resolvedUsingSettings }; } + var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName); if (moduleHasNonRelativeName(moduleName)) { // Climb up parent directories looking for a module. var resolved_3 = forEachAncestorDirectory(containingDirectory, function (directory) { + var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, directory, traceEnabled, host); + if (resolutionFromCache) { + return resolutionFromCache; + } var searchName = ts.normalizePath(ts.combinePaths(directory, moduleName)); - return loadModuleFromFile(extensions, searchName, failedLookupLocations, /*onlyRecordFailures*/ false, state); + return toSearchResult(loadModuleFromFile(extensions, searchName, failedLookupLocations, /*onlyRecordFailures*/ false, state)); }); if (resolved_3) { return resolved_3; } - if (extensions === 0 /* TypeScript */) { + if (extensions === Extensions.TypeScript) { // If we didn't find the file normally, look it up in @types. return loadModuleFromNodeModulesAtTypes(moduleName, containingDirectory, failedLookupLocations, state); } } else { var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - return loadModuleFromFile(extensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, state); + return toSearchResult(loadModuleFromFile(extensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, state)); } } } @@ -24072,10 +25333,17 @@ var ts; } var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var failedLookupLocations = []; - var resolved = loadModuleFromNodeModulesOneLevel(2 /* DtsOnly */, moduleName, globalCache, failedLookupLocations, state); + var resolved = loadModuleFromNodeModulesOneLevel(Extensions.DtsOnly, moduleName, globalCache, failedLookupLocations, state); return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations); } ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache; + /** + * Wraps value to SearchResult. + * @returns undefined if value is undefined or { value } otherwise + */ + function toSearchResult(value) { + return value !== undefined ? { value: value } : undefined; + } /** Calls `callback` on `directory` and every ancestor directory it has, returning the first defined result. */ function forEachAncestorDirectory(directory, callback) { while (true) { @@ -24128,23 +25396,34 @@ var ts; // is because diagnostics can be quite expensive, and we want to allow hosts to bail out if // they no longer need the information (for example, if the user started editing again). var cancellationToken; + var requestedExternalEmitHelpers; + var externalHelpersModule; var Symbol = ts.objectAllocator.getSymbolConstructor(); var Type = ts.objectAllocator.getTypeConstructor(); var Signature = ts.objectAllocator.getSignatureConstructor(); var typeCount = 0; var symbolCount = 0; + var symbolInstantiationDepth = 0; var emptyArray = []; var emptySymbols = ts.createMap(); var compilerOptions = host.getCompilerOptions(); - var languageVersion = compilerOptions.target || 0 /* ES3 */; + var languageVersion = ts.getEmitScriptTarget(compilerOptions); var modulekind = ts.getEmitModuleKind(compilerOptions); var noUnusedIdentifiers = !!compilerOptions.noUnusedLocals || !!compilerOptions.noUnusedParameters; var allowSyntheticDefaultImports = typeof compilerOptions.allowSyntheticDefaultImports !== "undefined" ? compilerOptions.allowSyntheticDefaultImports : modulekind === ts.ModuleKind.System; - var strictNullChecks = compilerOptions.strictNullChecks; + var strictNullChecks = compilerOptions.strictNullChecks === undefined ? compilerOptions.strict : compilerOptions.strictNullChecks; + var noImplicitAny = compilerOptions.noImplicitAny === undefined ? compilerOptions.strict : compilerOptions.noImplicitAny; + var noImplicitThis = compilerOptions.noImplicitThis === undefined ? compilerOptions.strict : compilerOptions.noImplicitThis; var emitResolver = createResolver(); - var undefinedSymbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "undefined"); + var nodeBuilder = createNodeBuilder(); + var undefinedSymbol = createSymbol(4 /* Property */, "undefined"); undefinedSymbol.declarations = []; - var argumentsSymbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "arguments"); + var argumentsSymbol = createSymbol(4 /* Property */, "arguments"); + // for public members that accept a Node or one of its subtypes, we must guard against + // synthetic nodes created during transformations by calling `getParseTreeNode`. + // for most of these, we perform the guard only on `checker` to avoid any possible + // extra cost of calling `getParseTreeNode` when calling these functions from inside the + // checker. var checker = { getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), "identifierCount"); }, @@ -24153,49 +25432,129 @@ var ts; isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, isUnknownSymbol: function (symbol) { return symbol === unknownSymbol; }, + getMergedSymbol: getMergedSymbol, getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, - getTypeOfSymbolAtLocation: getTypeOfSymbolAtLocation, - getSymbolsOfParameterPropertyDeclaration: getSymbolsOfParameterPropertyDeclaration, + getTypeOfSymbolAtLocation: function (symbol, location) { + location = ts.getParseTreeNode(location); + return location ? getTypeOfSymbolAtLocation(symbol, location) : unknownType; + }, + getSymbolsOfParameterPropertyDeclaration: function (parameter, parameterName) { + parameter = ts.getParseTreeNode(parameter, ts.isParameter); + ts.Debug.assert(parameter !== undefined, "Cannot get symbols of a synthetic parameter that cannot be resolved to a parse-tree node."); + return getSymbolsOfParameterPropertyDeclaration(parameter, parameterName); + }, getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, getPropertiesOfType: getPropertiesOfType, getPropertyOfType: getPropertyOfType, + getIndexInfoOfType: getIndexInfoOfType, getSignaturesOfType: getSignaturesOfType, getIndexTypeOfType: getIndexTypeOfType, getBaseTypes: getBaseTypes, + getBaseTypeOfLiteralType: getBaseTypeOfLiteralType, + getWidenedType: getWidenedType, + getTypeFromTypeNode: function (node) { + node = ts.getParseTreeNode(node, ts.isTypeNode); + return node ? getTypeFromTypeNode(node) : unknownType; + }, + getParameterType: getTypeAtPosition, getReturnTypeOfSignature: getReturnTypeOfSignature, getNonNullableType: getNonNullableType, - getSymbolsInScope: getSymbolsInScope, - getSymbolAtLocation: getSymbolAtLocation, - getShorthandAssignmentValueSymbol: getShorthandAssignmentValueSymbol, - getExportSpecifierLocalTargetSymbol: getExportSpecifierLocalTargetSymbol, - getTypeAtLocation: getTypeOfNode, - getPropertySymbolOfDestructuringAssignment: getPropertySymbolOfDestructuringAssignment, - typeToString: typeToString, + typeToTypeNode: nodeBuilder.typeToTypeNode, + indexInfoToIndexSignatureDeclaration: nodeBuilder.indexInfoToIndexSignatureDeclaration, + signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration, + getSymbolsInScope: function (location, meaning) { + location = ts.getParseTreeNode(location); + return location ? getSymbolsInScope(location, meaning) : []; + }, + getSymbolAtLocation: function (node) { + node = ts.getParseTreeNode(node); + return node ? getSymbolAtLocation(node) : undefined; + }, + getShorthandAssignmentValueSymbol: function (node) { + node = ts.getParseTreeNode(node); + return node ? getShorthandAssignmentValueSymbol(node) : undefined; + }, + getExportSpecifierLocalTargetSymbol: function (node) { + node = ts.getParseTreeNode(node, ts.isExportSpecifier); + return node ? getExportSpecifierLocalTargetSymbol(node) : undefined; + }, + getTypeAtLocation: function (node) { + node = ts.getParseTreeNode(node); + return node ? getTypeOfNode(node) : unknownType; + }, + getPropertySymbolOfDestructuringAssignment: function (location) { + location = ts.getParseTreeNode(location, ts.isIdentifier); + return location ? getPropertySymbolOfDestructuringAssignment(location) : undefined; + }, + signatureToString: function (signature, enclosingDeclaration, flags, kind) { + return signatureToString(signature, ts.getParseTreeNode(enclosingDeclaration), flags, kind); + }, + typeToString: function (type, enclosingDeclaration, flags) { + return typeToString(type, ts.getParseTreeNode(enclosingDeclaration), flags); + }, getSymbolDisplayBuilder: getSymbolDisplayBuilder, - symbolToString: symbolToString, + symbolToString: function (symbol, enclosingDeclaration, meaning) { + return symbolToString(symbol, ts.getParseTreeNode(enclosingDeclaration), meaning); + }, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, - getContextualType: getContextualType, + getContextualType: function (node) { + node = ts.getParseTreeNode(node, ts.isExpression); + return node ? getContextualType(node) : undefined; + }, getFullyQualifiedName: getFullyQualifiedName, - getResolvedSignature: getResolvedSignature, - getConstantValue: getConstantValue, - isValidPropertyAccess: isValidPropertyAccess, - getSignatureFromDeclaration: getSignatureFromDeclaration, - isImplementationOfOverload: isImplementationOfOverload, + getResolvedSignature: function (node, candidatesOutArray) { + node = ts.getParseTreeNode(node, ts.isCallLikeExpression); + return node ? getResolvedSignature(node, candidatesOutArray) : undefined; + }, + getConstantValue: function (node) { + node = ts.getParseTreeNode(node, canHaveConstantValue); + return node ? getConstantValue(node) : undefined; + }, + isValidPropertyAccess: function (node, propertyName) { + node = ts.getParseTreeNode(node, ts.isPropertyAccessOrQualifiedName); + return node ? isValidPropertyAccess(node, propertyName) : false; + }, + getSignatureFromDeclaration: function (declaration) { + declaration = ts.getParseTreeNode(declaration, ts.isFunctionLike); + return declaration ? getSignatureFromDeclaration(declaration) : undefined; + }, + isImplementationOfOverload: function (node) { + node = ts.getParseTreeNode(node, ts.isFunctionLike); + return node ? isImplementationOfOverload(node) : undefined; + }, + getImmediateAliasedSymbol: function (symbol) { + ts.Debug.assert((symbol.flags & 8388608 /* Alias */) !== 0, "Should only get Alias here."); + var links = getSymbolLinks(symbol); + if (!links.immediateTarget) { + var node = getDeclarationOfAliasSymbol(symbol); + ts.Debug.assert(!!node); + links.immediateTarget = getTargetOfAliasDeclaration(node, /*dontRecursivelyResolve*/ true); + } + return links.immediateTarget; + }, getAliasedSymbol: resolveAlias, getEmitResolver: getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, + getExportsAndPropertiesOfModule: getExportsAndPropertiesOfModule, getAmbientModules: getAmbientModules, - getJsxElementAttributesType: getJsxElementAttributesType, + getAllAttributesTypeFromJsxOpeningLikeElement: function (node) { + node = ts.getParseTreeNode(node, ts.isJsxOpeningLikeElement); + return node ? getAllAttributesTypeFromJsxOpeningLikeElement(node) : undefined; + }, getJsxIntrinsicTagNames: getJsxIntrinsicTagNames, - isOptionalParameter: isOptionalParameter, + isOptionalParameter: function (node) { + node = ts.getParseTreeNode(node, ts.isParameter); + return node ? isOptionalParameter(node) : false; + }, tryGetMemberInModuleExports: tryGetMemberInModuleExports, tryFindAmbientModuleWithoutAugmentations: function (moduleName) { // we deliberately exclude augmentations // since we are only interested in declarations of the module itself return tryFindAmbientModule(moduleName, /*withAugmentations*/ false); - } + }, + getApparentType: getApparentType }; var tupleTypes = []; var unionTypes = ts.createMap(); @@ -24204,8 +25563,8 @@ var ts; var numericLiteralTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); var evolvingArrayTypes = []; - var unknownSymbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "unknown"); - var resolvingSymbol = createSymbol(67108864 /* Transient */, "__resolving__"); + var unknownSymbol = createSymbol(4 /* Property */, "unknown"); + var resolvingSymbol = createSymbol(0, "__resolving__"); var anyType = createIntrinsicType(1 /* Any */, "any"); var autoType = createIntrinsicType(1 /* Any */, "any"); var unknownType = createIntrinsicType(1 /* Any */, "unknown"); @@ -24222,8 +25581,9 @@ var ts; var voidType = createIntrinsicType(1024 /* Void */, "void"); var neverType = createIntrinsicType(8192 /* Never */, "never"); var silentNeverType = createIntrinsicType(8192 /* Never */, "never"); + var nonPrimitiveType = createIntrinsicType(16777216 /* NonPrimitive */, "object"); var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); - var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */ | 67108864 /* Transient */, "__type"); + var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type"); emptyTypeLiteralSymbol.members = ts.createMap(); var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, undefined, undefined); var emptyGenericType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); @@ -24233,21 +25593,20 @@ var ts; // in getPropagatingFlagsOfTypes, and it is checked in inferFromTypes. anyFunctionType.flags |= 8388608 /* ContainsAnyFunctionType */; var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var circularConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anySignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); var unknownSignature = createSignature(undefined, undefined, undefined, emptyArray, unknownType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); var resolvingSignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); var silentNeverSignature = createSignature(undefined, undefined, undefined, emptyArray, silentNeverType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); var enumNumberIndexInfo = createIndexInfo(stringType, /*isReadonly*/ true); + var jsObjectLiteralIndexInfo = createIndexInfo(anyType, /*isReadonly*/ false); var globals = ts.createMap(); /** * List of every ambient module with a "*" wildcard. * Unlike other ambient modules, these can't be stored in `globals` because symbol tables only deal with exact matches. * This is only used if there is no exact match. - */ + */ var patternAmbientModules; - var getGlobalESSymbolConstructorSymbol; - var getGlobalPromiseConstructorSymbol; - var tryGetGlobalPromiseConstructorSymbol; var globalObjectType; var globalFunctionType; var globalArrayType; @@ -24256,29 +25615,29 @@ var ts; var globalNumberType; var globalBooleanType; var globalRegExpType; + var globalThisType; var anyArrayType; var autoArrayType; var anyReadonlyArrayType; // The library files are only loaded when the feature is used. // This allows users to just specify library files they want to used through --lib // and they will not get an error from not having unrelated library files - var getGlobalTemplateStringsArrayType; - var getGlobalESSymbolType; - var getGlobalIterableType; - var getGlobalIteratorType; - var getGlobalIterableIteratorType; - var getGlobalClassDecoratorType; - var getGlobalParameterDecoratorType; - var getGlobalPropertyDecoratorType; - var getGlobalMethodDecoratorType; - var getGlobalTypedPropertyDescriptorType; - var getGlobalPromiseType; - var tryGetGlobalPromiseType; - var getGlobalPromiseLikeType; - var getInstantiatedGlobalPromiseLikeType; - var getGlobalPromiseConstructorLikeType; - var getGlobalThenableType; - var jsxElementClassType; + var deferredGlobalESSymbolConstructorSymbol; + var deferredGlobalESSymbolType; + var deferredGlobalTypedPropertyDescriptorType; + var deferredGlobalPromiseType; + var deferredGlobalPromiseConstructorSymbol; + var deferredGlobalPromiseConstructorLikeType; + var deferredGlobalIterableType; + var deferredGlobalIteratorType; + var deferredGlobalIterableIteratorType; + var deferredGlobalAsyncIterableType; + var deferredGlobalAsyncIteratorType; + var deferredGlobalAsyncIterableIteratorType; + var deferredGlobalTemplateStringsArrayType; + var deferredJsxElementClassType; + var deferredJsxElementType; + var deferredJsxStatelessElementType; var deferredNodes; var deferredUnusedIdentifierNodes; var flowLoopStart = 0; @@ -24299,6 +25658,7 @@ var ts; var visitedFlowNodes = []; var visitedFlowTypes = []; var potentialThisCollisions = []; + var potentialNewTargetCollisions = []; var awaitedTypeStack = []; var diagnostics = ts.createDiagnosticCollection(); var TypeFacts; @@ -24364,7 +25724,7 @@ var ts; TypeFacts[TypeFacts["UndefinedFacts"] = 2457472] = "UndefinedFacts"; TypeFacts[TypeFacts["NullFacts"] = 2340752] = "NullFacts"; })(TypeFacts || (TypeFacts = {})); - var typeofEQFacts = ts.createMap({ + var typeofEQFacts = ts.createMapFromTemplate({ "string": 1 /* TypeofEQString */, "number": 2 /* TypeofEQNumber */, "boolean": 4 /* TypeofEQBoolean */, @@ -24373,7 +25733,7 @@ var ts; "object": 16 /* TypeofEQObject */, "function": 32 /* TypeofEQFunction */ }); - var typeofNEFacts = ts.createMap({ + var typeofNEFacts = ts.createMapFromTemplate({ "string": 128 /* TypeofNEString */, "number": 256 /* TypeofNENumber */, "boolean": 512 /* TypeofNEBoolean */, @@ -24382,14 +25742,14 @@ var ts; "object": 2048 /* TypeofNEObject */, "function": 4096 /* TypeofNEFunction */ }); - var typeofTypesByName = ts.createMap({ + var typeofTypesByName = ts.createMapFromTemplate({ "string": stringType, "number": numberType, "boolean": booleanType, "symbol": esSymbolType, "undefined": undefinedType }); - var jsxElementType; + var typeofType = createTypeofType(); var _jsxNamespace; var _jsxFactoryEntity; /** Things we lazy load from the JSX namespace */ @@ -24417,8 +25777,14 @@ var ts; TypeSystemPropertyName[TypeSystemPropertyName["DeclaredType"] = 2] = "DeclaredType"; TypeSystemPropertyName[TypeSystemPropertyName["ResolvedReturnType"] = 3] = "ResolvedReturnType"; })(TypeSystemPropertyName || (TypeSystemPropertyName = {})); + var CheckMode; + (function (CheckMode) { + CheckMode[CheckMode["Normal"] = 0] = "Normal"; + CheckMode[CheckMode["SkipContextSensitive"] = 1] = "SkipContextSensitive"; + CheckMode[CheckMode["Inferential"] = 2] = "Inferential"; + })(CheckMode || (CheckMode = {})); var builtinGlobals = ts.createMap(); - builtinGlobals[undefinedSymbol.name] = undefinedSymbol; + builtinGlobals.set(undefinedSymbol.name, undefinedSymbol); initializeTypeChecker(); return checker; function getJsxNamespace() { @@ -24450,7 +25816,12 @@ var ts; } function createSymbol(flags, name) { symbolCount++; - return new Symbol(flags, name); + var symbol = (new Symbol(flags | 134217728 /* Transient */, name)); + symbol.checkFlags = 0; + return symbol; + } + function isTransientSymbol(symbol) { + return (symbol.flags & 134217728 /* Transient */) !== 0; } function getExcludedSymbolFlags(flags) { var result = 0; @@ -24496,7 +25867,7 @@ var ts; mergedSymbols[source.mergeId] = target; } function cloneSymbol(symbol) { - var result = createSymbol(symbol.flags | 33554432 /* Merged */, symbol.name); + var result = createSymbol(symbol.flags, symbol.name); result.declarations = symbol.declarations.slice(0); result.parent = symbol.parent; if (symbol.valueDeclaration) @@ -24519,13 +25890,11 @@ var ts; target.flags |= source.flags; if (source.valueDeclaration && (!target.valueDeclaration || - (target.valueDeclaration.kind === 230 /* ModuleDeclaration */ && source.valueDeclaration.kind !== 230 /* ModuleDeclaration */))) { + (target.valueDeclaration.kind === 232 /* ModuleDeclaration */ && source.valueDeclaration.kind !== 232 /* ModuleDeclaration */))) { // other kinds of value declarations take precedence over modules target.valueDeclaration = source.valueDeclaration; } - ts.forEach(source.declarations, function (node) { - target.declarations.push(node); - }); + ts.addRange(target.declarations, source.declarations); if (source.members) { if (!target.members) target.members = ts.createMap(); @@ -24538,6 +25907,9 @@ var ts; } recordMergedSymbol(target, source); } + else if (target.flags & 1024 /* NamespaceModule */) { + error(source.valueDeclaration.name, ts.Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target)); + } else { var message_2 = target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; @@ -24550,18 +25922,19 @@ var ts; } } function mergeSymbolTable(target, source) { - for (var id in source) { - var targetSymbol = target[id]; + source.forEach(function (sourceSymbol, id) { + var targetSymbol = target.get(id); if (!targetSymbol) { - target[id] = source[id]; + target.set(id, sourceSymbol); } else { - if (!(targetSymbol.flags & 33554432 /* Merged */)) { - target[id] = targetSymbol = cloneSymbol(targetSymbol); + if (!(targetSymbol.flags & 134217728 /* Transient */)) { + targetSymbol = cloneSymbol(targetSymbol); + target.set(id, targetSymbol); } - mergeSymbol(targetSymbol, source[id]); + mergeSymbol(targetSymbol, sourceSymbol); } - } + }); } function mergeModuleAugmentation(moduleName) { var moduleAugmentation = moduleName.parent; @@ -24590,7 +25963,7 @@ var ts; if (mainModule.flags & 1920 /* Namespace */) { // if module symbol has already been merged - it is safe to use it. // otherwise clone it - mainModule = mainModule.flags & 33554432 /* Merged */ ? mainModule : cloneSymbol(mainModule); + mainModule = mainModule.flags & 134217728 /* Transient */ ? mainModule : cloneSymbol(mainModule); mergeSymbol(mainModule, moduleAugmentation.symbol); } else { @@ -24599,21 +25972,22 @@ var ts; } } function addToSymbolTable(target, source, message) { - for (var id in source) { - if (target[id]) { + source.forEach(function (sourceSymbol, id) { + var targetSymbol = target.get(id); + if (targetSymbol) { // Error on redeclarations - ts.forEach(target[id].declarations, addDeclarationDiagnostic(id, message)); + ts.forEach(targetSymbol.declarations, addDeclarationDiagnostic(id, message)); } else { - target[id] = source[id]; + target.set(id, sourceSymbol); } - } + }); function addDeclarationDiagnostic(id, message) { return function (declaration) { return diagnostics.add(ts.createDiagnosticForNode(declaration, message, id)); }; } } function getSymbolLinks(symbol) { - if (symbol.flags & 67108864 /* Transient */) + if (symbol.flags & 134217728 /* Transient */) return symbol; var id = getSymbolId(symbol); return symbolLinks[id] || (symbolLinks[id] = {}); @@ -24625,14 +25999,17 @@ var ts; function getObjectFlags(type) { return type.flags & 32768 /* Object */ ? type.objectFlags : 0; } + function getCheckFlags(symbol) { + return symbol.flags & 134217728 /* Transient */ ? symbol.checkFlags : 0; + } function isGlobalSourceFile(node) { - return node.kind === 261 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 264 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { - var symbol = symbols[name]; + var symbol = symbols.get(name); if (symbol) { - ts.Debug.assert((symbol.flags & 16777216 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); if (symbol.flags & meaning) { return symbol; } @@ -24669,12 +26046,12 @@ var ts; if (declarationFile !== useFile) { if ((modulekind && (declarationFile.externalModuleIndicator || useFile.externalModuleIndicator)) || (!compilerOptions.outFile && !compilerOptions.out)) { - // nodes are in different files and order cannot be determines + // nodes are in different files and order cannot be determined return true; } // declaration is after usage // can be legal if usage is deferred (i.e. inside function or in initializer of instance property) - if (isUsedInFunctionOrNonStaticProperty(usage)) { + if (isUsedInFunctionOrInstanceProperty(usage, declaration)) { return true; } var sourceFiles = host.getSourceFiles(); @@ -24682,20 +26059,41 @@ var ts; } if (declaration.pos <= usage.pos) { // declaration is before usage - // still might be illegal if usage is in the initializer of the variable declaration - return declaration.kind !== 223 /* VariableDeclaration */ || - !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); + if (declaration.kind === 175 /* BindingElement */) { + // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2]) + var errorBindingElement = ts.getAncestor(usage, 175 /* BindingElement */); + if (errorBindingElement) { + return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || + declaration.pos < errorBindingElement.pos; + } + // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a) + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 225 /* VariableDeclaration */), usage); + } + else if (declaration.kind === 225 /* VariableDeclaration */) { + // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) + return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); + } + return true; + } + // declaration is after usage, but it can still be legal if usage is deferred: + // 1. inside an export specifier + // 2. inside a function + // 3. inside an instance property initializer, a reference to a non-instance property + // 4. inside a static property initializer, a reference to a static method in the same class + // or if usage is in a type context: + // 1. inside a type query (typeof in type position) + if (usage.parent.kind === 245 /* ExportSpecifier */) { + // export specifiers do not use the variable, they only make it available for use + return true; } - // declaration is after usage - // can be legal if usage is deferred (i.e. inside function or in initializer of instance property) var container = ts.getEnclosingBlockScopeContainer(declaration); - return isUsedInFunctionOrNonStaticProperty(usage, container); + return isInTypeQuery(usage) || isUsedInFunctionOrInstanceProperty(usage, declaration, container); function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 205 /* VariableStatement */: - case 211 /* ForStatement */: - case 213 /* ForOfStatement */: + case 207 /* VariableStatement */: + case 213 /* ForStatement */: + case 215 /* ForOfStatement */: // variable statement/for/for-of statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) if (isSameScopeDescendentOf(usage, declaration, container)) { @@ -24704,8 +26102,8 @@ var ts; break; } switch (declaration.parent.parent.kind) { - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: // ForIn/ForOf case - use site should not be used in expression part if (isSameScopeDescendentOf(usage, declaration.parent.parent.expression, container)) { return true; @@ -24713,25 +26111,31 @@ var ts; } return false; } - function isUsedInFunctionOrNonStaticProperty(usage, container) { - var current = usage; - while (current) { + function isUsedInFunctionOrInstanceProperty(usage, declaration, container) { + return !!ts.findAncestor(usage, function (current) { if (current === container) { - return false; + return "quit"; } if (ts.isFunctionLike(current)) { return true; } - var initializerOfNonStaticProperty = current.parent && - current.parent.kind === 147 /* PropertyDeclaration */ && - (ts.getModifierFlags(current.parent) & 32 /* Static */) === 0 && + var initializerOfProperty = current.parent && + current.parent.kind === 148 /* PropertyDeclaration */ && current.parent.initializer === current; - if (initializerOfNonStaticProperty) { - return true; + if (initializerOfProperty) { + if (ts.getModifierFlags(current.parent) & 32 /* Static */) { + if (declaration.kind === 150 /* MethodDeclaration */) { + return true; + } + } + else { + var isDeclarationInstanceProperty = declaration.kind === 148 /* PropertyDeclaration */ && !(ts.getModifierFlags(declaration) & 32 /* Static */); + if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { + return true; + } + } } - current = current.parent; - } - return false; + }); } } // Resolve a given name for a given meaning at a given location. An error is reported if the name was not found and @@ -24756,11 +26160,11 @@ var ts; // - parameters are only in the scope of function body // This restriction does not apply to JSDoc comment types because they are parented // at a higher level than type parameters would normally be - if (meaning & result.flags & 793064 /* Type */ && lastLocation.kind !== 278 /* JSDocComment */) { + if (meaning & result.flags & 793064 /* Type */ && lastLocation.kind !== 282 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ ? lastLocation === location.type || - lastLocation.kind === 144 /* Parameter */ || - lastLocation.kind === 143 /* TypeParameter */ + lastLocation.kind === 145 /* Parameter */ || + lastLocation.kind === 144 /* TypeParameter */ : false; } if (meaning & 107455 /* Value */ && result.flags & 1 /* FunctionScopedVariable */) { @@ -24769,9 +26173,9 @@ var ts; // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 144 /* Parameter */ || + lastLocation.kind === 145 /* Parameter */ || (lastLocation === location.type && - result.valueDeclaration.kind === 144 /* Parameter */); + result.valueDeclaration.kind === 145 /* Parameter */); } } if (useResult) { @@ -24783,16 +26187,17 @@ var ts; } } switch (location.kind) { - case 261 /* SourceFile */: + case 264 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; - case 230 /* ModuleDeclaration */: + // falls through + case 232 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports; - if (location.kind === 261 /* SourceFile */ || ts.isAmbientModule(location)) { + if (location.kind === 264 /* SourceFile */ || ts.isAmbientModule(location)) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. - if (result = moduleExports["default"]) { + if (result = moduleExports.get("default")) { var localSymbol = ts.getLocalSymbolForExportDefault(result); if (localSymbol && (result.flags & meaning) && localSymbol.name === name) { break loop; @@ -24810,9 +26215,10 @@ var ts; // 2. We check === SymbolFlags.Alias in order to check that the symbol is *purely* // an alias. If we used &, we'd be throwing out symbols that have non alias aspects, // which is not the desired behavior. - if (moduleExports[name] && - moduleExports[name].flags === 8388608 /* Alias */ && - ts.getDeclarationOfKind(moduleExports[name], 243 /* ExportSpecifier */)) { + var moduleExport = moduleExports.get(name); + if (moduleExport && + moduleExport.flags === 8388608 /* Alias */ && + ts.getDeclarationOfKind(moduleExport, 245 /* ExportSpecifier */)) { break; } } @@ -24820,13 +26226,13 @@ var ts; break loop; } break; - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -24843,10 +26249,15 @@ var ts; } } break; - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 229 /* InterfaceDeclaration */: if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793064 /* Type */)) { + if (!isTypeParameterSymbolDeclaredInContainer(result, location)) { + // ignore type parameters not declared in this container + result = undefined; + break; + } if (lastLocation && ts.getModifierFlags(lastLocation) & 32 /* Static */) { // TypeScript 1.0 spec (April 2014): 3.4.1 // The scope of a type parameter extends over the entire declaration with which the type @@ -24856,7 +26267,7 @@ var ts; } break loop; } - if (location.kind === 197 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 198 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.text) { result = location.symbol; @@ -24872,9 +26283,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 142 /* ComputedPropertyName */: + case 143 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 227 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 229 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = getSymbol(getSymbolOfNode(grandparent).members, name, meaning & 793064 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -24882,19 +26293,19 @@ var ts; } } break; - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 225 /* FunctionDeclaration */: - case 185 /* ArrowFunction */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 227 /* FunctionDeclaration */: + case 186 /* ArrowFunction */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 184 /* FunctionExpression */: + case 185 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -24907,7 +26318,7 @@ var ts; } } break; - case 145 /* Decorator */: + case 146 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -24916,7 +26327,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 144 /* Parameter */) { + if (location.parent && location.parent.kind === 145 /* Parameter */) { location = location.parent; } // @@ -24945,7 +26356,8 @@ var ts; !checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && !checkAndReportErrorForExtendingInterface(errorLocation) && !checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) && - !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning)) { + !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) && + !checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning)) { error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); } } @@ -24967,31 +26379,41 @@ var ts; // interface bar {} // } // const foo/*1*/: foo/*2*/.bar; - // The foo at /*1*/ and /*2*/ will share same symbol with two meaning - // block - scope variable and namespace module. However, only when we + // The foo at /*1*/ and /*2*/ will share same symbol with two meanings: + // block-scoped variable and namespace module. However, only when we // try to resolve name in /*1*/ which is used in variable position, - // we want to check for block- scoped - if (meaning & 2 /* BlockScopedVariable */) { + // we want to check for block-scoped + if (meaning & 2 /* BlockScopedVariable */ || + ((meaning & 32 /* Class */ || meaning & 384 /* Enum */) && (meaning & 107455 /* Value */) === 107455 /* Value */)) { var exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result); - if (exportOrLocalSymbol.flags & 2 /* BlockScopedVariable */) { + if (exportOrLocalSymbol.flags & 2 /* BlockScopedVariable */ || exportOrLocalSymbol.flags & 32 /* Class */ || exportOrLocalSymbol.flags & 384 /* Enum */) { checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation); } } // If we're in an external module, we can't reference value symbols created from UMD export declarations if (result && isInExternalModule && (meaning & 107455 /* Value */) === 107455 /* Value */) { var decls = result.declarations; - if (decls && decls.length === 1 && decls[0].kind === 233 /* NamespaceExportDeclaration */) { + if (decls && decls.length === 1 && decls[0].kind === 235 /* NamespaceExportDeclaration */) { error(errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, name); } } } return result; } + function isTypeParameterSymbolDeclaredInContainer(symbol, container) { + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + if (decl.kind === 144 /* TypeParameter */ && decl.parent === container) { + return true; + } + } + return false; + } function checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) { if ((errorLocation.kind === 70 /* Identifier */ && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) { return false; } - var container = ts.getThisContainer(errorLocation, /* includeArrowFunctions */ true); + var container = ts.getThisContainer(errorLocation, /*includeArrowFunctions*/ true); var location = container; while (location) { if (ts.isClassLike(location.parent)) { @@ -25034,9 +26456,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 70 /* Identifier */: - case 177 /* PropertyAccessExpression */: + case 178 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 199 /* ExpressionWithTypeArguments */: + case 200 /* ExpressionWithTypeArguments */: ts.Debug.assert(ts.isEntityNameExpression(node.expression)); return node.expression; default: @@ -25063,13 +26485,38 @@ var ts; } return false; } + function checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) { + if (meaning & (107455 /* Value */ & ~1024 /* NamespaceModule */ & ~793064 /* Type */)) { + var symbol = resolveSymbol(resolveName(errorLocation, name, 1024 /* NamespaceModule */ & ~107455 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined)); + if (symbol) { + error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_value, name); + return true; + } + } + else if (meaning & (793064 /* Type */ & ~1024 /* NamespaceModule */ & ~107455 /* Value */)) { + var symbol = resolveSymbol(resolveName(errorLocation, name, 1024 /* NamespaceModule */ & ~793064 /* Type */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined)); + if (symbol) { + error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_type, name); + return true; + } + } + return false; + } function checkResolvedBlockScopedVariable(result, errorLocation) { - ts.Debug.assert((result.flags & 2 /* BlockScopedVariable */) !== 0); + ts.Debug.assert(!!(result.flags & 2 /* BlockScopedVariable */ || result.flags & 32 /* Class */ || result.flags & 384 /* Enum */)); // Block-scoped variables cannot be used before their definition - var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; }); - ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); - if (!ts.isInAmbientContext(declaration) && !isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 223 /* VariableDeclaration */), errorLocation)) { - error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 231 /* EnumDeclaration */) ? d : undefined; }); + ts.Debug.assert(declaration !== undefined, "Declaration to checkResolvedBlockScopedVariable is undefined"); + if (!ts.isInAmbientContext(declaration) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { + if (result.flags & 2 /* BlockScopedVariable */) { + error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + } + else if (result.flags & 32 /* Class */) { + error(errorLocation, ts.Diagnostics.Class_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + } + else if (result.flags & 384 /* Enum */) { + error(errorLocation, ts.Diagnostics.Enum_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + } } } /* Starting from 'initial' node walk up the parent chain until 'stopAt' node is reached. @@ -25077,56 +26524,50 @@ var ts; * Return false if 'stopAt' node is reached or isFunctionLike(current) === true. */ function isSameScopeDescendentOf(initial, parent, stopAt) { - if (!parent) { - return false; - } - for (var current = initial; current && current !== stopAt && !ts.isFunctionLike(current); current = current.parent) { - if (current === parent) { - return true; - } - } - return false; + return parent && !!ts.findAncestor(initial, function (n) { return n === stopAt || ts.isFunctionLike(n) ? "quit" : n === parent; }); } function getAnyImportSyntax(node) { if (ts.isAliasSymbolDeclaration(node)) { - if (node.kind === 234 /* ImportEqualsDeclaration */) { + if (node.kind === 236 /* ImportEqualsDeclaration */) { return node; } - while (node && node.kind !== 235 /* ImportDeclaration */) { - node = node.parent; - } - return node; + return ts.findAncestor(node, function (n) { return n.kind === 237 /* ImportDeclaration */; }); } } function getDeclarationOfAliasSymbol(symbol) { - return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); + return ts.find(symbol.declarations, ts.isAliasSymbolDeclaration); } - function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 245 /* ExternalModuleReference */) { + function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { + if (node.moduleReference.kind === 247 /* ExternalModuleReference */) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } - return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference); + return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias); } - function getTargetOfImportClause(node) { + function getTargetOfImportClause(node, dontResolveAlias) { var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { - var exportDefaultSymbol = ts.isShorthandAmbientModuleSymbol(moduleSymbol) ? - moduleSymbol : - moduleSymbol.exports["export="] ? - getPropertyOfType(getTypeOfSymbol(moduleSymbol.exports["export="]), "default") : - resolveSymbol(moduleSymbol.exports["default"]); + var exportDefaultSymbol = void 0; + if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { + exportDefaultSymbol = moduleSymbol; + } + else { + var exportValue = moduleSymbol.exports.get("export="); + exportDefaultSymbol = exportValue + ? getPropertyOfType(getTypeOfSymbol(exportValue), "default") + : resolveSymbol(moduleSymbol.exports.get("default"), dontResolveAlias); + } if (!exportDefaultSymbol && !allowSyntheticDefaultImports) { error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); } else if (!exportDefaultSymbol && allowSyntheticDefaultImports) { - return resolveExternalModuleSymbol(moduleSymbol) || resolveSymbol(moduleSymbol); + return resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); } return exportDefaultSymbol; } } - function getTargetOfNamespaceImport(node) { + function getTargetOfNamespaceImport(node, dontResolveAlias) { var moduleSpecifier = node.parent.parent.moduleSpecifier; - return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier); + return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier, dontResolveAlias); } // This function creates a synthetic symbol that combines the value side of one symbol with the // type/namespace side of another symbol. Consider this example: @@ -25161,12 +26602,9 @@ var ts; result.exports = valueSymbol.exports; return result; } - function getExportOfModule(symbol, name) { + function getExportOfModule(symbol, name, dontResolveAlias) { if (symbol.flags & 1536 /* Module */) { - var exportedSymbol = getExportsOfSymbol(symbol)[name]; - if (exportedSymbol) { - return resolveSymbol(exportedSymbol); - } + return resolveSymbol(getExportsOfSymbol(symbol).get(name), dontResolveAlias); } } function getPropertyOfVariable(symbol, name) { @@ -25177,74 +26615,75 @@ var ts; } } } - function getExternalModuleMember(node, specifier) { + function getExternalModuleMember(node, specifier, dontResolveAlias) { var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); - var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier); + var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier, dontResolveAlias); if (targetSymbol) { - var name_16 = specifier.propertyName || specifier.name; - if (name_16.text) { + var name = specifier.propertyName || specifier.name; + if (name.text) { if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { return moduleSymbol; } var symbolFromVariable = void 0; // First check if module was specified with "export=". If so, get the member from the resolved type - if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports["export="]) { - symbolFromVariable = getPropertyOfType(getTypeOfSymbol(targetSymbol), name_16.text); + if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports.get("export=")) { + symbolFromVariable = getPropertyOfType(getTypeOfSymbol(targetSymbol), name.text); } else { - symbolFromVariable = getPropertyOfVariable(targetSymbol, name_16.text); + symbolFromVariable = getPropertyOfVariable(targetSymbol, name.text); } // if symbolFromVariable is export - get its final target - symbolFromVariable = resolveSymbol(symbolFromVariable); - var symbolFromModule = getExportOfModule(targetSymbol, name_16.text); + symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias); + var symbolFromModule = getExportOfModule(targetSymbol, name.text, dontResolveAlias); // If the export member we're looking for is default, and there is no real default but allowSyntheticDefaultImports is on, return the entire module as the default - if (!symbolFromModule && allowSyntheticDefaultImports && name_16.text === "default") { - symbolFromModule = resolveExternalModuleSymbol(moduleSymbol) || resolveSymbol(moduleSymbol); + if (!symbolFromModule && allowSyntheticDefaultImports && name.text === "default") { + symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); } var symbol = symbolFromModule && symbolFromVariable ? combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) : symbolFromModule || symbolFromVariable; if (!symbol) { - error(name_16, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name_16)); + error(name, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name)); } return symbol; } } } - function getTargetOfImportSpecifier(node) { - return getExternalModuleMember(node.parent.parent.parent, node); + function getTargetOfImportSpecifier(node, dontResolveAlias) { + return getExternalModuleMember(node.parent.parent.parent, node, dontResolveAlias); } - function getTargetOfNamespaceExportDeclaration(node) { - return resolveExternalModuleSymbol(node.parent.symbol); + function getTargetOfNamespaceExportDeclaration(node, dontResolveAlias) { + return resolveExternalModuleSymbol(node.parent.symbol, dontResolveAlias); } - function getTargetOfExportSpecifier(node) { + function getTargetOfExportSpecifier(node, dontResolveAlias) { return node.parent.parent.moduleSpecifier ? - getExternalModuleMember(node.parent.parent, node) : - resolveEntityName(node.propertyName || node.name, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */); + getExternalModuleMember(node.parent.parent, node, dontResolveAlias) : + resolveEntityName(node.propertyName || node.name, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } - function getTargetOfExportAssignment(node) { - return resolveEntityName(node.expression, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */); + function getTargetOfExportAssignment(node, dontResolveAlias) { + return resolveEntityName(node.expression, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } - function getTargetOfAliasDeclaration(node) { + function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { switch (node.kind) { - case 234 /* ImportEqualsDeclaration */: - return getTargetOfImportEqualsDeclaration(node); - case 236 /* ImportClause */: - return getTargetOfImportClause(node); - case 237 /* NamespaceImport */: - return getTargetOfNamespaceImport(node); - case 239 /* ImportSpecifier */: - return getTargetOfImportSpecifier(node); - case 243 /* ExportSpecifier */: - return getTargetOfExportSpecifier(node); - case 240 /* ExportAssignment */: - return getTargetOfExportAssignment(node); - case 233 /* NamespaceExportDeclaration */: - return getTargetOfNamespaceExportDeclaration(node); + case 236 /* ImportEqualsDeclaration */: + return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); + case 238 /* ImportClause */: + return getTargetOfImportClause(node, dontRecursivelyResolve); + case 239 /* NamespaceImport */: + return getTargetOfNamespaceImport(node, dontRecursivelyResolve); + case 241 /* ImportSpecifier */: + return getTargetOfImportSpecifier(node, dontRecursivelyResolve); + case 245 /* ExportSpecifier */: + return getTargetOfExportSpecifier(node, dontRecursivelyResolve); + case 242 /* ExportAssignment */: + return getTargetOfExportAssignment(node, dontRecursivelyResolve); + case 235 /* NamespaceExportDeclaration */: + return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); } } - function resolveSymbol(symbol) { - return symbol && symbol.flags & 8388608 /* Alias */ && !(symbol.flags & (107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */)) ? resolveAlias(symbol) : symbol; + function resolveSymbol(symbol, dontResolveAlias) { + var shouldResolve = !dontResolveAlias && symbol && symbol.flags & 8388608 /* Alias */ && !(symbol.flags & (107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */)); + return shouldResolve ? resolveAlias(symbol) : symbol; } function resolveAlias(symbol) { ts.Debug.assert((symbol.flags & 8388608 /* Alias */) !== 0, "Should only get Alias here."); @@ -25286,11 +26725,11 @@ var ts; links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); ts.Debug.assert(!!node); - if (node.kind === 240 /* ExportAssignment */) { + if (node.kind === 242 /* ExportAssignment */) { // export default checkExpressionCached(node.expression); } - else if (node.kind === 243 /* ExportSpecifier */) { + else if (node.kind === 245 /* ExportSpecifier */) { // export { } or export { as foo } checkExpressionCached(node.propertyName || node.name); } @@ -25312,20 +26751,22 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 70 /* Identifier */ || entityName.parent.kind === 141 /* QualifiedName */) { + if (entityName.kind === 70 /* Identifier */ || entityName.parent.kind === 142 /* QualifiedName */) { return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 234 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 236 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } function getFullyQualifiedName(symbol) { return symbol.parent ? getFullyQualifiedName(symbol.parent) + "." + symbolToString(symbol) : symbolToString(symbol); } - // Resolves a qualified name and any involved aliases + /** + * Resolves a qualified name and any involved aliases. + */ function resolveEntityName(name, meaning, ignoreErrors, dontResolveAlias, location) { if (ts.nodeIsMissing(name)) { return undefined; @@ -25338,9 +26779,23 @@ var ts; return undefined; } } - else if (name.kind === 141 /* QualifiedName */ || name.kind === 177 /* PropertyAccessExpression */) { - var left = name.kind === 141 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 141 /* QualifiedName */ ? name.right : name.name; + else if (name.kind === 142 /* QualifiedName */ || name.kind === 178 /* PropertyAccessExpression */) { + var left = void 0; + if (name.kind === 142 /* QualifiedName */) { + left = name.left; + } + else if (name.kind === 178 /* PropertyAccessExpression */ && + (name.expression.kind === 184 /* ParenthesizedExpression */ || ts.isEntityNameExpression(name.expression))) { + left = name.expression; + } + else { + // If the expression in property-access expression is not entity-name or parenthsizedExpression (e.g. it is a call expression), it won't be able to successfully resolve the name. + // This is the case when we are trying to do any language service operation in heritage clauses. By return undefined, the getSymbolOfEntityNameOrPropertyAccessExpression + // will attempt to checkPropertyAccessExpression to resolve symbol. + // i.e class C extends foo()./*do language service operation here*/B {} + return undefined; + } + var right = name.kind === 142 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, 1920 /* Namespace */, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -25356,10 +26811,19 @@ var ts; return undefined; } } + else if (name.kind === 184 /* ParenthesizedExpression */) { + // If the expression in parenthesizedExpression is not an entity-name (e.g. it is a call expression), it won't be able to successfully resolve the name. + // This is the case when we are trying to do any language service operation in heritage clauses. + // By return undefined, the getSymbolOfEntityNameOrPropertyAccessExpression will attempt to checkPropertyAccessExpression to resolve symbol. + // i.e class C extends foo()./*do language service operation here*/B {} + return ts.isEntityNameExpression(name.expression) ? + resolveEntityName(name.expression, meaning, ignoreErrors, dontResolveAlias, location) : + undefined; + } else { ts.Debug.fail("Unknown entity name kind."); } - ts.Debug.assert((symbol.flags & 16777216 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); } function resolveExternalModuleName(location, moduleReferenceExpression) { @@ -25367,7 +26831,7 @@ var ts; } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } - if (moduleReferenceExpression.kind !== 9 /* StringLiteral */) { + if (moduleReferenceExpression.kind !== 9 /* StringLiteral */ && moduleReferenceExpression.kind !== 12 /* NoSubstitutionTemplateLiteral */) { return; } var moduleReferenceLiteral = moduleReferenceExpression; @@ -25409,11 +26873,10 @@ var ts; // May be an untyped module. If so, ignore resolutionDiagnostic. if (!isRelative && resolvedModule && !ts.extensionIsTypeScript(resolvedModule.extension)) { if (isForAugmentation) { - ts.Debug.assert(!!moduleNotFoundError); var diag = ts.Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented; - error(errorNode, diag, moduleName, resolvedModule.resolvedFileName); + error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName); } - else if (compilerOptions.noImplicitAny && moduleNotFoundError) { + else if (noImplicitAny && moduleNotFoundError) { error(errorNode, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedModule.resolvedFileName); } // Failed imports and untyped modules are both treated in an untyped manner; only difference is whether we give a diagnostic first. @@ -25439,30 +26902,38 @@ var ts; } // An external module with an 'export =' declaration resolves to the target of the 'export =' declaration, // and an external module with no 'export =' declaration resolves to the module itself. - function resolveExternalModuleSymbol(moduleSymbol) { - return moduleSymbol && getMergedSymbol(resolveSymbol(moduleSymbol.exports["export="])) || moduleSymbol; + function resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) { + return moduleSymbol && getMergedSymbol(resolveSymbol(moduleSymbol.exports.get("export="), dontResolveAlias)) || moduleSymbol; } // An external module with an 'export =' declaration may be referenced as an ES6 module provided the 'export =' // references a symbol that is at least declared as a module or a variable. The target of the 'export =' may // combine other declarations with the module or variable (e.g. a class/module, function/module, interface/variable). - function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression) { - var symbol = resolveExternalModuleSymbol(moduleSymbol); - if (symbol && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */))) { + function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression, dontResolveAlias) { + var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); + if (!dontResolveAlias && symbol && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */))) { error(moduleReferenceExpression, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); symbol = undefined; } return symbol; } function hasExportAssignmentSymbol(moduleSymbol) { - return moduleSymbol.exports["export="] !== undefined; + return moduleSymbol.exports.get("export=") !== undefined; } function getExportsOfModuleAsArray(moduleSymbol) { return symbolsToArray(getExportsOfModule(moduleSymbol)); } + function getExportsAndPropertiesOfModule(moduleSymbol) { + var exports = getExportsOfModuleAsArray(moduleSymbol); + var exportEquals = resolveExternalModuleSymbol(moduleSymbol); + if (exportEquals !== moduleSymbol) { + ts.addRange(exports, getPropertiesOfType(getTypeOfSymbol(exportEquals))); + } + return exports; + } function tryGetMemberInModuleExports(memberName, moduleSymbol) { var symbolTable = getExportsOfModule(moduleSymbol); if (symbolTable) { - return symbolTable[memberName]; + return symbolTable.get(memberName); } } function getExportsOfSymbol(symbol) { @@ -25477,24 +26948,28 @@ var ts; * Not passing `lookupTable` and `exportNode` disables this collection, and just extends the tables */ function extendExportSymbols(target, source, lookupTable, exportNode) { - for (var id in source) { - if (id !== "default" && !target[id]) { - target[id] = source[id]; + source && source.forEach(function (sourceSymbol, id) { + if (id === "default") + return; + var targetSymbol = target.get(id); + if (!targetSymbol) { + target.set(id, sourceSymbol); if (lookupTable && exportNode) { - lookupTable[id] = { + lookupTable.set(id, { specifierText: ts.getTextOfNode(exportNode.moduleSpecifier) - }; + }); } } - else if (lookupTable && exportNode && id !== "default" && target[id] && resolveSymbol(target[id]) !== resolveSymbol(source[id])) { - if (!lookupTable[id].exportsWithDuplicate) { - lookupTable[id].exportsWithDuplicate = [exportNode]; + else if (lookupTable && exportNode && targetSymbol && resolveSymbol(targetSymbol) !== resolveSymbol(sourceSymbol)) { + var collisionTracker = lookupTable.get(id); + if (!collisionTracker.exportsWithDuplicate) { + collisionTracker.exportsWithDuplicate = [exportNode]; } else { - lookupTable[id].exportsWithDuplicate.push(exportNode); + collisionTracker.exportsWithDuplicate.push(exportNode); } } - } + }); } function getExportsForModule(moduleSymbol) { var visitedSymbols = []; @@ -25510,27 +26985,27 @@ var ts; visitedSymbols.push(symbol); var symbols = ts.cloneMap(symbol.exports); // All export * declarations are collected in an __export symbol by the binder - var exportStars = symbol.exports["__export"]; + var exportStars = symbol.exports.get("__export"); if (exportStars) { var nestedSymbols = ts.createMap(); - var lookupTable = ts.createMap(); + var lookupTable_1 = ts.createMap(); for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) { var node = _a[_i]; var resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier); var exportedSymbols = visit(resolvedModule); - extendExportSymbols(nestedSymbols, exportedSymbols, lookupTable, node); + extendExportSymbols(nestedSymbols, exportedSymbols, lookupTable_1, node); } - for (var id in lookupTable) { - var exportsWithDuplicate = lookupTable[id].exportsWithDuplicate; + lookupTable_1.forEach(function (_a, id) { + var exportsWithDuplicate = _a.exportsWithDuplicate; // It's not an error if the file with multiple `export *`s with duplicate names exports a member with that name itself - if (id === "export=" || !(exportsWithDuplicate && exportsWithDuplicate.length) || symbols[id]) { - continue; + if (id === "export=" || !(exportsWithDuplicate && exportsWithDuplicate.length) || symbols.has(id)) { + return; } - for (var _b = 0, exportsWithDuplicate_1 = exportsWithDuplicate; _b < exportsWithDuplicate_1.length; _b++) { - var node = exportsWithDuplicate_1[_b]; - diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity, lookupTable[id].specifierText, id)); + for (var _i = 0, exportsWithDuplicate_1 = exportsWithDuplicate; _i < exportsWithDuplicate_1.length; _i++) { + var node = exportsWithDuplicate_1[_i]; + diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity, lookupTable_1.get(id).specifierText, id)); } - } + }); extendExportSymbols(symbols, nestedSymbols); } return symbols; @@ -25552,26 +27027,13 @@ var ts; : symbol; } function symbolIsValue(symbol) { - // If it is an instantiated symbol, then it is a value if the symbol it is an - // instantiation of is a value. - if (symbol.flags & 16777216 /* Instantiated */) { - return symbolIsValue(getSymbolLinks(symbol).target); - } - // If the symbol has the value flag, it is trivially a value. - if (symbol.flags & 107455 /* Value */) { - return true; - } - // If it is an alias, then it is a value if the symbol it resolves to is a value. - if (symbol.flags & 8388608 /* Alias */) { - return (resolveAlias(symbol).flags & 107455 /* Value */) !== 0; - } - return false; + return !!(symbol.flags & 107455 /* Value */ || symbol.flags & 8388608 /* Alias */ && resolveAlias(symbol).flags & 107455 /* Value */); } function findConstructorDeclaration(node) { var members = node.members; for (var _i = 0, members_1 = members; _i < members_1.length; _i++) { var member = members_1[_i]; - if (member.kind === 150 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 151 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -25599,6 +27061,9 @@ var ts; type.symbol = symbol; return type; } + function createTypeofType() { + return getUnionType(ts.convertToArray(typeofEQFacts.keys(), function (s) { return getLiteralTypeForText(32 /* StringLiteral */, s); })); + } // A reserved member name starts with two underscores, but the third character cannot be an underscore // or the @ symbol. A third underscore indicates an escaped form of an identifer that started // with at least two underscores. The @ character indicates that the name is denoted by a well known ES @@ -25611,16 +27076,15 @@ var ts; } function getNamedMembers(members) { var result; - for (var id in members) { + members.forEach(function (symbol, id) { if (!isReservedMemberName(id)) { if (!result) result = []; - var symbol = members[id]; if (symbolIsValue(symbol)) { result.push(symbol); } } - } + }); return result || emptyArray; } function setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) { @@ -25639,20 +27103,21 @@ var ts; } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; - for (var location_1 = enclosingDeclaration; location_1; location_1 = location_1.parent) { + for (var location = enclosingDeclaration; location; location = location.parent) { // Locals of a source file are not in scope (because they get merged into the global symbol table) - if (location_1.locals && !isGlobalSourceFile(location_1)) { - if (result = callback(location_1.locals)) { + if (location.locals && !isGlobalSourceFile(location)) { + if (result = callback(location.locals)) { return result; } } - switch (location_1.kind) { - case 261 /* SourceFile */: - if (!ts.isExternalOrCommonJsModule(location_1)) { + switch (location.kind) { + case 264 /* SourceFile */: + if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 230 /* ModuleDeclaration */: - if (result = callback(getSymbolOfNode(location_1).exports)) { + // falls through + case 232 /* ModuleDeclaration */: + if (result = callback(getSymbolOfNode(location).exports)) { return result; } break; @@ -25666,6 +27131,16 @@ var ts; } function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing) { function getAccessibleSymbolChainFromSymbolTable(symbols) { + return getAccessibleSymbolChainFromSymbolTableWorker(symbols, []); + } + function getAccessibleSymbolChainFromSymbolTableWorker(symbols, visitedSymbolTables) { + if (ts.contains(visitedSymbolTables, symbols)) { + return undefined; + } + visitedSymbolTables.push(symbols); + var result = trySymbolTable(symbols); + visitedSymbolTables.pop(); + return result; function canQualifySymbol(symbolFromSymbolTable, meaning) { // If the symbol is equivalent and doesn't need further qualification, this symbol is accessible if (!needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning)) { @@ -25684,31 +27159,33 @@ var ts; canQualifySymbol(symbolFromSymbolTable, meaning); } } - // If symbol is directly available by its name in the symbol table - if (isAccessible(symbols[symbol.name])) { - return [symbol]; - } - // Check if symbol is any of the alias - return ts.forEachProperty(symbols, function (symbolFromSymbolTable) { - if (symbolFromSymbolTable.flags & 8388608 /* Alias */ - && symbolFromSymbolTable.name !== "export=" - && !ts.getDeclarationOfKind(symbolFromSymbolTable, 243 /* ExportSpecifier */)) { - if (!useOnlyExternalAliasing || - // Is this external alias, then use it to name - ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { - var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); - if (isAccessible(symbolFromSymbolTable, resolveAlias(symbolFromSymbolTable))) { - return [symbolFromSymbolTable]; - } - // Look in the exported members, if we can find accessibleSymbolChain, symbol is accessible using this chain - // but only if the symbolFromSymbolTable can be qualified - var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; - if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { - return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); + function trySymbolTable(symbols) { + // If symbol is directly available by its name in the symbol table + if (isAccessible(symbols.get(symbol.name))) { + return [symbol]; + } + // Check if symbol is any of the alias + return ts.forEachEntry(symbols, function (symbolFromSymbolTable) { + if (symbolFromSymbolTable.flags & 8388608 /* Alias */ + && symbolFromSymbolTable.name !== "export=" + && !ts.getDeclarationOfKind(symbolFromSymbolTable, 245 /* ExportSpecifier */)) { + if (!useOnlyExternalAliasing || + // Is this external alias, then use it to name + ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { + var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); + if (isAccessible(symbolFromSymbolTable, resolveAlias(symbolFromSymbolTable))) { + return [symbolFromSymbolTable]; + } + // Look in the exported members, if we can find accessibleSymbolChain, symbol is accessible using this chain + // but only if the symbolFromSymbolTable can be qualified + var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTableWorker(resolvedImportedSymbol.exports, visitedSymbolTables) : undefined; + if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { + return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); + } } } - } - }); + }); + } } if (symbol) { if (!(isPropertyOrMethodDeclarationSymbol(symbol))) { @@ -25720,7 +27197,7 @@ var ts; var qualify = false; forEachSymbolTableInScope(enclosingDeclaration, function (symbolTable) { // If symbol of this name is not available in the symbol table we are ok - var symbolFromSymbolTable = symbolTable[symbol.name]; + var symbolFromSymbolTable = symbolTable.get(symbol.name); if (!symbolFromSymbolTable) { // Continue to the next symbol table return false; @@ -25731,7 +27208,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 243 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 245 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -25746,10 +27223,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 147 /* PropertyDeclaration */: - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 148 /* PropertyDeclaration */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: continue; default: return false; @@ -25822,15 +27299,12 @@ var ts; } return { accessibility: 0 /* Accessible */ }; function getExternalModuleContainer(declaration) { - for (; declaration; declaration = declaration.parent) { - if (hasExternalModuleSymbol(declaration)) { - return getSymbolOfNode(declaration); - } - } + var node = ts.findAncestor(declaration, hasExternalModuleSymbol); + return node && getSymbolOfNode(node); } } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 261 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 264 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -25871,12 +27345,12 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 160 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { + if (entityName.parent.kind === 161 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { // Typeof value meaning = 107455 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 141 /* QualifiedName */ || entityName.kind === 177 /* PropertyAccessExpression */ || - entityName.parent.kind === 234 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 142 /* QualifiedName */ || entityName.kind === 178 /* PropertyAccessExpression */ || + entityName.parent.kind === 236 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; @@ -25928,6 +27402,516 @@ var ts; } return result; } + function createNodeBuilder() { + var context; + return { + typeToTypeNode: function (type, enclosingDeclaration, flags) { + context = createNodeBuilderContext(enclosingDeclaration, flags); + var resultingNode = typeToTypeNodeHelper(type); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + indexInfoToIndexSignatureDeclaration: function (indexInfo, kind, enclosingDeclaration, flags) { + context = createNodeBuilderContext(enclosingDeclaration, flags); + var resultingNode = indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + signatureToSignatureDeclaration: function (signature, kind, enclosingDeclaration, flags) { + context = createNodeBuilderContext(enclosingDeclaration, flags); + var resultingNode = signatureToSignatureDeclarationHelper(signature, kind); + var result = context.encounteredError ? undefined : resultingNode; + return result; + } + }; + function createNodeBuilderContext(enclosingDeclaration, flags) { + return { + enclosingDeclaration: enclosingDeclaration, + flags: flags, + encounteredError: false, + inObjectTypeLiteral: false, + checkAlias: true, + symbolStack: undefined + }; + } + function typeToTypeNodeHelper(type) { + if (!type) { + context.encounteredError = true; + // TODO(aozgaa): should we return implict any (undefined) or explicit any (keywordtypenode)? + return undefined; + } + if (type.flags & 1 /* Any */) { + return ts.createKeywordTypeNode(118 /* AnyKeyword */); + } + if (type.flags & 2 /* String */) { + return ts.createKeywordTypeNode(135 /* StringKeyword */); + } + if (type.flags & 4 /* Number */) { + return ts.createKeywordTypeNode(132 /* NumberKeyword */); + } + if (type.flags & 8 /* Boolean */) { + return ts.createKeywordTypeNode(121 /* BooleanKeyword */); + } + if (type.flags & 16 /* Enum */) { + var name = symbolToName(type.symbol, /*expectsIdentifier*/ false); + return ts.createTypeReferenceNode(name, /*typeArguments*/ undefined); + } + if (type.flags & (32 /* StringLiteral */)) { + return ts.createLiteralTypeNode((ts.createLiteral(type.text))); + } + if (type.flags & (64 /* NumberLiteral */)) { + return ts.createLiteralTypeNode((ts.createNumericLiteral(type.text))); + } + if (type.flags & 128 /* BooleanLiteral */) { + return type.intrinsicName === "true" ? ts.createTrue() : ts.createFalse(); + } + if (type.flags & 256 /* EnumLiteral */) { + var name = symbolToName(type.symbol, /*expectsIdentifier*/ false); + return ts.createTypeReferenceNode(name, /*typeArguments*/ undefined); + } + if (type.flags & 1024 /* Void */) { + return ts.createKeywordTypeNode(104 /* VoidKeyword */); + } + if (type.flags & 2048 /* Undefined */) { + return ts.createKeywordTypeNode(138 /* UndefinedKeyword */); + } + if (type.flags & 4096 /* Null */) { + return ts.createKeywordTypeNode(94 /* NullKeyword */); + } + if (type.flags & 8192 /* Never */) { + return ts.createKeywordTypeNode(129 /* NeverKeyword */); + } + if (type.flags & 512 /* ESSymbol */) { + return ts.createKeywordTypeNode(136 /* SymbolKeyword */); + } + if (type.flags & 16777216 /* NonPrimitive */) { + return ts.createKeywordTypeNode(133 /* ObjectKeyword */); + } + if (type.flags & 16384 /* TypeParameter */ && type.isThisType) { + if (context.inObjectTypeLiteral) { + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowThisInObjectLiteral)) { + context.encounteredError = true; + } + } + return ts.createThis(); + } + var objectFlags = getObjectFlags(type); + if (objectFlags & 4 /* Reference */) { + ts.Debug.assert(!!(type.flags & 32768 /* Object */)); + return typeReferenceToTypeNode(type); + } + if (objectFlags & 3 /* ClassOrInterface */) { + ts.Debug.assert(!!(type.flags & 32768 /* Object */)); + var name = symbolToName(type.symbol, /*expectsIdentifier*/ false); + // TODO(aozgaa): handle type arguments. + return ts.createTypeReferenceNode(name, /*typeArguments*/ undefined); + } + if (type.flags & 16384 /* TypeParameter */) { + var name = symbolToName(type.symbol, /*expectsIdentifier*/ false); + // Ignore constraint/default when creating a usage (as opposed to declaration) of a type parameter. + return ts.createTypeReferenceNode(name, /*typeArguments*/ undefined); + } + if (context.checkAlias && type.aliasSymbol) { + var name = symbolToName(type.aliasSymbol, /*expectsIdentifier*/ false); + var typeArgumentNodes = type.aliasTypeArguments && mapToTypeNodeArray(type.aliasTypeArguments); + return ts.createTypeReferenceNode(name, typeArgumentNodes); + } + context.checkAlias = false; + if (type.flags & 65536 /* Union */) { + var formattedUnionTypes = formatUnionTypes(type.types); + var unionTypeNodes = formattedUnionTypes && mapToTypeNodeArray(formattedUnionTypes); + if (unionTypeNodes && unionTypeNodes.length > 0) { + return ts.createUnionOrIntersectionTypeNode(165 /* UnionType */, unionTypeNodes); + } + else { + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowEmptyUnionOrIntersection)) { + context.encounteredError = true; + } + return undefined; + } + } + if (type.flags & 131072 /* Intersection */) { + return ts.createUnionOrIntersectionTypeNode(166 /* IntersectionType */, mapToTypeNodeArray(type.types)); + } + if (objectFlags & (16 /* Anonymous */ | 32 /* Mapped */)) { + ts.Debug.assert(!!(type.flags & 32768 /* Object */)); + // The type is an object literal type. + return createAnonymousTypeNode(type); + } + if (type.flags & 262144 /* Index */) { + var indexedType = type.type; + var indexTypeNode = typeToTypeNodeHelper(indexedType); + return ts.createTypeOperatorNode(indexTypeNode); + } + if (type.flags & 524288 /* IndexedAccess */) { + var objectTypeNode = typeToTypeNodeHelper(type.objectType); + var indexTypeNode = typeToTypeNodeHelper(type.indexType); + return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); + } + ts.Debug.fail("Should be unreachable."); + function mapToTypeNodeArray(types) { + var result = []; + for (var _i = 0, types_1 = types; _i < types_1.length; _i++) { + var type_1 = types_1[_i]; + var typeNode = typeToTypeNodeHelper(type_1); + if (typeNode) { + result.push(typeNode); + } + } + return result; + } + function createMappedTypeNodeFromType(type) { + ts.Debug.assert(!!(type.flags & 32768 /* Object */)); + var typeParameter = getTypeParameterFromMappedType(type); + var typeParameterNode = typeParameterToDeclaration(typeParameter); + var templateType = getTemplateTypeFromMappedType(type); + var templateTypeNode = typeToTypeNodeHelper(templateType); + var readonlyToken = type.declaration && type.declaration.readonlyToken ? ts.createToken(130 /* ReadonlyKeyword */) : undefined; + var questionToken = type.declaration && type.declaration.questionToken ? ts.createToken(54 /* QuestionToken */) : undefined; + return ts.createMappedTypeNode(readonlyToken, typeParameterNode, questionToken, templateTypeNode); + } + function createAnonymousTypeNode(type) { + var symbol = type.symbol; + if (symbol) { + // Always use 'typeof T' for type of class, enum, and module objects + if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) || + symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || + shouldWriteTypeOfFunctionSymbol()) { + return createTypeQueryNodeFromSymbol(symbol); + } + else if (ts.contains(context.symbolStack, symbol)) { + // If type is an anonymous type literal in a type alias declaration, use type alias name + var typeAlias = getTypeAliasForTypeLiteral(type); + if (typeAlias) { + // The specified symbol flags need to be reinterpreted as type flags + var entityName = symbolToName(typeAlias, /*expectsIdentifier*/ false); + return ts.createTypeReferenceNode(entityName, /*typeArguments*/ undefined); + } + else { + return ts.createKeywordTypeNode(118 /* AnyKeyword */); + } + } + else { + // Since instantiations of the same anonymous type have the same symbol, tracking symbols instead + // of types allows us to catch circular references to instantiations of the same anonymous type + if (!context.symbolStack) { + context.symbolStack = []; + } + context.symbolStack.push(symbol); + var result = createTypeNodeFromObjectType(type); + context.symbolStack.pop(); + return result; + } + } + else { + // Anonymous types without a symbol are never circular. + return createTypeNodeFromObjectType(type); + } + function shouldWriteTypeOfFunctionSymbol() { + var isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */ && + ts.forEach(symbol.declarations, function (declaration) { return ts.getModifierFlags(declaration) & 32 /* Static */; })); + var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && + (symbol.parent || + ts.forEach(symbol.declarations, function (declaration) { + return declaration.parent.kind === 264 /* SourceFile */ || declaration.parent.kind === 233 /* ModuleBlock */; + })); + if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { + // typeof is allowed only for static/non local functions + return ts.contains(context.symbolStack, symbol); // it is type of the symbol uses itself recursively + } + } + } + function createTypeNodeFromObjectType(type) { + if (type.objectFlags & 32 /* Mapped */) { + if (getConstraintTypeFromMappedType(type).flags & (16384 /* TypeParameter */ | 262144 /* Index */)) { + return createMappedTypeNodeFromType(type); + } + } + var resolved = resolveStructuredTypeMembers(type); + if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { + if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { + return ts.createTypeLiteralNode(/*members*/ undefined); + } + if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { + var signature = resolved.callSignatures[0]; + return signatureToSignatureDeclarationHelper(signature, 159 /* FunctionType */); + } + if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { + var signature = resolved.constructSignatures[0]; + return signatureToSignatureDeclarationHelper(signature, 160 /* ConstructorType */); + } + } + var saveInObjectTypeLiteral = context.inObjectTypeLiteral; + context.inObjectTypeLiteral = true; + var members = createTypeNodesFromResolvedType(resolved); + context.inObjectTypeLiteral = saveInObjectTypeLiteral; + return ts.createTypeLiteralNode(members); + } + function createTypeQueryNodeFromSymbol(symbol) { + var entityName = symbolToName(symbol, /*expectsIdentifier*/ false); + return ts.createTypeQueryNode(entityName); + } + function typeReferenceToTypeNode(type) { + var typeArguments = type.typeArguments || emptyArray; + if (type.target === globalArrayType) { + var elementType = typeToTypeNodeHelper(typeArguments[0]); + return ts.createArrayTypeNode(elementType); + } + else if (type.target.objectFlags & 8 /* Tuple */) { + if (typeArguments.length > 0) { + var tupleConstituentNodes = mapToTypeNodeArray(typeArguments.slice(0, getTypeReferenceArity(type))); + if (tupleConstituentNodes && tupleConstituentNodes.length > 0) { + return ts.createTupleTypeNode(tupleConstituentNodes); + } + } + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowEmptyTuple)) { + context.encounteredError = true; + } + return undefined; + } + else { + var outerTypeParameters = type.target.outerTypeParameters; + var i = 0; + var qualifiedName = undefined; + if (outerTypeParameters) { + var length_1 = outerTypeParameters.length; + while (i < length_1) { + // Find group of type arguments for type parameters with the same declaring container. + var start = i; + var parent = getParentSymbolOfTypeParameter(outerTypeParameters[i]); + do { + i++; + } while (i < length_1 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent); + // When type parameters are their own type arguments for the whole group (i.e. we have + // the default outer type arguments), we don't show the group. + if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { + var qualifiedNamePart = symbolToName(parent, /*expectsIdentifier*/ true); + if (!qualifiedName) { + qualifiedName = ts.createQualifiedName(qualifiedNamePart, /*right*/ undefined); + } + else { + ts.Debug.assert(!qualifiedName.right); + qualifiedName.right = qualifiedNamePart; + qualifiedName = ts.createQualifiedName(qualifiedName, /*right*/ undefined); + } + } + } + } + var entityName = undefined; + var nameIdentifier = symbolToName(type.symbol, /*expectsIdentifier*/ true); + if (qualifiedName) { + ts.Debug.assert(!qualifiedName.right); + qualifiedName.right = nameIdentifier; + entityName = qualifiedName; + } + else { + entityName = nameIdentifier; + } + var typeParameterCount = (type.target.typeParameters || emptyArray).length; + var typeArgumentNodes = ts.some(typeArguments) ? mapToTypeNodeArray(typeArguments.slice(i, typeParameterCount - i)) : undefined; + return ts.createTypeReferenceNode(entityName, typeArgumentNodes); + } + } + function createTypeNodesFromResolvedType(resolvedType) { + var typeElements = []; + for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { + var signature = _a[_i]; + typeElements.push(signatureToSignatureDeclarationHelper(signature, 154 /* CallSignature */)); + } + for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { + var signature = _c[_b]; + typeElements.push(signatureToSignatureDeclarationHelper(signature, 155 /* ConstructSignature */)); + } + if (resolvedType.stringIndexInfo) { + typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.stringIndexInfo, 0 /* String */)); + } + if (resolvedType.numberIndexInfo) { + typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.numberIndexInfo, 1 /* Number */)); + } + var properties = resolvedType.properties; + if (!properties) { + return typeElements; + } + for (var _d = 0, properties_2 = properties; _d < properties_2.length; _d++) { + var propertySymbol = properties_2[_d]; + var propertyType = getTypeOfSymbol(propertySymbol); + var oldDeclaration = propertySymbol.declarations && propertySymbol.declarations[0]; + if (!oldDeclaration) { + return; + } + var propertyName = oldDeclaration.name; + var optionalToken = propertySymbol.flags & 67108864 /* Optional */ ? ts.createToken(54 /* QuestionToken */) : undefined; + if (propertySymbol.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(propertyType).length) { + var signatures = getSignaturesOfType(propertyType, 0 /* Call */); + for (var _e = 0, signatures_1 = signatures; _e < signatures_1.length; _e++) { + var signature = signatures_1[_e]; + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 149 /* MethodSignature */); + methodDeclaration.name = propertyName; + methodDeclaration.questionToken = optionalToken; + typeElements.push(methodDeclaration); + } + } + else { + // TODO(aozgaa): should we create a node with explicit or implict any? + var propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType) : ts.createKeywordTypeNode(118 /* AnyKeyword */); + typeElements.push(ts.createPropertySignature(propertyName, optionalToken, propertyTypeNode, + /*initializer*/ undefined)); + } + } + return typeElements.length ? typeElements : undefined; + } + } + function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind) { + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 135 /* StringKeyword */ : 132 /* NumberKeyword */); + var name = ts.getNameFromIndexInfo(indexInfo); + var indexingParameter = ts.createParameter( + /*decorators*/ undefined, + /*modifiers*/ undefined, + /*dotDotDotToken*/ undefined, name, + /*questionToken*/ undefined, indexerTypeNode, + /*initializer*/ undefined); + var typeNode = typeToTypeNodeHelper(indexInfo.type); + return ts.createIndexSignatureDeclaration( + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(130 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + } + function signatureToSignatureDeclarationHelper(signature, kind) { + var typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter); }); + var parameters = signature.parameters.map(function (parameter) { return symbolToParameterDeclaration(parameter); }); + var returnTypeNode; + if (signature.typePredicate) { + var typePredicate = signature.typePredicate; + var parameterName = typePredicate.kind === 1 /* Identifier */ ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(); + var typeNode = typeToTypeNodeHelper(typePredicate.type); + returnTypeNode = ts.createTypePredicateNode(parameterName, typeNode); + } + else { + var returnType = getReturnTypeOfSignature(signature); + returnTypeNode = returnType && typeToTypeNodeHelper(returnType); + } + var returnTypeNodeExceptAny = returnTypeNode && returnTypeNode.kind !== 118 /* AnyKeyword */ ? returnTypeNode : undefined; + return ts.createSignatureDeclaration(kind, typeParameters, parameters, returnTypeNodeExceptAny); + } + function typeParameterToDeclaration(type) { + var constraint = getConstraintFromTypeParameter(type); + var constraintNode = constraint && typeToTypeNodeHelper(constraint); + var defaultParameter = getDefaultFromTypeParameter(type); + var defaultParameterNode = defaultParameter && typeToTypeNodeHelper(defaultParameter); + var name = symbolToName(type.symbol, /*expectsIdentifier*/ true); + return ts.createTypeParameterDeclaration(name, constraintNode, defaultParameterNode); + } + function symbolToParameterDeclaration(parameterSymbol) { + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 145 /* Parameter */); + var parameterType = getTypeOfSymbol(parameterSymbol); + var parameterTypeNode = typeToTypeNodeHelper(parameterType); + // TODO(aozgaa): In the future, check initializer accessibility. + var parameterNode = ts.createParameter(parameterDeclaration.decorators, parameterDeclaration.modifiers, parameterDeclaration.dotDotDotToken && ts.createToken(23 /* DotDotDotToken */), + // Clone name to remove trivia. + ts.getSynthesizedClone(parameterDeclaration.name), parameterDeclaration.questionToken && ts.createToken(54 /* QuestionToken */), parameterTypeNode, parameterDeclaration.initializer); + return parameterNode; + } + function symbolToName(symbol, expectsIdentifier) { + // Try to get qualified name if the symbol is not a type parameter and there is an enclosing declaration. + var chain; + var isTypeParameter = symbol.flags & 262144 /* TypeParameter */; + if (!isTypeParameter && context.enclosingDeclaration) { + chain = getSymbolChain(symbol, 0 /* None */, /*endOfChain*/ true); + ts.Debug.assert(chain && chain.length > 0); + } + else { + chain = [symbol]; + } + if (expectsIdentifier && chain.length !== 1 + && !context.encounteredError + && !(context.flags & ts.NodeBuilderFlags.allowQualifedNameInPlaceOfIdentifier)) { + context.encounteredError = true; + } + return createEntityNameFromSymbolChain(chain, chain.length - 1); + function createEntityNameFromSymbolChain(chain, index) { + ts.Debug.assert(chain && 0 <= index && index < chain.length); + // const parentIndex = index - 1; + var symbol = chain[index]; + var typeParameterString = ""; + if (index > 0) { + var parentSymbol = chain[index - 1]; + var typeParameters = void 0; + if (getCheckFlags(symbol) & 1 /* Instantiated */) { + typeParameters = getTypeParametersOfClassOrInterface(parentSymbol); + } + else { + var targetSymbol = getTargetSymbol(parentSymbol); + if (targetSymbol.flags & (32 /* Class */ | 64 /* Interface */ | 524288 /* TypeAlias */)) { + typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); + } + } + if (typeParameters && typeParameters.length > 0) { + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowTypeParameterInQualifiedName)) { + context.encounteredError = true; + } + var writer = ts.getSingleLineStringWriter(); + var displayBuilder = getSymbolDisplayBuilder(); + displayBuilder.buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, context.enclosingDeclaration, 0); + typeParameterString = writer.string(); + ts.releaseStringWriter(writer); + } + } + var symbolName = getNameOfSymbol(symbol); + var symbolNameWithTypeParameters = typeParameterString.length > 0 ? symbolName + "<" + typeParameterString + ">" : symbolName; + var identifier = ts.createIdentifier(symbolNameWithTypeParameters); + return index > 0 ? ts.createQualifiedName(createEntityNameFromSymbolChain(chain, index - 1), identifier) : identifier; + } + /** @param endOfChain Set to false for recursive calls; non-recursive calls should always output something. */ + function getSymbolChain(symbol, meaning, endOfChain) { + var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, /*useOnlyExternalAliasing*/ false); + var parentSymbol; + if (!accessibleSymbolChain || + needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { + // Go up and add our parent. + var parent = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); + if (parent) { + var parentChain = getSymbolChain(parent, getQualifiedLeftMeaning(meaning), /*endOfChain*/ false); + if (parentChain) { + parentSymbol = parent; + accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [symbol]); + } + } + } + if (accessibleSymbolChain) { + return accessibleSymbolChain; + } + if ( + // If this is the last part of outputting the symbol, always output. The cases apply only to parent symbols. + endOfChain || + // If a parent symbol is an external module, don't write it. (We prefer just `x` vs `"foo/bar".x`.) + !(!parentSymbol && ts.forEach(symbol.declarations, hasExternalModuleSymbol)) && + // If a parent symbol is an anonymous type, don't write it. + !(symbol.flags & (2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */))) { + return [symbol]; + } + } + function getNameOfSymbol(symbol) { + var declaration = ts.firstOrUndefined(symbol.declarations); + if (declaration) { + if (declaration.name) { + return ts.declarationNameToString(declaration.name); + } + if (declaration.parent && declaration.parent.kind === 225 /* VariableDeclaration */) { + return ts.declarationNameToString(declaration.parent.name); + } + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowAnonymousIdentifier)) { + context.encounteredError = true; + } + switch (declaration.kind) { + case 198 /* ClassExpression */: + return "(Anonymous class)"; + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + return "(Anonymous function)"; + } + } + return symbol.name; + } + } + } function typePredicateToString(typePredicate, enclosingDeclaration, flags) { var writer = ts.getSingleLineStringWriter(); getSymbolDisplayBuilder().buildTypePredicateDisplay(typePredicate, writer, enclosingDeclaration, flags); @@ -25971,11 +27955,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { - var node = type.symbol.declarations[0].parent; - while (node.kind === 166 /* ParenthesizedType */) { - node = node.parent; - } - if (node.kind === 228 /* TypeAliasDeclaration */) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 167 /* ParenthesizedType */; }); + if (node.kind === 230 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -25983,29 +27964,32 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 231 /* ModuleBlock */ && + node.parent.kind === 233 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function literalTypeToString(type) { return type.flags & 32 /* StringLiteral */ ? "\"" + ts.escapeString(type.text) + "\"" : type.text; } - function getSymbolDisplayBuilder() { - function getNameOfSymbol(symbol) { - if (symbol.declarations && symbol.declarations.length) { - var declaration = symbol.declarations[0]; - if (declaration.name) { - return ts.declarationNameToString(declaration.name); - } - switch (declaration.kind) { - case 197 /* ClassExpression */: - return "(Anonymous class)"; - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - return "(Anonymous function)"; - } + function getNameOfSymbol(symbol) { + if (symbol.declarations && symbol.declarations.length) { + var declaration = symbol.declarations[0]; + if (declaration.name) { + return ts.declarationNameToString(declaration.name); + } + if (declaration.parent && declaration.parent.kind === 225 /* VariableDeclaration */) { + return ts.declarationNameToString(declaration.parent.name); + } + switch (declaration.kind) { + case 198 /* ClassExpression */: + return "(Anonymous class)"; + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + return "(Anonymous function)"; } - return symbol.name; } + return symbol.name; + } + function getSymbolDisplayBuilder() { /** * Writes only the name of the symbol out to the writer. Uses the original source text * for the name of the symbol if it is available to match how the user wrote the name. @@ -26047,7 +28031,7 @@ var ts; if (parentSymbol) { // Write type arguments of instantiated class/interface here if (flags & 1 /* WriteTypeParametersOrArguments */) { - if (symbol.flags & 16777216 /* Instantiated */) { + if (getCheckFlags(symbol) & 1 /* Instantiated */) { buildDisplayForTypeArgumentsAndDelimiters(getTypeParametersOfClassOrInterface(parentSymbol), symbol.mapper, writer, enclosingDeclaration); } else { @@ -26075,9 +28059,9 @@ var ts; if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { // Go up and add our parent. - var parent_5 = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); - if (parent_5) { - walkSymbol(parent_5, getQualifiedLeftMeaning(meaning), /*endOfChain*/ false); + var parent = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); + if (parent) { + walkSymbol(parent, getQualifiedLeftMeaning(meaning), /*endOfChain*/ false); } } if (accessibleSymbolChain) { @@ -26115,7 +28099,7 @@ var ts; function writeType(type, flags) { var nextFlags = flags & ~512 /* InTypeAlias */; // Write undefined/null type as any - if (type.flags & 16015 /* Intrinsic */) { + if (type.flags & 16793231 /* Intrinsic */) { // Special handling for unknown / resolving types, they should show up as any and not unknown or __resolving writer.writeKeyword(!(globalFlags & 16 /* WriteOwnNameForAnyLike */) && isTypeAny(type) ? "any" @@ -26142,7 +28126,7 @@ var ts; else if (!(flags & 512 /* InTypeAlias */) && type.aliasSymbol && isSymbolAccessible(type.aliasSymbol, enclosingDeclaration, 793064 /* Type */, /*shouldComputeAliasesToMakeVisible*/ false).accessibility === 0 /* Accessible */) { var typeArguments = type.aliasTypeArguments; - writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, typeArguments ? typeArguments.length : 0, nextFlags); + writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, ts.length(typeArguments), nextFlags); } else if (type.flags & 196608 /* UnionOrIntersection */) { writeUnionOrIntersectionType(type, nextFlags); @@ -26223,18 +28207,18 @@ var ts; var outerTypeParameters = type.target.outerTypeParameters; var i = 0; if (outerTypeParameters) { - var length_1 = outerTypeParameters.length; - while (i < length_1) { + var length_2 = outerTypeParameters.length; + while (i < length_2) { // Find group of type arguments for type parameters with the same declaring container. var start = i; - var parent_6 = getParentSymbolOfTypeParameter(outerTypeParameters[i]); + var parent = getParentSymbolOfTypeParameter(outerTypeParameters[i]); do { i++; - } while (i < length_1 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent_6); + } while (i < length_2 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent); // When type parameters are their own type arguments for the whole group (i.e. we have // the default outer type arguments), we don't show the group. if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { - writeSymbolTypeReference(parent_6, typeArguments, start, i, flags); + writeSymbolTypeReference(parent, typeArguments, start, i, flags); writePunctuation(writer, 22 /* DotToken */); } } @@ -26261,7 +28245,8 @@ var ts; var symbol = type.symbol; if (symbol) { // Always use 'typeof T' for type of class, enum, and module objects - if (symbol.flags & (32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { + if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) || + symbol.flags & (384 /* Enum */ | 512 /* ValueModule */)) { writeTypeOfSymbol(type, flags); } else if (shouldWriteTypeOfFunctionSymbol()) { @@ -26300,7 +28285,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 261 /* SourceFile */ || declaration.parent.kind === 231 /* ModuleBlock */; + return declaration.parent.kind === 264 /* SourceFile */ || declaration.parent.kind === 233 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -26314,32 +28299,13 @@ var ts; writeSpace(writer); buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455 /* Value */, 0 /* None */, typeFormatFlags); } - function writeIndexSignature(info, keyword) { - if (info) { - if (info.isReadonly) { - writeKeyword(writer, 130 /* ReadonlyKeyword */); - writeSpace(writer); - } - writePunctuation(writer, 20 /* OpenBracketToken */); - writer.writeParameter(info.declaration ? ts.declarationNameToString(info.declaration.parameters[0].name) : "x"); - writePunctuation(writer, 55 /* ColonToken */); - writeSpace(writer); - writeKeyword(writer, keyword); - writePunctuation(writer, 21 /* CloseBracketToken */); - writePunctuation(writer, 55 /* ColonToken */); - writeSpace(writer); - writeType(info.type, 0 /* None */); - writePunctuation(writer, 24 /* SemicolonToken */); - writer.writeLine(); - } - } function writePropertyWithModifiers(prop) { if (isReadonlySymbol(prop)) { writeKeyword(writer, 130 /* ReadonlyKeyword */); writeSpace(writer); } buildSymbolDisplay(prop, writer); - if (prop.flags & 536870912 /* Optional */) { + if (prop.flags & 67108864 /* Optional */) { writePunctuation(writer, 54 /* QuestionToken */); } } @@ -26416,15 +28382,15 @@ var ts; writePunctuation(writer, 24 /* SemicolonToken */); writer.writeLine(); } - writeIndexSignature(resolved.stringIndexInfo, 134 /* StringKeyword */); - writeIndexSignature(resolved.numberIndexInfo, 132 /* NumberKeyword */); + buildIndexSignatureDisplay(resolved.stringIndexInfo, writer, 0 /* String */, enclosingDeclaration, globalFlags, symbolStack); + buildIndexSignatureDisplay(resolved.numberIndexInfo, writer, 1 /* Number */, enclosingDeclaration, globalFlags, symbolStack); for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) { var p = _e[_d]; var t = getTypeOfSymbol(p); if (p.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(t).length) { var signatures = getSignaturesOfType(t, 0 /* Call */); - for (var _f = 0, signatures_1 = signatures; _f < signatures_1.length; _f++) { - var signature = signatures_1[_f]; + for (var _f = 0, signatures_2 = signatures; _f < signatures_2.length; _f++) { + var signature = signatures_2[_f]; writePropertyWithModifiers(p); buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, /*kind*/ undefined, symbolStack); writePunctuation(writer, 24 /* SemicolonToken */); @@ -26483,33 +28449,44 @@ var ts; writeSpace(writer); buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, symbolStack); } + var defaultType = getDefaultFromTypeParameter(tp); + if (defaultType) { + writeSpace(writer); + writePunctuation(writer, 57 /* EqualsToken */); + writeSpace(writer); + buildTypeDisplay(defaultType, writer, enclosingDeclaration, flags, symbolStack); + } } function buildParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack) { var parameterNode = p.valueDeclaration; - if (ts.isRestParameter(parameterNode)) { + if (parameterNode ? ts.isRestParameter(parameterNode) : isTransientSymbol(p) && p.isRestParameter) { writePunctuation(writer, 23 /* DotDotDotToken */); } - if (ts.isBindingPattern(parameterNode.name)) { + if (parameterNode && ts.isBindingPattern(parameterNode.name)) { buildBindingPatternDisplay(parameterNode.name, writer, enclosingDeclaration, flags, symbolStack); } else { appendSymbolNameOnly(p, writer); } - if (isOptionalParameter(parameterNode)) { + if (parameterNode && isOptionalParameter(parameterNode)) { writePunctuation(writer, 54 /* QuestionToken */); } writePunctuation(writer, 55 /* ColonToken */); writeSpace(writer); - buildTypeDisplay(getTypeOfSymbol(p), writer, enclosingDeclaration, flags, symbolStack); + var type = getTypeOfSymbol(p); + if (parameterNode && isRequiredInitializedParameter(parameterNode)) { + type = includeFalsyTypes(type, 2048 /* Undefined */); + } + buildTypeDisplay(type, writer, enclosingDeclaration, flags, symbolStack); } function buildBindingPatternDisplay(bindingPattern, writer, enclosingDeclaration, flags, symbolStack) { // We have to explicitly emit square bracket and bracket because these tokens are not stored inside the node. - if (bindingPattern.kind === 172 /* ObjectBindingPattern */) { + if (bindingPattern.kind === 173 /* ObjectBindingPattern */) { writePunctuation(writer, 16 /* OpenBraceToken */); buildDisplayForCommaSeparatedList(bindingPattern.elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); }); writePunctuation(writer, 17 /* CloseBraceToken */); } - else if (bindingPattern.kind === 173 /* ArrayBindingPattern */) { + else if (bindingPattern.kind === 174 /* ArrayBindingPattern */) { writePunctuation(writer, 20 /* OpenBracketToken */); var elements = bindingPattern.elements; buildDisplayForCommaSeparatedList(elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); }); @@ -26523,9 +28500,9 @@ var ts; if (ts.isOmittedExpression(bindingElement)) { return; } - ts.Debug.assert(bindingElement.kind === 174 /* BindingElement */); + ts.Debug.assert(bindingElement.kind === 175 /* BindingElement */); if (bindingElement.propertyName) { - writer.writeSymbol(ts.getTextOfNode(bindingElement.propertyName), bindingElement.symbol); + writer.writeProperty(ts.getTextOfNode(bindingElement.propertyName)); writePunctuation(writer, 55 /* ColonToken */); writeSpace(writer); } @@ -26597,6 +28574,10 @@ var ts; buildTypeDisplay(predicate.type, writer, enclosingDeclaration, flags, symbolStack); } function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) { + var returnType = getReturnTypeOfSignature(signature); + if (flags & 2048 /* SuppressAnyReturnType */ && isTypeAny(returnType)) { + return; + } if (flags & 8 /* WriteArrowStyleSignature */) { writeSpace(writer); writePunctuation(writer, 35 /* EqualsGreaterThanToken */); @@ -26609,7 +28590,6 @@ var ts; buildTypePredicateDisplay(signature.typePredicate, writer, enclosingDeclaration, flags, symbolStack); } else { - var returnType = getReturnTypeOfSignature(signature); buildTypeDisplay(returnType, writer, enclosingDeclaration, flags, symbolStack); } } @@ -26629,6 +28609,32 @@ var ts; buildDisplayForParametersAndDelimiters(signature.thisParameter, signature.parameters, writer, enclosingDeclaration, flags, symbolStack); buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack); } + function buildIndexSignatureDisplay(info, writer, kind, enclosingDeclaration, globalFlags, symbolStack) { + if (info) { + if (info.isReadonly) { + writeKeyword(writer, 130 /* ReadonlyKeyword */); + writeSpace(writer); + } + writePunctuation(writer, 20 /* OpenBracketToken */); + writer.writeParameter(info.declaration ? ts.declarationNameToString(info.declaration.parameters[0].name) : "x"); + writePunctuation(writer, 55 /* ColonToken */); + writeSpace(writer); + switch (kind) { + case 1 /* Number */: + writeKeyword(writer, 132 /* NumberKeyword */); + break; + case 0 /* String */: + writeKeyword(writer, 135 /* StringKeyword */); + break; + } + writePunctuation(writer, 21 /* CloseBracketToken */); + writePunctuation(writer, 55 /* ColonToken */); + writeSpace(writer); + buildTypeDisplay(info.type, writer, enclosingDeclaration, globalFlags, symbolStack); + writePunctuation(writer, 24 /* SemicolonToken */); + writer.writeLine(); + } + } return _displayBuilder || (_displayBuilder = { buildSymbolDisplay: buildSymbolDisplay, buildTypeDisplay: buildTypeDisplay, @@ -26639,6 +28645,7 @@ var ts; buildDisplayForTypeParametersAndDelimiters: buildDisplayForTypeParametersAndDelimiters, buildTypeParameterDisplayFromSymbol: buildTypeParameterDisplayFromSymbol, buildSignatureDisplay: buildSignatureDisplay, + buildIndexSignatureDisplay: buildIndexSignatureDisplay, buildReturnTypeDisplay: buildReturnTypeDisplay }); } @@ -26653,75 +28660,76 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 174 /* BindingElement */: + case 175 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 223 /* VariableDeclaration */: + case 225 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } - // Otherwise fall through - case 230 /* ModuleDeclaration */: - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 225 /* FunctionDeclaration */: - case 229 /* EnumDeclaration */: - case 234 /* ImportEqualsDeclaration */: + // falls through + case 232 /* ModuleDeclaration */: + case 228 /* ClassDeclaration */: + case 229 /* InterfaceDeclaration */: + case 230 /* TypeAliasDeclaration */: + case 227 /* FunctionDeclaration */: + case 231 /* EnumDeclaration */: + case 236 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; } - var parent_7 = getDeclarationContainer(node); + var parent = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) && - !(node.kind !== 234 /* ImportEqualsDeclaration */ && parent_7.kind !== 261 /* SourceFile */ && ts.isInAmbientContext(parent_7))) { - return isGlobalSourceFile(parent_7); + !(node.kind !== 236 /* ImportEqualsDeclaration */ && parent.kind !== 264 /* SourceFile */ && ts.isInAmbientContext(parent))) { + return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible - return isDeclarationVisible(parent_7); - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + return isDeclarationVisible(parent); + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: if (ts.getModifierFlags(node) & (8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } - // Public properties/methods are visible if its parents are visible, so const it fall into next case statement - case 150 /* Constructor */: - case 154 /* ConstructSignature */: - case 153 /* CallSignature */: - case 155 /* IndexSignature */: - case 144 /* Parameter */: - case 231 /* ModuleBlock */: - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 161 /* TypeLiteral */: - case 157 /* TypeReference */: - case 162 /* ArrayType */: - case 163 /* TupleType */: - case 164 /* UnionType */: - case 165 /* IntersectionType */: - case 166 /* ParenthesizedType */: + // Public properties/methods are visible if its parents are visible, so: + // falls through + case 151 /* Constructor */: + case 155 /* ConstructSignature */: + case 154 /* CallSignature */: + case 156 /* IndexSignature */: + case 145 /* Parameter */: + case 233 /* ModuleBlock */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: + case 162 /* TypeLiteral */: + case 158 /* TypeReference */: + case 163 /* ArrayType */: + case 164 /* TupleType */: + case 165 /* UnionType */: + case 166 /* IntersectionType */: + case 167 /* ParenthesizedType */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 236 /* ImportClause */: - case 237 /* NamespaceImport */: - case 239 /* ImportSpecifier */: + case 238 /* ImportClause */: + case 239 /* NamespaceImport */: + case 241 /* ImportSpecifier */: return false; // Type parameters are always visible - case 143 /* TypeParameter */: + case 144 /* TypeParameter */: // Source file and namespace export are always visible - case 261 /* SourceFile */: - case 233 /* NamespaceExportDeclaration */: + case 264 /* SourceFile */: + case 235 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: return false; default: return false; @@ -26730,10 +28738,10 @@ var ts; } function collectLinkedAliases(node) { var exportSymbol; - if (node.parent && node.parent.kind === 240 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 242 /* ExportAssignment */) { exportSymbol = resolveName(node.parent, node.text, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 8388608 /* Alias */, ts.Diagnostics.Cannot_find_name_0, node); } - else if (node.parent.kind === 243 /* ExportSpecifier */) { + else if (node.parent.kind === 245 /* ExportSpecifier */) { var exportSpecifier = node.parent; exportSymbol = exportSpecifier.parent.parent.moduleSpecifier ? getExternalModuleMember(exportSpecifier.parent.parent, exportSpecifier) : @@ -26778,8 +28786,8 @@ var ts; var resolutionCycleStartIndex = findResolutionCycleStartIndex(target, propertyName); if (resolutionCycleStartIndex >= 0) { // A cycle was found - var length_2 = resolutionTargets.length; - for (var i = resolutionCycleStartIndex; i < length_2; i++) { + var length_3 = resolutionTargets.length; + for (var i = resolutionCycleStartIndex; i < length_3; i++) { resolutionResults[i] = false; } return false; @@ -26823,21 +28831,20 @@ var ts; return resolutionResults.pop(); } function getDeclarationContainer(node) { - node = ts.getRootDeclaration(node); - while (node) { + node = ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 223 /* VariableDeclaration */: - case 224 /* VariableDeclarationList */: - case 239 /* ImportSpecifier */: - case 238 /* NamedImports */: - case 237 /* NamespaceImport */: - case 236 /* ImportClause */: - node = node.parent; - break; + case 225 /* VariableDeclaration */: + case 226 /* VariableDeclarationList */: + case 241 /* ImportSpecifier */: + case 240 /* NamedImports */: + case 239 /* NamespaceImport */: + case 238 /* ImportClause */: + return false; default: - return node.parent; + return true; } - } + }); + return node && node.parent; } function getTypeOfPrototypeProperty(prototype) { // TypeScript 1.0 spec (April 2014): 8.4 @@ -26855,9 +28862,6 @@ var ts; function isTypeAny(type) { return type && (type.flags & 1 /* Any */) !== 0; } - function isTypeNever(type) { - return type && (type.flags & 8192 /* Never */) !== 0; - } // Return the type of a binding element parent. We check SymbolLinks first to see if a type has been // assigned by contextual typing. function getTypeForBindingElementParent(node) { @@ -26865,24 +28869,29 @@ var ts; return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false); } function isComputedNonLiteralName(name) { - return name.kind === 142 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteral(name.expression); + return name.kind === 143 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteral(name.expression); } function getRestType(source, properties, symbol) { - ts.Debug.assert(!!(source.flags & 32768 /* Object */), "Rest types only support object types right now."); + source = filterType(source, function (t) { return !(t.flags & 6144 /* Nullable */); }); + if (source.flags & 8192 /* Never */) { + return emptyObjectType; + } + if (source.flags & 65536 /* Union */) { + return mapType(source, function (t) { return getRestType(t, properties, symbol); }); + } var members = ts.createMap(); var names = ts.createMap(); - for (var _i = 0, properties_2 = properties; _i < properties_2.length; _i++) { - var name_17 = properties_2[_i]; - names[ts.getTextOfPropertyName(name_17)] = true; + for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { + var name = properties_3[_i]; + names.set(ts.getTextOfPropertyName(name), true); } for (var _a = 0, _b = getPropertiesOfType(source); _a < _b.length; _a++) { var prop = _b[_a]; - var inNamesToRemove = prop.name in names; + var inNamesToRemove = names.has(prop.name); var isPrivate = getDeclarationModifierFlagsFromSymbol(prop) & (8 /* Private */ | 16 /* Protected */); - var isMethod = prop.flags & 8192 /* Method */; var isSetOnlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */); - if (!inNamesToRemove && !isPrivate && !isMethod && !isSetOnlyAccessor) { - members[prop.name] = prop; + if (!inNamesToRemove && !isPrivate && !isClassMethod(prop) && !isSetOnlyAccessor) { + members.set(prop.name, prop); } } var stringIndexInfo = getIndexInfoOfType(source, 0 /* String */); @@ -26907,9 +28916,9 @@ var ts; return parentType; } var type; - if (pattern.kind === 172 /* ObjectBindingPattern */) { + if (pattern.kind === 173 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { - if (!(parentType.flags & 32768 /* Object */)) { + if (!isValidSpreadType(parentType)) { error(declaration, ts.Diagnostics.Rest_types_may_only_be_created_from_object_types); return unknownType; } @@ -26924,8 +28933,8 @@ var ts; } else { // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) - var name_18 = declaration.propertyName || declaration.name; - if (isComputedNonLiteralName(name_18)) { + var name = declaration.propertyName || declaration.name; + if (isComputedNonLiteralName(name)) { // computed properties with non-literal names are treated as 'any' return anyType; } @@ -26934,12 +28943,12 @@ var ts; } // Use type of the specified property, or otherwise, for a numeric name, the type of the numeric index signature, // or otherwise the type of the string index signature. - var text = ts.getTextOfPropertyName(name_18); + var text = ts.getTextOfPropertyName(name); type = getTypeOfPropertyOfType(parentType, text) || isNumericLiteralName(text) && getIndexTypeOfType(parentType, 1 /* Number */) || getIndexTypeOfType(parentType, 0 /* String */); if (!type) { - error(name_18, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_18)); + error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name)); return unknownType; } } @@ -26948,7 +28957,7 @@ var ts; // This elementType will be used if the specific property corresponding to this index is not // present (aka the tuple element property). This call also checks that the parentType is in // fact an iterable or array (depending on target language). - var elementType = checkIteratedTypeOrElementType(parentType, pattern, /*allowStringInput*/ false); + var elementType = checkIteratedTypeOrElementType(parentType, pattern, /*allowStringInput*/ false, /*allowAsyncIterable*/ false); if (declaration.dotDotDotToken) { // Rest element has an array type with the same element type as the parent type type = createArrayType(elementType); @@ -26979,7 +28988,7 @@ var ts; getUnionType([type, checkExpressionCached(declaration.initializer)], /*subtypeReduction*/ true) : type; } - function getTypeForVariableLikeDeclarationFromJSDocComment(declaration) { + function getTypeForDeclarationFromJSDocComment(declaration) { var jsdocType = ts.getJSDocType(declaration); if (jsdocType) { return getTypeFromTypeNode(jsdocType); @@ -26992,44 +29001,46 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 175 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 176 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { return strictNullChecks && optional ? includeFalsyTypes(type, 2048 /* Undefined */) : type; } // Return the inferred type for a variable, parameter, or property declaration function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { - if (declaration.flags & 2097152 /* JavaScriptFile */) { + if (declaration.flags & 65536 /* JavaScriptFile */) { // If this is a variable in a JavaScript file, then use the JSDoc type (if it has // one as its type), otherwise fallback to the below standard TS codepaths to // try to figure it out. - var type = getTypeForVariableLikeDeclarationFromJSDocComment(declaration); + var type = getTypeForDeclarationFromJSDocComment(declaration); if (type && type !== unknownType) { return type; } } // A variable declared in a for..in statement is of type string, or of type keyof T when the // right hand expression is of a type parameter type. - if (declaration.parent.parent.kind === 212 /* ForInStatement */) { + if (declaration.parent.parent.kind === 214 /* ForInStatement */) { var indexType = getIndexType(checkNonNullExpression(declaration.parent.parent.expression)); return indexType.flags & (16384 /* TypeParameter */ | 262144 /* Index */) ? indexType : stringType; } - if (declaration.parent.parent.kind === 213 /* ForOfStatement */) { + if (declaration.parent.parent.kind === 215 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, // or it may have led to an error inside getElementTypeOfIterable. - return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType; + var forOfStatement = declaration.parent.parent; + return checkRightHandSideOfForOf(forOfStatement.expression, forOfStatement.awaitModifier) || anyType; } if (ts.isBindingPattern(declaration.parent)) { return getTypeForBindingElement(declaration); } // Use type from type annotation if one is present if (declaration.type) { - return addOptionality(getTypeFromTypeNode(declaration.type), /*optional*/ declaration.questionToken && includeOptionality); + var declaredType = getTypeFromTypeNode(declaration.type); + return addOptionality(declaredType, /*optional*/ declaration.questionToken && includeOptionality); } - if ((compilerOptions.noImplicitAny || declaration.flags & 2097152 /* JavaScriptFile */) && - declaration.kind === 223 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && + if ((noImplicitAny || declaration.flags & 65536 /* JavaScriptFile */) && + declaration.kind === 225 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1 /* Export */) && !ts.isInAmbientContext(declaration)) { // If --noImplicitAny is on or the declaration is in a Javascript file, // use control flow tracked 'any' type for non-ambient, non-exported var or let variables with no @@ -27043,11 +29054,11 @@ var ts; return autoArrayType; } } - if (declaration.kind === 144 /* Parameter */) { + if (declaration.kind === 145 /* Parameter */) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 152 /* SetAccessor */ && !ts.hasDynamicName(func)) { - var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 151 /* GetAccessor */); + if (func.kind === 153 /* SetAccessor */ && !ts.hasDynamicName(func)) { + var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 152 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -27076,8 +29087,13 @@ var ts; var type = checkDeclarationInitializer(declaration); return addOptionality(type, /*optional*/ declaration.questionToken && includeOptionality); } + if (ts.isJsxAttribute(declaration)) { + // if JSX attribute doesn't have initializer, by default the attribute will have boolean value of true. + // I.e is sugar for + return trueType; + } // If it is a short-hand property assignment, use the type of the identifier - if (declaration.kind === 258 /* ShorthandPropertyAssignment */) { + if (declaration.kind === 261 /* ShorthandPropertyAssignment */) { return checkIdentifier(declaration.name); } // If the declaration specifies a binding pattern, use the type implied by the binding pattern @@ -27087,6 +29103,38 @@ var ts; // No type specified and nothing can be inferred return undefined; } + function getWidenedTypeFromJSSpecialPropertyDeclarations(symbol) { + var types = []; + var definedInConstructor = false; + var definedInMethod = false; + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + var expression = declaration.kind === 193 /* BinaryExpression */ ? declaration : + declaration.kind === 178 /* PropertyAccessExpression */ ? ts.getAncestor(declaration, 193 /* BinaryExpression */) : + undefined; + if (!expression) { + return unknownType; + } + if (ts.isPropertyAccessExpression(expression.left) && expression.left.expression.kind === 98 /* ThisKeyword */) { + if (ts.getThisContainer(expression, /*includeArrowFunctions*/ false).kind === 151 /* Constructor */) { + definedInConstructor = true; + } + else { + definedInMethod = true; + } + } + if (expression.flags & 65536 /* JavaScriptFile */) { + // If there is a JSDoc type, use it + var type = getTypeForDeclarationFromJSDocComment(expression.parent); + if (type && type !== unknownType) { + types.push(getWidenedType(type)); + continue; + } + } + types.push(getWidenedLiteralType(checkExpressionCached(expression.right))); + } + return getWidenedType(addOptionality(getUnionType(types, /*subtypeReduction*/ true), definedInMethod && !definedInConstructor)); + } // Return the type implied by a binding pattern element. This is the type of the initializer of the element if // one is present. Otherwise, if the element is itself a binding pattern, it is the type implied by the binding // pattern. Otherwise, it is the type any. @@ -27097,7 +29145,7 @@ var ts; if (ts.isBindingPattern(element.name)) { return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors); } - if (reportErrors && compilerOptions.noImplicitAny && !declarationBelongsToPrivateAmbientMember(element)) { + if (reportErrors && noImplicitAny && !declarationBelongsToPrivateAmbientMember(element)) { reportImplicitAnyError(element, anyType); } return anyType; @@ -27105,22 +29153,27 @@ var ts; // Return the type implied by an object binding pattern function getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) { var members = ts.createMap(); + var stringIndexInfo; var hasComputedProperties = false; ts.forEach(pattern.elements, function (e) { var name = e.propertyName || e.name; - if (isComputedNonLiteralName(name) || e.dotDotDotToken) { - // do not include computed properties or rests in the implied type + if (isComputedNonLiteralName(name)) { + // do not include computed properties in the implied type hasComputedProperties = true; return; } + if (e.dotDotDotToken) { + stringIndexInfo = createIndexInfo(anyType, /*isReadonly*/ false); + return; + } var text = ts.getTextOfPropertyName(name); - var flags = 4 /* Property */ | 67108864 /* Transient */ | (e.initializer ? 536870912 /* Optional */ : 0); + var flags = 4 /* Property */ | (e.initializer ? 67108864 /* Optional */ : 0); var symbol = createSymbol(flags, text); symbol.type = getTypeFromBindingElement(e, includePatternInType, reportErrors); symbol.bindingElement = e; - members[symbol.name] = symbol; + members.set(symbol.name, symbol); }); - var result = createAnonymousType(undefined, members, emptyArray, emptyArray, undefined, undefined); + var result = createAnonymousType(undefined, members, emptyArray, emptyArray, stringIndexInfo, undefined); if (includePatternInType) { result.pattern = pattern; } @@ -27153,7 +29206,7 @@ var ts; // parameter with no type annotation or initializer, the type implied by the binding pattern becomes the type of // the parameter. function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { - return pattern.kind === 172 /* ObjectBindingPattern */ + return pattern.kind === 173 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -27175,7 +29228,7 @@ var ts; // During a normal type check we'll never get to here with a property assignment (the check of the containing // object literal uses a different path). We exclude widening only so that language services and type verification // tools see the actual type. - if (declaration.kind === 257 /* PropertyAssignment */) { + if (declaration.kind === 260 /* PropertyAssignment */) { return type; } return getWidenedType(type); @@ -27183,7 +29236,7 @@ var ts; // Rest parameters default to type any[], other parameters default to type any type = declaration.dotDotDotToken ? anyArrayType : anyType; // Report implicit any errors unless this is a private property within an ambient declaration - if (reportErrors && compilerOptions.noImplicitAny) { + if (reportErrors && noImplicitAny) { if (!declarationBelongsToPrivateAmbientMember(declaration)) { reportImplicitAnyError(declaration, type); } @@ -27192,14 +29245,14 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 144 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 145 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function getTypeOfVariableOrParameterOrProperty(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { // Handle prototype property - if (symbol.flags & 134217728 /* Prototype */) { + if (symbol.flags & 16777216 /* Prototype */) { return links.type = getTypeOfPrototypeProperty(symbol); } // Handle catch clause variables @@ -27208,10 +29261,10 @@ var ts; return links.type = anyType; } // Handle export default expressions - if (declaration.kind === 240 /* ExportAssignment */) { + if (declaration.kind === 242 /* ExportAssignment */) { return links.type = checkExpression(declaration.expression); } - if (declaration.flags & 2097152 /* JavaScriptFile */ && declaration.kind === 286 /* JSDocPropertyTag */ && declaration.typeExpression) { + if (declaration.flags & 65536 /* JavaScriptFile */ && declaration.kind === 290 /* JSDocPropertyTag */ && declaration.typeExpression) { return links.type = getTypeFromTypeNode(declaration.typeExpression.type); } // Handle variable, parameter or property @@ -27224,36 +29277,15 @@ var ts; // * exports.p = expr // * this.p = expr // * className.prototype.method = expr - if (declaration.kind === 192 /* BinaryExpression */ || - declaration.kind === 177 /* PropertyAccessExpression */ && declaration.parent.kind === 192 /* BinaryExpression */) { - // Use JS Doc type if present on parent expression statement - if (declaration.flags & 2097152 /* JavaScriptFile */) { - var jsdocType = ts.getJSDocType(declaration.parent); - if (jsdocType) { - return links.type = getTypeFromTypeNode(jsdocType); - } - } - var declaredTypes = ts.map(symbol.declarations, function (decl) { return decl.kind === 192 /* BinaryExpression */ ? - checkExpressionCached(decl.right) : - checkExpressionCached(decl.parent.right); }); - type = getUnionType(declaredTypes, /*subtypeReduction*/ true); + if (declaration.kind === 193 /* BinaryExpression */ || + declaration.kind === 178 /* PropertyAccessExpression */ && declaration.parent.kind === 193 /* BinaryExpression */) { + type = getWidenedTypeFromJSSpecialPropertyDeclarations(symbol); } else { type = getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true); } if (!popTypeResolution()) { - if (symbol.valueDeclaration.type) { - // Variable has type annotation that circularly references the variable itself - type = unknownType; - error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); - } - else { - // Variable has initializer that circularly references the variable itself - type = anyType; - if (compilerOptions.noImplicitAny) { - error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); - } - } + type = reportCircularityError(symbol); } links.type = type; } @@ -27261,7 +29293,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 151 /* GetAccessor */) { + if (accessor.kind === 152 /* GetAccessor */) { return accessor.type && getTypeFromTypeNode(accessor.type); } else { @@ -27281,10 +29313,10 @@ var ts; function getTypeOfAccessors(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - var getter = ts.getDeclarationOfKind(symbol, 151 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 152 /* SetAccessor */); - if (getter && getter.flags & 2097152 /* JavaScriptFile */) { - var jsDocType = getTypeForVariableLikeDeclarationFromJSDocComment(getter); + var getter = ts.getDeclarationOfKind(symbol, 152 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 153 /* SetAccessor */); + if (getter && getter.flags & 65536 /* JavaScriptFile */) { + var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { return links.type = jsDocType; } @@ -27310,7 +29342,7 @@ var ts; type = getReturnTypeFromBody(getter); } else { - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { if (setter) { error(setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation, symbolToString(symbol)); } @@ -27325,8 +29357,8 @@ var ts; } if (!popTypeResolution()) { type = anyType; - if (compilerOptions.noImplicitAny) { - var getter_1 = ts.getDeclarationOfKind(symbol, 151 /* GetAccessor */); + if (noImplicitAny) { + var getter_1 = ts.getDeclarationOfKind(symbol, 152 /* GetAccessor */); error(getter_1, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -27334,6 +29366,10 @@ var ts; } return links.type; } + function getBaseTypeVariableOfClass(symbol) { + var baseConstructorType = getBaseConstructorTypeOfClass(getDeclaredTypeOfClassOrInterface(symbol)); + return baseConstructorType.flags & 540672 /* TypeVariable */ ? baseConstructorType : undefined; + } function getTypeOfFuncClassEnumModule(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { @@ -27342,8 +29378,13 @@ var ts; } else { var type = createObjectType(16 /* Anonymous */, symbol); - links.type = strictNullChecks && symbol.flags & 536870912 /* Optional */ ? - includeFalsyTypes(type, 2048 /* Undefined */) : type; + if (symbol.flags & 32 /* Class */) { + var baseTypeVariable = getBaseTypeVariableOfClass(symbol); + links.type = baseTypeVariable ? getIntersectionType([type, baseTypeVariable]) : type; + } + else { + links.type = strictNullChecks && symbol.flags & 67108864 /* Optional */ ? includeFalsyTypes(type, 2048 /* Undefined */) : type; + } } } return links.type; @@ -27373,12 +29414,39 @@ var ts; function getTypeOfInstantiatedSymbol(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - links.type = instantiateType(getTypeOfSymbol(links.target), links.mapper); + if (symbolInstantiationDepth === 100) { + error(symbol.valueDeclaration, ts.Diagnostics.Generic_type_instantiation_is_excessively_deep_and_possibly_infinite); + links.type = unknownType; + } + else { + if (!pushTypeResolution(symbol, 0 /* Type */)) { + return unknownType; + } + symbolInstantiationDepth++; + var type = instantiateType(getTypeOfSymbol(links.target), links.mapper); + symbolInstantiationDepth--; + if (!popTypeResolution()) { + type = reportCircularityError(symbol); + } + links.type = type; + } } return links.type; } + function reportCircularityError(symbol) { + // Check if variable has type annotation that circularly references the variable itself + if (symbol.valueDeclaration.type) { + error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); + return unknownType; + } + // Otherwise variable has initializer that circularly references the variable itself + if (noImplicitAny) { + error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); + } + return anyType; + } function getTypeOfSymbol(symbol) { - if (symbol.flags & 16777216 /* Instantiated */) { + if (getCheckFlags(symbol) & 1 /* Instantiated */) { return getTypeOfInstantiatedSymbol(symbol); } if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { @@ -27398,22 +29466,33 @@ var ts; } return unknownType; } + function isReferenceToType(type, target) { + return type !== undefined + && target !== undefined + && (getObjectFlags(type) & 4 /* Reference */) !== 0 + && type.target === target; + } function getTargetType(type) { return getObjectFlags(type) & 4 /* Reference */ ? type.target : type; } function hasBaseType(type, checkBase) { return check(type); function check(type) { - var target = getTargetType(type); - return target === checkBase || ts.forEach(getBaseTypes(target), check); + if (getObjectFlags(type) & (3 /* ClassOrInterface */ | 4 /* Reference */)) { + var target = getTargetType(type); + return target === checkBase || ts.forEach(getBaseTypes(target), check); + } + else if (type.flags & 131072 /* Intersection */) { + return ts.forEach(type.types, check); + } } } // Appends the type parameters given by a list of declarations to a set of type parameters and returns the resulting set. // The function allocates a new array if the input type parameter set is undefined, but otherwise it modifies the set // in-place and returns the same array. function appendTypeParameters(typeParameters, declarations) { - for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { - var declaration = declarations_2[_i]; + for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { + var declaration = declarations_3[_i]; var tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(declaration)); if (!typeParameters) { typeParameters = [tp]; @@ -27433,9 +29512,9 @@ var ts; if (!node) { return typeParameters; } - if (node.kind === 226 /* ClassDeclaration */ || node.kind === 197 /* ClassExpression */ || - node.kind === 225 /* FunctionDeclaration */ || node.kind === 184 /* FunctionExpression */ || - node.kind === 149 /* MethodDeclaration */ || node.kind === 185 /* ArrowFunction */) { + if (node.kind === 228 /* ClassDeclaration */ || node.kind === 198 /* ClassExpression */ || + node.kind === 227 /* FunctionDeclaration */ || node.kind === 185 /* FunctionExpression */ || + node.kind === 150 /* MethodDeclaration */ || node.kind === 186 /* ArrowFunction */) { var declarations = node.typeParameters; if (declarations) { return appendTypeParameters(appendOuterTypeParameters(typeParameters, node), declarations); @@ -27445,8 +29524,8 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 227 /* InterfaceDeclaration */); - return appendOuterTypeParameters(undefined, declaration); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 229 /* InterfaceDeclaration */); + return appendOuterTypeParameters(/*typeParameters*/ undefined, declaration); } // The local type parameters are the combined set of type parameters from all declarations of the class, // interface, or type alias. @@ -27454,8 +29533,8 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 227 /* InterfaceDeclaration */ || node.kind === 226 /* ClassDeclaration */ || - node.kind === 197 /* ClassExpression */ || node.kind === 228 /* TypeAliasDeclaration */) { + if (node.kind === 229 /* InterfaceDeclaration */ || node.kind === 228 /* ClassDeclaration */ || + node.kind === 198 /* ClassExpression */ || node.kind === 230 /* TypeAliasDeclaration */) { var declaration = node; if (declaration.typeParameters) { result = appendTypeParameters(result, declaration.typeParameters); @@ -27469,29 +29548,50 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { return ts.concatenate(getOuterTypeParametersOfClassOrInterface(symbol), getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol)); } + // A type is a mixin constructor if it has a single construct signature taking no type parameters and a single + // rest parameter of type any[]. + function isMixinConstructorType(type) { + var signatures = getSignaturesOfType(type, 1 /* Construct */); + if (signatures.length === 1) { + var s = signatures[0]; + return !s.typeParameters && s.parameters.length === 1 && s.hasRestParameter && getTypeOfParameter(s.parameters[0]) === anyArrayType; + } + return false; + } function isConstructorType(type) { - return type.flags & 32768 /* Object */ && getSignaturesOfType(type, 1 /* Construct */).length > 0; + if (isValidBaseType(type) && getSignaturesOfType(type, 1 /* Construct */).length > 0) { + return true; + } + if (type.flags & 540672 /* TypeVariable */) { + var constraint = getBaseConstraintOfType(type); + return constraint && isValidBaseType(constraint) && isMixinConstructorType(constraint); + } + return false; } function getBaseTypeNodeOfClass(type) { return ts.getClassExtendsHeritageClauseElement(type.symbol.valueDeclaration); } - function getConstructorsForTypeArguments(type, typeArgumentNodes) { - var typeArgCount = typeArgumentNodes ? typeArgumentNodes.length : 0; - return ts.filter(getSignaturesOfType(type, 1 /* Construct */), function (sig) { return (sig.typeParameters ? sig.typeParameters.length : 0) === typeArgCount; }); + function getConstructorsForTypeArguments(type, typeArgumentNodes, location) { + var typeArgCount = ts.length(typeArgumentNodes); + var isJavaScript = ts.isInJavaScriptFile(location); + return ts.filter(getSignaturesOfType(type, 1 /* Construct */), function (sig) { return (isJavaScript || typeArgCount >= getMinTypeArgumentCount(sig.typeParameters)) && typeArgCount <= ts.length(sig.typeParameters); }); } - function getInstantiatedConstructorsForTypeArguments(type, typeArgumentNodes) { - var signatures = getConstructorsForTypeArguments(type, typeArgumentNodes); + function getInstantiatedConstructorsForTypeArguments(type, typeArgumentNodes, location) { + var signatures = getConstructorsForTypeArguments(type, typeArgumentNodes, location); if (typeArgumentNodes) { var typeArguments_1 = ts.map(typeArgumentNodes, getTypeFromTypeNode); signatures = ts.map(signatures, function (sig) { return getSignatureInstantiation(sig, typeArguments_1); }); } return signatures; } - // The base constructor of a class can resolve to - // undefinedType if the class has no extends clause, - // unknownType if an error occurred during resolution of the extends expression, - // nullType if the extends expression is the null value, or - // an object type with at least one construct signature. + /** + * The base constructor of a class can resolve to + * * undefinedType if the class has no extends clause, + * * unknownType if an error occurred during resolution of the extends expression, + * * nullType if the extends expression is the null value, + * * anyType if the extends expression has type any, or + * * an object type with at least one construct signature. + */ function getBaseConstructorTypeOfClass(type) { if (!type.resolvedBaseConstructorType) { var baseTypeNode = getBaseTypeNodeOfClass(type); @@ -27502,7 +29602,7 @@ var ts; return unknownType; } var baseConstructorType = checkExpression(baseTypeNode.expression); - if (baseConstructorType.flags & 32768 /* Object */) { + if (baseConstructorType.flags & (32768 /* Object */ | 131072 /* Intersection */)) { // Resolving the members of a class requires us to resolve the base class of that class. // We force resolution here such that we catch circularities now. resolveStructuredTypeMembers(baseConstructorType); @@ -27511,7 +29611,7 @@ var ts; error(type.symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_base_expression, symbolToString(type.symbol)); return type.resolvedBaseConstructorType = unknownType; } - if (baseConstructorType !== unknownType && baseConstructorType !== nullWideningType && !isConstructorType(baseConstructorType)) { + if (!(baseConstructorType.flags & 1 /* Any */) && baseConstructorType !== nullWideningType && !isConstructorType(baseConstructorType)) { error(baseTypeNode.expression, ts.Diagnostics.Type_0_is_not_a_constructor_function_type, typeToString(baseConstructorType)); return type.resolvedBaseConstructorType = unknownType; } @@ -27540,8 +29640,8 @@ var ts; } function resolveBaseTypesOfClass(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; - var baseConstructorType = getBaseConstructorTypeOfClass(type); - if (!(baseConstructorType.flags & 32768 /* Object */)) { + var baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type)); + if (!(baseConstructorType.flags & (32768 /* Object */ | 131072 /* Intersection */ | 1 /* Any */))) { return; } var baseTypeNode = getBaseTypeNodeOfClass(type); @@ -27554,11 +29654,14 @@ var ts; // type arguments in the same manner as a type reference to get the same error reporting experience. baseType = getTypeFromClassOrInterfaceReference(baseTypeNode, baseConstructorType.symbol); } + else if (baseConstructorType.flags & 1 /* Any */) { + baseType = baseConstructorType; + } else { // The class derives from a "class-like" constructor function, check that we have at least one construct signature // with a matching number of type parameters and use the return type of the first instantiated signature. Elsewhere // we check that all instantiated signatures return the same type. - var constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments); + var constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments, baseTypeNode); if (!constructors.length) { error(baseTypeNode.expression, ts.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments); return; @@ -27576,7 +29679,7 @@ var ts; if (baseType === unknownType) { return; } - if (!(getObjectFlags(getTargetType(baseType)) & 3 /* ClassOrInterface */)) { + if (!isValidBaseType(baseType)) { error(baseTypeNode.expression, ts.Diagnostics.Base_constructor_return_type_0_is_not_a_class_or_interface_type, typeToString(baseType)); return; } @@ -27602,16 +29705,22 @@ var ts; } return true; } + // A valid base type is `any`, any non-generic object type or intersection of non-generic + // object types. + function isValidBaseType(type) { + return type.flags & (32768 /* Object */ | 16777216 /* NonPrimitive */ | 1 /* Any */) && !isGenericMappedType(type) || + type.flags & 131072 /* Intersection */ && !ts.forEach(type.types, function (t) { return !isValidBaseType(t); }); + } function resolveBaseTypesOfInterface(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 227 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 229 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getTypeFromTypeNode(node); if (baseType !== unknownType) { - if (getObjectFlags(getTargetType(baseType)) & 3 /* ClassOrInterface */) { + if (isValidBaseType(baseType)) { if (type !== baseType && !hasBaseType(baseType, type)) { if (type.resolvedBaseTypes === emptyArray) { type.resolvedBaseTypes = [baseType]; @@ -27638,7 +29747,7 @@ var ts; function isIndependentInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 227 /* InterfaceDeclaration */) { + if (declaration.kind === 229 /* InterfaceDeclaration */) { if (declaration.flags & 64 /* ContainsThis */) { return false; } @@ -27676,7 +29785,7 @@ var ts; type.outerTypeParameters = outerTypeParameters; type.localTypeParameters = localTypeParameters; type.instantiations = ts.createMap(); - type.instantiations[getTypeListId(type.typeParameters)] = type; + type.instantiations.set(getTypeListId(type.typeParameters), type); type.target = type; type.typeArguments = type.typeParameters; type.thisType = createType(16384 /* TypeParameter */); @@ -27695,7 +29804,7 @@ var ts; if (!pushTypeResolution(symbol, 2 /* DeclaredType */)) { return unknownType; } - var declaration = ts.getDeclarationOfKind(symbol, 285 /* JSDocTypedefTag */); + var declaration = ts.getDeclarationOfKind(symbol, 289 /* JSDocTypedefTag */); var type = void 0; if (declaration) { if (declaration.jsDocTypeLiteral) { @@ -27706,7 +29815,7 @@ var ts; } } else { - declaration = ts.getDeclarationOfKind(symbol, 228 /* TypeAliasDeclaration */); + declaration = ts.getDeclarationOfKind(symbol, 230 /* TypeAliasDeclaration */); type = getTypeFromTypeNode(declaration.type); } if (popTypeResolution()) { @@ -27716,7 +29825,7 @@ var ts; // an instantiation of the type alias with the type parameters supplied as type arguments. links.typeParameters = typeParameters; links.instantiations = ts.createMap(); - links.instantiations[getTypeListId(typeParameters)] = type; + links.instantiations.set(getTypeListId(typeParameters), type); } } else { @@ -27733,14 +29842,14 @@ var ts; return !ts.isInAmbientContext(member); } return expr.kind === 8 /* NumericLiteral */ || - expr.kind === 190 /* PrefixUnaryExpression */ && expr.operator === 37 /* MinusToken */ && + expr.kind === 191 /* PrefixUnaryExpression */ && expr.operator === 37 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */ || - expr.kind === 70 /* Identifier */ && !!symbol.exports[expr.text]; + expr.kind === 70 /* Identifier */ && !!symbol.exports.get(expr.text); } function enumHasLiteralMembers(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 229 /* EnumDeclaration */) { + if (declaration.kind === 231 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (!isLiteralEnumMember(symbol, member)) { @@ -27765,10 +29874,10 @@ var ts; enumType.symbol = symbol; if (enumHasLiteralMembers(symbol)) { var memberTypeList = []; - var memberTypes = ts.createMap(); + var memberTypes = []; for (var _i = 0, _a = enumType.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 229 /* EnumDeclaration */) { + if (declaration.kind === 231 /* EnumDeclaration */) { computeEnumMemberValues(declaration); for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; @@ -27785,7 +29894,7 @@ var ts; if (memberTypeList.length > 1) { enumType.flags |= 65536 /* Union */; enumType.types = memberTypeList; - unionTypes[getTypeListId(memberTypeList)] = enumType; + unionTypes.set(getTypeListId(memberTypeList), enumType); } } } @@ -27806,9 +29915,6 @@ var ts; if (!links.declaredType) { var type = createType(16384 /* TypeParameter */); type.symbol = symbol; - if (!ts.getDeclarationOfKind(symbol, 143 /* TypeParameter */).constraint) { - type.constraint = noConstraintType; - } links.declaredType = type; } return links.declaredType; @@ -27821,7 +29927,6 @@ var ts; return links.declaredType; } function getDeclaredTypeOfSymbol(symbol) { - ts.Debug.assert((symbol.flags & 16777216 /* Instantiated */) === 0); if (symbol.flags & (32 /* Class */ | 64 /* Interface */)) { return getDeclaredTypeOfClassOrInterface(symbol); } @@ -27860,19 +29965,20 @@ var ts; function isIndependentType(node) { switch (node.kind) { case 118 /* AnyKeyword */: - case 134 /* StringKeyword */: + case 135 /* StringKeyword */: case 132 /* NumberKeyword */: case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: + case 136 /* SymbolKeyword */: + case 133 /* ObjectKeyword */: case 104 /* VoidKeyword */: - case 137 /* UndefinedKeyword */: + case 138 /* UndefinedKeyword */: case 94 /* NullKeyword */: case 129 /* NeverKeyword */: - case 171 /* LiteralType */: + case 172 /* LiteralType */: return true; - case 162 /* ArrayType */: + case 163 /* ArrayType */: return isIndependentType(node.elementType); - case 157 /* TypeReference */: + case 158 /* TypeReference */: return isIndependentTypeReference(node); } return false; @@ -27885,7 +29991,7 @@ var ts; // A function-like declaration is considered independent (free of this references) if it has a return type // annotation that is considered independent and if each parameter is considered independent. function isIndependentFunctionLikeDeclaration(node) { - if (node.kind !== 150 /* Constructor */ && (!node.type || !isIndependentType(node.type))) { + if (node.kind !== 151 /* Constructor */ && (!node.type || !isIndependentType(node.type))) { return false; } for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { @@ -27906,12 +30012,12 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: return isIndependentVariableLikeDeclaration(declaration); - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: return isIndependentFunctionLikeDeclaration(declaration); } } @@ -27922,7 +30028,7 @@ var ts; var result = ts.createMap(); for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) { var symbol = symbols_1[_i]; - result[symbol.name] = symbol; + result.set(symbol.name, symbol); } return result; } @@ -27932,15 +30038,15 @@ var ts; var result = ts.createMap(); for (var _i = 0, symbols_2 = symbols; _i < symbols_2.length; _i++) { var symbol = symbols_2[_i]; - result[symbol.name] = mappingThisOnly && isIndependentMember(symbol) ? symbol : instantiateSymbol(symbol, mapper); + result.set(symbol.name, mappingThisOnly && isIndependentMember(symbol) ? symbol : instantiateSymbol(symbol, mapper)); } return result; } function addInheritedMembers(symbols, baseSymbols) { for (var _i = 0, baseSymbols_1 = baseSymbols; _i < baseSymbols_1.length; _i++) { var s = baseSymbols_1[_i]; - if (!symbols[s.name]) { - symbols[s.name] = s; + if (!symbols.has(s.name)) { + symbols.set(s.name, s); } } } @@ -27948,8 +30054,8 @@ var ts; if (!type.declaredProperties) { var symbol = type.symbol; type.declaredProperties = getNamedMembers(symbol.members); - type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); - type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); + type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members.get("__call")); + type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members.get("__new")); type.declaredStringIndexInfo = getIndexInfoOfSymbol(symbol, 0 /* String */); type.declaredNumberIndexInfo = getIndexInfoOfSymbol(symbol, 1 /* Number */); } @@ -27957,7 +30063,14 @@ var ts; } function getTypeWithThisArgument(type, thisArgument) { if (getObjectFlags(type) & 4 /* Reference */) { - return createTypeReference(type.target, ts.concatenate(type.typeArguments, [thisArgument || type.target.thisType])); + var target = type.target; + var typeArguments = type.typeArguments; + if (ts.length(target.typeParameters) === ts.length(typeArguments)) { + return createTypeReference(target, ts.concatenate(typeArguments, [thisArgument || target.thisType])); + } + } + else if (type.flags & 131072 /* Intersection */) { + return getIntersectionType(ts.map(type.types, function (t) { return getTypeWithThisArgument(t, thisArgument); })); } return type; } @@ -27993,10 +30106,14 @@ var ts; for (var _i = 0, baseTypes_1 = baseTypes; _i < baseTypes_1.length; _i++) { var baseType = baseTypes_1[_i]; var instantiatedBaseType = thisArgument ? getTypeWithThisArgument(instantiateType(baseType, mapper), thisArgument) : baseType; - addInheritedMembers(members, getPropertiesOfObjectType(instantiatedBaseType)); + addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType)); callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0 /* Call */)); constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1 /* Construct */)); - stringIndexInfo = stringIndexInfo || getIndexInfoOfType(instantiatedBaseType, 0 /* String */); + if (!stringIndexInfo) { + stringIndexInfo = instantiatedBaseType === anyType ? + createIndexInfo(anyType, /*isReadonly*/ false) : + getIndexInfoOfType(instantiatedBaseType, 0 /* String */); + } numberIndexInfo = numberIndexInfo || getIndexInfoOfType(instantiatedBaseType, 1 /* Number */); } } @@ -28035,14 +30152,16 @@ var ts; return [createSignature(undefined, classType.localTypeParameters, undefined, emptyArray, classType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false)]; } var baseTypeNode = getBaseTypeNodeOfClass(classType); + var isJavaScript = ts.isInJavaScriptFile(baseTypeNode); var typeArguments = ts.map(baseTypeNode.typeArguments, getTypeFromTypeNode); - var typeArgCount = typeArguments ? typeArguments.length : 0; + var typeArgCount = ts.length(typeArguments); var result = []; for (var _i = 0, baseSignatures_1 = baseSignatures; _i < baseSignatures_1.length; _i++) { var baseSig = baseSignatures_1[_i]; - var typeParamCount = baseSig.typeParameters ? baseSig.typeParameters.length : 0; - if (typeParamCount === typeArgCount) { - var sig = typeParamCount ? createSignatureInstantiation(baseSig, typeArguments) : cloneSignature(baseSig); + var minTypeArgumentCount = getMinTypeArgumentCount(baseSig.typeParameters); + var typeParamCount = ts.length(baseSig.typeParameters); + if ((isJavaScript || typeArgCount >= minTypeArgumentCount) && typeArgCount <= typeParamCount) { + var sig = typeParamCount ? createSignatureInstantiation(baseSig, fillMissingTypeArguments(typeArguments, baseSig.typeParameters, minTypeArgumentCount, baseTypeNode)) : cloneSignature(baseSig); sig.typeParameters = classType.localTypeParameters; sig.resolvedReturnType = classType; result.push(sig); @@ -28105,7 +30224,7 @@ var ts; s = cloneSignature(signature); if (ts.forEach(unionSignatures, function (sig) { return sig.thisParameter; })) { var thisType = getUnionType(ts.map(unionSignatures, function (sig) { return getTypeOfSymbol(sig.thisParameter) || anyType; }), /*subtypeReduction*/ true); - s.thisParameter = createTransientSymbol(signature.thisParameter, thisType); + s.thisParameter = createSymbolWithType(signature.thisParameter, thisType); } // Clear resolved return type we possibly got from cloneSignature s.resolvedReturnType = undefined; @@ -28121,8 +30240,8 @@ var ts; function getUnionIndexInfo(types, kind) { var indexTypes = []; var isAnyReadonly = false; - for (var _i = 0, types_1 = types; _i < types_1.length; _i++) { - var type = types_1[_i]; + for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { + var type = types_2[_i]; var indexInfo = getIndexInfoOfType(type, kind); if (!indexInfo) { return undefined; @@ -28150,22 +30269,57 @@ var ts; function unionSpreadIndexInfos(info1, info2) { return info1 && info2 && createIndexInfo(getUnionType([info1.type, info2.type]), info1.isReadonly || info2.isReadonly); } + function includeMixinType(type, types, index) { + var mixedTypes = []; + for (var i = 0; i < types.length; i++) { + if (i === index) { + mixedTypes.push(type); + } + else if (isMixinConstructorType(types[i])) { + mixedTypes.push(getReturnTypeOfSignature(getSignaturesOfType(types[i], 1 /* Construct */)[0])); + } + } + return getIntersectionType(mixedTypes); + } function resolveIntersectionTypeMembers(type) { // The members and properties collections are empty for intersection types. To get all properties of an // intersection type use getPropertiesOfType (only the language service uses this). var callSignatures = emptyArray; var constructSignatures = emptyArray; - var stringIndexInfo = undefined; - var numberIndexInfo = undefined; - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var t = _a[_i]; + var stringIndexInfo; + var numberIndexInfo; + var types = type.types; + var mixinCount = ts.countWhere(types, isMixinConstructorType); + var _loop_3 = function (i) { + var t = type.types[i]; + // When an intersection type contains mixin constructor types, the construct signatures from + // those types are discarded and their return types are mixed into the return types of all + // other construct signatures in the intersection type. For example, the intersection type + // '{ new(...args: any[]) => A } & { new(s: string) => B }' has a single construct signature + // 'new(s: string) => A & B'. + if (mixinCount === 0 || mixinCount === types.length && i === 0 || !isMixinConstructorType(t)) { + var signatures = getSignaturesOfType(t, 1 /* Construct */); + if (signatures.length && mixinCount > 0) { + signatures = ts.map(signatures, function (s) { + var clone = cloneSignature(s); + clone.resolvedReturnType = includeMixinType(getReturnTypeOfSignature(s), types, i); + return clone; + }); + } + constructSignatures = ts.concatenate(constructSignatures, signatures); + } callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(t, 0 /* Call */)); - constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(t, 1 /* Construct */)); stringIndexInfo = intersectIndexInfos(stringIndexInfo, getIndexInfoOfType(t, 0 /* String */)); numberIndexInfo = intersectIndexInfos(numberIndexInfo, getIndexInfoOfType(t, 1 /* Number */)); + }; + for (var i = 0; i < types.length; i++) { + _loop_3(i); } setStructuredTypeMembers(type, emptySymbols, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo); } + /** + * Converts an AnonymousType to a ResolvedType. + */ function resolveAnonymousTypeMembers(type) { var symbol = type.symbol; if (type.target) { @@ -28178,8 +30332,8 @@ var ts; } else if (symbol.flags & 2048 /* TypeLiteral */) { var members = symbol.members; - var callSignatures = getSignaturesOfSymbol(members["__call"]); - var constructSignatures = getSignaturesOfSymbol(members["__new"]); + var callSignatures = getSignaturesOfSymbol(members.get("__call")); + var constructSignatures = getSignaturesOfSymbol(members.get("__new")); var stringIndexInfo = getIndexInfoOfSymbol(symbol, 0 /* String */); var numberIndexInfo = getIndexInfoOfSymbol(symbol, 1 /* Number */); setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo); @@ -28188,23 +30342,27 @@ var ts; // Combinations of function, class, enum and module var members = emptySymbols; var constructSignatures = emptyArray; - if (symbol.flags & 1952 /* HasExports */) { + var stringIndexInfo = undefined; + if (symbol.exports) { members = getExportsOfSymbol(symbol); } if (symbol.flags & 32 /* Class */) { var classType = getDeclaredTypeOfClassOrInterface(symbol); - constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); + constructSignatures = getSignaturesOfSymbol(symbol.members.get("__constructor")); if (!constructSignatures.length) { constructSignatures = getDefaultConstructSignatures(classType); } var baseConstructorType = getBaseConstructorTypeOfClass(classType); - if (baseConstructorType.flags & 32768 /* Object */) { + if (baseConstructorType.flags & (32768 /* Object */ | 131072 /* Intersection */ | 540672 /* TypeVariable */)) { members = createSymbolTable(getNamedMembers(members)); - addInheritedMembers(members, getPropertiesOfObjectType(baseConstructorType)); + addInheritedMembers(members, getPropertiesOfType(baseConstructorType)); + } + else if (baseConstructorType === anyType) { + stringIndexInfo = createIndexInfo(anyType, /*isReadonly*/ false); } } var numberIndexInfo = symbol.flags & 384 /* Enum */ ? enumNumberIndexInfo : undefined; - setStructuredTypeMembers(type, members, emptyArray, constructSignatures, undefined, numberIndexInfo); + setStructuredTypeMembers(type, members, emptyArray, constructSignatures, stringIndexInfo, numberIndexInfo); // We resolve the members before computing the signatures because a signature may use // typeof with a qualified name expression that circularly references the type we are // in the process of resolving (see issue #6072). The temporarily empty signature list @@ -28218,7 +30376,6 @@ var ts; function resolveMappedTypeMembers(type) { var members = ts.createMap(); var stringIndexInfo; - var numberIndexInfo; // Resolve upfront such that recursive references see an empty object type. setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, undefined, undefined); // In { [P in K]: T }, we refer to P as the type parameter type, K as the constraint type, @@ -28226,43 +30383,53 @@ var ts; var typeParameter = getTypeParameterFromMappedType(type); var constraintType = getConstraintTypeFromMappedType(type); var templateType = getTemplateTypeFromMappedType(type); - var isReadonly = !!type.declaration.readonlyToken; - var isOptional = !!type.declaration.questionToken; - // First, if the constraint type is a type parameter, obtain the base constraint. Then, - // if the key type is a 'keyof X', obtain 'keyof C' where C is the base constraint of X. - // Finally, iterate over the constituents of the resulting iteration type. - var keyType = constraintType.flags & 16384 /* TypeParameter */ ? getApparentType(constraintType) : constraintType; - var iterationType = keyType.flags & 262144 /* Index */ ? getIndexType(getApparentType(keyType.type)) : keyType; - forEachType(iterationType, function (t) { + var modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); // The 'T' in 'keyof T' + var templateReadonly = !!type.declaration.readonlyToken; + var templateOptional = !!type.declaration.questionToken; + if (type.declaration.typeParameter.constraint.kind === 169 /* TypeOperator */) { + // We have a { [P in keyof T]: X } + for (var _i = 0, _a = getPropertiesOfType(modifiersType); _i < _a.length; _i++) { + var propertySymbol = _a[_i]; + addMemberForKeyType(getLiteralTypeFromPropertyName(propertySymbol), propertySymbol); + } + if (getIndexInfoOfType(modifiersType, 0 /* String */)) { + addMemberForKeyType(stringType); + } + } + else { + // First, if the constraint type is a type parameter, obtain the base constraint. Then, + // if the key type is a 'keyof X', obtain 'keyof C' where C is the base constraint of X. + // Finally, iterate over the constituents of the resulting iteration type. + var keyType = constraintType.flags & 540672 /* TypeVariable */ ? getApparentType(constraintType) : constraintType; + var iterationType = keyType.flags & 262144 /* Index */ ? getIndexType(getApparentType(keyType.type)) : keyType; + forEachType(iterationType, addMemberForKeyType); + } + setStructuredTypeMembers(type, members, emptyArray, emptyArray, stringIndexInfo, undefined); + function addMemberForKeyType(t, propertySymbol) { // Create a mapper from T to the current iteration type constituent. Then, if the // mapped type is itself an instantiated type, combine the iteration mapper with the // instantiation mapper. - var iterationMapper = createUnaryTypeMapper(typeParameter, t); + var iterationMapper = createTypeMapper([typeParameter], [t]); var templateMapper = type.mapper ? combineTypeMappers(type.mapper, iterationMapper) : iterationMapper; var propType = instantiateType(templateType, templateMapper); - // If the current iteration type constituent is a literal type, create a property. - // Otherwise, for type string create a string index signature and for type number - // create a numeric index signature. - if (t.flags & (32 /* StringLiteral */ | 64 /* NumberLiteral */ | 256 /* EnumLiteral */)) { + // If the current iteration type constituent is a string literal type, create a property. + // Otherwise, for type string create a string index signature. + if (t.flags & 32 /* StringLiteral */) { var propName = t.text; - var prop = createSymbol(4 /* Property */ | 67108864 /* Transient */ | (isOptional ? 536870912 /* Optional */ : 0), propName); - prop.type = addOptionality(propType, isOptional); - prop.isReadonly = isReadonly; - members[propName] = prop; + var modifiersProp = getPropertyOfType(modifiersType, propName); + var isOptional = templateOptional || !!(modifiersProp && modifiersProp.flags & 67108864 /* Optional */); + var prop = createSymbol(4 /* Property */ | (isOptional ? 67108864 /* Optional */ : 0), propName); + prop.checkFlags = templateReadonly || modifiersProp && isReadonlySymbol(modifiersProp) ? 8 /* Readonly */ : 0; + prop.type = propType; + if (propertySymbol) { + prop.syntheticOrigin = propertySymbol; + } + members.set(propName, prop); } else if (t.flags & 2 /* String */) { - stringIndexInfo = createIndexInfo(propType, isReadonly); + stringIndexInfo = createIndexInfo(propType, templateReadonly); } - else if (t.flags & 4 /* Number */) { - numberIndexInfo = createIndexInfo(propType, isReadonly); - } - }); - // If we created both a string and a numeric string index signature, and if the two index - // signatures have identical types, discard the redundant numeric index signature. - if (stringIndexInfo && numberIndexInfo && isTypeIdenticalTo(stringIndexInfo.type, numberIndexInfo.type)) { - numberIndexInfo = undefined; } - setStructuredTypeMembers(type, members, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo); } function getTypeParameterFromMappedType(type) { return type.typeParameter || @@ -28275,16 +30442,34 @@ var ts; function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? - instantiateType(getTypeFromTypeNode(type.declaration.type), type.mapper || identityMapper) : + instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!type.declaration.questionToken), type.mapper || identityMapper) : unknownType); } - function getErasedTemplateTypeFromMappedType(type) { - return instantiateType(getTemplateTypeFromMappedType(type), createUnaryTypeMapper(getTypeParameterFromMappedType(type), anyType)); + function getModifiersTypeFromMappedType(type) { + if (!type.modifiersType) { + var constraintDeclaration = type.declaration.typeParameter.constraint; + if (constraintDeclaration.kind === 169 /* TypeOperator */) { + // If the constraint declaration is a 'keyof T' node, the modifiers type is T. We check + // AST nodes here because, when T is a non-generic type, the logic below eagerly resolves + // 'keyof T' to a literal union type and we can't recover T from that type. + type.modifiersType = instantiateType(getTypeFromTypeNode(constraintDeclaration.type), type.mapper || identityMapper); + } + else { + // Otherwise, get the declared constraint type, and if the constraint type is a type parameter, + // get the constraint of that type parameter. If the resulting type is an indexed type 'keyof T', + // the modifiers type is T. Otherwise, the modifiers type is {}. + var declaredType = getTypeFromMappedTypeNode(type.declaration); + var constraint = getConstraintTypeFromMappedType(declaredType); + var extendedConstraint = constraint && constraint.flags & 16384 /* TypeParameter */ ? getConstraintOfTypeParameter(constraint) : constraint; + type.modifiersType = extendedConstraint && extendedConstraint.flags & 262144 /* Index */ ? instantiateType(extendedConstraint.type, type.mapper || identityMapper) : emptyObjectType; + } + } + return type.modifiersType; } function isGenericMappedType(type) { if (getObjectFlags(type) & 32 /* Mapped */) { var constraintType = getConstraintTypeFromMappedType(type); - return !!(constraintType.flags & (16384 /* TypeParameter */ | 262144 /* Index */)); + return maybeTypeOfKind(constraintType, 540672 /* TypeVariable */ | 262144 /* Index */); } return false; } @@ -28321,42 +30506,40 @@ var ts; return emptyArray; } /** If the given type is an object type and that type has a property by the given name, - * return the symbol for that property. Otherwise return undefined. */ + * return the symbol for that property. Otherwise return undefined. + */ function getPropertyOfObjectType(type, name) { if (type.flags & 32768 /* Object */) { var resolved = resolveStructuredTypeMembers(type); - var symbol = resolved.members[name]; + var symbol = resolved.members.get(name); if (symbol && symbolIsValue(symbol)) { return symbol; } } } function getPropertiesOfUnionOrIntersectionType(type) { - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var current = _a[_i]; - for (var _b = 0, _c = getPropertiesOfType(current); _b < _c.length; _b++) { - var prop = _c[_b]; - getUnionOrIntersectionProperty(type, prop.name); - } - // The properties of a union type are those that are present in all constituent types, so - // we only need to check the properties of the first type - if (type.flags & 65536 /* Union */) { - break; - } - } - var props = type.resolvedProperties; - if (props) { - var result = []; - for (var key in props) { - var prop = props[key]; - // We need to filter out partial properties in union types - if (!(prop.flags & 268435456 /* SyntheticProperty */ && prop.isPartial)) { - result.push(prop); + if (!type.resolvedProperties) { + var members = ts.createMap(); + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var current = _a[_i]; + for (var _b = 0, _c = getPropertiesOfType(current); _b < _c.length; _b++) { + var prop = _c[_b]; + if (!members.has(prop.name)) { + var combinedProp = getPropertyOfUnionOrIntersectionType(type, prop.name); + if (combinedProp) { + members.set(prop.name, combinedProp); + } + } + } + // The properties of a union type are those that are present in all constituent types, so + // we only need to check the properties of the first type + if (type.flags & 65536 /* Union */) { + break; } } - return result; + type.resolvedProperties = getNamedMembers(members); } - return emptyArray; + return type.resolvedProperties; } function getPropertiesOfType(type) { type = getApparentType(type); @@ -28364,25 +30547,114 @@ var ts; getPropertiesOfUnionOrIntersectionType(type) : getPropertiesOfObjectType(type); } - /** - * The apparent type of a type parameter is the base constraint instantiated with the type parameter - * as the type argument for the 'this' type. - */ - function getApparentTypeOfTypeParameter(type) { - if (!type.resolvedApparentType) { - var constraintType = getConstraintOfTypeParameter(type); - while (constraintType && constraintType.flags & 16384 /* TypeParameter */) { - constraintType = getConstraintOfTypeParameter(constraintType); + function getConstraintOfType(type) { + return type.flags & 16384 /* TypeParameter */ ? getConstraintOfTypeParameter(type) : + type.flags & 524288 /* IndexedAccess */ ? getConstraintOfIndexedAccess(type) : + getBaseConstraintOfType(type); + } + function getConstraintOfTypeParameter(typeParameter) { + return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : undefined; + } + function getConstraintOfIndexedAccess(type) { + var baseObjectType = getBaseConstraintOfType(type.objectType); + var baseIndexType = getBaseConstraintOfType(type.indexType); + return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined; + } + function getBaseConstraintOfType(type) { + if (type.flags & (540672 /* TypeVariable */ | 196608 /* UnionOrIntersection */)) { + var constraint = getResolvedBaseConstraint(type); + if (constraint !== noConstraintType && constraint !== circularConstraintType) { + return constraint; } - type.resolvedApparentType = getTypeWithThisArgument(constraintType || emptyObjectType, type); } - return type.resolvedApparentType; + else if (type.flags & 262144 /* Index */) { + return stringType; + } + return undefined; + } + function hasNonCircularBaseConstraint(type) { + return getResolvedBaseConstraint(type) !== circularConstraintType; } /** - * The apparent type of an indexed access T[K] is the type of T's string index signature, if any. + * Return the resolved base constraint of a type variable. The noConstraintType singleton is returned if the + * type variable has no constraint, and the circularConstraintType singleton is returned if the constraint + * circularly references the type variable. */ - function getApparentTypeOfIndexedAccess(type) { - return getIndexTypeOfType(getApparentType(type.objectType), 0 /* String */) || type; + function getResolvedBaseConstraint(type) { + var typeStack; + var circular; + if (!type.resolvedBaseConstraint) { + typeStack = []; + var constraint = getBaseConstraint(type); + type.resolvedBaseConstraint = circular ? circularConstraintType : getTypeWithThisArgument(constraint || noConstraintType, type); + } + return type.resolvedBaseConstraint; + function getBaseConstraint(t) { + if (ts.contains(typeStack, t)) { + circular = true; + return undefined; + } + typeStack.push(t); + var result = computeBaseConstraint(t); + typeStack.pop(); + return result; + } + function computeBaseConstraint(t) { + if (t.flags & 16384 /* TypeParameter */) { + var constraint = getConstraintFromTypeParameter(t); + return t.isThisType ? constraint : + constraint ? getBaseConstraint(constraint) : undefined; + } + if (t.flags & 196608 /* UnionOrIntersection */) { + var types = t.types; + var baseTypes = []; + for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { + var type_2 = types_3[_i]; + var baseType = getBaseConstraint(type_2); + if (baseType) { + baseTypes.push(baseType); + } + } + return t.flags & 65536 /* Union */ && baseTypes.length === types.length ? getUnionType(baseTypes) : + t.flags & 131072 /* Intersection */ && baseTypes.length ? getIntersectionType(baseTypes) : + undefined; + } + if (t.flags & 262144 /* Index */) { + return stringType; + } + if (t.flags & 524288 /* IndexedAccess */) { + var baseObjectType = getBaseConstraint(t.objectType); + var baseIndexType = getBaseConstraint(t.indexType); + var baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined; + return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined; + } + return t; + } + } + function getApparentTypeOfIntersectionType(type) { + return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument(type, type)); + } + /** + * Gets the default type for a type parameter. + * + * If the type parameter is the result of an instantiation, this gets the instantiated + * default type of its target. If the type parameter has no default type, `undefined` + * is returned. + * + * This function *does not* perform a circularity check. + */ + function getDefaultFromTypeParameter(typeParameter) { + if (!typeParameter.default) { + if (typeParameter.target) { + var targetDefault = getDefaultFromTypeParameter(typeParameter.target); + typeParameter.default = targetDefault ? instantiateType(targetDefault, typeParameter.mapper) : noConstraintType; + } + else { + var defaultDeclaration = typeParameter.symbol && ts.forEach(typeParameter.symbol.declarations, function (decl) { return ts.isTypeParameter(decl) && decl.default; }); + typeParameter.default = defaultDeclaration ? getTypeFromTypeNode(defaultDeclaration) : noConstraintType; + } + } + return typeParameter.default === noConstraintType ? undefined : typeParameter.default; } /** * For a type parameter, return the base constraint of the type parameter. For the string, number, @@ -28390,28 +30662,31 @@ var ts; * type itself. Note that the apparent type of a union type is the union type itself. */ function getApparentType(type) { - var t = type.flags & 16384 /* TypeParameter */ ? getApparentTypeOfTypeParameter(type) : - type.flags & 524288 /* IndexedAccess */ ? getApparentTypeOfIndexedAccess(type) : - type; - return t.flags & 262178 /* StringLike */ ? globalStringType : - t.flags & 340 /* NumberLike */ ? globalNumberType : - t.flags & 136 /* BooleanLike */ ? globalBooleanType : - t.flags & 512 /* ESSymbol */ ? getGlobalESSymbolType() : - t; + var t = type.flags & 540672 /* TypeVariable */ ? getBaseConstraintOfType(type) || emptyObjectType : type; + return t.flags & 131072 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : + t.flags & 262178 /* StringLike */ ? globalStringType : + t.flags & 340 /* NumberLike */ ? globalNumberType : + t.flags & 136 /* BooleanLike */ ? globalBooleanType : + t.flags & 512 /* ESSymbol */ ? getGlobalESSymbolType(/*reportErrors*/ languageVersion >= 2 /* ES2015 */) : + t.flags & 16777216 /* NonPrimitive */ ? emptyObjectType : + t; } function createUnionOrIntersectionProperty(containingType, name) { - var types = containingType.types; var props; + var types = containingType.types; + var isUnion = containingType.flags & 65536 /* Union */; + var excludeModifiers = isUnion ? 24 /* NonPublicAccessibilityModifier */ : 0; // Flags we want to propagate to the result if they exist in all source symbols - var commonFlags = (containingType.flags & 131072 /* Intersection */) ? 536870912 /* Optional */ : 0 /* None */; - var isReadonly = false; - var isPartial = false; - for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { - var current = types_2[_i]; + var commonFlags = isUnion ? 0 /* None */ : 67108864 /* Optional */; + var syntheticFlag = 4 /* SyntheticMethod */; + var checkFlags = 0; + for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { + var current = types_4[_i]; var type = getApparentType(current); if (type !== unknownType) { var prop = getPropertyOfType(type, name); - if (prop && !(getDeclarationModifierFlagsFromSymbol(prop) & (8 /* Private */ | 16 /* Protected */))) { + var modifiers = prop ? getDeclarationModifierFlagsFromSymbol(prop) : 0; + if (prop && !(modifiers & excludeModifiers)) { commonFlags &= prop.flags; if (!props) { props = [prop]; @@ -28419,25 +30694,29 @@ var ts; else if (!ts.contains(props, prop)) { props.push(prop); } - if (isReadonlySymbol(prop)) { - isReadonly = true; + checkFlags |= (isReadonlySymbol(prop) ? 8 /* Readonly */ : 0) | + (!(modifiers & 24 /* NonPublicAccessibilityModifier */) ? 64 /* ContainsPublic */ : 0) | + (modifiers & 16 /* Protected */ ? 128 /* ContainsProtected */ : 0) | + (modifiers & 8 /* Private */ ? 256 /* ContainsPrivate */ : 0) | + (modifiers & 32 /* Static */ ? 512 /* ContainsStatic */ : 0); + if (!isMethodLike(prop)) { + syntheticFlag = 2 /* SyntheticProperty */; } } - else if (containingType.flags & 65536 /* Union */) { - isPartial = true; + else if (isUnion) { + checkFlags |= 16 /* Partial */; } } } if (!props) { return undefined; } - if (props.length === 1 && !isPartial) { + if (props.length === 1 && !(checkFlags & 16 /* Partial */)) { return props[0]; } var propTypes = []; var declarations = []; var commonType = undefined; - var hasNonUniformType = false; for (var _a = 0, props_1 = props; _a < props_1.length; _a++) { var prop = props_1[_a]; if (prop.declarations) { @@ -28448,17 +30727,15 @@ var ts; commonType = type; } else if (type !== commonType) { - hasNonUniformType = true; + checkFlags |= 32 /* HasNonUniformType */; } propTypes.push(type); } - var result = createSymbol(4 /* Property */ | 67108864 /* Transient */ | 268435456 /* SyntheticProperty */ | commonFlags, name); + var result = createSymbol(4 /* Property */ | commonFlags, name); + result.checkFlags = syntheticFlag | checkFlags; result.containingType = containingType; - result.hasNonUniformType = hasNonUniformType; - result.isPartial = isPartial; result.declarations = declarations; - result.isReadonly = isReadonly; - result.type = containingType.flags & 65536 /* Union */ ? getUnionType(propTypes) : getIntersectionType(propTypes); + result.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes); return result; } // Return the symbol for a given property in a union or intersection type, or undefined if the property @@ -28467,12 +30744,12 @@ var ts; // these partial properties when identifying discriminant properties, but otherwise they are filtered out // and do not appear to be present in the union type. function getUnionOrIntersectionProperty(type, name) { - var properties = type.resolvedProperties || (type.resolvedProperties = ts.createMap()); - var property = properties[name]; + var properties = type.propertyCache || (type.propertyCache = ts.createMap()); + var property = properties.get(name); if (!property) { property = createUnionOrIntersectionProperty(type, name); if (property) { - properties[name] = property; + properties.set(name, property); } } return property; @@ -28480,7 +30757,7 @@ var ts; function getPropertyOfUnionOrIntersectionType(type, name) { var property = getUnionOrIntersectionProperty(type, name); // We need to filter out partial properties in union types - return property && !(property.flags & 268435456 /* SyntheticProperty */ && property.isPartial) ? property : undefined; + return property && !(getCheckFlags(property) & 16 /* Partial */) ? property : undefined; } /** * Return the symbol for the property with the given name in the given type. Creates synthetic union properties when @@ -28494,7 +30771,7 @@ var ts; type = getApparentType(type); if (type.flags & 32768 /* Object */) { var resolved = resolveStructuredTypeMembers(type); - var symbol = resolved.members[name]; + var symbol = resolved.members.get(name); if (symbol && symbolIsValue(symbol)) { return symbol; } @@ -28561,7 +30838,7 @@ var ts; return undefined; } function getTypeParametersFromJSDocTemplate(declaration) { - if (declaration.flags & 2097152 /* JavaScriptFile */) { + if (declaration.flags & 65536 /* JavaScriptFile */) { var templateTag = ts.getJSDocTemplateTag(declaration); if (templateTag) { return getTypeParametersFromDeclaration(templateTag.typeParameters); @@ -28583,16 +30860,16 @@ var ts; } function symbolsToArray(symbols) { var result = []; - for (var id in symbols) { + symbols.forEach(function (symbol, id) { if (!isReservedMemberName(id)) { - result.push(symbols[id]); + result.push(symbol); } - } + }); return result; } function isJSDocOptionalParameter(node) { - if (node.flags & 2097152 /* JavaScriptFile */) { - if (node.type && node.type.kind === 273 /* JSDocOptionalType */) { + if (node.flags & 65536 /* JavaScriptFile */) { + if (node.type && node.type.kind === 277 /* JSDocOptionalType */) { return true; } var paramTags = ts.getJSDocParameterTags(node); @@ -28603,7 +30880,7 @@ var ts; return true; } if (paramTag.typeExpression) { - return paramTag.typeExpression.type.kind === 273 /* JSDocOptionalType */; + return paramTag.typeExpression.type.kind === 277 /* JSDocOptionalType */; } } } @@ -28628,6 +30905,12 @@ var ts; ts.Debug.assert(parameterIndex >= 0); return parameterIndex >= signature.minArgumentCount; } + var iife = ts.getImmediatelyInvokedFunctionExpression(node.parent); + if (iife) { + return !node.type && + !node.dotDotDotToken && + ts.indexOf(node.parent.parameters, node) >= iife.arguments.length; + } return false; } function createTypePredicateFromTypePredicateNode(node) { @@ -28647,19 +30930,68 @@ var ts; }; } } + /** + * Gets the minimum number of type arguments needed to satisfy all non-optional type + * parameters. + */ + function getMinTypeArgumentCount(typeParameters) { + var minTypeArgumentCount = 0; + if (typeParameters) { + for (var i = 0; i < typeParameters.length; i++) { + if (!getDefaultFromTypeParameter(typeParameters[i])) { + minTypeArgumentCount = i + 1; + } + } + } + return minTypeArgumentCount; + } + /** + * Fill in default types for unsupplied type arguments. If `typeArguments` is undefined + * when a default type is supplied, a new array will be created and returned. + * + * @param typeArguments The supplied type arguments. + * @param typeParameters The requested type parameters. + * @param minTypeArgumentCount The minimum number of required type arguments. + */ + function fillMissingTypeArguments(typeArguments, typeParameters, minTypeArgumentCount, location) { + var numTypeParameters = ts.length(typeParameters); + if (numTypeParameters) { + var numTypeArguments = ts.length(typeArguments); + var isJavaScript = ts.isInJavaScriptFile(location); + if ((isJavaScript || numTypeArguments >= minTypeArgumentCount) && numTypeArguments <= numTypeParameters) { + if (!typeArguments) { + typeArguments = []; + } + // Map an unsatisfied type parameter with a default type. + // If a type parameter does not have a default type, or if the default type + // is a forward reference, the empty object type is used. + for (var i = numTypeArguments; i < numTypeParameters; i++) { + typeArguments[i] = isJavaScript ? anyType : emptyObjectType; + } + for (var i = numTypeArguments; i < numTypeParameters; i++) { + var mapper = createTypeMapper(typeParameters, typeArguments); + var defaultType = getDefaultFromTypeParameter(typeParameters[i]); + typeArguments[i] = defaultType ? instantiateType(defaultType, mapper) : isJavaScript ? anyType : emptyObjectType; + } + } + } + return typeArguments; + } function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { var parameters = []; var hasLiteralTypes = false; - var minArgumentCount = -1; + var minArgumentCount = 0; var thisParameter = undefined; var hasThisParameter = void 0; + var iife = ts.getImmediatelyInvokedFunctionExpression(declaration); var isJSConstructSignature = ts.isJSDocConstructSignature(declaration); + var isUntypedSignatureInJSFile = !iife && !isJSConstructSignature && ts.isInJavaScriptFile(declaration) && !ts.hasJSDocParameterTags(declaration); // If this is a JSDoc construct signature, then skip the first parameter in the // parameter list. The first parameter represents the return type of the construct // signature. - for (var i = isJSConstructSignature ? 1 : 0, n = declaration.parameters.length; i < n; i++) { + for (var i = isJSConstructSignature ? 1 : 0; i < declaration.parameters.length; i++) { var param = declaration.parameters[i]; var paramSymbol = param.symbol; // Include parameter symbol instead of property symbol in the signature @@ -28674,43 +31006,36 @@ var ts; else { parameters.push(paramSymbol); } - if (param.type && param.type.kind === 171 /* LiteralType */) { + if (param.type && param.type.kind === 172 /* LiteralType */) { hasLiteralTypes = true; } - if (param.initializer || param.questionToken || param.dotDotDotToken || isJSDocOptionalParameter(param)) { - if (minArgumentCount < 0) { - minArgumentCount = i - (hasThisParameter ? 1 : 0); - } - } - else { - // If we see any required parameters, it means the prior ones were not in fact optional. - minArgumentCount = -1; + // Record a new minimum argument count if this is not an optional parameter + var isOptionalParameter_1 = param.initializer || param.questionToken || param.dotDotDotToken || + iife && parameters.length > iife.arguments.length && !param.type || + isJSDocOptionalParameter(param) || + isUntypedSignatureInJSFile; + if (!isOptionalParameter_1) { + minArgumentCount = parameters.length; } } // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation - if ((declaration.kind === 151 /* GetAccessor */ || declaration.kind === 152 /* SetAccessor */) && + if ((declaration.kind === 152 /* GetAccessor */ || declaration.kind === 153 /* SetAccessor */) && !ts.hasDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 151 /* GetAccessor */ ? 152 /* SetAccessor */ : 151 /* GetAccessor */; + var otherKind = declaration.kind === 152 /* GetAccessor */ ? 153 /* SetAccessor */ : 152 /* GetAccessor */; var other = ts.getDeclarationOfKind(declaration.symbol, otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - if (minArgumentCount < 0) { - minArgumentCount = declaration.parameters.length - (hasThisParameter ? 1 : 0); - } - if (isJSConstructSignature) { - minArgumentCount--; - } - var classType = declaration.kind === 150 /* Constructor */ ? + var classType = declaration.kind === 151 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : getTypeParametersFromJSDocTemplate(declaration); var returnType = getSignatureReturnTypeFromDeclaration(declaration, isJSConstructSignature, classType); - var typePredicate = declaration.type && declaration.type.kind === 156 /* TypePredicate */ ? + var typePredicate = declaration.type && declaration.type.kind === 157 /* TypePredicate */ ? createTypePredicateFromTypePredicateNode(declaration.type) : undefined; links.resolvedSignature = createSignature(declaration, typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, ts.hasRestParameter(declaration), hasLiteralTypes); @@ -28727,7 +31052,7 @@ var ts; else if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.flags & 2097152 /* JavaScriptFile */) { + if (declaration.flags & 65536 /* JavaScriptFile */) { var type = getReturnTypeFromJSDocComment(declaration); if (type && type !== unknownType) { return type; @@ -28735,35 +31060,63 @@ var ts; } // TypeScript 1.0 spec (April 2014): // If only one accessor includes a type annotation, the other behaves as if it had the same type annotation. - if (declaration.kind === 151 /* GetAccessor */ && !ts.hasDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(declaration.symbol, 152 /* SetAccessor */); + if (declaration.kind === 152 /* GetAccessor */ && !ts.hasDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(declaration.symbol, 153 /* SetAccessor */); return getAnnotatedAccessorType(setter); } if (ts.nodeIsMissing(declaration.body)) { return anyType; } } + function containsArgumentsReference(declaration) { + var links = getNodeLinks(declaration); + if (links.containsArgumentsReference === undefined) { + if (links.flags & 8192 /* CaptureArguments */) { + links.containsArgumentsReference = true; + } + else { + links.containsArgumentsReference = traverse(declaration.body); + } + } + return links.containsArgumentsReference; + function traverse(node) { + if (!node) + return false; + switch (node.kind) { + case 70 /* Identifier */: + return node.text === "arguments" && ts.isPartOfExpression(node); + case 148 /* PropertyDeclaration */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + return node.name.kind === 143 /* ComputedPropertyName */ + && traverse(node.name); + default: + return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && ts.forEachChild(node, traverse); + } + } + } function getSignaturesOfSymbol(symbol) { if (!symbol) return emptyArray; var result = []; - for (var i = 0, len = symbol.declarations.length; i < len; i++) { + for (var i = 0; i < symbol.declarations.length; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 225 /* FunctionDeclaration */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 274 /* JSDocFunctionType */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: + case 227 /* FunctionDeclaration */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 278 /* JSDocFunctionType */: // Don't include signature if node is the implementation of an overloaded function. A node is considered // an implementation node if it has a body and the previous node is of the same kind and immediately // precedes the implementation node (i.e. has the same parent and ends where the implementation starts). @@ -28810,7 +31163,7 @@ var ts; } if (!popTypeResolution()) { type = anyType; - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { var declaration = signature.declaration; if (declaration.name) { error(declaration.name, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, ts.declarationNameToString(declaration.name)); @@ -28834,9 +31187,14 @@ var ts; return anyType; } function getSignatureInstantiation(signature, typeArguments) { + typeArguments = fillMissingTypeArguments(typeArguments, signature.typeParameters, getMinTypeArgumentCount(signature.typeParameters)); var instantiations = signature.instantiations || (signature.instantiations = ts.createMap()); var id = getTypeListId(typeArguments); - return instantiations[id] || (instantiations[id] = createSignatureInstantiation(signature, typeArguments)); + var instantiation = instantiations.get(id); + if (!instantiation) { + instantiations.set(id, instantiation = createSignatureInstantiation(signature, typeArguments)); + } + return instantiation; } function createSignatureInstantiation(signature, typeArguments) { return instantiateSignature(signature, createTypeMapper(signature.typeParameters, typeArguments), /*eraseTypeParameters*/ true); @@ -28855,7 +31213,7 @@ var ts; // object type literal or interface (using the new keyword). Each way of declaring a constructor // will result in a different declaration kind. if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 150 /* Constructor */ || signature.declaration.kind === 154 /* ConstructSignature */; + var isConstructor = signature.declaration.kind === 151 /* Constructor */ || signature.declaration.kind === 155 /* ConstructSignature */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = emptyArray; @@ -28866,10 +31224,10 @@ var ts; return signature.isolatedSignatureType; } function getIndexSymbol(symbol) { - return symbol.members["__index"]; + return symbol.members.get("__index"); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 132 /* NumberKeyword */ : 134 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 132 /* NumberKeyword */ : 135 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -28896,21 +31254,9 @@ var ts; return undefined; } function getConstraintDeclaration(type) { - return ts.getDeclarationOfKind(type.symbol, 143 /* TypeParameter */).constraint; + return ts.getDeclarationOfKind(type.symbol, 144 /* TypeParameter */).constraint; } - function hasConstraintReferenceTo(type, target) { - var checked; - while (type && type.flags & 16384 /* TypeParameter */ && !(type.isThisType) && !ts.contains(checked, type)) { - if (type === target) { - return true; - } - (checked || (checked = [])).push(type); - var constraintDeclaration = getConstraintDeclaration(type); - type = constraintDeclaration && getTypeFromTypeNode(constraintDeclaration); - } - return false; - } - function getConstraintOfTypeParameter(typeParameter) { + function getConstraintFromTypeParameter(typeParameter) { if (!typeParameter.constraint) { if (typeParameter.target) { var targetConstraint = getConstraintOfTypeParameter(typeParameter.target); @@ -28918,28 +31264,23 @@ var ts; } else { var constraintDeclaration = getConstraintDeclaration(typeParameter); - var constraint = getTypeFromTypeNode(constraintDeclaration); - if (hasConstraintReferenceTo(constraint, typeParameter)) { - error(constraintDeclaration, ts.Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(typeParameter)); - constraint = unknownType; - } - typeParameter.constraint = constraint; + typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : noConstraintType; } } return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 143 /* TypeParameter */).parent); + return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 144 /* TypeParameter */).parent); } function getTypeListId(types) { var result = ""; if (types) { - var length_3 = types.length; + var length_4 = types.length; var i = 0; - while (i < length_3) { + while (i < length_4) { var startId = types[i].id; var count = 1; - while (i + count < length_3 && types[i + count].id === startId + count) { + while (i + count < length_4 && types[i + count].id === startId + count) { count++; } if (result.length) { @@ -28960,8 +31301,8 @@ var ts; // that care about the presence of such types at arbitrary depth in a containing type. function getPropagatingFlagsOfTypes(types, excludeKinds) { var result = 0; - for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { - var type = types_3[_i]; + for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { + var type = types_5[_i]; if (!(type.flags & excludeKinds)) { result |= type.flags; } @@ -28970,9 +31311,10 @@ var ts; } function createTypeReference(target, typeArguments) { var id = getTypeListId(typeArguments); - var type = target.instantiations[id]; + var type = target.instantiations.get(id); if (!type) { - type = target.instantiations[id] = createObjectType(4 /* Reference */, target.symbol); + type = createObjectType(4 /* Reference */, target.symbol); + target.instantiations.set(id, type); type.flags |= typeArguments ? getPropagatingFlagsOfTypes(typeArguments, /*excludeKinds*/ 0) : 0; type.target = target; type.typeArguments = typeArguments; @@ -28988,21 +31330,26 @@ var ts; return type; } function getTypeReferenceArity(type) { - return type.target.typeParameters ? type.target.typeParameters.length : 0; + return ts.length(type.target.typeParameters); } // Get type from reference to class or interface function getTypeFromClassOrInterfaceReference(node, symbol) { var type = getDeclaredTypeOfSymbol(getMergedSymbol(symbol)); var typeParameters = type.localTypeParameters; if (typeParameters) { - if (!node.typeArguments || node.typeArguments.length !== typeParameters.length) { - error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, /*enclosingDeclaration*/ undefined, 1 /* WriteArrayAsGenericType */), typeParameters.length); + var numTypeArguments = ts.length(node.typeArguments); + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + if (!ts.isInJavaScriptFile(node) && (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length)) { + error(node, minTypeArgumentCount === typeParameters.length + ? ts.Diagnostics.Generic_type_0_requires_1_type_argument_s + : ts.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments, typeToString(type, /*enclosingDeclaration*/ undefined, 1 /* WriteArrayAsGenericType */), minTypeArgumentCount, typeParameters.length); return unknownType; } // In a type reference, the outer type parameters of the referenced class or interface are automatically // supplied as type arguments and the type reference only specifies arguments for the local type parameters // of the class or interface. - return createTypeReference(type, ts.concatenate(type.outerTypeParameters, ts.map(node.typeArguments, getTypeFromTypeNode))); + var typeArguments = ts.concatenate(type.outerTypeParameters, fillMissingTypeArguments(ts.map(node.typeArguments, getTypeFromTypeNode), typeParameters, minTypeArgumentCount, node)); + return createTypeReference(type, typeArguments); } if (node.typeArguments) { error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); @@ -29015,7 +31362,11 @@ var ts; var links = getSymbolLinks(symbol); var typeParameters = links.typeParameters; var id = getTypeListId(typeArguments); - return links.instantiations[id] || (links.instantiations[id] = instantiateTypeNoAlias(type, createTypeMapper(typeParameters, typeArguments))); + var instantiation = links.instantiations.get(id); + if (!instantiation) { + links.instantiations.set(id, instantiation = instantiateTypeNoAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters))))); + } + return instantiation; } // Get type from reference to type alias. When a type alias is generic, the declared type of the type alias may include // references to the type parameters of the alias. We replace those with the actual type arguments by instantiating the @@ -29024,8 +31375,12 @@ var ts; var type = getDeclaredTypeOfSymbol(symbol); var typeParameters = getSymbolLinks(symbol).typeParameters; if (typeParameters) { - if (!node.typeArguments || node.typeArguments.length !== typeParameters.length) { - error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, symbolToString(symbol), typeParameters.length); + var numTypeArguments = ts.length(node.typeArguments); + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + if (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length) { + error(node, minTypeArgumentCount === typeParameters.length + ? ts.Diagnostics.Generic_type_0_requires_1_type_argument_s + : ts.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments, symbolToString(symbol), minTypeArgumentCount, typeParameters.length); return unknownType; } var typeArguments = ts.map(node.typeArguments, getTypeFromTypeNode); @@ -29047,11 +31402,11 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 157 /* TypeReference */: + case 158 /* TypeReference */: return node.typeName; - case 272 /* JSDocTypeReference */: + case 276 /* JSDocTypeReference */: return node.name; - case 199 /* ExpressionWithTypeArguments */: + case 200 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; @@ -29077,7 +31432,7 @@ var ts; if (symbol.flags & 524288 /* TypeAlias */) { return getTypeFromTypeAliasReference(node, symbol); } - if (symbol.flags & 107455 /* Value */ && node.kind === 272 /* JSDocTypeReference */) { + if (symbol.flags & 107455 /* Value */ && node.kind === 276 /* JSDocTypeReference */) { // A JSDocTypeReference may have resolved to a value (as opposed to a type). In // that case, the type of this reference is just the type of the value we resolved // to. @@ -29085,19 +31440,54 @@ var ts; } return getTypeFromNonGenericTypeReference(node, symbol); } + function getPrimitiveTypeFromJSDocTypeReference(node) { + if (ts.isIdentifier(node.name)) { + switch (node.name.text) { + case "String": + return stringType; + case "Number": + return numberType; + case "Boolean": + return booleanType; + case "Void": + return voidType; + case "Undefined": + return undefinedType; + case "Null": + return nullType; + case "Object": + return anyType; + case "Function": + return anyFunctionType; + case "Array": + case "array": + return !node.typeArguments || !node.typeArguments.length ? createArrayType(anyType) : undefined; + case "Promise": + case "promise": + return !node.typeArguments || !node.typeArguments.length ? createPromiseType(anyType) : undefined; + } + } + } + function getTypeFromJSDocNullableTypeNode(node) { + var type = getTypeFromTypeNode(node.type); + return strictNullChecks ? getUnionType([type, nullType]) : type; + } function getTypeFromTypeReference(node) { var links = getNodeLinks(node); if (!links.resolvedType) { var symbol = void 0; var type = void 0; - if (node.kind === 272 /* JSDocTypeReference */) { - var typeReferenceName = getTypeReferenceName(node); - symbol = resolveTypeReferenceName(typeReferenceName); - type = getTypeReferenceType(node, symbol); + if (node.kind === 276 /* JSDocTypeReference */) { + type = getPrimitiveTypeFromJSDocTypeReference(node); + if (!type) { + var typeReferenceName = getTypeReferenceName(node); + symbol = resolveTypeReferenceName(typeReferenceName); + type = getTypeReferenceType(node, symbol); + } } else { // We only support expressions that are simple qualified names. For other expressions this produces undefined. - var typeNameOrExpression = node.kind === 157 /* TypeReference */ + var typeNameOrExpression = node.kind === 158 /* TypeReference */ ? node.typeName : ts.isEntityNameExpression(node.expression) ? node.expression @@ -29129,12 +31519,12 @@ var ts; function getTypeOfGlobalSymbol(symbol, arity) { function getTypeDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { - var declaration = declarations_3[_i]; + for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { + var declaration = declarations_4[_i]; switch (declaration.kind) { - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 229 /* EnumDeclaration */: + case 228 /* ClassDeclaration */: + case 229 /* InterfaceDeclaration */: + case 231 /* EnumDeclaration */: return declaration; } } @@ -29147,24 +31537,68 @@ var ts; error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbol.name); return arity ? emptyGenericType : emptyObjectType; } - if ((type.typeParameters ? type.typeParameters.length : 0) !== arity) { + if (ts.length(type.typeParameters) !== arity) { error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_have_1_type_parameter_s, symbol.name, arity); return arity ? emptyGenericType : emptyObjectType; } return type; } - function getGlobalValueSymbol(name) { - return getGlobalSymbol(name, 107455 /* Value */, ts.Diagnostics.Cannot_find_global_value_0); + function getGlobalValueSymbol(name, reportErrors) { + return getGlobalSymbol(name, 107455 /* Value */, reportErrors ? ts.Diagnostics.Cannot_find_global_value_0 : undefined); } - function getGlobalTypeSymbol(name) { - return getGlobalSymbol(name, 793064 /* Type */, ts.Diagnostics.Cannot_find_global_type_0); + function getGlobalTypeSymbol(name, reportErrors) { + return getGlobalSymbol(name, 793064 /* Type */, reportErrors ? ts.Diagnostics.Cannot_find_global_type_0 : undefined); } function getGlobalSymbol(name, meaning, diagnostic) { return resolveName(undefined, name, meaning, diagnostic, name); } - function getGlobalType(name, arity) { + function getGlobalType(name, arity, reportErrors) { + var symbol = getGlobalTypeSymbol(name, reportErrors); + return symbol || reportErrors ? getTypeOfGlobalSymbol(symbol, arity) : undefined; + } + function getGlobalTypedPropertyDescriptorType() { + return deferredGlobalTypedPropertyDescriptorType || (deferredGlobalTypedPropertyDescriptorType = getGlobalType("TypedPropertyDescriptor", /*arity*/ 1, /*reportErrors*/ true)) || emptyGenericType; + } + function getGlobalTemplateStringsArrayType() { + return deferredGlobalTemplateStringsArrayType || (deferredGlobalTemplateStringsArrayType = getGlobalType("TemplateStringsArray", /*arity*/ 0, /*reportErrors*/ true)) || emptyObjectType; + } + function getGlobalESSymbolConstructorSymbol(reportErrors) { + return deferredGlobalESSymbolConstructorSymbol || (deferredGlobalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol", reportErrors)); + } + function getGlobalESSymbolType(reportErrors) { + return deferredGlobalESSymbolType || (deferredGlobalESSymbolType = getGlobalType("Symbol", /*arity*/ 0, reportErrors)) || emptyObjectType; + } + function getGlobalPromiseType(reportErrors) { + return deferredGlobalPromiseType || (deferredGlobalPromiseType = getGlobalType("Promise", /*arity*/ 1, reportErrors)) || emptyGenericType; + } + function getGlobalPromiseConstructorSymbol(reportErrors) { + return deferredGlobalPromiseConstructorSymbol || (deferredGlobalPromiseConstructorSymbol = getGlobalValueSymbol("Promise", reportErrors)); + } + function getGlobalPromiseConstructorLikeType(reportErrors) { + return deferredGlobalPromiseConstructorLikeType || (deferredGlobalPromiseConstructorLikeType = getGlobalType("PromiseConstructorLike", /*arity*/ 0, reportErrors)) || emptyObjectType; + } + function getGlobalAsyncIterableType(reportErrors) { + return deferredGlobalAsyncIterableType || (deferredGlobalAsyncIterableType = getGlobalType("AsyncIterable", /*arity*/ 1, reportErrors)) || emptyGenericType; + } + function getGlobalAsyncIteratorType(reportErrors) { + return deferredGlobalAsyncIteratorType || (deferredGlobalAsyncIteratorType = getGlobalType("AsyncIterator", /*arity*/ 1, reportErrors)) || emptyGenericType; + } + function getGlobalAsyncIterableIteratorType(reportErrors) { + return deferredGlobalAsyncIterableIteratorType || (deferredGlobalAsyncIterableIteratorType = getGlobalType("AsyncIterableIterator", /*arity*/ 1, reportErrors)) || emptyGenericType; + } + function getGlobalIterableType(reportErrors) { + return deferredGlobalIterableType || (deferredGlobalIterableType = getGlobalType("Iterable", /*arity*/ 1, reportErrors)) || emptyGenericType; + } + function getGlobalIteratorType(reportErrors) { + return deferredGlobalIteratorType || (deferredGlobalIteratorType = getGlobalType("Iterator", /*arity*/ 1, reportErrors)) || emptyGenericType; + } + function getGlobalIterableIteratorType(reportErrors) { + return deferredGlobalIterableIteratorType || (deferredGlobalIterableIteratorType = getGlobalType("IterableIterator", /*arity*/ 1, reportErrors)) || emptyGenericType; + } + function getGlobalTypeOrUndefined(name, arity) { if (arity === void 0) { arity = 0; } - return getTypeOfGlobalSymbol(getGlobalTypeSymbol(name), arity); + var symbol = getGlobalSymbol(name, 793064 /* Type */, /*diagnostic*/ undefined); + return symbol && getTypeOfGlobalSymbol(symbol, arity); } /** * Returns a type that is inside a namespace at the global scope, e.g. @@ -29175,26 +31609,26 @@ var ts; var typeSymbol = namespaceSymbol && getSymbol(namespaceSymbol.exports, name, 793064 /* Type */); return typeSymbol && getDeclaredTypeOfSymbol(typeSymbol); } - /** - * Creates a TypeReference for a generic `TypedPropertyDescriptor`. - */ - function createTypedPropertyDescriptorType(propertyType) { - var globalTypedPropertyDescriptorType = getGlobalTypedPropertyDescriptorType(); - return globalTypedPropertyDescriptorType !== emptyGenericType - ? createTypeReference(globalTypedPropertyDescriptorType, [propertyType]) - : emptyObjectType; - } /** * Instantiates a global type that is generic with some element type, and returns that instantiation. */ function createTypeFromGenericGlobalType(genericGlobalType, typeArguments) { return genericGlobalType !== emptyGenericType ? createTypeReference(genericGlobalType, typeArguments) : emptyObjectType; } - function createIterableType(elementType) { - return createTypeFromGenericGlobalType(getGlobalIterableType(), [elementType]); + function createTypedPropertyDescriptorType(propertyType) { + return createTypeFromGenericGlobalType(getGlobalTypedPropertyDescriptorType(), [propertyType]); } - function createIterableIteratorType(elementType) { - return createTypeFromGenericGlobalType(getGlobalIterableIteratorType(), [elementType]); + function createAsyncIterableType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalAsyncIterableType(/*reportErrors*/ true), [iteratedType]); + } + function createAsyncIterableIteratorType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalAsyncIterableIteratorType(/*reportErrors*/ true), [iteratedType]); + } + function createIterableType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalIterableType(/*reportErrors*/ true), [iteratedType]); + } + function createIterableIteratorType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalIterableIteratorType(/*reportErrors*/ true), [iteratedType]); } function createArrayType(elementType) { return createTypeFromGenericGlobalType(globalArrayType, [elementType]); @@ -29219,7 +31653,7 @@ var ts; for (var i = 0; i < arity; i++) { var typeParameter = createType(16384 /* TypeParameter */); typeParameters.push(typeParameter); - var property = createSymbol(4 /* Property */ | 67108864 /* Transient */, "" + i); + var property = createSymbol(4 /* Property */, "" + i); property.type = typeParameter; properties.push(property); } @@ -29228,7 +31662,7 @@ var ts; type.outerTypeParameters = undefined; type.localTypeParameters = typeParameters; type.instantiations = ts.createMap(); - type.instantiations[getTypeListId(type.typeParameters)] = type; + type.instantiations.set(getTypeListId(type.typeParameters), type); type.target = type; type.typeArguments = type.typeParameters; type.thisType = createType(16384 /* TypeParameter */); @@ -29312,14 +31746,14 @@ var ts; // Add the given types to the given type set. Order is preserved, duplicates are removed, // and nested types of the given kind are flattened into the set. function addTypesToUnion(typeSet, types) { - for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { - var type = types_4[_i]; + for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { + var type = types_6[_i]; addTypeToUnion(typeSet, type); } } function containsIdenticalType(types, type) { - for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { - var t = types_5[_i]; + for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { + var t = types_7[_i]; if (isTypeIdenticalTo(t, type)) { return true; } @@ -29327,8 +31761,9 @@ var ts; return false; } function isSubtypeOfAny(candidate, types) { - for (var i = 0, len = types.length; i < len; i++) { - if (candidate !== types[i] && isTypeSubtypeOf(candidate, types[i])) { + for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { + var type = types_8[_i]; + if (candidate !== type && isTypeSubtypeOf(candidate, type)) { return true; } } @@ -29414,10 +31849,11 @@ var ts; return types[0]; } var id = getTypeListId(types); - var type = unionTypes[id]; + var type = unionTypes.get(id); if (!type) { var propagatedFlags = getPropagatingFlagsOfTypes(types, /*excludeKinds*/ 6144 /* Nullable */); - type = unionTypes[id] = createType(65536 /* Union */ | propagatedFlags); + type = createType(65536 /* Union */ | propagatedFlags); + unionTypes.set(id, type); type.types = types; type.aliasSymbol = aliasSymbol; type.aliasTypeArguments = aliasTypeArguments; @@ -29438,15 +31874,27 @@ var ts; else if (type.flags & 1 /* Any */) { typeSet.containsAny = true; } + else if (getObjectFlags(type) & 16 /* Anonymous */ && isEmptyObjectType(type)) { + typeSet.containsEmptyObject = true; + } else if (!(type.flags & 8192 /* Never */) && (strictNullChecks || !(type.flags & 6144 /* Nullable */)) && !ts.contains(typeSet, type)) { - typeSet.push(type); + if (type.flags & 32768 /* Object */) { + typeSet.containsObjectType = true; + } + if (type.flags & 65536 /* Union */ && typeSet.unionIndex === undefined) { + typeSet.unionIndex = typeSet.length; + } + if (!(type.flags & 32768 /* Object */ && type.objectFlags & 16 /* Anonymous */ && + type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */) && containsIdenticalType(typeSet, type))) { + typeSet.push(type); + } } } // Add the given types to the given type set. Order is preserved, duplicates are removed, // and nested types of the given kind are flattened into the set. function addTypesToIntersection(typeSet, types) { - for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { - var type = types_6[_i]; + for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { + var type = types_9[_i]; addTypeToIntersection(typeSet, type); } } @@ -29464,31 +31912,31 @@ var ts; if (types.length === 0) { return emptyObjectType; } - var _loop_2 = function (i) { - var type_1 = types[i]; - if (type_1.flags & 65536 /* Union */) { - return { value: getUnionType(ts.map(type_1.types, function (t) { return getIntersectionType(ts.replaceElement(types, i, t)); }), - /*subtypeReduction*/ false, aliasSymbol, aliasTypeArguments) }; - } - }; - for (var i = 0; i < types.length; i++) { - var state_2 = _loop_2(i); - if (typeof state_2 === "object") - return state_2.value; - } var typeSet = []; addTypesToIntersection(typeSet, types); if (typeSet.containsAny) { return anyType; } + if (typeSet.containsEmptyObject && !typeSet.containsObjectType) { + typeSet.push(emptyObjectType); + } if (typeSet.length === 1) { return typeSet[0]; } + var unionIndex = typeSet.unionIndex; + if (unionIndex !== undefined) { + // We are attempting to construct a type of the form X & (A | B) & Y. Transform this into a type of + // the form X & A & Y | X & B & Y and recursively reduce until no union type constituents remain. + var unionType = typeSet[unionIndex]; + return getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex, t)); }), + /*subtypeReduction*/ false, aliasSymbol, aliasTypeArguments); + } var id = getTypeListId(typeSet); - var type = intersectionTypes[id]; + var type = intersectionTypes.get(id); if (!type) { var propagatedFlags = getPropagatingFlagsOfTypes(typeSet, /*excludeKinds*/ 6144 /* Nullable */); - type = intersectionTypes[id] = createType(131072 /* Intersection */ | propagatedFlags); + type = createType(131072 /* Intersection */ | propagatedFlags); + intersectionTypes.set(id, type); type.types = typeSet; type.aliasSymbol = aliasSymbol; type.aliasTypeArguments = aliasTypeArguments; @@ -29502,7 +31950,7 @@ var ts; } return links.resolvedType; } - function getIndexTypeForTypeParameter(type) { + function getIndexTypeForGenericType(type) { if (!type.resolvedIndexType) { type.resolvedIndexType = createType(262144 /* Index */); type.resolvedIndexType.type = type; @@ -29518,7 +31966,7 @@ var ts; return getUnionType(ts.map(getPropertiesOfType(type), getLiteralTypeFromPropertyName)); } function getIndexType(type) { - return type.flags & 16384 /* TypeParameter */ ? getIndexTypeForTypeParameter(type) : + return maybeTypeOfKind(type, 540672 /* TypeVariable */) ? getIndexTypeForGenericType(type) : getObjectFlags(type) & 32 /* Mapped */ ? getConstraintTypeFromMappedType(type) : type.flags & 1 /* Any */ || getIndexInfoOfType(type, 0 /* String */) ? stringType : getLiteralTypeFromPropertyNames(type); @@ -29541,7 +31989,7 @@ var ts; return type; } function getPropertyTypeForIndexType(objectType, indexType, accessNode, cacheSymbol) { - var accessExpression = accessNode && accessNode.kind === 178 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 179 /* ElementAccessExpression */ ? accessNode : undefined; var propName = indexType.flags & (32 /* StringLiteral */ | 64 /* NumberLiteral */ | 256 /* EnumLiteral */) ? indexType.text : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? @@ -29570,14 +32018,14 @@ var ts; getIndexInfoOfType(objectType, 0 /* String */) || undefined; if (indexInfo) { - if (accessExpression && ts.isAssignmentTarget(accessExpression) && indexInfo.isReadonly) { + if (accessExpression && indexInfo.isReadonly && (ts.isAssignmentTarget(accessExpression) || ts.isDeleteTarget(accessExpression))) { error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); return unknownType; } return indexInfo.type; } if (accessExpression && !isConstEnumObjectType(objectType)) { - if (compilerOptions.noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors) { + if (noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors) { if (getIndexTypeOfType(objectType, 1 /* Number */)) { error(accessExpression.argumentExpression, ts.Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number); } @@ -29589,7 +32037,7 @@ var ts; } } if (accessNode) { - var indexNode = accessNode.kind === 178 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.indexType; + var indexNode = accessNode.kind === 179 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.indexType; if (indexType.flags & (32 /* StringLiteral */ | 64 /* NumberLiteral */)) { error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, indexType.text, typeToString(objectType)); } @@ -29599,32 +32047,32 @@ var ts; else { error(indexNode, ts.Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType)); } + return unknownType; } - return unknownType; + return anyType; } function getIndexedAccessForMappedType(type, indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 178 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 179 /* ElementAccessExpression */ ? accessNode : undefined; if (accessExpression && ts.isAssignmentTarget(accessExpression) && type.declaration.readonlyToken) { error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(type)); return unknownType; } - var mapper = createUnaryTypeMapper(getTypeParameterFromMappedType(type), indexType); + var mapper = createTypeMapper([getTypeParameterFromMappedType(type)], [indexType]); var templateMapper = type.mapper ? combineTypeMappers(type.mapper, mapper) : mapper; - return addOptionality(instantiateType(getTemplateTypeFromMappedType(type), templateMapper), !!type.declaration.questionToken); + return instantiateType(getTemplateTypeFromMappedType(type), templateMapper); } function getIndexedAccessType(objectType, indexType, accessNode) { - if (indexType.flags & 16384 /* TypeParameter */ || - objectType.flags & 16384 /* TypeParameter */ && indexType.flags & 262144 /* Index */ || + // If the index type is generic, if the object type is generic and doesn't originate in an expression, + // or if the object type is a mapped type with a generic constraint, we are performing a higher-order + // index access where we cannot meaningfully access the properties of the object type. Note that for a + // generic T and a non-generic K, we eagerly resolve T[K] if it originates in an expression. This is to + // preserve backwards compatibility. For example, an element access 'this["foo"]' has always been resolved + // eagerly using the constraint type of 'this' at the given location. + if (maybeTypeOfKind(indexType, 540672 /* TypeVariable */ | 262144 /* Index */) || + maybeTypeOfKind(objectType, 540672 /* TypeVariable */) && !(accessNode && accessNode.kind === 179 /* ElementAccessExpression */) || isGenericMappedType(objectType)) { - // If either the object type or the index type are type parameters, or if the object type is a mapped - // type with a generic constraint, we are performing a higher-order index access where we cannot - // meaningfully access the properties of the object type. In those cases, we first check that the - // index type is assignable to 'keyof T' for the object type. - if (accessNode) { - if (!isTypeAssignableTo(indexType, getIndexType(objectType))) { - error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); - return unknownType; - } + if (objectType.flags & 1 /* Any */) { + return objectType; } // If the object type is a mapped type { [P in K]: E }, we instantiate E using a mapper that substitutes // the index type for P. For example, for an index access { [P in K]: Box }[X], we construct the @@ -29634,8 +32082,13 @@ var ts; } // Otherwise we defer the operation by creating an indexed access type. var id = objectType.id + "," + indexType.id; - return indexedAccessTypes[id] || (indexedAccessTypes[id] = createIndexedAccessType(objectType, indexType)); + var type = indexedAccessTypes.get(id); + if (!type) { + indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType)); + } + return type; } + // In the following we resolve T[K] to the type of the property in T selected by K. var apparentObjectType = getApparentType(objectType); if (indexType.flags & 65536 /* Union */ && !(indexType.flags & 8190 /* Primitive */)) { var propTypes = []; @@ -29677,7 +32130,7 @@ var ts; if (!links.resolvedType) { // Deferred resolution of members is handled by resolveObjectTypeMembers var aliasSymbol = getAliasSymbolForTypeNode(node); - if (ts.isEmpty(node.symbol.members) && !aliasSymbol) { + if (node.symbol.members.size === 0 && !aliasSymbol) { links.resolvedType = emptyTypeLiteralType; } else { @@ -29690,7 +32143,7 @@ var ts; return links.resolvedType; } function getAliasSymbolForTypeNode(node) { - return node.parent.kind === 228 /* TypeAliasDeclaration */ ? getSymbolOfNode(node.parent) : undefined; + return node.parent.kind === 230 /* TypeAliasDeclaration */ ? getSymbolOfNode(node.parent) : undefined; } function getAliasTypeArgumentsForTypeNode(node) { var symbol = getAliasSymbolForTypeNode(node); @@ -29701,11 +32154,27 @@ var ts; * this function should be called in a left folding style, with left = previous result of getSpreadType * and right = the new element to be spread. */ - function getSpreadType(left, right, isFromObjectLiteral) { - ts.Debug.assert(!!(left.flags & (32768 /* Object */ | 1 /* Any */)) && !!(right.flags & (32768 /* Object */ | 1 /* Any */)), "Only object types may be spread."); + function getSpreadType(left, right) { if (left.flags & 1 /* Any */ || right.flags & 1 /* Any */) { return anyType; } + left = filterType(left, function (t) { return !(t.flags & 6144 /* Nullable */); }); + if (left.flags & 8192 /* Never */) { + return right; + } + right = filterType(right, function (t) { return !(t.flags & 6144 /* Nullable */); }); + if (right.flags & 8192 /* Never */) { + return left; + } + if (left.flags & 65536 /* Union */) { + return mapType(left, function (t) { return getSpreadType(t, right); }); + } + if (right.flags & 65536 /* Union */) { + return mapType(right, function (t) { return getSpreadType(left, t); }); + } + if (right.flags & 16777216 /* NonPrimitive */) { + return emptyObjectType; + } var members = ts.createMap(); var skippedPrivateMembers = ts.createMap(); var stringIndexInfo; @@ -29722,42 +32191,55 @@ var ts; for (var _i = 0, _a = getPropertiesOfType(right); _i < _a.length; _i++) { var rightProp = _a[_i]; // we approximate own properties as non-methods plus methods that are inside the object literal - var isOwnProperty = !(rightProp.flags & 8192 /* Method */) || isFromObjectLiteral; var isSetterWithoutGetter = rightProp.flags & 65536 /* SetAccessor */ && !(rightProp.flags & 32768 /* GetAccessor */); if (getDeclarationModifierFlagsFromSymbol(rightProp) & (8 /* Private */ | 16 /* Protected */)) { - skippedPrivateMembers[rightProp.name] = true; + skippedPrivateMembers.set(rightProp.name, true); } - else if (isOwnProperty && !isSetterWithoutGetter) { - members[rightProp.name] = rightProp; + else if (!isClassMethod(rightProp) && !isSetterWithoutGetter) { + members.set(rightProp.name, getNonReadonlySymbol(rightProp)); } } for (var _b = 0, _c = getPropertiesOfType(left); _b < _c.length; _b++) { var leftProp = _c[_b]; if (leftProp.flags & 65536 /* SetAccessor */ && !(leftProp.flags & 32768 /* GetAccessor */) - || leftProp.name in skippedPrivateMembers) { + || skippedPrivateMembers.has(leftProp.name) + || isClassMethod(leftProp)) { continue; } - if (leftProp.name in members) { - var rightProp = members[leftProp.name]; + if (members.has(leftProp.name)) { + var rightProp = members.get(leftProp.name); var rightType = getTypeOfSymbol(rightProp); - if (maybeTypeOfKind(rightType, 2048 /* Undefined */) || rightProp.flags & 536870912 /* Optional */) { + if (maybeTypeOfKind(rightType, 2048 /* Undefined */) || rightProp.flags & 67108864 /* Optional */) { var declarations = ts.concatenate(leftProp.declarations, rightProp.declarations); - var flags = 4 /* Property */ | 67108864 /* Transient */ | (leftProp.flags & 536870912 /* Optional */); + var flags = 4 /* Property */ | (leftProp.flags & 67108864 /* Optional */); var result = createSymbol(flags, leftProp.name); result.type = getUnionType([getTypeOfSymbol(leftProp), getTypeWithFacts(rightType, 131072 /* NEUndefined */)]); result.leftSpread = leftProp; result.rightSpread = rightProp; result.declarations = declarations; - result.isReadonly = isReadonlySymbol(leftProp) || isReadonlySymbol(rightProp); - members[leftProp.name] = result; + members.set(leftProp.name, result); } } else { - members[leftProp.name] = leftProp; + members.set(leftProp.name, getNonReadonlySymbol(leftProp)); } } return createAnonymousType(undefined, members, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo); } + function getNonReadonlySymbol(prop) { + if (!isReadonlySymbol(prop)) { + return prop; + } + var flags = 4 /* Property */ | (prop.flags & 67108864 /* Optional */); + var result = createSymbol(flags, prop.name); + result.type = getTypeOfSymbol(prop); + result.declarations = prop.declarations; + result.syntheticOrigin = prop; + return result; + } + function isClassMethod(prop) { + return prop.flags & 8192 /* Method */ && ts.find(prop.declarations, function (decl) { return ts.isClassLike(decl.parent); }); + } function createLiteralType(flags, text) { var type = createType(flags); type.text = text; @@ -29779,7 +32261,11 @@ var ts; } function getLiteralTypeForText(flags, text) { var map = flags & 32 /* StringLiteral */ ? stringLiteralTypes : numericLiteralTypes; - return map[text] || (map[text] = createLiteralType(flags, text)); + var type = map.get(text); + if (!type) { + map.set(text, type = createLiteralType(flags, text)); + } + return type; } function getTypeFromLiteralTypeNode(node) { var links = getNodeLinks(node); @@ -29807,9 +32293,9 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 227 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 229 /* InterfaceDeclaration */)) { if (!(ts.getModifierFlags(container) & 32 /* Static */) && - (container.kind !== 150 /* Constructor */ || ts.isNodeDescendantOf(node, container.body))) { + (container.kind !== 151 /* Constructor */ || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } } @@ -29826,87 +32312,84 @@ var ts; function getTypeFromTypeNode(node) { switch (node.kind) { case 118 /* AnyKeyword */: - case 263 /* JSDocAllType */: - case 264 /* JSDocUnknownType */: + case 267 /* JSDocAllType */: + case 268 /* JSDocUnknownType */: return anyType; - case 134 /* StringKeyword */: + case 135 /* StringKeyword */: return stringType; case 132 /* NumberKeyword */: return numberType; case 121 /* BooleanKeyword */: return booleanType; - case 135 /* SymbolKeyword */: + case 136 /* SymbolKeyword */: return esSymbolType; case 104 /* VoidKeyword */: return voidType; - case 137 /* UndefinedKeyword */: + case 138 /* UndefinedKeyword */: return undefinedType; case 94 /* NullKeyword */: return nullType; case 129 /* NeverKeyword */: return neverType; - case 289 /* JSDocNullKeyword */: - return nullType; - case 290 /* JSDocUndefinedKeyword */: - return undefinedType; - case 291 /* JSDocNeverKeyword */: - return neverType; - case 167 /* ThisType */: + case 133 /* ObjectKeyword */: + return nonPrimitiveType; + case 168 /* ThisType */: case 98 /* ThisKeyword */: return getTypeFromThisTypeNode(node); - case 171 /* LiteralType */: + case 172 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 288 /* JSDocLiteralType */: + case 292 /* JSDocLiteralType */: return getTypeFromLiteralTypeNode(node.literal); - case 157 /* TypeReference */: - case 272 /* JSDocTypeReference */: + case 158 /* TypeReference */: + case 276 /* JSDocTypeReference */: return getTypeFromTypeReference(node); - case 156 /* TypePredicate */: + case 157 /* TypePredicate */: return booleanType; - case 199 /* ExpressionWithTypeArguments */: + case 200 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 160 /* TypeQuery */: + case 161 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 162 /* ArrayType */: - case 265 /* JSDocArrayType */: + case 163 /* ArrayType */: + case 269 /* JSDocArrayType */: return getTypeFromArrayTypeNode(node); - case 163 /* TupleType */: + case 164 /* TupleType */: return getTypeFromTupleTypeNode(node); - case 164 /* UnionType */: - case 266 /* JSDocUnionType */: + case 165 /* UnionType */: + case 270 /* JSDocUnionType */: return getTypeFromUnionTypeNode(node); - case 165 /* IntersectionType */: + case 166 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 166 /* ParenthesizedType */: - case 268 /* JSDocNullableType */: - case 269 /* JSDocNonNullableType */: - case 276 /* JSDocConstructorType */: - case 277 /* JSDocThisType */: - case 273 /* JSDocOptionalType */: + case 272 /* JSDocNullableType */: + return getTypeFromJSDocNullableTypeNode(node); + case 167 /* ParenthesizedType */: + case 273 /* JSDocNonNullableType */: + case 280 /* JSDocConstructorType */: + case 281 /* JSDocThisType */: + case 277 /* JSDocOptionalType */: return getTypeFromTypeNode(node.type); - case 270 /* JSDocRecordType */: + case 274 /* JSDocRecordType */: return getTypeFromTypeNode(node.literal); - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 161 /* TypeLiteral */: - case 287 /* JSDocTypeLiteral */: - case 274 /* JSDocFunctionType */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: + case 162 /* TypeLiteral */: + case 291 /* JSDocTypeLiteral */: + case 278 /* JSDocFunctionType */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 168 /* TypeOperator */: + case 169 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 169 /* IndexedAccessType */: + case 170 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 170 /* MappedType */: + case 171 /* MappedType */: return getTypeFromMappedTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode case 70 /* Identifier */: - case 141 /* QualifiedName */: + case 142 /* QualifiedName */: var symbol = getSymbolAtLocation(node); return symbol && getDeclaredTypeOfSymbol(symbol); - case 267 /* JSDocTupleType */: + case 271 /* JSDocTupleType */: return getTypeFromJSDocTupleType(node); - case 275 /* JSDocVariadicType */: + case 279 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); default: return unknownType; @@ -29933,13 +32416,13 @@ var ts; var instantiations = mapper.instantiations || (mapper.instantiations = []); return instantiations[type.id] || (instantiations[type.id] = instantiator(type, mapper)); } - function createUnaryTypeMapper(source, target) { + function makeUnaryTypeMapper(source, target) { return function (t) { return t === source ? target : t; }; } - function createBinaryTypeMapper(source1, target1, source2, target2) { + function makeBinaryTypeMapper(source1, target1, source2, target2) { return function (t) { return t === source1 ? target1 : t === source2 ? target2 : t; }; } - function createArrayTypeMapper(sources, targets) { + function makeArrayTypeMapper(sources, targets) { return function (t) { for (var i = 0; i < sources.length; i++) { if (t === sources[i]) { @@ -29950,15 +32433,23 @@ var ts; }; } function createTypeMapper(sources, targets) { - var count = sources.length; - var mapper = count == 1 ? createUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : - count == 2 ? createBinaryTypeMapper(sources[0], targets ? targets[0] : anyType, sources[1], targets ? targets[1] : anyType) : - createArrayTypeMapper(sources, targets); + var mapper = sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : + sources.length === 2 ? makeBinaryTypeMapper(sources[0], targets ? targets[0] : anyType, sources[1], targets ? targets[1] : anyType) : + makeArrayTypeMapper(sources, targets); mapper.mappedTypes = sources; return mapper; } function createTypeEraser(sources) { - return createTypeMapper(sources, undefined); + return createTypeMapper(sources, /*targets*/ undefined); + } + /** + * Maps forward-references to later types parameters to the empty object type. + * This is used during inference when instantiating type parameter defaults. + */ + function createBackreferenceMapper(typeParameters, index) { + var mapper = function (t) { return ts.indexOf(typeParameters, t) >= index ? emptyObjectType : t; }; + mapper.mappedTypes = typeParameters; + return mapper; } function getInferenceMapper(context) { if (!context.mapper) { @@ -29983,7 +32474,12 @@ var ts; } function combineTypeMappers(mapper1, mapper2) { var mapper = function (t) { return instantiateType(mapper1(t), mapper2); }; - mapper.mappedTypes = mapper1.mappedTypes; + mapper.mappedTypes = ts.concatenate(mapper1.mappedTypes, mapper2.mappedTypes); + return mapper; + } + function createReplacementMapper(source, target, baseMapper) { + var mapper = function (t) { return t === source ? target : baseMapper(t); }; + mapper.mappedTypes = baseMapper.mappedTypes; return mapper; } function cloneTypeParameter(typeParameter) { @@ -30031,7 +32527,7 @@ var ts; return result; } function instantiateSymbol(symbol, mapper) { - if (symbol.flags & 16777216 /* Instantiated */) { + if (getCheckFlags(symbol) & 1 /* Instantiated */) { var links = getSymbolLinks(symbol); // If symbol being instantiated is itself a instantiation, fetch the original target and combine the // type mappers. This ensures that original type identities are properly preserved and that aliases @@ -30041,7 +32537,8 @@ var ts; } // Keep the flags from the symbol we're instantiating. Mark that is instantiated, and // also transient so that we can just store data on it directly. - var result = createSymbol(16777216 /* Instantiated */ | 67108864 /* Transient */ | symbol.flags, symbol.name); + var result = createSymbol(symbol.flags, symbol.name); + result.checkFlags = 1 /* Instantiated */; result.declarations = symbol.declarations; result.parent = symbol.parent; result.target = symbol; @@ -30060,25 +32557,24 @@ var ts; return result; } function instantiateMappedType(type, mapper) { - // Check if we have an isomorphic mapped type, i.e. a type of the form { [P in keyof T]: X } for some - // type parameter T. If so, the mapped type is distributive over a union type and when T is instantiated + // Check if we have a homomorphic mapped type, i.e. a type of the form { [P in keyof T]: X } for some + // type variable T. If so, the mapped type is distributive over a union type and when T is instantiated // to a union type A | B, we produce { [P in keyof A]: X } | { [P in keyof B]: X }. Furthermore, for - // isomorphic mapped types we leave primitive types alone. For example, when T is instantiated to a + // homomorphic mapped types we leave primitive types alone. For example, when T is instantiated to a // union type A | undefined, we produce { [P in keyof A]: X } | undefined. var constraintType = getConstraintTypeFromMappedType(type); if (constraintType.flags & 262144 /* Index */) { - var typeParameter_1 = constraintType.type; - var mappedTypeParameter = mapper(typeParameter_1); - if (typeParameter_1 !== mappedTypeParameter) { - return mapType(mappedTypeParameter, function (t) { - if (isMappableType(t)) { - var replacementMapper = createUnaryTypeMapper(typeParameter_1, t); - var combinedMapper = mapper.mappedTypes && mapper.mappedTypes.length === 1 ? replacementMapper : combineTypeMappers(replacementMapper, mapper); - combinedMapper.mappedTypes = mapper.mappedTypes; - return instantiateMappedObjectType(type, combinedMapper); - } - return t; - }); + var typeVariable_1 = constraintType.type; + if (typeVariable_1.flags & 16384 /* TypeParameter */) { + var mappedTypeVariable = instantiateType(typeVariable_1, mapper); + if (typeVariable_1 !== mappedTypeVariable) { + return mapType(mappedTypeVariable, function (t) { + if (isMappableType(t)) { + return instantiateMappedObjectType(type, createReplacementMapper(typeVariable_1, t, mapper)); + } + return t; + }); + } } } return instantiateMappedObjectType(type, mapper); @@ -30102,26 +32598,28 @@ var ts; // Starting with the parent of the symbol's declaration, check if the mapper maps any of // the type parameters introduced by enclosing declarations. We just pick the first // declaration since multiple declarations will all have the same parent anyway. - var node = symbol.declarations[0].parent; - while (node) { + return !!ts.findAncestor(symbol.declarations[0], function (node) { + if (node.kind === 232 /* ModuleDeclaration */ || node.kind === 264 /* SourceFile */) { + return "quit"; + } switch (node.kind) { - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 225 /* FunctionDeclaration */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: + case 227 /* FunctionDeclaration */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 229 /* InterfaceDeclaration */: + case 230 /* TypeAliasDeclaration */: var declaration = node; if (declaration.typeParameters) { for (var _i = 0, _a = declaration.typeParameters; _i < _a.length; _i++) { @@ -30131,25 +32629,34 @@ var ts; } } } - if (ts.isClassLike(node) || node.kind === 227 /* InterfaceDeclaration */) { + if (ts.isClassLike(node) || node.kind === 229 /* InterfaceDeclaration */) { var thisType = getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; if (thisType && ts.contains(mappedTypes, thisType)) { return true; } } break; - case 230 /* ModuleDeclaration */: - case 261 /* SourceFile */: - return false; + case 171 /* MappedType */: + if (ts.contains(mappedTypes, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter)))) { + return true; + } + break; + case 278 /* JSDocFunctionType */: + var func = node; + for (var _b = 0, _c = func.parameters; _b < _c.length; _b++) { + var p = _c[_b]; + if (ts.contains(mappedTypes, getTypeOfNode(p))) { + return true; + } + } + break; } - node = node.parent; - } - return false; + }); } function isTopLevelTypeAlias(symbol) { if (symbol.declarations && symbol.declarations.length) { var parentKind = symbol.declarations[0].parent.kind; - return parentKind === 261 /* SourceFile */ || parentKind === 231 /* ModuleBlock */; + return parentKind === 264 /* SourceFile */ || parentKind === 233 /* ModuleBlock */; } return false; } @@ -30226,28 +32733,36 @@ var ts; // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 149 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 150 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: return isContextSensitiveFunctionLikeDeclaration(node); - case 176 /* ObjectLiteralExpression */: + case 177 /* ObjectLiteralExpression */: return ts.forEach(node.properties, isContextSensitive); - case 175 /* ArrayLiteralExpression */: + case 176 /* ArrayLiteralExpression */: return ts.forEach(node.elements, isContextSensitive); - case 193 /* ConditionalExpression */: + case 194 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return node.operatorToken.kind === 53 /* BarBarToken */ && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 257 /* PropertyAssignment */: + case 260 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: return isContextSensitiveFunctionLikeDeclaration(node); - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return isContextSensitive(node.expression); + case 253 /* JsxAttributes */: + return ts.forEach(node.properties, isContextSensitive); + case 252 /* JsxAttribute */: + // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive. + return node.initializer && isContextSensitive(node.initializer); + case 255 /* JsxExpression */: + // It is possible to that node.expression is undefined (e.g
) + return node.expression && isContextSensitive(node.expression); } return false; } @@ -30261,7 +32776,7 @@ var ts; return true; } // For arrow functions we now know we're not context sensitive. - if (node.kind === 185 /* ArrowFunction */) { + if (node.kind === 186 /* ArrowFunction */) { return false; } // If the first parameter is not an explicit 'this' parameter, then the function has @@ -30283,9 +32798,12 @@ var ts; result.properties = resolved.properties; result.callSignatures = emptyArray; result.constructSignatures = emptyArray; - type = result; + return result; } } + else if (type.flags & 131072 /* Intersection */) { + return getIntersectionType(ts.map(type.types, getTypeWithoutSignatures)); + } return type; } // TYPE CHECKING @@ -30308,7 +32826,7 @@ var ts; // subtype of T but not structurally identical to T. This specifically means that two distinct but // structurally identical types (such as two classes) are not considered instances of each other. function isTypeInstanceOf(source, target) { - return source === target || isTypeSubtypeOf(source, target) && !isTypeIdenticalTo(source, target); + return getTargetType(source) === getTargetType(target) || isTypeSubtypeOf(source, target) && !isTypeIdenticalTo(source, target); } /** * This is *not* a bi-directional relationship. @@ -30334,12 +32852,13 @@ var ts; return checkTypeRelatedTo(source, target, comparableRelation, errorNode, headMessage, containingMessageChain); } function isSignatureAssignableTo(source, target, ignoreReturnTypes) { - return compareSignaturesRelated(source, target, ignoreReturnTypes, /*reportErrors*/ false, /*errorReporter*/ undefined, compareTypesAssignable) !== 0 /* False */; + return compareSignaturesRelated(source, target, /*checkAsCallback*/ false, ignoreReturnTypes, /*reportErrors*/ false, + /*errorReporter*/ undefined, compareTypesAssignable) !== 0 /* False */; } /** * See signatureRelatedTo, compareSignaturesIdentical */ - function compareSignaturesRelated(source, target, ignoreReturnTypes, reportErrors, errorReporter, compareTypes) { + function compareSignaturesRelated(source, target, checkAsCallback, ignoreReturnTypes, reportErrors, errorReporter, compareTypes) { // TODO (drosen): De-duplicate code between related functions. if (source === target) { return -1 /* True */; @@ -30374,9 +32893,23 @@ var ts; var sourceParams = source.parameters; var targetParams = target.parameters; for (var i = 0; i < checkCount; i++) { - var s = i < sourceMax ? getTypeOfParameter(sourceParams[i]) : getRestTypeOfSignature(source); - var t = i < targetMax ? getTypeOfParameter(targetParams[i]) : getRestTypeOfSignature(target); - var related = compareTypes(s, t, /*reportErrors*/ false) || compareTypes(t, s, reportErrors); + var sourceType = i < sourceMax ? getTypeOfParameter(sourceParams[i]) : getRestTypeOfSignature(source); + var targetType = i < targetMax ? getTypeOfParameter(targetParams[i]) : getRestTypeOfSignature(target); + var sourceSig = getSingleCallSignature(getNonNullableType(sourceType)); + var targetSig = getSingleCallSignature(getNonNullableType(targetType)); + // In order to ensure that any generic type Foo is at least co-variant with respect to T no matter + // how Foo uses T, we need to relate parameters bi-variantly (given that parameters are input positions, + // they naturally relate only contra-variantly). However, if the source and target parameters both have + // function types with a single call signature, we known we are relating two callback parameters. In + // that case it is sufficient to only relate the parameters of the signatures co-variantly because, + // similar to return values, callback parameters are output positions. This means that a Promise, + // where T is used only in callback parameter positions, will be co-variant (as opposed to bi-variant) + // with respect to T. + var callbacks = sourceSig && targetSig && !sourceSig.typePredicate && !targetSig.typePredicate && + (getFalsyFlags(sourceType) & 6144 /* Nullable */) === (getFalsyFlags(targetType) & 6144 /* Nullable */); + var related = callbacks ? + compareSignaturesRelated(targetSig, sourceSig, /*checkAsCallback*/ true, /*ignoreReturnTypes*/ false, reportErrors, errorReporter, compareTypes) : + !checkAsCallback && compareTypes(sourceType, targetType, /*reportErrors*/ false) || compareTypes(targetType, sourceType, reportErrors); if (!related) { if (reportErrors) { errorReporter(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, sourceParams[i < sourceMax ? i : sourceMax].name, targetParams[i < targetMax ? i : targetMax].name); @@ -30404,7 +32937,11 @@ var ts; } } else { - result &= compareTypes(sourceReturnType, targetReturnType, reportErrors); + // When relating callback signatures, we still need to relate return types bi-variantly as otherwise + // the containing type wouldn't be co-variant. For example, interface Foo { add(cb: () => T): void } + // wouldn't be co-variant for T without this rule. + result &= checkAsCallback && compareTypes(targetReturnType, sourceReturnType, /*reportErrors*/ false) || + compareTypes(sourceReturnType, targetReturnType, reportErrors); } } return result; @@ -30471,18 +33008,33 @@ var ts; sourceNonRestParamCount; } } + function isEmptyResolvedType(t) { + return t.properties.length === 0 && + t.callSignatures.length === 0 && + t.constructSignatures.length === 0 && + !t.stringIndexInfo && + !t.numberIndexInfo; + } + function isEmptyObjectType(type) { + return type.flags & 32768 /* Object */ ? isEmptyResolvedType(resolveStructuredTypeMembers(type)) : + type.flags & 65536 /* Union */ ? ts.forEach(type.types, isEmptyObjectType) : + type.flags & 131072 /* Intersection */ ? !ts.forEach(type.types, function (t) { return !isEmptyObjectType(t); }) : + false; + } function isEnumTypeRelatedTo(source, target, errorReporter) { if (source === target) { return true; } var id = source.id + "," + target.id; - if (enumRelation[id] !== undefined) { - return enumRelation[id]; + var relation = enumRelation.get(id); + if (relation !== undefined) { + return relation; } if (source.symbol.name !== target.symbol.name || !(source.symbol.flags & 256 /* RegularEnum */) || !(target.symbol.flags & 256 /* RegularEnum */) || (source.flags & 65536 /* Union */) !== (target.flags & 65536 /* Union */)) { - return enumRelation[id] = false; + enumRelation.set(id, false); + return false; } var targetEnumType = getTypeOfSymbol(target.symbol); for (var _i = 0, _a = getPropertiesOfType(getTypeOfSymbol(source.symbol)); _i < _a.length; _i++) { @@ -30493,11 +33045,13 @@ var ts; if (errorReporter) { errorReporter(ts.Diagnostics.Property_0_is_missing_in_type_1, property.name, typeToString(target, /*enclosingDeclaration*/ undefined, 128 /* UseFullyQualifiedType */)); } - return enumRelation[id] = false; + enumRelation.set(id, false); + return false; } } } - return enumRelation[id] = true; + enumRelation.set(id, true); + return true; } function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { if (target.flags & 8192 /* Never */) @@ -30518,6 +33072,8 @@ var ts; return true; if (source.flags & 4096 /* Null */ && (!strictNullChecks || target.flags & 4096 /* Null */)) return true; + if (source.flags & 32768 /* Object */ && target.flags & 16777216 /* NonPrimitive */) + return true; if (relation === assignableRelation || relation === comparableRelation) { if (source.flags & 1 /* Any */) return true; @@ -30549,13 +33105,13 @@ var ts; } if (source.flags & 32768 /* Object */ && target.flags & 32768 /* Object */) { var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; - var related = relation[id]; + var related = relation.get(id); if (related !== undefined) { return related === 1 /* Succeeded */; } } - if (source.flags & 507904 /* StructuredOrTypeParameter */ || target.flags & 507904 /* StructuredOrTypeParameter */) { - return checkTypeRelatedTo(source, target, relation, undefined, undefined, undefined); + if (source.flags & 1032192 /* StructuredOrTypeVariable */ || target.flags & 1032192 /* StructuredOrTypeVariable */) { + return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined); } return false; } @@ -30619,14 +33175,35 @@ var ts; if ((globalStringType === source && stringType === target) || (globalNumberType === source && numberType === target) || (globalBooleanType === source && booleanType === target) || - (getGlobalESSymbolType() === source && esSymbolType === target)) { + (getGlobalESSymbolType(/*reportErrors*/ false) === source && esSymbolType === target)) { reportError(ts.Diagnostics._0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible, targetType, sourceType); } } - // Compare two types and return - // Ternary.True if they are related with no assumptions, - // Ternary.Maybe if they are related with assumptions of other relationships, or - // Ternary.False if they are not related. + function isUnionOrIntersectionTypeWithoutNullableConstituents(type) { + if (!(type.flags & 196608 /* UnionOrIntersection */)) { + return false; + } + // at this point we know that this is union or intersection type possibly with nullable constituents. + // check if we still will have compound type if we ignore nullable components. + var seenNonNullable = false; + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (t.flags & 6144 /* Nullable */) { + continue; + } + if (seenNonNullable) { + return true; + } + seenNonNullable = true; + } + return false; + } + /** + * Compare two types and return + * * Ternary.True if they are related with no assumptions, + * * Ternary.Maybe if they are related with assumptions of other relationships, or + * * Ternary.False if they are not related. + */ function isRelatedTo(source, target, reportErrors, headMessage) { var result; if (source.flags & 96 /* StringOrNumberLiteral */ && source.flags & 1048576 /* FreshLiteral */) { @@ -30654,7 +33231,7 @@ var ts; // and intersection types are further deconstructed on the target side, we don't want to // make the check again (as it might fail for a partial target type). Therefore we obtain // the regular source type and proceed with that. - if (target.flags & 196608 /* UnionOrIntersection */) { + if (isUnionOrIntersectionTypeWithoutNullableConstituents(target)) { source = getRegularTypeOfObjectLiteral(source); } } @@ -30673,122 +33250,37 @@ var ts; return result; } } - else if (target.flags & 65536 /* Union */) { - if (result = typeRelatedToSomeType(source, target, reportErrors && !(source.flags & 8190 /* Primitive */) && !(target.flags & 8190 /* Primitive */))) { - return result; - } - } - else if (target.flags & 131072 /* Intersection */) { - if (result = typeRelatedToEachType(source, target, reportErrors)) { - return result; - } - } - else if (source.flags & 131072 /* Intersection */) { - // Check to see if any constituents of the intersection are immediately related to the target. - // - // Don't report errors though. Checking whether a constituent is related to the source is not actually - // useful and leads to some confusing error messages. Instead it is better to let the below checks - // take care of this, or to not elaborate at all. For instance, - // - // - For an object type (such as 'C = A & B'), users are usually more interested in structural errors. - // - // - For a union type (such as '(A | B) = (C & D)'), it's better to hold onto the whole intersection - // than to report that 'D' is not assignable to 'A' or 'B'. - // - // - For a primitive type or type parameter (such as 'number = A & B') there is no point in - // breaking the intersection apart. - if (result = someTypeRelatedToType(source, target, /*reportErrors*/ false)) { - return result; - } - } - if (target.flags & 16384 /* TypeParameter */) { - // A source type { [P in keyof T]: X } is related to a target type T if X is related to T[P]. - if (getObjectFlags(source) & 32 /* Mapped */ && getConstraintTypeFromMappedType(source) === getIndexType(target)) { - if (!source.declaration.questionToken) { - var templateType = getTemplateTypeFromMappedType(source); - var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); - if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) { - return result; - } - } - } - else { - // Given a type parameter K with a constraint keyof T, a type S is - // assignable to K if S is assignable to keyof T. - var constraint = getConstraintOfTypeParameter(target); - if (constraint && constraint.flags & 262144 /* Index */) { - if (result = isRelatedTo(source, constraint, reportErrors)) { - return result; - } - } - } - } - else if (target.flags & 262144 /* Index */) { - // A keyof S is related to a keyof T if T is related to S. - if (source.flags & 262144 /* Index */) { - if (result = isRelatedTo(target.type, source.type, /*reportErrors*/ false)) { - return result; - } - } - // Given a type parameter T with a constraint C, a type S is assignable to - // keyof T if S is assignable to keyof C. - var constraint = getConstraintOfTypeParameter(target.type); - if (constraint) { - if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) { - return result; - } - } - } - else if (target.flags & 524288 /* IndexedAccess */) { - // if we have indexed access types with identical index types, see if relationship holds for - // the two object types. - if (source.flags & 524288 /* IndexedAccess */ && source.indexType === target.indexType) { - if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) { - return result; - } - } - } - if (source.flags & 16384 /* TypeParameter */) { - // A source type T is related to a target type { [P in keyof T]: X } if T[P] is related to X. - if (getObjectFlags(target) & 32 /* Mapped */ && getConstraintTypeFromMappedType(target) === getIndexType(source)) { - var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); - var templateType = getTemplateTypeFromMappedType(target); - if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { - return result; - } - } - else { - var constraint = getConstraintOfTypeParameter(source); - if (!constraint || constraint.flags & 1 /* Any */) { - constraint = emptyObjectType; - } - // The constraint may need to be further instantiated with its 'this' type. - constraint = getTypeWithThisArgument(constraint, source); - // Report constraint errors only if the constraint is not the empty object type - var reportConstraintErrors = reportErrors && constraint !== emptyObjectType; - if (result = isRelatedTo(constraint, target, reportConstraintErrors)) { - errorInfo = saveErrorInfo; - return result; - } - } - } else { - if (getObjectFlags(source) & 4 /* Reference */ && getObjectFlags(target) & 4 /* Reference */ && source.target === target.target) { - // We have type references to same target type, see if relationship holds for all type arguments - if (result = typeArgumentsRelatedTo(source, target, reportErrors)) { + if (target.flags & 65536 /* Union */) { + if (result = typeRelatedToSomeType(source, target, reportErrors && !(source.flags & 8190 /* Primitive */) && !(target.flags & 8190 /* Primitive */))) { return result; } } - // Even if relationship doesn't hold for unions, intersections, or generic type references, - // it may hold in a structural comparison. - var apparentSource = getApparentType(source); - // In a check of the form X = A & B, we will have previously checked if A relates to X or B relates - // to X. Failing both of those we want to check if the aggregation of A and B's members structurally - // relates to X. Thus, we include intersection types on the source side here. - if (apparentSource.flags & (32768 /* Object */ | 131072 /* Intersection */) && target.flags & 32768 /* Object */) { - // Report structural errors only if we haven't reported any errors yet - var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !(source.flags & 8190 /* Primitive */); - if (result = objectTypeRelatedTo(apparentSource, source, target, reportStructuralErrors)) { + else if (target.flags & 131072 /* Intersection */) { + if (result = typeRelatedToEachType(source, target, reportErrors)) { + return result; + } + } + else if (source.flags & 131072 /* Intersection */) { + // Check to see if any constituents of the intersection are immediately related to the target. + // + // Don't report errors though. Checking whether a constituent is related to the source is not actually + // useful and leads to some confusing error messages. Instead it is better to let the below checks + // take care of this, or to not elaborate at all. For instance, + // + // - For an object type (such as 'C = A & B'), users are usually more interested in structural errors. + // + // - For a union type (such as '(A | B) = (C & D)'), it's better to hold onto the whole intersection + // than to report that 'D' is not assignable to 'A' or 'B'. + // + // - For a primitive type or type parameter (such as 'number = A & B') there is no point in + // breaking the intersection apart. + if (result = someTypeRelatedToType(source, target, /*reportErrors*/ false)) { + return result; + } + } + if (source.flags & 1032192 /* StructuredOrTypeVariable */ || target.flags & 1032192 /* StructuredOrTypeVariable */) { + if (result = recursiveTypeRelatedTo(source, target, reportErrors)) { errorInfo = saveErrorInfo; return result; } @@ -30808,13 +33300,7 @@ var ts; function isIdenticalTo(source, target) { var result; if (source.flags & 32768 /* Object */ && target.flags & 32768 /* Object */) { - if (getObjectFlags(source) & 4 /* Reference */ && getObjectFlags(target) & 4 /* Reference */ && source.target === target.target) { - // We have type references to same target type, see if all type arguments are identical - if (result = typeArgumentsRelatedTo(source, target, /*reportErrors*/ false)) { - return result; - } - } - return objectTypeRelatedTo(source, source, target, /*reportErrors*/ false); + return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false); } if (source.flags & 65536 /* Union */ && target.flags & 65536 /* Union */ || source.flags & 131072 /* Intersection */ && target.flags & 131072 /* Intersection */) { @@ -30830,45 +33316,49 @@ var ts; // is considered known if the object type is empty and the check is for assignability, if the object type has // index signatures, or if the property is actually declared in the object type. In a union or intersection // type, a property is considered known if it is known in any constituent type. - function isKnownProperty(type, name) { + function isKnownProperty(type, name, isComparingJsxAttributes) { if (type.flags & 32768 /* Object */) { var resolved = resolveStructuredTypeMembers(type); - if ((relation === assignableRelation || relation === comparableRelation) && (type === globalObjectType || isEmptyObjectType(resolved)) || - resolved.stringIndexInfo || - (resolved.numberIndexInfo && isNumericLiteralName(name)) || - getPropertyOfType(type, name)) { + if (resolved.stringIndexInfo || resolved.numberIndexInfo && isNumericLiteralName(name) || + getPropertyOfType(type, name) || isComparingJsxAttributes && !isUnhyphenatedJsxName(name)) { + // For JSXAttributes, if the attribute has a hyphenated name, consider that the attribute to be known. return true; } } else if (type.flags & 196608 /* UnionOrIntersection */) { for (var _i = 0, _a = type.types; _i < _a.length; _i++) { var t = _a[_i]; - if (isKnownProperty(t, name)) { + if (isKnownProperty(t, name, isComparingJsxAttributes)) { return true; } } } return false; } - function isEmptyObjectType(t) { - return t.properties.length === 0 && - t.callSignatures.length === 0 && - t.constructSignatures.length === 0 && - !t.stringIndexInfo && - !t.numberIndexInfo; - } function hasExcessProperties(source, target, reportErrors) { if (maybeTypeOfKind(target, 32768 /* Object */) && !(getObjectFlags(target) & 512 /* ObjectLiteralPatternWithComputedProperties */)) { + var isComparingJsxAttributes = !!(source.flags & 33554432 /* JsxAttributes */); + if ((relation === assignableRelation || relation === comparableRelation) && + (isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) { + return false; + } for (var _i = 0, _a = getPropertiesOfObjectType(source); _i < _a.length; _i++) { var prop = _a[_i]; - if (!isKnownProperty(target, prop.name)) { + if (!isKnownProperty(target, prop.name, isComparingJsxAttributes)) { if (reportErrors) { // We know *exactly* where things went wrong when comparing the types. // Use this property as the error node as this will be more helpful in // reasoning about what went wrong. ts.Debug.assert(!!errorNode); - errorNode = prop.valueDeclaration; - reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target)); + if (ts.isJsxAttributes(errorNode)) { + // JsxAttributes has an object-literal flag and undergo same type-assignablity check as normal object-literal. + // However, using an object-literal error message will be very confusing to the users so we give different a message. + reportError(ts.Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(target)); + } + else { + errorNode = prop.valueDeclaration; + reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target)); + } } return true; } @@ -30894,20 +33384,42 @@ var ts; if (target.flags & 65536 /* Union */ && containsType(targetTypes, source)) { return -1 /* True */; } - var len = targetTypes.length; - for (var i = 0; i < len; i++) { - var related = isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1); + for (var _i = 0, targetTypes_1 = targetTypes; _i < targetTypes_1.length; _i++) { + var type = targetTypes_1[_i]; + var related = isRelatedTo(source, type, /*reportErrors*/ false); if (related) { return related; } } + if (reportErrors) { + var discriminantType = findMatchingDiscriminantType(source, target); + isRelatedTo(source, discriminantType || targetTypes[targetTypes.length - 1], /*reportErrors*/ true); + } return 0 /* False */; } + function findMatchingDiscriminantType(source, target) { + var sourceProperties = getPropertiesOfObjectType(source); + if (sourceProperties) { + for (var _i = 0, sourceProperties_1 = sourceProperties; _i < sourceProperties_1.length; _i++) { + var sourceProperty = sourceProperties_1[_i]; + if (isDiscriminantProperty(target, sourceProperty.name)) { + var sourceType = getTypeOfSymbol(sourceProperty); + for (var _a = 0, _b = target.types; _a < _b.length; _a++) { + var type = _b[_a]; + var targetType = getTypeOfPropertyOfType(type, sourceProperty.name); + if (targetType && isRelatedTo(sourceType, targetType)) { + return type; + } + } + } + } + } + } function typeRelatedToEachType(source, target, reportErrors) { var result = -1 /* True */; var targetTypes = target.types; - for (var _i = 0, targetTypes_1 = targetTypes; _i < targetTypes_1.length; _i++) { - var targetType = targetTypes_1[_i]; + for (var _i = 0, targetTypes_2 = targetTypes; _i < targetTypes_2.length; _i++) { + var targetType = targetTypes_2[_i]; var related = isRelatedTo(source, targetType, reportErrors); if (!related) { return 0 /* False */; @@ -30960,22 +33472,22 @@ var ts; } return result; } - // Determine if two object types are related by structure. First, check if the result is already available in the global cache. + // Determine if possibly recursive types are related. First, check if the result is already available in the global cache. // Second, check if we have already started a comparison of the given two types in which case we assume the result to be true. // Third, check if both types are part of deeply nested chains of generic type instantiations and if so assume the types are // equal and infinitely expanding. Fourth, if we have reached a depth of 100 nested comparisons, assume we have runaway recursion // and issue an error. Otherwise, actually compare the structure of the two types. - function objectTypeRelatedTo(source, originalSource, target, reportErrors) { + function recursiveTypeRelatedTo(source, target, reportErrors) { if (overflow) { return 0 /* False */; } var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; - var related = relation[id]; + var related = relation.get(id); if (related !== undefined) { if (reportErrors && related === 2 /* Failed */) { // We are elaborating errors and the cached result is an unreported failure. Record the result as a reported // failure and continue computing the relation such that errors get reported. - relation[id] = 3 /* FailedAndReported */; + relation.set(id, 3 /* FailedAndReported */); } else { return related === 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */; @@ -30984,7 +33496,7 @@ var ts; if (depth > 0) { for (var i = 0; i < depth; i++) { // If source and target are already being compared, consider them related with assumptions - if (maybeStack[i][id]) { + if (maybeStack[i].get(id)) { return 1 /* Maybe */; } } @@ -31002,75 +33514,192 @@ var ts; sourceStack[depth] = source; targetStack[depth] = target; maybeStack[depth] = ts.createMap(); - maybeStack[depth][id] = 1 /* Succeeded */; + maybeStack[depth].set(id, 1 /* Succeeded */); depth++; var saveExpandingFlags = expandingFlags; - if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack, depth)) + if (!(expandingFlags & 1) && isDeeplyNestedType(source, sourceStack, depth)) expandingFlags |= 1; - if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack, depth)) + if (!(expandingFlags & 2) && isDeeplyNestedType(target, targetStack, depth)) expandingFlags |= 2; - var result; - if (expandingFlags === 3) { - result = 1 /* Maybe */; - } - else if (isGenericMappedType(source) || isGenericMappedType(target)) { - result = mappedTypeRelatedTo(source, target, reportErrors); - } - else { - result = propertiesRelatedTo(source, target, reportErrors); - if (result) { - result &= signaturesRelatedTo(source, target, 0 /* Call */, reportErrors); - if (result) { - result &= signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors); - if (result) { - result &= indexTypesRelatedTo(source, originalSource, target, 0 /* String */, reportErrors); - if (result) { - result &= indexTypesRelatedTo(source, originalSource, target, 1 /* Number */, reportErrors); - } - } - } - } - } + var result = expandingFlags !== 3 ? structuredTypeRelatedTo(source, target, reportErrors) : 1 /* Maybe */; expandingFlags = saveExpandingFlags; depth--; if (result) { var maybeCache = maybeStack[depth]; // If result is definitely true, copy assumptions to global cache, else copy to next level up var destinationCache = (result === -1 /* True */ || depth === 0) ? relation : maybeStack[depth - 1]; - ts.copyProperties(maybeCache, destinationCache); + ts.copyEntries(maybeCache, destinationCache); } else { // A false result goes straight into global cache (when something is false under assumptions it // will also be false without assumptions) - relation[id] = reportErrors ? 3 /* FailedAndReported */ : 2 /* Failed */; + relation.set(id, reportErrors ? 3 /* FailedAndReported */ : 2 /* Failed */); } return result; } - // A type [P in S]: X is related to a type [P in T]: Y if T is related to S and X is related to Y. - function mappedTypeRelatedTo(source, target, reportErrors) { - if (isGenericMappedType(target)) { - if (isGenericMappedType(source)) { - var result_2; - if (relation === identityRelation) { - var readonlyMatches = !source.declaration.readonlyToken === !target.declaration.readonlyToken; - var optionalMatches = !source.declaration.questionToken === !target.declaration.questionToken; - if (readonlyMatches && optionalMatches) { - if (result_2 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { - return result_2 & isRelatedTo(getErasedTemplateTypeFromMappedType(source), getErasedTemplateTypeFromMappedType(target), reportErrors); - } - } - } - else { - if (relation === comparableRelation || !source.declaration.questionToken || target.declaration.questionToken) { - if (result_2 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { - return result_2 & isRelatedTo(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target), reportErrors); - } + function structuredTypeRelatedTo(source, target, reportErrors) { + var result; + var saveErrorInfo = errorInfo; + if (target.flags & 16384 /* TypeParameter */) { + // A source type { [P in keyof T]: X } is related to a target type T if X is related to T[P]. + if (getObjectFlags(source) & 32 /* Mapped */ && getConstraintTypeFromMappedType(source) === getIndexType(target)) { + if (!source.declaration.questionToken) { + var templateType = getTemplateTypeFromMappedType(source); + var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); + if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) { + return result; } } } } - else if (relation !== identityRelation && isEmptyObjectType(resolveStructuredTypeMembers(target))) { - return -1 /* True */; + else if (target.flags & 262144 /* Index */) { + // A keyof S is related to a keyof T if T is related to S. + if (source.flags & 262144 /* Index */) { + if (result = isRelatedTo(target.type, source.type, /*reportErrors*/ false)) { + return result; + } + } + // A type S is assignable to keyof T if S is assignable to keyof C, where C is the + // constraint of T. + var constraint = getConstraintOfType(target.type); + if (constraint) { + if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) { + return result; + } + } + } + else if (target.flags & 524288 /* IndexedAccess */) { + // A type S is related to a type T[K] if S is related to A[K], where K is string-like and + // A is the apparent type of S. + var constraint = getConstraintOfType(target); + if (constraint) { + if (result = isRelatedTo(source, constraint, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + } + if (source.flags & 16384 /* TypeParameter */) { + // A source type T is related to a target type { [P in keyof T]: X } if T[P] is related to X. + if (getObjectFlags(target) & 32 /* Mapped */ && getConstraintTypeFromMappedType(target) === getIndexType(source)) { + var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); + var templateType = getTemplateTypeFromMappedType(target); + if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + else { + var constraint = getConstraintOfTypeParameter(source); + // A type parameter with no constraint is not related to the non-primitive object type. + if (constraint || !(target.flags & 16777216 /* NonPrimitive */)) { + if (!constraint || constraint.flags & 1 /* Any */) { + constraint = emptyObjectType; + } + // The constraint may need to be further instantiated with its 'this' type. + constraint = getTypeWithThisArgument(constraint, source); + // Report constraint errors only if the constraint is not the empty object type + var reportConstraintErrors = reportErrors && constraint !== emptyObjectType; + if (result = isRelatedTo(constraint, target, reportConstraintErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + } + } + else if (source.flags & 524288 /* IndexedAccess */) { + // A type S[K] is related to a type T if A[K] is related to T, where K is string-like and + // A is the apparent type of S. + var constraint = getConstraintOfType(source); + if (constraint) { + if (result = isRelatedTo(constraint, target, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + else if (target.flags & 524288 /* IndexedAccess */ && source.indexType === target.indexType) { + // if we have indexed access types with identical index types, see if relationship holds for + // the two object types. + if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) { + return result; + } + } + } + else { + if (getObjectFlags(source) & 4 /* Reference */ && getObjectFlags(target) & 4 /* Reference */ && source.target === target.target) { + // We have type references to same target type, see if relationship holds for all type arguments + if (result = typeArgumentsRelatedTo(source, target, reportErrors)) { + return result; + } + } + // Even if relationship doesn't hold for unions, intersections, or generic type references, + // it may hold in a structural comparison. + var sourceIsPrimitive = !!(source.flags & 8190 /* Primitive */); + if (relation !== identityRelation) { + source = getApparentType(source); + } + // In a check of the form X = A & B, we will have previously checked if A relates to X or B relates + // to X. Failing both of those we want to check if the aggregation of A and B's members structurally + // relates to X. Thus, we include intersection types on the source side here. + if (source.flags & (32768 /* Object */ | 131072 /* Intersection */) && target.flags & 32768 /* Object */) { + // Report structural errors only if we haven't reported any errors yet + var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !sourceIsPrimitive; + if (isGenericMappedType(source) || isGenericMappedType(target)) { + result = mappedTypeRelatedTo(source, target, reportStructuralErrors); + } + else { + result = propertiesRelatedTo(source, target, reportStructuralErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 0 /* Call */, reportStructuralErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 1 /* Construct */, reportStructuralErrors); + if (result) { + result &= indexTypesRelatedTo(source, target, 0 /* String */, sourceIsPrimitive, reportStructuralErrors); + if (result) { + result &= indexTypesRelatedTo(source, target, 1 /* Number */, sourceIsPrimitive, reportStructuralErrors); + } + } + } + } + } + if (result) { + errorInfo = saveErrorInfo; + return result; + } + } + } + return 0 /* False */; + } + // A type [P in S]: X is related to a type [Q in T]: Y if T is related to S and X' is + // related to Y, where X' is an instantiation of X in which P is replaced with Q. Notice + // that S and T are contra-variant whereas X and Y are co-variant. + function mappedTypeRelatedTo(source, target, reportErrors) { + if (isGenericMappedType(target)) { + if (isGenericMappedType(source)) { + var sourceReadonly = !!source.declaration.readonlyToken; + var sourceOptional = !!source.declaration.questionToken; + var targetReadonly = !!target.declaration.readonlyToken; + var targetOptional = !!target.declaration.questionToken; + var modifiersRelated = relation === identityRelation ? + sourceReadonly === targetReadonly && sourceOptional === targetOptional : + relation === comparableRelation || !sourceOptional || targetOptional; + if (modifiersRelated) { + var result_2; + if (result_2 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { + var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); + return result_2 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); + } + } + } + else if (target.declaration.questionToken && isEmptyObjectType(source)) { + return -1 /* True */; + } + } + else if (relation !== identityRelation) { + var resolved = resolveStructuredTypeMembers(target); + if (isEmptyResolvedType(resolved) || resolved.stringIndexInfo && resolved.stringIndexInfo.type.flags & 1 /* Any */) { + return -1 /* True */; + } } return 0 /* False */; } @@ -31081,22 +33710,28 @@ var ts; var result = -1 /* True */; var properties = getPropertiesOfObjectType(target); var requireOptionalProperties = relation === subtypeRelation && !(getObjectFlags(source) & 128 /* ObjectLiteral */); - for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { - var targetProp = properties_3[_i]; + for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) { + var targetProp = properties_4[_i]; var sourceProp = getPropertyOfType(source, targetProp.name); if (sourceProp !== targetProp) { if (!sourceProp) { - if (!(targetProp.flags & 536870912 /* Optional */) || requireOptionalProperties) { + if (!(targetProp.flags & 67108864 /* Optional */) || requireOptionalProperties) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source)); } return 0 /* False */; } } - else if (!(targetProp.flags & 134217728 /* Prototype */)) { + else if (!(targetProp.flags & 16777216 /* Prototype */)) { var sourcePropFlags = getDeclarationModifierFlagsFromSymbol(sourceProp); var targetPropFlags = getDeclarationModifierFlagsFromSymbol(targetProp); if (sourcePropFlags & 8 /* Private */ || targetPropFlags & 8 /* Private */) { + if (getCheckFlags(sourceProp) & 256 /* ContainsPrivate */) { + if (reportErrors) { + reportError(ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(sourceProp), typeToString(source)); + } + return 0 /* False */; + } if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) { if (reportErrors) { if (sourcePropFlags & 8 /* Private */ && targetPropFlags & 8 /* Private */) { @@ -31110,12 +33745,9 @@ var ts; } } else if (targetPropFlags & 16 /* Protected */) { - var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 32 /* Class */; - var sourceClass = sourceDeclaredInClass ? getDeclaredTypeOfSymbol(getParentOfSymbol(sourceProp)) : undefined; - var targetClass = getDeclaredTypeOfSymbol(getParentOfSymbol(targetProp)); - if (!sourceClass || !hasBaseType(sourceClass, targetClass)) { + if (!isValidOverrideOf(sourceProp, targetProp)) { if (reportErrors) { - reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(sourceClass || source), typeToString(targetClass)); + reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(getDeclaringClass(sourceProp) || source), typeToString(getDeclaringClass(targetProp) || target)); } return 0 /* False */; } @@ -31135,7 +33767,7 @@ var ts; } result &= related; // When checking for comparability, be more lenient with optional properties. - if (relation !== comparableRelation && sourceProp.flags & 536870912 /* Optional */ && !(targetProp.flags & 536870912 /* Optional */)) { + if (relation !== comparableRelation && sourceProp.flags & 67108864 /* Optional */ && !(targetProp.flags & 67108864 /* Optional */)) { // TypeScript 1.0 spec (April 2014): 3.8.3 // S is a subtype of a type T, and T is a supertype of S if ... // S' and T are object types and, for each member M in T.. @@ -31163,8 +33795,8 @@ var ts; return 0 /* False */; } var result = -1 /* True */; - for (var _i = 0, sourceProperties_1 = sourceProperties; _i < sourceProperties_1.length; _i++) { - var sourceProp = sourceProperties_1[_i]; + for (var _i = 0, sourceProperties_2 = sourceProperties; _i < sourceProperties_2.length; _i++) { + var sourceProp = sourceProperties_2[_i]; var targetProp = getPropertyOfObjectType(target, sourceProp.name); if (!targetProp) { return 0 /* False */; @@ -31228,7 +33860,7 @@ var ts; * See signatureAssignableTo, compareSignaturesIdentical */ function signatureRelatedTo(source, target, reportErrors) { - return compareSignaturesRelated(source, target, /*ignoreReturnTypes*/ false, reportErrors, reportError, isRelatedTo); + return compareSignaturesRelated(source, target, /*checkAsCallback*/ false, /*ignoreReturnTypes*/ false, reportErrors, reportError, isRelatedTo); } function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); @@ -31237,7 +33869,7 @@ var ts; return 0 /* False */; } var result = -1 /* True */; - for (var i = 0, len = sourceSignatures.length; i < len; i++) { + for (var i = 0; i < sourceSignatures.length; i++) { var related = compareSignaturesIdentical(sourceSignatures[i], targetSignatures[i], /*partialMatch*/ false, /*ignoreThisTypes*/ false, /*ignoreReturnTypes*/ false, isRelatedTo); if (!related) { return 0 /* False */; @@ -31270,12 +33902,12 @@ var ts; } return related; } - function indexTypesRelatedTo(source, originalSource, target, kind, reportErrors) { + function indexTypesRelatedTo(source, target, kind, sourceIsPrimitive, reportErrors) { if (relation === identityRelation) { return indexTypesIdenticalTo(source, target, kind); } var targetInfo = getIndexInfoOfType(target, kind); - if (!targetInfo || ((targetInfo.type.flags & 1 /* Any */) && !(originalSource.flags & 8190 /* Primitive */))) { + if (!targetInfo || targetInfo.type.flags & 1 /* Any */ && !sourceIsPrimitive) { // Index signature of type any permits assignment from everything but primitives return -1 /* True */; } @@ -31337,6 +33969,45 @@ var ts; return false; } } + // Invoke the callback for each underlying property symbol of the given symbol and return the first + // value that isn't undefined. + function forEachProperty(prop, callback) { + if (getCheckFlags(prop) & 6 /* Synthetic */) { + for (var _i = 0, _a = prop.containingType.types; _i < _a.length; _i++) { + var t = _a[_i]; + var p = getPropertyOfType(t, prop.name); + var result = p && forEachProperty(p, callback); + if (result) { + return result; + } + } + return undefined; + } + return callback(prop); + } + // Return the declaring class type of a property or undefined if property not declared in class + function getDeclaringClass(prop) { + return prop.parent && prop.parent.flags & 32 /* Class */ ? getDeclaredTypeOfSymbol(getParentOfSymbol(prop)) : undefined; + } + // Return true if some underlying source property is declared in a class that derives + // from the given base class. + function isPropertyInClassDerivedFrom(prop, baseClass) { + return forEachProperty(prop, function (sp) { + var sourceClass = getDeclaringClass(sp); + return sourceClass ? hasBaseType(sourceClass, baseClass) : false; + }); + } + // Return true if source property is a valid override of protected parts of target property. + function isValidOverrideOf(sourceProp, targetProp) { + return !forEachProperty(targetProp, function (tp) { return getDeclarationModifierFlagsFromSymbol(tp) & 16 /* Protected */ ? + !isPropertyInClassDerivedFrom(sourceProp, getDeclaringClass(tp)) : false; }); + } + // Return true if the given class derives from each of the declaring classes of the protected + // constituents of the given property. + function isClassDerivedFromDeclaringClasses(checkClass, prop) { + return forEachProperty(prop, function (p) { return getDeclarationModifierFlagsFromSymbol(p) & 16 /* Protected */ ? + !hasBaseType(checkClass, getDeclaringClass(p)) : false; }) ? undefined : checkClass; + } // Return true if the given type is the constructor type for an abstract class function isAbstractConstructorType(type) { if (getObjectFlags(type) & 16 /* Anonymous */) { @@ -31350,22 +34021,24 @@ var ts; } return false; } - // Return true if the given type is part of a deeply nested chain of generic instantiations. We consider this to be the case - // when structural type comparisons have been started for 10 or more instantiations of the same generic type. It is possible, - // though highly unlikely, for this test to be true in a situation where a chain of instantiations is not infinitely expanding. - // Effectively, we will generate a false positive when two types are structurally equal to at least 10 levels, but unequal at - // some level beyond that. - function isDeeplyNestedGeneric(type, stack, depth) { - // We track type references (created by createTypeReference) and instantiated types (created by instantiateType) - if (getObjectFlags(type) & (4 /* Reference */ | 64 /* Instantiated */) && depth >= 5) { + // Return true if the given type is deeply nested. We consider this to be the case when structural type comparisons + // for 5 or more occurrences or instantiations of the type have been recorded on the given stack. It is possible, + // though highly unlikely, for this test to be true in a situation where a chain of instantiations is not infinitely + // expanding. Effectively, we will generate a false positive when two types are structurally equal to at least 5 + // levels, but unequal at some level beyond that. + function isDeeplyNestedType(type, stack, depth) { + // We track all object types that have an associated symbol (representing the origin of the type) + if (depth >= 5 && type.flags & 32768 /* Object */) { var symbol = type.symbol; - var count = 0; - for (var i = 0; i < depth; i++) { - var t = stack[i]; - if (getObjectFlags(t) & (4 /* Reference */ | 64 /* Instantiated */) && t.symbol === symbol) { - count++; - if (count >= 5) - return true; + if (symbol) { + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (t.flags & 32768 /* Object */ && t.symbol === symbol) { + count++; + if (count >= 5) + return true; + } } } } @@ -31392,7 +34065,7 @@ var ts; } } else { - if ((sourceProp.flags & 536870912 /* Optional */) !== (targetProp.flags & 536870912 /* Optional */)) { + if ((sourceProp.flags & 67108864 /* Optional */) !== (targetProp.flags & 67108864 /* Optional */)) { return 0 /* False */; } } @@ -31436,7 +34109,7 @@ var ts; // the constraints with a common set of type arguments to get relatable entities in places where // type parameters occur in the constraints. The complexity of doing that doesn't seem worthwhile, // particularly as we're comparing erased versions of the signatures below. - if ((source.typeParameters ? source.typeParameters.length : 0) !== (target.typeParameters ? target.typeParameters.length : 0)) { + if (ts.length(source.typeParameters) !== ts.length(target.typeParameters)) { return 0 /* False */; } // Spec 1.0 Section 3.8.3 & 3.8.4: @@ -31476,8 +34149,8 @@ var ts; return signature.hasRestParameter && parameterIndex >= signature.parameters.length - 1; } function isSupertypeOfEach(candidate, types) { - for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { - var t = types_7[_i]; + for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { + var t = types_10[_i]; if (candidate !== t && !isTypeSubtypeOf(t, candidate)) return false; } @@ -31485,8 +34158,8 @@ var ts; } function literalTypesWithSameBaseType(types) { var commonBaseType; - for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { - var t = types_8[_i]; + for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { + var t = types_11[_i]; var baseType = getBaseTypeOfLiteralType(t); if (!commonBaseType) { commonBaseType = baseType; @@ -31592,8 +34265,8 @@ var ts; } function getFalsyFlagsOfTypes(types) { var result = 0; - for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { - var t = types_9[_i]; + for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { + var t = types_12[_i]; result |= getFalsyFlags(t); } return result; @@ -31625,7 +34298,7 @@ var ts; types.push(undefinedType); if (flags & 4096 /* Null */) types.push(nullType); - return getUnionType(types, /*subtypeReduction*/ true); + return getUnionType(types); } function removeDefinitelyFalsyTypes(type) { return getFalsyFlags(type) & 7392 /* DefinitelyFalsy */ ? @@ -31644,8 +34317,8 @@ var ts; getSignaturesOfType(type, 0 /* Call */).length === 0 && getSignaturesOfType(type, 1 /* Construct */).length === 0; } - function createTransientSymbol(source, type) { - var symbol = createSymbol(source.flags | 67108864 /* Transient */, source.name); + function createSymbolWithType(source, type) { + var symbol = createSymbol(source.flags, source.name); symbol.declarations = source.declarations; symbol.parent = source.parent; symbol.type = type; @@ -31661,9 +34334,8 @@ var ts; var property = _a[_i]; var original = getTypeOfSymbol(property); var updated = f(original); - members[property.name] = updated === original ? property : createTransientSymbol(property, updated); + members.set(property.name, updated === original ? property : createSymbolWithType(property, updated)); } - ; return members; } /** @@ -31687,11 +34359,19 @@ var ts; type.regularType = regularNew; return regularNew; } + function getWidenedProperty(prop) { + var original = getTypeOfSymbol(prop); + var widened = getWidenedType(original); + return widened === original ? prop : createSymbolWithType(prop, widened); + } function getWidenedTypeOfObjectLiteral(type) { - var members = transformTypeOfMembers(type, function (prop) { - var widened = getWidenedType(prop); - return prop === widened ? prop : widened; - }); + var members = ts.createMap(); + for (var _i = 0, _a = getPropertiesOfObjectType(type); _i < _a.length; _i++) { + var prop = _a[_i]; + // Since get accessors already widen their return value there is no need to + // widen accessor based properties here. + members.set(prop.name, prop.flags & 4 /* Property */ ? getWidenedProperty(prop) : prop); + } var stringIndexInfo = getIndexInfoOfType(type, 0 /* String */); var numberIndexInfo = getIndexInfoOfType(type, 1 /* Number */); return createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexInfo && createIndexInfo(getWidenedType(stringIndexInfo.type), stringIndexInfo.isReadonly), numberIndexInfo && createIndexInfo(getWidenedType(numberIndexInfo.type), numberIndexInfo.isReadonly)); @@ -31763,25 +34443,25 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 144 /* Parameter */: + case 145 /* Parameter */: diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 174 /* BindingElement */: + case 175 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; break; - case 225 /* FunctionDeclaration */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 227 /* FunctionDeclaration */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -31794,7 +34474,7 @@ var ts; error(declaration, diagnostic, ts.declarationNameToString(declaration.name), typeAsString); } function reportErrorsFromWidening(declaration, type) { - if (produceDiagnostics && compilerOptions.noImplicitAny && type.flags & 2097152 /* ContainsWideningType */) { + if (produceDiagnostics && noImplicitAny && type.flags & 2097152 /* ContainsWideningType */) { // Report implicit any error within type if possible, otherwise report error on declaration if (!reportWideningErrorsInType(type)) { reportImplicitAnyError(declaration, type); @@ -31821,13 +34501,14 @@ var ts; callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i)); } } - function createInferenceContext(signature, inferUnionTypes) { + function createInferenceContext(signature, inferUnionTypes, useAnyForNoInferences) { var inferences = ts.map(signature.typeParameters, createTypeInferencesObject); return { signature: signature, inferUnionTypes: inferUnionTypes, inferences: inferences, inferredTypes: new Array(signature.typeParameters.length), + useAnyForNoInferences: useAnyForNoInferences }; } function createTypeInferencesObject() { @@ -31841,25 +34522,73 @@ var ts; // Return true if the given type could possibly reference a type parameter for which // we perform type inference (i.e. a type parameter of a generic function). We cache // results for union and intersection types for performance reasons. - function couldContainTypeParameters(type) { + function couldContainTypeVariables(type) { var objectFlags = getObjectFlags(type); - return !!(type.flags & 16384 /* TypeParameter */ || - objectFlags & 4 /* Reference */ && ts.forEach(type.typeArguments, couldContainTypeParameters) || + return !!(type.flags & 540672 /* TypeVariable */ || + objectFlags & 4 /* Reference */ && ts.forEach(type.typeArguments, couldContainTypeVariables) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (8192 /* Method */ | 2048 /* TypeLiteral */ | 32 /* Class */) || objectFlags & 32 /* Mapped */ || - type.flags & 196608 /* UnionOrIntersection */ && couldUnionOrIntersectionContainTypeParameters(type)); + type.flags & 196608 /* UnionOrIntersection */ && couldUnionOrIntersectionContainTypeVariables(type)); } - function couldUnionOrIntersectionContainTypeParameters(type) { - if (type.couldContainTypeParameters === undefined) { - type.couldContainTypeParameters = ts.forEach(type.types, couldContainTypeParameters); + function couldUnionOrIntersectionContainTypeVariables(type) { + if (type.couldContainTypeVariables === undefined) { + type.couldContainTypeVariables = ts.forEach(type.types, couldContainTypeVariables); } - return type.couldContainTypeParameters; + return type.couldContainTypeVariables; } function isTypeParameterAtTopLevel(type, typeParameter) { return type === typeParameter || type.flags & 196608 /* UnionOrIntersection */ && ts.forEach(type.types, function (t) { return isTypeParameterAtTopLevel(t, typeParameter); }); } - function inferTypes(context, originalSource, originalTarget) { - var typeParameters = context.signature.typeParameters; + // Infer a suitable input type for a homomorphic mapped type { [P in keyof T]: X }. We construct + // an object type with the same set of properties as the source type, where the type of each + // property is computed by inferring from the source property type to X for the type + // variable T[P] (i.e. we treat the type T[P] as the type variable we're inferring for). + function inferTypeForHomomorphicMappedType(source, target) { + var properties = getPropertiesOfType(source); + var indexInfo = getIndexInfoOfType(source, 0 /* String */); + if (properties.length === 0 && !indexInfo) { + return undefined; + } + var typeVariable = getIndexedAccessType(getConstraintTypeFromMappedType(target).type, getTypeParameterFromMappedType(target)); + var typeVariableArray = [typeVariable]; + var typeInferences = createTypeInferencesObject(); + var typeInferencesArray = [typeInferences]; + var templateType = getTemplateTypeFromMappedType(target); + var readonlyMask = target.declaration.readonlyToken ? false : true; + var optionalMask = target.declaration.questionToken ? 0 : 67108864 /* Optional */; + var members = createSymbolTable(properties); + for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) { + var prop = properties_5[_i]; + var inferredPropType = inferTargetType(getTypeOfSymbol(prop)); + if (!inferredPropType) { + return undefined; + } + var inferredProp = createSymbol(4 /* Property */ | prop.flags & optionalMask, prop.name); + inferredProp.checkFlags = readonlyMask && isReadonlySymbol(prop) ? 8 /* Readonly */ : 0; + inferredProp.declarations = prop.declarations; + inferredProp.type = inferredPropType; + members.set(prop.name, inferredProp); + } + if (indexInfo) { + var inferredIndexType = inferTargetType(indexInfo.type); + if (!inferredIndexType) { + return undefined; + } + indexInfo = createIndexInfo(inferredIndexType, readonlyMask && indexInfo.isReadonly); + } + return createAnonymousType(undefined, members, emptyArray, emptyArray, indexInfo, undefined); + function inferTargetType(sourceType) { + typeInferences.primary = undefined; + typeInferences.secondary = undefined; + inferTypes(typeVariableArray, typeInferencesArray, sourceType, templateType); + var inferences = typeInferences.primary || typeInferences.secondary; + return inferences && getUnionType(inferences, /*subtypeReduction*/ true); + } + } + function inferTypesWithContext(context, originalSource, originalTarget) { + inferTypes(context.signature.typeParameters, context.inferences, originalSource, originalTarget); + } + function inferTypes(typeVariables, typeInferences, originalSource, originalTarget) { var sourceStack; var targetStack; var depth = 0; @@ -31875,7 +34604,7 @@ var ts; return false; } function inferFromTypes(source, target) { - if (!couldContainTypeParameters(target)) { + if (!couldContainTypeVariables(target)) { return; } if (source.aliasSymbol && source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol) { @@ -31927,7 +34656,7 @@ var ts; target = removeTypesFromUnionOrIntersection(target, matchingTypes); } } - if (target.flags & 16384 /* TypeParameter */) { + if (target.flags & 540672 /* TypeVariable */) { // If target is a type parameter, make an inference, unless the source type contains // the anyFunctionType (the wildcard type that's used to avoid contextually typing functions). // Because the anyFunctionType is internal, it should not be exposed to the user by adding @@ -31937,9 +34666,9 @@ var ts; if (source.flags & 8388608 /* ContainsAnyFunctionType */) { return; } - for (var i = 0; i < typeParameters.length; i++) { - if (target === typeParameters[i]) { - var inferences = context.inferences[i]; + for (var i = 0; i < typeVariables.length; i++) { + if (target === typeVariables[i]) { + var inferences = typeInferences[i]; if (!inferences.isFixed) { // Any inferences that are made to a type parameter in a union type are inferior // to inferences made to a flat (non-union) type. This is because if we infer to @@ -31953,7 +34682,7 @@ var ts; if (!ts.contains(candidates, source)) { candidates.push(source); } - if (!isTypeParameterAtTopLevel(originalTarget, target)) { + if (target.flags & 16384 /* TypeParameter */ && !isTypeParameterAtTopLevel(originalTarget, target)) { inferences.topLevel = false; } } @@ -31972,25 +34701,25 @@ var ts; } else if (target.flags & 196608 /* UnionOrIntersection */) { var targetTypes = target.types; - var typeParameterCount = 0; - var typeParameter = void 0; - // First infer to each type in union or intersection that isn't a type parameter - for (var _d = 0, targetTypes_2 = targetTypes; _d < targetTypes_2.length; _d++) { - var t = targetTypes_2[_d]; - if (t.flags & 16384 /* TypeParameter */ && ts.contains(typeParameters, t)) { - typeParameter = t; - typeParameterCount++; + var typeVariableCount = 0; + var typeVariable = void 0; + // First infer to each type in union or intersection that isn't a type variable + for (var _d = 0, targetTypes_3 = targetTypes; _d < targetTypes_3.length; _d++) { + var t = targetTypes_3[_d]; + if (t.flags & 540672 /* TypeVariable */ && ts.contains(typeVariables, t)) { + typeVariable = t; + typeVariableCount++; } else { inferFromTypes(source, t); } } - // Next, if target containings a single naked type parameter, make a secondary inference to that type - // parameter. This gives meaningful results for union types in co-variant positions and intersection + // Next, if target containings a single naked type variable, make a secondary inference to that type + // variable. This gives meaningful results for union types in co-variant positions and intersection // types in contra-variant positions (such as callback parameters). - if (typeParameterCount === 1) { + if (typeVariableCount === 1) { inferiority++; - inferFromTypes(source, typeParameter); + inferFromTypes(source, typeVariable); inferiority--; } } @@ -32008,14 +34737,14 @@ var ts; if (isInProcess(source, target)) { return; } - if (isDeeplyNestedGeneric(source, sourceStack, depth) && isDeeplyNestedGeneric(target, targetStack, depth)) { + if (isDeeplyNestedType(source, sourceStack, depth) && isDeeplyNestedType(target, targetStack, depth)) { return; } var key = source.id + "," + target.id; - if (visited[key]) { + if (visited.get(key)) { return; } - visited[key] = true; + visited.set(key, true); if (depth === 0) { sourceStack = []; targetStack = []; @@ -32031,12 +34760,25 @@ var ts; function inferFromObjectTypes(source, target) { if (getObjectFlags(target) & 32 /* Mapped */) { var constraintType = getConstraintTypeFromMappedType(target); - if (getObjectFlags(source) & 32 /* Mapped */) { - inferFromTypes(getConstraintTypeFromMappedType(source), constraintType); - inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target)); + if (constraintType.flags & 262144 /* Index */) { + // We're inferring from some source type S to a homomorphic mapped type { [P in keyof T]: X }, + // where T is a type variable. Use inferTypeForHomomorphicMappedType to infer a suitable source + // type and then make a secondary inference from that type to T. We make a secondary inference + // such that direct inferences to T get priority over inferences to Partial, for example. + var index = ts.indexOf(typeVariables, constraintType.type); + if (index >= 0 && !typeInferences[index].isFixed) { + var inferredType = inferTypeForHomomorphicMappedType(source, target); + if (inferredType) { + inferiority++; + inferFromTypes(inferredType, typeVariables[index]); + inferiority--; + } + } return; } if (constraintType.flags & 16384 /* TypeParameter */) { + // We're inferring from some source type S to a mapped type { [P in T]: X }, where T is a type + // parameter. Infer from 'keyof S' to T and infer from a union of each property type in S to X. inferFromTypes(getIndexType(source), constraintType); inferFromTypes(getUnionType(ts.map(getPropertiesOfType(source), getTypeOfSymbol)), getTemplateTypeFromMappedType(target)); return; @@ -32049,8 +34791,8 @@ var ts; } function inferFromProperties(source, target) { var properties = getPropertiesOfObjectType(target); - for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) { - var targetProp = properties_4[_i]; + for (var _i = 0, properties_6 = properties; _i < properties_6.length; _i++) { + var targetProp = properties_6[_i]; var sourceProp = getPropertyOfObjectType(source, targetProp.name); if (sourceProp) { inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); @@ -32100,8 +34842,8 @@ var ts; } } function typeIdenticalToSomeType(type, types) { - for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { - var t = types_10[_i]; + for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { + var t = types_13[_i]; if (isTypeIdenticalTo(t, type)) { return true; } @@ -32151,11 +34893,20 @@ var ts; inferenceSucceeded = !!unionOrSuperType; } else { - // Infer the empty object type when no inferences were made. It is important to remember that - // in this case, inference still succeeds, meaning there is no error for not having inference - // candidates. An inference error only occurs when there are *conflicting* candidates, i.e. + // Infer either the default or the empty object type when no inferences were + // made. It is important to remember that in this case, inference still + // succeeds, meaning there is no error for not having inference candidates. An + // inference error only occurs when there are *conflicting* candidates, i.e. // candidates with no common supertype. - inferredType = emptyObjectType; + var defaultType = getDefaultFromTypeParameter(context.signature.typeParameters[index]); + if (defaultType) { + // Instantiate the default type. Any forward reference to a type + // parameter should be instantiated to the empty object type. + inferredType = instantiateType(defaultType, combineTypeMappers(createBackreferenceMapper(context.signature.typeParameters, index), getInferenceMapper(context))); + } + else { + inferredType = context.useAnyForNoInferences ? anyType : emptyObjectType; + } inferenceSucceeded = true; } context.inferredTypes[index] = inferredType; @@ -32196,19 +34947,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 3.6.3 // A type query consists of the keyword typeof followed by an expression. // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - while (node) { - switch (node.kind) { - case 160 /* TypeQuery */: - return true; - case 70 /* Identifier */: - case 141 /* QualifiedName */: - node = node.parent; - continue; - default: - return false; - } - } - ts.Debug.fail("should not get here"); + return !!ts.findAncestor(node, function (n) { return n.kind === 161 /* TypeQuery */ ? true : n.kind === 70 /* Identifier */ || n.kind === 142 /* QualifiedName */ ? false : "quit"; }); } // Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers // separated by dots). The key consists of the id of the symbol referenced by the @@ -32222,7 +34961,7 @@ var ts; if (node.kind === 98 /* ThisKeyword */) { return "0"; } - if (node.kind === 177 /* PropertyAccessExpression */) { + if (node.kind === 178 /* PropertyAccessExpression */) { var key = getFlowCacheKey(node.expression); return key && key + "." + node.name.text; } @@ -32233,7 +34972,7 @@ var ts; case 70 /* Identifier */: case 98 /* ThisKeyword */: return node; - case 177 /* PropertyAccessExpression */: + case 178 /* PropertyAccessExpression */: return getLeftmostIdentifierOrThis(node.expression); } return undefined; @@ -32242,19 +34981,21 @@ var ts; switch (source.kind) { case 70 /* Identifier */: return target.kind === 70 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 223 /* VariableDeclaration */ || target.kind === 174 /* BindingElement */) && + (target.kind === 225 /* VariableDeclaration */ || target.kind === 175 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 98 /* ThisKeyword */: return target.kind === 98 /* ThisKeyword */; - case 177 /* PropertyAccessExpression */: - return target.kind === 177 /* PropertyAccessExpression */ && + case 96 /* SuperKeyword */: + return target.kind === 96 /* SuperKeyword */; + case 178 /* PropertyAccessExpression */: + return target.kind === 178 /* PropertyAccessExpression */ && source.name.text === target.name.text && isMatchingReference(source.expression, target.expression); } return false; } function containsMatchingReference(source, target) { - while (source.kind === 177 /* PropertyAccessExpression */) { + while (source.kind === 178 /* PropertyAccessExpression */) { source = source.expression; if (isMatchingReference(source, target)) { return true; @@ -32267,7 +35008,7 @@ var ts; // a possible discriminant if its type differs in the constituents of containing union type, and if every // choice is a unit type or a union of unit types. function containsMatchingReferenceDiscriminant(source, target) { - return target.kind === 177 /* PropertyAccessExpression */ && + return target.kind === 178 /* PropertyAccessExpression */ && containsMatchingReference(source, target.expression) && isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.text); } @@ -32275,7 +35016,7 @@ var ts; if (expr.kind === 70 /* Identifier */) { return getTypeOfSymbol(getResolvedSymbol(expr)); } - if (expr.kind === 177 /* PropertyAccessExpression */) { + if (expr.kind === 178 /* PropertyAccessExpression */) { var type = getDeclaredTypeOfReference(expr.expression); return type && getTypeOfPropertyOfType(type, expr.name.text); } @@ -32284,9 +35025,9 @@ var ts; function isDiscriminantProperty(type, name) { if (type && type.flags & 65536 /* Union */) { var prop = getUnionOrIntersectionProperty(type, name); - if (prop && prop.flags & 268435456 /* SyntheticProperty */) { + if (prop && getCheckFlags(prop) & 2 /* SyntheticProperty */) { if (prop.isDiscriminantProperty === undefined) { - prop.isDiscriminantProperty = prop.hasNonUniformType && isLiteralType(getTypeOfSymbol(prop)); + prop.isDiscriminantProperty = prop.checkFlags & 32 /* HasNonUniformType */ && isLiteralType(getTypeOfSymbol(prop)); } return prop.isDiscriminantProperty; } @@ -32305,7 +35046,7 @@ var ts; } } } - if (callExpression.expression.kind === 177 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 178 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -32347,8 +35088,8 @@ var ts; } function getTypeFactsOfTypes(types) { var result = 0 /* None */; - for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { - var t = types_11[_i]; + for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { + var t = types_14[_i]; result |= getTypeFacts(t); } return result; @@ -32358,7 +35099,7 @@ var ts; // check. This gives us a quicker out in the common case where an object type is not a function. var resolved = resolveStructuredTypeMembers(type); return !!(resolved.callSignatures.length || resolved.constructSignatures.length || - resolved.members["bind"] && isTypeSubtypeOf(type, globalFunctionType)); + resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType)); } function getTypeFacts(type) { var flags = type.flags; @@ -32401,9 +35142,11 @@ var ts; if (flags & 512 /* ESSymbol */) { return strictNullChecks ? 1981320 /* SymbolStrictFacts */ : 4193160 /* SymbolFacts */; } - if (flags & 16384 /* TypeParameter */) { - var constraint = getConstraintOfTypeParameter(type); - return getTypeFacts(constraint || emptyObjectType); + if (flags & 16777216 /* NonPrimitive */) { + return strictNullChecks ? 6166480 /* ObjectStrictFacts */ : 8378320 /* ObjectFacts */; + } + if (flags & 540672 /* TypeVariable */) { + return getTypeFacts(getBaseConstraintOfType(type) || emptyObjectType); } if (flags & 196608 /* UnionOrIntersection */) { return getTypeFactsOfTypes(type.types); @@ -32429,17 +35172,23 @@ var ts; } function getTypeOfDestructuredArrayElement(type, index) { return isTupleLikeType(type) && getTypeOfPropertyOfType(type, "" + index) || - checkIteratedTypeOrElementType(type, /*errorNode*/ undefined, /*allowStringInput*/ false) || + checkIteratedTypeOrElementType(type, /*errorNode*/ undefined, /*allowStringInput*/ false, /*allowAsyncIterable*/ false) || unknownType; } function getTypeOfDestructuredSpreadExpression(type) { - return createArrayType(checkIteratedTypeOrElementType(type, /*errorNode*/ undefined, /*allowStringInput*/ false) || unknownType); + return createArrayType(checkIteratedTypeOrElementType(type, /*errorNode*/ undefined, /*allowStringInput*/ false, /*allowAsyncIterable*/ false) || unknownType); } function getAssignedTypeOfBinaryExpression(node) { - return node.parent.kind === 175 /* ArrayLiteralExpression */ || node.parent.kind === 257 /* PropertyAssignment */ ? + var isDestructuringDefaultAssignment = node.parent.kind === 176 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 260 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } + function isDestructuringAssignmentTarget(parent) { + return parent.parent.kind === 193 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 215 /* ForOfStatement */ && parent.parent.initializer === parent; + } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), ts.indexOf(node.elements, element)); } @@ -32455,21 +35204,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 212 /* ForInStatement */: + case 214 /* ForInStatement */: return stringType; - case 213 /* ForOfStatement */: - return checkRightHandSideOfForOf(parent.expression) || unknownType; - case 192 /* BinaryExpression */: + case 215 /* ForOfStatement */: + return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || unknownType; + case 193 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 186 /* DeleteExpression */: + case 187 /* DeleteExpression */: return undefinedType; - case 175 /* ArrayLiteralExpression */: + case 176 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 196 /* SpreadElement */: + case 197 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 257 /* PropertyAssignment */: + case 260 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 258 /* ShorthandPropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return unknownType; @@ -32477,7 +35226,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 172 /* ObjectBindingPattern */ ? + var type = pattern.kind === 173 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, ts.indexOf(pattern.elements, node)) : @@ -32495,35 +35244,35 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 212 /* ForInStatement */) { + if (node.parent.parent.kind === 214 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 213 /* ForOfStatement */) { - return checkRightHandSideOfForOf(node.parent.parent.expression) || unknownType; + if (node.parent.parent.kind === 215 /* ForOfStatement */) { + return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || unknownType; } return unknownType; } function getInitialType(node) { - return node.kind === 223 /* VariableDeclaration */ ? + return node.kind === 225 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function getInitialOrAssignedType(node) { - return node.kind === 223 /* VariableDeclaration */ || node.kind === 174 /* BindingElement */ ? + return node.kind === 225 /* VariableDeclaration */ || node.kind === 175 /* BindingElement */ ? getInitialType(node) : getAssignedType(node); } function isEmptyArrayAssignment(node) { - return node.kind === 223 /* VariableDeclaration */ && node.initializer && + return node.kind === 225 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 174 /* BindingElement */ && node.parent.kind === 192 /* BinaryExpression */ && + node.kind !== 175 /* BindingElement */ && node.parent.kind === 193 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: switch (node.operatorToken.kind) { case 57 /* EqualsToken */: return getReferenceCandidate(node.left); @@ -32535,13 +35284,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 183 /* ParenthesizedExpression */ || - parent.kind === 192 /* BinaryExpression */ && parent.operatorToken.kind === 57 /* EqualsToken */ && parent.left === node || - parent.kind === 192 /* BinaryExpression */ && parent.operatorToken.kind === 25 /* CommaToken */ && parent.right === node ? + return parent.kind === 184 /* ParenthesizedExpression */ || + parent.kind === 193 /* BinaryExpression */ && parent.operatorToken.kind === 57 /* EqualsToken */ && parent.left === node || + parent.kind === 193 /* BinaryExpression */ && parent.operatorToken.kind === 25 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 253 /* CaseClause */) { + if (clause.kind === 256 /* CaseClause */) { var caseType = getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); return isUnitType(caseType) ? caseType : undefined; } @@ -32589,8 +35338,32 @@ var ts; } return f(type) ? type : neverType; } - function mapType(type, f) { - return type.flags & 65536 /* Union */ ? getUnionType(ts.map(type.types, f)) : f(type); + // Apply a mapping function to a type and return the resulting type. If the source type + // is a union type, the mapping function is applied to each constituent type and a union + // of the resulting types is returned. + function mapType(type, mapper) { + if (!(type.flags & 65536 /* Union */)) { + return mapper(type); + } + var types = type.types; + var mappedType; + var mappedTypes; + for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { + var current = types_15[_i]; + var t = mapper(current); + if (t) { + if (!mappedType) { + mappedType = t; + } + else if (!mappedTypes) { + mappedTypes = [mappedType, t]; + } + else { + mappedTypes.push(t); + } + } + } + return mappedTypes ? getUnionType(mappedTypes) : mappedType; } function extractTypesOfKind(type, kind) { return filterType(type, function (t) { return (t.flags & kind) !== 0; }); @@ -32634,7 +35407,7 @@ var ts; // we defer subtype reduction until the evolving array type is finalized into a manifest // array type. function addEvolvingArrayElementType(evolvingArrayType, node) { - var elementType = getBaseTypeOfLiteralType(getTypeOfExpression(node)); + var elementType = getBaseTypeOfLiteralType(getContextFreeTypeOfExpression(node)); return isTypeSubsetOf(elementType, evolvingArrayType.elementType) ? evolvingArrayType : getEvolvingArrayType(getUnionType([evolvingArrayType.elementType, elementType])); } function createFinalArrayType(elementType) { @@ -32656,8 +35429,8 @@ var ts; } function isEvolvingArrayTypeList(types) { var hasEvolvingArrayType = false; - for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { - var t = types_12[_i]; + for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { + var t = types_16[_i]; if (!(t.flags & 8192 /* Never */)) { if (!(getObjectFlags(t) & 256 /* EvolvingArray */)) { return false; @@ -32680,11 +35453,11 @@ var ts; function isEvolvingArrayOperationTarget(node) { var root = getReferenceRoot(node); var parent = root.parent; - var isLengthPushOrUnshift = parent.kind === 177 /* PropertyAccessExpression */ && (parent.name.text === "length" || - parent.parent.kind === 179 /* CallExpression */ && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 178 /* ElementAccessExpression */ && + var isLengthPushOrUnshift = parent.kind === 178 /* PropertyAccessExpression */ && (parent.name.text === "length" || + parent.parent.kind === 180 /* CallExpression */ && ts.isPushOrUnshiftIdentifier(parent.name)); + var isElementAssignment = parent.kind === 179 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 192 /* BinaryExpression */ && + parent.parent.kind === 193 /* BinaryExpression */ && parent.parent.operatorToken.kind === 57 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -32711,14 +35484,12 @@ var ts; } return false; } - function getFlowTypeOfReference(reference, declaredType, assumeInitialized, flowContainer) { + function getFlowTypeOfReference(reference, declaredType, initialType, flowContainer, couldBeUninitialized) { + if (initialType === void 0) { initialType = declaredType; } var key; - if (!reference.flowNode || assumeInitialized && !(declaredType.flags & 1033215 /* Narrowable */)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 17810431 /* Narrowable */)) { return declaredType; } - var initialType = assumeInitialized ? declaredType : - declaredType === autoType || declaredType === autoArrayType ? undefinedType : - includeFalsyTypes(declaredType, 2048 /* Undefined */); var visitedFlowStart = visitedFlowCount; var evolvedType = getTypeFromFlowType(getTypeAtFlowNode(reference.flowNode)); visitedFlowCount = visitedFlowStart; @@ -32727,7 +35498,7 @@ var ts; // on empty arrays are possible without implicit any errors and new element types can be inferred without // type mismatch errors. var resultType = getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? anyArrayType : finalizeEvolvingArrayType(evolvedType); - if (reference.parent.kind === 201 /* NonNullExpression */ && getTypeWithFacts(resultType, 524288 /* NEUndefinedOrNull */).flags & 8192 /* Never */) { + if (reference.parent.kind === 202 /* NonNullExpression */ && getTypeWithFacts(resultType, 524288 /* NEUndefinedOrNull */).flags & 8192 /* Never */) { return declaredType; } return resultType; @@ -32744,7 +35515,19 @@ var ts; } } var type = void 0; - if (flow.flags & 16 /* Assignment */) { + if (flow.flags & 4096 /* AfterFinally */) { + // block flow edge: finally -> pre-try (for larger explanation check comment in binder.ts - bindTryStatement + flow.locked = true; + type = getTypeAtFlowNode(flow.antecedent); + flow.locked = false; + } + else if (flow.flags & 2048 /* PreFinally */) { + // locked pre-finally flows are filtered out in getTypeAtFlowBranchLabel + // so here just redirect to antecedent + flow = flow.antecedent; + continue; + } + else if (flow.flags & 16 /* Assignment */) { type = getTypeAtFlowAssignment(flow); if (!type) { flow = flow.antecedent; @@ -32776,7 +35559,7 @@ var ts; else if (flow.flags & 2 /* Start */) { // Check if we should continue with the control flow of the containing function. var container = flow.container; - if (container && container !== flowContainer && reference.kind !== 177 /* PropertyAccessExpression */) { + if (container && container !== flowContainer && reference.kind !== 178 /* PropertyAccessExpression */ && reference.kind !== 98 /* ThisKeyword */) { flow = container.flowNode; continue; } @@ -32830,7 +35613,7 @@ var ts; } function getTypeAtFlowArrayMutation(flow) { var node = flow.node; - var expr = node.kind === 179 /* CallExpression */ ? + var expr = node.kind === 180 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -32838,7 +35621,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 179 /* CallExpression */) { + if (node.kind === 180 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -32897,6 +35680,12 @@ var ts; var seenIncomplete = false; for (var _i = 0, _a = flow.antecedents; _i < _a.length; _i++) { var antecedent = _a[_i]; + if (antecedent.flags & 2048 /* PreFinally */ && antecedent.lock.locked) { + // if flow correspond to branch from pre-try to finally and this branch is locked - this means that + // we initially have started following the flow outside the finally block. + // in this case we should ignore this branch. + continue; + } var flowType = getTypeAtFlowNode(antecedent); var type = getTypeFromFlowType(flowType); // If the type at a particular antecedent path is the declared type and the @@ -32929,8 +35718,9 @@ var ts; if (!key) { key = getFlowCacheKey(reference); } - if (cache[key]) { - return cache[key]; + var cached = cache.get(key); + if (cached) { + return cached; } // If this flow loop junction and reference are already being processed, return // the union of the types computed for each branch so far, marked as incomplete. @@ -32965,8 +35755,9 @@ var ts; // If we see a value appear in the cache it is a sign that control flow analysis // was restarted and completed by checkExpressionCached. We can simply pick up // the resulting type and bail out. - if (cache[key]) { - return cache[key]; + var cached_1 = cache.get(key); + if (cached_1) { + return cached_1; } if (!ts.contains(antecedentTypes, type)) { antecedentTypes.push(type); @@ -32990,10 +35781,11 @@ var ts; if (isIncomplete(firstAntecedentType)) { return createFlowType(result, /*incomplete*/ true); } - return cache[key] = result; + cache.set(key, result); + return result; } function isMatchingReferenceDiscriminant(expr) { - return expr.kind === 177 /* PropertyAccessExpression */ && + return expr.kind === 178 /* PropertyAccessExpression */ && declaredType.flags & 65536 /* Union */ && isMatchingReference(reference, expr.expression) && isDiscriminantProperty(declaredType, expr.name.text); @@ -33027,10 +35819,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 187 /* TypeOfExpression */ && right_1.kind === 9 /* StringLiteral */) { + if (left_1.kind === 188 /* TypeOfExpression */ && right_1.kind === 9 /* StringLiteral */) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 187 /* TypeOfExpression */ && left_1.kind === 9 /* StringLiteral */) { + if (right_1.kind === 188 /* TypeOfExpression */ && left_1.kind === 9 /* StringLiteral */) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (isMatchingReference(reference, left_1)) { @@ -33076,7 +35868,7 @@ var ts; assumeTrue ? 16384 /* EQUndefined */ : 131072 /* NEUndefined */; return getTypeWithFacts(type, facts); } - if (type.flags & 33281 /* NotUnionOrUnit */) { + if (type.flags & 16810497 /* NotUnionOrUnit */) { return type; } if (assumeTrue) { @@ -33107,14 +35899,22 @@ var ts; // We narrow a non-union type to an exact primitive type if the non-union type // is a supertype of that primitive type. For example, type 'any' can be narrowed // to one of the primitive types. - var targetType = typeofTypesByName[literal.text]; - if (targetType && isTypeSubtypeOf(targetType, type)) { - return targetType; + var targetType = typeofTypesByName.get(literal.text); + if (targetType) { + if (isTypeSubtypeOf(targetType, type)) { + return targetType; + } + if (type.flags & 540672 /* TypeVariable */) { + var constraint = getBaseConstraintOfType(type) || anyType; + if (isTypeSubtypeOf(targetType, constraint)) { + return getIntersectionType([type, targetType]); + } + } } } var facts = assumeTrue ? - typeofEQFacts[literal.text] || 64 /* TypeofEQHostObject */ : - typeofNEFacts[literal.text] || 8192 /* TypeofNEHostObject */; + typeofEQFacts.get(literal.text) || 64 /* TypeofEQHostObject */ : + typeofNEFacts.get(literal.text) || 8192 /* TypeofNEHostObject */; return getTypeWithFacts(type, facts); } function narrowTypeBySwitchOnDiscriminant(type, switchStatement, clauseStart, clauseEnd) { @@ -33197,10 +35997,9 @@ var ts; // Otherwise, if the candidate type is assignable to the target type, narrow to the candidate // type. Otherwise, the types are completely unrelated, so narrow to an intersection of the // two types. - var targetType = type.flags & 16384 /* TypeParameter */ ? getApparentType(type) : type; return isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : - isTypeAssignableTo(candidate, targetType) ? candidate : + isTypeAssignableTo(candidate, type) ? candidate : getIntersectionType([type, candidate]); } function narrowTypeByTypePredicate(type, callExpression, assumeTrue) { @@ -33229,7 +36028,7 @@ var ts; } else { var invokedExpression = ts.skipParentheses(callExpression.expression); - if (invokedExpression.kind === 178 /* ElementAccessExpression */ || invokedExpression.kind === 177 /* PropertyAccessExpression */) { + if (invokedExpression.kind === 179 /* ElementAccessExpression */ || invokedExpression.kind === 178 /* PropertyAccessExpression */) { var accessExpression = invokedExpression; var possibleReference = ts.skipParentheses(accessExpression.expression); if (isMatchingReference(reference, possibleReference)) { @@ -33248,15 +36047,16 @@ var ts; switch (expr.kind) { case 70 /* Identifier */: case 98 /* ThisKeyword */: - case 177 /* PropertyAccessExpression */: + case 96 /* SuperKeyword */: + case 178 /* PropertyAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 179 /* CallExpression */: + case 180 /* CallExpression */: return narrowTypeByTypePredicate(type, expr, assumeTrue); - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 190 /* PrefixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: if (expr.operator === 50 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -33289,15 +36089,12 @@ var ts; return getTypeOfSymbol(symbol); } function getControlFlowContainer(node) { - while (true) { - node = node.parent; - if (ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 231 /* ModuleBlock */ || - node.kind === 261 /* SourceFile */ || - node.kind === 147 /* PropertyDeclaration */) { - return node; - } - } + return ts.findAncestor(node.parent, function (node) { + return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || + node.kind === 233 /* ModuleBlock */ || + node.kind === 264 /* SourceFile */ || + node.kind === 148 /* PropertyDeclaration */; + }); } // Check if a parameter is assigned anywhere within its declaring function. function isParameterAssigned(symbol) { @@ -33312,21 +36109,13 @@ var ts; return symbol.isAssigned || false; } function hasParentWithAssignmentsMarked(node) { - while (true) { - node = node.parent; - if (!node) { - return false; - } - if (ts.isFunctionLike(node) && getNodeLinks(node).flags & 4194304 /* AssignmentsMarked */) { - return true; - } - } + return !!ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !!(getNodeLinks(node).flags & 4194304 /* AssignmentsMarked */); }); } function markParameterAssignments(node) { if (node.kind === 70 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 144 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 145 /* Parameter */) { symbol.isAssigned = true; } } @@ -33338,6 +36127,15 @@ var ts; function isConstVariable(symbol) { return symbol.flags & 3 /* Variable */ && (getDeclarationNodeFlagsFromSymbol(symbol) & 2 /* Const */) !== 0 && getTypeOfSymbol(symbol) !== autoArrayType; } + /** remove undefined from the annotated type of a parameter when there is an initializer (that doesn't include undefined) */ + function removeOptionalityFromDeclaredType(declaredType, declaration) { + var annotationIncludesUndefined = strictNullChecks && + declaration.kind === 145 /* Parameter */ && + declaration.initializer && + getFalsyFlags(declaredType) & 2048 /* Undefined */ && + !(getFalsyFlags(checkExpression(declaration.initializer)) & 2048 /* Undefined */); + return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 131072 /* NEUndefined */) : declaredType; + } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); if (symbol === unknownSymbol) { @@ -33352,16 +36150,14 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 185 /* ArrowFunction */) { + if (container.kind === 186 /* ArrowFunction */) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasModifier(container, 256 /* Async */)) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method); } } - if (node.flags & 524288 /* AwaitContext */) { - getNodeLinks(container).flags |= 8192 /* CaptureArguments */; - } + getNodeLinks(container).flags |= 8192 /* CaptureArguments */; return getTypeOfSymbol(symbol); } if (symbol.flags & 8388608 /* Alias */ && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { @@ -33373,7 +36169,7 @@ var ts; // Due to the emit for class decorators, any reference to the class from inside of the class body // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind // behavior of class names in ES6. - if (declaration_1.kind === 226 /* ClassDeclaration */ + if (declaration_1.kind === 228 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration_1)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -33385,14 +36181,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration_1.kind === 197 /* ClassExpression */) { + else if (declaration_1.kind === 198 /* ClassExpression */) { // When we emit a class expression with static members that contain a reference // to the constructor in the initializer, we will need to substitute that // binding with an alias as the class name is not in scope. var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); while (container !== undefined) { if (container.parent === declaration_1) { - if (container.kind === 147 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { + if (container.kind === 148 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { getNodeLinks(declaration_1).flags |= 8388608 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 16777216 /* ConstructorReferenceInClass */; } @@ -33404,6 +36200,7 @@ var ts; } checkCollisionWithCapturedSuperVariable(node, node); checkCollisionWithCapturedThisVariable(node, node); + checkCollisionWithCapturedNewTargetVariable(node, node); checkNestedBlockScopedBinding(node, symbol); var type = getTypeOfSymbol(localOrExportSymbol); var declaration = localOrExportSymbol.valueDeclaration; @@ -33426,15 +36223,15 @@ var ts; // The declaration container is the innermost function that encloses the declaration of the variable // or parameter. The flow container is the innermost function starting with which we analyze the control // flow graph to determine the control flow based type. - var isParameter = ts.getRootDeclaration(declaration).kind === 144 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 145 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. - while (flowContainer !== declarationContainer && (flowContainer.kind === 184 /* FunctionExpression */ || - flowContainer.kind === 185 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 185 /* FunctionExpression */ || + flowContainer.kind === 186 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } @@ -33442,15 +36239,18 @@ var ts; // the entire control flow graph from the variable's declaration (i.e. when the flow container and // declaration container are the same). var assumeInitialized = isParameter || isOuterVariable || - type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1 /* Any */) !== 0) || + type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1 /* Any */) !== 0 || isInTypeQuery(node)) || ts.isInAmbientContext(declaration); - var flowType = getFlowTypeOfReference(node, type, assumeInitialized, flowContainer); + var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, ts.getRootDeclaration(declaration)) : type) : + type === autoType || type === autoArrayType ? undefinedType : + includeFalsyTypes(type, 2048 /* Undefined */); + var flowType = getFlowTypeOfReference(node, type, initialType, flowContainer, !assumeInitialized); // A variable is considered uninitialized when it is possible to analyze the entire control flow graph // from declaration to use, and when the variable's declared type doesn't include undefined but the // control flow based type does include undefined. if (type === autoType || type === autoArrayType) { if (flowType === autoType || flowType === autoArrayType) { - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { error(declaration.name, ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined, symbolToString(symbol), typeToString(flowType)); error(node, ts.Diagnostics.Variable_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType)); } @@ -33465,19 +36265,12 @@ var ts; return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType; } function isInsideFunction(node, threshold) { - var current = node; - while (current && current !== threshold) { - if (ts.isFunctionLike(current)) { - return true; - } - current = current.parent; - } - return false; + return !!ts.findAncestor(node, function (n) { return n === threshold ? "quit" : ts.isFunctionLike(n); }); } function checkNestedBlockScopedBinding(node, symbol) { if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || - symbol.valueDeclaration.parent.kind === 256 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 259 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -33502,8 +36295,8 @@ var ts; } // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement. // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back. - if (container.kind === 211 /* ForStatement */ && - ts.getAncestor(symbol.valueDeclaration, 224 /* VariableDeclarationList */).parent === container && + if (container.kind === 213 /* ForStatement */ && + ts.getAncestor(symbol.valueDeclaration, 226 /* VariableDeclarationList */).parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 2097152 /* NeedsLoopOutParameter */; } @@ -33515,9 +36308,9 @@ var ts; } } function isAssignedInBodyOfForStatement(node, container) { - var current = node; // skip parenthesized nodes - while (current.parent.kind === 183 /* ParenthesizedExpression */) { + var current = node; + while (current.parent.kind === 184 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -33525,7 +36318,7 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 190 /* PrefixUnaryExpression */ || current.parent.kind === 191 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 191 /* PrefixUnaryExpression */ || current.parent.kind === 192 /* PostfixUnaryExpression */)) { var expr = current.parent; isAssigned = expr.operator === 42 /* PlusPlusToken */ || expr.operator === 43 /* MinusMinusToken */; } @@ -33534,19 +36327,11 @@ var ts; } // at this point we know that node is the target of assignment // now check that modification happens inside the statement part of the ForStatement - while (current !== container) { - if (current === container.statement) { - return true; - } - else { - current = current.parent; - } - } - return false; + return !!ts.findAncestor(current, function (n) { return n === container ? "quit" : n === container.statement; }); } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 147 /* PropertyDeclaration */ || container.kind === 150 /* Constructor */) { + if (container.kind === 148 /* PropertyDeclaration */ || container.kind === 151 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -33589,58 +36374,63 @@ var ts; var baseConstructorType = getBaseConstructorTypeOfClass(classInstanceType); return baseConstructorType === nullWideningType; } + function checkThisBeforeSuper(node, container, diagnosticMessage) { + var containingClassDecl = container.parent; + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(containingClassDecl); + // If a containing class does not have extends clause or the class extends null + // skip checking whether super statement is called before "this" accessing. + if (baseTypeNode && !classDeclarationExtendsNull(containingClassDecl)) { + var superCall = getSuperCallInConstructor(container); + // We should give an error in the following cases: + // - No super-call + // - "this" is accessing before super-call. + // i.e super(this) + // this.x; super(); + // We want to make sure that super-call is done before accessing "this" so that + // "this" is not accessed as a parameter of the super-call. + if (!superCall || superCall.end > node.pos) { + // In ES6, super inside constructor of class-declaration has to precede "this" accessing + error(node, diagnosticMessage); + } + } + } function checkThisExpression(node) { // Stop at the first arrow function so that we can // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var needToCaptureLexicalThis = false; - if (container.kind === 150 /* Constructor */) { - var containingClassDecl = container.parent; - var baseTypeNode = ts.getClassExtendsHeritageClauseElement(containingClassDecl); - // If a containing class does not have extends clause or the class extends null - // skip checking whether super statement is called before "this" accessing. - if (baseTypeNode && !classDeclarationExtendsNull(containingClassDecl)) { - var superCall = getSuperCallInConstructor(container); - // We should give an error in the following cases: - // - No super-call - // - "this" is accessing before super-call. - // i.e super(this) - // this.x; super(); - // We want to make sure that super-call is done before accessing "this" so that - // "this" is not accessed as a parameter of the super-call. - if (!superCall || superCall.end > node.pos) { - // In ES6, super inside constructor of class-declaration has to precede "this" accessing - error(node, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); - } - } + if (container.kind === 151 /* Constructor */) { + checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 185 /* ArrowFunction */) { + if (container.kind === 186 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); // When targeting es6, arrow function lexically bind "this" so we do not need to do the work of binding "this" in emitted code needToCaptureLexicalThis = (languageVersion < 2 /* ES2015 */); } switch (container.kind) { - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 150 /* Constructor */: + case 151 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); + // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: if (ts.getModifierFlags(container) & 32 /* Static */) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); + // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 142 /* ComputedPropertyName */: + case 143 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -33652,8 +36442,8 @@ var ts; // Note: a parameter initializer should refer to class-this unless function-this is explicitly annotated. // If this is a function in a JS file, it might be a class method. Check if it's the RHS // of a x.prototype.y = function [name]() { .... } - if (container.kind === 184 /* FunctionExpression */ && - ts.isInJavaScriptFile(container.parent) && + if (container.kind === 185 /* FunctionExpression */ && + container.parent.kind === 193 /* BinaryExpression */ && ts.getSpecialPropertyAssignmentKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = f' (here, 'f' is 'container') var className = container.parent // x.prototype.y = f @@ -33673,7 +36463,7 @@ var ts; if (ts.isClassLike(container.parent)) { var symbol = getSymbolOfNode(container.parent); var type = ts.hasModifier(container, 32 /* Static */) ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType; - return getFlowTypeOfReference(node, type, /*assumeInitialized*/ true, /*flowContainer*/ undefined); + return getFlowTypeOfReference(node, type); } if (ts.isInJavaScriptFile(node)) { var type = getTypeForThisExpressionFromJSDoc(container); @@ -33681,7 +36471,7 @@ var ts; return type; } } - if (compilerOptions.noImplicitThis) { + if (noImplicitThis) { // With noImplicitThis, functions may not reference 'this' if it has type 'any' error(node, ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation); } @@ -33689,28 +36479,23 @@ var ts; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 274 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 278 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; - if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].type.kind === 277 /* JSDocThisType */) { + if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].type.kind === 281 /* JSDocThisType */) { return getTypeFromTypeNode(jsDocFunctionType.parameters[0].type); } } } function isInConstructorArgumentInitializer(node, constructorDecl) { - for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 144 /* Parameter */) { - return true; - } - } - return false; + return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 145 /* Parameter */; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 179 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 180 /* CallExpression */ && node.parent.expression === node; var container = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var needToCaptureLexicalThis = false; // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting if (!isCallExpression) { - while (container && container.kind === 185 /* ArrowFunction */) { + while (container && container.kind === 186 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -33723,17 +36508,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = node; - while (current && current !== container && current.kind !== 142 /* ComputedPropertyName */) { - current = current.parent; - } - if (current && current.kind === 142 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 143 /* ComputedPropertyName */; }); + if (current && current.kind === 143 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 176 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 177 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -33741,6 +36523,9 @@ var ts; } return unknownType; } + if (!isCallExpression && container.kind === 151 /* Constructor */) { + checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); + } if ((ts.getModifierFlags(container) & 32 /* Static */) || isCallExpression) { nodeCheckFlag = 512 /* SuperStatic */; } @@ -33804,7 +36589,7 @@ var ts; // This helper creates an object with a "value" property that wraps the `super` property or indexed access for both get and set. // This is required for destructuring assignments, as a call expression cannot be used as the target of a destructuring assignment // while a property access can. - if (container.kind === 149 /* MethodDeclaration */ && ts.getModifierFlags(container) & 256 /* Async */) { + if (container.kind === 150 /* MethodDeclaration */ && ts.getModifierFlags(container) & 256 /* Async */) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -33818,7 +36603,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 176 /* ObjectLiteralExpression */) { + if (container.parent.kind === 177 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return unknownType; @@ -33838,7 +36623,7 @@ var ts; } return unknownType; } - if (container.kind === 150 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 151 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return unknownType; @@ -33853,7 +36638,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 150 /* Constructor */; + return container.kind === 151 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -33861,29 +36646,47 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 176 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 177 /* ObjectLiteralExpression */) { if (ts.getModifierFlags(container) & 32 /* Static */) { - return container.kind === 149 /* MethodDeclaration */ || - container.kind === 148 /* MethodSignature */ || - container.kind === 151 /* GetAccessor */ || - container.kind === 152 /* SetAccessor */; + return container.kind === 150 /* MethodDeclaration */ || + container.kind === 149 /* MethodSignature */ || + container.kind === 152 /* GetAccessor */ || + container.kind === 153 /* SetAccessor */; } else { - return container.kind === 149 /* MethodDeclaration */ || - container.kind === 148 /* MethodSignature */ || - container.kind === 151 /* GetAccessor */ || - container.kind === 152 /* SetAccessor */ || - container.kind === 147 /* PropertyDeclaration */ || - container.kind === 146 /* PropertySignature */ || - container.kind === 150 /* Constructor */; + return container.kind === 150 /* MethodDeclaration */ || + container.kind === 149 /* MethodSignature */ || + container.kind === 152 /* GetAccessor */ || + container.kind === 153 /* SetAccessor */ || + container.kind === 148 /* PropertyDeclaration */ || + container.kind === 147 /* PropertySignature */ || + container.kind === 151 /* Constructor */; } } } return false; } } + function getContainingObjectLiteral(func) { + return (func.kind === 150 /* MethodDeclaration */ || + func.kind === 152 /* GetAccessor */ || + func.kind === 153 /* SetAccessor */) && func.parent.kind === 177 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 185 /* FunctionExpression */ && func.parent.kind === 260 /* PropertyAssignment */ ? func.parent.parent : + undefined; + } + function getThisTypeArgument(type) { + return getObjectFlags(type) & 4 /* Reference */ && type.target === globalThisType ? type.typeArguments[0] : undefined; + } + function getThisTypeFromContextualType(type) { + return mapType(type, function (t) { + return t.flags & 131072 /* Intersection */ ? ts.forEach(t.types, getThisTypeArgument) : getThisTypeArgument(t); + }); + } function getContextualThisParameterType(func) { - if (isContextSensitiveFunctionOrObjectLiteralMethod(func) && func.kind !== 185 /* ArrowFunction */) { + if (func.kind === 186 /* ArrowFunction */) { + return undefined; + } + if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { var contextualSignature = getContextualSignature(func); if (contextualSignature) { var thisParameter = contextualSignature.thisParameter; @@ -33892,6 +36695,40 @@ var ts; } } } + if (noImplicitThis) { + var containingLiteral = getContainingObjectLiteral(func); + if (containingLiteral) { + // We have an object literal method. Check if the containing object literal has a contextual type + // that includes a ThisType. If so, T is the contextual type for 'this'. We continue looking in + // any directly enclosing object literals. + var contextualType = getApparentTypeOfContextualType(containingLiteral); + var literal = containingLiteral; + var type = contextualType; + while (type) { + var thisType = getThisTypeFromContextualType(type); + if (thisType) { + return instantiateType(thisType, getContextualMapper(containingLiteral)); + } + if (literal.parent.kind !== 260 /* PropertyAssignment */) { + break; + } + literal = literal.parent.parent; + type = getApparentTypeOfContextualType(literal); + } + // There was no contextual ThisType for the containing object literal, so the contextual type + // for 'this' is the non-null form of the contextual type for the containing object literal or + // the type of the object literal itself. + return contextualType ? getNonNullableType(contextualType) : checkExpressionCached(containingLiteral); + } + // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the + // contextual type for 'this' is 'obj'. + if (func.parent.kind === 193 /* BinaryExpression */ && func.parent.operatorToken.kind === 57 /* EqualsToken */) { + var target = func.parent.left; + if (target.kind === 178 /* PropertyAccessExpression */ || target.kind === 179 /* ElementAccessExpression */) { + return checkExpressionCached(target.expression); + } + } + } return undefined; } // Return contextual type of parameter or undefined if no contextual type is available @@ -33899,23 +36736,23 @@ var ts; var func = parameter.parent; if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { var iife = ts.getImmediatelyInvokedFunctionExpression(func); - if (iife) { + if (iife && iife.arguments) { var indexOfParameter = ts.indexOf(func.parameters, parameter); - if (iife.arguments && indexOfParameter < iife.arguments.length) { - if (parameter.dotDotDotToken) { - var restTypes = []; - for (var i = indexOfParameter; i < iife.arguments.length; i++) { - restTypes.push(getWidenedLiteralType(checkExpression(iife.arguments[i]))); - } - return createArrayType(getUnionType(restTypes)); + if (parameter.dotDotDotToken) { + var restTypes = []; + for (var i = indexOfParameter; i < iife.arguments.length; i++) { + restTypes.push(getWidenedLiteralType(checkExpression(iife.arguments[i]))); } - var links = getNodeLinks(iife); - var cached = links.resolvedSignature; - links.resolvedSignature = anySignature; - var type = getWidenedLiteralType(checkExpression(iife.arguments[indexOfParameter])); - links.resolvedSignature = cached; - return type; + return restTypes.length ? createArrayType(getUnionType(restTypes)) : undefined; } + var links = getNodeLinks(iife); + var cached = links.resolvedSignature; + links.resolvedSignature = anySignature; + var type = indexOfParameter < iife.arguments.length ? + getWidenedLiteralType(checkExpression(iife.arguments[indexOfParameter])) : + parameter.initializer ? undefined : undefinedWideningType; + links.resolvedSignature = cached; + return type; } var contextualSignature = getContextualSignature(func); if (contextualSignature) { @@ -33949,7 +36786,7 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 144 /* Parameter */) { + if (declaration.kind === 145 /* Parameter */) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -33960,11 +36797,11 @@ var ts; } if (ts.isBindingPattern(declaration.parent)) { var parentDeclaration = declaration.parent.parent; - var name_19 = declaration.propertyName || declaration.name; - if (ts.isVariableLike(parentDeclaration) && + var name = declaration.propertyName || declaration.name; + if (parentDeclaration.kind !== 175 /* BindingElement */ && parentDeclaration.type && - !ts.isBindingPattern(name_19)) { - var text = ts.getTextOfPropertyName(name_19); + !ts.isBindingPattern(name)) { + var text = ts.getTextOfPropertyName(name); if (text) { return getTypeOfPropertyOfType(getTypeFromTypeNode(parentDeclaration.type), text); } @@ -33975,33 +36812,34 @@ var ts; } function getContextualTypeForReturnExpression(node) { var func = ts.getContainingFunction(node); - if (ts.isAsyncFunctionLike(func)) { - var contextualReturnType = getContextualReturnType(func); - if (contextualReturnType) { - return getPromisedType(contextualReturnType); + if (func) { + var functionFlags = ts.getFunctionFlags(func); + if (functionFlags & 1 /* Generator */) { + return undefined; } - return undefined; - } - if (func && !func.asteriskToken) { - return getContextualReturnType(func); + var contextualReturnType = getContextualReturnType(func); + return functionFlags & 2 /* Async */ + ? contextualReturnType && getAwaitedTypeOfPromise(contextualReturnType) // Async function + : contextualReturnType; // Regular function } return undefined; } function getContextualTypeForYieldOperand(node) { var func = ts.getContainingFunction(node); if (func) { + var functionFlags = ts.getFunctionFlags(func); var contextualReturnType = getContextualReturnType(func); if (contextualReturnType) { return node.asteriskToken ? contextualReturnType - : getElementTypeOfIterableIterator(contextualReturnType); + : getIteratedTypeOfGenerator(contextualReturnType, (functionFlags & 2 /* Async */) !== 0); } } return undefined; } function isInParameterInitializerBeforeContainingFunction(node) { while (node.parent && !ts.isFunctionLike(node.parent)) { - if (node.parent.kind === 144 /* Parameter */ && node.parent.initializer === node) { + if (node.parent.kind === 145 /* Parameter */ && node.parent.initializer === node) { return true; } node = node.parent; @@ -34012,8 +36850,8 @@ var ts; // If the containing function has a return type annotation, is a constructor, or is a get accessor whose // corresponding set accessor has a type annotation, return statements in the function are contextually typed if (functionDecl.type || - functionDecl.kind === 150 /* Constructor */ || - functionDecl.kind === 151 /* GetAccessor */ && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 152 /* SetAccessor */))) { + functionDecl.kind === 151 /* Constructor */ || + functionDecl.kind === 152 /* GetAccessor */ && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 153 /* SetAccessor */))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl)); } // Otherwise, if the containing function is contextually typed by a function type with exactly one call signature @@ -34035,7 +36873,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 181 /* TaggedTemplateExpression */) { + if (template.parent.kind === 182 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -34069,41 +36907,14 @@ var ts; } return undefined; } - // Apply a mapping function to a contextual type and return the resulting type. If the contextual type - // is a union type, the mapping function is applied to each constituent type and a union of the resulting - // types is returned. - function applyToContextualType(type, mapper) { - if (!(type.flags & 65536 /* Union */)) { - return mapper(type); - } - var types = type.types; - var mappedType; - var mappedTypes; - for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { - var current = types_13[_i]; - var t = mapper(current); - if (t) { - if (!mappedType) { - mappedType = t; - } - else if (!mappedTypes) { - mappedTypes = [mappedType, t]; - } - else { - mappedTypes.push(t); - } - } - } - return mappedTypes ? getUnionType(mappedTypes) : mappedType; - } function getTypeOfPropertyOfContextualType(type, name) { - return applyToContextualType(type, function (t) { + return mapType(type, function (t) { var prop = t.flags & 229376 /* StructuredType */ ? getPropertyOfType(t, name) : undefined; return prop ? getTypeOfSymbol(prop) : undefined; }); } function getIndexTypeOfContextualType(type, kind) { - return applyToContextualType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }); + return mapType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }); } // Return true if the given contextual type is a tuple-like type function contextualTypeIsTupleLikeType(type) { @@ -34150,7 +36961,7 @@ var ts; var index = ts.indexOf(arrayLiteral.elements, node); return getTypeOfPropertyOfContextualType(type, "" + index) || getIndexTypeOfContextualType(type, 1 /* Number */) - || (languageVersion >= 2 /* ES2015 */ ? getElementTypeOfIterable(type, /*errorNode*/ undefined) : undefined); + || getIteratedTypeOrElementType(type, /*errorNode*/ undefined, /*allowStringInput*/ false, /*allowAsyncIterable*/ false, /*checkAssignability*/ false); } return undefined; } @@ -34160,19 +36971,19 @@ var ts; return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; } function getContextualTypeForJsxAttribute(attribute) { - var kind = attribute.kind; - var jsxElement = attribute.parent; - var attrsType = getJsxElementAttributesType(jsxElement); - if (attribute.kind === 250 /* JsxAttribute */) { - if (!attrsType || isTypeAny(attrsType)) { + // When we trying to resolve JsxOpeningLikeElement as a stateless function element, we will already give its attributes a contextual type + // which is a type of the parameter of the signature we are trying out. + // If there is no contextual type (e.g. we are trying to resolve stateful component), get attributes type from resolving element's tagName + var attributesType = getContextualType(attribute.parent); + if (ts.isJsxAttribute(attribute)) { + if (!attributesType || isTypeAny(attributesType)) { return undefined; } - return getTypeOfPropertyOfType(attrsType, attribute.name.text); + return getTypeOfPropertyOfType(attributesType, attribute.name.text); } - else if (attribute.kind === 251 /* JsxSpreadAttribute */) { - return attrsType; + else { + return attributesType; } - ts.Debug.fail("Expected JsxAttribute or JsxSpreadAttribute, got ts.SyntaxKind[" + kind + "]"); } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily // be "pushed" onto a node using the contextualType property. @@ -34207,45 +37018,52 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 223 /* VariableDeclaration */: - case 144 /* Parameter */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 174 /* BindingElement */: + case 225 /* VariableDeclaration */: + case 145 /* Parameter */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 175 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 185 /* ArrowFunction */: - case 216 /* ReturnStatement */: + case 186 /* ArrowFunction */: + case 218 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 195 /* YieldExpression */: + case 196 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 179 /* CallExpression */: - case 180 /* NewExpression */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 182 /* TypeAssertionExpression */: - case 200 /* AsExpression */: + case 183 /* TypeAssertionExpression */: + case 201 /* AsExpression */: return getTypeFromTypeNode(parent.type); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 257 /* PropertyAssignment */: - case 258 /* ShorthandPropertyAssignment */: + case 260 /* PropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent); - case 175 /* ArrayLiteralExpression */: + case 176 /* ArrayLiteralExpression */: return getContextualTypeForElementExpression(node); - case 193 /* ConditionalExpression */: + case 194 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); - case 202 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 194 /* TemplateExpression */); + case 204 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 195 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return getContextualType(parent); - case 252 /* JsxExpression */: + case 255 /* JsxExpression */: return getContextualType(parent); - case 250 /* JsxAttribute */: - case 251 /* JsxSpreadAttribute */: + case 252 /* JsxAttribute */: + case 254 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); + case 250 /* JsxOpeningElement */: + case 249 /* JsxSelfClosingElement */: + return getAttributesTypeFromJsxOpeningLikeElement(parent); } return undefined; } + function getContextualMapper(node) { + node = ts.findAncestor(node, function (n) { return !!n.contextualMapper; }); + return node ? node.contextualMapper : identityMapper; + } // If the given type is an object or union type, if that type has a single signature, and if // that signature is non-generic, return the signature. Otherwise return undefined. function getNonGenericSignature(type, node) { @@ -34273,7 +37091,7 @@ var ts; return sourceLength < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 184 /* FunctionExpression */ || node.kind === 185 /* ArrowFunction */; + return node.kind === 185 /* FunctionExpression */ || node.kind === 186 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -34292,7 +37110,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 149 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 150 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var type = getContextualTypeForFunctionLikeDeclaration(node); if (!type) { return undefined; @@ -34302,8 +37120,8 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { - var current = types_14[_i]; + for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { + var current = types_17[_i]; var signature = getNonGenericSignature(current, node); if (signature) { if (!signatureList) { @@ -34330,46 +37148,25 @@ var ts; } return result; } - /** - * Detect if the mapper implies an inference context. Specifically, there are 4 possible values - * for a mapper. Let's go through each one of them: - * - * 1. undefined - this means we are not doing inferential typing, but we may do contextual typing, - * which could cause us to assign a parameter a type - * 2. identityMapper - means we want to avoid assigning a parameter a type, whether or not we are in - * inferential typing (context is undefined for the identityMapper) - * 3. a mapper created by createInferenceMapper - we are doing inferential typing, we want to assign - * types to parameters and fix type parameters (context is defined) - * 4. an instantiation mapper created by createTypeMapper or createTypeEraser - this should never be - * passed as the contextual mapper when checking an expression (context is undefined for these) - * - * isInferentialContext is detecting if we are in case 3 - */ - function isInferentialContext(mapper) { - return mapper && mapper.context; - } - function checkSpreadExpression(node, contextualMapper) { - // It is usually not safe to call checkExpressionCached if we can be contextually typing. - // You can tell that we are contextually typing because of the contextualMapper parameter. - // While it is true that a spread element can have a contextual type, it does not do anything - // with this type. It is neither affected by it, nor does it propagate it to its operand. - // So the fact that contextualMapper is passed is not important, because the operand of a spread - // element is not contextually typed. - var arrayOrIterableType = checkExpressionCached(node.expression, contextualMapper); - return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, /*allowStringInput*/ false); + function checkSpreadExpression(node, checkMode) { + if (languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 1536 /* SpreadIncludes */); + } + var arrayOrIterableType = checkExpression(node.expression, checkMode); + return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, /*allowStringInput*/ false, /*allowAsyncIterable*/ false); } function hasDefaultValue(node) { - return (node.kind === 174 /* BindingElement */ && !!node.initializer) || - (node.kind === 192 /* BinaryExpression */ && node.operatorToken.kind === 57 /* EqualsToken */); + return (node.kind === 175 /* BindingElement */ && !!node.initializer) || + (node.kind === 193 /* BinaryExpression */ && node.operatorToken.kind === 57 /* EqualsToken */); } - function checkArrayLiteral(node, contextualMapper) { + function checkArrayLiteral(node, checkMode) { var elements = node.elements; var hasSpreadElement = false; var elementTypes = []; var inDestructuringPattern = ts.isAssignmentTarget(node); for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) { var e = elements_1[_i]; - if (inDestructuringPattern && e.kind === 196 /* SpreadElement */) { + if (inDestructuringPattern && e.kind === 197 /* SpreadElement */) { // Given the following situation: // var c: {}; // [...c] = ["", 0]; @@ -34382,18 +37179,18 @@ var ts; // get the contextual element type from it. So we do something similar to // getContextualTypeForElementExpression, which will crucially not error // if there is no index type / iterated type. - var restArrayType = checkExpression(e.expression, contextualMapper); + var restArrayType = checkExpression(e.expression, checkMode); var restElementType = getIndexTypeOfType(restArrayType, 1 /* Number */) || - (languageVersion >= 2 /* ES2015 */ ? getElementTypeOfIterable(restArrayType, /*errorNode*/ undefined) : undefined); + getIteratedTypeOrElementType(restArrayType, /*errorNode*/ undefined, /*allowStringInput*/ false, /*allowAsyncIterable*/ false, /*checkAssignability*/ false); if (restElementType) { elementTypes.push(restElementType); } } else { - var type = checkExpressionForMutableLocation(e, contextualMapper); + var type = checkExpressionForMutableLocation(e, checkMode); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 196 /* SpreadElement */; + hasSpreadElement = hasSpreadElement || e.kind === 197 /* SpreadElement */; } if (!hasSpreadElement) { // If array literal is actually a destructuring pattern, mark it as an implied type. We do this such @@ -34408,7 +37205,7 @@ var ts; var pattern = contextualType.pattern; // If array literal is contextually typed by a binding pattern or an assignment pattern, pad the resulting // tuple type with the corresponding binding or assignment element types to make the lengths equal. - if (pattern && (pattern.kind === 173 /* ArrayBindingPattern */ || pattern.kind === 175 /* ArrayLiteralExpression */)) { + if (pattern && (pattern.kind === 174 /* ArrayBindingPattern */ || pattern.kind === 176 /* ArrayLiteralExpression */)) { var patternElements = pattern.elements; for (var i = elementTypes.length; i < patternElements.length; i++) { var patternElement = patternElements[i]; @@ -34416,7 +37213,7 @@ var ts; elementTypes.push(contextualType.typeArguments[i]); } else { - if (patternElement.kind !== 198 /* OmittedExpression */) { + if (patternElement.kind !== 199 /* OmittedExpression */) { error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } elementTypes.push(unknownType); @@ -34433,7 +37230,7 @@ var ts; strictNullChecks ? neverType : undefinedWideningType); } function isNumericName(name) { - return name.kind === 142 /* ComputedPropertyName */ ? isNumericComputedName(name) : isNumericLiteralName(name.text); + return name.kind === 143 /* ComputedPropertyName */ ? isNumericComputedName(name) : isNumericLiteralName(name.text); } function isNumericComputedName(name) { // It seems odd to consider an expression of type Any to result in a numeric name, @@ -34495,7 +37292,7 @@ var ts; var unionType = propTypes.length ? getUnionType(propTypes, /*subtypeReduction*/ true) : undefinedType; return createIndexInfo(unionType, /*isReadonly*/ false); } - function checkObjectLiteral(node, contextualMapper) { + function checkObjectLiteral(node, checkMode) { var inDestructuringPattern = ts.isAssignmentTarget(node); // Grammar checking checkGrammarObjectLiteralExpression(node, inDestructuringPattern); @@ -34505,7 +37302,8 @@ var ts; var propagatedFlags = 0; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 172 /* ObjectBindingPattern */ || contextualType.pattern.kind === 176 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 173 /* ObjectBindingPattern */ || contextualType.pattern.kind === 177 /* ObjectLiteralExpression */); + var isJSObjectLiteral = !contextualType && ts.isInJavaScriptFile(node); var typeFlags = 0; var patternWithComputedProperties = false; var hasComputedStringProperty = false; @@ -34514,29 +37312,29 @@ var ts; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = memberDecl.symbol; - if (memberDecl.kind === 257 /* PropertyAssignment */ || - memberDecl.kind === 258 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 260 /* PropertyAssignment */ || + memberDecl.kind === 261 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 257 /* PropertyAssignment */) { - type = checkPropertyAssignment(memberDecl, contextualMapper); + if (memberDecl.kind === 260 /* PropertyAssignment */) { + type = checkPropertyAssignment(memberDecl, checkMode); } - else if (memberDecl.kind === 149 /* MethodDeclaration */) { - type = checkObjectLiteralMethod(memberDecl, contextualMapper); + else if (memberDecl.kind === 150 /* MethodDeclaration */) { + type = checkObjectLiteralMethod(memberDecl, checkMode); } else { - ts.Debug.assert(memberDecl.kind === 258 /* ShorthandPropertyAssignment */); - type = checkExpressionForMutableLocation(memberDecl.name, contextualMapper); + ts.Debug.assert(memberDecl.kind === 261 /* ShorthandPropertyAssignment */); + type = checkExpressionForMutableLocation(memberDecl.name, checkMode); } typeFlags |= type.flags; - var prop = createSymbol(4 /* Property */ | 67108864 /* Transient */ | member.flags, member.name); + var prop = createSymbol(4 /* Property */ | member.flags, member.name); if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 257 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 258 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 260 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 261 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { - prop.flags |= 536870912 /* Optional */; + prop.flags |= 67108864 /* Optional */; } if (ts.hasDynamicName(memberDecl)) { patternWithComputedProperties = true; @@ -34547,9 +37345,9 @@ var ts; // binding pattern specifies a default value for the property, make the property optional. var impliedProp = getPropertyOfType(contextualType, member.name); if (impliedProp) { - prop.flags |= impliedProp.flags & 536870912 /* Optional */; + prop.flags |= impliedProp.flags & 67108864 /* Optional */; } - else if (!compilerOptions.suppressExcessPropertyErrors) { + else if (!compilerOptions.suppressExcessPropertyErrors && !getIndexInfoOfType(contextualType, 0 /* String */)) { error(memberDecl.name, ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(member), typeToString(contextualType)); } } @@ -34562,9 +37360,12 @@ var ts; prop.target = member; member = prop; } - else if (memberDecl.kind === 259 /* SpreadAssignment */) { + else if (memberDecl.kind === 262 /* SpreadAssignment */) { + if (languageVersion < 2 /* ES2015 */) { + checkExternalEmitHelpers(memberDecl, 2 /* Assign */); + } if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), /*isFromObjectLiteral*/ true); + spread = getSpreadType(spread, createObjectLiteralType()); propertiesArray = []; propertiesTable = ts.createMap(); hasComputedStringProperty = false; @@ -34572,11 +37373,11 @@ var ts; typeFlags = 0; } var type = checkExpression(memberDecl.expression); - if (!(type.flags & (32768 /* Object */ | 1 /* Any */))) { + if (!isValidSpreadType(type)) { error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); return unknownType; } - spread = getSpreadType(spread, type, /*isFromObjectLiteral*/ false); + spread = getSpreadType(spread, type); offset = i + 1; continue; } @@ -34586,8 +37387,8 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 151 /* GetAccessor */ || memberDecl.kind === 152 /* SetAccessor */); - checkAccessorDeclaration(memberDecl); + ts.Debug.assert(memberDecl.kind === 152 /* GetAccessor */ || memberDecl.kind === 153 /* SetAccessor */); + checkNodeDeferred(memberDecl); } if (ts.hasDynamicName(memberDecl)) { if (isNumericName(memberDecl.name)) { @@ -34598,7 +37399,7 @@ var ts; } } else { - propertiesTable[member.name] = member; + propertiesTable.set(member.name, member); } propertiesArray.push(member); } @@ -34607,27 +37408,30 @@ var ts; if (contextualTypeHasPattern) { for (var _i = 0, _a = getPropertiesOfType(contextualType); _i < _a.length; _i++) { var prop = _a[_i]; - if (!propertiesTable[prop.name]) { - if (!(prop.flags & 536870912 /* Optional */)) { + if (!propertiesTable.get(prop.name)) { + if (!(prop.flags & 67108864 /* Optional */)) { error(prop.valueDeclaration || prop.bindingElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } - propertiesTable[prop.name] = prop; + propertiesTable.set(prop.name, prop); propertiesArray.push(prop); } } } if (spread !== emptyObjectType) { if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), /*isFromObjectLiteral*/ true); + spread = getSpreadType(spread, createObjectLiteralType()); + } + if (spread.flags & 32768 /* Object */) { + // only set the symbol and flags if this is a (fresh) object type + spread.flags |= propagatedFlags; + spread.symbol = node.symbol; } - spread.flags |= propagatedFlags; - spread.symbol = node.symbol; return spread; } return createObjectLiteralType(); function createObjectLiteralType() { - var stringIndexInfo = hasComputedStringProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 0 /* String */) : undefined; - var numberIndexInfo = hasComputedNumberProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 1 /* Number */) : undefined; + var stringIndexInfo = isJSObjectLiteral ? jsObjectLiteralIndexInfo : hasComputedStringProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 0 /* String */) : undefined; + var numberIndexInfo = hasComputedNumberProperty && !isJSObjectLiteral ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 1 /* Number */) : undefined; var result = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo); var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 1048576 /* FreshLiteral */; result.flags |= 4194304 /* ContainsObjectLiteral */ | freshObjectLiteralFlag | (typeFlags & 14680064 /* PropagatingFlags */); @@ -34644,9 +37448,14 @@ var ts; return result; } } + function isValidSpreadType(type) { + return !!(type.flags & (1 /* Any */ | 4096 /* Null */ | 2048 /* Undefined */ | 16777216 /* NonPrimitive */) || + type.flags & 32768 /* Object */ && !isGenericMappedType(type) || + type.flags & 196608 /* UnionOrIntersection */ && !ts.forEach(type.types, function (t) { return !isValidSpreadType(t); })); + } function checkJsxSelfClosingElement(node) { checkJsxOpeningLikeElement(node); - return jsxElementType || anyType; + return getJsxGlobalElementType() || anyType; } function checkJsxElement(node) { // Check attributes @@ -34662,18 +37471,18 @@ var ts; for (var _i = 0, _a = node.children; _i < _a.length; _i++) { var child = _a[_i]; switch (child.kind) { - case 252 /* JsxExpression */: + case 255 /* JsxExpression */: checkJsxExpression(child); break; - case 246 /* JsxElement */: + case 248 /* JsxElement */: checkJsxElement(child); break; - case 247 /* JsxSelfClosingElement */: + case 249 /* JsxSelfClosingElement */: checkJsxSelfClosingElement(child); break; } } - return jsxElementType || anyType; + return getJsxGlobalElementType() || anyType; } /** * Returns true iff the JSX element name would be a valid JS identifier, ignoring restrictions about keywords not being identifiers @@ -34687,81 +37496,114 @@ var ts; */ function isJsxIntrinsicIdentifier(tagName) { // TODO (yuisu): comment - if (tagName.kind === 177 /* PropertyAccessExpression */ || tagName.kind === 98 /* ThisKeyword */) { + if (tagName.kind === 178 /* PropertyAccessExpression */ || tagName.kind === 98 /* ThisKeyword */) { return false; } else { return ts.isIntrinsicJsxName(tagName.text); } } - function checkJsxAttribute(node, elementAttributesType, nameTable) { - var correspondingPropType = undefined; - // Look up the corresponding property for this attribute - if (elementAttributesType === emptyObjectType && isUnhyphenatedJsxName(node.name.text)) { - // If there is no 'props' property, you may not have non-"data-" attributes - error(node.parent, ts.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, getJsxElementPropertiesName()); - } - else if (elementAttributesType && !isTypeAny(elementAttributesType)) { - var correspondingPropSymbol = getPropertyOfType(elementAttributesType, node.name.text); - correspondingPropType = correspondingPropSymbol && getTypeOfSymbol(correspondingPropSymbol); - if (isUnhyphenatedJsxName(node.name.text)) { - var attributeType = getTypeOfPropertyOfType(elementAttributesType, ts.getTextOfPropertyName(node.name)) || getIndexTypeOfType(elementAttributesType, 0 /* String */); - if (attributeType) { - correspondingPropType = attributeType; + /** + * Get attributes type of the JSX opening-like element. The result is from resolving "attributes" property of the opening-like element. + * + * @param openingLikeElement a JSX opening-like element + * @param filter a function to remove attributes that will not participate in checking whether attributes are assignable + * @return an anonymous type (similar to the one returned by checkObjectLiteral) in which its properties are attributes property. + * @remarks Because this function calls getSpreadType, it needs to use the same checks as checkObjectLiteral, + * which also calls getSpreadType. + */ + function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, filter, checkMode) { + var attributes = openingLikeElement.attributes; + var attributesTable = ts.createMap(); + var spread = emptyObjectType; + var attributesArray = []; + for (var _i = 0, _a = attributes.properties; _i < _a.length; _i++) { + var attributeDecl = _a[_i]; + var member = attributeDecl.symbol; + if (ts.isJsxAttribute(attributeDecl)) { + var exprType = attributeDecl.initializer ? + checkExpression(attributeDecl.initializer, checkMode) : + trueType; // is sugar for + var attributeSymbol = createSymbol(4 /* Property */ | 134217728 /* Transient */ | member.flags, member.name); + attributeSymbol.declarations = member.declarations; + attributeSymbol.parent = member.parent; + if (member.valueDeclaration) { + attributeSymbol.valueDeclaration = member.valueDeclaration; } - else { - // If there's no corresponding property with this name, error - if (!correspondingPropType) { - error(node.name, ts.Diagnostics.Property_0_does_not_exist_on_type_1, node.name.text, typeToString(elementAttributesType)); - return unknownType; - } + attributeSymbol.type = exprType; + attributeSymbol.target = member; + attributesTable.set(attributeSymbol.name, attributeSymbol); + attributesArray.push(attributeSymbol); + } + else { + ts.Debug.assert(attributeDecl.kind === 254 /* JsxSpreadAttribute */); + if (attributesArray.length > 0) { + spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable)); + attributesArray = []; + attributesTable = ts.createMap(); } + var exprType = checkExpression(attributeDecl.expression); + if (!isValidSpreadType(exprType)) { + error(attributeDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); + return anyType; + } + if (isTypeAny(exprType)) { + return anyType; + } + spread = getSpreadType(spread, exprType); } } - var exprType; - if (node.initializer) { - exprType = checkExpression(node.initializer); - } - else { - // is sugar for - exprType = booleanType; - } - if (correspondingPropType) { - checkTypeAssignableTo(exprType, correspondingPropType, node); - } - nameTable[node.name.text] = true; - return exprType; - } - function checkJsxSpreadAttribute(node, elementAttributesType, nameTable) { - var type = checkExpression(node.expression); - var props = getPropertiesOfType(type); - for (var _i = 0, props_2 = props; _i < props_2.length; _i++) { - var prop = props_2[_i]; - // Is there a corresponding property in the element attributes type? Skip checking of properties - // that have already been assigned to, as these are not actually pushed into the resulting type - if (!nameTable[prop.name]) { - var targetPropSym = getPropertyOfType(elementAttributesType, prop.name); - if (targetPropSym) { - var msg = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property, prop.name); - checkTypeAssignableTo(getTypeOfSymbol(prop), getTypeOfSymbol(targetPropSym), node, undefined, msg); - } - nameTable[prop.name] = true; + if (spread !== emptyObjectType) { + if (attributesArray.length > 0) { + spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable)); + attributesArray = []; + attributesTable = ts.createMap(); } + attributesArray = getPropertiesOfType(spread); } - return type; - } - function getJsxType(name) { - if (jsxTypes[name] === undefined) { - return jsxTypes[name] = getExportedTypeFromNamespace(JsxNames.JSX, name) || unknownType; + attributesTable = ts.createMap(); + if (attributesArray) { + ts.forEach(attributesArray, function (attr) { + if (!filter || filter(attr)) { + attributesTable.set(attr.name, attr); + } + }); + } + return createJsxAttributesType(attributes.symbol, attributesTable); + /** + * Create anonymous type from given attributes symbol table. + * @param symbol a symbol of JsxAttributes containing attributes corresponding to attributesTable + * @param attributesTable a symbol table of attributes property + */ + function createJsxAttributesType(symbol, attributesTable) { + var result = createAnonymousType(symbol, attributesTable, emptyArray, emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined); + var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 1048576 /* FreshLiteral */; + result.flags |= 33554432 /* JsxAttributes */ | 4194304 /* ContainsObjectLiteral */ | freshObjectLiteralFlag; + result.objectFlags |= 128 /* ObjectLiteral */; + return result; } - return jsxTypes[name]; } /** - * Looks up an intrinsic tag name and returns a symbol that either points to an intrinsic - * property (in which case nodeLinks.jsxFlags will be IntrinsicNamedElement) or an intrinsic - * string index signature (in which case nodeLinks.jsxFlags will be IntrinsicIndexedElement). - * May also return unknownSymbol if both of these lookups fail. - */ + * Check attributes property of opening-like element. This function is called during chooseOverload to get call signature of a JSX opening-like element. + * (See "checkApplicableSignatureForJsxOpeningLikeElement" for how the function is used) + * @param node a JSXAttributes to be resolved of its type + */ + function checkJsxAttributes(node, checkMode) { + return createJsxAttributesTypeFromAttributesProperty(node.parent, /*filter*/ undefined, checkMode); + } + function getJsxType(name) { + var jsxType = jsxTypes.get(name); + if (jsxType === undefined) { + jsxTypes.set(name, jsxType = getExportedTypeFromNamespace(JsxNames.JSX, name) || unknownType); + } + return jsxType; + } + /** + * Looks up an intrinsic tag name and returns a symbol that either points to an intrinsic + * property (in which case nodeLinks.jsxFlags will be IntrinsicNamedElement) or an intrinsic + * string index signature (in which case nodeLinks.jsxFlags will be IntrinsicIndexedElement). + * May also return unknownSymbol if both of these lookups fail. + */ function getIntrinsicTagSymbol(node) { var links = getNodeLinks(node); if (!links.resolvedSymbol) { @@ -34784,7 +37626,7 @@ var ts; return links.resolvedSymbol = unknownSymbol; } else { - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { error(node, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists, JsxNames.IntrinsicElements); } return links.resolvedSymbol = unknownSymbol; @@ -34849,28 +37691,133 @@ var ts; } } /** - * Given React element instance type and the class type, resolve the Jsx type - * Pass elemType to handle individual type in the union typed element type. + * Get JSX attributes type by trying to resolve openingLikeElement as a stateless function component. + * Return only attributes type of successfully resolved call signature. + * This function assumes that the caller handled other possible element type of the JSX element (e.g. stateful component) + * Unlike tryGetAllJsxStatelessFunctionAttributesType, this function is a default behavior of type-checkers. + * @param openingLikeElement a JSX opening-like element to find attributes type + * @param elementType a type of the opening-like element. This elementType can't be an union type + * @param elemInstanceType an element instance type (the result of newing or invoking this tag) + * @param elementClassType a JSX-ElementClass type. This is a result of looking up ElementClass interface in the JSX global */ - function getResolvedJsxType(node, elemType, elemClassType) { - if (!elemType) { - elemType = checkExpression(node.tagName); + function defaultTryGetJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) { + ts.Debug.assert(!(elementType.flags & 65536 /* Union */)); + if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) { + var jsxStatelessElementType = getJsxGlobalStatelessElementType(); + if (jsxStatelessElementType) { + // We don't call getResolvedSignature here because we have already resolve the type of JSX Element. + var callSignature = getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, /*candidatesOutArray*/ undefined); + if (callSignature !== unknownSignature) { + var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); + var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); + if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) { + // Intersect in JSX.IntrinsicAttributes if it exists + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttributes !== unknownType) { + paramType = intersectTypes(intrinsicAttributes, paramType); + } + return paramType; + } + } + } } - if (elemType.flags & 65536 /* Union */) { - var types = elemType.types; - return getUnionType(ts.map(types, function (type) { - return getResolvedJsxType(node, type, elemClassType); + return undefined; + } + /** + * Get JSX attributes type by trying to resolve openingLikeElement as a stateless function component. + * Return all attributes type of resolved call signature including candidate signatures. + * This function assumes that the caller handled other possible element type of the JSX element. + * This function is a behavior used by language service when looking up completion in JSX element. + * @param openingLikeElement a JSX opening-like element to find attributes type + * @param elementType a type of the opening-like element. This elementType can't be an union type + * @param elemInstanceType an element instance type (the result of newing or invoking this tag) + * @param elementClassType a JSX-ElementClass type. This is a result of looking up ElementClass interface in the JSX global + */ + function tryGetAllJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) { + ts.Debug.assert(!(elementType.flags & 65536 /* Union */)); + if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) { + // Is this is a stateless function component? See if its single signature's return type is assignable to the JSX Element Type + var jsxStatelessElementType = getJsxGlobalStatelessElementType(); + if (jsxStatelessElementType) { + // We don't call getResolvedSignature because here we have already resolve the type of JSX Element. + var candidatesOutArray = []; + getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, candidatesOutArray); + var result = void 0; + var allMatchingAttributesType = void 0; + for (var _i = 0, candidatesOutArray_1 = candidatesOutArray; _i < candidatesOutArray_1.length; _i++) { + var candidate = candidatesOutArray_1[_i]; + var callReturnType = getReturnTypeOfSignature(candidate); + var paramType = callReturnType && (candidate.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(candidate.parameters[0])); + if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) { + var shouldBeCandidate = true; + for (var _a = 0, _b = openingLikeElement.attributes.properties; _a < _b.length; _a++) { + var attribute = _b[_a]; + if (ts.isJsxAttribute(attribute) && + isUnhyphenatedJsxName(attribute.name.text) && + !getPropertyOfType(paramType, attribute.name.text)) { + shouldBeCandidate = false; + break; + } + } + if (shouldBeCandidate) { + result = intersectTypes(result, paramType); + } + allMatchingAttributesType = intersectTypes(allMatchingAttributesType, paramType); + } + } + // If we can't find any matching, just return everything. + if (!result) { + result = allMatchingAttributesType; + } + // Intersect in JSX.IntrinsicAttributes if it exists + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttributes !== unknownType) { + result = intersectTypes(intrinsicAttributes, result); + } + return result; + } + } + return undefined; + } + /** + * Resolve attributes type of the given opening-like element. The attributes type is a type of attributes associated with the given elementType. + * For instance: + * declare function Foo(attr: { p1: string}): JSX.Element; + * ; // This function will try resolve "Foo" and return an attributes type of "Foo" which is "{ p1: string }" + * + * The function is intended to initially be called from getAttributesTypeFromJsxOpeningLikeElement which already handle JSX-intrinsic-element.. + * This function will try to resolve custom JSX attributes type in following order: string literal, stateless function, and stateful component + * + * @param openingLikeElement a non-intrinsic JSXOPeningLikeElement + * @param shouldIncludeAllStatelessAttributesType a boolean indicating whether to include all attributes types from all stateless function signature + * @param elementType an instance type of the given opening-like element. If undefined, the function will check type openinglikeElement's tagname. + * @param elementClassType a JSX-ElementClass type. This is a result of looking up ElementClass interface in the JSX global (imported from react.d.ts) + * @return attributes type if able to resolve the type of node + * anyType if there is no type ElementAttributesProperty or there is an error + * emptyObjectType if there is no "prop" in the element instance type + */ + function resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, elementType, elementClassType) { + if (!elementType) { + elementType = checkExpression(openingLikeElement.tagName); + } + if (elementType.flags & 65536 /* Union */) { + var types = elementType.types; + return getUnionType(types.map(function (type) { + return resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, type, elementClassType); }), /*subtypeReduction*/ true); } // If the elemType is a string type, we have to return anyType to prevent an error downstream as we will try to find construct or call signature of the type - if (elemType.flags & 2 /* String */) { + if (elementType.flags & 2 /* String */) { return anyType; } - else if (elemType.flags & 32 /* StringLiteral */) { + else if (elementType.flags & 32 /* StringLiteral */) { // If the elemType is a stringLiteral type, we can then provide a check to make sure that the string literal type is one of the Jsx intrinsic element type + // For example: + // var CustomTag: "h1" = "h1"; + // Hello World var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); if (intrinsicElementsType !== unknownType) { - var stringLiteralTypeName = elemType.text; + var stringLiteralTypeName = elementType.text; var intrinsicProp = getPropertyOfType(intrinsicElementsType, stringLiteralTypeName); if (intrinsicProp) { return getTypeOfSymbol(intrinsicProp); @@ -34879,34 +37826,24 @@ var ts; if (indexSignatureType) { return indexSignatureType; } - error(node, ts.Diagnostics.Property_0_does_not_exist_on_type_1, stringLiteralTypeName, "JSX." + JsxNames.IntrinsicElements); + error(openingLikeElement, ts.Diagnostics.Property_0_does_not_exist_on_type_1, stringLiteralTypeName, "JSX." + JsxNames.IntrinsicElements); } // If we need to report an error, we already done so here. So just return any to prevent any more error downstream return anyType; } // Get the element instance type (the result of newing or invoking this tag) - var elemInstanceType = getJsxElementInstanceType(node, elemType); - if (!elemClassType || !isTypeAssignableTo(elemInstanceType, elemClassType)) { - // Is this is a stateless function component? See if its single signature's return type is - // assignable to the JSX Element Type - if (jsxElementType) { - var callSignatures = elemType && getSignaturesOfType(elemType, 0 /* Call */); - var callSignature = callSignatures && callSignatures.length > 0 && callSignatures[0]; - var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); - var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); - if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType)) { - // Intersect in JSX.IntrinsicAttributes if it exists - var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); - if (intrinsicAttributes !== unknownType) { - paramType = intersectTypes(intrinsicAttributes, paramType); - } - return paramType; - } - } + var elemInstanceType = getJsxElementInstanceType(openingLikeElement, elementType); + // If we should include all stateless attributes type, then get all attributes type from all stateless function signature. + // Otherwise get only attributes type from the signature picked by choose-overload logic. + var statelessAttributesType = shouldIncludeAllStatelessAttributesType ? + tryGetAllJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) : + defaultTryGetJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType); + if (statelessAttributesType) { + return statelessAttributesType; } // Issue an error if this return type isn't assignable to JSX.ElementClass - if (elemClassType) { - checkTypeRelatedTo(elemInstanceType, elemClassType, assignableRelation, node, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); + if (elementClassType) { + checkTypeRelatedTo(elemInstanceType, elementClassType, assignableRelation, openingLikeElement, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); } if (isTypeAny(elemInstanceType)) { return elemInstanceType; @@ -34930,11 +37867,6 @@ var ts; // Props is of type 'any' or unknown return attributesType; } - else if (attributesType.flags & 65536 /* Union */) { - // Props cannot be a union type - error(node.tagName, ts.Diagnostics.JSX_element_attributes_type_0_may_not_be_a_union_type, typeToString(attributesType)); - return anyType; - } else { // Normal case -- add in IntrinsicClassElements and IntrinsicElements var apparentAttributesType = attributesType; @@ -34959,30 +37891,68 @@ var ts; } } /** - * Given an opening/self-closing element, get the 'element attributes type', i.e. the type that tells - * us which attributes are valid on a given element. + * Get attributes type of the given intrinsic opening-like Jsx element by resolving the tag name. + * The function is intended to be called from a function which has checked that the opening element is an intrinsic element. + * @param node an intrinsic JSX opening-like element */ - function getJsxElementAttributesType(node) { + function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) { + ts.Debug.assert(isJsxIntrinsicIdentifier(node.tagName)); var links = getNodeLinks(node); - if (!links.resolvedJsxType) { - if (isJsxIntrinsicIdentifier(node.tagName)) { - var symbol = getIntrinsicTagSymbol(node); - if (links.jsxFlags & 1 /* IntrinsicNamedElement */) { - return links.resolvedJsxType = getTypeOfSymbol(symbol); - } - else if (links.jsxFlags & 2 /* IntrinsicIndexedElement */) { - return links.resolvedJsxType = getIndexInfoOfSymbol(symbol, 0 /* String */).type; - } - else { - return links.resolvedJsxType = unknownType; - } + if (!links.resolvedJsxElementAttributesType) { + var symbol = getIntrinsicTagSymbol(node); + if (links.jsxFlags & 1 /* IntrinsicNamedElement */) { + return links.resolvedJsxElementAttributesType = getTypeOfSymbol(symbol); + } + else if (links.jsxFlags & 2 /* IntrinsicIndexedElement */) { + return links.resolvedJsxElementAttributesType = getIndexInfoOfSymbol(symbol, 0 /* String */).type; } else { - var elemClassType = getJsxGlobalElementClassType(); - return links.resolvedJsxType = getResolvedJsxType(node, undefined, elemClassType); + return links.resolvedJsxElementAttributesType = unknownType; } } - return links.resolvedJsxType; + return links.resolvedJsxElementAttributesType; + } + /** + * Get attributes type of the given custom opening-like JSX element. + * This function is intended to be called from a caller that handles intrinsic JSX element already. + * @param node a custom JSX opening-like element + * @param shouldIncludeAllStatelessAttributesType a boolean value used by language service to get all possible attributes type from an overload stateless function component + */ + function getCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType) { + var links = getNodeLinks(node); + if (!links.resolvedJsxElementAttributesType) { + var elemClassType = getJsxGlobalElementClassType(); + return links.resolvedJsxElementAttributesType = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, /*elementType*/ undefined, elemClassType); + } + return links.resolvedJsxElementAttributesType; + } + /** + * Get all possible attributes type, especially from an overload stateless function component, of the given JSX opening-like element. + * This function is called by language service (see: completions-tryGetGlobalSymbols). + * @param node a JSX opening-like element to get attributes type for + */ + function getAllAttributesTypeFromJsxOpeningLikeElement(node) { + if (isJsxIntrinsicIdentifier(node.tagName)) { + return getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); + } + else { + // Because in language service, the given JSX opening-like element may be incomplete and therefore, + // we can't resolve to exact signature if the element is a stateless function component so the best thing to do is return all attributes type from all overloads. + return getCustomJsxElementAttributesType(node, /*shouldIncludeAllStatelessAttributesType*/ true); + } + } + /** + * Get the attributes type, which indicates the attributes that are valid on the given JSXOpeningLikeElement. + * @param node a JSXOpeningLikeElement node + * @return an attributes type of the given node + */ + function getAttributesTypeFromJsxOpeningLikeElement(node) { + if (isJsxIntrinsicIdentifier(node.tagName)) { + return getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); + } + else { + return getCustomJsxElementAttributesType(node, /*shouldIncludeAllStatelessAttributesType*/ false); + } } /** * Given a JSX attribute, returns the symbol for the corresponds property @@ -34990,17 +37960,34 @@ var ts; * that have no matching element attributes type property. */ function getJsxAttributePropertySymbol(attrib) { - var attributesType = getJsxElementAttributesType(attrib.parent); + var attributesType = getAttributesTypeFromJsxOpeningLikeElement(attrib.parent.parent); var prop = getPropertyOfType(attributesType, attrib.name.text); return prop || unknownSymbol; } function getJsxGlobalElementClassType() { - if (!jsxElementClassType) { - jsxElementClassType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.ElementClass); + if (!deferredJsxElementClassType) { + deferredJsxElementClassType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.ElementClass); } - return jsxElementClassType; + return deferredJsxElementClassType; } - /// Returns all the properties of the Jsx.IntrinsicElements interface + function getJsxGlobalElementType() { + if (!deferredJsxElementType) { + deferredJsxElementType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.Element); + } + return deferredJsxElementType; + } + function getJsxGlobalStatelessElementType() { + if (!deferredJsxStatelessElementType) { + var jsxElementType = getJsxGlobalElementType(); + if (jsxElementType) { + deferredJsxStatelessElementType = getUnionType([jsxElementType, nullType]); + } + } + return deferredJsxStatelessElementType; + } + /** + * Returns all the properties of the Jsx.IntrinsicElements interface + */ function getJsxIntrinsicTagNames() { var intrinsics = getJsxType(JsxNames.IntrinsicElements); return intrinsics ? getPropertiesOfType(intrinsics) : emptyArray; @@ -35010,8 +37997,8 @@ var ts; if ((compilerOptions.jsx || 0 /* None */) === 0 /* None */) { error(errorNode, ts.Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided); } - if (jsxElementType === undefined) { - if (compilerOptions.noImplicitAny) { + if (getJsxGlobalElementType() === undefined) { + if (noImplicitAny) { error(errorNode, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist); } } @@ -35033,39 +38020,46 @@ var ts; markAliasSymbolAsReferenced(reactSym); } } - var targetAttributesType = getJsxElementAttributesType(node); - var nameTable = ts.createMap(); - // Process this array in right-to-left order so we know which - // attributes (mostly from spreads) are being overwritten and - // thus should have their types ignored - var sawSpreadedAny = false; - for (var i = node.attributes.length - 1; i >= 0; i--) { - if (node.attributes[i].kind === 250 /* JsxAttribute */) { - checkJsxAttribute((node.attributes[i]), targetAttributesType, nameTable); - } - else { - ts.Debug.assert(node.attributes[i].kind === 251 /* JsxSpreadAttribute */); - var spreadType = checkJsxSpreadAttribute((node.attributes[i]), targetAttributesType, nameTable); - if (isTypeAny(spreadType)) { - sawSpreadedAny = true; - } - } + checkJsxAttributesAssignableToTagNameAttributes(node); + } + /** + * Check whether the given attributes of JSX opening-like element is assignable to the tagName attributes. + * Get the attributes type of the opening-like element through resolving the tagName, "target attributes" + * Check assignablity between given attributes property, "source attributes", and the "target attributes" + * @param openingLikeElement an opening-like JSX element to check its JSXAttributes + */ + function checkJsxAttributesAssignableToTagNameAttributes(openingLikeElement) { + // The function involves following steps: + // 1. Figure out expected attributes type by resolving tagName of the JSX opening-like element, targetAttributesType. + // During these steps, we will try to resolve the tagName as intrinsic name, stateless function, stateful component (in the order) + // 2. Solved JSX attributes type given by users, sourceAttributesType, which is by resolving "attributes" property of the JSX opening-like element. + // 3. Check if the two are assignable to each other + // targetAttributesType is a type of an attributes from resolving tagName of an opening-like JSX element. + var targetAttributesType = isJsxIntrinsicIdentifier(openingLikeElement.tagName) ? + getIntrinsicAttributesTypeFromJsxOpeningLikeElement(openingLikeElement) : + getCustomJsxElementAttributesType(openingLikeElement, /*shouldIncludeAllStatelessAttributesType*/ false); + // sourceAttributesType is a type of an attributes properties. + // i.e
+ // attr1 and attr2 are treated as JSXAttributes attached in the JsxOpeningLikeElement as "attributes". + var sourceAttributesType = createJsxAttributesTypeFromAttributesProperty(openingLikeElement, function (attribute) { + return isUnhyphenatedJsxName(attribute.name) || !!(getPropertyOfType(targetAttributesType, attribute.name)); + }); + // If the targetAttributesType is an emptyObjectType, indicating that there is no property named 'props' on this instance type. + // but there exists a sourceAttributesType, we need to explicitly give an error as normal assignability check allow excess properties and will pass. + if (targetAttributesType === emptyObjectType && (isTypeAny(sourceAttributesType) || sourceAttributesType.properties.length > 0)) { + error(openingLikeElement, ts.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, getJsxElementPropertiesName()); } - // Check that all required properties have been provided. If an 'any' - // was spreaded in, though, assume that it provided all required properties - if (targetAttributesType && !sawSpreadedAny) { - var targetProperties = getPropertiesOfType(targetAttributesType); - for (var i = 0; i < targetProperties.length; i++) { - if (!(targetProperties[i].flags & 536870912 /* Optional */) && - !nameTable[targetProperties[i].name]) { - error(node, ts.Diagnostics.Property_0_is_missing_in_type_1, targetProperties[i].name, typeToString(targetAttributesType)); - } - } + else { + checkTypeAssignableTo(sourceAttributesType, targetAttributesType, openingLikeElement.attributes.properties.length > 0 ? openingLikeElement.attributes : openingLikeElement); } } - function checkJsxExpression(node) { + function checkJsxExpression(node, checkMode) { if (node.expression) { - return checkExpression(node.expression); + var type = checkExpression(node.expression, checkMode); + if (node.dotDotDotToken && type !== anyType && !isArrayType(type)) { + error(node, ts.Diagnostics.JSX_spread_child_must_be_an_array_type, node.toString(), typeToString(type)); + } + return type; } else { return unknownType; @@ -35074,14 +38068,32 @@ var ts; // If a symbol is a synthesized symbol with no value declaration, we assume it is a property. Example of this are the synthesized // '.prototype' property as well as synthesized tuple index properties. function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 147 /* PropertyDeclaration */; + return s.valueDeclaration ? s.valueDeclaration.kind : 148 /* PropertyDeclaration */; } function getDeclarationModifierFlagsFromSymbol(s) { - return s.valueDeclaration ? ts.getCombinedModifierFlags(s.valueDeclaration) : s.flags & 134217728 /* Prototype */ ? 4 /* Public */ | 32 /* Static */ : 0; + if (s.valueDeclaration) { + var flags = ts.getCombinedModifierFlags(s.valueDeclaration); + return s.parent && s.parent.flags & 32 /* Class */ ? flags : flags & ~28 /* AccessibilityModifier */; + } + if (getCheckFlags(s) & 6 /* Synthetic */) { + var checkFlags = s.checkFlags; + var accessModifier = checkFlags & 256 /* ContainsPrivate */ ? 8 /* Private */ : + checkFlags & 64 /* ContainsPublic */ ? 4 /* Public */ : + 16 /* Protected */; + var staticModifier = checkFlags & 512 /* ContainsStatic */ ? 32 /* Static */ : 0; + return accessModifier | staticModifier; + } + if (s.flags & 16777216 /* Prototype */) { + return 4 /* Public */ | 32 /* Static */; + } + return 0; } function getDeclarationNodeFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : 0; } + function isMethodLike(symbol) { + return !!(symbol.flags & 8192 /* Method */ || getCheckFlags(symbol) & 4 /* SyntheticMethod */); + } /** * Check whether the requested property access is valid. * Returns true if node is a valid property access, and false otherwise. @@ -35090,12 +38102,16 @@ var ts; * @param type The type of left. * @param prop The symbol for the right hand side of the property access. */ - function checkClassPropertyAccess(node, left, type, prop) { + function checkPropertyAccessibility(node, left, type, prop) { var flags = getDeclarationModifierFlagsFromSymbol(prop); - var declaringClass = getDeclaredTypeOfSymbol(getParentOfSymbol(prop)); - var errorNode = node.kind === 177 /* PropertyAccessExpression */ || node.kind === 223 /* VariableDeclaration */ ? + var errorNode = node.kind === 178 /* PropertyAccessExpression */ || node.kind === 225 /* VariableDeclaration */ ? node.name : node.right; + if (getCheckFlags(prop) & 256 /* ContainsPrivate */) { + // Synthetic property with private constituent property + error(errorNode, ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(prop), typeToString(type)); + return false; + } if (left.kind === 96 /* SuperKeyword */) { // TS 1.0 spec (April 2014): 4.8.2 // - In a constructor, instance member function, instance member accessor, or @@ -35104,18 +38120,22 @@ var ts; // - In a static member function or static member accessor // where this references the constructor function object of a derived class, // a super property access is permitted and must specify a public static member function of the base class. - if (languageVersion < 2 /* ES2015 */ && getDeclarationKindFromSymbol(prop) !== 149 /* MethodDeclaration */) { - // `prop` refers to a *property* declared in the super class - // rather than a *method*, so it does not satisfy the above criteria. - error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); - return false; + if (languageVersion < 2 /* ES2015 */) { + var hasNonMethodDeclaration = forEachProperty(prop, function (p) { + var propKind = getDeclarationKindFromSymbol(p); + return propKind !== 150 /* MethodDeclaration */ && propKind !== 149 /* MethodSignature */; + }); + if (hasNonMethodDeclaration) { + error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); + return false; + } } if (flags & 128 /* Abstract */) { // A method cannot be accessed in a super property access if the method is abstract. // This error could mask a private property access error. But, a member // cannot simultaneously be private and abstract, so this will trigger an // additional error elsewhere. - error(errorNode, ts.Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString(prop), typeToString(declaringClass)); + error(errorNode, ts.Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString(prop), typeToString(getDeclaringClass(prop))); return false; } } @@ -35128,7 +38148,7 @@ var ts; if (flags & 8 /* Private */) { var declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop)); if (!isNodeWithinClass(node, declaringClassDeclaration)) { - error(errorNode, ts.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(declaringClass)); + error(errorNode, ts.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(getDeclaringClass(prop))); return false; } return true; @@ -35138,14 +38158,15 @@ var ts; if (left.kind === 96 /* SuperKeyword */) { return true; } - // Get the enclosing class that has the declaring class as its base type + // Find the first enclosing class that has the declaring classes of the protected constituents + // of the property as base classes var enclosingClass = forEachEnclosingClass(node, function (enclosingDeclaration) { var enclosingClass = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingDeclaration)); - return hasBaseType(enclosingClass, declaringClass) ? enclosingClass : undefined; + return isClassDerivedFromDeclaringClasses(enclosingClass, prop) ? enclosingClass : undefined; }); // A protected property is accessible if the property is within the declaring class or classes derived from it if (!enclosingClass) { - error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(declaringClass)); + error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(getDeclaringClass(prop) || type)); return false; } // No further restrictions for static properties @@ -35157,7 +38178,6 @@ var ts; // get the original type -- represented as the type constraint of the 'this' type type = getConstraintOfTypeParameter(type); } - // TODO: why is the first part of this check here? if (!(getObjectFlags(getTargetType(type)) & 3 /* ClassOrInterface */ && hasBaseType(type, enclosingClass))) { error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1, symbolToString(prop), typeToString(enclosingClass)); return false; @@ -35165,16 +38185,17 @@ var ts; return true; } function checkNonNullExpression(node) { - var type = checkExpression(node); - if (strictNullChecks) { - var kind = getFalsyFlags(type) & 6144 /* Nullable */; - if (kind) { - error(node, kind & 2048 /* Undefined */ ? kind & 4096 /* Null */ ? - ts.Diagnostics.Object_is_possibly_null_or_undefined : - ts.Diagnostics.Object_is_possibly_undefined : - ts.Diagnostics.Object_is_possibly_null); - } - return getNonNullableType(type); + return checkNonNullType(checkExpression(node), node); + } + function checkNonNullType(type, errorNode) { + var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 6144 /* Nullable */; + if (kind) { + error(errorNode, kind & 2048 /* Undefined */ ? kind & 4096 /* Null */ ? + ts.Diagnostics.Object_is_possibly_null_or_undefined : + ts.Diagnostics.Object_is_possibly_undefined : + ts.Diagnostics.Object_is_possibly_null); + var t = getNonNullableType(type); + return t.flags & (6144 /* Nullable */ | 8192 /* Never */) ? unknownType : t; } return type; } @@ -35203,7 +38224,7 @@ var ts; noUnusedIdentifiers && (prop.flags & 106500 /* ClassMember */) && prop.valueDeclaration && (ts.getModifierFlags(prop.valueDeclaration) & 8 /* Private */)) { - if (prop.flags & 16777216 /* Instantiated */) { + if (getCheckFlags(prop) & 1 /* Instantiated */) { getSymbolLinks(prop).target.isReferenced = true; } else { @@ -35211,6 +38232,15 @@ var ts; } } } + function isInPropertyInitializer(node) { + while (node) { + if (node.parent && node.parent.kind === 148 /* PropertyDeclaration */ && node.parent.initializer === node) { + return true; + } + node = node.parent; + } + return false; + } function checkPropertyAccessExpressionOrQualifiedName(node, left, right) { var type = checkNonNullExpression(left); if (isTypeAny(type) || type === silentNeverType) { @@ -35223,16 +38253,30 @@ var ts; } var prop = getPropertyOfType(apparentType, right.text); if (!prop) { + var stringIndexType = getIndexTypeOfType(apparentType, 0 /* String */); + if (stringIndexType) { + return stringIndexType; + } if (right.text && !checkAndReportErrorForExtendingInterface(node)) { reportNonexistentProperty(right, type.flags & 16384 /* TypeParameter */ && type.isThisType ? apparentType : type); } return unknownType; } + if (prop.valueDeclaration) { + if (isInPropertyInitializer(node) && + !isBlockScopedNameDeclaredBeforeUse(prop.valueDeclaration, right)) { + error(right, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, right.text); + } + if (prop.valueDeclaration.kind === 228 /* ClassDeclaration */ && + node.parent && node.parent.kind !== 158 /* TypeReference */ && + !ts.isInAmbientContext(prop.valueDeclaration) && + !isBlockScopedNameDeclaredBeforeUse(prop.valueDeclaration, right)) { + error(right, ts.Diagnostics.Class_0_used_before_its_declaration, right.text); + } + } markPropertyAsReferenced(prop); getNodeLinks(node).resolvedSymbol = prop; - if (prop.parent && prop.parent.flags & 32 /* Class */) { - checkClassPropertyAccess(node, left, apparentType, prop); - } + checkPropertyAccessibility(node, left, apparentType, prop); var propType = getTypeOfSymbol(prop); var assignmentKind = ts.getAssignmentTargetKind(node); if (assignmentKind) { @@ -35244,23 +38288,23 @@ var ts; // Only compute control flow type if this is a property access expression that isn't an // assignment target, and the referenced property was declared as a variable, property, // accessor, or optional method. - if (node.kind !== 177 /* PropertyAccessExpression */ || assignmentKind === 1 /* Definite */ || + if (node.kind !== 178 /* PropertyAccessExpression */ || assignmentKind === 1 /* Definite */ || !(prop.flags & (3 /* Variable */ | 4 /* Property */ | 98304 /* Accessor */)) && !(prop.flags & 8192 /* Method */ && propType.flags & 65536 /* Union */)) { return propType; } - var flowType = getFlowTypeOfReference(node, propType, /*assumeInitialized*/ true, /*flowContainer*/ undefined); + var flowType = getFlowTypeOfReference(node, propType); return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 177 /* PropertyAccessExpression */ + var left = node.kind === 178 /* PropertyAccessExpression */ ? node.expression : node.left; var type = checkExpression(left); if (type !== unknownType && !isTypeAny(type)) { var prop = getPropertyOfType(getWidenedType(type), propertyName); - if (prop && prop.parent && prop.parent.flags & 32 /* Class */) { - return checkClassPropertyAccess(node, left, type, prop); + if (prop) { + return checkPropertyAccessibility(node, left, type, prop); } } return true; @@ -35270,7 +38314,7 @@ var ts; */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 224 /* VariableDeclarationList */) { + if (initializer.kind === 226 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -35299,7 +38343,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 212 /* ForInStatement */ && + if (node.kind === 214 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -35317,7 +38361,7 @@ var ts; var indexExpression = node.argumentExpression; if (!indexExpression) { var sourceFile = ts.getSourceFileOfNode(node); - if (node.parent.kind === 180 /* NewExpression */ && node.parent.expression === node) { + if (node.parent.kind === 181 /* NewExpression */ && node.parent.expression === node) { var start = ts.skipTrivia(sourceFile.text, node.expression.end); var end = node.end; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); @@ -35337,7 +38381,7 @@ var ts; error(indexExpression, ts.Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal); return unknownType; } - return getIndexedAccessType(objectType, indexType, node); + return checkIndexedAccessIndexType(getIndexedAccessType(objectType, indexType, node), node); } function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) { if (expressionType === unknownType) { @@ -35361,7 +38405,7 @@ var ts; if (!leftHandSideSymbol) { return false; } - var globalESSymbol = getGlobalESSymbolConstructorSymbol(); + var globalESSymbol = getGlobalESSymbolConstructorSymbol(/*reportErrors*/ true); if (!globalESSymbol) { // Already errored when we tried to look up the symbol return false; @@ -35375,10 +38419,10 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 181 /* TaggedTemplateExpression */) { + if (node.kind === 182 /* TaggedTemplateExpression */) { checkExpression(node.template); } - else if (node.kind !== 145 /* Decorator */) { + else if (node.kind !== 146 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -35405,16 +38449,16 @@ var ts; var specializedIndex = -1; var spliceIndex; ts.Debug.assert(!result.length); - for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { - var signature = signatures_2[_i]; + for (var _i = 0, signatures_3 = signatures; _i < signatures_3.length; _i++) { + var signature = signatures_3[_i]; var symbol = signature.declaration && getSymbolOfNode(signature.declaration); - var parent_8 = signature.declaration && signature.declaration.parent; + var parent = signature.declaration && signature.declaration.parent; if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && parent_8 === lastParent) { + if (lastParent && parent === lastParent) { index++; } else { - lastParent = parent_8; + lastParent = parent; index = cutoffIndex; } } @@ -35422,7 +38466,7 @@ var ts; // current declaration belongs to a different symbol // set cutoffIndex so re-orderings in the future won't change result set from 0 to cutoffIndex index = cutoffIndex = result.length; - lastParent = parent_8; + lastParent = parent; } lastSymbol = symbol; // specialized signatures always need to be placed before non-specialized signatures regardless @@ -35444,7 +38488,7 @@ var ts; function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg && arg.kind === 196 /* SpreadElement */) { + if (arg && arg.kind === 197 /* SpreadElement */) { return i; } } @@ -35457,13 +38501,17 @@ var ts; var callIsIncomplete; // In incomplete call we want to be lenient when we have too few arguments var isDecorator; var spreadArgIndex = -1; - if (node.kind === 181 /* TaggedTemplateExpression */) { + if (ts.isJsxOpeningLikeElement(node)) { + // The arity check will be done in "checkApplicableSignatureForJsxOpeningLikeElement". + return true; + } + if (node.kind === 182 /* TaggedTemplateExpression */) { var tagExpression = node; // Even if the call is incomplete, we'll have a missing expression as our last argument, // so we can say the count is just the arg list length argCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 194 /* TemplateExpression */) { + if (tagExpression.template.kind === 195 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. var templateExpression = tagExpression.template; @@ -35480,7 +38528,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 145 /* Decorator */) { + else if (node.kind === 146 /* Decorator */) { isDecorator = true; typeArguments = undefined; argCount = getEffectiveArgumentCount(node, /*args*/ undefined, signature); @@ -35489,19 +38537,21 @@ var ts; var callExpression = node; if (!callExpression.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(callExpression.kind === 180 /* NewExpression */); + ts.Debug.assert(callExpression.kind === 181 /* NewExpression */); return signature.minArgumentCount === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; - // If we are missing the close paren, the call is incomplete. + // If we are missing the close parenthesis, the call is incomplete. callIsIncomplete = callExpression.arguments.end === callExpression.end; typeArguments = callExpression.typeArguments; spreadArgIndex = getSpreadArgumentIndex(args); } // If the user supplied type arguments, but the number of type arguments does not match // the declared number of type parameters, the call has an incorrect arity. + var numTypeParameters = ts.length(signature.typeParameters); + var minTypeArgumentCount = getMinTypeArgumentCount(signature.typeParameters); var hasRightNumberOfTypeArgs = !typeArguments || - (signature.typeParameters && typeArguments.length === signature.typeParameters.length); + (typeArguments.length >= minTypeArgumentCount && typeArguments.length <= numTypeParameters); if (!hasRightNumberOfTypeArgs) { return false; } @@ -35531,10 +38581,10 @@ var ts; } // Instantiate a generic signature in the context of a non-generic signature (section 3.8.5 in TypeScript spec) function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper) { - var context = createInferenceContext(signature, /*inferUnionTypes*/ true); + var context = createInferenceContext(signature, /*inferUnionTypes*/ true, /*useAnyForNoInferences*/ false); forEachMatchingParameterType(contextualSignature, signature, function (source, target) { // Type parameters from outer context referenced by source type are fixed by instantiation of the source type - inferTypes(context, instantiateType(source, contextualMapper), target); + inferTypesWithContext(context, instantiateType(source, contextualMapper), target); }); return getSignatureInstantiation(signature, getInferredTypes(context)); } @@ -35565,7 +38615,7 @@ var ts; if (thisType) { var thisArgumentNode = getThisArgumentOfCall(node); var thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType; - inferTypes(context, thisArgumentType, thisType); + inferTypesWithContext(context, thisArgumentType, thisType); } // We perform two passes over the arguments. In the first pass we infer from all arguments, but use // wildcards for all context sensitive function expressions. @@ -35573,7 +38623,7 @@ var ts; for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); // If the effective argument is 'undefined', then it is an argument that is present but is synthetic. - if (arg === undefined || arg.kind !== 198 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 199 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i); // If the effective argument type is 'undefined', there is no synthetic type @@ -35584,7 +38634,7 @@ var ts; var mapper = excludeArgument && excludeArgument[i] !== undefined ? identityMapper : inferenceMapper; argType = checkExpressionWithContextualType(arg, paramType, mapper); } - inferTypes(context, argType, paramType); + inferTypesWithContext(context, argType, paramType); } } // In the second pass we visit only context sensitive arguments, and only those that aren't excluded, this @@ -35598,7 +38648,7 @@ var ts; if (excludeArgument[i] === false) { var arg = args[i]; var paramType = getTypeAtPosition(signature, i); - inferTypes(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); + inferTypesWithContext(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); } } } @@ -35608,7 +38658,7 @@ var ts; var typeParameters = signature.typeParameters; var typeArgumentsAreAssignable = true; var mapper; - for (var i = 0; i < typeParameters.length; i++) { + for (var i = 0; i < typeArgumentNodes.length; i++) { if (typeArgumentsAreAssignable /* so far */) { var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { @@ -35628,9 +38678,44 @@ var ts; } return typeArgumentsAreAssignable; } + /** + * Check if the given signature can possibly be a signature called by the JSX opening-like element. + * @param node a JSX opening-like element we are trying to figure its call signature + * @param signature a candidate signature we are trying whether it is a call signature + * @param relation a relationship to check parameter and argument type + * @param excludeArgument + */ + function checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation) { + // JSX opening-like element has correct arity for stateless-function component if the one of the following condition is true: + // 1. callIsIncomplete + // 2. attributes property has same number of properties as the parameter object type. + // We can figure that out by resolving attributes property and check number of properties in the resolved type + // If the call has correct arity, we will then check if the argument type and parameter type is assignable + var callIsIncomplete = node.attributes.end === node.end; // If we are missing the close "/>", the call is incomplete + if (callIsIncomplete) { + return true; + } + var headMessage = ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1; + // Stateless function components can have maximum of three arguments: "props", "context", and "updater". + // However "context" and "updater" are implicit and can't be specify by users. Only the first parameter, props, + // can be specified by users through attributes property. + var paramType = getTypeAtPosition(signature, 0); + var attributesType = checkExpressionWithContextualType(node.attributes, paramType, /*contextualMapper*/ undefined); + var argProperties = getPropertiesOfType(attributesType); + for (var _i = 0, argProperties_1 = argProperties; _i < argProperties_1.length; _i++) { + var arg = argProperties_1[_i]; + if (!getPropertyOfType(paramType, arg.name) && isUnhyphenatedJsxName(arg.name)) { + return false; + } + } + return checkTypeRelatedTo(attributesType, paramType, relation, /*errorNode*/ undefined, headMessage); + } function checkApplicableSignature(node, args, signature, relation, excludeArgument, reportErrors) { + if (ts.isJsxOpeningLikeElement(node)) { + return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation); + } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 180 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 181 /* NewExpression */) { // If the called expression is not of the form `x.f` or `x["f"]`, then sourceType = voidType // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible. // If the expression is a new expression, then the check is skipped. @@ -35647,7 +38732,7 @@ var ts; for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); // If the effective argument is 'undefined', then it is an argument that is present but is synthetic. - if (arg === undefined || arg.kind !== 198 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 199 /* OmittedExpression */) { // Check spread elements against rest type (from arity check we know spread argument corresponds to a rest parameter) var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i); @@ -35669,12 +38754,12 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 179 /* CallExpression */) { + if (node.kind === 180 /* CallExpression */) { var callee = node.expression; - if (callee.kind === 177 /* PropertyAccessExpression */) { + if (callee.kind === 178 /* PropertyAccessExpression */) { return callee.expression; } - else if (callee.kind === 178 /* ElementAccessExpression */) { + else if (callee.kind === 179 /* ElementAccessExpression */) { return callee.expression; } } @@ -35690,53 +38775,56 @@ var ts; */ function getEffectiveCallArguments(node) { var args; - if (node.kind === 181 /* TaggedTemplateExpression */) { + if (node.kind === 182 /* TaggedTemplateExpression */) { var template = node.template; args = [undefined]; - if (template.kind === 194 /* TemplateExpression */) { + if (template.kind === 195 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); } } - else if (node.kind === 145 /* Decorator */) { + else if (node.kind === 146 /* Decorator */) { // For a decorator, we return undefined as we will determine // the number and types of arguments for a decorator using // `getEffectiveArgumentCount` and `getEffectiveArgumentType` below. return undefined; } + else if (ts.isJsxOpeningLikeElement(node)) { + args = node.attributes.properties.length > 0 ? [node.attributes] : emptyArray; + } else { args = node.arguments || emptyArray; } return args; } /** - * Returns the effective argument count for a node that works like a function invocation. - * If 'node' is a Decorator, the number of arguments is derived from the decoration - * target and the signature: - * If 'node.target' is a class declaration or class expression, the effective argument - * count is 1. - * If 'node.target' is a parameter declaration, the effective argument count is 3. - * If 'node.target' is a property declaration, the effective argument count is 2. - * If 'node.target' is a method or accessor declaration, the effective argument count - * is 3, although it can be 2 if the signature only accepts two arguments, allowing - * us to match a property decorator. - * Otherwise, the argument count is the length of the 'args' array. - */ + * Returns the effective argument count for a node that works like a function invocation. + * If 'node' is a Decorator, the number of arguments is derived from the decoration + * target and the signature: + * If 'node.target' is a class declaration or class expression, the effective argument + * count is 1. + * If 'node.target' is a parameter declaration, the effective argument count is 3. + * If 'node.target' is a property declaration, the effective argument count is 2. + * If 'node.target' is a method or accessor declaration, the effective argument count + * is 3, although it can be 2 if the signature only accepts two arguments, allowing + * us to match a property decorator. + * Otherwise, the argument count is the length of the 'args' array. + */ function getEffectiveArgumentCount(node, args, signature) { - if (node.kind === 145 /* Decorator */) { + if (node.kind === 146 /* Decorator */) { switch (node.parent.kind) { - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: // A class decorator will have one argument (see `ClassDecorator` in core.d.ts) return 1; - case 147 /* PropertyDeclaration */: + case 148 /* PropertyDeclaration */: // A property declaration decorator will have two arguments (see // `PropertyDecorator` in core.d.ts) return 2; - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts) // If we are emitting decorators for ES3, we will only pass two arguments. @@ -35746,7 +38834,7 @@ var ts; // If the method decorator signature only accepts a target and a key, we will only // type check those arguments. return signature.parameters.length >= 3 ? 3 : 2; - case 144 /* Parameter */: + case 145 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts) return 3; @@ -35757,38 +38845,38 @@ var ts; } } /** - * Returns the effective type of the first argument to a decorator. - * If 'node' is a class declaration or class expression, the effective argument type - * is the type of the static side of the class. - * If 'node' is a parameter declaration, the effective argument type is either the type - * of the static or instance side of the class for the parameter's parent method, - * depending on whether the method is declared static. - * For a constructor, the type is always the type of the static side of the class. - * If 'node' is a property, method, or accessor declaration, the effective argument - * type is the type of the static or instance side of the parent class for class - * element, depending on whether the element is declared static. - */ + * Returns the effective type of the first argument to a decorator. + * If 'node' is a class declaration or class expression, the effective argument type + * is the type of the static side of the class. + * If 'node' is a parameter declaration, the effective argument type is either the type + * of the static or instance side of the class for the parameter's parent method, + * depending on whether the method is declared static. + * For a constructor, the type is always the type of the static side of the class. + * If 'node' is a property, method, or accessor declaration, the effective argument + * type is the type of the static or instance side of the parent class for class + * element, depending on whether the element is declared static. + */ function getEffectiveDecoratorFirstArgumentType(node) { // The first argument to a decorator is its `target`. - if (node.kind === 226 /* ClassDeclaration */) { + if (node.kind === 228 /* ClassDeclaration */) { // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class) var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } - if (node.kind === 144 /* Parameter */) { + if (node.kind === 145 /* Parameter */) { // For a parameter decorator, the `target` is the parent type of the // parameter's containing method. node = node.parent; - if (node.kind === 150 /* Constructor */) { + if (node.kind === 151 /* Constructor */) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } } - if (node.kind === 147 /* PropertyDeclaration */ || - node.kind === 149 /* MethodDeclaration */ || - node.kind === 151 /* GetAccessor */ || - node.kind === 152 /* SetAccessor */) { + if (node.kind === 148 /* PropertyDeclaration */ || + node.kind === 150 /* MethodDeclaration */ || + node.kind === 152 /* GetAccessor */ || + node.kind === 153 /* SetAccessor */) { // For a property or method decorator, the `target` is the // "static"-side type of the parent of the member if the member is // declared "static"; otherwise, it is the "instance"-side type of the @@ -35799,37 +38887,39 @@ var ts; return unknownType; } /** - * Returns the effective type for the second argument to a decorator. - * If 'node' is a parameter, its effective argument type is one of the following: - * If 'node.parent' is a constructor, the effective argument type is 'any', as we - * will emit `undefined`. - * If 'node.parent' is a member with an identifier, numeric, or string literal name, - * the effective argument type will be a string literal type for the member name. - * If 'node.parent' is a computed property name, the effective argument type will - * either be a symbol type or the string type. - * If 'node' is a member with an identifier, numeric, or string literal name, the - * effective argument type will be a string literal type for the member name. - * If 'node' is a computed property name, the effective argument type will either - * be a symbol type or the string type. - * A class decorator does not have a second argument type. - */ + * Returns the effective type for the second argument to a decorator. + * If 'node' is a parameter, its effective argument type is one of the following: + * If 'node.parent' is a constructor, the effective argument type is 'any', as we + * will emit `undefined`. + * If 'node.parent' is a member with an identifier, numeric, or string literal name, + * the effective argument type will be a string literal type for the member name. + * If 'node.parent' is a computed property name, the effective argument type will + * either be a symbol type or the string type. + * If 'node' is a member with an identifier, numeric, or string literal name, the + * effective argument type will be a string literal type for the member name. + * If 'node' is a computed property name, the effective argument type will either + * be a symbol type or the string type. + * A class decorator does not have a second argument type. + */ function getEffectiveDecoratorSecondArgumentType(node) { // The second argument to a decorator is its `propertyKey` - if (node.kind === 226 /* ClassDeclaration */) { + if (node.kind === 228 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a second synthetic argument."); return unknownType; } - if (node.kind === 144 /* Parameter */) { + if (node.kind === 145 /* Parameter */) { node = node.parent; - if (node.kind === 150 /* Constructor */) { + if (node.kind === 151 /* Constructor */) { // For a constructor parameter decorator, the `propertyKey` will be `undefined`. return anyType; } + // For a non-constructor parameter decorator, the `propertyKey` will be either + // a string or a symbol, based on the name of the parameter's containing method. } - if (node.kind === 147 /* PropertyDeclaration */ || - node.kind === 149 /* MethodDeclaration */ || - node.kind === 151 /* GetAccessor */ || - node.kind === 152 /* SetAccessor */) { + if (node.kind === 148 /* PropertyDeclaration */ || + node.kind === 150 /* MethodDeclaration */ || + node.kind === 152 /* GetAccessor */ || + node.kind === 153 /* SetAccessor */) { // The `propertyKey` for a property or method decorator will be a // string literal type if the member name is an identifier, number, or string; // otherwise, if the member name is a computed property name it will @@ -35840,7 +38930,7 @@ var ts; case 8 /* NumericLiteral */: case 9 /* StringLiteral */: return getLiteralTypeForText(32 /* StringLiteral */, element.name.text); - case 142 /* ComputedPropertyName */: + case 143 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(element.name); if (isTypeOfKind(nameType, 512 /* ESSymbol */)) { return nameType; @@ -35857,30 +38947,30 @@ var ts; return unknownType; } /** - * Returns the effective argument type for the third argument to a decorator. - * If 'node' is a parameter, the effective argument type is the number type. - * If 'node' is a method or accessor, the effective argument type is a - * `TypedPropertyDescriptor` instantiated with the type of the member. - * Class and property decorators do not have a third effective argument. - */ + * Returns the effective argument type for the third argument to a decorator. + * If 'node' is a parameter, the effective argument type is the number type. + * If 'node' is a method or accessor, the effective argument type is a + * `TypedPropertyDescriptor` instantiated with the type of the member. + * Class and property decorators do not have a third effective argument. + */ function getEffectiveDecoratorThirdArgumentType(node) { // The third argument to a decorator is either its `descriptor` for a method decorator // or its `parameterIndex` for a parameter decorator - if (node.kind === 226 /* ClassDeclaration */) { + if (node.kind === 228 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 144 /* Parameter */) { + if (node.kind === 145 /* Parameter */) { // The `parameterIndex` for a parameter decorator is always a number return numberType; } - if (node.kind === 147 /* PropertyDeclaration */) { + if (node.kind === 148 /* PropertyDeclaration */) { ts.Debug.fail("Property decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 149 /* MethodDeclaration */ || - node.kind === 151 /* GetAccessor */ || - node.kind === 152 /* SetAccessor */) { + if (node.kind === 150 /* MethodDeclaration */ || + node.kind === 152 /* GetAccessor */ || + node.kind === 153 /* SetAccessor */) { // The `descriptor` for a method decorator will be a `TypedPropertyDescriptor` // for the type of the member. var propertyType = getTypeOfNode(node); @@ -35890,8 +38980,8 @@ var ts; return unknownType; } /** - * Returns the effective argument type for the provided argument to a decorator. - */ + * Returns the effective argument type for the provided argument to a decorator. + */ function getEffectiveDecoratorArgumentType(node, argIndex) { if (argIndex === 0) { return getEffectiveDecoratorFirstArgumentType(node.parent); @@ -35906,16 +38996,16 @@ var ts; return unknownType; } /** - * Gets the effective argument type for an argument in a call expression. - */ + * Gets the effective argument type for an argument in a call expression. + */ function getEffectiveArgumentType(node, argIndex) { // Decorators provide special arguments, a tagged template expression provides // a special first argument, and string literals get string literal types // unless we're reporting errors - if (node.kind === 145 /* Decorator */) { + if (node.kind === 146 /* Decorator */) { return getEffectiveDecoratorArgumentType(node, argIndex); } - else if (argIndex === 0 && node.kind === 181 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 182 /* TaggedTemplateExpression */) { return getGlobalTemplateStringsArrayType(); } // This is not a synthetic argument, so we return 'undefined' @@ -35923,25 +39013,25 @@ var ts; return undefined; } /** - * Gets the effective argument expression for an argument in a call expression. - */ + * Gets the effective argument expression for an argument in a call expression. + */ function getEffectiveArgument(node, args, argIndex) { // For a decorator or the first argument of a tagged template expression we return undefined. - if (node.kind === 145 /* Decorator */ || - (argIndex === 0 && node.kind === 181 /* TaggedTemplateExpression */)) { + if (node.kind === 146 /* Decorator */ || + (argIndex === 0 && node.kind === 182 /* TaggedTemplateExpression */)) { return undefined; } return args[argIndex]; } /** - * Gets the error node to use when reporting errors for an effective argument. - */ + * Gets the error node to use when reporting errors for an effective argument. + */ function getEffectiveArgumentErrorNode(node, argIndex, arg) { - if (node.kind === 145 /* Decorator */) { + if (node.kind === 146 /* Decorator */) { // For a decorator, we use the expression of the decorator for error reporting. return node.expression; } - else if (argIndex === 0 && node.kind === 181 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 182 /* TaggedTemplateExpression */) { // For a the first argument of a tagged template expression, we use the template of the tag for error reporting. return node.template; } @@ -35950,16 +39040,31 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray, headMessage) { - var isTaggedTemplate = node.kind === 181 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 145 /* Decorator */; + var isTaggedTemplate = node.kind === 182 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 146 /* Decorator */; + var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var typeArguments; - if (!isTaggedTemplate && !isDecorator) { + if (!isTaggedTemplate && !isDecorator && !isJsxOpeningOrSelfClosingElement) { typeArguments = node.typeArguments; // We already perform checking on the type arguments on the class declaration itself. if (node.expression.kind !== 96 /* SuperKeyword */) { ts.forEach(typeArguments, checkSourceElement); } } + if (signatures.length === 1) { + var declaration = signatures[0].declaration; + if (declaration && ts.isInJavaScriptFile(declaration) && !ts.hasJSDocParameterTags(declaration)) { + if (containsArgumentsReference(declaration)) { + var signatureWithRest = cloneSignature(signatures[0]); + var syntheticArgsSymbol = createSymbol(3 /* Variable */, "args"); + syntheticArgsSymbol.type = anyArrayType; + syntheticArgsSymbol.isRestParameter = true; + signatureWithRest.parameters = ts.concatenate(signatureWithRest.parameters, [syntheticArgsSymbol]); + signatureWithRest.hasRestParameter = true; + signatures = [signatureWithRest]; + } + } + } var candidates = candidatesOutArray || []; // reorderCandidates fills up the candidates array directly reorderCandidates(signatures, candidates); @@ -36022,7 +39127,7 @@ var ts; var result; // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. - var signatureHelpTrailingComma = candidatesOutArray && node.kind === 179 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = candidatesOutArray && node.kind === 180 /* CallExpression */ && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument // expression is a subtype of each corresponding parameter type, the return type of the first @@ -36051,6 +39156,10 @@ var ts; // If candidate is undefined, it means that no candidates had a suitable arity. In that case, // skip the checkApplicableSignature check. if (candidateForArgumentError) { + if (isJsxOpeningOrSelfClosingElement) { + // We do not report any error here because any error will be handled in "resolveCustomJsxElementAttributesType". + return candidateForArgumentError; + } // excludeArgument is undefined, in this case also equivalent to [undefined, undefined, ...] // The importance of excludeArgument is to prevent us from typing function expression parameters // in arguments too early. If possible, we'd like to only type them once we know the correct @@ -36072,7 +39181,7 @@ var ts; if (headMessage) { diagnosticChainHead = ts.chainDiagnosticMessages(diagnosticChainHead, headMessage); } - reportNoCommonSupertypeError(inferenceCandidates, node.expression || node.tag, diagnosticChainHead); + reportNoCommonSupertypeError(inferenceCandidates, node.tagName || node.expression || node.tag, diagnosticChainHead); } } else { @@ -36113,20 +39222,20 @@ var ts; var candidate = void 0; var typeArgumentsAreValid = void 0; var inferenceContext = originalCandidate.typeParameters - ? createInferenceContext(originalCandidate, /*inferUnionTypes*/ false) + ? createInferenceContext(originalCandidate, /*inferUnionTypes*/ false, /*useAnyForNoInferences*/ ts.isInJavaScriptFile(node)) : undefined; while (true) { candidate = originalCandidate; if (candidate.typeParameters) { var typeArgumentTypes = void 0; if (typeArguments) { - typeArgumentTypes = ts.map(typeArguments, getTypeFromTypeNode); + typeArgumentTypes = fillMissingTypeArguments(ts.map(typeArguments, getTypeFromTypeNode), candidate.typeParameters, getMinTypeArgumentCount(candidate.typeParameters)); typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, /*reportErrors*/ false); } else { inferTypeArguments(node, candidate, args, excludeArgument, inferenceContext); - typeArgumentsAreValid = inferenceContext.failedTypeParameterIndex === undefined; typeArgumentTypes = inferenceContext.inferredTypes; + typeArgumentsAreValid = inferenceContext.failedTypeParameterIndex === undefined; } if (!typeArgumentsAreValid) { break; @@ -36136,7 +39245,7 @@ var ts; if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, /*reportErrors*/ false)) { break; } - var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; + var index = excludeArgument ? ts.indexOf(excludeArgument, /*value*/ true) : -1; if (index < 0) { return candidate; } @@ -36175,7 +39284,7 @@ var ts; // with the type arguments specified in the extends clause. var baseTypeNode = ts.getClassExtendsHeritageClauseElement(ts.getContainingClass(node)); if (baseTypeNode) { - var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments); + var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments, baseTypeNode); return resolveCall(node, baseConstructors, candidatesOutArray); } } @@ -36329,12 +39438,13 @@ var ts; if (containingClass) { var containingType = getTypeOfNode(containingClass); var baseTypes = getBaseTypes(containingType); - if (baseTypes.length) { + while (baseTypes.length) { var baseType = baseTypes[0]; if (modifiers & 16 /* Protected */ && baseType.symbol === declaration.parent.symbol) { return true; } + baseTypes = getBaseTypes(baseType); } } if (modifiers & 8 /* Private */) { @@ -36366,26 +39476,26 @@ var ts; return resolveCall(node, callSignatures, candidatesOutArray); } /** - * Gets the localized diagnostic head message to use for errors when resolving a decorator as a call expression. - */ + * Gets the localized diagnostic head message to use for errors when resolving a decorator as a call expression. + */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 144 /* Parameter */: + case 145 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 147 /* PropertyDeclaration */: + case 148 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; } } /** - * Resolves a decorator as if it were a call expression. - */ + * Resolves a decorator as if it were a call expression. + */ function resolveDecorator(node, candidatesOutArray) { var funcType = checkExpression(node.expression); var apparentType = getApparentType(funcType); @@ -36407,21 +39517,73 @@ var ts; } return resolveCall(node, callSignatures, candidatesOutArray, headMessage); } + /** + * This function is similar to getResolvedSignature but is exclusively for trying to resolve JSX stateless-function component. + * The main reason we have to use this function instead of getResolvedSignature because, the caller of this function will already check the type of openingLikeElement's tagName + * and pass the type as elementType. The elementType can not be a union (as such case should be handled by the caller of this function) + * Note: at this point, we are still not sure whether the opening-like element is a stateless function component or not. + * @param openingLikeElement an opening-like JSX element to try to resolve as JSX stateless function + * @param elementType an element type of the opneing-like element by checking opening-like element's tagname. + * @param candidatesOutArray an array of signature to be filled in by the function. It is passed by signature help in the language service; + * the function will fill it up with appropriate candidate signatures + */ + function getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, candidatesOutArray) { + ts.Debug.assert(!(elementType.flags & 65536 /* Union */)); + var callSignature = resolveStatelessJsxOpeningLikeElement(openingLikeElement, elementType, candidatesOutArray); + return callSignature; + } + /** + * Try treating a given opening-like element as stateless function component and resolve a tagName to a function signature. + * @param openingLikeElement an JSX opening-like element we want to try resolve its stateless function if possible + * @param elementType a type of the opening-like JSX element, a result of resolving tagName in opening-like element. + * @param candidatesOutArray an array of signature to be filled in by the function. It is passed by signature help in the language service; + * the function will fill it up with appropriate candidate signatures + * @return a resolved signature if we can find function matching function signature through resolve call or a first signature in the list of functions. + * otherwise return undefined if tag-name of the opening-like element doesn't have call signatures + */ + function resolveStatelessJsxOpeningLikeElement(openingLikeElement, elementType, candidatesOutArray) { + // If this function is called from language service, elementType can be a union type. This is not possible if the function is called from compiler (see: resolveCustomJsxElementAttributesType) + if (elementType.flags & 65536 /* Union */) { + var types = elementType.types; + var result = void 0; + for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { + var type = types_18[_i]; + result = result || resolveStatelessJsxOpeningLikeElement(openingLikeElement, type, candidatesOutArray); + } + return result; + } + var callSignatures = elementType && getSignaturesOfType(elementType, 0 /* Call */); + if (callSignatures && callSignatures.length > 0) { + var callSignature = void 0; + callSignature = resolveCall(openingLikeElement, callSignatures, candidatesOutArray); + return callSignature; + } + return undefined; + } function resolveSignature(node, candidatesOutArray) { switch (node.kind) { - case 179 /* CallExpression */: + case 180 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray); - case 180 /* NewExpression */: + case 181 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray); - case 181 /* TaggedTemplateExpression */: + case 182 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray); - case 145 /* Decorator */: + case 146 /* Decorator */: return resolveDecorator(node, candidatesOutArray); + case 250 /* JsxOpeningElement */: + case 249 /* JsxSelfClosingElement */: + // This code-path is called by language service + return resolveStatelessJsxOpeningLikeElement(node, checkExpression(node.tagName), candidatesOutArray); } ts.Debug.fail("Branch in 'resolveSignature' should be unreachable."); } - // candidatesOutArray is passed by signature help in the language service, and collectCandidates - // must fill it up with the appropriate candidate signatures + /** + * Resolve a signature of a given call-like expression. + * @param node a call-like expression to try resolve a signature for + * @param candidatesOutArray an array of signature to be filled in by the function. It is passed by signature help in the language service; + * the function will fill it up with appropriate candidate signatures + * @return a signature of the call-like expression or undefined if one can't be found + */ function getResolvedSignature(node, candidatesOutArray) { var links = getNodeLinks(node); // If getResolvedSignature has already been called, we will have cached the resolvedSignature. @@ -36464,12 +39626,12 @@ var ts; if (node.expression.kind === 96 /* SuperKeyword */) { return voidType; } - if (node.kind === 180 /* NewExpression */) { + if (node.kind === 181 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 150 /* Constructor */ && - declaration.kind !== 154 /* ConstructSignature */ && - declaration.kind !== 159 /* ConstructorType */ && + declaration.kind !== 151 /* Constructor */ && + declaration.kind !== 155 /* ConstructSignature */ && + declaration.kind !== 160 /* ConstructorType */ && !ts.isJSDocConstructSignature(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any, unless // the declaring function had members created through 'x.prototype.y = expr' or 'this.y = expr' psuedodeclarations @@ -36479,10 +39641,13 @@ var ts; var funcSymbol = node.expression.kind === 70 /* Identifier */ ? getResolvedSymbol(node.expression) : checkExpression(node.expression).symbol; - if (funcSymbol && funcSymbol.members && (funcSymbol.flags & 16 /* Function */ || ts.isDeclarationOfFunctionExpression(funcSymbol))) { + if (funcSymbol && ts.isDeclarationOfFunctionOrClassExpression(funcSymbol)) { + funcSymbol = getSymbolOfNode(funcSymbol.valueDeclaration.initializer); + } + if (funcSymbol && funcSymbol.members && funcSymbol.flags & 16 /* Function */) { return getInferredClassType(funcSymbol); } - else if (compilerOptions.noImplicitAny) { + else if (noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } return anyType; @@ -36509,9 +39674,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 225 /* FunctionDeclaration */ + ? 227 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 223 /* VariableDeclaration */ + ? 225 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -36538,6 +39703,22 @@ var ts; function checkNonNullAssertion(node) { return getNonNullableType(checkExpression(node.expression)); } + function checkMetaProperty(node) { + checkGrammarMetaProperty(node); + var container = ts.getNewTargetContainer(node); + if (!container) { + error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); + return unknownType; + } + else if (container.kind === 151 /* Constructor */) { + var symbol = getSymbolOfNode(container.parent); + return getTypeOfSymbol(symbol); + } + else { + var symbol = getSymbolOfNode(container); + return getTypeOfSymbol(symbol); + } + } function getTypeOfParameter(symbol) { var type = getTypeOfSymbol(symbol); if (strictNullChecks) { @@ -36553,13 +39734,16 @@ var ts; pos < signature.parameters.length - 1 ? getTypeOfParameter(signature.parameters[pos]) : getRestTypeOfSignature(signature) : pos < signature.parameters.length ? getTypeOfParameter(signature.parameters[pos]) : anyType; } - function assignContextualParameterTypes(signature, context, mapper) { + function getTypeOfFirstParameterOfSignature(signature) { + return signature.parameters.length > 0 ? getTypeAtPosition(signature, 0) : neverType; + } + function assignContextualParameterTypes(signature, context, mapper, checkMode) { var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0); - if (isInferentialContext(mapper)) { + if (checkMode === 2 /* Inferential */) { for (var i = 0; i < len; i++) { var declaration = signature.parameters[i].valueDeclaration; if (declaration.type) { - inferTypes(mapper.context, getTypeFromTypeNode(declaration.type), getTypeAtPosition(context, i)); + inferTypesWithContext(mapper.context, getTypeFromTypeNode(declaration.type), getTypeAtPosition(context, i)); } } } @@ -36567,23 +39751,23 @@ var ts; var parameter = signature.thisParameter; if (!parameter || parameter.valueDeclaration && !parameter.valueDeclaration.type) { if (!parameter) { - signature.thisParameter = createTransientSymbol(context.thisParameter, undefined); + signature.thisParameter = createSymbolWithType(context.thisParameter, /*type*/ undefined); } - assignTypeToParameterAndFixTypeParameters(signature.thisParameter, getTypeOfSymbol(context.thisParameter), mapper); + assignTypeToParameterAndFixTypeParameters(signature.thisParameter, getTypeOfSymbol(context.thisParameter), mapper, checkMode); } } for (var i = 0; i < len; i++) { var parameter = signature.parameters[i]; if (!parameter.valueDeclaration.type) { var contextualParameterType = getTypeAtPosition(context, i); - assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper); + assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper, checkMode); } } if (signature.hasRestParameter && isRestParameterIndex(context, signature.parameters.length - 1)) { var parameter = ts.lastOrUndefined(signature.parameters); if (!parameter.valueDeclaration.type) { var contextualParameterType = getTypeOfSymbol(ts.lastOrUndefined(context.parameters)); - assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper); + assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper, checkMode); } } } @@ -36602,19 +39786,19 @@ var ts; } } } - function assignTypeToParameterAndFixTypeParameters(parameter, contextualType, mapper) { + function assignTypeToParameterAndFixTypeParameters(parameter, contextualType, mapper, checkMode) { var links = getSymbolLinks(parameter); if (!links.type) { links.type = instantiateType(contextualType, mapper); // if inference didn't come up with anything but {}, fall back to the binding pattern if present. if (links.type === emptyObjectType && - (parameter.valueDeclaration.name.kind === 172 /* ObjectBindingPattern */ || - parameter.valueDeclaration.name.kind === 173 /* ArrayBindingPattern */)) { + (parameter.valueDeclaration.name.kind === 173 /* ObjectBindingPattern */ || + parameter.valueDeclaration.name.kind === 174 /* ArrayBindingPattern */)) { links.type = getTypeFromBindingPattern(parameter.valueDeclaration.name); } assignBindingElementTypes(parameter.valueDeclaration); } - else if (isInferentialContext(mapper)) { + else if (checkMode === 2 /* Inferential */) { // Even if the parameter already has a type, it might be because it was given a type while // processing the function as an argument to a prior signature during overload resolution. // If this was the case, it may have caused some type parameters to be fixed. So here, @@ -36644,7 +39828,7 @@ var ts; // T in the second overload so that we do not infer Base as a candidate for T // (inferring Base would make type argument inference inconsistent between the two // overloads). - inferTypes(mapper.context, links.type, instantiateType(contextualType, mapper)); + inferTypesWithContext(mapper.context, links.type, instantiateType(contextualType, mapper)); } } function getReturnTypeFromJSDocComment(func) { @@ -36656,10 +39840,10 @@ var ts; } function createPromiseType(promisedType) { // creates a `Promise` type where `T` is the promisedType argument - var globalPromiseType = getGlobalPromiseType(); + var globalPromiseType = getGlobalPromiseType(/*reportErrors*/ true); if (globalPromiseType !== emptyGenericType) { // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type - promisedType = getAwaitedType(promisedType); + promisedType = getAwaitedType(promisedType) || emptyObjectType; return createTypeReference(globalPromiseType, [promisedType]); } return emptyObjectType; @@ -36670,53 +39854,63 @@ var ts; error(func, ts.Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option); return unknownType; } + else if (!getGlobalPromiseConstructorSymbol(/*reportErrors*/ true)) { + error(func, ts.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option); + } return promiseType; } - function getReturnTypeFromBody(func, contextualMapper) { + function getReturnTypeFromBody(func, checkMode) { var contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func); if (!func.body) { return unknownType; } - var isAsync = ts.isAsyncFunctionLike(func); + var functionFlags = ts.getFunctionFlags(func); var type; - if (func.body.kind !== 204 /* Block */) { - type = checkExpressionCached(func.body, contextualMapper); - if (isAsync) { + if (func.body.kind !== 206 /* Block */) { + type = checkExpressionCached(func.body, checkMode); + if (functionFlags & 2 /* Async */) { // From within an async function you can return either a non-promise value or a promise. Any // Promise/A+ compatible implementation will always assimilate any foreign promise, so the // return type of the body should be unwrapped to its awaited type, which we will wrap in // the native Promise type later in this function. - type = checkAwaitedType(type, func, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); + type = checkAwaitedType(type, /*errorNode*/ func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } } else { var types = void 0; - var funcIsGenerator = !!func.asteriskToken; - if (funcIsGenerator) { - types = checkAndAggregateYieldOperandTypes(func, contextualMapper); - if (types.length === 0) { - var iterableIteratorAny = createIterableIteratorType(anyType); - if (compilerOptions.noImplicitAny) { + if (functionFlags & 1 /* Generator */) { + types = ts.concatenate(checkAndAggregateYieldOperandTypes(func, checkMode), checkAndAggregateReturnExpressionTypes(func, checkMode)); + if (!types || types.length === 0) { + var iterableIteratorAny = functionFlags & 2 /* Async */ + ? createAsyncIterableIteratorType(anyType) // AsyncGenerator function + : createIterableIteratorType(anyType); // Generator function + if (noImplicitAny) { error(func.asteriskToken, ts.Diagnostics.Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type, typeToString(iterableIteratorAny)); } return iterableIteratorAny; } } else { - types = checkAndAggregateReturnExpressionTypes(func, contextualMapper); + types = checkAndAggregateReturnExpressionTypes(func, checkMode); if (!types) { // For an async function, the return type will not be never, but rather a Promise for never. - return isAsync ? createPromiseReturnType(func, neverType) : neverType; + return functionFlags & 2 /* Async */ + ? createPromiseReturnType(func, neverType) // Async function + : neverType; // Normal function } if (types.length === 0) { // For an async function, the return type will not be void, but rather a Promise for void. - return isAsync ? createPromiseReturnType(func, voidType) : voidType; + return functionFlags & 2 /* Async */ + ? createPromiseReturnType(func, voidType) // Async function + : voidType; // Normal function } } // Return a union of the return expression types. type = getUnionType(types, /*subtypeReduction*/ true); - if (funcIsGenerator) { - type = createIterableIteratorType(type); + if (functionFlags & 1 /* Generator */) { + type = functionFlags & 2 /* Async */ + ? createAsyncIterableIteratorType(type) // AsyncGenerator function + : createIterableIteratorType(type); // Generator function } } if (!contextualSignature) { @@ -36731,17 +39925,25 @@ var ts; // From within an async function you can return either a non-promise value or a promise. Any // Promise/A+ compatible implementation will always assimilate any foreign promise, so the // return type of the body is awaited type of the body, wrapped in a native Promise type. - return isAsync ? createPromiseReturnType(func, widenedType) : widenedType; + return (functionFlags & 3 /* AsyncOrAsyncGenerator */) === 2 /* Async */ + ? createPromiseReturnType(func, widenedType) // Async function + : widenedType; // Generator function, AsyncGenerator function, or normal function } - function checkAndAggregateYieldOperandTypes(func, contextualMapper) { + function checkAndAggregateYieldOperandTypes(func, checkMode) { var aggregatedTypes = []; + var functionFlags = ts.getFunctionFlags(func); ts.forEachYieldExpression(func.body, function (yieldExpression) { var expr = yieldExpression.expression; if (expr) { - var type = checkExpressionCached(expr, contextualMapper); + var type = checkExpressionCached(expr, checkMode); if (yieldExpression.asteriskToken) { // A yield* expression effectively yields everything that its operand yields - type = checkElementTypeOfIterable(type, yieldExpression.expression); + type = checkIteratedTypeOrElementType(type, yieldExpression.expression, /*allowStringInput*/ false, (functionFlags & 2 /* Async */) !== 0); + } + if (functionFlags & 2 /* Async */) { + type = checkAwaitedType(type, expr, yieldExpression.asteriskToken + ? ts.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + : ts.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } if (!ts.contains(aggregatedTypes, type)) { aggregatedTypes.push(type); @@ -36762,33 +39964,33 @@ var ts; if (!switchTypes.length) { return false; } - return eachTypeContainedIn(type, switchTypes); + return eachTypeContainedIn(mapType(type, getRegularTypeOfLiteralType), switchTypes); } function functionHasImplicitReturn(func) { if (!(func.flags & 128 /* HasImplicitReturn */)) { return false; } var lastStatement = ts.lastOrUndefined(func.body.statements); - if (lastStatement && lastStatement.kind === 218 /* SwitchStatement */ && isExhaustiveSwitchStatement(lastStatement)) { + if (lastStatement && lastStatement.kind === 220 /* SwitchStatement */ && isExhaustiveSwitchStatement(lastStatement)) { return false; } return true; } - function checkAndAggregateReturnExpressionTypes(func, contextualMapper) { - var isAsync = ts.isAsyncFunctionLike(func); + function checkAndAggregateReturnExpressionTypes(func, checkMode) { + var functionFlags = ts.getFunctionFlags(func); var aggregatedTypes = []; var hasReturnWithNoExpression = functionHasImplicitReturn(func); var hasReturnOfTypeNever = false; ts.forEachReturnStatement(func.body, function (returnStatement) { var expr = returnStatement.expression; if (expr) { - var type = checkExpressionCached(expr, contextualMapper); - if (isAsync) { + var type = checkExpressionCached(expr, checkMode); + if (functionFlags & 2 /* Async */) { // From within an async function you can return either a non-promise value or a promise. Any // Promise/A+ compatible implementation will always assimilate any foreign promise, so the // return type of the body should be unwrapped to its awaited type, which should be wrapped in // the native Promise type by the caller. - type = checkAwaitedType(type, func, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); + type = checkAwaitedType(type, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } if (type.flags & 8192 /* Never */) { hasReturnOfTypeNever = true; @@ -36802,7 +40004,7 @@ var ts; } }); if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever || - func.kind === 184 /* FunctionExpression */ || func.kind === 185 /* ArrowFunction */)) { + func.kind === 185 /* FunctionExpression */ || func.kind === 186 /* ArrowFunction */)) { return undefined; } if (strictNullChecks && aggregatedTypes.length && hasReturnWithNoExpression) { @@ -36831,7 +40033,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (ts.nodeIsMissing(func.body) || func.body.kind !== 204 /* Block */ || !functionHasImplicitReturn(func)) { + if (ts.nodeIsMissing(func.body) || func.body.kind !== 206 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 256 /* HasExplicitReturn */; @@ -36863,22 +40065,22 @@ var ts; error(func.type || func, ts.Diagnostics.Not_all_code_paths_return_a_value); } } - function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) { - ts.Debug.assert(node.kind !== 149 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { + ts.Debug.assert(node.kind !== 150 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 184 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 185 /* FunctionExpression */) { checkGrammarForGenerator(node); } // The identityMapper object is used to indicate that function expressions are wildcards - if (contextualMapper === identityMapper && isContextSensitive(node)) { + if (checkMode === 1 /* SkipContextSensitive */ && isContextSensitive(node)) { checkNodeDeferred(node); return anyFunctionType; } var links = getNodeLinks(node); var type = getTypeOfSymbol(node.symbol); var contextSensitive = isContextSensitive(node); - var mightFixTypeParameters = contextSensitive && isInferentialContext(contextualMapper); + var mightFixTypeParameters = contextSensitive && checkMode === 2 /* Inferential */; // Check if function expression is contextually typed and assign parameter types if so. // See the comment in assignTypeToParameterAndFixTypeParameters to understand why we need to // check mightFixTypeParameters. @@ -36893,10 +40095,10 @@ var ts; if (contextualSignature) { var signature = getSignaturesOfType(type, 0 /* Call */)[0]; if (contextSensitive) { - assignContextualParameterTypes(signature, contextualSignature, contextualMapper || identityMapper); + assignContextualParameterTypes(signature, contextualSignature, getContextualMapper(node), checkMode); } if (mightFixTypeParameters || !node.type && !signature.resolvedReturnType) { - var returnType = getReturnTypeFromBody(node, contextualMapper); + var returnType = getReturnTypeFromBody(node, checkMode); if (!signature.resolvedReturnType) { signature.resolvedReturnType = returnType; } @@ -36908,17 +40110,21 @@ var ts; } } } - if (produceDiagnostics && node.kind !== 149 /* MethodDeclaration */) { + if (produceDiagnostics && node.kind !== 150 /* MethodDeclaration */) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); } return type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 149 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); - var isAsync = ts.isAsyncFunctionLike(node); - var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); - if (!node.asteriskToken) { + ts.Debug.assert(node.kind !== 150 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + var functionFlags = ts.getFunctionFlags(node); + var returnOrPromisedType = node.type && + ((functionFlags & 3 /* AsyncOrAsyncGenerator */) === 2 /* Async */ ? + checkAsyncFunctionReturnType(node) : + getTypeFromTypeNode(node.type)); // AsyncGenerator function, Generator function, or normal function + if ((functionFlags & 1 /* Generator */) === 0) { // return is not necessary in the body of generators checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } @@ -36931,7 +40137,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 204 /* Block */) { + if (node.body.kind === 206 /* Block */) { checkSourceElement(node.body); } else { @@ -36942,8 +40148,8 @@ var ts; // its return type annotation. var exprType = checkExpression(node.body); if (returnOrPromisedType) { - if (isAsync) { - var awaitedType = checkAwaitedType(exprType, node.body, ts.Diagnostics.Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member); + if ((functionFlags & 3 /* AsyncOrAsyncGenerator */) === 2 /* Async */) { + var awaitedType = checkAwaitedType(exprType, node.body, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); checkTypeAssignableTo(awaitedType, returnOrPromisedType, node.body); } else { @@ -36968,21 +40174,21 @@ var ts; // Get accessors without matching set accessors // Enum members // Unions and intersections of the above (unions and intersections eagerly set isReadonly on creation) - return symbol.isReadonly || - symbol.flags & 4 /* Property */ && (getDeclarationModifierFlagsFromSymbol(symbol) & 64 /* Readonly */) !== 0 || - symbol.flags & 3 /* Variable */ && (getDeclarationNodeFlagsFromSymbol(symbol) & 2 /* Const */) !== 0 || + return !!(getCheckFlags(symbol) & 8 /* Readonly */ || + symbol.flags & 4 /* Property */ && getDeclarationModifierFlagsFromSymbol(symbol) & 64 /* Readonly */ || + symbol.flags & 3 /* Variable */ && getDeclarationNodeFlagsFromSymbol(symbol) & 2 /* Const */ || symbol.flags & 98304 /* Accessor */ && !(symbol.flags & 65536 /* SetAccessor */) || - (symbol.flags & 8 /* EnumMember */) !== 0; + symbol.flags & 8 /* EnumMember */); } function isReferenceToReadonlyEntity(expr, symbol) { if (isReadonlySymbol(symbol)) { // Allow assignments to readonly properties within constructors of the same class declaration. if (symbol.flags & 4 /* Property */ && - (expr.kind === 177 /* PropertyAccessExpression */ || expr.kind === 178 /* ElementAccessExpression */) && + (expr.kind === 178 /* PropertyAccessExpression */ || expr.kind === 179 /* ElementAccessExpression */) && expr.expression.kind === 98 /* ThisKeyword */) { // Look for if this is the constructor for the class that `symbol` is a property of. var func = ts.getContainingFunction(expr); - if (!(func && func.kind === 150 /* Constructor */)) + if (!(func && func.kind === 151 /* Constructor */)) return true; // If func.parent is a class and symbol is a (readonly) property of that class, or // if func is a constructor and symbol is a (readonly) parameter property declared in it, @@ -36994,13 +40200,13 @@ var ts; return false; } function isReferenceThroughNamespaceImport(expr) { - if (expr.kind === 177 /* PropertyAccessExpression */ || expr.kind === 178 /* ElementAccessExpression */) { + if (expr.kind === 178 /* PropertyAccessExpression */ || expr.kind === 179 /* ElementAccessExpression */) { var node = ts.skipParentheses(expr.expression); if (node.kind === 70 /* Identifier */) { var symbol = getNodeLinks(node).resolvedSymbol; if (symbol.flags & 8388608 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol); - return declaration && declaration.kind === 237 /* NamespaceImport */; + return declaration && declaration.kind === 239 /* NamespaceImport */; } } } @@ -37009,7 +40215,7 @@ var ts; function checkReferenceExpression(expr, invalidReferenceMessage) { // References are combinations of identifiers, parentheses, and property accesses. var node = ts.skipParentheses(expr); - if (node.kind !== 70 /* Identifier */ && node.kind !== 177 /* PropertyAccessExpression */ && node.kind !== 178 /* ElementAccessExpression */) { + if (node.kind !== 70 /* Identifier */ && node.kind !== 178 /* PropertyAccessExpression */ && node.kind !== 179 /* ElementAccessExpression */) { error(expr, invalidReferenceMessage); return false; } @@ -37017,11 +40223,21 @@ var ts; } function checkDeleteExpression(node) { checkExpression(node.expression); + var expr = ts.skipParentheses(node.expression); + if (expr.kind !== 178 /* PropertyAccessExpression */ && expr.kind !== 179 /* ElementAccessExpression */) { + error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); + return booleanType; + } + var links = getNodeLinks(expr); + var symbol = getExportSymbolOfValueSymbolIfExported(links.resolvedSymbol); + if (symbol && isReadonlySymbol(symbol)) { + error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_read_only_property); + } return booleanType; } function checkTypeOfExpression(node) { checkExpression(node.expression); - return stringType; + return typeofType; } function checkVoidExpression(node) { checkExpression(node.expression); @@ -37030,7 +40246,7 @@ var ts; function checkAwaitExpression(node) { // Grammar checking if (produceDiagnostics) { - if (!(node.flags & 524288 /* AwaitContext */)) { + if (!(node.flags & 16384 /* AwaitContext */)) { grammarErrorOnFirstToken(node, ts.Diagnostics.await_expression_is_only_allowed_within_an_async_function); } if (isInParameterInitializerBeforeContainingFunction(node)) { @@ -37038,7 +40254,7 @@ var ts; } } var operandType = checkExpression(node.expression); - return checkAwaitedType(operandType, node); + return checkAwaitedType(operandType, node, ts.Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } function checkPrefixUnaryExpression(node) { var operandType = checkExpression(node.operand); @@ -37052,6 +40268,7 @@ var ts; case 36 /* PlusToken */: case 37 /* MinusToken */: case 51 /* TildeToken */: + checkNonNullType(operandType, node.operand); if (maybeTypeOfKind(operandType, 512 /* ESSymbol */)) { error(node.operand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(node.operator)); } @@ -37063,7 +40280,7 @@ var ts; booleanType; case 42 /* PlusPlusToken */: case 43 /* MinusMinusToken */: - var ok = checkArithmeticOperandType(node.operand, getNonNullableType(operandType), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); + var ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { // run check only if former checks succeeded to avoid reporting cascading errors checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access); @@ -37077,7 +40294,7 @@ var ts; if (operandType === silentNeverType) { return silentNeverType; } - var ok = checkArithmeticOperandType(node.operand, getNonNullableType(operandType), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); + var ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { // run check only if former checks succeeded to avoid reporting cascading errors checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access); @@ -37092,8 +40309,8 @@ var ts; } if (type.flags & 196608 /* UnionOrIntersection */) { var types = type.types; - for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { - var t = types_15[_i]; + for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { + var t = types_19[_i]; if (maybeTypeOfKind(t, kind)) { return true; } @@ -37110,8 +40327,8 @@ var ts; } if (type.flags & 65536 /* Union */) { var types = type.types; - for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { - var t = types_16[_i]; + for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { + var t = types_20[_i]; if (!isTypeOfKind(t, kind)) { return false; } @@ -37120,8 +40337,8 @@ var ts; } if (type.flags & 131072 /* Intersection */) { var types = type.types; - for (var _a = 0, types_17 = types; _a < types_17.length; _a++) { - var t = types_17[_a]; + for (var _a = 0, types_21 = types; _a < types_21.length; _a++) { + var t = types_21[_a]; if (isTypeOfKind(t, kind)) { return true; } @@ -37141,14 +40358,17 @@ var ts; } // TypeScript 1.0 spec (April 2014): 4.15.4 // The instanceof operator requires the left operand to be of type Any, an object type, or a type parameter type, - // and the right operand to be of type Any or a subtype of the 'Function' interface type. + // and the right operand to be of type Any, a subtype of the 'Function' interface type, or have a call or construct signature. // The result is always of the Boolean primitive type. // NOTE: do not raise error if leftType is unknown as related error was already reported if (isTypeOfKind(leftType, 8190 /* Primitive */)) { error(left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } // NOTE: do not raise error if right is unknown as related error was already reported - if (!(isTypeAny(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) { + if (!(isTypeAny(rightType) || + getSignaturesOfType(rightType, 0 /* Call */).length || + getSignaturesOfType(rightType, 1 /* Construct */).length || + isTypeSubtypeOf(rightType, globalFunctionType))) { error(right, ts.Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); } return booleanType; @@ -37157,6 +40377,8 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } + leftType = checkNonNullType(leftType, left); + rightType = checkNonNullType(rightType, right); // TypeScript 1.0 spec (April 2014): 4.15.5 // The in operator requires the left operand to be of type Any, the String primitive type, or the Number primitive type, // and the right operand to be of type Any, an object type, or a type parameter type. @@ -37164,37 +40386,37 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeOfKind(leftType, 340 /* NumberLike */ | 512 /* ESSymbol */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 /* Object */ | 16384 /* TypeParameter */ | 524288 /* IndexedAccess */)) { + if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 /* Object */ | 540672 /* TypeVariable */ | 16777216 /* NonPrimitive */)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; } function checkObjectLiteralAssignment(node, sourceType) { var properties = node.properties; - for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) { - var p = properties_5[_i]; + for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) { + var p = properties_7[_i]; checkObjectLiteralDestructuringPropertyAssignment(sourceType, p, properties); } return sourceType; } /** Note: If property cannot be a SpreadAssignment, then allProperties does not need to be provided */ function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property, allProperties) { - if (property.kind === 257 /* PropertyAssignment */ || property.kind === 258 /* ShorthandPropertyAssignment */) { - var name_20 = property.name; - if (name_20.kind === 142 /* ComputedPropertyName */) { - checkComputedPropertyName(name_20); + if (property.kind === 260 /* PropertyAssignment */ || property.kind === 261 /* ShorthandPropertyAssignment */) { + var name = property.name; + if (name.kind === 143 /* ComputedPropertyName */) { + checkComputedPropertyName(name); } - if (isComputedNonLiteralName(name_20)) { + if (isComputedNonLiteralName(name)) { return undefined; } - var text = ts.getTextOfPropertyName(name_20); + var text = ts.getTextOfPropertyName(name); var type = isTypeAny(objectLiteralType) ? objectLiteralType : getTypeOfPropertyOfType(objectLiteralType, text) || isNumericLiteralName(text) && getIndexTypeOfType(objectLiteralType, 1 /* Number */) || getIndexTypeOfType(objectLiteralType, 0 /* String */); if (type) { - if (property.kind === 258 /* ShorthandPropertyAssignment */) { + if (property.kind === 261 /* ShorthandPropertyAssignment */) { return checkDestructuringAssignment(property, type); } else { @@ -37203,10 +40425,13 @@ var ts; } } else { - error(name_20, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name_20)); + error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name)); } } - else if (property.kind === 259 /* SpreadAssignment */) { + else if (property.kind === 262 /* SpreadAssignment */) { + if (languageVersion < 5 /* ESNext */) { + checkExternalEmitHelpers(property, 4 /* Rest */); + } var nonRestNames = []; if (allProperties) { for (var i = 0; i < allProperties.length - 1; i++) { @@ -37220,22 +40445,25 @@ var ts; error(property, ts.Diagnostics.Property_assignment_expected); } } - function checkArrayLiteralAssignment(node, sourceType, contextualMapper) { + function checkArrayLiteralAssignment(node, sourceType, checkMode) { + if (languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 512 /* Read */); + } // This elementType will be used if the specific property corresponding to this index is not // present (aka the tuple element property). This call also checks that the parentType is in // fact an iterable or array (depending on target language). - var elementType = checkIteratedTypeOrElementType(sourceType, node, /*allowStringInput*/ false) || unknownType; + var elementType = checkIteratedTypeOrElementType(sourceType, node, /*allowStringInput*/ false, /*allowAsyncIterable*/ false) || unknownType; var elements = node.elements; for (var i = 0; i < elements.length; i++) { - checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, elementType, contextualMapper); + checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, elementType, checkMode); } return sourceType; } - function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, contextualMapper) { + function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 198 /* OmittedExpression */) { - if (element.kind !== 196 /* SpreadElement */) { + if (element.kind !== 199 /* OmittedExpression */) { + if (element.kind !== 197 /* SpreadElement */) { var propName = "" + elementIndex; var type = isTypeAny(sourceType) ? sourceType @@ -37243,7 +40471,7 @@ var ts; ? getTypeOfPropertyOfType(sourceType, propName) : elementType; if (type) { - return checkDestructuringAssignment(element, type, contextualMapper); + return checkDestructuringAssignment(element, type, checkMode); } else { // We still need to check element expression here because we may need to set appropriate flag on the expression @@ -37263,20 +40491,20 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 192 /* BinaryExpression */ && restExpression.operatorToken.kind === 57 /* EqualsToken */) { + if (restExpression.kind === 193 /* BinaryExpression */ && restExpression.operatorToken.kind === 57 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { - return checkDestructuringAssignment(restExpression, createArrayType(elementType), contextualMapper); + return checkDestructuringAssignment(restExpression, createArrayType(elementType), checkMode); } } } } return undefined; } - function checkDestructuringAssignment(exprOrAssignment, sourceType, contextualMapper) { + function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode) { var target; - if (exprOrAssignment.kind === 258 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 261 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -37285,28 +40513,28 @@ var ts; !(getFalsyFlags(checkExpression(prop.objectAssignmentInitializer)) & 2048 /* Undefined */)) { sourceType = getTypeWithFacts(sourceType, 131072 /* NEUndefined */); } - checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, contextualMapper); + checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode); } target = exprOrAssignment.name; } else { target = exprOrAssignment; } - if (target.kind === 192 /* BinaryExpression */ && target.operatorToken.kind === 57 /* EqualsToken */) { - checkBinaryExpression(target, contextualMapper); + if (target.kind === 193 /* BinaryExpression */ && target.operatorToken.kind === 57 /* EqualsToken */) { + checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 176 /* ObjectLiteralExpression */) { + if (target.kind === 177 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType); } - if (target.kind === 175 /* ArrayLiteralExpression */) { - return checkArrayLiteralAssignment(target, sourceType, contextualMapper); + if (target.kind === 176 /* ArrayLiteralExpression */) { + return checkArrayLiteralAssignment(target, sourceType, checkMode); } - return checkReferenceAssignment(target, sourceType, contextualMapper); + return checkReferenceAssignment(target, sourceType, checkMode); } - function checkReferenceAssignment(target, sourceType, contextualMapper) { - var targetType = checkExpression(target, contextualMapper); - var error = target.parent.kind === 259 /* SpreadAssignment */ ? + function checkReferenceAssignment(target, sourceType, checkMode) { + var targetType = checkExpression(target, checkMode); + var error = target.parent.kind === 262 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; if (checkReferenceExpression(target, error)) { @@ -37328,35 +40556,35 @@ var ts; case 70 /* Identifier */: case 9 /* StringLiteral */: case 11 /* RegularExpressionLiteral */: - case 181 /* TaggedTemplateExpression */: - case 194 /* TemplateExpression */: + case 182 /* TaggedTemplateExpression */: + case 195 /* TemplateExpression */: case 12 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 100 /* TrueKeyword */: case 85 /* FalseKeyword */: case 94 /* NullKeyword */: - case 137 /* UndefinedKeyword */: - case 184 /* FunctionExpression */: - case 197 /* ClassExpression */: - case 185 /* ArrowFunction */: - case 175 /* ArrayLiteralExpression */: - case 176 /* ObjectLiteralExpression */: - case 187 /* TypeOfExpression */: - case 201 /* NonNullExpression */: - case 247 /* JsxSelfClosingElement */: - case 246 /* JsxElement */: + case 138 /* UndefinedKeyword */: + case 185 /* FunctionExpression */: + case 198 /* ClassExpression */: + case 186 /* ArrowFunction */: + case 176 /* ArrayLiteralExpression */: + case 177 /* ObjectLiteralExpression */: + case 188 /* TypeOfExpression */: + case 202 /* NonNullExpression */: + case 249 /* JsxSelfClosingElement */: + case 248 /* JsxElement */: return true; - case 193 /* ConditionalExpression */: + case 194 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 190 /* PrefixUnaryExpression */: - case 191 /* PostfixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { @@ -37368,9 +40596,9 @@ var ts; } return false; // Some forms listed here for clarity - case 188 /* VoidExpression */: // Explicit opt-out - case 182 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 200 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 189 /* VoidExpression */: // Explicit opt-out + case 183 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 201 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -37385,16 +40613,16 @@ var ts; firstAssignableToSecond && !secondAssignableToFirst ? type2 : getUnionType([type1, type2], /*subtypeReduction*/ true); } - function checkBinaryExpression(node, contextualMapper) { - return checkBinaryLikeExpression(node.left, node.operatorToken, node.right, contextualMapper, node); + function checkBinaryExpression(node, checkMode) { + return checkBinaryLikeExpression(node.left, node.operatorToken, node.right, checkMode, node); } - function checkBinaryLikeExpression(left, operatorToken, right, contextualMapper, errorNode) { + function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 57 /* EqualsToken */ && (left.kind === 176 /* ObjectLiteralExpression */ || left.kind === 175 /* ArrayLiteralExpression */)) { - return checkDestructuringAssignment(left, checkExpression(right, contextualMapper), contextualMapper); + if (operator === 57 /* EqualsToken */ && (left.kind === 177 /* ObjectLiteralExpression */ || left.kind === 176 /* ArrayLiteralExpression */)) { + return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode); } - var leftType = checkExpression(left, contextualMapper); - var rightType = checkExpression(right, contextualMapper); + var leftType = checkExpression(left, checkMode); + var rightType = checkExpression(right, checkMode); switch (operator) { case 38 /* AsteriskToken */: case 39 /* AsteriskAsteriskToken */: @@ -37421,18 +40649,8 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - // TypeScript 1.0 spec (April 2014): 4.19.1 - // These operators require their operands to be of type Any, the Number primitive type, - // or an enum type. Operands of an enum type are treated - // as having the primitive type Number. If one operand is the null or undefined value, - // it is treated as having the type of the other operand. - // The result is always of the Number primitive type. - if (leftType.flags & 6144 /* Nullable */) - leftType = rightType; - if (rightType.flags & 6144 /* Nullable */) - rightType = leftType; - leftType = getNonNullableType(leftType); - rightType = getNonNullableType(rightType); + leftType = checkNonNullType(leftType, left); + rightType = checkNonNullType(rightType, right); var suggestedOperator = void 0; // if a user tries to apply a bitwise operator to 2 boolean operands // try and return them a helpful suggestion @@ -37455,16 +40673,10 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - // TypeScript 1.0 spec (April 2014): 4.19.2 - // The binary + operator requires both operands to be of the Number primitive type or an enum type, - // or at least one of the operands to be of type Any or the String primitive type. - // If one operand is the null or undefined value, it is treated as having the type of the other operand. - if (leftType.flags & 6144 /* Nullable */) - leftType = rightType; - if (rightType.flags & 6144 /* Nullable */) - rightType = leftType; - leftType = getNonNullableType(leftType); - rightType = getNonNullableType(rightType); + if (!isTypeOfKind(leftType, 1 /* Any */ | 262178 /* StringLike */) && !isTypeOfKind(rightType, 1 /* Any */ | 262178 /* StringLike */)) { + leftType = checkNonNullType(leftType, left); + rightType = checkNonNullType(rightType, right); + } var resultType = void 0; if (isTypeOfKind(leftType, 340 /* NumberLike */) && isTypeOfKind(rightType, 340 /* NumberLike */)) { // Operands of an enum type are treated as having the primitive type Number. @@ -37499,8 +40711,8 @@ var ts; case 29 /* LessThanEqualsToken */: case 30 /* GreaterThanEqualsToken */: if (checkForDisallowedESSymbolOperand(operator)) { - leftType = getBaseTypeOfLiteralType(leftType); - rightType = getBaseTypeOfLiteralType(rightType); + leftType = getBaseTypeOfLiteralType(checkNonNullType(leftType, left)); + rightType = getBaseTypeOfLiteralType(checkNonNullType(rightType, right)); if (!isTypeComparableTo(leftType, rightType) && !isTypeComparableTo(rightType, leftType)) { reportOperatorError(); } @@ -37536,11 +40748,14 @@ var ts; checkAssignmentOperator(rightType); return getRegularTypeOfObjectLiteral(rightType); case 25 /* CommaToken */: - if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left)) { + if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isEvalNode(right)) { error(left, ts.Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects); } return rightType; } + function isEvalNode(node) { + return node.kind === 70 /* Identifier */ && node.text === "eval"; + } // Return true if there was no error, false if there was an error. function checkForDisallowedESSymbolOperand(operator) { var offendingSymbolOperand = maybeTypeOfKind(leftType, 512 /* ESSymbol */) ? left : @@ -37603,7 +40818,7 @@ var ts; function checkYieldExpression(node) { // Grammar checking if (produceDiagnostics) { - if (!(node.flags & 131072 /* YieldContext */) || isYieldExpressionInClass(node)) { + if (!(node.flags & 4096 /* YieldContext */) || isYieldExpressionInClass(node)) { grammarErrorOnFirstToken(node, ts.Diagnostics.A_yield_expression_is_only_allowed_in_a_generator_body); } if (isInParameterInitializerBeforeContainingFunction(node)) { @@ -37614,23 +40829,40 @@ var ts; var func = ts.getContainingFunction(node); // If the user's code is syntactically correct, the func should always have a star. After all, // we are in a yield context. - if (func && func.asteriskToken) { + var functionFlags = func && ts.getFunctionFlags(func); + if (node.asteriskToken) { + if (functionFlags & 2 /* Async */) { + if (languageVersion < 4 /* ES2017 */) { + checkExternalEmitHelpers(node, 4096 /* AsyncDelegator */); + } + } + else if (languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 256 /* Values */); + } + } + if (functionFlags & 1 /* Generator */) { var expressionType = checkExpressionCached(node.expression, /*contextualMapper*/ undefined); var expressionElementType = void 0; var nodeIsYieldStar = !!node.asteriskToken; if (nodeIsYieldStar) { - expressionElementType = checkElementTypeOfIterable(expressionType, node.expression); + expressionElementType = checkIteratedTypeOrElementType(expressionType, node.expression, /*allowStringInput*/ false, (functionFlags & 2 /* Async */) !== 0); } // There is no point in doing an assignability check if the function // has no explicit return type because the return type is directly computed // from the yield expressions. if (func.type) { - var signatureElementType = getElementTypeOfIterableIterator(getTypeFromTypeNode(func.type)) || anyType; + var signatureElementType = getIteratedTypeOfGenerator(getTypeFromTypeNode(func.type), (functionFlags & 2 /* Async */) !== 0) || anyType; if (nodeIsYieldStar) { - checkTypeAssignableTo(expressionElementType, signatureElementType, node.expression, /*headMessage*/ undefined); + checkTypeAssignableTo(functionFlags & 2 /* Async */ + ? getAwaitedType(expressionElementType, node.expression, ts.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) + : expressionElementType, signatureElementType, node.expression, + /*headMessage*/ undefined); } else { - checkTypeAssignableTo(expressionType, signatureElementType, node.expression, /*headMessage*/ undefined); + checkTypeAssignableTo(functionFlags & 2 /* Async */ + ? getAwaitedType(expressionType, node.expression, ts.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) + : expressionType, signatureElementType, node.expression, + /*headMessage*/ undefined); } } } @@ -37638,10 +40870,10 @@ var ts; // Both yield and yield* expressions have type 'any' return anyType; } - function checkConditionalExpression(node, contextualMapper) { + function checkConditionalExpression(node, checkMode) { checkExpression(node.condition); - var type1 = checkExpression(node.whenTrue, contextualMapper); - var type2 = checkExpression(node.whenFalse, contextualMapper); + var type1 = checkExpression(node.whenTrue, checkMode); + var type2 = checkExpression(node.whenFalse, checkMode); return getBestChoiceType(type1, type2); } function checkLiteralExpression(node) { @@ -37672,12 +40904,17 @@ var ts; } function checkExpressionWithContextualType(node, contextualType, contextualMapper) { var saveContextualType = node.contextualType; + var saveContextualMapper = node.contextualMapper; node.contextualType = contextualType; - var result = checkExpression(node, contextualMapper); + node.contextualMapper = contextualMapper; + var checkMode = contextualMapper === identityMapper ? 1 /* SkipContextSensitive */ : + contextualMapper ? 2 /* Inferential */ : 0 /* Normal */; + var result = checkExpression(node, checkMode); node.contextualType = saveContextualType; + node.contextualMapper = saveContextualMapper; return result; } - function checkExpressionCached(node, contextualMapper) { + function checkExpressionCached(node, checkMode) { var links = getNodeLinks(node); if (!links.resolvedType) { // When computing a type that we're going to cache, we need to ignore any ongoing control flow @@ -37685,83 +40922,87 @@ var ts; // to the top of the stack ensures all transient types are computed from a known point. var saveFlowLoopStart = flowLoopStart; flowLoopStart = flowLoopCount; - links.resolvedType = checkExpression(node, contextualMapper); + links.resolvedType = checkExpression(node, checkMode); flowLoopStart = saveFlowLoopStart; } return links.resolvedType; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 182 /* TypeAssertionExpression */ || node.kind === 200 /* AsExpression */; + return node.kind === 183 /* TypeAssertionExpression */ || node.kind === 201 /* AsExpression */; } function checkDeclarationInitializer(declaration) { - var type = checkExpressionCached(declaration.initializer); + var type = getTypeOfExpression(declaration.initializer, /*cache*/ true); return ts.getCombinedNodeFlags(declaration) & 2 /* Const */ || ts.getCombinedModifierFlags(declaration) & 64 /* Readonly */ && !ts.isParameterPropertyDeclaration(declaration) || isTypeAssertion(declaration.initializer) ? type : getWidenedLiteralType(type); } function isLiteralContextualType(contextualType) { if (contextualType) { - if (contextualType.flags & 16384 /* TypeParameter */) { - var apparentType = getApparentTypeOfTypeParameter(contextualType); + if (contextualType.flags & 540672 /* TypeVariable */) { + var constraint = getBaseConstraintOfType(contextualType) || emptyObjectType; // If the type parameter is constrained to the base primitive type we're checking for, // consider this a literal context. For example, given a type parameter 'T extends string', // this causes us to infer string literal types for T. - if (apparentType.flags & (2 /* String */ | 4 /* Number */ | 8 /* Boolean */ | 16 /* Enum */)) { + if (constraint.flags & (2 /* String */ | 4 /* Number */ | 8 /* Boolean */ | 16 /* Enum */)) { return true; } - contextualType = apparentType; + contextualType = constraint; } return maybeTypeOfKind(contextualType, (480 /* Literal */ | 262144 /* Index */)); } return false; } - function checkExpressionForMutableLocation(node, contextualMapper) { - var type = checkExpression(node, contextualMapper); + function checkExpressionForMutableLocation(node, checkMode) { + var type = checkExpression(node, checkMode); return isTypeAssertion(node) || isLiteralContextualType(getContextualType(node)) ? type : getWidenedLiteralType(type); } - function checkPropertyAssignment(node, contextualMapper) { + function checkPropertyAssignment(node, checkMode) { // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 142 /* ComputedPropertyName */) { + if (node.name.kind === 143 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } - return checkExpressionForMutableLocation(node.initializer, contextualMapper); + return checkExpressionForMutableLocation(node.initializer, checkMode); } - function checkObjectLiteralMethod(node, contextualMapper) { + function checkObjectLiteralMethod(node, checkMode) { // Grammar checking checkGrammarMethod(node); // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 142 /* ComputedPropertyName */) { + if (node.name.kind === 143 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } - var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - return instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); + var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); + return instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode); } - function instantiateTypeWithSingleGenericCallSignature(node, type, contextualMapper) { - if (isInferentialContext(contextualMapper)) { + function instantiateTypeWithSingleGenericCallSignature(node, type, checkMode) { + if (checkMode === 2 /* Inferential */) { var signature = getSingleCallSignature(type); if (signature && signature.typeParameters) { var contextualType = getApparentTypeOfContextualType(node); if (contextualType) { var contextualSignature = getSingleCallSignature(contextualType); if (contextualSignature && !contextualSignature.typeParameters) { - return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper)); + return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, getContextualMapper(node))); } } } } return type; } - // Returns the type of an expression. Unlike checkExpression, this function is simply concerned - // with computing the type and may not fully check all contained sub-expressions for errors. - function getTypeOfExpression(node) { + /** + * Returns the type of an expression. Unlike checkExpression, this function is simply concerned + * with computing the type and may not fully check all contained sub-expressions for errors. + * A cache argument of true indicates that if the function performs a full type check, it is ok + * to cache the result. + */ + function getTypeOfExpression(node, cache) { // Optimize for the common case of a call to a function with a single non-generic call // signature where we can just fetch the return type without checking the arguments. - if (node.kind === 179 /* CallExpression */ && node.expression.kind !== 96 /* SuperKeyword */) { + if (node.kind === 180 /* CallExpression */ && node.expression.kind !== 96 /* SuperKeyword */ && !ts.isRequireCall(node, /*checkArgumentIsStringLiteral*/ true)) { var funcType = checkNonNullExpression(node.expression); var signature = getSingleCallSignature(funcType); if (signature && !signature.typeParameters) { @@ -37771,7 +41012,21 @@ var ts; // Otherwise simply call checkExpression. Ideally, the entire family of checkXXX functions // should have a parameter that indicates whether full error checking is required such that // we can perform the optimizations locally. - return checkExpression(node); + return cache ? checkExpressionCached(node) : checkExpression(node); + } + /** + * Returns the type of an expression. Unlike checkExpression, this function is simply concerned + * with computing the type and may not fully check all contained sub-expressions for errors. + * It is intended for uses where you know there is no contextual type, + * and requesting the contextual type might cause a circularity or other bad behaviour. + * It sets the contextual type of the node to any before calling getTypeOfExpression. + */ + function getContextFreeTypeOfExpression(node) { + var saveContextualType = node.contextualType; + node.contextualType = anyType; + var type = getTypeOfExpression(node); + node.contextualType = saveContextualType; + return type; } // Checks an expression and returns its type. The contextualMapper parameter serves two purposes: When // contextualMapper is not undefined and not equal to the identityMapper function object it indicates that the @@ -37780,30 +41035,30 @@ var ts; // object, it serves as an indicator that all contained function and arrow expressions should be considered to // have the wildcard function type; this form of type check is used during overload resolution to exclude // contextually typed function and arrow expressions in the initial phase. - function checkExpression(node, contextualMapper) { + function checkExpression(node, checkMode) { var type; - if (node.kind === 141 /* QualifiedName */) { + if (node.kind === 142 /* QualifiedName */) { type = checkQualifiedName(node); } else { - var uninstantiatedType = checkExpressionWorker(node, contextualMapper); - type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); + var uninstantiatedType = checkExpressionWorker(node, checkMode); + type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode); } if (isConstEnumObjectType(type)) { // enum object type for const enums are only permitted in: // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 177 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 178 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 70 /* Identifier */ || node.kind === 141 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 178 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 179 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 70 /* Identifier */ || node.kind === 142 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); } } return type; } - function checkExpressionWorker(node, contextualMapper) { + function checkExpressionWorker(node, checkMode) { switch (node.kind) { case 70 /* Identifier */: return checkIdentifier(node); @@ -37818,66 +41073,70 @@ var ts; case 100 /* TrueKeyword */: case 85 /* FalseKeyword */: return checkLiteralExpression(node); - case 194 /* TemplateExpression */: + case 195 /* TemplateExpression */: return checkTemplateExpression(node); case 12 /* NoSubstitutionTemplateLiteral */: return stringType; case 11 /* RegularExpressionLiteral */: return globalRegExpType; - case 175 /* ArrayLiteralExpression */: - return checkArrayLiteral(node, contextualMapper); - case 176 /* ObjectLiteralExpression */: - return checkObjectLiteral(node, contextualMapper); - case 177 /* PropertyAccessExpression */: + case 176 /* ArrayLiteralExpression */: + return checkArrayLiteral(node, checkMode); + case 177 /* ObjectLiteralExpression */: + return checkObjectLiteral(node, checkMode); + case 178 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 178 /* ElementAccessExpression */: + case 179 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 179 /* CallExpression */: - case 180 /* NewExpression */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: return checkCallExpression(node); - case 181 /* TaggedTemplateExpression */: + case 182 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 183 /* ParenthesizedExpression */: - return checkExpression(node.expression, contextualMapper); - case 197 /* ClassExpression */: + case 184 /* ParenthesizedExpression */: + return checkExpression(node.expression, checkMode); + case 198 /* ClassExpression */: return checkClassExpression(node); - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 187 /* TypeOfExpression */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); + case 188 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 182 /* TypeAssertionExpression */: - case 200 /* AsExpression */: + case 183 /* TypeAssertionExpression */: + case 201 /* AsExpression */: return checkAssertion(node); - case 201 /* NonNullExpression */: + case 202 /* NonNullExpression */: return checkNonNullAssertion(node); - case 186 /* DeleteExpression */: + case 203 /* MetaProperty */: + return checkMetaProperty(node); + case 187 /* DeleteExpression */: return checkDeleteExpression(node); - case 188 /* VoidExpression */: + case 189 /* VoidExpression */: return checkVoidExpression(node); - case 189 /* AwaitExpression */: + case 190 /* AwaitExpression */: return checkAwaitExpression(node); - case 190 /* PrefixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 191 /* PostfixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 192 /* BinaryExpression */: - return checkBinaryExpression(node, contextualMapper); - case 193 /* ConditionalExpression */: - return checkConditionalExpression(node, contextualMapper); - case 196 /* SpreadElement */: - return checkSpreadExpression(node, contextualMapper); - case 198 /* OmittedExpression */: + case 193 /* BinaryExpression */: + return checkBinaryExpression(node, checkMode); + case 194 /* ConditionalExpression */: + return checkConditionalExpression(node, checkMode); + case 197 /* SpreadElement */: + return checkSpreadExpression(node, checkMode); + case 199 /* OmittedExpression */: return undefinedWideningType; - case 195 /* YieldExpression */: + case 196 /* YieldExpression */: return checkYieldExpression(node); - case 252 /* JsxExpression */: - return checkJsxExpression(node); - case 246 /* JsxElement */: + case 255 /* JsxExpression */: + return checkJsxExpression(node, checkMode); + case 248 /* JsxElement */: return checkJsxElement(node); - case 247 /* JsxSelfClosingElement */: + case 249 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node); - case 248 /* JsxOpeningElement */: + case 253 /* JsxAttributes */: + return checkJsxAttributes(node, checkMode); + case 250 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return unknownType; @@ -37889,7 +41148,16 @@ var ts; grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected); } checkSourceElement(node.constraint); - getConstraintOfTypeParameter(getDeclaredTypeOfTypeParameter(getSymbolOfNode(node))); + checkSourceElement(node.default); + var typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node)); + if (!hasNonCircularBaseConstraint(typeParameter)) { + error(node.constraint, ts.Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(typeParameter)); + } + var constraintType = getConstraintOfTypeParameter(typeParameter); + var defaultType = getDefaultFromTypeParameter(typeParameter); + if (constraintType && defaultType) { + checkTypeAssignableTo(defaultType, getTypeWithThisArgument(constraintType, defaultType), node.default, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + } if (produceDiagnostics) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); } @@ -37905,7 +41173,7 @@ var ts; var func = ts.getContainingFunction(node); if (ts.getModifierFlags(node) & 92 /* ParameterPropertyModifier */) { func = ts.getContainingFunction(node); - if (!(func.kind === 150 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 151 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -37916,7 +41184,7 @@ var ts; if (ts.indexOf(func.parameters, node) !== 0) { error(node, ts.Diagnostics.A_this_parameter_must_be_the_first_parameter); } - if (func.kind === 150 /* Constructor */ || func.kind === 154 /* ConstructSignature */ || func.kind === 159 /* ConstructorType */) { + if (func.kind === 151 /* Constructor */ || func.kind === 155 /* ConstructSignature */ || func.kind === 160 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } } @@ -37926,14 +41194,6 @@ var ts; error(node, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); } } - function isSyntacticallyValidGenerator(node) { - if (!node.asteriskToken || !node.body) { - return false; - } - return node.kind === 149 /* MethodDeclaration */ || - node.kind === 225 /* FunctionDeclaration */ || - node.kind === 184 /* FunctionExpression */; - } function getTypePredicateParameterIndex(parameterList, parameter) { if (parameterList) { for (var i = 0; i < parameterList.length; i++) { @@ -37967,7 +41227,7 @@ var ts; error(parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); } else { - var leadingError = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type); + var leadingError = ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type); checkTypeAssignableTo(typePredicate.type, getTypeOfNode(parent.parameters[typePredicate.parameterIndex]), node.type, /*headMessage*/ undefined, leadingError); } @@ -37975,9 +41235,9 @@ var ts; else if (parameterName) { var hasReportedError = false; for (var _i = 0, _a = parent.parameters; _i < _a.length; _i++) { - var name_21 = _a[_i].name; - if (ts.isBindingPattern(name_21) && - checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_21, parameterName, typePredicate.parameterName)) { + var name = _a[_i].name; + if (ts.isBindingPattern(name) && + checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, parameterName, typePredicate.parameterName)) { hasReportedError = true; break; } @@ -37990,16 +41250,16 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 185 /* ArrowFunction */: - case 153 /* CallSignature */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 158 /* FunctionType */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - var parent_9 = node.parent; - if (node === parent_9.type) { - return parent_9; + case 186 /* ArrowFunction */: + case 154 /* CallSignature */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 159 /* FunctionType */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + var parent = node.parent; + if (node === parent.type) { + return parent; } } } @@ -38009,15 +41269,15 @@ var ts; if (ts.isOmittedExpression(element)) { continue; } - var name_22 = element.name; - if (name_22.kind === 70 /* Identifier */ && - name_22.text === predicateVariableName) { + var name = element.name; + if (name.kind === 70 /* Identifier */ && + name.text === predicateVariableName) { error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name_22.kind === 173 /* ArrayBindingPattern */ || - name_22.kind === 172 /* ObjectBindingPattern */) { - if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_22, predicateVariableNode, predicateVariableName)) { + else if (name.kind === 174 /* ArrayBindingPattern */ || + name.kind === 173 /* ObjectBindingPattern */) { + if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } } @@ -38025,14 +41285,29 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 155 /* IndexSignature */) { + if (node.kind === 156 /* IndexSignature */) { checkGrammarIndexSignature(node); } - else if (node.kind === 158 /* FunctionType */ || node.kind === 225 /* FunctionDeclaration */ || node.kind === 159 /* ConstructorType */ || - node.kind === 153 /* CallSignature */ || node.kind === 150 /* Constructor */ || - node.kind === 154 /* ConstructSignature */) { + else if (node.kind === 159 /* FunctionType */ || node.kind === 227 /* FunctionDeclaration */ || node.kind === 160 /* ConstructorType */ || + node.kind === 154 /* CallSignature */ || node.kind === 151 /* Constructor */ || + node.kind === 155 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } + var functionFlags = ts.getFunctionFlags(node); + if ((functionFlags & 7 /* InvalidAsyncOrAsyncGenerator */) === 2 /* Async */ && languageVersion < 4 /* ES2017 */) { + checkExternalEmitHelpers(node, 64 /* Awaiter */); + if (languageVersion < 2 /* ES2015 */) { + checkExternalEmitHelpers(node, 128 /* Generator */); + } + } + if ((functionFlags & 5 /* InvalidGenerator */) === 1 /* Generator */) { + if (functionFlags & 2 /* Async */ && languageVersion < 4 /* ES2017 */) { + checkExternalEmitHelpers(node, 2048 /* AsyncGenerator */); + } + else if (languageVersion < 2 /* ES2015 */) { + checkExternalEmitHelpers(node, 128 /* Generator */); + } + } checkTypeParameters(node.typeParameters); ts.forEach(node.parameters, checkParameter); if (node.type) { @@ -38040,25 +41315,28 @@ var ts; } if (produceDiagnostics) { checkCollisionWithArgumentsInGeneratedCode(node); - if (compilerOptions.noImplicitAny && !node.type) { + if (noImplicitAny && !node.type) { switch (node.kind) { - case 154 /* ConstructSignature */: + case 155 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 153 /* CallSignature */: + case 154 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } } if (node.type) { - if (languageVersion >= 2 /* ES2015 */ && isSyntacticallyValidGenerator(node)) { + var functionFlags_1 = ts.getFunctionFlags(node); + if ((functionFlags_1 & 5 /* InvalidGenerator */) === 1 /* Generator */) { var returnType = getTypeFromTypeNode(node.type); if (returnType === voidType) { error(node.type, ts.Diagnostics.A_generator_cannot_have_a_void_type_annotation); } else { - var generatorElementType = getElementTypeOfIterableIterator(returnType) || anyType; - var iterableIteratorInstantiation = createIterableIteratorType(generatorElementType); + var generatorElementType = getIteratedTypeOfGenerator(returnType, (functionFlags_1 & 2 /* Async */) !== 0) || anyType; + var iterableIteratorInstantiation = functionFlags_1 & 2 /* Async */ + ? createAsyncIterableIteratorType(generatorElementType) // AsyncGenerator function + : createIterableIteratorType(generatorElementType); // Generator function // Naively, one could check that IterableIterator is assignable to the return type annotation. // However, that would not catch the error in the following case. // @@ -38068,7 +41346,7 @@ var ts; checkTypeAssignableTo(iterableIteratorInstantiation, returnType, node.type); } } - else if (ts.isAsyncFunctionLike(node)) { + else if ((functionFlags_1 & 3 /* AsyncOrAsyncGenerator */) === 2 /* Async */) { checkAsyncFunctionReturnType(node); } } @@ -38078,17 +41356,18 @@ var ts; } } function checkClassForDuplicateDeclarations(node) { - var Accessor; - (function (Accessor) { - Accessor[Accessor["Getter"] = 1] = "Getter"; - Accessor[Accessor["Setter"] = 2] = "Setter"; - Accessor[Accessor["Property"] = 3] = "Property"; - })(Accessor || (Accessor = {})); + var Declaration; + (function (Declaration) { + Declaration[Declaration["Getter"] = 1] = "Getter"; + Declaration[Declaration["Setter"] = 2] = "Setter"; + Declaration[Declaration["Method"] = 4] = "Method"; + Declaration[Declaration["Property"] = 3] = "Property"; + })(Declaration || (Declaration = {})); var instanceNames = ts.createMap(); var staticNames = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 150 /* Constructor */) { + if (member.kind === 151 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param)) { @@ -38097,36 +41376,76 @@ var ts; } } else { - var isStatic = ts.forEach(member.modifiers, function (m) { return m.kind === 114 /* StaticKeyword */; }); + var isStatic = ts.getModifierFlags(member) & 32 /* Static */; var names = isStatic ? staticNames : instanceNames; var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name); if (memberName) { switch (member.kind) { - case 151 /* GetAccessor */: + case 152 /* GetAccessor */: addName(names, member.name, memberName, 1 /* Getter */); break; - case 152 /* SetAccessor */: + case 153 /* SetAccessor */: addName(names, member.name, memberName, 2 /* Setter */); break; - case 147 /* PropertyDeclaration */: + case 148 /* PropertyDeclaration */: addName(names, member.name, memberName, 3 /* Property */); break; + case 150 /* MethodDeclaration */: + addName(names, member.name, memberName, 4 /* Method */); + break; } } } } function addName(names, location, name, meaning) { - var prev = names[name]; + var prev = names.get(name); if (prev) { - if (prev & meaning) { + if (prev & 4 /* Method */) { + if (meaning !== 4 /* Method */) { + error(location, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(location)); + } + } + else if (prev & meaning) { error(location, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(location)); } else { - names[name] = prev | meaning; + names.set(name, prev | meaning); } } else { - names[name] = meaning; + names.set(name, meaning); + } + } + } + /** + * Static members being set on a constructor function may conflict with built-in properties + * of Function. Esp. in ECMAScript 5 there are non-configurable and non-writable + * built-in properties. This check issues a transpile error when a class has a static + * member with the same name as a non-writable built-in property. + * + * @see http://www.ecma-international.org/ecma-262/5.1/#sec-15.3.3 + * @see http://www.ecma-international.org/ecma-262/5.1/#sec-15.3.5 + * @see http://www.ecma-international.org/ecma-262/6.0/#sec-properties-of-the-function-constructor + * @see http://www.ecma-international.org/ecma-262/6.0/#sec-function-instances + */ + function checkClassForStaticPropertyNameConflicts(node) { + for (var _i = 0, _a = node.members; _i < _a.length; _i++) { + var member = _a[_i]; + var memberNameNode = member.name; + var isStatic = ts.getModifierFlags(member) & 32 /* Static */; + if (isStatic && memberNameNode) { + var memberName = ts.getPropertyNameForPropertyNameNode(memberNameNode); + switch (memberName) { + case "name": + case "length": + case "caller": + case "arguments": + case "prototype": + var message = ts.Diagnostics.Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1; + var className = getNameOfSymbol(getSymbolOfNode(node)); + error(memberNameNode, message, memberName, className); + break; + } } } } @@ -38134,7 +41453,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind == 146 /* PropertySignature */) { + if (member.kind === 147 /* PropertySignature */) { var memberName = void 0; switch (member.name.kind) { case 9 /* StringLiteral */: @@ -38145,18 +41464,18 @@ var ts; default: continue; } - if (names[memberName]) { + if (names.get(memberName)) { error(member.symbol.valueDeclaration.name, ts.Diagnostics.Duplicate_identifier_0, memberName); error(member.name, ts.Diagnostics.Duplicate_identifier_0, memberName); } else { - names[memberName] = true; + names.set(memberName, true); } } } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 227 /* InterfaceDeclaration */) { + if (node.kind === 229 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -38176,7 +41495,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 134 /* StringKeyword */: + case 135 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -38252,12 +41571,12 @@ var ts; if (n.kind === 98 /* ThisKeyword */) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 184 /* FunctionExpression */ && n.kind !== 225 /* FunctionDeclaration */) { + else if (n.kind !== 185 /* FunctionExpression */ && n.kind !== 227 /* FunctionDeclaration */) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 147 /* PropertyDeclaration */ && + return n.kind === 148 /* PropertyDeclaration */ && !(ts.getModifierFlags(n) & 32 /* Static */) && !!n.initializer; } @@ -38287,7 +41606,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_3 = statements; _i < statements_3.length; _i++) { var statement = statements_3[_i]; - if (statement.kind === 207 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 209 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -38311,7 +41630,7 @@ var ts; checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 151 /* GetAccessor */) { + if (node.kind === 152 /* GetAccessor */) { if (!ts.isInAmbientContext(node) && ts.nodeIsPresent(node.body) && (node.flags & 128 /* HasImplicitReturn */)) { if (!(node.flags & 256 /* HasExplicitReturn */)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); @@ -38321,13 +41640,13 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 142 /* ComputedPropertyName */) { + if (node.name.kind === 143 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (!ts.hasDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 151 /* GetAccessor */ ? 152 /* SetAccessor */ : 151 /* GetAccessor */; + var otherKind = node.kind === 152 /* GetAccessor */ ? 153 /* SetAccessor */ : 152 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { if ((ts.getModifierFlags(node) & 28 /* AccessibilityModifier */) !== (ts.getModifierFlags(otherAccessor) & 28 /* AccessibilityModifier */)) { @@ -38343,17 +41662,12 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 151 /* GetAccessor */) { + if (node.kind === 152 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } - if (node.parent.kind !== 176 /* ObjectLiteralExpression */) { - checkSourceElement(node.body); - registerForUnusedIdentifiersCheck(node); - } - else { - checkNodeDeferred(node); - } + checkSourceElement(node.body); + registerForUnusedIdentifiersCheck(node); } function checkAccessorDeclarationTypesIdentical(first, second, getAnnotatedType, message) { var firstType = getAnnotatedType(first); @@ -38362,14 +41676,11 @@ var ts; error(first, message); } } - function checkAccessorDeferred(node) { - checkSourceElement(node.body); - registerForUnusedIdentifiersCheck(node); - } function checkMissingDeclaration(node) { checkDecorators(node); } function checkTypeArgumentConstraints(typeParameters, typeArgumentNodes) { + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); var typeArguments; var mapper; var result = true; @@ -38377,7 +41688,7 @@ var ts; var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { if (!typeArguments) { - typeArguments = ts.map(typeArgumentNodes, getTypeFromTypeNode); + typeArguments = fillMissingTypeArguments(ts.map(typeArgumentNodes, getTypeFromTypeNode), typeParameters, minTypeArgumentCount); mapper = createTypeMapper(typeParameters, typeArguments); } var typeArgument = typeArguments[i]; @@ -38430,16 +41741,36 @@ var ts; function checkUnionOrIntersectionType(node) { ts.forEach(node.types, checkSourceElement); } + function checkIndexedAccessIndexType(type, accessNode) { + if (!(type.flags & 524288 /* IndexedAccess */)) { + return type; + } + // Check if the index type is assignable to 'keyof T' for the object type. + var objectType = type.objectType; + var indexType = type.indexType; + if (isTypeAssignableTo(indexType, getIndexType(objectType))) { + return type; + } + // Check if we're indexing with a numeric type and the object type is a generic + // type with a constraint that has a numeric index signature. + if (maybeTypeOfKind(objectType, 540672 /* TypeVariable */) && isTypeOfKind(indexType, 340 /* NumberLike */)) { + var constraint = getBaseConstraintOfType(objectType); + if (constraint && getIndexInfoOfType(constraint, 1 /* Number */)) { + return type; + } + } + error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); + return type; + } function checkIndexedAccessType(node) { - getTypeFromIndexedAccessTypeNode(node); + checkIndexedAccessIndexType(getTypeFromIndexedAccessTypeNode(node), node); } function checkMappedType(node) { checkSourceElement(node.typeParameter); checkSourceElement(node.type); var type = getTypeFromMappedTypeNode(node); var constraintType = getConstraintTypeFromMappedType(type); - var keyType = constraintType.flags & 16384 /* TypeParameter */ ? getApparentTypeOfTypeParameter(constraintType) : constraintType; - checkTypeAssignableTo(keyType, stringType, node.typeParameter.constraint); + checkTypeAssignableTo(constraintType, stringType, node.typeParameter.constraint); } function isPrivateWithinAmbient(node) { return (ts.getModifierFlags(node) & 8 /* Private */) && ts.isInAmbientContext(node); @@ -38448,9 +41779,9 @@ var ts; var flags = ts.getCombinedModifierFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 227 /* InterfaceDeclaration */ && - n.parent.kind !== 226 /* ClassDeclaration */ && - n.parent.kind !== 197 /* ClassExpression */ && + if (n.parent.kind !== 229 /* InterfaceDeclaration */ && + n.parent.kind !== 228 /* ClassDeclaration */ && + n.parent.kind !== 198 /* ClassExpression */ && ts.isInAmbientContext(n)) { if (!(flags & 2 /* Ambient */)) { // It is nested in an ambient context, which means it is automatically exported @@ -38538,7 +41869,7 @@ var ts; var errorNode_1 = subsequentNode.name || subsequentNode; // TODO(jfreeman): These are methods, so handle computed name case if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - var reportError = (node.kind === 149 /* MethodDeclaration */ || node.kind === 148 /* MethodSignature */) && + var reportError = (node.kind === 150 /* MethodDeclaration */ || node.kind === 149 /* MethodSignature */) && (ts.getModifierFlags(node) & 32 /* Static */) !== (ts.getModifierFlags(subsequentNode) & 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -38573,11 +41904,11 @@ var ts; } var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; - for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { - var current = declarations_4[_i]; + for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { + var current = declarations_5[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 227 /* InterfaceDeclaration */ || node.parent.kind === 161 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 229 /* InterfaceDeclaration */ || node.parent.kind === 162 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -38588,7 +41919,7 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if (node.kind === 225 /* FunctionDeclaration */ || node.kind === 149 /* MethodDeclaration */ || node.kind === 148 /* MethodSignature */ || node.kind === 150 /* Constructor */) { + if (node.kind === 227 /* FunctionDeclaration */ || node.kind === 150 /* MethodDeclaration */ || node.kind === 149 /* MethodSignature */ || node.kind === 151 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -38640,8 +41971,8 @@ var ts; if (bodyDeclaration) { var signatures = getSignaturesOfSymbol(symbol); var bodySignature = getSignatureFromDeclaration(bodyDeclaration); - for (var _a = 0, signatures_3 = signatures; _a < signatures_3.length; _a++) { - var signature = signatures_3[_a]; + for (var _a = 0, signatures_4 = signatures; _a < signatures_4.length; _a++) { + var signature = signatures_4[_a]; if (!isImplementationCompatibleWithOverload(bodySignature, signature)) { error(signature.declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); break; @@ -38710,16 +42041,16 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: return 2097152 /* ExportType */; - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4194304 /* ExportNamespace */ | 1048576 /* ExportValue */ : 4194304 /* ExportNamespace */; - case 226 /* ClassDeclaration */: - case 229 /* EnumDeclaration */: + case 228 /* ClassDeclaration */: + case 231 /* EnumDeclaration */: return 2097152 /* ExportType */ | 1048576 /* ExportValue */; - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: var result_3 = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_3 |= getDeclarationSpaces(d); }); @@ -38729,25 +42060,16 @@ var ts; } } } - function checkNonThenableType(type, location, message) { - type = getWidenedType(type); - if (!isTypeAny(type) && !isTypeNever(type) && isTypeAssignableTo(type, getGlobalThenableType())) { - if (location) { - if (!message) { - message = ts.Diagnostics.Operand_for_await_does_not_have_a_valid_callable_then_member; - } - error(location, message); - } - return unknownType; - } - return type; + function getAwaitedTypeOfPromise(type, errorNode, diagnosticMessage) { + var promisedType = getPromisedTypeOfPromise(type, errorNode); + return promisedType && getAwaitedType(promisedType, errorNode, diagnosticMessage); } /** - * Gets the "promised type" of a promise. - * @param type The type of the promise. - * @remarks The "promised type" of a type is the type of the "value" parameter of the "onfulfilled" callback. - */ - function getPromisedType(promise) { + * Gets the "promised type" of a promise. + * @param type The type of the promise. + * @remarks The "promised type" of a type is the type of the "value" parameter of the "onfulfilled" callback. + */ + function getPromisedTypeOfPromise(promise, errorNode) { // // { // promise // then( // thenFunction @@ -38760,127 +42082,140 @@ var ts; if (isTypeAny(promise)) { return undefined; } - if (getObjectFlags(promise) & 4 /* Reference */) { - if (promise.target === tryGetGlobalPromiseType() - || promise.target === getGlobalPromiseLikeType()) { - return promise.typeArguments[0]; - } + var typeAsPromise = promise; + if (typeAsPromise.promisedTypeOfPromise) { + return typeAsPromise.promisedTypeOfPromise; } - var globalPromiseLikeType = getInstantiatedGlobalPromiseLikeType(); - if (globalPromiseLikeType === emptyObjectType || !isTypeAssignableTo(promise, globalPromiseLikeType)) { - return undefined; + if (isReferenceToType(promise, getGlobalPromiseType(/*reportErrors*/ false))) { + return typeAsPromise.promisedTypeOfPromise = promise.typeArguments[0]; } var thenFunction = getTypeOfPropertyOfType(promise, "then"); - if (!thenFunction || isTypeAny(thenFunction)) { + if (isTypeAny(thenFunction)) { return undefined; } - var thenSignatures = getSignaturesOfType(thenFunction, 0 /* Call */); + var thenSignatures = thenFunction ? getSignaturesOfType(thenFunction, 0 /* Call */) : emptyArray; if (thenSignatures.length === 0) { + if (errorNode) { + error(errorNode, ts.Diagnostics.A_promise_must_have_a_then_method); + } return undefined; } - var onfulfilledParameterType = getTypeWithFacts(getUnionType(ts.map(thenSignatures, getTypeOfFirstParameterOfSignature)), 131072 /* NEUndefined */); + var onfulfilledParameterType = getTypeWithFacts(getUnionType(ts.map(thenSignatures, getTypeOfFirstParameterOfSignature)), 524288 /* NEUndefinedOrNull */); if (isTypeAny(onfulfilledParameterType)) { return undefined; } var onfulfilledParameterSignatures = getSignaturesOfType(onfulfilledParameterType, 0 /* Call */); if (onfulfilledParameterSignatures.length === 0) { + if (errorNode) { + error(errorNode, ts.Diagnostics.The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback); + } return undefined; } - return getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), /*subtypeReduction*/ true); - } - function getTypeOfFirstParameterOfSignature(signature) { - return signature.parameters.length > 0 ? getTypeAtPosition(signature, 0) : neverType; + return typeAsPromise.promisedTypeOfPromise = getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), /*subtypeReduction*/ true); } /** - * Gets the "awaited type" of a type. - * @param type The type to await. - * @remarks The "awaited type" of an expression is its "promised type" if the expression is a - * Promise-like type; otherwise, it is the type of the expression. This is used to reflect - * The runtime behavior of the `await` keyword. - */ - function getAwaitedType(type) { - return checkAwaitedType(type, /*location*/ undefined, /*message*/ undefined); + * Gets the "awaited type" of a type. + * @param type The type to await. + * @remarks The "awaited type" of an expression is its "promised type" if the expression is a + * Promise-like type; otherwise, it is the type of the expression. This is used to reflect + * The runtime behavior of the `await` keyword. + */ + function checkAwaitedType(type, errorNode, diagnosticMessage) { + return getAwaitedType(type, errorNode, diagnosticMessage) || unknownType; } - function checkAwaitedType(type, location, message) { - return checkAwaitedTypeWorker(type); - function checkAwaitedTypeWorker(type) { - if (type.flags & 65536 /* Union */) { - var types = []; - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var constituentType = _a[_i]; - types.push(checkAwaitedTypeWorker(constituentType)); - } - return getUnionType(types, /*subtypeReduction*/ true); - } - else { - var promisedType = getPromisedType(type); - if (promisedType === undefined) { - // The type was not a PromiseLike, so it could not be unwrapped any further. - // As long as the type does not have a callable "then" property, it is - // safe to return the type; otherwise, an error will have been reported in - // the call to checkNonThenableType and we will return unknownType. - // - // An example of a non-promise "thenable" might be: - // - // await { then(): void {} } - // - // The "thenable" does not match the minimal definition for a PromiseLike. When - // a Promise/A+-compatible or ES6 promise tries to adopt this value, the promise - // will never settle. We treat this as an error to help flag an early indicator - // of a runtime problem. If the user wants to return this value from an async - // function, they would need to wrap it in some other value. If they want it to - // be treated as a promise, they can cast to . - return checkNonThenableType(type, location, message); - } - else { - if (type.id === promisedType.id || ts.indexOf(awaitedTypeStack, promisedType.id) >= 0) { - // We have a bad actor in the form of a promise whose promised type is - // the same promise type, or a mutually recursive promise. Return the - // unknown type as we cannot guess the shape. If this were the actual - // case in the JavaScript, this Promise would never resolve. - // - // An example of a bad actor with a singly-recursive promise type might - // be: - // - // interface BadPromise { - // then( - // onfulfilled: (value: BadPromise) => any, - // onrejected: (error: any) => any): BadPromise; - // } - // - // The above interface will pass the PromiseLike check, and return a - // promised type of `BadPromise`. Since this is a self reference, we - // don't want to keep recursing ad infinitum. - // - // An example of a bad actor in the form of a mutually-recursive - // promise type might be: - // - // interface BadPromiseA { - // then( - // onfulfilled: (value: BadPromiseB) => any, - // onrejected: (error: any) => any): BadPromiseB; - // } - // - // interface BadPromiseB { - // then( - // onfulfilled: (value: BadPromiseA) => any, - // onrejected: (error: any) => any): BadPromiseA; - // } - // - if (location) { - error(location, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method, symbolToString(type.symbol)); - } - return unknownType; - } - // Keep track of the type we're about to unwrap to avoid bad recursive promise types. - // See the comments above for more information. - awaitedTypeStack.push(type.id); - var awaitedType = checkAwaitedTypeWorker(promisedType); - awaitedTypeStack.pop(); - return awaitedType; - } - } + function getAwaitedType(type, errorNode, diagnosticMessage) { + var typeAsAwaitable = type; + if (typeAsAwaitable.awaitedTypeOfType) { + return typeAsAwaitable.awaitedTypeOfType; } + if (isTypeAny(type)) { + return typeAsAwaitable.awaitedTypeOfType = type; + } + if (type.flags & 65536 /* Union */) { + var types = void 0; + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var constituentType = _a[_i]; + types = ts.append(types, getAwaitedType(constituentType, errorNode, diagnosticMessage)); + } + if (!types) { + return undefined; + } + return typeAsAwaitable.awaitedTypeOfType = getUnionType(types, /*subtypeReduction*/ true); + } + var promisedType = getPromisedTypeOfPromise(type); + if (promisedType) { + if (type.id === promisedType.id || ts.indexOf(awaitedTypeStack, promisedType.id) >= 0) { + // Verify that we don't have a bad actor in the form of a promise whose + // promised type is the same as the promise type, or a mutually recursive + // promise. If so, we return undefined as we cannot guess the shape. If this + // were the actual case in the JavaScript, this Promise would never resolve. + // + // An example of a bad actor with a singly-recursive promise type might + // be: + // + // interface BadPromise { + // then( + // onfulfilled: (value: BadPromise) => any, + // onrejected: (error: any) => any): BadPromise; + // } + // The above interface will pass the PromiseLike check, and return a + // promised type of `BadPromise`. Since this is a self reference, we + // don't want to keep recursing ad infinitum. + // + // An example of a bad actor in the form of a mutually-recursive + // promise type might be: + // + // interface BadPromiseA { + // then( + // onfulfilled: (value: BadPromiseB) => any, + // onrejected: (error: any) => any): BadPromiseB; + // } + // + // interface BadPromiseB { + // then( + // onfulfilled: (value: BadPromiseA) => any, + // onrejected: (error: any) => any): BadPromiseA; + // } + // + if (errorNode) { + error(errorNode, ts.Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method); + } + return undefined; + } + // Keep track of the type we're about to unwrap to avoid bad recursive promise types. + // See the comments above for more information. + awaitedTypeStack.push(type.id); + var awaitedType = getAwaitedType(promisedType, errorNode, diagnosticMessage); + awaitedTypeStack.pop(); + if (!awaitedType) { + return undefined; + } + return typeAsAwaitable.awaitedTypeOfType = awaitedType; + } + // The type was not a promise, so it could not be unwrapped any further. + // As long as the type does not have a callable "then" property, it is + // safe to return the type; otherwise, an error will be reported in + // the call to getNonThenableType and we will return undefined. + // + // An example of a non-promise "thenable" might be: + // + // await { then(): void {} } + // + // The "thenable" does not match the minimal definition for a promise. When + // a Promise/A+-compatible or ES6 promise tries to adopt this value, the promise + // will never settle. We treat this as an error to help flag an early indicator + // of a runtime problem. If the user wants to return this value from an async + // function, they would need to wrap it in some other value. If they want it to + // be treated as a promise, they can cast to . + var thenFunction = getTypeOfPropertyOfType(type, "then"); + if (thenFunction && getSignaturesOfType(thenFunction, 0 /* Call */).length > 0) { + if (errorNode) { + ts.Debug.assert(!!diagnosticMessage); + error(errorNode, diagnosticMessage); + } + return undefined; + } + return typeAsAwaitable.awaitedTypeOfType = type; } /** * Checks the return type of an async function to ensure it is a compatible @@ -38925,8 +42260,8 @@ var ts; if (returnType === unknownType) { return unknownType; } - var globalPromiseType = getGlobalPromiseType(); - if (globalPromiseType !== emptyGenericType && globalPromiseType !== getTargetType(returnType)) { + var globalPromiseType = getGlobalPromiseType(/*reportErrors*/ true); + if (globalPromiseType !== emptyGenericType && !isReferenceToType(returnType, globalPromiseType)) { // The promise type was not a valid type reference to the global promise type, so we // report an error and return the unknown type. error(node.type, ts.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type); @@ -38947,10 +42282,15 @@ var ts; var promiseConstructorSymbol = resolveEntityName(promiseConstructorName, 107455 /* Value */, /*ignoreErrors*/ true); var promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : unknownType; if (promiseConstructorType === unknownType) { - error(node.type, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, ts.entityNameToString(promiseConstructorName)); + if (promiseConstructorName.kind === 70 /* Identifier */ && promiseConstructorName.text === "Promise" && getTargetType(returnType) === getGlobalPromiseType(/*reportErrors*/ false)) { + error(node.type, ts.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option); + } + else { + error(node.type, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, ts.entityNameToString(promiseConstructorName)); + } return unknownType; } - var globalPromiseConstructorLikeType = getGlobalPromiseConstructorLikeType(); + var globalPromiseConstructorLikeType = getGlobalPromiseConstructorLikeType(/*reportErrors*/ true); if (globalPromiseConstructorLikeType === emptyObjectType) { // If we couldn't resolve the global PromiseConstructorLike type we cannot verify // compatibility with __awaiter. @@ -38969,7 +42309,7 @@ var ts; } } // Get and return the awaited type of the return type. - return checkAwaitedType(returnType, node, ts.Diagnostics.An_async_function_or_method_must_have_a_valid_awaitable_return_type); + return checkAwaitedType(returnType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } /** Check a decorator */ function checkDecorator(node) { @@ -38982,22 +42322,22 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 144 /* Parameter */: + case 145 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 147 /* PropertyDeclaration */: + case 148 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -39020,6 +42360,9 @@ var ts; markAliasSymbolAsReferenced(rootSymbol); } } + function getParameterTypeNodeForDecoratorCheck(node) { + return node.dotDotDotToken ? ts.getRestParameterElementType(node.type) : node.type; + } /** Check the decorators of a node */ function checkDecorators(node) { if (!node.decorators) { @@ -39033,29 +42376,37 @@ var ts; if (!compilerOptions.experimentalDecorators) { error(node, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning); } + var firstDecorator = node.decorators[0]; + checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); + if (node.kind === 145 /* Parameter */) { + checkExternalEmitHelpers(firstDecorator, 32 /* Param */); + } if (compilerOptions.emitDecoratorMetadata) { + checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { var parameter = _a[_i]; - markTypeNodeAsReferenced(parameter.type); + markTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } } break; - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; - markTypeNodeAsReferenced(parameter.type); + markTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markTypeNodeAsReferenced(node.type); break; - case 147 /* PropertyDeclaration */: - case 144 /* Parameter */: + case 148 /* PropertyDeclaration */: + markTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); + break; + case 145 /* Parameter */: markTypeNodeAsReferenced(node.type); break; } @@ -39067,6 +42418,7 @@ var ts; checkFunctionOrMethodDeclaration(node) || checkGrammarForGenerator(node); checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); } @@ -39074,11 +42426,11 @@ var ts; function checkFunctionOrMethodDeclaration(node) { checkDecorators(node); checkSignatureDeclaration(node); - var isAsync = ts.isAsyncFunctionLike(node); + var functionFlags = ts.getFunctionFlags(node); // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 142 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 143 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -39109,17 +42461,19 @@ var ts; } } checkSourceElement(node.body); - if (!node.asteriskToken) { - var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); + if ((functionFlags & 1 /* Generator */) === 0) { + var returnOrPromisedType = node.type && (functionFlags & 2 /* Async */ + ? checkAsyncFunctionReturnType(node) // Async function + : getTypeFromTypeNode(node.type)); // normal function checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } if (produceDiagnostics && !node.type) { // Report an implicit any error if there is no body, no explicit return type, and node is not a private method // in an ambient context - if (compilerOptions.noImplicitAny && ts.nodeIsMissing(node.body) && !isPrivateWithinAmbient(node)) { + if (noImplicitAny && ts.nodeIsMissing(node.body) && !isPrivateWithinAmbient(node)) { reportImplicitAnyError(node, anyType); } - if (node.asteriskToken && ts.nodeIsPresent(node.body)) { + if (functionFlags & 1 /* Generator */ && ts.nodeIsPresent(node.body)) { // A generator with a body and no type annotation can still cause errors. It can error if the // yielded values have no common supertype, or it can give an implicit any error if it has no // yielded values. The only way to trigger these errors is to try checking its return type. @@ -39138,56 +42492,54 @@ var ts; for (var _i = 0, deferredUnusedIdentifierNodes_1 = deferredUnusedIdentifierNodes; _i < deferredUnusedIdentifierNodes_1.length; _i++) { var node = deferredUnusedIdentifierNodes_1[_i]; switch (node.kind) { - case 261 /* SourceFile */: - case 230 /* ModuleDeclaration */: + case 264 /* SourceFile */: + case 232 /* ModuleDeclaration */: checkUnusedModuleMembers(node); break; - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: checkUnusedClassMembers(node); checkUnusedTypeParameters(node); break; - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: checkUnusedTypeParameters(node); break; - case 204 /* Block */: - case 232 /* CaseBlock */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: + case 206 /* Block */: + case 234 /* CaseBlock */: + case 213 /* ForStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: checkUnusedLocalsAndParameters(node); break; - case 150 /* Constructor */: - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: - case 185 /* ArrowFunction */: - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 151 /* Constructor */: + case 185 /* FunctionExpression */: + case 227 /* FunctionDeclaration */: + case 186 /* ArrowFunction */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: if (node.body) { checkUnusedLocalsAndParameters(node); } checkUnusedTypeParameters(node); break; - case 148 /* MethodSignature */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 158 /* FunctionType */: - case 159 /* ConstructorType */: + case 149 /* MethodSignature */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: checkUnusedTypeParameters(node); break; } - ; } } } function checkUnusedLocalsAndParameters(node) { - if (node.parent.kind !== 227 /* InterfaceDeclaration */ && noUnusedIdentifiers && !ts.isInAmbientContext(node)) { - var _loop_3 = function (key) { - var local = node.locals[key]; + if (node.parent.kind !== 229 /* InterfaceDeclaration */ && noUnusedIdentifiers && !ts.isInAmbientContext(node)) { + node.locals.forEach(function (local) { if (!local.isReferenced) { - if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 144 /* Parameter */) { + if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 145 /* Parameter */) { var parameter = ts.getRootDeclaration(local.valueDeclaration); if (compilerOptions.noUnusedParameters && !ts.isParameterPropertyDeclaration(parameter) && @@ -39200,22 +42552,28 @@ var ts; ts.forEach(local.declarations, function (d) { return errorUnusedLocal(d.name || d, local.name); }); } } - }; - for (var key in node.locals) { - _loop_3(key); - } + }); } } + function isRemovedPropertyFromObjectSpread(node) { + if (ts.isBindingElement(node) && ts.isObjectBindingPattern(node.parent)) { + var lastElement = ts.lastOrUndefined(node.parent.elements); + return lastElement !== node && !!lastElement.dotDotDotToken; + } + return false; + } function errorUnusedLocal(node, name) { if (isIdentifierThatStartsWithUnderScore(node)) { var declaration = ts.getRootDeclaration(node.parent); - if (declaration.kind === 223 /* VariableDeclaration */ && - (declaration.parent.parent.kind === 212 /* ForInStatement */ || - declaration.parent.parent.kind === 213 /* ForOfStatement */)) { + if (declaration.kind === 225 /* VariableDeclaration */ && + (declaration.parent.parent.kind === 214 /* ForInStatement */ || + declaration.parent.parent.kind === 215 /* ForOfStatement */)) { return; } } - error(node, ts.Diagnostics._0_is_declared_but_never_used, name); + if (!isRemovedPropertyFromObjectSpread(node.kind === 70 /* Identifier */ ? node.parent : node)) { + error(node, ts.Diagnostics._0_is_declared_but_never_used, name); + } } function parameterNameStartsWithUnderscore(parameterName) { return parameterName && isIdentifierThatStartsWithUnderScore(parameterName); @@ -39228,12 +42586,12 @@ var ts; if (node.members) { for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 149 /* MethodDeclaration */ || member.kind === 147 /* PropertyDeclaration */) { + if (member.kind === 150 /* MethodDeclaration */ || member.kind === 148 /* PropertyDeclaration */) { if (!member.symbol.isReferenced && ts.getModifierFlags(member) & 8 /* Private */) { error(member.name, ts.Diagnostics._0_is_declared_but_never_used, member.symbol.name); } } - else if (member.kind === 150 /* Constructor */) { + else if (member.kind === 151 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.getModifierFlags(parameter) & 8 /* Private */) { @@ -39266,22 +42624,21 @@ var ts; } function checkUnusedModuleMembers(node) { if (compilerOptions.noUnusedLocals && !ts.isInAmbientContext(node)) { - for (var key in node.locals) { - var local = node.locals[key]; + node.locals.forEach(function (local) { if (!local.isReferenced && !local.exportSymbol) { for (var _i = 0, _a = local.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; if (!ts.isAmbientModule(declaration)) { - error(declaration.name, ts.Diagnostics._0_is_declared_but_never_used, local.name); + errorUnusedLocal(declaration.name, local.name); } } } - } + }); } } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 204 /* Block */) { + if (node.kind === 206 /* Block */) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); @@ -39304,12 +42661,12 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 147 /* PropertyDeclaration */ || - node.kind === 146 /* PropertySignature */ || - node.kind === 149 /* MethodDeclaration */ || - node.kind === 148 /* MethodSignature */ || - node.kind === 151 /* GetAccessor */ || - node.kind === 152 /* SetAccessor */) { + if (node.kind === 148 /* PropertyDeclaration */ || + node.kind === 147 /* PropertySignature */ || + node.kind === 150 /* MethodDeclaration */ || + node.kind === 149 /* MethodSignature */ || + node.kind === 152 /* GetAccessor */ || + node.kind === 153 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -39318,7 +42675,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 144 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 145 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -39329,10 +42686,14 @@ var ts; potentialThisCollisions.push(node); } } + function checkCollisionWithCapturedNewTargetVariable(node, name) { + if (needCollisionCheckForIdentifier(node, name, "_newTarget")) { + potentialNewTargetCollisions.push(node); + } + } // this function will run after checking the source file so 'CaptureThis' is correct for all nodes function checkIfThisIsCapturedInEnclosingScope(node) { - var current = node; - while (current) { + ts.findAncestor(node, function (current) { if (getNodeCheckFlags(current) & 4 /* CaptureThis */) { var isDeclaration_1 = node.kind !== 70 /* Identifier */; if (isDeclaration_1) { @@ -39341,10 +42702,23 @@ var ts; else { error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference); } - return; + return true; } - current = current.parent; - } + }); + } + function checkIfNewTargetIsCapturedInEnclosingScope(node) { + ts.findAncestor(node, function (current) { + if (getNodeCheckFlags(current) & 8 /* CaptureNewTarget */) { + var isDeclaration_2 = node.kind !== 70 /* Identifier */; + if (isDeclaration_2) { + error(node.name, ts.Diagnostics.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference); + } + else { + error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference); + } + return true; + } + }); } function checkCollisionWithCapturedSuperVariable(node, name) { if (!needCollisionCheckForIdentifier(node, name, "_super")) { @@ -39357,8 +42731,8 @@ var ts; return; } if (ts.getClassExtendsHeritageClauseElement(enclosingClass)) { - var isDeclaration_2 = node.kind !== 70 /* Identifier */; - if (isDeclaration_2) { + var isDeclaration_3 = node.kind !== 70 /* Identifier */; + if (isDeclaration_3) { error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); } else { @@ -39375,27 +42749,27 @@ var ts; return; } // Uninstantiated modules shouldnt do this check - if (node.kind === 230 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { + if (node.kind === 232 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 261 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 264 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } function checkCollisionWithGlobalPromiseInGeneratedCode(node, name) { - if (!needCollisionCheckForIdentifier(node, name, "Promise")) { + if (languageVersion >= 4 /* ES2017 */ || !needCollisionCheckForIdentifier(node, name, "Promise")) { return; } // Uninstantiated modules shouldnt do this check - if (node.kind === 230 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { + if (node.kind === 232 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 261 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 8192 /* HasAsyncFunctions */) { + if (parent.kind === 264 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024 /* HasAsyncFunctions */) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -39430,7 +42804,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 223 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 225 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -39440,24 +42814,24 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 224 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 205 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 226 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 207 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 204 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 231 /* ModuleBlock */ || - container.kind === 230 /* ModuleDeclaration */ || - container.kind === 261 /* SourceFile */); + (container.kind === 206 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 233 /* ModuleBlock */ || + container.kind === 232 /* ModuleDeclaration */ || + container.kind === 264 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail // since LHS will be block scoped name instead of function scoped if (!namesShareScope) { - var name_23 = symbolToString(localDeclarationSymbol); - error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_23, name_23); + var name = symbolToString(localDeclarationSymbol); + error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name); } } } @@ -39465,7 +42839,7 @@ var ts; } // Check that a parameter initializer contains no references to parameters declared to the right of itself function checkParameterInitializer(node) { - if (ts.getRootDeclaration(node).kind !== 144 /* Parameter */) { + if (ts.getRootDeclaration(node).kind !== 145 /* Parameter */) { return; } var func = ts.getContainingFunction(node); @@ -39476,7 +42850,7 @@ var ts; // skip declaration names (i.e. in object literal expressions) return; } - if (n.kind === 177 /* PropertyAccessExpression */) { + if (n.kind === 178 /* PropertyAccessExpression */) { // skip property names in property access expression return visit(n.expression); } @@ -39495,27 +42869,28 @@ var ts; // so we need to do a bit of extra work to check if reference is legal var enclosingContainer = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); if (enclosingContainer === func) { - if (symbol.valueDeclaration.kind === 144 /* Parameter */) { + if (symbol.valueDeclaration.kind === 145 /* Parameter */ || + symbol.valueDeclaration.kind === 175 /* BindingElement */) { // it is ok to reference parameter in initializer if either // - parameter is located strictly on the left of current parameter declaration if (symbol.valueDeclaration.pos < node.pos) { return; } // - parameter is wrapped in function-like entity - var current = n; - while (current !== node.initializer) { - if (ts.isFunctionLike(current.parent)) { - return; + if (ts.findAncestor(n, function (current) { + if (current === node.initializer) { + return "quit"; } - // computed property names/initializers in instance property declaration of class like entities - // are executed in constructor and thus deferred - if (current.parent.kind === 147 /* PropertyDeclaration */ && - !(ts.hasModifier(current.parent, 32 /* Static */)) && - ts.isClassLike(current.parent.parent)) { - return; - } - current = current.parent; + return ts.isFunctionLike(current.parent) || + // computed property names/initializers in instance property declaration of class like entities + // are executed in constructor and thus deferred + (current.parent.kind === 148 /* PropertyDeclaration */ && + !(ts.hasModifier(current.parent, 32 /* Static */)) && + ts.isClassLike(current.parent.parent)); + })) { + return; } + // fall through to report error } error(n, ts.Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, ts.declarationNameToString(node.name), ts.declarationNameToString(n)); } @@ -39536,40 +42911,46 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 142 /* ComputedPropertyName */) { + if (node.name.kind === 143 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 174 /* BindingElement */) { + if (node.kind === 175 /* BindingElement */) { + if (node.parent.kind === 173 /* ObjectBindingPattern */ && languageVersion < 5 /* ESNext */) { + checkExternalEmitHelpers(node, 4 /* Rest */); + } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 142 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 143 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access - var parent_10 = node.parent.parent; - var parentType = getTypeForBindingElementParent(parent_10); - var name_24 = node.propertyName || node.name; - var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name_24)); + var parent = node.parent.parent; + var parentType = getTypeForBindingElementParent(parent); + var name = node.propertyName || node.name; + var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name)); markPropertyAsReferenced(property); - if (parent_10.initializer && property && getParentOfSymbol(property)) { - checkClassPropertyAccess(parent_10, parent_10.initializer, parentType, property); + if (parent.initializer && property) { + checkPropertyAccessibility(parent, parent.initializer, parentType, property); } } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { + if (node.name.kind === 174 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 512 /* Read */); + } ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.getRootDeclaration(node).kind === 144 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 145 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { // Don't validate for-in initializer as it is already an error - if (node.initializer && node.parent.parent.kind !== 212 /* ForInStatement */) { + if (node.initializer && node.parent.parent.kind !== 214 /* ForInStatement */) { checkTypeAssignableTo(checkExpressionCached(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, /*headMessage*/ undefined); checkParameterInitializer(node); } @@ -39580,7 +42961,7 @@ var ts; if (node === symbol.valueDeclaration) { // Node is the primary declaration of the symbol, just validate the initializer // Don't validate for-in initializer as it is already an error - if (node.initializer && node.parent.parent.kind !== 212 /* ForInStatement */) { + if (node.initializer && node.parent.parent.kind !== 214 /* ForInStatement */) { checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, /*headMessage*/ undefined); checkParameterInitializer(node); } @@ -39600,21 +42981,22 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 147 /* PropertyDeclaration */ && node.kind !== 146 /* PropertySignature */) { + if (node.kind !== 148 /* PropertyDeclaration */ && node.kind !== 147 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 223 /* VariableDeclaration */ || node.kind === 174 /* BindingElement */) { + if (node.kind === 225 /* VariableDeclaration */ || node.kind === 175 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 144 /* Parameter */ && right.kind === 223 /* VariableDeclaration */) || - (left.kind === 223 /* VariableDeclaration */ && right.kind === 144 /* Parameter */)) { + if ((left.kind === 145 /* Parameter */ && right.kind === 225 /* VariableDeclaration */) || + (left.kind === 225 /* VariableDeclaration */ && right.kind === 145 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -39644,8 +43026,8 @@ var ts; } function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) { // We only disallow modifier on a method declaration if it is a property of object-literal-expression - if (node.modifiers && node.parent.kind === 176 /* ObjectLiteralExpression */) { - if (ts.isAsyncFunctionLike(node)) { + if (node.modifiers && node.parent.kind === 177 /* ObjectLiteralExpression */) { + if (ts.getFunctionFlags(node) & 2 /* Async */) { if (node.modifiers.length > 1) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } @@ -39665,7 +43047,7 @@ var ts; checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 206 /* EmptyStatement */) { + if (node.thenStatement.kind === 208 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -39685,12 +43067,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 224 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 226 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 224 /* VariableDeclarationList */) { + if (node.initializer.kind === 226 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -39708,19 +43090,29 @@ var ts; } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); + if (node.kind === 215 /* ForOfStatement */) { + if (node.awaitModifier) { + if (languageVersion < 4 /* ES2017 */) { + checkExternalEmitHelpers(node, 8192 /* ForAwaitOfIncludes */); + } + } + else if (languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 256 /* ForOfIncludes */); + } + } // Check the LHS and RHS // If the LHS is a declaration, just check it as a variable declaration, which will in turn check the RHS // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 224 /* VariableDeclarationList */) { + if (node.initializer.kind === 226 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; - var iteratedType = checkRightHandSideOfForOf(node.expression); + var iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier); // There may be a destructuring assignment on the left side - if (varExpr.kind === 175 /* ArrayLiteralExpression */ || varExpr.kind === 176 /* ObjectLiteralExpression */) { + if (varExpr.kind === 176 /* ArrayLiteralExpression */ || varExpr.kind === 177 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -39752,7 +43144,7 @@ var ts; // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 224 /* VariableDeclarationList */) { + if (node.initializer.kind === 226 /* VariableDeclarationList */) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -39766,7 +43158,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 175 /* ArrayLiteralExpression */ || varExpr.kind === 176 /* ObjectLiteralExpression */) { + if (varExpr.kind === 176 /* ArrayLiteralExpression */ || varExpr.kind === 177 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -39779,7 +43171,7 @@ var ts; } // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved // in this case error about missing name is already reported - do not report extra one - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 /* Object */ | 16384 /* TypeParameter */ | 524288 /* IndexedAccess */)) { + if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 /* Object */ | 540672 /* TypeVariable */ | 16777216 /* NonPrimitive */)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } checkSourceElement(node.statement); @@ -39795,52 +43187,113 @@ var ts; checkVariableDeclaration(decl); } } - function checkRightHandSideOfForOf(rhsExpression) { + function checkRightHandSideOfForOf(rhsExpression, awaitModifier) { var expressionType = checkNonNullExpression(rhsExpression); - return checkIteratedTypeOrElementType(expressionType, rhsExpression, /*allowStringInput*/ true); + return checkIteratedTypeOrElementType(expressionType, rhsExpression, /*allowStringInput*/ true, awaitModifier !== undefined); } - function checkIteratedTypeOrElementType(inputType, errorNode, allowStringInput) { + function checkIteratedTypeOrElementType(inputType, errorNode, allowStringInput, allowAsyncIterable) { if (isTypeAny(inputType)) { return inputType; } - if (languageVersion >= 2 /* ES2015 */) { - return checkElementTypeOfIterable(inputType, errorNode); - } - if (allowStringInput) { - return checkElementTypeOfArrayOrString(inputType, errorNode); - } - if (isArrayLikeType(inputType)) { - var indexType = getIndexTypeOfType(inputType, 1 /* Number */); - if (indexType) { - return indexType; - } - } - if (errorNode) { - error(errorNode, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(inputType)); - } - return unknownType; + return getIteratedTypeOrElementType(inputType, errorNode, allowStringInput, allowAsyncIterable, /*checkAssignability*/ true) || anyType; } /** - * When errorNode is undefined, it means we should not report any errors. + * When consuming an iterable type in a for..of, spread, or iterator destructuring assignment + * we want to get the iterated type of an iterable for ES2015 or later, or the iterated type + * of a iterable (if defined globally) or element type of an array like for ES2015 or earlier. */ - function checkElementTypeOfIterable(iterable, errorNode) { - var elementType = getElementTypeOfIterable(iterable, errorNode); - // Now even though we have extracted the iteratedType, we will have to validate that the type - // passed in is actually an Iterable. - if (errorNode && elementType) { - checkTypeAssignableTo(iterable, createIterableType(elementType), errorNode); + function getIteratedTypeOrElementType(inputType, errorNode, allowStringInput, allowAsyncIterable, checkAssignability) { + var uplevelIteration = languageVersion >= 2 /* ES2015 */; + var downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration; + // Get the iterated type of an `Iterable` or `IterableIterator` only in ES2015 + // or higher, when inside of an async generator or for-await-if, or when + // downlevelIteration is requested. + if (uplevelIteration || downlevelIteration || allowAsyncIterable) { + // We only report errors for an invalid iterable type in ES2015 or higher. + var iteratedType = getIteratedTypeOfIterable(inputType, uplevelIteration ? errorNode : undefined, allowAsyncIterable, allowAsyncIterable, checkAssignability); + if (iteratedType || uplevelIteration) { + return iteratedType; + } } - return elementType || anyType; + var arrayType = inputType; + var reportedError = false; + var hasStringConstituent = false; + // If strings are permitted, remove any string-like constituents from the array type. + // This allows us to find other non-string element types from an array unioned with + // a string. + if (allowStringInput) { + if (arrayType.flags & 65536 /* Union */) { + // After we remove all types that are StringLike, we will know if there was a string constituent + // based on whether the result of filter is a new array. + var arrayTypes = inputType.types; + var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 262178 /* StringLike */); }); + if (filteredTypes !== arrayTypes) { + arrayType = getUnionType(filteredTypes, /*subtypeReduction*/ true); + } + } + else if (arrayType.flags & 262178 /* StringLike */) { + arrayType = neverType; + } + hasStringConstituent = arrayType !== inputType; + if (hasStringConstituent) { + if (languageVersion < 1 /* ES5 */) { + if (errorNode) { + error(errorNode, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); + reportedError = true; + } + } + // Now that we've removed all the StringLike types, if no constituents remain, then the entire + // arrayOrStringType was a string. + if (arrayType.flags & 8192 /* Never */) { + return stringType; + } + } + } + if (!isArrayLikeType(arrayType)) { + if (errorNode && !reportedError) { + // Which error we report depends on whether we allow strings or if there was a + // string constituent. For example, if the input type is number | string, we + // want to say that number is not an array type. But if the input was just + // number and string input is allowed, we want to say that number is not an + // array type or a string type. + var diagnostic = !allowStringInput || hasStringConstituent + ? downlevelIteration + ? ts.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator + : ts.Diagnostics.Type_0_is_not_an_array_type + : downlevelIteration + ? ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator + : ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type; + error(errorNode, diagnostic, typeToString(arrayType)); + } + return hasStringConstituent ? stringType : undefined; + } + var arrayElementType = getIndexTypeOfType(arrayType, 1 /* Number */); + if (hasStringConstituent && arrayElementType) { + // This is just an optimization for the case where arrayOrStringType is string | string[] + if (arrayElementType.flags & 262178 /* StringLike */) { + return stringType; + } + return getUnionType([arrayElementType, stringType], /*subtypeReduction*/ true); + } + return arrayElementType; } /** * We want to treat type as an iterable, and get the type it is an iterable of. The iterable * must have the following structure (annotated with the names of the variables below): * - * { // iterable - * [Symbol.iterator]: { // iteratorFunction - * (): Iterator + * { // iterable + * [Symbol.iterator]: { // iteratorMethod + * (): Iterator + * } + * } + * + * For an async iterable, we expect the following structure: + * + * { // iterable + * [Symbol.asyncIterator]: { // iteratorMethod + * (): AsyncIterator + * } * } - * } * * T is the type we are after. At every level that involves analyzing return types * of signatures, we union the return types of all the signatures. @@ -39852,166 +43305,170 @@ var ts; * caller requested it. Then the caller can decide what to do in the case where there is no iterated * type. This is different from returning anyType, because that would signify that we have matched the * whole pattern and that T (above) is 'any'. + * + * For a **for-of** statement, `yield*` (in a normal generator), spread, array + * destructuring, or normal generator we will only ever look for a `[Symbol.iterator]()` + * method. + * + * For an async generator we will only ever look at the `[Symbol.asyncIterator]()` method. + * + * For a **for-await-of** statement or a `yield*` in an async generator we will look for + * the `[Symbol.asyncIterator]()` method first, and then the `[Symbol.iterator]()` method. */ - function getElementTypeOfIterable(type, errorNode) { + function getIteratedTypeOfIterable(type, errorNode, isAsyncIterable, allowNonAsyncIterables, checkAssignability) { if (isTypeAny(type)) { return undefined; } var typeAsIterable = type; - if (!typeAsIterable.iterableElementType) { - // As an optimization, if the type is instantiated directly using the globalIterableType (Iterable), - // then just grab its type argument. - if ((getObjectFlags(type) & 4 /* Reference */) && type.target === getGlobalIterableType()) { - typeAsIterable.iterableElementType = type.typeArguments[0]; - } - else { - var iteratorFunction = getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("iterator")); - if (isTypeAny(iteratorFunction)) { - return undefined; - } - var iteratorFunctionSignatures = iteratorFunction ? getSignaturesOfType(iteratorFunction, 0 /* Call */) : emptyArray; - if (iteratorFunctionSignatures.length === 0) { - if (errorNode) { - error(errorNode, ts.Diagnostics.Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator); - } - return undefined; - } - typeAsIterable.iterableElementType = getElementTypeOfIterator(getUnionType(ts.map(iteratorFunctionSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true), errorNode); + if (isAsyncIterable ? typeAsIterable.iteratedTypeOfAsyncIterable : typeAsIterable.iteratedTypeOfIterable) { + return isAsyncIterable ? typeAsIterable.iteratedTypeOfAsyncIterable : typeAsIterable.iteratedTypeOfIterable; + } + if (isAsyncIterable) { + // As an optimization, if the type is an instantiation of the global `AsyncIterable` + // or the global `AsyncIterableIterator` then just grab its type argument. + if (isReferenceToType(type, getGlobalAsyncIterableType(/*reportErrors*/ false)) || + isReferenceToType(type, getGlobalAsyncIterableIteratorType(/*reportErrors*/ false))) { + return typeAsIterable.iteratedTypeOfAsyncIterable = type.typeArguments[0]; } } - return typeAsIterable.iterableElementType; + if (!isAsyncIterable || allowNonAsyncIterables) { + // As an optimization, if the type is an instantiation of the global `Iterable` or + // `IterableIterator` then just grab its type argument. + if (isReferenceToType(type, getGlobalIterableType(/*reportErrors*/ false)) || + isReferenceToType(type, getGlobalIterableIteratorType(/*reportErrors*/ false))) { + return isAsyncIterable + ? typeAsIterable.iteratedTypeOfAsyncIterable = type.typeArguments[0] + : typeAsIterable.iteratedTypeOfIterable = type.typeArguments[0]; + } + } + var iteratorMethodSignatures; + var mayBeIterable = false; + if (isAsyncIterable) { + var iteratorMethod = getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("asyncIterator")); + if (isTypeAny(iteratorMethod)) { + return undefined; + } + iteratorMethodSignatures = iteratorMethod && getSignaturesOfType(iteratorMethod, 0 /* Call */); + } + if (!isAsyncIterable || (allowNonAsyncIterables && !ts.some(iteratorMethodSignatures))) { + var iteratorMethod = getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("iterator")); + if (isTypeAny(iteratorMethod)) { + return undefined; + } + iteratorMethodSignatures = iteratorMethod && getSignaturesOfType(iteratorMethod, 0 /* Call */); + mayBeIterable = true; + } + if (ts.some(iteratorMethodSignatures)) { + var iteratorMethodReturnType = getUnionType(ts.map(iteratorMethodSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true); + var iteratedType = getIteratedTypeOfIterator(iteratorMethodReturnType, errorNode, /*isAsyncIterator*/ false); + if (checkAssignability && errorNode && iteratedType) { + // If `checkAssignability` was specified, we were called from + // `checkIteratedTypeOrElementType`. As such, we need to validate that + // the type passed in is actually an Iterable. + checkTypeAssignableTo(type, mayBeIterable + ? createIterableType(iteratedType) + : createAsyncIterableType(iteratedType), errorNode); + } + return isAsyncIterable + ? typeAsIterable.iteratedTypeOfAsyncIterable = iteratedType + : typeAsIterable.iteratedTypeOfIterable = iteratedType; + } + if (errorNode) { + error(errorNode, isAsyncIterable + ? ts.Diagnostics.Type_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator + : ts.Diagnostics.Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator); + } + return undefined; } /** - * This function has very similar logic as getElementTypeOfIterable, except that it operates on + * This function has very similar logic as getIteratedTypeOfIterable, except that it operates on * Iterators instead of Iterables. Here is the structure: * * { // iterator - * next: { // iteratorNextFunction - * (): { // iteratorNextResult - * value: T // iteratorNextValue + * next: { // nextMethod + * (): { // nextResult + * value: T // nextValue * } * } * } * + * For an async iterator, we expect the following structure: + * + * { // iterator + * next: { // nextMethod + * (): PromiseLike<{ // nextResult + * value: T // nextValue + * }> + * } + * } */ - function getElementTypeOfIterator(type, errorNode) { + function getIteratedTypeOfIterator(type, errorNode, isAsyncIterator) { if (isTypeAny(type)) { return undefined; } var typeAsIterator = type; - if (!typeAsIterator.iteratorElementType) { - // As an optimization, if the type is instantiated directly using the globalIteratorType (Iterator), - // then just grab its type argument. - if ((getObjectFlags(type) & 4 /* Reference */) && type.target === getGlobalIteratorType()) { - typeAsIterator.iteratorElementType = type.typeArguments[0]; - } - else { - var iteratorNextFunction = getTypeOfPropertyOfType(type, "next"); - if (isTypeAny(iteratorNextFunction)) { - return undefined; - } - var iteratorNextFunctionSignatures = iteratorNextFunction ? getSignaturesOfType(iteratorNextFunction, 0 /* Call */) : emptyArray; - if (iteratorNextFunctionSignatures.length === 0) { - if (errorNode) { - error(errorNode, ts.Diagnostics.An_iterator_must_have_a_next_method); - } - return undefined; - } - var iteratorNextResult = getUnionType(ts.map(iteratorNextFunctionSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true); - if (isTypeAny(iteratorNextResult)) { - return undefined; - } - var iteratorNextValue = getTypeOfPropertyOfType(iteratorNextResult, "value"); - if (!iteratorNextValue) { - if (errorNode) { - error(errorNode, ts.Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); - } - return undefined; - } - typeAsIterator.iteratorElementType = iteratorNextValue; - } + if (isAsyncIterator ? typeAsIterator.iteratedTypeOfAsyncIterator : typeAsIterator.iteratedTypeOfIterator) { + return isAsyncIterator ? typeAsIterator.iteratedTypeOfAsyncIterator : typeAsIterator.iteratedTypeOfIterator; } - return typeAsIterator.iteratorElementType; - } - function getElementTypeOfIterableIterator(type) { - if (isTypeAny(type)) { + // As an optimization, if the type is an instantiation of the global `Iterator` (for + // a non-async iterator) or the global `AsyncIterator` (for an async-iterator) then + // just grab its type argument. + var getIteratorType = isAsyncIterator ? getGlobalAsyncIteratorType : getGlobalIteratorType; + if (isReferenceToType(type, getIteratorType(/*reportErrors*/ false))) { + return isAsyncIterator + ? typeAsIterator.iteratedTypeOfAsyncIterator = type.typeArguments[0] + : typeAsIterator.iteratedTypeOfIterator = type.typeArguments[0]; + } + // Both async and non-async iterators must have a `next` method. + var nextMethod = getTypeOfPropertyOfType(type, "next"); + if (isTypeAny(nextMethod)) { return undefined; } - // As an optimization, if the type is instantiated directly using the globalIterableIteratorType (IterableIterator), - // then just grab its type argument. - if ((getObjectFlags(type) & 4 /* Reference */) && type.target === getGlobalIterableIteratorType()) { - return type.typeArguments[0]; + var nextMethodSignatures = nextMethod ? getSignaturesOfType(nextMethod, 0 /* Call */) : emptyArray; + if (nextMethodSignatures.length === 0) { + if (errorNode) { + error(errorNode, isAsyncIterator + ? ts.Diagnostics.An_async_iterator_must_have_a_next_method + : ts.Diagnostics.An_iterator_must_have_a_next_method); + } + return undefined; } - return getElementTypeOfIterable(type, /*errorNode*/ undefined) || - getElementTypeOfIterator(type, /*errorNode*/ undefined); + var nextResult = getUnionType(ts.map(nextMethodSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true); + if (isTypeAny(nextResult)) { + return undefined; + } + // For an async iterator, we must get the awaited type of the return type. + if (isAsyncIterator) { + nextResult = getAwaitedTypeOfPromise(nextResult, errorNode, ts.Diagnostics.The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property); + if (isTypeAny(nextResult)) { + return undefined; + } + } + var nextValue = nextResult && getTypeOfPropertyOfType(nextResult, "value"); + if (!nextValue) { + if (errorNode) { + error(errorNode, isAsyncIterator + ? ts.Diagnostics.The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property + : ts.Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); + } + return undefined; + } + return isAsyncIterator + ? typeAsIterator.iteratedTypeOfAsyncIterator = nextValue + : typeAsIterator.iteratedTypeOfIterator = nextValue; } /** - * This function does the following steps: - * 1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents. - * 2. Take the element types of the array constituents. - * 3. Return the union of the element types, and string if there was a string constituent. - * - * For example: - * string -> string - * number[] -> number - * string[] | number[] -> string | number - * string | number[] -> string | number - * string | string[] | number[] -> string | number - * - * It also errors if: - * 1. Some constituent is neither a string nor an array. - * 2. Some constituent is a string and target is less than ES5 (because in ES3 string is not indexable). + * A generator may have a return type of `Iterator`, `Iterable`, or + * `IterableIterator`. An async generator may have a return type of `AsyncIterator`, + * `AsyncIterable`, or `AsyncIterableIterator`. This function can be used to extract + * the iterated type from this return type for contextual typing and verifying signatures. */ - function checkElementTypeOfArrayOrString(arrayOrStringType, errorNode) { - ts.Debug.assert(languageVersion < 2 /* ES2015 */); - var arrayType = arrayOrStringType; - if (arrayOrStringType.flags & 65536 /* Union */) { - // After we remove all types that are StringLike, we will know if there was a string constituent - // based on whether the result of filter is a new array. - var arrayTypes = arrayOrStringType.types; - var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 262178 /* StringLike */); }); - if (filteredTypes !== arrayTypes) { - arrayType = getUnionType(filteredTypes, /*subtypeReduction*/ true); - } + function getIteratedTypeOfGenerator(returnType, isAsyncGenerator) { + if (isTypeAny(returnType)) { + return undefined; } - else if (arrayOrStringType.flags & 262178 /* StringLike */) { - arrayType = neverType; - } - var hasStringConstituent = arrayOrStringType !== arrayType; - var reportedError = false; - if (hasStringConstituent) { - if (languageVersion < 1 /* ES5 */) { - error(errorNode, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); - reportedError = true; - } - // Now that we've removed all the StringLike types, if no constituents remain, then the entire - // arrayOrStringType was a string. - if (arrayType.flags & 8192 /* Never */) { - return stringType; - } - } - if (!isArrayLikeType(arrayType)) { - if (!reportedError) { - // Which error we report depends on whether there was a string constituent. For example, - // if the input type is number | string, we want to say that number is not an array type. - // But if the input was just number, we want to say that number is not an array type - // or a string type. - var diagnostic = hasStringConstituent - ? ts.Diagnostics.Type_0_is_not_an_array_type - : ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type; - error(errorNode, diagnostic, typeToString(arrayType)); - } - return hasStringConstituent ? stringType : unknownType; - } - var arrayElementType = getIndexTypeOfType(arrayType, 1 /* Number */) || unknownType; - if (hasStringConstituent) { - // This is just an optimization for the case where arrayOrStringType is string | string[] - if (arrayElementType.flags & 262178 /* StringLike */) { - return stringType; - } - return getUnionType([arrayElementType, stringType], /*subtypeReduction*/ true); - } - return arrayElementType; + return getIteratedTypeOfIterable(returnType, /*errorNode*/ undefined, isAsyncGenerator, /*allowNonAsyncIterables*/ false, /*checkAssignability*/ false) + || getIteratedTypeOfIterator(returnType, /*errorNode*/ undefined, isAsyncGenerator); } function checkBreakOrContinueStatement(node) { // Grammar checking @@ -40019,10 +43476,12 @@ var ts; // TODO: Check that target label is valid } function isGetAccessorWithAnnotatedSetAccessor(node) { - return !!(node.kind === 151 /* GetAccessor */ && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 152 /* SetAccessor */))); + return !!(node.kind === 152 /* GetAccessor */ && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 153 /* SetAccessor */))); } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { - var unwrappedReturnType = ts.isAsyncFunctionLike(func) ? getPromisedType(returnType) : returnType; + var unwrappedReturnType = (ts.getFunctionFlags(func) & 3 /* AsyncOrAsyncGenerator */) === 2 /* Async */ + ? getPromisedTypeOfPromise(returnType) // Async function + : returnType; // AsyncGenerator function, Generator function, or normal function return unwrappedReturnType && maybeTypeOfKind(unwrappedReturnType, 1024 /* Void */ | 1 /* Any */); } function checkReturnStatement(node) { @@ -40039,40 +43498,41 @@ var ts; var returnType = getReturnTypeOfSignature(signature); if (strictNullChecks || node.expression || returnType.flags & 8192 /* Never */) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.asteriskToken) { + var functionFlags = ts.getFunctionFlags(func); + if (functionFlags & 1 /* Generator */) { // A generator does not need its return expressions checked against its return type. // Instead, the yield expressions are checked against the element type. // TODO: Check return expressions of generators when return type tracking is added // for generators. return; } - if (func.kind === 152 /* SetAccessor */) { + if (func.kind === 153 /* SetAccessor */) { if (node.expression) { - error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); + error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 150 /* Constructor */) { - if (node.expression && !checkTypeAssignableTo(exprType, returnType, node.expression)) { - error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); + else if (func.kind === 151 /* Constructor */) { + if (node.expression && !checkTypeAssignableTo(exprType, returnType, node)) { + error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } } else if (func.type || isGetAccessorWithAnnotatedSetAccessor(func)) { - if (ts.isAsyncFunctionLike(func)) { - var promisedType = getPromisedType(returnType); - var awaitedType = checkAwaitedType(exprType, node.expression || node, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); + if (functionFlags & 2 /* Async */) { + var promisedType = getPromisedTypeOfPromise(returnType); + var awaitedType = checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); if (promisedType) { // If the function has a return type, but promisedType is // undefined, an error will be reported in checkAsyncFunctionReturnType // so we don't need to report one here. - checkTypeAssignableTo(awaitedType, promisedType, node.expression || node); + checkTypeAssignableTo(awaitedType, promisedType, node); } } else { - checkTypeAssignableTo(exprType, returnType, node.expression || node); + checkTypeAssignableTo(exprType, returnType, node); } } } - else if (func.kind !== 150 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 151 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { // The function has a return type, but the return statement doesn't have an expression. error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } @@ -40081,7 +43541,7 @@ var ts; function checkWithStatement(node) { // Grammar checking for withStatement if (!checkGrammarStatementInAmbientContext(node)) { - if (node.flags & 524288 /* AwaitContext */) { + if (node.flags & 16384 /* AwaitContext */) { grammarErrorOnFirstToken(node, ts.Diagnostics.with_statements_are_not_allowed_in_an_async_function_block); } } @@ -40102,7 +43562,7 @@ var ts; var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 254 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 257 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -40114,7 +43574,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 253 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 256 /* CaseClause */) { var caseClause = clause; // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable @@ -40140,18 +43600,16 @@ var ts; function checkLabeledStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - var current = node.parent; - while (current) { + ts.findAncestor(node.parent, function (current) { if (ts.isFunctionLike(current)) { - break; + return "quit"; } - if (current.kind === 219 /* LabeledStatement */ && current.label.text === node.label.text) { + if (current.kind === 221 /* LabeledStatement */ && current.label.text === node.label.text) { var sourceFile = ts.getSourceFileOfNode(node); grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); - break; + return true; } - current = current.parent; - } + }); } // ensure that label is unique checkSourceElement(node.statement); @@ -40182,14 +43640,14 @@ var ts; grammarErrorOnFirstToken(catchClause.variableDeclaration.initializer, ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer); } else { - var blockLocals = catchClause.block.locals; - if (blockLocals) { - for (var caughtName in catchClause.locals) { - var blockLocal = blockLocals[caughtName]; + var blockLocals_1 = catchClause.block.locals; + if (blockLocals_1) { + ts.forEachKey(catchClause.locals, function (caughtName) { + var blockLocal = blockLocals_1.get(caughtName); if (blockLocal && (blockLocal.flags & 2 /* BlockScopedVariable */) !== 0) { grammarErrorOnNode(blockLocal.valueDeclaration, ts.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause, caughtName); } - } + }); } } } @@ -40241,15 +43699,16 @@ var ts; if (!indexType) { return; } + var propDeclaration = prop.valueDeclaration; // index is numeric and property name is not valid numeric literal - if (indexKind === 1 /* Number */ && !isNumericName(prop.valueDeclaration.name)) { + if (indexKind === 1 /* Number */ && !(propDeclaration ? isNumericName(propDeclaration.name) : isNumericLiteralName(prop.name))) { return; } // perform property check if property or indexer is declared in 'type' // this allows to rule out cases when both property and indexer are inherited from the base class var errorNode; - if (prop.valueDeclaration.name.kind === 142 /* ComputedPropertyName */ || prop.parent === containingType.symbol) { - errorNode = prop.valueDeclaration; + if (propDeclaration && (propDeclaration.name.kind === 143 /* ComputedPropertyName */ || prop.parent === containingType.symbol)) { + errorNode = propDeclaration; } else if (indexDeclaration) { errorNode = indexDeclaration; @@ -40279,16 +43738,26 @@ var ts; case "string": case "symbol": case "void": + case "object": error(name, message, name.text); } } - /** Check each type parameter and check that type parameters have no duplicate type parameter declarations */ + /** + * Check each type parameter and check that type parameters have no duplicate type parameter declarations + */ function checkTypeParameters(typeParameterDeclarations) { if (typeParameterDeclarations) { - for (var i = 0, n = typeParameterDeclarations.length; i < n; i++) { + var seenDefault = false; + for (var i = 0; i < typeParameterDeclarations.length; i++) { var node = typeParameterDeclarations[i]; checkTypeParameter(node); if (produceDiagnostics) { + if (node.default) { + seenDefault = true; + } + else if (seenDefault) { + error(node, ts.Diagnostics.Required_type_parameters_may_not_follow_optional_type_parameters); + } for (var j = 0; j < i; j++) { if (typeParameterDeclarations[j].symbol === node.symbol) { error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.declarationNameToString(node.name)); @@ -40299,23 +43768,65 @@ var ts; } } /** Check that type parameter lists are identical across multiple declarations */ - function checkTypeParameterListsIdentical(node, symbol) { + function checkTypeParameterListsIdentical(symbol) { if (symbol.declarations.length === 1) { return; } - var firstDecl; - for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { - var declaration = _a[_i]; - if (declaration.kind === 226 /* ClassDeclaration */ || declaration.kind === 227 /* InterfaceDeclaration */) { - if (!firstDecl) { - firstDecl = declaration; - } - else if (!areTypeParametersIdentical(firstDecl.typeParameters, node.typeParameters)) { - error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, node.name.text); + var links = getSymbolLinks(symbol); + if (!links.typeParametersChecked) { + links.typeParametersChecked = true; + var declarations = getClassOrInterfaceDeclarationsOfSymbol(symbol); + if (declarations.length <= 1) { + return; + } + var type = getDeclaredTypeOfSymbol(symbol); + if (!areTypeParametersIdentical(declarations, type.localTypeParameters)) { + // Report an error on every conflicting declaration. + var name = symbolToString(symbol); + for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { + var declaration = declarations_6[_i]; + error(declaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name); } } } } + function areTypeParametersIdentical(declarations, typeParameters) { + var maxTypeArgumentCount = ts.length(typeParameters); + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { + var declaration = declarations_7[_i]; + // If this declaration has too few or too many type parameters, we report an error + var numTypeParameters = ts.length(declaration.typeParameters); + if (numTypeParameters < minTypeArgumentCount || numTypeParameters > maxTypeArgumentCount) { + return false; + } + for (var i = 0; i < numTypeParameters; i++) { + var source = declaration.typeParameters[i]; + var target = typeParameters[i]; + // If the type parameter node does not have the same as the resolved type + // parameter at this position, we report an error. + if (source.name.text !== target.symbol.name) { + return false; + } + // If the type parameter node does not have an identical constraint as the resolved + // type parameter at this position, we report an error. + var sourceConstraint = source.constraint && getTypeFromTypeNode(source.constraint); + var targetConstraint = getConstraintFromTypeParameter(target); + if ((sourceConstraint || targetConstraint) && + (!sourceConstraint || !targetConstraint || !isTypeIdenticalTo(sourceConstraint, targetConstraint))) { + return false; + } + // If the type parameter node has a default and it is not identical to the default + // for the type parameter at this position, we report an error. + var sourceDefault = source.default && getTypeFromTypeNode(source.default); + var targetDefault = getDefaultFromTypeParameter(target); + if (sourceDefault && targetDefault && !isTypeIdenticalTo(sourceDefault, targetDefault)) { + return false; + } + } + } + return true; + } function checkClassExpression(node) { checkClassLikeDeclaration(node); checkNodeDeferred(node); @@ -40334,11 +43845,12 @@ var ts; registerForUnusedIdentifiersCheck(node); } function checkClassLikeDeclaration(node) { - checkGrammarClassDeclarationHeritageClauses(node); + checkGrammarClassLikeDeclaration(node); checkDecorators(node); if (node.name) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Class_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); } @@ -40348,19 +43860,27 @@ var ts; var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); var staticType = getTypeOfSymbol(symbol); - checkTypeParameterListsIdentical(node, symbol); + checkTypeParameterListsIdentical(symbol); checkClassForDuplicateDeclarations(node); + // Only check for reserved static identifiers on non-ambient context. + if (!ts.isInAmbientContext(node)) { + checkClassForStaticPropertyNameConflicts(node); + } var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { + if (languageVersion < 2 /* ES2015 */) { + checkExternalEmitHelpers(baseTypeNode.parent, 1 /* Extends */); + } var baseTypes = getBaseTypes(type); if (baseTypes.length && produceDiagnostics) { var baseType_1 = baseTypes[0]; - var staticBaseType = getBaseConstructorTypeOfClass(type); + var baseConstructorType = getBaseConstructorTypeOfClass(type); + var staticBaseType = getApparentType(baseConstructorType); checkBaseTypeAccessibility(staticBaseType, baseTypeNode); checkSourceElement(baseTypeNode.expression); if (baseTypeNode.typeArguments) { ts.forEach(baseTypeNode.typeArguments, checkSourceElement); - for (var _i = 0, _a = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments); _i < _a.length; _i++) { + for (var _i = 0, _a = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); _i < _a.length; _i++) { var constructor = _a[_i]; if (!checkTypeArgumentConstraints(constructor.typeParameters, baseTypeNode.typeArguments)) { break; @@ -40369,19 +43889,15 @@ var ts; } checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(baseType_1, type.thisType), node.name || node, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); checkTypeAssignableTo(staticType, getTypeWithoutSignatures(staticBaseType), node.name || node, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); - if (baseType_1.symbol.valueDeclaration && - !ts.isInAmbientContext(baseType_1.symbol.valueDeclaration) && - baseType_1.symbol.valueDeclaration.kind === 226 /* ClassDeclaration */) { - if (!isBlockScopedNameDeclaredBeforeUse(baseType_1.symbol.valueDeclaration, node)) { - error(baseTypeNode, ts.Diagnostics.A_class_must_be_declared_after_its_base_class); - } + if (baseConstructorType.flags & 540672 /* TypeVariable */ && !isMixinConstructorType(staticType)) { + error(node.name || node, ts.Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any); } - if (!(staticBaseType.symbol && staticBaseType.symbol.flags & 32 /* Class */)) { + if (!(staticBaseType.symbol && staticBaseType.symbol.flags & 32 /* Class */) && !(baseConstructorType.flags & 540672 /* TypeVariable */)) { // When the static base type is a "class-like" constructor function (but not actually a class), we verify // that all instantiated base constructor signatures return the same type. We can simply compare the type // references (as opposed to checking the structure of the types) because elsewhere we have already checked // that the base type is a class or interface type (and not, for example, an anonymous object type). - var constructors = getInstantiatedConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments); + var constructors = getInstantiatedConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); if (ts.forEach(constructors, function (sig) { return getReturnTypeOfSignature(sig) !== baseType_1; })) { error(baseTypeNode.expression, ts.Diagnostics.Base_constructors_must_all_have_the_same_return_type); } @@ -40400,8 +43916,7 @@ var ts; if (produceDiagnostics) { var t = getTypeFromTypeNode(typeRefNode); if (t !== unknownType) { - var declaredType = getObjectFlags(t) & 4 /* Reference */ ? t.target : t; - if (getObjectFlags(declaredType) & 3 /* ClassOrInterface */) { + if (isValidBaseType(t)) { checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(t, type.thisType), node.name || node, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); } else { @@ -40431,11 +43946,16 @@ var ts; function getTargetSymbol(s) { // if symbol is instantiated its flags are not copied from the 'target' // so we'll need to get back original 'target' symbol to work with correct set of flags - return s.flags & 16777216 /* Instantiated */ ? getSymbolLinks(s).target : s; + return getCheckFlags(s) & 1 /* Instantiated */ ? s.target : s; } function getClassLikeDeclarationOfSymbol(symbol) { return ts.forEach(symbol.declarations, function (d) { return ts.isClassLike(d) ? d : undefined; }); } + function getClassOrInterfaceDeclarationsOfSymbol(symbol) { + return ts.filter(symbol.declarations, function (d) { + return d.kind === 228 /* ClassDeclaration */ || d.kind === 229 /* InterfaceDeclaration */; + }); + } function checkKindsOfPropertyMemberOverrides(type, baseType) { // TypeScript 1.0 spec (April 2014): 8.2.3 // A derived class inherits all members from its base class it doesn't override. @@ -40451,11 +43971,11 @@ var ts; // Base class instance member variables and accessors can be overridden by // derived class instance member variables and accessors, but not by other kinds of members. // NOTE: assignability is checked in checkClassDeclaration - var baseProperties = getPropertiesOfObjectType(baseType); + var baseProperties = getPropertiesOfType(baseType); for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) { var baseProperty = baseProperties_1[_i]; var base = getTargetSymbol(baseProperty); - if (base.flags & 134217728 /* Prototype */) { + if (base.flags & 16777216 /* Prototype */) { continue; } var derived = getTargetSymbol(getPropertyOfObjectType(type, base.name)); @@ -40472,7 +43992,7 @@ var ts; // If there is no declaration for the derived class (as in the case of class expressions), // then the class cannot be declared abstract. if (baseDeclarationFlags & 128 /* Abstract */ && (!derivedClassDecl || !(ts.getModifierFlags(derivedClassDecl) & 128 /* Abstract */))) { - if (derivedClassDecl.kind === 197 /* ClassExpression */) { + if (derivedClassDecl.kind === 198 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -40483,7 +44003,7 @@ var ts; else { // derived overrides base. var derivedDeclarationFlags = getDeclarationModifierFlagsFromSymbol(derived); - if ((baseDeclarationFlags & 8 /* Private */) || (derivedDeclarationFlags & 8 /* Private */)) { + if (baseDeclarationFlags & 8 /* Private */ || derivedDeclarationFlags & 8 /* Private */) { // either base or derived property is private - not override, skip it continue; } @@ -40491,64 +44011,32 @@ var ts; // value of 'static' is not the same for properties - not override, skip it continue; } - if ((base.flags & derived.flags & 8192 /* Method */) || ((base.flags & 98308 /* PropertyOrAccessor */) && (derived.flags & 98308 /* PropertyOrAccessor */))) { + if (isMethodLike(base) && isMethodLike(derived) || base.flags & 98308 /* PropertyOrAccessor */ && derived.flags & 98308 /* PropertyOrAccessor */) { // method is overridden with method or property/accessor is overridden with property/accessor - correct case continue; } var errorMessage = void 0; - if (base.flags & 8192 /* Method */) { + if (isMethodLike(base)) { if (derived.flags & 98304 /* Accessor */) { errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; } else { - ts.Debug.assert((derived.flags & 4 /* Property */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; } } else if (base.flags & 4 /* Property */) { - ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; } else { - ts.Debug.assert((base.flags & 98304 /* Accessor */) !== 0); - ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; } - error(derived.valueDeclaration.name, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); + error(derived.valueDeclaration.name || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); } } } } function isAccessor(kind) { - return kind === 151 /* GetAccessor */ || kind === 152 /* SetAccessor */; - } - function areTypeParametersIdentical(list1, list2) { - if (!list1 && !list2) { - return true; - } - if (!list1 || !list2 || list1.length !== list2.length) { - return false; - } - // TypeScript 1.0 spec (April 2014): - // When a generic interface has multiple declarations, all declarations must have identical type parameter - // lists, i.e. identical type parameter names with identical constraints in identical order. - for (var i = 0, len = list1.length; i < len; i++) { - var tp1 = list1[i]; - var tp2 = list2[i]; - if (tp1.name.text !== tp2.name.text) { - return false; - } - if (!tp1.constraint && !tp2.constraint) { - continue; - } - if (!tp1.constraint || !tp2.constraint) { - return false; - } - if (!isTypeIdenticalTo(getTypeFromTypeNode(tp1.constraint), getTypeFromTypeNode(tp2.constraint))) { - return false; - } - } - return true; + return kind === 152 /* GetAccessor */ || kind === 153 /* SetAccessor */; } function checkInheritedPropertiesAreIdentical(type, typeNode) { var baseTypes = getBaseTypes(type); @@ -40556,16 +44044,16 @@ var ts; return true; } var seen = ts.createMap(); - ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; }); + ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen.set(p.name, { prop: p, containingType: type }); }); var ok = true; for (var _i = 0, baseTypes_2 = baseTypes; _i < baseTypes_2.length; _i++) { var base = baseTypes_2[_i]; - var properties = getPropertiesOfObjectType(getTypeWithThisArgument(base, type.thisType)); - for (var _a = 0, properties_6 = properties; _a < properties_6.length; _a++) { - var prop = properties_6[_a]; - var existing = seen[prop.name]; + var properties = getPropertiesOfType(getTypeWithThisArgument(base, type.thisType)); + for (var _a = 0, properties_8 = properties; _a < properties_8.length; _a++) { + var prop = properties_8[_a]; + var existing = seen.get(prop.name); if (!existing) { - seen[prop.name] = { prop: prop, containingType: base }; + seen.set(prop.name, { prop: prop, containingType: base }); } else { var isInheritedProperty = existing.containingType !== type; @@ -40573,7 +44061,7 @@ var ts; ok = false; var typeName1 = typeToString(existing.containingType); var typeName2 = typeToString(base); - var errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Named_property_0_of_types_1_and_2_are_not_identical, symbolToString(prop), typeName1, typeName2); + var errorInfo = ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Named_property_0_of_types_1_and_2_are_not_identical, symbolToString(prop), typeName1, typeName2); errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2); diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(typeNode, errorInfo)); } @@ -40590,9 +44078,9 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - checkTypeParameterListsIdentical(node, symbol); + checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 227 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 229 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -40699,7 +44187,7 @@ var ts; return value; function evalConstant(e) { switch (e.kind) { - case 190 /* PrefixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: var value_1 = evalConstant(e.operand); if (value_1 === undefined) { return undefined; @@ -40710,7 +44198,7 @@ var ts; case 51 /* TildeToken */: return ~value_1; } return undefined; - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -40734,12 +44222,13 @@ var ts; } return undefined; case 8 /* NumericLiteral */: + checkGrammarNumericLiteral(e); return +e.text; - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return evalConstant(e.expression); case 70 /* Identifier */: - case 178 /* ElementAccessExpression */: - case 177 /* PropertyAccessExpression */: + case 179 /* ElementAccessExpression */: + case 178 /* PropertyAccessExpression */: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); var enumType_1; @@ -40752,7 +44241,7 @@ var ts; } else { var expression = void 0; - if (e.kind === 178 /* ElementAccessExpression */) { + if (e.kind === 179 /* ElementAccessExpression */) { if (e.argumentExpression === undefined || e.argumentExpression.kind !== 9 /* StringLiteral */) { return undefined; @@ -40770,7 +44259,7 @@ var ts; if (current.kind === 70 /* Identifier */) { break; } - else if (current.kind === 177 /* PropertyAccessExpression */) { + else if (current.kind === 178 /* PropertyAccessExpression */) { current = current.expression; } else { @@ -40814,6 +44303,7 @@ var ts; checkGrammarDecorators(node) || checkGrammarModifiers(node); checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); @@ -40842,7 +44332,7 @@ var ts; var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 229 /* EnumDeclaration */) { + if (declaration.kind !== 231 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -40863,10 +44353,10 @@ var ts; } function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { - var declaration = declarations_5[_i]; - if ((declaration.kind === 226 /* ClassDeclaration */ || - (declaration.kind === 225 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { + var declaration = declarations_8[_i]; + if ((declaration.kind === 228 /* ClassDeclaration */ || + (declaration.kind === 227 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } @@ -40930,7 +44420,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 226 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 228 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -40943,7 +44433,7 @@ var ts; // We can detect if augmentation was applied using following rules: // - augmentation for a global scope is always applied // - augmentation for some external module is applied if symbol for augmentation is merged (it was combined with target module). - var checkBody = isGlobalAugmentation || (getSymbolOfNode(node).flags & 33554432 /* Merged */); + var checkBody = isGlobalAugmentation || (getSymbolOfNode(node).flags & 134217728 /* Transient */); if (checkBody && node.body) { // body of ambient external module is always a module block for (var _i = 0, _a = node.body.statements; _i < _a.length; _i++) { @@ -40981,39 +44471,39 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: // error each individual name in variable statement instead of marking the entire variable statement for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 240 /* ExportAssignment */: - case 241 /* ExportDeclaration */: + case 242 /* ExportAssignment */: + case 243 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 234 /* ImportEqualsDeclaration */: - case 235 /* ImportDeclaration */: + case 236 /* ImportEqualsDeclaration */: + case 237 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 174 /* BindingElement */: - case 223 /* VariableDeclaration */: - var name_25 = node.name; - if (ts.isBindingPattern(name_25)) { - for (var _b = 0, _c = name_25.elements; _b < _c.length; _b++) { + case 175 /* BindingElement */: + case 225 /* VariableDeclaration */: + var name = node.name; + if (ts.isBindingPattern(name)) { + for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { var el = _c[_b]; // mark individual names in binding pattern checkModuleAugmentationElement(el, isGlobalAugmentation); } break; } - // fallthrough - case 226 /* ClassDeclaration */: - case 229 /* EnumDeclaration */: - case 225 /* FunctionDeclaration */: - case 227 /* InterfaceDeclaration */: - case 230 /* ModuleDeclaration */: - case 228 /* TypeAliasDeclaration */: + // falls through + case 228 /* ClassDeclaration */: + case 231 /* EnumDeclaration */: + case 227 /* FunctionDeclaration */: + case 229 /* InterfaceDeclaration */: + case 232 /* ModuleDeclaration */: + case 230 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -41023,7 +44513,7 @@ var ts; // this is done it two steps // 1. quick check - if symbol for node is not merged - this is local symbol to this augmentation - report error // 2. main check - report error if value declaration of the parent symbol is module augmentation) - var reportError = !(symbol.flags & 33554432 /* Merged */); + var reportError = !(symbol.flags & 134217728 /* Transient */); if (!reportError) { // symbol should not originate in augmentation reportError = ts.isExternalModuleAugmentation(symbol.parent.declarations[0]); @@ -41036,12 +44526,12 @@ var ts; switch (node.kind) { case 70 /* Identifier */: return node; - case 141 /* QualifiedName */: + case 142 /* QualifiedName */: do { node = node.left; } while (node.kind !== 70 /* Identifier */); return node; - case 177 /* PropertyAccessExpression */: + case 178 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 70 /* Identifier */); @@ -41054,9 +44544,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 231 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 261 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 241 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 233 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 264 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 243 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -41089,7 +44579,7 @@ var ts; (symbol.flags & 793064 /* Type */ ? 793064 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 243 /* ExportSpecifier */ ? + var message = node.kind === 245 /* ExportSpecifier */ ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); @@ -41117,7 +44607,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 237 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 239 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -41174,8 +44664,10 @@ var ts; // export { x, y } // export { x, y } from "foo" ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 231 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 261 /* SourceFile */ && !inAmbientExternalModule) { + var inAmbientExternalModule = node.parent.kind === 233 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 233 /* ModuleBlock */ && + !node.moduleSpecifier && ts.isInAmbientContext(node); + if (node.parent.kind !== 264 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -41189,7 +44681,7 @@ var ts; } } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 261 /* SourceFile */ || node.parent.kind === 231 /* ModuleBlock */ || node.parent.kind === 230 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 264 /* SourceFile */ || node.parent.kind === 233 /* ModuleBlock */ || node.parent.kind === 232 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -41215,9 +44707,14 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 261 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 230 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { - error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); + var container = node.parent.kind === 264 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 232 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + if (node.isExportEquals) { + error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); + } + else { + error(node, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); + } return; } // Grammar checking @@ -41243,18 +44740,13 @@ var ts; } } function hasExportedMembers(moduleSymbol) { - for (var id in moduleSymbol.exports) { - if (id !== "export=") { - return true; - } - } - return false; + return ts.forEachEntry(moduleSymbol.exports, function (_, id) { return id !== "export="; }); } function checkExternalModuleExports(node) { var moduleSymbol = getSymbolOfNode(node); var links = getSymbolLinks(moduleSymbol); if (!links.exportsChecked) { - var exportEqualsSymbol = moduleSymbol.exports["export="]; + var exportEqualsSymbol = moduleSymbol.exports.get("export="); if (exportEqualsSymbol && hasExportedMembers(moduleSymbol)) { var declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; if (!isTopLevelInExternalModuleAugmentation(declaration)) { @@ -41263,35 +44755,35 @@ var ts; } // Checks for export * conflicts var exports = getExportsOfModule(moduleSymbol); - for (var id in exports) { + exports && exports.forEach(function (_a, id) { + var declarations = _a.declarations, flags = _a.flags; if (id === "__export") { - continue; + return; } - var _a = exports[id], declarations = _a.declarations, flags = _a.flags; // ECMA262: 15.2.1.1 It is a Syntax Error if the ExportedNames of ModuleItemList contains any duplicate entries. // (TS Exceptions: namespaces, function overloads, enums, and interfaces) if (flags & (1920 /* Namespace */ | 64 /* Interface */ | 384 /* Enum */)) { - continue; + return; } var exportedDeclarationsCount = ts.countWhere(declarations, isNotOverload); if (flags & 524288 /* TypeAlias */ && exportedDeclarationsCount <= 2) { // it is legal to merge type alias with other values // so count should be either 1 (just type alias) or 2 (type alias + merged value) - continue; + return; } if (exportedDeclarationsCount > 1) { - for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { - var declaration = declarations_6[_i]; + for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) { + var declaration = declarations_9[_i]; if (isNotOverload(declaration)) { diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Cannot_redeclare_exported_variable_0, id)); } } } - } + }); links.exportsChecked = true; } function isNotOverload(declaration) { - return (declaration.kind !== 225 /* FunctionDeclaration */ && declaration.kind !== 149 /* MethodDeclaration */) || + return (declaration.kind !== 227 /* FunctionDeclaration */ && declaration.kind !== 150 /* MethodDeclaration */) || !!declaration.body; } } @@ -41304,123 +44796,123 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 230 /* ModuleDeclaration */: - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 225 /* FunctionDeclaration */: + case 232 /* ModuleDeclaration */: + case 228 /* ClassDeclaration */: + case 229 /* InterfaceDeclaration */: + case 227 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } switch (kind) { - case 143 /* TypeParameter */: + case 144 /* TypeParameter */: return checkTypeParameter(node); - case 144 /* Parameter */: + case 145 /* Parameter */: return checkParameter(node); - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: return checkPropertyDeclaration(node); - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: return checkSignatureDeclaration(node); - case 155 /* IndexSignature */: + case 156 /* IndexSignature */: return checkSignatureDeclaration(node); - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: return checkMethodDeclaration(node); - case 150 /* Constructor */: + case 151 /* Constructor */: return checkConstructorDeclaration(node); - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: return checkAccessorDeclaration(node); - case 157 /* TypeReference */: + case 158 /* TypeReference */: return checkTypeReferenceNode(node); - case 156 /* TypePredicate */: + case 157 /* TypePredicate */: return checkTypePredicate(node); - case 160 /* TypeQuery */: + case 161 /* TypeQuery */: return checkTypeQuery(node); - case 161 /* TypeLiteral */: + case 162 /* TypeLiteral */: return checkTypeLiteral(node); - case 162 /* ArrayType */: + case 163 /* ArrayType */: return checkArrayType(node); - case 163 /* TupleType */: + case 164 /* TupleType */: return checkTupleType(node); - case 164 /* UnionType */: - case 165 /* IntersectionType */: + case 165 /* UnionType */: + case 166 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 166 /* ParenthesizedType */: - case 168 /* TypeOperator */: + case 167 /* ParenthesizedType */: + case 169 /* TypeOperator */: return checkSourceElement(node.type); - case 169 /* IndexedAccessType */: + case 170 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 170 /* MappedType */: + case 171 /* MappedType */: return checkMappedType(node); - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 204 /* Block */: - case 231 /* ModuleBlock */: + case 206 /* Block */: + case 233 /* ModuleBlock */: return checkBlock(node); - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: return checkVariableStatement(node); - case 207 /* ExpressionStatement */: + case 209 /* ExpressionStatement */: return checkExpressionStatement(node); - case 208 /* IfStatement */: + case 210 /* IfStatement */: return checkIfStatement(node); - case 209 /* DoStatement */: + case 211 /* DoStatement */: return checkDoStatement(node); - case 210 /* WhileStatement */: + case 212 /* WhileStatement */: return checkWhileStatement(node); - case 211 /* ForStatement */: + case 213 /* ForStatement */: return checkForStatement(node); - case 212 /* ForInStatement */: + case 214 /* ForInStatement */: return checkForInStatement(node); - case 213 /* ForOfStatement */: + case 215 /* ForOfStatement */: return checkForOfStatement(node); - case 214 /* ContinueStatement */: - case 215 /* BreakStatement */: + case 216 /* ContinueStatement */: + case 217 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 216 /* ReturnStatement */: + case 218 /* ReturnStatement */: return checkReturnStatement(node); - case 217 /* WithStatement */: + case 219 /* WithStatement */: return checkWithStatement(node); - case 218 /* SwitchStatement */: + case 220 /* SwitchStatement */: return checkSwitchStatement(node); - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: return checkLabeledStatement(node); - case 220 /* ThrowStatement */: + case 222 /* ThrowStatement */: return checkThrowStatement(node); - case 221 /* TryStatement */: + case 223 /* TryStatement */: return checkTryStatement(node); - case 223 /* VariableDeclaration */: + case 225 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 174 /* BindingElement */: + case 175 /* BindingElement */: return checkBindingElement(node); - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: return checkClassDeclaration(node); - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 228 /* TypeAliasDeclaration */: + case 230 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 235 /* ImportDeclaration */: + case 237 /* ImportDeclaration */: return checkImportDeclaration(node); - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: return checkExportDeclaration(node); - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: return checkExportAssignment(node); - case 206 /* EmptyStatement */: + case 208 /* EmptyStatement */: checkGrammarStatementInAmbientContext(node); return; - case 222 /* DebuggerStatement */: + case 224 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 244 /* MissingDeclaration */: + case 246 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -41442,17 +44934,17 @@ var ts; for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) { var node = deferredNodes_1[_i]; switch (node.kind) { - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - checkAccessorDeferred(node); + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + checkAccessorDeclaration(node); break; - case 197 /* ClassExpression */: + case 198 /* ClassExpression */: checkClassExpressionDeferred(node); break; } @@ -41477,6 +44969,7 @@ var ts; // Grammar checking checkGrammarSourceFile(node); potentialThisCollisions.length = 0; + potentialNewTargetCollisions.length = 0; deferredNodes = []; deferredUnusedIdentifierNodes = produceDiagnostics && noUnusedIdentifiers ? [] : undefined; ts.forEach(node.statements, checkSourceElement); @@ -41496,6 +44989,10 @@ var ts; ts.forEach(potentialThisCollisions, checkIfThisIsCapturedInEnclosingScope); potentialThisCollisions.length = 0; } + if (potentialNewTargetCollisions.length) { + ts.forEach(potentialNewTargetCollisions, checkIfNewTargetIsCapturedInEnclosingScope); + potentialNewTargetCollisions.length = 0; + } links.flags |= 1 /* TypeChecked */; } } @@ -41553,7 +45050,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 217 /* WithStatement */ && node.parent.statement === node) { + if (node.parent.kind === 219 /* WithStatement */ && node.parent.statement === node) { return true; } node = node.parent; @@ -41562,12 +45059,12 @@ var ts; return false; } function getSymbolsInScope(location, meaning) { - var symbols = ts.createMap(); - var memberFlags = 0 /* None */; if (isInsideWithStatementBody(location)) { // We cannot answer semantic questions within a with block, do not proceed any further return []; } + var symbols = ts.createMap(); + var memberFlags = 0 /* None */; populateSymbols(); return symbolsToArray(symbols); function populateSymbols() { @@ -41576,25 +45073,27 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 261 /* SourceFile */: + case 264 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 230 /* ModuleDeclaration */: + // falls through + case 232 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931 /* ModuleMember */); break; - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 197 /* ClassExpression */: + case 198 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); } - // fall through; this fall-through is necessary because we would like to handle + // falls through + // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: + case 228 /* ClassDeclaration */: + case 229 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -41603,7 +45102,7 @@ var ts; copySymbols(getSymbolOfNode(location).members, meaning & 793064 /* Type */); } break; - case 184 /* FunctionExpression */: + case 185 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -41631,17 +45130,16 @@ var ts; // We will copy all symbol regardless of its reserved name because // symbolsToArray will check whether the key is a reserved name and // it will not copy symbol with reserved name to the array - if (!symbols[id]) { - symbols[id] = symbol; + if (!symbols.has(id)) { + symbols.set(id, symbol); } } } function copySymbols(source, meaning) { if (meaning) { - for (var id in source) { - var symbol = source[id]; + source.forEach(function (symbol) { copySymbol(symbol, meaning); - } + }); } } } @@ -41652,28 +45150,28 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 143 /* TypeParameter */: - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 229 /* EnumDeclaration */: + case 144 /* TypeParameter */: + case 228 /* ClassDeclaration */: + case 229 /* InterfaceDeclaration */: + case 230 /* TypeAliasDeclaration */: + case 231 /* EnumDeclaration */: return true; } } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 141 /* QualifiedName */) { + while (node.parent && node.parent.kind === 142 /* QualifiedName */) { node = node.parent; } - return node.parent && (node.parent.kind === 157 /* TypeReference */ || node.parent.kind === 272 /* JSDocTypeReference */); + return node.parent && (node.parent.kind === 158 /* TypeReference */ || node.parent.kind === 276 /* JSDocTypeReference */); } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 177 /* PropertyAccessExpression */) { + while (node.parent && node.parent.kind === 178 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent && node.parent.kind === 199 /* ExpressionWithTypeArguments */; + return node.parent && node.parent.kind === 200 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -41690,13 +45188,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 141 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 142 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 234 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 236 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 240 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 242 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -41704,29 +45202,38 @@ var ts; function isInRightSideOfImportOrExportAssignment(node) { return getLeftSideOfImportEqualsOrExportAssignment(node) !== undefined; } + function getSpecialPropertyAssignmentSymbolFromEntityName(entityName) { + var specialPropertyAssignmentKind = ts.getSpecialPropertyAssignmentKind(entityName.parent.parent); + switch (specialPropertyAssignmentKind) { + case 1 /* ExportsProperty */: + case 3 /* PrototypeProperty */: + return getSymbolOfNode(entityName.parent); + case 4 /* ThisProperty */: + case 2 /* ModuleExports */: + case 5 /* Property */: + return getSymbolOfNode(entityName.parent.parent); + } + } function getSymbolOfEntityNameOrPropertyAccessExpression(entityName) { if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (ts.isInJavaScriptFile(entityName) && entityName.parent.kind === 177 /* PropertyAccessExpression */) { - var specialPropertyAssignmentKind = ts.getSpecialPropertyAssignmentKind(entityName.parent.parent); - switch (specialPropertyAssignmentKind) { - case 1 /* ExportsProperty */: - case 3 /* PrototypeProperty */: - return getSymbolOfNode(entityName.parent); - case 4 /* ThisProperty */: - case 2 /* ModuleExports */: - return getSymbolOfNode(entityName.parent.parent); - default: + if (ts.isInJavaScriptFile(entityName) && + entityName.parent.kind === 178 /* PropertyAccessExpression */ && + entityName.parent === entityName.parent.parent.left) { + // Check if this is a special property assignment + var specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(entityName); + if (specialPropertyAssignmentSymbol) { + return specialPropertyAssignmentSymbol; } } - if (entityName.parent.kind === 240 /* ExportAssignment */ && ts.isEntityNameExpression(entityName)) { + if (entityName.parent.kind === 242 /* ExportAssignment */ && ts.isEntityNameExpression(entityName)) { return resolveEntityName(entityName, /*all meanings*/ 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 8388608 /* Alias */); } - if (entityName.kind !== 177 /* PropertyAccessExpression */ && isInRightSideOfImportOrExportAssignment(entityName)) { + if (entityName.kind !== 178 /* PropertyAccessExpression */ && isInRightSideOfImportOrExportAssignment(entityName)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(entityName, 234 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(entityName, 236 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, /*dontResolveAlias*/ true); } @@ -41736,7 +45243,7 @@ var ts; if (isHeritageClauseElementIdentifier(entityName)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (entityName.parent.kind === 199 /* ExpressionWithTypeArguments */) { + if (entityName.parent.kind === 200 /* ExpressionWithTypeArguments */) { meaning = 793064 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { @@ -41747,9 +45254,12 @@ var ts; meaning = 1920 /* Namespace */; } meaning |= 8388608 /* Alias */; - return resolveEntityName(entityName, meaning); + var entityNameSymbol = resolveEntityName(entityName, meaning); + if (entityNameSymbol) { + return entityNameSymbol; + } } - else if (ts.isPartOfExpression(entityName)) { + if (ts.isPartOfExpression(entityName)) { if (ts.nodeIsMissing(entityName)) { // Missing entity name. return undefined; @@ -41760,14 +45270,14 @@ var ts; } return resolveEntityName(entityName, 107455 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (entityName.kind === 177 /* PropertyAccessExpression */) { + else if (entityName.kind === 178 /* PropertyAccessExpression */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); } return getNodeLinks(entityName).resolvedSymbol; } - else if (entityName.kind === 141 /* QualifiedName */) { + else if (entityName.kind === 142 /* QualifiedName */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkQualifiedName(entityName); @@ -41776,20 +45286,20 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = (entityName.parent.kind === 157 /* TypeReference */ || entityName.parent.kind === 272 /* JSDocTypeReference */) ? 793064 /* Type */ : 1920 /* Namespace */; + var meaning = (entityName.parent.kind === 158 /* TypeReference */ || entityName.parent.kind === 276 /* JSDocTypeReference */) ? 793064 /* Type */ : 1920 /* Namespace */; return resolveEntityName(entityName, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (entityName.parent.kind === 250 /* JsxAttribute */) { + else if (entityName.parent.kind === 252 /* JsxAttribute */) { return getJsxAttributePropertySymbol(entityName.parent); } - if (entityName.parent.kind === 156 /* TypePredicate */) { + if (entityName.parent.kind === 157 /* TypePredicate */) { return resolveEntityName(entityName, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node) { - if (node.kind === 261 /* SourceFile */) { + if (node.kind === 264 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } if (isInsideWithStatementBody(node)) { @@ -41807,8 +45317,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfEntityNameOrPropertyAccessExpression(node); } - else if (node.parent.kind === 174 /* BindingElement */ && - node.parent.parent.kind === 172 /* ObjectBindingPattern */ && + else if (node.parent.kind === 175 /* BindingElement */ && + node.parent.parent.kind === 173 /* ObjectBindingPattern */ && node === node.parent.propertyName) { var typeOfPattern = getTypeOfNode(node.parent.parent); var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.text); @@ -41819,8 +45329,8 @@ var ts; } switch (node.kind) { case 70 /* Identifier */: - case 177 /* PropertyAccessExpression */: - case 141 /* QualifiedName */: + case 178 /* PropertyAccessExpression */: + case 142 /* QualifiedName */: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 98 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); @@ -41830,16 +45340,16 @@ var ts; return sig.thisParameter; } } - // fallthrough + // falls through case 96 /* SuperKeyword */: var type = ts.isPartOfExpression(node) ? getTypeOfExpression(node) : getTypeFromTypeNode(node); return type.symbol; - case 167 /* ThisType */: + case 168 /* ThisType */: return getTypeFromTypeNode(node).symbol; case 122 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 150 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 151 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -41847,17 +45357,17 @@ var ts; // External module name in an import declaration if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 235 /* ImportDeclaration */ || node.parent.kind === 241 /* ExportDeclaration */) && + ((node.parent.kind === 237 /* ImportDeclaration */ || node.parent.kind === 243 /* ExportDeclaration */) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } if (ts.isInJavaScriptFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false)) { return resolveExternalModuleName(node, node); } - // Fall through + // falls through case 8 /* NumericLiteral */: // index access - if (node.parent.kind === 178 /* ElementAccessExpression */ && node.parent.argumentExpression === node) { + if (node.parent.kind === 179 /* ElementAccessExpression */ && node.parent.argumentExpression === node) { var objectType = getTypeOfExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -41874,7 +45384,7 @@ var ts; // The function returns a value symbol of an identifier in the short-hand property assignment. // This is necessary as an identifier in short-hand property assignment can contains two meaning: // property name and property value. - if (location && location.kind === 258 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 261 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 107455 /* Value */ | 8388608 /* Alias */); } return undefined; @@ -41891,7 +45401,13 @@ var ts; return unknownType; } if (ts.isPartOfTypeNode(node)) { - return getTypeFromTypeNode(node); + var typeFromTypeNode = getTypeFromTypeNode(node); + if (typeFromTypeNode && ts.isExpressionWithTypeArgumentsInClassImplementsClause(node)) { + var containingClass = ts.getContainingClass(node); + var classType = getTypeOfNode(containingClass); + typeFromTypeNode = getTypeWithThisArgument(typeFromTypeNode, classType.thisType); + } + return typeFromTypeNode; } if (ts.isPartOfExpression(node)) { return getRegularTypeOfExpression(node); @@ -41899,7 +45415,10 @@ var ts; if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(node)) { // A SyntaxKind.ExpressionWithTypeArguments is considered a type node, except when it occurs in the // extends clause of a class. We handle that case here. - return getBaseTypes(getDeclaredTypeOfSymbol(getSymbolOfNode(node.parent.parent)))[0]; + var classNode = ts.getContainingClass(node); + var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(classNode)); + var baseType = getBaseTypes(classType)[0]; + return baseType && getTypeWithThisArgument(baseType, classType.thisType); } if (isTypeDeclaration(node)) { // In this case, we call getSymbolOfNode instead of getSymbolAtLocation because it is a declaration @@ -41936,31 +45455,31 @@ var ts; // [ a ] from // [a] = [ some array ...] function getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr) { - ts.Debug.assert(expr.kind === 176 /* ObjectLiteralExpression */ || expr.kind === 175 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.kind === 177 /* ObjectLiteralExpression */ || expr.kind === 176 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 213 /* ForOfStatement */) { - var iteratedType = checkRightHandSideOfForOf(expr.parent.expression); + if (expr.parent.kind === 215 /* ForOfStatement */) { + var iteratedType = checkRightHandSideOfForOf(expr.parent.expression, expr.parent.awaitModifier); return checkDestructuringAssignment(expr, iteratedType || unknownType); } // If this is from "for" initializer // for ({a } = elems[0];.....) { } - if (expr.parent.kind === 192 /* BinaryExpression */) { + if (expr.parent.kind === 193 /* BinaryExpression */) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || unknownType); } // If this is from nested object binding pattern // for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { - if (expr.parent.kind === 257 /* PropertyAssignment */) { + if (expr.parent.kind === 260 /* PropertyAssignment */) { var typeOfParentObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent.parent); return checkObjectLiteralDestructuringPropertyAssignment(typeOfParentObjectLiteral || unknownType, expr.parent); } // Array literal assignment - array destructuring pattern - ts.Debug.assert(expr.parent.kind === 175 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.parent.kind === 176 /* ArrayLiteralExpression */); // [{ property1: p1, property2 }] = elems; var typeOfArrayLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent); - var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, /*allowStringInput*/ false) || unknownType; + var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, /*allowStringInput*/ false, /*allowAsyncIterable*/ false) || unknownType; return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, ts.indexOf(expr.parent.elements, expr), elementType || unknownType); } // Gets the property symbol corresponding to the property in destructuring assignment @@ -41981,9 +45500,9 @@ var ts; return getRegularTypeOfLiteralType(getTypeOfExpression(expr)); } /** - * Gets either the static or instance type of a class element, based on - * whether the element is declared as "static". - */ + * Gets either the static or instance type of a class element, based on + * whether the element is declared as "static". + */ function getParentTypeOfClassElement(node) { var classSymbol = getSymbolOfNode(node.parent); return ts.getModifierFlags(node) & 32 /* Static */ @@ -41997,29 +45516,32 @@ var ts; var propsByName = createSymbolTable(getPropertiesOfType(type)); if (getSignaturesOfType(type, 0 /* Call */).length || getSignaturesOfType(type, 1 /* Construct */).length) { ts.forEach(getPropertiesOfType(globalFunctionType), function (p) { - if (!propsByName[p.name]) { - propsByName[p.name] = p; + if (!propsByName.has(p.name)) { + propsByName.set(p.name, p); } }); } return getNamedMembers(propsByName); } function getRootSymbols(symbol) { - if (symbol.flags & 268435456 /* SyntheticProperty */) { + if (getCheckFlags(symbol) & 6 /* Synthetic */) { var symbols_3 = []; - var name_26 = symbol.name; + var name_2 = symbol.name; ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) { - var symbol = getPropertyOfType(t, name_26); + var symbol = getPropertyOfType(t, name_2); if (symbol) { symbols_3.push(symbol); } }); return symbols_3; } - else if (symbol.flags & 67108864 /* Transient */) { + else if (symbol.flags & 134217728 /* Transient */) { if (symbol.leftSpread) { var links = symbol; - return [links.leftSpread, links.rightSpread]; + return getRootSymbols(links.leftSpread).concat(getRootSymbols(links.rightSpread)); + } + if (symbol.syntheticOrigin) { + return getRootSymbols(symbol.syntheticOrigin); } var target = void 0; var next = symbol; @@ -42037,7 +45559,8 @@ var ts; if (!ts.isGeneratedIdentifier(node)) { node = ts.getParseTreeNode(node, ts.isIdentifier); if (node) { - return getReferencedValueSymbol(node) === argumentsSymbol; + var isPropertyName_1 = node.parent.kind === 178 /* PropertyAccessExpression */ && node.parent.name === node; + return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } return false; @@ -42058,7 +45581,7 @@ var ts; // otherwise - check if at least one export is value symbolLinks.exportsSomeValue = hasExportAssignment ? !!(moduleSymbol.flags & 107455 /* Value */) - : ts.forEachProperty(getExportsOfModule(moduleSymbol), isValue); + : ts.forEachEntry(getExportsOfModule(moduleSymbol), isValue); } return symbolLinks.exportsSomeValue; function isValue(s) { @@ -42091,20 +45614,16 @@ var ts; } symbol = exportSymbol; } - var parentSymbol = getParentOfSymbol(symbol); - if (parentSymbol) { - if (parentSymbol.flags & 512 /* ValueModule */ && parentSymbol.valueDeclaration.kind === 261 /* SourceFile */) { - var symbolFile = parentSymbol.valueDeclaration; + var parentSymbol_1 = getParentOfSymbol(symbol); + if (parentSymbol_1) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 264 /* SourceFile */) { + var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined. var symbolIsUmdExport = symbolFile !== referenceFile; return symbolIsUmdExport ? undefined : symbolFile; } - for (var n = node.parent; n; n = n.parent) { - if (ts.isModuleOrEnumDeclaration(n) && getSymbolOfNode(n) === parentSymbol) { - return n; - } - } + return ts.findAncestor(node.parent, function (n) { return ts.isModuleOrEnumDeclaration(n) && getSymbolOfNode(n) === parentSymbol_1; }); } } } @@ -42150,7 +45669,7 @@ var ts; // they will not collide with anything var isDeclaredInLoop = nodeLinks_1.flags & 262144 /* BlockScopedBindingInLoop */; var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false); - var inLoopBodyBlock = container.kind === 204 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 206 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -42190,22 +45709,17 @@ var ts; return false; } function isValueAliasDeclaration(node) { - node = ts.getParseTreeNode(node); - if (node === undefined) { - // A synthesized node comes from an emit transformation and is always a value. - return true; - } switch (node.kind) { - case 234 /* ImportEqualsDeclaration */: - case 236 /* ImportClause */: - case 237 /* NamespaceImport */: - case 239 /* ImportSpecifier */: - case 243 /* ExportSpecifier */: + case 236 /* ImportEqualsDeclaration */: + case 238 /* ImportClause */: + case 239 /* NamespaceImport */: + case 241 /* ImportSpecifier */: + case 245 /* ExportSpecifier */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: return node.expression && node.expression.kind === 70 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) @@ -42215,7 +45729,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(node) { node = ts.getParseTreeNode(node, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 261 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 264 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -42236,11 +45750,6 @@ var ts; return isConstEnumSymbol(s) || s.constEnumOnlyModule; } function isReferencedAliasDeclaration(node, checkChildren) { - node = ts.getParseTreeNode(node); - // Purely synthesized nodes are always emitted. - if (node === undefined) { - return true; - } if (ts.isAliasSymbolDeclaration(node)) { var symbol = getSymbolOfNode(node); if (symbol && getSymbolLinks(symbol).referenced) { @@ -42272,16 +45781,30 @@ var ts; } return false; } + function isRequiredInitializedParameter(parameter) { + return strictNullChecks && + !isOptionalParameter(parameter) && + parameter.initializer && + !(ts.getModifierFlags(parameter) & 92 /* ParameterPropertyModifier */); + } function getNodeCheckFlags(node) { - node = ts.getParseTreeNode(node); - return node ? getNodeLinks(node).flags : undefined; + return getNodeLinks(node).flags; } function getEnumMemberValue(node) { computeEnumMemberValues(node.parent); return getNodeLinks(node).enumMemberValue; } + function canHaveConstantValue(node) { + switch (node.kind) { + case 263 /* EnumMember */: + case 178 /* PropertyAccessExpression */: + case 179 /* ElementAccessExpression */: + return true; + } + return false; + } function getConstantValue(node) { - if (node.kind === 260 /* EnumMember */) { + if (node.kind === 263 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -42299,16 +45822,18 @@ var ts; function getTypeReferenceSerializationKind(typeName, location) { // Resolve the symbol as a value to ensure the type can be reached at runtime during emit. var valueSymbol = resolveEntityName(typeName, 107455 /* Value */, /*ignoreErrors*/ true, /*dontResolveAlias*/ false, location); - var globalPromiseSymbol = tryGetGlobalPromiseConstructorSymbol(); - if (globalPromiseSymbol && valueSymbol === globalPromiseSymbol) { - return ts.TypeReferenceSerializationKind.Promise; - } - var constructorType = valueSymbol ? getTypeOfSymbol(valueSymbol) : undefined; - if (constructorType && isConstructorType(constructorType)) { - return ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue; - } // Resolve the symbol as a type so that we can provide a more useful hint for the type serializer. var typeSymbol = resolveEntityName(typeName, 793064 /* Type */, /*ignoreErrors*/ true, /*dontResolveAlias*/ false, location); + if (valueSymbol && valueSymbol === typeSymbol) { + var globalPromiseSymbol = getGlobalPromiseConstructorSymbol(/*reportErrors*/ false); + if (globalPromiseSymbol && valueSymbol === globalPromiseSymbol) { + return ts.TypeReferenceSerializationKind.Promise; + } + var constructorType = getTypeOfSymbol(valueSymbol); + if (constructorType && isConstructorType(constructorType)) { + return ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue; + } + } // We might not be able to resolve type symbol so use unknown type in that case (eg error case) if (!typeSymbol) { return ts.TypeReferenceSerializationKind.ObjectType; @@ -42354,6 +45879,9 @@ var ts; var type = symbol && !(symbol.flags & (2048 /* TypeLiteral */ | 131072 /* Signature */)) ? getWidenedLiteralType(getTypeOfSymbol(symbol)) : unknownType; + if (flags & 4096 /* AddUndefined */) { + type = includeFalsyTypes(type, 2048 /* Undefined */); + } getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { @@ -42368,10 +45896,13 @@ var ts; var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(node)); resolveBaseTypesOfClass(classType); var baseType = classType.resolvedBaseTypes.length ? classType.resolvedBaseTypes[0] : unknownType; + if (!baseType.symbol) { + writer.reportIllegalExtends(); + } getSymbolDisplayBuilder().buildTypeDisplay(baseType, writer, enclosingDeclaration, flags); } function hasGlobalName(name) { - return !!globals[name]; + return globals.has(name); } function getReferencedValueSymbol(reference, startInDeclarationContainer) { var resolvedSymbol = getNodeLinks(reference).resolvedSymbol; @@ -42382,9 +45913,9 @@ var ts; if (startInDeclarationContainer) { // When resolving the name of a declaration as a value, we need to start resolution // at a point outside of the declaration. - var parent_11 = reference.parent; - if (ts.isDeclaration(parent_11) && reference === parent_11.name) { - location = getDeclarationContainer(parent_11); + var parent = reference.parent; + if (ts.isDeclaration(parent) && reference === parent.name) { + location = getDeclarationContainer(parent); } } return resolveName(location, reference.text, 107455 /* Value */ | 1048576 /* ExportValue */ | 8388608 /* Alias */, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined); @@ -42420,34 +45951,48 @@ var ts; if (resolvedTypeReferenceDirectives) { // populate reverse mapping: file path -> type reference directive that was resolved to this file fileToDirective = ts.createFileMap(); - for (var key in resolvedTypeReferenceDirectives) { - var resolvedDirective = resolvedTypeReferenceDirectives[key]; + resolvedTypeReferenceDirectives.forEach(function (resolvedDirective, key) { if (!resolvedDirective) { - continue; + return; } var file = host.getSourceFile(resolvedDirective.resolvedFileName); fileToDirective.set(file.path, key); - } + }); } return { getReferencedExportContainer: getReferencedExportContainer, getReferencedImportDeclaration: getReferencedImportDeclaration, getReferencedDeclarationWithCollidingName: getReferencedDeclarationWithCollidingName, isDeclarationWithCollidingName: isDeclarationWithCollidingName, - isValueAliasDeclaration: isValueAliasDeclaration, + isValueAliasDeclaration: function (node) { + node = ts.getParseTreeNode(node); + // Synthesized nodes are always treated like values. + return node ? isValueAliasDeclaration(node) : true; + }, hasGlobalName: hasGlobalName, - isReferencedAliasDeclaration: isReferencedAliasDeclaration, - getNodeCheckFlags: getNodeCheckFlags, + isReferencedAliasDeclaration: function (node, checkChildren) { + node = ts.getParseTreeNode(node); + // Synthesized nodes are always treated as referenced. + return node ? isReferencedAliasDeclaration(node, checkChildren) : true; + }, + getNodeCheckFlags: function (node) { + node = ts.getParseTreeNode(node); + return node ? getNodeCheckFlags(node) : undefined; + }, isTopLevelValueImportEqualsWithEntityName: isTopLevelValueImportEqualsWithEntityName, isDeclarationVisible: isDeclarationVisible, isImplementationOfOverload: isImplementationOfOverload, + isRequiredInitializedParameter: isRequiredInitializedParameter, writeTypeOfDeclaration: writeTypeOfDeclaration, writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration, writeTypeOfExpression: writeTypeOfExpression, writeBaseConstructorTypeOfClass: writeBaseConstructorTypeOfClass, isSymbolAccessible: isSymbolAccessible, isEntityNameVisible: isEntityNameVisible, - getConstantValue: getConstantValue, + getConstantValue: function (node) { + node = ts.getParseTreeNode(node, canHaveConstantValue); + return node ? getConstantValue(node) : undefined; + }, collectLinkedAliases: collectLinkedAliases, getReferencedValueDeclaration: getReferencedValueDeclaration, getTypeReferenceSerializationKind: getTypeReferenceSerializationKind, @@ -42470,7 +46015,7 @@ var ts; // property access can only be used as values // qualified names can only be used as types\namespaces // identifiers are treated as values only if they appear in type queries - var meaning = (node.kind === 177 /* PropertyAccessExpression */) || (node.kind === 70 /* Identifier */ && isInTypeQuery(node)) + var meaning = (node.kind === 178 /* PropertyAccessExpression */) || (node.kind === 70 /* Identifier */ && isInTypeQuery(node)) ? 107455 /* Value */ | 1048576 /* ExportValue */ : 793064 /* Type */ | 1920 /* Namespace */; var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); @@ -42513,15 +46058,15 @@ var ts; // external modules cannot define or contribute to type declaration files var current = symbol; while (true) { - var parent_12 = getParentOfSymbol(current); - if (parent_12) { - current = parent_12; + var parent = getParentOfSymbol(current); + if (parent) { + current = parent; } else { break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 261 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 264 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -42541,7 +46086,7 @@ var ts; if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 261 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 264 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -42551,8 +46096,6 @@ var ts; } // Initialize global symbol table var augmentations; - var requestedExternalEmitHelpers = 0; - var firstFileRequestingExternalHelpers; for (var _b = 0, _c = host.getSourceFiles(); _b < _c.length; _b++) { var file = _c[_b]; if (!ts.isExternalOrCommonJsModule(file)) { @@ -42567,20 +46110,11 @@ var ts; if (file.symbol && file.symbol.globalExports) { // Merge in UMD exports with first-in-wins semantics (see #9771) var source = file.symbol.globalExports; - for (var id in source) { - if (!(id in globals)) { - globals[id] = source[id]; + source.forEach(function (sourceSymbol, id) { + if (!globals.has(id)) { + globals.set(id, sourceSymbol); } - } - } - if ((compilerOptions.isolatedModules || ts.isExternalModule(file)) && !file.isDeclarationFile) { - var fileRequestedExternalEmitHelpers = file.flags & 64512 /* EmitHelperFlags */; - if (fileRequestedExternalEmitHelpers) { - requestedExternalEmitHelpers |= fileRequestedExternalEmitHelpers; - if (firstFileRequestingExternalHelpers === undefined) { - firstFileRequestingExternalHelpers = file; - } - } + }); } } if (augmentations) { @@ -42597,110 +46131,67 @@ var ts; // Setup global builtins addToSymbolTable(globals, builtinGlobals, ts.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0); getSymbolLinks(undefinedSymbol).type = undefinedWideningType; - getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments"); + getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments", /*arity*/ 0, /*reportErrors*/ true); getSymbolLinks(unknownSymbol).type = unknownType; // Initialize special types - globalArrayType = getGlobalType("Array", /*arity*/ 1); - globalObjectType = getGlobalType("Object"); - globalFunctionType = getGlobalType("Function"); - globalStringType = getGlobalType("String"); - globalNumberType = getGlobalType("Number"); - globalBooleanType = getGlobalType("Boolean"); - globalRegExpType = getGlobalType("RegExp"); - jsxElementType = getExportedTypeFromNamespace("JSX", JsxNames.Element); - getGlobalClassDecoratorType = ts.memoize(function () { return getGlobalType("ClassDecorator"); }); - getGlobalPropertyDecoratorType = ts.memoize(function () { return getGlobalType("PropertyDecorator"); }); - getGlobalMethodDecoratorType = ts.memoize(function () { return getGlobalType("MethodDecorator"); }); - getGlobalParameterDecoratorType = ts.memoize(function () { return getGlobalType("ParameterDecorator"); }); - getGlobalTypedPropertyDescriptorType = ts.memoize(function () { return getGlobalType("TypedPropertyDescriptor", /*arity*/ 1); }); - getGlobalESSymbolConstructorSymbol = ts.memoize(function () { return getGlobalValueSymbol("Symbol"); }); - getGlobalPromiseType = ts.memoize(function () { return getGlobalType("Promise", /*arity*/ 1); }); - tryGetGlobalPromiseType = ts.memoize(function () { return getGlobalSymbol("Promise", 793064 /* Type */, /*diagnostic*/ undefined) && getGlobalPromiseType(); }); - getGlobalPromiseLikeType = ts.memoize(function () { return getGlobalType("PromiseLike", /*arity*/ 1); }); - getInstantiatedGlobalPromiseLikeType = ts.memoize(createInstantiatedPromiseLikeType); - getGlobalPromiseConstructorSymbol = ts.memoize(function () { return getGlobalValueSymbol("Promise"); }); - tryGetGlobalPromiseConstructorSymbol = ts.memoize(function () { return getGlobalSymbol("Promise", 107455 /* Value */, /*diagnostic*/ undefined) && getGlobalPromiseConstructorSymbol(); }); - getGlobalPromiseConstructorLikeType = ts.memoize(function () { return getGlobalType("PromiseConstructorLike"); }); - getGlobalThenableType = ts.memoize(createThenableType); - getGlobalTemplateStringsArrayType = ts.memoize(function () { return getGlobalType("TemplateStringsArray"); }); - if (languageVersion >= 2 /* ES2015 */) { - getGlobalESSymbolType = ts.memoize(function () { return getGlobalType("Symbol"); }); - getGlobalIterableType = ts.memoize(function () { return getGlobalType("Iterable", /*arity*/ 1); }); - getGlobalIteratorType = ts.memoize(function () { return getGlobalType("Iterator", /*arity*/ 1); }); - getGlobalIterableIteratorType = ts.memoize(function () { return getGlobalType("IterableIterator", /*arity*/ 1); }); - } - else { - getGlobalESSymbolType = ts.memoize(function () { return emptyObjectType; }); - getGlobalIterableType = ts.memoize(function () { return emptyGenericType; }); - getGlobalIteratorType = ts.memoize(function () { return emptyGenericType; }); - getGlobalIterableIteratorType = ts.memoize(function () { return emptyGenericType; }); - } + globalArrayType = getGlobalType("Array", /*arity*/ 1, /*reportErrors*/ true); + globalObjectType = getGlobalType("Object", /*arity*/ 0, /*reportErrors*/ true); + globalFunctionType = getGlobalType("Function", /*arity*/ 0, /*reportErrors*/ true); + globalStringType = getGlobalType("String", /*arity*/ 0, /*reportErrors*/ true); + globalNumberType = getGlobalType("Number", /*arity*/ 0, /*reportErrors*/ true); + globalBooleanType = getGlobalType("Boolean", /*arity*/ 0, /*reportErrors*/ true); + globalRegExpType = getGlobalType("RegExp", /*arity*/ 0, /*reportErrors*/ true); anyArrayType = createArrayType(anyType); autoArrayType = createArrayType(autoType); - var symbol = getGlobalSymbol("ReadonlyArray", 793064 /* Type */, /*diagnostic*/ undefined); - globalReadonlyArrayType = symbol && getTypeOfGlobalSymbol(symbol, /*arity*/ 1); + globalReadonlyArrayType = getGlobalTypeOrUndefined("ReadonlyArray", /*arity*/ 1); anyReadonlyArrayType = globalReadonlyArrayType ? createTypeFromGenericGlobalType(globalReadonlyArrayType, [anyType]) : anyArrayType; - // If we have specified that we are importing helpers, we should report global - // errors if we cannot resolve the helpers external module, or if it does not have - // the necessary helpers exported. - if (compilerOptions.importHelpers && firstFileRequestingExternalHelpers) { - // Find the first reference to the helpers module. - var helpersModule = resolveExternalModule(firstFileRequestingExternalHelpers, ts.externalHelpersModuleNameText, ts.Diagnostics.Cannot_find_module_0, - /*errorNode*/ undefined); - // If we found the module, report errors if it does not have the necessary exports. - if (helpersModule) { - var exports = helpersModule.exports; - if (requestedExternalEmitHelpers & 1024 /* HasClassExtends */ && languageVersion < 2 /* ES2015 */) { - verifyHelperSymbol(exports, "__extends", 107455 /* Value */); - } - if (requestedExternalEmitHelpers & 16384 /* HasSpreadAttribute */ && - (languageVersion < 5 /* ESNext */ || compilerOptions.jsx === 2 /* React */)) { - verifyHelperSymbol(exports, "__assign", 107455 /* Value */); - } - if (languageVersion < 5 /* ESNext */ && requestedExternalEmitHelpers & 32768 /* HasRestAttribute */) { - verifyHelperSymbol(exports, "__rest", 107455 /* Value */); - } - if (requestedExternalEmitHelpers & 2048 /* HasDecorators */) { - verifyHelperSymbol(exports, "__decorate", 107455 /* Value */); - if (compilerOptions.emitDecoratorMetadata) { - verifyHelperSymbol(exports, "__metadata", 107455 /* Value */); - } - } - if (requestedExternalEmitHelpers & 4096 /* HasParamDecorators */) { - verifyHelperSymbol(exports, "__param", 107455 /* Value */); - } - if (requestedExternalEmitHelpers & 8192 /* HasAsyncFunctions */) { - verifyHelperSymbol(exports, "__awaiter", 107455 /* Value */); - if (languageVersion < 2 /* ES2015 */) { - verifyHelperSymbol(exports, "__generator", 107455 /* Value */); + globalThisType = getGlobalTypeOrUndefined("ThisType", /*arity*/ 1); + } + function checkExternalEmitHelpers(location, helpers) { + if ((requestedExternalEmitHelpers & helpers) !== helpers && compilerOptions.importHelpers) { + var sourceFile = ts.getSourceFileOfNode(location); + if (ts.isEffectiveExternalModule(sourceFile, compilerOptions) && !ts.isInAmbientContext(location)) { + var helpersModule = resolveHelpersModule(sourceFile, location); + if (helpersModule !== unknownSymbol) { + var uncheckedHelpers = helpers & ~requestedExternalEmitHelpers; + for (var helper = 1 /* FirstEmitHelper */; helper <= 8192 /* LastEmitHelper */; helper <<= 1) { + if (uncheckedHelpers & helper) { + var name = getHelperName(helper); + var symbol = getSymbol(helpersModule.exports, ts.escapeIdentifier(name), 107455 /* Value */); + if (!symbol) { + error(location, ts.Diagnostics.This_syntax_requires_an_imported_helper_named_1_but_module_0_has_no_exported_member_1, ts.externalHelpersModuleNameText, name); + } + } } } + requestedExternalEmitHelpers |= helpers; } } } - function verifyHelperSymbol(symbols, name, meaning) { - var symbol = getSymbol(symbols, ts.escapeIdentifier(name), meaning); - if (!symbol) { - error(/*location*/ undefined, ts.Diagnostics.Module_0_has_no_exported_member_1, ts.externalHelpersModuleNameText, name); + function getHelperName(helper) { + switch (helper) { + case 1 /* Extends */: return "__extends"; + case 2 /* Assign */: return "__assign"; + case 4 /* Rest */: return "__rest"; + case 8 /* Decorate */: return "__decorate"; + case 16 /* Metadata */: return "__metadata"; + case 32 /* Param */: return "__param"; + case 64 /* Awaiter */: return "__awaiter"; + case 128 /* Generator */: return "__generator"; + case 256 /* Values */: return "__values"; + case 512 /* Read */: return "__read"; + case 1024 /* Spread */: return "__spread"; + case 2048 /* AsyncGenerator */: return "__asyncGenerator"; + case 4096 /* AsyncDelegator */: return "__asyncDelegator"; + case 8192 /* AsyncValues */: return "__asyncValues"; + default: ts.Debug.fail("Unrecognized helper."); } } - function createInstantiatedPromiseLikeType() { - var promiseLikeType = getGlobalPromiseLikeType(); - if (promiseLikeType !== emptyGenericType) { - return createTypeReference(promiseLikeType, [anyType]); + function resolveHelpersModule(node, errorNode) { + if (!externalHelpersModule) { + externalHelpersModule = resolveExternalModule(node, ts.externalHelpersModuleNameText, ts.Diagnostics.This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found, errorNode) || unknownSymbol; } - return emptyObjectType; - } - function createThenableType() { - // build the thenable type that is used to verify against a non-promise "thenable" operand to `await`. - var thenPropertySymbol = createSymbol(67108864 /* Transient */ | 4 /* Property */, "then"); - getSymbolLinks(thenPropertySymbol).type = globalFunctionType; - var thenableType = createObjectType(16 /* Anonymous */); - thenableType.properties = [thenPropertySymbol]; - thenableType.members = createSymbolTable(thenableType.properties); - thenableType.callSignatures = []; - thenableType.constructSignatures = []; - return thenableType; + return externalHelpersModule; } // GRAMMAR CHECKING function checkGrammarDecorators(node) { @@ -42708,14 +46199,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node)) { - if (node.kind === 149 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 150 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 151 /* GetAccessor */ || node.kind === 152 /* SetAccessor */) { + else if (node.kind === 152 /* GetAccessor */ || node.kind === 153 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -42733,16 +46224,16 @@ var ts; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; if (modifier.kind !== 130 /* ReadonlyKeyword */) { - if (node.kind === 146 /* PropertySignature */ || node.kind === 148 /* MethodSignature */) { + if (node.kind === 147 /* PropertySignature */ || node.kind === 149 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 155 /* IndexSignature */) { + if (node.kind === 156 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 75 /* ConstKeyword */: - if (node.kind !== 229 /* EnumDeclaration */ && node.parent.kind === 226 /* ClassDeclaration */) { + if (node.kind !== 231 /* EnumDeclaration */ && node.parent.kind === 228 /* ClassDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(75 /* ConstKeyword */)); } break; @@ -42768,7 +46259,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 231 /* ModuleBlock */ || node.parent.kind === 261 /* SourceFile */) { + else if (node.parent.kind === 233 /* ModuleBlock */ || node.parent.kind === 264 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { @@ -42791,10 +46282,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 231 /* ModuleBlock */ || node.parent.kind === 261 /* SourceFile */) { + else if (node.parent.kind === 233 /* ModuleBlock */ || node.parent.kind === 264 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 144 /* Parameter */) { + else if (node.kind === 145 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -42807,7 +46298,7 @@ var ts; if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 147 /* PropertyDeclaration */ && node.kind !== 146 /* PropertySignature */ && node.kind !== 155 /* IndexSignature */ && node.kind !== 144 /* Parameter */) { + else if (node.kind !== 148 /* PropertyDeclaration */ && node.kind !== 147 /* PropertySignature */ && node.kind !== 156 /* IndexSignature */ && node.kind !== 145 /* Parameter */) { // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property. return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } @@ -42827,10 +46318,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } - else if (node.parent.kind === 226 /* ClassDeclaration */) { + else if (node.parent.kind === 228 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 144 /* Parameter */) { + else if (node.kind === 145 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; @@ -42842,13 +46333,13 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.parent.kind === 226 /* ClassDeclaration */) { + else if (node.parent.kind === 228 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 144 /* Parameter */) { + else if (node.kind === 145 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 231 /* ModuleBlock */) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 233 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 2 /* Ambient */; @@ -42858,14 +46349,14 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 226 /* ClassDeclaration */) { - if (node.kind !== 149 /* MethodDeclaration */ && - node.kind !== 147 /* PropertyDeclaration */ && - node.kind !== 151 /* GetAccessor */ && - node.kind !== 152 /* SetAccessor */) { + if (node.kind !== 228 /* ClassDeclaration */) { + if (node.kind !== 150 /* MethodDeclaration */ && + node.kind !== 148 /* PropertyDeclaration */ && + node.kind !== 152 /* GetAccessor */ && + node.kind !== 153 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 226 /* ClassDeclaration */ && ts.getModifierFlags(node.parent) & 128 /* Abstract */)) { + if (!(node.parent.kind === 228 /* ClassDeclaration */ && ts.getModifierFlags(node.parent) & 128 /* Abstract */)) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -42884,7 +46375,7 @@ var ts; else if (flags & 2 /* Ambient */ || ts.isInAmbientContext(node.parent)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 144 /* Parameter */) { + else if (node.kind === 145 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256 /* Async */; @@ -42892,7 +46383,7 @@ var ts; break; } } - if (node.kind === 150 /* Constructor */) { + if (node.kind === 151 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -42907,13 +46398,13 @@ var ts; } return; } - else if ((node.kind === 235 /* ImportDeclaration */ || node.kind === 234 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 237 /* ImportDeclaration */ || node.kind === 236 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 144 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 145 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 144 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 145 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256 /* Async */) { @@ -42933,37 +46424,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 150 /* Constructor */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 155 /* IndexSignature */: - case 230 /* ModuleDeclaration */: - case 235 /* ImportDeclaration */: - case 234 /* ImportEqualsDeclaration */: - case 241 /* ExportDeclaration */: - case 240 /* ExportAssignment */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 144 /* Parameter */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 151 /* Constructor */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 156 /* IndexSignature */: + case 232 /* ModuleDeclaration */: + case 237 /* ImportDeclaration */: + case 236 /* ImportEqualsDeclaration */: + case 243 /* ExportDeclaration */: + case 242 /* ExportAssignment */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 145 /* Parameter */: return false; default: - if (node.parent.kind === 231 /* ModuleBlock */ || node.parent.kind === 261 /* SourceFile */) { + if (node.parent.kind === 233 /* ModuleBlock */ || node.parent.kind === 264 /* SourceFile */) { return false; } switch (node.kind) { - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: return nodeHasAnyModifiersExcept(node, 119 /* AsyncKeyword */); - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: return nodeHasAnyModifiersExcept(node, 116 /* AbstractKeyword */); - case 227 /* InterfaceDeclaration */: - case 205 /* VariableStatement */: - case 228 /* TypeAliasDeclaration */: + case 229 /* InterfaceDeclaration */: + case 207 /* VariableStatement */: + case 230 /* TypeAliasDeclaration */: return true; - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: return nodeHasAnyModifiersExcept(node, 75 /* ConstKeyword */); default: ts.Debug.fail(); @@ -42976,14 +46467,11 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 149 /* MethodDeclaration */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - if (!node.asteriskToken) { - return false; - } - break; + case 150 /* MethodDeclaration */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); } @@ -43041,8 +46529,12 @@ var ts; return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarTypeParameterList(node.typeParameters, file) || checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); } + function checkGrammarClassLikeDeclaration(node) { + var file = ts.getSourceFileOfNode(node); + return checkGrammarClassDeclarationHeritageClauses(node) || checkGrammarTypeParameterList(node.typeParameters, file); + } function checkGrammarArrowFunction(node, file) { - if (node.kind === 185 /* ArrowFunction */) { + if (node.kind === 186 /* ArrowFunction */) { var arrowFunction = node; var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; @@ -43077,7 +46569,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 134 /* StringKeyword */ && parameter.type.kind !== 132 /* NumberKeyword */) { + if (parameter.type.kind !== 135 /* StringKeyword */ && parameter.type.kind !== 132 /* NumberKeyword */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); } if (!node.type) { @@ -43105,7 +46597,7 @@ var ts; var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 198 /* OmittedExpression */) { + if (arg.kind === 199 /* OmittedExpression */) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -43178,28 +46670,25 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 142 /* ComputedPropertyName */) { + if (node.kind !== 143 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 192 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 25 /* CommaToken */) { + if (computedPropertyName.expression.kind === 193 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 25 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 225 /* FunctionDeclaration */ || - node.kind === 184 /* FunctionExpression */ || - node.kind === 149 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 227 /* FunctionDeclaration */ || + node.kind === 185 /* FunctionExpression */ || + node.kind === 150 /* MethodDeclaration */); if (ts.isInAmbientContext(node)) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } if (!node.body) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.An_overload_signature_cannot_be_declared_as_a_generator); } - if (languageVersion < 2 /* ES2015 */) { - return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher); - } } } function checkGrammarForInvalidQuestionMark(questionToken, message) { @@ -43215,15 +46704,15 @@ var ts; var GetOrSetAccessor = GetAccessor | SetAccessor; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 259 /* SpreadAssignment */) { + if (prop.kind === 262 /* SpreadAssignment */) { continue; } - var name_27 = prop.name; - if (name_27.kind === 142 /* ComputedPropertyName */) { + var name = prop.name; + if (name.kind === 143 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it - checkGrammarComputedPropertyName(name_27); + checkGrammarComputedPropertyName(name); } - if (prop.kind === 258 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 261 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); @@ -43232,7 +46721,7 @@ var ts; if (prop.modifiers) { for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { var mod = _c[_b]; - if (mod.kind !== 119 /* AsyncKeyword */ || prop.kind !== 149 /* MethodDeclaration */) { + if (mod.kind !== 119 /* AsyncKeyword */ || prop.kind !== 150 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -43246,69 +46735,69 @@ var ts; // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; - if (prop.kind === 257 /* PropertyAssignment */ || prop.kind === 258 /* ShorthandPropertyAssignment */) { + if (prop.kind === 260 /* PropertyAssignment */ || prop.kind === 261 /* ShorthandPropertyAssignment */) { // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); - if (name_27.kind === 8 /* NumericLiteral */) { - checkGrammarNumericLiteral(name_27); + if (name.kind === 8 /* NumericLiteral */) { + checkGrammarNumericLiteral(name); } currentKind = Property; } - else if (prop.kind === 149 /* MethodDeclaration */) { + else if (prop.kind === 150 /* MethodDeclaration */) { currentKind = Property; } - else if (prop.kind === 151 /* GetAccessor */) { + else if (prop.kind === 152 /* GetAccessor */) { currentKind = GetAccessor; } - else if (prop.kind === 152 /* SetAccessor */) { + else if (prop.kind === 153 /* SetAccessor */) { currentKind = SetAccessor; } else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - var effectiveName = ts.getPropertyNameForPropertyNameNode(name_27); + var effectiveName = ts.getPropertyNameForPropertyNameNode(name); if (effectiveName === undefined) { continue; } - if (!seen[effectiveName]) { - seen[effectiveName] = currentKind; + var existingKind = seen.get(effectiveName); + if (!existingKind) { + seen.set(effectiveName, currentKind); } else { - var existingKind = seen[effectiveName]; if (currentKind === Property && existingKind === Property) { - grammarErrorOnNode(name_27, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name_27)); + grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name)); } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[effectiveName] = currentKind | existingKind; + seen.set(effectiveName, currentKind | existingKind); } else { - return grammarErrorOnNode(name_27, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); } } else { - return grammarErrorOnNode(name_27, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); } } } } function checkGrammarJsxElement(node) { var seen = ts.createMap(); - for (var _i = 0, _a = node.attributes; _i < _a.length; _i++) { + for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 251 /* JsxSpreadAttribute */) { + if (attr.kind === 254 /* JsxSpreadAttribute */) { continue; } var jsxAttr = attr; - var name_28 = jsxAttr.name; - if (!seen[name_28.text]) { - seen[name_28.text] = true; + var name = jsxAttr.name; + if (!seen.get(name.text)) { + seen.set(name.text, true); } else { - return grammarErrorOnNode(name_28, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); + return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } var initializer = jsxAttr.initializer; - if (initializer && initializer.kind === 252 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 255 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(jsxAttr.initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -43317,7 +46806,12 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 224 /* VariableDeclarationList */) { + if (forInOrOfStatement.kind === 215 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if ((forInOrOfStatement.flags & 16384 /* AwaitContext */) === 0 /* None */) { + return grammarErrorOnNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); + } + } + if (forInOrOfStatement.initializer.kind === 226 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -43332,20 +46826,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 212 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 214 /* ForInStatement */ ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 212 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 214 /* ForInStatement */ ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 212 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 214 /* ForInStatement */ ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -43365,15 +46859,18 @@ var ts; else if (accessor.body === undefined && !(ts.getModifierFlags(accessor) & 128 /* Abstract */)) { return grammarErrorAtPos(ts.getSourceFileOfNode(accessor), accessor.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } + else if (accessor.body && ts.getModifierFlags(accessor) & 128 /* Abstract */) { + return grammarErrorOnNode(accessor, ts.Diagnostics.An_abstract_accessor_cannot_have_an_implementation); + } else if (accessor.typeParameters) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } else if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, kind === 151 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, kind === 152 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - else if (kind === 152 /* SetAccessor */) { + else if (kind === 153 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -43392,14 +46889,14 @@ var ts; } } /** Does the accessor have the right number of parameters? - - A get accessor has no parameters or a single `this` parameter. - A set accessor has one parameter or a `this` parameter and one more parameter */ + * A get accessor has no parameters or a single `this` parameter. + * A set accessor has one parameter or a `this` parameter and one more parameter. + */ function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 151 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 152 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 151 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 152 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } @@ -43414,7 +46911,7 @@ var ts; checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 176 /* ObjectLiteralExpression */) { + if (node.parent.kind === 177 /* ObjectLiteralExpression */) { if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) { return true; } @@ -43435,10 +46932,10 @@ var ts; return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol); } } - else if (node.parent.kind === 227 /* InterfaceDeclaration */) { + else if (node.parent.kind === 229 /* InterfaceDeclaration */) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol); } - else if (node.parent.kind === 161 /* TypeLiteral */) { + else if (node.parent.kind === 162 /* TypeLiteral */) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol); } } @@ -43449,11 +46946,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: if (node.label && current.label.text === node.label.text) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 214 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 216 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -43461,8 +46958,8 @@ var ts; return false; } break; - case 218 /* SwitchStatement */: - if (node.kind === 215 /* BreakStatement */ && !node.label) { + case 220 /* SwitchStatement */: + if (node.kind === 217 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -43477,13 +46974,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 215 /* BreakStatement */ + var message = node.kind === 217 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 215 /* BreakStatement */ + var message = node.kind === 217 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -43495,7 +46992,7 @@ var ts; if (node !== ts.lastOrUndefined(elements)) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } - if (node.name.kind === 173 /* ArrayBindingPattern */ || node.name.kind === 172 /* ObjectBindingPattern */) { + if (node.name.kind === 174 /* ArrayBindingPattern */ || node.name.kind === 173 /* ObjectBindingPattern */) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } if (node.initializer) { @@ -43506,11 +47003,11 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return expr.kind === 9 /* StringLiteral */ || expr.kind === 8 /* NumericLiteral */ || - expr.kind === 190 /* PrefixUnaryExpression */ && expr.operator === 37 /* MinusToken */ && + expr.kind === 191 /* PrefixUnaryExpression */ && expr.operator === 37 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 212 /* ForInStatement */ && node.parent.parent.kind !== 213 /* ForOfStatement */) { + if (node.parent.parent.kind !== 214 /* ForInStatement */ && node.parent.parent.kind !== 215 /* ForOfStatement */) { if (ts.isInAmbientContext(node)) { if (node.initializer) { if (ts.isConst(node) && !node.type) { @@ -43539,6 +47036,10 @@ var ts; } } } + if (compilerOptions.module !== ts.ModuleKind.ES2015 && compilerOptions.module !== ts.ModuleKind.System && !compilerOptions.noEmit && + !ts.isInAmbientContext(node.parent.parent) && ts.hasModifier(node.parent.parent, 1 /* Export */)) { + checkESModuleMarker(node.name); + } var checkLetConstNames = (ts.isLet(node) || ts.isConst(node)); // 1. LexicalDeclaration : LetOrConst BindingList ; // It is a Syntax Error if the BoundNames of BindingList contains "let". @@ -43548,6 +47049,22 @@ var ts; // and its Identifier is eval or arguments return checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name); } + function checkESModuleMarker(name) { + if (name.kind === 70 /* Identifier */) { + if (ts.unescapeIdentifier(name.text) === "__esModule") { + return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules); + } + } + else { + var elements = name.elements; + for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) { + var element = elements_2[_i]; + if (!ts.isOmittedExpression(element)) { + return checkESModuleMarker(element.name); + } + } + } + } function checkGrammarNameInLetOrConstDeclarations(name) { if (name.kind === 70 /* Identifier */) { if (name.originalKeywordKind === 109 /* LetKeyword */) { @@ -43556,8 +47073,8 @@ var ts; } else { var elements = name.elements; - for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) { - var element = elements_2[_i]; + for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) { + var element = elements_3[_i]; if (!ts.isOmittedExpression(element)) { checkGrammarNameInLetOrConstDeclarations(element.name); } @@ -43575,15 +47092,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 208 /* IfStatement */: - case 209 /* DoStatement */: - case 210 /* WhileStatement */: - case 217 /* WithStatement */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: + case 210 /* IfStatement */: + case 211 /* DoStatement */: + case 212 /* WhileStatement */: + case 219 /* WithStatement */: + case 213 /* ForStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: return false; - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -43598,6 +47115,13 @@ var ts; } } } + function checkGrammarMetaProperty(node) { + if (node.keywordToken === 93 /* NewKeyword */) { + if (node.name.text !== "target") { + return grammarErrorOnNode(node.name, ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, node.name.text, ts.tokenToString(node.keywordToken), "target"); + } + } + } function hasParseDiagnostics(sourceFile) { return sourceFile.parseDiagnostics.length > 0; } @@ -43638,7 +47162,7 @@ var ts; return true; } } - else if (node.parent.kind === 227 /* InterfaceDeclaration */) { + else if (node.parent.kind === 229 /* InterfaceDeclaration */) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -43646,7 +47170,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 161 /* TypeLiteral */) { + else if (node.parent.kind === 162 /* TypeLiteral */) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -43671,13 +47195,13 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 227 /* InterfaceDeclaration */ || - node.kind === 228 /* TypeAliasDeclaration */ || - node.kind === 235 /* ImportDeclaration */ || - node.kind === 234 /* ImportEqualsDeclaration */ || - node.kind === 241 /* ExportDeclaration */ || - node.kind === 240 /* ExportAssignment */ || - node.kind === 233 /* NamespaceExportDeclaration */ || + if (node.kind === 229 /* InterfaceDeclaration */ || + node.kind === 230 /* TypeAliasDeclaration */ || + node.kind === 237 /* ImportDeclaration */ || + node.kind === 236 /* ImportEqualsDeclaration */ || + node.kind === 243 /* ExportDeclaration */ || + node.kind === 242 /* ExportAssignment */ || + node.kind === 235 /* NamespaceExportDeclaration */ || ts.getModifierFlags(node) & (2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } @@ -43686,7 +47210,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 205 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 207 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -43712,7 +47236,7 @@ var ts; // to prevent noisiness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 204 /* Block */ || node.parent.kind === 231 /* ModuleBlock */ || node.parent.kind === 261 /* SourceFile */) { + if (node.parent.kind === 206 /* Block */ || node.parent.kind === 233 /* ModuleBlock */ || node.parent.kind === 264 /* SourceFile */) { var links_1 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_1.hasReportedStatementInAmbientContext) { @@ -43720,13 +47244,30 @@ var ts; } } else { + // We must be parented by a statement. If so, there's no need + // to report the error as our parent will have already done it. + // Debug.assert(isStatement(node.parent)); } } } function checkGrammarNumericLiteral(node) { // Grammar checking - if (node.isOctalLiteral && languageVersion >= 1 /* ES5 */) { - return grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); + if (node.numericLiteralFlags & 4 /* Octal */) { + var diagnosticMessage = void 0; + if (languageVersion >= 1 /* ES5 */) { + diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; + } + else if (ts.isChildOfNodeWithKind(node, 172 /* LiteralType */)) { + diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; + } + else if (ts.isChildOfNodeWithKind(node, 263 /* EnumMember */)) { + diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; + } + if (diagnosticMessage) { + var withMinus = ts.isPrefixUnaryExpression(node.parent) && node.parent.operator === 37 /* MinusToken */; + var literal = (withMinus ? "-" : "") + "0o" + node.text; + return grammarErrorOnNode(withMinus ? node.parent : node, diagnosticMessage, literal); + } } } function grammarErrorAfterFirstToken(node, message, arg0, arg1, arg2) { @@ -43739,11 +47280,11 @@ var ts; } function getAmbientModules() { var result = []; - for (var sym in globals) { + globals.forEach(function (global, sym) { if (ambientModuleSymbolRegex.test(sym)) { - result.push(globals[sym]); + result.push(global); } - } + }); return result; } } @@ -43752,466 +47293,19 @@ var ts; /// /// /// -/* @internal */ var ts; (function (ts) { - ; - /** - * This map contains information about the shape of each Node in "types.ts" pertaining to how - * each node should be traversed during a transformation. - * - * Each edge corresponds to a property in a Node subtype that should be traversed when visiting - * each child. The properties are assigned in the order in which traversal should occur. - * - * We only add entries for nodes that do not have a create/update pair defined in factory.ts - * - * NOTE: This needs to be kept up to date with changes to nodes in "types.ts". Currently, this - * map is not comprehensive. Only node edges relevant to tree transformation are - * currently defined. We may extend this to be more comprehensive, and eventually - * supplant the existing `forEachChild` implementation if performance is not - * significantly impacted. - */ - var nodeEdgeTraversalMap = ts.createMap((_a = {}, - _a[141 /* QualifiedName */] = [ - { name: "left", test: ts.isEntityName }, - { name: "right", test: ts.isIdentifier } - ], - _a[145 /* Decorator */] = [ - { name: "expression", test: ts.isLeftHandSideExpression } - ], - _a[182 /* TypeAssertionExpression */] = [ - { name: "type", test: ts.isTypeNode }, - { name: "expression", test: ts.isUnaryExpression } - ], - _a[200 /* AsExpression */] = [ - { name: "expression", test: ts.isExpression }, - { name: "type", test: ts.isTypeNode } - ], - _a[201 /* NonNullExpression */] = [ - { name: "expression", test: ts.isLeftHandSideExpression } - ], - _a[229 /* EnumDeclaration */] = [ - { name: "decorators", test: ts.isDecorator }, - { name: "modifiers", test: ts.isModifier }, - { name: "name", test: ts.isIdentifier }, - { name: "members", test: ts.isEnumMember } - ], - _a[230 /* ModuleDeclaration */] = [ - { name: "decorators", test: ts.isDecorator }, - { name: "modifiers", test: ts.isModifier }, - { name: "name", test: ts.isModuleName }, - { name: "body", test: ts.isModuleBody } - ], - _a[231 /* ModuleBlock */] = [ - { name: "statements", test: ts.isStatement } - ], - _a[234 /* ImportEqualsDeclaration */] = [ - { name: "decorators", test: ts.isDecorator }, - { name: "modifiers", test: ts.isModifier }, - { name: "name", test: ts.isIdentifier }, - { name: "moduleReference", test: ts.isModuleReference } - ], - _a[245 /* ExternalModuleReference */] = [ - { name: "expression", test: ts.isExpression, optional: true } - ], - _a[260 /* EnumMember */] = [ - { name: "name", test: ts.isPropertyName }, - { name: "initializer", test: ts.isExpression, optional: true, parenthesize: ts.parenthesizeExpressionForList } - ], - _a)); - function reduceNode(node, f, initial) { - return node ? f(initial, node) : initial; - } - function reduceNodeArray(nodes, f, initial) { - return nodes ? f(initial, nodes) : initial; - } - /** - * Similar to `reduceLeft`, performs a reduction against each child of a node. - * NOTE: Unlike `forEachChild`, this does *not* visit every node. Only nodes added to the - * `nodeEdgeTraversalMap` above will be visited. - * - * @param node The node containing the children to reduce. - * @param initial The initial value to supply to the reduction. - * @param f The callback function - */ - function reduceEachChild(node, initial, cbNode, cbNodeArray) { - if (node === undefined) { - return initial; - } - var reduceNodes = cbNodeArray ? reduceNodeArray : ts.reduceLeft; - var cbNodes = cbNodeArray || cbNode; - var kind = node.kind; - // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 140 /* LastToken */)) { - return initial; - } - // We do not yet support types. - if ((kind >= 156 /* TypePredicate */ && kind <= 171 /* LiteralType */)) { - return initial; - } - var result = initial; - switch (node.kind) { - // Leaf nodes - case 203 /* SemicolonClassElement */: - case 206 /* EmptyStatement */: - case 198 /* OmittedExpression */: - case 222 /* DebuggerStatement */: - case 293 /* NotEmittedStatement */: - // No need to visit nodes with no children. - break; - // Names - case 142 /* ComputedPropertyName */: - result = reduceNode(node.expression, cbNode, result); - break; - // Signature elements - case 144 /* Parameter */: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.type, cbNode, result); - result = reduceNode(node.initializer, cbNode, result); - break; - case 145 /* Decorator */: - result = reduceNode(node.expression, cbNode, result); - break; - // Type member - case 147 /* PropertyDeclaration */: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.type, cbNode, result); - result = reduceNode(node.initializer, cbNode, result); - break; - case 149 /* MethodDeclaration */: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNodes(node.typeParameters, cbNodes, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.type, cbNode, result); - result = reduceNode(node.body, cbNode, result); - break; - case 150 /* Constructor */: - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.body, cbNode, result); - break; - case 151 /* GetAccessor */: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.type, cbNode, result); - result = reduceNode(node.body, cbNode, result); - break; - case 152 /* SetAccessor */: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.body, cbNode, result); - break; - // Binding patterns - case 172 /* ObjectBindingPattern */: - case 173 /* ArrayBindingPattern */: - result = reduceNodes(node.elements, cbNodes, result); - break; - case 174 /* BindingElement */: - result = reduceNode(node.propertyName, cbNode, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.initializer, cbNode, result); - break; - // Expression - case 175 /* ArrayLiteralExpression */: - result = reduceNodes(node.elements, cbNodes, result); - break; - case 176 /* ObjectLiteralExpression */: - result = reduceNodes(node.properties, cbNodes, result); - break; - case 177 /* PropertyAccessExpression */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.name, cbNode, result); - break; - case 178 /* ElementAccessExpression */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.argumentExpression, cbNode, result); - break; - case 179 /* CallExpression */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNodes(node.typeArguments, cbNodes, result); - result = reduceNodes(node.arguments, cbNodes, result); - break; - case 180 /* NewExpression */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNodes(node.typeArguments, cbNodes, result); - result = reduceNodes(node.arguments, cbNodes, result); - break; - case 181 /* TaggedTemplateExpression */: - result = reduceNode(node.tag, cbNode, result); - result = reduceNode(node.template, cbNode, result); - break; - case 184 /* FunctionExpression */: - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNodes(node.typeParameters, cbNodes, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.type, cbNode, result); - result = reduceNode(node.body, cbNode, result); - break; - case 185 /* ArrowFunction */: - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNodes(node.typeParameters, cbNodes, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.type, cbNode, result); - result = reduceNode(node.body, cbNode, result); - break; - case 183 /* ParenthesizedExpression */: - case 186 /* DeleteExpression */: - case 187 /* TypeOfExpression */: - case 188 /* VoidExpression */: - case 189 /* AwaitExpression */: - case 195 /* YieldExpression */: - case 196 /* SpreadElement */: - case 201 /* NonNullExpression */: - result = reduceNode(node.expression, cbNode, result); - break; - case 190 /* PrefixUnaryExpression */: - case 191 /* PostfixUnaryExpression */: - result = reduceNode(node.operand, cbNode, result); - break; - case 192 /* BinaryExpression */: - result = reduceNode(node.left, cbNode, result); - result = reduceNode(node.right, cbNode, result); - break; - case 193 /* ConditionalExpression */: - result = reduceNode(node.condition, cbNode, result); - result = reduceNode(node.whenTrue, cbNode, result); - result = reduceNode(node.whenFalse, cbNode, result); - break; - case 194 /* TemplateExpression */: - result = reduceNode(node.head, cbNode, result); - result = reduceNodes(node.templateSpans, cbNodes, result); - break; - case 197 /* ClassExpression */: - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNodes(node.typeParameters, cbNodes, result); - result = reduceNodes(node.heritageClauses, cbNodes, result); - result = reduceNodes(node.members, cbNodes, result); - break; - case 199 /* ExpressionWithTypeArguments */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNodes(node.typeArguments, cbNodes, result); - break; - // Misc - case 202 /* TemplateSpan */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.literal, cbNode, result); - break; - // Element - case 204 /* Block */: - result = reduceNodes(node.statements, cbNodes, result); - break; - case 205 /* VariableStatement */: - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.declarationList, cbNode, result); - break; - case 207 /* ExpressionStatement */: - result = reduceNode(node.expression, cbNode, result); - break; - case 208 /* IfStatement */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.thenStatement, cbNode, result); - result = reduceNode(node.elseStatement, cbNode, result); - break; - case 209 /* DoStatement */: - result = reduceNode(node.statement, cbNode, result); - result = reduceNode(node.expression, cbNode, result); - break; - case 210 /* WhileStatement */: - case 217 /* WithStatement */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.statement, cbNode, result); - break; - case 211 /* ForStatement */: - result = reduceNode(node.initializer, cbNode, result); - result = reduceNode(node.condition, cbNode, result); - result = reduceNode(node.incrementor, cbNode, result); - result = reduceNode(node.statement, cbNode, result); - break; - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - result = reduceNode(node.initializer, cbNode, result); - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.statement, cbNode, result); - break; - case 216 /* ReturnStatement */: - case 220 /* ThrowStatement */: - result = reduceNode(node.expression, cbNode, result); - break; - case 218 /* SwitchStatement */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.caseBlock, cbNode, result); - break; - case 219 /* LabeledStatement */: - result = reduceNode(node.label, cbNode, result); - result = reduceNode(node.statement, cbNode, result); - break; - case 221 /* TryStatement */: - result = reduceNode(node.tryBlock, cbNode, result); - result = reduceNode(node.catchClause, cbNode, result); - result = reduceNode(node.finallyBlock, cbNode, result); - break; - case 223 /* VariableDeclaration */: - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.type, cbNode, result); - result = reduceNode(node.initializer, cbNode, result); - break; - case 224 /* VariableDeclarationList */: - result = reduceNodes(node.declarations, cbNodes, result); - break; - case 225 /* FunctionDeclaration */: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNodes(node.typeParameters, cbNodes, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.type, cbNode, result); - result = reduceNode(node.body, cbNode, result); - break; - case 226 /* ClassDeclaration */: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNodes(node.typeParameters, cbNodes, result); - result = reduceNodes(node.heritageClauses, cbNodes, result); - result = reduceNodes(node.members, cbNodes, result); - break; - case 232 /* CaseBlock */: - result = reduceNodes(node.clauses, cbNodes, result); - break; - case 235 /* ImportDeclaration */: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.importClause, cbNode, result); - result = reduceNode(node.moduleSpecifier, cbNode, result); - break; - case 236 /* ImportClause */: - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.namedBindings, cbNode, result); - break; - case 237 /* NamespaceImport */: - result = reduceNode(node.name, cbNode, result); - break; - case 238 /* NamedImports */: - case 242 /* NamedExports */: - result = reduceNodes(node.elements, cbNodes, result); - break; - case 239 /* ImportSpecifier */: - case 243 /* ExportSpecifier */: - result = reduceNode(node.propertyName, cbNode, result); - result = reduceNode(node.name, cbNode, result); - break; - case 240 /* ExportAssignment */: - result = ts.reduceLeft(node.decorators, cbNode, result); - result = ts.reduceLeft(node.modifiers, cbNode, result); - result = reduceNode(node.expression, cbNode, result); - break; - case 241 /* ExportDeclaration */: - result = ts.reduceLeft(node.decorators, cbNode, result); - result = ts.reduceLeft(node.modifiers, cbNode, result); - result = reduceNode(node.exportClause, cbNode, result); - result = reduceNode(node.moduleSpecifier, cbNode, result); - break; - // JSX - case 246 /* JsxElement */: - result = reduceNode(node.openingElement, cbNode, result); - result = ts.reduceLeft(node.children, cbNode, result); - result = reduceNode(node.closingElement, cbNode, result); - break; - case 247 /* JsxSelfClosingElement */: - case 248 /* JsxOpeningElement */: - result = reduceNode(node.tagName, cbNode, result); - result = reduceNodes(node.attributes, cbNodes, result); - break; - case 249 /* JsxClosingElement */: - result = reduceNode(node.tagName, cbNode, result); - break; - case 250 /* JsxAttribute */: - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.initializer, cbNode, result); - break; - case 251 /* JsxSpreadAttribute */: - result = reduceNode(node.expression, cbNode, result); - break; - case 252 /* JsxExpression */: - result = reduceNode(node.expression, cbNode, result); - break; - // Clauses - case 253 /* CaseClause */: - result = reduceNode(node.expression, cbNode, result); - // fall-through - case 254 /* DefaultClause */: - result = reduceNodes(node.statements, cbNodes, result); - break; - case 255 /* HeritageClause */: - result = reduceNodes(node.types, cbNodes, result); - break; - case 256 /* CatchClause */: - result = reduceNode(node.variableDeclaration, cbNode, result); - result = reduceNode(node.block, cbNode, result); - break; - // Property assignments - case 257 /* PropertyAssignment */: - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.initializer, cbNode, result); - break; - case 258 /* ShorthandPropertyAssignment */: - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.objectAssignmentInitializer, cbNode, result); - break; - case 259 /* SpreadAssignment */: - result = reduceNode(node.expression, cbNode, result); - break; - // Top-level nodes - case 261 /* SourceFile */: - result = reduceNodes(node.statements, cbNodes, result); - break; - case 294 /* PartiallyEmittedExpression */: - result = reduceNode(node.expression, cbNode, result); - break; - default: - var edgeTraversalPath = nodeEdgeTraversalMap[kind]; - if (edgeTraversalPath) { - for (var _i = 0, edgeTraversalPath_1 = edgeTraversalPath; _i < edgeTraversalPath_1.length; _i++) { - var edge = edgeTraversalPath_1[_i]; - var value = node[edge.name]; - if (value !== undefined) { - result = ts.isArray(value) - ? reduceNodes(value, cbNodes, result) - : cbNode(result, value); - } - } - } - break; - } - return result; - } - ts.reduceEachChild = reduceEachChild; - function visitNode(node, visitor, test, optional, lift, parenthesize, parentNode) { + function visitNode(node, visitor, test, lift) { if (node === undefined || visitor === undefined) { return node; } - aggregateTransformFlags(node); + ts.aggregateTransformFlags(node); var visited = visitor(node); if (visited === node) { return node; } var visitedNode; if (visited === undefined) { - if (!optional) { - Debug.failNotOptional(); - } return undefined; } else if (ts.isArray(visited)) { @@ -44220,17 +47314,23 @@ var ts; else { visitedNode = visited; } - if (parenthesize !== undefined) { - visitedNode = parenthesize(visitedNode, parentNode); - } - Debug.assertNode(visitedNode, test); - aggregateTransformFlags(visitedNode); + ts.Debug.assertNode(visitedNode, test); + ts.aggregateTransformFlags(visitedNode); return visitedNode; } ts.visitNode = visitNode; - function visitNodes(nodes, visitor, test, start, count, parenthesize, parentNode) { - if (nodes === undefined) { - return undefined; + /** + * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place. + * + * @param nodes The NodeArray to visit. + * @param visitor The callback used to visit a Node. + * @param test A node test to execute for each node. + * @param start An optional value indicating the starting offset at which to start visiting. + * @param count An optional value indicating the maximum number of nodes to visit. + */ + function visitNodes(nodes, visitor, test, start, count) { + if (nodes === undefined || visitor === undefined) { + return nodes; } var updated; // Ensure start and count have valid values @@ -44245,38 +47345,32 @@ var ts; // If we are not visiting all of the original nodes, we must always create a new array. // Since this is a fragment of a node array, we do not copy over the previous location // and will only copy over `hasTrailingComma` if we are including the last element. - updated = ts.createNodeArray([], /*location*/ undefined, - /*hasTrailingComma*/ nodes.hasTrailingComma && start + count === length); + updated = ts.createNodeArray([], /*hasTrailingComma*/ nodes.hasTrailingComma && start + count === length); } // Visit each original node. for (var i = 0; i < count; i++) { var node = nodes[i + start]; - aggregateTransformFlags(node); + ts.aggregateTransformFlags(node); var visited = node !== undefined ? visitor(node) : undefined; if (updated !== undefined || visited === undefined || visited !== node) { if (updated === undefined) { // Ensure we have a copy of `nodes`, up to the current index. - updated = ts.createNodeArray(nodes.slice(0, i), /*location*/ nodes, nodes.hasTrailingComma); + updated = ts.createNodeArray(nodes.slice(0, i), nodes.hasTrailingComma); + ts.setTextRange(updated, nodes); } if (visited) { if (ts.isArray(visited)) { for (var _i = 0, visited_1 = visited; _i < visited_1.length; _i++) { var visitedNode = visited_1[_i]; - visitedNode = parenthesize - ? parenthesize(visitedNode, parentNode) - : visitedNode; - Debug.assertNode(visitedNode, test); - aggregateTransformFlags(visitedNode); + ts.Debug.assertNode(visitedNode, test); + ts.aggregateTransformFlags(visitedNode); updated.push(visitedNode); } } else { - var visitedNode = parenthesize - ? parenthesize(visited, parentNode) - : visited; - Debug.assertNode(visitedNode, test); - aggregateTransformFlags(visitedNode); - updated.push(visitedNode); + ts.Debug.assertNode(visited, test); + ts.aggregateTransformFlags(visited); + updated.push(visited); } } } @@ -44292,19 +47386,20 @@ var ts; context.startLexicalEnvironment(); statements = visitNodes(statements, visitor, ts.isStatement, start); if (ensureUseStrict && !ts.startsWithUseStrict(statements)) { - statements = ts.createNodeArray([ts.createStatement(ts.createLiteral("use strict"))].concat(statements), statements); + statements = ts.setTextRange(ts.createNodeArray([ts.createStatement(ts.createLiteral("use strict"))].concat(statements)), statements); } var declarations = context.endLexicalEnvironment(); - return ts.createNodeArray(ts.concatenate(statements, declarations), statements); + return ts.setTextRange(ts.createNodeArray(ts.concatenate(statements, declarations)), statements); } ts.visitLexicalEnvironment = visitLexicalEnvironment; /** * Starts a new lexical environment and visits a parameter list, suspending the lexical * environment upon completion. */ - function visitParameterList(nodes, visitor, context) { + function visitParameterList(nodes, visitor, context, nodesVisitor) { + if (nodesVisitor === void 0) { nodesVisitor = visitNodes; } context.startLexicalEnvironment(); - var updated = visitNodes(nodes, visitor, ts.isParameterDeclaration); + var updated = nodesVisitor(nodes, visitor, ts.isParameterDeclaration); context.suspendLexicalEnvironment(); return updated; } @@ -44315,256 +47410,715 @@ var ts; var declarations = context.endLexicalEnvironment(); if (ts.some(declarations)) { var block = ts.convertToFunctionBody(updated); - var statements = mergeLexicalEnvironment(block.statements, declarations); + var statements = ts.mergeLexicalEnvironment(block.statements, declarations); return ts.updateBlock(block, statements); } return updated; } ts.visitFunctionBody = visitFunctionBody; - function visitEachChild(node, visitor, context) { + function visitEachChild(node, visitor, context, nodesVisitor, tokenVisitor) { + if (nodesVisitor === void 0) { nodesVisitor = visitNodes; } if (node === undefined) { return undefined; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 140 /* LastToken */)) { - return node; - } - // We do not yet support types. - if ((kind >= 156 /* TypePredicate */ && kind <= 171 /* LiteralType */)) { + if ((kind > 0 /* FirstToken */ && kind <= 141 /* LastToken */) || kind === 168 /* ThisType */) { return node; } switch (node.kind) { - case 203 /* SemicolonClassElement */: - case 206 /* EmptyStatement */: - case 198 /* OmittedExpression */: - case 222 /* DebuggerStatement */: + case 205 /* SemicolonClassElement */: + case 208 /* EmptyStatement */: + case 199 /* OmittedExpression */: + case 224 /* DebuggerStatement */: + case 297 /* EndOfDeclarationMarker */: + case 246 /* MissingDeclaration */: // No need to visit nodes with no children. return node; // Names - case 142 /* ComputedPropertyName */: + case 142 /* QualifiedName */: + return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); + case 143 /* ComputedPropertyName */: return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); - // Signature elements - case 144 /* Parameter */: - return ts.updateParameter(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), node.dotDotDotToken, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitNode(node.initializer, visitor, ts.isExpression, /*optional*/ true)); - // Type member - case 147 /* PropertyDeclaration */: - return ts.updateProperty(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitNode(node.initializer, visitor, ts.isExpression, /*optional*/ true)); - case 149 /* MethodDeclaration */: - return ts.updateMethod(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitFunctionBody(node.body, visitor, context)); - case 150 /* Constructor */: - return ts.updateConstructor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context), visitFunctionBody(node.body, visitor, context)); - case 151 /* GetAccessor */: - return ts.updateGetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitFunctionBody(node.body, visitor, context)); - case 152 /* SetAccessor */: - return ts.updateSetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context), visitFunctionBody(node.body, visitor, context)); + // Signatures and Signature Elements + case 159 /* FunctionType */: + return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 160 /* ConstructorType */: + return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 154 /* CallSignature */: + return ts.updateCallSignatureDeclaration(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 155 /* ConstructSignature */: + return ts.updateConstructSignatureDeclaration(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 149 /* MethodSignature */: + return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); + case 156 /* IndexSignature */: + return ts.updateIndexSignatureDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 145 /* Parameter */: + return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + case 146 /* Decorator */: + return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); + // Types + case 158 /* TypeReference */: + return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); + case 157 /* TypePredicate */: + return ts.updateTypePredicateNode(node, visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 161 /* TypeQuery */: + return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); + case 162 /* TypeLiteral */: + return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor)); + case 163 /* ArrayType */: + return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); + case 164 /* TupleType */: + return ts.updateTypleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); + case 165 /* UnionType */: + case 166 /* IntersectionType */: + return ts.updateUnionOrIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); + case 167 /* ParenthesizedType */: + throw ts.Debug.fail("not implemented."); + case 169 /* TypeOperator */: + return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); + case 170 /* IndexedAccessType */: + return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); + case 171 /* MappedType */: + return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameter), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); + case 172 /* LiteralType */: + return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); + // Type Declarations + case 144 /* TypeParameter */: + return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); + // Type members + case 147 /* PropertySignature */: + return ts.updatePropertySignature(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + case 148 /* PropertyDeclaration */: + return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + case 150 /* MethodDeclaration */: + return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 151 /* Constructor */: + return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); + case 152 /* GetAccessor */: + return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 153 /* SetAccessor */: + return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); // Binding patterns - case 172 /* ObjectBindingPattern */: - return ts.updateObjectBindingPattern(node, visitNodes(node.elements, visitor, ts.isBindingElement)); - case 173 /* ArrayBindingPattern */: - return ts.updateArrayBindingPattern(node, visitNodes(node.elements, visitor, ts.isArrayBindingElement)); - case 174 /* BindingElement */: - return ts.updateBindingElement(node, node.dotDotDotToken, visitNode(node.propertyName, visitor, ts.isPropertyName, /*optional*/ true), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression, /*optional*/ true)); + case 173 /* ObjectBindingPattern */: + return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); + case 174 /* ArrayBindingPattern */: + return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); + case 175 /* BindingElement */: + return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); // Expression - case 175 /* ArrayLiteralExpression */: - return ts.updateArrayLiteral(node, visitNodes(node.elements, visitor, ts.isExpression)); - case 176 /* ObjectLiteralExpression */: - return ts.updateObjectLiteral(node, visitNodes(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 177 /* PropertyAccessExpression */: + case 176 /* ArrayLiteralExpression */: + return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); + case 177 /* ObjectLiteralExpression */: + return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); + case 178 /* PropertyAccessExpression */: return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier)); - case 178 /* ElementAccessExpression */: + case 179 /* ElementAccessExpression */: return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 179 /* CallExpression */: - return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression)); - case 180 /* NewExpression */: - return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression)); - case 181 /* TaggedTemplateExpression */: + case 180 /* CallExpression */: + return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); + case 181 /* NewExpression */: + return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); + case 182 /* TaggedTemplateExpression */: return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); - case 183 /* ParenthesizedExpression */: + case 183 /* TypeAssertionExpression */: + return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); + case 184 /* ParenthesizedExpression */: return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); - case 184 /* FunctionExpression */: - return ts.updateFunctionExpression(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitFunctionBody(node.body, visitor, context)); - case 185 /* ArrowFunction */: - return ts.updateArrowFunction(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitFunctionBody(node.body, visitor, context)); - case 186 /* DeleteExpression */: + case 185 /* FunctionExpression */: + return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 186 /* ArrowFunction */: + return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 187 /* DeleteExpression */: return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); - case 187 /* TypeOfExpression */: + case 188 /* TypeOfExpression */: return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); - case 188 /* VoidExpression */: + case 189 /* VoidExpression */: return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); - case 189 /* AwaitExpression */: + case 190 /* AwaitExpression */: return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression)); - case 190 /* PrefixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 191 /* PostfixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 193 /* ConditionalExpression */: + case 194 /* ConditionalExpression */: return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.whenFalse, visitor, ts.isExpression)); - case 194 /* TemplateExpression */: - return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), visitNodes(node.templateSpans, visitor, ts.isTemplateSpan)); - case 195 /* YieldExpression */: - return ts.updateYield(node, visitNode(node.expression, visitor, ts.isExpression)); - case 196 /* SpreadElement */: + case 195 /* TemplateExpression */: + return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); + case 196 /* YieldExpression */: + return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); + case 197 /* SpreadElement */: return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); - case 197 /* ClassExpression */: - return ts.updateClassExpression(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier, /*optional*/ true), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), visitNodes(node.members, visitor, ts.isClassElement)); - case 199 /* ExpressionWithTypeArguments */: - return ts.updateExpressionWithTypeArguments(node, visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); + case 198 /* ClassExpression */: + return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); + case 200 /* ExpressionWithTypeArguments */: + return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); + case 201 /* AsExpression */: + return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); + case 202 /* NonNullExpression */: + return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); // Misc - case 202 /* TemplateSpan */: + case 204 /* TemplateSpan */: return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 204 /* Block */: - return ts.updateBlock(node, visitNodes(node.statements, visitor, ts.isStatement)); - case 205 /* VariableStatement */: - return ts.updateVariableStatement(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 207 /* ExpressionStatement */: + case 206 /* Block */: + return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + case 207 /* VariableStatement */: + return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); + case 209 /* ExpressionStatement */: return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression)); - case 208 /* IfStatement */: - return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, /*optional*/ false, liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, /*optional*/ true, liftToBlock)); - case 209 /* DoStatement */: - return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); - case 210 /* WhileStatement */: - return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, liftToBlock)); - case 211 /* ForStatement */: - return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, liftToBlock)); - case 212 /* ForInStatement */: - return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, liftToBlock)); - case 213 /* ForOfStatement */: - return ts.updateForOf(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, liftToBlock)); - case 214 /* ContinueStatement */: - return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier, /*optional*/ true)); - case 215 /* BreakStatement */: - return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier, /*optional*/ true)); - case 216 /* ReturnStatement */: - return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression, /*optional*/ true)); - case 217 /* WithStatement */: - return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, liftToBlock)); - case 218 /* SwitchStatement */: + case 210 /* IfStatement */: + return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); + case 211 /* DoStatement */: + return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); + case 212 /* WhileStatement */: + return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 213 /* ForStatement */: + return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 214 /* ForInStatement */: + return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 215 /* ForOfStatement */: + return ts.updateForOf(node, node.awaitModifier, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 216 /* ContinueStatement */: + return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); + case 217 /* BreakStatement */: + return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); + case 218 /* ReturnStatement */: + return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); + case 219 /* WithStatement */: + return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 220 /* SwitchStatement */: return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); - case 219 /* LabeledStatement */: - return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, liftToBlock)); - case 220 /* ThrowStatement */: + case 221 /* LabeledStatement */: + return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 222 /* ThrowStatement */: return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); - case 221 /* TryStatement */: - return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause, /*optional*/ true), visitNode(node.finallyBlock, visitor, ts.isBlock, /*optional*/ true)); - case 223 /* VariableDeclaration */: - return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitNode(node.initializer, visitor, ts.isExpression, /*optional*/ true)); - case 224 /* VariableDeclarationList */: - return ts.updateVariableDeclarationList(node, visitNodes(node.declarations, visitor, ts.isVariableDeclaration)); - case 225 /* FunctionDeclaration */: - return ts.updateFunctionDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitFunctionBody(node.body, visitor, context)); - case 226 /* ClassDeclaration */: - return ts.updateClassDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier, /*optional*/ true), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), visitNodes(node.members, visitor, ts.isClassElement)); - case 232 /* CaseBlock */: - return ts.updateCaseBlock(node, visitNodes(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 235 /* ImportDeclaration */: - return ts.updateImportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause, /*optional*/ true), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 236 /* ImportClause */: - return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier, /*optional*/ true), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings, /*optional*/ true)); - case 237 /* NamespaceImport */: + case 223 /* TryStatement */: + return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); + case 225 /* VariableDeclaration */: + return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + case 226 /* VariableDeclarationList */: + return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); + case 227 /* FunctionDeclaration */: + return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 228 /* ClassDeclaration */: + return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); + case 231 /* EnumDeclaration */: + return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); + case 232 /* ModuleDeclaration */: + return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); + case 233 /* ModuleBlock */: + return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + case 234 /* CaseBlock */: + return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); + case 236 /* ImportEqualsDeclaration */: + return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); + case 237 /* ImportDeclaration */: + return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); + case 238 /* ImportClause */: + return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings)); + case 239 /* NamespaceImport */: return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 238 /* NamedImports */: - return ts.updateNamedImports(node, visitNodes(node.elements, visitor, ts.isImportSpecifier)); - case 239 /* ImportSpecifier */: - return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier, /*optional*/ true), visitNode(node.name, visitor, ts.isIdentifier)); - case 240 /* ExportAssignment */: - return ts.updateExportAssignment(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); - case 241 /* ExportDeclaration */: - return ts.updateExportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports, /*optional*/ true), visitNode(node.moduleSpecifier, visitor, ts.isExpression, /*optional*/ true)); - case 242 /* NamedExports */: - return ts.updateNamedExports(node, visitNodes(node.elements, visitor, ts.isExportSpecifier)); - case 243 /* ExportSpecifier */: - return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier, /*optional*/ true), visitNode(node.name, visitor, ts.isIdentifier)); + case 240 /* NamedImports */: + return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); + case 241 /* ImportSpecifier */: + return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); + case 242 /* ExportAssignment */: + return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); + case 243 /* ExportDeclaration */: + return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); + case 244 /* NamedExports */: + return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); + case 245 /* ExportSpecifier */: + return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); + // Module references + case 247 /* ExternalModuleReference */: + return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); // JSX - case 246 /* JsxElement */: - return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), visitNodes(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 247 /* JsxSelfClosingElement */: - return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNodes(node.attributes, visitor, ts.isJsxAttributeLike)); - case 248 /* JsxOpeningElement */: - return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNodes(node.attributes, visitor, ts.isJsxAttributeLike)); - case 249 /* JsxClosingElement */: + case 248 /* JsxElement */: + return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); + case 253 /* JsxAttributes */: + return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); + case 249 /* JsxSelfClosingElement */: + return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); + case 250 /* JsxOpeningElement */: + return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); + case 251 /* JsxClosingElement */: return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 250 /* JsxAttribute */: + case 252 /* JsxAttribute */: return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 251 /* JsxSpreadAttribute */: + case 254 /* JsxSpreadAttribute */: return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); - case 252 /* JsxExpression */: + case 255 /* JsxExpression */: return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); // Clauses - case 253 /* CaseClause */: - return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.statements, visitor, ts.isStatement)); - case 254 /* DefaultClause */: - return ts.updateDefaultClause(node, visitNodes(node.statements, visitor, ts.isStatement)); - case 255 /* HeritageClause */: - return ts.updateHeritageClause(node, visitNodes(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 256 /* CatchClause */: + case 256 /* CaseClause */: + return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); + case 257 /* DefaultClause */: + return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + case 258 /* HeritageClause */: + return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); + case 259 /* CatchClause */: return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); // Property assignments - case 257 /* PropertyAssignment */: + case 260 /* PropertyAssignment */: return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 258 /* ShorthandPropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 259 /* SpreadAssignment */: + case 262 /* SpreadAssignment */: return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); + // Enum + case 263 /* EnumMember */: + return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 261 /* SourceFile */: + case 264 /* SourceFile */: return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 294 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); default: - var updated = void 0; - var edgeTraversalPath = nodeEdgeTraversalMap[kind]; - if (edgeTraversalPath) { - for (var _i = 0, edgeTraversalPath_2 = edgeTraversalPath; _i < edgeTraversalPath_2.length; _i++) { - var edge = edgeTraversalPath_2[_i]; - var value = node[edge.name]; - if (value !== undefined) { - var visited = ts.isArray(value) - ? visitNodes(value, visitor, edge.test, 0, value.length, edge.parenthesize, node) - : visitNode(value, visitor, edge.test, edge.optional, edge.lift, edge.parenthesize, node); - if (updated !== undefined || visited !== value) { - if (updated === undefined) { - updated = ts.getMutableClone(node); - } - if (visited !== value) { - updated[edge.name] = visited; - } - } - } - } - } - return updated ? ts.updateNode(updated, node) : node; + return node; } - // return node; } ts.visitEachChild = visitEachChild; + /** + * Extracts the single node from a NodeArray. + * + * @param nodes The NodeArray. + */ + function extractSingleNode(nodes) { + ts.Debug.assert(nodes.length <= 1, "Too many nodes written to output."); + return ts.singleOrUndefined(nodes); + } +})(ts || (ts = {})); +/* @internal */ +(function (ts) { + function reduceNode(node, f, initial) { + return node ? f(initial, node) : initial; + } + function reduceNodeArray(nodes, f, initial) { + return nodes ? f(initial, nodes) : initial; + } + /** + * Similar to `reduceLeft`, performs a reduction against each child of a node. + * NOTE: Unlike `forEachChild`, this does *not* visit every node. + * + * @param node The node containing the children to reduce. + * @param initial The initial value to supply to the reduction. + * @param f The callback function + */ + function reduceEachChild(node, initial, cbNode, cbNodeArray) { + if (node === undefined) { + return initial; + } + var reduceNodes = cbNodeArray ? reduceNodeArray : ts.reduceLeft; + var cbNodes = cbNodeArray || cbNode; + var kind = node.kind; + // No need to visit nodes with no children. + if ((kind > 0 /* FirstToken */ && kind <= 141 /* LastToken */)) { + return initial; + } + // We do not yet support types. + if ((kind >= 157 /* TypePredicate */ && kind <= 172 /* LiteralType */)) { + return initial; + } + var result = initial; + switch (node.kind) { + // Leaf nodes + case 205 /* SemicolonClassElement */: + case 208 /* EmptyStatement */: + case 199 /* OmittedExpression */: + case 224 /* DebuggerStatement */: + case 294 /* NotEmittedStatement */: + // No need to visit nodes with no children. + break; + // Names + case 142 /* QualifiedName */: + result = reduceNode(node.left, cbNode, result); + result = reduceNode(node.right, cbNode, result); + break; + case 143 /* ComputedPropertyName */: + result = reduceNode(node.expression, cbNode, result); + break; + // Signature elements + case 145 /* Parameter */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + case 146 /* Decorator */: + result = reduceNode(node.expression, cbNode, result); + break; + // Type member + case 148 /* PropertyDeclaration */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + case 150 /* MethodDeclaration */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.typeParameters, cbNodes, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.body, cbNode, result); + break; + case 151 /* Constructor */: + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.body, cbNode, result); + break; + case 152 /* GetAccessor */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.body, cbNode, result); + break; + case 153 /* SetAccessor */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.body, cbNode, result); + break; + // Binding patterns + case 173 /* ObjectBindingPattern */: + case 174 /* ArrayBindingPattern */: + result = reduceNodes(node.elements, cbNodes, result); + break; + case 175 /* BindingElement */: + result = reduceNode(node.propertyName, cbNode, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + // Expression + case 176 /* ArrayLiteralExpression */: + result = reduceNodes(node.elements, cbNodes, result); + break; + case 177 /* ObjectLiteralExpression */: + result = reduceNodes(node.properties, cbNodes, result); + break; + case 178 /* PropertyAccessExpression */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.name, cbNode, result); + break; + case 179 /* ElementAccessExpression */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.argumentExpression, cbNode, result); + break; + case 180 /* CallExpression */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNodes(node.typeArguments, cbNodes, result); + result = reduceNodes(node.arguments, cbNodes, result); + break; + case 181 /* NewExpression */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNodes(node.typeArguments, cbNodes, result); + result = reduceNodes(node.arguments, cbNodes, result); + break; + case 182 /* TaggedTemplateExpression */: + result = reduceNode(node.tag, cbNode, result); + result = reduceNode(node.template, cbNode, result); + break; + case 183 /* TypeAssertionExpression */: + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.expression, cbNode, result); + break; + case 185 /* FunctionExpression */: + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.typeParameters, cbNodes, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.body, cbNode, result); + break; + case 186 /* ArrowFunction */: + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNodes(node.typeParameters, cbNodes, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.body, cbNode, result); + break; + case 184 /* ParenthesizedExpression */: + case 187 /* DeleteExpression */: + case 188 /* TypeOfExpression */: + case 189 /* VoidExpression */: + case 190 /* AwaitExpression */: + case 196 /* YieldExpression */: + case 197 /* SpreadElement */: + case 202 /* NonNullExpression */: + result = reduceNode(node.expression, cbNode, result); + break; + case 191 /* PrefixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: + result = reduceNode(node.operand, cbNode, result); + break; + case 193 /* BinaryExpression */: + result = reduceNode(node.left, cbNode, result); + result = reduceNode(node.right, cbNode, result); + break; + case 194 /* ConditionalExpression */: + result = reduceNode(node.condition, cbNode, result); + result = reduceNode(node.whenTrue, cbNode, result); + result = reduceNode(node.whenFalse, cbNode, result); + break; + case 195 /* TemplateExpression */: + result = reduceNode(node.head, cbNode, result); + result = reduceNodes(node.templateSpans, cbNodes, result); + break; + case 198 /* ClassExpression */: + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.typeParameters, cbNodes, result); + result = reduceNodes(node.heritageClauses, cbNodes, result); + result = reduceNodes(node.members, cbNodes, result); + break; + case 200 /* ExpressionWithTypeArguments */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNodes(node.typeArguments, cbNodes, result); + break; + case 201 /* AsExpression */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.type, cbNode, result); + break; + case 202 /* NonNullExpression */: + result = reduceNode(node.expression, cbNode, result); + break; + // Misc + case 204 /* TemplateSpan */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.literal, cbNode, result); + break; + // Element + case 206 /* Block */: + result = reduceNodes(node.statements, cbNodes, result); + break; + case 207 /* VariableStatement */: + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.declarationList, cbNode, result); + break; + case 209 /* ExpressionStatement */: + result = reduceNode(node.expression, cbNode, result); + break; + case 210 /* IfStatement */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.thenStatement, cbNode, result); + result = reduceNode(node.elseStatement, cbNode, result); + break; + case 211 /* DoStatement */: + result = reduceNode(node.statement, cbNode, result); + result = reduceNode(node.expression, cbNode, result); + break; + case 212 /* WhileStatement */: + case 219 /* WithStatement */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.statement, cbNode, result); + break; + case 213 /* ForStatement */: + result = reduceNode(node.initializer, cbNode, result); + result = reduceNode(node.condition, cbNode, result); + result = reduceNode(node.incrementor, cbNode, result); + result = reduceNode(node.statement, cbNode, result); + break; + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: + result = reduceNode(node.initializer, cbNode, result); + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.statement, cbNode, result); + break; + case 218 /* ReturnStatement */: + case 222 /* ThrowStatement */: + result = reduceNode(node.expression, cbNode, result); + break; + case 220 /* SwitchStatement */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.caseBlock, cbNode, result); + break; + case 221 /* LabeledStatement */: + result = reduceNode(node.label, cbNode, result); + result = reduceNode(node.statement, cbNode, result); + break; + case 223 /* TryStatement */: + result = reduceNode(node.tryBlock, cbNode, result); + result = reduceNode(node.catchClause, cbNode, result); + result = reduceNode(node.finallyBlock, cbNode, result); + break; + case 225 /* VariableDeclaration */: + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + case 226 /* VariableDeclarationList */: + result = reduceNodes(node.declarations, cbNodes, result); + break; + case 227 /* FunctionDeclaration */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.typeParameters, cbNodes, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.body, cbNode, result); + break; + case 228 /* ClassDeclaration */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.typeParameters, cbNodes, result); + result = reduceNodes(node.heritageClauses, cbNodes, result); + result = reduceNodes(node.members, cbNodes, result); + break; + case 231 /* EnumDeclaration */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.members, cbNodes, result); + break; + case 232 /* ModuleDeclaration */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.body, cbNode, result); + break; + case 233 /* ModuleBlock */: + result = reduceNodes(node.statements, cbNodes, result); + break; + case 234 /* CaseBlock */: + result = reduceNodes(node.clauses, cbNodes, result); + break; + case 236 /* ImportEqualsDeclaration */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.moduleReference, cbNode, result); + break; + case 237 /* ImportDeclaration */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.importClause, cbNode, result); + result = reduceNode(node.moduleSpecifier, cbNode, result); + break; + case 238 /* ImportClause */: + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.namedBindings, cbNode, result); + break; + case 239 /* NamespaceImport */: + result = reduceNode(node.name, cbNode, result); + break; + case 240 /* NamedImports */: + case 244 /* NamedExports */: + result = reduceNodes(node.elements, cbNodes, result); + break; + case 241 /* ImportSpecifier */: + case 245 /* ExportSpecifier */: + result = reduceNode(node.propertyName, cbNode, result); + result = reduceNode(node.name, cbNode, result); + break; + case 242 /* ExportAssignment */: + result = ts.reduceLeft(node.decorators, cbNode, result); + result = ts.reduceLeft(node.modifiers, cbNode, result); + result = reduceNode(node.expression, cbNode, result); + break; + case 243 /* ExportDeclaration */: + result = ts.reduceLeft(node.decorators, cbNode, result); + result = ts.reduceLeft(node.modifiers, cbNode, result); + result = reduceNode(node.exportClause, cbNode, result); + result = reduceNode(node.moduleSpecifier, cbNode, result); + break; + // Module references + case 247 /* ExternalModuleReference */: + result = reduceNode(node.expression, cbNode, result); + break; + // JSX + case 248 /* JsxElement */: + result = reduceNode(node.openingElement, cbNode, result); + result = ts.reduceLeft(node.children, cbNode, result); + result = reduceNode(node.closingElement, cbNode, result); + break; + case 249 /* JsxSelfClosingElement */: + case 250 /* JsxOpeningElement */: + result = reduceNode(node.tagName, cbNode, result); + result = reduceNode(node.attributes, cbNode, result); + break; + case 253 /* JsxAttributes */: + result = reduceNodes(node.properties, cbNodes, result); + break; + case 251 /* JsxClosingElement */: + result = reduceNode(node.tagName, cbNode, result); + break; + case 252 /* JsxAttribute */: + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + case 254 /* JsxSpreadAttribute */: + result = reduceNode(node.expression, cbNode, result); + break; + case 255 /* JsxExpression */: + result = reduceNode(node.expression, cbNode, result); + break; + // Clauses + case 256 /* CaseClause */: + result = reduceNode(node.expression, cbNode, result); + // falls through + case 257 /* DefaultClause */: + result = reduceNodes(node.statements, cbNodes, result); + break; + case 258 /* HeritageClause */: + result = reduceNodes(node.types, cbNodes, result); + break; + case 259 /* CatchClause */: + result = reduceNode(node.variableDeclaration, cbNode, result); + result = reduceNode(node.block, cbNode, result); + break; + // Property assignments + case 260 /* PropertyAssignment */: + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + case 261 /* ShorthandPropertyAssignment */: + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.objectAssignmentInitializer, cbNode, result); + break; + case 262 /* SpreadAssignment */: + result = reduceNode(node.expression, cbNode, result); + break; + // Enum + case 263 /* EnumMember */: + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + // Top-level nodes + case 264 /* SourceFile */: + result = reduceNodes(node.statements, cbNodes, result); + break; + // Transformation nodes + case 295 /* PartiallyEmittedExpression */: + result = reduceNode(node.expression, cbNode, result); + break; + default: + break; + } + return result; + } + ts.reduceEachChild = reduceEachChild; function mergeLexicalEnvironment(statements, declarations) { if (!ts.some(declarations)) { return statements; } return ts.isNodeArray(statements) - ? ts.createNodeArray(ts.concatenate(statements, declarations), statements) + ? ts.setTextRange(ts.createNodeArray(ts.concatenate(statements, declarations)), statements) : ts.addRange(statements, declarations); } ts.mergeLexicalEnvironment = mergeLexicalEnvironment; - function mergeFunctionBodyLexicalEnvironment(body, declarations) { - if (body && declarations !== undefined && declarations.length > 0) { - if (ts.isBlock(body)) { - return ts.updateBlock(body, ts.createNodeArray(ts.concatenate(body.statements, declarations), body.statements)); - } - else { - return ts.createBlock(ts.createNodeArray([ts.createReturn(body, /*location*/ body)].concat(declarations), body), - /*location*/ body, - /*multiLine*/ true); - } - } - return body; - } - ts.mergeFunctionBodyLexicalEnvironment = mergeFunctionBodyLexicalEnvironment; /** * Lifts a NodeArray containing only Statement nodes to a block. * @@ -44575,15 +48129,6 @@ var ts; return ts.singleOrUndefined(nodes) || ts.createBlock(nodes); } ts.liftToBlock = liftToBlock; - /** - * Extracts the single node from a NodeArray. - * - * @param nodes The NodeArray. - */ - function extractSingleNode(nodes) { - Debug.assert(nodes.length <= 1, "Too many nodes written to output."); - return ts.singleOrUndefined(nodes); - } /** * Aggregates the TransformFlags for a Node and its subtree. */ @@ -44629,7 +48174,7 @@ var ts; function aggregateTransformFlagsForSubtree(node) { // We do not transform ambient declarations or types, so there is no need to // recursively aggregate transform flags. - if (ts.hasModifier(node, 2 /* Ambient */) || ts.isTypeNode(node)) { + if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 200 /* ExpressionWithTypeArguments */)) { return 0 /* None */; } // Aggregate the transform flags of each child. @@ -44647,9 +48192,6 @@ var ts; } var Debug; (function (Debug) { - Debug.failNotOptional = Debug.shouldAssert(1 /* Normal */) - ? function (message) { return Debug.assert(false, message || "Node not optional."); } - : ts.noop; Debug.failBadSyntaxKind = Debug.shouldAssert(1 /* Normal */) ? function (node, message) { return Debug.assert(false, message || "Unexpected node.", function () { return "Node " + ts.formatSyntaxKind(node.kind) + " was unexpected."; }); } : ts.noop; @@ -44682,7 +48224,6 @@ var ts; } } })(Debug = ts.Debug || (ts.Debug = {})); - var _a; })(ts || (ts = {})); /// /// @@ -44710,7 +48251,7 @@ var ts; var value; if (ts.isDestructuringAssignment(node)) { value = node.right; - while (ts.isEmptyObjectLiteralOrArrayLiteral(node.left)) { + while (ts.isEmptyArrayLiteral(node.left) || ts.isEmptyObjectLiteral(node.left)) { if (ts.isDestructuringAssignment(value)) { location = node = value; value = node.right; @@ -44724,6 +48265,7 @@ var ts; var flattenContext = { context: context, level: level, + downlevelIteration: context.getCompilerOptions().downlevelIteration, hoistTempVariables: true, emitExpression: emitExpression, emitBindingOrAssignment: emitBindingOrAssignment, @@ -44772,7 +48314,7 @@ var ts; ts.Debug.assertNode(target, createAssignmentCallback ? ts.isIdentifier : ts.isExpression); var expression = createAssignmentCallback ? createAssignmentCallback(target, value, location) - : ts.createAssignment(ts.visitNode(target, visitor, ts.isExpression), value, location); + : ts.setTextRange(ts.createAssignment(ts.visitNode(target, visitor, ts.isExpression), value), location); expression.original = original; emitExpression(expression); } @@ -44796,6 +48338,7 @@ var ts; var flattenContext = { context: context, level: level, + downlevelIteration: context.getCompilerOptions().downlevelIteration, hoistTempVariables: hoistTempVariables, emitExpression: emitExpression, emitBindingOrAssignment: emitBindingOrAssignment, @@ -44821,11 +48364,12 @@ var ts; } } for (var _i = 0, pendingDeclarations_1 = pendingDeclarations; _i < pendingDeclarations_1.length; _i++) { - var _a = pendingDeclarations_1[_i], pendingExpressions_1 = _a.pendingExpressions, name_29 = _a.name, value = _a.value, location_2 = _a.location, original = _a.original; - var variable = ts.createVariableDeclaration(name_29, - /*type*/ undefined, pendingExpressions_1 ? ts.inlineExpressions(ts.append(pendingExpressions_1, value)) : value, location_2); + var _a = pendingDeclarations_1[_i], pendingExpressions_1 = _a.pendingExpressions, name = _a.name, value = _a.value, location = _a.location, original = _a.original; + var variable = ts.createVariableDeclaration(name, + /*type*/ undefined, pendingExpressions_1 ? ts.inlineExpressions(ts.append(pendingExpressions_1, value)) : value); variable.original = original; - if (ts.isIdentifier(name_29)) { + ts.setTextRange(variable, location); + if (ts.isIdentifier(name)) { ts.setEmitFlags(variable, 64 /* NoNestedSourceMaps */); } ts.aggregateTransformFlags(variable); @@ -44947,7 +48491,14 @@ var ts; function flattenArrayBindingOrAssignmentPattern(flattenContext, parent, pattern, value, location) { var elements = ts.getElementsOfBindingOrAssignmentPattern(pattern); var numElements = elements.length; - if (numElements !== 1 && (flattenContext.level < 1 /* ObjectRest */ || numElements === 0)) { + if (flattenContext.level < 1 /* ObjectRest */ && flattenContext.downlevelIteration) { + // Read the elements of the iterable into an array + value = ensureIdentifier(flattenContext, ts.createReadHelper(flattenContext.context, value, numElements > 0 && ts.getRestIndicatorOfBindingOrAssignmentElement(elements[numElements - 1]) + ? undefined + : numElements, location), + /*reuseIdentifierExpressions*/ false, location); + } + else if (numElements !== 1 && (flattenContext.level < 1 /* ObjectRest */ || numElements === 0)) { // For anything other than a single-element destructuring we need to generate a temporary // to ensure value is evaluated exactly once. Additionally, if we have zero elements // we need to emit *something* to ensure that in case a 'var' keyword was already emitted, @@ -45029,8 +48580,8 @@ var ts; return ts.createElementAccess(value, argumentExpression); } else { - var name_30 = ts.createIdentifier(ts.unescapeIdentifier(propertyName.text)); - return ts.createPropertyAccess(value, name_30); + var name = ts.createIdentifier(ts.unescapeIdentifier(propertyName.text)); + return ts.createPropertyAccess(value, name); } } /** @@ -45052,7 +48603,7 @@ var ts; var temp = ts.createTempVariable(/*recordTempVariable*/ undefined); if (flattenContext.hoistTempVariables) { flattenContext.context.hoistVariableDeclaration(temp); - flattenContext.emitExpression(ts.createAssignment(temp, value, location)); + flattenContext.emitExpression(ts.setTextRange(ts.createAssignment(temp, value), location)); } else { flattenContext.emitBindingOrAssignment(temp, value, location, /*original*/ undefined); @@ -45075,7 +48626,7 @@ var ts; return ts.createObjectLiteral(ts.map(elements, ts.convertToObjectAssignmentElement)); } function makeBindingElement(name) { - return ts.createBindingElement(/*propertyName*/ undefined, /*dotDotDotToken*/ undefined, name); + return ts.createBindingElement(/*dotDotDotToken*/ undefined, /*propertyName*/ undefined, name); } function makeAssignmentElement(name) { return name; @@ -45083,10 +48634,11 @@ var ts; var restHelper = { name: "typescript:rest", scoped: false, - text: "\n var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\n t[p[i]] = s[p[i]];\n return t;\n };" + text: "\n var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\n t[p[i]] = s[p[i]];\n return t;\n };" }; /** Given value: o, propName: p, pattern: { a, b, ...p } from the original statement - * `{ a, b, ...p } = o`, create `p = __rest(o, ["a", "b"]);`*/ + * `{ a, b, ...p } = o`, create `p = __rest(o, ["a", "b"]);` + */ function createRestCall(context, value, elements, computedTempVariables, location) { context.requestEmitHelper(restHelper); var propertyNames = []; @@ -45105,7 +48657,11 @@ var ts; } } } - return ts.createCall(ts.getHelperName("__rest"), undefined, [value, ts.createArrayLiteral(propertyNames, location)]); + return ts.createCall(ts.getHelperName("__rest"), + /*typeArguments*/ undefined, [ + value, + ts.setTextRange(ts.createArrayLiteral(propertyNames), location) + ]); } })(ts || (ts = {})); /// @@ -45140,8 +48696,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(177 /* PropertyAccessExpression */); - context.enableSubstitution(178 /* ElementAccessExpression */); + context.enableSubstitution(178 /* PropertyAccessExpression */); + context.enableSubstitution(179 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -45205,15 +48761,15 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 261 /* SourceFile */: - case 232 /* CaseBlock */: - case 231 /* ModuleBlock */: - case 204 /* Block */: + case 264 /* SourceFile */: + case 234 /* CaseBlock */: + case 233 /* ModuleBlock */: + case 206 /* Block */: currentScope = node; currentScopeFirstDeclarationsOfName = undefined; break; - case 226 /* ClassDeclaration */: - case 225 /* FunctionDeclaration */: + case 228 /* ClassDeclaration */: + case 227 /* FunctionDeclaration */: if (ts.hasModifier(node, 2 /* Ambient */)) { break; } @@ -45260,13 +48816,13 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 235 /* ImportDeclaration */: + case 237 /* ImportDeclaration */: return visitImportDeclaration(node); - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: return visitExportAssignment(node); - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: return visitExportDeclaration(node); default: return visitorWorker(node); @@ -45286,11 +48842,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 241 /* ExportDeclaration */ || - node.kind === 235 /* ImportDeclaration */ || - node.kind === 236 /* ImportClause */ || - (node.kind === 234 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 245 /* ExternalModuleReference */)) { + if (node.kind === 243 /* ExportDeclaration */ || + node.kind === 237 /* ImportDeclaration */ || + node.kind === 238 /* ImportClause */ || + (node.kind === 236 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 247 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -45320,19 +48876,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 150 /* Constructor */: + case 151 /* Constructor */: // TypeScript constructors are transformed in `visitClassDeclaration`. // We elide them here as `visitorWorker` checks transform flags, which could // erronously include an ES6 constructor without TypeScript syntax. return undefined; - case 147 /* PropertyDeclaration */: - case 155 /* IndexSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 149 /* MethodDeclaration */: + case 148 /* PropertyDeclaration */: + case 156 /* IndexSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 150 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 203 /* SemicolonClassElement */: + case 205 /* SemicolonClassElement */: return node; default: ts.Debug.failBadSyntaxKind(node); @@ -45372,46 +48928,47 @@ var ts; case 123 /* DeclareKeyword */: case 130 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided. - case 162 /* ArrayType */: - case 163 /* TupleType */: - case 161 /* TypeLiteral */: - case 156 /* TypePredicate */: - case 143 /* TypeParameter */: + case 163 /* ArrayType */: + case 164 /* TupleType */: + case 162 /* TypeLiteral */: + case 157 /* TypePredicate */: + case 144 /* TypeParameter */: case 118 /* AnyKeyword */: case 121 /* BooleanKeyword */: - case 134 /* StringKeyword */: + case 135 /* StringKeyword */: case 132 /* NumberKeyword */: case 129 /* NeverKeyword */: case 104 /* VoidKeyword */: - case 135 /* SymbolKeyword */: - case 159 /* ConstructorType */: - case 158 /* FunctionType */: - case 160 /* TypeQuery */: - case 157 /* TypeReference */: - case 164 /* UnionType */: - case 165 /* IntersectionType */: - case 166 /* ParenthesizedType */: - case 167 /* ThisType */: - case 168 /* TypeOperator */: - case 169 /* IndexedAccessType */: - case 170 /* MappedType */: - case 171 /* LiteralType */: + case 136 /* SymbolKeyword */: + case 160 /* ConstructorType */: + case 159 /* FunctionType */: + case 161 /* TypeQuery */: + case 158 /* TypeReference */: + case 165 /* UnionType */: + case 166 /* IntersectionType */: + case 167 /* ParenthesizedType */: + case 168 /* ThisType */: + case 169 /* TypeOperator */: + case 170 /* IndexedAccessType */: + case 171 /* MappedType */: + case 172 /* LiteralType */: // TypeScript type nodes are elided. - case 155 /* IndexSignature */: + case 156 /* IndexSignature */: // TypeScript index signatures are elided. - case 145 /* Decorator */: + case 146 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. - case 228 /* TypeAliasDeclaration */: + case 230 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. - case 147 /* PropertyDeclaration */: - // TypeScript property declarations are elided. - case 150 /* Constructor */: + case 148 /* PropertyDeclaration */: + // TypeScript property declarations are elided. + return undefined; + case 151 /* Constructor */: return visitConstructor(node); - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: // TypeScript interfaces are elided, but some comments may be preserved. // See the implementation of `getLeadingComments` in comments.ts for more details. return ts.createNotEmittedStatement(node); - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: // This is a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -45422,7 +48979,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 197 /* ClassExpression */: + case 198 /* ClassExpression */: // This is a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -45433,35 +48990,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 255 /* HeritageClause */: + case 258 /* HeritageClause */: // This is a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 199 /* ExpressionWithTypeArguments */: + case 200 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 149 /* MethodDeclaration */: + case 150 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 151 /* GetAccessor */: + case 152 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 152 /* SetAccessor */: + case 153 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 184 /* FunctionExpression */: + case 185 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 185 /* ArrowFunction */: + case 186 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 144 /* Parameter */: + case 145 /* Parameter */: // This is a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -45471,33 +49028,33 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 182 /* TypeAssertionExpression */: - case 200 /* AsExpression */: + case 183 /* TypeAssertionExpression */: + case 201 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 179 /* CallExpression */: + case 180 /* CallExpression */: return visitCallExpression(node); - case 180 /* NewExpression */: + case 181 /* NewExpression */: return visitNewExpression(node); - case 201 /* NonNullExpression */: + case 202 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 223 /* VariableDeclaration */: + case 225 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); default: @@ -45506,7 +49063,8 @@ var ts; } } function visitSourceFile(node) { - var alwaysStrict = compilerOptions.alwaysStrict && !(ts.isExternalModule(node) && moduleKind === ts.ModuleKind.ES2015); + var alwaysStrict = (compilerOptions.alwaysStrict === undefined ? compilerOptions.strict : compilerOptions.alwaysStrict) && + !(ts.isExternalModule(node) && moduleKind === ts.ModuleKind.ES2015); return ts.updateSourceFileNode(node, ts.visitLexicalEnvironment(node.statements, sourceElementVisitor, context, /*start*/ 0, alwaysStrict)); } /** @@ -45602,13 +49160,14 @@ var ts; // } var classDeclaration = ts.createClassDeclaration( /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), name, - /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), transformClassMembers(node, hasExtendsClause), node); - var emitFlags = ts.getEmitFlags(node); + /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), transformClassMembers(node, hasExtendsClause)); // To better align with the old emitter, we should not emit a trailing source map // entry if the class has static properties. + var emitFlags = ts.getEmitFlags(node); if (hasStaticProperties) { emitFlags |= 32 /* NoTrailingSourceMap */; } + ts.setTextRange(classDeclaration, node); ts.setOriginalNode(classDeclaration, node); ts.setEmitFlags(classDeclaration, emitFlags); return classDeclaration; @@ -45716,12 +49275,18 @@ var ts; // } var heritageClauses = ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause); var members = transformClassMembers(node, hasExtendsClause); - var classExpression = ts.createClassExpression(/*modifiers*/ undefined, name, /*typeParameters*/ undefined, heritageClauses, members, location); + var classExpression = ts.createClassExpression(/*modifiers*/ undefined, name, /*typeParameters*/ undefined, heritageClauses, members); ts.setOriginalNode(classExpression, node); + ts.setTextRange(classExpression, location); // let ${name} = ${classExpression} where name is either declaredName if the class doesn't contain self-reference // or decoratedClassAlias if the class contain self-reference. - var statement = ts.createLetStatement(declName, classAlias ? ts.createAssignment(classAlias, classExpression) : classExpression, location); + var statement = ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration(declName, + /*type*/ undefined, classAlias ? ts.createAssignment(classAlias, classExpression) : classExpression) + ], 1 /* Let */)); ts.setOriginalNode(statement, node); + ts.setTextRange(statement, location); ts.setCommentRange(statement, node); return statement; } @@ -45738,10 +49303,11 @@ var ts; var staticProperties = getInitializedProperties(node, /*isStatic*/ true); var heritageClauses = ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause); var members = transformClassMembers(node, ts.some(heritageClauses, function (c) { return c.token === 84 /* ExtendsKeyword */; })); - var classExpression = ts.setOriginalNode(ts.createClassExpression( + var classExpression = ts.createClassExpression( /*modifiers*/ undefined, node.name, - /*typeParameters*/ undefined, heritageClauses, members, - /*location*/ node), node); + /*typeParameters*/ undefined, heritageClauses, members); + ts.setOriginalNode(classExpression, node); + ts.setTextRange(classExpression, node); if (staticProperties.length > 0) { var expressions = []; var temp = ts.createTempVariable(hoistVariableDeclaration); @@ -45773,7 +49339,7 @@ var ts; members.push(constructor); } ts.addRange(members, ts.visitNodes(node.members, classElementVisitor, ts.isClassElement)); - return ts.createNodeArray(members, /*location*/ node.members); + return ts.setTextRange(ts.createNodeArray(members), /*location*/ node.members); } /** * Transforms (or creates) a constructor for a class. @@ -45798,10 +49364,9 @@ var ts; // constructor(${parameters}) { // ${body} // } - return ts.startOnNewLine(ts.setOriginalNode(ts.createConstructor( + return ts.startOnNewLine(ts.setOriginalNode(ts.setTextRange(ts.createConstructor( /*decorators*/ undefined, - /*modifiers*/ undefined, parameters, body, - /*location*/ constructor || node), constructor)); + /*modifiers*/ undefined, parameters, body), constructor || node), constructor)); } /** * Transforms (or creates) the parameters for the constructor of a class with @@ -45883,11 +49448,11 @@ var ts; ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, indexOfFirstStatement)); } // End the lexical environment. - ts.addRange(statements, endLexicalEnvironment()); - return ts.createBlock(ts.createNodeArray(statements, + statements = ts.mergeLexicalEnvironment(statements, endLexicalEnvironment()); + return ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), /*location*/ constructor ? constructor.body.statements : node.members), - /*location*/ constructor ? constructor.body : undefined, - /*multiLine*/ true); + /*multiLine*/ true), + /*location*/ constructor ? constructor.body : undefined); } /** * Adds super call and preceding prologue directives into the list of statements. @@ -45899,13 +49464,13 @@ var ts; if (ctor.body) { var statements = ctor.body.statements; // add prologue directives to the list (if any) - var index = ts.addPrologueDirectives(result, statements, /*ensureUseStrict*/ false, visitor); + var index = ts.addPrologue(result, statements, /*ensureUseStrict*/ false, visitor); if (index === statements.length) { // list contains nothing but prologue directives (or empty) - exit return index; } var statement = statements[index]; - if (statement.kind === 207 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 209 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { result.push(ts.visitNode(statement, visitor, ts.isStatement)); return index + 1; } @@ -45942,9 +49507,7 @@ var ts; ts.setEmitFlags(propertyName, 1536 /* NoComments */ | 48 /* NoSourceMap */); var localName = ts.getMutableClone(name); ts.setEmitFlags(localName, 1536 /* NoComments */); - return ts.startOnNewLine(ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createThis(), propertyName, - /*location*/ node.name), localName), - /*location*/ ts.moveRangePos(node, -1))); + return ts.startOnNewLine(ts.setTextRange(ts.createStatement(ts.createAssignment(ts.setTextRange(ts.createPropertyAccess(ts.createThis(), propertyName), node.name), localName)), ts.moveRangePos(node, -1))); } /** * Gets all property declarations with initializers on either the static or instance side of a class. @@ -45978,7 +49541,7 @@ var ts; * @param isStatic A value indicating whether the member should be a static or instance member. */ function isInitializedProperty(member, isStatic) { - return member.kind === 147 /* PropertyDeclaration */ + return member.kind === 148 /* PropertyDeclaration */ && isStatic === ts.hasModifier(member, 32 /* Static */) && member.initializer !== undefined; } @@ -45989,8 +49552,8 @@ var ts; * @param receiver The receiver on which each property should be assigned. */ function addInitializedPropertyStatements(statements, properties, receiver) { - for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) { - var property = properties_7[_i]; + for (var _i = 0, properties_9 = properties; _i < properties_9.length; _i++) { + var property = properties_9[_i]; var statement = ts.createStatement(transformInitializedProperty(property, receiver)); ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property)); ts.setCommentRange(statement, property); @@ -46005,8 +49568,8 @@ var ts; */ function generateInitializedPropertyExpressions(properties, receiver) { var expressions = []; - for (var _i = 0, properties_8 = properties; _i < properties_8.length; _i++) { - var property = properties_8[_i]; + for (var _i = 0, properties_10 = properties; _i < properties_10.length; _i++) { + var property = properties_10[_i]; var expression = transformInitializedProperty(property, receiver); expression.startsOnNewLine = true; ts.setSourceMapRange(expression, ts.moveRangePastModifiers(property)); @@ -46113,12 +49676,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 149 /* MethodDeclaration */: + case 150 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 147 /* PropertyDeclaration */: + case 148 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -46135,10 +49698,11 @@ var ts; return undefined; } var _a = ts.getAllAccessorDeclarations(node.members, accessor), firstAccessor = _a.firstAccessor, secondAccessor = _a.secondAccessor, setAccessor = _a.setAccessor; - if (accessor !== firstAccessor) { + var firstAccessorWithDecorators = firstAccessor.decorators ? firstAccessor : secondAccessor && secondAccessor.decorators ? secondAccessor : undefined; + if (!firstAccessorWithDecorators || accessor !== firstAccessorWithDecorators) { return undefined; } - var decorators = firstAccessor.decorators || (secondAccessor && secondAccessor.decorators); + var decorators = firstAccessorWithDecorators.decorators; var parameters = getDecoratorsOfParameters(setAccessor); if (!decorators && !parameters) { return undefined; @@ -46179,14 +49743,14 @@ var ts; * @param node The declaration node. * @param allDecorators An object containing all of the decorators for the declaration. */ - function transformAllDecoratorsOfDeclaration(node, allDecorators) { + function transformAllDecoratorsOfDeclaration(node, container, allDecorators) { if (!allDecorators) { return undefined; } var decoratorExpressions = []; ts.addRange(decoratorExpressions, ts.map(allDecorators.decorators, transformDecorator)); ts.addRange(decoratorExpressions, ts.flatMap(allDecorators.parameters, transformDecoratorsOfParameter)); - addTypeMetadata(node, decoratorExpressions); + addTypeMetadata(node, container, decoratorExpressions); return decoratorExpressions; } /** @@ -46233,7 +49797,7 @@ var ts; */ function generateClassElementDecorationExpression(node, member) { var allDecorators = getAllDecoratorsOfClassElement(node, member); - var decoratorExpressions = transformAllDecoratorsOfDeclaration(member, allDecorators); + var decoratorExpressions = transformAllDecoratorsOfDeclaration(member, node, allDecorators); if (!decoratorExpressions) { return undefined; } @@ -46270,7 +49834,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 147 /* PropertyDeclaration */ + ? member.kind === 148 /* PropertyDeclaration */ ? ts.createVoidZero() : ts.createNull() : undefined; @@ -46296,7 +49860,7 @@ var ts; */ function generateConstructorDecorationExpression(node) { var allDecorators = getAllDecoratorsOfConstructor(node); - var decoratorExpressions = transformAllDecoratorsOfDeclaration(node, allDecorators); + var decoratorExpressions = transformAllDecoratorsOfDeclaration(node, node, allDecorators); if (!decoratorExpressions) { return undefined; } @@ -46342,41 +49906,41 @@ var ts; * @param node The declaration node. * @param decoratorExpressions The destination array to which to add new decorator expressions. */ - function addTypeMetadata(node, decoratorExpressions) { + function addTypeMetadata(node, container, decoratorExpressions) { if (USE_NEW_TYPE_METADATA_FORMAT) { - addNewTypeMetadata(node, decoratorExpressions); + addNewTypeMetadata(node, container, decoratorExpressions); } else { - addOldTypeMetadata(node, decoratorExpressions); + addOldTypeMetadata(node, container, decoratorExpressions); } } - function addOldTypeMetadata(node, decoratorExpressions) { + function addOldTypeMetadata(node, container, decoratorExpressions) { if (compilerOptions.emitDecoratorMetadata) { if (shouldAddTypeMetadata(node)) { decoratorExpressions.push(createMetadataHelper(context, "design:type", serializeTypeOfNode(node))); } if (shouldAddParamTypesMetadata(node)) { - decoratorExpressions.push(createMetadataHelper(context, "design:paramtypes", serializeParameterTypesOfNode(node))); + decoratorExpressions.push(createMetadataHelper(context, "design:paramtypes", serializeParameterTypesOfNode(node, container))); } if (shouldAddReturnTypeMetadata(node)) { decoratorExpressions.push(createMetadataHelper(context, "design:returntype", serializeReturnTypeOfNode(node))); } } } - function addNewTypeMetadata(node, decoratorExpressions) { + function addNewTypeMetadata(node, container, decoratorExpressions) { if (compilerOptions.emitDecoratorMetadata) { var properties = void 0; if (shouldAddTypeMetadata(node)) { (properties || (properties = [])).push(ts.createPropertyAssignment("type", ts.createArrowFunction(/*modifiers*/ undefined, /*typeParameters*/ undefined, [], /*type*/ undefined, ts.createToken(35 /* EqualsGreaterThanToken */), serializeTypeOfNode(node)))); } if (shouldAddParamTypesMetadata(node)) { - (properties || (properties = [])).push(ts.createPropertyAssignment("paramTypes", ts.createArrowFunction(/*modifiers*/ undefined, /*typeParameters*/ undefined, [], /*type*/ undefined, ts.createToken(35 /* EqualsGreaterThanToken */), serializeParameterTypesOfNode(node)))); + (properties || (properties = [])).push(ts.createPropertyAssignment("paramTypes", ts.createArrowFunction(/*modifiers*/ undefined, /*typeParameters*/ undefined, [], /*type*/ undefined, ts.createToken(35 /* EqualsGreaterThanToken */), serializeParameterTypesOfNode(node, container)))); } if (shouldAddReturnTypeMetadata(node)) { (properties || (properties = [])).push(ts.createPropertyAssignment("returnType", ts.createArrowFunction(/*modifiers*/ undefined, /*typeParameters*/ undefined, [], /*type*/ undefined, ts.createToken(35 /* EqualsGreaterThanToken */), serializeReturnTypeOfNode(node)))); } if (properties) { - decoratorExpressions.push(createMetadataHelper(context, "design:typeinfo", ts.createObjectLiteral(properties, /*location*/ undefined, /*multiLine*/ true))); + decoratorExpressions.push(createMetadataHelper(context, "design:typeinfo", ts.createObjectLiteral(properties, /*multiLine*/ true))); } } } @@ -46389,10 +49953,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 149 /* MethodDeclaration */ - || kind === 151 /* GetAccessor */ - || kind === 152 /* SetAccessor */ - || kind === 147 /* PropertyDeclaration */; + return kind === 150 /* MethodDeclaration */ + || kind === 152 /* GetAccessor */ + || kind === 153 /* SetAccessor */ + || kind === 148 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -46402,7 +49966,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 149 /* MethodDeclaration */; + return node.kind === 150 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -46412,12 +49976,16 @@ var ts; * @param node The node to test. */ function shouldAddParamTypesMetadata(node) { - var kind = node.kind; - return kind === 226 /* ClassDeclaration */ - || kind === 197 /* ClassExpression */ - || kind === 149 /* MethodDeclaration */ - || kind === 151 /* GetAccessor */ - || kind === 152 /* SetAccessor */; + switch (node.kind) { + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + return ts.getFirstConstructorWithBody(node) !== undefined; + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + return true; + } + return false; } /** * Serializes the type of a node for use with decorator type metadata. @@ -46426,43 +49994,26 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 147 /* PropertyDeclaration */: - case 144 /* Parameter */: - case 151 /* GetAccessor */: + case 148 /* PropertyDeclaration */: + case 145 /* Parameter */: + case 152 /* GetAccessor */: return serializeTypeNode(node.type); - case 152 /* SetAccessor */: + case 153 /* SetAccessor */: return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node)); - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 149 /* MethodDeclaration */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 150 /* MethodDeclaration */: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); } } - /** - * Gets the most likely element type for a TypeNode. This is not an exhaustive test - * as it assumes a rest argument can only be an array type (either T[], or Array). - * - * @param node The type node. - */ - function getRestParameterElementType(node) { - if (node && node.kind === 162 /* ArrayType */) { - return node.elementType; - } - else if (node && node.kind === 157 /* TypeReference */) { - return ts.singleOrUndefined(node.typeArguments); - } - else { - return undefined; - } - } /** * Serializes the types of the parameters of a node for use with decorator type metadata. * * @param node The node that should have its parameter types serialized. */ - function serializeParameterTypesOfNode(node) { + function serializeParameterTypesOfNode(node, container) { var valueDeclaration = ts.isClassLike(node) ? ts.getFirstConstructorWithBody(node) : ts.isFunctionLike(node) && ts.nodeIsPresent(node.body) @@ -46470,7 +50021,7 @@ var ts; : undefined; var expressions = []; if (valueDeclaration) { - var parameters = valueDeclaration.parameters; + var parameters = getParametersOfDecoratedDeclaration(valueDeclaration, container); var numParameters = parameters.length; for (var i = 0; i < numParameters; i++) { var parameter = parameters[i]; @@ -46478,7 +50029,7 @@ var ts; continue; } if (parameter.dotDotDotToken) { - expressions.push(serializeTypeNode(getRestParameterElementType(parameter.type))); + expressions.push(serializeTypeNode(ts.getRestParameterElementType(parameter.type))); } else { expressions.push(serializeTypeOfNode(parameter)); @@ -46487,6 +50038,15 @@ var ts; } return ts.createArrayLiteral(expressions); } + function getParametersOfDecoratedDeclaration(node, container) { + if (container && node.kind === 152 /* GetAccessor */) { + var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; + if (setAccessor) { + return setAccessor.parameters; + } + } + return node.parameters; + } /** * Serializes the return type of a node for use with decorator type metadata. * @@ -46496,7 +50056,7 @@ var ts; if (ts.isFunctionLike(node) && node.type) { return serializeTypeNode(node.type); } - else if (ts.isAsyncFunctionLike(node)) { + else if (ts.isAsyncFunction(node)) { return ts.createIdentifier("Promise"); } return ts.createVoidZero(); @@ -46525,21 +50085,26 @@ var ts; } switch (node.kind) { case 104 /* VoidKeyword */: + case 138 /* UndefinedKeyword */: + case 94 /* NullKeyword */: + case 129 /* NeverKeyword */: return ts.createVoidZero(); - case 166 /* ParenthesizedType */: + case 167 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 158 /* FunctionType */: - case 159 /* ConstructorType */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: return ts.createIdentifier("Function"); - case 162 /* ArrayType */: - case 163 /* TupleType */: + case 163 /* ArrayType */: + case 164 /* TupleType */: return ts.createIdentifier("Array"); - case 156 /* TypePredicate */: + case 157 /* TypePredicate */: case 121 /* BooleanKeyword */: return ts.createIdentifier("Boolean"); - case 134 /* StringKeyword */: + case 135 /* StringKeyword */: return ts.createIdentifier("String"); - case 171 /* LiteralType */: + case 133 /* ObjectKeyword */: + return ts.createIdentifier("Object"); + case 172 /* LiteralType */: switch (node.literal.kind) { case 9 /* StringLiteral */: return ts.createIdentifier("String"); @@ -46555,49 +50120,22 @@ var ts; break; case 132 /* NumberKeyword */: return ts.createIdentifier("Number"); - case 135 /* SymbolKeyword */: + case 136 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 157 /* TypeReference */: + case 158 /* TypeReference */: return serializeTypeReferenceNode(node); - case 165 /* IntersectionType */: - case 164 /* UnionType */: - { - var unionOrIntersection = node; - var serializedUnion = void 0; - for (var _i = 0, _a = unionOrIntersection.types; _i < _a.length; _i++) { - var typeNode = _a[_i]; - var serializedIndividual = serializeTypeNode(typeNode); - // Non identifier - if (serializedIndividual.kind !== 70 /* Identifier */) { - serializedUnion = undefined; - break; - } - // One of the individual is global object, return immediately - if (serializedIndividual.text === "Object") { - return serializedIndividual; - } - // Different types - if (serializedUnion && serializedUnion.text !== serializedIndividual.text) { - serializedUnion = undefined; - break; - } - serializedUnion = serializedIndividual; - } - // If we were able to find common type - if (serializedUnion) { - return serializedUnion; - } - } - // Fallthrough - case 160 /* TypeQuery */: - case 168 /* TypeOperator */: - case 169 /* IndexedAccessType */: - case 170 /* MappedType */: - case 161 /* TypeLiteral */: + case 166 /* IntersectionType */: + case 165 /* UnionType */: + return serializeUnionOrIntersectionType(node); + case 161 /* TypeQuery */: + case 169 /* TypeOperator */: + case 170 /* IndexedAccessType */: + case 171 /* MappedType */: + case 162 /* TypeLiteral */: case 118 /* AnyKeyword */: - case 167 /* ThisType */: + case 168 /* ThisType */: break; default: ts.Debug.failBadSyntaxKind(node); @@ -46605,6 +50143,37 @@ var ts; } return ts.createIdentifier("Object"); } + function serializeUnionOrIntersectionType(node) { + var serializedUnion; + for (var _i = 0, _a = node.types; _i < _a.length; _i++) { + var typeNode = _a[_i]; + var serializedIndividual = serializeTypeNode(typeNode); + if (ts.isVoidExpression(serializedIndividual)) { + // If we dont have any other type already set, set the initial type + if (!serializedUnion) { + serializedUnion = serializedIndividual; + } + } + else if (ts.isIdentifier(serializedIndividual) && serializedIndividual.text === "Object") { + // One of the individual is global object, return immediately + return serializedIndividual; + } + else if (serializedUnion && !ts.isVoidExpression(serializedUnion)) { + // Different types + if (!ts.isIdentifier(serializedUnion) || + !ts.isIdentifier(serializedIndividual) || + serializedUnion.text !== serializedIndividual.text) { + return ts.createIdentifier("Object"); + } + } + else { + // Initialize the union type + serializedUnion = serializedIndividual; + } + } + // If we were able to find common type, use it + return serializedUnion; + } /** * Serializes a TypeReferenceNode to an appropriate JS constructor value for use with * decorator type metadata. @@ -46654,15 +50223,15 @@ var ts; case 70 /* Identifier */: // Create a clone of the name with a new parent, and treat it as if it were // a source tree node for the purposes of the checker. - var name_31 = ts.getMutableClone(node); - name_31.flags &= ~8 /* Synthesized */; - name_31.original = undefined; - name_31.parent = currentScope; + var name = ts.getMutableClone(node); + name.flags &= ~8 /* Synthesized */; + name.original = undefined; + name.parent = currentScope; if (useFallback) { - return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name_31), ts.createLiteral("undefined")), name_31); + return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name), ts.createLiteral("undefined")), name); } - return name_31; - case 141 /* QualifiedName */: + return name; + case 142 /* QualifiedName */: return serializeQualifiedNameAsExpression(node, useFallback); } } @@ -46708,7 +50277,7 @@ var ts; : name.expression; } else if (ts.isIdentifier(name)) { - return ts.createLiteral(name.text); + return ts.createLiteral(ts.unescapeIdentifier(name.text)); } else { return ts.getSynthesizedClone(name); @@ -46730,7 +50299,7 @@ var ts; hoistVariableDeclaration(generatedName); expression = ts.createAssignment(generatedName, expression); } - return ts.setOriginalNode(ts.createComputedPropertyName(expression, /*location*/ name), name); + return ts.updateComputedPropertyName(name, expression); } else { return name; @@ -46748,7 +50317,7 @@ var ts; function visitHeritageClause(node) { if (node.token === 84 /* ExtendsKeyword */) { var types = ts.visitNodes(node.types, visitor, ts.isExpressionWithTypeArguments, 0, 1); - return ts.createHeritageClause(84 /* ExtendsKeyword */, types, node); + return ts.setTextRange(ts.createHeritageClause(84 /* ExtendsKeyword */, types), node); } return undefined; } @@ -46761,9 +50330,8 @@ var ts; * @param node The ExpressionWithTypeArguments to transform. */ function visitExpressionWithTypeArguments(node) { - var expression = ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression); - return ts.createExpressionWithTypeArguments( - /*typeArguments*/ undefined, expression, node); + return ts.updateExpressionWithTypeArguments(node, + /*typeArguments*/ undefined, ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression)); } /** * Determines whether to emit a function-like declaration. We should not emit the @@ -46778,7 +50346,7 @@ var ts; if (!shouldEmitFunctionLikeDeclaration(node)) { return undefined; } - return ts.visitEachChild(node, visitor, context); + return ts.updateConstructor(node, ts.visitNodes(node.decorators, visitor, ts.isDecorator), ts.visitNodes(node.modifiers, visitor, ts.isModifier), ts.visitParameterList(node.parameters, visitor, context), ts.visitFunctionBody(node.body, visitor, context)); } /** * Visits a method declaration of a class. @@ -46795,7 +50363,8 @@ var ts; return undefined; } var updated = ts.updateMethod(node, - /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), visitPropertyNameOfClassElement(node), + /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, visitPropertyNameOfClassElement(node), + /*questionToken*/ undefined, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), /*type*/ undefined, ts.visitFunctionBody(node.body, visitor, context)); if (updated !== node) { @@ -46877,7 +50446,7 @@ var ts; return ts.createNotEmittedStatement(node); } var updated = ts.updateFunctionDeclaration(node, - /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.name, + /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, node.name, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), /*type*/ undefined, ts.visitFunctionBody(node.body, visitor, context) || ts.createBlock([])); if (isNamespaceExport(node)) { @@ -46896,12 +50465,12 @@ var ts; * @param node The function expression node. */ function visitFunctionExpression(node) { - if (ts.nodeIsMissing(node.body)) { + if (!shouldEmitFunctionLikeDeclaration(node)) { return ts.createOmittedExpression(); } - var updated = ts.updateFunctionExpression(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.name, + var updated = ts.updateFunctionExpression(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, node.name, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, ts.visitFunctionBody(node.body, visitor, context)); + /*type*/ undefined, ts.visitFunctionBody(node.body, visitor, context) || ts.createBlock([])); return updated; } /** @@ -46933,11 +50502,11 @@ var ts; /*decorators*/ undefined, /*modifiers*/ undefined, node.dotDotDotToken, ts.visitNode(node.name, visitor, ts.isBindingName), /*questionToken*/ undefined, - /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression), - /*location*/ ts.moveRangePastModifiers(node)); + /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)); // While we emit the source map for the node after skipping decorators and modifiers, // we need to emit the comments for the original range. ts.setOriginalNode(parameter, node); + ts.setTextRange(parameter, ts.moveRangePastModifiers(node)); ts.setCommentRange(parameter, node); ts.setSourceMapRange(parameter, ts.moveRangePastModifiers(node)); ts.setEmitFlags(parameter.name, 32 /* NoTrailingSourceMap */); @@ -46956,8 +50525,7 @@ var ts; // elide statement if there are no initialized variables. return undefined; } - return ts.createStatement(ts.inlineExpressions(ts.map(variables, transformInitializedVariable)), - /*location*/ node); + return ts.setTextRange(ts.createStatement(ts.inlineExpressions(ts.map(variables, transformInitializedVariable))), node); } else { return ts.visitEachChild(node, visitor, context); @@ -46970,7 +50538,7 @@ var ts; /*needsValue*/ false, createNamespaceExportExpression); } else { - return ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(name), ts.visitNode(node.initializer, visitor, ts.isExpression), + return ts.setTextRange(ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(name), ts.visitNode(node.initializer, visitor, ts.isExpression)), /*location*/ node); } } @@ -46996,13 +50564,13 @@ var ts; // code if the casted expression has a lower precedence than the rest of the // expression. // + // To preserve comments, we return a "PartiallyEmittedExpression" here which will + // preserve the position information of the original expression. + // // Due to the auto-parenthesization rules used by the visitor and factory functions // we can safely elide the parentheses here, as a new synthetic // ParenthesizedExpression will be inserted if we remove parentheses too // aggressively. - // - // To preserve comments, we return a "PartiallyEmittedExpression" here which will - // preserve the position information of the original expression. return ts.createPartiallyEmittedExpression(expression, node); } return ts.visitEachChild(node, visitor, context); @@ -47084,9 +50652,9 @@ var ts; /*name*/ undefined, /*typeParameters*/ undefined, [ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, parameterName)], /*type*/ undefined, transformEnumBody(node, containerName)), - /*typeArguments*/ undefined, [moduleArg]), - /*location*/ node); + /*typeArguments*/ undefined, [moduleArg])); ts.setOriginalNode(enumStatement, node); + ts.setTextRange(enumStatement, node); ts.setEmitFlags(enumStatement, emitFlags); statements.push(enumStatement); // Add a DeclarationMarker for the enum to preserve trailing comments and mark @@ -47107,8 +50675,7 @@ var ts; ts.addRange(statements, ts.map(node.members, transformEnumMember)); ts.addRange(statements, endLexicalEnvironment()); currentNamespaceContainerName = savedCurrentNamespaceLocalName; - return ts.createBlock(ts.createNodeArray(statements, /*location*/ node.members), - /*location*/ undefined, + return ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), /*location*/ node.members), /*multiLine*/ true); } /** @@ -47121,9 +50688,7 @@ var ts; // we pass false as 'generateNameForComputedPropertyName' for a backward compatibility purposes // old emitter always generate 'expression' part of the name as-is. var name = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ false); - return ts.createStatement(ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, name), transformEnumMemberDeclarationValue(member))), name, - /*location*/ member), - /*location*/ member); + return ts.setTextRange(ts.createStatement(ts.setTextRange(ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, name), transformEnumMemberDeclarationValue(member))), name), member)), member); } /** * Transforms the value of an enum member. @@ -47176,8 +50741,8 @@ var ts; if (!currentScopeFirstDeclarationsOfName) { currentScopeFirstDeclarationsOfName = ts.createMap(); } - if (!(name in currentScopeFirstDeclarationsOfName)) { - currentScopeFirstDeclarationsOfName[name] = node; + if (!currentScopeFirstDeclarationsOfName.has(name)) { + currentScopeFirstDeclarationsOfName.set(name, node); } } } @@ -47187,9 +50752,9 @@ var ts; */ function isFirstEmittedDeclarationInScope(node) { if (currentScopeFirstDeclarationsOfName) { - var name_32 = node.symbol && node.symbol.name; - if (name_32) { - return currentScopeFirstDeclarationsOfName[name_32] === node; + var name = node.symbol && node.symbol.name; + if (name) { + return currentScopeFirstDeclarationsOfName.get(name) === node; } } return false; @@ -47206,7 +50771,7 @@ var ts; recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. - if (node.kind === 229 /* EnumDeclaration */) { + if (node.kind === 231 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -47298,9 +50863,9 @@ var ts; /*name*/ undefined, /*typeParameters*/ undefined, [ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, parameterName)], /*type*/ undefined, transformModuleBody(node, containerName)), - /*typeArguments*/ undefined, [moduleArg]), - /*location*/ node); + /*typeArguments*/ undefined, [moduleArg])); ts.setOriginalNode(moduleStatement, node); + ts.setTextRange(moduleStatement, node); ts.setEmitFlags(moduleStatement, emitFlags); statements.push(moduleStatement); // Add a DeclarationMarker for the namespace to preserve trailing comments and mark @@ -47325,8 +50890,8 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 231 /* ModuleBlock */) { - ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); + if (body.kind === 233 /* ModuleBlock */) { + saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; } @@ -47347,10 +50912,10 @@ var ts; currentNamespaceContainerName = savedCurrentNamespaceContainerName; currentNamespace = savedCurrentNamespace; currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName; - var block = ts.createBlock(ts.createNodeArray(statements, + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), /*location*/ statementsLocation), - /*location*/ blockLocation, /*multiLine*/ true); + ts.setTextRange(block, blockLocation); // namespace hello.hi.world { // function foo() {} // @@ -47371,13 +50936,13 @@ var ts; // })(hi = hello.hi || (hello.hi = {})); // })(hello || (hello = {})); // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces. - if (body.kind !== 231 /* ModuleBlock */) { + if (body.kind !== 233 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 230 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 232 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -47394,7 +50959,7 @@ var ts; return node; } // Elide the declaration if the import clause was elided. - var importClause = ts.visitNode(node.importClause, visitImportClause, ts.isImportClause, /*optional*/ true); + var importClause = ts.visitNode(node.importClause, visitImportClause, ts.isImportClause); return importClause ? ts.updateImportDeclaration(node, /*decorators*/ undefined, @@ -47409,7 +50974,7 @@ var ts; function visitImportClause(node) { // Elide the import clause if we elide both its name and its named bindings. var name = resolver.isReferencedAliasDeclaration(node) ? node.name : undefined; - var namedBindings = ts.visitNode(node.namedBindings, visitNamedImportBindings, ts.isNamedImportBindings, /*optional*/ true); + var namedBindings = ts.visitNode(node.namedBindings, visitNamedImportBindings, ts.isNamedImportBindings); return (name || namedBindings) ? ts.updateImportClause(node, name, namedBindings) : undefined; } /** @@ -47418,7 +50983,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 237 /* NamespaceImport */) { + if (node.kind === 239 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -47465,7 +51030,7 @@ var ts; return undefined; } // Elide the export declaration if all of its named exports are elided. - var exportClause = ts.visitNode(node.exportClause, visitNamedExports, ts.isNamedExports, /*optional*/ true); + var exportClause = ts.visitNode(node.exportClause, visitNamedExports, ts.isNamedExports); return exportClause ? ts.updateExportDeclaration(node, /*decorators*/ undefined, @@ -47525,10 +51090,10 @@ var ts; if (isNamedExternalModuleExport(node) || !isNamespaceExport(node)) { // export var ${name} = ${moduleReference}; // var ${name} = ${moduleReference}; - return ts.setOriginalNode(ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ + return ts.setOriginalNode(ts.setTextRange(ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.setOriginalNode(ts.createVariableDeclaration(node.name, /*type*/ undefined, moduleReference), node) - ]), node), node); + ])), node), node); } else { // exports.${name} = ${moduleReference}; @@ -47573,7 +51138,7 @@ var ts; * Creates a statement for the provided expression. This is used in calls to `map`. */ function expressionToStatement(expression) { - return ts.createStatement(expression, /*location*/ undefined); + return ts.createStatement(expression); } function addExportMemberAssignment(statements, node) { var expression = ts.createAssignment(ts.getExternalModuleOrNamespaceExportName(currentNamespaceContainerName, node, /*allowComments*/ false, /*allowSourceMaps*/ true), ts.getLocalName(node)); @@ -47583,10 +51148,10 @@ var ts; statements.push(statement); } function createNamespaceExport(exportName, exportValue, location) { - return ts.createStatement(ts.createAssignment(ts.getNamespaceMemberName(currentNamespaceContainerName, exportName, /*allowComments*/ false, /*allowSourceMaps*/ true), exportValue), location); + return ts.setTextRange(ts.createStatement(ts.createAssignment(ts.getNamespaceMemberName(currentNamespaceContainerName, exportName, /*allowComments*/ false, /*allowSourceMaps*/ true), exportValue)), location); } function createNamespaceExportExpression(exportName, exportValue, location) { - return ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(exportName), exportValue, location); + return ts.setTextRange(ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(exportName), exportValue), location); } function getNamespaceMemberNameWithSourceMapsAndWithoutComments(name) { return ts.getNamespaceMemberName(currentNamespaceContainerName, name, /*allowComments*/ false, /*allowSourceMaps*/ true); @@ -47614,7 +51179,7 @@ var ts; function getClassAliasIfNeeded(node) { if (resolver.getNodeCheckFlags(node) & 8388608 /* ClassWithConstructorReference */) { enableSubstitutionForClassAliases(); - var classAlias = ts.createUniqueName(node.name && !ts.isGeneratedIdentifier(node.name) ? node.name.text : "default"); + var classAlias = ts.createUniqueName(node.name && !ts.isGeneratedIdentifier(node.name) ? ts.unescapeIdentifier(node.name.text) : "default"); classAliases[ts.getOriginalNodeId(node)] = classAlias; hoistVariableDeclaration(classAlias); return classAlias; @@ -47641,7 +51206,7 @@ var ts; // substitute class names inside of a class declaration. context.enableSubstitution(70 /* Identifier */); // Keep track of class aliases. - classAliases = ts.createMap(); + classAliases = []; } } function enableSubstitutionForNamespaceExports() { @@ -47650,44 +51215,49 @@ var ts; // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to // substitute the names of exported members of a namespace. context.enableSubstitution(70 /* Identifier */); - context.enableSubstitution(258 /* ShorthandPropertyAssignment */); + context.enableSubstitution(261 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(230 /* ModuleDeclaration */); + context.enableEmitNotification(232 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 230 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 232 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 229 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 231 /* EnumDeclaration */; } /** * Hook for node emit. * - * @param emitContext A context hint for the emitter. + * @param hint A hint as to the intended usage of the node. * @param node The node to emit. * @param emit A callback used to emit the node in the printer. */ - function onEmitNode(emitContext, node, emitCallback) { + function onEmitNode(hint, node, emitCallback) { var savedApplicableSubstitutions = applicableSubstitutions; + var savedCurrentSourceFile = currentSourceFile; + if (ts.isSourceFile(node)) { + currentSourceFile = node; + } if (enabledSubstitutions & 2 /* NamespaceExports */ && isTransformedModuleDeclaration(node)) { applicableSubstitutions |= 2 /* NamespaceExports */; } if (enabledSubstitutions & 8 /* NonQualifiedEnumMembers */ && isTransformedEnumDeclaration(node)) { applicableSubstitutions |= 8 /* NonQualifiedEnumMembers */; } - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); applicableSubstitutions = savedApplicableSubstitutions; + currentSourceFile = savedCurrentSourceFile; } /** * Hooks node substitutions. * - * @param emitContext A context hint for the emitter. + * @param hint A hint as to the intended usage of the node. * @param node The node to substitute. */ - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1 /* Expression */) { + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 /* Expression */) { return substituteExpression(node); } else if (ts.isShorthandPropertyAssignment(node)) { @@ -47697,16 +51267,16 @@ var ts; } function substituteShorthandPropertyAssignment(node) { if (enabledSubstitutions & 2 /* NamespaceExports */) { - var name_33 = node.name; - var exportedName = trySubstituteNamespaceExportedName(name_33); + var name = node.name; + var exportedName = trySubstituteNamespaceExportedName(name); if (exportedName) { // A shorthand property with an assignment initializer is probably part of a // destructuring assignment if (node.objectAssignmentInitializer) { var initializer = ts.createAssignment(exportedName, node.objectAssignmentInitializer); - return ts.createPropertyAssignment(name_33, initializer, /*location*/ node); + return ts.setTextRange(ts.createPropertyAssignment(name, initializer), node); } - return ts.createPropertyAssignment(name_33, exportedName, /*location*/ node); + return ts.setTextRange(ts.createPropertyAssignment(name, exportedName), node); } } return node; @@ -47715,9 +51285,9 @@ var ts; switch (node.kind) { case 70 /* Identifier */: return substituteExpressionIdentifier(node); - case 177 /* PropertyAccessExpression */: + case 178 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 178 /* ElementAccessExpression */: + case 179 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -47755,11 +51325,12 @@ var ts; // If we are nested within a namespace declaration, we may need to qualifiy // an identifier that is exported from a merged namespace. var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false); - if (container && container.kind !== 261 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 230 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 229 /* EnumDeclaration */); + if (container && container.kind !== 264 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 232 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 231 /* EnumDeclaration */); if (substitute) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node, /*location*/ node); + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), + /*location*/ node); } } } @@ -47774,16 +51345,15 @@ var ts; function substituteConstantValue(node) { var constantValue = tryGetConstEnumValue(node); if (constantValue !== undefined) { + // track the constant value on the node for the printer in needsDotDotForPropertyAccess + ts.setConstantValue(node, constantValue); var substitute = ts.createLiteral(constantValue); - ts.setSourceMapRange(substitute, node); - ts.setCommentRange(substitute, node); if (!compilerOptions.removeComments) { var propertyName = ts.isPropertyAccessExpression(node) ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); - substitute.trailingComment = " " + propertyName + " "; + ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " " + propertyName + " "); } - ts.setConstantValue(node, constantValue); return substitute; } return node; @@ -47798,25 +51368,25 @@ var ts; } } ts.transformTypeScript = transformTypeScript; - var paramHelper = { - name: "typescript:param", - scoped: false, - priority: 4, - text: "\n var __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n };" - }; - function createParamHelper(context, expression, parameterOffset, location) { - context.requestEmitHelper(paramHelper); - return ts.createCall(ts.getHelperName("__param"), - /*typeArguments*/ undefined, [ - ts.createLiteral(parameterOffset), - expression - ], location); + function createDecorateHelper(context, decoratorExpressions, target, memberName, descriptor, location) { + var argumentsArray = []; + argumentsArray.push(ts.createArrayLiteral(decoratorExpressions, /*multiLine*/ true)); + argumentsArray.push(target); + if (memberName) { + argumentsArray.push(memberName); + if (descriptor) { + argumentsArray.push(descriptor); + } + } + context.requestEmitHelper(decorateHelper); + return ts.setTextRange(ts.createCall(ts.getHelperName("__decorate"), + /*typeArguments*/ undefined, argumentsArray), location); } - var metadataHelper = { - name: "typescript:metadata", + var decorateHelper = { + name: "typescript:decorate", scoped: false, - priority: 3, - text: "\n var __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n };" + priority: 2, + text: "\n var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };" }; function createMetadataHelper(context, metadataKey, metadataValue) { context.requestEmitHelper(metadataHelper); @@ -47826,33 +51396,397 @@ var ts; metadataValue ]); } - var decorateHelper = { - name: "typescript:decorate", + var metadataHelper = { + name: "typescript:metadata", scoped: false, - priority: 2, - text: "\n var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };" + priority: 3, + text: "\n var __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n };" }; - function createDecorateHelper(context, decoratorExpressions, target, memberName, descriptor, location) { - context.requestEmitHelper(decorateHelper); - var argumentsArray = []; - argumentsArray.push(ts.createArrayLiteral(decoratorExpressions, /*location*/ undefined, /*multiLine*/ true)); - argumentsArray.push(target); - if (memberName) { - argumentsArray.push(memberName); - if (descriptor) { - argumentsArray.push(descriptor); - } - } - return ts.createCall(ts.getHelperName("__decorate"), /*typeArguments*/ undefined, argumentsArray, location); + function createParamHelper(context, expression, parameterOffset, location) { + context.requestEmitHelper(paramHelper); + return ts.setTextRange(ts.createCall(ts.getHelperName("__param"), + /*typeArguments*/ undefined, [ + ts.createLiteral(parameterOffset), + expression + ]), location); } + var paramHelper = { + name: "typescript:param", + scoped: false, + priority: 4, + text: "\n var __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n };" + }; })(ts || (ts = {})); /// /// /*@internal*/ var ts; (function (ts) { + var ES2017SubstitutionFlags; + (function (ES2017SubstitutionFlags) { + /** Enables substitutions for async methods with `super` calls. */ + ES2017SubstitutionFlags[ES2017SubstitutionFlags["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper"; + })(ES2017SubstitutionFlags || (ES2017SubstitutionFlags = {})); + function transformES2017(context) { + var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; + var resolver = context.getEmitResolver(); + var compilerOptions = context.getCompilerOptions(); + var languageVersion = ts.getEmitScriptTarget(compilerOptions); + // These variables contain state that changes as we descend into the tree. + var currentSourceFile; + /** + * Keeps track of whether expression substitution has been enabled for specific edge cases. + * They are persisted between each SourceFile transformation and should not be reset. + */ + var enabledSubstitutions; + /** + * This keeps track of containers where `super` is valid, for use with + * just-in-time substitution for `super` expressions inside of async methods. + */ + var enclosingSuperContainerFlags = 0; + // Save the previous transformation hooks. + var previousOnEmitNode = context.onEmitNode; + var previousOnSubstituteNode = context.onSubstituteNode; + // Set new transformation hooks. + context.onEmitNode = onEmitNode; + context.onSubstituteNode = onSubstituteNode; + return transformSourceFile; + function transformSourceFile(node) { + if (ts.isDeclarationFile(node)) { + return node; + } + currentSourceFile = node; + var visited = ts.visitEachChild(node, visitor, context); + ts.addEmitHelpers(visited, context.readEmitHelpers()); + currentSourceFile = undefined; + return visited; + } + function visitor(node) { + if ((node.transformFlags & 16 /* ContainsES2017 */) === 0) { + return node; + } + switch (node.kind) { + case 119 /* AsyncKeyword */: + // ES2017 async modifier should be elided for targets < ES2017 + return undefined; + case 190 /* AwaitExpression */: + return visitAwaitExpression(node); + case 150 /* MethodDeclaration */: + return visitMethodDeclaration(node); + case 227 /* FunctionDeclaration */: + return visitFunctionDeclaration(node); + case 185 /* FunctionExpression */: + return visitFunctionExpression(node); + case 186 /* ArrowFunction */: + return visitArrowFunction(node); + default: + return ts.visitEachChild(node, visitor, context); + } + } + /** + * Visits an AwaitExpression node. + * + * This function will be called any time a ES2017 await expression is encountered. + * + * @param node The node to visit. + */ + function visitAwaitExpression(node) { + return ts.setOriginalNode(ts.setTextRange(ts.createYield( + /*asteriskToken*/ undefined, ts.visitNode(node.expression, visitor, ts.isExpression)), node), node); + } + /** + * Visits a MethodDeclaration node. + * + * This function will be called when one of the following conditions are met: + * - The node is marked as async + * + * @param node The node to visit. + */ + function visitMethodDeclaration(node) { + return ts.updateMethod(node, + /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, + /*questionToken*/ undefined, + /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), + /*type*/ undefined, ts.getFunctionFlags(node) & 2 /* Async */ + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + /** + * Visits a FunctionDeclaration node. + * + * This function will be called when one of the following conditions are met: + * - The node is marked async + * + * @param node The node to visit. + */ + function visitFunctionDeclaration(node) { + return ts.updateFunctionDeclaration(node, + /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, + /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), + /*type*/ undefined, ts.getFunctionFlags(node) & 2 /* Async */ + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + /** + * Visits a FunctionExpression node. + * + * This function will be called when one of the following conditions are met: + * - The node is marked async + * + * @param node The node to visit. + */ + function visitFunctionExpression(node) { + return ts.updateFunctionExpression(node, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, + /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), + /*type*/ undefined, ts.getFunctionFlags(node) & 2 /* Async */ + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + /** + * Visits an ArrowFunction. + * + * This function will be called when one of the following conditions are met: + * - The node is marked async + * + * @param node The node to visit. + */ + function visitArrowFunction(node) { + return ts.updateArrowFunction(node, ts.visitNodes(node.modifiers, visitor, ts.isModifier), + /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), + /*type*/ undefined, ts.getFunctionFlags(node) & 2 /* Async */ + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + function transformAsyncFunctionBody(node) { + resumeLexicalEnvironment(); + var original = ts.getOriginalNode(node, ts.isFunctionLike); + var nodeType = original.type; + var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; + var isArrowFunction = node.kind === 186 /* ArrowFunction */; + var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; + // An async function is emit as an outer function that calls an inner + // generator function. To preserve lexical bindings, we pass the current + // `this` and `arguments` objects to `__awaiter`. The generator function + // passed to `__awaiter` is executed inside of the callback to the + // promise constructor. + if (!isArrowFunction) { + var statements = []; + var statementOffset = ts.addPrologue(statements, node.body.statements, /*ensureUseStrict*/ false, visitor); + statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body, statementOffset)))); + ts.addRange(statements, endLexicalEnvironment()); + var block = ts.createBlock(statements, /*multiLine*/ true); + ts.setTextRange(block, node.body); + // Minor optimization, emit `_super` helper to capture `super` access in an arrow. + // This step isn't needed if we eventually transform this to ES5. + if (languageVersion >= 2 /* ES2015 */) { + if (resolver.getNodeCheckFlags(node) & 4096 /* AsyncMethodWithSuperBinding */) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.advancedAsyncSuperHelper); + } + else if (resolver.getNodeCheckFlags(node) & 2048 /* AsyncMethodWithSuper */) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.asyncSuperHelper); + } + } + return block; + } + else { + var expression = createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body)); + var declarations = endLexicalEnvironment(); + if (ts.some(declarations)) { + var block = ts.convertToFunctionBody(expression); + return ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(ts.concatenate(block.statements, declarations)), block.statements)); + } + return expression; + } + } + function transformFunctionBodyWorker(body, start) { + if (ts.isBlock(body)) { + return ts.updateBlock(body, ts.visitLexicalEnvironment(body.statements, visitor, context, start)); + } + else { + startLexicalEnvironment(); + var visited = ts.convertToFunctionBody(ts.visitNode(body, visitor, ts.isConciseBody)); + var declarations = endLexicalEnvironment(); + return ts.updateBlock(visited, ts.setTextRange(ts.createNodeArray(ts.concatenate(visited.statements, declarations)), visited.statements)); + } + } + function getPromiseConstructor(type) { + var typeName = type && ts.getEntityNameFromTypeNode(type); + if (typeName && ts.isEntityName(typeName)) { + var serializationKind = resolver.getTypeReferenceSerializationKind(typeName); + if (serializationKind === ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue + || serializationKind === ts.TypeReferenceSerializationKind.Unknown) { + return typeName; + } + } + return undefined; + } + function enableSubstitutionForAsyncMethodsWithSuper() { + if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) { + enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; + // We need to enable substitutions for call, property access, and element access + // if we need to rewrite super calls. + context.enableSubstitution(180 /* CallExpression */); + context.enableSubstitution(178 /* PropertyAccessExpression */); + context.enableSubstitution(179 /* ElementAccessExpression */); + // We need to be notified when entering and exiting declarations that bind super. + context.enableEmitNotification(228 /* ClassDeclaration */); + context.enableEmitNotification(150 /* MethodDeclaration */); + context.enableEmitNotification(152 /* GetAccessor */); + context.enableEmitNotification(153 /* SetAccessor */); + context.enableEmitNotification(151 /* Constructor */); + } + } + /** + * Hook for node emit. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to emit. + * @param emit A callback used to emit the node in the printer. + */ + function onEmitNode(hint, node, emitCallback) { + // If we need to support substitutions for `super` in an async method, + // we should track it here. + if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) { + var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 /* AsyncMethodWithSuper */ | 4096 /* AsyncMethodWithSuperBinding */); + if (superContainerFlags !== enclosingSuperContainerFlags) { + var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; + enclosingSuperContainerFlags = superContainerFlags; + previousOnEmitNode(hint, node, emitCallback); + enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; + return; + } + } + previousOnEmitNode(hint, node, emitCallback); + } + /** + * Hooks node substitutions. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to substitute. + */ + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 /* Expression */ && enclosingSuperContainerFlags) { + return substituteExpression(node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 178 /* PropertyAccessExpression */: + return substitutePropertyAccessExpression(node); + case 179 /* ElementAccessExpression */: + return substituteElementAccessExpression(node); + case 180 /* CallExpression */: + return substituteCallExpression(node); + } + return node; + } + function substitutePropertyAccessExpression(node) { + if (node.expression.kind === 96 /* SuperKeyword */) { + return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), node); + } + return node; + } + function substituteElementAccessExpression(node) { + if (node.expression.kind === 96 /* SuperKeyword */) { + return createSuperAccessInAsyncMethod(node.argumentExpression, node); + } + return node; + } + function substituteCallExpression(node) { + var expression = node.expression; + if (ts.isSuperProperty(expression)) { + var argumentExpression = ts.isPropertyAccessExpression(expression) + ? substitutePropertyAccessExpression(expression) + : substituteElementAccessExpression(expression); + return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), + /*typeArguments*/ undefined, [ + ts.createThis() + ].concat(node.arguments)); + } + return node; + } + function isSuperContainer(node) { + var kind = node.kind; + return kind === 228 /* ClassDeclaration */ + || kind === 151 /* Constructor */ + || kind === 150 /* MethodDeclaration */ + || kind === 152 /* GetAccessor */ + || kind === 153 /* SetAccessor */; + } + function createSuperAccessInAsyncMethod(argumentExpression, location) { + if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { + return ts.setTextRange(ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), + /*typeArguments*/ undefined, [argumentExpression]), "value"), location); + } + else { + return ts.setTextRange(ts.createCall(ts.createIdentifier("_super"), + /*typeArguments*/ undefined, [argumentExpression]), location); + } + } + } + ts.transformES2017 = transformES2017; + var awaiterHelper = { + name: "typescript:awaiter", + scoped: false, + priority: 5, + text: "\n var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n };" + }; + function createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, body) { + context.requestEmitHelper(awaiterHelper); + var generatorFunc = ts.createFunctionExpression( + /*modifiers*/ undefined, ts.createToken(38 /* AsteriskToken */), + /*name*/ undefined, + /*typeParameters*/ undefined, + /*parameters*/ [], + /*type*/ undefined, body); + // Mark this node as originally an async function + (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 131072 /* AsyncFunctionBody */; + return ts.createCall(ts.getHelperName("__awaiter"), + /*typeArguments*/ undefined, [ + ts.createThis(), + hasLexicalArguments ? ts.createIdentifier("arguments") : ts.createVoidZero(), + promiseConstructor ? ts.createExpressionFromEntityName(promiseConstructor) : ts.createVoidZero(), + generatorFunc + ]); + } + ts.asyncSuperHelper = { + name: "typescript:async-super", + scoped: true, + text: "\n const _super = name => super[name];\n " + }; + ts.advancedAsyncSuperHelper = { + name: "typescript:advanced-async-super", + scoped: true, + text: "\n const _super = (function (geti, seti) {\n const cache = Object.create(null);\n return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n })(name => super[name], (name, value) => super[name] = value);\n " + }; +})(ts || (ts = {})); +/// +/// +/// +/*@internal*/ +var ts; +(function (ts) { + var ESNextSubstitutionFlags; + (function (ESNextSubstitutionFlags) { + /** Enables substitutions for async methods with `super` calls. */ + ESNextSubstitutionFlags[ESNextSubstitutionFlags["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper"; + })(ESNextSubstitutionFlags || (ESNextSubstitutionFlags = {})); function transformESNext(context) { - var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; + var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration; + var resolver = context.getEmitResolver(); + var compilerOptions = context.getCompilerOptions(); + var languageVersion = ts.getEmitScriptTarget(compilerOptions); + var previousOnEmitNode = context.onEmitNode; + context.onEmitNode = onEmitNode; + var previousOnSubstituteNode = context.onSubstituteNode; + context.onSubstituteNode = onSubstituteNode; + var enabledSubstitutions; + var enclosingFunctionFlags; + var enclosingSuperContainerFlags = 0; return transformSourceFile; function transformSourceFile(node) { if (ts.isDeclarationFile(node)) { @@ -47868,53 +51802,95 @@ var ts; function visitorNoDestructuringValue(node) { return visitorWorker(node, /*noDestructuringValue*/ true); } + function visitorNoAsyncModifier(node) { + if (node.kind === 119 /* AsyncKeyword */) { + return undefined; + } + return node; + } function visitorWorker(node, noDestructuringValue) { if ((node.transformFlags & 8 /* ContainsESNext */) === 0) { return node; } switch (node.kind) { - case 176 /* ObjectLiteralExpression */: + case 190 /* AwaitExpression */: + return visitAwaitExpression(node); + case 196 /* YieldExpression */: + return visitYieldExpression(node); + case 221 /* LabeledStatement */: + return visitLabeledStatement(node); + case 177 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return visitBinaryExpression(node, noDestructuringValue); - case 223 /* VariableDeclaration */: + case 225 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 213 /* ForOfStatement */: - return visitForOfStatement(node); - case 211 /* ForStatement */: + case 215 /* ForOfStatement */: + return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); + case 213 /* ForStatement */: return visitForStatement(node); - case 188 /* VoidExpression */: + case 189 /* VoidExpression */: return visitVoidExpression(node); - case 150 /* Constructor */: + case 151 /* Constructor */: return visitConstructorDeclaration(node); - case 149 /* MethodDeclaration */: + case 150 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 151 /* GetAccessor */: + case 152 /* GetAccessor */: return visitGetAccessorDeclaration(node); - case 152 /* SetAccessor */: + case 153 /* SetAccessor */: return visitSetAccessorDeclaration(node); - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 184 /* FunctionExpression */: + case 185 /* FunctionExpression */: return visitFunctionExpression(node); - case 185 /* ArrowFunction */: + case 186 /* ArrowFunction */: return visitArrowFunction(node); - case 144 /* Parameter */: + case 145 /* Parameter */: return visitParameter(node); - case 207 /* ExpressionStatement */: + case 209 /* ExpressionStatement */: return visitExpressionStatement(node); - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, noDestructuringValue); default: return ts.visitEachChild(node, visitor, context); } } + function visitAwaitExpression(node) { + if (enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + return ts.setOriginalNode(ts.setTextRange(ts.createYield( + /*asteriskToken*/ undefined, ts.createArrayLiteral([ts.createLiteral("await"), expression])), + /*location*/ node), node); + } + return ts.visitEachChild(node, visitor, context); + } + function visitYieldExpression(node) { + if (enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + return ts.updateYield(node, node.asteriskToken, node.asteriskToken + ? createAsyncDelegatorHelper(context, expression, expression) + : ts.createArrayLiteral(expression + ? [ts.createLiteral("yield"), expression] + : [ts.createLiteral("yield")])); + } + return ts.visitEachChild(node, visitor, context); + } + function visitLabeledStatement(node) { + if (enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */) { + var statement = ts.unwrapInnermostStatementOfLabel(node); + if (statement.kind === 215 /* ForOfStatement */ && statement.awaitModifier) { + return visitForOfStatement(statement, node); + } + return ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), node); + } + return ts.visitEachChild(node, visitor, context); + } function chunkObjectLiteralElements(elements) { var chunkObject; var objects = []; - for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) { - var e = elements_3[_i]; - if (e.kind === 259 /* SpreadAssignment */) { + for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { + var e = elements_4[_i]; + if (e.kind === 262 /* SpreadAssignment */) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -47926,7 +51902,7 @@ var ts; if (!chunkObject) { chunkObject = []; } - if (e.kind === 257 /* PropertyAssignment */) { + if (e.kind === 260 /* PropertyAssignment */) { var p = e; chunkObject.push(ts.createPropertyAssignment(p.name, ts.visitNode(p.initializer, visitor, ts.isExpression))); } @@ -47948,7 +51924,7 @@ var ts; // If the first element is a spread element, then the first argument to __assign is {}: // { ...o, a, b, ...o2 } => __assign({}, o, {a, b}, o2) var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 176 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 177 /* ObjectLiteralExpression */) { objects.unshift(ts.createObjectLiteral()); } return createAssignHelper(context, objects); @@ -47998,41 +51974,101 @@ var ts; * * @param node A ForOfStatement. */ - function visitForOfStatement(node) { - var leadingStatements; - var temp; - var initializer = ts.skipParentheses(node.initializer); - if (initializer.transformFlags & 1048576 /* ContainsObjectRest */) { - if (ts.isVariableDeclarationList(initializer)) { - temp = ts.createTempVariable(/*recordTempVariable*/ undefined); - var firstDeclaration = ts.firstOrUndefined(initializer.declarations); - var declarations = ts.flattenDestructuringBinding(firstDeclaration, visitor, context, 1 /* ObjectRest */, temp, - /*doNotRecordTempVariablesInLine*/ false, - /*skipInitializer*/ true); - if (ts.some(declarations)) { - var statement = ts.createVariableStatement( - /*modifiers*/ undefined, ts.updateVariableDeclarationList(initializer, declarations), - /*location*/ initializer); - leadingStatements = ts.append(leadingStatements, statement); - } - } - else if (ts.isAssignmentPattern(initializer)) { - temp = ts.createTempVariable(/*recordTempVariable*/ undefined); - var expression = ts.flattenDestructuringAssignment(ts.aggregateTransformFlags(ts.createAssignment(initializer, temp, /*location*/ node.initializer)), visitor, context, 1 /* ObjectRest */); - leadingStatements = ts.append(leadingStatements, ts.createStatement(expression, /*location*/ node.initializer)); - } + function visitForOfStatement(node, outermostLabeledStatement) { + if (node.initializer.transformFlags & 1048576 /* ContainsObjectRest */) { + node = transformForOfStatementWithObjectRest(node); } - if (temp) { - var expression = ts.visitNode(node.expression, visitor, ts.isExpression); - var statement = ts.visitNode(node.statement, visitor, ts.isStatement); - var block = ts.isBlock(statement) - ? ts.updateBlock(statement, ts.createNodeArray(ts.concatenate(leadingStatements, statement.statements), statement.statements)) - : ts.createBlock(ts.append(leadingStatements, statement), statement, /*multiLine*/ true); - return ts.updateForOf(node, ts.createVariableDeclarationList([ - ts.createVariableDeclaration(temp, /*type*/ undefined, /*initializer*/ undefined, node.initializer) - ], node.initializer, 1 /* Let */), expression, block); + if (node.awaitModifier) { + return transformForAwaitOfStatement(node, outermostLabeledStatement); } - return ts.visitEachChild(node, visitor, context); + else { + return ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), outermostLabeledStatement); + } + } + function transformForOfStatementWithObjectRest(node) { + var initializerWithoutParens = ts.skipParentheses(node.initializer); + if (ts.isVariableDeclarationList(initializerWithoutParens) || ts.isAssignmentPattern(initializerWithoutParens)) { + var bodyLocation = void 0; + var statementsLocation = void 0; + var temp = ts.createTempVariable(/*recordTempVariable*/ undefined); + var statements = [ts.createForOfBindingStatement(initializerWithoutParens, temp)]; + if (ts.isBlock(node.statement)) { + ts.addRange(statements, node.statement.statements); + bodyLocation = node.statement; + statementsLocation = node.statement.statements; + } + return ts.updateForOf(node, node.awaitModifier, ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(temp), node.initializer) + ], 1 /* Let */), node.initializer), node.expression, ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), + /*multiLine*/ true), bodyLocation)); + } + return node; + } + function convertForOfStatementHead(node, boundValue) { + var binding = ts.createForOfBindingStatement(node.initializer, boundValue); + var bodyLocation; + var statementsLocation; + var statements = [ts.visitNode(binding, visitor, ts.isStatement)]; + var statement = ts.visitNode(node.statement, visitor, ts.isStatement); + if (ts.isBlock(statement)) { + ts.addRange(statements, statement.statements); + bodyLocation = statement; + statementsLocation = statement.statements; + } + else { + statements.push(statement); + } + return ts.setEmitFlags(ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), + /*multiLine*/ true), bodyLocation), 48 /* NoSourceMap */ | 384 /* NoTokenSourceMaps */); + } + function transformForAwaitOfStatement(node, outermostLabeledStatement) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + var iterator = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(expression) : ts.createTempVariable(/*recordTempVariable*/ undefined); + var result = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(iterator) : ts.createTempVariable(/*recordTempVariable*/ undefined); + var errorRecord = ts.createUniqueName("e"); + var catchVariable = ts.getGeneratedNameForNode(errorRecord); + var returnMethod = ts.createTempVariable(/*recordTempVariable*/ undefined); + var values = createAsyncValuesHelper(context, expression, /*location*/ node.expression); + var next = ts.createYield( + /*asteriskToken*/ undefined, enclosingFunctionFlags & 1 /* Generator */ + ? ts.createArrayLiteral([ + ts.createLiteral("await"), + ts.createCall(ts.createPropertyAccess(iterator, "next"), /*typeArguments*/ undefined, []) + ]) + : ts.createCall(ts.createPropertyAccess(iterator, "next"), /*typeArguments*/ undefined, [])); + hoistVariableDeclaration(errorRecord); + hoistVariableDeclaration(returnMethod); + var forStatement = ts.setEmitFlags(ts.setTextRange(ts.createFor( + /*initializer*/ ts.setEmitFlags(ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(iterator, /*type*/ undefined, values), node.expression), + ts.createVariableDeclaration(result, /*type*/ undefined, next) + ]), node.expression), 1048576 /* NoHoisting */), + /*condition*/ ts.createLogicalNot(ts.createPropertyAccess(result, "done")), + /*incrementor*/ ts.createAssignment(result, next), + /*statement*/ convertForOfStatementHead(node, ts.createPropertyAccess(result, "value"))), + /*location*/ node), 256 /* NoTokenTrailingSourceMaps */); + return ts.createTry(ts.createBlock([ + ts.restoreEnclosingLabel(forStatement, outermostLabeledStatement) + ]), ts.createCatchClause(ts.createVariableDeclaration(catchVariable), ts.setEmitFlags(ts.createBlock([ + ts.createStatement(ts.createAssignment(errorRecord, ts.createObjectLiteral([ + ts.createPropertyAssignment("error", catchVariable) + ]))) + ]), 1 /* SingleLine */)), ts.createBlock([ + ts.createTry( + /*tryBlock*/ ts.createBlock([ + ts.setEmitFlags(ts.createIf(ts.createLogicalAnd(ts.createLogicalAnd(result, ts.createLogicalNot(ts.createPropertyAccess(result, "done"))), ts.createAssignment(returnMethod, ts.createPropertyAccess(iterator, "return"))), ts.createStatement(ts.createYield( + /*asteriskToken*/ undefined, enclosingFunctionFlags & 1 /* Generator */ + ? ts.createArrayLiteral([ + ts.createLiteral("await"), + ts.createFunctionCall(returnMethod, iterator, []) + ]) + : ts.createFunctionCall(returnMethod, iterator, [])))), 1 /* SingleLine */) + ]), + /*catchClause*/ undefined, + /*finallyBlock*/ ts.setEmitFlags(ts.createBlock([ + ts.setEmitFlags(ts.createIf(errorRecord, ts.createThrow(ts.createPropertyAccess(errorRecord, "error"))), 1 /* SingleLine */) + ]), 1 /* SingleLine */)) + ])); } function visitParameter(node) { if (node.transformFlags & 1048576 /* ContainsObjectRest */) { @@ -48041,48 +52077,137 @@ var ts; return ts.updateParameter(node, /*decorators*/ undefined, /*modifiers*/ undefined, node.dotDotDotToken, ts.getGeneratedNameForNode(node), + /*questionToken*/ undefined, /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)); } return ts.visitEachChild(node, visitor, context); } function visitConstructorDeclaration(node) { - return ts.updateConstructor(node, + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = 0 /* Normal */; + var updated = ts.updateConstructor(node, /*decorators*/ undefined, node.modifiers, ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitGetAccessorDeclaration(node) { - return ts.updateGetAccessor(node, + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = 0 /* Normal */; + var updated = ts.updateGetAccessor(node, /*decorators*/ undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), /*type*/ undefined, transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitSetAccessorDeclaration(node) { - return ts.updateSetAccessor(node, + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = 0 /* Normal */; + var updated = ts.updateSetAccessor(node, /*decorators*/ undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitMethodDeclaration(node) { - return ts.updateMethod(node, - /*decorators*/ undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateMethod(node, + /*decorators*/ undefined, enclosingFunctionFlags & 1 /* Generator */ + ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier) + : node.modifiers, enclosingFunctionFlags & 2 /* Async */ + ? undefined + : node.asteriskToken, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNode(/*questionToken*/ undefined, visitor, ts.isToken), /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, transformFunctionBody(node)); + /*type*/ undefined, enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ + ? transformAsyncGeneratorFunctionBody(node) + : transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitFunctionDeclaration(node) { - return ts.updateFunctionDeclaration(node, - /*decorators*/ undefined, node.modifiers, node.name, + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateFunctionDeclaration(node, + /*decorators*/ undefined, enclosingFunctionFlags & 1 /* Generator */ + ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier) + : node.modifiers, enclosingFunctionFlags & 2 /* Async */ + ? undefined + : node.asteriskToken, node.name, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, transformFunctionBody(node)); + /*type*/ undefined, enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ + ? transformAsyncGeneratorFunctionBody(node) + : transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitArrowFunction(node) { - return ts.updateArrowFunction(node, node.modifiers, + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateArrowFunction(node, node.modifiers, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), /*type*/ undefined, transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitFunctionExpression(node) { - return ts.updateFunctionExpression(node, node.modifiers, node.name, + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateFunctionExpression(node, enclosingFunctionFlags & 1 /* Generator */ + ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier) + : node.modifiers, enclosingFunctionFlags & 2 /* Async */ + ? undefined + : node.asteriskToken, node.name, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, transformFunctionBody(node)); + /*type*/ undefined, enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ + ? transformAsyncGeneratorFunctionBody(node) + : transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; + } + function transformAsyncGeneratorFunctionBody(node) { + resumeLexicalEnvironment(); + var statements = []; + var statementOffset = ts.addPrologue(statements, node.body.statements, /*ensureUseStrict*/ false, visitor); + appendObjectRestAssignmentsIfNeeded(statements, node); + statements.push(ts.createReturn(createAsyncGeneratorHelper(context, ts.createFunctionExpression( + /*modifiers*/ undefined, ts.createToken(38 /* AsteriskToken */), node.name && ts.getGeneratedNameForNode(node.name), + /*typeParameters*/ undefined, + /*parameters*/ [], + /*type*/ undefined, ts.updateBlock(node.body, ts.visitLexicalEnvironment(node.body.statements, visitor, context, statementOffset)))))); + ts.addRange(statements, endLexicalEnvironment()); + var block = ts.updateBlock(node.body, statements); + // Minor optimization, emit `_super` helper to capture `super` access in an arrow. + // This step isn't needed if we eventually transform this to ES5. + if (languageVersion >= 2 /* ES2015 */) { + if (resolver.getNodeCheckFlags(node) & 4096 /* AsyncMethodWithSuperBinding */) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.advancedAsyncSuperHelper); + } + else if (resolver.getNodeCheckFlags(node) & 2048 /* AsyncMethodWithSuper */) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.asyncSuperHelper); + } + } + return block; } function transformFunctionBody(node) { resumeLexicalEnvironment(); - var leadingStatements; + var statementOffset = 0; + var statements = []; + var body = ts.visitNode(node.body, visitor, ts.isConciseBody); + if (ts.isBlock(body)) { + statementOffset = ts.addPrologue(statements, body.statements, /*ensureUseStrict*/ false, visitor); + } + ts.addRange(statements, appendObjectRestAssignmentsIfNeeded(/*statements*/ undefined, node)); + var trailingStatements = endLexicalEnvironment(); + if (statementOffset > 0 || ts.some(statements) || ts.some(trailingStatements)) { + var block = ts.convertToFunctionBody(body, /*multiLine*/ true); + ts.addRange(statements, block.statements.slice(statementOffset)); + ts.addRange(statements, trailingStatements); + return ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(statements), block.statements)); + } + return body; + } + function appendObjectRestAssignmentsIfNeeded(statements, node) { for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { var parameter = _a[_i]; if (parameter.transformFlags & 1048576 /* ContainsObjectRest */) { @@ -48094,17 +52219,116 @@ var ts; var statement = ts.createVariableStatement( /*modifiers*/ undefined, ts.createVariableDeclarationList(declarations)); ts.setEmitFlags(statement, 524288 /* CustomPrologue */); - leadingStatements = ts.append(leadingStatements, statement); + statements = ts.append(statements, statement); } } } - var body = ts.visitNode(node.body, visitor, ts.isConciseBody); - var trailingStatements = endLexicalEnvironment(); - if (ts.some(leadingStatements) || ts.some(trailingStatements)) { - var block = ts.convertToFunctionBody(body, /*multiLine*/ true); - return ts.updateBlock(block, ts.createNodeArray(ts.concatenate(ts.concatenate(leadingStatements, block.statements), trailingStatements), block.statements)); + return statements; + } + function enableSubstitutionForAsyncMethodsWithSuper() { + if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) { + enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; + // We need to enable substitutions for call, property access, and element access + // if we need to rewrite super calls. + context.enableSubstitution(180 /* CallExpression */); + context.enableSubstitution(178 /* PropertyAccessExpression */); + context.enableSubstitution(179 /* ElementAccessExpression */); + // We need to be notified when entering and exiting declarations that bind super. + context.enableEmitNotification(228 /* ClassDeclaration */); + context.enableEmitNotification(150 /* MethodDeclaration */); + context.enableEmitNotification(152 /* GetAccessor */); + context.enableEmitNotification(153 /* SetAccessor */); + context.enableEmitNotification(151 /* Constructor */); + } + } + /** + * Called by the printer just before a node is printed. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to be printed. + * @param emitCallback The callback used to emit the node. + */ + function onEmitNode(hint, node, emitCallback) { + // If we need to support substitutions for `super` in an async method, + // we should track it here. + if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) { + var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 /* AsyncMethodWithSuper */ | 4096 /* AsyncMethodWithSuperBinding */); + if (superContainerFlags !== enclosingSuperContainerFlags) { + var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; + enclosingSuperContainerFlags = superContainerFlags; + previousOnEmitNode(hint, node, emitCallback); + enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; + return; + } + } + previousOnEmitNode(hint, node, emitCallback); + } + /** + * Hooks node substitutions. + * + * @param hint The context for the emitter. + * @param node The node to substitute. + */ + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 /* Expression */ && enclosingSuperContainerFlags) { + return substituteExpression(node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 178 /* PropertyAccessExpression */: + return substitutePropertyAccessExpression(node); + case 179 /* ElementAccessExpression */: + return substituteElementAccessExpression(node); + case 180 /* CallExpression */: + return substituteCallExpression(node); + } + return node; + } + function substitutePropertyAccessExpression(node) { + if (node.expression.kind === 96 /* SuperKeyword */) { + return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), node); + } + return node; + } + function substituteElementAccessExpression(node) { + if (node.expression.kind === 96 /* SuperKeyword */) { + return createSuperAccessInAsyncMethod(node.argumentExpression, node); + } + return node; + } + function substituteCallExpression(node) { + var expression = node.expression; + if (ts.isSuperProperty(expression)) { + var argumentExpression = ts.isPropertyAccessExpression(expression) + ? substitutePropertyAccessExpression(expression) + : substituteElementAccessExpression(expression); + return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), + /*typeArguments*/ undefined, [ + ts.createThis() + ].concat(node.arguments)); + } + return node; + } + function isSuperContainer(node) { + var kind = node.kind; + return kind === 228 /* ClassDeclaration */ + || kind === 151 /* Constructor */ + || kind === 150 /* MethodDeclaration */ + || kind === 152 /* GetAccessor */ + || kind === 153 /* SetAccessor */; + } + function createSuperAccessInAsyncMethod(argumentExpression, location) { + if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { + return ts.setTextRange(ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), + /*typeArguments*/ undefined, [argumentExpression]), "value"), location); + } + else { + return ts.setTextRange(ts.createCall(ts.createIdentifier("_super"), + /*typeArguments*/ undefined, [argumentExpression]), location); } - return body; } } ts.transformESNext = transformESNext; @@ -48115,11 +52339,51 @@ var ts; text: "\n var __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };" }; function createAssignHelper(context, attributesSegments) { + if (context.getCompilerOptions().target >= 2 /* ES2015 */) { + return ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "assign"), + /*typeArguments*/ undefined, attributesSegments); + } context.requestEmitHelper(assignHelper); return ts.createCall(ts.getHelperName("__assign"), /*typeArguments*/ undefined, attributesSegments); } ts.createAssignHelper = createAssignHelper; + var asyncGeneratorHelper = { + name: "typescript:asyncGenerator", + scoped: false, + text: "\n var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), q = [], c, i;\n return i = { next: verb(\"next\"), \"throw\": verb(\"throw\"), \"return\": verb(\"return\") }, i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }\n function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }\n function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === \"yield\" ? _yield : r.value[0] === \"delegate\" ? delegate : fulfill, reject); }\n function _yield(value) { settle(c[2], { value: value, done: false }); }\n function delegate(r) { step(r.done ? r : { value: [\"yield\", r.value], done: false }); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { c = void 0, f(v), next(); }\n };\n " + }; + function createAsyncGeneratorHelper(context, generatorFunc) { + context.requestEmitHelper(asyncGeneratorHelper); + // Mark this node as originally an async function + (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 131072 /* AsyncFunctionBody */; + return ts.createCall(ts.getHelperName("__asyncGenerator"), + /*typeArguments*/ undefined, [ + ts.createThis(), + ts.createIdentifier("arguments"), + generatorFunc + ]); + } + var asyncDelegator = { + name: "typescript:asyncDelegator", + scoped: false, + text: "\n var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {\n var i = { next: verb(\"next\"), \"throw\": verb(\"throw\", function (e) { throw e; }), \"return\": verb(\"return\", function (v) { return { value: v, done: true }; }) };\n return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { return function (v) { return { value: [\"delegate\", (o[n] || f).call(o, v)], done: false }; }; }\n };\n " + }; + function createAsyncDelegatorHelper(context, expression, location) { + context.requestEmitHelper(asyncDelegator); + return ts.setTextRange(ts.createCall(ts.getHelperName("__asyncDelegator"), + /*typeArguments*/ undefined, [expression]), location); + } + var asyncValues = { + name: "typescript:asyncValues", + scoped: false, + text: "\n var __asyncValues = (this && this.__asyncIterator) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator];\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\n };\n " + }; + function createAsyncValuesHelper(context, expression, location) { + context.requestEmitHelper(asyncValues); + return ts.setTextRange(ts.createCall(ts.getHelperName("__asyncValues"), + /*typeArguments*/ undefined, [expression]), location); + } })(ts || (ts = {})); /// /// @@ -48129,7 +52393,6 @@ var ts; (function (ts) { function transformJsx(context) { var compilerOptions = context.getCompilerOptions(); - var currentSourceFile; return transformSourceFile; /** * Transform JSX-specific syntax in a SourceFile. @@ -48140,10 +52403,8 @@ var ts; if (ts.isDeclarationFile(node)) { return node; } - currentSourceFile = node; var visited = ts.visitEachChild(node, visitor, context); ts.addEmitHelpers(visited, context.readEmitHelpers()); - currentSourceFile = undefined; return visited; } function visitor(node) { @@ -48156,11 +52417,11 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 246 /* JsxElement */: + case 248 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 247 /* JsxSelfClosingElement */: + case 249 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 252 /* JsxExpression */: + case 255 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -48170,11 +52431,11 @@ var ts; switch (node.kind) { case 10 /* JsxText */: return visitJsxText(node); - case 252 /* JsxExpression */: + case 255 /* JsxExpression */: return visitJsxExpression(node); - case 246 /* JsxElement */: + case 248 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 247 /* JsxSelfClosingElement */: + case 249 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); default: ts.Debug.failBadSyntaxKind(node); @@ -48190,7 +52451,7 @@ var ts; function visitJsxOpeningLikeElement(node, children, isChild, location) { var tagName = getTagName(node); var objectProperties; - var attrs = node.attributes; + var attrs = node.attributes.properties; if (attrs.length === 0) { // When there are no attributes, React wants "null" objectProperties = ts.createNull(); @@ -48229,13 +52490,16 @@ var ts; } function transformJsxAttributeInitializer(node) { if (node === undefined) { - return ts.createLiteral(true); + return ts.createTrue(); } else if (node.kind === 9 /* StringLiteral */) { var decoded = tryDecodeEntities(node.text); - return decoded ? ts.createLiteral(decoded, /*location*/ node) : node; + return decoded ? ts.setTextRange(ts.createLiteral(decoded), node) : node; } - else if (node.kind === 252 /* JsxExpression */) { + else if (node.kind === 255 /* JsxExpression */) { + if (node.expression === undefined) { + return ts.createTrue(); + } return visitJsxExpression(node); } else { @@ -48243,54 +52507,61 @@ var ts; } } function visitJsxText(node) { - var text = ts.getTextOfNode(node, /*includeTrivia*/ true); - var parts; + var fixed = fixupWhitespaceAndDecodeEntities(ts.getTextOfNode(node, /*includeTrivia*/ true)); + return fixed === undefined ? undefined : ts.createLiteral(fixed); + } + /** + * JSX trims whitespace at the end and beginning of lines, except that the + * start/end of a tag is considered a start/end of a line only if that line is + * on the same line as the closing tag. See examples in + * tests/cases/conformance/jsx/tsxReactEmitWhitespace.tsx + * See also https://www.w3.org/TR/html4/struct/text.html#h-9.1 and https://www.w3.org/TR/CSS2/text.html#white-space-model + * + * An equivalent algorithm would be: + * - If there is only one line, return it. + * - If there is only whitespace (but multiple lines), return `undefined`. + * - Split the text into lines. + * - 'trimRight' the first line, 'trimLeft' the last line, 'trim' middle lines. + * - Decode entities on each line (individually). + * - Remove empty lines and join the rest with " ". + */ + function fixupWhitespaceAndDecodeEntities(text) { + var acc; + // First non-whitespace character on this line. var firstNonWhitespace = 0; + // Last non-whitespace character on this line. var lastNonWhitespace = -1; - // JSX trims whitespace at the end and beginning of lines, except that the - // start/end of a tag is considered a start/end of a line only if that line is - // on the same line as the closing tag. See examples in - // tests/cases/conformance/jsx/tsxReactEmitWhitespace.tsx + // These initial values are special because the first line is: + // firstNonWhitespace = 0 to indicate that we want leading whitsepace, + // but lastNonWhitespace = -1 as a special flag to indicate that we *don't* include the line if it's all whitespace. for (var i = 0; i < text.length; i++) { var c = text.charCodeAt(i); if (ts.isLineBreak(c)) { - if (firstNonWhitespace !== -1 && (lastNonWhitespace - firstNonWhitespace + 1 > 0)) { - var part = text.substr(firstNonWhitespace, lastNonWhitespace - firstNonWhitespace + 1); - if (!parts) { - parts = []; - } - // We do not escape the string here as that is handled by the printer - // when it emits the literal. We do, however, need to decode JSX entities. - parts.push(ts.createLiteral(decodeEntities(part))); + // If we've seen any non-whitespace characters on this line, add the 'trim' of the line. + // (lastNonWhitespace === -1 is a special flag to detect whether the first line is all whitespace.) + if (firstNonWhitespace !== -1 && lastNonWhitespace !== -1) { + acc = addLineOfJsxText(acc, text.substr(firstNonWhitespace, lastNonWhitespace - firstNonWhitespace + 1)); } + // Reset firstNonWhitespace for the next line. + // Don't bother to reset lastNonWhitespace because we ignore it if firstNonWhitespace = -1. firstNonWhitespace = -1; } - else if (!ts.isWhiteSpace(c)) { + else if (!ts.isWhiteSpaceSingleLine(c)) { lastNonWhitespace = i; if (firstNonWhitespace === -1) { firstNonWhitespace = i; } } } - if (firstNonWhitespace !== -1) { - var part = text.substr(firstNonWhitespace); - if (!parts) { - parts = []; - } - // We do not escape the string here as that is handled by the printer - // when it emits the literal. We do, however, need to decode JSX entities. - parts.push(ts.createLiteral(decodeEntities(part))); - } - if (parts) { - return ts.reduceLeft(parts, aggregateJsxTextParts); - } - return undefined; + return firstNonWhitespace !== -1 + ? addLineOfJsxText(acc, text.substr(firstNonWhitespace)) + : acc; } - /** - * Aggregates two expressions by interpolating them with a whitespace literal. - */ - function aggregateJsxTextParts(left, right) { - return ts.createAdd(ts.createAdd(left, ts.createLiteral(" ")), right); + function addLineOfJsxText(acc, trimmedLine) { + // We do not escape the string here as that is handled by the printer + // when it emits the literal. We do, however, need to decode JSX entities. + var decoded = decodeEntities(trimmedLine); + return acc === undefined ? decoded : acc + " " + decoded; } /** * Replace entities like " ", "{", and "�" with the characters they encode. @@ -48305,7 +52576,7 @@ var ts; return String.fromCharCode(parseInt(hex, 16)); } else { - var ch = entities[word]; + var ch = entities.get(word); // If this is not a valid entity, then just use `match` (replace it with itself, i.e. don't replace) return ch ? String.fromCharCode(ch) : match; } @@ -48317,16 +52588,16 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 246 /* JsxElement */) { + if (node.kind === 248 /* JsxElement */) { return getTagName(node.openingElement); } else { - var name_34 = node.tagName; - if (ts.isIdentifier(name_34) && ts.isIntrinsicJsxName(name_34.text)) { - return ts.createLiteral(name_34.text); + var name = node.tagName; + if (ts.isIdentifier(name) && ts.isIntrinsicJsxName(name.text)) { + return ts.createLiteral(name.text); } else { - return ts.createExpressionFromEntityName(name_34); + return ts.createExpressionFromEntityName(name); } } } @@ -48349,7 +52620,7 @@ var ts; } } ts.transformJsx = transformJsx; - var entities = ts.createMap({ + var entities = ts.createMapFromTemplate({ "quot": 0x0022, "amp": 0x0026, "apos": 0x0027, @@ -48609,375 +52880,6 @@ var ts; /// /*@internal*/ var ts; -(function (ts) { - var ES2017SubstitutionFlags; - (function (ES2017SubstitutionFlags) { - /** Enables substitutions for async methods with `super` calls. */ - ES2017SubstitutionFlags[ES2017SubstitutionFlags["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper"; - })(ES2017SubstitutionFlags || (ES2017SubstitutionFlags = {})); - function transformES2017(context) { - var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; - var resolver = context.getEmitResolver(); - var compilerOptions = context.getCompilerOptions(); - var languageVersion = ts.getEmitScriptTarget(compilerOptions); - // These variables contain state that changes as we descend into the tree. - var currentSourceFile; - /** - * Keeps track of whether expression substitution has been enabled for specific edge cases. - * They are persisted between each SourceFile transformation and should not be reset. - */ - var enabledSubstitutions; - /** - * This keeps track of containers where `super` is valid, for use with - * just-in-time substitution for `super` expressions inside of async methods. - */ - var currentSuperContainer; - // Save the previous transformation hooks. - var previousOnEmitNode = context.onEmitNode; - var previousOnSubstituteNode = context.onSubstituteNode; - // Set new transformation hooks. - context.onEmitNode = onEmitNode; - context.onSubstituteNode = onSubstituteNode; - return transformSourceFile; - function transformSourceFile(node) { - if (ts.isDeclarationFile(node)) { - return node; - } - currentSourceFile = node; - var visited = ts.visitEachChild(node, visitor, context); - ts.addEmitHelpers(visited, context.readEmitHelpers()); - currentSourceFile = undefined; - return visited; - } - function visitor(node) { - if ((node.transformFlags & 16 /* ContainsES2017 */) === 0) { - return node; - } - switch (node.kind) { - case 119 /* AsyncKeyword */: - // ES2017 async modifier should be elided for targets < ES2017 - return undefined; - case 189 /* AwaitExpression */: - // ES2017 'await' expressions must be transformed for targets < ES2017. - return visitAwaitExpression(node); - case 149 /* MethodDeclaration */: - // ES2017 method declarations may be 'async' - return visitMethodDeclaration(node); - case 225 /* FunctionDeclaration */: - // ES2017 function declarations may be 'async' - return visitFunctionDeclaration(node); - case 184 /* FunctionExpression */: - // ES2017 function expressions may be 'async' - return visitFunctionExpression(node); - case 185 /* ArrowFunction */: - // ES2017 arrow functions may be 'async' - return visitArrowFunction(node); - default: - return ts.visitEachChild(node, visitor, context); - } - } - /** - * Visits an AwaitExpression node. - * - * This function will be called any time a ES2017 await expression is encountered. - * - * @param node The node to visit. - */ - function visitAwaitExpression(node) { - return ts.setOriginalNode(ts.createYield( - /*asteriskToken*/ undefined, ts.visitNode(node.expression, visitor, ts.isExpression), - /*location*/ node), node); - } - /** - * Visits a MethodDeclaration node. - * - * This function will be called when one of the following conditions are met: - * - The node is marked as async - * - * @param node The node to visit. - */ - function visitMethodDeclaration(node) { - return ts.updateMethod(node, - /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.name, - /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - /** - * Visits a FunctionDeclaration node. - * - * This function will be called when one of the following conditions are met: - * - The node is marked async - * - * @param node The node to visit. - */ - function visitFunctionDeclaration(node) { - return ts.updateFunctionDeclaration(node, - /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.name, - /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - /** - * Visits a FunctionExpression node. - * - * This function will be called when one of the following conditions are met: - * - The node is marked async - * - * @param node The node to visit. - */ - function visitFunctionExpression(node) { - if (ts.nodeIsMissing(node.body)) { - return ts.createOmittedExpression(); - } - return ts.updateFunctionExpression(node, - /*modifiers*/ undefined, node.name, - /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - /** - * Visits an ArrowFunction. - * - * This function will be called when one of the following conditions are met: - * - The node is marked async - * - * @param node The node to visit. - */ - function visitArrowFunction(node) { - return ts.updateArrowFunction(node, ts.visitNodes(node.modifiers, visitor, ts.isModifier), - /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - function transformAsyncFunctionBody(node) { - resumeLexicalEnvironment(); - var original = ts.getOriginalNode(node, ts.isFunctionLike); - var nodeType = original.type; - var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 185 /* ArrowFunction */; - var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; - // An async function is emit as an outer function that calls an inner - // generator function. To preserve lexical bindings, we pass the current - // `this` and `arguments` objects to `__awaiter`. The generator function - // passed to `__awaiter` is executed inside of the callback to the - // promise constructor. - if (!isArrowFunction) { - var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.body.statements, /*ensureUseStrict*/ false, visitor); - statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body, statementOffset)))); - ts.addRange(statements, endLexicalEnvironment()); - var block = ts.createBlock(statements, /*location*/ node.body, /*multiLine*/ true); - // Minor optimization, emit `_super` helper to capture `super` access in an arrow. - // This step isn't needed if we eventually transform this to ES5. - if (languageVersion >= 2 /* ES2015 */) { - if (resolver.getNodeCheckFlags(node) & 4096 /* AsyncMethodWithSuperBinding */) { - enableSubstitutionForAsyncMethodsWithSuper(); - ts.addEmitHelper(block, advancedAsyncSuperHelper); - } - else if (resolver.getNodeCheckFlags(node) & 2048 /* AsyncMethodWithSuper */) { - enableSubstitutionForAsyncMethodsWithSuper(); - ts.addEmitHelper(block, asyncSuperHelper); - } - } - return block; - } - else { - var expression = createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body)); - var declarations = endLexicalEnvironment(); - if (ts.some(declarations)) { - var block = ts.convertToFunctionBody(expression); - return ts.updateBlock(block, ts.createNodeArray(ts.concatenate(block.statements, declarations), block.statements)); - } - return expression; - } - } - function transformFunctionBodyWorker(body, start) { - if (ts.isBlock(body)) { - return ts.updateBlock(body, ts.visitLexicalEnvironment(body.statements, visitor, context, start)); - } - else { - startLexicalEnvironment(); - var visited = ts.convertToFunctionBody(ts.visitNode(body, visitor, ts.isConciseBody)); - var declarations = endLexicalEnvironment(); - return ts.updateBlock(visited, ts.createNodeArray(ts.concatenate(visited.statements, declarations), visited.statements)); - } - } - function getPromiseConstructor(type) { - var typeName = type && ts.getEntityNameFromTypeNode(type); - if (typeName && ts.isEntityName(typeName)) { - var serializationKind = resolver.getTypeReferenceSerializationKind(typeName); - if (serializationKind === ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue - || serializationKind === ts.TypeReferenceSerializationKind.Unknown) { - return typeName; - } - } - return undefined; - } - function enableSubstitutionForAsyncMethodsWithSuper() { - if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) { - enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; - // We need to enable substitutions for call, property access, and element access - // if we need to rewrite super calls. - context.enableSubstitution(179 /* CallExpression */); - context.enableSubstitution(177 /* PropertyAccessExpression */); - context.enableSubstitution(178 /* ElementAccessExpression */); - // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(226 /* ClassDeclaration */); - context.enableEmitNotification(149 /* MethodDeclaration */); - context.enableEmitNotification(151 /* GetAccessor */); - context.enableEmitNotification(152 /* SetAccessor */); - context.enableEmitNotification(150 /* Constructor */); - } - } - function substituteExpression(node) { - switch (node.kind) { - case 177 /* PropertyAccessExpression */: - return substitutePropertyAccessExpression(node); - case 178 /* ElementAccessExpression */: - return substituteElementAccessExpression(node); - case 179 /* CallExpression */: - if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) { - return substituteCallExpression(node); - } - break; - } - return node; - } - function substitutePropertyAccessExpression(node) { - if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && node.expression.kind === 96 /* SuperKeyword */) { - var flags = getSuperContainerAsyncMethodFlags(); - if (flags) { - return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), flags, node); - } - } - return node; - } - function substituteElementAccessExpression(node) { - if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && node.expression.kind === 96 /* SuperKeyword */) { - var flags = getSuperContainerAsyncMethodFlags(); - if (flags) { - return createSuperAccessInAsyncMethod(node.argumentExpression, flags, node); - } - } - return node; - } - function substituteCallExpression(node) { - var expression = node.expression; - if (ts.isSuperProperty(expression)) { - var flags = getSuperContainerAsyncMethodFlags(); - if (flags) { - var argumentExpression = ts.isPropertyAccessExpression(expression) - ? substitutePropertyAccessExpression(expression) - : substituteElementAccessExpression(expression); - return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), - /*typeArguments*/ undefined, [ - ts.createThis() - ].concat(node.arguments)); - } - } - return node; - } - function isSuperContainer(node) { - var kind = node.kind; - return kind === 226 /* ClassDeclaration */ - || kind === 150 /* Constructor */ - || kind === 149 /* MethodDeclaration */ - || kind === 151 /* GetAccessor */ - || kind === 152 /* SetAccessor */; - } - /** - * Hook for node emit. - * - * @param node The node to emit. - * @param emit A callback used to emit the node in the printer. - */ - function onEmitNode(emitContext, node, emitCallback) { - // If we need to support substitutions for `super` in an async method, - // we should track it here. - if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) { - var savedCurrentSuperContainer = currentSuperContainer; - currentSuperContainer = node; - previousOnEmitNode(emitContext, node, emitCallback); - currentSuperContainer = savedCurrentSuperContainer; - } - else { - previousOnEmitNode(emitContext, node, emitCallback); - } - } - /** - * Hooks node substitutions. - * - * @param node The node to substitute. - * @param isExpression A value indicating whether the node is to be used in an expression - * position. - */ - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1 /* Expression */) { - return substituteExpression(node); - } - return node; - } - function createSuperAccessInAsyncMethod(argumentExpression, flags, location) { - if (flags & 4096 /* AsyncMethodWithSuperBinding */) { - return ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), - /*typeArguments*/ undefined, [argumentExpression]), "value", location); - } - else { - return ts.createCall(ts.createIdentifier("_super"), - /*typeArguments*/ undefined, [argumentExpression], location); - } - } - function getSuperContainerAsyncMethodFlags() { - return currentSuperContainer !== undefined - && resolver.getNodeCheckFlags(currentSuperContainer) & (2048 /* AsyncMethodWithSuper */ | 4096 /* AsyncMethodWithSuperBinding */); - } - } - ts.transformES2017 = transformES2017; - function createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, body) { - context.requestEmitHelper(awaiterHelper); - var generatorFunc = ts.createFunctionExpression( - /*modifiers*/ undefined, ts.createToken(38 /* AsteriskToken */), - /*name*/ undefined, - /*typeParameters*/ undefined, - /*parameters*/ [], - /*type*/ undefined, body); - // Mark this node as originally an async function - (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 131072 /* AsyncFunctionBody */; - return ts.createCall(ts.getHelperName("__awaiter"), - /*typeArguments*/ undefined, [ - ts.createThis(), - hasLexicalArguments ? ts.createIdentifier("arguments") : ts.createVoidZero(), - promiseConstructor ? ts.createExpressionFromEntityName(promiseConstructor) : ts.createVoidZero(), - generatorFunc - ]); - } - var awaiterHelper = { - name: "typescript:awaiter", - scoped: false, - priority: 5, - text: "\n var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments)).next());\n });\n };" - }; - var asyncSuperHelper = { - name: "typescript:async-super", - scoped: true, - text: "\n const _super = name => super[name];" - }; - var advancedAsyncSuperHelper = { - name: "typescript:advanced-async-super", - scoped: true, - text: "\n const _super = (function (geti, seti) {\n const cache = Object.create(null);\n return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n })(name => super[name], (name, value) => super[name] = value);" - }; -})(ts || (ts = {})); -/// -/// -/*@internal*/ -var ts; (function (ts) { function transformES2016(context) { var hoistVariableDeclaration = context.hoistVariableDeclaration; @@ -48993,7 +52895,7 @@ var ts; return node; } switch (node.kind) { - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -49018,25 +52920,21 @@ var ts; // Transforms `a[x] **= b` into `(_a = a)[_x = x] = Math.pow(_a[_x], b)` var expressionTemp = ts.createTempVariable(hoistVariableDeclaration); var argumentExpressionTemp = ts.createTempVariable(hoistVariableDeclaration); - target = ts.createElementAccess(ts.createAssignment(expressionTemp, left.expression, /*location*/ left.expression), ts.createAssignment(argumentExpressionTemp, left.argumentExpression, /*location*/ left.argumentExpression), - /*location*/ left); - value = ts.createElementAccess(expressionTemp, argumentExpressionTemp, - /*location*/ left); + target = ts.setTextRange(ts.createElementAccess(ts.setTextRange(ts.createAssignment(expressionTemp, left.expression), left.expression), ts.setTextRange(ts.createAssignment(argumentExpressionTemp, left.argumentExpression), left.argumentExpression)), left); + value = ts.setTextRange(ts.createElementAccess(expressionTemp, argumentExpressionTemp), left); } else if (ts.isPropertyAccessExpression(left)) { // Transforms `a.x **= b` into `(_a = a).x = Math.pow(_a.x, b)` var expressionTemp = ts.createTempVariable(hoistVariableDeclaration); - target = ts.createPropertyAccess(ts.createAssignment(expressionTemp, left.expression, /*location*/ left.expression), left.name, - /*location*/ left); - value = ts.createPropertyAccess(expressionTemp, left.name, - /*location*/ left); + target = ts.setTextRange(ts.createPropertyAccess(ts.setTextRange(ts.createAssignment(expressionTemp, left.expression), left.expression), left.name), left); + value = ts.setTextRange(ts.createPropertyAccess(expressionTemp, left.name), left); } else { // Transforms `a **= b` into `a = Math.pow(a, b)` target = left; value = left; } - return ts.createAssignment(target, ts.createMathPow(value, right, /*location*/ node), /*location*/ node); + return ts.setTextRange(ts.createAssignment(target, ts.createMathPow(value, right, /*location*/ node)), node); } function visitExponentiationExpression(node) { // Transforms `a ** b` into `Math.pow(a, b)` @@ -49049,6 +52947,7 @@ var ts; })(ts || (ts = {})); /// /// +/// /*@internal*/ var ts; (function (ts) { @@ -49094,8 +52993,85 @@ var ts; */ SuperCaptureResult[SuperCaptureResult["ReplaceWithReturn"] = 2] = "ReplaceWithReturn"; })(SuperCaptureResult || (SuperCaptureResult = {})); + // Facts we track as we traverse the tree + var HierarchyFacts; + (function (HierarchyFacts) { + HierarchyFacts[HierarchyFacts["None"] = 0] = "None"; + // + // Ancestor facts + // + HierarchyFacts[HierarchyFacts["Function"] = 1] = "Function"; + HierarchyFacts[HierarchyFacts["ArrowFunction"] = 2] = "ArrowFunction"; + HierarchyFacts[HierarchyFacts["AsyncFunctionBody"] = 4] = "AsyncFunctionBody"; + HierarchyFacts[HierarchyFacts["NonStaticClassElement"] = 8] = "NonStaticClassElement"; + HierarchyFacts[HierarchyFacts["CapturesThis"] = 16] = "CapturesThis"; + HierarchyFacts[HierarchyFacts["ExportedVariableStatement"] = 32] = "ExportedVariableStatement"; + HierarchyFacts[HierarchyFacts["TopLevel"] = 64] = "TopLevel"; + HierarchyFacts[HierarchyFacts["Block"] = 128] = "Block"; + HierarchyFacts[HierarchyFacts["IterationStatement"] = 256] = "IterationStatement"; + HierarchyFacts[HierarchyFacts["IterationStatementBlock"] = 512] = "IterationStatementBlock"; + HierarchyFacts[HierarchyFacts["ForStatement"] = 1024] = "ForStatement"; + HierarchyFacts[HierarchyFacts["ForInOrForOfStatement"] = 2048] = "ForInOrForOfStatement"; + HierarchyFacts[HierarchyFacts["ConstructorWithCapturedSuper"] = 4096] = "ConstructorWithCapturedSuper"; + HierarchyFacts[HierarchyFacts["ComputedPropertyName"] = 8192] = "ComputedPropertyName"; + // NOTE: do not add more ancestor flags without also updating AncestorFactsMask below. + // + // Ancestor masks + // + HierarchyFacts[HierarchyFacts["AncestorFactsMask"] = 16383] = "AncestorFactsMask"; + // We are always in *some* kind of block scope, but only specific block-scope containers are + // top-level or Blocks. + HierarchyFacts[HierarchyFacts["BlockScopeIncludes"] = 0] = "BlockScopeIncludes"; + HierarchyFacts[HierarchyFacts["BlockScopeExcludes"] = 4032] = "BlockScopeExcludes"; + // A source file is a top-level block scope. + HierarchyFacts[HierarchyFacts["SourceFileIncludes"] = 64] = "SourceFileIncludes"; + HierarchyFacts[HierarchyFacts["SourceFileExcludes"] = 3968] = "SourceFileExcludes"; + // Functions, methods, and accessors are both new lexical scopes and new block scopes. + HierarchyFacts[HierarchyFacts["FunctionIncludes"] = 65] = "FunctionIncludes"; + HierarchyFacts[HierarchyFacts["FunctionExcludes"] = 16286] = "FunctionExcludes"; + HierarchyFacts[HierarchyFacts["AsyncFunctionBodyIncludes"] = 69] = "AsyncFunctionBodyIncludes"; + HierarchyFacts[HierarchyFacts["AsyncFunctionBodyExcludes"] = 16278] = "AsyncFunctionBodyExcludes"; + // Arrow functions are lexically scoped to their container, but are new block scopes. + HierarchyFacts[HierarchyFacts["ArrowFunctionIncludes"] = 66] = "ArrowFunctionIncludes"; + HierarchyFacts[HierarchyFacts["ArrowFunctionExcludes"] = 16256] = "ArrowFunctionExcludes"; + // Constructors are both new lexical scopes and new block scopes. Constructors are also + // always considered non-static members of a class. + HierarchyFacts[HierarchyFacts["ConstructorIncludes"] = 73] = "ConstructorIncludes"; + HierarchyFacts[HierarchyFacts["ConstructorExcludes"] = 16278] = "ConstructorExcludes"; + // 'do' and 'while' statements are not block scopes. We track that the subtree is contained + // within an IterationStatement to indicate whether the embedded statement is an + // IterationStatementBlock. + HierarchyFacts[HierarchyFacts["DoOrWhileStatementIncludes"] = 256] = "DoOrWhileStatementIncludes"; + HierarchyFacts[HierarchyFacts["DoOrWhileStatementExcludes"] = 0] = "DoOrWhileStatementExcludes"; + // 'for' statements are new block scopes and have special handling for 'let' declarations. + HierarchyFacts[HierarchyFacts["ForStatementIncludes"] = 1280] = "ForStatementIncludes"; + HierarchyFacts[HierarchyFacts["ForStatementExcludes"] = 3008] = "ForStatementExcludes"; + // 'for-in' and 'for-of' statements are new block scopes and have special handling for + // 'let' declarations. + HierarchyFacts[HierarchyFacts["ForInOrForOfStatementIncludes"] = 2304] = "ForInOrForOfStatementIncludes"; + HierarchyFacts[HierarchyFacts["ForInOrForOfStatementExcludes"] = 1984] = "ForInOrForOfStatementExcludes"; + // Blocks (other than function bodies) are new block scopes. + HierarchyFacts[HierarchyFacts["BlockIncludes"] = 128] = "BlockIncludes"; + HierarchyFacts[HierarchyFacts["BlockExcludes"] = 3904] = "BlockExcludes"; + HierarchyFacts[HierarchyFacts["IterationStatementBlockIncludes"] = 512] = "IterationStatementBlockIncludes"; + HierarchyFacts[HierarchyFacts["IterationStatementBlockExcludes"] = 4032] = "IterationStatementBlockExcludes"; + // Computed property names track subtree flags differently than their containing members. + HierarchyFacts[HierarchyFacts["ComputedPropertyNameIncludes"] = 8192] = "ComputedPropertyNameIncludes"; + HierarchyFacts[HierarchyFacts["ComputedPropertyNameExcludes"] = 0] = "ComputedPropertyNameExcludes"; + // + // Subtree facts + // + HierarchyFacts[HierarchyFacts["NewTarget"] = 16384] = "NewTarget"; + HierarchyFacts[HierarchyFacts["NewTargetInComputedPropertyName"] = 32768] = "NewTargetInComputedPropertyName"; + // + // Subtree masks + // + HierarchyFacts[HierarchyFacts["SubtreeFactsMask"] = -16384] = "SubtreeFactsMask"; + HierarchyFacts[HierarchyFacts["PropagateNewTargetMask"] = 49152] = "PropagateNewTargetMask"; + })(HierarchyFacts || (HierarchyFacts = {})); function transformES2015(context) { var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration; + var compilerOptions = context.getCompilerOptions(); var resolver = context.getEmitResolver(); var previousOnSubstituteNode = context.onSubstituteNode; var previousOnEmitNode = context.onEmitNode; @@ -49103,15 +53079,7 @@ var ts; context.onSubstituteNode = onSubstituteNode; var currentSourceFile; var currentText; - var currentParent; - var currentNode; - var enclosingVariableStatement; - var enclosingBlockScopeContainer; - var enclosingBlockScopeContainerParent; - var enclosingFunction; - var enclosingNonArrowFunction; - var enclosingNonAsyncFunctionBody; - var isInConstructorWithCapturedSuper; + var hierarchyFacts; /** * Used to track if we are emitting body of the converted loop */ @@ -49129,257 +53097,221 @@ var ts; } currentSourceFile = node; currentText = node.text; - var visited = saveStateAndInvoke(node, visitSourceFile); + var visited = visitSourceFile(node); ts.addEmitHelpers(visited, context.readEmitHelpers()); currentSourceFile = undefined; currentText = undefined; + hierarchyFacts = 0 /* None */; return visited; } - function visitor(node) { - return saveStateAndInvoke(node, dispatcher); + /** + * Sets the `HierarchyFacts` for this node prior to visiting this node's subtree, returning the facts set prior to modification. + * @param excludeFacts The existing `HierarchyFacts` to reset before visiting the subtree. + * @param includeFacts The new `HierarchyFacts` to set before visiting the subtree. + */ + function enterSubtree(excludeFacts, includeFacts) { + var ancestorFacts = hierarchyFacts; + hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & 16383 /* AncestorFactsMask */; + return ancestorFacts; } - function dispatcher(node) { - return convertedLoopState - ? visitorForConvertedLoopWorker(node) - : visitorWorker(node); - } - function saveStateAndInvoke(node, f) { - var savedEnclosingFunction = enclosingFunction; - var savedEnclosingNonArrowFunction = enclosingNonArrowFunction; - var savedEnclosingNonAsyncFunctionBody = enclosingNonAsyncFunctionBody; - var savedEnclosingBlockScopeContainer = enclosingBlockScopeContainer; - var savedEnclosingBlockScopeContainerParent = enclosingBlockScopeContainerParent; - var savedEnclosingVariableStatement = enclosingVariableStatement; - var savedCurrentParent = currentParent; - var savedCurrentNode = currentNode; - var savedConvertedLoopState = convertedLoopState; - var savedIsInConstructorWithCapturedSuper = isInConstructorWithCapturedSuper; - if (ts.nodeStartsNewLexicalEnvironment(node)) { - // don't treat content of nodes that start new lexical environment as part of converted loop copy or constructor body - isInConstructorWithCapturedSuper = false; - convertedLoopState = undefined; - } - onBeforeVisitNode(node); - var visited = f(node); - isInConstructorWithCapturedSuper = savedIsInConstructorWithCapturedSuper; - convertedLoopState = savedConvertedLoopState; - enclosingFunction = savedEnclosingFunction; - enclosingNonArrowFunction = savedEnclosingNonArrowFunction; - enclosingNonAsyncFunctionBody = savedEnclosingNonAsyncFunctionBody; - enclosingBlockScopeContainer = savedEnclosingBlockScopeContainer; - enclosingBlockScopeContainerParent = savedEnclosingBlockScopeContainerParent; - enclosingVariableStatement = savedEnclosingVariableStatement; - currentParent = savedCurrentParent; - currentNode = savedCurrentNode; - return visited; - } - function onBeforeVisitNode(node) { - if (currentNode) { - if (ts.isBlockScope(currentNode, currentParent)) { - enclosingBlockScopeContainer = currentNode; - enclosingBlockScopeContainerParent = currentParent; - } - if (ts.isFunctionLike(currentNode)) { - enclosingFunction = currentNode; - if (currentNode.kind !== 185 /* ArrowFunction */) { - enclosingNonArrowFunction = currentNode; - if (!(ts.getEmitFlags(currentNode) & 131072 /* AsyncFunctionBody */)) { - enclosingNonAsyncFunctionBody = currentNode; - } - } - } - // keep track of the enclosing variable statement when in the context of - // variable statements, variable declarations, binding elements, and binding - // patterns. - switch (currentNode.kind) { - case 205 /* VariableStatement */: - enclosingVariableStatement = currentNode; - break; - case 224 /* VariableDeclarationList */: - case 223 /* VariableDeclaration */: - case 174 /* BindingElement */: - case 172 /* ObjectBindingPattern */: - case 173 /* ArrayBindingPattern */: - break; - default: - enclosingVariableStatement = undefined; - } - } - currentParent = currentNode; - currentNode = node; - } - function returnCapturedThis(node) { - return ts.setOriginalNode(ts.createReturn(ts.createIdentifier("_this")), node); + /** + * Restores the `HierarchyFacts` for this node's ancestor after visiting this node's + * subtree, propagating specific facts from the subtree. + * @param ancestorFacts The `HierarchyFacts` of the ancestor to restore after visiting the subtree. + * @param excludeFacts The existing `HierarchyFacts` of the subtree that should not be propagated. + * @param includeFacts The new `HierarchyFacts` of the subtree that should be propagated. + */ + function exitSubtree(ancestorFacts, excludeFacts, includeFacts) { + hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & -16384 /* SubtreeFactsMask */ | ancestorFacts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { - return isInConstructorWithCapturedSuper && node.kind === 216 /* ReturnStatement */ && !node.expression; + return hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ + && node.kind === 218 /* ReturnStatement */ + && !node.expression; } - function shouldCheckNode(node) { - return (node.transformFlags & 64 /* ES2015 */) !== 0 || - node.kind === 219 /* LabeledStatement */ || - (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatementBody(node)); + function shouldVisitNode(node) { + return (node.transformFlags & 128 /* ContainsES2015 */) !== 0 + || convertedLoopState !== undefined + || (hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ && ts.isStatement(node)) + || (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatementBody(node)); } - function visitorWorker(node) { - if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { - return returnCapturedThis(node); - } - else if (shouldCheckNode(node)) { + function visitor(node) { + if (shouldVisitNode(node)) { return visitJavaScript(node); } - else if (node.transformFlags & 128 /* ContainsES2015 */ || (isInConstructorWithCapturedSuper && !ts.isExpression(node))) { - // we want to dive in this branch either if node has children with ES2015 specific syntax - // or we are inside constructor that captures result of the super call so all returns without expression should be - // rewritten. Note: we skip expressions since returns should never appear there - return ts.visitEachChild(node, visitor, context); - } else { return node; } } - function visitorForConvertedLoopWorker(node) { - var result; - if (shouldCheckNode(node)) { - result = visitJavaScript(node); + function functionBodyVisitor(node) { + if (shouldVisitNode(node)) { + return visitBlock(node, /*isFunctionBody*/ true); } - else { - result = visitNodesInConvertedLoop(node); - } - return result; + return node; } - function visitNodesInConvertedLoop(node) { - switch (node.kind) { - case 216 /* ReturnStatement */: - node = isReturnVoidStatementInConstructorWithCapturedSuper(node) ? returnCapturedThis(node) : node; - return visitReturnStatement(node); - case 205 /* VariableStatement */: - return visitVariableStatement(node); - case 218 /* SwitchStatement */: - return visitSwitchStatement(node); - case 215 /* BreakStatement */: - case 214 /* ContinueStatement */: - return visitBreakOrContinueStatement(node); - case 98 /* ThisKeyword */: - return visitThisKeyword(node); - case 70 /* Identifier */: - return visitIdentifier(node); - default: - return ts.visitEachChild(node, visitor, context); + function callExpressionVisitor(node) { + if (node.kind === 96 /* SuperKeyword */) { + return visitSuperKeyword(/*isExpressionOfCall*/ true); } + return visitor(node); } function visitJavaScript(node) { switch (node.kind) { case 114 /* StaticKeyword */: return undefined; // elide static keyword - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: return visitClassDeclaration(node); - case 197 /* ClassExpression */: + case 198 /* ClassExpression */: return visitClassExpression(node); - case 144 /* Parameter */: + case 145 /* Parameter */: return visitParameter(node); - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 185 /* ArrowFunction */: + case 186 /* ArrowFunction */: return visitArrowFunction(node); - case 184 /* FunctionExpression */: + case 185 /* FunctionExpression */: return visitFunctionExpression(node); - case 223 /* VariableDeclaration */: + case 225 /* VariableDeclaration */: return visitVariableDeclaration(node); case 70 /* Identifier */: return visitIdentifier(node); - case 224 /* VariableDeclarationList */: + case 226 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 219 /* LabeledStatement */: + case 220 /* SwitchStatement */: + return visitSwitchStatement(node); + case 234 /* CaseBlock */: + return visitCaseBlock(node); + case 206 /* Block */: + return visitBlock(node, /*isFunctionBody*/ false); + case 217 /* BreakStatement */: + case 216 /* ContinueStatement */: + return visitBreakOrContinueStatement(node); + case 221 /* LabeledStatement */: return visitLabeledStatement(node); - case 209 /* DoStatement */: - return visitDoStatement(node); - case 210 /* WhileStatement */: - return visitWhileStatement(node); - case 211 /* ForStatement */: - return visitForStatement(node); - case 212 /* ForInStatement */: - return visitForInStatement(node); - case 213 /* ForOfStatement */: - return visitForOfStatement(node); - case 207 /* ExpressionStatement */: + case 211 /* DoStatement */: + case 212 /* WhileStatement */: + return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); + case 213 /* ForStatement */: + return visitForStatement(node, /*outermostLabeledStatement*/ undefined); + case 214 /* ForInStatement */: + return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); + case 215 /* ForOfStatement */: + return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); + case 209 /* ExpressionStatement */: return visitExpressionStatement(node); - case 176 /* ObjectLiteralExpression */: + case 177 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 256 /* CatchClause */: + case 259 /* CatchClause */: return visitCatchClause(node); - case 258 /* ShorthandPropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 175 /* ArrayLiteralExpression */: + case 143 /* ComputedPropertyName */: + return visitComputedPropertyName(node); + case 176 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 179 /* CallExpression */: + case 180 /* CallExpression */: return visitCallExpression(node); - case 180 /* NewExpression */: + case 181 /* NewExpression */: return visitNewExpression(node); - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return visitBinaryExpression(node, /*needsDestructuringValue*/ true); case 12 /* NoSubstitutionTemplateLiteral */: case 13 /* TemplateHead */: case 14 /* TemplateMiddle */: case 15 /* TemplateTail */: return visitTemplateLiteral(node); - case 181 /* TaggedTemplateExpression */: + case 9 /* StringLiteral */: + return visitStringLiteral(node); + case 8 /* NumericLiteral */: + return visitNumericLiteral(node); + case 182 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 194 /* TemplateExpression */: + case 195 /* TemplateExpression */: return visitTemplateExpression(node); - case 195 /* YieldExpression */: + case 196 /* YieldExpression */: return visitYieldExpression(node); - case 196 /* SpreadElement */: + case 197 /* SpreadElement */: return visitSpreadElement(node); case 96 /* SuperKeyword */: - return visitSuperKeyword(); - case 195 /* YieldExpression */: - // `yield` will be handled by a generators transform. - return ts.visitEachChild(node, visitor, context); - case 149 /* MethodDeclaration */: + return visitSuperKeyword(/*isExpressionOfCall*/ false); + case 98 /* ThisKeyword */: + return visitThisKeyword(node); + case 203 /* MetaProperty */: + return visitMetaProperty(node); + case 150 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 205 /* VariableStatement */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + return visitAccessorDeclaration(node); + case 207 /* VariableStatement */: return visitVariableStatement(node); + case 218 /* ReturnStatement */: + return visitReturnStatement(node); default: - ts.Debug.failBadSyntaxKind(node); return ts.visitEachChild(node, visitor, context); } } function visitSourceFile(node) { + var ancestorFacts = enterSubtree(3968 /* SourceFileExcludes */, 64 /* SourceFileIncludes */); var statements = []; startLexicalEnvironment(); - var statementOffset = ts.addPrologueDirectives(statements, node.statements, /*ensureUseStrict*/ false, visitor); + var statementOffset = ts.addStandardPrologue(statements, node.statements, /*ensureUseStrict*/ false); addCaptureThisForNodeIfNeeded(statements, node); + statementOffset = ts.addCustomPrologue(statements, node.statements, statementOffset, visitor); ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset)); ts.addRange(statements, endLexicalEnvironment()); - return ts.updateSourceFileNode(node, ts.createNodeArray(statements, node.statements)); + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements)); } function visitSwitchStatement(node) { - ts.Debug.assert(convertedLoopState !== undefined); - var savedAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; - // for switch statement allow only non-labeled break - convertedLoopState.allowedNonLabeledJumps |= 2 /* Break */; - var result = ts.visitEachChild(node, visitor, context); - convertedLoopState.allowedNonLabeledJumps = savedAllowedNonLabeledJumps; - return result; + if (convertedLoopState !== undefined) { + var savedAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; + // for switch statement allow only non-labeled break + convertedLoopState.allowedNonLabeledJumps |= 2 /* Break */; + var result = ts.visitEachChild(node, visitor, context); + convertedLoopState.allowedNonLabeledJumps = savedAllowedNonLabeledJumps; + return result; + } + return ts.visitEachChild(node, visitor, context); + } + function visitCaseBlock(node) { + var ancestorFacts = enterSubtree(4032 /* BlockScopeExcludes */, 0 /* BlockScopeIncludes */); + var updated = ts.visitEachChild(node, visitor, context); + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return updated; + } + function returnCapturedThis(node) { + return ts.setOriginalNode(ts.createReturn(ts.createIdentifier("_this")), node); } function visitReturnStatement(node) { - ts.Debug.assert(convertedLoopState !== undefined); - convertedLoopState.nonLocalJumps |= 8 /* Return */; - return ts.createReturn(ts.createObjectLiteral([ - ts.createPropertyAssignment(ts.createIdentifier("value"), node.expression - ? ts.visitNode(node.expression, visitor, ts.isExpression) - : ts.createVoidZero()) - ])); + if (convertedLoopState) { + convertedLoopState.nonLocalJumps |= 8 /* Return */; + if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { + node = returnCapturedThis(node); + } + return ts.createReturn(ts.createObjectLiteral([ + ts.createPropertyAssignment(ts.createIdentifier("value"), node.expression + ? ts.visitNode(node.expression, visitor, ts.isExpression) + : ts.createVoidZero()) + ])); + } + else if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { + return returnCapturedThis(node); + } + return ts.visitEachChild(node, visitor, context); } function visitThisKeyword(node) { - ts.Debug.assert(convertedLoopState !== undefined); - if (enclosingFunction && enclosingFunction.kind === 185 /* ArrowFunction */) { - // if the enclosing function is an ArrowFunction is then we use the captured 'this' keyword. - convertedLoopState.containsLexicalThis = true; - return node; + if (convertedLoopState) { + if (hierarchyFacts & 2 /* ArrowFunction */) { + // if the enclosing function is an ArrowFunction then we use the captured 'this' keyword. + convertedLoopState.containsLexicalThis = true; + return node; + } + return convertedLoopState.thisName || (convertedLoopState.thisName = ts.createUniqueName("this")); } - return convertedLoopState.thisName || (convertedLoopState.thisName = ts.createUniqueName("this")); + return node; } function visitIdentifier(node) { if (!convertedLoopState) { @@ -49388,7 +53320,7 @@ var ts; if (ts.isGeneratedIdentifier(node)) { return node; } - if (node.text !== "arguments" && !resolver.isArgumentsLocalBinding(node)) { + if (node.text !== "arguments" || !resolver.isArgumentsLocalBinding(node)) { return node; } return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = ts.createUniqueName("arguments")); @@ -49399,13 +53331,13 @@ var ts; // it is possible if either // - break/continue is labeled and label is located inside the converted loop // - break/continue is non-labeled and located in non-converted loop/switch statement - var jump = node.kind === 215 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; - var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels[node.label.text]) || + var jump = node.kind === 217 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(node.label.text)) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; if (!node.label) { - if (node.kind === 215 /* BreakStatement */) { + if (node.kind === 217 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -49416,7 +53348,7 @@ var ts; } } else { - if (node.kind === 215 /* BreakStatement */) { + if (node.kind === 217 /* BreakStatement */) { labelMarker = "break-" + node.label.text; setLabeledJump(convertedLoopState, /*isBreak*/ true, node.label.text, labelMarker); } @@ -49464,8 +53396,9 @@ var ts; /*type*/ undefined, transformClassLikeDeclarationToExpression(node)); ts.setOriginalNode(variable, node); var statements = []; - var statement = ts.createVariableStatement(/*modifiers*/ undefined, ts.createVariableDeclarationList([variable]), /*location*/ node); + var statement = ts.createVariableStatement(/*modifiers*/ undefined, ts.createVariableDeclarationList([variable])); ts.setOriginalNode(statement, node); + ts.setTextRange(statement, node); ts.startOnNewLine(statement); statements.push(statement); // Add an `export default` statement for default exports (for `--target es5 --module es6`) @@ -49583,7 +53516,7 @@ var ts; ts.setEmitFlags(statement, 1536 /* NoComments */ | 384 /* NoTokenSourceMaps */); statements.push(statement); ts.addRange(statements, endLexicalEnvironment()); - var block = ts.createBlock(ts.createNodeArray(statements, /*location*/ node.members), /*location*/ undefined, /*multiLine*/ true); + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), /*location*/ node.members), /*multiLine*/ true); ts.setEmitFlags(block, 1536 /* NoComments */); return block; } @@ -49596,7 +53529,7 @@ var ts; */ function addExtendsHelperIfNeeded(statements, node, extendsClauseElement) { if (extendsClauseElement) { - statements.push(ts.createStatement(createExtendsHelper(context, ts.getLocalName(node)), + statements.push(ts.setTextRange(ts.createStatement(createExtendsHelper(context, ts.getLocalName(node))), /*location*/ extendsClauseElement)); } } @@ -49608,6 +53541,9 @@ var ts; * @param extendsClauseElement The expression for the class `extends` clause. */ function addConstructor(statements, node, extendsClauseElement) { + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16278 /* ConstructorExcludes */, 73 /* ConstructorIncludes */); var constructor = ts.getFirstConstructorWithBody(node); var hasSynthesizedSuper = hasSynthesizedDefaultSuperCall(constructor, extendsClauseElement !== undefined); var constructorFunction = ts.createFunctionDeclaration( @@ -49615,12 +53551,14 @@ var ts; /*modifiers*/ undefined, /*asteriskToken*/ undefined, ts.getDeclarationName(node), /*typeParameters*/ undefined, transformConstructorParameters(constructor, hasSynthesizedSuper), - /*type*/ undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper), - /*location*/ constructor || node); + /*type*/ undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper)); + ts.setTextRange(constructorFunction, constructor || node); if (extendsClauseElement) { ts.setEmitFlags(constructorFunction, 8 /* CapturesThis */); } statements.push(constructorFunction); + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, 0 /* None */); + convertedLoopState = savedConvertedLoopState; } /** * Transforms the parameters of the constructor declaration of a class. @@ -49658,38 +53596,46 @@ var ts; statementOffset = 0; } else if (constructor) { - // Otherwise, try to emit all potential prologue directives first. - statementOffset = ts.addPrologueDirectives(statements, constructor.body.statements, /*ensureUseStrict*/ false, visitor); + statementOffset = ts.addStandardPrologue(statements, constructor.body.statements, /*ensureUseStrict*/ false); } if (constructor) { addDefaultValueAssignmentsIfNeeded(statements, constructor); addRestParameterIfNeeded(statements, constructor, hasSynthesizedSuper); + if (!hasSynthesizedSuper) { + // If no super call has been synthesized, emit custom prologue directives. + statementOffset = ts.addCustomPrologue(statements, constructor.body.statements, statementOffset, visitor); + } ts.Debug.assert(statementOffset >= 0, "statementOffset not initialized correctly!"); } - var superCaptureStatus = declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, constructor, !!extendsClauseElement, hasSynthesizedSuper, statementOffset); + // determine whether the class is known syntactically to be a derived class (e.g. a + // class that extends a value that is not syntactically known to be `null`). + var isDerivedClass = extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 94 /* NullKeyword */; + var superCaptureStatus = declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, constructor, isDerivedClass, hasSynthesizedSuper, statementOffset); // The last statement expression was replaced. Skip it. if (superCaptureStatus === 1 /* ReplaceSuperCapture */ || superCaptureStatus === 2 /* ReplaceWithReturn */) { statementOffset++; } if (constructor) { - var body = saveStateAndInvoke(constructor, function (constructor) { - isInConstructorWithCapturedSuper = superCaptureStatus === 1 /* ReplaceSuperCapture */; - return ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, /*start*/ statementOffset); - }); - ts.addRange(statements, body); + if (superCaptureStatus === 1 /* ReplaceSuperCapture */) { + hierarchyFacts |= 4096 /* ConstructorWithCapturedSuper */; + } + ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, /*start*/ statementOffset)); } // Return `_this` unless we're sure enough that it would be pointless to add a return statement. // If there's a constructor that we can tell returns in enough places, then we *do not* want to add a return. - if (extendsClauseElement + if (isDerivedClass && superCaptureStatus !== 2 /* ReplaceWithReturn */ && !(constructor && isSufficientlyCoveredByReturnStatements(constructor.body))) { statements.push(ts.createReturn(ts.createIdentifier("_this"))); } ts.addRange(statements, endLexicalEnvironment()); - var block = ts.createBlock(ts.createNodeArray(statements, + if (constructor) { + prependCaptureNewTargetIfNeeded(statements, constructor, /*copyOnWrite*/ false); + } + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), /*location*/ constructor ? constructor.body.statements : node.members), - /*location*/ constructor ? constructor.body : node, /*multiLine*/ true); + ts.setTextRange(block, constructor ? constructor.body : node); if (!constructor) { ts.setEmitFlags(block, 1536 /* NoComments */); } @@ -49702,17 +53648,17 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 216 /* ReturnStatement */) { + if (statement.kind === 218 /* ReturnStatement */) { return true; } - else if (statement.kind === 208 /* IfStatement */) { + else if (statement.kind === 210 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement); } } - else if (statement.kind === 204 /* Block */) { + else if (statement.kind === 206 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -49725,9 +53671,9 @@ var ts; * * @returns The new statement offset into the `statements` array. */ - function declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, ctor, hasExtendsClause, hasSynthesizedSuper, statementOffset) { + function declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, ctor, isDerivedClass, hasSynthesizedSuper, statementOffset) { // If this isn't a derived class, just capture 'this' for arrow functions if necessary. - if (!hasExtendsClause) { + if (!isDerivedClass) { if (ctor) { addCaptureThisForNodeIfNeeded(statements, ctor); } @@ -49770,16 +53716,18 @@ var ts; var ctorStatements = ctor.body.statements; if (statementOffset < ctorStatements.length) { firstStatement = ctorStatements[statementOffset]; - if (firstStatement.kind === 207 /* ExpressionStatement */ && ts.isSuperCall(firstStatement.expression)) { - var superCall = firstStatement.expression; - superCallExpression = ts.setOriginalNode(saveStateAndInvoke(superCall, visitImmediateSuperCallInBody), superCall); + if (firstStatement.kind === 209 /* ExpressionStatement */ && ts.isSuperCall(firstStatement.expression)) { + superCallExpression = visitImmediateSuperCallInBody(firstStatement.expression); } } - // Return the result if we have an immediate super() call on the last statement. - if (superCallExpression && statementOffset === ctorStatements.length - 1) { + // Return the result if we have an immediate super() call on the last statement, + // but only if the constructor itself doesn't use 'this' elsewhere. + if (superCallExpression + && statementOffset === ctorStatements.length - 1 + && !(ctor.transformFlags & (16384 /* ContainsLexicalThis */ | 32768 /* ContainsCapturedLexicalThis */))) { var returnStatement = ts.createReturn(superCallExpression); - if (superCallExpression.kind !== 192 /* BinaryExpression */ - || superCallExpression.left.kind !== 179 /* CallExpression */) { + if (superCallExpression.kind !== 193 /* BinaryExpression */ + || superCallExpression.left.kind !== 180 /* CallExpression */) { ts.Debug.fail("Assumed generated super call would have form 'super.call(...) || this'."); } // Shift comments from the original super call to the return statement. @@ -49788,18 +53736,18 @@ var ts; return 2 /* ReplaceWithReturn */; } // Perform the capture. - captureThisForNode(statements, ctor, superCallExpression, firstStatement); + captureThisForNode(statements, ctor, superCallExpression || createActualThis(), firstStatement); // If we're actually replacing the original statement, we need to signal this to the caller. if (superCallExpression) { return 1 /* ReplaceSuperCapture */; } return 0 /* NoReplacement */; } + function createActualThis() { + return ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */); + } function createDefaultSuperCallOrThis() { - var actualThis = ts.createThis(); - ts.setEmitFlags(actualThis, 4 /* NoSubstitution */); - var superCall = ts.createFunctionApply(ts.createIdentifier("_super"), actualThis, ts.createIdentifier("arguments")); - return ts.createLogicalOr(superCall, actualThis); + return ts.createLogicalOr(ts.createLogicalAnd(ts.createStrictInequality(ts.createIdentifier("_super"), ts.createNull()), ts.createFunctionApply(ts.createIdentifier("_super"), createActualThis(), ts.createIdentifier("arguments"))), createActualThis()); } /** * Visits a parameter declaration. @@ -49814,25 +53762,25 @@ var ts; else if (ts.isBindingPattern(node.name)) { // Binding patterns are converted into a generated name and are // evaluated inside the function body. - return ts.setOriginalNode(ts.createParameter( + return ts.setOriginalNode(ts.setTextRange(ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, ts.getGeneratedNameForNode(node), /*questionToken*/ undefined, /*type*/ undefined, - /*initializer*/ undefined, + /*initializer*/ undefined), /*location*/ node), /*original*/ node); } else if (node.initializer) { // Initializers are elided - return ts.setOriginalNode(ts.createParameter( + return ts.setOriginalNode(ts.setTextRange(ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, node.name, /*questionToken*/ undefined, /*type*/ undefined, - /*initializer*/ undefined, + /*initializer*/ undefined), /*location*/ node), /*original*/ node); } @@ -49862,17 +53810,17 @@ var ts; } for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { var parameter = _a[_i]; - var name_35 = parameter.name, initializer = parameter.initializer, dotDotDotToken = parameter.dotDotDotToken; + var name = parameter.name, initializer = parameter.initializer, dotDotDotToken = parameter.dotDotDotToken; // A rest parameter cannot have a binding pattern or an initializer, // so let's just ignore it. if (dotDotDotToken) { continue; } - if (ts.isBindingPattern(name_35)) { - addDefaultValueAssignmentForBindingPattern(statements, parameter, name_35, initializer); + if (ts.isBindingPattern(name)) { + addDefaultValueAssignmentForBindingPattern(statements, parameter, name, initializer); } else if (initializer) { - addDefaultValueAssignmentForInitializer(statements, parameter, name_35, initializer); + addDefaultValueAssignmentForInitializer(statements, parameter, name, initializer); } } } @@ -49907,13 +53855,11 @@ var ts; */ function addDefaultValueAssignmentForInitializer(statements, parameter, name, initializer) { initializer = ts.visitNode(initializer, visitor, ts.isExpression); - var statement = ts.createIf(ts.createTypeCheck(ts.getSynthesizedClone(name), "undefined"), ts.setEmitFlags(ts.createBlock([ - ts.createStatement(ts.createAssignment(ts.setEmitFlags(ts.getMutableClone(name), 48 /* NoSourceMap */), ts.setEmitFlags(initializer, 48 /* NoSourceMap */ | ts.getEmitFlags(initializer)), - /*location*/ parameter)) - ], /*location*/ parameter), 1 /* SingleLine */ | 32 /* NoTrailingSourceMap */ | 384 /* NoTokenSourceMaps */), - /*elseStatement*/ undefined, - /*location*/ parameter); + var statement = ts.createIf(ts.createTypeCheck(ts.getSynthesizedClone(name), "undefined"), ts.setEmitFlags(ts.setTextRange(ts.createBlock([ + ts.createStatement(ts.setTextRange(ts.createAssignment(ts.setEmitFlags(ts.getMutableClone(name), 48 /* NoSourceMap */), ts.setEmitFlags(initializer, 48 /* NoSourceMap */ | ts.getEmitFlags(initializer))), parameter)) + ]), parameter), 1 /* SingleLine */ | 32 /* NoTrailingSourceMap */ | 384 /* NoTokenSourceMaps */)); statement.startsOnNewLine = true; + ts.setTextRange(statement, parameter); ts.setEmitFlags(statement, 384 /* NoTokenSourceMaps */ | 32 /* NoTrailingSourceMap */ | 524288 /* CustomPrologue */); statements.push(statement); } @@ -49950,22 +53896,21 @@ var ts; var restIndex = node.parameters.length - 1; var temp = ts.createLoopVariable(); // var param = []; - statements.push(ts.setEmitFlags(ts.createVariableStatement( + statements.push(ts.setEmitFlags(ts.setTextRange(ts.createVariableStatement( /*modifiers*/ undefined, ts.createVariableDeclarationList([ ts.createVariableDeclaration(declarationName, /*type*/ undefined, ts.createArrayLiteral([])) - ]), + ])), /*location*/ parameter), 524288 /* CustomPrologue */)); // for (var _i = restIndex; _i < arguments.length; _i++) { // param[_i - restIndex] = arguments[_i]; // } - var forStatement = ts.createFor(ts.createVariableDeclarationList([ + var forStatement = ts.createFor(ts.setTextRange(ts.createVariableDeclarationList([ ts.createVariableDeclaration(temp, /*type*/ undefined, ts.createLiteral(restIndex)) - ], /*location*/ parameter), ts.createLessThan(temp, ts.createPropertyAccess(ts.createIdentifier("arguments"), "length"), - /*location*/ parameter), ts.createPostfixIncrement(temp, /*location*/ parameter), ts.createBlock([ - ts.startOnNewLine(ts.createStatement(ts.createAssignment(ts.createElementAccess(expressionName, restIndex === 0 + ]), parameter), ts.setTextRange(ts.createLessThan(temp, ts.createPropertyAccess(ts.createIdentifier("arguments"), "length")), parameter), ts.setTextRange(ts.createPostfixIncrement(temp), parameter), ts.createBlock([ + ts.startOnNewLine(ts.setTextRange(ts.createStatement(ts.createAssignment(ts.createElementAccess(expressionName, restIndex === 0 ? temp - : ts.createSubtract(temp, ts.createLiteral(restIndex))), ts.createElementAccess(ts.createIdentifier("arguments"), temp)), + : ts.createSubtract(temp, ts.createLiteral(restIndex))), ts.createElementAccess(ts.createIdentifier("arguments"), temp))), /*location*/ parameter)) ])); ts.setEmitFlags(forStatement, 524288 /* CustomPrologue */); @@ -49979,7 +53924,7 @@ var ts; * @param node A node. */ function addCaptureThisForNodeIfNeeded(statements, node) { - if (node.transformFlags & 32768 /* ContainsCapturedLexicalThis */ && node.kind !== 185 /* ArrowFunction */) { + if (node.transformFlags & 32768 /* ContainsCapturedLexicalThis */ && node.kind !== 186 /* ArrowFunction */) { captureThisForNode(statements, node, ts.createThis()); } } @@ -49989,11 +53934,52 @@ var ts; /*modifiers*/ undefined, ts.createVariableDeclarationList([ ts.createVariableDeclaration("_this", /*type*/ undefined, initializer) - ]), originalStatement); + ])); ts.setEmitFlags(captureThisStatement, 1536 /* NoComments */ | 524288 /* CustomPrologue */); + ts.setTextRange(captureThisStatement, originalStatement); ts.setSourceMapRange(captureThisStatement, node); statements.push(captureThisStatement); } + function prependCaptureNewTargetIfNeeded(statements, node, copyOnWrite) { + if (hierarchyFacts & 16384 /* NewTarget */) { + var newTarget = void 0; + switch (node.kind) { + case 186 /* ArrowFunction */: + return statements; + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + // Methods and accessors cannot be constructors, so 'new.target' will + // always return 'undefined'. + newTarget = ts.createVoidZero(); + break; + case 151 /* Constructor */: + // Class constructors can only be called with `new`, so `this.constructor` + // should be relatively safe to use. + newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"); + break; + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + // Functions can be called or constructed, and may have a `this` due to + // being a member or when calling an imported function via `other_1.f()`. + newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), 92 /* InstanceOfKeyword */, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"), ts.createVoidZero()); + break; + default: + ts.Debug.failBadSyntaxKind(node); + break; + } + var captureNewTargetStatement = ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration("_newTarget", + /*type*/ undefined, newTarget) + ])); + if (copyOnWrite) { + return [captureNewTargetStatement].concat(statements); + } + statements.unshift(captureNewTargetStatement); + } + return statements; + } /** * Adds statements to the class body function for a class to define the members of the * class. @@ -50005,20 +53991,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 203 /* SemicolonClassElement */: + case 205 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 149 /* MethodDeclaration */: - statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member)); + case 150 /* MethodDeclaration */: + statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { - statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors)); + statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 150 /* Constructor */: + case 151 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -50033,7 +54019,7 @@ var ts; * @param member The SemicolonClassElement node. */ function transformSemicolonClassElementToStatement(member) { - return ts.createEmptyStatement(/*location*/ member); + return ts.setTextRange(ts.createEmptyStatement(), member); } /** * Transforms a MethodDeclaration into a statement for a class body function. @@ -50041,14 +54027,15 @@ var ts; * @param receiver The receiver for the member. * @param member The MethodDeclaration node. */ - function transformClassMethodDeclarationToStatement(receiver, member) { + function transformClassMethodDeclarationToStatement(receiver, member, container) { + var ancestorFacts = enterSubtree(0 /* None */, 0 /* None */); var commentRange = ts.getCommentRange(member); var sourceMapRange = ts.getSourceMapRange(member); var memberName = ts.createMemberAccessForPropertyName(receiver, ts.visitNode(member.name, visitor, ts.isPropertyName), /*location*/ member.name); - var memberFunction = transformFunctionLikeToExpression(member, /*location*/ member, /*name*/ undefined); + var memberFunction = transformFunctionLikeToExpression(member, /*location*/ member, /*name*/ undefined, container); ts.setEmitFlags(memberFunction, 1536 /* NoComments */); ts.setSourceMapRange(memberFunction, sourceMapRange); - var statement = ts.createStatement(ts.createAssignment(memberName, memberFunction), + var statement = ts.setTextRange(ts.createStatement(ts.createAssignment(memberName, memberFunction)), /*location*/ member); ts.setOriginalNode(statement, member); ts.setCommentRange(statement, commentRange); @@ -50056,6 +54043,7 @@ var ts; // No source map should be emitted for this statement to align with the // old emitter. ts.setEmitFlags(statement, 48 /* NoSourceMap */); + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, hierarchyFacts & 49152 /* PropagateNewTargetMask */ ? 16384 /* NewTarget */ : 0 /* None */); return statement; } /** @@ -50064,13 +54052,13 @@ var ts; * @param receiver The receiver for the member. * @param accessors The set of related get/set accessors. */ - function transformAccessorsToStatement(receiver, accessors) { - var statement = ts.createStatement(transformAccessorsToExpression(receiver, accessors, /*startsOnNewLine*/ false), - /*location*/ ts.getSourceMapRange(accessors.firstAccessor)); + function transformAccessorsToStatement(receiver, accessors, container) { + var statement = ts.createStatement(transformAccessorsToExpression(receiver, accessors, container, /*startsOnNewLine*/ false)); // The location for the statement is used to emit source maps only. // No comments should be emitted for this statement to align with the // old emitter. ts.setEmitFlags(statement, 1536 /* NoComments */); + ts.setSourceMapRange(statement, ts.getSourceMapRange(accessors.firstAccessor)); return statement; } /** @@ -50079,8 +54067,9 @@ var ts; * * @param receiver The receiver for the member. */ - function transformAccessorsToExpression(receiver, _a, startsOnNewLine) { + function transformAccessorsToExpression(receiver, _a, container, startsOnNewLine) { var firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; + var ancestorFacts = enterSubtree(0 /* None */, 0 /* None */); // To align with source maps in the old emitter, the receiver and property name // arguments are both mapped contiguously to the accessor name. var target = ts.getMutableClone(receiver); @@ -50091,7 +54080,7 @@ var ts; ts.setSourceMapRange(propertyName, firstAccessor.name); var properties = []; if (getAccessor) { - var getterFunction = transformFunctionLikeToExpression(getAccessor, /*location*/ undefined, /*name*/ undefined); + var getterFunction = transformFunctionLikeToExpression(getAccessor, /*location*/ undefined, /*name*/ undefined, container); ts.setSourceMapRange(getterFunction, ts.getSourceMapRange(getAccessor)); ts.setEmitFlags(getterFunction, 512 /* NoLeadingComments */); var getter = ts.createPropertyAssignment("get", getterFunction); @@ -50099,23 +54088,24 @@ var ts; properties.push(getter); } if (setAccessor) { - var setterFunction = transformFunctionLikeToExpression(setAccessor, /*location*/ undefined, /*name*/ undefined); + var setterFunction = transformFunctionLikeToExpression(setAccessor, /*location*/ undefined, /*name*/ undefined, container); ts.setSourceMapRange(setterFunction, ts.getSourceMapRange(setAccessor)); ts.setEmitFlags(setterFunction, 512 /* NoLeadingComments */); var setter = ts.createPropertyAssignment("set", setterFunction); ts.setCommentRange(setter, ts.getCommentRange(setAccessor)); properties.push(setter); } - properties.push(ts.createPropertyAssignment("enumerable", ts.createLiteral(true)), ts.createPropertyAssignment("configurable", ts.createLiteral(true))); + properties.push(ts.createPropertyAssignment("enumerable", ts.createTrue()), ts.createPropertyAssignment("configurable", ts.createTrue())); var call = ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), /*typeArguments*/ undefined, [ target, propertyName, - ts.createObjectLiteral(properties, /*location*/ undefined, /*multiLine*/ true) + ts.createObjectLiteral(properties, /*multiLine*/ true) ]); if (startsOnNewLine) { call.startsOnNewLine = true; } + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, hierarchyFacts & 49152 /* PropagateNewTargetMask */ ? 16384 /* NewTarget */ : 0 /* None */); return call; } /** @@ -50127,14 +54117,20 @@ var ts; if (node.transformFlags & 16384 /* ContainsLexicalThis */) { enableSubstitutionsForCapturedThis(); } + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16256 /* ArrowFunctionExcludes */, 66 /* ArrowFunctionIncludes */); var func = ts.createFunctionExpression( /*modifiers*/ undefined, /*asteriskToken*/ undefined, /*name*/ undefined, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, transformFunctionBody(node), node); + /*type*/ undefined, transformFunctionBody(node)); + ts.setTextRange(func, node); ts.setOriginalNode(func, node); ts.setEmitFlags(func, 8 /* CapturesThis */); + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + convertedLoopState = savedConvertedLoopState; return func; } /** @@ -50143,12 +54139,24 @@ var ts; * @param node a FunctionExpression node. */ function visitFunctionExpression(node) { - return ts.updateFunctionExpression(node, - /*modifiers*/ undefined, node.name, - /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, node.transformFlags & 64 /* ES2015 */ + var ancestorFacts = ts.getEmitFlags(node) & 131072 /* AsyncFunctionBody */ + ? enterSubtree(16278 /* AsyncFunctionBodyExcludes */, 69 /* AsyncFunctionBodyIncludes */) + : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var parameters = ts.visitParameterList(node.parameters, visitor, context); + var body = node.transformFlags & 64 /* ES2015 */ ? transformFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); + : visitFunctionBodyDownLevel(node); + var name = hierarchyFacts & 16384 /* NewTarget */ + ? ts.getLocalName(node) + : node.name; + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, 0 /* None */); + convertedLoopState = savedConvertedLoopState; + return ts.updateFunctionExpression(node, + /*modifiers*/ undefined, node.asteriskToken, name, + /*typeParameters*/ undefined, parameters, + /*type*/ undefined, body); } /** * Visits a FunctionDeclaration node. @@ -50156,12 +54164,22 @@ var ts; * @param node a FunctionDeclaration node. */ function visitFunctionDeclaration(node) { - return ts.updateFunctionDeclaration(node, - /*decorators*/ undefined, node.modifiers, node.name, - /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, node.transformFlags & 64 /* ES2015 */ + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); + var parameters = ts.visitParameterList(node.parameters, visitor, context); + var body = node.transformFlags & 64 /* ES2015 */ ? transformFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); + : visitFunctionBodyDownLevel(node); + var name = hierarchyFacts & 16384 /* NewTarget */ + ? ts.getLocalName(node) + : node.name; + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, 0 /* None */); + convertedLoopState = savedConvertedLoopState; + return ts.updateFunctionDeclaration(node, + /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, name, + /*typeParameters*/ undefined, parameters, + /*type*/ undefined, body); } /** * Transforms a function-like node into a FunctionExpression. @@ -50170,18 +54188,24 @@ var ts; * @param location The source-map location for the new FunctionExpression. * @param name The name of the new FunctionExpression. */ - function transformFunctionLikeToExpression(node, location, name) { - var savedContainingNonArrowFunction = enclosingNonArrowFunction; - if (node.kind !== 185 /* ArrowFunction */) { - enclosingNonArrowFunction = node; + function transformFunctionLikeToExpression(node, location, name, container) { + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = container && ts.isClassLike(container) && !ts.hasModifier(node, 32 /* Static */) + ? enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */ | 8 /* NonStaticClassElement */) + : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); + var parameters = ts.visitParameterList(node.parameters, visitor, context); + var body = transformFunctionBody(node); + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 227 /* FunctionDeclaration */ || node.kind === 185 /* FunctionExpression */)) { + name = ts.getGeneratedNameForNode(node); } - var expression = ts.setOriginalNode(ts.createFunctionExpression( + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, 0 /* None */); + convertedLoopState = savedConvertedLoopState; + return ts.setOriginalNode(ts.setTextRange(ts.createFunctionExpression( /*modifiers*/ undefined, node.asteriskToken, name, - /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, saveStateAndInvoke(node, transformFunctionBody), location), + /*typeParameters*/ undefined, parameters, + /*type*/ undefined, body), location), /*original*/ node); - enclosingNonArrowFunction = savedContainingNonArrowFunction; - return expression; } /** * Transforms the body of a function-like node. @@ -50199,8 +54223,8 @@ var ts; resumeLexicalEnvironment(); if (ts.isBlock(body)) { // ensureUseStrict is false because no new prologue-directive should be added. - // addPrologueDirectives will simply put already-existing directives at the beginning of the target statement-array - statementOffset = ts.addPrologueDirectives(statements, body.statements, /*ensureUseStrict*/ false, visitor); + // addStandardPrologue will put already-existing directives at the beginning of the target statement-array + statementOffset = ts.addStandardPrologue(statements, body.statements, /*ensureUseStrict*/ false); } addCaptureThisForNodeIfNeeded(statements, node); addDefaultValueAssignmentsIfNeeded(statements, node); @@ -50210,6 +54234,8 @@ var ts; multiLine = true; } if (ts.isBlock(body)) { + // addCustomPrologue puts already-existing directives at the beginning of the target statement-array + statementOffset = ts.addCustomPrologue(statements, body.statements, statementOffset, visitor); statementsLocation = body.statements; ts.addRange(statements, ts.visitNodes(body.statements, visitor, ts.isStatement, statementOffset)); // If the original body was a multi-line block, this must be a multi-line block. @@ -50218,7 +54244,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 185 /* ArrowFunction */); + ts.Debug.assert(node.kind === 186 /* ArrowFunction */); // To align with the old emitter, we use a synthetic end position on the location // for the statement list we synthesize when we down-level an arrow function with // an expression function body. This prevents both comments and source maps from @@ -50234,7 +54260,8 @@ var ts; } } var expression = ts.visitNode(body, visitor, ts.isExpression); - var returnStatement = ts.createReturn(expression, /*location*/ body); + var returnStatement = ts.createReturn(expression); + ts.setTextRange(returnStatement, body); ts.setEmitFlags(returnStatement, 384 /* NoTokenSourceMaps */ | 32 /* NoTrailingSourceMap */ | 1024 /* NoTrailingComments */); statements.push(returnStatement); // To align with the source map emit for the old emitter, we set a custom @@ -50243,11 +54270,13 @@ var ts; } var lexicalEnvironment = context.endLexicalEnvironment(); ts.addRange(statements, lexicalEnvironment); + prependCaptureNewTargetIfNeeded(statements, node, /*copyOnWrite*/ false); // If we added any final generated statements, this must be a multi-line block if (!multiLine && lexicalEnvironment && lexicalEnvironment.length) { multiLine = true; } - var block = ts.createBlock(ts.createNodeArray(statements, statementsLocation), node.body, multiLine); + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), multiLine); + ts.setTextRange(block, node.body); if (!multiLine && singleLine) { ts.setEmitFlags(block, 1 /* SingleLine */); } @@ -50257,6 +54286,23 @@ var ts; ts.setOriginalNode(block, node.body); return block; } + function visitFunctionBodyDownLevel(node) { + var updated = ts.visitFunctionBody(node.body, functionBodyVisitor, context); + return ts.updateBlock(updated, ts.setTextRange(ts.createNodeArray(prependCaptureNewTargetIfNeeded(updated.statements, node, /*copyOnWrite*/ true)), + /*location*/ updated.statements)); + } + function visitBlock(node, isFunctionBody) { + if (isFunctionBody) { + // A function body is not a block scope. + return ts.visitEachChild(node, visitor, context); + } + var ancestorFacts = hierarchyFacts & 256 /* IterationStatement */ + ? enterSubtree(4032 /* IterationStatementBlockExcludes */, 512 /* IterationStatementBlockIncludes */) + : enterSubtree(3904 /* BlockExcludes */, 128 /* BlockIncludes */); + var updated = ts.visitEachChild(node, visitor, context); + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return updated; + } /** * Visits an ExpressionStatement that contains a destructuring assignment. * @@ -50265,9 +54311,9 @@ var ts; function visitExpressionStatement(node) { // If we are here it is most likely because our expression is a destructuring assignment. switch (node.expression.kind) { - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return ts.updateStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return ts.updateStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } return ts.visitEachChild(node, visitor, context); @@ -50282,10 +54328,13 @@ var ts; function visitParenthesizedExpression(node, needsDestructuringValue) { // If we are here it is most likely because our expression is a destructuring assignment. if (!needsDestructuringValue) { + // By default we always emit the RHS at the end of a flattened destructuring + // expression. If we are in a state where we do not need the destructuring value, + // we pass that information along to the children that care about it. switch (node.expression.kind) { - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return ts.updateParen(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return ts.updateParen(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } } @@ -50303,9 +54352,12 @@ var ts; if (ts.isDestructuringAssignment(node)) { return ts.flattenDestructuringAssignment(node, visitor, context, 0 /* All */, needsDestructuringValue); } + return ts.visitEachChild(node, visitor, context); } function visitVariableStatement(node) { - if (convertedLoopState && (ts.getCombinedNodeFlags(node.declarationList) & 3 /* BlockScoped */) == 0) { + var ancestorFacts = enterSubtree(0 /* None */, ts.hasModifier(node, 1 /* Export */) ? 32 /* ExportedVariableStatement */ : 0 /* None */); + var updated; + if (convertedLoopState && (node.declarationList.flags & 3 /* BlockScoped */) === 0) { // we are inside a converted loop - hoist variable declarations var assignments = void 0; for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { @@ -50319,18 +54371,22 @@ var ts; else { assignment = ts.createBinary(decl.name, 57 /* EqualsToken */, ts.visitNode(decl.initializer, visitor, ts.isExpression)); } - (assignments || (assignments = [])).push(assignment); + assignments = ts.append(assignments, assignment); } } if (assignments) { - return ts.createStatement(ts.reduceLeft(assignments, function (acc, v) { return ts.createBinary(v, 25 /* CommaToken */, acc); }), node); + updated = ts.setTextRange(ts.createStatement(ts.reduceLeft(assignments, function (acc, v) { return ts.createBinary(v, 25 /* CommaToken */, acc); })), node); } else { // none of declarations has initializer - the entire variable statement can be deleted - return undefined; + updated = undefined; } } - return ts.visitEachChild(node, visitor, context); + else { + updated = ts.visitEachChild(node, visitor, context); + } + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return updated; } /** * Visits a VariableDeclarationList that is block scoped (e.g. `let` or `const`). @@ -50338,25 +54394,29 @@ var ts; * @param node A VariableDeclarationList node. */ function visitVariableDeclarationList(node) { - if (node.flags & 3 /* BlockScoped */) { - enableSubstitutionsForBlockScopedBindings(); + if (node.transformFlags & 64 /* ES2015 */) { + if (node.flags & 3 /* BlockScoped */) { + enableSubstitutionsForBlockScopedBindings(); + } + var declarations = ts.flatten(ts.map(node.declarations, node.flags & 1 /* Let */ + ? visitVariableDeclarationInLetDeclarationList + : visitVariableDeclaration)); + var declarationList = ts.createVariableDeclarationList(declarations); + ts.setOriginalNode(declarationList, node); + ts.setTextRange(declarationList, node); + ts.setCommentRange(declarationList, node); + if (node.transformFlags & 8388608 /* ContainsBindingPattern */ + && (ts.isBindingPattern(node.declarations[0].name) + || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) { + // If the first or last declaration is a binding pattern, we need to modify + // the source map range for the declaration list. + var firstDeclaration = ts.firstOrUndefined(declarations); + var lastDeclaration = ts.lastOrUndefined(declarations); + ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); + } + return declarationList; } - var declarations = ts.flatten(ts.map(node.declarations, node.flags & 1 /* Let */ - ? visitVariableDeclarationInLetDeclarationList - : visitVariableDeclaration)); - var declarationList = ts.createVariableDeclarationList(declarations, /*location*/ node); - ts.setOriginalNode(declarationList, node); - ts.setCommentRange(declarationList, node); - if (node.transformFlags & 8388608 /* ContainsBindingPattern */ - && (ts.isBindingPattern(node.declarations[0].name) - || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) { - // If the first or last declaration is a binding pattern, we need to modify - // the source map range for the declaration list. - var firstDeclaration = ts.firstOrUndefined(declarations); - var lastDeclaration = ts.lastOrUndefined(declarations); - ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); - } - return declarationList; + return ts.visitEachChild(node, visitor, context); } /** * Gets a value indicating whether we should emit an explicit initializer for a variable @@ -50407,18 +54467,16 @@ var ts; var flags = resolver.getNodeCheckFlags(node); var isCapturedInFunction = flags & 131072 /* CapturedBlockScopedBinding */; var isDeclaredInLoop = flags & 262144 /* BlockScopedBindingInLoop */; - var emittedAsTopLevel = ts.isBlockScopedContainerTopLevel(enclosingBlockScopeContainer) + var emittedAsTopLevel = (hierarchyFacts & 64 /* TopLevel */) !== 0 || (isCapturedInFunction && isDeclaredInLoop - && ts.isBlock(enclosingBlockScopeContainer) - && ts.isIterationStatement(enclosingBlockScopeContainerParent, /*lookInLabeledStatements*/ false)); + && (hierarchyFacts & 512 /* IterationStatementBlock */) !== 0); var emitExplicitInitializer = !emittedAsTopLevel - && enclosingBlockScopeContainer.kind !== 212 /* ForInStatement */ - && enclosingBlockScopeContainer.kind !== 213 /* ForOfStatement */ + && (hierarchyFacts & 2048 /* ForInOrForOfStatement */) === 0 && (!resolver.isDeclarationWithCollidingName(node) || (isDeclaredInLoop && !isCapturedInFunction - && !ts.isIterationStatement(enclosingBlockScopeContainer, /*lookInLabeledStatements*/ false))); + && (hierarchyFacts & (1024 /* ForStatement */ | 2048 /* ForInOrForOfStatement */)) === 0)); return emitExplicitInitializer; } /** @@ -50447,55 +54505,130 @@ var ts; * @param node A VariableDeclaration node. */ function visitVariableDeclaration(node) { - // If we are here it is because the name contains a binding pattern. + var ancestorFacts = enterSubtree(32 /* ExportedVariableStatement */, 0 /* None */); + var updated; if (ts.isBindingPattern(node.name)) { - var hoistTempVariables = enclosingVariableStatement - && ts.hasModifier(enclosingVariableStatement, 1 /* Export */); - return ts.flattenDestructuringBinding(node, visitor, context, 0 /* All */, - /*value*/ undefined, hoistTempVariables); - } - return ts.visitEachChild(node, visitor, context); - } - function visitLabeledStatement(node) { - if (convertedLoopState) { - if (!convertedLoopState.labels) { - convertedLoopState.labels = ts.createMap(); - } - convertedLoopState.labels[node.label.text] = node.label.text; - } - var result; - if (ts.isIterationStatement(node.statement, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatementBody(node.statement)) { - result = ts.visitNodes(ts.createNodeArray([node.statement]), visitor, ts.isStatement); + updated = ts.flattenDestructuringBinding(node, visitor, context, 0 /* All */, + /*value*/ undefined, (ancestorFacts & 32 /* ExportedVariableStatement */) !== 0); } else { - result = ts.visitEachChild(node, visitor, context); + updated = ts.visitEachChild(node, visitor, context); } - if (convertedLoopState) { - convertedLoopState.labels[node.label.text] = undefined; + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return updated; + } + function recordLabel(node) { + convertedLoopState.labels.set(node.label.text, node.label.text); + } + function resetLabel(node) { + convertedLoopState.labels.set(node.label.text, undefined); + } + function visitLabeledStatement(node) { + if (convertedLoopState && !convertedLoopState.labels) { + convertedLoopState.labels = ts.createMap(); } - return result; + var statement = ts.unwrapInnermostStatementOfLabel(node, convertedLoopState && recordLabel); + return ts.isIterationStatement(statement, /*lookInLabeledStatements*/ false) + ? visitIterationStatement(statement, /*outermostLabeledStatement*/ node) + : ts.restoreEnclosingLabel(ts.visitNode(statement, visitor, ts.isStatement), node, convertedLoopState && resetLabel); } - function visitDoStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitIterationStatement(node, outermostLabeledStatement) { + switch (node.kind) { + case 211 /* DoStatement */: + case 212 /* WhileStatement */: + return visitDoOrWhileStatement(node, outermostLabeledStatement); + case 213 /* ForStatement */: + return visitForStatement(node, outermostLabeledStatement); + case 214 /* ForInStatement */: + return visitForInStatement(node, outermostLabeledStatement); + case 215 /* ForOfStatement */: + return visitForOfStatement(node, outermostLabeledStatement); + } } - function visitWhileStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitIterationStatementWithFacts(excludeFacts, includeFacts, node, outermostLabeledStatement, convert) { + var ancestorFacts = enterSubtree(excludeFacts, includeFacts); + var updated = convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, convert); + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return updated; } - function visitForStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitDoOrWhileStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(0 /* DoOrWhileStatementExcludes */, 256 /* DoOrWhileStatementIncludes */, node, outermostLabeledStatement); } - function visitForInStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitForStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(3008 /* ForStatementExcludes */, 1280 /* ForStatementIncludes */, node, outermostLabeledStatement); } - /** - * Visits a ForOfStatement and converts it into a compatible ForStatement. - * - * @param node A ForOfStatement. - */ - function visitForOfStatement(node) { - return convertIterationStatementBodyIfNecessary(node, convertForOfToFor); + function visitForInStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(1984 /* ForInOrForOfStatementExcludes */, 2304 /* ForInOrForOfStatementIncludes */, node, outermostLabeledStatement); } - function convertForOfToFor(node, convertedLoopBodyStatements) { + function visitForOfStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(1984 /* ForInOrForOfStatementExcludes */, 2304 /* ForInOrForOfStatementIncludes */, node, outermostLabeledStatement, compilerOptions.downlevelIteration ? convertForOfStatementForIterable : convertForOfStatementForArray); + } + function convertForOfStatementHead(node, boundValue, convertedLoopBodyStatements) { + var statements = []; + if (ts.isVariableDeclarationList(node.initializer)) { + if (node.initializer.flags & 3 /* BlockScoped */) { + enableSubstitutionsForBlockScopedBindings(); + } + var firstOriginalDeclaration = ts.firstOrUndefined(node.initializer.declarations); + if (firstOriginalDeclaration && ts.isBindingPattern(firstOriginalDeclaration.name)) { + // This works whether the declaration is a var, let, or const. + // It will use rhsIterationValue _a[_i] as the initializer. + var declarations = ts.flattenDestructuringBinding(firstOriginalDeclaration, visitor, context, 0 /* All */, boundValue); + var declarationList = ts.setTextRange(ts.createVariableDeclarationList(declarations), node.initializer); + ts.setOriginalNode(declarationList, node.initializer); + // Adjust the source map range for the first declaration to align with the old + // emitter. + var firstDeclaration = declarations[0]; + var lastDeclaration = ts.lastOrUndefined(declarations); + ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); + statements.push(ts.createVariableStatement( + /*modifiers*/ undefined, declarationList)); + } + else { + // The following call does not include the initializer, so we have + // to emit it separately. + statements.push(ts.setTextRange(ts.createVariableStatement( + /*modifiers*/ undefined, ts.setOriginalNode(ts.setTextRange(ts.createVariableDeclarationList([ + ts.createVariableDeclaration(firstOriginalDeclaration ? firstOriginalDeclaration.name : ts.createTempVariable(/*recordTempVariable*/ undefined), + /*type*/ undefined, boundValue) + ]), ts.moveRangePos(node.initializer, -1)), node.initializer)), ts.moveRangeEnd(node.initializer, -1))); + } + } + else { + // Initializer is an expression. Emit the expression in the body, so that it's + // evaluated on every iteration. + var assignment = ts.createAssignment(node.initializer, boundValue); + if (ts.isDestructuringAssignment(assignment)) { + ts.aggregateTransformFlags(assignment); + statements.push(ts.createStatement(visitBinaryExpression(assignment, /*needsDestructuringValue*/ false))); + } + else { + assignment.end = node.initializer.end; + statements.push(ts.setTextRange(ts.createStatement(ts.visitNode(assignment, visitor, ts.isExpression)), ts.moveRangeEnd(node.initializer, -1))); + } + } + var bodyLocation; + var statementsLocation; + if (convertedLoopBodyStatements) { + ts.addRange(statements, convertedLoopBodyStatements); + } + else { + var statement = ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock); + if (ts.isBlock(statement)) { + ts.addRange(statements, statement.statements); + bodyLocation = statement; + statementsLocation = statement.statements; + } + else { + statements.push(statement); + } + } + // The old emitter does not emit source maps for the block. + // We add the location to preserve comments. + return ts.setEmitFlags(ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), + /*multiLine*/ true), bodyLocation), 48 /* NoSourceMap */ | 384 /* NoTokenSourceMaps */); + } + function convertForOfStatementForArray(node, outermostLabeledStatement, convertedLoopBodyStatements) { // The following ES6 code: // // for (let v of expr) { } @@ -50517,97 +54650,65 @@ var ts; // Note also that because an extra statement is needed to assign to the LHS, // for-of bodies are always emitted as blocks. var expression = ts.visitNode(node.expression, visitor, ts.isExpression); - var initializer = node.initializer; - var statements = []; // In the case where the user wrote an identifier as the RHS, like this: // // for (let v of arr) { } // // we don't want to emit a temporary variable for the RHS, just use it directly. var counter = ts.createLoopVariable(); - var rhsReference = expression.kind === 70 /* Identifier */ - ? ts.createUniqueName(expression.text) - : ts.createTempVariable(/*recordTempVariable*/ undefined); - var elementAccess = ts.createElementAccess(rhsReference, counter); - // Initialize LHS - // var v = _a[_i]; - if (ts.isVariableDeclarationList(initializer)) { - if (initializer.flags & 3 /* BlockScoped */) { - enableSubstitutionsForBlockScopedBindings(); - } - var firstOriginalDeclaration = ts.firstOrUndefined(initializer.declarations); - if (firstOriginalDeclaration && ts.isBindingPattern(firstOriginalDeclaration.name)) { - // This works whether the declaration is a var, let, or const. - // It will use rhsIterationValue _a[_i] as the initializer. - var declarations = ts.flattenDestructuringBinding(firstOriginalDeclaration, visitor, context, 0 /* All */, elementAccess); - var declarationList = ts.createVariableDeclarationList(declarations, /*location*/ initializer); - ts.setOriginalNode(declarationList, initializer); - // Adjust the source map range for the first declaration to align with the old - // emitter. - var firstDeclaration = declarations[0]; - var lastDeclaration = ts.lastOrUndefined(declarations); - ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); - statements.push(ts.createVariableStatement( - /*modifiers*/ undefined, declarationList)); - } - else { - // The following call does not include the initializer, so we have - // to emit it separately. - statements.push(ts.createVariableStatement( - /*modifiers*/ undefined, ts.setOriginalNode(ts.createVariableDeclarationList([ - ts.createVariableDeclaration(firstOriginalDeclaration ? firstOriginalDeclaration.name : ts.createTempVariable(/*recordTempVariable*/ undefined), - /*type*/ undefined, ts.createElementAccess(rhsReference, counter)) - ], /*location*/ ts.moveRangePos(initializer, -1)), initializer), - /*location*/ ts.moveRangeEnd(initializer, -1))); - } - } - else { - // Initializer is an expression. Emit the expression in the body, so that it's - // evaluated on every iteration. - var assignment = ts.createAssignment(initializer, elementAccess); - if (ts.isDestructuringAssignment(assignment)) { - // This is a destructuring pattern, so we flatten the destructuring instead. - statements.push(ts.createStatement(ts.flattenDestructuringAssignment(assignment, visitor, context, 0 /* All */))); - } - else { - // Currently there is not way to check that assignment is binary expression of destructing assignment - // so we have to cast never type to binaryExpression - assignment.end = initializer.end; - statements.push(ts.createStatement(assignment, /*location*/ ts.moveRangeEnd(initializer, -1))); - } - } - var bodyLocation; - var statementsLocation; - if (convertedLoopBodyStatements) { - ts.addRange(statements, convertedLoopBodyStatements); - } - else { - var statement = ts.visitNode(node.statement, visitor, ts.isStatement); - if (ts.isBlock(statement)) { - ts.addRange(statements, statement.statements); - bodyLocation = statement; - statementsLocation = statement.statements; - } - else { - statements.push(statement); - } - } + var rhsReference = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(expression) : ts.createTempVariable(/*recordTempVariable*/ undefined); // The old emitter does not emit source maps for the expression ts.setEmitFlags(expression, 48 /* NoSourceMap */ | ts.getEmitFlags(expression)); - // The old emitter does not emit source maps for the block. - // We add the location to preserve comments. - var body = ts.createBlock(ts.createNodeArray(statements, /*location*/ statementsLocation), - /*location*/ bodyLocation); - ts.setEmitFlags(body, 48 /* NoSourceMap */ | 384 /* NoTokenSourceMaps */); - var forStatement = ts.createFor(ts.setEmitFlags(ts.createVariableDeclarationList([ - ts.createVariableDeclaration(counter, /*type*/ undefined, ts.createLiteral(0), /*location*/ ts.moveRangePos(node.expression, -1)), - ts.createVariableDeclaration(rhsReference, /*type*/ undefined, expression, /*location*/ node.expression) - ], /*location*/ node.expression), 1048576 /* NoHoisting */), ts.createLessThan(counter, ts.createPropertyAccess(rhsReference, "length"), - /*location*/ node.expression), ts.createPostfixIncrement(counter, /*location*/ node.expression), body, + var forStatement = ts.setTextRange(ts.createFor( + /*initializer*/ ts.setEmitFlags(ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(counter, /*type*/ undefined, ts.createLiteral(0)), ts.moveRangePos(node.expression, -1)), + ts.setTextRange(ts.createVariableDeclaration(rhsReference, /*type*/ undefined, expression), node.expression) + ]), node.expression), 1048576 /* NoHoisting */), + /*condition*/ ts.setTextRange(ts.createLessThan(counter, ts.createPropertyAccess(rhsReference, "length")), node.expression), + /*incrementor*/ ts.setTextRange(ts.createPostfixIncrement(counter), node.expression), + /*statement*/ convertForOfStatementHead(node, ts.createElementAccess(rhsReference, counter), convertedLoopBodyStatements)), /*location*/ node); // Disable trailing source maps for the OpenParenToken to align source map emit with the old emitter. ts.setEmitFlags(forStatement, 256 /* NoTokenTrailingSourceMaps */); - return forStatement; + ts.setTextRange(forStatement, node); + return ts.restoreEnclosingLabel(forStatement, outermostLabeledStatement, convertedLoopState && resetLabel); + } + function convertForOfStatementForIterable(node, outermostLabeledStatement, convertedLoopBodyStatements) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + var iterator = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(expression) : ts.createTempVariable(/*recordTempVariable*/ undefined); + var result = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(iterator) : ts.createTempVariable(/*recordTempVariable*/ undefined); + var errorRecord = ts.createUniqueName("e"); + var catchVariable = ts.getGeneratedNameForNode(errorRecord); + var returnMethod = ts.createTempVariable(/*recordTempVariable*/ undefined); + var values = ts.createValuesHelper(context, expression, node.expression); + var next = ts.createCall(ts.createPropertyAccess(iterator, "next"), /*typeArguments*/ undefined, []); + hoistVariableDeclaration(errorRecord); + hoistVariableDeclaration(returnMethod); + var forStatement = ts.setEmitFlags(ts.setTextRange(ts.createFor( + /*initializer*/ ts.setEmitFlags(ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(iterator, /*type*/ undefined, values), node.expression), + ts.createVariableDeclaration(result, /*type*/ undefined, next) + ]), node.expression), 1048576 /* NoHoisting */), + /*condition*/ ts.createLogicalNot(ts.createPropertyAccess(result, "done")), + /*incrementor*/ ts.createAssignment(result, next), + /*statement*/ convertForOfStatementHead(node, ts.createPropertyAccess(result, "value"), convertedLoopBodyStatements)), + /*location*/ node), 256 /* NoTokenTrailingSourceMaps */); + return ts.createTry(ts.createBlock([ + ts.restoreEnclosingLabel(forStatement, outermostLabeledStatement, convertedLoopState && resetLabel) + ]), ts.createCatchClause(ts.createVariableDeclaration(catchVariable), ts.setEmitFlags(ts.createBlock([ + ts.createStatement(ts.createAssignment(errorRecord, ts.createObjectLiteral([ + ts.createPropertyAssignment("error", catchVariable) + ]))) + ]), 1 /* SingleLine */)), ts.createBlock([ + ts.createTry( + /*tryBlock*/ ts.createBlock([ + ts.setEmitFlags(ts.createIf(ts.createLogicalAnd(ts.createLogicalAnd(result, ts.createLogicalNot(ts.createPropertyAccess(result, "done"))), ts.createAssignment(returnMethod, ts.createPropertyAccess(iterator, "return"))), ts.createStatement(ts.createFunctionCall(returnMethod, iterator, []))), 1 /* SingleLine */), + ]), + /*catchClause*/ undefined, + /*finallyBlock*/ ts.setEmitFlags(ts.createBlock([ + ts.setEmitFlags(ts.createIf(errorRecord, ts.createThrow(ts.createPropertyAccess(errorRecord, "error"))), 1 /* SingleLine */) + ]), 1 /* SingleLine */)) + ])); } /** * Visits an ObjectLiteralExpression with computed propety names. @@ -50621,31 +54722,39 @@ var ts; // Find the first computed property. // Everything until that point can be emitted as part of the initial object literal. var numInitialProperties = numProperties; + var numInitialPropertiesWithoutYield = numProperties; for (var i = 0; i < numProperties; i++) { var property = properties[i]; - if (property.transformFlags & 16777216 /* ContainsYield */ - || property.name.kind === 142 /* ComputedPropertyName */) { + if ((property.transformFlags & 16777216 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */) + && i < numInitialPropertiesWithoutYield) { + numInitialPropertiesWithoutYield = i; + } + if (property.name.kind === 143 /* ComputedPropertyName */) { numInitialProperties = i; break; } } - ts.Debug.assert(numInitialProperties !== numProperties); - // For computed properties, we need to create a unique handle to the object - // literal so we can modify it without risking internal assignments tainting the object. - var temp = ts.createTempVariable(hoistVariableDeclaration); - // Write out the first non-computed properties, then emit the rest through indexing on the temp variable. - var expressions = []; - var assignment = ts.createAssignment(temp, ts.setEmitFlags(ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), - /*location*/ undefined, node.multiLine), 32768 /* Indented */)); - if (node.multiLine) { - assignment.startsOnNewLine = true; + if (numInitialProperties !== numProperties) { + if (numInitialPropertiesWithoutYield < numInitialProperties) { + numInitialProperties = numInitialPropertiesWithoutYield; + } + // For computed properties, we need to create a unique handle to the object + // literal so we can modify it without risking internal assignments tainting the object. + var temp = ts.createTempVariable(hoistVariableDeclaration); + // Write out the first non-computed properties, then emit the rest through indexing on the temp variable. + var expressions = []; + var assignment = ts.createAssignment(temp, ts.setEmitFlags(ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), node.multiLine), 32768 /* Indented */)); + if (node.multiLine) { + assignment.startsOnNewLine = true; + } + expressions.push(assignment); + addObjectLiteralMembers(expressions, node, temp, numInitialProperties); + // We need to clone the temporary identifier so that we can write it on a + // new line + expressions.push(node.multiLine ? ts.startOnNewLine(ts.getMutableClone(temp)) : temp); + return ts.inlineExpressions(expressions); } - expressions.push(assignment); - addObjectLiteralMembers(expressions, node, temp, numInitialProperties); - // We need to clone the temporary identifier so that we can write it on a - // new line - expressions.push(node.multiLine ? ts.startOnNewLine(ts.getMutableClone(temp)) : temp); - return ts.inlineExpressions(expressions); + return ts.visitEachChild(node, visitor, context); } function shouldConvertIterationStatementBody(node) { return (resolver.getNodeCheckFlags(node) & 65536 /* LoopWithCapturedBlockScopedBinding */) !== 0; @@ -50672,7 +54781,7 @@ var ts; } } } - function convertIterationStatementBodyIfNecessary(node, convert) { + function convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, convert) { if (!shouldConvertIterationStatementBody(node)) { var saveAllowedNonLabeledJumps = void 0; if (convertedLoopState) { @@ -50681,7 +54790,9 @@ var ts; saveAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; convertedLoopState.allowedNonLabeledJumps = 2 /* Break */ | 4 /* Continue */; } - var result = convert ? convert(node, /*convertedLoopBodyStatements*/ undefined) : ts.visitEachChild(node, visitor, context); + var result = convert + ? convert(node, outermostLabeledStatement, /*convertedLoopBodyStatements*/ undefined) + : ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), outermostLabeledStatement, convertedLoopState && resetLabel); if (convertedLoopState) { convertedLoopState.allowedNonLabeledJumps = saveAllowedNonLabeledJumps; } @@ -50690,11 +54801,11 @@ var ts; var functionName = ts.createUniqueName("_loop"); var loopInitializer; switch (node.kind) { - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: + case 213 /* ForStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 224 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 226 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -50730,19 +54841,26 @@ var ts; convertedLoopState.hoistedLocalVariables = outerConvertedLoopState.hoistedLocalVariables; } } - var loopBody = ts.visitNode(node.statement, visitor, ts.isStatement); + startLexicalEnvironment(); + var loopBody = ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock); + var lexicalEnvironment = endLexicalEnvironment(); var currentState = convertedLoopState; convertedLoopState = outerConvertedLoopState; - if (loopOutParameters.length) { + if (loopOutParameters.length || lexicalEnvironment) { var statements_4 = ts.isBlock(loopBody) ? loopBody.statements.slice() : [loopBody]; - copyOutParameters(loopOutParameters, 1 /* ToOutParameter */, statements_4); - loopBody = ts.createBlock(statements_4, /*location*/ undefined, /*multiline*/ true); + if (loopOutParameters.length) { + copyOutParameters(loopOutParameters, 1 /* ToOutParameter */, statements_4); + } + ts.addRange(statements_4, lexicalEnvironment); + loopBody = ts.createBlock(statements_4, /*multiline*/ true); } - if (!ts.isBlock(loopBody)) { - loopBody = ts.createBlock([loopBody], /*location*/ undefined, /*multiline*/ true); + if (ts.isBlock(loopBody)) { + loopBody.multiLine = true; } - var isAsyncBlockContainingAwait = enclosingNonArrowFunction - && (ts.getEmitFlags(enclosingNonArrowFunction) & 131072 /* AsyncFunctionBody */) !== 0 + else { + loopBody = ts.createBlock([loopBody], /*multiline*/ true); + } + var isAsyncBlockContainingAwait = hierarchyFacts & 4 /* AsyncFunctionBody */ && (node.statement.transformFlags & 16777216 /* ContainsYield */) !== 0; var loopBodyFlags = 0; if (currentState.containsLexicalThis) { @@ -50825,25 +54943,22 @@ var ts; var convertedLoopBodyStatements = generateCallToConvertedLoop(functionName, loopParameters, currentState, isAsyncBlockContainingAwait); var loop; if (convert) { - loop = convert(node, convertedLoopBodyStatements); + loop = convert(node, outermostLabeledStatement, convertedLoopBodyStatements); } else { - loop = ts.getMutableClone(node); + var clone_4 = ts.getMutableClone(node); // clean statement part - loop.statement = undefined; + clone_4.statement = undefined; // visit childnodes to transform initializer/condition/incrementor parts - loop = ts.visitEachChild(loop, visitor, context); + clone_4 = ts.visitEachChild(clone_4, visitor, context); // set loop statement - loop.statement = ts.createBlock(convertedLoopBodyStatements, - /*location*/ undefined, - /*multiline*/ true); + clone_4.statement = ts.createBlock(convertedLoopBodyStatements, /*multiline*/ true); // reset and re-aggregate the transform flags - loop.transformFlags = 0; - ts.aggregateTransformFlags(loop); + clone_4.transformFlags = 0; + ts.aggregateTransformFlags(clone_4); + loop = ts.restoreEnclosingLabel(clone_4, outermostLabeledStatement, convertedLoopState && resetLabel); } - statements.push(currentParent.kind === 219 /* LabeledStatement */ - ? ts.createLabel(currentParent.label, loop) - : loop); + statements.push(loop); return statements; } function copyOutParameter(outParam, copyDirection) { @@ -50867,7 +54982,9 @@ var ts; !state.labeledNonLocalBreaks && !state.labeledNonLocalContinues; var call = ts.createCall(loopFunctionExpressionName, /*typeArguments*/ undefined, ts.map(parameters, function (p) { return p.name; })); - var callResult = isAsyncBlockContainingAwait ? ts.createYield(ts.createToken(38 /* AsteriskToken */), call) : call; + var callResult = isAsyncBlockContainingAwait + ? ts.createYield(ts.createToken(38 /* AsteriskToken */), ts.setEmitFlags(call, 4194304 /* Iterator */)) + : call; if (isSimpleLoop) { statements.push(ts.createStatement(callResult)); copyOutParameters(state.loopOutParameters, 0 /* ToOriginal */, statements); @@ -50906,26 +55023,25 @@ var ts; if (!state.labeledNonLocalBreaks) { state.labeledNonLocalBreaks = ts.createMap(); } - state.labeledNonLocalBreaks[labelText] = labelMarker; + state.labeledNonLocalBreaks.set(labelText, labelMarker); } else { if (!state.labeledNonLocalContinues) { state.labeledNonLocalContinues = ts.createMap(); } - state.labeledNonLocalContinues[labelText] = labelMarker; + state.labeledNonLocalContinues.set(labelText, labelMarker); } } function processLabeledJumps(table, isBreak, loopResultName, outerLoop, caseClauses) { if (!table) { return; } - for (var labelText in table) { - var labelMarker = table[labelText]; + table.forEach(function (labelMarker, labelText) { var statements = []; // if there are no outer converted loop or outer label in question is located inside outer converted loop // then emit labeled break\continue // otherwise propagate pair 'label -> marker' to outer converted loop and emit 'return labelMarker' so outer loop can later decide what to do - if (!outerLoop || (outerLoop.labels && outerLoop.labels[labelText])) { + if (!outerLoop || (outerLoop.labels && outerLoop.labels.get(labelText))) { var label = ts.createIdentifier(labelText); statements.push(isBreak ? ts.createBreak(label) : ts.createContinue(label)); } @@ -50934,7 +55050,7 @@ var ts; statements.push(ts.createReturn(loopResultName)); } caseClauses.push(ts.createCaseClause(ts.createLiteral(labelMarker), statements)); - } + }); } function processLoopVariableDeclaration(decl, loopParameters, loopOutParameters) { var name = decl.name; @@ -50949,7 +55065,7 @@ var ts; else { loopParameters.push(ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, name)); if (resolver.getNodeCheckFlags(decl) & 2097152 /* NeedsLoopOutParameter */) { - var outParamName = ts.createUniqueName("out_" + name.text); + var outParamName = ts.createUniqueName("out_" + ts.unescapeIdentifier(name.text)); loopOutParameters.push({ originalName: name, outParamName: outParamName }); } } @@ -50969,22 +55085,22 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { - expressions.push(transformAccessorsToExpression(receiver, accessors, node.multiLine)); + expressions.push(transformAccessorsToExpression(receiver, accessors, node, node.multiLine)); } break; - case 257 /* PropertyAssignment */: + case 150 /* MethodDeclaration */: + expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); + break; + case 260 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 258 /* ShorthandPropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 149 /* MethodDeclaration */: - expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node.multiLine)); - break; default: ts.Debug.failBadSyntaxKind(node); break; @@ -50999,8 +55115,8 @@ var ts; * @param receiver The receiver for the assignment. */ function transformPropertyAssignmentToExpression(property, receiver, startsOnNewLine) { - var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.visitNode(property.initializer, visitor, ts.isExpression), - /*location*/ property); + var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.visitNode(property.initializer, visitor, ts.isExpression)); + ts.setTextRange(expression, property); if (startsOnNewLine) { expression.startsOnNewLine = true; } @@ -51014,8 +55130,8 @@ var ts; * @param receiver The receiver for the assignment. */ function transformShorthandPropertyAssignmentToExpression(property, receiver, startsOnNewLine) { - var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.getSynthesizedClone(property.name), - /*location*/ property); + var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.getSynthesizedClone(property.name)); + ts.setTextRange(expression, property); if (startsOnNewLine) { expression.startsOnNewLine = true; } @@ -51028,22 +55144,34 @@ var ts; * @param method The MethodDeclaration node. * @param receiver The receiver for the assignment. */ - function transformObjectLiteralMethodDeclarationToExpression(method, receiver, startsOnNewLine) { - var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(method.name, visitor, ts.isPropertyName)), transformFunctionLikeToExpression(method, /*location*/ method, /*name*/ undefined), - /*location*/ method); + function transformObjectLiteralMethodDeclarationToExpression(method, receiver, container, startsOnNewLine) { + var ancestorFacts = enterSubtree(0 /* None */, 0 /* None */); + var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(method.name, visitor, ts.isPropertyName)), transformFunctionLikeToExpression(method, /*location*/ method, /*name*/ undefined, container)); + ts.setTextRange(expression, method); if (startsOnNewLine) { expression.startsOnNewLine = true; } + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, hierarchyFacts & 49152 /* PropagateNewTargetMask */ ? 16384 /* NewTarget */ : 0 /* None */); return expression; } function visitCatchClause(node) { - ts.Debug.assert(ts.isBindingPattern(node.variableDeclaration.name)); - var temp = ts.createTempVariable(undefined); - var newVariableDeclaration = ts.createVariableDeclaration(temp, undefined, undefined, node.variableDeclaration); - var vars = ts.flattenDestructuringBinding(node.variableDeclaration, visitor, context, 0 /* All */, temp); - var list = ts.createVariableDeclarationList(vars, /*location*/ node.variableDeclaration, /*flags*/ node.variableDeclaration.flags); - var destructure = ts.createVariableStatement(undefined, list); - return ts.updateCatchClause(node, newVariableDeclaration, addStatementToStartOfBlock(node.block, destructure)); + var ancestorFacts = enterSubtree(4032 /* BlockScopeExcludes */, 0 /* BlockScopeIncludes */); + var updated; + if (ts.isBindingPattern(node.variableDeclaration.name)) { + var temp = ts.createTempVariable(/*recordTempVariable*/ undefined); + var newVariableDeclaration = ts.createVariableDeclaration(temp); + ts.setTextRange(newVariableDeclaration, node.variableDeclaration); + var vars = ts.flattenDestructuringBinding(node.variableDeclaration, visitor, context, 0 /* All */, temp); + var list = ts.createVariableDeclarationList(vars); + ts.setTextRange(list, node.variableDeclaration); + var destructure = ts.createVariableStatement(/*modifiers*/ undefined, list); + updated = ts.updateCatchClause(node, newVariableDeclaration, addStatementToStartOfBlock(node.block, destructure)); + } + else { + updated = ts.visitEachChild(node, visitor, context); + } + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return updated; } function addStatementToStartOfBlock(block, statement) { var transformedStatements = ts.visitNodes(block.statements, visitor, ts.isStatement); @@ -51060,20 +55188,41 @@ var ts; // Methods on classes are handled in visitClassDeclaration/visitClassExpression. // Methods with computed property names are handled in visitObjectLiteralExpression. ts.Debug.assert(!ts.isComputedPropertyName(node.name)); - var functionExpression = transformFunctionLikeToExpression(node, /*location*/ ts.moveRangePos(node, -1), /*name*/ undefined); + var functionExpression = transformFunctionLikeToExpression(node, /*location*/ ts.moveRangePos(node, -1), /*name*/ undefined, /*container*/ undefined); ts.setEmitFlags(functionExpression, 512 /* NoLeadingComments */ | ts.getEmitFlags(functionExpression)); - return ts.createPropertyAssignment(node.name, functionExpression, + return ts.setTextRange(ts.createPropertyAssignment(node.name, functionExpression), /*location*/ node); } + /** + * Visits an AccessorDeclaration of an ObjectLiteralExpression. + * + * @param node An AccessorDeclaration node. + */ + function visitAccessorDeclaration(node) { + ts.Debug.assert(!ts.isComputedPropertyName(node.name)); + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); + var updated = ts.visitEachChild(node, visitor, context); + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, 0 /* None */); + convertedLoopState = savedConvertedLoopState; + return updated; + } /** * Visits a ShorthandPropertyAssignment and transforms it into a PropertyAssignment. * * @param node A ShorthandPropertyAssignment node. */ function visitShorthandPropertyAssignment(node) { - return ts.createPropertyAssignment(node.name, ts.getSynthesizedClone(node.name), + return ts.setTextRange(ts.createPropertyAssignment(node.name, ts.getSynthesizedClone(node.name)), /*location*/ node); } + function visitComputedPropertyName(node) { + var ancestorFacts = enterSubtree(0 /* ComputedPropertyNameExcludes */, 8192 /* ComputedPropertyNameIncludes */); + var updated = ts.visitEachChild(node, visitor, context); + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, hierarchyFacts & 49152 /* PropagateNewTargetMask */ ? 32768 /* NewTargetInComputedPropertyName */ : 0 /* None */); + return updated; + } /** * Visits a YieldExpression node. * @@ -51089,8 +55238,11 @@ var ts; * @param node An ArrayLiteralExpression node. */ function visitArrayLiteralExpression(node) { - // We are here because we contain a SpreadElementExpression. - return transformAndSpreadElements(node.elements, /*needsUniqueCopy*/ true, node.multiLine, /*hasTrailingComma*/ node.elements.hasTrailingComma); + if (node.transformFlags & 64 /* ES2015 */) { + // We are here because we contain a SpreadElementExpression. + return transformAndSpreadElements(node.elements, /*needsUniqueCopy*/ true, node.multiLine, /*hasTrailingComma*/ node.elements.hasTrailingComma); + } + return ts.visitEachChild(node, visitor, context); } /** * Visits a CallExpression that contains either a spread element or `super`. @@ -51098,7 +55250,11 @@ var ts; * @param node a CallExpression. */ function visitCallExpression(node) { - return visitCallExpressionWithPotentialCapturedThisAssignment(node, /*assignToCapturedThis*/ true); + if (node.transformFlags & 64 /* ES2015 */) { + return visitCallExpressionWithPotentialCapturedThisAssignment(node, /*assignToCapturedThis*/ true); + } + return ts.updateCall(node, ts.visitNode(node.expression, callExpressionVisitor, ts.isExpression), + /*typeArguments*/ undefined, ts.visitNodes(node.arguments, visitor, ts.isExpression)); } function visitImmediateSuperCallInBody(node) { return visitCallExpressionWithPotentialCapturedThisAssignment(node, /*assignToCapturedThis*/ false); @@ -51125,7 +55281,7 @@ var ts; // _super.apply(this, a.concat([b])) // _super.m.apply(this, a.concat([b])) // _super.prototype.m.apply(this, a.concat([b])) - resultingCall = ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)); + resultingCall = ts.createFunctionApply(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)); } else { // [source] @@ -51137,18 +55293,18 @@ var ts; // _super.call(this, a) // _super.m.call(this, a) // _super.prototype.m.call(this, a) - resultingCall = ts.createFunctionCall(ts.visitNode(target, visitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), + resultingCall = ts.createFunctionCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), /*location*/ node); } if (node.expression.kind === 96 /* SuperKeyword */) { var actualThis = ts.createThis(); ts.setEmitFlags(actualThis, 4 /* NoSubstitution */); var initializer = ts.createLogicalOr(resultingCall, actualThis); - return assignToCapturedThis + resultingCall = assignToCapturedThis ? ts.createAssignment(ts.createIdentifier("_this"), initializer) : initializer; } - return resultingCall; + return ts.setOriginalNode(resultingCall, node); } /** * Visits a NewExpression that contains a spread element. @@ -51156,16 +55312,18 @@ var ts; * @param node A NewExpression node. */ function visitNewExpression(node) { - // We are here because we contain a SpreadElementExpression. - ts.Debug.assert((node.transformFlags & 524288 /* ContainsSpread */) !== 0); - // [source] - // new C(...a) - // - // [output] - // new ((_a = C).bind.apply(_a, [void 0].concat(a)))() - var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; - return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray([ts.createVoidZero()].concat(node.arguments)), /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)), - /*typeArguments*/ undefined, []); + if (node.transformFlags & 524288 /* ContainsSpread */) { + // We are here because we contain a SpreadElementExpression. + // [source] + // new C(...a) + // + // [output] + // new ((_a = C).bind.apply(_a, [void 0].concat(a)))() + var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; + return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray([ts.createVoidZero()].concat(node.arguments)), /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)), + /*typeArguments*/ undefined, []); + } + return ts.visitEachChild(node, visitor, context); } /** * Transforms an array of Expression nodes that contains a SpreadExpression. @@ -51186,14 +55344,28 @@ var ts; var segments = ts.flatten(ts.spanMap(elements, partitionSpread, function (partition, visitPartition, _start, end) { return visitPartition(partition, multiLine, hasTrailingComma && end === numElements); })); - if (segments.length === 1) { - var firstElement = elements[0]; - return needsUniqueCopy && ts.isSpreadExpression(firstElement) && firstElement.expression.kind !== 175 /* ArrayLiteralExpression */ - ? ts.createArraySlice(segments[0]) - : segments[0]; + if (compilerOptions.downlevelIteration) { + if (segments.length === 1) { + var firstSegment = segments[0]; + if (ts.isCallExpression(firstSegment) + && ts.isIdentifier(firstSegment.expression) + && (ts.getEmitFlags(firstSegment.expression) & 4096 /* HelperName */) + && firstSegment.expression.text === "___spread") { + return segments[0]; + } + } + return ts.createSpreadHelper(context, segments); + } + else { + if (segments.length === 1) { + var firstElement = elements[0]; + return needsUniqueCopy && ts.isSpreadExpression(firstElement) && firstElement.expression.kind !== 176 /* ArrayLiteralExpression */ + ? ts.createArraySlice(segments[0]) + : segments[0]; + } + // Rewrite using the pattern .concat(, , ...) + return ts.createArrayConcat(segments.shift(), segments); } - // Rewrite using the pattern .concat(, , ...) - return ts.createArrayConcat(segments.shift(), segments); } function partitionSpread(node) { return ts.isSpreadExpression(node) @@ -51204,8 +55376,7 @@ var ts; return ts.map(chunk, visitExpressionOfSpread); } function visitSpanOfNonSpreads(chunk, multiLine, hasTrailingComma) { - return ts.createArrayLiteral(ts.visitNodes(ts.createNodeArray(chunk, /*location*/ undefined, hasTrailingComma), visitor, ts.isExpression), - /*location*/ undefined, multiLine); + return ts.createArrayLiteral(ts.visitNodes(ts.createNodeArray(chunk, hasTrailingComma), visitor, ts.isExpression), multiLine); } function visitSpreadElement(node) { return ts.visitNode(node.expression, visitor, ts.isExpression); @@ -51224,7 +55395,29 @@ var ts; * @param node A template literal. */ function visitTemplateLiteral(node) { - return ts.createLiteral(node.text, /*location*/ node); + return ts.setTextRange(ts.createLiteral(node.text), node); + } + /** + * Visits a string literal with an extended unicode escape. + * + * @param node A string literal. + */ + function visitStringLiteral(node) { + if (node.hasExtendedUnicodeEscape) { + return ts.setTextRange(ts.createLiteral(node.text), node); + } + return node; + } + /** + * Visits a binary or octal (ES6) numeric literal. + * + * @param node A string literal. + */ + function visitNumericLiteral(node) { + if (node.numericLiteralFlags & 48 /* BinaryOrOctalSpecifier */) { + return ts.setTextRange(ts.createNumericLiteral(node.text), node); + } + return node; } /** * Visits a TaggedTemplateExpression node. @@ -51284,7 +55477,7 @@ var ts; // ES6 Spec 11.8.6.1 - Static Semantics of TV's and TRV's // and LineTerminatorSequences are normalized to for both TV and TRV. text = text.replace(/\r\n?/g, "\n"); - return ts.createLiteral(text, /*location*/ node); + return ts.setTextRange(ts.createLiteral(text), node); } /** * Visits a TemplateExpression node. @@ -51306,7 +55499,8 @@ var ts; // "abc" + (1 << 2) + "" var expression = ts.reduceLeft(expressions, ts.createAdd); if (ts.nodeIsSynthesized(expression)) { - ts.setTextRange(expression, node); + expression.pos = node.pos; + expression.end = node.end; } return expression; } @@ -51368,27 +55562,42 @@ var ts; /** * Visits the `super` keyword */ - function visitSuperKeyword() { - return enclosingNonAsyncFunctionBody - && ts.isClassElement(enclosingNonAsyncFunctionBody) - && !ts.hasModifier(enclosingNonAsyncFunctionBody, 32 /* Static */) - && currentParent.kind !== 179 /* CallExpression */ + function visitSuperKeyword(isExpressionOfCall) { + return hierarchyFacts & 8 /* NonStaticClassElement */ + && !isExpressionOfCall ? ts.createPropertyAccess(ts.createIdentifier("_super"), "prototype") : ts.createIdentifier("_super"); } + function visitMetaProperty(node) { + if (node.keywordToken === 93 /* NewKeyword */ && node.name.text === "target") { + if (hierarchyFacts & 8192 /* ComputedPropertyName */) { + hierarchyFacts |= 32768 /* NewTargetInComputedPropertyName */; + } + else { + hierarchyFacts |= 16384 /* NewTarget */; + } + return ts.createIdentifier("_newTarget"); + } + return node; + } /** * Called by the printer just before a node is printed. * + * @param hint A hint as to the intended usage of the node. * @param node The node to be printed. + * @param emitCallback The callback used to emit the node. */ - function onEmitNode(emitContext, node, emitCallback) { - var savedEnclosingFunction = enclosingFunction; + function onEmitNode(hint, node, emitCallback) { if (enabledSubstitutions & 1 /* CapturedThis */ && ts.isFunctionLike(node)) { // If we are tracking a captured `this`, keep track of the enclosing function. - enclosingFunction = node; + var ancestorFacts = enterSubtree(16286 /* FunctionExcludes */, ts.getEmitFlags(node) & 8 /* CapturesThis */ + ? 65 /* FunctionIncludes */ | 16 /* CapturesThis */ + : 65 /* FunctionIncludes */); + previousOnEmitNode(hint, node, emitCallback); + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return; } - previousOnEmitNode(emitContext, node, emitCallback); - enclosingFunction = savedEnclosingFunction; + previousOnEmitNode(hint, node, emitCallback); } /** * Enables a more costly code path for substitutions when we determine a source file @@ -51408,24 +55617,24 @@ var ts; if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(98 /* ThisKeyword */); - context.enableEmitNotification(150 /* Constructor */); - context.enableEmitNotification(149 /* MethodDeclaration */); - context.enableEmitNotification(151 /* GetAccessor */); - context.enableEmitNotification(152 /* SetAccessor */); - context.enableEmitNotification(185 /* ArrowFunction */); - context.enableEmitNotification(184 /* FunctionExpression */); - context.enableEmitNotification(225 /* FunctionDeclaration */); + context.enableEmitNotification(151 /* Constructor */); + context.enableEmitNotification(150 /* MethodDeclaration */); + context.enableEmitNotification(152 /* GetAccessor */); + context.enableEmitNotification(153 /* SetAccessor */); + context.enableEmitNotification(186 /* ArrowFunction */); + context.enableEmitNotification(185 /* FunctionExpression */); + context.enableEmitNotification(227 /* FunctionDeclaration */); } } /** * Hooks node substitutions. * - * @param emitContext The context for the emitter. + * @param hint The context for the emitter. * @param node The node to substitute. */ - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1 /* Expression */) { + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 /* Expression */) { return substituteExpression(node); } if (ts.isIdentifier(node)) { @@ -51442,7 +55651,7 @@ var ts; if (enabledSubstitutions & 2 /* BlockScopedBindings */) { var original = ts.getParseTreeNode(node, ts.isIdentifier); if (original && isNameOfDeclarationWithCollidingName(original)) { - return ts.getGeneratedNameForNode(original); + return ts.setTextRange(ts.getGeneratedNameForNode(original), node); } } return node; @@ -51456,10 +55665,10 @@ var ts; function isNameOfDeclarationWithCollidingName(node) { var parent = node.parent; switch (parent.kind) { - case 174 /* BindingElement */: - case 226 /* ClassDeclaration */: - case 229 /* EnumDeclaration */: - case 223 /* VariableDeclaration */: + case 175 /* BindingElement */: + case 228 /* ClassDeclaration */: + case 231 /* EnumDeclaration */: + case 225 /* VariableDeclaration */: return parent.name === node && resolver.isDeclarationWithCollidingName(parent); } @@ -51488,7 +55697,7 @@ var ts; if (enabledSubstitutions & 2 /* BlockScopedBindings */) { var declaration = resolver.getReferencedDeclarationWithCollidingName(node); if (declaration) { - return ts.getGeneratedNameForNode(declaration.name); + return ts.setTextRange(ts.getGeneratedNameForNode(declaration.name), node); } } return node; @@ -51500,9 +55709,8 @@ var ts; */ function substituteThisKeyword(node) { if (enabledSubstitutions & 1 /* CapturedThis */ - && enclosingFunction - && ts.getEmitFlags(enclosingFunction) & 8 /* CapturesThis */) { - return ts.createIdentifier("_this", /*location*/ node); + && hierarchyFacts & 16 /* CapturesThis */) { + return ts.setTextRange(ts.createIdentifier("_this"), node); } return node; } @@ -51518,11 +55726,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 207 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 209 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 179 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 180 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; @@ -51530,7 +55738,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 196 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 197 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -51550,11 +55758,123 @@ var ts; name: "typescript:extends", scoped: false, priority: 0, - text: "\n var __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };" + text: "\n var __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n })();" }; })(ts || (ts = {})); /// /// +/*@internal*/ +var ts; +(function (ts) { + /** + * Transforms ES5 syntax into ES3 syntax. + * + * @param context Context and state information for the transformation. + */ + function transformES5(context) { + var compilerOptions = context.getCompilerOptions(); + // enable emit notification only if using --jsx preserve or react-native + var previousOnEmitNode; + var noSubstitution; + if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { + previousOnEmitNode = context.onEmitNode; + context.onEmitNode = onEmitNode; + context.enableEmitNotification(250 /* JsxOpeningElement */); + context.enableEmitNotification(251 /* JsxClosingElement */); + context.enableEmitNotification(249 /* JsxSelfClosingElement */); + noSubstitution = []; + } + var previousOnSubstituteNode = context.onSubstituteNode; + context.onSubstituteNode = onSubstituteNode; + context.enableSubstitution(178 /* PropertyAccessExpression */); + context.enableSubstitution(260 /* PropertyAssignment */); + return transformSourceFile; + /** + * Transforms an ES5 source file to ES3. + * + * @param node A SourceFile + */ + function transformSourceFile(node) { + return node; + } + /** + * Called by the printer just before a node is printed. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to emit. + * @param emitCallback A callback used to emit the node. + */ + function onEmitNode(hint, node, emitCallback) { + switch (node.kind) { + case 250 /* JsxOpeningElement */: + case 251 /* JsxClosingElement */: + case 249 /* JsxSelfClosingElement */: + var tagName = node.tagName; + noSubstitution[ts.getOriginalNodeId(tagName)] = true; + break; + } + previousOnEmitNode(hint, node, emitCallback); + } + /** + * Hooks node substitutions. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to substitute. + */ + function onSubstituteNode(hint, node) { + if (node.id && noSubstitution && noSubstitution[node.id]) { + return previousOnSubstituteNode(hint, node); + } + node = previousOnSubstituteNode(hint, node); + if (ts.isPropertyAccessExpression(node)) { + return substitutePropertyAccessExpression(node); + } + else if (ts.isPropertyAssignment(node)) { + return substitutePropertyAssignment(node); + } + return node; + } + /** + * Substitutes a PropertyAccessExpression whose name is a reserved word. + * + * @param node A PropertyAccessExpression + */ + function substitutePropertyAccessExpression(node) { + var literalName = trySubstituteReservedName(node.name); + if (literalName) { + return ts.setTextRange(ts.createElementAccess(node.expression, literalName), node); + } + return node; + } + /** + * Substitutes a PropertyAssignment whose name is a reserved word. + * + * @param node A PropertyAssignment + */ + function substitutePropertyAssignment(node) { + var literalName = ts.isIdentifier(node.name) && trySubstituteReservedName(node.name); + if (literalName) { + return ts.updatePropertyAssignment(node, literalName, node.initializer); + } + return node; + } + /** + * If an identifier name is a reserved word, returns a string literal for the name. + * + * @param name An Identifier + */ + function trySubstituteReservedName(name) { + var token = name.originalKeywordKind || (ts.nodeIsSynthesized(name) ? ts.stringToToken(name.text) : undefined); + if (token >= 71 /* FirstReservedWord */ && token <= 106 /* LastReservedWord */) { + return ts.setTextRange(ts.createLiteral(name), name); + } + return undefined; + } + } + ts.transformES5 = transformES5; +})(ts || (ts = {})); +/// +/// // Transforms generator functions into a compatible ES5 representation with similar runtime // semantics. This is accomplished by first transforming the body of each generator // function into an intermediate representation that is the compiled into a JavaScript @@ -51725,13 +56045,15 @@ var ts; Instruction[Instruction["Catch"] = 6] = "Catch"; Instruction[Instruction["Endfinally"] = 7] = "Endfinally"; })(Instruction || (Instruction = {})); - var instructionNames = ts.createMap((_a = {}, - _a[2 /* Return */] = "return", - _a[3 /* Break */] = "break", - _a[4 /* Yield */] = "yield", - _a[5 /* YieldStar */] = "yield*", - _a[7 /* Endfinally */] = "endfinally", - _a)); + function getInstructionName(instruction) { + switch (instruction) { + case 2 /* Return */: return "return"; + case 3 /* Break */: return "break"; + case 4 /* Yield */: return "yield"; + case 5 /* YieldStar */: return "yield*"; + case 7 /* Endfinally */: return "endfinally"; + } + } function transformGenerators(context) { var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistFunctionDeclaration = context.hoistFunctionDeclaration, hoistVariableDeclaration = context.hoistVariableDeclaration; var compilerOptions = context.getCompilerOptions(); @@ -51823,13 +56145,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 209 /* DoStatement */: + case 211 /* DoStatement */: return visitDoStatement(node); - case 210 /* WhileStatement */: + case 212 /* WhileStatement */: return visitWhileStatement(node); - case 218 /* SwitchStatement */: + case 220 /* SwitchStatement */: return visitSwitchStatement(node); - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -51842,24 +56164,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 184 /* FunctionExpression */: + case 185 /* FunctionExpression */: return visitFunctionExpression(node); - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: return visitAccessorDeclaration(node); - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: return visitVariableStatement(node); - case 211 /* ForStatement */: + case 213 /* ForStatement */: return visitForStatement(node); - case 212 /* ForInStatement */: + case 214 /* ForInStatement */: return visitForInStatement(node); - case 215 /* BreakStatement */: + case 217 /* BreakStatement */: return visitBreakStatement(node); - case 214 /* ContinueStatement */: + case 216 /* ContinueStatement */: return visitContinueStatement(node); - case 216 /* ReturnStatement */: + case 218 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 16777216 /* ContainsYield */) { @@ -51880,21 +56202,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return visitBinaryExpression(node); - case 193 /* ConditionalExpression */: + case 194 /* ConditionalExpression */: return visitConditionalExpression(node); - case 195 /* YieldExpression */: + case 196 /* YieldExpression */: return visitYieldExpression(node); - case 175 /* ArrayLiteralExpression */: + case 176 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 176 /* ObjectLiteralExpression */: + case 177 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 178 /* ElementAccessExpression */: + case 179 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 179 /* CallExpression */: + case 180 /* CallExpression */: return visitCallExpression(node); - case 180 /* NewExpression */: + case 181 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -51907,9 +56229,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 184 /* FunctionExpression */: + case 185 /* FunctionExpression */: return visitFunctionExpression(node); default: ts.Debug.failBadSyntaxKind(node); @@ -51927,12 +56249,12 @@ var ts; */ function visitFunctionDeclaration(node) { // Currently, we only support generators that were originally async functions. - if (node.asteriskToken && ts.getEmitFlags(node) & 131072 /* AsyncFunctionBody */) { - node = ts.setOriginalNode(ts.createFunctionDeclaration( + if (node.asteriskToken) { + node = ts.setOriginalNode(ts.setTextRange(ts.createFunctionDeclaration( /*decorators*/ undefined, node.modifiers, /*asteriskToken*/ undefined, node.name, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, transformGeneratorFunctionBody(node.body), + /*type*/ undefined, transformGeneratorFunctionBody(node.body)), /*location*/ node), node); } else { @@ -51965,12 +56287,12 @@ var ts; */ function visitFunctionExpression(node) { // Currently, we only support generators that were originally async functions. - if (node.asteriskToken && ts.getEmitFlags(node) & 131072 /* AsyncFunctionBody */) { - node = ts.setOriginalNode(ts.createFunctionExpression( + if (node.asteriskToken) { + node = ts.setOriginalNode(ts.setTextRange(ts.createFunctionExpression( /*modifiers*/ undefined, /*asteriskToken*/ undefined, node.name, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, transformGeneratorFunctionBody(node.body), + /*type*/ undefined, transformGeneratorFunctionBody(node.body)), /*location*/ node), node); } else { @@ -52039,7 +56361,7 @@ var ts; state = ts.createTempVariable(/*recordTempVariable*/ undefined); // Build the generator resumeLexicalEnvironment(); - var statementOffset = ts.addPrologueDirectives(statements, body.statements, /*ensureUseStrict*/ false, visitor); + var statementOffset = ts.addPrologue(statements, body.statements, /*ensureUseStrict*/ false, visitor); transformAndEmitStatements(body.statements, statementOffset); var buildResult = build(); ts.addRange(statements, endLexicalEnvironment()); @@ -52058,7 +56380,7 @@ var ts; operationArguments = savedOperationArguments; operationLocations = savedOperationLocations; state = savedState; - return ts.createBlock(statements, /*location*/ body, body.multiLine); + return ts.setTextRange(ts.createBlock(statements, body.multiLine), body); } /** * Visits a variable statement. @@ -52137,7 +56459,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 177 /* PropertyAccessExpression */: + case 178 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -52149,7 +56471,7 @@ var ts; // _a.b = %sent%; target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 178 /* ElementAccessExpression */: + case 179 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -52168,7 +56490,7 @@ var ts; } var operator = node.operatorToken.kind; if (isCompoundAssignment(operator)) { - return ts.createBinary(target, 57 /* EqualsToken */, ts.createBinary(cacheExpression(target), getOperatorForCompoundAssignment(operator), ts.visitNode(right, visitor, ts.isExpression), node), node); + return ts.setTextRange(ts.createAssignment(target, ts.setTextRange(ts.createBinary(cacheExpression(target), getOperatorForCompoundAssignment(operator), ts.visitNode(right, visitor, ts.isExpression)), node)), node); } else { return ts.updateBinary(node, target, ts.visitNode(right, visitor, ts.isExpression)); @@ -52192,10 +56514,10 @@ var ts; // _a = a(); // .yield resumeLabel // _a + %sent% + c() - var clone_4 = ts.getMutableClone(node); - clone_4.left = cacheExpression(ts.visitNode(node.left, visitor, ts.isExpression)); - clone_4.right = ts.visitNode(node.right, visitor, ts.isExpression); - return clone_4; + var clone_5 = ts.getMutableClone(node); + clone_5.left = cacheExpression(ts.visitNode(node.left, visitor, ts.isExpression)); + clone_5.right = ts.visitNode(node.right, visitor, ts.isExpression); + return clone_5; } return ts.visitEachChild(node, visitor, context); } @@ -52330,17 +56652,19 @@ var ts; // .yield resumeLabel, (a()) // .mark resumeLabel // x = %sent%; - // NOTE: we are explicitly not handling YieldStar at this time. var resumeLabel = defineLabel(); var expression = ts.visitNode(node.expression, visitor, ts.isExpression); if (node.asteriskToken) { - emitYieldStar(expression, /*location*/ node); + var iterator = (ts.getEmitFlags(node.expression) & 4194304 /* Iterator */) === 0 + ? ts.createValuesHelper(context, expression, /*location*/ node) + : expression; + emitYieldStar(iterator, /*location*/ node); } else { emitYield(expression, /*location*/ node); } markLabel(resumeLabel); - return createGeneratorResume(); + return createGeneratorResume(/*location*/ node); } /** * Visits an ArrayLiteralExpression that contains a YieldExpression. @@ -52368,26 +56692,27 @@ var ts; // .mark resumeLabel // ar = _a.concat([%sent%, 2]); var numInitialElements = countInitialNodesWithoutYield(elements); - var temp = declareLocal(); - var hasAssignedTemp = false; + var temp; if (numInitialElements > 0) { + temp = declareLocal(); var initialElements = ts.visitNodes(elements, visitor, ts.isExpression, 0, numInitialElements); emitAssignment(temp, ts.createArrayLiteral(leadingElement ? [leadingElement].concat(initialElements) : initialElements)); leadingElement = undefined; - hasAssignedTemp = true; } var expressions = ts.reduceLeft(elements, reduceElement, [], numInitialElements); - return hasAssignedTemp - ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, /*location*/ undefined, multiLine)]) - : ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, location, multiLine); + return temp + ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)]) + : ts.setTextRange(ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine), location); function reduceElement(expressions, element) { if (containsYield(element) && expressions.length > 0) { + var hasAssignedTemp = temp !== undefined; + if (!temp) { + temp = declareLocal(); + } emitAssignment(temp, hasAssignedTemp - ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, /*location*/ undefined, multiLine)]) - : ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, - /*location*/ undefined, multiLine)); - hasAssignedTemp = true; + ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)]) + : ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine)); leadingElement = undefined; expressions = []; } @@ -52417,8 +56742,7 @@ var ts; var multiLine = node.multiLine; var numInitialProperties = countInitialNodesWithoutYield(properties); var temp = declareLocal(); - emitAssignment(temp, ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), - /*location*/ undefined, multiLine)); + emitAssignment(temp, ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), multiLine)); var expressions = ts.reduceLeft(properties, reduceProperty, [], numInitialProperties); expressions.push(multiLine ? ts.startOnNewLine(ts.getMutableClone(temp)) : temp); return ts.inlineExpressions(expressions); @@ -52454,10 +56778,10 @@ var ts; // .yield resumeLabel // .mark resumeLabel // a = _a[%sent%] - var clone_5 = ts.getMutableClone(node); - clone_5.expression = cacheExpression(ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression)); - clone_5.argumentExpression = ts.visitNode(node.argumentExpression, visitor, ts.isExpression); - return clone_5; + var clone_6 = ts.getMutableClone(node); + clone_6.expression = cacheExpression(ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression)); + clone_6.argumentExpression = ts.visitNode(node.argumentExpression, visitor, ts.isExpression); + return clone_6; } return ts.visitEachChild(node, visitor, context); } @@ -52492,10 +56816,9 @@ var ts; // .mark resumeLabel // new (_b.apply(_a, _c.concat([%sent%, 2]))); var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; - return ts.setOriginalNode(ts.createNew(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isExpression)), thisArg, visitElements(node.arguments, + return ts.setOriginalNode(ts.setTextRange(ts.createNew(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isExpression)), thisArg, visitElements(node.arguments, /*leadingElement*/ ts.createVoidZero())), - /*typeArguments*/ undefined, [], - /*location*/ node), node); + /*typeArguments*/ undefined, []), node), node); } return ts.visitEachChild(node, visitor, context); } @@ -52524,38 +56847,38 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 204 /* Block */: + case 206 /* Block */: return transformAndEmitBlock(node); - case 207 /* ExpressionStatement */: + case 209 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 208 /* IfStatement */: + case 210 /* IfStatement */: return transformAndEmitIfStatement(node); - case 209 /* DoStatement */: + case 211 /* DoStatement */: return transformAndEmitDoStatement(node); - case 210 /* WhileStatement */: + case 212 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 211 /* ForStatement */: + case 213 /* ForStatement */: return transformAndEmitForStatement(node); - case 212 /* ForInStatement */: + case 214 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 214 /* ContinueStatement */: + case 216 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 215 /* BreakStatement */: + case 217 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 216 /* ReturnStatement */: + case 218 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 217 /* WithStatement */: + case 219 /* WithStatement */: return transformAndEmitWithStatement(node); - case 218 /* SwitchStatement */: + case 220 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 220 /* ThrowStatement */: + case 222 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 221 /* TryStatement */: + case 223 /* TryStatement */: return transformAndEmitTryStatement(node); default: - return emitStatement(ts.visitNode(node, visitor, ts.isStatement, /*optional*/ true)); + return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); } } function transformAndEmitBlock(node) { @@ -52572,7 +56895,9 @@ var ts; function transformAndEmitVariableDeclarationList(node) { for (var _i = 0, _a = node.declarations; _i < _a.length; _i++) { var variable = _a[_i]; - hoistVariableDeclaration(variable.name); + var name = ts.getSynthesizedClone(variable.name); + ts.setCommentRange(name, variable.name); + hoistVariableDeclaration(name); } var variables = ts.getInitializedVariables(node); var numVariables = variables.length; @@ -52615,7 +56940,7 @@ var ts; if (containsYield(node.thenStatement) || containsYield(node.elseStatement)) { var endLabel = defineLabel(); var elseLabel = node.elseStatement ? defineLabel() : undefined; - emitBreakWhenFalse(node.elseStatement ? elseLabel : endLabel, ts.visitNode(node.expression, visitor, ts.isExpression)); + emitBreakWhenFalse(node.elseStatement ? elseLabel : endLabel, ts.visitNode(node.expression, visitor, ts.isExpression), /*location*/ node.expression); transformAndEmitEmbeddedStatement(node.thenStatement); if (node.elseStatement) { emitBreak(endLabel); @@ -52738,8 +57063,7 @@ var ts; transformAndEmitVariableDeclarationList(initializer); } else { - emitStatement(ts.createStatement(ts.visitNode(initializer, visitor, ts.isExpression), - /*location*/ initializer)); + emitStatement(ts.setTextRange(ts.createStatement(ts.visitNode(initializer, visitor, ts.isExpression)), initializer)); } } markLabel(conditionLabel); @@ -52749,8 +57073,7 @@ var ts; transformAndEmitEmbeddedStatement(node.statement); markLabel(incrementLabel); if (node.incrementor) { - emitStatement(ts.createStatement(ts.visitNode(node.incrementor, visitor, ts.isExpression), - /*location*/ node.incrementor)); + emitStatement(ts.setTextRange(ts.createStatement(ts.visitNode(node.incrementor, visitor, ts.isExpression)), node.incrementor)); } emitBreak(conditionLabel); endLoopBlock(); @@ -52764,7 +57087,7 @@ var ts; beginScriptLoopBlock(); } var initializer = node.initializer; - if (ts.isVariableDeclarationList(initializer)) { + if (initializer && ts.isVariableDeclarationList(initializer)) { for (var _i = 0, _a = initializer.declarations; _i < _a.length; _i++) { var variable = _a[_i]; hoistVariableDeclaration(variable.name); @@ -52772,7 +57095,7 @@ var ts; var variables = ts.getInitializedVariables(initializer); node = ts.updateFor(node, variables.length > 0 ? ts.inlineExpressions(ts.map(variables, transformInitializedVariable)) - : undefined, ts.visitNode(node.condition, visitor, ts.isExpression, /*optional*/ true), ts.visitNode(node.incrementor, visitor, ts.isExpression, /*optional*/ true), ts.visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, ts.liftToBlock)); + : undefined, ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); } else { node = ts.visitEachChild(node, visitor, context); @@ -52864,7 +57187,7 @@ var ts; var variable = _a[_i]; hoistVariableDeclaration(variable.name); } - node = ts.updateForIn(node, initializer.declarations[0].name, ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, ts.liftToBlock)); + node = ts.updateForIn(node, initializer.declarations[0].name, ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); } else { node = ts.visitEachChild(node, visitor, context); @@ -52903,11 +57226,11 @@ var ts; return ts.visitEachChild(node, visitor, context); } function transformAndEmitReturnStatement(node) { - emitReturn(ts.visitNode(node.expression, visitor, ts.isExpression, /*optional*/ true), + emitReturn(ts.visitNode(node.expression, visitor, ts.isExpression), /*location*/ node); } function visitReturnStatement(node) { - return createInlineReturn(ts.visitNode(node.expression, visitor, ts.isExpression, /*optional*/ true), + return createInlineReturn(ts.visitNode(node.expression, visitor, ts.isExpression), /*location*/ node); } function transformAndEmitWithStatement(node) { @@ -52972,7 +57295,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 254 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 257 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -52985,7 +57308,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 253 /* CaseClause */) { + if (clause.kind === 256 /* CaseClause */) { var caseClause = clause; if (containsYield(caseClause.expression) && pendingClauses.length > 0) { break; @@ -53127,9 +57450,9 @@ var ts; } return -1; } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1 /* Expression */) { + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 /* Expression */) { return substituteExpression(node); } return node; @@ -53141,17 +57464,17 @@ var ts; return node; } function substituteExpressionIdentifier(node) { - if (renamedCatchVariables && ts.hasProperty(renamedCatchVariables, node.text)) { + if (!ts.isGeneratedIdentifier(node) && renamedCatchVariables && renamedCatchVariables.has(node.text)) { var original = ts.getOriginalNode(node); if (ts.isIdentifier(original) && original.parent) { var declaration = resolver.getReferencedValueDeclaration(original); if (declaration) { - var name_36 = ts.getProperty(renamedCatchVariableDeclarations, String(ts.getOriginalNodeId(declaration))); - if (name_36) { - var clone_6 = ts.getMutableClone(name_36); - ts.setSourceMapRange(clone_6, node); - ts.setCommentRange(clone_6, node); - return clone_6; + var name = renamedCatchVariableDeclarations[ts.getOriginalNodeId(declaration)]; + if (name) { + var clone_7 = ts.getMutableClone(name); + ts.setSourceMapRange(clone_7, node); + ts.setCommentRange(clone_7, node); + return clone_7; } } } @@ -53160,7 +57483,7 @@ var ts; } function cacheExpression(node) { var temp; - if (ts.isGeneratedIdentifier(node)) { + if (ts.isGeneratedIdentifier(node) || ts.getEmitFlags(node) & 4096 /* HelperName */) { return node; } temp = ts.createTempVariable(hoistVariableDeclaration); @@ -53288,15 +57611,23 @@ var ts; */ function beginCatchBlock(variable) { ts.Debug.assert(peekBlockKind() === 0 /* Exception */); - var text = variable.name.text; - var name = declareLocal(text); - if (!renamedCatchVariables) { - renamedCatchVariables = ts.createMap(); - renamedCatchVariableDeclarations = ts.createMap(); - context.enableSubstitution(70 /* Identifier */); + // generated identifiers should already be unique within a file + var name; + if (ts.isGeneratedIdentifier(variable.name)) { + name = variable.name; + hoistVariableDeclaration(variable.name); + } + else { + var text = variable.name.text; + name = declareLocal(text); + if (!renamedCatchVariables) { + renamedCatchVariables = ts.createMap(); + renamedCatchVariableDeclarations = []; + context.enableSubstitution(70 /* Identifier */); + } + renamedCatchVariables.set(text, true); + renamedCatchVariableDeclarations[ts.getOriginalNodeId(variable)] = name; } - renamedCatchVariables[text] = true; - renamedCatchVariableDeclarations[ts.getOriginalNodeId(variable)] = name; var exception = peekBlock(); ts.Debug.assert(exception.state < 1 /* Catch */); var endLabel = exception.endLabel; @@ -53566,7 +57897,7 @@ var ts; */ function createInstruction(instruction) { var literal = ts.createLiteral(instruction); - literal.trailingComment = instructionNames[instruction]; + ts.addSyntheticTrailingComment(literal, 3 /* MultiLineCommentTrivia */, getInstructionName(instruction)); return literal; } /** @@ -53577,10 +57908,10 @@ var ts; */ function createInlineBreak(label, location) { ts.Debug.assert(label > 0, "Invalid label: " + label); - return ts.createReturn(ts.createArrayLiteral([ + return ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3 /* Break */), createLabel(label) - ]), location); + ])), location); } /** * Creates a statement that can be used indicate a Return operation. @@ -53589,15 +57920,16 @@ var ts; * @param location An optional source map location for the statement. */ function createInlineReturn(expression, location) { - return ts.createReturn(ts.createArrayLiteral(expression + return ts.setTextRange(ts.createReturn(ts.createArrayLiteral(expression ? [createInstruction(2 /* Return */), expression] - : [createInstruction(2 /* Return */)]), location); + : [createInstruction(2 /* Return */)])), location); } /** * Creates an expression that can be used to resume from a Yield operation. */ function createGeneratorResume(location) { - return ts.createCall(ts.createPropertyAccess(state, "sent"), /*typeArguments*/ undefined, [], location); + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(state, "sent"), + /*typeArguments*/ undefined, []), location); } /** * Emits an empty instruction. @@ -53743,7 +58075,6 @@ var ts; /*name*/ undefined, /*typeParameters*/ undefined, [ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, state)], /*type*/ undefined, ts.createBlock(buildResult, - /*location*/ undefined, /*multiLine*/ buildResult.length > 0)), 262144 /* ReuseTempVariableScope */)); } /** @@ -54014,7 +58345,7 @@ var ts; * @param operationLocation The source map location for the operation. */ function writeAssign(left, right, operationLocation) { - writeStatement(ts.createStatement(ts.createAssignment(left, right), operationLocation)); + writeStatement(ts.setTextRange(ts.createStatement(ts.createAssignment(left, right)), operationLocation)); } /** * Writes a Throw operation to the current label's statement list. @@ -54025,7 +58356,7 @@ var ts; function writeThrow(expression, operationLocation) { lastOperationWasAbrupt = true; lastOperationWasCompletion = true; - writeStatement(ts.createThrow(expression, operationLocation)); + writeStatement(ts.setTextRange(ts.createThrow(expression), operationLocation)); } /** * Writes a Return operation to the current label's statement list. @@ -54036,9 +58367,9 @@ var ts; function writeReturn(expression, operationLocation) { lastOperationWasAbrupt = true; lastOperationWasCompletion = true; - writeStatement(ts.createReturn(ts.createArrayLiteral(expression + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral(expression ? [createInstruction(2 /* Return */), expression] - : [createInstruction(2 /* Return */)]), operationLocation)); + : [createInstruction(2 /* Return */)])), operationLocation), 384 /* NoTokenSourceMaps */)); } /** * Writes a Break operation to the current label's statement list. @@ -54048,10 +58379,10 @@ var ts; */ function writeBreak(label, operationLocation) { lastOperationWasAbrupt = true; - writeStatement(ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3 /* Break */), createLabel(label) - ]), operationLocation)); + ])), operationLocation), 384 /* NoTokenSourceMaps */)); } /** * Writes a BreakWhenTrue operation to the current label's statement list. @@ -54061,10 +58392,10 @@ var ts; * @param operationLocation The source map location for the operation. */ function writeBreakWhenTrue(label, condition, operationLocation) { - writeStatement(ts.createIf(condition, ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.createIf(condition, ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3 /* Break */), createLabel(label) - ]), operationLocation))); + ])), operationLocation), 384 /* NoTokenSourceMaps */)), 1 /* SingleLine */)); } /** * Writes a BreakWhenFalse operation to the current label's statement list. @@ -54074,10 +58405,10 @@ var ts; * @param operationLocation The source map location for the operation. */ function writeBreakWhenFalse(label, condition, operationLocation) { - writeStatement(ts.createIf(ts.createLogicalNot(condition), ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.createIf(ts.createLogicalNot(condition), ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3 /* Break */), createLabel(label) - ]), operationLocation))); + ])), operationLocation), 384 /* NoTokenSourceMaps */)), 1 /* SingleLine */)); } /** * Writes a Yield operation to the current label's statement list. @@ -54087,9 +58418,9 @@ var ts; */ function writeYield(expression, operationLocation) { lastOperationWasAbrupt = true; - writeStatement(ts.createReturn(ts.createArrayLiteral(expression + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral(expression ? [createInstruction(4 /* Yield */), expression] - : [createInstruction(4 /* Yield */)]), operationLocation)); + : [createInstruction(4 /* Yield */)])), operationLocation), 384 /* NoTokenSourceMaps */)); } /** * Writes a YieldStar instruction to the current label's statement list. @@ -54099,10 +58430,10 @@ var ts; */ function writeYieldStar(expression, operationLocation) { lastOperationWasAbrupt = true; - writeStatement(ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(5 /* YieldStar */), expression - ]), operationLocation)); + ])), operationLocation), 384 /* NoTokenSourceMaps */)); } /** * Writes an Endfinally instruction to the current label's statement list. @@ -54183,157 +58514,918 @@ var ts; name: "typescript:generator", scoped: false, priority: 6, - text: "\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;\n return { next: verb(0), \"throw\": verb(1), \"return\": verb(2) };\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [0, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };" + text: "\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [0, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };" }; - var _a; -})(ts || (ts = {})); -/// -/// -/*@internal*/ -var ts; -(function (ts) { - /** - * Transforms ES5 syntax into ES3 syntax. - * - * @param context Context and state information for the transformation. - */ - function transformES5(context) { - var previousOnSubstituteNode = context.onSubstituteNode; - context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(177 /* PropertyAccessExpression */); - context.enableSubstitution(257 /* PropertyAssignment */); - return transformSourceFile; - /** - * Transforms an ES5 source file to ES3. - * - * @param node A SourceFile - */ - function transformSourceFile(node) { - return node; - } - /** - * Hooks node substitutions. - * - * @param emitContext The context for the emitter. - * @param node The node to substitute. - */ - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (ts.isPropertyAccessExpression(node)) { - return substitutePropertyAccessExpression(node); - } - else if (ts.isPropertyAssignment(node)) { - return substitutePropertyAssignment(node); - } - return node; - } - /** - * Substitutes a PropertyAccessExpression whose name is a reserved word. - * - * @param node A PropertyAccessExpression - */ - function substitutePropertyAccessExpression(node) { - var literalName = trySubstituteReservedName(node.name); - if (literalName) { - return ts.createElementAccess(node.expression, literalName, /*location*/ node); - } - return node; - } - /** - * Substitutes a PropertyAssignment whose name is a reserved word. - * - * @param node A PropertyAssignment - */ - function substitutePropertyAssignment(node) { - var literalName = ts.isIdentifier(node.name) && trySubstituteReservedName(node.name); - if (literalName) { - return ts.updatePropertyAssignment(node, literalName, node.initializer); - } - return node; - } - /** - * If an identifier name is a reserved word, returns a string literal for the name. - * - * @param name An Identifier - */ - function trySubstituteReservedName(name) { - var token = name.originalKeywordKind || (ts.nodeIsSynthesized(name) ? ts.stringToToken(name.text) : undefined); - if (token >= 71 /* FirstReservedWord */ && token <= 106 /* LastReservedWord */) { - return ts.createLiteral(name, /*location*/ name); - } - return undefined; - } - } - ts.transformES5 = transformES5; })(ts || (ts = {})); /// /// +/// /*@internal*/ var ts; (function (ts) { - function transformES2015Module(context) { + function transformModule(context) { + function getTransformModuleDelegate(moduleKind) { + switch (moduleKind) { + case ts.ModuleKind.AMD: return transformAMDModule; + case ts.ModuleKind.UMD: return transformUMDModule; + default: return transformCommonJSModule; + } + } + var startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; var compilerOptions = context.getCompilerOptions(); - var previousOnEmitNode = context.onEmitNode; + var resolver = context.getEmitResolver(); + var host = context.getEmitHost(); + var languageVersion = ts.getEmitScriptTarget(compilerOptions); + var moduleKind = ts.getEmitModuleKind(compilerOptions); var previousOnSubstituteNode = context.onSubstituteNode; - context.onEmitNode = onEmitNode; + var previousOnEmitNode = context.onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(261 /* SourceFile */); - context.enableSubstitution(70 /* Identifier */); - var currentSourceFile; + context.onEmitNode = onEmitNode; + context.enableSubstitution(70 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. + context.enableSubstitution(193 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(191 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(192 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(261 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(264 /* SourceFile */); // Restore state when substituting nodes in a file. + var moduleInfoMap = []; // The ExternalModuleInfo for each file. + var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. + var currentSourceFile; // The current file. + var currentModuleInfo; // The ExternalModuleInfo for the current file. + var noSubstitution; // Set of nodes for which substitution rules should be ignored. return transformSourceFile; + /** + * Transforms the module aspects of a SourceFile. + * + * @param node The SourceFile node. + */ function transformSourceFile(node) { - if (ts.isDeclarationFile(node)) { + if (ts.isDeclarationFile(node) || !(ts.isExternalModule(node) || compilerOptions.isolatedModules)) { return node; } - if (ts.isExternalModule(node) || compilerOptions.isolatedModules) { - var externalHelpersModuleName = ts.getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions); - if (externalHelpersModuleName) { - var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.statements); - ts.append(statements, ts.createImportDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText))); - ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset)); - return ts.updateSourceFileNode(node, ts.createNodeArray(statements, node.statements)); + currentSourceFile = node; + currentModuleInfo = ts.collectExternalModuleInfo(node, resolver, compilerOptions); + moduleInfoMap[ts.getOriginalNodeId(node)] = currentModuleInfo; + // Perform the transformation. + var transformModule = getTransformModuleDelegate(moduleKind); + var updated = transformModule(node); + currentSourceFile = undefined; + currentModuleInfo = undefined; + return ts.aggregateTransformFlags(updated); + } + function shouldEmitUnderscoreUnderscoreESModule() { + if (!currentModuleInfo.exportEquals && ts.isExternalModule(currentSourceFile)) { + return true; + } + return false; + } + /** + * Transforms a SourceFile into a CommonJS module. + * + * @param node The SourceFile node. + */ + function transformCommonJSModule(node) { + startLexicalEnvironment(); + var statements = []; + var ensureUseStrict = compilerOptions.alwaysStrict || (!compilerOptions.noImplicitUseStrict && ts.isExternalModule(currentSourceFile)); + var statementOffset = ts.addPrologue(statements, node.statements, ensureUseStrict, sourceElementVisitor); + if (shouldEmitUnderscoreUnderscoreESModule()) { + ts.append(statements, createUnderscoreUnderscoreESModule()); + } + ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement)); + ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); + addExportEqualsIfNeeded(statements, /*emitAsReturn*/ false); + ts.addRange(statements, endLexicalEnvironment()); + var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements)); + if (currentModuleInfo.hasExportStarsToExportValues) { + // If we have any `export * from ...` declarations + // we need to inform the emitter to add the __export helper. + ts.addEmitHelper(updated, exportStarHelper); + } + return updated; + } + /** + * Transforms a SourceFile into an AMD module. + * + * @param node The SourceFile node. + */ + function transformAMDModule(node) { + var define = ts.createIdentifier("define"); + var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions); + // An AMD define function has the following shape: + // + // define(id?, dependencies?, factory); + // + // This has the shape of the following: + // + // define(name, ["module1", "module2"], function (module1Alias) { ... } + // + // The location of the alias in the parameter list in the factory function needs to + // match the position of the module name in the dependency list. + // + // To ensure this is true in cases of modules with no aliases, e.g.: + // + // import "module" + // + // or + // + // /// + // + // we need to add modules without alias names to the end of the dependencies list + var _a = collectAsynchronousDependencies(node, /*includeNonAmdDependencies*/ true), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames; + // Create an updated SourceFile: + // + // define(moduleName?, ["module1", "module2"], function ... + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ + ts.createStatement(ts.createCall(define, + /*typeArguments*/ undefined, (moduleName ? [moduleName] : []).concat([ + // Add the dependency array argument: + // + // ["require", "exports", module1", "module2", ...] + ts.createArrayLiteral([ + ts.createLiteral("require"), + ts.createLiteral("exports") + ].concat(aliasedModuleNames, unaliasedModuleNames)), + // Add the module body function argument: + // + // function (require, exports, module1, module2) ... + ts.createFunctionExpression( + /*modifiers*/ undefined, + /*asteriskToken*/ undefined, + /*name*/ undefined, + /*typeParameters*/ undefined, [ + ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "require"), + ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "exports") + ].concat(importAliasNames), + /*type*/ undefined, transformAsynchronousModuleBody(node)) + ]))) + ]), + /*location*/ node.statements)); + } + /** + * Transforms a SourceFile into a UMD module. + * + * @param node The SourceFile node. + */ + function transformUMDModule(node) { + var _a = collectAsynchronousDependencies(node, /*includeNonAmdDependencies*/ false), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames; + var umdHeader = ts.createFunctionExpression( + /*modifiers*/ undefined, + /*asteriskToken*/ undefined, + /*name*/ undefined, + /*typeParameters*/ undefined, [ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "factory")], + /*type*/ undefined, ts.setTextRange(ts.createBlock([ + ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier("module"), "object"), ts.createTypeCheck(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), "object")), ts.createBlock([ + ts.createVariableStatement( + /*modifiers*/ undefined, [ + ts.createVariableDeclaration("v", + /*type*/ undefined, ts.createCall(ts.createIdentifier("factory"), + /*typeArguments*/ undefined, [ + ts.createIdentifier("require"), + ts.createIdentifier("exports") + ])) + ]), + ts.setEmitFlags(ts.createIf(ts.createStrictInequality(ts.createIdentifier("v"), ts.createIdentifier("undefined")), ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), ts.createIdentifier("v")))), 1 /* SingleLine */) + ]), ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier("define"), "function"), ts.createPropertyAccess(ts.createIdentifier("define"), "amd")), ts.createBlock([ + ts.createStatement(ts.createCall(ts.createIdentifier("define"), + /*typeArguments*/ undefined, [ + ts.createArrayLiteral([ + ts.createLiteral("require"), + ts.createLiteral("exports") + ].concat(aliasedModuleNames, unaliasedModuleNames)), + ts.createIdentifier("factory") + ])) + ]))) + ], + /*multiLine*/ true), + /*location*/ undefined)); + // Create an updated SourceFile: + // + // (function (factory) { + // if (typeof module === "object" && typeof module.exports === "object") { + // var v = factory(require, exports); + // if (v !== undefined) module.exports = v; + // } + // else if (typeof define === 'function' && define.amd) { + // define(["require", "exports"], factory); + // } + // })(function ...) + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ + ts.createStatement(ts.createCall(umdHeader, + /*typeArguments*/ undefined, [ + // Add the module body function argument: + // + // function (require, exports) ... + ts.createFunctionExpression( + /*modifiers*/ undefined, + /*asteriskToken*/ undefined, + /*name*/ undefined, + /*typeParameters*/ undefined, [ + ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "require"), + ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "exports") + ].concat(importAliasNames), + /*type*/ undefined, transformAsynchronousModuleBody(node)) + ])) + ]), + /*location*/ node.statements)); + } + /** + * Collect the additional asynchronous dependencies for the module. + * + * @param node The source file. + * @param includeNonAmdDependencies A value indicating whether to include non-AMD dependencies. + */ + function collectAsynchronousDependencies(node, includeNonAmdDependencies) { + // names of modules with corresponding parameter in the factory function + var aliasedModuleNames = []; + // names of modules with no corresponding parameters in factory function + var unaliasedModuleNames = []; + // names of the parameters in the factory function; these + // parameters need to match the indexes of the corresponding + // module names in aliasedModuleNames. + var importAliasNames = []; + // Fill in amd-dependency tags + for (var _i = 0, _a = node.amdDependencies; _i < _a.length; _i++) { + var amdDependency = _a[_i]; + if (amdDependency.name) { + aliasedModuleNames.push(ts.createLiteral(amdDependency.path)); + importAliasNames.push(ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, amdDependency.name)); } else { - return ts.visitEachChild(node, visitor, context); + unaliasedModuleNames.push(ts.createLiteral(amdDependency.path)); } } - return node; + for (var _b = 0, _c = currentModuleInfo.externalImports; _b < _c.length; _b++) { + var importNode = _c[_b]; + // Find the name of the external module + var externalModuleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions); + // Find the name of the module alias, if there is one + var importAliasName = ts.getLocalNameForExternalImport(importNode, currentSourceFile); + // It is possible that externalModuleName is undefined if it is not string literal. + // This can happen in the invalid import syntax. + // E.g : "import * from alias from 'someLib';" + if (externalModuleName) { + if (includeNonAmdDependencies && importAliasName) { + // Set emitFlags on the name of the classDeclaration + // This is so that when printer will not substitute the identifier + ts.setEmitFlags(importAliasName, 4 /* NoSubstitution */); + aliasedModuleNames.push(externalModuleName); + importAliasNames.push(ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, importAliasName)); + } + else { + unaliasedModuleNames.push(externalModuleName); + } + } + } + return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames }; } - function visitor(node) { + /** + * Transforms a SourceFile into an AMD or UMD module body. + * + * @param node The SourceFile node. + */ + function transformAsynchronousModuleBody(node) { + startLexicalEnvironment(); + var statements = []; + var statementOffset = ts.addPrologue(statements, node.statements, /*ensureUseStrict*/ !compilerOptions.noImplicitUseStrict, sourceElementVisitor); + if (shouldEmitUnderscoreUnderscoreESModule()) { + ts.append(statements, createUnderscoreUnderscoreESModule()); + } + // Visit each statement of the module body. + ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement)); + ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); + // Append the 'export =' statement if provided. + addExportEqualsIfNeeded(statements, /*emitAsReturn*/ true); + // End the lexical environment for the module body + // and merge any new lexical declarations. + ts.addRange(statements, endLexicalEnvironment()); + var body = ts.createBlock(statements, /*multiLine*/ true); + if (currentModuleInfo.hasExportStarsToExportValues) { + // If we have any `export * from ...` declarations + // we need to inform the emitter to add the __export helper. + ts.addEmitHelper(body, exportStarHelper); + } + return body; + } + /** + * Adds the down-level representation of `export=` to the statement list if one exists + * in the source file. + * + * @param statements The Statement list to modify. + * @param emitAsReturn A value indicating whether to emit the `export=` statement as a + * return statement. + */ + function addExportEqualsIfNeeded(statements, emitAsReturn) { + if (currentModuleInfo.exportEquals) { + if (emitAsReturn) { + var statement = ts.createReturn(currentModuleInfo.exportEquals.expression); + ts.setTextRange(statement, currentModuleInfo.exportEquals); + ts.setEmitFlags(statement, 384 /* NoTokenSourceMaps */ | 1536 /* NoComments */); + statements.push(statement); + } + else { + var statement = ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), currentModuleInfo.exportEquals.expression)); + ts.setTextRange(statement, currentModuleInfo.exportEquals); + ts.setEmitFlags(statement, 1536 /* NoComments */); + statements.push(statement); + } + } + } + // + // Top-Level Source Element Visitors + // + /** + * Visits a node at the top level of the source file. + * + * @param node The node to visit. + */ + function sourceElementVisitor(node) { switch (node.kind) { - case 234 /* ImportEqualsDeclaration */: - // Elide `import=` as it is not legal with --module ES6 - return undefined; - case 240 /* ExportAssignment */: + case 237 /* ImportDeclaration */: + return visitImportDeclaration(node); + case 236 /* ImportEqualsDeclaration */: + return visitImportEqualsDeclaration(node); + case 243 /* ExportDeclaration */: + return visitExportDeclaration(node); + case 242 /* ExportAssignment */: return visitExportAssignment(node); + case 207 /* VariableStatement */: + return visitVariableStatement(node); + case 227 /* FunctionDeclaration */: + return visitFunctionDeclaration(node); + case 228 /* ClassDeclaration */: + return visitClassDeclaration(node); + case 296 /* MergeDeclarationMarker */: + return visitMergeDeclarationMarker(node); + case 297 /* EndOfDeclarationMarker */: + return visitEndOfDeclarationMarker(node); + default: + // This visitor does not descend into the tree, as export/import statements + // are only transformed at the top level of a file. + return node; + } + } + /** + * Visits an ImportDeclaration node. + * + * @param node The node to visit. + */ + function visitImportDeclaration(node) { + var statements; + var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); + if (moduleKind !== ts.ModuleKind.AMD) { + if (!node.importClause) { + // import "mod"; + return ts.setTextRange(ts.createStatement(createRequireCall(node)), node); + } + else { + var variables = []; + if (namespaceDeclaration && !ts.isDefaultImport(node)) { + // import * as n from "mod"; + variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), + /*type*/ undefined, createRequireCall(node))); + } + else { + // import d from "mod"; + // import { x, y } from "mod"; + // import d, { x, y } from "mod"; + // import d, * as n from "mod"; + variables.push(ts.createVariableDeclaration(ts.getGeneratedNameForNode(node), + /*type*/ undefined, createRequireCall(node))); + if (namespaceDeclaration && ts.isDefaultImport(node)) { + variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), + /*type*/ undefined, ts.getGeneratedNameForNode(node))); + } + } + statements = ts.append(statements, ts.setTextRange(ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList(variables, languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */)), + /*location*/ node)); + } + } + else if (namespaceDeclaration && ts.isDefaultImport(node)) { + // import d, * as n from "mod"; + statements = ts.append(statements, ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), + /*type*/ undefined, ts.getGeneratedNameForNode(node)), + /*location*/ node) + ], languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */))); + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + // Defer exports until we encounter an EndOfDeclarationMarker node + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfImportDeclaration(deferredExports[id], node); + } + else { + statements = appendExportsOfImportDeclaration(statements, node); + } + return ts.singleOrMany(statements); + } + /** + * Creates a `require()` call to import an external module. + * + * @param importNode The declararation to import. + */ + function createRequireCall(importNode) { + var moduleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions); + var args = []; + if (moduleName) { + args.push(moduleName); + } + return ts.createCall(ts.createIdentifier("require"), /*typeArguments*/ undefined, args); + } + /** + * Visits an ImportEqualsDeclaration node. + * + * @param node The node to visit. + */ + function visitImportEqualsDeclaration(node) { + ts.Debug.assert(ts.isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer."); + var statements; + if (moduleKind !== ts.ModuleKind.AMD) { + if (ts.hasModifier(node, 1 /* Export */)) { + statements = ts.append(statements, ts.setTextRange(ts.createStatement(createExportExpression(node.name, createRequireCall(node))), node)); + } + else { + statements = ts.append(statements, ts.setTextRange(ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration(ts.getSynthesizedClone(node.name), + /*type*/ undefined, createRequireCall(node)) + ], + /*flags*/ languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */)), node)); + } + } + else { + if (ts.hasModifier(node, 1 /* Export */)) { + statements = ts.append(statements, ts.setTextRange(ts.createStatement(createExportExpression(ts.getExportName(node), ts.getLocalName(node))), node)); + } + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + // Defer exports until we encounter an EndOfDeclarationMarker node + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfImportEqualsDeclaration(deferredExports[id], node); + } + else { + statements = appendExportsOfImportEqualsDeclaration(statements, node); + } + return ts.singleOrMany(statements); + } + /** + * Visits an ExportDeclaration node. + * + * @param The node to visit. + */ + function visitExportDeclaration(node) { + if (!node.moduleSpecifier) { + // Elide export declarations with no module specifier as they are handled + // elsewhere. + return undefined; + } + var generatedName = ts.getGeneratedNameForNode(node); + if (node.exportClause) { + var statements = []; + // export { x, y } from "mod"; + if (moduleKind !== ts.ModuleKind.AMD) { + statements.push(ts.setTextRange(ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration(generatedName, + /*type*/ undefined, createRequireCall(node)) + ])), + /*location*/ node)); + } + for (var _i = 0, _a = node.exportClause.elements; _i < _a.length; _i++) { + var specifier = _a[_i]; + var exportedValue = ts.createPropertyAccess(generatedName, specifier.propertyName || specifier.name); + statements.push(ts.setTextRange(ts.createStatement(createExportExpression(ts.getExportName(specifier), exportedValue)), specifier)); + } + return ts.singleOrMany(statements); + } + else { + // export * from "mod"; + return ts.setTextRange(ts.createStatement(ts.createCall(ts.createIdentifier("__export"), + /*typeArguments*/ undefined, [ + moduleKind !== ts.ModuleKind.AMD + ? createRequireCall(node) + : generatedName + ])), node); + } + } + /** + * Visits an ExportAssignment node. + * + * @param node The node to visit. + */ + function visitExportAssignment(node) { + if (node.isExportEquals) { + return undefined; + } + var statements; + var original = node.original; + if (original && hasAssociatedEndOfDeclarationMarker(original)) { + // Defer exports until we encounter an EndOfDeclarationMarker node + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportStatement(deferredExports[id], ts.createIdentifier("default"), node.expression, /*location*/ node, /*allowComments*/ true); + } + else { + statements = appendExportStatement(statements, ts.createIdentifier("default"), node.expression, /*location*/ node, /*allowComments*/ true); + } + return ts.singleOrMany(statements); + } + /** + * Visits a FunctionDeclaration node. + * + * @param node The node to visit. + */ + function visitFunctionDeclaration(node) { + var statements; + if (ts.hasModifier(node, 1 /* Export */)) { + statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(ts.createFunctionDeclaration( + /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, ts.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), + /*typeParameters*/ undefined, node.parameters, + /*type*/ undefined, node.body), + /*location*/ node), + /*original*/ node)); + } + else { + statements = ts.append(statements, node); + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + // Defer exports until we encounter an EndOfDeclarationMarker node + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node); + } + else { + statements = appendExportsOfHoistedDeclaration(statements, node); + } + return ts.singleOrMany(statements); + } + /** + * Visits a ClassDeclaration node. + * + * @param node The node to visit. + */ + function visitClassDeclaration(node) { + var statements; + if (ts.hasModifier(node, 1 /* Export */)) { + statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(ts.createClassDeclaration( + /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), + /*typeParameters*/ undefined, node.heritageClauses, node.members), node), node)); + } + else { + statements = ts.append(statements, node); + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + // Defer exports until we encounter an EndOfDeclarationMarker node + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node); + } + else { + statements = appendExportsOfHoistedDeclaration(statements, node); + } + return ts.singleOrMany(statements); + } + /** + * Visits a VariableStatement node. + * + * @param node The node to visit. + */ + function visitVariableStatement(node) { + var statements; + var variables; + var expressions; + if (ts.hasModifier(node, 1 /* Export */)) { + var modifiers = void 0; + // If we're exporting these variables, then these just become assignments to 'exports.x'. + // We only want to emit assignments for variables with initializers. + for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { + var variable = _a[_i]; + if (ts.isIdentifier(variable.name) && ts.isLocalName(variable.name)) { + if (!modifiers) { + modifiers = ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier); + } + variables = ts.append(variables, variable); + } + else if (variable.initializer) { + expressions = ts.append(expressions, transformInitializedVariable(variable)); + } + } + if (variables) { + statements = ts.append(statements, ts.updateVariableStatement(node, modifiers, ts.updateVariableDeclarationList(node.declarationList, variables))); + } + if (expressions) { + statements = ts.append(statements, ts.setTextRange(ts.createStatement(ts.inlineExpressions(expressions)), node)); + } + } + else { + statements = ts.append(statements, node); + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + // Defer exports until we encounter an EndOfDeclarationMarker node + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node); + } + else { + statements = appendExportsOfVariableStatement(statements, node); + } + return ts.singleOrMany(statements); + } + /** + * Transforms an exported variable with an initializer into an expression. + * + * @param node The node to transform. + */ + function transformInitializedVariable(node) { + if (ts.isBindingPattern(node.name)) { + return ts.flattenDestructuringAssignment(node, + /*visitor*/ undefined, context, 0 /* All */, + /*needsValue*/ false, createExportExpression); + } + else { + return ts.createAssignment(ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), node.name), + /*location*/ node.name), node.initializer); + } + } + /** + * Visits a MergeDeclarationMarker used as a placeholder for the beginning of a merged + * and transformed declaration. + * + * @param node The node to visit. + */ + function visitMergeDeclarationMarker(node) { + // For an EnumDeclaration or ModuleDeclaration that merges with a preceeding + // declaration we do not emit a leading variable declaration. To preserve the + // begin/end semantics of the declararation and to properly handle exports + // we wrapped the leading variable declaration in a `MergeDeclarationMarker`. + // + // To balance the declaration, add the exports of the elided variable + // statement. + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 207 /* VariableStatement */) { + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } return node; } - function visitExportAssignment(node) { - // Elide `export=` as it is not legal with --module ES6 - return node.isExportEquals ? undefined : node; + /** + * Determines whether a node has an associated EndOfDeclarationMarker. + * + * @param node The node to test. + */ + function hasAssociatedEndOfDeclarationMarker(node) { + return (ts.getEmitFlags(node) & 2097152 /* HasEndOfDeclarationMarker */) !== 0; + } + /** + * Visits a DeclarationMarker used as a placeholder for the end of a transformed + * declaration. + * + * @param node The node to visit. + */ + function visitEndOfDeclarationMarker(node) { + // For some transformations we emit an `EndOfDeclarationMarker` to mark the actual + // end of the transformed declaration. We use this marker to emit any deferred exports + // of the declaration. + var id = ts.getOriginalNodeId(node); + var statements = deferredExports[id]; + if (statements) { + delete deferredExports[id]; + return ts.append(statements, node); + } + return node; + } + /** + * Appends the exports of an ImportDeclaration to a statement list, returning the + * statement list. + * + * @param statements A statement list to which the down-level export statements are to be + * appended. If `statements` is `undefined`, a new array is allocated if statements are + * appended. + * @param decl The declaration whose exports are to be recorded. + */ + function appendExportsOfImportDeclaration(statements, decl) { + if (currentModuleInfo.exportEquals) { + return statements; + } + var importClause = decl.importClause; + if (!importClause) { + return statements; + } + if (importClause.name) { + statements = appendExportsOfDeclaration(statements, importClause); + } + var namedBindings = importClause.namedBindings; + if (namedBindings) { + switch (namedBindings.kind) { + case 239 /* NamespaceImport */: + statements = appendExportsOfDeclaration(statements, namedBindings); + break; + case 240 /* NamedImports */: + for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { + var importBinding = _a[_i]; + statements = appendExportsOfDeclaration(statements, importBinding); + } + break; + } + } + return statements; + } + /** + * Appends the exports of an ImportEqualsDeclaration to a statement list, returning the + * statement list. + * + * @param statements A statement list to which the down-level export statements are to be + * appended. If `statements` is `undefined`, a new array is allocated if statements are + * appended. + * @param decl The declaration whose exports are to be recorded. + */ + function appendExportsOfImportEqualsDeclaration(statements, decl) { + if (currentModuleInfo.exportEquals) { + return statements; + } + return appendExportsOfDeclaration(statements, decl); + } + /** + * Appends the exports of a VariableStatement to a statement list, returning the statement + * list. + * + * @param statements A statement list to which the down-level export statements are to be + * appended. If `statements` is `undefined`, a new array is allocated if statements are + * appended. + * @param node The VariableStatement whose exports are to be recorded. + */ + function appendExportsOfVariableStatement(statements, node) { + if (currentModuleInfo.exportEquals) { + return statements; + } + for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + statements = appendExportsOfBindingElement(statements, decl); + } + return statements; + } + /** + * Appends the exports of a VariableDeclaration or BindingElement to a statement list, + * returning the statement list. + * + * @param statements A statement list to which the down-level export statements are to be + * appended. If `statements` is `undefined`, a new array is allocated if statements are + * appended. + * @param decl The declaration whose exports are to be recorded. + */ + function appendExportsOfBindingElement(statements, decl) { + if (currentModuleInfo.exportEquals) { + return statements; + } + if (ts.isBindingPattern(decl.name)) { + for (var _i = 0, _a = decl.name.elements; _i < _a.length; _i++) { + var element = _a[_i]; + if (!ts.isOmittedExpression(element)) { + statements = appendExportsOfBindingElement(statements, element); + } + } + } + else if (!ts.isGeneratedIdentifier(decl.name)) { + statements = appendExportsOfDeclaration(statements, decl); + } + return statements; + } + /** + * Appends the exports of a ClassDeclaration or FunctionDeclaration to a statement list, + * returning the statement list. + * + * @param statements A statement list to which the down-level export statements are to be + * appended. If `statements` is `undefined`, a new array is allocated if statements are + * appended. + * @param decl The declaration whose exports are to be recorded. + */ + function appendExportsOfHoistedDeclaration(statements, decl) { + if (currentModuleInfo.exportEquals) { + return statements; + } + if (ts.hasModifier(decl, 1 /* Export */)) { + var exportName = ts.hasModifier(decl, 512 /* Default */) ? ts.createIdentifier("default") : decl.name; + statements = appendExportStatement(statements, exportName, ts.getLocalName(decl), /*location*/ decl); + } + if (decl.name) { + statements = appendExportsOfDeclaration(statements, decl); + } + return statements; + } + /** + * Appends the exports of a declaration to a statement list, returning the statement list. + * + * @param statements A statement list to which the down-level export statements are to be + * appended. If `statements` is `undefined`, a new array is allocated if statements are + * appended. + * @param decl The declaration to export. + */ + function appendExportsOfDeclaration(statements, decl) { + var name = ts.getDeclarationName(decl); + var exportSpecifiers = currentModuleInfo.exportSpecifiers.get(name.text); + if (exportSpecifiers) { + for (var _i = 0, exportSpecifiers_1 = exportSpecifiers; _i < exportSpecifiers_1.length; _i++) { + var exportSpecifier = exportSpecifiers_1[_i]; + statements = appendExportStatement(statements, exportSpecifier.name, name, /*location*/ exportSpecifier.name); + } + } + return statements; + } + /** + * Appends the down-level representation of an export to a statement list, returning the + * statement list. + * + * @param statements A statement list to which the down-level export statements are to be + * appended. If `statements` is `undefined`, a new array is allocated if statements are + * appended. + * @param exportName The name of the export. + * @param expression The expression to export. + * @param location The location to use for source maps and comments for the export. + * @param allowComments Whether to allow comments on the export. + */ + function appendExportStatement(statements, exportName, expression, location, allowComments) { + statements = ts.append(statements, createExportStatement(exportName, expression, location, allowComments)); + return statements; + } + function createUnderscoreUnderscoreESModule() { + var statement; + if (languageVersion === 0 /* ES3 */) { + statement = ts.createStatement(createExportExpression(ts.createIdentifier("__esModule"), ts.createLiteral(/*value*/ true))); + } + else { + statement = ts.createStatement(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), + /*typeArguments*/ undefined, [ + ts.createIdentifier("exports"), + ts.createLiteral("__esModule"), + ts.createObjectLiteral([ + ts.createPropertyAssignment("value", ts.createLiteral(/*value*/ true)) + ]) + ])); + } + ts.setEmitFlags(statement, 524288 /* CustomPrologue */); + return statement; + } + /** + * Creates a call to the current file's export function to export a value. + * + * @param name The bound name of the export. + * @param value The exported value. + * @param location The location to use for source maps and comments for the export. + * @param allowComments An optional value indicating whether to emit comments for the statement. + */ + function createExportStatement(name, value, location, allowComments) { + var statement = ts.setTextRange(ts.createStatement(createExportExpression(name, value)), location); + ts.startOnNewLine(statement); + if (!allowComments) { + ts.setEmitFlags(statement, 1536 /* NoComments */); + } + return statement; + } + /** + * Creates a call to the current file's export function to export a value. + * + * @param name The bound name of the export. + * @param value The exported value. + * @param location The location to use for source maps and comments for the export. + */ + function createExportExpression(name, value, location) { + return ts.setTextRange(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(name)), value), location); + } + // + // Modifier Visitors + // + /** + * Visit nodes to elide module-specific modifiers. + * + * @param node The node to visit. + */ + function modifierVisitor(node) { + // Elide module-specific modifiers. + switch (node.kind) { + case 83 /* ExportKeyword */: + case 78 /* DefaultKeyword */: + return undefined; + } + return node; } // // Emit Notification // /** - * Hook for node emit. + * Hook for node emit notifications. * - * @param emitContext A context hint for the emitter. + * @param hint A hint as to the intended usage of the node. * @param node The node to emit. * @param emit A callback used to emit the node in the printer. */ - function onEmitNode(emitContext, node, emitCallback) { - if (ts.isSourceFile(node)) { + function onEmitNode(hint, node, emitCallback) { + if (node.kind === 264 /* SourceFile */) { currentSourceFile = node; - previousOnEmitNode(emitContext, node, emitCallback); + currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; + noSubstitution = []; + previousOnEmitNode(hint, node, emitCallback); currentSourceFile = undefined; + currentModuleInfo = undefined; + noSubstitution = undefined; } else { - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); } } // @@ -54342,30 +59434,192 @@ var ts; /** * Hooks node substitutions. * - * @param emitContext A context hint for the emitter. + * @param hint A hint as to the intended usage of the node. * @param node The node to substitute. */ - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (ts.isIdentifier(node) && emitContext === 1 /* Expression */) { - return substituteExpressionIdentifier(node); + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (node.id && noSubstitution[node.id]) { + return node; + } + if (hint === 1 /* Expression */) { + return substituteExpression(node); + } + else if (ts.isShorthandPropertyAssignment(node)) { + return substituteShorthandPropertyAssignment(node); } return node; } + /** + * Substitution for a ShorthandPropertyAssignment whose declaration name is an imported + * or exported symbol. + * + * @param node The node to substitute. + */ + function substituteShorthandPropertyAssignment(node) { + var name = node.name; + var exportedOrImportedName = substituteExpressionIdentifier(name); + if (exportedOrImportedName !== name) { + // A shorthand property with an assignment initializer is probably part of a + // destructuring assignment + if (node.objectAssignmentInitializer) { + var initializer = ts.createAssignment(exportedOrImportedName, node.objectAssignmentInitializer); + return ts.setTextRange(ts.createPropertyAssignment(name, initializer), node); + } + return ts.setTextRange(ts.createPropertyAssignment(name, exportedOrImportedName), node); + } + return node; + } + /** + * Substitution for an Expression that may contain an imported or exported symbol. + * + * @param node The node to substitute. + */ + function substituteExpression(node) { + switch (node.kind) { + case 70 /* Identifier */: + return substituteExpressionIdentifier(node); + case 193 /* BinaryExpression */: + return substituteBinaryExpression(node); + case 192 /* PostfixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: + return substituteUnaryExpression(node); + } + return node; + } + /** + * Substitution for an Identifier expression that may contain an imported or exported + * symbol. + * + * @param node The node to substitute. + */ function substituteExpressionIdentifier(node) { if (ts.getEmitFlags(node) & 4096 /* HelperName */) { var externalHelpersModuleName = ts.getExternalHelpersModuleName(currentSourceFile); if (externalHelpersModuleName) { return ts.createPropertyAccess(externalHelpersModuleName, node); } + return node; + } + if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { + var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); + if (exportContainer && exportContainer.kind === 264 /* SourceFile */) { + return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), + /*location*/ node); + } + var importDeclaration = resolver.getReferencedImportDeclaration(node); + if (importDeclaration) { + if (ts.isImportClause(importDeclaration)) { + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default")), + /*location*/ node); + } + else if (ts.isImportSpecifier(importDeclaration)) { + var name = importDeclaration.propertyName || importDeclaration.name; + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(name)), + /*location*/ node); + } + } } return node; } + /** + * Substitution for a BinaryExpression that may contain an imported or exported symbol. + * + * @param node The node to substitute. + */ + function substituteBinaryExpression(node) { + // When we see an assignment expression whose left-hand side is an exported symbol, + // we should ensure all exports of that symbol are updated with the correct value. + // + // - We do not substitute generated identifiers for any reason. + // - We do not substitute identifiers tagged with the LocalName flag. + // - We do not substitute identifiers that were originally the name of an enum or + // namespace due to how they are transformed in TypeScript. + // - We only substitute identifiers that are exported at the top level. + if (ts.isAssignmentOperator(node.operatorToken.kind) + && ts.isIdentifier(node.left) + && !ts.isGeneratedIdentifier(node.left) + && !ts.isLocalName(node.left) + && !ts.isDeclarationNameOfEnumOrNamespace(node.left)) { + var exportedNames = getExports(node.left); + if (exportedNames) { + // For each additional export of the declaration, apply an export assignment. + var expression = node; + for (var _i = 0, exportedNames_1 = exportedNames; _i < exportedNames_1.length; _i++) { + var exportName = exportedNames_1[_i]; + // Mark the node to prevent triggering this rule again. + noSubstitution[ts.getNodeId(expression)] = true; + expression = createExportExpression(exportName, expression, /*location*/ node); + } + return expression; + } + } + return node; + } + /** + * Substitution for a UnaryExpression that may contain an imported or exported symbol. + * + * @param node The node to substitute. + */ + function substituteUnaryExpression(node) { + // When we see a prefix or postfix increment expression whose operand is an exported + // symbol, we should ensure all exports of that symbol are updated with the correct + // value. + // + // - We do not substitute generated identifiers for any reason. + // - We do not substitute identifiers tagged with the LocalName flag. + // - We do not substitute identifiers that were originally the name of an enum or + // namespace due to how they are transformed in TypeScript. + // - We only substitute identifiers that are exported at the top level. + if ((node.operator === 42 /* PlusPlusToken */ || node.operator === 43 /* MinusMinusToken */) + && ts.isIdentifier(node.operand) + && !ts.isGeneratedIdentifier(node.operand) + && !ts.isLocalName(node.operand) + && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { + var exportedNames = getExports(node.operand); + if (exportedNames) { + var expression = node.kind === 192 /* PostfixUnaryExpression */ + ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 42 /* PlusPlusToken */ ? 58 /* PlusEqualsToken */ : 59 /* MinusEqualsToken */), ts.createLiteral(1)), + /*location*/ node) + : node; + for (var _i = 0, exportedNames_2 = exportedNames; _i < exportedNames_2.length; _i++) { + var exportName = exportedNames_2[_i]; + // Mark the node to prevent triggering this rule again. + noSubstitution[ts.getNodeId(expression)] = true; + expression = createExportExpression(exportName, expression); + } + return expression; + } + } + return node; + } + /** + * Gets the additional exports of a name. + * + * @param name The name. + */ + function getExports(name) { + if (!ts.isGeneratedIdentifier(name)) { + var valueDeclaration = resolver.getReferencedImportDeclaration(name) + || resolver.getReferencedValueDeclaration(name); + if (valueDeclaration) { + return currentModuleInfo + && currentModuleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]; + } + } + } } - ts.transformES2015Module = transformES2015Module; + ts.transformModule = transformModule; + // emit output for the __export helper function + var exportStarHelper = { + name: "typescript:export-star", + scoped: true, + text: "\n function __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n }" + }; })(ts || (ts = {})); /// /// +/// /*@internal*/ var ts; (function (ts) { @@ -54379,14 +59633,14 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(70 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(192 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(190 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(191 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableEmitNotification(261 /* SourceFile */); // Restore state when substituting nodes in a file. - var moduleInfoMap = ts.createMap(); // The ExternalModuleInfo for each file. - var deferredExports = ts.createMap(); // Exports to defer until an EndOfDeclarationMarker is found. - var exportFunctionsMap = ts.createMap(); // The export function associated with a source file. - var noSubstitutionMap = ts.createMap(); // Set of nodes for which substitution rules should be ignored for each file. + context.enableSubstitution(193 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(191 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(192 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableEmitNotification(264 /* SourceFile */); // Restore state when substituting nodes in a file. + var moduleInfoMap = []; // The ExternalModuleInfo for each file. + var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. + var exportFunctionsMap = []; // The export function associated with a source file. + var noSubstitutionMap = []; // Set of nodes for which substitution rules should be ignored for each file. var currentSourceFile; // The current file. var moduleInfo; // ExternalModuleInfo for the current file. var exportFunction; // The export function for the current file. @@ -54425,7 +59679,8 @@ var ts; moduleInfo = moduleInfoMap[id] = ts.collectExternalModuleInfo(node, resolver, compilerOptions); // Make sure that the name of the 'exports' function does not conflict with // existing identifiers. - exportFunction = exportFunctionsMap[id] = ts.createUniqueName("exports"); + exportFunction = ts.createUniqueName("exports"); + exportFunctionsMap[id] = exportFunction; contextObject = ts.createUniqueName("context"); // Add the body of the module. var dependencyGroups = collectDependencyGroups(moduleInfo.externalImports); @@ -54444,12 +59699,12 @@ var ts; // So the helper will be emit at the correct position instead of at the top of the source-file var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions); var dependencies = ts.createArrayLiteral(ts.map(dependencyGroups, function (dependencyGroup) { return dependencyGroup.name; })); - var updated = ts.updateSourceFileNode(node, ts.createNodeArray([ + var updated = ts.setEmitFlags(ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ ts.createStatement(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("System"), "register"), /*typeArguments*/ undefined, moduleName ? [moduleName, dependencies, moduleBodyFunction] : [dependencies, moduleBodyFunction])) - ], node.statements)); + ]), node.statements)), 1024 /* NoTrailingComments */); if (!(compilerOptions.outFile || compilerOptions.out)) { ts.moveEmitHelpers(updated, moduleBodyBlock, function (helper) { return !helper.scoped; }); } @@ -54476,18 +59731,20 @@ var ts; for (var i = 0; i < externalImports.length; i++) { var externalImport = externalImports[i]; var externalModuleName = ts.getExternalModuleNameLiteral(externalImport, currentSourceFile, host, resolver, compilerOptions); - var text = externalModuleName.text; - if (ts.hasProperty(groupIndices, text)) { - // deduplicate/group entries in dependency list by the dependency name - var groupIndex = groupIndices[text]; - dependencyGroups[groupIndex].externalImports.push(externalImport); - } - else { - groupIndices[text] = dependencyGroups.length; - dependencyGroups.push({ - name: externalModuleName, - externalImports: [externalImport] - }); + if (externalModuleName) { + var text = externalModuleName.text; + var groupIndex = groupIndices.get(text); + if (groupIndex !== undefined) { + // deduplicate/group entries in dependency list by the dependency name + dependencyGroups[groupIndex].externalImports.push(externalImport); + } + else { + groupIndices.set(text, dependencyGroups.length); + dependencyGroups.push({ + name: externalModuleName, + externalImports: [externalImport] + }); + } } } return dependencyGroups; @@ -54545,7 +59802,8 @@ var ts; // only in the outer module body and not in the inner one. startLexicalEnvironment(); // Add any prologue directives. - var statementOffset = ts.addPrologueDirectives(statements, node.statements, /*ensureUseStrict*/ !compilerOptions.noImplicitUseStrict, sourceElementVisitor); + var ensureUseStrict = compilerOptions.alwaysStrict || (!compilerOptions.noImplicitUseStrict && ts.isExternalModule(currentSourceFile)); + var statementOffset = ts.addPrologue(statements, node.statements, ensureUseStrict, sourceElementVisitor); // var __moduleName = context_1 && context_1.id; statements.push(ts.createVariableStatement( /*modifiers*/ undefined, ts.createVariableDeclarationList([ @@ -54553,7 +59811,7 @@ var ts; /*type*/ undefined, ts.createLogicalAnd(contextObject, ts.createPropertyAccess(contextObject, "id"))) ]))); // Visit the synthetic external helpers import declaration if present - ts.visitNode(moduleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement, /*optional*/ true); + ts.visitNode(moduleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement); // Visit the statements of the source file, emitting any transformations into // the `executeStatements` array. We do this *before* we fill the `setters` array // as we both emit transformations as well as aggregate some data used when creating @@ -54567,7 +59825,7 @@ var ts; // - Temporary variables will appear at the top rather than at the bottom of the file ts.addRange(statements, endLexicalEnvironment()); var exportStarFunction = addExportStarIfNeeded(statements); - statements.push(ts.createReturn(ts.setMultiLine(ts.createObjectLiteral([ + var moduleObject = ts.createObjectLiteral([ ts.createPropertyAssignment("setters", createSettersArray(exportStarFunction, dependencyGroups)), ts.createPropertyAssignment("execute", ts.createFunctionExpression( /*modifiers*/ undefined, @@ -54575,12 +59833,11 @@ var ts; /*name*/ undefined, /*typeParameters*/ undefined, /*parameters*/ [], - /*type*/ undefined, ts.createBlock(executeStatements, - /*location*/ undefined, - /*multiLine*/ true))) - ]), - /*multiLine*/ true))); - return ts.createBlock(statements, /*location*/ undefined, /*multiLine*/ true); + /*type*/ undefined, ts.createBlock(executeStatements, /*multiLine*/ true))) + ]); + moduleObject.multiLine = true; + statements.push(ts.createReturn(moduleObject)); + return ts.createBlock(statements, /*multiLine*/ true); } /** * Adds an exportStar function to a statement list if it is needed for the file. @@ -54596,13 +59853,13 @@ var ts; // to support this we store names of local/indirect exported entries in a set. // this set is used to filter names brought by star expors. // local names set should only be added if we have anything exported - if (!moduleInfo.exportedNames && ts.isEmpty(moduleInfo.exportSpecifiers)) { + if (!moduleInfo.exportedNames && moduleInfo.exportSpecifiers.size === 0) { // no exported declarations (export var ...) or export specifiers (export {x}) // check if we have any non star export declarations. var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 241 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 243 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -54622,12 +59879,12 @@ var ts; continue; } // write name of exported declaration, i.e 'export var x...' - exportedNames.push(ts.createPropertyAssignment(ts.createLiteral(exportedLocalName), ts.createLiteral(true))); + exportedNames.push(ts.createPropertyAssignment(ts.createLiteral(exportedLocalName), ts.createTrue())); } } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 241 /* ExportDeclaration */) { + if (externalImport.kind !== 243 /* ExportDeclaration */) { continue; } var exportDecl = externalImport; @@ -54638,14 +59895,14 @@ var ts; for (var _f = 0, _g = exportDecl.exportClause.elements; _f < _g.length; _f++) { var element = _g[_f]; // write name of indirectly exported entry, i.e. 'export {x} from ...' - exportedNames.push(ts.createPropertyAssignment(ts.createLiteral((element.name || element.propertyName).text), ts.createLiteral(true))); + exportedNames.push(ts.createPropertyAssignment(ts.createLiteral((element.name || element.propertyName).text), ts.createTrue())); } } var exportedNamesStorageRef = ts.createUniqueName("exportedNames"); statements.push(ts.createVariableStatement( /*modifiers*/ undefined, ts.createVariableDeclarationList([ ts.createVariableDeclaration(exportedNamesStorageRef, - /*type*/ undefined, ts.createObjectLiteral(exportedNames, /*location*/ undefined, /*multiline*/ true)) + /*type*/ undefined, ts.createObjectLiteral(exportedNames, /*multiline*/ true)) ]))); var exportStarFunction = createExportStarFunction(exportedNamesStorageRef); statements.push(exportStarFunction); @@ -54686,9 +59943,7 @@ var ts; ])), ts.createStatement(ts.createCall(exportFunction, /*typeArguments*/ undefined, [exports])) - ], - /*location*/ undefined, - /*multiline*/ true)); + ], /*multiline*/ true)); } /** * Creates an array setter callbacks for each dependency group. @@ -54708,19 +59963,19 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); switch (entry.kind) { - case 235 /* ImportDeclaration */: + case 237 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } - // fall-through - case 234 /* ImportEqualsDeclaration */: + // falls through + case 236 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(ts.createStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { // export {a, b as c} from 'foo' @@ -54737,7 +59992,7 @@ var ts; properties.push(ts.createPropertyAssignment(ts.createLiteral(e.name.text), ts.createElementAccess(parameterName, ts.createLiteral((e.propertyName || e.name).text)))); } statements.push(ts.createStatement(ts.createCall(exportFunction, - /*typeArguments*/ undefined, [ts.createObjectLiteral(properties, /*location*/ undefined, /*multiline*/ true)]))); + /*typeArguments*/ undefined, [ts.createObjectLiteral(properties, /*multiline*/ true)]))); } else { // export * from 'foo' @@ -54756,9 +60011,9 @@ var ts; /*asteriskToken*/ undefined, /*name*/ undefined, /*typeParameters*/ undefined, [ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, parameterName)], - /*type*/ undefined, ts.createBlock(statements, /*location*/ undefined, /*multiLine*/ true))); + /*type*/ undefined, ts.createBlock(statements, /*multiLine*/ true))); } - return ts.createArrayLiteral(setters, /*location*/ undefined, /*multiLine*/ true); + return ts.createArrayLiteral(setters, /*multiLine*/ true); } // // Top-level Source Element Visitors @@ -54770,15 +60025,15 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 235 /* ImportDeclaration */: + case 237 /* ImportDeclaration */: return visitImportDeclaration(node); - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: // ExportDeclarations are elided as they are handled via // `appendExportsOfDeclaration`. return undefined; - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -54851,7 +60106,7 @@ var ts; */ function visitFunctionDeclaration(node) { if (ts.hasModifier(node, 1 /* Export */)) { - hoistedStatements = ts.append(hoistedStatements, ts.updateFunctionDeclaration(node, node.decorators, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), + hoistedStatements = ts.append(hoistedStatements, ts.updateFunctionDeclaration(node, node.decorators, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, ts.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), /*typeParameters*/ undefined, ts.visitNodes(node.parameters, destructuringVisitor, ts.isParameterDeclaration), /*type*/ undefined, ts.visitNode(node.body, destructuringVisitor, ts.isBlock))); } @@ -54879,11 +60134,9 @@ var ts; var name = ts.getLocalName(node); hoistVariableDeclaration(name); // Rewrite the class declaration into an assignment of a class expression. - statements = ts.append(statements, ts.createStatement(ts.createAssignment(name, ts.createClassExpression( + statements = ts.append(statements, ts.setTextRange(ts.createStatement(ts.createAssignment(name, ts.setTextRange(ts.createClassExpression( /*modifiers*/ undefined, node.name, - /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, destructuringVisitor, ts.isHeritageClause), ts.visitNodes(node.members, destructuringVisitor, ts.isClassElement), - /*location*/ node)), - /*location*/ node)); + /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, destructuringVisitor, ts.isHeritageClause), ts.visitNodes(node.members, destructuringVisitor, ts.isClassElement)), node))), node)); if (hasAssociatedEndOfDeclarationMarker(node)) { // Defer exports until we encounter an EndOfDeclarationMarker node var id = ts.getOriginalNodeId(node); @@ -54918,7 +60171,7 @@ var ts; } var statements; if (expressions) { - statements = ts.append(statements, ts.createStatement(ts.inlineExpressions(expressions), /*location*/ node)); + statements = ts.append(statements, ts.setTextRange(ts.createStatement(ts.inlineExpressions(expressions)), node)); } if (isMarkedDeclaration) { // Defer exports until we encounter an EndOfDeclarationMarker node @@ -54956,7 +60209,7 @@ var ts; function shouldHoistVariableDeclarationList(node) { // hoist only non-block scoped declarations or block scoped declarations parented by source file return (ts.getEmitFlags(node) & 1048576 /* NoHoisting */) === 0 - && (enclosingBlockScopedContainer.kind === 261 /* SourceFile */ + && (enclosingBlockScopedContainer.kind === 264 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -55003,8 +60256,8 @@ var ts; function createVariableAssignment(name, value, location, isExportedDeclaration) { hoistVariableDeclaration(ts.getSynthesizedClone(name)); return isExportedDeclaration - ? createExportExpression(name, preventSubstitution(ts.createAssignment(name, value, location))) - : preventSubstitution(ts.createAssignment(name, value, location)); + ? createExportExpression(name, preventSubstitution(ts.setTextRange(ts.createAssignment(name, value), location))) + : preventSubstitution(ts.setTextRange(ts.createAssignment(name, value), location)); } /** * Visits a MergeDeclarationMarker used as a placeholder for the beginning of a merged @@ -55020,7 +60273,7 @@ var ts; // // To balance the declaration, we defer the exports of the elided variable // statement until we visit this declaration's `EndOfDeclarationMarker`. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 205 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 207 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -55076,10 +60329,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 237 /* NamespaceImport */: + case 239 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 238 /* NamedImports */: + case 240 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -55197,10 +60450,10 @@ var ts; return statements; } var name = ts.getDeclarationName(decl); - var exportSpecifiers = moduleInfo.exportSpecifiers[name.text]; + var exportSpecifiers = moduleInfo.exportSpecifiers.get(name.text); if (exportSpecifiers) { - for (var _i = 0, exportSpecifiers_1 = exportSpecifiers; _i < exportSpecifiers_1.length; _i++) { - var exportSpecifier = exportSpecifiers_1[_i]; + for (var _i = 0, exportSpecifiers_2 = exportSpecifiers; _i < exportSpecifiers_2.length; _i++) { + var exportSpecifier = exportSpecifiers_2[_i]; if (exportSpecifier.name.text !== excludeName) { statements = appendExportStatement(statements, exportSpecifier.name, name); } @@ -55258,43 +60511,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: return visitVariableStatement(node); - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: return visitClassDeclaration(node); - case 211 /* ForStatement */: + case 213 /* ForStatement */: return visitForStatement(node); - case 212 /* ForInStatement */: + case 214 /* ForInStatement */: return visitForInStatement(node); - case 213 /* ForOfStatement */: + case 215 /* ForOfStatement */: return visitForOfStatement(node); - case 209 /* DoStatement */: + case 211 /* DoStatement */: return visitDoStatement(node); - case 210 /* WhileStatement */: + case 212 /* WhileStatement */: return visitWhileStatement(node); - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: return visitLabeledStatement(node); - case 217 /* WithStatement */: + case 219 /* WithStatement */: return visitWithStatement(node); - case 218 /* SwitchStatement */: + case 220 /* SwitchStatement */: return visitSwitchStatement(node); - case 232 /* CaseBlock */: + case 234 /* CaseBlock */: return visitCaseBlock(node); - case 253 /* CaseClause */: + case 256 /* CaseClause */: return visitCaseClause(node); - case 254 /* DefaultClause */: + case 257 /* DefaultClause */: return visitDefaultClause(node); - case 221 /* TryStatement */: + case 223 /* TryStatement */: return visitTryStatement(node); - case 256 /* CatchClause */: + case 259 /* CatchClause */: return visitCatchClause(node); - case 204 /* Block */: + case 206 /* Block */: return visitBlock(node); - case 295 /* MergeDeclarationMarker */: + case 296 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 296 /* EndOfDeclarationMarker */: + case 297 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringVisitor(node); @@ -55308,7 +60561,7 @@ var ts; function visitForStatement(node) { var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; enclosingBlockScopedContainer = node; - node = ts.updateFor(node, visitForInitializer(node.initializer), ts.visitNode(node.condition, destructuringVisitor, ts.isExpression, /*optional*/ true), ts.visitNode(node.incrementor, destructuringVisitor, ts.isExpression, /*optional*/ true), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement)); + node = ts.updateFor(node, visitForInitializer(node.initializer), ts.visitNode(node.condition, destructuringVisitor, ts.isExpression), ts.visitNode(node.incrementor, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement)); enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; return node; } @@ -55320,7 +60573,7 @@ var ts; function visitForInStatement(node) { var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; enclosingBlockScopedContainer = node; - node = ts.updateForIn(node, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, /*optional*/ false, ts.liftToBlock)); + node = ts.updateForIn(node, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; return node; } @@ -55332,7 +60585,7 @@ var ts; function visitForOfStatement(node) { var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; enclosingBlockScopedContainer = node; - node = ts.updateForOf(node, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, /*optional*/ false, ts.liftToBlock)); + node = ts.updateForOf(node, node.awaitModifier, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; return node; } @@ -55352,6 +60605,9 @@ var ts; * @param node The node to visit. */ function visitForInitializer(node) { + if (!node) { + return node; + } if (shouldHoistForInitializer(node)) { var expressions = void 0; for (var _i = 0, _a = node.declarations; _i < _a.length; _i++) { @@ -55370,7 +60626,7 @@ var ts; * @param node The node to visit. */ function visitDoStatement(node) { - return ts.updateDo(node, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, /*optional*/ false, ts.liftToBlock), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression)); + return ts.updateDo(node, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression)); } /** * Visits the body of a WhileStatement to hoist declarations. @@ -55378,7 +60634,7 @@ var ts; * @param node The node to visit. */ function visitWhileStatement(node) { - return ts.updateWhile(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, /*optional*/ false, ts.liftToBlock)); + return ts.updateWhile(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); } /** * Visits the body of a LabeledStatement to hoist declarations. @@ -55386,7 +60642,7 @@ var ts; * @param node The node to visit. */ function visitLabeledStatement(node) { - return ts.updateLabel(node, node.label, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, /*optional*/ false, ts.liftToBlock)); + return ts.updateLabel(node, node.label, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); } /** * Visits the body of a WithStatement to hoist declarations. @@ -55394,7 +60650,7 @@ var ts; * @param node The node to visit. */ function visitWithStatement(node) { - return ts.updateWith(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, /*optional*/ false, ts.liftToBlock)); + return ts.updateWith(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); } /** * Visits the body of a SwitchStatement to hoist declarations. @@ -55474,7 +60730,7 @@ var ts; */ function destructuringVisitor(node) { if (node.transformFlags & 1024 /* DestructuringAssignment */ - && node.kind === 192 /* BinaryExpression */) { + && node.kind === 193 /* BinaryExpression */) { return visitDestructuringAssignment(node); } else if (node.transformFlags & 2048 /* ContainsDestructuringAssignment */) { @@ -55502,7 +60758,7 @@ var ts; * @param node The destructuring target. */ function hasExportedReferenceInDestructuringTarget(node) { - if (ts.isAssignmentExpression(node)) { + if (ts.isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { return hasExportedReferenceInDestructuringTarget(node.left); } else if (ts.isSpreadExpression(node)) { @@ -55522,7 +60778,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 261 /* SourceFile */; + return container !== undefined && container.kind === 264 /* SourceFile */; } else { return false; @@ -55550,12 +60806,12 @@ var ts; /** * Hook for node emit notifications. * - * @param emitContext A context hint for the emitter. + * @param hint A hint as to the intended usage of the node. * @param node The node to emit. - * @param emit A callback used to emit the node in the printer. + * @param emitCallback A callback used to emit the node in the printer. */ - function onEmitNode(emitContext, node, emitCallback) { - if (node.kind === 261 /* SourceFile */) { + function onEmitNode(hint, node, emitCallback) { + if (node.kind === 264 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -55564,14 +60820,14 @@ var ts; if (noSubstitution) { delete noSubstitutionMap[id]; } - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); currentSourceFile = undefined; moduleInfo = undefined; exportFunction = undefined; noSubstitution = undefined; } else { - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); } } // @@ -55580,15 +60836,15 @@ var ts; /** * Hooks node substitutions. * - * @param emitContext A context hint for the emitter. + * @param hint A hint as to the intended usage of the node. * @param node The node to substitute. */ - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); if (isSubstitutionPrevented(node)) { return node; } - if (emitContext === 1 /* Expression */) { + if (hint === 1 /* Expression */) { return substituteExpression(node); } return node; @@ -55602,10 +60858,10 @@ var ts; switch (node.kind) { case 70 /* Identifier */: return substituteExpressionIdentifier(node); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return substituteBinaryExpression(node); - case 190 /* PrefixUnaryExpression */: - case 191 /* PostfixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -55633,1072 +60889,11 @@ var ts; var importDeclaration = resolver.getReferencedImportDeclaration(node); if (importDeclaration) { if (ts.isImportClause(importDeclaration)) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default"), + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default")), /*location*/ node); } else if (ts.isImportSpecifier(importDeclaration)) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(importDeclaration.propertyName || importDeclaration.name), - /*location*/ node); - } - } - } - return node; - } - /** - * Substitution for a BinaryExpression that may contain an imported or exported symbol. - * - * @param node The node to substitute. - */ - function substituteBinaryExpression(node) { - // When we see an assignment expression whose left-hand side is an exported symbol, - // we should ensure all exports of that symbol are updated with the correct value. - // - // - We do not substitute generated identifiers for any reason. - // - We do not substitute identifiers tagged with the LocalName flag. - // - We do not substitute identifiers that were originally the name of an enum or - // namespace due to how they are transformed in TypeScript. - // - We only substitute identifiers that are exported at the top level. - if (ts.isAssignmentOperator(node.operatorToken.kind) - && ts.isIdentifier(node.left) - && !ts.isGeneratedIdentifier(node.left) - && !ts.isLocalName(node.left) - && !ts.isDeclarationNameOfEnumOrNamespace(node.left)) { - var exportedNames = getExports(node.left); - if (exportedNames) { - // For each additional export of the declaration, apply an export assignment. - var expression = node; - for (var _i = 0, exportedNames_1 = exportedNames; _i < exportedNames_1.length; _i++) { - var exportName = exportedNames_1[_i]; - expression = createExportExpression(exportName, preventSubstitution(expression)); - } - return expression; - } - } - return node; - } - /** - * Substitution for a UnaryExpression that may contain an imported or exported symbol. - * - * @param node The node to substitute. - */ - function substituteUnaryExpression(node) { - // When we see a prefix or postfix increment expression whose operand is an exported - // symbol, we should ensure all exports of that symbol are updated with the correct - // value. - // - // - We do not substitute generated identifiers for any reason. - // - We do not substitute identifiers tagged with the LocalName flag. - // - We do not substitute identifiers that were originally the name of an enum or - // namespace due to how they are transformed in TypeScript. - // - We only substitute identifiers that are exported at the top level. - if ((node.operator === 42 /* PlusPlusToken */ || node.operator === 43 /* MinusMinusToken */) - && ts.isIdentifier(node.operand) - && !ts.isGeneratedIdentifier(node.operand) - && !ts.isLocalName(node.operand) - && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { - var exportedNames = getExports(node.operand); - if (exportedNames) { - var expression = node.kind === 191 /* PostfixUnaryExpression */ - ? ts.createPrefix(node.operator, node.operand, - /*location*/ node) - : node; - for (var _i = 0, exportedNames_2 = exportedNames; _i < exportedNames_2.length; _i++) { - var exportName = exportedNames_2[_i]; - expression = createExportExpression(exportName, preventSubstitution(expression)); - } - if (node.kind === 191 /* PostfixUnaryExpression */) { - expression = node.operator === 42 /* PlusPlusToken */ - ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) - : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); - } - return expression; - } - } - return node; - } - /** - * Gets the exports of a name. - * - * @param name The name. - */ - function getExports(name) { - var exportedNames; - if (!ts.isGeneratedIdentifier(name)) { - var valueDeclaration = resolver.getReferencedImportDeclaration(name) - || resolver.getReferencedValueDeclaration(name); - if (valueDeclaration) { - var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 261 /* SourceFile */) { - exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); - } - exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); - } - } - return exportedNames; - } - /** - * Prevent substitution of a node for this transformer. - * - * @param node The node which should not be substituted. - */ - function preventSubstitution(node) { - if (noSubstitution === undefined) - noSubstitution = ts.createMap(); - noSubstitution[ts.getNodeId(node)] = true; - return node; - } - /** - * Determines whether a node should not be substituted. - * - * @param node The node to test. - */ - function isSubstitutionPrevented(node) { - return noSubstitution && node.id && noSubstitution[node.id]; - } - } - ts.transformSystemModule = transformSystemModule; -})(ts || (ts = {})); -/// -/// -/*@internal*/ -var ts; -(function (ts) { - function transformModule(context) { - var transformModuleDelegates = ts.createMap((_a = {}, - _a[ts.ModuleKind.None] = transformCommonJSModule, - _a[ts.ModuleKind.CommonJS] = transformCommonJSModule, - _a[ts.ModuleKind.AMD] = transformAMDModule, - _a[ts.ModuleKind.UMD] = transformUMDModule, - _a)); - var startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; - var compilerOptions = context.getCompilerOptions(); - var resolver = context.getEmitResolver(); - var host = context.getEmitHost(); - var languageVersion = ts.getEmitScriptTarget(compilerOptions); - var moduleKind = ts.getEmitModuleKind(compilerOptions); - var previousOnSubstituteNode = context.onSubstituteNode; - var previousOnEmitNode = context.onEmitNode; - context.onSubstituteNode = onSubstituteNode; - context.onEmitNode = onEmitNode; - context.enableSubstitution(70 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(192 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(190 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(191 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(258 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(261 /* SourceFile */); // Restore state when substituting nodes in a file. - var moduleInfoMap = ts.createMap(); // The ExternalModuleInfo for each file. - var deferredExports = ts.createMap(); // Exports to defer until an EndOfDeclarationMarker is found. - var currentSourceFile; // The current file. - var currentModuleInfo; // The ExternalModuleInfo for the current file. - var noSubstitution; // Set of nodes for which substitution rules should be ignored. - return transformSourceFile; - /** - * Transforms the module aspects of a SourceFile. - * - * @param node The SourceFile node. - */ - function transformSourceFile(node) { - if (ts.isDeclarationFile(node) - || !(ts.isExternalModule(node) - || compilerOptions.isolatedModules)) { - return node; - } - currentSourceFile = node; - currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(node)] = ts.collectExternalModuleInfo(node, resolver, compilerOptions); - // Perform the transformation. - var transformModule = transformModuleDelegates[moduleKind] || transformModuleDelegates[ts.ModuleKind.None]; - var updated = transformModule(node); - currentSourceFile = undefined; - currentModuleInfo = undefined; - return ts.aggregateTransformFlags(updated); - } - /** - * Transforms a SourceFile into a CommonJS module. - * - * @param node The SourceFile node. - */ - function transformCommonJSModule(node) { - startLexicalEnvironment(); - var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.statements, /*ensureUseStrict*/ !compilerOptions.noImplicitUseStrict, sourceElementVisitor); - ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement, /*optional*/ true)); - ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); - ts.addRange(statements, endLexicalEnvironment()); - addExportEqualsIfNeeded(statements, /*emitAsReturn*/ false); - var updated = ts.updateSourceFileNode(node, ts.createNodeArray(statements, node.statements)); - if (currentModuleInfo.hasExportStarsToExportValues) { - ts.addEmitHelper(updated, exportStarHelper); - } - return updated; - } - /** - * Transforms a SourceFile into an AMD module. - * - * @param node The SourceFile node. - */ - function transformAMDModule(node) { - var define = ts.createIdentifier("define"); - var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions); - return transformAsynchronousModule(node, define, moduleName, /*includeNonAmdDependencies*/ true); - } - /** - * Transforms a SourceFile into a UMD module. - * - * @param node The SourceFile node. - */ - function transformUMDModule(node) { - var define = ts.createRawExpression(umdHelper); - return transformAsynchronousModule(node, define, /*moduleName*/ undefined, /*includeNonAmdDependencies*/ false); - } - /** - * Transforms a SourceFile into an AMD or UMD module. - * - * @param node The SourceFile node. - * @param define The expression used to define the module. - * @param moduleName An expression for the module name, if available. - * @param includeNonAmdDependencies A value indicating whether to incldue any non-AMD dependencies. - */ - function transformAsynchronousModule(node, define, moduleName, includeNonAmdDependencies) { - // An AMD define function has the following shape: - // - // define(id?, dependencies?, factory); - // - // This has the shape of the following: - // - // define(name, ["module1", "module2"], function (module1Alias) { ... } - // - // The location of the alias in the parameter list in the factory function needs to - // match the position of the module name in the dependency list. - // - // To ensure this is true in cases of modules with no aliases, e.g.: - // - // import "module" - // - // or - // - // /// - // - // we need to add modules without alias names to the end of the dependencies list - var _a = collectAsynchronousDependencies(node, includeNonAmdDependencies), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames; - // Create an updated SourceFile: - // - // define(moduleName?, ["module1", "module2"], function ... - return ts.updateSourceFileNode(node, ts.createNodeArray([ - ts.createStatement(ts.createCall(define, - /*typeArguments*/ undefined, (moduleName ? [moduleName] : []).concat([ - // Add the dependency array argument: - // - // ["require", "exports", module1", "module2", ...] - ts.createArrayLiteral([ - ts.createLiteral("require"), - ts.createLiteral("exports") - ].concat(aliasedModuleNames, unaliasedModuleNames)), - // Add the module body function argument: - // - // function (require, exports, module1, module2) ... - ts.createFunctionExpression( - /*modifiers*/ undefined, - /*asteriskToken*/ undefined, - /*name*/ undefined, - /*typeParameters*/ undefined, [ - ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "require"), - ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "exports") - ].concat(importAliasNames), - /*type*/ undefined, transformAsynchronousModuleBody(node)) - ]))) - ], - /*location*/ node.statements)); - } - /** - * Collect the additional asynchronous dependencies for the module. - * - * @param node The source file. - * @param includeNonAmdDependencies A value indicating whether to include non-AMD dependencies. - */ - function collectAsynchronousDependencies(node, includeNonAmdDependencies) { - // names of modules with corresponding parameter in the factory function - var aliasedModuleNames = []; - // names of modules with no corresponding parameters in factory function - var unaliasedModuleNames = []; - // names of the parameters in the factory function; these - // parameters need to match the indexes of the corresponding - // module names in aliasedModuleNames. - var importAliasNames = []; - // Fill in amd-dependency tags - for (var _i = 0, _a = node.amdDependencies; _i < _a.length; _i++) { - var amdDependency = _a[_i]; - if (amdDependency.name) { - aliasedModuleNames.push(ts.createLiteral(amdDependency.path)); - importAliasNames.push(ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, amdDependency.name)); - } - else { - unaliasedModuleNames.push(ts.createLiteral(amdDependency.path)); - } - } - for (var _b = 0, _c = currentModuleInfo.externalImports; _b < _c.length; _b++) { - var importNode = _c[_b]; - // Find the name of the external module - var externalModuleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions); - // Find the name of the module alias, if there is one - var importAliasName = ts.getLocalNameForExternalImport(importNode, currentSourceFile); - if (includeNonAmdDependencies && importAliasName) { - // Set emitFlags on the name of the classDeclaration - // This is so that when printer will not substitute the identifier - ts.setEmitFlags(importAliasName, 4 /* NoSubstitution */); - aliasedModuleNames.push(externalModuleName); - importAliasNames.push(ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, importAliasName)); - } - else { - unaliasedModuleNames.push(externalModuleName); - } - } - return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames }; - } - /** - * Transforms a SourceFile into an AMD or UMD module body. - * - * @param node The SourceFile node. - */ - function transformAsynchronousModuleBody(node) { - startLexicalEnvironment(); - var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.statements, /*ensureUseStrict*/ !compilerOptions.noImplicitUseStrict, sourceElementVisitor); - // Visit each statement of the module body. - ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement, /*optional*/ true)); - ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); - // End the lexical environment for the module body - // and merge any new lexical declarations. - ts.addRange(statements, endLexicalEnvironment()); - // Append the 'export =' statement if provided. - addExportEqualsIfNeeded(statements, /*emitAsReturn*/ true); - var body = ts.createBlock(statements, /*location*/ undefined, /*multiLine*/ true); - if (currentModuleInfo.hasExportStarsToExportValues) { - // If we have any `export * from ...` declarations - // we need to inform the emitter to add the __export helper. - ts.addEmitHelper(body, exportStarHelper); - } - return body; - } - /** - * Adds the down-level representation of `export=` to the statement list if one exists - * in the source file. - * - * @param statements The Statement list to modify. - * @param emitAsReturn A value indicating whether to emit the `export=` statement as a - * return statement. - */ - function addExportEqualsIfNeeded(statements, emitAsReturn) { - if (currentModuleInfo.exportEquals) { - if (emitAsReturn) { - var statement = ts.createReturn(currentModuleInfo.exportEquals.expression, - /*location*/ currentModuleInfo.exportEquals); - ts.setEmitFlags(statement, 384 /* NoTokenSourceMaps */ | 1536 /* NoComments */); - statements.push(statement); - } - else { - var statement = ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), currentModuleInfo.exportEquals.expression), - /*location*/ currentModuleInfo.exportEquals); - ts.setEmitFlags(statement, 1536 /* NoComments */); - statements.push(statement); - } - } - } - // - // Top-Level Source Element Visitors - // - /** - * Visits a node at the top level of the source file. - * - * @param node The node to visit. - */ - function sourceElementVisitor(node) { - switch (node.kind) { - case 235 /* ImportDeclaration */: - return visitImportDeclaration(node); - case 234 /* ImportEqualsDeclaration */: - return visitImportEqualsDeclaration(node); - case 241 /* ExportDeclaration */: - return visitExportDeclaration(node); - case 240 /* ExportAssignment */: - return visitExportAssignment(node); - case 205 /* VariableStatement */: - return visitVariableStatement(node); - case 225 /* FunctionDeclaration */: - return visitFunctionDeclaration(node); - case 226 /* ClassDeclaration */: - return visitClassDeclaration(node); - case 295 /* MergeDeclarationMarker */: - return visitMergeDeclarationMarker(node); - case 296 /* EndOfDeclarationMarker */: - return visitEndOfDeclarationMarker(node); - default: - // This visitor does not descend into the tree, as export/import statements - // are only transformed at the top level of a file. - return node; - } - } - /** - * Visits an ImportDeclaration node. - * - * @param node The node to visit. - */ - function visitImportDeclaration(node) { - var statements; - var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); - if (moduleKind !== ts.ModuleKind.AMD) { - if (!node.importClause) { - // import "mod"; - return ts.createStatement(createRequireCall(node), /*location*/ node); - } - else { - var variables = []; - if (namespaceDeclaration && !ts.isDefaultImport(node)) { - // import * as n from "mod"; - variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), - /*type*/ undefined, createRequireCall(node))); - } - else { - // import d from "mod"; - // import { x, y } from "mod"; - // import d, { x, y } from "mod"; - // import d, * as n from "mod"; - variables.push(ts.createVariableDeclaration(ts.getGeneratedNameForNode(node), - /*type*/ undefined, createRequireCall(node))); - if (namespaceDeclaration && ts.isDefaultImport(node)) { - variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), - /*type*/ undefined, ts.getGeneratedNameForNode(node))); - } - } - statements = ts.append(statements, ts.createVariableStatement( - /*modifiers*/ undefined, ts.createVariableDeclarationList(variables, - /*location*/ undefined, languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */), - /*location*/ node)); - } - } - else if (namespaceDeclaration && ts.isDefaultImport(node)) { - // import d, * as n from "mod"; - statements = ts.append(statements, ts.createVariableStatement( - /*modifiers*/ undefined, ts.createVariableDeclarationList([ - ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), - /*type*/ undefined, ts.getGeneratedNameForNode(node), - /*location*/ node) - ], - /*location*/ undefined, languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */))); - } - if (hasAssociatedEndOfDeclarationMarker(node)) { - // Defer exports until we encounter an EndOfDeclarationMarker node - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfImportDeclaration(deferredExports[id], node); - } - else { - statements = appendExportsOfImportDeclaration(statements, node); - } - return ts.singleOrMany(statements); - } - /** - * Creates a `require()` call to import an external module. - * - * @param importNode The declararation to import. - */ - function createRequireCall(importNode) { - var moduleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions); - var args = []; - if (moduleName) { - args.push(moduleName); - } - return ts.createCall(ts.createIdentifier("require"), /*typeArguments*/ undefined, args); - } - /** - * Visits an ImportEqualsDeclaration node. - * - * @param node The node to visit. - */ - function visitImportEqualsDeclaration(node) { - ts.Debug.assert(ts.isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer."); - var statements; - if (moduleKind !== ts.ModuleKind.AMD) { - if (ts.hasModifier(node, 1 /* Export */)) { - statements = ts.append(statements, ts.createStatement(createExportExpression(node.name, createRequireCall(node)), - /*location*/ node)); - } - else { - statements = ts.append(statements, ts.createVariableStatement( - /*modifiers*/ undefined, ts.createVariableDeclarationList([ - ts.createVariableDeclaration(ts.getSynthesizedClone(node.name), - /*type*/ undefined, createRequireCall(node)) - ], - /*location*/ undefined, - /*flags*/ languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */), - /*location*/ node)); - } - } - else { - if (ts.hasModifier(node, 1 /* Export */)) { - statements = ts.append(statements, ts.createStatement(createExportExpression(ts.getExportName(node), ts.getLocalName(node)), - /*location*/ node)); - } - } - if (hasAssociatedEndOfDeclarationMarker(node)) { - // Defer exports until we encounter an EndOfDeclarationMarker node - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfImportEqualsDeclaration(deferredExports[id], node); - } - else { - statements = appendExportsOfImportEqualsDeclaration(statements, node); - } - return ts.singleOrMany(statements); - } - /** - * Visits an ExportDeclaration node. - * - * @param The node to visit. - */ - function visitExportDeclaration(node) { - if (!node.moduleSpecifier) { - // Elide export declarations with no module specifier as they are handled - // elsewhere. - return undefined; - } - var generatedName = ts.getGeneratedNameForNode(node); - if (node.exportClause) { - var statements = []; - // export { x, y } from "mod"; - if (moduleKind !== ts.ModuleKind.AMD) { - statements.push(ts.createVariableStatement( - /*modifiers*/ undefined, ts.createVariableDeclarationList([ - ts.createVariableDeclaration(generatedName, - /*type*/ undefined, createRequireCall(node)) - ]), - /*location*/ node)); - } - for (var _i = 0, _a = node.exportClause.elements; _i < _a.length; _i++) { - var specifier = _a[_i]; - var exportedValue = ts.createPropertyAccess(generatedName, specifier.propertyName || specifier.name); - statements.push(ts.createStatement(createExportExpression(ts.getExportName(specifier), exportedValue), - /*location*/ specifier)); - } - return ts.singleOrMany(statements); - } - else { - // export * from "mod"; - return ts.createStatement(ts.createCall(ts.createIdentifier("__export"), - /*typeArguments*/ undefined, [ - moduleKind !== ts.ModuleKind.AMD - ? createRequireCall(node) - : generatedName - ]), - /*location*/ node); - } - } - /** - * Visits an ExportAssignment node. - * - * @param node The node to visit. - */ - function visitExportAssignment(node) { - if (node.isExportEquals) { - return undefined; - } - var statements; - var original = node.original; - if (original && hasAssociatedEndOfDeclarationMarker(original)) { - // Defer exports until we encounter an EndOfDeclarationMarker node - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportStatement(deferredExports[id], ts.createIdentifier("default"), node.expression, /*location*/ node, /*allowComments*/ true); - } - else { - statements = appendExportStatement(statements, ts.createIdentifier("default"), node.expression, /*location*/ node, /*allowComments*/ true); - } - return ts.singleOrMany(statements); - } - /** - * Visits a FunctionDeclaration node. - * - * @param node The node to visit. - */ - function visitFunctionDeclaration(node) { - var statements; - if (ts.hasModifier(node, 1 /* Export */)) { - statements = ts.append(statements, ts.setOriginalNode(ts.createFunctionDeclaration( - /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, ts.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), - /*typeParameters*/ undefined, node.parameters, - /*type*/ undefined, node.body, - /*location*/ node), - /*original*/ node)); - } - else { - statements = ts.append(statements, node); - } - if (hasAssociatedEndOfDeclarationMarker(node)) { - // Defer exports until we encounter an EndOfDeclarationMarker node - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node); - } - else { - statements = appendExportsOfHoistedDeclaration(statements, node); - } - return ts.singleOrMany(statements); - } - /** - * Visits a ClassDeclaration node. - * - * @param node The node to visit. - */ - function visitClassDeclaration(node) { - var statements; - if (ts.hasModifier(node, 1 /* Export */)) { - statements = ts.append(statements, ts.setOriginalNode(ts.createClassDeclaration( - /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), - /*typeParameters*/ undefined, node.heritageClauses, node.members, - /*location*/ node), - /*original*/ node)); - } - else { - statements = ts.append(statements, node); - } - if (hasAssociatedEndOfDeclarationMarker(node)) { - // Defer exports until we encounter an EndOfDeclarationMarker node - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node); - } - else { - statements = appendExportsOfHoistedDeclaration(statements, node); - } - return ts.singleOrMany(statements); - } - /** - * Visits a VariableStatement node. - * - * @param node The node to visit. - */ - function visitVariableStatement(node) { - var statements; - var variables; - var expressions; - if (ts.hasModifier(node, 1 /* Export */)) { - var modifiers = void 0; - // If we're exporting these variables, then these just become assignments to 'exports.x'. - // We only want to emit assignments for variables with initializers. - for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { - var variable = _a[_i]; - if (ts.isIdentifier(variable.name) && ts.isLocalName(variable.name)) { - if (!modifiers) { - modifiers = ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier); - } - variables = ts.append(variables, variable); - } - else if (variable.initializer) { - expressions = ts.append(expressions, transformInitializedVariable(variable)); - } - } - if (variables) { - statements = ts.append(statements, ts.updateVariableStatement(node, modifiers, ts.updateVariableDeclarationList(node.declarationList, variables))); - } - if (expressions) { - statements = ts.append(statements, ts.createStatement(ts.inlineExpressions(expressions), /*location*/ node)); - } - } - else { - statements = ts.append(statements, node); - } - if (hasAssociatedEndOfDeclarationMarker(node)) { - // Defer exports until we encounter an EndOfDeclarationMarker node - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node); - } - else { - statements = appendExportsOfVariableStatement(statements, node); - } - return ts.singleOrMany(statements); - } - /** - * Transforms an exported variable with an initializer into an expression. - * - * @param node The node to transform. - */ - function transformInitializedVariable(node) { - if (ts.isBindingPattern(node.name)) { - return ts.flattenDestructuringAssignment(node, - /*visitor*/ undefined, context, 0 /* All */, - /*needsValue*/ false, createExportExpression); - } - else { - return ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("exports"), node.name, - /*location*/ node.name), node.initializer); - } - } - /** - * Visits a MergeDeclarationMarker used as a placeholder for the beginning of a merged - * and transformed declaration. - * - * @param node The node to visit. - */ - function visitMergeDeclarationMarker(node) { - // For an EnumDeclaration or ModuleDeclaration that merges with a preceeding - // declaration we do not emit a leading variable declaration. To preserve the - // begin/end semantics of the declararation and to properly handle exports - // we wrapped the leading variable declaration in a `MergeDeclarationMarker`. - // - // To balance the declaration, add the exports of the elided variable - // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 205 /* VariableStatement */) { - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); - } - return node; - } - /** - * Determines whether a node has an associated EndOfDeclarationMarker. - * - * @param node The node to test. - */ - function hasAssociatedEndOfDeclarationMarker(node) { - return (ts.getEmitFlags(node) & 2097152 /* HasEndOfDeclarationMarker */) !== 0; - } - /** - * Visits a DeclarationMarker used as a placeholder for the end of a transformed - * declaration. - * - * @param node The node to visit. - */ - function visitEndOfDeclarationMarker(node) { - // For some transformations we emit an `EndOfDeclarationMarker` to mark the actual - // end of the transformed declaration. We use this marker to emit any deferred exports - // of the declaration. - var id = ts.getOriginalNodeId(node); - var statements = deferredExports[id]; - if (statements) { - delete deferredExports[id]; - return ts.append(statements, node); - } - return node; - } - /** - * Appends the exports of an ImportDeclaration to a statement list, returning the - * statement list. - * - * @param statements A statement list to which the down-level export statements are to be - * appended. If `statements` is `undefined`, a new array is allocated if statements are - * appended. - * @param decl The declaration whose exports are to be recorded. - */ - function appendExportsOfImportDeclaration(statements, decl) { - if (currentModuleInfo.exportEquals) { - return statements; - } - var importClause = decl.importClause; - if (!importClause) { - return statements; - } - if (importClause.name) { - statements = appendExportsOfDeclaration(statements, importClause); - } - var namedBindings = importClause.namedBindings; - if (namedBindings) { - switch (namedBindings.kind) { - case 237 /* NamespaceImport */: - statements = appendExportsOfDeclaration(statements, namedBindings); - break; - case 238 /* NamedImports */: - for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { - var importBinding = _a[_i]; - statements = appendExportsOfDeclaration(statements, importBinding); - } - break; - } - } - return statements; - } - /** - * Appends the exports of an ImportEqualsDeclaration to a statement list, returning the - * statement list. - * - * @param statements A statement list to which the down-level export statements are to be - * appended. If `statements` is `undefined`, a new array is allocated if statements are - * appended. - * @param decl The declaration whose exports are to be recorded. - */ - function appendExportsOfImportEqualsDeclaration(statements, decl) { - if (currentModuleInfo.exportEquals) { - return statements; - } - return appendExportsOfDeclaration(statements, decl); - } - /** - * Appends the exports of a VariableStatement to a statement list, returning the statement - * list. - * - * @param statements A statement list to which the down-level export statements are to be - * appended. If `statements` is `undefined`, a new array is allocated if statements are - * appended. - * @param node The VariableStatement whose exports are to be recorded. - */ - function appendExportsOfVariableStatement(statements, node) { - if (currentModuleInfo.exportEquals) { - return statements; - } - for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { - var decl = _a[_i]; - statements = appendExportsOfBindingElement(statements, decl); - } - return statements; - } - /** - * Appends the exports of a VariableDeclaration or BindingElement to a statement list, - * returning the statement list. - * - * @param statements A statement list to which the down-level export statements are to be - * appended. If `statements` is `undefined`, a new array is allocated if statements are - * appended. - * @param decl The declaration whose exports are to be recorded. - */ - function appendExportsOfBindingElement(statements, decl) { - if (currentModuleInfo.exportEquals) { - return statements; - } - if (ts.isBindingPattern(decl.name)) { - for (var _i = 0, _a = decl.name.elements; _i < _a.length; _i++) { - var element = _a[_i]; - if (!ts.isOmittedExpression(element)) { - statements = appendExportsOfBindingElement(statements, element); - } - } - } - else if (!ts.isGeneratedIdentifier(decl.name)) { - statements = appendExportsOfDeclaration(statements, decl); - } - return statements; - } - /** - * Appends the exports of a ClassDeclaration or FunctionDeclaration to a statement list, - * returning the statement list. - * - * @param statements A statement list to which the down-level export statements are to be - * appended. If `statements` is `undefined`, a new array is allocated if statements are - * appended. - * @param decl The declaration whose exports are to be recorded. - */ - function appendExportsOfHoistedDeclaration(statements, decl) { - if (currentModuleInfo.exportEquals) { - return statements; - } - if (ts.hasModifier(decl, 1 /* Export */)) { - var exportName = ts.hasModifier(decl, 512 /* Default */) ? ts.createIdentifier("default") : decl.name; - statements = appendExportStatement(statements, exportName, ts.getLocalName(decl), /*location*/ decl); - } - if (decl.name) { - statements = appendExportsOfDeclaration(statements, decl); - } - return statements; - } - /** - * Appends the exports of a declaration to a statement list, returning the statement list. - * - * @param statements A statement list to which the down-level export statements are to be - * appended. If `statements` is `undefined`, a new array is allocated if statements are - * appended. - * @param decl The declaration to export. - */ - function appendExportsOfDeclaration(statements, decl) { - var name = ts.getDeclarationName(decl); - var exportSpecifiers = currentModuleInfo.exportSpecifiers[name.text]; - if (exportSpecifiers) { - for (var _i = 0, exportSpecifiers_2 = exportSpecifiers; _i < exportSpecifiers_2.length; _i++) { - var exportSpecifier = exportSpecifiers_2[_i]; - statements = appendExportStatement(statements, exportSpecifier.name, name, /*location*/ exportSpecifier.name); - } - } - return statements; - } - /** - * Appends the down-level representation of an export to a statement list, returning the - * statement list. - * - * @param statements A statement list to which the down-level export statements are to be - * appended. If `statements` is `undefined`, a new array is allocated if statements are - * appended. - * @param exportName The name of the export. - * @param expression The expression to export. - * @param location The location to use for source maps and comments for the export. - * @param allowComments Whether to allow comments on the export. - */ - function appendExportStatement(statements, exportName, expression, location, allowComments) { - if (exportName.text === "default") { - var sourceFile = ts.getOriginalNode(currentSourceFile, ts.isSourceFile); - if (sourceFile && !sourceFile.symbol.exports["___esModule"]) { - if (languageVersion === 0 /* ES3 */) { - statements = ts.append(statements, ts.createStatement(createExportExpression(ts.createIdentifier("__esModule"), ts.createLiteral(true)))); - } - else { - statements = ts.append(statements, ts.createStatement(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), - /*typeArguments*/ undefined, [ - ts.createIdentifier("exports"), - ts.createLiteral("__esModule"), - ts.createObjectLiteral([ - ts.createPropertyAssignment("value", ts.createLiteral(true)) - ]) - ]))); - } - } - } - statements = ts.append(statements, createExportStatement(exportName, expression, location, allowComments)); - return statements; - } - /** - * Creates a call to the current file's export function to export a value. - * - * @param name The bound name of the export. - * @param value The exported value. - * @param location The location to use for source maps and comments for the export. - * @param allowComments An optional value indicating whether to emit comments for the statement. - */ - function createExportStatement(name, value, location, allowComments) { - var statement = ts.createStatement(createExportExpression(name, value), location); - ts.startOnNewLine(statement); - if (!allowComments) { - ts.setEmitFlags(statement, 1536 /* NoComments */); - } - return statement; - } - /** - * Creates a call to the current file's export function to export a value. - * - * @param name The bound name of the export. - * @param value The exported value. - * @param location The location to use for source maps and comments for the export. - */ - function createExportExpression(name, value, location) { - return ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(name)), value, location); - } - // - // Modifier Visitors - // - /** - * Visit nodes to elide module-specific modifiers. - * - * @param node The node to visit. - */ - function modifierVisitor(node) { - // Elide module-specific modifiers. - switch (node.kind) { - case 83 /* ExportKeyword */: - case 78 /* DefaultKeyword */: - return undefined; - } - return node; - } - // - // Emit Notification - // - /** - * Hook for node emit notifications. - * - * @param emitContext A context hint for the emitter. - * @param node The node to emit. - * @param emit A callback used to emit the node in the printer. - */ - function onEmitNode(emitContext, node, emitCallback) { - if (node.kind === 261 /* SourceFile */) { - currentSourceFile = node; - currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; - noSubstitution = ts.createMap(); - previousOnEmitNode(emitContext, node, emitCallback); - currentSourceFile = undefined; - currentModuleInfo = undefined; - noSubstitution = undefined; - } - else { - previousOnEmitNode(emitContext, node, emitCallback); - } - } - // - // Substitutions - // - /** - * Hooks node substitutions. - * - * @param emitContext A context hint for the emitter. - * @param node The node to substitute. - */ - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (node.id && noSubstitution[node.id]) { - return node; - } - if (emitContext === 1 /* Expression */) { - return substituteExpression(node); - } - else if (ts.isShorthandPropertyAssignment(node)) { - return substituteShorthandPropertyAssignment(node); - } - return node; - } - /** - * Substitution for a ShorthandPropertyAssignment whose declaration name is an imported - * or exported symbol. - * - * @param node The node to substitute. - */ - function substituteShorthandPropertyAssignment(node) { - var name = node.name; - var exportedOrImportedName = substituteExpressionIdentifier(name); - if (exportedOrImportedName !== name) { - // A shorthand property with an assignment initializer is probably part of a - // destructuring assignment - if (node.objectAssignmentInitializer) { - var initializer = ts.createAssignment(exportedOrImportedName, node.objectAssignmentInitializer); - return ts.createPropertyAssignment(name, initializer, /*location*/ node); - } - return ts.createPropertyAssignment(name, exportedOrImportedName, /*location*/ node); - } - return node; - } - /** - * Substitution for an Expression that may contain an imported or exported symbol. - * - * @param node The node to substitute. - */ - function substituteExpression(node) { - switch (node.kind) { - case 70 /* Identifier */: - return substituteExpressionIdentifier(node); - case 192 /* BinaryExpression */: - return substituteBinaryExpression(node); - case 191 /* PostfixUnaryExpression */: - case 190 /* PrefixUnaryExpression */: - return substituteUnaryExpression(node); - } - return node; - } - /** - * Substitution for an Identifier expression that may contain an imported or exported - * symbol. - * - * @param node The node to substitute. - */ - function substituteExpressionIdentifier(node) { - if (ts.getEmitFlags(node) & 4096 /* HelperName */) { - var externalHelpersModuleName = ts.getExternalHelpersModuleName(currentSourceFile); - if (externalHelpersModuleName) { - return ts.createPropertyAccess(externalHelpersModuleName, node); - } - return node; - } - if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { - var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 261 /* SourceFile */) { - return ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node), - /*location*/ node); - } - var importDeclaration = resolver.getReferencedImportDeclaration(node); - if (importDeclaration) { - if (ts.isImportClause(importDeclaration)) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default"), - /*location*/ node); - } - else if (ts.isImportSpecifier(importDeclaration)) { - var name_37 = importDeclaration.propertyName || importDeclaration.name; - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(name_37), + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(importDeclaration.propertyName || importDeclaration.name)), /*location*/ node); } } @@ -56730,9 +60925,7 @@ var ts; var expression = node; for (var _i = 0, exportedNames_3 = exportedNames; _i < exportedNames_3.length; _i++) { var exportName = exportedNames_3[_i]; - // Mark the node to prevent triggering this rule again. - noSubstitution[ts.getNodeId(expression)] = true; - expression = createExportExpression(exportName, expression, /*location*/ node); + expression = createExportExpression(exportName, preventSubstitution(expression)); } return expression; } @@ -56761,15 +60954,17 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 191 /* PostfixUnaryExpression */ - ? ts.createBinary(node.operand, ts.createToken(node.operator === 42 /* PlusPlusToken */ ? 58 /* PlusEqualsToken */ : 59 /* MinusEqualsToken */), ts.createLiteral(1), - /*location*/ node) + var expression = node.kind === 192 /* PostfixUnaryExpression */ + ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_4 = exportedNames; _i < exportedNames_4.length; _i++) { var exportName = exportedNames_4[_i]; - // Mark the node to prevent triggering this rule again. - noSubstitution[ts.getNodeId(expression)] = true; - expression = createExportExpression(exportName, expression); + expression = createExportExpression(exportName, preventSubstitution(expression)); + } + if (node.kind === 192 /* PostfixUnaryExpression */) { + expression = node.operator === 42 /* PlusPlusToken */ + ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) + : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); } return expression; } @@ -56777,31 +60972,144 @@ var ts; return node; } /** - * Gets the additional exports of a name. + * Gets the exports of a name. * * @param name The name. */ function getExports(name) { + var exportedNames; if (!ts.isGeneratedIdentifier(name)) { var valueDeclaration = resolver.getReferencedImportDeclaration(name) || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { - return currentModuleInfo - && currentModuleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]; + var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); + if (exportContainer && exportContainer.kind === 264 /* SourceFile */) { + exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); + } + exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); } } + return exportedNames; + } + /** + * Prevent substitution of a node for this transformer. + * + * @param node The node which should not be substituted. + */ + function preventSubstitution(node) { + if (noSubstitution === undefined) + noSubstitution = []; + noSubstitution[ts.getNodeId(node)] = true; + return node; + } + /** + * Determines whether a node should not be substituted. + * + * @param node The node to test. + */ + function isSubstitutionPrevented(node) { + return noSubstitution && node.id && noSubstitution[node.id]; } - var _a; } - ts.transformModule = transformModule; - // emit output for the __export helper function - var exportStarHelper = { - name: "typescript:export-star", - scoped: true, - text: "\n function __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n }" - }; - // emit output for the UMD helper function. - var umdHelper = "\n (function (dependencies, factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define(dependencies, factory);\n }\n })"; + ts.transformSystemModule = transformSystemModule; +})(ts || (ts = {})); +/// +/// +/*@internal*/ +var ts; +(function (ts) { + function transformES2015Module(context) { + var compilerOptions = context.getCompilerOptions(); + var previousOnEmitNode = context.onEmitNode; + var previousOnSubstituteNode = context.onSubstituteNode; + context.onEmitNode = onEmitNode; + context.onSubstituteNode = onSubstituteNode; + context.enableEmitNotification(264 /* SourceFile */); + context.enableSubstitution(70 /* Identifier */); + var currentSourceFile; + return transformSourceFile; + function transformSourceFile(node) { + if (ts.isDeclarationFile(node)) { + return node; + } + if (ts.isExternalModule(node) || compilerOptions.isolatedModules) { + var externalHelpersModuleName = ts.getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions); + if (externalHelpersModuleName) { + var statements = []; + var statementOffset = ts.addPrologue(statements, node.statements); + ts.append(statements, ts.createImportDeclaration( + /*decorators*/ undefined, + /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText))); + ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset)); + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements)); + } + else { + return ts.visitEachChild(node, visitor, context); + } + } + return node; + } + function visitor(node) { + switch (node.kind) { + case 236 /* ImportEqualsDeclaration */: + // Elide `import=` as it is not legal with --module ES6 + return undefined; + case 242 /* ExportAssignment */: + return visitExportAssignment(node); + } + return node; + } + function visitExportAssignment(node) { + // Elide `export=` as it is not legal with --module ES6 + return node.isExportEquals ? undefined : node; + } + // + // Emit Notification + // + /** + * Hook for node emit. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to emit. + * @param emit A callback used to emit the node in the printer. + */ + function onEmitNode(hint, node, emitCallback) { + if (ts.isSourceFile(node)) { + currentSourceFile = node; + previousOnEmitNode(hint, node, emitCallback); + currentSourceFile = undefined; + } + else { + previousOnEmitNode(hint, node, emitCallback); + } + } + // + // Substitutions + // + /** + * Hooks node substitutions. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to substitute. + */ + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (ts.isIdentifier(node) && hint === 1 /* Expression */) { + return substituteExpressionIdentifier(node); + } + return node; + } + function substituteExpressionIdentifier(node) { + if (ts.getEmitFlags(node) & 4096 /* HelperName */) { + var externalHelpersModuleName = ts.getExternalHelpersModuleName(currentSourceFile); + if (externalHelpersModuleName) { + return ts.createPropertyAccess(externalHelpersModuleName, node); + } + } + return node; + } + } + ts.transformES2015Module = transformES2015Module; })(ts || (ts = {})); /// /// @@ -56818,24 +61126,34 @@ var ts; /* @internal */ var ts; (function (ts) { - var moduleTransformerMap = ts.createMap((_a = {}, - _a[ts.ModuleKind.ES2015] = ts.transformES2015Module, - _a[ts.ModuleKind.System] = ts.transformSystemModule, - _a[ts.ModuleKind.AMD] = ts.transformModule, - _a[ts.ModuleKind.CommonJS] = ts.transformModule, - _a[ts.ModuleKind.UMD] = ts.transformModule, - _a[ts.ModuleKind.None] = ts.transformModule, - _a)); + function getModuleTransformer(moduleKind) { + switch (moduleKind) { + case ts.ModuleKind.ES2015: + return ts.transformES2015Module; + case ts.ModuleKind.System: + return ts.transformSystemModule; + default: + return ts.transformModule; + } + } + var TransformationState; + (function (TransformationState) { + TransformationState[TransformationState["Uninitialized"] = 0] = "Uninitialized"; + TransformationState[TransformationState["Initialized"] = 1] = "Initialized"; + TransformationState[TransformationState["Completed"] = 2] = "Completed"; + TransformationState[TransformationState["Disposed"] = 3] = "Disposed"; + })(TransformationState || (TransformationState = {})); var SyntaxKindFeatureFlags; (function (SyntaxKindFeatureFlags) { SyntaxKindFeatureFlags[SyntaxKindFeatureFlags["Substitution"] = 1] = "Substitution"; SyntaxKindFeatureFlags[SyntaxKindFeatureFlags["EmitNotifications"] = 2] = "EmitNotifications"; })(SyntaxKindFeatureFlags || (SyntaxKindFeatureFlags = {})); - function getTransformers(compilerOptions) { + function getTransformers(compilerOptions, customTransformers) { var jsx = compilerOptions.jsx; var languageVersion = ts.getEmitScriptTarget(compilerOptions); var moduleKind = ts.getEmitModuleKind(compilerOptions); var transformers = []; + ts.addRange(transformers, customTransformers && customTransformers.before); transformers.push(ts.transformTypeScript); if (jsx === 2 /* React */) { transformers.push(ts.transformJsx); @@ -56853,12 +61171,13 @@ var ts; transformers.push(ts.transformES2015); transformers.push(ts.transformGenerators); } - transformers.push(moduleTransformerMap[moduleKind] || moduleTransformerMap[ts.ModuleKind.None]); + transformers.push(getModuleTransformer(moduleKind)); // The ES5 transformer is last so that it can substitute expressions like `exports.default` // for ES3. if (languageVersion < 1 /* ES5 */) { transformers.push(ts.transformES5); } + ts.addRange(transformers, customTransformers && customTransformers.after); return transformers; } ts.getTransformers = getTransformers; @@ -56866,13 +61185,14 @@ var ts; * Transforms an array of SourceFiles by passing them through each transformer. * * @param resolver The emit resolver provided by the checker. - * @param host The emit host. - * @param sourceFiles An array of source files - * @param transforms An array of Transformers. + * @param host The emit host object used to interact with the file system. + * @param options Compiler options to surface in the `TransformationContext`. + * @param nodes An array of nodes to transform. + * @param transforms An array of `TransformerFactory` callbacks. + * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ - function transformFiles(resolver, host, sourceFiles, transformers) { + function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { var enabledSyntaxKindFeatures = new Array(298 /* Count */); - var lexicalEnvironmentDisabled = false; var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -56880,10 +61200,13 @@ var ts; var lexicalEnvironmentStackOffset = 0; var lexicalEnvironmentSuspended = false; var emitHelpers; + var onSubstituteNode = function (_, node) { return node; }; + var onEmitNode = function (hint, node, callback) { return callback(hint, node); }; + var state = 0 /* Uninitialized */; // The transformation context is provided to each transformer as part of transformer // initialization. var context = { - getCompilerOptions: function () { return host.getCompilerOptions(); }, + getCompilerOptions: function () { return options; }, getEmitResolver: function () { return resolver; }, getEmitHost: function () { return host; }, startLexicalEnvironment: startLexicalEnvironment, @@ -56894,39 +61217,53 @@ var ts; hoistFunctionDeclaration: hoistFunctionDeclaration, requestEmitHelper: requestEmitHelper, readEmitHelpers: readEmitHelpers, - onSubstituteNode: function (_emitContext, node) { return node; }, enableSubstitution: enableSubstitution, - isSubstitutionEnabled: isSubstitutionEnabled, - onEmitNode: function (node, emitContext, emitCallback) { return emitCallback(node, emitContext); }, enableEmitNotification: enableEmitNotification, - isEmitNotificationEnabled: isEmitNotificationEnabled + isSubstitutionEnabled: isSubstitutionEnabled, + isEmitNotificationEnabled: isEmitNotificationEnabled, + get onSubstituteNode() { return onSubstituteNode; }, + set onSubstituteNode(value) { + ts.Debug.assert(state < 1 /* Initialized */, "Cannot modify transformation hooks after initialization has completed."); + ts.Debug.assert(value !== undefined, "Value must not be 'undefined'"); + onSubstituteNode = value; + }, + get onEmitNode() { return onEmitNode; }, + set onEmitNode(value) { + ts.Debug.assert(state < 1 /* Initialized */, "Cannot modify transformation hooks after initialization has completed."); + ts.Debug.assert(value !== undefined, "Value must not be 'undefined'"); + onEmitNode = value; + } }; + // Ensure the parse tree is clean before applying transformations + for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { + var node = nodes_4[_i]; + ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node))); + } + ts.performance.mark("beforeTransform"); // Chain together and initialize each transformer. var transformation = ts.chain.apply(void 0, transformers)(context); - // Transform each source file. - var transformed = ts.map(sourceFiles, transformSourceFile); - // Disable modification of the lexical environment. - lexicalEnvironmentDisabled = true; + // prevent modification of transformation hooks. + state = 1 /* Initialized */; + // Transform each node. + var transformed = ts.map(nodes, allowDtsFiles ? transformation : transformRoot); + // prevent modification of the lexical environment. + state = 2 /* Completed */; + ts.performance.mark("afterTransform"); + ts.performance.measure("transformTime", "beforeTransform", "afterTransform"); return { transformed: transformed, - emitNodeWithSubstitution: emitNodeWithSubstitution, - emitNodeWithNotification: emitNodeWithNotification + substituteNode: substituteNode, + emitNodeWithNotification: emitNodeWithNotification, + dispose: dispose }; - /** - * Transforms a source file. - * - * @param sourceFile The source file to transform. - */ - function transformSourceFile(sourceFile) { - if (ts.isDeclarationFile(sourceFile)) { - return sourceFile; - } - return transformation(sourceFile); + function transformRoot(node) { + return node && (!ts.isSourceFile(node) || !ts.isDeclarationFile(node)) ? transformation(node) : node; } /** * Enables expression substitutions in the pretty printer for the provided SyntaxKind. */ function enableSubstitution(kind) { + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the transformation context after transformation has completed."); enabledSyntaxKindFeatures[kind] |= 1 /* Substitution */; } /** @@ -56939,26 +61276,19 @@ var ts; /** * Emits a node with possible substitution. * - * @param emitContext The current emit context. + * @param hint A hint as to the intended usage of the node. * @param node The node to emit. * @param emitCallback The callback used to emit the node or its substitute. */ - function emitNodeWithSubstitution(emitContext, node, emitCallback) { - if (node) { - if (isSubstitutionEnabled(node)) { - var substitute = context.onSubstituteNode(emitContext, node); - if (substitute && substitute !== node) { - emitCallback(emitContext, substitute); - return; - } - } - emitCallback(emitContext, node); - } + function substituteNode(hint, node) { + ts.Debug.assert(state < 3 /* Disposed */, "Cannot substitute a node after the result is disposed."); + return node && isSubstitutionEnabled(node) && onSubstituteNode(hint, node) || node; } /** * Enables before/after emit notifications in the pretty printer for the provided SyntaxKind. */ function enableEmitNotification(kind) { + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the transformation context after transformation has completed."); enabledSyntaxKindFeatures[kind] |= 2 /* EmitNotifications */; } /** @@ -56972,17 +61302,18 @@ var ts; /** * Emits a node with possible emit notification. * - * @param emitContext The current emit context. + * @param hint A hint as to the intended usage of the node. * @param node The node to emit. * @param emitCallback The callback used to emit the node. */ - function emitNodeWithNotification(emitContext, node, emitCallback) { + function emitNodeWithNotification(hint, node, emitCallback) { + ts.Debug.assert(state < 3 /* Disposed */, "Cannot invoke TransformationResult callbacks after the result is disposed."); if (node) { if (isEmitNotificationEnabled(node)) { - context.onEmitNode(emitContext, node, emitCallback); + onEmitNode(hint, node, emitCallback); } else { - emitCallback(emitContext, node); + emitCallback(hint, node); } } } @@ -56990,7 +61321,8 @@ var ts; * Records a hoisted variable declaration for the provided name within a lexical environment. */ function hoistVariableDeclaration(name) { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); var decl = ts.createVariableDeclaration(name); if (!lexicalEnvironmentVariableDeclarations) { lexicalEnvironmentVariableDeclarations = [decl]; @@ -57003,7 +61335,8 @@ var ts; * Records a hoisted function declaration within a lexical environment. */ function hoistFunctionDeclaration(func) { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); if (!lexicalEnvironmentFunctionDeclarations) { lexicalEnvironmentFunctionDeclarations = [func]; } @@ -57016,7 +61349,8 @@ var ts; * are pushed onto a stack, and the related storage variables are reset. */ function startLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot start a lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is suspended."); // Save the current lexical environment. Rather than resizing the array we adjust the // stack size variable. This allows us to reuse existing array slots we've @@ -57030,13 +61364,15 @@ var ts; } /** Suspends the current lexical environment, usually after visiting a parameter list. */ function suspendLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot suspend a lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is already suspended."); lexicalEnvironmentSuspended = true; } /** Resumes a suspended lexical environment, usually before visiting a function body. */ function resumeLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot resume a lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(lexicalEnvironmentSuspended, "Lexical environment is not suspended."); lexicalEnvironmentSuspended = false; } @@ -57045,7 +61381,8 @@ var ts; * any hoisted declarations added in this environment are returned. */ function endLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot end a lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is suspended."); var statements; if (lexicalEnvironmentVariableDeclarations || lexicalEnvironmentFunctionDeclarations) { @@ -57074,19 +61411,39 @@ var ts; return statements; } function requestEmitHelper(helper) { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the transformation context during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the transformation context after transformation has completed."); ts.Debug.assert(!helper.scoped, "Cannot request a scoped emit helper."); emitHelpers = ts.append(emitHelpers, helper); } function readEmitHelpers() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the transformation context during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the transformation context after transformation has completed."); var helpers = emitHelpers; emitHelpers = undefined; return helpers; } + function dispose() { + if (state < 3 /* Disposed */) { + // Clean up emit nodes on parse tree + for (var _i = 0, nodes_5 = nodes; _i < nodes_5.length; _i++) { + var node = nodes_5[_i]; + ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node))); + } + // Release references to external entries for GC purposes. + lexicalEnvironmentVariableDeclarations = undefined; + lexicalEnvironmentVariableDeclarationsStack = undefined; + lexicalEnvironmentFunctionDeclarations = undefined; + lexicalEnvironmentFunctionDeclarationsStack = undefined; + onSubstituteNode = undefined; + onEmitNode = undefined; + emitHelpers = undefined; + // Prevent further use of the transformation result. + state = 3 /* Disposed */; + } + } } - ts.transformFiles = transformFiles; - var _a; + ts.transformNodes = transformNodes; })(ts || (ts = {})); /// /* @internal */ @@ -57131,10 +61488,9 @@ var ts; * * @param filePath The path to the generated output file. * @param sourceMapFilePath The path to the output source map file. - * @param sourceFiles The input source files for the program. - * @param isBundledEmit A value indicating whether the generated output file is a bundle. + * @param sourceFileOrBundle The input source file or bundle for the program. */ - function initialize(filePath, sourceMapFilePath, sourceFiles, isBundledEmit) { + function initialize(filePath, sourceMapFilePath, sourceFileOrBundle) { if (disabled) { return; } @@ -57170,11 +61526,10 @@ var ts; } if (compilerOptions.mapRoot) { sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); - if (!isBundledEmit) { - ts.Debug.assert(sourceFiles.length === 1); + if (sourceFileOrBundle.kind === 264 /* SourceFile */) { // For modules or multiple emit files the mapRoot will have directory structure like the sources // So if src\a.ts and src\lib\b.ts are compiled together user would be moving the maps into mapRoot\a.js.map and mapRoot\lib\b.js.map - sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFiles[0], host, sourceMapDir)); + sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFileOrBundle, host, sourceMapDir)); } if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { // The relative paths are relative to the common directory @@ -57297,31 +61652,32 @@ var ts; /** * Emits a node with possible leading and trailing source maps. * + * @param hint A hint as to the intended usage of the node. * @param node The node to emit. * @param emitCallback The callback used to emit the node. */ - function emitNodeWithSourceMap(emitContext, node, emitCallback) { + function emitNodeWithSourceMap(hint, node, emitCallback) { if (disabled) { - return emitCallback(emitContext, node); + return emitCallback(hint, node); } if (node) { var emitNode = node.emitNode; var emitFlags = emitNode && emitNode.flags; var _a = emitNode && emitNode.sourceMapRange || node, pos = _a.pos, end = _a.end; - if (node.kind !== 293 /* NotEmittedStatement */ + if (node.kind !== 294 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitPos(ts.skipTrivia(currentSourceText, pos)); } if (emitFlags & 64 /* NoNestedSourceMaps */) { disabled = true; - emitCallback(emitContext, node); + emitCallback(hint, node); disabled = false; } else { - emitCallback(emitContext, node); + emitCallback(hint, node); } - if (node.kind !== 293 /* NotEmittedStatement */ + if (node.kind !== 294 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitPos(end); @@ -57391,7 +61747,7 @@ var ts; return; } encodeLastRecordedSourceMapSpan(); - return ts.stringify({ + return JSON.stringify({ version: 3, file: sourceMapData.sourceMapFile, sourceRoot: sourceMapData.sourceMapSourceRoot, @@ -57456,11 +61812,10 @@ var ts; /* @internal */ var ts; (function (ts) { - function createCommentWriter(host, writer, sourceMap) { - var compilerOptions = host.getCompilerOptions(); - var extendedDiagnostics = compilerOptions.extendedDiagnostics; - var newLine = host.getNewLine(); - var emitPos = sourceMap.emitPos; + function createCommentWriter(printerOptions, emitPos) { + var extendedDiagnostics = printerOptions.extendedDiagnostics; + var newLine = ts.getNewLineCharacter(printerOptions); + var writer; var containerPos = -1; var containerEnd = -1; var declarationListContainerEnd = -1; @@ -57469,38 +61824,35 @@ var ts; var currentLineMap; var detachedCommentsInfo; var hasWrittenComment = false; - var disabled = compilerOptions.removeComments; + var disabled = printerOptions.removeComments; return { reset: reset, + setWriter: setWriter, setSourceFile: setSourceFile, emitNodeWithComments: emitNodeWithComments, emitBodyWithDetachedComments: emitBodyWithDetachedComments, emitTrailingCommentsOfPosition: emitTrailingCommentsOfPosition, + emitLeadingCommentsOfPosition: emitLeadingCommentsOfPosition, }; - function emitNodeWithComments(emitContext, node, emitCallback) { + function emitNodeWithComments(hint, node, emitCallback) { if (disabled) { - emitCallback(emitContext, node); + emitCallback(hint, node); return; } if (node) { - var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var emitFlags = ts.getEmitFlags(node); + hasWrittenComment = false; + var emitNode = node.emitNode; + var emitFlags = emitNode && emitNode.flags; + var _a = emitNode && emitNode.commentRange || node, pos = _a.pos, end = _a.end; if ((pos < 0 && end < 0) || (pos === end)) { // Both pos and end are synthesized, so just emit the node without comments. - if (emitFlags & 2048 /* NoNestedComments */) { - disabled = true; - emitCallback(emitContext, node); - disabled = false; - } - else { - emitCallback(emitContext, node); - } + emitNodeWithSynthesizedComments(hint, node, emitNode, emitFlags, emitCallback); } else { if (extendedDiagnostics) { ts.performance.mark("preEmitNodeWithComment"); } - var isEmittedNode = node.kind !== 293 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 294 /* NotEmittedStatement */; var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0; var skipTrailingComments = end < 0 || (emitFlags & 1024 /* NoTrailingComments */) !== 0; // Emit leading comments if the position is not synthesized and the node @@ -57519,23 +61871,16 @@ var ts; containerEnd = end; // To avoid invalid comment emit in a down-level binding pattern, we // keep track of the last declaration list container's end - if (node.kind === 224 /* VariableDeclarationList */) { + if (node.kind === 226 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } if (extendedDiagnostics) { ts.performance.measure("commentTime", "preEmitNodeWithComment"); } - if (emitFlags & 2048 /* NoNestedComments */) { - disabled = true; - emitCallback(emitContext, node); - disabled = false; - } - else { - emitCallback(emitContext, node); - } + emitNodeWithSynthesizedComments(hint, node, emitNode, emitFlags, emitCallback); if (extendedDiagnostics) { - ts.performance.mark("beginEmitNodeWithComment"); + ts.performance.mark("postEmitNodeWithComment"); } // Restore previous container state. containerPos = savedContainerPos; @@ -57547,11 +61892,75 @@ var ts; emitTrailingComments(end); } if (extendedDiagnostics) { - ts.performance.measure("commentTime", "beginEmitNodeWithComment"); + ts.performance.measure("commentTime", "postEmitNodeWithComment"); } } } } + function emitNodeWithSynthesizedComments(hint, node, emitNode, emitFlags, emitCallback) { + var leadingComments = emitNode && emitNode.leadingComments; + if (ts.some(leadingComments)) { + if (extendedDiagnostics) { + ts.performance.mark("preEmitNodeWithSynthesizedComments"); + } + ts.forEach(leadingComments, emitLeadingSynthesizedComment); + if (extendedDiagnostics) { + ts.performance.measure("commentTime", "preEmitNodeWithSynthesizedComments"); + } + } + emitNodeWithNestedComments(hint, node, emitFlags, emitCallback); + var trailingComments = emitNode && emitNode.trailingComments; + if (ts.some(trailingComments)) { + if (extendedDiagnostics) { + ts.performance.mark("postEmitNodeWithSynthesizedComments"); + } + ts.forEach(trailingComments, emitTrailingSynthesizedComment); + if (extendedDiagnostics) { + ts.performance.measure("commentTime", "postEmitNodeWithSynthesizedComments"); + } + } + } + function emitLeadingSynthesizedComment(comment) { + if (comment.kind === 2 /* SingleLineCommentTrivia */) { + writer.writeLine(); + } + writeSynthesizedComment(comment); + if (comment.hasTrailingNewLine || comment.kind === 2 /* SingleLineCommentTrivia */) { + writer.writeLine(); + } + else { + writer.write(" "); + } + } + function emitTrailingSynthesizedComment(comment) { + if (!writer.isAtStartOfLine()) { + writer.write(" "); + } + writeSynthesizedComment(comment); + if (comment.hasTrailingNewLine) { + writer.writeLine(); + } + } + function writeSynthesizedComment(comment) { + var text = formatSynthesizedComment(comment); + var lineMap = comment.kind === 3 /* MultiLineCommentTrivia */ ? ts.computeLineStarts(text) : undefined; + ts.writeCommentRange(text, lineMap, writer, 0, text.length, newLine); + } + function formatSynthesizedComment(comment) { + return comment.kind === 3 /* MultiLineCommentTrivia */ + ? "/*" + comment.text + "*/" + : "//" + comment.text; + } + function emitNodeWithNestedComments(hint, node, emitFlags, emitCallback) { + if (emitFlags & 2048 /* NoNestedComments */) { + disabled = true; + emitCallback(hint, node); + disabled = false; + } + else { + emitCallback(hint, node); + } + } function emitBodyWithDetachedComments(node, detachedRange, emitCallback) { if (extendedDiagnostics) { ts.performance.mark("preEmitBodyWithDetachedComments"); @@ -57579,6 +61988,9 @@ var ts; } if (!skipTrailingComments) { emitLeadingComments(detachedRange.end, /*isEmittedNode*/ true); + if (hasWrittenComment && !writer.isAtStartOfLine()) { + writer.writeLine(); + } } if (extendedDiagnostics) { ts.performance.measure("commentTime", "beginEmitBodyWithDetachedCommetns"); @@ -57612,9 +62024,11 @@ var ts; hasWrittenComment = true; } // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); if (hasTrailingNewLine) { writer.writeLine(); } @@ -57622,6 +62036,12 @@ var ts; writer.write(" "); } } + function emitLeadingCommentsOfPosition(pos) { + if (disabled || pos === -1) { + return; + } + emitLeadingComments(pos, /*isEmittedNode*/ true); + } function emitTrailingComments(pos) { forEachTrailingCommentToEmit(pos, emitTrailingComment); } @@ -57630,9 +62050,11 @@ var ts; if (!writer.isAtStartOfLine()) { writer.write(" "); } - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); if (hasTrailingNewLine) { writer.writeLine(); } @@ -57651,9 +62073,11 @@ var ts; } function emitTrailingCommentOfPosition(commentPos, commentEnd, _kind, hasTrailingNewLine) { // trailing comments of a position are emitted at /*trailing comment1 */space/*trailing comment*/space - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); if (hasTrailingNewLine) { writer.writeLine(); } @@ -57684,6 +62108,9 @@ var ts; currentLineMap = undefined; detachedCommentsInfo = undefined; } + function setWriter(output) { + writer = output; + } function setSourceFile(sourceFile) { currentSourceFile = sourceFile; currentText = currentSourceFile.text; @@ -57716,15 +62143,17 @@ var ts; } } function writeComment(text, lineMap, writer, commentPos, commentEnd, newLine) { - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(text, lineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); } /** * Determine if the given comment is a triple-slash * * @return true if the comment is a triple-slash comment else false - **/ + */ function isTripleSlashComment(commentPos, commentEnd) { // Verify this is /// comment, but do the regexp match only when we first can find /// in the comment text // so that we don't end up computing comment string and doing match for all // comments @@ -57747,15 +62176,17 @@ var ts; (function (ts) { function getDeclarationDiagnostics(host, resolver, targetSourceFile) { var declarationDiagnostics = ts.createDiagnosticCollection(); - ts.forEachExpectedEmitFile(host, getDeclarationDiagnosticsFromFile, targetSourceFile); + ts.forEachEmittedFile(host, getDeclarationDiagnosticsFromFile, targetSourceFile); return declarationDiagnostics.getDiagnostics(targetSourceFile ? targetSourceFile.fileName : undefined); - function getDeclarationDiagnosticsFromFile(_a, sources, isBundledEmit) { + function getDeclarationDiagnosticsFromFile(_a, sourceFileOrBundle) { var declarationFilePath = _a.declarationFilePath; - emitDeclarations(host, resolver, declarationDiagnostics, declarationFilePath, sources, isBundledEmit, /*emitOnlyDtsFiles*/ false); + emitDeclarations(host, resolver, declarationDiagnostics, declarationFilePath, sourceFileOrBundle, /*emitOnlyDtsFiles*/ false); } } ts.getDeclarationDiagnostics = getDeclarationDiagnostics; - function emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFiles, isBundledEmit, emitOnlyDtsFiles) { + function emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles) { + var sourceFiles = sourceFileOrBundle.kind === 265 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; + var isBundledEmit = sourceFileOrBundle.kind === 265 /* Bundle */; var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); var write; @@ -57829,7 +62260,7 @@ var ts; var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { - ts.Debug.assert(aliasEmitInfo.node.kind === 235 /* ImportDeclaration */); + ts.Debug.assert(aliasEmitInfo.node.kind === 237 /* ImportDeclaration */); createAndSetNewTextWriterWithSymbolWriter(); ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit)); for (var i = 0; i < aliasEmitInfo.indent; i++) { @@ -57855,9 +62286,9 @@ var ts; } }); if (usedTypeDirectiveReferences) { - for (var directive in usedTypeDirectiveReferences) { + ts.forEachKey(usedTypeDirectiveReferences, function (directive) { referencesOutput += "/// " + newLine; - } + }); } return { reportedDeclarationError: reportedDeclarationError, @@ -57882,12 +62313,14 @@ var ts; var writer = ts.createTextWriter(newLine); writer.trackSymbol = trackSymbol; writer.reportInaccessibleThisError = reportInaccessibleThisError; + writer.reportIllegalExtends = reportIllegalExtends; writer.writeKeyword = writer.write; writer.writeOperator = writer.write; writer.writePunctuation = writer.write; writer.writeSpace = writer.write; writer.writeStringLiteral = writer.writeLiteral; writer.writeParameter = writer.write; + writer.writeProperty = writer.write; writer.writeSymbol = writer.write; setWriter(writer); } @@ -57903,10 +62336,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 223 /* VariableDeclaration */) { + if (declaration.kind === 225 /* VariableDeclaration */) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 238 /* NamedImports */ || declaration.kind === 239 /* ImportSpecifier */ || declaration.kind === 236 /* ImportClause */) { + else if (declaration.kind === 240 /* NamedImports */ || declaration.kind === 241 /* ImportSpecifier */ || declaration.kind === 238 /* ImportClause */) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -57924,7 +62357,7 @@ var ts; // Writing of function bar would mark alias declaration foo as visible but we haven't yet visited that declaration so do nothing, // we would write alias foo declaration when we visit it since it would now be marked as visible if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 235 /* ImportDeclaration */) { + if (moduleElementEmitInfo.node.kind === 237 /* ImportDeclaration */) { // we have to create asynchronous output only after we have collected complete information // because it is possible to enable multiple bindings as asynchronously visible moduleElementEmitInfo.isVisible = true; @@ -57934,12 +62367,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 230 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 232 /* ModuleDeclaration */) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 230 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 232 /* ModuleDeclaration */) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -57958,8 +62391,8 @@ var ts; } for (var _i = 0, typeReferenceDirectives_1 = typeReferenceDirectives; _i < typeReferenceDirectives_1.length; _i++) { var directive = typeReferenceDirectives_1[_i]; - if (!(directive in usedTypeDirectiveReferences)) { - usedTypeDirectiveReferences[directive] = directive; + if (!usedTypeDirectiveReferences.has(directive)) { + usedTypeDirectiveReferences.set(directive, directive); } } } @@ -57988,6 +62421,12 @@ var ts; handleSymbolAccessibilityError(resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning, /*shouldComputeAliasesToMakeVisible*/ true)); recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForSymbol(symbol, meaning)); } + function reportIllegalExtends() { + if (errorNameNode) { + reportedDeclarationError = true; + emitterDiagnostics.add(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.extends_clause_of_exported_class_0_refers_to_a_type_whose_name_cannot_be_referenced, ts.declarationNameToString(errorNameNode))); + } + } function reportInaccessibleThisError() { if (errorNameNode) { reportedDeclarationError = true; @@ -57997,13 +62436,19 @@ var ts; function writeTypeOfDeclaration(declaration, type, getSymbolAccessibilityDiagnostic) { writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; write(": "); - if (type) { + // use the checker's type, not the declared type, + // for non-optional initialized parameters that aren't a parameter property + var shouldUseResolverType = declaration.kind === 145 /* Parameter */ && + resolver.isRequiredInitializedParameter(declaration); + if (type && !shouldUseResolverType) { // Write the type emitType(type); } else { errorNameNode = declaration.name; - resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, 2 /* UseTypeOfFunction */ | 1024 /* UseTypeAliasValue */, writer); + var format = 2 /* UseTypeOfFunction */ | 1024 /* UseTypeAliasValue */ | + (shouldUseResolverType ? 4096 /* AddUndefined */ : 0); + resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, format, writer); errorNameNode = undefined; } } @@ -58021,15 +62466,15 @@ var ts; } } function emitLines(nodes) { - for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { - var node = nodes_4[_i]; + for (var _i = 0, nodes_6 = nodes; _i < nodes_6.length; _i++) { + var node = nodes_6[_i]; emit(node); } } function emitSeparatedList(nodes, separator, eachNodeEmitFn, canEmitFn) { var currentWriterPos = writer.getTextPos(); - for (var _i = 0, nodes_5 = nodes; _i < nodes_5.length; _i++) { - var node = nodes_5[_i]; + for (var _i = 0, nodes_7 = nodes; _i < nodes_7.length; _i++) { + var node = nodes_7[_i]; if (!canEmitFn || canEmitFn(node)) { if (currentWriterPos !== writer.getTextPos()) { write(separator); @@ -58057,49 +62502,50 @@ var ts; function emitType(type) { switch (type.kind) { case 118 /* AnyKeyword */: - case 134 /* StringKeyword */: + case 135 /* StringKeyword */: case 132 /* NumberKeyword */: case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: + case 133 /* ObjectKeyword */: + case 136 /* SymbolKeyword */: case 104 /* VoidKeyword */: - case 137 /* UndefinedKeyword */: + case 138 /* UndefinedKeyword */: case 94 /* NullKeyword */: case 129 /* NeverKeyword */: - case 167 /* ThisType */: - case 171 /* LiteralType */: + case 168 /* ThisType */: + case 172 /* LiteralType */: return writeTextOfNode(currentText, type); - case 199 /* ExpressionWithTypeArguments */: + case 200 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(type); - case 157 /* TypeReference */: + case 158 /* TypeReference */: return emitTypeReference(type); - case 160 /* TypeQuery */: + case 161 /* TypeQuery */: return emitTypeQuery(type); - case 162 /* ArrayType */: + case 163 /* ArrayType */: return emitArrayType(type); - case 163 /* TupleType */: + case 164 /* TupleType */: return emitTupleType(type); - case 164 /* UnionType */: + case 165 /* UnionType */: return emitUnionType(type); - case 165 /* IntersectionType */: + case 166 /* IntersectionType */: return emitIntersectionType(type); - case 166 /* ParenthesizedType */: + case 167 /* ParenthesizedType */: return emitParenType(type); - case 168 /* TypeOperator */: + case 169 /* TypeOperator */: return emitTypeOperator(type); - case 169 /* IndexedAccessType */: + case 170 /* IndexedAccessType */: return emitIndexedAccessType(type); - case 170 /* MappedType */: + case 171 /* MappedType */: return emitMappedType(type); - case 158 /* FunctionType */: - case 159 /* ConstructorType */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: return emitSignatureDeclarationWithJsDocComments(type); - case 161 /* TypeLiteral */: + case 162 /* TypeLiteral */: return emitTypeLiteral(type); case 70 /* Identifier */: return emitEntityName(type); - case 141 /* QualifiedName */: + case 142 /* QualifiedName */: return emitEntityName(type); - case 156 /* TypePredicate */: + case 157 /* TypePredicate */: return emitTypePredicate(type); } function writeEntityName(entityName) { @@ -58107,8 +62553,8 @@ var ts; writeTextOfNode(currentText, entityName); } else { - var left = entityName.kind === 141 /* QualifiedName */ ? entityName.left : entityName.expression; - var right = entityName.kind === 141 /* QualifiedName */ ? entityName.right : entityName.name; + var left = entityName.kind === 142 /* QualifiedName */ ? entityName.left : entityName.expression; + var right = entityName.kind === 142 /* QualifiedName */ ? entityName.right : entityName.name; writeEntityName(left); write("."); writeTextOfNode(currentText, right); @@ -58117,14 +62563,14 @@ var ts; function emitEntityName(entityName) { var visibilityResult = resolver.isEntityNameVisible(entityName, // Aliases can be written asynchronously so use correct enclosing declaration - entityName.parent.kind === 234 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); + entityName.parent.kind === 236 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForEntityName(entityName)); writeEntityName(entityName); } function emitExpressionWithTypeArguments(node) { if (ts.isEntityNameExpression(node.expression)) { - ts.Debug.assert(node.expression.kind === 70 /* Identifier */ || node.expression.kind === 177 /* PropertyAccessExpression */); + ts.Debug.assert(node.expression.kind === 70 /* Identifier */ || node.expression.kind === 178 /* PropertyAccessExpression */); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -58224,7 +62670,7 @@ var ts; currentIdentifiers = node.identifiers; isCurrentFileExternalModule = ts.isExternalModule(node); enclosingDeclaration = node; - ts.emitDetachedComments(currentText, currentLineMap, writer, ts.writeCommentRange, node, newLine, true /* remove comments */); + ts.emitDetachedComments(currentText, currentLineMap, writer, ts.writeCommentRange, node, newLine, /*removeComents*/ true); emitLines(node.statements); } // Return a temp variable name to be used in `export default` statements. @@ -58233,15 +62679,15 @@ var ts; // do not need to keep track of created temp names. function getExportDefaultTempVariableName() { var baseName = "_default"; - if (!(baseName in currentIdentifiers)) { + if (!currentIdentifiers.has(baseName)) { return baseName; } var count = 0; while (true) { count++; - var name_38 = baseName + "_" + count; - if (!(name_38 in currentIdentifiers)) { - return name_38; + var name = baseName + "_" + count; + if (!currentIdentifiers.has(name)) { + return name; } } } @@ -58288,10 +62734,10 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 234 /* ImportEqualsDeclaration */ || - (node.parent.kind === 261 /* SourceFile */ && isCurrentFileExternalModule)) { + else if (node.kind === 236 /* ImportEqualsDeclaration */ || + (node.parent.kind === 264 /* SourceFile */ && isCurrentFileExternalModule)) { var isVisible = void 0; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 261 /* SourceFile */) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 264 /* SourceFile */) { // Import declaration of another module that is visited async so lets put it in right spot asynchronousSubModuleDeclarationEmitInfo.push({ node: node, @@ -58301,7 +62747,7 @@ var ts; }); } else { - if (node.kind === 235 /* ImportDeclaration */) { + if (node.kind === 237 /* ImportDeclaration */) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -58319,23 +62765,23 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: return writeFunctionDeclaration(node); - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: return writeVariableStatement(node); - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: return writeInterfaceDeclaration(node); - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: return writeClassDeclaration(node); - case 228 /* TypeAliasDeclaration */: + case 230 /* TypeAliasDeclaration */: return writeTypeAliasDeclaration(node); - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: return writeEnumDeclaration(node); - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: return writeModuleDeclaration(node); - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: return writeImportEqualsDeclaration(node); - case 235 /* ImportDeclaration */: + case 237 /* ImportDeclaration */: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); @@ -58343,7 +62789,7 @@ var ts; } function emitModuleElementDeclarationFlags(node) { // If the node is parented in the current source file we need to emit export declare or just export - if (node.parent.kind === 261 /* SourceFile */) { + if (node.parent.kind === 264 /* SourceFile */) { var modifiers = ts.getModifierFlags(node); // If the node is exported if (modifiers & 1 /* Export */) { @@ -58352,7 +62798,7 @@ var ts; if (modifiers & 512 /* Default */) { write("default "); } - else if (node.kind !== 227 /* InterfaceDeclaration */ && !noDeclare) { + else if (node.kind !== 229 /* InterfaceDeclaration */ && !noDeclare) { write("declare "); } } @@ -58404,7 +62850,7 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 237 /* NamespaceImport */) { + if (namedBindings.kind === 239 /* NamespaceImport */) { return resolver.isDeclarationVisible(namedBindings); } else { @@ -58428,7 +62874,7 @@ var ts; // If the default binding was emitted, write the separated write(", "); } - if (node.importClause.namedBindings.kind === 237 /* NamespaceImport */) { + if (node.importClause.namedBindings.kind === 239 /* NamespaceImport */) { write("* as "); writeTextOfNode(currentText, node.importClause.namedBindings.name); } @@ -58449,13 +62895,13 @@ var ts; // the only case when it is not true is when we call it to emit correct name for module augmentation - d.ts files with just module augmentations are not considered // external modules since they are indistinguishable from script files with ambient modules. To fix this in such d.ts files we'll emit top level 'export {}' // so compiler will treat them as external modules. - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 230 /* ModuleDeclaration */; + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 232 /* ModuleDeclaration */; var moduleSpecifier; - if (parent.kind === 234 /* ImportEqualsDeclaration */) { + if (parent.kind === 236 /* ImportEqualsDeclaration */) { var node = parent; moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node); } - else if (parent.kind === 230 /* ModuleDeclaration */) { + else if (parent.kind === 232 /* ModuleDeclaration */) { moduleSpecifier = parent.name; } else { @@ -58525,7 +62971,7 @@ var ts; writeTextOfNode(currentText, node.name); } } - while (node.body && node.body.kind !== 231 /* ModuleBlock */) { + while (node.body && node.body.kind !== 233 /* ModuleBlock */) { node = node.body; write("."); writeTextOfNode(currentText, node.name); @@ -58595,7 +63041,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 149 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); + return node.parent.kind === 150 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -58606,53 +63052,70 @@ var ts; // If there is constraint present and this is not a type parameter of the private method emit the constraint if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 158 /* FunctionType */ || - node.parent.kind === 159 /* ConstructorType */ || - (node.parent.parent && node.parent.parent.kind === 161 /* TypeLiteral */)) { - ts.Debug.assert(node.parent.kind === 149 /* MethodDeclaration */ || - node.parent.kind === 148 /* MethodSignature */ || - node.parent.kind === 158 /* FunctionType */ || - node.parent.kind === 159 /* ConstructorType */ || - node.parent.kind === 153 /* CallSignature */ || - node.parent.kind === 154 /* ConstructSignature */); + if (node.parent.kind === 159 /* FunctionType */ || + node.parent.kind === 160 /* ConstructorType */ || + (node.parent.parent && node.parent.parent.kind === 162 /* TypeLiteral */)) { + ts.Debug.assert(node.parent.kind === 150 /* MethodDeclaration */ || + node.parent.kind === 149 /* MethodSignature */ || + node.parent.kind === 159 /* FunctionType */ || + node.parent.kind === 160 /* ConstructorType */ || + node.parent.kind === 154 /* CallSignature */ || + node.parent.kind === 155 /* ConstructSignature */); emitType(node.constraint); } else { emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.constraint, getTypeParameterConstraintVisibilityError); } } + if (node.default && !isPrivateMethodTypeParameter(node)) { + write(" = "); + if (node.parent.kind === 159 /* FunctionType */ || + node.parent.kind === 160 /* ConstructorType */ || + (node.parent.parent && node.parent.parent.kind === 162 /* TypeLiteral */)) { + ts.Debug.assert(node.parent.kind === 150 /* MethodDeclaration */ || + node.parent.kind === 149 /* MethodSignature */ || + node.parent.kind === 159 /* FunctionType */ || + node.parent.kind === 160 /* ConstructorType */ || + node.parent.kind === 154 /* CallSignature */ || + node.parent.kind === 155 /* ConstructSignature */); + emitType(node.default); + } + else { + emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.default, getTypeParameterConstraintVisibilityError); + } + } function getTypeParameterConstraintVisibilityError() { // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 154 /* ConstructSignature */: + case 155 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 153 /* CallSignature */: + case 154 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 226 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 228 /* ClassDeclaration */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 228 /* TypeAliasDeclaration */: + case 230 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -58671,7 +63134,7 @@ var ts; write(">"); } } - function emitHeritageClause(typeReferences, isImplementsList) { + function emitHeritageClause(className, typeReferences, isImplementsList) { if (typeReferences) { write(isImplementsList ? " implements " : " extends "); emitCommaList(typeReferences, emitTypeOfTypeReference); @@ -58685,20 +63148,22 @@ var ts; } else { writer.getSymbolAccessibilityDiagnostic = getHeritageClauseVisibilityError; + errorNameNode = className; resolver.writeBaseConstructorTypeOfClass(enclosingDeclaration, enclosingDeclaration, 2 /* UseTypeOfFunction */ | 1024 /* UseTypeAliasValue */, writer); + errorNameNode = undefined; } function getHeritageClauseVisibilityError() { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 226 /* ClassDeclaration */) { + if (node.parent.parent.kind === 228 /* ClassDeclaration */) { // Class or Interface implemented/extended is inaccessible diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : - ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; + ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1; } else { // interface is inaccessible - diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; + diagnosticMessage = ts.Diagnostics.extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; } return { diagnosticMessage: diagnosticMessage, @@ -58730,9 +63195,10 @@ var ts; emitTypeParameters(node.typeParameters); var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { - emitHeritageClause([baseTypeNode], /*isImplementsList*/ false); + node.name; + emitHeritageClause(node.name, [baseTypeNode], /*isImplementsList*/ false); } - emitHeritageClause(ts.getClassImplementsHeritageClauseElements(node), /*isImplementsList*/ true); + emitHeritageClause(node.name, ts.getClassImplementsHeritageClauseElements(node), /*isImplementsList*/ true); write(" {"); writeLine(); increaseIndent(); @@ -58753,7 +63219,7 @@ var ts; emitTypeParameters(node.typeParameters); var interfaceExtendsTypes = ts.filter(ts.getInterfaceBaseTypeNodes(node), function (base) { return ts.isEntityNameExpression(base.expression); }); if (interfaceExtendsTypes && interfaceExtendsTypes.length) { - emitHeritageClause(interfaceExtendsTypes, /*isImplementsList*/ false); + emitHeritageClause(node.name, interfaceExtendsTypes, /*isImplementsList*/ false); } write(" {"); writeLine(); @@ -58777,7 +63243,7 @@ var ts; function emitVariableDeclaration(node) { // If we are emitting property it isn't moduleElement and hence we already know it needs to be emitted // so there is no check needed to see if declaration is visible - if (node.kind !== 223 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { + if (node.kind !== 225 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } @@ -58788,11 +63254,11 @@ var ts; writeTextOfNode(currentText, node.name); // If optional property emit ? but in the case of parameterProperty declaration with "?" indicating optional parameter for the constructor // we don't want to emit property declaration with "?" - if ((node.kind === 147 /* PropertyDeclaration */ || node.kind === 146 /* PropertySignature */ || - (node.kind === 144 /* Parameter */ && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { + if ((node.kind === 148 /* PropertyDeclaration */ || node.kind === 147 /* PropertySignature */ || + (node.kind === 145 /* Parameter */ && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { write("?"); } - if ((node.kind === 147 /* PropertyDeclaration */ || node.kind === 146 /* PropertySignature */) && node.parent.kind === 161 /* TypeLiteral */) { + if ((node.kind === 148 /* PropertyDeclaration */ || node.kind === 147 /* PropertySignature */) && node.parent.kind === 162 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (resolver.isLiteralConstDeclaration(node)) { @@ -58805,14 +63271,14 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 223 /* VariableDeclaration */) { + if (node.kind === 225 /* VariableDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 147 /* PropertyDeclaration */ || node.kind === 146 /* PropertySignature */) { + else if (node.kind === 148 /* PropertyDeclaration */ || node.kind === 147 /* PropertySignature */) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -58821,7 +63287,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 226 /* ClassDeclaration */) { + else if (node.parent.kind === 228 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -58853,7 +63319,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 198 /* OmittedExpression */) { + if (element.kind !== 199 /* OmittedExpression */) { elements.push(element); } } @@ -58923,7 +63389,7 @@ var ts; var type = getTypeAnnotationFromAccessor(node); if (!type) { // couldn't get type for the first accessor, try the another one - var anotherAccessor = node.kind === 151 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 152 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -58936,7 +63402,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 151 /* GetAccessor */ + return accessor.kind === 152 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -58945,7 +63411,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 152 /* SetAccessor */) { + if (accessorWithTypeAnnotation.kind === 153 /* SetAccessor */) { // Setters have to have type named and cannot infer it so, the type should always be named if (ts.hasModifier(accessorWithTypeAnnotation.parent, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? @@ -58995,17 +63461,17 @@ var ts; // so no need to verify if the declaration is visible if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 225 /* FunctionDeclaration */) { + if (node.kind === 227 /* FunctionDeclaration */) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 149 /* MethodDeclaration */ || node.kind === 150 /* Constructor */) { + else if (node.kind === 150 /* MethodDeclaration */ || node.kind === 151 /* Constructor */) { emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); } - if (node.kind === 225 /* FunctionDeclaration */) { + if (node.kind === 227 /* FunctionDeclaration */) { write("function "); writeTextOfNode(currentText, node.name); } - else if (node.kind === 150 /* Constructor */) { + else if (node.kind === 151 /* Constructor */) { write("constructor"); } else { @@ -59025,17 +63491,17 @@ var ts; var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; var closeParenthesizedFunctionType = false; - if (node.kind === 155 /* IndexSignature */) { + if (node.kind === 156 /* IndexSignature */) { // Index signature can have readonly modifier emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); write("["); } else { // Construct signature or constructor type write new Signature - if (node.kind === 154 /* ConstructSignature */ || node.kind === 159 /* ConstructorType */) { + if (node.kind === 155 /* ConstructSignature */ || node.kind === 160 /* ConstructorType */) { write("new "); } - else if (node.kind === 158 /* FunctionType */) { + else if (node.kind === 159 /* FunctionType */) { var currentOutput = writer.getText(); // Do not generate incorrect type when function type with type parameters is type argument // This could happen if user used space between two '<' making it error free @@ -59050,22 +63516,22 @@ var ts; } // Parameters emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 155 /* IndexSignature */) { + if (node.kind === 156 /* IndexSignature */) { write("]"); } else { write(")"); } // If this is not a constructor and is not private, emit the return type - var isFunctionTypeOrConstructorType = node.kind === 158 /* FunctionType */ || node.kind === 159 /* ConstructorType */; - if (isFunctionTypeOrConstructorType || node.parent.kind === 161 /* TypeLiteral */) { + var isFunctionTypeOrConstructorType = node.kind === 159 /* FunctionType */ || node.kind === 160 /* ConstructorType */; + if (isFunctionTypeOrConstructorType || node.parent.kind === 162 /* TypeLiteral */) { // Emit type literal signature return type only if specified if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 150 /* Constructor */ && !ts.hasModifier(node, 8 /* Private */)) { + else if (node.kind !== 151 /* Constructor */ && !ts.hasModifier(node, 8 /* Private */)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -59079,26 +63545,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 154 /* ConstructSignature */: + case 155 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 153 /* CallSignature */: + case 154 /* CallSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 155 /* IndexSignature */: + case 156 /* IndexSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: if (ts.hasModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -59106,7 +63572,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 226 /* ClassDeclaration */) { + else if (node.parent.kind === 228 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -59120,7 +63586,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -59155,9 +63621,9 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 158 /* FunctionType */ || - node.parent.kind === 159 /* ConstructorType */ || - node.parent.parent.kind === 161 /* TypeLiteral */) { + if (node.parent.kind === 159 /* FunctionType */ || + node.parent.kind === 160 /* ConstructorType */ || + node.parent.parent.kind === 162 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!ts.hasModifier(node.parent, 8 /* Private */)) { @@ -59173,24 +63639,29 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 150 /* Constructor */: + case 151 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 154 /* ConstructSignature */: + case 155 /* ConstructSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 153 /* CallSignature */: + case 154 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 156 /* IndexSignature */: + // Interfaces cannot have parameter types that cannot be named + return symbolAccessibilityResult.errorModuleName ? + ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : + ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -59198,7 +63669,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 226 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 228 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -59211,7 +63682,7 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -59223,12 +63694,12 @@ var ts; } function emitBindingPattern(bindingPattern) { // We have to explicitly emit square bracket and bracket because these tokens are not store inside the node. - if (bindingPattern.kind === 172 /* ObjectBindingPattern */) { + if (bindingPattern.kind === 173 /* ObjectBindingPattern */) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 173 /* ArrayBindingPattern */) { + else if (bindingPattern.kind === 174 /* ArrayBindingPattern */) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -59239,7 +63710,7 @@ var ts; } } function emitBindingElement(bindingElement) { - if (bindingElement.kind === 198 /* OmittedExpression */) { + if (bindingElement.kind === 199 /* OmittedExpression */) { // If bindingElement is an omittedExpression (i.e. containing elision), // we will emit blank space (although this may differ from users' original code, // it allows emitSeparatedList to write separator appropriately) @@ -59248,7 +63719,7 @@ var ts; // emit : function foo([ , x, , ]) {} write(" "); } - else if (bindingElement.kind === 174 /* BindingElement */) { + else if (bindingElement.kind === 175 /* BindingElement */) { if (bindingElement.propertyName) { // bindingElement has propertyName property in the following case: // { y: [a,b,c] ...} -> bindingPattern will have a property called propertyName for "y" @@ -59287,40 +63758,40 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 225 /* FunctionDeclaration */: - case 230 /* ModuleDeclaration */: - case 234 /* ImportEqualsDeclaration */: - case 227 /* InterfaceDeclaration */: - case 226 /* ClassDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 229 /* EnumDeclaration */: + case 227 /* FunctionDeclaration */: + case 232 /* ModuleDeclaration */: + case 236 /* ImportEqualsDeclaration */: + case 229 /* InterfaceDeclaration */: + case 228 /* ClassDeclaration */: + case 230 /* TypeAliasDeclaration */: + case 231 /* EnumDeclaration */: return emitModuleElement(node, isModuleElementVisible(node)); - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: return emitModuleElement(node, isVariableStatementVisible(node)); - case 235 /* ImportDeclaration */: + case 237 /* ImportDeclaration */: // Import declaration without import clause is visible, otherwise it is not visible return emitModuleElement(node, /*isModuleElementVisible*/ !node.importClause); - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: return emitExportDeclaration(node); - case 150 /* Constructor */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 151 /* Constructor */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: return writeFunctionDeclaration(node); - case 154 /* ConstructSignature */: - case 153 /* CallSignature */: - case 155 /* IndexSignature */: + case 155 /* ConstructSignature */: + case 154 /* CallSignature */: + case 156 /* IndexSignature */: return emitSignatureDeclarationWithJsDocComments(node); - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: return emitAccessorDeclaration(node); - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: return emitPropertyDeclaration(node); - case 260 /* EnumMember */: + case 263 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: return emitExportAssignment(node); - case 261 /* SourceFile */: + case 264 /* SourceFile */: return emitSourceFile(node); } } @@ -59338,7 +63809,7 @@ var ts; } else { // Get the declaration file path - ts.forEachExpectedEmitFile(host, getDeclFileName, referencedFile, emitOnlyDtsFiles); + ts.forEachEmittedFile(host, getDeclFileName, referencedFile, emitOnlyDtsFiles); } if (declFileName) { declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(declarationFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, @@ -59346,8 +63817,9 @@ var ts; referencesOutput += "/// " + newLine; } return addedBundledEmitReference; - function getDeclFileName(emitFileNames, _sourceFiles, isBundledEmit) { + function getDeclFileName(emitFileNames, sourceFileOrBundle) { // Dont add reference path to this file if it is a bundled emit and caller asked not emit bundled file path + var isBundledEmit = sourceFileOrBundle.kind === 265 /* Bundle */; if (isBundledEmit && !addBundledFileReference) { return; } @@ -59358,10 +63830,11 @@ var ts; } } /* @internal */ - function writeDeclarationFile(declarationFilePath, sourceFiles, isBundledEmit, host, resolver, emitterDiagnostics, emitOnlyDtsFiles) { - var emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFiles, isBundledEmit, emitOnlyDtsFiles); + function writeDeclarationFile(declarationFilePath, sourceFileOrBundle, host, resolver, emitterDiagnostics, emitOnlyDtsFiles) { + var emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles); var emitSkipped = emitDeclarationResult.reportedDeclarationError || host.isEmitBlocked(declarationFilePath) || host.getCompilerOptions().noEmit; if (!emitSkipped) { + var sourceFiles = sourceFileOrBundle.kind === 265 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; var declarationOutput = emitDeclarationResult.referencesOutput + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); ts.writeFile(host, emitterDiagnostics, declarationFilePath, declarationOutput, host.getCompilerOptions().emitBOM, sourceFiles); @@ -59384,83 +63857,73 @@ var ts; } ts.writeDeclarationFile = writeDeclarationFile; })(ts || (ts = {})); -/// +/// /// -/// -/// +/// +/// /// -/* @internal */ var ts; (function (ts) { - // Flags enum to track count of temp variables and a few dedicated names - var TempFlags; - (function (TempFlags) { - TempFlags[TempFlags["Auto"] = 0] = "Auto"; - TempFlags[TempFlags["CountMask"] = 268435455] = "CountMask"; - TempFlags[TempFlags["_i"] = 268435456] = "_i"; - })(TempFlags || (TempFlags = {})); - var id = function (s) { return s; }; - var nullTransformers = [function (_) { return id; }]; + var delimiters = createDelimiterMap(); + var brackets = createBracketsMap(); + /*@internal*/ // targetSourceFile is when users only want one file in entire project to be emitted. This is used in compileOnSave feature - function emitFiles(resolver, host, targetSourceFile, emitOnlyDtsFiles) { - var delimiters = createDelimiterMap(); - var brackets = createBracketsMap(); + function emitFiles(resolver, host, targetSourceFile, emitOnlyDtsFiles, transformers) { var compilerOptions = host.getCompilerOptions(); - var languageVersion = ts.getEmitScriptTarget(compilerOptions); var moduleKind = ts.getEmitModuleKind(compilerOptions); var sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? [] : undefined; var emittedFilesList = compilerOptions.listEmittedFiles ? [] : undefined; var emitterDiagnostics = ts.createDiagnosticCollection(); var newLine = host.getNewLine(); - var transformers = emitOnlyDtsFiles ? nullTransformers : ts.getTransformers(compilerOptions); var writer = ts.createTextWriter(newLine); - var write = writer.write, writeLine = writer.writeLine, increaseIndent = writer.increaseIndent, decreaseIndent = writer.decreaseIndent; var sourceMap = ts.createSourceMapWriter(host, writer); - var emitNodeWithSourceMap = sourceMap.emitNodeWithSourceMap, emitTokenWithSourceMap = sourceMap.emitTokenWithSourceMap; - var comments = ts.createCommentWriter(host, writer, sourceMap); - var emitNodeWithComments = comments.emitNodeWithComments, emitBodyWithDetachedComments = comments.emitBodyWithDetachedComments, emitTrailingCommentsOfPosition = comments.emitTrailingCommentsOfPosition; - var nodeIdToGeneratedName; - var autoGeneratedIdToGeneratedName; - var generatedNameSet; - var tempFlags; var currentSourceFile; - var currentText; - var currentFileIdentifiers; var bundledHelpers; var isOwnFileEmit; var emitSkipped = false; var sourceFiles = ts.getSourceFilesToEmit(host, targetSourceFile); // Transform the source files - ts.performance.mark("beforeTransform"); - var _a = ts.transformFiles(resolver, host, sourceFiles, transformers), transformed = _a.transformed, emitNodeWithSubstitution = _a.emitNodeWithSubstitution, emitNodeWithNotification = _a.emitNodeWithNotification; - ts.performance.measure("transformTime", "beforeTransform"); + var transform = ts.transformNodes(resolver, host, compilerOptions, sourceFiles, transformers, /*allowDtsFiles*/ false); + // Create a printer to print the nodes + var printer = createPrinter(compilerOptions, { + // resolver hooks + hasGlobalName: resolver.hasGlobalName, + // transform hooks + onEmitNode: transform.emitNodeWithNotification, + substituteNode: transform.substituteNode, + // sourcemap hooks + onEmitSourceMapOfNode: sourceMap.emitNodeWithSourceMap, + onEmitSourceMapOfToken: sourceMap.emitTokenWithSourceMap, + onEmitSourceMapOfPosition: sourceMap.emitPos, + // emitter hooks + onEmitHelpers: emitHelpers, + onSetSourceFile: setSourceFile, + }); // Emit each output file ts.performance.mark("beforePrint"); - ts.forEachTransformedEmitFile(host, transformed, emitFile, emitOnlyDtsFiles); + ts.forEachEmittedFile(host, emitSourceFileOrBundle, transform.transformed, emitOnlyDtsFiles); ts.performance.measure("printTime", "beforePrint"); // Clean up emit nodes on parse tree - for (var _b = 0, sourceFiles_4 = sourceFiles; _b < sourceFiles_4.length; _b++) { - var sourceFile = sourceFiles_4[_b]; - ts.disposeEmitNodes(sourceFile); - } + transform.dispose(); return { emitSkipped: emitSkipped, diagnostics: emitterDiagnostics.getDiagnostics(), emittedFiles: emittedFilesList, sourceMaps: sourceMapDataList }; - function emitFile(jsFilePath, sourceMapFilePath, declarationFilePath, sourceFiles, isBundledEmit) { + function emitSourceFileOrBundle(_a, sourceFileOrBundle) { + var jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath; // Make sure not to write js file and source map file if any of them cannot be written if (!host.isEmitBlocked(jsFilePath) && !compilerOptions.noEmit) { if (!emitOnlyDtsFiles) { - printFile(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit); + printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle); } } else { emitSkipped = true; } if (declarationFilePath) { - emitSkipped = ts.writeDeclarationFile(declarationFilePath, ts.getOriginalSourceFiles(sourceFiles), isBundledEmit, host, resolver, emitterDiagnostics, emitOnlyDtsFiles) || emitSkipped; + emitSkipped = ts.writeDeclarationFile(declarationFilePath, ts.getOriginalSourceFileOrBundle(sourceFileOrBundle), host, resolver, emitterDiagnostics, emitOnlyDtsFiles) || emitSkipped; } if (!emitSkipped && emittedFilesList) { if (!emitOnlyDtsFiles) { @@ -59474,26 +63937,24 @@ var ts; } } } - function printFile(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit) { - sourceMap.initialize(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit); - nodeIdToGeneratedName = []; - autoGeneratedIdToGeneratedName = []; - generatedNameSet = ts.createMap(); - bundledHelpers = isBundledEmit ? ts.createMap() : undefined; - isOwnFileEmit = !isBundledEmit; - // Emit helpers from all the files - if (isBundledEmit && moduleKind) { - for (var _a = 0, sourceFiles_5 = sourceFiles; _a < sourceFiles_5.length; _a++) { - var sourceFile = sourceFiles_5[_a]; - emitHelpers(sourceFile, /*isBundle*/ true); - } + function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle) { + var bundle = sourceFileOrBundle.kind === 265 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 264 /* SourceFile */ ? sourceFileOrBundle : undefined; + var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; + sourceMap.initialize(jsFilePath, sourceMapFilePath, sourceFileOrBundle); + if (bundle) { + bundledHelpers = ts.createMap(); + isOwnFileEmit = false; + printer.writeBundle(bundle, writer); } - // Print each transformed source file. - ts.forEach(sourceFiles, printSourceFile); - writeLine(); + else { + isOwnFileEmit = true; + printer.writeFile(sourceFile, writer); + } + writer.writeLine(); var sourceMappingURL = sourceMap.getSourceMappingURL(); if (sourceMappingURL) { - write("//# " + "sourceMappingURL" + "=" + sourceMappingURL); // Sometimes tools can sometimes see this line as a source mapping url comment + writer.write("//# " + "sourceMappingURL" + "=" + sourceMappingURL); // Sometimes tools can sometimes see this line as a source mapping url comment } // Write the source map if (compilerOptions.sourceMap && !compilerOptions.inlineSourceMap) { @@ -59507,138 +63968,232 @@ var ts; ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), compilerOptions.emitBOM, sourceFiles); // Reset state sourceMap.reset(); - comments.reset(); writer.reset(); - tempFlags = 0 /* Auto */; currentSourceFile = undefined; - currentText = undefined; + bundledHelpers = undefined; isOwnFileEmit = false; } - function printSourceFile(node) { + function setSourceFile(node) { currentSourceFile = node; - currentText = node.text; - currentFileIdentifiers = node.identifiers; sourceMap.setSourceFile(node); - comments.setSourceFile(node); - pipelineEmitWithNotification(0 /* SourceFile */, node); } - /** - * Emits a node. - */ + function emitHelpers(node, writeLines) { + var helpersEmitted = false; + var bundle = node.kind === 265 /* Bundle */ ? node : undefined; + if (bundle && moduleKind === ts.ModuleKind.None) { + return; + } + var numNodes = bundle ? bundle.sourceFiles.length : 1; + for (var i = 0; i < numNodes; i++) { + var currentNode = bundle ? bundle.sourceFiles[i] : node; + var sourceFile = ts.isSourceFile(currentNode) ? currentNode : currentSourceFile; + var shouldSkip = compilerOptions.noEmitHelpers || (sourceFile && ts.getExternalHelpersModuleName(sourceFile) !== undefined); + var shouldBundle = ts.isSourceFile(currentNode) && !isOwnFileEmit; + var helpers = ts.getEmitHelpers(currentNode); + if (helpers) { + for (var _a = 0, _b = ts.stableSort(helpers, ts.compareEmitHelpers); _a < _b.length; _a++) { + var helper = _b[_a]; + if (!helper.scoped) { + // Skip the helper if it can be skipped and the noEmitHelpers compiler + // option is set, or if it can be imported and the importHelpers compiler + // option is set. + if (shouldSkip) + continue; + // Skip the helper if it can be bundled but hasn't already been emitted and we + // are emitting a bundled module. + if (shouldBundle) { + if (bundledHelpers.get(helper.name)) { + continue; + } + bundledHelpers.set(helper.name, true); + } + } + else if (bundle) { + // Skip the helper if it is scoped and we are emitting bundled helpers + continue; + } + writeLines(helper.text); + helpersEmitted = true; + } + } + } + return helpersEmitted; + } + } + ts.emitFiles = emitFiles; + function createPrinter(printerOptions, handlers) { + if (printerOptions === void 0) { printerOptions = {}; } + if (handlers === void 0) { handlers = {}; } + var hasGlobalName = handlers.hasGlobalName, onEmitSourceMapOfNode = handlers.onEmitSourceMapOfNode, onEmitSourceMapOfToken = handlers.onEmitSourceMapOfToken, onEmitSourceMapOfPosition = handlers.onEmitSourceMapOfPosition, onEmitNode = handlers.onEmitNode, onEmitHelpers = handlers.onEmitHelpers, onSetSourceFile = handlers.onSetSourceFile, substituteNode = handlers.substituteNode, onBeforeEmitNodeArray = handlers.onBeforeEmitNodeArray, onAfterEmitNodeArray = handlers.onAfterEmitNodeArray; + var newLine = ts.getNewLineCharacter(printerOptions); + var comments = ts.createCommentWriter(printerOptions, onEmitSourceMapOfPosition); + var emitNodeWithComments = comments.emitNodeWithComments, emitBodyWithDetachedComments = comments.emitBodyWithDetachedComments, emitTrailingCommentsOfPosition = comments.emitTrailingCommentsOfPosition, emitLeadingCommentsOfPosition = comments.emitLeadingCommentsOfPosition; + var currentSourceFile; + var nodeIdToGeneratedName; // Map of generated names for specific nodes. + var autoGeneratedIdToGeneratedName; // Map of generated names for temp and loop variables. + var generatedNames; // Set of names generated by the NameGenerator. + var tempFlagsStack; // Stack of enclosing name generation scopes. + var tempFlags; // TempFlags for the current name generation scope. + var writer; + var ownWriter; + reset(); + return { + // public API + printNode: printNode, + printFile: printFile, + printBundle: printBundle, + // internal API + writeNode: writeNode, + writeFile: writeFile, + writeBundle: writeBundle + }; + function printNode(hint, node, sourceFile) { + switch (hint) { + case 0 /* SourceFile */: + ts.Debug.assert(ts.isSourceFile(node), "Expected a SourceFile node."); + break; + case 2 /* IdentifierName */: + ts.Debug.assert(ts.isIdentifier(node), "Expected an Identifier node."); + break; + case 1 /* Expression */: + ts.Debug.assert(ts.isExpression(node), "Expected an Expression node."); + break; + } + switch (node.kind) { + case 264 /* SourceFile */: return printFile(node); + case 265 /* Bundle */: return printBundle(node); + } + writeNode(hint, node, sourceFile, beginPrint()); + return endPrint(); + } + function printBundle(bundle) { + writeBundle(bundle, beginPrint()); + return endPrint(); + } + function printFile(sourceFile) { + writeFile(sourceFile, beginPrint()); + return endPrint(); + } + function writeNode(hint, node, sourceFile, output) { + var previousWriter = writer; + setWriter(output); + print(hint, node, sourceFile); + reset(); + writer = previousWriter; + } + function writeBundle(bundle, output) { + var previousWriter = writer; + setWriter(output); + emitShebangIfNeeded(bundle); + emitPrologueDirectivesIfNeeded(bundle); + emitHelpersIndirect(bundle); + for (var _a = 0, _b = bundle.sourceFiles; _a < _b.length; _a++) { + var sourceFile = _b[_a]; + print(0 /* SourceFile */, sourceFile, sourceFile); + } + reset(); + writer = previousWriter; + } + function writeFile(sourceFile, output) { + var previousWriter = writer; + setWriter(output); + emitShebangIfNeeded(sourceFile); + emitPrologueDirectivesIfNeeded(sourceFile); + print(0 /* SourceFile */, sourceFile, sourceFile); + reset(); + writer = previousWriter; + } + function beginPrint() { + return ownWriter || (ownWriter = ts.createTextWriter(newLine)); + } + function endPrint() { + var text = ownWriter.getText(); + ownWriter.reset(); + return text; + } + function print(hint, node, sourceFile) { + setSourceFile(sourceFile); + pipelineEmitWithNotification(hint, node); + } + function setSourceFile(sourceFile) { + currentSourceFile = sourceFile; + comments.setSourceFile(sourceFile); + if (onSetSourceFile) { + onSetSourceFile(sourceFile); + } + } + function setWriter(output) { + writer = output; + comments.setWriter(output); + } + function reset() { + nodeIdToGeneratedName = []; + autoGeneratedIdToGeneratedName = []; + generatedNames = ts.createMap(); + tempFlagsStack = []; + tempFlags = 0 /* Auto */; + comments.reset(); + setWriter(/*output*/ undefined); + } function emit(node) { pipelineEmitWithNotification(3 /* Unspecified */, node); } - /** - * Emits an IdentifierName. - */ function emitIdentifierName(node) { pipelineEmitWithNotification(2 /* IdentifierName */, node); } - /** - * Emits an expression node. - */ function emitExpression(node) { pipelineEmitWithNotification(1 /* Expression */, node); } - /** - * Emits a node with possible notification. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called from printSourceFile, emit, emitExpression, or - * emitIdentifierName. - */ - function pipelineEmitWithNotification(emitContext, node) { - emitNodeWithNotification(emitContext, node, pipelineEmitWithComments); + function pipelineEmitWithNotification(hint, node) { + if (onEmitNode) { + onEmitNode(hint, node, pipelineEmitWithComments); + } + else { + pipelineEmitWithComments(hint, node); + } } - /** - * Emits a node with comments. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitWithNotification. - */ - function pipelineEmitWithComments(emitContext, node) { - // Do not emit comments for SourceFile - if (emitContext === 0 /* SourceFile */) { - pipelineEmitWithSourceMap(emitContext, node); + function pipelineEmitWithComments(hint, node) { + node = trySubstituteNode(hint, node); + if (emitNodeWithComments && hint !== 0 /* SourceFile */) { + emitNodeWithComments(hint, node, pipelineEmitWithSourceMap); + } + else { + pipelineEmitWithSourceMap(hint, node); + } + } + function pipelineEmitWithSourceMap(hint, node) { + if (onEmitSourceMapOfNode && hint !== 0 /* SourceFile */ && hint !== 2 /* IdentifierName */) { + onEmitSourceMapOfNode(hint, node, pipelineEmitWithHint); + } + else { + pipelineEmitWithHint(hint, node); + } + } + function pipelineEmitWithHint(hint, node) { + switch (hint) { + case 0 /* SourceFile */: return pipelineEmitSourceFile(node); + case 2 /* IdentifierName */: return pipelineEmitIdentifierName(node); + case 1 /* Expression */: return pipelineEmitExpression(node); + case 3 /* Unspecified */: return pipelineEmitUnspecified(node); + } + } + function pipelineEmitSourceFile(node) { + ts.Debug.assertNode(node, ts.isSourceFile); + emitSourceFile(node); + } + function pipelineEmitIdentifierName(node) { + ts.Debug.assertNode(node, ts.isIdentifier); + emitIdentifier(node); + } + function pipelineEmitUnspecified(node) { + var kind = node.kind; + // Reserved words + // Strict mode reserved words + // Contextual keywords + if (ts.isKeyword(kind)) { + writeTokenText(kind); return; } - emitNodeWithComments(emitContext, node, pipelineEmitWithSourceMap); - } - /** - * Emits a node with source maps. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitWithComments. - */ - function pipelineEmitWithSourceMap(emitContext, node) { - // Do not emit source mappings for SourceFile or IdentifierName - if (emitContext === 0 /* SourceFile */ - || emitContext === 2 /* IdentifierName */) { - pipelineEmitWithSubstitution(emitContext, node); - return; - } - emitNodeWithSourceMap(emitContext, node, pipelineEmitWithSubstitution); - } - /** - * Emits a node with possible substitution. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitWithSourceMap or - * pipelineEmitInUnspecifiedContext (when picking a more specific context). - */ - function pipelineEmitWithSubstitution(emitContext, node) { - emitNodeWithSubstitution(emitContext, node, pipelineEmitForContext); - } - /** - * Emits a node. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitWithSubstitution. - */ - function pipelineEmitForContext(emitContext, node) { - switch (emitContext) { - case 0 /* SourceFile */: return pipelineEmitInSourceFileContext(node); - case 2 /* IdentifierName */: return pipelineEmitInIdentifierNameContext(node); - case 3 /* Unspecified */: return pipelineEmitInUnspecifiedContext(node); - case 1 /* Expression */: return pipelineEmitInExpressionContext(node); - } - } - /** - * Emits a node in the SourceFile EmitContext. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitForContext. - */ - function pipelineEmitInSourceFileContext(node) { - var kind = node.kind; - switch (kind) { - // Top-level nodes - case 261 /* SourceFile */: - return emitSourceFile(node); - } - } - /** - * Emits a node in the IdentifierName EmitContext. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitForContext. - */ - function pipelineEmitInIdentifierNameContext(node) { - var kind = node.kind; - switch (kind) { - // Identifiers - case 70 /* Identifier */: - return emitIdentifier(node); - } - } - /** - * Emits a node in the Unspecified EmitContext. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitForContext. - */ - function pipelineEmitInUnspecifiedContext(node) { - var kind = node.kind; switch (kind) { // Pseudo-literals case 13 /* TemplateHead */: @@ -59648,254 +64203,217 @@ var ts; // Identifiers case 70 /* Identifier */: return emitIdentifier(node); - // Reserved words - case 75 /* ConstKeyword */: - case 78 /* DefaultKeyword */: - case 83 /* ExportKeyword */: - case 104 /* VoidKeyword */: - // Strict mode reserved words - case 111 /* PrivateKeyword */: - case 112 /* ProtectedKeyword */: - case 113 /* PublicKeyword */: - case 114 /* StaticKeyword */: - // Contextual keywords - case 116 /* AbstractKeyword */: - case 117 /* AsKeyword */: - case 118 /* AnyKeyword */: - case 119 /* AsyncKeyword */: - case 120 /* AwaitKeyword */: - case 121 /* BooleanKeyword */: - case 122 /* ConstructorKeyword */: - case 123 /* DeclareKeyword */: - case 124 /* GetKeyword */: - case 125 /* IsKeyword */: - case 127 /* ModuleKeyword */: - case 128 /* NamespaceKeyword */: - case 129 /* NeverKeyword */: - case 130 /* ReadonlyKeyword */: - case 131 /* RequireKeyword */: - case 132 /* NumberKeyword */: - case 133 /* SetKeyword */: - case 134 /* StringKeyword */: - case 135 /* SymbolKeyword */: - case 136 /* TypeKeyword */: - case 137 /* UndefinedKeyword */: - case 138 /* FromKeyword */: - case 139 /* GlobalKeyword */: - case 140 /* OfKeyword */: - writeTokenText(kind); - return; // Parse tree nodes // Names - case 141 /* QualifiedName */: + case 142 /* QualifiedName */: return emitQualifiedName(node); - case 142 /* ComputedPropertyName */: + case 143 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 143 /* TypeParameter */: + case 144 /* TypeParameter */: return emitTypeParameter(node); - case 144 /* Parameter */: + case 145 /* Parameter */: return emitParameter(node); - case 145 /* Decorator */: + case 146 /* Decorator */: return emitDecorator(node); // Type members - case 146 /* PropertySignature */: + case 147 /* PropertySignature */: return emitPropertySignature(node); - case 147 /* PropertyDeclaration */: + case 148 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 148 /* MethodSignature */: + case 149 /* MethodSignature */: return emitMethodSignature(node); - case 149 /* MethodDeclaration */: + case 150 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 150 /* Constructor */: + case 151 /* Constructor */: return emitConstructor(node); - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: return emitAccessorDeclaration(node); - case 153 /* CallSignature */: + case 154 /* CallSignature */: return emitCallSignature(node); - case 154 /* ConstructSignature */: + case 155 /* ConstructSignature */: return emitConstructSignature(node); - case 155 /* IndexSignature */: + case 156 /* IndexSignature */: return emitIndexSignature(node); // Types - case 156 /* TypePredicate */: + case 157 /* TypePredicate */: return emitTypePredicate(node); - case 157 /* TypeReference */: + case 158 /* TypeReference */: return emitTypeReference(node); - case 158 /* FunctionType */: + case 159 /* FunctionType */: return emitFunctionType(node); - case 159 /* ConstructorType */: + case 160 /* ConstructorType */: return emitConstructorType(node); - case 160 /* TypeQuery */: + case 161 /* TypeQuery */: return emitTypeQuery(node); - case 161 /* TypeLiteral */: + case 162 /* TypeLiteral */: return emitTypeLiteral(node); - case 162 /* ArrayType */: + case 163 /* ArrayType */: return emitArrayType(node); - case 163 /* TupleType */: + case 164 /* TupleType */: return emitTupleType(node); - case 164 /* UnionType */: + case 165 /* UnionType */: return emitUnionType(node); - case 165 /* IntersectionType */: + case 166 /* IntersectionType */: return emitIntersectionType(node); - case 166 /* ParenthesizedType */: + case 167 /* ParenthesizedType */: return emitParenthesizedType(node); - case 199 /* ExpressionWithTypeArguments */: + case 200 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 167 /* ThisType */: + case 168 /* ThisType */: return emitThisType(); - case 168 /* TypeOperator */: + case 169 /* TypeOperator */: return emitTypeOperator(node); - case 169 /* IndexedAccessType */: + case 170 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 170 /* MappedType */: + case 171 /* MappedType */: return emitMappedType(node); - case 171 /* LiteralType */: + case 172 /* LiteralType */: return emitLiteralType(node); // Binding patterns - case 172 /* ObjectBindingPattern */: + case 173 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 173 /* ArrayBindingPattern */: + case 174 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 174 /* BindingElement */: + case 175 /* BindingElement */: return emitBindingElement(node); // Misc - case 202 /* TemplateSpan */: + case 204 /* TemplateSpan */: return emitTemplateSpan(node); - case 203 /* SemicolonClassElement */: + case 205 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 204 /* Block */: + case 206 /* Block */: return emitBlock(node); - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: return emitVariableStatement(node); - case 206 /* EmptyStatement */: + case 208 /* EmptyStatement */: return emitEmptyStatement(); - case 207 /* ExpressionStatement */: + case 209 /* ExpressionStatement */: return emitExpressionStatement(node); - case 208 /* IfStatement */: + case 210 /* IfStatement */: return emitIfStatement(node); - case 209 /* DoStatement */: + case 211 /* DoStatement */: return emitDoStatement(node); - case 210 /* WhileStatement */: + case 212 /* WhileStatement */: return emitWhileStatement(node); - case 211 /* ForStatement */: + case 213 /* ForStatement */: return emitForStatement(node); - case 212 /* ForInStatement */: + case 214 /* ForInStatement */: return emitForInStatement(node); - case 213 /* ForOfStatement */: + case 215 /* ForOfStatement */: return emitForOfStatement(node); - case 214 /* ContinueStatement */: + case 216 /* ContinueStatement */: return emitContinueStatement(node); - case 215 /* BreakStatement */: + case 217 /* BreakStatement */: return emitBreakStatement(node); - case 216 /* ReturnStatement */: + case 218 /* ReturnStatement */: return emitReturnStatement(node); - case 217 /* WithStatement */: + case 219 /* WithStatement */: return emitWithStatement(node); - case 218 /* SwitchStatement */: + case 220 /* SwitchStatement */: return emitSwitchStatement(node); - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: return emitLabeledStatement(node); - case 220 /* ThrowStatement */: + case 222 /* ThrowStatement */: return emitThrowStatement(node); - case 221 /* TryStatement */: + case 223 /* TryStatement */: return emitTryStatement(node); - case 222 /* DebuggerStatement */: + case 224 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 223 /* VariableDeclaration */: + case 225 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 224 /* VariableDeclarationList */: + case 226 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: return emitClassDeclaration(node); - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 228 /* TypeAliasDeclaration */: + case 230 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 231 /* ModuleBlock */: + case 233 /* ModuleBlock */: return emitModuleBlock(node); - case 232 /* CaseBlock */: + case 234 /* CaseBlock */: return emitCaseBlock(node); - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 235 /* ImportDeclaration */: + case 237 /* ImportDeclaration */: return emitImportDeclaration(node); - case 236 /* ImportClause */: + case 238 /* ImportClause */: return emitImportClause(node); - case 237 /* NamespaceImport */: + case 239 /* NamespaceImport */: return emitNamespaceImport(node); - case 238 /* NamedImports */: + case 240 /* NamedImports */: return emitNamedImports(node); - case 239 /* ImportSpecifier */: + case 241 /* ImportSpecifier */: return emitImportSpecifier(node); - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: return emitExportAssignment(node); - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: return emitExportDeclaration(node); - case 242 /* NamedExports */: + case 244 /* NamedExports */: return emitNamedExports(node); - case 243 /* ExportSpecifier */: + case 245 /* ExportSpecifier */: return emitExportSpecifier(node); - case 244 /* MissingDeclaration */: + case 246 /* MissingDeclaration */: return; // Module references - case 245 /* ExternalModuleReference */: + case 247 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 10 /* JsxText */: return emitJsxText(node); - case 248 /* JsxOpeningElement */: + case 250 /* JsxOpeningElement */: return emitJsxOpeningElement(node); - case 249 /* JsxClosingElement */: + case 251 /* JsxClosingElement */: return emitJsxClosingElement(node); - case 250 /* JsxAttribute */: + case 252 /* JsxAttribute */: return emitJsxAttribute(node); - case 251 /* JsxSpreadAttribute */: + case 253 /* JsxAttributes */: + return emitJsxAttributes(node); + case 254 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 252 /* JsxExpression */: + case 255 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 253 /* CaseClause */: + case 256 /* CaseClause */: return emitCaseClause(node); - case 254 /* DefaultClause */: + case 257 /* DefaultClause */: return emitDefaultClause(node); - case 255 /* HeritageClause */: + case 258 /* HeritageClause */: return emitHeritageClause(node); - case 256 /* CatchClause */: + case 259 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 257 /* PropertyAssignment */: + case 260 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 258 /* ShorthandPropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 259 /* SpreadAssignment */: + case 262 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 260 /* EnumMember */: + case 263 /* EnumMember */: return emitEnumMember(node); } // If the node is an expression, try to emit it as an expression with // substitution. if (ts.isExpression(node)) { - return pipelineEmitWithSubstitution(1 /* Expression */, node); + return pipelineEmitExpression(trySubstituteNode(1 /* Expression */, node)); + } + if (ts.isToken(node)) { + writeTokenText(kind); + return; } } - /** - * Emits a node in the Expression EmitContext. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitForContext. - */ - function pipelineEmitInExpressionContext(node) { + function pipelineEmitExpression(node) { var kind = node.kind; switch (kind) { // Literals @@ -59917,68 +64435,76 @@ var ts; writeTokenText(kind); return; // Expressions - case 175 /* ArrayLiteralExpression */: + case 176 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 176 /* ObjectLiteralExpression */: + case 177 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 177 /* PropertyAccessExpression */: + case 178 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 178 /* ElementAccessExpression */: + case 179 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 179 /* CallExpression */: + case 180 /* CallExpression */: return emitCallExpression(node); - case 180 /* NewExpression */: + case 181 /* NewExpression */: return emitNewExpression(node); - case 181 /* TaggedTemplateExpression */: + case 182 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 182 /* TypeAssertionExpression */: + case 183 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 184 /* FunctionExpression */: + case 185 /* FunctionExpression */: return emitFunctionExpression(node); - case 185 /* ArrowFunction */: + case 186 /* ArrowFunction */: return emitArrowFunction(node); - case 186 /* DeleteExpression */: + case 187 /* DeleteExpression */: return emitDeleteExpression(node); - case 187 /* TypeOfExpression */: + case 188 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 188 /* VoidExpression */: + case 189 /* VoidExpression */: return emitVoidExpression(node); - case 189 /* AwaitExpression */: + case 190 /* AwaitExpression */: return emitAwaitExpression(node); - case 190 /* PrefixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 191 /* PostfixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return emitBinaryExpression(node); - case 193 /* ConditionalExpression */: + case 194 /* ConditionalExpression */: return emitConditionalExpression(node); - case 194 /* TemplateExpression */: + case 195 /* TemplateExpression */: return emitTemplateExpression(node); - case 195 /* YieldExpression */: + case 196 /* YieldExpression */: return emitYieldExpression(node); - case 196 /* SpreadElement */: + case 197 /* SpreadElement */: return emitSpreadExpression(node); - case 197 /* ClassExpression */: + case 198 /* ClassExpression */: return emitClassExpression(node); - case 198 /* OmittedExpression */: + case 199 /* OmittedExpression */: return; - case 200 /* AsExpression */: + case 201 /* AsExpression */: return emitAsExpression(node); - case 201 /* NonNullExpression */: + case 202 /* NonNullExpression */: return emitNonNullExpression(node); + case 203 /* MetaProperty */: + return emitMetaProperty(node); // JSX - case 246 /* JsxElement */: + case 248 /* JsxElement */: return emitJsxElement(node); - case 247 /* JsxSelfClosingElement */: + case 249 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); // Transformation nodes - case 294 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 297 /* RawExpression */: - return writeLines(node.text); + } + } + function trySubstituteNode(hint, node) { + return node && substituteNode && substituteNode(hint, node) || node; + } + function emitHelpersIndirect(node) { + if (onEmitHelpers) { + onEmitHelpers(node, writeLines); } } // @@ -59987,9 +64513,6 @@ var ts; // SyntaxKind.NumericLiteral function emitNumericLiteral(node) { emitLiteral(node); - if (node.trailingComment) { - write(" /*" + node.trailingComment + "*/"); - } } // SyntaxKind.StringLiteral // SyntaxKind.RegularExpressionLiteral @@ -59999,7 +64522,7 @@ var ts; // SyntaxKind.TemplateTail function emitLiteral(node) { var text = getLiteralTextOfNode(node); - if ((compilerOptions.sourceMap || compilerOptions.inlineSourceMap) + if ((printerOptions.sourceMap || printerOptions.inlineSourceMap) && (node.kind === 9 /* StringLiteral */ || ts.isTemplateLiteralKind(node.kind))) { writer.writeLiteral(text); } @@ -60047,8 +64570,8 @@ var ts; writeIfPresent(node.dotDotDotToken, "..."); emit(node.name); writeIfPresent(node.questionToken, "?"); - emitExpressionWithPrefix(" = ", node.initializer); emitWithPrefix(": ", node.type); + emitExpressionWithPrefix(" = ", node.initializer); } function emitDecorator(decorator) { write("@"); @@ -60098,7 +64621,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write(node.kind === 151 /* GetAccessor */ ? "get " : "set "); + write(node.kind === 152 /* GetAccessor */ ? "get " : "set "); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); } @@ -60201,17 +64724,13 @@ var ts; write("{"); writeLine(); increaseIndent(); - if (node.readonlyToken) { - write("readonly "); - } + writeIfPresent(node.readonlyToken, "readonly "); write("["); emit(node.typeParameter.name); write(" in "); emit(node.typeParameter.constraint); write("]"); - if (node.questionToken) { - write("?"); - } + writeIfPresent(node.questionToken, "?"); write(": "); emit(node.type); write(";"); @@ -60277,7 +64796,7 @@ var ts; increaseIndent(); } var preferNewLine = node.multiLine ? 32768 /* PreferNewLine */ : 0 /* None */; - var allowTrailingComma = languageVersion >= 1 /* ES5 */ ? 32 /* AllowTrailingComma */ : 0 /* None */; + var allowTrailingComma = currentSourceFile.languageVersion >= 1 /* ES5 */ ? 32 /* AllowTrailingComma */ : 0 /* None */; emitList(node, properties, 978 /* ObjectLiteralExpressionProperties */ | allowTrailingComma | preferNewLine); if (indentedFlag) { decreaseIndent(); @@ -60289,7 +64808,7 @@ var ts; var indentAfterDot = false; if (!(ts.getEmitFlags(node) & 65536 /* NoIndentation */)) { var dotRangeStart = node.expression.end; - var dotRangeEnd = ts.skipTrivia(currentText, node.expression.end) + 1; + var dotRangeEnd = ts.skipTrivia(currentSourceFile.text, node.expression.end) + 1; var dotToken = { kind: 22 /* DotToken */, pos: dotRangeStart, end: dotRangeEnd }; indentBeforeDot = needsIndentation(node, node.expression, dotToken); indentAfterDot = needsIndentation(node, dotToken, node.name); @@ -60305,10 +64824,12 @@ var ts; // 1..toString is a valid property access, emit a dot after the literal // Also emit a dot if expression is a integer const enum value - it will appear in generated code as numeric literal function needsDotDotForPropertyAccess(expression) { - if (expression.kind === 8 /* NumericLiteral */) { - // check if numeric literal was originally written with a dot + expression = ts.skipPartiallyEmittedExpressions(expression); + if (ts.isNumericLiteral(expression)) { + // check if numeric literal is a decimal literal that was originally written with a dot var text = getLiteralTextOfNode(expression); - return text.indexOf(ts.tokenToString(22 /* DotToken */)) < 0; + return !expression.numericLiteralFlags + && text.indexOf(ts.tokenToString(22 /* DotToken */)) < 0; } else if (ts.isPropertyAccessExpression(expression) || ts.isElementAccessExpression(expression)) { // check if constant enum value is integer @@ -60316,7 +64837,7 @@ var ts; // isFinite handles cases when constantValue is undefined return isFinite(constantValue) && Math.floor(constantValue) === constantValue - && compilerOptions.removeComments; + && printerOptions.removeComments; } } function emitElementAccessExpression(node) { @@ -60342,11 +64863,9 @@ var ts; emitExpression(node.template); } function emitTypeAssertionExpression(node) { - if (node.type) { - write("<"); - emit(node.type); - write(">"); - } + write("<"); + emit(node.type); + write(">"); emitExpression(node.expression); } function emitParenthesizedExpression(node) { @@ -60405,7 +64924,7 @@ var ts; // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. var operand = node.operand; - return operand.kind === 190 /* PrefixUnaryExpression */ + return operand.kind === 191 /* PrefixUnaryExpression */ && ((node.operator === 36 /* PlusToken */ && (operand.operator === 36 /* PlusToken */ || operand.operator === 42 /* PlusPlusToken */)) || (node.operator === 37 /* MinusToken */ && (operand.operator === 37 /* MinusToken */ || operand.operator === 43 /* MinusMinusToken */))); } @@ -60471,6 +64990,11 @@ var ts; emitExpression(node.expression); write("!"); } + function emitMetaProperty(node) { + writeToken(node.keywordToken, node.pos); + write("."); + emit(node.name); + } // // Misc // @@ -60490,6 +65014,10 @@ var ts; else { writeToken(16 /* OpenBraceToken */, node.pos, /*contextNode*/ node); emitBlockStatements(node); + // We have to call emitLeadingComments explicitly here because otherwise leading comments of the close brace token will not be emitted + increaseIndent(); + emitLeadingCommentsOfPosition(node.statements.end); + decreaseIndent(); writeToken(17 /* CloseBraceToken */, node.statements.end, /*contextNode*/ node); } } @@ -60519,27 +65047,27 @@ var ts; writeToken(18 /* OpenParenToken */, openParenPos, node); emitExpression(node.expression); writeToken(19 /* CloseParenToken */, node.expression.end, node); - emitEmbeddedStatement(node.thenStatement); + emitEmbeddedStatement(node, node.thenStatement); if (node.elseStatement) { - writeLine(); + writeLineOrSpace(node); writeToken(81 /* ElseKeyword */, node.thenStatement.end, node); - if (node.elseStatement.kind === 208 /* IfStatement */) { + if (node.elseStatement.kind === 210 /* IfStatement */) { write(" "); emit(node.elseStatement); } else { - emitEmbeddedStatement(node.elseStatement); + emitEmbeddedStatement(node, node.elseStatement); } } } function emitDoStatement(node) { write("do"); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); if (ts.isBlock(node.statement)) { write(" "); } else { - writeLine(); + writeLineOrSpace(node); } write("while ("); emitExpression(node.expression); @@ -60549,7 +65077,7 @@ var ts; write("while ("); emitExpression(node.expression); write(")"); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitForStatement(node) { var openParenPos = writeToken(87 /* ForKeyword */, node.pos); @@ -60561,7 +65089,7 @@ var ts; write(";"); emitExpressionWithPrefix(" ", node.incrementor); write(")"); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitForInStatement(node) { var openParenPos = writeToken(87 /* ForKeyword */, node.pos); @@ -60571,21 +65099,22 @@ var ts; write(" in "); emitExpression(node.expression); writeToken(19 /* CloseParenToken */, node.expression.end); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitForOfStatement(node) { var openParenPos = writeToken(87 /* ForKeyword */, node.pos); write(" "); + emitWithSuffix(node.awaitModifier, " "); writeToken(18 /* OpenParenToken */, openParenPos); emitForBinding(node.initializer); write(" of "); emitExpression(node.expression); writeToken(19 /* CloseParenToken */, node.expression.end); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 224 /* VariableDeclarationList */) { + if (node.kind === 226 /* VariableDeclarationList */) { emit(node); } else { @@ -60612,7 +65141,7 @@ var ts; write("with ("); emitExpression(node.expression); write(")"); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitSwitchStatement(node) { var openParenPos = writeToken(97 /* SwitchKeyword */, node.pos); @@ -60636,9 +65165,12 @@ var ts; function emitTryStatement(node) { write("try "); emit(node.tryBlock); - emit(node.catchClause); + if (node.catchClause) { + writeLineOrSpace(node); + emit(node.catchClause); + } if (node.finallyBlock) { - writeLine(); + writeLineOrSpace(node); write("finally "); emit(node.finallyBlock); } @@ -60669,6 +65201,9 @@ var ts; emitIdentifierName(node.name); emitSignatureAndBody(node, emitSignatureHead); } + function emitBlockCallback(_hint, body) { + emitBlockFunctionBody(body); + } function emitSignatureAndBody(node, emitSignatureHead) { var body = node.body; if (body) { @@ -60679,14 +65214,23 @@ var ts; } if (ts.getEmitFlags(node) & 262144 /* ReuseTempVariableScope */) { emitSignatureHead(node); - emitBlockFunctionBody(body); + if (onEmitNode) { + onEmitNode(3 /* Unspecified */, body, emitBlockCallback); + } + else { + emitBlockFunctionBody(body); + } } else { - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); emitSignatureHead(node); - emitBlockFunctionBody(body); - tempFlags = savedTempFlags; + if (onEmitNode) { + onEmitNode(3 /* Unspecified */, body, emitBlockCallback); + } + else { + emitBlockFunctionBody(body); + } + popNameGenerationScope(); } if (indentedFlag) { decreaseIndent(); @@ -60741,9 +65285,15 @@ var ts; function emitBlockFunctionBody(body) { write(" {"); increaseIndent(); - emitBodyWithDetachedComments(body, body.statements, shouldEmitBlockFunctionBodyOnSingleLine(body) + var emitBlockFunctionBody = shouldEmitBlockFunctionBodyOnSingleLine(body) ? emitBlockFunctionBodyOnSingleLine - : emitBlockFunctionBodyWorker); + : emitBlockFunctionBodyWorker; + if (emitBodyWithDetachedComments) { + emitBodyWithDetachedComments(body, body.statements, emitBlockFunctionBody); + } + else { + emitBlockFunctionBody(body); + } decreaseIndent(); writeToken(17 /* CloseBraceToken */, body.statements.end, body); } @@ -60753,8 +65303,9 @@ var ts; function emitBlockFunctionBodyWorker(body, emitBlockFunctionBodyOnSingleLine) { // Emit all the prologue directives (like "use strict"). var statementOffset = emitPrologueDirectives(body.statements, /*startWithNewLine*/ true); - var helpersEmitted = emitHelpers(body); - if (statementOffset === 0 && !helpersEmitted && emitBlockFunctionBodyOnSingleLine) { + var pos = writer.getTextPos(); + emitHelpersIndirect(body); + if (statementOffset === 0 && pos === writer.getTextPos() && emitBlockFunctionBodyOnSingleLine) { decreaseIndent(); emitList(body, body.statements, 384 /* SingleLineFunctionBodyStatements */); increaseIndent(); @@ -60777,15 +65328,14 @@ var ts; } emitTypeParameters(node, node.typeParameters); emitList(node, node.heritageClauses, 256 /* ClassHeritageClauses */); - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); write(" {"); emitList(node, node.members, 65 /* ClassMembers */); write("}"); + popNameGenerationScope(); if (indentedFlag) { decreaseIndent(); } - tempFlags = savedTempFlags; } function emitInterfaceDeclaration(node) { emitDecorators(node, node.decorators); @@ -60812,19 +65362,18 @@ var ts; emitModifiers(node, node.modifiers); write("enum "); emit(node.name); - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); write(" {"); emitList(node, node.members, 81 /* EnumMembers */); write("}"); - tempFlags = savedTempFlags; + popNameGenerationScope(); } function emitModuleDeclaration(node) { emitModifiers(node, node.modifiers); write(node.flags & 16 /* Namespace */ ? "namespace " : "module "); emit(node.name); var body = node.body; - while (body.kind === 230 /* ModuleDeclaration */) { + while (body.kind === 232 /* ModuleDeclaration */) { write("."); emit(body.name); body = body.body; @@ -60837,13 +65386,11 @@ var ts; write("{ }"); } else { - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); write("{"); - increaseIndent(); emitBlockStatements(node); write("}"); - tempFlags = savedTempFlags; + popNameGenerationScope(); } } function emitCaseBlock(node) { @@ -60951,14 +65498,20 @@ var ts; write("<"); emitJsxTagName(node.tagName); write(" "); - emitList(node, node.attributes, 131328 /* JsxElementAttributes */); + // We are checking here so we won't re-enter the emiting pipeline and emit extra sourcemap + if (node.attributes.properties && node.attributes.properties.length > 0) { + emit(node.attributes); + } write("/>"); } function emitJsxOpeningElement(node) { write("<"); emitJsxTagName(node.tagName); - writeIfAny(node.attributes, " "); - emitList(node, node.attributes, 131328 /* JsxElementAttributes */); + writeIfAny(node.attributes.properties, " "); + // We are checking here so we won't re-enter the emitting pipeline and emit extra sourcemap + if (node.attributes.properties && node.attributes.properties.length > 0) { + emit(node.attributes); + } write(">"); } function emitJsxText(node) { @@ -60969,6 +65522,9 @@ var ts; emitJsxTagName(node.tagName); write(">"); } + function emitJsxAttributes(node) { + emitList(node, node.properties, 131328 /* JsxElementAttributes */); + } function emitJsxAttribute(node) { emit(node.name); emitWithPrefix("=", node.initializer); @@ -60981,6 +65537,9 @@ var ts; function emitJsxExpression(node) { if (node.expression) { write("{"); + if (node.dotDotDotToken) { + write("..."); + } emitExpression(node.expression); write("}"); } @@ -61028,7 +65587,6 @@ var ts; emitList(node, node.types, 272 /* HeritageClauseTypes */); } function emitCatchClause(node) { - writeLine(); var openParenPos = writeToken(73 /* CatchKeyword */, node.pos); write(" "); writeToken(18 /* OpenParenToken */, openParenPos); @@ -61051,7 +65609,7 @@ var ts; // "comment1" is not considered to be leading comment for node.initializer // but rather a trailing comment on the previous node. var initializer = node.initializer; - if ((ts.getEmitFlags(initializer) & 512 /* NoLeadingComments */) === 0) { + if (emitTrailingCommentsOfPosition && (ts.getEmitFlags(initializer) & 512 /* NoLeadingComments */) === 0) { var commentRange = ts.getCommentRange(initializer); emitTrailingCommentsOfPosition(commentRange.pos); } @@ -61082,17 +65640,27 @@ var ts; // function emitSourceFile(node) { writeLine(); - emitShebang(); - emitBodyWithDetachedComments(node, node.statements, emitSourceFileWorker); + var statements = node.statements; + if (emitBodyWithDetachedComments) { + // Emit detached comment if there are no prologue directives or if the first node is synthesized. + // The synthesized node will have no leading comment so some comments may be missed. + var shouldEmitDetachedComment = statements.length === 0 || + !ts.isPrologueDirective(statements[0]) || + ts.nodeIsSynthesized(statements[0]); + if (shouldEmitDetachedComment) { + emitBodyWithDetachedComments(node, statements, emitSourceFileWorker); + return; + } + } + emitSourceFileWorker(node); } function emitSourceFileWorker(node) { var statements = node.statements; - var statementOffset = emitPrologueDirectives(statements); - var savedTempFlags = tempFlags; - tempFlags = 0; - emitHelpers(node); - emitList(node, statements, 1 /* MultiLine */, statementOffset); - tempFlags = savedTempFlags; + pushNameGenerationScope(); + emitHelpersIndirect(node); + var index = ts.findIndex(statements, function (statement) { return !ts.isPrologueDirective(statement); }); + emitList(node, statements, 1 /* MultiLine */, index === -1 ? statements.length : index); + popNameGenerationScope(); } // Transformation nodes function emitPartiallyEmittedExpression(node) { @@ -61102,13 +65670,20 @@ var ts; * Emits any prologue directives at the start of a Statement list, returning the * number of prologue directives written to the output. */ - function emitPrologueDirectives(statements, startWithNewLine) { + function emitPrologueDirectives(statements, startWithNewLine, seenPrologueDirectives) { for (var i = 0; i < statements.length; i++) { - if (ts.isPrologueDirective(statements[i])) { - if (startWithNewLine || i > 0) { - writeLine(); + var statement = statements[i]; + if (ts.isPrologueDirective(statement)) { + var shouldEmitPrologueDirective = seenPrologueDirectives ? !seenPrologueDirectives.has(statement.expression.text) : true; + if (shouldEmitPrologueDirective) { + if (startWithNewLine || i > 0) { + writeLine(); + } + emit(statement); + if (seenPrologueDirectives) { + seenPrologueDirectives.set(statement.expression.text, statement.expression.text); + } } - emit(statements[i]); } else { // return index of the first non prologue directive @@ -61117,81 +65692,42 @@ var ts; } return statements.length; } - function emitHelpers(node, isBundle) { - var sourceFile = ts.isSourceFile(node) ? node : currentSourceFile; - var shouldSkip = compilerOptions.noEmitHelpers || (sourceFile && ts.getExternalHelpersModuleName(sourceFile) !== undefined); - var shouldBundle = ts.isSourceFile(node) && !isOwnFileEmit; - var helpersEmitted = false; - var helpers = ts.getEmitHelpers(node); - if (helpers) { - for (var _a = 0, _b = ts.stableSort(helpers, ts.compareEmitHelpers); _a < _b.length; _a++) { - var helper = _b[_a]; - if (!helper.scoped) { - // Skip the helper if it can be skipped and the noEmitHelpers compiler - // option is set, or if it can be imported and the importHelpers compiler - // option is set. - if (shouldSkip) - continue; - // Skip the helper if it can be bundled but hasn't already been emitted and we - // are emitting a bundled module. - if (shouldBundle) { - if (bundledHelpers[helper.name]) { - continue; - } - bundledHelpers[helper.name] = true; - } - } - else if (isBundle) { - // Skip the helper if it is scoped and we are emitting bundled helpers - continue; - } - writeLines(helper.text); - helpersEmitted = true; - } + function emitPrologueDirectivesIfNeeded(sourceFileOrBundle) { + if (ts.isSourceFile(sourceFileOrBundle)) { + setSourceFile(sourceFileOrBundle); + emitPrologueDirectives(sourceFileOrBundle.statements); } - if (helpersEmitted) { - writeLine(); - } - return helpersEmitted; - } - function writeLines(text) { - var lines = text.split(/\r\n?|\n/g); - var indentation = guessIndentation(lines); - for (var i = 0; i < lines.length; i++) { - var line = indentation ? lines[i].slice(indentation) : lines[i]; - if (line.length) { - if (i > 0) { - writeLine(); - } - write(line); + else { + var seenPrologueDirectives = ts.createMap(); + for (var _a = 0, _b = sourceFileOrBundle.sourceFiles; _a < _b.length; _a++) { + var sourceFile = _b[_a]; + setSourceFile(sourceFile); + emitPrologueDirectives(sourceFile.statements, /*startWithNewLine*/ true, seenPrologueDirectives); } } } - function guessIndentation(lines) { - var indentation; - for (var _a = 0, lines_1 = lines; _a < lines_1.length; _a++) { - var line = lines_1[_a]; - for (var i = 0; i < line.length && (indentation === undefined || i < indentation); i++) { - if (!ts.isWhiteSpace(line.charCodeAt(i))) { - if (indentation === undefined || i < indentation) { - indentation = i; - break; - } + function emitShebangIfNeeded(sourceFileOrBundle) { + if (ts.isSourceFile(sourceFileOrBundle)) { + var shebang = ts.getShebang(sourceFileOrBundle.text); + if (shebang) { + write(shebang); + writeLine(); + return true; + } + } + else { + for (var _a = 0, _b = sourceFileOrBundle.sourceFiles; _a < _b.length; _a++) { + var sourceFile = _b[_a]; + // Emit only the first encountered shebang + if (emitShebangIfNeeded(sourceFile)) { + break; } } } - return indentation; } // // Helpers // - function emitShebang() { - var shebang = ts.getShebang(currentText); - if (shebang) { - write(shebang); - writeLine(); - } - } function emitModifiers(node, modifiers) { if (modifiers && modifiers.length) { emitList(node, modifiers, 256 /* Modifiers */); @@ -61216,8 +65752,8 @@ var ts; write(suffix); } } - function emitEmbeddedStatement(node) { - if (ts.isBlock(node)) { + function emitEmbeddedStatement(parent, node) { + if (ts.isBlock(node) || ts.getEmitFlags(parent) & 1 /* SingleLine */) { write(" "); emit(node); } @@ -61274,6 +65810,9 @@ var ts; if (format & 7680 /* BracketsMask */) { write(getOpeningBracket(format)); } + if (onBeforeEmitNodeArray) { + onBeforeEmitNodeArray(children); + } if (isEmpty) { // Write a line terminator if the parent node was multi-line if (format & 1 /* MultiLine */) { @@ -61306,6 +65845,15 @@ var ts; var child = children[start + i]; // Write the delimiter if this is not the first node. if (previousSibling) { + // i.e + // function commentedParameters( + // /* Parameter a */ + // a + // /* End of parameter a */ -> this comment isn't considered to be trailing comment of parameter "a" due to newline + // , + if (delimiter && previousSibling.end !== parentNode.end) { + emitLeadingCommentsOfPosition(previousSibling.end); + } write(delimiter); // Write either a line terminator or whitespace to separate the elements. if (shouldWriteSeparatingLineTerminator(previousSibling, child, format)) { @@ -61322,14 +65870,16 @@ var ts; write(" "); } } + // Emit this child. if (shouldEmitInterveningComments) { - var commentRange = ts.getCommentRange(child); - emitTrailingCommentsOfPosition(commentRange.pos); + if (emitTrailingCommentsOfPosition) { + var commentRange = ts.getCommentRange(child); + emitTrailingCommentsOfPosition(commentRange.pos); + } } else { shouldEmitInterveningComments = mayEmitInterveningComments; } - // Emit this child. emit(child); if (shouldDecreaseIndentAfterEmit) { decreaseIndent(); @@ -61342,6 +65892,15 @@ var ts; if (format & 16 /* CommaDelimited */ && hasTrailingComma) { write(","); } + // Emit any trailing comment of the last element in the list + // i.e + // var array = [... + // 2 + // /* end of element 2 */ + // ]; + if (previousSibling && delimiter && previousSibling.end !== parentNode.end) { + emitLeadingCommentsOfPosition(previousSibling.end); + } // Decrease the indent, if requested. if (format & 64 /* Indented */) { decreaseIndent(); @@ -61354,28 +65913,80 @@ var ts; write(" "); } } + if (onAfterEmitNodeArray) { + onAfterEmitNodeArray(children); + } if (format & 7680 /* BracketsMask */) { write(getClosingBracket(format)); } } + function write(s) { + writer.write(s); + } + function writeLine() { + writer.writeLine(); + } + function increaseIndent() { + writer.increaseIndent(); + } + function decreaseIndent() { + writer.decreaseIndent(); + } function writeIfAny(nodes, text) { - if (nodes && nodes.length > 0) { + if (ts.some(nodes)) { write(text); } } function writeIfPresent(node, text) { - if (node !== undefined) { + if (node) { write(text); } } function writeToken(token, pos, contextNode) { - return emitTokenWithSourceMap(contextNode, token, pos, writeTokenText); + return onEmitSourceMapOfToken + ? onEmitSourceMapOfToken(contextNode, token, pos, writeTokenText) + : writeTokenText(token, pos); } function writeTokenText(token, pos) { var tokenString = ts.tokenToString(token); write(tokenString); return pos < 0 ? pos : pos + tokenString.length; } + function writeLineOrSpace(node) { + if (ts.getEmitFlags(node) & 1 /* SingleLine */) { + write(" "); + } + else { + writeLine(); + } + } + function writeLines(text) { + var lines = text.split(/\r\n?|\n/g); + var indentation = guessIndentation(lines); + for (var i = 0; i < lines.length; i++) { + var line = indentation ? lines[i].slice(indentation) : lines[i]; + if (line.length) { + writeLine(); + write(line); + writeLine(); + } + } + } + function guessIndentation(lines) { + var indentation; + for (var _a = 0, lines_1 = lines; _a < lines_1.length; _a++) { + var line = lines_1[_a]; + for (var i = 0; i < line.length && (indentation === undefined || i < indentation); i++) { + if (!ts.isWhiteSpace(line.charCodeAt(i))) { + if (indentation === undefined || i < indentation) { + indentation = i; + break; + } + } + } + } + return indentation; + } function increaseIndentIf(value, valueToWriteWhenNotIndenting) { if (value) { increaseIndent(); @@ -61485,15 +66096,23 @@ var ts; && !ts.nodeIsSynthesized(node2) && !ts.rangeEndIsOnSameLineAsRangeStart(node1, node2, currentSourceFile); } + function isSingleLineEmptyBlock(block) { + return !block.multiLine + && isEmptyBlock(block); + } + function isEmptyBlock(block) { + return block.statements.length === 0 + && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); + } function skipSynthesizedParentheses(node) { - while (node.kind === 183 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 184 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; } function getTextOfNode(node, includeTrivia) { if (ts.isGeneratedIdentifier(node)) { - return getGeneratedIdentifier(node); + return generateName(node); } else if (ts.isIdentifier(node) && (ts.nodeIsSynthesized(node) || !node.parent)) { return ts.unescapeIdentifier(node.text); @@ -61516,26 +66135,60 @@ var ts; return getLiteralTextOfNode(textSourceNode); } } - return ts.getLiteralText(node, currentSourceFile, languageVersion); + return ts.getLiteralText(node, currentSourceFile); } - function isSingleLineEmptyBlock(block) { - return !block.multiLine - && isEmptyBlock(block); + /** + * Push a new name generation scope. + */ + function pushNameGenerationScope() { + tempFlagsStack.push(tempFlags); + tempFlags = 0; } - function isEmptyBlock(block) { - return block.statements.length === 0 - && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); + /** + * Pop the current name generation scope. + */ + function popNameGenerationScope() { + tempFlags = tempFlagsStack.pop(); } + /** + * Generate the text for a generated identifier. + */ + function generateName(name) { + if (name.autoGenerateKind === 4 /* Node */) { + // Node names generate unique names based on their original node + // and are cached based on that node's id. + var node = getNodeForGeneratedName(name); + return generateNameCached(node); + } + else { + // Auto, Loop, and Unique names are cached based on their unique + // autoGenerateId. + var autoGenerateId = name.autoGenerateId; + return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = ts.unescapeIdentifier(makeName(name))); + } + } + function generateNameCached(node) { + var nodeId = ts.getNodeId(node); + return nodeIdToGeneratedName[nodeId] || (nodeIdToGeneratedName[nodeId] = ts.unescapeIdentifier(generateNameForNode(node))); + } + /** + * Returns a value indicating whether a name is unique globally, within the current file, + * or within the NameGenerator. + */ function isUniqueName(name) { - return !resolver.hasGlobalName(name) && - !ts.hasProperty(currentFileIdentifiers, name) && - !ts.hasProperty(generatedNameSet, name); + return !(hasGlobalName && hasGlobalName(name)) + && !currentSourceFile.identifiers.has(name) + && !generatedNames.has(name); } + /** + * Returns a value indicating whether a name is unique within a container. + */ function isUniqueLocalName(name, container) { for (var node = container; ts.isNodeDescendantOf(node, container); node = node.nextContainer) { - if (node.locals && ts.hasProperty(node.locals, name)) { + if (node.locals) { + var local = node.locals.get(name); // We conservatively include alias symbols to cover cases where they're emitted as locals - if (node.locals[name].flags & (107455 /* Value */ | 1048576 /* ExportValue */ | 8388608 /* Alias */)) { + if (local && local.flags & (107455 /* Value */ | 1048576 /* ExportValue */ | 8388608 /* Alias */)) { return false; } } @@ -61543,16 +66196,16 @@ var ts; return true; } /** - * Return the next available name in the pattern _a ... _z, _0, _1, ... - * TempFlags._i or TempFlags._n may be used to express a preference for that dedicated name. - * Note that names generated by makeTempVariableName and makeUniqueName will never conflict. - */ + * Return the next available name in the pattern _a ... _z, _0, _1, ... + * TempFlags._i or TempFlags._n may be used to express a preference for that dedicated name. + * Note that names generated by makeTempVariableName and makeUniqueName will never conflict. + */ function makeTempVariableName(flags) { if (flags && !(tempFlags & flags)) { - var name_39 = flags === 268435456 /* _i */ ? "_i" : "_n"; - if (isUniqueName(name_39)) { + var name = flags === 268435456 /* _i */ ? "_i" : "_n"; + if (isUniqueName(name)) { tempFlags |= flags; - return name_39; + return name; } } while (true) { @@ -61560,19 +66213,21 @@ var ts; tempFlags++; // Skip over 'i' and 'n' if (count !== 8 && count !== 13) { - var name_40 = count < 26 + var name = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26); - if (isUniqueName(name_40)) { - return name_40; + if (isUniqueName(name)) { + return name; } } } } - // Generate a name that is unique within the current file and doesn't conflict with any names - // in global scope. The name is formed by adding an '_n' suffix to the specified base name, - // where n is a positive integer. Note that names generated by makeTempVariableName and - // makeUniqueName are guaranteed to never conflict. + /** + * Generate a name that is unique within the current file and doesn't conflict with any names + * in global scope. The name is formed by adding an '_n' suffix to the specified base name, + * where n is a positive integer. Note that names generated by makeTempVariableName and + * makeUniqueName are guaranteed to never conflict. + */ function makeUniqueName(baseName) { // Find the first unique 'name_n', where n is a positive number if (baseName.charCodeAt(baseName.length - 1) !== 95 /* _ */) { @@ -61582,73 +66237,90 @@ var ts; while (true) { var generatedName = baseName + i; if (isUniqueName(generatedName)) { - return generatedNameSet[generatedName] = generatedName; + generatedNames.set(generatedName, generatedName); + return generatedName; } i++; } } + /** + * Generates a unique name for a ModuleDeclaration or EnumDeclaration. + */ function generateNameForModuleOrEnum(node) { var name = getTextOfNode(node.name); // Use module/enum name itself if it is unique, otherwise make a unique variation return isUniqueLocalName(name, node) ? name : makeUniqueName(name); } + /** + * Generates a unique name for an ImportDeclaration or ExportDeclaration. + */ function generateNameForImportOrExportDeclaration(node) { var expr = ts.getExternalModuleName(node); var baseName = expr.kind === 9 /* StringLiteral */ ? ts.escapeIdentifier(ts.makeIdentifierFromModuleName(expr.text)) : "module"; return makeUniqueName(baseName); } + /** + * Generates a unique name for a default export. + */ function generateNameForExportDefault() { return makeUniqueName("default"); } + /** + * Generates a unique name for a class expression. + */ function generateNameForClassExpression() { return makeUniqueName("class"); } + function generateNameForMethodOrAccessor(node) { + if (ts.isIdentifier(node.name)) { + return generateNameCached(node.name); + } + return makeTempVariableName(0 /* Auto */); + } /** * Generates a unique name from a node. - * - * @param node A node. */ function generateNameForNode(node) { switch (node.kind) { case 70 /* Identifier */: return makeUniqueName(getTextOfNode(node)); - case 230 /* ModuleDeclaration */: - case 229 /* EnumDeclaration */: + case 232 /* ModuleDeclaration */: + case 231 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 235 /* ImportDeclaration */: - case 241 /* ExportDeclaration */: + case 237 /* ImportDeclaration */: + case 243 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 225 /* FunctionDeclaration */: - case 226 /* ClassDeclaration */: - case 240 /* ExportAssignment */: + case 227 /* FunctionDeclaration */: + case 228 /* ClassDeclaration */: + case 242 /* ExportAssignment */: return generateNameForExportDefault(); - case 197 /* ClassExpression */: + case 198 /* ClassExpression */: return generateNameForClassExpression(); + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + return generateNameForMethodOrAccessor(node); default: return makeTempVariableName(0 /* Auto */); } } /** * Generates a unique identifier for a node. - * - * @param name A generated name. */ - function generateName(name) { + function makeName(name) { switch (name.autoGenerateKind) { case 1 /* Auto */: return makeTempVariableName(0 /* Auto */); case 2 /* Loop */: return makeTempVariableName(268435456 /* _i */); case 3 /* Unique */: - return makeUniqueName(name.text); + return makeUniqueName(ts.unescapeIdentifier(name.text)); } ts.Debug.fail("Unsupported GeneratedIdentifierKind."); } /** * Gets the node from which a name should be generated. - * - * @param name A generated name wrapper. */ function getNodeForGeneratedName(name) { var autoGenerateId = name.autoGenerateId; @@ -61668,53 +66340,40 @@ var ts; // otherwise, return the original node for the source; return node; } - /** - * Gets the generated identifier text from a generated identifier. - * - * @param name The generated identifier. - */ - function getGeneratedIdentifier(name) { - if (name.autoGenerateKind === 4 /* Node */) { - // Generated names generate unique names based on their original node - // and are cached based on that node's id - var node = getNodeForGeneratedName(name); - var nodeId = ts.getNodeId(node); - return nodeIdToGeneratedName[nodeId] || (nodeIdToGeneratedName[nodeId] = ts.unescapeIdentifier(generateNameForNode(node))); - } - else { - // Auto, Loop, and Unique names are cached based on their unique - // autoGenerateId. - var autoGenerateId = name.autoGenerateId; - return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = ts.unescapeIdentifier(generateName(name))); - } - } - function createDelimiterMap() { - var delimiters = []; - delimiters[0 /* None */] = ""; - delimiters[16 /* CommaDelimited */] = ","; - delimiters[4 /* BarDelimited */] = " |"; - delimiters[8 /* AmpersandDelimited */] = " &"; - return delimiters; - } - function getDelimiter(format) { - return delimiters[format & 28 /* DelimitersMask */]; - } - function createBracketsMap() { - var brackets = []; - brackets[512 /* Braces */] = ["{", "}"]; - brackets[1024 /* Parenthesis */] = ["(", ")"]; - brackets[2048 /* AngleBrackets */] = ["<", ">"]; - brackets[4096 /* SquareBrackets */] = ["[", "]"]; - return brackets; - } - function getOpeningBracket(format) { - return brackets[format & 7680 /* BracketsMask */][0]; - } - function getClosingBracket(format) { - return brackets[format & 7680 /* BracketsMask */][1]; - } } - ts.emitFiles = emitFiles; + ts.createPrinter = createPrinter; + function createDelimiterMap() { + var delimiters = []; + delimiters[0 /* None */] = ""; + delimiters[16 /* CommaDelimited */] = ","; + delimiters[4 /* BarDelimited */] = " |"; + delimiters[8 /* AmpersandDelimited */] = " &"; + return delimiters; + } + function getDelimiter(format) { + return delimiters[format & 28 /* DelimitersMask */]; + } + function createBracketsMap() { + var brackets = []; + brackets[512 /* Braces */] = ["{", "}"]; + brackets[1024 /* Parenthesis */] = ["(", ")"]; + brackets[2048 /* AngleBrackets */] = ["<", ">"]; + brackets[4096 /* SquareBrackets */] = ["[", "]"]; + return brackets; + } + function getOpeningBracket(format) { + return brackets[format & 7680 /* BracketsMask */][0]; + } + function getClosingBracket(format) { + return brackets[format & 7680 /* BracketsMask */][1]; + } + // Flags enum to track count of temp variables and a few dedicated names + var TempFlags; + (function (TempFlags) { + TempFlags[TempFlags["Auto"] = 0] = "Auto"; + TempFlags[TempFlags["CountMask"] = 268435455] = "CountMask"; + TempFlags[TempFlags["_i"] = 268435456] = "_i"; + })(TempFlags || (TempFlags = {})); var ListFormat; (function (ListFormat) { ListFormat[ListFormat["None"] = 0] = "None"; @@ -61790,6 +66449,7 @@ var ts; var ts; (function (ts) { var emptyArray = []; + var ignoreDiagnosticCommentRegEx = /(^\s*$)|(^\s*\/\/\/?\s*(@ts-ignore)?)/; function findConfigFile(searchPath, fileExists, configName) { if (configName === void 0) { configName = "tsconfig.json"; } while (true) { @@ -61824,7 +66484,8 @@ var ts; commonPathComponents = sourcePathComponents; return; } - for (var i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) { + var n = Math.min(commonPathComponents.length, sourcePathComponents.length); + for (var i = 0; i < n; i++) { if (getCanonicalFileName(commonPathComponents[i]) !== getCanonicalFileName(sourcePathComponents[i])) { if (i === 0) { // Failed to find any common path component @@ -61857,8 +66518,6 @@ var ts; // otherwise use toLowerCase as a canonical form. return ts.sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(); } - // returned by CScript sys environment - var unsupportedFileEncodingErrorCode = -2147024809; function getSourceFile(fileName, languageVersion, onError) { var text; try { @@ -61869,20 +66528,18 @@ var ts; } catch (e) { if (onError) { - onError(e.number === unsupportedFileEncodingErrorCode - ? ts.createCompilerDiagnostic(ts.Diagnostics.Unsupported_file_encoding).messageText - : e.message); + onError(e.message); } text = ""; } return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion, setParentNodes) : undefined; } function directoryExists(directoryPath) { - if (directoryPath in existingDirectories) { + if (existingDirectories.has(directoryPath)) { return true; } if (ts.sys.directoryExists(directoryPath)) { - existingDirectories[directoryPath] = true; + existingDirectories.set(directoryPath, true); return true; } return false; @@ -61901,10 +66558,11 @@ var ts; } var hash = ts.sys.createHash(data); var mtimeBefore = ts.sys.getModifiedTime(fileName); - if (mtimeBefore && fileName in outputFingerprints) { - var fingerprint = outputFingerprints[fileName]; + if (mtimeBefore) { + var fingerprint = outputFingerprints.get(fileName); // If output has not been changed, and the file has no external modification - if (fingerprint.byteOrderMark === writeByteOrderMark && + if (fingerprint && + fingerprint.byteOrderMark === writeByteOrderMark && fingerprint.hash === hash && fingerprint.mtime.getTime() === mtimeBefore.getTime()) { return; @@ -61912,11 +66570,11 @@ var ts; } ts.sys.writeFile(fileName, data, writeByteOrderMark); var mtimeAfter = ts.sys.getModifiedTime(fileName); - outputFingerprints[fileName] = { + outputFingerprints.set(fileName, { hash: hash, byteOrderMark: writeByteOrderMark, mtime: mtimeAfter - }; + }); } function writeFile(fileName, data, writeByteOrderMark, onError) { try { @@ -62015,10 +66673,14 @@ var ts; var resolutions = []; var cache = ts.createMap(); for (var _i = 0, names_1 = names; _i < names_1.length; _i++) { - var name_41 = names_1[_i]; - var result = name_41 in cache - ? cache[name_41] - : cache[name_41] = loader(name_41, containingFile); + var name = names_1[_i]; + var result = void 0; + if (cache.has(name)) { + result = cache.get(name); + } + else { + cache.set(name, result = loader(name, containingFile)); + } resolutions.push(result); } return resolutions; @@ -62030,6 +66692,8 @@ var ts; var diagnosticsProducingTypeChecker; var noDiagnosticsTypeChecker; var classifiableNames; + var cachedSemanticDiagnosticsForFile = {}; + var cachedDeclarationDiagnosticsForFile = {}; var resolvedTypeReferenceDirectives = ts.createMap(); var fileProcessingDiagnostics = ts.createDiagnosticCollection(); // The below settings are to track if a .js file should be add to the program if loaded via searching under node_modules. @@ -62054,6 +66718,7 @@ var ts; var supportedExtensions = ts.getSupportedExtensions(options); // Map storing if there is emit blocking diagnostics for given input var hasEmitBlockingDiagnostics = ts.createFileMap(getCanonicalFileName); + var moduleResolutionCache; var resolveModuleNamesWorker; if (host.resolveModuleNames) { resolveModuleNamesWorker = function (moduleNames, containingFile) { return host.resolveModuleNames(moduleNames, containingFile).map(function (resolved) { @@ -62067,7 +66732,8 @@ var ts; }); }; } else { - var loader_1 = function (moduleName, containingFile) { return ts.resolveModuleName(moduleName, containingFile, options, host).resolvedModule; }; + moduleResolutionCache = ts.createModuleResolutionCache(currentDirectory, function (x) { return host.getCanonicalFileName(x); }); + var loader_1 = function (moduleName, containingFile) { return ts.resolveModuleName(moduleName, containingFile, options, host, moduleResolutionCache).resolvedModule; }; resolveModuleNamesWorker = function (moduleNames, containingFile) { return loadWithLocalCache(moduleNames, containingFile, loader_1); }; } var resolveTypeReferenceDirectiveNamesWorker; @@ -62113,6 +66779,8 @@ var ts; } } } + // unconditionally set moduleResolutionCache to undefined to avoid unnecessary leaks + moduleResolutionCache = undefined; // unconditionally set oldProgram to undefined to prevent it from being captured in closure oldProgram = undefined; program = { @@ -62147,7 +66815,7 @@ var ts; return program; function getCommonSourceDirectory() { if (commonSourceDirectory === undefined) { - var emittedFiles = ts.filterSourceFilesInDirectory(files, isSourceFileFromExternalLibrary); + var emittedFiles = ts.filter(files, function (file) { return ts.sourceFileMayBeEmitted(file, options, isSourceFileFromExternalLibrary); }); if (options.rootDir && checkSourceFilesBelongToPath(emittedFiles, options.rootDir)) { // If a rootDir is specified and is valid use it as the commonSourceDirectory commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory); @@ -62171,7 +66839,7 @@ var ts; classifiableNames = ts.createMap(); for (var _i = 0, files_2 = files; _i < files_2.length; _i++) { var sourceFile = files_2[_i]; - ts.copyProperties(sourceFile.classifiableNames, classifiableNames); + ts.copyEntries(sourceFile.classifiableNames, classifiableNames); } } return classifiableNames; @@ -62245,7 +66913,7 @@ var ts; // combine results of resolutions and predicted results var j = 0; for (var i = 0; i < result.length; i++) { - if (result[i] == predictedToResolveToAmbientModuleMarker) { + if (result[i] === predictedToResolveToAmbientModuleMarker) { result[i] = undefined; } else { @@ -62378,7 +67046,7 @@ var ts; newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames; } // update fileName -> file mapping - for (var i = 0, len = newSourceFiles.length; i < len; i++) { + for (var i = 0; i < newSourceFiles.length; i++) { filesByName.set(filePaths[i], newSourceFiles[i]); } files = newSourceFiles; @@ -62407,7 +67075,7 @@ var ts; }; } function isSourceFileFromExternalLibrary(file) { - return sourceFilesFoundSearchingNodeModules[file.path]; + return sourceFilesFoundSearchingNodeModules.get(file.path); } function getDiagnosticsProducingTypeChecker() { return diagnosticsProducingTypeChecker || (diagnosticsProducingTypeChecker = ts.createTypeChecker(program, /*produceDiagnostics:*/ true)); @@ -62418,13 +67086,13 @@ var ts; function getTypeChecker() { return noDiagnosticsTypeChecker || (noDiagnosticsTypeChecker = ts.createTypeChecker(program, /*produceDiagnostics:*/ false)); } - function emit(sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles) { - return runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles); }); + function emit(sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers) { + return runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers); }); } function isEmitBlocked(emitFileName) { return hasEmitBlockingDiagnostics.contains(ts.toPath(emitFileName, currentDirectory, getCanonicalFileName)); } - function emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles) { + function emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, customTransformers) { var declarationDiagnostics = []; if (options.noEmit) { return { diagnostics: declarationDiagnostics, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true }; @@ -62456,7 +67124,8 @@ var ts; // checked is to not pass the file to getEmitResolver. var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile); ts.performance.mark("beforeEmit"); - var emitResult = ts.emitFiles(emitResolver, getEmitHost(writeFileCallback), sourceFile, emitOnlyDtsFiles); + var transformers = emitOnlyDtsFiles ? [] : ts.getTransformers(options, customTransformers); + var emitResult = ts.emitFiles(emitResolver, getEmitHost(writeFileCallback), sourceFile, emitOnlyDtsFiles, transformers); ts.performance.mark("afterEmit"); ts.performance.measure("Emit", "beforeEmit", "afterEmit"); return emitResult; @@ -62529,19 +67198,48 @@ var ts; } } function getSemanticDiagnosticsForFile(sourceFile, cancellationToken) { + return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedSemanticDiagnosticsForFile, getSemanticDiagnosticsForFileNoCache); + } + function getSemanticDiagnosticsForFileNoCache(sourceFile, cancellationToken) { return runWithCancellationToken(function () { var typeChecker = getDiagnosticsProducingTypeChecker(); ts.Debug.assert(!!sourceFile.bindDiagnostics); var bindDiagnostics = sourceFile.bindDiagnostics; - // For JavaScript files, we don't want to report semantic errors. - // Instead, we'll report errors for using TypeScript-only constructs from within a - // JavaScript file when we get syntactic diagnostics for the file. - var checkDiagnostics = ts.isSourceFileJavaScript(sourceFile) ? [] : typeChecker.getDiagnostics(sourceFile, cancellationToken); + // For JavaScript files, we don't want to report semantic errors unless explicitly requested. + var includeCheckDiagnostics = !ts.isSourceFileJavaScript(sourceFile) || ts.isCheckJsEnabledForFile(sourceFile, options); + var checkDiagnostics = includeCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : []; var fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName); var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName); - return bindDiagnostics.concat(checkDiagnostics, fileProcessingDiagnosticsInFile, programDiagnosticsInFile); + var diagnostics = bindDiagnostics.concat(checkDiagnostics, fileProcessingDiagnosticsInFile, programDiagnosticsInFile); + return ts.isSourceFileJavaScript(sourceFile) + ? ts.filter(diagnostics, shouldReportDiagnostic) + : diagnostics; }); } + /** + * Skip errors if previous line start with '// @ts-ignore' comment, not counting non-empty non-comment lines + */ + function shouldReportDiagnostic(diagnostic) { + var file = diagnostic.file, start = diagnostic.start; + if (file) { + var lineStarts = ts.getLineStarts(file); + var line = ts.computeLineAndCharacterOfPosition(lineStarts, start).line; + while (line > 0) { + var previousLineText = file.text.slice(lineStarts[line - 1], lineStarts[line]); + var result = ignoreDiagnosticCommentRegEx.exec(previousLineText); + if (!result) { + // non-empty line + return true; + } + if (result[3]) { + // @ts-ignore + return false; + } + line--; + } + } + return true; + } function getJavaScriptSyntacticDiagnosticsForFile(sourceFile) { return runWithCancellationToken(function () { var diagnostics = []; @@ -62552,23 +67250,23 @@ var ts; // Return directly from the case if the given node doesnt want to visit each child // Otherwise break to visit each child switch (parent.kind) { - case 144 /* Parameter */: - case 147 /* PropertyDeclaration */: + case 145 /* Parameter */: + case 148 /* PropertyDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, "?")); return; } - // Pass through - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: - case 185 /* ArrowFunction */: - case 225 /* FunctionDeclaration */: - case 223 /* VariableDeclaration */: + // falls through + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 185 /* FunctionExpression */: + case 227 /* FunctionDeclaration */: + case 186 /* ArrowFunction */: + case 227 /* FunctionDeclaration */: + case 225 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); @@ -62576,35 +67274,35 @@ var ts; } } switch (node.kind) { - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); return; - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); return; } break; - case 255 /* HeritageClause */: + case 258 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 107 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); return; } break; - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); return; - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); return; - case 228 /* TypeAliasDeclaration */: + case 230 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); return; - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); return; - case 182 /* TypeAssertionExpression */: + case 183 /* TypeAssertionExpression */: var typeAssertionExpression = node; diagnostics.push(createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); return; @@ -62619,29 +67317,29 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning)); } switch (parent.kind) { - case 226 /* ClassDeclaration */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: - case 185 /* ArrowFunction */: - case 225 /* FunctionDeclaration */: + case 228 /* ClassDeclaration */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 185 /* FunctionExpression */: + case 227 /* FunctionDeclaration */: + case 186 /* ArrowFunction */: + case 227 /* FunctionDeclaration */: // Check type parameters if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); return; } - // pass through - case 205 /* VariableStatement */: + // falls through + case 207 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - return checkModifiers(nodes, parent.kind === 205 /* VariableStatement */); + return checkModifiers(nodes, parent.kind === 207 /* VariableStatement */); } break; - case 147 /* PropertyDeclaration */: + case 148 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { @@ -62653,16 +67351,16 @@ var ts; return; } break; - case 144 /* Parameter */: + case 145 /* Parameter */: // Check modifiers of parameter declaration if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); return; } break; - case 179 /* CallExpression */: - case 180 /* NewExpression */: - case 199 /* ExpressionWithTypeArguments */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: + case 200 /* ExpressionWithTypeArguments */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); @@ -62670,8 +67368,8 @@ var ts; } break; } - for (var _b = 0, nodes_6 = nodes; _b < nodes_6.length; _b++) { - var node = nodes_6[_b]; + for (var _b = 0, nodes_8 = nodes; _b < nodes_8.length; _b++) { + var node = nodes_8[_b]; walk(node); } } @@ -62683,7 +67381,8 @@ var ts; if (isConstValid) { continue; } - // Fallthrough to report error + // to report error, + // falls through case 113 /* PublicKeyword */: case 111 /* PrivateKeyword */: case 112 /* ProtectedKeyword */: @@ -62711,12 +67410,34 @@ var ts; }); } function getDeclarationDiagnosticsWorker(sourceFile, cancellationToken) { + return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedDeclarationDiagnosticsForFile, getDeclarationDiagnosticsForFileNoCache); + } + function getDeclarationDiagnosticsForFileNoCache(sourceFile, cancellationToken) { return runWithCancellationToken(function () { var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile, cancellationToken); // Don't actually write any files since we're just getting diagnostics. return ts.getDeclarationDiagnostics(getEmitHost(ts.noop), resolver, sourceFile); }); } + function getAndCacheDiagnostics(sourceFile, cancellationToken, cache, getDiagnostics) { + var cachedResult = sourceFile + ? cache.perFile && cache.perFile.get(sourceFile.path) + : cache.allDiagnostics; + if (cachedResult) { + return cachedResult; + } + var result = getDiagnostics(sourceFile, cancellationToken) || emptyArray; + if (sourceFile) { + if (!cache.perFile) { + cache.perFile = ts.createFileMap(); + } + cache.perFile.set(sourceFile.path, result); + } + else { + cache.allDiagnostics = result; + } + return result; + } function getDeclarationDiagnosticsForFile(sourceFile, cancellationToken) { return ts.isDeclarationFile(sourceFile) ? [] : getDeclarationDiagnosticsWorker(sourceFile, cancellationToken); } @@ -62759,11 +67480,10 @@ var ts; && (options.isolatedModules || isExternalModuleFile) && !file.isDeclarationFile) { // synthesize 'import "tslib"' declaration - var externalHelpersModuleReference = ts.createSynthesizedNode(9 /* StringLiteral */); - externalHelpersModuleReference.text = ts.externalHelpersModuleNameText; - var importDecl = ts.createSynthesizedNode(235 /* ImportDeclaration */); - importDecl.parent = file; + var externalHelpersModuleReference = ts.createLiteral(ts.externalHelpersModuleNameText); + var importDecl = ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*importClause*/ undefined); externalHelpersModuleReference.parent = importDecl; + importDecl.parent = file; imports = [externalHelpersModuleReference]; } for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { @@ -62779,9 +67499,9 @@ var ts; return; function collectModuleReferences(node, inAmbientModule) { switch (node.kind) { - case 235 /* ImportDeclaration */: - case 234 /* ImportEqualsDeclaration */: - case 241 /* ExportDeclaration */: + case 237 /* ImportDeclaration */: + case 236 /* ImportEqualsDeclaration */: + case 243 /* ExportDeclaration */: var moduleNameExpr = ts.getExternalModuleName(node); if (!moduleNameExpr || moduleNameExpr.kind !== 9 /* StringLiteral */) { break; @@ -62796,7 +67516,7 @@ var ts; (imports || (imports = [])).push(moduleNameExpr); } break; - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: if (ts.isAmbientModule(node) && (inAmbientModule || ts.hasModifier(node, 2 /* Ambient */) || ts.isDeclarationFile(file))) { var moduleName = node.name; // Ambient module declarations can be interpreted as augmentations for some existing external modules. @@ -62896,18 +67616,18 @@ var ts; } // If the file was previously found via a node_modules search, but is now being processed as a root file, // then everything it sucks in may also be marked incorrectly, and needs to be checked again. - if (file_1 && sourceFilesFoundSearchingNodeModules[file_1.path] && currentNodeModulesDepth == 0) { - sourceFilesFoundSearchingNodeModules[file_1.path] = false; + if (file_1 && sourceFilesFoundSearchingNodeModules.get(file_1.path) && currentNodeModulesDepth === 0) { + sourceFilesFoundSearchingNodeModules.set(file_1.path, false); if (!options.noResolve) { processReferencedFiles(file_1, isDefaultLib); processTypeReferenceDirectives(file_1); } - modulesWithElidedImports[file_1.path] = false; + modulesWithElidedImports.set(file_1.path, false); processImportedModules(file_1); } - else if (file_1 && modulesWithElidedImports[file_1.path]) { + else if (file_1 && modulesWithElidedImports.get(file_1.path)) { if (currentNodeModulesDepth < maxNodeModuleJsDepth) { - modulesWithElidedImports[file_1.path] = false; + modulesWithElidedImports.set(file_1.path, false); processImportedModules(file_1); } } @@ -62924,7 +67644,7 @@ var ts; }); filesByName.set(path, file); if (file) { - sourceFilesFoundSearchingNodeModules[path] = (currentNodeModulesDepth > 0); + sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0); file.path = path; if (host.useCaseSensitiveFileNames()) { // for case-sensitive file systems check if we've already seen some file with similar filename ignoring case @@ -62973,7 +67693,7 @@ var ts; } function processTypeReferenceDirective(typeReferenceDirective, resolvedTypeReferenceDirective, refFile, refPos, refEnd) { // If we already found this library as a primary reference - nothing to do - var previousResolution = resolvedTypeReferenceDirectives[typeReferenceDirective]; + var previousResolution = resolvedTypeReferenceDirectives.get(typeReferenceDirective); if (previousResolution && previousResolution.primary) { return; } @@ -63007,7 +67727,7 @@ var ts; fileProcessingDiagnostics.add(createDiagnostic(refFile, refPos, refEnd, ts.Diagnostics.Cannot_find_type_definition_file_for_0, typeReferenceDirective)); } if (saveResolution) { - resolvedTypeReferenceDirectives[typeReferenceDirective] = resolvedTypeReferenceDirective; + resolvedTypeReferenceDirectives.set(typeReferenceDirective, resolvedTypeReferenceDirective); } } function createDiagnostic(refFile, refPos, refEnd, message) { @@ -63056,7 +67776,7 @@ var ts; // This may still end up being an untyped module -- the file won't be included but imports will be allowed. var shouldAddFile = resolvedFileName && !getResolutionDiagnostic(options, resolution) && !options.noResolve && i < file.imports.length && !elideImport; if (elideImport) { - modulesWithElidedImports[file.path] = true; + modulesWithElidedImports.set(file.path, true); } else if (shouldAddFile) { var path = ts.toPath(resolvedFileName, currentDirectory, getCanonicalFileName); @@ -63075,8 +67795,8 @@ var ts; } function computeCommonSourceDirectory(sourceFiles) { var fileNames = []; - for (var _i = 0, sourceFiles_6 = sourceFiles; _i < sourceFiles_6.length; _i++) { - var file = sourceFiles_6[_i]; + for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) { + var file = sourceFiles_2[_i]; if (!file.isDeclarationFile) { fileNames.push(file.fileName); } @@ -63087,8 +67807,8 @@ var ts; var allFilesBelongToPath = true; if (sourceFiles) { var absoluteRootDirectoryPath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(rootDirectory, currentDirectory)); - for (var _i = 0, sourceFiles_7 = sourceFiles; _i < sourceFiles_7.length; _i++) { - var sourceFile = sourceFiles_7[_i]; + for (var _i = 0, sourceFiles_3 = sourceFiles; _i < sourceFiles_3.length; _i++) { + var sourceFile = sourceFiles_3[_i]; if (!ts.isDeclarationFile(sourceFile)) { var absoluteSourceFilePath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { @@ -63182,7 +67902,7 @@ var ts; if (options.lib && options.noLib) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "lib", "noLib")); } - if (options.noImplicitUseStrict && options.alwaysStrict) { + if (options.noImplicitUseStrict && (options.alwaysStrict === undefined ? options.strict : options.alwaysStrict)) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "noImplicitUseStrict", "alwaysStrict")); } var languageVersion = options.target || 0 /* ES3 */; @@ -63228,6 +67948,9 @@ var ts; if (!options.noEmit && options.allowJs && options.declaration) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "allowJs", "declaration")); } + if (options.checkJs && !options.allowJs) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "checkJs", "allowJs")); + } if (options.emitDecoratorMetadata && !options.experimentalDecorators) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators")); @@ -63247,7 +67970,7 @@ var ts; if (!options.noEmit && !options.suppressOutputPathCheck) { var emitHost = getEmitHost(); var emitFilesSeen_1 = ts.createFileMap(!host.useCaseSensitiveFileNames() ? function (key) { return key.toLocaleLowerCase(); } : undefined); - ts.forEachExpectedEmitFile(emitHost, function (emitFileNames) { + ts.forEachEmittedFile(emitHost, function (emitFileNames) { verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen_1); verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen_1); }); @@ -63323,40 +68046,13 @@ var ts; ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean" }; /* @internal */ ts.optionDeclarations = [ - { - name: "charset", - type: "string", - }, - ts.compileOnSaveCommandLineOption, - { - name: "declaration", - shortName: "d", - type: "boolean", - description: ts.Diagnostics.Generates_corresponding_d_ts_file, - }, - { - name: "declarationDir", - type: "string", - isFilePath: true, - paramType: ts.Diagnostics.DIRECTORY, - }, - { - name: "diagnostics", - type: "boolean", - }, - { - name: "extendedDiagnostics", - type: "boolean", - experimental: true - }, - { - name: "emitBOM", - type: "boolean" - }, + // CommandLine only options { name: "help", shortName: "h", type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, description: ts.Diagnostics.Print_this_message, }, { @@ -63364,220 +68060,58 @@ var ts; shortName: "?", type: "boolean" }, + { + name: "all", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Show_all_compiler_options, + }, + { + name: "version", + shortName: "v", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Print_the_compiler_s_version, + }, { name: "init", type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, description: ts.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file, }, - { - name: "inlineSourceMap", - type: "boolean", - }, - { - name: "inlineSources", - type: "boolean", - }, - { - name: "jsx", - type: ts.createMap({ - "preserve": 1 /* Preserve */, - "react": 2 /* React */ - }), - paramType: ts.Diagnostics.KIND, - description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_or_react, - }, - { - name: "reactNamespace", - type: "string", - description: ts.Diagnostics.Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit - }, - { - name: "jsxFactory", - type: "string", - description: ts.Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h - }, - { - name: "listFiles", - type: "boolean", - }, - { - name: "locale", - type: "string", - }, - { - name: "mapRoot", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, - paramType: ts.Diagnostics.LOCATION, - }, - { - name: "module", - shortName: "m", - type: ts.createMap({ - "none": ts.ModuleKind.None, - "commonjs": ts.ModuleKind.CommonJS, - "amd": ts.ModuleKind.AMD, - "system": ts.ModuleKind.System, - "umd": ts.ModuleKind.UMD, - "es6": ts.ModuleKind.ES2015, - "es2015": ts.ModuleKind.ES2015, - }), - description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015, - paramType: ts.Diagnostics.KIND, - }, - { - name: "newLine", - type: ts.createMap({ - "crlf": 0 /* CarriageReturnLineFeed */, - "lf": 1 /* LineFeed */ - }), - description: ts.Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, - paramType: ts.Diagnostics.NEWLINE, - }, - { - name: "noEmit", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_outputs, - }, - { - name: "noEmitHelpers", - type: "boolean" - }, - { - name: "noEmitOnError", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported, - }, - { - name: "noErrorTruncation", - type: "boolean" - }, - { - name: "noImplicitAny", - type: "boolean", - description: ts.Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type, - }, - { - name: "noImplicitThis", - type: "boolean", - description: ts.Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type, - }, - { - name: "noUnusedLocals", - type: "boolean", - description: ts.Diagnostics.Report_errors_on_unused_locals, - }, - { - name: "noUnusedParameters", - type: "boolean", - description: ts.Diagnostics.Report_errors_on_unused_parameters, - }, - { - name: "noLib", - type: "boolean", - }, - { - name: "noResolve", - type: "boolean", - }, - { - name: "skipDefaultLibCheck", - type: "boolean", - }, - { - name: "skipLibCheck", - type: "boolean", - description: ts.Diagnostics.Skip_type_checking_of_declaration_files, - }, - { - name: "out", - type: "string", - isFilePath: false, - // for correct behaviour, please use outFile - paramType: ts.Diagnostics.FILE, - }, - { - name: "outFile", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Concatenate_and_emit_output_to_single_file, - paramType: ts.Diagnostics.FILE, - }, - { - name: "outDir", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Redirect_output_structure_to_the_directory, - paramType: ts.Diagnostics.DIRECTORY, - }, - { - name: "preserveConstEnums", - type: "boolean", - description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code - }, - { - name: "pretty", - description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental, - type: "boolean" - }, { name: "project", shortName: "p", type: "string", isFilePath: true, - description: ts.Diagnostics.Compile_the_project_in_the_given_directory, - paramType: ts.Diagnostics.DIRECTORY + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + paramType: ts.Diagnostics.FILE_OR_DIRECTORY, + description: ts.Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json, }, { - name: "removeComments", + name: "pretty", type: "boolean", - description: ts.Diagnostics.Do_not_emit_comments_to_output, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental }, { - name: "rootDir", - type: "string", - isFilePath: true, - paramType: ts.Diagnostics.LOCATION, - description: ts.Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, - }, - { - name: "isolatedModules", + name: "watch", + shortName: "w", type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Watch_input_files, }, - { - name: "sourceMap", - type: "boolean", - description: ts.Diagnostics.Generates_corresponding_map_file, - }, - { - name: "sourceRoot", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, - paramType: ts.Diagnostics.LOCATION, - }, - { - name: "suppressExcessPropertyErrors", - type: "boolean", - description: ts.Diagnostics.Suppress_excess_property_checks_for_object_literals, - experimental: true - }, - { - name: "suppressImplicitAnyIndexErrors", - type: "boolean", - description: ts.Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures, - }, - { - name: "stripInternal", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, - experimental: true - }, + // Basic { name: "target", shortName: "t", - type: ts.createMap({ + type: ts.createMapFromTemplate({ "es3": 0 /* ES3 */, "es5": 1 /* ES5 */, "es6": 2 /* ES2015 */, @@ -63586,144 +68120,34 @@ var ts; "es2017": 4 /* ES2017 */, "esnext": 5 /* ESNext */, }), - description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015, paramType: ts.Diagnostics.VERSION, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT, }, { - name: "version", - shortName: "v", - type: "boolean", - description: ts.Diagnostics.Print_the_compiler_s_version, - }, - { - name: "watch", - shortName: "w", - type: "boolean", - description: ts.Diagnostics.Watch_input_files, - }, - { - name: "experimentalDecorators", - type: "boolean", - description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators - }, - { - name: "emitDecoratorMetadata", - type: "boolean", - experimental: true, - description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators - }, - { - name: "moduleResolution", - type: ts.createMap({ - "node": ts.ModuleResolutionKind.NodeJs, - "classic": ts.ModuleResolutionKind.Classic, + name: "module", + shortName: "m", + type: ts.createMapFromTemplate({ + "none": ts.ModuleKind.None, + "commonjs": ts.ModuleKind.CommonJS, + "amd": ts.ModuleKind.AMD, + "system": ts.ModuleKind.System, + "umd": ts.ModuleKind.UMD, + "es6": ts.ModuleKind.ES2015, + "es2015": ts.ModuleKind.ES2015, }), - description: ts.Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6, - paramType: ts.Diagnostics.STRATEGY, - }, - { - name: "allowUnusedLabels", - type: "boolean", - description: ts.Diagnostics.Do_not_report_errors_on_unused_labels - }, - { - name: "noImplicitReturns", - type: "boolean", - description: ts.Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value - }, - { - name: "noFallthroughCasesInSwitch", - type: "boolean", - description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement - }, - { - name: "allowUnreachableCode", - type: "boolean", - description: ts.Diagnostics.Do_not_report_errors_on_unreachable_code - }, - { - name: "forceConsistentCasingInFileNames", - type: "boolean", - description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file - }, - { - name: "baseUrl", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Base_directory_to_resolve_non_absolute_module_names - }, - { - // this option can only be specified in tsconfig.json - // use type = object to copy the value as-is - name: "paths", - type: "object", - isTSConfigOnly: true - }, - { - // this option can only be specified in tsconfig.json - // use type = object to copy the value as-is - name: "rootDirs", - type: "list", - isTSConfigOnly: true, - element: { - name: "rootDirs", - type: "string", - isFilePath: true - } - }, - { - name: "typeRoots", - type: "list", - element: { - name: "typeRoots", - type: "string", - isFilePath: true - } - }, - { - name: "types", - type: "list", - element: { - name: "types", - type: "string" - }, - description: ts.Diagnostics.Type_declaration_files_to_be_included_in_compilation - }, - { - name: "traceResolution", - type: "boolean", - description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process - }, - { - name: "allowJs", - type: "boolean", - description: ts.Diagnostics.Allow_javascript_files_to_be_compiled - }, - { - name: "allowSyntheticDefaultImports", - type: "boolean", - description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking - }, - { - name: "noImplicitUseStrict", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_use_strict_directives_in_module_output - }, - { - name: "maxNodeModuleJsDepth", - type: "number", - description: ts.Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files - }, - { - name: "listEmittedFiles", - type: "boolean" + paramType: ts.Diagnostics.KIND, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015, }, { name: "lib", type: "list", element: { name: "lib", - type: ts.createMap({ + type: ts.createMapFromTemplate({ // JavaScript only "es5": "lib.es5.d.ts", "es6": "lib.es2015.d.ts", @@ -63731,6 +68155,7 @@ var ts; "es7": "lib.es2016.d.ts", "es2016": "lib.es2016.d.ts", "es2017": "lib.es2017.d.ts", + "esnext": "lib.esnext.d.ts", // Host only "dom": "lib.dom.d.ts", "dom.iterable": "lib.dom.iterable.d.ts", @@ -63750,28 +68175,487 @@ var ts; "es2017.object": "lib.es2017.object.d.ts", "es2017.sharedmemory": "lib.es2017.sharedmemory.d.ts", "es2017.string": "lib.es2017.string.d.ts", + "esnext.asynciterable": "lib.esnext.asynciterable.d.ts", }), }, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon }, { - name: "disableSizeLimit", - type: "boolean" + name: "allowJs", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Allow_javascript_files_to_be_compiled }, { - name: "strictNullChecks", + name: "checkJs", type: "boolean", - description: ts.Diagnostics.Enable_strict_null_checks + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Report_errors_in_js_files + }, + { + name: "jsx", + type: ts.createMapFromTemplate({ + "preserve": 1 /* Preserve */, + "react-native": 3 /* ReactNative */, + "react": 2 /* React */ + }), + paramType: ts.Diagnostics.KIND, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_react_native_or_react, + }, + { + name: "declaration", + shortName: "d", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Generates_corresponding_d_ts_file, + }, + { + name: "sourceMap", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Generates_corresponding_map_file, + }, + { + name: "outFile", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.FILE, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Concatenate_and_emit_output_to_single_file, + }, + { + name: "outDir", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.DIRECTORY, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Redirect_output_structure_to_the_directory, + }, + { + name: "rootDir", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.LOCATION, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, + }, + { + name: "removeComments", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Do_not_emit_comments_to_output, + }, + { + name: "noEmit", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Do_not_emit_outputs, }, { name: "importHelpers", type: "boolean", + category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Import_emit_helpers_from_tslib }, + { + name: "downlevelIteration", + type: "boolean", + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3 + }, + { + name: "isolatedModules", + type: "boolean", + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule + }, + // Strict Type Checks + { + name: "strict", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Enable_all_strict_type_checking_options + }, + { + name: "noImplicitAny", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type, + }, + { + name: "strictNullChecks", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Enable_strict_null_checks + }, + { + name: "noImplicitThis", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type, + }, { name: "alwaysStrict", type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, description: ts.Diagnostics.Parse_in_strict_mode_and_emit_use_strict_for_each_source_file + }, + // Additional Checks + { + name: "noUnusedLocals", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_errors_on_unused_locals, + }, + { + name: "noUnusedParameters", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_errors_on_unused_parameters, + }, + { + name: "noImplicitReturns", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value + }, + { + name: "noFallthroughCasesInSwitch", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement + }, + // Module Resolution + { + name: "moduleResolution", + type: ts.createMapFromTemplate({ + "node": ts.ModuleResolutionKind.NodeJs, + "classic": ts.ModuleResolutionKind.Classic, + }), + paramType: ts.Diagnostics.STRATEGY, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6, + }, + { + name: "baseUrl", + type: "string", + isFilePath: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Base_directory_to_resolve_non_absolute_module_names + }, + { + // this option can only be specified in tsconfig.json + // use type = object to copy the value as-is + name: "paths", + type: "object", + isTSConfigOnly: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl + }, + { + // this option can only be specified in tsconfig.json + // use type = object to copy the value as-is + name: "rootDirs", + type: "list", + isTSConfigOnly: true, + element: { + name: "rootDirs", + type: "string", + isFilePath: true + }, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime + }, + { + name: "typeRoots", + type: "list", + element: { + name: "typeRoots", + type: "string", + isFilePath: true + }, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.List_of_folders_to_include_type_definitions_from + }, + { + name: "types", + type: "list", + element: { + name: "types", + type: "string" + }, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Type_declaration_files_to_be_included_in_compilation + }, + { + name: "allowSyntheticDefaultImports", + type: "boolean", + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking + }, + // Source Maps + { + name: "sourceRoot", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.LOCATION, + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, + }, + { + name: "mapRoot", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.LOCATION, + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, + }, + { + name: "inlineSourceMap", + type: "boolean", + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file + }, + { + name: "inlineSources", + type: "boolean", + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set + }, + // Experimental + { + name: "experimentalDecorators", + type: "boolean", + category: ts.Diagnostics.Experimental_Options, + description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators + }, + { + name: "emitDecoratorMetadata", + type: "boolean", + category: ts.Diagnostics.Experimental_Options, + description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators + }, + // Advanced + { + name: "jsxFactory", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h + }, + { + name: "diagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_diagnostic_information + }, + { + name: "extendedDiagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_verbose_diagnostic_information + }, + { + name: "traceResolution", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process + }, + { + name: "listFiles", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Print_names_of_files_part_of_the_compilation + }, + { + name: "listEmittedFiles", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Print_names_of_generated_files_part_of_the_compilation + }, + { + name: "out", + type: "string", + isFilePath: false, + // for correct behaviour, please use outFile + category: ts.Diagnostics.Advanced_Options, + paramType: ts.Diagnostics.FILE, + description: ts.Diagnostics.Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file, + }, + { + name: "reactNamespace", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit + }, + { + name: "skipDefaultLibCheck", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files + }, + { + name: "charset", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.The_character_set_of_the_input_files + }, + { + name: "emitBOM", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files + }, + { + name: "locale", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.The_locale_used_when_displaying_messages_to_the_user_e_g_en_us + }, + { + name: "newLine", + type: ts.createMapFromTemplate({ + "crlf": 0 /* CarriageReturnLineFeed */, + "lf": 1 /* LineFeed */ + }), + paramType: ts.Diagnostics.NEWLINE, + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, + }, + { + name: "noErrorTruncation", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_truncate_error_messages + }, + { + name: "noLib", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_include_the_default_library_file_lib_d_ts + }, + { + name: "noResolve", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files + }, + { + name: "stripInternal", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, + }, + { + name: "disableSizeLimit", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Disable_size_limitations_on_JavaScript_projects + }, + { + name: "noImplicitUseStrict", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_emit_use_strict_directives_in_module_output + }, + { + name: "noEmitHelpers", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_generate_custom_helper_functions_like_extends_in_compiled_output + }, + { + name: "noEmitOnError", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported, + }, + { + name: "preserveConstEnums", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code + }, + { + name: "declarationDir", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.DIRECTORY, + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Output_directory_for_generated_declaration_files + }, + { + name: "skipLibCheck", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Skip_type_checking_of_declaration_files, + }, + { + name: "allowUnusedLabels", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_report_errors_on_unused_labels + }, + { + name: "allowUnreachableCode", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_report_errors_on_unreachable_code + }, + { + name: "suppressExcessPropertyErrors", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Suppress_excess_property_checks_for_object_literals, + }, + { + name: "suppressImplicitAnyIndexErrors", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures, + }, + { + name: "forceConsistentCasingInFileNames", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file + }, + { + name: "maxNodeModuleJsDepth", + type: "number", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files + }, + { + // A list of plugins to load in the language service + name: "plugins", + type: "list", + isTSConfigOnly: true, + element: { + name: "plugin", + type: "object" + }, + description: ts.Diagnostics.List_of_language_service_plugins } ]; /* @internal */ @@ -63808,8 +68692,7 @@ var ts; ts.defaultInitCompilerOptions = { module: ts.ModuleKind.CommonJS, target: 1 /* ES5 */, - noImplicitAny: false, - sourceMap: false, + strict: true }; var optionNameMapCache; /* @internal */ @@ -63834,9 +68717,9 @@ var ts; var optionNameMap = ts.createMap(); var shortOptionNames = ts.createMap(); ts.forEach(ts.optionDeclarations, function (option) { - optionNameMap[option.name.toLowerCase()] = option; + optionNameMap.set(option.name.toLowerCase(), option); if (option.shortName) { - shortOptionNames[option.shortName] = option.name; + shortOptionNames.set(option.shortName, option.name); } }); optionNameMapCache = { optionNameMap: optionNameMap, shortOptionNames: shortOptionNames }; @@ -63845,20 +68728,13 @@ var ts; ts.getOptionNameMap = getOptionNameMap; /* @internal */ function createCompilerDiagnosticForInvalidCustomType(opt) { - var namesOfType = Object.keys(opt.type).map(function (key) { return "'" + key + "'"; }).join(", "); + var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'" + key + "'"; }).join(", "); return ts.createCompilerDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType); } ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType; /* @internal */ function parseCustomTypeOption(opt, value, errors) { - var key = trimString((value || "")).toLowerCase(); - var map = opt.type; - if (key in map) { - return map[key]; - } - else { - errors.push(createCompilerDiagnosticForInvalidCustomType(opt)); - } + return convertJsonOptionOfCustomType(opt, trimString(value || ""), errors); } ts.parseCustomTypeOption = parseCustomTypeOption; /* @internal */ @@ -63882,7 +68758,6 @@ var ts; } } ts.parseListTypeOption = parseListTypeOption; - /* @internal */ function parseCommandLine(commandLine, readFile) { var options = {}; var fileNames = []; @@ -63905,11 +68780,12 @@ var ts; else if (s.charCodeAt(0) === 45 /* minus */) { s = s.slice(s.charCodeAt(1) === 45 /* minus */ ? 2 : 1).toLowerCase(); // Try to translate short option names to their full equivalents. - if (s in shortOptionNames) { - s = shortOptionNames[s]; + var short = shortOptionNames.get(s); + if (short !== undefined) { + s = short; } - if (s in optionNameMap) { - var opt = optionNameMap[s]; + var opt = optionNameMap.get(s); + if (opt) { if (opt.isTSConfigOnly) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file, opt.name)); } @@ -63997,9 +68873,9 @@ var ts; } ts.parseCommandLine = parseCommandLine; /** - * Read tsconfig.json file - * @param fileName The path to the config file - */ + * Read tsconfig.json file + * @param fileName The path to the config file + */ function readConfigFile(fileName, readFile) { var text = ""; try { @@ -64012,10 +68888,10 @@ var ts; } ts.readConfigFile = readConfigFile; /** - * Parse the text of the tsconfig.json file - * @param fileName The path to the config file - * @param jsonText The text of the config file - */ + * Parse the text of the tsconfig.json file + * @param fileName The path to the config file + * @param jsonText The text of the config file + */ function parseConfigFileTextToJson(fileName, jsonText, stripComments) { if (stripComments === void 0) { stripComments = true; } try { @@ -64033,7 +68909,7 @@ var ts; * @param fileNames array of filenames to be generated into tsconfig.json */ /* @internal */ - function generateTSConfig(options, fileNames) { + function generateTSConfig(options, fileNames, newLine) { var compilerOptions = ts.extend(options, ts.defaultInitCompilerOptions); var configurations = { compilerOptions: serializeCompilerOptions(compilerOptions) @@ -64042,7 +68918,7 @@ var ts; // only set the files property if we have at least one file configurations.files = fileNames; } - return configurations; + return writeConfigurations(); function getCustomTypeMapOfCommandLineOption(optionDefinition) { if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean") { // this is of a type CommandLineOptionOfPrimitiveType @@ -64057,58 +68933,130 @@ var ts; } function getNameOfCompilerOptionValue(value, customTypeMap) { // There is a typeMap associated with this command-line option so use it to map value back to its name - for (var key in customTypeMap) { - if (customTypeMap[key] === value) { + return ts.forEachEntry(customTypeMap, function (mapValue, key) { + if (mapValue === value) { return key; } - } - return undefined; + }); } function serializeCompilerOptions(options) { - var result = ts.createMap(); + var result = {}; var optionsNameMap = getOptionNameMap().optionNameMap; - for (var name_42 in options) { - if (ts.hasProperty(options, name_42)) { + for (var name in options) { + if (ts.hasProperty(options, name)) { // tsconfig only options cannot be specified via command line, // so we can assume that only types that can appear here string | number | boolean - switch (name_42) { - case "init": - case "watch": - case "version": - case "help": - case "project": - break; - default: - var value = options[name_42]; - var optionDefinition = optionsNameMap[name_42.toLowerCase()]; - if (optionDefinition) { - var customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition); - if (!customTypeMap) { - // There is no map associated with this compiler option then use the value as-is - // This is the case if the value is expect to be string, number, boolean or list of string - result[name_42] = value; - } - else { - if (optionDefinition.type === "list") { - var convertedValue = []; - for (var _i = 0, _a = value; _i < _a.length; _i++) { - var element = _a[_i]; - convertedValue.push(getNameOfCompilerOptionValue(element, customTypeMap)); - } - result[name_42] = convertedValue; - } - else { - // There is a typeMap associated with this command-line option so use it to map value back to its name - result[name_42] = getNameOfCompilerOptionValue(value, customTypeMap); - } + if (optionsNameMap.has(name) && optionsNameMap.get(name).category === ts.Diagnostics.Command_line_Options) { + continue; + } + var value = options[name]; + var optionDefinition = optionsNameMap.get(name.toLowerCase()); + if (optionDefinition) { + var customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition); + if (!customTypeMap) { + // There is no map associated with this compiler option then use the value as-is + // This is the case if the value is expect to be string, number, boolean or list of string + result[name] = value; + } + else { + if (optionDefinition.type === "list") { + var convertedValue = []; + for (var _i = 0, _a = value; _i < _a.length; _i++) { + var element = _a[_i]; + convertedValue.push(getNameOfCompilerOptionValue(element, customTypeMap)); } + result[name] = convertedValue; } - break; + else { + // There is a typeMap associated with this command-line option so use it to map value back to its name + result[name] = getNameOfCompilerOptionValue(value, customTypeMap); + } + } } } } return result; } + function getDefaultValueForOption(option) { + switch (option.type) { + case "number": + return 1; + case "boolean": + return true; + case "string": + return option.isFilePath ? "./" : ""; + case "list": + return []; + case "object": + return {}; + default: + return ts.arrayFrom(option.type.keys())[0]; + } + } + function makePadding(paddingLength) { + return Array(paddingLength + 1).join(" "); + } + function writeConfigurations() { + // Filter applicable options to place in the file + var categorizedOptions = ts.reduceLeft(ts.filter(ts.optionDeclarations, function (o) { return o.category !== ts.Diagnostics.Command_line_Options && o.category !== ts.Diagnostics.Advanced_Options; }), function (memo, value) { + if (value.category) { + var name = ts.getLocaleSpecificMessage(value.category); + (memo[name] || (memo[name] = [])).push(value); + } + return memo; + }, {}); + // Serialize all options and thier descriptions + var marginLength = 0; + var seenKnownKeys = 0; + var nameColumn = []; + var descriptionColumn = []; + var knownKeysCount = ts.getOwnKeys(configurations.compilerOptions).length; + for (var category in categorizedOptions) { + if (nameColumn.length !== 0) { + nameColumn.push(""); + descriptionColumn.push(""); + } + nameColumn.push("/* " + category + " */"); + descriptionColumn.push(""); + for (var _i = 0, _a = categorizedOptions[category]; _i < _a.length; _i++) { + var option = _a[_i]; + var optionName = void 0; + if (ts.hasProperty(configurations.compilerOptions, option.name)) { + optionName = "\"" + option.name + "\": " + JSON.stringify(configurations.compilerOptions[option.name]) + ((seenKnownKeys += 1) === knownKeysCount ? "" : ","); + } + else { + optionName = "// \"" + option.name + "\": " + JSON.stringify(getDefaultValueForOption(option)) + ","; + } + nameColumn.push(optionName); + descriptionColumn.push("/* " + (option.description && ts.getLocaleSpecificMessage(option.description) || option.name) + " */"); + marginLength = Math.max(optionName.length, marginLength); + } + } + // Write the output + var tab = makePadding(2); + var result = []; + result.push("{"); + result.push(tab + "\"compilerOptions\": {"); + // Print out each row, aligning all the descriptions on the same column. + for (var i = 0; i < nameColumn.length; i++) { + var optionName = nameColumn[i]; + var description = descriptionColumn[i]; + result.push(tab + tab + optionName + makePadding(marginLength - optionName.length + 2) + description); + } + if (configurations.files && configurations.files.length) { + result.push(tab + "},"); + result.push(tab + "\"files\": ["); + for (var i = 0; i < configurations.files.length; i++) { + result.push("" + tab + tab + JSON.stringify(configurations.files[i]) + (i === configurations.files.length - 1 ? "" : ",")); + } + result.push(tab + "]"); + } + else { + result.push(tab + "}"); + } + result.push("}"); + return result.join(newLine); + } } ts.generateTSConfig = generateTSConfig; /** @@ -64136,16 +69084,18 @@ var ts; return output; } /** - * Parse the contents of a config file (tsconfig.json). - * @param json The contents of the config file to parse - * @param host Instance of ParseConfigHost used to enumerate files in folder. - * @param basePath A root directory to resolve relative path entries in the config - * file to. e.g. outDir - */ - function parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack) { + * Parse the contents of a config file (tsconfig.json). + * @param json The contents of the config file to parse + * @param host Instance of ParseConfigHost used to enumerate files in folder. + * @param basePath A root directory to resolve relative path entries in the config + * file to. e.g. outDir + */ + function parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions) { if (existingOptions === void 0) { existingOptions = {}; } if (resolutionStack === void 0) { resolutionStack = []; } + if (extraFileExtensions === void 0) { extraFileExtensions = []; } var errors = []; + basePath = ts.normalizeSlashes(basePath); var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames); var resolvedPath = ts.toPath(configFileName || "", basePath, getCanonicalFileName); if (resolutionStack.indexOf(resolvedPath) >= 0) { @@ -64272,7 +69222,7 @@ var ts; if (fileNames === undefined && includeSpecs === undefined) { includeSpecs = ["**/*"]; } - var result = matchFileNames(fileNames, includeSpecs, excludeSpecs, basePath, options, host, errors); + var result = matchFileNames(fileNames, includeSpecs, excludeSpecs, basePath, options, host, errors, extraFileExtensions); if (result.fileNames.length === 0 && !ts.hasProperty(json, "files") && resolutionStack.length === 0) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, configFileName || "tsconfig.json", JSON.stringify(includeSpecs || []), JSON.stringify(excludeSpecs || []))); } @@ -64323,8 +69273,8 @@ var ts; } var optionNameMap = ts.arrayToMap(optionDeclarations, function (opt) { return opt.name; }); for (var id in jsonOptions) { - if (id in optionNameMap) { - var opt = optionNameMap[id]; + var opt = optionNameMap.get(id); + if (opt) { defaultOptions[opt.name] = convertJsonOption(opt, jsonOptions[id], basePath, errors); } else { @@ -64358,8 +69308,9 @@ var ts; } function convertJsonOptionOfCustomType(opt, value, errors) { var key = value.toLowerCase(); - if (key in opt.type) { - return opt.type[key]; + var val = opt.type.get(key); + if (val !== undefined) { + return val; } else { errors.push(createCompilerDiagnosticForInvalidCustomType(opt)); @@ -64449,7 +69400,7 @@ var ts; * @param host The host used to resolve files and directories. * @param errors An array for diagnostic reporting. */ - function matchFileNames(fileNames, include, exclude, basePath, options, host, errors) { + function matchFileNames(fileNames, include, exclude, basePath, options, host, errors, extraFileExtensions) { basePath = ts.normalizePath(basePath); // The exclude spec list is converted into a regular expression, which allows us to quickly // test whether a file or directory should be excluded before recursively traversing the @@ -64476,14 +69427,14 @@ var ts; var wildcardDirectories = getWildcardDirectories(include, exclude, basePath, host.useCaseSensitiveFileNames); // Rather than requery this for each file and filespec, we query the supported extensions // once and store it on the expansion context. - var supportedExtensions = ts.getSupportedExtensions(options); + var supportedExtensions = ts.getSupportedExtensions(options, extraFileExtensions); // Literal files are always included verbatim. An "include" or "exclude" specification cannot // remove a literal file. if (fileNames) { for (var _i = 0, fileNames_1 = fileNames; _i < fileNames_1.length; _i++) { var fileName = fileNames_1[_i]; var file = ts.combinePaths(basePath, fileName); - literalFileMap[keyMapper(file)] = file; + literalFileMap.set(keyMapper(file), file); } } if (include && include.length > 0) { @@ -64504,14 +69455,13 @@ var ts; // same directory, we should remove it. removeWildcardFilesWithLowerPriorityExtension(file, wildcardFileMap, supportedExtensions, keyMapper); var key = keyMapper(file); - if (!(key in literalFileMap) && !(key in wildcardFileMap)) { - wildcardFileMap[key] = file; + if (!literalFileMap.has(key) && !wildcardFileMap.has(key)) { + wildcardFileMap.set(key, file); } } } - var literalFiles = ts.reduceProperties(literalFileMap, addFileToOutput, []); - var wildcardFiles = ts.reduceProperties(wildcardFileMap, addFileToOutput, []); - wildcardFiles.sort(host.useCaseSensitiveFileNames ? ts.compareStrings : ts.compareStringsCaseInsensitive); + var literalFiles = ts.arrayFrom(literalFileMap.values()); + var wildcardFiles = ts.arrayFrom(wildcardFileMap.values()); return { fileNames: literalFiles.concat(wildcardFiles), wildcardDirectories: wildcardDirectories @@ -64519,8 +69469,8 @@ var ts; } function validateSpecs(specs, errors, allowTrailingRecursion) { var validSpecs = []; - for (var _i = 0, specs_2 = specs; _i < specs_2.length; _i++) { - var spec = specs_2[_i]; + for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) { + var spec = specs_1[_i]; if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); } @@ -64554,7 +69504,7 @@ var ts; // /a/b/a?z - Watch /a/b directly to catch any new file matching a?z var rawExcludeRegex = ts.getRegularExpressionForWildcard(exclude, path, "exclude"); var excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames ? "" : "i"); - var wildcardDirectories = ts.createMap(); + var wildcardDirectories = {}; if (include !== undefined) { var recursiveKeys = []; for (var _i = 0, include_1 = include; _i < include_1.length; _i++) { @@ -64576,14 +69526,15 @@ var ts; } } // Remove any subpaths under an existing recursively watched directory. - for (var key in wildcardDirectories) { - for (var _a = 0, recursiveKeys_1 = recursiveKeys; _a < recursiveKeys_1.length; _a++) { - var recursiveKey = recursiveKeys_1[_a]; - if (key !== recursiveKey && ts.containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) { - delete wildcardDirectories[key]; + for (var key in wildcardDirectories) + if (ts.hasProperty(wildcardDirectories, key)) { + for (var _a = 0, recursiveKeys_1 = recursiveKeys; _a < recursiveKeys_1.length; _a++) { + var recursiveKey = recursiveKeys_1[_a]; + if (key !== recursiveKey && ts.containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) { + delete wildcardDirectories[key]; + } } } - } } return wildcardDirectories; } @@ -64610,11 +69561,11 @@ var ts; */ function hasFileWithHigherPriorityExtension(file, literalFiles, wildcardFiles, extensions, keyMapper) { var extensionPriority = ts.getExtensionPriority(file, extensions); - var adjustedExtensionPriority = ts.adjustExtensionPriority(extensionPriority); + var adjustedExtensionPriority = ts.adjustExtensionPriority(extensionPriority, extensions); for (var i = 0 /* Highest */; i < adjustedExtensionPriority; i++) { var higherPriorityExtension = extensions[i]; var higherPriorityPath = keyMapper(ts.changeExtension(file, higherPriorityExtension)); - if (higherPriorityPath in literalFiles || higherPriorityPath in wildcardFiles) { + if (literalFiles.has(higherPriorityPath) || wildcardFiles.has(higherPriorityPath)) { return true; } } @@ -64630,23 +69581,13 @@ var ts; */ function removeWildcardFilesWithLowerPriorityExtension(file, wildcardFiles, extensions, keyMapper) { var extensionPriority = ts.getExtensionPriority(file, extensions); - var nextExtensionPriority = ts.getNextLowestExtensionPriority(extensionPriority); + var nextExtensionPriority = ts.getNextLowestExtensionPriority(extensionPriority, extensions); for (var i = nextExtensionPriority; i < extensions.length; i++) { var lowerPriorityExtension = extensions[i]; var lowerPriorityPath = keyMapper(ts.changeExtension(file, lowerPriorityExtension)); - delete wildcardFiles[lowerPriorityPath]; + wildcardFiles.delete(lowerPriorityPath); } } - /** - * Adds a file to an array of files. - * - * @param output The output array. - * @param file The file path. - */ - function addFileToOutput(output, file) { - output.push(file); - return output; - } /** * Gets a case sensitive key. * @@ -64673,7 +69614,9 @@ var ts; this.text = text; } StringScriptSnapshot.prototype.getText = function (start, end) { - return this.text.substring(start, end); + return start === 0 && end === this.text.length + ? this.text + : this.text.substring(start, end); }; StringScriptSnapshot.prototype.getLength = function () { return this.text.length; @@ -64783,8 +69726,7 @@ var ts; ScriptElementKind.typeElement = "type"; /** enum E */ ScriptElementKind.enumElement = "enum"; - // TODO: GH#9983 - ScriptElementKind.enumMemberElement = "const"; + ScriptElementKind.enumMemberElement = "enum member"; /** * Inside module and script only * const v = .. @@ -64827,6 +69769,10 @@ var ts; ScriptElementKind.letElement = "let"; ScriptElementKind.directory = "directory"; ScriptElementKind.externalModuleName = "external module name"; + /** + * + */ + ScriptElementKind.jsxAttribute = "JSX attribute"; })(ScriptElementKind = ts.ScriptElementKind || (ts.ScriptElementKind = {})); var ScriptElementKindModifier; (function (ScriptElementKindModifier) { @@ -64912,33 +69858,34 @@ var ts; })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 144 /* Parameter */: - case 223 /* VariableDeclaration */: - case 174 /* BindingElement */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 257 /* PropertyAssignment */: - case 258 /* ShorthandPropertyAssignment */: - case 260 /* EnumMember */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 256 /* CatchClause */: + case 145 /* Parameter */: + case 225 /* VariableDeclaration */: + case 175 /* BindingElement */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 260 /* PropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: + case 263 /* EnumMember */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 259 /* CatchClause */: + case 252 /* JsxAttribute */: return 1 /* Value */; - case 143 /* TypeParameter */: - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 161 /* TypeLiteral */: + case 144 /* TypeParameter */: + case 229 /* InterfaceDeclaration */: + case 230 /* TypeAliasDeclaration */: + case 162 /* TypeLiteral */: return 2 /* Type */; - case 226 /* ClassDeclaration */: - case 229 /* EnumDeclaration */: + case 228 /* ClassDeclaration */: + case 231 /* EnumDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: if (ts.isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } @@ -64948,22 +69895,25 @@ var ts; else { return 4 /* Namespace */; } - case 238 /* NamedImports */: - case 239 /* ImportSpecifier */: - case 234 /* ImportEqualsDeclaration */: - case 235 /* ImportDeclaration */: - case 240 /* ExportAssignment */: - case 241 /* ExportDeclaration */: + case 240 /* NamedImports */: + case 241 /* ImportSpecifier */: + case 236 /* ImportEqualsDeclaration */: + case 237 /* ImportDeclaration */: + case 242 /* ExportAssignment */: + case 243 /* ExportDeclaration */: return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; // An external module can be a Value - case 261 /* SourceFile */: + case 264 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { - if (node.parent.kind === 240 /* ExportAssignment */) { + if (node.kind === 264 /* SourceFile */) { + return 1 /* Value */; + } + else if (node.parent.kind === 242 /* ExportAssignment */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } else if (isInRightSideOfImport(node)) { @@ -64988,15 +69938,15 @@ var ts; // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - if (node.parent.kind === 141 /* QualifiedName */ && + if (node.parent.kind === 142 /* QualifiedName */ && node.parent.right === node && - node.parent.parent.kind === 234 /* ImportEqualsDeclaration */) { + node.parent.parent.kind === 236 /* ImportEqualsDeclaration */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } return 4 /* Namespace */; } function isInRightSideOfImport(node) { - while (node.parent.kind === 141 /* QualifiedName */) { + while (node.parent.kind === 142 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -65007,27 +69957,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 141 /* QualifiedName */) { - while (root.parent && root.parent.kind === 141 /* QualifiedName */) { + if (root.parent.kind === 142 /* QualifiedName */) { + while (root.parent && root.parent.kind === 142 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 157 /* TypeReference */ && !isLastClause; + return root.parent.kind === 158 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 177 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 177 /* PropertyAccessExpression */) { + if (root.parent.kind === 178 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 178 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 199 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 255 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 200 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 258 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 226 /* ClassDeclaration */ && root.parent.parent.token === 107 /* ImplementsKeyword */) || - (decl.kind === 227 /* InterfaceDeclaration */ && root.parent.parent.token === 84 /* ExtendsKeyword */); + return (decl.kind === 228 /* ClassDeclaration */ && root.parent.parent.token === 107 /* ImplementsKeyword */) || + (decl.kind === 229 /* InterfaceDeclaration */ && root.parent.parent.token === 84 /* ExtendsKeyword */); } return false; } @@ -65035,17 +69985,17 @@ var ts; if (ts.isRightSideOfQualifiedNameOrPropertyAccess(node)) { node = node.parent; } - return node.parent.kind === 157 /* TypeReference */ || - (node.parent.kind === 199 /* ExpressionWithTypeArguments */ && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || + return node.parent.kind === 158 /* TypeReference */ || + (node.parent.kind === 200 /* ExpressionWithTypeArguments */ && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || (node.kind === 98 /* ThisKeyword */ && !ts.isPartOfExpression(node)) || - node.kind === 167 /* ThisType */; + node.kind === 168 /* ThisType */; } function isCallExpressionTarget(node) { - return isCallOrNewExpressionTarget(node, 179 /* CallExpression */); + return isCallOrNewExpressionTarget(node, 180 /* CallExpression */); } ts.isCallExpressionTarget = isCallExpressionTarget; function isNewExpressionTarget(node) { - return isCallOrNewExpressionTarget(node, 180 /* NewExpression */); + return isCallOrNewExpressionTarget(node, 181 /* NewExpression */); } ts.isNewExpressionTarget = isNewExpressionTarget; function isCallOrNewExpressionTarget(node, kind) { @@ -65058,7 +70008,7 @@ var ts; ts.climbPastPropertyAccess = climbPastPropertyAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 219 /* LabeledStatement */ && referenceNode.label.text === labelName) { + if (referenceNode.kind === 221 /* LabeledStatement */ && referenceNode.label.text === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -65068,13 +70018,13 @@ var ts; ts.getTargetLabel = getTargetLabel; function isJumpStatementTarget(node) { return node.kind === 70 /* Identifier */ && - (node.parent.kind === 215 /* BreakStatement */ || node.parent.kind === 214 /* ContinueStatement */) && + (node.parent.kind === 217 /* BreakStatement */ || node.parent.kind === 216 /* ContinueStatement */) && node.parent.label === node; } ts.isJumpStatementTarget = isJumpStatementTarget; function isLabelOfLabeledStatement(node) { return node.kind === 70 /* Identifier */ && - node.parent.kind === 219 /* LabeledStatement */ && + node.parent.kind === 221 /* LabeledStatement */ && node.parent.label === node; } function isLabelName(node) { @@ -65082,15 +70032,15 @@ var ts; } ts.isLabelName = isLabelName; function isRightSideOfQualifiedName(node) { - return node.parent.kind === 141 /* QualifiedName */ && node.parent.right === node; + return node.parent.kind === 142 /* QualifiedName */ && node.parent.right === node; } ts.isRightSideOfQualifiedName = isRightSideOfQualifiedName; function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 177 /* PropertyAccessExpression */ && node.parent.name === node; + return node && node.parent && node.parent.kind === 178 /* PropertyAccessExpression */ && node.parent.name === node; } ts.isRightSideOfPropertyAccess = isRightSideOfPropertyAccess; function isNameOfModuleDeclaration(node) { - return node.parent.kind === 230 /* ModuleDeclaration */ && node.parent.name === node; + return node.parent.kind === 232 /* ModuleDeclaration */ && node.parent.name === node; } ts.isNameOfModuleDeclaration = isNameOfModuleDeclaration; function isNameOfFunctionDeclaration(node) { @@ -65101,19 +70051,19 @@ var ts; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) { switch (node.parent.kind) { - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 257 /* PropertyAssignment */: - case 260 /* EnumMember */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 230 /* ModuleDeclaration */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 260 /* PropertyAssignment */: + case 263 /* EnumMember */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 232 /* ModuleDeclaration */: return node.parent.name === node; - case 178 /* ElementAccessExpression */: + case 179 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 142 /* ComputedPropertyName */: + case 143 /* ComputedPropertyName */: return true; } } @@ -65162,17 +70112,17 @@ var ts; return undefined; } switch (node.kind) { - case 261 /* SourceFile */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 229 /* EnumDeclaration */: - case 230 /* ModuleDeclaration */: + case 264 /* SourceFile */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 228 /* ClassDeclaration */: + case 229 /* InterfaceDeclaration */: + case 231 /* EnumDeclaration */: + case 232 /* ModuleDeclaration */: return node; } } @@ -65180,46 +70130,46 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 261 /* SourceFile */: + case 264 /* SourceFile */: return ts.isExternalModule(node) ? ts.ScriptElementKind.moduleElement : ts.ScriptElementKind.scriptElement; - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: return ts.ScriptElementKind.moduleElement; - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: return ts.ScriptElementKind.classElement; - case 227 /* InterfaceDeclaration */: return ts.ScriptElementKind.interfaceElement; - case 228 /* TypeAliasDeclaration */: return ts.ScriptElementKind.typeElement; - case 229 /* EnumDeclaration */: return ts.ScriptElementKind.enumElement; - case 223 /* VariableDeclaration */: + case 229 /* InterfaceDeclaration */: return ts.ScriptElementKind.interfaceElement; + case 230 /* TypeAliasDeclaration */: return ts.ScriptElementKind.typeElement; + case 231 /* EnumDeclaration */: return ts.ScriptElementKind.enumElement; + case 225 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 174 /* BindingElement */: + case 175 /* BindingElement */: return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 185 /* ArrowFunction */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: return ts.ScriptElementKind.functionElement; - case 151 /* GetAccessor */: return ts.ScriptElementKind.memberGetAccessorElement; - case 152 /* SetAccessor */: return ts.ScriptElementKind.memberSetAccessorElement; - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 152 /* GetAccessor */: return ts.ScriptElementKind.memberGetAccessorElement; + case 153 /* SetAccessor */: return ts.ScriptElementKind.memberSetAccessorElement; + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: return ts.ScriptElementKind.memberFunctionElement; - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: return ts.ScriptElementKind.memberVariableElement; - case 155 /* IndexSignature */: return ts.ScriptElementKind.indexSignatureElement; - case 154 /* ConstructSignature */: return ts.ScriptElementKind.constructSignatureElement; - case 153 /* CallSignature */: return ts.ScriptElementKind.callSignatureElement; - case 150 /* Constructor */: return ts.ScriptElementKind.constructorImplementationElement; - case 143 /* TypeParameter */: return ts.ScriptElementKind.typeParameterElement; - case 260 /* EnumMember */: return ts.ScriptElementKind.enumMemberElement; - case 144 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? ts.ScriptElementKind.memberVariableElement : ts.ScriptElementKind.parameterElement; - case 234 /* ImportEqualsDeclaration */: - case 239 /* ImportSpecifier */: - case 236 /* ImportClause */: - case 243 /* ExportSpecifier */: - case 237 /* NamespaceImport */: + case 156 /* IndexSignature */: return ts.ScriptElementKind.indexSignatureElement; + case 155 /* ConstructSignature */: return ts.ScriptElementKind.constructSignatureElement; + case 154 /* CallSignature */: return ts.ScriptElementKind.callSignatureElement; + case 151 /* Constructor */: return ts.ScriptElementKind.constructorImplementationElement; + case 144 /* TypeParameter */: return ts.ScriptElementKind.typeParameterElement; + case 263 /* EnumMember */: return ts.ScriptElementKind.enumMemberElement; + case 145 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? ts.ScriptElementKind.memberVariableElement : ts.ScriptElementKind.parameterElement; + case 236 /* ImportEqualsDeclaration */: + case 241 /* ImportSpecifier */: + case 238 /* ImportClause */: + case 245 /* ExportSpecifier */: + case 239 /* NamespaceImport */: return ts.ScriptElementKind.alias; - case 285 /* JSDocTypedefTag */: + case 289 /* JSDocTypedefTag */: return ts.ScriptElementKind.typeElement; default: return ts.ScriptElementKind.unknown; @@ -65233,15 +70183,6 @@ var ts; } } ts.getNodeKind = getNodeKind; - function getStringLiteralTypeForNode(node, typeChecker) { - var searchNode = node.parent.kind === 171 /* LiteralType */ ? node.parent : node; - var type = typeChecker.getTypeAtLocation(searchNode); - if (type && type.flags & 32 /* StringLiteral */) { - return type; - } - return undefined; - } - ts.getStringLiteralTypeForNode = getStringLiteralTypeForNode; function isThis(node) { switch (node.kind) { case 98 /* ThisKeyword */: @@ -65249,7 +70190,7 @@ var ts; return true; case 70 /* Identifier */: // 'this' as a parameter - return ts.identifierIsThisKeyword(node) && node.parent.kind === 144 /* Parameter */; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 145 /* Parameter */; default: return false; } @@ -65258,7 +70199,7 @@ var ts; // Matches the beginning of a triple slash directive var tripleSlashDirectivePrefixRegex = /^\/\/\/\s*= node.end) { + if (c.kind === 293 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { return c; } }); @@ -65497,7 +70438,7 @@ var ts; if (includeJsDocComment === void 0) { includeJsDocComment = false; } var current = sourceFile; outer: while (true) { - if (isToken(current)) { + if (ts.isToken(current)) { // exit early return current; } @@ -65522,8 +70463,8 @@ var ts; } } // find the child that contains 'position' - for (var i = 0, n = current.getChildCount(sourceFile); i < n; i++) { - var child = current.getChildAt(i); + for (var _a = 0, _b = current.getChildren(); _a < _b.length; _a++) { + var child = _b[_a]; // all jsDocComment nodes were already visited if (ts.isJSDocNode(child)) { continue; @@ -65547,18 +70488,18 @@ var ts; } } /** - * The token on the left of the position is the token that strictly includes the position - * or sits to the left of the cursor if it is on a boundary. For example - * - * fo|o -> will return foo - * foo |bar -> will return foo - * - */ + * The token on the left of the position is the token that strictly includes the position + * or sits to the left of the cursor if it is on a boundary. For example + * + * fo|o -> will return foo + * foo |bar -> will return foo + * + */ function findTokenOnLeftOfPosition(file, position) { // Ideally, getTokenAtPosition should return a token. However, it is currently // broken, so we do a check to make sure the result was indeed a token. var tokenAtPosition = getTokenAtPosition(file, position); - if (isToken(tokenAtPosition) && position > tokenAtPosition.getStart(file) && position < tokenAtPosition.getEnd()) { + if (ts.isToken(tokenAtPosition) && position > tokenAtPosition.getStart(file) && position < tokenAtPosition.getEnd()) { return tokenAtPosition; } return findPrecedingToken(position, file); @@ -65567,7 +70508,7 @@ var ts; function findNextToken(previousToken, parent) { return find(parent); function find(n) { - if (isToken(n) && n.pos === previousToken.end) { + if (ts.isToken(n) && n.pos === previousToken.end) { // this is token that starts at the end of previous token - return it return n; } @@ -65590,7 +70531,7 @@ var ts; function findPrecedingToken(position, sourceFile, startNode) { return find(startNode || sourceFile); function findRightmostToken(n) { - if (isToken(n)) { + if (ts.isToken(n)) { return n; } var children = n.getChildren(); @@ -65598,11 +70539,11 @@ var ts; return candidate && findRightmostToken(candidate); } function find(n) { - if (isToken(n)) { + if (ts.isToken(n)) { return n; } var children = n.getChildren(); - for (var i = 0, len = children.length; i < len; i++) { + for (var i = 0; i < children.length; i++) { var child = children[i]; // condition 'position < child.end' checks if child node end after the position // in the example below this condition will be false for 'aaaa' and 'bbbb' and true for 'ccc' @@ -65627,7 +70568,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 261 /* SourceFile */); + ts.Debug.assert(startNode !== undefined || n.kind === 264 /* SourceFile */); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. // Try to find the rightmost token in the file without filtering. @@ -65686,17 +70627,17 @@ var ts; return true; } //
{ |
or
- if (token.kind === 26 /* LessThanToken */ && token.parent.kind === 252 /* JsxExpression */) { + if (token.kind === 26 /* LessThanToken */ && token.parent.kind === 255 /* JsxExpression */) { return true; } //
{ // | // } < /div> - if (token && token.kind === 17 /* CloseBraceToken */ && token.parent.kind === 252 /* JsxExpression */) { + if (token && token.kind === 17 /* CloseBraceToken */ && token.parent.kind === 255 /* JsxExpression */) { return true; } //
|
- if (token.kind === 26 /* LessThanToken */ && token.parent.kind === 249 /* JsxClosingElement */) { + if (token.kind === 26 /* LessThanToken */ && token.parent.kind === 251 /* JsxClosingElement */) { return true; } return false; @@ -65727,10 +70668,10 @@ var ts; // Internally, we represent the end of the comment at the newline and closing '/', respectively. return predicate ? ts.forEach(commentRanges, function (c) { return c.pos < position && - (c.kind == 2 /* SingleLineCommentTrivia */ ? position <= c.end : position < c.end) && + (c.kind === 2 /* SingleLineCommentTrivia */ ? position <= c.end : position < c.end) && predicate(c); }) : ts.forEach(commentRanges, function (c) { return c.pos < position && - (c.kind == 2 /* SingleLineCommentTrivia */ ? position <= c.end : position < c.end); }); + (c.kind === 2 /* SingleLineCommentTrivia */ ? position <= c.end : position < c.end); }); } return false; } @@ -65751,7 +70692,7 @@ var ts; */ function getJsDocTagAtPosition(sourceFile, position) { var node = ts.getTokenAtPosition(sourceFile, position); - if (isToken(node)) { + if (ts.isToken(node)) { switch (node.kind) { case 103 /* VarKeyword */: case 109 /* LetKeyword */: @@ -65808,19 +70749,15 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 157 /* TypeReference */ || node.kind === 179 /* CallExpression */) { + if (node.kind === 158 /* TypeReference */ || node.kind === 180 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 226 /* ClassDeclaration */ || node.kind === 227 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 228 /* ClassDeclaration */ || node.kind === 229 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; } ts.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList; - function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 140 /* LastToken */; - } - ts.isToken = isToken; function isWord(kind) { return kind === 70 /* Identifier */ || ts.isKeyword(kind); } @@ -65877,18 +70814,18 @@ var ts; } ts.compareDataObjects = compareDataObjects; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 175 /* ArrayLiteralExpression */ || - node.kind === 176 /* ObjectLiteralExpression */) { + if (node.kind === 176 /* ArrayLiteralExpression */ || + node.kind === 177 /* ObjectLiteralExpression */) { // [a,b,c] from: // [a, b, c] = someExpression; - if (node.parent.kind === 192 /* BinaryExpression */ && + if (node.parent.kind === 193 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 57 /* EqualsToken */) { return true; } // [a, b, c] from: // for([a, b, c] of expression) - if (node.parent.kind === 213 /* ForOfStatement */ && + if (node.parent.kind === 215 /* ForOfStatement */ && node.parent.initializer === node) { return true; } @@ -65896,7 +70833,7 @@ var ts; // [x, [a, b, c] ] = someExpression // or // {x, a: {a, b, c} } = someExpression - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 257 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 260 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -65924,12 +70861,47 @@ var ts; } } ts.isInNonReferenceComment = isInNonReferenceComment; + function createTextSpanFromNode(node, sourceFile) { + return ts.createTextSpanFromBounds(node.getStart(sourceFile), node.getEnd()); + } + ts.createTextSpanFromNode = createTextSpanFromNode; + function isTypeKeyword(kind) { + switch (kind) { + case 118 /* AnyKeyword */: + case 121 /* BooleanKeyword */: + case 129 /* NeverKeyword */: + case 132 /* NumberKeyword */: + case 133 /* ObjectKeyword */: + case 135 /* StringKeyword */: + case 136 /* SymbolKeyword */: + case 104 /* VoidKeyword */: + return true; + default: + return false; + } + } + ts.isTypeKeyword = isTypeKeyword; + /** True if the symbol is for an external module, as opposed to a namespace. */ + function isExternalModuleSymbol(moduleSymbol) { + ts.Debug.assert(!!(moduleSymbol.flags & 1536 /* Module */)); + return moduleSymbol.name.charCodeAt(0) === 34 /* doubleQuote */; + } + ts.isExternalModuleSymbol = isExternalModuleSymbol; + /** Returns `true` the first time it encounters a node and `false` afterwards. */ + function nodeSeenTracker() { + var seen = []; + return function (node) { + var id = ts.getNodeId(node); + return !seen[id] && (seen[id] = true); + }; + } + ts.nodeSeenTracker = nodeSeenTracker; })(ts || (ts = {})); // Display-part writer helpers /* @internal */ (function (ts) { function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 144 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 145 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -65946,13 +70918,15 @@ var ts; writeSpace: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.space); }, writeStringLiteral: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.stringLiteral); }, writeParameter: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.parameterName); }, + writeProperty: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.propertyName); }, writeSymbol: writeSymbol, writeLine: writeLine, increaseIndent: function () { indent++; }, decreaseIndent: function () { indent--; }, clear: resetWriter, trackSymbol: ts.noop, - reportInaccessibleThisError: ts.noop + reportInaccessibleThisError: ts.noop, + reportIllegalExtends: ts.noop }; function writeIndent() { if (lineStart) { @@ -66105,23 +71079,18 @@ var ts; function getDeclaredName(typeChecker, symbol, location) { // If this is an export or import specifier it could have been renamed using the 'as' syntax. // If so we want to search for whatever is under the cursor. - if (isImportOrExportSpecifierName(location)) { - return location.getText(); - } - else if (ts.isStringOrNumericLiteral(location) && - location.parent.kind === 142 /* ComputedPropertyName */) { + if (isImportOrExportSpecifierName(location) || ts.isStringOrNumericLiteral(location) && location.parent.kind === 143 /* ComputedPropertyName */) { return location.text; } // Try to get the local symbol if we're dealing with an 'export default' // since that symbol has the "true" name. var localExportDefaultSymbol = ts.getLocalSymbolForExportDefault(symbol); - var name = typeChecker.symbolToString(localExportDefaultSymbol || symbol); - return name; + return typeChecker.symbolToString(localExportDefaultSymbol || symbol); } ts.getDeclaredName = getDeclaredName; function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 239 /* ImportSpecifier */ || location.parent.kind === 243 /* ExportSpecifier */) && + (location.parent.kind === 241 /* ImportSpecifier */ || location.parent.kind === 245 /* ExportSpecifier */) && location.parent.propertyName === location; } ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName; @@ -66137,7 +71106,6 @@ var ts; (name.charCodeAt(0) === 34 /* doubleQuote */ || name.charCodeAt(0) === 39 /* singleQuote */)) { return name.substring(1, length - 1); } - ; return name; } ts.stripQuotes = stripQuotes; @@ -66188,6 +71156,22 @@ var ts; }; } ts.sanitizeConfigFile = sanitizeConfigFile; + function getFirstNonSpaceCharacterPosition(text, position) { + while (ts.isWhiteSpace(text.charCodeAt(position))) { + position += 1; + } + return position; + } + ts.getFirstNonSpaceCharacterPosition = getFirstNonSpaceCharacterPosition; + function getOpenBrace(constructor, sourceFile) { + // First token is the open curly, this is where we want to put the 'super' call. + return constructor.body.getFirstToken(sourceFile); + } + ts.getOpenBrace = getOpenBrace; + function getOpenBraceOfClassLike(declaration, sourceFile) { + return ts.getTokenAtPosition(sourceFile, declaration.members.pos - 1); + } + ts.getOpenBraceOfClassLike = getOpenBraceOfClassLike; })(ts || (ts = {})); var ts; (function (ts) { @@ -66236,7 +71220,7 @@ var ts; function canFollow(keyword1, keyword2) { if (ts.isAccessibilityModifier(keyword1)) { if (keyword2 === 124 /* GetKeyword */ || - keyword2 === 133 /* SetKeyword */ || + keyword2 === 134 /* SetKeyword */ || keyword2 === 122 /* ConstructorKeyword */ || keyword2 === 114 /* StaticKeyword */) { // Allow things like "public get", "public constructor" and "public static". @@ -66255,9 +71239,9 @@ var ts; var entries = []; var dense = classifications.spans; var lastEnd = 0; - for (var i = 0, n = dense.length; i < n; i += 3) { + for (var i = 0; i < dense.length; i += 3) { var start = dense[i]; - var length_4 = dense[i + 1]; + var length_5 = dense[i + 1]; var type = dense[i + 2]; // Make a whitespace entry between the last item and this one. if (lastEnd >= 0) { @@ -66266,8 +71250,8 @@ var ts; entries.push({ length: whitespaceLength_1, classification: ts.TokenClass.Whitespace }); } } - entries.push({ length: length_4, classification: convertClassification(type) }); - lastEnd = start + length_4; + entries.push({ length: length_5, classification: convertClassification(type) }); + lastEnd = start + length_5; } var whitespaceLength = text.length - lastEnd; if (whitespaceLength > 0) { @@ -66335,7 +71319,7 @@ var ts; case 5 /* InTemplateMiddleOrTail */: text = "}\n" + text; offset = 2; - // fallthrough + // falls through case 6 /* InTemplateSubstitutionPosition */: templateStack.push(13 /* TemplateHead */); break; @@ -66395,10 +71379,10 @@ var ts; angleBracketStack--; } else if (token === 118 /* AnyKeyword */ || - token === 134 /* StringKeyword */ || + token === 135 /* StringKeyword */ || token === 132 /* NumberKeyword */ || token === 121 /* BooleanKeyword */ || - token === 135 /* SymbolKeyword */) { + token === 136 /* SymbolKeyword */) { if (angleBracketStack > 0 && !syntacticClassifierAbsent) { // If it looks like we're could be in something generic, don't classify this // as a keyword. We may just get overwritten by the syntactic classifier, @@ -66570,7 +71554,7 @@ var ts; } } function isKeyword(token) { - return token >= 71 /* FirstKeyword */ && token <= 140 /* LastKeyword */; + return token >= 71 /* FirstKeyword */ && token <= 141 /* LastKeyword */; } function classFromKind(token) { if (isKeyword(token)) { @@ -66627,10 +71611,10 @@ var ts; // That means we're calling back into the host around every 1.2k of the file we process. // Lib.d.ts has similar numbers. switch (kind) { - case 230 /* ModuleDeclaration */: - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 225 /* FunctionDeclaration */: + case 232 /* ModuleDeclaration */: + case 228 /* ClassDeclaration */: + case 229 /* InterfaceDeclaration */: + case 227 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } @@ -66681,7 +71665,7 @@ var ts; */ function hasValueSideModule(symbol) { return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 230 /* ModuleDeclaration */ && + return declaration.kind === 232 /* ModuleDeclaration */ && ts.getModuleInstanceState(declaration) === 1 /* Instantiated */; }); } @@ -66696,7 +71680,7 @@ var ts; // Only bother calling into the typechecker if this is an identifier that // could possibly resolve to a type name. This makes classification run // in a third of the time it would normally take. - if (classifiableNames[identifier.text]) { + if (classifiableNames.get(identifier.text)) { var symbol = typeChecker.getSymbolAtLocation(node); if (symbol) { var type = classifySymbol(symbol, ts.getMeaningFromLocation(node)); @@ -66742,7 +71726,7 @@ var ts; ts.Debug.assert(classifications.spans.length % 3 === 0); var dense = classifications.spans; var result = []; - for (var i = 0, n = dense.length; i < n; i += 3) { + for (var i = 0; i < dense.length; i += 3) { result.push({ textSpan: ts.createTextSpan(dense[i], dense[i + 1]), classificationType: getClassificationTypeName(dense[i + 2]) @@ -66845,16 +71829,16 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); pos = tag.tagName.end; switch (tag.kind) { - case 281 /* JSDocParameterTag */: + case 285 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 284 /* JSDocTemplateTag */: + case 288 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); break; - case 283 /* JSDocTypeTag */: + case 287 /* JSDocTypeTag */: processElement(tag.typeExpression); break; - case 282 /* JSDocReturnTag */: + case 286 /* JSDocReturnTag */: processElement(tag.typeExpression); break; } @@ -66941,22 +71925,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 248 /* JsxOpeningElement */: + case 250 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 249 /* JsxClosingElement */: + case 251 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 247 /* JsxSelfClosingElement */: + case 249 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 250 /* JsxAttribute */: + case 252 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -66984,17 +71968,17 @@ var ts; if (token) { if (tokenKind === 57 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (token.parent.kind === 223 /* VariableDeclaration */ || - token.parent.kind === 147 /* PropertyDeclaration */ || - token.parent.kind === 144 /* Parameter */ || - token.parent.kind === 250 /* JsxAttribute */) { + if (token.parent.kind === 225 /* VariableDeclaration */ || + token.parent.kind === 148 /* PropertyDeclaration */ || + token.parent.kind === 145 /* Parameter */ || + token.parent.kind === 252 /* JsxAttribute */) { return 5 /* operator */; } } - if (token.parent.kind === 192 /* BinaryExpression */ || - token.parent.kind === 190 /* PrefixUnaryExpression */ || - token.parent.kind === 191 /* PostfixUnaryExpression */ || - token.parent.kind === 193 /* ConditionalExpression */) { + if (token.parent.kind === 193 /* BinaryExpression */ || + token.parent.kind === 191 /* PrefixUnaryExpression */ || + token.parent.kind === 192 /* PostfixUnaryExpression */ || + token.parent.kind === 194 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -67004,7 +71988,7 @@ var ts; return 4 /* numericLiteral */; } else if (tokenKind === 9 /* StringLiteral */) { - return token.parent.kind === 250 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token.parent.kind === 252 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 11 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. @@ -67020,32 +72004,32 @@ var ts; else if (tokenKind === 70 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 143 /* TypeParameter */: + case 144 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 144 /* Parameter */: + case 145 /* Parameter */: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -67062,9 +72046,8 @@ var ts; // Ignore nodes that don't intersect the original span to classify. if (ts.decodedTextSpanIntersectsWith(spanStart, spanLength, element.pos, element.getFullWidth())) { checkForClassificationCancellation(cancellationToken, element.kind); - var children = element.getChildren(sourceFile); - for (var i = 0, n = children.length; i < n; i++) { - var child = children[i]; + for (var _i = 0, _a = element.getChildren(sourceFile); _i < _a.length; _i++) { + var child = _a[_i]; if (!tryClassifyNode(child)) { // Recurse into our child nodes. processElement(child); @@ -67075,259 +72058,31 @@ var ts; } ts.getEncodedSyntacticClassifications = getEncodedSyntacticClassifications; })(ts || (ts = {})); -/// /* @internal */ var ts; (function (ts) { var Completions; (function (Completions) { - function getCompletionsAtPosition(host, typeChecker, log, compilerOptions, sourceFile, position) { - if (ts.isInReferenceComment(sourceFile, position)) { - return getTripleSlashReferenceCompletion(sourceFile, position); - } - if (ts.isInString(sourceFile, position)) { - return getStringLiteralCompletionEntries(sourceFile, position); - } - var completionData = getCompletionData(typeChecker, log, sourceFile, position); - if (!completionData) { - return undefined; - } - var symbols = completionData.symbols, isGlobalCompletion = completionData.isGlobalCompletion, isMemberCompletion = completionData.isMemberCompletion, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, isJsDocTagName = completionData.isJsDocTagName; - if (isJsDocTagName) { - // If the current position is a jsDoc tag name, only tag names should be provided for completion - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: ts.JsDoc.getAllJsDocCompletionEntries() }; - } - var entries = []; - if (ts.isSourceFileJavaScript(sourceFile)) { - var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true); - ts.addRange(entries, getJavaScriptCompletionEntries(sourceFile, location.pos, uniqueNames)); - } - else { - if (!symbols || symbols.length === 0) { - if (sourceFile.languageVariant === 1 /* JSX */ && - location.parent && location.parent.kind === 249 /* JsxClosingElement */) { - // In the TypeScript JSX element, if such element is not defined. When users query for completion at closing tag, - // instead of simply giving unknown value, the completion will return the tag-name of an associated opening-element. - // For example: - // var x =
completion list at "1" will contain "div" with type any - var tagName = location.parent.parent.openingElement.tagName; - entries.push({ - name: tagName.text, - kind: undefined, - kindModifiers: undefined, - sortText: "0", - }); - } - else { - return undefined; - } - } - getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true); - } - // Add keywords if this is not a member completion list - if (!isMemberCompletion && !isJsDocTagName) { - ts.addRange(entries, keywordCompletions); - } - return { isGlobalCompletion: isGlobalCompletion, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; - function getJavaScriptCompletionEntries(sourceFile, position, uniqueNames) { - var entries = []; - var nameTable = ts.getNameTable(sourceFile); - for (var name_43 in nameTable) { - // Skip identifiers produced only from the current location - if (nameTable[name_43] === position) { - continue; - } - if (!uniqueNames[name_43]) { - uniqueNames[name_43] = name_43; - var displayName = getCompletionEntryDisplayName(ts.unescapeIdentifier(name_43), compilerOptions.target, /*performCharacterChecks*/ true); - if (displayName) { - var entry = { - name: displayName, - kind: ts.ScriptElementKind.warning, - kindModifiers: "", - sortText: "1" - }; - entries.push(entry); - } - } - } - return entries; - } - function createCompletionEntry(symbol, location, performCharacterChecks) { - // Try to get a valid display name for this symbol, if we could not find one, then ignore it. - // We would like to only show things that can be added after a dot, so for instance numeric properties can - // not be accessed with a dot (a.1 <- invalid) - var displayName = getCompletionEntryDisplayNameForSymbol(typeChecker, symbol, compilerOptions.target, performCharacterChecks, location); - if (!displayName) { - return undefined; - } - // TODO(drosen): Right now we just permit *all* semantic meanings when calling - // 'getSymbolKind' which is permissible given that it is backwards compatible; but - // really we should consider passing the meaning for the node so that we don't report - // that a suggestion for a value is an interface. We COULD also just do what - // 'getSymbolModifiers' does, which is to use the first declaration. - // Use a 'sortText' of 0' so that all symbol completion entries come before any other - // entries (like JavaScript identifier entries). - return { - name: displayName, - kind: ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location), - kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), - sortText: "0", - }; - } - function getCompletionEntriesFromSymbols(symbols, entries, location, performCharacterChecks) { - var start = ts.timestamp(); - var uniqueNames = ts.createMap(); - if (symbols) { - for (var _i = 0, symbols_4 = symbols; _i < symbols_4.length; _i++) { - var symbol = symbols_4[_i]; - var entry = createCompletionEntry(symbol, location, performCharacterChecks); - if (entry) { - var id = ts.escapeIdentifier(entry.name); - if (!uniqueNames[id]) { - entries.push(entry); - uniqueNames[id] = id; - } - } - } - } - log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (ts.timestamp() - start)); - return uniqueNames; - } - function getStringLiteralCompletionEntries(sourceFile, position) { - var node = ts.findPrecedingToken(position, sourceFile); - if (!node || node.kind !== 9 /* StringLiteral */) { - return undefined; - } - if (node.parent.kind === 257 /* PropertyAssignment */ && - node.parent.parent.kind === 176 /* ObjectLiteralExpression */ && - node.parent.name === node) { - // Get quoted name of properties of the object literal expression - // i.e. interface ConfigFiles { - // 'jspm:dev': string - // } - // let files: ConfigFiles = { - // '/*completion position*/' - // } - // - // function foo(c: ConfigFiles) {} - // foo({ - // '/*completion position*/' - // }); - return getStringLiteralCompletionEntriesFromPropertyAssignment(node.parent); - } - else if (ts.isElementAccessExpression(node.parent) && node.parent.argumentExpression === node) { - // Get all names of properties on the expression - // i.e. interface A { - // 'prop1': string - // } - // let a: A; - // a['/*completion position*/'] - return getStringLiteralCompletionEntriesFromElementAccess(node.parent); - } - else if (node.parent.kind === 235 /* ImportDeclaration */ || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node) || ts.isRequireCall(node.parent, false)) { - // Get all known external module names or complete a path to a module - // i.e. import * as ns from "/*completion position*/"; - // import x = require("/*completion position*/"); - // var y = require("/*completion position*/"); - return getStringLiteralCompletionEntriesFromModuleNames(node); - } - else { - var argumentInfo = ts.SignatureHelp.getContainingArgumentInfo(node, position, sourceFile); - if (argumentInfo) { - // Get string literal completions from specialized signatures of the target - // i.e. declare function f(a: 'A'); - // f("/*completion position*/") - return getStringLiteralCompletionEntriesFromCallExpression(argumentInfo); - } - // Get completion for string literal from string literal type - // i.e. var x: "hi" | "hello" = "/*completion position*/" - return getStringLiteralCompletionEntriesFromContextualType(node); - } - } - function getStringLiteralCompletionEntriesFromPropertyAssignment(element) { - var type = typeChecker.getContextualType(element.parent); - var entries = []; - if (type) { - getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, element, /*performCharacterChecks*/ false); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; - } - } - } - function getStringLiteralCompletionEntriesFromCallExpression(argumentInfo) { - var candidates = []; - var entries = []; - typeChecker.getResolvedSignature(argumentInfo.invocation, candidates); - for (var _i = 0, candidates_3 = candidates; _i < candidates_3.length; _i++) { - var candidate = candidates_3[_i]; - if (candidate.parameters.length > argumentInfo.argumentIndex) { - var parameter = candidate.parameters[argumentInfo.argumentIndex]; - addStringLiteralCompletionsFromType(typeChecker.getTypeAtLocation(parameter.valueDeclaration), entries); - } - } - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: true, entries: entries }; - } - return undefined; - } - function getStringLiteralCompletionEntriesFromElementAccess(node) { - var type = typeChecker.getTypeAtLocation(node.expression); - var entries = []; - if (type) { - getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, node, /*performCharacterChecks*/ false); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; - } - } - return undefined; - } - function getStringLiteralCompletionEntriesFromContextualType(node) { - var type = typeChecker.getContextualType(node); - if (type) { - var entries_2 = []; - addStringLiteralCompletionsFromType(type, entries_2); - if (entries_2.length) { - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries_2 }; - } - } - return undefined; - } - function addStringLiteralCompletionsFromType(type, result) { - if (!type) { - return; - } - if (type.flags & 65536 /* Union */) { - ts.forEach(type.types, function (t) { return addStringLiteralCompletionsFromType(t, result); }); - } - else { - if (type.flags & 32 /* StringLiteral */) { - result.push({ - name: type.text, - kindModifiers: ts.ScriptElementKindModifier.none, - kind: ts.ScriptElementKind.variableElement, - sortText: "0" - }); - } - } - } - function getStringLiteralCompletionEntriesFromModuleNames(node) { + var PathCompletions; + (function (PathCompletions) { + function getStringLiteralCompletionEntriesFromModuleNames(node, compilerOptions, host, typeChecker) { var literalValue = ts.normalizeSlashes(node.text); var scriptPath = node.getSourceFile().path; var scriptDirectory = ts.getDirectoryPath(scriptPath); var span = getDirectoryFragmentTextSpan(node.text, node.getStart() + 1); var entries; if (isPathRelativeToScript(literalValue) || ts.isRootedDiskPath(literalValue)) { + var extensions = ts.getSupportedExtensions(compilerOptions); if (compilerOptions.rootDirs) { - entries = getCompletionEntriesForDirectoryFragmentWithRootDirs(compilerOptions.rootDirs, literalValue, scriptDirectory, ts.getSupportedExtensions(compilerOptions), /*includeExtensions*/ false, span, scriptPath); + entries = getCompletionEntriesForDirectoryFragmentWithRootDirs(compilerOptions.rootDirs, literalValue, scriptDirectory, extensions, /*includeExtensions*/ false, span, compilerOptions, host, scriptPath); } else { - entries = getCompletionEntriesForDirectoryFragment(literalValue, scriptDirectory, ts.getSupportedExtensions(compilerOptions), /*includeExtensions*/ false, span, scriptPath); + entries = getCompletionEntriesForDirectoryFragment(literalValue, scriptDirectory, extensions, /*includeExtensions*/ false, span, host, scriptPath); } } else { // Check for node modules - entries = getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, span); + entries = getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, span, compilerOptions, host, typeChecker); } return { isGlobalCompletion: false, @@ -67336,6 +72091,7 @@ var ts; entries: entries }; } + PathCompletions.getStringLiteralCompletionEntriesFromModuleNames = getStringLiteralCompletionEntriesFromModuleNames; /** * Takes a script path and returns paths for all potential folders that could be merged with its * containing folder via the "rootDirs" compiler option @@ -67355,21 +72111,21 @@ var ts; // Now find a path for each potential directory that is to be merged with the one containing the script return ts.deduplicate(ts.map(rootDirs, function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); })); } - function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptPath, extensions, includeExtensions, span, exclude) { + function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptPath, extensions, includeExtensions, span, compilerOptions, host, exclude) { var basePath = compilerOptions.project || host.getCurrentDirectory(); var ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); var baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptPath, ignoreCase); var result = []; for (var _i = 0, baseDirectories_1 = baseDirectories; _i < baseDirectories_1.length; _i++) { var baseDirectory = baseDirectories_1[_i]; - getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensions, includeExtensions, span, exclude, result); + getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensions, includeExtensions, span, host, exclude, result); } return result; } /** * Given a path ending at a directory, gets the completions for the path, and filters for those entries containing the basename. */ - function getCompletionEntriesForDirectoryFragment(fragment, scriptPath, extensions, includeExtensions, span, exclude, result) { + function getCompletionEntriesForDirectoryFragment(fragment, scriptPath, extensions, includeExtensions, span, host, exclude, result) { if (result === void 0) { result = []; } if (fragment === undefined) { fragment = ""; @@ -67405,13 +72161,13 @@ var ts; continue; } var foundFileName = includeExtensions ? ts.getBaseFileName(filePath) : ts.removeFileExtension(ts.getBaseFileName(filePath)); - if (!foundFiles[foundFileName]) { - foundFiles[foundFileName] = true; + if (!foundFiles.get(foundFileName)) { + foundFiles.set(foundFileName, true); } } - for (var foundFile in foundFiles) { + ts.forEachKey(foundFiles, function (foundFile) { result.push(createCompletionEntryForModule(foundFile, ts.ScriptElementKind.scriptElement, span)); - } + }); } // If possible, get folder completion as well var directories = tryGetDirectories(host, baseDirectory); @@ -67432,14 +72188,14 @@ var ts; * Modules from node_modules (i.e. those listed in package.json) * This includes all files that are found in node_modules/moduleName/ with acceptable file extensions */ - function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, span) { + function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, span, compilerOptions, host, typeChecker) { var baseUrl = compilerOptions.baseUrl, paths = compilerOptions.paths; var result; if (baseUrl) { var fileExtensions = ts.getSupportedExtensions(compilerOptions); var projectDir = compilerOptions.project || host.getCurrentDirectory(); var absolute = ts.isRootedDiskPath(baseUrl) ? baseUrl : ts.combinePaths(projectDir, baseUrl); - result = getCompletionEntriesForDirectoryFragment(fragment, ts.normalizePath(absolute), fileExtensions, /*includeExtensions*/ false, span); + result = getCompletionEntriesForDirectoryFragment(fragment, ts.normalizePath(absolute), fileExtensions, /*includeExtensions*/ false, span, host); if (paths) { for (var path in paths) { if (paths.hasOwnProperty(path)) { @@ -67447,7 +72203,7 @@ var ts; if (paths[path]) { for (var _i = 0, _a = paths[path]; _i < _a.length; _i++) { var pattern = _a[_i]; - for (var _b = 0, _c = getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions); _b < _c.length; _b++) { + for (var _b = 0, _c = getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host); _b < _c.length; _b++) { var match = _c[_b]; result.push(createCompletionEntryForModule(match, ts.ScriptElementKind.externalModuleName, span)); } @@ -67468,13 +72224,13 @@ var ts; result = []; } getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, span, result); - for (var _d = 0, _e = enumeratePotentialNonRelativeModules(fragment, scriptPath, compilerOptions); _d < _e.length; _d++) { + for (var _d = 0, _e = enumeratePotentialNonRelativeModules(fragment, scriptPath, compilerOptions, typeChecker, host); _d < _e.length; _d++) { var moduleName = _e[_d]; result.push(createCompletionEntryForModule(moduleName, ts.ScriptElementKind.externalModuleName, span)); } return result; } - function getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions) { + function getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host) { if (host.readDirectory) { var parsed = ts.hasZeroOrOneAsteriskCharacter(pattern) ? ts.tryParsePattern(pattern) : undefined; if (parsed) { @@ -67493,7 +72249,7 @@ var ts; // that encodes the suffix, but we would have to escape the character "?" which readDirectory // doesn't support. For now, this is safer but slower var includeGlob = normalizedSuffix ? "**/*" : "./*"; - var matches = tryReadDirectory(host, baseDirectory, fileExtensions, undefined, [includeGlob]); + var matches = tryReadDirectory(host, baseDirectory, fileExtensions, /*exclude*/ undefined, [includeGlob]); if (matches) { var result = []; // Trim away prefix and suffix @@ -67504,8 +72260,8 @@ var ts; continue; } var start = completePrefix.length; - var length_5 = normalizedMatch.length - start - normalizedSuffix.length; - result.push(ts.removeFileExtension(normalizedMatch.substr(start, length_5))); + var length_6 = normalizedMatch.length - start - normalizedSuffix.length; + result.push(ts.removeFileExtension(normalizedMatch.substr(start, length_6))); } return result; } @@ -67513,7 +72269,7 @@ var ts; } return undefined; } - function enumeratePotentialNonRelativeModules(fragment, scriptPath, options) { + function enumeratePotentialNonRelativeModules(fragment, scriptPath, options, typeChecker, host) { // Check If this is a nested module var isNestedModule = fragment.indexOf(ts.directorySeparator) !== -1; var moduleNameFragment = isNestedModule ? fragment.substr(0, fragment.lastIndexOf(ts.directorySeparator)) : undefined; @@ -67553,7 +72309,7 @@ var ts; } return ts.deduplicate(nonRelativeModules); } - function getTripleSlashReferenceCompletion(sourceFile, position) { + function getTripleSlashReferenceCompletion(sourceFile, position, compilerOptions, host) { var token = ts.getTokenAtPosition(sourceFile, position); if (!token) { return undefined; @@ -67589,7 +72345,7 @@ var ts; if (kind === "path") { // Give completions for a relative path var span_10 = getDirectoryFragmentTextSpan(toComplete, range.pos + prefix.length); - completionInfo.entries = getCompletionEntriesForDirectoryFragment(toComplete, scriptPath, ts.getSupportedExtensions(compilerOptions), /*includeExtensions*/ true, span_10, sourceFile.path); + completionInfo.entries = getCompletionEntriesForDirectoryFragment(toComplete, scriptPath, ts.getSupportedExtensions(compilerOptions), /*includeExtensions*/ true, span_10, host, sourceFile.path); } else { // Give completions based on the typings available @@ -67599,6 +72355,7 @@ var ts; } return completionInfo; } + PathCompletions.getTripleSlashReferenceCompletion = getTripleSlashReferenceCompletion; function getCompletionEntriesFromTypings(host, options, scriptPath, span, result) { if (result === void 0) { result = []; } // Check for typings specified in compiler options @@ -67624,7 +72381,7 @@ var ts; } if (host.getDirectories) { // Also get all @types typings installed in visible node_modules directories - for (var _c = 0, _d = findPackageJsons(scriptPath); _c < _d.length; _c++) { + for (var _c = 0, _d = findPackageJsons(scriptPath, host); _c < _d.length; _c++) { var packageJson = _d[_c]; var typesDir = ts.combinePaths(ts.getDirectoryPath(packageJson), "node_modules/@types"); getCompletionEntriesFromDirectories(host, typesDir, span, result); @@ -67644,7 +72401,7 @@ var ts; } } } - function findPackageJsons(currentDir) { + function findPackageJsons(currentDir, host) { var paths = []; var currentConfigPath; while (true) { @@ -67652,11 +72409,11 @@ var ts; if (currentConfigPath) { paths.push(currentConfigPath); currentDir = ts.getDirectoryPath(currentConfigPath); - var parent_13 = ts.getDirectoryPath(currentDir); - if (currentDir === parent_13) { + var parent = ts.getDirectoryPath(currentDir); + if (currentDir === parent) { break; } - currentDir = parent_13; + currentDir = parent; } else { break; @@ -67667,7 +72424,7 @@ var ts; function enumerateNodeModulesVisibleToScript(host, scriptPath) { var result = []; if (host.readFile && host.fileExists) { - for (var _i = 0, _a = findPackageJsons(scriptPath); _i < _a.length; _i++) { + for (var _i = 0, _a = findPackageJsons(scriptPath, host); _i < _a.length; _i++) { var packageJson = _a[_i]; var contents = tryReadingPackageJson(packageJson); if (!contents) { @@ -67731,26 +72488,326 @@ var ts; function normalizeAndPreserveTrailingSlash(path) { return ts.hasTrailingDirectorySeparator(path) ? ts.ensureTrailingDirectorySeparator(ts.normalizePath(path)) : ts.normalizePath(path); } + /** + * Matches a triple slash reference directive with an incomplete string literal for its path. Used + * to determine if the caret is currently within the string literal and capture the literal fragment + * for completions. + * For example, this matches + * + * /// +/* @internal */ +var ts; +(function (ts) { + var Completions; + (function (Completions) { + function getCompletionsAtPosition(host, typeChecker, log, compilerOptions, sourceFile, position) { + if (ts.isInReferenceComment(sourceFile, position)) { + return Completions.PathCompletions.getTripleSlashReferenceCompletion(sourceFile, position, compilerOptions, host); + } + if (ts.isInString(sourceFile, position)) { + return getStringLiteralCompletionEntries(sourceFile, position, typeChecker, compilerOptions, host, log); + } + var completionData = getCompletionData(typeChecker, log, sourceFile, position); + if (!completionData) { + return undefined; + } + var symbols = completionData.symbols, isGlobalCompletion = completionData.isGlobalCompletion, isMemberCompletion = completionData.isMemberCompletion, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, requestJsDocTagName = completionData.requestJsDocTagName, requestJsDocTag = completionData.requestJsDocTag; + if (requestJsDocTagName) { + // If the current position is a jsDoc tag name, only tag names should be provided for completion + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: ts.JsDoc.getJSDocTagNameCompletions() }; + } + if (requestJsDocTag) { + // If the current position is a jsDoc tag, only tags should be provided for completion + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: ts.JsDoc.getJSDocTagCompletions() }; + } + var entries = []; + if (ts.isSourceFileJavaScript(sourceFile)) { + var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true, typeChecker, compilerOptions.target, log); + ts.addRange(entries, getJavaScriptCompletionEntries(sourceFile, location.pos, uniqueNames, compilerOptions.target)); + } + else { + if (!symbols || symbols.length === 0) { + if (sourceFile.languageVariant === 1 /* JSX */ && + location.parent && location.parent.kind === 251 /* JsxClosingElement */) { + // In the TypeScript JSX element, if such element is not defined. When users query for completion at closing tag, + // instead of simply giving unknown value, the completion will return the tag-name of an associated opening-element. + // For example: + // var x =
completion list at "1" will contain "div" with type any + var tagName = location.parent.parent.openingElement.tagName; + entries.push({ + name: tagName.text, + kind: undefined, + kindModifiers: undefined, + sortText: "0", + }); + } + else { + return undefined; + } + } + getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true, typeChecker, compilerOptions.target, log); + } + // Add keywords if this is not a member completion list + if (!isMemberCompletion && !requestJsDocTag && !requestJsDocTagName) { + ts.addRange(entries, keywordCompletions); + } + return { isGlobalCompletion: isGlobalCompletion, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; } Completions.getCompletionsAtPosition = getCompletionsAtPosition; + function getJavaScriptCompletionEntries(sourceFile, position, uniqueNames, target) { + var entries = []; + var nameTable = ts.getNameTable(sourceFile); + nameTable.forEach(function (pos, name) { + // Skip identifiers produced only from the current location + if (pos === position) { + return; + } + if (!uniqueNames.get(name)) { + uniqueNames.set(name, name); + var displayName = getCompletionEntryDisplayName(ts.unescapeIdentifier(name), target, /*performCharacterChecks*/ true); + if (displayName) { + var entry = { + name: displayName, + kind: ts.ScriptElementKind.warning, + kindModifiers: "", + sortText: "1" + }; + entries.push(entry); + } + } + }); + return entries; + } + function createCompletionEntry(symbol, location, performCharacterChecks, typeChecker, target) { + // Try to get a valid display name for this symbol, if we could not find one, then ignore it. + // We would like to only show things that can be added after a dot, so for instance numeric properties can + // not be accessed with a dot (a.1 <- invalid) + var displayName = getCompletionEntryDisplayNameForSymbol(typeChecker, symbol, target, performCharacterChecks, location); + if (!displayName) { + return undefined; + } + // TODO(drosen): Right now we just permit *all* semantic meanings when calling + // 'getSymbolKind' which is permissible given that it is backwards compatible; but + // really we should consider passing the meaning for the node so that we don't report + // that a suggestion for a value is an interface. We COULD also just do what + // 'getSymbolModifiers' does, which is to use the first declaration. + // Use a 'sortText' of 0' so that all symbol completion entries come before any other + // entries (like JavaScript identifier entries). + return { + name: displayName, + kind: ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location), + kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), + sortText: "0", + }; + } + function getCompletionEntriesFromSymbols(symbols, entries, location, performCharacterChecks, typeChecker, target, log) { + var start = ts.timestamp(); + var uniqueNames = ts.createMap(); + if (symbols) { + for (var _i = 0, symbols_4 = symbols; _i < symbols_4.length; _i++) { + var symbol = symbols_4[_i]; + var entry = createCompletionEntry(symbol, location, performCharacterChecks, typeChecker, target); + if (entry) { + var id = ts.escapeIdentifier(entry.name); + if (!uniqueNames.get(id)) { + entries.push(entry); + uniqueNames.set(id, id); + } + } + } + } + log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (ts.timestamp() - start)); + return uniqueNames; + } + function getStringLiteralCompletionEntries(sourceFile, position, typeChecker, compilerOptions, host, log) { + var node = ts.findPrecedingToken(position, sourceFile); + if (!node || node.kind !== 9 /* StringLiteral */) { + return undefined; + } + if (node.parent.kind === 260 /* PropertyAssignment */ && + node.parent.parent.kind === 177 /* ObjectLiteralExpression */ && + node.parent.name === node) { + // Get quoted name of properties of the object literal expression + // i.e. interface ConfigFiles { + // 'jspm:dev': string + // } + // let files: ConfigFiles = { + // '/*completion position*/' + // } + // + // function foo(c: ConfigFiles) {} + // foo({ + // '/*completion position*/' + // }); + return getStringLiteralCompletionEntriesFromPropertyAssignment(node.parent, typeChecker, compilerOptions.target, log); + } + else if (ts.isElementAccessExpression(node.parent) && node.parent.argumentExpression === node) { + // Get all names of properties on the expression + // i.e. interface A { + // 'prop1': string + // } + // let a: A; + // a['/*completion position*/'] + return getStringLiteralCompletionEntriesFromElementAccess(node.parent, typeChecker, compilerOptions.target, log); + } + else if (node.parent.kind === 237 /* ImportDeclaration */ || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node) || ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false)) { + // Get all known external module names or complete a path to a module + // i.e. import * as ns from "/*completion position*/"; + // import x = require("/*completion position*/"); + // var y = require("/*completion position*/"); + return Completions.PathCompletions.getStringLiteralCompletionEntriesFromModuleNames(node, compilerOptions, host, typeChecker); + } + else if (isEqualityExpression(node.parent)) { + // Get completions from the type of the other operand + // i.e. switch (a) { + // case '/*completion position*/' + // } + return getStringLiteralCompletionEntriesFromType(typeChecker.getTypeAtLocation(node.parent.left === node ? node.parent.right : node.parent.left), typeChecker); + } + else if (ts.isCaseOrDefaultClause(node.parent)) { + // Get completions from the type of the switch expression + // i.e. x === '/*completion position' + return getStringLiteralCompletionEntriesFromType(typeChecker.getTypeAtLocation(node.parent.parent.parent.expression), typeChecker); + } + else { + var argumentInfo = ts.SignatureHelp.getImmediatelyContainingArgumentInfo(node, position, sourceFile); + if (argumentInfo) { + // Get string literal completions from specialized signatures of the target + // i.e. declare function f(a: 'A'); + // f("/*completion position*/") + return getStringLiteralCompletionEntriesFromCallExpression(argumentInfo, typeChecker); + } + // Get completion for string literal from string literal type + // i.e. var x: "hi" | "hello" = "/*completion position*/" + return getStringLiteralCompletionEntriesFromType(typeChecker.getContextualType(node), typeChecker); + } + } + function getStringLiteralCompletionEntriesFromPropertyAssignment(element, typeChecker, target, log) { + var type = typeChecker.getContextualType(element.parent); + var entries = []; + if (type) { + getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, element, /*performCharacterChecks*/ false, typeChecker, target, log); + if (entries.length) { + return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; + } + } + } + function getStringLiteralCompletionEntriesFromCallExpression(argumentInfo, typeChecker) { + var candidates = []; + var entries = []; + typeChecker.getResolvedSignature(argumentInfo.invocation, candidates); + for (var _i = 0, candidates_3 = candidates; _i < candidates_3.length; _i++) { + var candidate = candidates_3[_i]; + addStringLiteralCompletionsFromType(typeChecker.getParameterType(candidate, argumentInfo.argumentIndex), entries, typeChecker); + } + if (entries.length) { + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: true, entries: entries }; + } + return undefined; + } + function getStringLiteralCompletionEntriesFromElementAccess(node, typeChecker, target, log) { + var type = typeChecker.getTypeAtLocation(node.expression); + var entries = []; + if (type) { + getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, node, /*performCharacterChecks*/ false, typeChecker, target, log); + if (entries.length) { + return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; + } + } + return undefined; + } + function getStringLiteralCompletionEntriesFromType(type, typeChecker) { + if (type) { + var entries = []; + addStringLiteralCompletionsFromType(type, entries, typeChecker); + if (entries.length) { + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries }; + } + } + return undefined; + } + function addStringLiteralCompletionsFromType(type, result, typeChecker) { + if (type && type.flags & 16384 /* TypeParameter */) { + type = typeChecker.getApparentType(type); + } + if (!type) { + return; + } + if (type.flags & 65536 /* Union */) { + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var t = _a[_i]; + addStringLiteralCompletionsFromType(t, result, typeChecker); + } + } + else if (type.flags & 32 /* StringLiteral */) { + result.push({ + name: type.text, + kindModifiers: ts.ScriptElementKindModifier.none, + kind: ts.ScriptElementKind.variableElement, + sortText: "0" + }); + } + } function getCompletionEntryDetails(typeChecker, log, compilerOptions, sourceFile, position, entryName) { // Compute all the completion symbols again. var completionData = getCompletionData(typeChecker, log, sourceFile, position); if (completionData) { - var symbols = completionData.symbols, location_3 = completionData.location; + var symbols = completionData.symbols, location_1 = completionData.location; // Find the symbol with the matching entry name. // We don't need to perform character checks here because we're only comparing the // name against 'entryName' (which is known to be good), not building a new // completion entry. - var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(typeChecker, s, compilerOptions.target, /*performCharacterChecks*/ false, location_3) === entryName ? s : undefined; }); + var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(typeChecker, s, compilerOptions.target, /*performCharacterChecks*/ false, location_1) === entryName ? s : undefined; }); if (symbol) { - var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, location_3, location_3, 7 /* All */), displayParts = _a.displayParts, documentation = _a.documentation, symbolKind = _a.symbolKind; + var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, location_1, location_1, 7 /* All */), displayParts = _a.displayParts, documentation = _a.documentation, symbolKind = _a.symbolKind, tags = _a.tags; return { name: entryName, kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), kind: symbolKind, displayParts: displayParts, - documentation: documentation + documentation: documentation, + tags: tags }; } } @@ -67762,7 +72819,8 @@ var ts; kind: ts.ScriptElementKind.keyword, kindModifiers: ts.ScriptElementKindModifier.none, displayParts: [ts.displayPart(entryName, ts.SymbolDisplayPartKind.keyword)], - documentation: undefined + documentation: undefined, + tags: undefined }; } return undefined; @@ -67772,19 +72830,22 @@ var ts; // Compute all the completion symbols again. var completionData = getCompletionData(typeChecker, log, sourceFile, position); if (completionData) { - var symbols = completionData.symbols, location_4 = completionData.location; + var symbols = completionData.symbols, location_2 = completionData.location; // Find the symbol with the matching entry name. // We don't need to perform character checks here because we're only comparing the // name against 'entryName' (which is known to be good), not building a new // completion entry. - return ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(typeChecker, s, compilerOptions.target, /*performCharacterChecks*/ false, location_4) === entryName ? s : undefined; }); + return ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(typeChecker, s, compilerOptions.target, /*performCharacterChecks*/ false, location_2) === entryName ? s : undefined; }); } return undefined; } Completions.getCompletionEntrySymbol = getCompletionEntrySymbol; function getCompletionData(typeChecker, log, sourceFile, position) { var isJavaScriptFile = ts.isSourceFileJavaScript(sourceFile); - var isJsDocTagName = false; + // JsDoc tag-name is just the name of the JSDoc tagname (exclude "@") + var requestJsDocTagName = false; + // JsDoc tag includes both "@" and tag-name + var requestJsDocTag = false; var start = ts.timestamp(); var currentToken = ts.getTokenAtPosition(sourceFile, position); log("getCompletionData: Get current token: " + (ts.timestamp() - start)); @@ -67793,10 +72854,32 @@ var ts; var insideComment = ts.isInsideComment(sourceFile, currentToken, position); log("getCompletionData: Is inside comment: " + (ts.timestamp() - start)); if (insideComment) { - // The current position is next to the '@' sign, when no tag name being provided yet. - // Provide a full list of tag names - if (ts.hasDocComment(sourceFile, position) && sourceFile.text.charCodeAt(position - 1) === 64 /* at */) { - isJsDocTagName = true; + if (ts.hasDocComment(sourceFile, position)) { + // The current position is next to the '@' sign, when no tag name being provided yet. + // Provide a full list of tag names + if (sourceFile.text.charCodeAt(position - 1) === 64 /* at */) { + requestJsDocTagName = true; + } + else { + // When completion is requested without "@", we will have check to make sure that + // there are no comments prefix the request position. We will only allow "*" and space. + // e.g + // /** |c| /* + // + // /** + // |c| + // */ + // + // /** + // * |c| + // */ + // + // /** + // * |c| + // */ + var lineStart = ts.getLineStartPositionForPosition(position, sourceFile); + requestJsDocTag = !(sourceFile.text.substring(lineStart, position).match(/[^\*|\s|(/\*\*)]/)); + } } // Completion should work inside certain JsDoc tags. For example: // /** @type {number | string} */ @@ -67805,12 +72888,12 @@ var ts; var tag = ts.getJsDocTagAtPosition(sourceFile, position); if (tag) { if (tag.tagName.pos <= position && position <= tag.tagName.end) { - isJsDocTagName = true; + requestJsDocTagName = true; } switch (tag.kind) { - case 283 /* JSDocTypeTag */: - case 281 /* JSDocParameterTag */: - case 282 /* JSDocReturnTag */: + case 287 /* JSDocTypeTag */: + case 285 /* JSDocParameterTag */: + case 286 /* JSDocReturnTag */: var tagWithExpression = tag; if (tagWithExpression.typeExpression) { insideJsDocTagExpression = tagWithExpression.typeExpression.pos < position && position < tagWithExpression.typeExpression.end; @@ -67818,8 +72901,8 @@ var ts; break; } } - if (isJsDocTagName) { - return { symbols: undefined, isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, location: undefined, isRightOfDot: false, isJsDocTagName: isJsDocTagName }; + if (requestJsDocTagName || requestJsDocTag) { + return { symbols: undefined, isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, location: undefined, isRightOfDot: false, requestJsDocTagName: requestJsDocTagName, requestJsDocTag: requestJsDocTag }; } if (!insideJsDocTagExpression) { // Proceed if the current position is in jsDoc tag expression; otherwise it is a normal @@ -67855,13 +72938,13 @@ var ts; log("Returning an empty list because completion was requested in an invalid position."); return undefined; } - var parent_14 = contextToken.parent, kind = contextToken.kind; - if (kind === 22 /* DotToken */) { - if (parent_14.kind === 177 /* PropertyAccessExpression */) { + var parent = contextToken.parent; + if (contextToken.kind === 22 /* DotToken */) { + if (parent.kind === 178 /* PropertyAccessExpression */) { node = contextToken.parent.expression; isRightOfDot = true; } - else if (parent_14.kind === 141 /* QualifiedName */) { + else if (parent.kind === 142 /* QualifiedName */) { node = contextToken.parent.left; isRightOfDot = true; } @@ -67872,13 +72955,34 @@ var ts; } } else if (sourceFile.languageVariant === 1 /* JSX */) { - if (kind === 26 /* LessThanToken */) { - isRightOfOpenTag = true; - location = contextToken; + // + // If the tagname is a property access expression, we will then walk up to the top most of property access expression. + // Then, try to get a JSX container and its associated attributes type. + if (parent && parent.kind === 178 /* PropertyAccessExpression */) { + contextToken = parent; + parent = parent.parent; } - else if (kind === 40 /* SlashToken */ && contextToken.parent.kind === 249 /* JsxClosingElement */) { - isStartingCloseTag = true; - location = contextToken; + switch (parent.kind) { + case 251 /* JsxClosingElement */: + if (contextToken.kind === 40 /* SlashToken */) { + isStartingCloseTag = true; + location = contextToken; + } + break; + case 193 /* BinaryExpression */: + if (!(parent.left.flags & 32768 /* ThisNodeHasError */)) { + // It has a left-hand side, so we're not in an opening JSX tag. + break; + } + // falls through + case 249 /* JsxSelfClosingElement */: + case 248 /* JsxElement */: + case 250 /* JsxOpeningElement */: + if (contextToken.kind === 26 /* LessThanToken */) { + isRightOfOpenTag = true; + location = contextToken; + } + break; } } } @@ -67919,13 +73023,13 @@ var ts; } } log("getCompletionData: Semantic work: " + (ts.timestamp() - semanticStart)); - return { symbols: symbols, isGlobalCompletion: isGlobalCompletion, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, location: location, isRightOfDot: (isRightOfDot || isRightOfOpenTag), isJsDocTagName: isJsDocTagName }; + return { symbols: symbols, isGlobalCompletion: isGlobalCompletion, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, location: location, isRightOfDot: (isRightOfDot || isRightOfOpenTag), requestJsDocTagName: requestJsDocTagName, requestJsDocTag: requestJsDocTag }; function getTypeScriptMemberSymbols() { // Right of dot member completion list isGlobalCompletion = false; isMemberCompletion = true; isNewIdentifierLocation = false; - if (node.kind === 70 /* Identifier */ || node.kind === 141 /* QualifiedName */ || node.kind === 177 /* PropertyAccessExpression */) { + if (node.kind === 70 /* Identifier */ || node.kind === 142 /* QualifiedName */ || node.kind === 178 /* PropertyAccessExpression */) { var symbol = typeChecker.getSymbolAtLocation(node); // This is an alias, follow what it aliases if (symbol && symbol.flags & 8388608 /* Alias */) { @@ -67981,11 +73085,11 @@ var ts; } if (jsxContainer = tryGetContainingJsxElement(contextToken)) { var attrsType = void 0; - if ((jsxContainer.kind === 247 /* JsxSelfClosingElement */) || (jsxContainer.kind === 248 /* JsxOpeningElement */)) { + if ((jsxContainer.kind === 249 /* JsxSelfClosingElement */) || (jsxContainer.kind === 250 /* JsxOpeningElement */)) { // Cursor is inside a JSX self-closing element or opening element - attrsType = typeChecker.getJsxElementAttributesType(jsxContainer); + attrsType = typeChecker.getAllAttributesTypeFromJsxOpeningLikeElement(jsxContainer); if (attrsType) { - symbols = filterJsxAttributes(typeChecker.getPropertiesOfType(attrsType), jsxContainer.attributes); + symbols = filterJsxAttributes(typeChecker.getPropertiesOfType(attrsType), jsxContainer.attributes.properties); isMemberCompletion = true; isNewIdentifierLocation = false; return true; @@ -68029,9 +73133,9 @@ var ts; var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; if (scopeNode) { isGlobalCompletion = - scopeNode.kind === 261 /* SourceFile */ || - scopeNode.kind === 194 /* TemplateExpression */ || - scopeNode.kind === 252 /* JsxExpression */ || + scopeNode.kind === 264 /* SourceFile */ || + scopeNode.kind === 195 /* TemplateExpression */ || + scopeNode.kind === 255 /* JsxExpression */ || ts.isStatement(scopeNode); } /// TODO filter meaning based on the current context @@ -68064,11 +73168,11 @@ var ts; return true; } if (contextToken.kind === 28 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 248 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 250 /* JsxOpeningElement */) { return true; } - if (contextToken.parent.kind === 249 /* JsxClosingElement */ || contextToken.parent.kind === 247 /* JsxSelfClosingElement */) { - return contextToken.parent.parent && contextToken.parent.parent.kind === 246 /* JsxElement */; + if (contextToken.parent.kind === 251 /* JsxClosingElement */ || contextToken.parent.kind === 249 /* JsxSelfClosingElement */) { + return contextToken.parent.parent && contextToken.parent.parent.kind === 248 /* JsxElement */; } } return false; @@ -68078,40 +73182,40 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 25 /* CommaToken */: - return containingNodeKind === 179 /* CallExpression */ // func( a, | - || containingNodeKind === 150 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 180 /* NewExpression */ // new C(a, | - || containingNodeKind === 175 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 192 /* BinaryExpression */ // const x = (a, | - || containingNodeKind === 158 /* FunctionType */; // var x: (s: string, list| + return containingNodeKind === 180 /* CallExpression */ // func( a, | + || containingNodeKind === 151 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === 181 /* NewExpression */ // new C(a, | + || containingNodeKind === 176 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 193 /* BinaryExpression */ // const x = (a, | + || containingNodeKind === 159 /* FunctionType */; // var x: (s: string, list| case 18 /* OpenParenToken */: - return containingNodeKind === 179 /* CallExpression */ // func( | - || containingNodeKind === 150 /* Constructor */ // constructor( | - || containingNodeKind === 180 /* NewExpression */ // new C(a| - || containingNodeKind === 183 /* ParenthesizedExpression */ // const x = (a| - || containingNodeKind === 166 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + return containingNodeKind === 180 /* CallExpression */ // func( | + || containingNodeKind === 151 /* Constructor */ // constructor( | + || containingNodeKind === 181 /* NewExpression */ // new C(a| + || containingNodeKind === 184 /* ParenthesizedExpression */ // const x = (a| + || containingNodeKind === 167 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 20 /* OpenBracketToken */: - return containingNodeKind === 175 /* ArrayLiteralExpression */ // [ | - || containingNodeKind === 155 /* IndexSignature */ // [ | : string ] - || containingNodeKind === 142 /* ComputedPropertyName */; // [ | /* this can become an index signature */ + return containingNodeKind === 176 /* ArrayLiteralExpression */ // [ | + || containingNodeKind === 156 /* IndexSignature */ // [ | : string ] + || containingNodeKind === 143 /* ComputedPropertyName */; // [ | /* this can become an index signature */ case 127 /* ModuleKeyword */: // module | case 128 /* NamespaceKeyword */: return true; case 22 /* DotToken */: - return containingNodeKind === 230 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 232 /* ModuleDeclaration */; // module A.| case 16 /* OpenBraceToken */: - return containingNodeKind === 226 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 228 /* ClassDeclaration */; // class A{ | case 57 /* EqualsToken */: - return containingNodeKind === 223 /* VariableDeclaration */ // const x = a| - || containingNodeKind === 192 /* BinaryExpression */; // x = a| + return containingNodeKind === 225 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 193 /* BinaryExpression */; // x = a| case 13 /* TemplateHead */: - return containingNodeKind === 194 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 195 /* TemplateExpression */; // `aa ${| case 14 /* TemplateMiddle */: - return containingNodeKind === 202 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 204 /* TemplateSpan */; // `aa ${10} dd ${| case 113 /* PublicKeyword */: case 111 /* PrivateKeyword */: case 112 /* ProtectedKeyword */: - return containingNodeKind === 147 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 148 /* PropertyDeclaration */; // class A{ public | } // Previous token may have been a keyword that was converted to an identifier. switch (previousToken.getText()) { @@ -68154,7 +73258,7 @@ var ts; isMemberCompletion = true; var typeForObject; var existingMembers; - if (objectLikeContainer.kind === 176 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 177 /* ObjectLiteralExpression */) { // We are completing on contextual types, but may also include properties // other than those within the declared type. isNewIdentifierLocation = true; @@ -68164,7 +73268,7 @@ var ts; typeForObject = typeForObject && typeForObject.getNonNullableType(); existingMembers = objectLikeContainer.properties; } - else if (objectLikeContainer.kind === 172 /* ObjectBindingPattern */) { + else if (objectLikeContainer.kind === 173 /* ObjectBindingPattern */) { // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); @@ -68175,11 +73279,11 @@ var ts; // Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed - // type of parameter will flow in from the contextual type of the function var canGetType = !!(rootDeclaration.initializer || rootDeclaration.type); - if (!canGetType && rootDeclaration.kind === 144 /* Parameter */) { + if (!canGetType && rootDeclaration.kind === 145 /* Parameter */) { if (ts.isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); } - else if (rootDeclaration.parent.kind === 149 /* MethodDeclaration */ || rootDeclaration.parent.kind === 152 /* SetAccessor */) { + else if (rootDeclaration.parent.kind === 150 /* MethodDeclaration */ || rootDeclaration.parent.kind === 153 /* SetAccessor */) { canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -68221,9 +73325,9 @@ var ts; * @returns true if 'symbols' was successfully populated; false otherwise. */ function tryGetImportOrExportClauseCompletionSymbols(namedImportsOrExports) { - var declarationKind = namedImportsOrExports.kind === 238 /* NamedImports */ ? - 235 /* ImportDeclaration */ : - 241 /* ExportDeclaration */; + var declarationKind = namedImportsOrExports.kind === 240 /* NamedImports */ ? + 237 /* ImportDeclaration */ : + 243 /* ExportDeclaration */; var importOrExportDeclaration = ts.getAncestor(namedImportsOrExports, declarationKind); var moduleSpecifier = importOrExportDeclaration.moduleSpecifier; if (!moduleSpecifier) { @@ -68231,12 +73335,13 @@ var ts; } isMemberCompletion = true; isNewIdentifierLocation = false; - var exports; - var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(importOrExportDeclaration.moduleSpecifier); - if (moduleSpecifierSymbol) { - exports = typeChecker.getExportsOfModule(moduleSpecifierSymbol); + var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); + if (!moduleSpecifierSymbol) { + symbols = ts.emptyArray; + return true; } - symbols = exports ? filterNamedImportOrExportCompletionItems(exports, namedImportsOrExports.elements) : ts.emptyArray; + var exports = typeChecker.getExportsAndPropertiesOfModule(moduleSpecifierSymbol); + symbols = filterNamedImportOrExportCompletionItems(exports, namedImportsOrExports.elements); return true; } /** @@ -68248,9 +73353,9 @@ var ts; switch (contextToken.kind) { case 16 /* OpenBraceToken */: // const x = { | case 25 /* CommaToken */: - var parent_15 = contextToken.parent; - if (parent_15 && (parent_15.kind === 176 /* ObjectLiteralExpression */ || parent_15.kind === 172 /* ObjectBindingPattern */)) { - return parent_15; + var parent = contextToken.parent; + if (parent && (parent.kind === 177 /* ObjectLiteralExpression */ || parent.kind === 173 /* ObjectBindingPattern */)) { + return parent; } break; } @@ -68267,8 +73372,8 @@ var ts; case 16 /* OpenBraceToken */: // import { | case 25 /* CommaToken */: switch (contextToken.parent.kind) { - case 238 /* NamedImports */: - case 242 /* NamedExports */: + case 240 /* NamedImports */: + case 244 /* NamedExports */: return contextToken.parent; } } @@ -68277,37 +73382,55 @@ var ts; } function tryGetContainingJsxElement(contextToken) { if (contextToken) { - var parent_16 = contextToken.parent; + var parent = contextToken.parent; switch (contextToken.kind) { case 27 /* LessThanSlashToken */: case 40 /* SlashToken */: case 70 /* Identifier */: - case 250 /* JsxAttribute */: - case 251 /* JsxSpreadAttribute */: - if (parent_16 && (parent_16.kind === 247 /* JsxSelfClosingElement */ || parent_16.kind === 248 /* JsxOpeningElement */)) { - return parent_16; + case 178 /* PropertyAccessExpression */: + case 253 /* JsxAttributes */: + case 252 /* JsxAttribute */: + case 254 /* JsxSpreadAttribute */: + if (parent && (parent.kind === 249 /* JsxSelfClosingElement */ || parent.kind === 250 /* JsxOpeningElement */)) { + return parent; } - else if (parent_16.kind === 250 /* JsxAttribute */) { - return parent_16.parent; + else if (parent.kind === 252 /* JsxAttribute */) { + // Currently we parse JsxOpeningLikeElement as: + // JsxOpeningLikeElement + // attributes: JsxAttributes + // properties: NodeArray + return parent.parent.parent; } break; // The context token is the closing } or " of an attribute, which means // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 9 /* StringLiteral */: - if (parent_16 && ((parent_16.kind === 250 /* JsxAttribute */) || (parent_16.kind === 251 /* JsxSpreadAttribute */))) { - return parent_16.parent; + if (parent && ((parent.kind === 252 /* JsxAttribute */) || (parent.kind === 254 /* JsxSpreadAttribute */))) { + // Currently we parse JsxOpeningLikeElement as: + // JsxOpeningLikeElement + // attributes: JsxAttributes + // properties: NodeArray + return parent.parent.parent; } break; case 17 /* CloseBraceToken */: - if (parent_16 && - parent_16.kind === 252 /* JsxExpression */ && - parent_16.parent && - (parent_16.parent.kind === 250 /* JsxAttribute */)) { - return parent_16.parent.parent; + if (parent && + parent.kind === 255 /* JsxExpression */ && + parent.parent && parent.parent.kind === 252 /* JsxAttribute */) { + // Currently we parse JsxOpeningLikeElement as: + // JsxOpeningLikeElement + // attributes: JsxAttributes + // properties: NodeArray + // each JsxAttribute can have initializer as JsxExpression + return parent.parent.parent.parent; } - if (parent_16 && parent_16.kind === 251 /* JsxSpreadAttribute */) { - return parent_16.parent; + if (parent && parent.kind === 254 /* JsxSpreadAttribute */) { + // Currently we parse JsxOpeningLikeElement as: + // JsxOpeningLikeElement + // attributes: JsxAttributes + // properties: NodeArray + return parent.parent.parent; } break; } @@ -68315,20 +73438,17 @@ var ts; return undefined; } function isFunction(kind) { + if (!ts.isFunctionLikeKind(kind)) { + return false; + } switch (kind) { - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 225 /* FunctionDeclaration */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: + case 151 /* Constructor */: + case 160 /* ConstructorType */: + case 159 /* FunctionType */: + return false; + default: return true; } - return false; } /** * @returns true if we are certain that the currently edited location must define a new location; false otherwise. @@ -68337,66 +73457,66 @@ var ts; var containingNodeKind = contextToken.parent.kind; switch (contextToken.kind) { case 25 /* CommaToken */: - return containingNodeKind === 223 /* VariableDeclaration */ || - containingNodeKind === 224 /* VariableDeclarationList */ || - containingNodeKind === 205 /* VariableStatement */ || - containingNodeKind === 229 /* EnumDeclaration */ || + return containingNodeKind === 225 /* VariableDeclaration */ || + containingNodeKind === 226 /* VariableDeclarationList */ || + containingNodeKind === 207 /* VariableStatement */ || + containingNodeKind === 231 /* EnumDeclaration */ || isFunction(containingNodeKind) || - containingNodeKind === 226 /* ClassDeclaration */ || - containingNodeKind === 197 /* ClassExpression */ || - containingNodeKind === 227 /* InterfaceDeclaration */ || - containingNodeKind === 173 /* ArrayBindingPattern */ || - containingNodeKind === 228 /* TypeAliasDeclaration */; // type Map, K, | + containingNodeKind === 228 /* ClassDeclaration */ || + containingNodeKind === 198 /* ClassExpression */ || + containingNodeKind === 229 /* InterfaceDeclaration */ || + containingNodeKind === 174 /* ArrayBindingPattern */ || + containingNodeKind === 230 /* TypeAliasDeclaration */; // type Map, K, | case 22 /* DotToken */: - return containingNodeKind === 173 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 174 /* ArrayBindingPattern */; // var [.| case 55 /* ColonToken */: - return containingNodeKind === 174 /* BindingElement */; // var {x :html| + return containingNodeKind === 175 /* BindingElement */; // var {x :html| case 20 /* OpenBracketToken */: - return containingNodeKind === 173 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 174 /* ArrayBindingPattern */; // var [x| case 18 /* OpenParenToken */: - return containingNodeKind === 256 /* CatchClause */ || + return containingNodeKind === 259 /* CatchClause */ || isFunction(containingNodeKind); case 16 /* OpenBraceToken */: - return containingNodeKind === 229 /* EnumDeclaration */ || - containingNodeKind === 227 /* InterfaceDeclaration */ || - containingNodeKind === 161 /* TypeLiteral */; // const x : { | + return containingNodeKind === 231 /* EnumDeclaration */ || + containingNodeKind === 229 /* InterfaceDeclaration */ || + containingNodeKind === 162 /* TypeLiteral */; // const x : { | case 24 /* SemicolonToken */: - return containingNodeKind === 146 /* PropertySignature */ && + return containingNodeKind === 147 /* PropertySignature */ && contextToken.parent && contextToken.parent.parent && - (contextToken.parent.parent.kind === 227 /* InterfaceDeclaration */ || - contextToken.parent.parent.kind === 161 /* TypeLiteral */); // const x : { a; | + (contextToken.parent.parent.kind === 229 /* InterfaceDeclaration */ || + contextToken.parent.parent.kind === 162 /* TypeLiteral */); // const x : { a; | case 26 /* LessThanToken */: - return containingNodeKind === 226 /* ClassDeclaration */ || - containingNodeKind === 197 /* ClassExpression */ || - containingNodeKind === 227 /* InterfaceDeclaration */ || - containingNodeKind === 228 /* TypeAliasDeclaration */ || + return containingNodeKind === 228 /* ClassDeclaration */ || + containingNodeKind === 198 /* ClassExpression */ || + containingNodeKind === 229 /* InterfaceDeclaration */ || + containingNodeKind === 230 /* TypeAliasDeclaration */ || isFunction(containingNodeKind); case 114 /* StaticKeyword */: - return containingNodeKind === 147 /* PropertyDeclaration */; + return containingNodeKind === 148 /* PropertyDeclaration */; case 23 /* DotDotDotToken */: - return containingNodeKind === 144 /* Parameter */ || + return containingNodeKind === 145 /* Parameter */ || (contextToken.parent && contextToken.parent.parent && - contextToken.parent.parent.kind === 173 /* ArrayBindingPattern */); // var [...z| + contextToken.parent.parent.kind === 174 /* ArrayBindingPattern */); // var [...z| case 113 /* PublicKeyword */: case 111 /* PrivateKeyword */: case 112 /* ProtectedKeyword */: - return containingNodeKind === 144 /* Parameter */; + return containingNodeKind === 145 /* Parameter */; case 117 /* AsKeyword */: - return containingNodeKind === 239 /* ImportSpecifier */ || - containingNodeKind === 243 /* ExportSpecifier */ || - containingNodeKind === 237 /* NamespaceImport */; + return containingNodeKind === 241 /* ImportSpecifier */ || + containingNodeKind === 245 /* ExportSpecifier */ || + containingNodeKind === 239 /* NamespaceImport */; case 74 /* ClassKeyword */: case 82 /* EnumKeyword */: case 108 /* InterfaceKeyword */: case 88 /* FunctionKeyword */: case 103 /* VarKeyword */: case 124 /* GetKeyword */: - case 133 /* SetKeyword */: + case 134 /* SetKeyword */: case 90 /* ImportKeyword */: case 109 /* LetKeyword */: case 75 /* ConstKeyword */: case 115 /* YieldKeyword */: - case 136 /* TypeKeyword */: + case 137 /* TypeKeyword */: return true; } // Previous token may have been a keyword that was converted to an identifier. @@ -68444,13 +73564,13 @@ var ts; if (element.getStart() <= position && position <= element.getEnd()) { continue; } - var name_44 = element.propertyName || element.name; - existingImportsOrExports[name_44.text] = true; + var name = element.propertyName || element.name; + existingImportsOrExports.set(name.text, true); } - if (!ts.someProperties(existingImportsOrExports)) { + if (existingImportsOrExports.size === 0) { return ts.filter(exportsOfModule, function (e) { return e.name !== "default"; }); } - return ts.filter(exportsOfModule, function (e) { return e.name !== "default" && !existingImportsOrExports[e.name]; }); + return ts.filter(exportsOfModule, function (e) { return e.name !== "default" && !existingImportsOrExports.get(e.name); }); } /** * Filters out completion suggestions for named imports or exports. @@ -68466,12 +73586,12 @@ var ts; for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 257 /* PropertyAssignment */ && - m.kind !== 258 /* ShorthandPropertyAssignment */ && - m.kind !== 174 /* BindingElement */ && - m.kind !== 149 /* MethodDeclaration */ && - m.kind !== 151 /* GetAccessor */ && - m.kind !== 152 /* SetAccessor */) { + if (m.kind !== 260 /* PropertyAssignment */ && + m.kind !== 261 /* ShorthandPropertyAssignment */ && + m.kind !== 175 /* BindingElement */ && + m.kind !== 150 /* MethodDeclaration */ && + m.kind !== 152 /* GetAccessor */ && + m.kind !== 153 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -68479,7 +73599,7 @@ var ts; continue; } var existingName = void 0; - if (m.kind === 174 /* BindingElement */ && m.propertyName) { + if (m.kind === 175 /* BindingElement */ && m.propertyName) { // include only identifiers in completion list if (m.propertyName.kind === 70 /* Identifier */) { existingName = m.propertyName.text; @@ -68491,9 +73611,9 @@ var ts; // things like '__proto__' are not filtered out. existingName = m.name.text; } - existingMemberNames[existingName] = true; + existingMemberNames.set(existingName, true); } - return ts.filter(contextualMemberSymbols, function (m) { return !existingMemberNames[m.name]; }); + return ts.filter(contextualMemberSymbols, function (m) { return !existingMemberNames.get(m.name); }); } /** * Filters out completion suggestions from 'symbols' according to existing JSX attributes. @@ -68509,11 +73629,11 @@ var ts; if (attr.getStart() <= position && position <= attr.getEnd()) { continue; } - if (attr.kind === 250 /* JsxAttribute */) { - seenNames[attr.name.text] = true; + if (attr.kind === 252 /* JsxAttribute */) { + seenNames.set(attr.name.text, true); } } - return ts.filter(symbols, function (a) { return !seenNames[a.name]; }); + return ts.filter(symbols, function (a) { return !seenNames.get(a.name); }); } } /** @@ -68559,7 +73679,7 @@ var ts; } // A cache of completion entries for keywords, these do not change between sessions var keywordCompletions = []; - for (var i = 71 /* FirstKeyword */; i <= 140 /* LastKeyword */; i++) { + for (var i = 71 /* FirstKeyword */; i <= 141 /* LastKeyword */; i++) { keywordCompletions.push({ name: ts.tokenToString(i), kind: ts.ScriptElementKind.keyword, @@ -68567,49 +73687,14 @@ var ts; sortText: "0" }); } - /** - * Matches a triple slash reference directive with an incomplete string literal for its path. Used - * to determine if the caret is currently within the string literal and capture the literal fragment - * for completions. - * For example, this matches - * - * /// = 0; i--) { - if (pushKeywordIf(keywords, loopTokens[i], 105 /* WhileKeyword */)) { - break; - } - } - } - } - var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); - ts.forEach(breaksAndContinues, function (statement) { - if (ownsBreakOrContinueStatement(loopNode, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 71 /* BreakKeyword */, 76 /* ContinueKeyword */); - } - }); - return ts.map(keywords, getHighlightSpanForNode); - } - function getBreakOrContinueStatementOccurrences(breakOrContinueStatement) { - var owner = getBreakOrContinueOwner(breakOrContinueStatement); - if (owner) { - switch (owner.kind) { - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 209 /* DoStatement */: - case 210 /* WhileStatement */: - return getLoopBreakContinueOccurrences(owner); - case 218 /* SwitchStatement */: - return getSwitchCaseDefaultOccurrences(owner); - } - } - return undefined; - } - function getSwitchCaseDefaultOccurrences(switchStatement) { - var keywords = []; - pushKeywordIf(keywords, switchStatement.getFirstToken(), 97 /* SwitchKeyword */); - // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. - ts.forEach(switchStatement.caseBlock.clauses, function (clause) { - pushKeywordIf(keywords, clause.getFirstToken(), 72 /* CaseKeyword */, 78 /* DefaultKeyword */); - var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); - ts.forEach(breaksAndContinues, function (statement) { - if (ownsBreakOrContinueStatement(switchStatement, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 71 /* BreakKeyword */); - } - }); - }); - return ts.map(keywords, getHighlightSpanForNode); - } - function getTryCatchFinallyOccurrences(tryStatement) { - var keywords = []; - pushKeywordIf(keywords, tryStatement.getFirstToken(), 101 /* TryKeyword */); - if (tryStatement.catchClause) { - pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 73 /* CatchKeyword */); + // Exceptions thrown within a try block lacking a catch clause + // are "owned" in the current context. + aggregate(tryStatement.tryBlock); } if (tryStatement.finallyBlock) { - var finallyKeyword = ts.findChildOfKind(tryStatement, 86 /* FinallyKeyword */, sourceFile); - pushKeywordIf(keywords, finallyKeyword, 86 /* FinallyKeyword */); + aggregate(tryStatement.finallyBlock); } - return ts.map(keywords, getHighlightSpanForNode); } - function getThrowOccurrences(throwStatement) { - var owner = getThrowStatementOwner(throwStatement); - if (!owner) { - return undefined; - } - var keywords = []; - ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 99 /* ThrowKeyword */); - }); - // If the "owner" is a function, then we equate 'return' and 'throw' statements in their - // ability to "jump out" of the function, and include occurrences for both. - if (ts.isFunctionBlock(owner)) { - ts.forEachReturnStatement(owner, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 95 /* ReturnKeyword */); - }); - } - return ts.map(keywords, getHighlightSpanForNode); - } - function getReturnOccurrences(returnStatement) { - var func = ts.getContainingFunction(returnStatement); - // If we didn't find a containing function with a block body, bail out. - if (!(func && hasKind(func.body, 204 /* Block */))) { - return undefined; - } - var keywords = []; - ts.forEachReturnStatement(func.body, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 95 /* ReturnKeyword */); - }); - // Include 'throw' statements that do not occur within a try block. - ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 99 /* ThrowKeyword */); - }); - return ts.map(keywords, getHighlightSpanForNode); - } - function getIfElseOccurrences(ifStatement) { - var keywords = []; - // Traverse upwards through all parent if-statements linked by their else-branches. - while (hasKind(ifStatement.parent, 208 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { - ifStatement = ifStatement.parent; - } - // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. - while (ifStatement) { - var children = ifStatement.getChildren(); - pushKeywordIf(keywords, children[0], 89 /* IfKeyword */); - // Generally the 'else' keyword is second-to-last, so we traverse backwards. - for (var i = children.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, children[i], 81 /* ElseKeyword */)) { - break; - } - } - if (!hasKind(ifStatement.elseStatement, 208 /* IfStatement */)) { - break; - } - ifStatement = ifStatement.elseStatement; - } - var result = []; - // We'd like to highlight else/ifs together if they are only separated by whitespace - // (i.e. the keywords are separated by no comments, no newlines). - for (var i = 0; i < keywords.length; i++) { - if (keywords[i].kind === 81 /* ElseKeyword */ && i < keywords.length - 1) { - var elseKeyword = keywords[i]; - var ifKeyword = keywords[i + 1]; // this *should* always be an 'if' keyword. - var shouldCombindElseAndIf = true; - // Avoid recalculating getStart() by iterating backwards. - for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { - if (!ts.isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(j))) { - shouldCombindElseAndIf = false; - break; - } - } - if (shouldCombindElseAndIf) { - result.push({ - fileName: fileName, - textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), - kind: ts.HighlightSpanKind.reference - }); - i++; // skip the next keyword - continue; - } - } - // Ordinary case: just highlight the keyword. - result.push(getHighlightSpanForNode(keywords[i])); - } - return result; + else if (!ts.isFunctionLike(node)) { + ts.forEachChild(node, aggregate); } } } - DocumentHighlights.getDocumentHighlights = getDocumentHighlights; + /** + * For lack of a better name, this function takes a throw statement and returns the + * nearest ancestor that is a try-block (whose try statement has a catch clause), + * function-block, or source file. + */ + function getThrowStatementOwner(throwStatement) { + var child = throwStatement; + while (child.parent) { + var parent_2 = child.parent; + if (ts.isFunctionBlock(parent_2) || parent_2.kind === 264 /* SourceFile */) { + return parent_2; + } + // A throw-statement is only owned by a try-statement if the try-statement has + // a catch clause, and if the throw-statement occurs within the try block. + if (parent_2.kind === 223 /* TryStatement */) { + var tryStatement = parent_2; + if (tryStatement.tryBlock === child && tryStatement.catchClause) { + return child; + } + } + child = parent_2; + } + return undefined; + } + function aggregateAllBreakAndContinueStatements(node) { + var statementAccumulator = []; + aggregate(node); + return statementAccumulator; + function aggregate(node) { + if (node.kind === 217 /* BreakStatement */ || node.kind === 216 /* ContinueStatement */) { + statementAccumulator.push(node); + } + else if (!ts.isFunctionLike(node)) { + ts.forEachChild(node, aggregate); + } + } + } + function ownsBreakOrContinueStatement(owner, statement) { + var actualOwner = getBreakOrContinueOwner(statement); + return actualOwner && actualOwner === owner; + } + function getBreakOrContinueOwner(statement) { + for (var node = statement.parent; node; node = node.parent) { + switch (node.kind) { + case 220 /* SwitchStatement */: + if (statement.kind === 216 /* ContinueStatement */) { + continue; + } + // falls through + case 213 /* ForStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: + case 212 /* WhileStatement */: + case 211 /* DoStatement */: + if (!statement.label || isLabeledBy(node, statement.label.text)) { + return node; + } + break; + default: + // Don't cross function boundaries. + if (ts.isFunctionLike(node)) { + return undefined; + } + break; + } + } + return undefined; + } + function getModifierOccurrences(modifier, declaration) { + var container = declaration.parent; + // Make sure we only highlight the keyword when it makes sense to do so. + if (ts.isAccessibilityModifier(modifier)) { + if (!(container.kind === 228 /* ClassDeclaration */ || + container.kind === 198 /* ClassExpression */ || + (declaration.kind === 145 /* Parameter */ && hasKind(container, 151 /* Constructor */)))) { + return undefined; + } + } + else if (modifier === 114 /* StaticKeyword */) { + if (!(container.kind === 228 /* ClassDeclaration */ || container.kind === 198 /* ClassExpression */)) { + return undefined; + } + } + else if (modifier === 83 /* ExportKeyword */ || modifier === 123 /* DeclareKeyword */) { + if (!(container.kind === 233 /* ModuleBlock */ || container.kind === 264 /* SourceFile */)) { + return undefined; + } + } + else if (modifier === 116 /* AbstractKeyword */) { + if (!(container.kind === 228 /* ClassDeclaration */ || declaration.kind === 228 /* ClassDeclaration */)) { + return undefined; + } + } + else { + // unsupported modifier + return undefined; + } + var keywords = []; + var modifierFlag = getFlagFromModifier(modifier); + var nodes; + switch (container.kind) { + case 233 /* ModuleBlock */: + case 264 /* SourceFile */: + // Container is either a class declaration or the declaration is a classDeclaration + if (modifierFlag & 128 /* Abstract */) { + nodes = declaration.members.concat(declaration); + } + else { + nodes = container.statements; + } + break; + case 151 /* Constructor */: + nodes = container.parameters.concat(container.parent.members); + break; + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + nodes = container.members; + // If we're an accessibility modifier, we're in an instance member and should search + // the constructor's parameter list for instance members as well. + if (modifierFlag & 28 /* AccessibilityModifier */) { + var constructor = ts.forEach(container.members, function (member) { + return member.kind === 151 /* Constructor */ && member; + }); + if (constructor) { + nodes = nodes.concat(constructor.parameters); + } + } + else if (modifierFlag & 128 /* Abstract */) { + nodes = nodes.concat(container); + } + break; + default: + ts.Debug.fail("Invalid container kind."); + } + ts.forEach(nodes, function (node) { + if (ts.getModifierFlags(node) & modifierFlag) { + ts.forEach(node.modifiers, function (child) { return pushKeywordIf(keywords, child, modifier); }); + } + }); + return keywords; + function getFlagFromModifier(modifier) { + switch (modifier) { + case 113 /* PublicKeyword */: + return 4 /* Public */; + case 111 /* PrivateKeyword */: + return 8 /* Private */; + case 112 /* ProtectedKeyword */: + return 16 /* Protected */; + case 114 /* StaticKeyword */: + return 32 /* Static */; + case 83 /* ExportKeyword */: + return 1 /* Export */; + case 123 /* DeclareKeyword */: + return 2 /* Ambient */; + case 116 /* AbstractKeyword */: + return 128 /* Abstract */; + default: + ts.Debug.fail(); + } + } + } + function pushKeywordIf(keywordList, token) { + var expected = []; + for (var _i = 2; _i < arguments.length; _i++) { + expected[_i - 2] = arguments[_i]; + } + if (token && ts.contains(expected, token.kind)) { + keywordList.push(token); + return true; + } + return false; + } + function getGetAndSetOccurrences(accessorDeclaration) { + var keywords = []; + tryPushAccessorKeyword(accessorDeclaration.symbol, 152 /* GetAccessor */); + tryPushAccessorKeyword(accessorDeclaration.symbol, 153 /* SetAccessor */); + return keywords; + function tryPushAccessorKeyword(accessorSymbol, accessorKind) { + var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); + if (accessor) { + ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 124 /* GetKeyword */, 134 /* SetKeyword */); }); + } + } + } + function getConstructorOccurrences(constructorDeclaration) { + var declarations = constructorDeclaration.symbol.getDeclarations(); + var keywords = []; + ts.forEach(declarations, function (declaration) { + ts.forEach(declaration.getChildren(), function (token) { + return pushKeywordIf(keywords, token, 122 /* ConstructorKeyword */); + }); + }); + return keywords; + } + function getLoopBreakContinueOccurrences(loopNode) { + var keywords = []; + if (pushKeywordIf(keywords, loopNode.getFirstToken(), 87 /* ForKeyword */, 105 /* WhileKeyword */, 80 /* DoKeyword */)) { + // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. + if (loopNode.kind === 211 /* DoStatement */) { + var loopTokens = loopNode.getChildren(); + for (var i = loopTokens.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, loopTokens[i], 105 /* WhileKeyword */)) { + break; + } + } + } + } + var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); + ts.forEach(breaksAndContinues, function (statement) { + if (ownsBreakOrContinueStatement(loopNode, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), 71 /* BreakKeyword */, 76 /* ContinueKeyword */); + } + }); + return keywords; + } + function getBreakOrContinueStatementOccurrences(breakOrContinueStatement) { + var owner = getBreakOrContinueOwner(breakOrContinueStatement); + if (owner) { + switch (owner.kind) { + case 213 /* ForStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: + case 211 /* DoStatement */: + case 212 /* WhileStatement */: + return getLoopBreakContinueOccurrences(owner); + case 220 /* SwitchStatement */: + return getSwitchCaseDefaultOccurrences(owner); + } + } + return undefined; + } + function getSwitchCaseDefaultOccurrences(switchStatement) { + var keywords = []; + pushKeywordIf(keywords, switchStatement.getFirstToken(), 97 /* SwitchKeyword */); + // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. + ts.forEach(switchStatement.caseBlock.clauses, function (clause) { + pushKeywordIf(keywords, clause.getFirstToken(), 72 /* CaseKeyword */, 78 /* DefaultKeyword */); + var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); + ts.forEach(breaksAndContinues, function (statement) { + if (ownsBreakOrContinueStatement(switchStatement, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), 71 /* BreakKeyword */); + } + }); + }); + return keywords; + } + function getTryCatchFinallyOccurrences(tryStatement, sourceFile) { + var keywords = []; + pushKeywordIf(keywords, tryStatement.getFirstToken(), 101 /* TryKeyword */); + if (tryStatement.catchClause) { + pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 73 /* CatchKeyword */); + } + if (tryStatement.finallyBlock) { + var finallyKeyword = ts.findChildOfKind(tryStatement, 86 /* FinallyKeyword */, sourceFile); + pushKeywordIf(keywords, finallyKeyword, 86 /* FinallyKeyword */); + } + return keywords; + } + function getThrowOccurrences(throwStatement) { + var owner = getThrowStatementOwner(throwStatement); + if (!owner) { + return undefined; + } + var keywords = []; + ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { + pushKeywordIf(keywords, throwStatement.getFirstToken(), 99 /* ThrowKeyword */); + }); + // If the "owner" is a function, then we equate 'return' and 'throw' statements in their + // ability to "jump out" of the function, and include occurrences for both. + if (ts.isFunctionBlock(owner)) { + ts.forEachReturnStatement(owner, function (returnStatement) { + pushKeywordIf(keywords, returnStatement.getFirstToken(), 95 /* ReturnKeyword */); + }); + } + return keywords; + } + function getReturnOccurrences(returnStatement) { + var func = ts.getContainingFunction(returnStatement); + // If we didn't find a containing function with a block body, bail out. + if (!(func && hasKind(func.body, 206 /* Block */))) { + return undefined; + } + var keywords = []; + ts.forEachReturnStatement(func.body, function (returnStatement) { + pushKeywordIf(keywords, returnStatement.getFirstToken(), 95 /* ReturnKeyword */); + }); + // Include 'throw' statements that do not occur within a try block. + ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { + pushKeywordIf(keywords, throwStatement.getFirstToken(), 99 /* ThrowKeyword */); + }); + return keywords; + } + function getIfElseOccurrences(ifStatement, sourceFile) { + var keywords = []; + // Traverse upwards through all parent if-statements linked by their else-branches. + while (hasKind(ifStatement.parent, 210 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { + ifStatement = ifStatement.parent; + } + // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. + while (ifStatement) { + var children = ifStatement.getChildren(); + pushKeywordIf(keywords, children[0], 89 /* IfKeyword */); + // Generally the 'else' keyword is second-to-last, so we traverse backwards. + for (var i = children.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, children[i], 81 /* ElseKeyword */)) { + break; + } + } + if (!hasKind(ifStatement.elseStatement, 210 /* IfStatement */)) { + break; + } + ifStatement = ifStatement.elseStatement; + } + var result = []; + // We'd like to highlight else/ifs together if they are only separated by whitespace + // (i.e. the keywords are separated by no comments, no newlines). + for (var i = 0; i < keywords.length; i++) { + if (keywords[i].kind === 81 /* ElseKeyword */ && i < keywords.length - 1) { + var elseKeyword = keywords[i]; + var ifKeyword = keywords[i + 1]; // this *should* always be an 'if' keyword. + var shouldCombindElseAndIf = true; + // Avoid recalculating getStart() by iterating backwards. + for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { + if (!ts.isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(j))) { + shouldCombindElseAndIf = false; + break; + } + } + if (shouldCombindElseAndIf) { + result.push({ + fileName: sourceFile.fileName, + textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), + kind: ts.HighlightSpanKind.reference + }); + i++; // skip the next keyword + continue; + } + } + // Ordinary case: just highlight the keyword. + result.push(getHighlightSpanForNode(keywords[i], sourceFile)); + } + return result; + } /** * Whether or not a 'node' is preceded by a label of the given string. * Note: 'node' cannot be a SourceFile. */ function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 219 /* LabeledStatement */; owner = owner.parent) { + for (var owner = node.parent; owner.kind === 221 /* LabeledStatement */; owner = owner.parent) { if (owner.label.text === labelName) { return true; } @@ -69168,15 +74232,15 @@ var ts; return "_" + settings.target + "|" + settings.module + "|" + settings.noResolve + "|" + settings.jsx + "|" + settings.allowJs + "|" + settings.baseUrl + "|" + JSON.stringify(settings.typeRoots) + "|" + JSON.stringify(settings.rootDirs) + "|" + JSON.stringify(settings.paths); } function getBucketForCompilationSettings(key, createIfMissing) { - var bucket = buckets[key]; + var bucket = buckets.get(key); if (!bucket && createIfMissing) { - buckets[key] = bucket = ts.createFileMap(); + buckets.set(key, bucket = ts.createFileMap()); } return bucket; } function reportStats() { - var bucketInfoArray = Object.keys(buckets).filter(function (name) { return name && name.charAt(0) === "_"; }).map(function (name) { - var entries = buckets[name]; + var bucketInfoArray = ts.arrayFrom(buckets.keys()).filter(function (name) { return name && name.charAt(0) === "_"; }).map(function (name) { + var entries = buckets.get(name); var sourceFiles = []; entries.forEachValue(function (key, entry) { sourceFiles.push({ @@ -69269,41 +74333,764 @@ var ts; } ts.createDocumentRegistry = createDocumentRegistry; })(ts || (ts = {})); +/* Code for finding imports of an exported symbol. Used only by FindAllReferences. */ /* @internal */ var ts; (function (ts) { var FindAllReferences; (function (FindAllReferences) { - function findReferencedSymbols(typeChecker, cancellationToken, sourceFiles, sourceFile, position, findInStrings, findInComments) { - var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); - if (node === sourceFile) { + /** Creates the imports map and returns an ImportTracker that uses it. Call this lazily to avoid calling `getDirectImportsMap` unnecessarily. */ + function createImportTracker(sourceFiles, checker, cancellationToken) { + var allDirectImports = getDirectImportsMap(sourceFiles, checker, cancellationToken); + return function (exportSymbol, exportInfo, isForRename) { + var _a = getImportersForExport(sourceFiles, allDirectImports, exportInfo, checker, cancellationToken), directImports = _a.directImports, indirectUsers = _a.indirectUsers; + return __assign({ indirectUsers: indirectUsers }, getSearchesFromDirectImports(directImports, exportSymbol, exportInfo.exportKind, checker, isForRename)); + }; + } + FindAllReferences.createImportTracker = createImportTracker; + var ExportKind; + (function (ExportKind) { + ExportKind[ExportKind["Named"] = 0] = "Named"; + ExportKind[ExportKind["Default"] = 1] = "Default"; + ExportKind[ExportKind["ExportEquals"] = 2] = "ExportEquals"; + })(ExportKind = FindAllReferences.ExportKind || (FindAllReferences.ExportKind = {})); + var ImportExport; + (function (ImportExport) { + ImportExport[ImportExport["Import"] = 0] = "Import"; + ImportExport[ImportExport["Export"] = 1] = "Export"; + })(ImportExport = FindAllReferences.ImportExport || (FindAllReferences.ImportExport = {})); + /** Returns import statements that directly reference the exporting module, and a list of files that may access the module through a namespace. */ + function getImportersForExport(sourceFiles, allDirectImports, _a, checker, cancellationToken) { + var exportingModuleSymbol = _a.exportingModuleSymbol, exportKind = _a.exportKind; + var markSeenDirectImport = ts.nodeSeenTracker(); + var markSeenIndirectUser = ts.nodeSeenTracker(); + var directImports = []; + var isAvailableThroughGlobal = !!exportingModuleSymbol.globalExports; + var indirectUserDeclarations = isAvailableThroughGlobal ? undefined : []; + handleDirectImports(exportingModuleSymbol); + return { directImports: directImports, indirectUsers: getIndirectUsers() }; + function getIndirectUsers() { + if (isAvailableThroughGlobal) { + // It has `export as namespace`, so anything could potentially use it. + return sourceFiles; + } + // Module augmentations may use this module's exports without importing it. + for (var _i = 0, _a = exportingModuleSymbol.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + if (ts.isExternalModuleAugmentation(decl)) { + addIndirectUser(decl); + } + } + // This may return duplicates (if there are multiple module declarations in a single source file, all importing the same thing as a namespace), but `State.markSearchedSymbol` will handle that. + return indirectUserDeclarations.map(ts.getSourceFileOfNode); + } + function handleDirectImports(exportingModuleSymbol) { + var theseDirectImports = getDirectImports(exportingModuleSymbol); + if (theseDirectImports) + for (var _i = 0, theseDirectImports_1 = theseDirectImports; _i < theseDirectImports_1.length; _i++) { + var direct = theseDirectImports_1[_i]; + if (!markSeenDirectImport(direct)) { + continue; + } + cancellationToken.throwIfCancellationRequested(); + switch (direct.kind) { + case 180 /* CallExpression */: + if (!isAvailableThroughGlobal) { + var parent = direct.parent; + if (exportKind === 2 /* ExportEquals */ && parent.kind === 225 /* VariableDeclaration */) { + var name = parent.name; + if (name.kind === 70 /* Identifier */) { + directImports.push(name); + break; + } + } + // Don't support re-exporting 'require()' calls, so just add a single indirect user. + addIndirectUser(direct.getSourceFile()); + } + break; + case 236 /* ImportEqualsDeclaration */: + handleNamespaceImport(direct, direct.name, ts.hasModifier(direct, 1 /* Export */)); + break; + case 237 /* ImportDeclaration */: + var namedBindings = direct.importClause && direct.importClause.namedBindings; + if (namedBindings && namedBindings.kind === 239 /* NamespaceImport */) { + handleNamespaceImport(direct, namedBindings.name); + } + else { + directImports.push(direct); + } + break; + case 243 /* ExportDeclaration */: + if (!direct.exportClause) { + // This is `export * from "foo"`, so imports of this module may import the export too. + handleDirectImports(getContainingModuleSymbol(direct, checker)); + } + else { + // This is `export { foo } from "foo"` and creates an alias symbol, so recursive search will get handle re-exports. + directImports.push(direct); + } + break; + } + } + } + function handleNamespaceImport(importDeclaration, name, isReExport) { + if (exportKind === 2 /* ExportEquals */) { + // This is a direct import, not import-as-namespace. + directImports.push(importDeclaration); + } + else if (!isAvailableThroughGlobal) { + var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); + ts.Debug.assert(sourceFileLike.kind === 264 /* SourceFile */ || sourceFileLike.kind === 232 /* ModuleDeclaration */); + if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { + addIndirectUsers(sourceFileLike); + } + else { + addIndirectUser(sourceFileLike); + } + } + } + function addIndirectUser(sourceFileLike) { + ts.Debug.assert(!isAvailableThroughGlobal); + var isNew = markSeenIndirectUser(sourceFileLike); + if (isNew) { + indirectUserDeclarations.push(sourceFileLike); + } + return isNew; + } + /** Adds a module and all of its transitive dependencies as possible indirect users. */ + function addIndirectUsers(sourceFileLike) { + if (!addIndirectUser(sourceFileLike)) { + return; + } + var moduleSymbol = checker.getMergedSymbol(sourceFileLike.symbol); + ts.Debug.assert(!!(moduleSymbol.flags & 1536 /* Module */)); + var directImports = getDirectImports(moduleSymbol); + if (directImports) + for (var _i = 0, directImports_1 = directImports; _i < directImports_1.length; _i++) { + var directImport = directImports_1[_i]; + addIndirectUsers(getSourceFileLikeForImportDeclaration(directImport)); + } + } + function getDirectImports(moduleSymbol) { + return allDirectImports.get(ts.getSymbolId(moduleSymbol).toString()); + } + } + /** + * Given the set of direct imports of a module, we need to find which ones import the particular exported symbol. + * The returned `importSearches` will result in the entire source file being searched. + * But re-exports will be placed in 'singleReferences' since they cannot be locally referenced. + */ + function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, checker, isForRename) { + var exportName = exportSymbol.name; + var importSearches = []; + var singleReferences = []; + function addSearch(location, symbol) { + importSearches.push([location, symbol]); + } + if (directImports) + for (var _i = 0, directImports_2 = directImports; _i < directImports_2.length; _i++) { + var decl = directImports_2[_i]; + handleImport(decl); + } + return { importSearches: importSearches, singleReferences: singleReferences }; + function handleImport(decl) { + if (decl.kind === 236 /* ImportEqualsDeclaration */) { + if (isExternalModuleImportEquals(decl)) { + handleNamespaceImportLike(decl.name); + } + return; + } + if (decl.kind === 70 /* Identifier */) { + handleNamespaceImportLike(decl); + return; + } + // Ignore if there's a grammar error + if (decl.moduleSpecifier.kind !== 9 /* StringLiteral */) { + return; + } + if (decl.kind === 243 /* ExportDeclaration */) { + searchForNamedImport(decl.exportClause); + return; + } + var importClause = decl.importClause; + var namedBindings = importClause.namedBindings; + if (namedBindings && namedBindings.kind === 239 /* NamespaceImport */) { + handleNamespaceImportLike(namedBindings.name); + return; + } + if (exportKind === 0 /* Named */) { + searchForNamedImport(namedBindings); + } + else { + // `export =` might be imported by a default import if `--allowSyntheticDefaultImports` is on, so this handles both ExportKind.Default and ExportKind.ExportEquals + var name = importClause.name; + // If a default import has the same name as the default export, allow to rename it. + // Given `import f` and `export default function f`, we will rename both, but for `import g` we will rename just that. + if (name && (!isForRename || name.text === symbolName(exportSymbol))) { + var defaultImportAlias = checker.getSymbolAtLocation(name); + addSearch(name, defaultImportAlias); + } + // 'default' might be accessed as a named import `{ default as foo }`. + if (!isForRename && exportKind === 1 /* Default */) { + ts.Debug.assert(exportName === "default"); + searchForNamedImport(namedBindings); + } + } + } + /** + * `import x = require("./x") or `import * as x from "./x"`. + * An `export =` may be imported by this syntax, so it may be a direct import. + * If it's not a direct import, it will be in `indirectUsers`, so we don't have to do anything here. + */ + function handleNamespaceImportLike(importName) { + // Don't rename an import that already has a different name than the export. + if (exportKind === 2 /* ExportEquals */ && (!isForRename || importName.text === exportName)) { + addSearch(importName, checker.getSymbolAtLocation(importName)); + } + } + function searchForNamedImport(namedBindings) { + if (namedBindings) + for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { + var element = _a[_i]; + var name = element.name, propertyName = element.propertyName; + if ((propertyName || name).text !== exportName) { + continue; + } + if (propertyName) { + // This is `import { foo as bar } from "./a"` or `export { foo as bar } from "./a"`. `foo` isn't a local in the file, so just add it as a single reference. + singleReferences.push(propertyName); + if (!isForRename) { + // Search locally for `bar`. + addSearch(name, checker.getSymbolAtLocation(name)); + } + } + else { + var localSymbol = element.kind === 245 /* ExportSpecifier */ && element.propertyName + ? checker.getExportSpecifierLocalTargetSymbol(element) // For re-exporting under a different name, we want to get the re-exported symbol. + : checker.getSymbolAtLocation(name); + addSearch(name, localSymbol); + } + } + } + } + /** Returns 'true' is the namespace 'name' is re-exported from this module, and 'false' if it is only used locally. */ + function findNamespaceReExports(sourceFileLike, name, checker) { + var namespaceImportSymbol = checker.getSymbolAtLocation(name); + return forEachPossibleImportOrExportStatement(sourceFileLike, function (statement) { + if (statement.kind !== 243 /* ExportDeclaration */) + return; + var _a = statement, exportClause = _a.exportClause, moduleSpecifier = _a.moduleSpecifier; + if (moduleSpecifier || !exportClause) + return; + for (var _i = 0, _b = exportClause.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (checker.getExportSpecifierLocalTargetSymbol(element) === namespaceImportSymbol) { + return true; + } + } + }); + } + /** Returns a map from a module symbol Id to all import statements that directly reference the module. */ + function getDirectImportsMap(sourceFiles, checker, cancellationToken) { + var map = ts.createMap(); + for (var _i = 0, sourceFiles_4 = sourceFiles; _i < sourceFiles_4.length; _i++) { + var sourceFile = sourceFiles_4[_i]; + cancellationToken.throwIfCancellationRequested(); + forEachImport(sourceFile, function (importDecl, moduleSpecifier) { + var moduleSymbol = checker.getSymbolAtLocation(moduleSpecifier); + if (moduleSymbol) { + var id = ts.getSymbolId(moduleSymbol).toString(); + var imports = map.get(id); + if (!imports) { + map.set(id, imports = []); + } + imports.push(importDecl); + } + }); + } + return map; + } + /** Iterates over all statements at the top level or in module declarations. Returns the first truthy result. */ + function forEachPossibleImportOrExportStatement(sourceFileLike, action) { + return ts.forEach(sourceFileLike.kind === 264 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); + }); + } + /** Calls `action` for each import, re-export, or require() in a file. */ + function forEachImport(sourceFile, action) { + if (sourceFile.externalModuleIndicator) { + for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { + var moduleSpecifier = _a[_i]; + action(importerFromModuleSpecifier(moduleSpecifier), moduleSpecifier); + } + } + else { + forEachPossibleImportOrExportStatement(sourceFile, function (statement) { + switch (statement.kind) { + case 243 /* ExportDeclaration */: + case 237 /* ImportDeclaration */: { + var decl = statement; + if (decl.moduleSpecifier && decl.moduleSpecifier.kind === 9 /* StringLiteral */) { + action(decl, decl.moduleSpecifier); + } + break; + } + case 236 /* ImportEqualsDeclaration */: { + var decl = statement; + var moduleReference = decl.moduleReference; + if (moduleReference.kind === 247 /* ExternalModuleReference */ && + moduleReference.expression.kind === 9 /* StringLiteral */) { + action(decl, moduleReference.expression); + } + break; + } + } + }); + if (sourceFile.flags & 65536 /* JavaScriptFile */) { + // Find all 'require()' calls. + sourceFile.forEachChild(function recur(node) { + if (ts.isRequireCall(node, /*checkArgumentIsStringLiteral*/ true)) { + action(node, node.arguments[0]); + } + else { + node.forEachChild(recur); + } + }); + } + } + } + function importerFromModuleSpecifier(moduleSpecifier) { + var decl = moduleSpecifier.parent; + if (decl.kind === 237 /* ImportDeclaration */ || decl.kind === 243 /* ExportDeclaration */) { + return decl; + } + ts.Debug.assert(decl.kind === 247 /* ExternalModuleReference */); + return decl.parent; + } + /** + * Given a local reference, we might notice that it's an import/export and recursively search for references of that. + * If at an import, look locally for the symbol it imports. + * If an an export, look for all imports of it. + * This doesn't handle export specifiers; that is done in `getReferencesAtExportSpecifier`. + * @param comingFromExport If we are doing a search for all exports, don't bother looking backwards for the imported symbol, since that's the reason we're here. + */ + function getImportOrExportSymbol(node, symbol, checker, comingFromExport) { + return comingFromExport ? getExport() : getExport() || getImport(); + function getExport() { + var parent = node.parent; + if (symbol.flags & 7340032 /* Export */) { + if (parent.kind === 178 /* PropertyAccessExpression */) { + // When accessing an export of a JS module, there's no alias. The symbol will still be flagged as an export even though we're at the use. + // So check that we are at the declaration. + return symbol.declarations.some(function (d) { return d === parent; }) && parent.parent.kind === 193 /* BinaryExpression */ + ? getSpecialPropertyExport(parent.parent, /*useLhsSymbol*/ false) + : undefined; + } + else { + var exportSymbol = symbol.exportSymbol; + ts.Debug.assert(!!exportSymbol); + return exportInfo(exportSymbol, getExportKindForDeclaration(parent)); + } + } + else { + var exportNode = parent.kind === 225 /* VariableDeclaration */ ? ts.getAncestor(parent, 207 /* VariableStatement */) : parent; + if (ts.hasModifier(exportNode, 1 /* Export */)) { + if (exportNode.kind === 236 /* ImportEqualsDeclaration */ && exportNode.moduleReference === node) { + // We're at `Y` in `export import X = Y`. This is not the exported symbol, the left-hand-side is. So treat this as an import statement. + if (comingFromExport) { + return undefined; + } + var lhsSymbol = checker.getSymbolAtLocation(exportNode.name); + return { kind: 0 /* Import */, symbol: lhsSymbol, isNamedImport: false }; + } + else { + return exportInfo(symbol, getExportKindForDeclaration(exportNode)); + } + } + else if (parent.kind === 242 /* ExportAssignment */) { + // Get the symbol for the `export =` node; its parent is the module it's the export of. + var exportingModuleSymbol = parent.symbol.parent; + ts.Debug.assert(!!exportingModuleSymbol); + return { kind: 1 /* Export */, symbol: symbol, exportInfo: { exportingModuleSymbol: exportingModuleSymbol, exportKind: 2 /* ExportEquals */ } }; + } + else if (parent.kind === 193 /* BinaryExpression */) { + return getSpecialPropertyExport(parent, /*useLhsSymbol*/ true); + } + else if (parent.parent.kind === 193 /* BinaryExpression */) { + return getSpecialPropertyExport(parent.parent, /*useLhsSymbol*/ true); + } + } + function getSpecialPropertyExport(node, useLhsSymbol) { + var kind; + switch (ts.getSpecialPropertyAssignmentKind(node)) { + case 1 /* ExportsProperty */: + kind = 0 /* Named */; + break; + case 2 /* ModuleExports */: + kind = 2 /* ExportEquals */; + break; + default: + return undefined; + } + var sym = useLhsSymbol ? checker.getSymbolAtLocation(node.left.name) : symbol; + return sym && exportInfo(sym, kind); + } + } + function getImport() { + var isImport = isNodeImport(node); + if (!isImport) + return; + // A symbol being imported is always an alias. So get what that aliases to find the local symbol. + var importedSymbol = checker.getImmediateAliasedSymbol(symbol); + if (importedSymbol) { + // Search on the local symbol in the exporting module, not the exported symbol. + importedSymbol = skipExportSpecifierSymbol(importedSymbol, checker); + // Similarly, skip past the symbol for 'export =' + if (importedSymbol.name === "export=") { + importedSymbol = checker.getImmediateAliasedSymbol(importedSymbol); + } + if (symbolName(importedSymbol) === symbol.name) { + return __assign({ kind: 0 /* Import */, symbol: importedSymbol }, isImport); + } + } + } + function exportInfo(symbol, kind) { + var exportInfo = getExportInfo(symbol, kind, checker); + return exportInfo && { kind: 1 /* Export */, symbol: symbol, exportInfo: exportInfo }; + } + // Not meant for use with export specifiers or export assignment. + function getExportKindForDeclaration(node) { + return ts.hasModifier(node, 512 /* Default */) ? 1 /* Default */ : 0 /* Named */; + } + } + FindAllReferences.getImportOrExportSymbol = getImportOrExportSymbol; + function isNodeImport(node) { + var parent = node.parent; + switch (parent.kind) { + case 236 /* ImportEqualsDeclaration */: + return parent.name === node && isExternalModuleImportEquals(parent) + ? { isNamedImport: false } + : undefined; + case 241 /* ImportSpecifier */: + // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`. + return parent.propertyName ? undefined : { isNamedImport: true }; + case 238 /* ImportClause */: + case 239 /* NamespaceImport */: + ts.Debug.assert(parent.name === node); + return { isNamedImport: false }; + default: + return undefined; + } + } + function getExportInfo(exportSymbol, exportKind, checker) { + var exportingModuleSymbol = checker.getMergedSymbol(exportSymbol.parent); // Need to get merged symbol in case there's an augmentation. + // `export` may appear in a namespace. In that case, just rely on global search. + return ts.isExternalModuleSymbol(exportingModuleSymbol) ? { exportingModuleSymbol: exportingModuleSymbol, exportKind: exportKind } : undefined; + } + FindAllReferences.getExportInfo = getExportInfo; + function symbolName(symbol) { + if (symbol.name !== "default") { + return symbol.name; + } + var name = ts.forEach(symbol.declarations, function (_a) { + var name = _a.name; + return name && name.kind === 70 /* Identifier */ && name.text; + }); + ts.Debug.assert(!!name); + return name; + } + /** If at an export specifier, go to the symbol it refers to. */ + function skipExportSpecifierSymbol(symbol, checker) { + // For `export { foo } from './bar", there's nothing to skip, because it does not create a new alias. But `export { foo } does. + if (symbol.declarations) + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + if (ts.isExportSpecifier(declaration) && !declaration.propertyName && !declaration.parent.parent.moduleSpecifier) { + return checker.getExportSpecifierLocalTargetSymbol(declaration); + } + } + return symbol; + } + function getContainingModuleSymbol(importer, checker) { + return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); + } + function getSourceFileLikeForImportDeclaration(node) { + if (node.kind === 180 /* CallExpression */) { + return node.getSourceFile(); + } + var parent = node.parent; + if (parent.kind === 264 /* SourceFile */) { + return parent; + } + ts.Debug.assert(parent.kind === 233 /* ModuleBlock */ && isAmbientModuleDeclaration(parent.parent)); + return parent.parent; + } + function isAmbientModuleDeclaration(node) { + return node.kind === 232 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */; + } + function isExternalModuleImportEquals(_a) { + var moduleReference = _a.moduleReference; + return moduleReference.kind === 247 /* ExternalModuleReference */ && moduleReference.expression.kind === 9 /* StringLiteral */; + } + })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); +})(ts || (ts = {})); +/// +/* @internal */ +var ts; +(function (ts) { + var FindAllReferences; + (function (FindAllReferences) { + function nodeEntry(node, isInString) { + return { type: "node", node: node, isInString: isInString }; + } + FindAllReferences.nodeEntry = nodeEntry; + function findReferencedSymbols(checker, cancellationToken, sourceFiles, sourceFile, position) { + var referencedSymbols = findAllReferencedSymbols(checker, cancellationToken, sourceFiles, sourceFile, position); + if (!referencedSymbols || !referencedSymbols.length) { return undefined; } - switch (node.kind) { - case 8 /* NumericLiteral */: - if (!ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) { - break; - } - // Fallthrough - case 70 /* Identifier */: - case 98 /* ThisKeyword */: - // case SyntaxKind.SuperKeyword: TODO:GH#9268 - case 122 /* ConstructorKeyword */: - case 9 /* StringLiteral */: - return getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFiles, findInStrings, findInComments, /*implementations*/ false); + var out = []; + for (var _i = 0, referencedSymbols_1 = referencedSymbols; _i < referencedSymbols_1.length; _i++) { + var _a = referencedSymbols_1[_i], definition = _a.definition, references = _a.references; + // Only include referenced symbols that have a valid definition. + if (definition) { + out.push({ definition: definitionToReferencedSymbolDefinitionInfo(definition, checker), references: references.map(toReferenceEntry) }); + } } - return undefined; + return out; } FindAllReferences.findReferencedSymbols = findReferencedSymbols; - function getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFiles, findInStrings, findInComments, implementations) { - if (!implementations) { + function getImplementationsAtPosition(checker, cancellationToken, sourceFiles, sourceFile, position) { + var node = ts.getTouchingPropertyName(sourceFile, position); + var referenceEntries = getImplementationReferenceEntries(checker, cancellationToken, sourceFiles, node); + return ts.map(referenceEntries, function (entry) { return toImplementationLocation(entry, checker); }); + } + FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; + function getImplementationReferenceEntries(typeChecker, cancellationToken, sourceFiles, node) { + // If invoked directly on a shorthand property assignment, then return + // the declaration of the symbol being assigned (not the symbol being assigned to). + if (node.parent.kind === 261 /* ShorthandPropertyAssignment */) { + var result_4 = []; + FindAllReferences.Core.getReferenceEntriesForShorthandPropertyAssignment(node, typeChecker, function (node) { return result_4.push(nodeEntry(node)); }); + return result_4; + } + else if (node.kind === 96 /* SuperKeyword */ || ts.isSuperProperty(node.parent)) { + // References to and accesses on the super keyword only have one possible implementation, so no + // need to "Find all References" + var symbol = typeChecker.getSymbolAtLocation(node); + return symbol.valueDeclaration && [nodeEntry(symbol.valueDeclaration)]; + } + else { + // Perform "Find all References" and retrieve only those that are implementations + return getReferenceEntriesForNode(node, sourceFiles, typeChecker, cancellationToken, { implementations: true }); + } + } + function findReferencedEntries(checker, cancellationToken, sourceFiles, sourceFile, position, options) { + var x = flattenEntries(findAllReferencedSymbols(checker, cancellationToken, sourceFiles, sourceFile, position, options)); + return ts.map(x, toReferenceEntry); + } + FindAllReferences.findReferencedEntries = findReferencedEntries; + function getReferenceEntriesForNode(node, sourceFiles, checker, cancellationToken, options) { + if (options === void 0) { options = {}; } + return flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(node, sourceFiles, checker, cancellationToken, options)); + } + FindAllReferences.getReferenceEntriesForNode = getReferenceEntriesForNode; + function findAllReferencedSymbols(checker, cancellationToken, sourceFiles, sourceFile, position, options) { + var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); + return FindAllReferences.Core.getReferencedSymbolsForNode(node, sourceFiles, checker, cancellationToken, options); + } + function flattenEntries(referenceSymbols) { + return referenceSymbols && ts.flatMap(referenceSymbols, function (r) { return r.references; }); + } + function definitionToReferencedSymbolDefinitionInfo(def, checker) { + var info = (function () { + switch (def.type) { + case "symbol": { + var symbol = def.symbol, node_2 = def.node; + var declarations = symbol.declarations; + if (!declarations || declarations.length === 0) { + return undefined; + } + var _a = getDefinitionKindAndDisplayParts(symbol, node_2, checker), displayParts_1 = _a.displayParts, kind_1 = _a.kind; + var name_3 = displayParts_1.map(function (p) { return p.text; }).join(""); + return { node: node_2, name: name_3, kind: kind_1, displayParts: displayParts_1 }; + } + case "label": { + var node_3 = def.node; + return { node: node_3, name: node_3.text, kind: ts.ScriptElementKind.label, displayParts: [ts.displayPart(node_3.text, ts.SymbolDisplayPartKind.text)] }; + } + case "keyword": { + var node_4 = def.node; + var name_4 = ts.tokenToString(node_4.kind); + return { node: node_4, name: name_4, kind: ts.ScriptElementKind.keyword, displayParts: [{ text: name_4, kind: ts.ScriptElementKind.keyword }] }; + } + case "this": { + var node_5 = def.node; + var symbol = checker.getSymbolAtLocation(node_5); + var displayParts_2 = symbol && ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, node_5.getSourceFile(), ts.getContainerNode(node_5), node_5).displayParts; + return { node: node_5, name: "this", kind: ts.ScriptElementKind.variableElement, displayParts: displayParts_2 }; + } + case "string": { + var node_6 = def.node; + return { node: node_6, name: node_6.text, kind: ts.ScriptElementKind.variableElement, displayParts: [ts.displayPart(ts.getTextOfNode(node_6), ts.SymbolDisplayPartKind.stringLiteral)] }; + } + } + })(); + if (!info) { + return undefined; + } + var node = info.node, name = info.name, kind = info.kind, displayParts = info.displayParts; + var sourceFile = node.getSourceFile(); + return { + containerKind: "", + containerName: "", + fileName: sourceFile.fileName, + kind: kind, + name: name, + textSpan: ts.createTextSpanFromNode(node, sourceFile), + displayParts: displayParts + }; + } + function getDefinitionKindAndDisplayParts(symbol, node, checker) { + var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, node.getSourceFile(), ts.getContainerNode(node), node), displayParts = _a.displayParts, symbolKind = _a.symbolKind; + return { displayParts: displayParts, kind: symbolKind }; + } + function toReferenceEntry(entry) { + if (entry.type === "span") { + return { textSpan: entry.textSpan, fileName: entry.fileName, isWriteAccess: false, isDefinition: false }; + } + var node = entry.node, isInString = entry.isInString; + return { + fileName: node.getSourceFile().fileName, + textSpan: getTextSpan(node), + isWriteAccess: isWriteAccess(node), + isDefinition: ts.isDeclarationName(node) || ts.isLiteralComputedPropertyDeclarationName(node), + isInString: isInString + }; + } + function toImplementationLocation(entry, checker) { + if (entry.type === "node") { + var node = entry.node; + return __assign({ textSpan: getTextSpan(node), fileName: node.getSourceFile().fileName }, implementationKindDisplayParts(node, checker)); + } + else { + var textSpan = entry.textSpan, fileName = entry.fileName; + return { textSpan: textSpan, fileName: fileName, kind: ts.ScriptElementKind.unknown, displayParts: [] }; + } + } + function implementationKindDisplayParts(node, checker) { + var symbol = checker.getSymbolAtLocation(ts.isDeclaration(node) && node.name ? node.name : node); + if (symbol) { + return getDefinitionKindAndDisplayParts(symbol, node, checker); + } + else if (node.kind === 177 /* ObjectLiteralExpression */) { + return { + kind: ts.ScriptElementKind.interfaceElement, + displayParts: [ts.punctuationPart(18 /* OpenParenToken */), ts.textPart("object literal"), ts.punctuationPart(19 /* CloseParenToken */)] + }; + } + else if (node.kind === 198 /* ClassExpression */) { + return { + kind: ts.ScriptElementKind.localClassElement, + displayParts: [ts.punctuationPart(18 /* OpenParenToken */), ts.textPart("anonymous local class"), ts.punctuationPart(19 /* CloseParenToken */)] + }; + } + else { + return { kind: ts.getNodeKind(node), displayParts: [] }; + } + } + function toHighlightSpan(entry) { + if (entry.type === "span") { + var fileName_1 = entry.fileName, textSpan = entry.textSpan; + return { fileName: fileName_1, span: { textSpan: textSpan, kind: ts.HighlightSpanKind.reference } }; + } + var node = entry.node, isInString = entry.isInString; + var fileName = entry.node.getSourceFile().fileName; + var writeAccess = isWriteAccess(node); + var span = { + textSpan: getTextSpan(node), + kind: writeAccess ? ts.HighlightSpanKind.writtenReference : ts.HighlightSpanKind.reference, + isInString: isInString + }; + return { fileName: fileName, span: span }; + } + FindAllReferences.toHighlightSpan = toHighlightSpan; + function getTextSpan(node) { + var start = node.getStart(); + var end = node.getEnd(); + if (node.kind === 9 /* StringLiteral */) { + start += 1; + end -= 1; + } + return ts.createTextSpanFromBounds(start, end); + } + /** A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment */ + function isWriteAccess(node) { + if (node.kind === 70 /* Identifier */ && ts.isDeclarationName(node)) { + return true; + } + var parent = node.parent; + if (parent) { + if (parent.kind === 192 /* PostfixUnaryExpression */ || parent.kind === 191 /* PrefixUnaryExpression */) { + return true; + } + else if (parent.kind === 193 /* BinaryExpression */ && parent.left === node) { + var operator = parent.operatorToken.kind; + return 57 /* FirstAssignment */ <= operator && operator <= 69 /* LastAssignment */; + } + } + return false; + } + })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); +})(ts || (ts = {})); +/** Encapsulates the core find-all-references algorithm. */ +/* @internal */ +(function (ts) { + var FindAllReferences; + (function (FindAllReferences) { + var Core; + (function (Core) { + /** Core find-all-references algorithm. Handles special cases before delegating to `getReferencedSymbolsForSymbol`. */ + function getReferencedSymbolsForNode(node, sourceFiles, checker, cancellationToken, options) { + if (options === void 0) { options = {}; } + if (node.kind === 264 /* SourceFile */) { + return undefined; + } + if (!options.implementations) { + var special = getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken); + if (special) { + return special; + } + } + var symbol = checker.getSymbolAtLocation(node); + // Could not find a symbol e.g. unknown identifier + if (!symbol) { + // String literal might be a property (and thus have a symbol), so do this here rather than in getReferencedSymbolsSpecial. + if (!options.implementations && node.kind === 9 /* StringLiteral */) { + return getReferencesForStringLiteral(node, sourceFiles, cancellationToken); + } + // Can't have references to something that we have no symbol for. + return undefined; + } + // The symbol was an internal symbol and does not have a declaration e.g. undefined symbol + if (!symbol.declarations || !symbol.declarations.length) { + return undefined; + } + return getReferencedSymbolsForSymbol(symbol, node, sourceFiles, checker, cancellationToken, options); + } + Core.getReferencedSymbolsForNode = getReferencedSymbolsForNode; + /** getReferencedSymbols for special node kinds. */ + function getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken) { + if (ts.isTypeKeyword(node.kind)) { + return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken); + } // Labels if (ts.isLabelName(node)) { if (ts.isJumpStatementTarget(node)) { var labelDefinition = ts.getTargetLabel(node.parent, node.text); // if we have a label definition, look within its statement for references, if not, then // the label is undefined and we have no results.. - return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : undefined; + return labelDefinition && getLabelReferencesInNode(labelDefinition.parent, labelDefinition); } else { // it is a label definition and not a target, search within the parent labeledStatement @@ -69311,129 +75098,164 @@ var ts; } } if (ts.isThis(node)) { - return getReferencesForThisKeyword(node, sourceFiles); + return getReferencesForThisKeyword(node, sourceFiles, cancellationToken); } if (node.kind === 96 /* SuperKeyword */) { return getReferencesForSuperKeyword(node); } - } - // `getSymbolAtLocation` normally returns the symbol of the class when given the constructor keyword, - // so we have to specify that we want the constructor symbol. - var symbol = typeChecker.getSymbolAtLocation(node); - if (!implementations && !symbol && node.kind === 9 /* StringLiteral */) { - return getReferencesForStringLiteral(node, sourceFiles); - } - // Could not find a symbol e.g. unknown identifier - if (!symbol) { - // Can't have references to something that we have no symbol for. return undefined; } - var declarations = symbol.declarations; - // The symbol was an internal symbol and does not have a declaration e.g. undefined symbol - if (!declarations || !declarations.length) { - return undefined; + /** Core find-all-references algorithm for a normal symbol. */ + function getReferencedSymbolsForSymbol(symbol, node, sourceFiles, checker, cancellationToken, options) { + symbol = skipPastExportOrImportSpecifier(symbol, node, checker); + // Compute the meaning from the location and the symbol it references + var searchMeaning = getIntersectingMeaningFromDeclarations(ts.getMeaningFromLocation(node), symbol.declarations); + var result = []; + var state = createState(sourceFiles, node, checker, cancellationToken, searchMeaning, options, result); + var search = state.createSearch(node, symbol, /*comingFrom*/ undefined, { allSearchSymbols: populateSearchSymbolSet(symbol, node, checker, options.implementations) }); + // Try to get the smallest valid scope that we can limit our search to; + // otherwise we'll need to search globally (i.e. include each file). + var scope = getSymbolScope(symbol); + if (scope) { + getReferencesInContainer(scope, scope.getSourceFile(), search, state); + } + else { + // Global search + for (var _i = 0, _a = state.sourceFiles; _i < _a.length; _i++) { + var sourceFile = _a[_i]; + state.cancellationToken.throwIfCancellationRequested(); + searchForName(sourceFile, search, state); + } + } + return result; } - var result; - // Compute the meaning from the location and the symbol it references - var searchMeaning = getIntersectingMeaningFromDeclarations(ts.getMeaningFromLocation(node), declarations); - // Get the text to search for. - // Note: if this is an external module symbol, the name doesn't include quotes. - var declaredName = ts.stripQuotes(ts.getDeclaredName(typeChecker, symbol, node)); - // Try to get the smallest valid scope that we can limit our search to; - // otherwise we'll need to search globally (i.e. include each file). - var scope = getSymbolScope(symbol); - // Maps from a symbol ID to the ReferencedSymbol entry in 'result'. - var symbolToIndex = []; - if (scope) { - result = []; - getReferencesInNode(scope, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); + /** Handle a few special cases relating to export/import specifiers. */ + function skipPastExportOrImportSpecifier(symbol, node, checker) { + var parent = node.parent; + if (ts.isExportSpecifier(parent)) { + return getLocalSymbolForExportSpecifier(node, symbol, parent, checker); + } + if (ts.isImportSpecifier(parent) && parent.propertyName === node) { + // We're at `foo` in `import { foo as bar }`. Probably intended to find all refs on the original, not just on the import. + return checker.getImmediateAliasedSymbol(symbol); + } + return symbol; } - else { - var internedName = getInternedName(symbol, node); - for (var _i = 0, sourceFiles_8 = sourceFiles; _i < sourceFiles_8.length; _i++) { - var sourceFile = sourceFiles_8[_i]; - cancellationToken.throwIfCancellationRequested(); - var nameTable = ts.getNameTable(sourceFile); - if (nameTable[internedName] !== undefined) { - result = result || []; - getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); + function createState(sourceFiles, originalLocation, checker, cancellationToken, searchMeaning, options, result) { + var symbolIdToReferences = []; + var inheritsFromCache = ts.createMap(); + // Source file ID → symbol ID → Whether the symbol has been searched for in the source file. + var sourceFileToSeenSymbols = []; + var isForConstructor = originalLocation.kind === 122 /* ConstructorKeyword */; + var importTracker; + return __assign({}, options, { sourceFiles: sourceFiles, isForConstructor: isForConstructor, checker: checker, cancellationToken: cancellationToken, searchMeaning: searchMeaning, inheritsFromCache: inheritsFromCache, getImportSearches: getImportSearches, createSearch: createSearch, referenceAdder: referenceAdder, addStringOrCommentReference: addStringOrCommentReference, + markSearchedSymbol: markSearchedSymbol, markSeenContainingTypeReference: ts.nodeSeenTracker(), markSeenReExportRHS: ts.nodeSeenTracker() }); + function getImportSearches(exportSymbol, exportInfo) { + if (!importTracker) + importTracker = FindAllReferences.createImportTracker(sourceFiles, checker, cancellationToken); + return importTracker(exportSymbol, exportInfo, options.isForRename); + } + function createSearch(location, symbol, comingFrom, searchOptions) { + if (searchOptions === void 0) { searchOptions = {}; } + // Note: if this is an external module symbol, the name doesn't include quotes. + var _a = searchOptions.text, text = _a === void 0 ? ts.stripQuotes(ts.getDeclaredName(checker, symbol, location)) : _a, _b = searchOptions.allSearchSymbols, allSearchSymbols = _b === void 0 ? undefined : _b; + var escapedText = ts.escapeIdentifier(text); + var parents = options.implementations && getParentSymbolsOfPropertyAccess(location, symbol, checker); + return { location: location, symbol: symbol, comingFrom: comingFrom, text: text, escapedText: escapedText, parents: parents, includes: includes }; + function includes(referenceSymbol) { + return allSearchSymbols ? ts.contains(allSearchSymbols, referenceSymbol) : referenceSymbol === symbol; + } + } + function referenceAdder(referenceSymbol, searchLocation) { + var symbolId = ts.getSymbolId(referenceSymbol); + var references = symbolIdToReferences[symbolId]; + if (!references) { + references = symbolIdToReferences[symbolId] = []; + result.push({ definition: { type: "symbol", symbol: referenceSymbol, node: searchLocation }, references: references }); + } + return function (node) { return references.push(FindAllReferences.nodeEntry(node)); }; + } + function addStringOrCommentReference(fileName, textSpan) { + result.push({ + definition: undefined, + references: [{ type: "span", fileName: fileName, textSpan: textSpan }] + }); + } + function markSearchedSymbol(sourceFile, symbol) { + var sourceId = ts.getNodeId(sourceFile); + var symbolId = ts.getSymbolId(symbol); + var seenSymbols = sourceFileToSeenSymbols[sourceId] || (sourceFileToSeenSymbols[sourceId] = []); + return !seenSymbols[symbolId] && (seenSymbols[symbolId] = true); + } + } + /** Search for all imports of a given exported symbol using `State.getImportSearches`. */ + function searchForImportsOfExport(exportLocation, exportSymbol, exportInfo, state) { + var _a = state.getImportSearches(exportSymbol, exportInfo), importSearches = _a.importSearches, singleReferences = _a.singleReferences, indirectUsers = _a.indirectUsers; + // For `import { foo as bar }` just add the reference to `foo`, and don't otherwise search in the file. + if (singleReferences.length) { + var addRef = state.referenceAdder(exportSymbol, exportLocation); + for (var _i = 0, singleReferences_1 = singleReferences; _i < singleReferences_1.length; _i++) { + var singleRef = singleReferences_1[_i]; + addRef(singleRef); + } + } + // For each import, find all references to that import in its source file. + for (var _b = 0, importSearches_1 = importSearches; _b < importSearches_1.length; _b++) { + var _c = importSearches_1[_b], importLocation = _c[0], importSymbol = _c[1]; + getReferencesInSourceFile(importLocation.getSourceFile(), state.createSearch(importLocation, importSymbol, 1 /* Export */), state); + } + if (indirectUsers.length) { + var indirectSearch = void 0; + switch (exportInfo.exportKind) { + case 0 /* Named */: + indirectSearch = state.createSearch(exportLocation, exportSymbol, 1 /* Export */); + break; + case 1 /* Default */: + // Search for a property access to '.default'. This can't be renamed. + indirectSearch = state.isForRename ? undefined : state.createSearch(exportLocation, exportSymbol, 1 /* Export */, { text: "default" }); + break; + case 2 /* ExportEquals */: + break; + } + if (indirectSearch) { + for (var _d = 0, indirectUsers_1 = indirectUsers; _d < indirectUsers_1.length; _d++) { + var indirectUser = indirectUsers_1[_d]; + searchForName(indirectUser, indirectSearch, state); + } } } } - return result; - function getDefinition(symbol) { - var info = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, node.getSourceFile(), ts.getContainerNode(node), node); - var name = ts.map(info.displayParts, function (p) { return p.text; }).join(""); - var declarations = symbol.declarations; - if (!declarations || declarations.length === 0) { - return undefined; + // Go to the symbol we imported from and find references for it. + function searchForImportedSymbol(symbol, state) { + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + getReferencesInSourceFile(declaration.getSourceFile(), state.createSearch(declaration, symbol, 0 /* Import */), state); } - return { - containerKind: "", - containerName: "", - name: name, - kind: info.symbolKind, - fileName: declarations[0].getSourceFile().fileName, - textSpan: ts.createTextSpan(declarations[0].getStart(), 0), - displayParts: info.displayParts - }; } - function getAliasSymbolForPropertyNameSymbol(symbol, location) { - if (symbol.flags & 8388608 /* Alias */) { - // Default import get alias - var defaultImport = ts.getDeclarationOfKind(symbol, 236 /* ImportClause */); - if (defaultImport) { - return typeChecker.getAliasedSymbol(symbol); - } - var importOrExportSpecifier = ts.forEach(symbol.declarations, function (declaration) { return (declaration.kind === 239 /* ImportSpecifier */ || - declaration.kind === 243 /* ExportSpecifier */) ? declaration : undefined; }); - if (importOrExportSpecifier && - // export { a } - (!importOrExportSpecifier.propertyName || - // export {a as class } where a is location - importOrExportSpecifier.propertyName === location)) { - // If Import specifier -> get alias - // else Export specifier -> get local target - return importOrExportSpecifier.kind === 239 /* ImportSpecifier */ ? - typeChecker.getAliasedSymbol(symbol) : - typeChecker.getExportSpecifierLocalTargetSymbol(importOrExportSpecifier); - } + /** Search for all occurences of an identifier in a source file (and filter out the ones that match). */ + function searchForName(sourceFile, search, state) { + if (ts.getNameTable(sourceFile).get(search.escapedText) !== undefined) { + getReferencesInSourceFile(sourceFile, search, state); } - return undefined; } - function followAliasIfNecessary(symbol, location) { - return getAliasSymbolForPropertyNameSymbol(symbol, location) || symbol; - } - function getPropertySymbolOfDestructuringAssignment(location) { + function getPropertySymbolOfDestructuringAssignment(location, checker) { return ts.isArrayLiteralOrObjectLiteralDestructuringPattern(location.parent.parent) && - typeChecker.getPropertySymbolOfDestructuringAssignment(location); + checker.getPropertySymbolOfDestructuringAssignment(location); } function isObjectBindingPatternElementWithoutPropertyName(symbol) { - var bindingElement = ts.getDeclarationOfKind(symbol, 174 /* BindingElement */); + var bindingElement = ts.getDeclarationOfKind(symbol, 175 /* BindingElement */); return bindingElement && - bindingElement.parent.kind === 172 /* ObjectBindingPattern */ && + bindingElement.parent.kind === 173 /* ObjectBindingPattern */ && !bindingElement.propertyName; } - function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol) { + function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker) { if (isObjectBindingPatternElementWithoutPropertyName(symbol)) { - var bindingElement = ts.getDeclarationOfKind(symbol, 174 /* BindingElement */); - var typeOfPattern = typeChecker.getTypeAtLocation(bindingElement.parent); - return typeOfPattern && typeChecker.getPropertyOfType(typeOfPattern, bindingElement.name.text); + var bindingElement = ts.getDeclarationOfKind(symbol, 175 /* BindingElement */); + var typeOfPattern = checker.getTypeAtLocation(bindingElement.parent); + return typeOfPattern && checker.getPropertyOfType(typeOfPattern, bindingElement.name.text); } return undefined; } - function getInternedName(symbol, location) { - // If this is an export or import specifier it could have been renamed using the 'as' syntax. - // If so we want to search for whatever under the cursor. - if (ts.isImportOrExportSpecifierName(location)) { - return location.getText(); - } - // Try to get the local symbol if we're dealing with an 'export default' - // since that symbol has the "true" name. - var localExportDefaultSymbol = ts.getLocalSymbolForExportDefault(symbol); - symbol = localExportDefaultSymbol || symbol; - return ts.stripQuotes(symbol.name); - } /** * Determines the smallest scope in which a symbol may have named references. * Note that not every construct has been accounted for. This function can @@ -69445,55 +75267,57 @@ var ts; function getSymbolScope(symbol) { // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. - var valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 184 /* FunctionExpression */ || valueDeclaration.kind === 197 /* ClassExpression */)) { + var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; + if (valueDeclaration && (valueDeclaration.kind === 185 /* FunctionExpression */ || valueDeclaration.kind === 198 /* ClassExpression */)) { return valueDeclaration; } - // If this is private property or method, the scope is the containing class - if (symbol.flags & (4 /* Property */ | 8192 /* Method */)) { - var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (ts.getModifierFlags(d) & 8 /* Private */) ? d : undefined; }); - if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 226 /* ClassDeclaration */); - } - } - // If the symbol is an import we would like to find it if we are looking for what it imports. - // So consider it visible outside its declaration scope. - if (symbol.flags & 8388608 /* Alias */) { + if (!declarations) { return undefined; } + // If this is private property or method, the scope is the containing class + if (flags & (4 /* Property */ | 8192 /* Method */)) { + var privateDeclaration = ts.find(declarations, function (d) { return !!(ts.getModifierFlags(d) & 8 /* Private */); }); + if (privateDeclaration) { + return ts.getAncestor(privateDeclaration, 228 /* ClassDeclaration */); + } + } // If symbol is of object binding pattern element without property name we would want to // look for property too and that could be anywhere if (isObjectBindingPatternElementWithoutPropertyName(symbol)) { return undefined; } - // if this symbol is visible from its parent container, e.g. exported, then bail out - // if symbol correspond to the union property - bail out - if (symbol.parent || (symbol.flags & 268435456 /* SyntheticProperty */)) { + // If the symbol has a parent, it's globally visible. + // Unless that parent is an external module, then we should only search in the module (and recurse on the export later). + // But if the parent is a module that has `export as namespace`, then the symbol *is* globally visible. + if (parent && !((parent.flags & 1536 /* Module */) && ts.isExternalModuleSymbol(parent) && !parent.globalExports)) { + return undefined; + } + // If this is a synthetic property, it's a property and must be searched for globally. + if ((flags & 134217728 /* Transient */ && symbol.checkFlags & 6 /* Synthetic */)) { return undefined; } var scope; - var declarations = symbol.getDeclarations(); - if (declarations) { - for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { - var declaration = declarations_7[_i]; - var container = ts.getContainerNode(declaration); - if (!container) { - return undefined; - } - if (scope && scope !== container) { - // Different declarations have different containers, bail out - return undefined; - } - if (container.kind === 261 /* SourceFile */ && !ts.isExternalModule(container)) { - // This is a global variable and not an external module, any declaration defined - // within this scope is visible outside the file - return undefined; - } - // The search scope is the container node - scope = container; + for (var _i = 0, declarations_10 = declarations; _i < declarations_10.length; _i++) { + var declaration = declarations_10[_i]; + var container = ts.getContainerNode(declaration); + if (scope && scope !== container) { + // Different declarations have different containers, bail out + return undefined; } + if (!container || container.kind === 264 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { + // This is a global variable and not an external module, any declaration defined + // within this scope is visible outside the file + return undefined; + } + // The search scope is the container node + scope = container; } - return scope; + // If symbol.parent, this means we are in an export of an external module. (Otherwise we would have returned `undefined` above.) + // For an export of a module, we may be in a declaration file, and it may be accessed elsewhere. E.g.: + // declare module "a" { export type T = number; } + // declare module "b" { import { T } from "a"; export const x: T; } + // So we must search the whole source file. (Because we will mark the source file as seen, we we won't return to it when searching for imports.) + return parent ? scope.getSourceFile() : scope; } function getPossibleSymbolReferencePositions(sourceFile, symbolName, start, end) { var positions = []; @@ -69508,7 +75332,6 @@ var ts; var symbolNameLength = symbolName.length; var position = text.indexOf(symbolName, start); while (position >= 0) { - cancellationToken.throwIfCancellationRequested(); // If we are past the end, stop looking if (position > end) break; @@ -69529,279 +75352,320 @@ var ts; var sourceFile = container.getSourceFile(); var labelName = targetLabel.text; var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, labelName, container.getStart(), container.getEnd()); - ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); + for (var _i = 0, possiblePositions_1 = possiblePositions; _i < possiblePositions_1.length; _i++) { + var position = possiblePositions_1[_i]; var node = ts.getTouchingWord(sourceFile, position); if (!node || node.getWidth() !== labelName.length) { - return; + continue; } // Only pick labels that are either the target label, or have a target that is the target label if (node === targetLabel || (ts.isJumpStatementTarget(node) && ts.getTargetLabel(node, labelName) === targetLabel)) { - references.push(getReferenceEntryFromNode(node)); + references.push(FindAllReferences.nodeEntry(node)); } - }); - var definition = { - containerKind: "", - containerName: "", - fileName: targetLabel.getSourceFile().fileName, - kind: ts.ScriptElementKind.label, - name: labelName, - textSpan: ts.createTextSpanFromBounds(targetLabel.getStart(), targetLabel.getEnd()), - displayParts: [ts.displayPart(labelName, ts.SymbolDisplayPartKind.text)] - }; - return [{ definition: definition, references: references }]; + } + return [{ definition: { type: "label", node: targetLabel }, references: references }]; } function isValidReferencePosition(node, searchSymbolName) { - if (node) { - // Compare the length so we filter out strict superstrings of the symbol we are looking for - switch (node.kind) { - case 70 /* Identifier */: - return node.getWidth() === searchSymbolName.length; - case 9 /* StringLiteral */: - if (ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || - isNameOfExternalModuleImportOrDeclaration(node)) { - // For string literals we have two additional chars for the quotes - return node.getWidth() === searchSymbolName.length + 2; - } - break; - case 8 /* NumericLiteral */: - if (ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) { - return node.getWidth() === searchSymbolName.length; - } - break; - } + // Compare the length so we filter out strict superstrings of the symbol we are looking for + switch (node && node.kind) { + case 70 /* Identifier */: + return node.getWidth() === searchSymbolName.length; + case 9 /* StringLiteral */: + return (ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) && + // For string literals we have two additional chars for the quotes + node.getWidth() === searchSymbolName.length + 2; + case 8 /* NumericLiteral */: + return ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && node.getWidth() === searchSymbolName.length; + default: + return false; } - return false; } - /** Search within node "container" for references for a search value, where the search value is defined as a - * tuple of(searchSymbol, searchText, searchLocation, and searchMeaning). - * searchLocation: a node where the search value - */ - function getReferencesInNode(container, searchSymbol, searchText, searchLocation, searchMeaning, findInStrings, findInComments, result, symbolToIndex) { - var sourceFile = container.getSourceFile(); - var start = findInComments ? container.getFullStart() : container.getStart(); - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, searchText, start, container.getEnd()); - var parents = getParentSymbolsOfPropertyAccess(); - var inheritsFromCache = ts.createMap(); - if (possiblePositions.length) { - // Build the set of symbols to search for, initially it has only the current symbol - var searchSymbols_1 = populateSearchSymbolSet(searchSymbol, searchLocation); - ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); - var referenceLocation = ts.getTouchingPropertyName(sourceFile, position); - if (!isValidReferencePosition(referenceLocation, searchText)) { - // This wasn't the start of a token. Check to see if it might be a - // match in a comment or string if that's what the caller is asking - // for. - if (!implementations && ((findInStrings && ts.isInString(sourceFile, position)) || - (findInComments && ts.isInNonReferenceComment(sourceFile, position)))) { - // In the case where we're looking inside comments/strings, we don't have - // an actual definition. So just use 'undefined' here. Features like - // 'Rename' won't care (as they ignore the definitions), and features like - // 'FindReferences' will just filter out these results. - result.push({ - definition: undefined, - references: [{ - fileName: sourceFile.fileName, - textSpan: ts.createTextSpan(position, searchText.length), - isWriteAccess: false, - isDefinition: false - }] - }); - } - return; - } - if (!(ts.getMeaningFromLocation(referenceLocation) & searchMeaning)) { - return; - } - var referenceSymbol = typeChecker.getSymbolAtLocation(referenceLocation); - if (referenceSymbol) { - var referenceSymbolDeclaration = referenceSymbol.valueDeclaration; - var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration); - var relatedSymbol = getRelatedSymbol(searchSymbols_1, referenceSymbol, referenceLocation, - /*searchLocationIsConstructor*/ searchLocation.kind === 122 /* ConstructorKeyword */, parents, inheritsFromCache); - if (relatedSymbol) { - addReferenceToRelatedSymbol(referenceLocation, relatedSymbol); - } - else if (!(referenceSymbol.flags & 67108864 /* Transient */) && searchSymbols_1.indexOf(shorthandValueSymbol) >= 0) { - addReferenceToRelatedSymbol(referenceSymbolDeclaration.name, shorthandValueSymbol); - } - else if (searchLocation.kind === 122 /* ConstructorKeyword */) { - findAdditionalConstructorReferences(referenceSymbol, referenceLocation); - } - } - }); + function getAllReferencesForKeyword(sourceFiles, keywordKind, cancellationToken) { + var references = []; + for (var _i = 0, sourceFiles_5 = sourceFiles; _i < sourceFiles_5.length; _i++) { + var sourceFile = sourceFiles_5[_i]; + cancellationToken.throwIfCancellationRequested(); + addReferencesForKeywordInFile(sourceFile, keywordKind, ts.tokenToString(keywordKind), references); } - return; - /* If we are just looking for implementations and this is a property access expression, we need to get the - * symbol of the local type of the symbol the property is being accessed on. This is because our search - * symbol may have a different parent symbol if the local type's symbol does not declare the property - * being accessed (i.e. it is declared in some parent class or interface) + return references.length ? [{ definition: { type: "keyword", node: references[0].node }, references: references }] : undefined; + } + function addReferencesForKeywordInFile(sourceFile, kind, searchText, references) { + var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, searchText, sourceFile.getStart(), sourceFile.getEnd()); + for (var _i = 0, possiblePositions_2 = possiblePositions; _i < possiblePositions_2.length; _i++) { + var position = possiblePositions_2[_i]; + var referenceLocation = ts.getTouchingPropertyName(sourceFile, position); + if (referenceLocation.kind === kind) { + references.push(FindAllReferences.nodeEntry(referenceLocation)); + } + } + } + function getReferencesInSourceFile(sourceFile, search, state) { + state.cancellationToken.throwIfCancellationRequested(); + return getReferencesInContainer(sourceFile, sourceFile, search, state); + } + /** + * Search within node "container" for references for a search value, where the search value is defined as a + * tuple of(searchSymbol, searchText, searchLocation, and searchMeaning). + * searchLocation: a node where the search value + */ + function getReferencesInContainer(container, sourceFile, search, state) { + if (!state.markSearchedSymbol(sourceFile, search.symbol)) { + return; + } + var start = state.findInComments ? container.getFullStart() : container.getStart(); + var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, search.text, start, container.getEnd()); + for (var _i = 0, possiblePositions_3 = possiblePositions; _i < possiblePositions_3.length; _i++) { + var position = possiblePositions_3[_i]; + getReferencesAtLocation(sourceFile, position, search, state); + } + } + function getReferencesAtLocation(sourceFile, position, search, state) { + var referenceLocation = ts.getTouchingPropertyName(sourceFile, position); + if (!isValidReferencePosition(referenceLocation, search.text)) { + // This wasn't the start of a token. Check to see if it might be a + // match in a comment or string if that's what the caller is asking + // for. + if (!state.implementations && (state.findInStrings && ts.isInString(sourceFile, position) || state.findInComments && ts.isInNonReferenceComment(sourceFile, position))) { + // In the case where we're looking inside comments/strings, we don't have + // an actual definition. So just use 'undefined' here. Features like + // 'Rename' won't care (as they ignore the definitions), and features like + // 'FindReferences' will just filter out these results. + state.addStringOrCommentReference(sourceFile.fileName, ts.createTextSpan(position, search.text.length)); + } + return; + } + if (!(ts.getMeaningFromLocation(referenceLocation) & state.searchMeaning)) { + return; + } + var referenceSymbol = state.checker.getSymbolAtLocation(referenceLocation); + if (!referenceSymbol) { + return; + } + var parent = referenceLocation.parent; + if (ts.isImportSpecifier(parent) && parent.propertyName === referenceLocation) { + // This is added through `singleReferences` in ImportsResult. If we happen to see it again, don't add it again. + return; + } + if (ts.isExportSpecifier(parent)) { + ts.Debug.assert(referenceLocation.kind === 70 /* Identifier */); + getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, parent, search, state); + return; + } + var relatedSymbol = getRelatedSymbol(search, referenceSymbol, referenceLocation, state); + if (!relatedSymbol) { + getReferenceForShorthandProperty(referenceSymbol, search, state); + return; + } + if (state.isForConstructor) { + findConstructorReferences(referenceLocation, sourceFile, search, state); + } + else { + addReference(referenceLocation, relatedSymbol, search.location, state); + } + getImportOrExportReferences(referenceLocation, referenceSymbol, search, state); + } + function getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, search, state) { + var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name; + var exportDeclaration = parent.parent; + var localSymbol = getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, state.checker); + if (!search.includes(localSymbol)) { + return; + } + if (!propertyName) { + addRef(); + } + else if (referenceLocation === propertyName) { + // For `export { foo as bar } from "baz"`, "`foo`" will be added from the singleReferences for import searches of the original export. + // For `export { foo as bar };`, where `foo` is a local, so add it now. + if (!exportDeclaration.moduleSpecifier) { + addRef(); + } + if (!state.isForRename && state.markSeenReExportRHS(name)) { + addReference(name, referenceSymbol, name, state); + } + } + else { + if (state.markSeenReExportRHS(referenceLocation)) { + addRef(); + } + } + // For `export { foo as bar }`, rename `foo`, but not `bar`. + if (!(referenceLocation === propertyName && state.isForRename)) { + var exportKind = referenceLocation.originalKeywordKind === 78 /* DefaultKeyword */ ? 1 /* Default */ : 0 /* Named */; + var exportInfo = FindAllReferences.getExportInfo(referenceSymbol, exportKind, state.checker); + ts.Debug.assert(!!exportInfo); + searchForImportsOfExport(referenceLocation, referenceSymbol, exportInfo, state); + } + // At `export { x } from "foo"`, also search for the imported symbol `"foo".x`. + if (search.comingFrom !== 1 /* Export */ && exportDeclaration.moduleSpecifier && !propertyName) { + searchForImportedSymbol(state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier), state); + } + function addRef() { + addReference(referenceLocation, localSymbol, search.location, state); + } + } + function getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, checker) { + return isExportSpecifierAlias(referenceLocation, exportSpecifier) ? checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) : referenceSymbol; + } + function isExportSpecifierAlias(referenceLocation, exportSpecifier) { + var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name; + ts.Debug.assert(propertyName === referenceLocation || name === referenceLocation); + if (propertyName) { + // Given `export { foo as bar } [from "someModule"]`: It's an alias at `foo`, but at `bar` it's a new symbol. + return propertyName === referenceLocation; + } + else { + // `export { foo } from "foo"` is a re-export. + // `export { foo };` is not a re-export, it creates an alias for the local variable `foo`. + return !parent.parent.moduleSpecifier; + } + } + function getImportOrExportReferences(referenceLocation, referenceSymbol, search, state) { + var importOrExport = FindAllReferences.getImportOrExportSymbol(referenceLocation, referenceSymbol, state.checker, search.comingFrom === 1 /* Export */); + if (!importOrExport) + return; + var symbol = importOrExport.symbol; + if (importOrExport.kind === 0 /* Import */) { + if (!state.isForRename || importOrExport.isNamedImport) { + searchForImportedSymbol(symbol, state); + } + } + else { + // We don't check for `state.isForRename`, even for default exports, because importers that previously matched the export name should be updated to continue matching. + searchForImportsOfExport(referenceLocation, symbol, importOrExport.exportInfo, state); + } + } + function getReferenceForShorthandProperty(_a, search, state) { + var flags = _a.flags, valueDeclaration = _a.valueDeclaration; + var shorthandValueSymbol = state.checker.getShorthandAssignmentValueSymbol(valueDeclaration); + /* + * Because in short-hand property assignment, an identifier which stored as name of the short-hand property assignment + * has two meanings: property name and property value. Therefore when we do findAllReference at the position where + * an identifier is declared, the language service should return the position of the variable declaration as well as + * the position in short-hand property assignment excluding property accessing. However, if we do findAllReference at the + * position of property accessing, the referenceEntry of such position will be handled in the first case. */ - function getParentSymbolsOfPropertyAccess() { - if (implementations) { - var propertyAccessExpression = getPropertyAccessExpressionFromRightHandSide(searchLocation); - if (propertyAccessExpression) { - var localParentType = typeChecker.getTypeAtLocation(propertyAccessExpression.expression); - if (localParentType) { - if (localParentType.symbol && localParentType.symbol.flags & (32 /* Class */ | 64 /* Interface */) && localParentType.symbol !== searchSymbol.parent) { - return [localParentType.symbol]; - } - else if (localParentType.flags & 196608 /* UnionOrIntersection */) { - return getSymbolsForClassAndInterfaceComponents(localParentType); - } - } - } + if (!(flags & 134217728 /* Transient */) && search.includes(shorthandValueSymbol)) { + addReference(valueDeclaration.name, shorthandValueSymbol, search.location, state); + } + } + function addReference(referenceLocation, relatedSymbol, searchLocation, state) { + var addRef = state.referenceAdder(relatedSymbol, searchLocation); + if (state.implementations) { + addImplementationReferences(referenceLocation, addRef, state); + } + else { + addRef(referenceLocation); + } + } + /** Adds references when a constructor is used with `new this()` in its own class and `super()` calls in subclasses. */ + function findConstructorReferences(referenceLocation, sourceFile, search, state) { + if (ts.isNewExpressionTarget(referenceLocation)) { + addReference(referenceLocation, search.symbol, search.location, state); + } + var pusher = state.referenceAdder(search.symbol, search.location); + if (ts.isClassLike(referenceLocation.parent)) { + ts.Debug.assert(referenceLocation.parent.name === referenceLocation); + // This is the class declaration containing the constructor. + findOwnConstructorReferences(search.symbol, sourceFile, pusher); + } + else { + // If this class appears in `extends C`, then the extending class' "super" calls are references. + var classExtending = tryGetClassByExtendingIdentifier(referenceLocation); + if (classExtending && ts.isClassLike(classExtending)) { + findSuperConstructorAccesses(classExtending, pusher); } } - function getPropertyAccessExpressionFromRightHandSide(node) { - return ts.isRightSideOfPropertyAccess(node) && node.parent; + } + function getPropertyAccessExpressionFromRightHandSide(node) { + return ts.isRightSideOfPropertyAccess(node) && node.parent; + } + /** + * `classSymbol` is the class where the constructor was defined. + * Reference the constructor and all calls to `new this()`. + */ + function findOwnConstructorReferences(classSymbol, sourceFile, addNode) { + for (var _i = 0, _a = classSymbol.members.get("__constructor").declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + var ctrKeyword = ts.findChildOfKind(decl, 122 /* ConstructorKeyword */, sourceFile); + ts.Debug.assert(decl.kind === 151 /* Constructor */ && !!ctrKeyword); + addNode(ctrKeyword); } - /** Adds references when a constructor is used with `new this()` in its own class and `super()` calls in subclasses. */ - function findAdditionalConstructorReferences(referenceSymbol, referenceLocation) { - ts.Debug.assert(ts.isClassLike(searchSymbol.valueDeclaration)); - var referenceClass = referenceLocation.parent; - if (referenceSymbol === searchSymbol && ts.isClassLike(referenceClass)) { - ts.Debug.assert(referenceClass.name === referenceLocation); - // This is the class declaration containing the constructor. - addReferences(findOwnConstructorCalls(searchSymbol)); - } - else { - // If this class appears in `extends C`, then the extending class' "super" calls are references. - var classExtending = tryGetClassByExtendingIdentifier(referenceLocation); - if (classExtending && ts.isClassLike(classExtending) && followAliasIfNecessary(referenceSymbol, referenceLocation) === searchSymbol) { - addReferences(superConstructorAccesses(classExtending)); - } - } - } - function addReferences(references) { - if (references.length) { - var referencedSymbol = getReferencedSymbol(searchSymbol); - ts.addRange(referencedSymbol.references, ts.map(references, getReferenceEntryFromNode)); - } - } - /** `classSymbol` is the class where the constructor was defined. - * Reference the constructor and all calls to `new this()`. - */ - function findOwnConstructorCalls(classSymbol) { - var result = []; - for (var _i = 0, _a = classSymbol.members["__constructor"].declarations; _i < _a.length; _i++) { - var decl = _a[_i]; - ts.Debug.assert(decl.kind === 150 /* Constructor */); - var ctrKeyword = decl.getChildAt(0); - ts.Debug.assert(ctrKeyword.kind === 122 /* ConstructorKeyword */); - result.push(ctrKeyword); - } - ts.forEachProperty(classSymbol.exports, function (member) { - var decl = member.valueDeclaration; - if (decl && decl.kind === 149 /* MethodDeclaration */) { - var body = decl.body; - if (body) { - forEachDescendantOfKind(body, 98 /* ThisKeyword */, function (thisKeyword) { - if (ts.isNewExpressionTarget(thisKeyword)) { - result.push(thisKeyword); - } - }); - } - } - }); - return result; - } - /** Find references to `super` in the constructor of an extending class. */ - function superConstructorAccesses(cls) { - var symbol = cls.symbol; - var ctr = symbol.members["__constructor"]; - if (!ctr) { - return []; - } - var result = []; - for (var _i = 0, _a = ctr.declarations; _i < _a.length; _i++) { - var decl = _a[_i]; - ts.Debug.assert(decl.kind === 150 /* Constructor */); + classSymbol.exports.forEach(function (member) { + var decl = member.valueDeclaration; + if (decl && decl.kind === 150 /* MethodDeclaration */) { var body = decl.body; if (body) { - forEachDescendantOfKind(body, 96 /* SuperKeyword */, function (node) { - if (ts.isCallExpressionTarget(node)) { - result.push(node); + forEachDescendantOfKind(body, 98 /* ThisKeyword */, function (thisKeyword) { + if (ts.isNewExpressionTarget(thisKeyword)) { + addNode(thisKeyword); } }); } } - ; - return result; + }); + } + /** Find references to `super` in the constructor of an extending class. */ + function findSuperConstructorAccesses(cls, addNode) { + var symbol = cls.symbol; + var ctr = symbol.members.get("__constructor"); + if (!ctr) { + return; } - function getReferencedSymbol(symbol) { - var symbolId = ts.getSymbolId(symbol); - var index = symbolToIndex[symbolId]; - if (index === undefined) { - index = result.length; - symbolToIndex[symbolId] = index; - result.push({ - definition: getDefinition(symbol), - references: [] + for (var _i = 0, _a = ctr.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + ts.Debug.assert(decl.kind === 151 /* Constructor */); + var body = decl.body; + if (body) { + forEachDescendantOfKind(body, 96 /* SuperKeyword */, function (node) { + if (ts.isCallExpressionTarget(node)) { + addNode(node); + } }); } - return result[index]; - } - function addReferenceToRelatedSymbol(node, relatedSymbol) { - var references = getReferencedSymbol(relatedSymbol).references; - if (implementations) { - getImplementationReferenceEntryForNode(node, references); - } - else { - references.push(getReferenceEntryFromNode(node)); - } } } - function getImplementationReferenceEntryForNode(refNode, result) { + function addImplementationReferences(refNode, addReference, state) { // Check if we found a function/propertyAssignment/method with an implementation or initializer if (ts.isDeclarationName(refNode) && isImplementation(refNode.parent)) { - result.push(getReferenceEntryFromNode(refNode.parent)); + addReference(refNode.parent); + return; } - else if (refNode.kind === 70 /* Identifier */) { - if (refNode.parent.kind === 258 /* ShorthandPropertyAssignment */) { - // Go ahead and dereference the shorthand assignment by going to its definition - getReferenceEntriesForShorthandPropertyAssignment(refNode, typeChecker, result); - } - // Check if the node is within an extends or implements clause - var containingClass = getContainingClassIfInHeritageClause(refNode); - if (containingClass) { - result.push(getReferenceEntryFromNode(containingClass)); - return; - } - // If we got a type reference, try and see if the reference applies to any expressions that can implement an interface - var containingTypeReference = getContainingTypeReference(refNode); - if (containingTypeReference) { - var parent_18 = containingTypeReference.parent; - if (ts.isVariableLike(parent_18) && parent_18.type === containingTypeReference && parent_18.initializer && isImplementationExpression(parent_18.initializer)) { - maybeAdd(getReferenceEntryFromNode(parent_18.initializer)); - } - else if (ts.isFunctionLike(parent_18) && parent_18.type === containingTypeReference && parent_18.body) { - if (parent_18.body.kind === 204 /* Block */) { - ts.forEachReturnStatement(parent_18.body, function (returnStatement) { - if (returnStatement.expression && isImplementationExpression(returnStatement.expression)) { - maybeAdd(getReferenceEntryFromNode(returnStatement.expression)); - } - }); - } - else if (isImplementationExpression(parent_18.body)) { - maybeAdd(getReferenceEntryFromNode(parent_18.body)); - } - } - else if (ts.isAssertionExpression(parent_18) && isImplementationExpression(parent_18.expression)) { - maybeAdd(getReferenceEntryFromNode(parent_18.expression)); - } - } + if (refNode.kind !== 70 /* Identifier */) { + return; } - // Type nodes can contain multiple references to the same type. For example: - // let x: Foo & (Foo & Bar) = ... - // Because we are returning the implementation locations and not the identifier locations, - // duplicate entries would be returned here as each of the type references is part of - // the same implementation. For that reason, check before we add a new entry - function maybeAdd(a) { - if (!ts.forEach(result, function (b) { return a.fileName === b.fileName && a.textSpan.start === b.textSpan.start && a.textSpan.length === b.textSpan.length; })) { - result.push(a); + if (refNode.parent.kind === 261 /* ShorthandPropertyAssignment */) { + // Go ahead and dereference the shorthand assignment by going to its definition + getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); + } + // Check if the node is within an extends or implements clause + var containingClass = getContainingClassIfInHeritageClause(refNode); + if (containingClass) { + addReference(containingClass); + return; + } + // If we got a type reference, try and see if the reference applies to any expressions that can implement an interface + var containingTypeReference = getContainingTypeReference(refNode); + if (containingTypeReference && state.markSeenContainingTypeReference(containingTypeReference)) { + var parent = containingTypeReference.parent; + if (ts.isVariableLike(parent) && parent.type === containingTypeReference && parent.initializer && isImplementationExpression(parent.initializer)) { + addReference(parent.initializer); + } + else if (ts.isFunctionLike(parent) && parent.type === containingTypeReference && parent.body) { + if (parent.body.kind === 206 /* Block */) { + ts.forEachReturnStatement(parent.body, function (returnStatement) { + if (returnStatement.expression && isImplementationExpression(returnStatement.expression)) { + addReference(returnStatement.expression); + } + }); + } + else if (isImplementationExpression(parent.body)) { + addReference(parent.body); + } + } + else if (ts.isAssertionExpression(parent) && isImplementationExpression(parent.expression)) { + addReference(parent.expression); } } } @@ -69830,12 +75694,12 @@ var ts; } function getContainingClassIfInHeritageClause(node) { if (node && node.parent) { - if (node.kind === 199 /* ExpressionWithTypeArguments */ - && node.parent.kind === 255 /* HeritageClause */ + if (node.kind === 200 /* ExpressionWithTypeArguments */ + && node.parent.kind === 258 /* HeritageClause */ && ts.isClassLike(node.parent.parent)) { return node.parent.parent; } - else if (node.kind === 70 /* Identifier */ || node.kind === 177 /* PropertyAccessExpression */) { + else if (node.kind === 70 /* Identifier */ || node.kind === 178 /* PropertyAccessExpression */) { return getContainingClassIfInHeritageClause(node.parent); } } @@ -69845,15 +75709,18 @@ var ts; * Returns true if this is an expression that can be considered an implementation */ function isImplementationExpression(node) { - // Unwrap parentheses - if (node.kind === 183 /* ParenthesizedExpression */) { - return isImplementationExpression(node.expression); + switch (node.kind) { + case 184 /* ParenthesizedExpression */: + return isImplementationExpression(node.expression); + case 186 /* ArrowFunction */: + case 185 /* FunctionExpression */: + case 177 /* ObjectLiteralExpression */: + case 198 /* ClassExpression */: + case 176 /* ArrayLiteralExpression */: + return true; + default: + return false; } - return node.kind === 185 /* ArrowFunction */ || - node.kind === 184 /* FunctionExpression */ || - node.kind === 176 /* ObjectLiteralExpression */ || - node.kind === 197 /* ClassExpression */ || - node.kind === 175 /* ArrayLiteralExpression */; } /** * Determines if the parent symbol occurs somewhere in the child's ancestry. If the parent symbol @@ -69874,7 +75741,7 @@ var ts; * @param parent Another class or interface Symbol * @param cachedResults A map of symbol id pairs (i.e. "child,parent") to booleans indicating previous results */ - function explicitlyInheritsFrom(child, parent, cachedResults) { + function explicitlyInheritsFrom(child, parent, cachedResults, checker) { var parentIsInterface = parent.getFlags() & 64 /* Interface */; return searchHierarchy(child); function searchHierarchy(symbol) { @@ -69882,11 +75749,12 @@ var ts; return true; } var key = ts.getSymbolId(symbol) + "," + ts.getSymbolId(parent); - if (key in cachedResults) { - return cachedResults[key]; + var cached = cachedResults.get(key); + if (cached !== undefined) { + return cached; } // Set the key so that we don't infinitely recurse - cachedResults[key] = false; + cachedResults.set(key, false); var inherits = ts.forEach(symbol.getDeclarations(), function (declaration) { if (ts.isClassLike(declaration)) { if (parentIsInterface) { @@ -69902,19 +75770,19 @@ var ts; } return searchTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); } - else if (declaration.kind === 227 /* InterfaceDeclaration */) { + else if (declaration.kind === 229 /* InterfaceDeclaration */) { if (parentIsInterface) { return ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), searchTypeReference); } } return false; }); - cachedResults[key] = inherits; + cachedResults.set(key, inherits); return inherits; } function searchTypeReference(typeReference) { if (typeReference) { - var type = typeChecker.getTypeAtLocation(typeReference); + var type = checker.getTypeAtLocation(typeReference); if (type && type.symbol) { return searchHierarchy(type.symbol); } @@ -69930,13 +75798,13 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; @@ -69946,49 +75814,48 @@ var ts; var references = []; var sourceFile = searchSpaceNode.getSourceFile(); var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); - ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); + for (var _i = 0, possiblePositions_4 = possiblePositions; _i < possiblePositions_4.length; _i++) { + var position = possiblePositions_4[_i]; var node = ts.getTouchingWord(sourceFile, position); if (!node || node.kind !== 96 /* SuperKeyword */) { - return; + continue; } var container = ts.getSuperContainer(node, /*stopOnFunctions*/ false); // If we have a 'super' container, we must have an enclosing class. // Now make sure the owning class is the same as the search-space // and has the same static qualifier as the original 'super's owner. if (container && (32 /* Static */ & ts.getModifierFlags(container)) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) { - references.push(getReferenceEntryFromNode(node)); + references.push(FindAllReferences.nodeEntry(node)); } - }); - var definition = getDefinition(searchSpaceNode.symbol); - return [{ definition: definition, references: references }]; + } + return [{ definition: { type: "symbol", symbol: searchSpaceNode.symbol, node: superKeyword }, references: references }]; } - function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles) { + function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false); // Whether 'this' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } - // fall through - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + // falls through + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 261 /* SourceFile */: + case 264 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } - // Fall through - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: + // falls through + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. @@ -69997,8 +75864,9 @@ var ts; } var references = []; var possiblePositions; - if (searchSpaceNode.kind === 261 /* SourceFile */) { + if (searchSpaceNode.kind === 264 /* SourceFile */) { ts.forEach(sourceFiles, function (sourceFile) { + cancellationToken.throwIfCancellationRequested(); possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); }); @@ -70008,144 +75876,103 @@ var ts; possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, references); } - var thisOrSuperSymbol = typeChecker.getSymbolAtLocation(thisOrSuperKeyword); - var displayParts = thisOrSuperSymbol && ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, thisOrSuperSymbol, thisOrSuperKeyword.getSourceFile(), ts.getContainerNode(thisOrSuperKeyword), thisOrSuperKeyword).displayParts; return [{ - definition: { - containerKind: "", - containerName: "", - fileName: node.getSourceFile().fileName, - kind: ts.ScriptElementKind.variableElement, - name: "this", - textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()), - displayParts: displayParts - }, + definition: { type: "this", node: thisOrSuperKeyword }, references: references }]; function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result) { ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); var node = ts.getTouchingWord(sourceFile, position); if (!node || !ts.isThis(node)) { return; } var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); switch (searchSpaceNode.kind) { - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 227 /* FunctionDeclaration */: if (searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(node)); + result.push(FindAllReferences.nodeEntry(node)); } break; - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(node)); + result.push(FindAllReferences.nodeEntry(node)); } break; - case 197 /* ClassExpression */: - case 226 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 228 /* ClassDeclaration */: // Make sure the container belongs to the same class // and has the appropriate static modifier from the original container. if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32 /* Static */) === staticFlag) { - result.push(getReferenceEntryFromNode(node)); + result.push(FindAllReferences.nodeEntry(node)); } break; - case 261 /* SourceFile */: - if (container.kind === 261 /* SourceFile */ && !ts.isExternalModule(container)) { - result.push(getReferenceEntryFromNode(node)); + case 264 /* SourceFile */: + if (container.kind === 264 /* SourceFile */ && !ts.isExternalModule(container)) { + result.push(FindAllReferences.nodeEntry(node)); } break; } }); } } - function getReferencesForStringLiteral(node, sourceFiles) { - var type = ts.getStringLiteralTypeForNode(node, typeChecker); - if (!type) { - // nothing to do here. moving on - return undefined; - } + function getReferencesForStringLiteral(node, sourceFiles, cancellationToken) { var references = []; - for (var _i = 0, sourceFiles_9 = sourceFiles; _i < sourceFiles_9.length; _i++) { - var sourceFile = sourceFiles_9[_i]; - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, type.text, sourceFile.getStart(), sourceFile.getEnd()); - getReferencesForStringLiteralInFile(sourceFile, type, possiblePositions, references); + for (var _i = 0, sourceFiles_6 = sourceFiles; _i < sourceFiles_6.length; _i++) { + var sourceFile = sourceFiles_6[_i]; + cancellationToken.throwIfCancellationRequested(); + var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, node.text, sourceFile.getStart(), sourceFile.getEnd()); + getReferencesForStringLiteralInFile(sourceFile, node.text, possiblePositions, references); } return [{ - definition: { - containerKind: "", - containerName: "", - fileName: node.getSourceFile().fileName, - kind: ts.ScriptElementKind.variableElement, - name: type.text, - textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()), - displayParts: [ts.displayPart(ts.getTextOfNode(node), ts.SymbolDisplayPartKind.stringLiteral)] - }, + definition: { type: "string", node: node }, references: references }]; - function getReferencesForStringLiteralInFile(sourceFile, searchType, possiblePositions, references) { - for (var _i = 0, possiblePositions_1 = possiblePositions; _i < possiblePositions_1.length; _i++) { - var position = possiblePositions_1[_i]; - cancellationToken.throwIfCancellationRequested(); - var node_2 = ts.getTouchingWord(sourceFile, position); - if (!node_2 || node_2.kind !== 9 /* StringLiteral */) { - return; - } - var type_2 = ts.getStringLiteralTypeForNode(node_2, typeChecker); - if (type_2 === searchType) { - references.push(getReferenceEntryFromNode(node_2)); + function getReferencesForStringLiteralInFile(sourceFile, searchText, possiblePositions, references) { + for (var _i = 0, possiblePositions_5 = possiblePositions; _i < possiblePositions_5.length; _i++) { + var position = possiblePositions_5[_i]; + var node_7 = ts.getTouchingWord(sourceFile, position); + if (node_7 && node_7.kind === 9 /* StringLiteral */ && node_7.text === searchText) { + references.push(FindAllReferences.nodeEntry(node_7, /*isInString*/ true)); } } } } - function populateSearchSymbolSet(symbol, location) { + // For certain symbol kinds, we need to include other symbols in the search set. + // This is not needed when searching for re-exports. + function populateSearchSymbolSet(symbol, location, checker, implementations) { // The search set contains at least the current symbol var result = [symbol]; - // If the location is name of property symbol from object literal destructuring pattern - // Search the property symbol - // for ( { property: p2 } of elems) { } - var containingObjectLiteralElement = getContainingObjectLiteralElement(location); - if (containingObjectLiteralElement && containingObjectLiteralElement.kind !== 258 /* ShorthandPropertyAssignment */) { - var propertySymbol = getPropertySymbolOfDestructuringAssignment(location); - if (propertySymbol) { - result.push(propertySymbol); - } - } - // If the symbol is an alias, add what it aliases to the list - // import {a} from "mod"; - // export {a} - // If the symbol is an alias to default declaration, add what it aliases to the list - // declare "mod" { export default class B { } } - // import B from "mod"; - //// For export specifiers, the exported name can be referring to a local symbol, e.g.: - //// import {a} from "mod"; - //// export {a as somethingElse} - //// We want the *local* declaration of 'a' as declared in the import, - //// *not* as declared within "mod" (or farther) - var aliasSymbol = getAliasSymbolForPropertyNameSymbol(symbol, location); - if (aliasSymbol) { - result = result.concat(populateSearchSymbolSet(aliasSymbol, location)); - } - // If the location is in a context sensitive location (i.e. in an object literal) try - // to get a contextual type for it, and add the property symbol from the contextual - // type to the search set + var containingObjectLiteralElement = ts.getContainingObjectLiteralElement(location); if (containingObjectLiteralElement) { - ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement), function (contextualSymbol) { - ts.addRange(result, typeChecker.getRootSymbols(contextualSymbol)); + // If the location is name of property symbol from object literal destructuring pattern + // Search the property symbol + // for ( { property: p2 } of elems) { } + if (containingObjectLiteralElement.kind !== 261 /* ShorthandPropertyAssignment */) { + var propertySymbol = getPropertySymbolOfDestructuringAssignment(location, checker); + if (propertySymbol) { + result.push(propertySymbol); + } + } + // If the location is in a context sensitive location (i.e. in an object literal) try + // to get a contextual type for it, and add the property symbol from the contextual + // type to the search set + ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker), function (contextualSymbol) { + ts.addRange(result, checker.getRootSymbols(contextualSymbol)); }); /* Because in short-hand property assignment, location has two meaning : property name and as value of the property - * When we do findAllReference at the position of the short-hand property assignment, we would want to have references to position of - * property name and variable declaration of the identifier. - * Like in below example, when querying for all references for an identifier 'name', of the property assignment, the language service - * should show both 'name' in 'obj' and 'name' in variable declaration - * const name = "Foo"; - * const obj = { name }; - * In order to do that, we will populate the search set with the value symbol of the identifier as a value of the property assignment - * so that when matching with potential reference symbol, both symbols from property declaration and variable declaration - * will be included correctly. - */ - var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(location.parent); + * When we do findAllReference at the position of the short-hand property assignment, we would want to have references to position of + * property name and variable declaration of the identifier. + * Like in below example, when querying for all references for an identifier 'name', of the property assignment, the language service + * should show both 'name' in 'obj' and 'name' in variable declaration + * const name = "Foo"; + * const obj = { name }; + * In order to do that, we will populate the search set with the value symbol of the identifier as a value of the property assignment + * so that when matching with potential reference symbol, both symbols from property declaration and variable declaration + * will be included correctly. + */ + var shorthandValueSymbol = checker.getShorthandAssignmentValueSymbol(location.parent); if (shorthandValueSymbol) { result.push(shorthandValueSymbol); } @@ -70154,27 +75981,28 @@ var ts; // we should include both parameter declaration symbol and property declaration symbol // Parameter Declaration symbol is only visible within function scope, so the symbol is stored in constructor.locals. // Property Declaration symbol is a member of the class, so the symbol is stored in its class Declaration.symbol.members - if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 144 /* Parameter */ && + if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 145 /* Parameter */ && ts.isParameterPropertyDeclaration(symbol.valueDeclaration)) { - result = result.concat(typeChecker.getSymbolsOfParameterPropertyDeclaration(symbol.valueDeclaration, symbol.name)); + ts.addRange(result, checker.getSymbolsOfParameterPropertyDeclaration(symbol.valueDeclaration, symbol.name)); } // If this is symbol of binding element without propertyName declaration in Object binding pattern // Include the property in the search - var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol); + var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker); if (bindingElementPropertySymbol) { result.push(bindingElementPropertySymbol); } // If this is a union property, add all the symbols from all its source symbols in all unioned types. // If the symbol is an instantiation from a another symbol (e.g. widened symbol) , add the root the list - ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) { + for (var _i = 0, _a = checker.getRootSymbols(symbol); _i < _a.length; _i++) { + var rootSymbol = _a[_i]; if (rootSymbol !== symbol) { result.push(rootSymbol); } // Add symbol of properties/methods of the same name in base classes and implemented interfaces definitions if (!implementations && rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, /*previousIterationSymbolsCache*/ ts.createMap()); + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, /*previousIterationSymbolsCache*/ ts.createMap(), checker); } - }); + } return result; } /** @@ -70185,7 +76013,7 @@ var ts; * @param previousIterationSymbolsCache a cache of symbol from previous iterations of calling this function to prevent infinite revisiting of the same symbol. * The value of previousIterationSymbol is undefined when the function is first called. */ - function getPropertySymbolsFromBaseTypes(symbol, propertyName, result, previousIterationSymbolsCache) { + function getPropertySymbolsFromBaseTypes(symbol, propertyName, result, previousIterationSymbolsCache, checker) { if (!symbol) { return; } @@ -70200,7 +76028,7 @@ var ts; // the function will add any found symbol of the property-name, then its sub-routine will call // getPropertySymbolsFromBaseTypes again to walk up any base types to prevent revisiting already // visited symbol, interface "C", the sub-routine will pass the current symbol as previousIterationSymbol. - if (symbol.name in previousIterationSymbolsCache) { + if (previousIterationSymbolsCache.has(symbol.name)) { return; } if (symbol.flags & (32 /* Class */ | 64 /* Interface */)) { @@ -70209,7 +76037,7 @@ var ts; getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 227 /* InterfaceDeclaration */) { + else if (declaration.kind === 229 /* InterfaceDeclaration */) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -70217,37 +76045,30 @@ var ts; return; function getPropertySymbolFromTypeReference(typeReference) { if (typeReference) { - var type = typeChecker.getTypeAtLocation(typeReference); + var type = checker.getTypeAtLocation(typeReference); if (type) { - var propertySymbol = typeChecker.getPropertyOfType(type, propertyName); + var propertySymbol = checker.getPropertyOfType(type, propertyName); if (propertySymbol) { - result.push.apply(result, typeChecker.getRootSymbols(propertySymbol)); + result.push.apply(result, checker.getRootSymbols(propertySymbol)); } // Visit the typeReference as well to see if it directly or indirectly use that property - previousIterationSymbolsCache[symbol.name] = symbol; - getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result, previousIterationSymbolsCache); + previousIterationSymbolsCache.set(symbol.name, symbol); + getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result, previousIterationSymbolsCache, checker); } } } } - function getRelatedSymbol(searchSymbols, referenceSymbol, referenceLocation, searchLocationIsConstructor, parents, cache) { - if (ts.contains(searchSymbols, referenceSymbol)) { - // If we are searching for constructor uses, they must be 'new' expressions. - return (!searchLocationIsConstructor || ts.isNewExpressionTarget(referenceLocation)) && referenceSymbol; - } - // If the reference symbol is an alias, check if what it is aliasing is one of the search - // symbols but by looking up for related symbol of this alias so it can handle multiple level of indirectness. - var aliasSymbol = getAliasSymbolForPropertyNameSymbol(referenceSymbol, referenceLocation); - if (aliasSymbol) { - return getRelatedSymbol(searchSymbols, aliasSymbol, referenceLocation, searchLocationIsConstructor, parents, cache); + function getRelatedSymbol(search, referenceSymbol, referenceLocation, state) { + if (search.includes(referenceSymbol)) { + return referenceSymbol; } // If the reference location is in an object literal, try to get the contextual type for the // object literal, lookup the property symbol in the contextual type, and use this symbol to // compare to our searchSymbol - var containingObjectLiteralElement = getContainingObjectLiteralElement(referenceLocation); + var containingObjectLiteralElement = ts.getContainingObjectLiteralElement(referenceLocation); if (containingObjectLiteralElement) { - var contextualSymbol = ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement), function (contextualSymbol) { - return ts.forEach(typeChecker.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); + var contextualSymbol = ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement, state.checker), function (contextualSymbol) { + return ts.find(state.checker.getRootSymbols(contextualSymbol), search.includes); }); if (contextualSymbol) { return contextualSymbol; @@ -70256,23 +76077,23 @@ var ts; // Get the property symbol from the object literal's type and look if thats the search symbol // In below eg. get 'property' from type of elems iterating type // for ( { property: p2 } of elems) { } - var propertySymbol = getPropertySymbolOfDestructuringAssignment(referenceLocation); - if (propertySymbol && searchSymbols.indexOf(propertySymbol) >= 0) { + var propertySymbol = getPropertySymbolOfDestructuringAssignment(referenceLocation, state.checker); + if (propertySymbol && search.includes(propertySymbol)) { return propertySymbol; } } // If the reference location is the binding element and doesn't have property name // then include the binding element in the related symbols // let { a } : { a }; - var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(referenceSymbol); - if (bindingElementPropertySymbol && searchSymbols.indexOf(bindingElementPropertySymbol) >= 0) { + var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(referenceSymbol, state.checker); + if (bindingElementPropertySymbol && search.includes(bindingElementPropertySymbol)) { return bindingElementPropertySymbol; } // Unwrap symbols to get to the root (e.g. transient symbols as a result of widening) // Or a union property, use its underlying unioned symbols - return ts.forEach(typeChecker.getRootSymbols(referenceSymbol), function (rootSymbol) { + return ts.forEach(state.checker.getRootSymbols(referenceSymbol), function (rootSymbol) { // if it is in the list, then we are done - if (searchSymbols.indexOf(rootSymbol) >= 0) { + if (search.includes(rootSymbol)) { return rootSymbol; } // Finally, try all properties with the same name in any type the containing type extended or implemented, and @@ -70280,20 +76101,18 @@ var ts; // parent symbol if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { // Parents will only be defined if implementations is true - if (parents) { - if (!ts.forEach(parents, function (parent) { return explicitlyInheritsFrom(rootSymbol.parent, parent, cache); })) { - return undefined; - } + if (search.parents && !ts.some(search.parents, function (parent) { return explicitlyInheritsFrom(rootSymbol.parent, parent, state.inheritsFromCache, state.checker); })) { + return undefined; } - var result_4 = []; - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_4, /*previousIterationSymbolsCache*/ ts.createMap()); - return ts.forEach(result_4, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); + var result = []; + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, /*previousIterationSymbolsCache*/ ts.createMap(), state.checker); + return ts.find(result, search.includes); } return undefined; }); } function getNameFromObjectLiteralElement(node) { - if (node.name.kind === 142 /* ComputedPropertyName */) { + if (node.name.kind === 143 /* ComputedPropertyName */) { var nameExpression = node.name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteral(nameExpression)) { @@ -70303,15 +76122,16 @@ var ts; } return node.name.text; } - function getPropertySymbolsFromContextualType(node) { + /** Gets all symbols for one property. Does not get symbols for every property. */ + function getPropertySymbolsFromContextualType(node, checker) { var objectLiteral = node.parent; - var contextualType = typeChecker.getContextualType(objectLiteral); + var contextualType = checker.getContextualType(objectLiteral); var name = getNameFromObjectLiteralElement(node); if (name && contextualType) { var result_5 = []; - var symbol_2 = contextualType.getProperty(name); - if (symbol_2) { - result_5.push(symbol_2); + var symbol = contextualType.getProperty(name); + if (symbol) { + result_5.push(symbol); } if (contextualType.flags & 65536 /* Union */) { ts.forEach(contextualType.types, function (t) { @@ -70325,13 +76145,14 @@ var ts; } return undefined; } - /** Given an initial searchMeaning, extracted from a location, widen the search scope based on the declarations - * of the corresponding symbol. e.g. if we are searching for "Foo" in value position, but "Foo" references a class - * then we need to widen the search to include type positions as well. - * On the contrary, if we are searching for "Bar" in type position and we trace bar to an interface, and an uninstantiated - * module, we want to keep the search limited to only types, as the two declarations (interface and uninstantiated module) - * do not intersect in any of the three spaces. - */ + /** + * Given an initial searchMeaning, extracted from a location, widen the search scope based on the declarations + * of the corresponding symbol. e.g. if we are searching for "Foo" in value position, but "Foo" references a class + * then we need to widen the search to include type positions as well. + * On the contrary, if we are searching for "Bar" in type position and we trace bar to an interface, and an uninstantiated + * module, we want to keep the search limited to only types, as the two declarations (interface and uninstantiated module) + * do not intersect in any of the three spaces. + */ function getIntersectingMeaningFromDeclarations(meaning, declarations) { if (declarations) { var lastIterationMeaning = void 0; @@ -70342,8 +76163,8 @@ var ts; // To achieve that we will keep iterating until the result stabilizes. // Remember the last meaning lastIterationMeaning = meaning; - for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { - var declaration = declarations_8[_i]; + for (var _i = 0, declarations_11 = declarations; _i < declarations_11.length; _i++) { + var declaration = declarations_11[_i]; var declarationMeaning = ts.getMeaningFromDeclaration(declaration); if (declarationMeaning & meaning) { meaning |= declarationMeaning; @@ -70353,143 +76174,93 @@ var ts; } return meaning; } - } - FindAllReferences.getReferencedSymbolsForNode = getReferencedSymbolsForNode; - function convertReferences(referenceSymbols) { - if (!referenceSymbols) { - return undefined; - } - var referenceEntries = []; - for (var _i = 0, referenceSymbols_1 = referenceSymbols; _i < referenceSymbols_1.length; _i++) { - var referenceSymbol = referenceSymbols_1[_i]; - ts.addRange(referenceEntries, referenceSymbol.references); - } - return referenceEntries; - } - FindAllReferences.convertReferences = convertReferences; - function isImplementation(node) { - if (!node) { + function isImplementation(node) { + if (!node) { + return false; + } + else if (ts.isVariableLike(node)) { + if (node.initializer) { + return true; + } + else if (node.kind === 225 /* VariableDeclaration */) { + var parentStatement = getParentStatementOfVariableDeclaration(node); + return parentStatement && ts.hasModifier(parentStatement, 2 /* Ambient */); + } + } + else if (ts.isFunctionLike(node)) { + return !!node.body || ts.hasModifier(node, 2 /* Ambient */); + } + else { + switch (node.kind) { + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 231 /* EnumDeclaration */: + case 232 /* ModuleDeclaration */: + return true; + } + } return false; } - else if (ts.isVariableLike(node)) { - if (node.initializer) { - return true; - } - else if (node.kind === 223 /* VariableDeclaration */) { - var parentStatement = getParentStatementOfVariableDeclaration(node); - return parentStatement && ts.hasModifier(parentStatement, 2 /* Ambient */); + function getParentStatementOfVariableDeclaration(node) { + if (node.parent && node.parent.parent && node.parent.parent.kind === 207 /* VariableStatement */) { + ts.Debug.assert(node.parent.kind === 226 /* VariableDeclarationList */); + return node.parent.parent; } } - else if (ts.isFunctionLike(node)) { - return !!node.body || ts.hasModifier(node, 2 /* Ambient */); - } - else { - switch (node.kind) { - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 229 /* EnumDeclaration */: - case 230 /* ModuleDeclaration */: - return true; - } - } - return false; - } - function getParentStatementOfVariableDeclaration(node) { - if (node.parent && node.parent.parent && node.parent.parent.kind === 205 /* VariableStatement */) { - ts.Debug.assert(node.parent.kind === 224 /* VariableDeclarationList */); - return node.parent.parent; - } - } - function getReferenceEntriesForShorthandPropertyAssignment(node, typeChecker, result) { - var refSymbol = typeChecker.getSymbolAtLocation(node); - var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(refSymbol.valueDeclaration); - if (shorthandSymbol) { - for (var _i = 0, _a = shorthandSymbol.getDeclarations(); _i < _a.length; _i++) { - var declaration = _a[_i]; - if (ts.getMeaningFromDeclaration(declaration) & 1 /* Value */) { - result.push(getReferenceEntryFromNode(declaration)); + function getReferenceEntriesForShorthandPropertyAssignment(node, checker, addReference) { + var refSymbol = checker.getSymbolAtLocation(node); + var shorthandSymbol = checker.getShorthandAssignmentValueSymbol(refSymbol.valueDeclaration); + if (shorthandSymbol) { + for (var _i = 0, _a = shorthandSymbol.getDeclarations(); _i < _a.length; _i++) { + var declaration = _a[_i]; + if (ts.getMeaningFromDeclaration(declaration) & 1 /* Value */) { + addReference(declaration); + } } } } - } - FindAllReferences.getReferenceEntriesForShorthandPropertyAssignment = getReferenceEntriesForShorthandPropertyAssignment; - function getReferenceEntryFromNode(node) { - var start = node.getStart(); - var end = node.getEnd(); - if (node.kind === 9 /* StringLiteral */) { - start += 1; - end -= 1; - } - return { - fileName: node.getSourceFile().fileName, - textSpan: ts.createTextSpanFromBounds(start, end), - isWriteAccess: isWriteAccess(node), - isDefinition: ts.isDeclarationName(node) || ts.isLiteralComputedPropertyDeclarationName(node) - }; - } - FindAllReferences.getReferenceEntryFromNode = getReferenceEntryFromNode; - /** A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment */ - function isWriteAccess(node) { - if (node.kind === 70 /* Identifier */ && ts.isDeclarationName(node)) { - return true; - } - var parent = node.parent; - if (parent) { - if (parent.kind === 191 /* PostfixUnaryExpression */ || parent.kind === 190 /* PrefixUnaryExpression */) { - return true; - } - else if (parent.kind === 192 /* BinaryExpression */ && parent.left === node) { - var operator = parent.operatorToken.kind; - return 57 /* FirstAssignment */ <= operator && operator <= 69 /* LastAssignment */; - } - } - return false; - } - function forEachDescendantOfKind(node, kind, action) { - ts.forEachChild(node, function (child) { - if (child.kind === kind) { - action(child); - } - forEachDescendantOfKind(child, kind, action); - }); - } - /** - * Returns the containing object literal property declaration given a possible name node, e.g. "a" in x = { "a": 1 } - */ - function getContainingObjectLiteralElement(node) { - switch (node.kind) { - case 9 /* StringLiteral */: - case 8 /* NumericLiteral */: - if (node.parent.kind === 142 /* ComputedPropertyName */) { - return isObjectLiteralPropertyDeclaration(node.parent.parent) ? node.parent.parent : undefined; + Core.getReferenceEntriesForShorthandPropertyAssignment = getReferenceEntriesForShorthandPropertyAssignment; + function forEachDescendantOfKind(node, kind, action) { + ts.forEachChild(node, function (child) { + if (child.kind === kind) { + action(child); } - // intential fall through - case 70 /* Identifier */: - return isObjectLiteralPropertyDeclaration(node.parent) && node.parent.name === node ? node.parent : undefined; + forEachDescendantOfKind(child, kind, action); + }); } - return undefined; - } - function isObjectLiteralPropertyDeclaration(node) { - switch (node.kind) { - case 257 /* PropertyAssignment */: - case 258 /* ShorthandPropertyAssignment */: - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - return true; + /** Get `C` given `N` if `N` is in the position `class C extends N` or `class C extends foo.N` where `N` is an identifier. */ + function tryGetClassByExtendingIdentifier(node) { + return ts.tryGetClassExtendingExpressionWithTypeArguments(ts.climbPastPropertyAccess(node).parent); } - return false; - } - /** Get `C` given `N` if `N` is in the position `class C extends N` or `class C extends foo.N` where `N` is an identifier. */ - function tryGetClassByExtendingIdentifier(node) { - return ts.tryGetClassExtendingExpressionWithTypeArguments(ts.climbPastPropertyAccess(node).parent); - } - function isNameOfExternalModuleImportOrDeclaration(node) { - if (node.kind === 9 /* StringLiteral */) { - return ts.isNameOfModuleDeclaration(node) || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node); + function isNameOfExternalModuleImportOrDeclaration(node) { + if (node.kind === 9 /* StringLiteral */) { + return ts.isNameOfModuleDeclaration(node) || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node); + } + return false; } - return false; - } + /** + * If we are just looking for implementations and this is a property access expression, we need to get the + * symbol of the local type of the symbol the property is being accessed on. This is because our search + * symbol may have a different parent symbol if the local type's symbol does not declare the property + * being accessed (i.e. it is declared in some parent class or interface) + */ + function getParentSymbolsOfPropertyAccess(location, symbol, checker) { + var propertyAccessExpression = getPropertyAccessExpressionFromRightHandSide(location); + if (!propertyAccessExpression) { + return undefined; + } + var localParentType = checker.getTypeAtLocation(propertyAccessExpression.expression); + if (!localParentType) { + return undefined; + } + if (localParentType.symbol && localParentType.symbol.flags & (32 /* Class */ | 64 /* Interface */) && localParentType.symbol !== symbol.parent) { + return [localParentType.symbol]; + } + else if (localParentType.flags & 196608 /* UnionOrIntersection */) { + return getSymbolsForClassAndInterfaceComponents(localParentType); + } + } + })(Core = FindAllReferences.Core || (FindAllReferences.Core = {})); })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); /* @internal */ @@ -70510,11 +76281,9 @@ var ts; // Type reference directives var typeReferenceDirective = findReferenceInPosition(sourceFile.typeReferenceDirectives, position); if (typeReferenceDirective) { - var referenceFile = program.getResolvedTypeReferenceDirectives()[typeReferenceDirective.fileName]; - if (referenceFile && referenceFile.resolvedFileName) { - return [getDefinitionInfoForFileReference(typeReferenceDirective.fileName, referenceFile.resolvedFileName)]; - } - return undefined; + var referenceFile = program.getResolvedTypeReferenceDirectives().get(typeReferenceDirective.fileName); + return referenceFile && referenceFile.resolvedFileName && + [getDefinitionInfoForFileReference(typeReferenceDirective.fileName, referenceFile.resolvedFileName)]; } var node = ts.getTouchingPropertyName(sourceFile, position); if (node === sourceFile) { @@ -70524,7 +76293,7 @@ var ts; if (ts.isJumpStatementTarget(node)) { var labelName = node.text; var label = ts.getTargetLabel(node.parent, node.text); - return label ? [createDefinitionInfo(label, ts.ScriptElementKind.label, labelName, /*containerName*/ undefined)] : undefined; + return label ? [createDefinitionInfoFromName(label, ts.ScriptElementKind.label, labelName, /*containerName*/ undefined)] : undefined; } var typeChecker = program.getTypeChecker(); var calledDeclaration = tryGetSignatureDeclaration(typeChecker, node); @@ -70550,7 +76319,7 @@ var ts; // if (node.kind === 70 /* Identifier */ && (node.parent === declaration || - (declaration.kind === 239 /* ImportSpecifier */ && declaration.parent && declaration.parent.kind === 238 /* NamedImports */))) { + (declaration.kind === 241 /* ImportSpecifier */ && declaration.parent && declaration.parent.kind === 240 /* NamedImports */))) { symbol = typeChecker.getAliasedSymbol(symbol); } } @@ -70559,7 +76328,7 @@ var ts; // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. - if (node.parent.kind === 258 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 261 /* ShorthandPropertyAssignment */) { var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); if (!shorthandSymbol) { return []; @@ -70570,6 +76339,37 @@ var ts; var shorthandContainerName_1 = typeChecker.symbolToString(symbol.parent, node); return ts.map(shorthandDeclarations, function (declaration) { return createDefinitionInfo(declaration, shorthandSymbolKind_1, shorthandSymbolName_1, shorthandContainerName_1); }); } + if (ts.isJsxOpeningLikeElement(node.parent)) { + // If there are errors when trying to figure out stateless component function, just return the first declaration + // For example: + // declare function /*firstSource*/MainButton(buttonProps: ButtonProps): JSX.Element; + // declare function /*secondSource*/MainButton(linkProps: LinkProps): JSX.Element; + // declare function /*thirdSource*/MainButton(props: ButtonProps | LinkProps): JSX.Element; + // let opt =
; // Error - We get undefined for resolved signature indicating an error, then just return the first declaration + var _a = getSymbolInfo(typeChecker, symbol, node), symbolName = _a.symbolName, symbolKind = _a.symbolKind, containerName = _a.containerName; + return [createDefinitionInfo(symbol.valueDeclaration, symbolKind, symbolName, containerName)]; + } + // If the current location we want to find its definition is in an object literal, try to get the contextual type for the + // object literal, lookup the property symbol in the contextual type, and use this for goto-definition. + // For example + // interface Props{ + // /*first*/prop1: number + // prop2: boolean + // } + // function Foo(arg: Props) {} + // Foo( { pr/*1*/op1: 10, prop2: true }) + var element = ts.getContainingObjectLiteralElement(node); + if (element) { + if (typeChecker.getContextualType(element.parent)) { + var result = []; + var propertySymbols = ts.getPropertySymbolsFromContextualType(typeChecker, element); + for (var _i = 0, propertySymbols_1 = propertySymbols; _i < propertySymbols_1.length; _i++) { + var propertySymbol = propertySymbols_1[_i]; + result.push.apply(result, getDefinitionFromSymbol(typeChecker, propertySymbol, node)); + } + return result; + } + } return getDefinitionFromSymbol(typeChecker, symbol, node); } GoToDefinition.getDefinitionAtPosition = getDefinitionAtPosition; @@ -70639,31 +76439,47 @@ var ts; return false; } function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { + if (!signatureDeclarations) { + return false; + } var declarations = []; var definition; - ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 150 /* Constructor */) || - (!selectConstructors && (d.kind === 225 /* FunctionDeclaration */ || d.kind === 149 /* MethodDeclaration */ || d.kind === 148 /* MethodSignature */))) { + for (var _i = 0, signatureDeclarations_1 = signatureDeclarations; _i < signatureDeclarations_1.length; _i++) { + var d = signatureDeclarations_1[_i]; + if (selectConstructors ? d.kind === 151 /* Constructor */ : isSignatureDeclaration(d)) { declarations.push(d); if (d.body) definition = d; } - }); - if (definition) { - result.push(createDefinitionInfo(definition, symbolKind, symbolName, containerName)); - return true; } - else if (declarations.length) { - result.push(createDefinitionInfo(ts.lastOrUndefined(declarations), symbolKind, symbolName, containerName)); + if (declarations.length) { + result.push(createDefinitionInfo(definition || ts.lastOrUndefined(declarations), symbolKind, symbolName, containerName)); return true; } return false; } } + function isSignatureDeclaration(node) { + switch (node.kind) { + case 151 /* Constructor */: + case 227 /* FunctionDeclaration */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + return true; + default: + return false; + } + } + /** Creates a DefinitionInfo from a Declaration, using the declaration's name if possible. */ function createDefinitionInfo(node, symbolKind, symbolName, containerName) { + return createDefinitionInfoFromName(node.name || node, symbolKind, symbolName, containerName); + } + /** Creates a DefinitionInfo directly from the name of a declaration. */ + function createDefinitionInfoFromName(name, symbolKind, symbolName, containerName) { + var sourceFile = name.getSourceFile(); return { - fileName: node.getSourceFile().fileName, - textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()), + fileName: sourceFile.fileName, + textSpan: ts.createTextSpanFromNode(name, sourceFile), kind: symbolKind, name: symbolName, containerKind: undefined, @@ -70711,46 +76527,20 @@ var ts; } function tryGetSignatureDeclaration(typeChecker, node) { var callLike = getAncestorCallLikeExpression(node); - return callLike && typeChecker.getResolvedSignature(callLike).declaration; + var signature = callLike && typeChecker.getResolvedSignature(callLike); + if (signature) { + var decl = signature.declaration; + if (decl && isSignatureDeclaration(decl)) { + return decl; + } + } + // Don't go to a function type, go to the value having that type. + return undefined; } })(GoToDefinition = ts.GoToDefinition || (ts.GoToDefinition = {})); })(ts || (ts = {})); /* @internal */ var ts; -(function (ts) { - var GoToImplementation; - (function (GoToImplementation) { - function getImplementationAtPosition(typeChecker, cancellationToken, sourceFiles, node) { - // If invoked directly on a shorthand property assignment, then return - // the declaration of the symbol being assigned (not the symbol being assigned to). - if (node.parent.kind === 258 /* ShorthandPropertyAssignment */) { - var result = []; - ts.FindAllReferences.getReferenceEntriesForShorthandPropertyAssignment(node, typeChecker, result); - return result.length > 0 ? result : undefined; - } - else if (node.kind === 96 /* SuperKeyword */ || ts.isSuperProperty(node.parent)) { - // References to and accesses on the super keyword only have one possible implementation, so no - // need to "Find all References" - var symbol = typeChecker.getSymbolAtLocation(node); - return symbol.valueDeclaration && [ts.FindAllReferences.getReferenceEntryFromNode(symbol.valueDeclaration)]; - } - else { - // Perform "Find all References" and retrieve only those that are implementations - var referencedSymbols = ts.FindAllReferences.getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFiles, /*findInStrings*/ false, /*findInComments*/ false, /*implementations*/ true); - var result = ts.flatMap(referencedSymbols, function (symbol) { - return ts.map(symbol.references, function (_a) { - var textSpan = _a.textSpan, fileName = _a.fileName; - return ({ textSpan: textSpan, fileName: fileName }); - }); - }); - return result && result.length > 0 ? result : undefined; - } - } - GoToImplementation.getImplementationAtPosition = getImplementationAtPosition; - })(GoToImplementation = ts.GoToImplementation || (ts.GoToImplementation = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; (function (ts) { var JsDoc; (function (JsDoc) { @@ -70777,6 +76567,7 @@ var ts; "lends", "link", "memberOf", + "method", "name", "namespace", "param", @@ -70795,7 +76586,8 @@ var ts; "prop", "version" ]; - var jsDocCompletionEntries; + var jsDocTagNameCompletionEntries; + var jsDocTagCompletionEntries; function getJsDocCommentsFromDeclarations(declarations) { // Only collect doc comments from duplicate declarations once: // In case of a union property there might be same declaration multiple times @@ -70822,6 +76614,30 @@ var ts; return documentationComment; } JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; + function getJsDocTagsFromDeclarations(declarations) { + // Only collect doc comments from duplicate declarations once. + var tags = []; + forEachUnique(declarations, function (declaration) { + var jsDocs = ts.getJSDocs(declaration); + if (!jsDocs) { + return; + } + for (var _i = 0, jsDocs_1 = jsDocs; _i < jsDocs_1.length; _i++) { + var doc = jsDocs_1[_i]; + var tagsForDoc = doc.tags; + if (tagsForDoc) { + tags.push.apply(tags, tagsForDoc.filter(function (tag) { return tag.kind === 283 /* JSDocTag */; }).map(function (jsDocTag) { + return { + name: jsDocTag.tagName.text, + text: jsDocTag.comment + }; + })); + } + } + }); + return tags; + } + JsDoc.getJsDocTagsFromDeclarations = getJsDocTagsFromDeclarations; /** * Iterates through 'array' by index and performs the callback on each element of array until the callback * returns a truthy value, then returns that value. @@ -70829,7 +76645,7 @@ var ts; */ function forEachUnique(array, callback) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { if (ts.indexOf(array, array[i]) === i) { var result = callback(array[i], i); if (result) { @@ -70840,8 +76656,8 @@ var ts; } return undefined; } - function getAllJsDocCompletionEntries() { - return jsDocCompletionEntries || (jsDocCompletionEntries = ts.map(jsDocTagNames, function (tagName) { + function getJSDocTagNameCompletions() { + return jsDocTagNameCompletionEntries || (jsDocTagNameCompletionEntries = ts.map(jsDocTagNames, function (tagName) { return { name: tagName, kind: ts.ScriptElementKind.keyword, @@ -70850,7 +76666,18 @@ var ts; }; })); } - JsDoc.getAllJsDocCompletionEntries = getAllJsDocCompletionEntries; + JsDoc.getJSDocTagNameCompletions = getJSDocTagNameCompletions; + function getJSDocTagCompletions() { + return jsDocTagCompletionEntries || (jsDocTagCompletionEntries = ts.map(jsDocTagNames, function (tagName) { + return { + name: "@" + tagName, + kind: ts.ScriptElementKind.keyword, + kindModifiers: "", + sortText: "0" + }; + })); + } + JsDoc.getJSDocTagCompletions = getJSDocTagCompletions; /** * Checks if position points to a valid position to add JSDoc comments, and if so, * returns the appropriate template. Otherwise returns an empty string. @@ -70889,19 +76716,19 @@ var ts; var commentOwner; findOwner: for (commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) { switch (commentOwner.kind) { - case 225 /* FunctionDeclaration */: - case 149 /* MethodDeclaration */: - case 150 /* Constructor */: - case 226 /* ClassDeclaration */: - case 205 /* VariableStatement */: + case 227 /* FunctionDeclaration */: + case 150 /* MethodDeclaration */: + case 151 /* Constructor */: + case 228 /* ClassDeclaration */: + case 207 /* VariableStatement */: break findOwner; - case 261 /* SourceFile */: + case 264 /* SourceFile */: return undefined; - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: // If in walking up the tree, we hit a a nested namespace declaration, // then we must be somewhere within a dotted namespace name; however we don't // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. - if (commentOwner.parent.kind === 230 /* ModuleDeclaration */) { + if (commentOwner.parent.kind === 232 /* ModuleDeclaration */) { return undefined; } break findOwner; @@ -70913,14 +76740,21 @@ var ts; var parameters = getParametersForJsDocOwningNode(commentOwner); var posLineAndChar = sourceFile.getLineAndCharacterOfPosition(position); var lineStart = sourceFile.getLineStarts()[posLineAndChar.line]; - var indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character); + // replace non-whitespace characters in prefix with spaces. + var indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character).replace(/\S/i, function () { return " "; }); + var isJavaScriptFile = ts.hasJavaScriptFileExtension(sourceFile.fileName); var docParams = ""; - for (var i = 0, numParams = parameters.length; i < numParams; i++) { + for (var i = 0; i < parameters.length; i++) { var currentName = parameters[i].name; var paramName = currentName.kind === 70 /* Identifier */ ? currentName.text : "param" + i; - docParams += indentationStr + " * @param " + paramName + newLine; + if (isJavaScriptFile) { + docParams += indentationStr + " * @param {any} " + paramName + newLine; + } + else { + docParams += indentationStr + " * @param " + paramName + newLine; + } } // A doc comment consists of the following // * The opening comment line @@ -70942,7 +76776,7 @@ var ts; if (ts.isFunctionLike(commentOwner)) { return commentOwner.parameters; } - if (commentOwner.kind === 205 /* VariableStatement */) { + if (commentOwner.kind === 207 /* VariableStatement */) { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; if (varDeclarations.length === 1 && varDeclarations[0].initializer) { @@ -70960,17 +76794,17 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 183 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 184 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: return rightHandSide.parameters; - case 197 /* ClassExpression */: + case 198 /* ClassExpression */: for (var _i = 0, _a = rightHandSide.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 150 /* Constructor */) { + if (member.kind === 151 /* Constructor */) { return member.parameters; } } @@ -70990,8 +76824,6 @@ var ts; (function (ts) { var JsTyping; (function (JsTyping) { - ; - ; // A map of loose file names to library names // that we are confident require typings var safeList; @@ -71028,7 +76860,7 @@ var ts; }); if (!safeList) { var result = ts.readConfigFile(safeListPath, function (path) { return host.readFile(path); }); - safeList = result.config ? ts.createMap(result.config) : EmptySafeList; + safeList = result.config ? ts.createMapFromTemplate(result.config) : EmptySafeList; } var filesToWatch = []; // Directories to search for package.json, bower.json and other typing information @@ -71047,41 +76879,43 @@ var ts; getTypingNamesFromJson(packageJsonPath, filesToWatch); var bowerJsonPath = ts.combinePaths(searchDir, "bower.json"); getTypingNamesFromJson(bowerJsonPath, filesToWatch); + var bowerComponentsPath = ts.combinePaths(searchDir, "bower_components"); + getTypingNamesFromPackagesFolder(bowerComponentsPath); var nodeModulesPath = ts.combinePaths(searchDir, "node_modules"); - getTypingNamesFromNodeModuleFolder(nodeModulesPath); + getTypingNamesFromPackagesFolder(nodeModulesPath); } getTypingNamesFromSourceFileNames(fileNames); // add typings for unresolved imports if (unresolvedImports) { for (var _a = 0, unresolvedImports_1 = unresolvedImports; _a < unresolvedImports_1.length; _a++) { var moduleId = unresolvedImports_1[_a]; - var typingName = moduleId in nodeCoreModules ? "node" : moduleId; - if (!(typingName in inferredTypings)) { - inferredTypings[typingName] = undefined; + var typingName = nodeCoreModules.has(moduleId) ? "node" : moduleId; + if (!inferredTypings.has(typingName)) { + inferredTypings.set(typingName, undefined); } } } // Add the cached typing locations for inferred typings that are already installed - for (var name_45 in packageNameToTypingLocation) { - if (name_45 in inferredTypings && !inferredTypings[name_45]) { - inferredTypings[name_45] = packageNameToTypingLocation[name_45]; + packageNameToTypingLocation.forEach(function (typingLocation, name) { + if (inferredTypings.has(name) && inferredTypings.get(name) === undefined) { + inferredTypings.set(name, typingLocation); } - } + }); // Remove typings that the user has added to the exclude list for (var _b = 0, exclude_1 = exclude; _b < exclude_1.length; _b++) { var excludeTypingName = exclude_1[_b]; - delete inferredTypings[excludeTypingName]; + inferredTypings.delete(excludeTypingName); } var newTypingNames = []; var cachedTypingPaths = []; - for (var typing in inferredTypings) { - if (inferredTypings[typing] !== undefined) { - cachedTypingPaths.push(inferredTypings[typing]); + inferredTypings.forEach(function (inferred, typing) { + if (inferred !== undefined) { + cachedTypingPaths.push(inferred); } else { newTypingNames.push(typing); } - } + }); return { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch }; /** * Merge a given list of typingNames to the inferredTypings map @@ -71092,8 +76926,8 @@ var ts; } for (var _i = 0, typingNames_1 = typingNames; _i < typingNames_1.length; _i++) { var typing = typingNames_1[_i]; - if (!(typing in inferredTypings)) { - inferredTypings[typing] = undefined; + if (!inferredTypings.has(typing)) { + inferredTypings.set(typing, undefined); } } } @@ -71132,7 +76966,7 @@ var ts; var inferredTypingNames = ts.map(jsFileNames, function (f) { return ts.removeFileExtension(ts.getBaseFileName(f.toLowerCase())); }); var cleanedTypingNames = ts.map(inferredTypingNames, function (f) { return f.replace(/((?:\.|-)min(?=\.|$))|((?:-|\.)\d+)/g, ""); }); if (safeList !== EmptySafeList) { - mergeTypings(ts.filter(cleanedTypingNames, function (f) { return f in safeList; })); + mergeTypings(ts.filter(cleanedTypingNames, function (f) { return safeList.has(f); })); } var hasJsxFile = ts.forEach(fileNames, function (f) { return ts.ensureScriptKind(f, ts.getScriptKindFromFileName(f)) === 2 /* JSX */; }); if (hasJsxFile) { @@ -71140,20 +76974,22 @@ var ts; } } /** - * Infer typing names from node_module folder - * @param nodeModulesPath is the path to the "node_modules" folder + * Infer typing names from packages folder (ex: node_module, bower_components) + * @param packagesFolderPath is the path to the packages folder */ - function getTypingNamesFromNodeModuleFolder(nodeModulesPath) { + function getTypingNamesFromPackagesFolder(packagesFolderPath) { + filesToWatch.push(packagesFolderPath); // Todo: add support for ModuleResolutionHost too - if (!host.directoryExists(nodeModulesPath)) { + if (!host.directoryExists(packagesFolderPath)) { return; } var typingNames = []; - var fileNames = host.readDirectory(nodeModulesPath, [".json"], /*excludes*/ undefined, /*includes*/ undefined, /*depth*/ 2); + var fileNames = host.readDirectory(packagesFolderPath, [".json"], /*excludes*/ undefined, /*includes*/ undefined, /*depth*/ 2); for (var _i = 0, fileNames_2 = fileNames; _i < fileNames_2.length; _i++) { var fileName = fileNames_2[_i]; var normalizedFileName = ts.normalizePath(fileName); - if (ts.getBaseFileName(normalizedFileName) !== "package.json") { + var baseFileName = ts.getBaseFileName(normalizedFileName); + if (baseFileName !== "package.json" && baseFileName !== "bower.json") { continue; } var result = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); }); @@ -71164,7 +77000,7 @@ var ts; // npm 3's package.json contains a "_requiredBy" field // we should include all the top level module names for npm 2, and only module names whose // "_requiredBy" field starts with "#" or equals "/" for npm 3. - if (packageJson._requiredBy && + if (baseFileName === "package.json" && packageJson._requiredBy && ts.filter(packageJson._requiredBy, function (r) { return r[0] === "#" || r === "/"; }).length === 0) { continue; } @@ -71175,7 +77011,7 @@ var ts; } if (packageJson.typings) { var absolutePath = ts.getNormalizedAbsolutePath(packageJson.typings, ts.getDirectoryPath(normalizedFileName)); - inferredTypings[packageJson.name] = absolutePath; + inferredTypings.set(packageJson.name, absolutePath); } else { typingNames.push(packageJson.name); @@ -71195,47 +77031,49 @@ var ts; function getNavigateToItems(sourceFiles, checker, cancellationToken, searchValue, maxResultCount, excludeDtsFiles) { var patternMatcher = ts.createPatternMatcher(searchValue); var rawItems = []; - // Search the declarations in all files and output matched NavigateToItem into array of NavigateToItem[] - ts.forEach(sourceFiles, function (sourceFile) { + var _loop_4 = function (sourceFile) { cancellationToken.throwIfCancellationRequested(); if (excludeDtsFiles && ts.fileExtensionIs(sourceFile.fileName, ".d.ts")) { - return; + return "continue"; } - var nameToDeclarations = sourceFile.getNamedDeclarations(); - for (var name_46 in nameToDeclarations) { - var declarations = nameToDeclarations[name_46]; + ts.forEachEntry(sourceFile.getNamedDeclarations(), function (declarations, name) { if (declarations) { // First do a quick check to see if the name of the declaration matches the // last portion of the (possibly) dotted name they're searching for. - var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_46); + var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name); if (!matches) { - continue; + return; // continue to next named declarations } - for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) { - var declaration = declarations_9[_i]; + for (var _i = 0, declarations_12 = declarations; _i < declarations_12.length; _i++) { + var declaration = declarations_12[_i]; // It was a match! If the pattern has dots in it, then also see if the // declaration container matches as well. if (patternMatcher.patternContainsDots) { var containers = getContainers(declaration); if (!containers) { - return undefined; + return true; // Break out of named declarations and go to the next source file. } - matches = patternMatcher.getMatches(containers, name_46); + matches = patternMatcher.getMatches(containers, name); if (!matches) { - continue; + return; // continue to next named declarations } } var fileName = sourceFile.fileName; var matchKind = bestMatchKind(matches); - rawItems.push({ name: name_46, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); + rawItems.push({ name: name, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); } } - } - }); + }); + }; + // Search the declarations in all files and output matched NavigateToItem into array of NavigateToItem[] + for (var _i = 0, sourceFiles_7 = sourceFiles; _i < sourceFiles_7.length; _i++) { + var sourceFile = sourceFiles_7[_i]; + _loop_4(sourceFile); + } // Remove imports when the imported declaration is already in the list and has the same name. rawItems = ts.filter(rawItems, function (item) { var decl = item.declaration; - if (decl.kind === 236 /* ImportClause */ || decl.kind === 239 /* ImportSpecifier */ || decl.kind === 234 /* ImportEqualsDeclaration */) { + if (decl.kind === 238 /* ImportClause */ || decl.kind === 241 /* ImportSpecifier */ || decl.kind === 236 /* ImportEqualsDeclaration */) { var importer = checker.getSymbolAtLocation(decl.name); var imported = checker.getAliasedSymbol(importer); return importer.name !== imported.name; @@ -71277,7 +77115,7 @@ var ts; if (text !== undefined) { containers.unshift(text); } - else if (declaration.name.kind === 142 /* ComputedPropertyName */) { + else if (declaration.name.kind === 143 /* ComputedPropertyName */) { return tryAddComputedPropertyName(declaration.name.expression, containers, /*includeLastPortion*/ true); } else { @@ -71298,7 +77136,7 @@ var ts; } return true; } - if (expression.kind === 177 /* PropertyAccessExpression */) { + if (expression.kind === 178 /* PropertyAccessExpression */) { var propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); @@ -71311,7 +77149,7 @@ var ts; var containers = []; // First, if we started with a computed property name, then add all but the last // portion into the container array. - if (declaration.name.kind === 142 /* ComputedPropertyName */) { + if (declaration.name.kind === 143 /* ComputedPropertyName */) { if (!tryAddComputedPropertyName(declaration.name.expression, containers, /*includeLastPortion*/ false)) { return undefined; } @@ -71357,7 +77195,7 @@ var ts; matchKind: ts.PatternMatchKind[rawItem.matchKind], isCaseSensitive: rawItem.isCaseSensitive, fileName: rawItem.fileName, - textSpan: ts.createTextSpanFromBounds(declaration.getStart(), declaration.getEnd()), + textSpan: ts.createTextSpanFromNode(declaration), // TODO(jfreeman): What should be the containerName when the container has a computed name? containerName: container && container.name ? container.name.text : "", containerKind: container && container.name ? ts.getNodeKind(container) : "" @@ -71373,22 +77211,61 @@ var ts; (function (ts) { var NavigationBar; (function (NavigationBar) { - function getNavigationBarItems(sourceFile) { + /** + * Matches all whitespace characters in a string. Eg: + * + * "app. + * + * onactivated" + * + * matches because of the newline, whereas + * + * "app.onactivated" + * + * does not match. + */ + var whiteSpaceRegex = /\s+/g; + // Keep sourceFile handy so we don't have to search for it every time we need to call `getText`. + var curCancellationToken; + var curSourceFile; + /** + * For performance, we keep navigation bar parents on a stack rather than passing them through each recursion. + * `parent` is the current parent and is *not* stored in parentsStack. + * `startNode` sets a new parent and `endNode` returns to the previous parent. + */ + var parentsStack = []; + var parent; + // NavigationBarItem requires an array, but will not mutate it, so just give it this for performance. + var emptyChildItemArray = []; + function getNavigationBarItems(sourceFile, cancellationToken) { + curCancellationToken = cancellationToken; curSourceFile = sourceFile; - var result = ts.map(topLevelItems(rootNavigationBarNode(sourceFile)), convertToTopLevelItem); - curSourceFile = undefined; - return result; + try { + return ts.map(topLevelItems(rootNavigationBarNode(sourceFile)), convertToTopLevelItem); + } + finally { + reset(); + } } NavigationBar.getNavigationBarItems = getNavigationBarItems; - function getNavigationTree(sourceFile) { + function getNavigationTree(sourceFile, cancellationToken) { + curCancellationToken = cancellationToken; curSourceFile = sourceFile; - var result = convertToTree(rootNavigationBarNode(sourceFile)); - curSourceFile = undefined; - return result; + try { + return convertToTree(rootNavigationBarNode(sourceFile)); + } + finally { + reset(); + } } NavigationBar.getNavigationTree = getNavigationTree; - // Keep sourceFile handy so we don't have to search for it every time we need to call `getText`. - var curSourceFile; + function reset() { + curSourceFile = undefined; + curCancellationToken = undefined; + parentsStack = []; + parent = undefined; + emptyChildItemArray = []; + } function nodeText(node) { return node.getText(curSourceFile); } @@ -71403,13 +77280,6 @@ var ts; parent.children = [child]; } } - /* - For performance, we keep navigation bar parents on a stack rather than passing them through each recursion. - `parent` is the current parent and is *not* stored in parentsStack. - `startNode` sets a new parent and `endNode` returns to the previous parent. - */ - var parentsStack = []; - var parent; function rootNavigationBarNode(sourceFile) { ts.Debug.assert(!parentsStack.length); var root = { node: sourceFile, additionalNodes: undefined, parent: undefined, children: undefined, indent: 0 }; @@ -71460,11 +77330,12 @@ var ts; } /** Look for navigation bar items in node's subtree, adding them to the current `parent`. */ function addChildrenRecursively(node) { + curCancellationToken.throwIfCancellationRequested(); if (!node || ts.isToken(node)) { return; } switch (node.kind) { - case 150 /* Constructor */: + case 151 /* Constructor */: // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it. var ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); @@ -71476,21 +77347,21 @@ var ts; } } break; - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 148 /* MethodSignature */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 149 /* MethodSignature */: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 236 /* ImportClause */: + case 238 /* ImportClause */: var importClause = node; // Handle default import case e.g.: // import d from "mod"; @@ -71502,7 +77373,7 @@ var ts; // import {a, b as B} from "mod"; var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 237 /* NamespaceImport */) { + if (namedBindings.kind === 239 /* NamespaceImport */) { addLeafNode(namedBindings); } else { @@ -71513,12 +77384,12 @@ var ts; } } break; - case 174 /* BindingElement */: - case 223 /* VariableDeclaration */: + case 175 /* BindingElement */: + case 225 /* VariableDeclaration */: var decl = node; - var name_47 = decl.name; - if (ts.isBindingPattern(name_47)) { - addChildrenRecursively(name_47); + var name = decl.name; + if (ts.isBindingPattern(name)) { + addChildrenRecursively(name); } else if (decl.initializer && isFunctionOrClassExpression(decl.initializer)) { // For `const x = function() {}`, just use the function node, not the const. @@ -71528,12 +77399,12 @@ var ts; addNodeWithRecursiveChild(decl, decl.initializer); } break; - case 185 /* ArrowFunction */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: startNode(node); for (var _d = 0, _e = node.members; _d < _e.length; _d++) { var member = _e[_d]; @@ -71543,9 +77414,9 @@ var ts; } endNode(); break; - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 229 /* InterfaceDeclaration */: startNode(node); for (var _f = 0, _g = node.members; _f < _g.length; _f++) { var member = _g[_f]; @@ -71553,21 +77424,21 @@ var ts; } endNode(); break; - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 243 /* ExportSpecifier */: - case 234 /* ImportEqualsDeclaration */: - case 155 /* IndexSignature */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 228 /* TypeAliasDeclaration */: + case 245 /* ExportSpecifier */: + case 236 /* ImportEqualsDeclaration */: + case 156 /* IndexSignature */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 230 /* TypeAliasDeclaration */: addLeafNode(node); break; default: ts.forEach(node.jsDoc, function (jsDoc) { ts.forEach(jsDoc.tags, function (tag) { - if (tag.kind === 285 /* JSDocTypedefTag */) { + if (tag.kind === 289 /* JSDocTypedefTag */) { addLeafNode(tag); } }); @@ -71585,9 +77456,9 @@ var ts; // Anonymous items are never merged. return true; } - var itemsWithSameName = nameToItems[name]; + var itemsWithSameName = nameToItems.get(name); if (!itemsWithSameName) { - nameToItems[name] = child; + nameToItems.set(name, child); return true; } if (itemsWithSameName instanceof Array) { @@ -71605,7 +77476,7 @@ var ts; if (tryMerge(itemWithSameName, child)) { return false; } - nameToItems[name] = [itemWithSameName, child]; + nameToItems.set(name, [itemWithSameName, child]); return true; } function tryMerge(a, b) { @@ -71618,14 +77489,14 @@ var ts; }); /** a and b have the same name, but they may not be mergeable. */ function shouldReallyMerge(a, b) { - return a.kind === b.kind && (a.kind !== 230 /* ModuleDeclaration */ || areSameModule(a, b)); + return a.kind === b.kind && (a.kind !== 232 /* ModuleDeclaration */ || areSameModule(a, b)); // We use 1 NavNode to represent 'A.B.C', but there are multiple source nodes. // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'! function areSameModule(a, b) { if (a.body.kind !== b.body.kind) { return false; } - if (a.body.kind !== 230 /* ModuleDeclaration */) { + if (a.body.kind !== 232 /* ModuleDeclaration */) { return true; } return areSameModule(a.body, b.body); @@ -71653,39 +77524,20 @@ var ts; function compareChildren(child1, child2) { var name1 = tryGetName(child1.node), name2 = tryGetName(child2.node); if (name1 && name2) { - var cmp = localeCompareFix(name1, name2); + var cmp = ts.compareStringsCaseInsensitive(name1, name2); return cmp !== 0 ? cmp : navigationBarNodeKind(child1) - navigationBarNodeKind(child2); } else { return name1 ? 1 : name2 ? -1 : navigationBarNodeKind(child1) - navigationBarNodeKind(child2); } } - // Intl is missing in Safari, and node 0.10 treats "a" as greater than "B". - var localeCompareIsCorrect = ts.collator && ts.collator.compare("a", "B") < 0; - var localeCompareFix = localeCompareIsCorrect ? ts.collator.compare : function (a, b) { - // This isn't perfect, but it passes all of our tests. - for (var i = 0; i < Math.min(a.length, b.length); i++) { - var chA = a.charAt(i), chB = b.charAt(i); - if (chA === "\"" && chB === "'") { - return 1; - } - if (chA === "'" && chB === "\"") { - return -1; - } - var cmp = ts.compareStrings(chA.toLocaleLowerCase(), chB.toLocaleLowerCase()); - if (cmp !== 0) { - return cmp; - } - } - return a.length - b.length; - }; /** * This differs from getItemName because this is just used for sorting. * We only sort nodes by name that have a more-or-less "direct" name, as opposed to `new()` and the like. * So `new()` can still come before an `aardvark` method. */ function tryGetName(node) { - if (node.kind === 230 /* ModuleDeclaration */) { + if (node.kind === 232 /* ModuleDeclaration */) { return getModuleName(node); } var decl = node; @@ -71693,18 +77545,18 @@ var ts; return ts.getPropertyNameForPropertyNameNode(decl.name); } switch (node.kind) { - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 197 /* ClassExpression */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 198 /* ClassExpression */: return getFunctionOrClassName(node); - case 285 /* JSDocTypedefTag */: + case 289 /* JSDocTypedefTag */: return getJSDocTypedefTagName(node); default: return undefined; } } function getItemName(node) { - if (node.kind === 230 /* ModuleDeclaration */) { + if (node.kind === 232 /* ModuleDeclaration */) { return getModuleName(node); } var name = node.name; @@ -71715,16 +77567,16 @@ var ts; } } switch (node.kind) { - case 261 /* SourceFile */: + case 264 /* SourceFile */: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : ""; - case 185 /* ArrowFunction */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + case 186 /* ArrowFunction */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: if (ts.getModifierFlags(node) & 512 /* Default */) { return "default"; } @@ -71732,15 +77584,15 @@ var ts; // (eg: "app\n.onactivated"), so we should remove the whitespace for readabiltiy in the // navigation bar. return getFunctionOrClassName(node); - case 150 /* Constructor */: + case 151 /* Constructor */: return "constructor"; - case 154 /* ConstructSignature */: + case 155 /* ConstructSignature */: return "new()"; - case 153 /* CallSignature */: + case 154 /* CallSignature */: return "()"; - case 155 /* IndexSignature */: + case 156 /* IndexSignature */: return "[]"; - case 285 /* JSDocTypedefTag */: + case 289 /* JSDocTypedefTag */: return getJSDocTypedefTagName(node); default: return ""; @@ -71752,7 +77604,7 @@ var ts; } else { var parentNode = node.parent && node.parent.parent; - if (parentNode && parentNode.kind === 205 /* VariableStatement */) { + if (parentNode && parentNode.kind === 207 /* VariableStatement */) { if (parentNode.declarationList.declarations.length > 0) { var nameIdentifier = parentNode.declarationList.declarations[0].name; if (nameIdentifier.kind === 70 /* Identifier */) { @@ -71781,24 +77633,24 @@ var ts; return topLevel; function isTopLevel(item) { switch (navigationBarNodeKind(item)) { - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 229 /* EnumDeclaration */: - case 227 /* InterfaceDeclaration */: - case 230 /* ModuleDeclaration */: - case 261 /* SourceFile */: - case 228 /* TypeAliasDeclaration */: - case 285 /* JSDocTypedefTag */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 231 /* EnumDeclaration */: + case 229 /* InterfaceDeclaration */: + case 232 /* ModuleDeclaration */: + case 264 /* SourceFile */: + case 230 /* TypeAliasDeclaration */: + case 289 /* JSDocTypedefTag */: return true; - case 150 /* Constructor */: - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 223 /* VariableDeclaration */: + case 151 /* Constructor */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 225 /* VariableDeclaration */: return hasSomeImportantChild(item); - case 185 /* ArrowFunction */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -71808,10 +77660,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 231 /* ModuleBlock */: - case 261 /* SourceFile */: - case 149 /* MethodDeclaration */: - case 150 /* Constructor */: + case 233 /* ModuleBlock */: + case 264 /* SourceFile */: + case 150 /* MethodDeclaration */: + case 151 /* Constructor */: return true; default: return hasSomeImportantChild(item); @@ -71820,18 +77672,16 @@ var ts; function hasSomeImportantChild(item) { return ts.forEach(item.children, function (child) { var childKind = navigationBarNodeKind(child); - return childKind !== 223 /* VariableDeclaration */ && childKind !== 174 /* BindingElement */; + return childKind !== 225 /* VariableDeclaration */ && childKind !== 175 /* BindingElement */; }); } } } - // NavigationBarItem requires an array, but will not mutate it, so just give it this for performance. - var emptyChildItemArray = []; function convertToTree(n) { return { text: getItemName(n.node), kind: ts.getNodeKind(n.node), - kindModifiers: ts.getNodeModifiers(n.node), + kindModifiers: getModifiers(n.node), spans: getSpans(n), childItems: ts.map(n.children, convertToTree) }; @@ -71840,7 +77690,7 @@ var ts; return { text: getItemName(n.node), kind: ts.getNodeKind(n.node), - kindModifiers: ts.getNodeModifiers(n.node), + kindModifiers: getModifiers(n.node), spans: getSpans(n), childItems: ts.map(n.children, convertToChildItem) || emptyChildItemArray, indent: n.indent, @@ -71878,7 +77728,7 @@ var ts; // Otherwise, we need to aggregate each identifier to build up the qualified name. var result = []; result.push(moduleDeclaration.name.text); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 230 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 232 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(moduleDeclaration.name.text); } @@ -71889,28 +77739,34 @@ var ts; * We store 'A' as associated with a NavNode, and use getModuleName to traverse down again. */ function getInteriorModule(decl) { - return decl.body.kind === 230 /* ModuleDeclaration */ ? getInteriorModule(decl.body) : decl; + return decl.body.kind === 232 /* ModuleDeclaration */ ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 142 /* ComputedPropertyName */; + return !member.name || member.name.kind === 143 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 261 /* SourceFile */ + return node.kind === 264 /* SourceFile */ ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) - : ts.createTextSpanFromBounds(node.getStart(curSourceFile), node.getEnd()); + : ts.createTextSpanFromNode(node, curSourceFile); + } + function getModifiers(node) { + if (node.parent && node.parent.kind === 225 /* VariableDeclaration */) { + node = node.parent; + } + return ts.getNodeModifiers(node); } function getFunctionOrClassName(node) { if (node.name && ts.getFullWidth(node.name) > 0) { return ts.declarationNameToString(node.name); } - else if (node.parent.kind === 223 /* VariableDeclaration */) { + else if (node.parent.kind === 225 /* VariableDeclaration */) { return ts.declarationNameToString(node.parent.name); } - else if (node.parent.kind === 192 /* BinaryExpression */ && + else if (node.parent.kind === 193 /* BinaryExpression */ && node.parent.operatorToken.kind === 57 /* EqualsToken */) { return nodeText(node.parent.left).replace(whiteSpaceRegex, ""); } - else if (node.parent.kind === 257 /* PropertyAssignment */ && node.parent.name) { + else if (node.parent.kind === 260 /* PropertyAssignment */ && node.parent.name) { return nodeText(node.parent.name); } else if (ts.getModifierFlags(node) & 512 /* Default */) { @@ -71921,22 +77777,8 @@ var ts; } } function isFunctionOrClassExpression(node) { - return node.kind === 184 /* FunctionExpression */ || node.kind === 185 /* ArrowFunction */ || node.kind === 197 /* ClassExpression */; + return node.kind === 185 /* FunctionExpression */ || node.kind === 186 /* ArrowFunction */ || node.kind === 198 /* ClassExpression */; } - /** - * Matches all whitespace characters in a string. Eg: - * - * "app. - * - * onactivated" - * - * matches because of the newline, whereas - * - * "app.onactivated" - * - * does not match. - */ - var whiteSpaceRegex = /\s+/g; })(NavigationBar = ts.NavigationBar || (ts.NavigationBar = {})); })(ts || (ts = {})); /* @internal */ @@ -71944,29 +77786,29 @@ var ts; (function (ts) { var OutliningElementsCollector; (function (OutliningElementsCollector) { - function collectElements(sourceFile) { + function collectElements(sourceFile, cancellationToken) { var elements = []; var collapseText = "..."; function addOutliningSpan(hintSpanNode, startElement, endElement, autoCollapse) { if (hintSpanNode && startElement && endElement) { - var span_12 = { + var span_13 = { textSpan: ts.createTextSpanFromBounds(startElement.pos, endElement.end), - hintSpan: ts.createTextSpanFromBounds(hintSpanNode.getStart(), hintSpanNode.end), + hintSpan: ts.createTextSpanFromNode(hintSpanNode, sourceFile), bannerText: collapseText, autoCollapse: autoCollapse }; - elements.push(span_12); + elements.push(span_13); } } function addOutliningSpanComments(commentSpan, autoCollapse) { if (commentSpan) { - var span_13 = { + var span_14 = { textSpan: ts.createTextSpanFromBounds(commentSpan.pos, commentSpan.end), hintSpan: ts.createTextSpanFromBounds(commentSpan.pos, commentSpan.end), bannerText: collapseText, autoCollapse: autoCollapse }; - elements.push(span_13); + elements.push(span_14); } } function addOutliningForLeadingCommentsForNode(n) { @@ -71978,6 +77820,7 @@ var ts; var singleLineCommentCount = 0; for (var _i = 0, comments_4 = comments; _i < comments_4.length; _i++) { var currentComment = comments_4[_i]; + cancellationToken.throwIfCancellationRequested(); // For single line comments, combine consecutive ones (2 or more) into // a single span from the start of the first till the end of the last if (currentComment.kind === 2 /* SingleLineCommentTrivia */) { @@ -72003,19 +77846,20 @@ var ts; // Only outline spans of two or more consecutive single line comments if (count > 1) { var multipleSingleLineComments = { + kind: 2 /* SingleLineCommentTrivia */, pos: start, end: end, - kind: 2 /* SingleLineCommentTrivia */ }; addOutliningSpanComments(multipleSingleLineComments, /*autoCollapse*/ false); } } function autoCollapse(node) { - return ts.isFunctionBlock(node) && node.parent.kind !== 185 /* ArrowFunction */; + return ts.isFunctionBlock(node) && node.parent.kind !== 186 /* ArrowFunction */; } var depth = 0; var maxDepth = 20; function walk(n) { + cancellationToken.throwIfCancellationRequested(); if (depth > maxDepth) { return; } @@ -72023,30 +77867,30 @@ var ts; addOutliningForLeadingCommentsForNode(n); } switch (n.kind) { - case 204 /* Block */: + case 206 /* Block */: if (!ts.isFunctionBlock(n)) { - var parent_19 = n.parent; + var parent = n.parent; var openBrace = ts.findChildOfKind(n, 16 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 17 /* CloseBraceToken */, sourceFile); // Check if the block is standalone, or 'attached' to some parent statement. // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. - if (parent_19.kind === 209 /* DoStatement */ || - parent_19.kind === 212 /* ForInStatement */ || - parent_19.kind === 213 /* ForOfStatement */ || - parent_19.kind === 211 /* ForStatement */ || - parent_19.kind === 208 /* IfStatement */ || - parent_19.kind === 210 /* WhileStatement */ || - parent_19.kind === 217 /* WithStatement */ || - parent_19.kind === 256 /* CatchClause */) { - addOutliningSpan(parent_19, openBrace, closeBrace, autoCollapse(n)); + if (parent.kind === 211 /* DoStatement */ || + parent.kind === 214 /* ForInStatement */ || + parent.kind === 215 /* ForOfStatement */ || + parent.kind === 213 /* ForStatement */ || + parent.kind === 210 /* IfStatement */ || + parent.kind === 212 /* WhileStatement */ || + parent.kind === 219 /* WithStatement */ || + parent.kind === 259 /* CatchClause */) { + addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); break; } - if (parent_19.kind === 221 /* TryStatement */) { + if (parent.kind === 223 /* TryStatement */) { // Could be the try-block, or the finally-block. - var tryStatement = parent_19; + var tryStatement = parent; if (tryStatement.tryBlock === n) { - addOutliningSpan(parent_19, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); break; } else if (tryStatement.finallyBlock === n) { @@ -72056,36 +77900,37 @@ var ts; break; } } + // fall through. } // Block was a standalone block. In this case we want to only collapse // the span of the block, independent of any parent span. - var span_14 = ts.createTextSpanFromBounds(n.getStart(), n.end); + var span_15 = ts.createTextSpanFromNode(n); elements.push({ - textSpan: span_14, - hintSpan: span_14, + textSpan: span_15, + hintSpan: span_15, bannerText: collapseText, autoCollapse: autoCollapse(n) }); break; } - // Fallthrough. - case 231 /* ModuleBlock */: { + // falls through + case 233 /* ModuleBlock */: { var openBrace = ts.findChildOfKind(n, 16 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 17 /* CloseBraceToken */, sourceFile); addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); break; } - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 229 /* EnumDeclaration */: - case 176 /* ObjectLiteralExpression */: - case 232 /* CaseBlock */: { + case 228 /* ClassDeclaration */: + case 229 /* InterfaceDeclaration */: + case 231 /* EnumDeclaration */: + case 177 /* ObjectLiteralExpression */: + case 234 /* CaseBlock */: { var openBrace = ts.findChildOfKind(n, 16 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 17 /* CloseBraceToken */, sourceFile); addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); break; } - case 175 /* ArrayLiteralExpression */: + case 176 /* ArrayLiteralExpression */: var openBracket = ts.findChildOfKind(n, 20 /* OpenBracketToken */, sourceFile); var closeBracket = ts.findChildOfKind(n, 21 /* CloseBracketToken */, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); @@ -72181,10 +78026,11 @@ var ts; return totalMatch; } function getWordSpans(word) { - if (!(word in stringToWordSpans)) { - stringToWordSpans[word] = breakIntoWordSpans(word); + var spans = stringToWordSpans.get(word); + if (!spans) { + stringToWordSpans.set(word, spans = breakIntoWordSpans(word)); } - return stringToWordSpans[word]; + return spans; } function matchTextChunk(candidate, chunk, punctuationStripped) { var index = indexOfIgnoringCase(candidate, chunk.textLowerCase); @@ -72212,10 +78058,10 @@ var ts; // But we would match 'FooAttribute' (since 'Attribute' starts with 'a'). var wordSpans = getWordSpans(candidate); for (var _i = 0, wordSpans_1 = wordSpans; _i < wordSpans_1.length; _i++) { - var span_15 = wordSpans_1[_i]; - if (partStartsWith(candidate, span_15, chunk.text, /*ignoreCase:*/ true)) { + var span_16 = wordSpans_1[_i]; + if (partStartsWith(candidate, span_16, chunk.text, /*ignoreCase:*/ true)) { return createPatternMatch(PatternMatchKind.substring, punctuationStripped, - /*isCaseSensitive:*/ partStartsWith(candidate, span_15, chunk.text, /*ignoreCase:*/ false)); + /*isCaseSensitive:*/ partStartsWith(candidate, span_16, chunk.text, /*ignoreCase:*/ false)); } } } @@ -72465,7 +78311,8 @@ var ts; } // Assumes 'value' is already lowercase. function indexOfIgnoringCase(string, value) { - for (var i = 0, n = string.length - value.length; i <= n; i++) { + var n = string.length - value.length; + for (var i = 0; i <= n; i++) { if (startsWithIgnoringCase(string, value, i)) { return i; } @@ -72474,7 +78321,7 @@ var ts; } // Assumes 'value' is already lowercase. function startsWithIgnoringCase(string, value, start) { - for (var i = 0, n = value.length; i < n; i++) { + for (var i = 0; i < value.length; i++) { var ch1 = toLowerCase(string.charCodeAt(i + start)); var ch2 = value.charCodeAt(i); if (ch1 !== ch2) { @@ -72546,7 +78393,7 @@ var ts; function breakIntoSpans(identifier, word) { var result = []; var wordStart = 0; - for (var i = 1, n = identifier.length; i < n; i++) { + for (var i = 1; i < identifier.length; i++) { var lastIsDigit = isDigit(identifier.charCodeAt(i - 1)); var currentIsDigit = isDigit(identifier.charCodeAt(i)); var hasTransitionFromLowerToUpper = transitionFromLowerToUpper(identifier, word, i); @@ -72758,7 +78605,7 @@ var ts; else { if (token === 70 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 138 /* FromKeyword */) { + if (token === 139 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import d from "mod"; @@ -72789,7 +78636,7 @@ var ts; } if (token === 17 /* CloseBraceToken */) { token = nextToken(); - if (token === 138 /* FromKeyword */) { + if (token === 139 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import {a as A} from "mod"; @@ -72805,7 +78652,7 @@ var ts; token = nextToken(); if (token === 70 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 138 /* FromKeyword */) { + if (token === 139 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import * as NS from "mod" @@ -72835,7 +78682,7 @@ var ts; } if (token === 17 /* CloseBraceToken */) { token = nextToken(); - if (token === 138 /* FromKeyword */) { + if (token === 139 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // export {a as A} from "mod"; @@ -72847,7 +78694,7 @@ var ts; } else if (token === 38 /* AsteriskToken */) { token = nextToken(); - if (token === 138 /* FromKeyword */) { + if (token === 139 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // export * from "mod" @@ -72999,93 +78846,89 @@ var ts; var Rename; (function (Rename) { function getRenameInfo(typeChecker, defaultLibFileName, getCanonicalFileName, sourceFile, position) { - var canonicalDefaultLibName = getCanonicalFileName(ts.normalizePath(defaultLibFileName)); + var getCanonicalDefaultLibName = ts.memoize(function () { return getCanonicalFileName(ts.normalizePath(defaultLibFileName)); }); var node = ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ true); - if (node) { - if (node.kind === 70 /* Identifier */ || - node.kind === 9 /* StringLiteral */ || - ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || - ts.isThis(node)) { - var symbol = typeChecker.getSymbolAtLocation(node); - // Only allow a symbol to be renamed if it actually has at least one declaration. - if (symbol) { - var declarations = symbol.getDeclarations(); - if (declarations && declarations.length > 0) { - // Disallow rename for elements that are defined in the standard TypeScript library. - if (ts.forEach(declarations, isDefinedInLibraryFile)) { - return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library)); - } - var displayName = ts.stripQuotes(ts.getDeclaredName(typeChecker, symbol, node)); - var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - if (kind) { - return { - canRename: true, - kind: kind, - displayName: displayName, - localizedErrorMessage: undefined, - fullDisplayName: typeChecker.getFullyQualifiedName(symbol), - kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), - triggerSpan: createTriggerSpanForNode(node, sourceFile) - }; - } - } - } - else if (node.kind === 9 /* StringLiteral */) { - var type = ts.getStringLiteralTypeForNode(node, typeChecker); - if (type) { - if (isDefinedInLibraryFile(node)) { - return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library)); - } - else { - var displayName = ts.stripQuotes(type.text); - return { - canRename: true, - kind: ts.ScriptElementKind.variableElement, - displayName: displayName, - localizedErrorMessage: undefined, - fullDisplayName: displayName, - kindModifiers: ts.ScriptElementKindModifier.none, - triggerSpan: createTriggerSpanForNode(node, sourceFile) - }; - } - } - } - } - } - return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_this_element)); - function getRenameInfoError(localizedErrorMessage) { - return { - canRename: false, - localizedErrorMessage: localizedErrorMessage, - displayName: undefined, - fullDisplayName: undefined, - kind: undefined, - kindModifiers: undefined, - triggerSpan: undefined - }; - } + var renameInfo = node && nodeIsEligibleForRename(node) + ? getRenameInfoForNode(node, typeChecker, sourceFile, isDefinedInLibraryFile) + : undefined; + return renameInfo || getRenameInfoError(ts.Diagnostics.You_cannot_rename_this_element); function isDefinedInLibraryFile(declaration) { - if (defaultLibFileName) { - var sourceFile_1 = declaration.getSourceFile(); - var canonicalName = getCanonicalFileName(ts.normalizePath(sourceFile_1.fileName)); - if (canonicalName === canonicalDefaultLibName) { - return true; - } + if (!defaultLibFileName) { + return false; } - return false; - } - function createTriggerSpanForNode(node, sourceFile) { - var start = node.getStart(sourceFile); - var width = node.getWidth(sourceFile); - if (node.kind === 9 /* StringLiteral */) { - // Exclude the quotes - start += 1; - width -= 2; - } - return ts.createTextSpan(start, width); + var sourceFile = declaration.getSourceFile(); + var canonicalName = getCanonicalFileName(ts.normalizePath(sourceFile.fileName)); + return canonicalName === getCanonicalDefaultLibName(); } } Rename.getRenameInfo = getRenameInfo; + function getRenameInfoForNode(node, typeChecker, sourceFile, isDefinedInLibraryFile) { + var symbol = typeChecker.getSymbolAtLocation(node); + // Only allow a symbol to be renamed if it actually has at least one declaration. + if (symbol) { + var declarations = symbol.getDeclarations(); + if (declarations && declarations.length > 0) { + // Disallow rename for elements that are defined in the standard TypeScript library. + if (ts.some(declarations, isDefinedInLibraryFile)) { + return getRenameInfoError(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); + } + // Cannot rename `default` as in `import { default as foo } from "./someModule"; + if (node.kind === 70 /* Identifier */ && + node.originalKeywordKind === 78 /* DefaultKeyword */ && + symbol.parent.flags & 1536 /* Module */) { + return undefined; + } + var displayName = ts.stripQuotes(ts.getDeclaredName(typeChecker, symbol, node)); + var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); + return kind ? getRenameInfoSuccess(displayName, typeChecker.getFullyQualifiedName(symbol), kind, ts.SymbolDisplay.getSymbolModifiers(symbol), node, sourceFile) : undefined; + } + } + else if (node.kind === 9 /* StringLiteral */) { + if (isDefinedInLibraryFile(node)) { + return getRenameInfoError(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); + } + var displayName = ts.stripQuotes(node.text); + return getRenameInfoSuccess(displayName, displayName, ts.ScriptElementKind.variableElement, ts.ScriptElementKindModifier.none, node, sourceFile); + } + } + function getRenameInfoSuccess(displayName, fullDisplayName, kind, kindModifiers, node, sourceFile) { + return { + canRename: true, + kind: kind, + displayName: displayName, + localizedErrorMessage: undefined, + fullDisplayName: fullDisplayName, + kindModifiers: kindModifiers, + triggerSpan: createTriggerSpanForNode(node, sourceFile) + }; + } + function getRenameInfoError(diagnostic) { + return { + canRename: false, + localizedErrorMessage: ts.getLocaleSpecificMessage(diagnostic), + displayName: undefined, + fullDisplayName: undefined, + kind: undefined, + kindModifiers: undefined, + triggerSpan: undefined + }; + } + function createTriggerSpanForNode(node, sourceFile) { + var start = node.getStart(sourceFile); + var width = node.getWidth(sourceFile); + if (node.kind === 9 /* StringLiteral */) { + // Exclude the quotes + start += 1; + width -= 2; + } + return ts.createTextSpan(start, width); + } + function nodeIsEligibleForRename(node) { + return node.kind === 70 /* Identifier */ || + node.kind === 9 /* StringLiteral */ || + ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || + ts.isThis(node); + } })(Rename = ts.Rename || (ts.Rename = {})); })(ts || (ts = {})); /// @@ -73140,7 +78983,7 @@ var ts; // stack++; // break; // case TypeScript.SyntaxKind.CommaToken: - // if (stack == 0) { + // if (stack === 0) { // argumentIndex++; // } // break; @@ -73232,6 +79075,7 @@ var ts; ArgumentListKind[ArgumentListKind["TypeArguments"] = 0] = "TypeArguments"; ArgumentListKind[ArgumentListKind["CallArguments"] = 1] = "CallArguments"; ArgumentListKind[ArgumentListKind["TaggedTemplateArguments"] = 2] = "TaggedTemplateArguments"; + ArgumentListKind[ArgumentListKind["JSXAttributesArguments"] = 3] = "JSXAttributesArguments"; })(ArgumentListKind = SignatureHelp.ArgumentListKind || (SignatureHelp.ArgumentListKind = {})); function getSignatureHelpItems(program, sourceFile, position, cancellationToken) { var typeChecker = program.getTypeChecker(); @@ -73263,7 +79107,7 @@ var ts; } SignatureHelp.getSignatureHelpItems = getSignatureHelpItems; function createJavaScriptSignatureHelpItems(argumentInfo, program) { - if (argumentInfo.invocation.kind !== 179 /* CallExpression */) { + if (argumentInfo.invocation.kind !== 180 /* CallExpression */) { return undefined; } // See if we can find some symbol with the call expression name that has call signatures. @@ -73271,7 +79115,7 @@ var ts; var expression = callExpression.expression; var name = expression.kind === 70 /* Identifier */ ? expression - : expression.kind === 177 /* PropertyAccessExpression */ + : expression.kind === 178 /* PropertyAccessExpression */ ? expression.name : undefined; if (!name || !name.text) { @@ -73281,10 +79125,10 @@ var ts; for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { var sourceFile = _a[_i]; var nameToDeclarations = sourceFile.getNamedDeclarations(); - var declarations = nameToDeclarations[name.text]; + var declarations = nameToDeclarations.get(name.text); if (declarations) { - for (var _b = 0, declarations_10 = declarations; _b < declarations_10.length; _b++) { - var declaration = declarations_10[_b]; + for (var _b = 0, declarations_13 = declarations; _b < declarations_13.length; _b++) { + var declaration = declarations_13[_b]; var symbol = declaration.symbol; if (symbol) { var type = typeChecker.getTypeOfSymbolAtLocation(symbol, declaration); @@ -73304,21 +79148,21 @@ var ts; * in the argument of an invocation; returns undefined otherwise. */ function getImmediatelyContainingArgumentInfo(node, position, sourceFile) { - if (node.parent.kind === 179 /* CallExpression */ || node.parent.kind === 180 /* NewExpression */) { + if (node.parent.kind === 180 /* CallExpression */ || node.parent.kind === 181 /* NewExpression */) { var callExpression = node.parent; // There are 3 cases to handle: - // 1. The token introduces a list, and should begin a sig help session + // 1. The token introduces a list, and should begin a signature help session // 2. The token is either not associated with a list, or ends a list, so the session should end - // 3. The token is buried inside a list, and should give sig help + // 3. The token is buried inside a list, and should give signature help // // The following are examples of each: // // Case 1: - // foo<#T, U>(#a, b) -> The token introduces a list, and should begin a sig help session + // foo<#T, U>(#a, b) -> The token introduces a list, and should begin a signature help session // Case 2: // fo#o#(a, b)# -> The token is either not associated with a list, or ends a list, so the session should end // Case 3: - // foo(a#, #b#) -> The token is buried inside a list, and should give sig help + // foo(a#, #b#) -> The token is buried inside a list, and should give signature help // Find out if 'node' is an argument, a type argument, or neither if (node.kind === 26 /* LessThanToken */ || node.kind === 18 /* OpenParenToken */) { @@ -73337,7 +79181,7 @@ var ts; } // findListItemInfo can return undefined if we are not in parent's argument list // or type argument list. This includes cases where the cursor is: - // - To the right of the closing paren, non-substitution template, or template tail. + // - To the right of the closing parenthesis, non-substitution template, or template tail. // - Between the type arguments and the arguments (greater than token) // - On the target of the call (parent.func) // - On the 'new' keyword in a 'new' expression @@ -73358,25 +79202,25 @@ var ts; } return undefined; } - else if (node.kind === 12 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 181 /* TaggedTemplateExpression */) { + else if (node.kind === 12 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 182 /* TaggedTemplateExpression */) { // Check if we're actually inside the template; // otherwise we'll fall out and return undefined. if (ts.isInsideTemplateLiteral(node, position)) { return getArgumentListInfoForTemplate(node.parent, /*argumentIndex*/ 0, sourceFile); } } - else if (node.kind === 13 /* TemplateHead */ && node.parent.parent.kind === 181 /* TaggedTemplateExpression */) { + else if (node.kind === 13 /* TemplateHead */ && node.parent.parent.kind === 182 /* TaggedTemplateExpression */) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 194 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 195 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } - else if (node.parent.kind === 202 /* TemplateSpan */ && node.parent.parent.parent.kind === 181 /* TaggedTemplateExpression */) { + else if (node.parent.kind === 204 /* TemplateSpan */ && node.parent.parent.parent.kind === 182 /* TaggedTemplateExpression */) { var templateSpan = node.parent; var templateExpression = templateSpan.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 194 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 195 /* TemplateExpression */); // If we're just after a template tail, don't show signature help. if (node.kind === 15 /* TemplateTail */ && !ts.isInsideTemplateLiteral(node, position)) { return undefined; @@ -73385,8 +79229,25 @@ var ts; var argumentIndex = getArgumentIndexForTemplatePiece(spanIndex, node, position); return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } + else if (node.parent && ts.isJsxOpeningLikeElement(node.parent)) { + // Provide a signature help for JSX opening element or JSX self-closing element. + // This is not guarantee that JSX tag-name is resolved into stateless function component. (that is done in "getSignatureHelpItems") + // i.e + // export function MainButton(props: ButtonProps, context: any): JSX.Element { ... } + // ' '' - // That will give us 2 non-commas. We then add one for the last comma, givin us an + // That will give us 2 non-commas. We then add one for the last comma, giving us an // arg count of 3. var listChildren = argumentsList.getChildren(); var argumentCount = ts.countWhere(listChildren, function (arg) { return arg.kind !== 25 /* CommaToken */; }); @@ -73494,7 +79355,7 @@ var ts; // // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 194 /* TemplateExpression */) { + if (template.kind === 195 /* TemplateExpression */) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -73503,7 +79364,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node, position, sourceFile) { - for (var n = node; n.kind !== 261 /* SourceFile */; n = n.parent) { + for (var n = node; n.kind !== 264 /* SourceFile */; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } @@ -73516,6 +79377,7 @@ var ts; if (argumentInfo) { return argumentInfo; } + // TODO: Handle generic call with incomplete syntax } return undefined; } @@ -73596,7 +79458,8 @@ var ts; suffixDisplayParts: suffixDisplayParts, separatorDisplayParts: [ts.punctuationPart(25 /* CommaToken */), ts.spacePart()], parameters: signatureHelpParameters, - documentation: candidateSignature.getDocumentationComment() + documentation: candidateSignature.getDocumentationComment(), + tags: candidateSignature.getJsDocTags() }; }); var argumentIndex = argumentListInfo.argumentIndex; @@ -73646,9 +79509,9 @@ var ts; (function (SymbolDisplay) { // TODO(drosen): use contextual SemanticMeaning. function getSymbolKind(typeChecker, symbol, location) { - var flags = symbol.getFlags(); + var flags = symbol.flags; if (flags & 32 /* Class */) - return ts.getDeclarationOfKind(symbol, 197 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 198 /* ClassExpression */) ? ts.ScriptElementKind.localClassElement : ts.ScriptElementKind.classElement; if (flags & 384 /* Enum */) return ts.ScriptElementKind.enumElement; @@ -73658,12 +79521,12 @@ var ts; return ts.ScriptElementKind.interfaceElement; if (flags & 262144 /* TypeParameter */) return ts.ScriptElementKind.typeParameterElement; - var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, flags, location); + var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location); if (result === ts.ScriptElementKind.unknown) { if (flags & 262144 /* TypeParameter */) return ts.ScriptElementKind.typeParameterElement; if (flags & 8 /* EnumMember */) - return ts.ScriptElementKind.variableElement; + return ts.ScriptElementKind.enumMemberElement; if (flags & 8388608 /* Alias */) return ts.ScriptElementKind.alias; if (flags & 1536 /* Module */) @@ -73672,7 +79535,7 @@ var ts; return result; } SymbolDisplay.getSymbolKind = getSymbolKind; - function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, flags, location) { + function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location) { if (typeChecker.isUndefinedSymbol(symbol)) { return ts.ScriptElementKind.variableElement; } @@ -73682,6 +79545,7 @@ var ts; if (location.kind === 98 /* ThisKeyword */ && ts.isExpression(location)) { return ts.ScriptElementKind.parameterElement; } + var flags = symbol.flags; if (flags & 3 /* Variable */) { if (ts.isFirstDeclarationOfSymbolParameter(symbol)) { return ts.ScriptElementKind.parameterElement; @@ -73705,7 +79569,7 @@ var ts; if (flags & 16384 /* Constructor */) return ts.ScriptElementKind.constructorImplementationElement; if (flags & 4 /* Property */) { - if (flags & 268435456 /* SyntheticProperty */) { + if (flags & 134217728 /* Transient */ && symbol.checkFlags & 6 /* Synthetic */) { // If union property is result of union of non method (property/accessors/variables), it is labeled as property var unionPropertyKind = ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) { var rootSymbolFlags = rootSymbol.getFlags(); @@ -73725,6 +79589,9 @@ var ts; } return unionPropertyKind; } + if (location.parent && ts.isJsxAttribute(location.parent)) { + return ts.ScriptElementKind.jsxAttribute; + } return ts.ScriptElementKind.memberVariableElement; } return ts.ScriptElementKind.unknown; @@ -73740,8 +79607,9 @@ var ts; if (semanticMeaning === void 0) { semanticMeaning = ts.getMeaningFromLocation(location); } var displayParts = []; var documentation; + var tags; var symbolFlags = symbol.flags; - var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, symbolFlags, location); + var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location); var hasAddedSymbolInfo; var isThisExpression = location.kind === 98 /* ThisKeyword */ && ts.isExpression(location); var type; @@ -73754,7 +79622,7 @@ var ts; var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (type) { - if (location.parent && location.parent.kind === 177 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 178 /* PropertyAccessExpression */) { var right = location.parent.name; // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { @@ -73762,21 +79630,24 @@ var ts; } } // try get the call/construct signature from the type if it matches - var callExpression = void 0; - if (location.kind === 179 /* CallExpression */ || location.kind === 180 /* NewExpression */) { - callExpression = location; + var callExpressionLike = void 0; + if (location.kind === 180 /* CallExpression */ || location.kind === 181 /* NewExpression */) { + callExpressionLike = location; } else if (ts.isCallExpressionTarget(location) || ts.isNewExpressionTarget(location)) { - callExpression = location.parent; + callExpressionLike = location.parent; } - if (callExpression) { + else if (location.parent && ts.isJsxOpeningLikeElement(location.parent) && ts.isFunctionLike(symbol.valueDeclaration)) { + callExpressionLike = location.parent; + } + if (callExpressionLike) { var candidateSignatures = []; - signature = typeChecker.getResolvedSignature(callExpression, candidateSignatures); + signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures); if (!signature && candidateSignatures.length) { // Use the first candidate: signature = candidateSignatures[0]; } - var useConstructSignatures = callExpression.kind === 180 /* NewExpression */ || callExpression.expression.kind === 96 /* SuperKeyword */; + var useConstructSignatures = callExpressionLike.kind === 181 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 96 /* SuperKeyword */); var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { // Get the first signature if there is one -- allSignatures may contain @@ -73803,6 +79674,7 @@ var ts; addPrefixForAnyFunctionOrVar(symbol, symbolKind); } switch (symbolKind) { + case ts.ScriptElementKind.jsxAttribute: case ts.ScriptElementKind.memberVariableElement: case ts.ScriptElementKind.variableElement: case ts.ScriptElementKind.constElement: @@ -73829,24 +79701,24 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304 /* Accessor */)) || - (location.kind === 122 /* ConstructorKeyword */ && location.parent.kind === 150 /* Constructor */)) { + (location.kind === 122 /* ConstructorKeyword */ && location.parent.kind === 151 /* Constructor */)) { // get the signature from the declaration and write it var functionDeclaration = location.parent; - var allSignatures = functionDeclaration.kind === 150 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration.kind === 151 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); } else { signature = allSignatures[0]; } - if (functionDeclaration.kind === 150 /* Constructor */) { + if (functionDeclaration.kind === 151 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = ts.ScriptElementKind.constructorImplementationElement; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 153 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 154 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -73855,7 +79727,7 @@ var ts; } } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { - if (ts.getDeclarationOfKind(symbol, 197 /* ClassExpression */)) { + if (ts.getDeclarationOfKind(symbol, 198 /* ClassExpression */)) { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class @@ -73878,7 +79750,7 @@ var ts; } if (symbolFlags & 524288 /* TypeAlias */) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(136 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(137 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); @@ -73899,7 +79771,7 @@ var ts; } if (symbolFlags & 1536 /* Module */) { addNewLineIfDisplayPartsExist(); - var declaration = ts.getDeclarationOfKind(symbol, 230 /* ModuleDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 232 /* ModuleDeclaration */); var isNamespace = declaration && declaration.name && declaration.name.kind === 70 /* Identifier */; displayParts.push(ts.keywordPart(isNamespace ? 128 /* NamespaceKeyword */ : 127 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); @@ -73920,28 +79792,28 @@ var ts; } else { // Method/function type parameter - var declaration = ts.getDeclarationOfKind(symbol, 143 /* TypeParameter */); + var declaration = ts.getDeclarationOfKind(symbol, 144 /* TypeParameter */); ts.Debug.assert(declaration !== undefined); declaration = declaration.parent; if (declaration) { if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); - if (declaration.kind === 154 /* ConstructSignature */) { + if (declaration.kind === 155 /* ConstructSignature */) { displayParts.push(ts.keywordPart(93 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 153 /* CallSignature */ && declaration.name) { + else if (declaration.kind !== 154 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } - else if (declaration.kind === 228 /* TypeAliasDeclaration */) { + else if (declaration.kind === 230 /* TypeAliasDeclaration */) { // Type alias type parameter // For example // type list = T[]; // Both T will go through same code path addInPrefix(); - displayParts.push(ts.keywordPart(136 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(137 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -73950,9 +79822,10 @@ var ts; } } if (symbolFlags & 8 /* EnumMember */) { + symbolKind = ts.ScriptElementKind.enumMemberElement; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 260 /* EnumMember */) { + if (declaration.kind === 263 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -73964,7 +79837,7 @@ var ts; } if (symbolFlags & 8388608 /* Alias */) { addNewLineIfDisplayPartsExist(); - if (symbol.declarations[0].kind === 233 /* NamespaceExportDeclaration */) { + if (symbol.declarations[0].kind === 235 /* NamespaceExportDeclaration */) { displayParts.push(ts.keywordPart(83 /* ExportKeyword */)); displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(128 /* NamespaceKeyword */)); @@ -73975,7 +79848,7 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 234 /* ImportEqualsDeclaration */) { + if (declaration.kind === 236 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); @@ -74011,6 +79884,7 @@ var ts; } // For properties, variables and local vars: show the type if (symbolKind === ts.ScriptElementKind.memberVariableElement || + symbolKind === ts.ScriptElementKind.jsxAttribute || symbolFlags & 3 /* Variable */ || symbolKind === ts.ScriptElementKind.localVariableElement || isThisExpression) { @@ -74044,14 +79918,15 @@ var ts; } if (!documentation) { documentation = symbol.getDocumentationComment(); + tags = symbol.getJsDocTags(); if (documentation.length === 0 && symbol.flags & 4 /* Property */) { - // For some special property access expressions like `experts.foo = foo` or `module.exports.foo = foo` + // For some special property access expressions like `exports.foo = foo` or `module.exports.foo = foo` // there documentation comments might be attached to the right hand side symbol of their declarations. // The pattern of such special property access is that the parent symbol is the symbol of the file. - if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 261 /* SourceFile */; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 264 /* SourceFile */; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 192 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 193 /* BinaryExpression */) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -74059,6 +79934,7 @@ var ts; continue; } documentation = rhsSymbol.getDocumentationComment(); + tags = rhsSymbol.getJsDocTags(); if (documentation.length > 0) { break; } @@ -74066,7 +79942,7 @@ var ts; } } } - return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind }; + return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind, tags: tags }; function addNewLineIfDisplayPartsExist() { if (displayParts.length) { displayParts.push(ts.lineBreakPart()); @@ -74117,6 +79993,7 @@ var ts; displayParts.push(ts.punctuationPart(19 /* CloseParenToken */)); } documentation = signature.getDocumentationComment(); + tags = signature.getJsDocTags(); } function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) { var typeParameterParts = ts.mapToDisplayParts(function (writer) { @@ -74132,16 +80009,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 184 /* FunctionExpression */) { + if (declaration.kind === 185 /* FunctionExpression */) { return true; } - if (declaration.kind !== 223 /* VariableDeclaration */ && declaration.kind !== 225 /* FunctionDeclaration */) { + if (declaration.kind !== 225 /* VariableDeclaration */ && declaration.kind !== 227 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable - for (var parent_20 = declaration.parent; !ts.isFunctionBlock(parent_20); parent_20 = parent_20.parent) { + for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { // Reached source file or module block - if (parent_20.kind === 261 /* SourceFile */ || parent_20.kind === 231 /* ModuleBlock */) { + if (parent.kind === 264 /* SourceFile */ || parent.kind === 233 /* ModuleBlock */) { return false; } } @@ -74194,7 +80071,7 @@ var ts; sourceFile.moduleName = transpileOptions.moduleName; } if (transpileOptions.renamedDependencies) { - sourceFile.renamedDependencies = ts.createMap(transpileOptions.renamedDependencies); + sourceFile.renamedDependencies = ts.createMapFromTemplate(transpileOptions.renamedDependencies); } var newLine = ts.getNewLineCharacter(options); // Output @@ -74246,13 +80123,14 @@ var ts; ts.transpile = transpile; var commandLineOptionsStringToEnum; /** JS users may pass in string values for enum compiler options (such as ModuleKind), so convert. */ + /*@internal*/ function fixupCompilerOptions(options, diagnostics) { // Lazily create this value to fix module loading errors. commandLineOptionsStringToEnum = commandLineOptionsStringToEnum || ts.filter(ts.optionDeclarations, function (o) { - return typeof o.type === "object" && !ts.forEachProperty(o.type, function (v) { return typeof v !== "number"; }); + return typeof o.type === "object" && !ts.forEachEntry(o.type, function (v) { return typeof v !== "number"; }); }); options = ts.clone(options); - var _loop_4 = function (opt) { + var _loop_5 = function (opt) { if (!ts.hasProperty(options, opt.name)) { return "continue"; } @@ -74263,7 +80141,7 @@ var ts; options[opt.name] = ts.parseCustomTypeOption(opt, value, diagnostics); } else { - if (!ts.forEachProperty(opt.type, function (v) { return v === value; })) { + if (!ts.forEachEntry(opt.type, function (v) { return v === value; })) { // Supplied value isn't a valid enum value. diagnostics.push(ts.createCompilerDiagnosticForInvalidCustomType(opt)); } @@ -74271,10 +80149,11 @@ var ts; }; for (var _i = 0, commandLineOptionsStringToEnum_1 = commandLineOptionsStringToEnum; _i < commandLineOptionsStringToEnum_1.length; _i++) { var opt = commandLineOptionsStringToEnum_1[_i]; - _loop_4(opt); + _loop_5(opt); } return options; } + ts.fixupCompilerOptions = fixupCompilerOptions; })(ts || (ts = {})); /// /// @@ -74298,10 +80177,10 @@ var ts; ScanAction[ScanAction["RescanJsxIdentifier"] = 4] = "RescanJsxIdentifier"; ScanAction[ScanAction["RescanJsxText"] = 5] = "RescanJsxText"; })(ScanAction || (ScanAction = {})); - function getFormattingScanner(sourceFile, startPos, endPos) { + function getFormattingScanner(text, languageVariant, startPos, endPos) { ts.Debug.assert(scanner === undefined, "Scanner should be undefined"); - scanner = sourceFile.languageVariant === 1 /* JSX */ ? jsxScanner : standardScanner; - scanner.setText(sourceFile.text); + scanner = languageVariant === 1 /* JSX */ ? jsxScanner : standardScanner; + scanner.setText(text); scanner.setTextPos(startPos); var wasNewLine = true; var leadingTrivia; @@ -74379,10 +80258,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 250 /* JsxAttribute */: - case 248 /* JsxOpeningElement */: - case 249 /* JsxClosingElement */: - case 247 /* JsxSelfClosingElement */: + case 252 /* JsxAttribute */: + case 250 /* JsxOpeningElement */: + case 251 /* JsxClosingElement */: + case 249 /* JsxSelfClosingElement */: return node.kind === 70 /* Identifier */; } } @@ -74503,8 +80382,8 @@ var ts; } function isOnToken() { ts.Debug.assert(scanner !== undefined); - var current = (lastTokenInfo && lastTokenInfo.token.kind) || scanner.getToken(); - var startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); + var current = lastTokenInfo ? lastTokenInfo.token.kind : scanner.getToken(); + var startPos = lastTokenInfo ? lastTokenInfo.token.pos : scanner.getStartPos(); return startPos < endPos && current !== 1 /* EndOfFileToken */ && !ts.isTrivia(current); } // when containing node in the tree is token @@ -74794,11 +80673,11 @@ var ts; this.NoSpaceAfterQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create3(54 /* QuestionToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); this.SpaceAfterSemicolon = new formatting.Rule(formatting.RuleDescriptor.create3(24 /* SemicolonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); // Space after }. - this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17 /* CloseBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2 /* Space */)); + this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17 /* CloseBraceToken */, formatting.Shared.TokenRange.FromRange(0 /* FirstToken */, 141 /* LastToken */, [19 /* CloseParenToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2 /* Space */)); // Special case for (}, else) and (}, while) since else & while tokens are not part of the tree which makes SpaceAfterCloseBrace rule not applied this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(17 /* CloseBraceToken */, 81 /* ElseKeyword */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(17 /* CloseBraceToken */, 105 /* WhileKeyword */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); - this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17 /* CloseBraceToken */, formatting.Shared.TokenRange.FromTokens([19 /* CloseParenToken */, 21 /* CloseBracketToken */, 25 /* CommaToken */, 24 /* SemicolonToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17 /* CloseBraceToken */, formatting.Shared.TokenRange.FromTokens([21 /* CloseBracketToken */, 25 /* CommaToken */, 24 /* SemicolonToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); // No space for dot this.NoSpaceBeforeDot = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 22 /* DotToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); this.NoSpaceAfterDot = new formatting.Rule(formatting.RuleDescriptor.create3(22 /* DotToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); @@ -74815,10 +80694,10 @@ var ts; this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([19 /* CloseParenToken */, 3 /* MultiLineCommentTrivia */, 80 /* DoKeyword */, 101 /* TryKeyword */, 86 /* FinallyKeyword */, 81 /* ElseKeyword */]); this.SpaceBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 16 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */); // Insert a space after { and before } in single-line contexts, but remove space from empty object literals {}. - this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2 /* Space */)); - this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2 /* Space */)); - this.NoSpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 8 /* Delete */)); - this.NoSpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 8 /* Delete */)); + this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsBraceWrappedContext), 2 /* Space */)); + this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsBraceWrappedContext), 2 /* Space */)); + this.NoSpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); this.NoSpaceBetweenEmptyBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(16 /* OpenBraceToken */, 17 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsObjectContext), 8 /* Delete */)); // Insert new line after { and before } in multi-line contexts. this.NewLineAfterOpenBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create3(16 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4 /* NewLine */)); @@ -74848,6 +80727,7 @@ var ts; this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([109 /* LetKeyword */, 75 /* ConstKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2 /* Space */)); this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionCallOrNewContext, Rules.IsPreviousTokenNotComma), 8 /* Delete */)); this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(88 /* FunctionKeyword */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); + this.SpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionDeclContext), 2 /* Space */)); this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionDeclContext), 8 /* Delete */)); this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(104 /* VoidKeyword */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsVoidOpContext), 2 /* Space */)); this.NoSpaceBetweenReturnAndSemicolon = new formatting.Rule(formatting.RuleDescriptor.create1(95 /* ReturnKeyword */, 24 /* SemicolonToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); @@ -74858,18 +80738,19 @@ var ts; this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([101 /* TryKeyword */, 86 /* FinallyKeyword */]), 16 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); // get x() {} // set x(val) {} - this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([124 /* GetKeyword */, 133 /* SetKeyword */]), 70 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); + this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([124 /* GetKeyword */, 134 /* SetKeyword */]), 70 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); // Special case for binary operators (that are keywords). For these we have to add a space and shouldn't follow any user options. this.SpaceBeforeBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryKeywordOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); this.SpaceAfterBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryKeywordOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); // TypeScript-specific higher priority rules // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses + this.SpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(122 /* ConstructorKeyword */, 18 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); this.NoSpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(122 /* ConstructorKeyword */, 18 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); // Use of module as a function call. e.g.: import m2 = module("m2"); this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([127 /* ModuleKeyword */, 131 /* RequireKeyword */]), 18 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); // Add a space around certain TypeScript keywords - this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([116 /* AbstractKeyword */, 74 /* ClassKeyword */, 123 /* DeclareKeyword */, 78 /* DefaultKeyword */, 82 /* EnumKeyword */, 83 /* ExportKeyword */, 84 /* ExtendsKeyword */, 124 /* GetKeyword */, 107 /* ImplementsKeyword */, 90 /* ImportKeyword */, 108 /* InterfaceKeyword */, 127 /* ModuleKeyword */, 128 /* NamespaceKeyword */, 111 /* PrivateKeyword */, 113 /* PublicKeyword */, 112 /* ProtectedKeyword */, 133 /* SetKeyword */, 114 /* StaticKeyword */, 136 /* TypeKeyword */, 138 /* FromKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); - this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([84 /* ExtendsKeyword */, 107 /* ImplementsKeyword */, 138 /* FromKeyword */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([116 /* AbstractKeyword */, 74 /* ClassKeyword */, 123 /* DeclareKeyword */, 78 /* DefaultKeyword */, 82 /* EnumKeyword */, 83 /* ExportKeyword */, 84 /* ExtendsKeyword */, 124 /* GetKeyword */, 107 /* ImplementsKeyword */, 90 /* ImportKeyword */, 108 /* InterfaceKeyword */, 127 /* ModuleKeyword */, 128 /* NamespaceKeyword */, 111 /* PrivateKeyword */, 113 /* PublicKeyword */, 112 /* ProtectedKeyword */, 130 /* ReadonlyKeyword */, 134 /* SetKeyword */, 114 /* StaticKeyword */, 137 /* TypeKeyword */, 139 /* FromKeyword */, 126 /* KeyOfKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([84 /* ExtendsKeyword */, 107 /* ImplementsKeyword */, 139 /* FromKeyword */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(9 /* StringLiteral */, 16 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2 /* Space */)); // Lambda expressions @@ -74889,7 +80770,7 @@ var ts; // decorators this.SpaceBeforeAt = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 56 /* AtToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); this.NoSpaceAfterAt = new formatting.Rule(formatting.RuleDescriptor.create3(56 /* AtToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); - this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([116 /* AbstractKeyword */, 70 /* Identifier */, 83 /* ExportKeyword */, 78 /* DefaultKeyword */, 74 /* ClassKeyword */, 114 /* StaticKeyword */, 113 /* PublicKeyword */, 111 /* PrivateKeyword */, 112 /* ProtectedKeyword */, 124 /* GetKeyword */, 133 /* SetKeyword */, 20 /* OpenBracketToken */, 38 /* AsteriskToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2 /* Space */)); + this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([116 /* AbstractKeyword */, 70 /* Identifier */, 83 /* ExportKeyword */, 78 /* DefaultKeyword */, 74 /* ClassKeyword */, 114 /* StaticKeyword */, 113 /* PublicKeyword */, 111 /* PrivateKeyword */, 112 /* ProtectedKeyword */, 124 /* GetKeyword */, 134 /* SetKeyword */, 20 /* OpenBracketToken */, 38 /* AsteriskToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2 /* Space */)); this.NoSpaceBetweenFunctionKeywordAndStar = new formatting.Rule(formatting.RuleDescriptor.create1(88 /* FunctionKeyword */, 38 /* AsteriskToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), 8 /* Delete */)); this.SpaceAfterStarInGeneratorDeclaration = new formatting.Rule(formatting.RuleDescriptor.create3(38 /* AsteriskToken */, formatting.Shared.TokenRange.FromTokens([70 /* Identifier */, 18 /* OpenParenToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), 2 /* Space */)); this.NoSpaceBetweenYieldKeywordAndStar = new formatting.Rule(formatting.RuleDescriptor.create1(115 /* YieldKeyword */, 38 /* AsteriskToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsYieldOrYieldStarWithOperand), 8 /* Delete */)); @@ -74905,6 +80786,8 @@ var ts; this.NoSpaceBeforeGreaterThanTokenInJsxOpeningElement = new formatting.Rule(formatting.RuleDescriptor.create1(40 /* SlashToken */, 28 /* GreaterThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxSelfClosingElementContext, Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); this.NoSpaceBeforeEqualInJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 57 /* EqualsToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxAttributeContext, Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); this.NoSpaceAfterEqualInJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create3(57 /* EqualsToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxAttributeContext, Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + // No space before non-null assertion operator + this.NoSpaceBeforeNonNullAssertionOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 50 /* ExclamationToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonNullAssertionContext), 8 /* Delete */)); // These rules are higher in priority than user-configurable rules. this.HighPriorityCommonRules = [ this.IgnoreBeforeComment, this.IgnoreAfterLineComment, @@ -74935,7 +80818,7 @@ var ts; this.SpaceBeforeJsxAttribute, this.SpaceBeforeSlashInJsxOpeningElement, this.NoSpaceBeforeGreaterThanTokenInJsxOpeningElement, this.NoSpaceBeforeEqualInJsxAttribute, this.NoSpaceAfterEqualInJsxAttribute, // TypeScript-specific rules - this.NoSpaceAfterConstructor, this.NoSpaceAfterModuleImport, + this.NoSpaceAfterModuleImport, this.SpaceAfterCertainTypeScriptKeywords, this.SpaceBeforeCertainTypeScriptKeywords, this.SpaceAfterModuleName, this.SpaceBeforeArrow, this.SpaceAfterArrow, @@ -74950,6 +80833,7 @@ var ts; this.SpaceBeforeAt, this.NoSpaceAfterAt, this.SpaceAfterDecorator, + this.NoSpaceBeforeNonNullAssertionOperator ]; // These rules are lower in priority than user-configurable rules. this.LowPriorityCommonRules = [ @@ -74959,7 +80843,6 @@ var ts; this.NoSpaceBeforeOpenBracket, this.NoSpaceAfterCloseBracket, this.SpaceAfterSemicolon, - this.NoSpaceBeforeOpenParenInFuncDecl, this.SpaceBetweenStatements, this.SpaceAfterTryFinally ]; /// @@ -75017,9 +80900,9 @@ var ts; } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name_48 in o) { - if (o[name_48] === rule) { - return name_48; + for (var name in o) { + if (o[name] === rule) { + return name; } } throw new Error("Unknown rule"); @@ -75028,42 +80911,44 @@ var ts; /// Contexts /// Rules.IsForContext = function (context) { - return context.contextNode.kind === 211 /* ForStatement */; + return context.contextNode.kind === 213 /* ForStatement */; }; Rules.IsNotForContext = function (context) { return !Rules.IsForContext(context); }; Rules.IsBinaryOpContext = function (context) { switch (context.contextNode.kind) { - case 192 /* BinaryExpression */: - case 193 /* ConditionalExpression */: - case 200 /* AsExpression */: - case 243 /* ExportSpecifier */: - case 239 /* ImportSpecifier */: - case 156 /* TypePredicate */: - case 164 /* UnionType */: - case 165 /* IntersectionType */: + case 193 /* BinaryExpression */: + case 194 /* ConditionalExpression */: + case 201 /* AsExpression */: + case 245 /* ExportSpecifier */: + case 241 /* ImportSpecifier */: + case 157 /* TypePredicate */: + case 165 /* UnionType */: + case 166 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 174 /* BindingElement */: + case 175 /* BindingElement */: // equals in type X = ... - case 228 /* TypeAliasDeclaration */: + case 230 /* TypeAliasDeclaration */: // equal in import a = module('a'); - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: // equal in let a = 0; - case 223 /* VariableDeclaration */: + case 225 /* VariableDeclaration */: // equal in p = 0; - case 144 /* Parameter */: - case 260 /* EnumMember */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 145 /* Parameter */: + case 263 /* EnumMember */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: return context.currentTokenSpan.kind === 57 /* EqualsToken */ || context.nextTokenSpan.kind === 57 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 212 /* ForInStatement */: + case 214 /* ForInStatement */: + // "in" keyword in [P in keyof T]: T[P] + case 144 /* TypeParameter */: return context.currentTokenSpan.kind === 91 /* InKeyword */ || context.nextTokenSpan.kind === 91 /* InKeyword */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 213 /* ForOfStatement */: - return context.currentTokenSpan.kind === 140 /* OfKeyword */ || context.nextTokenSpan.kind === 140 /* OfKeyword */; + case 215 /* ForOfStatement */: + return context.currentTokenSpan.kind === 141 /* OfKeyword */ || context.nextTokenSpan.kind === 141 /* OfKeyword */; } return false; }; @@ -75071,7 +80956,7 @@ var ts; return !Rules.IsBinaryOpContext(context); }; Rules.IsConditionalOperatorContext = function (context) { - return context.contextNode.kind === 193 /* ConditionalExpression */; + return context.contextNode.kind === 194 /* ConditionalExpression */; }; Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { //// This check is mainly used inside SpaceBeforeOpenBraceInControl and SpaceBeforeOpenBraceInFunction. @@ -75092,6 +80977,9 @@ var ts; //// * ) and { are on different lines. We only need to format if the block is multiline context. So in this case we format. return context.TokensAreOnSameLine() || Rules.IsBeforeMultilineBlockContext(context); }; + Rules.IsBraceWrappedContext = function (context) { + return context.contextNode.kind === 173 /* ObjectBindingPattern */ || Rules.IsSingleLineBlockContext(context); + }; // This check is done before an open brace in a control construct, a function, or a typescript block declaration Rules.IsBeforeMultilineBlockContext = function (context) { return Rules.IsBeforeBlockContext(context) && !(context.NextNodeAllOnSameLine() || context.NextNodeBlockIsOnOneLine()); @@ -75115,97 +81003,103 @@ var ts; return true; } switch (node.kind) { - case 204 /* Block */: - case 232 /* CaseBlock */: - case 176 /* ObjectLiteralExpression */: - case 231 /* ModuleBlock */: + case 206 /* Block */: + case 234 /* CaseBlock */: + case 177 /* ObjectLiteralExpression */: + case 233 /* ModuleBlock */: return true; } return false; }; Rules.IsFunctionDeclContext = function (context) { switch (context.contextNode.kind) { - case 225 /* FunctionDeclaration */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 227 /* FunctionDeclaration */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: // case SyntaxKind.MemberFunctionDeclaration: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: // case SyntaxKind.MethodSignature: - case 153 /* CallSignature */: - case 184 /* FunctionExpression */: - case 150 /* Constructor */: - case 185 /* ArrowFunction */: + case 154 /* CallSignature */: + case 185 /* FunctionExpression */: + case 151 /* Constructor */: + case 186 /* ArrowFunction */: // case SyntaxKind.ConstructorDeclaration: // case SyntaxKind.SimpleArrowFunctionExpression: // case SyntaxKind.ParenthesizedArrowFunctionExpression: - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: return true; } return false; }; Rules.IsFunctionDeclarationOrFunctionExpressionContext = function (context) { - return context.contextNode.kind === 225 /* FunctionDeclaration */ || context.contextNode.kind === 184 /* FunctionExpression */; + return context.contextNode.kind === 227 /* FunctionDeclaration */ || context.contextNode.kind === 185 /* FunctionExpression */; }; Rules.IsTypeScriptDeclWithBlockContext = function (context) { return Rules.NodeIsTypeScriptDeclWithBlockContext(context.contextNode); }; Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { switch (node.kind) { - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: - case 229 /* EnumDeclaration */: - case 161 /* TypeLiteral */: - case 230 /* ModuleDeclaration */: - case 241 /* ExportDeclaration */: - case 242 /* NamedExports */: - case 235 /* ImportDeclaration */: - case 238 /* NamedImports */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 229 /* InterfaceDeclaration */: + case 231 /* EnumDeclaration */: + case 162 /* TypeLiteral */: + case 232 /* ModuleDeclaration */: + case 243 /* ExportDeclaration */: + case 244 /* NamedExports */: + case 237 /* ImportDeclaration */: + case 240 /* NamedImports */: return true; } return false; }; Rules.IsAfterCodeBlockContext = function (context) { switch (context.currentTokenParent.kind) { - case 226 /* ClassDeclaration */: - case 230 /* ModuleDeclaration */: - case 229 /* EnumDeclaration */: - case 204 /* Block */: - case 256 /* CatchClause */: - case 231 /* ModuleBlock */: - case 218 /* SwitchStatement */: + case 228 /* ClassDeclaration */: + case 232 /* ModuleDeclaration */: + case 231 /* EnumDeclaration */: + case 259 /* CatchClause */: + case 233 /* ModuleBlock */: + case 220 /* SwitchStatement */: return true; + case 206 /* Block */: { + var blockParent = context.currentTokenParent.parent; + if (blockParent.kind !== 186 /* ArrowFunction */ && + blockParent.kind !== 185 /* FunctionExpression */) { + return true; + } + } } return false; }; Rules.IsControlDeclContext = function (context) { switch (context.contextNode.kind) { - case 208 /* IfStatement */: - case 218 /* SwitchStatement */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 210 /* WhileStatement */: - case 221 /* TryStatement */: - case 209 /* DoStatement */: - case 217 /* WithStatement */: + case 210 /* IfStatement */: + case 220 /* SwitchStatement */: + case 213 /* ForStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: + case 212 /* WhileStatement */: + case 223 /* TryStatement */: + case 211 /* DoStatement */: + case 219 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: - case 256 /* CatchClause */: + case 259 /* CatchClause */: return true; default: return false; } }; Rules.IsObjectContext = function (context) { - return context.contextNode.kind === 176 /* ObjectLiteralExpression */; + return context.contextNode.kind === 177 /* ObjectLiteralExpression */; }; Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind === 179 /* CallExpression */; + return context.contextNode.kind === 180 /* CallExpression */; }; Rules.IsNewContext = function (context) { - return context.contextNode.kind === 180 /* NewExpression */; + return context.contextNode.kind === 181 /* NewExpression */; }; Rules.IsFunctionCallOrNewContext = function (context) { return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); @@ -75217,25 +81111,25 @@ var ts; return context.nextTokenSpan.kind !== 21 /* CloseBracketToken */; }; Rules.IsArrowFunctionContext = function (context) { - return context.contextNode.kind === 185 /* ArrowFunction */; + return context.contextNode.kind === 186 /* ArrowFunction */; }; Rules.IsNonJsxSameLineTokenContext = function (context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 10 /* JsxText */; }; Rules.IsNonJsxElementContext = function (context) { - return context.contextNode.kind !== 246 /* JsxElement */; + return context.contextNode.kind !== 248 /* JsxElement */; }; Rules.IsJsxExpressionContext = function (context) { - return context.contextNode.kind === 252 /* JsxExpression */; + return context.contextNode.kind === 255 /* JsxExpression */; }; Rules.IsNextTokenParentJsxAttribute = function (context) { - return context.nextTokenParent.kind === 250 /* JsxAttribute */; + return context.nextTokenParent.kind === 252 /* JsxAttribute */; }; Rules.IsJsxAttributeContext = function (context) { - return context.contextNode.kind === 250 /* JsxAttribute */; + return context.contextNode.kind === 252 /* JsxAttribute */; }; Rules.IsJsxSelfClosingElementContext = function (context) { - return context.contextNode.kind === 247 /* JsxSelfClosingElement */; + return context.contextNode.kind === 249 /* JsxSelfClosingElement */; }; Rules.IsNotBeforeBlockInFunctionDeclarationContext = function (context) { return !Rules.IsFunctionDeclContext(context) && !Rules.IsBeforeBlockContext(context); @@ -75250,41 +81144,42 @@ var ts; while (ts.isPartOfExpression(node)) { node = node.parent; } - return node.kind === 145 /* Decorator */; + return node.kind === 146 /* Decorator */; }; Rules.IsStartOfVariableDeclarationList = function (context) { - return context.currentTokenParent.kind === 224 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 226 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; }; Rules.IsNotFormatOnEnter = function (context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; }; Rules.IsModuleDeclContext = function (context) { - return context.contextNode.kind === 230 /* ModuleDeclaration */; + return context.contextNode.kind === 232 /* ModuleDeclaration */; }; Rules.IsObjectTypeContext = function (context) { - return context.contextNode.kind === 161 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 162 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; }; Rules.IsTypeArgumentOrParameterOrAssertion = function (token, parent) { if (token.kind !== 26 /* LessThanToken */ && token.kind !== 28 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 157 /* TypeReference */: - case 182 /* TypeAssertionExpression */: - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 179 /* CallExpression */: - case 180 /* NewExpression */: - case 199 /* ExpressionWithTypeArguments */: + case 158 /* TypeReference */: + case 183 /* TypeAssertionExpression */: + case 230 /* TypeAliasDeclaration */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 229 /* InterfaceDeclaration */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: + case 200 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -75295,13 +81190,16 @@ var ts; Rules.IsTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); }; Rules.IsTypeAssertionContext = function (context) { - return context.contextNode.kind === 182 /* TypeAssertionExpression */; + return context.contextNode.kind === 183 /* TypeAssertionExpression */; }; Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 104 /* VoidKeyword */ && context.currentTokenParent.kind === 188 /* VoidExpression */; + return context.currentTokenSpan.kind === 104 /* VoidKeyword */ && context.currentTokenParent.kind === 189 /* VoidExpression */; }; Rules.IsYieldOrYieldStarWithOperand = function (context) { - return context.contextNode.kind === 195 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 196 /* YieldExpression */ && context.contextNode.expression !== undefined; + }; + Rules.IsNonNullAssertionContext = function (context) { + return context.contextNode.kind === 202 /* NonNullExpression */; }; return Rules; }()); @@ -75325,7 +81223,7 @@ var ts; return result; }; RulesMap.prototype.Initialize = function (rules) { - this.mapRowLength = 140 /* LastToken */ + 1; + this.mapRowLength = 141 /* LastToken */ + 1; this.map = new Array(this.mapRowLength * this.mapRowLength); // new Array(this.mapRowLength * this.mapRowLength); // This array is used only during construction of the rulesbucket in the map var rulesBucketConstructionStateList = new Array(this.map.length); // new Array(this.map.length); @@ -75339,7 +81237,7 @@ var ts; }); }; RulesMap.prototype.GetRuleBucketIndex = function (row, column) { - ts.Debug.assert(row <= 140 /* LastKeyword */ && column <= 140 /* LastKeyword */, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 141 /* LastKeyword */ && column <= 141 /* LastKeyword */, "Must compute formatting context from tokens"); var rulesBucketIndex = (row * this.mapRowLength) + column; return rulesBucketIndex; }; @@ -75520,7 +81418,7 @@ var ts; } TokenAllAccess.prototype.GetTokens = function () { var result = []; - for (var token = 0 /* FirstToken */; token <= 140 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 141 /* LastToken */; token++) { result.push(token); } return result; @@ -75564,9 +81462,9 @@ var ts; }()); TokenRange.Any = TokenRange.AllTokens(); TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3 /* MultiLineCommentTrivia */])); - TokenRange.Keywords = TokenRange.FromRange(71 /* FirstKeyword */, 140 /* LastKeyword */); + TokenRange.Keywords = TokenRange.FromRange(71 /* FirstKeyword */, 141 /* LastKeyword */); TokenRange.BinaryOperators = TokenRange.FromRange(26 /* FirstBinaryOperator */, 69 /* LastBinaryOperator */); - TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([91 /* InKeyword */, 92 /* InstanceOfKeyword */, 140 /* OfKeyword */, 117 /* AsKeyword */, 125 /* IsKeyword */]); + TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([91 /* InKeyword */, 92 /* InstanceOfKeyword */, 141 /* OfKeyword */, 117 /* AsKeyword */, 125 /* IsKeyword */]); TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([42 /* PlusPlusToken */, 43 /* MinusMinusToken */, 51 /* TildeToken */, 50 /* ExclamationToken */]); TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([8 /* NumericLiteral */, 70 /* Identifier */, 18 /* OpenParenToken */, 20 /* OpenBracketToken */, 16 /* OpenBraceToken */, 98 /* ThisKeyword */, 93 /* NewKeyword */]); TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([70 /* Identifier */, 18 /* OpenParenToken */, 98 /* ThisKeyword */, 93 /* NewKeyword */]); @@ -75574,7 +81472,7 @@ var ts; TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([70 /* Identifier */, 18 /* OpenParenToken */, 98 /* ThisKeyword */, 93 /* NewKeyword */]); TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([70 /* Identifier */, 19 /* CloseParenToken */, 21 /* CloseBracketToken */, 93 /* NewKeyword */]); TokenRange.Comments = TokenRange.FromTokens([2 /* SingleLineCommentTrivia */, 3 /* MultiLineCommentTrivia */]); - TokenRange.TypeNames = TokenRange.FromTokens([70 /* Identifier */, 132 /* NumberKeyword */, 134 /* StringKeyword */, 121 /* BooleanKeyword */, 135 /* SymbolKeyword */, 104 /* VoidKeyword */, 118 /* AnyKeyword */]); + TokenRange.TypeNames = TokenRange.FromTokens([70 /* Identifier */, 132 /* NumberKeyword */, 135 /* StringKeyword */, 121 /* BooleanKeyword */, 136 /* SymbolKeyword */, 104 /* VoidKeyword */, 118 /* AnyKeyword */]); Shared.TokenRange = TokenRange; })(Shared = formatting.Shared || (formatting.Shared = {})); })(formatting = ts.formatting || (ts.formatting = {})); @@ -75610,6 +81508,9 @@ var ts; RulesProvider.prototype.getRulesMap = function () { return this.rulesMap; }; + RulesProvider.prototype.getFormatOptions = function () { + return this.options; + }; RulesProvider.prototype.ensureUpToDate = function (options) { if (!this.options || !ts.compareDataObjects(this.options, options)) { var activeRules = this.createActiveRules(options); @@ -75621,6 +81522,12 @@ var ts; }; RulesProvider.prototype.createActiveRules = function (options) { var rules = this.globalRules.HighPriorityCommonRules.slice(0); + if (options.insertSpaceAfterConstructor) { + rules.push(this.globalRules.SpaceAfterConstructor); + } + else { + rules.push(this.globalRules.NoSpaceAfterConstructor); + } if (options.insertSpaceAfterCommaDelimiter) { rules.push(this.globalRules.SpaceAfterComma); } @@ -75701,6 +81608,12 @@ var ts; rules.push(this.globalRules.NoSpaceBeforeBinaryOperator); rules.push(this.globalRules.NoSpaceAfterBinaryOperator); } + if (options.insertSpaceBeforeFunctionParenthesis) { + rules.push(this.globalRules.SpaceBeforeOpenParenInFuncDecl); + } + else { + rules.push(this.globalRules.NoSpaceBeforeOpenParenInFuncDecl); + } if (options.placeOpenBraceOnNewLineForControlBlocks) { rules.push(this.globalRules.NewLineBeforeOpenBraceInControl); } @@ -75833,17 +81746,17 @@ var ts; // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: + case 228 /* ClassDeclaration */: + case 229 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: var body = parent.body; - return body && body.kind === 231 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); - case 261 /* SourceFile */: - case 204 /* Block */: - case 231 /* ModuleBlock */: + return body && body.kind === 233 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); + case 264 /* SourceFile */: + case 206 /* Block */: + case 233 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 256 /* CatchClause */: + case 259 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -75863,9 +81776,9 @@ var ts; } } /** formatting is not applied to ranges that contain parse errors. - * This function will return a predicate that for a given text range will tell - * if there are any parse errors that overlap with the range. - */ + * This function will return a predicate that for a given text range will tell + * if there are any parse errors that overlap with the range. + */ function prepareRangeContainsErrorFunction(errors, originalRange) { if (!errors.length) { return rangeHasNoErrors; @@ -75903,10 +81816,10 @@ var ts; } } /** - * Start of the original range might fall inside the comment - scanner will not yield appropriate results - * This function will look for token that is located before the start of target range - * and return its end as start position for the scanner. - */ + * Start of the original range might fall inside the comment - scanner will not yield appropriate results + * This function will look for token that is located before the start of target range + * and return its end as start position for the scanner. + */ function getScanStartPosition(enclosingNode, originalRange, sourceFile) { var start = enclosingNode.getStart(sourceFile); if (start === originalRange.pos && enclosingNode.end === originalRange.end) { @@ -75956,14 +81869,21 @@ var ts; } return 0; } + /* @internal */ + function formatNode(node, sourceFileLike, languageVariant, initialIndentation, delta, rulesProvider) { + var range = { pos: 0, end: sourceFileLike.text.length }; + return formatSpanWorker(range, node, initialIndentation, delta, formatting.getFormattingScanner(sourceFileLike.text, languageVariant, range.pos, range.end), rulesProvider.getFormatOptions(), rulesProvider, 1 /* FormatSelection */, function (_) { return false; }, // assume that node does not have any errors + sourceFileLike); + } + formatting.formatNode = formatNode; function formatSpan(originalRange, sourceFile, options, rulesProvider, requestKind) { - var rangeContainsError = prepareRangeContainsErrorFunction(sourceFile.parseDiagnostics, originalRange); - // formatting context is used by rules provider - var formattingContext = new formatting.FormattingContext(sourceFile, requestKind); // find the smallest node that fully wraps the range and compute the initial indentation for the node var enclosingNode = findEnclosingNode(originalRange, sourceFile); - var formattingScanner = formatting.getFormattingScanner(sourceFile, getScanStartPosition(enclosingNode, originalRange, sourceFile), originalRange.end); - var initialIndentation = formatting.SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, options); + return formatSpanWorker(originalRange, enclosingNode, formatting.SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, options), getOwnOrInheritedDelta(enclosingNode, options, sourceFile), formatting.getFormattingScanner(sourceFile.text, sourceFile.languageVariant, getScanStartPosition(enclosingNode, originalRange, sourceFile), originalRange.end), options, rulesProvider, requestKind, prepareRangeContainsErrorFunction(sourceFile.parseDiagnostics, originalRange), sourceFile); + } + function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delta, formattingScanner, options, rulesProvider, requestKind, rangeContainsError, sourceFile) { + // formatting context is used by rules provider + var formattingContext = new formatting.FormattingContext(sourceFile, requestKind); var previousRangeHasError; var previousRange; var previousParent; @@ -75978,13 +81898,12 @@ var ts; if (enclosingNode.decorators) { undecoratedStartLine = sourceFile.getLineAndCharacterOfPosition(ts.getNonDecoratorTokenPosOfNode(enclosingNode, sourceFile)).line; } - var delta = getOwnOrInheritedDelta(enclosingNode, options, sourceFile); processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta); } if (!formattingScanner.isOnToken()) { var leadingTrivia = formattingScanner.getCurrentLeadingTrivia(); if (leadingTrivia) { - processTrivia(leadingTrivia, enclosingNode, enclosingNode, undefined); + processTrivia(leadingTrivia, enclosingNode, enclosingNode, /*dynamicIndentation*/ undefined); trimTrailingWhitespacesForRemainingRange(); } } @@ -75992,12 +81911,12 @@ var ts; return edits; // local functions /** Tries to compute the indentation for a list element. - * If list element is not in range then - * function will pick its actual indentation - * so it can be pushed downstream as inherited indentation. - * If list element is in the range - its indentation will be equal - * to inherited indentation from its predecessors. - */ + * If list element is not in range then + * function will pick its actual indentation + * so it can be pushed downstream as inherited indentation. + * If list element is in the range - its indentation will be equal + * to inherited indentation from its predecessors. + */ function tryComputeIndentationForListItem(startPos, endPos, parentStartLine, range, inheritedIndentation) { if (ts.rangeOverlapsWithStartEnd(range, startPos, endPos) || ts.rangeContainsStartEnd(range, startPos, endPos) /* Not to miss zero-range nodes e.g. JsxText */) { @@ -76048,20 +81967,19 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 226 /* ClassDeclaration */: return 74 /* ClassKeyword */; - case 227 /* InterfaceDeclaration */: return 108 /* InterfaceKeyword */; - case 225 /* FunctionDeclaration */: return 88 /* FunctionKeyword */; - case 229 /* EnumDeclaration */: return 229 /* EnumDeclaration */; - case 151 /* GetAccessor */: return 124 /* GetKeyword */; - case 152 /* SetAccessor */: return 133 /* SetKeyword */; - case 149 /* MethodDeclaration */: + case 228 /* ClassDeclaration */: return 74 /* ClassKeyword */; + case 229 /* InterfaceDeclaration */: return 108 /* InterfaceKeyword */; + case 227 /* FunctionDeclaration */: return 88 /* FunctionKeyword */; + case 231 /* EnumDeclaration */: return 231 /* EnumDeclaration */; + case 152 /* GetAccessor */: return 124 /* GetKeyword */; + case 153 /* SetAccessor */: return 134 /* SetKeyword */; + case 150 /* MethodDeclaration */: if (node.asteriskToken) { return 38 /* AsteriskToken */; - } /* - fall-through - */ - case 147 /* PropertyDeclaration */: - case 144 /* Parameter */: + } + // falls through + case 148 /* PropertyDeclaration */: + case 145 /* Parameter */: return node.name.kind; } } @@ -76091,18 +82009,31 @@ var ts; // open and close brace, 'else' and 'while' (in do statement) tokens has indentation of the parent case 16 /* OpenBraceToken */: case 17 /* CloseBraceToken */: - case 20 /* OpenBracketToken */: - case 21 /* CloseBracketToken */: case 18 /* OpenParenToken */: case 19 /* CloseParenToken */: case 81 /* ElseKeyword */: case 105 /* WhileKeyword */: case 56 /* AtToken */: return indentation; - default: - // if token line equals to the line of containing node (this is a first token in the node) - use node indentation - return nodeStartLine !== line ? indentation + getEffectiveDelta(delta, container) : indentation; + case 40 /* SlashToken */: + case 28 /* GreaterThanToken */: { + if (container.kind === 250 /* JsxOpeningElement */ || + container.kind === 251 /* JsxClosingElement */ || + container.kind === 249 /* JsxSelfClosingElement */) { + return indentation; + } + break; + } + case 20 /* OpenBracketToken */: + case 21 /* CloseBracketToken */: { + if (container.kind !== 171 /* MappedType */) { + return indentation; + } + break; + } } + // if token line equals to the line of containing node (this is a first token in the node) - use node indentation + return nodeStartLine !== line ? indentation + getEffectiveDelta(delta, container) : indentation; }, getIndentation: function () { return indentation; }, getDelta: function (child) { return getEffectiveDelta(delta, child); }, @@ -76125,7 +82056,7 @@ var ts; }; function getEffectiveDelta(delta, child) { // Delta value should be zero when the node explicitly prevents indentation of the child node - return formatting.SmartIndenter.nodeWillIndentChild(node, child, true) ? delta : 0; + return formatting.SmartIndenter.nodeWillIndentChild(node, child, /*indentByDefault*/ true) ? delta : 0; } } function processNode(node, contextNode, nodeStartLine, undecoratedNodeStartLine, indentation, delta) { @@ -76158,7 +82089,7 @@ var ts; if (tokenInfo.token.end > node.end) { break; } - consumeTokenAndAdvanceScanner(tokenInfo, node, nodeDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, node, nodeDynamicIndentation, node); } function processChildNode(child, inheritedIndentation, parent, parentDynamicIndentation, parentStartLine, undecoratedParentStartLine, isListItem, isFirstListItem) { var childStartPos = child.getStart(sourceFile); @@ -76192,7 +82123,7 @@ var ts; // stop when formatting scanner advances past the beginning of the child break; } - consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, node); } if (!formattingScanner.isOnToken()) { return inheritedIndentation; @@ -76205,11 +82136,11 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 145 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 146 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); childContextNode = node; - if (isFirstListItem && parent.kind === 175 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent.kind === 176 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -76232,11 +82163,11 @@ var ts; startLine = sourceFile.getLineAndCharacterOfPosition(tokenInfo.token.pos).line; var indentation_1 = computeIndentation(tokenInfo.token, startLine, -1 /* Unknown */, parent, parentDynamicIndentation, parentStartLine); listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, indentation_1.indentation, indentation_1.delta); - consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation, parent); } else { // consume any tokens that precede the list as child elements of 'node' using its indentation scope - consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation, parent); } } } @@ -76254,7 +82185,7 @@ var ts; // without this check close paren will be interpreted as list end token for function expression which is wrong if (tokenInfo.token.kind === listEndToken && ts.rangeContainsRange(parent, tokenInfo.token)) { // consume list end token - consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation, parent); } } } @@ -76461,7 +82392,7 @@ var ts; } // shift all parts on the delta size var delta = indentation - nonWhitespaceColumnInFirstPart.column; - for (var i = startIndex, len = parts.length; i < len; i++, startLine++) { + for (var i = startIndex; i < parts.length; i++, startLine++) { var startLinePos_1 = ts.getStartPositionOfLine(startLine, sourceFile); var nonWhitespaceCharacterAndColumn = i === 0 ? nonWhitespaceColumnInFirstPart @@ -76566,12 +82497,12 @@ var ts; } function getOpenTokenForList(node, list) { switch (node.kind) { - case 150 /* Constructor */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 185 /* ArrowFunction */: + case 151 /* Constructor */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 186 /* ArrowFunction */: if (node.typeParameters === list) { return 26 /* LessThanToken */; } @@ -76579,8 +82510,8 @@ var ts; return 18 /* OpenParenToken */; } break; - case 179 /* CallExpression */: - case 180 /* NewExpression */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: if (node.typeArguments === list) { return 26 /* LessThanToken */; } @@ -76588,7 +82519,7 @@ var ts; return 18 /* OpenParenToken */; } break; - case 157 /* TypeReference */: + case 158 /* TypeReference */: if (node.typeArguments === list) { return 26 /* LessThanToken */; } @@ -76668,7 +82599,20 @@ var ts; (function (Value) { Value[Value["Unknown"] = -1] = "Unknown"; })(Value || (Value = {})); - function getIndentation(position, sourceFile, options) { + /** + * Computed indentation for a given position in source file + * @param position - position in file + * @param sourceFile - target source file + * @param options - set of editor options that control indentation + * @param assumeNewLineBeforeCloseBrace - false when getIndentation is called on the text from the real source file. + * true - when we need to assume that position is on the newline. This is usefult for codefixes, i.e. + * function f() { + * |} + * when inserting some text after open brace we would like to get the value of indentation as if newline was already there. + * However by default indentation at position | will be 0 so 'assumeNewLineBeforeCloseBrace' allows to override this behavior, + */ + function getIndentation(position, sourceFile, options, assumeNewLineBeforeCloseBrace) { + if (assumeNewLineBeforeCloseBrace === void 0) { assumeNewLineBeforeCloseBrace = false; } if (position > sourceFile.text.length) { return getBaseIndentation(options); // past EOF } @@ -76704,7 +82648,7 @@ var ts; var lineStart = ts.getLineStartPositionForPosition(current_1, sourceFile); return SmartIndenter.findFirstNonWhitespaceColumn(lineStart, current_1, sourceFile, options); } - if (precedingToken.kind === 25 /* CommaToken */ && precedingToken.parent.kind !== 192 /* BinaryExpression */) { + if (precedingToken.kind === 25 /* CommaToken */ && precedingToken.parent.kind !== 193 /* BinaryExpression */) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { @@ -76720,8 +82664,10 @@ var ts; while (current) { if (ts.positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current, previous)) { currentStart = getStartLineAndCharacterForNode(current, sourceFile); - if (nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile)) { - indentationDelta = 0; + var nextTokenKind = nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile); + if (nextTokenKind !== 0 /* Unknown */) { + // handle cases when codefix is about to be inserted before the close brace + indentationDelta = assumeNewLineBeforeCloseBrace && nextTokenKind === 2 /* CloseBrace */ ? options.indentSize : 0; } else { indentationDelta = lineAtPosition !== currentStart.line ? options.indentSize : 0; @@ -76827,20 +82773,26 @@ var ts; // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) && - (parent.kind === 261 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 264 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } return findColumnForFirstNonWhitespaceCharacterInLine(currentLineAndChar, sourceFile, options); } + var NextTokenKind; + (function (NextTokenKind) { + NextTokenKind[NextTokenKind["Unknown"] = 0] = "Unknown"; + NextTokenKind[NextTokenKind["OpenBrace"] = 1] = "OpenBrace"; + NextTokenKind[NextTokenKind["CloseBrace"] = 2] = "CloseBrace"; + })(NextTokenKind || (NextTokenKind = {})); function nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile) { var nextToken = ts.findNextToken(precedingToken, current); if (!nextToken) { - return false; + return 0 /* Unknown */; } if (nextToken.kind === 16 /* OpenBraceToken */) { // open braces are always indented at the parent level - return true; + return 1 /* OpenBrace */; } else if (nextToken.kind === 17 /* CloseBraceToken */) { // close braces are indented at the parent level if they are located on the same line with cursor @@ -76852,15 +82804,15 @@ var ts; // class A { // $} var nextTokenStartLine = getStartLineAndCharacterForNode(nextToken, sourceFile).line; - return lineAtPosition === nextTokenStartLine; + return lineAtPosition === nextTokenStartLine ? 2 /* CloseBrace */ : 0 /* Unknown */; } - return false; + return 0 /* Unknown */; } function getStartLineAndCharacterForNode(n, sourceFile) { return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); } function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 208 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 210 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 81 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -76869,53 +82821,49 @@ var ts; return false; } SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement = childStartsOnTheSameLineWithElseInIfStatement; + function getListIfStartEndIsInListRange(list, start, end) { + return list && ts.rangeContainsStartEnd(list, start, end) ? list : undefined; + } function getContainingList(node, sourceFile) { if (node.parent) { switch (node.parent.kind) { - case 157 /* TypeReference */: - if (node.parent.typeArguments && - ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { - return node.parent.typeArguments; - } - break; - case 176 /* ObjectLiteralExpression */: + case 158 /* TypeReference */: + return getListIfStartEndIsInListRange(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd()); + case 177 /* ObjectLiteralExpression */: return node.parent.properties; - case 175 /* ArrayLiteralExpression */: + case 176 /* ArrayLiteralExpression */: return node.parent.elements; - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: { + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 154 /* CallSignature */: + case 151 /* Constructor */: + case 160 /* ConstructorType */: + case 155 /* ConstructSignature */: { var start = node.getStart(sourceFile); - if (node.parent.typeParameters && - ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { - return node.parent.typeParameters; - } - if (ts.rangeContainsStartEnd(node.parent.parameters, start, node.getEnd())) { - return node.parent.parameters; - } - break; + return getListIfStartEndIsInListRange(node.parent.typeParameters, start, node.getEnd()) || + getListIfStartEndIsInListRange(node.parent.parameters, start, node.getEnd()); } - case 180 /* NewExpression */: - case 179 /* CallExpression */: { + case 228 /* ClassDeclaration */: + return getListIfStartEndIsInListRange(node.parent.typeParameters, node.getStart(sourceFile), node.getEnd()); + case 181 /* NewExpression */: + case 180 /* CallExpression */: { var start = node.getStart(sourceFile); - if (node.parent.typeArguments && - ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { - return node.parent.typeArguments; - } - if (node.parent.arguments && - ts.rangeContainsStartEnd(node.parent.arguments, start, node.getEnd())) { - return node.parent.arguments; - } - break; + return getListIfStartEndIsInListRange(node.parent.typeArguments, start, node.getEnd()) || + getListIfStartEndIsInListRange(node.parent.arguments, start, node.getEnd()); } + case 226 /* VariableDeclarationList */: + return getListIfStartEndIsInListRange(node.parent.declarations, node.getStart(sourceFile), node.getEnd()); + case 240 /* NamedImports */: + case 244 /* NamedExports */: + return getListIfStartEndIsInListRange(node.parent.elements, node.getStart(sourceFile), node.getEnd()); } } return undefined; } + SmartIndenter.getContainingList = getContainingList; function getActualIndentationForListItem(node, sourceFile, options) { var containingList = getContainingList(node, sourceFile); return containingList ? getActualIndentationFromList(containingList) : -1 /* Unknown */; @@ -76930,8 +82878,8 @@ var ts; if (node.kind === 19 /* CloseParenToken */) { return -1 /* Unknown */; } - if (node.parent && (node.parent.kind === 179 /* CallExpression */ || - node.parent.kind === 180 /* NewExpression */) && + if (node.parent && (node.parent.kind === 180 /* CallExpression */ || + node.parent.kind === 181 /* NewExpression */) && node.parent.expression !== node) { var fullCallOrNewExpression = node.parent.expression; var startingExpression = getStartingExpression(fullCallOrNewExpression); @@ -76949,10 +82897,10 @@ var ts; function getStartingExpression(node) { while (true) { switch (node.kind) { - case 179 /* CallExpression */: - case 180 /* NewExpression */: - case 177 /* PropertyAccessExpression */: - case 178 /* ElementAccessExpression */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: + case 178 /* PropertyAccessExpression */: + case 179 /* ElementAccessExpression */: node = node.expression; break; default: @@ -77016,48 +82964,49 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 207 /* ExpressionStatement */: - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: - case 229 /* EnumDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 175 /* ArrayLiteralExpression */: - case 204 /* Block */: - case 231 /* ModuleBlock */: - case 176 /* ObjectLiteralExpression */: - case 161 /* TypeLiteral */: - case 163 /* TupleType */: - case 232 /* CaseBlock */: - case 254 /* DefaultClause */: - case 253 /* CaseClause */: - case 183 /* ParenthesizedExpression */: - case 177 /* PropertyAccessExpression */: - case 179 /* CallExpression */: - case 180 /* NewExpression */: - case 205 /* VariableStatement */: - case 223 /* VariableDeclaration */: - case 240 /* ExportAssignment */: - case 216 /* ReturnStatement */: - case 193 /* ConditionalExpression */: - case 173 /* ArrayBindingPattern */: - case 172 /* ObjectBindingPattern */: - case 248 /* JsxOpeningElement */: - case 247 /* JsxSelfClosingElement */: - case 252 /* JsxExpression */: - case 148 /* MethodSignature */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 144 /* Parameter */: - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 166 /* ParenthesizedType */: - case 181 /* TaggedTemplateExpression */: - case 189 /* AwaitExpression */: - case 242 /* NamedExports */: - case 238 /* NamedImports */: - case 243 /* ExportSpecifier */: - case 239 /* ImportSpecifier */: + case 209 /* ExpressionStatement */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 229 /* InterfaceDeclaration */: + case 231 /* EnumDeclaration */: + case 230 /* TypeAliasDeclaration */: + case 176 /* ArrayLiteralExpression */: + case 206 /* Block */: + case 233 /* ModuleBlock */: + case 177 /* ObjectLiteralExpression */: + case 162 /* TypeLiteral */: + case 171 /* MappedType */: + case 164 /* TupleType */: + case 234 /* CaseBlock */: + case 257 /* DefaultClause */: + case 256 /* CaseClause */: + case 184 /* ParenthesizedExpression */: + case 178 /* PropertyAccessExpression */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: + case 207 /* VariableStatement */: + case 225 /* VariableDeclaration */: + case 242 /* ExportAssignment */: + case 218 /* ReturnStatement */: + case 194 /* ConditionalExpression */: + case 174 /* ArrayBindingPattern */: + case 173 /* ObjectBindingPattern */: + case 250 /* JsxOpeningElement */: + case 249 /* JsxSelfClosingElement */: + case 255 /* JsxExpression */: + case 149 /* MethodSignature */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 145 /* Parameter */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: + case 167 /* ParenthesizedType */: + case 182 /* TaggedTemplateExpression */: + case 190 /* AwaitExpression */: + case 244 /* NamedExports */: + case 240 /* NamedImports */: + case 245 /* ExportSpecifier */: + case 241 /* ImportSpecifier */: return true; } return false; @@ -77066,27 +83015,27 @@ var ts; function nodeWillIndentChild(parent, child, indentByDefault) { var childKind = child ? child.kind : 0 /* Unknown */; switch (parent.kind) { - case 209 /* DoStatement */: - case 210 /* WhileStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 211 /* ForStatement */: - case 208 /* IfStatement */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 149 /* MethodDeclaration */: - case 185 /* ArrowFunction */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - return childKind !== 204 /* Block */; - case 241 /* ExportDeclaration */: - return childKind !== 242 /* NamedExports */; - case 235 /* ImportDeclaration */: - return childKind !== 236 /* ImportClause */ || - (child.namedBindings && child.namedBindings.kind !== 238 /* NamedImports */); - case 246 /* JsxElement */: - return childKind !== 249 /* JsxClosingElement */; + case 211 /* DoStatement */: + case 212 /* WhileStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: + case 213 /* ForStatement */: + case 210 /* IfStatement */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 150 /* MethodDeclaration */: + case 186 /* ArrowFunction */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + return childKind !== 206 /* Block */; + case 243 /* ExportDeclaration */: + return childKind !== 244 /* NamedExports */; + case 237 /* ImportDeclaration */: + return childKind !== 238 /* ImportClause */ || + (child.namedBindings && child.namedBindings.kind !== 240 /* NamedImports */); + case 248 /* JsxElement */: + return childKind !== 251 /* JsxClosingElement */; } // No explicit rule for given nodes so the result will follow the default value argument return indentByDefault; @@ -77104,10 +83053,589 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var textChanges; + (function (textChanges) { + /** + * Currently for simplicity we store recovered positions on the node itself. + * It can be changed to side-table later if we decide that current design is too invasive. + */ + function getPos(n) { + return n["__pos"]; + } + function setPos(n, pos) { + n["__pos"] = pos; + } + function getEnd(n) { + return n["__end"]; + } + function setEnd(n, end) { + n["__end"] = end; + } + var Position; + (function (Position) { + Position[Position["FullStart"] = 0] = "FullStart"; + Position[Position["Start"] = 1] = "Start"; + })(Position = textChanges.Position || (textChanges.Position = {})); + function skipWhitespacesAndLineBreaks(text, start) { + return ts.skipTrivia(text, start, /*stopAfterLineBreak*/ false, /*stopAtComments*/ true); + } + function hasCommentsBeforeLineBreak(text, start) { + var i = start; + while (i < text.length) { + var ch = text.charCodeAt(i); + if (ts.isWhiteSpaceSingleLine(ch)) { + i++; + continue; + } + return ch === 47 /* slash */; + } + return false; + } + function getSeparatorCharacter(separator) { + return ts.tokenToString(separator.kind); + } + textChanges.getSeparatorCharacter = getSeparatorCharacter; + function getAdjustedStartPosition(sourceFile, node, options, position) { + if (options.useNonAdjustedStartPosition) { + return node.getFullStart(); + } + var fullStart = node.getFullStart(); + var start = node.getStart(sourceFile); + if (fullStart === start) { + return start; + } + var fullStartLine = ts.getLineStartPositionForPosition(fullStart, sourceFile); + var startLine = ts.getLineStartPositionForPosition(start, sourceFile); + if (startLine === fullStartLine) { + // full start and start of the node are on the same line + // a, b; + // ^ ^ + // | start + // fullstart + // when b is replaced - we usually want to keep the leading trvia + // when b is deleted - we delete it + return position === Position.Start ? start : fullStart; + } + // get start position of the line following the line that contains fullstart position + var adjustedStartPosition = ts.getStartPositionOfLine(ts.getLineOfLocalPosition(sourceFile, fullStartLine) + 1, sourceFile); + // skip whitespaces/newlines + adjustedStartPosition = skipWhitespacesAndLineBreaks(sourceFile.text, adjustedStartPosition); + return ts.getStartPositionOfLine(ts.getLineOfLocalPosition(sourceFile, adjustedStartPosition), sourceFile); + } + textChanges.getAdjustedStartPosition = getAdjustedStartPosition; + function getAdjustedEndPosition(sourceFile, node, options) { + if (options.useNonAdjustedEndPosition) { + return node.getEnd(); + } + var end = node.getEnd(); + var newEnd = ts.skipTrivia(sourceFile.text, end, /*stopAfterLineBreak*/ true); + // check if last character before newPos is linebreak + // if yes - considered all skipped trivia to be trailing trivia of the node + return newEnd !== end && ts.isLineBreak(sourceFile.text.charCodeAt(newEnd - 1)) + ? newEnd + : end; + } + textChanges.getAdjustedEndPosition = getAdjustedEndPosition; + /** + * Checks if 'candidate' argument is a legal separator in the list that contains 'node' as an element + */ + function isSeparator(node, candidate) { + return candidate && node.parent && (candidate.kind === 25 /* CommaToken */ || (candidate.kind === 24 /* SemicolonToken */ && node.parent.kind === 177 /* ObjectLiteralExpression */)); + } + function spaces(count) { + var s = ""; + for (var i = 0; i < count; i++) { + s += " "; + } + return s; + } + var ChangeTracker = (function () { + function ChangeTracker(newLine, rulesProvider, validator) { + this.newLine = newLine; + this.rulesProvider = rulesProvider; + this.validator = validator; + this.changes = []; + this.newLineCharacter = ts.getNewLineCharacter({ newLine: newLine }); + } + ChangeTracker.fromCodeFixContext = function (context) { + return new ChangeTracker(context.newLineCharacter === "\n" ? 1 /* LineFeed */ : 0 /* CarriageReturnLineFeed */, context.rulesProvider); + }; + ChangeTracker.prototype.deleteNode = function (sourceFile, node, options) { + if (options === void 0) { options = {}; } + var startPosition = getAdjustedStartPosition(sourceFile, node, options, Position.FullStart); + var endPosition = getAdjustedEndPosition(sourceFile, node, options); + this.changes.push({ sourceFile: sourceFile, options: options, range: { pos: startPosition, end: endPosition } }); + return this; + }; + ChangeTracker.prototype.deleteRange = function (sourceFile, range) { + this.changes.push({ sourceFile: sourceFile, range: range }); + return this; + }; + ChangeTracker.prototype.deleteNodeRange = function (sourceFile, startNode, endNode, options) { + if (options === void 0) { options = {}; } + var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.FullStart); + var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); + this.changes.push({ sourceFile: sourceFile, options: options, range: { pos: startPosition, end: endPosition } }); + return this; + }; + ChangeTracker.prototype.deleteNodeInList = function (sourceFile, node) { + var containingList = ts.formatting.SmartIndenter.getContainingList(node, sourceFile); + if (!containingList) { + ts.Debug.fail("node is not a list element"); + return this; + } + var index = containingList.indexOf(node); + if (index < 0) { + return this; + } + if (containingList.length === 1) { + this.deleteNode(sourceFile, node); + return this; + } + if (index !== containingList.length - 1) { + var nextToken = ts.getTokenAtPosition(sourceFile, node.end); + if (nextToken && isSeparator(node, nextToken)) { + // find first non-whitespace position in the leading trivia of the node + var startPosition = ts.skipTrivia(sourceFile.text, getAdjustedStartPosition(sourceFile, node, {}, Position.FullStart), /*stopAfterLineBreak*/ false, /*stopAtComments*/ true); + var nextElement = containingList[index + 1]; + /// find first non-whitespace position in the leading trivia of the next node + var endPosition = ts.skipTrivia(sourceFile.text, getAdjustedStartPosition(sourceFile, nextElement, {}, Position.FullStart), /*stopAfterLineBreak*/ false, /*stopAtComments*/ true); + // shift next node so its first non-whitespace position will be moved to the first non-whitespace position of the deleted node + this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); + } + } + else { + var previousToken = ts.getTokenAtPosition(sourceFile, containingList[index - 1].end); + if (previousToken && isSeparator(node, previousToken)) { + this.deleteNodeRange(sourceFile, previousToken, node); + } + } + return this; + }; + ChangeTracker.prototype.replaceRange = function (sourceFile, range, newNode, options) { + if (options === void 0) { options = {}; } + this.changes.push({ sourceFile: sourceFile, range: range, options: options, node: newNode }); + return this; + }; + ChangeTracker.prototype.replaceNode = function (sourceFile, oldNode, newNode, options) { + if (options === void 0) { options = {}; } + var startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); + var endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); + this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: endPosition } }); + return this; + }; + ChangeTracker.prototype.replaceNodeRange = function (sourceFile, startNode, endNode, newNode, options) { + if (options === void 0) { options = {}; } + var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); + var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); + this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: endPosition } }); + return this; + }; + ChangeTracker.prototype.insertNodeAt = function (sourceFile, pos, newNode, options) { + if (options === void 0) { options = {}; } + this.changes.push({ sourceFile: sourceFile, options: options, node: newNode, range: { pos: pos, end: pos } }); + return this; + }; + ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, options) { + if (options === void 0) { options = {}; } + var startPosition = getAdjustedStartPosition(sourceFile, before, options, Position.Start); + this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: startPosition } }); + return this; + }; + ChangeTracker.prototype.insertNodeAfter = function (sourceFile, after, newNode, options) { + if (options === void 0) { options = {}; } + if ((ts.isStatementButNotDeclaration(after)) || + after.kind === 148 /* PropertyDeclaration */ || + after.kind === 147 /* PropertySignature */ || + after.kind === 149 /* MethodSignature */) { + // check if previous statement ends with semicolon + // if not - insert semicolon to preserve the code from changing the meaning due to ASI + if (sourceFile.text.charCodeAt(after.end - 1) !== 59 /* semicolon */) { + this.changes.push({ + sourceFile: sourceFile, + options: {}, + range: { pos: after.end, end: after.end }, + node: ts.createToken(24 /* SemicolonToken */) + }); + } + } + var endPosition = getAdjustedEndPosition(sourceFile, after, options); + this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: endPosition, end: endPosition } }); + return this; + }; + /** + * This function should be used to insert nodes in lists when nodes don't carry separators as the part of the node range, + * i.e. arguments in arguments lists, parameters in parameter lists etc. + * Note that separators are part of the node in statements and class elements. + */ + ChangeTracker.prototype.insertNodeInListAfter = function (sourceFile, after, newNode) { + var containingList = ts.formatting.SmartIndenter.getContainingList(after, sourceFile); + if (!containingList) { + ts.Debug.fail("node is not a list element"); + return this; + } + var index = containingList.indexOf(after); + if (index < 0) { + return this; + } + var end = after.getEnd(); + if (index !== containingList.length - 1) { + // any element except the last one + // use next sibling as an anchor + var nextToken = ts.getTokenAtPosition(sourceFile, after.end); + if (nextToken && isSeparator(after, nextToken)) { + // for list + // a, b, c + // create change for adding 'e' after 'a' as + // - find start of next element after a (it is b) + // - use this start as start and end position in final change + // - build text of change by formatting the text of node + separator + whitespace trivia of b + // in multiline case it will work as + // a, + // b, + // c, + // result - '*' denotes leading trivia that will be inserted after new text (displayed as '#') + // a,* + // ***insertedtext# + // ###b, + // c, + // find line and character of the next element + var lineAndCharOfNextElement = ts.getLineAndCharacterOfPosition(sourceFile, skipWhitespacesAndLineBreaks(sourceFile.text, containingList[index + 1].getFullStart())); + // find line and character of the token that precedes next element (usually it is separator) + var lineAndCharOfNextToken = ts.getLineAndCharacterOfPosition(sourceFile, nextToken.end); + var prefix = void 0; + var startPos = void 0; + if (lineAndCharOfNextToken.line === lineAndCharOfNextElement.line) { + // next element is located on the same line with separator: + // a,$$$$b + // ^ ^ + // | |-next element + // |-separator + // where $$$ is some leading trivia + // for a newly inserted node we'll maintain the same relative position comparing to separator and replace leading trivia with spaces + // a, x,$$$$b + // ^ ^ ^ + // | | |-next element + // | |-new inserted node padded with spaces + // |-separator + startPos = nextToken.end; + prefix = spaces(lineAndCharOfNextElement.character - lineAndCharOfNextToken.character); + } + else { + // next element is located on different line that separator + // let insert position be the beginning of the line that contains next element + startPos = ts.getStartPositionOfLine(lineAndCharOfNextElement.line, sourceFile); + } + this.changes.push({ + sourceFile: sourceFile, + range: { pos: startPos, end: containingList[index + 1].getStart(sourceFile) }, + node: newNode, + useIndentationFromFile: true, + options: { + prefix: prefix, + // write separator and leading trivia of the next element as suffix + suffix: "" + ts.tokenToString(nextToken.kind) + sourceFile.text.substring(nextToken.end, containingList[index + 1].getStart(sourceFile)) + } + }); + } + } + else { + var afterStart = after.getStart(sourceFile); + var afterStartLinePosition = ts.getLineStartPositionForPosition(afterStart, sourceFile); + var separator = void 0; + var multilineList = false; + // insert element after the last element in the list that has more than one item + // pick the element preceding the after element to: + // - pick the separator + // - determine if list is a multiline + if (containingList.length === 1) { + // if list has only one element then we'll format is as multiline if node has comment in trailing trivia, or as singleline otherwise + // i.e. var x = 1 // this is x + // | new element will be inserted at this position + separator = 25 /* CommaToken */; + } + else { + // element has more than one element, pick separator from the list + var tokenBeforeInsertPosition = ts.findPrecedingToken(after.pos, sourceFile); + separator = isSeparator(after, tokenBeforeInsertPosition) ? tokenBeforeInsertPosition.kind : 25 /* CommaToken */; + // determine if list is multiline by checking lines of after element and element that precedes it. + var afterMinusOneStartLinePosition = ts.getLineStartPositionForPosition(containingList[index - 1].getStart(sourceFile), sourceFile); + multilineList = afterMinusOneStartLinePosition !== afterStartLinePosition; + } + if (hasCommentsBeforeLineBreak(sourceFile.text, after.end)) { + // in this case we'll always treat containing list as multiline + multilineList = true; + } + if (multilineList) { + // insert separator immediately following the 'after' node to preserve comments in trailing trivia + this.changes.push({ + sourceFile: sourceFile, + range: { pos: end, end: end }, + node: ts.createToken(separator), + options: {} + }); + // use the same indentation as 'after' item + var indentation = ts.formatting.SmartIndenter.findFirstNonWhitespaceColumn(afterStartLinePosition, afterStart, sourceFile, this.rulesProvider.getFormatOptions()); + // insert element before the line break on the line that contains 'after' element + var insertPos = ts.skipTrivia(sourceFile.text, end, /*stopAfterLineBreak*/ true, /*stopAtComments*/ false); + if (insertPos !== end && ts.isLineBreak(sourceFile.text.charCodeAt(insertPos - 1))) { + insertPos--; + } + this.changes.push({ + sourceFile: sourceFile, + range: { pos: insertPos, end: insertPos }, + node: newNode, + options: { indentation: indentation, prefix: this.newLineCharacter } + }); + } + else { + this.changes.push({ + sourceFile: sourceFile, + range: { pos: end, end: end }, + node: newNode, + options: { prefix: ts.tokenToString(separator) + " " } + }); + } + } + return this; + }; + ChangeTracker.prototype.getChanges = function () { + var _this = this; + var changesPerFile = ts.createFileMap(); + // group changes per file + for (var _i = 0, _a = this.changes; _i < _a.length; _i++) { + var c = _a[_i]; + var changesInFile = changesPerFile.get(c.sourceFile.path); + if (!changesInFile) { + changesPerFile.set(c.sourceFile.path, changesInFile = []); + } + changesInFile.push(c); + } + // convert changes + var fileChangesList = []; + changesPerFile.forEachValue(function (path) { + var changesInFile = changesPerFile.get(path); + var sourceFile = changesInFile[0].sourceFile; + var fileTextChanges = { fileName: sourceFile.fileName, textChanges: [] }; + for (var _i = 0, _a = ChangeTracker.normalize(changesInFile); _i < _a.length; _i++) { + var c = _a[_i]; + fileTextChanges.textChanges.push({ + span: _this.computeSpan(c, sourceFile), + newText: _this.computeNewText(c, sourceFile) + }); + } + fileChangesList.push(fileTextChanges); + }); + return fileChangesList; + }; + ChangeTracker.prototype.computeSpan = function (change, _sourceFile) { + return ts.createTextSpanFromBounds(change.range.pos, change.range.end); + }; + ChangeTracker.prototype.computeNewText = function (change, sourceFile) { + if (!change.node) { + // deletion case + return ""; + } + var options = change.options || {}; + var nonFormattedText = getNonformattedText(change.node, sourceFile, this.newLine); + if (this.validator) { + this.validator(nonFormattedText); + } + var formatOptions = this.rulesProvider.getFormatOptions(); + var pos = change.range.pos; + var posStartsLine = ts.getLineStartPositionForPosition(pos, sourceFile) === pos; + var initialIndentation = change.options.indentation !== undefined + ? change.options.indentation + : change.useIndentationFromFile + ? ts.formatting.SmartIndenter.getIndentation(change.range.pos, sourceFile, formatOptions, posStartsLine || (change.options.prefix === this.newLineCharacter)) + : 0; + var delta = change.options.delta !== undefined + ? change.options.delta + : ts.formatting.SmartIndenter.shouldIndentChildNode(change.node) + ? formatOptions.indentSize + : 0; + var text = applyFormatting(nonFormattedText, sourceFile, initialIndentation, delta, this.rulesProvider); + // strip initial indentation (spaces or tabs) if text will be inserted in the middle of the line + // however keep indentation if it is was forced + text = posStartsLine || change.options.indentation !== undefined ? text : text.replace(/^\s+/, ""); + return (options.prefix || "") + text + (options.suffix || ""); + }; + ChangeTracker.normalize = function (changes) { + // order changes by start position + var normalized = ts.stableSort(changes, function (a, b) { return a.range.pos - b.range.pos; }); + // verify that change intervals do not overlap, except possibly at end points. + for (var i = 0; i < normalized.length - 2; i++) { + ts.Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos); + } + return normalized; + }; + return ChangeTracker; + }()); + textChanges.ChangeTracker = ChangeTracker; + function getNonformattedText(node, sourceFile, newLine) { + var options = { newLine: newLine, target: sourceFile.languageVersion }; + var writer = new Writer(ts.getNewLineCharacter(options)); + var printer = ts.createPrinter(options, writer); + printer.writeNode(3 /* Unspecified */, node, sourceFile, writer); + return { text: writer.getText(), node: assignPositionsToNode(node) }; + } + textChanges.getNonformattedText = getNonformattedText; + function applyFormatting(nonFormattedText, sourceFile, initialIndentation, delta, rulesProvider) { + var lineMap = ts.computeLineStarts(nonFormattedText.text); + var file = { + text: nonFormattedText.text, + lineMap: lineMap, + getLineAndCharacterOfPosition: function (pos) { return ts.computeLineAndCharacterOfPosition(lineMap, pos); } + }; + var changes = ts.formatting.formatNode(nonFormattedText.node, file, sourceFile.languageVariant, initialIndentation, delta, rulesProvider); + return applyChanges(nonFormattedText.text, changes); + } + textChanges.applyFormatting = applyFormatting; + function applyChanges(text, changes) { + for (var i = changes.length - 1; i >= 0; i--) { + var change = changes[i]; + text = "" + text.substring(0, change.span.start) + change.newText + text.substring(ts.textSpanEnd(change.span)); + } + return text; + } + textChanges.applyChanges = applyChanges; + function isTrivia(s) { + return ts.skipTrivia(s, 0) === s.length; + } + var nullTransformationContext = { + enableEmitNotification: ts.noop, + enableSubstitution: ts.noop, + endLexicalEnvironment: function () { return undefined; }, + getCompilerOptions: ts.notImplemented, + getEmitHost: ts.notImplemented, + getEmitResolver: ts.notImplemented, + hoistFunctionDeclaration: ts.noop, + hoistVariableDeclaration: ts.noop, + isEmitNotificationEnabled: ts.notImplemented, + isSubstitutionEnabled: ts.notImplemented, + onEmitNode: ts.noop, + onSubstituteNode: ts.notImplemented, + readEmitHelpers: ts.notImplemented, + requestEmitHelper: ts.noop, + resumeLexicalEnvironment: ts.noop, + startLexicalEnvironment: ts.noop, + suspendLexicalEnvironment: ts.noop + }; + function assignPositionsToNode(node) { + var visited = ts.visitEachChild(node, assignPositionsToNode, nullTransformationContext, assignPositionsToNodeArray, assignPositionsToNode); + // create proxy node for non synthesized nodes + var newNode = ts.nodeIsSynthesized(visited) + ? visited + : (Proxy.prototype = visited, new Proxy()); + newNode.pos = getPos(node); + newNode.end = getEnd(node); + return newNode; + function Proxy() { } + } + function assignPositionsToNodeArray(nodes, visitor, test, start, count) { + var visited = ts.visitNodes(nodes, visitor, test, start, count); + if (!visited) { + return visited; + } + // clone nodearray if necessary + var nodeArray = visited === nodes ? ts.createNodeArray(visited.slice(0)) : visited; + nodeArray.pos = getPos(nodes); + nodeArray.end = getEnd(nodes); + return nodeArray; + } + var Writer = (function () { + function Writer(newLine) { + var _this = this; + this.lastNonTriviaPosition = 0; + this.writer = ts.createTextWriter(newLine); + this.onEmitNode = function (hint, node, printCallback) { + if (node) { + setPos(node, _this.lastNonTriviaPosition); + } + printCallback(hint, node); + if (node) { + setEnd(node, _this.lastNonTriviaPosition); + } + }; + this.onBeforeEmitNodeArray = function (nodes) { + if (nodes) { + setPos(nodes, _this.lastNonTriviaPosition); + } + }; + this.onAfterEmitNodeArray = function (nodes) { + if (nodes) { + setEnd(nodes, _this.lastNonTriviaPosition); + } + }; + } + Writer.prototype.setLastNonTriviaPosition = function (s, force) { + if (force || !isTrivia(s)) { + this.lastNonTriviaPosition = this.writer.getTextPos(); + var i = 0; + while (ts.isWhiteSpace(s.charCodeAt(s.length - i - 1))) { + i++; + } + // trim trailing whitespaces + this.lastNonTriviaPosition -= i; + } + }; + Writer.prototype.write = function (s) { + this.writer.write(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeTextOfNode = function (text, node) { + this.writer.writeTextOfNode(text, node); + }; + Writer.prototype.writeLine = function () { + this.writer.writeLine(); + }; + Writer.prototype.increaseIndent = function () { + this.writer.increaseIndent(); + }; + Writer.prototype.decreaseIndent = function () { + this.writer.decreaseIndent(); + }; + Writer.prototype.getText = function () { + return this.writer.getText(); + }; + Writer.prototype.rawWrite = function (s) { + this.writer.rawWrite(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeLiteral = function (s) { + this.writer.writeLiteral(s); + this.setLastNonTriviaPosition(s, /*force*/ true); + }; + Writer.prototype.getTextPos = function () { + return this.writer.getTextPos(); + }; + Writer.prototype.getLine = function () { + return this.writer.getLine(); + }; + Writer.prototype.getColumn = function () { + return this.writer.getColumn(); + }; + Writer.prototype.getIndent = function () { + return this.writer.getIndent(); + }; + Writer.prototype.isAtStartOfLine = function () { + return this.writer.isAtStartOfLine(); + }; + Writer.prototype.reset = function () { + this.writer.reset(); + this.lastNonTriviaPosition = 0; + }; + return Writer; + }()); + })(textChanges = ts.textChanges || (ts.textChanges = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var codefix; (function (codefix) { - var codeFixes = ts.createMap(); + var codeFixes = []; function registerCodeFix(action) { ts.forEach(action.errorCodes, function (error) { var fixes = codeFixes[error]; @@ -77142,25 +83670,226 @@ var ts; (function (ts) { var codefix; (function (codefix) { - function getOpenBraceEnd(constructor, sourceFile) { - // First token is the open curly, this is where we want to put the 'super' call. - return constructor.body.getFirstToken(sourceFile).getEnd(); - } codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code], - getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start); - if (token.kind !== 122 /* ConstructorKeyword */) { - return undefined; - } - var newPosition = getOpenBraceEnd(token.parent, sourceFile); - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_missing_super_call), - changes: [{ fileName: sourceFile.fileName, textChanges: [{ newText: "super();", span: { start: newPosition, length: 0 } }] }] - }]; - } + errorCodes: [ts.Diagnostics.Class_0_incorrectly_implements_interface_1.code], + getCodeActions: getActionForClassLikeIncorrectImplementsInterface }); + function getActionForClassLikeIncorrectImplementsInterface(context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + var token = ts.getTokenAtPosition(sourceFile, start); + var checker = context.program.getTypeChecker(); + var classDeclaration = ts.getContainingClass(token); + if (!classDeclaration) { + return undefined; + } + var openBrace = ts.getOpenBraceOfClassLike(classDeclaration, sourceFile); + var classType = checker.getTypeAtLocation(classDeclaration); + var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(classDeclaration); + var hasNumericIndexSignature = !!checker.getIndexTypeOfType(classType, 1 /* Number */); + var hasStringIndexSignature = !!checker.getIndexTypeOfType(classType, 0 /* String */); + var result = []; + for (var _i = 0, implementedTypeNodes_2 = implementedTypeNodes; _i < implementedTypeNodes_2.length; _i++) { + var implementedTypeNode = implementedTypeNodes_2[_i]; + // Note that this is ultimately derived from a map indexed by symbol names, + // so duplicates cannot occur. + var implementedType = checker.getTypeAtLocation(implementedTypeNode); + var implementedTypeSymbols = checker.getPropertiesOfType(implementedType); + var nonPrivateMembers = implementedTypeSymbols.filter(function (symbol) { return !(ts.getModifierFlags(symbol.valueDeclaration) & 8 /* Private */); }); + var newNodes = []; + createAndAddMissingIndexSignatureDeclaration(implementedType, 1 /* Number */, hasNumericIndexSignature, newNodes); + createAndAddMissingIndexSignatureDeclaration(implementedType, 0 /* String */, hasStringIndexSignature, newNodes); + newNodes = newNodes.concat(codefix.createMissingMemberNodes(classDeclaration, nonPrivateMembers, checker)); + var message = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_interface_0), [implementedTypeNode.getText()]); + if (newNodes.length > 0) { + pushAction(result, newNodes, message); + } + } + return result; + function createAndAddMissingIndexSignatureDeclaration(type, kind, hasIndexSigOfKind, newNodes) { + if (hasIndexSigOfKind) { + return; + } + var indexInfoOfKind = checker.getIndexInfoOfType(type, kind); + if (!indexInfoOfKind) { + return; + } + var newIndexSignatureDeclaration = checker.indexInfoToIndexSignatureDeclaration(indexInfoOfKind, kind, classDeclaration); + newNodes.push(newIndexSignatureDeclaration); + } + function pushAction(result, newNodes, description) { + var newAction = { + description: description, + changes: codefix.newNodesToChanges(newNodes, openBrace, context) + }; + result.push(newAction); + } + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Property_0_does_not_exist_on_type_1.code], + getCodeActions: getActionsForAddMissingMember + }); + function getActionsForAddMissingMember(context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + // This is the identifier of the missing property. eg: + // this.missing = 1; + // ^^^^^^^ + var token = ts.getTokenAtPosition(sourceFile, start); + if (token.kind !== 70 /* Identifier */) { + return undefined; + } + if (!ts.isPropertyAccessExpression(token.parent) || token.parent.expression.kind !== 98 /* ThisKeyword */) { + return undefined; + } + var classMemberDeclaration = ts.getThisContainer(token, /*includeArrowFunctions*/ false); + if (!ts.isClassElement(classMemberDeclaration)) { + return undefined; + } + var classDeclaration = classMemberDeclaration.parent; + if (!classDeclaration || !ts.isClassLike(classDeclaration)) { + return undefined; + } + var isStatic = ts.hasModifier(classMemberDeclaration, 32 /* Static */); + return ts.isInJavaScriptFile(sourceFile) ? getActionsForAddMissingMemberInJavaScriptFile() : getActionsForAddMissingMemberInTypeScriptFile(); + function getActionsForAddMissingMemberInJavaScriptFile() { + var memberName = token.getText(); + if (isStatic) { + if (classDeclaration.kind === 198 /* ClassExpression */) { + return undefined; + } + var className = classDeclaration.name.getText(); + return [{ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Initialize_static_property_0), [memberName]), + changes: [{ + fileName: sourceFile.fileName, + textChanges: [{ + span: { start: classDeclaration.getEnd(), length: 0 }, + newText: "" + context.newLineCharacter + className + "." + memberName + " = undefined;" + context.newLineCharacter + }] + }] + }]; + } + else { + var classConstructor = ts.getFirstConstructorWithBody(classDeclaration); + if (!classConstructor) { + return undefined; + } + return [{ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Initialize_property_0_in_the_constructor), [memberName]), + changes: [{ + fileName: sourceFile.fileName, + textChanges: [{ + span: { start: classConstructor.body.getEnd() - 1, length: 0 }, + newText: "this." + memberName + " = undefined;" + context.newLineCharacter + }] + }] + }]; + } + } + function getActionsForAddMissingMemberInTypeScriptFile() { + var typeNode; + if (token.parent.parent.kind === 193 /* BinaryExpression */) { + var binaryExpression = token.parent.parent; + var checker = context.program.getTypeChecker(); + var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(binaryExpression.right))); + typeNode = checker.typeToTypeNode(widenedType, classDeclaration); + } + typeNode = typeNode || ts.createKeywordTypeNode(118 /* AnyKeyword */); + var openBrace = ts.getOpenBraceOfClassLike(classDeclaration, sourceFile); + var property = ts.createProperty( + /*decorators*/ undefined, + /*modifiers*/ isStatic ? [ts.createToken(114 /* StaticKeyword */)] : undefined, token.getText(sourceFile), + /*questionToken*/ undefined, typeNode, + /*initializer*/ undefined); + var propertyChangeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + propertyChangeTracker.insertNodeAfter(sourceFile, openBrace, property, { suffix: context.newLineCharacter }); + var actions = [{ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_declaration_for_missing_property_0), [token.getText()]), + changes: propertyChangeTracker.getChanges() + }]; + if (!isStatic) { + var stringTypeNode = ts.createKeywordTypeNode(135 /* StringKeyword */); + var indexingParameter = ts.createParameter( + /*decorators*/ undefined, + /*modifiers*/ undefined, + /*dotDotDotToken*/ undefined, "x", + /*questionToken*/ undefined, stringTypeNode, + /*initializer*/ undefined); + var indexSignature = ts.createIndexSignatureDeclaration( + /*decorators*/ undefined, + /*modifiers*/ undefined, [indexingParameter], typeNode); + var indexSignatureChangeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + indexSignatureChangeTracker.insertNodeAfter(sourceFile, openBrace, indexSignature, { suffix: context.newLineCharacter }); + actions.push({ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_index_signature_for_missing_property_0), [token.getText()]), + changes: indexSignatureChangeTracker.getChanges() + }); + } + return actions; + } + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code], + getCodeActions: getActionForClassLikeMissingAbstractMember + }); + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code], + getCodeActions: getActionForClassLikeMissingAbstractMember + }); + function getActionForClassLikeMissingAbstractMember(context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + // This is the identifier in the case of a class declaration + // or the class keyword token in the case of a class expression. + var token = ts.getTokenAtPosition(sourceFile, start); + var checker = context.program.getTypeChecker(); + if (ts.isClassLike(token.parent)) { + var classDeclaration = token.parent; + var extendsNode = ts.getClassExtendsHeritageClauseElement(classDeclaration); + var instantiatedExtendsType = checker.getTypeAtLocation(extendsNode); + // Note that this is ultimately derived from a map indexed by symbol names, + // so duplicates cannot occur. + var extendsSymbols = checker.getPropertiesOfType(instantiatedExtendsType); + var abstractAndNonPrivateExtendsSymbols = extendsSymbols.filter(symbolPointsToNonPrivateAndAbstractMember); + var newNodes = codefix.createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, checker); + var changes = codefix.newNodesToChanges(newNodes, ts.getOpenBraceOfClassLike(classDeclaration, sourceFile), context); + if (changes && changes.length > 0) { + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_inherited_abstract_class), + changes: changes + }]; + } + } + return undefined; + } + function symbolPointsToNonPrivateAndAbstractMember(symbol) { + var decls = symbol.getDeclarations(); + ts.Debug.assert(!!(decls && decls.length > 0)); + var flags = ts.getModifierFlags(decls[0]); + return !(flags & 8 /* Private */) && !!(flags & 128 /* Abstract */); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { codefix.registerCodeFix({ errorCodes: [ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code], getCodeActions: function (context) { @@ -77174,9 +83903,9 @@ var ts; if (!superCall) { return undefined; } - // figure out if the this access is actuall inside the supercall + // figure out if the `this` access is actually inside the supercall // i.e. super(this.a), since in that case we won't suggest a fix - if (superCall.expression && superCall.expression.kind == 179 /* CallExpression */) { + if (superCall.expression && superCall.expression.kind === 180 /* CallExpression */) { var arguments_1 = superCall.expression.arguments; for (var i = 0; i < arguments_1.length; i++) { if (arguments_1[i].expression === token) { @@ -77184,23 +83913,15 @@ var ts; } } } - var newPosition = getOpenBraceEnd(constructor, sourceFile); - var changes = [{ - fileName: sourceFile.fileName, textChanges: [{ - newText: superCall.getText(sourceFile), - span: { start: newPosition, length: 0 } - }, - { - newText: "", - span: { start: superCall.getStart(sourceFile), length: superCall.getWidth(sourceFile) } - }] - }]; + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + changeTracker.insertNodeAfter(sourceFile, ts.getOpenBrace(constructor, sourceFile), superCall, { suffix: context.newLineCharacter }); + changeTracker.deleteNode(sourceFile, superCall); return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Make_super_call_the_first_statement_in_the_constructor), - changes: changes + changes: changeTracker.getChanges() }]; function findSuperCall(n) { - if (n.kind === 207 /* ExpressionStatement */ && ts.isSuperCall(n.expression)) { + if (n.kind === 209 /* ExpressionStatement */ && ts.isSuperCall(n.expression)) { return n; } if (ts.isFunctionLike(n)) { @@ -77214,6 +83935,265 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code], + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var token = ts.getTokenAtPosition(sourceFile, context.span.start); + if (token.kind !== 122 /* ConstructorKeyword */) { + return undefined; + } + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + var superCall = ts.createStatement(ts.createCall(ts.createSuper(), /*typeArguments*/ undefined, /*argumentsArray*/ ts.emptyArray)); + changeTracker.insertNodeAfter(sourceFile, ts.getOpenBrace(token.parent, sourceFile), superCall, { suffix: context.newLineCharacter }); + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_missing_super_call), + changes: changeTracker.getChanges() + }]; + } + }); + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code], + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + var token = ts.getTokenAtPosition(sourceFile, start); + var classDeclNode = ts.getContainingClass(token); + if (!(token.kind === 70 /* Identifier */ && ts.isClassLike(classDeclNode))) { + return undefined; + } + var heritageClauses = classDeclNode.heritageClauses; + if (!(heritageClauses && heritageClauses.length > 0)) { + return undefined; + } + var extendsToken = heritageClauses[0].getFirstToken(); + if (!(extendsToken && extendsToken.kind === 84 /* ExtendsKeyword */)) { + return undefined; + } + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + changeTracker.replaceNode(sourceFile, extendsToken, ts.createToken(107 /* ImplementsKeyword */)); + // We replace existing keywords with commas. + for (var i = 1; i < heritageClauses.length; i++) { + var keywordToken = heritageClauses[i].getFirstToken(); + if (keywordToken) { + changeTracker.replaceNode(sourceFile, keywordToken, ts.createToken(25 /* CommaToken */)); + } + } + var result = [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Change_extends_to_implements), + changes: changeTracker.getChanges() + }]; + return result; + } + }); + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code], + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var token = ts.getTokenAtPosition(sourceFile, context.span.start); + if (token.kind !== 70 /* Identifier */) { + return undefined; + } + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + changeTracker.replaceNode(sourceFile, token, ts.createPropertyAccess(ts.createThis(), token)); + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_this_to_unresolved_variable), + changes: changeTracker.getChanges() + }]; + } + }); + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ + ts.Diagnostics._0_is_declared_but_never_used.code, + ts.Diagnostics.Property_0_is_declared_but_never_used.code + ], + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + var token = ts.getTokenAtPosition(sourceFile, start); + // this handles var ["computed"] = 12; + if (token.kind === 20 /* OpenBracketToken */) { + token = ts.getTokenAtPosition(sourceFile, start + 1); + } + switch (token.kind) { + case 70 /* Identifier */: + switch (token.parent.kind) { + case 225 /* VariableDeclaration */: + switch (token.parent.parent.parent.kind) { + case 213 /* ForStatement */: + var forStatement = token.parent.parent.parent; + var forInitializer = forStatement.initializer; + if (forInitializer.declarations.length === 1) { + return deleteNode(forInitializer); + } + else { + return deleteNodeInList(token.parent); + } + case 215 /* ForOfStatement */: + var forOfStatement = token.parent.parent.parent; + if (forOfStatement.initializer.kind === 226 /* VariableDeclarationList */) { + var forOfInitializer = forOfStatement.initializer; + return replaceNode(forOfInitializer.declarations[0], ts.createObjectLiteral()); + } + break; + case 214 /* ForInStatement */: + // There is no valid fix in the case of: + // for .. in + return undefined; + case 259 /* CatchClause */: + var catchClause = token.parent.parent; + var parameter = catchClause.variableDeclaration.getChildren()[0]; + return deleteNode(parameter); + default: + var variableStatement = token.parent.parent.parent; + if (variableStatement.declarationList.declarations.length === 1) { + return deleteNode(variableStatement); + } + else { + return deleteNodeInList(token.parent); + } + } + // TODO: #14885 + // falls through + case 144 /* TypeParameter */: + var typeParameters = token.parent.parent.typeParameters; + if (typeParameters.length === 1) { + var previousToken = ts.getTokenAtPosition(sourceFile, typeParameters.pos - 1); + if (!previousToken || previousToken.kind !== 26 /* LessThanToken */) { + return deleteRange(typeParameters); + } + var nextToken = ts.getTokenAtPosition(sourceFile, typeParameters.end); + if (!nextToken || nextToken.kind !== 28 /* GreaterThanToken */) { + return deleteRange(typeParameters); + } + return deleteNodeRange(previousToken, nextToken); + } + else { + return deleteNodeInList(token.parent); + } + case 145 /* Parameter */: + var functionDeclaration = token.parent.parent; + if (functionDeclaration.parameters.length === 1) { + return deleteNode(token.parent); + } + else { + return deleteNodeInList(token.parent); + } + // handle case where 'import a = A;' + case 236 /* ImportEqualsDeclaration */: + var importEquals = ts.getAncestor(token, 236 /* ImportEqualsDeclaration */); + return deleteNode(importEquals); + case 241 /* ImportSpecifier */: + var namedImports = token.parent.parent; + if (namedImports.elements.length === 1) { + // Only 1 import and it is unused. So the entire declaration should be removed. + var importSpec = ts.getAncestor(token, 237 /* ImportDeclaration */); + return deleteNode(importSpec); + } + else { + // delete import specifier + return deleteNodeInList(token.parent); + } + // handle case where "import d, * as ns from './file'" + // or "'import {a, b as ns} from './file'" + case 238 /* ImportClause */: + var importClause = token.parent; + if (!importClause.namedBindings) { + var importDecl = ts.getAncestor(importClause, 237 /* ImportDeclaration */); + return deleteNode(importDecl); + } + else { + // import |d,| * as ns from './file' + var start_4 = importClause.name.getStart(sourceFile); + var nextToken = ts.getTokenAtPosition(sourceFile, importClause.name.end); + if (nextToken && nextToken.kind === 25 /* CommaToken */) { + // shift first non-whitespace position after comma to the start position of the node + return deleteRange({ pos: start_4, end: ts.skipTrivia(sourceFile.text, nextToken.end, /*stopAfterLineBreaks*/ false, /*stopAtComments*/ true) }); + } + else { + return deleteNode(importClause.name); + } + } + case 239 /* NamespaceImport */: + var namespaceImport = token.parent; + if (namespaceImport.name === token && !namespaceImport.parent.name) { + var importDecl = ts.getAncestor(namespaceImport, 237 /* ImportDeclaration */); + return deleteNode(importDecl); + } + else { + var previousToken = ts.getTokenAtPosition(sourceFile, namespaceImport.pos - 1); + if (previousToken && previousToken.kind === 25 /* CommaToken */) { + var startPosition = ts.textChanges.getAdjustedStartPosition(sourceFile, previousToken, {}, ts.textChanges.Position.FullStart); + return deleteRange({ pos: startPosition, end: namespaceImport.end }); + } + return deleteRange(namespaceImport); + } + } + break; + case 148 /* PropertyDeclaration */: + case 239 /* NamespaceImport */: + return deleteNode(token.parent); + } + if (ts.isDeclarationName(token)) { + return deleteNode(token.parent); + } + else if (ts.isLiteralComputedPropertyDeclarationName(token)) { + return deleteNode(token.parent.parent); + } + else { + return undefined; + } + function deleteNode(n) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).deleteNode(sourceFile, n)); + } + function deleteRange(range) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).deleteRange(sourceFile, range)); + } + function deleteNodeInList(n) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).deleteNodeInList(sourceFile, n)); + } + function deleteNodeRange(start, end) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).deleteNodeRange(sourceFile, start, end)); + } + function replaceNode(n, newNode) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).replaceNode(sourceFile, n, newNode)); + } + function makeChange(changeTracker) { + return [{ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Remove_declaration_for_Colon_0), { 0: token.getText() }), + changes: changeTracker.getChanges() + }]; + } + } + }); + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var codefix; (function (codefix) { @@ -77225,18 +84205,19 @@ var ts; })(ModuleSpecifierComparison || (ModuleSpecifierComparison = {})); var ImportCodeActionMap = (function () { function ImportCodeActionMap() { - this.symbolIdToActionMap = ts.createMap(); + this.symbolIdToActionMap = []; } ImportCodeActionMap.prototype.addAction = function (symbolId, newAction) { if (!newAction) { return; } - if (!this.symbolIdToActionMap[symbolId]) { + var actions = this.symbolIdToActionMap[symbolId]; + if (!actions) { this.symbolIdToActionMap[symbolId] = [newAction]; return; } if (newAction.kind === "CodeChange") { - this.symbolIdToActionMap[symbolId].push(newAction); + actions.push(newAction); return; } var updatedNewImports = []; @@ -77249,12 +84230,13 @@ var ts; } switch (this.compareModuleSpecifiers(existingAction.moduleSpecifier, newAction.moduleSpecifier)) { case ModuleSpecifierComparison.Better: - // the new one is not worth considering if it is a new improt. + // the new one is not worth considering if it is a new import. // However if it is instead a insertion into existing import, the user might want to use // the module specifier even it is worse by our standards. So keep it. if (newAction.kind === "NewImport") { return; } + // falls through case ModuleSpecifierComparison.Equal: // the current one is safe. But it is still possible that the new one is worse // than another existing one. For example, you may have new imports from "./foo/bar" @@ -77280,8 +84262,8 @@ var ts; }; ImportCodeActionMap.prototype.getAllActions = function () { var result = []; - for (var symbolId in this.symbolIdToActionMap) { - result = ts.concatenate(result, this.symbolIdToActionMap[symbolId]); + for (var key in this.symbolIdToActionMap) { + result = ts.concatenate(result, this.symbolIdToActionMap[key]); } return result; }; @@ -77313,7 +84295,11 @@ var ts; return ImportCodeActionMap; }()); codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Cannot_find_name_0.code], + errorCodes: [ + ts.Diagnostics.Cannot_find_name_0.code, + ts.Diagnostics.Cannot_find_namespace_0.code, + ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code + ], getCodeActions: function (context) { var sourceFile = context.sourceFile; var checker = context.program.getTypeChecker(); @@ -77323,18 +84309,22 @@ var ts; var name = token.getText(); var symbolIdActionMap = new ImportCodeActionMap(); // this is a module id -> module import declaration map - var cachedImportDeclarations = ts.createMap(); - var cachedNewImportInsertPosition; - var allPotentialModules = checker.getAmbientModules(); + var cachedImportDeclarations = []; + var lastImportDeclaration; + var currentTokenMeaning = ts.getMeaningFromLocation(token); + if (context.errorCode === ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code) { + var symbol = checker.getAliasedSymbol(checker.getSymbolAtLocation(token)); + return getCodeActionForImport(symbol, /*isDefault*/ false, /*isNamespaceImport*/ true); + } + var candidateModules = checker.getAmbientModules(); for (var _i = 0, allSourceFiles_1 = allSourceFiles; _i < allSourceFiles_1.length; _i++) { var otherSourceFile = allSourceFiles_1[_i]; if (otherSourceFile !== sourceFile && ts.isExternalOrCommonJsModule(otherSourceFile)) { - allPotentialModules.push(otherSourceFile.symbol); + candidateModules.push(otherSourceFile.symbol); } } - var currentTokenMeaning = ts.getMeaningFromLocation(token); - for (var _a = 0, allPotentialModules_1 = allPotentialModules; _a < allPotentialModules_1.length; _a++) { - var moduleSymbol = allPotentialModules_1[_a]; + for (var _a = 0, candidateModules_1 = candidateModules; _a < candidateModules_1.length; _a++) { + var moduleSymbol = candidateModules_1[_a]; context.cancellationToken.throwIfCancellationRequested(); // check the default export var defaultExport = checker.tryGetMemberInModuleExports("default", moduleSymbol); @@ -77356,8 +84346,9 @@ var ts; return symbolIdActionMap.getAllActions(); function getImportDeclarations(moduleSymbol) { var moduleSymbolId = getUniqueSymbolId(moduleSymbol); - if (cachedImportDeclarations[moduleSymbolId]) { - return cachedImportDeclarations[moduleSymbolId]; + var cached = cachedImportDeclarations[moduleSymbolId]; + if (cached) { + return cached; } var existingDeclarations = []; for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { @@ -77372,10 +84363,10 @@ var ts; function getImportDeclaration(moduleSpecifier) { var node = moduleSpecifier; while (node) { - if (node.kind === 235 /* ImportDeclaration */) { + if (node.kind === 237 /* ImportDeclaration */) { return node; } - if (node.kind === 234 /* ImportEqualsDeclaration */) { + if (node.kind === 236 /* ImportEqualsDeclaration */) { return node; } node = node.parent; @@ -77393,7 +84384,7 @@ var ts; var declarations = symbol.getDeclarations(); return declarations ? ts.some(symbol.declarations, function (decl) { return !!(ts.getMeaningFromDeclaration(decl) & meaning); }) : false; } - function getCodeActionForImport(moduleSymbol, isDefault) { + function getCodeActionForImport(moduleSymbol, isDefault, isNamespaceImport) { var existingDeclarations = getImportDeclarations(moduleSymbol); if (existingDeclarations.length > 0) { // With an existing import statement, there are more than one actions the user can do. @@ -77419,11 +84410,11 @@ var ts; var namespaceImportDeclaration; var namedImportDeclaration; var existingModuleSpecifier; - for (var _i = 0, declarations_11 = declarations; _i < declarations_11.length; _i++) { - var declaration = declarations_11[_i]; - if (declaration.kind === 235 /* ImportDeclaration */) { + for (var _i = 0, declarations_14 = declarations; _i < declarations_14.length; _i++) { + var declaration = declarations_14[_i]; + if (declaration.kind === 237 /* ImportDeclaration */) { var namedBindings = declaration.importClause && declaration.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 237 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 239 /* NamespaceImport */) { // case: // import * as ns from "foo" namespaceImportDeclaration = declaration; @@ -77447,15 +84438,15 @@ var ts; if (namespaceImportDeclaration) { actions.push(getCodeActionForNamespaceImport(namespaceImportDeclaration)); } - if (namedImportDeclaration && namedImportDeclaration.importClause && + if (!isNamespaceImport && namedImportDeclaration && namedImportDeclaration.importClause && (namedImportDeclaration.importClause.name || namedImportDeclaration.importClause.namedBindings)) { /** * If the existing import declaration already has a named import list, just * insert the identifier into that list. */ - var textChange = getTextChangeForImportClause(namedImportDeclaration.importClause); + var fileTextChanges = getTextChangeForImportClause(namedImportDeclaration.importClause); var moduleSpecifierWithoutQuotes = ts.stripQuotes(namedImportDeclaration.moduleSpecifier.getText()); - actions.push(createCodeAction(ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, [name, moduleSpecifierWithoutQuotes], textChange.newText, textChange.span, sourceFile.fileName, "InsertingIntoExistingImport", moduleSpecifierWithoutQuotes)); + actions.push(createCodeAction(ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, [name, moduleSpecifierWithoutQuotes], fileTextChanges, "InsertingIntoExistingImport", moduleSpecifierWithoutQuotes)); } else { // we need to create a new import statement, but the existing module specifier can be reused. @@ -77463,55 +84454,35 @@ var ts; } return actions; function getModuleSpecifierFromImportEqualsDeclaration(declaration) { - if (declaration.moduleReference && declaration.moduleReference.kind === 245 /* ExternalModuleReference */) { + if (declaration.moduleReference && declaration.moduleReference.kind === 247 /* ExternalModuleReference */) { return declaration.moduleReference.expression.getText(); } return declaration.moduleReference.getText(); } function getTextChangeForImportClause(importClause) { - var newImportText = isDefault ? "default as " + name : name; var importList = importClause.namedBindings; + var newImportSpecifier = ts.createImportSpecifier(/*propertyName*/ undefined, ts.createIdentifier(name)); // case 1: // original text: import default from "module" // change to: import default, { name } from "module" - if (!importList && importClause.name) { - var start = importClause.name.getEnd(); - return { - newText: ", { " + newImportText + " }", - span: { start: start, length: 0 } - }; - } // case 2: // original text: import {} from "module" // change to: import { name } from "module" - if (importList.elements.length === 0) { - var start = importList.getStart(); - return { - newText: "{ " + newImportText + " }", - span: { start: start, length: importList.getEnd() - start } - }; + if (!importList || importList.elements.length === 0) { + var newImportClause = ts.createImportClause(importClause.name, ts.createNamedImports([newImportSpecifier])); + return createChangeTracker().replaceNode(sourceFile, importClause, newImportClause).getChanges(); } - // case 3: - // original text: import { foo, bar } from "module" - // change to: import { foo, bar, name } from "module" - var insertPoint = importList.elements[importList.elements.length - 1].getEnd(); /** * If the import list has one import per line, preserve that. Otherwise, insert on same line as last element * import { * foo * } from "./module"; */ - var startLine = ts.getLineOfLocalPosition(sourceFile, importList.getStart()); - var endLine = ts.getLineOfLocalPosition(sourceFile, importList.getEnd()); - var oneImportPerLine = endLine - startLine > importList.elements.length; - return { - newText: "," + (oneImportPerLine ? context.newLineCharacter : " ") + newImportText, - span: { start: insertPoint, length: 0 } - }; + return createChangeTracker().insertNodeInListAfter(sourceFile, importList.elements[importList.elements.length - 1], newImportSpecifier).getChanges(); } function getCodeActionForNamespaceImport(declaration) { var namespacePrefix; - if (declaration.kind === 235 /* ImportDeclaration */) { + if (declaration.kind === 237 /* ImportDeclaration */) { namespacePrefix = declaration.importClause.namedBindings.name.getText(); } else { @@ -77528,47 +84499,52 @@ var ts; * namespace instead of altering the import declaration. For example, "foo" would * become "ns.foo" */ - return createCodeAction(ts.Diagnostics.Change_0_to_1, [name, namespacePrefix + "." + name], namespacePrefix + ".", { start: token.getStart(), length: 0 }, sourceFile.fileName, "CodeChange"); + return createCodeAction(ts.Diagnostics.Change_0_to_1, [name, namespacePrefix + "." + name], createChangeTracker().replaceNode(sourceFile, token, ts.createPropertyAccess(ts.createIdentifier(namespacePrefix), name)).getChanges(), "CodeChange"); } } function getCodeActionForNewImport(moduleSpecifier) { - if (!cachedNewImportInsertPosition) { + if (!lastImportDeclaration) { // insert after any existing imports - var lastModuleSpecifierEnd = -1; - for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { - var moduleSpecifier_1 = _a[_i]; - var end = moduleSpecifier_1.getEnd(); - if (!lastModuleSpecifierEnd || end > lastModuleSpecifierEnd) { - lastModuleSpecifierEnd = end; + for (var i = sourceFile.statements.length - 1; i >= 0; i--) { + var statement = sourceFile.statements[i]; + if (statement.kind === 236 /* ImportEqualsDeclaration */ || statement.kind === 237 /* ImportDeclaration */) { + lastImportDeclaration = statement; + break; } } - cachedNewImportInsertPosition = lastModuleSpecifierEnd > 0 ? sourceFile.getLineEndOfPosition(lastModuleSpecifierEnd) : sourceFile.getStart(); } var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); var moduleSpecifierWithoutQuotes = ts.stripQuotes(moduleSpecifier || getModuleSpecifierForNewImport()); - var importStatementText = isDefault - ? "import " + name + " from \"" + moduleSpecifierWithoutQuotes + "\"" - : "import { " + name + " } from \"" + moduleSpecifierWithoutQuotes + "\""; + var changeTracker = createChangeTracker(); + var importClause = isDefault + ? ts.createImportClause(ts.createIdentifier(name), /*namedBindings*/ undefined) + : isNamespaceImport + ? ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(ts.createIdentifier(name))) + : ts.createImportClause(/*name*/ undefined, ts.createNamedImports([ts.createImportSpecifier(/*propertyName*/ undefined, ts.createIdentifier(name))])); + var importDecl = ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, importClause, ts.createLiteral(moduleSpecifierWithoutQuotes)); + if (!lastImportDeclaration) { + changeTracker.insertNodeAt(sourceFile, sourceFile.getStart(), importDecl, { suffix: "" + context.newLineCharacter + context.newLineCharacter }); + } + else { + changeTracker.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl, { suffix: context.newLineCharacter }); + } // if this file doesn't have any import statements, insert an import statement and then insert a new line // between the only import statement and user code. Otherwise just insert the statement because chances // are there are already a new line seperating code and import statements. - var newText = cachedNewImportInsertPosition === sourceFile.getStart() - ? importStatementText + ";" + context.newLineCharacter + context.newLineCharacter - : "" + context.newLineCharacter + importStatementText + ";"; - return createCodeAction(ts.Diagnostics.Import_0_from_1, [name, "\"" + moduleSpecifierWithoutQuotes + "\""], newText, { start: cachedNewImportInsertPosition, length: 0 }, sourceFile.fileName, "NewImport", moduleSpecifierWithoutQuotes); + return createCodeAction(ts.Diagnostics.Import_0_from_1, [name, "\"" + moduleSpecifierWithoutQuotes + "\""], changeTracker.getChanges(), "NewImport", moduleSpecifierWithoutQuotes); function getModuleSpecifierForNewImport() { - var fileName = sourceFile.path; - var moduleFileName = moduleSymbol.valueDeclaration.getSourceFile().path; + var fileName = sourceFile.fileName; + var moduleFileName = moduleSymbol.valueDeclaration.getSourceFile().fileName; var sourceDirectory = ts.getDirectoryPath(fileName); var options = context.program.getCompilerOptions(); return tryGetModuleNameFromAmbientModule() || - tryGetModuleNameFromBaseUrl() || - tryGetModuleNameFromRootDirs() || tryGetModuleNameFromTypeRoots() || tryGetModuleNameAsNodeModule() || + tryGetModuleNameFromBaseUrl() || + tryGetModuleNameFromRootDirs() || ts.removeFileExtension(getRelativePath(moduleFileName, sourceDirectory)); function tryGetModuleNameFromAmbientModule() { - if (moduleSymbol.valueDeclaration.kind !== 261 /* SourceFile */) { + if (moduleSymbol.valueDeclaration.kind !== 264 /* SourceFile */) { return moduleSymbol.name; } } @@ -77576,11 +84552,11 @@ var ts; if (!options.baseUrl) { return undefined; } - var normalizedBaseUrl = ts.toPath(options.baseUrl, ts.getDirectoryPath(options.baseUrl), getCanonicalFileName); - var relativeName = tryRemoveParentDirectoryName(moduleFileName, normalizedBaseUrl); + var relativeName = getRelativePathIfInDirectory(moduleFileName, options.baseUrl); if (!relativeName) { return undefined; } + var relativeNameWithIndex = ts.removeFileExtension(relativeName); relativeName = removeExtensionAndIndexPostFix(relativeName); if (options.paths) { for (var key in options.paths) { @@ -77600,7 +84576,7 @@ var ts; return key.replace("\*", matchedStar); } } - else if (pattern === relativeName) { + else if (pattern === relativeName || pattern === relativeNameWithIndex) { return key; } } @@ -77610,9 +84586,8 @@ var ts; } function tryGetModuleNameFromRootDirs() { if (options.rootDirs) { - var normalizedRootDirs = ts.map(options.rootDirs, function (rootDir) { return ts.toPath(rootDir, /*basePath*/ undefined, getCanonicalFileName); }); - var normalizedTargetPath = getPathRelativeToRootDirs(moduleFileName, normalizedRootDirs); - var normalizedSourcePath = getPathRelativeToRootDirs(sourceDirectory, normalizedRootDirs); + var normalizedTargetPath = getPathRelativeToRootDirs(moduleFileName, options.rootDirs); + var normalizedSourcePath = getPathRelativeToRootDirs(sourceDirectory, options.rootDirs); if (normalizedTargetPath !== undefined) { var relativePath = normalizedSourcePath !== undefined ? getRelativePath(normalizedTargetPath, normalizedSourcePath) : normalizedTargetPath; return ts.removeFileExtension(relativePath); @@ -77676,7 +84651,7 @@ var ts; function getPathRelativeToRootDirs(path, rootDirs) { for (var _i = 0, rootDirs_2 = rootDirs; _i < rootDirs_2.length; _i++) { var rootDir = rootDirs_2[_i]; - var relativeName = tryRemoveParentDirectoryName(path, rootDir); + var relativeName = getRelativePathIfInDirectory(path, rootDir); if (relativeName !== undefined) { return relativeName; } @@ -77690,25 +84665,23 @@ var ts; } return fileName; } - function getRelativePath(path, directoryPath) { - var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, false); - return ts.moduleHasNonRelativeName(relativePath) ? "./" + relativePath : relativePath; + function getRelativePathIfInDirectory(path, directoryPath) { + var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); + return ts.isRootedDiskPath(relativePath) || ts.startsWith(relativePath, "..") ? undefined : relativePath; } - function tryRemoveParentDirectoryName(path, parentDirectory) { - var index = path.indexOf(parentDirectory); - if (index === 0) { - return ts.endsWith(parentDirectory, ts.directorySeparator) - ? path.substring(parentDirectory.length) - : path.substring(parentDirectory.length + 1); - } - return undefined; + function getRelativePath(path, directoryPath) { + var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); + return ts.moduleHasNonRelativeName(relativePath) ? "./" + relativePath : relativePath; } } } - function createCodeAction(description, diagnosticArgs, newText, span, fileName, kind, moduleSpecifier) { + function createChangeTracker() { + return ts.textChanges.ChangeTracker.fromCodeFixContext(context); + } + function createCodeAction(description, diagnosticArgs, changes, kind, moduleSpecifier) { return { description: ts.formatMessage.apply(undefined, [undefined, description].concat(diagnosticArgs)), - changes: [{ fileName: fileName, textChanges: [{ newText: newText, span: span }] }], + changes: changes, kind: kind, moduleSpecifier: moduleSpecifier }; @@ -77723,155 +84696,275 @@ var ts; var codefix; (function (codefix) { codefix.registerCodeFix({ - errorCodes: [ - ts.Diagnostics._0_is_declared_but_never_used.code, - ts.Diagnostics.Property_0_is_declared_but_never_used.code - ], - getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var start = context.span.start; - var token = ts.getTokenAtPosition(sourceFile, start); - // this handles var ["computed"] = 12; - if (token.kind === 20 /* OpenBracketToken */) { - token = ts.getTokenAtPosition(sourceFile, start + 1); + errorCodes: getApplicableDiagnosticCodes(), + getCodeActions: getDisableJsDiagnosticsCodeActions + }); + function getApplicableDiagnosticCodes() { + var allDiagnostcs = ts.Diagnostics; + return Object.keys(allDiagnostcs) + .filter(function (d) { return allDiagnostcs[d] && allDiagnostcs[d].category === ts.DiagnosticCategory.Error; }) + .map(function (d) { return allDiagnostcs[d].code; }); + } + function getIgnoreCommentLocationForLocation(sourceFile, position, newLineCharacter) { + var line = ts.getLineAndCharacterOfPosition(sourceFile, position).line; + var lineStartPosition = ts.getStartPositionOfLine(line, sourceFile); + var startPosition = ts.getFirstNonSpaceCharacterPosition(sourceFile.text, lineStartPosition); + // First try to see if we can put the '// @ts-ignore' on the previous line. + // We need to make sure that we are not in the middle of a string literal or a comment. + // We also want to check if the previous line holds a comment for a node on the next line + // if so, we do not want to separate the node from its comment if we can. + if (!ts.isInComment(sourceFile, startPosition) && !ts.isInString(sourceFile, startPosition) && !ts.isInTemplateString(sourceFile, startPosition)) { + var token = ts.getTouchingToken(sourceFile, startPosition); + var tokenLeadingCommnets = ts.getLeadingCommentRangesOfNode(token, sourceFile); + if (!tokenLeadingCommnets || !tokenLeadingCommnets.length || tokenLeadingCommnets[0].pos >= startPosition) { + return { + span: { start: startPosition, length: 0 }, + newText: "// @ts-ignore" + newLineCharacter + }; } - switch (token.kind) { - case 70 /* Identifier */: - switch (token.parent.kind) { - case 223 /* VariableDeclaration */: - switch (token.parent.parent.parent.kind) { - case 211 /* ForStatement */: - var forStatement = token.parent.parent.parent; - var forInitializer = forStatement.initializer; - if (forInitializer.declarations.length === 1) { - return createCodeFix("", forInitializer.pos, forInitializer.end - forInitializer.pos); - } - else { - return removeSingleItem(forInitializer.declarations, token); - } - case 213 /* ForOfStatement */: - var forOfStatement = token.parent.parent.parent; - if (forOfStatement.initializer.kind === 224 /* VariableDeclarationList */) { - var forOfInitializer = forOfStatement.initializer; - return createCodeFix("{}", forOfInitializer.declarations[0].pos, forOfInitializer.declarations[0].end - forOfInitializer.declarations[0].pos); - } - break; - case 212 /* ForInStatement */: - // There is no valid fix in the case of: - // for .. in - return undefined; - case 256 /* CatchClause */: - var catchClause = token.parent.parent; - var parameter = catchClause.variableDeclaration.getChildren()[0]; - return createCodeFix("", parameter.pos, parameter.end - parameter.pos); - default: - var variableStatement = token.parent.parent.parent; - if (variableStatement.declarationList.declarations.length === 1) { - return createCodeFix("", variableStatement.pos, variableStatement.end - variableStatement.pos); - } - else { - var declarations = variableStatement.declarationList.declarations; - return removeSingleItem(declarations, token); - } - } - case 143 /* TypeParameter */: - var typeParameters = token.parent.parent.typeParameters; - if (typeParameters.length === 1) { - return createCodeFix("", token.parent.pos - 1, token.parent.end - token.parent.pos + 2); - } - else { - return removeSingleItem(typeParameters, token); - } - case 144 /* Parameter */: - var functionDeclaration = token.parent.parent; - if (functionDeclaration.parameters.length === 1) { - return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos); - } - else { - return removeSingleItem(functionDeclaration.parameters, token); - } - // handle case where 'import a = A;' - case 234 /* ImportEqualsDeclaration */: - var importEquals = findImportDeclaration(token); - return createCodeFix("", importEquals.pos, importEquals.end - importEquals.pos); - case 239 /* ImportSpecifier */: - var namedImports = token.parent.parent; - if (namedImports.elements.length === 1) { - // Only 1 import and it is unused. So the entire declaration should be removed. - var importSpec = findImportDeclaration(token); - return createCodeFix("", importSpec.pos, importSpec.end - importSpec.pos); - } - else { - return removeSingleItem(namedImports.elements, token); - } - // handle case where "import d, * as ns from './file'" - // or "'import {a, b as ns} from './file'" - case 236 /* ImportClause */: - var importClause = token.parent; - if (!importClause.namedBindings) { - var importDecl = findImportDeclaration(importClause); - return createCodeFix("", importDecl.pos, importDecl.end - importDecl.pos); - } - else { - return createCodeFix("", importClause.name.pos, importClause.namedBindings.pos - importClause.name.pos); - } - case 237 /* NamespaceImport */: - var namespaceImport = token.parent; - if (namespaceImport.name == token && !namespaceImport.parent.name) { - var importDecl = findImportDeclaration(namespaceImport); - return createCodeFix("", importDecl.pos, importDecl.end - importDecl.pos); - } - else { - var start_4 = namespaceImport.parent.name.end; - return createCodeFix("", start_4, namespaceImport.parent.namedBindings.end - start_4); - } - } - break; - case 147 /* PropertyDeclaration */: - return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos); - case 237 /* NamespaceImport */: - return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos); - } - if (ts.isDeclarationName(token)) { - return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos); - } - else if (ts.isLiteralComputedPropertyDeclarationName(token)) { - return createCodeFix("", token.parent.parent.pos, token.parent.parent.end - token.parent.parent.pos); - } - else { - return undefined; - } - function findImportDeclaration(token) { - var importDecl = token; - while (importDecl.kind != 235 /* ImportDeclaration */ && importDecl.parent) { - importDecl = importDecl.parent; - } - return importDecl; - } - function createCodeFix(newText, start, length) { - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Remove_unused_identifiers), - changes: [{ - fileName: sourceFile.fileName, - textChanges: [{ newText: newText, span: { start: start, length: length } }] + } + // If all fails, add an extra new line immediatlly before the error span. + return { + span: { start: position, length: 0 }, + newText: (position === startPosition ? "" : newLineCharacter) + "// @ts-ignore" + newLineCharacter + }; + } + function getDisableJsDiagnosticsCodeActions(context) { + var sourceFile = context.sourceFile, program = context.program, newLineCharacter = context.newLineCharacter, span = context.span; + if (!ts.isInJavaScriptFile(sourceFile) || !ts.isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) { + return undefined; + } + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Ignore_this_error_message), + changes: [{ + fileName: sourceFile.fileName, + textChanges: [getIgnoreCommentLocationForLocation(sourceFile, span.start, newLineCharacter)] + }] + }, + { + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Disable_checking_for_this_file), + changes: [{ + fileName: sourceFile.fileName, + textChanges: [{ + span: { + start: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.pos : 0, + length: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.end - sourceFile.checkJsDirective.pos : 0 + }, + newText: "// @ts-nocheck" + newLineCharacter }] - }]; - } - function removeSingleItem(elements, token) { - if (elements[0] === token.parent) { - return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos + 1); + }] + }]; + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + function newNodesToChanges(newNodes, insertAfter, context) { + var sourceFile = context.sourceFile; + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + for (var _i = 0, newNodes_1 = newNodes; _i < newNodes_1.length; _i++) { + var newNode = newNodes_1[_i]; + changeTracker.insertNodeAfter(sourceFile, insertAfter, newNode, { suffix: context.newLineCharacter }); + } + var changes = changeTracker.getChanges(); + if (!ts.some(changes)) { + return changes; + } + ts.Debug.assert(changes.length === 1); + var consolidatedChanges = [{ + fileName: changes[0].fileName, + textChanges: [{ + span: changes[0].textChanges[0].span, + newText: changes[0].textChanges.reduce(function (prev, cur) { return prev + cur.newText; }, "") + }] + }]; + return consolidatedChanges; + } + codefix.newNodesToChanges = newNodesToChanges; + /** + * Finds members of the resolved type that are missing in the class pointed to by class decl + * and generates source code for the missing members. + * @param possiblyMissingSymbols The collection of symbols to filter and then get insertions for. + * @returns Empty string iff there are no member insertions. + */ + function createMissingMemberNodes(classDeclaration, possiblyMissingSymbols, checker) { + var classMembers = classDeclaration.symbol.members; + var missingMembers = possiblyMissingSymbols.filter(function (symbol) { return !classMembers.has(symbol.getName()); }); + var newNodes = []; + for (var _i = 0, missingMembers_1 = missingMembers; _i < missingMembers_1.length; _i++) { + var symbol = missingMembers_1[_i]; + var newNode = createNewNodeForMemberSymbol(symbol, classDeclaration, checker); + if (newNode) { + if (Array.isArray(newNode)) { + newNodes = newNodes.concat(newNode); } else { - return createCodeFix("", token.parent.pos - 1, token.parent.end - token.parent.pos + 1); + newNodes.push(newNode); } } } - }); + return newNodes; + } + codefix.createMissingMemberNodes = createMissingMemberNodes; + /** + * @returns Empty string iff there we can't figure out a representation for `symbol` in `enclosingDeclaration`. + */ + function createNewNodeForMemberSymbol(symbol, enclosingDeclaration, checker) { + var declarations = symbol.getDeclarations(); + if (!(declarations && declarations.length)) { + return undefined; + } + var declaration = declarations[0]; + // Clone name to remove leading trivia. + var name = ts.getSynthesizedClone(declaration.name); + var visibilityModifier = createVisibilityModifier(ts.getModifierFlags(declaration)); + var modifiers = visibilityModifier ? ts.createNodeArray([visibilityModifier]) : undefined; + var type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration)); + var optional = !!(symbol.flags & 67108864 /* Optional */); + switch (declaration.kind) { + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 147 /* PropertySignature */: + case 148 /* PropertyDeclaration */: + var typeNode = checker.typeToTypeNode(type, enclosingDeclaration); + var property = ts.createProperty( + /*decorators*/ undefined, modifiers, name, optional ? ts.createToken(54 /* QuestionToken */) : undefined, typeNode, + /*initializer*/ undefined); + return property; + case 149 /* MethodSignature */: + case 150 /* MethodDeclaration */: + // The signature for the implementation appears as an entry in `signatures` iff + // there is only one signature. + // If there are overloads and an implementation signature, it appears as an + // extra declaration that isn't a signature for `type`. + // If there is more than one overload but no implementation signature + // (eg: an abstract method or interface declaration), there is a 1-1 + // correspondence of declarations and signatures. + var signatures = checker.getSignaturesOfType(type, 0 /* Call */); + if (!ts.some(signatures)) { + return undefined; + } + if (declarations.length === 1) { + ts.Debug.assert(signatures.length === 1); + var signature = signatures[0]; + return signatureToMethodDeclaration(signature, enclosingDeclaration, createStubbedMethodBody()); + } + var signatureDeclarations = []; + for (var i = 0; i < signatures.length; i++) { + var signature = signatures[i]; + var methodDeclaration = signatureToMethodDeclaration(signature, enclosingDeclaration); + if (methodDeclaration) { + signatureDeclarations.push(methodDeclaration); + } + } + if (declarations.length > signatures.length) { + var signature = checker.getSignatureFromDeclaration(declarations[declarations.length - 1]); + var methodDeclaration = signatureToMethodDeclaration(signature, enclosingDeclaration, createStubbedMethodBody()); + if (methodDeclaration) { + signatureDeclarations.push(methodDeclaration); + } + } + else { + ts.Debug.assert(declarations.length === signatures.length); + var methodImplementingSignatures = createMethodImplementingSignatures(signatures, name, optional, modifiers); + signatureDeclarations.push(methodImplementingSignatures); + } + return signatureDeclarations; + default: + return undefined; + } + function signatureToMethodDeclaration(signature, enclosingDeclaration, body) { + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 150 /* MethodDeclaration */, enclosingDeclaration); + if (signatureDeclaration) { + signatureDeclaration.decorators = undefined; + signatureDeclaration.modifiers = modifiers; + signatureDeclaration.name = name; + signatureDeclaration.questionToken = optional ? ts.createToken(54 /* QuestionToken */) : undefined; + signatureDeclaration.body = body; + } + return signatureDeclaration; + } + } + function createMethodImplementingSignatures(signatures, name, optional, modifiers) { + /** This is *a* signature with the maximal number of arguments, + * such that if there is a "maximal" signature without rest arguments, + * this is one of them. + */ + var maxArgsSignature = signatures[0]; + var minArgumentCount = signatures[0].minArgumentCount; + var someSigHasRestParameter = false; + for (var i = 0; i < signatures.length; i++) { + var sig = signatures[i]; + minArgumentCount = Math.min(sig.minArgumentCount, minArgumentCount); + if (sig.hasRestParameter) { + someSigHasRestParameter = true; + } + if (sig.parameters.length >= maxArgsSignature.parameters.length && (!sig.hasRestParameter || maxArgsSignature.hasRestParameter)) { + maxArgsSignature = sig; + } + } + var maxNonRestArgs = maxArgsSignature.parameters.length - (maxArgsSignature.hasRestParameter ? 1 : 0); + var maxArgsParameterSymbolNames = maxArgsSignature.parameters.map(function (symbol) { return symbol.getName(); }); + var parameters = []; + for (var i = 0; i < maxNonRestArgs; i++) { + var anyType = ts.createKeywordTypeNode(118 /* AnyKeyword */); + var newParameter = ts.createParameter( + /*decorators*/ undefined, + /*modifiers*/ undefined, + /*dotDotDotToken*/ undefined, maxArgsParameterSymbolNames[i], + /*questionToken*/ i >= minArgumentCount ? ts.createToken(54 /* QuestionToken */) : undefined, anyType, + /*initializer*/ undefined); + parameters.push(newParameter); + } + if (someSigHasRestParameter) { + var anyArrayType = ts.createArrayTypeNode(ts.createKeywordTypeNode(118 /* AnyKeyword */)); + var restParameter = ts.createParameter( + /*decorators*/ undefined, + /*modifiers*/ undefined, ts.createToken(23 /* DotDotDotToken */), maxArgsParameterSymbolNames[maxNonRestArgs] || "rest", + /*questionToken*/ maxNonRestArgs >= minArgumentCount ? ts.createToken(54 /* QuestionToken */) : undefined, anyArrayType, + /*initializer*/ undefined); + parameters.push(restParameter); + } + return createStubbedMethod(modifiers, name, optional, + /*typeParameters*/ undefined, parameters, + /*returnType*/ undefined); + } + function createStubbedMethod(modifiers, name, optional, typeParameters, parameters, returnType) { + return ts.createMethodDeclaration( + /*decorators*/ undefined, modifiers, + /*asteriskToken*/ undefined, name, optional ? ts.createToken(54 /* QuestionToken */) : undefined, typeParameters, parameters, returnType, createStubbedMethodBody()); + } + codefix.createStubbedMethod = createStubbedMethod; + function createStubbedMethodBody() { + return ts.createBlock([ts.createThrow(ts.createNew(ts.createIdentifier("Error"), + /*typeArguments*/ undefined, [ts.createLiteral("Method not implemented.")]))], + /*multiline*/ true); + } + function createVisibilityModifier(flags) { + if (flags & 4 /* Public */) { + return ts.createToken(113 /* PublicKeyword */); + } + else if (flags & 16 /* Protected */) { + return ts.createToken(112 /* ProtectedKeyword */); + } + return undefined; + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); -/// -/// -/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// /// /// /// @@ -77883,7 +84976,6 @@ var ts; /// /// /// -/// /// /// /// @@ -77897,14 +84989,15 @@ var ts; /// /// /// -/// +/// +/// /// var ts; (function (ts) { /** The version of the language service API */ ts.servicesVersion = "0.5"; function createNode(kind, pos, end, parent) { - var node = kind >= 141 /* FirstNode */ ? new NodeObject(kind, pos, end) : + var node = kind >= 142 /* FirstNode */ ? new NodeObject(kind, pos, end) : kind === 70 /* Identifier */ ? new IdentifierObject(70 /* Identifier */, pos, end) : new TokenObject(kind, pos, end); node.parent = parent; @@ -77962,11 +85055,11 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(292 /* SyntaxList */, nodes.pos, nodes.end, this); + var list = createNode(293 /* SyntaxList */, nodes.pos, nodes.end, this); list._children = []; var pos = nodes.pos; - for (var _i = 0, nodes_7 = nodes; _i < nodes_7.length; _i++) { - var node = nodes_7[_i]; + for (var _i = 0, nodes_9 = nodes; _i < nodes_9.length; _i++) { + var node = nodes_9[_i]; if (pos < node.pos) { pos = this.addSyntheticNodes(list._children, pos, node.pos); } @@ -77981,11 +85074,11 @@ var ts; NodeObject.prototype.createChildren = function (sourceFile) { var _this = this; var children; - if (this.kind >= 141 /* FirstNode */) { + if (this.kind >= 142 /* FirstNode */) { ts.scanner.setText((sourceFile || this.getSourceFile()).text); children = []; var pos_3 = this.pos; - var useJSDocScanner_1 = this.kind >= 278 /* FirstJSDocTagNode */ && this.kind <= 291 /* LastJSDocTagNode */; + var useJSDocScanner_1 = this.kind >= 282 /* FirstJSDocTagNode */ && this.kind <= 292 /* LastJSDocTagNode */; var processNode = function (node) { var isJSDocTagNode = ts.isJSDocTag(node); if (!isJSDocTagNode && pos_3 < node.pos) { @@ -78042,8 +85135,10 @@ var ts; if (!children.length) { return undefined; } - var child = children[0]; - return child.kind < 141 /* FirstNode */ ? child : child.getFirstToken(sourceFile); + var child = ts.find(children, function (kid) { return kid.kind < 266 /* FirstJSDocNode */ || kid.kind > 292 /* LastJSDocNode */; }); + return child.kind < 142 /* FirstNode */ ? + child : + child.getFirstToken(sourceFile); }; NodeObject.prototype.getLastToken = function (sourceFile) { var children = this.getChildren(sourceFile); @@ -78051,7 +85146,10 @@ var ts; if (!child) { return undefined; } - return child.kind < 141 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 142 /* FirstNode */ ? child : child.getLastToken(sourceFile); + }; + NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { + return ts.forEachChild(this, cbNode, cbNodeArray); }; return NodeObject; }()); @@ -78105,6 +85203,9 @@ var ts; TokenOrIdentifierObject.prototype.getLastToken = function () { return undefined; }; + TokenOrIdentifierObject.prototype.forEachChild = function () { + return undefined; + }; return TokenOrIdentifierObject; }()); var SymbolObject = (function () { @@ -78127,6 +85228,12 @@ var ts; } return this.documentationComment; }; + SymbolObject.prototype.getJsDocTags = function () { + if (this.tags === undefined) { + this.tags = ts.JsDoc.getJsDocTagsFromDeclarations(this.declarations); + } + return this.tags; + }; return SymbolObject; }()); var TokenObject = (function (_super) { @@ -78210,6 +85317,12 @@ var ts; } return this.documentationComment; }; + SignatureObject.prototype.getJsDocTags = function () { + if (this.jsDocTags === undefined) { + this.jsDocTags = this.declaration ? ts.JsDoc.getJsDocTagsFromDeclarations([this.declaration]) : []; + } + return this.jsDocTags; + }; return SignatureObject; }()); var SourceFileObject = (function (_super) { @@ -78250,17 +85363,21 @@ var ts; return this.namedDeclarations; }; SourceFileObject.prototype.computeNamedDeclarations = function () { - var result = ts.createMap(); + var result = ts.createMultiMap(); ts.forEachChild(this, visit); return result; function addDeclaration(declaration) { var name = getDeclarationName(declaration); if (name) { - ts.multiMapAdd(result, name, declaration); + result.add(name, declaration); } } function getDeclarations(name) { - return result[name] || (result[name] = []); + var declarations = result.get(name); + if (!declarations) { + result.set(name, declarations = []); + } + return declarations; } function getDeclarationName(declaration) { if (declaration.name) { @@ -78268,9 +85385,9 @@ var ts; if (result_7 !== undefined) { return result_7; } - if (declaration.name.kind === 142 /* ComputedPropertyName */) { + if (declaration.name.kind === 143 /* ComputedPropertyName */) { var expr = declaration.name.expression; - if (expr.kind === 177 /* PropertyAccessExpression */) { + if (expr.kind === 178 /* PropertyAccessExpression */) { return expr.name.text; } return getTextOfIdentifierOrLiteral(expr); @@ -78290,10 +85407,10 @@ var ts; } function visit(node) { switch (node.kind) { - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -78310,35 +85427,35 @@ var ts; else { declarations.push(functionDeclaration); } - ts.forEachChild(node, visit); } + ts.forEachChild(node, visit); break; - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 229 /* EnumDeclaration */: - case 230 /* ModuleDeclaration */: - case 234 /* ImportEqualsDeclaration */: - case 243 /* ExportSpecifier */: - case 239 /* ImportSpecifier */: - case 234 /* ImportEqualsDeclaration */: - case 236 /* ImportClause */: - case 237 /* NamespaceImport */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 161 /* TypeLiteral */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 229 /* InterfaceDeclaration */: + case 230 /* TypeAliasDeclaration */: + case 231 /* EnumDeclaration */: + case 232 /* ModuleDeclaration */: + case 236 /* ImportEqualsDeclaration */: + case 245 /* ExportSpecifier */: + case 241 /* ImportSpecifier */: + case 236 /* ImportEqualsDeclaration */: + case 238 /* ImportClause */: + case 239 /* NamespaceImport */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 162 /* TypeLiteral */: addDeclaration(node); ts.forEachChild(node, visit); break; - case 144 /* Parameter */: + case 145 /* Parameter */: // Only consider parameter properties if (!ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { break; } - // fall through - case 223 /* VariableDeclaration */: - case 174 /* BindingElement */: { + // falls through + case 225 /* VariableDeclaration */: + case 175 /* BindingElement */: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -78347,19 +85464,20 @@ var ts; if (decl.initializer) visit(decl.initializer); } - case 260 /* EnumMember */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + // falls through + case 263 /* EnumMember */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: addDeclaration(node); break; - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 235 /* ImportDeclaration */: + case 237 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -78371,7 +85489,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 237 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 239 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -78620,6 +85738,36 @@ var ts; }; return CancellationTokenObject; }()); + /* @internal */ + /** A cancellation that throttles calls to the host */ + var ThrottledCancellationToken = (function () { + function ThrottledCancellationToken(hostCancellationToken, throttleWaitMilliseconds) { + if (throttleWaitMilliseconds === void 0) { throttleWaitMilliseconds = 20; } + this.hostCancellationToken = hostCancellationToken; + this.throttleWaitMilliseconds = throttleWaitMilliseconds; + // Store when we last tried to cancel. Checking cancellation can be expensive (as we have + // to marshall over to the host layer). So we only bother actually checking once enough + // time has passed. + this.lastCancellationCheckTime = 0; + } + ThrottledCancellationToken.prototype.isCancellationRequested = function () { + var time = ts.timestamp(); + var duration = Math.abs(time - this.lastCancellationCheckTime); + if (duration >= this.throttleWaitMilliseconds) { + // Check no more than once every throttle wait milliseconds + this.lastCancellationCheckTime = time; + return this.hostCancellationToken.isCancellationRequested(); + } + return false; + }; + ThrottledCancellationToken.prototype.throwIfCancellationRequested = function () { + if (this.isCancellationRequested()) { + throw new ts.OperationCanceledException(); + } + }; + return ThrottledCancellationToken; + }()); + ts.ThrottledCancellationToken = ThrottledCancellationToken; function createLanguageService(host, documentRegistry) { if (documentRegistry === void 0) { documentRegistry = ts.createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory()); } var syntaxTreeCache = new SyntaxTreeCache(host); @@ -78801,6 +85949,7 @@ var ts; ts.Debug.assert(hostFileInformation.scriptKind === oldSourceFile.scriptKind, "Registered script kind (" + oldSourceFile.scriptKind + ") should match new script kind (" + hostFileInformation.scriptKind + ") for file: " + path); return documentRegistry.updateDocumentWithKey(fileName, path, newSettings, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind); } + // We didn't already have the file. Fall through and acquire it from the registry. } // Could not find this file in the old program, create a new SourceFile for it. return documentRegistry.acquireDocumentWithKey(fileName, path, newSettings, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind); @@ -78901,10 +86050,10 @@ var ts; // Try getting just type at this position and show switch (node.kind) { case 70 /* Identifier */: - case 177 /* PropertyAccessExpression */: - case 141 /* QualifiedName */: + case 178 /* PropertyAccessExpression */: + case 142 /* QualifiedName */: case 98 /* ThisKeyword */: - case 167 /* ThisType */: + case 168 /* ThisType */: case 96 /* SuperKeyword */: // For the identifiers/this/super etc get the type at position var type = typeChecker.getTypeAtLocation(node); @@ -78914,7 +86063,8 @@ var ts; kindModifiers: ts.ScriptElementKindModifier.none, textSpan: ts.createTextSpan(node.getStart(), node.getWidth()), displayParts: ts.typeToDisplayParts(typeChecker, type, ts.getContainerNode(node)), - documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined + documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined, + tags: type.symbol ? type.symbol.getJsDocTags() : undefined }; } } @@ -78926,7 +86076,8 @@ var ts; kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), textSpan: ts.createTextSpan(node.getStart(), node.getWidth()), displayParts: displayPartsDocumentationsAndKind.displayParts, - documentation: displayPartsDocumentationsAndKind.documentation + documentation: displayPartsDocumentationsAndKind.documentation, + tags: displayPartsDocumentationsAndKind.tags }; } /// Goto definition @@ -78934,22 +86085,23 @@ var ts; synchronizeHostData(); return ts.GoToDefinition.getDefinitionAtPosition(program, getValidSourceFile(fileName), position); } - /// Goto implementation - function getImplementationAtPosition(fileName, position) { - synchronizeHostData(); - return ts.GoToImplementation.getImplementationAtPosition(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), ts.getTouchingPropertyName(getValidSourceFile(fileName), position)); - } function getTypeDefinitionAtPosition(fileName, position) { synchronizeHostData(); return ts.GoToDefinition.getTypeDefinitionAtPosition(program.getTypeChecker(), getValidSourceFile(fileName), position); } + /// Goto implementation + function getImplementationAtPosition(fileName, position) { + synchronizeHostData(); + return ts.FindAllReferences.getImplementationsAtPosition(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position); + } + /// References and Occurrences function getOccurrencesAtPosition(fileName, position) { var results = getOccurrencesAtPositionCore(fileName, position); if (results) { - var sourceFile_2 = getCanonicalFileName(ts.normalizeSlashes(fileName)); + var sourceFile_1 = getCanonicalFileName(ts.normalizeSlashes(fileName)); // Get occurrences only supports reporting occurrences for the file queried. So // filter down to that list. - results = ts.filter(results, function (r) { return getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile_2; }); + results = ts.filter(results, function (r) { return getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile_1; }); } return results; } @@ -78959,9 +86111,7 @@ var ts; var sourceFile = getValidSourceFile(fileName); return ts.DocumentHighlights.getDocumentHighlights(program.getTypeChecker(), cancellationToken, sourceFile, position, sourceFilesToSearch); } - /// References and Occurrences function getOccurrencesAtPositionCore(fileName, position) { - synchronizeHostData(); return convertDocumentHighlights(getDocumentHighlights(fileName, position, [fileName])); function convertDocumentHighlights(documentHighlights) { if (!documentHighlights) { @@ -78976,7 +86126,8 @@ var ts; fileName: entry.fileName, textSpan: highlightSpan.textSpan, isWriteAccess: highlightSpan.kind === ts.HighlightSpanKind.writtenReference, - isDefinition: false + isDefinition: false, + isInString: highlightSpan.isInString, }); } } @@ -78984,21 +86135,18 @@ var ts; } } function findRenameLocations(fileName, position, findInStrings, findInComments) { - var referencedSymbols = findReferencedSymbols(fileName, position, findInStrings, findInComments); - return ts.FindAllReferences.convertReferences(referencedSymbols); + return getReferences(fileName, position, { findInStrings: findInStrings, findInComments: findInComments, isForRename: true }); } function getReferencesAtPosition(fileName, position) { - var referencedSymbols = findReferencedSymbols(fileName, position, /*findInStrings*/ false, /*findInComments*/ false); - return ts.FindAllReferences.convertReferences(referencedSymbols); + return getReferences(fileName, position); + } + function getReferences(fileName, position, options) { + synchronizeHostData(); + return ts.FindAllReferences.findReferencedEntries(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position, options); } function findReferences(fileName, position) { - var referencedSymbols = findReferencedSymbols(fileName, position, /*findInStrings*/ false, /*findInComments*/ false); - // Only include referenced symbols that have a valid definition. - return ts.filter(referencedSymbols, function (rs) { return !!rs.definition; }); - } - function findReferencedSymbols(fileName, position, findInStrings, findInComments) { synchronizeHostData(); - return ts.FindAllReferences.findReferencedSymbols(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position, findInStrings, findInComments); + return ts.FindAllReferences.findReferencedSymbols(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position); } /// NavigateTo function getNavigateToItems(searchValue, maxResultCount, fileName, excludeDtsFiles) { @@ -79017,7 +86165,8 @@ var ts; text: data }); } - var emitOutput = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles); + var customTransformers = host.getCustomTransformers && host.getCustomTransformers(); + var emitOutput = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); return { outputFiles: outputFiles, emitSkipped: emitOutput.emitSkipped @@ -79047,15 +86196,15 @@ var ts; return; } switch (node.kind) { - case 177 /* PropertyAccessExpression */: - case 141 /* QualifiedName */: + case 178 /* PropertyAccessExpression */: + case 142 /* QualifiedName */: case 9 /* StringLiteral */: case 85 /* FalseKeyword */: case 100 /* TrueKeyword */: case 94 /* NullKeyword */: case 96 /* SuperKeyword */: case 98 /* ThisKeyword */: - case 167 /* ThisType */: + case 168 /* ThisType */: case 70 /* Identifier */: break; // Cant create the text span @@ -79072,7 +86221,7 @@ var ts; // If this is name of a module declarations, check if this is right side of dotted module name // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 230 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 232 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -79095,10 +86244,10 @@ var ts; return ts.BreakpointResolver.spanInSourceFileAtLocation(sourceFile, position); } function getNavigationBarItems(fileName) { - return ts.NavigationBar.getNavigationBarItems(syntaxTreeCache.getCurrentSourceFile(fileName)); + return ts.NavigationBar.getNavigationBarItems(syntaxTreeCache.getCurrentSourceFile(fileName), cancellationToken); } function getNavigationTree(fileName) { - return ts.NavigationBar.getNavigationTree(syntaxTreeCache.getCurrentSourceFile(fileName)); + return ts.NavigationBar.getNavigationTree(syntaxTreeCache.getCurrentSourceFile(fileName), cancellationToken); } function isTsOrTsxFile(fileName) { var kind = ts.getScriptKind(fileName, host); @@ -79131,7 +86280,7 @@ var ts; function getOutliningSpans(fileName) { // doesn't use compiler - no need to synchronize with host var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - return ts.OutliningElementsCollector.collectElements(sourceFile); + return ts.OutliningElementsCollector.collectElements(sourceFile, cancellationToken); } function getBraceMatchingAtPosition(fileName, position) { var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); @@ -79209,13 +86358,13 @@ var ts; } return []; } - function getCodeFixesAtPosition(fileName, start, end, errorCodes) { + function getCodeFixesAtPosition(fileName, start, end, errorCodes, formatOptions) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); var span = { start: start, length: end - start }; var newLineChar = ts.getNewLineOrDefaultFromHost(host); var allFixes = []; - ts.forEach(errorCodes, function (error) { + ts.forEach(ts.deduplicate(errorCodes), function (error) { cancellationToken.throwIfCancellationRequested(); var context = { errorCode: error, @@ -79224,7 +86373,8 @@ var ts; program: program, newLineCharacter: newLineChar, host: host, - cancellationToken: cancellationToken + cancellationToken: cancellationToken, + rulesProvider: getRuleProvider(formatOptions) }; var fixes = ts.codefix.getFixes(context); if (fixes) { @@ -79248,7 +86398,7 @@ var ts; } var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); // Check if in a context where we don't want to perform any insertion - if (ts.isInString(sourceFile, position) || ts.isInComment(sourceFile, position)) { + if (ts.isInString(sourceFile, position)) { return false; } if (ts.isInsideJsxElementOrAttribute(sourceFile, position)) { @@ -79304,7 +86454,7 @@ var ts; continue; } var descriptor = undefined; - for (var i = 0, n = descriptors.length; i < n; i++) { + for (var i = 0; i < descriptors.length; i++) { if (matchArray[i + firstDescriptorCaptureIndex]) { descriptor = descriptors[i]; } @@ -79435,6 +86585,7 @@ var ts; } ts.createLanguageService = createLanguageService; /* @internal */ + /** Names in the name table are escaped, so an identifier `__foo` will have a name table entry `___foo`. */ function getNameTable(sourceFile) { if (!sourceFile.nameTable) { initializeNameTable(sourceFile); @@ -79449,7 +86600,7 @@ var ts; function walk(node) { switch (node.kind) { case 70 /* Identifier */: - nameTable[node.text] = nameTable[node.text] === undefined ? node.pos : -1; + setNameTable(node.text, node); break; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: @@ -79458,10 +86609,10 @@ var ts; // then we want 'something' to be in the name table. Similarly, if we have // "a['propname']" then we want to store "propname" in the name table. if (ts.isDeclarationName(node) || - node.parent.kind === 245 /* ExternalModuleReference */ || + node.parent.kind === 247 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node)) { - nameTable[node.text] = nameTable[node.text] === undefined ? node.pos : -1; + setNameTable(node.text, node); } break; default: @@ -79474,18 +86625,79 @@ var ts; } } } + function setNameTable(text, node) { + nameTable.set(text, nameTable.get(text) === undefined ? node.pos : -1); + } } + function isObjectLiteralElement(node) { + switch (node.kind) { + case 252 /* JsxAttribute */: + case 254 /* JsxSpreadAttribute */: + case 260 /* PropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + return true; + } + return false; + } + /** + * Returns the containing object literal property declaration given a possible name node, e.g. "a" in x = { "a": 1 } + */ + /* @internal */ + function getContainingObjectLiteralElement(node) { + switch (node.kind) { + case 9 /* StringLiteral */: + case 8 /* NumericLiteral */: + if (node.parent.kind === 143 /* ComputedPropertyName */) { + return isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; + } + // falls through + case 70 /* Identifier */: + return isObjectLiteralElement(node.parent) && + (node.parent.parent.kind === 177 /* ObjectLiteralExpression */ || node.parent.parent.kind === 253 /* JsxAttributes */) && + node.parent.name === node ? node.parent : undefined; + } + return undefined; + } + ts.getContainingObjectLiteralElement = getContainingObjectLiteralElement; + /* @internal */ + function getPropertySymbolsFromContextualType(typeChecker, node) { + var objectLiteral = node.parent; + var contextualType = typeChecker.getContextualType(objectLiteral); + var name = ts.getTextOfPropertyName(node.name); + if (name && contextualType) { + var result_8 = []; + var symbol = contextualType.getProperty(name); + if (contextualType.flags & 65536 /* Union */) { + ts.forEach(contextualType.types, function (t) { + var symbol = t.getProperty(name); + if (symbol) { + result_8.push(symbol); + } + }); + return result_8; + } + if (symbol) { + result_8.push(symbol); + return result_8; + } + } + return undefined; + } + ts.getPropertySymbolsFromContextualType = getPropertySymbolsFromContextualType; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 178 /* ElementAccessExpression */ && + node.parent.kind === 179 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /** - * Get the path of the default library files (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ + * Get the path of the default library files (lib.d.ts) as distributed with the typescript + * node package. + * The functionality is not supported if the ts module is consumed outside of a node module. + */ function getDefaultLibFilePath(options) { // Check __dirname is defined and that we are on a node.js system. if (typeof __dirname !== "undefined") { @@ -79494,10 +86706,7 @@ var ts; throw new Error("getDefaultLibFilePath is only supported when consumed as a node module. "); } ts.getDefaultLibFilePath = getDefaultLibFilePath; - function initializeServices() { - ts.objectAllocator = getServicesObjectAllocator(); - } - initializeServices(); + ts.objectAllocator = getServicesObjectAllocator(); })(ts || (ts = {})); // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. @@ -79562,113 +86771,114 @@ var ts; function spanInNode(node) { if (node) { switch (node.kind) { - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 223 /* VariableDeclaration */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 225 /* VariableDeclaration */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: return spanInVariableDeclaration(node); - case 144 /* Parameter */: + case 145 /* Parameter */: return spanInParameterDeclaration(node); - case 225 /* FunctionDeclaration */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 150 /* Constructor */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 227 /* FunctionDeclaration */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 151 /* Constructor */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 204 /* Block */: + case 206 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } - // Fall through - case 231 /* ModuleBlock */: + // falls through + case 233 /* ModuleBlock */: return spanInBlock(node); - case 256 /* CatchClause */: + case 259 /* CatchClause */: return spanInBlock(node.block); - case 207 /* ExpressionStatement */: + case 209 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 216 /* ReturnStatement */: + case 218 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 210 /* WhileStatement */: + case 212 /* WhileStatement */: // Span on while(...) return textSpanEndingAtNextToken(node, node.expression); - case 209 /* DoStatement */: + case 211 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 222 /* DebuggerStatement */: + case 224 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 208 /* IfStatement */: + case 210 /* IfStatement */: // set on if(..) span return textSpanEndingAtNextToken(node, node.expression); - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 215 /* BreakStatement */: - case 214 /* ContinueStatement */: + case 217 /* BreakStatement */: + case 216 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 211 /* ForStatement */: + case 213 /* ForStatement */: return spanInForStatement(node); - case 212 /* ForInStatement */: + case 214 /* ForInStatement */: // span of for (a in ...) return textSpanEndingAtNextToken(node, node.expression); - case 213 /* ForOfStatement */: + case 215 /* ForOfStatement */: // span in initializer return spanInInitializerOfForLike(node); - case 218 /* SwitchStatement */: + case 220 /* SwitchStatement */: // span on switch(...) return textSpanEndingAtNextToken(node, node.expression); - case 253 /* CaseClause */: - case 254 /* DefaultClause */: + case 256 /* CaseClause */: + case 257 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 221 /* TryStatement */: + case 223 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 220 /* ThrowStatement */: + case 222 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 235 /* ImportDeclaration */: + case 237 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } - case 226 /* ClassDeclaration */: - case 229 /* EnumDeclaration */: - case 260 /* EnumMember */: - case 174 /* BindingElement */: + // falls through + case 228 /* ClassDeclaration */: + case 231 /* EnumDeclaration */: + case 263 /* EnumMember */: + case 175 /* BindingElement */: // span on complete node return textSpan(node); - case 217 /* WithStatement */: + case 219 /* WithStatement */: // span in statement return spanInNode(node.statement); - case 145 /* Decorator */: + case 146 /* Decorator */: return spanInNodeArray(node.parent.decorators); - case 172 /* ObjectBindingPattern */: - case 173 /* ArrayBindingPattern */: + case 173 /* ObjectBindingPattern */: + case 174 /* ArrayBindingPattern */: return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: + case 229 /* InterfaceDeclaration */: + case 230 /* TypeAliasDeclaration */: return undefined; // Tokens: case 24 /* SemicolonToken */: @@ -79698,7 +86908,7 @@ var ts; case 73 /* CatchKeyword */: case 86 /* FinallyKeyword */: return spanInNextNode(node); - case 140 /* OfKeyword */: + case 141 /* OfKeyword */: return spanInOfKeyword(node); default: // Destructuring pattern in destructuring assignment @@ -79711,13 +86921,13 @@ var ts; // a or ...c or d: x from // [a, b, ...c] or { a, b } or { d: x } from destructuring pattern if ((node.kind === 70 /* Identifier */ || - node.kind == 196 /* SpreadElement */ || - node.kind === 257 /* PropertyAssignment */ || - node.kind === 258 /* ShorthandPropertyAssignment */) && + node.kind === 197 /* SpreadElement */ || + node.kind === 260 /* PropertyAssignment */ || + node.kind === 261 /* ShorthandPropertyAssignment */) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { return textSpan(node); } - if (node.kind === 192 /* BinaryExpression */) { + if (node.kind === 193 /* BinaryExpression */) { var binaryExpression = node; // Set breakpoint in destructuring pattern if its destructuring assignment // [a, b, c] or {a, b, c} of @@ -79740,22 +86950,22 @@ var ts; } if (ts.isPartOfExpression(node)) { switch (node.parent.kind) { - case 209 /* DoStatement */: + case 211 /* DoStatement */: // Set span as if on while keyword return spanInPreviousNode(node); - case 145 /* Decorator */: + case 146 /* Decorator */: // Set breakpoint on the decorator emit return spanInNode(node.parent); - case 211 /* ForStatement */: - case 213 /* ForOfStatement */: + case 213 /* ForStatement */: + case 215 /* ForOfStatement */: return textSpan(node); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: if (node.parent.operatorToken.kind === 25 /* CommaToken */) { // If this is a comma expression, the breakpoint is possible in this expression return textSpan(node); } break; - case 185 /* ArrowFunction */: + case 186 /* ArrowFunction */: if (node.parent.body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); @@ -79764,13 +86974,13 @@ var ts; } } // If this is name of property assignment, set breakpoint in the initializer - if (node.parent.kind === 257 /* PropertyAssignment */ && + if (node.parent.kind === 260 /* PropertyAssignment */ && node.parent.name === node && !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } // Breakpoint in type assertion goes to its operand - if (node.parent.kind === 182 /* TypeAssertionExpression */ && node.parent.type === node) { + if (node.parent.kind === 183 /* TypeAssertionExpression */ && node.parent.type === node) { return spanInNextNode(node.parent.type); } // return type of function go to previous token @@ -79778,8 +86988,8 @@ var ts; return spanInPreviousNode(node); } // initializer of variable/parameter declaration go to previous node - if ((node.parent.kind === 223 /* VariableDeclaration */ || - node.parent.kind === 144 /* Parameter */)) { + if ((node.parent.kind === 225 /* VariableDeclaration */ || + node.parent.kind === 145 /* Parameter */)) { var paramOrVarDecl = node.parent; if (paramOrVarDecl.initializer === node || paramOrVarDecl.type === node || @@ -79787,7 +86997,7 @@ var ts; return spanInPreviousNode(node); } } - if (node.parent.kind === 192 /* BinaryExpression */) { + if (node.parent.kind === 193 /* BinaryExpression */) { var binaryExpression = node.parent; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left) && (binaryExpression.right === node || @@ -79801,8 +87011,8 @@ var ts; } } function textSpanFromVariableDeclaration(variableDeclaration) { - var declarations = variableDeclaration.parent.declarations; - if (declarations && declarations[0] === variableDeclaration) { + if (variableDeclaration.parent.kind === 226 /* VariableDeclarationList */ && + variableDeclaration.parent.declarations[0] === variableDeclaration) { // First declaration - include let keyword return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); } @@ -79813,7 +87023,7 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 212 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 214 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } // If this is a destructuring pattern, set breakpoint in binding pattern @@ -79824,11 +87034,11 @@ var ts; // or its declaration from 'for of' if (variableDeclaration.initializer || ts.hasModifier(variableDeclaration, 1 /* Export */) || - variableDeclaration.parent.parent.kind === 213 /* ForOfStatement */) { + variableDeclaration.parent.parent.kind === 215 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } - var declarations = variableDeclaration.parent.declarations; - if (declarations && declarations[0] !== variableDeclaration) { + if (variableDeclaration.parent.kind === 226 /* VariableDeclarationList */ && + variableDeclaration.parent.declarations[0] !== variableDeclaration) { // If we cannot set breakpoint on this declaration, set it on previous one // Because the variable declaration may be binding pattern and // we would like to set breakpoint in last binding element if that's the case, @@ -79864,7 +87074,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasModifier(functionDeclaration, 1 /* Export */) || - (functionDeclaration.parent.kind === 226 /* ClassDeclaration */ && functionDeclaration.kind !== 150 /* Constructor */); + (functionDeclaration.parent.kind === 228 /* ClassDeclaration */ && functionDeclaration.kind !== 151 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -79887,25 +87097,26 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } + // falls through // Set on parent if on same line otherwise on first statement - case 210 /* WhileStatement */: - case 208 /* IfStatement */: - case 212 /* ForInStatement */: + case 212 /* WhileStatement */: + case 210 /* IfStatement */: + case 214 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 211 /* ForStatement */: - case 213 /* ForOfStatement */: + case 213 /* ForStatement */: + case 215 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 224 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 226 /* VariableDeclarationList */) { // Declaration list - set breakpoint in first declaration var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -79930,23 +87141,23 @@ var ts; } function spanInBindingPattern(bindingPattern) { // Set breakpoint in first binding element - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 198 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 199 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } // Empty binding pattern of binding element, set breakpoint on binding element - if (bindingPattern.parent.kind === 174 /* BindingElement */) { + if (bindingPattern.parent.kind === 175 /* BindingElement */) { return textSpan(bindingPattern.parent); } // Variable declaration is used as the span return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 173 /* ArrayBindingPattern */ && node.kind !== 172 /* ObjectBindingPattern */); - var elements = node.kind === 175 /* ArrayLiteralExpression */ ? + ts.Debug.assert(node.kind !== 174 /* ArrayBindingPattern */ && node.kind !== 173 /* ObjectBindingPattern */); + var elements = node.kind === 176 /* ArrayLiteralExpression */ ? node.elements : node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 198 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 199 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } @@ -79954,18 +87165,18 @@ var ts; // just nested element in another destructuring assignment // set breakpoint on assignment when parent is destructuring assignment // Otherwise set breakpoint for this element - return textSpan(node.parent.kind === 192 /* BinaryExpression */ ? node.parent : node); + return textSpan(node.parent.kind === 193 /* BinaryExpression */ ? node.parent : node); } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 232 /* CaseBlock */: + case 234 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -79973,24 +87184,25 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 231 /* ModuleBlock */: + case 233 /* ModuleBlock */: // If this is not an instantiated module block, no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } - case 229 /* EnumDeclaration */: - case 226 /* ClassDeclaration */: + // falls through + case 231 /* EnumDeclaration */: + case 228 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 204 /* Block */: + case 206 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } - // fall through - case 256 /* CatchClause */: + // falls through + case 259 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 232 /* CaseBlock */: + case 234 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -79998,7 +87210,7 @@ var ts; return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 172 /* ObjectBindingPattern */: + case 173 /* ObjectBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -80014,7 +87226,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 173 /* ArrayBindingPattern */: + case 174 /* ArrayBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -80029,12 +87241,12 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 209 /* DoStatement */ || - node.parent.kind === 179 /* CallExpression */ || - node.parent.kind === 180 /* NewExpression */) { + if (node.parent.kind === 211 /* DoStatement */ || + node.parent.kind === 180 /* CallExpression */ || + node.parent.kind === 181 /* NewExpression */) { return spanInPreviousNode(node); } - if (node.parent.kind === 183 /* ParenthesizedExpression */) { + if (node.parent.kind === 184 /* ParenthesizedExpression */) { return spanInNextNode(node); } // Default to parent node @@ -80043,21 +87255,21 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: - case 185 /* ArrowFunction */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 150 /* Constructor */: - case 210 /* WhileStatement */: - case 209 /* DoStatement */: - case 211 /* ForStatement */: - case 213 /* ForOfStatement */: - case 179 /* CallExpression */: - case 180 /* NewExpression */: - case 183 /* ParenthesizedExpression */: + case 185 /* FunctionExpression */: + case 227 /* FunctionDeclaration */: + case 186 /* ArrowFunction */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 151 /* Constructor */: + case 212 /* WhileStatement */: + case 211 /* DoStatement */: + case 213 /* ForStatement */: + case 215 /* ForOfStatement */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: + case 184 /* ParenthesizedExpression */: return spanInPreviousNode(node); // Default to parent node default: @@ -80067,20 +87279,20 @@ var ts; function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration if (ts.isFunctionLike(node.parent) || - node.parent.kind === 257 /* PropertyAssignment */ || - node.parent.kind === 144 /* Parameter */) { + node.parent.kind === 260 /* PropertyAssignment */ || + node.parent.kind === 145 /* Parameter */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 182 /* TypeAssertionExpression */) { + if (node.parent.kind === 183 /* TypeAssertionExpression */) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 209 /* DoStatement */) { + if (node.parent.kind === 211 /* DoStatement */) { // Set span on while expression return textSpanEndingAtNextToken(node, node.parent.expression); } @@ -80088,7 +87300,7 @@ var ts; return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 213 /* ForOfStatement */) { + if (node.parent.kind === 215 /* ForOfStatement */) { // Set using next token return spanInNextNode(node); } @@ -80100,6 +87312,26 @@ var ts; BreakpointResolver.spanInSourceFileAtLocation = spanInSourceFileAtLocation; })(BreakpointResolver = ts.BreakpointResolver || (ts.BreakpointResolver = {})); })(ts || (ts = {})); +/// +/// +var ts; +(function (ts) { + /** + * Transform one or more nodes using the supplied transformers. + * @param source A single `Node` or an array of `Node` objects. + * @param transformers An array of `TransformerFactory` callbacks used to process the transformation. + * @param compilerOptions Optional compiler options. + */ + function transform(source, transformers, compilerOptions) { + var diagnostics = []; + compilerOptions = ts.fixupCompilerOptions(compilerOptions, diagnostics); + var nodes = ts.isArray(source) ? source : [source]; + var result = ts.transformNodes(/*resolver*/ undefined, /*emitHost*/ undefined, compilerOptions, nodes, transformers, /*allowDtsFiles*/ true); + result.diagnostics = ts.concatenate(result.diagnostics, diagnostics); + return result; + } + ts.transform = transform; +})(ts || (ts = {})); // // Copyright (c) Microsoft Corporation. All rights reserved. // @@ -80141,8 +87373,7 @@ var ts; ScriptSnapshotShimAdapter.prototype.getChangeRange = function (oldSnapshot) { var oldSnapshotShim = oldSnapshot; var encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim); - // TODO: should this be '==='? - if (encoded == null) { + if (encoded === null) { return null; } var decoded = JSON.parse(encoded); @@ -80215,11 +87446,13 @@ var ts; }; LanguageServiceShimHostAdapter.prototype.getCompilationSettings = function () { var settingsJson = this.shimHost.getCompilationSettings(); - // TODO: should this be '==='? - if (settingsJson == null || settingsJson == "") { + if (settingsJson === null || settingsJson === "") { throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings"); } - return JSON.parse(settingsJson); + var compilerOptions = JSON.parse(settingsJson); + // permit language service to handle all files (filtering should be performed on the host side) + compilerOptions.allowNonTsExtensions = true; + return compilerOptions; }; LanguageServiceShimHostAdapter.prototype.getScriptFileNames = function () { var encoded = this.shimHost.getScriptFileNames(); @@ -80242,7 +87475,7 @@ var ts; }; LanguageServiceShimHostAdapter.prototype.getLocalizedDiagnosticMessages = function () { var diagnosticMessagesJson = this.shimHost.getLocalizedDiagnosticMessages(); - if (diagnosticMessagesJson == null || diagnosticMessagesJson == "") { + if (diagnosticMessagesJson === null || diagnosticMessagesJson === "") { return null; } try { @@ -80255,7 +87488,7 @@ var ts; }; LanguageServiceShimHostAdapter.prototype.getCancellationToken = function () { var hostCancellationToken = this.shimHost.getCancellationToken(); - return new ThrottledCancellationToken(hostCancellationToken); + return new ts.ThrottledCancellationToken(hostCancellationToken); }; LanguageServiceShimHostAdapter.prototype.getCurrentDirectory = function () { return this.shimHost.getCurrentDirectory(); @@ -80279,27 +87512,6 @@ var ts; return LanguageServiceShimHostAdapter; }()); ts.LanguageServiceShimHostAdapter = LanguageServiceShimHostAdapter; - /** A cancellation that throttles calls to the host */ - var ThrottledCancellationToken = (function () { - function ThrottledCancellationToken(hostCancellationToken) { - this.hostCancellationToken = hostCancellationToken; - // Store when we last tried to cancel. Checking cancellation can be expensive (as we have - // to marshall over to the host layer). So we only bother actually checking once enough - // time has passed. - this.lastCancellationCheckTime = 0; - } - ThrottledCancellationToken.prototype.isCancellationRequested = function () { - var time = ts.timestamp(); - var duration = Math.abs(time - this.lastCancellationCheckTime); - if (duration > 10) { - // Check no more than once every 10 ms. - this.lastCancellationCheckTime = time; - return this.hostCancellationToken.isCancellationRequested(); - } - return false; - }; - return ThrottledCancellationToken; - }()); var CoreServicesShimHostAdapter = (function () { function CoreServicesShimHostAdapter(shimHost) { var _this = this; @@ -80727,12 +87939,6 @@ var ts; var compilerOptions = JSON.parse(compilerOptionsJson); var result = ts.resolveModuleName(moduleName, ts.normalizeSlashes(fileName), compilerOptions, _this.host); var resolvedFileName = result.resolvedModule ? result.resolvedModule.resolvedFileName : undefined; - if (resolvedFileName && !compilerOptions.allowJs && ts.fileExtensionIs(resolvedFileName, ".js")) { - return { - resolvedFileName: undefined, - failedLookupLocations: [] - }; - } return { resolvedFileName: resolvedFileName, failedLookupLocations: result.failedLookupLocations @@ -80877,7 +88083,7 @@ var ts; this._shims.push(shim); }; TypeScriptServicesFactory.prototype.unregisterShim = function (shim) { - for (var i = 0, n = this._shims.length; i < n; i++) { + for (var i = 0; i < this._shims.length; i++) { if (this._shims[i] === shim) { delete this._shims[i]; return; @@ -80906,4 +88112,4 @@ var TypeScript; // 'toolsVersion' gets consumed by the managed side, so it's not unused. // TODO: it should be moved into a namespace though. /* @internal */ -var toolsVersion = "2.2"; +var toolsVersion = "2.3"; diff --git a/node_modules/typescript/lib/typescriptServices.d.ts b/node_modules/typescript/lib/typescriptServices.d.ts index ecd018623..e47dfbe31 100644 --- a/node_modules/typescript/lib/typescriptServices.d.ts +++ b/node_modules/typescript/lib/typescriptServices.d.ts @@ -14,11 +14,36 @@ and limitations under the License. ***************************************************************************** */ declare namespace ts { + /** + * Type of objects whose values are all of the same type. + * The `in` and `for-in` operators can *not* be safely used, + * since `Object.prototype` may be modified by outside code. + */ interface MapLike { [index: string]: T; } - interface Map extends MapLike { - __mapBrand: any; + /** ES6 Map interface. */ + interface Map { + get(key: string): T; + has(key: string): boolean; + set(key: string, value: T): this; + delete(key: string): boolean; + clear(): void; + forEach(action: (value: T, key: string) => void): void; + readonly size: number; + keys(): Iterator; + values(): Iterator; + entries(): Iterator<[string, T]>; + } + /** ES6 Iterator type. */ + interface Iterator { + next(): { + value: T; + done: false; + } | { + value: never; + done: true; + }; } type Path = string & { __pathBrand: any; @@ -170,171 +195,171 @@ declare namespace ts { ReadonlyKeyword = 130, RequireKeyword = 131, NumberKeyword = 132, - SetKeyword = 133, - StringKeyword = 134, - SymbolKeyword = 135, - TypeKeyword = 136, - UndefinedKeyword = 137, - FromKeyword = 138, - GlobalKeyword = 139, - OfKeyword = 140, - QualifiedName = 141, - ComputedPropertyName = 142, - TypeParameter = 143, - Parameter = 144, - Decorator = 145, - PropertySignature = 146, - PropertyDeclaration = 147, - MethodSignature = 148, - MethodDeclaration = 149, - Constructor = 150, - GetAccessor = 151, - SetAccessor = 152, - CallSignature = 153, - ConstructSignature = 154, - IndexSignature = 155, - TypePredicate = 156, - TypeReference = 157, - FunctionType = 158, - ConstructorType = 159, - TypeQuery = 160, - TypeLiteral = 161, - ArrayType = 162, - TupleType = 163, - UnionType = 164, - IntersectionType = 165, - ParenthesizedType = 166, - ThisType = 167, - TypeOperator = 168, - IndexedAccessType = 169, - MappedType = 170, - LiteralType = 171, - ObjectBindingPattern = 172, - ArrayBindingPattern = 173, - BindingElement = 174, - ArrayLiteralExpression = 175, - ObjectLiteralExpression = 176, - PropertyAccessExpression = 177, - ElementAccessExpression = 178, - CallExpression = 179, - NewExpression = 180, - TaggedTemplateExpression = 181, - TypeAssertionExpression = 182, - ParenthesizedExpression = 183, - FunctionExpression = 184, - ArrowFunction = 185, - DeleteExpression = 186, - TypeOfExpression = 187, - VoidExpression = 188, - AwaitExpression = 189, - PrefixUnaryExpression = 190, - PostfixUnaryExpression = 191, - BinaryExpression = 192, - ConditionalExpression = 193, - TemplateExpression = 194, - YieldExpression = 195, - SpreadElement = 196, - ClassExpression = 197, - OmittedExpression = 198, - ExpressionWithTypeArguments = 199, - AsExpression = 200, - NonNullExpression = 201, - TemplateSpan = 202, - SemicolonClassElement = 203, - Block = 204, - VariableStatement = 205, - EmptyStatement = 206, - ExpressionStatement = 207, - IfStatement = 208, - DoStatement = 209, - WhileStatement = 210, - ForStatement = 211, - ForInStatement = 212, - ForOfStatement = 213, - ContinueStatement = 214, - BreakStatement = 215, - ReturnStatement = 216, - WithStatement = 217, - SwitchStatement = 218, - LabeledStatement = 219, - ThrowStatement = 220, - TryStatement = 221, - DebuggerStatement = 222, - VariableDeclaration = 223, - VariableDeclarationList = 224, - FunctionDeclaration = 225, - ClassDeclaration = 226, - InterfaceDeclaration = 227, - TypeAliasDeclaration = 228, - EnumDeclaration = 229, - ModuleDeclaration = 230, - ModuleBlock = 231, - CaseBlock = 232, - NamespaceExportDeclaration = 233, - ImportEqualsDeclaration = 234, - ImportDeclaration = 235, - ImportClause = 236, - NamespaceImport = 237, - NamedImports = 238, - ImportSpecifier = 239, - ExportAssignment = 240, - ExportDeclaration = 241, - NamedExports = 242, - ExportSpecifier = 243, - MissingDeclaration = 244, - ExternalModuleReference = 245, - JsxElement = 246, - JsxSelfClosingElement = 247, - JsxOpeningElement = 248, - JsxClosingElement = 249, - JsxAttribute = 250, - JsxSpreadAttribute = 251, - JsxExpression = 252, - CaseClause = 253, - DefaultClause = 254, - HeritageClause = 255, - CatchClause = 256, - PropertyAssignment = 257, - ShorthandPropertyAssignment = 258, - SpreadAssignment = 259, - EnumMember = 260, - SourceFile = 261, - JSDocTypeExpression = 262, - JSDocAllType = 263, - JSDocUnknownType = 264, - JSDocArrayType = 265, - JSDocUnionType = 266, - JSDocTupleType = 267, - JSDocNullableType = 268, - JSDocNonNullableType = 269, - JSDocRecordType = 270, - JSDocRecordMember = 271, - JSDocTypeReference = 272, - JSDocOptionalType = 273, - JSDocFunctionType = 274, - JSDocVariadicType = 275, - JSDocConstructorType = 276, - JSDocThisType = 277, - JSDocComment = 278, - JSDocTag = 279, - JSDocAugmentsTag = 280, - JSDocParameterTag = 281, - JSDocReturnTag = 282, - JSDocTypeTag = 283, - JSDocTemplateTag = 284, - JSDocTypedefTag = 285, - JSDocPropertyTag = 286, - JSDocTypeLiteral = 287, - JSDocLiteralType = 288, - JSDocNullKeyword = 289, - JSDocUndefinedKeyword = 290, - JSDocNeverKeyword = 291, - SyntaxList = 292, - NotEmittedStatement = 293, - PartiallyEmittedExpression = 294, - MergeDeclarationMarker = 295, - EndOfDeclarationMarker = 296, - RawExpression = 297, + ObjectKeyword = 133, + SetKeyword = 134, + StringKeyword = 135, + SymbolKeyword = 136, + TypeKeyword = 137, + UndefinedKeyword = 138, + FromKeyword = 139, + GlobalKeyword = 140, + OfKeyword = 141, + QualifiedName = 142, + ComputedPropertyName = 143, + TypeParameter = 144, + Parameter = 145, + Decorator = 146, + PropertySignature = 147, + PropertyDeclaration = 148, + MethodSignature = 149, + MethodDeclaration = 150, + Constructor = 151, + GetAccessor = 152, + SetAccessor = 153, + CallSignature = 154, + ConstructSignature = 155, + IndexSignature = 156, + TypePredicate = 157, + TypeReference = 158, + FunctionType = 159, + ConstructorType = 160, + TypeQuery = 161, + TypeLiteral = 162, + ArrayType = 163, + TupleType = 164, + UnionType = 165, + IntersectionType = 166, + ParenthesizedType = 167, + ThisType = 168, + TypeOperator = 169, + IndexedAccessType = 170, + MappedType = 171, + LiteralType = 172, + ObjectBindingPattern = 173, + ArrayBindingPattern = 174, + BindingElement = 175, + ArrayLiteralExpression = 176, + ObjectLiteralExpression = 177, + PropertyAccessExpression = 178, + ElementAccessExpression = 179, + CallExpression = 180, + NewExpression = 181, + TaggedTemplateExpression = 182, + TypeAssertionExpression = 183, + ParenthesizedExpression = 184, + FunctionExpression = 185, + ArrowFunction = 186, + DeleteExpression = 187, + TypeOfExpression = 188, + VoidExpression = 189, + AwaitExpression = 190, + PrefixUnaryExpression = 191, + PostfixUnaryExpression = 192, + BinaryExpression = 193, + ConditionalExpression = 194, + TemplateExpression = 195, + YieldExpression = 196, + SpreadElement = 197, + ClassExpression = 198, + OmittedExpression = 199, + ExpressionWithTypeArguments = 200, + AsExpression = 201, + NonNullExpression = 202, + MetaProperty = 203, + TemplateSpan = 204, + SemicolonClassElement = 205, + Block = 206, + VariableStatement = 207, + EmptyStatement = 208, + ExpressionStatement = 209, + IfStatement = 210, + DoStatement = 211, + WhileStatement = 212, + ForStatement = 213, + ForInStatement = 214, + ForOfStatement = 215, + ContinueStatement = 216, + BreakStatement = 217, + ReturnStatement = 218, + WithStatement = 219, + SwitchStatement = 220, + LabeledStatement = 221, + ThrowStatement = 222, + TryStatement = 223, + DebuggerStatement = 224, + VariableDeclaration = 225, + VariableDeclarationList = 226, + FunctionDeclaration = 227, + ClassDeclaration = 228, + InterfaceDeclaration = 229, + TypeAliasDeclaration = 230, + EnumDeclaration = 231, + ModuleDeclaration = 232, + ModuleBlock = 233, + CaseBlock = 234, + NamespaceExportDeclaration = 235, + ImportEqualsDeclaration = 236, + ImportDeclaration = 237, + ImportClause = 238, + NamespaceImport = 239, + NamedImports = 240, + ImportSpecifier = 241, + ExportAssignment = 242, + ExportDeclaration = 243, + NamedExports = 244, + ExportSpecifier = 245, + MissingDeclaration = 246, + ExternalModuleReference = 247, + JsxElement = 248, + JsxSelfClosingElement = 249, + JsxOpeningElement = 250, + JsxClosingElement = 251, + JsxAttribute = 252, + JsxAttributes = 253, + JsxSpreadAttribute = 254, + JsxExpression = 255, + CaseClause = 256, + DefaultClause = 257, + HeritageClause = 258, + CatchClause = 259, + PropertyAssignment = 260, + ShorthandPropertyAssignment = 261, + SpreadAssignment = 262, + EnumMember = 263, + SourceFile = 264, + Bundle = 265, + JSDocTypeExpression = 266, + JSDocAllType = 267, + JSDocUnknownType = 268, + JSDocArrayType = 269, + JSDocUnionType = 270, + JSDocTupleType = 271, + JSDocNullableType = 272, + JSDocNonNullableType = 273, + JSDocRecordType = 274, + JSDocRecordMember = 275, + JSDocTypeReference = 276, + JSDocOptionalType = 277, + JSDocFunctionType = 278, + JSDocVariadicType = 279, + JSDocConstructorType = 280, + JSDocThisType = 281, + JSDocComment = 282, + JSDocTag = 283, + JSDocAugmentsTag = 284, + JSDocParameterTag = 285, + JSDocReturnTag = 286, + JSDocTypeTag = 287, + JSDocTemplateTag = 288, + JSDocTypedefTag = 289, + JSDocPropertyTag = 290, + JSDocTypeLiteral = 291, + JSDocLiteralType = 292, + SyntaxList = 293, + NotEmittedStatement = 294, + PartiallyEmittedExpression = 295, + MergeDeclarationMarker = 296, + EndOfDeclarationMarker = 297, Count = 298, FirstAssignment = 57, LastAssignment = 69, @@ -343,15 +368,15 @@ declare namespace ts { FirstReservedWord = 71, LastReservedWord = 106, FirstKeyword = 71, - LastKeyword = 140, + LastKeyword = 141, FirstFutureReservedWord = 107, LastFutureReservedWord = 115, - FirstTypeNode = 156, - LastTypeNode = 171, + FirstTypeNode = 157, + LastTypeNode = 172, FirstPunctuation = 16, LastPunctuation = 69, FirstToken = 0, - LastToken = 140, + LastToken = 141, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -360,11 +385,11 @@ declare namespace ts { LastTemplateToken = 15, FirstBinaryOperator = 26, LastBinaryOperator = 69, - FirstNode = 141, - FirstJSDocNode = 262, - LastJSDocNode = 288, - FirstJSDocTagNode = 278, - LastJSDocTagNode = 291, + FirstNode = 142, + FirstJSDocNode = 266, + LastJSDocNode = 292, + FirstJSDocTagNode = 282, + LastJSDocTagNode = 292, } enum NodeFlags { None = 0, @@ -378,26 +403,20 @@ declare namespace ts { HasImplicitReturn = 128, HasExplicitReturn = 256, GlobalAugmentation = 512, - HasClassExtends = 1024, - HasDecorators = 2048, - HasParamDecorators = 4096, - HasAsyncFunctions = 8192, - HasSpreadAttribute = 16384, - HasRestAttribute = 32768, - DisallowInContext = 65536, - YieldContext = 131072, - DecoratorContext = 262144, - AwaitContext = 524288, - ThisNodeHasError = 1048576, - JavaScriptFile = 2097152, - ThisNodeOrAnySubNodesHasError = 4194304, - HasAggregatedChildData = 8388608, + HasAsyncFunctions = 1024, + DisallowInContext = 2048, + YieldContext = 4096, + DecoratorContext = 8192, + AwaitContext = 16384, + ThisNodeHasError = 32768, + JavaScriptFile = 65536, + ThisNodeOrAnySubNodesHasError = 131072, + HasAggregatedChildData = 262144, BlockScoped = 3, ReachabilityCheckFlags = 384, - EmitHelperFlags = 64512, - ReachabilityAndEmitFlags = 64896, - ContextFlags = 3080192, - TypeExcludesFlags = 655360, + ReachabilityAndEmitFlags = 1408, + ContextFlags = 96256, + TypeExcludesFlags = 20480, } enum ModifierFlags { None = 0, @@ -449,6 +468,7 @@ declare namespace ts { type EndOfFileToken = Token; type AtToken = Token; type ReadonlyToken = Token; + type AwaitKeywordToken = Token; type Modifier = Token | Token | Token | Token | Token | Token | Token | Token | Token | Token | Token; type ModifiersArray = NodeArray; interface Identifier extends PrimaryExpression { @@ -485,8 +505,10 @@ declare namespace ts { } interface TypeParameterDeclaration extends Declaration { kind: SyntaxKind.TypeParameter; + parent?: DeclarationWithTypeParameters; name: Identifier; constraint?: TypeNode; + default?: TypeNode; expression?: Expression; } interface SignatureDeclaration extends Declaration { @@ -504,17 +526,19 @@ declare namespace ts { type BindingName = Identifier | BindingPattern; interface VariableDeclaration extends Declaration { kind: SyntaxKind.VariableDeclaration; - parent?: VariableDeclarationList; + parent?: VariableDeclarationList | CatchClause; name: BindingName; type?: TypeNode; initializer?: Expression; } interface VariableDeclarationList extends Node { kind: SyntaxKind.VariableDeclarationList; + parent?: VariableStatement | ForStatement | ForOfStatement | ForInStatement; declarations: NodeArray; } interface ParameterDeclaration extends Declaration { kind: SyntaxKind.Parameter; + parent?: SignatureDeclaration; dotDotDotToken?: DotDotDotToken; name: BindingName; questionToken?: QuestionToken; @@ -523,6 +547,7 @@ declare namespace ts { } interface BindingElement extends Declaration { kind: SyntaxKind.BindingElement; + parent?: BindingPattern; propertyName?: PropertyName; dotDotDotToken?: DotDotDotToken; name: BindingName; @@ -546,7 +571,7 @@ declare namespace ts { _objectLiteralBrandBrand: any; name?: PropertyName; } - type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | MethodDeclaration | AccessorDeclaration | SpreadAssignment; + type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | MethodDeclaration | AccessorDeclaration; interface PropertyAssignment extends ObjectLiteralElement { kind: SyntaxKind.PropertyAssignment; name: PropertyName; @@ -577,10 +602,12 @@ declare namespace ts { } interface ObjectBindingPattern extends Node { kind: SyntaxKind.ObjectBindingPattern; + parent?: VariableDeclaration | ParameterDeclaration | BindingElement; elements: NodeArray; } interface ArrayBindingPattern extends Node { kind: SyntaxKind.ArrayBindingPattern; + parent?: VariableDeclaration | ParameterDeclaration | BindingElement; elements: NodeArray; } type BindingPattern = ObjectBindingPattern | ArrayBindingPattern; @@ -615,41 +642,45 @@ declare namespace ts { } interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { kind: SyntaxKind.Constructor; + parent?: ClassDeclaration | ClassExpression; body?: FunctionBody; } + /** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */ interface SemicolonClassElement extends ClassElement { kind: SyntaxKind.SemicolonClassElement; + parent?: ClassDeclaration | ClassExpression; } interface GetAccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { kind: SyntaxKind.GetAccessor; + parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression; name: PropertyName; body: FunctionBody; } interface SetAccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { kind: SyntaxKind.SetAccessor; + parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression; name: PropertyName; body: FunctionBody; } type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration; interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement, TypeElement { kind: SyntaxKind.IndexSignature; + parent?: ClassDeclaration | ClassExpression | InterfaceDeclaration | TypeLiteralNode; } interface TypeNode extends Node { _typeNodeBrand: any; } interface KeywordTypeNode extends TypeNode { - kind: SyntaxKind.AnyKeyword | SyntaxKind.NumberKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.VoidKeyword; + kind: SyntaxKind.AnyKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.VoidKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.NullKeyword | SyntaxKind.NeverKeyword; } interface ThisTypeNode extends TypeNode { kind: SyntaxKind.ThisType; } - interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { - kind: SyntaxKind.FunctionType | SyntaxKind.ConstructorType; - } - interface FunctionTypeNode extends FunctionOrConstructorTypeNode { + type FunctionOrConstructorTypeNode = FunctionTypeNode | ConstructorTypeNode; + interface FunctionTypeNode extends TypeNode, SignatureDeclaration { kind: SyntaxKind.FunctionType; } - interface ConstructorTypeNode extends FunctionOrConstructorTypeNode { + interface ConstructorTypeNode extends TypeNode, SignatureDeclaration { kind: SyntaxKind.ConstructorType; } interface TypeReferenceNode extends TypeNode { @@ -678,15 +709,14 @@ declare namespace ts { kind: SyntaxKind.TupleType; elementTypes: NodeArray; } - interface UnionOrIntersectionTypeNode extends TypeNode { - kind: SyntaxKind.UnionType | SyntaxKind.IntersectionType; + type UnionOrIntersectionTypeNode = UnionTypeNode | IntersectionTypeNode; + interface UnionTypeNode extends TypeNode { + kind: SyntaxKind.UnionType; types: NodeArray; } - interface UnionTypeNode extends UnionOrIntersectionTypeNode { - kind: SyntaxKind.UnionType; - } - interface IntersectionTypeNode extends UnionOrIntersectionTypeNode { + interface IntersectionTypeNode extends TypeNode { kind: SyntaxKind.IntersectionType; + types: NodeArray; } interface ParenthesizedTypeNode extends TypeNode { kind: SyntaxKind.ParenthesizedType; @@ -704,6 +734,7 @@ declare namespace ts { } interface MappedTypeNode extends TypeNode, Declaration { kind: SyntaxKind.MappedType; + parent?: TypeAliasDeclaration; readonlyToken?: ReadonlyToken; typeParameter: TypeParameterDeclaration; questionToken?: QuestionToken; @@ -718,11 +749,14 @@ declare namespace ts { } interface Expression extends Node { _expressionBrand: any; - contextualType?: Type; } interface OmittedExpression extends Expression { kind: SyntaxKind.OmittedExpression; } + interface PartiallyEmittedExpression extends LeftHandSideExpression { + kind: SyntaxKind.PartiallyEmittedExpression; + expression: Expression; + } interface UnaryExpression extends Expression { _unaryExpressionBrand: any; } @@ -750,13 +784,13 @@ declare namespace ts { interface PrimaryExpression extends MemberExpression { _primaryExpressionBrand: any; } - interface NullLiteral extends PrimaryExpression { + interface NullLiteral extends PrimaryExpression, TypeNode { kind: SyntaxKind.NullKeyword; } - interface BooleanLiteral extends PrimaryExpression { + interface BooleanLiteral extends PrimaryExpression, TypeNode { kind: SyntaxKind.TrueKeyword | SyntaxKind.FalseKeyword; } - interface ThisExpression extends PrimaryExpression { + interface ThisExpression extends PrimaryExpression, KeywordTypeNode { kind: SyntaxKind.ThisKeyword; } interface SuperExpression extends PrimaryExpression { @@ -864,16 +898,18 @@ declare namespace ts { } interface NumericLiteral extends LiteralExpression { kind: SyntaxKind.NumericLiteral; - trailingComment?: string; } interface TemplateHead extends LiteralLikeNode { kind: SyntaxKind.TemplateHead; + parent?: TemplateExpression; } interface TemplateMiddle extends LiteralLikeNode { kind: SyntaxKind.TemplateMiddle; + parent?: TemplateSpan; } interface TemplateTail extends LiteralLikeNode { kind: SyntaxKind.TemplateTail; + parent?: TemplateSpan; } type TemplateLiteral = TemplateExpression | NoSubstitutionTemplateLiteral; interface TemplateExpression extends PrimaryExpression { @@ -883,6 +919,7 @@ declare namespace ts { } interface TemplateSpan extends Node { kind: SyntaxKind.TemplateSpan; + parent?: TemplateExpression; expression: Expression; literal: TemplateMiddle | TemplateTail; } @@ -899,18 +936,18 @@ declare namespace ts { expression: Expression; } /** - * This interface is a base interface for ObjectLiteralExpression and JSXAttributes to extend from. JSXAttributes is similar to - * ObjectLiteralExpression in that it contains array of properties; however, JSXAttributes' properties can only be - * JSXAttribute or JSXSpreadAttribute. ObjectLiteralExpression, on the other hand, can only have properties of type - * ObjectLiteralElement (e.g. PropertyAssignment, ShorthandPropertyAssignment etc.) - **/ + * This interface is a base interface for ObjectLiteralExpression and JSXAttributes to extend from. JSXAttributes is similar to + * ObjectLiteralExpression in that it contains array of properties; however, JSXAttributes' properties can only be + * JSXAttribute or JSXSpreadAttribute. ObjectLiteralExpression, on the other hand, can only have properties of type + * ObjectLiteralElement (e.g. PropertyAssignment, ShorthandPropertyAssignment etc.) + */ interface ObjectLiteralExpressionBase extends PrimaryExpression, Declaration { properties: NodeArray; } interface ObjectLiteralExpression extends ObjectLiteralExpressionBase { kind: SyntaxKind.ObjectLiteralExpression; } - type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression; + type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression | ParenthesizedExpression; type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression; interface PropertyAccessExpression extends MemberExpression, Declaration { kind: SyntaxKind.PropertyAccessExpression; @@ -945,6 +982,7 @@ declare namespace ts { } interface ExpressionWithTypeArguments extends TypeNode { kind: SyntaxKind.ExpressionWithTypeArguments; + parent?: HeritageClause; expression: LeftHandSideExpression; typeArguments?: NodeArray; } @@ -952,14 +990,14 @@ declare namespace ts { kind: SyntaxKind.NewExpression; expression: LeftHandSideExpression; typeArguments?: NodeArray; - arguments: NodeArray; + arguments?: NodeArray; } interface TaggedTemplateExpression extends MemberExpression { kind: SyntaxKind.TaggedTemplateExpression; tag: LeftHandSideExpression; template: TemplateLiteral; } - type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression | Decorator; + type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression | Decorator | JsxOpeningLikeElement; interface AsExpression extends Expression { kind: SyntaxKind.AsExpression; expression: Expression; @@ -975,49 +1013,67 @@ declare namespace ts { kind: SyntaxKind.NonNullExpression; expression: Expression; } + interface MetaProperty extends PrimaryExpression { + kind: SyntaxKind.MetaProperty; + keywordToken: SyntaxKind; + name: Identifier; + } interface JsxElement extends PrimaryExpression { kind: SyntaxKind.JsxElement; openingElement: JsxOpeningElement; children: NodeArray; closingElement: JsxClosingElement; } + type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement; + type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute; type JsxTagNameExpression = PrimaryExpression | PropertyAccessExpression; + interface JsxAttributes extends ObjectLiteralExpressionBase { + parent?: JsxOpeningLikeElement; + } interface JsxOpeningElement extends Expression { kind: SyntaxKind.JsxOpeningElement; + parent?: JsxElement; tagName: JsxTagNameExpression; - attributes: NodeArray; + attributes: JsxAttributes; } interface JsxSelfClosingElement extends PrimaryExpression { kind: SyntaxKind.JsxSelfClosingElement; tagName: JsxTagNameExpression; - attributes: NodeArray; + attributes: JsxAttributes; } - type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement; - type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute; - interface JsxAttribute extends Node { + interface JsxAttribute extends ObjectLiteralElement { kind: SyntaxKind.JsxAttribute; + parent?: JsxAttributes; name: Identifier; initializer?: StringLiteral | JsxExpression; } - interface JsxSpreadAttribute extends Node { + interface JsxSpreadAttribute extends ObjectLiteralElement { kind: SyntaxKind.JsxSpreadAttribute; + parent?: JsxAttributes; expression: Expression; } interface JsxClosingElement extends Node { kind: SyntaxKind.JsxClosingElement; + parent?: JsxElement; tagName: JsxTagNameExpression; } interface JsxExpression extends Expression { kind: SyntaxKind.JsxExpression; + parent?: JsxElement | JsxAttributeLike; + dotDotDotToken?: Token; expression?: Expression; } interface JsxText extends Node { kind: SyntaxKind.JsxText; + parent?: JsxElement; } type JsxChild = JsxText | JsxExpression | JsxElement | JsxSelfClosingElement; interface Statement extends Node { _statementBrand: any; } + interface NotEmittedStatement extends Statement { + kind: SyntaxKind.NotEmittedStatement; + } interface EmptyStatement extends Statement { kind: SyntaxKind.EmptyStatement; } @@ -1028,7 +1084,7 @@ declare namespace ts { kind: SyntaxKind.MissingDeclaration; name?: Identifier; } - type BlockLike = SourceFile | Block | ModuleBlock | CaseClause; + type BlockLike = SourceFile | Block | ModuleBlock | CaseOrDefaultClause; interface Block extends Statement { kind: SyntaxKind.Block; statements: NodeArray; @@ -1072,6 +1128,7 @@ declare namespace ts { } interface ForOfStatement extends IterationStatement { kind: SyntaxKind.ForOfStatement; + awaitModifier?: AwaitKeywordToken; initializer: ForInitializer; expression: Expression; } @@ -1101,15 +1158,18 @@ declare namespace ts { } interface CaseBlock extends Node { kind: SyntaxKind.CaseBlock; + parent?: SwitchStatement; clauses: NodeArray; } interface CaseClause extends Node { kind: SyntaxKind.CaseClause; + parent?: CaseBlock; expression: Expression; statements: NodeArray; } interface DefaultClause extends Node { kind: SyntaxKind.DefaultClause; + parent?: CaseBlock; statements: NodeArray; } type CaseOrDefaultClause = CaseClause | DefaultClause; @@ -1130,6 +1190,7 @@ declare namespace ts { } interface CatchClause extends Node { kind: SyntaxKind.CatchClause; + parent?: TryStatement; variableDeclaration: VariableDeclaration; block: Block; } @@ -1165,8 +1226,9 @@ declare namespace ts { } interface HeritageClause extends Node { kind: SyntaxKind.HeritageClause; - token: SyntaxKind; - types?: NodeArray; + parent?: InterfaceDeclaration | ClassDeclaration | ClassExpression; + token: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword; + types: NodeArray; } interface TypeAliasDeclaration extends DeclarationStatement { kind: SyntaxKind.TypeAliasDeclaration; @@ -1176,6 +1238,7 @@ declare namespace ts { } interface EnumMember extends Declaration { kind: SyntaxKind.EnumMember; + parent?: EnumDeclaration; name: PropertyName; initializer?: Expression; } @@ -1184,91 +1247,121 @@ declare namespace ts { name: Identifier; members: NodeArray; } - type ModuleBody = ModuleBlock | ModuleDeclaration; type ModuleName = Identifier | StringLiteral; + type ModuleBody = NamespaceBody | JSDocNamespaceBody; interface ModuleDeclaration extends DeclarationStatement { kind: SyntaxKind.ModuleDeclaration; - name: Identifier | StringLiteral; - body?: ModuleBlock | NamespaceDeclaration | JSDocNamespaceDeclaration | Identifier; + parent?: ModuleBody | SourceFile; + name: ModuleName; + body?: ModuleBody | JSDocNamespaceDeclaration; } + type NamespaceBody = ModuleBlock | NamespaceDeclaration; interface NamespaceDeclaration extends ModuleDeclaration { name: Identifier; - body: ModuleBlock | NamespaceDeclaration; + body: NamespaceBody; } + type JSDocNamespaceBody = Identifier | JSDocNamespaceDeclaration; interface JSDocNamespaceDeclaration extends ModuleDeclaration { name: Identifier; - body: JSDocNamespaceDeclaration | Identifier; + body: JSDocNamespaceBody; } interface ModuleBlock extends Node, Statement { kind: SyntaxKind.ModuleBlock; + parent?: ModuleDeclaration; statements: NodeArray; } type ModuleReference = EntityName | ExternalModuleReference; + /** + * One of: + * - import x = require("mod"); + * - import x = M.x; + */ interface ImportEqualsDeclaration extends DeclarationStatement { kind: SyntaxKind.ImportEqualsDeclaration; + parent?: SourceFile | ModuleBlock; name: Identifier; moduleReference: ModuleReference; } interface ExternalModuleReference extends Node { kind: SyntaxKind.ExternalModuleReference; + parent?: ImportEqualsDeclaration; expression?: Expression; } interface ImportDeclaration extends Statement { kind: SyntaxKind.ImportDeclaration; + parent?: SourceFile | ModuleBlock; importClause?: ImportClause; + /** If this is not a StringLiteral it will be a grammar error. */ moduleSpecifier: Expression; } type NamedImportBindings = NamespaceImport | NamedImports; interface ImportClause extends Declaration { kind: SyntaxKind.ImportClause; + parent?: ImportDeclaration; name?: Identifier; namedBindings?: NamedImportBindings; } interface NamespaceImport extends Declaration { kind: SyntaxKind.NamespaceImport; + parent?: ImportClause; name: Identifier; } interface NamespaceExportDeclaration extends DeclarationStatement { kind: SyntaxKind.NamespaceExportDeclaration; name: Identifier; - moduleReference: LiteralLikeNode; } interface ExportDeclaration extends DeclarationStatement { kind: SyntaxKind.ExportDeclaration; + parent?: SourceFile | ModuleBlock; exportClause?: NamedExports; + /** If this is not a StringLiteral it will be a grammar error. */ moduleSpecifier?: Expression; } interface NamedImports extends Node { kind: SyntaxKind.NamedImports; + parent?: ImportClause; elements: NodeArray; } interface NamedExports extends Node { kind: SyntaxKind.NamedExports; + parent?: ExportDeclaration; elements: NodeArray; } type NamedImportsOrExports = NamedImports | NamedExports; interface ImportSpecifier extends Declaration { kind: SyntaxKind.ImportSpecifier; + parent?: NamedImports; propertyName?: Identifier; name: Identifier; } interface ExportSpecifier extends Declaration { kind: SyntaxKind.ExportSpecifier; + parent?: NamedExports; propertyName?: Identifier; name: Identifier; } type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier; interface ExportAssignment extends DeclarationStatement { kind: SyntaxKind.ExportAssignment; + parent?: SourceFile; isExportEquals?: boolean; expression: Expression; } interface FileReference extends TextRange { fileName: string; } + interface CheckJsDirective extends TextRange { + enabled: boolean; + } + type CommentKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia; interface CommentRange extends TextRange { hasTrailingNewLine?: boolean; - kind: SyntaxKind; + kind: CommentKind; + } + interface SynthesizedComment extends CommentRange { + text: string; + pos: -1; + end: -1; } interface JSDocTypeExpression extends Node { kind: SyntaxKind.JSDocTypeExpression; @@ -1412,9 +1505,21 @@ declare namespace ts { ArrayMutation = 256, Referenced = 512, Shared = 1024, + PreFinally = 2048, + AfterFinally = 4096, Label = 12, Condition = 96, } + interface FlowLock { + locked?: boolean; + } + interface AfterFinallyFlow extends FlowNode, FlowLock { + antecedent: FlowNode; + } + interface PreFinallyFlow extends FlowNode { + antecedent: FlowNode; + lock: FlowLock; + } interface FlowNode { flags: FlowFlags; id?: number; @@ -1457,7 +1562,6 @@ declare namespace ts { statements: NodeArray; endOfFileToken: Token; fileName: string; - path: Path; text: string; amdDependencies: AmdDependency[]; moduleName: string; @@ -1476,6 +1580,10 @@ declare namespace ts { hasNoDefaultLib: boolean; languageVersion: ScriptTarget; } + interface Bundle extends Node { + kind: SyntaxKind.Bundle; + sourceFiles: SourceFile[]; + } interface ScriptReferenceHost { getCompilerOptions(): CompilerOptions; getSourceFile(fileName: string): SourceFile; @@ -1486,9 +1594,9 @@ declare namespace ts { useCaseSensitiveFileNames: boolean; readDirectory(rootDir: string, extensions: string[], excludes: string[], includes: string[]): string[]; /** - * Gets a value indicating whether the specified path exists and is a file. - * @param path The path to test. - */ + * Gets a value indicating whether the specified path exists and is a file. + * @param path The path to test. + */ fileExists(path: string): boolean; readFile(path: string): string; } @@ -1521,7 +1629,7 @@ declare namespace ts { * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter * will be invoked when writing the JavaScript and declaration files. */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean): EmitResult; + emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult; getOptionsDiagnostics(cancellationToken?: CancellationToken): Diagnostic[]; getGlobalDiagnostics(cancellationToken?: CancellationToken): Diagnostic[]; getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[]; @@ -1532,6 +1640,12 @@ declare namespace ts { */ getTypeChecker(): TypeChecker; } + interface CustomTransformers { + /** Custom transformers to evaluate before built-in transformations. */ + before?: TransformerFactory[]; + /** Custom transformers to evaluate after built-in transformations. */ + after?: TransformerFactory[]; + } interface SourceMapSpan { /** Line number in the .js file. */ emittedLine: number; @@ -1575,11 +1689,20 @@ declare namespace ts { getDeclaredTypeOfSymbol(symbol: Symbol): Type; getPropertiesOfType(type: Type): Symbol[]; getPropertyOfType(type: Type, propertyName: string): Symbol; + getIndexInfoOfType(type: Type, kind: IndexKind): IndexInfo; getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; getIndexTypeOfType(type: Type, kind: IndexKind): Type; - getBaseTypes(type: InterfaceType): ObjectType[]; + getBaseTypes(type: InterfaceType): BaseType[]; + getBaseTypeOfLiteralType(type: Type): Type; + getWidenedType(type: Type): Type; getReturnTypeOfSignature(signature: Signature): Type; getNonNullableType(type: Type): Type; + /** Note that the resulting nodes cannot be checked. */ + typeToTypeNode(type: Type, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): TypeNode; + /** Note that the resulting nodes cannot be checked. */ + signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): SignatureDeclaration; + /** Note that the resulting nodes cannot be checked. */ + indexInfoToIndexSignatureDeclaration(indexInfo: IndexInfo, kind: IndexKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): IndexSignatureDeclaration; getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; getSymbolAtLocation(node: Node): Symbol; getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[]; @@ -1587,6 +1710,8 @@ declare namespace ts { getExportSpecifierLocalTargetSymbol(location: ExportSpecifier): Symbol; getPropertySymbolOfDestructuringAssignment(location: Identifier): Symbol; getTypeAtLocation(node: Node): Type; + getTypeFromTypeNode(node: TypeNode): Type; + signatureToString(signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): string; typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; getSymbolDisplayBuilder(): SymbolDisplayBuilder; @@ -1602,18 +1727,30 @@ declare namespace ts { isUnknownSymbol(symbol: Symbol): boolean; getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; + /** Follow all aliases to get the original symbol. */ getAliasedSymbol(symbol: Symbol): Symbol; getExportsOfModule(moduleSymbol: Symbol): Symbol[]; - getJsxElementAttributesType(elementNode: JsxOpeningLikeElement): Type; + getAllAttributesTypeFromJsxOpeningLikeElement(elementNode: JsxOpeningLikeElement): Type; getJsxIntrinsicTagNames(): Symbol[]; isOptionalParameter(node: ParameterDeclaration): boolean; getAmbientModules(): Symbol[]; tryGetMemberInModuleExports(memberName: string, moduleSymbol: Symbol): Symbol | undefined; + getApparentType(type: Type): Type; + } + enum NodeBuilderFlags { + None = 0, + allowThisInObjectLiteral = 1, + allowQualifedNameInPlaceOfIdentifier = 2, + allowTypeParameterInQualifiedName = 4, + allowAnonymousIdentifier = 8, + allowEmptyUnionOrIntersection = 16, + allowEmptyTuple = 32, } interface SymbolDisplayBuilder { buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): void; + buildIndexSignatureDisplay(info: IndexInfo, writer: SymbolWriter, kind: IndexKind, enclosingDeclaration?: Node, globalFlags?: TypeFormatFlags, symbolStack?: Symbol[]): void; buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; buildTypePredicateDisplay(predicate: TypePredicate, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; @@ -1629,6 +1766,7 @@ declare namespace ts { writeSpace(text: string): void; writeStringLiteral(text: string): void; writeParameter(text: string): void; + writeProperty(text: string): void; writeSymbol(text: string, symbol: Symbol): void; writeLine(): void; increaseIndent(): void; @@ -1636,6 +1774,7 @@ declare namespace ts { clear(): void; trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; reportInaccessibleThisError(): void; + reportIllegalExtends(): void; } enum TypeFormatFlags { None = 0, @@ -1650,6 +1789,8 @@ declare namespace ts { InFirstTypeArgument = 256, InTypeAlias = 512, UseTypeAliasValue = 1024, + SuppressAnyReturnType = 2048, + AddUndefined = 4096, } enum SymbolFormatFlags { None = 0, @@ -1699,13 +1840,10 @@ declare namespace ts { ExportType = 2097152, ExportNamespace = 4194304, Alias = 8388608, - Instantiated = 16777216, - Merged = 33554432, - Transient = 67108864, - Prototype = 134217728, - SyntheticProperty = 268435456, - Optional = 536870912, - ExportStar = 1073741824, + Prototype = 16777216, + ExportStar = 33554432, + Optional = 67108864, + Transient = 134217728, Enum = 384, Variable = 3, Value = 107455, @@ -1771,6 +1909,7 @@ declare namespace ts { Intersection = 131072, Index = 262144, IndexedAccess = 524288, + NonPrimitive = 16777216, Literal = 480, StringOrNumberLiteral = 96, PossiblyFalsy = 7406, @@ -1780,9 +1919,10 @@ declare namespace ts { EnumLike = 272, UnionOrIntersection = 196608, StructuredType = 229376, - StructuredOrTypeParameter = 507904, - Narrowable = 1033215, - NotUnionOrUnit = 33281, + StructuredOrTypeVariable = 1032192, + TypeVariable = 540672, + Narrowable = 17810431, + NotUnionOrUnit = 16810497, } type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; interface Type { @@ -1798,7 +1938,7 @@ declare namespace ts { regularType?: LiteralType; } interface EnumType extends Type { - memberTypes: Map; + memberTypes: EnumLiteralType[]; } interface EnumLiteralType extends LiteralType { baseType: EnumType & UnionType; @@ -1819,12 +1959,14 @@ declare namespace ts { interface ObjectType extends Type { objectFlags: ObjectFlags; } + /** Class and interface types (TypeFlags.Class and TypeFlags.Interface). */ interface InterfaceType extends ObjectType { typeParameters: TypeParameter[]; outerTypeParameters: TypeParameter[]; localTypeParameters: TypeParameter[]; thisType: TypeParameter; } + type BaseType = ObjectType | IntersectionType; interface InterfaceTypeWithDeclaredMembers extends InterfaceType { declaredProperties: Symbol[]; declaredCallSignatures: Signature[]; @@ -1832,6 +1974,16 @@ declare namespace ts { declaredStringIndexInfo: IndexInfo; declaredNumberIndexInfo: IndexInfo; } + /** + * Type references (TypeFlags.Reference). When a class or interface has type parameters or + * a "this" type, references to the class or interface are made using type references. The + * typeArguments property specifies the types to substitute for the type parameters of the + * class or interface and optionally includes an extra element that specifies the type to + * substitute for "this" in the resulting instantiation. When no extra argument is present, + * the type reference itself is substituted for "this". The typeArguments property is undefined + * if the class or interface has no type parameters and the reference isn't specifying an + * explicit "this" argument. + */ interface TypeReference extends ObjectType { target: GenericType; typeArguments: Type[]; @@ -1850,15 +2002,19 @@ declare namespace ts { elementType: Type; finalArrayType?: Type; } - interface TypeParameter extends Type { + interface TypeVariable extends Type { + } + interface TypeParameter extends TypeVariable { constraint: Type; + default?: Type; } - interface IndexType extends Type { - type: TypeParameter; - } - interface IndexedAccessType extends Type { + interface IndexedAccessType extends TypeVariable { objectType: Type; indexType: Type; + constraint?: Type; + } + interface IndexType extends Type { + type: TypeVariable | UnionOrIntersectionType; } enum SignatureKind { Call = 0, @@ -1878,6 +2034,10 @@ declare namespace ts { isReadonly: boolean; declaration?: SignatureDeclaration; } + interface JsFileExtensionInfo { + extension: string; + isMixedContent: boolean; + } interface DiagnosticMessage { key: string; category: DiagnosticCategory; @@ -1913,7 +2073,10 @@ declare namespace ts { Classic = 1, NodeJs = 2, } - type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike; + interface PluginImport { + name: string; + } + type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike | PluginImport[]; interface CompilerOptions { allowJs?: boolean; allowSyntheticDefaultImports?: boolean; @@ -1922,9 +2085,11 @@ declare namespace ts { alwaysStrict?: boolean; baseUrl?: string; charset?: string; + checkJs?: boolean; declaration?: boolean; declarationDir?: string; disableSizeLimit?: boolean; + downlevelIteration?: boolean; emitBOM?: boolean; emitDecoratorMetadata?: boolean; experimentalDecorators?: boolean; @@ -1969,6 +2134,7 @@ declare namespace ts { skipDefaultLibCheck?: boolean; sourceMap?: boolean; sourceRoot?: string; + strict?: boolean; strictNullChecks?: boolean; suppressExcessPropertyErrors?: boolean; suppressImplicitAnyIndexErrors?: boolean; @@ -2007,6 +2173,7 @@ declare namespace ts { None = 0, Preserve = 1, React = 2, + ReactNative = 3, } enum NewLineKind { CarriageReturnLineFeed = 0, @@ -2022,6 +2189,7 @@ declare namespace ts { JSX = 2, TS = 3, TSX = 4, + External = 5, } enum ScriptTarget { ES3 = 0, @@ -2102,7 +2270,6 @@ declare namespace ts { } interface ResolvedModuleWithFailedLookupLocations { resolvedModule: ResolvedModuleFull | undefined; - failedLookupLocations: string[]; } interface ResolvedTypeReferenceDirective { primary: boolean; @@ -2131,6 +2298,206 @@ declare namespace ts { resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[]; getEnvironmentVariable?(name: string): string; } + enum EmitFlags { + SingleLine = 1, + AdviseOnEmitNode = 2, + NoSubstitution = 4, + CapturesThis = 8, + NoLeadingSourceMap = 16, + NoTrailingSourceMap = 32, + NoSourceMap = 48, + NoNestedSourceMaps = 64, + NoTokenLeadingSourceMaps = 128, + NoTokenTrailingSourceMaps = 256, + NoTokenSourceMaps = 384, + NoLeadingComments = 512, + NoTrailingComments = 1024, + NoComments = 1536, + NoNestedComments = 2048, + HelperName = 4096, + ExportName = 8192, + LocalName = 16384, + Indented = 32768, + NoIndentation = 65536, + AsyncFunctionBody = 131072, + ReuseTempVariableScope = 262144, + CustomPrologue = 524288, + NoHoisting = 1048576, + HasEndOfDeclarationMarker = 2097152, + Iterator = 4194304, + } + interface EmitHelper { + readonly name: string; + readonly scoped: boolean; + readonly text: string; + readonly priority?: number; + } + enum EmitHint { + SourceFile = 0, + Expression = 1, + IdentifierName = 2, + Unspecified = 3, + } + interface TransformationContext { + /** Gets the compiler options supplied to the transformer. */ + getCompilerOptions(): CompilerOptions; + /** Starts a new lexical environment. */ + startLexicalEnvironment(): void; + /** Suspends the current lexical environment, usually after visiting a parameter list. */ + suspendLexicalEnvironment(): void; + /** Resumes a suspended lexical environment, usually before visiting a function body. */ + resumeLexicalEnvironment(): void; + /** Ends a lexical environment, returning any declarations. */ + endLexicalEnvironment(): Statement[]; + /** Hoists a function declaration to the containing scope. */ + hoistFunctionDeclaration(node: FunctionDeclaration): void; + /** Hoists a variable declaration to the containing scope. */ + hoistVariableDeclaration(node: Identifier): void; + /** Records a request for a non-scoped emit helper in the current context. */ + requestEmitHelper(helper: EmitHelper): void; + /** Gets and resets the requested non-scoped emit helpers. */ + readEmitHelpers(): EmitHelper[] | undefined; + /** Enables expression substitutions in the pretty printer for the provided SyntaxKind. */ + enableSubstitution(kind: SyntaxKind): void; + /** Determines whether expression substitutions are enabled for the provided node. */ + isSubstitutionEnabled(node: Node): boolean; + /** + * Hook used by transformers to substitute expressions just before they + * are emitted by the pretty printer. + * + * NOTE: Transformation hooks should only be modified during `Transformer` initialization, + * before returning the `NodeTransformer` callback. + */ + onSubstituteNode: (hint: EmitHint, node: Node) => Node; + /** + * Enables before/after emit notifications in the pretty printer for the provided + * SyntaxKind. + */ + enableEmitNotification(kind: SyntaxKind): void; + /** + * Determines whether before/after emit notifications should be raised in the pretty + * printer when it emits a node. + */ + isEmitNotificationEnabled(node: Node): boolean; + /** + * Hook used to allow transformers to capture state before or after + * the printer emits a node. + * + * NOTE: Transformation hooks should only be modified during `Transformer` initialization, + * before returning the `NodeTransformer` callback. + */ + onEmitNode: (hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void) => void; + } + interface TransformationResult { + /** Gets the transformed source files. */ + transformed: T[]; + /** Gets diagnostics for the transformation. */ + diagnostics?: Diagnostic[]; + /** + * Gets a substitute for a node, if one is available; otherwise, returns the original node. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to substitute. + */ + substituteNode(hint: EmitHint, node: Node): Node; + /** + * Emits a node with possible notification. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to emit. + * @param emitCallback A callback used to emit the node. + */ + emitNodeWithNotification(hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void): void; + /** + * Clean up EmitNode entries on any parse-tree nodes. + */ + dispose(): void; + } + /** + * A function that is used to initialize and return a `Transformer` callback, which in turn + * will be used to transform one or more nodes. + */ + type TransformerFactory = (context: TransformationContext) => Transformer; + /** + * A function that transforms a node. + */ + type Transformer = (node: T) => T; + /** + * A function that accepts and possibly transforms a node. + */ + type Visitor = (node: Node) => VisitResult; + type VisitResult = T | T[]; + interface Printer { + /** + * Print a node and its subtree as-is, without any emit transformations. + * @param hint A value indicating the purpose of a node. This is primarily used to + * distinguish between an `Identifier` used in an expression position, versus an + * `Identifier` used as an `IdentifierName` as part of a declaration. For most nodes you + * should just pass `Unspecified`. + * @param node The node to print. The node and its subtree are printed as-is, without any + * emit transformations. + * @param sourceFile A source file that provides context for the node. The source text of + * the file is used to emit the original source content for literals and identifiers, while + * the identifiers of the source file are used when generating unique names to avoid + * collisions. + */ + printNode(hint: EmitHint, node: Node, sourceFile: SourceFile): string; + /** + * Prints a source file as-is, without any emit transformations. + */ + printFile(sourceFile: SourceFile): string; + /** + * Prints a bundle of source files as-is, without any emit transformations. + */ + printBundle(bundle: Bundle): string; + } + interface PrintHandlers { + /** + * A hook used by the Printer when generating unique names to avoid collisions with + * globally defined names that exist outside of the current source file. + */ + hasGlobalName?(name: string): boolean; + /** + * A hook used by the Printer to provide notifications prior to emitting a node. A + * compatible implementation **must** invoke `emitCallback` with the provided `hint` and + * `node` values. + * @param hint A hint indicating the intended purpose of the node. + * @param node The node to emit. + * @param emitCallback A callback that, when invoked, will emit the node. + * @example + * ```ts + * var printer = createPrinter(printerOptions, { + * onEmitNode(hint, node, emitCallback) { + * // set up or track state prior to emitting the node... + * emitCallback(hint, node); + * // restore state after emitting the node... + * } + * }); + * ``` + */ + onEmitNode?(hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void): void; + /** + * A hook used by the Printer to perform just-in-time substitution of a node. This is + * primarily used by node transformations that need to substitute one node for another, + * such as replacing `myExportedVar` with `exports.myExportedVar`. + * @param hint A hint indicating the intended purpose of the node. + * @param node The node to emit. + * @example + * ```ts + * var printer = createPrinter(printerOptions, { + * substituteNode(hint, node) { + * // perform substitution if necessary... + * return node; + * } + * }); + * ``` + */ + substituteNode?(hint: EmitHint, node: Node): Node; + } + interface PrinterOptions { + removeComments?: boolean; + newLine?: NewLineKind; + } interface TextSpan { start: number; length: number; @@ -2145,8 +2512,10 @@ declare namespace ts { } declare namespace ts { /** The version of the TypeScript compiler release */ - const version = "2.2.0-dev.20161127"; + const version = "2.3.0-dev.20170419"; } +declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any; +declare function clearTimeout(handle: any): void; declare namespace ts { type FileWatcherCallback = (fileName: string, removed?: boolean) => void; type DirectoryWatcherCallback = (fileName: string) => void; @@ -2192,6 +2561,7 @@ declare namespace ts { directoryName: string; referenceCount: number; } + function getNodeMajorVersion(): number; let sys: System; } declare namespace ts { @@ -2237,12 +2607,12 @@ declare namespace ts { function isWhiteSpaceSingleLine(ch: number): boolean; function isLineBreak(ch: number): boolean; function couldStartTrivia(text: string, pos: number): boolean; - function forEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: SyntaxKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U; - function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: SyntaxKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U; - function reduceEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: SyntaxKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; - function reduceEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: SyntaxKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; - function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; - function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; + function forEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U; + function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U; + function reduceEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; + function reduceEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; + function getLeadingCommentRanges(text: string, pos: number): CommentRange[] | undefined; + function getTrailingCommentRanges(text: string, pos: number): CommentRange[] | undefined; /** Optionally, get the shebang */ function getShebang(text: string): string; function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; @@ -2282,15 +2652,414 @@ declare namespace ts { function getCombinedModifierFlags(node: Node): ModifierFlags; function getCombinedNodeFlags(node: Node): NodeFlags; /** - * Checks to see if the locale is in the appropriate format, - * and if it is, attempts to set the appropriate language. - */ + * Checks to see if the locale is in the appropriate format, + * and if it is, attempts to set the appropriate language. + */ function validateLocaleAndSetLanguage(locale: string, sys: { getExecutingFilePath(): string; resolvePath(path: string): string; fileExists(fileName: string): boolean; readFile(fileName: string): string; }, errors?: Diagnostic[]): void; + function getOriginalNode(node: Node): Node; + function getOriginalNode(node: Node, nodeTest: (node: Node) => node is T): T; + /** + * Gets a value indicating whether a node originated in the parse tree. + * + * @param node The node to test. + */ + function isParseTreeNode(node: Node): boolean; + /** + * Gets the original parse tree node for a node. + * + * @param node The original node. + * @returns The original parse tree node if found; otherwise, undefined. + */ + function getParseTreeNode(node: Node): Node; + /** + * Gets the original parse tree node for a node. + * + * @param node The original node. + * @param nodeTest A callback used to ensure the correct type of parse tree node is returned. + * @returns The original parse tree node if found; otherwise, undefined. + */ + function getParseTreeNode(node: Node, nodeTest?: (node: Node) => node is T): T; + /** + * Remove extra underscore from escaped identifier text content. + * + * @param identifier The escaped identifier text. + * @returns The unescaped identifier text. + */ + function unescapeIdentifier(identifier: string): string; +} +declare namespace ts { + /** + * Make `elements` into a `NodeArray`. If `elements` is `undefined`, returns an empty `NodeArray`. + */ + function createNodeArray(elements?: T[], hasTrailingComma?: boolean): NodeArray; + function createLiteral(value: string): StringLiteral; + function createLiteral(value: number): NumericLiteral; + function createLiteral(value: boolean): BooleanLiteral; + /** Create a string literal whose source text is read from a source node during emit. */ + function createLiteral(sourceNode: StringLiteral | NumericLiteral | Identifier): StringLiteral; + function createLiteral(value: string | number | boolean): PrimaryExpression; + function createNumericLiteral(value: string): NumericLiteral; + function createIdentifier(text: string): Identifier; + /** Create a unique temporary variable. */ + function createTempVariable(recordTempVariable: ((node: Identifier) => void) | undefined): Identifier; + /** Create a unique temporary variable for use in a loop. */ + function createLoopVariable(): Identifier; + /** Create a unique name based on the supplied text. */ + function createUniqueName(text: string): Identifier; + /** Create a unique name generated for a node. */ + function getGeneratedNameForNode(node: Node): Identifier; + function createToken(token: TKind): Token; + function createSuper(): SuperExpression; + function createThis(): ThisExpression & Token; + function createNull(): NullLiteral & Token; + function createTrue(): BooleanLiteral & Token; + function createFalse(): BooleanLiteral & Token; + function createQualifiedName(left: EntityName, right: string | Identifier): QualifiedName; + function updateQualifiedName(node: QualifiedName, left: EntityName, right: Identifier): QualifiedName; + function createComputedPropertyName(expression: Expression): ComputedPropertyName; + function updateComputedPropertyName(node: ComputedPropertyName, expression: Expression): ComputedPropertyName; + function createSignatureDeclaration(kind: SyntaxKind, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): SignatureDeclaration; + function createFunctionTypeNode(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): FunctionTypeNode; + function updateFunctionTypeNode(node: FunctionTypeNode, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): FunctionTypeNode; + function createConstructorTypeNode(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): ConstructorTypeNode; + function updateConstructorTypeNode(node: ConstructorTypeNode, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): ConstructorTypeNode; + function createCallSignatureDeclaration(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): CallSignatureDeclaration; + function updateCallSignatureDeclaration(node: CallSignatureDeclaration, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): CallSignatureDeclaration; + function createConstructSignatureDeclaration(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): ConstructSignatureDeclaration; + function updateConstructSignatureDeclaration(node: ConstructSignatureDeclaration, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): ConstructSignatureDeclaration; + function createMethodSignature(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined): MethodSignature; + function updateMethodSignature(node: MethodSignature, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined, name: PropertyName, questionToken: QuestionToken | undefined): MethodSignature; + function createKeywordTypeNode(kind: KeywordTypeNode["kind"]): KeywordTypeNode; + function createThisTypeNode(): ThisTypeNode; + function createLiteralTypeNode(literal: Expression): LiteralTypeNode; + function updateLiteralTypeNode(node: LiteralTypeNode, literal: Expression): LiteralTypeNode; + function createTypeReferenceNode(typeName: string | EntityName, typeArguments: TypeNode[] | undefined): TypeReferenceNode; + function updateTypeReferenceNode(node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray | undefined): TypeReferenceNode; + function createTypePredicateNode(parameterName: Identifier | ThisTypeNode | string, type: TypeNode): TypePredicateNode; + function updateTypePredicateNode(node: TypePredicateNode, parameterName: Identifier | ThisTypeNode, type: TypeNode): TypePredicateNode; + function createTypeQueryNode(exprName: EntityName): TypeQueryNode; + function updateTypeQueryNode(node: TypeQueryNode, exprName: EntityName): TypeQueryNode; + function createArrayTypeNode(elementType: TypeNode): ArrayTypeNode; + function updateArrayTypeNode(node: ArrayTypeNode, elementType: TypeNode): ArrayTypeNode; + function createUnionOrIntersectionTypeNode(kind: SyntaxKind.UnionType, types: TypeNode[]): UnionTypeNode; + function createUnionOrIntersectionTypeNode(kind: SyntaxKind.IntersectionType, types: TypeNode[]): IntersectionTypeNode; + function createUnionOrIntersectionTypeNode(kind: SyntaxKind.UnionType | SyntaxKind.IntersectionType, types: TypeNode[]): UnionOrIntersectionTypeNode; + function updateUnionOrIntersectionTypeNode(node: UnionOrIntersectionTypeNode, types: NodeArray): UnionOrIntersectionTypeNode; + function createTypeLiteralNode(members: TypeElement[]): TypeLiteralNode; + function updateTypeLiteralNode(node: TypeLiteralNode, members: NodeArray): TypeLiteralNode; + function createTupleTypeNode(elementTypes: TypeNode[]): TupleTypeNode; + function updateTypleTypeNode(node: TupleTypeNode, elementTypes: TypeNode[]): TupleTypeNode; + function createMappedTypeNode(readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; + function updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; + function createTypeOperatorNode(type: TypeNode): TypeOperatorNode; + function updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; + function createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; + function updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; + function createTypeParameterDeclaration(name: string | Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined): TypeParameterDeclaration; + function updateTypeParameterDeclaration(node: TypeParameterDeclaration, name: Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined): TypeParameterDeclaration; + function createPropertySignature(name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertySignature; + function updatePropertySignature(node: PropertySignature, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertySignature; + function createIndexSignatureDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, parameters: ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; + function updateIndexSignatureDeclaration(node: IndexSignatureDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, parameters: ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; + function createParameter(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken?: QuestionToken, type?: TypeNode, initializer?: Expression): ParameterDeclaration; + function updateParameter(node: ParameterDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): ParameterDeclaration; + function createDecorator(expression: Expression): Decorator; + function updateDecorator(node: Decorator, expression: Expression): Decorator; + function createProperty(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression): PropertyDeclaration; + function updateProperty(node: PropertyDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: PropertyName, type: TypeNode | undefined, initializer: Expression): PropertyDeclaration; + function createMethodDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; + function updateMethod(node: MethodDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; + function createConstructor(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, parameters: ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; + function updateConstructor(node: ConstructorDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, parameters: ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; + function createGetAccessor(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | PropertyName, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration; + function updateGetAccessor(node: GetAccessorDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: PropertyName, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration; + function createSetAccessor(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | PropertyName, parameters: ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration; + function updateSetAccessor(node: SetAccessorDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: PropertyName, parameters: ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration; + function createObjectBindingPattern(elements: BindingElement[]): ObjectBindingPattern; + function updateObjectBindingPattern(node: ObjectBindingPattern, elements: BindingElement[]): ObjectBindingPattern; + function createArrayBindingPattern(elements: ArrayBindingElement[]): ArrayBindingPattern; + function updateArrayBindingPattern(node: ArrayBindingPattern, elements: ArrayBindingElement[]): ArrayBindingPattern; + function createBindingElement(dotDotDotToken: DotDotDotToken | undefined, propertyName: string | PropertyName | undefined, name: string | BindingName, initializer?: Expression): BindingElement; + function updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken | undefined, propertyName: PropertyName | undefined, name: BindingName, initializer: Expression | undefined): BindingElement; + function createArrayLiteral(elements?: Expression[], multiLine?: boolean): ArrayLiteralExpression; + function updateArrayLiteral(node: ArrayLiteralExpression, elements: Expression[]): ArrayLiteralExpression; + function createObjectLiteral(properties?: ObjectLiteralElementLike[], multiLine?: boolean): ObjectLiteralExpression; + function updateObjectLiteral(node: ObjectLiteralExpression, properties: ObjectLiteralElementLike[]): ObjectLiteralExpression; + function createPropertyAccess(expression: Expression, name: string | Identifier): PropertyAccessExpression; + function updatePropertyAccess(node: PropertyAccessExpression, expression: Expression, name: Identifier): PropertyAccessExpression; + function createElementAccess(expression: Expression, index: number | Expression): ElementAccessExpression; + function updateElementAccess(node: ElementAccessExpression, expression: Expression, argumentExpression: Expression): ElementAccessExpression; + function createCall(expression: Expression, typeArguments: TypeNode[] | undefined, argumentsArray: Expression[]): CallExpression; + function updateCall(node: CallExpression, expression: Expression, typeArguments: TypeNode[] | undefined, argumentsArray: Expression[]): CallExpression; + function createNew(expression: Expression, typeArguments: TypeNode[] | undefined, argumentsArray: Expression[] | undefined): NewExpression; + function updateNew(node: NewExpression, expression: Expression, typeArguments: TypeNode[] | undefined, argumentsArray: Expression[] | undefined): NewExpression; + function createTaggedTemplate(tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; + function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; + function createTypeAssertion(type: TypeNode, expression: Expression): TypeAssertion; + function updateTypeAssertion(node: TypeAssertion, type: TypeNode, expression: Expression): TypeAssertion; + function createParen(expression: Expression): ParenthesizedExpression; + function updateParen(node: ParenthesizedExpression, expression: Expression): ParenthesizedExpression; + function createFunctionExpression(modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block): FunctionExpression; + function updateFunctionExpression(node: FunctionExpression, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block): FunctionExpression; + function createArrowFunction(modifiers: Modifier[] | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction; + function updateArrowFunction(node: ArrowFunction, modifiers: Modifier[] | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: ConciseBody): ArrowFunction; + function createDelete(expression: Expression): DeleteExpression; + function updateDelete(node: DeleteExpression, expression: Expression): DeleteExpression; + function createTypeOf(expression: Expression): TypeOfExpression; + function updateTypeOf(node: TypeOfExpression, expression: Expression): TypeOfExpression; + function createVoid(expression: Expression): VoidExpression; + function updateVoid(node: VoidExpression, expression: Expression): VoidExpression; + function createAwait(expression: Expression): AwaitExpression; + function updateAwait(node: AwaitExpression, expression: Expression): AwaitExpression; + function createPrefix(operator: PrefixUnaryOperator, operand: Expression): PrefixUnaryExpression; + function updatePrefix(node: PrefixUnaryExpression, operand: Expression): PrefixUnaryExpression; + function createPostfix(operand: Expression, operator: PostfixUnaryOperator): PostfixUnaryExpression; + function updatePostfix(node: PostfixUnaryExpression, operand: Expression): PostfixUnaryExpression; + function createBinary(left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression): BinaryExpression; + function updateBinary(node: BinaryExpression, left: Expression, right: Expression): BinaryExpression; + function createConditional(condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression; + function createConditional(condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression; + function updateConditional(node: ConditionalExpression, condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression; + function createTemplateExpression(head: TemplateHead, templateSpans: TemplateSpan[]): TemplateExpression; + function updateTemplateExpression(node: TemplateExpression, head: TemplateHead, templateSpans: TemplateSpan[]): TemplateExpression; + function createYield(expression?: Expression): YieldExpression; + function createYield(asteriskToken: AsteriskToken, expression: Expression): YieldExpression; + function updateYield(node: YieldExpression, asteriskToken: AsteriskToken | undefined, expression: Expression): YieldExpression; + function createSpread(expression: Expression): SpreadElement; + function updateSpread(node: SpreadElement, expression: Expression): SpreadElement; + function createClassExpression(modifiers: Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, heritageClauses: HeritageClause[], members: ClassElement[]): ClassExpression; + function updateClassExpression(node: ClassExpression, modifiers: Modifier[] | undefined, name: Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, heritageClauses: HeritageClause[], members: ClassElement[]): ClassExpression; + function createOmittedExpression(): OmittedExpression; + function createExpressionWithTypeArguments(typeArguments: TypeNode[], expression: Expression): ExpressionWithTypeArguments; + function updateExpressionWithTypeArguments(node: ExpressionWithTypeArguments, typeArguments: TypeNode[], expression: Expression): ExpressionWithTypeArguments; + function createAsExpression(expression: Expression, type: TypeNode): AsExpression; + function updateAsExpression(node: AsExpression, expression: Expression, type: TypeNode): AsExpression; + function createNonNullExpression(expression: Expression): NonNullExpression; + function updateNonNullExpression(node: NonNullExpression, expression: Expression): NonNullExpression; + function createTemplateSpan(expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan; + function updateTemplateSpan(node: TemplateSpan, expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan; + function createBlock(statements: Statement[], multiLine?: boolean): Block; + function updateBlock(node: Block, statements: Statement[]): Block; + function createVariableStatement(modifiers: Modifier[] | undefined, declarationList: VariableDeclarationList | VariableDeclaration[]): VariableStatement; + function updateVariableStatement(node: VariableStatement, modifiers: Modifier[] | undefined, declarationList: VariableDeclarationList): VariableStatement; + function createVariableDeclarationList(declarations: VariableDeclaration[], flags?: NodeFlags): VariableDeclarationList; + function updateVariableDeclarationList(node: VariableDeclarationList, declarations: VariableDeclaration[]): VariableDeclarationList; + function createVariableDeclaration(name: string | BindingName, type?: TypeNode, initializer?: Expression): VariableDeclaration; + function updateVariableDeclaration(node: VariableDeclaration, name: BindingName, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration; + function createEmptyStatement(): EmptyStatement; + function createStatement(expression: Expression): ExpressionStatement; + function updateStatement(node: ExpressionStatement, expression: Expression): ExpressionStatement; + function createIf(expression: Expression, thenStatement: Statement, elseStatement?: Statement): IfStatement; + function updateIf(node: IfStatement, expression: Expression, thenStatement: Statement, elseStatement: Statement | undefined): IfStatement; + function createDo(statement: Statement, expression: Expression): DoStatement; + function updateDo(node: DoStatement, statement: Statement, expression: Expression): DoStatement; + function createWhile(expression: Expression, statement: Statement): WhileStatement; + function updateWhile(node: WhileStatement, expression: Expression, statement: Statement): WhileStatement; + function createFor(initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement): ForStatement; + function updateFor(node: ForStatement, initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement): ForStatement; + function createForIn(initializer: ForInitializer, expression: Expression, statement: Statement): ForInStatement; + function updateForIn(node: ForInStatement, initializer: ForInitializer, expression: Expression, statement: Statement): ForInStatement; + function createForOf(awaitModifier: AwaitKeywordToken, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement; + function updateForOf(node: ForOfStatement, awaitModifier: AwaitKeywordToken, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement; + function createContinue(label?: string | Identifier): ContinueStatement; + function updateContinue(node: ContinueStatement, label: Identifier | undefined): ContinueStatement; + function createBreak(label?: string | Identifier): BreakStatement; + function updateBreak(node: BreakStatement, label: Identifier | undefined): BreakStatement; + function createReturn(expression?: Expression): ReturnStatement; + function updateReturn(node: ReturnStatement, expression: Expression | undefined): ReturnStatement; + function createWith(expression: Expression, statement: Statement): WithStatement; + function updateWith(node: WithStatement, expression: Expression, statement: Statement): WithStatement; + function createSwitch(expression: Expression, caseBlock: CaseBlock): SwitchStatement; + function updateSwitch(node: SwitchStatement, expression: Expression, caseBlock: CaseBlock): SwitchStatement; + function createLabel(label: string | Identifier, statement: Statement): LabeledStatement; + function updateLabel(node: LabeledStatement, label: Identifier, statement: Statement): LabeledStatement; + function createThrow(expression: Expression): ThrowStatement; + function updateThrow(node: ThrowStatement, expression: Expression): ThrowStatement; + function createTry(tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined): TryStatement; + function updateTry(node: TryStatement, tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined): TryStatement; + function createFunctionDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration; + function updateFunctionDeclaration(node: FunctionDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration; + function createClassDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, heritageClauses: HeritageClause[], members: ClassElement[]): ClassDeclaration; + function updateClassDeclaration(node: ClassDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, heritageClauses: HeritageClause[], members: ClassElement[]): ClassDeclaration; + function createEnumDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | Identifier, members: EnumMember[]): EnumDeclaration; + function updateEnumDeclaration(node: EnumDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: Identifier, members: EnumMember[]): EnumDeclaration; + function createModuleDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration; + function updateModuleDeclaration(node: ModuleDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined): ModuleDeclaration; + function createModuleBlock(statements: Statement[]): ModuleBlock; + function updateModuleBlock(node: ModuleBlock, statements: Statement[]): ModuleBlock; + function createCaseBlock(clauses: CaseOrDefaultClause[]): CaseBlock; + function updateCaseBlock(node: CaseBlock, clauses: CaseOrDefaultClause[]): CaseBlock; + function createImportEqualsDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; + function updateImportEqualsDeclaration(node: ImportEqualsDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; + function createImportDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier?: Expression): ImportDeclaration; + function updateImportDeclaration(node: ImportDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression | undefined): ImportDeclaration; + function createImportClause(name: Identifier, namedBindings: NamedImportBindings): ImportClause; + function updateImportClause(node: ImportClause, name: Identifier, namedBindings: NamedImportBindings): ImportClause; + function createNamespaceImport(name: Identifier): NamespaceImport; + function updateNamespaceImport(node: NamespaceImport, name: Identifier): NamespaceImport; + function createNamedImports(elements: ImportSpecifier[]): NamedImports; + function updateNamedImports(node: NamedImports, elements: ImportSpecifier[]): NamedImports; + function createImportSpecifier(propertyName: Identifier | undefined, name: Identifier): ImportSpecifier; + function updateImportSpecifier(node: ImportSpecifier, propertyName: Identifier | undefined, name: Identifier): ImportSpecifier; + function createExportAssignment(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, isExportEquals: boolean, expression: Expression): ExportAssignment; + function updateExportAssignment(node: ExportAssignment, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, expression: Expression): ExportAssignment; + function createExportDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, exportClause: NamedExports | undefined, moduleSpecifier?: Expression): ExportDeclaration; + function updateExportDeclaration(node: ExportDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, exportClause: NamedExports | undefined, moduleSpecifier: Expression | undefined): ExportDeclaration; + function createNamedExports(elements: ExportSpecifier[]): NamedExports; + function updateNamedExports(node: NamedExports, elements: ExportSpecifier[]): NamedExports; + function createExportSpecifier(propertyName: string | Identifier | undefined, name: string | Identifier): ExportSpecifier; + function updateExportSpecifier(node: ExportSpecifier, propertyName: Identifier | undefined, name: Identifier): ExportSpecifier; + function createExternalModuleReference(expression: Expression): ExternalModuleReference; + function updateExternalModuleReference(node: ExternalModuleReference, expression: Expression): ExternalModuleReference; + function createJsxElement(openingElement: JsxOpeningElement, children: JsxChild[], closingElement: JsxClosingElement): JsxElement; + function updateJsxElement(node: JsxElement, openingElement: JsxOpeningElement, children: JsxChild[], closingElement: JsxClosingElement): JsxElement; + function createJsxSelfClosingElement(tagName: JsxTagNameExpression, attributes: JsxAttributes): JsxSelfClosingElement; + function updateJsxSelfClosingElement(node: JsxSelfClosingElement, tagName: JsxTagNameExpression, attributes: JsxAttributes): JsxSelfClosingElement; + function createJsxOpeningElement(tagName: JsxTagNameExpression, attributes: JsxAttributes): JsxOpeningElement; + function updateJsxOpeningElement(node: JsxOpeningElement, tagName: JsxTagNameExpression, attributes: JsxAttributes): JsxOpeningElement; + function createJsxClosingElement(tagName: JsxTagNameExpression): JsxClosingElement; + function updateJsxClosingElement(node: JsxClosingElement, tagName: JsxTagNameExpression): JsxClosingElement; + function createJsxAttributes(properties: JsxAttributeLike[]): JsxAttributes; + function updateJsxAttributes(jsxAttributes: JsxAttributes, properties: JsxAttributeLike[]): JsxAttributes; + function createJsxAttribute(name: Identifier, initializer: StringLiteral | JsxExpression): JsxAttribute; + function updateJsxAttribute(node: JsxAttribute, name: Identifier, initializer: StringLiteral | JsxExpression): JsxAttribute; + function createJsxSpreadAttribute(expression: Expression): JsxSpreadAttribute; + function updateJsxSpreadAttribute(node: JsxSpreadAttribute, expression: Expression): JsxSpreadAttribute; + function createJsxExpression(dotDotDotToken: DotDotDotToken | undefined, expression: Expression | undefined): JsxExpression; + function updateJsxExpression(node: JsxExpression, expression: Expression | undefined): JsxExpression; + function createHeritageClause(token: HeritageClause["token"], types: ExpressionWithTypeArguments[]): HeritageClause; + function updateHeritageClause(node: HeritageClause, types: ExpressionWithTypeArguments[]): HeritageClause; + function createCaseClause(expression: Expression, statements: Statement[]): CaseClause; + function updateCaseClause(node: CaseClause, expression: Expression, statements: Statement[]): CaseClause; + function createDefaultClause(statements: Statement[]): DefaultClause; + function updateDefaultClause(node: DefaultClause, statements: Statement[]): DefaultClause; + function createCatchClause(variableDeclaration: string | VariableDeclaration, block: Block): CatchClause; + function updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration, block: Block): CatchClause; + function createPropertyAssignment(name: string | PropertyName, initializer: Expression): PropertyAssignment; + function updatePropertyAssignment(node: PropertyAssignment, name: PropertyName, initializer: Expression): PropertyAssignment; + function createShorthandPropertyAssignment(name: string | Identifier, objectAssignmentInitializer?: Expression): ShorthandPropertyAssignment; + function updateShorthandPropertyAssignment(node: ShorthandPropertyAssignment, name: Identifier, objectAssignmentInitializer: Expression | undefined): ShorthandPropertyAssignment; + function createSpreadAssignment(expression: Expression): SpreadAssignment; + function updateSpreadAssignment(node: SpreadAssignment, expression: Expression): SpreadAssignment; + function createEnumMember(name: string | PropertyName, initializer?: Expression): EnumMember; + function updateEnumMember(node: EnumMember, name: PropertyName, initializer: Expression | undefined): EnumMember; + function updateSourceFileNode(node: SourceFile, statements: Statement[]): SourceFile; + /** + * Creates a shallow, memberwise clone of a node for mutation. + */ + function getMutableClone(node: T): T; + /** + * Creates a synthetic statement to act as a placeholder for a not-emitted statement in + * order to preserve comments. + * + * @param original The original statement. + */ + function createNotEmittedStatement(original: Node): NotEmittedStatement; + /** + * Creates a synthetic expression to act as a placeholder for a not-emitted expression in + * order to preserve comments or sourcemap positions. + * + * @param expression The inner expression to emit. + * @param original The original outer expression. + * @param location The location for the expression. Defaults to the positions from "original" if provided. + */ + function createPartiallyEmittedExpression(expression: Expression, original?: Node): PartiallyEmittedExpression; + function updatePartiallyEmittedExpression(node: PartiallyEmittedExpression, expression: Expression): PartiallyEmittedExpression; + function createBundle(sourceFiles: SourceFile[]): Bundle; + function updateBundle(node: Bundle, sourceFiles: SourceFile[]): Bundle; + function createComma(left: Expression, right: Expression): Expression; + function createLessThan(left: Expression, right: Expression): Expression; + function createAssignment(left: ObjectLiteralExpression | ArrayLiteralExpression, right: Expression): DestructuringAssignment; + function createAssignment(left: Expression, right: Expression): BinaryExpression; + function createStrictEquality(left: Expression, right: Expression): BinaryExpression; + function createStrictInequality(left: Expression, right: Expression): BinaryExpression; + function createAdd(left: Expression, right: Expression): BinaryExpression; + function createSubtract(left: Expression, right: Expression): BinaryExpression; + function createPostfixIncrement(operand: Expression): PostfixUnaryExpression; + function createLogicalAnd(left: Expression, right: Expression): BinaryExpression; + function createLogicalOr(left: Expression, right: Expression): BinaryExpression; + function createLogicalNot(operand: Expression): PrefixUnaryExpression; + function createVoidZero(): VoidExpression; + function createExportDefault(expression: Expression): ExportAssignment; + function createExternalModuleExport(exportName: Identifier): ExportDeclaration; + /** + * Clears any EmitNode entries from parse-tree nodes. + * @param sourceFile A source file. + */ + function disposeEmitNodes(sourceFile: SourceFile): void; + function setTextRange(range: T, location: TextRange | undefined): T; + /** + * Gets flags that control emit behavior of a node. + */ + function getEmitFlags(node: Node): EmitFlags | undefined; + /** + * Sets flags that control emit behavior of a node. + */ + function setEmitFlags(node: T, emitFlags: EmitFlags): T; + /** + * Gets a custom text range to use when emitting source maps. + */ + function getSourceMapRange(node: Node): TextRange; + /** + * Sets a custom text range to use when emitting source maps. + */ + function setSourceMapRange(node: T, range: TextRange | undefined): T; + /** + * Gets the TextRange to use for source maps for a token of a node. + */ + function getTokenSourceMapRange(node: Node, token: SyntaxKind): TextRange | undefined; + /** + * Sets the TextRange to use for source maps for a token of a node. + */ + function setTokenSourceMapRange(node: T, token: SyntaxKind, range: TextRange | undefined): T; + /** + * Gets a custom text range to use when emitting comments. + */ + function getCommentRange(node: Node): TextRange; + /** + * Sets a custom text range to use when emitting comments. + */ + function setCommentRange(node: T, range: TextRange): T; + function getSyntheticLeadingComments(node: Node): SynthesizedComment[] | undefined; + function setSyntheticLeadingComments(node: T, comments: SynthesizedComment[]): T; + function addSyntheticLeadingComment(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean): T; + function getSyntheticTrailingComments(node: Node): SynthesizedComment[] | undefined; + function setSyntheticTrailingComments(node: T, comments: SynthesizedComment[]): T; + function addSyntheticTrailingComment(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean): T; + /** + * Gets the constant value to emit for an expression. + */ + function getConstantValue(node: PropertyAccessExpression | ElementAccessExpression): number; + /** + * Sets the constant value to emit for an expression. + */ + function setConstantValue(node: PropertyAccessExpression | ElementAccessExpression, value: number): PropertyAccessExpression | ElementAccessExpression; + /** + * Adds an EmitHelper to a node. + */ + function addEmitHelper(node: T, helper: EmitHelper): T; + /** + * Add EmitHelpers to a node. + */ + function addEmitHelpers(node: T, helpers: EmitHelper[] | undefined): T; + /** + * Removes an EmitHelper from a node. + */ + function removeEmitHelper(node: Node, helper: EmitHelper): boolean; + /** + * Gets the EmitHelpers of a node. + */ + function getEmitHelpers(node: Node): EmitHelper[] | undefined; + /** + * Moves matching emit helpers from a source node to a target node. + */ + function moveEmitHelpers(source: Node, target: Node, predicate: (helper: EmitHelper) => boolean): void; + function setOriginalNode(node: T, original: Node | undefined): T; } declare namespace ts { function createNode(kind: SyntaxKind, pos?: number, end?: number): Node; @@ -2301,6 +3070,10 @@ declare namespace ts { function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; } declare namespace ts { + /** Array that is only intended to be pushed to, never read. */ + interface Push { + push(value: T): void; + } function moduleHasNonRelativeName(moduleName: string): boolean; function getEffectiveTypeRoots(options: CompilerOptions, host: { directoryExists?: (directoryName: string) => boolean; @@ -2313,17 +3086,120 @@ declare namespace ts { */ function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost): ResolvedTypeReferenceDirectiveWithFailedLookupLocations; /** - * Given a set of options, returns the set of type directive names - * that should be included for this program automatically. - * This list could either come from the config file, - * or from enumerating the types root + initial secondary types lookup location. - * More type directives might appear in the program later as a result of loading actual source files; - * this list is only the set of defaults that are implicitly included. - */ + * Given a set of options, returns the set of type directive names + * that should be included for this program automatically. + * This list could either come from the config file, + * or from enumerating the types root + initial secondary types lookup location. + * More type directives might appear in the program later as a result of loading actual source files; + * this list is only the set of defaults that are implicitly included. + */ function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): string[]; - function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations; - function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations; - function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations; + /** + * Cached module resolutions per containing directory. + * This assumes that any module id will have the same resolution for sibling files located in the same folder. + */ + interface ModuleResolutionCache extends NonRelativeModuleNameResolutionCache { + getOrCreateCacheForDirectory(directoryName: string): Map; + } + /** + * Stored map from non-relative module name to a table: directory -> result of module lookup in this directory + * We support only non-relative module names because resolution of relative module names is usually more deterministic and thus less expensive. + */ + interface NonRelativeModuleNameResolutionCache { + getOrCreateCacheForModuleName(nonRelativeModuleName: string): PerModuleNameCache; + } + interface PerModuleNameCache { + get(directory: string): ResolvedModuleWithFailedLookupLocations; + set(directory: string, result: ResolvedModuleWithFailedLookupLocations): void; + } + function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string): ModuleResolutionCache; + function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations; + function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations; + function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache): ResolvedModuleWithFailedLookupLocations; +} +declare namespace ts { + /** + * Visits a Node using the supplied visitor, possibly returning a new Node in its place. + * + * @param node The Node to visit. + * @param visitor The callback used to visit the Node. + * @param test A callback to execute to verify the Node is valid. + * @param lift An optional callback to execute to lift a NodeArray into a valid Node. + */ + function visitNode(node: T, visitor: Visitor, test?: (node: Node) => boolean, lift?: (node: NodeArray) => T): T; + /** + * Visits a Node using the supplied visitor, possibly returning a new Node in its place. + * + * @param node The Node to visit. + * @param visitor The callback used to visit the Node. + * @param test A callback to execute to verify the Node is valid. + * @param lift An optional callback to execute to lift a NodeArray into a valid Node. + */ + function visitNode(node: T | undefined, visitor: Visitor, test?: (node: Node) => boolean, lift?: (node: NodeArray) => T): T | undefined; + /** + * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place. + * + * @param nodes The NodeArray to visit. + * @param visitor The callback used to visit a Node. + * @param test A node test to execute for each node. + * @param start An optional value indicating the starting offset at which to start visiting. + * @param count An optional value indicating the maximum number of nodes to visit. + */ + function visitNodes(nodes: NodeArray, visitor: Visitor, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray; + /** + * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place. + * + * @param nodes The NodeArray to visit. + * @param visitor The callback used to visit a Node. + * @param test A node test to execute for each node. + * @param start An optional value indicating the starting offset at which to start visiting. + * @param count An optional value indicating the maximum number of nodes to visit. + */ + function visitNodes(nodes: NodeArray | undefined, visitor: Visitor, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray | undefined; + /** + * Starts a new lexical environment and visits a statement list, ending the lexical environment + * and merging hoisted declarations upon completion. + */ + function visitLexicalEnvironment(statements: NodeArray, visitor: Visitor, context: TransformationContext, start?: number, ensureUseStrict?: boolean): NodeArray; + /** + * Starts a new lexical environment and visits a parameter list, suspending the lexical + * environment upon completion. + */ + function visitParameterList(nodes: NodeArray, visitor: Visitor, context: TransformationContext, nodesVisitor?: typeof visitNodes): NodeArray; + /** + * Resumes a suspended lexical environment and visits a function body, ending the lexical + * environment and merging hoisted declarations upon completion. + */ + function visitFunctionBody(node: FunctionBody, visitor: Visitor, context: TransformationContext): FunctionBody; + /** + * Resumes a suspended lexical environment and visits a function body, ending the lexical + * environment and merging hoisted declarations upon completion. + */ + function visitFunctionBody(node: FunctionBody | undefined, visitor: Visitor, context: TransformationContext): FunctionBody | undefined; + /** + * Resumes a suspended lexical environment and visits a concise body, ending the lexical + * environment and merging hoisted declarations upon completion. + */ + function visitFunctionBody(node: ConciseBody, visitor: Visitor, context: TransformationContext): ConciseBody; + /** + * Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place. + * + * @param node The Node whose children will be visited. + * @param visitor The callback used to visit each child. + * @param context A lexical environment context for the visitor. + */ + function visitEachChild(node: T, visitor: Visitor, context: TransformationContext): T; + /** + * Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place. + * + * @param node The Node whose children will be visited. + * @param visitor The callback used to visit each child. + * @param context A lexical environment context for the visitor. + */ + function visitEachChild(node: T | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: typeof visitNodes, tokenVisitor?: Visitor): T | undefined; +} +declare namespace ts { + function createPrinter(printerOptions?: PrinterOptions, handlers?: PrintHandlers): Printer; } declare namespace ts { function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string; @@ -2340,31 +3216,32 @@ declare namespace ts { function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost, oldProgram?: Program): Program; } declare namespace ts { + function parseCommandLine(commandLine: string[], readFile?: (path: string) => string): ParsedCommandLine; /** - * Read tsconfig.json file - * @param fileName The path to the config file - */ + * Read tsconfig.json file + * @param fileName The path to the config file + */ function readConfigFile(fileName: string, readFile: (path: string) => string): { config?: any; error?: Diagnostic; }; /** - * Parse the text of the tsconfig.json file - * @param fileName The path to the config file - * @param jsonText The text of the config file - */ + * Parse the text of the tsconfig.json file + * @param fileName The path to the config file + * @param jsonText The text of the config file + */ function parseConfigFileTextToJson(fileName: string, jsonText: string, stripComments?: boolean): { config?: any; error?: Diagnostic; }; /** - * Parse the contents of a config file (tsconfig.json). - * @param json The contents of the config file to parse - * @param host Instance of ParseConfigHost used to enumerate files in folder. - * @param basePath A root directory to resolve relative path entries in the config - * file to. e.g. outDir - */ - function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[]): ParsedCommandLine; + * Parse the contents of a config file (tsconfig.json). + * @param json The contents of the config file to parse + * @param host Instance of ParseConfigHost used to enumerate files in folder. + * @param basePath A root directory to resolve relative path entries in the config + * file to. e.g. outDir + */ + function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: JsFileExtensionInfo[]): ParsedCommandLine; function convertCompileOnSaveOptionFromJson(jsonOption: any, basePath: string, errors: Diagnostic[]): boolean; function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): { options: CompilerOptions; @@ -2391,12 +3268,14 @@ declare namespace ts { getText(sourceFile?: SourceFile): string; getFirstToken(sourceFile?: SourceFile): Node; getLastToken(sourceFile?: SourceFile): Node; + forEachChild(cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; } interface Symbol { getFlags(): SymbolFlags; getName(): string; getDeclarations(): Declaration[]; getDocumentationComment(): SymbolDisplayPart[]; + getJsDocTags(): JSDocTagInfo[]; } interface Type { getFlags(): TypeFlags; @@ -2408,15 +3287,16 @@ declare namespace ts { getConstructSignatures(): Signature[]; getStringIndexType(): Type; getNumberIndexType(): Type; - getBaseTypes(): ObjectType[]; + getBaseTypes(): BaseType[]; getNonNullableType(): Type; } interface Signature { getDeclaration(): SignatureDeclaration; - getTypeParameters(): Type[]; + getTypeParameters(): TypeParameter[]; getParameters(): Symbol[]; getReturnType(): Type; getDocumentationComment(): SymbolDisplayPart[]; + getJsDocTags(): JSDocTagInfo[]; } interface SourceFile { getLineAndCharacterOfPosition(pos: number): LineAndCharacter; @@ -2425,6 +3305,9 @@ declare namespace ts { getPositionOfLineAndCharacter(line: number, character: number): number; update(newText: string, textChangeRange: TextChangeRange): SourceFile; } + interface SourceFileLike { + getLineAndCharacterOfPosition(pos: number): LineAndCharacter; + } /** * Represents an immutable snapshot of a script at a specified time.Once acquired, the * snapshot is observably immutable. i.e. the same calls with the same parameters will return @@ -2483,6 +3366,10 @@ declare namespace ts { resolveTypeReferenceDirectives?(typeDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[]; directoryExists?(directoryName: string): boolean; getDirectories?(directoryName: string): string[]; + /** + * Gets a set of custom transformers to use during emit. + */ + getCustomTransformers?(): CustomTransformers | undefined; } interface LanguageService { cleanupSemanticCache(): void; @@ -2528,7 +3415,7 @@ declare namespace ts { getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; getDocCommentTemplateAtPosition(fileName: string, position: number): TextInsertion; isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean; - getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[]): CodeAction[]; + getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[]; getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput; getProgram(): Program; dispose(): void; @@ -2604,19 +3491,20 @@ declare namespace ts { /** The position in newText the caret should point to after the insertion. */ caretOffset: number; } - interface RenameLocation { + interface DocumentSpan { textSpan: TextSpan; fileName: string; } - interface ReferenceEntry { - textSpan: TextSpan; - fileName: string; + interface RenameLocation extends DocumentSpan { + } + interface ReferenceEntry extends DocumentSpan { isWriteAccess: boolean; isDefinition: boolean; + isInString?: true; } - interface ImplementationLocation { - textSpan: TextSpan; - fileName: string; + interface ImplementationLocation extends DocumentSpan { + kind: string; + displayParts: SymbolDisplayPart[]; } interface DocumentHighlights { fileName: string; @@ -2630,6 +3518,7 @@ declare namespace ts { } interface HighlightSpan { fileName?: string; + isInString?: true; textSpan: TextSpan; kind: string; } @@ -2669,6 +3558,7 @@ declare namespace ts { InsertSpaceAfterCommaDelimiter: boolean; InsertSpaceAfterSemicolonInForStatements: boolean; InsertSpaceBeforeAndAfterBinaryOperators: boolean; + InsertSpaceAfterConstructor?: boolean; InsertSpaceAfterKeywordsInControlFlowStatements: boolean; InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; @@ -2677,6 +3567,7 @@ declare namespace ts { InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: boolean; InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean; InsertSpaceAfterTypeAssertion?: boolean; + InsertSpaceBeforeFunctionParenthesis?: boolean; PlaceOpenBraceOnNewLineForFunctions: boolean; PlaceOpenBraceOnNewLineForControlBlocks: boolean; } @@ -2684,6 +3575,7 @@ declare namespace ts { insertSpaceAfterCommaDelimiter?: boolean; insertSpaceAfterSemicolonInForStatements?: boolean; insertSpaceBeforeAndAfterBinaryOperators?: boolean; + insertSpaceAfterConstructor?: boolean; insertSpaceAfterKeywordsInControlFlowStatements?: boolean; insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean; insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean; @@ -2692,6 +3584,7 @@ declare namespace ts { insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean; insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean; insertSpaceAfterTypeAssertion?: boolean; + insertSpaceBeforeFunctionParenthesis?: boolean; placeOpenBraceOnNewLineForFunctions?: boolean; placeOpenBraceOnNewLineForControlBlocks?: boolean; } @@ -2738,12 +3631,17 @@ declare namespace ts { text: string; kind: string; } + interface JSDocTagInfo { + name: string; + text?: string; + } interface QuickInfo { kind: string; kindModifiers: string; textSpan: TextSpan; displayParts: SymbolDisplayPart[]; documentation: SymbolDisplayPart[]; + tags: JSDocTagInfo[]; } interface RenameInfo { canRename: boolean; @@ -2774,6 +3672,7 @@ declare namespace ts { separatorDisplayParts: SymbolDisplayPart[]; parameters: SignatureHelpParameter[]; documentation: SymbolDisplayPart[]; + tags: JSDocTagInfo[]; } /** * Represents a set of signature help items, and the preferred item that should be selected. @@ -2800,10 +3699,10 @@ declare namespace ts { kindModifiers: string; sortText: string; /** - * An optional span that indicates the text to be replaced by this completion item. It will be - * set if the required span differs from the one generated by the default replacement behavior and should - * be used in that case - */ + * An optional span that indicates the text to be replaced by this completion item. It will be + * set if the required span differs from the one generated by the default replacement behavior and should + * be used in that case + */ replacementSpan?: TextSpan; } interface CompletionEntryDetails { @@ -2812,6 +3711,7 @@ declare namespace ts { kindModifiers: string; displayParts: SymbolDisplayPart[]; documentation: SymbolDisplayPart[]; + tags: JSDocTagInfo[]; } interface OutliningSpan { /** The span of the document to actually collapse. */ @@ -2821,9 +3721,9 @@ declare namespace ts { /** The text to display in the editor for the collapsed region. */ bannerText: string; /** - * Whether or not this region should be automatically collapsed when - * the 'Collapse to Definitions' command is invoked. - */ + * Whether or not this region should be automatically collapsed when + * the 'Collapse to Definitions' command is invoked. + */ autoCollapse: boolean; } interface EmitOutput { @@ -2911,7 +3811,7 @@ declare namespace ts { const typeElement = "type"; /** enum E */ const enumElement = "enum"; - const enumMemberElement = "const"; + const enumMemberElement = "enum member"; /** * Inside module and script only * const v = .. @@ -2954,6 +3854,10 @@ declare namespace ts { const letElement = "let"; const directory = "directory"; const externalModuleName = "external module name"; + /** + * + */ + const jsxAttribute = "JSX attribute"; } namespace ScriptElementKindModifier { const none = ""; @@ -3022,61 +3926,61 @@ declare namespace ts { } declare namespace ts { /** - * The document registry represents a store of SourceFile objects that can be shared between - * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) - * of files in the context. - * SourceFile objects account for most of the memory usage by the language service. Sharing - * the same DocumentRegistry instance between different instances of LanguageService allow - * for more efficient memory utilization since all projects will share at least the library - * file (lib.d.ts). - * - * A more advanced use of the document registry is to serialize sourceFile objects to disk - * and re-hydrate them when needed. - * - * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it - * to all subsequent createLanguageService calls. - */ + * The document registry represents a store of SourceFile objects that can be shared between + * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) + * of files in the context. + * SourceFile objects account for most of the memory usage by the language service. Sharing + * the same DocumentRegistry instance between different instances of LanguageService allow + * for more efficient memory utilization since all projects will share at least the library + * file (lib.d.ts). + * + * A more advanced use of the document registry is to serialize sourceFile objects to disk + * and re-hydrate them when needed. + * + * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it + * to all subsequent createLanguageService calls. + */ interface DocumentRegistry { /** - * Request a stored SourceFile with a given fileName and compilationSettings. - * The first call to acquire will call createLanguageServiceSourceFile to generate - * the SourceFile if was not found in the registry. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @parm scriptSnapshot Text of the file. Only used if the file was not found - * in the registry and a new one was created. - * @parm version Current version of the file. Only used if the file was not found - * in the registry and a new one was created. - */ + * Request a stored SourceFile with a given fileName and compilationSettings. + * The first call to acquire will call createLanguageServiceSourceFile to generate + * the SourceFile if was not found in the registry. + * + * @param fileName The name of the file requested + * @param compilationSettings Some compilation settings like target affects the + * shape of a the resulting SourceFile. This allows the DocumentRegistry to store + * multiple copies of the same file for different compilation settings. + * @parm scriptSnapshot Text of the file. Only used if the file was not found + * in the registry and a new one was created. + * @parm version Current version of the file. Only used if the file was not found + * in the registry and a new one was created. + */ acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile; acquireDocumentWithKey(fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile; /** - * Request an updated version of an already existing SourceFile with a given fileName - * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile - * to get an updated SourceFile. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @param scriptSnapshot Text of the file. - * @param version Current version of the file. - */ + * Request an updated version of an already existing SourceFile with a given fileName + * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile + * to get an updated SourceFile. + * + * @param fileName The name of the file requested + * @param compilationSettings Some compilation settings like target affects the + * shape of a the resulting SourceFile. This allows the DocumentRegistry to store + * multiple copies of the same file for different compilation settings. + * @param scriptSnapshot Text of the file. + * @param version Current version of the file. + */ updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile; updateDocumentWithKey(fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile; getKeyForCompilationSettings(settings: CompilerOptions): DocumentRegistryBucketKey; /** - * Informs the DocumentRegistry that a file is not needed any longer. - * - * Note: It is not allowed to call release on a SourceFile that was not acquired from - * this registry originally. - * - * @param fileName The name of the file to be released - * @param compilationSettings The compilation settings used to acquire the file - */ + * Informs the DocumentRegistry that a file is not needed any longer. + * + * Note: It is not allowed to call release on a SourceFile that was not acquired from + * this registry originally. + * + * @param fileName The name of the file to be released + * @param compilationSettings The compilation settings used to acquire the file + */ releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey): void; reportStats(): string; @@ -3120,9 +4024,18 @@ declare namespace ts { function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; /** - * Get the path of the default library files (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ + * Get the path of the default library files (lib.d.ts) as distributed with the typescript + * node package. + * The functionality is not supported if the ts module is consumed outside of a node module. + */ function getDefaultLibFilePath(options: CompilerOptions): string; } +declare namespace ts { + /** + * Transform one or more nodes using the supplied transformers. + * @param source A single `Node` or an array of `Node` objects. + * @param transformers An array of `TransformerFactory` callbacks used to process the transformation. + * @param compilerOptions Optional compiler options. + */ + function transform(source: T | T[], transformers: TransformerFactory[], compilerOptions?: CompilerOptions): TransformationResult; +} diff --git a/node_modules/typescript/lib/typescriptServices.js b/node_modules/typescript/lib/typescriptServices.js index d4ad545cf..ad7cbabef 100644 --- a/node_modules/typescript/lib/typescriptServices.js +++ b/node_modules/typescript/lib/typescriptServices.js @@ -13,11 +13,24 @@ See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; }; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var ts; (function (ts) { // token > SyntaxKind.Identifer => token is a keyword @@ -168,191 +181,191 @@ var ts; SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 130] = "ReadonlyKeyword"; SyntaxKind[SyntaxKind["RequireKeyword"] = 131] = "RequireKeyword"; SyntaxKind[SyntaxKind["NumberKeyword"] = 132] = "NumberKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 133] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 134] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 135] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 136] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 137] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 138] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 139] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 140] = "OfKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 133] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 134] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 135] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 136] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 137] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 138] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 139] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 140] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 141] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 141] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 142] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 142] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 143] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 143] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 144] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 145] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 144] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 145] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 146] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 146] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 147] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 148] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 149] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 150] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 151] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 152] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 153] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 154] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 155] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 147] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 148] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 149] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 150] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 151] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 152] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 153] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 154] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 155] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 156] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 156] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 157] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 158] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 159] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 160] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 161] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 162] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 163] = "TupleType"; - SyntaxKind[SyntaxKind["UnionType"] = 164] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 165] = "IntersectionType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 166] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 167] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 168] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 169] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 170] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 171] = "LiteralType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 157] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 158] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 159] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 160] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 161] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 162] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 163] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 164] = "TupleType"; + SyntaxKind[SyntaxKind["UnionType"] = 165] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 166] = "IntersectionType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 167] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 168] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 169] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 170] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 171] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 172] = "LiteralType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 172] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 173] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 174] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 173] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 174] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 175] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 175] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 176] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 177] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 178] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 179] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 180] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 181] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 182] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 183] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 184] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 185] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 186] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 187] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 188] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 189] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 190] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 191] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 192] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 193] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 194] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 195] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 196] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 197] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 198] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 199] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 200] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 201] = "NonNullExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 176] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 177] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 178] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 179] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 180] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 181] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 182] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 183] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 184] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 185] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 186] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 187] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 188] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 189] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 190] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 191] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 192] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 193] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 194] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 195] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 196] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 197] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 198] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 199] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 200] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 201] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 202] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 203] = "MetaProperty"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 202] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 203] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 204] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 205] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 204] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 205] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 206] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 207] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 208] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 209] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 210] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 211] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 212] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 213] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 214] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 215] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 216] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 217] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 218] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 219] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 220] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 221] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 222] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 223] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 224] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 225] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 226] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 227] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 228] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 229] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 230] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 231] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 232] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 233] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 234] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 235] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 236] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 237] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 238] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 239] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 240] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 241] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 242] = "NamedExports"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 243] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 244] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 206] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 207] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 208] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 209] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 210] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 211] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 212] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 213] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 214] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 215] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 216] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 217] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 218] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 219] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 220] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 221] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 222] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 223] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 224] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 225] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 226] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 227] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 228] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 229] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 230] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 231] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 232] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 233] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 234] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 235] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 236] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 237] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 238] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 239] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 240] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 241] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 242] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 243] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 244] = "NamedExports"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 245] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 246] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 245] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 247] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 246] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 247] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 248] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 249] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 250] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 251] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 252] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 248] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 249] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 250] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 251] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 252] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 253] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 254] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 255] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 253] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 254] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 255] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 256] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 256] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 257] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 258] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 259] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 257] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 258] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 259] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 260] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 261] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 262] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 260] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 263] = "EnumMember"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 261] = "SourceFile"; + SyntaxKind[SyntaxKind["SourceFile"] = 264] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 265] = "Bundle"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 262] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 266] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 263] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 267] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 264] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocArrayType"] = 265] = "JSDocArrayType"; - SyntaxKind[SyntaxKind["JSDocUnionType"] = 266] = "JSDocUnionType"; - SyntaxKind[SyntaxKind["JSDocTupleType"] = 267] = "JSDocTupleType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 268] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 269] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocRecordType"] = 270] = "JSDocRecordType"; - SyntaxKind[SyntaxKind["JSDocRecordMember"] = 271] = "JSDocRecordMember"; - SyntaxKind[SyntaxKind["JSDocTypeReference"] = 272] = "JSDocTypeReference"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 273] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 274] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 275] = "JSDocVariadicType"; - SyntaxKind[SyntaxKind["JSDocConstructorType"] = 276] = "JSDocConstructorType"; - SyntaxKind[SyntaxKind["JSDocThisType"] = 277] = "JSDocThisType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 278] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTag"] = 279] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 280] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 281] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 282] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 283] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 284] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 285] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 286] = "JSDocPropertyTag"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 287] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocLiteralType"] = 288] = "JSDocLiteralType"; - SyntaxKind[SyntaxKind["JSDocNullKeyword"] = 289] = "JSDocNullKeyword"; - SyntaxKind[SyntaxKind["JSDocUndefinedKeyword"] = 290] = "JSDocUndefinedKeyword"; - SyntaxKind[SyntaxKind["JSDocNeverKeyword"] = 291] = "JSDocNeverKeyword"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 268] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocArrayType"] = 269] = "JSDocArrayType"; + SyntaxKind[SyntaxKind["JSDocUnionType"] = 270] = "JSDocUnionType"; + SyntaxKind[SyntaxKind["JSDocTupleType"] = 271] = "JSDocTupleType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 272] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 273] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocRecordType"] = 274] = "JSDocRecordType"; + SyntaxKind[SyntaxKind["JSDocRecordMember"] = 275] = "JSDocRecordMember"; + SyntaxKind[SyntaxKind["JSDocTypeReference"] = 276] = "JSDocTypeReference"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 277] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 278] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 279] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocConstructorType"] = 280] = "JSDocConstructorType"; + SyntaxKind[SyntaxKind["JSDocThisType"] = 281] = "JSDocThisType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 282] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTag"] = 283] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 284] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 285] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 286] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 287] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 288] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 289] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 290] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 291] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocLiteralType"] = 292] = "JSDocLiteralType"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 292] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 293] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 293] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 294] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 295] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 296] = "EndOfDeclarationMarker"; - SyntaxKind[SyntaxKind["RawExpression"] = 297] = "RawExpression"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 294] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 295] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 296] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 297] = "EndOfDeclarationMarker"; // Enum value count SyntaxKind[SyntaxKind["Count"] = 298] = "Count"; // Markers @@ -363,15 +376,15 @@ var ts; SyntaxKind[SyntaxKind["FirstReservedWord"] = 71] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 106] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 71] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 140] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 141] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 107] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 115] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 156] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 171] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 157] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 172] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 16] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 69] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 140] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 141] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -380,11 +393,11 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 15] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 26] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 69] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstNode"] = 141] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 262] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 288] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 278] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 291] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["FirstNode"] = 142] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 266] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 292] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 282] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 292] = "LastJSDocTagNode"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -399,28 +412,22 @@ var ts; NodeFlags[NodeFlags["HasImplicitReturn"] = 128] = "HasImplicitReturn"; NodeFlags[NodeFlags["HasExplicitReturn"] = 256] = "HasExplicitReturn"; NodeFlags[NodeFlags["GlobalAugmentation"] = 512] = "GlobalAugmentation"; - NodeFlags[NodeFlags["HasClassExtends"] = 1024] = "HasClassExtends"; - NodeFlags[NodeFlags["HasDecorators"] = 2048] = "HasDecorators"; - NodeFlags[NodeFlags["HasParamDecorators"] = 4096] = "HasParamDecorators"; - NodeFlags[NodeFlags["HasAsyncFunctions"] = 8192] = "HasAsyncFunctions"; - NodeFlags[NodeFlags["HasSpreadAttribute"] = 16384] = "HasSpreadAttribute"; - NodeFlags[NodeFlags["HasRestAttribute"] = 32768] = "HasRestAttribute"; - NodeFlags[NodeFlags["DisallowInContext"] = 65536] = "DisallowInContext"; - NodeFlags[NodeFlags["YieldContext"] = 131072] = "YieldContext"; - NodeFlags[NodeFlags["DecoratorContext"] = 262144] = "DecoratorContext"; - NodeFlags[NodeFlags["AwaitContext"] = 524288] = "AwaitContext"; - NodeFlags[NodeFlags["ThisNodeHasError"] = 1048576] = "ThisNodeHasError"; - NodeFlags[NodeFlags["JavaScriptFile"] = 2097152] = "JavaScriptFile"; - NodeFlags[NodeFlags["ThisNodeOrAnySubNodesHasError"] = 4194304] = "ThisNodeOrAnySubNodesHasError"; - NodeFlags[NodeFlags["HasAggregatedChildData"] = 8388608] = "HasAggregatedChildData"; + NodeFlags[NodeFlags["HasAsyncFunctions"] = 1024] = "HasAsyncFunctions"; + NodeFlags[NodeFlags["DisallowInContext"] = 2048] = "DisallowInContext"; + NodeFlags[NodeFlags["YieldContext"] = 4096] = "YieldContext"; + NodeFlags[NodeFlags["DecoratorContext"] = 8192] = "DecoratorContext"; + NodeFlags[NodeFlags["AwaitContext"] = 16384] = "AwaitContext"; + NodeFlags[NodeFlags["ThisNodeHasError"] = 32768] = "ThisNodeHasError"; + NodeFlags[NodeFlags["JavaScriptFile"] = 65536] = "JavaScriptFile"; + NodeFlags[NodeFlags["ThisNodeOrAnySubNodesHasError"] = 131072] = "ThisNodeOrAnySubNodesHasError"; + NodeFlags[NodeFlags["HasAggregatedChildData"] = 262144] = "HasAggregatedChildData"; NodeFlags[NodeFlags["BlockScoped"] = 3] = "BlockScoped"; NodeFlags[NodeFlags["ReachabilityCheckFlags"] = 384] = "ReachabilityCheckFlags"; - NodeFlags[NodeFlags["EmitHelperFlags"] = 64512] = "EmitHelperFlags"; - NodeFlags[NodeFlags["ReachabilityAndEmitFlags"] = 64896] = "ReachabilityAndEmitFlags"; + NodeFlags[NodeFlags["ReachabilityAndEmitFlags"] = 1408] = "ReachabilityAndEmitFlags"; // Parsing context flags - NodeFlags[NodeFlags["ContextFlags"] = 3080192] = "ContextFlags"; + NodeFlags[NodeFlags["ContextFlags"] = 96256] = "ContextFlags"; // Exclude these flags when parsing a Type - NodeFlags[NodeFlags["TypeExcludesFlags"] = 655360] = "TypeExcludesFlags"; + NodeFlags[NodeFlags["TypeExcludesFlags"] = 20480] = "TypeExcludesFlags"; })(NodeFlags = ts.NodeFlags || (ts.NodeFlags = {})); var ModifierFlags; (function (ModifierFlags) { @@ -469,6 +476,17 @@ var ts; GeneratedIdentifierKind[GeneratedIdentifierKind["Unique"] = 3] = "Unique"; GeneratedIdentifierKind[GeneratedIdentifierKind["Node"] = 4] = "Node"; })(GeneratedIdentifierKind = ts.GeneratedIdentifierKind || (ts.GeneratedIdentifierKind = {})); + /* @internal */ + var NumericLiteralFlags; + (function (NumericLiteralFlags) { + NumericLiteralFlags[NumericLiteralFlags["None"] = 0] = "None"; + NumericLiteralFlags[NumericLiteralFlags["Scientific"] = 2] = "Scientific"; + NumericLiteralFlags[NumericLiteralFlags["Octal"] = 4] = "Octal"; + NumericLiteralFlags[NumericLiteralFlags["HexSpecifier"] = 8] = "HexSpecifier"; + NumericLiteralFlags[NumericLiteralFlags["BinarySpecifier"] = 16] = "BinarySpecifier"; + NumericLiteralFlags[NumericLiteralFlags["OctalSpecifier"] = 32] = "OctalSpecifier"; + NumericLiteralFlags[NumericLiteralFlags["BinaryOrOctalSpecifier"] = 48] = "BinaryOrOctalSpecifier"; + })(NumericLiteralFlags = ts.NumericLiteralFlags || (ts.NumericLiteralFlags = {})); var FlowFlags; (function (FlowFlags) { FlowFlags[FlowFlags["Unreachable"] = 1] = "Unreachable"; @@ -482,6 +500,8 @@ var ts; FlowFlags[FlowFlags["ArrayMutation"] = 256] = "ArrayMutation"; FlowFlags[FlowFlags["Referenced"] = 512] = "Referenced"; FlowFlags[FlowFlags["Shared"] = 1024] = "Shared"; + FlowFlags[FlowFlags["PreFinally"] = 2048] = "PreFinally"; + FlowFlags[FlowFlags["AfterFinally"] = 4096] = "AfterFinally"; FlowFlags[FlowFlags["Label"] = 12] = "Label"; FlowFlags[FlowFlags["Condition"] = 96] = "Condition"; })(FlowFlags = ts.FlowFlags || (ts.FlowFlags = {})); @@ -503,6 +523,16 @@ var ts; // Diagnostics were produced and outputs were generated in spite of them. ExitStatus[ExitStatus["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated"; })(ExitStatus = ts.ExitStatus || (ts.ExitStatus = {})); + var NodeBuilderFlags; + (function (NodeBuilderFlags) { + NodeBuilderFlags[NodeBuilderFlags["None"] = 0] = "None"; + NodeBuilderFlags[NodeBuilderFlags["allowThisInObjectLiteral"] = 1] = "allowThisInObjectLiteral"; + NodeBuilderFlags[NodeBuilderFlags["allowQualifedNameInPlaceOfIdentifier"] = 2] = "allowQualifedNameInPlaceOfIdentifier"; + NodeBuilderFlags[NodeBuilderFlags["allowTypeParameterInQualifiedName"] = 4] = "allowTypeParameterInQualifiedName"; + NodeBuilderFlags[NodeBuilderFlags["allowAnonymousIdentifier"] = 8] = "allowAnonymousIdentifier"; + NodeBuilderFlags[NodeBuilderFlags["allowEmptyUnionOrIntersection"] = 16] = "allowEmptyUnionOrIntersection"; + NodeBuilderFlags[NodeBuilderFlags["allowEmptyTuple"] = 32] = "allowEmptyTuple"; + })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {})); var TypeFormatFlags; (function (TypeFormatFlags) { TypeFormatFlags[TypeFormatFlags["None"] = 0] = "None"; @@ -517,6 +547,8 @@ var ts; TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 256] = "InFirstTypeArgument"; TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 512] = "InTypeAlias"; TypeFormatFlags[TypeFormatFlags["UseTypeAliasValue"] = 1024] = "UseTypeAliasValue"; + TypeFormatFlags[TypeFormatFlags["SuppressAnyReturnType"] = 2048] = "SuppressAnyReturnType"; + TypeFormatFlags[TypeFormatFlags["AddUndefined"] = 4096] = "AddUndefined"; })(TypeFormatFlags = ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); var SymbolFormatFlags; (function (SymbolFormatFlags) { @@ -549,8 +581,7 @@ var ts; TypePredicateKind[TypePredicateKind["This"] = 0] = "This"; TypePredicateKind[TypePredicateKind["Identifier"] = 1] = "Identifier"; })(TypePredicateKind = ts.TypePredicateKind || (ts.TypePredicateKind = {})); - /** Indicates how to serialize the name for a TypeReferenceNode when emitting decorator - * metadata */ + /** Indicates how to serialize the name for a TypeReferenceNode when emitting decorator metadata */ /* @internal */ var TypeReferenceSerializationKind; (function (TypeReferenceSerializationKind) { @@ -598,13 +629,10 @@ var ts; SymbolFlags[SymbolFlags["ExportType"] = 2097152] = "ExportType"; SymbolFlags[SymbolFlags["ExportNamespace"] = 4194304] = "ExportNamespace"; SymbolFlags[SymbolFlags["Alias"] = 8388608] = "Alias"; - SymbolFlags[SymbolFlags["Instantiated"] = 16777216] = "Instantiated"; - SymbolFlags[SymbolFlags["Merged"] = 33554432] = "Merged"; - SymbolFlags[SymbolFlags["Transient"] = 67108864] = "Transient"; - SymbolFlags[SymbolFlags["Prototype"] = 134217728] = "Prototype"; - SymbolFlags[SymbolFlags["SyntheticProperty"] = 268435456] = "SyntheticProperty"; - SymbolFlags[SymbolFlags["Optional"] = 536870912] = "Optional"; - SymbolFlags[SymbolFlags["ExportStar"] = 1073741824] = "ExportStar"; + SymbolFlags[SymbolFlags["Prototype"] = 16777216] = "Prototype"; + SymbolFlags[SymbolFlags["ExportStar"] = 33554432] = "ExportStar"; + SymbolFlags[SymbolFlags["Optional"] = 67108864] = "Optional"; + SymbolFlags[SymbolFlags["Transient"] = 134217728] = "Transient"; SymbolFlags[SymbolFlags["Enum"] = 384] = "Enum"; SymbolFlags[SymbolFlags["Variable"] = 3] = "Variable"; SymbolFlags[SymbolFlags["Value"] = 107455] = "Value"; @@ -648,11 +676,27 @@ var ts; SymbolFlags[SymbolFlags["Classifiable"] = 788448] = "Classifiable"; })(SymbolFlags = ts.SymbolFlags || (ts.SymbolFlags = {})); /* @internal */ + var CheckFlags; + (function (CheckFlags) { + CheckFlags[CheckFlags["Instantiated"] = 1] = "Instantiated"; + CheckFlags[CheckFlags["SyntheticProperty"] = 2] = "SyntheticProperty"; + CheckFlags[CheckFlags["SyntheticMethod"] = 4] = "SyntheticMethod"; + CheckFlags[CheckFlags["Readonly"] = 8] = "Readonly"; + CheckFlags[CheckFlags["Partial"] = 16] = "Partial"; + CheckFlags[CheckFlags["HasNonUniformType"] = 32] = "HasNonUniformType"; + CheckFlags[CheckFlags["ContainsPublic"] = 64] = "ContainsPublic"; + CheckFlags[CheckFlags["ContainsProtected"] = 128] = "ContainsProtected"; + CheckFlags[CheckFlags["ContainsPrivate"] = 256] = "ContainsPrivate"; + CheckFlags[CheckFlags["ContainsStatic"] = 512] = "ContainsStatic"; + CheckFlags[CheckFlags["Synthetic"] = 6] = "Synthetic"; + })(CheckFlags = ts.CheckFlags || (ts.CheckFlags = {})); + /* @internal */ var NodeCheckFlags; (function (NodeCheckFlags) { NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 1] = "TypeChecked"; NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 2] = "LexicalThis"; NodeCheckFlags[NodeCheckFlags["CaptureThis"] = 4] = "CaptureThis"; + NodeCheckFlags[NodeCheckFlags["CaptureNewTarget"] = 8] = "CaptureNewTarget"; NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 256] = "SuperInstance"; NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 512] = "SuperStatic"; NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 1024] = "ContextChecked"; @@ -701,6 +745,9 @@ var ts; TypeFlags[TypeFlags["ContainsObjectLiteral"] = 4194304] = "ContainsObjectLiteral"; /* @internal */ TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 8388608] = "ContainsAnyFunctionType"; + TypeFlags[TypeFlags["NonPrimitive"] = 16777216] = "NonPrimitive"; + /* @internal */ + TypeFlags[TypeFlags["JsxAttributes"] = 33554432] = "JsxAttributes"; /* @internal */ TypeFlags[TypeFlags["Nullable"] = 6144] = "Nullable"; TypeFlags[TypeFlags["Literal"] = 480] = "Literal"; @@ -709,7 +756,7 @@ var ts; TypeFlags[TypeFlags["DefinitelyFalsy"] = 7392] = "DefinitelyFalsy"; TypeFlags[TypeFlags["PossiblyFalsy"] = 7406] = "PossiblyFalsy"; /* @internal */ - TypeFlags[TypeFlags["Intrinsic"] = 16015] = "Intrinsic"; + TypeFlags[TypeFlags["Intrinsic"] = 16793231] = "Intrinsic"; /* @internal */ TypeFlags[TypeFlags["Primitive"] = 8190] = "Primitive"; TypeFlags[TypeFlags["StringLike"] = 262178] = "StringLike"; @@ -718,11 +765,12 @@ var ts; TypeFlags[TypeFlags["EnumLike"] = 272] = "EnumLike"; TypeFlags[TypeFlags["UnionOrIntersection"] = 196608] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 229376] = "StructuredType"; - TypeFlags[TypeFlags["StructuredOrTypeParameter"] = 507904] = "StructuredOrTypeParameter"; + TypeFlags[TypeFlags["StructuredOrTypeVariable"] = 1032192] = "StructuredOrTypeVariable"; + TypeFlags[TypeFlags["TypeVariable"] = 540672] = "TypeVariable"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never - TypeFlags[TypeFlags["Narrowable"] = 1033215] = "Narrowable"; - TypeFlags[TypeFlags["NotUnionOrUnit"] = 33281] = "NotUnionOrUnit"; + TypeFlags[TypeFlags["Narrowable"] = 17810431] = "Narrowable"; + TypeFlags[TypeFlags["NotUnionOrUnit"] = 16810497] = "NotUnionOrUnit"; /* @internal */ TypeFlags[TypeFlags["RequiresWidening"] = 6291456] = "RequiresWidening"; /* @internal */ @@ -764,6 +812,8 @@ var ts; SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["PrototypeProperty"] = 3] = "PrototypeProperty"; /// this.name = expr SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ThisProperty"] = 4] = "ThisProperty"; + // F.name = expr + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["Property"] = 5] = "Property"; })(SpecialPropertyAssignmentKind = ts.SpecialPropertyAssignmentKind || (ts.SpecialPropertyAssignmentKind = {})); var DiagnosticCategory; (function (DiagnosticCategory) { @@ -790,6 +840,7 @@ var ts; JsxEmit[JsxEmit["None"] = 0] = "None"; JsxEmit[JsxEmit["Preserve"] = 1] = "Preserve"; JsxEmit[JsxEmit["React"] = 2] = "React"; + JsxEmit[JsxEmit["ReactNative"] = 3] = "ReactNative"; })(JsxEmit = ts.JsxEmit || (ts.JsxEmit = {})); var NewLineKind; (function (NewLineKind) { @@ -803,6 +854,7 @@ var ts; ScriptKind[ScriptKind["JSX"] = 2] = "JSX"; ScriptKind[ScriptKind["TS"] = 3] = "TS"; ScriptKind[ScriptKind["TSX"] = 4] = "TSX"; + ScriptKind[ScriptKind["External"] = 5] = "External"; })(ScriptKind = ts.ScriptKind || (ts.ScriptKind = {})); var ScriptTarget; (function (ScriptTarget) { @@ -1037,7 +1089,6 @@ var ts; TransformFlags[TransformFlags["TypeScriptClassSyntaxMask"] = 274432] = "TypeScriptClassSyntaxMask"; TransformFlags[TransformFlags["ES2015FunctionSyntaxMask"] = 163840] = "ES2015FunctionSyntaxMask"; })(TransformFlags = ts.TransformFlags || (ts.TransformFlags = {})); - /* @internal */ var EmitFlags; (function (EmitFlags) { EmitFlags[EmitFlags["SingleLine"] = 1] = "SingleLine"; @@ -1065,15 +1116,45 @@ var ts; EmitFlags[EmitFlags["CustomPrologue"] = 524288] = "CustomPrologue"; EmitFlags[EmitFlags["NoHoisting"] = 1048576] = "NoHoisting"; EmitFlags[EmitFlags["HasEndOfDeclarationMarker"] = 2097152] = "HasEndOfDeclarationMarker"; + EmitFlags[EmitFlags["Iterator"] = 4194304] = "Iterator"; })(EmitFlags = ts.EmitFlags || (ts.EmitFlags = {})); + /** + * Used by the checker, this enum keeps track of external emit helpers that should be type + * checked. + */ /* @internal */ - var EmitContext; - (function (EmitContext) { - EmitContext[EmitContext["SourceFile"] = 0] = "SourceFile"; - EmitContext[EmitContext["Expression"] = 1] = "Expression"; - EmitContext[EmitContext["IdentifierName"] = 2] = "IdentifierName"; - EmitContext[EmitContext["Unspecified"] = 3] = "Unspecified"; - })(EmitContext = ts.EmitContext || (ts.EmitContext = {})); + var ExternalEmitHelpers; + (function (ExternalEmitHelpers) { + ExternalEmitHelpers[ExternalEmitHelpers["Extends"] = 1] = "Extends"; + ExternalEmitHelpers[ExternalEmitHelpers["Assign"] = 2] = "Assign"; + ExternalEmitHelpers[ExternalEmitHelpers["Rest"] = 4] = "Rest"; + ExternalEmitHelpers[ExternalEmitHelpers["Decorate"] = 8] = "Decorate"; + ExternalEmitHelpers[ExternalEmitHelpers["Metadata"] = 16] = "Metadata"; + ExternalEmitHelpers[ExternalEmitHelpers["Param"] = 32] = "Param"; + ExternalEmitHelpers[ExternalEmitHelpers["Awaiter"] = 64] = "Awaiter"; + ExternalEmitHelpers[ExternalEmitHelpers["Generator"] = 128] = "Generator"; + ExternalEmitHelpers[ExternalEmitHelpers["Values"] = 256] = "Values"; + ExternalEmitHelpers[ExternalEmitHelpers["Read"] = 512] = "Read"; + ExternalEmitHelpers[ExternalEmitHelpers["Spread"] = 1024] = "Spread"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncGenerator"] = 2048] = "AsyncGenerator"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncDelegator"] = 4096] = "AsyncDelegator"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncValues"] = 8192] = "AsyncValues"; + // Helpers included by ES2015 for..of + ExternalEmitHelpers[ExternalEmitHelpers["ForOfIncludes"] = 256] = "ForOfIncludes"; + // Helpers included by ES2017 for..await..of + ExternalEmitHelpers[ExternalEmitHelpers["ForAwaitOfIncludes"] = 8192] = "ForAwaitOfIncludes"; + // Helpers included by ES2015 spread + ExternalEmitHelpers[ExternalEmitHelpers["SpreadIncludes"] = 1536] = "SpreadIncludes"; + ExternalEmitHelpers[ExternalEmitHelpers["FirstEmitHelper"] = 1] = "FirstEmitHelper"; + ExternalEmitHelpers[ExternalEmitHelpers["LastEmitHelper"] = 8192] = "LastEmitHelper"; + })(ExternalEmitHelpers = ts.ExternalEmitHelpers || (ts.ExternalEmitHelpers = {})); + var EmitHint; + (function (EmitHint) { + EmitHint[EmitHint["SourceFile"] = 0] = "SourceFile"; + EmitHint[EmitHint["Expression"] = 1] = "Expression"; + EmitHint[EmitHint["IdentifierName"] = 2] = "IdentifierName"; + EmitHint[EmitHint["Unspecified"] = 3] = "Unspecified"; + })(EmitHint = ts.EmitHint || (ts.EmitHint = {})); })(ts || (ts = {})); /*@internal*/ var ts; @@ -1101,8 +1182,8 @@ var ts; */ function mark(markName) { if (enabled) { - marks[markName] = ts.timestamp(); - counts[markName] = (counts[markName] || 0) + 1; + marks.set(markName, ts.timestamp()); + counts.set(markName, (counts.get(markName) || 0) + 1); profilerEvent(markName); } } @@ -1118,9 +1199,9 @@ var ts; */ function measure(measureName, startMarkName, endMarkName) { if (enabled) { - var end = endMarkName && marks[endMarkName] || ts.timestamp(); - var start = startMarkName && marks[startMarkName] || profilerStart; - measures[measureName] = (measures[measureName] || 0) + (end - start); + var end = endMarkName && marks.get(endMarkName) || ts.timestamp(); + var start = startMarkName && marks.get(startMarkName) || profilerStart; + measures.set(measureName, (measures.get(measureName) || 0) + (end - start)); } } performance.measure = measure; @@ -1130,7 +1211,7 @@ var ts; * @param markName The name of the mark. */ function getCount(markName) { - return counts && counts[markName] || 0; + return counts && counts.get(markName) || 0; } performance.getCount = getCount; /** @@ -1139,7 +1220,7 @@ var ts; * @param measureName The name of the measure whose durations should be accumulated. */ function getDuration(measureName) { - return measures && measures[measureName] || 0; + return measures && measures.get(measureName) || 0; } performance.getDuration = getDuration; /** @@ -1148,9 +1229,9 @@ var ts; * @param cb The action to perform for each measure */ function forEachMeasure(cb) { - for (var key in measures) { - cb(key, measures[key]); - } + measures.forEach(function (measure, key) { + cb(key, measure); + }); } performance.forEachMeasure = forEachMeasure; /** Enables (and resets) performance measurements for the compiler. */ @@ -1174,7 +1255,7 @@ var ts; var ts; (function (ts) { /** The version of the TypeScript compiler release */ - ts.version = "2.2.0-dev.20161127"; + ts.version = "2.3.0-dev.20170419"; })(ts || (ts = {})); /* @internal */ (function (ts) { @@ -1193,25 +1274,106 @@ var ts; Ternary[Ternary["Maybe"] = 1] = "Maybe"; Ternary[Ternary["True"] = -1] = "True"; })(Ternary = ts.Ternary || (ts.Ternary = {})); - var createObject = Object.create; // More efficient to create a collator once and use its `compare` than to call `a.localeCompare(b)` many times. - ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined; - function createMap(template) { - var map = createObject(null); // tslint:disable-line:no-null-keyword + ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator(/*locales*/ undefined, { usage: "sort", sensitivity: "accent" }) : undefined; + // Intl is missing in Safari, and node 0.10 treats "a" as greater than "B". + ts.localeCompareIsCorrect = ts.collator && ts.collator.compare("a", "B") < 0; + /** Create a MapLike with good performance. */ + function createDictionaryObject() { + var map = Object.create(/*prototype*/ null); // tslint:disable-line:no-null-keyword // Using 'delete' on an object causes V8 to put the object in dictionary mode. // This disables creation of hidden classes, which are expensive when an object is // constantly changing shape. map["__"] = undefined; delete map["__"]; + return map; + } + /** Create a new map. If a template object is provided, the map will copy entries from it. */ + function createMap() { + return new MapCtr(); + } + ts.createMap = createMap; + function createMapFromTemplate(template) { + var map = new MapCtr(); // Copies keys/values from template. Note that for..in will not throw if // template is undefined, and instead will just exit the loop. for (var key in template) if (hasOwnProperty.call(template, key)) { - map[key] = template[key]; + map.set(key, template[key]); } return map; } - ts.createMap = createMap; + ts.createMapFromTemplate = createMapFromTemplate; + // Internet Explorer's Map doesn't support iteration, so don't use it. + // tslint:disable-next-line:no-in-operator + var MapCtr = typeof Map !== "undefined" && "entries" in Map.prototype ? Map : shimMap(); + // Keep the class inside a function so it doesn't get compiled if it's not used. + function shimMap() { + var MapIterator = (function () { + function MapIterator(data, selector) { + this.index = 0; + this.data = data; + this.selector = selector; + this.keys = Object.keys(data); + } + MapIterator.prototype.next = function () { + var index = this.index; + if (index < this.keys.length) { + this.index++; + return { value: this.selector(this.data, this.keys[index]), done: false }; + } + return { value: undefined, done: true }; + }; + return MapIterator; + }()); + return (function () { + function class_1() { + this.data = createDictionaryObject(); + this.size = 0; + } + class_1.prototype.get = function (key) { + return this.data[key]; + }; + class_1.prototype.set = function (key, value) { + if (!this.has(key)) { + this.size++; + } + this.data[key] = value; + return this; + }; + class_1.prototype.has = function (key) { + // tslint:disable-next-line:no-in-operator + return key in this.data; + }; + class_1.prototype.delete = function (key) { + if (this.has(key)) { + this.size--; + delete this.data[key]; + return true; + } + return false; + }; + class_1.prototype.clear = function () { + this.data = createDictionaryObject(); + this.size = 0; + }; + class_1.prototype.keys = function () { + return new MapIterator(this.data, function (_data, key) { return key; }); + }; + class_1.prototype.values = function () { + return new MapIterator(this.data, function (data, key) { return data[key]; }); + }; + class_1.prototype.entries = function () { + return new MapIterator(this.data, function (data, key) { return [key, data[key]]; }); + }; + class_1.prototype.forEach = function (action) { + for (var key in this.data) { + action(this.data[key], key); + } + }; + return class_1; + }()); + } function createFileMap(keyMapper) { var files = createMap(); return { @@ -1224,33 +1386,28 @@ var ts; clear: clear, }; function forEachValueInMap(f) { - for (var key in files) { - f(key, files[key]); - } + files.forEach(function (file, key) { + f(key, file); + }); } function getKeys() { - var keys = []; - for (var key in files) { - keys.push(key); - } - return keys; + return arrayFrom(files.keys()); } // path should already be well-formed so it does not need to be normalized function get(path) { - return files[toKey(path)]; + return files.get(toKey(path)); } function set(path, value) { - files[toKey(path)] = value; + files.set(toKey(path), value); } function contains(path) { - return toKey(path) in files; + return files.has(toKey(path)); } function remove(path) { - var key = toKey(path); - delete files[key]; + files.delete(toKey(path)); } function clear() { - files = createMap(); + files.clear(); } function toKey(path) { return keyMapper ? keyMapper(path) : path; @@ -1270,6 +1427,10 @@ var ts; Comparison[Comparison["EqualTo"] = 0] = "EqualTo"; Comparison[Comparison["GreaterThan"] = 1] = "GreaterThan"; })(Comparison = ts.Comparison || (ts.Comparison = {})); + function length(array) { + return array ? array.length : 0; + } + ts.length = length; /** * Iterates through 'array' by index and performs the callback on each element of array until the callback * returns a truthy value, then returns that value. @@ -1277,7 +1438,7 @@ var ts; */ function forEach(array, callback) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { var result = callback(array[i], i); if (result) { return result; @@ -1287,6 +1448,26 @@ var ts; return undefined; } ts.forEach = forEach; + /** + * Iterates through the parent chain of a node and performs the callback on each parent until the callback + * returns a truthy value, then returns that value. + * If no such value is found, it applies the callback until the parent pointer is undefined or the callback returns "quit" + * At that point findAncestor returns undefined. + */ + function findAncestor(node, callback) { + while (node) { + var result = callback(node); + if (result === "quit") { + return undefined; + } + else if (result) { + return node; + } + node = node.parent; + } + return undefined; + } + ts.findAncestor = findAncestor; function zipWith(arrayA, arrayB, callback) { Debug.assert(arrayA.length === arrayB.length); for (var i = 0; i < arrayA.length; i++) { @@ -1301,7 +1482,7 @@ var ts; */ function every(array, callback) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { if (!callback(array[i], i)) { return false; } @@ -1312,7 +1493,7 @@ var ts; ts.every = every; /** Works like Array.prototype.find, returning `undefined` if no element satisfying the predicate is found. */ function find(array, predicate) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { var value = array[i]; if (predicate(value, i)) { return value; @@ -1321,12 +1502,22 @@ var ts; return undefined; } ts.find = find; + /** Works like Array.prototype.findIndex, returning `-1` if no element satisfying the predicate is found. */ + function findIndex(array, predicate) { + for (var i = 0; i < array.length; i++) { + if (predicate(array[i], i)) { + return i; + } + } + return -1; + } + ts.findIndex = findIndex; /** * Returns the first truthy result of `callback`, or else fails. * This is like `forEach`, but never returns undefined. */ function findMap(array, callback) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { var result = callback(array[i], i); if (result) { return result; @@ -1349,7 +1540,7 @@ var ts; ts.contains = contains; function indexOf(array, value) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { if (array[i] === value) { return i; } @@ -1359,7 +1550,7 @@ var ts; } ts.indexOf = indexOf; function indexOfAnyCharCode(text, charCodes, start) { - for (var i = start || 0, len = text.length; i < len; i++) { + for (var i = start || 0; i < text.length; i++) { if (contains(charCodes, text.charCodeAt(i))) { return i; } @@ -1569,21 +1760,18 @@ var ts; return result; } ts.spanMap = spanMap; - function mapObject(object, f) { - var result; - if (object) { - result = {}; - for (var _i = 0, _a = getOwnKeys(object); _i < _a.length; _i++) { - var v = _a[_i]; - var _b = f(v, object[v]) || [undefined, undefined], key = _b[0], value = _b[1]; - if (key !== undefined) { - result[key] = value; - } - } + function mapEntries(map, f) { + if (!map) { + return undefined; } + var result = createMap(); + map.forEach(function (value, key) { + var _a = f(key, value), newKey = _a[0], newValue = _a[1]; + result.set(newKey, newValue); + }); return result; } - ts.mapObject = mapObject; + ts.mapEntries = mapEntries; function some(array, predicate) { if (array) { if (predicate) { @@ -1901,9 +2089,6 @@ var ts; /** * Indicates whether a map-like contains an own property with the specified key. * - * NOTE: This is intended for use only with MapLike objects. For Map objects, use - * the 'in' operator. - * * @param map A map-like. * @param key A property key. */ @@ -1914,9 +2099,6 @@ var ts; /** * Gets the value of an owned property in a map-like. * - * NOTE: This is intended for use only with MapLike objects. For Map objects, use - * an indexer. - * * @param map A map-like. * @param key A property key. */ @@ -1941,56 +2123,61 @@ var ts; return keys; } ts.getOwnKeys = getOwnKeys; - /** - * Enumerates the properties of a Map, invoking a callback and returning the first truthy result. - * - * @param map A map for which properties should be enumerated. - * @param callback A callback to invoke for each property. - */ - function forEachProperty(map, callback) { - var result; - for (var key in map) { - if (result = callback(map[key], key)) - break; + function arrayFrom(iterator, map) { + var result = []; + for (var _a = iterator.next(), value = _a.value, done = _a.done; !done; _b = iterator.next(), value = _b.value, done = _b.done, _b) { + result.push(map ? map(value) : value); } return result; + var _b; } - ts.forEachProperty = forEachProperty; - /** - * Returns true if a Map has some matching property. - * - * @param map A map whose properties should be tested. - * @param predicate An optional callback used to test each property. - */ - function someProperties(map, predicate) { - for (var key in map) { - if (!predicate || predicate(map[key], key)) - return true; + ts.arrayFrom = arrayFrom; + function convertToArray(iterator, f) { + var result = []; + for (var _a = iterator.next(), value = _a.value, done = _a.done; !done; _b = iterator.next(), value = _b.value, done = _b.done, _b) { + result.push(f(value)); } - return false; + return result; + var _b; } - ts.someProperties = someProperties; + ts.convertToArray = convertToArray; /** - * Performs a shallow copy of the properties from a source Map to a target MapLike - * - * @param source A map from which properties should be copied. - * @param target A map to which properties should be copied. + * Calls `callback` for each entry in the map, returning the first truthy result. + * Use `map.forEach` instead for normal iteration. */ - function copyProperties(source, target) { - for (var key in source) { - target[key] = source[key]; + function forEachEntry(map, callback) { + var iterator = map.entries(); + for (var _a = iterator.next(), pair = _a.value, done = _a.done; !done; _b = iterator.next(), pair = _b.value, done = _b.done, _b) { + var key = pair[0], value = pair[1]; + var result = callback(value, key); + if (result) { + return result; + } } + return undefined; + var _b; } - ts.copyProperties = copyProperties; - function appendProperty(map, key, value) { - if (key === undefined || value === undefined) - return map; - if (map === undefined) - map = createMap(); - map[key] = value; - return map; + ts.forEachEntry = forEachEntry; + /** `forEachEntry` for just keys. */ + function forEachKey(map, callback) { + var iterator = map.keys(); + for (var _a = iterator.next(), key = _a.value, done = _a.done; !done; _b = iterator.next(), key = _b.value, done = _b.done, _b) { + var result = callback(key); + if (result) { + return result; + } + } + return undefined; + var _b; } - ts.appendProperty = appendProperty; + ts.forEachKey = forEachKey; + /** Copy entries from `source` to `target`. */ + function copyEntries(source, target) { + source.forEach(function (value, key) { + target.set(key, value); + }); + } + ts.copyEntries = copyEntries; function assign(t) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { @@ -1998,51 +2185,14 @@ var ts; } for (var _a = 0, args_1 = args; _a < args_1.length; _a++) { var arg = args_1[_a]; - for (var _b = 0, _c = getOwnKeys(arg); _b < _c.length; _b++) { - var p = _c[_b]; - t[p] = arg[p]; - } + for (var p in arg) + if (hasProperty(arg, p)) { + t[p] = arg[p]; + } } return t; } ts.assign = assign; - /** - * Reduce the properties of a map. - * - * NOTE: This is intended for use with Map objects. For MapLike objects, use - * reduceOwnProperties instead as it offers better runtime safety. - * - * @param map The map to reduce - * @param callback An aggregation function that is called for each entry in the map - * @param initial The initial value for the reduction. - */ - function reduceProperties(map, callback, initial) { - var result = initial; - for (var key in map) { - result = callback(result, map[key], String(key)); - } - return result; - } - ts.reduceProperties = reduceProperties; - /** - * Reduce the properties defined on a map-like (but not from its prototype chain). - * - * NOTE: This is intended for use with MapLike objects. For Map objects, use - * reduceProperties instead as it offers better performance. - * - * @param map The map-like to reduce - * @param callback An aggregation function that is called for each entry in the map - * @param initial The initial value for the reduction. - */ - function reduceOwnProperties(map, callback, initial) { - var result = initial; - for (var key in map) - if (hasOwnProperty.call(map, key)) { - result = callback(result, map[key], String(key)); - } - return result; - } - ts.reduceOwnProperties = reduceOwnProperties; /** * Performs a shallow equality comparison of the contents of two map-likes. * @@ -2073,23 +2223,14 @@ var ts; var result = createMap(); for (var _i = 0, array_8 = array; _i < array_8.length; _i++) { var value = array_8[_i]; - result[makeKey(value)] = makeValue ? makeValue(value) : value; + result.set(makeKey(value), makeValue ? makeValue(value) : value); } return result; } ts.arrayToMap = arrayToMap; - function isEmpty(map) { - for (var id in map) { - if (hasProperty(map, id)) { - return false; - } - } - return true; - } - ts.isEmpty = isEmpty; function cloneMap(map) { var clone = createMap(); - copyProperties(map, clone); + copyEntries(map, clone); return clone; } ts.cloneMap = cloneMap; @@ -2116,36 +2257,32 @@ var ts; return result; } ts.extend = extend; - /** - * Adds the value to an array of values associated with the key, and returns the array. - * Creates the array if it does not already exist. - */ - function multiMapAdd(map, key, value) { - var values = map[key]; + function createMultiMap() { + var map = createMap(); + map.add = multiMapAdd; + map.remove = multiMapRemove; + return map; + } + ts.createMultiMap = createMultiMap; + function multiMapAdd(key, value) { + var values = this.get(key); if (values) { values.push(value); - return values; } else { - return map[key] = [value]; + this.set(key, values = [value]); } + return values; } - ts.multiMapAdd = multiMapAdd; - /** - * Removes a value from an array of values associated with the key. - * Does not preserve the order of those values. - * Does nothing if `key` is not in `map`, or `value` is not in `map[key]`. - */ - function multiMapRemove(map, key, value) { - var values = map[key]; + function multiMapRemove(key, value) { + var values = this.get(key); if (values) { unorderedRemoveItem(values, value); if (!values.length) { - delete map[key]; + this.delete(key); } } } - ts.multiMapRemove = multiMapRemove; /** * Tests whether a value is an array. */ @@ -2226,6 +2363,7 @@ var ts; baseIndex = baseIndex || 0; return text.replace(/{(\d+)}/g, function (_match, index) { return args[+index + baseIndex]; }); } + ts.formatStringFromArgs = formatStringFromArgs; ts.localizedDiagnosticMessages = undefined; function getLocaleSpecificMessage(message) { return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message.key] || message.message; @@ -2328,9 +2466,12 @@ var ts; if (b === undefined) return 1 /* GreaterThan */; if (ignoreCase) { - if (ts.collator && String.prototype.localeCompare) { - // accent means a ≠ b, a ≠ aÌ, a = A - var result = a.localeCompare(b, /*locales*/ undefined, { usage: "sort", sensitivity: "accent" }); + // Checking if "collator exists indicates that Intl is available. + // We still have to check if "collator.compare" is correct. If it is not, use "String.localeComapre" + if (ts.collator) { + var result = ts.localeCompareIsCorrect ? + ts.collator.compare(a, b) : + a.localeCompare(b, /*locales*/ undefined, { usage: "sort", sensitivity: "accent" }); // accent means a ≠ b, a ≠ aÌ, a = A return result < 0 ? -1 /* LessThan */ : result > 0 ? 1 /* GreaterThan */ : 0 /* EqualTo */; } a = a.toUpperCase(); @@ -2403,7 +2544,7 @@ var ts; ts.normalizeSlashes = normalizeSlashes; /** * Returns length of path root (i.e. length of "/", "x:/", "//server/share/, file:///user/files") - */ + */ function getRootLength(path) { if (path.charCodeAt(0) === 47 /* slash */) { if (path.charCodeAt(1) !== 47 /* slash */) @@ -2775,6 +2916,17 @@ var ts; var singleAsteriskRegexFragmentFiles = "([^./]|(\\.(?!min\\.js$))?)*"; var singleAsteriskRegexFragmentOther = "[^/]*"; function getRegularExpressionForWildcard(specs, basePath, usage) { + var patterns = getRegularExpressionsForWildcards(specs, basePath, usage); + if (!patterns || !patterns.length) { + return undefined; + } + var pattern = patterns.map(function (pattern) { return "(" + pattern + ")"; }).join("|"); + // If excluding, match "foo/bar/baz...", but if including, only allow "foo". + var terminator = usage === "exclude" ? "($|/)" : "$"; + return "^(" + pattern + ")" + terminator; + } + ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard; + function getRegularExpressionsForWildcards(specs, basePath, usage) { if (specs === undefined || specs.length === 0) { return undefined; } @@ -2785,31 +2937,10 @@ var ts; * files or directories, does not match subdirectories that start with a . character */ var doubleAsteriskRegexFragment = usage === "exclude" ? "(/.+?)?" : "(/[^/.][^/]*)*?"; - var pattern = ""; - var hasWrittenSubpattern = false; - for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) { - var spec = specs_1[_i]; - if (!spec) { - continue; - } - var subPattern = getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter); - if (subPattern === undefined) { - continue; - } - if (hasWrittenSubpattern) { - pattern += "|"; - } - pattern += "(" + subPattern + ")"; - hasWrittenSubpattern = true; - } - if (!pattern) { - return undefined; - } - // If excluding, match "foo/bar/baz...", but if including, only allow "foo". - var terminator = usage === "exclude" ? "($|/)" : "$"; - return "^(" + pattern + ")" + terminator; + return flatMap(specs, function (spec) { + return spec && getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter); + }); } - ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard; /** * An "includes" path "foo" is implicitly a glob "foo/** /*" (without the space) if its last component has no extension, * and does not contain any glob characters itself. @@ -2888,6 +3019,7 @@ var ts; currentDirectory = normalizePath(currentDirectory); var absolutePath = combinePaths(currentDirectory, path); return { + includeFilePatterns: map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^" + pattern + "$"; }), includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"), includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"), excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"), @@ -2900,34 +3032,50 @@ var ts; currentDirectory = normalizePath(currentDirectory); var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory); var regexFlag = useCaseSensitiveFileNames ? "" : "i"; - var includeFileRegex = patterns.includeFilePattern && new RegExp(patterns.includeFilePattern, regexFlag); + var includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map(function (pattern) { return new RegExp(pattern, regexFlag); }); var includeDirectoryRegex = patterns.includeDirectoryPattern && new RegExp(patterns.includeDirectoryPattern, regexFlag); var excludeRegex = patterns.excludePattern && new RegExp(patterns.excludePattern, regexFlag); - var result = []; + // Associate an array of results with each include regex. This keeps results in order of the "include" order. + // If there are no "includes", then just put everything in results[0]. + var results = includeFileRegexes ? includeFileRegexes.map(function () { return []; }) : [[]]; + var comparer = useCaseSensitiveFileNames ? compareStrings : compareStringsCaseInsensitive; for (var _i = 0, _a = patterns.basePaths; _i < _a.length; _i++) { var basePath = _a[_i]; visitDirectory(basePath, combinePaths(currentDirectory, basePath)); } - return result; + return flatten(results); function visitDirectory(path, absolutePath) { var _a = getFileSystemEntries(path), files = _a.files, directories = _a.directories; + files = files.slice().sort(comparer); + directories = directories.slice().sort(comparer); + var _loop_1 = function (current) { + var name = combinePaths(path, current); + var absoluteName = combinePaths(absolutePath, current); + if (extensions && !fileExtensionIsAny(name, extensions)) + return "continue"; + if (excludeRegex && excludeRegex.test(absoluteName)) + return "continue"; + if (!includeFileRegexes) { + results[0].push(name); + } + else { + var includeIndex = findIndex(includeFileRegexes, function (re) { return re.test(absoluteName); }); + if (includeIndex !== -1) { + results[includeIndex].push(name); + } + } + }; for (var _i = 0, files_1 = files; _i < files_1.length; _i++) { var current = files_1[_i]; - var name_1 = combinePaths(path, current); - var absoluteName = combinePaths(absolutePath, current); - if ((!extensions || fileExtensionIsAny(name_1, extensions)) && - (!includeFileRegex || includeFileRegex.test(absoluteName)) && - (!excludeRegex || !excludeRegex.test(absoluteName))) { - result.push(name_1); - } + _loop_1(current); } for (var _b = 0, directories_1 = directories; _b < directories_1.length; _b++) { var current = directories_1[_b]; - var name_2 = combinePaths(path, current); + var name = combinePaths(path, current); var absoluteName = combinePaths(absolutePath, current); if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) && (!excludeRegex || !excludeRegex.test(absoluteName))) { - visitDirectory(name_2, absoluteName); + visitDirectory(name, absoluteName); } } } @@ -2952,7 +3100,7 @@ var ts; } // Sort the offsets array using either the literal or canonical path representations. includeBasePaths.sort(useCaseSensitiveFileNames ? compareStrings : compareStringsCaseInsensitive); - var _loop_1 = function (includeBasePath) { + var _loop_2 = function (includeBasePath) { if (ts.every(basePaths, function (basePath) { return !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames); })) { basePaths.push(includeBasePath); } @@ -2961,7 +3109,7 @@ var ts; // subpath of an existing base path for (var _a = 0, includeBasePaths_1 = includeBasePaths; _a < includeBasePaths_1.length; _a++) { var includeBasePath = includeBasePaths_1[_a]; - _loop_1(includeBasePath); + _loop_2(includeBasePath); } } return basePaths; @@ -3010,8 +3158,19 @@ var ts; ts.supportedTypescriptExtensionsForExtractExtension = [".d.ts", ".ts", ".tsx"]; ts.supportedJavascriptExtensions = [".js", ".jsx"]; var allSupportedExtensions = ts.supportedTypeScriptExtensions.concat(ts.supportedJavascriptExtensions); - function getSupportedExtensions(options) { - return options && options.allowJs ? allSupportedExtensions : ts.supportedTypeScriptExtensions; + function getSupportedExtensions(options, extraFileExtensions) { + var needAllExtensions = options && options.allowJs; + if (!extraFileExtensions || extraFileExtensions.length === 0 || !needAllExtensions) { + return needAllExtensions ? allSupportedExtensions : ts.supportedTypeScriptExtensions; + } + var extensions = allSupportedExtensions.slice(0); + for (var _i = 0, extraFileExtensions_1 = extraFileExtensions; _i < extraFileExtensions_1.length; _i++) { + var extInfo = extraFileExtensions_1[_i]; + if (extensions.indexOf(extInfo.extension) === -1) { + extensions.push(extInfo.extension); + } + } + return extensions; } ts.getSupportedExtensions = getSupportedExtensions; function hasJavaScriptFileExtension(fileName) { @@ -3022,11 +3181,11 @@ var ts; return forEach(ts.supportedTypeScriptExtensions, function (extension) { return fileExtensionIs(fileName, extension); }); } ts.hasTypeScriptFileExtension = hasTypeScriptFileExtension; - function isSupportedSourceFileName(fileName, compilerOptions) { + function isSupportedSourceFileName(fileName, compilerOptions, extraFileExtensions) { if (!fileName) { return false; } - for (var _i = 0, _a = getSupportedExtensions(compilerOptions); _i < _a.length; _i++) { + for (var _i = 0, _a = getSupportedExtensions(compilerOptions, extraFileExtensions); _i < _a.length; _i++) { var extension = _a[_i]; if (fileExtensionIs(fileName, extension)) { return true; @@ -3044,14 +3203,13 @@ var ts; (function (ExtensionPriority) { ExtensionPriority[ExtensionPriority["TypeScriptFiles"] = 0] = "TypeScriptFiles"; ExtensionPriority[ExtensionPriority["DeclarationAndJavaScriptFiles"] = 2] = "DeclarationAndJavaScriptFiles"; - ExtensionPriority[ExtensionPriority["Limit"] = 5] = "Limit"; ExtensionPriority[ExtensionPriority["Highest"] = 0] = "Highest"; ExtensionPriority[ExtensionPriority["Lowest"] = 2] = "Lowest"; })(ExtensionPriority = ts.ExtensionPriority || (ts.ExtensionPriority = {})); function getExtensionPriority(path, supportedExtensions) { for (var i = supportedExtensions.length - 1; i >= 0; i--) { if (fileExtensionIs(path, supportedExtensions[i])) { - return adjustExtensionPriority(i); + return adjustExtensionPriority(i, supportedExtensions); } } // If its not in the list of supported extensions, this is likely a @@ -3062,27 +3220,27 @@ var ts; /** * Adjusts an extension priority to be the highest priority within the same range. */ - function adjustExtensionPriority(extensionPriority) { + function adjustExtensionPriority(extensionPriority, supportedExtensions) { if (extensionPriority < 2 /* DeclarationAndJavaScriptFiles */) { return 0 /* TypeScriptFiles */; } - else if (extensionPriority < 5 /* Limit */) { + else if (extensionPriority < supportedExtensions.length) { return 2 /* DeclarationAndJavaScriptFiles */; } else { - return 5 /* Limit */; + return supportedExtensions.length; } } ts.adjustExtensionPriority = adjustExtensionPriority; /** * Gets the next lowest extension priority for a given priority. */ - function getNextLowestExtensionPriority(extensionPriority) { + function getNextLowestExtensionPriority(extensionPriority, supportedExtensions) { if (extensionPriority < 2 /* DeclarationAndJavaScriptFiles */) { return 2 /* DeclarationAndJavaScriptFiles */; } else { - return 5 /* Limit */; + return supportedExtensions.length; } } ts.getNextLowestExtensionPriority = getNextLowestExtensionPriority; @@ -3329,144 +3487,30 @@ var ts; } } ts.tryGetExtensionFromPath = tryGetExtensionFromPath; + function isCheckJsEnabledForFile(sourceFile, compilerOptions) { + return sourceFile.checkJsDirective ? sourceFile.checkJsDirective.enabled : compilerOptions.checkJs; + } + ts.isCheckJsEnabledForFile = isCheckJsEnabledForFile; })(ts || (ts = {})); /// var ts; (function (ts) { - ts.sys = (function () { - function getWScriptSystem() { - var fso = new ActiveXObject("Scripting.FileSystemObject"); - var shell = new ActiveXObject("WScript.Shell"); - var fileStream = new ActiveXObject("ADODB.Stream"); - fileStream.Type = 2 /*text*/; - var binaryStream = new ActiveXObject("ADODB.Stream"); - binaryStream.Type = 1 /*binary*/; - var args = []; - for (var i = 0; i < WScript.Arguments.length; i++) { - args[i] = WScript.Arguments.Item(i); - } - function readFile(fileName, encoding) { - if (!fso.FileExists(fileName)) { - return undefined; - } - fileStream.Open(); - try { - if (encoding) { - fileStream.Charset = encoding; - fileStream.LoadFromFile(fileName); - } - else { - // Load file and read the first two bytes into a string with no interpretation - fileStream.Charset = "x-ansi"; - fileStream.LoadFromFile(fileName); - var bom = fileStream.ReadText(2) || ""; - // Position must be at 0 before encoding can be changed - fileStream.Position = 0; - // [0xFF,0xFE] and [0xFE,0xFF] mean utf-16 (little or big endian), otherwise default to utf-8 - fileStream.Charset = bom.length >= 2 && (bom.charCodeAt(0) === 0xFF && bom.charCodeAt(1) === 0xFE || bom.charCodeAt(0) === 0xFE && bom.charCodeAt(1) === 0xFF) ? "unicode" : "utf-8"; - } - // ReadText method always strips byte order mark from resulting string - return fileStream.ReadText(); - } - catch (e) { - throw e; - } - finally { - fileStream.Close(); - } - } - function writeFile(fileName, data, writeByteOrderMark) { - fileStream.Open(); - binaryStream.Open(); - try { - // Write characters in UTF-8 encoding - fileStream.Charset = "utf-8"; - fileStream.WriteText(data); - // If we don't want the BOM, then skip it by setting the starting location to 3 (size of BOM). - // If not, start from position 0, as the BOM will be added automatically when charset==utf8. - if (writeByteOrderMark) { - fileStream.Position = 0; - } - else { - fileStream.Position = 3; - } - fileStream.CopyTo(binaryStream); - binaryStream.SaveToFile(fileName, 2 /*overwrite*/); - } - finally { - binaryStream.Close(); - fileStream.Close(); - } - } - function getNames(collection) { - var result = []; - for (var e = new Enumerator(collection); !e.atEnd(); e.moveNext()) { - result.push(e.item().Name); - } - return result.sort(); - } - function getDirectories(path) { - var folder = fso.GetFolder(path); - return getNames(folder.subfolders); - } - function getAccessibleFileSystemEntries(path) { - try { - var folder = fso.GetFolder(path || "."); - var files = getNames(folder.files); - var directories = getNames(folder.subfolders); - return { files: files, directories: directories }; - } - catch (e) { - return { files: [], directories: [] }; - } - } - function readDirectory(path, extensions, excludes, includes) { - return ts.matchFiles(path, extensions, excludes, includes, /*useCaseSensitiveFileNames*/ false, shell.CurrentDirectory, getAccessibleFileSystemEntries); - } - var wscriptSystem = { - args: args, - newLine: "\r\n", - useCaseSensitiveFileNames: false, - write: function (s) { - WScript.StdOut.Write(s); - }, - readFile: readFile, - writeFile: writeFile, - resolvePath: function (path) { - return fso.GetAbsolutePathName(path); - }, - fileExists: function (path) { - return fso.FileExists(path); - }, - directoryExists: function (path) { - return fso.FolderExists(path); - }, - createDirectory: function (directoryName) { - if (!wscriptSystem.directoryExists(directoryName)) { - fso.CreateFolder(directoryName); - } - }, - getExecutingFilePath: function () { - return WScript.ScriptFullName; - }, - getCurrentDirectory: function () { - return shell.CurrentDirectory; - }, - getDirectories: getDirectories, - getEnvironmentVariable: function (name) { - return new ActiveXObject("WScript.Shell").ExpandEnvironmentStrings("%" + name + "%"); - }, - readDirectory: readDirectory, - exit: function (exitCode) { - try { - WScript.Quit(exitCode); - } - catch (e) { - } - } - }; - return wscriptSystem; + function getNodeMajorVersion() { + if (typeof process === "undefined") { + return undefined; } + var version = process.version; + if (!version) { + return undefined; + } + var dot = version.indexOf("."); + if (dot === -1) { + return undefined; + } + return parseInt(version.substring(1, dot)); + } + ts.getNodeMajorVersion = getNodeMajorVersion; + ts.sys = (function () { function getNodeSystem() { var _fs = require("fs"); var _path = require("path"); @@ -3476,32 +3520,32 @@ var ts; function createWatchedFileSet() { var dirWatchers = ts.createMap(); // One file can have multiple watchers - var fileWatcherCallbacks = ts.createMap(); + var fileWatcherCallbacks = ts.createMultiMap(); return { addFile: addFile, removeFile: removeFile }; function reduceDirWatcherRefCountForFile(fileName) { var dirName = ts.getDirectoryPath(fileName); - var watcher = dirWatchers[dirName]; + var watcher = dirWatchers.get(dirName); if (watcher) { watcher.referenceCount -= 1; if (watcher.referenceCount <= 0) { watcher.close(); - delete dirWatchers[dirName]; + dirWatchers.delete(dirName); } } } function addDirWatcher(dirPath) { - var watcher = dirWatchers[dirPath]; + var watcher = dirWatchers.get(dirPath); if (watcher) { watcher.referenceCount += 1; return; } watcher = _fs.watch(dirPath, { persistent: true }, function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); watcher.referenceCount = 1; - dirWatchers[dirPath] = watcher; + dirWatchers.set(dirPath, watcher); return; } function addFileWatcherCallback(filePath, callback) { - ts.multiMapAdd(fileWatcherCallbacks, filePath, callback); + fileWatcherCallbacks.add(filePath, callback); } function addFile(fileName, callback) { addFileWatcherCallback(fileName, callback); @@ -3513,7 +3557,7 @@ var ts; reduceDirWatcherRefCountForFile(watchedFile.fileName); } function removeFileWatcherCallback(filePath, callback) { - ts.multiMapRemove(fileWatcherCallbacks, filePath, callback); + fileWatcherCallbacks.remove(filePath, callback); } function fileEventHandler(eventName, relativeFileName, baseDirPath) { // When files are deleted from disk, the triggered "rename" event would have a relativefileName of "undefined" @@ -3521,18 +3565,20 @@ var ts; ? undefined : ts.getNormalizedAbsolutePath(relativeFileName, baseDirPath); // Some applications save a working file via rename operations - if ((eventName === "change" || eventName === "rename") && fileWatcherCallbacks[fileName]) { - for (var _i = 0, _a = fileWatcherCallbacks[fileName]; _i < _a.length; _i++) { - var fileCallback = _a[_i]; - fileCallback(fileName); + if ((eventName === "change" || eventName === "rename")) { + var callbacks = fileWatcherCallbacks.get(fileName); + if (callbacks) { + for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) { + var fileCallback = callbacks_1[_i]; + fileCallback(fileName); + } } } } } var watchedFileSet = createWatchedFileSet(); - function isNode4OrLater() { - return parseInt(process.version.charAt(1)) >= 4; - } + var nodeVersion = getNodeMajorVersion(); + var isNode4OrLater = nodeVersion >= 4; function isFileSystemCaseSensitive() { // win32\win64 are case insensitive platforms if (platform === "win32" || platform === "win64") { @@ -3553,7 +3599,7 @@ var ts; if (len >= 2 && buffer[0] === 0xFE && buffer[1] === 0xFF) { // Big endian UTF-16 byte order mark detected. Since big endian is not supported by node.js, // flip all byte pairs and treat as little endian. - len &= ~1; + len &= ~1; // Round down to a multiple of 2 for (var i = 0; i < len; i += 2) { var temp = buffer[i]; buffer[i] = buffer[i + 1]; @@ -3580,7 +3626,7 @@ var ts; var fd; try { fd = _fs.openSync(fileName, "w"); - _fs.writeSync(fd, data, undefined, "utf8"); + _fs.writeSync(fd, data, /*position*/ undefined, "utf8"); } finally { if (fd !== undefined) { @@ -3600,10 +3646,10 @@ var ts; if (entry === "." || entry === "..") { continue; } - var name_3 = ts.combinePaths(path, entry); + var name = ts.combinePaths(path, entry); var stat = void 0; try { - stat = _fs.statSync(name_3); + stat = _fs.statSync(name); } catch (e) { continue; @@ -3685,9 +3731,10 @@ var ts; // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643) var options; if (!directoryExists(directoryName)) { + // do nothing if target folder does not exist return noOpFileWatcher; } - if (isNode4OrLater() && (process.platform === "win32" || process.platform === "darwin")) { + if (isNode4OrLater && (process.platform === "win32" || process.platform === "darwin")) { options = { persistent: true, recursive: !!recursive }; } else { @@ -3701,7 +3748,6 @@ var ts; // When deleting a file, the passed baseFileName is null callback(!relativeFileName ? relativeFileName : ts.normalizePath(ts.combinePaths(directoryName, relativeFileName))); } - ; }); }, resolvePath: function (path) { @@ -3765,6 +3811,7 @@ var ts; require("source-map-support").install(); } catch (e) { + // Could not enable source maps. } }, setTimeout: setTimeout, @@ -3820,9 +3867,6 @@ var ts; if (typeof ChakraHost !== "undefined") { sys = getChakraSystem(); } - else if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { - sys = getWScriptSystem(); - } else if (typeof process !== "undefined" && process.nextTick && !process.browser && typeof require !== "undefined") { // process and process.nextTick checks if current environment is node-like // process.browser check excludes webpack and browserify @@ -3897,11 +3941,11 @@ var ts; Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value: { code: 1055, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055", message: "Type '{0}' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value." }, Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: ts.DiagnosticCategory.Error, key: "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056", message: "Accessors are only available when targeting ECMAScript 5 and higher." }, An_async_function_or_method_must_have_a_valid_awaitable_return_type: { code: 1057, category: ts.DiagnosticCategory.Error, key: "An_async_function_or_method_must_have_a_valid_awaitable_return_type_1057", message: "An async function or method must have a valid awaitable return type." }, - Operand_for_await_does_not_have_a_valid_callable_then_member: { code: 1058, category: ts.DiagnosticCategory.Error, key: "Operand_for_await_does_not_have_a_valid_callable_then_member_1058", message: "Operand for 'await' does not have a valid callable 'then' member." }, - Return_expression_in_async_function_does_not_have_a_valid_callable_then_member: { code: 1059, category: ts.DiagnosticCategory.Error, key: "Return_expression_in_async_function_does_not_have_a_valid_callable_then_member_1059", message: "Return expression in async function does not have a valid callable 'then' member." }, - Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member: { code: 1060, category: ts.DiagnosticCategory.Error, key: "Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member_1060", message: "Expression body for async arrow function does not have a valid callable 'then' member." }, + The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1058, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058", message: "The return type of an async function must either be a valid promise or must not contain a callable 'then' member." }, + A_promise_must_have_a_then_method: { code: 1059, category: ts.DiagnosticCategory.Error, key: "A_promise_must_have_a_then_method_1059", message: "A promise must have a 'then' method." }, + The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback: { code: 1060, category: ts.DiagnosticCategory.Error, key: "The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060", message: "The first parameter of the 'then' method of a promise must be a callback." }, Enum_member_must_have_initializer: { code: 1061, category: ts.DiagnosticCategory.Error, key: "Enum_member_must_have_initializer_1061", message: "Enum member must have initializer." }, - _0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: { code: 1062, category: ts.DiagnosticCategory.Error, key: "_0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062", message: "{0} is referenced directly or indirectly in the fulfillment callback of its own 'then' method." }, + Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: { code: 1062, category: ts.DiagnosticCategory.Error, key: "Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062", message: "Type is referenced directly or indirectly in the fulfillment callback of its own 'then' method." }, An_export_assignment_cannot_be_used_in_a_namespace: { code: 1063, category: ts.DiagnosticCategory.Error, key: "An_export_assignment_cannot_be_used_in_a_namespace_1063", message: "An export assignment cannot be used in a namespace." }, The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type: { code: 1064, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1064", message: "The return type of an async function or method must be the global Promise type." }, In_ambient_enum_declarations_member_initializer_must_be_constant_expression: { code: 1066, category: ts.DiagnosticCategory.Error, key: "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066", message: "In ambient enum declarations member initializer must be constant expression." }, @@ -3910,7 +3954,7 @@ var ts; _0_modifier_cannot_appear_on_an_index_signature: { code: 1071, category: ts.DiagnosticCategory.Error, key: "_0_modifier_cannot_appear_on_an_index_signature_1071", message: "'{0}' modifier cannot appear on an index signature." }, A_0_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: ts.DiagnosticCategory.Error, key: "A_0_modifier_cannot_be_used_with_an_import_declaration_1079", message: "A '{0}' modifier cannot be used with an import declaration." }, Invalid_reference_directive_syntax: { code: 1084, category: ts.DiagnosticCategory.Error, key: "Invalid_reference_directive_syntax_1084", message: "Invalid 'reference' directive syntax." }, - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: ts.DiagnosticCategory.Error, key: "Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_1085", message: "Octal literals are not available when targeting ECMAScript 5 and higher." }, + Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0: { code: 1085, category: ts.DiagnosticCategory.Error, key: "Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0_1085", message: "Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '{0}'." }, An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: ts.DiagnosticCategory.Error, key: "An_accessor_cannot_be_declared_in_an_ambient_context_1086", message: "An accessor cannot be declared in an ambient context." }, _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: ts.DiagnosticCategory.Error, key: "_0_modifier_cannot_appear_on_a_constructor_declaration_1089", message: "'{0}' modifier cannot appear on a constructor declaration." }, _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: ts.DiagnosticCategory.Error, key: "_0_modifier_cannot_appear_on_a_parameter_1090", message: "'{0}' modifier cannot appear on a parameter." }, @@ -3926,6 +3970,7 @@ var ts; Invalid_use_of_0_in_strict_mode: { code: 1100, category: ts.DiagnosticCategory.Error, key: "Invalid_use_of_0_in_strict_mode_1100", message: "Invalid use of '{0}' in strict mode." }, with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: ts.DiagnosticCategory.Error, key: "with_statements_are_not_allowed_in_strict_mode_1101", message: "'with' statements are not allowed in strict mode." }, delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: ts.DiagnosticCategory.Error, key: "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102", message: "'delete' cannot be called on an identifier in strict mode." }, + A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator: { code: 1103, category: ts.DiagnosticCategory.Error, key: "A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator_1103", message: "A 'for-await-of' statement is only allowed within an async function or async generator." }, A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: ts.DiagnosticCategory.Error, key: "A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104", message: "A 'continue' statement can only be used within an enclosing iteration statement." }, A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: ts.DiagnosticCategory.Error, key: "A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105", message: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, Jump_target_cannot_cross_function_boundary: { code: 1107, category: ts.DiagnosticCategory.Error, key: "Jump_target_cannot_cross_function_boundary_1107", message: "Jump target cannot cross function boundary." }, @@ -3933,7 +3978,7 @@ var ts; Expression_expected: { code: 1109, category: ts.DiagnosticCategory.Error, key: "Expression_expected_1109", message: "Expression expected." }, Type_expected: { code: 1110, category: ts.DiagnosticCategory.Error, key: "Type_expected_1110", message: "Type expected." }, A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: ts.DiagnosticCategory.Error, key: "A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113", message: "A 'default' clause cannot appear more than once in a 'switch' statement." }, - Duplicate_label_0: { code: 1114, category: ts.DiagnosticCategory.Error, key: "Duplicate_label_0_1114", message: "Duplicate label '{0}'" }, + Duplicate_label_0: { code: 1114, category: ts.DiagnosticCategory.Error, key: "Duplicate_label_0_1114", message: "Duplicate label '{0}'." }, A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: ts.DiagnosticCategory.Error, key: "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", message: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: ts.DiagnosticCategory.Error, key: "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", message: "A 'break' statement can only jump to a label of an enclosing statement." }, An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: ts.DiagnosticCategory.Error, key: "An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode_1117", message: "An object literal cannot have multiple properties with the same name in strict mode." }, @@ -3965,9 +4010,9 @@ var ts; Declaration_expected: { code: 1146, category: ts.DiagnosticCategory.Error, key: "Declaration_expected_1146", message: "Declaration expected." }, Import_declarations_in_a_namespace_cannot_reference_a_module: { code: 1147, category: ts.DiagnosticCategory.Error, key: "Import_declarations_in_a_namespace_cannot_reference_a_module_1147", message: "Import declarations in a namespace cannot reference a module." }, Cannot_use_imports_exports_or_module_augmentations_when_module_is_none: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148", message: "Cannot use imports, exports, or module augmentations when '--module' is 'none'." }, - File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", message: "File name '{0}' differs from already included file name '{1}' only in casing" }, + File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", message: "File name '{0}' differs from already included file name '{1}' only in casing." }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: ts.DiagnosticCategory.Error, key: "new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead_1150", message: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "const_declarations_must_be_initialized_1155", message: "'const' declarations must be initialized" }, + const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "const_declarations_must_be_initialized_1155", message: "'const' declarations must be initialized." }, const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: ts.DiagnosticCategory.Error, key: "const_declarations_can_only_be_declared_inside_a_block_1156", message: "'const' declarations can only be declared inside a block." }, let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: ts.DiagnosticCategory.Error, key: "let_declarations_can_only_be_declared_inside_a_block_1157", message: "'let' declarations can only be declared inside a block." }, Unterminated_template_literal: { code: 1160, category: ts.DiagnosticCategory.Error, key: "Unterminated_template_literal_1160", message: "Unterminated template literal." }, @@ -4016,11 +4061,12 @@ var ts; Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided_1208", message: "Cannot compile namespaces when the '--isolatedModules' flag is provided." }, Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided_1209", message: "Ambient const enums are not allowed when the '--isolatedModules' flag is provided." }, Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode_1210", message: "Invalid use of '{0}'. Class definitions are automatically in strict mode." }, - A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", message: "A class declaration without the 'default' modifier must have a name" }, - Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", message: "Identifier expected. '{0}' is a reserved word in strict mode" }, + A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", message: "A class declaration without the 'default' modifier must have a name." }, + Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", message: "Identifier expected. '{0}' is a reserved word in strict mode." }, Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213", message: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode: { code: 1214, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214", message: "Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode." }, Invalid_use_of_0_Modules_are_automatically_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215", message: "Invalid use of '{0}'. Modules are automatically in strict mode." }, + Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216", message: "Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules." }, Export_assignment_is_not_supported_when_module_flag_is_system: { code: 1218, category: ts.DiagnosticCategory.Error, key: "Export_assignment_is_not_supported_when_module_flag_is_system_1218", message: "Export assignment is not supported when '--module' flag is 'system'." }, Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning: { code: 1219, category: ts.DiagnosticCategory.Error, key: "Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219", message: "Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning." }, Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher: { code: 1220, category: ts.DiagnosticCategory.Error, key: "Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher_1220", message: "Generators are only available when targeting ECMAScript 2015 or higher." }, @@ -4066,6 +4112,11 @@ var ts; Global_module_exports_may_only_appear_in_declaration_files: { code: 1315, category: ts.DiagnosticCategory.Error, key: "Global_module_exports_may_only_appear_in_declaration_files_1315", message: "Global module exports may only appear in declaration files." }, Global_module_exports_may_only_appear_at_top_level: { code: 1316, category: ts.DiagnosticCategory.Error, key: "Global_module_exports_may_only_appear_at_top_level_1316", message: "Global module exports may only appear at top level." }, A_parameter_property_cannot_be_declared_using_a_rest_parameter: { code: 1317, category: ts.DiagnosticCategory.Error, key: "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317", message: "A parameter property cannot be declared using a rest parameter." }, + An_abstract_accessor_cannot_have_an_implementation: { code: 1318, category: ts.DiagnosticCategory.Error, key: "An_abstract_accessor_cannot_have_an_implementation_1318", message: "An abstract accessor cannot have an implementation." }, + A_default_export_can_only_be_used_in_an_ECMAScript_style_module: { code: 1319, category: ts.DiagnosticCategory.Error, key: "A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319", message: "A default export can only be used in an ECMAScript-style module." }, + Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1320, category: ts.DiagnosticCategory.Error, key: "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320", message: "Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member." }, + Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1321, category: ts.DiagnosticCategory.Error, key: "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321", message: "Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member." }, + Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1322, category: ts.DiagnosticCategory.Error, key: "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322", message: "Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member." }, Duplicate_identifier_0: { code: 2300, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_2300", message: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: ts.DiagnosticCategory.Error, key: "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", message: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: ts.DiagnosticCategory.Error, key: "Static_members_cannot_reference_class_type_parameters_2302", message: "Static members cannot reference class type parameters." }, @@ -4109,6 +4160,7 @@ var ts; Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: ts.DiagnosticCategory.Error, key: "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340", message: "Only public and protected methods of the base class are accessible via the 'super' keyword." }, Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: ts.DiagnosticCategory.Error, key: "Property_0_is_private_and_only_accessible_within_class_1_2341", message: "Property '{0}' is private and only accessible within class '{1}'." }, An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { code: 2342, category: ts.DiagnosticCategory.Error, key: "An_index_expression_argument_must_be_of_type_string_number_symbol_or_any_2342", message: "An index expression argument must be of type 'string', 'number', 'symbol', or 'any'." }, + This_syntax_requires_an_imported_helper_named_1_but_module_0_has_no_exported_member_1: { code: 2343, category: ts.DiagnosticCategory.Error, key: "This_syntax_requires_an_imported_helper_named_1_but_module_0_has_no_exported_member_1_2343", message: "This syntax requires an imported helper named '{1}', but module '{0}' has no exported member '{1}'." }, Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: ts.DiagnosticCategory.Error, key: "Type_0_does_not_satisfy_the_constraint_1_2344", message: "Type '{0}' does not satisfy the constraint '{1}'." }, Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: ts.DiagnosticCategory.Error, key: "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345", message: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: ts.DiagnosticCategory.Error, key: "Supplied_parameters_do_not_match_any_signature_of_call_target_2346", message: "Supplied parameters do not match any signature of call target." }, @@ -4119,19 +4171,20 @@ var ts; Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: ts.DiagnosticCategory.Error, key: "Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature_2351", message: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, Type_0_cannot_be_converted_to_type_1: { code: 2352, category: ts.DiagnosticCategory.Error, key: "Type_0_cannot_be_converted_to_type_1_2352", message: "Type '{0}' cannot be converted to type '{1}'." }, Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1: { code: 2353, category: ts.DiagnosticCategory.Error, key: "Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353", message: "Object literal may only specify known properties, and '{0}' does not exist in type '{1}'." }, + This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found: { code: 2354, category: ts.DiagnosticCategory.Error, key: "This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354", message: "This syntax requires an imported helper but module '{0}' cannot be found." }, A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value: { code: 2355, category: ts.DiagnosticCategory.Error, key: "A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_2355", message: "A function whose declared type is neither 'void' nor 'any' must return a value." }, An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: ts.DiagnosticCategory.Error, key: "An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type_2356", message: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access: { code: 2357, category: ts.DiagnosticCategory.Error, key: "The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357", message: "The operand of an increment or decrement operator must be a variable or a property access." }, The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358", message: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359", message: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { code: 2360, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol_2360", message: "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'." }, - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter_2361", message: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter_2361", message: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter." }, The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2362", message: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2363", message: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access: { code: 2364, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364", message: "The left-hand side of an assignment expression must be a variable or a property access." }, Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: ts.DiagnosticCategory.Error, key: "Operator_0_cannot_be_applied_to_types_1_and_2_2365", message: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined: { code: 2366, category: ts.DiagnosticCategory.Error, key: "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366", message: "Function lacks ending return statement and return type does not include 'undefined'." }, - Type_parameter_name_cannot_be_0: { code: 2368, category: ts.DiagnosticCategory.Error, key: "Type_parameter_name_cannot_be_0_2368", message: "Type parameter name cannot be '{0}'" }, + Type_parameter_name_cannot_be_0: { code: 2368, category: ts.DiagnosticCategory.Error, key: "Type_parameter_name_cannot_be_0_2368", message: "Type parameter name cannot be '{0}'." }, A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: ts.DiagnosticCategory.Error, key: "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369", message: "A parameter property is only allowed in a constructor implementation." }, A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: ts.DiagnosticCategory.Error, key: "A_rest_parameter_must_be_of_an_array_type_2370", message: "A rest parameter must be of an array type." }, A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: ts.DiagnosticCategory.Error, key: "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371", message: "A parameter initializer is only allowed in a function or constructor implementation." }, @@ -4171,12 +4224,12 @@ var ts; The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access: { code: 2406, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406", message: "The left-hand side of a 'for...in' statement must be a variable or a property access." }, The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_2407", message: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, Setters_cannot_return_a_value: { code: 2408, category: ts.DiagnosticCategory.Error, key: "Setters_cannot_return_a_value_2408", message: "Setters cannot return a value." }, - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: ts.DiagnosticCategory.Error, key: "Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409", message: "Return type of constructor signature must be assignable to the instance type of the class" }, + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: ts.DiagnosticCategory.Error, key: "Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409", message: "Return type of constructor signature must be assignable to the instance type of the class." }, The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any: { code: 2410, category: ts.DiagnosticCategory.Error, key: "The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410", message: "The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'." }, Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: ts.DiagnosticCategory.Error, key: "Property_0_of_type_1_is_not_assignable_to_string_index_type_2_2411", message: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: ts.DiagnosticCategory.Error, key: "Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2_2412", message: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: ts.DiagnosticCategory.Error, key: "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413", message: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, - Class_name_cannot_be_0: { code: 2414, category: ts.DiagnosticCategory.Error, key: "Class_name_cannot_be_0_2414", message: "Class name cannot be '{0}'" }, + Class_name_cannot_be_0: { code: 2414, category: ts.DiagnosticCategory.Error, key: "Class_name_cannot_be_0_2414", message: "Class name cannot be '{0}'." }, Class_0_incorrectly_extends_base_class_1: { code: 2415, category: ts.DiagnosticCategory.Error, key: "Class_0_incorrectly_extends_base_class_1_2415", message: "Class '{0}' incorrectly extends base class '{1}'." }, Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: ts.DiagnosticCategory.Error, key: "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", message: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, Class_0_incorrectly_implements_interface_1: { code: 2420, category: ts.DiagnosticCategory.Error, key: "Class_0_incorrectly_implements_interface_1_2420", message: "Class '{0}' incorrectly implements interface '{1}'." }, @@ -4185,19 +4238,19 @@ var ts; Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: ts.DiagnosticCategory.Error, key: "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424", message: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: ts.DiagnosticCategory.Error, key: "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425", message: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: ts.DiagnosticCategory.Error, key: "Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426", message: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Interface_name_cannot_be_0: { code: 2427, category: ts.DiagnosticCategory.Error, key: "Interface_name_cannot_be_0_2427", message: "Interface name cannot be '{0}'" }, + Interface_name_cannot_be_0: { code: 2427, category: ts.DiagnosticCategory.Error, key: "Interface_name_cannot_be_0_2427", message: "Interface name cannot be '{0}'." }, All_declarations_of_0_must_have_identical_type_parameters: { code: 2428, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_0_must_have_identical_type_parameters_2428", message: "All declarations of '{0}' must have identical type parameters." }, Interface_0_incorrectly_extends_interface_1: { code: 2430, category: ts.DiagnosticCategory.Error, key: "Interface_0_incorrectly_extends_interface_1_2430", message: "Interface '{0}' incorrectly extends interface '{1}'." }, - Enum_name_cannot_be_0: { code: 2431, category: ts.DiagnosticCategory.Error, key: "Enum_name_cannot_be_0_2431", message: "Enum name cannot be '{0}'" }, + Enum_name_cannot_be_0: { code: 2431, category: ts.DiagnosticCategory.Error, key: "Enum_name_cannot_be_0_2431", message: "Enum name cannot be '{0}'." }, In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: ts.DiagnosticCategory.Error, key: "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432", message: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433", message: "A namespace declaration cannot be in a different file from a class or function with which it is merged" }, - A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434", message: "A namespace declaration cannot be located prior to a class or function with which it is merged" }, + A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433", message: "A namespace declaration cannot be in a different file from a class or function with which it is merged." }, + A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434", message: "A namespace declaration cannot be located prior to a class or function with which it is merged." }, Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces: { code: 2435, category: ts.DiagnosticCategory.Error, key: "Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435", message: "Ambient modules cannot be nested in other modules or namespaces." }, Ambient_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: ts.DiagnosticCategory.Error, key: "Ambient_module_declaration_cannot_specify_relative_module_name_2436", message: "Ambient module declaration cannot specify relative module name." }, - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: ts.DiagnosticCategory.Error, key: "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437", message: "Module '{0}' is hidden by a local declaration with the same name" }, - Import_name_cannot_be_0: { code: 2438, category: ts.DiagnosticCategory.Error, key: "Import_name_cannot_be_0_2438", message: "Import name cannot be '{0}'" }, + Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: ts.DiagnosticCategory.Error, key: "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437", message: "Module '{0}' is hidden by a local declaration with the same name." }, + Import_name_cannot_be_0: { code: 2438, category: ts.DiagnosticCategory.Error, key: "Import_name_cannot_be_0_2438", message: "Import name cannot be '{0}'." }, Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name: { code: 2439, category: ts.DiagnosticCategory.Error, key: "Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439", message: "Import or export declaration in an ambient module declaration cannot reference module through relative module name." }, - Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: ts.DiagnosticCategory.Error, key: "Import_declaration_conflicts_with_local_declaration_of_0_2440", message: "Import declaration conflicts with local declaration of '{0}'" }, + Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: ts.DiagnosticCategory.Error, key: "Import_declaration_conflicts_with_local_declaration_of_0_2440", message: "Import declaration conflicts with local declaration of '{0}'." }, Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module: { code: 2441, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441", message: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module." }, Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: ts.DiagnosticCategory.Error, key: "Types_have_separate_declarations_of_a_private_property_0_2442", message: "Types have separate declarations of a private property '{0}'." }, Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: ts.DiagnosticCategory.Error, key: "Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443", message: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, @@ -4206,18 +4259,20 @@ var ts; Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: ts.DiagnosticCategory.Error, key: "Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_2446", message: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: ts.DiagnosticCategory.Error, key: "The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447", message: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: ts.DiagnosticCategory.Error, key: "Block_scoped_variable_0_used_before_its_declaration_2448", message: "Block-scoped variable '{0}' used before its declaration." }, + Class_0_used_before_its_declaration: { code: 2449, category: ts.DiagnosticCategory.Error, key: "Class_0_used_before_its_declaration_2449", message: "Class '{0}' used before its declaration." }, + Enum_0_used_before_its_declaration: { code: 2450, category: ts.DiagnosticCategory.Error, key: "Enum_0_used_before_its_declaration_2450", message: "Enum '{0}' used before its declaration." }, Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_block_scoped_variable_0_2451", message: "Cannot redeclare block-scoped variable '{0}'." }, An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: ts.DiagnosticCategory.Error, key: "An_enum_member_cannot_have_a_numeric_name_2452", message: "An enum member cannot have a numeric name." }, The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: ts.DiagnosticCategory.Error, key: "The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_typ_2453", message: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, Variable_0_is_used_before_being_assigned: { code: 2454, category: ts.DiagnosticCategory.Error, key: "Variable_0_is_used_before_being_assigned_2454", message: "Variable '{0}' is used before being assigned." }, Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: ts.DiagnosticCategory.Error, key: "Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0_2455", message: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, Type_alias_0_circularly_references_itself: { code: 2456, category: ts.DiagnosticCategory.Error, key: "Type_alias_0_circularly_references_itself_2456", message: "Type alias '{0}' circularly references itself." }, - Type_alias_name_cannot_be_0: { code: 2457, category: ts.DiagnosticCategory.Error, key: "Type_alias_name_cannot_be_0_2457", message: "Type alias name cannot be '{0}'" }, + Type_alias_name_cannot_be_0: { code: 2457, category: ts.DiagnosticCategory.Error, key: "Type_alias_name_cannot_be_0_2457", message: "Type alias name cannot be '{0}'." }, An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: ts.DiagnosticCategory.Error, key: "An_AMD_module_cannot_have_multiple_name_assignments_2458", message: "An AMD module cannot have multiple name assignments." }, Type_0_has_no_property_1_and_no_string_index_signature: { code: 2459, category: ts.DiagnosticCategory.Error, key: "Type_0_has_no_property_1_and_no_string_index_signature_2459", message: "Type '{0}' has no property '{1}' and no string index signature." }, Type_0_has_no_property_1: { code: 2460, category: ts.DiagnosticCategory.Error, key: "Type_0_has_no_property_1_2460", message: "Type '{0}' has no property '{1}'." }, Type_0_is_not_an_array_type: { code: 2461, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_2461", message: "Type '{0}' is not an array type." }, - A_rest_element_must_be_last_in_a_destructuring_pattern: { code: 2462, category: ts.DiagnosticCategory.Error, key: "A_rest_element_must_be_last_in_a_destructuring_pattern_2462", message: "A rest element must be last in a destructuring pattern" }, + A_rest_element_must_be_last_in_a_destructuring_pattern: { code: 2462, category: ts.DiagnosticCategory.Error, key: "A_rest_element_must_be_last_in_a_destructuring_pattern_2462", message: "A rest element must be last in a destructuring pattern." }, A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { code: 2463, category: ts.DiagnosticCategory.Error, key: "A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463", message: "A binding pattern parameter cannot be optional in an implementation signature." }, A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { code: 2464, category: ts.DiagnosticCategory.Error, key: "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464", message: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." }, this_cannot_be_referenced_in_a_computed_property_name: { code: 2465, category: ts.DiagnosticCategory.Error, key: "this_cannot_be_referenced_in_a_computed_property_name_2465", message: "'this' cannot be referenced in a computed property name." }, @@ -4238,13 +4293,13 @@ var ts; let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2480, category: ts.DiagnosticCategory.Error, key: "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480", message: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2481, category: ts.DiagnosticCategory.Error, key: "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481", message: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." }, The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { code: 2483, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483", message: "The left-hand side of a 'for...of' statement cannot use a type annotation." }, - Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: ts.DiagnosticCategory.Error, key: "Export_declaration_conflicts_with_exported_declaration_of_0_2484", message: "Export declaration conflicts with exported declaration of '{0}'" }, + Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: ts.DiagnosticCategory.Error, key: "Export_declaration_conflicts_with_exported_declaration_of_0_2484", message: "Export declaration conflicts with exported declaration of '{0}'." }, The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access: { code: 2487, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487", message: "The left-hand side of a 'for...of' statement must be a variable or a property access." }, Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: ts.DiagnosticCategory.Error, key: "Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488", message: "Type must have a '[Symbol.iterator]()' method that returns an iterator." }, An_iterator_must_have_a_next_method: { code: 2489, category: ts.DiagnosticCategory.Error, key: "An_iterator_must_have_a_next_method_2489", message: "An iterator must have a 'next()' method." }, The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { code: 2490, category: ts.DiagnosticCategory.Error, key: "The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property_2490", message: "The type returned by the 'next()' method of an iterator must have a 'value' property." }, The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { code: 2491, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491", message: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." }, - Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_identifier_0_in_catch_clause_2492", message: "Cannot redeclare identifier '{0}' in catch clause" }, + Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_identifier_0_in_catch_clause_2492", message: "Cannot redeclare identifier '{0}' in catch clause." }, Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { code: 2493, category: ts.DiagnosticCategory.Error, key: "Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2_2493", message: "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'." }, Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { code: 2494, category: ts.DiagnosticCategory.Error, key: "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494", message: "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher." }, Type_0_is_not_an_array_type_or_a_string_type: { code: 2495, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_or_a_string_type_2495", message: "Type '{0}' is not an array type or a string type." }, @@ -4256,6 +4311,7 @@ var ts; A_rest_element_cannot_contain_a_binding_pattern: { code: 2501, category: ts.DiagnosticCategory.Error, key: "A_rest_element_cannot_contain_a_binding_pattern_2501", message: "A rest element cannot contain a binding pattern." }, _0_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 2502, category: ts.DiagnosticCategory.Error, key: "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502", message: "'{0}' is referenced directly or indirectly in its own type annotation." }, Cannot_find_namespace_0: { code: 2503, category: ts.DiagnosticCategory.Error, key: "Cannot_find_namespace_0_2503", message: "Cannot find namespace '{0}'." }, + Type_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator: { code: 2504, category: ts.DiagnosticCategory.Error, key: "Type_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504", message: "Type must have a '[Symbol.asyncIterator]()' method that returns an async iterator." }, A_generator_cannot_have_a_void_type_annotation: { code: 2505, category: ts.DiagnosticCategory.Error, key: "A_generator_cannot_have_a_void_type_annotation_2505", message: "A generator cannot have a 'void' type annotation." }, _0_is_referenced_directly_or_indirectly_in_its_own_base_expression: { code: 2506, category: ts.DiagnosticCategory.Error, key: "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506", message: "'{0}' is referenced directly or indirectly in its own base expression." }, Type_0_is_not_a_constructor_function_type: { code: 2507, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_a_constructor_function_type_2507", message: "Type '{0}' is not a constructor function type." }, @@ -4270,6 +4326,7 @@ var ts; All_declarations_of_an_abstract_method_must_be_consecutive: { code: 2516, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_an_abstract_method_must_be_consecutive_2516", message: "All declarations of an abstract method must be consecutive." }, Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: { code: 2517, category: ts.DiagnosticCategory.Error, key: "Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517", message: "Cannot assign an abstract constructor type to a non-abstract constructor type." }, A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: { code: 2518, category: ts.DiagnosticCategory.Error, key: "A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518", message: "A 'this'-based type guard is not compatible with a parameter-based type guard." }, + An_async_iterator_must_have_a_next_method: { code: 2519, category: ts.DiagnosticCategory.Error, key: "An_async_iterator_must_have_a_next_method_2519", message: "An async iterator must have a 'next()' method." }, Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: { code: 2520, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520", message: "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions." }, Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: { code: 2521, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions_2521", message: "Expression resolves to variable declaration '{0}' that compiler uses to support async functions." }, The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method: { code: 2522, category: ts.DiagnosticCategory.Error, key: "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522", message: "The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method." }, @@ -4293,23 +4350,33 @@ var ts; Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property: { code: 2540, category: ts.DiagnosticCategory.Error, key: "Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property_2540", message: "Cannot assign to '{0}' because it is a constant or a read-only property." }, The_target_of_an_assignment_must_be_a_variable_or_a_property_access: { code: 2541, category: ts.DiagnosticCategory.Error, key: "The_target_of_an_assignment_must_be_a_variable_or_a_property_access_2541", message: "The target of an assignment must be a variable or a property access." }, Index_signature_in_type_0_only_permits_reading: { code: 2542, category: ts.DiagnosticCategory.Error, key: "Index_signature_in_type_0_only_permits_reading_2542", message: "Index signature in type '{0}' only permits reading." }, + Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference: { code: 2543, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543", message: "Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference." }, + Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference: { code: 2544, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544", message: "Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference." }, + A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any: { code: 2545, category: ts.DiagnosticCategory.Error, key: "A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545", message: "A mixin class must have a constructor with a single rest parameter of type 'any[]'." }, + Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1: { code: 2546, category: ts.DiagnosticCategory.Error, key: "Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1_2546", message: "Property '{0}' has conflicting declarations and is inaccessible in type '{1}'." }, + The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property: { code: 2547, category: ts.DiagnosticCategory.Error, key: "The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value__2547", message: "The type returned by the 'next()' method of an async iterator must be a promise for a type with a 'value' property." }, + Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2548, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548", message: "Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator." }, + Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2549, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549", message: "Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator." }, + Generic_type_instantiation_is_excessively_deep_and_possibly_infinite: { code: 2550, category: ts.DiagnosticCategory.Error, key: "Generic_type_instantiation_is_excessively_deep_and_possibly_infinite_2550", message: "Generic type instantiation is excessively deep and possibly infinite." }, JSX_element_attributes_type_0_may_not_be_a_union_type: { code: 2600, category: ts.DiagnosticCategory.Error, key: "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", message: "JSX element attributes type '{0}' may not be a union type." }, The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: { code: 2601, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", message: "The return type of a JSX element constructor must return an object type." }, JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: { code: 2602, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", message: "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist." }, - Property_0_in_type_1_is_not_assignable_to_type_2: { code: 2603, category: ts.DiagnosticCategory.Error, key: "Property_0_in_type_1_is_not_assignable_to_type_2_2603", message: "Property '{0}' in type '{1}' is not assignable to type '{2}'" }, + Property_0_in_type_1_is_not_assignable_to_type_2: { code: 2603, category: ts.DiagnosticCategory.Error, key: "Property_0_in_type_1_is_not_assignable_to_type_2_2603", message: "Property '{0}' in type '{1}' is not assignable to type '{2}'." }, JSX_element_type_0_does_not_have_any_construct_or_call_signatures: { code: 2604, category: ts.DiagnosticCategory.Error, key: "JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604", message: "JSX element type '{0}' does not have any construct or call signatures." }, JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements: { code: 2605, category: ts.DiagnosticCategory.Error, key: "JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements_2605", message: "JSX element type '{0}' is not a constructor function for JSX elements." }, Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property: { code: 2606, category: ts.DiagnosticCategory.Error, key: "Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606", message: "Property '{0}' of JSX spread attribute is not assignable to target property." }, - JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property: { code: 2607, category: ts.DiagnosticCategory.Error, key: "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607", message: "JSX element class does not support attributes because it does not have a '{0}' property" }, - The_global_type_JSX_0_may_not_have_more_than_one_property: { code: 2608, category: ts.DiagnosticCategory.Error, key: "The_global_type_JSX_0_may_not_have_more_than_one_property_2608", message: "The global type 'JSX.{0}' may not have more than one property" }, - Cannot_emit_namespaced_JSX_elements_in_React: { code: 2650, category: ts.DiagnosticCategory.Error, key: "Cannot_emit_namespaced_JSX_elements_in_React_2650", message: "Cannot emit namespaced JSX elements in React" }, + JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property: { code: 2607, category: ts.DiagnosticCategory.Error, key: "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607", message: "JSX element class does not support attributes because it does not have a '{0}' property." }, + The_global_type_JSX_0_may_not_have_more_than_one_property: { code: 2608, category: ts.DiagnosticCategory.Error, key: "The_global_type_JSX_0_may_not_have_more_than_one_property_2608", message: "The global type 'JSX.{0}' may not have more than one property." }, + JSX_spread_child_must_be_an_array_type: { code: 2609, category: ts.DiagnosticCategory.Error, key: "JSX_spread_child_must_be_an_array_type_2609", message: "JSX spread child must be an array type." }, + Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: { code: 2649, category: ts.DiagnosticCategory.Error, key: "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", message: "Cannot augment module '{0}' with value exports because it resolves to a non-module entity." }, + Cannot_emit_namespaced_JSX_elements_in_React: { code: 2650, category: ts.DiagnosticCategory.Error, key: "Cannot_emit_namespaced_JSX_elements_in_React_2650", message: "Cannot emit namespaced JSX elements in React." }, A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: { code: 2651, category: ts.DiagnosticCategory.Error, key: "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", message: "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums." }, Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: { code: 2652, category: ts.DiagnosticCategory.Error, key: "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", message: "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead." }, Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1: { code: 2653, category: ts.DiagnosticCategory.Error, key: "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653", message: "Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'." }, Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_package_author_to_update_the_package_definition: { code: 2654, category: ts.DiagnosticCategory.Error, key: "Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_pack_2654", message: "Exported external package typings file cannot contain tripleslash references. Please contact the package author to update the package definition." }, Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition: { code: 2656, category: ts.DiagnosticCategory.Error, key: "Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_2656", message: "Exported external package typings file '{0}' is not a module. Please contact the package author to update the package definition." }, - JSX_expressions_must_have_one_parent_element: { code: 2657, category: ts.DiagnosticCategory.Error, key: "JSX_expressions_must_have_one_parent_element_2657", message: "JSX expressions must have one parent element" }, - Type_0_provides_no_match_for_the_signature_1: { code: 2658, category: ts.DiagnosticCategory.Error, key: "Type_0_provides_no_match_for_the_signature_1_2658", message: "Type '{0}' provides no match for the signature '{1}'" }, + JSX_expressions_must_have_one_parent_element: { code: 2657, category: ts.DiagnosticCategory.Error, key: "JSX_expressions_must_have_one_parent_element_2657", message: "JSX expressions must have one parent element." }, + Type_0_provides_no_match_for_the_signature_1: { code: 2658, category: ts.DiagnosticCategory.Error, key: "Type_0_provides_no_match_for_the_signature_1_2658", message: "Type '{0}' provides no match for the signature '{1}'." }, super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: { code: 2659, category: ts.DiagnosticCategory.Error, key: "super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659", message: "'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher." }, super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: { code: 2660, category: ts.DiagnosticCategory.Error, key: "super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660", message: "'super' can only be referenced in members of derived classes or object literal expressions." }, Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module: { code: 2661, category: ts.DiagnosticCategory.Error, key: "Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661", message: "Cannot export '{0}'. Only local declarations can be exported from a module." }, @@ -4341,7 +4408,6 @@ var ts; All_declarations_of_0_must_have_identical_modifiers: { code: 2687, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_0_must_have_identical_modifiers_2687", message: "All declarations of '{0}' must have identical modifiers." }, Cannot_find_type_definition_file_for_0: { code: 2688, category: ts.DiagnosticCategory.Error, key: "Cannot_find_type_definition_file_for_0_2688", message: "Cannot find type definition file for '{0}'." }, Cannot_extend_an_interface_0_Did_you_mean_implements: { code: 2689, category: ts.DiagnosticCategory.Error, key: "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", message: "Cannot extend an interface '{0}'. Did you mean 'implements'?" }, - A_class_must_be_declared_after_its_base_class: { code: 2690, category: ts.DiagnosticCategory.Error, key: "A_class_must_be_declared_after_its_base_class_2690", message: "A class must be declared after its base class." }, An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: { code: 2691, category: ts.DiagnosticCategory.Error, key: "An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691", message: "An import path cannot end with a '{0}' extension. Consider importing '{1}' instead." }, _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: { code: 2692, category: ts.DiagnosticCategory.Error, key: "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", message: "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible." }, _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: { code: 2693, category: ts.DiagnosticCategory.Error, key: "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", message: "'{0}' only refers to a type, but is being used as a value here." }, @@ -4350,9 +4416,17 @@ var ts; The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead: { code: 2696, category: ts.DiagnosticCategory.Error, key: "The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696", message: "The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?" }, An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: { code: 2697, category: ts.DiagnosticCategory.Error, key: "An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697", message: "An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your `--lib` option." }, Spread_types_may_only_be_created_from_object_types: { code: 2698, category: ts.DiagnosticCategory.Error, key: "Spread_types_may_only_be_created_from_object_types_2698", message: "Spread types may only be created from object types." }, + Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1: { code: 2699, category: ts.DiagnosticCategory.Error, key: "Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699", message: "Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'." }, Rest_types_may_only_be_created_from_object_types: { code: 2700, category: ts.DiagnosticCategory.Error, key: "Rest_types_may_only_be_created_from_object_types_2700", message: "Rest types may only be created from object types." }, The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access: { code: 2701, category: ts.DiagnosticCategory.Error, key: "The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701", message: "The target of an object rest assignment must be a variable or a property access." }, _0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here: { code: 2702, category: ts.DiagnosticCategory.Error, key: "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702", message: "'{0}' only refers to a type, but is being used as a namespace here." }, + The_operand_of_a_delete_operator_must_be_a_property_reference: { code: 2703, category: ts.DiagnosticCategory.Error, key: "The_operand_of_a_delete_operator_must_be_a_property_reference_2703", message: "The operand of a delete operator must be a property reference." }, + The_operand_of_a_delete_operator_cannot_be_a_read_only_property: { code: 2704, category: ts.DiagnosticCategory.Error, key: "The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704", message: "The operand of a delete operator cannot be a read-only property." }, + An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: { code: 2705, category: ts.DiagnosticCategory.Error, key: "An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705", message: "An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option." }, + Required_type_parameters_may_not_follow_optional_type_parameters: { code: 2706, category: ts.DiagnosticCategory.Error, key: "Required_type_parameters_may_not_follow_optional_type_parameters_2706", message: "Required type parameters may not follow optional type parameters." }, + Generic_type_0_requires_between_1_and_2_type_arguments: { code: 2707, category: ts.DiagnosticCategory.Error, key: "Generic_type_0_requires_between_1_and_2_type_arguments_2707", message: "Generic type '{0}' requires between {1} and {2} type arguments." }, + Cannot_use_namespace_0_as_a_value: { code: 2708, category: ts.DiagnosticCategory.Error, key: "Cannot_use_namespace_0_as_a_value_2708", message: "Cannot use namespace '{0}' as a value." }, + Cannot_use_namespace_0_as_a_type: { code: 2709, category: ts.DiagnosticCategory.Error, key: "Cannot_use_namespace_0_as_a_type_2709", message: "Cannot use namespace '{0}' as a type." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "Import_declaration_0_is_using_private_name_1_4000", message: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", message: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", message: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, @@ -4363,8 +4437,8 @@ var ts; Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014", message: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016", message: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: ts.DiagnosticCategory.Error, key: "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019", message: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: ts.DiagnosticCategory.Error, key: "Extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020", message: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: ts.DiagnosticCategory.Error, key: "Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022", message: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, + extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: ts.DiagnosticCategory.Error, key: "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020", message: "'extends' clause of exported class '{0}' has or is using private name '{1}'." }, + extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: ts.DiagnosticCategory.Error, key: "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022", message: "'extends' clause of exported interface '{0}' has or is using private name '{1}'." }, Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: ts.DiagnosticCategory.Error, key: "Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023", message: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: ts.DiagnosticCategory.Error, key: "Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024", message: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: ts.DiagnosticCategory.Error, key: "Exported_variable_0_has_or_is_using_private_name_1_4025", message: "Exported variable '{0}' has or is using private name '{1}'." }, @@ -4425,16 +4499,18 @@ var ts; Default_export_of_the_module_has_or_is_using_private_name_0: { code: 4082, category: ts.DiagnosticCategory.Error, key: "Default_export_of_the_module_has_or_is_using_private_name_0_4082", message: "Default export of the module has or is using private name '{0}'." }, Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: { code: 4083, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", message: "Type parameter '{0}' of exported type alias has or is using private name '{1}'." }, Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: { code: 4090, category: ts.DiagnosticCategory.Message, key: "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", message: "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict." }, + Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4091, category: ts.DiagnosticCategory.Error, key: "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", message: "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4092, category: ts.DiagnosticCategory.Error, key: "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", message: "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'." }, + extends_clause_of_exported_class_0_refers_to_a_type_whose_name_cannot_be_referenced: { code: 4093, category: ts.DiagnosticCategory.Error, key: "extends_clause_of_exported_class_0_refers_to_a_type_whose_name_cannot_be_referenced_4093", message: "'extends' clause of exported class '{0}' refers to a type whose name cannot be referenced." }, The_current_host_does_not_support_the_0_option: { code: 5001, category: ts.DiagnosticCategory.Error, key: "The_current_host_does_not_support_the_0_option_5001", message: "The current host does not support the '{0}' option." }, Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: ts.DiagnosticCategory.Error, key: "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", message: "Cannot find the common subdirectory path for the input files." }, File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: { code: 5010, category: ts.DiagnosticCategory.Error, key: "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", message: "File specification cannot end in a recursive directory wildcard ('**'): '{0}'." }, File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0: { code: 5011, category: ts.DiagnosticCategory.Error, key: "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011", message: "File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'." }, - Cannot_read_file_0_Colon_1: { code: 5012, category: ts.DiagnosticCategory.Error, key: "Cannot_read_file_0_Colon_1_5012", message: "Cannot read file '{0}': {1}" }, - Unsupported_file_encoding: { code: 5013, category: ts.DiagnosticCategory.Error, key: "Unsupported_file_encoding_5013", message: "Unsupported file encoding." }, + Cannot_read_file_0_Colon_1: { code: 5012, category: ts.DiagnosticCategory.Error, key: "Cannot_read_file_0_Colon_1_5012", message: "Cannot read file '{0}': {1}." }, Failed_to_parse_file_0_Colon_1: { code: 5014, category: ts.DiagnosticCategory.Error, key: "Failed_to_parse_file_0_Colon_1_5014", message: "Failed to parse file '{0}': {1}." }, Unknown_compiler_option_0: { code: 5023, category: ts.DiagnosticCategory.Error, key: "Unknown_compiler_option_0_5023", message: "Unknown compiler option '{0}'." }, Compiler_option_0_requires_a_value_of_type_1: { code: 5024, category: ts.DiagnosticCategory.Error, key: "Compiler_option_0_requires_a_value_of_type_1_5024", message: "Compiler option '{0}' requires a value of type {1}." }, - Could_not_write_file_0_Colon_1: { code: 5033, category: ts.DiagnosticCategory.Error, key: "Could_not_write_file_0_Colon_1_5033", message: "Could not write file '{0}': {1}" }, + Could_not_write_file_0_Colon_1: { code: 5033, category: ts.DiagnosticCategory.Error, key: "Could_not_write_file_0_Colon_1_5033", message: "Could not write file '{0}': {1}." }, Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: ts.DiagnosticCategory.Error, key: "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042", message: "Option 'project' cannot be mixed with source files on a command line." }, Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher: { code: 5047, category: ts.DiagnosticCategory.Error, key: "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047", message: "Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher." }, Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: { code: 5051, category: ts.DiagnosticCategory.Error, key: "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051", message: "Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided." }, @@ -4443,12 +4519,12 @@ var ts; A_tsconfig_json_file_is_already_defined_at_Colon_0: { code: 5054, category: ts.DiagnosticCategory.Error, key: "A_tsconfig_json_file_is_already_defined_at_Colon_0_5054", message: "A 'tsconfig.json' file is already defined at: '{0}'." }, Cannot_write_file_0_because_it_would_overwrite_input_file: { code: 5055, category: ts.DiagnosticCategory.Error, key: "Cannot_write_file_0_because_it_would_overwrite_input_file_5055", message: "Cannot write file '{0}' because it would overwrite input file." }, Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files: { code: 5056, category: ts.DiagnosticCategory.Error, key: "Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056", message: "Cannot write file '{0}' because it would be overwritten by multiple input files." }, - Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: { code: 5057, category: ts.DiagnosticCategory.Error, key: "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", message: "Cannot find a tsconfig.json file at the specified directory: '{0}'" }, - The_specified_path_does_not_exist_Colon_0: { code: 5058, category: ts.DiagnosticCategory.Error, key: "The_specified_path_does_not_exist_Colon_0_5058", message: "The specified path does not exist: '{0}'" }, + Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: { code: 5057, category: ts.DiagnosticCategory.Error, key: "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", message: "Cannot find a tsconfig.json file at the specified directory: '{0}'." }, + The_specified_path_does_not_exist_Colon_0: { code: 5058, category: ts.DiagnosticCategory.Error, key: "The_specified_path_does_not_exist_Colon_0_5058", message: "The specified path does not exist: '{0}'." }, Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: { code: 5059, category: ts.DiagnosticCategory.Error, key: "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", message: "Invalid value for '--reactNamespace'. '{0}' is not a valid identifier." }, Option_paths_cannot_be_used_without_specifying_baseUrl_option: { code: 5060, category: ts.DiagnosticCategory.Error, key: "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060", message: "Option 'paths' cannot be used without specifying '--baseUrl' option." }, - Pattern_0_can_have_at_most_one_Asterisk_character: { code: 5061, category: ts.DiagnosticCategory.Error, key: "Pattern_0_can_have_at_most_one_Asterisk_character_5061", message: "Pattern '{0}' can have at most one '*' character" }, - Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character: { code: 5062, category: ts.DiagnosticCategory.Error, key: "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062", message: "Substitution '{0}' in pattern '{1}' in can have at most one '*' character" }, + Pattern_0_can_have_at_most_one_Asterisk_character: { code: 5061, category: ts.DiagnosticCategory.Error, key: "Pattern_0_can_have_at_most_one_Asterisk_character_5061", message: "Pattern '{0}' can have at most one '*' character." }, + Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character: { code: 5062, category: ts.DiagnosticCategory.Error, key: "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062", message: "Substitution '{0}' in pattern '{1}' in can have at most one '*' character." }, Substitutions_for_pattern_0_should_be_an_array: { code: 5063, category: ts.DiagnosticCategory.Error, key: "Substitutions_for_pattern_0_should_be_an_array_5063", message: "Substitutions for pattern '{0}' should be an array." }, Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2: { code: 5064, category: ts.DiagnosticCategory.Error, key: "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064", message: "Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'." }, File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: { code: 5065, category: ts.DiagnosticCategory.Error, key: "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065", message: "File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'." }, @@ -4466,11 +4542,11 @@ var ts; Do_not_emit_outputs: { code: 6010, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_outputs_6010", message: "Do not emit outputs." }, Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: { code: 6011, category: ts.DiagnosticCategory.Message, key: "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", message: "Allow default imports from modules with no default export. This does not affect code emit, just typechecking." }, Skip_type_checking_of_declaration_files: { code: 6012, category: ts.DiagnosticCategory.Message, key: "Skip_type_checking_of_declaration_files_6012", message: "Skip type checking of declaration files." }, - Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015_6015", message: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES2015'" }, - Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015_6016", message: "Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'" }, + Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015", message: "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'." }, + Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015_6016", message: "Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'." }, Print_this_message: { code: 6017, category: ts.DiagnosticCategory.Message, key: "Print_this_message_6017", message: "Print this message." }, Print_the_compiler_s_version: { code: 6019, category: ts.DiagnosticCategory.Message, key: "Print_the_compiler_s_version_6019", message: "Print the compiler's version." }, - Compile_the_project_in_the_given_directory: { code: 6020, category: ts.DiagnosticCategory.Message, key: "Compile_the_project_in_the_given_directory_6020", message: "Compile the project in the given directory." }, + Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json: { code: 6020, category: ts.DiagnosticCategory.Message, key: "Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020", message: "Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'." }, Syntax_Colon_0: { code: 6023, category: ts.DiagnosticCategory.Message, key: "Syntax_Colon_0_6023", message: "Syntax: {0}" }, options: { code: 6024, category: ts.DiagnosticCategory.Message, key: "options_6024", message: "options" }, file: { code: 6025, category: ts.DiagnosticCategory.Message, key: "file_6025", message: "file" }, @@ -4485,11 +4561,12 @@ var ts; LOCATION: { code: 6037, category: ts.DiagnosticCategory.Message, key: "LOCATION_6037", message: "LOCATION" }, DIRECTORY: { code: 6038, category: ts.DiagnosticCategory.Message, key: "DIRECTORY_6038", message: "DIRECTORY" }, STRATEGY: { code: 6039, category: ts.DiagnosticCategory.Message, key: "STRATEGY_6039", message: "STRATEGY" }, + FILE_OR_DIRECTORY: { code: 6040, category: ts.DiagnosticCategory.Message, key: "FILE_OR_DIRECTORY_6040", message: "FILE OR DIRECTORY" }, Compilation_complete_Watching_for_file_changes: { code: 6042, category: ts.DiagnosticCategory.Message, key: "Compilation_complete_Watching_for_file_changes_6042", message: "Compilation complete. Watching for file changes." }, Generates_corresponding_map_file: { code: 6043, category: ts.DiagnosticCategory.Message, key: "Generates_corresponding_map_file_6043", message: "Generates corresponding '.map' file." }, Compiler_option_0_expects_an_argument: { code: 6044, category: ts.DiagnosticCategory.Error, key: "Compiler_option_0_expects_an_argument_6044", message: "Compiler option '{0}' expects an argument." }, Unterminated_quoted_string_in_response_file_0: { code: 6045, category: ts.DiagnosticCategory.Error, key: "Unterminated_quoted_string_in_response_file_0_6045", message: "Unterminated quoted string in response file '{0}'." }, - Argument_for_0_option_must_be_Colon_1: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument_for_0_option_must_be_Colon_1_6046", message: "Argument for '{0}' option must be: {1}" }, + Argument_for_0_option_must_be_Colon_1: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument_for_0_option_must_be_Colon_1_6046", message: "Argument for '{0}' option must be: {1}." }, Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: ts.DiagnosticCategory.Error, key: "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048", message: "Locale must be of the form or -. For example '{0}' or '{1}'." }, Unsupported_locale_0: { code: 6049, category: ts.DiagnosticCategory.Error, key: "Unsupported_locale_0_6049", message: "Unsupported locale '{0}'." }, Unable_to_open_file_0: { code: 6050, category: ts.DiagnosticCategory.Error, key: "Unable_to_open_file_0_6050", message: "Unable to open file '{0}'." }, @@ -4511,17 +4588,18 @@ var ts; Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file: { code: 6070, category: ts.DiagnosticCategory.Message, key: "Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070", message: "Initializes a TypeScript project and creates a tsconfig.json file." }, Successfully_created_a_tsconfig_json_file: { code: 6071, category: ts.DiagnosticCategory.Message, key: "Successfully_created_a_tsconfig_json_file_6071", message: "Successfully created a tsconfig.json file." }, Suppress_excess_property_checks_for_object_literals: { code: 6072, category: ts.DiagnosticCategory.Message, key: "Suppress_excess_property_checks_for_object_literals_6072", message: "Suppress excess property checks for object literals." }, - Stylize_errors_and_messages_using_color_and_context_experimental: { code: 6073, category: ts.DiagnosticCategory.Message, key: "Stylize_errors_and_messages_using_color_and_context_experimental_6073", message: "Stylize errors and messages using color and context. (experimental)" }, + Stylize_errors_and_messages_using_color_and_context_experimental: { code: 6073, category: ts.DiagnosticCategory.Message, key: "Stylize_errors_and_messages_using_color_and_context_experimental_6073", message: "Stylize errors and messages using color and context (experimental)." }, Do_not_report_errors_on_unused_labels: { code: 6074, category: ts.DiagnosticCategory.Message, key: "Do_not_report_errors_on_unused_labels_6074", message: "Do not report errors on unused labels." }, Report_error_when_not_all_code_paths_in_function_return_a_value: { code: 6075, category: ts.DiagnosticCategory.Message, key: "Report_error_when_not_all_code_paths_in_function_return_a_value_6075", message: "Report error when not all code paths in function return a value." }, Report_errors_for_fallthrough_cases_in_switch_statement: { code: 6076, category: ts.DiagnosticCategory.Message, key: "Report_errors_for_fallthrough_cases_in_switch_statement_6076", message: "Report errors for fallthrough cases in switch statement." }, Do_not_report_errors_on_unreachable_code: { code: 6077, category: ts.DiagnosticCategory.Message, key: "Do_not_report_errors_on_unreachable_code_6077", message: "Do not report errors on unreachable code." }, Disallow_inconsistently_cased_references_to_the_same_file: { code: 6078, category: ts.DiagnosticCategory.Message, key: "Disallow_inconsistently_cased_references_to_the_same_file_6078", message: "Disallow inconsistently-cased references to the same file." }, Specify_library_files_to_be_included_in_the_compilation_Colon: { code: 6079, category: ts.DiagnosticCategory.Message, key: "Specify_library_files_to_be_included_in_the_compilation_Colon_6079", message: "Specify library files to be included in the compilation: " }, - Specify_JSX_code_generation_Colon_preserve_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify_JSX_code_generation_Colon_preserve_or_react_6080", message: "Specify JSX code generation: 'preserve' or 'react'" }, + Specify_JSX_code_generation_Colon_preserve_react_native_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080", message: "Specify JSX code generation: 'preserve', 'react-native', or 'react'." }, + File_0_has_an_unsupported_extension_so_skipping_it: { code: 6081, category: ts.DiagnosticCategory.Message, key: "File_0_has_an_unsupported_extension_so_skipping_it_6081", message: "File '{0}' has an unsupported extension, so skipping it." }, Only_amd_and_system_modules_are_supported_alongside_0: { code: 6082, category: ts.DiagnosticCategory.Error, key: "Only_amd_and_system_modules_are_supported_alongside_0_6082", message: "Only 'amd' and 'system' modules are supported alongside --{0}." }, Base_directory_to_resolve_non_absolute_module_names: { code: 6083, category: ts.DiagnosticCategory.Message, key: "Base_directory_to_resolve_non_absolute_module_names_6083", message: "Base directory to resolve non-absolute module names." }, - Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit: { code: 6084, category: ts.DiagnosticCategory.Message, key: "Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit_6084", message: "Specify the object invoked for createElement and __spread when targeting 'react' JSX emit" }, + Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit: { code: 6084, category: ts.DiagnosticCategory.Message, key: "Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084", message: "[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit" }, Enable_tracing_of_the_name_resolution_process: { code: 6085, category: ts.DiagnosticCategory.Message, key: "Enable_tracing_of_the_name_resolution_process_6085", message: "Enable tracing of the name resolution process." }, Resolving_module_0_from_1: { code: 6086, category: ts.DiagnosticCategory.Message, key: "Resolving_module_0_from_1_6086", message: "======== Resolving module '{0}' from '{1}'. ========" }, Explicitly_specified_module_resolution_kind_Colon_0: { code: 6087, category: ts.DiagnosticCategory.Message, key: "Explicitly_specified_module_resolution_kind_Colon_0_6087", message: "Explicitly specified module resolution kind: '{0}'." }, @@ -4532,23 +4610,23 @@ var ts; Module_name_0_matched_pattern_1: { code: 6092, category: ts.DiagnosticCategory.Message, key: "Module_name_0_matched_pattern_1_6092", message: "Module name '{0}', matched pattern '{1}'." }, Trying_substitution_0_candidate_module_location_Colon_1: { code: 6093, category: ts.DiagnosticCategory.Message, key: "Trying_substitution_0_candidate_module_location_Colon_1_6093", message: "Trying substitution '{0}', candidate module location: '{1}'." }, Resolving_module_name_0_relative_to_base_url_1_2: { code: 6094, category: ts.DiagnosticCategory.Message, key: "Resolving_module_name_0_relative_to_base_url_1_2_6094", message: "Resolving module name '{0}' relative to base url '{1}' - '{2}'." }, - Loading_module_as_file_Slash_folder_candidate_module_location_0: { code: 6095, category: ts.DiagnosticCategory.Message, key: "Loading_module_as_file_Slash_folder_candidate_module_location_0_6095", message: "Loading module as file / folder, candidate module location '{0}'." }, + Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1: { code: 6095, category: ts.DiagnosticCategory.Message, key: "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1_6095", message: "Loading module as file / folder, candidate module location '{0}', target file type '{1}'." }, File_0_does_not_exist: { code: 6096, category: ts.DiagnosticCategory.Message, key: "File_0_does_not_exist_6096", message: "File '{0}' does not exist." }, File_0_exist_use_it_as_a_name_resolution_result: { code: 6097, category: ts.DiagnosticCategory.Message, key: "File_0_exist_use_it_as_a_name_resolution_result_6097", message: "File '{0}' exist - use it as a name resolution result." }, - Loading_module_0_from_node_modules_folder: { code: 6098, category: ts.DiagnosticCategory.Message, key: "Loading_module_0_from_node_modules_folder_6098", message: "Loading module '{0}' from 'node_modules' folder." }, + Loading_module_0_from_node_modules_folder_target_file_type_1: { code: 6098, category: ts.DiagnosticCategory.Message, key: "Loading_module_0_from_node_modules_folder_target_file_type_1_6098", message: "Loading module '{0}' from 'node_modules' folder, target file type '{1}'." }, Found_package_json_at_0: { code: 6099, category: ts.DiagnosticCategory.Message, key: "Found_package_json_at_0_6099", message: "Found 'package.json' at '{0}'." }, - package_json_does_not_have_a_types_or_main_field: { code: 6100, category: ts.DiagnosticCategory.Message, key: "package_json_does_not_have_a_types_or_main_field_6100", message: "'package.json' does not have a 'types' or 'main' field." }, + package_json_does_not_have_a_0_field: { code: 6100, category: ts.DiagnosticCategory.Message, key: "package_json_does_not_have_a_0_field_6100", message: "'package.json' does not have a '{0}' field." }, package_json_has_0_field_1_that_references_2: { code: 6101, category: ts.DiagnosticCategory.Message, key: "package_json_has_0_field_1_that_references_2_6101", message: "'package.json' has '{0}' field '{1}' that references '{2}'." }, Allow_javascript_files_to_be_compiled: { code: 6102, category: ts.DiagnosticCategory.Message, key: "Allow_javascript_files_to_be_compiled_6102", message: "Allow javascript files to be compiled." }, Option_0_should_have_array_of_strings_as_a_value: { code: 6103, category: ts.DiagnosticCategory.Error, key: "Option_0_should_have_array_of_strings_as_a_value_6103", message: "Option '{0}' should have array of strings as a value." }, Checking_if_0_is_the_longest_matching_prefix_for_1_2: { code: 6104, category: ts.DiagnosticCategory.Message, key: "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104", message: "Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'." }, Expected_type_of_0_field_in_package_json_to_be_string_got_1: { code: 6105, category: ts.DiagnosticCategory.Message, key: "Expected_type_of_0_field_in_package_json_to_be_string_got_1_6105", message: "Expected type of '{0}' field in 'package.json' to be 'string', got '{1}'." }, - baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1: { code: 6106, category: ts.DiagnosticCategory.Message, key: "baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106", message: "'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'" }, - rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0: { code: 6107, category: ts.DiagnosticCategory.Message, key: "rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107", message: "'rootDirs' option is set, using it to resolve relative module name '{0}'" }, - Longest_matching_prefix_for_0_is_1: { code: 6108, category: ts.DiagnosticCategory.Message, key: "Longest_matching_prefix_for_0_is_1_6108", message: "Longest matching prefix for '{0}' is '{1}'" }, - Loading_0_from_the_root_dir_1_candidate_location_2: { code: 6109, category: ts.DiagnosticCategory.Message, key: "Loading_0_from_the_root_dir_1_candidate_location_2_6109", message: "Loading '{0}' from the root dir '{1}', candidate location '{2}'" }, - Trying_other_entries_in_rootDirs: { code: 6110, category: ts.DiagnosticCategory.Message, key: "Trying_other_entries_in_rootDirs_6110", message: "Trying other entries in 'rootDirs'" }, - Module_resolution_using_rootDirs_has_failed: { code: 6111, category: ts.DiagnosticCategory.Message, key: "Module_resolution_using_rootDirs_has_failed_6111", message: "Module resolution using 'rootDirs' has failed" }, + baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1: { code: 6106, category: ts.DiagnosticCategory.Message, key: "baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106", message: "'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'." }, + rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0: { code: 6107, category: ts.DiagnosticCategory.Message, key: "rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107", message: "'rootDirs' option is set, using it to resolve relative module name '{0}'." }, + Longest_matching_prefix_for_0_is_1: { code: 6108, category: ts.DiagnosticCategory.Message, key: "Longest_matching_prefix_for_0_is_1_6108", message: "Longest matching prefix for '{0}' is '{1}'." }, + Loading_0_from_the_root_dir_1_candidate_location_2: { code: 6109, category: ts.DiagnosticCategory.Message, key: "Loading_0_from_the_root_dir_1_candidate_location_2_6109", message: "Loading '{0}' from the root dir '{1}', candidate location '{2}'." }, + Trying_other_entries_in_rootDirs: { code: 6110, category: ts.DiagnosticCategory.Message, key: "Trying_other_entries_in_rootDirs_6110", message: "Trying other entries in 'rootDirs'." }, + Module_resolution_using_rootDirs_has_failed: { code: 6111, category: ts.DiagnosticCategory.Message, key: "Module_resolution_using_rootDirs_has_failed_6111", message: "Module resolution using 'rootDirs' has failed." }, Do_not_emit_use_strict_directives_in_module_output: { code: 6112, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_use_strict_directives_in_module_output_6112", message: "Do not emit 'use strict' directives in module output." }, Enable_strict_null_checks: { code: 6113, category: ts.DiagnosticCategory.Message, key: "Enable_strict_null_checks_6113", message: "Enable strict null checks." }, Unknown_option_excludes_Did_you_mean_exclude: { code: 6114, category: ts.DiagnosticCategory.Error, key: "Unknown_option_excludes_Did_you_mean_exclude_6114", message: "Unknown option 'excludes'. Did you mean 'exclude'?" }, @@ -4558,32 +4636,67 @@ var ts; Resolving_from_node_modules_folder: { code: 6118, category: ts.DiagnosticCategory.Message, key: "Resolving_from_node_modules_folder_6118", message: "Resolving from node_modules folder..." }, Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2: { code: 6119, category: ts.DiagnosticCategory.Message, key: "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119", message: "======== Type reference directive '{0}' was successfully resolved to '{1}', primary: {2}. ========" }, Type_reference_directive_0_was_not_resolved: { code: 6120, category: ts.DiagnosticCategory.Message, key: "Type_reference_directive_0_was_not_resolved_6120", message: "======== Type reference directive '{0}' was not resolved. ========" }, - Resolving_with_primary_search_path_0: { code: 6121, category: ts.DiagnosticCategory.Message, key: "Resolving_with_primary_search_path_0_6121", message: "Resolving with primary search path '{0}'" }, + Resolving_with_primary_search_path_0: { code: 6121, category: ts.DiagnosticCategory.Message, key: "Resolving_with_primary_search_path_0_6121", message: "Resolving with primary search path '{0}'." }, Root_directory_cannot_be_determined_skipping_primary_search_paths: { code: 6122, category: ts.DiagnosticCategory.Message, key: "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122", message: "Root directory cannot be determined, skipping primary search paths." }, Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set: { code: 6123, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123", message: "======== Resolving type reference directive '{0}', containing file '{1}', root directory not set. ========" }, Type_declaration_files_to_be_included_in_compilation: { code: 6124, category: ts.DiagnosticCategory.Message, key: "Type_declaration_files_to_be_included_in_compilation_6124", message: "Type declaration files to be included in compilation." }, - Looking_up_in_node_modules_folder_initial_location_0: { code: 6125, category: ts.DiagnosticCategory.Message, key: "Looking_up_in_node_modules_folder_initial_location_0_6125", message: "Looking up in 'node_modules' folder, initial location '{0}'" }, + Looking_up_in_node_modules_folder_initial_location_0: { code: 6125, category: ts.DiagnosticCategory.Message, key: "Looking_up_in_node_modules_folder_initial_location_0_6125", message: "Looking up in 'node_modules' folder, initial location '{0}'." }, Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder: { code: 6126, category: ts.DiagnosticCategory.Message, key: "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126", message: "Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder." }, Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1: { code: 6127, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127", message: "======== Resolving type reference directive '{0}', containing file not set, root directory '{1}'. ========" }, Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set: { code: 6128, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128", message: "======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========" }, The_config_file_0_found_doesn_t_contain_any_source_files: { code: 6129, category: ts.DiagnosticCategory.Error, key: "The_config_file_0_found_doesn_t_contain_any_source_files_6129", message: "The config file '{0}' found doesn't contain any source files." }, - Resolving_real_path_for_0_result_1: { code: 6130, category: ts.DiagnosticCategory.Message, key: "Resolving_real_path_for_0_result_1_6130", message: "Resolving real path for '{0}', result '{1}'" }, + Resolving_real_path_for_0_result_1: { code: 6130, category: ts.DiagnosticCategory.Message, key: "Resolving_real_path_for_0_result_1_6130", message: "Resolving real path for '{0}', result '{1}'." }, Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system: { code: 6131, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131", message: "Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'." }, - File_name_0_has_a_1_extension_stripping_it: { code: 6132, category: ts.DiagnosticCategory.Message, key: "File_name_0_has_a_1_extension_stripping_it_6132", message: "File name '{0}' has a '{1}' extension - stripping it" }, + File_name_0_has_a_1_extension_stripping_it: { code: 6132, category: ts.DiagnosticCategory.Message, key: "File_name_0_has_a_1_extension_stripping_it_6132", message: "File name '{0}' has a '{1}' extension - stripping it." }, _0_is_declared_but_never_used: { code: 6133, category: ts.DiagnosticCategory.Error, key: "_0_is_declared_but_never_used_6133", message: "'{0}' is declared but never used." }, Report_errors_on_unused_locals: { code: 6134, category: ts.DiagnosticCategory.Message, key: "Report_errors_on_unused_locals_6134", message: "Report errors on unused locals." }, Report_errors_on_unused_parameters: { code: 6135, category: ts.DiagnosticCategory.Message, key: "Report_errors_on_unused_parameters_6135", message: "Report errors on unused parameters." }, - The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files: { code: 6136, category: ts.DiagnosticCategory.Message, key: "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136", message: "The maximum dependency depth to search under node_modules and load JavaScript files" }, - No_types_specified_in_package_json_so_returning_main_value_of_0: { code: 6137, category: ts.DiagnosticCategory.Message, key: "No_types_specified_in_package_json_so_returning_main_value_of_0_6137", message: "No types specified in 'package.json', so returning 'main' value of '{0}'" }, + The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files: { code: 6136, category: ts.DiagnosticCategory.Message, key: "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136", message: "The maximum dependency depth to search under node_modules and load JavaScript files." }, Property_0_is_declared_but_never_used: { code: 6138, category: ts.DiagnosticCategory.Error, key: "Property_0_is_declared_but_never_used_6138", message: "Property '{0}' is declared but never used." }, Import_emit_helpers_from_tslib: { code: 6139, category: ts.DiagnosticCategory.Message, key: "Import_emit_helpers_from_tslib_6139", message: "Import emit helpers from 'tslib'." }, Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2: { code: 6140, category: ts.DiagnosticCategory.Error, key: "Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140", message: "Auto discovery for typings is enabled in project '{0}'. Running extra resolution pass for module '{1}' using cache location '{2}'." }, - Parse_in_strict_mode_and_emit_use_strict_for_each_source_file: { code: 6141, category: ts.DiagnosticCategory.Message, key: "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141", message: "Parse in strict mode and emit \"use strict\" for each source file" }, + Parse_in_strict_mode_and_emit_use_strict_for_each_source_file: { code: 6141, category: ts.DiagnosticCategory.Message, key: "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141", message: "Parse in strict mode and emit \"use strict\" for each source file." }, Module_0_was_resolved_to_1_but_jsx_is_not_set: { code: 6142, category: ts.DiagnosticCategory.Error, key: "Module_0_was_resolved_to_1_but_jsx_is_not_set_6142", message: "Module '{0}' was resolved to '{1}', but '--jsx' is not set." }, Module_0_was_resolved_to_1_but_allowJs_is_not_set: { code: 6143, category: ts.DiagnosticCategory.Error, key: "Module_0_was_resolved_to_1_but_allowJs_is_not_set_6143", message: "Module '{0}' was resolved to '{1}', but '--allowJs' is not set." }, Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1: { code: 6144, category: ts.DiagnosticCategory.Message, key: "Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144", message: "Module '{0}' was resolved as locally declared ambient module in file '{1}'." }, Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified: { code: 6145, category: ts.DiagnosticCategory.Message, key: "Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified_6145", message: "Module '{0}' was resolved as ambient module declared in '{1}' since this file was not modified." }, Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h: { code: 6146, category: ts.DiagnosticCategory.Message, key: "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146", message: "Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'." }, + Resolution_for_module_0_was_found_in_cache: { code: 6147, category: ts.DiagnosticCategory.Message, key: "Resolution_for_module_0_was_found_in_cache_6147", message: "Resolution for module '{0}' was found in cache." }, + Directory_0_does_not_exist_skipping_all_lookups_in_it: { code: 6148, category: ts.DiagnosticCategory.Message, key: "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148", message: "Directory '{0}' does not exist, skipping all lookups in it." }, + Show_diagnostic_information: { code: 6149, category: ts.DiagnosticCategory.Message, key: "Show_diagnostic_information_6149", message: "Show diagnostic information." }, + Show_verbose_diagnostic_information: { code: 6150, category: ts.DiagnosticCategory.Message, key: "Show_verbose_diagnostic_information_6150", message: "Show verbose diagnostic information." }, + Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file: { code: 6151, category: ts.DiagnosticCategory.Message, key: "Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151", message: "Emit a single file with source maps instead of having a separate file." }, + Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set: { code: 6152, category: ts.DiagnosticCategory.Message, key: "Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152", message: "Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set." }, + Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule: { code: 6153, category: ts.DiagnosticCategory.Message, key: "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153", message: "Transpile each file as a separate module (similar to 'ts.transpileModule')." }, + Print_names_of_generated_files_part_of_the_compilation: { code: 6154, category: ts.DiagnosticCategory.Message, key: "Print_names_of_generated_files_part_of_the_compilation_6154", message: "Print names of generated files part of the compilation." }, + Print_names_of_files_part_of_the_compilation: { code: 6155, category: ts.DiagnosticCategory.Message, key: "Print_names_of_files_part_of_the_compilation_6155", message: "Print names of files part of the compilation." }, + The_locale_used_when_displaying_messages_to_the_user_e_g_en_us: { code: 6156, category: ts.DiagnosticCategory.Message, key: "The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156", message: "The locale used when displaying messages to the user (e.g. 'en-us')" }, + Do_not_generate_custom_helper_functions_like_extends_in_compiled_output: { code: 6157, category: ts.DiagnosticCategory.Message, key: "Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157", message: "Do not generate custom helper functions like '__extends' in compiled output." }, + Do_not_include_the_default_library_file_lib_d_ts: { code: 6158, category: ts.DiagnosticCategory.Message, key: "Do_not_include_the_default_library_file_lib_d_ts_6158", message: "Do not include the default library file (lib.d.ts)." }, + Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files: { code: 6159, category: ts.DiagnosticCategory.Message, key: "Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159", message: "Do not add triple-slash references or imported modules to the list of compiled files." }, + Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files: { code: 6160, category: ts.DiagnosticCategory.Message, key: "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160", message: "[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files." }, + List_of_folders_to_include_type_definitions_from: { code: 6161, category: ts.DiagnosticCategory.Message, key: "List_of_folders_to_include_type_definitions_from_6161", message: "List of folders to include type definitions from." }, + Disable_size_limitations_on_JavaScript_projects: { code: 6162, category: ts.DiagnosticCategory.Message, key: "Disable_size_limitations_on_JavaScript_projects_6162", message: "Disable size limitations on JavaScript projects." }, + The_character_set_of_the_input_files: { code: 6163, category: ts.DiagnosticCategory.Message, key: "The_character_set_of_the_input_files_6163", message: "The character set of the input files." }, + Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files: { code: 6164, category: ts.DiagnosticCategory.Message, key: "Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6164", message: "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files." }, + Do_not_truncate_error_messages: { code: 6165, category: ts.DiagnosticCategory.Message, key: "Do_not_truncate_error_messages_6165", message: "Do not truncate error messages." }, + Output_directory_for_generated_declaration_files: { code: 6166, category: ts.DiagnosticCategory.Message, key: "Output_directory_for_generated_declaration_files_6166", message: "Output directory for generated declaration files." }, + A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl: { code: 6167, category: ts.DiagnosticCategory.Message, key: "A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167", message: "A series of entries which re-map imports to lookup locations relative to the 'baseUrl'." }, + List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime: { code: 6168, category: ts.DiagnosticCategory.Message, key: "List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168", message: "List of root folders whose combined content represents the structure of the project at runtime." }, + Show_all_compiler_options: { code: 6169, category: ts.DiagnosticCategory.Message, key: "Show_all_compiler_options_6169", message: "Show all compiler options." }, + Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file: { code: 6170, category: ts.DiagnosticCategory.Message, key: "Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170", message: "[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file" }, + Command_line_Options: { code: 6171, category: ts.DiagnosticCategory.Message, key: "Command_line_Options_6171", message: "Command-line Options" }, + Basic_Options: { code: 6172, category: ts.DiagnosticCategory.Message, key: "Basic_Options_6172", message: "Basic Options" }, + Strict_Type_Checking_Options: { code: 6173, category: ts.DiagnosticCategory.Message, key: "Strict_Type_Checking_Options_6173", message: "Strict Type-Checking Options" }, + Module_Resolution_Options: { code: 6174, category: ts.DiagnosticCategory.Message, key: "Module_Resolution_Options_6174", message: "Module Resolution Options" }, + Source_Map_Options: { code: 6175, category: ts.DiagnosticCategory.Message, key: "Source_Map_Options_6175", message: "Source Map Options" }, + Additional_Checks: { code: 6176, category: ts.DiagnosticCategory.Message, key: "Additional_Checks_6176", message: "Additional Checks" }, + Experimental_Options: { code: 6177, category: ts.DiagnosticCategory.Message, key: "Experimental_Options_6177", message: "Experimental Options" }, + Advanced_Options: { code: 6178, category: ts.DiagnosticCategory.Message, key: "Advanced_Options_6178", message: "Advanced Options" }, + Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3: { code: 6179, category: ts.DiagnosticCategory.Message, key: "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179", message: "Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'." }, + Enable_all_strict_type_checking_options: { code: 6180, category: ts.DiagnosticCategory.Message, key: "Enable_all_strict_type_checking_options_6180", message: "Enable all strict type-checking options." }, + List_of_language_service_plugins: { code: 6181, category: ts.DiagnosticCategory.Message, key: "List_of_language_service_plugins_6181", message: "List of language service plugins." }, + Scoped_package_detected_looking_in_0: { code: 6182, category: ts.DiagnosticCategory.Message, key: "Scoped_package_detected_looking_in_0_6182", message: "Scoped package detected, looking in '{0}'" }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_an_1_type_7005", message: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter_0_implicitly_has_an_1_type_7006", message: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member_0_implicitly_has_an_1_type_7008", message: "Member '{0}' implicitly has an '{1}' type." }, @@ -4601,7 +4714,7 @@ var ts; _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7023, category: ts.DiagnosticCategory.Error, key: "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023", message: "'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7024, category: ts.DiagnosticCategory.Error, key: "Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024", message: "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type: { code: 7025, category: ts.DiagnosticCategory.Error, key: "Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_typ_7025", message: "Generator implicitly has type '{0}' because it does not yield any values. Consider supplying a return type." }, - JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: { code: 7026, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026", message: "JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists" }, + JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: { code: 7026, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026", message: "JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists." }, Unreachable_code_detected: { code: 7027, category: ts.DiagnosticCategory.Error, key: "Unreachable_code_detected_7027", message: "Unreachable code detected." }, Unused_label: { code: 7028, category: ts.DiagnosticCategory.Error, key: "Unused_label_7028", message: "Unused label." }, Fallthrough_case_in_switch: { code: 7029, category: ts.DiagnosticCategory.Error, key: "Fallthrough_case_in_switch_7029", message: "Fallthrough case in switch." }, @@ -4625,7 +4738,7 @@ var ts; parameter_modifiers_can_only_be_used_in_a_ts_file: { code: 8012, category: ts.DiagnosticCategory.Error, key: "parameter_modifiers_can_only_be_used_in_a_ts_file_8012", message: "'parameter modifiers' can only be used in a .ts file." }, enum_declarations_can_only_be_used_in_a_ts_file: { code: 8015, category: ts.DiagnosticCategory.Error, key: "enum_declarations_can_only_be_used_in_a_ts_file_8015", message: "'enum declarations' can only be used in a .ts file." }, type_assertion_expressions_can_only_be_used_in_a_ts_file: { code: 8016, category: ts.DiagnosticCategory.Error, key: "type_assertion_expressions_can_only_be_used_in_a_ts_file_8016", message: "'type assertion expressions' can only be used in a .ts file." }, - Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses: { code: 9002, category: ts.DiagnosticCategory.Error, key: "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002", message: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses." }, + Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clause: { code: 9002, category: ts.DiagnosticCategory.Error, key: "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002", message: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clause." }, class_expressions_are_not_currently_supported: { code: 9003, category: ts.DiagnosticCategory.Error, key: "class_expressions_are_not_currently_supported_9003", message: "'class' expressions are not currently supported." }, Language_service_is_disabled: { code: 9004, category: ts.DiagnosticCategory.Error, key: "Language_service_is_disabled_9004", message: "Language service is disabled." }, JSX_attributes_must_only_be_assigned_a_non_empty_expression: { code: 17000, category: ts.DiagnosticCategory.Error, key: "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", message: "JSX attributes must only be assigned a non-empty 'expression'." }, @@ -4633,28 +4746,40 @@ var ts; Expected_corresponding_JSX_closing_tag_for_0: { code: 17002, category: ts.DiagnosticCategory.Error, key: "Expected_corresponding_JSX_closing_tag_for_0_17002", message: "Expected corresponding JSX closing tag for '{0}'." }, JSX_attribute_expected: { code: 17003, category: ts.DiagnosticCategory.Error, key: "JSX_attribute_expected_17003", message: "JSX attribute expected." }, Cannot_use_JSX_unless_the_jsx_flag_is_provided: { code: 17004, category: ts.DiagnosticCategory.Error, key: "Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004", message: "Cannot use JSX unless the '--jsx' flag is provided." }, - A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: ts.DiagnosticCategory.Error, key: "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005", message: "A constructor cannot contain a 'super' call when its class extends 'null'" }, + A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: ts.DiagnosticCategory.Error, key: "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005", message: "A constructor cannot contain a 'super' call when its class extends 'null'." }, An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17006, category: ts.DiagnosticCategory.Error, key: "An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006", message: "An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17007, category: ts.DiagnosticCategory.Error, key: "A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007", message: "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, JSX_element_0_has_no_corresponding_closing_tag: { code: 17008, category: ts.DiagnosticCategory.Error, key: "JSX_element_0_has_no_corresponding_closing_tag_17008", message: "JSX element '{0}' has no corresponding closing tag." }, super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class: { code: 17009, category: ts.DiagnosticCategory.Error, key: "super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009", message: "'super' must be called before accessing 'this' in the constructor of a derived class." }, Unknown_type_acquisition_option_0: { code: 17010, category: ts.DiagnosticCategory.Error, key: "Unknown_type_acquisition_option_0_17010", message: "Unknown type acquisition option '{0}'." }, + super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class: { code: 17011, category: ts.DiagnosticCategory.Error, key: "super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011", message: "'super' must be called before accessing a property of 'super' in the constructor of a derived class." }, + _0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2: { code: 17012, category: ts.DiagnosticCategory.Error, key: "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012", message: "'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?" }, + Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor: { code: 17013, category: ts.DiagnosticCategory.Error, key: "Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013", message: "Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor." }, Circularity_detected_while_resolving_configuration_Colon_0: { code: 18000, category: ts.DiagnosticCategory.Error, key: "Circularity_detected_while_resolving_configuration_Colon_0_18000", message: "Circularity detected while resolving configuration: {0}" }, A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not: { code: 18001, category: ts.DiagnosticCategory.Error, key: "A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not_18001", message: "A path in an 'extends' option must be relative or rooted, but '{0}' is not." }, The_files_list_in_config_file_0_is_empty: { code: 18002, category: ts.DiagnosticCategory.Error, key: "The_files_list_in_config_file_0_is_empty_18002", message: "The 'files' list in config file '{0}' is empty." }, No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2: { code: 18003, category: ts.DiagnosticCategory.Error, key: "No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003", message: "No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'." }, Add_missing_super_call: { code: 90001, category: ts.DiagnosticCategory.Message, key: "Add_missing_super_call_90001", message: "Add missing 'super()' call." }, Make_super_call_the_first_statement_in_the_constructor: { code: 90002, category: ts.DiagnosticCategory.Message, key: "Make_super_call_the_first_statement_in_the_constructor_90002", message: "Make 'super()' call the first statement in the constructor." }, - Change_extends_to_implements: { code: 90003, category: ts.DiagnosticCategory.Message, key: "Change_extends_to_implements_90003", message: "Change 'extends' to 'implements'" }, - Remove_unused_identifiers: { code: 90004, category: ts.DiagnosticCategory.Message, key: "Remove_unused_identifiers_90004", message: "Remove unused identifiers" }, - Implement_interface_on_reference: { code: 90005, category: ts.DiagnosticCategory.Message, key: "Implement_interface_on_reference_90005", message: "Implement interface on reference" }, - Implement_interface_on_class: { code: 90006, category: ts.DiagnosticCategory.Message, key: "Implement_interface_on_class_90006", message: "Implement interface on class" }, - Implement_inherited_abstract_class: { code: 90007, category: ts.DiagnosticCategory.Message, key: "Implement_inherited_abstract_class_90007", message: "Implement inherited abstract class" }, - Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: { code: 90009, category: ts.DiagnosticCategory.Error, key: "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009", message: "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig" }, + Change_extends_to_implements: { code: 90003, category: ts.DiagnosticCategory.Message, key: "Change_extends_to_implements_90003", message: "Change 'extends' to 'implements'." }, + Remove_declaration_for_Colon_0: { code: 90004, category: ts.DiagnosticCategory.Message, key: "Remove_declaration_for_Colon_0_90004", message: "Remove declaration for: '{0}'." }, + Implement_interface_0: { code: 90006, category: ts.DiagnosticCategory.Message, key: "Implement_interface_0_90006", message: "Implement interface '{0}'." }, + Implement_inherited_abstract_class: { code: 90007, category: ts.DiagnosticCategory.Message, key: "Implement_inherited_abstract_class_90007", message: "Implement inherited abstract class." }, + Add_this_to_unresolved_variable: { code: 90008, category: ts.DiagnosticCategory.Message, key: "Add_this_to_unresolved_variable_90008", message: "Add 'this.' to unresolved variable." }, + Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: { code: 90009, category: ts.DiagnosticCategory.Error, key: "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009", message: "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig." }, Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: { code: 90010, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010", message: "Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated." }, - Import_0_from_1: { code: 90013, category: ts.DiagnosticCategory.Message, key: "Import_0_from_1_90013", message: "Import {0} from {1}" }, - Change_0_to_1: { code: 90014, category: ts.DiagnosticCategory.Message, key: "Change_0_to_1_90014", message: "Change {0} to {1}" }, - Add_0_to_existing_import_declaration_from_1: { code: 90015, category: ts.DiagnosticCategory.Message, key: "Add_0_to_existing_import_declaration_from_1_90015", message: "Add {0} to existing import declaration from {1}" }, + Import_0_from_1: { code: 90013, category: ts.DiagnosticCategory.Message, key: "Import_0_from_1_90013", message: "Import {0} from {1}." }, + Change_0_to_1: { code: 90014, category: ts.DiagnosticCategory.Message, key: "Change_0_to_1_90014", message: "Change {0} to {1}." }, + Add_0_to_existing_import_declaration_from_1: { code: 90015, category: ts.DiagnosticCategory.Message, key: "Add_0_to_existing_import_declaration_from_1_90015", message: "Add {0} to existing import declaration from {1}." }, + Add_declaration_for_missing_property_0: { code: 90016, category: ts.DiagnosticCategory.Message, key: "Add_declaration_for_missing_property_0_90016", message: "Add declaration for missing property '{0}'." }, + Add_index_signature_for_missing_property_0: { code: 90017, category: ts.DiagnosticCategory.Message, key: "Add_index_signature_for_missing_property_0_90017", message: "Add index signature for missing property '{0}'." }, + Disable_checking_for_this_file: { code: 90018, category: ts.DiagnosticCategory.Message, key: "Disable_checking_for_this_file_90018", message: "Disable checking for this file." }, + Ignore_this_error_message: { code: 90019, category: ts.DiagnosticCategory.Message, key: "Ignore_this_error_message_90019", message: "Ignore this error message." }, + Initialize_property_0_in_the_constructor: { code: 90020, category: ts.DiagnosticCategory.Message, key: "Initialize_property_0_in_the_constructor_90020", message: "Initialize property '{0}' in the constructor." }, + Initialize_static_property_0: { code: 90021, category: ts.DiagnosticCategory.Message, key: "Initialize_static_property_0_90021", message: "Initialize static property '{0}'." }, + Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0: { code: 8017, category: ts.DiagnosticCategory.Error, key: "Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0_8017", message: "Octal literal types must use ES2015 syntax. Use the syntax '{0}'." }, + Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0: { code: 8018, category: ts.DiagnosticCategory.Error, key: "Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0_8018", message: "Octal literals are not allowed in enums members initializer. Use the syntax '{0}'." }, + Report_errors_in_js_files: { code: 8019, category: ts.DiagnosticCategory.Message, key: "Report_errors_in_js_files_8019", message: "Report errors in .js files." }, }; })(ts || (ts = {})); /// @@ -4666,7 +4791,7 @@ var ts; return token >= 70 /* Identifier */; } ts.tokenIsIdentifierOrKeyword = tokenIsIdentifierOrKeyword; - var textToToken = ts.createMap({ + var textToToken = ts.createMapFromTemplate({ "abstract": 116 /* AbstractKeyword */, "any": 118 /* AnyKeyword */, "as": 117 /* AsKeyword */, @@ -4690,7 +4815,7 @@ var ts; "false": 85 /* FalseKeyword */, "finally": 86 /* FinallyKeyword */, "for": 87 /* ForKeyword */, - "from": 138 /* FromKeyword */, + "from": 139 /* FromKeyword */, "function": 88 /* FunctionKeyword */, "get": 124 /* GetKeyword */, "if": 89 /* IfKeyword */, @@ -4708,27 +4833,28 @@ var ts; "new": 93 /* NewKeyword */, "null": 94 /* NullKeyword */, "number": 132 /* NumberKeyword */, + "object": 133 /* ObjectKeyword */, "package": 110 /* PackageKeyword */, "private": 111 /* PrivateKeyword */, "protected": 112 /* ProtectedKeyword */, "public": 113 /* PublicKeyword */, "readonly": 130 /* ReadonlyKeyword */, "require": 131 /* RequireKeyword */, - "global": 139 /* GlobalKeyword */, + "global": 140 /* GlobalKeyword */, "return": 95 /* ReturnKeyword */, - "set": 133 /* SetKeyword */, + "set": 134 /* SetKeyword */, "static": 114 /* StaticKeyword */, - "string": 134 /* StringKeyword */, + "string": 135 /* StringKeyword */, "super": 96 /* SuperKeyword */, "switch": 97 /* SwitchKeyword */, - "symbol": 135 /* SymbolKeyword */, + "symbol": 136 /* SymbolKeyword */, "this": 98 /* ThisKeyword */, "throw": 99 /* ThrowKeyword */, "true": 100 /* TrueKeyword */, "try": 101 /* TryKeyword */, - "type": 136 /* TypeKeyword */, + "type": 137 /* TypeKeyword */, "typeof": 102 /* TypeOfKeyword */, - "undefined": 137 /* UndefinedKeyword */, + "undefined": 138 /* UndefinedKeyword */, "var": 103 /* VarKeyword */, "void": 104 /* VoidKeyword */, "while": 105 /* WhileKeyword */, @@ -4736,7 +4862,7 @@ var ts; "yield": 115 /* YieldKeyword */, "async": 119 /* AsyncKeyword */, "await": 120 /* AwaitKeyword */, - "of": 140 /* OfKeyword */, + "of": 141 /* OfKeyword */, "{": 16 /* OpenBraceToken */, "}": 17 /* CloseBraceToken */, "(": 18 /* OpenParenToken */, @@ -4876,9 +5002,9 @@ var ts; } function makeReverseMap(source) { var result = []; - for (var name_4 in source) { - result[source[name_4]] = name_4; - } + source.forEach(function (value, name) { + result[value] = name; + }); return result; } var tokenStrings = makeReverseMap(textToToken); @@ -4888,7 +5014,7 @@ var ts; ts.tokenToString = tokenToString; /* @internal */ function stringToToken(s) { - return textToToken[s]; + return textToToken.get(s); } ts.stringToToken = stringToToken; /* @internal */ @@ -4904,6 +5030,7 @@ var ts; if (text.charCodeAt(pos) === 10 /* lineFeed */) { pos++; } + // falls through case 10 /* lineFeed */: result.push(lineStart); lineStart = pos; @@ -4962,7 +5089,6 @@ var ts; return computeLineAndCharacterOfPosition(getLineStarts(sourceFile), position); } ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; - var hasOwnProperty = Object.prototype.hasOwnProperty; function isWhiteSpace(ch) { return isWhiteSpaceSingleLine(ch) || isLineBreak(ch); } @@ -5049,6 +5175,7 @@ var ts; if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) { pos++; } + // falls through case 10 /* lineFeed */: pos++; if (stopAfterLineBreak) { @@ -5121,7 +5248,7 @@ var ts; if (pos === 0 || isLineBreak(text.charCodeAt(pos - 1))) { var ch = text.charCodeAt(pos); if ((pos + mergeConflictMarkerLength) < text.length) { - for (var i = 0, n = mergeConflictMarkerLength; i < n; i++) { + for (var i = 0; i < mergeConflictMarkerLength; i++) { if (text.charCodeAt(pos + i) !== ch) { return false; } @@ -5203,6 +5330,7 @@ var ts; if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) { pos++; } + // falls through case 10 /* lineFeed */: pos++; if (trailing) { @@ -5298,15 +5426,15 @@ var ts; if (!comments) { comments = []; } - comments.push({ pos: pos, end: end, hasTrailingNewLine: hasTrailingNewLine, kind: kind }); + comments.push({ kind: kind, pos: pos, end: end, hasTrailingNewLine: hasTrailingNewLine }); return comments; } function getLeadingCommentRanges(text, pos) { - return reduceEachLeadingCommentRange(text, pos, appendCommentRange, undefined, undefined); + return reduceEachLeadingCommentRange(text, pos, appendCommentRange, /*state*/ undefined, /*initial*/ undefined); } ts.getLeadingCommentRanges = getLeadingCommentRanges; function getTrailingCommentRanges(text, pos) { - return reduceEachTrailingCommentRange(text, pos, appendCommentRange, undefined, undefined); + return reduceEachTrailingCommentRange(text, pos, appendCommentRange, /*state*/ undefined, /*initial*/ undefined); } ts.getTrailingCommentRanges = getTrailingCommentRanges; /** Optionally, get the shebang */ @@ -5333,7 +5461,7 @@ var ts; if (!isIdentifierStart(name.charCodeAt(0), languageVersion)) { return false; } - for (var i = 1, n = name.length; i < n; i++) { + for (var i = 1; i < name.length; i++) { if (!isIdentifierPart(name.charCodeAt(i), languageVersion)) { return false; } @@ -5357,6 +5485,7 @@ var ts; var precedingLineBreak; var hasExtendedUnicodeEscape; var tokenIsUnterminated; + var numericLiteralFlags; setText(text, start, length); return { getStartPos: function () { return startPos; }, @@ -5370,6 +5499,7 @@ var ts; isIdentifier: function () { return token === 70 /* Identifier */ || token > 106 /* LastReservedWord */; }, isReservedWord: function () { return token >= 71 /* FirstReservedWord */ && token <= 106 /* LastReservedWord */; }, isUnterminated: function () { return tokenIsUnterminated; }, + getNumericLiteralFlags: function () { return numericLiteralFlags; }, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, reScanTemplateToken: reScanTemplateToken, @@ -5406,6 +5536,7 @@ var ts; var end = pos; if (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */) { pos++; + numericLiteralFlags = 2 /* Scientific */; if (text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) pos++; if (isDigit(text.charCodeAt(pos))) { @@ -5604,7 +5735,7 @@ var ts; if (pos < end && text.charCodeAt(pos) === 10 /* lineFeed */) { pos++; } - // fall through + // falls through case 10 /* lineFeed */: case 8232 /* lineSeparator */: case 8233 /* paragraphSeparator */: @@ -5705,8 +5836,11 @@ var ts; var len = tokenValue.length; if (len >= 2 && len <= 11) { var ch = tokenValue.charCodeAt(0); - if (ch >= 97 /* a */ && ch <= 122 /* z */ && hasOwnProperty.call(textToToken, tokenValue)) { - return token = textToToken[tokenValue]; + if (ch >= 97 /* a */ && ch <= 122 /* z */) { + token = textToToken.get(tokenValue); + if (token !== undefined) { + return token; + } } } return token = 70 /* Identifier */; @@ -5738,6 +5872,7 @@ var ts; hasExtendedUnicodeEscape = false; precedingLineBreak = false; tokenIsUnterminated = false; + numericLiteralFlags = 0; while (true) { tokenPos = pos; if (pos >= end) { @@ -5923,6 +6058,7 @@ var ts; value = 0; } tokenValue = "" + value; + numericLiteralFlags = 8 /* HexSpecifier */; return token = 8 /* NumericLiteral */; } else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 66 /* B */ || text.charCodeAt(pos + 1) === 98 /* b */)) { @@ -5933,6 +6069,7 @@ var ts; value = 0; } tokenValue = "" + value; + numericLiteralFlags = 16 /* BinarySpecifier */; return token = 8 /* NumericLiteral */; } else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 79 /* O */ || text.charCodeAt(pos + 1) === 111 /* o */)) { @@ -5943,16 +6080,19 @@ var ts; value = 0; } tokenValue = "" + value; + numericLiteralFlags = 32 /* OctalSpecifier */; return token = 8 /* NumericLiteral */; } // Try to parse as an octal if (pos + 1 < end && isOctalDigit(text.charCodeAt(pos + 1))) { tokenValue = "" + scanOctalDigits(); + numericLiteralFlags = 4 /* Octal */; return token = 8 /* NumericLiteral */; } // This fall-through is a deviation from the EcmaScript grammar. The grammar says that a leading zero // can only be followed by an octal digit, a dot, or the end of the number literal. However, we are being // permissive and allowing decimal digits of the form 08* and 09* (which many browsers also do). + // falls through case 49 /* _1 */: case 50 /* _2 */: case 51 /* _3 */: @@ -6206,7 +6346,14 @@ var ts; while (pos < end) { pos++; char = text.charCodeAt(pos); - if ((char === 123 /* openBrace */) || (char === 60 /* lessThan */)) { + if (char === 123 /* openBrace */) { + break; + } + if (char === 60 /* lessThan */) { + if (isConflictMarkerTrivia(text, pos)) { + pos = scanConflictMarkerTrivia(text, pos, error); + return token = 7 /* ConflictMarkerTrivia */; + } break; } } @@ -6399,6 +6546,19 @@ var ts; return undefined; } ts.getDeclarationOfKind = getDeclarationOfKind; + function findDeclaration(symbol, predicate) { + var declarations = symbol.declarations; + if (declarations) { + for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { + var declaration = declarations_2[_i]; + if (predicate(declaration)) { + return declaration; + } + } + } + return undefined; + } + ts.findDeclaration = findDeclaration; // Pool writers to avoid needing to allocate them for every symbol we write. var stringWriters = []; function getSingleLineStringWriter() { @@ -6413,6 +6573,7 @@ var ts; writeSpace: writeText, writeStringLiteral: writeText, writeParameter: writeText, + writeProperty: writeText, writeSymbol: writeText, // Completely ignore indentation for string writers. And map newlines to // a single space. @@ -6421,7 +6582,8 @@ var ts; decreaseIndent: ts.noop, clear: function () { return str_1 = ""; }, trackSymbol: ts.noop, - reportInaccessibleThisError: ts.noop + reportInaccessibleThisError: ts.noop, + reportIllegalExtends: ts.noop }; } return stringWriters.pop(); @@ -6437,25 +6599,25 @@ var ts; } ts.getFullWidth = getFullWidth; function hasResolvedModule(sourceFile, moduleNameText) { - return !!(sourceFile && sourceFile.resolvedModules && sourceFile.resolvedModules[moduleNameText]); + return !!(sourceFile && sourceFile.resolvedModules && sourceFile.resolvedModules.get(moduleNameText)); } ts.hasResolvedModule = hasResolvedModule; function getResolvedModule(sourceFile, moduleNameText) { - return hasResolvedModule(sourceFile, moduleNameText) ? sourceFile.resolvedModules[moduleNameText] : undefined; + return hasResolvedModule(sourceFile, moduleNameText) ? sourceFile.resolvedModules.get(moduleNameText) : undefined; } ts.getResolvedModule = getResolvedModule; function setResolvedModule(sourceFile, moduleNameText, resolvedModule) { if (!sourceFile.resolvedModules) { sourceFile.resolvedModules = ts.createMap(); } - sourceFile.resolvedModules[moduleNameText] = resolvedModule; + sourceFile.resolvedModules.set(moduleNameText, resolvedModule); } ts.setResolvedModule = setResolvedModule; function setResolvedTypeReferenceDirective(sourceFile, typeReferenceDirectiveName, resolvedTypeReferenceDirective) { if (!sourceFile.resolvedTypeReferenceDirectiveNames) { sourceFile.resolvedTypeReferenceDirectiveNames = ts.createMap(); } - sourceFile.resolvedTypeReferenceDirectiveNames[typeReferenceDirectiveName] = resolvedTypeReferenceDirective; + sourceFile.resolvedTypeReferenceDirectiveNames.set(typeReferenceDirectiveName, resolvedTypeReferenceDirective); } ts.setResolvedTypeReferenceDirective = setResolvedTypeReferenceDirective; /* @internal */ @@ -6477,7 +6639,7 @@ var ts; } for (var i = 0; i < names.length; i++) { var newResolution = newResolutions[i]; - var oldResolution = oldResolutions && oldResolutions[names[i]]; + var oldResolution = oldResolutions && oldResolutions.get(names[i]); var changed = oldResolution ? !newResolution || !comparer(oldResolution, newResolution) : newResolution; @@ -6491,28 +6653,28 @@ var ts; // Returns true if this node contains a parse error anywhere underneath it. function containsParseError(node) { aggregateChildData(node); - return (node.flags & 4194304 /* ThisNodeOrAnySubNodesHasError */) !== 0; + return (node.flags & 131072 /* ThisNodeOrAnySubNodesHasError */) !== 0; } ts.containsParseError = containsParseError; function aggregateChildData(node) { - if (!(node.flags & 8388608 /* HasAggregatedChildData */)) { + if (!(node.flags & 262144 /* HasAggregatedChildData */)) { // A node is considered to contain a parse error if: // a) the parser explicitly marked that it had an error // b) any of it's children reported that it had an error. - var thisNodeOrAnySubNodesHasError = ((node.flags & 1048576 /* ThisNodeHasError */) !== 0) || + var thisNodeOrAnySubNodesHasError = ((node.flags & 32768 /* ThisNodeHasError */) !== 0) || ts.forEachChild(node, containsParseError); // If so, mark ourselves accordingly. if (thisNodeOrAnySubNodesHasError) { - node.flags |= 4194304 /* ThisNodeOrAnySubNodesHasError */; + node.flags |= 131072 /* ThisNodeOrAnySubNodesHasError */; } // Also mark that we've propagated the child information to this node. This way we can // always consult the bit directly on this node without needing to check its children // again. - node.flags |= 8388608 /* HasAggregatedChildData */; + node.flags |= 262144 /* HasAggregatedChildData */; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 261 /* SourceFile */) { + while (node && node.kind !== 264 /* SourceFile */) { node = node.parent; } return node; @@ -6520,11 +6682,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 204 /* Block */: - case 232 /* CaseBlock */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: + case 206 /* Block */: + case 234 /* CaseBlock */: + case 213 /* ForStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: return true; } return false; @@ -6599,6 +6761,10 @@ var ts; return !nodeIsMissing(node); } ts.nodeIsPresent = nodeIsPresent; + function isToken(n) { + return n.kind >= 0 /* FirstToken */ && n.kind <= 141 /* LastToken */; + } + ts.isToken = isToken; function getTokenPosOfNode(node, sourceFile, includeJsDoc) { // With nodes that have no width (i.e. 'Missing' nodes), we actually *don't* // want to skip trivia because this will launch us forward to the next token. @@ -6615,18 +6781,18 @@ var ts; // the syntax list itself considers them as normal trivia. Therefore if we simply skip // trivia for the list, we may have skipped the JSDocComment as well. So we should process its // first child to determine the actual position of its first token. - if (node.kind === 292 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 293 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); } ts.getTokenPosOfNode = getTokenPosOfNode; function isJSDocNode(node) { - return node.kind >= 262 /* FirstJSDocNode */ && node.kind <= 288 /* LastJSDocNode */; + return node.kind >= 266 /* FirstJSDocNode */ && node.kind <= 292 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; function isJSDocTag(node) { - return node.kind >= 278 /* FirstJSDocTagNode */ && node.kind <= 291 /* LastJSDocTagNode */; + return node.kind >= 282 /* FirstJSDocTagNode */ && node.kind <= 292 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function getNonDecoratorTokenPosOfNode(node, sourceFile) { @@ -6657,20 +6823,11 @@ var ts; return getSourceTextOfNodeFromSourceFile(getSourceFileOfNode(node), node, includeTrivia); } ts.getTextOfNode = getTextOfNode; - function getLiteralText(node, sourceFile, languageVersion) { - // Any template literal or string literal with an extended escape - // (e.g. "\u{0067}") will need to be downleveled as a escaped string literal. - if (languageVersion < 2 /* ES2015 */ && (isTemplateLiteralKind(node.kind) || node.hasExtendedUnicodeEscape)) { - return getQuotedEscapedLiteralText('"', node.text, '"'); - } + function getLiteralText(node, sourceFile) { // If we don't need to downlevel and we can reach the original source text using // the node's parent reference, then simply get the text as it was originally written. if (!nodeIsSynthesized(node) && node.parent) { - var text = getSourceTextOfNodeFromSourceFile(sourceFile, node); - if (languageVersion < 2 /* ES2015 */ && isBinaryOrOctalIntegerLiteral(node, text)) { - return node.text; - } - return text; + return getSourceTextOfNodeFromSourceFile(sourceFile, node); } // If we can't reach the original source text, use the canonical form if it's a number, // or an escaped quoted form of the original text if it's string-like. @@ -6691,19 +6848,6 @@ var ts; ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for."); } ts.getLiteralText = getLiteralText; - function isBinaryOrOctalIntegerLiteral(node, text) { - if (node.kind === 8 /* NumericLiteral */ && text.length > 1) { - switch (text.charCodeAt(1)) { - case 98 /* b */: - case 66 /* B */: - case 111 /* o */: - case 79 /* O */: - return true; - } - } - return false; - } - ts.isBinaryOrOctalIntegerLiteral = isBinaryOrOctalIntegerLiteral; function getQuotedEscapedLiteralText(leftQuote, text, rightQuote) { return leftQuote + escapeNonAsciiCharacters(escapeString(text)) + rightQuote; } @@ -6712,11 +6856,6 @@ var ts; return identifier.length >= 2 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ ? "_" + identifier : identifier; } ts.escapeIdentifier = escapeIdentifier; - // Remove extra underscore from escaped identifier - function unescapeIdentifier(identifier) { - return identifier.length >= 3 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ && identifier.charCodeAt(2) === 95 /* _ */ ? identifier.substr(1) : identifier; - } - ts.unescapeIdentifier = unescapeIdentifier; // Make an identifier from an external module name by extracting the string after the last "/" and replacing // all non-alphanumeric characters with underscores function makeIdentifierFromModuleName(moduleName) { @@ -6730,26 +6869,26 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 223 /* VariableDeclaration */ && node.parent.kind === 256 /* CatchClause */; + return node.kind === 225 /* VariableDeclaration */ && node.parent.kind === 259 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { - return node && node.kind === 230 /* ModuleDeclaration */ && + return node && node.kind === 232 /* ModuleDeclaration */ && (node.name.kind === 9 /* StringLiteral */ || isGlobalScopeAugmentation(node)); } ts.isAmbientModule = isAmbientModule; - /** Given a symbol for a module, checks that it is either an untyped import or a shorthand ambient module. */ + /** Given a symbol for a module, checks that it is a shorthand ambient module. */ function isShorthandAmbientModuleSymbol(moduleSymbol) { return isShorthandAmbientModule(moduleSymbol.valueDeclaration); } ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { // The only kind of module that can be missing a body is a shorthand ambient module. - return node.kind === 230 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 232 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 261 /* SourceFile */ || - node.kind === 230 /* ModuleDeclaration */ || + return node.kind === 264 /* SourceFile */ || + node.kind === 232 /* ModuleDeclaration */ || isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -6765,32 +6904,36 @@ var ts; return false; } switch (node.parent.kind) { - case 261 /* SourceFile */: + case 264 /* SourceFile */: return ts.isExternalModule(node.parent); - case 231 /* ModuleBlock */: + case 233 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; } ts.isExternalModuleAugmentation = isExternalModuleAugmentation; + function isEffectiveExternalModule(node, compilerOptions) { + return ts.isExternalModule(node) || compilerOptions.isolatedModules; + } + ts.isEffectiveExternalModule = isEffectiveExternalModule; function isBlockScope(node, parentNode) { switch (node.kind) { - case 261 /* SourceFile */: - case 232 /* CaseBlock */: - case 256 /* CatchClause */: - case 230 /* ModuleDeclaration */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 150 /* Constructor */: - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 264 /* SourceFile */: + case 234 /* CaseBlock */: + case 259 /* CatchClause */: + case 232 /* ModuleDeclaration */: + case 213 /* ForStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: + case 151 /* Constructor */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: return true; - case 204 /* Block */: + case 206 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return parentNode && !isFunctionLike(parentNode); @@ -6817,6 +6960,10 @@ var ts; return getFullWidth(name) === 0 ? "(Missing)" : getTextOfNode(name); } ts.declarationNameToString = declarationNameToString; + function getNameFromIndexInfo(info) { + return info.declaration ? declarationNameToString(info.declaration.parameters[0].name) : undefined; + } + ts.getNameFromIndexInfo = getNameFromIndexInfo; function getTextOfPropertyName(name) { switch (name.kind) { case 70 /* Identifier */: @@ -6824,7 +6971,7 @@ var ts; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: return name.text; - case 142 /* ComputedPropertyName */: + case 143 /* ComputedPropertyName */: if (isStringOrNumericLiteral(name.expression)) { return name.expression.text; } @@ -6835,10 +6982,10 @@ var ts; function entityNameToString(name) { switch (name.kind) { case 70 /* Identifier */: - return getFullWidth(name) === 0 ? unescapeIdentifier(name.text) : getTextOfNode(name); - case 141 /* QualifiedName */: + return getFullWidth(name) === 0 ? ts.unescapeIdentifier(name.text) : getTextOfNode(name); + case 142 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 177 /* PropertyAccessExpression */: + case 178 /* PropertyAccessExpression */: return entityNameToString(name.expression) + "." + entityNameToString(name.name); } } @@ -6875,7 +7022,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 204 /* Block */) { + if (node.body && node.body.kind === 206 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -6889,7 +7036,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 261 /* SourceFile */: + case 264 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -6898,23 +7045,23 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 223 /* VariableDeclaration */: - case 174 /* BindingElement */: - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: - case 230 /* ModuleDeclaration */: - case 229 /* EnumDeclaration */: - case 260 /* EnumMember */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 228 /* TypeAliasDeclaration */: + case 225 /* VariableDeclaration */: + case 175 /* BindingElement */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 229 /* InterfaceDeclaration */: + case 232 /* ModuleDeclaration */: + case 231 /* EnumDeclaration */: + case 263 /* EnumMember */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 230 /* TypeAliasDeclaration */: errorNode = node.name; break; - case 185 /* ArrowFunction */: + case 186 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); } if (errorNode === undefined) { @@ -6937,7 +7084,7 @@ var ts; } ts.isDeclarationFile = isDeclarationFile; function isConstEnumDeclaration(node) { - return node.kind === 229 /* EnumDeclaration */ && isConst(node); + return node.kind === 231 /* EnumDeclaration */ && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function isConst(node) { @@ -6950,11 +7097,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 179 /* CallExpression */ && n.expression.kind === 96 /* SuperKeyword */; + return n.kind === 180 /* CallExpression */ && n.expression.kind === 96 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isPrologueDirective(node) { - return node.kind === 207 /* ExpressionStatement */ + return node.kind === 209 /* ExpressionStatement */ && node.expression.kind === 9 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -6967,10 +7114,10 @@ var ts; } ts.getLeadingCommentRangesOfNodeFromText = getLeadingCommentRangesOfNodeFromText; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 144 /* Parameter */ || - node.kind === 143 /* TypeParameter */ || - node.kind === 184 /* FunctionExpression */ || - node.kind === 185 /* ArrowFunction */) ? + var commentRanges = (node.kind === 145 /* Parameter */ || + node.kind === 144 /* TypeParameter */ || + node.kind === 185 /* FunctionExpression */ || + node.kind === 186 /* ArrowFunction */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRangesOfNodeFromText(node, text); // True if the comment starts with '/**' but not if it is '/**/' @@ -6985,79 +7132,80 @@ var ts; ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (156 /* FirstTypeNode */ <= node.kind && node.kind <= 171 /* LastTypeNode */) { + if (157 /* FirstTypeNode */ <= node.kind && node.kind <= 172 /* LastTypeNode */) { return true; } switch (node.kind) { case 118 /* AnyKeyword */: case 132 /* NumberKeyword */: - case 134 /* StringKeyword */: + case 135 /* StringKeyword */: case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: - case 137 /* UndefinedKeyword */: + case 136 /* SymbolKeyword */: + case 138 /* UndefinedKeyword */: case 129 /* NeverKeyword */: return true; case 104 /* VoidKeyword */: - return node.parent.kind !== 188 /* VoidExpression */; - case 199 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 189 /* VoidExpression */; + case 200 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 70 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 141 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 142 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 177 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 178 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 70 /* Identifier */ || node.kind === 141 /* QualifiedName */ || node.kind === 177 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); - case 141 /* QualifiedName */: - case 177 /* PropertyAccessExpression */: + ts.Debug.assert(node.kind === 70 /* Identifier */ || node.kind === 142 /* QualifiedName */ || node.kind === 178 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + // falls through + case 142 /* QualifiedName */: + case 178 /* PropertyAccessExpression */: case 98 /* ThisKeyword */: - var parent_1 = node.parent; - if (parent_1.kind === 160 /* TypeQuery */) { + var parent = node.parent; + if (parent.kind === 161 /* TypeQuery */) { return false; } // Do not recursively call isPartOfTypeNode on the parent. In the example: // // let a: A.B.C; // - // Calling isPartOfTypeNode would consider the qualified name A.B a type node. Only C or - // A.B.C is a type node. - if (156 /* FirstTypeNode */ <= parent_1.kind && parent_1.kind <= 171 /* LastTypeNode */) { + // Calling isPartOfTypeNode would consider the qualified name A.B a type node. + // Only C and A.B.C are type nodes. + if (157 /* FirstTypeNode */ <= parent.kind && parent.kind <= 172 /* LastTypeNode */) { return true; } - switch (parent_1.kind) { - case 199 /* ExpressionWithTypeArguments */: - return !isExpressionWithTypeArgumentsInClassExtendsClause(parent_1); - case 143 /* TypeParameter */: - return node === parent_1.constraint; - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 144 /* Parameter */: - case 223 /* VariableDeclaration */: - return node === parent_1.type; - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 150 /* Constructor */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - return node === parent_1.type; - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - return node === parent_1.type; - case 182 /* TypeAssertionExpression */: - return node === parent_1.type; - case 179 /* CallExpression */: - case 180 /* NewExpression */: - return parent_1.typeArguments && ts.indexOf(parent_1.typeArguments, node) >= 0; - case 181 /* TaggedTemplateExpression */: + switch (parent.kind) { + case 200 /* ExpressionWithTypeArguments */: + return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); + case 144 /* TypeParameter */: + return node === parent.constraint; + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 145 /* Parameter */: + case 225 /* VariableDeclaration */: + return node === parent.type; + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 151 /* Constructor */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + return node === parent.type; + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: + return node === parent.type; + case 183 /* TypeAssertionExpression */: + return node === parent.type; + case 180 /* CallExpression */: + case 181 /* NewExpression */: + return parent.typeArguments && ts.indexOf(parent.typeArguments, node) >= 0; + case 182 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -7065,29 +7213,43 @@ var ts; return false; } ts.isPartOfTypeNode = isPartOfTypeNode; + function isChildOfNodeWithKind(node, kind) { + while (node) { + if (node.kind === kind) { + return true; + } + node = node.parent; + } + return false; + } + ts.isChildOfNodeWithKind = isChildOfNodeWithKind; + function isPrefixUnaryExpression(node) { + return node.kind === 191 /* PrefixUnaryExpression */; + } + ts.isPrefixUnaryExpression = isPrefixUnaryExpression; // Warning: This has the same semantics as the forEach family of functions, // in that traversal terminates in the event that 'visitor' supplies a truthy value. function forEachReturnStatement(body, visitor) { return traverse(body); function traverse(node) { switch (node.kind) { - case 216 /* ReturnStatement */: + case 218 /* ReturnStatement */: return visitor(node); - case 232 /* CaseBlock */: - case 204 /* Block */: - case 208 /* IfStatement */: - case 209 /* DoStatement */: - case 210 /* WhileStatement */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 217 /* WithStatement */: - case 218 /* SwitchStatement */: - case 253 /* CaseClause */: - case 254 /* DefaultClause */: - case 219 /* LabeledStatement */: - case 221 /* TryStatement */: - case 256 /* CatchClause */: + case 234 /* CaseBlock */: + case 206 /* Block */: + case 210 /* IfStatement */: + case 211 /* DoStatement */: + case 212 /* WhileStatement */: + case 213 /* ForStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: + case 219 /* WithStatement */: + case 220 /* SwitchStatement */: + case 256 /* CaseClause */: + case 257 /* DefaultClause */: + case 221 /* LabeledStatement */: + case 223 /* TryStatement */: + case 259 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -7097,29 +7259,30 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 195 /* YieldExpression */: + case 196 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } - case 229 /* EnumDeclaration */: - case 227 /* InterfaceDeclaration */: - case 230 /* ModuleDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + return; + case 231 /* EnumDeclaration */: + case 229 /* InterfaceDeclaration */: + case 232 /* ModuleDeclaration */: + case 230 /* TypeAliasDeclaration */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, any yield statements contained within them should be // skipped in this traversal. return; default: if (isFunctionLike(node)) { - var name_5 = node.name; - if (name_5 && name_5.kind === 142 /* ComputedPropertyName */) { + var name = node.name; + if (name && name.kind === 143 /* ComputedPropertyName */) { // Note that we will not include methods/accessors of a class because they would require // first descending into the class. This is by design. - traverse(name_5.expression); + traverse(name.expression); return; } } @@ -7132,17 +7295,35 @@ var ts; } } ts.forEachYieldExpression = forEachYieldExpression; + /** + * Gets the most likely element type for a TypeNode. This is not an exhaustive test + * as it assumes a rest argument can only be an array type (either T[], or Array). + * + * @param node The type node. + */ + function getRestParameterElementType(node) { + if (node && node.kind === 163 /* ArrayType */) { + return node.elementType; + } + else if (node && node.kind === 158 /* TypeReference */) { + return ts.singleOrUndefined(node.typeArguments); + } + else { + return undefined; + } + } + ts.getRestParameterElementType = getRestParameterElementType; function isVariableLike(node) { if (node) { switch (node.kind) { - case 174 /* BindingElement */: - case 260 /* EnumMember */: - case 144 /* Parameter */: - case 257 /* PropertyAssignment */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 258 /* ShorthandPropertyAssignment */: - case 223 /* VariableDeclaration */: + case 175 /* BindingElement */: + case 263 /* EnumMember */: + case 145 /* Parameter */: + case 260 /* PropertyAssignment */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 261 /* ShorthandPropertyAssignment */: + case 225 /* VariableDeclaration */: return true; } } @@ -7150,11 +7331,11 @@ var ts; } ts.isVariableLike = isVariableLike; function isAccessor(node) { - return node && (node.kind === 151 /* GetAccessor */ || node.kind === 152 /* SetAccessor */); + return node && (node.kind === 152 /* GetAccessor */ || node.kind === 153 /* SetAccessor */); } ts.isAccessor = isAccessor; function isClassLike(node) { - return node && (node.kind === 226 /* ClassDeclaration */ || node.kind === 197 /* ClassExpression */); + return node && (node.kind === 228 /* ClassDeclaration */ || node.kind === 198 /* ClassExpression */); } ts.isClassLike = isClassLike; function isFunctionLike(node) { @@ -7163,19 +7344,19 @@ var ts; ts.isFunctionLike = isFunctionLike; function isFunctionLikeKind(kind) { switch (kind) { - case 150 /* Constructor */: - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: - case 185 /* ArrowFunction */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 158 /* FunctionType */: - case 159 /* ConstructorType */: + case 151 /* Constructor */: + case 185 /* FunctionExpression */: + case 227 /* FunctionDeclaration */: + case 186 /* ArrowFunction */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: return true; } return false; @@ -7183,13 +7364,13 @@ var ts; ts.isFunctionLikeKind = isFunctionLikeKind; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: return true; } return false; @@ -7197,30 +7378,42 @@ var ts; ts.introducesArgumentsExoticObject = introducesArgumentsExoticObject; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 209 /* DoStatement */: - case 210 /* WhileStatement */: + case 213 /* ForStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: + case 211 /* DoStatement */: + case 212 /* WhileStatement */: return true; - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; } ts.isIterationStatement = isIterationStatement; + function unwrapInnermostStatementOfLabel(node, beforeUnwrapLabelCallback) { + while (true) { + if (beforeUnwrapLabelCallback) { + beforeUnwrapLabelCallback(node); + } + if (node.statement.kind !== 221 /* LabeledStatement */) { + return node.statement; + } + node = node.statement; + } + } + ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 204 /* Block */ && isFunctionLike(node.parent); + return node && node.kind === 206 /* Block */ && isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 149 /* MethodDeclaration */ && node.parent.kind === 176 /* ObjectLiteralExpression */; + return node && node.kind === 150 /* MethodDeclaration */ && node.parent.kind === 177 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 149 /* MethodDeclaration */ && - (node.parent.kind === 176 /* ObjectLiteralExpression */ || - node.parent.kind === 197 /* ClassExpression */); + return node.kind === 150 /* MethodDeclaration */ && + (node.parent.kind === 177 /* ObjectLiteralExpression */ || + node.parent.kind === 198 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -7256,7 +7449,7 @@ var ts; return undefined; } switch (node.kind) { - case 142 /* ComputedPropertyName */: + case 143 /* ComputedPropertyName */: // If the grandparent node is an object literal (as opposed to a class), // then the computed property is not a 'this' container. // A computed property name in a class needs to be a this container @@ -7271,9 +7464,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 145 /* Decorator */: + case 146 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 144 /* Parameter */ && isClassElement(node.parent.parent)) { + if (node.parent.kind === 145 /* Parameter */ && isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -7284,39 +7477,52 @@ var ts; node = node.parent; } break; - case 185 /* ArrowFunction */: + case 186 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } - // Fall through - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 230 /* ModuleDeclaration */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 229 /* EnumDeclaration */: - case 261 /* SourceFile */: + // falls through + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 232 /* ModuleDeclaration */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: + case 231 /* EnumDeclaration */: + case 264 /* SourceFile */: return node; } } } ts.getThisContainer = getThisContainer; + function getNewTargetContainer(node) { + var container = getThisContainer(node, /*includeArrowFunctions*/ false); + if (container) { + switch (container.kind) { + case 151 /* Constructor */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + return container; + } + } + return undefined; + } + ts.getNewTargetContainer = getNewTargetContainer; /** - * Given an super call/property node, returns the closest node where - * - a super call/property access is legal in the node and not legal in the parent node the node. - * i.e. super call is legal in constructor but not legal in the class body. - * - the container is an arrow function (so caller might need to call getSuperContainer again in case it needs to climb higher) - * - a super call/property is definitely illegal in the container (but might be legal in some subnode) - * i.e. super property access is illegal in function declaration but can be legal in the statement list - */ + * Given an super call/property node, returns the closest node where + * - a super call/property access is legal in the node and not legal in the parent node the node. + * i.e. super call is legal in constructor but not legal in the class body. + * - the container is an arrow function (so caller might need to call getSuperContainer again in case it needs to climb higher) + * - a super call/property is definitely illegal in the container (but might be legal in some subnode) + * i.e. super property access is illegal in function declaration but can be legal in the statement list + */ function getSuperContainer(node, stopOnFunctions) { while (true) { node = node.parent; @@ -7324,26 +7530,27 @@ var ts; return node; } switch (node.kind) { - case 142 /* ComputedPropertyName */: + case 143 /* ComputedPropertyName */: node = node.parent; break; - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: if (!stopOnFunctions) { continue; } - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + // falls through + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: return node; - case 145 /* Decorator */: + case 146 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 144 /* Parameter */ && isClassElement(node.parent.parent)) { + if (node.parent.kind === 145 /* Parameter */ && isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -7359,15 +7566,15 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 184 /* FunctionExpression */ || func.kind === 185 /* ArrowFunction */) { + if (func.kind === 185 /* FunctionExpression */ || func.kind === 186 /* ArrowFunction */) { var prev = func; - var parent_2 = func.parent; - while (parent_2.kind === 183 /* ParenthesizedExpression */) { - prev = parent_2; - parent_2 = parent_2.parent; + var parent = func.parent; + while (parent.kind === 184 /* ParenthesizedExpression */) { + prev = parent; + parent = parent.parent; } - if (parent_2.kind === 179 /* CallExpression */ && parent_2.expression === prev) { - return parent_2; + if (parent.kind === 180 /* CallExpression */ && parent.expression === prev) { + return parent; } } } @@ -7377,21 +7584,21 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 177 /* PropertyAccessExpression */ || kind === 178 /* ElementAccessExpression */) + return (kind === 178 /* PropertyAccessExpression */ || kind === 179 /* ElementAccessExpression */) && node.expression.kind === 96 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 157 /* TypeReference */: - case 272 /* JSDocTypeReference */: + case 158 /* TypeReference */: + case 276 /* JSDocTypeReference */: return node.typeName; - case 199 /* ExpressionWithTypeArguments */: + case 200 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 70 /* Identifier */: - case 141 /* QualifiedName */: + case 142 /* QualifiedName */: return node; } return undefined; @@ -7399,10 +7606,12 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function isCallLikeExpression(node) { switch (node.kind) { - case 179 /* CallExpression */: - case 180 /* NewExpression */: - case 181 /* TaggedTemplateExpression */: - case 145 /* Decorator */: + case 250 /* JsxOpeningElement */: + case 249 /* JsxSelfClosingElement */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: + case 182 /* TaggedTemplateExpression */: + case 146 /* Decorator */: return true; default: return false; @@ -7410,34 +7619,37 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function getInvokedExpression(node) { - if (node.kind === 181 /* TaggedTemplateExpression */) { + if (node.kind === 182 /* TaggedTemplateExpression */) { return node.tag; } + else if (isJsxOpeningLikeElement(node)) { + return node.tagName; + } // Will either be a CallExpression, NewExpression, or Decorator. return node.expression; } ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node) { switch (node.kind) { - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: // classes are valid targets return true; - case 147 /* PropertyDeclaration */: + case 148 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return node.parent.kind === 226 /* ClassDeclaration */; - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 149 /* MethodDeclaration */: + return node.parent.kind === 228 /* ClassDeclaration */; + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 150 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. return node.body !== undefined - && node.parent.kind === 226 /* ClassDeclaration */; - case 144 /* Parameter */: + && node.parent.kind === 228 /* ClassDeclaration */; + case 145 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; return node.parent.body !== undefined - && (node.parent.kind === 150 /* Constructor */ - || node.parent.kind === 149 /* MethodDeclaration */ - || node.parent.kind === 152 /* SetAccessor */) - && node.parent.parent.kind === 226 /* ClassDeclaration */; + && (node.parent.kind === 151 /* Constructor */ + || node.parent.kind === 150 /* MethodDeclaration */ + || node.parent.kind === 153 /* SetAccessor */) + && node.parent.parent.kind === 228 /* ClassDeclaration */; } return false; } @@ -7453,19 +7665,19 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node) { switch (node.kind) { - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: return ts.forEach(node.members, nodeOrChildIsDecorated); - case 149 /* MethodDeclaration */: - case 152 /* SetAccessor */: + case 150 /* MethodDeclaration */: + case 153 /* SetAccessor */: return ts.forEach(node.parameters, nodeIsDecorated); } } ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 248 /* JsxOpeningElement */ || - parent.kind === 247 /* JsxSelfClosingElement */ || - parent.kind === 249 /* JsxClosingElement */) { + if (parent.kind === 250 /* JsxOpeningElement */ || + parent.kind === 249 /* JsxSelfClosingElement */ || + parent.kind === 251 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -7479,96 +7691,97 @@ var ts; case 100 /* TrueKeyword */: case 85 /* FalseKeyword */: case 11 /* RegularExpressionLiteral */: - case 175 /* ArrayLiteralExpression */: - case 176 /* ObjectLiteralExpression */: - case 177 /* PropertyAccessExpression */: - case 178 /* ElementAccessExpression */: - case 179 /* CallExpression */: - case 180 /* NewExpression */: - case 181 /* TaggedTemplateExpression */: - case 200 /* AsExpression */: - case 182 /* TypeAssertionExpression */: - case 201 /* NonNullExpression */: - case 183 /* ParenthesizedExpression */: - case 184 /* FunctionExpression */: - case 197 /* ClassExpression */: - case 185 /* ArrowFunction */: - case 188 /* VoidExpression */: - case 186 /* DeleteExpression */: - case 187 /* TypeOfExpression */: - case 190 /* PrefixUnaryExpression */: - case 191 /* PostfixUnaryExpression */: - case 192 /* BinaryExpression */: - case 193 /* ConditionalExpression */: - case 196 /* SpreadElement */: - case 194 /* TemplateExpression */: + case 176 /* ArrayLiteralExpression */: + case 177 /* ObjectLiteralExpression */: + case 178 /* PropertyAccessExpression */: + case 179 /* ElementAccessExpression */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: + case 182 /* TaggedTemplateExpression */: + case 201 /* AsExpression */: + case 183 /* TypeAssertionExpression */: + case 202 /* NonNullExpression */: + case 184 /* ParenthesizedExpression */: + case 185 /* FunctionExpression */: + case 198 /* ClassExpression */: + case 186 /* ArrowFunction */: + case 189 /* VoidExpression */: + case 187 /* DeleteExpression */: + case 188 /* TypeOfExpression */: + case 191 /* PrefixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: + case 193 /* BinaryExpression */: + case 194 /* ConditionalExpression */: + case 197 /* SpreadElement */: + case 195 /* TemplateExpression */: case 12 /* NoSubstitutionTemplateLiteral */: - case 198 /* OmittedExpression */: - case 246 /* JsxElement */: - case 247 /* JsxSelfClosingElement */: - case 195 /* YieldExpression */: - case 189 /* AwaitExpression */: + case 199 /* OmittedExpression */: + case 248 /* JsxElement */: + case 249 /* JsxSelfClosingElement */: + case 196 /* YieldExpression */: + case 190 /* AwaitExpression */: + case 203 /* MetaProperty */: return true; - case 141 /* QualifiedName */: - while (node.parent.kind === 141 /* QualifiedName */) { + case 142 /* QualifiedName */: + while (node.parent.kind === 142 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 160 /* TypeQuery */ || isJSXTagName(node); + return node.parent.kind === 161 /* TypeQuery */ || isJSXTagName(node); case 70 /* Identifier */: - if (node.parent.kind === 160 /* TypeQuery */ || isJSXTagName(node)) { + if (node.parent.kind === 161 /* TypeQuery */ || isJSXTagName(node)) { return true; } - // fall through + // falls through case 8 /* NumericLiteral */: case 9 /* StringLiteral */: case 98 /* ThisKeyword */: - var parent_3 = node.parent; - switch (parent_3.kind) { - case 223 /* VariableDeclaration */: - case 144 /* Parameter */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 260 /* EnumMember */: - case 257 /* PropertyAssignment */: - case 174 /* BindingElement */: - return parent_3.initializer === node; - case 207 /* ExpressionStatement */: - case 208 /* IfStatement */: - case 209 /* DoStatement */: - case 210 /* WhileStatement */: - case 216 /* ReturnStatement */: - case 217 /* WithStatement */: - case 218 /* SwitchStatement */: - case 253 /* CaseClause */: - case 220 /* ThrowStatement */: - case 218 /* SwitchStatement */: - return parent_3.expression === node; - case 211 /* ForStatement */: - var forStatement = parent_3; - return (forStatement.initializer === node && forStatement.initializer.kind !== 224 /* VariableDeclarationList */) || + var parent = node.parent; + switch (parent.kind) { + case 225 /* VariableDeclaration */: + case 145 /* Parameter */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 263 /* EnumMember */: + case 260 /* PropertyAssignment */: + case 175 /* BindingElement */: + return parent.initializer === node; + case 209 /* ExpressionStatement */: + case 210 /* IfStatement */: + case 211 /* DoStatement */: + case 212 /* WhileStatement */: + case 218 /* ReturnStatement */: + case 219 /* WithStatement */: + case 220 /* SwitchStatement */: + case 256 /* CaseClause */: + case 222 /* ThrowStatement */: + case 220 /* SwitchStatement */: + return parent.expression === node; + case 213 /* ForStatement */: + var forStatement = parent; + return (forStatement.initializer === node && forStatement.initializer.kind !== 226 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - var forInStatement = parent_3; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 224 /* VariableDeclarationList */) || + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: + var forInStatement = parent; + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 226 /* VariableDeclarationList */) || forInStatement.expression === node; - case 182 /* TypeAssertionExpression */: - case 200 /* AsExpression */: - return node === parent_3.expression; - case 202 /* TemplateSpan */: - return node === parent_3.expression; - case 142 /* ComputedPropertyName */: - return node === parent_3.expression; - case 145 /* Decorator */: - case 252 /* JsxExpression */: - case 251 /* JsxSpreadAttribute */: - case 259 /* SpreadAssignment */: + case 183 /* TypeAssertionExpression */: + case 201 /* AsExpression */: + return node === parent.expression; + case 204 /* TemplateSpan */: + return node === parent.expression; + case 143 /* ComputedPropertyName */: + return node === parent.expression; + case 146 /* Decorator */: + case 255 /* JsxExpression */: + case 254 /* JsxSpreadAttribute */: + case 262 /* SpreadAssignment */: return true; - case 199 /* ExpressionWithTypeArguments */: - return parent_3.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent_3); + case 200 /* ExpressionWithTypeArguments */: + return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); default: - if (isPartOfExpression(parent_3)) { + if (isPartOfExpression(parent)) { return true; } } @@ -7583,7 +7796,7 @@ var ts; } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 234 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 245 /* ExternalModuleReference */; + return node.kind === 236 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 247 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -7592,7 +7805,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 234 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 245 /* ExternalModuleReference */; + return node.kind === 236 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 247 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJavaScript(file) { @@ -7600,21 +7813,27 @@ var ts; } ts.isSourceFileJavaScript = isSourceFileJavaScript; function isInJavaScriptFile(node) { - return node && !!(node.flags & 2097152 /* JavaScriptFile */); + return node && !!(node.flags & 65536 /* JavaScriptFile */); } ts.isInJavaScriptFile = isInJavaScriptFile; /** * Returns true if the node is a CallExpression to the identifier 'require' with - * exactly one argument. + * exactly one argument (of the form 'require("name")'). * This function does not test if the node is in a JavaScript file or not. - */ - function isRequireCall(expression, checkArgumentIsStringLiteral) { - // of the form 'require("name")' - var isRequire = expression.kind === 179 /* CallExpression */ && - expression.expression.kind === 70 /* Identifier */ && - expression.expression.text === "require" && - expression.arguments.length === 1; - return isRequire && (!checkArgumentIsStringLiteral || expression.arguments[0].kind === 9 /* StringLiteral */); + */ + function isRequireCall(callExpression, checkArgumentIsStringLiteral) { + if (callExpression.kind !== 180 /* CallExpression */) { + return false; + } + var _a = callExpression, expression = _a.expression, args = _a.arguments; + if (expression.kind !== 70 /* Identifier */ || expression.text !== "require") { + return false; + } + if (args.length !== 1) { + return false; + } + var arg = args[0]; + return !checkArgumentIsStringLiteral || arg.kind === 9 /* StringLiteral */ || arg.kind === 12 /* NoSubstitutionTemplateLiteral */; } ts.isRequireCall = isRequireCall; function isSingleOrDoubleQuote(charCode) { @@ -7625,25 +7844,37 @@ var ts; * Returns true if the node is a variable declaration whose initializer is a function expression. * This function does not test if the node is in a JavaScript file or not. */ - function isDeclarationOfFunctionExpression(s) { - if (s.valueDeclaration && s.valueDeclaration.kind === 223 /* VariableDeclaration */) { + function isDeclarationOfFunctionOrClassExpression(s) { + if (s.valueDeclaration && s.valueDeclaration.kind === 225 /* VariableDeclaration */) { var declaration = s.valueDeclaration; - return declaration.initializer && declaration.initializer.kind === 184 /* FunctionExpression */; + return declaration.initializer && (declaration.initializer.kind === 185 /* FunctionExpression */ || declaration.initializer.kind === 198 /* ClassExpression */); } return false; } - ts.isDeclarationOfFunctionExpression = isDeclarationOfFunctionExpression; + ts.isDeclarationOfFunctionOrClassExpression = isDeclarationOfFunctionOrClassExpression; + function getRightMostAssignedExpression(node) { + while (isAssignmentExpression(node, /*excludeCompoundAssignements*/ true)) { + node = node.right; + } + return node; + } + ts.getRightMostAssignedExpression = getRightMostAssignedExpression; + function isExportsIdentifier(node) { + return isIdentifier(node) && node.text === "exports"; + } + ts.isExportsIdentifier = isExportsIdentifier; + function isModuleExportsPropertyAccessExpression(node) { + return isPropertyAccessExpression(node) && isIdentifier(node.expression) && node.expression.text === "module" && node.name.text === "exports"; + } + ts.isModuleExportsPropertyAccessExpression = isModuleExportsPropertyAccessExpression; /// Given a BinaryExpression, returns SpecialPropertyAssignmentKind for the various kinds of property /// assignments we treat as special in the binder function getSpecialPropertyAssignmentKind(expression) { if (!isInJavaScriptFile(expression)) { return 0 /* None */; } - if (expression.kind !== 192 /* BinaryExpression */) { - return 0 /* None */; - } var expr = expression; - if (expr.operatorToken.kind !== 57 /* EqualsToken */ || expr.left.kind !== 177 /* PropertyAccessExpression */) { + if (expr.operatorToken.kind !== 57 /* EqualsToken */ || expr.left.kind !== 178 /* PropertyAccessExpression */) { return 0 /* None */; } var lhs = expr.left; @@ -7657,11 +7888,15 @@ var ts; // module.exports = expr return 2 /* ModuleExports */; } + else { + // F.x = expr + return 5 /* Property */; + } } else if (lhs.expression.kind === 98 /* ThisKeyword */) { return 4 /* ThisProperty */; } - else if (lhs.expression.kind === 177 /* PropertyAccessExpression */) { + else if (lhs.expression.kind === 178 /* PropertyAccessExpression */) { // chained dot, e.g. x.y.z = expr; this var is the 'x.y' part var innerPropertyAccess = lhs.expression; if (innerPropertyAccess.expression.kind === 70 /* Identifier */) { @@ -7679,35 +7914,35 @@ var ts; } ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind; function getExternalModuleName(node) { - if (node.kind === 235 /* ImportDeclaration */) { + if (node.kind === 237 /* ImportDeclaration */) { return node.moduleSpecifier; } - if (node.kind === 234 /* ImportEqualsDeclaration */) { + if (node.kind === 236 /* ImportEqualsDeclaration */) { var reference = node.moduleReference; - if (reference.kind === 245 /* ExternalModuleReference */) { + if (reference.kind === 247 /* ExternalModuleReference */) { return reference.expression; } } - if (node.kind === 241 /* ExportDeclaration */) { + if (node.kind === 243 /* ExportDeclaration */) { return node.moduleSpecifier; } - if (node.kind === 230 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */) { + if (node.kind === 232 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */) { return node.name; } } ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { - if (node.kind === 234 /* ImportEqualsDeclaration */) { + if (node.kind === 236 /* ImportEqualsDeclaration */) { return node; } var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 237 /* NamespaceImport */) { + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 239 /* NamespaceImport */) { return importClause.namedBindings; } } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 235 /* ImportDeclaration */ + return node.kind === 237 /* ImportDeclaration */ && node.importClause && !!node.importClause.name; } @@ -7715,13 +7950,13 @@ var ts; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 144 /* Parameter */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 258 /* ShorthandPropertyAssignment */: - case 257 /* PropertyAssignment */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 145 /* Parameter */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 261 /* ShorthandPropertyAssignment */: + case 260 /* PropertyAssignment */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -7729,28 +7964,36 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function isJSDocConstructSignature(node) { - return node.kind === 274 /* JSDocFunctionType */ && + return node.kind === 278 /* JSDocFunctionType */ && node.parameters.length > 0 && - node.parameters[0].type.kind === 276 /* JSDocConstructorType */; + node.parameters[0].type.kind === 280 /* JSDocConstructorType */; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function getCommentsFromJSDoc(node) { return ts.map(getJSDocs(node), function (doc) { return doc.comment; }); } ts.getCommentsFromJSDoc = getCommentsFromJSDoc; + function hasJSDocParameterTags(node) { + var parameterTags = getJSDocTags(node, 285 /* JSDocParameterTag */); + return parameterTags && parameterTags.length > 0; + } + ts.hasJSDocParameterTags = hasJSDocParameterTags; function getJSDocTags(node, kind) { var docs = getJSDocs(node); if (docs) { var result = []; for (var _i = 0, docs_1 = docs; _i < docs_1.length; _i++) { var doc = docs_1[_i]; - if (doc.kind === 281 /* JSDocParameterTag */) { + if (doc.kind === 285 /* JSDocParameterTag */) { if (doc.kind === kind) { result.push(doc); } } else { - result.push.apply(result, ts.filter(doc.tags, function (tag) { return tag.kind === kind; })); + var tags = doc.tags; + if (tags) { + result.push.apply(result, ts.filter(tags, function (tag) { return tag.kind === kind; })); + } } } return result; @@ -7776,9 +8019,9 @@ var ts; // var x = function(name) { return name.length; } var isInitializerOfVariableDeclarationInStatement = isVariableLike(parent) && parent.initializer === node && - parent.parent.parent.kind === 205 /* VariableStatement */; + parent.parent.parent.kind === 207 /* VariableStatement */; var isVariableOfVariableDeclarationStatement = isVariableLike(node) && - parent.parent.kind === 205 /* VariableStatement */; + parent.parent.kind === 207 /* VariableStatement */; var variableStatementNode = isInitializerOfVariableDeclarationInStatement ? parent.parent.parent : isVariableOfVariableDeclarationStatement ? parent.parent : undefined; @@ -7787,20 +8030,20 @@ var ts; } // Also recognize when the node is the RHS of an assignment expression var isSourceOfAssignmentExpressionStatement = parent && parent.parent && - parent.kind === 192 /* BinaryExpression */ && + parent.kind === 193 /* BinaryExpression */ && parent.operatorToken.kind === 57 /* EqualsToken */ && - parent.parent.kind === 207 /* ExpressionStatement */; + parent.parent.kind === 209 /* ExpressionStatement */; if (isSourceOfAssignmentExpressionStatement) { getJSDocsWorker(parent.parent); } - var isModuleDeclaration = node.kind === 230 /* ModuleDeclaration */ && - parent && parent.kind === 230 /* ModuleDeclaration */; - var isPropertyAssignmentExpression = parent && parent.kind === 257 /* PropertyAssignment */; + var isModuleDeclaration = node.kind === 232 /* ModuleDeclaration */ && + parent && parent.kind === 232 /* ModuleDeclaration */; + var isPropertyAssignmentExpression = parent && parent.kind === 260 /* PropertyAssignment */; if (isModuleDeclaration || isPropertyAssignmentExpression) { getJSDocsWorker(parent); } // Pull parameter comments from declaring function as well - if (node.kind === 144 /* Parameter */) { + if (node.kind === 145 /* Parameter */) { cache = ts.concatenate(cache, getJSDocParameterTags(node)); } if (isVariableLike(node) && node.initializer) { @@ -7809,23 +8052,24 @@ var ts; cache = ts.concatenate(cache, node.jsDoc); } } + ts.getJSDocs = getJSDocs; function getJSDocParameterTags(param) { if (!isParameter(param)) { return undefined; } var func = param.parent; - var tags = getJSDocTags(func, 281 /* JSDocParameterTag */); + var tags = getJSDocTags(func, 285 /* JSDocParameterTag */); if (!param.name) { // this is an anonymous jsdoc param from a `function(type1, type2): type3` specification var i = func.parameters.indexOf(param); - var paramTags = ts.filter(tags, function (tag) { return tag.kind === 281 /* JSDocParameterTag */; }); + var paramTags = ts.filter(tags, function (tag) { return tag.kind === 285 /* JSDocParameterTag */; }); if (paramTags && 0 <= i && i < paramTags.length) { return [paramTags[i]]; } } else if (param.name.kind === 70 /* Identifier */) { - var name_6 = param.name.text; - return ts.filter(tags, function (tag) { return tag.kind === 281 /* JSDocParameterTag */ && tag.parameterName.text === name_6; }); + var name_1 = param.name.text; + return ts.filter(tags, function (tag) { return tag.kind === 285 /* JSDocParameterTag */ && tag.parameterName.text === name_1; }); } else { // TODO: it's a destructured parameter, so it should look up an "object type" series of multiple lines @@ -7835,8 +8079,8 @@ var ts; } ts.getJSDocParameterTags = getJSDocParameterTags; function getJSDocType(node) { - var tag = getFirstJSDocTag(node, 283 /* JSDocTypeTag */); - if (!tag && node.kind === 144 /* Parameter */) { + var tag = getFirstJSDocTag(node, 287 /* JSDocTypeTag */); + if (!tag && node.kind === 145 /* Parameter */) { var paramTags = getJSDocParameterTags(node); if (paramTags) { tag = ts.find(paramTags, function (tag) { return !!tag.typeExpression; }); @@ -7846,15 +8090,15 @@ var ts; } ts.getJSDocType = getJSDocType; function getJSDocAugmentsTag(node) { - return getFirstJSDocTag(node, 280 /* JSDocAugmentsTag */); + return getFirstJSDocTag(node, 284 /* JSDocAugmentsTag */); } ts.getJSDocAugmentsTag = getJSDocAugmentsTag; function getJSDocReturnTag(node) { - return getFirstJSDocTag(node, 282 /* JSDocReturnTag */); + return getFirstJSDocTag(node, 286 /* JSDocReturnTag */); } ts.getJSDocReturnTag = getJSDocReturnTag; function getJSDocTemplateTag(node) { - return getFirstJSDocTag(node, 284 /* JSDocTemplateTag */); + return getFirstJSDocTag(node, 288 /* JSDocTemplateTag */); } ts.getJSDocTemplateTag = getJSDocTemplateTag; function hasRestParameter(s) { @@ -7866,9 +8110,9 @@ var ts; } ts.hasDeclaredRestParameter = hasDeclaredRestParameter; function isRestParameter(node) { - if (node && (node.flags & 2097152 /* JavaScriptFile */)) { - if (node.type && node.type.kind === 275 /* JSDocVariadicType */ || - ts.forEach(getJSDocParameterTags(node), function (t) { return t.typeExpression && t.typeExpression.type.kind === 275 /* JSDocVariadicType */; })) { + if (node && (node.flags & 65536 /* JavaScriptFile */)) { + if (node.type && node.type.kind === 279 /* JSDocVariadicType */ || + ts.forEach(getJSDocParameterTags(node), function (t) { return t.typeExpression && t.typeExpression.type.kind === 279 /* JSDocVariadicType */; })) { return true; } } @@ -7889,29 +8133,33 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 57 /* EqualsToken */ ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 190 /* PrefixUnaryExpression */: - case 191 /* PostfixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; return unaryOperator === 42 /* PlusPlusToken */ || unaryOperator === 43 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 183 /* ParenthesizedExpression */: - case 175 /* ArrayLiteralExpression */: - case 196 /* SpreadElement */: + case 184 /* ParenthesizedExpression */: + case 176 /* ArrayLiteralExpression */: + case 197 /* SpreadElement */: node = parent; break; - case 258 /* ShorthandPropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } - // Fall through - case 257 /* PropertyAssignment */: + node = parent.parent; + break; + case 260 /* PropertyAssignment */: + if (parent.name === node) { + return 0 /* None */; + } node = parent.parent; break; default: @@ -7923,11 +8171,24 @@ var ts; ts.getAssignmentTargetKind = getAssignmentTargetKind; // A node is an assignment target if it is on the left hand side of an '=' token, if it is parented by a property // assignment in an object literal that is an assignment target, or if it is parented by an array literal that is - // an assignment target. Examples include 'a = xxx', '{ p: a } = xxx', '[{ p: a}] = xxx'. + // an assignment target. Examples include 'a = xxx', '{ p: a } = xxx', '[{ a }] = xxx'. + // (Note that `p` is not a target in the above examples, only `a`.) function isAssignmentTarget(node) { return getAssignmentTargetKind(node) !== 0 /* None */; } ts.isAssignmentTarget = isAssignmentTarget; + // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped + function isDeleteTarget(node) { + if (node.kind !== 178 /* PropertyAccessExpression */ && node.kind !== 179 /* ElementAccessExpression */) { + return false; + } + node = node.parent; + while (node && node.kind === 184 /* ParenthesizedExpression */) { + node = node.parent; + } + return node && node.kind === 187 /* DeleteExpression */; + } + ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { while (node) { if (node === ancestor) @@ -7939,7 +8200,7 @@ var ts; ts.isNodeDescendantOf = isNodeDescendantOf; function isInAmbientContext(node) { while (node) { - if (hasModifier(node, 2 /* Ambient */) || (node.kind === 261 /* SourceFile */ && node.isDeclarationFile)) { + if (hasModifier(node, 2 /* Ambient */) || (node.kind === 264 /* SourceFile */ && node.isDeclarationFile)) { return true; } node = node.parent; @@ -7953,7 +8214,7 @@ var ts; return false; } var parent = name.parent; - if (parent.kind === 239 /* ImportSpecifier */ || parent.kind === 243 /* ExportSpecifier */) { + if (parent.kind === 241 /* ImportSpecifier */ || parent.kind === 245 /* ExportSpecifier */) { if (parent.propertyName) { return true; } @@ -7966,7 +8227,7 @@ var ts; ts.isDeclarationName = isDeclarationName; function isLiteralComputedPropertyDeclarationName(node) { return (node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) && - node.parent.kind === 142 /* ComputedPropertyName */ && + node.parent.kind === 143 /* ComputedPropertyName */ && isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -7974,31 +8235,31 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 260 /* EnumMember */: - case 257 /* PropertyAssignment */: - case 177 /* PropertyAccessExpression */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 263 /* EnumMember */: + case 260 /* PropertyAssignment */: + case 178 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 141 /* QualifiedName */: + case 142 /* QualifiedName */: // Name on right hand side of dot in a type query if (parent.right === node) { - while (parent.kind === 141 /* QualifiedName */) { + while (parent.kind === 142 /* QualifiedName */) { parent = parent.parent; } - return parent.kind === 160 /* TypeQuery */; + return parent.kind === 161 /* TypeQuery */; } return false; - case 174 /* BindingElement */: - case 239 /* ImportSpecifier */: + case 175 /* BindingElement */: + case 241 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 243 /* ExportSpecifier */: + case 245 /* ExportSpecifier */: // Any name in an export specifier return true; } @@ -8014,13 +8275,13 @@ var ts; // export = // export default function isAliasSymbolDeclaration(node) { - return node.kind === 234 /* ImportEqualsDeclaration */ || - node.kind === 233 /* NamespaceExportDeclaration */ || - node.kind === 236 /* ImportClause */ && !!node.name || - node.kind === 237 /* NamespaceImport */ || - node.kind === 239 /* ImportSpecifier */ || - node.kind === 243 /* ExportSpecifier */ || - node.kind === 240 /* ExportAssignment */ && exportAssignmentIsAlias(node); + return node.kind === 236 /* ImportEqualsDeclaration */ || + node.kind === 235 /* NamespaceExportDeclaration */ || + node.kind === 238 /* ImportClause */ && !!node.name || + node.kind === 239 /* NamespaceImport */ || + node.kind === 241 /* ImportSpecifier */ || + node.kind === 245 /* ExportSpecifier */ || + node.kind === 242 /* ExportAssignment */ && exportAssignmentIsAlias(node); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function exportAssignmentIsAlias(node) { @@ -8106,17 +8367,62 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 71 /* FirstKeyword */ <= token && token <= 140 /* LastKeyword */; + return 71 /* FirstKeyword */ <= token && token <= 141 /* LastKeyword */; } ts.isKeyword = isKeyword; function isTrivia(token) { return 2 /* FirstTriviaToken */ <= token && token <= 7 /* LastTriviaToken */; } ts.isTrivia = isTrivia; - function isAsyncFunctionLike(node) { - return isFunctionLike(node) && hasModifier(node, 256 /* Async */) && !isAccessor(node); + var FunctionFlags; + (function (FunctionFlags) { + FunctionFlags[FunctionFlags["Normal"] = 0] = "Normal"; + FunctionFlags[FunctionFlags["Generator"] = 1] = "Generator"; + FunctionFlags[FunctionFlags["Async"] = 2] = "Async"; + FunctionFlags[FunctionFlags["AsyncOrAsyncGenerator"] = 3] = "AsyncOrAsyncGenerator"; + FunctionFlags[FunctionFlags["Invalid"] = 4] = "Invalid"; + FunctionFlags[FunctionFlags["InvalidAsyncOrAsyncGenerator"] = 7] = "InvalidAsyncOrAsyncGenerator"; + FunctionFlags[FunctionFlags["InvalidGenerator"] = 5] = "InvalidGenerator"; + })(FunctionFlags = ts.FunctionFlags || (ts.FunctionFlags = {})); + function getFunctionFlags(node) { + var flags = 0 /* Normal */; + switch (node.kind) { + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 150 /* MethodDeclaration */: + if (node.asteriskToken) { + flags |= 1 /* Generator */; + } + // falls through + case 186 /* ArrowFunction */: + if (hasModifier(node, 256 /* Async */)) { + flags |= 2 /* Async */; + } + break; + } + if (!node.body) { + flags |= 4 /* Invalid */; + } + return flags; } - ts.isAsyncFunctionLike = isAsyncFunctionLike; + ts.getFunctionFlags = getFunctionFlags; + function isAsyncFunction(node) { + switch (node.kind) { + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 150 /* MethodDeclaration */: + return node.body !== undefined + && node.asteriskToken === undefined + && hasModifier(node, 256 /* Async */); + } + return false; + } + ts.isAsyncFunction = isAsyncFunction; + function isNumericLiteral(node) { + return node.kind === 8 /* NumericLiteral */; + } + ts.isNumericLiteral = isNumericLiteral; function isStringOrNumericLiteral(node) { var kind = node.kind; return kind === 9 /* StringLiteral */ @@ -8135,7 +8441,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - return name.kind === 142 /* ComputedPropertyName */ && + return name.kind === 143 /* ComputedPropertyName */ && !isStringOrNumericLiteral(name.expression) && !isWellKnownSymbolSyntactically(name.expression); } @@ -8150,10 +8456,10 @@ var ts; } ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically; function getPropertyNameForPropertyNameNode(name) { - if (name.kind === 70 /* Identifier */ || name.kind === 9 /* StringLiteral */ || name.kind === 8 /* NumericLiteral */ || name.kind === 144 /* Parameter */) { + if (name.kind === 70 /* Identifier */ || name.kind === 9 /* StringLiteral */ || name.kind === 8 /* NumericLiteral */ || name.kind === 145 /* Parameter */) { return name.text; } - if (name.kind === 142 /* ComputedPropertyName */) { + if (name.kind === 143 /* ComputedPropertyName */) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { var rightHandSideName = nameExpression.name.text; @@ -8201,11 +8507,11 @@ var ts; ts.isModifierKind = isModifierKind; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 144 /* Parameter */; + return root.kind === 145 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 174 /* BindingElement */) { + while (node.kind === 175 /* BindingElement */) { node = node.parent.parent; } return node; @@ -8213,15 +8519,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 150 /* Constructor */ - || kind === 184 /* FunctionExpression */ - || kind === 225 /* FunctionDeclaration */ - || kind === 185 /* ArrowFunction */ - || kind === 149 /* MethodDeclaration */ - || kind === 151 /* GetAccessor */ - || kind === 152 /* SetAccessor */ - || kind === 230 /* ModuleDeclaration */ - || kind === 261 /* SourceFile */; + return kind === 151 /* Constructor */ + || kind === 185 /* FunctionExpression */ + || kind === 227 /* FunctionDeclaration */ + || kind === 186 /* ArrowFunction */ + || kind === 150 /* MethodDeclaration */ + || kind === 152 /* GetAccessor */ + || kind === 153 /* SetAccessor */ + || kind === 232 /* ModuleDeclaration */ + || kind === 264 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(node) { @@ -8229,49 +8535,22 @@ var ts; || ts.positionIsSynthesized(node.end); } ts.nodeIsSynthesized = nodeIsSynthesized; - function getOriginalNode(node, nodeTest) { - if (node) { - while (node.original !== undefined) { - node = node.original; - } + function getOriginalSourceFileOrBundle(sourceFileOrBundle) { + if (sourceFileOrBundle.kind === 265 /* Bundle */) { + return ts.updateBundle(sourceFileOrBundle, ts.sameMap(sourceFileOrBundle.sourceFiles, getOriginalSourceFile)); } - return !nodeTest || nodeTest(node) ? node : undefined; + return getOriginalSourceFile(sourceFileOrBundle); } - ts.getOriginalNode = getOriginalNode; - /** - * Gets a value indicating whether a node originated in the parse tree. - * - * @param node The node to test. - */ - function isParseTreeNode(node) { - return (node.flags & 8 /* Synthesized */) === 0; + ts.getOriginalSourceFileOrBundle = getOriginalSourceFileOrBundle; + function getOriginalSourceFile(sourceFile) { + return ts.getParseTreeNode(sourceFile, isSourceFile) || sourceFile; } - ts.isParseTreeNode = isParseTreeNode; - function getParseTreeNode(node, nodeTest) { - if (isParseTreeNode(node)) { - return node; - } - node = getOriginalNode(node); - if (isParseTreeNode(node) && (!nodeTest || nodeTest(node))) { - return node; - } - return undefined; - } - ts.getParseTreeNode = getParseTreeNode; function getOriginalSourceFiles(sourceFiles) { - var originalSourceFiles = []; - for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { - var sourceFile = sourceFiles_1[_i]; - var originalSourceFile = getParseTreeNode(sourceFile, isSourceFile); - if (originalSourceFile) { - originalSourceFiles.push(originalSourceFile); - } - } - return originalSourceFiles; + return ts.sameMap(sourceFiles, getOriginalSourceFile); } ts.getOriginalSourceFiles = getOriginalSourceFiles; function getOriginalNodeId(node) { - node = getOriginalNode(node); + node = ts.getOriginalNode(node); return node ? ts.getNodeId(node) : 0; } ts.getOriginalNodeId = getOriginalNodeId; @@ -8282,23 +8561,23 @@ var ts; })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 180 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 181 /* NewExpression */ && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 180 /* NewExpression */: + case 181 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 190 /* PrefixUnaryExpression */: - case 187 /* TypeOfExpression */: - case 188 /* VoidExpression */: - case 186 /* DeleteExpression */: - case 189 /* AwaitExpression */: - case 193 /* ConditionalExpression */: - case 195 /* YieldExpression */: + case 191 /* PrefixUnaryExpression */: + case 188 /* TypeOfExpression */: + case 189 /* VoidExpression */: + case 187 /* DeleteExpression */: + case 190 /* AwaitExpression */: + case 194 /* ConditionalExpression */: + case 196 /* YieldExpression */: return 1 /* Right */; - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: switch (operator) { case 39 /* AsteriskAsteriskToken */: case 57 /* EqualsToken */: @@ -8322,15 +8601,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 180 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 181 /* NewExpression */ && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 192 /* BinaryExpression */) { + if (expression.kind === 193 /* BinaryExpression */) { return expression.operatorToken.kind; } - else if (expression.kind === 190 /* PrefixUnaryExpression */ || expression.kind === 191 /* PostfixUnaryExpression */) { + else if (expression.kind === 191 /* PrefixUnaryExpression */ || expression.kind === 192 /* PostfixUnaryExpression */) { return expression.operator; } else { @@ -8348,37 +8627,36 @@ var ts; case 85 /* FalseKeyword */: case 8 /* NumericLiteral */: case 9 /* StringLiteral */: - case 175 /* ArrayLiteralExpression */: - case 176 /* ObjectLiteralExpression */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 197 /* ClassExpression */: - case 246 /* JsxElement */: - case 247 /* JsxSelfClosingElement */: + case 176 /* ArrayLiteralExpression */: + case 177 /* ObjectLiteralExpression */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 198 /* ClassExpression */: + case 248 /* JsxElement */: + case 249 /* JsxSelfClosingElement */: case 11 /* RegularExpressionLiteral */: case 12 /* NoSubstitutionTemplateLiteral */: - case 194 /* TemplateExpression */: - case 183 /* ParenthesizedExpression */: - case 198 /* OmittedExpression */: - case 297 /* RawExpression */: + case 195 /* TemplateExpression */: + case 184 /* ParenthesizedExpression */: + case 199 /* OmittedExpression */: return 19; - case 181 /* TaggedTemplateExpression */: - case 177 /* PropertyAccessExpression */: - case 178 /* ElementAccessExpression */: + case 182 /* TaggedTemplateExpression */: + case 178 /* PropertyAccessExpression */: + case 179 /* ElementAccessExpression */: return 18; - case 180 /* NewExpression */: + case 181 /* NewExpression */: return hasArguments ? 18 : 17; - case 179 /* CallExpression */: + case 180 /* CallExpression */: return 17; - case 191 /* PostfixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: return 16; - case 190 /* PrefixUnaryExpression */: - case 187 /* TypeOfExpression */: - case 188 /* VoidExpression */: - case 186 /* DeleteExpression */: - case 189 /* AwaitExpression */: + case 191 /* PrefixUnaryExpression */: + case 188 /* TypeOfExpression */: + case 189 /* VoidExpression */: + case 187 /* DeleteExpression */: + case 190 /* AwaitExpression */: return 15; - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: switch (operatorKind) { case 50 /* ExclamationToken */: case 51 /* TildeToken */: @@ -8436,11 +8714,11 @@ var ts; default: return -1; } - case 193 /* ConditionalExpression */: + case 194 /* ConditionalExpression */: return 4; - case 195 /* YieldExpression */: + case 196 /* YieldExpression */: return 2; - case 196 /* SpreadElement */: + case 197 /* SpreadElement */: return 1; default: return -1; @@ -8463,21 +8741,15 @@ var ts; return modificationCount; } function reattachFileDiagnostics(newFile) { - if (!ts.hasProperty(fileDiagnostics, newFile.fileName)) { - return; - } - for (var _i = 0, _a = fileDiagnostics[newFile.fileName]; _i < _a.length; _i++) { - var diagnostic = _a[_i]; - diagnostic.file = newFile; - } + ts.forEach(fileDiagnostics.get(newFile.fileName), function (diagnostic) { return diagnostic.file = newFile; }); } function add(diagnostic) { var diagnostics; if (diagnostic.file) { - diagnostics = fileDiagnostics[diagnostic.file.fileName]; + diagnostics = fileDiagnostics.get(diagnostic.file.fileName); if (!diagnostics) { diagnostics = []; - fileDiagnostics[diagnostic.file.fileName] = diagnostics; + fileDiagnostics.set(diagnostic.file.fileName, diagnostics); } } else { @@ -8494,16 +8766,16 @@ var ts; function getDiagnostics(fileName) { sortAndDeduplicate(); if (fileName) { - return fileDiagnostics[fileName] || []; + return fileDiagnostics.get(fileName) || []; } var allDiagnostics = []; function pushDiagnostic(d) { allDiagnostics.push(d); } ts.forEach(nonFileDiagnostics, pushDiagnostic); - for (var key in fileDiagnostics) { - ts.forEach(fileDiagnostics[key], pushDiagnostic); - } + fileDiagnostics.forEach(function (diagnostics) { + ts.forEach(diagnostics, pushDiagnostic); + }); return ts.sortAndDeduplicateDiagnostics(allDiagnostics); } function sortAndDeduplicate() { @@ -8512,9 +8784,9 @@ var ts; } diagnosticsModified = false; nonFileDiagnostics = ts.sortAndDeduplicateDiagnostics(nonFileDiagnostics); - for (var key in fileDiagnostics) { - fileDiagnostics[key] = ts.sortAndDeduplicateDiagnostics(fileDiagnostics[key]); - } + fileDiagnostics.forEach(function (diagnostics, key) { + fileDiagnostics.set(key, ts.sortAndDeduplicateDiagnostics(diagnostics)); + }); } } ts.createDiagnosticCollection = createDiagnosticCollection; @@ -8524,7 +8796,7 @@ var ts; // the map below must be updated. Note that this regexp *does not* include the 'delete' character. // There is no reason for this other than that JSON.stringify does not handle it either. var escapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; - var escapedCharsMap = ts.createMap({ + var escapedCharsMap = ts.createMapFromTemplate({ "\0": "\\0", "\t": "\\t", "\v": "\\v", @@ -8544,13 +8816,12 @@ var ts; * Note that this doesn't actually wrap the input in double quotes. */ function escapeString(s) { - s = escapedCharsRegExp.test(s) ? s.replace(escapedCharsRegExp, getReplacement) : s; - return s; - function getReplacement(c) { - return escapedCharsMap[c] || get16BitUnicodeEscapeSequence(c.charCodeAt(0)); - } + return s.replace(escapedCharsRegExp, getReplacement); } ts.escapeString = escapeString; + function getReplacement(c) { + return escapedCharsMap.get(c) || get16BitUnicodeEscapeSequence(c.charCodeAt(0)); + } function isIntrinsicJsxName(name) { var ch = name.substr(0, 1); return ch.toLowerCase() === ch; @@ -8707,168 +8978,77 @@ var ts; */ function getSourceFilesToEmit(host, targetSourceFile) { var options = host.getCompilerOptions(); + var isSourceFileFromExternalLibrary = function (file) { return host.isSourceFileFromExternalLibrary(file); }; if (options.outFile || options.out) { var moduleKind = ts.getEmitModuleKind(options); - var moduleEmitEnabled = moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System; - var sourceFiles = getAllEmittableSourceFiles(); + var moduleEmitEnabled_1 = moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System; // Can emit only sources that are not declaration file and are either non module code or module with --module or --target es6 specified - return ts.filter(sourceFiles, moduleEmitEnabled ? isNonDeclarationFile : isBundleEmitNonExternalModule); + return ts.filter(host.getSourceFiles(), function (sourceFile) { + return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) && sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary); + }); } else { - var sourceFiles = targetSourceFile === undefined ? getAllEmittableSourceFiles() : [targetSourceFile]; - return filterSourceFilesInDirectory(sourceFiles, function (file) { return host.isSourceFileFromExternalLibrary(file); }); - } - function getAllEmittableSourceFiles() { - return options.noEmitForJsFiles ? ts.filter(host.getSourceFiles(), function (sourceFile) { return !isSourceFileJavaScript(sourceFile); }) : host.getSourceFiles(); + var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile]; + return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary); }); } } ts.getSourceFilesToEmit = getSourceFilesToEmit; - /** Don't call this for `--outFile`, just for `--outDir` or plain emit. */ - function filterSourceFilesInDirectory(sourceFiles, isSourceFileFromExternalLibrary) { - return ts.filter(sourceFiles, function (file) { return shouldEmitInDirectory(file, isSourceFileFromExternalLibrary); }); - } - ts.filterSourceFilesInDirectory = filterSourceFilesInDirectory; - function isNonDeclarationFile(sourceFile) { - return !isDeclarationFile(sourceFile); + /** Don't call this for `--outFile`, just for `--outDir` or plain emit. `--outFile` needs additional checks. */ + function sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary) { + return !(options.noEmitForJsFiles && isSourceFileJavaScript(sourceFile)) && !isDeclarationFile(sourceFile) && !isSourceFileFromExternalLibrary(sourceFile); } + ts.sourceFileMayBeEmitted = sourceFileMayBeEmitted; /** - * Whether a file should be emitted in a non-`--outFile` case. - * Don't emit if source file is a declaration file, or was located under node_modules - */ - function shouldEmitInDirectory(sourceFile, isSourceFileFromExternalLibrary) { - return isNonDeclarationFile(sourceFile) && !isSourceFileFromExternalLibrary(sourceFile); - } - function isBundleEmitNonExternalModule(sourceFile) { - return isNonDeclarationFile(sourceFile) && !ts.isExternalModule(sourceFile); - } - /** - * Iterates over each source file to emit. The source files are expected to have been - * transformed for use by the pretty printer. - * - * Originally part of `forEachExpectedEmitFile`, this functionality was extracted to support - * transformations. + * Iterates over the source files that are expected to have an emit output. * * @param host An EmitHost. - * @param sourceFiles The transformed source files to emit. * @param action The action to execute. + * @param sourceFilesOrTargetSourceFile + * If an array, the full list of source files to emit. + * Else, calls `getSourceFilesToEmit` with the (optional) target source file to determine the list of source files to emit. */ - function forEachTransformedEmitFile(host, sourceFiles, action, emitOnlyDtsFiles) { + function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, emitOnlyDtsFiles) { + var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile); var options = host.getCompilerOptions(); - // Emit on each source file if (options.outFile || options.out) { - onBundledEmit(sourceFiles); - } - else { - for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) { - var sourceFile = sourceFiles_2[_i]; - // Don't emit if source file is a declaration file, or was located under node_modules - if (!isDeclarationFile(sourceFile) && !host.isSourceFileFromExternalLibrary(sourceFile)) { - onSingleFileEmit(host, sourceFile); - } - } - } - function onSingleFileEmit(host, sourceFile) { - // JavaScript files are always LanguageVariant.JSX, as JSX syntax is allowed in .js files also. - // So for JavaScript files, '.jsx' is only emitted if the input was '.jsx', and JsxEmit.Preserve. - // For TypeScript, the only time to emit with a '.jsx' extension, is on JSX input, and JsxEmit.Preserve - var extension = ".js"; - if (options.jsx === 1 /* Preserve */) { - if (isSourceFileJavaScript(sourceFile)) { - if (ts.fileExtensionIs(sourceFile.fileName, ".jsx")) { - extension = ".jsx"; - } - } - else if (sourceFile.languageVariant === 1 /* JSX */) { - // TypeScript source file preserving JSX syntax - extension = ".jsx"; - } - } - var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, extension); - var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); - var declarationFilePath = !isSourceFileJavaScript(sourceFile) && (options.declaration || emitOnlyDtsFiles) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; - action(jsFilePath, sourceMapFilePath, declarationFilePath, [sourceFile], /*isBundledEmit*/ false); - } - function onBundledEmit(sourceFiles) { if (sourceFiles.length) { var jsFilePath = options.outFile || options.out; var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); - var declarationFilePath = options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : undefined; - action(jsFilePath, sourceMapFilePath, declarationFilePath, sourceFiles, /*isBundledEmit*/ true); + var declarationFilePath = options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : ""; + action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, ts.createBundle(sourceFiles), emitOnlyDtsFiles); + } + } + else { + for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { + var sourceFile = sourceFiles_1[_i]; + var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, getOutputExtension(sourceFile, options)); + var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); + var declarationFilePath = !isSourceFileJavaScript(sourceFile) && (emitOnlyDtsFiles || options.declaration) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; + action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, sourceFile, emitOnlyDtsFiles); } } } - ts.forEachTransformedEmitFile = forEachTransformedEmitFile; + ts.forEachEmittedFile = forEachEmittedFile; function getSourceMapFilePath(jsFilePath, options) { return options.sourceMap ? jsFilePath + ".map" : undefined; } - /** - * Iterates over the source files that are expected to have an emit output. This function - * is used by the legacy emitter and the declaration emitter and should not be used by - * the tree transforming emitter. - * - * @param host An EmitHost. - * @param action The action to execute. - * @param targetSourceFile An optional target source file to emit. - */ - function forEachExpectedEmitFile(host, action, targetSourceFile, emitOnlyDtsFiles) { - var options = host.getCompilerOptions(); - // Emit on each source file - if (options.outFile || options.out) { - onBundledEmit(host); - } - else { - var sourceFiles = targetSourceFile === undefined ? getSourceFilesToEmit(host) : [targetSourceFile]; - for (var _i = 0, sourceFiles_3 = sourceFiles; _i < sourceFiles_3.length; _i++) { - var sourceFile = sourceFiles_3[_i]; - if (shouldEmitInDirectory(sourceFile, function (file) { return host.isSourceFileFromExternalLibrary(file); })) { - onSingleFileEmit(host, sourceFile); + // JavaScript files are always LanguageVariant.JSX, as JSX syntax is allowed in .js files also. + // So for JavaScript files, '.jsx' is only emitted if the input was '.jsx', and JsxEmit.Preserve. + // For TypeScript, the only time to emit with a '.jsx' extension, is on JSX input, and JsxEmit.Preserve + function getOutputExtension(sourceFile, options) { + if (options.jsx === 1 /* Preserve */) { + if (isSourceFileJavaScript(sourceFile)) { + if (ts.fileExtensionIs(sourceFile.fileName, ".jsx")) { + return ".jsx"; } } - } - function onSingleFileEmit(host, sourceFile) { - // JavaScript files are always LanguageVariant.JSX, as JSX syntax is allowed in .js files also. - // So for JavaScript files, '.jsx' is only emitted if the input was '.jsx', and JsxEmit.Preserve. - // For TypeScript, the only time to emit with a '.jsx' extension, is on JSX input, and JsxEmit.Preserve - var extension = ".js"; - if (options.jsx === 1 /* Preserve */) { - if (isSourceFileJavaScript(sourceFile)) { - if (ts.fileExtensionIs(sourceFile.fileName, ".jsx")) { - extension = ".jsx"; - } - } - else if (sourceFile.languageVariant === 1 /* JSX */) { - // TypeScript source file preserving JSX syntax - extension = ".jsx"; - } - } - var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, extension); - var declarationFilePath = !isSourceFileJavaScript(sourceFile) && (emitOnlyDtsFiles || options.declaration) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; - var emitFileNames = { - jsFilePath: jsFilePath, - sourceMapFilePath: getSourceMapFilePath(jsFilePath, options), - declarationFilePath: declarationFilePath - }; - action(emitFileNames, [sourceFile], /*isBundledEmit*/ false, emitOnlyDtsFiles); - } - function onBundledEmit(host) { - // Can emit only sources that are not declaration file and are either non module code or module with - // --module or --target es6 specified. Files included by searching under node_modules are also not emitted. - var bundledSources = ts.filter(getSourceFilesToEmit(host), function (sourceFile) { return !isDeclarationFile(sourceFile) && - !host.isSourceFileFromExternalLibrary(sourceFile) && - (!ts.isExternalModule(sourceFile) || - !!ts.getEmitModuleKind(options)); }); - if (bundledSources.length) { - var jsFilePath = options.outFile || options.out; - var emitFileNames = { - jsFilePath: jsFilePath, - sourceMapFilePath: getSourceMapFilePath(jsFilePath, options), - declarationFilePath: options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : undefined - }; - action(emitFileNames, bundledSources, /*isBundledEmit*/ true, emitOnlyDtsFiles); + else if (sourceFile.languageVariant === 1 /* JSX */) { + // TypeScript source file preserving JSX syntax + return ".jsx"; } } + return ".js"; } - ts.forEachExpectedEmitFile = forEachExpectedEmitFile; function getSourceFilePathInNewDir(sourceFile, host, newDirPath) { var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory()); var commonSourceDirectory = host.getCommonSourceDirectory(); @@ -8893,7 +9073,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 150 /* Constructor */ && nodeIsPresent(member.body)) { + if (member.kind === 151 /* Constructor */ && nodeIsPresent(member.body)) { return member; } }); @@ -8935,10 +9115,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 151 /* GetAccessor */) { + if (accessor.kind === 152 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 152 /* SetAccessor */) { + else if (accessor.kind === 153 /* SetAccessor */) { setAccessor = accessor; } else { @@ -8947,7 +9127,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 151 /* GetAccessor */ || member.kind === 152 /* SetAccessor */) + if ((member.kind === 152 /* GetAccessor */ || member.kind === 153 /* SetAccessor */) && hasModifier(member, 32 /* Static */) === hasModifier(accessor, 32 /* Static */)) { var memberName = getPropertyNameForPropertyNameNode(member.name); var accessorName = getPropertyNameForPropertyNameNode(accessor.name); @@ -8958,10 +9138,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 151 /* GetAccessor */ && !getAccessor) { + if (member.kind === 152 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 152 /* SetAccessor */ && !setAccessor) { + if (member.kind === 153 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -9224,7 +9404,7 @@ var ts; ts.isAssignmentOperator = isAssignmentOperator; /** Get `C` given `N` if `N` is in the position `class C extends N` where `N` is an ExpressionWithTypeArguments. */ function tryGetClassExtendingExpressionWithTypeArguments(node) { - if (node.kind === 199 /* ExpressionWithTypeArguments */ && + if (node.kind === 200 /* ExpressionWithTypeArguments */ && node.parent.token === 84 /* ExtendsKeyword */ && isClassLike(node.parent.parent)) { return node.parent.parent; @@ -9242,8 +9422,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 176 /* ObjectLiteralExpression */ - || kind === 175 /* ArrayLiteralExpression */; + return kind === 177 /* ObjectLiteralExpression */ + || kind === 176 /* ArrayLiteralExpression */; } return false; } @@ -9269,31 +9449,42 @@ var ts; return tryGetClassExtendingExpressionWithTypeArguments(node) !== undefined; } ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause; + function isExpressionWithTypeArgumentsInClassImplementsClause(node) { + return node.kind === 200 /* ExpressionWithTypeArguments */ + && isEntityNameExpression(node.expression) + && node.parent + && node.parent.token === 107 /* ImplementsKeyword */ + && node.parent.parent + && isClassLike(node.parent.parent); + } + ts.isExpressionWithTypeArgumentsInClassImplementsClause = isExpressionWithTypeArgumentsInClassImplementsClause; function isEntityNameExpression(node) { return node.kind === 70 /* Identifier */ || - node.kind === 177 /* PropertyAccessExpression */ && isEntityNameExpression(node.expression); + node.kind === 178 /* PropertyAccessExpression */ && isEntityNameExpression(node.expression); } ts.isEntityNameExpression = isEntityNameExpression; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 141 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 177 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 142 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 178 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; - function isEmptyObjectLiteralOrArrayLiteral(expression) { - var kind = expression.kind; - if (kind === 176 /* ObjectLiteralExpression */) { - return expression.properties.length === 0; - } - if (kind === 175 /* ArrayLiteralExpression */) { - return expression.elements.length === 0; - } - return false; + function isEmptyObjectLiteral(expression) { + return expression.kind === 177 /* ObjectLiteralExpression */ && + expression.properties.length === 0; } - ts.isEmptyObjectLiteralOrArrayLiteral = isEmptyObjectLiteralOrArrayLiteral; + ts.isEmptyObjectLiteral = isEmptyObjectLiteral; + function isEmptyArrayLiteral(expression) { + return expression.kind === 176 /* ArrayLiteralExpression */ && + expression.elements.length === 0; + } + ts.isEmptyArrayLiteral = isEmptyArrayLiteral; function getLocalSymbolForExportDefault(symbol) { - return symbol && symbol.valueDeclaration && hasModifier(symbol.valueDeclaration, 512 /* Default */) ? symbol.valueDeclaration.localSymbol : undefined; + return isExportDefaultSymbol(symbol) ? symbol.valueDeclaration.localSymbol : undefined; } ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; + function isExportDefaultSymbol(symbol) { + return symbol && symbol.valueDeclaration && hasModifier(symbol.valueDeclaration, 512 /* Default */); + } /** Return ".ts", ".d.ts", or ".tsx", if that is the extension. */ function tryExtractTypeScriptExtension(fileName) { return ts.find(ts.supportedTypescriptExtensionsForExtractExtension, function (extension) { return ts.fileExtensionIs(fileName, extension); }); @@ -9333,47 +9524,6 @@ var ts; } return output; } - /** - * Serialize an object graph into a JSON string. This is intended only for use on an acyclic graph - * as the fallback implementation does not check for circular references by default. - */ - ts.stringify = typeof JSON !== "undefined" && JSON.stringify - ? JSON.stringify - : stringifyFallback; - /** - * Serialize an object graph into a JSON string. - */ - function stringifyFallback(value) { - // JSON.stringify returns `undefined` here, instead of the string "undefined". - return value === undefined ? undefined : stringifyValue(value); - } - function stringifyValue(value) { - return typeof value === "string" ? "\"" + escapeString(value) + "\"" - : typeof value === "number" ? isFinite(value) ? String(value) : "null" - : typeof value === "boolean" ? value ? "true" : "false" - : typeof value === "object" && value ? ts.isArray(value) ? cycleCheck(stringifyArray, value) : cycleCheck(stringifyObject, value) - : "null"; - } - function cycleCheck(cb, value) { - ts.Debug.assert(!value.hasOwnProperty("__cycle"), "Converting circular structure to JSON"); - value.__cycle = true; - var result = cb(value); - delete value.__cycle; - return result; - } - function stringifyArray(value) { - return "[" + ts.reduceLeft(value, stringifyElement, "") + "]"; - } - function stringifyElement(memo, value) { - return (memo ? memo + "," : memo) + stringifyValue(value); - } - function stringifyObject(value) { - return "{" + ts.reduceOwnProperties(value, stringifyProperty, "") + "}"; - } - function stringifyProperty(memo, value, key) { - return value === undefined || typeof value === "function" || key === "__cycle" ? memo - : (memo ? memo + "," : memo) + ("\"" + escapeString(key) + "\":" + stringifyValue(value)); - } var base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; /** * Converts a string to a base-64 encoded ASCII string. @@ -9446,39 +9596,39 @@ var ts; || kind === 94 /* NullKeyword */) { return true; } - else if (kind === 177 /* PropertyAccessExpression */) { + else if (kind === 178 /* PropertyAccessExpression */) { return isSimpleExpressionWorker(node.expression, depth + 1); } - else if (kind === 178 /* ElementAccessExpression */) { + else if (kind === 179 /* ElementAccessExpression */) { return isSimpleExpressionWorker(node.expression, depth + 1) && isSimpleExpressionWorker(node.argumentExpression, depth + 1); } - else if (kind === 190 /* PrefixUnaryExpression */ - || kind === 191 /* PostfixUnaryExpression */) { + else if (kind === 191 /* PrefixUnaryExpression */ + || kind === 192 /* PostfixUnaryExpression */) { return isSimpleExpressionWorker(node.operand, depth + 1); } - else if (kind === 192 /* BinaryExpression */) { + else if (kind === 193 /* BinaryExpression */) { return node.operatorToken.kind !== 39 /* AsteriskAsteriskToken */ && isSimpleExpressionWorker(node.left, depth + 1) && isSimpleExpressionWorker(node.right, depth + 1); } - else if (kind === 193 /* ConditionalExpression */) { + else if (kind === 194 /* ConditionalExpression */) { return isSimpleExpressionWorker(node.condition, depth + 1) && isSimpleExpressionWorker(node.whenTrue, depth + 1) && isSimpleExpressionWorker(node.whenFalse, depth + 1); } - else if (kind === 188 /* VoidExpression */ - || kind === 187 /* TypeOfExpression */ - || kind === 186 /* DeleteExpression */) { + else if (kind === 189 /* VoidExpression */ + || kind === 188 /* TypeOfExpression */ + || kind === 187 /* DeleteExpression */) { return isSimpleExpressionWorker(node.expression, depth + 1); } - else if (kind === 175 /* ArrayLiteralExpression */) { + else if (kind === 176 /* ArrayLiteralExpression */) { return node.elements.length === 0; } - else if (kind === 176 /* ObjectLiteralExpression */) { + else if (kind === 177 /* ObjectLiteralExpression */) { return node.properties.length === 0; } - else if (kind === 179 /* CallExpression */) { + else if (kind === 180 /* CallExpression */) { if (!isSimpleExpressionWorker(node.expression, depth + 1)) { return false; } @@ -9493,16 +9643,19 @@ var ts; } return false; } - var syntaxKindCache = ts.createMap(); + var syntaxKindCache = []; function formatSyntaxKind(kind) { var syntaxKindEnum = ts.SyntaxKind; if (syntaxKindEnum) { - if (syntaxKindCache[kind]) { - return syntaxKindCache[kind]; + var cached = syntaxKindCache[kind]; + if (cached !== undefined) { + return cached; } - for (var name_7 in syntaxKindEnum) { - if (syntaxKindEnum[name_7] === kind) { - return syntaxKindCache[kind] = kind.toString() + " (" + name_7 + ")"; + for (var name in syntaxKindEnum) { + if (syntaxKindEnum[name] === kind) { + var result = kind + " (" + name + ")"; + syntaxKindCache[kind] = result; + return result; } } } @@ -9511,6 +9664,14 @@ var ts; } } ts.formatSyntaxKind = formatSyntaxKind; + function getRangePos(range) { + return range ? range.pos : -1; + } + ts.getRangePos = getRangePos; + function getRangeEnd(range) { + return range ? range.end : -1; + } + ts.getRangeEnd = getRangeEnd; /** * Increases (or decreases) a position by the provided amount. * @@ -9642,11 +9803,11 @@ var ts; * declaration. */ function isDeclarationNameOfEnumOrNamespace(node) { - var parseNode = getParseTreeNode(node); + var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 229 /* EnumDeclaration */: - case 230 /* ModuleDeclaration */: + case 231 /* EnumDeclaration */: + case 232 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -9667,7 +9828,7 @@ var ts; if (node.symbol) { for (var _i = 0, _a = node.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 226 /* ClassDeclaration */ && declaration !== node) { + if (declaration.kind === 228 /* ClassDeclaration */ && declaration !== node) { return true; } } @@ -9732,6 +9893,10 @@ var ts; return node.kind === 70 /* Identifier */; } ts.isIdentifier = isIdentifier; + function isVoidExpression(node) { + return node.kind === 189 /* VoidExpression */; + } + ts.isVoidExpression = isVoidExpression; function isGeneratedIdentifier(node) { // Using `>` here catches both `GeneratedIdentifierKind.None` and `undefined`. return isIdentifier(node) && node.autoGenerateKind > 0 /* None */; @@ -9744,16 +9909,16 @@ var ts; ts.isModifier = isModifier; // Names function isQualifiedName(node) { - return node.kind === 141 /* QualifiedName */; + return node.kind === 142 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 142 /* ComputedPropertyName */; + return node.kind === 143 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; function isEntityName(node) { var kind = node.kind; - return kind === 141 /* QualifiedName */ + return kind === 142 /* QualifiedName */ || kind === 70 /* Identifier */; } ts.isEntityName = isEntityName; @@ -9762,7 +9927,7 @@ var ts; return kind === 70 /* Identifier */ || kind === 9 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 142 /* ComputedPropertyName */; + || kind === 143 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isModuleName(node) { @@ -9774,61 +9939,65 @@ var ts; function isBindingName(node) { var kind = node.kind; return kind === 70 /* Identifier */ - || kind === 172 /* ObjectBindingPattern */ - || kind === 173 /* ArrayBindingPattern */; + || kind === 173 /* ObjectBindingPattern */ + || kind === 174 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Signature elements function isTypeParameter(node) { - return node.kind === 143 /* TypeParameter */; + return node.kind === 144 /* TypeParameter */; } ts.isTypeParameter = isTypeParameter; function isParameter(node) { - return node.kind === 144 /* Parameter */; + return node.kind === 145 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 145 /* Decorator */; + return node.kind === 146 /* Decorator */; } ts.isDecorator = isDecorator; // Type members function isMethodDeclaration(node) { - return node.kind === 149 /* MethodDeclaration */; + return node.kind === 150 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isClassElement(node) { var kind = node.kind; - return kind === 150 /* Constructor */ - || kind === 147 /* PropertyDeclaration */ - || kind === 149 /* MethodDeclaration */ - || kind === 151 /* GetAccessor */ - || kind === 152 /* SetAccessor */ - || kind === 155 /* IndexSignature */ - || kind === 203 /* SemicolonClassElement */; + return kind === 151 /* Constructor */ + || kind === 148 /* PropertyDeclaration */ + || kind === 150 /* MethodDeclaration */ + || kind === 152 /* GetAccessor */ + || kind === 153 /* SetAccessor */ + || kind === 156 /* IndexSignature */ + || kind === 205 /* SemicolonClassElement */; } ts.isClassElement = isClassElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 257 /* PropertyAssignment */ - || kind === 258 /* ShorthandPropertyAssignment */ - || kind === 259 /* SpreadAssignment */ - || kind === 149 /* MethodDeclaration */ - || kind === 151 /* GetAccessor */ - || kind === 152 /* SetAccessor */ - || kind === 244 /* MissingDeclaration */; + return kind === 260 /* PropertyAssignment */ + || kind === 261 /* ShorthandPropertyAssignment */ + || kind === 262 /* SpreadAssignment */ + || kind === 150 /* MethodDeclaration */ + || kind === 152 /* GetAccessor */ + || kind === 153 /* SetAccessor */ + || kind === 246 /* MissingDeclaration */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type function isTypeNodeKind(kind) { - return (kind >= 156 /* FirstTypeNode */ && kind <= 171 /* LastTypeNode */) + return (kind >= 157 /* FirstTypeNode */ && kind <= 172 /* LastTypeNode */) || kind === 118 /* AnyKeyword */ || kind === 132 /* NumberKeyword */ + || kind === 133 /* ObjectKeyword */ || kind === 121 /* BooleanKeyword */ - || kind === 134 /* StringKeyword */ - || kind === 135 /* SymbolKeyword */ + || kind === 135 /* StringKeyword */ + || kind === 136 /* SymbolKeyword */ + || kind === 98 /* ThisKeyword */ || kind === 104 /* VoidKeyword */ + || kind === 138 /* UndefinedKeyword */ + || kind === 94 /* NullKeyword */ || kind === 129 /* NeverKeyword */ - || kind === 199 /* ExpressionWithTypeArguments */; + || kind === 200 /* ExpressionWithTypeArguments */; } /** * Node test that determines whether a node is a valid type node. @@ -9841,36 +10010,36 @@ var ts; ts.isTypeNode = isTypeNode; // Binding patterns function isArrayBindingPattern(node) { - return node.kind === 173 /* ArrayBindingPattern */; + return node.kind === 174 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isObjectBindingPattern(node) { - return node.kind === 172 /* ObjectBindingPattern */; + return node.kind === 173 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 173 /* ArrayBindingPattern */ - || kind === 172 /* ObjectBindingPattern */; + return kind === 174 /* ArrayBindingPattern */ + || kind === 173 /* ObjectBindingPattern */; } return false; } ts.isBindingPattern = isBindingPattern; function isAssignmentPattern(node) { var kind = node.kind; - return kind === 175 /* ArrayLiteralExpression */ - || kind === 176 /* ObjectLiteralExpression */; + return kind === 176 /* ArrayLiteralExpression */ + || kind === 177 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; function isBindingElement(node) { - return node.kind === 174 /* BindingElement */; + return node.kind === 175 /* BindingElement */; } ts.isBindingElement = isBindingElement; function isArrayBindingElement(node) { var kind = node.kind; - return kind === 174 /* BindingElement */ - || kind === 198 /* OmittedExpression */; + return kind === 175 /* BindingElement */ + || kind === 199 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -9878,9 +10047,9 @@ var ts; */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 223 /* VariableDeclaration */: - case 144 /* Parameter */: - case 174 /* BindingElement */: + case 225 /* VariableDeclaration */: + case 145 /* Parameter */: + case 175 /* BindingElement */: return true; } return false; @@ -9899,8 +10068,8 @@ var ts; */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 172 /* ObjectBindingPattern */: - case 176 /* ObjectLiteralExpression */: + case 173 /* ObjectBindingPattern */: + case 177 /* ObjectLiteralExpression */: return true; } return false; @@ -9911,8 +10080,8 @@ var ts; */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 173 /* ArrayBindingPattern */: - case 175 /* ArrayLiteralExpression */: + case 174 /* ArrayBindingPattern */: + case 176 /* ArrayLiteralExpression */: return true; } return false; @@ -9920,86 +10089,92 @@ var ts; ts.isArrayBindingOrAssignmentPattern = isArrayBindingOrAssignmentPattern; // Expression function isArrayLiteralExpression(node) { - return node.kind === 175 /* ArrayLiteralExpression */; + return node.kind === 176 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 176 /* ObjectLiteralExpression */; + return node.kind === 177 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 177 /* PropertyAccessExpression */; + return node.kind === 178 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; + function isPropertyAccessOrQualifiedName(node) { + var kind = node.kind; + return kind === 178 /* PropertyAccessExpression */ + || kind === 142 /* QualifiedName */; + } + ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isElementAccessExpression(node) { - return node.kind === 178 /* ElementAccessExpression */; + return node.kind === 179 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isBinaryExpression(node) { - return node.kind === 192 /* BinaryExpression */; + return node.kind === 193 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 193 /* ConditionalExpression */; + return node.kind === 194 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isCallExpression(node) { - return node.kind === 179 /* CallExpression */; + return node.kind === 180 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 194 /* TemplateExpression */ + return kind === 195 /* TemplateExpression */ || kind === 12 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; function isSpreadExpression(node) { - return node.kind === 196 /* SpreadElement */; + return node.kind === 197 /* SpreadElement */; } ts.isSpreadExpression = isSpreadExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 199 /* ExpressionWithTypeArguments */; + return node.kind === 200 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isLeftHandSideExpressionKind(kind) { - return kind === 177 /* PropertyAccessExpression */ - || kind === 178 /* ElementAccessExpression */ - || kind === 180 /* NewExpression */ - || kind === 179 /* CallExpression */ - || kind === 246 /* JsxElement */ - || kind === 247 /* JsxSelfClosingElement */ - || kind === 181 /* TaggedTemplateExpression */ - || kind === 175 /* ArrayLiteralExpression */ - || kind === 183 /* ParenthesizedExpression */ - || kind === 176 /* ObjectLiteralExpression */ - || kind === 197 /* ClassExpression */ - || kind === 184 /* FunctionExpression */ + return kind === 178 /* PropertyAccessExpression */ + || kind === 179 /* ElementAccessExpression */ + || kind === 181 /* NewExpression */ + || kind === 180 /* CallExpression */ + || kind === 248 /* JsxElement */ + || kind === 249 /* JsxSelfClosingElement */ + || kind === 182 /* TaggedTemplateExpression */ + || kind === 176 /* ArrayLiteralExpression */ + || kind === 184 /* ParenthesizedExpression */ + || kind === 177 /* ObjectLiteralExpression */ + || kind === 198 /* ClassExpression */ + || kind === 185 /* FunctionExpression */ || kind === 70 /* Identifier */ || kind === 11 /* RegularExpressionLiteral */ || kind === 8 /* NumericLiteral */ || kind === 9 /* StringLiteral */ || kind === 12 /* NoSubstitutionTemplateLiteral */ - || kind === 194 /* TemplateExpression */ + || kind === 195 /* TemplateExpression */ || kind === 85 /* FalseKeyword */ || kind === 94 /* NullKeyword */ || kind === 98 /* ThisKeyword */ || kind === 100 /* TrueKeyword */ || kind === 96 /* SuperKeyword */ - || kind === 201 /* NonNullExpression */ - || kind === 297 /* RawExpression */; + || kind === 202 /* NonNullExpression */ + || kind === 203 /* MetaProperty */; } function isLeftHandSideExpression(node) { return isLeftHandSideExpressionKind(ts.skipPartiallyEmittedExpressions(node).kind); } ts.isLeftHandSideExpression = isLeftHandSideExpression; function isUnaryExpressionKind(kind) { - return kind === 190 /* PrefixUnaryExpression */ - || kind === 191 /* PostfixUnaryExpression */ - || kind === 186 /* DeleteExpression */ - || kind === 187 /* TypeOfExpression */ - || kind === 188 /* VoidExpression */ - || kind === 189 /* AwaitExpression */ - || kind === 182 /* TypeAssertionExpression */ + return kind === 191 /* PrefixUnaryExpression */ + || kind === 192 /* PostfixUnaryExpression */ + || kind === 187 /* DeleteExpression */ + || kind === 188 /* TypeOfExpression */ + || kind === 189 /* VoidExpression */ + || kind === 190 /* AwaitExpression */ + || kind === 183 /* TypeAssertionExpression */ || isLeftHandSideExpressionKind(kind); } function isUnaryExpression(node) { @@ -10007,14 +10182,13 @@ var ts; } ts.isUnaryExpression = isUnaryExpression; function isExpressionKind(kind) { - return kind === 193 /* ConditionalExpression */ - || kind === 195 /* YieldExpression */ - || kind === 185 /* ArrowFunction */ - || kind === 192 /* BinaryExpression */ - || kind === 196 /* SpreadElement */ - || kind === 200 /* AsExpression */ - || kind === 198 /* OmittedExpression */ - || kind === 297 /* RawExpression */ + return kind === 194 /* ConditionalExpression */ + || kind === 196 /* YieldExpression */ + || kind === 186 /* ArrowFunction */ + || kind === 193 /* BinaryExpression */ + || kind === 197 /* SpreadElement */ + || kind === 201 /* AsExpression */ + || kind === 199 /* OmittedExpression */ || isUnaryExpressionKind(kind); } function isExpression(node) { @@ -10023,16 +10197,16 @@ var ts; ts.isExpression = isExpression; function isAssertionExpression(node) { var kind = node.kind; - return kind === 182 /* TypeAssertionExpression */ - || kind === 200 /* AsExpression */; + return kind === 183 /* TypeAssertionExpression */ + || kind === 201 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; function isPartiallyEmittedExpression(node) { - return node.kind === 294 /* PartiallyEmittedExpression */; + return node.kind === 295 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; function isNotEmittedStatement(node) { - return node.kind === 293 /* NotEmittedStatement */; + return node.kind === 294 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; function isNotEmittedOrPartiallyEmittedNode(node) { @@ -10041,17 +10215,17 @@ var ts; } ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isOmittedExpression(node) { - return node.kind === 198 /* OmittedExpression */; + return node.kind === 199 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; // Misc function isTemplateSpan(node) { - return node.kind === 202 /* TemplateSpan */; + return node.kind === 204 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; // Element function isBlock(node) { - return node.kind === 204 /* Block */; + return node.kind === 206 /* Block */; } ts.isBlock = isBlock; function isConciseBody(node) { @@ -10069,121 +10243,135 @@ var ts; } ts.isForInitializer = isForInitializer; function isVariableDeclaration(node) { - return node.kind === 223 /* VariableDeclaration */; + return node.kind === 225 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 224 /* VariableDeclarationList */; + return node.kind === 226 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isCaseBlock(node) { - return node.kind === 232 /* CaseBlock */; + return node.kind === 234 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isModuleBody(node) { var kind = node.kind; - return kind === 231 /* ModuleBlock */ - || kind === 230 /* ModuleDeclaration */; + return kind === 233 /* ModuleBlock */ + || kind === 232 /* ModuleDeclaration */ + || kind === 70 /* Identifier */; } ts.isModuleBody = isModuleBody; + function isNamespaceBody(node) { + var kind = node.kind; + return kind === 233 /* ModuleBlock */ + || kind === 232 /* ModuleDeclaration */; + } + ts.isNamespaceBody = isNamespaceBody; + function isJSDocNamespaceBody(node) { + var kind = node.kind; + return kind === 70 /* Identifier */ + || kind === 232 /* ModuleDeclaration */; + } + ts.isJSDocNamespaceBody = isJSDocNamespaceBody; function isImportEqualsDeclaration(node) { - return node.kind === 234 /* ImportEqualsDeclaration */; + return node.kind === 236 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportClause(node) { - return node.kind === 236 /* ImportClause */; + return node.kind === 238 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamedImportBindings(node) { var kind = node.kind; - return kind === 238 /* NamedImports */ - || kind === 237 /* NamespaceImport */; + return kind === 240 /* NamedImports */ + || kind === 239 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; function isImportSpecifier(node) { - return node.kind === 239 /* ImportSpecifier */; + return node.kind === 241 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isNamedExports(node) { - return node.kind === 242 /* NamedExports */; + return node.kind === 244 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 243 /* ExportSpecifier */; + return node.kind === 245 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isModuleOrEnumDeclaration(node) { - return node.kind === 230 /* ModuleDeclaration */ || node.kind === 229 /* EnumDeclaration */; + return node.kind === 232 /* ModuleDeclaration */ || node.kind === 231 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 185 /* ArrowFunction */ - || kind === 174 /* BindingElement */ - || kind === 226 /* ClassDeclaration */ - || kind === 197 /* ClassExpression */ - || kind === 150 /* Constructor */ - || kind === 229 /* EnumDeclaration */ - || kind === 260 /* EnumMember */ - || kind === 243 /* ExportSpecifier */ - || kind === 225 /* FunctionDeclaration */ - || kind === 184 /* FunctionExpression */ - || kind === 151 /* GetAccessor */ - || kind === 236 /* ImportClause */ - || kind === 234 /* ImportEqualsDeclaration */ - || kind === 239 /* ImportSpecifier */ - || kind === 227 /* InterfaceDeclaration */ - || kind === 149 /* MethodDeclaration */ - || kind === 148 /* MethodSignature */ - || kind === 230 /* ModuleDeclaration */ - || kind === 233 /* NamespaceExportDeclaration */ - || kind === 237 /* NamespaceImport */ - || kind === 144 /* Parameter */ - || kind === 257 /* PropertyAssignment */ - || kind === 147 /* PropertyDeclaration */ - || kind === 146 /* PropertySignature */ - || kind === 152 /* SetAccessor */ - || kind === 258 /* ShorthandPropertyAssignment */ - || kind === 228 /* TypeAliasDeclaration */ - || kind === 143 /* TypeParameter */ - || kind === 223 /* VariableDeclaration */ - || kind === 285 /* JSDocTypedefTag */; + return kind === 186 /* ArrowFunction */ + || kind === 175 /* BindingElement */ + || kind === 228 /* ClassDeclaration */ + || kind === 198 /* ClassExpression */ + || kind === 151 /* Constructor */ + || kind === 231 /* EnumDeclaration */ + || kind === 263 /* EnumMember */ + || kind === 245 /* ExportSpecifier */ + || kind === 227 /* FunctionDeclaration */ + || kind === 185 /* FunctionExpression */ + || kind === 152 /* GetAccessor */ + || kind === 238 /* ImportClause */ + || kind === 236 /* ImportEqualsDeclaration */ + || kind === 241 /* ImportSpecifier */ + || kind === 229 /* InterfaceDeclaration */ + || kind === 252 /* JsxAttribute */ + || kind === 150 /* MethodDeclaration */ + || kind === 149 /* MethodSignature */ + || kind === 232 /* ModuleDeclaration */ + || kind === 235 /* NamespaceExportDeclaration */ + || kind === 239 /* NamespaceImport */ + || kind === 145 /* Parameter */ + || kind === 260 /* PropertyAssignment */ + || kind === 148 /* PropertyDeclaration */ + || kind === 147 /* PropertySignature */ + || kind === 153 /* SetAccessor */ + || kind === 261 /* ShorthandPropertyAssignment */ + || kind === 230 /* TypeAliasDeclaration */ + || kind === 144 /* TypeParameter */ + || kind === 225 /* VariableDeclaration */ + || kind === 289 /* JSDocTypedefTag */; } function isDeclarationStatementKind(kind) { - return kind === 225 /* FunctionDeclaration */ - || kind === 244 /* MissingDeclaration */ - || kind === 226 /* ClassDeclaration */ - || kind === 227 /* InterfaceDeclaration */ - || kind === 228 /* TypeAliasDeclaration */ - || kind === 229 /* EnumDeclaration */ - || kind === 230 /* ModuleDeclaration */ - || kind === 235 /* ImportDeclaration */ - || kind === 234 /* ImportEqualsDeclaration */ - || kind === 241 /* ExportDeclaration */ - || kind === 240 /* ExportAssignment */ - || kind === 233 /* NamespaceExportDeclaration */; + return kind === 227 /* FunctionDeclaration */ + || kind === 246 /* MissingDeclaration */ + || kind === 228 /* ClassDeclaration */ + || kind === 229 /* InterfaceDeclaration */ + || kind === 230 /* TypeAliasDeclaration */ + || kind === 231 /* EnumDeclaration */ + || kind === 232 /* ModuleDeclaration */ + || kind === 237 /* ImportDeclaration */ + || kind === 236 /* ImportEqualsDeclaration */ + || kind === 243 /* ExportDeclaration */ + || kind === 242 /* ExportAssignment */ + || kind === 235 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 215 /* BreakStatement */ - || kind === 214 /* ContinueStatement */ - || kind === 222 /* DebuggerStatement */ - || kind === 209 /* DoStatement */ - || kind === 207 /* ExpressionStatement */ - || kind === 206 /* EmptyStatement */ - || kind === 212 /* ForInStatement */ - || kind === 213 /* ForOfStatement */ - || kind === 211 /* ForStatement */ - || kind === 208 /* IfStatement */ - || kind === 219 /* LabeledStatement */ - || kind === 216 /* ReturnStatement */ - || kind === 218 /* SwitchStatement */ - || kind === 220 /* ThrowStatement */ - || kind === 221 /* TryStatement */ - || kind === 205 /* VariableStatement */ - || kind === 210 /* WhileStatement */ - || kind === 217 /* WithStatement */ - || kind === 293 /* NotEmittedStatement */ - || kind === 296 /* EndOfDeclarationMarker */ - || kind === 295 /* MergeDeclarationMarker */; + return kind === 217 /* BreakStatement */ + || kind === 216 /* ContinueStatement */ + || kind === 224 /* DebuggerStatement */ + || kind === 211 /* DoStatement */ + || kind === 209 /* ExpressionStatement */ + || kind === 208 /* EmptyStatement */ + || kind === 214 /* ForInStatement */ + || kind === 215 /* ForOfStatement */ + || kind === 213 /* ForStatement */ + || kind === 210 /* IfStatement */ + || kind === 221 /* LabeledStatement */ + || kind === 218 /* ReturnStatement */ + || kind === 220 /* SwitchStatement */ + || kind === 222 /* ThrowStatement */ + || kind === 223 /* TryStatement */ + || kind === 207 /* VariableStatement */ + || kind === 212 /* WhileStatement */ + || kind === 219 /* WithStatement */ + || kind === 294 /* NotEmittedStatement */ + || kind === 297 /* EndOfDeclarationMarker */ + || kind === 296 /* MergeDeclarationMarker */; } function isDeclaration(node) { return isDeclarationKind(node.kind); @@ -10204,93 +10392,104 @@ var ts; var kind = node.kind; return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) - || kind === 204 /* Block */; + || kind === 206 /* Block */; } ts.isStatement = isStatement; // Module references function isModuleReference(node) { var kind = node.kind; - return kind === 245 /* ExternalModuleReference */ - || kind === 141 /* QualifiedName */ + return kind === 247 /* ExternalModuleReference */ + || kind === 142 /* QualifiedName */ || kind === 70 /* Identifier */; } ts.isModuleReference = isModuleReference; // JSX function isJsxOpeningElement(node) { - return node.kind === 248 /* JsxOpeningElement */; + return node.kind === 250 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 249 /* JsxClosingElement */; + return node.kind === 251 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxTagNameExpression(node) { var kind = node.kind; return kind === 98 /* ThisKeyword */ || kind === 70 /* Identifier */ - || kind === 177 /* PropertyAccessExpression */; + || kind === 178 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; function isJsxChild(node) { var kind = node.kind; - return kind === 246 /* JsxElement */ - || kind === 252 /* JsxExpression */ - || kind === 247 /* JsxSelfClosingElement */ + return kind === 248 /* JsxElement */ + || kind === 255 /* JsxExpression */ + || kind === 249 /* JsxSelfClosingElement */ || kind === 10 /* JsxText */; } ts.isJsxChild = isJsxChild; + function isJsxAttributes(node) { + var kind = node.kind; + return kind === 253 /* JsxAttributes */; + } + ts.isJsxAttributes = isJsxAttributes; function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 250 /* JsxAttribute */ - || kind === 251 /* JsxSpreadAttribute */; + return kind === 252 /* JsxAttribute */ + || kind === 254 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; function isJsxSpreadAttribute(node) { - return node.kind === 251 /* JsxSpreadAttribute */; + return node.kind === 254 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxAttribute(node) { - return node.kind === 250 /* JsxAttribute */; + return node.kind === 252 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 9 /* StringLiteral */ - || kind === 252 /* JsxExpression */; + || kind === 255 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; + function isJsxOpeningLikeElement(node) { + var kind = node.kind; + return kind === 250 /* JsxOpeningElement */ + || kind === 249 /* JsxSelfClosingElement */; + } + ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 253 /* CaseClause */ - || kind === 254 /* DefaultClause */; + return kind === 256 /* CaseClause */ + || kind === 257 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; function isHeritageClause(node) { - return node.kind === 255 /* HeritageClause */; + return node.kind === 258 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 256 /* CatchClause */; + return node.kind === 259 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 257 /* PropertyAssignment */; + return node.kind === 260 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 258 /* ShorthandPropertyAssignment */; + return node.kind === 261 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; // Enum function isEnumMember(node) { - return node.kind === 260 /* EnumMember */; + return node.kind === 263 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Top-level nodes function isSourceFile(node) { - return node.kind === 261 /* SourceFile */; + return node.kind === 264 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isWatchSet(options) { @@ -10303,12 +10502,13 @@ var ts; function getDefaultLibFileName(options) { switch (options.target) { case 5 /* ESNext */: + return "lib.esnext.full.d.ts"; case 4 /* ES2017 */: - return "lib.es2017.d.ts"; + return "lib.es2017.full.d.ts"; case 3 /* ES2016 */: - return "lib.es2016.d.ts"; + return "lib.es2016.full.d.ts"; case 2 /* ES2015 */: - return "lib.es6.d.ts"; + return "lib.es6.d.ts"; // We don't use lib.es2015.full.d.ts due to breaking change. default: return "lib.d.ts"; } @@ -10516,13 +10716,13 @@ var ts; oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); } - return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), /*newLength:*/ newEndN - oldStartN); + return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), /*newLength*/ newEndN - oldStartN); } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 143 /* TypeParameter */) { + if (d && d.kind === 144 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 227 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 229 /* InterfaceDeclaration */) { return current; } } @@ -10530,11 +10730,11 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node) { - return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 150 /* Constructor */ && ts.isClassLike(node.parent.parent); + return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 151 /* Constructor */ && ts.isClassLike(node.parent.parent); } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 174 /* BindingElement */ || ts.isBindingPattern(node))) { + while (node && (node.kind === 175 /* BindingElement */ || ts.isBindingPattern(node))) { node = node.parent; } return node; @@ -10542,14 +10742,14 @@ var ts; function getCombinedModifierFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = ts.getModifierFlags(node); - if (node.kind === 223 /* VariableDeclaration */) { + if (node.kind === 225 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 224 /* VariableDeclarationList */) { + if (node && node.kind === 226 /* VariableDeclarationList */) { flags |= ts.getModifierFlags(node); node = node.parent; } - if (node && node.kind === 205 /* VariableStatement */) { + if (node && node.kind === 207 /* VariableStatement */) { flags |= ts.getModifierFlags(node); } return flags; @@ -10565,23 +10765,23 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 223 /* VariableDeclaration */) { + if (node.kind === 225 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 224 /* VariableDeclarationList */) { + if (node && node.kind === 226 /* VariableDeclarationList */) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 205 /* VariableStatement */) { + if (node && node.kind === 207 /* VariableStatement */) { flags |= node.flags; } return flags; } ts.getCombinedNodeFlags = getCombinedNodeFlags; /** - * Checks to see if the locale is in the appropriate format, - * and if it is, attempts to set the appropriate language. - */ + * Checks to see if the locale is in the appropriate format, + * and if it is, attempts to set the appropriate language. + */ function validateLocaleAndSetLanguage(locale, sys, errors) { var matchResult = /^([a-z]+)([_\-]([a-z]+))?$/.exec(locale.toLowerCase()); if (!matchResult) { @@ -10632,27 +10832,60 @@ var ts; } } ts.validateLocaleAndSetLanguage = validateLocaleAndSetLanguage; + function getOriginalNode(node, nodeTest) { + if (node) { + while (node.original !== undefined) { + node = node.original; + } + } + return !nodeTest || nodeTest(node) ? node : undefined; + } + ts.getOriginalNode = getOriginalNode; + /** + * Gets a value indicating whether a node originated in the parse tree. + * + * @param node The node to test. + */ + function isParseTreeNode(node) { + return (node.flags & 8 /* Synthesized */) === 0; + } + ts.isParseTreeNode = isParseTreeNode; + function getParseTreeNode(node, nodeTest) { + if (node === undefined || isParseTreeNode(node)) { + return node; + } + node = getOriginalNode(node); + if (isParseTreeNode(node) && (!nodeTest || nodeTest(node))) { + return node; + } + return undefined; + } + ts.getParseTreeNode = getParseTreeNode; + /** + * Remove extra underscore from escaped identifier text content. + * + * @param identifier The escaped identifier text. + * @returns The unescaped identifier text. + */ + function unescapeIdentifier(identifier) { + return identifier.length >= 3 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ && identifier.charCodeAt(2) === 95 /* _ */ ? identifier.substr(1) : identifier; + } + ts.unescapeIdentifier = unescapeIdentifier; })(ts || (ts = {})); /// /// -/* @internal */ var ts; (function (ts) { - var NodeConstructor; - var SourceFileConstructor; - function createNode(kind, location, flags) { - var ConstructorForKind = kind === 261 /* SourceFile */ - ? (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor())) - : (NodeConstructor || (NodeConstructor = ts.objectAllocator.getNodeConstructor())); - var node = location - ? new ConstructorForKind(kind, location.pos, location.end) - : new ConstructorForKind(kind, /*pos*/ -1, /*end*/ -1); - node.flags = flags | 8 /* Synthesized */; + function createSynthesizedNode(kind) { + var node = ts.createNode(kind, -1, -1); + node.flags |= 8 /* Synthesized */; return node; } + /* @internal */ function updateNode(updated, original) { if (updated !== original) { setOriginalNode(updated, original); + setTextRange(updated, original); if (original.startsOnNewLine) { updated.startsOnNewLine = true; } @@ -10661,7 +10894,10 @@ var ts; return updated; } ts.updateNode = updateNode; - function createNodeArray(elements, location, hasTrailingComma) { + /** + * Make `elements` into a `NodeArray`. If `elements` is `undefined`, returns an empty `NodeArray`. + */ + function createNodeArray(elements, hasTrailingComma) { if (elements) { if (ts.isNodeArray(elements)) { return elements; @@ -10671,38 +10907,22 @@ var ts; elements = []; } var array = elements; - if (location) { - array.pos = location.pos; - array.end = location.end; - } - else { - array.pos = -1; - array.end = -1; - } - if (hasTrailingComma) { - array.hasTrailingComma = true; - } + array.pos = -1; + array.end = -1; + array.hasTrailingComma = hasTrailingComma; return array; } ts.createNodeArray = createNodeArray; - function createSynthesizedNode(kind, startsOnNewLine) { - var node = createNode(kind, /*location*/ undefined); - node.startsOnNewLine = startsOnNewLine; - return node; - } - ts.createSynthesizedNode = createSynthesizedNode; - function createSynthesizedNodeArray(elements) { - return createNodeArray(elements, /*location*/ undefined); - } - ts.createSynthesizedNodeArray = createSynthesizedNodeArray; /** * Creates a shallow, memberwise clone of a node with no source map location. */ + /* @internal */ function getSynthesizedClone(node) { // We don't use "clone" from core.ts here, as we need to preserve the prototype chain of // the original node. We also need to exclude specific properties and only include own- // properties (to skip members already defined on the shared prototype). - var clone = createNode(node.kind, /*location*/ undefined, node.flags); + var clone = createSynthesizedNode(node.kind); + clone.flags |= node.flags; setOriginalNode(clone, node); for (var key in node) { if (clone.hasOwnProperty(key) || !node.hasOwnProperty(key)) { @@ -10713,54 +10933,50 @@ var ts; return clone; } ts.getSynthesizedClone = getSynthesizedClone; - /** - * Creates a shallow, memberwise clone of a node for mutation. - */ - function getMutableClone(node) { - var clone = getSynthesizedClone(node); - clone.pos = node.pos; - clone.end = node.end; - clone.parent = node.parent; - return clone; - } - ts.getMutableClone = getMutableClone; - function createLiteral(value, location) { + function createLiteral(value) { if (typeof value === "number") { - var node = createNode(8 /* NumericLiteral */, location, /*flags*/ undefined); - node.text = value.toString(); - return node; + return createNumericLiteral(value + ""); } - else if (typeof value === "boolean") { - return createNode(value ? 100 /* TrueKeyword */ : 85 /* FalseKeyword */, location, /*flags*/ undefined); + if (typeof value === "boolean") { + return value ? createTrue() : createFalse(); } - else if (typeof value === "string") { - var node = createNode(9 /* StringLiteral */, location, /*flags*/ undefined); - node.text = value; - return node; - } - else if (value) { - var node = createNode(9 /* StringLiteral */, location, /*flags*/ undefined); - node.textSourceNode = value; - node.text = value.text; - return node; + if (typeof value === "string") { + return createStringLiteral(value); } + return createLiteralFromNode(value); } ts.createLiteral = createLiteral; + function createNumericLiteral(value) { + var node = createSynthesizedNode(8 /* NumericLiteral */); + node.text = value; + node.numericLiteralFlags = 0; + return node; + } + ts.createNumericLiteral = createNumericLiteral; + function createStringLiteral(text) { + var node = createSynthesizedNode(9 /* StringLiteral */); + node.text = text; + return node; + } + function createLiteralFromNode(sourceNode) { + var node = createStringLiteral(sourceNode.text); + node.textSourceNode = sourceNode; + return node; + } // Identifiers - var nextAutoGenerateId = 0; - function createIdentifier(text, location) { - var node = createNode(70 /* Identifier */, location); + function createIdentifier(text) { + var node = createSynthesizedNode(70 /* Identifier */); node.text = ts.escapeIdentifier(text); - node.originalKeywordKind = ts.stringToToken(text); + node.originalKeywordKind = text ? ts.stringToToken(text) : 0 /* Unknown */; node.autoGenerateKind = 0 /* None */; node.autoGenerateId = 0; return node; } ts.createIdentifier = createIdentifier; - function createTempVariable(recordTempVariable, location) { - var name = createNode(70 /* Identifier */, location); - name.text = ""; - name.originalKeywordKind = 0 /* Unknown */; + var nextAutoGenerateId = 0; + /** Create a unique temporary variable. */ + function createTempVariable(recordTempVariable) { + var name = createIdentifier(""); name.autoGenerateKind = 1 /* Auto */; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; @@ -10770,98 +10986,399 @@ var ts; return name; } ts.createTempVariable = createTempVariable; - function createLoopVariable(location) { - var name = createNode(70 /* Identifier */, location); - name.text = ""; - name.originalKeywordKind = 0 /* Unknown */; + /** Create a unique temporary variable for use in a loop. */ + function createLoopVariable() { + var name = createIdentifier(""); name.autoGenerateKind = 2 /* Loop */; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; return name; } ts.createLoopVariable = createLoopVariable; - function createUniqueName(text, location) { - var name = createNode(70 /* Identifier */, location); - name.text = text; - name.originalKeywordKind = 0 /* Unknown */; + /** Create a unique name based on the supplied text. */ + function createUniqueName(text) { + var name = createIdentifier(text); name.autoGenerateKind = 3 /* Unique */; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; return name; } ts.createUniqueName = createUniqueName; - function getGeneratedNameForNode(node, location) { - var name = createNode(70 /* Identifier */, location); - name.original = node; - name.text = ""; - name.originalKeywordKind = 0 /* Unknown */; + /** Create a unique name generated for a node. */ + function getGeneratedNameForNode(node) { + var name = createIdentifier(""); name.autoGenerateKind = 4 /* Node */; name.autoGenerateId = nextAutoGenerateId; + name.original = node; nextAutoGenerateId++; return name; } ts.getGeneratedNameForNode = getGeneratedNameForNode; // Punctuation function createToken(token) { - return createNode(token); + return createSynthesizedNode(token); } ts.createToken = createToken; // Reserved words function createSuper() { - var node = createNode(96 /* SuperKeyword */); - return node; + return createSynthesizedNode(96 /* SuperKeyword */); } ts.createSuper = createSuper; - function createThis(location) { - var node = createNode(98 /* ThisKeyword */, location); - return node; + function createThis() { + return createSynthesizedNode(98 /* ThisKeyword */); } ts.createThis = createThis; function createNull() { - var node = createNode(94 /* NullKeyword */); - return node; + return createSynthesizedNode(94 /* NullKeyword */); } ts.createNull = createNull; + function createTrue() { + return createSynthesizedNode(100 /* TrueKeyword */); + } + ts.createTrue = createTrue; + function createFalse() { + return createSynthesizedNode(85 /* FalseKeyword */); + } + ts.createFalse = createFalse; // Names - function createComputedPropertyName(expression, location) { - var node = createNode(142 /* ComputedPropertyName */, location); + function createQualifiedName(left, right) { + var node = createSynthesizedNode(142 /* QualifiedName */); + node.left = left; + node.right = asName(right); + return node; + } + ts.createQualifiedName = createQualifiedName; + function updateQualifiedName(node, left, right) { + return node.left !== left + || node.right !== right + ? updateNode(createQualifiedName(left, right), node) + : node; + } + ts.updateQualifiedName = updateQualifiedName; + function createComputedPropertyName(expression) { + var node = createSynthesizedNode(143 /* ComputedPropertyName */); node.expression = expression; return node; } ts.createComputedPropertyName = createComputedPropertyName; function updateComputedPropertyName(node, expression) { - if (node.expression !== expression) { - return updateNode(createComputedPropertyName(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createComputedPropertyName(expression), node) + : node; } ts.updateComputedPropertyName = updateComputedPropertyName; + // Type Elements + function createSignatureDeclaration(kind, typeParameters, parameters, type) { + var signatureDeclaration = createSynthesizedNode(kind); + signatureDeclaration.typeParameters = asNodeArray(typeParameters); + signatureDeclaration.parameters = asNodeArray(parameters); + signatureDeclaration.type = type; + return signatureDeclaration; + } + ts.createSignatureDeclaration = createSignatureDeclaration; + function updateSignatureDeclaration(node, typeParameters, parameters, type) { + return node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + ? updateNode(createSignatureDeclaration(node.kind, typeParameters, parameters, type), node) + : node; + } + function createFunctionTypeNode(typeParameters, parameters, type) { + return createSignatureDeclaration(159 /* FunctionType */, typeParameters, parameters, type); + } + ts.createFunctionTypeNode = createFunctionTypeNode; + function updateFunctionTypeNode(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateFunctionTypeNode = updateFunctionTypeNode; + function createConstructorTypeNode(typeParameters, parameters, type) { + return createSignatureDeclaration(160 /* ConstructorType */, typeParameters, parameters, type); + } + ts.createConstructorTypeNode = createConstructorTypeNode; + function updateConstructorTypeNode(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateConstructorTypeNode = updateConstructorTypeNode; + function createCallSignatureDeclaration(typeParameters, parameters, type) { + return createSignatureDeclaration(154 /* CallSignature */, typeParameters, parameters, type); + } + ts.createCallSignatureDeclaration = createCallSignatureDeclaration; + function updateCallSignatureDeclaration(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateCallSignatureDeclaration = updateCallSignatureDeclaration; + function createConstructSignatureDeclaration(typeParameters, parameters, type) { + return createSignatureDeclaration(155 /* ConstructSignature */, typeParameters, parameters, type); + } + ts.createConstructSignatureDeclaration = createConstructSignatureDeclaration; + function updateConstructSignatureDeclaration(node, typeParameters, parameters, type) { + return updateSignatureDeclaration(node, typeParameters, parameters, type); + } + ts.updateConstructSignatureDeclaration = updateConstructSignatureDeclaration; + function createMethodSignature(typeParameters, parameters, type, name, questionToken) { + var methodSignature = createSignatureDeclaration(149 /* MethodSignature */, typeParameters, parameters, type); + methodSignature.name = asName(name); + methodSignature.questionToken = questionToken; + return methodSignature; + } + ts.createMethodSignature = createMethodSignature; + function updateMethodSignature(node, typeParameters, parameters, type, name, questionToken) { + return node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.name !== name + || node.questionToken !== questionToken + ? updateNode(createMethodSignature(typeParameters, parameters, type, name, questionToken), node) + : node; + } + ts.updateMethodSignature = updateMethodSignature; + // Types + function createKeywordTypeNode(kind) { + return createSynthesizedNode(kind); + } + ts.createKeywordTypeNode = createKeywordTypeNode; + function createThisTypeNode() { + return createSynthesizedNode(168 /* ThisType */); + } + ts.createThisTypeNode = createThisTypeNode; + function createLiteralTypeNode(literal) { + var literalTypeNode = createSynthesizedNode(172 /* LiteralType */); + literalTypeNode.literal = literal; + return literalTypeNode; + } + ts.createLiteralTypeNode = createLiteralTypeNode; + function updateLiteralTypeNode(node, literal) { + return node.literal !== literal + ? updateNode(createLiteralTypeNode(literal), node) + : node; + } + ts.updateLiteralTypeNode = updateLiteralTypeNode; + function createTypeReferenceNode(typeName, typeArguments) { + var typeReference = createSynthesizedNode(158 /* TypeReference */); + typeReference.typeName = asName(typeName); + typeReference.typeArguments = asNodeArray(typeArguments); + return typeReference; + } + ts.createTypeReferenceNode = createTypeReferenceNode; + function updateTypeReferenceNode(node, typeName, typeArguments) { + return node.typeName !== typeName + || node.typeArguments !== typeArguments + ? updateNode(createTypeReferenceNode(typeName, typeArguments), node) + : node; + } + ts.updateTypeReferenceNode = updateTypeReferenceNode; + function createTypePredicateNode(parameterName, type) { + var typePredicateNode = createSynthesizedNode(157 /* TypePredicate */); + typePredicateNode.parameterName = asName(parameterName); + typePredicateNode.type = type; + return typePredicateNode; + } + ts.createTypePredicateNode = createTypePredicateNode; + function updateTypePredicateNode(node, parameterName, type) { + return node.parameterName !== parameterName + || node.type !== type + ? updateNode(createTypePredicateNode(parameterName, type), node) + : node; + } + ts.updateTypePredicateNode = updateTypePredicateNode; + function createTypeQueryNode(exprName) { + var typeQueryNode = createSynthesizedNode(161 /* TypeQuery */); + typeQueryNode.exprName = exprName; + return typeQueryNode; + } + ts.createTypeQueryNode = createTypeQueryNode; + function updateTypeQueryNode(node, exprName) { + return node.exprName !== exprName ? updateNode(createTypeQueryNode(exprName), node) : node; + } + ts.updateTypeQueryNode = updateTypeQueryNode; + function createArrayTypeNode(elementType) { + var arrayTypeNode = createSynthesizedNode(163 /* ArrayType */); + arrayTypeNode.elementType = elementType; + return arrayTypeNode; + } + ts.createArrayTypeNode = createArrayTypeNode; + function updateArrayTypeNode(node, elementType) { + return node.elementType !== elementType + ? updateNode(createArrayTypeNode(elementType), node) + : node; + } + ts.updateArrayTypeNode = updateArrayTypeNode; + function createUnionOrIntersectionTypeNode(kind, types) { + var unionTypeNode = createSynthesizedNode(kind); + unionTypeNode.types = createNodeArray(types); + return unionTypeNode; + } + ts.createUnionOrIntersectionTypeNode = createUnionOrIntersectionTypeNode; + function updateUnionOrIntersectionTypeNode(node, types) { + return node.types !== types + ? updateNode(createUnionOrIntersectionTypeNode(node.kind, types), node) + : node; + } + ts.updateUnionOrIntersectionTypeNode = updateUnionOrIntersectionTypeNode; + function createTypeLiteralNode(members) { + var typeLiteralNode = createSynthesizedNode(162 /* TypeLiteral */); + typeLiteralNode.members = createNodeArray(members); + return typeLiteralNode; + } + ts.createTypeLiteralNode = createTypeLiteralNode; + function updateTypeLiteralNode(node, members) { + return node.members !== members + ? updateNode(createTypeLiteralNode(members), node) + : node; + } + ts.updateTypeLiteralNode = updateTypeLiteralNode; + function createTupleTypeNode(elementTypes) { + var tupleTypeNode = createSynthesizedNode(164 /* TupleType */); + tupleTypeNode.elementTypes = createNodeArray(elementTypes); + return tupleTypeNode; + } + ts.createTupleTypeNode = createTupleTypeNode; + function updateTypleTypeNode(node, elementTypes) { + return node.elementTypes !== elementTypes + ? updateNode(createTupleTypeNode(elementTypes), node) + : node; + } + ts.updateTypleTypeNode = updateTypleTypeNode; + function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { + var mappedTypeNode = createSynthesizedNode(171 /* MappedType */); + mappedTypeNode.readonlyToken = readonlyToken; + mappedTypeNode.typeParameter = typeParameter; + mappedTypeNode.questionToken = questionToken; + mappedTypeNode.type = type; + return mappedTypeNode; + } + ts.createMappedTypeNode = createMappedTypeNode; + function updateMappedTypeNode(node, readonlyToken, typeParameter, questionToken, type) { + return node.readonlyToken !== readonlyToken + || node.typeParameter !== typeParameter + || node.questionToken !== questionToken + || node.type !== type + ? updateNode(createMappedTypeNode(readonlyToken, typeParameter, questionToken, type), node) + : node; + } + ts.updateMappedTypeNode = updateMappedTypeNode; + function createTypeOperatorNode(type) { + var typeOperatorNode = createSynthesizedNode(169 /* TypeOperator */); + typeOperatorNode.operator = 126 /* KeyOfKeyword */; + typeOperatorNode.type = type; + return typeOperatorNode; + } + ts.createTypeOperatorNode = createTypeOperatorNode; + function updateTypeOperatorNode(node, type) { + return node.type !== type ? updateNode(createTypeOperatorNode(type), node) : node; + } + ts.updateTypeOperatorNode = updateTypeOperatorNode; + function createIndexedAccessTypeNode(objectType, indexType) { + var indexedAccessTypeNode = createSynthesizedNode(170 /* IndexedAccessType */); + indexedAccessTypeNode.objectType = objectType; + indexedAccessTypeNode.indexType = indexType; + return indexedAccessTypeNode; + } + ts.createIndexedAccessTypeNode = createIndexedAccessTypeNode; + function updateIndexedAccessTypeNode(node, objectType, indexType) { + return node.objectType !== objectType + || node.indexType !== indexType + ? updateNode(createIndexedAccessTypeNode(objectType, indexType), node) + : node; + } + ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; + // Type Declarations + function createTypeParameterDeclaration(name, constraint, defaultType) { + var typeParameter = createSynthesizedNode(144 /* TypeParameter */); + typeParameter.name = asName(name); + typeParameter.constraint = constraint; + typeParameter.default = defaultType; + return typeParameter; + } + ts.createTypeParameterDeclaration = createTypeParameterDeclaration; + function updateTypeParameterDeclaration(node, name, constraint, defaultType) { + return node.name !== name + || node.constraint !== constraint + || node.default !== defaultType + ? updateNode(createTypeParameterDeclaration(name, constraint, defaultType), node) + : node; + } + ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; // Signature elements - function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer, location, flags) { - var node = createNode(144 /* Parameter */, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createPropertySignature(name, questionToken, type, initializer) { + var propertySignature = createSynthesizedNode(147 /* PropertySignature */); + propertySignature.name = asName(name); + propertySignature.questionToken = questionToken; + propertySignature.type = type; + propertySignature.initializer = initializer; + return propertySignature; + } + ts.createPropertySignature = createPropertySignature; + function updatePropertySignature(node, name, questionToken, type, initializer) { + return node.name !== name + || node.questionToken !== questionToken + || node.type !== type + || node.initializer !== initializer + ? updateNode(createPropertySignature(name, questionToken, type, initializer), node) + : node; + } + ts.updatePropertySignature = updatePropertySignature; + function createIndexSignatureDeclaration(decorators, modifiers, parameters, type) { + var indexSignature = createSynthesizedNode(156 /* IndexSignature */); + indexSignature.decorators = asNodeArray(decorators); + indexSignature.modifiers = asNodeArray(modifiers); + indexSignature.parameters = createNodeArray(parameters); + indexSignature.type = type; + return indexSignature; + } + ts.createIndexSignatureDeclaration = createIndexSignatureDeclaration; + function updateIndexSignatureDeclaration(node, decorators, modifiers, parameters, type) { + return node.parameters !== parameters + || node.type !== type + || node.decorators !== decorators + || node.modifiers !== modifiers + ? updateNode(createIndexSignatureDeclaration(decorators, modifiers, parameters, type), node) + : node; + } + ts.updateIndexSignatureDeclaration = updateIndexSignatureDeclaration; + // Signature elements + function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { + var node = createSynthesizedNode(145 /* Parameter */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; + node.name = asName(name); node.questionToken = questionToken; node.type = type; - node.initializer = initializer ? parenthesizeExpressionForList(initializer) : undefined; + node.initializer = initializer ? ts.parenthesizeExpressionForList(initializer) : undefined; return node; } ts.createParameter = createParameter; - function updateParameter(node, decorators, modifiers, dotDotDotToken, name, type, initializer) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.type !== type || node.initializer !== initializer) { - return updateNode(createParameter(decorators, modifiers, dotDotDotToken, name, node.questionToken, type, initializer, /*location*/ node, /*flags*/ node.flags), node); - } - return node; + function updateParameter(node, decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.dotDotDotToken !== dotDotDotToken + || node.name !== name + || node.questionToken !== questionToken + || node.type !== type + || node.initializer !== initializer + ? updateNode(createParameter(decorators, modifiers, dotDotDotToken, name, node.questionToken, type, initializer), node) + : node; } ts.updateParameter = updateParameter; + function createDecorator(expression) { + var node = createSynthesizedNode(146 /* Decorator */); + node.expression = ts.parenthesizeForAccess(expression); + return node; + } + ts.createDecorator = createDecorator; + function updateDecorator(node, expression) { + return node.expression !== expression + ? updateNode(createDecorator(expression), node) + : node; + } + ts.updateDecorator = updateDecorator; // Type members - function createProperty(decorators, modifiers, name, questionToken, type, initializer, location) { - var node = createNode(147 /* PropertyDeclaration */, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createProperty(decorators, modifiers, name, questionToken, type, initializer) { + var node = createSynthesizedNode(148 /* PropertyDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); node.questionToken = questionToken; node.type = type; node.initializer = initializer; @@ -10869,36 +11386,46 @@ var ts; } ts.createProperty = createProperty; function updateProperty(node, decorators, modifiers, name, type, initializer) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.type !== type || node.initializer !== initializer) { - return updateNode(createProperty(decorators, modifiers, name, node.questionToken, type, initializer, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.type !== type + || node.initializer !== initializer + ? updateNode(createProperty(decorators, modifiers, name, node.questionToken, type, initializer), node) + : node; } ts.updateProperty = updateProperty; - function createMethod(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) { - var node = createNode(149 /* MethodDeclaration */, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createMethodDeclaration(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { + var node = createSynthesizedNode(150 /* MethodDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + node.name = asName(name); + node.questionToken = questionToken; + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.body = body; return node; } - ts.createMethod = createMethod; - function updateMethod(node, decorators, modifiers, name, typeParameters, parameters, type, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createMethod(decorators, modifiers, node.asteriskToken, name, typeParameters, parameters, type, body, /*location*/ node, node.flags), node); - } - return node; + ts.createMethodDeclaration = createMethodDeclaration; + function updateMethod(node, decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.asteriskToken !== asteriskToken + || node.name !== name + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createMethodDeclaration(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body), node) + : node; } ts.updateMethod = updateMethod; - function createConstructor(decorators, modifiers, parameters, body, location, flags) { - var node = createNode(150 /* Constructor */, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createConstructor(decorators, modifiers, parameters, body) { + var node = createSynthesizedNode(151 /* Constructor */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; node.parameters = createNodeArray(parameters); node.type = undefined; @@ -10907,17 +11434,19 @@ var ts; } ts.createConstructor = createConstructor; function updateConstructor(node, decorators, modifiers, parameters, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.parameters !== parameters || node.body !== body) { - return updateNode(createConstructor(decorators, modifiers, parameters, body, /*location*/ node, node.flags), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.parameters !== parameters + || node.body !== body + ? updateNode(createConstructor(decorators, modifiers, parameters, body), node) + : node; } ts.updateConstructor = updateConstructor; - function createGetAccessor(decorators, modifiers, name, parameters, type, body, location, flags) { - var node = createNode(151 /* GetAccessor */, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createGetAccessor(decorators, modifiers, name, parameters, type, body) { + var node = createSynthesizedNode(152 /* GetAccessor */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); node.typeParameters = undefined; node.parameters = createNodeArray(parameters); node.type = type; @@ -10926,17 +11455,21 @@ var ts; } ts.createGetAccessor = createGetAccessor; function updateGetAccessor(node, decorators, modifiers, name, parameters, type, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createGetAccessor(decorators, modifiers, name, parameters, type, body, /*location*/ node, node.flags), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createGetAccessor(decorators, modifiers, name, parameters, type, body), node) + : node; } ts.updateGetAccessor = updateGetAccessor; - function createSetAccessor(decorators, modifiers, name, parameters, body, location, flags) { - var node = createNode(152 /* SetAccessor */, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createSetAccessor(decorators, modifiers, name, parameters, body) { + var node = createSynthesizedNode(153 /* SetAccessor */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); node.typeParameters = undefined; node.parameters = createNodeArray(parameters); node.body = body; @@ -10944,59 +11477,62 @@ var ts; } ts.createSetAccessor = createSetAccessor; function updateSetAccessor(node, decorators, modifiers, name, parameters, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.parameters !== parameters || node.body !== body) { - return updateNode(createSetAccessor(decorators, modifiers, name, parameters, body, /*location*/ node, node.flags), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.parameters !== parameters + || node.body !== body + ? updateNode(createSetAccessor(decorators, modifiers, name, parameters, body), node) + : node; } ts.updateSetAccessor = updateSetAccessor; // Binding Patterns - function createObjectBindingPattern(elements, location) { - var node = createNode(172 /* ObjectBindingPattern */, location); + function createObjectBindingPattern(elements) { + var node = createSynthesizedNode(173 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); return node; } ts.createObjectBindingPattern = createObjectBindingPattern; function updateObjectBindingPattern(node, elements) { - if (node.elements !== elements) { - return updateNode(createObjectBindingPattern(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createObjectBindingPattern(elements), node) + : node; } ts.updateObjectBindingPattern = updateObjectBindingPattern; - function createArrayBindingPattern(elements, location) { - var node = createNode(173 /* ArrayBindingPattern */, location); + function createArrayBindingPattern(elements) { + var node = createSynthesizedNode(174 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); return node; } ts.createArrayBindingPattern = createArrayBindingPattern; function updateArrayBindingPattern(node, elements) { - if (node.elements !== elements) { - return updateNode(createArrayBindingPattern(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createArrayBindingPattern(elements), node) + : node; } ts.updateArrayBindingPattern = updateArrayBindingPattern; - function createBindingElement(propertyName, dotDotDotToken, name, initializer, location) { - var node = createNode(174 /* BindingElement */, location); - node.propertyName = typeof propertyName === "string" ? createIdentifier(propertyName) : propertyName; + function createBindingElement(dotDotDotToken, propertyName, name, initializer) { + var node = createSynthesizedNode(175 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; + node.propertyName = asName(propertyName); + node.name = asName(name); node.initializer = initializer; return node; } ts.createBindingElement = createBindingElement; function updateBindingElement(node, dotDotDotToken, propertyName, name, initializer) { - if (node.propertyName !== propertyName || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.initializer !== initializer) { - return updateNode(createBindingElement(propertyName, dotDotDotToken, name, initializer, node), node); - } - return node; + return node.propertyName !== propertyName + || node.dotDotDotToken !== dotDotDotToken + || node.name !== name + || node.initializer !== initializer + ? updateNode(createBindingElement(dotDotDotToken, propertyName, name, initializer), node) + : node; } ts.updateBindingElement = updateBindingElement; // Expression - function createArrayLiteral(elements, location, multiLine) { - var node = createNode(175 /* ArrayLiteralExpression */, location); - node.elements = parenthesizeListElements(createNodeArray(elements)); + function createArrayLiteral(elements, multiLine) { + var node = createSynthesizedNode(176 /* ArrayLiteralExpression */); + node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) { node.multiLine = true; } @@ -11004,14 +11540,13 @@ var ts; } ts.createArrayLiteral = createArrayLiteral; function updateArrayLiteral(node, elements) { - if (node.elements !== elements) { - return updateNode(createArrayLiteral(elements, node, node.multiLine), node); - } - return node; + return node.elements !== elements + ? updateNode(createArrayLiteral(elements, node.multiLine), node) + : node; } ts.updateArrayLiteral = updateArrayLiteral; - function createObjectLiteral(properties, location, multiLine) { - var node = createNode(176 /* ObjectLiteralExpression */, location); + function createObjectLiteral(properties, multiLine) { + var node = createSynthesizedNode(177 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); if (multiLine) { node.multiLine = true; @@ -11020,436 +11555,465 @@ var ts; } ts.createObjectLiteral = createObjectLiteral; function updateObjectLiteral(node, properties) { - if (node.properties !== properties) { - return updateNode(createObjectLiteral(properties, node, node.multiLine), node); - } - return node; + return node.properties !== properties + ? updateNode(createObjectLiteral(properties, node.multiLine), node) + : node; } ts.updateObjectLiteral = updateObjectLiteral; - function createPropertyAccess(expression, name, location, flags) { - var node = createNode(177 /* PropertyAccessExpression */, location, flags); - node.expression = parenthesizeForAccess(expression); - (node.emitNode || (node.emitNode = {})).flags |= 65536 /* NoIndentation */; - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createPropertyAccess(expression, name) { + var node = createSynthesizedNode(178 /* PropertyAccessExpression */); + node.expression = ts.parenthesizeForAccess(expression); + node.name = asName(name); + setEmitFlags(node, 65536 /* NoIndentation */); return node; } ts.createPropertyAccess = createPropertyAccess; function updatePropertyAccess(node, expression, name) { - if (node.expression !== expression || node.name !== name) { - var propertyAccess = createPropertyAccess(expression, name, /*location*/ node, node.flags); - // Because we are updating existed propertyAccess we want to inherit its emitFlags instead of using default from createPropertyAccess - (propertyAccess.emitNode || (propertyAccess.emitNode = {})).flags = getEmitFlags(node); - return updateNode(propertyAccess, node); - } - return node; + // Because we are updating existed propertyAccess we want to inherit its emitFlags + // instead of using the default from createPropertyAccess + return node.expression !== expression + || node.name !== name + ? updateNode(setEmitFlags(createPropertyAccess(expression, name), getEmitFlags(node)), node) + : node; } ts.updatePropertyAccess = updatePropertyAccess; - function createElementAccess(expression, index, location) { - var node = createNode(178 /* ElementAccessExpression */, location); - node.expression = parenthesizeForAccess(expression); - node.argumentExpression = typeof index === "number" ? createLiteral(index) : index; + function createElementAccess(expression, index) { + var node = createSynthesizedNode(179 /* ElementAccessExpression */); + node.expression = ts.parenthesizeForAccess(expression); + node.argumentExpression = asExpression(index); return node; } ts.createElementAccess = createElementAccess; function updateElementAccess(node, expression, argumentExpression) { - if (node.expression !== expression || node.argumentExpression !== argumentExpression) { - return updateNode(createElementAccess(expression, argumentExpression, node), node); - } - return node; + return node.expression !== expression + || node.argumentExpression !== argumentExpression + ? updateNode(createElementAccess(expression, argumentExpression), node) + : node; } ts.updateElementAccess = updateElementAccess; - function createCall(expression, typeArguments, argumentsArray, location, flags) { - var node = createNode(179 /* CallExpression */, location, flags); - node.expression = parenthesizeForAccess(expression); - if (typeArguments) { - node.typeArguments = createNodeArray(typeArguments); - } - node.arguments = parenthesizeListElements(createNodeArray(argumentsArray)); + function createCall(expression, typeArguments, argumentsArray) { + var node = createSynthesizedNode(180 /* CallExpression */); + node.expression = ts.parenthesizeForAccess(expression); + node.typeArguments = asNodeArray(typeArguments); + node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); return node; } ts.createCall = createCall; function updateCall(node, expression, typeArguments, argumentsArray) { - if (expression !== node.expression || typeArguments !== node.typeArguments || argumentsArray !== node.arguments) { - return updateNode(createCall(expression, typeArguments, argumentsArray, /*location*/ node, node.flags), node); - } - return node; + return expression !== node.expression + || typeArguments !== node.typeArguments + || argumentsArray !== node.arguments + ? updateNode(createCall(expression, typeArguments, argumentsArray), node) + : node; } ts.updateCall = updateCall; - function createNew(expression, typeArguments, argumentsArray, location, flags) { - var node = createNode(180 /* NewExpression */, location, flags); - node.expression = parenthesizeForNew(expression); - node.typeArguments = typeArguments ? createNodeArray(typeArguments) : undefined; - node.arguments = argumentsArray ? parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; + function createNew(expression, typeArguments, argumentsArray) { + var node = createSynthesizedNode(181 /* NewExpression */); + node.expression = ts.parenthesizeForNew(expression); + node.typeArguments = asNodeArray(typeArguments); + node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; return node; } ts.createNew = createNew; function updateNew(node, expression, typeArguments, argumentsArray) { - if (node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray) { - return updateNode(createNew(expression, typeArguments, argumentsArray, /*location*/ node, node.flags), node); - } - return node; + return node.expression !== expression + || node.typeArguments !== typeArguments + || node.arguments !== argumentsArray + ? updateNode(createNew(expression, typeArguments, argumentsArray), node) + : node; } ts.updateNew = updateNew; - function createTaggedTemplate(tag, template, location) { - var node = createNode(181 /* TaggedTemplateExpression */, location); - node.tag = parenthesizeForAccess(tag); + function createTaggedTemplate(tag, template) { + var node = createSynthesizedNode(182 /* TaggedTemplateExpression */); + node.tag = ts.parenthesizeForAccess(tag); node.template = template; return node; } ts.createTaggedTemplate = createTaggedTemplate; function updateTaggedTemplate(node, tag, template) { - if (node.tag !== tag || node.template !== template) { - return updateNode(createTaggedTemplate(tag, template, node), node); - } - return node; + return node.tag !== tag + || node.template !== template + ? updateNode(createTaggedTemplate(tag, template), node) + : node; } ts.updateTaggedTemplate = updateTaggedTemplate; - function createParen(expression, location) { - var node = createNode(183 /* ParenthesizedExpression */, location); + function createTypeAssertion(type, expression) { + var node = createSynthesizedNode(183 /* TypeAssertionExpression */); + node.type = type; + node.expression = ts.parenthesizePrefixOperand(expression); + return node; + } + ts.createTypeAssertion = createTypeAssertion; + function updateTypeAssertion(node, type, expression) { + return node.type !== type + || node.expression !== expression + ? updateNode(createTypeAssertion(type, expression), node) + : node; + } + ts.updateTypeAssertion = updateTypeAssertion; + function createParen(expression) { + var node = createSynthesizedNode(184 /* ParenthesizedExpression */); node.expression = expression; return node; } ts.createParen = createParen; function updateParen(node, expression) { - if (node.expression !== expression) { - return updateNode(createParen(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createParen(expression), node) + : node; } ts.updateParen = updateParen; - function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) { - var node = createNode(184 /* FunctionExpression */, location, flags); - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + var node = createSynthesizedNode(185 /* FunctionExpression */); + node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.body = body; return node; } ts.createFunctionExpression = createFunctionExpression; - function updateFunctionExpression(node, modifiers, name, typeParameters, parameters, type, body) { - if (node.name !== name || node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createFunctionExpression(modifiers, node.asteriskToken, name, typeParameters, parameters, type, body, /*location*/ node, node.flags), node); - } - return node; + function updateFunctionExpression(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + return node.name !== name + || node.modifiers !== modifiers + || node.asteriskToken !== asteriskToken + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) + : node; } ts.updateFunctionExpression = updateFunctionExpression; - function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body, location, flags) { - var node = createNode(185 /* ArrowFunction */, location, flags); - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { + var node = createSynthesizedNode(186 /* ArrowFunction */); + node.modifiers = asNodeArray(modifiers); + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.equalsGreaterThanToken = equalsGreaterThanToken || createToken(35 /* EqualsGreaterThanToken */); - node.body = parenthesizeConciseBody(body); + node.body = ts.parenthesizeConciseBody(body); return node; } ts.createArrowFunction = createArrowFunction; function updateArrowFunction(node, modifiers, typeParameters, parameters, type, body) { - if (node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createArrowFunction(modifiers, typeParameters, parameters, type, node.equalsGreaterThanToken, body, /*location*/ node, node.flags), node); - } - return node; + return node.modifiers !== modifiers + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createArrowFunction(modifiers, typeParameters, parameters, type, node.equalsGreaterThanToken, body), node) + : node; } ts.updateArrowFunction = updateArrowFunction; - function createDelete(expression, location) { - var node = createNode(186 /* DeleteExpression */, location); - node.expression = parenthesizePrefixOperand(expression); + function createDelete(expression) { + var node = createSynthesizedNode(187 /* DeleteExpression */); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createDelete = createDelete; function updateDelete(node, expression) { - if (node.expression !== expression) { - return updateNode(createDelete(expression, node), expression); - } - return node; + return node.expression !== expression + ? updateNode(createDelete(expression), node) + : node; } ts.updateDelete = updateDelete; - function createTypeOf(expression, location) { - var node = createNode(187 /* TypeOfExpression */, location); - node.expression = parenthesizePrefixOperand(expression); + function createTypeOf(expression) { + var node = createSynthesizedNode(188 /* TypeOfExpression */); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createTypeOf = createTypeOf; function updateTypeOf(node, expression) { - if (node.expression !== expression) { - return updateNode(createTypeOf(expression, node), expression); - } - return node; + return node.expression !== expression + ? updateNode(createTypeOf(expression), node) + : node; } ts.updateTypeOf = updateTypeOf; - function createVoid(expression, location) { - var node = createNode(188 /* VoidExpression */, location); - node.expression = parenthesizePrefixOperand(expression); + function createVoid(expression) { + var node = createSynthesizedNode(189 /* VoidExpression */); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createVoid = createVoid; function updateVoid(node, expression) { - if (node.expression !== expression) { - return updateNode(createVoid(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createVoid(expression), node) + : node; } ts.updateVoid = updateVoid; - function createAwait(expression, location) { - var node = createNode(189 /* AwaitExpression */, location); - node.expression = parenthesizePrefixOperand(expression); + function createAwait(expression) { + var node = createSynthesizedNode(190 /* AwaitExpression */); + node.expression = ts.parenthesizePrefixOperand(expression); return node; } ts.createAwait = createAwait; function updateAwait(node, expression) { - if (node.expression !== expression) { - return updateNode(createAwait(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createAwait(expression), node) + : node; } ts.updateAwait = updateAwait; - function createPrefix(operator, operand, location) { - var node = createNode(190 /* PrefixUnaryExpression */, location); + function createPrefix(operator, operand) { + var node = createSynthesizedNode(191 /* PrefixUnaryExpression */); node.operator = operator; - node.operand = parenthesizePrefixOperand(operand); + node.operand = ts.parenthesizePrefixOperand(operand); return node; } ts.createPrefix = createPrefix; function updatePrefix(node, operand) { - if (node.operand !== operand) { - return updateNode(createPrefix(node.operator, operand, node), node); - } - return node; + return node.operand !== operand + ? updateNode(createPrefix(node.operator, operand), node) + : node; } ts.updatePrefix = updatePrefix; - function createPostfix(operand, operator, location) { - var node = createNode(191 /* PostfixUnaryExpression */, location); - node.operand = parenthesizePostfixOperand(operand); + function createPostfix(operand, operator) { + var node = createSynthesizedNode(192 /* PostfixUnaryExpression */); + node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; } ts.createPostfix = createPostfix; function updatePostfix(node, operand) { - if (node.operand !== operand) { - return updateNode(createPostfix(operand, node.operator, node), node); - } - return node; + return node.operand !== operand + ? updateNode(createPostfix(operand, node.operator), node) + : node; } ts.updatePostfix = updatePostfix; - function createBinary(left, operator, right, location) { - var operatorToken = typeof operator === "number" ? createToken(operator) : operator; + function createBinary(left, operator, right) { + var node = createSynthesizedNode(193 /* BinaryExpression */); + var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; - var node = createNode(192 /* BinaryExpression */, location); - node.left = parenthesizeBinaryOperand(operatorKind, left, /*isLeftSideOfBinary*/ true, /*leftOperand*/ undefined); + node.left = ts.parenthesizeBinaryOperand(operatorKind, left, /*isLeftSideOfBinary*/ true, /*leftOperand*/ undefined); node.operatorToken = operatorToken; - node.right = parenthesizeBinaryOperand(operatorKind, right, /*isLeftSideOfBinary*/ false, node.left); + node.right = ts.parenthesizeBinaryOperand(operatorKind, right, /*isLeftSideOfBinary*/ false, node.left); return node; } ts.createBinary = createBinary; function updateBinary(node, left, right) { - if (node.left !== left || node.right !== right) { - return updateNode(createBinary(left, node.operatorToken, right, /*location*/ node), node); - } - return node; + return node.left !== left + || node.right !== right + ? updateNode(createBinary(left, node.operatorToken, right), node) + : node; } ts.updateBinary = updateBinary; - function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonTokenOrLocation, whenFalse, location) { - var node = createNode(193 /* ConditionalExpression */, whenFalse ? location : colonTokenOrLocation); - node.condition = parenthesizeForConditionalHead(condition); - if (whenFalse) { - // second overload - node.questionToken = questionTokenOrWhenTrue; - node.whenTrue = parenthesizeSubexpressionOfConditionalExpression(whenTrueOrWhenFalse); - node.colonToken = colonTokenOrLocation; - node.whenFalse = parenthesizeSubexpressionOfConditionalExpression(whenFalse); - } - else { - // first overload - node.questionToken = createToken(54 /* QuestionToken */); - node.whenTrue = parenthesizeSubexpressionOfConditionalExpression(questionTokenOrWhenTrue); - node.colonToken = createToken(55 /* ColonToken */); - node.whenFalse = parenthesizeSubexpressionOfConditionalExpression(whenTrueOrWhenFalse); - } + function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { + var node = createSynthesizedNode(194 /* ConditionalExpression */); + node.condition = ts.parenthesizeForConditionalHead(condition); + node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(54 /* QuestionToken */); + node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); + node.colonToken = whenFalse ? colonToken : createToken(55 /* ColonToken */); + node.whenFalse = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenFalse : whenTrueOrWhenFalse); return node; } ts.createConditional = createConditional; function updateConditional(node, condition, whenTrue, whenFalse) { - if (node.condition !== condition || node.whenTrue !== whenTrue || node.whenFalse !== whenFalse) { - return updateNode(createConditional(condition, node.questionToken, whenTrue, node.colonToken, whenFalse, node), node); - } - return node; + return node.condition !== condition + || node.whenTrue !== whenTrue + || node.whenFalse !== whenFalse + ? updateNode(createConditional(condition, node.questionToken, whenTrue, node.colonToken, whenFalse), node) + : node; } ts.updateConditional = updateConditional; - function createTemplateExpression(head, templateSpans, location) { - var node = createNode(194 /* TemplateExpression */, location); + function createTemplateExpression(head, templateSpans) { + var node = createSynthesizedNode(195 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; } ts.createTemplateExpression = createTemplateExpression; function updateTemplateExpression(node, head, templateSpans) { - if (node.head !== head || node.templateSpans !== templateSpans) { - return updateNode(createTemplateExpression(head, templateSpans, node), node); - } - return node; + return node.head !== head + || node.templateSpans !== templateSpans + ? updateNode(createTemplateExpression(head, templateSpans), node) + : node; } ts.updateTemplateExpression = updateTemplateExpression; - function createYield(asteriskToken, expression, location) { - var node = createNode(195 /* YieldExpression */, location); - node.asteriskToken = asteriskToken; - node.expression = expression; + function createYield(asteriskTokenOrExpression, expression) { + var node = createSynthesizedNode(196 /* YieldExpression */); + node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 38 /* AsteriskToken */ ? asteriskTokenOrExpression : undefined; + node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 38 /* AsteriskToken */ ? asteriskTokenOrExpression : expression; return node; } ts.createYield = createYield; - function updateYield(node, expression) { - if (node.expression !== expression) { - return updateNode(createYield(node.asteriskToken, expression, node), node); - } - return node; + function updateYield(node, asteriskToken, expression) { + return node.expression !== expression + || node.asteriskToken !== asteriskToken + ? updateNode(createYield(asteriskToken, expression), node) + : node; } ts.updateYield = updateYield; - function createSpread(expression, location) { - var node = createNode(196 /* SpreadElement */, location); - node.expression = parenthesizeExpressionForList(expression); + function createSpread(expression) { + var node = createSynthesizedNode(197 /* SpreadElement */); + node.expression = ts.parenthesizeExpressionForList(expression); return node; } ts.createSpread = createSpread; function updateSpread(node, expression) { - if (node.expression !== expression) { - return updateNode(createSpread(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createSpread(expression), node) + : node; } ts.updateSpread = updateSpread; - function createClassExpression(modifiers, name, typeParameters, heritageClauses, members, location) { - var node = createNode(197 /* ClassExpression */, location); + function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { + var node = createSynthesizedNode(198 /* ClassExpression */); node.decorators = undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; - node.heritageClauses = createNodeArray(heritageClauses); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); + node.heritageClauses = asNodeArray(heritageClauses); node.members = createNodeArray(members); return node; } ts.createClassExpression = createClassExpression; function updateClassExpression(node, modifiers, name, typeParameters, heritageClauses, members) { - if (node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members) { - return updateNode(createClassExpression(modifiers, name, typeParameters, heritageClauses, members, node), node); - } - return node; + return node.modifiers !== modifiers + || node.name !== name + || node.typeParameters !== typeParameters + || node.heritageClauses !== heritageClauses + || node.members !== members + ? updateNode(createClassExpression(modifiers, name, typeParameters, heritageClauses, members), node) + : node; } ts.updateClassExpression = updateClassExpression; - function createOmittedExpression(location) { - var node = createNode(198 /* OmittedExpression */, location); - return node; + function createOmittedExpression() { + return createSynthesizedNode(199 /* OmittedExpression */); } ts.createOmittedExpression = createOmittedExpression; - function createExpressionWithTypeArguments(typeArguments, expression, location) { - var node = createNode(199 /* ExpressionWithTypeArguments */, location); - node.typeArguments = typeArguments ? createNodeArray(typeArguments) : undefined; - node.expression = parenthesizeForAccess(expression); + function createExpressionWithTypeArguments(typeArguments, expression) { + var node = createSynthesizedNode(200 /* ExpressionWithTypeArguments */); + node.expression = ts.parenthesizeForAccess(expression); + node.typeArguments = asNodeArray(typeArguments); return node; } ts.createExpressionWithTypeArguments = createExpressionWithTypeArguments; function updateExpressionWithTypeArguments(node, typeArguments, expression) { - if (node.typeArguments !== typeArguments || node.expression !== expression) { - return updateNode(createExpressionWithTypeArguments(typeArguments, expression, node), node); - } - return node; + return node.typeArguments !== typeArguments + || node.expression !== expression + ? updateNode(createExpressionWithTypeArguments(typeArguments, expression), node) + : node; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; + function createAsExpression(expression, type) { + var node = createSynthesizedNode(201 /* AsExpression */); + node.expression = expression; + node.type = type; + return node; + } + ts.createAsExpression = createAsExpression; + function updateAsExpression(node, expression, type) { + return node.expression !== expression + || node.type !== type + ? updateNode(createAsExpression(expression, type), node) + : node; + } + ts.updateAsExpression = updateAsExpression; + function createNonNullExpression(expression) { + var node = createSynthesizedNode(202 /* NonNullExpression */); + node.expression = ts.parenthesizeForAccess(expression); + return node; + } + ts.createNonNullExpression = createNonNullExpression; + function updateNonNullExpression(node, expression) { + return node.expression !== expression + ? updateNode(createNonNullExpression(expression), node) + : node; + } + ts.updateNonNullExpression = updateNonNullExpression; // Misc - function createTemplateSpan(expression, literal, location) { - var node = createNode(202 /* TemplateSpan */, location); + function createTemplateSpan(expression, literal) { + var node = createSynthesizedNode(204 /* TemplateSpan */); node.expression = expression; node.literal = literal; return node; } ts.createTemplateSpan = createTemplateSpan; function updateTemplateSpan(node, expression, literal) { - if (node.expression !== expression || node.literal !== literal) { - return updateNode(createTemplateSpan(expression, literal, node), node); - } - return node; + return node.expression !== expression + || node.literal !== literal + ? updateNode(createTemplateSpan(expression, literal), node) + : node; } ts.updateTemplateSpan = updateTemplateSpan; // Element - function createBlock(statements, location, multiLine, flags) { - var block = createNode(204 /* Block */, location, flags); + function createBlock(statements, multiLine) { + var block = createSynthesizedNode(206 /* Block */); block.statements = createNodeArray(statements); - if (multiLine) { - block.multiLine = true; - } + if (multiLine) + block.multiLine = multiLine; return block; } ts.createBlock = createBlock; function updateBlock(node, statements) { - if (statements !== node.statements) { - return updateNode(createBlock(statements, /*location*/ node, node.multiLine, node.flags), node); - } - return node; + return statements !== node.statements + ? updateNode(createBlock(statements, node.multiLine), node) + : node; } ts.updateBlock = updateBlock; - function createVariableStatement(modifiers, declarationList, location, flags) { - var node = createNode(205 /* VariableStatement */, location, flags); + function createVariableStatement(modifiers, declarationList) { + var node = createSynthesizedNode(207 /* VariableStatement */); node.decorators = undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; return node; } ts.createVariableStatement = createVariableStatement; function updateVariableStatement(node, modifiers, declarationList) { - if (node.modifiers !== modifiers || node.declarationList !== declarationList) { - return updateNode(createVariableStatement(modifiers, declarationList, /*location*/ node, node.flags), node); - } - return node; + return node.modifiers !== modifiers + || node.declarationList !== declarationList + ? updateNode(createVariableStatement(modifiers, declarationList), node) + : node; } ts.updateVariableStatement = updateVariableStatement; - function createVariableDeclarationList(declarations, location, flags) { - var node = createNode(224 /* VariableDeclarationList */, location, flags); + function createVariableDeclarationList(declarations, flags) { + var node = createSynthesizedNode(226 /* VariableDeclarationList */); + node.flags |= flags; node.declarations = createNodeArray(declarations); return node; } ts.createVariableDeclarationList = createVariableDeclarationList; function updateVariableDeclarationList(node, declarations) { - if (node.declarations !== declarations) { - return updateNode(createVariableDeclarationList(declarations, /*location*/ node, node.flags), node); - } - return node; + return node.declarations !== declarations + ? updateNode(createVariableDeclarationList(declarations, node.flags), node) + : node; } ts.updateVariableDeclarationList = updateVariableDeclarationList; - function createVariableDeclaration(name, type, initializer, location, flags) { - var node = createNode(223 /* VariableDeclaration */, location, flags); - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createVariableDeclaration(name, type, initializer) { + var node = createSynthesizedNode(225 /* VariableDeclaration */); + node.name = asName(name); node.type = type; - node.initializer = initializer !== undefined ? parenthesizeExpressionForList(initializer) : undefined; + node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; return node; } ts.createVariableDeclaration = createVariableDeclaration; function updateVariableDeclaration(node, name, type, initializer) { - if (node.name !== name || node.type !== type || node.initializer !== initializer) { - return updateNode(createVariableDeclaration(name, type, initializer, /*location*/ node, node.flags), node); - } - return node; + return node.name !== name + || node.type !== type + || node.initializer !== initializer + ? updateNode(createVariableDeclaration(name, type, initializer), node) + : node; } ts.updateVariableDeclaration = updateVariableDeclaration; - function createEmptyStatement(location) { - return createNode(206 /* EmptyStatement */, location); + function createEmptyStatement() { + return createSynthesizedNode(208 /* EmptyStatement */); } ts.createEmptyStatement = createEmptyStatement; - function createStatement(expression, location, flags) { - var node = createNode(207 /* ExpressionStatement */, location, flags); - node.expression = parenthesizeExpressionForExpressionStatement(expression); + function createStatement(expression) { + var node = createSynthesizedNode(209 /* ExpressionStatement */); + node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } ts.createStatement = createStatement; function updateStatement(node, expression) { - if (node.expression !== expression) { - return updateNode(createStatement(expression, /*location*/ node, node.flags), node); - } - return node; + return node.expression !== expression + ? updateNode(createStatement(expression), node) + : node; } ts.updateStatement = updateStatement; - function createIf(expression, thenStatement, elseStatement, location) { - var node = createNode(208 /* IfStatement */, location); + function createIf(expression, thenStatement, elseStatement) { + var node = createSynthesizedNode(210 /* IfStatement */); node.expression = expression; node.thenStatement = thenStatement; node.elseStatement = elseStatement; @@ -11457,42 +12021,43 @@ var ts; } ts.createIf = createIf; function updateIf(node, expression, thenStatement, elseStatement) { - if (node.expression !== expression || node.thenStatement !== thenStatement || node.elseStatement !== elseStatement) { - return updateNode(createIf(expression, thenStatement, elseStatement, /*location*/ node), node); - } - return node; + return node.expression !== expression + || node.thenStatement !== thenStatement + || node.elseStatement !== elseStatement + ? updateNode(createIf(expression, thenStatement, elseStatement), node) + : node; } ts.updateIf = updateIf; - function createDo(statement, expression, location) { - var node = createNode(209 /* DoStatement */, location); + function createDo(statement, expression) { + var node = createSynthesizedNode(211 /* DoStatement */); node.statement = statement; node.expression = expression; return node; } ts.createDo = createDo; function updateDo(node, statement, expression) { - if (node.statement !== statement || node.expression !== expression) { - return updateNode(createDo(statement, expression, node), node); - } - return node; + return node.statement !== statement + || node.expression !== expression + ? updateNode(createDo(statement, expression), node) + : node; } ts.updateDo = updateDo; - function createWhile(expression, statement, location) { - var node = createNode(210 /* WhileStatement */, location); + function createWhile(expression, statement) { + var node = createSynthesizedNode(212 /* WhileStatement */); node.expression = expression; node.statement = statement; return node; } ts.createWhile = createWhile; function updateWhile(node, expression, statement) { - if (node.expression !== expression || node.statement !== statement) { - return updateNode(createWhile(expression, statement, node), node); - } - return node; + return node.expression !== expression + || node.statement !== statement + ? updateNode(createWhile(expression, statement), node) + : node; } ts.updateWhile = updateWhile; - function createFor(initializer, condition, incrementor, statement, location) { - var node = createNode(211 /* ForStatement */, location, /*flags*/ undefined); + function createFor(initializer, condition, incrementor, statement) { + var node = createSynthesizedNode(213 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -11501,14 +12066,16 @@ var ts; } ts.createFor = createFor; function updateFor(node, initializer, condition, incrementor, statement) { - if (node.initializer !== initializer || node.condition !== condition || node.incrementor !== incrementor || node.statement !== statement) { - return updateNode(createFor(initializer, condition, incrementor, statement, node), node); - } - return node; + return node.initializer !== initializer + || node.condition !== condition + || node.incrementor !== incrementor + || node.statement !== statement + ? updateNode(createFor(initializer, condition, incrementor, statement), node) + : node; } ts.updateFor = updateFor; - function createForIn(initializer, expression, statement, location) { - var node = createNode(212 /* ForInStatement */, location); + function createForIn(initializer, expression, statement) { + var node = createSynthesizedNode(214 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = statement; @@ -11516,127 +12083,123 @@ var ts; } ts.createForIn = createForIn; function updateForIn(node, initializer, expression, statement) { - if (node.initializer !== initializer || node.expression !== expression || node.statement !== statement) { - return updateNode(createForIn(initializer, expression, statement, node), node); - } - return node; + return node.initializer !== initializer + || node.expression !== expression + || node.statement !== statement + ? updateNode(createForIn(initializer, expression, statement), node) + : node; } ts.updateForIn = updateForIn; - function createForOf(initializer, expression, statement, location) { - var node = createNode(213 /* ForOfStatement */, location); + function createForOf(awaitModifier, initializer, expression, statement) { + var node = createSynthesizedNode(215 /* ForOfStatement */); + node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = expression; node.statement = statement; return node; } ts.createForOf = createForOf; - function updateForOf(node, initializer, expression, statement) { - if (node.initializer !== initializer || node.expression !== expression || node.statement !== statement) { - return updateNode(createForOf(initializer, expression, statement, node), node); - } - return node; + function updateForOf(node, awaitModifier, initializer, expression, statement) { + return node.awaitModifier !== awaitModifier + || node.initializer !== initializer + || node.expression !== expression + || node.statement !== statement + ? updateNode(createForOf(awaitModifier, initializer, expression, statement), node) + : node; } ts.updateForOf = updateForOf; - function createContinue(label, location) { - var node = createNode(214 /* ContinueStatement */, location); - if (label) { - node.label = label; - } + function createContinue(label) { + var node = createSynthesizedNode(216 /* ContinueStatement */); + node.label = asName(label); return node; } ts.createContinue = createContinue; function updateContinue(node, label) { - if (node.label !== label) { - return updateNode(createContinue(label, node), node); - } - return node; + return node.label !== label + ? updateNode(createContinue(label), node) + : node; } ts.updateContinue = updateContinue; - function createBreak(label, location) { - var node = createNode(215 /* BreakStatement */, location); - if (label) { - node.label = label; - } + function createBreak(label) { + var node = createSynthesizedNode(217 /* BreakStatement */); + node.label = asName(label); return node; } ts.createBreak = createBreak; function updateBreak(node, label) { - if (node.label !== label) { - return updateNode(createBreak(label, node), node); - } - return node; + return node.label !== label + ? updateNode(createBreak(label), node) + : node; } ts.updateBreak = updateBreak; - function createReturn(expression, location) { - var node = createNode(216 /* ReturnStatement */, location); + function createReturn(expression) { + var node = createSynthesizedNode(218 /* ReturnStatement */); node.expression = expression; return node; } ts.createReturn = createReturn; function updateReturn(node, expression) { - if (node.expression !== expression) { - return updateNode(createReturn(expression, /*location*/ node), node); - } - return node; + return node.expression !== expression + ? updateNode(createReturn(expression), node) + : node; } ts.updateReturn = updateReturn; - function createWith(expression, statement, location) { - var node = createNode(217 /* WithStatement */, location); + function createWith(expression, statement) { + var node = createSynthesizedNode(219 /* WithStatement */); node.expression = expression; node.statement = statement; return node; } ts.createWith = createWith; function updateWith(node, expression, statement) { - if (node.expression !== expression || node.statement !== statement) { - return updateNode(createWith(expression, statement, node), node); - } - return node; + return node.expression !== expression + || node.statement !== statement + ? updateNode(createWith(expression, statement), node) + : node; } ts.updateWith = updateWith; - function createSwitch(expression, caseBlock, location) { - var node = createNode(218 /* SwitchStatement */, location); - node.expression = parenthesizeExpressionForList(expression); + function createSwitch(expression, caseBlock) { + var node = createSynthesizedNode(220 /* SwitchStatement */); + node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; } ts.createSwitch = createSwitch; function updateSwitch(node, expression, caseBlock) { - if (node.expression !== expression || node.caseBlock !== caseBlock) { - return updateNode(createSwitch(expression, caseBlock, node), node); - } - return node; + return node.expression !== expression + || node.caseBlock !== caseBlock + ? updateNode(createSwitch(expression, caseBlock), node) + : node; } ts.updateSwitch = updateSwitch; - function createLabel(label, statement, location) { - var node = createNode(219 /* LabeledStatement */, location); - node.label = typeof label === "string" ? createIdentifier(label) : label; + function createLabel(label, statement) { + var node = createSynthesizedNode(221 /* LabeledStatement */); + node.label = asName(label); node.statement = statement; return node; } ts.createLabel = createLabel; function updateLabel(node, label, statement) { - if (node.label !== label || node.statement !== statement) { - return updateNode(createLabel(label, statement, node), node); - } - return node; + return node.label !== label + || node.statement !== statement + ? updateNode(createLabel(label, statement), node) + : node; } ts.updateLabel = updateLabel; - function createThrow(expression, location) { - var node = createNode(220 /* ThrowStatement */, location); + function createThrow(expression) { + var node = createSynthesizedNode(222 /* ThrowStatement */); node.expression = expression; return node; } ts.createThrow = createThrow; function updateThrow(node, expression) { - if (node.expression !== expression) { - return updateNode(createThrow(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createThrow(expression), node) + : node; } ts.updateThrow = updateThrow; - function createTry(tryBlock, catchClause, finallyBlock, location) { - var node = createNode(221 /* TryStatement */, location); + function createTry(tryBlock, catchClause, finallyBlock) { + var node = createSynthesizedNode(223 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -11644,195 +12207,286 @@ var ts; } ts.createTry = createTry; function updateTry(node, tryBlock, catchClause, finallyBlock) { - if (node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock) { - return updateNode(createTry(tryBlock, catchClause, finallyBlock, node), node); - } - return node; + return node.tryBlock !== tryBlock + || node.catchClause !== catchClause + || node.finallyBlock !== finallyBlock + ? updateNode(createTry(tryBlock, catchClause, finallyBlock), node) + : node; } ts.updateTry = updateTry; - function createCaseBlock(clauses, location) { - var node = createNode(232 /* CaseBlock */, location); - node.clauses = createNodeArray(clauses); - return node; - } - ts.createCaseBlock = createCaseBlock; - function updateCaseBlock(node, clauses) { - if (node.clauses !== clauses) { - return updateNode(createCaseBlock(clauses, node), node); - } - return node; - } - ts.updateCaseBlock = updateCaseBlock; - function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) { - var node = createNode(225 /* FunctionDeclaration */, location, flags); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + var node = createSynthesizedNode(227 /* FunctionDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.body = body; return node; } ts.createFunctionDeclaration = createFunctionDeclaration; - function updateFunctionDeclaration(node, decorators, modifiers, name, typeParameters, parameters, type, body) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) { - return updateNode(createFunctionDeclaration(decorators, modifiers, node.asteriskToken, name, typeParameters, parameters, type, body, /*location*/ node, node.flags), node); - } - return node; + function updateFunctionDeclaration(node, decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.asteriskToken !== asteriskToken + || node.name !== name + || node.typeParameters !== typeParameters + || node.parameters !== parameters + || node.type !== type + || node.body !== body + ? updateNode(createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) + : node; } ts.updateFunctionDeclaration = updateFunctionDeclaration; - function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members, location) { - var node = createNode(226 /* ClassDeclaration */, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; - node.name = name; - node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined; - node.heritageClauses = createNodeArray(heritageClauses); + function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { + var node = createSynthesizedNode(228 /* ClassDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.typeParameters = asNodeArray(typeParameters); + node.heritageClauses = asNodeArray(heritageClauses); node.members = createNodeArray(members); return node; } ts.createClassDeclaration = createClassDeclaration; function updateClassDeclaration(node, decorators, modifiers, name, typeParameters, heritageClauses, members) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members) { - return updateNode(createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.typeParameters !== typeParameters + || node.heritageClauses !== heritageClauses + || node.members !== members + ? updateNode(createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members), node) + : node; } ts.updateClassDeclaration = updateClassDeclaration; - function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier, location) { - var node = createNode(235 /* ImportDeclaration */, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createEnumDeclaration(decorators, modifiers, name, members) { + var node = createSynthesizedNode(231 /* EnumDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.members = createNodeArray(members); + return node; + } + ts.createEnumDeclaration = createEnumDeclaration; + function updateEnumDeclaration(node, decorators, modifiers, name, members) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.members !== members + ? updateNode(createEnumDeclaration(decorators, modifiers, name, members), node) + : node; + } + ts.updateEnumDeclaration = updateEnumDeclaration; + function createModuleDeclaration(decorators, modifiers, name, body, flags) { + var node = createSynthesizedNode(232 /* ModuleDeclaration */); + node.flags |= flags; + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = name; + node.body = body; + return node; + } + ts.createModuleDeclaration = createModuleDeclaration; + function updateModuleDeclaration(node, decorators, modifiers, name, body) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.body !== body + ? updateNode(createModuleDeclaration(decorators, modifiers, name, body, node.flags), node) + : node; + } + ts.updateModuleDeclaration = updateModuleDeclaration; + function createModuleBlock(statements) { + var node = createSynthesizedNode(233 /* ModuleBlock */); + node.statements = createNodeArray(statements); + return node; + } + ts.createModuleBlock = createModuleBlock; + function updateModuleBlock(node, statements) { + return node.statements !== statements + ? updateNode(createModuleBlock(statements), node) + : node; + } + ts.updateModuleBlock = updateModuleBlock; + function createCaseBlock(clauses) { + var node = createSynthesizedNode(234 /* CaseBlock */); + node.clauses = createNodeArray(clauses); + return node; + } + ts.createCaseBlock = createCaseBlock; + function updateCaseBlock(node, clauses) { + return node.clauses !== clauses + ? updateNode(createCaseBlock(clauses), node) + : node; + } + ts.updateCaseBlock = updateCaseBlock; + function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { + var node = createSynthesizedNode(236 /* ImportEqualsDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name); + node.moduleReference = moduleReference; + return node; + } + ts.createImportEqualsDeclaration = createImportEqualsDeclaration; + function updateImportEqualsDeclaration(node, decorators, modifiers, name, moduleReference) { + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.name !== name + || node.moduleReference !== moduleReference + ? updateNode(createImportEqualsDeclaration(decorators, modifiers, name, moduleReference), node) + : node; + } + ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; + function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { + var node = createSynthesizedNode(237 /* ImportDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.importClause = importClause; node.moduleSpecifier = moduleSpecifier; return node; } ts.createImportDeclaration = createImportDeclaration; function updateImportDeclaration(node, decorators, modifiers, importClause, moduleSpecifier) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier) { - return updateNode(createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier + ? updateNode(createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier), node) + : node; } ts.updateImportDeclaration = updateImportDeclaration; - function createImportClause(name, namedBindings, location) { - var node = createNode(236 /* ImportClause */, location); + function createImportClause(name, namedBindings) { + var node = createSynthesizedNode(238 /* ImportClause */); node.name = name; node.namedBindings = namedBindings; return node; } ts.createImportClause = createImportClause; function updateImportClause(node, name, namedBindings) { - if (node.name !== name || node.namedBindings !== namedBindings) { - return updateNode(createImportClause(name, namedBindings, node), node); - } - return node; + return node.name !== name + || node.namedBindings !== namedBindings + ? updateNode(createImportClause(name, namedBindings), node) + : node; } ts.updateImportClause = updateImportClause; - function createNamespaceImport(name, location) { - var node = createNode(237 /* NamespaceImport */, location); + function createNamespaceImport(name) { + var node = createSynthesizedNode(239 /* NamespaceImport */); node.name = name; return node; } ts.createNamespaceImport = createNamespaceImport; function updateNamespaceImport(node, name) { - if (node.name !== name) { - return updateNode(createNamespaceImport(name, node), node); - } - return node; + return node.name !== name + ? updateNode(createNamespaceImport(name), node) + : node; } ts.updateNamespaceImport = updateNamespaceImport; - function createNamedImports(elements, location) { - var node = createNode(238 /* NamedImports */, location); + function createNamedImports(elements) { + var node = createSynthesizedNode(240 /* NamedImports */); node.elements = createNodeArray(elements); return node; } ts.createNamedImports = createNamedImports; function updateNamedImports(node, elements) { - if (node.elements !== elements) { - return updateNode(createNamedImports(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createNamedImports(elements), node) + : node; } ts.updateNamedImports = updateNamedImports; - function createImportSpecifier(propertyName, name, location) { - var node = createNode(239 /* ImportSpecifier */, location); + function createImportSpecifier(propertyName, name) { + var node = createSynthesizedNode(241 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; return node; } ts.createImportSpecifier = createImportSpecifier; function updateImportSpecifier(node, propertyName, name) { - if (node.propertyName !== propertyName || node.name !== name) { - return updateNode(createImportSpecifier(propertyName, name, node), node); - } - return node; + return node.propertyName !== propertyName + || node.name !== name + ? updateNode(createImportSpecifier(propertyName, name), node) + : node; } ts.updateImportSpecifier = updateImportSpecifier; - function createExportAssignment(decorators, modifiers, isExportEquals, expression, location) { - var node = createNode(240 /* ExportAssignment */, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createExportAssignment(decorators, modifiers, isExportEquals, expression) { + var node = createSynthesizedNode(242 /* ExportAssignment */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; node.expression = expression; return node; } ts.createExportAssignment = createExportAssignment; function updateExportAssignment(node, decorators, modifiers, expression) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.expression !== expression) { - return updateNode(createExportAssignment(decorators, modifiers, node.isExportEquals, expression, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.expression !== expression + ? updateNode(createExportAssignment(decorators, modifiers, node.isExportEquals, expression), node) + : node; } ts.updateExportAssignment = updateExportAssignment; - function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, location) { - var node = createNode(241 /* ExportDeclaration */, location); - node.decorators = decorators ? createNodeArray(decorators) : undefined; - node.modifiers = modifiers ? createNodeArray(modifiers) : undefined; + function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier) { + var node = createSynthesizedNode(243 /* ExportDeclaration */); + node.decorators = asNodeArray(decorators); + node.modifiers = asNodeArray(modifiers); node.exportClause = exportClause; node.moduleSpecifier = moduleSpecifier; return node; } ts.createExportDeclaration = createExportDeclaration; function updateExportDeclaration(node, decorators, modifiers, exportClause, moduleSpecifier) { - if (node.decorators !== decorators || node.modifiers !== modifiers || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier) { - return updateNode(createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, node), node); - } - return node; + return node.decorators !== decorators + || node.modifiers !== modifiers + || node.exportClause !== exportClause + || node.moduleSpecifier !== moduleSpecifier + ? updateNode(createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier), node) + : node; } ts.updateExportDeclaration = updateExportDeclaration; - function createNamedExports(elements, location) { - var node = createNode(242 /* NamedExports */, location); + function createNamedExports(elements) { + var node = createSynthesizedNode(244 /* NamedExports */); node.elements = createNodeArray(elements); return node; } ts.createNamedExports = createNamedExports; function updateNamedExports(node, elements) { - if (node.elements !== elements) { - return updateNode(createNamedExports(elements, node), node); - } - return node; + return node.elements !== elements + ? updateNode(createNamedExports(elements), node) + : node; } ts.updateNamedExports = updateNamedExports; - function createExportSpecifier(name, propertyName, location) { - var node = createNode(243 /* ExportSpecifier */, location); - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.propertyName = typeof propertyName === "string" ? createIdentifier(propertyName) : propertyName; + function createExportSpecifier(propertyName, name) { + var node = createSynthesizedNode(245 /* ExportSpecifier */); + node.propertyName = asName(propertyName); + node.name = asName(name); return node; } ts.createExportSpecifier = createExportSpecifier; - function updateExportSpecifier(node, name, propertyName) { - if (node.name !== name || node.propertyName !== propertyName) { - return updateNode(createExportSpecifier(name, propertyName, node), node); - } - return node; + function updateExportSpecifier(node, propertyName, name) { + return node.propertyName !== propertyName + || node.name !== name + ? updateNode(createExportSpecifier(propertyName, name), node) + : node; } ts.updateExportSpecifier = updateExportSpecifier; + // Module references + function createExternalModuleReference(expression) { + var node = createSynthesizedNode(247 /* ExternalModuleReference */); + node.expression = expression; + return node; + } + ts.createExternalModuleReference = createExternalModuleReference; + function updateExternalModuleReference(node, expression) { + return node.expression !== expression + ? updateNode(createExternalModuleReference(expression), node) + : node; + } + ts.updateExternalModuleReference = updateExternalModuleReference; // JSX - function createJsxElement(openingElement, children, closingElement, location) { - var node = createNode(246 /* JsxElement */, location); + function createJsxElement(openingElement, children, closingElement) { + var node = createSynthesizedNode(248 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -11840,96 +12494,108 @@ var ts; } ts.createJsxElement = createJsxElement; function updateJsxElement(node, openingElement, children, closingElement) { - if (node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement) { - return updateNode(createJsxElement(openingElement, children, closingElement, node), node); - } - return node; + return node.openingElement !== openingElement + || node.children !== children + || node.closingElement !== closingElement + ? updateNode(createJsxElement(openingElement, children, closingElement), node) + : node; } ts.updateJsxElement = updateJsxElement; - function createJsxSelfClosingElement(tagName, attributes, location) { - var node = createNode(247 /* JsxSelfClosingElement */, location); + function createJsxSelfClosingElement(tagName, attributes) { + var node = createSynthesizedNode(249 /* JsxSelfClosingElement */); node.tagName = tagName; - node.attributes = createNodeArray(attributes); + node.attributes = attributes; return node; } ts.createJsxSelfClosingElement = createJsxSelfClosingElement; function updateJsxSelfClosingElement(node, tagName, attributes) { - if (node.tagName !== tagName || node.attributes !== attributes) { - return updateNode(createJsxSelfClosingElement(tagName, attributes, node), node); - } - return node; + return node.tagName !== tagName + || node.attributes !== attributes + ? updateNode(createJsxSelfClosingElement(tagName, attributes), node) + : node; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; - function createJsxOpeningElement(tagName, attributes, location) { - var node = createNode(248 /* JsxOpeningElement */, location); + function createJsxOpeningElement(tagName, attributes) { + var node = createSynthesizedNode(250 /* JsxOpeningElement */); node.tagName = tagName; - node.attributes = createNodeArray(attributes); + node.attributes = attributes; return node; } ts.createJsxOpeningElement = createJsxOpeningElement; function updateJsxOpeningElement(node, tagName, attributes) { - if (node.tagName !== tagName || node.attributes !== attributes) { - return updateNode(createJsxOpeningElement(tagName, attributes, node), node); - } - return node; + return node.tagName !== tagName + || node.attributes !== attributes + ? updateNode(createJsxOpeningElement(tagName, attributes), node) + : node; } ts.updateJsxOpeningElement = updateJsxOpeningElement; - function createJsxClosingElement(tagName, location) { - var node = createNode(249 /* JsxClosingElement */, location); + function createJsxClosingElement(tagName) { + var node = createSynthesizedNode(251 /* JsxClosingElement */); node.tagName = tagName; return node; } ts.createJsxClosingElement = createJsxClosingElement; function updateJsxClosingElement(node, tagName) { - if (node.tagName !== tagName) { - return updateNode(createJsxClosingElement(tagName, node), node); - } - return node; + return node.tagName !== tagName + ? updateNode(createJsxClosingElement(tagName), node) + : node; } ts.updateJsxClosingElement = updateJsxClosingElement; - function createJsxAttribute(name, initializer, location) { - var node = createNode(250 /* JsxAttribute */, location); + function createJsxAttributes(properties) { + var jsxAttributes = createSynthesizedNode(253 /* JsxAttributes */); + jsxAttributes.properties = createNodeArray(properties); + return jsxAttributes; + } + ts.createJsxAttributes = createJsxAttributes; + function updateJsxAttributes(jsxAttributes, properties) { + if (jsxAttributes.properties !== properties) { + return updateNode(createJsxAttributes(properties), jsxAttributes); + } + return jsxAttributes; + } + ts.updateJsxAttributes = updateJsxAttributes; + function createJsxAttribute(name, initializer) { + var node = createSynthesizedNode(252 /* JsxAttribute */); node.name = name; node.initializer = initializer; return node; } ts.createJsxAttribute = createJsxAttribute; function updateJsxAttribute(node, name, initializer) { - if (node.name !== name || node.initializer !== initializer) { - return updateNode(createJsxAttribute(name, initializer, node), node); - } - return node; + return node.name !== name + || node.initializer !== initializer + ? updateNode(createJsxAttribute(name, initializer), node) + : node; } ts.updateJsxAttribute = updateJsxAttribute; - function createJsxSpreadAttribute(expression, location) { - var node = createNode(251 /* JsxSpreadAttribute */, location); + function createJsxSpreadAttribute(expression) { + var node = createSynthesizedNode(254 /* JsxSpreadAttribute */); node.expression = expression; return node; } ts.createJsxSpreadAttribute = createJsxSpreadAttribute; function updateJsxSpreadAttribute(node, expression) { - if (node.expression !== expression) { - return updateNode(createJsxSpreadAttribute(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createJsxSpreadAttribute(expression), node) + : node; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; - function createJsxExpression(expression, location) { - var node = createNode(252 /* JsxExpression */, location); + function createJsxExpression(dotDotDotToken, expression) { + var node = createSynthesizedNode(255 /* JsxExpression */); + node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; } ts.createJsxExpression = createJsxExpression; function updateJsxExpression(node, expression) { - if (node.expression !== expression) { - return updateNode(createJsxExpression(expression, node), node); - } - return node; + return node.expression !== expression + ? updateNode(createJsxExpression(node.dotDotDotToken, expression), node) + : node; } ts.updateJsxExpression = updateJsxExpression; // Clauses - function createHeritageClause(token, types, location) { - var node = createNode(255 /* HeritageClause */, location); + function createHeritageClause(token, types) { + var node = createSynthesizedNode(258 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); return node; @@ -11937,40 +12603,40 @@ var ts; ts.createHeritageClause = createHeritageClause; function updateHeritageClause(node, types) { if (node.types !== types) { - return updateNode(createHeritageClause(node.token, types, node), node); + return updateNode(createHeritageClause(node.token, types), node); } return node; } ts.updateHeritageClause = updateHeritageClause; - function createCaseClause(expression, statements, location) { - var node = createNode(253 /* CaseClause */, location); - node.expression = parenthesizeExpressionForList(expression); + function createCaseClause(expression, statements) { + var node = createSynthesizedNode(256 /* CaseClause */); + node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; } ts.createCaseClause = createCaseClause; function updateCaseClause(node, expression, statements) { if (node.expression !== expression || node.statements !== statements) { - return updateNode(createCaseClause(expression, statements, node), node); + return updateNode(createCaseClause(expression, statements), node); } return node; } ts.updateCaseClause = updateCaseClause; - function createDefaultClause(statements, location) { - var node = createNode(254 /* DefaultClause */, location); + function createDefaultClause(statements) { + var node = createSynthesizedNode(257 /* DefaultClause */); node.statements = createNodeArray(statements); return node; } ts.createDefaultClause = createDefaultClause; function updateDefaultClause(node, statements) { if (node.statements !== statements) { - return updateNode(createDefaultClause(statements, node), node); + return updateNode(createDefaultClause(statements), node); } return node; } ts.updateDefaultClause = updateDefaultClause; - function createCatchClause(variableDeclaration, block, location) { - var node = createNode(256 /* CatchClause */, location); + function createCatchClause(variableDeclaration, block) { + var node = createSynthesizedNode(259 /* CatchClause */); node.variableDeclaration = typeof variableDeclaration === "string" ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -11978,58 +12644,74 @@ var ts; ts.createCatchClause = createCatchClause; function updateCatchClause(node, variableDeclaration, block) { if (node.variableDeclaration !== variableDeclaration || node.block !== block) { - return updateNode(createCatchClause(variableDeclaration, block, node), node); + return updateNode(createCatchClause(variableDeclaration, block), node); } return node; } ts.updateCatchClause = updateCatchClause; // Property assignments - function createPropertyAssignment(name, initializer, location) { - var node = createNode(257 /* PropertyAssignment */, location); - node.name = typeof name === "string" ? createIdentifier(name) : name; + function createPropertyAssignment(name, initializer) { + var node = createSynthesizedNode(260 /* PropertyAssignment */); + node.name = asName(name); node.questionToken = undefined; - node.initializer = initializer !== undefined ? parenthesizeExpressionForList(initializer) : undefined; + node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; return node; } ts.createPropertyAssignment = createPropertyAssignment; function updatePropertyAssignment(node, name, initializer) { if (node.name !== name || node.initializer !== initializer) { - return updateNode(createPropertyAssignment(name, initializer, node), node); + return updateNode(createPropertyAssignment(name, initializer), node); } return node; } ts.updatePropertyAssignment = updatePropertyAssignment; - function createShorthandPropertyAssignment(name, objectAssignmentInitializer, location) { - var node = createNode(258 /* ShorthandPropertyAssignment */, location); - node.name = typeof name === "string" ? createIdentifier(name) : name; - node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; + function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { + var node = createSynthesizedNode(261 /* ShorthandPropertyAssignment */); + node.name = asName(name); + node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; } ts.createShorthandPropertyAssignment = createShorthandPropertyAssignment; - function createSpreadAssignment(expression, location) { - var node = createNode(259 /* SpreadAssignment */, location); - node.expression = expression !== undefined ? parenthesizeExpressionForList(expression) : undefined; - return node; - } - ts.createSpreadAssignment = createSpreadAssignment; function updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer) { if (node.name !== name || node.objectAssignmentInitializer !== objectAssignmentInitializer) { - return updateNode(createShorthandPropertyAssignment(name, objectAssignmentInitializer, node), node); + return updateNode(createShorthandPropertyAssignment(name, objectAssignmentInitializer), node); } return node; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; + function createSpreadAssignment(expression) { + var node = createSynthesizedNode(262 /* SpreadAssignment */); + node.expression = expression !== undefined ? ts.parenthesizeExpressionForList(expression) : undefined; + return node; + } + ts.createSpreadAssignment = createSpreadAssignment; function updateSpreadAssignment(node, expression) { if (node.expression !== expression) { - return updateNode(createSpreadAssignment(expression, node), node); + return updateNode(createSpreadAssignment(expression), node); } return node; } ts.updateSpreadAssignment = updateSpreadAssignment; + // Enum + function createEnumMember(name, initializer) { + var node = createSynthesizedNode(263 /* EnumMember */); + node.name = asName(name); + node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); + return node; + } + ts.createEnumMember = createEnumMember; + function updateEnumMember(node, name, initializer) { + return node.name !== name + || node.initializer !== initializer + ? updateNode(createEnumMember(name, initializer), node) + : node; + } + ts.updateEnumMember = updateEnumMember; // Top-level nodes function updateSourceFileNode(node, statements) { if (node.statements !== statements) { - var updated = createNode(261 /* SourceFile */, /*location*/ node, node.flags); + var updated = createSynthesizedNode(264 /* SourceFile */); + updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; updated.fileName = node.fileName; @@ -12088,6 +12770,17 @@ var ts; return node; } ts.updateSourceFileNode = updateSourceFileNode; + /** + * Creates a shallow, memberwise clone of a node for mutation. + */ + function getMutableClone(node) { + var clone = getSynthesizedClone(node); + clone.pos = node.pos; + clone.end = node.end; + clone.parent = node.parent; + return clone; + } + ts.getMutableClone = getMutableClone; // Transformation nodes /** * Creates a synthetic statement to act as a placeholder for a not-emitted statement in @@ -12096,8 +12789,9 @@ var ts; * @param original The original statement. */ function createNotEmittedStatement(original) { - var node = createNode(293 /* NotEmittedStatement */, /*location*/ original); + var node = createSynthesizedNode(294 /* NotEmittedStatement */); node.original = original; + setTextRange(node, original); return node; } ts.createNotEmittedStatement = createNotEmittedStatement; @@ -12105,8 +12799,9 @@ var ts; * Creates a synthetic element to act as a placeholder for the end of an emitted declaration in * order to properly emit exports. */ + /* @internal */ function createEndOfDeclarationMarker(original) { - var node = createNode(296 /* EndOfDeclarationMarker */); + var node = createSynthesizedNode(297 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -12116,8 +12811,9 @@ var ts; * Creates a synthetic element to act as a placeholder for the beginning of a merged declaration in * order to properly emit exports. */ + /* @internal */ function createMergeDeclarationMarker(original) { - var node = createNode(295 /* MergeDeclarationMarker */); + var node = createSynthesizedNode(296 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -12131,44 +12827,45 @@ var ts; * @param original The original outer expression. * @param location The location for the expression. Defaults to the positions from "original" if provided. */ - function createPartiallyEmittedExpression(expression, original, location) { - var node = createNode(294 /* PartiallyEmittedExpression */, /*location*/ location || original); + function createPartiallyEmittedExpression(expression, original) { + var node = createSynthesizedNode(295 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; + setTextRange(node, original); return node; } ts.createPartiallyEmittedExpression = createPartiallyEmittedExpression; function updatePartiallyEmittedExpression(node, expression) { if (node.expression !== expression) { - return updateNode(createPartiallyEmittedExpression(expression, node.original, node), node); + return updateNode(createPartiallyEmittedExpression(expression, node.original), node); } return node; } ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; - /** - * Creates a node that emits a string of raw text in an expression position. Raw text is never - * transformed, should be ES3 compliant, and should have the same precedence as - * PrimaryExpression. - * - * @param text The raw text of the node. - */ - function createRawExpression(text) { - var node = createNode(297 /* RawExpression */); - node.text = text; + function createBundle(sourceFiles) { + var node = ts.createNode(265 /* Bundle */); + node.sourceFiles = sourceFiles; return node; } - ts.createRawExpression = createRawExpression; + ts.createBundle = createBundle; + function updateBundle(node, sourceFiles) { + if (node.sourceFiles !== sourceFiles) { + return createBundle(sourceFiles); + } + return node; + } + ts.updateBundle = updateBundle; // Compound nodes function createComma(left, right) { return createBinary(left, 25 /* CommaToken */, right); } ts.createComma = createComma; - function createLessThan(left, right, location) { - return createBinary(left, 26 /* LessThanToken */, right, location); + function createLessThan(left, right) { + return createBinary(left, 26 /* LessThanToken */, right); } ts.createLessThan = createLessThan; - function createAssignment(left, right, location) { - return createBinary(left, 57 /* EqualsToken */, right, location); + function createAssignment(left, right) { + return createBinary(left, 57 /* EqualsToken */, right); } ts.createAssignment = createAssignment; function createStrictEquality(left, right) { @@ -12187,8 +12884,8 @@ var ts; return createBinary(left, 37 /* MinusToken */, right); } ts.createSubtract = createSubtract; - function createPostfixIncrement(operand, location) { - return createPostfix(operand, 42 /* PlusPlusToken */, location); + function createPostfixIncrement(operand) { + return createPostfix(operand, 42 /* PlusPlusToken */); } ts.createPostfixIncrement = createPostfixIncrement; function createLogicalAnd(left, right) { @@ -12207,61 +12904,378 @@ var ts; return createVoid(createLiteral(0)); } ts.createVoidZero = createVoidZero; + function createExportDefault(expression) { + return createExportAssignment(/*decorators*/ undefined, /*modifiers*/ undefined, /*isExportEquals*/ false, expression); + } + ts.createExportDefault = createExportDefault; + function createExternalModuleExport(exportName) { + return createExportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, createNamedExports([createExportSpecifier(/*propertyName*/ undefined, exportName)])); + } + ts.createExternalModuleExport = createExternalModuleExport; + function asName(name) { + return typeof name === "string" ? createIdentifier(name) : name; + } + function asExpression(value) { + return typeof value === "string" || typeof value === "number" ? createLiteral(value) : value; + } + function asNodeArray(array) { + return array ? createNodeArray(array) : undefined; + } + function asToken(value) { + return typeof value === "number" ? createToken(value) : value; + } + /** + * Clears any EmitNode entries from parse-tree nodes. + * @param sourceFile A source file. + */ + function disposeEmitNodes(sourceFile) { + // During transformation we may need to annotate a parse tree node with transient + // transformation properties. As parse tree nodes live longer than transformation + // nodes, we need to make sure we reclaim any memory allocated for custom ranges + // from these nodes to ensure we do not hold onto entire subtrees just for position + // information. We also need to reset these nodes to a pre-transformation state + // for incremental parsing scenarios so that we do not impact later emit. + sourceFile = ts.getSourceFileOfNode(ts.getParseTreeNode(sourceFile)); + var emitNode = sourceFile && sourceFile.emitNode; + var annotatedNodes = emitNode && emitNode.annotatedNodes; + if (annotatedNodes) { + for (var _i = 0, annotatedNodes_1 = annotatedNodes; _i < annotatedNodes_1.length; _i++) { + var node = annotatedNodes_1[_i]; + node.emitNode = undefined; + } + } + } + ts.disposeEmitNodes = disposeEmitNodes; + /** + * Associates a node with the current transformation, initializing + * various transient transformation properties. + */ + /* @internal */ + function getOrCreateEmitNode(node) { + if (!node.emitNode) { + if (ts.isParseTreeNode(node)) { + // To avoid holding onto transformation artifacts, we keep track of any + // parse tree node we are annotating. This allows us to clean them up after + // all transformations have completed. + if (node.kind === 264 /* SourceFile */) { + return node.emitNode = { annotatedNodes: [node] }; + } + var sourceFile = ts.getSourceFileOfNode(node); + getOrCreateEmitNode(sourceFile).annotatedNodes.push(node); + } + node.emitNode = {}; + } + return node.emitNode; + } + ts.getOrCreateEmitNode = getOrCreateEmitNode; + function setTextRange(range, location) { + if (location) { + range.pos = location.pos; + range.end = location.end; + } + return range; + } + ts.setTextRange = setTextRange; + /** + * Gets flags that control emit behavior of a node. + */ + function getEmitFlags(node) { + var emitNode = node.emitNode; + return emitNode && emitNode.flags; + } + ts.getEmitFlags = getEmitFlags; + /** + * Sets flags that control emit behavior of a node. + */ + function setEmitFlags(node, emitFlags) { + getOrCreateEmitNode(node).flags = emitFlags; + return node; + } + ts.setEmitFlags = setEmitFlags; + /** + * Gets a custom text range to use when emitting source maps. + */ + function getSourceMapRange(node) { + var emitNode = node.emitNode; + return (emitNode && emitNode.sourceMapRange) || node; + } + ts.getSourceMapRange = getSourceMapRange; + /** + * Sets a custom text range to use when emitting source maps. + */ + function setSourceMapRange(node, range) { + getOrCreateEmitNode(node).sourceMapRange = range; + return node; + } + ts.setSourceMapRange = setSourceMapRange; + /** + * Gets the TextRange to use for source maps for a token of a node. + */ + function getTokenSourceMapRange(node, token) { + var emitNode = node.emitNode; + var tokenSourceMapRanges = emitNode && emitNode.tokenSourceMapRanges; + return tokenSourceMapRanges && tokenSourceMapRanges[token]; + } + ts.getTokenSourceMapRange = getTokenSourceMapRange; + /** + * Sets the TextRange to use for source maps for a token of a node. + */ + function setTokenSourceMapRange(node, token, range) { + var emitNode = getOrCreateEmitNode(node); + var tokenSourceMapRanges = emitNode.tokenSourceMapRanges || (emitNode.tokenSourceMapRanges = []); + tokenSourceMapRanges[token] = range; + return node; + } + ts.setTokenSourceMapRange = setTokenSourceMapRange; + /** + * Gets a custom text range to use when emitting comments. + */ + function getCommentRange(node) { + var emitNode = node.emitNode; + return (emitNode && emitNode.commentRange) || node; + } + ts.getCommentRange = getCommentRange; + /** + * Sets a custom text range to use when emitting comments. + */ + function setCommentRange(node, range) { + getOrCreateEmitNode(node).commentRange = range; + return node; + } + ts.setCommentRange = setCommentRange; + function getSyntheticLeadingComments(node) { + var emitNode = node.emitNode; + return emitNode && emitNode.leadingComments; + } + ts.getSyntheticLeadingComments = getSyntheticLeadingComments; + function setSyntheticLeadingComments(node, comments) { + getOrCreateEmitNode(node).leadingComments = comments; + return node; + } + ts.setSyntheticLeadingComments = setSyntheticLeadingComments; + function addSyntheticLeadingComment(node, kind, text, hasTrailingNewLine) { + return setSyntheticLeadingComments(node, ts.append(getSyntheticLeadingComments(node), { kind: kind, pos: -1, end: -1, hasTrailingNewLine: hasTrailingNewLine, text: text })); + } + ts.addSyntheticLeadingComment = addSyntheticLeadingComment; + function getSyntheticTrailingComments(node) { + var emitNode = node.emitNode; + return emitNode && emitNode.trailingComments; + } + ts.getSyntheticTrailingComments = getSyntheticTrailingComments; + function setSyntheticTrailingComments(node, comments) { + getOrCreateEmitNode(node).trailingComments = comments; + return node; + } + ts.setSyntheticTrailingComments = setSyntheticTrailingComments; + function addSyntheticTrailingComment(node, kind, text, hasTrailingNewLine) { + return setSyntheticTrailingComments(node, ts.append(getSyntheticTrailingComments(node), { kind: kind, pos: -1, end: -1, hasTrailingNewLine: hasTrailingNewLine, text: text })); + } + ts.addSyntheticTrailingComment = addSyntheticTrailingComment; + /** + * Gets the constant value to emit for an expression. + */ + function getConstantValue(node) { + var emitNode = node.emitNode; + return emitNode && emitNode.constantValue; + } + ts.getConstantValue = getConstantValue; + /** + * Sets the constant value to emit for an expression. + */ + function setConstantValue(node, value) { + var emitNode = getOrCreateEmitNode(node); + emitNode.constantValue = value; + return node; + } + ts.setConstantValue = setConstantValue; + /** + * Adds an EmitHelper to a node. + */ + function addEmitHelper(node, helper) { + var emitNode = getOrCreateEmitNode(node); + emitNode.helpers = ts.append(emitNode.helpers, helper); + return node; + } + ts.addEmitHelper = addEmitHelper; + /** + * Add EmitHelpers to a node. + */ + function addEmitHelpers(node, helpers) { + if (ts.some(helpers)) { + var emitNode = getOrCreateEmitNode(node); + for (var _i = 0, helpers_1 = helpers; _i < helpers_1.length; _i++) { + var helper = helpers_1[_i]; + if (!ts.contains(emitNode.helpers, helper)) { + emitNode.helpers = ts.append(emitNode.helpers, helper); + } + } + } + return node; + } + ts.addEmitHelpers = addEmitHelpers; + /** + * Removes an EmitHelper from a node. + */ + function removeEmitHelper(node, helper) { + var emitNode = node.emitNode; + if (emitNode) { + var helpers = emitNode.helpers; + if (helpers) { + return ts.orderedRemoveItem(helpers, helper); + } + } + return false; + } + ts.removeEmitHelper = removeEmitHelper; + /** + * Gets the EmitHelpers of a node. + */ + function getEmitHelpers(node) { + var emitNode = node.emitNode; + return emitNode && emitNode.helpers; + } + ts.getEmitHelpers = getEmitHelpers; + /** + * Moves matching emit helpers from a source node to a target node. + */ + function moveEmitHelpers(source, target, predicate) { + var sourceEmitNode = source.emitNode; + var sourceEmitHelpers = sourceEmitNode && sourceEmitNode.helpers; + if (!ts.some(sourceEmitHelpers)) + return; + var targetEmitNode = getOrCreateEmitNode(target); + var helpersRemoved = 0; + for (var i = 0; i < sourceEmitHelpers.length; i++) { + var helper = sourceEmitHelpers[i]; + if (predicate(helper)) { + helpersRemoved++; + if (!ts.contains(targetEmitNode.helpers, helper)) { + targetEmitNode.helpers = ts.append(targetEmitNode.helpers, helper); + } + } + else if (helpersRemoved > 0) { + sourceEmitHelpers[i - helpersRemoved] = helper; + } + } + if (helpersRemoved > 0) { + sourceEmitHelpers.length -= helpersRemoved; + } + } + ts.moveEmitHelpers = moveEmitHelpers; + /* @internal */ + function compareEmitHelpers(x, y) { + if (x === y) + return 0 /* EqualTo */; + if (x.priority === y.priority) + return 0 /* EqualTo */; + if (x.priority === undefined) + return 1 /* GreaterThan */; + if (y.priority === undefined) + return -1 /* LessThan */; + return ts.compareValues(x.priority, y.priority); + } + ts.compareEmitHelpers = compareEmitHelpers; + function setOriginalNode(node, original) { + node.original = original; + if (original) { + var emitNode = original.emitNode; + if (emitNode) + node.emitNode = mergeEmitNode(emitNode, node.emitNode); + } + return node; + } + ts.setOriginalNode = setOriginalNode; + function mergeEmitNode(sourceEmitNode, destEmitNode) { + var flags = sourceEmitNode.flags, leadingComments = sourceEmitNode.leadingComments, trailingComments = sourceEmitNode.trailingComments, commentRange = sourceEmitNode.commentRange, sourceMapRange = sourceEmitNode.sourceMapRange, tokenSourceMapRanges = sourceEmitNode.tokenSourceMapRanges, constantValue = sourceEmitNode.constantValue, helpers = sourceEmitNode.helpers; + if (!destEmitNode) + destEmitNode = {}; + if (leadingComments) + destEmitNode.leadingComments = ts.addRange(leadingComments.slice(), destEmitNode.leadingComments); + if (trailingComments) + destEmitNode.trailingComments = ts.addRange(trailingComments.slice(), destEmitNode.trailingComments); + if (flags) + destEmitNode.flags = flags; + if (commentRange) + destEmitNode.commentRange = commentRange; + if (sourceMapRange) + destEmitNode.sourceMapRange = sourceMapRange; + if (tokenSourceMapRanges) + destEmitNode.tokenSourceMapRanges = mergeTokenSourceMapRanges(tokenSourceMapRanges, destEmitNode.tokenSourceMapRanges); + if (constantValue !== undefined) + destEmitNode.constantValue = constantValue; + if (helpers) + destEmitNode.helpers = ts.addRange(destEmitNode.helpers, helpers); + return destEmitNode; + } + function mergeTokenSourceMapRanges(sourceRanges, destRanges) { + if (!destRanges) + destRanges = []; + for (var key in sourceRanges) { + destRanges[key] = sourceRanges[key]; + } + return destRanges; + } +})(ts || (ts = {})); +/* @internal */ +(function (ts) { + // Compound nodes function createTypeCheck(value, tag) { return tag === "undefined" - ? createStrictEquality(value, createVoidZero()) - : createStrictEquality(createTypeOf(value), createLiteral(tag)); + ? ts.createStrictEquality(value, ts.createVoidZero()) + : ts.createStrictEquality(ts.createTypeOf(value), ts.createLiteral(tag)); } ts.createTypeCheck = createTypeCheck; function createMemberAccessForPropertyName(target, memberName, location) { if (ts.isComputedPropertyName(memberName)) { - return createElementAccess(target, memberName.expression, location); + return ts.setTextRange(ts.createElementAccess(target, memberName.expression), location); } else { - var expression = ts.isIdentifier(memberName) ? createPropertyAccess(target, memberName, location) : createElementAccess(target, memberName, location); - (expression.emitNode || (expression.emitNode = {})).flags |= 64 /* NoNestedSourceMaps */; + var expression = ts.setTextRange(ts.isIdentifier(memberName) + ? ts.createPropertyAccess(target, memberName) + : ts.createElementAccess(target, memberName), memberName); + ts.getOrCreateEmitNode(expression).flags |= 64 /* NoNestedSourceMaps */; return expression; } } ts.createMemberAccessForPropertyName = createMemberAccessForPropertyName; function createFunctionCall(func, thisArg, argumentsList, location) { - return createCall(createPropertyAccess(func, "call"), + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(func, "call"), /*typeArguments*/ undefined, [ thisArg - ].concat(argumentsList), location); + ].concat(argumentsList)), location); } ts.createFunctionCall = createFunctionCall; function createFunctionApply(func, thisArg, argumentsExpression, location) { - return createCall(createPropertyAccess(func, "apply"), + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(func, "apply"), /*typeArguments*/ undefined, [ thisArg, argumentsExpression - ], location); + ]), location); } ts.createFunctionApply = createFunctionApply; function createArraySlice(array, start) { var argumentsList = []; if (start !== undefined) { - argumentsList.push(typeof start === "number" ? createLiteral(start) : start); + argumentsList.push(typeof start === "number" ? ts.createLiteral(start) : start); } - return createCall(createPropertyAccess(array, "slice"), /*typeArguments*/ undefined, argumentsList); + return ts.createCall(ts.createPropertyAccess(array, "slice"), /*typeArguments*/ undefined, argumentsList); } ts.createArraySlice = createArraySlice; function createArrayConcat(array, values) { - return createCall(createPropertyAccess(array, "concat"), + return ts.createCall(ts.createPropertyAccess(array, "concat"), /*typeArguments*/ undefined, values); } ts.createArrayConcat = createArrayConcat; function createMathPow(left, right, location) { - return createCall(createPropertyAccess(createIdentifier("Math"), "pow"), - /*typeArguments*/ undefined, [left, right], location); + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Math"), "pow"), + /*typeArguments*/ undefined, [left, right]), location); } ts.createMathPow = createMathPow; function createReactNamespace(reactNamespace, parent) { // To ensure the emit resolver can properly resolve the namespace, we need to // treat this identifier as if it were a source tree node by clearing the `Synthesized` // flag and setting a parent node. - var react = createIdentifier(reactNamespace || "React"); + var react = ts.createIdentifier(reactNamespace || "React"); react.flags &= ~8 /* Synthesized */; // Set the parent that is in parse tree // this makes sure that parent chain is intact for checker to traverse complete scope tree @@ -12271,9 +13285,9 @@ var ts; function createJsxFactoryExpressionFromEntityName(jsxFactory, parent) { if (ts.isQualifiedName(jsxFactory)) { var left = createJsxFactoryExpressionFromEntityName(jsxFactory.left, parent); - var right = createSynthesizedNode(70 /* Identifier */); + var right = ts.createIdentifier(jsxFactory.right.text); right.text = jsxFactory.right.text; - return createPropertyAccess(left, right); + return ts.createPropertyAccess(left, right); } else { return createReactNamespace(jsxFactory.text, parent); @@ -12282,7 +13296,7 @@ var ts; function createJsxFactoryExpression(jsxFactoryEntity, reactNamespace, parent) { return jsxFactoryEntity ? createJsxFactoryExpressionFromEntityName(jsxFactoryEntity, parent) : - createPropertyAccess(createReactNamespace(reactNamespace, parent), "createElement"); + ts.createPropertyAccess(createReactNamespace(reactNamespace, parent), "createElement"); } function createExpressionForJsxElement(jsxFactoryEntity, reactNamespace, tagName, props, children, parentElement, location) { var argumentsList = [tagName]; @@ -12291,7 +13305,7 @@ var ts; } if (children && children.length > 0) { if (!props) { - argumentsList.push(createNull()); + argumentsList.push(ts.createNull()); } if (children.length > 1) { for (var _i = 0, children_1 = children; _i < children_1.length; _i++) { @@ -12304,35 +13318,89 @@ var ts; argumentsList.push(children[0]); } } - return createCall(createJsxFactoryExpression(jsxFactoryEntity, reactNamespace, parentElement), - /*typeArguments*/ undefined, argumentsList, location); + return ts.setTextRange(ts.createCall(createJsxFactoryExpression(jsxFactoryEntity, reactNamespace, parentElement), + /*typeArguments*/ undefined, argumentsList), location); } ts.createExpressionForJsxElement = createExpressionForJsxElement; - function createExportDefault(expression) { - return createExportAssignment(/*decorators*/ undefined, /*modifiers*/ undefined, /*isExportEquals*/ false, expression); - } - ts.createExportDefault = createExportDefault; - function createExternalModuleExport(exportName) { - return createExportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, createNamedExports([createExportSpecifier(exportName)])); - } - ts.createExternalModuleExport = createExternalModuleExport; - function createLetStatement(name, initializer, location) { - return createVariableStatement(/*modifiers*/ undefined, createLetDeclarationList([createVariableDeclaration(name, /*type*/ undefined, initializer)]), location); - } - ts.createLetStatement = createLetStatement; - function createLetDeclarationList(declarations, location) { - return createVariableDeclarationList(declarations, location, 1 /* Let */); - } - ts.createLetDeclarationList = createLetDeclarationList; - function createConstDeclarationList(declarations, location) { - return createVariableDeclarationList(declarations, location, 2 /* Const */); - } - ts.createConstDeclarationList = createConstDeclarationList; // Helpers function getHelperName(name) { - return setEmitFlags(createIdentifier(name), 4096 /* HelperName */ | 2 /* AdviseOnEmitNode */); + return ts.setEmitFlags(ts.createIdentifier(name), 4096 /* HelperName */ | 2 /* AdviseOnEmitNode */); } ts.getHelperName = getHelperName; + var valuesHelper = { + name: "typescript:values", + scoped: false, + text: "\n var __values = (this && this.__values) || function (o) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\n if (m) return m.call(o);\n return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n };\n " + }; + function createValuesHelper(context, expression, location) { + context.requestEmitHelper(valuesHelper); + return ts.setTextRange(ts.createCall(getHelperName("__values"), + /*typeArguments*/ undefined, [expression]), location); + } + ts.createValuesHelper = createValuesHelper; + var readHelper = { + name: "typescript:read", + scoped: false, + text: "\n var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n };\n " + }; + function createReadHelper(context, iteratorRecord, count, location) { + context.requestEmitHelper(readHelper); + return ts.setTextRange(ts.createCall(getHelperName("__read"), + /*typeArguments*/ undefined, count !== undefined + ? [iteratorRecord, ts.createLiteral(count)] + : [iteratorRecord]), location); + } + ts.createReadHelper = createReadHelper; + var spreadHelper = { + name: "typescript:spread", + scoped: false, + text: "\n var __spread = (this && this.__spread) || function () {\n for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));\n return ar;\n };" + }; + function createSpreadHelper(context, argumentList, location) { + context.requestEmitHelper(readHelper); + context.requestEmitHelper(spreadHelper); + return ts.setTextRange(ts.createCall(getHelperName("__spread"), + /*typeArguments*/ undefined, argumentList), location); + } + ts.createSpreadHelper = createSpreadHelper; + // Utilities + function createForOfBindingStatement(node, boundValue) { + if (ts.isVariableDeclarationList(node)) { + var firstDeclaration = ts.firstOrUndefined(node.declarations); + var updatedDeclaration = ts.updateVariableDeclaration(firstDeclaration, firstDeclaration.name, + /*typeNode*/ undefined, boundValue); + return ts.setTextRange(ts.createVariableStatement( + /*modifiers*/ undefined, ts.updateVariableDeclarationList(node, [updatedDeclaration])), + /*location*/ node); + } + else { + var updatedExpression = ts.setTextRange(ts.createAssignment(node, boundValue), /*location*/ node); + return ts.setTextRange(ts.createStatement(updatedExpression), /*location*/ node); + } + } + ts.createForOfBindingStatement = createForOfBindingStatement; + function insertLeadingStatement(dest, source) { + if (ts.isBlock(dest)) { + return ts.updateBlock(dest, ts.setTextRange(ts.createNodeArray([source].concat(dest.statements)), dest.statements)); + } + else { + return ts.createBlock(ts.createNodeArray([dest, source]), /*multiLine*/ true); + } + } + ts.insertLeadingStatement = insertLeadingStatement; + function restoreEnclosingLabel(node, outermostLabeledStatement, afterRestoreLabelCallback) { + if (!outermostLabeledStatement) { + return node; + } + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 221 /* LabeledStatement */ + ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) + : node); + if (afterRestoreLabelCallback) { + afterRestoreLabelCallback(outermostLabeledStatement); + } + return updated; + } + ts.restoreEnclosingLabel = restoreEnclosingLabel; function shouldBeCapturedInTempVariable(node, cacheIdentifiers) { var target = skipParentheses(node); switch (target.kind) { @@ -12342,13 +13410,13 @@ var ts; case 8 /* NumericLiteral */: case 9 /* StringLiteral */: return false; - case 175 /* ArrayLiteralExpression */: + case 176 /* ArrayLiteralExpression */: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 176 /* ObjectLiteralExpression */: + case 177 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -12359,22 +13427,27 @@ var ts; var thisArg; var target; if (ts.isSuperProperty(callee)) { - thisArg = createThis(); + thisArg = ts.createThis(); target = callee; } else if (callee.kind === 96 /* SuperKeyword */) { - thisArg = createThis(); - target = languageVersion < 2 /* ES2015 */ ? createIdentifier("_super", /*location*/ callee) : callee; + thisArg = ts.createThis(); + target = languageVersion < 2 /* ES2015 */ + ? ts.setTextRange(ts.createIdentifier("_super"), callee) + : callee; + } + else if (ts.getEmitFlags(callee) & 4096 /* HelperName */) { + thisArg = ts.createVoidZero(); + target = parenthesizeForAccess(callee); } else { switch (callee.kind) { - case 177 /* PropertyAccessExpression */: { + case 178 /* PropertyAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a.b()` target is `(_a = a).b` and thisArg is `_a` - thisArg = createTempVariable(recordTempVariable); - target = createPropertyAccess(createAssignment(thisArg, callee.expression, - /*location*/ callee.expression), callee.name, - /*location*/ callee); + thisArg = ts.createTempVariable(recordTempVariable); + target = ts.createPropertyAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.name); + ts.setTextRange(target, callee); } else { thisArg = callee.expression; @@ -12382,13 +13455,12 @@ var ts; } break; } - case 178 /* ElementAccessExpression */: { + case 179 /* ElementAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a[b]()` target is `(_a = a)[b]` and thisArg is `_a` - thisArg = createTempVariable(recordTempVariable); - target = createElementAccess(createAssignment(thisArg, callee.expression, - /*location*/ callee.expression), callee.argumentExpression, - /*location*/ callee); + thisArg = ts.createTempVariable(recordTempVariable); + target = ts.createElementAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.argumentExpression); + ts.setTextRange(target, callee); } else { thisArg = callee.expression; @@ -12398,7 +13470,7 @@ var ts; } default: { // for `a()` target is `a` and thisArg is `void 0` - thisArg = createVoidZero(); + thisArg = ts.createVoidZero(); target = parenthesizeForAccess(expression); break; } @@ -12408,42 +13480,42 @@ var ts; } ts.createCallBinding = createCallBinding; function inlineExpressions(expressions) { - return ts.reduceLeft(expressions, createComma); + return ts.reduceLeft(expressions, ts.createComma); } ts.inlineExpressions = inlineExpressions; function createExpressionFromEntityName(node) { if (ts.isQualifiedName(node)) { var left = createExpressionFromEntityName(node.left); - var right = getMutableClone(node.right); - return createPropertyAccess(left, right, /*location*/ node); + var right = ts.getMutableClone(node.right); + return ts.setTextRange(ts.createPropertyAccess(left, right), node); } else { - return getMutableClone(node); + return ts.getMutableClone(node); } } ts.createExpressionFromEntityName = createExpressionFromEntityName; function createExpressionForPropertyName(memberName) { if (ts.isIdentifier(memberName)) { - return createLiteral(memberName, /*location*/ undefined); + return ts.createLiteral(memberName); } else if (ts.isComputedPropertyName(memberName)) { - return getMutableClone(memberName.expression); + return ts.getMutableClone(memberName.expression); } else { - return getMutableClone(memberName); + return ts.getMutableClone(memberName); } } ts.createExpressionForPropertyName = createExpressionForPropertyName; function createExpressionForObjectLiteralElementLike(node, property, receiver) { switch (property.kind) { - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine); - case 257 /* PropertyAssignment */: + case 260 /* PropertyAssignment */: return createExpressionForPropertyAssignment(property, receiver); - case 258 /* ShorthandPropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(property, receiver); - case 149 /* MethodDeclaration */: + case 150 /* MethodDeclaration */: return createExpressionForMethodDeclaration(property, receiver); } } @@ -12453,57 +13525,55 @@ var ts; if (property === firstAccessor) { var properties_1 = []; if (getAccessor) { - var getterFunction = createFunctionExpression(getAccessor.modifiers, + var getterFunction = ts.createFunctionExpression(getAccessor.modifiers, /*asteriskToken*/ undefined, /*name*/ undefined, /*typeParameters*/ undefined, getAccessor.parameters, - /*type*/ undefined, getAccessor.body, - /*location*/ getAccessor); - setOriginalNode(getterFunction, getAccessor); - var getter = createPropertyAssignment("get", getterFunction); + /*type*/ undefined, getAccessor.body); + ts.setTextRange(getterFunction, getAccessor); + ts.setOriginalNode(getterFunction, getAccessor); + var getter = ts.createPropertyAssignment("get", getterFunction); properties_1.push(getter); } if (setAccessor) { - var setterFunction = createFunctionExpression(setAccessor.modifiers, + var setterFunction = ts.createFunctionExpression(setAccessor.modifiers, /*asteriskToken*/ undefined, /*name*/ undefined, /*typeParameters*/ undefined, setAccessor.parameters, - /*type*/ undefined, setAccessor.body, - /*location*/ setAccessor); - setOriginalNode(setterFunction, setAccessor); - var setter = createPropertyAssignment("set", setterFunction); + /*type*/ undefined, setAccessor.body); + ts.setTextRange(setterFunction, setAccessor); + ts.setOriginalNode(setterFunction, setAccessor); + var setter = ts.createPropertyAssignment("set", setterFunction); properties_1.push(setter); } - properties_1.push(createPropertyAssignment("enumerable", createLiteral(true))); - properties_1.push(createPropertyAssignment("configurable", createLiteral(true))); - var expression = createCall(createPropertyAccess(createIdentifier("Object"), "defineProperty"), + properties_1.push(ts.createPropertyAssignment("enumerable", ts.createTrue())); + properties_1.push(ts.createPropertyAssignment("configurable", ts.createTrue())); + var expression = ts.setTextRange(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), /*typeArguments*/ undefined, [ receiver, createExpressionForPropertyName(property.name), - createObjectLiteral(properties_1, /*location*/ undefined, multiLine) - ], + ts.createObjectLiteral(properties_1, multiLine) + ]), /*location*/ firstAccessor); return ts.aggregateTransformFlags(expression); } return undefined; } function createExpressionForPropertyAssignment(property, receiver) { - return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, property.name, /*location*/ property.name), property.initializer, - /*location*/ property), - /*original*/ property)); + return ts.aggregateTransformFlags(ts.setOriginalNode(ts.setTextRange(ts.createAssignment(createMemberAccessForPropertyName(receiver, property.name, /*location*/ property.name), property.initializer), property), property)); } function createExpressionForShorthandPropertyAssignment(property, receiver) { - return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, property.name, /*location*/ property.name), getSynthesizedClone(property.name), + return ts.aggregateTransformFlags(ts.setOriginalNode(ts.setTextRange(ts.createAssignment(createMemberAccessForPropertyName(receiver, property.name, /*location*/ property.name), ts.getSynthesizedClone(property.name)), /*location*/ property), /*original*/ property)); } function createExpressionForMethodDeclaration(method, receiver) { - return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, method.name, /*location*/ method.name), setOriginalNode(createFunctionExpression(method.modifiers, method.asteriskToken, + return ts.aggregateTransformFlags(ts.setOriginalNode(ts.setTextRange(ts.createAssignment(createMemberAccessForPropertyName(receiver, method.name, /*location*/ method.name), ts.setOriginalNode(ts.setTextRange(ts.createFunctionExpression(method.modifiers, method.asteriskToken, /*name*/ undefined, /*typeParameters*/ undefined, method.parameters, - /*type*/ undefined, method.body, + /*type*/ undefined, method.body), /*location*/ method), - /*original*/ method), + /*original*/ method)), /*location*/ method), /*original*/ method)); } @@ -12525,7 +13595,7 @@ var ts; * Gets whether an identifier should only be referred to by its local name. */ function isLocalName(node) { - return (getEmitFlags(node) & 16384 /* LocalName */) !== 0; + return (ts.getEmitFlags(node) & 16384 /* LocalName */) !== 0; } ts.isLocalName = isLocalName; /** @@ -12547,7 +13617,7 @@ var ts; * name points to an exported symbol. */ function isExportName(node) { - return (getEmitFlags(node) & 8192 /* ExportName */) !== 0; + return (ts.getEmitFlags(node) & 8192 /* ExportName */) !== 0; } ts.isExportName = isExportName; /** @@ -12563,17 +13633,17 @@ var ts; ts.getDeclarationName = getDeclarationName; function getName(node, allowComments, allowSourceMaps, emitFlags) { if (node.name && ts.isIdentifier(node.name) && !ts.isGeneratedIdentifier(node.name)) { - var name_8 = getMutableClone(node.name); - emitFlags |= getEmitFlags(node.name); + var name = ts.getMutableClone(node.name); + emitFlags |= ts.getEmitFlags(node.name); if (!allowSourceMaps) emitFlags |= 48 /* NoSourceMap */; if (!allowComments) emitFlags |= 1536 /* NoComments */; if (emitFlags) - setEmitFlags(name_8, emitFlags); - return name_8; + ts.setEmitFlags(name, emitFlags); + return name; } - return getGeneratedNameForNode(node); + return ts.getGeneratedNameForNode(node); } /** * Gets the exported name of a declaration for use in expressions. @@ -12602,19 +13672,20 @@ var ts; * @param allowSourceMaps A value indicating whether source maps may be emitted for the name. */ function getNamespaceMemberName(ns, name, allowComments, allowSourceMaps) { - var qualifiedName = createPropertyAccess(ns, ts.nodeIsSynthesized(name) ? name : getSynthesizedClone(name), /*location*/ name); + var qualifiedName = ts.createPropertyAccess(ns, ts.nodeIsSynthesized(name) ? name : ts.getSynthesizedClone(name)); + ts.setTextRange(qualifiedName, name); var emitFlags; if (!allowSourceMaps) emitFlags |= 48 /* NoSourceMap */; if (!allowComments) emitFlags |= 1536 /* NoComments */; if (emitFlags) - setEmitFlags(qualifiedName, emitFlags); + ts.setEmitFlags(qualifiedName, emitFlags); return qualifiedName; } ts.getNamespaceMemberName = getNamespaceMemberName; function convertToFunctionBody(node, multiLine) { - return ts.isBlock(node) ? node : createBlock([createReturn(node, /*location*/ node)], /*location*/ node, multiLine); + return ts.isBlock(node) ? node : ts.setTextRange(ts.createBlock([ts.setTextRange(ts.createReturn(node), node)], multiLine), node); } ts.convertToFunctionBody = convertToFunctionBody; function isUseStrictPrologue(node) { @@ -12631,7 +13702,18 @@ var ts; * @param ensureUseStrict: boolean determining whether the function need to add prologue-directives * @param visitor: Optional callback used to visit any custom prologue directives. */ - function addPrologueDirectives(target, source, ensureUseStrict, visitor) { + function addPrologue(target, source, ensureUseStrict, visitor) { + var offset = addStandardPrologue(target, source, ensureUseStrict); + return addCustomPrologue(target, source, offset, visitor); + } + ts.addPrologue = addPrologue; + /** + * Add just the standard (string-expression) prologue-directives into target statement-array. + * The function needs to be called during each transformation step. + * This function needs to be called whenever we transform the statement + * list of a source file, namespace, or function-like body. + */ + function addStandardPrologue(target, source, ensureUseStrict) { ts.Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array"); var foundUseStrict = false; var statementOffset = 0; @@ -12650,11 +13732,22 @@ var ts; statementOffset++; } if (ensureUseStrict && !foundUseStrict) { - target.push(startOnNewLine(createStatement(createLiteral("use strict")))); + target.push(startOnNewLine(ts.createStatement(ts.createLiteral("use strict")))); } + return statementOffset; + } + ts.addStandardPrologue = addStandardPrologue; + /** + * Add just the custom prologue-directives into target statement-array. + * The function needs to be called during each transformation step. + * This function needs to be called whenever we transform the statement + * list of a source file, namespace, or function-like body. + */ + function addCustomPrologue(target, source, statementOffset, visitor) { + var numStatements = source.length; while (statementOffset < numStatements) { var statement = source[statementOffset]; - if (getEmitFlags(statement) & 524288 /* CustomPrologue */) { + if (ts.getEmitFlags(statement) & 524288 /* CustomPrologue */) { target.push(visitor ? ts.visitNode(statement, visitor, ts.isStatement) : statement); } else { @@ -12664,7 +13757,7 @@ var ts; } return statementOffset; } - ts.addPrologueDirectives = addPrologueDirectives; + ts.addCustomPrologue = addCustomPrologue; function startsWithUseStrict(statements) { var firstStatement = ts.firstOrUndefined(statements); return firstStatement !== undefined @@ -12692,13 +13785,23 @@ var ts; } } if (!foundUseStrict) { - return createNodeArray([ - startOnNewLine(createStatement(createLiteral("use strict"))) - ].concat(statements), statements); + return ts.setTextRange(ts.createNodeArray([ + startOnNewLine(ts.createStatement(ts.createLiteral("use strict"))) + ].concat(statements)), statements); } return statements; } ts.ensureUseStrict = ensureUseStrict; + function parenthesizeConditionalHead(condition) { + var conditionalPrecedence = ts.getOperatorPrecedence(194 /* ConditionalExpression */, 54 /* QuestionToken */); + var emittedCondition = skipPartiallyEmittedExpressions(condition); + var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); + if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1 /* LessThan */) { + return ts.createParen(condition); + } + return condition; + } + ts.parenthesizeConditionalHead = parenthesizeConditionalHead; /** * Wraps the operand to a BinaryExpression in parentheses if they are needed to preserve the intended * order of operations. @@ -12711,11 +13814,11 @@ var ts; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = skipPartiallyEmittedExpressions(operand); // If the resulting expression is already parenthesized, we do not need to do any further processing. - if (skipped.kind === 183 /* ParenthesizedExpression */) { + if (skipped.kind === 184 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) - ? createParen(operand) + ? ts.createParen(operand) : operand; } ts.parenthesizeBinaryOperand = parenthesizeBinaryOperand; @@ -12745,8 +13848,8 @@ var ts; // // If `a ** d` is on the left of operator `**`, we need to parenthesize to preserve // the intended order of operations: `(a ** b) ** c` - var binaryOperatorPrecedence = ts.getOperatorPrecedence(192 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(192 /* BinaryExpression */, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(193 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(193 /* BinaryExpression */, binaryOperator); var emittedOperand = skipPartiallyEmittedExpressions(operand); var operandPrecedence = ts.getExpressionPrecedence(emittedOperand); switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) { @@ -12755,7 +13858,7 @@ var ts; // and is a yield expression, then we do not need parentheses. if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 195 /* YieldExpression */) { + && operand.kind === 196 /* YieldExpression */) { return false; } return true; @@ -12843,7 +13946,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 192 /* BinaryExpression */ && node.operatorToken.kind === 36 /* PlusToken */) { + if (node.kind === 193 /* BinaryExpression */ && node.operatorToken.kind === 36 /* PlusToken */) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -12858,11 +13961,11 @@ var ts; return 0 /* Unknown */; } function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(193 /* ConditionalExpression */, 54 /* QuestionToken */); + var conditionalPrecedence = ts.getOperatorPrecedence(194 /* ConditionalExpression */, 54 /* QuestionToken */); var emittedCondition = skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1 /* LessThan */) { - return createParen(condition); + return ts.createParen(condition); } return condition; } @@ -12871,10 +13974,11 @@ var ts; // per ES grammar both 'whenTrue' and 'whenFalse' parts of conditional expression are assignment expressions // so in case when comma expression is introduced as a part of previous transformations // if should be wrapped in parens since comma operator has the lowest precedence - return e.kind === 192 /* BinaryExpression */ && e.operatorToken.kind === 25 /* CommaToken */ - ? createParen(e) + return e.kind === 193 /* BinaryExpression */ && e.operatorToken.kind === 25 /* CommaToken */ + ? ts.createParen(e) : e; } + ts.parenthesizeSubexpressionOfConditionalExpression = parenthesizeSubexpressionOfConditionalExpression; /** * Wraps an expression in parentheses if it is needed in order to use the expression * as the expression of a NewExpression node. @@ -12884,12 +13988,12 @@ var ts; function parenthesizeForNew(expression) { var emittedExpression = skipPartiallyEmittedExpressions(expression); switch (emittedExpression.kind) { - case 179 /* CallExpression */: - return createParen(expression); - case 180 /* NewExpression */: + case 180 /* CallExpression */: + return ts.createParen(expression); + case 181 /* NewExpression */: return emittedExpression.arguments ? expression - : createParen(expression); + : ts.createParen(expression); } return parenthesizeForAccess(expression); } @@ -12902,32 +14006,29 @@ var ts; */ function parenthesizeForAccess(expression) { // isLeftHandSideExpression is almost the correct criterion for when it is not necessary - // to parenthesize the expression before a dot. The known exceptions are: + // to parenthesize the expression before a dot. The known exception is: // // NewExpression: // new C.x -> not the same as (new C).x - // NumericLiteral - // 1.x -> not the same as (1).x // var emittedExpression = skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 180 /* NewExpression */ || emittedExpression.arguments) - && emittedExpression.kind !== 8 /* NumericLiteral */) { + && (emittedExpression.kind !== 181 /* NewExpression */ || emittedExpression.arguments)) { return expression; } - return createParen(expression, /*location*/ expression); + return ts.setTextRange(ts.createParen(expression), expression); } ts.parenthesizeForAccess = parenthesizeForAccess; function parenthesizePostfixOperand(operand) { return ts.isLeftHandSideExpression(operand) ? operand - : createParen(operand, /*location*/ operand); + : ts.setTextRange(ts.createParen(operand), operand); } ts.parenthesizePostfixOperand = parenthesizePostfixOperand; function parenthesizePrefixOperand(operand) { return ts.isUnaryExpression(operand) ? operand - : createParen(operand, /*location*/ operand); + : ts.setTextRange(ts.createParen(operand), operand); } ts.parenthesizePrefixOperand = parenthesizePrefixOperand; function parenthesizeListElements(elements) { @@ -12942,17 +14043,18 @@ var ts; } } if (result !== undefined) { - return createNodeArray(result, elements, elements.hasTrailingComma); + return ts.setTextRange(ts.createNodeArray(result, elements.hasTrailingComma), elements); } return elements; } + ts.parenthesizeListElements = parenthesizeListElements; function parenthesizeExpressionForList(expression) { var emittedExpression = skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(192 /* BinaryExpression */, 25 /* CommaToken */); + var commaPrecedence = ts.getOperatorPrecedence(193 /* BinaryExpression */, 25 /* CommaToken */); return expressionPrecedence > commaPrecedence ? expression - : createParen(expression, /*location*/ expression); + : ts.setTextRange(ts.createParen(expression), expression); } ts.parenthesizeExpressionForList = parenthesizeExpressionForList; function parenthesizeExpressionForExpressionStatement(expression) { @@ -12960,16 +14062,16 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = skipPartiallyEmittedExpressions(callee).kind; - if (kind === 184 /* FunctionExpression */ || kind === 185 /* ArrowFunction */) { - var mutableCall = getMutableClone(emittedExpression); - mutableCall.expression = createParen(callee, /*location*/ callee); + if (kind === 185 /* FunctionExpression */ || kind === 186 /* ArrowFunction */) { + var mutableCall = ts.getMutableClone(emittedExpression); + mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); return recreatePartiallyEmittedExpressions(expression, mutableCall); } } else { var leftmostExpressionKind = getLeftmostExpression(emittedExpression).kind; - if (leftmostExpressionKind === 176 /* ObjectLiteralExpression */ || leftmostExpressionKind === 184 /* FunctionExpression */) { - return createParen(expression, /*location*/ expression); + if (leftmostExpressionKind === 177 /* ObjectLiteralExpression */ || leftmostExpressionKind === 185 /* FunctionExpression */) { + return ts.setTextRange(ts.createParen(expression), expression); } } return expression; @@ -12983,7 +14085,7 @@ var ts; */ function recreatePartiallyEmittedExpressions(originalOuterExpression, newInnerExpression) { if (ts.isPartiallyEmittedExpression(originalOuterExpression)) { - var clone_1 = getMutableClone(originalOuterExpression); + var clone_1 = ts.getMutableClone(originalOuterExpression); clone_1.expression = recreatePartiallyEmittedExpressions(clone_1.expression, newInnerExpression); return clone_1; } @@ -12992,21 +14094,21 @@ var ts; function getLeftmostExpression(node) { while (true) { switch (node.kind) { - case 191 /* PostfixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: node = node.operand; continue; - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: node = node.left; continue; - case 193 /* ConditionalExpression */: + case 194 /* ConditionalExpression */: node = node.condition; continue; - case 179 /* CallExpression */: - case 178 /* ElementAccessExpression */: - case 177 /* PropertyAccessExpression */: + case 180 /* CallExpression */: + case 179 /* ElementAccessExpression */: + case 178 /* PropertyAccessExpression */: node = node.expression; continue; - case 294 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: node = node.expression; continue; } @@ -13014,9 +14116,8 @@ var ts; } } function parenthesizeConciseBody(body) { - var emittedBody = skipPartiallyEmittedExpressions(body); - if (emittedBody.kind === 176 /* ObjectLiteralExpression */) { - return createParen(body, /*location*/ body); + if (!ts.isBlock(body) && getLeftmostExpression(body).kind === 177 /* ObjectLiteralExpression */) { + return ts.setTextRange(ts.createParen(body), body); } return body; } @@ -13047,7 +14148,7 @@ var ts; } ts.skipOuterExpressions = skipOuterExpressions; function skipParentheses(node) { - while (node.kind === 183 /* ParenthesizedExpression */) { + while (node.kind === 184 /* ParenthesizedExpression */) { node = node.expression; } return node; @@ -13061,7 +14162,7 @@ var ts; } ts.skipAssertions = skipAssertions; function skipPartiallyEmittedExpressions(node) { - while (node.kind === 294 /* PartiallyEmittedExpression */) { + while (node.kind === 295 /* PartiallyEmittedExpression */) { node = node.expression; } return node; @@ -13072,188 +14173,6 @@ var ts; return node; } ts.startOnNewLine = startOnNewLine; - function setOriginalNode(node, original) { - node.original = original; - if (original) { - var emitNode = original.emitNode; - if (emitNode) - node.emitNode = mergeEmitNode(emitNode, node.emitNode); - } - return node; - } - ts.setOriginalNode = setOriginalNode; - function mergeEmitNode(sourceEmitNode, destEmitNode) { - var flags = sourceEmitNode.flags, commentRange = sourceEmitNode.commentRange, sourceMapRange = sourceEmitNode.sourceMapRange, tokenSourceMapRanges = sourceEmitNode.tokenSourceMapRanges, constantValue = sourceEmitNode.constantValue, helpers = sourceEmitNode.helpers; - if (!destEmitNode) - destEmitNode = {}; - if (flags) - destEmitNode.flags = flags; - if (commentRange) - destEmitNode.commentRange = commentRange; - if (sourceMapRange) - destEmitNode.sourceMapRange = sourceMapRange; - if (tokenSourceMapRanges) - destEmitNode.tokenSourceMapRanges = mergeTokenSourceMapRanges(tokenSourceMapRanges, destEmitNode.tokenSourceMapRanges); - if (constantValue !== undefined) - destEmitNode.constantValue = constantValue; - if (helpers) - destEmitNode.helpers = ts.addRange(destEmitNode.helpers, helpers); - return destEmitNode; - } - function mergeTokenSourceMapRanges(sourceRanges, destRanges) { - if (!destRanges) - destRanges = ts.createMap(); - ts.copyProperties(sourceRanges, destRanges); - return destRanges; - } - /** - * Clears any EmitNode entries from parse-tree nodes. - * @param sourceFile A source file. - */ - function disposeEmitNodes(sourceFile) { - // During transformation we may need to annotate a parse tree node with transient - // transformation properties. As parse tree nodes live longer than transformation - // nodes, we need to make sure we reclaim any memory allocated for custom ranges - // from these nodes to ensure we do not hold onto entire subtrees just for position - // information. We also need to reset these nodes to a pre-transformation state - // for incremental parsing scenarios so that we do not impact later emit. - sourceFile = ts.getSourceFileOfNode(ts.getParseTreeNode(sourceFile)); - var emitNode = sourceFile && sourceFile.emitNode; - var annotatedNodes = emitNode && emitNode.annotatedNodes; - if (annotatedNodes) { - for (var _i = 0, annotatedNodes_1 = annotatedNodes; _i < annotatedNodes_1.length; _i++) { - var node = annotatedNodes_1[_i]; - node.emitNode = undefined; - } - } - } - ts.disposeEmitNodes = disposeEmitNodes; - /** - * Associates a node with the current transformation, initializing - * various transient transformation properties. - * - * @param node The node. - */ - function getOrCreateEmitNode(node) { - if (!node.emitNode) { - if (ts.isParseTreeNode(node)) { - // To avoid holding onto transformation artifacts, we keep track of any - // parse tree node we are annotating. This allows us to clean them up after - // all transformations have completed. - if (node.kind === 261 /* SourceFile */) { - return node.emitNode = { annotatedNodes: [node] }; - } - var sourceFile = ts.getSourceFileOfNode(node); - getOrCreateEmitNode(sourceFile).annotatedNodes.push(node); - } - node.emitNode = {}; - } - return node.emitNode; - } - ts.getOrCreateEmitNode = getOrCreateEmitNode; - /** - * Gets flags that control emit behavior of a node. - * - * @param node The node. - */ - function getEmitFlags(node) { - var emitNode = node.emitNode; - return emitNode && emitNode.flags; - } - ts.getEmitFlags = getEmitFlags; - /** - * Sets flags that control emit behavior of a node. - * - * @param node The node. - * @param emitFlags The NodeEmitFlags for the node. - */ - function setEmitFlags(node, emitFlags) { - getOrCreateEmitNode(node).flags = emitFlags; - return node; - } - ts.setEmitFlags = setEmitFlags; - /** - * Gets a custom text range to use when emitting source maps. - * - * @param node The node. - */ - function getSourceMapRange(node) { - var emitNode = node.emitNode; - return (emitNode && emitNode.sourceMapRange) || node; - } - ts.getSourceMapRange = getSourceMapRange; - /** - * Sets a custom text range to use when emitting source maps. - * - * @param node The node. - * @param range The text range. - */ - function setSourceMapRange(node, range) { - getOrCreateEmitNode(node).sourceMapRange = range; - return node; - } - ts.setSourceMapRange = setSourceMapRange; - /** - * Gets the TextRange to use for source maps for a token of a node. - * - * @param node The node. - * @param token The token. - */ - function getTokenSourceMapRange(node, token) { - var emitNode = node.emitNode; - var tokenSourceMapRanges = emitNode && emitNode.tokenSourceMapRanges; - return tokenSourceMapRanges && tokenSourceMapRanges[token]; - } - ts.getTokenSourceMapRange = getTokenSourceMapRange; - /** - * Sets the TextRange to use for source maps for a token of a node. - * - * @param node The node. - * @param token The token. - * @param range The text range. - */ - function setTokenSourceMapRange(node, token, range) { - var emitNode = getOrCreateEmitNode(node); - var tokenSourceMapRanges = emitNode.tokenSourceMapRanges || (emitNode.tokenSourceMapRanges = ts.createMap()); - tokenSourceMapRanges[token] = range; - return node; - } - ts.setTokenSourceMapRange = setTokenSourceMapRange; - /** - * Gets a custom text range to use when emitting comments. - * - * @param node The node. - */ - function getCommentRange(node) { - var emitNode = node.emitNode; - return (emitNode && emitNode.commentRange) || node; - } - ts.getCommentRange = getCommentRange; - /** - * Sets a custom text range to use when emitting comments. - */ - function setCommentRange(node, range) { - getOrCreateEmitNode(node).commentRange = range; - return node; - } - ts.setCommentRange = setCommentRange; - /** - * Gets the constant value to emit for an expression. - */ - function getConstantValue(node) { - var emitNode = node.emitNode; - return emitNode && emitNode.constantValue; - } - ts.getConstantValue = getConstantValue; - /** - * Sets the constant value to emit for an expression. - */ - function setConstantValue(node, value) { - var emitNode = getOrCreateEmitNode(node); - emitNode.constantValue = value; - return node; - } - ts.setConstantValue = setConstantValue; function getExternalHelpersModuleName(node) { var parseNode = ts.getOriginalNode(node, ts.isSourceFile); var emitNode = parseNode && parseNode.emitNode; @@ -13266,143 +14185,34 @@ var ts; if (externalHelpersModuleName) { return externalHelpersModuleName; } - var helpers = getEmitHelpers(node); + var helpers = ts.getEmitHelpers(node); if (helpers) { - for (var _i = 0, helpers_1 = helpers; _i < helpers_1.length; _i++) { - var helper = helpers_1[_i]; + for (var _i = 0, helpers_2 = helpers; _i < helpers_2.length; _i++) { + var helper = helpers_2[_i]; if (!helper.scoped) { var parseNode = ts.getOriginalNode(node, ts.isSourceFile); - var emitNode = getOrCreateEmitNode(parseNode); - return emitNode.externalHelpersModuleName || (emitNode.externalHelpersModuleName = createUniqueName(ts.externalHelpersModuleNameText)); + var emitNode = ts.getOrCreateEmitNode(parseNode); + return emitNode.externalHelpersModuleName || (emitNode.externalHelpersModuleName = ts.createUniqueName(ts.externalHelpersModuleNameText)); } } } } } ts.getOrCreateExternalHelpersModuleNameIfNeeded = getOrCreateExternalHelpersModuleNameIfNeeded; - /** - * Adds an EmitHelper to a node. - */ - function addEmitHelper(node, helper) { - var emitNode = getOrCreateEmitNode(node); - emitNode.helpers = ts.append(emitNode.helpers, helper); - return node; - } - ts.addEmitHelper = addEmitHelper; - /** - * Adds an EmitHelper to a node. - */ - function addEmitHelpers(node, helpers) { - if (ts.some(helpers)) { - var emitNode = getOrCreateEmitNode(node); - for (var _i = 0, helpers_2 = helpers; _i < helpers_2.length; _i++) { - var helper = helpers_2[_i]; - if (!ts.contains(emitNode.helpers, helper)) { - emitNode.helpers = ts.append(emitNode.helpers, helper); - } - } - } - return node; - } - ts.addEmitHelpers = addEmitHelpers; - /** - * Removes an EmitHelper from a node. - */ - function removeEmitHelper(node, helper) { - var emitNode = node.emitNode; - if (emitNode) { - var helpers = emitNode.helpers; - if (helpers) { - return ts.orderedRemoveItem(helpers, helper); - } - } - return false; - } - ts.removeEmitHelper = removeEmitHelper; - /** - * Gets the EmitHelpers of a node. - */ - function getEmitHelpers(node) { - var emitNode = node.emitNode; - return emitNode && emitNode.helpers; - } - ts.getEmitHelpers = getEmitHelpers; - /** - * Moves matching emit helpers from a source node to a target node. - */ - function moveEmitHelpers(source, target, predicate) { - var sourceEmitNode = source.emitNode; - var sourceEmitHelpers = sourceEmitNode && sourceEmitNode.helpers; - if (!ts.some(sourceEmitHelpers)) - return; - var targetEmitNode = getOrCreateEmitNode(target); - var helpersRemoved = 0; - for (var i = 0; i < sourceEmitHelpers.length; i++) { - var helper = sourceEmitHelpers[i]; - if (predicate(helper)) { - helpersRemoved++; - if (!ts.contains(targetEmitNode.helpers, helper)) { - targetEmitNode.helpers = ts.append(targetEmitNode.helpers, helper); - } - } - else if (helpersRemoved > 0) { - sourceEmitHelpers[i - helpersRemoved] = helper; - } - } - if (helpersRemoved > 0) { - sourceEmitHelpers.length -= helpersRemoved; - } - } - ts.moveEmitHelpers = moveEmitHelpers; - function compareEmitHelpers(x, y) { - if (x === y) - return 0 /* EqualTo */; - if (x.priority === y.priority) - return 0 /* EqualTo */; - if (x.priority === undefined) - return 1 /* GreaterThan */; - if (y.priority === undefined) - return -1 /* LessThan */; - return ts.compareValues(x.priority, y.priority); - } - ts.compareEmitHelpers = compareEmitHelpers; - function setTextRange(node, location) { - if (location) { - node.pos = location.pos; - node.end = location.end; - } - return node; - } - ts.setTextRange = setTextRange; - function setNodeFlags(node, flags) { - node.flags = flags; - return node; - } - ts.setNodeFlags = setNodeFlags; - function setMultiLine(node, multiLine) { - node.multiLine = multiLine; - return node; - } - ts.setMultiLine = setMultiLine; - function setHasTrailingComma(nodes, hasTrailingComma) { - nodes.hasTrailingComma = hasTrailingComma; - return nodes; - } - ts.setHasTrailingComma = setHasTrailingComma; /** * Get the name of that target module from an import or export declaration */ function getLocalNameForExternalImport(node, sourceFile) { var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); if (namespaceDeclaration && !ts.isDefaultImport(node)) { - var name_9 = namespaceDeclaration.name; - return ts.isGeneratedIdentifier(name_9) ? name_9 : createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, namespaceDeclaration.name)); + var name = namespaceDeclaration.name; + return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, namespaceDeclaration.name)); } - if (node.kind === 235 /* ImportDeclaration */ && node.importClause) { - return getGeneratedNameForNode(node); + if (node.kind === 237 /* ImportDeclaration */ && node.importClause) { + return ts.getGeneratedNameForNode(node); } - if (node.kind === 241 /* ExportDeclaration */ && node.moduleSpecifier) { - return getGeneratedNameForNode(node); + if (node.kind === 243 /* ExportDeclaration */ && node.moduleSpecifier) { + return ts.getGeneratedNameForNode(node); } return undefined; } @@ -13420,7 +14230,7 @@ var ts; if (moduleName.kind === 9 /* StringLiteral */) { return tryGetModuleNameFromDeclaration(importNode, host, resolver, compilerOptions) || tryRenameExternalModule(moduleName, sourceFile) - || getSynthesizedClone(moduleName); + || ts.getSynthesizedClone(moduleName); } return undefined; } @@ -13430,10 +14240,8 @@ var ts; * Here we check if alternative name was provided for a given moduleName and return it if possible. */ function tryRenameExternalModule(moduleName, sourceFile) { - if (sourceFile.renamedDependencies && ts.hasProperty(sourceFile.renamedDependencies, moduleName.text)) { - return createLiteral(sourceFile.renamedDependencies[moduleName.text]); - } - return undefined; + var rename = sourceFile.renamedDependencies && sourceFile.renamedDependencies.get(moduleName.text); + return rename && ts.createLiteral(rename); } /** * Get the name of a module as should be written in the emitted output. @@ -13447,10 +14255,10 @@ var ts; return undefined; } if (file.moduleName) { - return createLiteral(file.moduleName); + return ts.createLiteral(file.moduleName); } if (!ts.isDeclarationFile(file) && (options.out || options.outFile)) { - return createLiteral(ts.getExternalModuleNameFromPath(host, file.fileName)); + return ts.createLiteral(ts.getExternalModuleNameFromPath(host, file.fileName)); } return undefined; } @@ -13521,7 +14329,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 257 /* PropertyAssignment */: + case 260 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -13533,11 +14341,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 258 /* ShorthandPropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 259 /* SpreadAssignment */: + case 262 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -13569,12 +14377,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 144 /* Parameter */: - case 174 /* BindingElement */: + case 145 /* Parameter */: + case 175 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 196 /* SpreadElement */: - case 259 /* SpreadAssignment */: + case 197 /* SpreadElement */: + case 262 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -13586,7 +14394,7 @@ var ts; */ function getPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 174 /* BindingElement */: + case 175 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -13598,7 +14406,7 @@ var ts; : propertyName; } break; - case 257 /* PropertyAssignment */: + case 260 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -13610,7 +14418,7 @@ var ts; : propertyName; } break; - case 259 /* SpreadAssignment */: + case 262 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return bindingElement.name; } @@ -13628,13 +14436,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 172 /* ObjectBindingPattern */: - case 173 /* ArrayBindingPattern */: - case 175 /* ArrayLiteralExpression */: + case 173 /* ObjectBindingPattern */: + case 174 /* ArrayBindingPattern */: + case 176 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 176 /* ObjectLiteralExpression */: + case 177 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -13644,10 +14452,12 @@ var ts; if (ts.isBindingElement(element)) { if (element.dotDotDotToken) { ts.Debug.assertNode(element.name, ts.isIdentifier); - return setOriginalNode(createSpread(element.name, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createSpread(element.name), element), element); } var expression = convertToAssignmentElementTarget(element.name); - return element.initializer ? setOriginalNode(createAssignment(expression, element.initializer, element), element) : expression; + return element.initializer + ? ts.setOriginalNode(ts.setTextRange(ts.createAssignment(expression, element.initializer), element), element) + : expression; } ts.Debug.assertNode(element, ts.isExpression); return element; @@ -13657,14 +14467,14 @@ var ts; if (ts.isBindingElement(element)) { if (element.dotDotDotToken) { ts.Debug.assertNode(element.name, ts.isIdentifier); - return setOriginalNode(createSpreadAssignment(element.name, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createSpreadAssignment(element.name), element), element); } if (element.propertyName) { var expression = convertToAssignmentElementTarget(element.name); - return setOriginalNode(createPropertyAssignment(element.propertyName, element.initializer ? createAssignment(expression, element.initializer) : expression, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createPropertyAssignment(element.propertyName, element.initializer ? ts.createAssignment(expression, element.initializer) : expression), element), element); } ts.Debug.assertNode(element.name, ts.isIdentifier); - return setOriginalNode(createShorthandPropertyAssignment(element.name, element.initializer, element), element); + return ts.setOriginalNode(ts.setTextRange(ts.createShorthandPropertyAssignment(element.name, element.initializer), element), element); } ts.Debug.assertNode(element, ts.isObjectLiteralElementLike); return element; @@ -13672,18 +14482,18 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 173 /* ArrayBindingPattern */: - case 175 /* ArrayLiteralExpression */: + case 174 /* ArrayBindingPattern */: + case 176 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 172 /* ObjectBindingPattern */: - case 176 /* ObjectLiteralExpression */: + case 173 /* ObjectBindingPattern */: + case 177 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } ts.convertToAssignmentPattern = convertToAssignmentPattern; function convertToObjectAssignmentPattern(node) { if (ts.isObjectBindingPattern(node)) { - return setOriginalNode(createObjectLiteral(ts.map(node.elements, convertToObjectAssignmentElement), node), node); + return ts.setOriginalNode(ts.setTextRange(ts.createObjectLiteral(ts.map(node.elements, convertToObjectAssignmentElement)), node), node); } ts.Debug.assertNode(node, ts.isObjectLiteralExpression); return node; @@ -13691,7 +14501,7 @@ var ts; ts.convertToObjectAssignmentPattern = convertToObjectAssignmentPattern; function convertToArrayAssignmentPattern(node) { if (ts.isArrayBindingPattern(node)) { - return setOriginalNode(createArrayLiteral(ts.map(node.elements, convertToArrayAssignmentElement), node), node); + return ts.setOriginalNode(ts.setTextRange(ts.createArrayLiteral(ts.map(node.elements, convertToArrayAssignmentElement)), node), node); } ts.Debug.assertNode(node, ts.isArrayLiteralExpression); return node; @@ -13707,37 +14517,37 @@ var ts; ts.convertToAssignmentElementTarget = convertToAssignmentElementTarget; function collectExternalModuleInfo(sourceFile, resolver, compilerOptions) { var externalImports = []; - var exportSpecifiers = ts.createMap(); - var exportedBindings = ts.createMap(); + var exportSpecifiers = ts.createMultiMap(); + var exportedBindings = []; var uniqueExports = ts.createMap(); var exportedNames; var hasExportDefault = false; var exportEquals = undefined; var hasExportStarsToExportValues = false; var externalHelpersModuleName = getOrCreateExternalHelpersModuleNameIfNeeded(sourceFile, compilerOptions); - var externalHelpersImportDeclaration = externalHelpersModuleName && createImportDeclaration( + var externalHelpersImportDeclaration = externalHelpersModuleName && ts.createImportDeclaration( /*decorators*/ undefined, - /*modifiers*/ undefined, createImportClause(/*name*/ undefined, createNamespaceImport(externalHelpersModuleName)), createLiteral(ts.externalHelpersModuleNameText)); + /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText)); if (externalHelpersImportDeclaration) { externalImports.push(externalHelpersImportDeclaration); } for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 235 /* ImportDeclaration */: + case 237 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" // import { x, y } from "mod" externalImports.push(node); break; - case 234 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 245 /* ExternalModuleReference */) { + case 236 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 247 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -13753,27 +14563,27 @@ var ts; // export { x, y } for (var _b = 0, _c = node.exportClause.elements; _b < _c.length; _b++) { var specifier = _c[_b]; - if (!uniqueExports[specifier.name.text]) { - var name_10 = specifier.propertyName || specifier.name; - ts.multiMapAdd(exportSpecifiers, name_10.text, specifier); - var decl = resolver.getReferencedImportDeclaration(name_10) - || resolver.getReferencedValueDeclaration(name_10); + if (!uniqueExports.get(specifier.name.text)) { + var name = specifier.propertyName || specifier.name; + exportSpecifiers.add(name.text, specifier); + var decl = resolver.getReferencedImportDeclaration(name) + || resolver.getReferencedValueDeclaration(name); if (decl) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(decl), specifier.name); + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(decl), specifier.name); } - uniqueExports[specifier.name.text] = true; + uniqueExports.set(specifier.name.text, true); exportedNames = ts.append(exportedNames, specifier.name); } } } break; - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: if (ts.hasModifier(node, 1 /* Export */)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -13781,42 +14591,42 @@ var ts; } } break; - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default function() { } if (!hasExportDefault) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); hasExportDefault = true; } } else { // export function x() { } - var name_11 = node.name; - if (!uniqueExports[name_11.text]) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), name_11); - uniqueExports[name_11.text] = true; - exportedNames = ts.append(exportedNames, name_11); + var name = node.name; + if (!uniqueExports.get(name.text)) { + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), name); + uniqueExports.set(name.text, true); + exportedNames = ts.append(exportedNames, name); } } } break; - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default class { } if (!hasExportDefault) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), getDeclarationName(node)); hasExportDefault = true; } } else { // export class x { } - var name_12 = node.name; - if (!uniqueExports[name_12.text]) { - ts.multiMapAdd(exportedBindings, ts.getOriginalNodeId(node), name_12); - uniqueExports[name_12.text] = true; - exportedNames = ts.append(exportedNames, name_12); + var name = node.name; + if (!uniqueExports.get(name.text)) { + multiMapSparseArrayAdd(exportedBindings, ts.getOriginalNodeId(node), name); + uniqueExports.set(name.text, true); + exportedNames = ts.append(exportedNames, name); } } } @@ -13836,13 +14646,24 @@ var ts; } } else if (!ts.isGeneratedIdentifier(decl.name)) { - if (!uniqueExports[decl.name.text]) { - uniqueExports[decl.name.text] = true; + if (!uniqueExports.get(decl.name.text)) { + uniqueExports.set(decl.name.text, true); exportedNames = ts.append(exportedNames, decl.name); } } return exportedNames; } + /** Use a sparse array as a multi-map. */ + function multiMapSparseArrayAdd(map, key, value) { + var values = map[key]; + if (values) { + values.push(value); + } + else { + map[key] = values = [value]; + } + return values; + } })(ts || (ts = {})); /// /// @@ -13854,13 +14675,13 @@ var ts; var IdentifierConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 261 /* SourceFile */) { + if (kind === 264 /* SourceFile */) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 70 /* Identifier */) { return new (IdentifierConstructor || (IdentifierConstructor = ts.objectAllocator.getIdentifierConstructor()))(kind, pos, end); } - else if (kind < 141 /* FirstNode */) { + else if (kind < 142 /* FirstNode */) { return new (TokenConstructor || (TokenConstructor = ts.objectAllocator.getTokenConstructor()))(kind, pos, end); } else { @@ -13903,28 +14724,29 @@ var ts; var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode; var cbNodes = cbNodeArray || cbNode; switch (node.kind) { - case 141 /* QualifiedName */: + case 142 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 143 /* TypeParameter */: + case 144 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || + visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 258 /* ShorthandPropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 259 /* SpreadAssignment */: + case 262 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 144 /* Parameter */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 257 /* PropertyAssignment */: - case 223 /* VariableDeclaration */: - case 174 /* BindingElement */: + case 145 /* Parameter */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 260 /* PropertyAssignment */: + case 225 /* VariableDeclaration */: + case 175 /* BindingElement */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || @@ -13933,24 +14755,24 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: - case 185 /* ArrowFunction */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 185 /* FunctionExpression */: + case 227 /* FunctionDeclaration */: + case 186 /* ArrowFunction */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -13961,320 +14783,326 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 157 /* TypeReference */: + case 158 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNodes, node.typeArguments); - case 156 /* TypePredicate */: + case 157 /* TypePredicate */: return visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 160 /* TypeQuery */: + case 161 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 161 /* TypeLiteral */: + case 162 /* TypeLiteral */: return visitNodes(cbNodes, node.members); - case 162 /* ArrayType */: + case 163 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 163 /* TupleType */: + case 164 /* TupleType */: return visitNodes(cbNodes, node.elementTypes); - case 164 /* UnionType */: - case 165 /* IntersectionType */: + case 165 /* UnionType */: + case 166 /* IntersectionType */: return visitNodes(cbNodes, node.types); - case 166 /* ParenthesizedType */: - case 168 /* TypeOperator */: + case 167 /* ParenthesizedType */: + case 169 /* TypeOperator */: return visitNode(cbNode, node.type); - case 169 /* IndexedAccessType */: + case 170 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 170 /* MappedType */: + case 171 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 171 /* LiteralType */: + case 172 /* LiteralType */: return visitNode(cbNode, node.literal); - case 172 /* ObjectBindingPattern */: - case 173 /* ArrayBindingPattern */: + case 173 /* ObjectBindingPattern */: + case 174 /* ArrayBindingPattern */: return visitNodes(cbNodes, node.elements); - case 175 /* ArrayLiteralExpression */: + case 176 /* ArrayLiteralExpression */: return visitNodes(cbNodes, node.elements); - case 176 /* ObjectLiteralExpression */: + case 177 /* ObjectLiteralExpression */: return visitNodes(cbNodes, node.properties); - case 177 /* PropertyAccessExpression */: + case 178 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.name); - case 178 /* ElementAccessExpression */: + case 179 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 179 /* CallExpression */: - case 180 /* NewExpression */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); - case 181 /* TaggedTemplateExpression */: + case 182 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 182 /* TypeAssertionExpression */: + case 183 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 186 /* DeleteExpression */: + case 187 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 187 /* TypeOfExpression */: + case 188 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 188 /* VoidExpression */: + case 189 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 190 /* PrefixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 195 /* YieldExpression */: + case 196 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 189 /* AwaitExpression */: + case 190 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 191 /* PostfixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 200 /* AsExpression */: + case 201 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 201 /* NonNullExpression */: + case 202 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 193 /* ConditionalExpression */: + case 203 /* MetaProperty */: + return visitNode(cbNode, node.name); + case 194 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 196 /* SpreadElement */: + case 197 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 204 /* Block */: - case 231 /* ModuleBlock */: + case 206 /* Block */: + case 233 /* ModuleBlock */: return visitNodes(cbNodes, node.statements); - case 261 /* SourceFile */: + case 264 /* SourceFile */: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 224 /* VariableDeclarationList */: + case 226 /* VariableDeclarationList */: return visitNodes(cbNodes, node.declarations); - case 207 /* ExpressionStatement */: + case 209 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 208 /* IfStatement */: + case 210 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 209 /* DoStatement */: + case 211 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 210 /* WhileStatement */: + case 212 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 211 /* ForStatement */: + case 213 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 212 /* ForInStatement */: + case 214 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 213 /* ForOfStatement */: - return visitNode(cbNode, node.initializer) || + case 215 /* ForOfStatement */: + return visitNode(cbNode, node.awaitModifier) || + visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 214 /* ContinueStatement */: - case 215 /* BreakStatement */: + case 216 /* ContinueStatement */: + case 217 /* BreakStatement */: return visitNode(cbNode, node.label); - case 216 /* ReturnStatement */: + case 218 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 217 /* WithStatement */: + case 219 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 218 /* SwitchStatement */: + case 220 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 232 /* CaseBlock */: + case 234 /* CaseBlock */: return visitNodes(cbNodes, node.clauses); - case 253 /* CaseClause */: + case 256 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.statements); - case 254 /* DefaultClause */: + case 257 /* DefaultClause */: return visitNodes(cbNodes, node.statements); - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 220 /* ThrowStatement */: + case 222 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 221 /* TryStatement */: + case 223 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 256 /* CatchClause */: + case 259 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 145 /* Decorator */: + case 146 /* Decorator */: return visitNode(cbNode, node.expression); - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); - case 228 /* TypeAliasDeclaration */: + case 230 /* TypeAliasDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.members); - case 260 /* EnumMember */: + case 263 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 235 /* ImportDeclaration */: + case 237 /* ImportDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 236 /* ImportClause */: + case 238 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 233 /* NamespaceExportDeclaration */: + case 235 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 237 /* NamespaceImport */: + case 239 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 238 /* NamedImports */: - case 242 /* NamedExports */: + case 240 /* NamedImports */: + case 244 /* NamedExports */: return visitNodes(cbNodes, node.elements); - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 239 /* ImportSpecifier */: - case 243 /* ExportSpecifier */: + case 241 /* ImportSpecifier */: + case 245 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 194 /* TemplateExpression */: + case 195 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 202 /* TemplateSpan */: + case 204 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 142 /* ComputedPropertyName */: + case 143 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 255 /* HeritageClause */: + case 258 /* HeritageClause */: return visitNodes(cbNodes, node.types); - case 199 /* ExpressionWithTypeArguments */: + case 200 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments); - case 245 /* ExternalModuleReference */: + case 247 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 244 /* MissingDeclaration */: + case 246 /* MissingDeclaration */: return visitNodes(cbNodes, node.decorators); - case 246 /* JsxElement */: + case 248 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 247 /* JsxSelfClosingElement */: - case 248 /* JsxOpeningElement */: + case 249 /* JsxSelfClosingElement */: + case 250 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || - visitNodes(cbNodes, node.attributes); - case 250 /* JsxAttribute */: + visitNode(cbNode, node.attributes); + case 253 /* JsxAttributes */: + return visitNodes(cbNodes, node.properties); + case 252 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 251 /* JsxSpreadAttribute */: + case 254 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 252 /* JsxExpression */: - return visitNode(cbNode, node.expression); - case 249 /* JsxClosingElement */: + case 255 /* JsxExpression */: + return visitNode(cbNode, node.dotDotDotToken) || + visitNode(cbNode, node.expression); + case 251 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 262 /* JSDocTypeExpression */: + case 266 /* JSDocTypeExpression */: return visitNode(cbNode, node.type); - case 266 /* JSDocUnionType */: + case 270 /* JSDocUnionType */: return visitNodes(cbNodes, node.types); - case 267 /* JSDocTupleType */: + case 271 /* JSDocTupleType */: return visitNodes(cbNodes, node.types); - case 265 /* JSDocArrayType */: + case 269 /* JSDocArrayType */: return visitNode(cbNode, node.elementType); - case 269 /* JSDocNonNullableType */: + case 273 /* JSDocNonNullableType */: return visitNode(cbNode, node.type); - case 268 /* JSDocNullableType */: + case 272 /* JSDocNullableType */: return visitNode(cbNode, node.type); - case 270 /* JSDocRecordType */: + case 274 /* JSDocRecordType */: return visitNode(cbNode, node.literal); - case 272 /* JSDocTypeReference */: + case 276 /* JSDocTypeReference */: return visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeArguments); - case 273 /* JSDocOptionalType */: + case 277 /* JSDocOptionalType */: return visitNode(cbNode, node.type); - case 274 /* JSDocFunctionType */: + case 278 /* JSDocFunctionType */: return visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 275 /* JSDocVariadicType */: + case 279 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 276 /* JSDocConstructorType */: + case 280 /* JSDocConstructorType */: return visitNode(cbNode, node.type); - case 277 /* JSDocThisType */: + case 281 /* JSDocThisType */: return visitNode(cbNode, node.type); - case 271 /* JSDocRecordMember */: + case 275 /* JSDocRecordMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.type); - case 278 /* JSDocComment */: + case 282 /* JSDocComment */: return visitNodes(cbNodes, node.tags); - case 281 /* JSDocParameterTag */: + case 285 /* JSDocParameterTag */: return visitNode(cbNode, node.preParameterName) || visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.postParameterName); - case 282 /* JSDocReturnTag */: + case 286 /* JSDocReturnTag */: return visitNode(cbNode, node.typeExpression); - case 283 /* JSDocTypeTag */: + case 287 /* JSDocTypeTag */: return visitNode(cbNode, node.typeExpression); - case 280 /* JSDocAugmentsTag */: + case 284 /* JSDocAugmentsTag */: return visitNode(cbNode, node.typeExpression); - case 284 /* JSDocTemplateTag */: + case 288 /* JSDocTemplateTag */: return visitNodes(cbNodes, node.typeParameters); - case 285 /* JSDocTypedefTag */: + case 289 /* JSDocTypedefTag */: return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.jsDocTypeLiteral); - case 287 /* JSDocTypeLiteral */: + case 291 /* JSDocTypeLiteral */: return visitNodes(cbNodes, node.jsDocPropertyTags); - case 286 /* JSDocPropertyTag */: + case 290 /* JSDocPropertyTag */: return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name); - case 294 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); - case 288 /* JSDocLiteralType */: + case 292 /* JSDocLiteralType */: return visitNode(cbNode, node.literal); } } @@ -14292,6 +15120,7 @@ var ts; return Parser.parseIsolatedEntityName(text, languageVersion); } ts.parseIsolatedEntityName = parseIsolatedEntityName; + // See also `isExternalOrCommonJsModule` in utilities.ts function isExternalModule(file) { return file.externalModuleIndicator !== undefined; } @@ -14334,7 +15163,7 @@ var ts; // Share a single scanner across all calls to parse a source file. This helps speed things // up by avoiding the cost of creating/compiling scanners over and over again. var scanner = ts.createScanner(5 /* Latest */, /*skipTrivia*/ true); - var disallowInAndDecoratorContext = 65536 /* DisallowInContext */ | 262144 /* DecoratorContext */; + var disallowInAndDecoratorContext = 2048 /* DisallowInContext */ | 8192 /* DecoratorContext */; // capture constructors in 'initializeState' to avoid null checks var NodeConstructor; var TokenConstructor; @@ -14458,7 +15287,7 @@ var ts; identifiers = ts.createMap(); identifierCount = 0; nodeCount = 0; - contextFlags = scriptKind === 1 /* JS */ || scriptKind === 2 /* JSX */ ? 2097152 /* JavaScriptFile */ : 0 /* None */; + contextFlags = scriptKind === 1 /* JS */ || scriptKind === 2 /* JSX */ ? 65536 /* JavaScriptFile */ : 0 /* None */; parseErrorBeforeNextFinishedNode = false; // Initialize and prime the scanner before parsing the source elements. scanner.setText(sourceText); @@ -14546,7 +15375,7 @@ var ts; function createSourceFile(fileName, languageVersion, scriptKind) { // code from createNode is inlined here so createNode won't have to deal with special case of creating source files // this is quite rare comparing to other nodes and createNode should be as fast as possible - var sourceFile = new SourceFileConstructor(261 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + var sourceFile = new SourceFileConstructor(264 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -14566,16 +15395,16 @@ var ts; } } function setDisallowInContext(val) { - setContextFlag(val, 65536 /* DisallowInContext */); + setContextFlag(val, 2048 /* DisallowInContext */); } function setYieldContext(val) { - setContextFlag(val, 131072 /* YieldContext */); + setContextFlag(val, 4096 /* YieldContext */); } function setDecoratorContext(val) { - setContextFlag(val, 262144 /* DecoratorContext */); + setContextFlag(val, 8192 /* DecoratorContext */); } function setAwaitContext(val) { - setContextFlag(val, 524288 /* AwaitContext */); + setContextFlag(val, 16384 /* AwaitContext */); } function doOutsideOfContext(context, func) { // contextFlagsToClear will contain only the context flags that are @@ -14616,40 +15445,40 @@ var ts; return func(); } function allowInAnd(func) { - return doOutsideOfContext(65536 /* DisallowInContext */, func); + return doOutsideOfContext(2048 /* DisallowInContext */, func); } function disallowInAnd(func) { - return doInsideOfContext(65536 /* DisallowInContext */, func); + return doInsideOfContext(2048 /* DisallowInContext */, func); } function doInYieldContext(func) { - return doInsideOfContext(131072 /* YieldContext */, func); + return doInsideOfContext(4096 /* YieldContext */, func); } function doInDecoratorContext(func) { - return doInsideOfContext(262144 /* DecoratorContext */, func); + return doInsideOfContext(8192 /* DecoratorContext */, func); } function doInAwaitContext(func) { - return doInsideOfContext(524288 /* AwaitContext */, func); + return doInsideOfContext(16384 /* AwaitContext */, func); } function doOutsideOfAwaitContext(func) { - return doOutsideOfContext(524288 /* AwaitContext */, func); + return doOutsideOfContext(16384 /* AwaitContext */, func); } function doInYieldAndAwaitContext(func) { - return doInsideOfContext(131072 /* YieldContext */ | 524288 /* AwaitContext */, func); + return doInsideOfContext(4096 /* YieldContext */ | 16384 /* AwaitContext */, func); } function inContext(flags) { return (contextFlags & flags) !== 0; } function inYieldContext() { - return inContext(131072 /* YieldContext */); + return inContext(4096 /* YieldContext */); } function inDisallowInContext() { - return inContext(65536 /* DisallowInContext */); + return inContext(2048 /* DisallowInContext */); } function inDecoratorContext() { - return inContext(262144 /* DecoratorContext */); + return inContext(8192 /* DecoratorContext */); } function inAwaitContext() { - return inContext(524288 /* AwaitContext */); + return inContext(16384 /* AwaitContext */); } function parseErrorAtCurrentToken(message, arg0) { var start = scanner.getTokenPos(); @@ -14830,7 +15659,7 @@ var ts; if (!(pos >= 0)) { pos = scanner.getStartPos(); } - return kind >= 141 /* FirstNode */ ? new NodeConstructor(kind, pos, pos) : + return kind >= 142 /* FirstNode */ ? new NodeConstructor(kind, pos, pos) : kind === 70 /* Identifier */ ? new IdentifierConstructor(kind, pos, pos) : new TokenConstructor(kind, pos, pos); } @@ -14853,7 +15682,7 @@ var ts; // flag so that we don't mark any subsequent nodes. if (parseErrorBeforeNextFinishedNode) { parseErrorBeforeNextFinishedNode = false; - node.flags |= 1048576 /* ThisNodeHasError */; + node.flags |= 32768 /* ThisNodeHasError */; } return node; } @@ -14870,7 +15699,11 @@ var ts; } function internIdentifier(text) { text = ts.escapeIdentifier(text); - return identifiers[text] || (identifiers[text] = text); + var identifier = identifiers.get(text); + if (identifier === undefined) { + identifiers.set(text, identifier = text); + } + return identifier; } // An identifier that starts with two underscores has an extra underscore character prepended to it to avoid issues // with magic property names like '__proto__'. The 'identifiers' object is used to share a single string instance for @@ -14922,7 +15755,7 @@ var ts; // PropertyName [Yield]: // LiteralPropertyName // ComputedPropertyName[?Yield] - var node = createNode(142 /* ComputedPropertyName */); + var node = createNode(143 /* ComputedPropertyName */); parseExpected(20 /* OpenBracketToken */); // We parse any expression (including a comma expression). But the grammar // says that only an assignment expression is allowed, so the grammar checker @@ -14975,6 +15808,7 @@ var ts; function nextTokenIsClassOrFunctionOrAsync() { nextToken(); return token() === 74 /* ClassKeyword */ || token() === 88 /* FunctionKeyword */ || + (token() === 116 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine)) || (token() === 119 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine)); } // True if positioned at the start of a list element @@ -15015,7 +15849,7 @@ var ts; case 9 /* ObjectBindingElements */: return token() === 20 /* OpenBracketToken */ || token() === 23 /* DotDotDotToken */ || isLiteralPropertyName(); case 7 /* HeritageClauseElement */: - // If we see { } then only consume it as an expression if it is followed by , or { + // If we see `{ ... }` then only consume it as an expression if it is followed by `,` or `{` // That way we won't consume the body of a class in its heritage clause. if (token() === 16 /* OpenBraceToken */) { return lookAhead(isValidHeritageClauseObjectLiteral); @@ -15247,7 +16081,7 @@ var ts; // differently depending on what mode it is in. // // This also applies to all our other context flags as well. - var nodeContextFlags = node.flags & 3080192 /* ContextFlags */; + var nodeContextFlags = node.flags & 96256 /* ContextFlags */; if (nodeContextFlags !== contextFlags) { return undefined; } @@ -15329,14 +16163,14 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 150 /* Constructor */: - case 155 /* IndexSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 147 /* PropertyDeclaration */: - case 203 /* SemicolonClassElement */: + case 151 /* Constructor */: + case 156 /* IndexSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 148 /* PropertyDeclaration */: + case 205 /* SemicolonClassElement */: return true; - case 149 /* MethodDeclaration */: + case 150 /* MethodDeclaration */: // Method declarations are not necessarily reusable. An object-literal // may have a method calls "constructor(...)" and we must reparse that // into an actual .ConstructorDeclaration. @@ -15351,8 +16185,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 253 /* CaseClause */: - case 254 /* DefaultClause */: + case 256 /* CaseClause */: + case 257 /* DefaultClause */: return true; } } @@ -15361,58 +16195,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 225 /* FunctionDeclaration */: - case 205 /* VariableStatement */: - case 204 /* Block */: - case 208 /* IfStatement */: - case 207 /* ExpressionStatement */: - case 220 /* ThrowStatement */: - case 216 /* ReturnStatement */: - case 218 /* SwitchStatement */: - case 215 /* BreakStatement */: - case 214 /* ContinueStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 211 /* ForStatement */: - case 210 /* WhileStatement */: - case 217 /* WithStatement */: - case 206 /* EmptyStatement */: - case 221 /* TryStatement */: - case 219 /* LabeledStatement */: - case 209 /* DoStatement */: - case 222 /* DebuggerStatement */: - case 235 /* ImportDeclaration */: - case 234 /* ImportEqualsDeclaration */: - case 241 /* ExportDeclaration */: - case 240 /* ExportAssignment */: - case 230 /* ModuleDeclaration */: - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 229 /* EnumDeclaration */: - case 228 /* TypeAliasDeclaration */: + case 227 /* FunctionDeclaration */: + case 207 /* VariableStatement */: + case 206 /* Block */: + case 210 /* IfStatement */: + case 209 /* ExpressionStatement */: + case 222 /* ThrowStatement */: + case 218 /* ReturnStatement */: + case 220 /* SwitchStatement */: + case 217 /* BreakStatement */: + case 216 /* ContinueStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: + case 213 /* ForStatement */: + case 212 /* WhileStatement */: + case 219 /* WithStatement */: + case 208 /* EmptyStatement */: + case 223 /* TryStatement */: + case 221 /* LabeledStatement */: + case 211 /* DoStatement */: + case 224 /* DebuggerStatement */: + case 237 /* ImportDeclaration */: + case 236 /* ImportEqualsDeclaration */: + case 243 /* ExportDeclaration */: + case 242 /* ExportAssignment */: + case 232 /* ModuleDeclaration */: + case 228 /* ClassDeclaration */: + case 229 /* InterfaceDeclaration */: + case 231 /* EnumDeclaration */: + case 230 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 260 /* EnumMember */; + return node.kind === 263 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 154 /* ConstructSignature */: - case 148 /* MethodSignature */: - case 155 /* IndexSignature */: - case 146 /* PropertySignature */: - case 153 /* CallSignature */: + case 155 /* ConstructSignature */: + case 149 /* MethodSignature */: + case 156 /* IndexSignature */: + case 147 /* PropertySignature */: + case 154 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 223 /* VariableDeclaration */) { + if (node.kind !== 225 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -15433,7 +16267,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 144 /* Parameter */) { + if (node.kind !== 145 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -15480,7 +16314,6 @@ var ts; case 25 /* JSDocRecordMembers */: return ts.Diagnostics.Property_assignment_expected; } } - ; // Parses a comma-delimited list of elements function parseDelimitedList(kind, parseElement, considerSemicolonAsDelimiter) { var saveParsingContext = parsingContext; @@ -15546,7 +16379,7 @@ var ts; function parseEntityName(allowReservedWords, diagnosticMessage) { var entity = parseIdentifier(diagnosticMessage); while (parseOptional(22 /* DotToken */)) { - var node = createNode(141 /* QualifiedName */, entity.pos); // !!! + var node = createNode(142 /* QualifiedName */, entity.pos); // !!! node.left = entity; node.right = parseRightSideOfDot(allowReservedWords); entity = finishNode(node); @@ -15585,7 +16418,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(194 /* TemplateExpression */); + var template = createNode(195 /* TemplateExpression */); template.head = parseTemplateHead(); ts.Debug.assert(template.head.kind === 13 /* TemplateHead */, "Template head has wrong token kind"); var templateSpans = createNodeArray(); @@ -15597,7 +16430,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(202 /* TemplateSpan */); + var span = createNode(204 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token() === 17 /* CloseBraceToken */) { @@ -15633,27 +16466,23 @@ var ts; if (scanner.isUnterminated()) { node.isUnterminated = true; } - var tokenPos = scanner.getTokenPos(); - nextToken(); - finishNode(node); // Octal literals are not allowed in strict mode or ES5 // Note that theoretically the following condition would hold true literals like 009, // which is not octal.But because of how the scanner separates the tokens, we would // never get a token like this. Instead, we would get 00 and 9 as two separate tokens. // We also do not need to check for negatives because any prefix operator would be part of a // parent unary expression. - if (node.kind === 8 /* NumericLiteral */ - && sourceText.charCodeAt(tokenPos) === 48 /* _0 */ - && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { - node.isOctalLiteral = true; + if (node.kind === 8 /* NumericLiteral */) { + node.numericLiteralFlags = scanner.getNumericLiteralFlags(); } + nextToken(); + finishNode(node); return node; } // TYPES function parseTypeReference() { - var typeName = parseEntityName(/*allowReservedWords*/ false, ts.Diagnostics.Type_expected); - var node = createNode(157 /* TypeReference */, typeName.pos); - node.typeName = typeName; + var node = createNode(158 /* TypeReference */); + node.typeName = parseEntityName(/*allowReservedWords*/ false, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && token() === 26 /* LessThanToken */) { node.typeArguments = parseBracketedList(19 /* TypeArguments */, parseType, 26 /* LessThanToken */, 28 /* GreaterThanToken */); } @@ -15661,24 +16490,24 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(156 /* TypePredicate */, lhs.pos); + var node = createNode(157 /* TypePredicate */, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(167 /* ThisType */); + var node = createNode(168 /* ThisType */); nextToken(); return finishNode(node); } function parseTypeQuery() { - var node = createNode(160 /* TypeQuery */); + var node = createNode(161 /* TypeQuery */); parseExpected(102 /* TypeOfKeyword */); node.exprName = parseEntityName(/*allowReservedWords*/ true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(143 /* TypeParameter */); + var node = createNode(144 /* TypeParameter */); node.name = parseIdentifier(); if (parseOptional(84 /* ExtendsKeyword */)) { // It's not uncommon for people to write improper constraints to a generic. If the @@ -15699,6 +16528,9 @@ var ts; node.expression = parseUnaryExpressionOrHigher(); } } + if (parseOptional(57 /* EqualsToken */)) { + node.default = parseType(); + } return finishNode(node); } function parseTypeParameters() { @@ -15716,9 +16548,9 @@ var ts; return token() === 23 /* DotDotDotToken */ || isIdentifierOrPattern() || ts.isModifierKind(token()) || token() === 56 /* AtToken */ || token() === 98 /* ThisKeyword */; } function parseParameter() { - var node = createNode(144 /* Parameter */); + var node = createNode(145 /* Parameter */); if (token() === 98 /* ThisKeyword */) { - node.name = createIdentifier(/*isIdentifier*/ true, undefined); + node.name = createIdentifier(/*isIdentifier*/ true); node.type = parseParameterType(); return finishNode(node); } @@ -15815,7 +16647,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNode(kind); - if (kind === 154 /* ConstructSignature */) { + if (kind === 155 /* ConstructSignature */) { parseExpected(93 /* NewKeyword */); } fillSignature(55 /* ColonToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, node); @@ -15879,7 +16711,7 @@ var ts; return token() === 55 /* ColonToken */ || token() === 25 /* CommaToken */ || token() === 21 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) { - var node = createNode(155 /* IndexSignature */, fullStart); + var node = createNode(156 /* IndexSignature */, fullStart); node.decorators = decorators; node.modifiers = modifiers; node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 20 /* OpenBracketToken */, 21 /* CloseBracketToken */); @@ -15891,7 +16723,7 @@ var ts; var name = parsePropertyName(); var questionToken = parseOptionalToken(54 /* QuestionToken */); if (token() === 18 /* OpenParenToken */ || token() === 26 /* LessThanToken */) { - var method = createNode(148 /* MethodSignature */, fullStart); + var method = createNode(149 /* MethodSignature */, fullStart); method.modifiers = modifiers; method.name = name; method.questionToken = questionToken; @@ -15902,7 +16734,7 @@ var ts; return addJSDocComment(finishNode(method)); } else { - var property = createNode(146 /* PropertySignature */, fullStart); + var property = createNode(147 /* PropertySignature */, fullStart); property.modifiers = modifiers; property.name = name; property.questionToken = questionToken; @@ -15918,14 +16750,14 @@ var ts; } } function isTypeMemberStart() { - var idToken; // Return true if we have the start of a signature member if (token() === 18 /* OpenParenToken */ || token() === 26 /* LessThanToken */) { return true; } + var idToken; // Eat up all modifiers, but hold on to the last one in case it is actually an identifier while (ts.isModifierKind(token())) { - idToken = token(); + idToken = true; nextToken(); } // Index signatures and computed property names are type members @@ -15934,7 +16766,7 @@ var ts; } // Try to get the first property-like token following all modifiers if (isLiteralPropertyName()) { - idToken = token(); + idToken = true; nextToken(); } // If we were able to get any potential identifier, check that it is @@ -15951,10 +16783,10 @@ var ts; } function parseTypeMember() { if (token() === 18 /* OpenParenToken */ || token() === 26 /* LessThanToken */) { - return parseSignatureMember(153 /* CallSignature */); + return parseSignatureMember(154 /* CallSignature */); } if (token() === 93 /* NewKeyword */ && lookAhead(isStartOfConstructSignature)) { - return parseSignatureMember(154 /* ConstructSignature */); + return parseSignatureMember(155 /* ConstructSignature */); } var fullStart = getNodePos(); var modifiers = parseModifiers(); @@ -15968,7 +16800,7 @@ var ts; return token() === 18 /* OpenParenToken */ || token() === 26 /* LessThanToken */; } function parseTypeLiteral() { - var node = createNode(161 /* TypeLiteral */); + var node = createNode(162 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -15991,14 +16823,14 @@ var ts; return token() === 20 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 91 /* InKeyword */; } function parseMappedTypeParameter() { - var node = createNode(143 /* TypeParameter */); + var node = createNode(144 /* TypeParameter */); node.name = parseIdentifier(); parseExpected(91 /* InKeyword */); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(170 /* MappedType */); + var node = createNode(171 /* MappedType */); parseExpected(16 /* OpenBraceToken */); node.readonlyToken = parseOptionalToken(130 /* ReadonlyKeyword */); parseExpected(20 /* OpenBracketToken */); @@ -16011,12 +16843,12 @@ var ts; return finishNode(node); } function parseTupleType() { - var node = createNode(163 /* TupleType */); + var node = createNode(164 /* TupleType */); node.elementTypes = parseBracketedList(20 /* TupleElementTypes */, parseType, 20 /* OpenBracketToken */, 21 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(166 /* ParenthesizedType */); + var node = createNode(167 /* ParenthesizedType */); parseExpected(18 /* OpenParenToken */); node.type = parseType(); parseExpected(19 /* CloseParenToken */); @@ -16024,7 +16856,7 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNode(kind); - if (kind === 159 /* ConstructorType */) { + if (kind === 160 /* ConstructorType */) { parseExpected(93 /* NewKeyword */); } fillSignature(35 /* EqualsGreaterThanToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, node); @@ -16035,7 +16867,7 @@ var ts; return token() === 22 /* DotToken */ ? undefined : node; } function parseLiteralTypeNode() { - var node = createNode(171 /* LiteralType */); + var node = createNode(172 /* LiteralType */); node.literal = parseSimpleUnaryExpression(); finishNode(node); return node; @@ -16046,12 +16878,13 @@ var ts; function parseNonArrayType() { switch (token()) { case 118 /* AnyKeyword */: - case 134 /* StringKeyword */: + case 135 /* StringKeyword */: case 132 /* NumberKeyword */: case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: - case 137 /* UndefinedKeyword */: + case 136 /* SymbolKeyword */: + case 138 /* UndefinedKeyword */: case 129 /* NeverKeyword */: + case 133 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReference(); @@ -16089,12 +16922,12 @@ var ts; function isStartOfType() { switch (token()) { case 118 /* AnyKeyword */: - case 134 /* StringKeyword */: + case 135 /* StringKeyword */: case 132 /* NumberKeyword */: case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: + case 136 /* SymbolKeyword */: case 104 /* VoidKeyword */: - case 137 /* UndefinedKeyword */: + case 138 /* UndefinedKeyword */: case 94 /* NullKeyword */: case 98 /* ThisKeyword */: case 102 /* TypeOfKeyword */: @@ -16102,11 +16935,14 @@ var ts; case 16 /* OpenBraceToken */: case 20 /* OpenBracketToken */: case 26 /* LessThanToken */: + case 48 /* BarToken */: + case 47 /* AmpersandToken */: case 93 /* NewKeyword */: case 9 /* StringLiteral */: case 8 /* NumericLiteral */: case 100 /* TrueKeyword */: case 85 /* FalseKeyword */: + case 133 /* ObjectKeyword */: return true; case 37 /* MinusToken */: return lookAhead(nextTokenIsNumericLiteral); @@ -16126,14 +16962,14 @@ var ts; var type = parseNonArrayType(); while (!scanner.hasPrecedingLineBreak() && parseOptional(20 /* OpenBracketToken */)) { if (isStartOfType()) { - var node = createNode(169 /* IndexedAccessType */, type.pos); + var node = createNode(170 /* IndexedAccessType */, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(21 /* CloseBracketToken */); type = finishNode(node); } else { - var node = createNode(162 /* ArrayType */, type.pos); + var node = createNode(163 /* ArrayType */, type.pos); node.elementType = type; parseExpected(21 /* CloseBracketToken */); type = finishNode(node); @@ -16142,7 +16978,7 @@ var ts; return type; } function parseTypeOperator(operator) { - var node = createNode(168 /* TypeOperator */); + var node = createNode(169 /* TypeOperator */); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); @@ -16156,6 +16992,7 @@ var ts; return parseArrayTypeOrHigher(); } function parseUnionOrIntersectionType(kind, parseConstituentType, operator) { + parseOptional(operator); var type = parseConstituentType(); if (token() === operator) { var types = createNodeArray([type], type.pos); @@ -16170,10 +17007,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(165 /* IntersectionType */, parseTypeOperatorOrHigher, 47 /* AmpersandToken */); + return parseUnionOrIntersectionType(166 /* IntersectionType */, parseTypeOperatorOrHigher, 47 /* AmpersandToken */); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(164 /* UnionType */, parseIntersectionTypeOrHigher, 48 /* BarToken */); + return parseUnionOrIntersectionType(165 /* UnionType */, parseIntersectionTypeOrHigher, 48 /* BarToken */); } function isStartOfFunctionType() { if (token() === 26 /* LessThanToken */) { @@ -16230,7 +17067,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(156 /* TypePredicate */, typePredicateVariable.pos); + var node = createNode(157 /* TypePredicate */, typePredicateVariable.pos); node.parameterName = typePredicateVariable; node.type = type; return finishNode(node); @@ -16249,14 +17086,14 @@ var ts; function parseType() { // The rules about 'yield' only apply to actual code/expression contexts. They don't // apply to 'type' contexts. So we disable these parameters here before moving on. - return doOutsideOfContext(655360 /* TypeExcludesFlags */, parseTypeWorker); + return doOutsideOfContext(20480 /* TypeExcludesFlags */, parseTypeWorker); } function parseTypeWorker() { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(158 /* FunctionType */); + return parseFunctionOrConstructorType(159 /* FunctionType */); } if (token() === 93 /* NewKeyword */) { - return parseFunctionOrConstructorType(159 /* ConstructorType */); + return parseFunctionOrConstructorType(160 /* ConstructorType */); } return parseUnionTypeOrHigher(); } @@ -16457,7 +17294,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(195 /* YieldExpression */); + var node = createNode(196 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -16479,13 +17316,13 @@ var ts; ts.Debug.assert(token() === 35 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(185 /* ArrowFunction */, asyncModifier.pos); + node = createNode(186 /* ArrowFunction */, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(185 /* ArrowFunction */, identifier.pos); + node = createNode(186 /* ArrowFunction */, identifier.pos); } - var parameter = createNode(144 /* Parameter */, identifier.pos); + var parameter = createNode(145 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos); @@ -16667,7 +17504,7 @@ var ts; return 0 /* False */; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(185 /* ArrowFunction */); + var node = createNode(186 /* ArrowFunction */); node.modifiers = parseModifiersForArrowFunction(); var isAsync = !!(ts.getModifierFlags(node) & 256 /* Async */); // Arrow functions are never generators. @@ -16733,7 +17570,7 @@ var ts; } // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - var node = createNode(193 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(194 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -16746,7 +17583,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 91 /* InKeyword */ || t === 140 /* OfKeyword */; + return t === 91 /* InKeyword */ || t === 141 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -16854,39 +17691,39 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(192 /* BinaryExpression */, left.pos); + var node = createNode(193 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(200 /* AsExpression */, left.pos); + var node = createNode(201 /* AsExpression */, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(190 /* PrefixUnaryExpression */); + var node = createNode(191 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(186 /* DeleteExpression */); + var node = createNode(187 /* DeleteExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(187 /* TypeOfExpression */); + var node = createNode(188 /* TypeOfExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(188 /* VoidExpression */); + var node = createNode(189 /* VoidExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -16902,7 +17739,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(189 /* AwaitExpression */); + var node = createNode(190 /* AwaitExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -16945,7 +17782,7 @@ var ts; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token() === 39 /* AsteriskAsteriskToken */) { var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); - if (simpleUnaryExpression.kind === 182 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 183 /* TypeAssertionExpression */) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -16990,6 +17827,7 @@ var ts; if (isAwaitExpression()) { return parseAwaitExpression(); } + // falls through default: return parseIncrementExpression(); } @@ -17023,7 +17861,7 @@ var ts; return false; } // We are in JSX context and the token is part of JSXElement. - // Fall through + // falls through default: return true; } @@ -17041,7 +17879,7 @@ var ts; */ function parseIncrementExpression() { if (token() === 42 /* PlusPlusToken */ || token() === 43 /* MinusMinusToken */) { - var node = createNode(190 /* PrefixUnaryExpression */); + var node = createNode(191 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -17054,7 +17892,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 42 /* PlusPlusToken */ || token() === 43 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(191 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(192 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -17158,7 +17996,7 @@ var ts; } // If we have seen "super" it must be followed by '(' or '.'. // If it wasn't then just try to parse out a '.' and report an error. - var node = createNode(177 /* PropertyAccessExpression */, expression.pos); + var node = createNode(178 /* PropertyAccessExpression */, expression.pos); node.expression = expression; parseExpectedToken(22 /* DotToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); @@ -17183,8 +18021,8 @@ var ts; function parseJsxElementOrSelfClosingElement(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElement(inExpressionContext); var result; - if (opening.kind === 248 /* JsxOpeningElement */) { - var node = createNode(246 /* JsxElement */, opening.pos); + if (opening.kind === 250 /* JsxOpeningElement */) { + var node = createNode(248 /* JsxElement */, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement.tagName); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -17194,7 +18032,7 @@ var ts; result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 247 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 249 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -17209,7 +18047,7 @@ var ts; var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElement(/*inExpressionContext*/ true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(192 /* BinaryExpression */, result.pos); + var badNode = createNode(193 /* BinaryExpression */, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -17252,23 +18090,31 @@ var ts; parseErrorAtPosition(openingTagName.pos, openingTagName.end - openingTagName.pos, ts.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, ts.getTextOfNodeFromSourceText(sourceText, openingTagName)); break; } + else if (token() === 7 /* ConflictMarkerTrivia */) { + break; + } result.push(parseJsxChild()); } result.end = scanner.getTokenPos(); parsingContext = saveParsingContext; return result; } + function parseJsxAttributes() { + var jsxAttributes = createNode(253 /* JsxAttributes */); + jsxAttributes.properties = parseList(13 /* JsxAttributes */, parseJsxAttribute); + return finishNode(jsxAttributes); + } function parseJsxOpeningOrSelfClosingElement(inExpressionContext) { var fullStart = scanner.getStartPos(); parseExpected(26 /* LessThanToken */); var tagName = parseJsxElementName(); - var attributes = parseList(13 /* JsxAttributes */, parseJsxAttribute); + var attributes = parseJsxAttributes(); var node; if (token() === 28 /* GreaterThanToken */) { // Closing tag, so scan the immediately-following text with the JSX scanning instead // of regular scanning to avoid treating illegal characters (e.g. '#') as immediate // scanning errors - node = createNode(248 /* JsxOpeningElement */, fullStart); + node = createNode(250 /* JsxOpeningElement */, fullStart); scanJsxText(); } else { @@ -17280,7 +18126,7 @@ var ts; parseExpected(28 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } - node = createNode(247 /* JsxSelfClosingElement */, fullStart); + node = createNode(249 /* JsxSelfClosingElement */, fullStart); } node.tagName = tagName; node.attributes = attributes; @@ -17296,7 +18142,7 @@ var ts; var expression = token() === 98 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); while (parseOptional(22 /* DotToken */)) { - var propertyAccess = createNode(177 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(178 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); expression = finishNode(propertyAccess); @@ -17304,9 +18150,10 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(252 /* JsxExpression */); + var node = createNode(255 /* JsxExpression */); parseExpected(16 /* OpenBraceToken */); if (token() !== 17 /* CloseBraceToken */) { + node.dotDotDotToken = parseOptionalToken(23 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); } if (inExpressionContext) { @@ -17323,7 +18170,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(250 /* JsxAttribute */); + var node = createNode(252 /* JsxAttribute */); node.name = parseIdentifierName(); if (token() === 57 /* EqualsToken */) { switch (scanJsxAttributeValue()) { @@ -17338,7 +18185,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(251 /* JsxSpreadAttribute */); + var node = createNode(254 /* JsxSpreadAttribute */); parseExpected(16 /* OpenBraceToken */); parseExpected(23 /* DotDotDotToken */); node.expression = parseExpression(); @@ -17346,7 +18193,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(249 /* JsxClosingElement */); + var node = createNode(251 /* JsxClosingElement */); parseExpected(27 /* LessThanSlashToken */); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -17359,7 +18206,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(182 /* TypeAssertionExpression */); + var node = createNode(183 /* TypeAssertionExpression */); parseExpected(26 /* LessThanToken */); node.type = parseType(); parseExpected(28 /* GreaterThanToken */); @@ -17370,7 +18217,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(22 /* DotToken */); if (dotToken) { - var propertyAccess = createNode(177 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(178 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); expression = finishNode(propertyAccess); @@ -17378,14 +18225,14 @@ var ts; } if (token() === 50 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(201 /* NonNullExpression */, expression.pos); + var nonNullExpression = createNode(202 /* NonNullExpression */, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; } // when in the [Decorator] context, we do not parse ElementAccess as it could be part of a ComputedPropertyName if (!inDecoratorContext() && parseOptional(20 /* OpenBracketToken */)) { - var indexedAccess = createNode(178 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(179 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; // It's not uncommon for a user to write: "new Type[]". // Check for that common pattern and report a better error message. @@ -17401,7 +18248,7 @@ var ts; continue; } if (token() === 12 /* NoSubstitutionTemplateLiteral */ || token() === 13 /* TemplateHead */) { - var tagExpression = createNode(181 /* TaggedTemplateExpression */, expression.pos); + var tagExpression = createNode(182 /* TaggedTemplateExpression */, expression.pos); tagExpression.tag = expression; tagExpression.template = token() === 12 /* NoSubstitutionTemplateLiteral */ ? parseLiteralNode() @@ -17424,7 +18271,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(179 /* CallExpression */, expression.pos); + var callExpr = createNode(180 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -17432,7 +18279,7 @@ var ts; continue; } else if (token() === 18 /* OpenParenToken */) { - var callExpr = createNode(179 /* CallExpression */, expression.pos); + var callExpr = createNode(180 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -17542,28 +18389,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(183 /* ParenthesizedExpression */); + var node = createNode(184 /* ParenthesizedExpression */); parseExpected(18 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(19 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(196 /* SpreadElement */); + var node = createNode(197 /* SpreadElement */); parseExpected(23 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 23 /* DotDotDotToken */ ? parseSpreadElement() : - token() === 25 /* CommaToken */ ? createNode(198 /* OmittedExpression */) : + token() === 25 /* CommaToken */ ? createNode(199 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(175 /* ArrayLiteralExpression */); + var node = createNode(176 /* ArrayLiteralExpression */); parseExpected(20 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -17574,10 +18421,10 @@ var ts; } function tryParseAccessorDeclaration(fullStart, decorators, modifiers) { if (parseContextualModifier(124 /* GetKeyword */)) { - return parseAccessorDeclaration(151 /* GetAccessor */, fullStart, decorators, modifiers); + return parseAccessorDeclaration(152 /* GetAccessor */, fullStart, decorators, modifiers); } - else if (parseContextualModifier(133 /* SetKeyword */)) { - return parseAccessorDeclaration(152 /* SetAccessor */, fullStart, decorators, modifiers); + else if (parseContextualModifier(134 /* SetKeyword */)) { + return parseAccessorDeclaration(153 /* SetAccessor */, fullStart, decorators, modifiers); } return undefined; } @@ -17585,7 +18432,7 @@ var ts; var fullStart = scanner.getStartPos(); var dotDotDotToken = parseOptionalToken(23 /* DotDotDotToken */); if (dotDotDotToken) { - var spreadElement = createNode(259 /* SpreadAssignment */, fullStart); + var spreadElement = createNode(262 /* SpreadAssignment */, fullStart); spreadElement.expression = parseAssignmentExpressionOrHigher(); return addJSDocComment(finishNode(spreadElement)); } @@ -17610,7 +18457,7 @@ var ts; // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 25 /* CommaToken */ || token() === 17 /* CloseBraceToken */ || token() === 57 /* EqualsToken */); if (isShorthandPropertyAssignment) { - var shorthandDeclaration = createNode(258 /* ShorthandPropertyAssignment */, fullStart); + var shorthandDeclaration = createNode(261 /* ShorthandPropertyAssignment */, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; var equalsToken = parseOptionalToken(57 /* EqualsToken */); @@ -17621,7 +18468,7 @@ var ts; return addJSDocComment(finishNode(shorthandDeclaration)); } else { - var propertyAssignment = createNode(257 /* PropertyAssignment */, fullStart); + var propertyAssignment = createNode(260 /* PropertyAssignment */, fullStart); propertyAssignment.modifiers = modifiers; propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; @@ -17631,7 +18478,7 @@ var ts; } } function parseObjectLiteralExpression() { - var node = createNode(176 /* ObjectLiteralExpression */); + var node = createNode(177 /* ObjectLiteralExpression */); parseExpected(16 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -17650,7 +18497,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(/*val*/ false); } - var node = createNode(184 /* FunctionExpression */); + var node = createNode(185 /* FunctionExpression */); node.modifiers = parseModifiers(); parseExpected(88 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(38 /* AsteriskToken */); @@ -17672,8 +18519,15 @@ var ts; return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(180 /* NewExpression */); + var fullStart = scanner.getStartPos(); parseExpected(93 /* NewKeyword */); + if (parseOptional(22 /* DotToken */)) { + var node_1 = createNode(203 /* MetaProperty */, fullStart); + node_1.keywordToken = 93 /* NewKeyword */; + node_1.name = parseIdentifierName(); + return finishNode(node_1); + } + var node = createNode(181 /* NewExpression */, fullStart); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); if (node.typeArguments || token() === 18 /* OpenParenToken */) { @@ -17683,7 +18537,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(204 /* Block */); + var node = createNode(206 /* Block */); if (parseExpected(16 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -17716,12 +18570,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(206 /* EmptyStatement */); + var node = createNode(208 /* EmptyStatement */); parseExpected(24 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(208 /* IfStatement */); + var node = createNode(210 /* IfStatement */); parseExpected(89 /* IfKeyword */); parseExpected(18 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -17731,7 +18585,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(209 /* DoStatement */); + var node = createNode(211 /* DoStatement */); parseExpected(80 /* DoKeyword */); node.statement = parseStatement(); parseExpected(105 /* WhileKeyword */); @@ -17746,7 +18600,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(210 /* WhileStatement */); + var node = createNode(212 /* WhileStatement */); parseExpected(105 /* WhileKeyword */); parseExpected(18 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -17757,6 +18611,7 @@ var ts; function parseForOrForInOrForOfStatement() { var pos = getNodePos(); parseExpected(87 /* ForKeyword */); + var awaitToken = parseOptionalToken(120 /* AwaitKeyword */); parseExpected(18 /* OpenParenToken */); var initializer = undefined; if (token() !== 24 /* SemicolonToken */) { @@ -17768,22 +18623,23 @@ var ts; } } var forOrForInOrForOfStatement; - if (parseOptional(91 /* InKeyword */)) { - var forInStatement = createNode(212 /* ForInStatement */, pos); - forInStatement.initializer = initializer; - forInStatement.expression = allowInAnd(parseExpression); - parseExpected(19 /* CloseParenToken */); - forOrForInOrForOfStatement = forInStatement; - } - else if (parseOptional(140 /* OfKeyword */)) { - var forOfStatement = createNode(213 /* ForOfStatement */, pos); + if (awaitToken ? parseExpected(141 /* OfKeyword */) : parseOptional(141 /* OfKeyword */)) { + var forOfStatement = createNode(215 /* ForOfStatement */, pos); + forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(19 /* CloseParenToken */); forOrForInOrForOfStatement = forOfStatement; } + else if (parseOptional(91 /* InKeyword */)) { + var forInStatement = createNode(214 /* ForInStatement */, pos); + forInStatement.initializer = initializer; + forInStatement.expression = allowInAnd(parseExpression); + parseExpected(19 /* CloseParenToken */); + forOrForInOrForOfStatement = forInStatement; + } else { - var forStatement = createNode(211 /* ForStatement */, pos); + var forStatement = createNode(213 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(24 /* SemicolonToken */); if (token() !== 24 /* SemicolonToken */ && token() !== 19 /* CloseParenToken */) { @@ -17801,7 +18657,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 215 /* BreakStatement */ ? 71 /* BreakKeyword */ : 76 /* ContinueKeyword */); + parseExpected(kind === 217 /* BreakStatement */ ? 71 /* BreakKeyword */ : 76 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -17809,7 +18665,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(216 /* ReturnStatement */); + var node = createNode(218 /* ReturnStatement */); parseExpected(95 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -17818,7 +18674,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(217 /* WithStatement */); + var node = createNode(219 /* WithStatement */); parseExpected(106 /* WithKeyword */); parseExpected(18 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -17827,7 +18683,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(253 /* CaseClause */); + var node = createNode(256 /* CaseClause */); parseExpected(72 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(55 /* ColonToken */); @@ -17835,7 +18691,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(254 /* DefaultClause */); + var node = createNode(257 /* DefaultClause */); parseExpected(78 /* DefaultKeyword */); parseExpected(55 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); @@ -17845,12 +18701,12 @@ var ts; return token() === 72 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(218 /* SwitchStatement */); + var node = createNode(220 /* SwitchStatement */); parseExpected(97 /* SwitchKeyword */); parseExpected(18 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(19 /* CloseParenToken */); - var caseBlock = createNode(232 /* CaseBlock */, scanner.getStartPos()); + var caseBlock = createNode(234 /* CaseBlock */, scanner.getStartPos()); parseExpected(16 /* OpenBraceToken */); caseBlock.clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(17 /* CloseBraceToken */); @@ -17865,7 +18721,7 @@ var ts; // directly as that might consume an expression on the following line. // We just return 'undefined' in that case. The actual error will be reported in the // grammar walker. - var node = createNode(220 /* ThrowStatement */); + var node = createNode(222 /* ThrowStatement */); parseExpected(99 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); @@ -17873,7 +18729,7 @@ var ts; } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(221 /* TryStatement */); + var node = createNode(223 /* TryStatement */); parseExpected(101 /* TryKeyword */); node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); node.catchClause = token() === 73 /* CatchKeyword */ ? parseCatchClause() : undefined; @@ -17886,7 +18742,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(256 /* CatchClause */); + var result = createNode(259 /* CatchClause */); parseExpected(73 /* CatchKeyword */); if (parseExpected(18 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); @@ -17896,7 +18752,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(222 /* DebuggerStatement */); + var node = createNode(224 /* DebuggerStatement */); parseExpected(77 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -17908,13 +18764,13 @@ var ts; var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); if (expression.kind === 70 /* Identifier */ && parseOptional(55 /* ColonToken */)) { - var labeledStatement = createNode(219 /* LabeledStatement */, fullStart); + var labeledStatement = createNode(221 /* LabeledStatement */, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return addJSDocComment(finishNode(labeledStatement)); } else { - var expressionStatement = createNode(207 /* ExpressionStatement */, fullStart); + var expressionStatement = createNode(209 /* ExpressionStatement */, fullStart); expressionStatement.expression = expression; parseSemicolon(); return addJSDocComment(finishNode(expressionStatement)); @@ -17924,6 +18780,10 @@ var ts; nextToken(); return ts.tokenIsIdentifierOrKeyword(token()) && !scanner.hasPrecedingLineBreak(); } + function nextTokenIsClassKeywordOnSameLine() { + nextToken(); + return token() === 74 /* ClassKeyword */ && !scanner.hasPrecedingLineBreak(); + } function nextTokenIsFunctionKeywordOnSameLine() { nextToken(); return token() === 88 /* FunctionKeyword */ && !scanner.hasPrecedingLineBreak(); @@ -17964,7 +18824,7 @@ var ts; // // could be legal, it would add complexity for very little gain. case 108 /* InterfaceKeyword */: - case 136 /* TypeKeyword */: + case 137 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); case 127 /* ModuleKeyword */: case 128 /* NamespaceKeyword */: @@ -17982,7 +18842,7 @@ var ts; return false; } continue; - case 139 /* GlobalKeyword */: + case 140 /* GlobalKeyword */: nextToken(); return token() === 16 /* OpenBraceToken */ || token() === 70 /* Identifier */ || token() === 83 /* ExportKeyword */; case 90 /* ImportKeyword */: @@ -18044,8 +18904,8 @@ var ts; case 108 /* InterfaceKeyword */: case 127 /* ModuleKeyword */: case 128 /* NamespaceKeyword */: - case 136 /* TypeKeyword */: - case 139 /* GlobalKeyword */: + case 137 /* TypeKeyword */: + case 140 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 113 /* PublicKeyword */: @@ -18095,9 +18955,9 @@ var ts; case 87 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 76 /* ContinueKeyword */: - return parseBreakOrContinueStatement(214 /* ContinueStatement */); + return parseBreakOrContinueStatement(216 /* ContinueStatement */); case 71 /* BreakKeyword */: - return parseBreakOrContinueStatement(215 /* BreakStatement */); + return parseBreakOrContinueStatement(217 /* BreakStatement */); case 95 /* ReturnKeyword */: return parseReturnStatement(); case 106 /* WithKeyword */: @@ -18117,7 +18977,7 @@ var ts; return parseDeclaration(); case 119 /* AsyncKeyword */: case 108 /* InterfaceKeyword */: - case 136 /* TypeKeyword */: + case 137 /* TypeKeyword */: case 127 /* ModuleKeyword */: case 128 /* NamespaceKeyword */: case 123 /* DeclareKeyword */: @@ -18131,7 +18991,7 @@ var ts; case 116 /* AbstractKeyword */: case 114 /* StaticKeyword */: case 130 /* ReadonlyKeyword */: - case 139 /* GlobalKeyword */: + case 140 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -18154,11 +19014,11 @@ var ts; return parseClassDeclaration(fullStart, decorators, modifiers); case 108 /* InterfaceKeyword */: return parseInterfaceDeclaration(fullStart, decorators, modifiers); - case 136 /* TypeKeyword */: + case 137 /* TypeKeyword */: return parseTypeAliasDeclaration(fullStart, decorators, modifiers); case 82 /* EnumKeyword */: return parseEnumDeclaration(fullStart, decorators, modifiers); - case 139 /* GlobalKeyword */: + case 140 /* GlobalKeyword */: case 127 /* ModuleKeyword */: case 128 /* NamespaceKeyword */: return parseModuleDeclaration(fullStart, decorators, modifiers); @@ -18179,7 +19039,7 @@ var ts; if (decorators || modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var node = createMissingNode(244 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var node = createMissingNode(246 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); node.pos = fullStart; node.decorators = decorators; node.modifiers = modifiers; @@ -18201,16 +19061,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token() === 25 /* CommaToken */) { - return createNode(198 /* OmittedExpression */); + return createNode(199 /* OmittedExpression */); } - var node = createNode(174 /* BindingElement */); + var node = createNode(175 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(23 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseBindingElementInitializer(/*inParameter*/ false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(174 /* BindingElement */); + var node = createNode(175 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(23 /* DotDotDotToken */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -18226,14 +19086,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(172 /* ObjectBindingPattern */); + var node = createNode(173 /* ObjectBindingPattern */); parseExpected(16 /* OpenBraceToken */); node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(17 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(173 /* ArrayBindingPattern */); + var node = createNode(174 /* ArrayBindingPattern */); parseExpected(20 /* OpenBracketToken */); node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(21 /* CloseBracketToken */); @@ -18252,7 +19112,7 @@ var ts; return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(223 /* VariableDeclaration */); + var node = createNode(225 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token())) { @@ -18261,7 +19121,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(224 /* VariableDeclarationList */); + var node = createNode(226 /* VariableDeclarationList */); switch (token()) { case 103 /* VarKeyword */: break; @@ -18284,7 +19144,7 @@ var ts; // So we need to look ahead to determine if 'of' should be treated as a keyword in // this context. // The checker will then give an error that there is an empty declaration list. - if (token() === 140 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 141 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -18299,7 +19159,7 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 19 /* CloseParenToken */; } function parseVariableStatement(fullStart, decorators, modifiers) { - var node = createNode(205 /* VariableStatement */, fullStart); + var node = createNode(207 /* VariableStatement */, fullStart); node.decorators = decorators; node.modifiers = modifiers; node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); @@ -18307,7 +19167,7 @@ var ts; return addJSDocComment(finishNode(node)); } function parseFunctionDeclaration(fullStart, decorators, modifiers) { - var node = createNode(225 /* FunctionDeclaration */, fullStart); + var node = createNode(227 /* FunctionDeclaration */, fullStart); node.decorators = decorators; node.modifiers = modifiers; parseExpected(88 /* FunctionKeyword */); @@ -18320,7 +19180,7 @@ var ts; return addJSDocComment(finishNode(node)); } function parseConstructorDeclaration(pos, decorators, modifiers) { - var node = createNode(150 /* Constructor */, pos); + var node = createNode(151 /* Constructor */, pos); node.decorators = decorators; node.modifiers = modifiers; parseExpected(122 /* ConstructorKeyword */); @@ -18329,7 +19189,7 @@ var ts; return addJSDocComment(finishNode(node)); } function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { - var method = createNode(149 /* MethodDeclaration */, fullStart); + var method = createNode(150 /* MethodDeclaration */, fullStart); method.decorators = decorators; method.modifiers = modifiers; method.asteriskToken = asteriskToken; @@ -18342,7 +19202,7 @@ var ts; return addJSDocComment(finishNode(method)); } function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) { - var property = createNode(147 /* PropertyDeclaration */, fullStart); + var property = createNode(148 /* PropertyDeclaration */, fullStart); property.decorators = decorators; property.modifiers = modifiers; property.name = name; @@ -18359,7 +19219,7 @@ var ts; // The checker may still error in the static case to explicitly disallow the yield expression. property.initializer = ts.hasModifier(property, 32 /* Static */) ? allowInAnd(parseNonParameterInitializer) - : doOutsideOfContext(131072 /* YieldContext */ | 65536 /* DisallowInContext */, parseNonParameterInitializer); + : doOutsideOfContext(4096 /* YieldContext */ | 2048 /* DisallowInContext */, parseNonParameterInitializer); parseSemicolon(); return addJSDocComment(finishNode(property)); } @@ -18435,7 +19295,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 133 /* SetKeyword */ || idToken === 124 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 134 /* SetKeyword */ || idToken === 124 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -18465,7 +19325,7 @@ var ts; if (!parseOptional(56 /* AtToken */)) { break; } - var decorator = createNode(145 /* Decorator */, decoratorStart); + var decorator = createNode(146 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); if (!decorators) { @@ -18531,7 +19391,7 @@ var ts; } function parseClassElement() { if (token() === 24 /* SemicolonToken */) { - var result = createNode(203 /* SemicolonClassElement */); + var result = createNode(205 /* SemicolonClassElement */); nextToken(); return finishNode(result); } @@ -18559,8 +19419,8 @@ var ts; } if (decorators || modifiers) { // treat this as a property declaration with a missing name. - var name_13 = createMissingNode(70 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); - return parsePropertyDeclaration(fullStart, decorators, modifiers, name_13, /*questionToken*/ undefined); + var name = createMissingNode(70 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + return parsePropertyDeclaration(fullStart, decorators, modifiers, name, /*questionToken*/ undefined); } // 'isClassMemberStart' should have hinted not to attempt parsing. ts.Debug.fail("Should not have attempted to parse class member declaration."); @@ -18569,10 +19429,10 @@ var ts; return parseClassDeclarationOrExpression( /*fullStart*/ scanner.getStartPos(), /*decorators*/ undefined, - /*modifiers*/ undefined, 197 /* ClassExpression */); + /*modifiers*/ undefined, 198 /* ClassExpression */); } function parseClassDeclaration(fullStart, decorators, modifiers) { - return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 226 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 228 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { var node = createNode(kind, fullStart); @@ -18615,9 +19475,10 @@ var ts; return undefined; } function parseHeritageClause() { - if (token() === 84 /* ExtendsKeyword */ || token() === 107 /* ImplementsKeyword */) { - var node = createNode(255 /* HeritageClause */); - node.token = token(); + var tok = token(); + if (tok === 84 /* ExtendsKeyword */ || tok === 107 /* ImplementsKeyword */) { + var node = createNode(258 /* HeritageClause */); + node.token = tok; nextToken(); node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); return finishNode(node); @@ -18625,7 +19486,7 @@ var ts; return undefined; } function parseExpressionWithTypeArguments() { - var node = createNode(199 /* ExpressionWithTypeArguments */); + var node = createNode(200 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); if (token() === 26 /* LessThanToken */) { node.typeArguments = parseBracketedList(19 /* TypeArguments */, parseType, 26 /* LessThanToken */, 28 /* GreaterThanToken */); @@ -18639,7 +19500,7 @@ var ts; return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(fullStart, decorators, modifiers) { - var node = createNode(227 /* InterfaceDeclaration */, fullStart); + var node = createNode(229 /* InterfaceDeclaration */, fullStart); node.decorators = decorators; node.modifiers = modifiers; parseExpected(108 /* InterfaceKeyword */); @@ -18650,10 +19511,10 @@ var ts; return addJSDocComment(finishNode(node)); } function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { - var node = createNode(228 /* TypeAliasDeclaration */, fullStart); + var node = createNode(230 /* TypeAliasDeclaration */, fullStart); node.decorators = decorators; node.modifiers = modifiers; - parseExpected(136 /* TypeKeyword */); + parseExpected(137 /* TypeKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(57 /* EqualsToken */); @@ -18666,13 +19527,13 @@ var ts; // ConstantEnumMemberSection, which starts at the beginning of an enum declaration // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNode(260 /* EnumMember */, scanner.getStartPos()); + var node = createNode(263 /* EnumMember */, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return addJSDocComment(finishNode(node)); } function parseEnumDeclaration(fullStart, decorators, modifiers) { - var node = createNode(229 /* EnumDeclaration */, fullStart); + var node = createNode(231 /* EnumDeclaration */, fullStart); node.decorators = decorators; node.modifiers = modifiers; parseExpected(82 /* EnumKeyword */); @@ -18687,7 +19548,7 @@ var ts; return addJSDocComment(finishNode(node)); } function parseModuleBlock() { - var node = createNode(231 /* ModuleBlock */, scanner.getStartPos()); + var node = createNode(233 /* ModuleBlock */, scanner.getStartPos()); if (parseExpected(16 /* OpenBraceToken */)) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(17 /* CloseBraceToken */); @@ -18698,7 +19559,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags) { - var node = createNode(230 /* ModuleDeclaration */, fullStart); + var node = createNode(232 /* ModuleDeclaration */, fullStart); // If we are parsing a dotted namespace name, we want to // propagate the 'Namespace' flag across the names if set. var namespaceFlag = flags & 16 /* Namespace */; @@ -18712,10 +19573,10 @@ var ts; return addJSDocComment(finishNode(node)); } function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { - var node = createNode(230 /* ModuleDeclaration */, fullStart); + var node = createNode(232 /* ModuleDeclaration */, fullStart); node.decorators = decorators; node.modifiers = modifiers; - if (token() === 139 /* GlobalKeyword */) { + if (token() === 140 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation node.name = parseIdentifier(); node.flags |= 512 /* GlobalAugmentation */; @@ -18733,7 +19594,7 @@ var ts; } function parseModuleDeclaration(fullStart, decorators, modifiers) { var flags = 0; - if (token() === 139 /* GlobalKeyword */) { + if (token() === 140 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers); } @@ -18759,7 +19620,7 @@ var ts; return nextToken() === 40 /* SlashToken */; } function parseNamespaceExportDeclaration(fullStart, decorators, modifiers) { - var exportDeclaration = createNode(233 /* NamespaceExportDeclaration */, fullStart); + var exportDeclaration = createNode(235 /* NamespaceExportDeclaration */, fullStart); exportDeclaration.decorators = decorators; exportDeclaration.modifiers = modifiers; parseExpected(117 /* AsKeyword */); @@ -18774,22 +19635,12 @@ var ts; var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token() !== 25 /* CommaToken */ && token() !== 138 /* FromKeyword */) { - // ImportEquals declaration of type: - // import x = require("mod"); or - // import x = M.x; - var importEqualsDeclaration = createNode(234 /* ImportEqualsDeclaration */, fullStart); - importEqualsDeclaration.decorators = decorators; - importEqualsDeclaration.modifiers = modifiers; - importEqualsDeclaration.name = identifier; - parseExpected(57 /* EqualsToken */); - importEqualsDeclaration.moduleReference = parseModuleReference(); - parseSemicolon(); - return addJSDocComment(finishNode(importEqualsDeclaration)); + if (token() !== 25 /* CommaToken */ && token() !== 139 /* FromKeyword */) { + return parseImportEqualsDeclaration(fullStart, decorators, modifiers, identifier); } } // Import statement - var importDeclaration = createNode(235 /* ImportDeclaration */, fullStart); + var importDeclaration = createNode(237 /* ImportDeclaration */, fullStart); importDeclaration.decorators = decorators; importDeclaration.modifiers = modifiers; // ImportDeclaration: @@ -18799,12 +19650,22 @@ var ts; token() === 38 /* AsteriskToken */ || token() === 16 /* OpenBraceToken */) { importDeclaration.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(138 /* FromKeyword */); + parseExpected(139 /* FromKeyword */); } importDeclaration.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); return finishNode(importDeclaration); } + function parseImportEqualsDeclaration(fullStart, decorators, modifiers, identifier) { + var importEqualsDeclaration = createNode(236 /* ImportEqualsDeclaration */, fullStart); + importEqualsDeclaration.decorators = decorators; + importEqualsDeclaration.modifiers = modifiers; + importEqualsDeclaration.name = identifier; + parseExpected(57 /* EqualsToken */); + importEqualsDeclaration.moduleReference = parseModuleReference(); + parseSemicolon(); + return addJSDocComment(finishNode(importEqualsDeclaration)); + } function parseImportClause(identifier, fullStart) { // ImportClause: // ImportedDefaultBinding @@ -18812,7 +19673,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(236 /* ImportClause */, fullStart); + var importClause = createNode(238 /* ImportClause */, fullStart); if (identifier) { // ImportedDefaultBinding: // ImportedBinding @@ -18822,7 +19683,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(25 /* CommaToken */)) { - importClause.namedBindings = token() === 38 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(238 /* NamedImports */); + importClause.namedBindings = token() === 38 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(240 /* NamedImports */); } return finishNode(importClause); } @@ -18832,7 +19693,7 @@ var ts; : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { - var node = createNode(245 /* ExternalModuleReference */); + var node = createNode(247 /* ExternalModuleReference */); parseExpected(131 /* RequireKeyword */); parseExpected(18 /* OpenParenToken */); node.expression = parseModuleSpecifier(); @@ -18855,7 +19716,7 @@ var ts; function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(237 /* NamespaceImport */); + var namespaceImport = createNode(239 /* NamespaceImport */); parseExpected(38 /* AsteriskToken */); parseExpected(117 /* AsKeyword */); namespaceImport.name = parseIdentifier(); @@ -18870,14 +19731,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(22 /* ImportOrExportSpecifiers */, kind === 238 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 16 /* OpenBraceToken */, 17 /* CloseBraceToken */); + node.elements = parseBracketedList(22 /* ImportOrExportSpecifiers */, kind === 240 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 16 /* OpenBraceToken */, 17 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(243 /* ExportSpecifier */); + return parseImportOrExportSpecifier(245 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(239 /* ImportSpecifier */); + return parseImportOrExportSpecifier(241 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -18902,27 +19763,27 @@ var ts; else { node.name = identifierName; } - if (kind === 239 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 241 /* ImportSpecifier */ && checkIdentifierIsKeyword) { // Report error identifier expected parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(fullStart, decorators, modifiers) { - var node = createNode(241 /* ExportDeclaration */, fullStart); + var node = createNode(243 /* ExportDeclaration */, fullStart); node.decorators = decorators; node.modifiers = modifiers; if (parseOptional(38 /* AsteriskToken */)) { - parseExpected(138 /* FromKeyword */); + parseExpected(139 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(242 /* NamedExports */); + node.exportClause = parseNamedImportsOrExports(244 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. - if (token() === 138 /* FromKeyword */ || (token() === 9 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(138 /* FromKeyword */); + if (token() === 139 /* FromKeyword */ || (token() === 9 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(139 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -18930,7 +19791,7 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, decorators, modifiers) { - var node = createNode(240 /* ExportAssignment */, fullStart); + var node = createNode(242 /* ExportAssignment */, fullStart); node.decorators = decorators; node.modifiers = modifiers; if (parseOptional(57 /* EqualsToken */)) { @@ -18949,6 +19810,7 @@ var ts; var typeReferenceDirectives = []; var amdDependencies = []; var amdModuleName; + var checkJsDirective = undefined; // Keep scanning all the leading trivia in the file until we get to something that // isn't trivia. Any single line comment will be analyzed to see if it is a // reference comment. @@ -18962,7 +19824,11 @@ var ts; break; } } - var range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos(), kind: triviaScanner.getToken() }; + var range = { + kind: triviaScanner.getToken(), + pos: triviaScanner.getTokenPos(), + end: triviaScanner.getTextPos(), + }; var comment = sourceText.substring(range.pos, range.end); var referencePathMatchResult = ts.getFileReferenceFromReferencePath(comment, range); if (referencePathMatchResult) { @@ -19002,20 +19868,30 @@ var ts; amdDependencies.push(amdDependency); } } + var checkJsDirectiveRegEx = /^\/\/\/?\s*(@ts-check|@ts-nocheck)\s*$/gim; + var checkJsDirectiveMatchResult = checkJsDirectiveRegEx.exec(comment); + if (checkJsDirectiveMatchResult) { + checkJsDirective = { + enabled: ts.compareStrings(checkJsDirectiveMatchResult[1], "@ts-check", /*ignoreCase*/ true) === 0 /* EqualTo */, + end: range.end, + pos: range.pos + }; + } } } sourceFile.referencedFiles = referencedFiles; sourceFile.typeReferenceDirectives = typeReferenceDirectives; sourceFile.amdDependencies = amdDependencies; sourceFile.moduleName = amdModuleName; + sourceFile.checkJsDirective = checkJsDirective; } function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return ts.hasModifier(node, 1 /* Export */) - || node.kind === 234 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 245 /* ExternalModuleReference */ - || node.kind === 235 /* ImportDeclaration */ - || node.kind === 240 /* ExportAssignment */ - || node.kind === 241 /* ExportDeclaration */ + || node.kind === 236 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 247 /* ExternalModuleReference */ + || node.kind === 237 /* ImportDeclaration */ + || node.kind === 242 /* ExportAssignment */ + || node.kind === 243 /* ExportDeclaration */ ? node : undefined; }); @@ -19090,7 +19966,7 @@ var ts; // Parses out a JSDoc type expression. /* @internal */ function parseJSDocTypeExpression() { - var result = createNode(262 /* JSDocTypeExpression */, scanner.getTokenPos()); + var result = createNode(266 /* JSDocTypeExpression */, scanner.getTokenPos()); parseExpected(16 /* OpenBraceToken */); result.type = parseJSDocTopLevelType(); parseExpected(17 /* CloseBraceToken */); @@ -19101,12 +19977,12 @@ var ts; function parseJSDocTopLevelType() { var type = parseJSDocType(); if (token() === 48 /* BarToken */) { - var unionType = createNode(266 /* JSDocUnionType */, type.pos); + var unionType = createNode(270 /* JSDocUnionType */, type.pos); unionType.types = parseJSDocTypeList(type); type = finishNode(unionType); } if (token() === 57 /* EqualsToken */) { - var optionalType = createNode(273 /* JSDocOptionalType */, type.pos); + var optionalType = createNode(277 /* JSDocOptionalType */, type.pos); nextToken(); optionalType.type = type; type = finishNode(optionalType); @@ -19117,20 +19993,20 @@ var ts; var type = parseBasicTypeExpression(); while (true) { if (token() === 20 /* OpenBracketToken */) { - var arrayType = createNode(265 /* JSDocArrayType */, type.pos); + var arrayType = createNode(269 /* JSDocArrayType */, type.pos); arrayType.elementType = type; nextToken(); parseExpected(21 /* CloseBracketToken */); type = finishNode(arrayType); } else if (token() === 54 /* QuestionToken */) { - var nullableType = createNode(268 /* JSDocNullableType */, type.pos); + var nullableType = createNode(272 /* JSDocNullableType */, type.pos); nullableType.type = type; nextToken(); type = finishNode(nullableType); } else if (token() === 50 /* ExclamationToken */) { - var nonNullableType = createNode(269 /* JSDocNonNullableType */, type.pos); + var nonNullableType = createNode(273 /* JSDocNonNullableType */, type.pos); nonNullableType.type = type; nextToken(); type = finishNode(nonNullableType); @@ -19164,14 +20040,15 @@ var ts; case 98 /* ThisKeyword */: return parseJSDocThisType(); case 118 /* AnyKeyword */: - case 134 /* StringKeyword */: + case 135 /* StringKeyword */: case 132 /* NumberKeyword */: case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: + case 136 /* SymbolKeyword */: case 104 /* VoidKeyword */: case 94 /* NullKeyword */: - case 137 /* UndefinedKeyword */: + case 138 /* UndefinedKeyword */: case 129 /* NeverKeyword */: + case 133 /* ObjectKeyword */: return parseTokenNode(); case 9 /* StringLiteral */: case 8 /* NumericLiteral */: @@ -19182,27 +20059,27 @@ var ts; return parseJSDocTypeReference(); } function parseJSDocThisType() { - var result = createNode(277 /* JSDocThisType */); + var result = createNode(281 /* JSDocThisType */); nextToken(); parseExpected(55 /* ColonToken */); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocConstructorType() { - var result = createNode(276 /* JSDocConstructorType */); + var result = createNode(280 /* JSDocConstructorType */); nextToken(); parseExpected(55 /* ColonToken */); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocVariadicType() { - var result = createNode(275 /* JSDocVariadicType */); + var result = createNode(279 /* JSDocVariadicType */); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocFunctionType() { - var result = createNode(274 /* JSDocFunctionType */); + var result = createNode(278 /* JSDocFunctionType */); nextToken(); parseExpected(18 /* OpenParenToken */); result.parameters = parseDelimitedList(23 /* JSDocFunctionParameters */, parseJSDocParameter); @@ -19215,7 +20092,7 @@ var ts; return finishNode(result); } function parseJSDocParameter() { - var parameter = createNode(144 /* Parameter */); + var parameter = createNode(145 /* Parameter */); parameter.type = parseJSDocType(); if (parseOptional(57 /* EqualsToken */)) { // TODO(rbuckton): Can this be changed to SyntaxKind.QuestionToken? @@ -19224,7 +20101,7 @@ var ts; return finishNode(parameter); } function parseJSDocTypeReference() { - var result = createNode(272 /* JSDocTypeReference */); + var result = createNode(276 /* JSDocTypeReference */); result.name = parseSimplePropertyName(); if (token() === 26 /* LessThanToken */) { result.typeArguments = parseTypeArguments(); @@ -19259,24 +20136,24 @@ var ts; } } function parseQualifiedName(left) { - var result = createNode(141 /* QualifiedName */, left.pos); + var result = createNode(142 /* QualifiedName */, left.pos); result.left = left; result.right = parseIdentifierName(); return finishNode(result); } function parseJSDocRecordType() { - var result = createNode(270 /* JSDocRecordType */); + var result = createNode(274 /* JSDocRecordType */); result.literal = parseTypeLiteral(); return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(269 /* JSDocNonNullableType */); + var result = createNode(273 /* JSDocNonNullableType */); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocTupleType() { - var result = createNode(267 /* JSDocTupleType */); + var result = createNode(271 /* JSDocTupleType */); nextToken(); result.types = parseDelimitedList(26 /* JSDocTupleTypes */, parseJSDocType); checkForTrailingComma(result.types); @@ -19290,7 +20167,7 @@ var ts; } } function parseJSDocUnionType() { - var result = createNode(266 /* JSDocUnionType */); + var result = createNode(270 /* JSDocUnionType */); nextToken(); result.types = parseJSDocTypeList(parseJSDocType()); parseExpected(19 /* CloseParenToken */); @@ -19306,12 +20183,12 @@ var ts; return types; } function parseJSDocAllType() { - var result = createNode(263 /* JSDocAllType */); + var result = createNode(267 /* JSDocAllType */); nextToken(); return finishNode(result); } function parseJSDocLiteralType() { - var result = createNode(288 /* JSDocLiteralType */); + var result = createNode(292 /* JSDocLiteralType */); result.literal = parseLiteralTypeNode(); return finishNode(result); } @@ -19334,11 +20211,11 @@ var ts; token() === 28 /* GreaterThanToken */ || token() === 57 /* EqualsToken */ || token() === 48 /* BarToken */) { - var result = createNode(264 /* JSDocUnknownType */, pos); + var result = createNode(268 /* JSDocUnknownType */, pos); return finishNode(result); } else { - var result = createNode(268 /* JSDocNullableType */, pos); + var result = createNode(272 /* JSDocNullableType */, pos); result.type = parseJSDocType(); return finishNode(result); } @@ -19437,7 +20314,7 @@ var ts; break; case 38 /* AsteriskToken */: var asterisk = scanner.getTokenText(); - if (state === 1 /* SawAsterisk */) { + if (state === 1 /* SawAsterisk */ || state === 2 /* SavingComments */) { // If we've already seen an asterisk, then we can no longer parse a tag on this line state = 2 /* SavingComments */; pushComment(asterisk); @@ -19458,7 +20335,10 @@ var ts; case 5 /* WhitespaceTrivia */: // only collect whitespace if we're already saving comments or have just crossed the comment indent margin var whitespace = scanner.getTokenText(); - if (state === 2 /* SavingComments */ || margin !== undefined && indent + whitespace.length > margin) { + if (state === 2 /* SavingComments */) { + comments.push(whitespace); + } + else if (margin !== undefined && indent + whitespace.length > margin) { comments.push(whitespace.slice(margin - indent - 1)); } indent += whitespace.length; @@ -19466,6 +20346,8 @@ var ts; case 1 /* EndOfFileToken */: break; default: + // anything other than whitespace or asterisk at the beginning of the line starts the comment text + state = 2 /* SavingComments */; pushComment(scanner.getTokenText()); break; } @@ -19498,7 +20380,7 @@ var ts; content.charCodeAt(start + 3) !== 42 /* asterisk */; } function createJSDocComment() { - var result = createNode(278 /* JSDocComment */, start); + var result = createNode(282 /* JSDocComment */, start); result.tags = tags; result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -19556,7 +20438,7 @@ var ts; } function parseTagComments(indent) { var comments = []; - var state = 1 /* SawAsterisk */; + var state = 0 /* BeginningOfLine */; var margin; function pushComment(text) { if (!margin) { @@ -19597,7 +20479,8 @@ var ts; indent += scanner.getTokenText().length; break; } - // FALLTHROUGH otherwise to record the * as a comment + // record the * as a comment + // falls through default: state = 2 /* SavingComments */; // leading identifiers start recording as well pushComment(scanner.getTokenText()); @@ -19614,7 +20497,7 @@ var ts; return comments; } function parseUnknownTag(atToken, tagName) { - var result = createNode(279 /* JSDocTag */, atToken.pos); + var result = createNode(283 /* JSDocTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; return finishNode(result); @@ -19671,7 +20554,7 @@ var ts; if (!typeExpression) { typeExpression = tryParseTypeExpression(); } - var result = createNode(281 /* JSDocParameterTag */, atToken.pos); + var result = createNode(285 /* JSDocParameterTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.preParameterName = preName; @@ -19682,20 +20565,20 @@ var ts; return finishNode(result); } function parseReturnTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 282 /* JSDocReturnTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 286 /* JSDocReturnTag */; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(282 /* JSDocReturnTag */, atToken.pos); + var result = createNode(286 /* JSDocReturnTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); } function parseTypeTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 283 /* JSDocTypeTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 287 /* JSDocTypeTag */; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(283 /* JSDocTypeTag */, atToken.pos); + var result = createNode(287 /* JSDocTypeTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); @@ -19710,7 +20593,7 @@ var ts; parseErrorAtPosition(scanner.getStartPos(), /*length*/ 0, ts.Diagnostics.Identifier_expected); return undefined; } - var result = createNode(286 /* JSDocPropertyTag */, atToken.pos); + var result = createNode(290 /* JSDocPropertyTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.name = name; @@ -19719,7 +20602,7 @@ var ts; } function parseAugmentsTag(atToken, tagName) { var typeExpression = tryParseTypeExpression(); - var result = createNode(280 /* JSDocAugmentsTag */, atToken.pos); + var result = createNode(284 /* JSDocAugmentsTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = typeExpression; @@ -19728,25 +20611,30 @@ var ts; function parseTypedefTag(atToken, tagName) { var typeExpression = tryParseTypeExpression(); skipWhitespace(); - var typedefTag = createNode(285 /* JSDocTypedefTag */, atToken.pos); + var typedefTag = createNode(289 /* JSDocTypedefTag */, atToken.pos); typedefTag.atToken = atToken; typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(/*flags*/ 0); if (typedefTag.fullName) { var rightNode = typedefTag.fullName; - while (rightNode.kind !== 70 /* Identifier */) { + while (true) { + if (rightNode.kind === 70 /* Identifier */ || !rightNode.body) { + // if node is identifier - use it as name + // otherwise use name of the rightmost part that we were able to parse + typedefTag.name = rightNode.kind === 70 /* Identifier */ ? rightNode : rightNode.name; + break; + } rightNode = rightNode.body; } - typedefTag.name = rightNode; } typedefTag.typeExpression = typeExpression; skipWhitespace(); if (typeExpression) { - if (typeExpression.type.kind === 272 /* JSDocTypeReference */) { + if (typeExpression.type.kind === 276 /* JSDocTypeReference */) { var jsDocTypeReference = typeExpression.type; if (jsDocTypeReference.name.kind === 70 /* Identifier */) { - var name_14 = jsDocTypeReference.name; - if (name_14.text === "Object") { + var name = jsDocTypeReference.name; + if (name.text === "Object") { typedefTag.jsDocTypeLiteral = scanChildTags(); } } @@ -19760,7 +20648,7 @@ var ts; } return finishNode(typedefTag); function scanChildTags() { - var jsDocTypeLiteral = createNode(287 /* JSDocTypeLiteral */, scanner.getStartPos()); + var jsDocTypeLiteral = createNode(291 /* JSDocTypeLiteral */, scanner.getStartPos()); var resumePos = scanner.getStartPos(); var canParseTag = true; var seenAsterisk = false; @@ -19790,6 +20678,7 @@ var ts; break; case 70 /* Identifier */: canParseTag = false; + break; case 1 /* EndOfFileToken */: break; } @@ -19801,7 +20690,7 @@ var ts; var pos = scanner.getTokenPos(); var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (typeNameOrNamespaceName && parseOptional(22 /* DotToken */)) { - var jsDocNamespaceNode = createNode(230 /* ModuleDeclaration */, pos); + var jsDocNamespaceNode = createNode(232 /* ModuleDeclaration */, pos); jsDocNamespaceNode.flags |= flags; jsDocNamespaceNode.name = typeNameOrNamespaceName; jsDocNamespaceNode.body = parseJSDocTypeNameWithNamespace(4 /* NestedNamespace */); @@ -19847,20 +20736,20 @@ var ts; return false; } function parseTemplateTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 284 /* JSDocTemplateTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 288 /* JSDocTemplateTag */; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } // Type parameter list looks like '@template T,U,V' var typeParameters = createNodeArray(); while (true) { - var name_15 = parseJSDocIdentifierName(); + var name = parseJSDocIdentifierName(); skipWhitespace(); - if (!name_15) { + if (!name) { parseErrorAtPosition(scanner.getStartPos(), 0, ts.Diagnostics.Identifier_expected); return undefined; } - var typeParameter = createNode(143 /* TypeParameter */, name_15.pos); - typeParameter.name = name_15; + var typeParameter = createNode(144 /* TypeParameter */, name.pos); + typeParameter.name = name; finishNode(typeParameter); typeParameters.push(typeParameter); if (token() === 25 /* CommaToken */) { @@ -19871,7 +20760,7 @@ var ts; break; } } - var result = createNode(284 /* JSDocTemplateTag */, atToken.pos); + var result = createNode(288 /* JSDocTemplateTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeParameters = typeParameters; @@ -20345,7 +21234,7 @@ var ts; if (position >= array.pos && position < array.end) { // position was in this array. Search through this array to see if we find a // viable element. - for (var i = 0, n = array.length; i < n; i++) { + for (var i = 0; i < array.length; i++) { var child = array[i]; if (child) { if (child.pos === position) { @@ -20391,16 +21280,16 @@ var ts; function getModuleInstanceState(node) { // A module is uninstantiated if it contains only // 1. interface declarations, type alias declarations - if (node.kind === 227 /* InterfaceDeclaration */ || node.kind === 228 /* TypeAliasDeclaration */) { + if (node.kind === 229 /* InterfaceDeclaration */ || node.kind === 230 /* TypeAliasDeclaration */) { return 0 /* NonInstantiated */; } else if (ts.isConstEnumDeclaration(node)) { return 2 /* ConstEnumOnly */; } - else if ((node.kind === 235 /* ImportDeclaration */ || node.kind === 234 /* ImportEqualsDeclaration */) && !(ts.hasModifier(node, 1 /* Export */))) { + else if ((node.kind === 237 /* ImportDeclaration */ || node.kind === 236 /* ImportEqualsDeclaration */) && !(ts.hasModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } - else if (node.kind === 231 /* ModuleBlock */) { + else if (node.kind === 233 /* ModuleBlock */) { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { switch (getModuleInstanceState(n)) { @@ -20419,7 +21308,7 @@ var ts; }); return state_1; } - else if (node.kind === 230 /* ModuleDeclaration */) { + else if (node.kind === 232 /* ModuleDeclaration */) { var body = node.body; return body ? getModuleInstanceState(body) : 1 /* Instantiated */; } @@ -20532,7 +21421,7 @@ var ts; } return bindSourceFile; function bindInStrictMode(file, opts) { - if (opts.alwaysStrict && !ts.isDeclarationFile(file)) { + if ((opts.alwaysStrict === undefined ? opts.strict : opts.alwaysStrict) && !ts.isDeclarationFile(file)) { // bind in strict mode source files with alwaysStrict option return true; } @@ -20560,7 +21449,7 @@ var ts; if (symbolFlags & 107455 /* Value */) { var valueDeclaration = symbol.valueDeclaration; if (!valueDeclaration || - (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 230 /* ModuleDeclaration */)) { + (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 232 /* ModuleDeclaration */)) { // other kinds of value declarations take precedence over modules symbol.valueDeclaration = node; } @@ -20573,7 +21462,7 @@ var ts; if (ts.isAmbientModule(node)) { return ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + node.name.text + "\""; } - if (node.name.kind === 142 /* ComputedPropertyName */) { + if (node.name.kind === 143 /* ComputedPropertyName */) { var nameExpression = node.name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteral(nameExpression)) { @@ -20585,27 +21474,28 @@ var ts; return node.name.text; } switch (node.kind) { - case 150 /* Constructor */: + case 151 /* Constructor */: return "__constructor"; - case 158 /* FunctionType */: - case 153 /* CallSignature */: + case 159 /* FunctionType */: + case 154 /* CallSignature */: return "__call"; - case 159 /* ConstructorType */: - case 154 /* ConstructSignature */: + case 160 /* ConstructorType */: + case 155 /* ConstructSignature */: return "__new"; - case 155 /* IndexSignature */: + case 156 /* IndexSignature */: return "__index"; - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: return "__export"; - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: return node.isExportEquals ? "export=" : "default"; - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: switch (ts.getSpecialPropertyAssignmentKind(node)) { case 2 /* ModuleExports */: // module.exports = ... return "export="; case 1 /* ExportsProperty */: case 4 /* ThisProperty */: + case 5 /* Property */: // exports.x = ... or this.y = ... return node.left.name.text; case 3 /* PrototypeProperty */: @@ -20614,22 +21504,22 @@ var ts; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 225 /* FunctionDeclaration */: - case 226 /* ClassDeclaration */: + case 227 /* FunctionDeclaration */: + case 228 /* ClassDeclaration */: return ts.hasModifier(node, 512 /* Default */) ? "default" : undefined; - case 274 /* JSDocFunctionType */: + case 278 /* JSDocFunctionType */: return ts.isJSDocConstructSignature(node) ? "__new" : "__call"; - case 144 /* Parameter */: + case 145 /* Parameter */: // Parameters with names are handled at the top of this function. Parameters // without names can only come from JSDocFunctionTypes. - ts.Debug.assert(node.parent.kind === 274 /* JSDocFunctionType */); + ts.Debug.assert(node.parent.kind === 278 /* JSDocFunctionType */); var functionType = node.parent; var index = ts.indexOf(functionType.parameters, node); return "arg" + index; - case 285 /* JSDocTypedefTag */: + case 289 /* JSDocTypedefTag */: var parentNode = node.parent && node.parent.parent; var nameFromParentNode = void 0; - if (parentNode && parentNode.kind === 205 /* VariableStatement */) { + if (parentNode && parentNode.kind === 207 /* VariableStatement */) { if (parentNode.declarationList.declarations.length > 0) { var nameIdentifier = parentNode.declarationList.declarations[0].name; if (nameIdentifier.kind === 70 /* Identifier */) { @@ -20684,15 +21574,18 @@ var ts; // Otherwise, we'll be merging into a compatible existing symbol (for example when // you have multiple 'vars' with the same name in the same container). In this case // just add this node into the declarations list of the symbol. - symbol = symbolTable[name] || (symbolTable[name] = createSymbol(0 /* None */, name)); + symbol = symbolTable.get(name); + if (!symbol) { + symbolTable.set(name, symbol = createSymbol(0 /* None */, name)); + } if (name && (includes & 788448 /* Classifiable */)) { - classifiableNames[name] = name; + classifiableNames.set(name, name); } if (symbol.flags & excludes) { if (symbol.isReplaceableByMethod) { // Javascript constructor-declared symbols can be discarded in favor of // prototype symbols like methods. - symbol = symbolTable[name] = createSymbol(0 /* None */, name); + symbolTable.set(name, symbol = createSymbol(0 /* None */, name)); } else { if (node.name) { @@ -20716,7 +21609,7 @@ var ts; // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers) if (symbol.declarations && symbol.declarations.length && - (isDefaultExport || (node.kind === 240 /* ExportAssignment */ && !node.isExportEquals))) { + (isDefaultExport || (node.kind === 242 /* ExportAssignment */ && !node.isExportEquals))) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; } } @@ -20736,11 +21629,11 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 8388608 /* Alias */) { - if (node.kind === 243 /* ExportSpecifier */ || (node.kind === 234 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 245 /* ExportSpecifier */ || (node.kind === 236 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { - return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); + return declareSymbol(container.locals, /*parent*/ undefined, node, symbolFlags, symbolExcludes); } } else { @@ -20759,7 +21652,7 @@ var ts; // during global merging in the checker. Why? The only case when ambient module is permitted inside another module is module augmentation // and this case is specially handled. Module augmentations should only be merged with original module definition // and should never be merged directly with other augmentation, and the latter case would be possible if automatic merge is allowed. - var isJSDocTypedefInJSDocNamespace = node.kind === 285 /* JSDocTypedefTag */ && + var isJSDocTypedefInJSDocNamespace = node.kind === 289 /* JSDocTypedefTag */ && node.name && node.name.kind === 70 /* Identifier */ && node.name.isInJSDocNamespace; @@ -20767,13 +21660,13 @@ var ts; var exportKind = (symbolFlags & 107455 /* Value */ ? 1048576 /* ExportValue */ : 0) | (symbolFlags & 793064 /* Type */ ? 2097152 /* ExportType */ : 0) | (symbolFlags & 1920 /* Namespace */ ? 4194304 /* ExportNamespace */ : 0); - var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); + var local = declareSymbol(container.locals, /*parent*/ undefined, node, exportKind, symbolExcludes); local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); node.localSymbol = local; return local; } else { - return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); + return declareSymbol(container.locals, /*parent*/ undefined, node, symbolFlags, symbolExcludes); } } } @@ -20840,14 +21733,13 @@ var ts; hasExplicitReturn = false; bindChildren(node); // Reset all reachability check related flags on node (for incremental scenarios) - // Reset all emit helper flags on node (for incremental scenarios) - node.flags &= ~64896 /* ReachabilityAndEmitFlags */; + node.flags &= ~1408 /* ReachabilityAndEmitFlags */; if (!(currentFlow.flags & 1 /* Unreachable */) && containerFlags & 8 /* IsFunctionLike */ && ts.nodeIsPresent(node.body)) { node.flags |= 128 /* HasImplicitReturn */; if (hasExplicitReturn) node.flags |= 256 /* HasExplicitReturn */; } - if (node.kind === 261 /* SourceFile */) { + if (node.kind === 264 /* SourceFile */) { node.flags |= emitFlags; } if (isIIFE) { @@ -20926,66 +21818,72 @@ var ts; return; } switch (node.kind) { - case 210 /* WhileStatement */: + case 212 /* WhileStatement */: bindWhileStatement(node); break; - case 209 /* DoStatement */: + case 211 /* DoStatement */: bindDoStatement(node); break; - case 211 /* ForStatement */: + case 213 /* ForStatement */: bindForStatement(node); break; - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 208 /* IfStatement */: + case 210 /* IfStatement */: bindIfStatement(node); break; - case 216 /* ReturnStatement */: - case 220 /* ThrowStatement */: + case 218 /* ReturnStatement */: + case 222 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 215 /* BreakStatement */: - case 214 /* ContinueStatement */: + case 217 /* BreakStatement */: + case 216 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 221 /* TryStatement */: + case 223 /* TryStatement */: bindTryStatement(node); break; - case 218 /* SwitchStatement */: + case 220 /* SwitchStatement */: bindSwitchStatement(node); break; - case 232 /* CaseBlock */: + case 234 /* CaseBlock */: bindCaseBlock(node); break; - case 253 /* CaseClause */: + case 256 /* CaseClause */: bindCaseClause(node); break; - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: bindLabeledStatement(node); break; - case 190 /* PrefixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 191 /* PostfixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 186 /* DeleteExpression */: + case 187 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 193 /* ConditionalExpression */: + case 194 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 223 /* VariableDeclaration */: + case 225 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 179 /* CallExpression */: + case 180 /* CallExpression */: bindCallExpressionFlow(node); break; + case 282 /* JSDocComment */: + bindJSDocComment(node); + break; + case 289 /* JSDocTypedefTag */: + bindJSDocTypedefTag(node); + break; default: bindEachChild(node); break; @@ -20995,15 +21893,15 @@ var ts; switch (expr.kind) { case 70 /* Identifier */: case 98 /* ThisKeyword */: - case 177 /* PropertyAccessExpression */: + case 178 /* PropertyAccessExpression */: return isNarrowableReference(expr); - case 179 /* CallExpression */: + case 180 /* CallExpression */: return hasNarrowableArgument(expr); - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 190 /* PrefixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: return expr.operator === 50 /* ExclamationToken */ && isNarrowingExpression(expr.operand); } return false; @@ -21011,7 +21909,8 @@ var ts; function isNarrowableReference(expr) { return expr.kind === 70 /* Identifier */ || expr.kind === 98 /* ThisKeyword */ || - expr.kind === 177 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression); + expr.kind === 96 /* SuperKeyword */ || + expr.kind === 178 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression); } function hasNarrowableArgument(expr) { if (expr.arguments) { @@ -21022,14 +21921,14 @@ var ts; } } } - if (expr.expression.kind === 177 /* PropertyAccessExpression */ && + if (expr.expression.kind === 178 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression.expression)) { return true; } return false; } function isNarrowingTypeofOperands(expr1, expr2) { - return expr1.kind === 187 /* TypeOfExpression */ && isNarrowableOperand(expr1.expression) && expr2.kind === 9 /* StringLiteral */; + return expr1.kind === 188 /* TypeOfExpression */ && isNarrowableOperand(expr1.expression) && expr2.kind === 9 /* StringLiteral */; } function isNarrowingBinaryExpression(expr) { switch (expr.operatorToken.kind) { @@ -21050,9 +21949,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 57 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -21147,33 +22046,33 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 208 /* IfStatement */: - case 210 /* WhileStatement */: - case 209 /* DoStatement */: + case 210 /* IfStatement */: + case 212 /* WhileStatement */: + case 211 /* DoStatement */: return parent.expression === node; - case 211 /* ForStatement */: - case 193 /* ConditionalExpression */: + case 213 /* ForStatement */: + case 194 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 183 /* ParenthesizedExpression */) { + if (node.kind === 184 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 190 /* PrefixUnaryExpression */ && node.operator === 50 /* ExclamationToken */) { + else if (node.kind === 191 /* PrefixUnaryExpression */ && node.operator === 50 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 192 /* BinaryExpression */ && (node.operatorToken.kind === 52 /* AmpersandAmpersandToken */ || + return node.kind === 193 /* BinaryExpression */ && (node.operatorToken.kind === 52 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 53 /* BarBarToken */); } } } function isTopLevelLogicalExpression(node) { - while (node.parent.kind === 183 /* ParenthesizedExpression */ || - node.parent.kind === 190 /* PrefixUnaryExpression */ && + while (node.parent.kind === 184 /* ParenthesizedExpression */ || + node.parent.kind === 191 /* PrefixUnaryExpression */ && node.parent.operator === 50 /* ExclamationToken */) { node = node.parent; } @@ -21215,7 +22114,7 @@ var ts; } function bindDoStatement(node) { var preDoLabel = createLoopLabel(); - var enclosingLabeledStatement = node.parent.kind === 219 /* LabeledStatement */ + var enclosingLabeledStatement = node.parent.kind === 221 /* LabeledStatement */ ? ts.lastOrUndefined(activeLabels) : undefined; // if do statement is wrapped in labeled statement then target labels for break/continue with or without @@ -21249,10 +22148,13 @@ var ts; var postLoopLabel = createBranchLabel(); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; + if (node.kind === 215 /* ForOfStatement */) { + bind(node.awaitModifier); + } bind(node.expression); addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 224 /* VariableDeclarationList */) { + if (node.initializer.kind !== 226 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -21274,7 +22176,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 216 /* ReturnStatement */) { + if (node.kind === 218 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -21294,7 +22196,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 215 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 217 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -21330,7 +22232,32 @@ var ts; if (node.finallyBlock) { // in finally flow is combined from pre-try/flow from try/flow from catch // pre-flow is necessary to make sure that finally is reachable even if finally flows in both try and finally blocks are unreachable - addAntecedent(preFinallyLabel, preTryFlow); + // also for finally blocks we inject two extra edges into the flow graph. + // first -> edge that connects pre-try flow with the label at the beginning of the finally block, it has lock associated with it + // second -> edge that represents post-finally flow. + // these edges are used in following scenario: + // let a; (1) + // try { a = someOperation(); (2)} + // finally { (3) console.log(a) } (4) + // (5) a + // flow graph for this case looks roughly like this (arrows show ): + // (1-pre-try-flow) <--.. <-- (2-post-try-flow) + // ^ ^ + // |*****(3-pre-finally-label) -----| + // ^ + // |-- ... <-- (4-post-finally-label) <--- (5) + // In case when we walk the flow starting from inside the finally block we want to take edge '*****' into account + // since it ensures that finally is always reachable. However when we start outside the finally block and go through label (5) + // then edge '*****' should be discarded because label 4 is only reachable if post-finally label-4 is reachable + // Simply speaking code inside finally block is treated as reachable as pre-try-flow + // since we conservatively assume that any line in try block can throw or return in which case we'll enter finally. + // However code after finally is reachable only if control flow was not abrupted in try/catch or finally blocks - it should be composed from + // final flows of these blocks without taking pre-try flow into account. + // + // extra edges that we inject allows to control this behavior + // if when walking the flow we step on post-finally edge - we can mark matching pre-finally edge as locked so it will be skipped. + var preFinallyFlow = { flags: 2048 /* PreFinally */, antecedent: preTryFlow, lock: {} }; + addAntecedent(preFinallyLabel, preFinallyFlow); currentFlow = finishFlowLabel(preFinallyLabel); bind(node.finallyBlock); // if flow after finally is unreachable - keep it @@ -21346,6 +22273,11 @@ var ts; : unreachableFlow; } } + if (!(currentFlow.flags & 1 /* Unreachable */)) { + var afterFinallyFlow = { flags: 4096 /* AfterFinally */, antecedent: currentFlow }; + preFinallyFlow.lock = afterFinallyFlow; + currentFlow = afterFinallyFlow; + } } else { currentFlow = finishFlowLabel(preFinallyLabel); @@ -21360,7 +22292,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 254 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 257 /* DefaultClause */; }); // We mark a switch statement as possibly exhaustive if it has no default clause and if all // case clauses have unreachable end points (e.g. they all return). node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents; @@ -21427,14 +22359,14 @@ var ts; if (!activeLabel.referenced && !options.allowUnusedLabels) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node.label, ts.Diagnostics.Unused_label)); } - if (!node.statement || node.statement.kind !== 209 /* DoStatement */) { + if (!node.statement || node.statement.kind !== 211 /* DoStatement */) { // do statement sets current flow inside bindDoStatement addAntecedent(postStatementLabel, currentFlow); currentFlow = finishFlowLabel(postStatementLabel); } } function bindDestructuringTargetFlow(node) { - if (node.kind === 192 /* BinaryExpression */ && node.operatorToken.kind === 57 /* EqualsToken */) { + if (node.kind === 193 /* BinaryExpression */ && node.operatorToken.kind === 57 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -21445,10 +22377,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowAssignment(currentFlow, node); } - else if (node.kind === 175 /* ArrayLiteralExpression */) { + else if (node.kind === 176 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 196 /* SpreadElement */) { + if (e.kind === 197 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -21456,16 +22388,16 @@ var ts; } } } - else if (node.kind === 176 /* ObjectLiteralExpression */) { + else if (node.kind === 177 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 257 /* PropertyAssignment */) { + if (p.kind === 260 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 258 /* ShorthandPropertyAssignment */) { + else if (p.kind === 261 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 259 /* SpreadAssignment */) { + else if (p.kind === 262 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -21521,7 +22453,7 @@ var ts; bindEachChild(node); if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 57 /* EqualsToken */ && node.left.kind === 178 /* ElementAccessExpression */) { + if (operator === 57 /* EqualsToken */ && node.left.kind === 179 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -21532,7 +22464,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 177 /* PropertyAccessExpression */) { + if (node.expression.kind === 178 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -21565,19 +22497,37 @@ var ts; } function bindVariableDeclarationFlow(node) { bindEachChild(node); - if (node.initializer || node.parent.parent.kind === 212 /* ForInStatement */ || node.parent.parent.kind === 213 /* ForOfStatement */) { + if (node.initializer || node.parent.parent.kind === 214 /* ForInStatement */ || node.parent.parent.kind === 215 /* ForOfStatement */) { bindInitializedVariableFlow(node); } } + function bindJSDocComment(node) { + ts.forEachChild(node, function (n) { + if (n.kind !== 289 /* JSDocTypedefTag */) { + bind(n); + } + }); + } + function bindJSDocTypedefTag(node) { + ts.forEachChild(node, function (n) { + // if the node has a fullName "A.B.C", that means symbol "C" was already bound + // when we visit "fullName"; so when we visit the name "C" as the next child of + // the jsDocTypedefTag, we should skip binding it. + if (node.fullName && n === node.name && node.fullName.kind !== 70 /* Identifier */) { + return; + } + bind(n); + }); + } function bindCallExpressionFlow(node) { // If the target of the call expression is a function expression or arrow function we have // an immediately invoked function expression (IIFE). Initialize the flowNode property to // the current control flow (which includes evaluation of the IIFE arguments). var expr = node.expression; - while (expr.kind === 183 /* ParenthesizedExpression */) { + while (expr.kind === 184 /* ParenthesizedExpression */) { expr = expr.expression; } - if (expr.kind === 184 /* FunctionExpression */ || expr.kind === 185 /* ArrowFunction */) { + if (expr.kind === 185 /* FunctionExpression */ || expr.kind === 186 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -21585,7 +22535,7 @@ var ts; else { bindEachChild(node); } - if (node.expression.kind === 177 /* PropertyAccessExpression */) { + if (node.expression.kind === 178 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -21594,52 +22544,54 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 197 /* ClassExpression */: - case 226 /* ClassDeclaration */: - case 229 /* EnumDeclaration */: - case 176 /* ObjectLiteralExpression */: - case 161 /* TypeLiteral */: - case 287 /* JSDocTypeLiteral */: - case 270 /* JSDocRecordType */: + case 198 /* ClassExpression */: + case 228 /* ClassDeclaration */: + case 231 /* EnumDeclaration */: + case 177 /* ObjectLiteralExpression */: + case 162 /* TypeLiteral */: + case 291 /* JSDocTypeLiteral */: + case 274 /* JSDocRecordType */: + case 253 /* JsxAttributes */: return 1 /* IsContainer */; - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 274 /* JSDocFunctionType */: - case 230 /* ModuleDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 170 /* MappedType */: + case 278 /* JSDocFunctionType */: + case 232 /* ModuleDeclaration */: + case 230 /* TypeAliasDeclaration */: + case 171 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 261 /* SourceFile */: + case 264 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 149 /* MethodDeclaration */: + case 150 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } - case 150 /* Constructor */: - case 225 /* FunctionDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 158 /* FunctionType */: - case 159 /* ConstructorType */: + // falls through + case 151 /* Constructor */: + case 227 /* FunctionDeclaration */: + case 149 /* MethodSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 231 /* ModuleBlock */: + case 233 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 147 /* PropertyDeclaration */: + case 148 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 256 /* CatchClause */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 232 /* CaseBlock */: + case 259 /* CatchClause */: + case 213 /* ForStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: + case 234 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 204 /* Block */: + case 206 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Otherwise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -21676,42 +22628,43 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 261 /* SourceFile */: + case 264 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 197 /* ClassExpression */: - case 226 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 228 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 161 /* TypeLiteral */: - case 176 /* ObjectLiteralExpression */: - case 227 /* InterfaceDeclaration */: - case 270 /* JSDocRecordType */: - case 287 /* JSDocTypeLiteral */: + case 162 /* TypeLiteral */: + case 177 /* ObjectLiteralExpression */: + case 229 /* InterfaceDeclaration */: + case 274 /* JSDocRecordType */: + case 291 /* JSDocTypeLiteral */: + case 253 /* JsxAttributes */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 274 /* JSDocFunctionType */: - case 228 /* TypeAliasDeclaration */: - case 170 /* MappedType */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 278 /* JSDocFunctionType */: + case 230 /* TypeAliasDeclaration */: + case 171 /* MappedType */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -21729,14 +22682,14 @@ var ts; function declareSourceFileMember(node, symbolFlags, symbolExcludes) { return ts.isExternalModule(file) ? declareModuleMember(node, symbolFlags, symbolExcludes) - : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); + : declareSymbol(file.locals, /*parent*/ undefined, node, symbolFlags, symbolExcludes); } function hasExportDeclarations(node) { - var body = node.kind === 261 /* SourceFile */ ? node : node.body; - if (body && (body.kind === 261 /* SourceFile */ || body.kind === 231 /* ModuleBlock */)) { + var body = node.kind === 264 /* SourceFile */ ? node : node.body; + if (body && (body.kind === 264 /* SourceFile */ || body.kind === 233 /* ModuleBlock */)) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 241 /* ExportDeclaration */ || stat.kind === 240 /* ExportAssignment */) { + if (stat.kind === 243 /* ExportDeclaration */ || stat.kind === 242 /* ExportAssignment */) { return true; } } @@ -21760,7 +22713,7 @@ var ts; errorOnFirstToken(node, ts.Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible); } if (ts.isExternalModuleAugmentation(node)) { - declareSymbolAndAddToSymbolTable(node, 1024 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */); + declareModuleSymbol(node); } else { var pattern = void 0; @@ -21780,12 +22733,8 @@ var ts; } } else { - var state = getModuleInstanceState(node); - if (state === 0 /* NonInstantiated */) { - declareSymbolAndAddToSymbolTable(node, 1024 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */); - } - else { - declareSymbolAndAddToSymbolTable(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */); + var state = declareModuleSymbol(node); + if (state !== 0 /* NonInstantiated */) { if (node.symbol.flags & (16 /* Function */ | 32 /* Class */ | 256 /* RegularEnum */)) { // if module was already merged with some function, class or non-const enum // treat is a non-const-enum-only @@ -21805,6 +22754,12 @@ var ts; } } } + function declareModuleSymbol(node) { + var state = getModuleInstanceState(node); + var instantiated = state !== 0 /* NonInstantiated */; + declareSymbolAndAddToSymbolTable(node, instantiated ? 512 /* ValueModule */ : 1024 /* NamespaceModule */, instantiated ? 106639 /* ValueModuleExcludes */ : 0 /* NamespaceModuleExcludes */); + return state; + } function bindFunctionOrConstructorType(node) { // For a given function symbol "<...>(...) => T" we want to generate a symbol identical // to the one we would get for: { <...>(...): T } @@ -21817,7 +22772,7 @@ var ts; var typeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type"); addDeclarationToSymbol(typeLiteralSymbol, node, 2048 /* TypeLiteral */); typeLiteralSymbol.members = ts.createMap(); - typeLiteralSymbol.members[symbol.name] = symbol; + typeLiteralSymbol.members.set(symbol.name, symbol); } function bindObjectLiteralExpression(node) { var ElementKind; @@ -21829,7 +22784,7 @@ var ts; var seen = ts.createMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 259 /* SpreadAssignment */ || prop.name.kind !== 70 /* Identifier */) { + if (prop.kind === 262 /* SpreadAssignment */ || prop.name.kind !== 70 /* Identifier */) { continue; } var identifier = prop.name; @@ -21841,12 +22796,12 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 257 /* PropertyAssignment */ || prop.kind === 258 /* ShorthandPropertyAssignment */ || prop.kind === 149 /* MethodDeclaration */ + var currentKind = prop.kind === 260 /* PropertyAssignment */ || prop.kind === 261 /* ShorthandPropertyAssignment */ || prop.kind === 150 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; - var existingKind = seen[identifier.text]; + var existingKind = seen.get(identifier.text); if (!existingKind) { - seen[identifier.text] = currentKind; + seen.set(identifier.text, currentKind); continue; } if (currentKind === 1 /* Property */ && existingKind === 1 /* Property */) { @@ -21857,27 +22812,33 @@ var ts; } return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object"); } + function bindJsxAttributes(node) { + return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__jsxAttributes"); + } + function bindJsxAttribute(node, symbolFlags, symbolExcludes) { + return declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); + } function bindAnonymousDeclaration(node, symbolFlags, name) { var symbol = createSymbol(symbolFlags, name); addDeclarationToSymbol(symbol, node, symbolFlags); } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 261 /* SourceFile */: + case 264 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; } - // fall through. + // falls through default: if (!blockScopeContainer.locals) { blockScopeContainer.locals = ts.createMap(); addToContainerChain(blockScopeContainer); } - declareSymbol(blockScopeContainer.locals, undefined, node, symbolFlags, symbolExcludes); + declareSymbol(blockScopeContainer.locals, /*parent*/ undefined, node, symbolFlags, symbolExcludes); } } function bindBlockScopedVariableDeclaration(node) { @@ -21977,8 +22938,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 261 /* SourceFile */ && - blockScopeContainer.kind !== 230 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 264 /* SourceFile */ && + blockScopeContainer.kind !== 232 /* ModuleDeclaration */ && !ts.isFunctionLike(blockScopeContainer)) { // We check first if the name is inside class declaration or class expression; if so give explicit message // otherwise report generic error message. @@ -21988,7 +22949,7 @@ var ts; } } function checkStrictModeNumericLiteral(node) { - if (inStrictMode && node.isOctalLiteral) { + if (inStrictMode && node.numericLiteralFlags & 4 /* Octal */) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode)); } } @@ -22028,6 +22989,18 @@ var ts; } node.parent = parent; var saveInStrictMode = inStrictMode; + // Even though in the AST the jsdoc @typedef node belongs to the current node, + // its symbol might be in the same scope with the current node's symbol. Consider: + // + // /** @typedef {string | number} MyType */ + // function foo(); + // + // Here the current node is "foo", which is a container, but the scope of "MyType" should + // not be inside "foo". Therefore we always bind @typedef before bind the parent node, + // and skip binding this tag later when binding all the other jsdoc tags. + if (ts.isInJavaScriptFile(node)) { + bindJSDocTypedefTagIfAny(node); + } // First we bind declaration nodes to a symbol if possible. We'll both create a symbol // and then potentially add the symbol to an appropriate symbol table. Possible // destination symbol tables are: @@ -22044,7 +23017,7 @@ var ts; // the current 'container' node when it changes. This helps us know which symbol table // a local should go into for example. Since terminal nodes are known not to have // children, as an optimization we don't process those. - if (node.kind > 140 /* LastToken */) { + if (node.kind > 141 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -22061,6 +23034,26 @@ var ts; } inStrictMode = saveInStrictMode; } + function bindJSDocTypedefTagIfAny(node) { + if (!node.jsDoc) { + return; + } + for (var _i = 0, _a = node.jsDoc; _i < _a.length; _i++) { + var jsDoc = _a[_i]; + if (!jsDoc.tags) { + continue; + } + for (var _b = 0, _c = jsDoc.tags; _b < _c.length; _b++) { + var tag = _c[_b]; + if (tag.kind === 289 /* JSDocTypedefTag */) { + var savedParent = parent; + parent = jsDoc; + bind(tag); + parent = savedParent; + } + } + } + } function updateStrictModeStatementList(statements) { if (!inStrictMode) { for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) { @@ -22091,91 +23084,90 @@ var ts; // current "blockScopeContainer" needs to be set to its immediate namespace parent. if (node.isInJSDocNamespace) { var parentNode = node.parent; - while (parentNode && parentNode.kind !== 285 /* JSDocTypedefTag */) { + while (parentNode && parentNode.kind !== 289 /* JSDocTypedefTag */) { parentNode = parentNode.parent; } bindBlockScopedDeclaration(parentNode, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); break; } + // falls through case 98 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 258 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 261 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); - case 177 /* PropertyAccessExpression */: + case 178 /* PropertyAccessExpression */: if (currentFlow && isNarrowableReference(node)) { node.flowNode = currentFlow; } break; - case 192 /* BinaryExpression */: - if (ts.isInJavaScriptFile(node)) { - var specialKind = ts.getSpecialPropertyAssignmentKind(node); - switch (specialKind) { - case 1 /* ExportsProperty */: - bindExportsPropertyAssignment(node); - break; - case 2 /* ModuleExports */: - bindModuleExportsAssignment(node); - break; - case 3 /* PrototypeProperty */: - bindPrototypePropertyAssignment(node); - break; - case 4 /* ThisProperty */: - bindThisPropertyAssignment(node); - break; - case 0 /* None */: - // Nothing to do - break; - default: - ts.Debug.fail("Unknown special property assignment kind"); - } + case 193 /* BinaryExpression */: + var specialKind = ts.getSpecialPropertyAssignmentKind(node); + switch (specialKind) { + case 1 /* ExportsProperty */: + bindExportsPropertyAssignment(node); + break; + case 2 /* ModuleExports */: + bindModuleExportsAssignment(node); + break; + case 3 /* PrototypeProperty */: + bindPrototypePropertyAssignment(node); + break; + case 4 /* ThisProperty */: + bindThisPropertyAssignment(node); + break; + case 5 /* Property */: + bindStaticPropertyAssignment(node); + break; + case 0 /* None */: + // Nothing to do + break; + default: + ts.Debug.fail("Unknown special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 256 /* CatchClause */: + case 259 /* CatchClause */: return checkStrictModeCatchClause(node); - case 186 /* DeleteExpression */: + case 187 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 191 /* PostfixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 190 /* PrefixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 217 /* WithStatement */: + case 219 /* WithStatement */: return checkStrictModeWithStatement(node); - case 167 /* ThisType */: + case 168 /* ThisType */: seenThisKeyword = true; return; - case 156 /* TypePredicate */: + case 157 /* TypePredicate */: return checkTypePredicate(node); - case 143 /* TypeParameter */: + case 144 /* TypeParameter */: return declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530920 /* TypeParameterExcludes */); - case 144 /* Parameter */: + case 145 /* Parameter */: return bindParameter(node); - case 223 /* VariableDeclaration */: - case 174 /* BindingElement */: - if (node.dotDotDotToken && node.parent.kind === 172 /* ObjectBindingPattern */) { - emitFlags |= 32768 /* HasRestAttribute */; - } + case 225 /* VariableDeclaration */: + case 175 /* BindingElement */: return bindVariableDeclarationOrBindingElement(node); - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 271 /* JSDocRecordMember */: - return bindPropertyOrMethodOrAccessor(node, 4 /* Property */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), 0 /* PropertyExcludes */); - case 286 /* JSDocPropertyTag */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 275 /* JSDocRecordMember */: + return bindPropertyOrMethodOrAccessor(node, 4 /* Property */ | (node.questionToken ? 67108864 /* Optional */ : 0 /* None */), 0 /* PropertyExcludes */); + case 290 /* JSDocPropertyTag */: return bindJSDocProperty(node); - case 257 /* PropertyAssignment */: - case 258 /* ShorthandPropertyAssignment */: + case 260 /* PropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 260 /* EnumMember */: + case 263 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 259 /* SpreadAssignment */: - case 251 /* JsxSpreadAttribute */: + case 262 /* SpreadAssignment */: + case 254 /* JsxSpreadAttribute */: var root = container; var hasRest = false; while (root.parent) { - if (root.kind === 176 /* ObjectLiteralExpression */ && - root.parent.kind === 192 /* BinaryExpression */ && + if (root.kind === 177 /* ObjectLiteralExpression */ && + root.parent.kind === 193 /* BinaryExpression */ && root.parent.operatorToken.kind === 57 /* EqualsToken */ && root.parent.left === root) { hasRest = true; @@ -22183,88 +23175,92 @@ var ts; } root = root.parent; } - emitFlags |= hasRest ? 32768 /* HasRestAttribute */ : 16384 /* HasSpreadAttribute */; return; - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. - return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 99263 /* MethodExcludes */); - case 225 /* FunctionDeclaration */: + return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 67108864 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 99263 /* MethodExcludes */); + case 227 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 150 /* Constructor */: + case 151 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 151 /* GetAccessor */: + case 152 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */); - case 152 /* SetAccessor */: + case 153 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */); - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 274 /* JSDocFunctionType */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: + case 278 /* JSDocFunctionType */: return bindFunctionOrConstructorType(node); - case 161 /* TypeLiteral */: - case 170 /* MappedType */: - case 287 /* JSDocTypeLiteral */: - case 270 /* JSDocRecordType */: + case 162 /* TypeLiteral */: + case 171 /* MappedType */: + case 291 /* JSDocTypeLiteral */: + case 274 /* JSDocRecordType */: return bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type"); - case 176 /* ObjectLiteralExpression */: + case 177 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: return bindFunctionExpression(node); - case 179 /* CallExpression */: + case 180 /* CallExpression */: if (ts.isInJavaScriptFile(node)) { bindCallExpression(node); } break; // Members of classes, interfaces, and modules - case 197 /* ClassExpression */: - case 226 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 228 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 792968 /* InterfaceExcludes */); - case 285 /* JSDocTypedefTag */: + case 289 /* JSDocTypedefTag */: if (!node.fullName || node.fullName.kind === 70 /* Identifier */) { return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); } break; - case 228 /* TypeAliasDeclaration */: + case 230 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: return bindModuleDeclaration(node); + // Jsx-attributes + case 253 /* JsxAttributes */: + return bindJsxAttributes(node); + case 252 /* JsxAttribute */: + return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 234 /* ImportEqualsDeclaration */: - case 237 /* NamespaceImport */: - case 239 /* ImportSpecifier */: - case 243 /* ExportSpecifier */: + case 236 /* ImportEqualsDeclaration */: + case 239 /* NamespaceImport */: + case 241 /* ImportSpecifier */: + case 245 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */); - case 233 /* NamespaceExportDeclaration */: + case 235 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 236 /* ImportClause */: + case 238 /* ImportClause */: return bindImportClause(node); - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: return bindExportDeclaration(node); - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: return bindExportAssignment(node); - case 261 /* SourceFile */: + case 264 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 204 /* Block */: + case 206 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } - // Fall through - case 231 /* ModuleBlock */: + // falls through + case 233 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); } } @@ -22273,7 +23269,7 @@ var ts; if (parameterName && parameterName.kind === 70 /* Identifier */) { checkStrictModeIdentifier(parameterName); } - if (parameterName && parameterName.kind === 167 /* ThisType */) { + if (parameterName && parameterName.kind === 168 /* ThisType */) { seenThisKeyword = true; } bind(type); @@ -22296,7 +23292,7 @@ var ts; // An export default clause with an expression exports a value // We want to exclude both class and function here, this is necessary to issue an error when there are both // default export-assignment and default export function and class declaration. - var flags = node.kind === 240 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) + var flags = node.kind === 242 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) ? 8388608 /* Alias */ : 4 /* Property */; declareSymbol(container.symbol.exports, container.symbol, node, flags, 4 /* Property */ | 8388608 /* AliasExcludes */ | 32 /* Class */ | 16 /* Function */); @@ -22306,17 +23302,17 @@ var ts; if (node.modifiers && node.modifiers.length) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Modifiers_cannot_appear_here)); } - if (node.parent.kind !== 261 /* SourceFile */) { + if (node.parent.kind !== 264 /* SourceFile */) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_at_top_level)); return; } else { - var parent_4 = node.parent; - if (!ts.isExternalModule(parent_4)) { + var parent_1 = node.parent; + if (!ts.isExternalModule(parent_1)) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_in_module_files)); return; } - if (!parent_4.isDeclarationFile) { + if (!parent_1.isDeclarationFile) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_in_declaration_files)); return; } @@ -22327,11 +23323,11 @@ var ts; function bindExportDeclaration(node) { if (!container.symbol || !container.symbol.exports) { // Export * in some sort of block construct - bindAnonymousDeclaration(node, 1073741824 /* ExportStar */, getDeclarationName(node)); + bindAnonymousDeclaration(node, 33554432 /* ExportStar */, getDeclarationName(node)); } else if (!node.exportClause) { // All export * declarations are collected in an __export symbol - declareSymbol(container.symbol.exports, container.symbol, node, 1073741824 /* ExportStar */, 0 /* None */); + declareSymbol(container.symbol.exports, container.symbol, node, 33554432 /* ExportStar */, 0 /* None */); } } function bindImportClause(node) { @@ -22353,30 +23349,67 @@ var ts; setCommonJsModuleIndicator(node); declareSymbol(file.symbol.exports, file.symbol, node.left, 4 /* Property */ | 7340032 /* Export */, 0 /* None */); } + function isExportsOrModuleExportsOrAlias(node) { + return ts.isExportsIdentifier(node) || + ts.isModuleExportsPropertyAccessExpression(node) || + isNameOfExportsOrModuleExportsAliasDeclaration(node); + } + function isNameOfExportsOrModuleExportsAliasDeclaration(node) { + if (node.kind === 70 /* Identifier */) { + var symbol = lookupSymbolForName(node.text); + if (symbol && symbol.valueDeclaration && symbol.valueDeclaration.kind === 225 /* VariableDeclaration */) { + var declaration = symbol.valueDeclaration; + if (declaration.initializer) { + return isExportsOrModuleExportsOrAliasOrAssignemnt(declaration.initializer); + } + } + } + return false; + } + function isExportsOrModuleExportsOrAliasOrAssignemnt(node) { + return isExportsOrModuleExportsOrAlias(node) || + (ts.isAssignmentExpression(node, /*excludeCompoundAssignements*/ true) && (isExportsOrModuleExportsOrAliasOrAssignemnt(node.left) || isExportsOrModuleExportsOrAliasOrAssignemnt(node.right))); + } function bindModuleExportsAssignment(node) { + // A common practice in node modules is to set 'export = module.exports = {}', this ensures that 'exports' + // is still pointing to 'module.exports'. + // We do not want to consider this as 'export=' since a module can have only one of these. + // Similarlly we do not want to treat 'module.exports = exports' as an 'export='. + var assignedExpression = ts.getRightMostAssignedExpression(node.right); + if (ts.isEmptyObjectLiteral(assignedExpression) || isExportsOrModuleExportsOrAlias(assignedExpression)) { + // Mark it as a module in case there are no other exports in the file + setCommonJsModuleIndicator(node); + return; + } // 'module.exports = expr' assignment setCommonJsModuleIndicator(node); declareSymbol(file.symbol.exports, file.symbol, node, 4 /* Property */ | 7340032 /* Export */ | 512 /* ValueModule */, 0 /* None */); } function bindThisPropertyAssignment(node) { ts.Debug.assert(ts.isInJavaScriptFile(node)); - // Declare a 'member' if the container is an ES5 class or ES6 constructor - if (container.kind === 225 /* FunctionDeclaration */ || container.kind === 184 /* FunctionExpression */) { - container.symbol.members = container.symbol.members || ts.createMap(); - // It's acceptable for multiple 'this' assignments of the same identifier to occur - declareSymbol(container.symbol.members, container.symbol, node, 4 /* Property */, 0 /* PropertyExcludes */ & ~4 /* Property */); - } - else if (container.kind === 150 /* Constructor */) { - // this.foo assignment in a JavaScript class - // Bind this property to the containing class - var saveContainer = container; - container = container.parent; - var symbol = bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* None */); - if (symbol) { - // constructor-declared symbols can be overwritten by subsequent method declarations - symbol.isReplaceableByMethod = true; - } - container = saveContainer; + var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); + switch (container.kind) { + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + // Declare a 'member' if the container is an ES5 class or ES6 constructor + container.symbol.members = container.symbol.members || ts.createMap(); + // It's acceptable for multiple 'this' assignments of the same identifier to occur + declareSymbol(container.symbol.members, container.symbol, node, 4 /* Property */, 0 /* PropertyExcludes */ & ~4 /* Property */); + break; + case 151 /* Constructor */: + case 148 /* PropertyDeclaration */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + // this.foo assignment in a JavaScript class + // Bind this property to the containing class + var containingClass = container.parent; + var symbol = declareSymbol(ts.hasModifier(container, 32 /* Static */) ? containingClass.symbol.exports : containingClass.symbol.members, containingClass.symbol, node, 4 /* Property */, 0 /* None */); + if (symbol) { + // symbols declared through 'this' property assignements can be overwritten by subsequent method declarations + symbol.isReplaceableByMethod = true; + } + break; } } function bindPrototypePropertyAssignment(node) { @@ -22390,16 +23423,44 @@ var ts; leftSideOfAssignment.parent = node; constructorFunction.parent = classPrototype; classPrototype.parent = leftSideOfAssignment; - var funcSymbol = container.locals[constructorFunction.text]; - if (!funcSymbol || !(funcSymbol.flags & 16 /* Function */ || ts.isDeclarationOfFunctionExpression(funcSymbol))) { + bindPropertyAssignment(constructorFunction.text, leftSideOfAssignment, /*isPrototypeProperty*/ true); + } + function bindStaticPropertyAssignment(node) { + // We saw a node of the form 'x.y = z'. Declare a 'member' y on x if x was a function. + // Look up the function in the local scope, since prototype assignments should + // follow the function declaration + var leftSideOfAssignment = node.left; + var target = leftSideOfAssignment.expression; + // Fix up parent pointers since we're going to use these nodes before we bind into them + leftSideOfAssignment.parent = node; + target.parent = leftSideOfAssignment; + if (isNameOfExportsOrModuleExportsAliasDeclaration(target)) { + // This can be an alias for the 'exports' or 'module.exports' names, e.g. + // var util = module.exports; + // util.property = function ... + bindExportsPropertyAssignment(node); + } + else { + bindPropertyAssignment(target.text, leftSideOfAssignment, /*isPrototypeProperty*/ false); + } + } + function lookupSymbolForName(name) { + return (container.symbol && container.symbol.exports && container.symbol.exports.get(name)) || (container.locals && container.locals.get(name)); + } + function bindPropertyAssignment(functionName, propertyAccessExpression, isPrototypeProperty) { + var targetSymbol = lookupSymbolForName(functionName); + if (targetSymbol && ts.isDeclarationOfFunctionOrClassExpression(targetSymbol)) { + targetSymbol = targetSymbol.valueDeclaration.initializer.symbol; + } + if (!targetSymbol || !(targetSymbol.flags & (16 /* Function */ | 32 /* Class */))) { return; } // Set up the members collection if it doesn't exist already - if (!funcSymbol.members) { - funcSymbol.members = ts.createMap(); - } + var symbolTable = isPrototypeProperty ? + (targetSymbol.members || (targetSymbol.members = ts.createMap())) : + (targetSymbol.exports || (targetSymbol.exports = ts.createMap())); // Declare the method/property - declareSymbol(funcSymbol.members, funcSymbol, leftSideOfAssignment, 4 /* Property */, 0 /* PropertyExcludes */); + declareSymbol(symbolTable, targetSymbol, propertyAccessExpression, 4 /* Property */, 0 /* PropertyExcludes */); } function bindCallExpression(node) { // We're only inspecting call expressions to detect CommonJS modules, so we can skip @@ -22409,15 +23470,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { - if (ts.getClassExtendsHeritageClauseElement(node) !== undefined) { - emitFlags |= 1024 /* HasClassExtends */; - } - if (ts.nodeIsDecorated(node)) { - emitFlags |= 2048 /* HasDecorators */; - } - } - if (node.kind === 226 /* ClassDeclaration */) { + if (node.kind === 228 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899519 /* ClassExcludes */); } else { @@ -22425,7 +23478,7 @@ var ts; bindAnonymousDeclaration(node, 32 /* Class */, bindingName); // Add name of class expression into the map for semantic classifier if (node.name) { - classifiableNames[node.name.text] = node.name.text; + classifiableNames.set(node.name.text, node.name.text); } } var symbol = node.symbol; @@ -22438,14 +23491,15 @@ var ts; // Note: we check for this here because this class may be merging into a module. The // module might have an exported variable called 'prototype'. We can't allow that as // that would clash with the built-in 'prototype' for the class. - var prototypeSymbol = createSymbol(4 /* Property */ | 134217728 /* Prototype */, "prototype"); - if (symbol.exports[prototypeSymbol.name]) { + var prototypeSymbol = createSymbol(4 /* Property */ | 16777216 /* Prototype */, "prototype"); + var symbolExport = symbol.exports.get(prototypeSymbol.name); + if (symbolExport) { if (node.name) { node.name.parent = node; } - file.bindDiagnostics.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); + file.bindDiagnostics.push(ts.createDiagnosticForNode(symbolExport.declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); } - symbol.exports[prototypeSymbol.name] = prototypeSymbol; + symbol.exports.set(prototypeSymbol.name, prototypeSymbol); prototypeSymbol.parent = symbol; } function bindEnumDeclaration(node) { @@ -22479,11 +23533,6 @@ var ts; } } function bindParameter(node) { - if (!ts.isDeclarationFile(file) && - !ts.isInAmbientContext(node) && - ts.nodeIsDecorated(node)) { - emitFlags |= (2048 /* HasDecorators */ | 4096 /* HasParamDecorators */); - } if (inStrictMode) { // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a // strict mode FunctionLikeDeclaration or FunctionExpression(13.1) @@ -22499,13 +23548,13 @@ var ts; // containing class. if (ts.isParameterPropertyDeclaration(node)) { var classDeclaration = node.parent.parent; - declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 /* Property */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), 0 /* PropertyExcludes */); + declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 /* Property */ | (node.questionToken ? 67108864 /* Optional */ : 0 /* None */), 0 /* PropertyExcludes */); } } function bindFunctionDeclaration(node) { if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { - if (ts.isAsyncFunctionLike(node)) { - emitFlags |= 8192 /* HasAsyncFunctions */; + if (ts.isAsyncFunction(node)) { + emitFlags |= 1024 /* HasAsyncFunctions */; } } checkStrictModeFunctionName(node); @@ -22519,8 +23568,8 @@ var ts; } function bindFunctionExpression(node) { if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { - if (ts.isAsyncFunctionLike(node)) { - emitFlags |= 8192 /* HasAsyncFunctions */; + if (ts.isAsyncFunction(node)) { + emitFlags |= 1024 /* HasAsyncFunctions */; } } if (currentFlow) { @@ -22532,11 +23581,8 @@ var ts; } function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) { if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { - if (ts.isAsyncFunctionLike(node)) { - emitFlags |= 8192 /* HasAsyncFunctions */; - } - if (ts.nodeIsDecorated(node)) { - emitFlags |= 2048 /* HasDecorators */; + if (ts.isAsyncFunction(node)) { + emitFlags |= 1024 /* HasAsyncFunctions */; } } if (currentFlow && ts.isObjectLiteralOrClassExpressionMethod(node)) { @@ -22561,13 +23607,13 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 206 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 208 /* EmptyStatement */) || // report error on class declarations - node.kind === 226 /* ClassDeclaration */ || + node.kind === 228 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 230 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || + (node.kind === 232 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || // report error on regular enums and const enums if preserveConstEnums is set - (node.kind === 229 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + (node.kind === 231 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); if (reportError) { currentFlow = reportedUnreachableFlow; // unreachable code is reported if @@ -22581,7 +23627,7 @@ var ts; // On the other side we do want to report errors on non-initialized 'lets' because of TDZ var reportUnreachableCode = !options.allowUnreachableCode && !ts.isInAmbientContext(node) && - (node.kind !== 205 /* VariableStatement */ || + (node.kind !== 207 /* VariableStatement */ || ts.getCombinedNodeFlags(node.declarationList) & 3 /* BlockScoped */ || ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); if (reportUnreachableCode) { @@ -22601,56 +23647,56 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 179 /* CallExpression */: + case 180 /* CallExpression */: return computeCallExpression(node, subtreeFlags); - case 180 /* NewExpression */: + case 181 /* NewExpression */: return computeNewExpression(node, subtreeFlags); - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: return computeModuleDeclaration(node, subtreeFlags); - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return computeParenthesizedExpression(node, subtreeFlags); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return computeBinaryExpression(node, subtreeFlags); - case 207 /* ExpressionStatement */: + case 209 /* ExpressionStatement */: return computeExpressionStatement(node, subtreeFlags); - case 144 /* Parameter */: + case 145 /* Parameter */: return computeParameter(node, subtreeFlags); - case 185 /* ArrowFunction */: + case 186 /* ArrowFunction */: return computeArrowFunction(node, subtreeFlags); - case 184 /* FunctionExpression */: + case 185 /* FunctionExpression */: return computeFunctionExpression(node, subtreeFlags); - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: return computeFunctionDeclaration(node, subtreeFlags); - case 223 /* VariableDeclaration */: + case 225 /* VariableDeclaration */: return computeVariableDeclaration(node, subtreeFlags); - case 224 /* VariableDeclarationList */: + case 226 /* VariableDeclarationList */: return computeVariableDeclarationList(node, subtreeFlags); - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: return computeVariableStatement(node, subtreeFlags); - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: return computeLabeledStatement(node, subtreeFlags); - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: return computeClassDeclaration(node, subtreeFlags); - case 197 /* ClassExpression */: + case 198 /* ClassExpression */: return computeClassExpression(node, subtreeFlags); - case 255 /* HeritageClause */: + case 258 /* HeritageClause */: return computeHeritageClause(node, subtreeFlags); - case 256 /* CatchClause */: + case 259 /* CatchClause */: return computeCatchClause(node, subtreeFlags); - case 199 /* ExpressionWithTypeArguments */: + case 200 /* ExpressionWithTypeArguments */: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 150 /* Constructor */: + case 151 /* Constructor */: return computeConstructor(node, subtreeFlags); - case 147 /* PropertyDeclaration */: + case 148 /* PropertyDeclaration */: return computePropertyDeclaration(node, subtreeFlags); - case 149 /* MethodDeclaration */: + case 150 /* MethodDeclaration */: return computeMethod(node, subtreeFlags); - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: return computeAccessor(node, subtreeFlags); - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: return computeImportEquals(node, subtreeFlags); - case 177 /* PropertyAccessExpression */: + case 178 /* PropertyAccessExpression */: return computePropertyAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); @@ -22677,8 +23723,8 @@ var ts; switch (kind) { case 96 /* SuperKeyword */: return true; - case 177 /* PropertyAccessExpression */: - case 178 /* ElementAccessExpression */: + case 178 /* PropertyAccessExpression */: + case 179 /* ElementAccessExpression */: var expression = node.expression; var expressionKind = expression.kind; return expressionKind === 96 /* SuperKeyword */; @@ -22702,12 +23748,12 @@ var ts; var transformFlags = subtreeFlags; var operatorTokenKind = node.operatorToken.kind; var leftKind = node.left.kind; - if (operatorTokenKind === 57 /* EqualsToken */ && leftKind === 176 /* ObjectLiteralExpression */) { + if (operatorTokenKind === 57 /* EqualsToken */ && leftKind === 177 /* ObjectLiteralExpression */) { // Destructuring object assignments with are ES2015 syntax // and possibly ESNext if they contain rest transformFlags |= 8 /* AssertESNext */ | 192 /* AssertES2015 */ | 3072 /* AssertDestructuringAssignment */; } - else if (operatorTokenKind === 57 /* EqualsToken */ && leftKind === 175 /* ArrayLiteralExpression */) { + else if (operatorTokenKind === 57 /* EqualsToken */ && leftKind === 176 /* ArrayLiteralExpression */) { // Destructuring assignments are ES2015 syntax. transformFlags |= 192 /* AssertES2015 */ | 3072 /* AssertDestructuringAssignment */; } @@ -22757,8 +23803,8 @@ var ts; // If the node is synthesized, it means the emitter put the parentheses there, // not the user. If we didn't want them, the emitter would not have put them // there. - if (expressionKind === 200 /* AsExpression */ - || expressionKind === 182 /* TypeAssertionExpression */) { + if (expressionKind === 201 /* AsExpression */ + || expressionKind === 183 /* TypeAssertionExpression */) { transformFlags |= 3 /* AssertTypeScript */; } // If the expression of a ParenthesizedExpression is a destructuring assignment, @@ -22883,10 +23929,9 @@ var ts; } // An async method declaration is ES2017 syntax. if (ts.hasModifier(node, 256 /* Async */)) { - transformFlags |= 16 /* AssertES2017 */; + transformFlags |= node.asteriskToken ? 8 /* AssertESNext */ : 16 /* AssertES2017 */; } - // Currently, we only support generators that were originally async function bodies. - if (node.asteriskToken && ts.getEmitFlags(node) & 131072 /* AsyncFunctionBody */) { + if (node.asteriskToken) { transformFlags |= 768 /* AssertGenerator */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; @@ -22940,7 +23985,7 @@ var ts; } // An async function declaration is ES2017 syntax. if (modifierFlags & 256 /* Async */) { - transformFlags |= 16 /* AssertES2017 */; + transformFlags |= node.asteriskToken ? 8 /* AssertESNext */ : 16 /* AssertES2017 */; } // function declarations with object rest destructuring are ES Next syntax if (subtreeFlags & 1048576 /* ContainsObjectRest */) { @@ -22957,7 +24002,7 @@ var ts; // down-level generator. // Currently we do not support transforming any other generator fucntions // down level. - if (node.asteriskToken && ts.getEmitFlags(node) & 131072 /* AsyncFunctionBody */) { + if (node.asteriskToken) { transformFlags |= 768 /* AssertGenerator */; } } @@ -22975,7 +24020,7 @@ var ts; } // An async function expression is ES2017 syntax. if (ts.hasModifier(node, 256 /* Async */)) { - transformFlags |= 16 /* AssertES2017 */; + transformFlags |= node.asteriskToken ? 8 /* AssertESNext */ : 16 /* AssertES2017 */; } // function expressions with object rest destructuring are ES Next syntax if (subtreeFlags & 1048576 /* ContainsObjectRest */) { @@ -22990,9 +24035,7 @@ var ts; // If a FunctionExpression is generator function and is the body of a // transformed async function, then this node can be transformed to a // down-level generator. - // Currently we do not support transforming any other generator fucntions - // down level. - if (node.asteriskToken && ts.getEmitFlags(node) & 131072 /* AsyncFunctionBody */) { + if (node.asteriskToken) { transformFlags |= 768 /* AssertGenerator */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; @@ -23123,9 +24166,9 @@ var ts; var excludeFlags = 536872257 /* NodeExcludes */; switch (kind) { case 119 /* AsyncKeyword */: - case 189 /* AwaitExpression */: - // async/await is ES2017 syntax - transformFlags |= 16 /* AssertES2017 */; + case 190 /* AwaitExpression */: + // async/await is ES2017 syntax, but may be ESNext syntax (for async generators) + transformFlags |= 8 /* AssertESNext */ | 16 /* AssertES2017 */; break; case 113 /* PublicKeyword */: case 111 /* PrivateKeyword */: @@ -23133,81 +24176,98 @@ var ts; case 116 /* AbstractKeyword */: case 123 /* DeclareKeyword */: case 75 /* ConstKeyword */: - case 229 /* EnumDeclaration */: - case 260 /* EnumMember */: - case 182 /* TypeAssertionExpression */: - case 200 /* AsExpression */: - case 201 /* NonNullExpression */: + case 231 /* EnumDeclaration */: + case 263 /* EnumMember */: + case 183 /* TypeAssertionExpression */: + case 201 /* AsExpression */: + case 202 /* NonNullExpression */: case 130 /* ReadonlyKeyword */: // These nodes are TypeScript syntax. transformFlags |= 3 /* AssertTypeScript */; break; - case 246 /* JsxElement */: - case 247 /* JsxSelfClosingElement */: - case 248 /* JsxOpeningElement */: + case 248 /* JsxElement */: + case 249 /* JsxSelfClosingElement */: + case 250 /* JsxOpeningElement */: case 10 /* JsxText */: - case 249 /* JsxClosingElement */: - case 250 /* JsxAttribute */: - case 251 /* JsxSpreadAttribute */: - case 252 /* JsxExpression */: + case 251 /* JsxClosingElement */: + case 252 /* JsxAttribute */: + case 253 /* JsxAttributes */: + case 254 /* JsxSpreadAttribute */: + case 255 /* JsxExpression */: // These nodes are Jsx syntax. transformFlags |= 4 /* AssertJsx */; break; - case 213 /* ForOfStatement */: - // for-of might be ESNext if it has a rest destructuring - transformFlags |= 8 /* AssertESNext */; - // FALLTHROUGH case 12 /* NoSubstitutionTemplateLiteral */: case 13 /* TemplateHead */: case 14 /* TemplateMiddle */: case 15 /* TemplateTail */: - case 194 /* TemplateExpression */: - case 181 /* TaggedTemplateExpression */: - case 258 /* ShorthandPropertyAssignment */: + case 195 /* TemplateExpression */: + case 182 /* TaggedTemplateExpression */: + case 261 /* ShorthandPropertyAssignment */: case 114 /* StaticKeyword */: + case 203 /* MetaProperty */: // These nodes are ES6 syntax. transformFlags |= 192 /* AssertES2015 */; break; - case 195 /* YieldExpression */: - // This node is ES6 syntax. - transformFlags |= 192 /* AssertES2015 */ | 16777216 /* ContainsYield */; + case 9 /* StringLiteral */: + if (node.hasExtendedUnicodeEscape) { + transformFlags |= 192 /* AssertES2015 */; + } + break; + case 8 /* NumericLiteral */: + if (node.numericLiteralFlags & 48 /* BinaryOrOctalSpecifier */) { + transformFlags |= 192 /* AssertES2015 */; + } + break; + case 215 /* ForOfStatement */: + // This node is either ES2015 syntax or ES2017 syntax (if it is a for-await-of). + if (node.awaitModifier) { + transformFlags |= 8 /* AssertESNext */; + } + transformFlags |= 192 /* AssertES2015 */; + break; + case 196 /* YieldExpression */: + // This node is either ES2015 syntax (in a generator) or ES2017 syntax (in an async + // generator). + transformFlags |= 8 /* AssertESNext */ | 192 /* AssertES2015 */ | 16777216 /* ContainsYield */; break; case 118 /* AnyKeyword */: case 132 /* NumberKeyword */: case 129 /* NeverKeyword */: - case 134 /* StringKeyword */: + case 133 /* ObjectKeyword */: + case 135 /* StringKeyword */: case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: + case 136 /* SymbolKeyword */: case 104 /* VoidKeyword */: - case 143 /* TypeParameter */: - case 146 /* PropertySignature */: - case 148 /* MethodSignature */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 156 /* TypePredicate */: - case 157 /* TypeReference */: - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 160 /* TypeQuery */: - case 161 /* TypeLiteral */: - case 162 /* ArrayType */: - case 163 /* TupleType */: - case 164 /* UnionType */: - case 165 /* IntersectionType */: - case 166 /* ParenthesizedType */: - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 167 /* ThisType */: - case 168 /* TypeOperator */: - case 169 /* IndexedAccessType */: - case 170 /* MappedType */: - case 171 /* LiteralType */: + case 144 /* TypeParameter */: + case 147 /* PropertySignature */: + case 149 /* MethodSignature */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: + case 157 /* TypePredicate */: + case 158 /* TypeReference */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: + case 161 /* TypeQuery */: + case 162 /* TypeLiteral */: + case 163 /* ArrayType */: + case 164 /* TupleType */: + case 165 /* UnionType */: + case 166 /* IntersectionType */: + case 167 /* ParenthesizedType */: + case 229 /* InterfaceDeclaration */: + case 230 /* TypeAliasDeclaration */: + case 168 /* ThisType */: + case 169 /* TypeOperator */: + case 170 /* IndexedAccessType */: + case 171 /* MappedType */: + case 172 /* LiteralType */: // Types and signatures are TypeScript syntax, and exclude all other facts. transformFlags = 3 /* AssertTypeScript */; excludeFlags = -3 /* TypeExcludes */; break; - case 142 /* ComputedPropertyName */: + case 143 /* ComputedPropertyName */: // Even though computed property names are ES6, we don't treat them as such. // This is so that they can flow through PropertyName transforms unaffected. // Instead, we mark the container as ES6, so that it can properly handle the transform. @@ -23224,10 +24284,10 @@ var ts; transformFlags |= 65536 /* ContainsLexicalThisInComputedPropertyName */; } break; - case 196 /* SpreadElement */: + case 197 /* SpreadElement */: transformFlags |= 192 /* AssertES2015 */ | 524288 /* ContainsSpread */; break; - case 259 /* SpreadAssignment */: + case 262 /* SpreadAssignment */: transformFlags |= 8 /* AssertESNext */ | 1048576 /* ContainsObjectSpread */; break; case 96 /* SuperKeyword */: @@ -23238,28 +24298,28 @@ var ts; // Mark this node and its ancestors as containing a lexical `this` keyword. transformFlags |= 16384 /* ContainsLexicalThis */; break; - case 172 /* ObjectBindingPattern */: + case 173 /* ObjectBindingPattern */: transformFlags |= 192 /* AssertES2015 */ | 8388608 /* ContainsBindingPattern */; if (subtreeFlags & 524288 /* ContainsRest */) { transformFlags |= 8 /* AssertESNext */ | 1048576 /* ContainsObjectRest */; } excludeFlags = 537396545 /* BindingPatternExcludes */; break; - case 173 /* ArrayBindingPattern */: + case 174 /* ArrayBindingPattern */: transformFlags |= 192 /* AssertES2015 */ | 8388608 /* ContainsBindingPattern */; excludeFlags = 537396545 /* BindingPatternExcludes */; break; - case 174 /* BindingElement */: + case 175 /* BindingElement */: transformFlags |= 192 /* AssertES2015 */; if (node.dotDotDotToken) { transformFlags |= 524288 /* ContainsRest */; } break; - case 145 /* Decorator */: + case 146 /* Decorator */: // This node is TypeScript syntax, and marks its container as also being TypeScript syntax. transformFlags |= 3 /* AssertTypeScript */ | 4096 /* ContainsDecorators */; break; - case 176 /* ObjectLiteralExpression */: + case 177 /* ObjectLiteralExpression */: excludeFlags = 540087617 /* ObjectLiteralExcludes */; if (subtreeFlags & 2097152 /* ContainsComputedPropertyName */) { // If an ObjectLiteralExpression contains a ComputedPropertyName, then it @@ -23277,8 +24337,8 @@ var ts; transformFlags |= 8 /* AssertESNext */; } break; - case 175 /* ArrayLiteralExpression */: - case 180 /* NewExpression */: + case 176 /* ArrayLiteralExpression */: + case 181 /* NewExpression */: excludeFlags = 537396545 /* ArrayLiteralOrCallOrNewExcludes */; if (subtreeFlags & 524288 /* ContainsSpread */) { // If the this node contains a SpreadExpression, then it is an ES6 @@ -23286,23 +24346,23 @@ var ts; transformFlags |= 192 /* AssertES2015 */; } break; - case 209 /* DoStatement */: - case 210 /* WhileStatement */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: + case 211 /* DoStatement */: + case 212 /* WhileStatement */: + case 213 /* ForStatement */: + case 214 /* ForInStatement */: // A loop containing a block scoped binding *may* need to be transformed from ES6. if (subtreeFlags & 4194304 /* ContainsBlockScopedBinding */) { transformFlags |= 192 /* AssertES2015 */; } break; - case 261 /* SourceFile */: + case 264 /* SourceFile */: if (subtreeFlags & 32768 /* ContainsCapturedLexicalThis */) { transformFlags |= 192 /* AssertES2015 */; } break; - case 216 /* ReturnStatement */: - case 214 /* ContinueStatement */: - case 215 /* BreakStatement */: + case 218 /* ReturnStatement */: + case 216 /* ContinueStatement */: + case 217 /* BreakStatement */: transformFlags |= 33554432 /* ContainsHoistedDeclarationOrCompletion */; break; } @@ -23318,56 +24378,57 @@ var ts; */ /* @internal */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 156 /* FirstTypeNode */ && kind <= 171 /* LastTypeNode */) { + if (kind >= 157 /* FirstTypeNode */ && kind <= 172 /* LastTypeNode */) { return -3 /* TypeExcludes */; } switch (kind) { - case 179 /* CallExpression */: - case 180 /* NewExpression */: - case 175 /* ArrayLiteralExpression */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: + case 176 /* ArrayLiteralExpression */: return 537396545 /* ArrayLiteralOrCallOrNewExcludes */; - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: return 574674241 /* ModuleExcludes */; - case 144 /* Parameter */: + case 145 /* Parameter */: return 536872257 /* ParameterExcludes */; - case 185 /* ArrowFunction */: + case 186 /* ArrowFunction */: return 601249089 /* ArrowFunctionExcludes */; - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 227 /* FunctionDeclaration */: return 601281857 /* FunctionExcludes */; - case 224 /* VariableDeclarationList */: + case 226 /* VariableDeclarationList */: return 546309441 /* VariableDeclarationListExcludes */; - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: return 539358529 /* ClassExcludes */; - case 150 /* Constructor */: + case 151 /* Constructor */: return 601015617 /* ConstructorExcludes */; - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: return 601015617 /* MethodOrAccessorExcludes */; case 118 /* AnyKeyword */: case 132 /* NumberKeyword */: case 129 /* NeverKeyword */: - case 134 /* StringKeyword */: + case 135 /* StringKeyword */: + case 133 /* ObjectKeyword */: case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: + case 136 /* SymbolKeyword */: case 104 /* VoidKeyword */: - case 143 /* TypeParameter */: - case 146 /* PropertySignature */: - case 148 /* MethodSignature */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: + case 144 /* TypeParameter */: + case 147 /* PropertySignature */: + case 149 /* MethodSignature */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: + case 229 /* InterfaceDeclaration */: + case 230 /* TypeAliasDeclaration */: return -3 /* TypeExcludes */; - case 176 /* ObjectLiteralExpression */: + case 177 /* ObjectLiteralExpression */: return 540087617 /* ObjectLiteralExcludes */; - case 256 /* CatchClause */: + case 259 /* CatchClause */: return 537920833 /* CatchClauseExcludes */; - case 172 /* ObjectBindingPattern */: - case 173 /* ArrayBindingPattern */: + case 173 /* ObjectBindingPattern */: + case 174 /* ArrayBindingPattern */: return 537396545 /* BindingPatternExcludes */; default: return 536872257 /* NodeExcludes */; @@ -23406,10 +24467,6 @@ var ts; ts.Debug.assert(ts.extensionIsTypeScript(resolved.extension)); return resolved.path; } - /** Create Resolved from a file with unknown extension. */ - function resolvedFromAnyFile(path) { - return { path: path, extension: ts.extensionFromPath(path) }; - } /** Adds `isExernalLibraryImport` to a Resolved to get a ResolvedModule. */ function resolvedModuleFromResolved(_a, isExternalLibraryImport) { var path = _a.path, extension = _a.extension; @@ -23422,37 +24479,29 @@ var ts; return !(ts.isRootedDiskPath(moduleName) || ts.isExternalModuleNameRelative(moduleName)); } ts.moduleHasNonRelativeName = moduleHasNonRelativeName; - function tryReadTypesSection(extensions, packageJsonPath, baseDirectory, state) { + /** Reads from "main" or "types"/"typings" depending on `extensions`. */ + function tryReadPackageJsonFields(readTypes, packageJsonPath, baseDirectory, state) { var jsonContent = readJson(packageJsonPath, state.host); - switch (extensions) { - case 2 /* DtsOnly */: - case 0 /* TypeScript */: - return tryReadFromField("typings") || tryReadFromField("types"); - case 1 /* JavaScript */: - if (typeof jsonContent.main === "string") { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.No_types_specified_in_package_json_so_returning_main_value_of_0, jsonContent.main); - } - return ts.normalizePath(ts.combinePaths(baseDirectory, jsonContent.main)); - } - return undefined; - } + return readTypes ? tryReadFromField("typings") || tryReadFromField("types") : tryReadFromField("main"); function tryReadFromField(fieldName) { - if (ts.hasProperty(jsonContent, fieldName)) { - var typesFile = jsonContent[fieldName]; - if (typeof typesFile === "string") { - var typesFilePath = ts.normalizePath(ts.combinePaths(baseDirectory, typesFile)); - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.package_json_has_0_field_1_that_references_2, fieldName, typesFile, typesFilePath); - } - return typesFilePath; - } - else { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_string_got_1, fieldName, typeof typesFile); - } + if (!ts.hasProperty(jsonContent, fieldName)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.package_json_does_not_have_a_0_field, fieldName); } + return; } + var fileName = jsonContent[fieldName]; + if (typeof fileName !== "string") { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_string_got_1, fieldName, typeof fileName); + } + return; + } + var path = ts.normalizePath(ts.combinePaths(baseDirectory, fileName)); + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.package_json_has_0_field_1_that_references_2, fieldName, fileName, path); + } + return path; } } function readJson(path, host) { @@ -23488,13 +24537,15 @@ var ts; function getDefaultTypeRoots(currentDirectory, host) { if (!host.directoryExists) { return [ts.combinePaths(currentDirectory, nodeModulesAtTypes)]; + // And if it doesn't exist, tough. } var typeRoots; - forEachAncestorDirectory(currentDirectory, function (directory) { + forEachAncestorDirectory(ts.normalizePath(currentDirectory), function (directory) { var atTypes = ts.combinePaths(directory, nodeModulesAtTypes); if (host.directoryExists(atTypes)) { (typeRoots || (typeRoots = [])).push(atTypes); } + return undefined; }); return typeRoots; } @@ -23555,7 +24606,11 @@ var ts; return ts.forEach(typeRoots, function (typeRoot) { var candidate = ts.combinePaths(typeRoot, typeReferenceDirectiveName); var candidateDirectory = ts.getDirectoryPath(candidate); - return resolvedTypeScriptOnly(loadNodeModuleFromDirectory(2 /* DtsOnly */, candidate, failedLookupLocations, !directoryProbablyExists(candidateDirectory, host), moduleResolutionState)); + var directoryExists = directoryProbablyExists(candidateDirectory, host); + if (!directoryExists && traceEnabled) { + trace(host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, candidateDirectory); + } + return resolvedTypeScriptOnly(loadNodeModuleFromDirectory(Extensions.DtsOnly, candidate, failedLookupLocations, !directoryExists, moduleResolutionState)); }); } else { @@ -23572,7 +24627,8 @@ var ts; if (traceEnabled) { trace(host, ts.Diagnostics.Looking_up_in_node_modules_folder_initial_location_0, initialLocationForSecondaryLookup); } - resolvedFile = resolvedTypeScriptOnly(loadModuleFromNodeModules(2 /* DtsOnly */, typeReferenceDirectiveName, initialLocationForSecondaryLookup, failedLookupLocations, moduleResolutionState)); + var result = loadModuleFromNodeModules(Extensions.DtsOnly, typeReferenceDirectiveName, initialLocationForSecondaryLookup, failedLookupLocations, moduleResolutionState, /*cache*/ undefined); + resolvedFile = resolvedTypeScriptOnly(result && result.value); if (!resolvedFile && traceEnabled) { trace(host, ts.Diagnostics.Type_reference_directive_0_was_not_resolved, typeReferenceDirectiveName); } @@ -23587,13 +24643,13 @@ var ts; } ts.resolveTypeReferenceDirective = resolveTypeReferenceDirective; /** - * Given a set of options, returns the set of type directive names - * that should be included for this program automatically. - * This list could either come from the config file, - * or from enumerating the types root + initial secondary types lookup location. - * More type directives might appear in the program later as a result of loading actual source files; - * this list is only the set of defaults that are implicitly included. - */ + * Given a set of options, returns the set of type directive names + * that should be included for this program automatically. + * This list could either come from the config file, + * or from enumerating the types root + initial secondary types lookup location. + * More type directives might appear in the program later as a result of loading actual source files; + * this list is only the set of defaults that are implicitly included. + */ function getAutomaticTypeDirectiveNames(options, host) { // Use explicit type list from tsconfig.json if (options.types) { @@ -23625,31 +24681,135 @@ var ts; return result; } ts.getAutomaticTypeDirectiveNames = getAutomaticTypeDirectiveNames; - function resolveModuleName(moduleName, containingFile, compilerOptions, host) { + function createModuleResolutionCache(currentDirectory, getCanonicalFileName) { + var directoryToModuleNameMap = ts.createFileMap(); + var moduleNameToDirectoryMap = ts.createMap(); + return { getOrCreateCacheForDirectory: getOrCreateCacheForDirectory, getOrCreateCacheForModuleName: getOrCreateCacheForModuleName }; + function getOrCreateCacheForDirectory(directoryName) { + var path = ts.toPath(directoryName, currentDirectory, getCanonicalFileName); + var perFolderCache = directoryToModuleNameMap.get(path); + if (!perFolderCache) { + perFolderCache = ts.createMap(); + directoryToModuleNameMap.set(path, perFolderCache); + } + return perFolderCache; + } + function getOrCreateCacheForModuleName(nonRelativeModuleName) { + if (!moduleHasNonRelativeName(nonRelativeModuleName)) { + return undefined; + } + var perModuleNameCache = moduleNameToDirectoryMap.get(nonRelativeModuleName); + if (!perModuleNameCache) { + perModuleNameCache = createPerModuleNameCache(); + moduleNameToDirectoryMap.set(nonRelativeModuleName, perModuleNameCache); + } + return perModuleNameCache; + } + function createPerModuleNameCache() { + var directoryPathMap = ts.createFileMap(); + return { get: get, set: set }; + function get(directory) { + return directoryPathMap.get(ts.toPath(directory, currentDirectory, getCanonicalFileName)); + } + /** + * At first this function add entry directory -> module resolution result to the table. + * Then it computes the set of parent folders for 'directory' that should have the same module resolution result + * and for every parent folder in set it adds entry: parent -> module resolution. . + * Lets say we first directory name: /a/b/c/d/e and resolution result is: /a/b/bar.ts. + * Set of parent folders that should have the same result will be: + * [ + * /a/b/c/d, /a/b/c, /a/b + * ] + * this means that request for module resolution from file in any of these folder will be immediately found in cache. + */ + function set(directory, result) { + var path = ts.toPath(directory, currentDirectory, getCanonicalFileName); + // if entry is already in cache do nothing + if (directoryPathMap.contains(path)) { + return; + } + directoryPathMap.set(path, result); + var resolvedFileName = result.resolvedModule && result.resolvedModule.resolvedFileName; + // find common prefix between directory and resolved file name + // this common prefix should be the shorted path that has the same resolution + // directory: /a/b/c/d/e + // resolvedFileName: /a/b/foo.d.ts + var commonPrefix = getCommonPrefix(path, resolvedFileName); + var current = path; + while (true) { + var parent = ts.getDirectoryPath(current); + if (parent === current || directoryPathMap.contains(parent)) { + break; + } + directoryPathMap.set(parent, result); + current = parent; + if (current === commonPrefix) { + break; + } + } + } + function getCommonPrefix(directory, resolution) { + if (resolution === undefined) { + return undefined; + } + var resolutionDirectory = ts.toPath(ts.getDirectoryPath(resolution), currentDirectory, getCanonicalFileName); + // find first position where directory and resolution differs + var i = 0; + while (i < Math.min(directory.length, resolutionDirectory.length) && directory.charCodeAt(i) === resolutionDirectory.charCodeAt(i)) { + i++; + } + // find last directory separator before position i + var sep = directory.lastIndexOf(ts.directorySeparator, i); + if (sep < 0) { + return undefined; + } + return directory.substr(0, sep); + } + } + } + ts.createModuleResolutionCache = createModuleResolutionCache; + function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache) { var traceEnabled = isTraceEnabled(compilerOptions, host); if (traceEnabled) { trace(host, ts.Diagnostics.Resolving_module_0_from_1, moduleName, containingFile); } - var moduleResolution = compilerOptions.moduleResolution; - if (moduleResolution === undefined) { - moduleResolution = ts.getEmitModuleKind(compilerOptions) === ts.ModuleKind.CommonJS ? ts.ModuleResolutionKind.NodeJs : ts.ModuleResolutionKind.Classic; + var containingDirectory = ts.getDirectoryPath(containingFile); + var perFolderCache = cache && cache.getOrCreateCacheForDirectory(containingDirectory); + var result = perFolderCache && perFolderCache.get(moduleName); + if (result) { if (traceEnabled) { - trace(host, ts.Diagnostics.Module_resolution_kind_is_not_specified_using_0, ts.ModuleResolutionKind[moduleResolution]); + trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); } } else { - if (traceEnabled) { - trace(host, ts.Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0, ts.ModuleResolutionKind[moduleResolution]); + var moduleResolution = compilerOptions.moduleResolution; + if (moduleResolution === undefined) { + moduleResolution = ts.getEmitModuleKind(compilerOptions) === ts.ModuleKind.CommonJS ? ts.ModuleResolutionKind.NodeJs : ts.ModuleResolutionKind.Classic; + if (traceEnabled) { + trace(host, ts.Diagnostics.Module_resolution_kind_is_not_specified_using_0, ts.ModuleResolutionKind[moduleResolution]); + } + } + else { + if (traceEnabled) { + trace(host, ts.Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0, ts.ModuleResolutionKind[moduleResolution]); + } + } + switch (moduleResolution) { + case ts.ModuleResolutionKind.NodeJs: + result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache); + break; + case ts.ModuleResolutionKind.Classic: + result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache); + break; + } + if (perFolderCache) { + perFolderCache.set(moduleName, result); + // put result in per-module name cache + var perModuleNameCache = cache.getOrCreateCacheForModuleName(moduleName); + if (perModuleNameCache) { + perModuleNameCache.set(containingDirectory, result); + } } - } - var result; - switch (moduleResolution) { - case ts.ModuleResolutionKind.NodeJs: - result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host); - break; - case ts.ModuleResolutionKind.Classic: - result = classicNameResolver(moduleName, containingFile, compilerOptions, host); - break; } if (traceEnabled) { if (result.resolvedModule) { @@ -23842,38 +25002,45 @@ var ts; return loader(extensions, candidate, failedLookupLocations, !directoryProbablyExists(ts.getDirectoryPath(candidate), state.host), state); } } - function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host) { + function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache) { + return nodeModuleNameResolverWorker(moduleName, containingFile, compilerOptions, host, cache, /*jsOnly*/ false); + } + ts.nodeModuleNameResolver = nodeModuleNameResolver; + /* @internal */ + function nodeModuleNameResolverWorker(moduleName, containingFile, compilerOptions, host, cache, jsOnly) { + if (jsOnly === void 0) { jsOnly = false; } var containingDirectory = ts.getDirectoryPath(containingFile); var traceEnabled = isTraceEnabled(compilerOptions, host); var failedLookupLocations = []; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; - var result = tryResolve(0 /* TypeScript */) || tryResolve(1 /* JavaScript */); - if (result) { - var resolved = result.resolved, isExternalLibraryImport = result.isExternalLibraryImport; + var result = jsOnly ? tryResolve(Extensions.JavaScript) : (tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript)); + if (result && result.value) { + var _a = result.value, resolved = _a.resolved, isExternalLibraryImport = _a.isExternalLibraryImport; return createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations); } return { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; function tryResolve(extensions) { - var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, nodeLoadModuleByRelativeName, failedLookupLocations, state); + var loader = function (extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { return nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, /*considerPackageJson*/ true); }; + var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, failedLookupLocations, state); if (resolved) { - return { resolved: resolved, isExternalLibraryImport: false }; + return toSearchResult({ resolved: resolved, isExternalLibraryImport: false }); } if (moduleHasNonRelativeName(moduleName)) { if (traceEnabled) { - trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder, moduleName); + trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1, moduleName, Extensions[extensions]); } - var resolved_1 = loadModuleFromNodeModules(extensions, moduleName, containingDirectory, failedLookupLocations, state); + var resolved_1 = loadModuleFromNodeModules(extensions, moduleName, containingDirectory, failedLookupLocations, state, cache); // For node_modules lookups, get the real path so that multiple accesses to an `npm link`-ed module do not create duplicate files. - return resolved_1 && { resolved: { path: realpath(resolved_1.path, host, traceEnabled), extension: resolved_1.extension }, isExternalLibraryImport: true }; + return resolved_1 && { value: resolved_1.value && { resolved: { path: realpath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }, isExternalLibraryImport: true } }; } else { var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, state); - return resolved_2 && { resolved: resolved_2, isExternalLibraryImport: false }; + var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, state, /*considerPackageJson*/ true); + return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: false }); } } } - ts.nodeModuleNameResolver = nodeModuleNameResolver; + ts.nodeModuleNameResolverWorker = nodeModuleNameResolverWorker; function realpath(path, host, traceEnabled) { if (!host.realpath) { return path; @@ -23884,12 +25051,35 @@ var ts; } return real; } - function nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { + function nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson) { if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0, candidate); + trace(state.host, ts.Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1, candidate, Extensions[extensions]); } - var resolvedFromFile = !ts.pathEndsWithDirectorySeparator(candidate) && loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); - return resolvedFromFile || loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); + if (!ts.pathEndsWithDirectorySeparator(candidate)) { + if (!onlyRecordFailures) { + var parentOfCandidate = ts.getDirectoryPath(candidate); + if (!directoryProbablyExists(parentOfCandidate, state.host)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, parentOfCandidate); + } + onlyRecordFailures = true; + } + } + var resolvedFromFile = loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); + if (resolvedFromFile) { + return resolvedFromFile; + } + } + if (!onlyRecordFailures) { + var candidateExists = directoryProbablyExists(candidate, state.host); + if (!candidateExists) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, candidate); + } + onlyRecordFailures = true; + } + } + return loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson); } /* @internal */ function directoryProbablyExists(directoryName, host) { @@ -23928,11 +25118,11 @@ var ts; } } switch (extensions) { - case 2 /* DtsOnly */: + case Extensions.DtsOnly: return tryExtension(".d.ts", ts.Extension.Dts); - case 0 /* TypeScript */: + case Extensions.TypeScript: return tryExtension(".ts", ts.Extension.Ts) || tryExtension(".tsx", ts.Extension.Tsx) || tryExtension(".d.ts", ts.Extension.Dts); - case 1 /* JavaScript */: + case Extensions.JavaScript: return tryExtension(".js", ts.Extension.Js) || tryExtension(".jsx", ts.Extension.Jsx); } function tryExtension(ext, extension) { @@ -23942,120 +25132,191 @@ var ts; } /** Return the file if it exists. */ function tryFile(fileName, failedLookupLocations, onlyRecordFailures, state) { - if (!onlyRecordFailures && state.host.fileExists(fileName)) { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName); - } - return fileName; - } - else { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.File_0_does_not_exist, fileName); - } - failedLookupLocations.push(fileName); - return undefined; - } - } - function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { - var packageJsonPath = pathToPackageJson(candidate); - var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); - if (directoryExists && state.host.fileExists(packageJsonPath)) { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); - } - var typesFile = tryReadTypesSection(extensions, packageJsonPath, candidate, state); - if (typesFile) { - var onlyRecordFailures_1 = !directoryProbablyExists(ts.getDirectoryPath(typesFile), state.host); - // A package.json "typings" may specify an exact filename, or may choose to omit an extension. - var fromFile = tryFile(typesFile, failedLookupLocations, onlyRecordFailures_1, state); - if (fromFile) { - // Note: this would allow a package.json to specify a ".js" file as typings. Maybe that should be forbidden. - return resolvedFromAnyFile(fromFile); - } - var x = tryAddingExtensions(typesFile, 0 /* TypeScript */, failedLookupLocations, onlyRecordFailures_1, state); - if (x) { - return x; + if (!onlyRecordFailures) { + if (state.host.fileExists(fileName)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName); } + return fileName; } else { if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.package_json_does_not_have_a_types_or_main_field); + trace(state.host, ts.Diagnostics.File_0_does_not_exist, fileName); } } } - else { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.File_0_does_not_exist, packageJsonPath); + failedLookupLocations.push(fileName); + return undefined; + } + function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson) { + if (considerPackageJson === void 0) { considerPackageJson = true; } + var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); + if (considerPackageJson) { + var packageJsonPath = pathToPackageJson(candidate); + if (directoryExists && state.host.fileExists(packageJsonPath)) { + var fromPackageJson = loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state); + if (fromPackageJson) { + return fromPackageJson; + } + } + else { + if (directoryExists && state.traceEnabled) { + trace(state.host, ts.Diagnostics.File_0_does_not_exist, packageJsonPath); + } + // record package json as one of failed lookup locations - in the future if this file will appear it will invalidate resolution results + failedLookupLocations.push(packageJsonPath); } - // record package json as one of failed lookup locations - in the future if this file will appear it will invalidate resolution results - failedLookupLocations.push(packageJsonPath); } return loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state); } + function loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); + } + var file = tryReadPackageJsonFields(extensions !== Extensions.JavaScript, packageJsonPath, candidate, state); + if (!file) { + return undefined; + } + var onlyRecordFailures = !directoryProbablyExists(ts.getDirectoryPath(file), state.host); + var fromFile = tryFile(file, failedLookupLocations, onlyRecordFailures, state); + if (fromFile) { + var resolved = fromFile && resolvedIfExtensionMatches(extensions, fromFile); + if (resolved) { + return resolved; + } + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromFile); + } + } + // Even if extensions is DtsOnly, we can still look up a .ts file as a result of package.json "types" + var nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions; + // Don't do package.json lookup recursively, because Node.js' package lookup doesn't. + return nodeLoadModuleByRelativeName(nextExtensions, file, failedLookupLocations, onlyRecordFailures, state, /*considerPackageJson*/ false); + } + /** Resolve from an arbitrarily specified file. Return `undefined` if it has an unsupported extension. */ + function resolvedIfExtensionMatches(extensions, path) { + var extension = ts.tryGetExtensionFromPath(path); + return extension !== undefined && extensionIsOk(extensions, extension) ? { path: path, extension: extension } : undefined; + } + /** True if `extension` is one of the supported `extensions`. */ + function extensionIsOk(extensions, extension) { + switch (extensions) { + case Extensions.JavaScript: + return extension === ts.Extension.Js || extension === ts.Extension.Jsx; + case Extensions.TypeScript: + return extension === ts.Extension.Ts || extension === ts.Extension.Tsx || extension === ts.Extension.Dts; + case Extensions.DtsOnly: + return extension === ts.Extension.Dts; + } + } function pathToPackageJson(directory) { return ts.combinePaths(directory, "package.json"); } - function loadModuleFromNodeModulesFolder(extensions, moduleName, directory, failedLookupLocations, state) { - var nodeModulesFolder = ts.combinePaths(directory, "node_modules"); - var nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, state.host); + function loadModuleFromNodeModulesFolder(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, failedLookupLocations, state) { var candidate = ts.normalizePath(ts.combinePaths(nodeModulesFolder, moduleName)); return loadModuleFromFile(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state) || loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state); } - function loadModuleFromNodeModules(extensions, moduleName, directory, failedLookupLocations, state) { - return loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, /*typesOnly*/ false); + function loadModuleFromNodeModules(extensions, moduleName, directory, failedLookupLocations, state, cache) { + return loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, /*typesOnly*/ false, cache); } function loadModuleFromNodeModulesAtTypes(moduleName, directory, failedLookupLocations, state) { // Extensions parameter here doesn't actually matter, because typesOnly ensures we're just doing @types lookup, which is always DtsOnly. - return loadModuleFromNodeModulesWorker(2 /* DtsOnly */, moduleName, directory, failedLookupLocations, state, /*typesOnly*/ true); + return loadModuleFromNodeModulesWorker(Extensions.DtsOnly, moduleName, directory, failedLookupLocations, state, /*typesOnly*/ true, /*cache*/ undefined); } - function loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, typesOnly) { + function loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, typesOnly, cache) { + var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName); return forEachAncestorDirectory(ts.normalizeSlashes(directory), function (ancestorDirectory) { if (ts.getBaseFileName(ancestorDirectory) !== "node_modules") { - return loadModuleFromNodeModulesOneLevel(extensions, moduleName, ancestorDirectory, failedLookupLocations, state, typesOnly); + var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, ancestorDirectory, state.traceEnabled, state.host); + if (resolutionFromCache) { + return resolutionFromCache; + } + return toSearchResult(loadModuleFromNodeModulesOneLevel(extensions, moduleName, ancestorDirectory, failedLookupLocations, state, typesOnly)); } }); } /** Load a module from a single node_modules directory, but not from any ancestors' node_modules directories. */ function loadModuleFromNodeModulesOneLevel(extensions, moduleName, directory, failedLookupLocations, state, typesOnly) { if (typesOnly === void 0) { typesOnly = false; } - var packageResult = typesOnly ? undefined : loadModuleFromNodeModulesFolder(extensions, moduleName, directory, failedLookupLocations, state); + var nodeModulesFolder = ts.combinePaths(directory, "node_modules"); + var nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, state.host); + if (!nodeModulesFolderExists && state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesFolder); + } + var packageResult = typesOnly ? undefined : loadModuleFromNodeModulesFolder(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, failedLookupLocations, state); if (packageResult) { return packageResult; } - if (extensions !== 1 /* JavaScript */) { - return loadModuleFromNodeModulesFolder(2 /* DtsOnly */, ts.combinePaths("@types", moduleName), directory, failedLookupLocations, state); + if (extensions !== Extensions.JavaScript) { + var nodeModulesAtTypes_1 = ts.combinePaths(nodeModulesFolder, "@types"); + var nodeModulesAtTypesExists = nodeModulesFolderExists; + if (nodeModulesFolderExists && !directoryProbablyExists(nodeModulesAtTypes_1, state.host)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesAtTypes_1); + } + nodeModulesAtTypesExists = false; + } + return loadModuleFromNodeModulesFolder(Extensions.DtsOnly, mangleScopedPackage(moduleName, state), nodeModulesAtTypes_1, nodeModulesAtTypesExists, failedLookupLocations, state); } } - function classicNameResolver(moduleName, containingFile, compilerOptions, host) { + /** For a scoped package, we must look in `@types/foo__bar` instead of `@types/@foo/bar`. */ + function mangleScopedPackage(moduleName, state) { + if (ts.startsWith(moduleName, "@")) { + var replaceSlash = moduleName.replace(ts.directorySeparator, "__"); + if (replaceSlash !== moduleName) { + var mangled = replaceSlash.slice(1); // Take off the "@" + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Scoped_package_detected_looking_in_0, mangled); + } + return mangled; + } + } + return moduleName; + } + function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, traceEnabled, host) { + var result = cache && cache.get(containingDirectory); + if (result) { + if (traceEnabled) { + trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); + } + return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension } }; + } + } + function classicNameResolver(moduleName, containingFile, compilerOptions, host, cache) { var traceEnabled = isTraceEnabled(compilerOptions, host); var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var failedLookupLocations = []; var containingDirectory = ts.getDirectoryPath(containingFile); - var resolved = tryResolve(0 /* TypeScript */) || tryResolve(1 /* JavaScript */); - return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ false, failedLookupLocations); + var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); + return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations); function tryResolve(extensions) { var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFile, failedLookupLocations, state); if (resolvedUsingSettings) { - return resolvedUsingSettings; + return { value: resolvedUsingSettings }; } + var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName); if (moduleHasNonRelativeName(moduleName)) { // Climb up parent directories looking for a module. var resolved_3 = forEachAncestorDirectory(containingDirectory, function (directory) { + var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, directory, traceEnabled, host); + if (resolutionFromCache) { + return resolutionFromCache; + } var searchName = ts.normalizePath(ts.combinePaths(directory, moduleName)); - return loadModuleFromFile(extensions, searchName, failedLookupLocations, /*onlyRecordFailures*/ false, state); + return toSearchResult(loadModuleFromFile(extensions, searchName, failedLookupLocations, /*onlyRecordFailures*/ false, state)); }); if (resolved_3) { return resolved_3; } - if (extensions === 0 /* TypeScript */) { + if (extensions === Extensions.TypeScript) { // If we didn't find the file normally, look it up in @types. return loadModuleFromNodeModulesAtTypes(moduleName, containingDirectory, failedLookupLocations, state); } } else { var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - return loadModuleFromFile(extensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, state); + return toSearchResult(loadModuleFromFile(extensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, state)); } } } @@ -24072,10 +25333,17 @@ var ts; } var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var failedLookupLocations = []; - var resolved = loadModuleFromNodeModulesOneLevel(2 /* DtsOnly */, moduleName, globalCache, failedLookupLocations, state); + var resolved = loadModuleFromNodeModulesOneLevel(Extensions.DtsOnly, moduleName, globalCache, failedLookupLocations, state); return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations); } ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache; + /** + * Wraps value to SearchResult. + * @returns undefined if value is undefined or { value } otherwise + */ + function toSearchResult(value) { + return value !== undefined ? { value: value } : undefined; + } /** Calls `callback` on `directory` and every ancestor directory it has, returning the first defined result. */ function forEachAncestorDirectory(directory, callback) { while (true) { @@ -24128,23 +25396,34 @@ var ts; // is because diagnostics can be quite expensive, and we want to allow hosts to bail out if // they no longer need the information (for example, if the user started editing again). var cancellationToken; + var requestedExternalEmitHelpers; + var externalHelpersModule; var Symbol = ts.objectAllocator.getSymbolConstructor(); var Type = ts.objectAllocator.getTypeConstructor(); var Signature = ts.objectAllocator.getSignatureConstructor(); var typeCount = 0; var symbolCount = 0; + var symbolInstantiationDepth = 0; var emptyArray = []; var emptySymbols = ts.createMap(); var compilerOptions = host.getCompilerOptions(); - var languageVersion = compilerOptions.target || 0 /* ES3 */; + var languageVersion = ts.getEmitScriptTarget(compilerOptions); var modulekind = ts.getEmitModuleKind(compilerOptions); var noUnusedIdentifiers = !!compilerOptions.noUnusedLocals || !!compilerOptions.noUnusedParameters; var allowSyntheticDefaultImports = typeof compilerOptions.allowSyntheticDefaultImports !== "undefined" ? compilerOptions.allowSyntheticDefaultImports : modulekind === ts.ModuleKind.System; - var strictNullChecks = compilerOptions.strictNullChecks; + var strictNullChecks = compilerOptions.strictNullChecks === undefined ? compilerOptions.strict : compilerOptions.strictNullChecks; + var noImplicitAny = compilerOptions.noImplicitAny === undefined ? compilerOptions.strict : compilerOptions.noImplicitAny; + var noImplicitThis = compilerOptions.noImplicitThis === undefined ? compilerOptions.strict : compilerOptions.noImplicitThis; var emitResolver = createResolver(); - var undefinedSymbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "undefined"); + var nodeBuilder = createNodeBuilder(); + var undefinedSymbol = createSymbol(4 /* Property */, "undefined"); undefinedSymbol.declarations = []; - var argumentsSymbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "arguments"); + var argumentsSymbol = createSymbol(4 /* Property */, "arguments"); + // for public members that accept a Node or one of its subtypes, we must guard against + // synthetic nodes created during transformations by calling `getParseTreeNode`. + // for most of these, we perform the guard only on `checker` to avoid any possible + // extra cost of calling `getParseTreeNode` when calling these functions from inside the + // checker. var checker = { getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), "identifierCount"); }, @@ -24153,49 +25432,129 @@ var ts; isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, isUnknownSymbol: function (symbol) { return symbol === unknownSymbol; }, + getMergedSymbol: getMergedSymbol, getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, - getTypeOfSymbolAtLocation: getTypeOfSymbolAtLocation, - getSymbolsOfParameterPropertyDeclaration: getSymbolsOfParameterPropertyDeclaration, + getTypeOfSymbolAtLocation: function (symbol, location) { + location = ts.getParseTreeNode(location); + return location ? getTypeOfSymbolAtLocation(symbol, location) : unknownType; + }, + getSymbolsOfParameterPropertyDeclaration: function (parameter, parameterName) { + parameter = ts.getParseTreeNode(parameter, ts.isParameter); + ts.Debug.assert(parameter !== undefined, "Cannot get symbols of a synthetic parameter that cannot be resolved to a parse-tree node."); + return getSymbolsOfParameterPropertyDeclaration(parameter, parameterName); + }, getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, getPropertiesOfType: getPropertiesOfType, getPropertyOfType: getPropertyOfType, + getIndexInfoOfType: getIndexInfoOfType, getSignaturesOfType: getSignaturesOfType, getIndexTypeOfType: getIndexTypeOfType, getBaseTypes: getBaseTypes, + getBaseTypeOfLiteralType: getBaseTypeOfLiteralType, + getWidenedType: getWidenedType, + getTypeFromTypeNode: function (node) { + node = ts.getParseTreeNode(node, ts.isTypeNode); + return node ? getTypeFromTypeNode(node) : unknownType; + }, + getParameterType: getTypeAtPosition, getReturnTypeOfSignature: getReturnTypeOfSignature, getNonNullableType: getNonNullableType, - getSymbolsInScope: getSymbolsInScope, - getSymbolAtLocation: getSymbolAtLocation, - getShorthandAssignmentValueSymbol: getShorthandAssignmentValueSymbol, - getExportSpecifierLocalTargetSymbol: getExportSpecifierLocalTargetSymbol, - getTypeAtLocation: getTypeOfNode, - getPropertySymbolOfDestructuringAssignment: getPropertySymbolOfDestructuringAssignment, - typeToString: typeToString, + typeToTypeNode: nodeBuilder.typeToTypeNode, + indexInfoToIndexSignatureDeclaration: nodeBuilder.indexInfoToIndexSignatureDeclaration, + signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration, + getSymbolsInScope: function (location, meaning) { + location = ts.getParseTreeNode(location); + return location ? getSymbolsInScope(location, meaning) : []; + }, + getSymbolAtLocation: function (node) { + node = ts.getParseTreeNode(node); + return node ? getSymbolAtLocation(node) : undefined; + }, + getShorthandAssignmentValueSymbol: function (node) { + node = ts.getParseTreeNode(node); + return node ? getShorthandAssignmentValueSymbol(node) : undefined; + }, + getExportSpecifierLocalTargetSymbol: function (node) { + node = ts.getParseTreeNode(node, ts.isExportSpecifier); + return node ? getExportSpecifierLocalTargetSymbol(node) : undefined; + }, + getTypeAtLocation: function (node) { + node = ts.getParseTreeNode(node); + return node ? getTypeOfNode(node) : unknownType; + }, + getPropertySymbolOfDestructuringAssignment: function (location) { + location = ts.getParseTreeNode(location, ts.isIdentifier); + return location ? getPropertySymbolOfDestructuringAssignment(location) : undefined; + }, + signatureToString: function (signature, enclosingDeclaration, flags, kind) { + return signatureToString(signature, ts.getParseTreeNode(enclosingDeclaration), flags, kind); + }, + typeToString: function (type, enclosingDeclaration, flags) { + return typeToString(type, ts.getParseTreeNode(enclosingDeclaration), flags); + }, getSymbolDisplayBuilder: getSymbolDisplayBuilder, - symbolToString: symbolToString, + symbolToString: function (symbol, enclosingDeclaration, meaning) { + return symbolToString(symbol, ts.getParseTreeNode(enclosingDeclaration), meaning); + }, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, - getContextualType: getContextualType, + getContextualType: function (node) { + node = ts.getParseTreeNode(node, ts.isExpression); + return node ? getContextualType(node) : undefined; + }, getFullyQualifiedName: getFullyQualifiedName, - getResolvedSignature: getResolvedSignature, - getConstantValue: getConstantValue, - isValidPropertyAccess: isValidPropertyAccess, - getSignatureFromDeclaration: getSignatureFromDeclaration, - isImplementationOfOverload: isImplementationOfOverload, + getResolvedSignature: function (node, candidatesOutArray) { + node = ts.getParseTreeNode(node, ts.isCallLikeExpression); + return node ? getResolvedSignature(node, candidatesOutArray) : undefined; + }, + getConstantValue: function (node) { + node = ts.getParseTreeNode(node, canHaveConstantValue); + return node ? getConstantValue(node) : undefined; + }, + isValidPropertyAccess: function (node, propertyName) { + node = ts.getParseTreeNode(node, ts.isPropertyAccessOrQualifiedName); + return node ? isValidPropertyAccess(node, propertyName) : false; + }, + getSignatureFromDeclaration: function (declaration) { + declaration = ts.getParseTreeNode(declaration, ts.isFunctionLike); + return declaration ? getSignatureFromDeclaration(declaration) : undefined; + }, + isImplementationOfOverload: function (node) { + node = ts.getParseTreeNode(node, ts.isFunctionLike); + return node ? isImplementationOfOverload(node) : undefined; + }, + getImmediateAliasedSymbol: function (symbol) { + ts.Debug.assert((symbol.flags & 8388608 /* Alias */) !== 0, "Should only get Alias here."); + var links = getSymbolLinks(symbol); + if (!links.immediateTarget) { + var node = getDeclarationOfAliasSymbol(symbol); + ts.Debug.assert(!!node); + links.immediateTarget = getTargetOfAliasDeclaration(node, /*dontRecursivelyResolve*/ true); + } + return links.immediateTarget; + }, getAliasedSymbol: resolveAlias, getEmitResolver: getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, + getExportsAndPropertiesOfModule: getExportsAndPropertiesOfModule, getAmbientModules: getAmbientModules, - getJsxElementAttributesType: getJsxElementAttributesType, + getAllAttributesTypeFromJsxOpeningLikeElement: function (node) { + node = ts.getParseTreeNode(node, ts.isJsxOpeningLikeElement); + return node ? getAllAttributesTypeFromJsxOpeningLikeElement(node) : undefined; + }, getJsxIntrinsicTagNames: getJsxIntrinsicTagNames, - isOptionalParameter: isOptionalParameter, + isOptionalParameter: function (node) { + node = ts.getParseTreeNode(node, ts.isParameter); + return node ? isOptionalParameter(node) : false; + }, tryGetMemberInModuleExports: tryGetMemberInModuleExports, tryFindAmbientModuleWithoutAugmentations: function (moduleName) { // we deliberately exclude augmentations // since we are only interested in declarations of the module itself return tryFindAmbientModule(moduleName, /*withAugmentations*/ false); - } + }, + getApparentType: getApparentType }; var tupleTypes = []; var unionTypes = ts.createMap(); @@ -24204,8 +25563,8 @@ var ts; var numericLiteralTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); var evolvingArrayTypes = []; - var unknownSymbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "unknown"); - var resolvingSymbol = createSymbol(67108864 /* Transient */, "__resolving__"); + var unknownSymbol = createSymbol(4 /* Property */, "unknown"); + var resolvingSymbol = createSymbol(0, "__resolving__"); var anyType = createIntrinsicType(1 /* Any */, "any"); var autoType = createIntrinsicType(1 /* Any */, "any"); var unknownType = createIntrinsicType(1 /* Any */, "unknown"); @@ -24222,8 +25581,9 @@ var ts; var voidType = createIntrinsicType(1024 /* Void */, "void"); var neverType = createIntrinsicType(8192 /* Never */, "never"); var silentNeverType = createIntrinsicType(8192 /* Never */, "never"); + var nonPrimitiveType = createIntrinsicType(16777216 /* NonPrimitive */, "object"); var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); - var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */ | 67108864 /* Transient */, "__type"); + var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type"); emptyTypeLiteralSymbol.members = ts.createMap(); var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, undefined, undefined); var emptyGenericType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); @@ -24233,21 +25593,20 @@ var ts; // in getPropagatingFlagsOfTypes, and it is checked in inferFromTypes. anyFunctionType.flags |= 8388608 /* ContainsAnyFunctionType */; var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var circularConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anySignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); var unknownSignature = createSignature(undefined, undefined, undefined, emptyArray, unknownType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); var resolvingSignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); var silentNeverSignature = createSignature(undefined, undefined, undefined, emptyArray, silentNeverType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); var enumNumberIndexInfo = createIndexInfo(stringType, /*isReadonly*/ true); + var jsObjectLiteralIndexInfo = createIndexInfo(anyType, /*isReadonly*/ false); var globals = ts.createMap(); /** * List of every ambient module with a "*" wildcard. * Unlike other ambient modules, these can't be stored in `globals` because symbol tables only deal with exact matches. * This is only used if there is no exact match. - */ + */ var patternAmbientModules; - var getGlobalESSymbolConstructorSymbol; - var getGlobalPromiseConstructorSymbol; - var tryGetGlobalPromiseConstructorSymbol; var globalObjectType; var globalFunctionType; var globalArrayType; @@ -24256,29 +25615,29 @@ var ts; var globalNumberType; var globalBooleanType; var globalRegExpType; + var globalThisType; var anyArrayType; var autoArrayType; var anyReadonlyArrayType; // The library files are only loaded when the feature is used. // This allows users to just specify library files they want to used through --lib // and they will not get an error from not having unrelated library files - var getGlobalTemplateStringsArrayType; - var getGlobalESSymbolType; - var getGlobalIterableType; - var getGlobalIteratorType; - var getGlobalIterableIteratorType; - var getGlobalClassDecoratorType; - var getGlobalParameterDecoratorType; - var getGlobalPropertyDecoratorType; - var getGlobalMethodDecoratorType; - var getGlobalTypedPropertyDescriptorType; - var getGlobalPromiseType; - var tryGetGlobalPromiseType; - var getGlobalPromiseLikeType; - var getInstantiatedGlobalPromiseLikeType; - var getGlobalPromiseConstructorLikeType; - var getGlobalThenableType; - var jsxElementClassType; + var deferredGlobalESSymbolConstructorSymbol; + var deferredGlobalESSymbolType; + var deferredGlobalTypedPropertyDescriptorType; + var deferredGlobalPromiseType; + var deferredGlobalPromiseConstructorSymbol; + var deferredGlobalPromiseConstructorLikeType; + var deferredGlobalIterableType; + var deferredGlobalIteratorType; + var deferredGlobalIterableIteratorType; + var deferredGlobalAsyncIterableType; + var deferredGlobalAsyncIteratorType; + var deferredGlobalAsyncIterableIteratorType; + var deferredGlobalTemplateStringsArrayType; + var deferredJsxElementClassType; + var deferredJsxElementType; + var deferredJsxStatelessElementType; var deferredNodes; var deferredUnusedIdentifierNodes; var flowLoopStart = 0; @@ -24299,6 +25658,7 @@ var ts; var visitedFlowNodes = []; var visitedFlowTypes = []; var potentialThisCollisions = []; + var potentialNewTargetCollisions = []; var awaitedTypeStack = []; var diagnostics = ts.createDiagnosticCollection(); var TypeFacts; @@ -24364,7 +25724,7 @@ var ts; TypeFacts[TypeFacts["UndefinedFacts"] = 2457472] = "UndefinedFacts"; TypeFacts[TypeFacts["NullFacts"] = 2340752] = "NullFacts"; })(TypeFacts || (TypeFacts = {})); - var typeofEQFacts = ts.createMap({ + var typeofEQFacts = ts.createMapFromTemplate({ "string": 1 /* TypeofEQString */, "number": 2 /* TypeofEQNumber */, "boolean": 4 /* TypeofEQBoolean */, @@ -24373,7 +25733,7 @@ var ts; "object": 16 /* TypeofEQObject */, "function": 32 /* TypeofEQFunction */ }); - var typeofNEFacts = ts.createMap({ + var typeofNEFacts = ts.createMapFromTemplate({ "string": 128 /* TypeofNEString */, "number": 256 /* TypeofNENumber */, "boolean": 512 /* TypeofNEBoolean */, @@ -24382,14 +25742,14 @@ var ts; "object": 2048 /* TypeofNEObject */, "function": 4096 /* TypeofNEFunction */ }); - var typeofTypesByName = ts.createMap({ + var typeofTypesByName = ts.createMapFromTemplate({ "string": stringType, "number": numberType, "boolean": booleanType, "symbol": esSymbolType, "undefined": undefinedType }); - var jsxElementType; + var typeofType = createTypeofType(); var _jsxNamespace; var _jsxFactoryEntity; /** Things we lazy load from the JSX namespace */ @@ -24417,8 +25777,14 @@ var ts; TypeSystemPropertyName[TypeSystemPropertyName["DeclaredType"] = 2] = "DeclaredType"; TypeSystemPropertyName[TypeSystemPropertyName["ResolvedReturnType"] = 3] = "ResolvedReturnType"; })(TypeSystemPropertyName || (TypeSystemPropertyName = {})); + var CheckMode; + (function (CheckMode) { + CheckMode[CheckMode["Normal"] = 0] = "Normal"; + CheckMode[CheckMode["SkipContextSensitive"] = 1] = "SkipContextSensitive"; + CheckMode[CheckMode["Inferential"] = 2] = "Inferential"; + })(CheckMode || (CheckMode = {})); var builtinGlobals = ts.createMap(); - builtinGlobals[undefinedSymbol.name] = undefinedSymbol; + builtinGlobals.set(undefinedSymbol.name, undefinedSymbol); initializeTypeChecker(); return checker; function getJsxNamespace() { @@ -24450,7 +25816,12 @@ var ts; } function createSymbol(flags, name) { symbolCount++; - return new Symbol(flags, name); + var symbol = (new Symbol(flags | 134217728 /* Transient */, name)); + symbol.checkFlags = 0; + return symbol; + } + function isTransientSymbol(symbol) { + return (symbol.flags & 134217728 /* Transient */) !== 0; } function getExcludedSymbolFlags(flags) { var result = 0; @@ -24496,7 +25867,7 @@ var ts; mergedSymbols[source.mergeId] = target; } function cloneSymbol(symbol) { - var result = createSymbol(symbol.flags | 33554432 /* Merged */, symbol.name); + var result = createSymbol(symbol.flags, symbol.name); result.declarations = symbol.declarations.slice(0); result.parent = symbol.parent; if (symbol.valueDeclaration) @@ -24519,13 +25890,11 @@ var ts; target.flags |= source.flags; if (source.valueDeclaration && (!target.valueDeclaration || - (target.valueDeclaration.kind === 230 /* ModuleDeclaration */ && source.valueDeclaration.kind !== 230 /* ModuleDeclaration */))) { + (target.valueDeclaration.kind === 232 /* ModuleDeclaration */ && source.valueDeclaration.kind !== 232 /* ModuleDeclaration */))) { // other kinds of value declarations take precedence over modules target.valueDeclaration = source.valueDeclaration; } - ts.forEach(source.declarations, function (node) { - target.declarations.push(node); - }); + ts.addRange(target.declarations, source.declarations); if (source.members) { if (!target.members) target.members = ts.createMap(); @@ -24538,6 +25907,9 @@ var ts; } recordMergedSymbol(target, source); } + else if (target.flags & 1024 /* NamespaceModule */) { + error(source.valueDeclaration.name, ts.Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target)); + } else { var message_2 = target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; @@ -24550,18 +25922,19 @@ var ts; } } function mergeSymbolTable(target, source) { - for (var id in source) { - var targetSymbol = target[id]; + source.forEach(function (sourceSymbol, id) { + var targetSymbol = target.get(id); if (!targetSymbol) { - target[id] = source[id]; + target.set(id, sourceSymbol); } else { - if (!(targetSymbol.flags & 33554432 /* Merged */)) { - target[id] = targetSymbol = cloneSymbol(targetSymbol); + if (!(targetSymbol.flags & 134217728 /* Transient */)) { + targetSymbol = cloneSymbol(targetSymbol); + target.set(id, targetSymbol); } - mergeSymbol(targetSymbol, source[id]); + mergeSymbol(targetSymbol, sourceSymbol); } - } + }); } function mergeModuleAugmentation(moduleName) { var moduleAugmentation = moduleName.parent; @@ -24590,7 +25963,7 @@ var ts; if (mainModule.flags & 1920 /* Namespace */) { // if module symbol has already been merged - it is safe to use it. // otherwise clone it - mainModule = mainModule.flags & 33554432 /* Merged */ ? mainModule : cloneSymbol(mainModule); + mainModule = mainModule.flags & 134217728 /* Transient */ ? mainModule : cloneSymbol(mainModule); mergeSymbol(mainModule, moduleAugmentation.symbol); } else { @@ -24599,21 +25972,22 @@ var ts; } } function addToSymbolTable(target, source, message) { - for (var id in source) { - if (target[id]) { + source.forEach(function (sourceSymbol, id) { + var targetSymbol = target.get(id); + if (targetSymbol) { // Error on redeclarations - ts.forEach(target[id].declarations, addDeclarationDiagnostic(id, message)); + ts.forEach(targetSymbol.declarations, addDeclarationDiagnostic(id, message)); } else { - target[id] = source[id]; + target.set(id, sourceSymbol); } - } + }); function addDeclarationDiagnostic(id, message) { return function (declaration) { return diagnostics.add(ts.createDiagnosticForNode(declaration, message, id)); }; } } function getSymbolLinks(symbol) { - if (symbol.flags & 67108864 /* Transient */) + if (symbol.flags & 134217728 /* Transient */) return symbol; var id = getSymbolId(symbol); return symbolLinks[id] || (symbolLinks[id] = {}); @@ -24625,14 +25999,17 @@ var ts; function getObjectFlags(type) { return type.flags & 32768 /* Object */ ? type.objectFlags : 0; } + function getCheckFlags(symbol) { + return symbol.flags & 134217728 /* Transient */ ? symbol.checkFlags : 0; + } function isGlobalSourceFile(node) { - return node.kind === 261 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 264 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { - var symbol = symbols[name]; + var symbol = symbols.get(name); if (symbol) { - ts.Debug.assert((symbol.flags & 16777216 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); if (symbol.flags & meaning) { return symbol; } @@ -24669,12 +26046,12 @@ var ts; if (declarationFile !== useFile) { if ((modulekind && (declarationFile.externalModuleIndicator || useFile.externalModuleIndicator)) || (!compilerOptions.outFile && !compilerOptions.out)) { - // nodes are in different files and order cannot be determines + // nodes are in different files and order cannot be determined return true; } // declaration is after usage // can be legal if usage is deferred (i.e. inside function or in initializer of instance property) - if (isUsedInFunctionOrNonStaticProperty(usage)) { + if (isUsedInFunctionOrInstanceProperty(usage, declaration)) { return true; } var sourceFiles = host.getSourceFiles(); @@ -24682,20 +26059,41 @@ var ts; } if (declaration.pos <= usage.pos) { // declaration is before usage - // still might be illegal if usage is in the initializer of the variable declaration - return declaration.kind !== 223 /* VariableDeclaration */ || - !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); + if (declaration.kind === 175 /* BindingElement */) { + // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2]) + var errorBindingElement = ts.getAncestor(usage, 175 /* BindingElement */); + if (errorBindingElement) { + return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || + declaration.pos < errorBindingElement.pos; + } + // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a) + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 225 /* VariableDeclaration */), usage); + } + else if (declaration.kind === 225 /* VariableDeclaration */) { + // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) + return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); + } + return true; + } + // declaration is after usage, but it can still be legal if usage is deferred: + // 1. inside an export specifier + // 2. inside a function + // 3. inside an instance property initializer, a reference to a non-instance property + // 4. inside a static property initializer, a reference to a static method in the same class + // or if usage is in a type context: + // 1. inside a type query (typeof in type position) + if (usage.parent.kind === 245 /* ExportSpecifier */) { + // export specifiers do not use the variable, they only make it available for use + return true; } - // declaration is after usage - // can be legal if usage is deferred (i.e. inside function or in initializer of instance property) var container = ts.getEnclosingBlockScopeContainer(declaration); - return isUsedInFunctionOrNonStaticProperty(usage, container); + return isInTypeQuery(usage) || isUsedInFunctionOrInstanceProperty(usage, declaration, container); function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 205 /* VariableStatement */: - case 211 /* ForStatement */: - case 213 /* ForOfStatement */: + case 207 /* VariableStatement */: + case 213 /* ForStatement */: + case 215 /* ForOfStatement */: // variable statement/for/for-of statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) if (isSameScopeDescendentOf(usage, declaration, container)) { @@ -24704,8 +26102,8 @@ var ts; break; } switch (declaration.parent.parent.kind) { - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: // ForIn/ForOf case - use site should not be used in expression part if (isSameScopeDescendentOf(usage, declaration.parent.parent.expression, container)) { return true; @@ -24713,25 +26111,31 @@ var ts; } return false; } - function isUsedInFunctionOrNonStaticProperty(usage, container) { - var current = usage; - while (current) { + function isUsedInFunctionOrInstanceProperty(usage, declaration, container) { + return !!ts.findAncestor(usage, function (current) { if (current === container) { - return false; + return "quit"; } if (ts.isFunctionLike(current)) { return true; } - var initializerOfNonStaticProperty = current.parent && - current.parent.kind === 147 /* PropertyDeclaration */ && - (ts.getModifierFlags(current.parent) & 32 /* Static */) === 0 && + var initializerOfProperty = current.parent && + current.parent.kind === 148 /* PropertyDeclaration */ && current.parent.initializer === current; - if (initializerOfNonStaticProperty) { - return true; + if (initializerOfProperty) { + if (ts.getModifierFlags(current.parent) & 32 /* Static */) { + if (declaration.kind === 150 /* MethodDeclaration */) { + return true; + } + } + else { + var isDeclarationInstanceProperty = declaration.kind === 148 /* PropertyDeclaration */ && !(ts.getModifierFlags(declaration) & 32 /* Static */); + if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { + return true; + } + } } - current = current.parent; - } - return false; + }); } } // Resolve a given name for a given meaning at a given location. An error is reported if the name was not found and @@ -24756,11 +26160,11 @@ var ts; // - parameters are only in the scope of function body // This restriction does not apply to JSDoc comment types because they are parented // at a higher level than type parameters would normally be - if (meaning & result.flags & 793064 /* Type */ && lastLocation.kind !== 278 /* JSDocComment */) { + if (meaning & result.flags & 793064 /* Type */ && lastLocation.kind !== 282 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ ? lastLocation === location.type || - lastLocation.kind === 144 /* Parameter */ || - lastLocation.kind === 143 /* TypeParameter */ + lastLocation.kind === 145 /* Parameter */ || + lastLocation.kind === 144 /* TypeParameter */ : false; } if (meaning & 107455 /* Value */ && result.flags & 1 /* FunctionScopedVariable */) { @@ -24769,9 +26173,9 @@ var ts; // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 144 /* Parameter */ || + lastLocation.kind === 145 /* Parameter */ || (lastLocation === location.type && - result.valueDeclaration.kind === 144 /* Parameter */); + result.valueDeclaration.kind === 145 /* Parameter */); } } if (useResult) { @@ -24783,16 +26187,17 @@ var ts; } } switch (location.kind) { - case 261 /* SourceFile */: + case 264 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; - case 230 /* ModuleDeclaration */: + // falls through + case 232 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports; - if (location.kind === 261 /* SourceFile */ || ts.isAmbientModule(location)) { + if (location.kind === 264 /* SourceFile */ || ts.isAmbientModule(location)) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. - if (result = moduleExports["default"]) { + if (result = moduleExports.get("default")) { var localSymbol = ts.getLocalSymbolForExportDefault(result); if (localSymbol && (result.flags & meaning) && localSymbol.name === name) { break loop; @@ -24810,9 +26215,10 @@ var ts; // 2. We check === SymbolFlags.Alias in order to check that the symbol is *purely* // an alias. If we used &, we'd be throwing out symbols that have non alias aspects, // which is not the desired behavior. - if (moduleExports[name] && - moduleExports[name].flags === 8388608 /* Alias */ && - ts.getDeclarationOfKind(moduleExports[name], 243 /* ExportSpecifier */)) { + var moduleExport = moduleExports.get(name); + if (moduleExport && + moduleExport.flags === 8388608 /* Alias */ && + ts.getDeclarationOfKind(moduleExport, 245 /* ExportSpecifier */)) { break; } } @@ -24820,13 +26226,13 @@ var ts; break loop; } break; - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -24843,10 +26249,15 @@ var ts; } } break; - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 229 /* InterfaceDeclaration */: if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793064 /* Type */)) { + if (!isTypeParameterSymbolDeclaredInContainer(result, location)) { + // ignore type parameters not declared in this container + result = undefined; + break; + } if (lastLocation && ts.getModifierFlags(lastLocation) & 32 /* Static */) { // TypeScript 1.0 spec (April 2014): 3.4.1 // The scope of a type parameter extends over the entire declaration with which the type @@ -24856,7 +26267,7 @@ var ts; } break loop; } - if (location.kind === 197 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 198 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.text) { result = location.symbol; @@ -24872,9 +26283,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 142 /* ComputedPropertyName */: + case 143 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 227 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 229 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = getSymbol(getSymbolOfNode(grandparent).members, name, meaning & 793064 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -24882,19 +26293,19 @@ var ts; } } break; - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 225 /* FunctionDeclaration */: - case 185 /* ArrowFunction */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 227 /* FunctionDeclaration */: + case 186 /* ArrowFunction */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 184 /* FunctionExpression */: + case 185 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -24907,7 +26318,7 @@ var ts; } } break; - case 145 /* Decorator */: + case 146 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -24916,7 +26327,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 144 /* Parameter */) { + if (location.parent && location.parent.kind === 145 /* Parameter */) { location = location.parent; } // @@ -24945,7 +26356,8 @@ var ts; !checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && !checkAndReportErrorForExtendingInterface(errorLocation) && !checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) && - !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning)) { + !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) && + !checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning)) { error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); } } @@ -24967,31 +26379,41 @@ var ts; // interface bar {} // } // const foo/*1*/: foo/*2*/.bar; - // The foo at /*1*/ and /*2*/ will share same symbol with two meaning - // block - scope variable and namespace module. However, only when we + // The foo at /*1*/ and /*2*/ will share same symbol with two meanings: + // block-scoped variable and namespace module. However, only when we // try to resolve name in /*1*/ which is used in variable position, - // we want to check for block- scoped - if (meaning & 2 /* BlockScopedVariable */) { + // we want to check for block-scoped + if (meaning & 2 /* BlockScopedVariable */ || + ((meaning & 32 /* Class */ || meaning & 384 /* Enum */) && (meaning & 107455 /* Value */) === 107455 /* Value */)) { var exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result); - if (exportOrLocalSymbol.flags & 2 /* BlockScopedVariable */) { + if (exportOrLocalSymbol.flags & 2 /* BlockScopedVariable */ || exportOrLocalSymbol.flags & 32 /* Class */ || exportOrLocalSymbol.flags & 384 /* Enum */) { checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation); } } // If we're in an external module, we can't reference value symbols created from UMD export declarations if (result && isInExternalModule && (meaning & 107455 /* Value */) === 107455 /* Value */) { var decls = result.declarations; - if (decls && decls.length === 1 && decls[0].kind === 233 /* NamespaceExportDeclaration */) { + if (decls && decls.length === 1 && decls[0].kind === 235 /* NamespaceExportDeclaration */) { error(errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, name); } } } return result; } + function isTypeParameterSymbolDeclaredInContainer(symbol, container) { + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + if (decl.kind === 144 /* TypeParameter */ && decl.parent === container) { + return true; + } + } + return false; + } function checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) { if ((errorLocation.kind === 70 /* Identifier */ && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) { return false; } - var container = ts.getThisContainer(errorLocation, /* includeArrowFunctions */ true); + var container = ts.getThisContainer(errorLocation, /*includeArrowFunctions*/ true); var location = container; while (location) { if (ts.isClassLike(location.parent)) { @@ -25034,9 +26456,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 70 /* Identifier */: - case 177 /* PropertyAccessExpression */: + case 178 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 199 /* ExpressionWithTypeArguments */: + case 200 /* ExpressionWithTypeArguments */: ts.Debug.assert(ts.isEntityNameExpression(node.expression)); return node.expression; default: @@ -25063,13 +26485,38 @@ var ts; } return false; } + function checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) { + if (meaning & (107455 /* Value */ & ~1024 /* NamespaceModule */ & ~793064 /* Type */)) { + var symbol = resolveSymbol(resolveName(errorLocation, name, 1024 /* NamespaceModule */ & ~107455 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined)); + if (symbol) { + error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_value, name); + return true; + } + } + else if (meaning & (793064 /* Type */ & ~1024 /* NamespaceModule */ & ~107455 /* Value */)) { + var symbol = resolveSymbol(resolveName(errorLocation, name, 1024 /* NamespaceModule */ & ~793064 /* Type */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined)); + if (symbol) { + error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_type, name); + return true; + } + } + return false; + } function checkResolvedBlockScopedVariable(result, errorLocation) { - ts.Debug.assert((result.flags & 2 /* BlockScopedVariable */) !== 0); + ts.Debug.assert(!!(result.flags & 2 /* BlockScopedVariable */ || result.flags & 32 /* Class */ || result.flags & 384 /* Enum */)); // Block-scoped variables cannot be used before their definition - var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; }); - ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); - if (!ts.isInAmbientContext(declaration) && !isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 223 /* VariableDeclaration */), errorLocation)) { - error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 231 /* EnumDeclaration */) ? d : undefined; }); + ts.Debug.assert(declaration !== undefined, "Declaration to checkResolvedBlockScopedVariable is undefined"); + if (!ts.isInAmbientContext(declaration) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { + if (result.flags & 2 /* BlockScopedVariable */) { + error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + } + else if (result.flags & 32 /* Class */) { + error(errorLocation, ts.Diagnostics.Class_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + } + else if (result.flags & 384 /* Enum */) { + error(errorLocation, ts.Diagnostics.Enum_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + } } } /* Starting from 'initial' node walk up the parent chain until 'stopAt' node is reached. @@ -25077,56 +26524,50 @@ var ts; * Return false if 'stopAt' node is reached or isFunctionLike(current) === true. */ function isSameScopeDescendentOf(initial, parent, stopAt) { - if (!parent) { - return false; - } - for (var current = initial; current && current !== stopAt && !ts.isFunctionLike(current); current = current.parent) { - if (current === parent) { - return true; - } - } - return false; + return parent && !!ts.findAncestor(initial, function (n) { return n === stopAt || ts.isFunctionLike(n) ? "quit" : n === parent; }); } function getAnyImportSyntax(node) { if (ts.isAliasSymbolDeclaration(node)) { - if (node.kind === 234 /* ImportEqualsDeclaration */) { + if (node.kind === 236 /* ImportEqualsDeclaration */) { return node; } - while (node && node.kind !== 235 /* ImportDeclaration */) { - node = node.parent; - } - return node; + return ts.findAncestor(node, function (n) { return n.kind === 237 /* ImportDeclaration */; }); } } function getDeclarationOfAliasSymbol(symbol) { - return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); + return ts.find(symbol.declarations, ts.isAliasSymbolDeclaration); } - function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 245 /* ExternalModuleReference */) { + function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { + if (node.moduleReference.kind === 247 /* ExternalModuleReference */) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } - return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference); + return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias); } - function getTargetOfImportClause(node) { + function getTargetOfImportClause(node, dontResolveAlias) { var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { - var exportDefaultSymbol = ts.isShorthandAmbientModuleSymbol(moduleSymbol) ? - moduleSymbol : - moduleSymbol.exports["export="] ? - getPropertyOfType(getTypeOfSymbol(moduleSymbol.exports["export="]), "default") : - resolveSymbol(moduleSymbol.exports["default"]); + var exportDefaultSymbol = void 0; + if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { + exportDefaultSymbol = moduleSymbol; + } + else { + var exportValue = moduleSymbol.exports.get("export="); + exportDefaultSymbol = exportValue + ? getPropertyOfType(getTypeOfSymbol(exportValue), "default") + : resolveSymbol(moduleSymbol.exports.get("default"), dontResolveAlias); + } if (!exportDefaultSymbol && !allowSyntheticDefaultImports) { error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); } else if (!exportDefaultSymbol && allowSyntheticDefaultImports) { - return resolveExternalModuleSymbol(moduleSymbol) || resolveSymbol(moduleSymbol); + return resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); } return exportDefaultSymbol; } } - function getTargetOfNamespaceImport(node) { + function getTargetOfNamespaceImport(node, dontResolveAlias) { var moduleSpecifier = node.parent.parent.moduleSpecifier; - return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier); + return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier, dontResolveAlias); } // This function creates a synthetic symbol that combines the value side of one symbol with the // type/namespace side of another symbol. Consider this example: @@ -25161,12 +26602,9 @@ var ts; result.exports = valueSymbol.exports; return result; } - function getExportOfModule(symbol, name) { + function getExportOfModule(symbol, name, dontResolveAlias) { if (symbol.flags & 1536 /* Module */) { - var exportedSymbol = getExportsOfSymbol(symbol)[name]; - if (exportedSymbol) { - return resolveSymbol(exportedSymbol); - } + return resolveSymbol(getExportsOfSymbol(symbol).get(name), dontResolveAlias); } } function getPropertyOfVariable(symbol, name) { @@ -25177,74 +26615,75 @@ var ts; } } } - function getExternalModuleMember(node, specifier) { + function getExternalModuleMember(node, specifier, dontResolveAlias) { var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); - var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier); + var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier, dontResolveAlias); if (targetSymbol) { - var name_16 = specifier.propertyName || specifier.name; - if (name_16.text) { + var name = specifier.propertyName || specifier.name; + if (name.text) { if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { return moduleSymbol; } var symbolFromVariable = void 0; // First check if module was specified with "export=". If so, get the member from the resolved type - if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports["export="]) { - symbolFromVariable = getPropertyOfType(getTypeOfSymbol(targetSymbol), name_16.text); + if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports.get("export=")) { + symbolFromVariable = getPropertyOfType(getTypeOfSymbol(targetSymbol), name.text); } else { - symbolFromVariable = getPropertyOfVariable(targetSymbol, name_16.text); + symbolFromVariable = getPropertyOfVariable(targetSymbol, name.text); } // if symbolFromVariable is export - get its final target - symbolFromVariable = resolveSymbol(symbolFromVariable); - var symbolFromModule = getExportOfModule(targetSymbol, name_16.text); + symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias); + var symbolFromModule = getExportOfModule(targetSymbol, name.text, dontResolveAlias); // If the export member we're looking for is default, and there is no real default but allowSyntheticDefaultImports is on, return the entire module as the default - if (!symbolFromModule && allowSyntheticDefaultImports && name_16.text === "default") { - symbolFromModule = resolveExternalModuleSymbol(moduleSymbol) || resolveSymbol(moduleSymbol); + if (!symbolFromModule && allowSyntheticDefaultImports && name.text === "default") { + symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); } var symbol = symbolFromModule && symbolFromVariable ? combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) : symbolFromModule || symbolFromVariable; if (!symbol) { - error(name_16, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name_16)); + error(name, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name)); } return symbol; } } } - function getTargetOfImportSpecifier(node) { - return getExternalModuleMember(node.parent.parent.parent, node); + function getTargetOfImportSpecifier(node, dontResolveAlias) { + return getExternalModuleMember(node.parent.parent.parent, node, dontResolveAlias); } - function getTargetOfNamespaceExportDeclaration(node) { - return resolveExternalModuleSymbol(node.parent.symbol); + function getTargetOfNamespaceExportDeclaration(node, dontResolveAlias) { + return resolveExternalModuleSymbol(node.parent.symbol, dontResolveAlias); } - function getTargetOfExportSpecifier(node) { + function getTargetOfExportSpecifier(node, dontResolveAlias) { return node.parent.parent.moduleSpecifier ? - getExternalModuleMember(node.parent.parent, node) : - resolveEntityName(node.propertyName || node.name, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */); + getExternalModuleMember(node.parent.parent, node, dontResolveAlias) : + resolveEntityName(node.propertyName || node.name, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } - function getTargetOfExportAssignment(node) { - return resolveEntityName(node.expression, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */); + function getTargetOfExportAssignment(node, dontResolveAlias) { + return resolveEntityName(node.expression, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } - function getTargetOfAliasDeclaration(node) { + function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { switch (node.kind) { - case 234 /* ImportEqualsDeclaration */: - return getTargetOfImportEqualsDeclaration(node); - case 236 /* ImportClause */: - return getTargetOfImportClause(node); - case 237 /* NamespaceImport */: - return getTargetOfNamespaceImport(node); - case 239 /* ImportSpecifier */: - return getTargetOfImportSpecifier(node); - case 243 /* ExportSpecifier */: - return getTargetOfExportSpecifier(node); - case 240 /* ExportAssignment */: - return getTargetOfExportAssignment(node); - case 233 /* NamespaceExportDeclaration */: - return getTargetOfNamespaceExportDeclaration(node); + case 236 /* ImportEqualsDeclaration */: + return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); + case 238 /* ImportClause */: + return getTargetOfImportClause(node, dontRecursivelyResolve); + case 239 /* NamespaceImport */: + return getTargetOfNamespaceImport(node, dontRecursivelyResolve); + case 241 /* ImportSpecifier */: + return getTargetOfImportSpecifier(node, dontRecursivelyResolve); + case 245 /* ExportSpecifier */: + return getTargetOfExportSpecifier(node, dontRecursivelyResolve); + case 242 /* ExportAssignment */: + return getTargetOfExportAssignment(node, dontRecursivelyResolve); + case 235 /* NamespaceExportDeclaration */: + return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); } } - function resolveSymbol(symbol) { - return symbol && symbol.flags & 8388608 /* Alias */ && !(symbol.flags & (107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */)) ? resolveAlias(symbol) : symbol; + function resolveSymbol(symbol, dontResolveAlias) { + var shouldResolve = !dontResolveAlias && symbol && symbol.flags & 8388608 /* Alias */ && !(symbol.flags & (107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */)); + return shouldResolve ? resolveAlias(symbol) : symbol; } function resolveAlias(symbol) { ts.Debug.assert((symbol.flags & 8388608 /* Alias */) !== 0, "Should only get Alias here."); @@ -25286,11 +26725,11 @@ var ts; links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); ts.Debug.assert(!!node); - if (node.kind === 240 /* ExportAssignment */) { + if (node.kind === 242 /* ExportAssignment */) { // export default checkExpressionCached(node.expression); } - else if (node.kind === 243 /* ExportSpecifier */) { + else if (node.kind === 245 /* ExportSpecifier */) { // export { } or export { as foo } checkExpressionCached(node.propertyName || node.name); } @@ -25312,20 +26751,22 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 70 /* Identifier */ || entityName.parent.kind === 141 /* QualifiedName */) { + if (entityName.kind === 70 /* Identifier */ || entityName.parent.kind === 142 /* QualifiedName */) { return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 234 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 236 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } function getFullyQualifiedName(symbol) { return symbol.parent ? getFullyQualifiedName(symbol.parent) + "." + symbolToString(symbol) : symbolToString(symbol); } - // Resolves a qualified name and any involved aliases + /** + * Resolves a qualified name and any involved aliases. + */ function resolveEntityName(name, meaning, ignoreErrors, dontResolveAlias, location) { if (ts.nodeIsMissing(name)) { return undefined; @@ -25338,9 +26779,23 @@ var ts; return undefined; } } - else if (name.kind === 141 /* QualifiedName */ || name.kind === 177 /* PropertyAccessExpression */) { - var left = name.kind === 141 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 141 /* QualifiedName */ ? name.right : name.name; + else if (name.kind === 142 /* QualifiedName */ || name.kind === 178 /* PropertyAccessExpression */) { + var left = void 0; + if (name.kind === 142 /* QualifiedName */) { + left = name.left; + } + else if (name.kind === 178 /* PropertyAccessExpression */ && + (name.expression.kind === 184 /* ParenthesizedExpression */ || ts.isEntityNameExpression(name.expression))) { + left = name.expression; + } + else { + // If the expression in property-access expression is not entity-name or parenthsizedExpression (e.g. it is a call expression), it won't be able to successfully resolve the name. + // This is the case when we are trying to do any language service operation in heritage clauses. By return undefined, the getSymbolOfEntityNameOrPropertyAccessExpression + // will attempt to checkPropertyAccessExpression to resolve symbol. + // i.e class C extends foo()./*do language service operation here*/B {} + return undefined; + } + var right = name.kind === 142 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, 1920 /* Namespace */, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -25356,10 +26811,19 @@ var ts; return undefined; } } + else if (name.kind === 184 /* ParenthesizedExpression */) { + // If the expression in parenthesizedExpression is not an entity-name (e.g. it is a call expression), it won't be able to successfully resolve the name. + // This is the case when we are trying to do any language service operation in heritage clauses. + // By return undefined, the getSymbolOfEntityNameOrPropertyAccessExpression will attempt to checkPropertyAccessExpression to resolve symbol. + // i.e class C extends foo()./*do language service operation here*/B {} + return ts.isEntityNameExpression(name.expression) ? + resolveEntityName(name.expression, meaning, ignoreErrors, dontResolveAlias, location) : + undefined; + } else { ts.Debug.fail("Unknown entity name kind."); } - ts.Debug.assert((symbol.flags & 16777216 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); } function resolveExternalModuleName(location, moduleReferenceExpression) { @@ -25367,7 +26831,7 @@ var ts; } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } - if (moduleReferenceExpression.kind !== 9 /* StringLiteral */) { + if (moduleReferenceExpression.kind !== 9 /* StringLiteral */ && moduleReferenceExpression.kind !== 12 /* NoSubstitutionTemplateLiteral */) { return; } var moduleReferenceLiteral = moduleReferenceExpression; @@ -25409,11 +26873,10 @@ var ts; // May be an untyped module. If so, ignore resolutionDiagnostic. if (!isRelative && resolvedModule && !ts.extensionIsTypeScript(resolvedModule.extension)) { if (isForAugmentation) { - ts.Debug.assert(!!moduleNotFoundError); var diag = ts.Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented; - error(errorNode, diag, moduleName, resolvedModule.resolvedFileName); + error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName); } - else if (compilerOptions.noImplicitAny && moduleNotFoundError) { + else if (noImplicitAny && moduleNotFoundError) { error(errorNode, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedModule.resolvedFileName); } // Failed imports and untyped modules are both treated in an untyped manner; only difference is whether we give a diagnostic first. @@ -25439,30 +26902,38 @@ var ts; } // An external module with an 'export =' declaration resolves to the target of the 'export =' declaration, // and an external module with no 'export =' declaration resolves to the module itself. - function resolveExternalModuleSymbol(moduleSymbol) { - return moduleSymbol && getMergedSymbol(resolveSymbol(moduleSymbol.exports["export="])) || moduleSymbol; + function resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) { + return moduleSymbol && getMergedSymbol(resolveSymbol(moduleSymbol.exports.get("export="), dontResolveAlias)) || moduleSymbol; } // An external module with an 'export =' declaration may be referenced as an ES6 module provided the 'export =' // references a symbol that is at least declared as a module or a variable. The target of the 'export =' may // combine other declarations with the module or variable (e.g. a class/module, function/module, interface/variable). - function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression) { - var symbol = resolveExternalModuleSymbol(moduleSymbol); - if (symbol && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */))) { + function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression, dontResolveAlias) { + var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); + if (!dontResolveAlias && symbol && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */))) { error(moduleReferenceExpression, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); symbol = undefined; } return symbol; } function hasExportAssignmentSymbol(moduleSymbol) { - return moduleSymbol.exports["export="] !== undefined; + return moduleSymbol.exports.get("export=") !== undefined; } function getExportsOfModuleAsArray(moduleSymbol) { return symbolsToArray(getExportsOfModule(moduleSymbol)); } + function getExportsAndPropertiesOfModule(moduleSymbol) { + var exports = getExportsOfModuleAsArray(moduleSymbol); + var exportEquals = resolveExternalModuleSymbol(moduleSymbol); + if (exportEquals !== moduleSymbol) { + ts.addRange(exports, getPropertiesOfType(getTypeOfSymbol(exportEquals))); + } + return exports; + } function tryGetMemberInModuleExports(memberName, moduleSymbol) { var symbolTable = getExportsOfModule(moduleSymbol); if (symbolTable) { - return symbolTable[memberName]; + return symbolTable.get(memberName); } } function getExportsOfSymbol(symbol) { @@ -25477,24 +26948,28 @@ var ts; * Not passing `lookupTable` and `exportNode` disables this collection, and just extends the tables */ function extendExportSymbols(target, source, lookupTable, exportNode) { - for (var id in source) { - if (id !== "default" && !target[id]) { - target[id] = source[id]; + source && source.forEach(function (sourceSymbol, id) { + if (id === "default") + return; + var targetSymbol = target.get(id); + if (!targetSymbol) { + target.set(id, sourceSymbol); if (lookupTable && exportNode) { - lookupTable[id] = { + lookupTable.set(id, { specifierText: ts.getTextOfNode(exportNode.moduleSpecifier) - }; + }); } } - else if (lookupTable && exportNode && id !== "default" && target[id] && resolveSymbol(target[id]) !== resolveSymbol(source[id])) { - if (!lookupTable[id].exportsWithDuplicate) { - lookupTable[id].exportsWithDuplicate = [exportNode]; + else if (lookupTable && exportNode && targetSymbol && resolveSymbol(targetSymbol) !== resolveSymbol(sourceSymbol)) { + var collisionTracker = lookupTable.get(id); + if (!collisionTracker.exportsWithDuplicate) { + collisionTracker.exportsWithDuplicate = [exportNode]; } else { - lookupTable[id].exportsWithDuplicate.push(exportNode); + collisionTracker.exportsWithDuplicate.push(exportNode); } } - } + }); } function getExportsForModule(moduleSymbol) { var visitedSymbols = []; @@ -25510,27 +26985,27 @@ var ts; visitedSymbols.push(symbol); var symbols = ts.cloneMap(symbol.exports); // All export * declarations are collected in an __export symbol by the binder - var exportStars = symbol.exports["__export"]; + var exportStars = symbol.exports.get("__export"); if (exportStars) { var nestedSymbols = ts.createMap(); - var lookupTable = ts.createMap(); + var lookupTable_1 = ts.createMap(); for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) { var node = _a[_i]; var resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier); var exportedSymbols = visit(resolvedModule); - extendExportSymbols(nestedSymbols, exportedSymbols, lookupTable, node); + extendExportSymbols(nestedSymbols, exportedSymbols, lookupTable_1, node); } - for (var id in lookupTable) { - var exportsWithDuplicate = lookupTable[id].exportsWithDuplicate; + lookupTable_1.forEach(function (_a, id) { + var exportsWithDuplicate = _a.exportsWithDuplicate; // It's not an error if the file with multiple `export *`s with duplicate names exports a member with that name itself - if (id === "export=" || !(exportsWithDuplicate && exportsWithDuplicate.length) || symbols[id]) { - continue; + if (id === "export=" || !(exportsWithDuplicate && exportsWithDuplicate.length) || symbols.has(id)) { + return; } - for (var _b = 0, exportsWithDuplicate_1 = exportsWithDuplicate; _b < exportsWithDuplicate_1.length; _b++) { - var node = exportsWithDuplicate_1[_b]; - diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity, lookupTable[id].specifierText, id)); + for (var _i = 0, exportsWithDuplicate_1 = exportsWithDuplicate; _i < exportsWithDuplicate_1.length; _i++) { + var node = exportsWithDuplicate_1[_i]; + diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity, lookupTable_1.get(id).specifierText, id)); } - } + }); extendExportSymbols(symbols, nestedSymbols); } return symbols; @@ -25552,26 +27027,13 @@ var ts; : symbol; } function symbolIsValue(symbol) { - // If it is an instantiated symbol, then it is a value if the symbol it is an - // instantiation of is a value. - if (symbol.flags & 16777216 /* Instantiated */) { - return symbolIsValue(getSymbolLinks(symbol).target); - } - // If the symbol has the value flag, it is trivially a value. - if (symbol.flags & 107455 /* Value */) { - return true; - } - // If it is an alias, then it is a value if the symbol it resolves to is a value. - if (symbol.flags & 8388608 /* Alias */) { - return (resolveAlias(symbol).flags & 107455 /* Value */) !== 0; - } - return false; + return !!(symbol.flags & 107455 /* Value */ || symbol.flags & 8388608 /* Alias */ && resolveAlias(symbol).flags & 107455 /* Value */); } function findConstructorDeclaration(node) { var members = node.members; for (var _i = 0, members_1 = members; _i < members_1.length; _i++) { var member = members_1[_i]; - if (member.kind === 150 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 151 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -25599,6 +27061,9 @@ var ts; type.symbol = symbol; return type; } + function createTypeofType() { + return getUnionType(ts.convertToArray(typeofEQFacts.keys(), function (s) { return getLiteralTypeForText(32 /* StringLiteral */, s); })); + } // A reserved member name starts with two underscores, but the third character cannot be an underscore // or the @ symbol. A third underscore indicates an escaped form of an identifer that started // with at least two underscores. The @ character indicates that the name is denoted by a well known ES @@ -25611,16 +27076,15 @@ var ts; } function getNamedMembers(members) { var result; - for (var id in members) { + members.forEach(function (symbol, id) { if (!isReservedMemberName(id)) { if (!result) result = []; - var symbol = members[id]; if (symbolIsValue(symbol)) { result.push(symbol); } } - } + }); return result || emptyArray; } function setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) { @@ -25639,20 +27103,21 @@ var ts; } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; - for (var location_1 = enclosingDeclaration; location_1; location_1 = location_1.parent) { + for (var location = enclosingDeclaration; location; location = location.parent) { // Locals of a source file are not in scope (because they get merged into the global symbol table) - if (location_1.locals && !isGlobalSourceFile(location_1)) { - if (result = callback(location_1.locals)) { + if (location.locals && !isGlobalSourceFile(location)) { + if (result = callback(location.locals)) { return result; } } - switch (location_1.kind) { - case 261 /* SourceFile */: - if (!ts.isExternalOrCommonJsModule(location_1)) { + switch (location.kind) { + case 264 /* SourceFile */: + if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 230 /* ModuleDeclaration */: - if (result = callback(getSymbolOfNode(location_1).exports)) { + // falls through + case 232 /* ModuleDeclaration */: + if (result = callback(getSymbolOfNode(location).exports)) { return result; } break; @@ -25666,6 +27131,16 @@ var ts; } function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing) { function getAccessibleSymbolChainFromSymbolTable(symbols) { + return getAccessibleSymbolChainFromSymbolTableWorker(symbols, []); + } + function getAccessibleSymbolChainFromSymbolTableWorker(symbols, visitedSymbolTables) { + if (ts.contains(visitedSymbolTables, symbols)) { + return undefined; + } + visitedSymbolTables.push(symbols); + var result = trySymbolTable(symbols); + visitedSymbolTables.pop(); + return result; function canQualifySymbol(symbolFromSymbolTable, meaning) { // If the symbol is equivalent and doesn't need further qualification, this symbol is accessible if (!needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning)) { @@ -25684,31 +27159,33 @@ var ts; canQualifySymbol(symbolFromSymbolTable, meaning); } } - // If symbol is directly available by its name in the symbol table - if (isAccessible(symbols[symbol.name])) { - return [symbol]; - } - // Check if symbol is any of the alias - return ts.forEachProperty(symbols, function (symbolFromSymbolTable) { - if (symbolFromSymbolTable.flags & 8388608 /* Alias */ - && symbolFromSymbolTable.name !== "export=" - && !ts.getDeclarationOfKind(symbolFromSymbolTable, 243 /* ExportSpecifier */)) { - if (!useOnlyExternalAliasing || - // Is this external alias, then use it to name - ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { - var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); - if (isAccessible(symbolFromSymbolTable, resolveAlias(symbolFromSymbolTable))) { - return [symbolFromSymbolTable]; - } - // Look in the exported members, if we can find accessibleSymbolChain, symbol is accessible using this chain - // but only if the symbolFromSymbolTable can be qualified - var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; - if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { - return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); + function trySymbolTable(symbols) { + // If symbol is directly available by its name in the symbol table + if (isAccessible(symbols.get(symbol.name))) { + return [symbol]; + } + // Check if symbol is any of the alias + return ts.forEachEntry(symbols, function (symbolFromSymbolTable) { + if (symbolFromSymbolTable.flags & 8388608 /* Alias */ + && symbolFromSymbolTable.name !== "export=" + && !ts.getDeclarationOfKind(symbolFromSymbolTable, 245 /* ExportSpecifier */)) { + if (!useOnlyExternalAliasing || + // Is this external alias, then use it to name + ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { + var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); + if (isAccessible(symbolFromSymbolTable, resolveAlias(symbolFromSymbolTable))) { + return [symbolFromSymbolTable]; + } + // Look in the exported members, if we can find accessibleSymbolChain, symbol is accessible using this chain + // but only if the symbolFromSymbolTable can be qualified + var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTableWorker(resolvedImportedSymbol.exports, visitedSymbolTables) : undefined; + if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { + return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); + } } } - } - }); + }); + } } if (symbol) { if (!(isPropertyOrMethodDeclarationSymbol(symbol))) { @@ -25720,7 +27197,7 @@ var ts; var qualify = false; forEachSymbolTableInScope(enclosingDeclaration, function (symbolTable) { // If symbol of this name is not available in the symbol table we are ok - var symbolFromSymbolTable = symbolTable[symbol.name]; + var symbolFromSymbolTable = symbolTable.get(symbol.name); if (!symbolFromSymbolTable) { // Continue to the next symbol table return false; @@ -25731,7 +27208,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 243 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 245 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -25746,10 +27223,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 147 /* PropertyDeclaration */: - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 148 /* PropertyDeclaration */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: continue; default: return false; @@ -25822,15 +27299,12 @@ var ts; } return { accessibility: 0 /* Accessible */ }; function getExternalModuleContainer(declaration) { - for (; declaration; declaration = declaration.parent) { - if (hasExternalModuleSymbol(declaration)) { - return getSymbolOfNode(declaration); - } - } + var node = ts.findAncestor(declaration, hasExternalModuleSymbol); + return node && getSymbolOfNode(node); } } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 261 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 264 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -25871,12 +27345,12 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 160 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { + if (entityName.parent.kind === 161 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { // Typeof value meaning = 107455 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 141 /* QualifiedName */ || entityName.kind === 177 /* PropertyAccessExpression */ || - entityName.parent.kind === 234 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 142 /* QualifiedName */ || entityName.kind === 178 /* PropertyAccessExpression */ || + entityName.parent.kind === 236 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; @@ -25928,6 +27402,516 @@ var ts; } return result; } + function createNodeBuilder() { + var context; + return { + typeToTypeNode: function (type, enclosingDeclaration, flags) { + context = createNodeBuilderContext(enclosingDeclaration, flags); + var resultingNode = typeToTypeNodeHelper(type); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + indexInfoToIndexSignatureDeclaration: function (indexInfo, kind, enclosingDeclaration, flags) { + context = createNodeBuilderContext(enclosingDeclaration, flags); + var resultingNode = indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + signatureToSignatureDeclaration: function (signature, kind, enclosingDeclaration, flags) { + context = createNodeBuilderContext(enclosingDeclaration, flags); + var resultingNode = signatureToSignatureDeclarationHelper(signature, kind); + var result = context.encounteredError ? undefined : resultingNode; + return result; + } + }; + function createNodeBuilderContext(enclosingDeclaration, flags) { + return { + enclosingDeclaration: enclosingDeclaration, + flags: flags, + encounteredError: false, + inObjectTypeLiteral: false, + checkAlias: true, + symbolStack: undefined + }; + } + function typeToTypeNodeHelper(type) { + if (!type) { + context.encounteredError = true; + // TODO(aozgaa): should we return implict any (undefined) or explicit any (keywordtypenode)? + return undefined; + } + if (type.flags & 1 /* Any */) { + return ts.createKeywordTypeNode(118 /* AnyKeyword */); + } + if (type.flags & 2 /* String */) { + return ts.createKeywordTypeNode(135 /* StringKeyword */); + } + if (type.flags & 4 /* Number */) { + return ts.createKeywordTypeNode(132 /* NumberKeyword */); + } + if (type.flags & 8 /* Boolean */) { + return ts.createKeywordTypeNode(121 /* BooleanKeyword */); + } + if (type.flags & 16 /* Enum */) { + var name = symbolToName(type.symbol, /*expectsIdentifier*/ false); + return ts.createTypeReferenceNode(name, /*typeArguments*/ undefined); + } + if (type.flags & (32 /* StringLiteral */)) { + return ts.createLiteralTypeNode((ts.createLiteral(type.text))); + } + if (type.flags & (64 /* NumberLiteral */)) { + return ts.createLiteralTypeNode((ts.createNumericLiteral(type.text))); + } + if (type.flags & 128 /* BooleanLiteral */) { + return type.intrinsicName === "true" ? ts.createTrue() : ts.createFalse(); + } + if (type.flags & 256 /* EnumLiteral */) { + var name = symbolToName(type.symbol, /*expectsIdentifier*/ false); + return ts.createTypeReferenceNode(name, /*typeArguments*/ undefined); + } + if (type.flags & 1024 /* Void */) { + return ts.createKeywordTypeNode(104 /* VoidKeyword */); + } + if (type.flags & 2048 /* Undefined */) { + return ts.createKeywordTypeNode(138 /* UndefinedKeyword */); + } + if (type.flags & 4096 /* Null */) { + return ts.createKeywordTypeNode(94 /* NullKeyword */); + } + if (type.flags & 8192 /* Never */) { + return ts.createKeywordTypeNode(129 /* NeverKeyword */); + } + if (type.flags & 512 /* ESSymbol */) { + return ts.createKeywordTypeNode(136 /* SymbolKeyword */); + } + if (type.flags & 16777216 /* NonPrimitive */) { + return ts.createKeywordTypeNode(133 /* ObjectKeyword */); + } + if (type.flags & 16384 /* TypeParameter */ && type.isThisType) { + if (context.inObjectTypeLiteral) { + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowThisInObjectLiteral)) { + context.encounteredError = true; + } + } + return ts.createThis(); + } + var objectFlags = getObjectFlags(type); + if (objectFlags & 4 /* Reference */) { + ts.Debug.assert(!!(type.flags & 32768 /* Object */)); + return typeReferenceToTypeNode(type); + } + if (objectFlags & 3 /* ClassOrInterface */) { + ts.Debug.assert(!!(type.flags & 32768 /* Object */)); + var name = symbolToName(type.symbol, /*expectsIdentifier*/ false); + // TODO(aozgaa): handle type arguments. + return ts.createTypeReferenceNode(name, /*typeArguments*/ undefined); + } + if (type.flags & 16384 /* TypeParameter */) { + var name = symbolToName(type.symbol, /*expectsIdentifier*/ false); + // Ignore constraint/default when creating a usage (as opposed to declaration) of a type parameter. + return ts.createTypeReferenceNode(name, /*typeArguments*/ undefined); + } + if (context.checkAlias && type.aliasSymbol) { + var name = symbolToName(type.aliasSymbol, /*expectsIdentifier*/ false); + var typeArgumentNodes = type.aliasTypeArguments && mapToTypeNodeArray(type.aliasTypeArguments); + return ts.createTypeReferenceNode(name, typeArgumentNodes); + } + context.checkAlias = false; + if (type.flags & 65536 /* Union */) { + var formattedUnionTypes = formatUnionTypes(type.types); + var unionTypeNodes = formattedUnionTypes && mapToTypeNodeArray(formattedUnionTypes); + if (unionTypeNodes && unionTypeNodes.length > 0) { + return ts.createUnionOrIntersectionTypeNode(165 /* UnionType */, unionTypeNodes); + } + else { + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowEmptyUnionOrIntersection)) { + context.encounteredError = true; + } + return undefined; + } + } + if (type.flags & 131072 /* Intersection */) { + return ts.createUnionOrIntersectionTypeNode(166 /* IntersectionType */, mapToTypeNodeArray(type.types)); + } + if (objectFlags & (16 /* Anonymous */ | 32 /* Mapped */)) { + ts.Debug.assert(!!(type.flags & 32768 /* Object */)); + // The type is an object literal type. + return createAnonymousTypeNode(type); + } + if (type.flags & 262144 /* Index */) { + var indexedType = type.type; + var indexTypeNode = typeToTypeNodeHelper(indexedType); + return ts.createTypeOperatorNode(indexTypeNode); + } + if (type.flags & 524288 /* IndexedAccess */) { + var objectTypeNode = typeToTypeNodeHelper(type.objectType); + var indexTypeNode = typeToTypeNodeHelper(type.indexType); + return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); + } + ts.Debug.fail("Should be unreachable."); + function mapToTypeNodeArray(types) { + var result = []; + for (var _i = 0, types_1 = types; _i < types_1.length; _i++) { + var type_1 = types_1[_i]; + var typeNode = typeToTypeNodeHelper(type_1); + if (typeNode) { + result.push(typeNode); + } + } + return result; + } + function createMappedTypeNodeFromType(type) { + ts.Debug.assert(!!(type.flags & 32768 /* Object */)); + var typeParameter = getTypeParameterFromMappedType(type); + var typeParameterNode = typeParameterToDeclaration(typeParameter); + var templateType = getTemplateTypeFromMappedType(type); + var templateTypeNode = typeToTypeNodeHelper(templateType); + var readonlyToken = type.declaration && type.declaration.readonlyToken ? ts.createToken(130 /* ReadonlyKeyword */) : undefined; + var questionToken = type.declaration && type.declaration.questionToken ? ts.createToken(54 /* QuestionToken */) : undefined; + return ts.createMappedTypeNode(readonlyToken, typeParameterNode, questionToken, templateTypeNode); + } + function createAnonymousTypeNode(type) { + var symbol = type.symbol; + if (symbol) { + // Always use 'typeof T' for type of class, enum, and module objects + if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) || + symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || + shouldWriteTypeOfFunctionSymbol()) { + return createTypeQueryNodeFromSymbol(symbol); + } + else if (ts.contains(context.symbolStack, symbol)) { + // If type is an anonymous type literal in a type alias declaration, use type alias name + var typeAlias = getTypeAliasForTypeLiteral(type); + if (typeAlias) { + // The specified symbol flags need to be reinterpreted as type flags + var entityName = symbolToName(typeAlias, /*expectsIdentifier*/ false); + return ts.createTypeReferenceNode(entityName, /*typeArguments*/ undefined); + } + else { + return ts.createKeywordTypeNode(118 /* AnyKeyword */); + } + } + else { + // Since instantiations of the same anonymous type have the same symbol, tracking symbols instead + // of types allows us to catch circular references to instantiations of the same anonymous type + if (!context.symbolStack) { + context.symbolStack = []; + } + context.symbolStack.push(symbol); + var result = createTypeNodeFromObjectType(type); + context.symbolStack.pop(); + return result; + } + } + else { + // Anonymous types without a symbol are never circular. + return createTypeNodeFromObjectType(type); + } + function shouldWriteTypeOfFunctionSymbol() { + var isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */ && + ts.forEach(symbol.declarations, function (declaration) { return ts.getModifierFlags(declaration) & 32 /* Static */; })); + var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && + (symbol.parent || + ts.forEach(symbol.declarations, function (declaration) { + return declaration.parent.kind === 264 /* SourceFile */ || declaration.parent.kind === 233 /* ModuleBlock */; + })); + if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { + // typeof is allowed only for static/non local functions + return ts.contains(context.symbolStack, symbol); // it is type of the symbol uses itself recursively + } + } + } + function createTypeNodeFromObjectType(type) { + if (type.objectFlags & 32 /* Mapped */) { + if (getConstraintTypeFromMappedType(type).flags & (16384 /* TypeParameter */ | 262144 /* Index */)) { + return createMappedTypeNodeFromType(type); + } + } + var resolved = resolveStructuredTypeMembers(type); + if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { + if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { + return ts.createTypeLiteralNode(/*members*/ undefined); + } + if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { + var signature = resolved.callSignatures[0]; + return signatureToSignatureDeclarationHelper(signature, 159 /* FunctionType */); + } + if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { + var signature = resolved.constructSignatures[0]; + return signatureToSignatureDeclarationHelper(signature, 160 /* ConstructorType */); + } + } + var saveInObjectTypeLiteral = context.inObjectTypeLiteral; + context.inObjectTypeLiteral = true; + var members = createTypeNodesFromResolvedType(resolved); + context.inObjectTypeLiteral = saveInObjectTypeLiteral; + return ts.createTypeLiteralNode(members); + } + function createTypeQueryNodeFromSymbol(symbol) { + var entityName = symbolToName(symbol, /*expectsIdentifier*/ false); + return ts.createTypeQueryNode(entityName); + } + function typeReferenceToTypeNode(type) { + var typeArguments = type.typeArguments || emptyArray; + if (type.target === globalArrayType) { + var elementType = typeToTypeNodeHelper(typeArguments[0]); + return ts.createArrayTypeNode(elementType); + } + else if (type.target.objectFlags & 8 /* Tuple */) { + if (typeArguments.length > 0) { + var tupleConstituentNodes = mapToTypeNodeArray(typeArguments.slice(0, getTypeReferenceArity(type))); + if (tupleConstituentNodes && tupleConstituentNodes.length > 0) { + return ts.createTupleTypeNode(tupleConstituentNodes); + } + } + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowEmptyTuple)) { + context.encounteredError = true; + } + return undefined; + } + else { + var outerTypeParameters = type.target.outerTypeParameters; + var i = 0; + var qualifiedName = undefined; + if (outerTypeParameters) { + var length_1 = outerTypeParameters.length; + while (i < length_1) { + // Find group of type arguments for type parameters with the same declaring container. + var start = i; + var parent = getParentSymbolOfTypeParameter(outerTypeParameters[i]); + do { + i++; + } while (i < length_1 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent); + // When type parameters are their own type arguments for the whole group (i.e. we have + // the default outer type arguments), we don't show the group. + if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { + var qualifiedNamePart = symbolToName(parent, /*expectsIdentifier*/ true); + if (!qualifiedName) { + qualifiedName = ts.createQualifiedName(qualifiedNamePart, /*right*/ undefined); + } + else { + ts.Debug.assert(!qualifiedName.right); + qualifiedName.right = qualifiedNamePart; + qualifiedName = ts.createQualifiedName(qualifiedName, /*right*/ undefined); + } + } + } + } + var entityName = undefined; + var nameIdentifier = symbolToName(type.symbol, /*expectsIdentifier*/ true); + if (qualifiedName) { + ts.Debug.assert(!qualifiedName.right); + qualifiedName.right = nameIdentifier; + entityName = qualifiedName; + } + else { + entityName = nameIdentifier; + } + var typeParameterCount = (type.target.typeParameters || emptyArray).length; + var typeArgumentNodes = ts.some(typeArguments) ? mapToTypeNodeArray(typeArguments.slice(i, typeParameterCount - i)) : undefined; + return ts.createTypeReferenceNode(entityName, typeArgumentNodes); + } + } + function createTypeNodesFromResolvedType(resolvedType) { + var typeElements = []; + for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { + var signature = _a[_i]; + typeElements.push(signatureToSignatureDeclarationHelper(signature, 154 /* CallSignature */)); + } + for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { + var signature = _c[_b]; + typeElements.push(signatureToSignatureDeclarationHelper(signature, 155 /* ConstructSignature */)); + } + if (resolvedType.stringIndexInfo) { + typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.stringIndexInfo, 0 /* String */)); + } + if (resolvedType.numberIndexInfo) { + typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.numberIndexInfo, 1 /* Number */)); + } + var properties = resolvedType.properties; + if (!properties) { + return typeElements; + } + for (var _d = 0, properties_2 = properties; _d < properties_2.length; _d++) { + var propertySymbol = properties_2[_d]; + var propertyType = getTypeOfSymbol(propertySymbol); + var oldDeclaration = propertySymbol.declarations && propertySymbol.declarations[0]; + if (!oldDeclaration) { + return; + } + var propertyName = oldDeclaration.name; + var optionalToken = propertySymbol.flags & 67108864 /* Optional */ ? ts.createToken(54 /* QuestionToken */) : undefined; + if (propertySymbol.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(propertyType).length) { + var signatures = getSignaturesOfType(propertyType, 0 /* Call */); + for (var _e = 0, signatures_1 = signatures; _e < signatures_1.length; _e++) { + var signature = signatures_1[_e]; + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 149 /* MethodSignature */); + methodDeclaration.name = propertyName; + methodDeclaration.questionToken = optionalToken; + typeElements.push(methodDeclaration); + } + } + else { + // TODO(aozgaa): should we create a node with explicit or implict any? + var propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType) : ts.createKeywordTypeNode(118 /* AnyKeyword */); + typeElements.push(ts.createPropertySignature(propertyName, optionalToken, propertyTypeNode, + /*initializer*/ undefined)); + } + } + return typeElements.length ? typeElements : undefined; + } + } + function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind) { + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 135 /* StringKeyword */ : 132 /* NumberKeyword */); + var name = ts.getNameFromIndexInfo(indexInfo); + var indexingParameter = ts.createParameter( + /*decorators*/ undefined, + /*modifiers*/ undefined, + /*dotDotDotToken*/ undefined, name, + /*questionToken*/ undefined, indexerTypeNode, + /*initializer*/ undefined); + var typeNode = typeToTypeNodeHelper(indexInfo.type); + return ts.createIndexSignatureDeclaration( + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(130 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + } + function signatureToSignatureDeclarationHelper(signature, kind) { + var typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter); }); + var parameters = signature.parameters.map(function (parameter) { return symbolToParameterDeclaration(parameter); }); + var returnTypeNode; + if (signature.typePredicate) { + var typePredicate = signature.typePredicate; + var parameterName = typePredicate.kind === 1 /* Identifier */ ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(); + var typeNode = typeToTypeNodeHelper(typePredicate.type); + returnTypeNode = ts.createTypePredicateNode(parameterName, typeNode); + } + else { + var returnType = getReturnTypeOfSignature(signature); + returnTypeNode = returnType && typeToTypeNodeHelper(returnType); + } + var returnTypeNodeExceptAny = returnTypeNode && returnTypeNode.kind !== 118 /* AnyKeyword */ ? returnTypeNode : undefined; + return ts.createSignatureDeclaration(kind, typeParameters, parameters, returnTypeNodeExceptAny); + } + function typeParameterToDeclaration(type) { + var constraint = getConstraintFromTypeParameter(type); + var constraintNode = constraint && typeToTypeNodeHelper(constraint); + var defaultParameter = getDefaultFromTypeParameter(type); + var defaultParameterNode = defaultParameter && typeToTypeNodeHelper(defaultParameter); + var name = symbolToName(type.symbol, /*expectsIdentifier*/ true); + return ts.createTypeParameterDeclaration(name, constraintNode, defaultParameterNode); + } + function symbolToParameterDeclaration(parameterSymbol) { + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 145 /* Parameter */); + var parameterType = getTypeOfSymbol(parameterSymbol); + var parameterTypeNode = typeToTypeNodeHelper(parameterType); + // TODO(aozgaa): In the future, check initializer accessibility. + var parameterNode = ts.createParameter(parameterDeclaration.decorators, parameterDeclaration.modifiers, parameterDeclaration.dotDotDotToken && ts.createToken(23 /* DotDotDotToken */), + // Clone name to remove trivia. + ts.getSynthesizedClone(parameterDeclaration.name), parameterDeclaration.questionToken && ts.createToken(54 /* QuestionToken */), parameterTypeNode, parameterDeclaration.initializer); + return parameterNode; + } + function symbolToName(symbol, expectsIdentifier) { + // Try to get qualified name if the symbol is not a type parameter and there is an enclosing declaration. + var chain; + var isTypeParameter = symbol.flags & 262144 /* TypeParameter */; + if (!isTypeParameter && context.enclosingDeclaration) { + chain = getSymbolChain(symbol, 0 /* None */, /*endOfChain*/ true); + ts.Debug.assert(chain && chain.length > 0); + } + else { + chain = [symbol]; + } + if (expectsIdentifier && chain.length !== 1 + && !context.encounteredError + && !(context.flags & ts.NodeBuilderFlags.allowQualifedNameInPlaceOfIdentifier)) { + context.encounteredError = true; + } + return createEntityNameFromSymbolChain(chain, chain.length - 1); + function createEntityNameFromSymbolChain(chain, index) { + ts.Debug.assert(chain && 0 <= index && index < chain.length); + // const parentIndex = index - 1; + var symbol = chain[index]; + var typeParameterString = ""; + if (index > 0) { + var parentSymbol = chain[index - 1]; + var typeParameters = void 0; + if (getCheckFlags(symbol) & 1 /* Instantiated */) { + typeParameters = getTypeParametersOfClassOrInterface(parentSymbol); + } + else { + var targetSymbol = getTargetSymbol(parentSymbol); + if (targetSymbol.flags & (32 /* Class */ | 64 /* Interface */ | 524288 /* TypeAlias */)) { + typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); + } + } + if (typeParameters && typeParameters.length > 0) { + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowTypeParameterInQualifiedName)) { + context.encounteredError = true; + } + var writer = ts.getSingleLineStringWriter(); + var displayBuilder = getSymbolDisplayBuilder(); + displayBuilder.buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, context.enclosingDeclaration, 0); + typeParameterString = writer.string(); + ts.releaseStringWriter(writer); + } + } + var symbolName = getNameOfSymbol(symbol); + var symbolNameWithTypeParameters = typeParameterString.length > 0 ? symbolName + "<" + typeParameterString + ">" : symbolName; + var identifier = ts.createIdentifier(symbolNameWithTypeParameters); + return index > 0 ? ts.createQualifiedName(createEntityNameFromSymbolChain(chain, index - 1), identifier) : identifier; + } + /** @param endOfChain Set to false for recursive calls; non-recursive calls should always output something. */ + function getSymbolChain(symbol, meaning, endOfChain) { + var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, /*useOnlyExternalAliasing*/ false); + var parentSymbol; + if (!accessibleSymbolChain || + needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { + // Go up and add our parent. + var parent = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); + if (parent) { + var parentChain = getSymbolChain(parent, getQualifiedLeftMeaning(meaning), /*endOfChain*/ false); + if (parentChain) { + parentSymbol = parent; + accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [symbol]); + } + } + } + if (accessibleSymbolChain) { + return accessibleSymbolChain; + } + if ( + // If this is the last part of outputting the symbol, always output. The cases apply only to parent symbols. + endOfChain || + // If a parent symbol is an external module, don't write it. (We prefer just `x` vs `"foo/bar".x`.) + !(!parentSymbol && ts.forEach(symbol.declarations, hasExternalModuleSymbol)) && + // If a parent symbol is an anonymous type, don't write it. + !(symbol.flags & (2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */))) { + return [symbol]; + } + } + function getNameOfSymbol(symbol) { + var declaration = ts.firstOrUndefined(symbol.declarations); + if (declaration) { + if (declaration.name) { + return ts.declarationNameToString(declaration.name); + } + if (declaration.parent && declaration.parent.kind === 225 /* VariableDeclaration */) { + return ts.declarationNameToString(declaration.parent.name); + } + if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.allowAnonymousIdentifier)) { + context.encounteredError = true; + } + switch (declaration.kind) { + case 198 /* ClassExpression */: + return "(Anonymous class)"; + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + return "(Anonymous function)"; + } + } + return symbol.name; + } + } + } function typePredicateToString(typePredicate, enclosingDeclaration, flags) { var writer = ts.getSingleLineStringWriter(); getSymbolDisplayBuilder().buildTypePredicateDisplay(typePredicate, writer, enclosingDeclaration, flags); @@ -25971,11 +27955,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { - var node = type.symbol.declarations[0].parent; - while (node.kind === 166 /* ParenthesizedType */) { - node = node.parent; - } - if (node.kind === 228 /* TypeAliasDeclaration */) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 167 /* ParenthesizedType */; }); + if (node.kind === 230 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -25983,29 +27964,32 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 231 /* ModuleBlock */ && + node.parent.kind === 233 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function literalTypeToString(type) { return type.flags & 32 /* StringLiteral */ ? "\"" + ts.escapeString(type.text) + "\"" : type.text; } - function getSymbolDisplayBuilder() { - function getNameOfSymbol(symbol) { - if (symbol.declarations && symbol.declarations.length) { - var declaration = symbol.declarations[0]; - if (declaration.name) { - return ts.declarationNameToString(declaration.name); - } - switch (declaration.kind) { - case 197 /* ClassExpression */: - return "(Anonymous class)"; - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - return "(Anonymous function)"; - } + function getNameOfSymbol(symbol) { + if (symbol.declarations && symbol.declarations.length) { + var declaration = symbol.declarations[0]; + if (declaration.name) { + return ts.declarationNameToString(declaration.name); + } + if (declaration.parent && declaration.parent.kind === 225 /* VariableDeclaration */) { + return ts.declarationNameToString(declaration.parent.name); + } + switch (declaration.kind) { + case 198 /* ClassExpression */: + return "(Anonymous class)"; + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + return "(Anonymous function)"; } - return symbol.name; } + return symbol.name; + } + function getSymbolDisplayBuilder() { /** * Writes only the name of the symbol out to the writer. Uses the original source text * for the name of the symbol if it is available to match how the user wrote the name. @@ -26047,7 +28031,7 @@ var ts; if (parentSymbol) { // Write type arguments of instantiated class/interface here if (flags & 1 /* WriteTypeParametersOrArguments */) { - if (symbol.flags & 16777216 /* Instantiated */) { + if (getCheckFlags(symbol) & 1 /* Instantiated */) { buildDisplayForTypeArgumentsAndDelimiters(getTypeParametersOfClassOrInterface(parentSymbol), symbol.mapper, writer, enclosingDeclaration); } else { @@ -26075,9 +28059,9 @@ var ts; if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { // Go up and add our parent. - var parent_5 = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); - if (parent_5) { - walkSymbol(parent_5, getQualifiedLeftMeaning(meaning), /*endOfChain*/ false); + var parent = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); + if (parent) { + walkSymbol(parent, getQualifiedLeftMeaning(meaning), /*endOfChain*/ false); } } if (accessibleSymbolChain) { @@ -26115,7 +28099,7 @@ var ts; function writeType(type, flags) { var nextFlags = flags & ~512 /* InTypeAlias */; // Write undefined/null type as any - if (type.flags & 16015 /* Intrinsic */) { + if (type.flags & 16793231 /* Intrinsic */) { // Special handling for unknown / resolving types, they should show up as any and not unknown or __resolving writer.writeKeyword(!(globalFlags & 16 /* WriteOwnNameForAnyLike */) && isTypeAny(type) ? "any" @@ -26142,7 +28126,7 @@ var ts; else if (!(flags & 512 /* InTypeAlias */) && type.aliasSymbol && isSymbolAccessible(type.aliasSymbol, enclosingDeclaration, 793064 /* Type */, /*shouldComputeAliasesToMakeVisible*/ false).accessibility === 0 /* Accessible */) { var typeArguments = type.aliasTypeArguments; - writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, typeArguments ? typeArguments.length : 0, nextFlags); + writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, ts.length(typeArguments), nextFlags); } else if (type.flags & 196608 /* UnionOrIntersection */) { writeUnionOrIntersectionType(type, nextFlags); @@ -26223,18 +28207,18 @@ var ts; var outerTypeParameters = type.target.outerTypeParameters; var i = 0; if (outerTypeParameters) { - var length_1 = outerTypeParameters.length; - while (i < length_1) { + var length_2 = outerTypeParameters.length; + while (i < length_2) { // Find group of type arguments for type parameters with the same declaring container. var start = i; - var parent_6 = getParentSymbolOfTypeParameter(outerTypeParameters[i]); + var parent = getParentSymbolOfTypeParameter(outerTypeParameters[i]); do { i++; - } while (i < length_1 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent_6); + } while (i < length_2 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent); // When type parameters are their own type arguments for the whole group (i.e. we have // the default outer type arguments), we don't show the group. if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { - writeSymbolTypeReference(parent_6, typeArguments, start, i, flags); + writeSymbolTypeReference(parent, typeArguments, start, i, flags); writePunctuation(writer, 22 /* DotToken */); } } @@ -26261,7 +28245,8 @@ var ts; var symbol = type.symbol; if (symbol) { // Always use 'typeof T' for type of class, enum, and module objects - if (symbol.flags & (32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { + if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) || + symbol.flags & (384 /* Enum */ | 512 /* ValueModule */)) { writeTypeOfSymbol(type, flags); } else if (shouldWriteTypeOfFunctionSymbol()) { @@ -26300,7 +28285,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 261 /* SourceFile */ || declaration.parent.kind === 231 /* ModuleBlock */; + return declaration.parent.kind === 264 /* SourceFile */ || declaration.parent.kind === 233 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -26314,32 +28299,13 @@ var ts; writeSpace(writer); buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455 /* Value */, 0 /* None */, typeFormatFlags); } - function writeIndexSignature(info, keyword) { - if (info) { - if (info.isReadonly) { - writeKeyword(writer, 130 /* ReadonlyKeyword */); - writeSpace(writer); - } - writePunctuation(writer, 20 /* OpenBracketToken */); - writer.writeParameter(info.declaration ? ts.declarationNameToString(info.declaration.parameters[0].name) : "x"); - writePunctuation(writer, 55 /* ColonToken */); - writeSpace(writer); - writeKeyword(writer, keyword); - writePunctuation(writer, 21 /* CloseBracketToken */); - writePunctuation(writer, 55 /* ColonToken */); - writeSpace(writer); - writeType(info.type, 0 /* None */); - writePunctuation(writer, 24 /* SemicolonToken */); - writer.writeLine(); - } - } function writePropertyWithModifiers(prop) { if (isReadonlySymbol(prop)) { writeKeyword(writer, 130 /* ReadonlyKeyword */); writeSpace(writer); } buildSymbolDisplay(prop, writer); - if (prop.flags & 536870912 /* Optional */) { + if (prop.flags & 67108864 /* Optional */) { writePunctuation(writer, 54 /* QuestionToken */); } } @@ -26416,15 +28382,15 @@ var ts; writePunctuation(writer, 24 /* SemicolonToken */); writer.writeLine(); } - writeIndexSignature(resolved.stringIndexInfo, 134 /* StringKeyword */); - writeIndexSignature(resolved.numberIndexInfo, 132 /* NumberKeyword */); + buildIndexSignatureDisplay(resolved.stringIndexInfo, writer, 0 /* String */, enclosingDeclaration, globalFlags, symbolStack); + buildIndexSignatureDisplay(resolved.numberIndexInfo, writer, 1 /* Number */, enclosingDeclaration, globalFlags, symbolStack); for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) { var p = _e[_d]; var t = getTypeOfSymbol(p); if (p.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(t).length) { var signatures = getSignaturesOfType(t, 0 /* Call */); - for (var _f = 0, signatures_1 = signatures; _f < signatures_1.length; _f++) { - var signature = signatures_1[_f]; + for (var _f = 0, signatures_2 = signatures; _f < signatures_2.length; _f++) { + var signature = signatures_2[_f]; writePropertyWithModifiers(p); buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, /*kind*/ undefined, symbolStack); writePunctuation(writer, 24 /* SemicolonToken */); @@ -26483,33 +28449,44 @@ var ts; writeSpace(writer); buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, symbolStack); } + var defaultType = getDefaultFromTypeParameter(tp); + if (defaultType) { + writeSpace(writer); + writePunctuation(writer, 57 /* EqualsToken */); + writeSpace(writer); + buildTypeDisplay(defaultType, writer, enclosingDeclaration, flags, symbolStack); + } } function buildParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack) { var parameterNode = p.valueDeclaration; - if (ts.isRestParameter(parameterNode)) { + if (parameterNode ? ts.isRestParameter(parameterNode) : isTransientSymbol(p) && p.isRestParameter) { writePunctuation(writer, 23 /* DotDotDotToken */); } - if (ts.isBindingPattern(parameterNode.name)) { + if (parameterNode && ts.isBindingPattern(parameterNode.name)) { buildBindingPatternDisplay(parameterNode.name, writer, enclosingDeclaration, flags, symbolStack); } else { appendSymbolNameOnly(p, writer); } - if (isOptionalParameter(parameterNode)) { + if (parameterNode && isOptionalParameter(parameterNode)) { writePunctuation(writer, 54 /* QuestionToken */); } writePunctuation(writer, 55 /* ColonToken */); writeSpace(writer); - buildTypeDisplay(getTypeOfSymbol(p), writer, enclosingDeclaration, flags, symbolStack); + var type = getTypeOfSymbol(p); + if (parameterNode && isRequiredInitializedParameter(parameterNode)) { + type = includeFalsyTypes(type, 2048 /* Undefined */); + } + buildTypeDisplay(type, writer, enclosingDeclaration, flags, symbolStack); } function buildBindingPatternDisplay(bindingPattern, writer, enclosingDeclaration, flags, symbolStack) { // We have to explicitly emit square bracket and bracket because these tokens are not stored inside the node. - if (bindingPattern.kind === 172 /* ObjectBindingPattern */) { + if (bindingPattern.kind === 173 /* ObjectBindingPattern */) { writePunctuation(writer, 16 /* OpenBraceToken */); buildDisplayForCommaSeparatedList(bindingPattern.elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); }); writePunctuation(writer, 17 /* CloseBraceToken */); } - else if (bindingPattern.kind === 173 /* ArrayBindingPattern */) { + else if (bindingPattern.kind === 174 /* ArrayBindingPattern */) { writePunctuation(writer, 20 /* OpenBracketToken */); var elements = bindingPattern.elements; buildDisplayForCommaSeparatedList(elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); }); @@ -26523,9 +28500,9 @@ var ts; if (ts.isOmittedExpression(bindingElement)) { return; } - ts.Debug.assert(bindingElement.kind === 174 /* BindingElement */); + ts.Debug.assert(bindingElement.kind === 175 /* BindingElement */); if (bindingElement.propertyName) { - writer.writeSymbol(ts.getTextOfNode(bindingElement.propertyName), bindingElement.symbol); + writer.writeProperty(ts.getTextOfNode(bindingElement.propertyName)); writePunctuation(writer, 55 /* ColonToken */); writeSpace(writer); } @@ -26597,6 +28574,10 @@ var ts; buildTypeDisplay(predicate.type, writer, enclosingDeclaration, flags, symbolStack); } function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) { + var returnType = getReturnTypeOfSignature(signature); + if (flags & 2048 /* SuppressAnyReturnType */ && isTypeAny(returnType)) { + return; + } if (flags & 8 /* WriteArrowStyleSignature */) { writeSpace(writer); writePunctuation(writer, 35 /* EqualsGreaterThanToken */); @@ -26609,7 +28590,6 @@ var ts; buildTypePredicateDisplay(signature.typePredicate, writer, enclosingDeclaration, flags, symbolStack); } else { - var returnType = getReturnTypeOfSignature(signature); buildTypeDisplay(returnType, writer, enclosingDeclaration, flags, symbolStack); } } @@ -26629,6 +28609,32 @@ var ts; buildDisplayForParametersAndDelimiters(signature.thisParameter, signature.parameters, writer, enclosingDeclaration, flags, symbolStack); buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack); } + function buildIndexSignatureDisplay(info, writer, kind, enclosingDeclaration, globalFlags, symbolStack) { + if (info) { + if (info.isReadonly) { + writeKeyword(writer, 130 /* ReadonlyKeyword */); + writeSpace(writer); + } + writePunctuation(writer, 20 /* OpenBracketToken */); + writer.writeParameter(info.declaration ? ts.declarationNameToString(info.declaration.parameters[0].name) : "x"); + writePunctuation(writer, 55 /* ColonToken */); + writeSpace(writer); + switch (kind) { + case 1 /* Number */: + writeKeyword(writer, 132 /* NumberKeyword */); + break; + case 0 /* String */: + writeKeyword(writer, 135 /* StringKeyword */); + break; + } + writePunctuation(writer, 21 /* CloseBracketToken */); + writePunctuation(writer, 55 /* ColonToken */); + writeSpace(writer); + buildTypeDisplay(info.type, writer, enclosingDeclaration, globalFlags, symbolStack); + writePunctuation(writer, 24 /* SemicolonToken */); + writer.writeLine(); + } + } return _displayBuilder || (_displayBuilder = { buildSymbolDisplay: buildSymbolDisplay, buildTypeDisplay: buildTypeDisplay, @@ -26639,6 +28645,7 @@ var ts; buildDisplayForTypeParametersAndDelimiters: buildDisplayForTypeParametersAndDelimiters, buildTypeParameterDisplayFromSymbol: buildTypeParameterDisplayFromSymbol, buildSignatureDisplay: buildSignatureDisplay, + buildIndexSignatureDisplay: buildIndexSignatureDisplay, buildReturnTypeDisplay: buildReturnTypeDisplay }); } @@ -26653,75 +28660,76 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 174 /* BindingElement */: + case 175 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 223 /* VariableDeclaration */: + case 225 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } - // Otherwise fall through - case 230 /* ModuleDeclaration */: - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 225 /* FunctionDeclaration */: - case 229 /* EnumDeclaration */: - case 234 /* ImportEqualsDeclaration */: + // falls through + case 232 /* ModuleDeclaration */: + case 228 /* ClassDeclaration */: + case 229 /* InterfaceDeclaration */: + case 230 /* TypeAliasDeclaration */: + case 227 /* FunctionDeclaration */: + case 231 /* EnumDeclaration */: + case 236 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; } - var parent_7 = getDeclarationContainer(node); + var parent = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) && - !(node.kind !== 234 /* ImportEqualsDeclaration */ && parent_7.kind !== 261 /* SourceFile */ && ts.isInAmbientContext(parent_7))) { - return isGlobalSourceFile(parent_7); + !(node.kind !== 236 /* ImportEqualsDeclaration */ && parent.kind !== 264 /* SourceFile */ && ts.isInAmbientContext(parent))) { + return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible - return isDeclarationVisible(parent_7); - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + return isDeclarationVisible(parent); + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: if (ts.getModifierFlags(node) & (8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } - // Public properties/methods are visible if its parents are visible, so const it fall into next case statement - case 150 /* Constructor */: - case 154 /* ConstructSignature */: - case 153 /* CallSignature */: - case 155 /* IndexSignature */: - case 144 /* Parameter */: - case 231 /* ModuleBlock */: - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 161 /* TypeLiteral */: - case 157 /* TypeReference */: - case 162 /* ArrayType */: - case 163 /* TupleType */: - case 164 /* UnionType */: - case 165 /* IntersectionType */: - case 166 /* ParenthesizedType */: + // Public properties/methods are visible if its parents are visible, so: + // falls through + case 151 /* Constructor */: + case 155 /* ConstructSignature */: + case 154 /* CallSignature */: + case 156 /* IndexSignature */: + case 145 /* Parameter */: + case 233 /* ModuleBlock */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: + case 162 /* TypeLiteral */: + case 158 /* TypeReference */: + case 163 /* ArrayType */: + case 164 /* TupleType */: + case 165 /* UnionType */: + case 166 /* IntersectionType */: + case 167 /* ParenthesizedType */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 236 /* ImportClause */: - case 237 /* NamespaceImport */: - case 239 /* ImportSpecifier */: + case 238 /* ImportClause */: + case 239 /* NamespaceImport */: + case 241 /* ImportSpecifier */: return false; // Type parameters are always visible - case 143 /* TypeParameter */: + case 144 /* TypeParameter */: // Source file and namespace export are always visible - case 261 /* SourceFile */: - case 233 /* NamespaceExportDeclaration */: + case 264 /* SourceFile */: + case 235 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: return false; default: return false; @@ -26730,10 +28738,10 @@ var ts; } function collectLinkedAliases(node) { var exportSymbol; - if (node.parent && node.parent.kind === 240 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 242 /* ExportAssignment */) { exportSymbol = resolveName(node.parent, node.text, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 8388608 /* Alias */, ts.Diagnostics.Cannot_find_name_0, node); } - else if (node.parent.kind === 243 /* ExportSpecifier */) { + else if (node.parent.kind === 245 /* ExportSpecifier */) { var exportSpecifier = node.parent; exportSymbol = exportSpecifier.parent.parent.moduleSpecifier ? getExternalModuleMember(exportSpecifier.parent.parent, exportSpecifier) : @@ -26778,8 +28786,8 @@ var ts; var resolutionCycleStartIndex = findResolutionCycleStartIndex(target, propertyName); if (resolutionCycleStartIndex >= 0) { // A cycle was found - var length_2 = resolutionTargets.length; - for (var i = resolutionCycleStartIndex; i < length_2; i++) { + var length_3 = resolutionTargets.length; + for (var i = resolutionCycleStartIndex; i < length_3; i++) { resolutionResults[i] = false; } return false; @@ -26823,21 +28831,20 @@ var ts; return resolutionResults.pop(); } function getDeclarationContainer(node) { - node = ts.getRootDeclaration(node); - while (node) { + node = ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 223 /* VariableDeclaration */: - case 224 /* VariableDeclarationList */: - case 239 /* ImportSpecifier */: - case 238 /* NamedImports */: - case 237 /* NamespaceImport */: - case 236 /* ImportClause */: - node = node.parent; - break; + case 225 /* VariableDeclaration */: + case 226 /* VariableDeclarationList */: + case 241 /* ImportSpecifier */: + case 240 /* NamedImports */: + case 239 /* NamespaceImport */: + case 238 /* ImportClause */: + return false; default: - return node.parent; + return true; } - } + }); + return node && node.parent; } function getTypeOfPrototypeProperty(prototype) { // TypeScript 1.0 spec (April 2014): 8.4 @@ -26855,9 +28862,6 @@ var ts; function isTypeAny(type) { return type && (type.flags & 1 /* Any */) !== 0; } - function isTypeNever(type) { - return type && (type.flags & 8192 /* Never */) !== 0; - } // Return the type of a binding element parent. We check SymbolLinks first to see if a type has been // assigned by contextual typing. function getTypeForBindingElementParent(node) { @@ -26865,24 +28869,29 @@ var ts; return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false); } function isComputedNonLiteralName(name) { - return name.kind === 142 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteral(name.expression); + return name.kind === 143 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteral(name.expression); } function getRestType(source, properties, symbol) { - ts.Debug.assert(!!(source.flags & 32768 /* Object */), "Rest types only support object types right now."); + source = filterType(source, function (t) { return !(t.flags & 6144 /* Nullable */); }); + if (source.flags & 8192 /* Never */) { + return emptyObjectType; + } + if (source.flags & 65536 /* Union */) { + return mapType(source, function (t) { return getRestType(t, properties, symbol); }); + } var members = ts.createMap(); var names = ts.createMap(); - for (var _i = 0, properties_2 = properties; _i < properties_2.length; _i++) { - var name_17 = properties_2[_i]; - names[ts.getTextOfPropertyName(name_17)] = true; + for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { + var name = properties_3[_i]; + names.set(ts.getTextOfPropertyName(name), true); } for (var _a = 0, _b = getPropertiesOfType(source); _a < _b.length; _a++) { var prop = _b[_a]; - var inNamesToRemove = prop.name in names; + var inNamesToRemove = names.has(prop.name); var isPrivate = getDeclarationModifierFlagsFromSymbol(prop) & (8 /* Private */ | 16 /* Protected */); - var isMethod = prop.flags & 8192 /* Method */; var isSetOnlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */); - if (!inNamesToRemove && !isPrivate && !isMethod && !isSetOnlyAccessor) { - members[prop.name] = prop; + if (!inNamesToRemove && !isPrivate && !isClassMethod(prop) && !isSetOnlyAccessor) { + members.set(prop.name, prop); } } var stringIndexInfo = getIndexInfoOfType(source, 0 /* String */); @@ -26907,9 +28916,9 @@ var ts; return parentType; } var type; - if (pattern.kind === 172 /* ObjectBindingPattern */) { + if (pattern.kind === 173 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { - if (!(parentType.flags & 32768 /* Object */)) { + if (!isValidSpreadType(parentType)) { error(declaration, ts.Diagnostics.Rest_types_may_only_be_created_from_object_types); return unknownType; } @@ -26924,8 +28933,8 @@ var ts; } else { // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) - var name_18 = declaration.propertyName || declaration.name; - if (isComputedNonLiteralName(name_18)) { + var name = declaration.propertyName || declaration.name; + if (isComputedNonLiteralName(name)) { // computed properties with non-literal names are treated as 'any' return anyType; } @@ -26934,12 +28943,12 @@ var ts; } // Use type of the specified property, or otherwise, for a numeric name, the type of the numeric index signature, // or otherwise the type of the string index signature. - var text = ts.getTextOfPropertyName(name_18); + var text = ts.getTextOfPropertyName(name); type = getTypeOfPropertyOfType(parentType, text) || isNumericLiteralName(text) && getIndexTypeOfType(parentType, 1 /* Number */) || getIndexTypeOfType(parentType, 0 /* String */); if (!type) { - error(name_18, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_18)); + error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name)); return unknownType; } } @@ -26948,7 +28957,7 @@ var ts; // This elementType will be used if the specific property corresponding to this index is not // present (aka the tuple element property). This call also checks that the parentType is in // fact an iterable or array (depending on target language). - var elementType = checkIteratedTypeOrElementType(parentType, pattern, /*allowStringInput*/ false); + var elementType = checkIteratedTypeOrElementType(parentType, pattern, /*allowStringInput*/ false, /*allowAsyncIterable*/ false); if (declaration.dotDotDotToken) { // Rest element has an array type with the same element type as the parent type type = createArrayType(elementType); @@ -26979,7 +28988,7 @@ var ts; getUnionType([type, checkExpressionCached(declaration.initializer)], /*subtypeReduction*/ true) : type; } - function getTypeForVariableLikeDeclarationFromJSDocComment(declaration) { + function getTypeForDeclarationFromJSDocComment(declaration) { var jsdocType = ts.getJSDocType(declaration); if (jsdocType) { return getTypeFromTypeNode(jsdocType); @@ -26992,44 +29001,46 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 175 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 176 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { return strictNullChecks && optional ? includeFalsyTypes(type, 2048 /* Undefined */) : type; } // Return the inferred type for a variable, parameter, or property declaration function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { - if (declaration.flags & 2097152 /* JavaScriptFile */) { + if (declaration.flags & 65536 /* JavaScriptFile */) { // If this is a variable in a JavaScript file, then use the JSDoc type (if it has // one as its type), otherwise fallback to the below standard TS codepaths to // try to figure it out. - var type = getTypeForVariableLikeDeclarationFromJSDocComment(declaration); + var type = getTypeForDeclarationFromJSDocComment(declaration); if (type && type !== unknownType) { return type; } } // A variable declared in a for..in statement is of type string, or of type keyof T when the // right hand expression is of a type parameter type. - if (declaration.parent.parent.kind === 212 /* ForInStatement */) { + if (declaration.parent.parent.kind === 214 /* ForInStatement */) { var indexType = getIndexType(checkNonNullExpression(declaration.parent.parent.expression)); return indexType.flags & (16384 /* TypeParameter */ | 262144 /* Index */) ? indexType : stringType; } - if (declaration.parent.parent.kind === 213 /* ForOfStatement */) { + if (declaration.parent.parent.kind === 215 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, // or it may have led to an error inside getElementTypeOfIterable. - return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType; + var forOfStatement = declaration.parent.parent; + return checkRightHandSideOfForOf(forOfStatement.expression, forOfStatement.awaitModifier) || anyType; } if (ts.isBindingPattern(declaration.parent)) { return getTypeForBindingElement(declaration); } // Use type from type annotation if one is present if (declaration.type) { - return addOptionality(getTypeFromTypeNode(declaration.type), /*optional*/ declaration.questionToken && includeOptionality); + var declaredType = getTypeFromTypeNode(declaration.type); + return addOptionality(declaredType, /*optional*/ declaration.questionToken && includeOptionality); } - if ((compilerOptions.noImplicitAny || declaration.flags & 2097152 /* JavaScriptFile */) && - declaration.kind === 223 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && + if ((noImplicitAny || declaration.flags & 65536 /* JavaScriptFile */) && + declaration.kind === 225 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1 /* Export */) && !ts.isInAmbientContext(declaration)) { // If --noImplicitAny is on or the declaration is in a Javascript file, // use control flow tracked 'any' type for non-ambient, non-exported var or let variables with no @@ -27043,11 +29054,11 @@ var ts; return autoArrayType; } } - if (declaration.kind === 144 /* Parameter */) { + if (declaration.kind === 145 /* Parameter */) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 152 /* SetAccessor */ && !ts.hasDynamicName(func)) { - var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 151 /* GetAccessor */); + if (func.kind === 153 /* SetAccessor */ && !ts.hasDynamicName(func)) { + var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 152 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -27076,8 +29087,13 @@ var ts; var type = checkDeclarationInitializer(declaration); return addOptionality(type, /*optional*/ declaration.questionToken && includeOptionality); } + if (ts.isJsxAttribute(declaration)) { + // if JSX attribute doesn't have initializer, by default the attribute will have boolean value of true. + // I.e is sugar for + return trueType; + } // If it is a short-hand property assignment, use the type of the identifier - if (declaration.kind === 258 /* ShorthandPropertyAssignment */) { + if (declaration.kind === 261 /* ShorthandPropertyAssignment */) { return checkIdentifier(declaration.name); } // If the declaration specifies a binding pattern, use the type implied by the binding pattern @@ -27087,6 +29103,38 @@ var ts; // No type specified and nothing can be inferred return undefined; } + function getWidenedTypeFromJSSpecialPropertyDeclarations(symbol) { + var types = []; + var definedInConstructor = false; + var definedInMethod = false; + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + var expression = declaration.kind === 193 /* BinaryExpression */ ? declaration : + declaration.kind === 178 /* PropertyAccessExpression */ ? ts.getAncestor(declaration, 193 /* BinaryExpression */) : + undefined; + if (!expression) { + return unknownType; + } + if (ts.isPropertyAccessExpression(expression.left) && expression.left.expression.kind === 98 /* ThisKeyword */) { + if (ts.getThisContainer(expression, /*includeArrowFunctions*/ false).kind === 151 /* Constructor */) { + definedInConstructor = true; + } + else { + definedInMethod = true; + } + } + if (expression.flags & 65536 /* JavaScriptFile */) { + // If there is a JSDoc type, use it + var type = getTypeForDeclarationFromJSDocComment(expression.parent); + if (type && type !== unknownType) { + types.push(getWidenedType(type)); + continue; + } + } + types.push(getWidenedLiteralType(checkExpressionCached(expression.right))); + } + return getWidenedType(addOptionality(getUnionType(types, /*subtypeReduction*/ true), definedInMethod && !definedInConstructor)); + } // Return the type implied by a binding pattern element. This is the type of the initializer of the element if // one is present. Otherwise, if the element is itself a binding pattern, it is the type implied by the binding // pattern. Otherwise, it is the type any. @@ -27097,7 +29145,7 @@ var ts; if (ts.isBindingPattern(element.name)) { return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors); } - if (reportErrors && compilerOptions.noImplicitAny && !declarationBelongsToPrivateAmbientMember(element)) { + if (reportErrors && noImplicitAny && !declarationBelongsToPrivateAmbientMember(element)) { reportImplicitAnyError(element, anyType); } return anyType; @@ -27105,22 +29153,27 @@ var ts; // Return the type implied by an object binding pattern function getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) { var members = ts.createMap(); + var stringIndexInfo; var hasComputedProperties = false; ts.forEach(pattern.elements, function (e) { var name = e.propertyName || e.name; - if (isComputedNonLiteralName(name) || e.dotDotDotToken) { - // do not include computed properties or rests in the implied type + if (isComputedNonLiteralName(name)) { + // do not include computed properties in the implied type hasComputedProperties = true; return; } + if (e.dotDotDotToken) { + stringIndexInfo = createIndexInfo(anyType, /*isReadonly*/ false); + return; + } var text = ts.getTextOfPropertyName(name); - var flags = 4 /* Property */ | 67108864 /* Transient */ | (e.initializer ? 536870912 /* Optional */ : 0); + var flags = 4 /* Property */ | (e.initializer ? 67108864 /* Optional */ : 0); var symbol = createSymbol(flags, text); symbol.type = getTypeFromBindingElement(e, includePatternInType, reportErrors); symbol.bindingElement = e; - members[symbol.name] = symbol; + members.set(symbol.name, symbol); }); - var result = createAnonymousType(undefined, members, emptyArray, emptyArray, undefined, undefined); + var result = createAnonymousType(undefined, members, emptyArray, emptyArray, stringIndexInfo, undefined); if (includePatternInType) { result.pattern = pattern; } @@ -27153,7 +29206,7 @@ var ts; // parameter with no type annotation or initializer, the type implied by the binding pattern becomes the type of // the parameter. function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { - return pattern.kind === 172 /* ObjectBindingPattern */ + return pattern.kind === 173 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -27175,7 +29228,7 @@ var ts; // During a normal type check we'll never get to here with a property assignment (the check of the containing // object literal uses a different path). We exclude widening only so that language services and type verification // tools see the actual type. - if (declaration.kind === 257 /* PropertyAssignment */) { + if (declaration.kind === 260 /* PropertyAssignment */) { return type; } return getWidenedType(type); @@ -27183,7 +29236,7 @@ var ts; // Rest parameters default to type any[], other parameters default to type any type = declaration.dotDotDotToken ? anyArrayType : anyType; // Report implicit any errors unless this is a private property within an ambient declaration - if (reportErrors && compilerOptions.noImplicitAny) { + if (reportErrors && noImplicitAny) { if (!declarationBelongsToPrivateAmbientMember(declaration)) { reportImplicitAnyError(declaration, type); } @@ -27192,14 +29245,14 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 144 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 145 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function getTypeOfVariableOrParameterOrProperty(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { // Handle prototype property - if (symbol.flags & 134217728 /* Prototype */) { + if (symbol.flags & 16777216 /* Prototype */) { return links.type = getTypeOfPrototypeProperty(symbol); } // Handle catch clause variables @@ -27208,10 +29261,10 @@ var ts; return links.type = anyType; } // Handle export default expressions - if (declaration.kind === 240 /* ExportAssignment */) { + if (declaration.kind === 242 /* ExportAssignment */) { return links.type = checkExpression(declaration.expression); } - if (declaration.flags & 2097152 /* JavaScriptFile */ && declaration.kind === 286 /* JSDocPropertyTag */ && declaration.typeExpression) { + if (declaration.flags & 65536 /* JavaScriptFile */ && declaration.kind === 290 /* JSDocPropertyTag */ && declaration.typeExpression) { return links.type = getTypeFromTypeNode(declaration.typeExpression.type); } // Handle variable, parameter or property @@ -27224,36 +29277,15 @@ var ts; // * exports.p = expr // * this.p = expr // * className.prototype.method = expr - if (declaration.kind === 192 /* BinaryExpression */ || - declaration.kind === 177 /* PropertyAccessExpression */ && declaration.parent.kind === 192 /* BinaryExpression */) { - // Use JS Doc type if present on parent expression statement - if (declaration.flags & 2097152 /* JavaScriptFile */) { - var jsdocType = ts.getJSDocType(declaration.parent); - if (jsdocType) { - return links.type = getTypeFromTypeNode(jsdocType); - } - } - var declaredTypes = ts.map(symbol.declarations, function (decl) { return decl.kind === 192 /* BinaryExpression */ ? - checkExpressionCached(decl.right) : - checkExpressionCached(decl.parent.right); }); - type = getUnionType(declaredTypes, /*subtypeReduction*/ true); + if (declaration.kind === 193 /* BinaryExpression */ || + declaration.kind === 178 /* PropertyAccessExpression */ && declaration.parent.kind === 193 /* BinaryExpression */) { + type = getWidenedTypeFromJSSpecialPropertyDeclarations(symbol); } else { type = getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true); } if (!popTypeResolution()) { - if (symbol.valueDeclaration.type) { - // Variable has type annotation that circularly references the variable itself - type = unknownType; - error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); - } - else { - // Variable has initializer that circularly references the variable itself - type = anyType; - if (compilerOptions.noImplicitAny) { - error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); - } - } + type = reportCircularityError(symbol); } links.type = type; } @@ -27261,7 +29293,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 151 /* GetAccessor */) { + if (accessor.kind === 152 /* GetAccessor */) { return accessor.type && getTypeFromTypeNode(accessor.type); } else { @@ -27281,10 +29313,10 @@ var ts; function getTypeOfAccessors(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - var getter = ts.getDeclarationOfKind(symbol, 151 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 152 /* SetAccessor */); - if (getter && getter.flags & 2097152 /* JavaScriptFile */) { - var jsDocType = getTypeForVariableLikeDeclarationFromJSDocComment(getter); + var getter = ts.getDeclarationOfKind(symbol, 152 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 153 /* SetAccessor */); + if (getter && getter.flags & 65536 /* JavaScriptFile */) { + var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { return links.type = jsDocType; } @@ -27310,7 +29342,7 @@ var ts; type = getReturnTypeFromBody(getter); } else { - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { if (setter) { error(setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation, symbolToString(symbol)); } @@ -27325,8 +29357,8 @@ var ts; } if (!popTypeResolution()) { type = anyType; - if (compilerOptions.noImplicitAny) { - var getter_1 = ts.getDeclarationOfKind(symbol, 151 /* GetAccessor */); + if (noImplicitAny) { + var getter_1 = ts.getDeclarationOfKind(symbol, 152 /* GetAccessor */); error(getter_1, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -27334,6 +29366,10 @@ var ts; } return links.type; } + function getBaseTypeVariableOfClass(symbol) { + var baseConstructorType = getBaseConstructorTypeOfClass(getDeclaredTypeOfClassOrInterface(symbol)); + return baseConstructorType.flags & 540672 /* TypeVariable */ ? baseConstructorType : undefined; + } function getTypeOfFuncClassEnumModule(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { @@ -27342,8 +29378,13 @@ var ts; } else { var type = createObjectType(16 /* Anonymous */, symbol); - links.type = strictNullChecks && symbol.flags & 536870912 /* Optional */ ? - includeFalsyTypes(type, 2048 /* Undefined */) : type; + if (symbol.flags & 32 /* Class */) { + var baseTypeVariable = getBaseTypeVariableOfClass(symbol); + links.type = baseTypeVariable ? getIntersectionType([type, baseTypeVariable]) : type; + } + else { + links.type = strictNullChecks && symbol.flags & 67108864 /* Optional */ ? includeFalsyTypes(type, 2048 /* Undefined */) : type; + } } } return links.type; @@ -27373,12 +29414,39 @@ var ts; function getTypeOfInstantiatedSymbol(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - links.type = instantiateType(getTypeOfSymbol(links.target), links.mapper); + if (symbolInstantiationDepth === 100) { + error(symbol.valueDeclaration, ts.Diagnostics.Generic_type_instantiation_is_excessively_deep_and_possibly_infinite); + links.type = unknownType; + } + else { + if (!pushTypeResolution(symbol, 0 /* Type */)) { + return unknownType; + } + symbolInstantiationDepth++; + var type = instantiateType(getTypeOfSymbol(links.target), links.mapper); + symbolInstantiationDepth--; + if (!popTypeResolution()) { + type = reportCircularityError(symbol); + } + links.type = type; + } } return links.type; } + function reportCircularityError(symbol) { + // Check if variable has type annotation that circularly references the variable itself + if (symbol.valueDeclaration.type) { + error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); + return unknownType; + } + // Otherwise variable has initializer that circularly references the variable itself + if (noImplicitAny) { + error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); + } + return anyType; + } function getTypeOfSymbol(symbol) { - if (symbol.flags & 16777216 /* Instantiated */) { + if (getCheckFlags(symbol) & 1 /* Instantiated */) { return getTypeOfInstantiatedSymbol(symbol); } if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { @@ -27398,22 +29466,33 @@ var ts; } return unknownType; } + function isReferenceToType(type, target) { + return type !== undefined + && target !== undefined + && (getObjectFlags(type) & 4 /* Reference */) !== 0 + && type.target === target; + } function getTargetType(type) { return getObjectFlags(type) & 4 /* Reference */ ? type.target : type; } function hasBaseType(type, checkBase) { return check(type); function check(type) { - var target = getTargetType(type); - return target === checkBase || ts.forEach(getBaseTypes(target), check); + if (getObjectFlags(type) & (3 /* ClassOrInterface */ | 4 /* Reference */)) { + var target = getTargetType(type); + return target === checkBase || ts.forEach(getBaseTypes(target), check); + } + else if (type.flags & 131072 /* Intersection */) { + return ts.forEach(type.types, check); + } } } // Appends the type parameters given by a list of declarations to a set of type parameters and returns the resulting set. // The function allocates a new array if the input type parameter set is undefined, but otherwise it modifies the set // in-place and returns the same array. function appendTypeParameters(typeParameters, declarations) { - for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { - var declaration = declarations_2[_i]; + for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { + var declaration = declarations_3[_i]; var tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(declaration)); if (!typeParameters) { typeParameters = [tp]; @@ -27433,9 +29512,9 @@ var ts; if (!node) { return typeParameters; } - if (node.kind === 226 /* ClassDeclaration */ || node.kind === 197 /* ClassExpression */ || - node.kind === 225 /* FunctionDeclaration */ || node.kind === 184 /* FunctionExpression */ || - node.kind === 149 /* MethodDeclaration */ || node.kind === 185 /* ArrowFunction */) { + if (node.kind === 228 /* ClassDeclaration */ || node.kind === 198 /* ClassExpression */ || + node.kind === 227 /* FunctionDeclaration */ || node.kind === 185 /* FunctionExpression */ || + node.kind === 150 /* MethodDeclaration */ || node.kind === 186 /* ArrowFunction */) { var declarations = node.typeParameters; if (declarations) { return appendTypeParameters(appendOuterTypeParameters(typeParameters, node), declarations); @@ -27445,8 +29524,8 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 227 /* InterfaceDeclaration */); - return appendOuterTypeParameters(undefined, declaration); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 229 /* InterfaceDeclaration */); + return appendOuterTypeParameters(/*typeParameters*/ undefined, declaration); } // The local type parameters are the combined set of type parameters from all declarations of the class, // interface, or type alias. @@ -27454,8 +29533,8 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 227 /* InterfaceDeclaration */ || node.kind === 226 /* ClassDeclaration */ || - node.kind === 197 /* ClassExpression */ || node.kind === 228 /* TypeAliasDeclaration */) { + if (node.kind === 229 /* InterfaceDeclaration */ || node.kind === 228 /* ClassDeclaration */ || + node.kind === 198 /* ClassExpression */ || node.kind === 230 /* TypeAliasDeclaration */) { var declaration = node; if (declaration.typeParameters) { result = appendTypeParameters(result, declaration.typeParameters); @@ -27469,29 +29548,50 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { return ts.concatenate(getOuterTypeParametersOfClassOrInterface(symbol), getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol)); } + // A type is a mixin constructor if it has a single construct signature taking no type parameters and a single + // rest parameter of type any[]. + function isMixinConstructorType(type) { + var signatures = getSignaturesOfType(type, 1 /* Construct */); + if (signatures.length === 1) { + var s = signatures[0]; + return !s.typeParameters && s.parameters.length === 1 && s.hasRestParameter && getTypeOfParameter(s.parameters[0]) === anyArrayType; + } + return false; + } function isConstructorType(type) { - return type.flags & 32768 /* Object */ && getSignaturesOfType(type, 1 /* Construct */).length > 0; + if (isValidBaseType(type) && getSignaturesOfType(type, 1 /* Construct */).length > 0) { + return true; + } + if (type.flags & 540672 /* TypeVariable */) { + var constraint = getBaseConstraintOfType(type); + return constraint && isValidBaseType(constraint) && isMixinConstructorType(constraint); + } + return false; } function getBaseTypeNodeOfClass(type) { return ts.getClassExtendsHeritageClauseElement(type.symbol.valueDeclaration); } - function getConstructorsForTypeArguments(type, typeArgumentNodes) { - var typeArgCount = typeArgumentNodes ? typeArgumentNodes.length : 0; - return ts.filter(getSignaturesOfType(type, 1 /* Construct */), function (sig) { return (sig.typeParameters ? sig.typeParameters.length : 0) === typeArgCount; }); + function getConstructorsForTypeArguments(type, typeArgumentNodes, location) { + var typeArgCount = ts.length(typeArgumentNodes); + var isJavaScript = ts.isInJavaScriptFile(location); + return ts.filter(getSignaturesOfType(type, 1 /* Construct */), function (sig) { return (isJavaScript || typeArgCount >= getMinTypeArgumentCount(sig.typeParameters)) && typeArgCount <= ts.length(sig.typeParameters); }); } - function getInstantiatedConstructorsForTypeArguments(type, typeArgumentNodes) { - var signatures = getConstructorsForTypeArguments(type, typeArgumentNodes); + function getInstantiatedConstructorsForTypeArguments(type, typeArgumentNodes, location) { + var signatures = getConstructorsForTypeArguments(type, typeArgumentNodes, location); if (typeArgumentNodes) { var typeArguments_1 = ts.map(typeArgumentNodes, getTypeFromTypeNode); signatures = ts.map(signatures, function (sig) { return getSignatureInstantiation(sig, typeArguments_1); }); } return signatures; } - // The base constructor of a class can resolve to - // undefinedType if the class has no extends clause, - // unknownType if an error occurred during resolution of the extends expression, - // nullType if the extends expression is the null value, or - // an object type with at least one construct signature. + /** + * The base constructor of a class can resolve to + * * undefinedType if the class has no extends clause, + * * unknownType if an error occurred during resolution of the extends expression, + * * nullType if the extends expression is the null value, + * * anyType if the extends expression has type any, or + * * an object type with at least one construct signature. + */ function getBaseConstructorTypeOfClass(type) { if (!type.resolvedBaseConstructorType) { var baseTypeNode = getBaseTypeNodeOfClass(type); @@ -27502,7 +29602,7 @@ var ts; return unknownType; } var baseConstructorType = checkExpression(baseTypeNode.expression); - if (baseConstructorType.flags & 32768 /* Object */) { + if (baseConstructorType.flags & (32768 /* Object */ | 131072 /* Intersection */)) { // Resolving the members of a class requires us to resolve the base class of that class. // We force resolution here such that we catch circularities now. resolveStructuredTypeMembers(baseConstructorType); @@ -27511,7 +29611,7 @@ var ts; error(type.symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_base_expression, symbolToString(type.symbol)); return type.resolvedBaseConstructorType = unknownType; } - if (baseConstructorType !== unknownType && baseConstructorType !== nullWideningType && !isConstructorType(baseConstructorType)) { + if (!(baseConstructorType.flags & 1 /* Any */) && baseConstructorType !== nullWideningType && !isConstructorType(baseConstructorType)) { error(baseTypeNode.expression, ts.Diagnostics.Type_0_is_not_a_constructor_function_type, typeToString(baseConstructorType)); return type.resolvedBaseConstructorType = unknownType; } @@ -27540,8 +29640,8 @@ var ts; } function resolveBaseTypesOfClass(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; - var baseConstructorType = getBaseConstructorTypeOfClass(type); - if (!(baseConstructorType.flags & 32768 /* Object */)) { + var baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type)); + if (!(baseConstructorType.flags & (32768 /* Object */ | 131072 /* Intersection */ | 1 /* Any */))) { return; } var baseTypeNode = getBaseTypeNodeOfClass(type); @@ -27554,11 +29654,14 @@ var ts; // type arguments in the same manner as a type reference to get the same error reporting experience. baseType = getTypeFromClassOrInterfaceReference(baseTypeNode, baseConstructorType.symbol); } + else if (baseConstructorType.flags & 1 /* Any */) { + baseType = baseConstructorType; + } else { // The class derives from a "class-like" constructor function, check that we have at least one construct signature // with a matching number of type parameters and use the return type of the first instantiated signature. Elsewhere // we check that all instantiated signatures return the same type. - var constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments); + var constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments, baseTypeNode); if (!constructors.length) { error(baseTypeNode.expression, ts.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments); return; @@ -27576,7 +29679,7 @@ var ts; if (baseType === unknownType) { return; } - if (!(getObjectFlags(getTargetType(baseType)) & 3 /* ClassOrInterface */)) { + if (!isValidBaseType(baseType)) { error(baseTypeNode.expression, ts.Diagnostics.Base_constructor_return_type_0_is_not_a_class_or_interface_type, typeToString(baseType)); return; } @@ -27602,16 +29705,22 @@ var ts; } return true; } + // A valid base type is `any`, any non-generic object type or intersection of non-generic + // object types. + function isValidBaseType(type) { + return type.flags & (32768 /* Object */ | 16777216 /* NonPrimitive */ | 1 /* Any */) && !isGenericMappedType(type) || + type.flags & 131072 /* Intersection */ && !ts.forEach(type.types, function (t) { return !isValidBaseType(t); }); + } function resolveBaseTypesOfInterface(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 227 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 229 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getTypeFromTypeNode(node); if (baseType !== unknownType) { - if (getObjectFlags(getTargetType(baseType)) & 3 /* ClassOrInterface */) { + if (isValidBaseType(baseType)) { if (type !== baseType && !hasBaseType(baseType, type)) { if (type.resolvedBaseTypes === emptyArray) { type.resolvedBaseTypes = [baseType]; @@ -27638,7 +29747,7 @@ var ts; function isIndependentInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 227 /* InterfaceDeclaration */) { + if (declaration.kind === 229 /* InterfaceDeclaration */) { if (declaration.flags & 64 /* ContainsThis */) { return false; } @@ -27676,7 +29785,7 @@ var ts; type.outerTypeParameters = outerTypeParameters; type.localTypeParameters = localTypeParameters; type.instantiations = ts.createMap(); - type.instantiations[getTypeListId(type.typeParameters)] = type; + type.instantiations.set(getTypeListId(type.typeParameters), type); type.target = type; type.typeArguments = type.typeParameters; type.thisType = createType(16384 /* TypeParameter */); @@ -27695,7 +29804,7 @@ var ts; if (!pushTypeResolution(symbol, 2 /* DeclaredType */)) { return unknownType; } - var declaration = ts.getDeclarationOfKind(symbol, 285 /* JSDocTypedefTag */); + var declaration = ts.getDeclarationOfKind(symbol, 289 /* JSDocTypedefTag */); var type = void 0; if (declaration) { if (declaration.jsDocTypeLiteral) { @@ -27706,7 +29815,7 @@ var ts; } } else { - declaration = ts.getDeclarationOfKind(symbol, 228 /* TypeAliasDeclaration */); + declaration = ts.getDeclarationOfKind(symbol, 230 /* TypeAliasDeclaration */); type = getTypeFromTypeNode(declaration.type); } if (popTypeResolution()) { @@ -27716,7 +29825,7 @@ var ts; // an instantiation of the type alias with the type parameters supplied as type arguments. links.typeParameters = typeParameters; links.instantiations = ts.createMap(); - links.instantiations[getTypeListId(typeParameters)] = type; + links.instantiations.set(getTypeListId(typeParameters), type); } } else { @@ -27733,14 +29842,14 @@ var ts; return !ts.isInAmbientContext(member); } return expr.kind === 8 /* NumericLiteral */ || - expr.kind === 190 /* PrefixUnaryExpression */ && expr.operator === 37 /* MinusToken */ && + expr.kind === 191 /* PrefixUnaryExpression */ && expr.operator === 37 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */ || - expr.kind === 70 /* Identifier */ && !!symbol.exports[expr.text]; + expr.kind === 70 /* Identifier */ && !!symbol.exports.get(expr.text); } function enumHasLiteralMembers(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 229 /* EnumDeclaration */) { + if (declaration.kind === 231 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (!isLiteralEnumMember(symbol, member)) { @@ -27765,10 +29874,10 @@ var ts; enumType.symbol = symbol; if (enumHasLiteralMembers(symbol)) { var memberTypeList = []; - var memberTypes = ts.createMap(); + var memberTypes = []; for (var _i = 0, _a = enumType.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 229 /* EnumDeclaration */) { + if (declaration.kind === 231 /* EnumDeclaration */) { computeEnumMemberValues(declaration); for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; @@ -27785,7 +29894,7 @@ var ts; if (memberTypeList.length > 1) { enumType.flags |= 65536 /* Union */; enumType.types = memberTypeList; - unionTypes[getTypeListId(memberTypeList)] = enumType; + unionTypes.set(getTypeListId(memberTypeList), enumType); } } } @@ -27806,9 +29915,6 @@ var ts; if (!links.declaredType) { var type = createType(16384 /* TypeParameter */); type.symbol = symbol; - if (!ts.getDeclarationOfKind(symbol, 143 /* TypeParameter */).constraint) { - type.constraint = noConstraintType; - } links.declaredType = type; } return links.declaredType; @@ -27821,7 +29927,6 @@ var ts; return links.declaredType; } function getDeclaredTypeOfSymbol(symbol) { - ts.Debug.assert((symbol.flags & 16777216 /* Instantiated */) === 0); if (symbol.flags & (32 /* Class */ | 64 /* Interface */)) { return getDeclaredTypeOfClassOrInterface(symbol); } @@ -27860,19 +29965,20 @@ var ts; function isIndependentType(node) { switch (node.kind) { case 118 /* AnyKeyword */: - case 134 /* StringKeyword */: + case 135 /* StringKeyword */: case 132 /* NumberKeyword */: case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: + case 136 /* SymbolKeyword */: + case 133 /* ObjectKeyword */: case 104 /* VoidKeyword */: - case 137 /* UndefinedKeyword */: + case 138 /* UndefinedKeyword */: case 94 /* NullKeyword */: case 129 /* NeverKeyword */: - case 171 /* LiteralType */: + case 172 /* LiteralType */: return true; - case 162 /* ArrayType */: + case 163 /* ArrayType */: return isIndependentType(node.elementType); - case 157 /* TypeReference */: + case 158 /* TypeReference */: return isIndependentTypeReference(node); } return false; @@ -27885,7 +29991,7 @@ var ts; // A function-like declaration is considered independent (free of this references) if it has a return type // annotation that is considered independent and if each parameter is considered independent. function isIndependentFunctionLikeDeclaration(node) { - if (node.kind !== 150 /* Constructor */ && (!node.type || !isIndependentType(node.type))) { + if (node.kind !== 151 /* Constructor */ && (!node.type || !isIndependentType(node.type))) { return false; } for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { @@ -27906,12 +30012,12 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: return isIndependentVariableLikeDeclaration(declaration); - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: return isIndependentFunctionLikeDeclaration(declaration); } } @@ -27922,7 +30028,7 @@ var ts; var result = ts.createMap(); for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) { var symbol = symbols_1[_i]; - result[symbol.name] = symbol; + result.set(symbol.name, symbol); } return result; } @@ -27932,15 +30038,15 @@ var ts; var result = ts.createMap(); for (var _i = 0, symbols_2 = symbols; _i < symbols_2.length; _i++) { var symbol = symbols_2[_i]; - result[symbol.name] = mappingThisOnly && isIndependentMember(symbol) ? symbol : instantiateSymbol(symbol, mapper); + result.set(symbol.name, mappingThisOnly && isIndependentMember(symbol) ? symbol : instantiateSymbol(symbol, mapper)); } return result; } function addInheritedMembers(symbols, baseSymbols) { for (var _i = 0, baseSymbols_1 = baseSymbols; _i < baseSymbols_1.length; _i++) { var s = baseSymbols_1[_i]; - if (!symbols[s.name]) { - symbols[s.name] = s; + if (!symbols.has(s.name)) { + symbols.set(s.name, s); } } } @@ -27948,8 +30054,8 @@ var ts; if (!type.declaredProperties) { var symbol = type.symbol; type.declaredProperties = getNamedMembers(symbol.members); - type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); - type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); + type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members.get("__call")); + type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members.get("__new")); type.declaredStringIndexInfo = getIndexInfoOfSymbol(symbol, 0 /* String */); type.declaredNumberIndexInfo = getIndexInfoOfSymbol(symbol, 1 /* Number */); } @@ -27957,7 +30063,14 @@ var ts; } function getTypeWithThisArgument(type, thisArgument) { if (getObjectFlags(type) & 4 /* Reference */) { - return createTypeReference(type.target, ts.concatenate(type.typeArguments, [thisArgument || type.target.thisType])); + var target = type.target; + var typeArguments = type.typeArguments; + if (ts.length(target.typeParameters) === ts.length(typeArguments)) { + return createTypeReference(target, ts.concatenate(typeArguments, [thisArgument || target.thisType])); + } + } + else if (type.flags & 131072 /* Intersection */) { + return getIntersectionType(ts.map(type.types, function (t) { return getTypeWithThisArgument(t, thisArgument); })); } return type; } @@ -27993,10 +30106,14 @@ var ts; for (var _i = 0, baseTypes_1 = baseTypes; _i < baseTypes_1.length; _i++) { var baseType = baseTypes_1[_i]; var instantiatedBaseType = thisArgument ? getTypeWithThisArgument(instantiateType(baseType, mapper), thisArgument) : baseType; - addInheritedMembers(members, getPropertiesOfObjectType(instantiatedBaseType)); + addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType)); callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0 /* Call */)); constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1 /* Construct */)); - stringIndexInfo = stringIndexInfo || getIndexInfoOfType(instantiatedBaseType, 0 /* String */); + if (!stringIndexInfo) { + stringIndexInfo = instantiatedBaseType === anyType ? + createIndexInfo(anyType, /*isReadonly*/ false) : + getIndexInfoOfType(instantiatedBaseType, 0 /* String */); + } numberIndexInfo = numberIndexInfo || getIndexInfoOfType(instantiatedBaseType, 1 /* Number */); } } @@ -28035,14 +30152,16 @@ var ts; return [createSignature(undefined, classType.localTypeParameters, undefined, emptyArray, classType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false)]; } var baseTypeNode = getBaseTypeNodeOfClass(classType); + var isJavaScript = ts.isInJavaScriptFile(baseTypeNode); var typeArguments = ts.map(baseTypeNode.typeArguments, getTypeFromTypeNode); - var typeArgCount = typeArguments ? typeArguments.length : 0; + var typeArgCount = ts.length(typeArguments); var result = []; for (var _i = 0, baseSignatures_1 = baseSignatures; _i < baseSignatures_1.length; _i++) { var baseSig = baseSignatures_1[_i]; - var typeParamCount = baseSig.typeParameters ? baseSig.typeParameters.length : 0; - if (typeParamCount === typeArgCount) { - var sig = typeParamCount ? createSignatureInstantiation(baseSig, typeArguments) : cloneSignature(baseSig); + var minTypeArgumentCount = getMinTypeArgumentCount(baseSig.typeParameters); + var typeParamCount = ts.length(baseSig.typeParameters); + if ((isJavaScript || typeArgCount >= minTypeArgumentCount) && typeArgCount <= typeParamCount) { + var sig = typeParamCount ? createSignatureInstantiation(baseSig, fillMissingTypeArguments(typeArguments, baseSig.typeParameters, minTypeArgumentCount, baseTypeNode)) : cloneSignature(baseSig); sig.typeParameters = classType.localTypeParameters; sig.resolvedReturnType = classType; result.push(sig); @@ -28105,7 +30224,7 @@ var ts; s = cloneSignature(signature); if (ts.forEach(unionSignatures, function (sig) { return sig.thisParameter; })) { var thisType = getUnionType(ts.map(unionSignatures, function (sig) { return getTypeOfSymbol(sig.thisParameter) || anyType; }), /*subtypeReduction*/ true); - s.thisParameter = createTransientSymbol(signature.thisParameter, thisType); + s.thisParameter = createSymbolWithType(signature.thisParameter, thisType); } // Clear resolved return type we possibly got from cloneSignature s.resolvedReturnType = undefined; @@ -28121,8 +30240,8 @@ var ts; function getUnionIndexInfo(types, kind) { var indexTypes = []; var isAnyReadonly = false; - for (var _i = 0, types_1 = types; _i < types_1.length; _i++) { - var type = types_1[_i]; + for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { + var type = types_2[_i]; var indexInfo = getIndexInfoOfType(type, kind); if (!indexInfo) { return undefined; @@ -28150,22 +30269,57 @@ var ts; function unionSpreadIndexInfos(info1, info2) { return info1 && info2 && createIndexInfo(getUnionType([info1.type, info2.type]), info1.isReadonly || info2.isReadonly); } + function includeMixinType(type, types, index) { + var mixedTypes = []; + for (var i = 0; i < types.length; i++) { + if (i === index) { + mixedTypes.push(type); + } + else if (isMixinConstructorType(types[i])) { + mixedTypes.push(getReturnTypeOfSignature(getSignaturesOfType(types[i], 1 /* Construct */)[0])); + } + } + return getIntersectionType(mixedTypes); + } function resolveIntersectionTypeMembers(type) { // The members and properties collections are empty for intersection types. To get all properties of an // intersection type use getPropertiesOfType (only the language service uses this). var callSignatures = emptyArray; var constructSignatures = emptyArray; - var stringIndexInfo = undefined; - var numberIndexInfo = undefined; - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var t = _a[_i]; + var stringIndexInfo; + var numberIndexInfo; + var types = type.types; + var mixinCount = ts.countWhere(types, isMixinConstructorType); + var _loop_3 = function (i) { + var t = type.types[i]; + // When an intersection type contains mixin constructor types, the construct signatures from + // those types are discarded and their return types are mixed into the return types of all + // other construct signatures in the intersection type. For example, the intersection type + // '{ new(...args: any[]) => A } & { new(s: string) => B }' has a single construct signature + // 'new(s: string) => A & B'. + if (mixinCount === 0 || mixinCount === types.length && i === 0 || !isMixinConstructorType(t)) { + var signatures = getSignaturesOfType(t, 1 /* Construct */); + if (signatures.length && mixinCount > 0) { + signatures = ts.map(signatures, function (s) { + var clone = cloneSignature(s); + clone.resolvedReturnType = includeMixinType(getReturnTypeOfSignature(s), types, i); + return clone; + }); + } + constructSignatures = ts.concatenate(constructSignatures, signatures); + } callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(t, 0 /* Call */)); - constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(t, 1 /* Construct */)); stringIndexInfo = intersectIndexInfos(stringIndexInfo, getIndexInfoOfType(t, 0 /* String */)); numberIndexInfo = intersectIndexInfos(numberIndexInfo, getIndexInfoOfType(t, 1 /* Number */)); + }; + for (var i = 0; i < types.length; i++) { + _loop_3(i); } setStructuredTypeMembers(type, emptySymbols, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo); } + /** + * Converts an AnonymousType to a ResolvedType. + */ function resolveAnonymousTypeMembers(type) { var symbol = type.symbol; if (type.target) { @@ -28178,8 +30332,8 @@ var ts; } else if (symbol.flags & 2048 /* TypeLiteral */) { var members = symbol.members; - var callSignatures = getSignaturesOfSymbol(members["__call"]); - var constructSignatures = getSignaturesOfSymbol(members["__new"]); + var callSignatures = getSignaturesOfSymbol(members.get("__call")); + var constructSignatures = getSignaturesOfSymbol(members.get("__new")); var stringIndexInfo = getIndexInfoOfSymbol(symbol, 0 /* String */); var numberIndexInfo = getIndexInfoOfSymbol(symbol, 1 /* Number */); setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo); @@ -28188,23 +30342,27 @@ var ts; // Combinations of function, class, enum and module var members = emptySymbols; var constructSignatures = emptyArray; - if (symbol.flags & 1952 /* HasExports */) { + var stringIndexInfo = undefined; + if (symbol.exports) { members = getExportsOfSymbol(symbol); } if (symbol.flags & 32 /* Class */) { var classType = getDeclaredTypeOfClassOrInterface(symbol); - constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); + constructSignatures = getSignaturesOfSymbol(symbol.members.get("__constructor")); if (!constructSignatures.length) { constructSignatures = getDefaultConstructSignatures(classType); } var baseConstructorType = getBaseConstructorTypeOfClass(classType); - if (baseConstructorType.flags & 32768 /* Object */) { + if (baseConstructorType.flags & (32768 /* Object */ | 131072 /* Intersection */ | 540672 /* TypeVariable */)) { members = createSymbolTable(getNamedMembers(members)); - addInheritedMembers(members, getPropertiesOfObjectType(baseConstructorType)); + addInheritedMembers(members, getPropertiesOfType(baseConstructorType)); + } + else if (baseConstructorType === anyType) { + stringIndexInfo = createIndexInfo(anyType, /*isReadonly*/ false); } } var numberIndexInfo = symbol.flags & 384 /* Enum */ ? enumNumberIndexInfo : undefined; - setStructuredTypeMembers(type, members, emptyArray, constructSignatures, undefined, numberIndexInfo); + setStructuredTypeMembers(type, members, emptyArray, constructSignatures, stringIndexInfo, numberIndexInfo); // We resolve the members before computing the signatures because a signature may use // typeof with a qualified name expression that circularly references the type we are // in the process of resolving (see issue #6072). The temporarily empty signature list @@ -28218,7 +30376,6 @@ var ts; function resolveMappedTypeMembers(type) { var members = ts.createMap(); var stringIndexInfo; - var numberIndexInfo; // Resolve upfront such that recursive references see an empty object type. setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, undefined, undefined); // In { [P in K]: T }, we refer to P as the type parameter type, K as the constraint type, @@ -28226,43 +30383,53 @@ var ts; var typeParameter = getTypeParameterFromMappedType(type); var constraintType = getConstraintTypeFromMappedType(type); var templateType = getTemplateTypeFromMappedType(type); - var isReadonly = !!type.declaration.readonlyToken; - var isOptional = !!type.declaration.questionToken; - // First, if the constraint type is a type parameter, obtain the base constraint. Then, - // if the key type is a 'keyof X', obtain 'keyof C' where C is the base constraint of X. - // Finally, iterate over the constituents of the resulting iteration type. - var keyType = constraintType.flags & 16384 /* TypeParameter */ ? getApparentType(constraintType) : constraintType; - var iterationType = keyType.flags & 262144 /* Index */ ? getIndexType(getApparentType(keyType.type)) : keyType; - forEachType(iterationType, function (t) { + var modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); // The 'T' in 'keyof T' + var templateReadonly = !!type.declaration.readonlyToken; + var templateOptional = !!type.declaration.questionToken; + if (type.declaration.typeParameter.constraint.kind === 169 /* TypeOperator */) { + // We have a { [P in keyof T]: X } + for (var _i = 0, _a = getPropertiesOfType(modifiersType); _i < _a.length; _i++) { + var propertySymbol = _a[_i]; + addMemberForKeyType(getLiteralTypeFromPropertyName(propertySymbol), propertySymbol); + } + if (getIndexInfoOfType(modifiersType, 0 /* String */)) { + addMemberForKeyType(stringType); + } + } + else { + // First, if the constraint type is a type parameter, obtain the base constraint. Then, + // if the key type is a 'keyof X', obtain 'keyof C' where C is the base constraint of X. + // Finally, iterate over the constituents of the resulting iteration type. + var keyType = constraintType.flags & 540672 /* TypeVariable */ ? getApparentType(constraintType) : constraintType; + var iterationType = keyType.flags & 262144 /* Index */ ? getIndexType(getApparentType(keyType.type)) : keyType; + forEachType(iterationType, addMemberForKeyType); + } + setStructuredTypeMembers(type, members, emptyArray, emptyArray, stringIndexInfo, undefined); + function addMemberForKeyType(t, propertySymbol) { // Create a mapper from T to the current iteration type constituent. Then, if the // mapped type is itself an instantiated type, combine the iteration mapper with the // instantiation mapper. - var iterationMapper = createUnaryTypeMapper(typeParameter, t); + var iterationMapper = createTypeMapper([typeParameter], [t]); var templateMapper = type.mapper ? combineTypeMappers(type.mapper, iterationMapper) : iterationMapper; var propType = instantiateType(templateType, templateMapper); - // If the current iteration type constituent is a literal type, create a property. - // Otherwise, for type string create a string index signature and for type number - // create a numeric index signature. - if (t.flags & (32 /* StringLiteral */ | 64 /* NumberLiteral */ | 256 /* EnumLiteral */)) { + // If the current iteration type constituent is a string literal type, create a property. + // Otherwise, for type string create a string index signature. + if (t.flags & 32 /* StringLiteral */) { var propName = t.text; - var prop = createSymbol(4 /* Property */ | 67108864 /* Transient */ | (isOptional ? 536870912 /* Optional */ : 0), propName); - prop.type = addOptionality(propType, isOptional); - prop.isReadonly = isReadonly; - members[propName] = prop; + var modifiersProp = getPropertyOfType(modifiersType, propName); + var isOptional = templateOptional || !!(modifiersProp && modifiersProp.flags & 67108864 /* Optional */); + var prop = createSymbol(4 /* Property */ | (isOptional ? 67108864 /* Optional */ : 0), propName); + prop.checkFlags = templateReadonly || modifiersProp && isReadonlySymbol(modifiersProp) ? 8 /* Readonly */ : 0; + prop.type = propType; + if (propertySymbol) { + prop.syntheticOrigin = propertySymbol; + } + members.set(propName, prop); } else if (t.flags & 2 /* String */) { - stringIndexInfo = createIndexInfo(propType, isReadonly); + stringIndexInfo = createIndexInfo(propType, templateReadonly); } - else if (t.flags & 4 /* Number */) { - numberIndexInfo = createIndexInfo(propType, isReadonly); - } - }); - // If we created both a string and a numeric string index signature, and if the two index - // signatures have identical types, discard the redundant numeric index signature. - if (stringIndexInfo && numberIndexInfo && isTypeIdenticalTo(stringIndexInfo.type, numberIndexInfo.type)) { - numberIndexInfo = undefined; } - setStructuredTypeMembers(type, members, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo); } function getTypeParameterFromMappedType(type) { return type.typeParameter || @@ -28275,16 +30442,34 @@ var ts; function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? - instantiateType(getTypeFromTypeNode(type.declaration.type), type.mapper || identityMapper) : + instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!type.declaration.questionToken), type.mapper || identityMapper) : unknownType); } - function getErasedTemplateTypeFromMappedType(type) { - return instantiateType(getTemplateTypeFromMappedType(type), createUnaryTypeMapper(getTypeParameterFromMappedType(type), anyType)); + function getModifiersTypeFromMappedType(type) { + if (!type.modifiersType) { + var constraintDeclaration = type.declaration.typeParameter.constraint; + if (constraintDeclaration.kind === 169 /* TypeOperator */) { + // If the constraint declaration is a 'keyof T' node, the modifiers type is T. We check + // AST nodes here because, when T is a non-generic type, the logic below eagerly resolves + // 'keyof T' to a literal union type and we can't recover T from that type. + type.modifiersType = instantiateType(getTypeFromTypeNode(constraintDeclaration.type), type.mapper || identityMapper); + } + else { + // Otherwise, get the declared constraint type, and if the constraint type is a type parameter, + // get the constraint of that type parameter. If the resulting type is an indexed type 'keyof T', + // the modifiers type is T. Otherwise, the modifiers type is {}. + var declaredType = getTypeFromMappedTypeNode(type.declaration); + var constraint = getConstraintTypeFromMappedType(declaredType); + var extendedConstraint = constraint && constraint.flags & 16384 /* TypeParameter */ ? getConstraintOfTypeParameter(constraint) : constraint; + type.modifiersType = extendedConstraint && extendedConstraint.flags & 262144 /* Index */ ? instantiateType(extendedConstraint.type, type.mapper || identityMapper) : emptyObjectType; + } + } + return type.modifiersType; } function isGenericMappedType(type) { if (getObjectFlags(type) & 32 /* Mapped */) { var constraintType = getConstraintTypeFromMappedType(type); - return !!(constraintType.flags & (16384 /* TypeParameter */ | 262144 /* Index */)); + return maybeTypeOfKind(constraintType, 540672 /* TypeVariable */ | 262144 /* Index */); } return false; } @@ -28321,42 +30506,40 @@ var ts; return emptyArray; } /** If the given type is an object type and that type has a property by the given name, - * return the symbol for that property. Otherwise return undefined. */ + * return the symbol for that property. Otherwise return undefined. + */ function getPropertyOfObjectType(type, name) { if (type.flags & 32768 /* Object */) { var resolved = resolveStructuredTypeMembers(type); - var symbol = resolved.members[name]; + var symbol = resolved.members.get(name); if (symbol && symbolIsValue(symbol)) { return symbol; } } } function getPropertiesOfUnionOrIntersectionType(type) { - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var current = _a[_i]; - for (var _b = 0, _c = getPropertiesOfType(current); _b < _c.length; _b++) { - var prop = _c[_b]; - getUnionOrIntersectionProperty(type, prop.name); - } - // The properties of a union type are those that are present in all constituent types, so - // we only need to check the properties of the first type - if (type.flags & 65536 /* Union */) { - break; - } - } - var props = type.resolvedProperties; - if (props) { - var result = []; - for (var key in props) { - var prop = props[key]; - // We need to filter out partial properties in union types - if (!(prop.flags & 268435456 /* SyntheticProperty */ && prop.isPartial)) { - result.push(prop); + if (!type.resolvedProperties) { + var members = ts.createMap(); + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var current = _a[_i]; + for (var _b = 0, _c = getPropertiesOfType(current); _b < _c.length; _b++) { + var prop = _c[_b]; + if (!members.has(prop.name)) { + var combinedProp = getPropertyOfUnionOrIntersectionType(type, prop.name); + if (combinedProp) { + members.set(prop.name, combinedProp); + } + } + } + // The properties of a union type are those that are present in all constituent types, so + // we only need to check the properties of the first type + if (type.flags & 65536 /* Union */) { + break; } } - return result; + type.resolvedProperties = getNamedMembers(members); } - return emptyArray; + return type.resolvedProperties; } function getPropertiesOfType(type) { type = getApparentType(type); @@ -28364,25 +30547,114 @@ var ts; getPropertiesOfUnionOrIntersectionType(type) : getPropertiesOfObjectType(type); } - /** - * The apparent type of a type parameter is the base constraint instantiated with the type parameter - * as the type argument for the 'this' type. - */ - function getApparentTypeOfTypeParameter(type) { - if (!type.resolvedApparentType) { - var constraintType = getConstraintOfTypeParameter(type); - while (constraintType && constraintType.flags & 16384 /* TypeParameter */) { - constraintType = getConstraintOfTypeParameter(constraintType); + function getConstraintOfType(type) { + return type.flags & 16384 /* TypeParameter */ ? getConstraintOfTypeParameter(type) : + type.flags & 524288 /* IndexedAccess */ ? getConstraintOfIndexedAccess(type) : + getBaseConstraintOfType(type); + } + function getConstraintOfTypeParameter(typeParameter) { + return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : undefined; + } + function getConstraintOfIndexedAccess(type) { + var baseObjectType = getBaseConstraintOfType(type.objectType); + var baseIndexType = getBaseConstraintOfType(type.indexType); + return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined; + } + function getBaseConstraintOfType(type) { + if (type.flags & (540672 /* TypeVariable */ | 196608 /* UnionOrIntersection */)) { + var constraint = getResolvedBaseConstraint(type); + if (constraint !== noConstraintType && constraint !== circularConstraintType) { + return constraint; } - type.resolvedApparentType = getTypeWithThisArgument(constraintType || emptyObjectType, type); } - return type.resolvedApparentType; + else if (type.flags & 262144 /* Index */) { + return stringType; + } + return undefined; + } + function hasNonCircularBaseConstraint(type) { + return getResolvedBaseConstraint(type) !== circularConstraintType; } /** - * The apparent type of an indexed access T[K] is the type of T's string index signature, if any. + * Return the resolved base constraint of a type variable. The noConstraintType singleton is returned if the + * type variable has no constraint, and the circularConstraintType singleton is returned if the constraint + * circularly references the type variable. */ - function getApparentTypeOfIndexedAccess(type) { - return getIndexTypeOfType(getApparentType(type.objectType), 0 /* String */) || type; + function getResolvedBaseConstraint(type) { + var typeStack; + var circular; + if (!type.resolvedBaseConstraint) { + typeStack = []; + var constraint = getBaseConstraint(type); + type.resolvedBaseConstraint = circular ? circularConstraintType : getTypeWithThisArgument(constraint || noConstraintType, type); + } + return type.resolvedBaseConstraint; + function getBaseConstraint(t) { + if (ts.contains(typeStack, t)) { + circular = true; + return undefined; + } + typeStack.push(t); + var result = computeBaseConstraint(t); + typeStack.pop(); + return result; + } + function computeBaseConstraint(t) { + if (t.flags & 16384 /* TypeParameter */) { + var constraint = getConstraintFromTypeParameter(t); + return t.isThisType ? constraint : + constraint ? getBaseConstraint(constraint) : undefined; + } + if (t.flags & 196608 /* UnionOrIntersection */) { + var types = t.types; + var baseTypes = []; + for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { + var type_2 = types_3[_i]; + var baseType = getBaseConstraint(type_2); + if (baseType) { + baseTypes.push(baseType); + } + } + return t.flags & 65536 /* Union */ && baseTypes.length === types.length ? getUnionType(baseTypes) : + t.flags & 131072 /* Intersection */ && baseTypes.length ? getIntersectionType(baseTypes) : + undefined; + } + if (t.flags & 262144 /* Index */) { + return stringType; + } + if (t.flags & 524288 /* IndexedAccess */) { + var baseObjectType = getBaseConstraint(t.objectType); + var baseIndexType = getBaseConstraint(t.indexType); + var baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined; + return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined; + } + return t; + } + } + function getApparentTypeOfIntersectionType(type) { + return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument(type, type)); + } + /** + * Gets the default type for a type parameter. + * + * If the type parameter is the result of an instantiation, this gets the instantiated + * default type of its target. If the type parameter has no default type, `undefined` + * is returned. + * + * This function *does not* perform a circularity check. + */ + function getDefaultFromTypeParameter(typeParameter) { + if (!typeParameter.default) { + if (typeParameter.target) { + var targetDefault = getDefaultFromTypeParameter(typeParameter.target); + typeParameter.default = targetDefault ? instantiateType(targetDefault, typeParameter.mapper) : noConstraintType; + } + else { + var defaultDeclaration = typeParameter.symbol && ts.forEach(typeParameter.symbol.declarations, function (decl) { return ts.isTypeParameter(decl) && decl.default; }); + typeParameter.default = defaultDeclaration ? getTypeFromTypeNode(defaultDeclaration) : noConstraintType; + } + } + return typeParameter.default === noConstraintType ? undefined : typeParameter.default; } /** * For a type parameter, return the base constraint of the type parameter. For the string, number, @@ -28390,28 +30662,31 @@ var ts; * type itself. Note that the apparent type of a union type is the union type itself. */ function getApparentType(type) { - var t = type.flags & 16384 /* TypeParameter */ ? getApparentTypeOfTypeParameter(type) : - type.flags & 524288 /* IndexedAccess */ ? getApparentTypeOfIndexedAccess(type) : - type; - return t.flags & 262178 /* StringLike */ ? globalStringType : - t.flags & 340 /* NumberLike */ ? globalNumberType : - t.flags & 136 /* BooleanLike */ ? globalBooleanType : - t.flags & 512 /* ESSymbol */ ? getGlobalESSymbolType() : - t; + var t = type.flags & 540672 /* TypeVariable */ ? getBaseConstraintOfType(type) || emptyObjectType : type; + return t.flags & 131072 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : + t.flags & 262178 /* StringLike */ ? globalStringType : + t.flags & 340 /* NumberLike */ ? globalNumberType : + t.flags & 136 /* BooleanLike */ ? globalBooleanType : + t.flags & 512 /* ESSymbol */ ? getGlobalESSymbolType(/*reportErrors*/ languageVersion >= 2 /* ES2015 */) : + t.flags & 16777216 /* NonPrimitive */ ? emptyObjectType : + t; } function createUnionOrIntersectionProperty(containingType, name) { - var types = containingType.types; var props; + var types = containingType.types; + var isUnion = containingType.flags & 65536 /* Union */; + var excludeModifiers = isUnion ? 24 /* NonPublicAccessibilityModifier */ : 0; // Flags we want to propagate to the result if they exist in all source symbols - var commonFlags = (containingType.flags & 131072 /* Intersection */) ? 536870912 /* Optional */ : 0 /* None */; - var isReadonly = false; - var isPartial = false; - for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { - var current = types_2[_i]; + var commonFlags = isUnion ? 0 /* None */ : 67108864 /* Optional */; + var syntheticFlag = 4 /* SyntheticMethod */; + var checkFlags = 0; + for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { + var current = types_4[_i]; var type = getApparentType(current); if (type !== unknownType) { var prop = getPropertyOfType(type, name); - if (prop && !(getDeclarationModifierFlagsFromSymbol(prop) & (8 /* Private */ | 16 /* Protected */))) { + var modifiers = prop ? getDeclarationModifierFlagsFromSymbol(prop) : 0; + if (prop && !(modifiers & excludeModifiers)) { commonFlags &= prop.flags; if (!props) { props = [prop]; @@ -28419,25 +30694,29 @@ var ts; else if (!ts.contains(props, prop)) { props.push(prop); } - if (isReadonlySymbol(prop)) { - isReadonly = true; + checkFlags |= (isReadonlySymbol(prop) ? 8 /* Readonly */ : 0) | + (!(modifiers & 24 /* NonPublicAccessibilityModifier */) ? 64 /* ContainsPublic */ : 0) | + (modifiers & 16 /* Protected */ ? 128 /* ContainsProtected */ : 0) | + (modifiers & 8 /* Private */ ? 256 /* ContainsPrivate */ : 0) | + (modifiers & 32 /* Static */ ? 512 /* ContainsStatic */ : 0); + if (!isMethodLike(prop)) { + syntheticFlag = 2 /* SyntheticProperty */; } } - else if (containingType.flags & 65536 /* Union */) { - isPartial = true; + else if (isUnion) { + checkFlags |= 16 /* Partial */; } } } if (!props) { return undefined; } - if (props.length === 1 && !isPartial) { + if (props.length === 1 && !(checkFlags & 16 /* Partial */)) { return props[0]; } var propTypes = []; var declarations = []; var commonType = undefined; - var hasNonUniformType = false; for (var _a = 0, props_1 = props; _a < props_1.length; _a++) { var prop = props_1[_a]; if (prop.declarations) { @@ -28448,17 +30727,15 @@ var ts; commonType = type; } else if (type !== commonType) { - hasNonUniformType = true; + checkFlags |= 32 /* HasNonUniformType */; } propTypes.push(type); } - var result = createSymbol(4 /* Property */ | 67108864 /* Transient */ | 268435456 /* SyntheticProperty */ | commonFlags, name); + var result = createSymbol(4 /* Property */ | commonFlags, name); + result.checkFlags = syntheticFlag | checkFlags; result.containingType = containingType; - result.hasNonUniformType = hasNonUniformType; - result.isPartial = isPartial; result.declarations = declarations; - result.isReadonly = isReadonly; - result.type = containingType.flags & 65536 /* Union */ ? getUnionType(propTypes) : getIntersectionType(propTypes); + result.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes); return result; } // Return the symbol for a given property in a union or intersection type, or undefined if the property @@ -28467,12 +30744,12 @@ var ts; // these partial properties when identifying discriminant properties, but otherwise they are filtered out // and do not appear to be present in the union type. function getUnionOrIntersectionProperty(type, name) { - var properties = type.resolvedProperties || (type.resolvedProperties = ts.createMap()); - var property = properties[name]; + var properties = type.propertyCache || (type.propertyCache = ts.createMap()); + var property = properties.get(name); if (!property) { property = createUnionOrIntersectionProperty(type, name); if (property) { - properties[name] = property; + properties.set(name, property); } } return property; @@ -28480,7 +30757,7 @@ var ts; function getPropertyOfUnionOrIntersectionType(type, name) { var property = getUnionOrIntersectionProperty(type, name); // We need to filter out partial properties in union types - return property && !(property.flags & 268435456 /* SyntheticProperty */ && property.isPartial) ? property : undefined; + return property && !(getCheckFlags(property) & 16 /* Partial */) ? property : undefined; } /** * Return the symbol for the property with the given name in the given type. Creates synthetic union properties when @@ -28494,7 +30771,7 @@ var ts; type = getApparentType(type); if (type.flags & 32768 /* Object */) { var resolved = resolveStructuredTypeMembers(type); - var symbol = resolved.members[name]; + var symbol = resolved.members.get(name); if (symbol && symbolIsValue(symbol)) { return symbol; } @@ -28561,7 +30838,7 @@ var ts; return undefined; } function getTypeParametersFromJSDocTemplate(declaration) { - if (declaration.flags & 2097152 /* JavaScriptFile */) { + if (declaration.flags & 65536 /* JavaScriptFile */) { var templateTag = ts.getJSDocTemplateTag(declaration); if (templateTag) { return getTypeParametersFromDeclaration(templateTag.typeParameters); @@ -28583,16 +30860,16 @@ var ts; } function symbolsToArray(symbols) { var result = []; - for (var id in symbols) { + symbols.forEach(function (symbol, id) { if (!isReservedMemberName(id)) { - result.push(symbols[id]); + result.push(symbol); } - } + }); return result; } function isJSDocOptionalParameter(node) { - if (node.flags & 2097152 /* JavaScriptFile */) { - if (node.type && node.type.kind === 273 /* JSDocOptionalType */) { + if (node.flags & 65536 /* JavaScriptFile */) { + if (node.type && node.type.kind === 277 /* JSDocOptionalType */) { return true; } var paramTags = ts.getJSDocParameterTags(node); @@ -28603,7 +30880,7 @@ var ts; return true; } if (paramTag.typeExpression) { - return paramTag.typeExpression.type.kind === 273 /* JSDocOptionalType */; + return paramTag.typeExpression.type.kind === 277 /* JSDocOptionalType */; } } } @@ -28628,6 +30905,12 @@ var ts; ts.Debug.assert(parameterIndex >= 0); return parameterIndex >= signature.minArgumentCount; } + var iife = ts.getImmediatelyInvokedFunctionExpression(node.parent); + if (iife) { + return !node.type && + !node.dotDotDotToken && + ts.indexOf(node.parent.parameters, node) >= iife.arguments.length; + } return false; } function createTypePredicateFromTypePredicateNode(node) { @@ -28647,19 +30930,68 @@ var ts; }; } } + /** + * Gets the minimum number of type arguments needed to satisfy all non-optional type + * parameters. + */ + function getMinTypeArgumentCount(typeParameters) { + var minTypeArgumentCount = 0; + if (typeParameters) { + for (var i = 0; i < typeParameters.length; i++) { + if (!getDefaultFromTypeParameter(typeParameters[i])) { + minTypeArgumentCount = i + 1; + } + } + } + return minTypeArgumentCount; + } + /** + * Fill in default types for unsupplied type arguments. If `typeArguments` is undefined + * when a default type is supplied, a new array will be created and returned. + * + * @param typeArguments The supplied type arguments. + * @param typeParameters The requested type parameters. + * @param minTypeArgumentCount The minimum number of required type arguments. + */ + function fillMissingTypeArguments(typeArguments, typeParameters, minTypeArgumentCount, location) { + var numTypeParameters = ts.length(typeParameters); + if (numTypeParameters) { + var numTypeArguments = ts.length(typeArguments); + var isJavaScript = ts.isInJavaScriptFile(location); + if ((isJavaScript || numTypeArguments >= minTypeArgumentCount) && numTypeArguments <= numTypeParameters) { + if (!typeArguments) { + typeArguments = []; + } + // Map an unsatisfied type parameter with a default type. + // If a type parameter does not have a default type, or if the default type + // is a forward reference, the empty object type is used. + for (var i = numTypeArguments; i < numTypeParameters; i++) { + typeArguments[i] = isJavaScript ? anyType : emptyObjectType; + } + for (var i = numTypeArguments; i < numTypeParameters; i++) { + var mapper = createTypeMapper(typeParameters, typeArguments); + var defaultType = getDefaultFromTypeParameter(typeParameters[i]); + typeArguments[i] = defaultType ? instantiateType(defaultType, mapper) : isJavaScript ? anyType : emptyObjectType; + } + } + } + return typeArguments; + } function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { var parameters = []; var hasLiteralTypes = false; - var minArgumentCount = -1; + var minArgumentCount = 0; var thisParameter = undefined; var hasThisParameter = void 0; + var iife = ts.getImmediatelyInvokedFunctionExpression(declaration); var isJSConstructSignature = ts.isJSDocConstructSignature(declaration); + var isUntypedSignatureInJSFile = !iife && !isJSConstructSignature && ts.isInJavaScriptFile(declaration) && !ts.hasJSDocParameterTags(declaration); // If this is a JSDoc construct signature, then skip the first parameter in the // parameter list. The first parameter represents the return type of the construct // signature. - for (var i = isJSConstructSignature ? 1 : 0, n = declaration.parameters.length; i < n; i++) { + for (var i = isJSConstructSignature ? 1 : 0; i < declaration.parameters.length; i++) { var param = declaration.parameters[i]; var paramSymbol = param.symbol; // Include parameter symbol instead of property symbol in the signature @@ -28674,43 +31006,36 @@ var ts; else { parameters.push(paramSymbol); } - if (param.type && param.type.kind === 171 /* LiteralType */) { + if (param.type && param.type.kind === 172 /* LiteralType */) { hasLiteralTypes = true; } - if (param.initializer || param.questionToken || param.dotDotDotToken || isJSDocOptionalParameter(param)) { - if (minArgumentCount < 0) { - minArgumentCount = i - (hasThisParameter ? 1 : 0); - } - } - else { - // If we see any required parameters, it means the prior ones were not in fact optional. - minArgumentCount = -1; + // Record a new minimum argument count if this is not an optional parameter + var isOptionalParameter_1 = param.initializer || param.questionToken || param.dotDotDotToken || + iife && parameters.length > iife.arguments.length && !param.type || + isJSDocOptionalParameter(param) || + isUntypedSignatureInJSFile; + if (!isOptionalParameter_1) { + minArgumentCount = parameters.length; } } // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation - if ((declaration.kind === 151 /* GetAccessor */ || declaration.kind === 152 /* SetAccessor */) && + if ((declaration.kind === 152 /* GetAccessor */ || declaration.kind === 153 /* SetAccessor */) && !ts.hasDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 151 /* GetAccessor */ ? 152 /* SetAccessor */ : 151 /* GetAccessor */; + var otherKind = declaration.kind === 152 /* GetAccessor */ ? 153 /* SetAccessor */ : 152 /* GetAccessor */; var other = ts.getDeclarationOfKind(declaration.symbol, otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - if (minArgumentCount < 0) { - minArgumentCount = declaration.parameters.length - (hasThisParameter ? 1 : 0); - } - if (isJSConstructSignature) { - minArgumentCount--; - } - var classType = declaration.kind === 150 /* Constructor */ ? + var classType = declaration.kind === 151 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : getTypeParametersFromJSDocTemplate(declaration); var returnType = getSignatureReturnTypeFromDeclaration(declaration, isJSConstructSignature, classType); - var typePredicate = declaration.type && declaration.type.kind === 156 /* TypePredicate */ ? + var typePredicate = declaration.type && declaration.type.kind === 157 /* TypePredicate */ ? createTypePredicateFromTypePredicateNode(declaration.type) : undefined; links.resolvedSignature = createSignature(declaration, typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, ts.hasRestParameter(declaration), hasLiteralTypes); @@ -28727,7 +31052,7 @@ var ts; else if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.flags & 2097152 /* JavaScriptFile */) { + if (declaration.flags & 65536 /* JavaScriptFile */) { var type = getReturnTypeFromJSDocComment(declaration); if (type && type !== unknownType) { return type; @@ -28735,35 +31060,63 @@ var ts; } // TypeScript 1.0 spec (April 2014): // If only one accessor includes a type annotation, the other behaves as if it had the same type annotation. - if (declaration.kind === 151 /* GetAccessor */ && !ts.hasDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(declaration.symbol, 152 /* SetAccessor */); + if (declaration.kind === 152 /* GetAccessor */ && !ts.hasDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(declaration.symbol, 153 /* SetAccessor */); return getAnnotatedAccessorType(setter); } if (ts.nodeIsMissing(declaration.body)) { return anyType; } } + function containsArgumentsReference(declaration) { + var links = getNodeLinks(declaration); + if (links.containsArgumentsReference === undefined) { + if (links.flags & 8192 /* CaptureArguments */) { + links.containsArgumentsReference = true; + } + else { + links.containsArgumentsReference = traverse(declaration.body); + } + } + return links.containsArgumentsReference; + function traverse(node) { + if (!node) + return false; + switch (node.kind) { + case 70 /* Identifier */: + return node.text === "arguments" && ts.isPartOfExpression(node); + case 148 /* PropertyDeclaration */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + return node.name.kind === 143 /* ComputedPropertyName */ + && traverse(node.name); + default: + return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && ts.forEachChild(node, traverse); + } + } + } function getSignaturesOfSymbol(symbol) { if (!symbol) return emptyArray; var result = []; - for (var i = 0, len = symbol.declarations.length; i < len; i++) { + for (var i = 0; i < symbol.declarations.length; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 225 /* FunctionDeclaration */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 274 /* JSDocFunctionType */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: + case 227 /* FunctionDeclaration */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 278 /* JSDocFunctionType */: // Don't include signature if node is the implementation of an overloaded function. A node is considered // an implementation node if it has a body and the previous node is of the same kind and immediately // precedes the implementation node (i.e. has the same parent and ends where the implementation starts). @@ -28810,7 +31163,7 @@ var ts; } if (!popTypeResolution()) { type = anyType; - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { var declaration = signature.declaration; if (declaration.name) { error(declaration.name, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, ts.declarationNameToString(declaration.name)); @@ -28834,9 +31187,14 @@ var ts; return anyType; } function getSignatureInstantiation(signature, typeArguments) { + typeArguments = fillMissingTypeArguments(typeArguments, signature.typeParameters, getMinTypeArgumentCount(signature.typeParameters)); var instantiations = signature.instantiations || (signature.instantiations = ts.createMap()); var id = getTypeListId(typeArguments); - return instantiations[id] || (instantiations[id] = createSignatureInstantiation(signature, typeArguments)); + var instantiation = instantiations.get(id); + if (!instantiation) { + instantiations.set(id, instantiation = createSignatureInstantiation(signature, typeArguments)); + } + return instantiation; } function createSignatureInstantiation(signature, typeArguments) { return instantiateSignature(signature, createTypeMapper(signature.typeParameters, typeArguments), /*eraseTypeParameters*/ true); @@ -28855,7 +31213,7 @@ var ts; // object type literal or interface (using the new keyword). Each way of declaring a constructor // will result in a different declaration kind. if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 150 /* Constructor */ || signature.declaration.kind === 154 /* ConstructSignature */; + var isConstructor = signature.declaration.kind === 151 /* Constructor */ || signature.declaration.kind === 155 /* ConstructSignature */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = emptyArray; @@ -28866,10 +31224,10 @@ var ts; return signature.isolatedSignatureType; } function getIndexSymbol(symbol) { - return symbol.members["__index"]; + return symbol.members.get("__index"); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 132 /* NumberKeyword */ : 134 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 132 /* NumberKeyword */ : 135 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -28896,21 +31254,9 @@ var ts; return undefined; } function getConstraintDeclaration(type) { - return ts.getDeclarationOfKind(type.symbol, 143 /* TypeParameter */).constraint; + return ts.getDeclarationOfKind(type.symbol, 144 /* TypeParameter */).constraint; } - function hasConstraintReferenceTo(type, target) { - var checked; - while (type && type.flags & 16384 /* TypeParameter */ && !(type.isThisType) && !ts.contains(checked, type)) { - if (type === target) { - return true; - } - (checked || (checked = [])).push(type); - var constraintDeclaration = getConstraintDeclaration(type); - type = constraintDeclaration && getTypeFromTypeNode(constraintDeclaration); - } - return false; - } - function getConstraintOfTypeParameter(typeParameter) { + function getConstraintFromTypeParameter(typeParameter) { if (!typeParameter.constraint) { if (typeParameter.target) { var targetConstraint = getConstraintOfTypeParameter(typeParameter.target); @@ -28918,28 +31264,23 @@ var ts; } else { var constraintDeclaration = getConstraintDeclaration(typeParameter); - var constraint = getTypeFromTypeNode(constraintDeclaration); - if (hasConstraintReferenceTo(constraint, typeParameter)) { - error(constraintDeclaration, ts.Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(typeParameter)); - constraint = unknownType; - } - typeParameter.constraint = constraint; + typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : noConstraintType; } } return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 143 /* TypeParameter */).parent); + return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 144 /* TypeParameter */).parent); } function getTypeListId(types) { var result = ""; if (types) { - var length_3 = types.length; + var length_4 = types.length; var i = 0; - while (i < length_3) { + while (i < length_4) { var startId = types[i].id; var count = 1; - while (i + count < length_3 && types[i + count].id === startId + count) { + while (i + count < length_4 && types[i + count].id === startId + count) { count++; } if (result.length) { @@ -28960,8 +31301,8 @@ var ts; // that care about the presence of such types at arbitrary depth in a containing type. function getPropagatingFlagsOfTypes(types, excludeKinds) { var result = 0; - for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { - var type = types_3[_i]; + for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { + var type = types_5[_i]; if (!(type.flags & excludeKinds)) { result |= type.flags; } @@ -28970,9 +31311,10 @@ var ts; } function createTypeReference(target, typeArguments) { var id = getTypeListId(typeArguments); - var type = target.instantiations[id]; + var type = target.instantiations.get(id); if (!type) { - type = target.instantiations[id] = createObjectType(4 /* Reference */, target.symbol); + type = createObjectType(4 /* Reference */, target.symbol); + target.instantiations.set(id, type); type.flags |= typeArguments ? getPropagatingFlagsOfTypes(typeArguments, /*excludeKinds*/ 0) : 0; type.target = target; type.typeArguments = typeArguments; @@ -28988,21 +31330,26 @@ var ts; return type; } function getTypeReferenceArity(type) { - return type.target.typeParameters ? type.target.typeParameters.length : 0; + return ts.length(type.target.typeParameters); } // Get type from reference to class or interface function getTypeFromClassOrInterfaceReference(node, symbol) { var type = getDeclaredTypeOfSymbol(getMergedSymbol(symbol)); var typeParameters = type.localTypeParameters; if (typeParameters) { - if (!node.typeArguments || node.typeArguments.length !== typeParameters.length) { - error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, /*enclosingDeclaration*/ undefined, 1 /* WriteArrayAsGenericType */), typeParameters.length); + var numTypeArguments = ts.length(node.typeArguments); + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + if (!ts.isInJavaScriptFile(node) && (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length)) { + error(node, minTypeArgumentCount === typeParameters.length + ? ts.Diagnostics.Generic_type_0_requires_1_type_argument_s + : ts.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments, typeToString(type, /*enclosingDeclaration*/ undefined, 1 /* WriteArrayAsGenericType */), minTypeArgumentCount, typeParameters.length); return unknownType; } // In a type reference, the outer type parameters of the referenced class or interface are automatically // supplied as type arguments and the type reference only specifies arguments for the local type parameters // of the class or interface. - return createTypeReference(type, ts.concatenate(type.outerTypeParameters, ts.map(node.typeArguments, getTypeFromTypeNode))); + var typeArguments = ts.concatenate(type.outerTypeParameters, fillMissingTypeArguments(ts.map(node.typeArguments, getTypeFromTypeNode), typeParameters, minTypeArgumentCount, node)); + return createTypeReference(type, typeArguments); } if (node.typeArguments) { error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); @@ -29015,7 +31362,11 @@ var ts; var links = getSymbolLinks(symbol); var typeParameters = links.typeParameters; var id = getTypeListId(typeArguments); - return links.instantiations[id] || (links.instantiations[id] = instantiateTypeNoAlias(type, createTypeMapper(typeParameters, typeArguments))); + var instantiation = links.instantiations.get(id); + if (!instantiation) { + links.instantiations.set(id, instantiation = instantiateTypeNoAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters))))); + } + return instantiation; } // Get type from reference to type alias. When a type alias is generic, the declared type of the type alias may include // references to the type parameters of the alias. We replace those with the actual type arguments by instantiating the @@ -29024,8 +31375,12 @@ var ts; var type = getDeclaredTypeOfSymbol(symbol); var typeParameters = getSymbolLinks(symbol).typeParameters; if (typeParameters) { - if (!node.typeArguments || node.typeArguments.length !== typeParameters.length) { - error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, symbolToString(symbol), typeParameters.length); + var numTypeArguments = ts.length(node.typeArguments); + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + if (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length) { + error(node, minTypeArgumentCount === typeParameters.length + ? ts.Diagnostics.Generic_type_0_requires_1_type_argument_s + : ts.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments, symbolToString(symbol), minTypeArgumentCount, typeParameters.length); return unknownType; } var typeArguments = ts.map(node.typeArguments, getTypeFromTypeNode); @@ -29047,11 +31402,11 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 157 /* TypeReference */: + case 158 /* TypeReference */: return node.typeName; - case 272 /* JSDocTypeReference */: + case 276 /* JSDocTypeReference */: return node.name; - case 199 /* ExpressionWithTypeArguments */: + case 200 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; @@ -29077,7 +31432,7 @@ var ts; if (symbol.flags & 524288 /* TypeAlias */) { return getTypeFromTypeAliasReference(node, symbol); } - if (symbol.flags & 107455 /* Value */ && node.kind === 272 /* JSDocTypeReference */) { + if (symbol.flags & 107455 /* Value */ && node.kind === 276 /* JSDocTypeReference */) { // A JSDocTypeReference may have resolved to a value (as opposed to a type). In // that case, the type of this reference is just the type of the value we resolved // to. @@ -29085,19 +31440,54 @@ var ts; } return getTypeFromNonGenericTypeReference(node, symbol); } + function getPrimitiveTypeFromJSDocTypeReference(node) { + if (ts.isIdentifier(node.name)) { + switch (node.name.text) { + case "String": + return stringType; + case "Number": + return numberType; + case "Boolean": + return booleanType; + case "Void": + return voidType; + case "Undefined": + return undefinedType; + case "Null": + return nullType; + case "Object": + return anyType; + case "Function": + return anyFunctionType; + case "Array": + case "array": + return !node.typeArguments || !node.typeArguments.length ? createArrayType(anyType) : undefined; + case "Promise": + case "promise": + return !node.typeArguments || !node.typeArguments.length ? createPromiseType(anyType) : undefined; + } + } + } + function getTypeFromJSDocNullableTypeNode(node) { + var type = getTypeFromTypeNode(node.type); + return strictNullChecks ? getUnionType([type, nullType]) : type; + } function getTypeFromTypeReference(node) { var links = getNodeLinks(node); if (!links.resolvedType) { var symbol = void 0; var type = void 0; - if (node.kind === 272 /* JSDocTypeReference */) { - var typeReferenceName = getTypeReferenceName(node); - symbol = resolveTypeReferenceName(typeReferenceName); - type = getTypeReferenceType(node, symbol); + if (node.kind === 276 /* JSDocTypeReference */) { + type = getPrimitiveTypeFromJSDocTypeReference(node); + if (!type) { + var typeReferenceName = getTypeReferenceName(node); + symbol = resolveTypeReferenceName(typeReferenceName); + type = getTypeReferenceType(node, symbol); + } } else { // We only support expressions that are simple qualified names. For other expressions this produces undefined. - var typeNameOrExpression = node.kind === 157 /* TypeReference */ + var typeNameOrExpression = node.kind === 158 /* TypeReference */ ? node.typeName : ts.isEntityNameExpression(node.expression) ? node.expression @@ -29129,12 +31519,12 @@ var ts; function getTypeOfGlobalSymbol(symbol, arity) { function getTypeDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { - var declaration = declarations_3[_i]; + for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { + var declaration = declarations_4[_i]; switch (declaration.kind) { - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 229 /* EnumDeclaration */: + case 228 /* ClassDeclaration */: + case 229 /* InterfaceDeclaration */: + case 231 /* EnumDeclaration */: return declaration; } } @@ -29147,24 +31537,68 @@ var ts; error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbol.name); return arity ? emptyGenericType : emptyObjectType; } - if ((type.typeParameters ? type.typeParameters.length : 0) !== arity) { + if (ts.length(type.typeParameters) !== arity) { error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_have_1_type_parameter_s, symbol.name, arity); return arity ? emptyGenericType : emptyObjectType; } return type; } - function getGlobalValueSymbol(name) { - return getGlobalSymbol(name, 107455 /* Value */, ts.Diagnostics.Cannot_find_global_value_0); + function getGlobalValueSymbol(name, reportErrors) { + return getGlobalSymbol(name, 107455 /* Value */, reportErrors ? ts.Diagnostics.Cannot_find_global_value_0 : undefined); } - function getGlobalTypeSymbol(name) { - return getGlobalSymbol(name, 793064 /* Type */, ts.Diagnostics.Cannot_find_global_type_0); + function getGlobalTypeSymbol(name, reportErrors) { + return getGlobalSymbol(name, 793064 /* Type */, reportErrors ? ts.Diagnostics.Cannot_find_global_type_0 : undefined); } function getGlobalSymbol(name, meaning, diagnostic) { return resolveName(undefined, name, meaning, diagnostic, name); } - function getGlobalType(name, arity) { + function getGlobalType(name, arity, reportErrors) { + var symbol = getGlobalTypeSymbol(name, reportErrors); + return symbol || reportErrors ? getTypeOfGlobalSymbol(symbol, arity) : undefined; + } + function getGlobalTypedPropertyDescriptorType() { + return deferredGlobalTypedPropertyDescriptorType || (deferredGlobalTypedPropertyDescriptorType = getGlobalType("TypedPropertyDescriptor", /*arity*/ 1, /*reportErrors*/ true)) || emptyGenericType; + } + function getGlobalTemplateStringsArrayType() { + return deferredGlobalTemplateStringsArrayType || (deferredGlobalTemplateStringsArrayType = getGlobalType("TemplateStringsArray", /*arity*/ 0, /*reportErrors*/ true)) || emptyObjectType; + } + function getGlobalESSymbolConstructorSymbol(reportErrors) { + return deferredGlobalESSymbolConstructorSymbol || (deferredGlobalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol", reportErrors)); + } + function getGlobalESSymbolType(reportErrors) { + return deferredGlobalESSymbolType || (deferredGlobalESSymbolType = getGlobalType("Symbol", /*arity*/ 0, reportErrors)) || emptyObjectType; + } + function getGlobalPromiseType(reportErrors) { + return deferredGlobalPromiseType || (deferredGlobalPromiseType = getGlobalType("Promise", /*arity*/ 1, reportErrors)) || emptyGenericType; + } + function getGlobalPromiseConstructorSymbol(reportErrors) { + return deferredGlobalPromiseConstructorSymbol || (deferredGlobalPromiseConstructorSymbol = getGlobalValueSymbol("Promise", reportErrors)); + } + function getGlobalPromiseConstructorLikeType(reportErrors) { + return deferredGlobalPromiseConstructorLikeType || (deferredGlobalPromiseConstructorLikeType = getGlobalType("PromiseConstructorLike", /*arity*/ 0, reportErrors)) || emptyObjectType; + } + function getGlobalAsyncIterableType(reportErrors) { + return deferredGlobalAsyncIterableType || (deferredGlobalAsyncIterableType = getGlobalType("AsyncIterable", /*arity*/ 1, reportErrors)) || emptyGenericType; + } + function getGlobalAsyncIteratorType(reportErrors) { + return deferredGlobalAsyncIteratorType || (deferredGlobalAsyncIteratorType = getGlobalType("AsyncIterator", /*arity*/ 1, reportErrors)) || emptyGenericType; + } + function getGlobalAsyncIterableIteratorType(reportErrors) { + return deferredGlobalAsyncIterableIteratorType || (deferredGlobalAsyncIterableIteratorType = getGlobalType("AsyncIterableIterator", /*arity*/ 1, reportErrors)) || emptyGenericType; + } + function getGlobalIterableType(reportErrors) { + return deferredGlobalIterableType || (deferredGlobalIterableType = getGlobalType("Iterable", /*arity*/ 1, reportErrors)) || emptyGenericType; + } + function getGlobalIteratorType(reportErrors) { + return deferredGlobalIteratorType || (deferredGlobalIteratorType = getGlobalType("Iterator", /*arity*/ 1, reportErrors)) || emptyGenericType; + } + function getGlobalIterableIteratorType(reportErrors) { + return deferredGlobalIterableIteratorType || (deferredGlobalIterableIteratorType = getGlobalType("IterableIterator", /*arity*/ 1, reportErrors)) || emptyGenericType; + } + function getGlobalTypeOrUndefined(name, arity) { if (arity === void 0) { arity = 0; } - return getTypeOfGlobalSymbol(getGlobalTypeSymbol(name), arity); + var symbol = getGlobalSymbol(name, 793064 /* Type */, /*diagnostic*/ undefined); + return symbol && getTypeOfGlobalSymbol(symbol, arity); } /** * Returns a type that is inside a namespace at the global scope, e.g. @@ -29175,26 +31609,26 @@ var ts; var typeSymbol = namespaceSymbol && getSymbol(namespaceSymbol.exports, name, 793064 /* Type */); return typeSymbol && getDeclaredTypeOfSymbol(typeSymbol); } - /** - * Creates a TypeReference for a generic `TypedPropertyDescriptor`. - */ - function createTypedPropertyDescriptorType(propertyType) { - var globalTypedPropertyDescriptorType = getGlobalTypedPropertyDescriptorType(); - return globalTypedPropertyDescriptorType !== emptyGenericType - ? createTypeReference(globalTypedPropertyDescriptorType, [propertyType]) - : emptyObjectType; - } /** * Instantiates a global type that is generic with some element type, and returns that instantiation. */ function createTypeFromGenericGlobalType(genericGlobalType, typeArguments) { return genericGlobalType !== emptyGenericType ? createTypeReference(genericGlobalType, typeArguments) : emptyObjectType; } - function createIterableType(elementType) { - return createTypeFromGenericGlobalType(getGlobalIterableType(), [elementType]); + function createTypedPropertyDescriptorType(propertyType) { + return createTypeFromGenericGlobalType(getGlobalTypedPropertyDescriptorType(), [propertyType]); } - function createIterableIteratorType(elementType) { - return createTypeFromGenericGlobalType(getGlobalIterableIteratorType(), [elementType]); + function createAsyncIterableType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalAsyncIterableType(/*reportErrors*/ true), [iteratedType]); + } + function createAsyncIterableIteratorType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalAsyncIterableIteratorType(/*reportErrors*/ true), [iteratedType]); + } + function createIterableType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalIterableType(/*reportErrors*/ true), [iteratedType]); + } + function createIterableIteratorType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalIterableIteratorType(/*reportErrors*/ true), [iteratedType]); } function createArrayType(elementType) { return createTypeFromGenericGlobalType(globalArrayType, [elementType]); @@ -29219,7 +31653,7 @@ var ts; for (var i = 0; i < arity; i++) { var typeParameter = createType(16384 /* TypeParameter */); typeParameters.push(typeParameter); - var property = createSymbol(4 /* Property */ | 67108864 /* Transient */, "" + i); + var property = createSymbol(4 /* Property */, "" + i); property.type = typeParameter; properties.push(property); } @@ -29228,7 +31662,7 @@ var ts; type.outerTypeParameters = undefined; type.localTypeParameters = typeParameters; type.instantiations = ts.createMap(); - type.instantiations[getTypeListId(type.typeParameters)] = type; + type.instantiations.set(getTypeListId(type.typeParameters), type); type.target = type; type.typeArguments = type.typeParameters; type.thisType = createType(16384 /* TypeParameter */); @@ -29312,14 +31746,14 @@ var ts; // Add the given types to the given type set. Order is preserved, duplicates are removed, // and nested types of the given kind are flattened into the set. function addTypesToUnion(typeSet, types) { - for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { - var type = types_4[_i]; + for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { + var type = types_6[_i]; addTypeToUnion(typeSet, type); } } function containsIdenticalType(types, type) { - for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { - var t = types_5[_i]; + for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { + var t = types_7[_i]; if (isTypeIdenticalTo(t, type)) { return true; } @@ -29327,8 +31761,9 @@ var ts; return false; } function isSubtypeOfAny(candidate, types) { - for (var i = 0, len = types.length; i < len; i++) { - if (candidate !== types[i] && isTypeSubtypeOf(candidate, types[i])) { + for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { + var type = types_8[_i]; + if (candidate !== type && isTypeSubtypeOf(candidate, type)) { return true; } } @@ -29414,10 +31849,11 @@ var ts; return types[0]; } var id = getTypeListId(types); - var type = unionTypes[id]; + var type = unionTypes.get(id); if (!type) { var propagatedFlags = getPropagatingFlagsOfTypes(types, /*excludeKinds*/ 6144 /* Nullable */); - type = unionTypes[id] = createType(65536 /* Union */ | propagatedFlags); + type = createType(65536 /* Union */ | propagatedFlags); + unionTypes.set(id, type); type.types = types; type.aliasSymbol = aliasSymbol; type.aliasTypeArguments = aliasTypeArguments; @@ -29438,15 +31874,27 @@ var ts; else if (type.flags & 1 /* Any */) { typeSet.containsAny = true; } + else if (getObjectFlags(type) & 16 /* Anonymous */ && isEmptyObjectType(type)) { + typeSet.containsEmptyObject = true; + } else if (!(type.flags & 8192 /* Never */) && (strictNullChecks || !(type.flags & 6144 /* Nullable */)) && !ts.contains(typeSet, type)) { - typeSet.push(type); + if (type.flags & 32768 /* Object */) { + typeSet.containsObjectType = true; + } + if (type.flags & 65536 /* Union */ && typeSet.unionIndex === undefined) { + typeSet.unionIndex = typeSet.length; + } + if (!(type.flags & 32768 /* Object */ && type.objectFlags & 16 /* Anonymous */ && + type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */) && containsIdenticalType(typeSet, type))) { + typeSet.push(type); + } } } // Add the given types to the given type set. Order is preserved, duplicates are removed, // and nested types of the given kind are flattened into the set. function addTypesToIntersection(typeSet, types) { - for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { - var type = types_6[_i]; + for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { + var type = types_9[_i]; addTypeToIntersection(typeSet, type); } } @@ -29464,31 +31912,31 @@ var ts; if (types.length === 0) { return emptyObjectType; } - var _loop_2 = function (i) { - var type_1 = types[i]; - if (type_1.flags & 65536 /* Union */) { - return { value: getUnionType(ts.map(type_1.types, function (t) { return getIntersectionType(ts.replaceElement(types, i, t)); }), - /*subtypeReduction*/ false, aliasSymbol, aliasTypeArguments) }; - } - }; - for (var i = 0; i < types.length; i++) { - var state_2 = _loop_2(i); - if (typeof state_2 === "object") - return state_2.value; - } var typeSet = []; addTypesToIntersection(typeSet, types); if (typeSet.containsAny) { return anyType; } + if (typeSet.containsEmptyObject && !typeSet.containsObjectType) { + typeSet.push(emptyObjectType); + } if (typeSet.length === 1) { return typeSet[0]; } + var unionIndex = typeSet.unionIndex; + if (unionIndex !== undefined) { + // We are attempting to construct a type of the form X & (A | B) & Y. Transform this into a type of + // the form X & A & Y | X & B & Y and recursively reduce until no union type constituents remain. + var unionType = typeSet[unionIndex]; + return getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex, t)); }), + /*subtypeReduction*/ false, aliasSymbol, aliasTypeArguments); + } var id = getTypeListId(typeSet); - var type = intersectionTypes[id]; + var type = intersectionTypes.get(id); if (!type) { var propagatedFlags = getPropagatingFlagsOfTypes(typeSet, /*excludeKinds*/ 6144 /* Nullable */); - type = intersectionTypes[id] = createType(131072 /* Intersection */ | propagatedFlags); + type = createType(131072 /* Intersection */ | propagatedFlags); + intersectionTypes.set(id, type); type.types = typeSet; type.aliasSymbol = aliasSymbol; type.aliasTypeArguments = aliasTypeArguments; @@ -29502,7 +31950,7 @@ var ts; } return links.resolvedType; } - function getIndexTypeForTypeParameter(type) { + function getIndexTypeForGenericType(type) { if (!type.resolvedIndexType) { type.resolvedIndexType = createType(262144 /* Index */); type.resolvedIndexType.type = type; @@ -29518,7 +31966,7 @@ var ts; return getUnionType(ts.map(getPropertiesOfType(type), getLiteralTypeFromPropertyName)); } function getIndexType(type) { - return type.flags & 16384 /* TypeParameter */ ? getIndexTypeForTypeParameter(type) : + return maybeTypeOfKind(type, 540672 /* TypeVariable */) ? getIndexTypeForGenericType(type) : getObjectFlags(type) & 32 /* Mapped */ ? getConstraintTypeFromMappedType(type) : type.flags & 1 /* Any */ || getIndexInfoOfType(type, 0 /* String */) ? stringType : getLiteralTypeFromPropertyNames(type); @@ -29541,7 +31989,7 @@ var ts; return type; } function getPropertyTypeForIndexType(objectType, indexType, accessNode, cacheSymbol) { - var accessExpression = accessNode && accessNode.kind === 178 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 179 /* ElementAccessExpression */ ? accessNode : undefined; var propName = indexType.flags & (32 /* StringLiteral */ | 64 /* NumberLiteral */ | 256 /* EnumLiteral */) ? indexType.text : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? @@ -29570,14 +32018,14 @@ var ts; getIndexInfoOfType(objectType, 0 /* String */) || undefined; if (indexInfo) { - if (accessExpression && ts.isAssignmentTarget(accessExpression) && indexInfo.isReadonly) { + if (accessExpression && indexInfo.isReadonly && (ts.isAssignmentTarget(accessExpression) || ts.isDeleteTarget(accessExpression))) { error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); return unknownType; } return indexInfo.type; } if (accessExpression && !isConstEnumObjectType(objectType)) { - if (compilerOptions.noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors) { + if (noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors) { if (getIndexTypeOfType(objectType, 1 /* Number */)) { error(accessExpression.argumentExpression, ts.Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number); } @@ -29589,7 +32037,7 @@ var ts; } } if (accessNode) { - var indexNode = accessNode.kind === 178 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.indexType; + var indexNode = accessNode.kind === 179 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.indexType; if (indexType.flags & (32 /* StringLiteral */ | 64 /* NumberLiteral */)) { error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, indexType.text, typeToString(objectType)); } @@ -29599,32 +32047,32 @@ var ts; else { error(indexNode, ts.Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType)); } + return unknownType; } - return unknownType; + return anyType; } function getIndexedAccessForMappedType(type, indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 178 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 179 /* ElementAccessExpression */ ? accessNode : undefined; if (accessExpression && ts.isAssignmentTarget(accessExpression) && type.declaration.readonlyToken) { error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(type)); return unknownType; } - var mapper = createUnaryTypeMapper(getTypeParameterFromMappedType(type), indexType); + var mapper = createTypeMapper([getTypeParameterFromMappedType(type)], [indexType]); var templateMapper = type.mapper ? combineTypeMappers(type.mapper, mapper) : mapper; - return addOptionality(instantiateType(getTemplateTypeFromMappedType(type), templateMapper), !!type.declaration.questionToken); + return instantiateType(getTemplateTypeFromMappedType(type), templateMapper); } function getIndexedAccessType(objectType, indexType, accessNode) { - if (indexType.flags & 16384 /* TypeParameter */ || - objectType.flags & 16384 /* TypeParameter */ && indexType.flags & 262144 /* Index */ || + // If the index type is generic, if the object type is generic and doesn't originate in an expression, + // or if the object type is a mapped type with a generic constraint, we are performing a higher-order + // index access where we cannot meaningfully access the properties of the object type. Note that for a + // generic T and a non-generic K, we eagerly resolve T[K] if it originates in an expression. This is to + // preserve backwards compatibility. For example, an element access 'this["foo"]' has always been resolved + // eagerly using the constraint type of 'this' at the given location. + if (maybeTypeOfKind(indexType, 540672 /* TypeVariable */ | 262144 /* Index */) || + maybeTypeOfKind(objectType, 540672 /* TypeVariable */) && !(accessNode && accessNode.kind === 179 /* ElementAccessExpression */) || isGenericMappedType(objectType)) { - // If either the object type or the index type are type parameters, or if the object type is a mapped - // type with a generic constraint, we are performing a higher-order index access where we cannot - // meaningfully access the properties of the object type. In those cases, we first check that the - // index type is assignable to 'keyof T' for the object type. - if (accessNode) { - if (!isTypeAssignableTo(indexType, getIndexType(objectType))) { - error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); - return unknownType; - } + if (objectType.flags & 1 /* Any */) { + return objectType; } // If the object type is a mapped type { [P in K]: E }, we instantiate E using a mapper that substitutes // the index type for P. For example, for an index access { [P in K]: Box }[X], we construct the @@ -29634,8 +32082,13 @@ var ts; } // Otherwise we defer the operation by creating an indexed access type. var id = objectType.id + "," + indexType.id; - return indexedAccessTypes[id] || (indexedAccessTypes[id] = createIndexedAccessType(objectType, indexType)); + var type = indexedAccessTypes.get(id); + if (!type) { + indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType)); + } + return type; } + // In the following we resolve T[K] to the type of the property in T selected by K. var apparentObjectType = getApparentType(objectType); if (indexType.flags & 65536 /* Union */ && !(indexType.flags & 8190 /* Primitive */)) { var propTypes = []; @@ -29677,7 +32130,7 @@ var ts; if (!links.resolvedType) { // Deferred resolution of members is handled by resolveObjectTypeMembers var aliasSymbol = getAliasSymbolForTypeNode(node); - if (ts.isEmpty(node.symbol.members) && !aliasSymbol) { + if (node.symbol.members.size === 0 && !aliasSymbol) { links.resolvedType = emptyTypeLiteralType; } else { @@ -29690,7 +32143,7 @@ var ts; return links.resolvedType; } function getAliasSymbolForTypeNode(node) { - return node.parent.kind === 228 /* TypeAliasDeclaration */ ? getSymbolOfNode(node.parent) : undefined; + return node.parent.kind === 230 /* TypeAliasDeclaration */ ? getSymbolOfNode(node.parent) : undefined; } function getAliasTypeArgumentsForTypeNode(node) { var symbol = getAliasSymbolForTypeNode(node); @@ -29701,11 +32154,27 @@ var ts; * this function should be called in a left folding style, with left = previous result of getSpreadType * and right = the new element to be spread. */ - function getSpreadType(left, right, isFromObjectLiteral) { - ts.Debug.assert(!!(left.flags & (32768 /* Object */ | 1 /* Any */)) && !!(right.flags & (32768 /* Object */ | 1 /* Any */)), "Only object types may be spread."); + function getSpreadType(left, right) { if (left.flags & 1 /* Any */ || right.flags & 1 /* Any */) { return anyType; } + left = filterType(left, function (t) { return !(t.flags & 6144 /* Nullable */); }); + if (left.flags & 8192 /* Never */) { + return right; + } + right = filterType(right, function (t) { return !(t.flags & 6144 /* Nullable */); }); + if (right.flags & 8192 /* Never */) { + return left; + } + if (left.flags & 65536 /* Union */) { + return mapType(left, function (t) { return getSpreadType(t, right); }); + } + if (right.flags & 65536 /* Union */) { + return mapType(right, function (t) { return getSpreadType(left, t); }); + } + if (right.flags & 16777216 /* NonPrimitive */) { + return emptyObjectType; + } var members = ts.createMap(); var skippedPrivateMembers = ts.createMap(); var stringIndexInfo; @@ -29722,42 +32191,55 @@ var ts; for (var _i = 0, _a = getPropertiesOfType(right); _i < _a.length; _i++) { var rightProp = _a[_i]; // we approximate own properties as non-methods plus methods that are inside the object literal - var isOwnProperty = !(rightProp.flags & 8192 /* Method */) || isFromObjectLiteral; var isSetterWithoutGetter = rightProp.flags & 65536 /* SetAccessor */ && !(rightProp.flags & 32768 /* GetAccessor */); if (getDeclarationModifierFlagsFromSymbol(rightProp) & (8 /* Private */ | 16 /* Protected */)) { - skippedPrivateMembers[rightProp.name] = true; + skippedPrivateMembers.set(rightProp.name, true); } - else if (isOwnProperty && !isSetterWithoutGetter) { - members[rightProp.name] = rightProp; + else if (!isClassMethod(rightProp) && !isSetterWithoutGetter) { + members.set(rightProp.name, getNonReadonlySymbol(rightProp)); } } for (var _b = 0, _c = getPropertiesOfType(left); _b < _c.length; _b++) { var leftProp = _c[_b]; if (leftProp.flags & 65536 /* SetAccessor */ && !(leftProp.flags & 32768 /* GetAccessor */) - || leftProp.name in skippedPrivateMembers) { + || skippedPrivateMembers.has(leftProp.name) + || isClassMethod(leftProp)) { continue; } - if (leftProp.name in members) { - var rightProp = members[leftProp.name]; + if (members.has(leftProp.name)) { + var rightProp = members.get(leftProp.name); var rightType = getTypeOfSymbol(rightProp); - if (maybeTypeOfKind(rightType, 2048 /* Undefined */) || rightProp.flags & 536870912 /* Optional */) { + if (maybeTypeOfKind(rightType, 2048 /* Undefined */) || rightProp.flags & 67108864 /* Optional */) { var declarations = ts.concatenate(leftProp.declarations, rightProp.declarations); - var flags = 4 /* Property */ | 67108864 /* Transient */ | (leftProp.flags & 536870912 /* Optional */); + var flags = 4 /* Property */ | (leftProp.flags & 67108864 /* Optional */); var result = createSymbol(flags, leftProp.name); result.type = getUnionType([getTypeOfSymbol(leftProp), getTypeWithFacts(rightType, 131072 /* NEUndefined */)]); result.leftSpread = leftProp; result.rightSpread = rightProp; result.declarations = declarations; - result.isReadonly = isReadonlySymbol(leftProp) || isReadonlySymbol(rightProp); - members[leftProp.name] = result; + members.set(leftProp.name, result); } } else { - members[leftProp.name] = leftProp; + members.set(leftProp.name, getNonReadonlySymbol(leftProp)); } } return createAnonymousType(undefined, members, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo); } + function getNonReadonlySymbol(prop) { + if (!isReadonlySymbol(prop)) { + return prop; + } + var flags = 4 /* Property */ | (prop.flags & 67108864 /* Optional */); + var result = createSymbol(flags, prop.name); + result.type = getTypeOfSymbol(prop); + result.declarations = prop.declarations; + result.syntheticOrigin = prop; + return result; + } + function isClassMethod(prop) { + return prop.flags & 8192 /* Method */ && ts.find(prop.declarations, function (decl) { return ts.isClassLike(decl.parent); }); + } function createLiteralType(flags, text) { var type = createType(flags); type.text = text; @@ -29779,7 +32261,11 @@ var ts; } function getLiteralTypeForText(flags, text) { var map = flags & 32 /* StringLiteral */ ? stringLiteralTypes : numericLiteralTypes; - return map[text] || (map[text] = createLiteralType(flags, text)); + var type = map.get(text); + if (!type) { + map.set(text, type = createLiteralType(flags, text)); + } + return type; } function getTypeFromLiteralTypeNode(node) { var links = getNodeLinks(node); @@ -29807,9 +32293,9 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 227 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 229 /* InterfaceDeclaration */)) { if (!(ts.getModifierFlags(container) & 32 /* Static */) && - (container.kind !== 150 /* Constructor */ || ts.isNodeDescendantOf(node, container.body))) { + (container.kind !== 151 /* Constructor */ || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } } @@ -29826,87 +32312,84 @@ var ts; function getTypeFromTypeNode(node) { switch (node.kind) { case 118 /* AnyKeyword */: - case 263 /* JSDocAllType */: - case 264 /* JSDocUnknownType */: + case 267 /* JSDocAllType */: + case 268 /* JSDocUnknownType */: return anyType; - case 134 /* StringKeyword */: + case 135 /* StringKeyword */: return stringType; case 132 /* NumberKeyword */: return numberType; case 121 /* BooleanKeyword */: return booleanType; - case 135 /* SymbolKeyword */: + case 136 /* SymbolKeyword */: return esSymbolType; case 104 /* VoidKeyword */: return voidType; - case 137 /* UndefinedKeyword */: + case 138 /* UndefinedKeyword */: return undefinedType; case 94 /* NullKeyword */: return nullType; case 129 /* NeverKeyword */: return neverType; - case 289 /* JSDocNullKeyword */: - return nullType; - case 290 /* JSDocUndefinedKeyword */: - return undefinedType; - case 291 /* JSDocNeverKeyword */: - return neverType; - case 167 /* ThisType */: + case 133 /* ObjectKeyword */: + return nonPrimitiveType; + case 168 /* ThisType */: case 98 /* ThisKeyword */: return getTypeFromThisTypeNode(node); - case 171 /* LiteralType */: + case 172 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 288 /* JSDocLiteralType */: + case 292 /* JSDocLiteralType */: return getTypeFromLiteralTypeNode(node.literal); - case 157 /* TypeReference */: - case 272 /* JSDocTypeReference */: + case 158 /* TypeReference */: + case 276 /* JSDocTypeReference */: return getTypeFromTypeReference(node); - case 156 /* TypePredicate */: + case 157 /* TypePredicate */: return booleanType; - case 199 /* ExpressionWithTypeArguments */: + case 200 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 160 /* TypeQuery */: + case 161 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 162 /* ArrayType */: - case 265 /* JSDocArrayType */: + case 163 /* ArrayType */: + case 269 /* JSDocArrayType */: return getTypeFromArrayTypeNode(node); - case 163 /* TupleType */: + case 164 /* TupleType */: return getTypeFromTupleTypeNode(node); - case 164 /* UnionType */: - case 266 /* JSDocUnionType */: + case 165 /* UnionType */: + case 270 /* JSDocUnionType */: return getTypeFromUnionTypeNode(node); - case 165 /* IntersectionType */: + case 166 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 166 /* ParenthesizedType */: - case 268 /* JSDocNullableType */: - case 269 /* JSDocNonNullableType */: - case 276 /* JSDocConstructorType */: - case 277 /* JSDocThisType */: - case 273 /* JSDocOptionalType */: + case 272 /* JSDocNullableType */: + return getTypeFromJSDocNullableTypeNode(node); + case 167 /* ParenthesizedType */: + case 273 /* JSDocNonNullableType */: + case 280 /* JSDocConstructorType */: + case 281 /* JSDocThisType */: + case 277 /* JSDocOptionalType */: return getTypeFromTypeNode(node.type); - case 270 /* JSDocRecordType */: + case 274 /* JSDocRecordType */: return getTypeFromTypeNode(node.literal); - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 161 /* TypeLiteral */: - case 287 /* JSDocTypeLiteral */: - case 274 /* JSDocFunctionType */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: + case 162 /* TypeLiteral */: + case 291 /* JSDocTypeLiteral */: + case 278 /* JSDocFunctionType */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 168 /* TypeOperator */: + case 169 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 169 /* IndexedAccessType */: + case 170 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 170 /* MappedType */: + case 171 /* MappedType */: return getTypeFromMappedTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode case 70 /* Identifier */: - case 141 /* QualifiedName */: + case 142 /* QualifiedName */: var symbol = getSymbolAtLocation(node); return symbol && getDeclaredTypeOfSymbol(symbol); - case 267 /* JSDocTupleType */: + case 271 /* JSDocTupleType */: return getTypeFromJSDocTupleType(node); - case 275 /* JSDocVariadicType */: + case 279 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); default: return unknownType; @@ -29933,13 +32416,13 @@ var ts; var instantiations = mapper.instantiations || (mapper.instantiations = []); return instantiations[type.id] || (instantiations[type.id] = instantiator(type, mapper)); } - function createUnaryTypeMapper(source, target) { + function makeUnaryTypeMapper(source, target) { return function (t) { return t === source ? target : t; }; } - function createBinaryTypeMapper(source1, target1, source2, target2) { + function makeBinaryTypeMapper(source1, target1, source2, target2) { return function (t) { return t === source1 ? target1 : t === source2 ? target2 : t; }; } - function createArrayTypeMapper(sources, targets) { + function makeArrayTypeMapper(sources, targets) { return function (t) { for (var i = 0; i < sources.length; i++) { if (t === sources[i]) { @@ -29950,15 +32433,23 @@ var ts; }; } function createTypeMapper(sources, targets) { - var count = sources.length; - var mapper = count == 1 ? createUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : - count == 2 ? createBinaryTypeMapper(sources[0], targets ? targets[0] : anyType, sources[1], targets ? targets[1] : anyType) : - createArrayTypeMapper(sources, targets); + var mapper = sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : + sources.length === 2 ? makeBinaryTypeMapper(sources[0], targets ? targets[0] : anyType, sources[1], targets ? targets[1] : anyType) : + makeArrayTypeMapper(sources, targets); mapper.mappedTypes = sources; return mapper; } function createTypeEraser(sources) { - return createTypeMapper(sources, undefined); + return createTypeMapper(sources, /*targets*/ undefined); + } + /** + * Maps forward-references to later types parameters to the empty object type. + * This is used during inference when instantiating type parameter defaults. + */ + function createBackreferenceMapper(typeParameters, index) { + var mapper = function (t) { return ts.indexOf(typeParameters, t) >= index ? emptyObjectType : t; }; + mapper.mappedTypes = typeParameters; + return mapper; } function getInferenceMapper(context) { if (!context.mapper) { @@ -29983,7 +32474,12 @@ var ts; } function combineTypeMappers(mapper1, mapper2) { var mapper = function (t) { return instantiateType(mapper1(t), mapper2); }; - mapper.mappedTypes = mapper1.mappedTypes; + mapper.mappedTypes = ts.concatenate(mapper1.mappedTypes, mapper2.mappedTypes); + return mapper; + } + function createReplacementMapper(source, target, baseMapper) { + var mapper = function (t) { return t === source ? target : baseMapper(t); }; + mapper.mappedTypes = baseMapper.mappedTypes; return mapper; } function cloneTypeParameter(typeParameter) { @@ -30031,7 +32527,7 @@ var ts; return result; } function instantiateSymbol(symbol, mapper) { - if (symbol.flags & 16777216 /* Instantiated */) { + if (getCheckFlags(symbol) & 1 /* Instantiated */) { var links = getSymbolLinks(symbol); // If symbol being instantiated is itself a instantiation, fetch the original target and combine the // type mappers. This ensures that original type identities are properly preserved and that aliases @@ -30041,7 +32537,8 @@ var ts; } // Keep the flags from the symbol we're instantiating. Mark that is instantiated, and // also transient so that we can just store data on it directly. - var result = createSymbol(16777216 /* Instantiated */ | 67108864 /* Transient */ | symbol.flags, symbol.name); + var result = createSymbol(symbol.flags, symbol.name); + result.checkFlags = 1 /* Instantiated */; result.declarations = symbol.declarations; result.parent = symbol.parent; result.target = symbol; @@ -30060,25 +32557,24 @@ var ts; return result; } function instantiateMappedType(type, mapper) { - // Check if we have an isomorphic mapped type, i.e. a type of the form { [P in keyof T]: X } for some - // type parameter T. If so, the mapped type is distributive over a union type and when T is instantiated + // Check if we have a homomorphic mapped type, i.e. a type of the form { [P in keyof T]: X } for some + // type variable T. If so, the mapped type is distributive over a union type and when T is instantiated // to a union type A | B, we produce { [P in keyof A]: X } | { [P in keyof B]: X }. Furthermore, for - // isomorphic mapped types we leave primitive types alone. For example, when T is instantiated to a + // homomorphic mapped types we leave primitive types alone. For example, when T is instantiated to a // union type A | undefined, we produce { [P in keyof A]: X } | undefined. var constraintType = getConstraintTypeFromMappedType(type); if (constraintType.flags & 262144 /* Index */) { - var typeParameter_1 = constraintType.type; - var mappedTypeParameter = mapper(typeParameter_1); - if (typeParameter_1 !== mappedTypeParameter) { - return mapType(mappedTypeParameter, function (t) { - if (isMappableType(t)) { - var replacementMapper = createUnaryTypeMapper(typeParameter_1, t); - var combinedMapper = mapper.mappedTypes && mapper.mappedTypes.length === 1 ? replacementMapper : combineTypeMappers(replacementMapper, mapper); - combinedMapper.mappedTypes = mapper.mappedTypes; - return instantiateMappedObjectType(type, combinedMapper); - } - return t; - }); + var typeVariable_1 = constraintType.type; + if (typeVariable_1.flags & 16384 /* TypeParameter */) { + var mappedTypeVariable = instantiateType(typeVariable_1, mapper); + if (typeVariable_1 !== mappedTypeVariable) { + return mapType(mappedTypeVariable, function (t) { + if (isMappableType(t)) { + return instantiateMappedObjectType(type, createReplacementMapper(typeVariable_1, t, mapper)); + } + return t; + }); + } } } return instantiateMappedObjectType(type, mapper); @@ -30102,26 +32598,28 @@ var ts; // Starting with the parent of the symbol's declaration, check if the mapper maps any of // the type parameters introduced by enclosing declarations. We just pick the first // declaration since multiple declarations will all have the same parent anyway. - var node = symbol.declarations[0].parent; - while (node) { + return !!ts.findAncestor(symbol.declarations[0], function (node) { + if (node.kind === 232 /* ModuleDeclaration */ || node.kind === 264 /* SourceFile */) { + return "quit"; + } switch (node.kind) { - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 225 /* FunctionDeclaration */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: + case 227 /* FunctionDeclaration */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 229 /* InterfaceDeclaration */: + case 230 /* TypeAliasDeclaration */: var declaration = node; if (declaration.typeParameters) { for (var _i = 0, _a = declaration.typeParameters; _i < _a.length; _i++) { @@ -30131,25 +32629,34 @@ var ts; } } } - if (ts.isClassLike(node) || node.kind === 227 /* InterfaceDeclaration */) { + if (ts.isClassLike(node) || node.kind === 229 /* InterfaceDeclaration */) { var thisType = getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; if (thisType && ts.contains(mappedTypes, thisType)) { return true; } } break; - case 230 /* ModuleDeclaration */: - case 261 /* SourceFile */: - return false; + case 171 /* MappedType */: + if (ts.contains(mappedTypes, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter)))) { + return true; + } + break; + case 278 /* JSDocFunctionType */: + var func = node; + for (var _b = 0, _c = func.parameters; _b < _c.length; _b++) { + var p = _c[_b]; + if (ts.contains(mappedTypes, getTypeOfNode(p))) { + return true; + } + } + break; } - node = node.parent; - } - return false; + }); } function isTopLevelTypeAlias(symbol) { if (symbol.declarations && symbol.declarations.length) { var parentKind = symbol.declarations[0].parent.kind; - return parentKind === 261 /* SourceFile */ || parentKind === 231 /* ModuleBlock */; + return parentKind === 264 /* SourceFile */ || parentKind === 233 /* ModuleBlock */; } return false; } @@ -30226,28 +32733,36 @@ var ts; // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 149 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 150 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: return isContextSensitiveFunctionLikeDeclaration(node); - case 176 /* ObjectLiteralExpression */: + case 177 /* ObjectLiteralExpression */: return ts.forEach(node.properties, isContextSensitive); - case 175 /* ArrayLiteralExpression */: + case 176 /* ArrayLiteralExpression */: return ts.forEach(node.elements, isContextSensitive); - case 193 /* ConditionalExpression */: + case 194 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return node.operatorToken.kind === 53 /* BarBarToken */ && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 257 /* PropertyAssignment */: + case 260 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: return isContextSensitiveFunctionLikeDeclaration(node); - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return isContextSensitive(node.expression); + case 253 /* JsxAttributes */: + return ts.forEach(node.properties, isContextSensitive); + case 252 /* JsxAttribute */: + // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive. + return node.initializer && isContextSensitive(node.initializer); + case 255 /* JsxExpression */: + // It is possible to that node.expression is undefined (e.g
) + return node.expression && isContextSensitive(node.expression); } return false; } @@ -30261,7 +32776,7 @@ var ts; return true; } // For arrow functions we now know we're not context sensitive. - if (node.kind === 185 /* ArrowFunction */) { + if (node.kind === 186 /* ArrowFunction */) { return false; } // If the first parameter is not an explicit 'this' parameter, then the function has @@ -30283,9 +32798,12 @@ var ts; result.properties = resolved.properties; result.callSignatures = emptyArray; result.constructSignatures = emptyArray; - type = result; + return result; } } + else if (type.flags & 131072 /* Intersection */) { + return getIntersectionType(ts.map(type.types, getTypeWithoutSignatures)); + } return type; } // TYPE CHECKING @@ -30308,7 +32826,7 @@ var ts; // subtype of T but not structurally identical to T. This specifically means that two distinct but // structurally identical types (such as two classes) are not considered instances of each other. function isTypeInstanceOf(source, target) { - return source === target || isTypeSubtypeOf(source, target) && !isTypeIdenticalTo(source, target); + return getTargetType(source) === getTargetType(target) || isTypeSubtypeOf(source, target) && !isTypeIdenticalTo(source, target); } /** * This is *not* a bi-directional relationship. @@ -30334,12 +32852,13 @@ var ts; return checkTypeRelatedTo(source, target, comparableRelation, errorNode, headMessage, containingMessageChain); } function isSignatureAssignableTo(source, target, ignoreReturnTypes) { - return compareSignaturesRelated(source, target, ignoreReturnTypes, /*reportErrors*/ false, /*errorReporter*/ undefined, compareTypesAssignable) !== 0 /* False */; + return compareSignaturesRelated(source, target, /*checkAsCallback*/ false, ignoreReturnTypes, /*reportErrors*/ false, + /*errorReporter*/ undefined, compareTypesAssignable) !== 0 /* False */; } /** * See signatureRelatedTo, compareSignaturesIdentical */ - function compareSignaturesRelated(source, target, ignoreReturnTypes, reportErrors, errorReporter, compareTypes) { + function compareSignaturesRelated(source, target, checkAsCallback, ignoreReturnTypes, reportErrors, errorReporter, compareTypes) { // TODO (drosen): De-duplicate code between related functions. if (source === target) { return -1 /* True */; @@ -30374,9 +32893,23 @@ var ts; var sourceParams = source.parameters; var targetParams = target.parameters; for (var i = 0; i < checkCount; i++) { - var s = i < sourceMax ? getTypeOfParameter(sourceParams[i]) : getRestTypeOfSignature(source); - var t = i < targetMax ? getTypeOfParameter(targetParams[i]) : getRestTypeOfSignature(target); - var related = compareTypes(s, t, /*reportErrors*/ false) || compareTypes(t, s, reportErrors); + var sourceType = i < sourceMax ? getTypeOfParameter(sourceParams[i]) : getRestTypeOfSignature(source); + var targetType = i < targetMax ? getTypeOfParameter(targetParams[i]) : getRestTypeOfSignature(target); + var sourceSig = getSingleCallSignature(getNonNullableType(sourceType)); + var targetSig = getSingleCallSignature(getNonNullableType(targetType)); + // In order to ensure that any generic type Foo is at least co-variant with respect to T no matter + // how Foo uses T, we need to relate parameters bi-variantly (given that parameters are input positions, + // they naturally relate only contra-variantly). However, if the source and target parameters both have + // function types with a single call signature, we known we are relating two callback parameters. In + // that case it is sufficient to only relate the parameters of the signatures co-variantly because, + // similar to return values, callback parameters are output positions. This means that a Promise, + // where T is used only in callback parameter positions, will be co-variant (as opposed to bi-variant) + // with respect to T. + var callbacks = sourceSig && targetSig && !sourceSig.typePredicate && !targetSig.typePredicate && + (getFalsyFlags(sourceType) & 6144 /* Nullable */) === (getFalsyFlags(targetType) & 6144 /* Nullable */); + var related = callbacks ? + compareSignaturesRelated(targetSig, sourceSig, /*checkAsCallback*/ true, /*ignoreReturnTypes*/ false, reportErrors, errorReporter, compareTypes) : + !checkAsCallback && compareTypes(sourceType, targetType, /*reportErrors*/ false) || compareTypes(targetType, sourceType, reportErrors); if (!related) { if (reportErrors) { errorReporter(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, sourceParams[i < sourceMax ? i : sourceMax].name, targetParams[i < targetMax ? i : targetMax].name); @@ -30404,7 +32937,11 @@ var ts; } } else { - result &= compareTypes(sourceReturnType, targetReturnType, reportErrors); + // When relating callback signatures, we still need to relate return types bi-variantly as otherwise + // the containing type wouldn't be co-variant. For example, interface Foo { add(cb: () => T): void } + // wouldn't be co-variant for T without this rule. + result &= checkAsCallback && compareTypes(targetReturnType, sourceReturnType, /*reportErrors*/ false) || + compareTypes(sourceReturnType, targetReturnType, reportErrors); } } return result; @@ -30471,18 +33008,33 @@ var ts; sourceNonRestParamCount; } } + function isEmptyResolvedType(t) { + return t.properties.length === 0 && + t.callSignatures.length === 0 && + t.constructSignatures.length === 0 && + !t.stringIndexInfo && + !t.numberIndexInfo; + } + function isEmptyObjectType(type) { + return type.flags & 32768 /* Object */ ? isEmptyResolvedType(resolveStructuredTypeMembers(type)) : + type.flags & 65536 /* Union */ ? ts.forEach(type.types, isEmptyObjectType) : + type.flags & 131072 /* Intersection */ ? !ts.forEach(type.types, function (t) { return !isEmptyObjectType(t); }) : + false; + } function isEnumTypeRelatedTo(source, target, errorReporter) { if (source === target) { return true; } var id = source.id + "," + target.id; - if (enumRelation[id] !== undefined) { - return enumRelation[id]; + var relation = enumRelation.get(id); + if (relation !== undefined) { + return relation; } if (source.symbol.name !== target.symbol.name || !(source.symbol.flags & 256 /* RegularEnum */) || !(target.symbol.flags & 256 /* RegularEnum */) || (source.flags & 65536 /* Union */) !== (target.flags & 65536 /* Union */)) { - return enumRelation[id] = false; + enumRelation.set(id, false); + return false; } var targetEnumType = getTypeOfSymbol(target.symbol); for (var _i = 0, _a = getPropertiesOfType(getTypeOfSymbol(source.symbol)); _i < _a.length; _i++) { @@ -30493,11 +33045,13 @@ var ts; if (errorReporter) { errorReporter(ts.Diagnostics.Property_0_is_missing_in_type_1, property.name, typeToString(target, /*enclosingDeclaration*/ undefined, 128 /* UseFullyQualifiedType */)); } - return enumRelation[id] = false; + enumRelation.set(id, false); + return false; } } } - return enumRelation[id] = true; + enumRelation.set(id, true); + return true; } function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { if (target.flags & 8192 /* Never */) @@ -30518,6 +33072,8 @@ var ts; return true; if (source.flags & 4096 /* Null */ && (!strictNullChecks || target.flags & 4096 /* Null */)) return true; + if (source.flags & 32768 /* Object */ && target.flags & 16777216 /* NonPrimitive */) + return true; if (relation === assignableRelation || relation === comparableRelation) { if (source.flags & 1 /* Any */) return true; @@ -30549,13 +33105,13 @@ var ts; } if (source.flags & 32768 /* Object */ && target.flags & 32768 /* Object */) { var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; - var related = relation[id]; + var related = relation.get(id); if (related !== undefined) { return related === 1 /* Succeeded */; } } - if (source.flags & 507904 /* StructuredOrTypeParameter */ || target.flags & 507904 /* StructuredOrTypeParameter */) { - return checkTypeRelatedTo(source, target, relation, undefined, undefined, undefined); + if (source.flags & 1032192 /* StructuredOrTypeVariable */ || target.flags & 1032192 /* StructuredOrTypeVariable */) { + return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined); } return false; } @@ -30619,14 +33175,35 @@ var ts; if ((globalStringType === source && stringType === target) || (globalNumberType === source && numberType === target) || (globalBooleanType === source && booleanType === target) || - (getGlobalESSymbolType() === source && esSymbolType === target)) { + (getGlobalESSymbolType(/*reportErrors*/ false) === source && esSymbolType === target)) { reportError(ts.Diagnostics._0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible, targetType, sourceType); } } - // Compare two types and return - // Ternary.True if they are related with no assumptions, - // Ternary.Maybe if they are related with assumptions of other relationships, or - // Ternary.False if they are not related. + function isUnionOrIntersectionTypeWithoutNullableConstituents(type) { + if (!(type.flags & 196608 /* UnionOrIntersection */)) { + return false; + } + // at this point we know that this is union or intersection type possibly with nullable constituents. + // check if we still will have compound type if we ignore nullable components. + var seenNonNullable = false; + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (t.flags & 6144 /* Nullable */) { + continue; + } + if (seenNonNullable) { + return true; + } + seenNonNullable = true; + } + return false; + } + /** + * Compare two types and return + * * Ternary.True if they are related with no assumptions, + * * Ternary.Maybe if they are related with assumptions of other relationships, or + * * Ternary.False if they are not related. + */ function isRelatedTo(source, target, reportErrors, headMessage) { var result; if (source.flags & 96 /* StringOrNumberLiteral */ && source.flags & 1048576 /* FreshLiteral */) { @@ -30654,7 +33231,7 @@ var ts; // and intersection types are further deconstructed on the target side, we don't want to // make the check again (as it might fail for a partial target type). Therefore we obtain // the regular source type and proceed with that. - if (target.flags & 196608 /* UnionOrIntersection */) { + if (isUnionOrIntersectionTypeWithoutNullableConstituents(target)) { source = getRegularTypeOfObjectLiteral(source); } } @@ -30673,122 +33250,37 @@ var ts; return result; } } - else if (target.flags & 65536 /* Union */) { - if (result = typeRelatedToSomeType(source, target, reportErrors && !(source.flags & 8190 /* Primitive */) && !(target.flags & 8190 /* Primitive */))) { - return result; - } - } - else if (target.flags & 131072 /* Intersection */) { - if (result = typeRelatedToEachType(source, target, reportErrors)) { - return result; - } - } - else if (source.flags & 131072 /* Intersection */) { - // Check to see if any constituents of the intersection are immediately related to the target. - // - // Don't report errors though. Checking whether a constituent is related to the source is not actually - // useful and leads to some confusing error messages. Instead it is better to let the below checks - // take care of this, or to not elaborate at all. For instance, - // - // - For an object type (such as 'C = A & B'), users are usually more interested in structural errors. - // - // - For a union type (such as '(A | B) = (C & D)'), it's better to hold onto the whole intersection - // than to report that 'D' is not assignable to 'A' or 'B'. - // - // - For a primitive type or type parameter (such as 'number = A & B') there is no point in - // breaking the intersection apart. - if (result = someTypeRelatedToType(source, target, /*reportErrors*/ false)) { - return result; - } - } - if (target.flags & 16384 /* TypeParameter */) { - // A source type { [P in keyof T]: X } is related to a target type T if X is related to T[P]. - if (getObjectFlags(source) & 32 /* Mapped */ && getConstraintTypeFromMappedType(source) === getIndexType(target)) { - if (!source.declaration.questionToken) { - var templateType = getTemplateTypeFromMappedType(source); - var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); - if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) { - return result; - } - } - } - else { - // Given a type parameter K with a constraint keyof T, a type S is - // assignable to K if S is assignable to keyof T. - var constraint = getConstraintOfTypeParameter(target); - if (constraint && constraint.flags & 262144 /* Index */) { - if (result = isRelatedTo(source, constraint, reportErrors)) { - return result; - } - } - } - } - else if (target.flags & 262144 /* Index */) { - // A keyof S is related to a keyof T if T is related to S. - if (source.flags & 262144 /* Index */) { - if (result = isRelatedTo(target.type, source.type, /*reportErrors*/ false)) { - return result; - } - } - // Given a type parameter T with a constraint C, a type S is assignable to - // keyof T if S is assignable to keyof C. - var constraint = getConstraintOfTypeParameter(target.type); - if (constraint) { - if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) { - return result; - } - } - } - else if (target.flags & 524288 /* IndexedAccess */) { - // if we have indexed access types with identical index types, see if relationship holds for - // the two object types. - if (source.flags & 524288 /* IndexedAccess */ && source.indexType === target.indexType) { - if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) { - return result; - } - } - } - if (source.flags & 16384 /* TypeParameter */) { - // A source type T is related to a target type { [P in keyof T]: X } if T[P] is related to X. - if (getObjectFlags(target) & 32 /* Mapped */ && getConstraintTypeFromMappedType(target) === getIndexType(source)) { - var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); - var templateType = getTemplateTypeFromMappedType(target); - if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { - return result; - } - } - else { - var constraint = getConstraintOfTypeParameter(source); - if (!constraint || constraint.flags & 1 /* Any */) { - constraint = emptyObjectType; - } - // The constraint may need to be further instantiated with its 'this' type. - constraint = getTypeWithThisArgument(constraint, source); - // Report constraint errors only if the constraint is not the empty object type - var reportConstraintErrors = reportErrors && constraint !== emptyObjectType; - if (result = isRelatedTo(constraint, target, reportConstraintErrors)) { - errorInfo = saveErrorInfo; - return result; - } - } - } else { - if (getObjectFlags(source) & 4 /* Reference */ && getObjectFlags(target) & 4 /* Reference */ && source.target === target.target) { - // We have type references to same target type, see if relationship holds for all type arguments - if (result = typeArgumentsRelatedTo(source, target, reportErrors)) { + if (target.flags & 65536 /* Union */) { + if (result = typeRelatedToSomeType(source, target, reportErrors && !(source.flags & 8190 /* Primitive */) && !(target.flags & 8190 /* Primitive */))) { return result; } } - // Even if relationship doesn't hold for unions, intersections, or generic type references, - // it may hold in a structural comparison. - var apparentSource = getApparentType(source); - // In a check of the form X = A & B, we will have previously checked if A relates to X or B relates - // to X. Failing both of those we want to check if the aggregation of A and B's members structurally - // relates to X. Thus, we include intersection types on the source side here. - if (apparentSource.flags & (32768 /* Object */ | 131072 /* Intersection */) && target.flags & 32768 /* Object */) { - // Report structural errors only if we haven't reported any errors yet - var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !(source.flags & 8190 /* Primitive */); - if (result = objectTypeRelatedTo(apparentSource, source, target, reportStructuralErrors)) { + else if (target.flags & 131072 /* Intersection */) { + if (result = typeRelatedToEachType(source, target, reportErrors)) { + return result; + } + } + else if (source.flags & 131072 /* Intersection */) { + // Check to see if any constituents of the intersection are immediately related to the target. + // + // Don't report errors though. Checking whether a constituent is related to the source is not actually + // useful and leads to some confusing error messages. Instead it is better to let the below checks + // take care of this, or to not elaborate at all. For instance, + // + // - For an object type (such as 'C = A & B'), users are usually more interested in structural errors. + // + // - For a union type (such as '(A | B) = (C & D)'), it's better to hold onto the whole intersection + // than to report that 'D' is not assignable to 'A' or 'B'. + // + // - For a primitive type or type parameter (such as 'number = A & B') there is no point in + // breaking the intersection apart. + if (result = someTypeRelatedToType(source, target, /*reportErrors*/ false)) { + return result; + } + } + if (source.flags & 1032192 /* StructuredOrTypeVariable */ || target.flags & 1032192 /* StructuredOrTypeVariable */) { + if (result = recursiveTypeRelatedTo(source, target, reportErrors)) { errorInfo = saveErrorInfo; return result; } @@ -30808,13 +33300,7 @@ var ts; function isIdenticalTo(source, target) { var result; if (source.flags & 32768 /* Object */ && target.flags & 32768 /* Object */) { - if (getObjectFlags(source) & 4 /* Reference */ && getObjectFlags(target) & 4 /* Reference */ && source.target === target.target) { - // We have type references to same target type, see if all type arguments are identical - if (result = typeArgumentsRelatedTo(source, target, /*reportErrors*/ false)) { - return result; - } - } - return objectTypeRelatedTo(source, source, target, /*reportErrors*/ false); + return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false); } if (source.flags & 65536 /* Union */ && target.flags & 65536 /* Union */ || source.flags & 131072 /* Intersection */ && target.flags & 131072 /* Intersection */) { @@ -30830,45 +33316,49 @@ var ts; // is considered known if the object type is empty and the check is for assignability, if the object type has // index signatures, or if the property is actually declared in the object type. In a union or intersection // type, a property is considered known if it is known in any constituent type. - function isKnownProperty(type, name) { + function isKnownProperty(type, name, isComparingJsxAttributes) { if (type.flags & 32768 /* Object */) { var resolved = resolveStructuredTypeMembers(type); - if ((relation === assignableRelation || relation === comparableRelation) && (type === globalObjectType || isEmptyObjectType(resolved)) || - resolved.stringIndexInfo || - (resolved.numberIndexInfo && isNumericLiteralName(name)) || - getPropertyOfType(type, name)) { + if (resolved.stringIndexInfo || resolved.numberIndexInfo && isNumericLiteralName(name) || + getPropertyOfType(type, name) || isComparingJsxAttributes && !isUnhyphenatedJsxName(name)) { + // For JSXAttributes, if the attribute has a hyphenated name, consider that the attribute to be known. return true; } } else if (type.flags & 196608 /* UnionOrIntersection */) { for (var _i = 0, _a = type.types; _i < _a.length; _i++) { var t = _a[_i]; - if (isKnownProperty(t, name)) { + if (isKnownProperty(t, name, isComparingJsxAttributes)) { return true; } } } return false; } - function isEmptyObjectType(t) { - return t.properties.length === 0 && - t.callSignatures.length === 0 && - t.constructSignatures.length === 0 && - !t.stringIndexInfo && - !t.numberIndexInfo; - } function hasExcessProperties(source, target, reportErrors) { if (maybeTypeOfKind(target, 32768 /* Object */) && !(getObjectFlags(target) & 512 /* ObjectLiteralPatternWithComputedProperties */)) { + var isComparingJsxAttributes = !!(source.flags & 33554432 /* JsxAttributes */); + if ((relation === assignableRelation || relation === comparableRelation) && + (isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) { + return false; + } for (var _i = 0, _a = getPropertiesOfObjectType(source); _i < _a.length; _i++) { var prop = _a[_i]; - if (!isKnownProperty(target, prop.name)) { + if (!isKnownProperty(target, prop.name, isComparingJsxAttributes)) { if (reportErrors) { // We know *exactly* where things went wrong when comparing the types. // Use this property as the error node as this will be more helpful in // reasoning about what went wrong. ts.Debug.assert(!!errorNode); - errorNode = prop.valueDeclaration; - reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target)); + if (ts.isJsxAttributes(errorNode)) { + // JsxAttributes has an object-literal flag and undergo same type-assignablity check as normal object-literal. + // However, using an object-literal error message will be very confusing to the users so we give different a message. + reportError(ts.Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(target)); + } + else { + errorNode = prop.valueDeclaration; + reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target)); + } } return true; } @@ -30894,20 +33384,42 @@ var ts; if (target.flags & 65536 /* Union */ && containsType(targetTypes, source)) { return -1 /* True */; } - var len = targetTypes.length; - for (var i = 0; i < len; i++) { - var related = isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1); + for (var _i = 0, targetTypes_1 = targetTypes; _i < targetTypes_1.length; _i++) { + var type = targetTypes_1[_i]; + var related = isRelatedTo(source, type, /*reportErrors*/ false); if (related) { return related; } } + if (reportErrors) { + var discriminantType = findMatchingDiscriminantType(source, target); + isRelatedTo(source, discriminantType || targetTypes[targetTypes.length - 1], /*reportErrors*/ true); + } return 0 /* False */; } + function findMatchingDiscriminantType(source, target) { + var sourceProperties = getPropertiesOfObjectType(source); + if (sourceProperties) { + for (var _i = 0, sourceProperties_1 = sourceProperties; _i < sourceProperties_1.length; _i++) { + var sourceProperty = sourceProperties_1[_i]; + if (isDiscriminantProperty(target, sourceProperty.name)) { + var sourceType = getTypeOfSymbol(sourceProperty); + for (var _a = 0, _b = target.types; _a < _b.length; _a++) { + var type = _b[_a]; + var targetType = getTypeOfPropertyOfType(type, sourceProperty.name); + if (targetType && isRelatedTo(sourceType, targetType)) { + return type; + } + } + } + } + } + } function typeRelatedToEachType(source, target, reportErrors) { var result = -1 /* True */; var targetTypes = target.types; - for (var _i = 0, targetTypes_1 = targetTypes; _i < targetTypes_1.length; _i++) { - var targetType = targetTypes_1[_i]; + for (var _i = 0, targetTypes_2 = targetTypes; _i < targetTypes_2.length; _i++) { + var targetType = targetTypes_2[_i]; var related = isRelatedTo(source, targetType, reportErrors); if (!related) { return 0 /* False */; @@ -30960,22 +33472,22 @@ var ts; } return result; } - // Determine if two object types are related by structure. First, check if the result is already available in the global cache. + // Determine if possibly recursive types are related. First, check if the result is already available in the global cache. // Second, check if we have already started a comparison of the given two types in which case we assume the result to be true. // Third, check if both types are part of deeply nested chains of generic type instantiations and if so assume the types are // equal and infinitely expanding. Fourth, if we have reached a depth of 100 nested comparisons, assume we have runaway recursion // and issue an error. Otherwise, actually compare the structure of the two types. - function objectTypeRelatedTo(source, originalSource, target, reportErrors) { + function recursiveTypeRelatedTo(source, target, reportErrors) { if (overflow) { return 0 /* False */; } var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; - var related = relation[id]; + var related = relation.get(id); if (related !== undefined) { if (reportErrors && related === 2 /* Failed */) { // We are elaborating errors and the cached result is an unreported failure. Record the result as a reported // failure and continue computing the relation such that errors get reported. - relation[id] = 3 /* FailedAndReported */; + relation.set(id, 3 /* FailedAndReported */); } else { return related === 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */; @@ -30984,7 +33496,7 @@ var ts; if (depth > 0) { for (var i = 0; i < depth; i++) { // If source and target are already being compared, consider them related with assumptions - if (maybeStack[i][id]) { + if (maybeStack[i].get(id)) { return 1 /* Maybe */; } } @@ -31002,75 +33514,192 @@ var ts; sourceStack[depth] = source; targetStack[depth] = target; maybeStack[depth] = ts.createMap(); - maybeStack[depth][id] = 1 /* Succeeded */; + maybeStack[depth].set(id, 1 /* Succeeded */); depth++; var saveExpandingFlags = expandingFlags; - if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack, depth)) + if (!(expandingFlags & 1) && isDeeplyNestedType(source, sourceStack, depth)) expandingFlags |= 1; - if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack, depth)) + if (!(expandingFlags & 2) && isDeeplyNestedType(target, targetStack, depth)) expandingFlags |= 2; - var result; - if (expandingFlags === 3) { - result = 1 /* Maybe */; - } - else if (isGenericMappedType(source) || isGenericMappedType(target)) { - result = mappedTypeRelatedTo(source, target, reportErrors); - } - else { - result = propertiesRelatedTo(source, target, reportErrors); - if (result) { - result &= signaturesRelatedTo(source, target, 0 /* Call */, reportErrors); - if (result) { - result &= signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors); - if (result) { - result &= indexTypesRelatedTo(source, originalSource, target, 0 /* String */, reportErrors); - if (result) { - result &= indexTypesRelatedTo(source, originalSource, target, 1 /* Number */, reportErrors); - } - } - } - } - } + var result = expandingFlags !== 3 ? structuredTypeRelatedTo(source, target, reportErrors) : 1 /* Maybe */; expandingFlags = saveExpandingFlags; depth--; if (result) { var maybeCache = maybeStack[depth]; // If result is definitely true, copy assumptions to global cache, else copy to next level up var destinationCache = (result === -1 /* True */ || depth === 0) ? relation : maybeStack[depth - 1]; - ts.copyProperties(maybeCache, destinationCache); + ts.copyEntries(maybeCache, destinationCache); } else { // A false result goes straight into global cache (when something is false under assumptions it // will also be false without assumptions) - relation[id] = reportErrors ? 3 /* FailedAndReported */ : 2 /* Failed */; + relation.set(id, reportErrors ? 3 /* FailedAndReported */ : 2 /* Failed */); } return result; } - // A type [P in S]: X is related to a type [P in T]: Y if T is related to S and X is related to Y. - function mappedTypeRelatedTo(source, target, reportErrors) { - if (isGenericMappedType(target)) { - if (isGenericMappedType(source)) { - var result_2; - if (relation === identityRelation) { - var readonlyMatches = !source.declaration.readonlyToken === !target.declaration.readonlyToken; - var optionalMatches = !source.declaration.questionToken === !target.declaration.questionToken; - if (readonlyMatches && optionalMatches) { - if (result_2 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { - return result_2 & isRelatedTo(getErasedTemplateTypeFromMappedType(source), getErasedTemplateTypeFromMappedType(target), reportErrors); - } - } - } - else { - if (relation === comparableRelation || !source.declaration.questionToken || target.declaration.questionToken) { - if (result_2 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { - return result_2 & isRelatedTo(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target), reportErrors); - } + function structuredTypeRelatedTo(source, target, reportErrors) { + var result; + var saveErrorInfo = errorInfo; + if (target.flags & 16384 /* TypeParameter */) { + // A source type { [P in keyof T]: X } is related to a target type T if X is related to T[P]. + if (getObjectFlags(source) & 32 /* Mapped */ && getConstraintTypeFromMappedType(source) === getIndexType(target)) { + if (!source.declaration.questionToken) { + var templateType = getTemplateTypeFromMappedType(source); + var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); + if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) { + return result; } } } } - else if (relation !== identityRelation && isEmptyObjectType(resolveStructuredTypeMembers(target))) { - return -1 /* True */; + else if (target.flags & 262144 /* Index */) { + // A keyof S is related to a keyof T if T is related to S. + if (source.flags & 262144 /* Index */) { + if (result = isRelatedTo(target.type, source.type, /*reportErrors*/ false)) { + return result; + } + } + // A type S is assignable to keyof T if S is assignable to keyof C, where C is the + // constraint of T. + var constraint = getConstraintOfType(target.type); + if (constraint) { + if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) { + return result; + } + } + } + else if (target.flags & 524288 /* IndexedAccess */) { + // A type S is related to a type T[K] if S is related to A[K], where K is string-like and + // A is the apparent type of S. + var constraint = getConstraintOfType(target); + if (constraint) { + if (result = isRelatedTo(source, constraint, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + } + if (source.flags & 16384 /* TypeParameter */) { + // A source type T is related to a target type { [P in keyof T]: X } if T[P] is related to X. + if (getObjectFlags(target) & 32 /* Mapped */ && getConstraintTypeFromMappedType(target) === getIndexType(source)) { + var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); + var templateType = getTemplateTypeFromMappedType(target); + if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + else { + var constraint = getConstraintOfTypeParameter(source); + // A type parameter with no constraint is not related to the non-primitive object type. + if (constraint || !(target.flags & 16777216 /* NonPrimitive */)) { + if (!constraint || constraint.flags & 1 /* Any */) { + constraint = emptyObjectType; + } + // The constraint may need to be further instantiated with its 'this' type. + constraint = getTypeWithThisArgument(constraint, source); + // Report constraint errors only if the constraint is not the empty object type + var reportConstraintErrors = reportErrors && constraint !== emptyObjectType; + if (result = isRelatedTo(constraint, target, reportConstraintErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + } + } + else if (source.flags & 524288 /* IndexedAccess */) { + // A type S[K] is related to a type T if A[K] is related to T, where K is string-like and + // A is the apparent type of S. + var constraint = getConstraintOfType(source); + if (constraint) { + if (result = isRelatedTo(constraint, target, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + else if (target.flags & 524288 /* IndexedAccess */ && source.indexType === target.indexType) { + // if we have indexed access types with identical index types, see if relationship holds for + // the two object types. + if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) { + return result; + } + } + } + else { + if (getObjectFlags(source) & 4 /* Reference */ && getObjectFlags(target) & 4 /* Reference */ && source.target === target.target) { + // We have type references to same target type, see if relationship holds for all type arguments + if (result = typeArgumentsRelatedTo(source, target, reportErrors)) { + return result; + } + } + // Even if relationship doesn't hold for unions, intersections, or generic type references, + // it may hold in a structural comparison. + var sourceIsPrimitive = !!(source.flags & 8190 /* Primitive */); + if (relation !== identityRelation) { + source = getApparentType(source); + } + // In a check of the form X = A & B, we will have previously checked if A relates to X or B relates + // to X. Failing both of those we want to check if the aggregation of A and B's members structurally + // relates to X. Thus, we include intersection types on the source side here. + if (source.flags & (32768 /* Object */ | 131072 /* Intersection */) && target.flags & 32768 /* Object */) { + // Report structural errors only if we haven't reported any errors yet + var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !sourceIsPrimitive; + if (isGenericMappedType(source) || isGenericMappedType(target)) { + result = mappedTypeRelatedTo(source, target, reportStructuralErrors); + } + else { + result = propertiesRelatedTo(source, target, reportStructuralErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 0 /* Call */, reportStructuralErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 1 /* Construct */, reportStructuralErrors); + if (result) { + result &= indexTypesRelatedTo(source, target, 0 /* String */, sourceIsPrimitive, reportStructuralErrors); + if (result) { + result &= indexTypesRelatedTo(source, target, 1 /* Number */, sourceIsPrimitive, reportStructuralErrors); + } + } + } + } + } + if (result) { + errorInfo = saveErrorInfo; + return result; + } + } + } + return 0 /* False */; + } + // A type [P in S]: X is related to a type [Q in T]: Y if T is related to S and X' is + // related to Y, where X' is an instantiation of X in which P is replaced with Q. Notice + // that S and T are contra-variant whereas X and Y are co-variant. + function mappedTypeRelatedTo(source, target, reportErrors) { + if (isGenericMappedType(target)) { + if (isGenericMappedType(source)) { + var sourceReadonly = !!source.declaration.readonlyToken; + var sourceOptional = !!source.declaration.questionToken; + var targetReadonly = !!target.declaration.readonlyToken; + var targetOptional = !!target.declaration.questionToken; + var modifiersRelated = relation === identityRelation ? + sourceReadonly === targetReadonly && sourceOptional === targetOptional : + relation === comparableRelation || !sourceOptional || targetOptional; + if (modifiersRelated) { + var result_2; + if (result_2 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { + var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); + return result_2 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); + } + } + } + else if (target.declaration.questionToken && isEmptyObjectType(source)) { + return -1 /* True */; + } + } + else if (relation !== identityRelation) { + var resolved = resolveStructuredTypeMembers(target); + if (isEmptyResolvedType(resolved) || resolved.stringIndexInfo && resolved.stringIndexInfo.type.flags & 1 /* Any */) { + return -1 /* True */; + } } return 0 /* False */; } @@ -31081,22 +33710,28 @@ var ts; var result = -1 /* True */; var properties = getPropertiesOfObjectType(target); var requireOptionalProperties = relation === subtypeRelation && !(getObjectFlags(source) & 128 /* ObjectLiteral */); - for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { - var targetProp = properties_3[_i]; + for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) { + var targetProp = properties_4[_i]; var sourceProp = getPropertyOfType(source, targetProp.name); if (sourceProp !== targetProp) { if (!sourceProp) { - if (!(targetProp.flags & 536870912 /* Optional */) || requireOptionalProperties) { + if (!(targetProp.flags & 67108864 /* Optional */) || requireOptionalProperties) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source)); } return 0 /* False */; } } - else if (!(targetProp.flags & 134217728 /* Prototype */)) { + else if (!(targetProp.flags & 16777216 /* Prototype */)) { var sourcePropFlags = getDeclarationModifierFlagsFromSymbol(sourceProp); var targetPropFlags = getDeclarationModifierFlagsFromSymbol(targetProp); if (sourcePropFlags & 8 /* Private */ || targetPropFlags & 8 /* Private */) { + if (getCheckFlags(sourceProp) & 256 /* ContainsPrivate */) { + if (reportErrors) { + reportError(ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(sourceProp), typeToString(source)); + } + return 0 /* False */; + } if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) { if (reportErrors) { if (sourcePropFlags & 8 /* Private */ && targetPropFlags & 8 /* Private */) { @@ -31110,12 +33745,9 @@ var ts; } } else if (targetPropFlags & 16 /* Protected */) { - var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 32 /* Class */; - var sourceClass = sourceDeclaredInClass ? getDeclaredTypeOfSymbol(getParentOfSymbol(sourceProp)) : undefined; - var targetClass = getDeclaredTypeOfSymbol(getParentOfSymbol(targetProp)); - if (!sourceClass || !hasBaseType(sourceClass, targetClass)) { + if (!isValidOverrideOf(sourceProp, targetProp)) { if (reportErrors) { - reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(sourceClass || source), typeToString(targetClass)); + reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(getDeclaringClass(sourceProp) || source), typeToString(getDeclaringClass(targetProp) || target)); } return 0 /* False */; } @@ -31135,7 +33767,7 @@ var ts; } result &= related; // When checking for comparability, be more lenient with optional properties. - if (relation !== comparableRelation && sourceProp.flags & 536870912 /* Optional */ && !(targetProp.flags & 536870912 /* Optional */)) { + if (relation !== comparableRelation && sourceProp.flags & 67108864 /* Optional */ && !(targetProp.flags & 67108864 /* Optional */)) { // TypeScript 1.0 spec (April 2014): 3.8.3 // S is a subtype of a type T, and T is a supertype of S if ... // S' and T are object types and, for each member M in T.. @@ -31163,8 +33795,8 @@ var ts; return 0 /* False */; } var result = -1 /* True */; - for (var _i = 0, sourceProperties_1 = sourceProperties; _i < sourceProperties_1.length; _i++) { - var sourceProp = sourceProperties_1[_i]; + for (var _i = 0, sourceProperties_2 = sourceProperties; _i < sourceProperties_2.length; _i++) { + var sourceProp = sourceProperties_2[_i]; var targetProp = getPropertyOfObjectType(target, sourceProp.name); if (!targetProp) { return 0 /* False */; @@ -31228,7 +33860,7 @@ var ts; * See signatureAssignableTo, compareSignaturesIdentical */ function signatureRelatedTo(source, target, reportErrors) { - return compareSignaturesRelated(source, target, /*ignoreReturnTypes*/ false, reportErrors, reportError, isRelatedTo); + return compareSignaturesRelated(source, target, /*checkAsCallback*/ false, /*ignoreReturnTypes*/ false, reportErrors, reportError, isRelatedTo); } function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); @@ -31237,7 +33869,7 @@ var ts; return 0 /* False */; } var result = -1 /* True */; - for (var i = 0, len = sourceSignatures.length; i < len; i++) { + for (var i = 0; i < sourceSignatures.length; i++) { var related = compareSignaturesIdentical(sourceSignatures[i], targetSignatures[i], /*partialMatch*/ false, /*ignoreThisTypes*/ false, /*ignoreReturnTypes*/ false, isRelatedTo); if (!related) { return 0 /* False */; @@ -31270,12 +33902,12 @@ var ts; } return related; } - function indexTypesRelatedTo(source, originalSource, target, kind, reportErrors) { + function indexTypesRelatedTo(source, target, kind, sourceIsPrimitive, reportErrors) { if (relation === identityRelation) { return indexTypesIdenticalTo(source, target, kind); } var targetInfo = getIndexInfoOfType(target, kind); - if (!targetInfo || ((targetInfo.type.flags & 1 /* Any */) && !(originalSource.flags & 8190 /* Primitive */))) { + if (!targetInfo || targetInfo.type.flags & 1 /* Any */ && !sourceIsPrimitive) { // Index signature of type any permits assignment from everything but primitives return -1 /* True */; } @@ -31337,6 +33969,45 @@ var ts; return false; } } + // Invoke the callback for each underlying property symbol of the given symbol and return the first + // value that isn't undefined. + function forEachProperty(prop, callback) { + if (getCheckFlags(prop) & 6 /* Synthetic */) { + for (var _i = 0, _a = prop.containingType.types; _i < _a.length; _i++) { + var t = _a[_i]; + var p = getPropertyOfType(t, prop.name); + var result = p && forEachProperty(p, callback); + if (result) { + return result; + } + } + return undefined; + } + return callback(prop); + } + // Return the declaring class type of a property or undefined if property not declared in class + function getDeclaringClass(prop) { + return prop.parent && prop.parent.flags & 32 /* Class */ ? getDeclaredTypeOfSymbol(getParentOfSymbol(prop)) : undefined; + } + // Return true if some underlying source property is declared in a class that derives + // from the given base class. + function isPropertyInClassDerivedFrom(prop, baseClass) { + return forEachProperty(prop, function (sp) { + var sourceClass = getDeclaringClass(sp); + return sourceClass ? hasBaseType(sourceClass, baseClass) : false; + }); + } + // Return true if source property is a valid override of protected parts of target property. + function isValidOverrideOf(sourceProp, targetProp) { + return !forEachProperty(targetProp, function (tp) { return getDeclarationModifierFlagsFromSymbol(tp) & 16 /* Protected */ ? + !isPropertyInClassDerivedFrom(sourceProp, getDeclaringClass(tp)) : false; }); + } + // Return true if the given class derives from each of the declaring classes of the protected + // constituents of the given property. + function isClassDerivedFromDeclaringClasses(checkClass, prop) { + return forEachProperty(prop, function (p) { return getDeclarationModifierFlagsFromSymbol(p) & 16 /* Protected */ ? + !hasBaseType(checkClass, getDeclaringClass(p)) : false; }) ? undefined : checkClass; + } // Return true if the given type is the constructor type for an abstract class function isAbstractConstructorType(type) { if (getObjectFlags(type) & 16 /* Anonymous */) { @@ -31350,22 +34021,24 @@ var ts; } return false; } - // Return true if the given type is part of a deeply nested chain of generic instantiations. We consider this to be the case - // when structural type comparisons have been started for 10 or more instantiations of the same generic type. It is possible, - // though highly unlikely, for this test to be true in a situation where a chain of instantiations is not infinitely expanding. - // Effectively, we will generate a false positive when two types are structurally equal to at least 10 levels, but unequal at - // some level beyond that. - function isDeeplyNestedGeneric(type, stack, depth) { - // We track type references (created by createTypeReference) and instantiated types (created by instantiateType) - if (getObjectFlags(type) & (4 /* Reference */ | 64 /* Instantiated */) && depth >= 5) { + // Return true if the given type is deeply nested. We consider this to be the case when structural type comparisons + // for 5 or more occurrences or instantiations of the type have been recorded on the given stack. It is possible, + // though highly unlikely, for this test to be true in a situation where a chain of instantiations is not infinitely + // expanding. Effectively, we will generate a false positive when two types are structurally equal to at least 5 + // levels, but unequal at some level beyond that. + function isDeeplyNestedType(type, stack, depth) { + // We track all object types that have an associated symbol (representing the origin of the type) + if (depth >= 5 && type.flags & 32768 /* Object */) { var symbol = type.symbol; - var count = 0; - for (var i = 0; i < depth; i++) { - var t = stack[i]; - if (getObjectFlags(t) & (4 /* Reference */ | 64 /* Instantiated */) && t.symbol === symbol) { - count++; - if (count >= 5) - return true; + if (symbol) { + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (t.flags & 32768 /* Object */ && t.symbol === symbol) { + count++; + if (count >= 5) + return true; + } } } } @@ -31392,7 +34065,7 @@ var ts; } } else { - if ((sourceProp.flags & 536870912 /* Optional */) !== (targetProp.flags & 536870912 /* Optional */)) { + if ((sourceProp.flags & 67108864 /* Optional */) !== (targetProp.flags & 67108864 /* Optional */)) { return 0 /* False */; } } @@ -31436,7 +34109,7 @@ var ts; // the constraints with a common set of type arguments to get relatable entities in places where // type parameters occur in the constraints. The complexity of doing that doesn't seem worthwhile, // particularly as we're comparing erased versions of the signatures below. - if ((source.typeParameters ? source.typeParameters.length : 0) !== (target.typeParameters ? target.typeParameters.length : 0)) { + if (ts.length(source.typeParameters) !== ts.length(target.typeParameters)) { return 0 /* False */; } // Spec 1.0 Section 3.8.3 & 3.8.4: @@ -31476,8 +34149,8 @@ var ts; return signature.hasRestParameter && parameterIndex >= signature.parameters.length - 1; } function isSupertypeOfEach(candidate, types) { - for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { - var t = types_7[_i]; + for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { + var t = types_10[_i]; if (candidate !== t && !isTypeSubtypeOf(t, candidate)) return false; } @@ -31485,8 +34158,8 @@ var ts; } function literalTypesWithSameBaseType(types) { var commonBaseType; - for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { - var t = types_8[_i]; + for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { + var t = types_11[_i]; var baseType = getBaseTypeOfLiteralType(t); if (!commonBaseType) { commonBaseType = baseType; @@ -31592,8 +34265,8 @@ var ts; } function getFalsyFlagsOfTypes(types) { var result = 0; - for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { - var t = types_9[_i]; + for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { + var t = types_12[_i]; result |= getFalsyFlags(t); } return result; @@ -31625,7 +34298,7 @@ var ts; types.push(undefinedType); if (flags & 4096 /* Null */) types.push(nullType); - return getUnionType(types, /*subtypeReduction*/ true); + return getUnionType(types); } function removeDefinitelyFalsyTypes(type) { return getFalsyFlags(type) & 7392 /* DefinitelyFalsy */ ? @@ -31644,8 +34317,8 @@ var ts; getSignaturesOfType(type, 0 /* Call */).length === 0 && getSignaturesOfType(type, 1 /* Construct */).length === 0; } - function createTransientSymbol(source, type) { - var symbol = createSymbol(source.flags | 67108864 /* Transient */, source.name); + function createSymbolWithType(source, type) { + var symbol = createSymbol(source.flags, source.name); symbol.declarations = source.declarations; symbol.parent = source.parent; symbol.type = type; @@ -31661,9 +34334,8 @@ var ts; var property = _a[_i]; var original = getTypeOfSymbol(property); var updated = f(original); - members[property.name] = updated === original ? property : createTransientSymbol(property, updated); + members.set(property.name, updated === original ? property : createSymbolWithType(property, updated)); } - ; return members; } /** @@ -31687,11 +34359,19 @@ var ts; type.regularType = regularNew; return regularNew; } + function getWidenedProperty(prop) { + var original = getTypeOfSymbol(prop); + var widened = getWidenedType(original); + return widened === original ? prop : createSymbolWithType(prop, widened); + } function getWidenedTypeOfObjectLiteral(type) { - var members = transformTypeOfMembers(type, function (prop) { - var widened = getWidenedType(prop); - return prop === widened ? prop : widened; - }); + var members = ts.createMap(); + for (var _i = 0, _a = getPropertiesOfObjectType(type); _i < _a.length; _i++) { + var prop = _a[_i]; + // Since get accessors already widen their return value there is no need to + // widen accessor based properties here. + members.set(prop.name, prop.flags & 4 /* Property */ ? getWidenedProperty(prop) : prop); + } var stringIndexInfo = getIndexInfoOfType(type, 0 /* String */); var numberIndexInfo = getIndexInfoOfType(type, 1 /* Number */); return createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexInfo && createIndexInfo(getWidenedType(stringIndexInfo.type), stringIndexInfo.isReadonly), numberIndexInfo && createIndexInfo(getWidenedType(numberIndexInfo.type), numberIndexInfo.isReadonly)); @@ -31763,25 +34443,25 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 144 /* Parameter */: + case 145 /* Parameter */: diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 174 /* BindingElement */: + case 175 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; break; - case 225 /* FunctionDeclaration */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 227 /* FunctionDeclaration */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -31794,7 +34474,7 @@ var ts; error(declaration, diagnostic, ts.declarationNameToString(declaration.name), typeAsString); } function reportErrorsFromWidening(declaration, type) { - if (produceDiagnostics && compilerOptions.noImplicitAny && type.flags & 2097152 /* ContainsWideningType */) { + if (produceDiagnostics && noImplicitAny && type.flags & 2097152 /* ContainsWideningType */) { // Report implicit any error within type if possible, otherwise report error on declaration if (!reportWideningErrorsInType(type)) { reportImplicitAnyError(declaration, type); @@ -31821,13 +34501,14 @@ var ts; callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i)); } } - function createInferenceContext(signature, inferUnionTypes) { + function createInferenceContext(signature, inferUnionTypes, useAnyForNoInferences) { var inferences = ts.map(signature.typeParameters, createTypeInferencesObject); return { signature: signature, inferUnionTypes: inferUnionTypes, inferences: inferences, inferredTypes: new Array(signature.typeParameters.length), + useAnyForNoInferences: useAnyForNoInferences }; } function createTypeInferencesObject() { @@ -31841,25 +34522,73 @@ var ts; // Return true if the given type could possibly reference a type parameter for which // we perform type inference (i.e. a type parameter of a generic function). We cache // results for union and intersection types for performance reasons. - function couldContainTypeParameters(type) { + function couldContainTypeVariables(type) { var objectFlags = getObjectFlags(type); - return !!(type.flags & 16384 /* TypeParameter */ || - objectFlags & 4 /* Reference */ && ts.forEach(type.typeArguments, couldContainTypeParameters) || + return !!(type.flags & 540672 /* TypeVariable */ || + objectFlags & 4 /* Reference */ && ts.forEach(type.typeArguments, couldContainTypeVariables) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (8192 /* Method */ | 2048 /* TypeLiteral */ | 32 /* Class */) || objectFlags & 32 /* Mapped */ || - type.flags & 196608 /* UnionOrIntersection */ && couldUnionOrIntersectionContainTypeParameters(type)); + type.flags & 196608 /* UnionOrIntersection */ && couldUnionOrIntersectionContainTypeVariables(type)); } - function couldUnionOrIntersectionContainTypeParameters(type) { - if (type.couldContainTypeParameters === undefined) { - type.couldContainTypeParameters = ts.forEach(type.types, couldContainTypeParameters); + function couldUnionOrIntersectionContainTypeVariables(type) { + if (type.couldContainTypeVariables === undefined) { + type.couldContainTypeVariables = ts.forEach(type.types, couldContainTypeVariables); } - return type.couldContainTypeParameters; + return type.couldContainTypeVariables; } function isTypeParameterAtTopLevel(type, typeParameter) { return type === typeParameter || type.flags & 196608 /* UnionOrIntersection */ && ts.forEach(type.types, function (t) { return isTypeParameterAtTopLevel(t, typeParameter); }); } - function inferTypes(context, originalSource, originalTarget) { - var typeParameters = context.signature.typeParameters; + // Infer a suitable input type for a homomorphic mapped type { [P in keyof T]: X }. We construct + // an object type with the same set of properties as the source type, where the type of each + // property is computed by inferring from the source property type to X for the type + // variable T[P] (i.e. we treat the type T[P] as the type variable we're inferring for). + function inferTypeForHomomorphicMappedType(source, target) { + var properties = getPropertiesOfType(source); + var indexInfo = getIndexInfoOfType(source, 0 /* String */); + if (properties.length === 0 && !indexInfo) { + return undefined; + } + var typeVariable = getIndexedAccessType(getConstraintTypeFromMappedType(target).type, getTypeParameterFromMappedType(target)); + var typeVariableArray = [typeVariable]; + var typeInferences = createTypeInferencesObject(); + var typeInferencesArray = [typeInferences]; + var templateType = getTemplateTypeFromMappedType(target); + var readonlyMask = target.declaration.readonlyToken ? false : true; + var optionalMask = target.declaration.questionToken ? 0 : 67108864 /* Optional */; + var members = createSymbolTable(properties); + for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) { + var prop = properties_5[_i]; + var inferredPropType = inferTargetType(getTypeOfSymbol(prop)); + if (!inferredPropType) { + return undefined; + } + var inferredProp = createSymbol(4 /* Property */ | prop.flags & optionalMask, prop.name); + inferredProp.checkFlags = readonlyMask && isReadonlySymbol(prop) ? 8 /* Readonly */ : 0; + inferredProp.declarations = prop.declarations; + inferredProp.type = inferredPropType; + members.set(prop.name, inferredProp); + } + if (indexInfo) { + var inferredIndexType = inferTargetType(indexInfo.type); + if (!inferredIndexType) { + return undefined; + } + indexInfo = createIndexInfo(inferredIndexType, readonlyMask && indexInfo.isReadonly); + } + return createAnonymousType(undefined, members, emptyArray, emptyArray, indexInfo, undefined); + function inferTargetType(sourceType) { + typeInferences.primary = undefined; + typeInferences.secondary = undefined; + inferTypes(typeVariableArray, typeInferencesArray, sourceType, templateType); + var inferences = typeInferences.primary || typeInferences.secondary; + return inferences && getUnionType(inferences, /*subtypeReduction*/ true); + } + } + function inferTypesWithContext(context, originalSource, originalTarget) { + inferTypes(context.signature.typeParameters, context.inferences, originalSource, originalTarget); + } + function inferTypes(typeVariables, typeInferences, originalSource, originalTarget) { var sourceStack; var targetStack; var depth = 0; @@ -31875,7 +34604,7 @@ var ts; return false; } function inferFromTypes(source, target) { - if (!couldContainTypeParameters(target)) { + if (!couldContainTypeVariables(target)) { return; } if (source.aliasSymbol && source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol) { @@ -31927,7 +34656,7 @@ var ts; target = removeTypesFromUnionOrIntersection(target, matchingTypes); } } - if (target.flags & 16384 /* TypeParameter */) { + if (target.flags & 540672 /* TypeVariable */) { // If target is a type parameter, make an inference, unless the source type contains // the anyFunctionType (the wildcard type that's used to avoid contextually typing functions). // Because the anyFunctionType is internal, it should not be exposed to the user by adding @@ -31937,9 +34666,9 @@ var ts; if (source.flags & 8388608 /* ContainsAnyFunctionType */) { return; } - for (var i = 0; i < typeParameters.length; i++) { - if (target === typeParameters[i]) { - var inferences = context.inferences[i]; + for (var i = 0; i < typeVariables.length; i++) { + if (target === typeVariables[i]) { + var inferences = typeInferences[i]; if (!inferences.isFixed) { // Any inferences that are made to a type parameter in a union type are inferior // to inferences made to a flat (non-union) type. This is because if we infer to @@ -31953,7 +34682,7 @@ var ts; if (!ts.contains(candidates, source)) { candidates.push(source); } - if (!isTypeParameterAtTopLevel(originalTarget, target)) { + if (target.flags & 16384 /* TypeParameter */ && !isTypeParameterAtTopLevel(originalTarget, target)) { inferences.topLevel = false; } } @@ -31972,25 +34701,25 @@ var ts; } else if (target.flags & 196608 /* UnionOrIntersection */) { var targetTypes = target.types; - var typeParameterCount = 0; - var typeParameter = void 0; - // First infer to each type in union or intersection that isn't a type parameter - for (var _d = 0, targetTypes_2 = targetTypes; _d < targetTypes_2.length; _d++) { - var t = targetTypes_2[_d]; - if (t.flags & 16384 /* TypeParameter */ && ts.contains(typeParameters, t)) { - typeParameter = t; - typeParameterCount++; + var typeVariableCount = 0; + var typeVariable = void 0; + // First infer to each type in union or intersection that isn't a type variable + for (var _d = 0, targetTypes_3 = targetTypes; _d < targetTypes_3.length; _d++) { + var t = targetTypes_3[_d]; + if (t.flags & 540672 /* TypeVariable */ && ts.contains(typeVariables, t)) { + typeVariable = t; + typeVariableCount++; } else { inferFromTypes(source, t); } } - // Next, if target containings a single naked type parameter, make a secondary inference to that type - // parameter. This gives meaningful results for union types in co-variant positions and intersection + // Next, if target containings a single naked type variable, make a secondary inference to that type + // variable. This gives meaningful results for union types in co-variant positions and intersection // types in contra-variant positions (such as callback parameters). - if (typeParameterCount === 1) { + if (typeVariableCount === 1) { inferiority++; - inferFromTypes(source, typeParameter); + inferFromTypes(source, typeVariable); inferiority--; } } @@ -32008,14 +34737,14 @@ var ts; if (isInProcess(source, target)) { return; } - if (isDeeplyNestedGeneric(source, sourceStack, depth) && isDeeplyNestedGeneric(target, targetStack, depth)) { + if (isDeeplyNestedType(source, sourceStack, depth) && isDeeplyNestedType(target, targetStack, depth)) { return; } var key = source.id + "," + target.id; - if (visited[key]) { + if (visited.get(key)) { return; } - visited[key] = true; + visited.set(key, true); if (depth === 0) { sourceStack = []; targetStack = []; @@ -32031,12 +34760,25 @@ var ts; function inferFromObjectTypes(source, target) { if (getObjectFlags(target) & 32 /* Mapped */) { var constraintType = getConstraintTypeFromMappedType(target); - if (getObjectFlags(source) & 32 /* Mapped */) { - inferFromTypes(getConstraintTypeFromMappedType(source), constraintType); - inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target)); + if (constraintType.flags & 262144 /* Index */) { + // We're inferring from some source type S to a homomorphic mapped type { [P in keyof T]: X }, + // where T is a type variable. Use inferTypeForHomomorphicMappedType to infer a suitable source + // type and then make a secondary inference from that type to T. We make a secondary inference + // such that direct inferences to T get priority over inferences to Partial, for example. + var index = ts.indexOf(typeVariables, constraintType.type); + if (index >= 0 && !typeInferences[index].isFixed) { + var inferredType = inferTypeForHomomorphicMappedType(source, target); + if (inferredType) { + inferiority++; + inferFromTypes(inferredType, typeVariables[index]); + inferiority--; + } + } return; } if (constraintType.flags & 16384 /* TypeParameter */) { + // We're inferring from some source type S to a mapped type { [P in T]: X }, where T is a type + // parameter. Infer from 'keyof S' to T and infer from a union of each property type in S to X. inferFromTypes(getIndexType(source), constraintType); inferFromTypes(getUnionType(ts.map(getPropertiesOfType(source), getTypeOfSymbol)), getTemplateTypeFromMappedType(target)); return; @@ -32049,8 +34791,8 @@ var ts; } function inferFromProperties(source, target) { var properties = getPropertiesOfObjectType(target); - for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) { - var targetProp = properties_4[_i]; + for (var _i = 0, properties_6 = properties; _i < properties_6.length; _i++) { + var targetProp = properties_6[_i]; var sourceProp = getPropertyOfObjectType(source, targetProp.name); if (sourceProp) { inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); @@ -32100,8 +34842,8 @@ var ts; } } function typeIdenticalToSomeType(type, types) { - for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { - var t = types_10[_i]; + for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { + var t = types_13[_i]; if (isTypeIdenticalTo(t, type)) { return true; } @@ -32151,11 +34893,20 @@ var ts; inferenceSucceeded = !!unionOrSuperType; } else { - // Infer the empty object type when no inferences were made. It is important to remember that - // in this case, inference still succeeds, meaning there is no error for not having inference - // candidates. An inference error only occurs when there are *conflicting* candidates, i.e. + // Infer either the default or the empty object type when no inferences were + // made. It is important to remember that in this case, inference still + // succeeds, meaning there is no error for not having inference candidates. An + // inference error only occurs when there are *conflicting* candidates, i.e. // candidates with no common supertype. - inferredType = emptyObjectType; + var defaultType = getDefaultFromTypeParameter(context.signature.typeParameters[index]); + if (defaultType) { + // Instantiate the default type. Any forward reference to a type + // parameter should be instantiated to the empty object type. + inferredType = instantiateType(defaultType, combineTypeMappers(createBackreferenceMapper(context.signature.typeParameters, index), getInferenceMapper(context))); + } + else { + inferredType = context.useAnyForNoInferences ? anyType : emptyObjectType; + } inferenceSucceeded = true; } context.inferredTypes[index] = inferredType; @@ -32196,19 +34947,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 3.6.3 // A type query consists of the keyword typeof followed by an expression. // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - while (node) { - switch (node.kind) { - case 160 /* TypeQuery */: - return true; - case 70 /* Identifier */: - case 141 /* QualifiedName */: - node = node.parent; - continue; - default: - return false; - } - } - ts.Debug.fail("should not get here"); + return !!ts.findAncestor(node, function (n) { return n.kind === 161 /* TypeQuery */ ? true : n.kind === 70 /* Identifier */ || n.kind === 142 /* QualifiedName */ ? false : "quit"; }); } // Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers // separated by dots). The key consists of the id of the symbol referenced by the @@ -32222,7 +34961,7 @@ var ts; if (node.kind === 98 /* ThisKeyword */) { return "0"; } - if (node.kind === 177 /* PropertyAccessExpression */) { + if (node.kind === 178 /* PropertyAccessExpression */) { var key = getFlowCacheKey(node.expression); return key && key + "." + node.name.text; } @@ -32233,7 +34972,7 @@ var ts; case 70 /* Identifier */: case 98 /* ThisKeyword */: return node; - case 177 /* PropertyAccessExpression */: + case 178 /* PropertyAccessExpression */: return getLeftmostIdentifierOrThis(node.expression); } return undefined; @@ -32242,19 +34981,21 @@ var ts; switch (source.kind) { case 70 /* Identifier */: return target.kind === 70 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 223 /* VariableDeclaration */ || target.kind === 174 /* BindingElement */) && + (target.kind === 225 /* VariableDeclaration */ || target.kind === 175 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 98 /* ThisKeyword */: return target.kind === 98 /* ThisKeyword */; - case 177 /* PropertyAccessExpression */: - return target.kind === 177 /* PropertyAccessExpression */ && + case 96 /* SuperKeyword */: + return target.kind === 96 /* SuperKeyword */; + case 178 /* PropertyAccessExpression */: + return target.kind === 178 /* PropertyAccessExpression */ && source.name.text === target.name.text && isMatchingReference(source.expression, target.expression); } return false; } function containsMatchingReference(source, target) { - while (source.kind === 177 /* PropertyAccessExpression */) { + while (source.kind === 178 /* PropertyAccessExpression */) { source = source.expression; if (isMatchingReference(source, target)) { return true; @@ -32267,7 +35008,7 @@ var ts; // a possible discriminant if its type differs in the constituents of containing union type, and if every // choice is a unit type or a union of unit types. function containsMatchingReferenceDiscriminant(source, target) { - return target.kind === 177 /* PropertyAccessExpression */ && + return target.kind === 178 /* PropertyAccessExpression */ && containsMatchingReference(source, target.expression) && isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.text); } @@ -32275,7 +35016,7 @@ var ts; if (expr.kind === 70 /* Identifier */) { return getTypeOfSymbol(getResolvedSymbol(expr)); } - if (expr.kind === 177 /* PropertyAccessExpression */) { + if (expr.kind === 178 /* PropertyAccessExpression */) { var type = getDeclaredTypeOfReference(expr.expression); return type && getTypeOfPropertyOfType(type, expr.name.text); } @@ -32284,9 +35025,9 @@ var ts; function isDiscriminantProperty(type, name) { if (type && type.flags & 65536 /* Union */) { var prop = getUnionOrIntersectionProperty(type, name); - if (prop && prop.flags & 268435456 /* SyntheticProperty */) { + if (prop && getCheckFlags(prop) & 2 /* SyntheticProperty */) { if (prop.isDiscriminantProperty === undefined) { - prop.isDiscriminantProperty = prop.hasNonUniformType && isLiteralType(getTypeOfSymbol(prop)); + prop.isDiscriminantProperty = prop.checkFlags & 32 /* HasNonUniformType */ && isLiteralType(getTypeOfSymbol(prop)); } return prop.isDiscriminantProperty; } @@ -32305,7 +35046,7 @@ var ts; } } } - if (callExpression.expression.kind === 177 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 178 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -32347,8 +35088,8 @@ var ts; } function getTypeFactsOfTypes(types) { var result = 0 /* None */; - for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { - var t = types_11[_i]; + for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { + var t = types_14[_i]; result |= getTypeFacts(t); } return result; @@ -32358,7 +35099,7 @@ var ts; // check. This gives us a quicker out in the common case where an object type is not a function. var resolved = resolveStructuredTypeMembers(type); return !!(resolved.callSignatures.length || resolved.constructSignatures.length || - resolved.members["bind"] && isTypeSubtypeOf(type, globalFunctionType)); + resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType)); } function getTypeFacts(type) { var flags = type.flags; @@ -32401,9 +35142,11 @@ var ts; if (flags & 512 /* ESSymbol */) { return strictNullChecks ? 1981320 /* SymbolStrictFacts */ : 4193160 /* SymbolFacts */; } - if (flags & 16384 /* TypeParameter */) { - var constraint = getConstraintOfTypeParameter(type); - return getTypeFacts(constraint || emptyObjectType); + if (flags & 16777216 /* NonPrimitive */) { + return strictNullChecks ? 6166480 /* ObjectStrictFacts */ : 8378320 /* ObjectFacts */; + } + if (flags & 540672 /* TypeVariable */) { + return getTypeFacts(getBaseConstraintOfType(type) || emptyObjectType); } if (flags & 196608 /* UnionOrIntersection */) { return getTypeFactsOfTypes(type.types); @@ -32429,17 +35172,23 @@ var ts; } function getTypeOfDestructuredArrayElement(type, index) { return isTupleLikeType(type) && getTypeOfPropertyOfType(type, "" + index) || - checkIteratedTypeOrElementType(type, /*errorNode*/ undefined, /*allowStringInput*/ false) || + checkIteratedTypeOrElementType(type, /*errorNode*/ undefined, /*allowStringInput*/ false, /*allowAsyncIterable*/ false) || unknownType; } function getTypeOfDestructuredSpreadExpression(type) { - return createArrayType(checkIteratedTypeOrElementType(type, /*errorNode*/ undefined, /*allowStringInput*/ false) || unknownType); + return createArrayType(checkIteratedTypeOrElementType(type, /*errorNode*/ undefined, /*allowStringInput*/ false, /*allowAsyncIterable*/ false) || unknownType); } function getAssignedTypeOfBinaryExpression(node) { - return node.parent.kind === 175 /* ArrayLiteralExpression */ || node.parent.kind === 257 /* PropertyAssignment */ ? + var isDestructuringDefaultAssignment = node.parent.kind === 176 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 260 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } + function isDestructuringAssignmentTarget(parent) { + return parent.parent.kind === 193 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 215 /* ForOfStatement */ && parent.parent.initializer === parent; + } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), ts.indexOf(node.elements, element)); } @@ -32455,21 +35204,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 212 /* ForInStatement */: + case 214 /* ForInStatement */: return stringType; - case 213 /* ForOfStatement */: - return checkRightHandSideOfForOf(parent.expression) || unknownType; - case 192 /* BinaryExpression */: + case 215 /* ForOfStatement */: + return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || unknownType; + case 193 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 186 /* DeleteExpression */: + case 187 /* DeleteExpression */: return undefinedType; - case 175 /* ArrayLiteralExpression */: + case 176 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 196 /* SpreadElement */: + case 197 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 257 /* PropertyAssignment */: + case 260 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 258 /* ShorthandPropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return unknownType; @@ -32477,7 +35226,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 172 /* ObjectBindingPattern */ ? + var type = pattern.kind === 173 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, ts.indexOf(pattern.elements, node)) : @@ -32495,35 +35244,35 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 212 /* ForInStatement */) { + if (node.parent.parent.kind === 214 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 213 /* ForOfStatement */) { - return checkRightHandSideOfForOf(node.parent.parent.expression) || unknownType; + if (node.parent.parent.kind === 215 /* ForOfStatement */) { + return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || unknownType; } return unknownType; } function getInitialType(node) { - return node.kind === 223 /* VariableDeclaration */ ? + return node.kind === 225 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function getInitialOrAssignedType(node) { - return node.kind === 223 /* VariableDeclaration */ || node.kind === 174 /* BindingElement */ ? + return node.kind === 225 /* VariableDeclaration */ || node.kind === 175 /* BindingElement */ ? getInitialType(node) : getAssignedType(node); } function isEmptyArrayAssignment(node) { - return node.kind === 223 /* VariableDeclaration */ && node.initializer && + return node.kind === 225 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 174 /* BindingElement */ && node.parent.kind === 192 /* BinaryExpression */ && + node.kind !== 175 /* BindingElement */ && node.parent.kind === 193 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: switch (node.operatorToken.kind) { case 57 /* EqualsToken */: return getReferenceCandidate(node.left); @@ -32535,13 +35284,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 183 /* ParenthesizedExpression */ || - parent.kind === 192 /* BinaryExpression */ && parent.operatorToken.kind === 57 /* EqualsToken */ && parent.left === node || - parent.kind === 192 /* BinaryExpression */ && parent.operatorToken.kind === 25 /* CommaToken */ && parent.right === node ? + return parent.kind === 184 /* ParenthesizedExpression */ || + parent.kind === 193 /* BinaryExpression */ && parent.operatorToken.kind === 57 /* EqualsToken */ && parent.left === node || + parent.kind === 193 /* BinaryExpression */ && parent.operatorToken.kind === 25 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 253 /* CaseClause */) { + if (clause.kind === 256 /* CaseClause */) { var caseType = getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); return isUnitType(caseType) ? caseType : undefined; } @@ -32589,8 +35338,32 @@ var ts; } return f(type) ? type : neverType; } - function mapType(type, f) { - return type.flags & 65536 /* Union */ ? getUnionType(ts.map(type.types, f)) : f(type); + // Apply a mapping function to a type and return the resulting type. If the source type + // is a union type, the mapping function is applied to each constituent type and a union + // of the resulting types is returned. + function mapType(type, mapper) { + if (!(type.flags & 65536 /* Union */)) { + return mapper(type); + } + var types = type.types; + var mappedType; + var mappedTypes; + for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { + var current = types_15[_i]; + var t = mapper(current); + if (t) { + if (!mappedType) { + mappedType = t; + } + else if (!mappedTypes) { + mappedTypes = [mappedType, t]; + } + else { + mappedTypes.push(t); + } + } + } + return mappedTypes ? getUnionType(mappedTypes) : mappedType; } function extractTypesOfKind(type, kind) { return filterType(type, function (t) { return (t.flags & kind) !== 0; }); @@ -32634,7 +35407,7 @@ var ts; // we defer subtype reduction until the evolving array type is finalized into a manifest // array type. function addEvolvingArrayElementType(evolvingArrayType, node) { - var elementType = getBaseTypeOfLiteralType(getTypeOfExpression(node)); + var elementType = getBaseTypeOfLiteralType(getContextFreeTypeOfExpression(node)); return isTypeSubsetOf(elementType, evolvingArrayType.elementType) ? evolvingArrayType : getEvolvingArrayType(getUnionType([evolvingArrayType.elementType, elementType])); } function createFinalArrayType(elementType) { @@ -32656,8 +35429,8 @@ var ts; } function isEvolvingArrayTypeList(types) { var hasEvolvingArrayType = false; - for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { - var t = types_12[_i]; + for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { + var t = types_16[_i]; if (!(t.flags & 8192 /* Never */)) { if (!(getObjectFlags(t) & 256 /* EvolvingArray */)) { return false; @@ -32680,11 +35453,11 @@ var ts; function isEvolvingArrayOperationTarget(node) { var root = getReferenceRoot(node); var parent = root.parent; - var isLengthPushOrUnshift = parent.kind === 177 /* PropertyAccessExpression */ && (parent.name.text === "length" || - parent.parent.kind === 179 /* CallExpression */ && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 178 /* ElementAccessExpression */ && + var isLengthPushOrUnshift = parent.kind === 178 /* PropertyAccessExpression */ && (parent.name.text === "length" || + parent.parent.kind === 180 /* CallExpression */ && ts.isPushOrUnshiftIdentifier(parent.name)); + var isElementAssignment = parent.kind === 179 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 192 /* BinaryExpression */ && + parent.parent.kind === 193 /* BinaryExpression */ && parent.parent.operatorToken.kind === 57 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -32711,14 +35484,12 @@ var ts; } return false; } - function getFlowTypeOfReference(reference, declaredType, assumeInitialized, flowContainer) { + function getFlowTypeOfReference(reference, declaredType, initialType, flowContainer, couldBeUninitialized) { + if (initialType === void 0) { initialType = declaredType; } var key; - if (!reference.flowNode || assumeInitialized && !(declaredType.flags & 1033215 /* Narrowable */)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 17810431 /* Narrowable */)) { return declaredType; } - var initialType = assumeInitialized ? declaredType : - declaredType === autoType || declaredType === autoArrayType ? undefinedType : - includeFalsyTypes(declaredType, 2048 /* Undefined */); var visitedFlowStart = visitedFlowCount; var evolvedType = getTypeFromFlowType(getTypeAtFlowNode(reference.flowNode)); visitedFlowCount = visitedFlowStart; @@ -32727,7 +35498,7 @@ var ts; // on empty arrays are possible without implicit any errors and new element types can be inferred without // type mismatch errors. var resultType = getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? anyArrayType : finalizeEvolvingArrayType(evolvedType); - if (reference.parent.kind === 201 /* NonNullExpression */ && getTypeWithFacts(resultType, 524288 /* NEUndefinedOrNull */).flags & 8192 /* Never */) { + if (reference.parent.kind === 202 /* NonNullExpression */ && getTypeWithFacts(resultType, 524288 /* NEUndefinedOrNull */).flags & 8192 /* Never */) { return declaredType; } return resultType; @@ -32744,7 +35515,19 @@ var ts; } } var type = void 0; - if (flow.flags & 16 /* Assignment */) { + if (flow.flags & 4096 /* AfterFinally */) { + // block flow edge: finally -> pre-try (for larger explanation check comment in binder.ts - bindTryStatement + flow.locked = true; + type = getTypeAtFlowNode(flow.antecedent); + flow.locked = false; + } + else if (flow.flags & 2048 /* PreFinally */) { + // locked pre-finally flows are filtered out in getTypeAtFlowBranchLabel + // so here just redirect to antecedent + flow = flow.antecedent; + continue; + } + else if (flow.flags & 16 /* Assignment */) { type = getTypeAtFlowAssignment(flow); if (!type) { flow = flow.antecedent; @@ -32776,7 +35559,7 @@ var ts; else if (flow.flags & 2 /* Start */) { // Check if we should continue with the control flow of the containing function. var container = flow.container; - if (container && container !== flowContainer && reference.kind !== 177 /* PropertyAccessExpression */) { + if (container && container !== flowContainer && reference.kind !== 178 /* PropertyAccessExpression */ && reference.kind !== 98 /* ThisKeyword */) { flow = container.flowNode; continue; } @@ -32830,7 +35613,7 @@ var ts; } function getTypeAtFlowArrayMutation(flow) { var node = flow.node; - var expr = node.kind === 179 /* CallExpression */ ? + var expr = node.kind === 180 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -32838,7 +35621,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 179 /* CallExpression */) { + if (node.kind === 180 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -32897,6 +35680,12 @@ var ts; var seenIncomplete = false; for (var _i = 0, _a = flow.antecedents; _i < _a.length; _i++) { var antecedent = _a[_i]; + if (antecedent.flags & 2048 /* PreFinally */ && antecedent.lock.locked) { + // if flow correspond to branch from pre-try to finally and this branch is locked - this means that + // we initially have started following the flow outside the finally block. + // in this case we should ignore this branch. + continue; + } var flowType = getTypeAtFlowNode(antecedent); var type = getTypeFromFlowType(flowType); // If the type at a particular antecedent path is the declared type and the @@ -32929,8 +35718,9 @@ var ts; if (!key) { key = getFlowCacheKey(reference); } - if (cache[key]) { - return cache[key]; + var cached = cache.get(key); + if (cached) { + return cached; } // If this flow loop junction and reference are already being processed, return // the union of the types computed for each branch so far, marked as incomplete. @@ -32965,8 +35755,9 @@ var ts; // If we see a value appear in the cache it is a sign that control flow analysis // was restarted and completed by checkExpressionCached. We can simply pick up // the resulting type and bail out. - if (cache[key]) { - return cache[key]; + var cached_1 = cache.get(key); + if (cached_1) { + return cached_1; } if (!ts.contains(antecedentTypes, type)) { antecedentTypes.push(type); @@ -32990,10 +35781,11 @@ var ts; if (isIncomplete(firstAntecedentType)) { return createFlowType(result, /*incomplete*/ true); } - return cache[key] = result; + cache.set(key, result); + return result; } function isMatchingReferenceDiscriminant(expr) { - return expr.kind === 177 /* PropertyAccessExpression */ && + return expr.kind === 178 /* PropertyAccessExpression */ && declaredType.flags & 65536 /* Union */ && isMatchingReference(reference, expr.expression) && isDiscriminantProperty(declaredType, expr.name.text); @@ -33027,10 +35819,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 187 /* TypeOfExpression */ && right_1.kind === 9 /* StringLiteral */) { + if (left_1.kind === 188 /* TypeOfExpression */ && right_1.kind === 9 /* StringLiteral */) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 187 /* TypeOfExpression */ && left_1.kind === 9 /* StringLiteral */) { + if (right_1.kind === 188 /* TypeOfExpression */ && left_1.kind === 9 /* StringLiteral */) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (isMatchingReference(reference, left_1)) { @@ -33076,7 +35868,7 @@ var ts; assumeTrue ? 16384 /* EQUndefined */ : 131072 /* NEUndefined */; return getTypeWithFacts(type, facts); } - if (type.flags & 33281 /* NotUnionOrUnit */) { + if (type.flags & 16810497 /* NotUnionOrUnit */) { return type; } if (assumeTrue) { @@ -33107,14 +35899,22 @@ var ts; // We narrow a non-union type to an exact primitive type if the non-union type // is a supertype of that primitive type. For example, type 'any' can be narrowed // to one of the primitive types. - var targetType = typeofTypesByName[literal.text]; - if (targetType && isTypeSubtypeOf(targetType, type)) { - return targetType; + var targetType = typeofTypesByName.get(literal.text); + if (targetType) { + if (isTypeSubtypeOf(targetType, type)) { + return targetType; + } + if (type.flags & 540672 /* TypeVariable */) { + var constraint = getBaseConstraintOfType(type) || anyType; + if (isTypeSubtypeOf(targetType, constraint)) { + return getIntersectionType([type, targetType]); + } + } } } var facts = assumeTrue ? - typeofEQFacts[literal.text] || 64 /* TypeofEQHostObject */ : - typeofNEFacts[literal.text] || 8192 /* TypeofNEHostObject */; + typeofEQFacts.get(literal.text) || 64 /* TypeofEQHostObject */ : + typeofNEFacts.get(literal.text) || 8192 /* TypeofNEHostObject */; return getTypeWithFacts(type, facts); } function narrowTypeBySwitchOnDiscriminant(type, switchStatement, clauseStart, clauseEnd) { @@ -33197,10 +35997,9 @@ var ts; // Otherwise, if the candidate type is assignable to the target type, narrow to the candidate // type. Otherwise, the types are completely unrelated, so narrow to an intersection of the // two types. - var targetType = type.flags & 16384 /* TypeParameter */ ? getApparentType(type) : type; return isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : - isTypeAssignableTo(candidate, targetType) ? candidate : + isTypeAssignableTo(candidate, type) ? candidate : getIntersectionType([type, candidate]); } function narrowTypeByTypePredicate(type, callExpression, assumeTrue) { @@ -33229,7 +36028,7 @@ var ts; } else { var invokedExpression = ts.skipParentheses(callExpression.expression); - if (invokedExpression.kind === 178 /* ElementAccessExpression */ || invokedExpression.kind === 177 /* PropertyAccessExpression */) { + if (invokedExpression.kind === 179 /* ElementAccessExpression */ || invokedExpression.kind === 178 /* PropertyAccessExpression */) { var accessExpression = invokedExpression; var possibleReference = ts.skipParentheses(accessExpression.expression); if (isMatchingReference(reference, possibleReference)) { @@ -33248,15 +36047,16 @@ var ts; switch (expr.kind) { case 70 /* Identifier */: case 98 /* ThisKeyword */: - case 177 /* PropertyAccessExpression */: + case 96 /* SuperKeyword */: + case 178 /* PropertyAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 179 /* CallExpression */: + case 180 /* CallExpression */: return narrowTypeByTypePredicate(type, expr, assumeTrue); - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 190 /* PrefixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: if (expr.operator === 50 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -33289,15 +36089,12 @@ var ts; return getTypeOfSymbol(symbol); } function getControlFlowContainer(node) { - while (true) { - node = node.parent; - if (ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 231 /* ModuleBlock */ || - node.kind === 261 /* SourceFile */ || - node.kind === 147 /* PropertyDeclaration */) { - return node; - } - } + return ts.findAncestor(node.parent, function (node) { + return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || + node.kind === 233 /* ModuleBlock */ || + node.kind === 264 /* SourceFile */ || + node.kind === 148 /* PropertyDeclaration */; + }); } // Check if a parameter is assigned anywhere within its declaring function. function isParameterAssigned(symbol) { @@ -33312,21 +36109,13 @@ var ts; return symbol.isAssigned || false; } function hasParentWithAssignmentsMarked(node) { - while (true) { - node = node.parent; - if (!node) { - return false; - } - if (ts.isFunctionLike(node) && getNodeLinks(node).flags & 4194304 /* AssignmentsMarked */) { - return true; - } - } + return !!ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !!(getNodeLinks(node).flags & 4194304 /* AssignmentsMarked */); }); } function markParameterAssignments(node) { if (node.kind === 70 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 144 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 145 /* Parameter */) { symbol.isAssigned = true; } } @@ -33338,6 +36127,15 @@ var ts; function isConstVariable(symbol) { return symbol.flags & 3 /* Variable */ && (getDeclarationNodeFlagsFromSymbol(symbol) & 2 /* Const */) !== 0 && getTypeOfSymbol(symbol) !== autoArrayType; } + /** remove undefined from the annotated type of a parameter when there is an initializer (that doesn't include undefined) */ + function removeOptionalityFromDeclaredType(declaredType, declaration) { + var annotationIncludesUndefined = strictNullChecks && + declaration.kind === 145 /* Parameter */ && + declaration.initializer && + getFalsyFlags(declaredType) & 2048 /* Undefined */ && + !(getFalsyFlags(checkExpression(declaration.initializer)) & 2048 /* Undefined */); + return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 131072 /* NEUndefined */) : declaredType; + } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); if (symbol === unknownSymbol) { @@ -33352,16 +36150,14 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 185 /* ArrowFunction */) { + if (container.kind === 186 /* ArrowFunction */) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasModifier(container, 256 /* Async */)) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method); } } - if (node.flags & 524288 /* AwaitContext */) { - getNodeLinks(container).flags |= 8192 /* CaptureArguments */; - } + getNodeLinks(container).flags |= 8192 /* CaptureArguments */; return getTypeOfSymbol(symbol); } if (symbol.flags & 8388608 /* Alias */ && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { @@ -33373,7 +36169,7 @@ var ts; // Due to the emit for class decorators, any reference to the class from inside of the class body // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind // behavior of class names in ES6. - if (declaration_1.kind === 226 /* ClassDeclaration */ + if (declaration_1.kind === 228 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration_1)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -33385,14 +36181,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration_1.kind === 197 /* ClassExpression */) { + else if (declaration_1.kind === 198 /* ClassExpression */) { // When we emit a class expression with static members that contain a reference // to the constructor in the initializer, we will need to substitute that // binding with an alias as the class name is not in scope. var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); while (container !== undefined) { if (container.parent === declaration_1) { - if (container.kind === 147 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { + if (container.kind === 148 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { getNodeLinks(declaration_1).flags |= 8388608 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 16777216 /* ConstructorReferenceInClass */; } @@ -33404,6 +36200,7 @@ var ts; } checkCollisionWithCapturedSuperVariable(node, node); checkCollisionWithCapturedThisVariable(node, node); + checkCollisionWithCapturedNewTargetVariable(node, node); checkNestedBlockScopedBinding(node, symbol); var type = getTypeOfSymbol(localOrExportSymbol); var declaration = localOrExportSymbol.valueDeclaration; @@ -33426,15 +36223,15 @@ var ts; // The declaration container is the innermost function that encloses the declaration of the variable // or parameter. The flow container is the innermost function starting with which we analyze the control // flow graph to determine the control flow based type. - var isParameter = ts.getRootDeclaration(declaration).kind === 144 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 145 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. - while (flowContainer !== declarationContainer && (flowContainer.kind === 184 /* FunctionExpression */ || - flowContainer.kind === 185 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 185 /* FunctionExpression */ || + flowContainer.kind === 186 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } @@ -33442,15 +36239,18 @@ var ts; // the entire control flow graph from the variable's declaration (i.e. when the flow container and // declaration container are the same). var assumeInitialized = isParameter || isOuterVariable || - type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1 /* Any */) !== 0) || + type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1 /* Any */) !== 0 || isInTypeQuery(node)) || ts.isInAmbientContext(declaration); - var flowType = getFlowTypeOfReference(node, type, assumeInitialized, flowContainer); + var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, ts.getRootDeclaration(declaration)) : type) : + type === autoType || type === autoArrayType ? undefinedType : + includeFalsyTypes(type, 2048 /* Undefined */); + var flowType = getFlowTypeOfReference(node, type, initialType, flowContainer, !assumeInitialized); // A variable is considered uninitialized when it is possible to analyze the entire control flow graph // from declaration to use, and when the variable's declared type doesn't include undefined but the // control flow based type does include undefined. if (type === autoType || type === autoArrayType) { if (flowType === autoType || flowType === autoArrayType) { - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { error(declaration.name, ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined, symbolToString(symbol), typeToString(flowType)); error(node, ts.Diagnostics.Variable_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType)); } @@ -33465,19 +36265,12 @@ var ts; return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType; } function isInsideFunction(node, threshold) { - var current = node; - while (current && current !== threshold) { - if (ts.isFunctionLike(current)) { - return true; - } - current = current.parent; - } - return false; + return !!ts.findAncestor(node, function (n) { return n === threshold ? "quit" : ts.isFunctionLike(n); }); } function checkNestedBlockScopedBinding(node, symbol) { if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || - symbol.valueDeclaration.parent.kind === 256 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 259 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -33502,8 +36295,8 @@ var ts; } // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement. // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back. - if (container.kind === 211 /* ForStatement */ && - ts.getAncestor(symbol.valueDeclaration, 224 /* VariableDeclarationList */).parent === container && + if (container.kind === 213 /* ForStatement */ && + ts.getAncestor(symbol.valueDeclaration, 226 /* VariableDeclarationList */).parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 2097152 /* NeedsLoopOutParameter */; } @@ -33515,9 +36308,9 @@ var ts; } } function isAssignedInBodyOfForStatement(node, container) { - var current = node; // skip parenthesized nodes - while (current.parent.kind === 183 /* ParenthesizedExpression */) { + var current = node; + while (current.parent.kind === 184 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -33525,7 +36318,7 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 190 /* PrefixUnaryExpression */ || current.parent.kind === 191 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 191 /* PrefixUnaryExpression */ || current.parent.kind === 192 /* PostfixUnaryExpression */)) { var expr = current.parent; isAssigned = expr.operator === 42 /* PlusPlusToken */ || expr.operator === 43 /* MinusMinusToken */; } @@ -33534,19 +36327,11 @@ var ts; } // at this point we know that node is the target of assignment // now check that modification happens inside the statement part of the ForStatement - while (current !== container) { - if (current === container.statement) { - return true; - } - else { - current = current.parent; - } - } - return false; + return !!ts.findAncestor(current, function (n) { return n === container ? "quit" : n === container.statement; }); } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 147 /* PropertyDeclaration */ || container.kind === 150 /* Constructor */) { + if (container.kind === 148 /* PropertyDeclaration */ || container.kind === 151 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -33589,58 +36374,63 @@ var ts; var baseConstructorType = getBaseConstructorTypeOfClass(classInstanceType); return baseConstructorType === nullWideningType; } + function checkThisBeforeSuper(node, container, diagnosticMessage) { + var containingClassDecl = container.parent; + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(containingClassDecl); + // If a containing class does not have extends clause or the class extends null + // skip checking whether super statement is called before "this" accessing. + if (baseTypeNode && !classDeclarationExtendsNull(containingClassDecl)) { + var superCall = getSuperCallInConstructor(container); + // We should give an error in the following cases: + // - No super-call + // - "this" is accessing before super-call. + // i.e super(this) + // this.x; super(); + // We want to make sure that super-call is done before accessing "this" so that + // "this" is not accessed as a parameter of the super-call. + if (!superCall || superCall.end > node.pos) { + // In ES6, super inside constructor of class-declaration has to precede "this" accessing + error(node, diagnosticMessage); + } + } + } function checkThisExpression(node) { // Stop at the first arrow function so that we can // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var needToCaptureLexicalThis = false; - if (container.kind === 150 /* Constructor */) { - var containingClassDecl = container.parent; - var baseTypeNode = ts.getClassExtendsHeritageClauseElement(containingClassDecl); - // If a containing class does not have extends clause or the class extends null - // skip checking whether super statement is called before "this" accessing. - if (baseTypeNode && !classDeclarationExtendsNull(containingClassDecl)) { - var superCall = getSuperCallInConstructor(container); - // We should give an error in the following cases: - // - No super-call - // - "this" is accessing before super-call. - // i.e super(this) - // this.x; super(); - // We want to make sure that super-call is done before accessing "this" so that - // "this" is not accessed as a parameter of the super-call. - if (!superCall || superCall.end > node.pos) { - // In ES6, super inside constructor of class-declaration has to precede "this" accessing - error(node, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); - } - } + if (container.kind === 151 /* Constructor */) { + checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 185 /* ArrowFunction */) { + if (container.kind === 186 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); // When targeting es6, arrow function lexically bind "this" so we do not need to do the work of binding "this" in emitted code needToCaptureLexicalThis = (languageVersion < 2 /* ES2015 */); } switch (container.kind) { - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 150 /* Constructor */: + case 151 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); + // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: if (ts.getModifierFlags(container) & 32 /* Static */) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); + // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 142 /* ComputedPropertyName */: + case 143 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -33652,8 +36442,8 @@ var ts; // Note: a parameter initializer should refer to class-this unless function-this is explicitly annotated. // If this is a function in a JS file, it might be a class method. Check if it's the RHS // of a x.prototype.y = function [name]() { .... } - if (container.kind === 184 /* FunctionExpression */ && - ts.isInJavaScriptFile(container.parent) && + if (container.kind === 185 /* FunctionExpression */ && + container.parent.kind === 193 /* BinaryExpression */ && ts.getSpecialPropertyAssignmentKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = f' (here, 'f' is 'container') var className = container.parent // x.prototype.y = f @@ -33673,7 +36463,7 @@ var ts; if (ts.isClassLike(container.parent)) { var symbol = getSymbolOfNode(container.parent); var type = ts.hasModifier(container, 32 /* Static */) ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType; - return getFlowTypeOfReference(node, type, /*assumeInitialized*/ true, /*flowContainer*/ undefined); + return getFlowTypeOfReference(node, type); } if (ts.isInJavaScriptFile(node)) { var type = getTypeForThisExpressionFromJSDoc(container); @@ -33681,7 +36471,7 @@ var ts; return type; } } - if (compilerOptions.noImplicitThis) { + if (noImplicitThis) { // With noImplicitThis, functions may not reference 'this' if it has type 'any' error(node, ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation); } @@ -33689,28 +36479,23 @@ var ts; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 274 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 278 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; - if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].type.kind === 277 /* JSDocThisType */) { + if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].type.kind === 281 /* JSDocThisType */) { return getTypeFromTypeNode(jsDocFunctionType.parameters[0].type); } } } function isInConstructorArgumentInitializer(node, constructorDecl) { - for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 144 /* Parameter */) { - return true; - } - } - return false; + return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 145 /* Parameter */; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 179 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 180 /* CallExpression */ && node.parent.expression === node; var container = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var needToCaptureLexicalThis = false; // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting if (!isCallExpression) { - while (container && container.kind === 185 /* ArrowFunction */) { + while (container && container.kind === 186 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -33723,17 +36508,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = node; - while (current && current !== container && current.kind !== 142 /* ComputedPropertyName */) { - current = current.parent; - } - if (current && current.kind === 142 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 143 /* ComputedPropertyName */; }); + if (current && current.kind === 143 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 176 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 177 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -33741,6 +36523,9 @@ var ts; } return unknownType; } + if (!isCallExpression && container.kind === 151 /* Constructor */) { + checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); + } if ((ts.getModifierFlags(container) & 32 /* Static */) || isCallExpression) { nodeCheckFlag = 512 /* SuperStatic */; } @@ -33804,7 +36589,7 @@ var ts; // This helper creates an object with a "value" property that wraps the `super` property or indexed access for both get and set. // This is required for destructuring assignments, as a call expression cannot be used as the target of a destructuring assignment // while a property access can. - if (container.kind === 149 /* MethodDeclaration */ && ts.getModifierFlags(container) & 256 /* Async */) { + if (container.kind === 150 /* MethodDeclaration */ && ts.getModifierFlags(container) & 256 /* Async */) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -33818,7 +36603,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 176 /* ObjectLiteralExpression */) { + if (container.parent.kind === 177 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return unknownType; @@ -33838,7 +36623,7 @@ var ts; } return unknownType; } - if (container.kind === 150 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 151 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return unknownType; @@ -33853,7 +36638,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 150 /* Constructor */; + return container.kind === 151 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -33861,29 +36646,47 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 176 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 177 /* ObjectLiteralExpression */) { if (ts.getModifierFlags(container) & 32 /* Static */) { - return container.kind === 149 /* MethodDeclaration */ || - container.kind === 148 /* MethodSignature */ || - container.kind === 151 /* GetAccessor */ || - container.kind === 152 /* SetAccessor */; + return container.kind === 150 /* MethodDeclaration */ || + container.kind === 149 /* MethodSignature */ || + container.kind === 152 /* GetAccessor */ || + container.kind === 153 /* SetAccessor */; } else { - return container.kind === 149 /* MethodDeclaration */ || - container.kind === 148 /* MethodSignature */ || - container.kind === 151 /* GetAccessor */ || - container.kind === 152 /* SetAccessor */ || - container.kind === 147 /* PropertyDeclaration */ || - container.kind === 146 /* PropertySignature */ || - container.kind === 150 /* Constructor */; + return container.kind === 150 /* MethodDeclaration */ || + container.kind === 149 /* MethodSignature */ || + container.kind === 152 /* GetAccessor */ || + container.kind === 153 /* SetAccessor */ || + container.kind === 148 /* PropertyDeclaration */ || + container.kind === 147 /* PropertySignature */ || + container.kind === 151 /* Constructor */; } } } return false; } } + function getContainingObjectLiteral(func) { + return (func.kind === 150 /* MethodDeclaration */ || + func.kind === 152 /* GetAccessor */ || + func.kind === 153 /* SetAccessor */) && func.parent.kind === 177 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 185 /* FunctionExpression */ && func.parent.kind === 260 /* PropertyAssignment */ ? func.parent.parent : + undefined; + } + function getThisTypeArgument(type) { + return getObjectFlags(type) & 4 /* Reference */ && type.target === globalThisType ? type.typeArguments[0] : undefined; + } + function getThisTypeFromContextualType(type) { + return mapType(type, function (t) { + return t.flags & 131072 /* Intersection */ ? ts.forEach(t.types, getThisTypeArgument) : getThisTypeArgument(t); + }); + } function getContextualThisParameterType(func) { - if (isContextSensitiveFunctionOrObjectLiteralMethod(func) && func.kind !== 185 /* ArrowFunction */) { + if (func.kind === 186 /* ArrowFunction */) { + return undefined; + } + if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { var contextualSignature = getContextualSignature(func); if (contextualSignature) { var thisParameter = contextualSignature.thisParameter; @@ -33892,6 +36695,40 @@ var ts; } } } + if (noImplicitThis) { + var containingLiteral = getContainingObjectLiteral(func); + if (containingLiteral) { + // We have an object literal method. Check if the containing object literal has a contextual type + // that includes a ThisType. If so, T is the contextual type for 'this'. We continue looking in + // any directly enclosing object literals. + var contextualType = getApparentTypeOfContextualType(containingLiteral); + var literal = containingLiteral; + var type = contextualType; + while (type) { + var thisType = getThisTypeFromContextualType(type); + if (thisType) { + return instantiateType(thisType, getContextualMapper(containingLiteral)); + } + if (literal.parent.kind !== 260 /* PropertyAssignment */) { + break; + } + literal = literal.parent.parent; + type = getApparentTypeOfContextualType(literal); + } + // There was no contextual ThisType for the containing object literal, so the contextual type + // for 'this' is the non-null form of the contextual type for the containing object literal or + // the type of the object literal itself. + return contextualType ? getNonNullableType(contextualType) : checkExpressionCached(containingLiteral); + } + // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the + // contextual type for 'this' is 'obj'. + if (func.parent.kind === 193 /* BinaryExpression */ && func.parent.operatorToken.kind === 57 /* EqualsToken */) { + var target = func.parent.left; + if (target.kind === 178 /* PropertyAccessExpression */ || target.kind === 179 /* ElementAccessExpression */) { + return checkExpressionCached(target.expression); + } + } + } return undefined; } // Return contextual type of parameter or undefined if no contextual type is available @@ -33899,23 +36736,23 @@ var ts; var func = parameter.parent; if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { var iife = ts.getImmediatelyInvokedFunctionExpression(func); - if (iife) { + if (iife && iife.arguments) { var indexOfParameter = ts.indexOf(func.parameters, parameter); - if (iife.arguments && indexOfParameter < iife.arguments.length) { - if (parameter.dotDotDotToken) { - var restTypes = []; - for (var i = indexOfParameter; i < iife.arguments.length; i++) { - restTypes.push(getWidenedLiteralType(checkExpression(iife.arguments[i]))); - } - return createArrayType(getUnionType(restTypes)); + if (parameter.dotDotDotToken) { + var restTypes = []; + for (var i = indexOfParameter; i < iife.arguments.length; i++) { + restTypes.push(getWidenedLiteralType(checkExpression(iife.arguments[i]))); } - var links = getNodeLinks(iife); - var cached = links.resolvedSignature; - links.resolvedSignature = anySignature; - var type = getWidenedLiteralType(checkExpression(iife.arguments[indexOfParameter])); - links.resolvedSignature = cached; - return type; + return restTypes.length ? createArrayType(getUnionType(restTypes)) : undefined; } + var links = getNodeLinks(iife); + var cached = links.resolvedSignature; + links.resolvedSignature = anySignature; + var type = indexOfParameter < iife.arguments.length ? + getWidenedLiteralType(checkExpression(iife.arguments[indexOfParameter])) : + parameter.initializer ? undefined : undefinedWideningType; + links.resolvedSignature = cached; + return type; } var contextualSignature = getContextualSignature(func); if (contextualSignature) { @@ -33949,7 +36786,7 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 144 /* Parameter */) { + if (declaration.kind === 145 /* Parameter */) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -33960,11 +36797,11 @@ var ts; } if (ts.isBindingPattern(declaration.parent)) { var parentDeclaration = declaration.parent.parent; - var name_19 = declaration.propertyName || declaration.name; - if (ts.isVariableLike(parentDeclaration) && + var name = declaration.propertyName || declaration.name; + if (parentDeclaration.kind !== 175 /* BindingElement */ && parentDeclaration.type && - !ts.isBindingPattern(name_19)) { - var text = ts.getTextOfPropertyName(name_19); + !ts.isBindingPattern(name)) { + var text = ts.getTextOfPropertyName(name); if (text) { return getTypeOfPropertyOfType(getTypeFromTypeNode(parentDeclaration.type), text); } @@ -33975,33 +36812,34 @@ var ts; } function getContextualTypeForReturnExpression(node) { var func = ts.getContainingFunction(node); - if (ts.isAsyncFunctionLike(func)) { - var contextualReturnType = getContextualReturnType(func); - if (contextualReturnType) { - return getPromisedType(contextualReturnType); + if (func) { + var functionFlags = ts.getFunctionFlags(func); + if (functionFlags & 1 /* Generator */) { + return undefined; } - return undefined; - } - if (func && !func.asteriskToken) { - return getContextualReturnType(func); + var contextualReturnType = getContextualReturnType(func); + return functionFlags & 2 /* Async */ + ? contextualReturnType && getAwaitedTypeOfPromise(contextualReturnType) // Async function + : contextualReturnType; // Regular function } return undefined; } function getContextualTypeForYieldOperand(node) { var func = ts.getContainingFunction(node); if (func) { + var functionFlags = ts.getFunctionFlags(func); var contextualReturnType = getContextualReturnType(func); if (contextualReturnType) { return node.asteriskToken ? contextualReturnType - : getElementTypeOfIterableIterator(contextualReturnType); + : getIteratedTypeOfGenerator(contextualReturnType, (functionFlags & 2 /* Async */) !== 0); } } return undefined; } function isInParameterInitializerBeforeContainingFunction(node) { while (node.parent && !ts.isFunctionLike(node.parent)) { - if (node.parent.kind === 144 /* Parameter */ && node.parent.initializer === node) { + if (node.parent.kind === 145 /* Parameter */ && node.parent.initializer === node) { return true; } node = node.parent; @@ -34012,8 +36850,8 @@ var ts; // If the containing function has a return type annotation, is a constructor, or is a get accessor whose // corresponding set accessor has a type annotation, return statements in the function are contextually typed if (functionDecl.type || - functionDecl.kind === 150 /* Constructor */ || - functionDecl.kind === 151 /* GetAccessor */ && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 152 /* SetAccessor */))) { + functionDecl.kind === 151 /* Constructor */ || + functionDecl.kind === 152 /* GetAccessor */ && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 153 /* SetAccessor */))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl)); } // Otherwise, if the containing function is contextually typed by a function type with exactly one call signature @@ -34035,7 +36873,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 181 /* TaggedTemplateExpression */) { + if (template.parent.kind === 182 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -34069,41 +36907,14 @@ var ts; } return undefined; } - // Apply a mapping function to a contextual type and return the resulting type. If the contextual type - // is a union type, the mapping function is applied to each constituent type and a union of the resulting - // types is returned. - function applyToContextualType(type, mapper) { - if (!(type.flags & 65536 /* Union */)) { - return mapper(type); - } - var types = type.types; - var mappedType; - var mappedTypes; - for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { - var current = types_13[_i]; - var t = mapper(current); - if (t) { - if (!mappedType) { - mappedType = t; - } - else if (!mappedTypes) { - mappedTypes = [mappedType, t]; - } - else { - mappedTypes.push(t); - } - } - } - return mappedTypes ? getUnionType(mappedTypes) : mappedType; - } function getTypeOfPropertyOfContextualType(type, name) { - return applyToContextualType(type, function (t) { + return mapType(type, function (t) { var prop = t.flags & 229376 /* StructuredType */ ? getPropertyOfType(t, name) : undefined; return prop ? getTypeOfSymbol(prop) : undefined; }); } function getIndexTypeOfContextualType(type, kind) { - return applyToContextualType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }); + return mapType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }); } // Return true if the given contextual type is a tuple-like type function contextualTypeIsTupleLikeType(type) { @@ -34150,7 +36961,7 @@ var ts; var index = ts.indexOf(arrayLiteral.elements, node); return getTypeOfPropertyOfContextualType(type, "" + index) || getIndexTypeOfContextualType(type, 1 /* Number */) - || (languageVersion >= 2 /* ES2015 */ ? getElementTypeOfIterable(type, /*errorNode*/ undefined) : undefined); + || getIteratedTypeOrElementType(type, /*errorNode*/ undefined, /*allowStringInput*/ false, /*allowAsyncIterable*/ false, /*checkAssignability*/ false); } return undefined; } @@ -34160,19 +36971,19 @@ var ts; return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; } function getContextualTypeForJsxAttribute(attribute) { - var kind = attribute.kind; - var jsxElement = attribute.parent; - var attrsType = getJsxElementAttributesType(jsxElement); - if (attribute.kind === 250 /* JsxAttribute */) { - if (!attrsType || isTypeAny(attrsType)) { + // When we trying to resolve JsxOpeningLikeElement as a stateless function element, we will already give its attributes a contextual type + // which is a type of the parameter of the signature we are trying out. + // If there is no contextual type (e.g. we are trying to resolve stateful component), get attributes type from resolving element's tagName + var attributesType = getContextualType(attribute.parent); + if (ts.isJsxAttribute(attribute)) { + if (!attributesType || isTypeAny(attributesType)) { return undefined; } - return getTypeOfPropertyOfType(attrsType, attribute.name.text); + return getTypeOfPropertyOfType(attributesType, attribute.name.text); } - else if (attribute.kind === 251 /* JsxSpreadAttribute */) { - return attrsType; + else { + return attributesType; } - ts.Debug.fail("Expected JsxAttribute or JsxSpreadAttribute, got ts.SyntaxKind[" + kind + "]"); } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily // be "pushed" onto a node using the contextualType property. @@ -34207,45 +37018,52 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 223 /* VariableDeclaration */: - case 144 /* Parameter */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 174 /* BindingElement */: + case 225 /* VariableDeclaration */: + case 145 /* Parameter */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 175 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 185 /* ArrowFunction */: - case 216 /* ReturnStatement */: + case 186 /* ArrowFunction */: + case 218 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 195 /* YieldExpression */: + case 196 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 179 /* CallExpression */: - case 180 /* NewExpression */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 182 /* TypeAssertionExpression */: - case 200 /* AsExpression */: + case 183 /* TypeAssertionExpression */: + case 201 /* AsExpression */: return getTypeFromTypeNode(parent.type); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 257 /* PropertyAssignment */: - case 258 /* ShorthandPropertyAssignment */: + case 260 /* PropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent); - case 175 /* ArrayLiteralExpression */: + case 176 /* ArrayLiteralExpression */: return getContextualTypeForElementExpression(node); - case 193 /* ConditionalExpression */: + case 194 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); - case 202 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 194 /* TemplateExpression */); + case 204 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 195 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return getContextualType(parent); - case 252 /* JsxExpression */: + case 255 /* JsxExpression */: return getContextualType(parent); - case 250 /* JsxAttribute */: - case 251 /* JsxSpreadAttribute */: + case 252 /* JsxAttribute */: + case 254 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); + case 250 /* JsxOpeningElement */: + case 249 /* JsxSelfClosingElement */: + return getAttributesTypeFromJsxOpeningLikeElement(parent); } return undefined; } + function getContextualMapper(node) { + node = ts.findAncestor(node, function (n) { return !!n.contextualMapper; }); + return node ? node.contextualMapper : identityMapper; + } // If the given type is an object or union type, if that type has a single signature, and if // that signature is non-generic, return the signature. Otherwise return undefined. function getNonGenericSignature(type, node) { @@ -34273,7 +37091,7 @@ var ts; return sourceLength < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 184 /* FunctionExpression */ || node.kind === 185 /* ArrowFunction */; + return node.kind === 185 /* FunctionExpression */ || node.kind === 186 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -34292,7 +37110,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 149 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 150 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var type = getContextualTypeForFunctionLikeDeclaration(node); if (!type) { return undefined; @@ -34302,8 +37120,8 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { - var current = types_14[_i]; + for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { + var current = types_17[_i]; var signature = getNonGenericSignature(current, node); if (signature) { if (!signatureList) { @@ -34330,46 +37148,25 @@ var ts; } return result; } - /** - * Detect if the mapper implies an inference context. Specifically, there are 4 possible values - * for a mapper. Let's go through each one of them: - * - * 1. undefined - this means we are not doing inferential typing, but we may do contextual typing, - * which could cause us to assign a parameter a type - * 2. identityMapper - means we want to avoid assigning a parameter a type, whether or not we are in - * inferential typing (context is undefined for the identityMapper) - * 3. a mapper created by createInferenceMapper - we are doing inferential typing, we want to assign - * types to parameters and fix type parameters (context is defined) - * 4. an instantiation mapper created by createTypeMapper or createTypeEraser - this should never be - * passed as the contextual mapper when checking an expression (context is undefined for these) - * - * isInferentialContext is detecting if we are in case 3 - */ - function isInferentialContext(mapper) { - return mapper && mapper.context; - } - function checkSpreadExpression(node, contextualMapper) { - // It is usually not safe to call checkExpressionCached if we can be contextually typing. - // You can tell that we are contextually typing because of the contextualMapper parameter. - // While it is true that a spread element can have a contextual type, it does not do anything - // with this type. It is neither affected by it, nor does it propagate it to its operand. - // So the fact that contextualMapper is passed is not important, because the operand of a spread - // element is not contextually typed. - var arrayOrIterableType = checkExpressionCached(node.expression, contextualMapper); - return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, /*allowStringInput*/ false); + function checkSpreadExpression(node, checkMode) { + if (languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 1536 /* SpreadIncludes */); + } + var arrayOrIterableType = checkExpression(node.expression, checkMode); + return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, /*allowStringInput*/ false, /*allowAsyncIterable*/ false); } function hasDefaultValue(node) { - return (node.kind === 174 /* BindingElement */ && !!node.initializer) || - (node.kind === 192 /* BinaryExpression */ && node.operatorToken.kind === 57 /* EqualsToken */); + return (node.kind === 175 /* BindingElement */ && !!node.initializer) || + (node.kind === 193 /* BinaryExpression */ && node.operatorToken.kind === 57 /* EqualsToken */); } - function checkArrayLiteral(node, contextualMapper) { + function checkArrayLiteral(node, checkMode) { var elements = node.elements; var hasSpreadElement = false; var elementTypes = []; var inDestructuringPattern = ts.isAssignmentTarget(node); for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) { var e = elements_1[_i]; - if (inDestructuringPattern && e.kind === 196 /* SpreadElement */) { + if (inDestructuringPattern && e.kind === 197 /* SpreadElement */) { // Given the following situation: // var c: {}; // [...c] = ["", 0]; @@ -34382,18 +37179,18 @@ var ts; // get the contextual element type from it. So we do something similar to // getContextualTypeForElementExpression, which will crucially not error // if there is no index type / iterated type. - var restArrayType = checkExpression(e.expression, contextualMapper); + var restArrayType = checkExpression(e.expression, checkMode); var restElementType = getIndexTypeOfType(restArrayType, 1 /* Number */) || - (languageVersion >= 2 /* ES2015 */ ? getElementTypeOfIterable(restArrayType, /*errorNode*/ undefined) : undefined); + getIteratedTypeOrElementType(restArrayType, /*errorNode*/ undefined, /*allowStringInput*/ false, /*allowAsyncIterable*/ false, /*checkAssignability*/ false); if (restElementType) { elementTypes.push(restElementType); } } else { - var type = checkExpressionForMutableLocation(e, contextualMapper); + var type = checkExpressionForMutableLocation(e, checkMode); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 196 /* SpreadElement */; + hasSpreadElement = hasSpreadElement || e.kind === 197 /* SpreadElement */; } if (!hasSpreadElement) { // If array literal is actually a destructuring pattern, mark it as an implied type. We do this such @@ -34408,7 +37205,7 @@ var ts; var pattern = contextualType.pattern; // If array literal is contextually typed by a binding pattern or an assignment pattern, pad the resulting // tuple type with the corresponding binding or assignment element types to make the lengths equal. - if (pattern && (pattern.kind === 173 /* ArrayBindingPattern */ || pattern.kind === 175 /* ArrayLiteralExpression */)) { + if (pattern && (pattern.kind === 174 /* ArrayBindingPattern */ || pattern.kind === 176 /* ArrayLiteralExpression */)) { var patternElements = pattern.elements; for (var i = elementTypes.length; i < patternElements.length; i++) { var patternElement = patternElements[i]; @@ -34416,7 +37213,7 @@ var ts; elementTypes.push(contextualType.typeArguments[i]); } else { - if (patternElement.kind !== 198 /* OmittedExpression */) { + if (patternElement.kind !== 199 /* OmittedExpression */) { error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } elementTypes.push(unknownType); @@ -34433,7 +37230,7 @@ var ts; strictNullChecks ? neverType : undefinedWideningType); } function isNumericName(name) { - return name.kind === 142 /* ComputedPropertyName */ ? isNumericComputedName(name) : isNumericLiteralName(name.text); + return name.kind === 143 /* ComputedPropertyName */ ? isNumericComputedName(name) : isNumericLiteralName(name.text); } function isNumericComputedName(name) { // It seems odd to consider an expression of type Any to result in a numeric name, @@ -34495,7 +37292,7 @@ var ts; var unionType = propTypes.length ? getUnionType(propTypes, /*subtypeReduction*/ true) : undefinedType; return createIndexInfo(unionType, /*isReadonly*/ false); } - function checkObjectLiteral(node, contextualMapper) { + function checkObjectLiteral(node, checkMode) { var inDestructuringPattern = ts.isAssignmentTarget(node); // Grammar checking checkGrammarObjectLiteralExpression(node, inDestructuringPattern); @@ -34505,7 +37302,8 @@ var ts; var propagatedFlags = 0; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 172 /* ObjectBindingPattern */ || contextualType.pattern.kind === 176 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 173 /* ObjectBindingPattern */ || contextualType.pattern.kind === 177 /* ObjectLiteralExpression */); + var isJSObjectLiteral = !contextualType && ts.isInJavaScriptFile(node); var typeFlags = 0; var patternWithComputedProperties = false; var hasComputedStringProperty = false; @@ -34514,29 +37312,29 @@ var ts; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = memberDecl.symbol; - if (memberDecl.kind === 257 /* PropertyAssignment */ || - memberDecl.kind === 258 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 260 /* PropertyAssignment */ || + memberDecl.kind === 261 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 257 /* PropertyAssignment */) { - type = checkPropertyAssignment(memberDecl, contextualMapper); + if (memberDecl.kind === 260 /* PropertyAssignment */) { + type = checkPropertyAssignment(memberDecl, checkMode); } - else if (memberDecl.kind === 149 /* MethodDeclaration */) { - type = checkObjectLiteralMethod(memberDecl, contextualMapper); + else if (memberDecl.kind === 150 /* MethodDeclaration */) { + type = checkObjectLiteralMethod(memberDecl, checkMode); } else { - ts.Debug.assert(memberDecl.kind === 258 /* ShorthandPropertyAssignment */); - type = checkExpressionForMutableLocation(memberDecl.name, contextualMapper); + ts.Debug.assert(memberDecl.kind === 261 /* ShorthandPropertyAssignment */); + type = checkExpressionForMutableLocation(memberDecl.name, checkMode); } typeFlags |= type.flags; - var prop = createSymbol(4 /* Property */ | 67108864 /* Transient */ | member.flags, member.name); + var prop = createSymbol(4 /* Property */ | member.flags, member.name); if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 257 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 258 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 260 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 261 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { - prop.flags |= 536870912 /* Optional */; + prop.flags |= 67108864 /* Optional */; } if (ts.hasDynamicName(memberDecl)) { patternWithComputedProperties = true; @@ -34547,9 +37345,9 @@ var ts; // binding pattern specifies a default value for the property, make the property optional. var impliedProp = getPropertyOfType(contextualType, member.name); if (impliedProp) { - prop.flags |= impliedProp.flags & 536870912 /* Optional */; + prop.flags |= impliedProp.flags & 67108864 /* Optional */; } - else if (!compilerOptions.suppressExcessPropertyErrors) { + else if (!compilerOptions.suppressExcessPropertyErrors && !getIndexInfoOfType(contextualType, 0 /* String */)) { error(memberDecl.name, ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(member), typeToString(contextualType)); } } @@ -34562,9 +37360,12 @@ var ts; prop.target = member; member = prop; } - else if (memberDecl.kind === 259 /* SpreadAssignment */) { + else if (memberDecl.kind === 262 /* SpreadAssignment */) { + if (languageVersion < 2 /* ES2015 */) { + checkExternalEmitHelpers(memberDecl, 2 /* Assign */); + } if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), /*isFromObjectLiteral*/ true); + spread = getSpreadType(spread, createObjectLiteralType()); propertiesArray = []; propertiesTable = ts.createMap(); hasComputedStringProperty = false; @@ -34572,11 +37373,11 @@ var ts; typeFlags = 0; } var type = checkExpression(memberDecl.expression); - if (!(type.flags & (32768 /* Object */ | 1 /* Any */))) { + if (!isValidSpreadType(type)) { error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); return unknownType; } - spread = getSpreadType(spread, type, /*isFromObjectLiteral*/ false); + spread = getSpreadType(spread, type); offset = i + 1; continue; } @@ -34586,8 +37387,8 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 151 /* GetAccessor */ || memberDecl.kind === 152 /* SetAccessor */); - checkAccessorDeclaration(memberDecl); + ts.Debug.assert(memberDecl.kind === 152 /* GetAccessor */ || memberDecl.kind === 153 /* SetAccessor */); + checkNodeDeferred(memberDecl); } if (ts.hasDynamicName(memberDecl)) { if (isNumericName(memberDecl.name)) { @@ -34598,7 +37399,7 @@ var ts; } } else { - propertiesTable[member.name] = member; + propertiesTable.set(member.name, member); } propertiesArray.push(member); } @@ -34607,27 +37408,30 @@ var ts; if (contextualTypeHasPattern) { for (var _i = 0, _a = getPropertiesOfType(contextualType); _i < _a.length; _i++) { var prop = _a[_i]; - if (!propertiesTable[prop.name]) { - if (!(prop.flags & 536870912 /* Optional */)) { + if (!propertiesTable.get(prop.name)) { + if (!(prop.flags & 67108864 /* Optional */)) { error(prop.valueDeclaration || prop.bindingElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } - propertiesTable[prop.name] = prop; + propertiesTable.set(prop.name, prop); propertiesArray.push(prop); } } } if (spread !== emptyObjectType) { if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), /*isFromObjectLiteral*/ true); + spread = getSpreadType(spread, createObjectLiteralType()); + } + if (spread.flags & 32768 /* Object */) { + // only set the symbol and flags if this is a (fresh) object type + spread.flags |= propagatedFlags; + spread.symbol = node.symbol; } - spread.flags |= propagatedFlags; - spread.symbol = node.symbol; return spread; } return createObjectLiteralType(); function createObjectLiteralType() { - var stringIndexInfo = hasComputedStringProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 0 /* String */) : undefined; - var numberIndexInfo = hasComputedNumberProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 1 /* Number */) : undefined; + var stringIndexInfo = isJSObjectLiteral ? jsObjectLiteralIndexInfo : hasComputedStringProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 0 /* String */) : undefined; + var numberIndexInfo = hasComputedNumberProperty && !isJSObjectLiteral ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 1 /* Number */) : undefined; var result = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo); var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 1048576 /* FreshLiteral */; result.flags |= 4194304 /* ContainsObjectLiteral */ | freshObjectLiteralFlag | (typeFlags & 14680064 /* PropagatingFlags */); @@ -34644,9 +37448,14 @@ var ts; return result; } } + function isValidSpreadType(type) { + return !!(type.flags & (1 /* Any */ | 4096 /* Null */ | 2048 /* Undefined */ | 16777216 /* NonPrimitive */) || + type.flags & 32768 /* Object */ && !isGenericMappedType(type) || + type.flags & 196608 /* UnionOrIntersection */ && !ts.forEach(type.types, function (t) { return !isValidSpreadType(t); })); + } function checkJsxSelfClosingElement(node) { checkJsxOpeningLikeElement(node); - return jsxElementType || anyType; + return getJsxGlobalElementType() || anyType; } function checkJsxElement(node) { // Check attributes @@ -34662,18 +37471,18 @@ var ts; for (var _i = 0, _a = node.children; _i < _a.length; _i++) { var child = _a[_i]; switch (child.kind) { - case 252 /* JsxExpression */: + case 255 /* JsxExpression */: checkJsxExpression(child); break; - case 246 /* JsxElement */: + case 248 /* JsxElement */: checkJsxElement(child); break; - case 247 /* JsxSelfClosingElement */: + case 249 /* JsxSelfClosingElement */: checkJsxSelfClosingElement(child); break; } } - return jsxElementType || anyType; + return getJsxGlobalElementType() || anyType; } /** * Returns true iff the JSX element name would be a valid JS identifier, ignoring restrictions about keywords not being identifiers @@ -34687,81 +37496,114 @@ var ts; */ function isJsxIntrinsicIdentifier(tagName) { // TODO (yuisu): comment - if (tagName.kind === 177 /* PropertyAccessExpression */ || tagName.kind === 98 /* ThisKeyword */) { + if (tagName.kind === 178 /* PropertyAccessExpression */ || tagName.kind === 98 /* ThisKeyword */) { return false; } else { return ts.isIntrinsicJsxName(tagName.text); } } - function checkJsxAttribute(node, elementAttributesType, nameTable) { - var correspondingPropType = undefined; - // Look up the corresponding property for this attribute - if (elementAttributesType === emptyObjectType && isUnhyphenatedJsxName(node.name.text)) { - // If there is no 'props' property, you may not have non-"data-" attributes - error(node.parent, ts.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, getJsxElementPropertiesName()); - } - else if (elementAttributesType && !isTypeAny(elementAttributesType)) { - var correspondingPropSymbol = getPropertyOfType(elementAttributesType, node.name.text); - correspondingPropType = correspondingPropSymbol && getTypeOfSymbol(correspondingPropSymbol); - if (isUnhyphenatedJsxName(node.name.text)) { - var attributeType = getTypeOfPropertyOfType(elementAttributesType, ts.getTextOfPropertyName(node.name)) || getIndexTypeOfType(elementAttributesType, 0 /* String */); - if (attributeType) { - correspondingPropType = attributeType; + /** + * Get attributes type of the JSX opening-like element. The result is from resolving "attributes" property of the opening-like element. + * + * @param openingLikeElement a JSX opening-like element + * @param filter a function to remove attributes that will not participate in checking whether attributes are assignable + * @return an anonymous type (similar to the one returned by checkObjectLiteral) in which its properties are attributes property. + * @remarks Because this function calls getSpreadType, it needs to use the same checks as checkObjectLiteral, + * which also calls getSpreadType. + */ + function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, filter, checkMode) { + var attributes = openingLikeElement.attributes; + var attributesTable = ts.createMap(); + var spread = emptyObjectType; + var attributesArray = []; + for (var _i = 0, _a = attributes.properties; _i < _a.length; _i++) { + var attributeDecl = _a[_i]; + var member = attributeDecl.symbol; + if (ts.isJsxAttribute(attributeDecl)) { + var exprType = attributeDecl.initializer ? + checkExpression(attributeDecl.initializer, checkMode) : + trueType; // is sugar for + var attributeSymbol = createSymbol(4 /* Property */ | 134217728 /* Transient */ | member.flags, member.name); + attributeSymbol.declarations = member.declarations; + attributeSymbol.parent = member.parent; + if (member.valueDeclaration) { + attributeSymbol.valueDeclaration = member.valueDeclaration; } - else { - // If there's no corresponding property with this name, error - if (!correspondingPropType) { - error(node.name, ts.Diagnostics.Property_0_does_not_exist_on_type_1, node.name.text, typeToString(elementAttributesType)); - return unknownType; - } + attributeSymbol.type = exprType; + attributeSymbol.target = member; + attributesTable.set(attributeSymbol.name, attributeSymbol); + attributesArray.push(attributeSymbol); + } + else { + ts.Debug.assert(attributeDecl.kind === 254 /* JsxSpreadAttribute */); + if (attributesArray.length > 0) { + spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable)); + attributesArray = []; + attributesTable = ts.createMap(); } + var exprType = checkExpression(attributeDecl.expression); + if (!isValidSpreadType(exprType)) { + error(attributeDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); + return anyType; + } + if (isTypeAny(exprType)) { + return anyType; + } + spread = getSpreadType(spread, exprType); } } - var exprType; - if (node.initializer) { - exprType = checkExpression(node.initializer); - } - else { - // is sugar for - exprType = booleanType; - } - if (correspondingPropType) { - checkTypeAssignableTo(exprType, correspondingPropType, node); - } - nameTable[node.name.text] = true; - return exprType; - } - function checkJsxSpreadAttribute(node, elementAttributesType, nameTable) { - var type = checkExpression(node.expression); - var props = getPropertiesOfType(type); - for (var _i = 0, props_2 = props; _i < props_2.length; _i++) { - var prop = props_2[_i]; - // Is there a corresponding property in the element attributes type? Skip checking of properties - // that have already been assigned to, as these are not actually pushed into the resulting type - if (!nameTable[prop.name]) { - var targetPropSym = getPropertyOfType(elementAttributesType, prop.name); - if (targetPropSym) { - var msg = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property, prop.name); - checkTypeAssignableTo(getTypeOfSymbol(prop), getTypeOfSymbol(targetPropSym), node, undefined, msg); - } - nameTable[prop.name] = true; + if (spread !== emptyObjectType) { + if (attributesArray.length > 0) { + spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable)); + attributesArray = []; + attributesTable = ts.createMap(); } + attributesArray = getPropertiesOfType(spread); } - return type; - } - function getJsxType(name) { - if (jsxTypes[name] === undefined) { - return jsxTypes[name] = getExportedTypeFromNamespace(JsxNames.JSX, name) || unknownType; + attributesTable = ts.createMap(); + if (attributesArray) { + ts.forEach(attributesArray, function (attr) { + if (!filter || filter(attr)) { + attributesTable.set(attr.name, attr); + } + }); + } + return createJsxAttributesType(attributes.symbol, attributesTable); + /** + * Create anonymous type from given attributes symbol table. + * @param symbol a symbol of JsxAttributes containing attributes corresponding to attributesTable + * @param attributesTable a symbol table of attributes property + */ + function createJsxAttributesType(symbol, attributesTable) { + var result = createAnonymousType(symbol, attributesTable, emptyArray, emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined); + var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 1048576 /* FreshLiteral */; + result.flags |= 33554432 /* JsxAttributes */ | 4194304 /* ContainsObjectLiteral */ | freshObjectLiteralFlag; + result.objectFlags |= 128 /* ObjectLiteral */; + return result; } - return jsxTypes[name]; } /** - * Looks up an intrinsic tag name and returns a symbol that either points to an intrinsic - * property (in which case nodeLinks.jsxFlags will be IntrinsicNamedElement) or an intrinsic - * string index signature (in which case nodeLinks.jsxFlags will be IntrinsicIndexedElement). - * May also return unknownSymbol if both of these lookups fail. - */ + * Check attributes property of opening-like element. This function is called during chooseOverload to get call signature of a JSX opening-like element. + * (See "checkApplicableSignatureForJsxOpeningLikeElement" for how the function is used) + * @param node a JSXAttributes to be resolved of its type + */ + function checkJsxAttributes(node, checkMode) { + return createJsxAttributesTypeFromAttributesProperty(node.parent, /*filter*/ undefined, checkMode); + } + function getJsxType(name) { + var jsxType = jsxTypes.get(name); + if (jsxType === undefined) { + jsxTypes.set(name, jsxType = getExportedTypeFromNamespace(JsxNames.JSX, name) || unknownType); + } + return jsxType; + } + /** + * Looks up an intrinsic tag name and returns a symbol that either points to an intrinsic + * property (in which case nodeLinks.jsxFlags will be IntrinsicNamedElement) or an intrinsic + * string index signature (in which case nodeLinks.jsxFlags will be IntrinsicIndexedElement). + * May also return unknownSymbol if both of these lookups fail. + */ function getIntrinsicTagSymbol(node) { var links = getNodeLinks(node); if (!links.resolvedSymbol) { @@ -34784,7 +37626,7 @@ var ts; return links.resolvedSymbol = unknownSymbol; } else { - if (compilerOptions.noImplicitAny) { + if (noImplicitAny) { error(node, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists, JsxNames.IntrinsicElements); } return links.resolvedSymbol = unknownSymbol; @@ -34849,28 +37691,133 @@ var ts; } } /** - * Given React element instance type and the class type, resolve the Jsx type - * Pass elemType to handle individual type in the union typed element type. + * Get JSX attributes type by trying to resolve openingLikeElement as a stateless function component. + * Return only attributes type of successfully resolved call signature. + * This function assumes that the caller handled other possible element type of the JSX element (e.g. stateful component) + * Unlike tryGetAllJsxStatelessFunctionAttributesType, this function is a default behavior of type-checkers. + * @param openingLikeElement a JSX opening-like element to find attributes type + * @param elementType a type of the opening-like element. This elementType can't be an union type + * @param elemInstanceType an element instance type (the result of newing or invoking this tag) + * @param elementClassType a JSX-ElementClass type. This is a result of looking up ElementClass interface in the JSX global */ - function getResolvedJsxType(node, elemType, elemClassType) { - if (!elemType) { - elemType = checkExpression(node.tagName); + function defaultTryGetJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) { + ts.Debug.assert(!(elementType.flags & 65536 /* Union */)); + if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) { + var jsxStatelessElementType = getJsxGlobalStatelessElementType(); + if (jsxStatelessElementType) { + // We don't call getResolvedSignature here because we have already resolve the type of JSX Element. + var callSignature = getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, /*candidatesOutArray*/ undefined); + if (callSignature !== unknownSignature) { + var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); + var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); + if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) { + // Intersect in JSX.IntrinsicAttributes if it exists + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttributes !== unknownType) { + paramType = intersectTypes(intrinsicAttributes, paramType); + } + return paramType; + } + } + } } - if (elemType.flags & 65536 /* Union */) { - var types = elemType.types; - return getUnionType(ts.map(types, function (type) { - return getResolvedJsxType(node, type, elemClassType); + return undefined; + } + /** + * Get JSX attributes type by trying to resolve openingLikeElement as a stateless function component. + * Return all attributes type of resolved call signature including candidate signatures. + * This function assumes that the caller handled other possible element type of the JSX element. + * This function is a behavior used by language service when looking up completion in JSX element. + * @param openingLikeElement a JSX opening-like element to find attributes type + * @param elementType a type of the opening-like element. This elementType can't be an union type + * @param elemInstanceType an element instance type (the result of newing or invoking this tag) + * @param elementClassType a JSX-ElementClass type. This is a result of looking up ElementClass interface in the JSX global + */ + function tryGetAllJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) { + ts.Debug.assert(!(elementType.flags & 65536 /* Union */)); + if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) { + // Is this is a stateless function component? See if its single signature's return type is assignable to the JSX Element Type + var jsxStatelessElementType = getJsxGlobalStatelessElementType(); + if (jsxStatelessElementType) { + // We don't call getResolvedSignature because here we have already resolve the type of JSX Element. + var candidatesOutArray = []; + getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, candidatesOutArray); + var result = void 0; + var allMatchingAttributesType = void 0; + for (var _i = 0, candidatesOutArray_1 = candidatesOutArray; _i < candidatesOutArray_1.length; _i++) { + var candidate = candidatesOutArray_1[_i]; + var callReturnType = getReturnTypeOfSignature(candidate); + var paramType = callReturnType && (candidate.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(candidate.parameters[0])); + if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) { + var shouldBeCandidate = true; + for (var _a = 0, _b = openingLikeElement.attributes.properties; _a < _b.length; _a++) { + var attribute = _b[_a]; + if (ts.isJsxAttribute(attribute) && + isUnhyphenatedJsxName(attribute.name.text) && + !getPropertyOfType(paramType, attribute.name.text)) { + shouldBeCandidate = false; + break; + } + } + if (shouldBeCandidate) { + result = intersectTypes(result, paramType); + } + allMatchingAttributesType = intersectTypes(allMatchingAttributesType, paramType); + } + } + // If we can't find any matching, just return everything. + if (!result) { + result = allMatchingAttributesType; + } + // Intersect in JSX.IntrinsicAttributes if it exists + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttributes !== unknownType) { + result = intersectTypes(intrinsicAttributes, result); + } + return result; + } + } + return undefined; + } + /** + * Resolve attributes type of the given opening-like element. The attributes type is a type of attributes associated with the given elementType. + * For instance: + * declare function Foo(attr: { p1: string}): JSX.Element; + * ; // This function will try resolve "Foo" and return an attributes type of "Foo" which is "{ p1: string }" + * + * The function is intended to initially be called from getAttributesTypeFromJsxOpeningLikeElement which already handle JSX-intrinsic-element.. + * This function will try to resolve custom JSX attributes type in following order: string literal, stateless function, and stateful component + * + * @param openingLikeElement a non-intrinsic JSXOPeningLikeElement + * @param shouldIncludeAllStatelessAttributesType a boolean indicating whether to include all attributes types from all stateless function signature + * @param elementType an instance type of the given opening-like element. If undefined, the function will check type openinglikeElement's tagname. + * @param elementClassType a JSX-ElementClass type. This is a result of looking up ElementClass interface in the JSX global (imported from react.d.ts) + * @return attributes type if able to resolve the type of node + * anyType if there is no type ElementAttributesProperty or there is an error + * emptyObjectType if there is no "prop" in the element instance type + */ + function resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, elementType, elementClassType) { + if (!elementType) { + elementType = checkExpression(openingLikeElement.tagName); + } + if (elementType.flags & 65536 /* Union */) { + var types = elementType.types; + return getUnionType(types.map(function (type) { + return resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, type, elementClassType); }), /*subtypeReduction*/ true); } // If the elemType is a string type, we have to return anyType to prevent an error downstream as we will try to find construct or call signature of the type - if (elemType.flags & 2 /* String */) { + if (elementType.flags & 2 /* String */) { return anyType; } - else if (elemType.flags & 32 /* StringLiteral */) { + else if (elementType.flags & 32 /* StringLiteral */) { // If the elemType is a stringLiteral type, we can then provide a check to make sure that the string literal type is one of the Jsx intrinsic element type + // For example: + // var CustomTag: "h1" = "h1"; + // Hello World var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); if (intrinsicElementsType !== unknownType) { - var stringLiteralTypeName = elemType.text; + var stringLiteralTypeName = elementType.text; var intrinsicProp = getPropertyOfType(intrinsicElementsType, stringLiteralTypeName); if (intrinsicProp) { return getTypeOfSymbol(intrinsicProp); @@ -34879,34 +37826,24 @@ var ts; if (indexSignatureType) { return indexSignatureType; } - error(node, ts.Diagnostics.Property_0_does_not_exist_on_type_1, stringLiteralTypeName, "JSX." + JsxNames.IntrinsicElements); + error(openingLikeElement, ts.Diagnostics.Property_0_does_not_exist_on_type_1, stringLiteralTypeName, "JSX." + JsxNames.IntrinsicElements); } // If we need to report an error, we already done so here. So just return any to prevent any more error downstream return anyType; } // Get the element instance type (the result of newing or invoking this tag) - var elemInstanceType = getJsxElementInstanceType(node, elemType); - if (!elemClassType || !isTypeAssignableTo(elemInstanceType, elemClassType)) { - // Is this is a stateless function component? See if its single signature's return type is - // assignable to the JSX Element Type - if (jsxElementType) { - var callSignatures = elemType && getSignaturesOfType(elemType, 0 /* Call */); - var callSignature = callSignatures && callSignatures.length > 0 && callSignatures[0]; - var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); - var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); - if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType)) { - // Intersect in JSX.IntrinsicAttributes if it exists - var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); - if (intrinsicAttributes !== unknownType) { - paramType = intersectTypes(intrinsicAttributes, paramType); - } - return paramType; - } - } + var elemInstanceType = getJsxElementInstanceType(openingLikeElement, elementType); + // If we should include all stateless attributes type, then get all attributes type from all stateless function signature. + // Otherwise get only attributes type from the signature picked by choose-overload logic. + var statelessAttributesType = shouldIncludeAllStatelessAttributesType ? + tryGetAllJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) : + defaultTryGetJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType); + if (statelessAttributesType) { + return statelessAttributesType; } // Issue an error if this return type isn't assignable to JSX.ElementClass - if (elemClassType) { - checkTypeRelatedTo(elemInstanceType, elemClassType, assignableRelation, node, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); + if (elementClassType) { + checkTypeRelatedTo(elemInstanceType, elementClassType, assignableRelation, openingLikeElement, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); } if (isTypeAny(elemInstanceType)) { return elemInstanceType; @@ -34930,11 +37867,6 @@ var ts; // Props is of type 'any' or unknown return attributesType; } - else if (attributesType.flags & 65536 /* Union */) { - // Props cannot be a union type - error(node.tagName, ts.Diagnostics.JSX_element_attributes_type_0_may_not_be_a_union_type, typeToString(attributesType)); - return anyType; - } else { // Normal case -- add in IntrinsicClassElements and IntrinsicElements var apparentAttributesType = attributesType; @@ -34959,30 +37891,68 @@ var ts; } } /** - * Given an opening/self-closing element, get the 'element attributes type', i.e. the type that tells - * us which attributes are valid on a given element. + * Get attributes type of the given intrinsic opening-like Jsx element by resolving the tag name. + * The function is intended to be called from a function which has checked that the opening element is an intrinsic element. + * @param node an intrinsic JSX opening-like element */ - function getJsxElementAttributesType(node) { + function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) { + ts.Debug.assert(isJsxIntrinsicIdentifier(node.tagName)); var links = getNodeLinks(node); - if (!links.resolvedJsxType) { - if (isJsxIntrinsicIdentifier(node.tagName)) { - var symbol = getIntrinsicTagSymbol(node); - if (links.jsxFlags & 1 /* IntrinsicNamedElement */) { - return links.resolvedJsxType = getTypeOfSymbol(symbol); - } - else if (links.jsxFlags & 2 /* IntrinsicIndexedElement */) { - return links.resolvedJsxType = getIndexInfoOfSymbol(symbol, 0 /* String */).type; - } - else { - return links.resolvedJsxType = unknownType; - } + if (!links.resolvedJsxElementAttributesType) { + var symbol = getIntrinsicTagSymbol(node); + if (links.jsxFlags & 1 /* IntrinsicNamedElement */) { + return links.resolvedJsxElementAttributesType = getTypeOfSymbol(symbol); + } + else if (links.jsxFlags & 2 /* IntrinsicIndexedElement */) { + return links.resolvedJsxElementAttributesType = getIndexInfoOfSymbol(symbol, 0 /* String */).type; } else { - var elemClassType = getJsxGlobalElementClassType(); - return links.resolvedJsxType = getResolvedJsxType(node, undefined, elemClassType); + return links.resolvedJsxElementAttributesType = unknownType; } } - return links.resolvedJsxType; + return links.resolvedJsxElementAttributesType; + } + /** + * Get attributes type of the given custom opening-like JSX element. + * This function is intended to be called from a caller that handles intrinsic JSX element already. + * @param node a custom JSX opening-like element + * @param shouldIncludeAllStatelessAttributesType a boolean value used by language service to get all possible attributes type from an overload stateless function component + */ + function getCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType) { + var links = getNodeLinks(node); + if (!links.resolvedJsxElementAttributesType) { + var elemClassType = getJsxGlobalElementClassType(); + return links.resolvedJsxElementAttributesType = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, /*elementType*/ undefined, elemClassType); + } + return links.resolvedJsxElementAttributesType; + } + /** + * Get all possible attributes type, especially from an overload stateless function component, of the given JSX opening-like element. + * This function is called by language service (see: completions-tryGetGlobalSymbols). + * @param node a JSX opening-like element to get attributes type for + */ + function getAllAttributesTypeFromJsxOpeningLikeElement(node) { + if (isJsxIntrinsicIdentifier(node.tagName)) { + return getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); + } + else { + // Because in language service, the given JSX opening-like element may be incomplete and therefore, + // we can't resolve to exact signature if the element is a stateless function component so the best thing to do is return all attributes type from all overloads. + return getCustomJsxElementAttributesType(node, /*shouldIncludeAllStatelessAttributesType*/ true); + } + } + /** + * Get the attributes type, which indicates the attributes that are valid on the given JSXOpeningLikeElement. + * @param node a JSXOpeningLikeElement node + * @return an attributes type of the given node + */ + function getAttributesTypeFromJsxOpeningLikeElement(node) { + if (isJsxIntrinsicIdentifier(node.tagName)) { + return getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); + } + else { + return getCustomJsxElementAttributesType(node, /*shouldIncludeAllStatelessAttributesType*/ false); + } } /** * Given a JSX attribute, returns the symbol for the corresponds property @@ -34990,17 +37960,34 @@ var ts; * that have no matching element attributes type property. */ function getJsxAttributePropertySymbol(attrib) { - var attributesType = getJsxElementAttributesType(attrib.parent); + var attributesType = getAttributesTypeFromJsxOpeningLikeElement(attrib.parent.parent); var prop = getPropertyOfType(attributesType, attrib.name.text); return prop || unknownSymbol; } function getJsxGlobalElementClassType() { - if (!jsxElementClassType) { - jsxElementClassType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.ElementClass); + if (!deferredJsxElementClassType) { + deferredJsxElementClassType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.ElementClass); } - return jsxElementClassType; + return deferredJsxElementClassType; } - /// Returns all the properties of the Jsx.IntrinsicElements interface + function getJsxGlobalElementType() { + if (!deferredJsxElementType) { + deferredJsxElementType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.Element); + } + return deferredJsxElementType; + } + function getJsxGlobalStatelessElementType() { + if (!deferredJsxStatelessElementType) { + var jsxElementType = getJsxGlobalElementType(); + if (jsxElementType) { + deferredJsxStatelessElementType = getUnionType([jsxElementType, nullType]); + } + } + return deferredJsxStatelessElementType; + } + /** + * Returns all the properties of the Jsx.IntrinsicElements interface + */ function getJsxIntrinsicTagNames() { var intrinsics = getJsxType(JsxNames.IntrinsicElements); return intrinsics ? getPropertiesOfType(intrinsics) : emptyArray; @@ -35010,8 +37997,8 @@ var ts; if ((compilerOptions.jsx || 0 /* None */) === 0 /* None */) { error(errorNode, ts.Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided); } - if (jsxElementType === undefined) { - if (compilerOptions.noImplicitAny) { + if (getJsxGlobalElementType() === undefined) { + if (noImplicitAny) { error(errorNode, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist); } } @@ -35033,39 +38020,46 @@ var ts; markAliasSymbolAsReferenced(reactSym); } } - var targetAttributesType = getJsxElementAttributesType(node); - var nameTable = ts.createMap(); - // Process this array in right-to-left order so we know which - // attributes (mostly from spreads) are being overwritten and - // thus should have their types ignored - var sawSpreadedAny = false; - for (var i = node.attributes.length - 1; i >= 0; i--) { - if (node.attributes[i].kind === 250 /* JsxAttribute */) { - checkJsxAttribute((node.attributes[i]), targetAttributesType, nameTable); - } - else { - ts.Debug.assert(node.attributes[i].kind === 251 /* JsxSpreadAttribute */); - var spreadType = checkJsxSpreadAttribute((node.attributes[i]), targetAttributesType, nameTable); - if (isTypeAny(spreadType)) { - sawSpreadedAny = true; - } - } + checkJsxAttributesAssignableToTagNameAttributes(node); + } + /** + * Check whether the given attributes of JSX opening-like element is assignable to the tagName attributes. + * Get the attributes type of the opening-like element through resolving the tagName, "target attributes" + * Check assignablity between given attributes property, "source attributes", and the "target attributes" + * @param openingLikeElement an opening-like JSX element to check its JSXAttributes + */ + function checkJsxAttributesAssignableToTagNameAttributes(openingLikeElement) { + // The function involves following steps: + // 1. Figure out expected attributes type by resolving tagName of the JSX opening-like element, targetAttributesType. + // During these steps, we will try to resolve the tagName as intrinsic name, stateless function, stateful component (in the order) + // 2. Solved JSX attributes type given by users, sourceAttributesType, which is by resolving "attributes" property of the JSX opening-like element. + // 3. Check if the two are assignable to each other + // targetAttributesType is a type of an attributes from resolving tagName of an opening-like JSX element. + var targetAttributesType = isJsxIntrinsicIdentifier(openingLikeElement.tagName) ? + getIntrinsicAttributesTypeFromJsxOpeningLikeElement(openingLikeElement) : + getCustomJsxElementAttributesType(openingLikeElement, /*shouldIncludeAllStatelessAttributesType*/ false); + // sourceAttributesType is a type of an attributes properties. + // i.e
+ // attr1 and attr2 are treated as JSXAttributes attached in the JsxOpeningLikeElement as "attributes". + var sourceAttributesType = createJsxAttributesTypeFromAttributesProperty(openingLikeElement, function (attribute) { + return isUnhyphenatedJsxName(attribute.name) || !!(getPropertyOfType(targetAttributesType, attribute.name)); + }); + // If the targetAttributesType is an emptyObjectType, indicating that there is no property named 'props' on this instance type. + // but there exists a sourceAttributesType, we need to explicitly give an error as normal assignability check allow excess properties and will pass. + if (targetAttributesType === emptyObjectType && (isTypeAny(sourceAttributesType) || sourceAttributesType.properties.length > 0)) { + error(openingLikeElement, ts.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, getJsxElementPropertiesName()); } - // Check that all required properties have been provided. If an 'any' - // was spreaded in, though, assume that it provided all required properties - if (targetAttributesType && !sawSpreadedAny) { - var targetProperties = getPropertiesOfType(targetAttributesType); - for (var i = 0; i < targetProperties.length; i++) { - if (!(targetProperties[i].flags & 536870912 /* Optional */) && - !nameTable[targetProperties[i].name]) { - error(node, ts.Diagnostics.Property_0_is_missing_in_type_1, targetProperties[i].name, typeToString(targetAttributesType)); - } - } + else { + checkTypeAssignableTo(sourceAttributesType, targetAttributesType, openingLikeElement.attributes.properties.length > 0 ? openingLikeElement.attributes : openingLikeElement); } } - function checkJsxExpression(node) { + function checkJsxExpression(node, checkMode) { if (node.expression) { - return checkExpression(node.expression); + var type = checkExpression(node.expression, checkMode); + if (node.dotDotDotToken && type !== anyType && !isArrayType(type)) { + error(node, ts.Diagnostics.JSX_spread_child_must_be_an_array_type, node.toString(), typeToString(type)); + } + return type; } else { return unknownType; @@ -35074,14 +38068,32 @@ var ts; // If a symbol is a synthesized symbol with no value declaration, we assume it is a property. Example of this are the synthesized // '.prototype' property as well as synthesized tuple index properties. function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 147 /* PropertyDeclaration */; + return s.valueDeclaration ? s.valueDeclaration.kind : 148 /* PropertyDeclaration */; } function getDeclarationModifierFlagsFromSymbol(s) { - return s.valueDeclaration ? ts.getCombinedModifierFlags(s.valueDeclaration) : s.flags & 134217728 /* Prototype */ ? 4 /* Public */ | 32 /* Static */ : 0; + if (s.valueDeclaration) { + var flags = ts.getCombinedModifierFlags(s.valueDeclaration); + return s.parent && s.parent.flags & 32 /* Class */ ? flags : flags & ~28 /* AccessibilityModifier */; + } + if (getCheckFlags(s) & 6 /* Synthetic */) { + var checkFlags = s.checkFlags; + var accessModifier = checkFlags & 256 /* ContainsPrivate */ ? 8 /* Private */ : + checkFlags & 64 /* ContainsPublic */ ? 4 /* Public */ : + 16 /* Protected */; + var staticModifier = checkFlags & 512 /* ContainsStatic */ ? 32 /* Static */ : 0; + return accessModifier | staticModifier; + } + if (s.flags & 16777216 /* Prototype */) { + return 4 /* Public */ | 32 /* Static */; + } + return 0; } function getDeclarationNodeFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : 0; } + function isMethodLike(symbol) { + return !!(symbol.flags & 8192 /* Method */ || getCheckFlags(symbol) & 4 /* SyntheticMethod */); + } /** * Check whether the requested property access is valid. * Returns true if node is a valid property access, and false otherwise. @@ -35090,12 +38102,16 @@ var ts; * @param type The type of left. * @param prop The symbol for the right hand side of the property access. */ - function checkClassPropertyAccess(node, left, type, prop) { + function checkPropertyAccessibility(node, left, type, prop) { var flags = getDeclarationModifierFlagsFromSymbol(prop); - var declaringClass = getDeclaredTypeOfSymbol(getParentOfSymbol(prop)); - var errorNode = node.kind === 177 /* PropertyAccessExpression */ || node.kind === 223 /* VariableDeclaration */ ? + var errorNode = node.kind === 178 /* PropertyAccessExpression */ || node.kind === 225 /* VariableDeclaration */ ? node.name : node.right; + if (getCheckFlags(prop) & 256 /* ContainsPrivate */) { + // Synthetic property with private constituent property + error(errorNode, ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(prop), typeToString(type)); + return false; + } if (left.kind === 96 /* SuperKeyword */) { // TS 1.0 spec (April 2014): 4.8.2 // - In a constructor, instance member function, instance member accessor, or @@ -35104,18 +38120,22 @@ var ts; // - In a static member function or static member accessor // where this references the constructor function object of a derived class, // a super property access is permitted and must specify a public static member function of the base class. - if (languageVersion < 2 /* ES2015 */ && getDeclarationKindFromSymbol(prop) !== 149 /* MethodDeclaration */) { - // `prop` refers to a *property* declared in the super class - // rather than a *method*, so it does not satisfy the above criteria. - error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); - return false; + if (languageVersion < 2 /* ES2015 */) { + var hasNonMethodDeclaration = forEachProperty(prop, function (p) { + var propKind = getDeclarationKindFromSymbol(p); + return propKind !== 150 /* MethodDeclaration */ && propKind !== 149 /* MethodSignature */; + }); + if (hasNonMethodDeclaration) { + error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); + return false; + } } if (flags & 128 /* Abstract */) { // A method cannot be accessed in a super property access if the method is abstract. // This error could mask a private property access error. But, a member // cannot simultaneously be private and abstract, so this will trigger an // additional error elsewhere. - error(errorNode, ts.Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString(prop), typeToString(declaringClass)); + error(errorNode, ts.Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString(prop), typeToString(getDeclaringClass(prop))); return false; } } @@ -35128,7 +38148,7 @@ var ts; if (flags & 8 /* Private */) { var declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop)); if (!isNodeWithinClass(node, declaringClassDeclaration)) { - error(errorNode, ts.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(declaringClass)); + error(errorNode, ts.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(getDeclaringClass(prop))); return false; } return true; @@ -35138,14 +38158,15 @@ var ts; if (left.kind === 96 /* SuperKeyword */) { return true; } - // Get the enclosing class that has the declaring class as its base type + // Find the first enclosing class that has the declaring classes of the protected constituents + // of the property as base classes var enclosingClass = forEachEnclosingClass(node, function (enclosingDeclaration) { var enclosingClass = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingDeclaration)); - return hasBaseType(enclosingClass, declaringClass) ? enclosingClass : undefined; + return isClassDerivedFromDeclaringClasses(enclosingClass, prop) ? enclosingClass : undefined; }); // A protected property is accessible if the property is within the declaring class or classes derived from it if (!enclosingClass) { - error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(declaringClass)); + error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(getDeclaringClass(prop) || type)); return false; } // No further restrictions for static properties @@ -35157,7 +38178,6 @@ var ts; // get the original type -- represented as the type constraint of the 'this' type type = getConstraintOfTypeParameter(type); } - // TODO: why is the first part of this check here? if (!(getObjectFlags(getTargetType(type)) & 3 /* ClassOrInterface */ && hasBaseType(type, enclosingClass))) { error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1, symbolToString(prop), typeToString(enclosingClass)); return false; @@ -35165,16 +38185,17 @@ var ts; return true; } function checkNonNullExpression(node) { - var type = checkExpression(node); - if (strictNullChecks) { - var kind = getFalsyFlags(type) & 6144 /* Nullable */; - if (kind) { - error(node, kind & 2048 /* Undefined */ ? kind & 4096 /* Null */ ? - ts.Diagnostics.Object_is_possibly_null_or_undefined : - ts.Diagnostics.Object_is_possibly_undefined : - ts.Diagnostics.Object_is_possibly_null); - } - return getNonNullableType(type); + return checkNonNullType(checkExpression(node), node); + } + function checkNonNullType(type, errorNode) { + var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 6144 /* Nullable */; + if (kind) { + error(errorNode, kind & 2048 /* Undefined */ ? kind & 4096 /* Null */ ? + ts.Diagnostics.Object_is_possibly_null_or_undefined : + ts.Diagnostics.Object_is_possibly_undefined : + ts.Diagnostics.Object_is_possibly_null); + var t = getNonNullableType(type); + return t.flags & (6144 /* Nullable */ | 8192 /* Never */) ? unknownType : t; } return type; } @@ -35203,7 +38224,7 @@ var ts; noUnusedIdentifiers && (prop.flags & 106500 /* ClassMember */) && prop.valueDeclaration && (ts.getModifierFlags(prop.valueDeclaration) & 8 /* Private */)) { - if (prop.flags & 16777216 /* Instantiated */) { + if (getCheckFlags(prop) & 1 /* Instantiated */) { getSymbolLinks(prop).target.isReferenced = true; } else { @@ -35211,6 +38232,15 @@ var ts; } } } + function isInPropertyInitializer(node) { + while (node) { + if (node.parent && node.parent.kind === 148 /* PropertyDeclaration */ && node.parent.initializer === node) { + return true; + } + node = node.parent; + } + return false; + } function checkPropertyAccessExpressionOrQualifiedName(node, left, right) { var type = checkNonNullExpression(left); if (isTypeAny(type) || type === silentNeverType) { @@ -35223,16 +38253,30 @@ var ts; } var prop = getPropertyOfType(apparentType, right.text); if (!prop) { + var stringIndexType = getIndexTypeOfType(apparentType, 0 /* String */); + if (stringIndexType) { + return stringIndexType; + } if (right.text && !checkAndReportErrorForExtendingInterface(node)) { reportNonexistentProperty(right, type.flags & 16384 /* TypeParameter */ && type.isThisType ? apparentType : type); } return unknownType; } + if (prop.valueDeclaration) { + if (isInPropertyInitializer(node) && + !isBlockScopedNameDeclaredBeforeUse(prop.valueDeclaration, right)) { + error(right, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, right.text); + } + if (prop.valueDeclaration.kind === 228 /* ClassDeclaration */ && + node.parent && node.parent.kind !== 158 /* TypeReference */ && + !ts.isInAmbientContext(prop.valueDeclaration) && + !isBlockScopedNameDeclaredBeforeUse(prop.valueDeclaration, right)) { + error(right, ts.Diagnostics.Class_0_used_before_its_declaration, right.text); + } + } markPropertyAsReferenced(prop); getNodeLinks(node).resolvedSymbol = prop; - if (prop.parent && prop.parent.flags & 32 /* Class */) { - checkClassPropertyAccess(node, left, apparentType, prop); - } + checkPropertyAccessibility(node, left, apparentType, prop); var propType = getTypeOfSymbol(prop); var assignmentKind = ts.getAssignmentTargetKind(node); if (assignmentKind) { @@ -35244,23 +38288,23 @@ var ts; // Only compute control flow type if this is a property access expression that isn't an // assignment target, and the referenced property was declared as a variable, property, // accessor, or optional method. - if (node.kind !== 177 /* PropertyAccessExpression */ || assignmentKind === 1 /* Definite */ || + if (node.kind !== 178 /* PropertyAccessExpression */ || assignmentKind === 1 /* Definite */ || !(prop.flags & (3 /* Variable */ | 4 /* Property */ | 98304 /* Accessor */)) && !(prop.flags & 8192 /* Method */ && propType.flags & 65536 /* Union */)) { return propType; } - var flowType = getFlowTypeOfReference(node, propType, /*assumeInitialized*/ true, /*flowContainer*/ undefined); + var flowType = getFlowTypeOfReference(node, propType); return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 177 /* PropertyAccessExpression */ + var left = node.kind === 178 /* PropertyAccessExpression */ ? node.expression : node.left; var type = checkExpression(left); if (type !== unknownType && !isTypeAny(type)) { var prop = getPropertyOfType(getWidenedType(type), propertyName); - if (prop && prop.parent && prop.parent.flags & 32 /* Class */) { - return checkClassPropertyAccess(node, left, type, prop); + if (prop) { + return checkPropertyAccessibility(node, left, type, prop); } } return true; @@ -35270,7 +38314,7 @@ var ts; */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 224 /* VariableDeclarationList */) { + if (initializer.kind === 226 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -35299,7 +38343,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 212 /* ForInStatement */ && + if (node.kind === 214 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -35317,7 +38361,7 @@ var ts; var indexExpression = node.argumentExpression; if (!indexExpression) { var sourceFile = ts.getSourceFileOfNode(node); - if (node.parent.kind === 180 /* NewExpression */ && node.parent.expression === node) { + if (node.parent.kind === 181 /* NewExpression */ && node.parent.expression === node) { var start = ts.skipTrivia(sourceFile.text, node.expression.end); var end = node.end; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); @@ -35337,7 +38381,7 @@ var ts; error(indexExpression, ts.Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal); return unknownType; } - return getIndexedAccessType(objectType, indexType, node); + return checkIndexedAccessIndexType(getIndexedAccessType(objectType, indexType, node), node); } function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) { if (expressionType === unknownType) { @@ -35361,7 +38405,7 @@ var ts; if (!leftHandSideSymbol) { return false; } - var globalESSymbol = getGlobalESSymbolConstructorSymbol(); + var globalESSymbol = getGlobalESSymbolConstructorSymbol(/*reportErrors*/ true); if (!globalESSymbol) { // Already errored when we tried to look up the symbol return false; @@ -35375,10 +38419,10 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 181 /* TaggedTemplateExpression */) { + if (node.kind === 182 /* TaggedTemplateExpression */) { checkExpression(node.template); } - else if (node.kind !== 145 /* Decorator */) { + else if (node.kind !== 146 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -35405,16 +38449,16 @@ var ts; var specializedIndex = -1; var spliceIndex; ts.Debug.assert(!result.length); - for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { - var signature = signatures_2[_i]; + for (var _i = 0, signatures_3 = signatures; _i < signatures_3.length; _i++) { + var signature = signatures_3[_i]; var symbol = signature.declaration && getSymbolOfNode(signature.declaration); - var parent_8 = signature.declaration && signature.declaration.parent; + var parent = signature.declaration && signature.declaration.parent; if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && parent_8 === lastParent) { + if (lastParent && parent === lastParent) { index++; } else { - lastParent = parent_8; + lastParent = parent; index = cutoffIndex; } } @@ -35422,7 +38466,7 @@ var ts; // current declaration belongs to a different symbol // set cutoffIndex so re-orderings in the future won't change result set from 0 to cutoffIndex index = cutoffIndex = result.length; - lastParent = parent_8; + lastParent = parent; } lastSymbol = symbol; // specialized signatures always need to be placed before non-specialized signatures regardless @@ -35444,7 +38488,7 @@ var ts; function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg && arg.kind === 196 /* SpreadElement */) { + if (arg && arg.kind === 197 /* SpreadElement */) { return i; } } @@ -35457,13 +38501,17 @@ var ts; var callIsIncomplete; // In incomplete call we want to be lenient when we have too few arguments var isDecorator; var spreadArgIndex = -1; - if (node.kind === 181 /* TaggedTemplateExpression */) { + if (ts.isJsxOpeningLikeElement(node)) { + // The arity check will be done in "checkApplicableSignatureForJsxOpeningLikeElement". + return true; + } + if (node.kind === 182 /* TaggedTemplateExpression */) { var tagExpression = node; // Even if the call is incomplete, we'll have a missing expression as our last argument, // so we can say the count is just the arg list length argCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 194 /* TemplateExpression */) { + if (tagExpression.template.kind === 195 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. var templateExpression = tagExpression.template; @@ -35480,7 +38528,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 145 /* Decorator */) { + else if (node.kind === 146 /* Decorator */) { isDecorator = true; typeArguments = undefined; argCount = getEffectiveArgumentCount(node, /*args*/ undefined, signature); @@ -35489,19 +38537,21 @@ var ts; var callExpression = node; if (!callExpression.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(callExpression.kind === 180 /* NewExpression */); + ts.Debug.assert(callExpression.kind === 181 /* NewExpression */); return signature.minArgumentCount === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; - // If we are missing the close paren, the call is incomplete. + // If we are missing the close parenthesis, the call is incomplete. callIsIncomplete = callExpression.arguments.end === callExpression.end; typeArguments = callExpression.typeArguments; spreadArgIndex = getSpreadArgumentIndex(args); } // If the user supplied type arguments, but the number of type arguments does not match // the declared number of type parameters, the call has an incorrect arity. + var numTypeParameters = ts.length(signature.typeParameters); + var minTypeArgumentCount = getMinTypeArgumentCount(signature.typeParameters); var hasRightNumberOfTypeArgs = !typeArguments || - (signature.typeParameters && typeArguments.length === signature.typeParameters.length); + (typeArguments.length >= minTypeArgumentCount && typeArguments.length <= numTypeParameters); if (!hasRightNumberOfTypeArgs) { return false; } @@ -35531,10 +38581,10 @@ var ts; } // Instantiate a generic signature in the context of a non-generic signature (section 3.8.5 in TypeScript spec) function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper) { - var context = createInferenceContext(signature, /*inferUnionTypes*/ true); + var context = createInferenceContext(signature, /*inferUnionTypes*/ true, /*useAnyForNoInferences*/ false); forEachMatchingParameterType(contextualSignature, signature, function (source, target) { // Type parameters from outer context referenced by source type are fixed by instantiation of the source type - inferTypes(context, instantiateType(source, contextualMapper), target); + inferTypesWithContext(context, instantiateType(source, contextualMapper), target); }); return getSignatureInstantiation(signature, getInferredTypes(context)); } @@ -35565,7 +38615,7 @@ var ts; if (thisType) { var thisArgumentNode = getThisArgumentOfCall(node); var thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType; - inferTypes(context, thisArgumentType, thisType); + inferTypesWithContext(context, thisArgumentType, thisType); } // We perform two passes over the arguments. In the first pass we infer from all arguments, but use // wildcards for all context sensitive function expressions. @@ -35573,7 +38623,7 @@ var ts; for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); // If the effective argument is 'undefined', then it is an argument that is present but is synthetic. - if (arg === undefined || arg.kind !== 198 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 199 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i); // If the effective argument type is 'undefined', there is no synthetic type @@ -35584,7 +38634,7 @@ var ts; var mapper = excludeArgument && excludeArgument[i] !== undefined ? identityMapper : inferenceMapper; argType = checkExpressionWithContextualType(arg, paramType, mapper); } - inferTypes(context, argType, paramType); + inferTypesWithContext(context, argType, paramType); } } // In the second pass we visit only context sensitive arguments, and only those that aren't excluded, this @@ -35598,7 +38648,7 @@ var ts; if (excludeArgument[i] === false) { var arg = args[i]; var paramType = getTypeAtPosition(signature, i); - inferTypes(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); + inferTypesWithContext(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); } } } @@ -35608,7 +38658,7 @@ var ts; var typeParameters = signature.typeParameters; var typeArgumentsAreAssignable = true; var mapper; - for (var i = 0; i < typeParameters.length; i++) { + for (var i = 0; i < typeArgumentNodes.length; i++) { if (typeArgumentsAreAssignable /* so far */) { var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { @@ -35628,9 +38678,44 @@ var ts; } return typeArgumentsAreAssignable; } + /** + * Check if the given signature can possibly be a signature called by the JSX opening-like element. + * @param node a JSX opening-like element we are trying to figure its call signature + * @param signature a candidate signature we are trying whether it is a call signature + * @param relation a relationship to check parameter and argument type + * @param excludeArgument + */ + function checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation) { + // JSX opening-like element has correct arity for stateless-function component if the one of the following condition is true: + // 1. callIsIncomplete + // 2. attributes property has same number of properties as the parameter object type. + // We can figure that out by resolving attributes property and check number of properties in the resolved type + // If the call has correct arity, we will then check if the argument type and parameter type is assignable + var callIsIncomplete = node.attributes.end === node.end; // If we are missing the close "/>", the call is incomplete + if (callIsIncomplete) { + return true; + } + var headMessage = ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1; + // Stateless function components can have maximum of three arguments: "props", "context", and "updater". + // However "context" and "updater" are implicit and can't be specify by users. Only the first parameter, props, + // can be specified by users through attributes property. + var paramType = getTypeAtPosition(signature, 0); + var attributesType = checkExpressionWithContextualType(node.attributes, paramType, /*contextualMapper*/ undefined); + var argProperties = getPropertiesOfType(attributesType); + for (var _i = 0, argProperties_1 = argProperties; _i < argProperties_1.length; _i++) { + var arg = argProperties_1[_i]; + if (!getPropertyOfType(paramType, arg.name) && isUnhyphenatedJsxName(arg.name)) { + return false; + } + } + return checkTypeRelatedTo(attributesType, paramType, relation, /*errorNode*/ undefined, headMessage); + } function checkApplicableSignature(node, args, signature, relation, excludeArgument, reportErrors) { + if (ts.isJsxOpeningLikeElement(node)) { + return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation); + } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 180 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 181 /* NewExpression */) { // If the called expression is not of the form `x.f` or `x["f"]`, then sourceType = voidType // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible. // If the expression is a new expression, then the check is skipped. @@ -35647,7 +38732,7 @@ var ts; for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); // If the effective argument is 'undefined', then it is an argument that is present but is synthetic. - if (arg === undefined || arg.kind !== 198 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 199 /* OmittedExpression */) { // Check spread elements against rest type (from arity check we know spread argument corresponds to a rest parameter) var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i); @@ -35669,12 +38754,12 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 179 /* CallExpression */) { + if (node.kind === 180 /* CallExpression */) { var callee = node.expression; - if (callee.kind === 177 /* PropertyAccessExpression */) { + if (callee.kind === 178 /* PropertyAccessExpression */) { return callee.expression; } - else if (callee.kind === 178 /* ElementAccessExpression */) { + else if (callee.kind === 179 /* ElementAccessExpression */) { return callee.expression; } } @@ -35690,53 +38775,56 @@ var ts; */ function getEffectiveCallArguments(node) { var args; - if (node.kind === 181 /* TaggedTemplateExpression */) { + if (node.kind === 182 /* TaggedTemplateExpression */) { var template = node.template; args = [undefined]; - if (template.kind === 194 /* TemplateExpression */) { + if (template.kind === 195 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); } } - else if (node.kind === 145 /* Decorator */) { + else if (node.kind === 146 /* Decorator */) { // For a decorator, we return undefined as we will determine // the number and types of arguments for a decorator using // `getEffectiveArgumentCount` and `getEffectiveArgumentType` below. return undefined; } + else if (ts.isJsxOpeningLikeElement(node)) { + args = node.attributes.properties.length > 0 ? [node.attributes] : emptyArray; + } else { args = node.arguments || emptyArray; } return args; } /** - * Returns the effective argument count for a node that works like a function invocation. - * If 'node' is a Decorator, the number of arguments is derived from the decoration - * target and the signature: - * If 'node.target' is a class declaration or class expression, the effective argument - * count is 1. - * If 'node.target' is a parameter declaration, the effective argument count is 3. - * If 'node.target' is a property declaration, the effective argument count is 2. - * If 'node.target' is a method or accessor declaration, the effective argument count - * is 3, although it can be 2 if the signature only accepts two arguments, allowing - * us to match a property decorator. - * Otherwise, the argument count is the length of the 'args' array. - */ + * Returns the effective argument count for a node that works like a function invocation. + * If 'node' is a Decorator, the number of arguments is derived from the decoration + * target and the signature: + * If 'node.target' is a class declaration or class expression, the effective argument + * count is 1. + * If 'node.target' is a parameter declaration, the effective argument count is 3. + * If 'node.target' is a property declaration, the effective argument count is 2. + * If 'node.target' is a method or accessor declaration, the effective argument count + * is 3, although it can be 2 if the signature only accepts two arguments, allowing + * us to match a property decorator. + * Otherwise, the argument count is the length of the 'args' array. + */ function getEffectiveArgumentCount(node, args, signature) { - if (node.kind === 145 /* Decorator */) { + if (node.kind === 146 /* Decorator */) { switch (node.parent.kind) { - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: // A class decorator will have one argument (see `ClassDecorator` in core.d.ts) return 1; - case 147 /* PropertyDeclaration */: + case 148 /* PropertyDeclaration */: // A property declaration decorator will have two arguments (see // `PropertyDecorator` in core.d.ts) return 2; - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts) // If we are emitting decorators for ES3, we will only pass two arguments. @@ -35746,7 +38834,7 @@ var ts; // If the method decorator signature only accepts a target and a key, we will only // type check those arguments. return signature.parameters.length >= 3 ? 3 : 2; - case 144 /* Parameter */: + case 145 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts) return 3; @@ -35757,38 +38845,38 @@ var ts; } } /** - * Returns the effective type of the first argument to a decorator. - * If 'node' is a class declaration or class expression, the effective argument type - * is the type of the static side of the class. - * If 'node' is a parameter declaration, the effective argument type is either the type - * of the static or instance side of the class for the parameter's parent method, - * depending on whether the method is declared static. - * For a constructor, the type is always the type of the static side of the class. - * If 'node' is a property, method, or accessor declaration, the effective argument - * type is the type of the static or instance side of the parent class for class - * element, depending on whether the element is declared static. - */ + * Returns the effective type of the first argument to a decorator. + * If 'node' is a class declaration or class expression, the effective argument type + * is the type of the static side of the class. + * If 'node' is a parameter declaration, the effective argument type is either the type + * of the static or instance side of the class for the parameter's parent method, + * depending on whether the method is declared static. + * For a constructor, the type is always the type of the static side of the class. + * If 'node' is a property, method, or accessor declaration, the effective argument + * type is the type of the static or instance side of the parent class for class + * element, depending on whether the element is declared static. + */ function getEffectiveDecoratorFirstArgumentType(node) { // The first argument to a decorator is its `target`. - if (node.kind === 226 /* ClassDeclaration */) { + if (node.kind === 228 /* ClassDeclaration */) { // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class) var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } - if (node.kind === 144 /* Parameter */) { + if (node.kind === 145 /* Parameter */) { // For a parameter decorator, the `target` is the parent type of the // parameter's containing method. node = node.parent; - if (node.kind === 150 /* Constructor */) { + if (node.kind === 151 /* Constructor */) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } } - if (node.kind === 147 /* PropertyDeclaration */ || - node.kind === 149 /* MethodDeclaration */ || - node.kind === 151 /* GetAccessor */ || - node.kind === 152 /* SetAccessor */) { + if (node.kind === 148 /* PropertyDeclaration */ || + node.kind === 150 /* MethodDeclaration */ || + node.kind === 152 /* GetAccessor */ || + node.kind === 153 /* SetAccessor */) { // For a property or method decorator, the `target` is the // "static"-side type of the parent of the member if the member is // declared "static"; otherwise, it is the "instance"-side type of the @@ -35799,37 +38887,39 @@ var ts; return unknownType; } /** - * Returns the effective type for the second argument to a decorator. - * If 'node' is a parameter, its effective argument type is one of the following: - * If 'node.parent' is a constructor, the effective argument type is 'any', as we - * will emit `undefined`. - * If 'node.parent' is a member with an identifier, numeric, or string literal name, - * the effective argument type will be a string literal type for the member name. - * If 'node.parent' is a computed property name, the effective argument type will - * either be a symbol type or the string type. - * If 'node' is a member with an identifier, numeric, or string literal name, the - * effective argument type will be a string literal type for the member name. - * If 'node' is a computed property name, the effective argument type will either - * be a symbol type or the string type. - * A class decorator does not have a second argument type. - */ + * Returns the effective type for the second argument to a decorator. + * If 'node' is a parameter, its effective argument type is one of the following: + * If 'node.parent' is a constructor, the effective argument type is 'any', as we + * will emit `undefined`. + * If 'node.parent' is a member with an identifier, numeric, or string literal name, + * the effective argument type will be a string literal type for the member name. + * If 'node.parent' is a computed property name, the effective argument type will + * either be a symbol type or the string type. + * If 'node' is a member with an identifier, numeric, or string literal name, the + * effective argument type will be a string literal type for the member name. + * If 'node' is a computed property name, the effective argument type will either + * be a symbol type or the string type. + * A class decorator does not have a second argument type. + */ function getEffectiveDecoratorSecondArgumentType(node) { // The second argument to a decorator is its `propertyKey` - if (node.kind === 226 /* ClassDeclaration */) { + if (node.kind === 228 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a second synthetic argument."); return unknownType; } - if (node.kind === 144 /* Parameter */) { + if (node.kind === 145 /* Parameter */) { node = node.parent; - if (node.kind === 150 /* Constructor */) { + if (node.kind === 151 /* Constructor */) { // For a constructor parameter decorator, the `propertyKey` will be `undefined`. return anyType; } + // For a non-constructor parameter decorator, the `propertyKey` will be either + // a string or a symbol, based on the name of the parameter's containing method. } - if (node.kind === 147 /* PropertyDeclaration */ || - node.kind === 149 /* MethodDeclaration */ || - node.kind === 151 /* GetAccessor */ || - node.kind === 152 /* SetAccessor */) { + if (node.kind === 148 /* PropertyDeclaration */ || + node.kind === 150 /* MethodDeclaration */ || + node.kind === 152 /* GetAccessor */ || + node.kind === 153 /* SetAccessor */) { // The `propertyKey` for a property or method decorator will be a // string literal type if the member name is an identifier, number, or string; // otherwise, if the member name is a computed property name it will @@ -35840,7 +38930,7 @@ var ts; case 8 /* NumericLiteral */: case 9 /* StringLiteral */: return getLiteralTypeForText(32 /* StringLiteral */, element.name.text); - case 142 /* ComputedPropertyName */: + case 143 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(element.name); if (isTypeOfKind(nameType, 512 /* ESSymbol */)) { return nameType; @@ -35857,30 +38947,30 @@ var ts; return unknownType; } /** - * Returns the effective argument type for the third argument to a decorator. - * If 'node' is a parameter, the effective argument type is the number type. - * If 'node' is a method or accessor, the effective argument type is a - * `TypedPropertyDescriptor` instantiated with the type of the member. - * Class and property decorators do not have a third effective argument. - */ + * Returns the effective argument type for the third argument to a decorator. + * If 'node' is a parameter, the effective argument type is the number type. + * If 'node' is a method or accessor, the effective argument type is a + * `TypedPropertyDescriptor` instantiated with the type of the member. + * Class and property decorators do not have a third effective argument. + */ function getEffectiveDecoratorThirdArgumentType(node) { // The third argument to a decorator is either its `descriptor` for a method decorator // or its `parameterIndex` for a parameter decorator - if (node.kind === 226 /* ClassDeclaration */) { + if (node.kind === 228 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 144 /* Parameter */) { + if (node.kind === 145 /* Parameter */) { // The `parameterIndex` for a parameter decorator is always a number return numberType; } - if (node.kind === 147 /* PropertyDeclaration */) { + if (node.kind === 148 /* PropertyDeclaration */) { ts.Debug.fail("Property decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 149 /* MethodDeclaration */ || - node.kind === 151 /* GetAccessor */ || - node.kind === 152 /* SetAccessor */) { + if (node.kind === 150 /* MethodDeclaration */ || + node.kind === 152 /* GetAccessor */ || + node.kind === 153 /* SetAccessor */) { // The `descriptor` for a method decorator will be a `TypedPropertyDescriptor` // for the type of the member. var propertyType = getTypeOfNode(node); @@ -35890,8 +38980,8 @@ var ts; return unknownType; } /** - * Returns the effective argument type for the provided argument to a decorator. - */ + * Returns the effective argument type for the provided argument to a decorator. + */ function getEffectiveDecoratorArgumentType(node, argIndex) { if (argIndex === 0) { return getEffectiveDecoratorFirstArgumentType(node.parent); @@ -35906,16 +38996,16 @@ var ts; return unknownType; } /** - * Gets the effective argument type for an argument in a call expression. - */ + * Gets the effective argument type for an argument in a call expression. + */ function getEffectiveArgumentType(node, argIndex) { // Decorators provide special arguments, a tagged template expression provides // a special first argument, and string literals get string literal types // unless we're reporting errors - if (node.kind === 145 /* Decorator */) { + if (node.kind === 146 /* Decorator */) { return getEffectiveDecoratorArgumentType(node, argIndex); } - else if (argIndex === 0 && node.kind === 181 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 182 /* TaggedTemplateExpression */) { return getGlobalTemplateStringsArrayType(); } // This is not a synthetic argument, so we return 'undefined' @@ -35923,25 +39013,25 @@ var ts; return undefined; } /** - * Gets the effective argument expression for an argument in a call expression. - */ + * Gets the effective argument expression for an argument in a call expression. + */ function getEffectiveArgument(node, args, argIndex) { // For a decorator or the first argument of a tagged template expression we return undefined. - if (node.kind === 145 /* Decorator */ || - (argIndex === 0 && node.kind === 181 /* TaggedTemplateExpression */)) { + if (node.kind === 146 /* Decorator */ || + (argIndex === 0 && node.kind === 182 /* TaggedTemplateExpression */)) { return undefined; } return args[argIndex]; } /** - * Gets the error node to use when reporting errors for an effective argument. - */ + * Gets the error node to use when reporting errors for an effective argument. + */ function getEffectiveArgumentErrorNode(node, argIndex, arg) { - if (node.kind === 145 /* Decorator */) { + if (node.kind === 146 /* Decorator */) { // For a decorator, we use the expression of the decorator for error reporting. return node.expression; } - else if (argIndex === 0 && node.kind === 181 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 182 /* TaggedTemplateExpression */) { // For a the first argument of a tagged template expression, we use the template of the tag for error reporting. return node.template; } @@ -35950,16 +39040,31 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray, headMessage) { - var isTaggedTemplate = node.kind === 181 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 145 /* Decorator */; + var isTaggedTemplate = node.kind === 182 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 146 /* Decorator */; + var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var typeArguments; - if (!isTaggedTemplate && !isDecorator) { + if (!isTaggedTemplate && !isDecorator && !isJsxOpeningOrSelfClosingElement) { typeArguments = node.typeArguments; // We already perform checking on the type arguments on the class declaration itself. if (node.expression.kind !== 96 /* SuperKeyword */) { ts.forEach(typeArguments, checkSourceElement); } } + if (signatures.length === 1) { + var declaration = signatures[0].declaration; + if (declaration && ts.isInJavaScriptFile(declaration) && !ts.hasJSDocParameterTags(declaration)) { + if (containsArgumentsReference(declaration)) { + var signatureWithRest = cloneSignature(signatures[0]); + var syntheticArgsSymbol = createSymbol(3 /* Variable */, "args"); + syntheticArgsSymbol.type = anyArrayType; + syntheticArgsSymbol.isRestParameter = true; + signatureWithRest.parameters = ts.concatenate(signatureWithRest.parameters, [syntheticArgsSymbol]); + signatureWithRest.hasRestParameter = true; + signatures = [signatureWithRest]; + } + } + } var candidates = candidatesOutArray || []; // reorderCandidates fills up the candidates array directly reorderCandidates(signatures, candidates); @@ -36022,7 +39127,7 @@ var ts; var result; // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. - var signatureHelpTrailingComma = candidatesOutArray && node.kind === 179 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = candidatesOutArray && node.kind === 180 /* CallExpression */ && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument // expression is a subtype of each corresponding parameter type, the return type of the first @@ -36051,6 +39156,10 @@ var ts; // If candidate is undefined, it means that no candidates had a suitable arity. In that case, // skip the checkApplicableSignature check. if (candidateForArgumentError) { + if (isJsxOpeningOrSelfClosingElement) { + // We do not report any error here because any error will be handled in "resolveCustomJsxElementAttributesType". + return candidateForArgumentError; + } // excludeArgument is undefined, in this case also equivalent to [undefined, undefined, ...] // The importance of excludeArgument is to prevent us from typing function expression parameters // in arguments too early. If possible, we'd like to only type them once we know the correct @@ -36072,7 +39181,7 @@ var ts; if (headMessage) { diagnosticChainHead = ts.chainDiagnosticMessages(diagnosticChainHead, headMessage); } - reportNoCommonSupertypeError(inferenceCandidates, node.expression || node.tag, diagnosticChainHead); + reportNoCommonSupertypeError(inferenceCandidates, node.tagName || node.expression || node.tag, diagnosticChainHead); } } else { @@ -36113,20 +39222,20 @@ var ts; var candidate = void 0; var typeArgumentsAreValid = void 0; var inferenceContext = originalCandidate.typeParameters - ? createInferenceContext(originalCandidate, /*inferUnionTypes*/ false) + ? createInferenceContext(originalCandidate, /*inferUnionTypes*/ false, /*useAnyForNoInferences*/ ts.isInJavaScriptFile(node)) : undefined; while (true) { candidate = originalCandidate; if (candidate.typeParameters) { var typeArgumentTypes = void 0; if (typeArguments) { - typeArgumentTypes = ts.map(typeArguments, getTypeFromTypeNode); + typeArgumentTypes = fillMissingTypeArguments(ts.map(typeArguments, getTypeFromTypeNode), candidate.typeParameters, getMinTypeArgumentCount(candidate.typeParameters)); typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, /*reportErrors*/ false); } else { inferTypeArguments(node, candidate, args, excludeArgument, inferenceContext); - typeArgumentsAreValid = inferenceContext.failedTypeParameterIndex === undefined; typeArgumentTypes = inferenceContext.inferredTypes; + typeArgumentsAreValid = inferenceContext.failedTypeParameterIndex === undefined; } if (!typeArgumentsAreValid) { break; @@ -36136,7 +39245,7 @@ var ts; if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, /*reportErrors*/ false)) { break; } - var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; + var index = excludeArgument ? ts.indexOf(excludeArgument, /*value*/ true) : -1; if (index < 0) { return candidate; } @@ -36175,7 +39284,7 @@ var ts; // with the type arguments specified in the extends clause. var baseTypeNode = ts.getClassExtendsHeritageClauseElement(ts.getContainingClass(node)); if (baseTypeNode) { - var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments); + var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments, baseTypeNode); return resolveCall(node, baseConstructors, candidatesOutArray); } } @@ -36329,12 +39438,13 @@ var ts; if (containingClass) { var containingType = getTypeOfNode(containingClass); var baseTypes = getBaseTypes(containingType); - if (baseTypes.length) { + while (baseTypes.length) { var baseType = baseTypes[0]; if (modifiers & 16 /* Protected */ && baseType.symbol === declaration.parent.symbol) { return true; } + baseTypes = getBaseTypes(baseType); } } if (modifiers & 8 /* Private */) { @@ -36366,26 +39476,26 @@ var ts; return resolveCall(node, callSignatures, candidatesOutArray); } /** - * Gets the localized diagnostic head message to use for errors when resolving a decorator as a call expression. - */ + * Gets the localized diagnostic head message to use for errors when resolving a decorator as a call expression. + */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 144 /* Parameter */: + case 145 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 147 /* PropertyDeclaration */: + case 148 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; } } /** - * Resolves a decorator as if it were a call expression. - */ + * Resolves a decorator as if it were a call expression. + */ function resolveDecorator(node, candidatesOutArray) { var funcType = checkExpression(node.expression); var apparentType = getApparentType(funcType); @@ -36407,21 +39517,73 @@ var ts; } return resolveCall(node, callSignatures, candidatesOutArray, headMessage); } + /** + * This function is similar to getResolvedSignature but is exclusively for trying to resolve JSX stateless-function component. + * The main reason we have to use this function instead of getResolvedSignature because, the caller of this function will already check the type of openingLikeElement's tagName + * and pass the type as elementType. The elementType can not be a union (as such case should be handled by the caller of this function) + * Note: at this point, we are still not sure whether the opening-like element is a stateless function component or not. + * @param openingLikeElement an opening-like JSX element to try to resolve as JSX stateless function + * @param elementType an element type of the opneing-like element by checking opening-like element's tagname. + * @param candidatesOutArray an array of signature to be filled in by the function. It is passed by signature help in the language service; + * the function will fill it up with appropriate candidate signatures + */ + function getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, candidatesOutArray) { + ts.Debug.assert(!(elementType.flags & 65536 /* Union */)); + var callSignature = resolveStatelessJsxOpeningLikeElement(openingLikeElement, elementType, candidatesOutArray); + return callSignature; + } + /** + * Try treating a given opening-like element as stateless function component and resolve a tagName to a function signature. + * @param openingLikeElement an JSX opening-like element we want to try resolve its stateless function if possible + * @param elementType a type of the opening-like JSX element, a result of resolving tagName in opening-like element. + * @param candidatesOutArray an array of signature to be filled in by the function. It is passed by signature help in the language service; + * the function will fill it up with appropriate candidate signatures + * @return a resolved signature if we can find function matching function signature through resolve call or a first signature in the list of functions. + * otherwise return undefined if tag-name of the opening-like element doesn't have call signatures + */ + function resolveStatelessJsxOpeningLikeElement(openingLikeElement, elementType, candidatesOutArray) { + // If this function is called from language service, elementType can be a union type. This is not possible if the function is called from compiler (see: resolveCustomJsxElementAttributesType) + if (elementType.flags & 65536 /* Union */) { + var types = elementType.types; + var result = void 0; + for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { + var type = types_18[_i]; + result = result || resolveStatelessJsxOpeningLikeElement(openingLikeElement, type, candidatesOutArray); + } + return result; + } + var callSignatures = elementType && getSignaturesOfType(elementType, 0 /* Call */); + if (callSignatures && callSignatures.length > 0) { + var callSignature = void 0; + callSignature = resolveCall(openingLikeElement, callSignatures, candidatesOutArray); + return callSignature; + } + return undefined; + } function resolveSignature(node, candidatesOutArray) { switch (node.kind) { - case 179 /* CallExpression */: + case 180 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray); - case 180 /* NewExpression */: + case 181 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray); - case 181 /* TaggedTemplateExpression */: + case 182 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray); - case 145 /* Decorator */: + case 146 /* Decorator */: return resolveDecorator(node, candidatesOutArray); + case 250 /* JsxOpeningElement */: + case 249 /* JsxSelfClosingElement */: + // This code-path is called by language service + return resolveStatelessJsxOpeningLikeElement(node, checkExpression(node.tagName), candidatesOutArray); } ts.Debug.fail("Branch in 'resolveSignature' should be unreachable."); } - // candidatesOutArray is passed by signature help in the language service, and collectCandidates - // must fill it up with the appropriate candidate signatures + /** + * Resolve a signature of a given call-like expression. + * @param node a call-like expression to try resolve a signature for + * @param candidatesOutArray an array of signature to be filled in by the function. It is passed by signature help in the language service; + * the function will fill it up with appropriate candidate signatures + * @return a signature of the call-like expression or undefined if one can't be found + */ function getResolvedSignature(node, candidatesOutArray) { var links = getNodeLinks(node); // If getResolvedSignature has already been called, we will have cached the resolvedSignature. @@ -36464,12 +39626,12 @@ var ts; if (node.expression.kind === 96 /* SuperKeyword */) { return voidType; } - if (node.kind === 180 /* NewExpression */) { + if (node.kind === 181 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 150 /* Constructor */ && - declaration.kind !== 154 /* ConstructSignature */ && - declaration.kind !== 159 /* ConstructorType */ && + declaration.kind !== 151 /* Constructor */ && + declaration.kind !== 155 /* ConstructSignature */ && + declaration.kind !== 160 /* ConstructorType */ && !ts.isJSDocConstructSignature(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any, unless // the declaring function had members created through 'x.prototype.y = expr' or 'this.y = expr' psuedodeclarations @@ -36479,10 +39641,13 @@ var ts; var funcSymbol = node.expression.kind === 70 /* Identifier */ ? getResolvedSymbol(node.expression) : checkExpression(node.expression).symbol; - if (funcSymbol && funcSymbol.members && (funcSymbol.flags & 16 /* Function */ || ts.isDeclarationOfFunctionExpression(funcSymbol))) { + if (funcSymbol && ts.isDeclarationOfFunctionOrClassExpression(funcSymbol)) { + funcSymbol = getSymbolOfNode(funcSymbol.valueDeclaration.initializer); + } + if (funcSymbol && funcSymbol.members && funcSymbol.flags & 16 /* Function */) { return getInferredClassType(funcSymbol); } - else if (compilerOptions.noImplicitAny) { + else if (noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } return anyType; @@ -36509,9 +39674,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 225 /* FunctionDeclaration */ + ? 227 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 223 /* VariableDeclaration */ + ? 225 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -36538,6 +39703,22 @@ var ts; function checkNonNullAssertion(node) { return getNonNullableType(checkExpression(node.expression)); } + function checkMetaProperty(node) { + checkGrammarMetaProperty(node); + var container = ts.getNewTargetContainer(node); + if (!container) { + error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); + return unknownType; + } + else if (container.kind === 151 /* Constructor */) { + var symbol = getSymbolOfNode(container.parent); + return getTypeOfSymbol(symbol); + } + else { + var symbol = getSymbolOfNode(container); + return getTypeOfSymbol(symbol); + } + } function getTypeOfParameter(symbol) { var type = getTypeOfSymbol(symbol); if (strictNullChecks) { @@ -36553,13 +39734,16 @@ var ts; pos < signature.parameters.length - 1 ? getTypeOfParameter(signature.parameters[pos]) : getRestTypeOfSignature(signature) : pos < signature.parameters.length ? getTypeOfParameter(signature.parameters[pos]) : anyType; } - function assignContextualParameterTypes(signature, context, mapper) { + function getTypeOfFirstParameterOfSignature(signature) { + return signature.parameters.length > 0 ? getTypeAtPosition(signature, 0) : neverType; + } + function assignContextualParameterTypes(signature, context, mapper, checkMode) { var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0); - if (isInferentialContext(mapper)) { + if (checkMode === 2 /* Inferential */) { for (var i = 0; i < len; i++) { var declaration = signature.parameters[i].valueDeclaration; if (declaration.type) { - inferTypes(mapper.context, getTypeFromTypeNode(declaration.type), getTypeAtPosition(context, i)); + inferTypesWithContext(mapper.context, getTypeFromTypeNode(declaration.type), getTypeAtPosition(context, i)); } } } @@ -36567,23 +39751,23 @@ var ts; var parameter = signature.thisParameter; if (!parameter || parameter.valueDeclaration && !parameter.valueDeclaration.type) { if (!parameter) { - signature.thisParameter = createTransientSymbol(context.thisParameter, undefined); + signature.thisParameter = createSymbolWithType(context.thisParameter, /*type*/ undefined); } - assignTypeToParameterAndFixTypeParameters(signature.thisParameter, getTypeOfSymbol(context.thisParameter), mapper); + assignTypeToParameterAndFixTypeParameters(signature.thisParameter, getTypeOfSymbol(context.thisParameter), mapper, checkMode); } } for (var i = 0; i < len; i++) { var parameter = signature.parameters[i]; if (!parameter.valueDeclaration.type) { var contextualParameterType = getTypeAtPosition(context, i); - assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper); + assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper, checkMode); } } if (signature.hasRestParameter && isRestParameterIndex(context, signature.parameters.length - 1)) { var parameter = ts.lastOrUndefined(signature.parameters); if (!parameter.valueDeclaration.type) { var contextualParameterType = getTypeOfSymbol(ts.lastOrUndefined(context.parameters)); - assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper); + assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper, checkMode); } } } @@ -36602,19 +39786,19 @@ var ts; } } } - function assignTypeToParameterAndFixTypeParameters(parameter, contextualType, mapper) { + function assignTypeToParameterAndFixTypeParameters(parameter, contextualType, mapper, checkMode) { var links = getSymbolLinks(parameter); if (!links.type) { links.type = instantiateType(contextualType, mapper); // if inference didn't come up with anything but {}, fall back to the binding pattern if present. if (links.type === emptyObjectType && - (parameter.valueDeclaration.name.kind === 172 /* ObjectBindingPattern */ || - parameter.valueDeclaration.name.kind === 173 /* ArrayBindingPattern */)) { + (parameter.valueDeclaration.name.kind === 173 /* ObjectBindingPattern */ || + parameter.valueDeclaration.name.kind === 174 /* ArrayBindingPattern */)) { links.type = getTypeFromBindingPattern(parameter.valueDeclaration.name); } assignBindingElementTypes(parameter.valueDeclaration); } - else if (isInferentialContext(mapper)) { + else if (checkMode === 2 /* Inferential */) { // Even if the parameter already has a type, it might be because it was given a type while // processing the function as an argument to a prior signature during overload resolution. // If this was the case, it may have caused some type parameters to be fixed. So here, @@ -36644,7 +39828,7 @@ var ts; // T in the second overload so that we do not infer Base as a candidate for T // (inferring Base would make type argument inference inconsistent between the two // overloads). - inferTypes(mapper.context, links.type, instantiateType(contextualType, mapper)); + inferTypesWithContext(mapper.context, links.type, instantiateType(contextualType, mapper)); } } function getReturnTypeFromJSDocComment(func) { @@ -36656,10 +39840,10 @@ var ts; } function createPromiseType(promisedType) { // creates a `Promise` type where `T` is the promisedType argument - var globalPromiseType = getGlobalPromiseType(); + var globalPromiseType = getGlobalPromiseType(/*reportErrors*/ true); if (globalPromiseType !== emptyGenericType) { // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type - promisedType = getAwaitedType(promisedType); + promisedType = getAwaitedType(promisedType) || emptyObjectType; return createTypeReference(globalPromiseType, [promisedType]); } return emptyObjectType; @@ -36670,53 +39854,63 @@ var ts; error(func, ts.Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option); return unknownType; } + else if (!getGlobalPromiseConstructorSymbol(/*reportErrors*/ true)) { + error(func, ts.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option); + } return promiseType; } - function getReturnTypeFromBody(func, contextualMapper) { + function getReturnTypeFromBody(func, checkMode) { var contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func); if (!func.body) { return unknownType; } - var isAsync = ts.isAsyncFunctionLike(func); + var functionFlags = ts.getFunctionFlags(func); var type; - if (func.body.kind !== 204 /* Block */) { - type = checkExpressionCached(func.body, contextualMapper); - if (isAsync) { + if (func.body.kind !== 206 /* Block */) { + type = checkExpressionCached(func.body, checkMode); + if (functionFlags & 2 /* Async */) { // From within an async function you can return either a non-promise value or a promise. Any // Promise/A+ compatible implementation will always assimilate any foreign promise, so the // return type of the body should be unwrapped to its awaited type, which we will wrap in // the native Promise type later in this function. - type = checkAwaitedType(type, func, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); + type = checkAwaitedType(type, /*errorNode*/ func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } } else { var types = void 0; - var funcIsGenerator = !!func.asteriskToken; - if (funcIsGenerator) { - types = checkAndAggregateYieldOperandTypes(func, contextualMapper); - if (types.length === 0) { - var iterableIteratorAny = createIterableIteratorType(anyType); - if (compilerOptions.noImplicitAny) { + if (functionFlags & 1 /* Generator */) { + types = ts.concatenate(checkAndAggregateYieldOperandTypes(func, checkMode), checkAndAggregateReturnExpressionTypes(func, checkMode)); + if (!types || types.length === 0) { + var iterableIteratorAny = functionFlags & 2 /* Async */ + ? createAsyncIterableIteratorType(anyType) // AsyncGenerator function + : createIterableIteratorType(anyType); // Generator function + if (noImplicitAny) { error(func.asteriskToken, ts.Diagnostics.Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type, typeToString(iterableIteratorAny)); } return iterableIteratorAny; } } else { - types = checkAndAggregateReturnExpressionTypes(func, contextualMapper); + types = checkAndAggregateReturnExpressionTypes(func, checkMode); if (!types) { // For an async function, the return type will not be never, but rather a Promise for never. - return isAsync ? createPromiseReturnType(func, neverType) : neverType; + return functionFlags & 2 /* Async */ + ? createPromiseReturnType(func, neverType) // Async function + : neverType; // Normal function } if (types.length === 0) { // For an async function, the return type will not be void, but rather a Promise for void. - return isAsync ? createPromiseReturnType(func, voidType) : voidType; + return functionFlags & 2 /* Async */ + ? createPromiseReturnType(func, voidType) // Async function + : voidType; // Normal function } } // Return a union of the return expression types. type = getUnionType(types, /*subtypeReduction*/ true); - if (funcIsGenerator) { - type = createIterableIteratorType(type); + if (functionFlags & 1 /* Generator */) { + type = functionFlags & 2 /* Async */ + ? createAsyncIterableIteratorType(type) // AsyncGenerator function + : createIterableIteratorType(type); // Generator function } } if (!contextualSignature) { @@ -36731,17 +39925,25 @@ var ts; // From within an async function you can return either a non-promise value or a promise. Any // Promise/A+ compatible implementation will always assimilate any foreign promise, so the // return type of the body is awaited type of the body, wrapped in a native Promise type. - return isAsync ? createPromiseReturnType(func, widenedType) : widenedType; + return (functionFlags & 3 /* AsyncOrAsyncGenerator */) === 2 /* Async */ + ? createPromiseReturnType(func, widenedType) // Async function + : widenedType; // Generator function, AsyncGenerator function, or normal function } - function checkAndAggregateYieldOperandTypes(func, contextualMapper) { + function checkAndAggregateYieldOperandTypes(func, checkMode) { var aggregatedTypes = []; + var functionFlags = ts.getFunctionFlags(func); ts.forEachYieldExpression(func.body, function (yieldExpression) { var expr = yieldExpression.expression; if (expr) { - var type = checkExpressionCached(expr, contextualMapper); + var type = checkExpressionCached(expr, checkMode); if (yieldExpression.asteriskToken) { // A yield* expression effectively yields everything that its operand yields - type = checkElementTypeOfIterable(type, yieldExpression.expression); + type = checkIteratedTypeOrElementType(type, yieldExpression.expression, /*allowStringInput*/ false, (functionFlags & 2 /* Async */) !== 0); + } + if (functionFlags & 2 /* Async */) { + type = checkAwaitedType(type, expr, yieldExpression.asteriskToken + ? ts.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + : ts.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } if (!ts.contains(aggregatedTypes, type)) { aggregatedTypes.push(type); @@ -36762,33 +39964,33 @@ var ts; if (!switchTypes.length) { return false; } - return eachTypeContainedIn(type, switchTypes); + return eachTypeContainedIn(mapType(type, getRegularTypeOfLiteralType), switchTypes); } function functionHasImplicitReturn(func) { if (!(func.flags & 128 /* HasImplicitReturn */)) { return false; } var lastStatement = ts.lastOrUndefined(func.body.statements); - if (lastStatement && lastStatement.kind === 218 /* SwitchStatement */ && isExhaustiveSwitchStatement(lastStatement)) { + if (lastStatement && lastStatement.kind === 220 /* SwitchStatement */ && isExhaustiveSwitchStatement(lastStatement)) { return false; } return true; } - function checkAndAggregateReturnExpressionTypes(func, contextualMapper) { - var isAsync = ts.isAsyncFunctionLike(func); + function checkAndAggregateReturnExpressionTypes(func, checkMode) { + var functionFlags = ts.getFunctionFlags(func); var aggregatedTypes = []; var hasReturnWithNoExpression = functionHasImplicitReturn(func); var hasReturnOfTypeNever = false; ts.forEachReturnStatement(func.body, function (returnStatement) { var expr = returnStatement.expression; if (expr) { - var type = checkExpressionCached(expr, contextualMapper); - if (isAsync) { + var type = checkExpressionCached(expr, checkMode); + if (functionFlags & 2 /* Async */) { // From within an async function you can return either a non-promise value or a promise. Any // Promise/A+ compatible implementation will always assimilate any foreign promise, so the // return type of the body should be unwrapped to its awaited type, which should be wrapped in // the native Promise type by the caller. - type = checkAwaitedType(type, func, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); + type = checkAwaitedType(type, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } if (type.flags & 8192 /* Never */) { hasReturnOfTypeNever = true; @@ -36802,7 +40004,7 @@ var ts; } }); if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever || - func.kind === 184 /* FunctionExpression */ || func.kind === 185 /* ArrowFunction */)) { + func.kind === 185 /* FunctionExpression */ || func.kind === 186 /* ArrowFunction */)) { return undefined; } if (strictNullChecks && aggregatedTypes.length && hasReturnWithNoExpression) { @@ -36831,7 +40033,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (ts.nodeIsMissing(func.body) || func.body.kind !== 204 /* Block */ || !functionHasImplicitReturn(func)) { + if (ts.nodeIsMissing(func.body) || func.body.kind !== 206 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 256 /* HasExplicitReturn */; @@ -36863,22 +40065,22 @@ var ts; error(func.type || func, ts.Diagnostics.Not_all_code_paths_return_a_value); } } - function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) { - ts.Debug.assert(node.kind !== 149 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { + ts.Debug.assert(node.kind !== 150 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 184 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 185 /* FunctionExpression */) { checkGrammarForGenerator(node); } // The identityMapper object is used to indicate that function expressions are wildcards - if (contextualMapper === identityMapper && isContextSensitive(node)) { + if (checkMode === 1 /* SkipContextSensitive */ && isContextSensitive(node)) { checkNodeDeferred(node); return anyFunctionType; } var links = getNodeLinks(node); var type = getTypeOfSymbol(node.symbol); var contextSensitive = isContextSensitive(node); - var mightFixTypeParameters = contextSensitive && isInferentialContext(contextualMapper); + var mightFixTypeParameters = contextSensitive && checkMode === 2 /* Inferential */; // Check if function expression is contextually typed and assign parameter types if so. // See the comment in assignTypeToParameterAndFixTypeParameters to understand why we need to // check mightFixTypeParameters. @@ -36893,10 +40095,10 @@ var ts; if (contextualSignature) { var signature = getSignaturesOfType(type, 0 /* Call */)[0]; if (contextSensitive) { - assignContextualParameterTypes(signature, contextualSignature, contextualMapper || identityMapper); + assignContextualParameterTypes(signature, contextualSignature, getContextualMapper(node), checkMode); } if (mightFixTypeParameters || !node.type && !signature.resolvedReturnType) { - var returnType = getReturnTypeFromBody(node, contextualMapper); + var returnType = getReturnTypeFromBody(node, checkMode); if (!signature.resolvedReturnType) { signature.resolvedReturnType = returnType; } @@ -36908,17 +40110,21 @@ var ts; } } } - if (produceDiagnostics && node.kind !== 149 /* MethodDeclaration */) { + if (produceDiagnostics && node.kind !== 150 /* MethodDeclaration */) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); } return type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 149 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); - var isAsync = ts.isAsyncFunctionLike(node); - var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); - if (!node.asteriskToken) { + ts.Debug.assert(node.kind !== 150 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + var functionFlags = ts.getFunctionFlags(node); + var returnOrPromisedType = node.type && + ((functionFlags & 3 /* AsyncOrAsyncGenerator */) === 2 /* Async */ ? + checkAsyncFunctionReturnType(node) : + getTypeFromTypeNode(node.type)); // AsyncGenerator function, Generator function, or normal function + if ((functionFlags & 1 /* Generator */) === 0) { // return is not necessary in the body of generators checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } @@ -36931,7 +40137,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 204 /* Block */) { + if (node.body.kind === 206 /* Block */) { checkSourceElement(node.body); } else { @@ -36942,8 +40148,8 @@ var ts; // its return type annotation. var exprType = checkExpression(node.body); if (returnOrPromisedType) { - if (isAsync) { - var awaitedType = checkAwaitedType(exprType, node.body, ts.Diagnostics.Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member); + if ((functionFlags & 3 /* AsyncOrAsyncGenerator */) === 2 /* Async */) { + var awaitedType = checkAwaitedType(exprType, node.body, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); checkTypeAssignableTo(awaitedType, returnOrPromisedType, node.body); } else { @@ -36968,21 +40174,21 @@ var ts; // Get accessors without matching set accessors // Enum members // Unions and intersections of the above (unions and intersections eagerly set isReadonly on creation) - return symbol.isReadonly || - symbol.flags & 4 /* Property */ && (getDeclarationModifierFlagsFromSymbol(symbol) & 64 /* Readonly */) !== 0 || - symbol.flags & 3 /* Variable */ && (getDeclarationNodeFlagsFromSymbol(symbol) & 2 /* Const */) !== 0 || + return !!(getCheckFlags(symbol) & 8 /* Readonly */ || + symbol.flags & 4 /* Property */ && getDeclarationModifierFlagsFromSymbol(symbol) & 64 /* Readonly */ || + symbol.flags & 3 /* Variable */ && getDeclarationNodeFlagsFromSymbol(symbol) & 2 /* Const */ || symbol.flags & 98304 /* Accessor */ && !(symbol.flags & 65536 /* SetAccessor */) || - (symbol.flags & 8 /* EnumMember */) !== 0; + symbol.flags & 8 /* EnumMember */); } function isReferenceToReadonlyEntity(expr, symbol) { if (isReadonlySymbol(symbol)) { // Allow assignments to readonly properties within constructors of the same class declaration. if (symbol.flags & 4 /* Property */ && - (expr.kind === 177 /* PropertyAccessExpression */ || expr.kind === 178 /* ElementAccessExpression */) && + (expr.kind === 178 /* PropertyAccessExpression */ || expr.kind === 179 /* ElementAccessExpression */) && expr.expression.kind === 98 /* ThisKeyword */) { // Look for if this is the constructor for the class that `symbol` is a property of. var func = ts.getContainingFunction(expr); - if (!(func && func.kind === 150 /* Constructor */)) + if (!(func && func.kind === 151 /* Constructor */)) return true; // If func.parent is a class and symbol is a (readonly) property of that class, or // if func is a constructor and symbol is a (readonly) parameter property declared in it, @@ -36994,13 +40200,13 @@ var ts; return false; } function isReferenceThroughNamespaceImport(expr) { - if (expr.kind === 177 /* PropertyAccessExpression */ || expr.kind === 178 /* ElementAccessExpression */) { + if (expr.kind === 178 /* PropertyAccessExpression */ || expr.kind === 179 /* ElementAccessExpression */) { var node = ts.skipParentheses(expr.expression); if (node.kind === 70 /* Identifier */) { var symbol = getNodeLinks(node).resolvedSymbol; if (symbol.flags & 8388608 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol); - return declaration && declaration.kind === 237 /* NamespaceImport */; + return declaration && declaration.kind === 239 /* NamespaceImport */; } } } @@ -37009,7 +40215,7 @@ var ts; function checkReferenceExpression(expr, invalidReferenceMessage) { // References are combinations of identifiers, parentheses, and property accesses. var node = ts.skipParentheses(expr); - if (node.kind !== 70 /* Identifier */ && node.kind !== 177 /* PropertyAccessExpression */ && node.kind !== 178 /* ElementAccessExpression */) { + if (node.kind !== 70 /* Identifier */ && node.kind !== 178 /* PropertyAccessExpression */ && node.kind !== 179 /* ElementAccessExpression */) { error(expr, invalidReferenceMessage); return false; } @@ -37017,11 +40223,21 @@ var ts; } function checkDeleteExpression(node) { checkExpression(node.expression); + var expr = ts.skipParentheses(node.expression); + if (expr.kind !== 178 /* PropertyAccessExpression */ && expr.kind !== 179 /* ElementAccessExpression */) { + error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); + return booleanType; + } + var links = getNodeLinks(expr); + var symbol = getExportSymbolOfValueSymbolIfExported(links.resolvedSymbol); + if (symbol && isReadonlySymbol(symbol)) { + error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_read_only_property); + } return booleanType; } function checkTypeOfExpression(node) { checkExpression(node.expression); - return stringType; + return typeofType; } function checkVoidExpression(node) { checkExpression(node.expression); @@ -37030,7 +40246,7 @@ var ts; function checkAwaitExpression(node) { // Grammar checking if (produceDiagnostics) { - if (!(node.flags & 524288 /* AwaitContext */)) { + if (!(node.flags & 16384 /* AwaitContext */)) { grammarErrorOnFirstToken(node, ts.Diagnostics.await_expression_is_only_allowed_within_an_async_function); } if (isInParameterInitializerBeforeContainingFunction(node)) { @@ -37038,7 +40254,7 @@ var ts; } } var operandType = checkExpression(node.expression); - return checkAwaitedType(operandType, node); + return checkAwaitedType(operandType, node, ts.Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } function checkPrefixUnaryExpression(node) { var operandType = checkExpression(node.operand); @@ -37052,6 +40268,7 @@ var ts; case 36 /* PlusToken */: case 37 /* MinusToken */: case 51 /* TildeToken */: + checkNonNullType(operandType, node.operand); if (maybeTypeOfKind(operandType, 512 /* ESSymbol */)) { error(node.operand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(node.operator)); } @@ -37063,7 +40280,7 @@ var ts; booleanType; case 42 /* PlusPlusToken */: case 43 /* MinusMinusToken */: - var ok = checkArithmeticOperandType(node.operand, getNonNullableType(operandType), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); + var ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { // run check only if former checks succeeded to avoid reporting cascading errors checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access); @@ -37077,7 +40294,7 @@ var ts; if (operandType === silentNeverType) { return silentNeverType; } - var ok = checkArithmeticOperandType(node.operand, getNonNullableType(operandType), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); + var ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { // run check only if former checks succeeded to avoid reporting cascading errors checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access); @@ -37092,8 +40309,8 @@ var ts; } if (type.flags & 196608 /* UnionOrIntersection */) { var types = type.types; - for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { - var t = types_15[_i]; + for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { + var t = types_19[_i]; if (maybeTypeOfKind(t, kind)) { return true; } @@ -37110,8 +40327,8 @@ var ts; } if (type.flags & 65536 /* Union */) { var types = type.types; - for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { - var t = types_16[_i]; + for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { + var t = types_20[_i]; if (!isTypeOfKind(t, kind)) { return false; } @@ -37120,8 +40337,8 @@ var ts; } if (type.flags & 131072 /* Intersection */) { var types = type.types; - for (var _a = 0, types_17 = types; _a < types_17.length; _a++) { - var t = types_17[_a]; + for (var _a = 0, types_21 = types; _a < types_21.length; _a++) { + var t = types_21[_a]; if (isTypeOfKind(t, kind)) { return true; } @@ -37141,14 +40358,17 @@ var ts; } // TypeScript 1.0 spec (April 2014): 4.15.4 // The instanceof operator requires the left operand to be of type Any, an object type, or a type parameter type, - // and the right operand to be of type Any or a subtype of the 'Function' interface type. + // and the right operand to be of type Any, a subtype of the 'Function' interface type, or have a call or construct signature. // The result is always of the Boolean primitive type. // NOTE: do not raise error if leftType is unknown as related error was already reported if (isTypeOfKind(leftType, 8190 /* Primitive */)) { error(left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } // NOTE: do not raise error if right is unknown as related error was already reported - if (!(isTypeAny(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) { + if (!(isTypeAny(rightType) || + getSignaturesOfType(rightType, 0 /* Call */).length || + getSignaturesOfType(rightType, 1 /* Construct */).length || + isTypeSubtypeOf(rightType, globalFunctionType))) { error(right, ts.Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); } return booleanType; @@ -37157,6 +40377,8 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } + leftType = checkNonNullType(leftType, left); + rightType = checkNonNullType(rightType, right); // TypeScript 1.0 spec (April 2014): 4.15.5 // The in operator requires the left operand to be of type Any, the String primitive type, or the Number primitive type, // and the right operand to be of type Any, an object type, or a type parameter type. @@ -37164,37 +40386,37 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeOfKind(leftType, 340 /* NumberLike */ | 512 /* ESSymbol */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 /* Object */ | 16384 /* TypeParameter */ | 524288 /* IndexedAccess */)) { + if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 /* Object */ | 540672 /* TypeVariable */ | 16777216 /* NonPrimitive */)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; } function checkObjectLiteralAssignment(node, sourceType) { var properties = node.properties; - for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) { - var p = properties_5[_i]; + for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) { + var p = properties_7[_i]; checkObjectLiteralDestructuringPropertyAssignment(sourceType, p, properties); } return sourceType; } /** Note: If property cannot be a SpreadAssignment, then allProperties does not need to be provided */ function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property, allProperties) { - if (property.kind === 257 /* PropertyAssignment */ || property.kind === 258 /* ShorthandPropertyAssignment */) { - var name_20 = property.name; - if (name_20.kind === 142 /* ComputedPropertyName */) { - checkComputedPropertyName(name_20); + if (property.kind === 260 /* PropertyAssignment */ || property.kind === 261 /* ShorthandPropertyAssignment */) { + var name = property.name; + if (name.kind === 143 /* ComputedPropertyName */) { + checkComputedPropertyName(name); } - if (isComputedNonLiteralName(name_20)) { + if (isComputedNonLiteralName(name)) { return undefined; } - var text = ts.getTextOfPropertyName(name_20); + var text = ts.getTextOfPropertyName(name); var type = isTypeAny(objectLiteralType) ? objectLiteralType : getTypeOfPropertyOfType(objectLiteralType, text) || isNumericLiteralName(text) && getIndexTypeOfType(objectLiteralType, 1 /* Number */) || getIndexTypeOfType(objectLiteralType, 0 /* String */); if (type) { - if (property.kind === 258 /* ShorthandPropertyAssignment */) { + if (property.kind === 261 /* ShorthandPropertyAssignment */) { return checkDestructuringAssignment(property, type); } else { @@ -37203,10 +40425,13 @@ var ts; } } else { - error(name_20, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name_20)); + error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name)); } } - else if (property.kind === 259 /* SpreadAssignment */) { + else if (property.kind === 262 /* SpreadAssignment */) { + if (languageVersion < 5 /* ESNext */) { + checkExternalEmitHelpers(property, 4 /* Rest */); + } var nonRestNames = []; if (allProperties) { for (var i = 0; i < allProperties.length - 1; i++) { @@ -37220,22 +40445,25 @@ var ts; error(property, ts.Diagnostics.Property_assignment_expected); } } - function checkArrayLiteralAssignment(node, sourceType, contextualMapper) { + function checkArrayLiteralAssignment(node, sourceType, checkMode) { + if (languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 512 /* Read */); + } // This elementType will be used if the specific property corresponding to this index is not // present (aka the tuple element property). This call also checks that the parentType is in // fact an iterable or array (depending on target language). - var elementType = checkIteratedTypeOrElementType(sourceType, node, /*allowStringInput*/ false) || unknownType; + var elementType = checkIteratedTypeOrElementType(sourceType, node, /*allowStringInput*/ false, /*allowAsyncIterable*/ false) || unknownType; var elements = node.elements; for (var i = 0; i < elements.length; i++) { - checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, elementType, contextualMapper); + checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, elementType, checkMode); } return sourceType; } - function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, contextualMapper) { + function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 198 /* OmittedExpression */) { - if (element.kind !== 196 /* SpreadElement */) { + if (element.kind !== 199 /* OmittedExpression */) { + if (element.kind !== 197 /* SpreadElement */) { var propName = "" + elementIndex; var type = isTypeAny(sourceType) ? sourceType @@ -37243,7 +40471,7 @@ var ts; ? getTypeOfPropertyOfType(sourceType, propName) : elementType; if (type) { - return checkDestructuringAssignment(element, type, contextualMapper); + return checkDestructuringAssignment(element, type, checkMode); } else { // We still need to check element expression here because we may need to set appropriate flag on the expression @@ -37263,20 +40491,20 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 192 /* BinaryExpression */ && restExpression.operatorToken.kind === 57 /* EqualsToken */) { + if (restExpression.kind === 193 /* BinaryExpression */ && restExpression.operatorToken.kind === 57 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { - return checkDestructuringAssignment(restExpression, createArrayType(elementType), contextualMapper); + return checkDestructuringAssignment(restExpression, createArrayType(elementType), checkMode); } } } } return undefined; } - function checkDestructuringAssignment(exprOrAssignment, sourceType, contextualMapper) { + function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode) { var target; - if (exprOrAssignment.kind === 258 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 261 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -37285,28 +40513,28 @@ var ts; !(getFalsyFlags(checkExpression(prop.objectAssignmentInitializer)) & 2048 /* Undefined */)) { sourceType = getTypeWithFacts(sourceType, 131072 /* NEUndefined */); } - checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, contextualMapper); + checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode); } target = exprOrAssignment.name; } else { target = exprOrAssignment; } - if (target.kind === 192 /* BinaryExpression */ && target.operatorToken.kind === 57 /* EqualsToken */) { - checkBinaryExpression(target, contextualMapper); + if (target.kind === 193 /* BinaryExpression */ && target.operatorToken.kind === 57 /* EqualsToken */) { + checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 176 /* ObjectLiteralExpression */) { + if (target.kind === 177 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType); } - if (target.kind === 175 /* ArrayLiteralExpression */) { - return checkArrayLiteralAssignment(target, sourceType, contextualMapper); + if (target.kind === 176 /* ArrayLiteralExpression */) { + return checkArrayLiteralAssignment(target, sourceType, checkMode); } - return checkReferenceAssignment(target, sourceType, contextualMapper); + return checkReferenceAssignment(target, sourceType, checkMode); } - function checkReferenceAssignment(target, sourceType, contextualMapper) { - var targetType = checkExpression(target, contextualMapper); - var error = target.parent.kind === 259 /* SpreadAssignment */ ? + function checkReferenceAssignment(target, sourceType, checkMode) { + var targetType = checkExpression(target, checkMode); + var error = target.parent.kind === 262 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; if (checkReferenceExpression(target, error)) { @@ -37328,35 +40556,35 @@ var ts; case 70 /* Identifier */: case 9 /* StringLiteral */: case 11 /* RegularExpressionLiteral */: - case 181 /* TaggedTemplateExpression */: - case 194 /* TemplateExpression */: + case 182 /* TaggedTemplateExpression */: + case 195 /* TemplateExpression */: case 12 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 100 /* TrueKeyword */: case 85 /* FalseKeyword */: case 94 /* NullKeyword */: - case 137 /* UndefinedKeyword */: - case 184 /* FunctionExpression */: - case 197 /* ClassExpression */: - case 185 /* ArrowFunction */: - case 175 /* ArrayLiteralExpression */: - case 176 /* ObjectLiteralExpression */: - case 187 /* TypeOfExpression */: - case 201 /* NonNullExpression */: - case 247 /* JsxSelfClosingElement */: - case 246 /* JsxElement */: + case 138 /* UndefinedKeyword */: + case 185 /* FunctionExpression */: + case 198 /* ClassExpression */: + case 186 /* ArrowFunction */: + case 176 /* ArrayLiteralExpression */: + case 177 /* ObjectLiteralExpression */: + case 188 /* TypeOfExpression */: + case 202 /* NonNullExpression */: + case 249 /* JsxSelfClosingElement */: + case 248 /* JsxElement */: return true; - case 193 /* ConditionalExpression */: + case 194 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 190 /* PrefixUnaryExpression */: - case 191 /* PostfixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { @@ -37368,9 +40596,9 @@ var ts; } return false; // Some forms listed here for clarity - case 188 /* VoidExpression */: // Explicit opt-out - case 182 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 200 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 189 /* VoidExpression */: // Explicit opt-out + case 183 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 201 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -37385,16 +40613,16 @@ var ts; firstAssignableToSecond && !secondAssignableToFirst ? type2 : getUnionType([type1, type2], /*subtypeReduction*/ true); } - function checkBinaryExpression(node, contextualMapper) { - return checkBinaryLikeExpression(node.left, node.operatorToken, node.right, contextualMapper, node); + function checkBinaryExpression(node, checkMode) { + return checkBinaryLikeExpression(node.left, node.operatorToken, node.right, checkMode, node); } - function checkBinaryLikeExpression(left, operatorToken, right, contextualMapper, errorNode) { + function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 57 /* EqualsToken */ && (left.kind === 176 /* ObjectLiteralExpression */ || left.kind === 175 /* ArrayLiteralExpression */)) { - return checkDestructuringAssignment(left, checkExpression(right, contextualMapper), contextualMapper); + if (operator === 57 /* EqualsToken */ && (left.kind === 177 /* ObjectLiteralExpression */ || left.kind === 176 /* ArrayLiteralExpression */)) { + return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode); } - var leftType = checkExpression(left, contextualMapper); - var rightType = checkExpression(right, contextualMapper); + var leftType = checkExpression(left, checkMode); + var rightType = checkExpression(right, checkMode); switch (operator) { case 38 /* AsteriskToken */: case 39 /* AsteriskAsteriskToken */: @@ -37421,18 +40649,8 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - // TypeScript 1.0 spec (April 2014): 4.19.1 - // These operators require their operands to be of type Any, the Number primitive type, - // or an enum type. Operands of an enum type are treated - // as having the primitive type Number. If one operand is the null or undefined value, - // it is treated as having the type of the other operand. - // The result is always of the Number primitive type. - if (leftType.flags & 6144 /* Nullable */) - leftType = rightType; - if (rightType.flags & 6144 /* Nullable */) - rightType = leftType; - leftType = getNonNullableType(leftType); - rightType = getNonNullableType(rightType); + leftType = checkNonNullType(leftType, left); + rightType = checkNonNullType(rightType, right); var suggestedOperator = void 0; // if a user tries to apply a bitwise operator to 2 boolean operands // try and return them a helpful suggestion @@ -37455,16 +40673,10 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - // TypeScript 1.0 spec (April 2014): 4.19.2 - // The binary + operator requires both operands to be of the Number primitive type or an enum type, - // or at least one of the operands to be of type Any or the String primitive type. - // If one operand is the null or undefined value, it is treated as having the type of the other operand. - if (leftType.flags & 6144 /* Nullable */) - leftType = rightType; - if (rightType.flags & 6144 /* Nullable */) - rightType = leftType; - leftType = getNonNullableType(leftType); - rightType = getNonNullableType(rightType); + if (!isTypeOfKind(leftType, 1 /* Any */ | 262178 /* StringLike */) && !isTypeOfKind(rightType, 1 /* Any */ | 262178 /* StringLike */)) { + leftType = checkNonNullType(leftType, left); + rightType = checkNonNullType(rightType, right); + } var resultType = void 0; if (isTypeOfKind(leftType, 340 /* NumberLike */) && isTypeOfKind(rightType, 340 /* NumberLike */)) { // Operands of an enum type are treated as having the primitive type Number. @@ -37499,8 +40711,8 @@ var ts; case 29 /* LessThanEqualsToken */: case 30 /* GreaterThanEqualsToken */: if (checkForDisallowedESSymbolOperand(operator)) { - leftType = getBaseTypeOfLiteralType(leftType); - rightType = getBaseTypeOfLiteralType(rightType); + leftType = getBaseTypeOfLiteralType(checkNonNullType(leftType, left)); + rightType = getBaseTypeOfLiteralType(checkNonNullType(rightType, right)); if (!isTypeComparableTo(leftType, rightType) && !isTypeComparableTo(rightType, leftType)) { reportOperatorError(); } @@ -37536,11 +40748,14 @@ var ts; checkAssignmentOperator(rightType); return getRegularTypeOfObjectLiteral(rightType); case 25 /* CommaToken */: - if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left)) { + if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isEvalNode(right)) { error(left, ts.Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects); } return rightType; } + function isEvalNode(node) { + return node.kind === 70 /* Identifier */ && node.text === "eval"; + } // Return true if there was no error, false if there was an error. function checkForDisallowedESSymbolOperand(operator) { var offendingSymbolOperand = maybeTypeOfKind(leftType, 512 /* ESSymbol */) ? left : @@ -37603,7 +40818,7 @@ var ts; function checkYieldExpression(node) { // Grammar checking if (produceDiagnostics) { - if (!(node.flags & 131072 /* YieldContext */) || isYieldExpressionInClass(node)) { + if (!(node.flags & 4096 /* YieldContext */) || isYieldExpressionInClass(node)) { grammarErrorOnFirstToken(node, ts.Diagnostics.A_yield_expression_is_only_allowed_in_a_generator_body); } if (isInParameterInitializerBeforeContainingFunction(node)) { @@ -37614,23 +40829,40 @@ var ts; var func = ts.getContainingFunction(node); // If the user's code is syntactically correct, the func should always have a star. After all, // we are in a yield context. - if (func && func.asteriskToken) { + var functionFlags = func && ts.getFunctionFlags(func); + if (node.asteriskToken) { + if (functionFlags & 2 /* Async */) { + if (languageVersion < 4 /* ES2017 */) { + checkExternalEmitHelpers(node, 4096 /* AsyncDelegator */); + } + } + else if (languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 256 /* Values */); + } + } + if (functionFlags & 1 /* Generator */) { var expressionType = checkExpressionCached(node.expression, /*contextualMapper*/ undefined); var expressionElementType = void 0; var nodeIsYieldStar = !!node.asteriskToken; if (nodeIsYieldStar) { - expressionElementType = checkElementTypeOfIterable(expressionType, node.expression); + expressionElementType = checkIteratedTypeOrElementType(expressionType, node.expression, /*allowStringInput*/ false, (functionFlags & 2 /* Async */) !== 0); } // There is no point in doing an assignability check if the function // has no explicit return type because the return type is directly computed // from the yield expressions. if (func.type) { - var signatureElementType = getElementTypeOfIterableIterator(getTypeFromTypeNode(func.type)) || anyType; + var signatureElementType = getIteratedTypeOfGenerator(getTypeFromTypeNode(func.type), (functionFlags & 2 /* Async */) !== 0) || anyType; if (nodeIsYieldStar) { - checkTypeAssignableTo(expressionElementType, signatureElementType, node.expression, /*headMessage*/ undefined); + checkTypeAssignableTo(functionFlags & 2 /* Async */ + ? getAwaitedType(expressionElementType, node.expression, ts.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) + : expressionElementType, signatureElementType, node.expression, + /*headMessage*/ undefined); } else { - checkTypeAssignableTo(expressionType, signatureElementType, node.expression, /*headMessage*/ undefined); + checkTypeAssignableTo(functionFlags & 2 /* Async */ + ? getAwaitedType(expressionType, node.expression, ts.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) + : expressionType, signatureElementType, node.expression, + /*headMessage*/ undefined); } } } @@ -37638,10 +40870,10 @@ var ts; // Both yield and yield* expressions have type 'any' return anyType; } - function checkConditionalExpression(node, contextualMapper) { + function checkConditionalExpression(node, checkMode) { checkExpression(node.condition); - var type1 = checkExpression(node.whenTrue, contextualMapper); - var type2 = checkExpression(node.whenFalse, contextualMapper); + var type1 = checkExpression(node.whenTrue, checkMode); + var type2 = checkExpression(node.whenFalse, checkMode); return getBestChoiceType(type1, type2); } function checkLiteralExpression(node) { @@ -37672,12 +40904,17 @@ var ts; } function checkExpressionWithContextualType(node, contextualType, contextualMapper) { var saveContextualType = node.contextualType; + var saveContextualMapper = node.contextualMapper; node.contextualType = contextualType; - var result = checkExpression(node, contextualMapper); + node.contextualMapper = contextualMapper; + var checkMode = contextualMapper === identityMapper ? 1 /* SkipContextSensitive */ : + contextualMapper ? 2 /* Inferential */ : 0 /* Normal */; + var result = checkExpression(node, checkMode); node.contextualType = saveContextualType; + node.contextualMapper = saveContextualMapper; return result; } - function checkExpressionCached(node, contextualMapper) { + function checkExpressionCached(node, checkMode) { var links = getNodeLinks(node); if (!links.resolvedType) { // When computing a type that we're going to cache, we need to ignore any ongoing control flow @@ -37685,83 +40922,87 @@ var ts; // to the top of the stack ensures all transient types are computed from a known point. var saveFlowLoopStart = flowLoopStart; flowLoopStart = flowLoopCount; - links.resolvedType = checkExpression(node, contextualMapper); + links.resolvedType = checkExpression(node, checkMode); flowLoopStart = saveFlowLoopStart; } return links.resolvedType; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 182 /* TypeAssertionExpression */ || node.kind === 200 /* AsExpression */; + return node.kind === 183 /* TypeAssertionExpression */ || node.kind === 201 /* AsExpression */; } function checkDeclarationInitializer(declaration) { - var type = checkExpressionCached(declaration.initializer); + var type = getTypeOfExpression(declaration.initializer, /*cache*/ true); return ts.getCombinedNodeFlags(declaration) & 2 /* Const */ || ts.getCombinedModifierFlags(declaration) & 64 /* Readonly */ && !ts.isParameterPropertyDeclaration(declaration) || isTypeAssertion(declaration.initializer) ? type : getWidenedLiteralType(type); } function isLiteralContextualType(contextualType) { if (contextualType) { - if (contextualType.flags & 16384 /* TypeParameter */) { - var apparentType = getApparentTypeOfTypeParameter(contextualType); + if (contextualType.flags & 540672 /* TypeVariable */) { + var constraint = getBaseConstraintOfType(contextualType) || emptyObjectType; // If the type parameter is constrained to the base primitive type we're checking for, // consider this a literal context. For example, given a type parameter 'T extends string', // this causes us to infer string literal types for T. - if (apparentType.flags & (2 /* String */ | 4 /* Number */ | 8 /* Boolean */ | 16 /* Enum */)) { + if (constraint.flags & (2 /* String */ | 4 /* Number */ | 8 /* Boolean */ | 16 /* Enum */)) { return true; } - contextualType = apparentType; + contextualType = constraint; } return maybeTypeOfKind(contextualType, (480 /* Literal */ | 262144 /* Index */)); } return false; } - function checkExpressionForMutableLocation(node, contextualMapper) { - var type = checkExpression(node, contextualMapper); + function checkExpressionForMutableLocation(node, checkMode) { + var type = checkExpression(node, checkMode); return isTypeAssertion(node) || isLiteralContextualType(getContextualType(node)) ? type : getWidenedLiteralType(type); } - function checkPropertyAssignment(node, contextualMapper) { + function checkPropertyAssignment(node, checkMode) { // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 142 /* ComputedPropertyName */) { + if (node.name.kind === 143 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } - return checkExpressionForMutableLocation(node.initializer, contextualMapper); + return checkExpressionForMutableLocation(node.initializer, checkMode); } - function checkObjectLiteralMethod(node, contextualMapper) { + function checkObjectLiteralMethod(node, checkMode) { // Grammar checking checkGrammarMethod(node); // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 142 /* ComputedPropertyName */) { + if (node.name.kind === 143 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } - var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - return instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); + var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); + return instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode); } - function instantiateTypeWithSingleGenericCallSignature(node, type, contextualMapper) { - if (isInferentialContext(contextualMapper)) { + function instantiateTypeWithSingleGenericCallSignature(node, type, checkMode) { + if (checkMode === 2 /* Inferential */) { var signature = getSingleCallSignature(type); if (signature && signature.typeParameters) { var contextualType = getApparentTypeOfContextualType(node); if (contextualType) { var contextualSignature = getSingleCallSignature(contextualType); if (contextualSignature && !contextualSignature.typeParameters) { - return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper)); + return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, getContextualMapper(node))); } } } } return type; } - // Returns the type of an expression. Unlike checkExpression, this function is simply concerned - // with computing the type and may not fully check all contained sub-expressions for errors. - function getTypeOfExpression(node) { + /** + * Returns the type of an expression. Unlike checkExpression, this function is simply concerned + * with computing the type and may not fully check all contained sub-expressions for errors. + * A cache argument of true indicates that if the function performs a full type check, it is ok + * to cache the result. + */ + function getTypeOfExpression(node, cache) { // Optimize for the common case of a call to a function with a single non-generic call // signature where we can just fetch the return type without checking the arguments. - if (node.kind === 179 /* CallExpression */ && node.expression.kind !== 96 /* SuperKeyword */) { + if (node.kind === 180 /* CallExpression */ && node.expression.kind !== 96 /* SuperKeyword */ && !ts.isRequireCall(node, /*checkArgumentIsStringLiteral*/ true)) { var funcType = checkNonNullExpression(node.expression); var signature = getSingleCallSignature(funcType); if (signature && !signature.typeParameters) { @@ -37771,7 +41012,21 @@ var ts; // Otherwise simply call checkExpression. Ideally, the entire family of checkXXX functions // should have a parameter that indicates whether full error checking is required such that // we can perform the optimizations locally. - return checkExpression(node); + return cache ? checkExpressionCached(node) : checkExpression(node); + } + /** + * Returns the type of an expression. Unlike checkExpression, this function is simply concerned + * with computing the type and may not fully check all contained sub-expressions for errors. + * It is intended for uses where you know there is no contextual type, + * and requesting the contextual type might cause a circularity or other bad behaviour. + * It sets the contextual type of the node to any before calling getTypeOfExpression. + */ + function getContextFreeTypeOfExpression(node) { + var saveContextualType = node.contextualType; + node.contextualType = anyType; + var type = getTypeOfExpression(node); + node.contextualType = saveContextualType; + return type; } // Checks an expression and returns its type. The contextualMapper parameter serves two purposes: When // contextualMapper is not undefined and not equal to the identityMapper function object it indicates that the @@ -37780,30 +41035,30 @@ var ts; // object, it serves as an indicator that all contained function and arrow expressions should be considered to // have the wildcard function type; this form of type check is used during overload resolution to exclude // contextually typed function and arrow expressions in the initial phase. - function checkExpression(node, contextualMapper) { + function checkExpression(node, checkMode) { var type; - if (node.kind === 141 /* QualifiedName */) { + if (node.kind === 142 /* QualifiedName */) { type = checkQualifiedName(node); } else { - var uninstantiatedType = checkExpressionWorker(node, contextualMapper); - type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); + var uninstantiatedType = checkExpressionWorker(node, checkMode); + type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode); } if (isConstEnumObjectType(type)) { // enum object type for const enums are only permitted in: // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 177 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 178 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 70 /* Identifier */ || node.kind === 141 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 178 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 179 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 70 /* Identifier */ || node.kind === 142 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); } } return type; } - function checkExpressionWorker(node, contextualMapper) { + function checkExpressionWorker(node, checkMode) { switch (node.kind) { case 70 /* Identifier */: return checkIdentifier(node); @@ -37818,66 +41073,70 @@ var ts; case 100 /* TrueKeyword */: case 85 /* FalseKeyword */: return checkLiteralExpression(node); - case 194 /* TemplateExpression */: + case 195 /* TemplateExpression */: return checkTemplateExpression(node); case 12 /* NoSubstitutionTemplateLiteral */: return stringType; case 11 /* RegularExpressionLiteral */: return globalRegExpType; - case 175 /* ArrayLiteralExpression */: - return checkArrayLiteral(node, contextualMapper); - case 176 /* ObjectLiteralExpression */: - return checkObjectLiteral(node, contextualMapper); - case 177 /* PropertyAccessExpression */: + case 176 /* ArrayLiteralExpression */: + return checkArrayLiteral(node, checkMode); + case 177 /* ObjectLiteralExpression */: + return checkObjectLiteral(node, checkMode); + case 178 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 178 /* ElementAccessExpression */: + case 179 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 179 /* CallExpression */: - case 180 /* NewExpression */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: return checkCallExpression(node); - case 181 /* TaggedTemplateExpression */: + case 182 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 183 /* ParenthesizedExpression */: - return checkExpression(node.expression, contextualMapper); - case 197 /* ClassExpression */: + case 184 /* ParenthesizedExpression */: + return checkExpression(node.expression, checkMode); + case 198 /* ClassExpression */: return checkClassExpression(node); - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 187 /* TypeOfExpression */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); + case 188 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 182 /* TypeAssertionExpression */: - case 200 /* AsExpression */: + case 183 /* TypeAssertionExpression */: + case 201 /* AsExpression */: return checkAssertion(node); - case 201 /* NonNullExpression */: + case 202 /* NonNullExpression */: return checkNonNullAssertion(node); - case 186 /* DeleteExpression */: + case 203 /* MetaProperty */: + return checkMetaProperty(node); + case 187 /* DeleteExpression */: return checkDeleteExpression(node); - case 188 /* VoidExpression */: + case 189 /* VoidExpression */: return checkVoidExpression(node); - case 189 /* AwaitExpression */: + case 190 /* AwaitExpression */: return checkAwaitExpression(node); - case 190 /* PrefixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 191 /* PostfixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 192 /* BinaryExpression */: - return checkBinaryExpression(node, contextualMapper); - case 193 /* ConditionalExpression */: - return checkConditionalExpression(node, contextualMapper); - case 196 /* SpreadElement */: - return checkSpreadExpression(node, contextualMapper); - case 198 /* OmittedExpression */: + case 193 /* BinaryExpression */: + return checkBinaryExpression(node, checkMode); + case 194 /* ConditionalExpression */: + return checkConditionalExpression(node, checkMode); + case 197 /* SpreadElement */: + return checkSpreadExpression(node, checkMode); + case 199 /* OmittedExpression */: return undefinedWideningType; - case 195 /* YieldExpression */: + case 196 /* YieldExpression */: return checkYieldExpression(node); - case 252 /* JsxExpression */: - return checkJsxExpression(node); - case 246 /* JsxElement */: + case 255 /* JsxExpression */: + return checkJsxExpression(node, checkMode); + case 248 /* JsxElement */: return checkJsxElement(node); - case 247 /* JsxSelfClosingElement */: + case 249 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node); - case 248 /* JsxOpeningElement */: + case 253 /* JsxAttributes */: + return checkJsxAttributes(node, checkMode); + case 250 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return unknownType; @@ -37889,7 +41148,16 @@ var ts; grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected); } checkSourceElement(node.constraint); - getConstraintOfTypeParameter(getDeclaredTypeOfTypeParameter(getSymbolOfNode(node))); + checkSourceElement(node.default); + var typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node)); + if (!hasNonCircularBaseConstraint(typeParameter)) { + error(node.constraint, ts.Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(typeParameter)); + } + var constraintType = getConstraintOfTypeParameter(typeParameter); + var defaultType = getDefaultFromTypeParameter(typeParameter); + if (constraintType && defaultType) { + checkTypeAssignableTo(defaultType, getTypeWithThisArgument(constraintType, defaultType), node.default, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + } if (produceDiagnostics) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); } @@ -37905,7 +41173,7 @@ var ts; var func = ts.getContainingFunction(node); if (ts.getModifierFlags(node) & 92 /* ParameterPropertyModifier */) { func = ts.getContainingFunction(node); - if (!(func.kind === 150 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 151 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -37916,7 +41184,7 @@ var ts; if (ts.indexOf(func.parameters, node) !== 0) { error(node, ts.Diagnostics.A_this_parameter_must_be_the_first_parameter); } - if (func.kind === 150 /* Constructor */ || func.kind === 154 /* ConstructSignature */ || func.kind === 159 /* ConstructorType */) { + if (func.kind === 151 /* Constructor */ || func.kind === 155 /* ConstructSignature */ || func.kind === 160 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } } @@ -37926,14 +41194,6 @@ var ts; error(node, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); } } - function isSyntacticallyValidGenerator(node) { - if (!node.asteriskToken || !node.body) { - return false; - } - return node.kind === 149 /* MethodDeclaration */ || - node.kind === 225 /* FunctionDeclaration */ || - node.kind === 184 /* FunctionExpression */; - } function getTypePredicateParameterIndex(parameterList, parameter) { if (parameterList) { for (var i = 0; i < parameterList.length; i++) { @@ -37967,7 +41227,7 @@ var ts; error(parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); } else { - var leadingError = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type); + var leadingError = ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type); checkTypeAssignableTo(typePredicate.type, getTypeOfNode(parent.parameters[typePredicate.parameterIndex]), node.type, /*headMessage*/ undefined, leadingError); } @@ -37975,9 +41235,9 @@ var ts; else if (parameterName) { var hasReportedError = false; for (var _i = 0, _a = parent.parameters; _i < _a.length; _i++) { - var name_21 = _a[_i].name; - if (ts.isBindingPattern(name_21) && - checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_21, parameterName, typePredicate.parameterName)) { + var name = _a[_i].name; + if (ts.isBindingPattern(name) && + checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, parameterName, typePredicate.parameterName)) { hasReportedError = true; break; } @@ -37990,16 +41250,16 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 185 /* ArrowFunction */: - case 153 /* CallSignature */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 158 /* FunctionType */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - var parent_9 = node.parent; - if (node === parent_9.type) { - return parent_9; + case 186 /* ArrowFunction */: + case 154 /* CallSignature */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 159 /* FunctionType */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + var parent = node.parent; + if (node === parent.type) { + return parent; } } } @@ -38009,15 +41269,15 @@ var ts; if (ts.isOmittedExpression(element)) { continue; } - var name_22 = element.name; - if (name_22.kind === 70 /* Identifier */ && - name_22.text === predicateVariableName) { + var name = element.name; + if (name.kind === 70 /* Identifier */ && + name.text === predicateVariableName) { error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name_22.kind === 173 /* ArrayBindingPattern */ || - name_22.kind === 172 /* ObjectBindingPattern */) { - if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_22, predicateVariableNode, predicateVariableName)) { + else if (name.kind === 174 /* ArrayBindingPattern */ || + name.kind === 173 /* ObjectBindingPattern */) { + if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } } @@ -38025,14 +41285,29 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 155 /* IndexSignature */) { + if (node.kind === 156 /* IndexSignature */) { checkGrammarIndexSignature(node); } - else if (node.kind === 158 /* FunctionType */ || node.kind === 225 /* FunctionDeclaration */ || node.kind === 159 /* ConstructorType */ || - node.kind === 153 /* CallSignature */ || node.kind === 150 /* Constructor */ || - node.kind === 154 /* ConstructSignature */) { + else if (node.kind === 159 /* FunctionType */ || node.kind === 227 /* FunctionDeclaration */ || node.kind === 160 /* ConstructorType */ || + node.kind === 154 /* CallSignature */ || node.kind === 151 /* Constructor */ || + node.kind === 155 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } + var functionFlags = ts.getFunctionFlags(node); + if ((functionFlags & 7 /* InvalidAsyncOrAsyncGenerator */) === 2 /* Async */ && languageVersion < 4 /* ES2017 */) { + checkExternalEmitHelpers(node, 64 /* Awaiter */); + if (languageVersion < 2 /* ES2015 */) { + checkExternalEmitHelpers(node, 128 /* Generator */); + } + } + if ((functionFlags & 5 /* InvalidGenerator */) === 1 /* Generator */) { + if (functionFlags & 2 /* Async */ && languageVersion < 4 /* ES2017 */) { + checkExternalEmitHelpers(node, 2048 /* AsyncGenerator */); + } + else if (languageVersion < 2 /* ES2015 */) { + checkExternalEmitHelpers(node, 128 /* Generator */); + } + } checkTypeParameters(node.typeParameters); ts.forEach(node.parameters, checkParameter); if (node.type) { @@ -38040,25 +41315,28 @@ var ts; } if (produceDiagnostics) { checkCollisionWithArgumentsInGeneratedCode(node); - if (compilerOptions.noImplicitAny && !node.type) { + if (noImplicitAny && !node.type) { switch (node.kind) { - case 154 /* ConstructSignature */: + case 155 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 153 /* CallSignature */: + case 154 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } } if (node.type) { - if (languageVersion >= 2 /* ES2015 */ && isSyntacticallyValidGenerator(node)) { + var functionFlags_1 = ts.getFunctionFlags(node); + if ((functionFlags_1 & 5 /* InvalidGenerator */) === 1 /* Generator */) { var returnType = getTypeFromTypeNode(node.type); if (returnType === voidType) { error(node.type, ts.Diagnostics.A_generator_cannot_have_a_void_type_annotation); } else { - var generatorElementType = getElementTypeOfIterableIterator(returnType) || anyType; - var iterableIteratorInstantiation = createIterableIteratorType(generatorElementType); + var generatorElementType = getIteratedTypeOfGenerator(returnType, (functionFlags_1 & 2 /* Async */) !== 0) || anyType; + var iterableIteratorInstantiation = functionFlags_1 & 2 /* Async */ + ? createAsyncIterableIteratorType(generatorElementType) // AsyncGenerator function + : createIterableIteratorType(generatorElementType); // Generator function // Naively, one could check that IterableIterator is assignable to the return type annotation. // However, that would not catch the error in the following case. // @@ -38068,7 +41346,7 @@ var ts; checkTypeAssignableTo(iterableIteratorInstantiation, returnType, node.type); } } - else if (ts.isAsyncFunctionLike(node)) { + else if ((functionFlags_1 & 3 /* AsyncOrAsyncGenerator */) === 2 /* Async */) { checkAsyncFunctionReturnType(node); } } @@ -38078,17 +41356,18 @@ var ts; } } function checkClassForDuplicateDeclarations(node) { - var Accessor; - (function (Accessor) { - Accessor[Accessor["Getter"] = 1] = "Getter"; - Accessor[Accessor["Setter"] = 2] = "Setter"; - Accessor[Accessor["Property"] = 3] = "Property"; - })(Accessor || (Accessor = {})); + var Declaration; + (function (Declaration) { + Declaration[Declaration["Getter"] = 1] = "Getter"; + Declaration[Declaration["Setter"] = 2] = "Setter"; + Declaration[Declaration["Method"] = 4] = "Method"; + Declaration[Declaration["Property"] = 3] = "Property"; + })(Declaration || (Declaration = {})); var instanceNames = ts.createMap(); var staticNames = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 150 /* Constructor */) { + if (member.kind === 151 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param)) { @@ -38097,36 +41376,76 @@ var ts; } } else { - var isStatic = ts.forEach(member.modifiers, function (m) { return m.kind === 114 /* StaticKeyword */; }); + var isStatic = ts.getModifierFlags(member) & 32 /* Static */; var names = isStatic ? staticNames : instanceNames; var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name); if (memberName) { switch (member.kind) { - case 151 /* GetAccessor */: + case 152 /* GetAccessor */: addName(names, member.name, memberName, 1 /* Getter */); break; - case 152 /* SetAccessor */: + case 153 /* SetAccessor */: addName(names, member.name, memberName, 2 /* Setter */); break; - case 147 /* PropertyDeclaration */: + case 148 /* PropertyDeclaration */: addName(names, member.name, memberName, 3 /* Property */); break; + case 150 /* MethodDeclaration */: + addName(names, member.name, memberName, 4 /* Method */); + break; } } } } function addName(names, location, name, meaning) { - var prev = names[name]; + var prev = names.get(name); if (prev) { - if (prev & meaning) { + if (prev & 4 /* Method */) { + if (meaning !== 4 /* Method */) { + error(location, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(location)); + } + } + else if (prev & meaning) { error(location, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(location)); } else { - names[name] = prev | meaning; + names.set(name, prev | meaning); } } else { - names[name] = meaning; + names.set(name, meaning); + } + } + } + /** + * Static members being set on a constructor function may conflict with built-in properties + * of Function. Esp. in ECMAScript 5 there are non-configurable and non-writable + * built-in properties. This check issues a transpile error when a class has a static + * member with the same name as a non-writable built-in property. + * + * @see http://www.ecma-international.org/ecma-262/5.1/#sec-15.3.3 + * @see http://www.ecma-international.org/ecma-262/5.1/#sec-15.3.5 + * @see http://www.ecma-international.org/ecma-262/6.0/#sec-properties-of-the-function-constructor + * @see http://www.ecma-international.org/ecma-262/6.0/#sec-function-instances + */ + function checkClassForStaticPropertyNameConflicts(node) { + for (var _i = 0, _a = node.members; _i < _a.length; _i++) { + var member = _a[_i]; + var memberNameNode = member.name; + var isStatic = ts.getModifierFlags(member) & 32 /* Static */; + if (isStatic && memberNameNode) { + var memberName = ts.getPropertyNameForPropertyNameNode(memberNameNode); + switch (memberName) { + case "name": + case "length": + case "caller": + case "arguments": + case "prototype": + var message = ts.Diagnostics.Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1; + var className = getNameOfSymbol(getSymbolOfNode(node)); + error(memberNameNode, message, memberName, className); + break; + } } } } @@ -38134,7 +41453,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind == 146 /* PropertySignature */) { + if (member.kind === 147 /* PropertySignature */) { var memberName = void 0; switch (member.name.kind) { case 9 /* StringLiteral */: @@ -38145,18 +41464,18 @@ var ts; default: continue; } - if (names[memberName]) { + if (names.get(memberName)) { error(member.symbol.valueDeclaration.name, ts.Diagnostics.Duplicate_identifier_0, memberName); error(member.name, ts.Diagnostics.Duplicate_identifier_0, memberName); } else { - names[memberName] = true; + names.set(memberName, true); } } } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 227 /* InterfaceDeclaration */) { + if (node.kind === 229 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -38176,7 +41495,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 134 /* StringKeyword */: + case 135 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -38252,12 +41571,12 @@ var ts; if (n.kind === 98 /* ThisKeyword */) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 184 /* FunctionExpression */ && n.kind !== 225 /* FunctionDeclaration */) { + else if (n.kind !== 185 /* FunctionExpression */ && n.kind !== 227 /* FunctionDeclaration */) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 147 /* PropertyDeclaration */ && + return n.kind === 148 /* PropertyDeclaration */ && !(ts.getModifierFlags(n) & 32 /* Static */) && !!n.initializer; } @@ -38287,7 +41606,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_3 = statements; _i < statements_3.length; _i++) { var statement = statements_3[_i]; - if (statement.kind === 207 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 209 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -38311,7 +41630,7 @@ var ts; checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 151 /* GetAccessor */) { + if (node.kind === 152 /* GetAccessor */) { if (!ts.isInAmbientContext(node) && ts.nodeIsPresent(node.body) && (node.flags & 128 /* HasImplicitReturn */)) { if (!(node.flags & 256 /* HasExplicitReturn */)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); @@ -38321,13 +41640,13 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 142 /* ComputedPropertyName */) { + if (node.name.kind === 143 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (!ts.hasDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 151 /* GetAccessor */ ? 152 /* SetAccessor */ : 151 /* GetAccessor */; + var otherKind = node.kind === 152 /* GetAccessor */ ? 153 /* SetAccessor */ : 152 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { if ((ts.getModifierFlags(node) & 28 /* AccessibilityModifier */) !== (ts.getModifierFlags(otherAccessor) & 28 /* AccessibilityModifier */)) { @@ -38343,17 +41662,12 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 151 /* GetAccessor */) { + if (node.kind === 152 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } - if (node.parent.kind !== 176 /* ObjectLiteralExpression */) { - checkSourceElement(node.body); - registerForUnusedIdentifiersCheck(node); - } - else { - checkNodeDeferred(node); - } + checkSourceElement(node.body); + registerForUnusedIdentifiersCheck(node); } function checkAccessorDeclarationTypesIdentical(first, second, getAnnotatedType, message) { var firstType = getAnnotatedType(first); @@ -38362,14 +41676,11 @@ var ts; error(first, message); } } - function checkAccessorDeferred(node) { - checkSourceElement(node.body); - registerForUnusedIdentifiersCheck(node); - } function checkMissingDeclaration(node) { checkDecorators(node); } function checkTypeArgumentConstraints(typeParameters, typeArgumentNodes) { + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); var typeArguments; var mapper; var result = true; @@ -38377,7 +41688,7 @@ var ts; var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { if (!typeArguments) { - typeArguments = ts.map(typeArgumentNodes, getTypeFromTypeNode); + typeArguments = fillMissingTypeArguments(ts.map(typeArgumentNodes, getTypeFromTypeNode), typeParameters, minTypeArgumentCount); mapper = createTypeMapper(typeParameters, typeArguments); } var typeArgument = typeArguments[i]; @@ -38430,16 +41741,36 @@ var ts; function checkUnionOrIntersectionType(node) { ts.forEach(node.types, checkSourceElement); } + function checkIndexedAccessIndexType(type, accessNode) { + if (!(type.flags & 524288 /* IndexedAccess */)) { + return type; + } + // Check if the index type is assignable to 'keyof T' for the object type. + var objectType = type.objectType; + var indexType = type.indexType; + if (isTypeAssignableTo(indexType, getIndexType(objectType))) { + return type; + } + // Check if we're indexing with a numeric type and the object type is a generic + // type with a constraint that has a numeric index signature. + if (maybeTypeOfKind(objectType, 540672 /* TypeVariable */) && isTypeOfKind(indexType, 340 /* NumberLike */)) { + var constraint = getBaseConstraintOfType(objectType); + if (constraint && getIndexInfoOfType(constraint, 1 /* Number */)) { + return type; + } + } + error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); + return type; + } function checkIndexedAccessType(node) { - getTypeFromIndexedAccessTypeNode(node); + checkIndexedAccessIndexType(getTypeFromIndexedAccessTypeNode(node), node); } function checkMappedType(node) { checkSourceElement(node.typeParameter); checkSourceElement(node.type); var type = getTypeFromMappedTypeNode(node); var constraintType = getConstraintTypeFromMappedType(type); - var keyType = constraintType.flags & 16384 /* TypeParameter */ ? getApparentTypeOfTypeParameter(constraintType) : constraintType; - checkTypeAssignableTo(keyType, stringType, node.typeParameter.constraint); + checkTypeAssignableTo(constraintType, stringType, node.typeParameter.constraint); } function isPrivateWithinAmbient(node) { return (ts.getModifierFlags(node) & 8 /* Private */) && ts.isInAmbientContext(node); @@ -38448,9 +41779,9 @@ var ts; var flags = ts.getCombinedModifierFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 227 /* InterfaceDeclaration */ && - n.parent.kind !== 226 /* ClassDeclaration */ && - n.parent.kind !== 197 /* ClassExpression */ && + if (n.parent.kind !== 229 /* InterfaceDeclaration */ && + n.parent.kind !== 228 /* ClassDeclaration */ && + n.parent.kind !== 198 /* ClassExpression */ && ts.isInAmbientContext(n)) { if (!(flags & 2 /* Ambient */)) { // It is nested in an ambient context, which means it is automatically exported @@ -38538,7 +41869,7 @@ var ts; var errorNode_1 = subsequentNode.name || subsequentNode; // TODO(jfreeman): These are methods, so handle computed name case if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - var reportError = (node.kind === 149 /* MethodDeclaration */ || node.kind === 148 /* MethodSignature */) && + var reportError = (node.kind === 150 /* MethodDeclaration */ || node.kind === 149 /* MethodSignature */) && (ts.getModifierFlags(node) & 32 /* Static */) !== (ts.getModifierFlags(subsequentNode) & 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -38573,11 +41904,11 @@ var ts; } var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; - for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { - var current = declarations_4[_i]; + for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { + var current = declarations_5[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 227 /* InterfaceDeclaration */ || node.parent.kind === 161 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 229 /* InterfaceDeclaration */ || node.parent.kind === 162 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -38588,7 +41919,7 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if (node.kind === 225 /* FunctionDeclaration */ || node.kind === 149 /* MethodDeclaration */ || node.kind === 148 /* MethodSignature */ || node.kind === 150 /* Constructor */) { + if (node.kind === 227 /* FunctionDeclaration */ || node.kind === 150 /* MethodDeclaration */ || node.kind === 149 /* MethodSignature */ || node.kind === 151 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -38640,8 +41971,8 @@ var ts; if (bodyDeclaration) { var signatures = getSignaturesOfSymbol(symbol); var bodySignature = getSignatureFromDeclaration(bodyDeclaration); - for (var _a = 0, signatures_3 = signatures; _a < signatures_3.length; _a++) { - var signature = signatures_3[_a]; + for (var _a = 0, signatures_4 = signatures; _a < signatures_4.length; _a++) { + var signature = signatures_4[_a]; if (!isImplementationCompatibleWithOverload(bodySignature, signature)) { error(signature.declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); break; @@ -38710,16 +42041,16 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: return 2097152 /* ExportType */; - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4194304 /* ExportNamespace */ | 1048576 /* ExportValue */ : 4194304 /* ExportNamespace */; - case 226 /* ClassDeclaration */: - case 229 /* EnumDeclaration */: + case 228 /* ClassDeclaration */: + case 231 /* EnumDeclaration */: return 2097152 /* ExportType */ | 1048576 /* ExportValue */; - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: var result_3 = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_3 |= getDeclarationSpaces(d); }); @@ -38729,25 +42060,16 @@ var ts; } } } - function checkNonThenableType(type, location, message) { - type = getWidenedType(type); - if (!isTypeAny(type) && !isTypeNever(type) && isTypeAssignableTo(type, getGlobalThenableType())) { - if (location) { - if (!message) { - message = ts.Diagnostics.Operand_for_await_does_not_have_a_valid_callable_then_member; - } - error(location, message); - } - return unknownType; - } - return type; + function getAwaitedTypeOfPromise(type, errorNode, diagnosticMessage) { + var promisedType = getPromisedTypeOfPromise(type, errorNode); + return promisedType && getAwaitedType(promisedType, errorNode, diagnosticMessage); } /** - * Gets the "promised type" of a promise. - * @param type The type of the promise. - * @remarks The "promised type" of a type is the type of the "value" parameter of the "onfulfilled" callback. - */ - function getPromisedType(promise) { + * Gets the "promised type" of a promise. + * @param type The type of the promise. + * @remarks The "promised type" of a type is the type of the "value" parameter of the "onfulfilled" callback. + */ + function getPromisedTypeOfPromise(promise, errorNode) { // // { // promise // then( // thenFunction @@ -38760,127 +42082,140 @@ var ts; if (isTypeAny(promise)) { return undefined; } - if (getObjectFlags(promise) & 4 /* Reference */) { - if (promise.target === tryGetGlobalPromiseType() - || promise.target === getGlobalPromiseLikeType()) { - return promise.typeArguments[0]; - } + var typeAsPromise = promise; + if (typeAsPromise.promisedTypeOfPromise) { + return typeAsPromise.promisedTypeOfPromise; } - var globalPromiseLikeType = getInstantiatedGlobalPromiseLikeType(); - if (globalPromiseLikeType === emptyObjectType || !isTypeAssignableTo(promise, globalPromiseLikeType)) { - return undefined; + if (isReferenceToType(promise, getGlobalPromiseType(/*reportErrors*/ false))) { + return typeAsPromise.promisedTypeOfPromise = promise.typeArguments[0]; } var thenFunction = getTypeOfPropertyOfType(promise, "then"); - if (!thenFunction || isTypeAny(thenFunction)) { + if (isTypeAny(thenFunction)) { return undefined; } - var thenSignatures = getSignaturesOfType(thenFunction, 0 /* Call */); + var thenSignatures = thenFunction ? getSignaturesOfType(thenFunction, 0 /* Call */) : emptyArray; if (thenSignatures.length === 0) { + if (errorNode) { + error(errorNode, ts.Diagnostics.A_promise_must_have_a_then_method); + } return undefined; } - var onfulfilledParameterType = getTypeWithFacts(getUnionType(ts.map(thenSignatures, getTypeOfFirstParameterOfSignature)), 131072 /* NEUndefined */); + var onfulfilledParameterType = getTypeWithFacts(getUnionType(ts.map(thenSignatures, getTypeOfFirstParameterOfSignature)), 524288 /* NEUndefinedOrNull */); if (isTypeAny(onfulfilledParameterType)) { return undefined; } var onfulfilledParameterSignatures = getSignaturesOfType(onfulfilledParameterType, 0 /* Call */); if (onfulfilledParameterSignatures.length === 0) { + if (errorNode) { + error(errorNode, ts.Diagnostics.The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback); + } return undefined; } - return getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), /*subtypeReduction*/ true); - } - function getTypeOfFirstParameterOfSignature(signature) { - return signature.parameters.length > 0 ? getTypeAtPosition(signature, 0) : neverType; + return typeAsPromise.promisedTypeOfPromise = getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), /*subtypeReduction*/ true); } /** - * Gets the "awaited type" of a type. - * @param type The type to await. - * @remarks The "awaited type" of an expression is its "promised type" if the expression is a - * Promise-like type; otherwise, it is the type of the expression. This is used to reflect - * The runtime behavior of the `await` keyword. - */ - function getAwaitedType(type) { - return checkAwaitedType(type, /*location*/ undefined, /*message*/ undefined); + * Gets the "awaited type" of a type. + * @param type The type to await. + * @remarks The "awaited type" of an expression is its "promised type" if the expression is a + * Promise-like type; otherwise, it is the type of the expression. This is used to reflect + * The runtime behavior of the `await` keyword. + */ + function checkAwaitedType(type, errorNode, diagnosticMessage) { + return getAwaitedType(type, errorNode, diagnosticMessage) || unknownType; } - function checkAwaitedType(type, location, message) { - return checkAwaitedTypeWorker(type); - function checkAwaitedTypeWorker(type) { - if (type.flags & 65536 /* Union */) { - var types = []; - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var constituentType = _a[_i]; - types.push(checkAwaitedTypeWorker(constituentType)); - } - return getUnionType(types, /*subtypeReduction*/ true); - } - else { - var promisedType = getPromisedType(type); - if (promisedType === undefined) { - // The type was not a PromiseLike, so it could not be unwrapped any further. - // As long as the type does not have a callable "then" property, it is - // safe to return the type; otherwise, an error will have been reported in - // the call to checkNonThenableType and we will return unknownType. - // - // An example of a non-promise "thenable" might be: - // - // await { then(): void {} } - // - // The "thenable" does not match the minimal definition for a PromiseLike. When - // a Promise/A+-compatible or ES6 promise tries to adopt this value, the promise - // will never settle. We treat this as an error to help flag an early indicator - // of a runtime problem. If the user wants to return this value from an async - // function, they would need to wrap it in some other value. If they want it to - // be treated as a promise, they can cast to . - return checkNonThenableType(type, location, message); - } - else { - if (type.id === promisedType.id || ts.indexOf(awaitedTypeStack, promisedType.id) >= 0) { - // We have a bad actor in the form of a promise whose promised type is - // the same promise type, or a mutually recursive promise. Return the - // unknown type as we cannot guess the shape. If this were the actual - // case in the JavaScript, this Promise would never resolve. - // - // An example of a bad actor with a singly-recursive promise type might - // be: - // - // interface BadPromise { - // then( - // onfulfilled: (value: BadPromise) => any, - // onrejected: (error: any) => any): BadPromise; - // } - // - // The above interface will pass the PromiseLike check, and return a - // promised type of `BadPromise`. Since this is a self reference, we - // don't want to keep recursing ad infinitum. - // - // An example of a bad actor in the form of a mutually-recursive - // promise type might be: - // - // interface BadPromiseA { - // then( - // onfulfilled: (value: BadPromiseB) => any, - // onrejected: (error: any) => any): BadPromiseB; - // } - // - // interface BadPromiseB { - // then( - // onfulfilled: (value: BadPromiseA) => any, - // onrejected: (error: any) => any): BadPromiseA; - // } - // - if (location) { - error(location, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method, symbolToString(type.symbol)); - } - return unknownType; - } - // Keep track of the type we're about to unwrap to avoid bad recursive promise types. - // See the comments above for more information. - awaitedTypeStack.push(type.id); - var awaitedType = checkAwaitedTypeWorker(promisedType); - awaitedTypeStack.pop(); - return awaitedType; - } - } + function getAwaitedType(type, errorNode, diagnosticMessage) { + var typeAsAwaitable = type; + if (typeAsAwaitable.awaitedTypeOfType) { + return typeAsAwaitable.awaitedTypeOfType; } + if (isTypeAny(type)) { + return typeAsAwaitable.awaitedTypeOfType = type; + } + if (type.flags & 65536 /* Union */) { + var types = void 0; + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var constituentType = _a[_i]; + types = ts.append(types, getAwaitedType(constituentType, errorNode, diagnosticMessage)); + } + if (!types) { + return undefined; + } + return typeAsAwaitable.awaitedTypeOfType = getUnionType(types, /*subtypeReduction*/ true); + } + var promisedType = getPromisedTypeOfPromise(type); + if (promisedType) { + if (type.id === promisedType.id || ts.indexOf(awaitedTypeStack, promisedType.id) >= 0) { + // Verify that we don't have a bad actor in the form of a promise whose + // promised type is the same as the promise type, or a mutually recursive + // promise. If so, we return undefined as we cannot guess the shape. If this + // were the actual case in the JavaScript, this Promise would never resolve. + // + // An example of a bad actor with a singly-recursive promise type might + // be: + // + // interface BadPromise { + // then( + // onfulfilled: (value: BadPromise) => any, + // onrejected: (error: any) => any): BadPromise; + // } + // The above interface will pass the PromiseLike check, and return a + // promised type of `BadPromise`. Since this is a self reference, we + // don't want to keep recursing ad infinitum. + // + // An example of a bad actor in the form of a mutually-recursive + // promise type might be: + // + // interface BadPromiseA { + // then( + // onfulfilled: (value: BadPromiseB) => any, + // onrejected: (error: any) => any): BadPromiseB; + // } + // + // interface BadPromiseB { + // then( + // onfulfilled: (value: BadPromiseA) => any, + // onrejected: (error: any) => any): BadPromiseA; + // } + // + if (errorNode) { + error(errorNode, ts.Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method); + } + return undefined; + } + // Keep track of the type we're about to unwrap to avoid bad recursive promise types. + // See the comments above for more information. + awaitedTypeStack.push(type.id); + var awaitedType = getAwaitedType(promisedType, errorNode, diagnosticMessage); + awaitedTypeStack.pop(); + if (!awaitedType) { + return undefined; + } + return typeAsAwaitable.awaitedTypeOfType = awaitedType; + } + // The type was not a promise, so it could not be unwrapped any further. + // As long as the type does not have a callable "then" property, it is + // safe to return the type; otherwise, an error will be reported in + // the call to getNonThenableType and we will return undefined. + // + // An example of a non-promise "thenable" might be: + // + // await { then(): void {} } + // + // The "thenable" does not match the minimal definition for a promise. When + // a Promise/A+-compatible or ES6 promise tries to adopt this value, the promise + // will never settle. We treat this as an error to help flag an early indicator + // of a runtime problem. If the user wants to return this value from an async + // function, they would need to wrap it in some other value. If they want it to + // be treated as a promise, they can cast to . + var thenFunction = getTypeOfPropertyOfType(type, "then"); + if (thenFunction && getSignaturesOfType(thenFunction, 0 /* Call */).length > 0) { + if (errorNode) { + ts.Debug.assert(!!diagnosticMessage); + error(errorNode, diagnosticMessage); + } + return undefined; + } + return typeAsAwaitable.awaitedTypeOfType = type; } /** * Checks the return type of an async function to ensure it is a compatible @@ -38925,8 +42260,8 @@ var ts; if (returnType === unknownType) { return unknownType; } - var globalPromiseType = getGlobalPromiseType(); - if (globalPromiseType !== emptyGenericType && globalPromiseType !== getTargetType(returnType)) { + var globalPromiseType = getGlobalPromiseType(/*reportErrors*/ true); + if (globalPromiseType !== emptyGenericType && !isReferenceToType(returnType, globalPromiseType)) { // The promise type was not a valid type reference to the global promise type, so we // report an error and return the unknown type. error(node.type, ts.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type); @@ -38947,10 +42282,15 @@ var ts; var promiseConstructorSymbol = resolveEntityName(promiseConstructorName, 107455 /* Value */, /*ignoreErrors*/ true); var promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : unknownType; if (promiseConstructorType === unknownType) { - error(node.type, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, ts.entityNameToString(promiseConstructorName)); + if (promiseConstructorName.kind === 70 /* Identifier */ && promiseConstructorName.text === "Promise" && getTargetType(returnType) === getGlobalPromiseType(/*reportErrors*/ false)) { + error(node.type, ts.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option); + } + else { + error(node.type, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, ts.entityNameToString(promiseConstructorName)); + } return unknownType; } - var globalPromiseConstructorLikeType = getGlobalPromiseConstructorLikeType(); + var globalPromiseConstructorLikeType = getGlobalPromiseConstructorLikeType(/*reportErrors*/ true); if (globalPromiseConstructorLikeType === emptyObjectType) { // If we couldn't resolve the global PromiseConstructorLike type we cannot verify // compatibility with __awaiter. @@ -38969,7 +42309,7 @@ var ts; } } // Get and return the awaited type of the return type. - return checkAwaitedType(returnType, node, ts.Diagnostics.An_async_function_or_method_must_have_a_valid_awaitable_return_type); + return checkAwaitedType(returnType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } /** Check a decorator */ function checkDecorator(node) { @@ -38982,22 +42322,22 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 144 /* Parameter */: + case 145 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 147 /* PropertyDeclaration */: + case 148 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -39020,6 +42360,9 @@ var ts; markAliasSymbolAsReferenced(rootSymbol); } } + function getParameterTypeNodeForDecoratorCheck(node) { + return node.dotDotDotToken ? ts.getRestParameterElementType(node.type) : node.type; + } /** Check the decorators of a node */ function checkDecorators(node) { if (!node.decorators) { @@ -39033,29 +42376,37 @@ var ts; if (!compilerOptions.experimentalDecorators) { error(node, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning); } + var firstDecorator = node.decorators[0]; + checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); + if (node.kind === 145 /* Parameter */) { + checkExternalEmitHelpers(firstDecorator, 32 /* Param */); + } if (compilerOptions.emitDecoratorMetadata) { + checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { var parameter = _a[_i]; - markTypeNodeAsReferenced(parameter.type); + markTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } } break; - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; - markTypeNodeAsReferenced(parameter.type); + markTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markTypeNodeAsReferenced(node.type); break; - case 147 /* PropertyDeclaration */: - case 144 /* Parameter */: + case 148 /* PropertyDeclaration */: + markTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); + break; + case 145 /* Parameter */: markTypeNodeAsReferenced(node.type); break; } @@ -39067,6 +42418,7 @@ var ts; checkFunctionOrMethodDeclaration(node) || checkGrammarForGenerator(node); checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); } @@ -39074,11 +42426,11 @@ var ts; function checkFunctionOrMethodDeclaration(node) { checkDecorators(node); checkSignatureDeclaration(node); - var isAsync = ts.isAsyncFunctionLike(node); + var functionFlags = ts.getFunctionFlags(node); // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 142 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 143 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -39109,17 +42461,19 @@ var ts; } } checkSourceElement(node.body); - if (!node.asteriskToken) { - var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); + if ((functionFlags & 1 /* Generator */) === 0) { + var returnOrPromisedType = node.type && (functionFlags & 2 /* Async */ + ? checkAsyncFunctionReturnType(node) // Async function + : getTypeFromTypeNode(node.type)); // normal function checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } if (produceDiagnostics && !node.type) { // Report an implicit any error if there is no body, no explicit return type, and node is not a private method // in an ambient context - if (compilerOptions.noImplicitAny && ts.nodeIsMissing(node.body) && !isPrivateWithinAmbient(node)) { + if (noImplicitAny && ts.nodeIsMissing(node.body) && !isPrivateWithinAmbient(node)) { reportImplicitAnyError(node, anyType); } - if (node.asteriskToken && ts.nodeIsPresent(node.body)) { + if (functionFlags & 1 /* Generator */ && ts.nodeIsPresent(node.body)) { // A generator with a body and no type annotation can still cause errors. It can error if the // yielded values have no common supertype, or it can give an implicit any error if it has no // yielded values. The only way to trigger these errors is to try checking its return type. @@ -39138,56 +42492,54 @@ var ts; for (var _i = 0, deferredUnusedIdentifierNodes_1 = deferredUnusedIdentifierNodes; _i < deferredUnusedIdentifierNodes_1.length; _i++) { var node = deferredUnusedIdentifierNodes_1[_i]; switch (node.kind) { - case 261 /* SourceFile */: - case 230 /* ModuleDeclaration */: + case 264 /* SourceFile */: + case 232 /* ModuleDeclaration */: checkUnusedModuleMembers(node); break; - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: checkUnusedClassMembers(node); checkUnusedTypeParameters(node); break; - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: checkUnusedTypeParameters(node); break; - case 204 /* Block */: - case 232 /* CaseBlock */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: + case 206 /* Block */: + case 234 /* CaseBlock */: + case 213 /* ForStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: checkUnusedLocalsAndParameters(node); break; - case 150 /* Constructor */: - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: - case 185 /* ArrowFunction */: - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 151 /* Constructor */: + case 185 /* FunctionExpression */: + case 227 /* FunctionDeclaration */: + case 186 /* ArrowFunction */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: if (node.body) { checkUnusedLocalsAndParameters(node); } checkUnusedTypeParameters(node); break; - case 148 /* MethodSignature */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: - case 158 /* FunctionType */: - case 159 /* ConstructorType */: + case 149 /* MethodSignature */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 156 /* IndexSignature */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: checkUnusedTypeParameters(node); break; } - ; } } } function checkUnusedLocalsAndParameters(node) { - if (node.parent.kind !== 227 /* InterfaceDeclaration */ && noUnusedIdentifiers && !ts.isInAmbientContext(node)) { - var _loop_3 = function (key) { - var local = node.locals[key]; + if (node.parent.kind !== 229 /* InterfaceDeclaration */ && noUnusedIdentifiers && !ts.isInAmbientContext(node)) { + node.locals.forEach(function (local) { if (!local.isReferenced) { - if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 144 /* Parameter */) { + if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 145 /* Parameter */) { var parameter = ts.getRootDeclaration(local.valueDeclaration); if (compilerOptions.noUnusedParameters && !ts.isParameterPropertyDeclaration(parameter) && @@ -39200,22 +42552,28 @@ var ts; ts.forEach(local.declarations, function (d) { return errorUnusedLocal(d.name || d, local.name); }); } } - }; - for (var key in node.locals) { - _loop_3(key); - } + }); } } + function isRemovedPropertyFromObjectSpread(node) { + if (ts.isBindingElement(node) && ts.isObjectBindingPattern(node.parent)) { + var lastElement = ts.lastOrUndefined(node.parent.elements); + return lastElement !== node && !!lastElement.dotDotDotToken; + } + return false; + } function errorUnusedLocal(node, name) { if (isIdentifierThatStartsWithUnderScore(node)) { var declaration = ts.getRootDeclaration(node.parent); - if (declaration.kind === 223 /* VariableDeclaration */ && - (declaration.parent.parent.kind === 212 /* ForInStatement */ || - declaration.parent.parent.kind === 213 /* ForOfStatement */)) { + if (declaration.kind === 225 /* VariableDeclaration */ && + (declaration.parent.parent.kind === 214 /* ForInStatement */ || + declaration.parent.parent.kind === 215 /* ForOfStatement */)) { return; } } - error(node, ts.Diagnostics._0_is_declared_but_never_used, name); + if (!isRemovedPropertyFromObjectSpread(node.kind === 70 /* Identifier */ ? node.parent : node)) { + error(node, ts.Diagnostics._0_is_declared_but_never_used, name); + } } function parameterNameStartsWithUnderscore(parameterName) { return parameterName && isIdentifierThatStartsWithUnderScore(parameterName); @@ -39228,12 +42586,12 @@ var ts; if (node.members) { for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 149 /* MethodDeclaration */ || member.kind === 147 /* PropertyDeclaration */) { + if (member.kind === 150 /* MethodDeclaration */ || member.kind === 148 /* PropertyDeclaration */) { if (!member.symbol.isReferenced && ts.getModifierFlags(member) & 8 /* Private */) { error(member.name, ts.Diagnostics._0_is_declared_but_never_used, member.symbol.name); } } - else if (member.kind === 150 /* Constructor */) { + else if (member.kind === 151 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.getModifierFlags(parameter) & 8 /* Private */) { @@ -39266,22 +42624,21 @@ var ts; } function checkUnusedModuleMembers(node) { if (compilerOptions.noUnusedLocals && !ts.isInAmbientContext(node)) { - for (var key in node.locals) { - var local = node.locals[key]; + node.locals.forEach(function (local) { if (!local.isReferenced && !local.exportSymbol) { for (var _i = 0, _a = local.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; if (!ts.isAmbientModule(declaration)) { - error(declaration.name, ts.Diagnostics._0_is_declared_but_never_used, local.name); + errorUnusedLocal(declaration.name, local.name); } } } - } + }); } } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 204 /* Block */) { + if (node.kind === 206 /* Block */) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); @@ -39304,12 +42661,12 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 147 /* PropertyDeclaration */ || - node.kind === 146 /* PropertySignature */ || - node.kind === 149 /* MethodDeclaration */ || - node.kind === 148 /* MethodSignature */ || - node.kind === 151 /* GetAccessor */ || - node.kind === 152 /* SetAccessor */) { + if (node.kind === 148 /* PropertyDeclaration */ || + node.kind === 147 /* PropertySignature */ || + node.kind === 150 /* MethodDeclaration */ || + node.kind === 149 /* MethodSignature */ || + node.kind === 152 /* GetAccessor */ || + node.kind === 153 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -39318,7 +42675,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 144 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 145 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -39329,10 +42686,14 @@ var ts; potentialThisCollisions.push(node); } } + function checkCollisionWithCapturedNewTargetVariable(node, name) { + if (needCollisionCheckForIdentifier(node, name, "_newTarget")) { + potentialNewTargetCollisions.push(node); + } + } // this function will run after checking the source file so 'CaptureThis' is correct for all nodes function checkIfThisIsCapturedInEnclosingScope(node) { - var current = node; - while (current) { + ts.findAncestor(node, function (current) { if (getNodeCheckFlags(current) & 4 /* CaptureThis */) { var isDeclaration_1 = node.kind !== 70 /* Identifier */; if (isDeclaration_1) { @@ -39341,10 +42702,23 @@ var ts; else { error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference); } - return; + return true; } - current = current.parent; - } + }); + } + function checkIfNewTargetIsCapturedInEnclosingScope(node) { + ts.findAncestor(node, function (current) { + if (getNodeCheckFlags(current) & 8 /* CaptureNewTarget */) { + var isDeclaration_2 = node.kind !== 70 /* Identifier */; + if (isDeclaration_2) { + error(node.name, ts.Diagnostics.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference); + } + else { + error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference); + } + return true; + } + }); } function checkCollisionWithCapturedSuperVariable(node, name) { if (!needCollisionCheckForIdentifier(node, name, "_super")) { @@ -39357,8 +42731,8 @@ var ts; return; } if (ts.getClassExtendsHeritageClauseElement(enclosingClass)) { - var isDeclaration_2 = node.kind !== 70 /* Identifier */; - if (isDeclaration_2) { + var isDeclaration_3 = node.kind !== 70 /* Identifier */; + if (isDeclaration_3) { error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); } else { @@ -39375,27 +42749,27 @@ var ts; return; } // Uninstantiated modules shouldnt do this check - if (node.kind === 230 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { + if (node.kind === 232 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 261 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 264 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } function checkCollisionWithGlobalPromiseInGeneratedCode(node, name) { - if (!needCollisionCheckForIdentifier(node, name, "Promise")) { + if (languageVersion >= 4 /* ES2017 */ || !needCollisionCheckForIdentifier(node, name, "Promise")) { return; } // Uninstantiated modules shouldnt do this check - if (node.kind === 230 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { + if (node.kind === 232 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 261 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 8192 /* HasAsyncFunctions */) { + if (parent.kind === 264 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024 /* HasAsyncFunctions */) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -39430,7 +42804,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 223 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 225 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -39440,24 +42814,24 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 224 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 205 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 226 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 207 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 204 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 231 /* ModuleBlock */ || - container.kind === 230 /* ModuleDeclaration */ || - container.kind === 261 /* SourceFile */); + (container.kind === 206 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 233 /* ModuleBlock */ || + container.kind === 232 /* ModuleDeclaration */ || + container.kind === 264 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail // since LHS will be block scoped name instead of function scoped if (!namesShareScope) { - var name_23 = symbolToString(localDeclarationSymbol); - error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_23, name_23); + var name = symbolToString(localDeclarationSymbol); + error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name); } } } @@ -39465,7 +42839,7 @@ var ts; } // Check that a parameter initializer contains no references to parameters declared to the right of itself function checkParameterInitializer(node) { - if (ts.getRootDeclaration(node).kind !== 144 /* Parameter */) { + if (ts.getRootDeclaration(node).kind !== 145 /* Parameter */) { return; } var func = ts.getContainingFunction(node); @@ -39476,7 +42850,7 @@ var ts; // skip declaration names (i.e. in object literal expressions) return; } - if (n.kind === 177 /* PropertyAccessExpression */) { + if (n.kind === 178 /* PropertyAccessExpression */) { // skip property names in property access expression return visit(n.expression); } @@ -39495,27 +42869,28 @@ var ts; // so we need to do a bit of extra work to check if reference is legal var enclosingContainer = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); if (enclosingContainer === func) { - if (symbol.valueDeclaration.kind === 144 /* Parameter */) { + if (symbol.valueDeclaration.kind === 145 /* Parameter */ || + symbol.valueDeclaration.kind === 175 /* BindingElement */) { // it is ok to reference parameter in initializer if either // - parameter is located strictly on the left of current parameter declaration if (symbol.valueDeclaration.pos < node.pos) { return; } // - parameter is wrapped in function-like entity - var current = n; - while (current !== node.initializer) { - if (ts.isFunctionLike(current.parent)) { - return; + if (ts.findAncestor(n, function (current) { + if (current === node.initializer) { + return "quit"; } - // computed property names/initializers in instance property declaration of class like entities - // are executed in constructor and thus deferred - if (current.parent.kind === 147 /* PropertyDeclaration */ && - !(ts.hasModifier(current.parent, 32 /* Static */)) && - ts.isClassLike(current.parent.parent)) { - return; - } - current = current.parent; + return ts.isFunctionLike(current.parent) || + // computed property names/initializers in instance property declaration of class like entities + // are executed in constructor and thus deferred + (current.parent.kind === 148 /* PropertyDeclaration */ && + !(ts.hasModifier(current.parent, 32 /* Static */)) && + ts.isClassLike(current.parent.parent)); + })) { + return; } + // fall through to report error } error(n, ts.Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, ts.declarationNameToString(node.name), ts.declarationNameToString(n)); } @@ -39536,40 +42911,46 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 142 /* ComputedPropertyName */) { + if (node.name.kind === 143 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 174 /* BindingElement */) { + if (node.kind === 175 /* BindingElement */) { + if (node.parent.kind === 173 /* ObjectBindingPattern */ && languageVersion < 5 /* ESNext */) { + checkExternalEmitHelpers(node, 4 /* Rest */); + } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 142 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 143 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access - var parent_10 = node.parent.parent; - var parentType = getTypeForBindingElementParent(parent_10); - var name_24 = node.propertyName || node.name; - var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name_24)); + var parent = node.parent.parent; + var parentType = getTypeForBindingElementParent(parent); + var name = node.propertyName || node.name; + var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name)); markPropertyAsReferenced(property); - if (parent_10.initializer && property && getParentOfSymbol(property)) { - checkClassPropertyAccess(parent_10, parent_10.initializer, parentType, property); + if (parent.initializer && property) { + checkPropertyAccessibility(parent, parent.initializer, parentType, property); } } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { + if (node.name.kind === 174 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 512 /* Read */); + } ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.getRootDeclaration(node).kind === 144 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 145 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { // Don't validate for-in initializer as it is already an error - if (node.initializer && node.parent.parent.kind !== 212 /* ForInStatement */) { + if (node.initializer && node.parent.parent.kind !== 214 /* ForInStatement */) { checkTypeAssignableTo(checkExpressionCached(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, /*headMessage*/ undefined); checkParameterInitializer(node); } @@ -39580,7 +42961,7 @@ var ts; if (node === symbol.valueDeclaration) { // Node is the primary declaration of the symbol, just validate the initializer // Don't validate for-in initializer as it is already an error - if (node.initializer && node.parent.parent.kind !== 212 /* ForInStatement */) { + if (node.initializer && node.parent.parent.kind !== 214 /* ForInStatement */) { checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, /*headMessage*/ undefined); checkParameterInitializer(node); } @@ -39600,21 +42981,22 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 147 /* PropertyDeclaration */ && node.kind !== 146 /* PropertySignature */) { + if (node.kind !== 148 /* PropertyDeclaration */ && node.kind !== 147 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 223 /* VariableDeclaration */ || node.kind === 174 /* BindingElement */) { + if (node.kind === 225 /* VariableDeclaration */ || node.kind === 175 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 144 /* Parameter */ && right.kind === 223 /* VariableDeclaration */) || - (left.kind === 223 /* VariableDeclaration */ && right.kind === 144 /* Parameter */)) { + if ((left.kind === 145 /* Parameter */ && right.kind === 225 /* VariableDeclaration */) || + (left.kind === 225 /* VariableDeclaration */ && right.kind === 145 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -39644,8 +43026,8 @@ var ts; } function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) { // We only disallow modifier on a method declaration if it is a property of object-literal-expression - if (node.modifiers && node.parent.kind === 176 /* ObjectLiteralExpression */) { - if (ts.isAsyncFunctionLike(node)) { + if (node.modifiers && node.parent.kind === 177 /* ObjectLiteralExpression */) { + if (ts.getFunctionFlags(node) & 2 /* Async */) { if (node.modifiers.length > 1) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } @@ -39665,7 +43047,7 @@ var ts; checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 206 /* EmptyStatement */) { + if (node.thenStatement.kind === 208 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -39685,12 +43067,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 224 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 226 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 224 /* VariableDeclarationList */) { + if (node.initializer.kind === 226 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -39708,19 +43090,29 @@ var ts; } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); + if (node.kind === 215 /* ForOfStatement */) { + if (node.awaitModifier) { + if (languageVersion < 4 /* ES2017 */) { + checkExternalEmitHelpers(node, 8192 /* ForAwaitOfIncludes */); + } + } + else if (languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 256 /* ForOfIncludes */); + } + } // Check the LHS and RHS // If the LHS is a declaration, just check it as a variable declaration, which will in turn check the RHS // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 224 /* VariableDeclarationList */) { + if (node.initializer.kind === 226 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; - var iteratedType = checkRightHandSideOfForOf(node.expression); + var iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier); // There may be a destructuring assignment on the left side - if (varExpr.kind === 175 /* ArrayLiteralExpression */ || varExpr.kind === 176 /* ObjectLiteralExpression */) { + if (varExpr.kind === 176 /* ArrayLiteralExpression */ || varExpr.kind === 177 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -39752,7 +43144,7 @@ var ts; // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 224 /* VariableDeclarationList */) { + if (node.initializer.kind === 226 /* VariableDeclarationList */) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -39766,7 +43158,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 175 /* ArrayLiteralExpression */ || varExpr.kind === 176 /* ObjectLiteralExpression */) { + if (varExpr.kind === 176 /* ArrayLiteralExpression */ || varExpr.kind === 177 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -39779,7 +43171,7 @@ var ts; } // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved // in this case error about missing name is already reported - do not report extra one - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 /* Object */ | 16384 /* TypeParameter */ | 524288 /* IndexedAccess */)) { + if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 /* Object */ | 540672 /* TypeVariable */ | 16777216 /* NonPrimitive */)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } checkSourceElement(node.statement); @@ -39795,52 +43187,113 @@ var ts; checkVariableDeclaration(decl); } } - function checkRightHandSideOfForOf(rhsExpression) { + function checkRightHandSideOfForOf(rhsExpression, awaitModifier) { var expressionType = checkNonNullExpression(rhsExpression); - return checkIteratedTypeOrElementType(expressionType, rhsExpression, /*allowStringInput*/ true); + return checkIteratedTypeOrElementType(expressionType, rhsExpression, /*allowStringInput*/ true, awaitModifier !== undefined); } - function checkIteratedTypeOrElementType(inputType, errorNode, allowStringInput) { + function checkIteratedTypeOrElementType(inputType, errorNode, allowStringInput, allowAsyncIterable) { if (isTypeAny(inputType)) { return inputType; } - if (languageVersion >= 2 /* ES2015 */) { - return checkElementTypeOfIterable(inputType, errorNode); - } - if (allowStringInput) { - return checkElementTypeOfArrayOrString(inputType, errorNode); - } - if (isArrayLikeType(inputType)) { - var indexType = getIndexTypeOfType(inputType, 1 /* Number */); - if (indexType) { - return indexType; - } - } - if (errorNode) { - error(errorNode, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(inputType)); - } - return unknownType; + return getIteratedTypeOrElementType(inputType, errorNode, allowStringInput, allowAsyncIterable, /*checkAssignability*/ true) || anyType; } /** - * When errorNode is undefined, it means we should not report any errors. + * When consuming an iterable type in a for..of, spread, or iterator destructuring assignment + * we want to get the iterated type of an iterable for ES2015 or later, or the iterated type + * of a iterable (if defined globally) or element type of an array like for ES2015 or earlier. */ - function checkElementTypeOfIterable(iterable, errorNode) { - var elementType = getElementTypeOfIterable(iterable, errorNode); - // Now even though we have extracted the iteratedType, we will have to validate that the type - // passed in is actually an Iterable. - if (errorNode && elementType) { - checkTypeAssignableTo(iterable, createIterableType(elementType), errorNode); + function getIteratedTypeOrElementType(inputType, errorNode, allowStringInput, allowAsyncIterable, checkAssignability) { + var uplevelIteration = languageVersion >= 2 /* ES2015 */; + var downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration; + // Get the iterated type of an `Iterable` or `IterableIterator` only in ES2015 + // or higher, when inside of an async generator or for-await-if, or when + // downlevelIteration is requested. + if (uplevelIteration || downlevelIteration || allowAsyncIterable) { + // We only report errors for an invalid iterable type in ES2015 or higher. + var iteratedType = getIteratedTypeOfIterable(inputType, uplevelIteration ? errorNode : undefined, allowAsyncIterable, allowAsyncIterable, checkAssignability); + if (iteratedType || uplevelIteration) { + return iteratedType; + } } - return elementType || anyType; + var arrayType = inputType; + var reportedError = false; + var hasStringConstituent = false; + // If strings are permitted, remove any string-like constituents from the array type. + // This allows us to find other non-string element types from an array unioned with + // a string. + if (allowStringInput) { + if (arrayType.flags & 65536 /* Union */) { + // After we remove all types that are StringLike, we will know if there was a string constituent + // based on whether the result of filter is a new array. + var arrayTypes = inputType.types; + var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 262178 /* StringLike */); }); + if (filteredTypes !== arrayTypes) { + arrayType = getUnionType(filteredTypes, /*subtypeReduction*/ true); + } + } + else if (arrayType.flags & 262178 /* StringLike */) { + arrayType = neverType; + } + hasStringConstituent = arrayType !== inputType; + if (hasStringConstituent) { + if (languageVersion < 1 /* ES5 */) { + if (errorNode) { + error(errorNode, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); + reportedError = true; + } + } + // Now that we've removed all the StringLike types, if no constituents remain, then the entire + // arrayOrStringType was a string. + if (arrayType.flags & 8192 /* Never */) { + return stringType; + } + } + } + if (!isArrayLikeType(arrayType)) { + if (errorNode && !reportedError) { + // Which error we report depends on whether we allow strings or if there was a + // string constituent. For example, if the input type is number | string, we + // want to say that number is not an array type. But if the input was just + // number and string input is allowed, we want to say that number is not an + // array type or a string type. + var diagnostic = !allowStringInput || hasStringConstituent + ? downlevelIteration + ? ts.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator + : ts.Diagnostics.Type_0_is_not_an_array_type + : downlevelIteration + ? ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator + : ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type; + error(errorNode, diagnostic, typeToString(arrayType)); + } + return hasStringConstituent ? stringType : undefined; + } + var arrayElementType = getIndexTypeOfType(arrayType, 1 /* Number */); + if (hasStringConstituent && arrayElementType) { + // This is just an optimization for the case where arrayOrStringType is string | string[] + if (arrayElementType.flags & 262178 /* StringLike */) { + return stringType; + } + return getUnionType([arrayElementType, stringType], /*subtypeReduction*/ true); + } + return arrayElementType; } /** * We want to treat type as an iterable, and get the type it is an iterable of. The iterable * must have the following structure (annotated with the names of the variables below): * - * { // iterable - * [Symbol.iterator]: { // iteratorFunction - * (): Iterator + * { // iterable + * [Symbol.iterator]: { // iteratorMethod + * (): Iterator + * } + * } + * + * For an async iterable, we expect the following structure: + * + * { // iterable + * [Symbol.asyncIterator]: { // iteratorMethod + * (): AsyncIterator + * } * } - * } * * T is the type we are after. At every level that involves analyzing return types * of signatures, we union the return types of all the signatures. @@ -39852,166 +43305,170 @@ var ts; * caller requested it. Then the caller can decide what to do in the case where there is no iterated * type. This is different from returning anyType, because that would signify that we have matched the * whole pattern and that T (above) is 'any'. + * + * For a **for-of** statement, `yield*` (in a normal generator), spread, array + * destructuring, or normal generator we will only ever look for a `[Symbol.iterator]()` + * method. + * + * For an async generator we will only ever look at the `[Symbol.asyncIterator]()` method. + * + * For a **for-await-of** statement or a `yield*` in an async generator we will look for + * the `[Symbol.asyncIterator]()` method first, and then the `[Symbol.iterator]()` method. */ - function getElementTypeOfIterable(type, errorNode) { + function getIteratedTypeOfIterable(type, errorNode, isAsyncIterable, allowNonAsyncIterables, checkAssignability) { if (isTypeAny(type)) { return undefined; } var typeAsIterable = type; - if (!typeAsIterable.iterableElementType) { - // As an optimization, if the type is instantiated directly using the globalIterableType (Iterable), - // then just grab its type argument. - if ((getObjectFlags(type) & 4 /* Reference */) && type.target === getGlobalIterableType()) { - typeAsIterable.iterableElementType = type.typeArguments[0]; - } - else { - var iteratorFunction = getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("iterator")); - if (isTypeAny(iteratorFunction)) { - return undefined; - } - var iteratorFunctionSignatures = iteratorFunction ? getSignaturesOfType(iteratorFunction, 0 /* Call */) : emptyArray; - if (iteratorFunctionSignatures.length === 0) { - if (errorNode) { - error(errorNode, ts.Diagnostics.Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator); - } - return undefined; - } - typeAsIterable.iterableElementType = getElementTypeOfIterator(getUnionType(ts.map(iteratorFunctionSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true), errorNode); + if (isAsyncIterable ? typeAsIterable.iteratedTypeOfAsyncIterable : typeAsIterable.iteratedTypeOfIterable) { + return isAsyncIterable ? typeAsIterable.iteratedTypeOfAsyncIterable : typeAsIterable.iteratedTypeOfIterable; + } + if (isAsyncIterable) { + // As an optimization, if the type is an instantiation of the global `AsyncIterable` + // or the global `AsyncIterableIterator` then just grab its type argument. + if (isReferenceToType(type, getGlobalAsyncIterableType(/*reportErrors*/ false)) || + isReferenceToType(type, getGlobalAsyncIterableIteratorType(/*reportErrors*/ false))) { + return typeAsIterable.iteratedTypeOfAsyncIterable = type.typeArguments[0]; } } - return typeAsIterable.iterableElementType; + if (!isAsyncIterable || allowNonAsyncIterables) { + // As an optimization, if the type is an instantiation of the global `Iterable` or + // `IterableIterator` then just grab its type argument. + if (isReferenceToType(type, getGlobalIterableType(/*reportErrors*/ false)) || + isReferenceToType(type, getGlobalIterableIteratorType(/*reportErrors*/ false))) { + return isAsyncIterable + ? typeAsIterable.iteratedTypeOfAsyncIterable = type.typeArguments[0] + : typeAsIterable.iteratedTypeOfIterable = type.typeArguments[0]; + } + } + var iteratorMethodSignatures; + var mayBeIterable = false; + if (isAsyncIterable) { + var iteratorMethod = getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("asyncIterator")); + if (isTypeAny(iteratorMethod)) { + return undefined; + } + iteratorMethodSignatures = iteratorMethod && getSignaturesOfType(iteratorMethod, 0 /* Call */); + } + if (!isAsyncIterable || (allowNonAsyncIterables && !ts.some(iteratorMethodSignatures))) { + var iteratorMethod = getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("iterator")); + if (isTypeAny(iteratorMethod)) { + return undefined; + } + iteratorMethodSignatures = iteratorMethod && getSignaturesOfType(iteratorMethod, 0 /* Call */); + mayBeIterable = true; + } + if (ts.some(iteratorMethodSignatures)) { + var iteratorMethodReturnType = getUnionType(ts.map(iteratorMethodSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true); + var iteratedType = getIteratedTypeOfIterator(iteratorMethodReturnType, errorNode, /*isAsyncIterator*/ false); + if (checkAssignability && errorNode && iteratedType) { + // If `checkAssignability` was specified, we were called from + // `checkIteratedTypeOrElementType`. As such, we need to validate that + // the type passed in is actually an Iterable. + checkTypeAssignableTo(type, mayBeIterable + ? createIterableType(iteratedType) + : createAsyncIterableType(iteratedType), errorNode); + } + return isAsyncIterable + ? typeAsIterable.iteratedTypeOfAsyncIterable = iteratedType + : typeAsIterable.iteratedTypeOfIterable = iteratedType; + } + if (errorNode) { + error(errorNode, isAsyncIterable + ? ts.Diagnostics.Type_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator + : ts.Diagnostics.Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator); + } + return undefined; } /** - * This function has very similar logic as getElementTypeOfIterable, except that it operates on + * This function has very similar logic as getIteratedTypeOfIterable, except that it operates on * Iterators instead of Iterables. Here is the structure: * * { // iterator - * next: { // iteratorNextFunction - * (): { // iteratorNextResult - * value: T // iteratorNextValue + * next: { // nextMethod + * (): { // nextResult + * value: T // nextValue * } * } * } * + * For an async iterator, we expect the following structure: + * + * { // iterator + * next: { // nextMethod + * (): PromiseLike<{ // nextResult + * value: T // nextValue + * }> + * } + * } */ - function getElementTypeOfIterator(type, errorNode) { + function getIteratedTypeOfIterator(type, errorNode, isAsyncIterator) { if (isTypeAny(type)) { return undefined; } var typeAsIterator = type; - if (!typeAsIterator.iteratorElementType) { - // As an optimization, if the type is instantiated directly using the globalIteratorType (Iterator), - // then just grab its type argument. - if ((getObjectFlags(type) & 4 /* Reference */) && type.target === getGlobalIteratorType()) { - typeAsIterator.iteratorElementType = type.typeArguments[0]; - } - else { - var iteratorNextFunction = getTypeOfPropertyOfType(type, "next"); - if (isTypeAny(iteratorNextFunction)) { - return undefined; - } - var iteratorNextFunctionSignatures = iteratorNextFunction ? getSignaturesOfType(iteratorNextFunction, 0 /* Call */) : emptyArray; - if (iteratorNextFunctionSignatures.length === 0) { - if (errorNode) { - error(errorNode, ts.Diagnostics.An_iterator_must_have_a_next_method); - } - return undefined; - } - var iteratorNextResult = getUnionType(ts.map(iteratorNextFunctionSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true); - if (isTypeAny(iteratorNextResult)) { - return undefined; - } - var iteratorNextValue = getTypeOfPropertyOfType(iteratorNextResult, "value"); - if (!iteratorNextValue) { - if (errorNode) { - error(errorNode, ts.Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); - } - return undefined; - } - typeAsIterator.iteratorElementType = iteratorNextValue; - } + if (isAsyncIterator ? typeAsIterator.iteratedTypeOfAsyncIterator : typeAsIterator.iteratedTypeOfIterator) { + return isAsyncIterator ? typeAsIterator.iteratedTypeOfAsyncIterator : typeAsIterator.iteratedTypeOfIterator; } - return typeAsIterator.iteratorElementType; - } - function getElementTypeOfIterableIterator(type) { - if (isTypeAny(type)) { + // As an optimization, if the type is an instantiation of the global `Iterator` (for + // a non-async iterator) or the global `AsyncIterator` (for an async-iterator) then + // just grab its type argument. + var getIteratorType = isAsyncIterator ? getGlobalAsyncIteratorType : getGlobalIteratorType; + if (isReferenceToType(type, getIteratorType(/*reportErrors*/ false))) { + return isAsyncIterator + ? typeAsIterator.iteratedTypeOfAsyncIterator = type.typeArguments[0] + : typeAsIterator.iteratedTypeOfIterator = type.typeArguments[0]; + } + // Both async and non-async iterators must have a `next` method. + var nextMethod = getTypeOfPropertyOfType(type, "next"); + if (isTypeAny(nextMethod)) { return undefined; } - // As an optimization, if the type is instantiated directly using the globalIterableIteratorType (IterableIterator), - // then just grab its type argument. - if ((getObjectFlags(type) & 4 /* Reference */) && type.target === getGlobalIterableIteratorType()) { - return type.typeArguments[0]; + var nextMethodSignatures = nextMethod ? getSignaturesOfType(nextMethod, 0 /* Call */) : emptyArray; + if (nextMethodSignatures.length === 0) { + if (errorNode) { + error(errorNode, isAsyncIterator + ? ts.Diagnostics.An_async_iterator_must_have_a_next_method + : ts.Diagnostics.An_iterator_must_have_a_next_method); + } + return undefined; } - return getElementTypeOfIterable(type, /*errorNode*/ undefined) || - getElementTypeOfIterator(type, /*errorNode*/ undefined); + var nextResult = getUnionType(ts.map(nextMethodSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true); + if (isTypeAny(nextResult)) { + return undefined; + } + // For an async iterator, we must get the awaited type of the return type. + if (isAsyncIterator) { + nextResult = getAwaitedTypeOfPromise(nextResult, errorNode, ts.Diagnostics.The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property); + if (isTypeAny(nextResult)) { + return undefined; + } + } + var nextValue = nextResult && getTypeOfPropertyOfType(nextResult, "value"); + if (!nextValue) { + if (errorNode) { + error(errorNode, isAsyncIterator + ? ts.Diagnostics.The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property + : ts.Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); + } + return undefined; + } + return isAsyncIterator + ? typeAsIterator.iteratedTypeOfAsyncIterator = nextValue + : typeAsIterator.iteratedTypeOfIterator = nextValue; } /** - * This function does the following steps: - * 1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents. - * 2. Take the element types of the array constituents. - * 3. Return the union of the element types, and string if there was a string constituent. - * - * For example: - * string -> string - * number[] -> number - * string[] | number[] -> string | number - * string | number[] -> string | number - * string | string[] | number[] -> string | number - * - * It also errors if: - * 1. Some constituent is neither a string nor an array. - * 2. Some constituent is a string and target is less than ES5 (because in ES3 string is not indexable). + * A generator may have a return type of `Iterator`, `Iterable`, or + * `IterableIterator`. An async generator may have a return type of `AsyncIterator`, + * `AsyncIterable`, or `AsyncIterableIterator`. This function can be used to extract + * the iterated type from this return type for contextual typing and verifying signatures. */ - function checkElementTypeOfArrayOrString(arrayOrStringType, errorNode) { - ts.Debug.assert(languageVersion < 2 /* ES2015 */); - var arrayType = arrayOrStringType; - if (arrayOrStringType.flags & 65536 /* Union */) { - // After we remove all types that are StringLike, we will know if there was a string constituent - // based on whether the result of filter is a new array. - var arrayTypes = arrayOrStringType.types; - var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 262178 /* StringLike */); }); - if (filteredTypes !== arrayTypes) { - arrayType = getUnionType(filteredTypes, /*subtypeReduction*/ true); - } + function getIteratedTypeOfGenerator(returnType, isAsyncGenerator) { + if (isTypeAny(returnType)) { + return undefined; } - else if (arrayOrStringType.flags & 262178 /* StringLike */) { - arrayType = neverType; - } - var hasStringConstituent = arrayOrStringType !== arrayType; - var reportedError = false; - if (hasStringConstituent) { - if (languageVersion < 1 /* ES5 */) { - error(errorNode, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); - reportedError = true; - } - // Now that we've removed all the StringLike types, if no constituents remain, then the entire - // arrayOrStringType was a string. - if (arrayType.flags & 8192 /* Never */) { - return stringType; - } - } - if (!isArrayLikeType(arrayType)) { - if (!reportedError) { - // Which error we report depends on whether there was a string constituent. For example, - // if the input type is number | string, we want to say that number is not an array type. - // But if the input was just number, we want to say that number is not an array type - // or a string type. - var diagnostic = hasStringConstituent - ? ts.Diagnostics.Type_0_is_not_an_array_type - : ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type; - error(errorNode, diagnostic, typeToString(arrayType)); - } - return hasStringConstituent ? stringType : unknownType; - } - var arrayElementType = getIndexTypeOfType(arrayType, 1 /* Number */) || unknownType; - if (hasStringConstituent) { - // This is just an optimization for the case where arrayOrStringType is string | string[] - if (arrayElementType.flags & 262178 /* StringLike */) { - return stringType; - } - return getUnionType([arrayElementType, stringType], /*subtypeReduction*/ true); - } - return arrayElementType; + return getIteratedTypeOfIterable(returnType, /*errorNode*/ undefined, isAsyncGenerator, /*allowNonAsyncIterables*/ false, /*checkAssignability*/ false) + || getIteratedTypeOfIterator(returnType, /*errorNode*/ undefined, isAsyncGenerator); } function checkBreakOrContinueStatement(node) { // Grammar checking @@ -40019,10 +43476,12 @@ var ts; // TODO: Check that target label is valid } function isGetAccessorWithAnnotatedSetAccessor(node) { - return !!(node.kind === 151 /* GetAccessor */ && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 152 /* SetAccessor */))); + return !!(node.kind === 152 /* GetAccessor */ && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 153 /* SetAccessor */))); } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { - var unwrappedReturnType = ts.isAsyncFunctionLike(func) ? getPromisedType(returnType) : returnType; + var unwrappedReturnType = (ts.getFunctionFlags(func) & 3 /* AsyncOrAsyncGenerator */) === 2 /* Async */ + ? getPromisedTypeOfPromise(returnType) // Async function + : returnType; // AsyncGenerator function, Generator function, or normal function return unwrappedReturnType && maybeTypeOfKind(unwrappedReturnType, 1024 /* Void */ | 1 /* Any */); } function checkReturnStatement(node) { @@ -40039,40 +43498,41 @@ var ts; var returnType = getReturnTypeOfSignature(signature); if (strictNullChecks || node.expression || returnType.flags & 8192 /* Never */) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.asteriskToken) { + var functionFlags = ts.getFunctionFlags(func); + if (functionFlags & 1 /* Generator */) { // A generator does not need its return expressions checked against its return type. // Instead, the yield expressions are checked against the element type. // TODO: Check return expressions of generators when return type tracking is added // for generators. return; } - if (func.kind === 152 /* SetAccessor */) { + if (func.kind === 153 /* SetAccessor */) { if (node.expression) { - error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); + error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 150 /* Constructor */) { - if (node.expression && !checkTypeAssignableTo(exprType, returnType, node.expression)) { - error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); + else if (func.kind === 151 /* Constructor */) { + if (node.expression && !checkTypeAssignableTo(exprType, returnType, node)) { + error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } } else if (func.type || isGetAccessorWithAnnotatedSetAccessor(func)) { - if (ts.isAsyncFunctionLike(func)) { - var promisedType = getPromisedType(returnType); - var awaitedType = checkAwaitedType(exprType, node.expression || node, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); + if (functionFlags & 2 /* Async */) { + var promisedType = getPromisedTypeOfPromise(returnType); + var awaitedType = checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); if (promisedType) { // If the function has a return type, but promisedType is // undefined, an error will be reported in checkAsyncFunctionReturnType // so we don't need to report one here. - checkTypeAssignableTo(awaitedType, promisedType, node.expression || node); + checkTypeAssignableTo(awaitedType, promisedType, node); } } else { - checkTypeAssignableTo(exprType, returnType, node.expression || node); + checkTypeAssignableTo(exprType, returnType, node); } } } - else if (func.kind !== 150 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 151 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { // The function has a return type, but the return statement doesn't have an expression. error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } @@ -40081,7 +43541,7 @@ var ts; function checkWithStatement(node) { // Grammar checking for withStatement if (!checkGrammarStatementInAmbientContext(node)) { - if (node.flags & 524288 /* AwaitContext */) { + if (node.flags & 16384 /* AwaitContext */) { grammarErrorOnFirstToken(node, ts.Diagnostics.with_statements_are_not_allowed_in_an_async_function_block); } } @@ -40102,7 +43562,7 @@ var ts; var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 254 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 257 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -40114,7 +43574,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 253 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 256 /* CaseClause */) { var caseClause = clause; // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable @@ -40140,18 +43600,16 @@ var ts; function checkLabeledStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - var current = node.parent; - while (current) { + ts.findAncestor(node.parent, function (current) { if (ts.isFunctionLike(current)) { - break; + return "quit"; } - if (current.kind === 219 /* LabeledStatement */ && current.label.text === node.label.text) { + if (current.kind === 221 /* LabeledStatement */ && current.label.text === node.label.text) { var sourceFile = ts.getSourceFileOfNode(node); grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); - break; + return true; } - current = current.parent; - } + }); } // ensure that label is unique checkSourceElement(node.statement); @@ -40182,14 +43640,14 @@ var ts; grammarErrorOnFirstToken(catchClause.variableDeclaration.initializer, ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer); } else { - var blockLocals = catchClause.block.locals; - if (blockLocals) { - for (var caughtName in catchClause.locals) { - var blockLocal = blockLocals[caughtName]; + var blockLocals_1 = catchClause.block.locals; + if (blockLocals_1) { + ts.forEachKey(catchClause.locals, function (caughtName) { + var blockLocal = blockLocals_1.get(caughtName); if (blockLocal && (blockLocal.flags & 2 /* BlockScopedVariable */) !== 0) { grammarErrorOnNode(blockLocal.valueDeclaration, ts.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause, caughtName); } - } + }); } } } @@ -40241,15 +43699,16 @@ var ts; if (!indexType) { return; } + var propDeclaration = prop.valueDeclaration; // index is numeric and property name is not valid numeric literal - if (indexKind === 1 /* Number */ && !isNumericName(prop.valueDeclaration.name)) { + if (indexKind === 1 /* Number */ && !(propDeclaration ? isNumericName(propDeclaration.name) : isNumericLiteralName(prop.name))) { return; } // perform property check if property or indexer is declared in 'type' // this allows to rule out cases when both property and indexer are inherited from the base class var errorNode; - if (prop.valueDeclaration.name.kind === 142 /* ComputedPropertyName */ || prop.parent === containingType.symbol) { - errorNode = prop.valueDeclaration; + if (propDeclaration && (propDeclaration.name.kind === 143 /* ComputedPropertyName */ || prop.parent === containingType.symbol)) { + errorNode = propDeclaration; } else if (indexDeclaration) { errorNode = indexDeclaration; @@ -40279,16 +43738,26 @@ var ts; case "string": case "symbol": case "void": + case "object": error(name, message, name.text); } } - /** Check each type parameter and check that type parameters have no duplicate type parameter declarations */ + /** + * Check each type parameter and check that type parameters have no duplicate type parameter declarations + */ function checkTypeParameters(typeParameterDeclarations) { if (typeParameterDeclarations) { - for (var i = 0, n = typeParameterDeclarations.length; i < n; i++) { + var seenDefault = false; + for (var i = 0; i < typeParameterDeclarations.length; i++) { var node = typeParameterDeclarations[i]; checkTypeParameter(node); if (produceDiagnostics) { + if (node.default) { + seenDefault = true; + } + else if (seenDefault) { + error(node, ts.Diagnostics.Required_type_parameters_may_not_follow_optional_type_parameters); + } for (var j = 0; j < i; j++) { if (typeParameterDeclarations[j].symbol === node.symbol) { error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.declarationNameToString(node.name)); @@ -40299,23 +43768,65 @@ var ts; } } /** Check that type parameter lists are identical across multiple declarations */ - function checkTypeParameterListsIdentical(node, symbol) { + function checkTypeParameterListsIdentical(symbol) { if (symbol.declarations.length === 1) { return; } - var firstDecl; - for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { - var declaration = _a[_i]; - if (declaration.kind === 226 /* ClassDeclaration */ || declaration.kind === 227 /* InterfaceDeclaration */) { - if (!firstDecl) { - firstDecl = declaration; - } - else if (!areTypeParametersIdentical(firstDecl.typeParameters, node.typeParameters)) { - error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, node.name.text); + var links = getSymbolLinks(symbol); + if (!links.typeParametersChecked) { + links.typeParametersChecked = true; + var declarations = getClassOrInterfaceDeclarationsOfSymbol(symbol); + if (declarations.length <= 1) { + return; + } + var type = getDeclaredTypeOfSymbol(symbol); + if (!areTypeParametersIdentical(declarations, type.localTypeParameters)) { + // Report an error on every conflicting declaration. + var name = symbolToString(symbol); + for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { + var declaration = declarations_6[_i]; + error(declaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name); } } } } + function areTypeParametersIdentical(declarations, typeParameters) { + var maxTypeArgumentCount = ts.length(typeParameters); + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { + var declaration = declarations_7[_i]; + // If this declaration has too few or too many type parameters, we report an error + var numTypeParameters = ts.length(declaration.typeParameters); + if (numTypeParameters < minTypeArgumentCount || numTypeParameters > maxTypeArgumentCount) { + return false; + } + for (var i = 0; i < numTypeParameters; i++) { + var source = declaration.typeParameters[i]; + var target = typeParameters[i]; + // If the type parameter node does not have the same as the resolved type + // parameter at this position, we report an error. + if (source.name.text !== target.symbol.name) { + return false; + } + // If the type parameter node does not have an identical constraint as the resolved + // type parameter at this position, we report an error. + var sourceConstraint = source.constraint && getTypeFromTypeNode(source.constraint); + var targetConstraint = getConstraintFromTypeParameter(target); + if ((sourceConstraint || targetConstraint) && + (!sourceConstraint || !targetConstraint || !isTypeIdenticalTo(sourceConstraint, targetConstraint))) { + return false; + } + // If the type parameter node has a default and it is not identical to the default + // for the type parameter at this position, we report an error. + var sourceDefault = source.default && getTypeFromTypeNode(source.default); + var targetDefault = getDefaultFromTypeParameter(target); + if (sourceDefault && targetDefault && !isTypeIdenticalTo(sourceDefault, targetDefault)) { + return false; + } + } + } + return true; + } function checkClassExpression(node) { checkClassLikeDeclaration(node); checkNodeDeferred(node); @@ -40334,11 +43845,12 @@ var ts; registerForUnusedIdentifiersCheck(node); } function checkClassLikeDeclaration(node) { - checkGrammarClassDeclarationHeritageClauses(node); + checkGrammarClassLikeDeclaration(node); checkDecorators(node); if (node.name) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Class_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); } @@ -40348,19 +43860,27 @@ var ts; var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); var staticType = getTypeOfSymbol(symbol); - checkTypeParameterListsIdentical(node, symbol); + checkTypeParameterListsIdentical(symbol); checkClassForDuplicateDeclarations(node); + // Only check for reserved static identifiers on non-ambient context. + if (!ts.isInAmbientContext(node)) { + checkClassForStaticPropertyNameConflicts(node); + } var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { + if (languageVersion < 2 /* ES2015 */) { + checkExternalEmitHelpers(baseTypeNode.parent, 1 /* Extends */); + } var baseTypes = getBaseTypes(type); if (baseTypes.length && produceDiagnostics) { var baseType_1 = baseTypes[0]; - var staticBaseType = getBaseConstructorTypeOfClass(type); + var baseConstructorType = getBaseConstructorTypeOfClass(type); + var staticBaseType = getApparentType(baseConstructorType); checkBaseTypeAccessibility(staticBaseType, baseTypeNode); checkSourceElement(baseTypeNode.expression); if (baseTypeNode.typeArguments) { ts.forEach(baseTypeNode.typeArguments, checkSourceElement); - for (var _i = 0, _a = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments); _i < _a.length; _i++) { + for (var _i = 0, _a = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); _i < _a.length; _i++) { var constructor = _a[_i]; if (!checkTypeArgumentConstraints(constructor.typeParameters, baseTypeNode.typeArguments)) { break; @@ -40369,19 +43889,15 @@ var ts; } checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(baseType_1, type.thisType), node.name || node, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); checkTypeAssignableTo(staticType, getTypeWithoutSignatures(staticBaseType), node.name || node, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); - if (baseType_1.symbol.valueDeclaration && - !ts.isInAmbientContext(baseType_1.symbol.valueDeclaration) && - baseType_1.symbol.valueDeclaration.kind === 226 /* ClassDeclaration */) { - if (!isBlockScopedNameDeclaredBeforeUse(baseType_1.symbol.valueDeclaration, node)) { - error(baseTypeNode, ts.Diagnostics.A_class_must_be_declared_after_its_base_class); - } + if (baseConstructorType.flags & 540672 /* TypeVariable */ && !isMixinConstructorType(staticType)) { + error(node.name || node, ts.Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any); } - if (!(staticBaseType.symbol && staticBaseType.symbol.flags & 32 /* Class */)) { + if (!(staticBaseType.symbol && staticBaseType.symbol.flags & 32 /* Class */) && !(baseConstructorType.flags & 540672 /* TypeVariable */)) { // When the static base type is a "class-like" constructor function (but not actually a class), we verify // that all instantiated base constructor signatures return the same type. We can simply compare the type // references (as opposed to checking the structure of the types) because elsewhere we have already checked // that the base type is a class or interface type (and not, for example, an anonymous object type). - var constructors = getInstantiatedConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments); + var constructors = getInstantiatedConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); if (ts.forEach(constructors, function (sig) { return getReturnTypeOfSignature(sig) !== baseType_1; })) { error(baseTypeNode.expression, ts.Diagnostics.Base_constructors_must_all_have_the_same_return_type); } @@ -40400,8 +43916,7 @@ var ts; if (produceDiagnostics) { var t = getTypeFromTypeNode(typeRefNode); if (t !== unknownType) { - var declaredType = getObjectFlags(t) & 4 /* Reference */ ? t.target : t; - if (getObjectFlags(declaredType) & 3 /* ClassOrInterface */) { + if (isValidBaseType(t)) { checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(t, type.thisType), node.name || node, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); } else { @@ -40431,11 +43946,16 @@ var ts; function getTargetSymbol(s) { // if symbol is instantiated its flags are not copied from the 'target' // so we'll need to get back original 'target' symbol to work with correct set of flags - return s.flags & 16777216 /* Instantiated */ ? getSymbolLinks(s).target : s; + return getCheckFlags(s) & 1 /* Instantiated */ ? s.target : s; } function getClassLikeDeclarationOfSymbol(symbol) { return ts.forEach(symbol.declarations, function (d) { return ts.isClassLike(d) ? d : undefined; }); } + function getClassOrInterfaceDeclarationsOfSymbol(symbol) { + return ts.filter(symbol.declarations, function (d) { + return d.kind === 228 /* ClassDeclaration */ || d.kind === 229 /* InterfaceDeclaration */; + }); + } function checkKindsOfPropertyMemberOverrides(type, baseType) { // TypeScript 1.0 spec (April 2014): 8.2.3 // A derived class inherits all members from its base class it doesn't override. @@ -40451,11 +43971,11 @@ var ts; // Base class instance member variables and accessors can be overridden by // derived class instance member variables and accessors, but not by other kinds of members. // NOTE: assignability is checked in checkClassDeclaration - var baseProperties = getPropertiesOfObjectType(baseType); + var baseProperties = getPropertiesOfType(baseType); for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) { var baseProperty = baseProperties_1[_i]; var base = getTargetSymbol(baseProperty); - if (base.flags & 134217728 /* Prototype */) { + if (base.flags & 16777216 /* Prototype */) { continue; } var derived = getTargetSymbol(getPropertyOfObjectType(type, base.name)); @@ -40472,7 +43992,7 @@ var ts; // If there is no declaration for the derived class (as in the case of class expressions), // then the class cannot be declared abstract. if (baseDeclarationFlags & 128 /* Abstract */ && (!derivedClassDecl || !(ts.getModifierFlags(derivedClassDecl) & 128 /* Abstract */))) { - if (derivedClassDecl.kind === 197 /* ClassExpression */) { + if (derivedClassDecl.kind === 198 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -40483,7 +44003,7 @@ var ts; else { // derived overrides base. var derivedDeclarationFlags = getDeclarationModifierFlagsFromSymbol(derived); - if ((baseDeclarationFlags & 8 /* Private */) || (derivedDeclarationFlags & 8 /* Private */)) { + if (baseDeclarationFlags & 8 /* Private */ || derivedDeclarationFlags & 8 /* Private */) { // either base or derived property is private - not override, skip it continue; } @@ -40491,64 +44011,32 @@ var ts; // value of 'static' is not the same for properties - not override, skip it continue; } - if ((base.flags & derived.flags & 8192 /* Method */) || ((base.flags & 98308 /* PropertyOrAccessor */) && (derived.flags & 98308 /* PropertyOrAccessor */))) { + if (isMethodLike(base) && isMethodLike(derived) || base.flags & 98308 /* PropertyOrAccessor */ && derived.flags & 98308 /* PropertyOrAccessor */) { // method is overridden with method or property/accessor is overridden with property/accessor - correct case continue; } var errorMessage = void 0; - if (base.flags & 8192 /* Method */) { + if (isMethodLike(base)) { if (derived.flags & 98304 /* Accessor */) { errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; } else { - ts.Debug.assert((derived.flags & 4 /* Property */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; } } else if (base.flags & 4 /* Property */) { - ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; } else { - ts.Debug.assert((base.flags & 98304 /* Accessor */) !== 0); - ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; } - error(derived.valueDeclaration.name, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); + error(derived.valueDeclaration.name || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); } } } } function isAccessor(kind) { - return kind === 151 /* GetAccessor */ || kind === 152 /* SetAccessor */; - } - function areTypeParametersIdentical(list1, list2) { - if (!list1 && !list2) { - return true; - } - if (!list1 || !list2 || list1.length !== list2.length) { - return false; - } - // TypeScript 1.0 spec (April 2014): - // When a generic interface has multiple declarations, all declarations must have identical type parameter - // lists, i.e. identical type parameter names with identical constraints in identical order. - for (var i = 0, len = list1.length; i < len; i++) { - var tp1 = list1[i]; - var tp2 = list2[i]; - if (tp1.name.text !== tp2.name.text) { - return false; - } - if (!tp1.constraint && !tp2.constraint) { - continue; - } - if (!tp1.constraint || !tp2.constraint) { - return false; - } - if (!isTypeIdenticalTo(getTypeFromTypeNode(tp1.constraint), getTypeFromTypeNode(tp2.constraint))) { - return false; - } - } - return true; + return kind === 152 /* GetAccessor */ || kind === 153 /* SetAccessor */; } function checkInheritedPropertiesAreIdentical(type, typeNode) { var baseTypes = getBaseTypes(type); @@ -40556,16 +44044,16 @@ var ts; return true; } var seen = ts.createMap(); - ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; }); + ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen.set(p.name, { prop: p, containingType: type }); }); var ok = true; for (var _i = 0, baseTypes_2 = baseTypes; _i < baseTypes_2.length; _i++) { var base = baseTypes_2[_i]; - var properties = getPropertiesOfObjectType(getTypeWithThisArgument(base, type.thisType)); - for (var _a = 0, properties_6 = properties; _a < properties_6.length; _a++) { - var prop = properties_6[_a]; - var existing = seen[prop.name]; + var properties = getPropertiesOfType(getTypeWithThisArgument(base, type.thisType)); + for (var _a = 0, properties_8 = properties; _a < properties_8.length; _a++) { + var prop = properties_8[_a]; + var existing = seen.get(prop.name); if (!existing) { - seen[prop.name] = { prop: prop, containingType: base }; + seen.set(prop.name, { prop: prop, containingType: base }); } else { var isInheritedProperty = existing.containingType !== type; @@ -40573,7 +44061,7 @@ var ts; ok = false; var typeName1 = typeToString(existing.containingType); var typeName2 = typeToString(base); - var errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Named_property_0_of_types_1_and_2_are_not_identical, symbolToString(prop), typeName1, typeName2); + var errorInfo = ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Named_property_0_of_types_1_and_2_are_not_identical, symbolToString(prop), typeName1, typeName2); errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2); diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(typeNode, errorInfo)); } @@ -40590,9 +44078,9 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - checkTypeParameterListsIdentical(node, symbol); + checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 227 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 229 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -40699,7 +44187,7 @@ var ts; return value; function evalConstant(e) { switch (e.kind) { - case 190 /* PrefixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: var value_1 = evalConstant(e.operand); if (value_1 === undefined) { return undefined; @@ -40710,7 +44198,7 @@ var ts; case 51 /* TildeToken */: return ~value_1; } return undefined; - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -40734,12 +44222,13 @@ var ts; } return undefined; case 8 /* NumericLiteral */: + checkGrammarNumericLiteral(e); return +e.text; - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return evalConstant(e.expression); case 70 /* Identifier */: - case 178 /* ElementAccessExpression */: - case 177 /* PropertyAccessExpression */: + case 179 /* ElementAccessExpression */: + case 178 /* PropertyAccessExpression */: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); var enumType_1; @@ -40752,7 +44241,7 @@ var ts; } else { var expression = void 0; - if (e.kind === 178 /* ElementAccessExpression */) { + if (e.kind === 179 /* ElementAccessExpression */) { if (e.argumentExpression === undefined || e.argumentExpression.kind !== 9 /* StringLiteral */) { return undefined; @@ -40770,7 +44259,7 @@ var ts; if (current.kind === 70 /* Identifier */) { break; } - else if (current.kind === 177 /* PropertyAccessExpression */) { + else if (current.kind === 178 /* PropertyAccessExpression */) { current = current.expression; } else { @@ -40814,6 +44303,7 @@ var ts; checkGrammarDecorators(node) || checkGrammarModifiers(node); checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); @@ -40842,7 +44332,7 @@ var ts; var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 229 /* EnumDeclaration */) { + if (declaration.kind !== 231 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -40863,10 +44353,10 @@ var ts; } function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { - var declaration = declarations_5[_i]; - if ((declaration.kind === 226 /* ClassDeclaration */ || - (declaration.kind === 225 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { + var declaration = declarations_8[_i]; + if ((declaration.kind === 228 /* ClassDeclaration */ || + (declaration.kind === 227 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } @@ -40930,7 +44420,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 226 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 228 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -40943,7 +44433,7 @@ var ts; // We can detect if augmentation was applied using following rules: // - augmentation for a global scope is always applied // - augmentation for some external module is applied if symbol for augmentation is merged (it was combined with target module). - var checkBody = isGlobalAugmentation || (getSymbolOfNode(node).flags & 33554432 /* Merged */); + var checkBody = isGlobalAugmentation || (getSymbolOfNode(node).flags & 134217728 /* Transient */); if (checkBody && node.body) { // body of ambient external module is always a module block for (var _i = 0, _a = node.body.statements; _i < _a.length; _i++) { @@ -40981,39 +44471,39 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: // error each individual name in variable statement instead of marking the entire variable statement for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 240 /* ExportAssignment */: - case 241 /* ExportDeclaration */: + case 242 /* ExportAssignment */: + case 243 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 234 /* ImportEqualsDeclaration */: - case 235 /* ImportDeclaration */: + case 236 /* ImportEqualsDeclaration */: + case 237 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 174 /* BindingElement */: - case 223 /* VariableDeclaration */: - var name_25 = node.name; - if (ts.isBindingPattern(name_25)) { - for (var _b = 0, _c = name_25.elements; _b < _c.length; _b++) { + case 175 /* BindingElement */: + case 225 /* VariableDeclaration */: + var name = node.name; + if (ts.isBindingPattern(name)) { + for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { var el = _c[_b]; // mark individual names in binding pattern checkModuleAugmentationElement(el, isGlobalAugmentation); } break; } - // fallthrough - case 226 /* ClassDeclaration */: - case 229 /* EnumDeclaration */: - case 225 /* FunctionDeclaration */: - case 227 /* InterfaceDeclaration */: - case 230 /* ModuleDeclaration */: - case 228 /* TypeAliasDeclaration */: + // falls through + case 228 /* ClassDeclaration */: + case 231 /* EnumDeclaration */: + case 227 /* FunctionDeclaration */: + case 229 /* InterfaceDeclaration */: + case 232 /* ModuleDeclaration */: + case 230 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -41023,7 +44513,7 @@ var ts; // this is done it two steps // 1. quick check - if symbol for node is not merged - this is local symbol to this augmentation - report error // 2. main check - report error if value declaration of the parent symbol is module augmentation) - var reportError = !(symbol.flags & 33554432 /* Merged */); + var reportError = !(symbol.flags & 134217728 /* Transient */); if (!reportError) { // symbol should not originate in augmentation reportError = ts.isExternalModuleAugmentation(symbol.parent.declarations[0]); @@ -41036,12 +44526,12 @@ var ts; switch (node.kind) { case 70 /* Identifier */: return node; - case 141 /* QualifiedName */: + case 142 /* QualifiedName */: do { node = node.left; } while (node.kind !== 70 /* Identifier */); return node; - case 177 /* PropertyAccessExpression */: + case 178 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 70 /* Identifier */); @@ -41054,9 +44544,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 231 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 261 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 241 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 233 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 264 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 243 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -41089,7 +44579,7 @@ var ts; (symbol.flags & 793064 /* Type */ ? 793064 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 243 /* ExportSpecifier */ ? + var message = node.kind === 245 /* ExportSpecifier */ ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); @@ -41117,7 +44607,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 237 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 239 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -41174,8 +44664,10 @@ var ts; // export { x, y } // export { x, y } from "foo" ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 231 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 261 /* SourceFile */ && !inAmbientExternalModule) { + var inAmbientExternalModule = node.parent.kind === 233 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 233 /* ModuleBlock */ && + !node.moduleSpecifier && ts.isInAmbientContext(node); + if (node.parent.kind !== 264 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -41189,7 +44681,7 @@ var ts; } } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 261 /* SourceFile */ || node.parent.kind === 231 /* ModuleBlock */ || node.parent.kind === 230 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 264 /* SourceFile */ || node.parent.kind === 233 /* ModuleBlock */ || node.parent.kind === 232 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -41215,9 +44707,14 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 261 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 230 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { - error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); + var container = node.parent.kind === 264 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 232 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + if (node.isExportEquals) { + error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); + } + else { + error(node, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); + } return; } // Grammar checking @@ -41243,18 +44740,13 @@ var ts; } } function hasExportedMembers(moduleSymbol) { - for (var id in moduleSymbol.exports) { - if (id !== "export=") { - return true; - } - } - return false; + return ts.forEachEntry(moduleSymbol.exports, function (_, id) { return id !== "export="; }); } function checkExternalModuleExports(node) { var moduleSymbol = getSymbolOfNode(node); var links = getSymbolLinks(moduleSymbol); if (!links.exportsChecked) { - var exportEqualsSymbol = moduleSymbol.exports["export="]; + var exportEqualsSymbol = moduleSymbol.exports.get("export="); if (exportEqualsSymbol && hasExportedMembers(moduleSymbol)) { var declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; if (!isTopLevelInExternalModuleAugmentation(declaration)) { @@ -41263,35 +44755,35 @@ var ts; } // Checks for export * conflicts var exports = getExportsOfModule(moduleSymbol); - for (var id in exports) { + exports && exports.forEach(function (_a, id) { + var declarations = _a.declarations, flags = _a.flags; if (id === "__export") { - continue; + return; } - var _a = exports[id], declarations = _a.declarations, flags = _a.flags; // ECMA262: 15.2.1.1 It is a Syntax Error if the ExportedNames of ModuleItemList contains any duplicate entries. // (TS Exceptions: namespaces, function overloads, enums, and interfaces) if (flags & (1920 /* Namespace */ | 64 /* Interface */ | 384 /* Enum */)) { - continue; + return; } var exportedDeclarationsCount = ts.countWhere(declarations, isNotOverload); if (flags & 524288 /* TypeAlias */ && exportedDeclarationsCount <= 2) { // it is legal to merge type alias with other values // so count should be either 1 (just type alias) or 2 (type alias + merged value) - continue; + return; } if (exportedDeclarationsCount > 1) { - for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { - var declaration = declarations_6[_i]; + for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) { + var declaration = declarations_9[_i]; if (isNotOverload(declaration)) { diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Cannot_redeclare_exported_variable_0, id)); } } } - } + }); links.exportsChecked = true; } function isNotOverload(declaration) { - return (declaration.kind !== 225 /* FunctionDeclaration */ && declaration.kind !== 149 /* MethodDeclaration */) || + return (declaration.kind !== 227 /* FunctionDeclaration */ && declaration.kind !== 150 /* MethodDeclaration */) || !!declaration.body; } } @@ -41304,123 +44796,123 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 230 /* ModuleDeclaration */: - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 225 /* FunctionDeclaration */: + case 232 /* ModuleDeclaration */: + case 228 /* ClassDeclaration */: + case 229 /* InterfaceDeclaration */: + case 227 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } switch (kind) { - case 143 /* TypeParameter */: + case 144 /* TypeParameter */: return checkTypeParameter(node); - case 144 /* Parameter */: + case 145 /* Parameter */: return checkParameter(node); - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: return checkPropertyDeclaration(node); - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: return checkSignatureDeclaration(node); - case 155 /* IndexSignature */: + case 156 /* IndexSignature */: return checkSignatureDeclaration(node); - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: return checkMethodDeclaration(node); - case 150 /* Constructor */: + case 151 /* Constructor */: return checkConstructorDeclaration(node); - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: return checkAccessorDeclaration(node); - case 157 /* TypeReference */: + case 158 /* TypeReference */: return checkTypeReferenceNode(node); - case 156 /* TypePredicate */: + case 157 /* TypePredicate */: return checkTypePredicate(node); - case 160 /* TypeQuery */: + case 161 /* TypeQuery */: return checkTypeQuery(node); - case 161 /* TypeLiteral */: + case 162 /* TypeLiteral */: return checkTypeLiteral(node); - case 162 /* ArrayType */: + case 163 /* ArrayType */: return checkArrayType(node); - case 163 /* TupleType */: + case 164 /* TupleType */: return checkTupleType(node); - case 164 /* UnionType */: - case 165 /* IntersectionType */: + case 165 /* UnionType */: + case 166 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 166 /* ParenthesizedType */: - case 168 /* TypeOperator */: + case 167 /* ParenthesizedType */: + case 169 /* TypeOperator */: return checkSourceElement(node.type); - case 169 /* IndexedAccessType */: + case 170 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 170 /* MappedType */: + case 171 /* MappedType */: return checkMappedType(node); - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 204 /* Block */: - case 231 /* ModuleBlock */: + case 206 /* Block */: + case 233 /* ModuleBlock */: return checkBlock(node); - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: return checkVariableStatement(node); - case 207 /* ExpressionStatement */: + case 209 /* ExpressionStatement */: return checkExpressionStatement(node); - case 208 /* IfStatement */: + case 210 /* IfStatement */: return checkIfStatement(node); - case 209 /* DoStatement */: + case 211 /* DoStatement */: return checkDoStatement(node); - case 210 /* WhileStatement */: + case 212 /* WhileStatement */: return checkWhileStatement(node); - case 211 /* ForStatement */: + case 213 /* ForStatement */: return checkForStatement(node); - case 212 /* ForInStatement */: + case 214 /* ForInStatement */: return checkForInStatement(node); - case 213 /* ForOfStatement */: + case 215 /* ForOfStatement */: return checkForOfStatement(node); - case 214 /* ContinueStatement */: - case 215 /* BreakStatement */: + case 216 /* ContinueStatement */: + case 217 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 216 /* ReturnStatement */: + case 218 /* ReturnStatement */: return checkReturnStatement(node); - case 217 /* WithStatement */: + case 219 /* WithStatement */: return checkWithStatement(node); - case 218 /* SwitchStatement */: + case 220 /* SwitchStatement */: return checkSwitchStatement(node); - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: return checkLabeledStatement(node); - case 220 /* ThrowStatement */: + case 222 /* ThrowStatement */: return checkThrowStatement(node); - case 221 /* TryStatement */: + case 223 /* TryStatement */: return checkTryStatement(node); - case 223 /* VariableDeclaration */: + case 225 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 174 /* BindingElement */: + case 175 /* BindingElement */: return checkBindingElement(node); - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: return checkClassDeclaration(node); - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 228 /* TypeAliasDeclaration */: + case 230 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 235 /* ImportDeclaration */: + case 237 /* ImportDeclaration */: return checkImportDeclaration(node); - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: return checkExportDeclaration(node); - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: return checkExportAssignment(node); - case 206 /* EmptyStatement */: + case 208 /* EmptyStatement */: checkGrammarStatementInAmbientContext(node); return; - case 222 /* DebuggerStatement */: + case 224 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 244 /* MissingDeclaration */: + case 246 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -41442,17 +44934,17 @@ var ts; for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) { var node = deferredNodes_1[_i]; switch (node.kind) { - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - checkAccessorDeferred(node); + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + checkAccessorDeclaration(node); break; - case 197 /* ClassExpression */: + case 198 /* ClassExpression */: checkClassExpressionDeferred(node); break; } @@ -41477,6 +44969,7 @@ var ts; // Grammar checking checkGrammarSourceFile(node); potentialThisCollisions.length = 0; + potentialNewTargetCollisions.length = 0; deferredNodes = []; deferredUnusedIdentifierNodes = produceDiagnostics && noUnusedIdentifiers ? [] : undefined; ts.forEach(node.statements, checkSourceElement); @@ -41496,6 +44989,10 @@ var ts; ts.forEach(potentialThisCollisions, checkIfThisIsCapturedInEnclosingScope); potentialThisCollisions.length = 0; } + if (potentialNewTargetCollisions.length) { + ts.forEach(potentialNewTargetCollisions, checkIfNewTargetIsCapturedInEnclosingScope); + potentialNewTargetCollisions.length = 0; + } links.flags |= 1 /* TypeChecked */; } } @@ -41553,7 +45050,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 217 /* WithStatement */ && node.parent.statement === node) { + if (node.parent.kind === 219 /* WithStatement */ && node.parent.statement === node) { return true; } node = node.parent; @@ -41562,12 +45059,12 @@ var ts; return false; } function getSymbolsInScope(location, meaning) { - var symbols = ts.createMap(); - var memberFlags = 0 /* None */; if (isInsideWithStatementBody(location)) { // We cannot answer semantic questions within a with block, do not proceed any further return []; } + var symbols = ts.createMap(); + var memberFlags = 0 /* None */; populateSymbols(); return symbolsToArray(symbols); function populateSymbols() { @@ -41576,25 +45073,27 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 261 /* SourceFile */: + case 264 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 230 /* ModuleDeclaration */: + // falls through + case 232 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931 /* ModuleMember */); break; - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 197 /* ClassExpression */: + case 198 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); } - // fall through; this fall-through is necessary because we would like to handle + // falls through + // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: + case 228 /* ClassDeclaration */: + case 229 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -41603,7 +45102,7 @@ var ts; copySymbols(getSymbolOfNode(location).members, meaning & 793064 /* Type */); } break; - case 184 /* FunctionExpression */: + case 185 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -41631,17 +45130,16 @@ var ts; // We will copy all symbol regardless of its reserved name because // symbolsToArray will check whether the key is a reserved name and // it will not copy symbol with reserved name to the array - if (!symbols[id]) { - symbols[id] = symbol; + if (!symbols.has(id)) { + symbols.set(id, symbol); } } } function copySymbols(source, meaning) { if (meaning) { - for (var id in source) { - var symbol = source[id]; + source.forEach(function (symbol) { copySymbol(symbol, meaning); - } + }); } } } @@ -41652,28 +45150,28 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 143 /* TypeParameter */: - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 229 /* EnumDeclaration */: + case 144 /* TypeParameter */: + case 228 /* ClassDeclaration */: + case 229 /* InterfaceDeclaration */: + case 230 /* TypeAliasDeclaration */: + case 231 /* EnumDeclaration */: return true; } } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 141 /* QualifiedName */) { + while (node.parent && node.parent.kind === 142 /* QualifiedName */) { node = node.parent; } - return node.parent && (node.parent.kind === 157 /* TypeReference */ || node.parent.kind === 272 /* JSDocTypeReference */); + return node.parent && (node.parent.kind === 158 /* TypeReference */ || node.parent.kind === 276 /* JSDocTypeReference */); } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 177 /* PropertyAccessExpression */) { + while (node.parent && node.parent.kind === 178 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent && node.parent.kind === 199 /* ExpressionWithTypeArguments */; + return node.parent && node.parent.kind === 200 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -41690,13 +45188,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 141 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 142 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 234 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 236 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 240 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 242 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -41704,29 +45202,38 @@ var ts; function isInRightSideOfImportOrExportAssignment(node) { return getLeftSideOfImportEqualsOrExportAssignment(node) !== undefined; } + function getSpecialPropertyAssignmentSymbolFromEntityName(entityName) { + var specialPropertyAssignmentKind = ts.getSpecialPropertyAssignmentKind(entityName.parent.parent); + switch (specialPropertyAssignmentKind) { + case 1 /* ExportsProperty */: + case 3 /* PrototypeProperty */: + return getSymbolOfNode(entityName.parent); + case 4 /* ThisProperty */: + case 2 /* ModuleExports */: + case 5 /* Property */: + return getSymbolOfNode(entityName.parent.parent); + } + } function getSymbolOfEntityNameOrPropertyAccessExpression(entityName) { if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (ts.isInJavaScriptFile(entityName) && entityName.parent.kind === 177 /* PropertyAccessExpression */) { - var specialPropertyAssignmentKind = ts.getSpecialPropertyAssignmentKind(entityName.parent.parent); - switch (specialPropertyAssignmentKind) { - case 1 /* ExportsProperty */: - case 3 /* PrototypeProperty */: - return getSymbolOfNode(entityName.parent); - case 4 /* ThisProperty */: - case 2 /* ModuleExports */: - return getSymbolOfNode(entityName.parent.parent); - default: + if (ts.isInJavaScriptFile(entityName) && + entityName.parent.kind === 178 /* PropertyAccessExpression */ && + entityName.parent === entityName.parent.parent.left) { + // Check if this is a special property assignment + var specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(entityName); + if (specialPropertyAssignmentSymbol) { + return specialPropertyAssignmentSymbol; } } - if (entityName.parent.kind === 240 /* ExportAssignment */ && ts.isEntityNameExpression(entityName)) { + if (entityName.parent.kind === 242 /* ExportAssignment */ && ts.isEntityNameExpression(entityName)) { return resolveEntityName(entityName, /*all meanings*/ 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 8388608 /* Alias */); } - if (entityName.kind !== 177 /* PropertyAccessExpression */ && isInRightSideOfImportOrExportAssignment(entityName)) { + if (entityName.kind !== 178 /* PropertyAccessExpression */ && isInRightSideOfImportOrExportAssignment(entityName)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(entityName, 234 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(entityName, 236 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, /*dontResolveAlias*/ true); } @@ -41736,7 +45243,7 @@ var ts; if (isHeritageClauseElementIdentifier(entityName)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (entityName.parent.kind === 199 /* ExpressionWithTypeArguments */) { + if (entityName.parent.kind === 200 /* ExpressionWithTypeArguments */) { meaning = 793064 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { @@ -41747,9 +45254,12 @@ var ts; meaning = 1920 /* Namespace */; } meaning |= 8388608 /* Alias */; - return resolveEntityName(entityName, meaning); + var entityNameSymbol = resolveEntityName(entityName, meaning); + if (entityNameSymbol) { + return entityNameSymbol; + } } - else if (ts.isPartOfExpression(entityName)) { + if (ts.isPartOfExpression(entityName)) { if (ts.nodeIsMissing(entityName)) { // Missing entity name. return undefined; @@ -41760,14 +45270,14 @@ var ts; } return resolveEntityName(entityName, 107455 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (entityName.kind === 177 /* PropertyAccessExpression */) { + else if (entityName.kind === 178 /* PropertyAccessExpression */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); } return getNodeLinks(entityName).resolvedSymbol; } - else if (entityName.kind === 141 /* QualifiedName */) { + else if (entityName.kind === 142 /* QualifiedName */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkQualifiedName(entityName); @@ -41776,20 +45286,20 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = (entityName.parent.kind === 157 /* TypeReference */ || entityName.parent.kind === 272 /* JSDocTypeReference */) ? 793064 /* Type */ : 1920 /* Namespace */; + var meaning = (entityName.parent.kind === 158 /* TypeReference */ || entityName.parent.kind === 276 /* JSDocTypeReference */) ? 793064 /* Type */ : 1920 /* Namespace */; return resolveEntityName(entityName, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (entityName.parent.kind === 250 /* JsxAttribute */) { + else if (entityName.parent.kind === 252 /* JsxAttribute */) { return getJsxAttributePropertySymbol(entityName.parent); } - if (entityName.parent.kind === 156 /* TypePredicate */) { + if (entityName.parent.kind === 157 /* TypePredicate */) { return resolveEntityName(entityName, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node) { - if (node.kind === 261 /* SourceFile */) { + if (node.kind === 264 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } if (isInsideWithStatementBody(node)) { @@ -41807,8 +45317,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfEntityNameOrPropertyAccessExpression(node); } - else if (node.parent.kind === 174 /* BindingElement */ && - node.parent.parent.kind === 172 /* ObjectBindingPattern */ && + else if (node.parent.kind === 175 /* BindingElement */ && + node.parent.parent.kind === 173 /* ObjectBindingPattern */ && node === node.parent.propertyName) { var typeOfPattern = getTypeOfNode(node.parent.parent); var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.text); @@ -41819,8 +45329,8 @@ var ts; } switch (node.kind) { case 70 /* Identifier */: - case 177 /* PropertyAccessExpression */: - case 141 /* QualifiedName */: + case 178 /* PropertyAccessExpression */: + case 142 /* QualifiedName */: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 98 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); @@ -41830,16 +45340,16 @@ var ts; return sig.thisParameter; } } - // fallthrough + // falls through case 96 /* SuperKeyword */: var type = ts.isPartOfExpression(node) ? getTypeOfExpression(node) : getTypeFromTypeNode(node); return type.symbol; - case 167 /* ThisType */: + case 168 /* ThisType */: return getTypeFromTypeNode(node).symbol; case 122 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 150 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 151 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -41847,17 +45357,17 @@ var ts; // External module name in an import declaration if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 235 /* ImportDeclaration */ || node.parent.kind === 241 /* ExportDeclaration */) && + ((node.parent.kind === 237 /* ImportDeclaration */ || node.parent.kind === 243 /* ExportDeclaration */) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } if (ts.isInJavaScriptFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false)) { return resolveExternalModuleName(node, node); } - // Fall through + // falls through case 8 /* NumericLiteral */: // index access - if (node.parent.kind === 178 /* ElementAccessExpression */ && node.parent.argumentExpression === node) { + if (node.parent.kind === 179 /* ElementAccessExpression */ && node.parent.argumentExpression === node) { var objectType = getTypeOfExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -41874,7 +45384,7 @@ var ts; // The function returns a value symbol of an identifier in the short-hand property assignment. // This is necessary as an identifier in short-hand property assignment can contains two meaning: // property name and property value. - if (location && location.kind === 258 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 261 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 107455 /* Value */ | 8388608 /* Alias */); } return undefined; @@ -41891,7 +45401,13 @@ var ts; return unknownType; } if (ts.isPartOfTypeNode(node)) { - return getTypeFromTypeNode(node); + var typeFromTypeNode = getTypeFromTypeNode(node); + if (typeFromTypeNode && ts.isExpressionWithTypeArgumentsInClassImplementsClause(node)) { + var containingClass = ts.getContainingClass(node); + var classType = getTypeOfNode(containingClass); + typeFromTypeNode = getTypeWithThisArgument(typeFromTypeNode, classType.thisType); + } + return typeFromTypeNode; } if (ts.isPartOfExpression(node)) { return getRegularTypeOfExpression(node); @@ -41899,7 +45415,10 @@ var ts; if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(node)) { // A SyntaxKind.ExpressionWithTypeArguments is considered a type node, except when it occurs in the // extends clause of a class. We handle that case here. - return getBaseTypes(getDeclaredTypeOfSymbol(getSymbolOfNode(node.parent.parent)))[0]; + var classNode = ts.getContainingClass(node); + var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(classNode)); + var baseType = getBaseTypes(classType)[0]; + return baseType && getTypeWithThisArgument(baseType, classType.thisType); } if (isTypeDeclaration(node)) { // In this case, we call getSymbolOfNode instead of getSymbolAtLocation because it is a declaration @@ -41936,31 +45455,31 @@ var ts; // [ a ] from // [a] = [ some array ...] function getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr) { - ts.Debug.assert(expr.kind === 176 /* ObjectLiteralExpression */ || expr.kind === 175 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.kind === 177 /* ObjectLiteralExpression */ || expr.kind === 176 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 213 /* ForOfStatement */) { - var iteratedType = checkRightHandSideOfForOf(expr.parent.expression); + if (expr.parent.kind === 215 /* ForOfStatement */) { + var iteratedType = checkRightHandSideOfForOf(expr.parent.expression, expr.parent.awaitModifier); return checkDestructuringAssignment(expr, iteratedType || unknownType); } // If this is from "for" initializer // for ({a } = elems[0];.....) { } - if (expr.parent.kind === 192 /* BinaryExpression */) { + if (expr.parent.kind === 193 /* BinaryExpression */) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || unknownType); } // If this is from nested object binding pattern // for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { - if (expr.parent.kind === 257 /* PropertyAssignment */) { + if (expr.parent.kind === 260 /* PropertyAssignment */) { var typeOfParentObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent.parent); return checkObjectLiteralDestructuringPropertyAssignment(typeOfParentObjectLiteral || unknownType, expr.parent); } // Array literal assignment - array destructuring pattern - ts.Debug.assert(expr.parent.kind === 175 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.parent.kind === 176 /* ArrayLiteralExpression */); // [{ property1: p1, property2 }] = elems; var typeOfArrayLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent); - var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, /*allowStringInput*/ false) || unknownType; + var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, /*allowStringInput*/ false, /*allowAsyncIterable*/ false) || unknownType; return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, ts.indexOf(expr.parent.elements, expr), elementType || unknownType); } // Gets the property symbol corresponding to the property in destructuring assignment @@ -41981,9 +45500,9 @@ var ts; return getRegularTypeOfLiteralType(getTypeOfExpression(expr)); } /** - * Gets either the static or instance type of a class element, based on - * whether the element is declared as "static". - */ + * Gets either the static or instance type of a class element, based on + * whether the element is declared as "static". + */ function getParentTypeOfClassElement(node) { var classSymbol = getSymbolOfNode(node.parent); return ts.getModifierFlags(node) & 32 /* Static */ @@ -41997,29 +45516,32 @@ var ts; var propsByName = createSymbolTable(getPropertiesOfType(type)); if (getSignaturesOfType(type, 0 /* Call */).length || getSignaturesOfType(type, 1 /* Construct */).length) { ts.forEach(getPropertiesOfType(globalFunctionType), function (p) { - if (!propsByName[p.name]) { - propsByName[p.name] = p; + if (!propsByName.has(p.name)) { + propsByName.set(p.name, p); } }); } return getNamedMembers(propsByName); } function getRootSymbols(symbol) { - if (symbol.flags & 268435456 /* SyntheticProperty */) { + if (getCheckFlags(symbol) & 6 /* Synthetic */) { var symbols_3 = []; - var name_26 = symbol.name; + var name_2 = symbol.name; ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) { - var symbol = getPropertyOfType(t, name_26); + var symbol = getPropertyOfType(t, name_2); if (symbol) { symbols_3.push(symbol); } }); return symbols_3; } - else if (symbol.flags & 67108864 /* Transient */) { + else if (symbol.flags & 134217728 /* Transient */) { if (symbol.leftSpread) { var links = symbol; - return [links.leftSpread, links.rightSpread]; + return getRootSymbols(links.leftSpread).concat(getRootSymbols(links.rightSpread)); + } + if (symbol.syntheticOrigin) { + return getRootSymbols(symbol.syntheticOrigin); } var target = void 0; var next = symbol; @@ -42037,7 +45559,8 @@ var ts; if (!ts.isGeneratedIdentifier(node)) { node = ts.getParseTreeNode(node, ts.isIdentifier); if (node) { - return getReferencedValueSymbol(node) === argumentsSymbol; + var isPropertyName_1 = node.parent.kind === 178 /* PropertyAccessExpression */ && node.parent.name === node; + return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } return false; @@ -42058,7 +45581,7 @@ var ts; // otherwise - check if at least one export is value symbolLinks.exportsSomeValue = hasExportAssignment ? !!(moduleSymbol.flags & 107455 /* Value */) - : ts.forEachProperty(getExportsOfModule(moduleSymbol), isValue); + : ts.forEachEntry(getExportsOfModule(moduleSymbol), isValue); } return symbolLinks.exportsSomeValue; function isValue(s) { @@ -42091,20 +45614,16 @@ var ts; } symbol = exportSymbol; } - var parentSymbol = getParentOfSymbol(symbol); - if (parentSymbol) { - if (parentSymbol.flags & 512 /* ValueModule */ && parentSymbol.valueDeclaration.kind === 261 /* SourceFile */) { - var symbolFile = parentSymbol.valueDeclaration; + var parentSymbol_1 = getParentOfSymbol(symbol); + if (parentSymbol_1) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 264 /* SourceFile */) { + var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined. var symbolIsUmdExport = symbolFile !== referenceFile; return symbolIsUmdExport ? undefined : symbolFile; } - for (var n = node.parent; n; n = n.parent) { - if (ts.isModuleOrEnumDeclaration(n) && getSymbolOfNode(n) === parentSymbol) { - return n; - } - } + return ts.findAncestor(node.parent, function (n) { return ts.isModuleOrEnumDeclaration(n) && getSymbolOfNode(n) === parentSymbol_1; }); } } } @@ -42150,7 +45669,7 @@ var ts; // they will not collide with anything var isDeclaredInLoop = nodeLinks_1.flags & 262144 /* BlockScopedBindingInLoop */; var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false); - var inLoopBodyBlock = container.kind === 204 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 206 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -42190,22 +45709,17 @@ var ts; return false; } function isValueAliasDeclaration(node) { - node = ts.getParseTreeNode(node); - if (node === undefined) { - // A synthesized node comes from an emit transformation and is always a value. - return true; - } switch (node.kind) { - case 234 /* ImportEqualsDeclaration */: - case 236 /* ImportClause */: - case 237 /* NamespaceImport */: - case 239 /* ImportSpecifier */: - case 243 /* ExportSpecifier */: + case 236 /* ImportEqualsDeclaration */: + case 238 /* ImportClause */: + case 239 /* NamespaceImport */: + case 241 /* ImportSpecifier */: + case 245 /* ExportSpecifier */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: return node.expression && node.expression.kind === 70 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) @@ -42215,7 +45729,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(node) { node = ts.getParseTreeNode(node, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 261 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 264 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -42236,11 +45750,6 @@ var ts; return isConstEnumSymbol(s) || s.constEnumOnlyModule; } function isReferencedAliasDeclaration(node, checkChildren) { - node = ts.getParseTreeNode(node); - // Purely synthesized nodes are always emitted. - if (node === undefined) { - return true; - } if (ts.isAliasSymbolDeclaration(node)) { var symbol = getSymbolOfNode(node); if (symbol && getSymbolLinks(symbol).referenced) { @@ -42272,16 +45781,30 @@ var ts; } return false; } + function isRequiredInitializedParameter(parameter) { + return strictNullChecks && + !isOptionalParameter(parameter) && + parameter.initializer && + !(ts.getModifierFlags(parameter) & 92 /* ParameterPropertyModifier */); + } function getNodeCheckFlags(node) { - node = ts.getParseTreeNode(node); - return node ? getNodeLinks(node).flags : undefined; + return getNodeLinks(node).flags; } function getEnumMemberValue(node) { computeEnumMemberValues(node.parent); return getNodeLinks(node).enumMemberValue; } + function canHaveConstantValue(node) { + switch (node.kind) { + case 263 /* EnumMember */: + case 178 /* PropertyAccessExpression */: + case 179 /* ElementAccessExpression */: + return true; + } + return false; + } function getConstantValue(node) { - if (node.kind === 260 /* EnumMember */) { + if (node.kind === 263 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -42299,16 +45822,18 @@ var ts; function getTypeReferenceSerializationKind(typeName, location) { // Resolve the symbol as a value to ensure the type can be reached at runtime during emit. var valueSymbol = resolveEntityName(typeName, 107455 /* Value */, /*ignoreErrors*/ true, /*dontResolveAlias*/ false, location); - var globalPromiseSymbol = tryGetGlobalPromiseConstructorSymbol(); - if (globalPromiseSymbol && valueSymbol === globalPromiseSymbol) { - return ts.TypeReferenceSerializationKind.Promise; - } - var constructorType = valueSymbol ? getTypeOfSymbol(valueSymbol) : undefined; - if (constructorType && isConstructorType(constructorType)) { - return ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue; - } // Resolve the symbol as a type so that we can provide a more useful hint for the type serializer. var typeSymbol = resolveEntityName(typeName, 793064 /* Type */, /*ignoreErrors*/ true, /*dontResolveAlias*/ false, location); + if (valueSymbol && valueSymbol === typeSymbol) { + var globalPromiseSymbol = getGlobalPromiseConstructorSymbol(/*reportErrors*/ false); + if (globalPromiseSymbol && valueSymbol === globalPromiseSymbol) { + return ts.TypeReferenceSerializationKind.Promise; + } + var constructorType = getTypeOfSymbol(valueSymbol); + if (constructorType && isConstructorType(constructorType)) { + return ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue; + } + } // We might not be able to resolve type symbol so use unknown type in that case (eg error case) if (!typeSymbol) { return ts.TypeReferenceSerializationKind.ObjectType; @@ -42354,6 +45879,9 @@ var ts; var type = symbol && !(symbol.flags & (2048 /* TypeLiteral */ | 131072 /* Signature */)) ? getWidenedLiteralType(getTypeOfSymbol(symbol)) : unknownType; + if (flags & 4096 /* AddUndefined */) { + type = includeFalsyTypes(type, 2048 /* Undefined */); + } getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { @@ -42368,10 +45896,13 @@ var ts; var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(node)); resolveBaseTypesOfClass(classType); var baseType = classType.resolvedBaseTypes.length ? classType.resolvedBaseTypes[0] : unknownType; + if (!baseType.symbol) { + writer.reportIllegalExtends(); + } getSymbolDisplayBuilder().buildTypeDisplay(baseType, writer, enclosingDeclaration, flags); } function hasGlobalName(name) { - return !!globals[name]; + return globals.has(name); } function getReferencedValueSymbol(reference, startInDeclarationContainer) { var resolvedSymbol = getNodeLinks(reference).resolvedSymbol; @@ -42382,9 +45913,9 @@ var ts; if (startInDeclarationContainer) { // When resolving the name of a declaration as a value, we need to start resolution // at a point outside of the declaration. - var parent_11 = reference.parent; - if (ts.isDeclaration(parent_11) && reference === parent_11.name) { - location = getDeclarationContainer(parent_11); + var parent = reference.parent; + if (ts.isDeclaration(parent) && reference === parent.name) { + location = getDeclarationContainer(parent); } } return resolveName(location, reference.text, 107455 /* Value */ | 1048576 /* ExportValue */ | 8388608 /* Alias */, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined); @@ -42420,34 +45951,48 @@ var ts; if (resolvedTypeReferenceDirectives) { // populate reverse mapping: file path -> type reference directive that was resolved to this file fileToDirective = ts.createFileMap(); - for (var key in resolvedTypeReferenceDirectives) { - var resolvedDirective = resolvedTypeReferenceDirectives[key]; + resolvedTypeReferenceDirectives.forEach(function (resolvedDirective, key) { if (!resolvedDirective) { - continue; + return; } var file = host.getSourceFile(resolvedDirective.resolvedFileName); fileToDirective.set(file.path, key); - } + }); } return { getReferencedExportContainer: getReferencedExportContainer, getReferencedImportDeclaration: getReferencedImportDeclaration, getReferencedDeclarationWithCollidingName: getReferencedDeclarationWithCollidingName, isDeclarationWithCollidingName: isDeclarationWithCollidingName, - isValueAliasDeclaration: isValueAliasDeclaration, + isValueAliasDeclaration: function (node) { + node = ts.getParseTreeNode(node); + // Synthesized nodes are always treated like values. + return node ? isValueAliasDeclaration(node) : true; + }, hasGlobalName: hasGlobalName, - isReferencedAliasDeclaration: isReferencedAliasDeclaration, - getNodeCheckFlags: getNodeCheckFlags, + isReferencedAliasDeclaration: function (node, checkChildren) { + node = ts.getParseTreeNode(node); + // Synthesized nodes are always treated as referenced. + return node ? isReferencedAliasDeclaration(node, checkChildren) : true; + }, + getNodeCheckFlags: function (node) { + node = ts.getParseTreeNode(node); + return node ? getNodeCheckFlags(node) : undefined; + }, isTopLevelValueImportEqualsWithEntityName: isTopLevelValueImportEqualsWithEntityName, isDeclarationVisible: isDeclarationVisible, isImplementationOfOverload: isImplementationOfOverload, + isRequiredInitializedParameter: isRequiredInitializedParameter, writeTypeOfDeclaration: writeTypeOfDeclaration, writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration, writeTypeOfExpression: writeTypeOfExpression, writeBaseConstructorTypeOfClass: writeBaseConstructorTypeOfClass, isSymbolAccessible: isSymbolAccessible, isEntityNameVisible: isEntityNameVisible, - getConstantValue: getConstantValue, + getConstantValue: function (node) { + node = ts.getParseTreeNode(node, canHaveConstantValue); + return node ? getConstantValue(node) : undefined; + }, collectLinkedAliases: collectLinkedAliases, getReferencedValueDeclaration: getReferencedValueDeclaration, getTypeReferenceSerializationKind: getTypeReferenceSerializationKind, @@ -42470,7 +46015,7 @@ var ts; // property access can only be used as values // qualified names can only be used as types\namespaces // identifiers are treated as values only if they appear in type queries - var meaning = (node.kind === 177 /* PropertyAccessExpression */) || (node.kind === 70 /* Identifier */ && isInTypeQuery(node)) + var meaning = (node.kind === 178 /* PropertyAccessExpression */) || (node.kind === 70 /* Identifier */ && isInTypeQuery(node)) ? 107455 /* Value */ | 1048576 /* ExportValue */ : 793064 /* Type */ | 1920 /* Namespace */; var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); @@ -42513,15 +46058,15 @@ var ts; // external modules cannot define or contribute to type declaration files var current = symbol; while (true) { - var parent_12 = getParentOfSymbol(current); - if (parent_12) { - current = parent_12; + var parent = getParentOfSymbol(current); + if (parent) { + current = parent; } else { break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 261 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 264 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -42541,7 +46086,7 @@ var ts; if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 261 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 264 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -42551,8 +46096,6 @@ var ts; } // Initialize global symbol table var augmentations; - var requestedExternalEmitHelpers = 0; - var firstFileRequestingExternalHelpers; for (var _b = 0, _c = host.getSourceFiles(); _b < _c.length; _b++) { var file = _c[_b]; if (!ts.isExternalOrCommonJsModule(file)) { @@ -42567,20 +46110,11 @@ var ts; if (file.symbol && file.symbol.globalExports) { // Merge in UMD exports with first-in-wins semantics (see #9771) var source = file.symbol.globalExports; - for (var id in source) { - if (!(id in globals)) { - globals[id] = source[id]; + source.forEach(function (sourceSymbol, id) { + if (!globals.has(id)) { + globals.set(id, sourceSymbol); } - } - } - if ((compilerOptions.isolatedModules || ts.isExternalModule(file)) && !file.isDeclarationFile) { - var fileRequestedExternalEmitHelpers = file.flags & 64512 /* EmitHelperFlags */; - if (fileRequestedExternalEmitHelpers) { - requestedExternalEmitHelpers |= fileRequestedExternalEmitHelpers; - if (firstFileRequestingExternalHelpers === undefined) { - firstFileRequestingExternalHelpers = file; - } - } + }); } } if (augmentations) { @@ -42597,110 +46131,67 @@ var ts; // Setup global builtins addToSymbolTable(globals, builtinGlobals, ts.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0); getSymbolLinks(undefinedSymbol).type = undefinedWideningType; - getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments"); + getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments", /*arity*/ 0, /*reportErrors*/ true); getSymbolLinks(unknownSymbol).type = unknownType; // Initialize special types - globalArrayType = getGlobalType("Array", /*arity*/ 1); - globalObjectType = getGlobalType("Object"); - globalFunctionType = getGlobalType("Function"); - globalStringType = getGlobalType("String"); - globalNumberType = getGlobalType("Number"); - globalBooleanType = getGlobalType("Boolean"); - globalRegExpType = getGlobalType("RegExp"); - jsxElementType = getExportedTypeFromNamespace("JSX", JsxNames.Element); - getGlobalClassDecoratorType = ts.memoize(function () { return getGlobalType("ClassDecorator"); }); - getGlobalPropertyDecoratorType = ts.memoize(function () { return getGlobalType("PropertyDecorator"); }); - getGlobalMethodDecoratorType = ts.memoize(function () { return getGlobalType("MethodDecorator"); }); - getGlobalParameterDecoratorType = ts.memoize(function () { return getGlobalType("ParameterDecorator"); }); - getGlobalTypedPropertyDescriptorType = ts.memoize(function () { return getGlobalType("TypedPropertyDescriptor", /*arity*/ 1); }); - getGlobalESSymbolConstructorSymbol = ts.memoize(function () { return getGlobalValueSymbol("Symbol"); }); - getGlobalPromiseType = ts.memoize(function () { return getGlobalType("Promise", /*arity*/ 1); }); - tryGetGlobalPromiseType = ts.memoize(function () { return getGlobalSymbol("Promise", 793064 /* Type */, /*diagnostic*/ undefined) && getGlobalPromiseType(); }); - getGlobalPromiseLikeType = ts.memoize(function () { return getGlobalType("PromiseLike", /*arity*/ 1); }); - getInstantiatedGlobalPromiseLikeType = ts.memoize(createInstantiatedPromiseLikeType); - getGlobalPromiseConstructorSymbol = ts.memoize(function () { return getGlobalValueSymbol("Promise"); }); - tryGetGlobalPromiseConstructorSymbol = ts.memoize(function () { return getGlobalSymbol("Promise", 107455 /* Value */, /*diagnostic*/ undefined) && getGlobalPromiseConstructorSymbol(); }); - getGlobalPromiseConstructorLikeType = ts.memoize(function () { return getGlobalType("PromiseConstructorLike"); }); - getGlobalThenableType = ts.memoize(createThenableType); - getGlobalTemplateStringsArrayType = ts.memoize(function () { return getGlobalType("TemplateStringsArray"); }); - if (languageVersion >= 2 /* ES2015 */) { - getGlobalESSymbolType = ts.memoize(function () { return getGlobalType("Symbol"); }); - getGlobalIterableType = ts.memoize(function () { return getGlobalType("Iterable", /*arity*/ 1); }); - getGlobalIteratorType = ts.memoize(function () { return getGlobalType("Iterator", /*arity*/ 1); }); - getGlobalIterableIteratorType = ts.memoize(function () { return getGlobalType("IterableIterator", /*arity*/ 1); }); - } - else { - getGlobalESSymbolType = ts.memoize(function () { return emptyObjectType; }); - getGlobalIterableType = ts.memoize(function () { return emptyGenericType; }); - getGlobalIteratorType = ts.memoize(function () { return emptyGenericType; }); - getGlobalIterableIteratorType = ts.memoize(function () { return emptyGenericType; }); - } + globalArrayType = getGlobalType("Array", /*arity*/ 1, /*reportErrors*/ true); + globalObjectType = getGlobalType("Object", /*arity*/ 0, /*reportErrors*/ true); + globalFunctionType = getGlobalType("Function", /*arity*/ 0, /*reportErrors*/ true); + globalStringType = getGlobalType("String", /*arity*/ 0, /*reportErrors*/ true); + globalNumberType = getGlobalType("Number", /*arity*/ 0, /*reportErrors*/ true); + globalBooleanType = getGlobalType("Boolean", /*arity*/ 0, /*reportErrors*/ true); + globalRegExpType = getGlobalType("RegExp", /*arity*/ 0, /*reportErrors*/ true); anyArrayType = createArrayType(anyType); autoArrayType = createArrayType(autoType); - var symbol = getGlobalSymbol("ReadonlyArray", 793064 /* Type */, /*diagnostic*/ undefined); - globalReadonlyArrayType = symbol && getTypeOfGlobalSymbol(symbol, /*arity*/ 1); + globalReadonlyArrayType = getGlobalTypeOrUndefined("ReadonlyArray", /*arity*/ 1); anyReadonlyArrayType = globalReadonlyArrayType ? createTypeFromGenericGlobalType(globalReadonlyArrayType, [anyType]) : anyArrayType; - // If we have specified that we are importing helpers, we should report global - // errors if we cannot resolve the helpers external module, or if it does not have - // the necessary helpers exported. - if (compilerOptions.importHelpers && firstFileRequestingExternalHelpers) { - // Find the first reference to the helpers module. - var helpersModule = resolveExternalModule(firstFileRequestingExternalHelpers, ts.externalHelpersModuleNameText, ts.Diagnostics.Cannot_find_module_0, - /*errorNode*/ undefined); - // If we found the module, report errors if it does not have the necessary exports. - if (helpersModule) { - var exports = helpersModule.exports; - if (requestedExternalEmitHelpers & 1024 /* HasClassExtends */ && languageVersion < 2 /* ES2015 */) { - verifyHelperSymbol(exports, "__extends", 107455 /* Value */); - } - if (requestedExternalEmitHelpers & 16384 /* HasSpreadAttribute */ && - (languageVersion < 5 /* ESNext */ || compilerOptions.jsx === 2 /* React */)) { - verifyHelperSymbol(exports, "__assign", 107455 /* Value */); - } - if (languageVersion < 5 /* ESNext */ && requestedExternalEmitHelpers & 32768 /* HasRestAttribute */) { - verifyHelperSymbol(exports, "__rest", 107455 /* Value */); - } - if (requestedExternalEmitHelpers & 2048 /* HasDecorators */) { - verifyHelperSymbol(exports, "__decorate", 107455 /* Value */); - if (compilerOptions.emitDecoratorMetadata) { - verifyHelperSymbol(exports, "__metadata", 107455 /* Value */); - } - } - if (requestedExternalEmitHelpers & 4096 /* HasParamDecorators */) { - verifyHelperSymbol(exports, "__param", 107455 /* Value */); - } - if (requestedExternalEmitHelpers & 8192 /* HasAsyncFunctions */) { - verifyHelperSymbol(exports, "__awaiter", 107455 /* Value */); - if (languageVersion < 2 /* ES2015 */) { - verifyHelperSymbol(exports, "__generator", 107455 /* Value */); + globalThisType = getGlobalTypeOrUndefined("ThisType", /*arity*/ 1); + } + function checkExternalEmitHelpers(location, helpers) { + if ((requestedExternalEmitHelpers & helpers) !== helpers && compilerOptions.importHelpers) { + var sourceFile = ts.getSourceFileOfNode(location); + if (ts.isEffectiveExternalModule(sourceFile, compilerOptions) && !ts.isInAmbientContext(location)) { + var helpersModule = resolveHelpersModule(sourceFile, location); + if (helpersModule !== unknownSymbol) { + var uncheckedHelpers = helpers & ~requestedExternalEmitHelpers; + for (var helper = 1 /* FirstEmitHelper */; helper <= 8192 /* LastEmitHelper */; helper <<= 1) { + if (uncheckedHelpers & helper) { + var name = getHelperName(helper); + var symbol = getSymbol(helpersModule.exports, ts.escapeIdentifier(name), 107455 /* Value */); + if (!symbol) { + error(location, ts.Diagnostics.This_syntax_requires_an_imported_helper_named_1_but_module_0_has_no_exported_member_1, ts.externalHelpersModuleNameText, name); + } + } } } + requestedExternalEmitHelpers |= helpers; } } } - function verifyHelperSymbol(symbols, name, meaning) { - var symbol = getSymbol(symbols, ts.escapeIdentifier(name), meaning); - if (!symbol) { - error(/*location*/ undefined, ts.Diagnostics.Module_0_has_no_exported_member_1, ts.externalHelpersModuleNameText, name); + function getHelperName(helper) { + switch (helper) { + case 1 /* Extends */: return "__extends"; + case 2 /* Assign */: return "__assign"; + case 4 /* Rest */: return "__rest"; + case 8 /* Decorate */: return "__decorate"; + case 16 /* Metadata */: return "__metadata"; + case 32 /* Param */: return "__param"; + case 64 /* Awaiter */: return "__awaiter"; + case 128 /* Generator */: return "__generator"; + case 256 /* Values */: return "__values"; + case 512 /* Read */: return "__read"; + case 1024 /* Spread */: return "__spread"; + case 2048 /* AsyncGenerator */: return "__asyncGenerator"; + case 4096 /* AsyncDelegator */: return "__asyncDelegator"; + case 8192 /* AsyncValues */: return "__asyncValues"; + default: ts.Debug.fail("Unrecognized helper."); } } - function createInstantiatedPromiseLikeType() { - var promiseLikeType = getGlobalPromiseLikeType(); - if (promiseLikeType !== emptyGenericType) { - return createTypeReference(promiseLikeType, [anyType]); + function resolveHelpersModule(node, errorNode) { + if (!externalHelpersModule) { + externalHelpersModule = resolveExternalModule(node, ts.externalHelpersModuleNameText, ts.Diagnostics.This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found, errorNode) || unknownSymbol; } - return emptyObjectType; - } - function createThenableType() { - // build the thenable type that is used to verify against a non-promise "thenable" operand to `await`. - var thenPropertySymbol = createSymbol(67108864 /* Transient */ | 4 /* Property */, "then"); - getSymbolLinks(thenPropertySymbol).type = globalFunctionType; - var thenableType = createObjectType(16 /* Anonymous */); - thenableType.properties = [thenPropertySymbol]; - thenableType.members = createSymbolTable(thenableType.properties); - thenableType.callSignatures = []; - thenableType.constructSignatures = []; - return thenableType; + return externalHelpersModule; } // GRAMMAR CHECKING function checkGrammarDecorators(node) { @@ -42708,14 +46199,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node)) { - if (node.kind === 149 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 150 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 151 /* GetAccessor */ || node.kind === 152 /* SetAccessor */) { + else if (node.kind === 152 /* GetAccessor */ || node.kind === 153 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -42733,16 +46224,16 @@ var ts; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; if (modifier.kind !== 130 /* ReadonlyKeyword */) { - if (node.kind === 146 /* PropertySignature */ || node.kind === 148 /* MethodSignature */) { + if (node.kind === 147 /* PropertySignature */ || node.kind === 149 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 155 /* IndexSignature */) { + if (node.kind === 156 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 75 /* ConstKeyword */: - if (node.kind !== 229 /* EnumDeclaration */ && node.parent.kind === 226 /* ClassDeclaration */) { + if (node.kind !== 231 /* EnumDeclaration */ && node.parent.kind === 228 /* ClassDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(75 /* ConstKeyword */)); } break; @@ -42768,7 +46259,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 231 /* ModuleBlock */ || node.parent.kind === 261 /* SourceFile */) { + else if (node.parent.kind === 233 /* ModuleBlock */ || node.parent.kind === 264 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { @@ -42791,10 +46282,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 231 /* ModuleBlock */ || node.parent.kind === 261 /* SourceFile */) { + else if (node.parent.kind === 233 /* ModuleBlock */ || node.parent.kind === 264 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 144 /* Parameter */) { + else if (node.kind === 145 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -42807,7 +46298,7 @@ var ts; if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 147 /* PropertyDeclaration */ && node.kind !== 146 /* PropertySignature */ && node.kind !== 155 /* IndexSignature */ && node.kind !== 144 /* Parameter */) { + else if (node.kind !== 148 /* PropertyDeclaration */ && node.kind !== 147 /* PropertySignature */ && node.kind !== 156 /* IndexSignature */ && node.kind !== 145 /* Parameter */) { // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property. return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } @@ -42827,10 +46318,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } - else if (node.parent.kind === 226 /* ClassDeclaration */) { + else if (node.parent.kind === 228 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 144 /* Parameter */) { + else if (node.kind === 145 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; @@ -42842,13 +46333,13 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.parent.kind === 226 /* ClassDeclaration */) { + else if (node.parent.kind === 228 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 144 /* Parameter */) { + else if (node.kind === 145 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 231 /* ModuleBlock */) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 233 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 2 /* Ambient */; @@ -42858,14 +46349,14 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 226 /* ClassDeclaration */) { - if (node.kind !== 149 /* MethodDeclaration */ && - node.kind !== 147 /* PropertyDeclaration */ && - node.kind !== 151 /* GetAccessor */ && - node.kind !== 152 /* SetAccessor */) { + if (node.kind !== 228 /* ClassDeclaration */) { + if (node.kind !== 150 /* MethodDeclaration */ && + node.kind !== 148 /* PropertyDeclaration */ && + node.kind !== 152 /* GetAccessor */ && + node.kind !== 153 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 226 /* ClassDeclaration */ && ts.getModifierFlags(node.parent) & 128 /* Abstract */)) { + if (!(node.parent.kind === 228 /* ClassDeclaration */ && ts.getModifierFlags(node.parent) & 128 /* Abstract */)) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -42884,7 +46375,7 @@ var ts; else if (flags & 2 /* Ambient */ || ts.isInAmbientContext(node.parent)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 144 /* Parameter */) { + else if (node.kind === 145 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256 /* Async */; @@ -42892,7 +46383,7 @@ var ts; break; } } - if (node.kind === 150 /* Constructor */) { + if (node.kind === 151 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -42907,13 +46398,13 @@ var ts; } return; } - else if ((node.kind === 235 /* ImportDeclaration */ || node.kind === 234 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 237 /* ImportDeclaration */ || node.kind === 236 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 144 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 145 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 144 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 145 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256 /* Async */) { @@ -42933,37 +46424,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 150 /* Constructor */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 155 /* IndexSignature */: - case 230 /* ModuleDeclaration */: - case 235 /* ImportDeclaration */: - case 234 /* ImportEqualsDeclaration */: - case 241 /* ExportDeclaration */: - case 240 /* ExportAssignment */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 144 /* Parameter */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 151 /* Constructor */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 156 /* IndexSignature */: + case 232 /* ModuleDeclaration */: + case 237 /* ImportDeclaration */: + case 236 /* ImportEqualsDeclaration */: + case 243 /* ExportDeclaration */: + case 242 /* ExportAssignment */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 145 /* Parameter */: return false; default: - if (node.parent.kind === 231 /* ModuleBlock */ || node.parent.kind === 261 /* SourceFile */) { + if (node.parent.kind === 233 /* ModuleBlock */ || node.parent.kind === 264 /* SourceFile */) { return false; } switch (node.kind) { - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: return nodeHasAnyModifiersExcept(node, 119 /* AsyncKeyword */); - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: return nodeHasAnyModifiersExcept(node, 116 /* AbstractKeyword */); - case 227 /* InterfaceDeclaration */: - case 205 /* VariableStatement */: - case 228 /* TypeAliasDeclaration */: + case 229 /* InterfaceDeclaration */: + case 207 /* VariableStatement */: + case 230 /* TypeAliasDeclaration */: return true; - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: return nodeHasAnyModifiersExcept(node, 75 /* ConstKeyword */); default: ts.Debug.fail(); @@ -42976,14 +46467,11 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 149 /* MethodDeclaration */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - if (!node.asteriskToken) { - return false; - } - break; + case 150 /* MethodDeclaration */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); } @@ -43041,8 +46529,12 @@ var ts; return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarTypeParameterList(node.typeParameters, file) || checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); } + function checkGrammarClassLikeDeclaration(node) { + var file = ts.getSourceFileOfNode(node); + return checkGrammarClassDeclarationHeritageClauses(node) || checkGrammarTypeParameterList(node.typeParameters, file); + } function checkGrammarArrowFunction(node, file) { - if (node.kind === 185 /* ArrowFunction */) { + if (node.kind === 186 /* ArrowFunction */) { var arrowFunction = node; var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; @@ -43077,7 +46569,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 134 /* StringKeyword */ && parameter.type.kind !== 132 /* NumberKeyword */) { + if (parameter.type.kind !== 135 /* StringKeyword */ && parameter.type.kind !== 132 /* NumberKeyword */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); } if (!node.type) { @@ -43105,7 +46597,7 @@ var ts; var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 198 /* OmittedExpression */) { + if (arg.kind === 199 /* OmittedExpression */) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -43178,28 +46670,25 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 142 /* ComputedPropertyName */) { + if (node.kind !== 143 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 192 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 25 /* CommaToken */) { + if (computedPropertyName.expression.kind === 193 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 25 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 225 /* FunctionDeclaration */ || - node.kind === 184 /* FunctionExpression */ || - node.kind === 149 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 227 /* FunctionDeclaration */ || + node.kind === 185 /* FunctionExpression */ || + node.kind === 150 /* MethodDeclaration */); if (ts.isInAmbientContext(node)) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } if (!node.body) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.An_overload_signature_cannot_be_declared_as_a_generator); } - if (languageVersion < 2 /* ES2015 */) { - return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher); - } } } function checkGrammarForInvalidQuestionMark(questionToken, message) { @@ -43215,15 +46704,15 @@ var ts; var GetOrSetAccessor = GetAccessor | SetAccessor; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 259 /* SpreadAssignment */) { + if (prop.kind === 262 /* SpreadAssignment */) { continue; } - var name_27 = prop.name; - if (name_27.kind === 142 /* ComputedPropertyName */) { + var name = prop.name; + if (name.kind === 143 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it - checkGrammarComputedPropertyName(name_27); + checkGrammarComputedPropertyName(name); } - if (prop.kind === 258 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 261 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); @@ -43232,7 +46721,7 @@ var ts; if (prop.modifiers) { for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { var mod = _c[_b]; - if (mod.kind !== 119 /* AsyncKeyword */ || prop.kind !== 149 /* MethodDeclaration */) { + if (mod.kind !== 119 /* AsyncKeyword */ || prop.kind !== 150 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -43246,69 +46735,69 @@ var ts; // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; - if (prop.kind === 257 /* PropertyAssignment */ || prop.kind === 258 /* ShorthandPropertyAssignment */) { + if (prop.kind === 260 /* PropertyAssignment */ || prop.kind === 261 /* ShorthandPropertyAssignment */) { // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); - if (name_27.kind === 8 /* NumericLiteral */) { - checkGrammarNumericLiteral(name_27); + if (name.kind === 8 /* NumericLiteral */) { + checkGrammarNumericLiteral(name); } currentKind = Property; } - else if (prop.kind === 149 /* MethodDeclaration */) { + else if (prop.kind === 150 /* MethodDeclaration */) { currentKind = Property; } - else if (prop.kind === 151 /* GetAccessor */) { + else if (prop.kind === 152 /* GetAccessor */) { currentKind = GetAccessor; } - else if (prop.kind === 152 /* SetAccessor */) { + else if (prop.kind === 153 /* SetAccessor */) { currentKind = SetAccessor; } else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - var effectiveName = ts.getPropertyNameForPropertyNameNode(name_27); + var effectiveName = ts.getPropertyNameForPropertyNameNode(name); if (effectiveName === undefined) { continue; } - if (!seen[effectiveName]) { - seen[effectiveName] = currentKind; + var existingKind = seen.get(effectiveName); + if (!existingKind) { + seen.set(effectiveName, currentKind); } else { - var existingKind = seen[effectiveName]; if (currentKind === Property && existingKind === Property) { - grammarErrorOnNode(name_27, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name_27)); + grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name)); } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[effectiveName] = currentKind | existingKind; + seen.set(effectiveName, currentKind | existingKind); } else { - return grammarErrorOnNode(name_27, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); } } else { - return grammarErrorOnNode(name_27, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); } } } } function checkGrammarJsxElement(node) { var seen = ts.createMap(); - for (var _i = 0, _a = node.attributes; _i < _a.length; _i++) { + for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 251 /* JsxSpreadAttribute */) { + if (attr.kind === 254 /* JsxSpreadAttribute */) { continue; } var jsxAttr = attr; - var name_28 = jsxAttr.name; - if (!seen[name_28.text]) { - seen[name_28.text] = true; + var name = jsxAttr.name; + if (!seen.get(name.text)) { + seen.set(name.text, true); } else { - return grammarErrorOnNode(name_28, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); + return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } var initializer = jsxAttr.initializer; - if (initializer && initializer.kind === 252 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 255 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(jsxAttr.initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -43317,7 +46806,12 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 224 /* VariableDeclarationList */) { + if (forInOrOfStatement.kind === 215 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if ((forInOrOfStatement.flags & 16384 /* AwaitContext */) === 0 /* None */) { + return grammarErrorOnNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); + } + } + if (forInOrOfStatement.initializer.kind === 226 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -43332,20 +46826,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 212 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 214 /* ForInStatement */ ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 212 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 214 /* ForInStatement */ ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 212 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 214 /* ForInStatement */ ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -43365,15 +46859,18 @@ var ts; else if (accessor.body === undefined && !(ts.getModifierFlags(accessor) & 128 /* Abstract */)) { return grammarErrorAtPos(ts.getSourceFileOfNode(accessor), accessor.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } + else if (accessor.body && ts.getModifierFlags(accessor) & 128 /* Abstract */) { + return grammarErrorOnNode(accessor, ts.Diagnostics.An_abstract_accessor_cannot_have_an_implementation); + } else if (accessor.typeParameters) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } else if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, kind === 151 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, kind === 152 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - else if (kind === 152 /* SetAccessor */) { + else if (kind === 153 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -43392,14 +46889,14 @@ var ts; } } /** Does the accessor have the right number of parameters? - - A get accessor has no parameters or a single `this` parameter. - A set accessor has one parameter or a `this` parameter and one more parameter */ + * A get accessor has no parameters or a single `this` parameter. + * A set accessor has one parameter or a `this` parameter and one more parameter. + */ function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 151 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 152 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 151 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 152 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } @@ -43414,7 +46911,7 @@ var ts; checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 176 /* ObjectLiteralExpression */) { + if (node.parent.kind === 177 /* ObjectLiteralExpression */) { if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) { return true; } @@ -43435,10 +46932,10 @@ var ts; return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol); } } - else if (node.parent.kind === 227 /* InterfaceDeclaration */) { + else if (node.parent.kind === 229 /* InterfaceDeclaration */) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol); } - else if (node.parent.kind === 161 /* TypeLiteral */) { + else if (node.parent.kind === 162 /* TypeLiteral */) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol); } } @@ -43449,11 +46946,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: if (node.label && current.label.text === node.label.text) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 214 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 216 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -43461,8 +46958,8 @@ var ts; return false; } break; - case 218 /* SwitchStatement */: - if (node.kind === 215 /* BreakStatement */ && !node.label) { + case 220 /* SwitchStatement */: + if (node.kind === 217 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -43477,13 +46974,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 215 /* BreakStatement */ + var message = node.kind === 217 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 215 /* BreakStatement */ + var message = node.kind === 217 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -43495,7 +46992,7 @@ var ts; if (node !== ts.lastOrUndefined(elements)) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } - if (node.name.kind === 173 /* ArrayBindingPattern */ || node.name.kind === 172 /* ObjectBindingPattern */) { + if (node.name.kind === 174 /* ArrayBindingPattern */ || node.name.kind === 173 /* ObjectBindingPattern */) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } if (node.initializer) { @@ -43506,11 +47003,11 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return expr.kind === 9 /* StringLiteral */ || expr.kind === 8 /* NumericLiteral */ || - expr.kind === 190 /* PrefixUnaryExpression */ && expr.operator === 37 /* MinusToken */ && + expr.kind === 191 /* PrefixUnaryExpression */ && expr.operator === 37 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 212 /* ForInStatement */ && node.parent.parent.kind !== 213 /* ForOfStatement */) { + if (node.parent.parent.kind !== 214 /* ForInStatement */ && node.parent.parent.kind !== 215 /* ForOfStatement */) { if (ts.isInAmbientContext(node)) { if (node.initializer) { if (ts.isConst(node) && !node.type) { @@ -43539,6 +47036,10 @@ var ts; } } } + if (compilerOptions.module !== ts.ModuleKind.ES2015 && compilerOptions.module !== ts.ModuleKind.System && !compilerOptions.noEmit && + !ts.isInAmbientContext(node.parent.parent) && ts.hasModifier(node.parent.parent, 1 /* Export */)) { + checkESModuleMarker(node.name); + } var checkLetConstNames = (ts.isLet(node) || ts.isConst(node)); // 1. LexicalDeclaration : LetOrConst BindingList ; // It is a Syntax Error if the BoundNames of BindingList contains "let". @@ -43548,6 +47049,22 @@ var ts; // and its Identifier is eval or arguments return checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name); } + function checkESModuleMarker(name) { + if (name.kind === 70 /* Identifier */) { + if (ts.unescapeIdentifier(name.text) === "__esModule") { + return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules); + } + } + else { + var elements = name.elements; + for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) { + var element = elements_2[_i]; + if (!ts.isOmittedExpression(element)) { + return checkESModuleMarker(element.name); + } + } + } + } function checkGrammarNameInLetOrConstDeclarations(name) { if (name.kind === 70 /* Identifier */) { if (name.originalKeywordKind === 109 /* LetKeyword */) { @@ -43556,8 +47073,8 @@ var ts; } else { var elements = name.elements; - for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) { - var element = elements_2[_i]; + for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) { + var element = elements_3[_i]; if (!ts.isOmittedExpression(element)) { checkGrammarNameInLetOrConstDeclarations(element.name); } @@ -43575,15 +47092,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 208 /* IfStatement */: - case 209 /* DoStatement */: - case 210 /* WhileStatement */: - case 217 /* WithStatement */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: + case 210 /* IfStatement */: + case 211 /* DoStatement */: + case 212 /* WhileStatement */: + case 219 /* WithStatement */: + case 213 /* ForStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: return false; - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -43598,6 +47115,13 @@ var ts; } } } + function checkGrammarMetaProperty(node) { + if (node.keywordToken === 93 /* NewKeyword */) { + if (node.name.text !== "target") { + return grammarErrorOnNode(node.name, ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, node.name.text, ts.tokenToString(node.keywordToken), "target"); + } + } + } function hasParseDiagnostics(sourceFile) { return sourceFile.parseDiagnostics.length > 0; } @@ -43638,7 +47162,7 @@ var ts; return true; } } - else if (node.parent.kind === 227 /* InterfaceDeclaration */) { + else if (node.parent.kind === 229 /* InterfaceDeclaration */) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -43646,7 +47170,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 161 /* TypeLiteral */) { + else if (node.parent.kind === 162 /* TypeLiteral */) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -43671,13 +47195,13 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 227 /* InterfaceDeclaration */ || - node.kind === 228 /* TypeAliasDeclaration */ || - node.kind === 235 /* ImportDeclaration */ || - node.kind === 234 /* ImportEqualsDeclaration */ || - node.kind === 241 /* ExportDeclaration */ || - node.kind === 240 /* ExportAssignment */ || - node.kind === 233 /* NamespaceExportDeclaration */ || + if (node.kind === 229 /* InterfaceDeclaration */ || + node.kind === 230 /* TypeAliasDeclaration */ || + node.kind === 237 /* ImportDeclaration */ || + node.kind === 236 /* ImportEqualsDeclaration */ || + node.kind === 243 /* ExportDeclaration */ || + node.kind === 242 /* ExportAssignment */ || + node.kind === 235 /* NamespaceExportDeclaration */ || ts.getModifierFlags(node) & (2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } @@ -43686,7 +47210,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 205 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 207 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -43712,7 +47236,7 @@ var ts; // to prevent noisiness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 204 /* Block */ || node.parent.kind === 231 /* ModuleBlock */ || node.parent.kind === 261 /* SourceFile */) { + if (node.parent.kind === 206 /* Block */ || node.parent.kind === 233 /* ModuleBlock */ || node.parent.kind === 264 /* SourceFile */) { var links_1 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_1.hasReportedStatementInAmbientContext) { @@ -43720,13 +47244,30 @@ var ts; } } else { + // We must be parented by a statement. If so, there's no need + // to report the error as our parent will have already done it. + // Debug.assert(isStatement(node.parent)); } } } function checkGrammarNumericLiteral(node) { // Grammar checking - if (node.isOctalLiteral && languageVersion >= 1 /* ES5 */) { - return grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); + if (node.numericLiteralFlags & 4 /* Octal */) { + var diagnosticMessage = void 0; + if (languageVersion >= 1 /* ES5 */) { + diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; + } + else if (ts.isChildOfNodeWithKind(node, 172 /* LiteralType */)) { + diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; + } + else if (ts.isChildOfNodeWithKind(node, 263 /* EnumMember */)) { + diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; + } + if (diagnosticMessage) { + var withMinus = ts.isPrefixUnaryExpression(node.parent) && node.parent.operator === 37 /* MinusToken */; + var literal = (withMinus ? "-" : "") + "0o" + node.text; + return grammarErrorOnNode(withMinus ? node.parent : node, diagnosticMessage, literal); + } } } function grammarErrorAfterFirstToken(node, message, arg0, arg1, arg2) { @@ -43739,11 +47280,11 @@ var ts; } function getAmbientModules() { var result = []; - for (var sym in globals) { + globals.forEach(function (global, sym) { if (ambientModuleSymbolRegex.test(sym)) { - result.push(globals[sym]); + result.push(global); } - } + }); return result; } } @@ -43752,466 +47293,19 @@ var ts; /// /// /// -/* @internal */ var ts; (function (ts) { - ; - /** - * This map contains information about the shape of each Node in "types.ts" pertaining to how - * each node should be traversed during a transformation. - * - * Each edge corresponds to a property in a Node subtype that should be traversed when visiting - * each child. The properties are assigned in the order in which traversal should occur. - * - * We only add entries for nodes that do not have a create/update pair defined in factory.ts - * - * NOTE: This needs to be kept up to date with changes to nodes in "types.ts". Currently, this - * map is not comprehensive. Only node edges relevant to tree transformation are - * currently defined. We may extend this to be more comprehensive, and eventually - * supplant the existing `forEachChild` implementation if performance is not - * significantly impacted. - */ - var nodeEdgeTraversalMap = ts.createMap((_a = {}, - _a[141 /* QualifiedName */] = [ - { name: "left", test: ts.isEntityName }, - { name: "right", test: ts.isIdentifier } - ], - _a[145 /* Decorator */] = [ - { name: "expression", test: ts.isLeftHandSideExpression } - ], - _a[182 /* TypeAssertionExpression */] = [ - { name: "type", test: ts.isTypeNode }, - { name: "expression", test: ts.isUnaryExpression } - ], - _a[200 /* AsExpression */] = [ - { name: "expression", test: ts.isExpression }, - { name: "type", test: ts.isTypeNode } - ], - _a[201 /* NonNullExpression */] = [ - { name: "expression", test: ts.isLeftHandSideExpression } - ], - _a[229 /* EnumDeclaration */] = [ - { name: "decorators", test: ts.isDecorator }, - { name: "modifiers", test: ts.isModifier }, - { name: "name", test: ts.isIdentifier }, - { name: "members", test: ts.isEnumMember } - ], - _a[230 /* ModuleDeclaration */] = [ - { name: "decorators", test: ts.isDecorator }, - { name: "modifiers", test: ts.isModifier }, - { name: "name", test: ts.isModuleName }, - { name: "body", test: ts.isModuleBody } - ], - _a[231 /* ModuleBlock */] = [ - { name: "statements", test: ts.isStatement } - ], - _a[234 /* ImportEqualsDeclaration */] = [ - { name: "decorators", test: ts.isDecorator }, - { name: "modifiers", test: ts.isModifier }, - { name: "name", test: ts.isIdentifier }, - { name: "moduleReference", test: ts.isModuleReference } - ], - _a[245 /* ExternalModuleReference */] = [ - { name: "expression", test: ts.isExpression, optional: true } - ], - _a[260 /* EnumMember */] = [ - { name: "name", test: ts.isPropertyName }, - { name: "initializer", test: ts.isExpression, optional: true, parenthesize: ts.parenthesizeExpressionForList } - ], - _a)); - function reduceNode(node, f, initial) { - return node ? f(initial, node) : initial; - } - function reduceNodeArray(nodes, f, initial) { - return nodes ? f(initial, nodes) : initial; - } - /** - * Similar to `reduceLeft`, performs a reduction against each child of a node. - * NOTE: Unlike `forEachChild`, this does *not* visit every node. Only nodes added to the - * `nodeEdgeTraversalMap` above will be visited. - * - * @param node The node containing the children to reduce. - * @param initial The initial value to supply to the reduction. - * @param f The callback function - */ - function reduceEachChild(node, initial, cbNode, cbNodeArray) { - if (node === undefined) { - return initial; - } - var reduceNodes = cbNodeArray ? reduceNodeArray : ts.reduceLeft; - var cbNodes = cbNodeArray || cbNode; - var kind = node.kind; - // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 140 /* LastToken */)) { - return initial; - } - // We do not yet support types. - if ((kind >= 156 /* TypePredicate */ && kind <= 171 /* LiteralType */)) { - return initial; - } - var result = initial; - switch (node.kind) { - // Leaf nodes - case 203 /* SemicolonClassElement */: - case 206 /* EmptyStatement */: - case 198 /* OmittedExpression */: - case 222 /* DebuggerStatement */: - case 293 /* NotEmittedStatement */: - // No need to visit nodes with no children. - break; - // Names - case 142 /* ComputedPropertyName */: - result = reduceNode(node.expression, cbNode, result); - break; - // Signature elements - case 144 /* Parameter */: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.type, cbNode, result); - result = reduceNode(node.initializer, cbNode, result); - break; - case 145 /* Decorator */: - result = reduceNode(node.expression, cbNode, result); - break; - // Type member - case 147 /* PropertyDeclaration */: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.type, cbNode, result); - result = reduceNode(node.initializer, cbNode, result); - break; - case 149 /* MethodDeclaration */: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNodes(node.typeParameters, cbNodes, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.type, cbNode, result); - result = reduceNode(node.body, cbNode, result); - break; - case 150 /* Constructor */: - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.body, cbNode, result); - break; - case 151 /* GetAccessor */: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.type, cbNode, result); - result = reduceNode(node.body, cbNode, result); - break; - case 152 /* SetAccessor */: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.body, cbNode, result); - break; - // Binding patterns - case 172 /* ObjectBindingPattern */: - case 173 /* ArrayBindingPattern */: - result = reduceNodes(node.elements, cbNodes, result); - break; - case 174 /* BindingElement */: - result = reduceNode(node.propertyName, cbNode, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.initializer, cbNode, result); - break; - // Expression - case 175 /* ArrayLiteralExpression */: - result = reduceNodes(node.elements, cbNodes, result); - break; - case 176 /* ObjectLiteralExpression */: - result = reduceNodes(node.properties, cbNodes, result); - break; - case 177 /* PropertyAccessExpression */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.name, cbNode, result); - break; - case 178 /* ElementAccessExpression */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.argumentExpression, cbNode, result); - break; - case 179 /* CallExpression */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNodes(node.typeArguments, cbNodes, result); - result = reduceNodes(node.arguments, cbNodes, result); - break; - case 180 /* NewExpression */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNodes(node.typeArguments, cbNodes, result); - result = reduceNodes(node.arguments, cbNodes, result); - break; - case 181 /* TaggedTemplateExpression */: - result = reduceNode(node.tag, cbNode, result); - result = reduceNode(node.template, cbNode, result); - break; - case 184 /* FunctionExpression */: - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNodes(node.typeParameters, cbNodes, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.type, cbNode, result); - result = reduceNode(node.body, cbNode, result); - break; - case 185 /* ArrowFunction */: - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNodes(node.typeParameters, cbNodes, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.type, cbNode, result); - result = reduceNode(node.body, cbNode, result); - break; - case 183 /* ParenthesizedExpression */: - case 186 /* DeleteExpression */: - case 187 /* TypeOfExpression */: - case 188 /* VoidExpression */: - case 189 /* AwaitExpression */: - case 195 /* YieldExpression */: - case 196 /* SpreadElement */: - case 201 /* NonNullExpression */: - result = reduceNode(node.expression, cbNode, result); - break; - case 190 /* PrefixUnaryExpression */: - case 191 /* PostfixUnaryExpression */: - result = reduceNode(node.operand, cbNode, result); - break; - case 192 /* BinaryExpression */: - result = reduceNode(node.left, cbNode, result); - result = reduceNode(node.right, cbNode, result); - break; - case 193 /* ConditionalExpression */: - result = reduceNode(node.condition, cbNode, result); - result = reduceNode(node.whenTrue, cbNode, result); - result = reduceNode(node.whenFalse, cbNode, result); - break; - case 194 /* TemplateExpression */: - result = reduceNode(node.head, cbNode, result); - result = reduceNodes(node.templateSpans, cbNodes, result); - break; - case 197 /* ClassExpression */: - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNodes(node.typeParameters, cbNodes, result); - result = reduceNodes(node.heritageClauses, cbNodes, result); - result = reduceNodes(node.members, cbNodes, result); - break; - case 199 /* ExpressionWithTypeArguments */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNodes(node.typeArguments, cbNodes, result); - break; - // Misc - case 202 /* TemplateSpan */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.literal, cbNode, result); - break; - // Element - case 204 /* Block */: - result = reduceNodes(node.statements, cbNodes, result); - break; - case 205 /* VariableStatement */: - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.declarationList, cbNode, result); - break; - case 207 /* ExpressionStatement */: - result = reduceNode(node.expression, cbNode, result); - break; - case 208 /* IfStatement */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.thenStatement, cbNode, result); - result = reduceNode(node.elseStatement, cbNode, result); - break; - case 209 /* DoStatement */: - result = reduceNode(node.statement, cbNode, result); - result = reduceNode(node.expression, cbNode, result); - break; - case 210 /* WhileStatement */: - case 217 /* WithStatement */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.statement, cbNode, result); - break; - case 211 /* ForStatement */: - result = reduceNode(node.initializer, cbNode, result); - result = reduceNode(node.condition, cbNode, result); - result = reduceNode(node.incrementor, cbNode, result); - result = reduceNode(node.statement, cbNode, result); - break; - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - result = reduceNode(node.initializer, cbNode, result); - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.statement, cbNode, result); - break; - case 216 /* ReturnStatement */: - case 220 /* ThrowStatement */: - result = reduceNode(node.expression, cbNode, result); - break; - case 218 /* SwitchStatement */: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.caseBlock, cbNode, result); - break; - case 219 /* LabeledStatement */: - result = reduceNode(node.label, cbNode, result); - result = reduceNode(node.statement, cbNode, result); - break; - case 221 /* TryStatement */: - result = reduceNode(node.tryBlock, cbNode, result); - result = reduceNode(node.catchClause, cbNode, result); - result = reduceNode(node.finallyBlock, cbNode, result); - break; - case 223 /* VariableDeclaration */: - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.type, cbNode, result); - result = reduceNode(node.initializer, cbNode, result); - break; - case 224 /* VariableDeclarationList */: - result = reduceNodes(node.declarations, cbNodes, result); - break; - case 225 /* FunctionDeclaration */: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNodes(node.typeParameters, cbNodes, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.type, cbNode, result); - result = reduceNode(node.body, cbNode, result); - break; - case 226 /* ClassDeclaration */: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNodes(node.typeParameters, cbNodes, result); - result = reduceNodes(node.heritageClauses, cbNodes, result); - result = reduceNodes(node.members, cbNodes, result); - break; - case 232 /* CaseBlock */: - result = reduceNodes(node.clauses, cbNodes, result); - break; - case 235 /* ImportDeclaration */: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.importClause, cbNode, result); - result = reduceNode(node.moduleSpecifier, cbNode, result); - break; - case 236 /* ImportClause */: - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.namedBindings, cbNode, result); - break; - case 237 /* NamespaceImport */: - result = reduceNode(node.name, cbNode, result); - break; - case 238 /* NamedImports */: - case 242 /* NamedExports */: - result = reduceNodes(node.elements, cbNodes, result); - break; - case 239 /* ImportSpecifier */: - case 243 /* ExportSpecifier */: - result = reduceNode(node.propertyName, cbNode, result); - result = reduceNode(node.name, cbNode, result); - break; - case 240 /* ExportAssignment */: - result = ts.reduceLeft(node.decorators, cbNode, result); - result = ts.reduceLeft(node.modifiers, cbNode, result); - result = reduceNode(node.expression, cbNode, result); - break; - case 241 /* ExportDeclaration */: - result = ts.reduceLeft(node.decorators, cbNode, result); - result = ts.reduceLeft(node.modifiers, cbNode, result); - result = reduceNode(node.exportClause, cbNode, result); - result = reduceNode(node.moduleSpecifier, cbNode, result); - break; - // JSX - case 246 /* JsxElement */: - result = reduceNode(node.openingElement, cbNode, result); - result = ts.reduceLeft(node.children, cbNode, result); - result = reduceNode(node.closingElement, cbNode, result); - break; - case 247 /* JsxSelfClosingElement */: - case 248 /* JsxOpeningElement */: - result = reduceNode(node.tagName, cbNode, result); - result = reduceNodes(node.attributes, cbNodes, result); - break; - case 249 /* JsxClosingElement */: - result = reduceNode(node.tagName, cbNode, result); - break; - case 250 /* JsxAttribute */: - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.initializer, cbNode, result); - break; - case 251 /* JsxSpreadAttribute */: - result = reduceNode(node.expression, cbNode, result); - break; - case 252 /* JsxExpression */: - result = reduceNode(node.expression, cbNode, result); - break; - // Clauses - case 253 /* CaseClause */: - result = reduceNode(node.expression, cbNode, result); - // fall-through - case 254 /* DefaultClause */: - result = reduceNodes(node.statements, cbNodes, result); - break; - case 255 /* HeritageClause */: - result = reduceNodes(node.types, cbNodes, result); - break; - case 256 /* CatchClause */: - result = reduceNode(node.variableDeclaration, cbNode, result); - result = reduceNode(node.block, cbNode, result); - break; - // Property assignments - case 257 /* PropertyAssignment */: - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.initializer, cbNode, result); - break; - case 258 /* ShorthandPropertyAssignment */: - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.objectAssignmentInitializer, cbNode, result); - break; - case 259 /* SpreadAssignment */: - result = reduceNode(node.expression, cbNode, result); - break; - // Top-level nodes - case 261 /* SourceFile */: - result = reduceNodes(node.statements, cbNodes, result); - break; - case 294 /* PartiallyEmittedExpression */: - result = reduceNode(node.expression, cbNode, result); - break; - default: - var edgeTraversalPath = nodeEdgeTraversalMap[kind]; - if (edgeTraversalPath) { - for (var _i = 0, edgeTraversalPath_1 = edgeTraversalPath; _i < edgeTraversalPath_1.length; _i++) { - var edge = edgeTraversalPath_1[_i]; - var value = node[edge.name]; - if (value !== undefined) { - result = ts.isArray(value) - ? reduceNodes(value, cbNodes, result) - : cbNode(result, value); - } - } - } - break; - } - return result; - } - ts.reduceEachChild = reduceEachChild; - function visitNode(node, visitor, test, optional, lift, parenthesize, parentNode) { + function visitNode(node, visitor, test, lift) { if (node === undefined || visitor === undefined) { return node; } - aggregateTransformFlags(node); + ts.aggregateTransformFlags(node); var visited = visitor(node); if (visited === node) { return node; } var visitedNode; if (visited === undefined) { - if (!optional) { - Debug.failNotOptional(); - } return undefined; } else if (ts.isArray(visited)) { @@ -44220,17 +47314,23 @@ var ts; else { visitedNode = visited; } - if (parenthesize !== undefined) { - visitedNode = parenthesize(visitedNode, parentNode); - } - Debug.assertNode(visitedNode, test); - aggregateTransformFlags(visitedNode); + ts.Debug.assertNode(visitedNode, test); + ts.aggregateTransformFlags(visitedNode); return visitedNode; } ts.visitNode = visitNode; - function visitNodes(nodes, visitor, test, start, count, parenthesize, parentNode) { - if (nodes === undefined) { - return undefined; + /** + * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place. + * + * @param nodes The NodeArray to visit. + * @param visitor The callback used to visit a Node. + * @param test A node test to execute for each node. + * @param start An optional value indicating the starting offset at which to start visiting. + * @param count An optional value indicating the maximum number of nodes to visit. + */ + function visitNodes(nodes, visitor, test, start, count) { + if (nodes === undefined || visitor === undefined) { + return nodes; } var updated; // Ensure start and count have valid values @@ -44245,38 +47345,32 @@ var ts; // If we are not visiting all of the original nodes, we must always create a new array. // Since this is a fragment of a node array, we do not copy over the previous location // and will only copy over `hasTrailingComma` if we are including the last element. - updated = ts.createNodeArray([], /*location*/ undefined, - /*hasTrailingComma*/ nodes.hasTrailingComma && start + count === length); + updated = ts.createNodeArray([], /*hasTrailingComma*/ nodes.hasTrailingComma && start + count === length); } // Visit each original node. for (var i = 0; i < count; i++) { var node = nodes[i + start]; - aggregateTransformFlags(node); + ts.aggregateTransformFlags(node); var visited = node !== undefined ? visitor(node) : undefined; if (updated !== undefined || visited === undefined || visited !== node) { if (updated === undefined) { // Ensure we have a copy of `nodes`, up to the current index. - updated = ts.createNodeArray(nodes.slice(0, i), /*location*/ nodes, nodes.hasTrailingComma); + updated = ts.createNodeArray(nodes.slice(0, i), nodes.hasTrailingComma); + ts.setTextRange(updated, nodes); } if (visited) { if (ts.isArray(visited)) { for (var _i = 0, visited_1 = visited; _i < visited_1.length; _i++) { var visitedNode = visited_1[_i]; - visitedNode = parenthesize - ? parenthesize(visitedNode, parentNode) - : visitedNode; - Debug.assertNode(visitedNode, test); - aggregateTransformFlags(visitedNode); + ts.Debug.assertNode(visitedNode, test); + ts.aggregateTransformFlags(visitedNode); updated.push(visitedNode); } } else { - var visitedNode = parenthesize - ? parenthesize(visited, parentNode) - : visited; - Debug.assertNode(visitedNode, test); - aggregateTransformFlags(visitedNode); - updated.push(visitedNode); + ts.Debug.assertNode(visited, test); + ts.aggregateTransformFlags(visited); + updated.push(visited); } } } @@ -44292,19 +47386,20 @@ var ts; context.startLexicalEnvironment(); statements = visitNodes(statements, visitor, ts.isStatement, start); if (ensureUseStrict && !ts.startsWithUseStrict(statements)) { - statements = ts.createNodeArray([ts.createStatement(ts.createLiteral("use strict"))].concat(statements), statements); + statements = ts.setTextRange(ts.createNodeArray([ts.createStatement(ts.createLiteral("use strict"))].concat(statements)), statements); } var declarations = context.endLexicalEnvironment(); - return ts.createNodeArray(ts.concatenate(statements, declarations), statements); + return ts.setTextRange(ts.createNodeArray(ts.concatenate(statements, declarations)), statements); } ts.visitLexicalEnvironment = visitLexicalEnvironment; /** * Starts a new lexical environment and visits a parameter list, suspending the lexical * environment upon completion. */ - function visitParameterList(nodes, visitor, context) { + function visitParameterList(nodes, visitor, context, nodesVisitor) { + if (nodesVisitor === void 0) { nodesVisitor = visitNodes; } context.startLexicalEnvironment(); - var updated = visitNodes(nodes, visitor, ts.isParameterDeclaration); + var updated = nodesVisitor(nodes, visitor, ts.isParameterDeclaration); context.suspendLexicalEnvironment(); return updated; } @@ -44315,256 +47410,715 @@ var ts; var declarations = context.endLexicalEnvironment(); if (ts.some(declarations)) { var block = ts.convertToFunctionBody(updated); - var statements = mergeLexicalEnvironment(block.statements, declarations); + var statements = ts.mergeLexicalEnvironment(block.statements, declarations); return ts.updateBlock(block, statements); } return updated; } ts.visitFunctionBody = visitFunctionBody; - function visitEachChild(node, visitor, context) { + function visitEachChild(node, visitor, context, nodesVisitor, tokenVisitor) { + if (nodesVisitor === void 0) { nodesVisitor = visitNodes; } if (node === undefined) { return undefined; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 140 /* LastToken */)) { - return node; - } - // We do not yet support types. - if ((kind >= 156 /* TypePredicate */ && kind <= 171 /* LiteralType */)) { + if ((kind > 0 /* FirstToken */ && kind <= 141 /* LastToken */) || kind === 168 /* ThisType */) { return node; } switch (node.kind) { - case 203 /* SemicolonClassElement */: - case 206 /* EmptyStatement */: - case 198 /* OmittedExpression */: - case 222 /* DebuggerStatement */: + case 205 /* SemicolonClassElement */: + case 208 /* EmptyStatement */: + case 199 /* OmittedExpression */: + case 224 /* DebuggerStatement */: + case 297 /* EndOfDeclarationMarker */: + case 246 /* MissingDeclaration */: // No need to visit nodes with no children. return node; // Names - case 142 /* ComputedPropertyName */: + case 142 /* QualifiedName */: + return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); + case 143 /* ComputedPropertyName */: return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); - // Signature elements - case 144 /* Parameter */: - return ts.updateParameter(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), node.dotDotDotToken, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitNode(node.initializer, visitor, ts.isExpression, /*optional*/ true)); - // Type member - case 147 /* PropertyDeclaration */: - return ts.updateProperty(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitNode(node.initializer, visitor, ts.isExpression, /*optional*/ true)); - case 149 /* MethodDeclaration */: - return ts.updateMethod(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitFunctionBody(node.body, visitor, context)); - case 150 /* Constructor */: - return ts.updateConstructor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context), visitFunctionBody(node.body, visitor, context)); - case 151 /* GetAccessor */: - return ts.updateGetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitFunctionBody(node.body, visitor, context)); - case 152 /* SetAccessor */: - return ts.updateSetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context), visitFunctionBody(node.body, visitor, context)); + // Signatures and Signature Elements + case 159 /* FunctionType */: + return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 160 /* ConstructorType */: + return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 154 /* CallSignature */: + return ts.updateCallSignatureDeclaration(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 155 /* ConstructSignature */: + return ts.updateConstructSignatureDeclaration(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 149 /* MethodSignature */: + return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); + case 156 /* IndexSignature */: + return ts.updateIndexSignatureDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 145 /* Parameter */: + return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + case 146 /* Decorator */: + return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); + // Types + case 158 /* TypeReference */: + return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); + case 157 /* TypePredicate */: + return ts.updateTypePredicateNode(node, visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); + case 161 /* TypeQuery */: + return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); + case 162 /* TypeLiteral */: + return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor)); + case 163 /* ArrayType */: + return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); + case 164 /* TupleType */: + return ts.updateTypleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); + case 165 /* UnionType */: + case 166 /* IntersectionType */: + return ts.updateUnionOrIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); + case 167 /* ParenthesizedType */: + throw ts.Debug.fail("not implemented."); + case 169 /* TypeOperator */: + return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); + case 170 /* IndexedAccessType */: + return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); + case 171 /* MappedType */: + return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameter), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); + case 172 /* LiteralType */: + return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); + // Type Declarations + case 144 /* TypeParameter */: + return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); + // Type members + case 147 /* PropertySignature */: + return ts.updatePropertySignature(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + case 148 /* PropertyDeclaration */: + return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + case 150 /* MethodDeclaration */: + return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 151 /* Constructor */: + return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); + case 152 /* GetAccessor */: + return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 153 /* SetAccessor */: + return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); // Binding patterns - case 172 /* ObjectBindingPattern */: - return ts.updateObjectBindingPattern(node, visitNodes(node.elements, visitor, ts.isBindingElement)); - case 173 /* ArrayBindingPattern */: - return ts.updateArrayBindingPattern(node, visitNodes(node.elements, visitor, ts.isArrayBindingElement)); - case 174 /* BindingElement */: - return ts.updateBindingElement(node, node.dotDotDotToken, visitNode(node.propertyName, visitor, ts.isPropertyName, /*optional*/ true), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression, /*optional*/ true)); + case 173 /* ObjectBindingPattern */: + return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); + case 174 /* ArrayBindingPattern */: + return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); + case 175 /* BindingElement */: + return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); // Expression - case 175 /* ArrayLiteralExpression */: - return ts.updateArrayLiteral(node, visitNodes(node.elements, visitor, ts.isExpression)); - case 176 /* ObjectLiteralExpression */: - return ts.updateObjectLiteral(node, visitNodes(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 177 /* PropertyAccessExpression */: + case 176 /* ArrayLiteralExpression */: + return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); + case 177 /* ObjectLiteralExpression */: + return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); + case 178 /* PropertyAccessExpression */: return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier)); - case 178 /* ElementAccessExpression */: + case 179 /* ElementAccessExpression */: return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 179 /* CallExpression */: - return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression)); - case 180 /* NewExpression */: - return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression)); - case 181 /* TaggedTemplateExpression */: + case 180 /* CallExpression */: + return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); + case 181 /* NewExpression */: + return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); + case 182 /* TaggedTemplateExpression */: return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); - case 183 /* ParenthesizedExpression */: + case 183 /* TypeAssertionExpression */: + return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); + case 184 /* ParenthesizedExpression */: return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); - case 184 /* FunctionExpression */: - return ts.updateFunctionExpression(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitFunctionBody(node.body, visitor, context)); - case 185 /* ArrowFunction */: - return ts.updateArrowFunction(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitFunctionBody(node.body, visitor, context)); - case 186 /* DeleteExpression */: + case 185 /* FunctionExpression */: + return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 186 /* ArrowFunction */: + return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 187 /* DeleteExpression */: return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); - case 187 /* TypeOfExpression */: + case 188 /* TypeOfExpression */: return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); - case 188 /* VoidExpression */: + case 189 /* VoidExpression */: return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); - case 189 /* AwaitExpression */: + case 190 /* AwaitExpression */: return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression)); - case 190 /* PrefixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 191 /* PostfixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 193 /* ConditionalExpression */: + case 194 /* ConditionalExpression */: return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.whenFalse, visitor, ts.isExpression)); - case 194 /* TemplateExpression */: - return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), visitNodes(node.templateSpans, visitor, ts.isTemplateSpan)); - case 195 /* YieldExpression */: - return ts.updateYield(node, visitNode(node.expression, visitor, ts.isExpression)); - case 196 /* SpreadElement */: + case 195 /* TemplateExpression */: + return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); + case 196 /* YieldExpression */: + return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); + case 197 /* SpreadElement */: return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); - case 197 /* ClassExpression */: - return ts.updateClassExpression(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier, /*optional*/ true), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), visitNodes(node.members, visitor, ts.isClassElement)); - case 199 /* ExpressionWithTypeArguments */: - return ts.updateExpressionWithTypeArguments(node, visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); + case 198 /* ClassExpression */: + return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); + case 200 /* ExpressionWithTypeArguments */: + return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); + case 201 /* AsExpression */: + return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); + case 202 /* NonNullExpression */: + return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); // Misc - case 202 /* TemplateSpan */: + case 204 /* TemplateSpan */: return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 204 /* Block */: - return ts.updateBlock(node, visitNodes(node.statements, visitor, ts.isStatement)); - case 205 /* VariableStatement */: - return ts.updateVariableStatement(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 207 /* ExpressionStatement */: + case 206 /* Block */: + return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + case 207 /* VariableStatement */: + return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); + case 209 /* ExpressionStatement */: return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression)); - case 208 /* IfStatement */: - return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, /*optional*/ false, liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, /*optional*/ true, liftToBlock)); - case 209 /* DoStatement */: - return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); - case 210 /* WhileStatement */: - return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, liftToBlock)); - case 211 /* ForStatement */: - return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, liftToBlock)); - case 212 /* ForInStatement */: - return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, liftToBlock)); - case 213 /* ForOfStatement */: - return ts.updateForOf(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, liftToBlock)); - case 214 /* ContinueStatement */: - return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier, /*optional*/ true)); - case 215 /* BreakStatement */: - return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier, /*optional*/ true)); - case 216 /* ReturnStatement */: - return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression, /*optional*/ true)); - case 217 /* WithStatement */: - return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, liftToBlock)); - case 218 /* SwitchStatement */: + case 210 /* IfStatement */: + return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); + case 211 /* DoStatement */: + return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); + case 212 /* WhileStatement */: + return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 213 /* ForStatement */: + return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 214 /* ForInStatement */: + return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 215 /* ForOfStatement */: + return ts.updateForOf(node, node.awaitModifier, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 216 /* ContinueStatement */: + return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); + case 217 /* BreakStatement */: + return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); + case 218 /* ReturnStatement */: + return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); + case 219 /* WithStatement */: + return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 220 /* SwitchStatement */: return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); - case 219 /* LabeledStatement */: - return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, liftToBlock)); - case 220 /* ThrowStatement */: + case 221 /* LabeledStatement */: + return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 222 /* ThrowStatement */: return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); - case 221 /* TryStatement */: - return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause, /*optional*/ true), visitNode(node.finallyBlock, visitor, ts.isBlock, /*optional*/ true)); - case 223 /* VariableDeclaration */: - return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitNode(node.initializer, visitor, ts.isExpression, /*optional*/ true)); - case 224 /* VariableDeclarationList */: - return ts.updateVariableDeclarationList(node, visitNodes(node.declarations, visitor, ts.isVariableDeclaration)); - case 225 /* FunctionDeclaration */: - return ts.updateFunctionDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context), visitNode(node.type, visitor, ts.isTypeNode, /*optional*/ true), visitFunctionBody(node.body, visitor, context)); - case 226 /* ClassDeclaration */: - return ts.updateClassDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier, /*optional*/ true), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), visitNodes(node.members, visitor, ts.isClassElement)); - case 232 /* CaseBlock */: - return ts.updateCaseBlock(node, visitNodes(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 235 /* ImportDeclaration */: - return ts.updateImportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause, /*optional*/ true), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 236 /* ImportClause */: - return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier, /*optional*/ true), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings, /*optional*/ true)); - case 237 /* NamespaceImport */: + case 223 /* TryStatement */: + return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); + case 225 /* VariableDeclaration */: + return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + case 226 /* VariableDeclarationList */: + return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); + case 227 /* FunctionDeclaration */: + return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + case 228 /* ClassDeclaration */: + return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameter), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); + case 231 /* EnumDeclaration */: + return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); + case 232 /* ModuleDeclaration */: + return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); + case 233 /* ModuleBlock */: + return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + case 234 /* CaseBlock */: + return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); + case 236 /* ImportEqualsDeclaration */: + return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); + case 237 /* ImportDeclaration */: + return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); + case 238 /* ImportClause */: + return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings)); + case 239 /* NamespaceImport */: return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 238 /* NamedImports */: - return ts.updateNamedImports(node, visitNodes(node.elements, visitor, ts.isImportSpecifier)); - case 239 /* ImportSpecifier */: - return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier, /*optional*/ true), visitNode(node.name, visitor, ts.isIdentifier)); - case 240 /* ExportAssignment */: - return ts.updateExportAssignment(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); - case 241 /* ExportDeclaration */: - return ts.updateExportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports, /*optional*/ true), visitNode(node.moduleSpecifier, visitor, ts.isExpression, /*optional*/ true)); - case 242 /* NamedExports */: - return ts.updateNamedExports(node, visitNodes(node.elements, visitor, ts.isExportSpecifier)); - case 243 /* ExportSpecifier */: - return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier, /*optional*/ true), visitNode(node.name, visitor, ts.isIdentifier)); + case 240 /* NamedImports */: + return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); + case 241 /* ImportSpecifier */: + return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); + case 242 /* ExportAssignment */: + return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); + case 243 /* ExportDeclaration */: + return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); + case 244 /* NamedExports */: + return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); + case 245 /* ExportSpecifier */: + return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); + // Module references + case 247 /* ExternalModuleReference */: + return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); // JSX - case 246 /* JsxElement */: - return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), visitNodes(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 247 /* JsxSelfClosingElement */: - return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNodes(node.attributes, visitor, ts.isJsxAttributeLike)); - case 248 /* JsxOpeningElement */: - return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNodes(node.attributes, visitor, ts.isJsxAttributeLike)); - case 249 /* JsxClosingElement */: + case 248 /* JsxElement */: + return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); + case 253 /* JsxAttributes */: + return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); + case 249 /* JsxSelfClosingElement */: + return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); + case 250 /* JsxOpeningElement */: + return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); + case 251 /* JsxClosingElement */: return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 250 /* JsxAttribute */: + case 252 /* JsxAttribute */: return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 251 /* JsxSpreadAttribute */: + case 254 /* JsxSpreadAttribute */: return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); - case 252 /* JsxExpression */: + case 255 /* JsxExpression */: return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); // Clauses - case 253 /* CaseClause */: - return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.statements, visitor, ts.isStatement)); - case 254 /* DefaultClause */: - return ts.updateDefaultClause(node, visitNodes(node.statements, visitor, ts.isStatement)); - case 255 /* HeritageClause */: - return ts.updateHeritageClause(node, visitNodes(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 256 /* CatchClause */: + case 256 /* CaseClause */: + return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); + case 257 /* DefaultClause */: + return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + case 258 /* HeritageClause */: + return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); + case 259 /* CatchClause */: return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); // Property assignments - case 257 /* PropertyAssignment */: + case 260 /* PropertyAssignment */: return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 258 /* ShorthandPropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 259 /* SpreadAssignment */: + case 262 /* SpreadAssignment */: return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); + // Enum + case 263 /* EnumMember */: + return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 261 /* SourceFile */: + case 264 /* SourceFile */: return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 294 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); default: - var updated = void 0; - var edgeTraversalPath = nodeEdgeTraversalMap[kind]; - if (edgeTraversalPath) { - for (var _i = 0, edgeTraversalPath_2 = edgeTraversalPath; _i < edgeTraversalPath_2.length; _i++) { - var edge = edgeTraversalPath_2[_i]; - var value = node[edge.name]; - if (value !== undefined) { - var visited = ts.isArray(value) - ? visitNodes(value, visitor, edge.test, 0, value.length, edge.parenthesize, node) - : visitNode(value, visitor, edge.test, edge.optional, edge.lift, edge.parenthesize, node); - if (updated !== undefined || visited !== value) { - if (updated === undefined) { - updated = ts.getMutableClone(node); - } - if (visited !== value) { - updated[edge.name] = visited; - } - } - } - } - } - return updated ? ts.updateNode(updated, node) : node; + return node; } - // return node; } ts.visitEachChild = visitEachChild; + /** + * Extracts the single node from a NodeArray. + * + * @param nodes The NodeArray. + */ + function extractSingleNode(nodes) { + ts.Debug.assert(nodes.length <= 1, "Too many nodes written to output."); + return ts.singleOrUndefined(nodes); + } +})(ts || (ts = {})); +/* @internal */ +(function (ts) { + function reduceNode(node, f, initial) { + return node ? f(initial, node) : initial; + } + function reduceNodeArray(nodes, f, initial) { + return nodes ? f(initial, nodes) : initial; + } + /** + * Similar to `reduceLeft`, performs a reduction against each child of a node. + * NOTE: Unlike `forEachChild`, this does *not* visit every node. + * + * @param node The node containing the children to reduce. + * @param initial The initial value to supply to the reduction. + * @param f The callback function + */ + function reduceEachChild(node, initial, cbNode, cbNodeArray) { + if (node === undefined) { + return initial; + } + var reduceNodes = cbNodeArray ? reduceNodeArray : ts.reduceLeft; + var cbNodes = cbNodeArray || cbNode; + var kind = node.kind; + // No need to visit nodes with no children. + if ((kind > 0 /* FirstToken */ && kind <= 141 /* LastToken */)) { + return initial; + } + // We do not yet support types. + if ((kind >= 157 /* TypePredicate */ && kind <= 172 /* LiteralType */)) { + return initial; + } + var result = initial; + switch (node.kind) { + // Leaf nodes + case 205 /* SemicolonClassElement */: + case 208 /* EmptyStatement */: + case 199 /* OmittedExpression */: + case 224 /* DebuggerStatement */: + case 294 /* NotEmittedStatement */: + // No need to visit nodes with no children. + break; + // Names + case 142 /* QualifiedName */: + result = reduceNode(node.left, cbNode, result); + result = reduceNode(node.right, cbNode, result); + break; + case 143 /* ComputedPropertyName */: + result = reduceNode(node.expression, cbNode, result); + break; + // Signature elements + case 145 /* Parameter */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + case 146 /* Decorator */: + result = reduceNode(node.expression, cbNode, result); + break; + // Type member + case 148 /* PropertyDeclaration */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + case 150 /* MethodDeclaration */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.typeParameters, cbNodes, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.body, cbNode, result); + break; + case 151 /* Constructor */: + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.body, cbNode, result); + break; + case 152 /* GetAccessor */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.body, cbNode, result); + break; + case 153 /* SetAccessor */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.body, cbNode, result); + break; + // Binding patterns + case 173 /* ObjectBindingPattern */: + case 174 /* ArrayBindingPattern */: + result = reduceNodes(node.elements, cbNodes, result); + break; + case 175 /* BindingElement */: + result = reduceNode(node.propertyName, cbNode, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + // Expression + case 176 /* ArrayLiteralExpression */: + result = reduceNodes(node.elements, cbNodes, result); + break; + case 177 /* ObjectLiteralExpression */: + result = reduceNodes(node.properties, cbNodes, result); + break; + case 178 /* PropertyAccessExpression */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.name, cbNode, result); + break; + case 179 /* ElementAccessExpression */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.argumentExpression, cbNode, result); + break; + case 180 /* CallExpression */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNodes(node.typeArguments, cbNodes, result); + result = reduceNodes(node.arguments, cbNodes, result); + break; + case 181 /* NewExpression */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNodes(node.typeArguments, cbNodes, result); + result = reduceNodes(node.arguments, cbNodes, result); + break; + case 182 /* TaggedTemplateExpression */: + result = reduceNode(node.tag, cbNode, result); + result = reduceNode(node.template, cbNode, result); + break; + case 183 /* TypeAssertionExpression */: + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.expression, cbNode, result); + break; + case 185 /* FunctionExpression */: + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.typeParameters, cbNodes, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.body, cbNode, result); + break; + case 186 /* ArrowFunction */: + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNodes(node.typeParameters, cbNodes, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.body, cbNode, result); + break; + case 184 /* ParenthesizedExpression */: + case 187 /* DeleteExpression */: + case 188 /* TypeOfExpression */: + case 189 /* VoidExpression */: + case 190 /* AwaitExpression */: + case 196 /* YieldExpression */: + case 197 /* SpreadElement */: + case 202 /* NonNullExpression */: + result = reduceNode(node.expression, cbNode, result); + break; + case 191 /* PrefixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: + result = reduceNode(node.operand, cbNode, result); + break; + case 193 /* BinaryExpression */: + result = reduceNode(node.left, cbNode, result); + result = reduceNode(node.right, cbNode, result); + break; + case 194 /* ConditionalExpression */: + result = reduceNode(node.condition, cbNode, result); + result = reduceNode(node.whenTrue, cbNode, result); + result = reduceNode(node.whenFalse, cbNode, result); + break; + case 195 /* TemplateExpression */: + result = reduceNode(node.head, cbNode, result); + result = reduceNodes(node.templateSpans, cbNodes, result); + break; + case 198 /* ClassExpression */: + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.typeParameters, cbNodes, result); + result = reduceNodes(node.heritageClauses, cbNodes, result); + result = reduceNodes(node.members, cbNodes, result); + break; + case 200 /* ExpressionWithTypeArguments */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNodes(node.typeArguments, cbNodes, result); + break; + case 201 /* AsExpression */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.type, cbNode, result); + break; + case 202 /* NonNullExpression */: + result = reduceNode(node.expression, cbNode, result); + break; + // Misc + case 204 /* TemplateSpan */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.literal, cbNode, result); + break; + // Element + case 206 /* Block */: + result = reduceNodes(node.statements, cbNodes, result); + break; + case 207 /* VariableStatement */: + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.declarationList, cbNode, result); + break; + case 209 /* ExpressionStatement */: + result = reduceNode(node.expression, cbNode, result); + break; + case 210 /* IfStatement */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.thenStatement, cbNode, result); + result = reduceNode(node.elseStatement, cbNode, result); + break; + case 211 /* DoStatement */: + result = reduceNode(node.statement, cbNode, result); + result = reduceNode(node.expression, cbNode, result); + break; + case 212 /* WhileStatement */: + case 219 /* WithStatement */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.statement, cbNode, result); + break; + case 213 /* ForStatement */: + result = reduceNode(node.initializer, cbNode, result); + result = reduceNode(node.condition, cbNode, result); + result = reduceNode(node.incrementor, cbNode, result); + result = reduceNode(node.statement, cbNode, result); + break; + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: + result = reduceNode(node.initializer, cbNode, result); + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.statement, cbNode, result); + break; + case 218 /* ReturnStatement */: + case 222 /* ThrowStatement */: + result = reduceNode(node.expression, cbNode, result); + break; + case 220 /* SwitchStatement */: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.caseBlock, cbNode, result); + break; + case 221 /* LabeledStatement */: + result = reduceNode(node.label, cbNode, result); + result = reduceNode(node.statement, cbNode, result); + break; + case 223 /* TryStatement */: + result = reduceNode(node.tryBlock, cbNode, result); + result = reduceNode(node.catchClause, cbNode, result); + result = reduceNode(node.finallyBlock, cbNode, result); + break; + case 225 /* VariableDeclaration */: + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + case 226 /* VariableDeclarationList */: + result = reduceNodes(node.declarations, cbNodes, result); + break; + case 227 /* FunctionDeclaration */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.typeParameters, cbNodes, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.body, cbNode, result); + break; + case 228 /* ClassDeclaration */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.typeParameters, cbNodes, result); + result = reduceNodes(node.heritageClauses, cbNodes, result); + result = reduceNodes(node.members, cbNodes, result); + break; + case 231 /* EnumDeclaration */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.members, cbNodes, result); + break; + case 232 /* ModuleDeclaration */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.body, cbNode, result); + break; + case 233 /* ModuleBlock */: + result = reduceNodes(node.statements, cbNodes, result); + break; + case 234 /* CaseBlock */: + result = reduceNodes(node.clauses, cbNodes, result); + break; + case 236 /* ImportEqualsDeclaration */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.moduleReference, cbNode, result); + break; + case 237 /* ImportDeclaration */: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.importClause, cbNode, result); + result = reduceNode(node.moduleSpecifier, cbNode, result); + break; + case 238 /* ImportClause */: + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.namedBindings, cbNode, result); + break; + case 239 /* NamespaceImport */: + result = reduceNode(node.name, cbNode, result); + break; + case 240 /* NamedImports */: + case 244 /* NamedExports */: + result = reduceNodes(node.elements, cbNodes, result); + break; + case 241 /* ImportSpecifier */: + case 245 /* ExportSpecifier */: + result = reduceNode(node.propertyName, cbNode, result); + result = reduceNode(node.name, cbNode, result); + break; + case 242 /* ExportAssignment */: + result = ts.reduceLeft(node.decorators, cbNode, result); + result = ts.reduceLeft(node.modifiers, cbNode, result); + result = reduceNode(node.expression, cbNode, result); + break; + case 243 /* ExportDeclaration */: + result = ts.reduceLeft(node.decorators, cbNode, result); + result = ts.reduceLeft(node.modifiers, cbNode, result); + result = reduceNode(node.exportClause, cbNode, result); + result = reduceNode(node.moduleSpecifier, cbNode, result); + break; + // Module references + case 247 /* ExternalModuleReference */: + result = reduceNode(node.expression, cbNode, result); + break; + // JSX + case 248 /* JsxElement */: + result = reduceNode(node.openingElement, cbNode, result); + result = ts.reduceLeft(node.children, cbNode, result); + result = reduceNode(node.closingElement, cbNode, result); + break; + case 249 /* JsxSelfClosingElement */: + case 250 /* JsxOpeningElement */: + result = reduceNode(node.tagName, cbNode, result); + result = reduceNode(node.attributes, cbNode, result); + break; + case 253 /* JsxAttributes */: + result = reduceNodes(node.properties, cbNodes, result); + break; + case 251 /* JsxClosingElement */: + result = reduceNode(node.tagName, cbNode, result); + break; + case 252 /* JsxAttribute */: + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + case 254 /* JsxSpreadAttribute */: + result = reduceNode(node.expression, cbNode, result); + break; + case 255 /* JsxExpression */: + result = reduceNode(node.expression, cbNode, result); + break; + // Clauses + case 256 /* CaseClause */: + result = reduceNode(node.expression, cbNode, result); + // falls through + case 257 /* DefaultClause */: + result = reduceNodes(node.statements, cbNodes, result); + break; + case 258 /* HeritageClause */: + result = reduceNodes(node.types, cbNodes, result); + break; + case 259 /* CatchClause */: + result = reduceNode(node.variableDeclaration, cbNode, result); + result = reduceNode(node.block, cbNode, result); + break; + // Property assignments + case 260 /* PropertyAssignment */: + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + case 261 /* ShorthandPropertyAssignment */: + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.objectAssignmentInitializer, cbNode, result); + break; + case 262 /* SpreadAssignment */: + result = reduceNode(node.expression, cbNode, result); + break; + // Enum + case 263 /* EnumMember */: + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + // Top-level nodes + case 264 /* SourceFile */: + result = reduceNodes(node.statements, cbNodes, result); + break; + // Transformation nodes + case 295 /* PartiallyEmittedExpression */: + result = reduceNode(node.expression, cbNode, result); + break; + default: + break; + } + return result; + } + ts.reduceEachChild = reduceEachChild; function mergeLexicalEnvironment(statements, declarations) { if (!ts.some(declarations)) { return statements; } return ts.isNodeArray(statements) - ? ts.createNodeArray(ts.concatenate(statements, declarations), statements) + ? ts.setTextRange(ts.createNodeArray(ts.concatenate(statements, declarations)), statements) : ts.addRange(statements, declarations); } ts.mergeLexicalEnvironment = mergeLexicalEnvironment; - function mergeFunctionBodyLexicalEnvironment(body, declarations) { - if (body && declarations !== undefined && declarations.length > 0) { - if (ts.isBlock(body)) { - return ts.updateBlock(body, ts.createNodeArray(ts.concatenate(body.statements, declarations), body.statements)); - } - else { - return ts.createBlock(ts.createNodeArray([ts.createReturn(body, /*location*/ body)].concat(declarations), body), - /*location*/ body, - /*multiLine*/ true); - } - } - return body; - } - ts.mergeFunctionBodyLexicalEnvironment = mergeFunctionBodyLexicalEnvironment; /** * Lifts a NodeArray containing only Statement nodes to a block. * @@ -44575,15 +48129,6 @@ var ts; return ts.singleOrUndefined(nodes) || ts.createBlock(nodes); } ts.liftToBlock = liftToBlock; - /** - * Extracts the single node from a NodeArray. - * - * @param nodes The NodeArray. - */ - function extractSingleNode(nodes) { - Debug.assert(nodes.length <= 1, "Too many nodes written to output."); - return ts.singleOrUndefined(nodes); - } /** * Aggregates the TransformFlags for a Node and its subtree. */ @@ -44629,7 +48174,7 @@ var ts; function aggregateTransformFlagsForSubtree(node) { // We do not transform ambient declarations or types, so there is no need to // recursively aggregate transform flags. - if (ts.hasModifier(node, 2 /* Ambient */) || ts.isTypeNode(node)) { + if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 200 /* ExpressionWithTypeArguments */)) { return 0 /* None */; } // Aggregate the transform flags of each child. @@ -44647,9 +48192,6 @@ var ts; } var Debug; (function (Debug) { - Debug.failNotOptional = Debug.shouldAssert(1 /* Normal */) - ? function (message) { return Debug.assert(false, message || "Node not optional."); } - : ts.noop; Debug.failBadSyntaxKind = Debug.shouldAssert(1 /* Normal */) ? function (node, message) { return Debug.assert(false, message || "Unexpected node.", function () { return "Node " + ts.formatSyntaxKind(node.kind) + " was unexpected."; }); } : ts.noop; @@ -44682,7 +48224,6 @@ var ts; } } })(Debug = ts.Debug || (ts.Debug = {})); - var _a; })(ts || (ts = {})); /// /// @@ -44710,7 +48251,7 @@ var ts; var value; if (ts.isDestructuringAssignment(node)) { value = node.right; - while (ts.isEmptyObjectLiteralOrArrayLiteral(node.left)) { + while (ts.isEmptyArrayLiteral(node.left) || ts.isEmptyObjectLiteral(node.left)) { if (ts.isDestructuringAssignment(value)) { location = node = value; value = node.right; @@ -44724,6 +48265,7 @@ var ts; var flattenContext = { context: context, level: level, + downlevelIteration: context.getCompilerOptions().downlevelIteration, hoistTempVariables: true, emitExpression: emitExpression, emitBindingOrAssignment: emitBindingOrAssignment, @@ -44772,7 +48314,7 @@ var ts; ts.Debug.assertNode(target, createAssignmentCallback ? ts.isIdentifier : ts.isExpression); var expression = createAssignmentCallback ? createAssignmentCallback(target, value, location) - : ts.createAssignment(ts.visitNode(target, visitor, ts.isExpression), value, location); + : ts.setTextRange(ts.createAssignment(ts.visitNode(target, visitor, ts.isExpression), value), location); expression.original = original; emitExpression(expression); } @@ -44796,6 +48338,7 @@ var ts; var flattenContext = { context: context, level: level, + downlevelIteration: context.getCompilerOptions().downlevelIteration, hoistTempVariables: hoistTempVariables, emitExpression: emitExpression, emitBindingOrAssignment: emitBindingOrAssignment, @@ -44821,11 +48364,12 @@ var ts; } } for (var _i = 0, pendingDeclarations_1 = pendingDeclarations; _i < pendingDeclarations_1.length; _i++) { - var _a = pendingDeclarations_1[_i], pendingExpressions_1 = _a.pendingExpressions, name_29 = _a.name, value = _a.value, location_2 = _a.location, original = _a.original; - var variable = ts.createVariableDeclaration(name_29, - /*type*/ undefined, pendingExpressions_1 ? ts.inlineExpressions(ts.append(pendingExpressions_1, value)) : value, location_2); + var _a = pendingDeclarations_1[_i], pendingExpressions_1 = _a.pendingExpressions, name = _a.name, value = _a.value, location = _a.location, original = _a.original; + var variable = ts.createVariableDeclaration(name, + /*type*/ undefined, pendingExpressions_1 ? ts.inlineExpressions(ts.append(pendingExpressions_1, value)) : value); variable.original = original; - if (ts.isIdentifier(name_29)) { + ts.setTextRange(variable, location); + if (ts.isIdentifier(name)) { ts.setEmitFlags(variable, 64 /* NoNestedSourceMaps */); } ts.aggregateTransformFlags(variable); @@ -44947,7 +48491,14 @@ var ts; function flattenArrayBindingOrAssignmentPattern(flattenContext, parent, pattern, value, location) { var elements = ts.getElementsOfBindingOrAssignmentPattern(pattern); var numElements = elements.length; - if (numElements !== 1 && (flattenContext.level < 1 /* ObjectRest */ || numElements === 0)) { + if (flattenContext.level < 1 /* ObjectRest */ && flattenContext.downlevelIteration) { + // Read the elements of the iterable into an array + value = ensureIdentifier(flattenContext, ts.createReadHelper(flattenContext.context, value, numElements > 0 && ts.getRestIndicatorOfBindingOrAssignmentElement(elements[numElements - 1]) + ? undefined + : numElements, location), + /*reuseIdentifierExpressions*/ false, location); + } + else if (numElements !== 1 && (flattenContext.level < 1 /* ObjectRest */ || numElements === 0)) { // For anything other than a single-element destructuring we need to generate a temporary // to ensure value is evaluated exactly once. Additionally, if we have zero elements // we need to emit *something* to ensure that in case a 'var' keyword was already emitted, @@ -45029,8 +48580,8 @@ var ts; return ts.createElementAccess(value, argumentExpression); } else { - var name_30 = ts.createIdentifier(ts.unescapeIdentifier(propertyName.text)); - return ts.createPropertyAccess(value, name_30); + var name = ts.createIdentifier(ts.unescapeIdentifier(propertyName.text)); + return ts.createPropertyAccess(value, name); } } /** @@ -45052,7 +48603,7 @@ var ts; var temp = ts.createTempVariable(/*recordTempVariable*/ undefined); if (flattenContext.hoistTempVariables) { flattenContext.context.hoistVariableDeclaration(temp); - flattenContext.emitExpression(ts.createAssignment(temp, value, location)); + flattenContext.emitExpression(ts.setTextRange(ts.createAssignment(temp, value), location)); } else { flattenContext.emitBindingOrAssignment(temp, value, location, /*original*/ undefined); @@ -45075,7 +48626,7 @@ var ts; return ts.createObjectLiteral(ts.map(elements, ts.convertToObjectAssignmentElement)); } function makeBindingElement(name) { - return ts.createBindingElement(/*propertyName*/ undefined, /*dotDotDotToken*/ undefined, name); + return ts.createBindingElement(/*dotDotDotToken*/ undefined, /*propertyName*/ undefined, name); } function makeAssignmentElement(name) { return name; @@ -45083,10 +48634,11 @@ var ts; var restHelper = { name: "typescript:rest", scoped: false, - text: "\n var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\n t[p[i]] = s[p[i]];\n return t;\n };" + text: "\n var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\n t[p[i]] = s[p[i]];\n return t;\n };" }; /** Given value: o, propName: p, pattern: { a, b, ...p } from the original statement - * `{ a, b, ...p } = o`, create `p = __rest(o, ["a", "b"]);`*/ + * `{ a, b, ...p } = o`, create `p = __rest(o, ["a", "b"]);` + */ function createRestCall(context, value, elements, computedTempVariables, location) { context.requestEmitHelper(restHelper); var propertyNames = []; @@ -45105,7 +48657,11 @@ var ts; } } } - return ts.createCall(ts.getHelperName("__rest"), undefined, [value, ts.createArrayLiteral(propertyNames, location)]); + return ts.createCall(ts.getHelperName("__rest"), + /*typeArguments*/ undefined, [ + value, + ts.setTextRange(ts.createArrayLiteral(propertyNames), location) + ]); } })(ts || (ts = {})); /// @@ -45140,8 +48696,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(177 /* PropertyAccessExpression */); - context.enableSubstitution(178 /* ElementAccessExpression */); + context.enableSubstitution(178 /* PropertyAccessExpression */); + context.enableSubstitution(179 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -45205,15 +48761,15 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 261 /* SourceFile */: - case 232 /* CaseBlock */: - case 231 /* ModuleBlock */: - case 204 /* Block */: + case 264 /* SourceFile */: + case 234 /* CaseBlock */: + case 233 /* ModuleBlock */: + case 206 /* Block */: currentScope = node; currentScopeFirstDeclarationsOfName = undefined; break; - case 226 /* ClassDeclaration */: - case 225 /* FunctionDeclaration */: + case 228 /* ClassDeclaration */: + case 227 /* FunctionDeclaration */: if (ts.hasModifier(node, 2 /* Ambient */)) { break; } @@ -45260,13 +48816,13 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 235 /* ImportDeclaration */: + case 237 /* ImportDeclaration */: return visitImportDeclaration(node); - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: return visitExportAssignment(node); - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: return visitExportDeclaration(node); default: return visitorWorker(node); @@ -45286,11 +48842,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 241 /* ExportDeclaration */ || - node.kind === 235 /* ImportDeclaration */ || - node.kind === 236 /* ImportClause */ || - (node.kind === 234 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 245 /* ExternalModuleReference */)) { + if (node.kind === 243 /* ExportDeclaration */ || + node.kind === 237 /* ImportDeclaration */ || + node.kind === 238 /* ImportClause */ || + (node.kind === 236 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 247 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -45320,19 +48876,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 150 /* Constructor */: + case 151 /* Constructor */: // TypeScript constructors are transformed in `visitClassDeclaration`. // We elide them here as `visitorWorker` checks transform flags, which could // erronously include an ES6 constructor without TypeScript syntax. return undefined; - case 147 /* PropertyDeclaration */: - case 155 /* IndexSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 149 /* MethodDeclaration */: + case 148 /* PropertyDeclaration */: + case 156 /* IndexSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 150 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 203 /* SemicolonClassElement */: + case 205 /* SemicolonClassElement */: return node; default: ts.Debug.failBadSyntaxKind(node); @@ -45372,46 +48928,47 @@ var ts; case 123 /* DeclareKeyword */: case 130 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided. - case 162 /* ArrayType */: - case 163 /* TupleType */: - case 161 /* TypeLiteral */: - case 156 /* TypePredicate */: - case 143 /* TypeParameter */: + case 163 /* ArrayType */: + case 164 /* TupleType */: + case 162 /* TypeLiteral */: + case 157 /* TypePredicate */: + case 144 /* TypeParameter */: case 118 /* AnyKeyword */: case 121 /* BooleanKeyword */: - case 134 /* StringKeyword */: + case 135 /* StringKeyword */: case 132 /* NumberKeyword */: case 129 /* NeverKeyword */: case 104 /* VoidKeyword */: - case 135 /* SymbolKeyword */: - case 159 /* ConstructorType */: - case 158 /* FunctionType */: - case 160 /* TypeQuery */: - case 157 /* TypeReference */: - case 164 /* UnionType */: - case 165 /* IntersectionType */: - case 166 /* ParenthesizedType */: - case 167 /* ThisType */: - case 168 /* TypeOperator */: - case 169 /* IndexedAccessType */: - case 170 /* MappedType */: - case 171 /* LiteralType */: + case 136 /* SymbolKeyword */: + case 160 /* ConstructorType */: + case 159 /* FunctionType */: + case 161 /* TypeQuery */: + case 158 /* TypeReference */: + case 165 /* UnionType */: + case 166 /* IntersectionType */: + case 167 /* ParenthesizedType */: + case 168 /* ThisType */: + case 169 /* TypeOperator */: + case 170 /* IndexedAccessType */: + case 171 /* MappedType */: + case 172 /* LiteralType */: // TypeScript type nodes are elided. - case 155 /* IndexSignature */: + case 156 /* IndexSignature */: // TypeScript index signatures are elided. - case 145 /* Decorator */: + case 146 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. - case 228 /* TypeAliasDeclaration */: + case 230 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. - case 147 /* PropertyDeclaration */: - // TypeScript property declarations are elided. - case 150 /* Constructor */: + case 148 /* PropertyDeclaration */: + // TypeScript property declarations are elided. + return undefined; + case 151 /* Constructor */: return visitConstructor(node); - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: // TypeScript interfaces are elided, but some comments may be preserved. // See the implementation of `getLeadingComments` in comments.ts for more details. return ts.createNotEmittedStatement(node); - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: // This is a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -45422,7 +48979,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 197 /* ClassExpression */: + case 198 /* ClassExpression */: // This is a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -45433,35 +48990,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 255 /* HeritageClause */: + case 258 /* HeritageClause */: // This is a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 199 /* ExpressionWithTypeArguments */: + case 200 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 149 /* MethodDeclaration */: + case 150 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 151 /* GetAccessor */: + case 152 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 152 /* SetAccessor */: + case 153 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 184 /* FunctionExpression */: + case 185 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 185 /* ArrowFunction */: + case 186 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 144 /* Parameter */: + case 145 /* Parameter */: // This is a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -45471,33 +49028,33 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 182 /* TypeAssertionExpression */: - case 200 /* AsExpression */: + case 183 /* TypeAssertionExpression */: + case 201 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 179 /* CallExpression */: + case 180 /* CallExpression */: return visitCallExpression(node); - case 180 /* NewExpression */: + case 181 /* NewExpression */: return visitNewExpression(node); - case 201 /* NonNullExpression */: + case 202 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 223 /* VariableDeclaration */: + case 225 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); default: @@ -45506,7 +49063,8 @@ var ts; } } function visitSourceFile(node) { - var alwaysStrict = compilerOptions.alwaysStrict && !(ts.isExternalModule(node) && moduleKind === ts.ModuleKind.ES2015); + var alwaysStrict = (compilerOptions.alwaysStrict === undefined ? compilerOptions.strict : compilerOptions.alwaysStrict) && + !(ts.isExternalModule(node) && moduleKind === ts.ModuleKind.ES2015); return ts.updateSourceFileNode(node, ts.visitLexicalEnvironment(node.statements, sourceElementVisitor, context, /*start*/ 0, alwaysStrict)); } /** @@ -45602,13 +49160,14 @@ var ts; // } var classDeclaration = ts.createClassDeclaration( /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), name, - /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), transformClassMembers(node, hasExtendsClause), node); - var emitFlags = ts.getEmitFlags(node); + /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), transformClassMembers(node, hasExtendsClause)); // To better align with the old emitter, we should not emit a trailing source map // entry if the class has static properties. + var emitFlags = ts.getEmitFlags(node); if (hasStaticProperties) { emitFlags |= 32 /* NoTrailingSourceMap */; } + ts.setTextRange(classDeclaration, node); ts.setOriginalNode(classDeclaration, node); ts.setEmitFlags(classDeclaration, emitFlags); return classDeclaration; @@ -45716,12 +49275,18 @@ var ts; // } var heritageClauses = ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause); var members = transformClassMembers(node, hasExtendsClause); - var classExpression = ts.createClassExpression(/*modifiers*/ undefined, name, /*typeParameters*/ undefined, heritageClauses, members, location); + var classExpression = ts.createClassExpression(/*modifiers*/ undefined, name, /*typeParameters*/ undefined, heritageClauses, members); ts.setOriginalNode(classExpression, node); + ts.setTextRange(classExpression, location); // let ${name} = ${classExpression} where name is either declaredName if the class doesn't contain self-reference // or decoratedClassAlias if the class contain self-reference. - var statement = ts.createLetStatement(declName, classAlias ? ts.createAssignment(classAlias, classExpression) : classExpression, location); + var statement = ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration(declName, + /*type*/ undefined, classAlias ? ts.createAssignment(classAlias, classExpression) : classExpression) + ], 1 /* Let */)); ts.setOriginalNode(statement, node); + ts.setTextRange(statement, location); ts.setCommentRange(statement, node); return statement; } @@ -45738,10 +49303,11 @@ var ts; var staticProperties = getInitializedProperties(node, /*isStatic*/ true); var heritageClauses = ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause); var members = transformClassMembers(node, ts.some(heritageClauses, function (c) { return c.token === 84 /* ExtendsKeyword */; })); - var classExpression = ts.setOriginalNode(ts.createClassExpression( + var classExpression = ts.createClassExpression( /*modifiers*/ undefined, node.name, - /*typeParameters*/ undefined, heritageClauses, members, - /*location*/ node), node); + /*typeParameters*/ undefined, heritageClauses, members); + ts.setOriginalNode(classExpression, node); + ts.setTextRange(classExpression, node); if (staticProperties.length > 0) { var expressions = []; var temp = ts.createTempVariable(hoistVariableDeclaration); @@ -45773,7 +49339,7 @@ var ts; members.push(constructor); } ts.addRange(members, ts.visitNodes(node.members, classElementVisitor, ts.isClassElement)); - return ts.createNodeArray(members, /*location*/ node.members); + return ts.setTextRange(ts.createNodeArray(members), /*location*/ node.members); } /** * Transforms (or creates) a constructor for a class. @@ -45798,10 +49364,9 @@ var ts; // constructor(${parameters}) { // ${body} // } - return ts.startOnNewLine(ts.setOriginalNode(ts.createConstructor( + return ts.startOnNewLine(ts.setOriginalNode(ts.setTextRange(ts.createConstructor( /*decorators*/ undefined, - /*modifiers*/ undefined, parameters, body, - /*location*/ constructor || node), constructor)); + /*modifiers*/ undefined, parameters, body), constructor || node), constructor)); } /** * Transforms (or creates) the parameters for the constructor of a class with @@ -45883,11 +49448,11 @@ var ts; ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, indexOfFirstStatement)); } // End the lexical environment. - ts.addRange(statements, endLexicalEnvironment()); - return ts.createBlock(ts.createNodeArray(statements, + statements = ts.mergeLexicalEnvironment(statements, endLexicalEnvironment()); + return ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), /*location*/ constructor ? constructor.body.statements : node.members), - /*location*/ constructor ? constructor.body : undefined, - /*multiLine*/ true); + /*multiLine*/ true), + /*location*/ constructor ? constructor.body : undefined); } /** * Adds super call and preceding prologue directives into the list of statements. @@ -45899,13 +49464,13 @@ var ts; if (ctor.body) { var statements = ctor.body.statements; // add prologue directives to the list (if any) - var index = ts.addPrologueDirectives(result, statements, /*ensureUseStrict*/ false, visitor); + var index = ts.addPrologue(result, statements, /*ensureUseStrict*/ false, visitor); if (index === statements.length) { // list contains nothing but prologue directives (or empty) - exit return index; } var statement = statements[index]; - if (statement.kind === 207 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 209 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { result.push(ts.visitNode(statement, visitor, ts.isStatement)); return index + 1; } @@ -45942,9 +49507,7 @@ var ts; ts.setEmitFlags(propertyName, 1536 /* NoComments */ | 48 /* NoSourceMap */); var localName = ts.getMutableClone(name); ts.setEmitFlags(localName, 1536 /* NoComments */); - return ts.startOnNewLine(ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createThis(), propertyName, - /*location*/ node.name), localName), - /*location*/ ts.moveRangePos(node, -1))); + return ts.startOnNewLine(ts.setTextRange(ts.createStatement(ts.createAssignment(ts.setTextRange(ts.createPropertyAccess(ts.createThis(), propertyName), node.name), localName)), ts.moveRangePos(node, -1))); } /** * Gets all property declarations with initializers on either the static or instance side of a class. @@ -45978,7 +49541,7 @@ var ts; * @param isStatic A value indicating whether the member should be a static or instance member. */ function isInitializedProperty(member, isStatic) { - return member.kind === 147 /* PropertyDeclaration */ + return member.kind === 148 /* PropertyDeclaration */ && isStatic === ts.hasModifier(member, 32 /* Static */) && member.initializer !== undefined; } @@ -45989,8 +49552,8 @@ var ts; * @param receiver The receiver on which each property should be assigned. */ function addInitializedPropertyStatements(statements, properties, receiver) { - for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) { - var property = properties_7[_i]; + for (var _i = 0, properties_9 = properties; _i < properties_9.length; _i++) { + var property = properties_9[_i]; var statement = ts.createStatement(transformInitializedProperty(property, receiver)); ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property)); ts.setCommentRange(statement, property); @@ -46005,8 +49568,8 @@ var ts; */ function generateInitializedPropertyExpressions(properties, receiver) { var expressions = []; - for (var _i = 0, properties_8 = properties; _i < properties_8.length; _i++) { - var property = properties_8[_i]; + for (var _i = 0, properties_10 = properties; _i < properties_10.length; _i++) { + var property = properties_10[_i]; var expression = transformInitializedProperty(property, receiver); expression.startsOnNewLine = true; ts.setSourceMapRange(expression, ts.moveRangePastModifiers(property)); @@ -46113,12 +49676,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 149 /* MethodDeclaration */: + case 150 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 147 /* PropertyDeclaration */: + case 148 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -46135,10 +49698,11 @@ var ts; return undefined; } var _a = ts.getAllAccessorDeclarations(node.members, accessor), firstAccessor = _a.firstAccessor, secondAccessor = _a.secondAccessor, setAccessor = _a.setAccessor; - if (accessor !== firstAccessor) { + var firstAccessorWithDecorators = firstAccessor.decorators ? firstAccessor : secondAccessor && secondAccessor.decorators ? secondAccessor : undefined; + if (!firstAccessorWithDecorators || accessor !== firstAccessorWithDecorators) { return undefined; } - var decorators = firstAccessor.decorators || (secondAccessor && secondAccessor.decorators); + var decorators = firstAccessorWithDecorators.decorators; var parameters = getDecoratorsOfParameters(setAccessor); if (!decorators && !parameters) { return undefined; @@ -46179,14 +49743,14 @@ var ts; * @param node The declaration node. * @param allDecorators An object containing all of the decorators for the declaration. */ - function transformAllDecoratorsOfDeclaration(node, allDecorators) { + function transformAllDecoratorsOfDeclaration(node, container, allDecorators) { if (!allDecorators) { return undefined; } var decoratorExpressions = []; ts.addRange(decoratorExpressions, ts.map(allDecorators.decorators, transformDecorator)); ts.addRange(decoratorExpressions, ts.flatMap(allDecorators.parameters, transformDecoratorsOfParameter)); - addTypeMetadata(node, decoratorExpressions); + addTypeMetadata(node, container, decoratorExpressions); return decoratorExpressions; } /** @@ -46233,7 +49797,7 @@ var ts; */ function generateClassElementDecorationExpression(node, member) { var allDecorators = getAllDecoratorsOfClassElement(node, member); - var decoratorExpressions = transformAllDecoratorsOfDeclaration(member, allDecorators); + var decoratorExpressions = transformAllDecoratorsOfDeclaration(member, node, allDecorators); if (!decoratorExpressions) { return undefined; } @@ -46270,7 +49834,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 147 /* PropertyDeclaration */ + ? member.kind === 148 /* PropertyDeclaration */ ? ts.createVoidZero() : ts.createNull() : undefined; @@ -46296,7 +49860,7 @@ var ts; */ function generateConstructorDecorationExpression(node) { var allDecorators = getAllDecoratorsOfConstructor(node); - var decoratorExpressions = transformAllDecoratorsOfDeclaration(node, allDecorators); + var decoratorExpressions = transformAllDecoratorsOfDeclaration(node, node, allDecorators); if (!decoratorExpressions) { return undefined; } @@ -46342,41 +49906,41 @@ var ts; * @param node The declaration node. * @param decoratorExpressions The destination array to which to add new decorator expressions. */ - function addTypeMetadata(node, decoratorExpressions) { + function addTypeMetadata(node, container, decoratorExpressions) { if (USE_NEW_TYPE_METADATA_FORMAT) { - addNewTypeMetadata(node, decoratorExpressions); + addNewTypeMetadata(node, container, decoratorExpressions); } else { - addOldTypeMetadata(node, decoratorExpressions); + addOldTypeMetadata(node, container, decoratorExpressions); } } - function addOldTypeMetadata(node, decoratorExpressions) { + function addOldTypeMetadata(node, container, decoratorExpressions) { if (compilerOptions.emitDecoratorMetadata) { if (shouldAddTypeMetadata(node)) { decoratorExpressions.push(createMetadataHelper(context, "design:type", serializeTypeOfNode(node))); } if (shouldAddParamTypesMetadata(node)) { - decoratorExpressions.push(createMetadataHelper(context, "design:paramtypes", serializeParameterTypesOfNode(node))); + decoratorExpressions.push(createMetadataHelper(context, "design:paramtypes", serializeParameterTypesOfNode(node, container))); } if (shouldAddReturnTypeMetadata(node)) { decoratorExpressions.push(createMetadataHelper(context, "design:returntype", serializeReturnTypeOfNode(node))); } } } - function addNewTypeMetadata(node, decoratorExpressions) { + function addNewTypeMetadata(node, container, decoratorExpressions) { if (compilerOptions.emitDecoratorMetadata) { var properties = void 0; if (shouldAddTypeMetadata(node)) { (properties || (properties = [])).push(ts.createPropertyAssignment("type", ts.createArrowFunction(/*modifiers*/ undefined, /*typeParameters*/ undefined, [], /*type*/ undefined, ts.createToken(35 /* EqualsGreaterThanToken */), serializeTypeOfNode(node)))); } if (shouldAddParamTypesMetadata(node)) { - (properties || (properties = [])).push(ts.createPropertyAssignment("paramTypes", ts.createArrowFunction(/*modifiers*/ undefined, /*typeParameters*/ undefined, [], /*type*/ undefined, ts.createToken(35 /* EqualsGreaterThanToken */), serializeParameterTypesOfNode(node)))); + (properties || (properties = [])).push(ts.createPropertyAssignment("paramTypes", ts.createArrowFunction(/*modifiers*/ undefined, /*typeParameters*/ undefined, [], /*type*/ undefined, ts.createToken(35 /* EqualsGreaterThanToken */), serializeParameterTypesOfNode(node, container)))); } if (shouldAddReturnTypeMetadata(node)) { (properties || (properties = [])).push(ts.createPropertyAssignment("returnType", ts.createArrowFunction(/*modifiers*/ undefined, /*typeParameters*/ undefined, [], /*type*/ undefined, ts.createToken(35 /* EqualsGreaterThanToken */), serializeReturnTypeOfNode(node)))); } if (properties) { - decoratorExpressions.push(createMetadataHelper(context, "design:typeinfo", ts.createObjectLiteral(properties, /*location*/ undefined, /*multiLine*/ true))); + decoratorExpressions.push(createMetadataHelper(context, "design:typeinfo", ts.createObjectLiteral(properties, /*multiLine*/ true))); } } } @@ -46389,10 +49953,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 149 /* MethodDeclaration */ - || kind === 151 /* GetAccessor */ - || kind === 152 /* SetAccessor */ - || kind === 147 /* PropertyDeclaration */; + return kind === 150 /* MethodDeclaration */ + || kind === 152 /* GetAccessor */ + || kind === 153 /* SetAccessor */ + || kind === 148 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -46402,7 +49966,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 149 /* MethodDeclaration */; + return node.kind === 150 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -46412,12 +49976,16 @@ var ts; * @param node The node to test. */ function shouldAddParamTypesMetadata(node) { - var kind = node.kind; - return kind === 226 /* ClassDeclaration */ - || kind === 197 /* ClassExpression */ - || kind === 149 /* MethodDeclaration */ - || kind === 151 /* GetAccessor */ - || kind === 152 /* SetAccessor */; + switch (node.kind) { + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + return ts.getFirstConstructorWithBody(node) !== undefined; + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + return true; + } + return false; } /** * Serializes the type of a node for use with decorator type metadata. @@ -46426,43 +49994,26 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 147 /* PropertyDeclaration */: - case 144 /* Parameter */: - case 151 /* GetAccessor */: + case 148 /* PropertyDeclaration */: + case 145 /* Parameter */: + case 152 /* GetAccessor */: return serializeTypeNode(node.type); - case 152 /* SetAccessor */: + case 153 /* SetAccessor */: return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node)); - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 149 /* MethodDeclaration */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 150 /* MethodDeclaration */: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); } } - /** - * Gets the most likely element type for a TypeNode. This is not an exhaustive test - * as it assumes a rest argument can only be an array type (either T[], or Array). - * - * @param node The type node. - */ - function getRestParameterElementType(node) { - if (node && node.kind === 162 /* ArrayType */) { - return node.elementType; - } - else if (node && node.kind === 157 /* TypeReference */) { - return ts.singleOrUndefined(node.typeArguments); - } - else { - return undefined; - } - } /** * Serializes the types of the parameters of a node for use with decorator type metadata. * * @param node The node that should have its parameter types serialized. */ - function serializeParameterTypesOfNode(node) { + function serializeParameterTypesOfNode(node, container) { var valueDeclaration = ts.isClassLike(node) ? ts.getFirstConstructorWithBody(node) : ts.isFunctionLike(node) && ts.nodeIsPresent(node.body) @@ -46470,7 +50021,7 @@ var ts; : undefined; var expressions = []; if (valueDeclaration) { - var parameters = valueDeclaration.parameters; + var parameters = getParametersOfDecoratedDeclaration(valueDeclaration, container); var numParameters = parameters.length; for (var i = 0; i < numParameters; i++) { var parameter = parameters[i]; @@ -46478,7 +50029,7 @@ var ts; continue; } if (parameter.dotDotDotToken) { - expressions.push(serializeTypeNode(getRestParameterElementType(parameter.type))); + expressions.push(serializeTypeNode(ts.getRestParameterElementType(parameter.type))); } else { expressions.push(serializeTypeOfNode(parameter)); @@ -46487,6 +50038,15 @@ var ts; } return ts.createArrayLiteral(expressions); } + function getParametersOfDecoratedDeclaration(node, container) { + if (container && node.kind === 152 /* GetAccessor */) { + var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; + if (setAccessor) { + return setAccessor.parameters; + } + } + return node.parameters; + } /** * Serializes the return type of a node for use with decorator type metadata. * @@ -46496,7 +50056,7 @@ var ts; if (ts.isFunctionLike(node) && node.type) { return serializeTypeNode(node.type); } - else if (ts.isAsyncFunctionLike(node)) { + else if (ts.isAsyncFunction(node)) { return ts.createIdentifier("Promise"); } return ts.createVoidZero(); @@ -46525,21 +50085,26 @@ var ts; } switch (node.kind) { case 104 /* VoidKeyword */: + case 138 /* UndefinedKeyword */: + case 94 /* NullKeyword */: + case 129 /* NeverKeyword */: return ts.createVoidZero(); - case 166 /* ParenthesizedType */: + case 167 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 158 /* FunctionType */: - case 159 /* ConstructorType */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: return ts.createIdentifier("Function"); - case 162 /* ArrayType */: - case 163 /* TupleType */: + case 163 /* ArrayType */: + case 164 /* TupleType */: return ts.createIdentifier("Array"); - case 156 /* TypePredicate */: + case 157 /* TypePredicate */: case 121 /* BooleanKeyword */: return ts.createIdentifier("Boolean"); - case 134 /* StringKeyword */: + case 135 /* StringKeyword */: return ts.createIdentifier("String"); - case 171 /* LiteralType */: + case 133 /* ObjectKeyword */: + return ts.createIdentifier("Object"); + case 172 /* LiteralType */: switch (node.literal.kind) { case 9 /* StringLiteral */: return ts.createIdentifier("String"); @@ -46555,49 +50120,22 @@ var ts; break; case 132 /* NumberKeyword */: return ts.createIdentifier("Number"); - case 135 /* SymbolKeyword */: + case 136 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 157 /* TypeReference */: + case 158 /* TypeReference */: return serializeTypeReferenceNode(node); - case 165 /* IntersectionType */: - case 164 /* UnionType */: - { - var unionOrIntersection = node; - var serializedUnion = void 0; - for (var _i = 0, _a = unionOrIntersection.types; _i < _a.length; _i++) { - var typeNode = _a[_i]; - var serializedIndividual = serializeTypeNode(typeNode); - // Non identifier - if (serializedIndividual.kind !== 70 /* Identifier */) { - serializedUnion = undefined; - break; - } - // One of the individual is global object, return immediately - if (serializedIndividual.text === "Object") { - return serializedIndividual; - } - // Different types - if (serializedUnion && serializedUnion.text !== serializedIndividual.text) { - serializedUnion = undefined; - break; - } - serializedUnion = serializedIndividual; - } - // If we were able to find common type - if (serializedUnion) { - return serializedUnion; - } - } - // Fallthrough - case 160 /* TypeQuery */: - case 168 /* TypeOperator */: - case 169 /* IndexedAccessType */: - case 170 /* MappedType */: - case 161 /* TypeLiteral */: + case 166 /* IntersectionType */: + case 165 /* UnionType */: + return serializeUnionOrIntersectionType(node); + case 161 /* TypeQuery */: + case 169 /* TypeOperator */: + case 170 /* IndexedAccessType */: + case 171 /* MappedType */: + case 162 /* TypeLiteral */: case 118 /* AnyKeyword */: - case 167 /* ThisType */: + case 168 /* ThisType */: break; default: ts.Debug.failBadSyntaxKind(node); @@ -46605,6 +50143,37 @@ var ts; } return ts.createIdentifier("Object"); } + function serializeUnionOrIntersectionType(node) { + var serializedUnion; + for (var _i = 0, _a = node.types; _i < _a.length; _i++) { + var typeNode = _a[_i]; + var serializedIndividual = serializeTypeNode(typeNode); + if (ts.isVoidExpression(serializedIndividual)) { + // If we dont have any other type already set, set the initial type + if (!serializedUnion) { + serializedUnion = serializedIndividual; + } + } + else if (ts.isIdentifier(serializedIndividual) && serializedIndividual.text === "Object") { + // One of the individual is global object, return immediately + return serializedIndividual; + } + else if (serializedUnion && !ts.isVoidExpression(serializedUnion)) { + // Different types + if (!ts.isIdentifier(serializedUnion) || + !ts.isIdentifier(serializedIndividual) || + serializedUnion.text !== serializedIndividual.text) { + return ts.createIdentifier("Object"); + } + } + else { + // Initialize the union type + serializedUnion = serializedIndividual; + } + } + // If we were able to find common type, use it + return serializedUnion; + } /** * Serializes a TypeReferenceNode to an appropriate JS constructor value for use with * decorator type metadata. @@ -46654,15 +50223,15 @@ var ts; case 70 /* Identifier */: // Create a clone of the name with a new parent, and treat it as if it were // a source tree node for the purposes of the checker. - var name_31 = ts.getMutableClone(node); - name_31.flags &= ~8 /* Synthesized */; - name_31.original = undefined; - name_31.parent = currentScope; + var name = ts.getMutableClone(node); + name.flags &= ~8 /* Synthesized */; + name.original = undefined; + name.parent = currentScope; if (useFallback) { - return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name_31), ts.createLiteral("undefined")), name_31); + return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name), ts.createLiteral("undefined")), name); } - return name_31; - case 141 /* QualifiedName */: + return name; + case 142 /* QualifiedName */: return serializeQualifiedNameAsExpression(node, useFallback); } } @@ -46708,7 +50277,7 @@ var ts; : name.expression; } else if (ts.isIdentifier(name)) { - return ts.createLiteral(name.text); + return ts.createLiteral(ts.unescapeIdentifier(name.text)); } else { return ts.getSynthesizedClone(name); @@ -46730,7 +50299,7 @@ var ts; hoistVariableDeclaration(generatedName); expression = ts.createAssignment(generatedName, expression); } - return ts.setOriginalNode(ts.createComputedPropertyName(expression, /*location*/ name), name); + return ts.updateComputedPropertyName(name, expression); } else { return name; @@ -46748,7 +50317,7 @@ var ts; function visitHeritageClause(node) { if (node.token === 84 /* ExtendsKeyword */) { var types = ts.visitNodes(node.types, visitor, ts.isExpressionWithTypeArguments, 0, 1); - return ts.createHeritageClause(84 /* ExtendsKeyword */, types, node); + return ts.setTextRange(ts.createHeritageClause(84 /* ExtendsKeyword */, types), node); } return undefined; } @@ -46761,9 +50330,8 @@ var ts; * @param node The ExpressionWithTypeArguments to transform. */ function visitExpressionWithTypeArguments(node) { - var expression = ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression); - return ts.createExpressionWithTypeArguments( - /*typeArguments*/ undefined, expression, node); + return ts.updateExpressionWithTypeArguments(node, + /*typeArguments*/ undefined, ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression)); } /** * Determines whether to emit a function-like declaration. We should not emit the @@ -46778,7 +50346,7 @@ var ts; if (!shouldEmitFunctionLikeDeclaration(node)) { return undefined; } - return ts.visitEachChild(node, visitor, context); + return ts.updateConstructor(node, ts.visitNodes(node.decorators, visitor, ts.isDecorator), ts.visitNodes(node.modifiers, visitor, ts.isModifier), ts.visitParameterList(node.parameters, visitor, context), ts.visitFunctionBody(node.body, visitor, context)); } /** * Visits a method declaration of a class. @@ -46795,7 +50363,8 @@ var ts; return undefined; } var updated = ts.updateMethod(node, - /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), visitPropertyNameOfClassElement(node), + /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, visitPropertyNameOfClassElement(node), + /*questionToken*/ undefined, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), /*type*/ undefined, ts.visitFunctionBody(node.body, visitor, context)); if (updated !== node) { @@ -46877,7 +50446,7 @@ var ts; return ts.createNotEmittedStatement(node); } var updated = ts.updateFunctionDeclaration(node, - /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.name, + /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, node.name, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), /*type*/ undefined, ts.visitFunctionBody(node.body, visitor, context) || ts.createBlock([])); if (isNamespaceExport(node)) { @@ -46896,12 +50465,12 @@ var ts; * @param node The function expression node. */ function visitFunctionExpression(node) { - if (ts.nodeIsMissing(node.body)) { + if (!shouldEmitFunctionLikeDeclaration(node)) { return ts.createOmittedExpression(); } - var updated = ts.updateFunctionExpression(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.name, + var updated = ts.updateFunctionExpression(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, node.name, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, ts.visitFunctionBody(node.body, visitor, context)); + /*type*/ undefined, ts.visitFunctionBody(node.body, visitor, context) || ts.createBlock([])); return updated; } /** @@ -46933,11 +50502,11 @@ var ts; /*decorators*/ undefined, /*modifiers*/ undefined, node.dotDotDotToken, ts.visitNode(node.name, visitor, ts.isBindingName), /*questionToken*/ undefined, - /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression), - /*location*/ ts.moveRangePastModifiers(node)); + /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)); // While we emit the source map for the node after skipping decorators and modifiers, // we need to emit the comments for the original range. ts.setOriginalNode(parameter, node); + ts.setTextRange(parameter, ts.moveRangePastModifiers(node)); ts.setCommentRange(parameter, node); ts.setSourceMapRange(parameter, ts.moveRangePastModifiers(node)); ts.setEmitFlags(parameter.name, 32 /* NoTrailingSourceMap */); @@ -46956,8 +50525,7 @@ var ts; // elide statement if there are no initialized variables. return undefined; } - return ts.createStatement(ts.inlineExpressions(ts.map(variables, transformInitializedVariable)), - /*location*/ node); + return ts.setTextRange(ts.createStatement(ts.inlineExpressions(ts.map(variables, transformInitializedVariable))), node); } else { return ts.visitEachChild(node, visitor, context); @@ -46970,7 +50538,7 @@ var ts; /*needsValue*/ false, createNamespaceExportExpression); } else { - return ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(name), ts.visitNode(node.initializer, visitor, ts.isExpression), + return ts.setTextRange(ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(name), ts.visitNode(node.initializer, visitor, ts.isExpression)), /*location*/ node); } } @@ -46996,13 +50564,13 @@ var ts; // code if the casted expression has a lower precedence than the rest of the // expression. // + // To preserve comments, we return a "PartiallyEmittedExpression" here which will + // preserve the position information of the original expression. + // // Due to the auto-parenthesization rules used by the visitor and factory functions // we can safely elide the parentheses here, as a new synthetic // ParenthesizedExpression will be inserted if we remove parentheses too // aggressively. - // - // To preserve comments, we return a "PartiallyEmittedExpression" here which will - // preserve the position information of the original expression. return ts.createPartiallyEmittedExpression(expression, node); } return ts.visitEachChild(node, visitor, context); @@ -47084,9 +50652,9 @@ var ts; /*name*/ undefined, /*typeParameters*/ undefined, [ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, parameterName)], /*type*/ undefined, transformEnumBody(node, containerName)), - /*typeArguments*/ undefined, [moduleArg]), - /*location*/ node); + /*typeArguments*/ undefined, [moduleArg])); ts.setOriginalNode(enumStatement, node); + ts.setTextRange(enumStatement, node); ts.setEmitFlags(enumStatement, emitFlags); statements.push(enumStatement); // Add a DeclarationMarker for the enum to preserve trailing comments and mark @@ -47107,8 +50675,7 @@ var ts; ts.addRange(statements, ts.map(node.members, transformEnumMember)); ts.addRange(statements, endLexicalEnvironment()); currentNamespaceContainerName = savedCurrentNamespaceLocalName; - return ts.createBlock(ts.createNodeArray(statements, /*location*/ node.members), - /*location*/ undefined, + return ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), /*location*/ node.members), /*multiLine*/ true); } /** @@ -47121,9 +50688,7 @@ var ts; // we pass false as 'generateNameForComputedPropertyName' for a backward compatibility purposes // old emitter always generate 'expression' part of the name as-is. var name = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ false); - return ts.createStatement(ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, name), transformEnumMemberDeclarationValue(member))), name, - /*location*/ member), - /*location*/ member); + return ts.setTextRange(ts.createStatement(ts.setTextRange(ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, name), transformEnumMemberDeclarationValue(member))), name), member)), member); } /** * Transforms the value of an enum member. @@ -47176,8 +50741,8 @@ var ts; if (!currentScopeFirstDeclarationsOfName) { currentScopeFirstDeclarationsOfName = ts.createMap(); } - if (!(name in currentScopeFirstDeclarationsOfName)) { - currentScopeFirstDeclarationsOfName[name] = node; + if (!currentScopeFirstDeclarationsOfName.has(name)) { + currentScopeFirstDeclarationsOfName.set(name, node); } } } @@ -47187,9 +50752,9 @@ var ts; */ function isFirstEmittedDeclarationInScope(node) { if (currentScopeFirstDeclarationsOfName) { - var name_32 = node.symbol && node.symbol.name; - if (name_32) { - return currentScopeFirstDeclarationsOfName[name_32] === node; + var name = node.symbol && node.symbol.name; + if (name) { + return currentScopeFirstDeclarationsOfName.get(name) === node; } } return false; @@ -47206,7 +50771,7 @@ var ts; recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. - if (node.kind === 229 /* EnumDeclaration */) { + if (node.kind === 231 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -47298,9 +50863,9 @@ var ts; /*name*/ undefined, /*typeParameters*/ undefined, [ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, parameterName)], /*type*/ undefined, transformModuleBody(node, containerName)), - /*typeArguments*/ undefined, [moduleArg]), - /*location*/ node); + /*typeArguments*/ undefined, [moduleArg])); ts.setOriginalNode(moduleStatement, node); + ts.setTextRange(moduleStatement, node); ts.setEmitFlags(moduleStatement, emitFlags); statements.push(moduleStatement); // Add a DeclarationMarker for the namespace to preserve trailing comments and mark @@ -47325,8 +50890,8 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 231 /* ModuleBlock */) { - ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); + if (body.kind === 233 /* ModuleBlock */) { + saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; } @@ -47347,10 +50912,10 @@ var ts; currentNamespaceContainerName = savedCurrentNamespaceContainerName; currentNamespace = savedCurrentNamespace; currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName; - var block = ts.createBlock(ts.createNodeArray(statements, + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), /*location*/ statementsLocation), - /*location*/ blockLocation, /*multiLine*/ true); + ts.setTextRange(block, blockLocation); // namespace hello.hi.world { // function foo() {} // @@ -47371,13 +50936,13 @@ var ts; // })(hi = hello.hi || (hello.hi = {})); // })(hello || (hello = {})); // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces. - if (body.kind !== 231 /* ModuleBlock */) { + if (body.kind !== 233 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 230 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 232 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -47394,7 +50959,7 @@ var ts; return node; } // Elide the declaration if the import clause was elided. - var importClause = ts.visitNode(node.importClause, visitImportClause, ts.isImportClause, /*optional*/ true); + var importClause = ts.visitNode(node.importClause, visitImportClause, ts.isImportClause); return importClause ? ts.updateImportDeclaration(node, /*decorators*/ undefined, @@ -47409,7 +50974,7 @@ var ts; function visitImportClause(node) { // Elide the import clause if we elide both its name and its named bindings. var name = resolver.isReferencedAliasDeclaration(node) ? node.name : undefined; - var namedBindings = ts.visitNode(node.namedBindings, visitNamedImportBindings, ts.isNamedImportBindings, /*optional*/ true); + var namedBindings = ts.visitNode(node.namedBindings, visitNamedImportBindings, ts.isNamedImportBindings); return (name || namedBindings) ? ts.updateImportClause(node, name, namedBindings) : undefined; } /** @@ -47418,7 +50983,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 237 /* NamespaceImport */) { + if (node.kind === 239 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -47465,7 +51030,7 @@ var ts; return undefined; } // Elide the export declaration if all of its named exports are elided. - var exportClause = ts.visitNode(node.exportClause, visitNamedExports, ts.isNamedExports, /*optional*/ true); + var exportClause = ts.visitNode(node.exportClause, visitNamedExports, ts.isNamedExports); return exportClause ? ts.updateExportDeclaration(node, /*decorators*/ undefined, @@ -47525,10 +51090,10 @@ var ts; if (isNamedExternalModuleExport(node) || !isNamespaceExport(node)) { // export var ${name} = ${moduleReference}; // var ${name} = ${moduleReference}; - return ts.setOriginalNode(ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ + return ts.setOriginalNode(ts.setTextRange(ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.setOriginalNode(ts.createVariableDeclaration(node.name, /*type*/ undefined, moduleReference), node) - ]), node), node); + ])), node), node); } else { // exports.${name} = ${moduleReference}; @@ -47573,7 +51138,7 @@ var ts; * Creates a statement for the provided expression. This is used in calls to `map`. */ function expressionToStatement(expression) { - return ts.createStatement(expression, /*location*/ undefined); + return ts.createStatement(expression); } function addExportMemberAssignment(statements, node) { var expression = ts.createAssignment(ts.getExternalModuleOrNamespaceExportName(currentNamespaceContainerName, node, /*allowComments*/ false, /*allowSourceMaps*/ true), ts.getLocalName(node)); @@ -47583,10 +51148,10 @@ var ts; statements.push(statement); } function createNamespaceExport(exportName, exportValue, location) { - return ts.createStatement(ts.createAssignment(ts.getNamespaceMemberName(currentNamespaceContainerName, exportName, /*allowComments*/ false, /*allowSourceMaps*/ true), exportValue), location); + return ts.setTextRange(ts.createStatement(ts.createAssignment(ts.getNamespaceMemberName(currentNamespaceContainerName, exportName, /*allowComments*/ false, /*allowSourceMaps*/ true), exportValue)), location); } function createNamespaceExportExpression(exportName, exportValue, location) { - return ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(exportName), exportValue, location); + return ts.setTextRange(ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(exportName), exportValue), location); } function getNamespaceMemberNameWithSourceMapsAndWithoutComments(name) { return ts.getNamespaceMemberName(currentNamespaceContainerName, name, /*allowComments*/ false, /*allowSourceMaps*/ true); @@ -47614,7 +51179,7 @@ var ts; function getClassAliasIfNeeded(node) { if (resolver.getNodeCheckFlags(node) & 8388608 /* ClassWithConstructorReference */) { enableSubstitutionForClassAliases(); - var classAlias = ts.createUniqueName(node.name && !ts.isGeneratedIdentifier(node.name) ? node.name.text : "default"); + var classAlias = ts.createUniqueName(node.name && !ts.isGeneratedIdentifier(node.name) ? ts.unescapeIdentifier(node.name.text) : "default"); classAliases[ts.getOriginalNodeId(node)] = classAlias; hoistVariableDeclaration(classAlias); return classAlias; @@ -47641,7 +51206,7 @@ var ts; // substitute class names inside of a class declaration. context.enableSubstitution(70 /* Identifier */); // Keep track of class aliases. - classAliases = ts.createMap(); + classAliases = []; } } function enableSubstitutionForNamespaceExports() { @@ -47650,44 +51215,49 @@ var ts; // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to // substitute the names of exported members of a namespace. context.enableSubstitution(70 /* Identifier */); - context.enableSubstitution(258 /* ShorthandPropertyAssignment */); + context.enableSubstitution(261 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(230 /* ModuleDeclaration */); + context.enableEmitNotification(232 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 230 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 232 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 229 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 231 /* EnumDeclaration */; } /** * Hook for node emit. * - * @param emitContext A context hint for the emitter. + * @param hint A hint as to the intended usage of the node. * @param node The node to emit. * @param emit A callback used to emit the node in the printer. */ - function onEmitNode(emitContext, node, emitCallback) { + function onEmitNode(hint, node, emitCallback) { var savedApplicableSubstitutions = applicableSubstitutions; + var savedCurrentSourceFile = currentSourceFile; + if (ts.isSourceFile(node)) { + currentSourceFile = node; + } if (enabledSubstitutions & 2 /* NamespaceExports */ && isTransformedModuleDeclaration(node)) { applicableSubstitutions |= 2 /* NamespaceExports */; } if (enabledSubstitutions & 8 /* NonQualifiedEnumMembers */ && isTransformedEnumDeclaration(node)) { applicableSubstitutions |= 8 /* NonQualifiedEnumMembers */; } - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); applicableSubstitutions = savedApplicableSubstitutions; + currentSourceFile = savedCurrentSourceFile; } /** * Hooks node substitutions. * - * @param emitContext A context hint for the emitter. + * @param hint A hint as to the intended usage of the node. * @param node The node to substitute. */ - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1 /* Expression */) { + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 /* Expression */) { return substituteExpression(node); } else if (ts.isShorthandPropertyAssignment(node)) { @@ -47697,16 +51267,16 @@ var ts; } function substituteShorthandPropertyAssignment(node) { if (enabledSubstitutions & 2 /* NamespaceExports */) { - var name_33 = node.name; - var exportedName = trySubstituteNamespaceExportedName(name_33); + var name = node.name; + var exportedName = trySubstituteNamespaceExportedName(name); if (exportedName) { // A shorthand property with an assignment initializer is probably part of a // destructuring assignment if (node.objectAssignmentInitializer) { var initializer = ts.createAssignment(exportedName, node.objectAssignmentInitializer); - return ts.createPropertyAssignment(name_33, initializer, /*location*/ node); + return ts.setTextRange(ts.createPropertyAssignment(name, initializer), node); } - return ts.createPropertyAssignment(name_33, exportedName, /*location*/ node); + return ts.setTextRange(ts.createPropertyAssignment(name, exportedName), node); } } return node; @@ -47715,9 +51285,9 @@ var ts; switch (node.kind) { case 70 /* Identifier */: return substituteExpressionIdentifier(node); - case 177 /* PropertyAccessExpression */: + case 178 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 178 /* ElementAccessExpression */: + case 179 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -47755,11 +51325,12 @@ var ts; // If we are nested within a namespace declaration, we may need to qualifiy // an identifier that is exported from a merged namespace. var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false); - if (container && container.kind !== 261 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 230 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 229 /* EnumDeclaration */); + if (container && container.kind !== 264 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 232 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 231 /* EnumDeclaration */); if (substitute) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node, /*location*/ node); + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), + /*location*/ node); } } } @@ -47774,16 +51345,15 @@ var ts; function substituteConstantValue(node) { var constantValue = tryGetConstEnumValue(node); if (constantValue !== undefined) { + // track the constant value on the node for the printer in needsDotDotForPropertyAccess + ts.setConstantValue(node, constantValue); var substitute = ts.createLiteral(constantValue); - ts.setSourceMapRange(substitute, node); - ts.setCommentRange(substitute, node); if (!compilerOptions.removeComments) { var propertyName = ts.isPropertyAccessExpression(node) ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); - substitute.trailingComment = " " + propertyName + " "; + ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " " + propertyName + " "); } - ts.setConstantValue(node, constantValue); return substitute; } return node; @@ -47798,25 +51368,25 @@ var ts; } } ts.transformTypeScript = transformTypeScript; - var paramHelper = { - name: "typescript:param", - scoped: false, - priority: 4, - text: "\n var __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n };" - }; - function createParamHelper(context, expression, parameterOffset, location) { - context.requestEmitHelper(paramHelper); - return ts.createCall(ts.getHelperName("__param"), - /*typeArguments*/ undefined, [ - ts.createLiteral(parameterOffset), - expression - ], location); + function createDecorateHelper(context, decoratorExpressions, target, memberName, descriptor, location) { + var argumentsArray = []; + argumentsArray.push(ts.createArrayLiteral(decoratorExpressions, /*multiLine*/ true)); + argumentsArray.push(target); + if (memberName) { + argumentsArray.push(memberName); + if (descriptor) { + argumentsArray.push(descriptor); + } + } + context.requestEmitHelper(decorateHelper); + return ts.setTextRange(ts.createCall(ts.getHelperName("__decorate"), + /*typeArguments*/ undefined, argumentsArray), location); } - var metadataHelper = { - name: "typescript:metadata", + var decorateHelper = { + name: "typescript:decorate", scoped: false, - priority: 3, - text: "\n var __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n };" + priority: 2, + text: "\n var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };" }; function createMetadataHelper(context, metadataKey, metadataValue) { context.requestEmitHelper(metadataHelper); @@ -47826,33 +51396,397 @@ var ts; metadataValue ]); } - var decorateHelper = { - name: "typescript:decorate", + var metadataHelper = { + name: "typescript:metadata", scoped: false, - priority: 2, - text: "\n var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };" + priority: 3, + text: "\n var __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n };" }; - function createDecorateHelper(context, decoratorExpressions, target, memberName, descriptor, location) { - context.requestEmitHelper(decorateHelper); - var argumentsArray = []; - argumentsArray.push(ts.createArrayLiteral(decoratorExpressions, /*location*/ undefined, /*multiLine*/ true)); - argumentsArray.push(target); - if (memberName) { - argumentsArray.push(memberName); - if (descriptor) { - argumentsArray.push(descriptor); - } - } - return ts.createCall(ts.getHelperName("__decorate"), /*typeArguments*/ undefined, argumentsArray, location); + function createParamHelper(context, expression, parameterOffset, location) { + context.requestEmitHelper(paramHelper); + return ts.setTextRange(ts.createCall(ts.getHelperName("__param"), + /*typeArguments*/ undefined, [ + ts.createLiteral(parameterOffset), + expression + ]), location); } + var paramHelper = { + name: "typescript:param", + scoped: false, + priority: 4, + text: "\n var __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n };" + }; })(ts || (ts = {})); /// /// /*@internal*/ var ts; (function (ts) { + var ES2017SubstitutionFlags; + (function (ES2017SubstitutionFlags) { + /** Enables substitutions for async methods with `super` calls. */ + ES2017SubstitutionFlags[ES2017SubstitutionFlags["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper"; + })(ES2017SubstitutionFlags || (ES2017SubstitutionFlags = {})); + function transformES2017(context) { + var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; + var resolver = context.getEmitResolver(); + var compilerOptions = context.getCompilerOptions(); + var languageVersion = ts.getEmitScriptTarget(compilerOptions); + // These variables contain state that changes as we descend into the tree. + var currentSourceFile; + /** + * Keeps track of whether expression substitution has been enabled for specific edge cases. + * They are persisted between each SourceFile transformation and should not be reset. + */ + var enabledSubstitutions; + /** + * This keeps track of containers where `super` is valid, for use with + * just-in-time substitution for `super` expressions inside of async methods. + */ + var enclosingSuperContainerFlags = 0; + // Save the previous transformation hooks. + var previousOnEmitNode = context.onEmitNode; + var previousOnSubstituteNode = context.onSubstituteNode; + // Set new transformation hooks. + context.onEmitNode = onEmitNode; + context.onSubstituteNode = onSubstituteNode; + return transformSourceFile; + function transformSourceFile(node) { + if (ts.isDeclarationFile(node)) { + return node; + } + currentSourceFile = node; + var visited = ts.visitEachChild(node, visitor, context); + ts.addEmitHelpers(visited, context.readEmitHelpers()); + currentSourceFile = undefined; + return visited; + } + function visitor(node) { + if ((node.transformFlags & 16 /* ContainsES2017 */) === 0) { + return node; + } + switch (node.kind) { + case 119 /* AsyncKeyword */: + // ES2017 async modifier should be elided for targets < ES2017 + return undefined; + case 190 /* AwaitExpression */: + return visitAwaitExpression(node); + case 150 /* MethodDeclaration */: + return visitMethodDeclaration(node); + case 227 /* FunctionDeclaration */: + return visitFunctionDeclaration(node); + case 185 /* FunctionExpression */: + return visitFunctionExpression(node); + case 186 /* ArrowFunction */: + return visitArrowFunction(node); + default: + return ts.visitEachChild(node, visitor, context); + } + } + /** + * Visits an AwaitExpression node. + * + * This function will be called any time a ES2017 await expression is encountered. + * + * @param node The node to visit. + */ + function visitAwaitExpression(node) { + return ts.setOriginalNode(ts.setTextRange(ts.createYield( + /*asteriskToken*/ undefined, ts.visitNode(node.expression, visitor, ts.isExpression)), node), node); + } + /** + * Visits a MethodDeclaration node. + * + * This function will be called when one of the following conditions are met: + * - The node is marked as async + * + * @param node The node to visit. + */ + function visitMethodDeclaration(node) { + return ts.updateMethod(node, + /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, + /*questionToken*/ undefined, + /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), + /*type*/ undefined, ts.getFunctionFlags(node) & 2 /* Async */ + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + /** + * Visits a FunctionDeclaration node. + * + * This function will be called when one of the following conditions are met: + * - The node is marked async + * + * @param node The node to visit. + */ + function visitFunctionDeclaration(node) { + return ts.updateFunctionDeclaration(node, + /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, + /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), + /*type*/ undefined, ts.getFunctionFlags(node) & 2 /* Async */ + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + /** + * Visits a FunctionExpression node. + * + * This function will be called when one of the following conditions are met: + * - The node is marked async + * + * @param node The node to visit. + */ + function visitFunctionExpression(node) { + return ts.updateFunctionExpression(node, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, + /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), + /*type*/ undefined, ts.getFunctionFlags(node) & 2 /* Async */ + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + /** + * Visits an ArrowFunction. + * + * This function will be called when one of the following conditions are met: + * - The node is marked async + * + * @param node The node to visit. + */ + function visitArrowFunction(node) { + return ts.updateArrowFunction(node, ts.visitNodes(node.modifiers, visitor, ts.isModifier), + /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), + /*type*/ undefined, ts.getFunctionFlags(node) & 2 /* Async */ + ? transformAsyncFunctionBody(node) + : ts.visitFunctionBody(node.body, visitor, context)); + } + function transformAsyncFunctionBody(node) { + resumeLexicalEnvironment(); + var original = ts.getOriginalNode(node, ts.isFunctionLike); + var nodeType = original.type; + var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; + var isArrowFunction = node.kind === 186 /* ArrowFunction */; + var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; + // An async function is emit as an outer function that calls an inner + // generator function. To preserve lexical bindings, we pass the current + // `this` and `arguments` objects to `__awaiter`. The generator function + // passed to `__awaiter` is executed inside of the callback to the + // promise constructor. + if (!isArrowFunction) { + var statements = []; + var statementOffset = ts.addPrologue(statements, node.body.statements, /*ensureUseStrict*/ false, visitor); + statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body, statementOffset)))); + ts.addRange(statements, endLexicalEnvironment()); + var block = ts.createBlock(statements, /*multiLine*/ true); + ts.setTextRange(block, node.body); + // Minor optimization, emit `_super` helper to capture `super` access in an arrow. + // This step isn't needed if we eventually transform this to ES5. + if (languageVersion >= 2 /* ES2015 */) { + if (resolver.getNodeCheckFlags(node) & 4096 /* AsyncMethodWithSuperBinding */) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.advancedAsyncSuperHelper); + } + else if (resolver.getNodeCheckFlags(node) & 2048 /* AsyncMethodWithSuper */) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.asyncSuperHelper); + } + } + return block; + } + else { + var expression = createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body)); + var declarations = endLexicalEnvironment(); + if (ts.some(declarations)) { + var block = ts.convertToFunctionBody(expression); + return ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(ts.concatenate(block.statements, declarations)), block.statements)); + } + return expression; + } + } + function transformFunctionBodyWorker(body, start) { + if (ts.isBlock(body)) { + return ts.updateBlock(body, ts.visitLexicalEnvironment(body.statements, visitor, context, start)); + } + else { + startLexicalEnvironment(); + var visited = ts.convertToFunctionBody(ts.visitNode(body, visitor, ts.isConciseBody)); + var declarations = endLexicalEnvironment(); + return ts.updateBlock(visited, ts.setTextRange(ts.createNodeArray(ts.concatenate(visited.statements, declarations)), visited.statements)); + } + } + function getPromiseConstructor(type) { + var typeName = type && ts.getEntityNameFromTypeNode(type); + if (typeName && ts.isEntityName(typeName)) { + var serializationKind = resolver.getTypeReferenceSerializationKind(typeName); + if (serializationKind === ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue + || serializationKind === ts.TypeReferenceSerializationKind.Unknown) { + return typeName; + } + } + return undefined; + } + function enableSubstitutionForAsyncMethodsWithSuper() { + if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) { + enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; + // We need to enable substitutions for call, property access, and element access + // if we need to rewrite super calls. + context.enableSubstitution(180 /* CallExpression */); + context.enableSubstitution(178 /* PropertyAccessExpression */); + context.enableSubstitution(179 /* ElementAccessExpression */); + // We need to be notified when entering and exiting declarations that bind super. + context.enableEmitNotification(228 /* ClassDeclaration */); + context.enableEmitNotification(150 /* MethodDeclaration */); + context.enableEmitNotification(152 /* GetAccessor */); + context.enableEmitNotification(153 /* SetAccessor */); + context.enableEmitNotification(151 /* Constructor */); + } + } + /** + * Hook for node emit. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to emit. + * @param emit A callback used to emit the node in the printer. + */ + function onEmitNode(hint, node, emitCallback) { + // If we need to support substitutions for `super` in an async method, + // we should track it here. + if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) { + var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 /* AsyncMethodWithSuper */ | 4096 /* AsyncMethodWithSuperBinding */); + if (superContainerFlags !== enclosingSuperContainerFlags) { + var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; + enclosingSuperContainerFlags = superContainerFlags; + previousOnEmitNode(hint, node, emitCallback); + enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; + return; + } + } + previousOnEmitNode(hint, node, emitCallback); + } + /** + * Hooks node substitutions. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to substitute. + */ + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 /* Expression */ && enclosingSuperContainerFlags) { + return substituteExpression(node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 178 /* PropertyAccessExpression */: + return substitutePropertyAccessExpression(node); + case 179 /* ElementAccessExpression */: + return substituteElementAccessExpression(node); + case 180 /* CallExpression */: + return substituteCallExpression(node); + } + return node; + } + function substitutePropertyAccessExpression(node) { + if (node.expression.kind === 96 /* SuperKeyword */) { + return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), node); + } + return node; + } + function substituteElementAccessExpression(node) { + if (node.expression.kind === 96 /* SuperKeyword */) { + return createSuperAccessInAsyncMethod(node.argumentExpression, node); + } + return node; + } + function substituteCallExpression(node) { + var expression = node.expression; + if (ts.isSuperProperty(expression)) { + var argumentExpression = ts.isPropertyAccessExpression(expression) + ? substitutePropertyAccessExpression(expression) + : substituteElementAccessExpression(expression); + return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), + /*typeArguments*/ undefined, [ + ts.createThis() + ].concat(node.arguments)); + } + return node; + } + function isSuperContainer(node) { + var kind = node.kind; + return kind === 228 /* ClassDeclaration */ + || kind === 151 /* Constructor */ + || kind === 150 /* MethodDeclaration */ + || kind === 152 /* GetAccessor */ + || kind === 153 /* SetAccessor */; + } + function createSuperAccessInAsyncMethod(argumentExpression, location) { + if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { + return ts.setTextRange(ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), + /*typeArguments*/ undefined, [argumentExpression]), "value"), location); + } + else { + return ts.setTextRange(ts.createCall(ts.createIdentifier("_super"), + /*typeArguments*/ undefined, [argumentExpression]), location); + } + } + } + ts.transformES2017 = transformES2017; + var awaiterHelper = { + name: "typescript:awaiter", + scoped: false, + priority: 5, + text: "\n var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n };" + }; + function createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, body) { + context.requestEmitHelper(awaiterHelper); + var generatorFunc = ts.createFunctionExpression( + /*modifiers*/ undefined, ts.createToken(38 /* AsteriskToken */), + /*name*/ undefined, + /*typeParameters*/ undefined, + /*parameters*/ [], + /*type*/ undefined, body); + // Mark this node as originally an async function + (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 131072 /* AsyncFunctionBody */; + return ts.createCall(ts.getHelperName("__awaiter"), + /*typeArguments*/ undefined, [ + ts.createThis(), + hasLexicalArguments ? ts.createIdentifier("arguments") : ts.createVoidZero(), + promiseConstructor ? ts.createExpressionFromEntityName(promiseConstructor) : ts.createVoidZero(), + generatorFunc + ]); + } + ts.asyncSuperHelper = { + name: "typescript:async-super", + scoped: true, + text: "\n const _super = name => super[name];\n " + }; + ts.advancedAsyncSuperHelper = { + name: "typescript:advanced-async-super", + scoped: true, + text: "\n const _super = (function (geti, seti) {\n const cache = Object.create(null);\n return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n })(name => super[name], (name, value) => super[name] = value);\n " + }; +})(ts || (ts = {})); +/// +/// +/// +/*@internal*/ +var ts; +(function (ts) { + var ESNextSubstitutionFlags; + (function (ESNextSubstitutionFlags) { + /** Enables substitutions for async methods with `super` calls. */ + ESNextSubstitutionFlags[ESNextSubstitutionFlags["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper"; + })(ESNextSubstitutionFlags || (ESNextSubstitutionFlags = {})); function transformESNext(context) { - var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; + var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration; + var resolver = context.getEmitResolver(); + var compilerOptions = context.getCompilerOptions(); + var languageVersion = ts.getEmitScriptTarget(compilerOptions); + var previousOnEmitNode = context.onEmitNode; + context.onEmitNode = onEmitNode; + var previousOnSubstituteNode = context.onSubstituteNode; + context.onSubstituteNode = onSubstituteNode; + var enabledSubstitutions; + var enclosingFunctionFlags; + var enclosingSuperContainerFlags = 0; return transformSourceFile; function transformSourceFile(node) { if (ts.isDeclarationFile(node)) { @@ -47868,53 +51802,95 @@ var ts; function visitorNoDestructuringValue(node) { return visitorWorker(node, /*noDestructuringValue*/ true); } + function visitorNoAsyncModifier(node) { + if (node.kind === 119 /* AsyncKeyword */) { + return undefined; + } + return node; + } function visitorWorker(node, noDestructuringValue) { if ((node.transformFlags & 8 /* ContainsESNext */) === 0) { return node; } switch (node.kind) { - case 176 /* ObjectLiteralExpression */: + case 190 /* AwaitExpression */: + return visitAwaitExpression(node); + case 196 /* YieldExpression */: + return visitYieldExpression(node); + case 221 /* LabeledStatement */: + return visitLabeledStatement(node); + case 177 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return visitBinaryExpression(node, noDestructuringValue); - case 223 /* VariableDeclaration */: + case 225 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 213 /* ForOfStatement */: - return visitForOfStatement(node); - case 211 /* ForStatement */: + case 215 /* ForOfStatement */: + return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); + case 213 /* ForStatement */: return visitForStatement(node); - case 188 /* VoidExpression */: + case 189 /* VoidExpression */: return visitVoidExpression(node); - case 150 /* Constructor */: + case 151 /* Constructor */: return visitConstructorDeclaration(node); - case 149 /* MethodDeclaration */: + case 150 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 151 /* GetAccessor */: + case 152 /* GetAccessor */: return visitGetAccessorDeclaration(node); - case 152 /* SetAccessor */: + case 153 /* SetAccessor */: return visitSetAccessorDeclaration(node); - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 184 /* FunctionExpression */: + case 185 /* FunctionExpression */: return visitFunctionExpression(node); - case 185 /* ArrowFunction */: + case 186 /* ArrowFunction */: return visitArrowFunction(node); - case 144 /* Parameter */: + case 145 /* Parameter */: return visitParameter(node); - case 207 /* ExpressionStatement */: + case 209 /* ExpressionStatement */: return visitExpressionStatement(node); - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, noDestructuringValue); default: return ts.visitEachChild(node, visitor, context); } } + function visitAwaitExpression(node) { + if (enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + return ts.setOriginalNode(ts.setTextRange(ts.createYield( + /*asteriskToken*/ undefined, ts.createArrayLiteral([ts.createLiteral("await"), expression])), + /*location*/ node), node); + } + return ts.visitEachChild(node, visitor, context); + } + function visitYieldExpression(node) { + if (enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + return ts.updateYield(node, node.asteriskToken, node.asteriskToken + ? createAsyncDelegatorHelper(context, expression, expression) + : ts.createArrayLiteral(expression + ? [ts.createLiteral("yield"), expression] + : [ts.createLiteral("yield")])); + } + return ts.visitEachChild(node, visitor, context); + } + function visitLabeledStatement(node) { + if (enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */) { + var statement = ts.unwrapInnermostStatementOfLabel(node); + if (statement.kind === 215 /* ForOfStatement */ && statement.awaitModifier) { + return visitForOfStatement(statement, node); + } + return ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), node); + } + return ts.visitEachChild(node, visitor, context); + } function chunkObjectLiteralElements(elements) { var chunkObject; var objects = []; - for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) { - var e = elements_3[_i]; - if (e.kind === 259 /* SpreadAssignment */) { + for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { + var e = elements_4[_i]; + if (e.kind === 262 /* SpreadAssignment */) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -47926,7 +51902,7 @@ var ts; if (!chunkObject) { chunkObject = []; } - if (e.kind === 257 /* PropertyAssignment */) { + if (e.kind === 260 /* PropertyAssignment */) { var p = e; chunkObject.push(ts.createPropertyAssignment(p.name, ts.visitNode(p.initializer, visitor, ts.isExpression))); } @@ -47948,7 +51924,7 @@ var ts; // If the first element is a spread element, then the first argument to __assign is {}: // { ...o, a, b, ...o2 } => __assign({}, o, {a, b}, o2) var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 176 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 177 /* ObjectLiteralExpression */) { objects.unshift(ts.createObjectLiteral()); } return createAssignHelper(context, objects); @@ -47998,41 +51974,101 @@ var ts; * * @param node A ForOfStatement. */ - function visitForOfStatement(node) { - var leadingStatements; - var temp; - var initializer = ts.skipParentheses(node.initializer); - if (initializer.transformFlags & 1048576 /* ContainsObjectRest */) { - if (ts.isVariableDeclarationList(initializer)) { - temp = ts.createTempVariable(/*recordTempVariable*/ undefined); - var firstDeclaration = ts.firstOrUndefined(initializer.declarations); - var declarations = ts.flattenDestructuringBinding(firstDeclaration, visitor, context, 1 /* ObjectRest */, temp, - /*doNotRecordTempVariablesInLine*/ false, - /*skipInitializer*/ true); - if (ts.some(declarations)) { - var statement = ts.createVariableStatement( - /*modifiers*/ undefined, ts.updateVariableDeclarationList(initializer, declarations), - /*location*/ initializer); - leadingStatements = ts.append(leadingStatements, statement); - } - } - else if (ts.isAssignmentPattern(initializer)) { - temp = ts.createTempVariable(/*recordTempVariable*/ undefined); - var expression = ts.flattenDestructuringAssignment(ts.aggregateTransformFlags(ts.createAssignment(initializer, temp, /*location*/ node.initializer)), visitor, context, 1 /* ObjectRest */); - leadingStatements = ts.append(leadingStatements, ts.createStatement(expression, /*location*/ node.initializer)); - } + function visitForOfStatement(node, outermostLabeledStatement) { + if (node.initializer.transformFlags & 1048576 /* ContainsObjectRest */) { + node = transformForOfStatementWithObjectRest(node); } - if (temp) { - var expression = ts.visitNode(node.expression, visitor, ts.isExpression); - var statement = ts.visitNode(node.statement, visitor, ts.isStatement); - var block = ts.isBlock(statement) - ? ts.updateBlock(statement, ts.createNodeArray(ts.concatenate(leadingStatements, statement.statements), statement.statements)) - : ts.createBlock(ts.append(leadingStatements, statement), statement, /*multiLine*/ true); - return ts.updateForOf(node, ts.createVariableDeclarationList([ - ts.createVariableDeclaration(temp, /*type*/ undefined, /*initializer*/ undefined, node.initializer) - ], node.initializer, 1 /* Let */), expression, block); + if (node.awaitModifier) { + return transformForAwaitOfStatement(node, outermostLabeledStatement); } - return ts.visitEachChild(node, visitor, context); + else { + return ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), outermostLabeledStatement); + } + } + function transformForOfStatementWithObjectRest(node) { + var initializerWithoutParens = ts.skipParentheses(node.initializer); + if (ts.isVariableDeclarationList(initializerWithoutParens) || ts.isAssignmentPattern(initializerWithoutParens)) { + var bodyLocation = void 0; + var statementsLocation = void 0; + var temp = ts.createTempVariable(/*recordTempVariable*/ undefined); + var statements = [ts.createForOfBindingStatement(initializerWithoutParens, temp)]; + if (ts.isBlock(node.statement)) { + ts.addRange(statements, node.statement.statements); + bodyLocation = node.statement; + statementsLocation = node.statement.statements; + } + return ts.updateForOf(node, node.awaitModifier, ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(temp), node.initializer) + ], 1 /* Let */), node.initializer), node.expression, ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), + /*multiLine*/ true), bodyLocation)); + } + return node; + } + function convertForOfStatementHead(node, boundValue) { + var binding = ts.createForOfBindingStatement(node.initializer, boundValue); + var bodyLocation; + var statementsLocation; + var statements = [ts.visitNode(binding, visitor, ts.isStatement)]; + var statement = ts.visitNode(node.statement, visitor, ts.isStatement); + if (ts.isBlock(statement)) { + ts.addRange(statements, statement.statements); + bodyLocation = statement; + statementsLocation = statement.statements; + } + else { + statements.push(statement); + } + return ts.setEmitFlags(ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), + /*multiLine*/ true), bodyLocation), 48 /* NoSourceMap */ | 384 /* NoTokenSourceMaps */); + } + function transformForAwaitOfStatement(node, outermostLabeledStatement) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + var iterator = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(expression) : ts.createTempVariable(/*recordTempVariable*/ undefined); + var result = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(iterator) : ts.createTempVariable(/*recordTempVariable*/ undefined); + var errorRecord = ts.createUniqueName("e"); + var catchVariable = ts.getGeneratedNameForNode(errorRecord); + var returnMethod = ts.createTempVariable(/*recordTempVariable*/ undefined); + var values = createAsyncValuesHelper(context, expression, /*location*/ node.expression); + var next = ts.createYield( + /*asteriskToken*/ undefined, enclosingFunctionFlags & 1 /* Generator */ + ? ts.createArrayLiteral([ + ts.createLiteral("await"), + ts.createCall(ts.createPropertyAccess(iterator, "next"), /*typeArguments*/ undefined, []) + ]) + : ts.createCall(ts.createPropertyAccess(iterator, "next"), /*typeArguments*/ undefined, [])); + hoistVariableDeclaration(errorRecord); + hoistVariableDeclaration(returnMethod); + var forStatement = ts.setEmitFlags(ts.setTextRange(ts.createFor( + /*initializer*/ ts.setEmitFlags(ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(iterator, /*type*/ undefined, values), node.expression), + ts.createVariableDeclaration(result, /*type*/ undefined, next) + ]), node.expression), 1048576 /* NoHoisting */), + /*condition*/ ts.createLogicalNot(ts.createPropertyAccess(result, "done")), + /*incrementor*/ ts.createAssignment(result, next), + /*statement*/ convertForOfStatementHead(node, ts.createPropertyAccess(result, "value"))), + /*location*/ node), 256 /* NoTokenTrailingSourceMaps */); + return ts.createTry(ts.createBlock([ + ts.restoreEnclosingLabel(forStatement, outermostLabeledStatement) + ]), ts.createCatchClause(ts.createVariableDeclaration(catchVariable), ts.setEmitFlags(ts.createBlock([ + ts.createStatement(ts.createAssignment(errorRecord, ts.createObjectLiteral([ + ts.createPropertyAssignment("error", catchVariable) + ]))) + ]), 1 /* SingleLine */)), ts.createBlock([ + ts.createTry( + /*tryBlock*/ ts.createBlock([ + ts.setEmitFlags(ts.createIf(ts.createLogicalAnd(ts.createLogicalAnd(result, ts.createLogicalNot(ts.createPropertyAccess(result, "done"))), ts.createAssignment(returnMethod, ts.createPropertyAccess(iterator, "return"))), ts.createStatement(ts.createYield( + /*asteriskToken*/ undefined, enclosingFunctionFlags & 1 /* Generator */ + ? ts.createArrayLiteral([ + ts.createLiteral("await"), + ts.createFunctionCall(returnMethod, iterator, []) + ]) + : ts.createFunctionCall(returnMethod, iterator, [])))), 1 /* SingleLine */) + ]), + /*catchClause*/ undefined, + /*finallyBlock*/ ts.setEmitFlags(ts.createBlock([ + ts.setEmitFlags(ts.createIf(errorRecord, ts.createThrow(ts.createPropertyAccess(errorRecord, "error"))), 1 /* SingleLine */) + ]), 1 /* SingleLine */)) + ])); } function visitParameter(node) { if (node.transformFlags & 1048576 /* ContainsObjectRest */) { @@ -48041,48 +52077,137 @@ var ts; return ts.updateParameter(node, /*decorators*/ undefined, /*modifiers*/ undefined, node.dotDotDotToken, ts.getGeneratedNameForNode(node), + /*questionToken*/ undefined, /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)); } return ts.visitEachChild(node, visitor, context); } function visitConstructorDeclaration(node) { - return ts.updateConstructor(node, + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = 0 /* Normal */; + var updated = ts.updateConstructor(node, /*decorators*/ undefined, node.modifiers, ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitGetAccessorDeclaration(node) { - return ts.updateGetAccessor(node, + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = 0 /* Normal */; + var updated = ts.updateGetAccessor(node, /*decorators*/ undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), /*type*/ undefined, transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitSetAccessorDeclaration(node) { - return ts.updateSetAccessor(node, + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = 0 /* Normal */; + var updated = ts.updateSetAccessor(node, /*decorators*/ undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitMethodDeclaration(node) { - return ts.updateMethod(node, - /*decorators*/ undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateMethod(node, + /*decorators*/ undefined, enclosingFunctionFlags & 1 /* Generator */ + ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier) + : node.modifiers, enclosingFunctionFlags & 2 /* Async */ + ? undefined + : node.asteriskToken, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNode(/*questionToken*/ undefined, visitor, ts.isToken), /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, transformFunctionBody(node)); + /*type*/ undefined, enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ + ? transformAsyncGeneratorFunctionBody(node) + : transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitFunctionDeclaration(node) { - return ts.updateFunctionDeclaration(node, - /*decorators*/ undefined, node.modifiers, node.name, + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateFunctionDeclaration(node, + /*decorators*/ undefined, enclosingFunctionFlags & 1 /* Generator */ + ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier) + : node.modifiers, enclosingFunctionFlags & 2 /* Async */ + ? undefined + : node.asteriskToken, node.name, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, transformFunctionBody(node)); + /*type*/ undefined, enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ + ? transformAsyncGeneratorFunctionBody(node) + : transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitArrowFunction(node) { - return ts.updateArrowFunction(node, node.modifiers, + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateArrowFunction(node, node.modifiers, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), /*type*/ undefined, transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; } function visitFunctionExpression(node) { - return ts.updateFunctionExpression(node, node.modifiers, node.name, + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + enclosingFunctionFlags = ts.getFunctionFlags(node); + var updated = ts.updateFunctionExpression(node, enclosingFunctionFlags & 1 /* Generator */ + ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier) + : node.modifiers, enclosingFunctionFlags & 2 /* Async */ + ? undefined + : node.asteriskToken, node.name, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, transformFunctionBody(node)); + /*type*/ undefined, enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ + ? transformAsyncGeneratorFunctionBody(node) + : transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + return updated; + } + function transformAsyncGeneratorFunctionBody(node) { + resumeLexicalEnvironment(); + var statements = []; + var statementOffset = ts.addPrologue(statements, node.body.statements, /*ensureUseStrict*/ false, visitor); + appendObjectRestAssignmentsIfNeeded(statements, node); + statements.push(ts.createReturn(createAsyncGeneratorHelper(context, ts.createFunctionExpression( + /*modifiers*/ undefined, ts.createToken(38 /* AsteriskToken */), node.name && ts.getGeneratedNameForNode(node.name), + /*typeParameters*/ undefined, + /*parameters*/ [], + /*type*/ undefined, ts.updateBlock(node.body, ts.visitLexicalEnvironment(node.body.statements, visitor, context, statementOffset)))))); + ts.addRange(statements, endLexicalEnvironment()); + var block = ts.updateBlock(node.body, statements); + // Minor optimization, emit `_super` helper to capture `super` access in an arrow. + // This step isn't needed if we eventually transform this to ES5. + if (languageVersion >= 2 /* ES2015 */) { + if (resolver.getNodeCheckFlags(node) & 4096 /* AsyncMethodWithSuperBinding */) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.advancedAsyncSuperHelper); + } + else if (resolver.getNodeCheckFlags(node) & 2048 /* AsyncMethodWithSuper */) { + enableSubstitutionForAsyncMethodsWithSuper(); + ts.addEmitHelper(block, ts.asyncSuperHelper); + } + } + return block; } function transformFunctionBody(node) { resumeLexicalEnvironment(); - var leadingStatements; + var statementOffset = 0; + var statements = []; + var body = ts.visitNode(node.body, visitor, ts.isConciseBody); + if (ts.isBlock(body)) { + statementOffset = ts.addPrologue(statements, body.statements, /*ensureUseStrict*/ false, visitor); + } + ts.addRange(statements, appendObjectRestAssignmentsIfNeeded(/*statements*/ undefined, node)); + var trailingStatements = endLexicalEnvironment(); + if (statementOffset > 0 || ts.some(statements) || ts.some(trailingStatements)) { + var block = ts.convertToFunctionBody(body, /*multiLine*/ true); + ts.addRange(statements, block.statements.slice(statementOffset)); + ts.addRange(statements, trailingStatements); + return ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(statements), block.statements)); + } + return body; + } + function appendObjectRestAssignmentsIfNeeded(statements, node) { for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { var parameter = _a[_i]; if (parameter.transformFlags & 1048576 /* ContainsObjectRest */) { @@ -48094,17 +52219,116 @@ var ts; var statement = ts.createVariableStatement( /*modifiers*/ undefined, ts.createVariableDeclarationList(declarations)); ts.setEmitFlags(statement, 524288 /* CustomPrologue */); - leadingStatements = ts.append(leadingStatements, statement); + statements = ts.append(statements, statement); } } } - var body = ts.visitNode(node.body, visitor, ts.isConciseBody); - var trailingStatements = endLexicalEnvironment(); - if (ts.some(leadingStatements) || ts.some(trailingStatements)) { - var block = ts.convertToFunctionBody(body, /*multiLine*/ true); - return ts.updateBlock(block, ts.createNodeArray(ts.concatenate(ts.concatenate(leadingStatements, block.statements), trailingStatements), block.statements)); + return statements; + } + function enableSubstitutionForAsyncMethodsWithSuper() { + if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) { + enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; + // We need to enable substitutions for call, property access, and element access + // if we need to rewrite super calls. + context.enableSubstitution(180 /* CallExpression */); + context.enableSubstitution(178 /* PropertyAccessExpression */); + context.enableSubstitution(179 /* ElementAccessExpression */); + // We need to be notified when entering and exiting declarations that bind super. + context.enableEmitNotification(228 /* ClassDeclaration */); + context.enableEmitNotification(150 /* MethodDeclaration */); + context.enableEmitNotification(152 /* GetAccessor */); + context.enableEmitNotification(153 /* SetAccessor */); + context.enableEmitNotification(151 /* Constructor */); + } + } + /** + * Called by the printer just before a node is printed. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to be printed. + * @param emitCallback The callback used to emit the node. + */ + function onEmitNode(hint, node, emitCallback) { + // If we need to support substitutions for `super` in an async method, + // we should track it here. + if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) { + var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 /* AsyncMethodWithSuper */ | 4096 /* AsyncMethodWithSuperBinding */); + if (superContainerFlags !== enclosingSuperContainerFlags) { + var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; + enclosingSuperContainerFlags = superContainerFlags; + previousOnEmitNode(hint, node, emitCallback); + enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; + return; + } + } + previousOnEmitNode(hint, node, emitCallback); + } + /** + * Hooks node substitutions. + * + * @param hint The context for the emitter. + * @param node The node to substitute. + */ + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 /* Expression */ && enclosingSuperContainerFlags) { + return substituteExpression(node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 178 /* PropertyAccessExpression */: + return substitutePropertyAccessExpression(node); + case 179 /* ElementAccessExpression */: + return substituteElementAccessExpression(node); + case 180 /* CallExpression */: + return substituteCallExpression(node); + } + return node; + } + function substitutePropertyAccessExpression(node) { + if (node.expression.kind === 96 /* SuperKeyword */) { + return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), node); + } + return node; + } + function substituteElementAccessExpression(node) { + if (node.expression.kind === 96 /* SuperKeyword */) { + return createSuperAccessInAsyncMethod(node.argumentExpression, node); + } + return node; + } + function substituteCallExpression(node) { + var expression = node.expression; + if (ts.isSuperProperty(expression)) { + var argumentExpression = ts.isPropertyAccessExpression(expression) + ? substitutePropertyAccessExpression(expression) + : substituteElementAccessExpression(expression); + return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), + /*typeArguments*/ undefined, [ + ts.createThis() + ].concat(node.arguments)); + } + return node; + } + function isSuperContainer(node) { + var kind = node.kind; + return kind === 228 /* ClassDeclaration */ + || kind === 151 /* Constructor */ + || kind === 150 /* MethodDeclaration */ + || kind === 152 /* GetAccessor */ + || kind === 153 /* SetAccessor */; + } + function createSuperAccessInAsyncMethod(argumentExpression, location) { + if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { + return ts.setTextRange(ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), + /*typeArguments*/ undefined, [argumentExpression]), "value"), location); + } + else { + return ts.setTextRange(ts.createCall(ts.createIdentifier("_super"), + /*typeArguments*/ undefined, [argumentExpression]), location); } - return body; } } ts.transformESNext = transformESNext; @@ -48115,11 +52339,51 @@ var ts; text: "\n var __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };" }; function createAssignHelper(context, attributesSegments) { + if (context.getCompilerOptions().target >= 2 /* ES2015 */) { + return ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "assign"), + /*typeArguments*/ undefined, attributesSegments); + } context.requestEmitHelper(assignHelper); return ts.createCall(ts.getHelperName("__assign"), /*typeArguments*/ undefined, attributesSegments); } ts.createAssignHelper = createAssignHelper; + var asyncGeneratorHelper = { + name: "typescript:asyncGenerator", + scoped: false, + text: "\n var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), q = [], c, i;\n return i = { next: verb(\"next\"), \"throw\": verb(\"throw\"), \"return\": verb(\"return\") }, i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }\n function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }\n function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === \"yield\" ? _yield : r.value[0] === \"delegate\" ? delegate : fulfill, reject); }\n function _yield(value) { settle(c[2], { value: value, done: false }); }\n function delegate(r) { step(r.done ? r : { value: [\"yield\", r.value], done: false }); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { c = void 0, f(v), next(); }\n };\n " + }; + function createAsyncGeneratorHelper(context, generatorFunc) { + context.requestEmitHelper(asyncGeneratorHelper); + // Mark this node as originally an async function + (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 131072 /* AsyncFunctionBody */; + return ts.createCall(ts.getHelperName("__asyncGenerator"), + /*typeArguments*/ undefined, [ + ts.createThis(), + ts.createIdentifier("arguments"), + generatorFunc + ]); + } + var asyncDelegator = { + name: "typescript:asyncDelegator", + scoped: false, + text: "\n var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {\n var i = { next: verb(\"next\"), \"throw\": verb(\"throw\", function (e) { throw e; }), \"return\": verb(\"return\", function (v) { return { value: v, done: true }; }) };\n return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { return function (v) { return { value: [\"delegate\", (o[n] || f).call(o, v)], done: false }; }; }\n };\n " + }; + function createAsyncDelegatorHelper(context, expression, location) { + context.requestEmitHelper(asyncDelegator); + return ts.setTextRange(ts.createCall(ts.getHelperName("__asyncDelegator"), + /*typeArguments*/ undefined, [expression]), location); + } + var asyncValues = { + name: "typescript:asyncValues", + scoped: false, + text: "\n var __asyncValues = (this && this.__asyncIterator) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator];\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\n };\n " + }; + function createAsyncValuesHelper(context, expression, location) { + context.requestEmitHelper(asyncValues); + return ts.setTextRange(ts.createCall(ts.getHelperName("__asyncValues"), + /*typeArguments*/ undefined, [expression]), location); + } })(ts || (ts = {})); /// /// @@ -48129,7 +52393,6 @@ var ts; (function (ts) { function transformJsx(context) { var compilerOptions = context.getCompilerOptions(); - var currentSourceFile; return transformSourceFile; /** * Transform JSX-specific syntax in a SourceFile. @@ -48140,10 +52403,8 @@ var ts; if (ts.isDeclarationFile(node)) { return node; } - currentSourceFile = node; var visited = ts.visitEachChild(node, visitor, context); ts.addEmitHelpers(visited, context.readEmitHelpers()); - currentSourceFile = undefined; return visited; } function visitor(node) { @@ -48156,11 +52417,11 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 246 /* JsxElement */: + case 248 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 247 /* JsxSelfClosingElement */: + case 249 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 252 /* JsxExpression */: + case 255 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -48170,11 +52431,11 @@ var ts; switch (node.kind) { case 10 /* JsxText */: return visitJsxText(node); - case 252 /* JsxExpression */: + case 255 /* JsxExpression */: return visitJsxExpression(node); - case 246 /* JsxElement */: + case 248 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 247 /* JsxSelfClosingElement */: + case 249 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); default: ts.Debug.failBadSyntaxKind(node); @@ -48190,7 +52451,7 @@ var ts; function visitJsxOpeningLikeElement(node, children, isChild, location) { var tagName = getTagName(node); var objectProperties; - var attrs = node.attributes; + var attrs = node.attributes.properties; if (attrs.length === 0) { // When there are no attributes, React wants "null" objectProperties = ts.createNull(); @@ -48229,13 +52490,16 @@ var ts; } function transformJsxAttributeInitializer(node) { if (node === undefined) { - return ts.createLiteral(true); + return ts.createTrue(); } else if (node.kind === 9 /* StringLiteral */) { var decoded = tryDecodeEntities(node.text); - return decoded ? ts.createLiteral(decoded, /*location*/ node) : node; + return decoded ? ts.setTextRange(ts.createLiteral(decoded), node) : node; } - else if (node.kind === 252 /* JsxExpression */) { + else if (node.kind === 255 /* JsxExpression */) { + if (node.expression === undefined) { + return ts.createTrue(); + } return visitJsxExpression(node); } else { @@ -48243,54 +52507,61 @@ var ts; } } function visitJsxText(node) { - var text = ts.getTextOfNode(node, /*includeTrivia*/ true); - var parts; + var fixed = fixupWhitespaceAndDecodeEntities(ts.getTextOfNode(node, /*includeTrivia*/ true)); + return fixed === undefined ? undefined : ts.createLiteral(fixed); + } + /** + * JSX trims whitespace at the end and beginning of lines, except that the + * start/end of a tag is considered a start/end of a line only if that line is + * on the same line as the closing tag. See examples in + * tests/cases/conformance/jsx/tsxReactEmitWhitespace.tsx + * See also https://www.w3.org/TR/html4/struct/text.html#h-9.1 and https://www.w3.org/TR/CSS2/text.html#white-space-model + * + * An equivalent algorithm would be: + * - If there is only one line, return it. + * - If there is only whitespace (but multiple lines), return `undefined`. + * - Split the text into lines. + * - 'trimRight' the first line, 'trimLeft' the last line, 'trim' middle lines. + * - Decode entities on each line (individually). + * - Remove empty lines and join the rest with " ". + */ + function fixupWhitespaceAndDecodeEntities(text) { + var acc; + // First non-whitespace character on this line. var firstNonWhitespace = 0; + // Last non-whitespace character on this line. var lastNonWhitespace = -1; - // JSX trims whitespace at the end and beginning of lines, except that the - // start/end of a tag is considered a start/end of a line only if that line is - // on the same line as the closing tag. See examples in - // tests/cases/conformance/jsx/tsxReactEmitWhitespace.tsx + // These initial values are special because the first line is: + // firstNonWhitespace = 0 to indicate that we want leading whitsepace, + // but lastNonWhitespace = -1 as a special flag to indicate that we *don't* include the line if it's all whitespace. for (var i = 0; i < text.length; i++) { var c = text.charCodeAt(i); if (ts.isLineBreak(c)) { - if (firstNonWhitespace !== -1 && (lastNonWhitespace - firstNonWhitespace + 1 > 0)) { - var part = text.substr(firstNonWhitespace, lastNonWhitespace - firstNonWhitespace + 1); - if (!parts) { - parts = []; - } - // We do not escape the string here as that is handled by the printer - // when it emits the literal. We do, however, need to decode JSX entities. - parts.push(ts.createLiteral(decodeEntities(part))); + // If we've seen any non-whitespace characters on this line, add the 'trim' of the line. + // (lastNonWhitespace === -1 is a special flag to detect whether the first line is all whitespace.) + if (firstNonWhitespace !== -1 && lastNonWhitespace !== -1) { + acc = addLineOfJsxText(acc, text.substr(firstNonWhitespace, lastNonWhitespace - firstNonWhitespace + 1)); } + // Reset firstNonWhitespace for the next line. + // Don't bother to reset lastNonWhitespace because we ignore it if firstNonWhitespace = -1. firstNonWhitespace = -1; } - else if (!ts.isWhiteSpace(c)) { + else if (!ts.isWhiteSpaceSingleLine(c)) { lastNonWhitespace = i; if (firstNonWhitespace === -1) { firstNonWhitespace = i; } } } - if (firstNonWhitespace !== -1) { - var part = text.substr(firstNonWhitespace); - if (!parts) { - parts = []; - } - // We do not escape the string here as that is handled by the printer - // when it emits the literal. We do, however, need to decode JSX entities. - parts.push(ts.createLiteral(decodeEntities(part))); - } - if (parts) { - return ts.reduceLeft(parts, aggregateJsxTextParts); - } - return undefined; + return firstNonWhitespace !== -1 + ? addLineOfJsxText(acc, text.substr(firstNonWhitespace)) + : acc; } - /** - * Aggregates two expressions by interpolating them with a whitespace literal. - */ - function aggregateJsxTextParts(left, right) { - return ts.createAdd(ts.createAdd(left, ts.createLiteral(" ")), right); + function addLineOfJsxText(acc, trimmedLine) { + // We do not escape the string here as that is handled by the printer + // when it emits the literal. We do, however, need to decode JSX entities. + var decoded = decodeEntities(trimmedLine); + return acc === undefined ? decoded : acc + " " + decoded; } /** * Replace entities like " ", "{", and "�" with the characters they encode. @@ -48305,7 +52576,7 @@ var ts; return String.fromCharCode(parseInt(hex, 16)); } else { - var ch = entities[word]; + var ch = entities.get(word); // If this is not a valid entity, then just use `match` (replace it with itself, i.e. don't replace) return ch ? String.fromCharCode(ch) : match; } @@ -48317,16 +52588,16 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 246 /* JsxElement */) { + if (node.kind === 248 /* JsxElement */) { return getTagName(node.openingElement); } else { - var name_34 = node.tagName; - if (ts.isIdentifier(name_34) && ts.isIntrinsicJsxName(name_34.text)) { - return ts.createLiteral(name_34.text); + var name = node.tagName; + if (ts.isIdentifier(name) && ts.isIntrinsicJsxName(name.text)) { + return ts.createLiteral(name.text); } else { - return ts.createExpressionFromEntityName(name_34); + return ts.createExpressionFromEntityName(name); } } } @@ -48349,7 +52620,7 @@ var ts; } } ts.transformJsx = transformJsx; - var entities = ts.createMap({ + var entities = ts.createMapFromTemplate({ "quot": 0x0022, "amp": 0x0026, "apos": 0x0027, @@ -48609,375 +52880,6 @@ var ts; /// /*@internal*/ var ts; -(function (ts) { - var ES2017SubstitutionFlags; - (function (ES2017SubstitutionFlags) { - /** Enables substitutions for async methods with `super` calls. */ - ES2017SubstitutionFlags[ES2017SubstitutionFlags["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper"; - })(ES2017SubstitutionFlags || (ES2017SubstitutionFlags = {})); - function transformES2017(context) { - var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; - var resolver = context.getEmitResolver(); - var compilerOptions = context.getCompilerOptions(); - var languageVersion = ts.getEmitScriptTarget(compilerOptions); - // These variables contain state that changes as we descend into the tree. - var currentSourceFile; - /** - * Keeps track of whether expression substitution has been enabled for specific edge cases. - * They are persisted between each SourceFile transformation and should not be reset. - */ - var enabledSubstitutions; - /** - * This keeps track of containers where `super` is valid, for use with - * just-in-time substitution for `super` expressions inside of async methods. - */ - var currentSuperContainer; - // Save the previous transformation hooks. - var previousOnEmitNode = context.onEmitNode; - var previousOnSubstituteNode = context.onSubstituteNode; - // Set new transformation hooks. - context.onEmitNode = onEmitNode; - context.onSubstituteNode = onSubstituteNode; - return transformSourceFile; - function transformSourceFile(node) { - if (ts.isDeclarationFile(node)) { - return node; - } - currentSourceFile = node; - var visited = ts.visitEachChild(node, visitor, context); - ts.addEmitHelpers(visited, context.readEmitHelpers()); - currentSourceFile = undefined; - return visited; - } - function visitor(node) { - if ((node.transformFlags & 16 /* ContainsES2017 */) === 0) { - return node; - } - switch (node.kind) { - case 119 /* AsyncKeyword */: - // ES2017 async modifier should be elided for targets < ES2017 - return undefined; - case 189 /* AwaitExpression */: - // ES2017 'await' expressions must be transformed for targets < ES2017. - return visitAwaitExpression(node); - case 149 /* MethodDeclaration */: - // ES2017 method declarations may be 'async' - return visitMethodDeclaration(node); - case 225 /* FunctionDeclaration */: - // ES2017 function declarations may be 'async' - return visitFunctionDeclaration(node); - case 184 /* FunctionExpression */: - // ES2017 function expressions may be 'async' - return visitFunctionExpression(node); - case 185 /* ArrowFunction */: - // ES2017 arrow functions may be 'async' - return visitArrowFunction(node); - default: - return ts.visitEachChild(node, visitor, context); - } - } - /** - * Visits an AwaitExpression node. - * - * This function will be called any time a ES2017 await expression is encountered. - * - * @param node The node to visit. - */ - function visitAwaitExpression(node) { - return ts.setOriginalNode(ts.createYield( - /*asteriskToken*/ undefined, ts.visitNode(node.expression, visitor, ts.isExpression), - /*location*/ node), node); - } - /** - * Visits a MethodDeclaration node. - * - * This function will be called when one of the following conditions are met: - * - The node is marked as async - * - * @param node The node to visit. - */ - function visitMethodDeclaration(node) { - return ts.updateMethod(node, - /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.name, - /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - /** - * Visits a FunctionDeclaration node. - * - * This function will be called when one of the following conditions are met: - * - The node is marked async - * - * @param node The node to visit. - */ - function visitFunctionDeclaration(node) { - return ts.updateFunctionDeclaration(node, - /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.name, - /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - /** - * Visits a FunctionExpression node. - * - * This function will be called when one of the following conditions are met: - * - The node is marked async - * - * @param node The node to visit. - */ - function visitFunctionExpression(node) { - if (ts.nodeIsMissing(node.body)) { - return ts.createOmittedExpression(); - } - return ts.updateFunctionExpression(node, - /*modifiers*/ undefined, node.name, - /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - /** - * Visits an ArrowFunction. - * - * This function will be called when one of the following conditions are met: - * - The node is marked async - * - * @param node The node to visit. - */ - function visitArrowFunction(node) { - return ts.updateArrowFunction(node, ts.visitNodes(node.modifiers, visitor, ts.isModifier), - /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, ts.isAsyncFunctionLike(node) - ? transformAsyncFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); - } - function transformAsyncFunctionBody(node) { - resumeLexicalEnvironment(); - var original = ts.getOriginalNode(node, ts.isFunctionLike); - var nodeType = original.type; - var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 185 /* ArrowFunction */; - var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; - // An async function is emit as an outer function that calls an inner - // generator function. To preserve lexical bindings, we pass the current - // `this` and `arguments` objects to `__awaiter`. The generator function - // passed to `__awaiter` is executed inside of the callback to the - // promise constructor. - if (!isArrowFunction) { - var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.body.statements, /*ensureUseStrict*/ false, visitor); - statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body, statementOffset)))); - ts.addRange(statements, endLexicalEnvironment()); - var block = ts.createBlock(statements, /*location*/ node.body, /*multiLine*/ true); - // Minor optimization, emit `_super` helper to capture `super` access in an arrow. - // This step isn't needed if we eventually transform this to ES5. - if (languageVersion >= 2 /* ES2015 */) { - if (resolver.getNodeCheckFlags(node) & 4096 /* AsyncMethodWithSuperBinding */) { - enableSubstitutionForAsyncMethodsWithSuper(); - ts.addEmitHelper(block, advancedAsyncSuperHelper); - } - else if (resolver.getNodeCheckFlags(node) & 2048 /* AsyncMethodWithSuper */) { - enableSubstitutionForAsyncMethodsWithSuper(); - ts.addEmitHelper(block, asyncSuperHelper); - } - } - return block; - } - else { - var expression = createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body)); - var declarations = endLexicalEnvironment(); - if (ts.some(declarations)) { - var block = ts.convertToFunctionBody(expression); - return ts.updateBlock(block, ts.createNodeArray(ts.concatenate(block.statements, declarations), block.statements)); - } - return expression; - } - } - function transformFunctionBodyWorker(body, start) { - if (ts.isBlock(body)) { - return ts.updateBlock(body, ts.visitLexicalEnvironment(body.statements, visitor, context, start)); - } - else { - startLexicalEnvironment(); - var visited = ts.convertToFunctionBody(ts.visitNode(body, visitor, ts.isConciseBody)); - var declarations = endLexicalEnvironment(); - return ts.updateBlock(visited, ts.createNodeArray(ts.concatenate(visited.statements, declarations), visited.statements)); - } - } - function getPromiseConstructor(type) { - var typeName = type && ts.getEntityNameFromTypeNode(type); - if (typeName && ts.isEntityName(typeName)) { - var serializationKind = resolver.getTypeReferenceSerializationKind(typeName); - if (serializationKind === ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue - || serializationKind === ts.TypeReferenceSerializationKind.Unknown) { - return typeName; - } - } - return undefined; - } - function enableSubstitutionForAsyncMethodsWithSuper() { - if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) { - enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; - // We need to enable substitutions for call, property access, and element access - // if we need to rewrite super calls. - context.enableSubstitution(179 /* CallExpression */); - context.enableSubstitution(177 /* PropertyAccessExpression */); - context.enableSubstitution(178 /* ElementAccessExpression */); - // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(226 /* ClassDeclaration */); - context.enableEmitNotification(149 /* MethodDeclaration */); - context.enableEmitNotification(151 /* GetAccessor */); - context.enableEmitNotification(152 /* SetAccessor */); - context.enableEmitNotification(150 /* Constructor */); - } - } - function substituteExpression(node) { - switch (node.kind) { - case 177 /* PropertyAccessExpression */: - return substitutePropertyAccessExpression(node); - case 178 /* ElementAccessExpression */: - return substituteElementAccessExpression(node); - case 179 /* CallExpression */: - if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) { - return substituteCallExpression(node); - } - break; - } - return node; - } - function substitutePropertyAccessExpression(node) { - if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && node.expression.kind === 96 /* SuperKeyword */) { - var flags = getSuperContainerAsyncMethodFlags(); - if (flags) { - return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), flags, node); - } - } - return node; - } - function substituteElementAccessExpression(node) { - if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && node.expression.kind === 96 /* SuperKeyword */) { - var flags = getSuperContainerAsyncMethodFlags(); - if (flags) { - return createSuperAccessInAsyncMethod(node.argumentExpression, flags, node); - } - } - return node; - } - function substituteCallExpression(node) { - var expression = node.expression; - if (ts.isSuperProperty(expression)) { - var flags = getSuperContainerAsyncMethodFlags(); - if (flags) { - var argumentExpression = ts.isPropertyAccessExpression(expression) - ? substitutePropertyAccessExpression(expression) - : substituteElementAccessExpression(expression); - return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), - /*typeArguments*/ undefined, [ - ts.createThis() - ].concat(node.arguments)); - } - } - return node; - } - function isSuperContainer(node) { - var kind = node.kind; - return kind === 226 /* ClassDeclaration */ - || kind === 150 /* Constructor */ - || kind === 149 /* MethodDeclaration */ - || kind === 151 /* GetAccessor */ - || kind === 152 /* SetAccessor */; - } - /** - * Hook for node emit. - * - * @param node The node to emit. - * @param emit A callback used to emit the node in the printer. - */ - function onEmitNode(emitContext, node, emitCallback) { - // If we need to support substitutions for `super` in an async method, - // we should track it here. - if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) { - var savedCurrentSuperContainer = currentSuperContainer; - currentSuperContainer = node; - previousOnEmitNode(emitContext, node, emitCallback); - currentSuperContainer = savedCurrentSuperContainer; - } - else { - previousOnEmitNode(emitContext, node, emitCallback); - } - } - /** - * Hooks node substitutions. - * - * @param node The node to substitute. - * @param isExpression A value indicating whether the node is to be used in an expression - * position. - */ - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1 /* Expression */) { - return substituteExpression(node); - } - return node; - } - function createSuperAccessInAsyncMethod(argumentExpression, flags, location) { - if (flags & 4096 /* AsyncMethodWithSuperBinding */) { - return ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), - /*typeArguments*/ undefined, [argumentExpression]), "value", location); - } - else { - return ts.createCall(ts.createIdentifier("_super"), - /*typeArguments*/ undefined, [argumentExpression], location); - } - } - function getSuperContainerAsyncMethodFlags() { - return currentSuperContainer !== undefined - && resolver.getNodeCheckFlags(currentSuperContainer) & (2048 /* AsyncMethodWithSuper */ | 4096 /* AsyncMethodWithSuperBinding */); - } - } - ts.transformES2017 = transformES2017; - function createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, body) { - context.requestEmitHelper(awaiterHelper); - var generatorFunc = ts.createFunctionExpression( - /*modifiers*/ undefined, ts.createToken(38 /* AsteriskToken */), - /*name*/ undefined, - /*typeParameters*/ undefined, - /*parameters*/ [], - /*type*/ undefined, body); - // Mark this node as originally an async function - (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 131072 /* AsyncFunctionBody */; - return ts.createCall(ts.getHelperName("__awaiter"), - /*typeArguments*/ undefined, [ - ts.createThis(), - hasLexicalArguments ? ts.createIdentifier("arguments") : ts.createVoidZero(), - promiseConstructor ? ts.createExpressionFromEntityName(promiseConstructor) : ts.createVoidZero(), - generatorFunc - ]); - } - var awaiterHelper = { - name: "typescript:awaiter", - scoped: false, - priority: 5, - text: "\n var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments)).next());\n });\n };" - }; - var asyncSuperHelper = { - name: "typescript:async-super", - scoped: true, - text: "\n const _super = name => super[name];" - }; - var advancedAsyncSuperHelper = { - name: "typescript:advanced-async-super", - scoped: true, - text: "\n const _super = (function (geti, seti) {\n const cache = Object.create(null);\n return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n })(name => super[name], (name, value) => super[name] = value);" - }; -})(ts || (ts = {})); -/// -/// -/*@internal*/ -var ts; (function (ts) { function transformES2016(context) { var hoistVariableDeclaration = context.hoistVariableDeclaration; @@ -48993,7 +52895,7 @@ var ts; return node; } switch (node.kind) { - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -49018,25 +52920,21 @@ var ts; // Transforms `a[x] **= b` into `(_a = a)[_x = x] = Math.pow(_a[_x], b)` var expressionTemp = ts.createTempVariable(hoistVariableDeclaration); var argumentExpressionTemp = ts.createTempVariable(hoistVariableDeclaration); - target = ts.createElementAccess(ts.createAssignment(expressionTemp, left.expression, /*location*/ left.expression), ts.createAssignment(argumentExpressionTemp, left.argumentExpression, /*location*/ left.argumentExpression), - /*location*/ left); - value = ts.createElementAccess(expressionTemp, argumentExpressionTemp, - /*location*/ left); + target = ts.setTextRange(ts.createElementAccess(ts.setTextRange(ts.createAssignment(expressionTemp, left.expression), left.expression), ts.setTextRange(ts.createAssignment(argumentExpressionTemp, left.argumentExpression), left.argumentExpression)), left); + value = ts.setTextRange(ts.createElementAccess(expressionTemp, argumentExpressionTemp), left); } else if (ts.isPropertyAccessExpression(left)) { // Transforms `a.x **= b` into `(_a = a).x = Math.pow(_a.x, b)` var expressionTemp = ts.createTempVariable(hoistVariableDeclaration); - target = ts.createPropertyAccess(ts.createAssignment(expressionTemp, left.expression, /*location*/ left.expression), left.name, - /*location*/ left); - value = ts.createPropertyAccess(expressionTemp, left.name, - /*location*/ left); + target = ts.setTextRange(ts.createPropertyAccess(ts.setTextRange(ts.createAssignment(expressionTemp, left.expression), left.expression), left.name), left); + value = ts.setTextRange(ts.createPropertyAccess(expressionTemp, left.name), left); } else { // Transforms `a **= b` into `a = Math.pow(a, b)` target = left; value = left; } - return ts.createAssignment(target, ts.createMathPow(value, right, /*location*/ node), /*location*/ node); + return ts.setTextRange(ts.createAssignment(target, ts.createMathPow(value, right, /*location*/ node)), node); } function visitExponentiationExpression(node) { // Transforms `a ** b` into `Math.pow(a, b)` @@ -49049,6 +52947,7 @@ var ts; })(ts || (ts = {})); /// /// +/// /*@internal*/ var ts; (function (ts) { @@ -49094,8 +52993,85 @@ var ts; */ SuperCaptureResult[SuperCaptureResult["ReplaceWithReturn"] = 2] = "ReplaceWithReturn"; })(SuperCaptureResult || (SuperCaptureResult = {})); + // Facts we track as we traverse the tree + var HierarchyFacts; + (function (HierarchyFacts) { + HierarchyFacts[HierarchyFacts["None"] = 0] = "None"; + // + // Ancestor facts + // + HierarchyFacts[HierarchyFacts["Function"] = 1] = "Function"; + HierarchyFacts[HierarchyFacts["ArrowFunction"] = 2] = "ArrowFunction"; + HierarchyFacts[HierarchyFacts["AsyncFunctionBody"] = 4] = "AsyncFunctionBody"; + HierarchyFacts[HierarchyFacts["NonStaticClassElement"] = 8] = "NonStaticClassElement"; + HierarchyFacts[HierarchyFacts["CapturesThis"] = 16] = "CapturesThis"; + HierarchyFacts[HierarchyFacts["ExportedVariableStatement"] = 32] = "ExportedVariableStatement"; + HierarchyFacts[HierarchyFacts["TopLevel"] = 64] = "TopLevel"; + HierarchyFacts[HierarchyFacts["Block"] = 128] = "Block"; + HierarchyFacts[HierarchyFacts["IterationStatement"] = 256] = "IterationStatement"; + HierarchyFacts[HierarchyFacts["IterationStatementBlock"] = 512] = "IterationStatementBlock"; + HierarchyFacts[HierarchyFacts["ForStatement"] = 1024] = "ForStatement"; + HierarchyFacts[HierarchyFacts["ForInOrForOfStatement"] = 2048] = "ForInOrForOfStatement"; + HierarchyFacts[HierarchyFacts["ConstructorWithCapturedSuper"] = 4096] = "ConstructorWithCapturedSuper"; + HierarchyFacts[HierarchyFacts["ComputedPropertyName"] = 8192] = "ComputedPropertyName"; + // NOTE: do not add more ancestor flags without also updating AncestorFactsMask below. + // + // Ancestor masks + // + HierarchyFacts[HierarchyFacts["AncestorFactsMask"] = 16383] = "AncestorFactsMask"; + // We are always in *some* kind of block scope, but only specific block-scope containers are + // top-level or Blocks. + HierarchyFacts[HierarchyFacts["BlockScopeIncludes"] = 0] = "BlockScopeIncludes"; + HierarchyFacts[HierarchyFacts["BlockScopeExcludes"] = 4032] = "BlockScopeExcludes"; + // A source file is a top-level block scope. + HierarchyFacts[HierarchyFacts["SourceFileIncludes"] = 64] = "SourceFileIncludes"; + HierarchyFacts[HierarchyFacts["SourceFileExcludes"] = 3968] = "SourceFileExcludes"; + // Functions, methods, and accessors are both new lexical scopes and new block scopes. + HierarchyFacts[HierarchyFacts["FunctionIncludes"] = 65] = "FunctionIncludes"; + HierarchyFacts[HierarchyFacts["FunctionExcludes"] = 16286] = "FunctionExcludes"; + HierarchyFacts[HierarchyFacts["AsyncFunctionBodyIncludes"] = 69] = "AsyncFunctionBodyIncludes"; + HierarchyFacts[HierarchyFacts["AsyncFunctionBodyExcludes"] = 16278] = "AsyncFunctionBodyExcludes"; + // Arrow functions are lexically scoped to their container, but are new block scopes. + HierarchyFacts[HierarchyFacts["ArrowFunctionIncludes"] = 66] = "ArrowFunctionIncludes"; + HierarchyFacts[HierarchyFacts["ArrowFunctionExcludes"] = 16256] = "ArrowFunctionExcludes"; + // Constructors are both new lexical scopes and new block scopes. Constructors are also + // always considered non-static members of a class. + HierarchyFacts[HierarchyFacts["ConstructorIncludes"] = 73] = "ConstructorIncludes"; + HierarchyFacts[HierarchyFacts["ConstructorExcludes"] = 16278] = "ConstructorExcludes"; + // 'do' and 'while' statements are not block scopes. We track that the subtree is contained + // within an IterationStatement to indicate whether the embedded statement is an + // IterationStatementBlock. + HierarchyFacts[HierarchyFacts["DoOrWhileStatementIncludes"] = 256] = "DoOrWhileStatementIncludes"; + HierarchyFacts[HierarchyFacts["DoOrWhileStatementExcludes"] = 0] = "DoOrWhileStatementExcludes"; + // 'for' statements are new block scopes and have special handling for 'let' declarations. + HierarchyFacts[HierarchyFacts["ForStatementIncludes"] = 1280] = "ForStatementIncludes"; + HierarchyFacts[HierarchyFacts["ForStatementExcludes"] = 3008] = "ForStatementExcludes"; + // 'for-in' and 'for-of' statements are new block scopes and have special handling for + // 'let' declarations. + HierarchyFacts[HierarchyFacts["ForInOrForOfStatementIncludes"] = 2304] = "ForInOrForOfStatementIncludes"; + HierarchyFacts[HierarchyFacts["ForInOrForOfStatementExcludes"] = 1984] = "ForInOrForOfStatementExcludes"; + // Blocks (other than function bodies) are new block scopes. + HierarchyFacts[HierarchyFacts["BlockIncludes"] = 128] = "BlockIncludes"; + HierarchyFacts[HierarchyFacts["BlockExcludes"] = 3904] = "BlockExcludes"; + HierarchyFacts[HierarchyFacts["IterationStatementBlockIncludes"] = 512] = "IterationStatementBlockIncludes"; + HierarchyFacts[HierarchyFacts["IterationStatementBlockExcludes"] = 4032] = "IterationStatementBlockExcludes"; + // Computed property names track subtree flags differently than their containing members. + HierarchyFacts[HierarchyFacts["ComputedPropertyNameIncludes"] = 8192] = "ComputedPropertyNameIncludes"; + HierarchyFacts[HierarchyFacts["ComputedPropertyNameExcludes"] = 0] = "ComputedPropertyNameExcludes"; + // + // Subtree facts + // + HierarchyFacts[HierarchyFacts["NewTarget"] = 16384] = "NewTarget"; + HierarchyFacts[HierarchyFacts["NewTargetInComputedPropertyName"] = 32768] = "NewTargetInComputedPropertyName"; + // + // Subtree masks + // + HierarchyFacts[HierarchyFacts["SubtreeFactsMask"] = -16384] = "SubtreeFactsMask"; + HierarchyFacts[HierarchyFacts["PropagateNewTargetMask"] = 49152] = "PropagateNewTargetMask"; + })(HierarchyFacts || (HierarchyFacts = {})); function transformES2015(context) { var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration; + var compilerOptions = context.getCompilerOptions(); var resolver = context.getEmitResolver(); var previousOnSubstituteNode = context.onSubstituteNode; var previousOnEmitNode = context.onEmitNode; @@ -49103,15 +53079,7 @@ var ts; context.onSubstituteNode = onSubstituteNode; var currentSourceFile; var currentText; - var currentParent; - var currentNode; - var enclosingVariableStatement; - var enclosingBlockScopeContainer; - var enclosingBlockScopeContainerParent; - var enclosingFunction; - var enclosingNonArrowFunction; - var enclosingNonAsyncFunctionBody; - var isInConstructorWithCapturedSuper; + var hierarchyFacts; /** * Used to track if we are emitting body of the converted loop */ @@ -49129,257 +53097,221 @@ var ts; } currentSourceFile = node; currentText = node.text; - var visited = saveStateAndInvoke(node, visitSourceFile); + var visited = visitSourceFile(node); ts.addEmitHelpers(visited, context.readEmitHelpers()); currentSourceFile = undefined; currentText = undefined; + hierarchyFacts = 0 /* None */; return visited; } - function visitor(node) { - return saveStateAndInvoke(node, dispatcher); + /** + * Sets the `HierarchyFacts` for this node prior to visiting this node's subtree, returning the facts set prior to modification. + * @param excludeFacts The existing `HierarchyFacts` to reset before visiting the subtree. + * @param includeFacts The new `HierarchyFacts` to set before visiting the subtree. + */ + function enterSubtree(excludeFacts, includeFacts) { + var ancestorFacts = hierarchyFacts; + hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & 16383 /* AncestorFactsMask */; + return ancestorFacts; } - function dispatcher(node) { - return convertedLoopState - ? visitorForConvertedLoopWorker(node) - : visitorWorker(node); - } - function saveStateAndInvoke(node, f) { - var savedEnclosingFunction = enclosingFunction; - var savedEnclosingNonArrowFunction = enclosingNonArrowFunction; - var savedEnclosingNonAsyncFunctionBody = enclosingNonAsyncFunctionBody; - var savedEnclosingBlockScopeContainer = enclosingBlockScopeContainer; - var savedEnclosingBlockScopeContainerParent = enclosingBlockScopeContainerParent; - var savedEnclosingVariableStatement = enclosingVariableStatement; - var savedCurrentParent = currentParent; - var savedCurrentNode = currentNode; - var savedConvertedLoopState = convertedLoopState; - var savedIsInConstructorWithCapturedSuper = isInConstructorWithCapturedSuper; - if (ts.nodeStartsNewLexicalEnvironment(node)) { - // don't treat content of nodes that start new lexical environment as part of converted loop copy or constructor body - isInConstructorWithCapturedSuper = false; - convertedLoopState = undefined; - } - onBeforeVisitNode(node); - var visited = f(node); - isInConstructorWithCapturedSuper = savedIsInConstructorWithCapturedSuper; - convertedLoopState = savedConvertedLoopState; - enclosingFunction = savedEnclosingFunction; - enclosingNonArrowFunction = savedEnclosingNonArrowFunction; - enclosingNonAsyncFunctionBody = savedEnclosingNonAsyncFunctionBody; - enclosingBlockScopeContainer = savedEnclosingBlockScopeContainer; - enclosingBlockScopeContainerParent = savedEnclosingBlockScopeContainerParent; - enclosingVariableStatement = savedEnclosingVariableStatement; - currentParent = savedCurrentParent; - currentNode = savedCurrentNode; - return visited; - } - function onBeforeVisitNode(node) { - if (currentNode) { - if (ts.isBlockScope(currentNode, currentParent)) { - enclosingBlockScopeContainer = currentNode; - enclosingBlockScopeContainerParent = currentParent; - } - if (ts.isFunctionLike(currentNode)) { - enclosingFunction = currentNode; - if (currentNode.kind !== 185 /* ArrowFunction */) { - enclosingNonArrowFunction = currentNode; - if (!(ts.getEmitFlags(currentNode) & 131072 /* AsyncFunctionBody */)) { - enclosingNonAsyncFunctionBody = currentNode; - } - } - } - // keep track of the enclosing variable statement when in the context of - // variable statements, variable declarations, binding elements, and binding - // patterns. - switch (currentNode.kind) { - case 205 /* VariableStatement */: - enclosingVariableStatement = currentNode; - break; - case 224 /* VariableDeclarationList */: - case 223 /* VariableDeclaration */: - case 174 /* BindingElement */: - case 172 /* ObjectBindingPattern */: - case 173 /* ArrayBindingPattern */: - break; - default: - enclosingVariableStatement = undefined; - } - } - currentParent = currentNode; - currentNode = node; - } - function returnCapturedThis(node) { - return ts.setOriginalNode(ts.createReturn(ts.createIdentifier("_this")), node); + /** + * Restores the `HierarchyFacts` for this node's ancestor after visiting this node's + * subtree, propagating specific facts from the subtree. + * @param ancestorFacts The `HierarchyFacts` of the ancestor to restore after visiting the subtree. + * @param excludeFacts The existing `HierarchyFacts` of the subtree that should not be propagated. + * @param includeFacts The new `HierarchyFacts` of the subtree that should be propagated. + */ + function exitSubtree(ancestorFacts, excludeFacts, includeFacts) { + hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & -16384 /* SubtreeFactsMask */ | ancestorFacts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { - return isInConstructorWithCapturedSuper && node.kind === 216 /* ReturnStatement */ && !node.expression; + return hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ + && node.kind === 218 /* ReturnStatement */ + && !node.expression; } - function shouldCheckNode(node) { - return (node.transformFlags & 64 /* ES2015 */) !== 0 || - node.kind === 219 /* LabeledStatement */ || - (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatementBody(node)); + function shouldVisitNode(node) { + return (node.transformFlags & 128 /* ContainsES2015 */) !== 0 + || convertedLoopState !== undefined + || (hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ && ts.isStatement(node)) + || (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatementBody(node)); } - function visitorWorker(node) { - if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { - return returnCapturedThis(node); - } - else if (shouldCheckNode(node)) { + function visitor(node) { + if (shouldVisitNode(node)) { return visitJavaScript(node); } - else if (node.transformFlags & 128 /* ContainsES2015 */ || (isInConstructorWithCapturedSuper && !ts.isExpression(node))) { - // we want to dive in this branch either if node has children with ES2015 specific syntax - // or we are inside constructor that captures result of the super call so all returns without expression should be - // rewritten. Note: we skip expressions since returns should never appear there - return ts.visitEachChild(node, visitor, context); - } else { return node; } } - function visitorForConvertedLoopWorker(node) { - var result; - if (shouldCheckNode(node)) { - result = visitJavaScript(node); + function functionBodyVisitor(node) { + if (shouldVisitNode(node)) { + return visitBlock(node, /*isFunctionBody*/ true); } - else { - result = visitNodesInConvertedLoop(node); - } - return result; + return node; } - function visitNodesInConvertedLoop(node) { - switch (node.kind) { - case 216 /* ReturnStatement */: - node = isReturnVoidStatementInConstructorWithCapturedSuper(node) ? returnCapturedThis(node) : node; - return visitReturnStatement(node); - case 205 /* VariableStatement */: - return visitVariableStatement(node); - case 218 /* SwitchStatement */: - return visitSwitchStatement(node); - case 215 /* BreakStatement */: - case 214 /* ContinueStatement */: - return visitBreakOrContinueStatement(node); - case 98 /* ThisKeyword */: - return visitThisKeyword(node); - case 70 /* Identifier */: - return visitIdentifier(node); - default: - return ts.visitEachChild(node, visitor, context); + function callExpressionVisitor(node) { + if (node.kind === 96 /* SuperKeyword */) { + return visitSuperKeyword(/*isExpressionOfCall*/ true); } + return visitor(node); } function visitJavaScript(node) { switch (node.kind) { case 114 /* StaticKeyword */: return undefined; // elide static keyword - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: return visitClassDeclaration(node); - case 197 /* ClassExpression */: + case 198 /* ClassExpression */: return visitClassExpression(node); - case 144 /* Parameter */: + case 145 /* Parameter */: return visitParameter(node); - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 185 /* ArrowFunction */: + case 186 /* ArrowFunction */: return visitArrowFunction(node); - case 184 /* FunctionExpression */: + case 185 /* FunctionExpression */: return visitFunctionExpression(node); - case 223 /* VariableDeclaration */: + case 225 /* VariableDeclaration */: return visitVariableDeclaration(node); case 70 /* Identifier */: return visitIdentifier(node); - case 224 /* VariableDeclarationList */: + case 226 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 219 /* LabeledStatement */: + case 220 /* SwitchStatement */: + return visitSwitchStatement(node); + case 234 /* CaseBlock */: + return visitCaseBlock(node); + case 206 /* Block */: + return visitBlock(node, /*isFunctionBody*/ false); + case 217 /* BreakStatement */: + case 216 /* ContinueStatement */: + return visitBreakOrContinueStatement(node); + case 221 /* LabeledStatement */: return visitLabeledStatement(node); - case 209 /* DoStatement */: - return visitDoStatement(node); - case 210 /* WhileStatement */: - return visitWhileStatement(node); - case 211 /* ForStatement */: - return visitForStatement(node); - case 212 /* ForInStatement */: - return visitForInStatement(node); - case 213 /* ForOfStatement */: - return visitForOfStatement(node); - case 207 /* ExpressionStatement */: + case 211 /* DoStatement */: + case 212 /* WhileStatement */: + return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); + case 213 /* ForStatement */: + return visitForStatement(node, /*outermostLabeledStatement*/ undefined); + case 214 /* ForInStatement */: + return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); + case 215 /* ForOfStatement */: + return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); + case 209 /* ExpressionStatement */: return visitExpressionStatement(node); - case 176 /* ObjectLiteralExpression */: + case 177 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 256 /* CatchClause */: + case 259 /* CatchClause */: return visitCatchClause(node); - case 258 /* ShorthandPropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 175 /* ArrayLiteralExpression */: + case 143 /* ComputedPropertyName */: + return visitComputedPropertyName(node); + case 176 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 179 /* CallExpression */: + case 180 /* CallExpression */: return visitCallExpression(node); - case 180 /* NewExpression */: + case 181 /* NewExpression */: return visitNewExpression(node); - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return visitBinaryExpression(node, /*needsDestructuringValue*/ true); case 12 /* NoSubstitutionTemplateLiteral */: case 13 /* TemplateHead */: case 14 /* TemplateMiddle */: case 15 /* TemplateTail */: return visitTemplateLiteral(node); - case 181 /* TaggedTemplateExpression */: + case 9 /* StringLiteral */: + return visitStringLiteral(node); + case 8 /* NumericLiteral */: + return visitNumericLiteral(node); + case 182 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 194 /* TemplateExpression */: + case 195 /* TemplateExpression */: return visitTemplateExpression(node); - case 195 /* YieldExpression */: + case 196 /* YieldExpression */: return visitYieldExpression(node); - case 196 /* SpreadElement */: + case 197 /* SpreadElement */: return visitSpreadElement(node); case 96 /* SuperKeyword */: - return visitSuperKeyword(); - case 195 /* YieldExpression */: - // `yield` will be handled by a generators transform. - return ts.visitEachChild(node, visitor, context); - case 149 /* MethodDeclaration */: + return visitSuperKeyword(/*isExpressionOfCall*/ false); + case 98 /* ThisKeyword */: + return visitThisKeyword(node); + case 203 /* MetaProperty */: + return visitMetaProperty(node); + case 150 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 205 /* VariableStatement */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + return visitAccessorDeclaration(node); + case 207 /* VariableStatement */: return visitVariableStatement(node); + case 218 /* ReturnStatement */: + return visitReturnStatement(node); default: - ts.Debug.failBadSyntaxKind(node); return ts.visitEachChild(node, visitor, context); } } function visitSourceFile(node) { + var ancestorFacts = enterSubtree(3968 /* SourceFileExcludes */, 64 /* SourceFileIncludes */); var statements = []; startLexicalEnvironment(); - var statementOffset = ts.addPrologueDirectives(statements, node.statements, /*ensureUseStrict*/ false, visitor); + var statementOffset = ts.addStandardPrologue(statements, node.statements, /*ensureUseStrict*/ false); addCaptureThisForNodeIfNeeded(statements, node); + statementOffset = ts.addCustomPrologue(statements, node.statements, statementOffset, visitor); ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset)); ts.addRange(statements, endLexicalEnvironment()); - return ts.updateSourceFileNode(node, ts.createNodeArray(statements, node.statements)); + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements)); } function visitSwitchStatement(node) { - ts.Debug.assert(convertedLoopState !== undefined); - var savedAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; - // for switch statement allow only non-labeled break - convertedLoopState.allowedNonLabeledJumps |= 2 /* Break */; - var result = ts.visitEachChild(node, visitor, context); - convertedLoopState.allowedNonLabeledJumps = savedAllowedNonLabeledJumps; - return result; + if (convertedLoopState !== undefined) { + var savedAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; + // for switch statement allow only non-labeled break + convertedLoopState.allowedNonLabeledJumps |= 2 /* Break */; + var result = ts.visitEachChild(node, visitor, context); + convertedLoopState.allowedNonLabeledJumps = savedAllowedNonLabeledJumps; + return result; + } + return ts.visitEachChild(node, visitor, context); + } + function visitCaseBlock(node) { + var ancestorFacts = enterSubtree(4032 /* BlockScopeExcludes */, 0 /* BlockScopeIncludes */); + var updated = ts.visitEachChild(node, visitor, context); + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return updated; + } + function returnCapturedThis(node) { + return ts.setOriginalNode(ts.createReturn(ts.createIdentifier("_this")), node); } function visitReturnStatement(node) { - ts.Debug.assert(convertedLoopState !== undefined); - convertedLoopState.nonLocalJumps |= 8 /* Return */; - return ts.createReturn(ts.createObjectLiteral([ - ts.createPropertyAssignment(ts.createIdentifier("value"), node.expression - ? ts.visitNode(node.expression, visitor, ts.isExpression) - : ts.createVoidZero()) - ])); + if (convertedLoopState) { + convertedLoopState.nonLocalJumps |= 8 /* Return */; + if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { + node = returnCapturedThis(node); + } + return ts.createReturn(ts.createObjectLiteral([ + ts.createPropertyAssignment(ts.createIdentifier("value"), node.expression + ? ts.visitNode(node.expression, visitor, ts.isExpression) + : ts.createVoidZero()) + ])); + } + else if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { + return returnCapturedThis(node); + } + return ts.visitEachChild(node, visitor, context); } function visitThisKeyword(node) { - ts.Debug.assert(convertedLoopState !== undefined); - if (enclosingFunction && enclosingFunction.kind === 185 /* ArrowFunction */) { - // if the enclosing function is an ArrowFunction is then we use the captured 'this' keyword. - convertedLoopState.containsLexicalThis = true; - return node; + if (convertedLoopState) { + if (hierarchyFacts & 2 /* ArrowFunction */) { + // if the enclosing function is an ArrowFunction then we use the captured 'this' keyword. + convertedLoopState.containsLexicalThis = true; + return node; + } + return convertedLoopState.thisName || (convertedLoopState.thisName = ts.createUniqueName("this")); } - return convertedLoopState.thisName || (convertedLoopState.thisName = ts.createUniqueName("this")); + return node; } function visitIdentifier(node) { if (!convertedLoopState) { @@ -49388,7 +53320,7 @@ var ts; if (ts.isGeneratedIdentifier(node)) { return node; } - if (node.text !== "arguments" && !resolver.isArgumentsLocalBinding(node)) { + if (node.text !== "arguments" || !resolver.isArgumentsLocalBinding(node)) { return node; } return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = ts.createUniqueName("arguments")); @@ -49399,13 +53331,13 @@ var ts; // it is possible if either // - break/continue is labeled and label is located inside the converted loop // - break/continue is non-labeled and located in non-converted loop/switch statement - var jump = node.kind === 215 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; - var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels[node.label.text]) || + var jump = node.kind === 217 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(node.label.text)) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; if (!node.label) { - if (node.kind === 215 /* BreakStatement */) { + if (node.kind === 217 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -49416,7 +53348,7 @@ var ts; } } else { - if (node.kind === 215 /* BreakStatement */) { + if (node.kind === 217 /* BreakStatement */) { labelMarker = "break-" + node.label.text; setLabeledJump(convertedLoopState, /*isBreak*/ true, node.label.text, labelMarker); } @@ -49464,8 +53396,9 @@ var ts; /*type*/ undefined, transformClassLikeDeclarationToExpression(node)); ts.setOriginalNode(variable, node); var statements = []; - var statement = ts.createVariableStatement(/*modifiers*/ undefined, ts.createVariableDeclarationList([variable]), /*location*/ node); + var statement = ts.createVariableStatement(/*modifiers*/ undefined, ts.createVariableDeclarationList([variable])); ts.setOriginalNode(statement, node); + ts.setTextRange(statement, node); ts.startOnNewLine(statement); statements.push(statement); // Add an `export default` statement for default exports (for `--target es5 --module es6`) @@ -49583,7 +53516,7 @@ var ts; ts.setEmitFlags(statement, 1536 /* NoComments */ | 384 /* NoTokenSourceMaps */); statements.push(statement); ts.addRange(statements, endLexicalEnvironment()); - var block = ts.createBlock(ts.createNodeArray(statements, /*location*/ node.members), /*location*/ undefined, /*multiLine*/ true); + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), /*location*/ node.members), /*multiLine*/ true); ts.setEmitFlags(block, 1536 /* NoComments */); return block; } @@ -49596,7 +53529,7 @@ var ts; */ function addExtendsHelperIfNeeded(statements, node, extendsClauseElement) { if (extendsClauseElement) { - statements.push(ts.createStatement(createExtendsHelper(context, ts.getLocalName(node)), + statements.push(ts.setTextRange(ts.createStatement(createExtendsHelper(context, ts.getLocalName(node))), /*location*/ extendsClauseElement)); } } @@ -49608,6 +53541,9 @@ var ts; * @param extendsClauseElement The expression for the class `extends` clause. */ function addConstructor(statements, node, extendsClauseElement) { + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16278 /* ConstructorExcludes */, 73 /* ConstructorIncludes */); var constructor = ts.getFirstConstructorWithBody(node); var hasSynthesizedSuper = hasSynthesizedDefaultSuperCall(constructor, extendsClauseElement !== undefined); var constructorFunction = ts.createFunctionDeclaration( @@ -49615,12 +53551,14 @@ var ts; /*modifiers*/ undefined, /*asteriskToken*/ undefined, ts.getDeclarationName(node), /*typeParameters*/ undefined, transformConstructorParameters(constructor, hasSynthesizedSuper), - /*type*/ undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper), - /*location*/ constructor || node); + /*type*/ undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper)); + ts.setTextRange(constructorFunction, constructor || node); if (extendsClauseElement) { ts.setEmitFlags(constructorFunction, 8 /* CapturesThis */); } statements.push(constructorFunction); + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, 0 /* None */); + convertedLoopState = savedConvertedLoopState; } /** * Transforms the parameters of the constructor declaration of a class. @@ -49658,38 +53596,46 @@ var ts; statementOffset = 0; } else if (constructor) { - // Otherwise, try to emit all potential prologue directives first. - statementOffset = ts.addPrologueDirectives(statements, constructor.body.statements, /*ensureUseStrict*/ false, visitor); + statementOffset = ts.addStandardPrologue(statements, constructor.body.statements, /*ensureUseStrict*/ false); } if (constructor) { addDefaultValueAssignmentsIfNeeded(statements, constructor); addRestParameterIfNeeded(statements, constructor, hasSynthesizedSuper); + if (!hasSynthesizedSuper) { + // If no super call has been synthesized, emit custom prologue directives. + statementOffset = ts.addCustomPrologue(statements, constructor.body.statements, statementOffset, visitor); + } ts.Debug.assert(statementOffset >= 0, "statementOffset not initialized correctly!"); } - var superCaptureStatus = declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, constructor, !!extendsClauseElement, hasSynthesizedSuper, statementOffset); + // determine whether the class is known syntactically to be a derived class (e.g. a + // class that extends a value that is not syntactically known to be `null`). + var isDerivedClass = extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 94 /* NullKeyword */; + var superCaptureStatus = declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, constructor, isDerivedClass, hasSynthesizedSuper, statementOffset); // The last statement expression was replaced. Skip it. if (superCaptureStatus === 1 /* ReplaceSuperCapture */ || superCaptureStatus === 2 /* ReplaceWithReturn */) { statementOffset++; } if (constructor) { - var body = saveStateAndInvoke(constructor, function (constructor) { - isInConstructorWithCapturedSuper = superCaptureStatus === 1 /* ReplaceSuperCapture */; - return ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, /*start*/ statementOffset); - }); - ts.addRange(statements, body); + if (superCaptureStatus === 1 /* ReplaceSuperCapture */) { + hierarchyFacts |= 4096 /* ConstructorWithCapturedSuper */; + } + ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, /*start*/ statementOffset)); } // Return `_this` unless we're sure enough that it would be pointless to add a return statement. // If there's a constructor that we can tell returns in enough places, then we *do not* want to add a return. - if (extendsClauseElement + if (isDerivedClass && superCaptureStatus !== 2 /* ReplaceWithReturn */ && !(constructor && isSufficientlyCoveredByReturnStatements(constructor.body))) { statements.push(ts.createReturn(ts.createIdentifier("_this"))); } ts.addRange(statements, endLexicalEnvironment()); - var block = ts.createBlock(ts.createNodeArray(statements, + if (constructor) { + prependCaptureNewTargetIfNeeded(statements, constructor, /*copyOnWrite*/ false); + } + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), /*location*/ constructor ? constructor.body.statements : node.members), - /*location*/ constructor ? constructor.body : node, /*multiLine*/ true); + ts.setTextRange(block, constructor ? constructor.body : node); if (!constructor) { ts.setEmitFlags(block, 1536 /* NoComments */); } @@ -49702,17 +53648,17 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 216 /* ReturnStatement */) { + if (statement.kind === 218 /* ReturnStatement */) { return true; } - else if (statement.kind === 208 /* IfStatement */) { + else if (statement.kind === 210 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement); } } - else if (statement.kind === 204 /* Block */) { + else if (statement.kind === 206 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -49725,9 +53671,9 @@ var ts; * * @returns The new statement offset into the `statements` array. */ - function declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, ctor, hasExtendsClause, hasSynthesizedSuper, statementOffset) { + function declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, ctor, isDerivedClass, hasSynthesizedSuper, statementOffset) { // If this isn't a derived class, just capture 'this' for arrow functions if necessary. - if (!hasExtendsClause) { + if (!isDerivedClass) { if (ctor) { addCaptureThisForNodeIfNeeded(statements, ctor); } @@ -49770,16 +53716,18 @@ var ts; var ctorStatements = ctor.body.statements; if (statementOffset < ctorStatements.length) { firstStatement = ctorStatements[statementOffset]; - if (firstStatement.kind === 207 /* ExpressionStatement */ && ts.isSuperCall(firstStatement.expression)) { - var superCall = firstStatement.expression; - superCallExpression = ts.setOriginalNode(saveStateAndInvoke(superCall, visitImmediateSuperCallInBody), superCall); + if (firstStatement.kind === 209 /* ExpressionStatement */ && ts.isSuperCall(firstStatement.expression)) { + superCallExpression = visitImmediateSuperCallInBody(firstStatement.expression); } } - // Return the result if we have an immediate super() call on the last statement. - if (superCallExpression && statementOffset === ctorStatements.length - 1) { + // Return the result if we have an immediate super() call on the last statement, + // but only if the constructor itself doesn't use 'this' elsewhere. + if (superCallExpression + && statementOffset === ctorStatements.length - 1 + && !(ctor.transformFlags & (16384 /* ContainsLexicalThis */ | 32768 /* ContainsCapturedLexicalThis */))) { var returnStatement = ts.createReturn(superCallExpression); - if (superCallExpression.kind !== 192 /* BinaryExpression */ - || superCallExpression.left.kind !== 179 /* CallExpression */) { + if (superCallExpression.kind !== 193 /* BinaryExpression */ + || superCallExpression.left.kind !== 180 /* CallExpression */) { ts.Debug.fail("Assumed generated super call would have form 'super.call(...) || this'."); } // Shift comments from the original super call to the return statement. @@ -49788,18 +53736,18 @@ var ts; return 2 /* ReplaceWithReturn */; } // Perform the capture. - captureThisForNode(statements, ctor, superCallExpression, firstStatement); + captureThisForNode(statements, ctor, superCallExpression || createActualThis(), firstStatement); // If we're actually replacing the original statement, we need to signal this to the caller. if (superCallExpression) { return 1 /* ReplaceSuperCapture */; } return 0 /* NoReplacement */; } + function createActualThis() { + return ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */); + } function createDefaultSuperCallOrThis() { - var actualThis = ts.createThis(); - ts.setEmitFlags(actualThis, 4 /* NoSubstitution */); - var superCall = ts.createFunctionApply(ts.createIdentifier("_super"), actualThis, ts.createIdentifier("arguments")); - return ts.createLogicalOr(superCall, actualThis); + return ts.createLogicalOr(ts.createLogicalAnd(ts.createStrictInequality(ts.createIdentifier("_super"), ts.createNull()), ts.createFunctionApply(ts.createIdentifier("_super"), createActualThis(), ts.createIdentifier("arguments"))), createActualThis()); } /** * Visits a parameter declaration. @@ -49814,25 +53762,25 @@ var ts; else if (ts.isBindingPattern(node.name)) { // Binding patterns are converted into a generated name and are // evaluated inside the function body. - return ts.setOriginalNode(ts.createParameter( + return ts.setOriginalNode(ts.setTextRange(ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, ts.getGeneratedNameForNode(node), /*questionToken*/ undefined, /*type*/ undefined, - /*initializer*/ undefined, + /*initializer*/ undefined), /*location*/ node), /*original*/ node); } else if (node.initializer) { // Initializers are elided - return ts.setOriginalNode(ts.createParameter( + return ts.setOriginalNode(ts.setTextRange(ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, node.name, /*questionToken*/ undefined, /*type*/ undefined, - /*initializer*/ undefined, + /*initializer*/ undefined), /*location*/ node), /*original*/ node); } @@ -49862,17 +53810,17 @@ var ts; } for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { var parameter = _a[_i]; - var name_35 = parameter.name, initializer = parameter.initializer, dotDotDotToken = parameter.dotDotDotToken; + var name = parameter.name, initializer = parameter.initializer, dotDotDotToken = parameter.dotDotDotToken; // A rest parameter cannot have a binding pattern or an initializer, // so let's just ignore it. if (dotDotDotToken) { continue; } - if (ts.isBindingPattern(name_35)) { - addDefaultValueAssignmentForBindingPattern(statements, parameter, name_35, initializer); + if (ts.isBindingPattern(name)) { + addDefaultValueAssignmentForBindingPattern(statements, parameter, name, initializer); } else if (initializer) { - addDefaultValueAssignmentForInitializer(statements, parameter, name_35, initializer); + addDefaultValueAssignmentForInitializer(statements, parameter, name, initializer); } } } @@ -49907,13 +53855,11 @@ var ts; */ function addDefaultValueAssignmentForInitializer(statements, parameter, name, initializer) { initializer = ts.visitNode(initializer, visitor, ts.isExpression); - var statement = ts.createIf(ts.createTypeCheck(ts.getSynthesizedClone(name), "undefined"), ts.setEmitFlags(ts.createBlock([ - ts.createStatement(ts.createAssignment(ts.setEmitFlags(ts.getMutableClone(name), 48 /* NoSourceMap */), ts.setEmitFlags(initializer, 48 /* NoSourceMap */ | ts.getEmitFlags(initializer)), - /*location*/ parameter)) - ], /*location*/ parameter), 1 /* SingleLine */ | 32 /* NoTrailingSourceMap */ | 384 /* NoTokenSourceMaps */), - /*elseStatement*/ undefined, - /*location*/ parameter); + var statement = ts.createIf(ts.createTypeCheck(ts.getSynthesizedClone(name), "undefined"), ts.setEmitFlags(ts.setTextRange(ts.createBlock([ + ts.createStatement(ts.setTextRange(ts.createAssignment(ts.setEmitFlags(ts.getMutableClone(name), 48 /* NoSourceMap */), ts.setEmitFlags(initializer, 48 /* NoSourceMap */ | ts.getEmitFlags(initializer))), parameter)) + ]), parameter), 1 /* SingleLine */ | 32 /* NoTrailingSourceMap */ | 384 /* NoTokenSourceMaps */)); statement.startsOnNewLine = true; + ts.setTextRange(statement, parameter); ts.setEmitFlags(statement, 384 /* NoTokenSourceMaps */ | 32 /* NoTrailingSourceMap */ | 524288 /* CustomPrologue */); statements.push(statement); } @@ -49950,22 +53896,21 @@ var ts; var restIndex = node.parameters.length - 1; var temp = ts.createLoopVariable(); // var param = []; - statements.push(ts.setEmitFlags(ts.createVariableStatement( + statements.push(ts.setEmitFlags(ts.setTextRange(ts.createVariableStatement( /*modifiers*/ undefined, ts.createVariableDeclarationList([ ts.createVariableDeclaration(declarationName, /*type*/ undefined, ts.createArrayLiteral([])) - ]), + ])), /*location*/ parameter), 524288 /* CustomPrologue */)); // for (var _i = restIndex; _i < arguments.length; _i++) { // param[_i - restIndex] = arguments[_i]; // } - var forStatement = ts.createFor(ts.createVariableDeclarationList([ + var forStatement = ts.createFor(ts.setTextRange(ts.createVariableDeclarationList([ ts.createVariableDeclaration(temp, /*type*/ undefined, ts.createLiteral(restIndex)) - ], /*location*/ parameter), ts.createLessThan(temp, ts.createPropertyAccess(ts.createIdentifier("arguments"), "length"), - /*location*/ parameter), ts.createPostfixIncrement(temp, /*location*/ parameter), ts.createBlock([ - ts.startOnNewLine(ts.createStatement(ts.createAssignment(ts.createElementAccess(expressionName, restIndex === 0 + ]), parameter), ts.setTextRange(ts.createLessThan(temp, ts.createPropertyAccess(ts.createIdentifier("arguments"), "length")), parameter), ts.setTextRange(ts.createPostfixIncrement(temp), parameter), ts.createBlock([ + ts.startOnNewLine(ts.setTextRange(ts.createStatement(ts.createAssignment(ts.createElementAccess(expressionName, restIndex === 0 ? temp - : ts.createSubtract(temp, ts.createLiteral(restIndex))), ts.createElementAccess(ts.createIdentifier("arguments"), temp)), + : ts.createSubtract(temp, ts.createLiteral(restIndex))), ts.createElementAccess(ts.createIdentifier("arguments"), temp))), /*location*/ parameter)) ])); ts.setEmitFlags(forStatement, 524288 /* CustomPrologue */); @@ -49979,7 +53924,7 @@ var ts; * @param node A node. */ function addCaptureThisForNodeIfNeeded(statements, node) { - if (node.transformFlags & 32768 /* ContainsCapturedLexicalThis */ && node.kind !== 185 /* ArrowFunction */) { + if (node.transformFlags & 32768 /* ContainsCapturedLexicalThis */ && node.kind !== 186 /* ArrowFunction */) { captureThisForNode(statements, node, ts.createThis()); } } @@ -49989,11 +53934,52 @@ var ts; /*modifiers*/ undefined, ts.createVariableDeclarationList([ ts.createVariableDeclaration("_this", /*type*/ undefined, initializer) - ]), originalStatement); + ])); ts.setEmitFlags(captureThisStatement, 1536 /* NoComments */ | 524288 /* CustomPrologue */); + ts.setTextRange(captureThisStatement, originalStatement); ts.setSourceMapRange(captureThisStatement, node); statements.push(captureThisStatement); } + function prependCaptureNewTargetIfNeeded(statements, node, copyOnWrite) { + if (hierarchyFacts & 16384 /* NewTarget */) { + var newTarget = void 0; + switch (node.kind) { + case 186 /* ArrowFunction */: + return statements; + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + // Methods and accessors cannot be constructors, so 'new.target' will + // always return 'undefined'. + newTarget = ts.createVoidZero(); + break; + case 151 /* Constructor */: + // Class constructors can only be called with `new`, so `this.constructor` + // should be relatively safe to use. + newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"); + break; + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + // Functions can be called or constructed, and may have a `this` due to + // being a member or when calling an imported function via `other_1.f()`. + newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), 92 /* InstanceOfKeyword */, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"), ts.createVoidZero()); + break; + default: + ts.Debug.failBadSyntaxKind(node); + break; + } + var captureNewTargetStatement = ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration("_newTarget", + /*type*/ undefined, newTarget) + ])); + if (copyOnWrite) { + return [captureNewTargetStatement].concat(statements); + } + statements.unshift(captureNewTargetStatement); + } + return statements; + } /** * Adds statements to the class body function for a class to define the members of the * class. @@ -50005,20 +53991,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 203 /* SemicolonClassElement */: + case 205 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 149 /* MethodDeclaration */: - statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member)); + case 150 /* MethodDeclaration */: + statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { - statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors)); + statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 150 /* Constructor */: + case 151 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -50033,7 +54019,7 @@ var ts; * @param member The SemicolonClassElement node. */ function transformSemicolonClassElementToStatement(member) { - return ts.createEmptyStatement(/*location*/ member); + return ts.setTextRange(ts.createEmptyStatement(), member); } /** * Transforms a MethodDeclaration into a statement for a class body function. @@ -50041,14 +54027,15 @@ var ts; * @param receiver The receiver for the member. * @param member The MethodDeclaration node. */ - function transformClassMethodDeclarationToStatement(receiver, member) { + function transformClassMethodDeclarationToStatement(receiver, member, container) { + var ancestorFacts = enterSubtree(0 /* None */, 0 /* None */); var commentRange = ts.getCommentRange(member); var sourceMapRange = ts.getSourceMapRange(member); var memberName = ts.createMemberAccessForPropertyName(receiver, ts.visitNode(member.name, visitor, ts.isPropertyName), /*location*/ member.name); - var memberFunction = transformFunctionLikeToExpression(member, /*location*/ member, /*name*/ undefined); + var memberFunction = transformFunctionLikeToExpression(member, /*location*/ member, /*name*/ undefined, container); ts.setEmitFlags(memberFunction, 1536 /* NoComments */); ts.setSourceMapRange(memberFunction, sourceMapRange); - var statement = ts.createStatement(ts.createAssignment(memberName, memberFunction), + var statement = ts.setTextRange(ts.createStatement(ts.createAssignment(memberName, memberFunction)), /*location*/ member); ts.setOriginalNode(statement, member); ts.setCommentRange(statement, commentRange); @@ -50056,6 +54043,7 @@ var ts; // No source map should be emitted for this statement to align with the // old emitter. ts.setEmitFlags(statement, 48 /* NoSourceMap */); + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, hierarchyFacts & 49152 /* PropagateNewTargetMask */ ? 16384 /* NewTarget */ : 0 /* None */); return statement; } /** @@ -50064,13 +54052,13 @@ var ts; * @param receiver The receiver for the member. * @param accessors The set of related get/set accessors. */ - function transformAccessorsToStatement(receiver, accessors) { - var statement = ts.createStatement(transformAccessorsToExpression(receiver, accessors, /*startsOnNewLine*/ false), - /*location*/ ts.getSourceMapRange(accessors.firstAccessor)); + function transformAccessorsToStatement(receiver, accessors, container) { + var statement = ts.createStatement(transformAccessorsToExpression(receiver, accessors, container, /*startsOnNewLine*/ false)); // The location for the statement is used to emit source maps only. // No comments should be emitted for this statement to align with the // old emitter. ts.setEmitFlags(statement, 1536 /* NoComments */); + ts.setSourceMapRange(statement, ts.getSourceMapRange(accessors.firstAccessor)); return statement; } /** @@ -50079,8 +54067,9 @@ var ts; * * @param receiver The receiver for the member. */ - function transformAccessorsToExpression(receiver, _a, startsOnNewLine) { + function transformAccessorsToExpression(receiver, _a, container, startsOnNewLine) { var firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; + var ancestorFacts = enterSubtree(0 /* None */, 0 /* None */); // To align with source maps in the old emitter, the receiver and property name // arguments are both mapped contiguously to the accessor name. var target = ts.getMutableClone(receiver); @@ -50091,7 +54080,7 @@ var ts; ts.setSourceMapRange(propertyName, firstAccessor.name); var properties = []; if (getAccessor) { - var getterFunction = transformFunctionLikeToExpression(getAccessor, /*location*/ undefined, /*name*/ undefined); + var getterFunction = transformFunctionLikeToExpression(getAccessor, /*location*/ undefined, /*name*/ undefined, container); ts.setSourceMapRange(getterFunction, ts.getSourceMapRange(getAccessor)); ts.setEmitFlags(getterFunction, 512 /* NoLeadingComments */); var getter = ts.createPropertyAssignment("get", getterFunction); @@ -50099,23 +54088,24 @@ var ts; properties.push(getter); } if (setAccessor) { - var setterFunction = transformFunctionLikeToExpression(setAccessor, /*location*/ undefined, /*name*/ undefined); + var setterFunction = transformFunctionLikeToExpression(setAccessor, /*location*/ undefined, /*name*/ undefined, container); ts.setSourceMapRange(setterFunction, ts.getSourceMapRange(setAccessor)); ts.setEmitFlags(setterFunction, 512 /* NoLeadingComments */); var setter = ts.createPropertyAssignment("set", setterFunction); ts.setCommentRange(setter, ts.getCommentRange(setAccessor)); properties.push(setter); } - properties.push(ts.createPropertyAssignment("enumerable", ts.createLiteral(true)), ts.createPropertyAssignment("configurable", ts.createLiteral(true))); + properties.push(ts.createPropertyAssignment("enumerable", ts.createTrue()), ts.createPropertyAssignment("configurable", ts.createTrue())); var call = ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), /*typeArguments*/ undefined, [ target, propertyName, - ts.createObjectLiteral(properties, /*location*/ undefined, /*multiLine*/ true) + ts.createObjectLiteral(properties, /*multiLine*/ true) ]); if (startsOnNewLine) { call.startsOnNewLine = true; } + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, hierarchyFacts & 49152 /* PropagateNewTargetMask */ ? 16384 /* NewTarget */ : 0 /* None */); return call; } /** @@ -50127,14 +54117,20 @@ var ts; if (node.transformFlags & 16384 /* ContainsLexicalThis */) { enableSubstitutionsForCapturedThis(); } + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16256 /* ArrowFunctionExcludes */, 66 /* ArrowFunctionIncludes */); var func = ts.createFunctionExpression( /*modifiers*/ undefined, /*asteriskToken*/ undefined, /*name*/ undefined, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, transformFunctionBody(node), node); + /*type*/ undefined, transformFunctionBody(node)); + ts.setTextRange(func, node); ts.setOriginalNode(func, node); ts.setEmitFlags(func, 8 /* CapturesThis */); + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + convertedLoopState = savedConvertedLoopState; return func; } /** @@ -50143,12 +54139,24 @@ var ts; * @param node a FunctionExpression node. */ function visitFunctionExpression(node) { - return ts.updateFunctionExpression(node, - /*modifiers*/ undefined, node.name, - /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, node.transformFlags & 64 /* ES2015 */ + var ancestorFacts = ts.getEmitFlags(node) & 131072 /* AsyncFunctionBody */ + ? enterSubtree(16278 /* AsyncFunctionBodyExcludes */, 69 /* AsyncFunctionBodyIncludes */) + : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var parameters = ts.visitParameterList(node.parameters, visitor, context); + var body = node.transformFlags & 64 /* ES2015 */ ? transformFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); + : visitFunctionBodyDownLevel(node); + var name = hierarchyFacts & 16384 /* NewTarget */ + ? ts.getLocalName(node) + : node.name; + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, 0 /* None */); + convertedLoopState = savedConvertedLoopState; + return ts.updateFunctionExpression(node, + /*modifiers*/ undefined, node.asteriskToken, name, + /*typeParameters*/ undefined, parameters, + /*type*/ undefined, body); } /** * Visits a FunctionDeclaration node. @@ -50156,12 +54164,22 @@ var ts; * @param node a FunctionDeclaration node. */ function visitFunctionDeclaration(node) { - return ts.updateFunctionDeclaration(node, - /*decorators*/ undefined, node.modifiers, node.name, - /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, node.transformFlags & 64 /* ES2015 */ + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); + var parameters = ts.visitParameterList(node.parameters, visitor, context); + var body = node.transformFlags & 64 /* ES2015 */ ? transformFunctionBody(node) - : ts.visitFunctionBody(node.body, visitor, context)); + : visitFunctionBodyDownLevel(node); + var name = hierarchyFacts & 16384 /* NewTarget */ + ? ts.getLocalName(node) + : node.name; + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, 0 /* None */); + convertedLoopState = savedConvertedLoopState; + return ts.updateFunctionDeclaration(node, + /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, name, + /*typeParameters*/ undefined, parameters, + /*type*/ undefined, body); } /** * Transforms a function-like node into a FunctionExpression. @@ -50170,18 +54188,24 @@ var ts; * @param location The source-map location for the new FunctionExpression. * @param name The name of the new FunctionExpression. */ - function transformFunctionLikeToExpression(node, location, name) { - var savedContainingNonArrowFunction = enclosingNonArrowFunction; - if (node.kind !== 185 /* ArrowFunction */) { - enclosingNonArrowFunction = node; + function transformFunctionLikeToExpression(node, location, name, container) { + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = container && ts.isClassLike(container) && !ts.hasModifier(node, 32 /* Static */) + ? enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */ | 8 /* NonStaticClassElement */) + : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); + var parameters = ts.visitParameterList(node.parameters, visitor, context); + var body = transformFunctionBody(node); + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 227 /* FunctionDeclaration */ || node.kind === 185 /* FunctionExpression */)) { + name = ts.getGeneratedNameForNode(node); } - var expression = ts.setOriginalNode(ts.createFunctionExpression( + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, 0 /* None */); + convertedLoopState = savedConvertedLoopState; + return ts.setOriginalNode(ts.setTextRange(ts.createFunctionExpression( /*modifiers*/ undefined, node.asteriskToken, name, - /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, saveStateAndInvoke(node, transformFunctionBody), location), + /*typeParameters*/ undefined, parameters, + /*type*/ undefined, body), location), /*original*/ node); - enclosingNonArrowFunction = savedContainingNonArrowFunction; - return expression; } /** * Transforms the body of a function-like node. @@ -50199,8 +54223,8 @@ var ts; resumeLexicalEnvironment(); if (ts.isBlock(body)) { // ensureUseStrict is false because no new prologue-directive should be added. - // addPrologueDirectives will simply put already-existing directives at the beginning of the target statement-array - statementOffset = ts.addPrologueDirectives(statements, body.statements, /*ensureUseStrict*/ false, visitor); + // addStandardPrologue will put already-existing directives at the beginning of the target statement-array + statementOffset = ts.addStandardPrologue(statements, body.statements, /*ensureUseStrict*/ false); } addCaptureThisForNodeIfNeeded(statements, node); addDefaultValueAssignmentsIfNeeded(statements, node); @@ -50210,6 +54234,8 @@ var ts; multiLine = true; } if (ts.isBlock(body)) { + // addCustomPrologue puts already-existing directives at the beginning of the target statement-array + statementOffset = ts.addCustomPrologue(statements, body.statements, statementOffset, visitor); statementsLocation = body.statements; ts.addRange(statements, ts.visitNodes(body.statements, visitor, ts.isStatement, statementOffset)); // If the original body was a multi-line block, this must be a multi-line block. @@ -50218,7 +54244,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 185 /* ArrowFunction */); + ts.Debug.assert(node.kind === 186 /* ArrowFunction */); // To align with the old emitter, we use a synthetic end position on the location // for the statement list we synthesize when we down-level an arrow function with // an expression function body. This prevents both comments and source maps from @@ -50234,7 +54260,8 @@ var ts; } } var expression = ts.visitNode(body, visitor, ts.isExpression); - var returnStatement = ts.createReturn(expression, /*location*/ body); + var returnStatement = ts.createReturn(expression); + ts.setTextRange(returnStatement, body); ts.setEmitFlags(returnStatement, 384 /* NoTokenSourceMaps */ | 32 /* NoTrailingSourceMap */ | 1024 /* NoTrailingComments */); statements.push(returnStatement); // To align with the source map emit for the old emitter, we set a custom @@ -50243,11 +54270,13 @@ var ts; } var lexicalEnvironment = context.endLexicalEnvironment(); ts.addRange(statements, lexicalEnvironment); + prependCaptureNewTargetIfNeeded(statements, node, /*copyOnWrite*/ false); // If we added any final generated statements, this must be a multi-line block if (!multiLine && lexicalEnvironment && lexicalEnvironment.length) { multiLine = true; } - var block = ts.createBlock(ts.createNodeArray(statements, statementsLocation), node.body, multiLine); + var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), multiLine); + ts.setTextRange(block, node.body); if (!multiLine && singleLine) { ts.setEmitFlags(block, 1 /* SingleLine */); } @@ -50257,6 +54286,23 @@ var ts; ts.setOriginalNode(block, node.body); return block; } + function visitFunctionBodyDownLevel(node) { + var updated = ts.visitFunctionBody(node.body, functionBodyVisitor, context); + return ts.updateBlock(updated, ts.setTextRange(ts.createNodeArray(prependCaptureNewTargetIfNeeded(updated.statements, node, /*copyOnWrite*/ true)), + /*location*/ updated.statements)); + } + function visitBlock(node, isFunctionBody) { + if (isFunctionBody) { + // A function body is not a block scope. + return ts.visitEachChild(node, visitor, context); + } + var ancestorFacts = hierarchyFacts & 256 /* IterationStatement */ + ? enterSubtree(4032 /* IterationStatementBlockExcludes */, 512 /* IterationStatementBlockIncludes */) + : enterSubtree(3904 /* BlockExcludes */, 128 /* BlockIncludes */); + var updated = ts.visitEachChild(node, visitor, context); + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return updated; + } /** * Visits an ExpressionStatement that contains a destructuring assignment. * @@ -50265,9 +54311,9 @@ var ts; function visitExpressionStatement(node) { // If we are here it is most likely because our expression is a destructuring assignment. switch (node.expression.kind) { - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return ts.updateStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return ts.updateStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } return ts.visitEachChild(node, visitor, context); @@ -50282,10 +54328,13 @@ var ts; function visitParenthesizedExpression(node, needsDestructuringValue) { // If we are here it is most likely because our expression is a destructuring assignment. if (!needsDestructuringValue) { + // By default we always emit the RHS at the end of a flattened destructuring + // expression. If we are in a state where we do not need the destructuring value, + // we pass that information along to the children that care about it. switch (node.expression.kind) { - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return ts.updateParen(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return ts.updateParen(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } } @@ -50303,9 +54352,12 @@ var ts; if (ts.isDestructuringAssignment(node)) { return ts.flattenDestructuringAssignment(node, visitor, context, 0 /* All */, needsDestructuringValue); } + return ts.visitEachChild(node, visitor, context); } function visitVariableStatement(node) { - if (convertedLoopState && (ts.getCombinedNodeFlags(node.declarationList) & 3 /* BlockScoped */) == 0) { + var ancestorFacts = enterSubtree(0 /* None */, ts.hasModifier(node, 1 /* Export */) ? 32 /* ExportedVariableStatement */ : 0 /* None */); + var updated; + if (convertedLoopState && (node.declarationList.flags & 3 /* BlockScoped */) === 0) { // we are inside a converted loop - hoist variable declarations var assignments = void 0; for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { @@ -50319,18 +54371,22 @@ var ts; else { assignment = ts.createBinary(decl.name, 57 /* EqualsToken */, ts.visitNode(decl.initializer, visitor, ts.isExpression)); } - (assignments || (assignments = [])).push(assignment); + assignments = ts.append(assignments, assignment); } } if (assignments) { - return ts.createStatement(ts.reduceLeft(assignments, function (acc, v) { return ts.createBinary(v, 25 /* CommaToken */, acc); }), node); + updated = ts.setTextRange(ts.createStatement(ts.reduceLeft(assignments, function (acc, v) { return ts.createBinary(v, 25 /* CommaToken */, acc); })), node); } else { // none of declarations has initializer - the entire variable statement can be deleted - return undefined; + updated = undefined; } } - return ts.visitEachChild(node, visitor, context); + else { + updated = ts.visitEachChild(node, visitor, context); + } + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return updated; } /** * Visits a VariableDeclarationList that is block scoped (e.g. `let` or `const`). @@ -50338,25 +54394,29 @@ var ts; * @param node A VariableDeclarationList node. */ function visitVariableDeclarationList(node) { - if (node.flags & 3 /* BlockScoped */) { - enableSubstitutionsForBlockScopedBindings(); + if (node.transformFlags & 64 /* ES2015 */) { + if (node.flags & 3 /* BlockScoped */) { + enableSubstitutionsForBlockScopedBindings(); + } + var declarations = ts.flatten(ts.map(node.declarations, node.flags & 1 /* Let */ + ? visitVariableDeclarationInLetDeclarationList + : visitVariableDeclaration)); + var declarationList = ts.createVariableDeclarationList(declarations); + ts.setOriginalNode(declarationList, node); + ts.setTextRange(declarationList, node); + ts.setCommentRange(declarationList, node); + if (node.transformFlags & 8388608 /* ContainsBindingPattern */ + && (ts.isBindingPattern(node.declarations[0].name) + || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) { + // If the first or last declaration is a binding pattern, we need to modify + // the source map range for the declaration list. + var firstDeclaration = ts.firstOrUndefined(declarations); + var lastDeclaration = ts.lastOrUndefined(declarations); + ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); + } + return declarationList; } - var declarations = ts.flatten(ts.map(node.declarations, node.flags & 1 /* Let */ - ? visitVariableDeclarationInLetDeclarationList - : visitVariableDeclaration)); - var declarationList = ts.createVariableDeclarationList(declarations, /*location*/ node); - ts.setOriginalNode(declarationList, node); - ts.setCommentRange(declarationList, node); - if (node.transformFlags & 8388608 /* ContainsBindingPattern */ - && (ts.isBindingPattern(node.declarations[0].name) - || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) { - // If the first or last declaration is a binding pattern, we need to modify - // the source map range for the declaration list. - var firstDeclaration = ts.firstOrUndefined(declarations); - var lastDeclaration = ts.lastOrUndefined(declarations); - ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); - } - return declarationList; + return ts.visitEachChild(node, visitor, context); } /** * Gets a value indicating whether we should emit an explicit initializer for a variable @@ -50407,18 +54467,16 @@ var ts; var flags = resolver.getNodeCheckFlags(node); var isCapturedInFunction = flags & 131072 /* CapturedBlockScopedBinding */; var isDeclaredInLoop = flags & 262144 /* BlockScopedBindingInLoop */; - var emittedAsTopLevel = ts.isBlockScopedContainerTopLevel(enclosingBlockScopeContainer) + var emittedAsTopLevel = (hierarchyFacts & 64 /* TopLevel */) !== 0 || (isCapturedInFunction && isDeclaredInLoop - && ts.isBlock(enclosingBlockScopeContainer) - && ts.isIterationStatement(enclosingBlockScopeContainerParent, /*lookInLabeledStatements*/ false)); + && (hierarchyFacts & 512 /* IterationStatementBlock */) !== 0); var emitExplicitInitializer = !emittedAsTopLevel - && enclosingBlockScopeContainer.kind !== 212 /* ForInStatement */ - && enclosingBlockScopeContainer.kind !== 213 /* ForOfStatement */ + && (hierarchyFacts & 2048 /* ForInOrForOfStatement */) === 0 && (!resolver.isDeclarationWithCollidingName(node) || (isDeclaredInLoop && !isCapturedInFunction - && !ts.isIterationStatement(enclosingBlockScopeContainer, /*lookInLabeledStatements*/ false))); + && (hierarchyFacts & (1024 /* ForStatement */ | 2048 /* ForInOrForOfStatement */)) === 0)); return emitExplicitInitializer; } /** @@ -50447,55 +54505,130 @@ var ts; * @param node A VariableDeclaration node. */ function visitVariableDeclaration(node) { - // If we are here it is because the name contains a binding pattern. + var ancestorFacts = enterSubtree(32 /* ExportedVariableStatement */, 0 /* None */); + var updated; if (ts.isBindingPattern(node.name)) { - var hoistTempVariables = enclosingVariableStatement - && ts.hasModifier(enclosingVariableStatement, 1 /* Export */); - return ts.flattenDestructuringBinding(node, visitor, context, 0 /* All */, - /*value*/ undefined, hoistTempVariables); - } - return ts.visitEachChild(node, visitor, context); - } - function visitLabeledStatement(node) { - if (convertedLoopState) { - if (!convertedLoopState.labels) { - convertedLoopState.labels = ts.createMap(); - } - convertedLoopState.labels[node.label.text] = node.label.text; - } - var result; - if (ts.isIterationStatement(node.statement, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatementBody(node.statement)) { - result = ts.visitNodes(ts.createNodeArray([node.statement]), visitor, ts.isStatement); + updated = ts.flattenDestructuringBinding(node, visitor, context, 0 /* All */, + /*value*/ undefined, (ancestorFacts & 32 /* ExportedVariableStatement */) !== 0); } else { - result = ts.visitEachChild(node, visitor, context); + updated = ts.visitEachChild(node, visitor, context); } - if (convertedLoopState) { - convertedLoopState.labels[node.label.text] = undefined; + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return updated; + } + function recordLabel(node) { + convertedLoopState.labels.set(node.label.text, node.label.text); + } + function resetLabel(node) { + convertedLoopState.labels.set(node.label.text, undefined); + } + function visitLabeledStatement(node) { + if (convertedLoopState && !convertedLoopState.labels) { + convertedLoopState.labels = ts.createMap(); } - return result; + var statement = ts.unwrapInnermostStatementOfLabel(node, convertedLoopState && recordLabel); + return ts.isIterationStatement(statement, /*lookInLabeledStatements*/ false) + ? visitIterationStatement(statement, /*outermostLabeledStatement*/ node) + : ts.restoreEnclosingLabel(ts.visitNode(statement, visitor, ts.isStatement), node, convertedLoopState && resetLabel); } - function visitDoStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitIterationStatement(node, outermostLabeledStatement) { + switch (node.kind) { + case 211 /* DoStatement */: + case 212 /* WhileStatement */: + return visitDoOrWhileStatement(node, outermostLabeledStatement); + case 213 /* ForStatement */: + return visitForStatement(node, outermostLabeledStatement); + case 214 /* ForInStatement */: + return visitForInStatement(node, outermostLabeledStatement); + case 215 /* ForOfStatement */: + return visitForOfStatement(node, outermostLabeledStatement); + } } - function visitWhileStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitIterationStatementWithFacts(excludeFacts, includeFacts, node, outermostLabeledStatement, convert) { + var ancestorFacts = enterSubtree(excludeFacts, includeFacts); + var updated = convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, convert); + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return updated; } - function visitForStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitDoOrWhileStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(0 /* DoOrWhileStatementExcludes */, 256 /* DoOrWhileStatementIncludes */, node, outermostLabeledStatement); } - function visitForInStatement(node) { - return convertIterationStatementBodyIfNecessary(node); + function visitForStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(3008 /* ForStatementExcludes */, 1280 /* ForStatementIncludes */, node, outermostLabeledStatement); } - /** - * Visits a ForOfStatement and converts it into a compatible ForStatement. - * - * @param node A ForOfStatement. - */ - function visitForOfStatement(node) { - return convertIterationStatementBodyIfNecessary(node, convertForOfToFor); + function visitForInStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(1984 /* ForInOrForOfStatementExcludes */, 2304 /* ForInOrForOfStatementIncludes */, node, outermostLabeledStatement); } - function convertForOfToFor(node, convertedLoopBodyStatements) { + function visitForOfStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(1984 /* ForInOrForOfStatementExcludes */, 2304 /* ForInOrForOfStatementIncludes */, node, outermostLabeledStatement, compilerOptions.downlevelIteration ? convertForOfStatementForIterable : convertForOfStatementForArray); + } + function convertForOfStatementHead(node, boundValue, convertedLoopBodyStatements) { + var statements = []; + if (ts.isVariableDeclarationList(node.initializer)) { + if (node.initializer.flags & 3 /* BlockScoped */) { + enableSubstitutionsForBlockScopedBindings(); + } + var firstOriginalDeclaration = ts.firstOrUndefined(node.initializer.declarations); + if (firstOriginalDeclaration && ts.isBindingPattern(firstOriginalDeclaration.name)) { + // This works whether the declaration is a var, let, or const. + // It will use rhsIterationValue _a[_i] as the initializer. + var declarations = ts.flattenDestructuringBinding(firstOriginalDeclaration, visitor, context, 0 /* All */, boundValue); + var declarationList = ts.setTextRange(ts.createVariableDeclarationList(declarations), node.initializer); + ts.setOriginalNode(declarationList, node.initializer); + // Adjust the source map range for the first declaration to align with the old + // emitter. + var firstDeclaration = declarations[0]; + var lastDeclaration = ts.lastOrUndefined(declarations); + ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); + statements.push(ts.createVariableStatement( + /*modifiers*/ undefined, declarationList)); + } + else { + // The following call does not include the initializer, so we have + // to emit it separately. + statements.push(ts.setTextRange(ts.createVariableStatement( + /*modifiers*/ undefined, ts.setOriginalNode(ts.setTextRange(ts.createVariableDeclarationList([ + ts.createVariableDeclaration(firstOriginalDeclaration ? firstOriginalDeclaration.name : ts.createTempVariable(/*recordTempVariable*/ undefined), + /*type*/ undefined, boundValue) + ]), ts.moveRangePos(node.initializer, -1)), node.initializer)), ts.moveRangeEnd(node.initializer, -1))); + } + } + else { + // Initializer is an expression. Emit the expression in the body, so that it's + // evaluated on every iteration. + var assignment = ts.createAssignment(node.initializer, boundValue); + if (ts.isDestructuringAssignment(assignment)) { + ts.aggregateTransformFlags(assignment); + statements.push(ts.createStatement(visitBinaryExpression(assignment, /*needsDestructuringValue*/ false))); + } + else { + assignment.end = node.initializer.end; + statements.push(ts.setTextRange(ts.createStatement(ts.visitNode(assignment, visitor, ts.isExpression)), ts.moveRangeEnd(node.initializer, -1))); + } + } + var bodyLocation; + var statementsLocation; + if (convertedLoopBodyStatements) { + ts.addRange(statements, convertedLoopBodyStatements); + } + else { + var statement = ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock); + if (ts.isBlock(statement)) { + ts.addRange(statements, statement.statements); + bodyLocation = statement; + statementsLocation = statement.statements; + } + else { + statements.push(statement); + } + } + // The old emitter does not emit source maps for the block. + // We add the location to preserve comments. + return ts.setEmitFlags(ts.setTextRange(ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), + /*multiLine*/ true), bodyLocation), 48 /* NoSourceMap */ | 384 /* NoTokenSourceMaps */); + } + function convertForOfStatementForArray(node, outermostLabeledStatement, convertedLoopBodyStatements) { // The following ES6 code: // // for (let v of expr) { } @@ -50517,97 +54650,65 @@ var ts; // Note also that because an extra statement is needed to assign to the LHS, // for-of bodies are always emitted as blocks. var expression = ts.visitNode(node.expression, visitor, ts.isExpression); - var initializer = node.initializer; - var statements = []; // In the case where the user wrote an identifier as the RHS, like this: // // for (let v of arr) { } // // we don't want to emit a temporary variable for the RHS, just use it directly. var counter = ts.createLoopVariable(); - var rhsReference = expression.kind === 70 /* Identifier */ - ? ts.createUniqueName(expression.text) - : ts.createTempVariable(/*recordTempVariable*/ undefined); - var elementAccess = ts.createElementAccess(rhsReference, counter); - // Initialize LHS - // var v = _a[_i]; - if (ts.isVariableDeclarationList(initializer)) { - if (initializer.flags & 3 /* BlockScoped */) { - enableSubstitutionsForBlockScopedBindings(); - } - var firstOriginalDeclaration = ts.firstOrUndefined(initializer.declarations); - if (firstOriginalDeclaration && ts.isBindingPattern(firstOriginalDeclaration.name)) { - // This works whether the declaration is a var, let, or const. - // It will use rhsIterationValue _a[_i] as the initializer. - var declarations = ts.flattenDestructuringBinding(firstOriginalDeclaration, visitor, context, 0 /* All */, elementAccess); - var declarationList = ts.createVariableDeclarationList(declarations, /*location*/ initializer); - ts.setOriginalNode(declarationList, initializer); - // Adjust the source map range for the first declaration to align with the old - // emitter. - var firstDeclaration = declarations[0]; - var lastDeclaration = ts.lastOrUndefined(declarations); - ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); - statements.push(ts.createVariableStatement( - /*modifiers*/ undefined, declarationList)); - } - else { - // The following call does not include the initializer, so we have - // to emit it separately. - statements.push(ts.createVariableStatement( - /*modifiers*/ undefined, ts.setOriginalNode(ts.createVariableDeclarationList([ - ts.createVariableDeclaration(firstOriginalDeclaration ? firstOriginalDeclaration.name : ts.createTempVariable(/*recordTempVariable*/ undefined), - /*type*/ undefined, ts.createElementAccess(rhsReference, counter)) - ], /*location*/ ts.moveRangePos(initializer, -1)), initializer), - /*location*/ ts.moveRangeEnd(initializer, -1))); - } - } - else { - // Initializer is an expression. Emit the expression in the body, so that it's - // evaluated on every iteration. - var assignment = ts.createAssignment(initializer, elementAccess); - if (ts.isDestructuringAssignment(assignment)) { - // This is a destructuring pattern, so we flatten the destructuring instead. - statements.push(ts.createStatement(ts.flattenDestructuringAssignment(assignment, visitor, context, 0 /* All */))); - } - else { - // Currently there is not way to check that assignment is binary expression of destructing assignment - // so we have to cast never type to binaryExpression - assignment.end = initializer.end; - statements.push(ts.createStatement(assignment, /*location*/ ts.moveRangeEnd(initializer, -1))); - } - } - var bodyLocation; - var statementsLocation; - if (convertedLoopBodyStatements) { - ts.addRange(statements, convertedLoopBodyStatements); - } - else { - var statement = ts.visitNode(node.statement, visitor, ts.isStatement); - if (ts.isBlock(statement)) { - ts.addRange(statements, statement.statements); - bodyLocation = statement; - statementsLocation = statement.statements; - } - else { - statements.push(statement); - } - } + var rhsReference = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(expression) : ts.createTempVariable(/*recordTempVariable*/ undefined); // The old emitter does not emit source maps for the expression ts.setEmitFlags(expression, 48 /* NoSourceMap */ | ts.getEmitFlags(expression)); - // The old emitter does not emit source maps for the block. - // We add the location to preserve comments. - var body = ts.createBlock(ts.createNodeArray(statements, /*location*/ statementsLocation), - /*location*/ bodyLocation); - ts.setEmitFlags(body, 48 /* NoSourceMap */ | 384 /* NoTokenSourceMaps */); - var forStatement = ts.createFor(ts.setEmitFlags(ts.createVariableDeclarationList([ - ts.createVariableDeclaration(counter, /*type*/ undefined, ts.createLiteral(0), /*location*/ ts.moveRangePos(node.expression, -1)), - ts.createVariableDeclaration(rhsReference, /*type*/ undefined, expression, /*location*/ node.expression) - ], /*location*/ node.expression), 1048576 /* NoHoisting */), ts.createLessThan(counter, ts.createPropertyAccess(rhsReference, "length"), - /*location*/ node.expression), ts.createPostfixIncrement(counter, /*location*/ node.expression), body, + var forStatement = ts.setTextRange(ts.createFor( + /*initializer*/ ts.setEmitFlags(ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(counter, /*type*/ undefined, ts.createLiteral(0)), ts.moveRangePos(node.expression, -1)), + ts.setTextRange(ts.createVariableDeclaration(rhsReference, /*type*/ undefined, expression), node.expression) + ]), node.expression), 1048576 /* NoHoisting */), + /*condition*/ ts.setTextRange(ts.createLessThan(counter, ts.createPropertyAccess(rhsReference, "length")), node.expression), + /*incrementor*/ ts.setTextRange(ts.createPostfixIncrement(counter), node.expression), + /*statement*/ convertForOfStatementHead(node, ts.createElementAccess(rhsReference, counter), convertedLoopBodyStatements)), /*location*/ node); // Disable trailing source maps for the OpenParenToken to align source map emit with the old emitter. ts.setEmitFlags(forStatement, 256 /* NoTokenTrailingSourceMaps */); - return forStatement; + ts.setTextRange(forStatement, node); + return ts.restoreEnclosingLabel(forStatement, outermostLabeledStatement, convertedLoopState && resetLabel); + } + function convertForOfStatementForIterable(node, outermostLabeledStatement, convertedLoopBodyStatements) { + var expression = ts.visitNode(node.expression, visitor, ts.isExpression); + var iterator = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(expression) : ts.createTempVariable(/*recordTempVariable*/ undefined); + var result = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(iterator) : ts.createTempVariable(/*recordTempVariable*/ undefined); + var errorRecord = ts.createUniqueName("e"); + var catchVariable = ts.getGeneratedNameForNode(errorRecord); + var returnMethod = ts.createTempVariable(/*recordTempVariable*/ undefined); + var values = ts.createValuesHelper(context, expression, node.expression); + var next = ts.createCall(ts.createPropertyAccess(iterator, "next"), /*typeArguments*/ undefined, []); + hoistVariableDeclaration(errorRecord); + hoistVariableDeclaration(returnMethod); + var forStatement = ts.setEmitFlags(ts.setTextRange(ts.createFor( + /*initializer*/ ts.setEmitFlags(ts.setTextRange(ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(iterator, /*type*/ undefined, values), node.expression), + ts.createVariableDeclaration(result, /*type*/ undefined, next) + ]), node.expression), 1048576 /* NoHoisting */), + /*condition*/ ts.createLogicalNot(ts.createPropertyAccess(result, "done")), + /*incrementor*/ ts.createAssignment(result, next), + /*statement*/ convertForOfStatementHead(node, ts.createPropertyAccess(result, "value"), convertedLoopBodyStatements)), + /*location*/ node), 256 /* NoTokenTrailingSourceMaps */); + return ts.createTry(ts.createBlock([ + ts.restoreEnclosingLabel(forStatement, outermostLabeledStatement, convertedLoopState && resetLabel) + ]), ts.createCatchClause(ts.createVariableDeclaration(catchVariable), ts.setEmitFlags(ts.createBlock([ + ts.createStatement(ts.createAssignment(errorRecord, ts.createObjectLiteral([ + ts.createPropertyAssignment("error", catchVariable) + ]))) + ]), 1 /* SingleLine */)), ts.createBlock([ + ts.createTry( + /*tryBlock*/ ts.createBlock([ + ts.setEmitFlags(ts.createIf(ts.createLogicalAnd(ts.createLogicalAnd(result, ts.createLogicalNot(ts.createPropertyAccess(result, "done"))), ts.createAssignment(returnMethod, ts.createPropertyAccess(iterator, "return"))), ts.createStatement(ts.createFunctionCall(returnMethod, iterator, []))), 1 /* SingleLine */), + ]), + /*catchClause*/ undefined, + /*finallyBlock*/ ts.setEmitFlags(ts.createBlock([ + ts.setEmitFlags(ts.createIf(errorRecord, ts.createThrow(ts.createPropertyAccess(errorRecord, "error"))), 1 /* SingleLine */) + ]), 1 /* SingleLine */)) + ])); } /** * Visits an ObjectLiteralExpression with computed propety names. @@ -50621,31 +54722,39 @@ var ts; // Find the first computed property. // Everything until that point can be emitted as part of the initial object literal. var numInitialProperties = numProperties; + var numInitialPropertiesWithoutYield = numProperties; for (var i = 0; i < numProperties; i++) { var property = properties[i]; - if (property.transformFlags & 16777216 /* ContainsYield */ - || property.name.kind === 142 /* ComputedPropertyName */) { + if ((property.transformFlags & 16777216 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */) + && i < numInitialPropertiesWithoutYield) { + numInitialPropertiesWithoutYield = i; + } + if (property.name.kind === 143 /* ComputedPropertyName */) { numInitialProperties = i; break; } } - ts.Debug.assert(numInitialProperties !== numProperties); - // For computed properties, we need to create a unique handle to the object - // literal so we can modify it without risking internal assignments tainting the object. - var temp = ts.createTempVariable(hoistVariableDeclaration); - // Write out the first non-computed properties, then emit the rest through indexing on the temp variable. - var expressions = []; - var assignment = ts.createAssignment(temp, ts.setEmitFlags(ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), - /*location*/ undefined, node.multiLine), 32768 /* Indented */)); - if (node.multiLine) { - assignment.startsOnNewLine = true; + if (numInitialProperties !== numProperties) { + if (numInitialPropertiesWithoutYield < numInitialProperties) { + numInitialProperties = numInitialPropertiesWithoutYield; + } + // For computed properties, we need to create a unique handle to the object + // literal so we can modify it without risking internal assignments tainting the object. + var temp = ts.createTempVariable(hoistVariableDeclaration); + // Write out the first non-computed properties, then emit the rest through indexing on the temp variable. + var expressions = []; + var assignment = ts.createAssignment(temp, ts.setEmitFlags(ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), node.multiLine), 32768 /* Indented */)); + if (node.multiLine) { + assignment.startsOnNewLine = true; + } + expressions.push(assignment); + addObjectLiteralMembers(expressions, node, temp, numInitialProperties); + // We need to clone the temporary identifier so that we can write it on a + // new line + expressions.push(node.multiLine ? ts.startOnNewLine(ts.getMutableClone(temp)) : temp); + return ts.inlineExpressions(expressions); } - expressions.push(assignment); - addObjectLiteralMembers(expressions, node, temp, numInitialProperties); - // We need to clone the temporary identifier so that we can write it on a - // new line - expressions.push(node.multiLine ? ts.startOnNewLine(ts.getMutableClone(temp)) : temp); - return ts.inlineExpressions(expressions); + return ts.visitEachChild(node, visitor, context); } function shouldConvertIterationStatementBody(node) { return (resolver.getNodeCheckFlags(node) & 65536 /* LoopWithCapturedBlockScopedBinding */) !== 0; @@ -50672,7 +54781,7 @@ var ts; } } } - function convertIterationStatementBodyIfNecessary(node, convert) { + function convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, convert) { if (!shouldConvertIterationStatementBody(node)) { var saveAllowedNonLabeledJumps = void 0; if (convertedLoopState) { @@ -50681,7 +54790,9 @@ var ts; saveAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; convertedLoopState.allowedNonLabeledJumps = 2 /* Break */ | 4 /* Continue */; } - var result = convert ? convert(node, /*convertedLoopBodyStatements*/ undefined) : ts.visitEachChild(node, visitor, context); + var result = convert + ? convert(node, outermostLabeledStatement, /*convertedLoopBodyStatements*/ undefined) + : ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), outermostLabeledStatement, convertedLoopState && resetLabel); if (convertedLoopState) { convertedLoopState.allowedNonLabeledJumps = saveAllowedNonLabeledJumps; } @@ -50690,11 +54801,11 @@ var ts; var functionName = ts.createUniqueName("_loop"); var loopInitializer; switch (node.kind) { - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: + case 213 /* ForStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 224 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 226 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -50730,19 +54841,26 @@ var ts; convertedLoopState.hoistedLocalVariables = outerConvertedLoopState.hoistedLocalVariables; } } - var loopBody = ts.visitNode(node.statement, visitor, ts.isStatement); + startLexicalEnvironment(); + var loopBody = ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock); + var lexicalEnvironment = endLexicalEnvironment(); var currentState = convertedLoopState; convertedLoopState = outerConvertedLoopState; - if (loopOutParameters.length) { + if (loopOutParameters.length || lexicalEnvironment) { var statements_4 = ts.isBlock(loopBody) ? loopBody.statements.slice() : [loopBody]; - copyOutParameters(loopOutParameters, 1 /* ToOutParameter */, statements_4); - loopBody = ts.createBlock(statements_4, /*location*/ undefined, /*multiline*/ true); + if (loopOutParameters.length) { + copyOutParameters(loopOutParameters, 1 /* ToOutParameter */, statements_4); + } + ts.addRange(statements_4, lexicalEnvironment); + loopBody = ts.createBlock(statements_4, /*multiline*/ true); } - if (!ts.isBlock(loopBody)) { - loopBody = ts.createBlock([loopBody], /*location*/ undefined, /*multiline*/ true); + if (ts.isBlock(loopBody)) { + loopBody.multiLine = true; } - var isAsyncBlockContainingAwait = enclosingNonArrowFunction - && (ts.getEmitFlags(enclosingNonArrowFunction) & 131072 /* AsyncFunctionBody */) !== 0 + else { + loopBody = ts.createBlock([loopBody], /*multiline*/ true); + } + var isAsyncBlockContainingAwait = hierarchyFacts & 4 /* AsyncFunctionBody */ && (node.statement.transformFlags & 16777216 /* ContainsYield */) !== 0; var loopBodyFlags = 0; if (currentState.containsLexicalThis) { @@ -50825,25 +54943,22 @@ var ts; var convertedLoopBodyStatements = generateCallToConvertedLoop(functionName, loopParameters, currentState, isAsyncBlockContainingAwait); var loop; if (convert) { - loop = convert(node, convertedLoopBodyStatements); + loop = convert(node, outermostLabeledStatement, convertedLoopBodyStatements); } else { - loop = ts.getMutableClone(node); + var clone_4 = ts.getMutableClone(node); // clean statement part - loop.statement = undefined; + clone_4.statement = undefined; // visit childnodes to transform initializer/condition/incrementor parts - loop = ts.visitEachChild(loop, visitor, context); + clone_4 = ts.visitEachChild(clone_4, visitor, context); // set loop statement - loop.statement = ts.createBlock(convertedLoopBodyStatements, - /*location*/ undefined, - /*multiline*/ true); + clone_4.statement = ts.createBlock(convertedLoopBodyStatements, /*multiline*/ true); // reset and re-aggregate the transform flags - loop.transformFlags = 0; - ts.aggregateTransformFlags(loop); + clone_4.transformFlags = 0; + ts.aggregateTransformFlags(clone_4); + loop = ts.restoreEnclosingLabel(clone_4, outermostLabeledStatement, convertedLoopState && resetLabel); } - statements.push(currentParent.kind === 219 /* LabeledStatement */ - ? ts.createLabel(currentParent.label, loop) - : loop); + statements.push(loop); return statements; } function copyOutParameter(outParam, copyDirection) { @@ -50867,7 +54982,9 @@ var ts; !state.labeledNonLocalBreaks && !state.labeledNonLocalContinues; var call = ts.createCall(loopFunctionExpressionName, /*typeArguments*/ undefined, ts.map(parameters, function (p) { return p.name; })); - var callResult = isAsyncBlockContainingAwait ? ts.createYield(ts.createToken(38 /* AsteriskToken */), call) : call; + var callResult = isAsyncBlockContainingAwait + ? ts.createYield(ts.createToken(38 /* AsteriskToken */), ts.setEmitFlags(call, 4194304 /* Iterator */)) + : call; if (isSimpleLoop) { statements.push(ts.createStatement(callResult)); copyOutParameters(state.loopOutParameters, 0 /* ToOriginal */, statements); @@ -50906,26 +55023,25 @@ var ts; if (!state.labeledNonLocalBreaks) { state.labeledNonLocalBreaks = ts.createMap(); } - state.labeledNonLocalBreaks[labelText] = labelMarker; + state.labeledNonLocalBreaks.set(labelText, labelMarker); } else { if (!state.labeledNonLocalContinues) { state.labeledNonLocalContinues = ts.createMap(); } - state.labeledNonLocalContinues[labelText] = labelMarker; + state.labeledNonLocalContinues.set(labelText, labelMarker); } } function processLabeledJumps(table, isBreak, loopResultName, outerLoop, caseClauses) { if (!table) { return; } - for (var labelText in table) { - var labelMarker = table[labelText]; + table.forEach(function (labelMarker, labelText) { var statements = []; // if there are no outer converted loop or outer label in question is located inside outer converted loop // then emit labeled break\continue // otherwise propagate pair 'label -> marker' to outer converted loop and emit 'return labelMarker' so outer loop can later decide what to do - if (!outerLoop || (outerLoop.labels && outerLoop.labels[labelText])) { + if (!outerLoop || (outerLoop.labels && outerLoop.labels.get(labelText))) { var label = ts.createIdentifier(labelText); statements.push(isBreak ? ts.createBreak(label) : ts.createContinue(label)); } @@ -50934,7 +55050,7 @@ var ts; statements.push(ts.createReturn(loopResultName)); } caseClauses.push(ts.createCaseClause(ts.createLiteral(labelMarker), statements)); - } + }); } function processLoopVariableDeclaration(decl, loopParameters, loopOutParameters) { var name = decl.name; @@ -50949,7 +55065,7 @@ var ts; else { loopParameters.push(ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, name)); if (resolver.getNodeCheckFlags(decl) & 2097152 /* NeedsLoopOutParameter */) { - var outParamName = ts.createUniqueName("out_" + name.text); + var outParamName = ts.createUniqueName("out_" + ts.unescapeIdentifier(name.text)); loopOutParameters.push({ originalName: name, outParamName: outParamName }); } } @@ -50969,22 +55085,22 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { - expressions.push(transformAccessorsToExpression(receiver, accessors, node.multiLine)); + expressions.push(transformAccessorsToExpression(receiver, accessors, node, node.multiLine)); } break; - case 257 /* PropertyAssignment */: + case 150 /* MethodDeclaration */: + expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); + break; + case 260 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 258 /* ShorthandPropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 149 /* MethodDeclaration */: - expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node.multiLine)); - break; default: ts.Debug.failBadSyntaxKind(node); break; @@ -50999,8 +55115,8 @@ var ts; * @param receiver The receiver for the assignment. */ function transformPropertyAssignmentToExpression(property, receiver, startsOnNewLine) { - var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.visitNode(property.initializer, visitor, ts.isExpression), - /*location*/ property); + var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.visitNode(property.initializer, visitor, ts.isExpression)); + ts.setTextRange(expression, property); if (startsOnNewLine) { expression.startsOnNewLine = true; } @@ -51014,8 +55130,8 @@ var ts; * @param receiver The receiver for the assignment. */ function transformShorthandPropertyAssignmentToExpression(property, receiver, startsOnNewLine) { - var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.getSynthesizedClone(property.name), - /*location*/ property); + var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.getSynthesizedClone(property.name)); + ts.setTextRange(expression, property); if (startsOnNewLine) { expression.startsOnNewLine = true; } @@ -51028,22 +55144,34 @@ var ts; * @param method The MethodDeclaration node. * @param receiver The receiver for the assignment. */ - function transformObjectLiteralMethodDeclarationToExpression(method, receiver, startsOnNewLine) { - var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(method.name, visitor, ts.isPropertyName)), transformFunctionLikeToExpression(method, /*location*/ method, /*name*/ undefined), - /*location*/ method); + function transformObjectLiteralMethodDeclarationToExpression(method, receiver, container, startsOnNewLine) { + var ancestorFacts = enterSubtree(0 /* None */, 0 /* None */); + var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(method.name, visitor, ts.isPropertyName)), transformFunctionLikeToExpression(method, /*location*/ method, /*name*/ undefined, container)); + ts.setTextRange(expression, method); if (startsOnNewLine) { expression.startsOnNewLine = true; } + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, hierarchyFacts & 49152 /* PropagateNewTargetMask */ ? 16384 /* NewTarget */ : 0 /* None */); return expression; } function visitCatchClause(node) { - ts.Debug.assert(ts.isBindingPattern(node.variableDeclaration.name)); - var temp = ts.createTempVariable(undefined); - var newVariableDeclaration = ts.createVariableDeclaration(temp, undefined, undefined, node.variableDeclaration); - var vars = ts.flattenDestructuringBinding(node.variableDeclaration, visitor, context, 0 /* All */, temp); - var list = ts.createVariableDeclarationList(vars, /*location*/ node.variableDeclaration, /*flags*/ node.variableDeclaration.flags); - var destructure = ts.createVariableStatement(undefined, list); - return ts.updateCatchClause(node, newVariableDeclaration, addStatementToStartOfBlock(node.block, destructure)); + var ancestorFacts = enterSubtree(4032 /* BlockScopeExcludes */, 0 /* BlockScopeIncludes */); + var updated; + if (ts.isBindingPattern(node.variableDeclaration.name)) { + var temp = ts.createTempVariable(/*recordTempVariable*/ undefined); + var newVariableDeclaration = ts.createVariableDeclaration(temp); + ts.setTextRange(newVariableDeclaration, node.variableDeclaration); + var vars = ts.flattenDestructuringBinding(node.variableDeclaration, visitor, context, 0 /* All */, temp); + var list = ts.createVariableDeclarationList(vars); + ts.setTextRange(list, node.variableDeclaration); + var destructure = ts.createVariableStatement(/*modifiers*/ undefined, list); + updated = ts.updateCatchClause(node, newVariableDeclaration, addStatementToStartOfBlock(node.block, destructure)); + } + else { + updated = ts.visitEachChild(node, visitor, context); + } + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return updated; } function addStatementToStartOfBlock(block, statement) { var transformedStatements = ts.visitNodes(block.statements, visitor, ts.isStatement); @@ -51060,20 +55188,41 @@ var ts; // Methods on classes are handled in visitClassDeclaration/visitClassExpression. // Methods with computed property names are handled in visitObjectLiteralExpression. ts.Debug.assert(!ts.isComputedPropertyName(node.name)); - var functionExpression = transformFunctionLikeToExpression(node, /*location*/ ts.moveRangePos(node, -1), /*name*/ undefined); + var functionExpression = transformFunctionLikeToExpression(node, /*location*/ ts.moveRangePos(node, -1), /*name*/ undefined, /*container*/ undefined); ts.setEmitFlags(functionExpression, 512 /* NoLeadingComments */ | ts.getEmitFlags(functionExpression)); - return ts.createPropertyAssignment(node.name, functionExpression, + return ts.setTextRange(ts.createPropertyAssignment(node.name, functionExpression), /*location*/ node); } + /** + * Visits an AccessorDeclaration of an ObjectLiteralExpression. + * + * @param node An AccessorDeclaration node. + */ + function visitAccessorDeclaration(node) { + ts.Debug.assert(!ts.isComputedPropertyName(node.name)); + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = undefined; + var ancestorFacts = enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); + var updated = ts.visitEachChild(node, visitor, context); + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, 0 /* None */); + convertedLoopState = savedConvertedLoopState; + return updated; + } /** * Visits a ShorthandPropertyAssignment and transforms it into a PropertyAssignment. * * @param node A ShorthandPropertyAssignment node. */ function visitShorthandPropertyAssignment(node) { - return ts.createPropertyAssignment(node.name, ts.getSynthesizedClone(node.name), + return ts.setTextRange(ts.createPropertyAssignment(node.name, ts.getSynthesizedClone(node.name)), /*location*/ node); } + function visitComputedPropertyName(node) { + var ancestorFacts = enterSubtree(0 /* ComputedPropertyNameExcludes */, 8192 /* ComputedPropertyNameIncludes */); + var updated = ts.visitEachChild(node, visitor, context); + exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, hierarchyFacts & 49152 /* PropagateNewTargetMask */ ? 32768 /* NewTargetInComputedPropertyName */ : 0 /* None */); + return updated; + } /** * Visits a YieldExpression node. * @@ -51089,8 +55238,11 @@ var ts; * @param node An ArrayLiteralExpression node. */ function visitArrayLiteralExpression(node) { - // We are here because we contain a SpreadElementExpression. - return transformAndSpreadElements(node.elements, /*needsUniqueCopy*/ true, node.multiLine, /*hasTrailingComma*/ node.elements.hasTrailingComma); + if (node.transformFlags & 64 /* ES2015 */) { + // We are here because we contain a SpreadElementExpression. + return transformAndSpreadElements(node.elements, /*needsUniqueCopy*/ true, node.multiLine, /*hasTrailingComma*/ node.elements.hasTrailingComma); + } + return ts.visitEachChild(node, visitor, context); } /** * Visits a CallExpression that contains either a spread element or `super`. @@ -51098,7 +55250,11 @@ var ts; * @param node a CallExpression. */ function visitCallExpression(node) { - return visitCallExpressionWithPotentialCapturedThisAssignment(node, /*assignToCapturedThis*/ true); + if (node.transformFlags & 64 /* ES2015 */) { + return visitCallExpressionWithPotentialCapturedThisAssignment(node, /*assignToCapturedThis*/ true); + } + return ts.updateCall(node, ts.visitNode(node.expression, callExpressionVisitor, ts.isExpression), + /*typeArguments*/ undefined, ts.visitNodes(node.arguments, visitor, ts.isExpression)); } function visitImmediateSuperCallInBody(node) { return visitCallExpressionWithPotentialCapturedThisAssignment(node, /*assignToCapturedThis*/ false); @@ -51125,7 +55281,7 @@ var ts; // _super.apply(this, a.concat([b])) // _super.m.apply(this, a.concat([b])) // _super.prototype.m.apply(this, a.concat([b])) - resultingCall = ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)); + resultingCall = ts.createFunctionApply(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)); } else { // [source] @@ -51137,18 +55293,18 @@ var ts; // _super.call(this, a) // _super.m.call(this, a) // _super.prototype.m.call(this, a) - resultingCall = ts.createFunctionCall(ts.visitNode(target, visitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), + resultingCall = ts.createFunctionCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), /*location*/ node); } if (node.expression.kind === 96 /* SuperKeyword */) { var actualThis = ts.createThis(); ts.setEmitFlags(actualThis, 4 /* NoSubstitution */); var initializer = ts.createLogicalOr(resultingCall, actualThis); - return assignToCapturedThis + resultingCall = assignToCapturedThis ? ts.createAssignment(ts.createIdentifier("_this"), initializer) : initializer; } - return resultingCall; + return ts.setOriginalNode(resultingCall, node); } /** * Visits a NewExpression that contains a spread element. @@ -51156,16 +55312,18 @@ var ts; * @param node A NewExpression node. */ function visitNewExpression(node) { - // We are here because we contain a SpreadElementExpression. - ts.Debug.assert((node.transformFlags & 524288 /* ContainsSpread */) !== 0); - // [source] - // new C(...a) - // - // [output] - // new ((_a = C).bind.apply(_a, [void 0].concat(a)))() - var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; - return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray([ts.createVoidZero()].concat(node.arguments)), /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)), - /*typeArguments*/ undefined, []); + if (node.transformFlags & 524288 /* ContainsSpread */) { + // We are here because we contain a SpreadElementExpression. + // [source] + // new C(...a) + // + // [output] + // new ((_a = C).bind.apply(_a, [void 0].concat(a)))() + var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; + return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray([ts.createVoidZero()].concat(node.arguments)), /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)), + /*typeArguments*/ undefined, []); + } + return ts.visitEachChild(node, visitor, context); } /** * Transforms an array of Expression nodes that contains a SpreadExpression. @@ -51186,14 +55344,28 @@ var ts; var segments = ts.flatten(ts.spanMap(elements, partitionSpread, function (partition, visitPartition, _start, end) { return visitPartition(partition, multiLine, hasTrailingComma && end === numElements); })); - if (segments.length === 1) { - var firstElement = elements[0]; - return needsUniqueCopy && ts.isSpreadExpression(firstElement) && firstElement.expression.kind !== 175 /* ArrayLiteralExpression */ - ? ts.createArraySlice(segments[0]) - : segments[0]; + if (compilerOptions.downlevelIteration) { + if (segments.length === 1) { + var firstSegment = segments[0]; + if (ts.isCallExpression(firstSegment) + && ts.isIdentifier(firstSegment.expression) + && (ts.getEmitFlags(firstSegment.expression) & 4096 /* HelperName */) + && firstSegment.expression.text === "___spread") { + return segments[0]; + } + } + return ts.createSpreadHelper(context, segments); + } + else { + if (segments.length === 1) { + var firstElement = elements[0]; + return needsUniqueCopy && ts.isSpreadExpression(firstElement) && firstElement.expression.kind !== 176 /* ArrayLiteralExpression */ + ? ts.createArraySlice(segments[0]) + : segments[0]; + } + // Rewrite using the pattern .concat(, , ...) + return ts.createArrayConcat(segments.shift(), segments); } - // Rewrite using the pattern .concat(, , ...) - return ts.createArrayConcat(segments.shift(), segments); } function partitionSpread(node) { return ts.isSpreadExpression(node) @@ -51204,8 +55376,7 @@ var ts; return ts.map(chunk, visitExpressionOfSpread); } function visitSpanOfNonSpreads(chunk, multiLine, hasTrailingComma) { - return ts.createArrayLiteral(ts.visitNodes(ts.createNodeArray(chunk, /*location*/ undefined, hasTrailingComma), visitor, ts.isExpression), - /*location*/ undefined, multiLine); + return ts.createArrayLiteral(ts.visitNodes(ts.createNodeArray(chunk, hasTrailingComma), visitor, ts.isExpression), multiLine); } function visitSpreadElement(node) { return ts.visitNode(node.expression, visitor, ts.isExpression); @@ -51224,7 +55395,29 @@ var ts; * @param node A template literal. */ function visitTemplateLiteral(node) { - return ts.createLiteral(node.text, /*location*/ node); + return ts.setTextRange(ts.createLiteral(node.text), node); + } + /** + * Visits a string literal with an extended unicode escape. + * + * @param node A string literal. + */ + function visitStringLiteral(node) { + if (node.hasExtendedUnicodeEscape) { + return ts.setTextRange(ts.createLiteral(node.text), node); + } + return node; + } + /** + * Visits a binary or octal (ES6) numeric literal. + * + * @param node A string literal. + */ + function visitNumericLiteral(node) { + if (node.numericLiteralFlags & 48 /* BinaryOrOctalSpecifier */) { + return ts.setTextRange(ts.createNumericLiteral(node.text), node); + } + return node; } /** * Visits a TaggedTemplateExpression node. @@ -51284,7 +55477,7 @@ var ts; // ES6 Spec 11.8.6.1 - Static Semantics of TV's and TRV's // and LineTerminatorSequences are normalized to for both TV and TRV. text = text.replace(/\r\n?/g, "\n"); - return ts.createLiteral(text, /*location*/ node); + return ts.setTextRange(ts.createLiteral(text), node); } /** * Visits a TemplateExpression node. @@ -51306,7 +55499,8 @@ var ts; // "abc" + (1 << 2) + "" var expression = ts.reduceLeft(expressions, ts.createAdd); if (ts.nodeIsSynthesized(expression)) { - ts.setTextRange(expression, node); + expression.pos = node.pos; + expression.end = node.end; } return expression; } @@ -51368,27 +55562,42 @@ var ts; /** * Visits the `super` keyword */ - function visitSuperKeyword() { - return enclosingNonAsyncFunctionBody - && ts.isClassElement(enclosingNonAsyncFunctionBody) - && !ts.hasModifier(enclosingNonAsyncFunctionBody, 32 /* Static */) - && currentParent.kind !== 179 /* CallExpression */ + function visitSuperKeyword(isExpressionOfCall) { + return hierarchyFacts & 8 /* NonStaticClassElement */ + && !isExpressionOfCall ? ts.createPropertyAccess(ts.createIdentifier("_super"), "prototype") : ts.createIdentifier("_super"); } + function visitMetaProperty(node) { + if (node.keywordToken === 93 /* NewKeyword */ && node.name.text === "target") { + if (hierarchyFacts & 8192 /* ComputedPropertyName */) { + hierarchyFacts |= 32768 /* NewTargetInComputedPropertyName */; + } + else { + hierarchyFacts |= 16384 /* NewTarget */; + } + return ts.createIdentifier("_newTarget"); + } + return node; + } /** * Called by the printer just before a node is printed. * + * @param hint A hint as to the intended usage of the node. * @param node The node to be printed. + * @param emitCallback The callback used to emit the node. */ - function onEmitNode(emitContext, node, emitCallback) { - var savedEnclosingFunction = enclosingFunction; + function onEmitNode(hint, node, emitCallback) { if (enabledSubstitutions & 1 /* CapturedThis */ && ts.isFunctionLike(node)) { // If we are tracking a captured `this`, keep track of the enclosing function. - enclosingFunction = node; + var ancestorFacts = enterSubtree(16286 /* FunctionExcludes */, ts.getEmitFlags(node) & 8 /* CapturesThis */ + ? 65 /* FunctionIncludes */ | 16 /* CapturesThis */ + : 65 /* FunctionIncludes */); + previousOnEmitNode(hint, node, emitCallback); + exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); + return; } - previousOnEmitNode(emitContext, node, emitCallback); - enclosingFunction = savedEnclosingFunction; + previousOnEmitNode(hint, node, emitCallback); } /** * Enables a more costly code path for substitutions when we determine a source file @@ -51408,24 +55617,24 @@ var ts; if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(98 /* ThisKeyword */); - context.enableEmitNotification(150 /* Constructor */); - context.enableEmitNotification(149 /* MethodDeclaration */); - context.enableEmitNotification(151 /* GetAccessor */); - context.enableEmitNotification(152 /* SetAccessor */); - context.enableEmitNotification(185 /* ArrowFunction */); - context.enableEmitNotification(184 /* FunctionExpression */); - context.enableEmitNotification(225 /* FunctionDeclaration */); + context.enableEmitNotification(151 /* Constructor */); + context.enableEmitNotification(150 /* MethodDeclaration */); + context.enableEmitNotification(152 /* GetAccessor */); + context.enableEmitNotification(153 /* SetAccessor */); + context.enableEmitNotification(186 /* ArrowFunction */); + context.enableEmitNotification(185 /* FunctionExpression */); + context.enableEmitNotification(227 /* FunctionDeclaration */); } } /** * Hooks node substitutions. * - * @param emitContext The context for the emitter. + * @param hint The context for the emitter. * @param node The node to substitute. */ - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1 /* Expression */) { + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 /* Expression */) { return substituteExpression(node); } if (ts.isIdentifier(node)) { @@ -51442,7 +55651,7 @@ var ts; if (enabledSubstitutions & 2 /* BlockScopedBindings */) { var original = ts.getParseTreeNode(node, ts.isIdentifier); if (original && isNameOfDeclarationWithCollidingName(original)) { - return ts.getGeneratedNameForNode(original); + return ts.setTextRange(ts.getGeneratedNameForNode(original), node); } } return node; @@ -51456,10 +55665,10 @@ var ts; function isNameOfDeclarationWithCollidingName(node) { var parent = node.parent; switch (parent.kind) { - case 174 /* BindingElement */: - case 226 /* ClassDeclaration */: - case 229 /* EnumDeclaration */: - case 223 /* VariableDeclaration */: + case 175 /* BindingElement */: + case 228 /* ClassDeclaration */: + case 231 /* EnumDeclaration */: + case 225 /* VariableDeclaration */: return parent.name === node && resolver.isDeclarationWithCollidingName(parent); } @@ -51488,7 +55697,7 @@ var ts; if (enabledSubstitutions & 2 /* BlockScopedBindings */) { var declaration = resolver.getReferencedDeclarationWithCollidingName(node); if (declaration) { - return ts.getGeneratedNameForNode(declaration.name); + return ts.setTextRange(ts.getGeneratedNameForNode(declaration.name), node); } } return node; @@ -51500,9 +55709,8 @@ var ts; */ function substituteThisKeyword(node) { if (enabledSubstitutions & 1 /* CapturedThis */ - && enclosingFunction - && ts.getEmitFlags(enclosingFunction) & 8 /* CapturesThis */) { - return ts.createIdentifier("_this", /*location*/ node); + && hierarchyFacts & 16 /* CapturesThis */) { + return ts.setTextRange(ts.createIdentifier("_this"), node); } return node; } @@ -51518,11 +55726,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 207 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 209 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 179 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 180 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; @@ -51530,7 +55738,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 196 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 197 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -51550,11 +55758,123 @@ var ts; name: "typescript:extends", scoped: false, priority: 0, - text: "\n var __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };" + text: "\n var __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n })();" }; })(ts || (ts = {})); /// /// +/*@internal*/ +var ts; +(function (ts) { + /** + * Transforms ES5 syntax into ES3 syntax. + * + * @param context Context and state information for the transformation. + */ + function transformES5(context) { + var compilerOptions = context.getCompilerOptions(); + // enable emit notification only if using --jsx preserve or react-native + var previousOnEmitNode; + var noSubstitution; + if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { + previousOnEmitNode = context.onEmitNode; + context.onEmitNode = onEmitNode; + context.enableEmitNotification(250 /* JsxOpeningElement */); + context.enableEmitNotification(251 /* JsxClosingElement */); + context.enableEmitNotification(249 /* JsxSelfClosingElement */); + noSubstitution = []; + } + var previousOnSubstituteNode = context.onSubstituteNode; + context.onSubstituteNode = onSubstituteNode; + context.enableSubstitution(178 /* PropertyAccessExpression */); + context.enableSubstitution(260 /* PropertyAssignment */); + return transformSourceFile; + /** + * Transforms an ES5 source file to ES3. + * + * @param node A SourceFile + */ + function transformSourceFile(node) { + return node; + } + /** + * Called by the printer just before a node is printed. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to emit. + * @param emitCallback A callback used to emit the node. + */ + function onEmitNode(hint, node, emitCallback) { + switch (node.kind) { + case 250 /* JsxOpeningElement */: + case 251 /* JsxClosingElement */: + case 249 /* JsxSelfClosingElement */: + var tagName = node.tagName; + noSubstitution[ts.getOriginalNodeId(tagName)] = true; + break; + } + previousOnEmitNode(hint, node, emitCallback); + } + /** + * Hooks node substitutions. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to substitute. + */ + function onSubstituteNode(hint, node) { + if (node.id && noSubstitution && noSubstitution[node.id]) { + return previousOnSubstituteNode(hint, node); + } + node = previousOnSubstituteNode(hint, node); + if (ts.isPropertyAccessExpression(node)) { + return substitutePropertyAccessExpression(node); + } + else if (ts.isPropertyAssignment(node)) { + return substitutePropertyAssignment(node); + } + return node; + } + /** + * Substitutes a PropertyAccessExpression whose name is a reserved word. + * + * @param node A PropertyAccessExpression + */ + function substitutePropertyAccessExpression(node) { + var literalName = trySubstituteReservedName(node.name); + if (literalName) { + return ts.setTextRange(ts.createElementAccess(node.expression, literalName), node); + } + return node; + } + /** + * Substitutes a PropertyAssignment whose name is a reserved word. + * + * @param node A PropertyAssignment + */ + function substitutePropertyAssignment(node) { + var literalName = ts.isIdentifier(node.name) && trySubstituteReservedName(node.name); + if (literalName) { + return ts.updatePropertyAssignment(node, literalName, node.initializer); + } + return node; + } + /** + * If an identifier name is a reserved word, returns a string literal for the name. + * + * @param name An Identifier + */ + function trySubstituteReservedName(name) { + var token = name.originalKeywordKind || (ts.nodeIsSynthesized(name) ? ts.stringToToken(name.text) : undefined); + if (token >= 71 /* FirstReservedWord */ && token <= 106 /* LastReservedWord */) { + return ts.setTextRange(ts.createLiteral(name), name); + } + return undefined; + } + } + ts.transformES5 = transformES5; +})(ts || (ts = {})); +/// +/// // Transforms generator functions into a compatible ES5 representation with similar runtime // semantics. This is accomplished by first transforming the body of each generator // function into an intermediate representation that is the compiled into a JavaScript @@ -51725,13 +56045,15 @@ var ts; Instruction[Instruction["Catch"] = 6] = "Catch"; Instruction[Instruction["Endfinally"] = 7] = "Endfinally"; })(Instruction || (Instruction = {})); - var instructionNames = ts.createMap((_a = {}, - _a[2 /* Return */] = "return", - _a[3 /* Break */] = "break", - _a[4 /* Yield */] = "yield", - _a[5 /* YieldStar */] = "yield*", - _a[7 /* Endfinally */] = "endfinally", - _a)); + function getInstructionName(instruction) { + switch (instruction) { + case 2 /* Return */: return "return"; + case 3 /* Break */: return "break"; + case 4 /* Yield */: return "yield"; + case 5 /* YieldStar */: return "yield*"; + case 7 /* Endfinally */: return "endfinally"; + } + } function transformGenerators(context) { var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistFunctionDeclaration = context.hoistFunctionDeclaration, hoistVariableDeclaration = context.hoistVariableDeclaration; var compilerOptions = context.getCompilerOptions(); @@ -51823,13 +56145,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 209 /* DoStatement */: + case 211 /* DoStatement */: return visitDoStatement(node); - case 210 /* WhileStatement */: + case 212 /* WhileStatement */: return visitWhileStatement(node); - case 218 /* SwitchStatement */: + case 220 /* SwitchStatement */: return visitSwitchStatement(node); - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -51842,24 +56164,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 184 /* FunctionExpression */: + case 185 /* FunctionExpression */: return visitFunctionExpression(node); - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: return visitAccessorDeclaration(node); - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: return visitVariableStatement(node); - case 211 /* ForStatement */: + case 213 /* ForStatement */: return visitForStatement(node); - case 212 /* ForInStatement */: + case 214 /* ForInStatement */: return visitForInStatement(node); - case 215 /* BreakStatement */: + case 217 /* BreakStatement */: return visitBreakStatement(node); - case 214 /* ContinueStatement */: + case 216 /* ContinueStatement */: return visitContinueStatement(node); - case 216 /* ReturnStatement */: + case 218 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 16777216 /* ContainsYield */) { @@ -51880,21 +56202,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return visitBinaryExpression(node); - case 193 /* ConditionalExpression */: + case 194 /* ConditionalExpression */: return visitConditionalExpression(node); - case 195 /* YieldExpression */: + case 196 /* YieldExpression */: return visitYieldExpression(node); - case 175 /* ArrayLiteralExpression */: + case 176 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 176 /* ObjectLiteralExpression */: + case 177 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 178 /* ElementAccessExpression */: + case 179 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 179 /* CallExpression */: + case 180 /* CallExpression */: return visitCallExpression(node); - case 180 /* NewExpression */: + case 181 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -51907,9 +56229,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 184 /* FunctionExpression */: + case 185 /* FunctionExpression */: return visitFunctionExpression(node); default: ts.Debug.failBadSyntaxKind(node); @@ -51927,12 +56249,12 @@ var ts; */ function visitFunctionDeclaration(node) { // Currently, we only support generators that were originally async functions. - if (node.asteriskToken && ts.getEmitFlags(node) & 131072 /* AsyncFunctionBody */) { - node = ts.setOriginalNode(ts.createFunctionDeclaration( + if (node.asteriskToken) { + node = ts.setOriginalNode(ts.setTextRange(ts.createFunctionDeclaration( /*decorators*/ undefined, node.modifiers, /*asteriskToken*/ undefined, node.name, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, transformGeneratorFunctionBody(node.body), + /*type*/ undefined, transformGeneratorFunctionBody(node.body)), /*location*/ node), node); } else { @@ -51965,12 +56287,12 @@ var ts; */ function visitFunctionExpression(node) { // Currently, we only support generators that were originally async functions. - if (node.asteriskToken && ts.getEmitFlags(node) & 131072 /* AsyncFunctionBody */) { - node = ts.setOriginalNode(ts.createFunctionExpression( + if (node.asteriskToken) { + node = ts.setOriginalNode(ts.setTextRange(ts.createFunctionExpression( /*modifiers*/ undefined, /*asteriskToken*/ undefined, node.name, /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), - /*type*/ undefined, transformGeneratorFunctionBody(node.body), + /*type*/ undefined, transformGeneratorFunctionBody(node.body)), /*location*/ node), node); } else { @@ -52039,7 +56361,7 @@ var ts; state = ts.createTempVariable(/*recordTempVariable*/ undefined); // Build the generator resumeLexicalEnvironment(); - var statementOffset = ts.addPrologueDirectives(statements, body.statements, /*ensureUseStrict*/ false, visitor); + var statementOffset = ts.addPrologue(statements, body.statements, /*ensureUseStrict*/ false, visitor); transformAndEmitStatements(body.statements, statementOffset); var buildResult = build(); ts.addRange(statements, endLexicalEnvironment()); @@ -52058,7 +56380,7 @@ var ts; operationArguments = savedOperationArguments; operationLocations = savedOperationLocations; state = savedState; - return ts.createBlock(statements, /*location*/ body, body.multiLine); + return ts.setTextRange(ts.createBlock(statements, body.multiLine), body); } /** * Visits a variable statement. @@ -52137,7 +56459,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 177 /* PropertyAccessExpression */: + case 178 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -52149,7 +56471,7 @@ var ts; // _a.b = %sent%; target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 178 /* ElementAccessExpression */: + case 179 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -52168,7 +56490,7 @@ var ts; } var operator = node.operatorToken.kind; if (isCompoundAssignment(operator)) { - return ts.createBinary(target, 57 /* EqualsToken */, ts.createBinary(cacheExpression(target), getOperatorForCompoundAssignment(operator), ts.visitNode(right, visitor, ts.isExpression), node), node); + return ts.setTextRange(ts.createAssignment(target, ts.setTextRange(ts.createBinary(cacheExpression(target), getOperatorForCompoundAssignment(operator), ts.visitNode(right, visitor, ts.isExpression)), node)), node); } else { return ts.updateBinary(node, target, ts.visitNode(right, visitor, ts.isExpression)); @@ -52192,10 +56514,10 @@ var ts; // _a = a(); // .yield resumeLabel // _a + %sent% + c() - var clone_4 = ts.getMutableClone(node); - clone_4.left = cacheExpression(ts.visitNode(node.left, visitor, ts.isExpression)); - clone_4.right = ts.visitNode(node.right, visitor, ts.isExpression); - return clone_4; + var clone_5 = ts.getMutableClone(node); + clone_5.left = cacheExpression(ts.visitNode(node.left, visitor, ts.isExpression)); + clone_5.right = ts.visitNode(node.right, visitor, ts.isExpression); + return clone_5; } return ts.visitEachChild(node, visitor, context); } @@ -52330,17 +56652,19 @@ var ts; // .yield resumeLabel, (a()) // .mark resumeLabel // x = %sent%; - // NOTE: we are explicitly not handling YieldStar at this time. var resumeLabel = defineLabel(); var expression = ts.visitNode(node.expression, visitor, ts.isExpression); if (node.asteriskToken) { - emitYieldStar(expression, /*location*/ node); + var iterator = (ts.getEmitFlags(node.expression) & 4194304 /* Iterator */) === 0 + ? ts.createValuesHelper(context, expression, /*location*/ node) + : expression; + emitYieldStar(iterator, /*location*/ node); } else { emitYield(expression, /*location*/ node); } markLabel(resumeLabel); - return createGeneratorResume(); + return createGeneratorResume(/*location*/ node); } /** * Visits an ArrayLiteralExpression that contains a YieldExpression. @@ -52368,26 +56692,27 @@ var ts; // .mark resumeLabel // ar = _a.concat([%sent%, 2]); var numInitialElements = countInitialNodesWithoutYield(elements); - var temp = declareLocal(); - var hasAssignedTemp = false; + var temp; if (numInitialElements > 0) { + temp = declareLocal(); var initialElements = ts.visitNodes(elements, visitor, ts.isExpression, 0, numInitialElements); emitAssignment(temp, ts.createArrayLiteral(leadingElement ? [leadingElement].concat(initialElements) : initialElements)); leadingElement = undefined; - hasAssignedTemp = true; } var expressions = ts.reduceLeft(elements, reduceElement, [], numInitialElements); - return hasAssignedTemp - ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, /*location*/ undefined, multiLine)]) - : ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, location, multiLine); + return temp + ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)]) + : ts.setTextRange(ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine), location); function reduceElement(expressions, element) { if (containsYield(element) && expressions.length > 0) { + var hasAssignedTemp = temp !== undefined; + if (!temp) { + temp = declareLocal(); + } emitAssignment(temp, hasAssignedTemp - ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, /*location*/ undefined, multiLine)]) - : ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, - /*location*/ undefined, multiLine)); - hasAssignedTemp = true; + ? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)]) + : ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine)); leadingElement = undefined; expressions = []; } @@ -52417,8 +56742,7 @@ var ts; var multiLine = node.multiLine; var numInitialProperties = countInitialNodesWithoutYield(properties); var temp = declareLocal(); - emitAssignment(temp, ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), - /*location*/ undefined, multiLine)); + emitAssignment(temp, ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), multiLine)); var expressions = ts.reduceLeft(properties, reduceProperty, [], numInitialProperties); expressions.push(multiLine ? ts.startOnNewLine(ts.getMutableClone(temp)) : temp); return ts.inlineExpressions(expressions); @@ -52454,10 +56778,10 @@ var ts; // .yield resumeLabel // .mark resumeLabel // a = _a[%sent%] - var clone_5 = ts.getMutableClone(node); - clone_5.expression = cacheExpression(ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression)); - clone_5.argumentExpression = ts.visitNode(node.argumentExpression, visitor, ts.isExpression); - return clone_5; + var clone_6 = ts.getMutableClone(node); + clone_6.expression = cacheExpression(ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression)); + clone_6.argumentExpression = ts.visitNode(node.argumentExpression, visitor, ts.isExpression); + return clone_6; } return ts.visitEachChild(node, visitor, context); } @@ -52492,10 +56816,9 @@ var ts; // .mark resumeLabel // new (_b.apply(_a, _c.concat([%sent%, 2]))); var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; - return ts.setOriginalNode(ts.createNew(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isExpression)), thisArg, visitElements(node.arguments, + return ts.setOriginalNode(ts.setTextRange(ts.createNew(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isExpression)), thisArg, visitElements(node.arguments, /*leadingElement*/ ts.createVoidZero())), - /*typeArguments*/ undefined, [], - /*location*/ node), node); + /*typeArguments*/ undefined, []), node), node); } return ts.visitEachChild(node, visitor, context); } @@ -52524,38 +56847,38 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 204 /* Block */: + case 206 /* Block */: return transformAndEmitBlock(node); - case 207 /* ExpressionStatement */: + case 209 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 208 /* IfStatement */: + case 210 /* IfStatement */: return transformAndEmitIfStatement(node); - case 209 /* DoStatement */: + case 211 /* DoStatement */: return transformAndEmitDoStatement(node); - case 210 /* WhileStatement */: + case 212 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 211 /* ForStatement */: + case 213 /* ForStatement */: return transformAndEmitForStatement(node); - case 212 /* ForInStatement */: + case 214 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 214 /* ContinueStatement */: + case 216 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 215 /* BreakStatement */: + case 217 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 216 /* ReturnStatement */: + case 218 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 217 /* WithStatement */: + case 219 /* WithStatement */: return transformAndEmitWithStatement(node); - case 218 /* SwitchStatement */: + case 220 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 220 /* ThrowStatement */: + case 222 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 221 /* TryStatement */: + case 223 /* TryStatement */: return transformAndEmitTryStatement(node); default: - return emitStatement(ts.visitNode(node, visitor, ts.isStatement, /*optional*/ true)); + return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); } } function transformAndEmitBlock(node) { @@ -52572,7 +56895,9 @@ var ts; function transformAndEmitVariableDeclarationList(node) { for (var _i = 0, _a = node.declarations; _i < _a.length; _i++) { var variable = _a[_i]; - hoistVariableDeclaration(variable.name); + var name = ts.getSynthesizedClone(variable.name); + ts.setCommentRange(name, variable.name); + hoistVariableDeclaration(name); } var variables = ts.getInitializedVariables(node); var numVariables = variables.length; @@ -52615,7 +56940,7 @@ var ts; if (containsYield(node.thenStatement) || containsYield(node.elseStatement)) { var endLabel = defineLabel(); var elseLabel = node.elseStatement ? defineLabel() : undefined; - emitBreakWhenFalse(node.elseStatement ? elseLabel : endLabel, ts.visitNode(node.expression, visitor, ts.isExpression)); + emitBreakWhenFalse(node.elseStatement ? elseLabel : endLabel, ts.visitNode(node.expression, visitor, ts.isExpression), /*location*/ node.expression); transformAndEmitEmbeddedStatement(node.thenStatement); if (node.elseStatement) { emitBreak(endLabel); @@ -52738,8 +57063,7 @@ var ts; transformAndEmitVariableDeclarationList(initializer); } else { - emitStatement(ts.createStatement(ts.visitNode(initializer, visitor, ts.isExpression), - /*location*/ initializer)); + emitStatement(ts.setTextRange(ts.createStatement(ts.visitNode(initializer, visitor, ts.isExpression)), initializer)); } } markLabel(conditionLabel); @@ -52749,8 +57073,7 @@ var ts; transformAndEmitEmbeddedStatement(node.statement); markLabel(incrementLabel); if (node.incrementor) { - emitStatement(ts.createStatement(ts.visitNode(node.incrementor, visitor, ts.isExpression), - /*location*/ node.incrementor)); + emitStatement(ts.setTextRange(ts.createStatement(ts.visitNode(node.incrementor, visitor, ts.isExpression)), node.incrementor)); } emitBreak(conditionLabel); endLoopBlock(); @@ -52764,7 +57087,7 @@ var ts; beginScriptLoopBlock(); } var initializer = node.initializer; - if (ts.isVariableDeclarationList(initializer)) { + if (initializer && ts.isVariableDeclarationList(initializer)) { for (var _i = 0, _a = initializer.declarations; _i < _a.length; _i++) { var variable = _a[_i]; hoistVariableDeclaration(variable.name); @@ -52772,7 +57095,7 @@ var ts; var variables = ts.getInitializedVariables(initializer); node = ts.updateFor(node, variables.length > 0 ? ts.inlineExpressions(ts.map(variables, transformInitializedVariable)) - : undefined, ts.visitNode(node.condition, visitor, ts.isExpression, /*optional*/ true), ts.visitNode(node.incrementor, visitor, ts.isExpression, /*optional*/ true), ts.visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, ts.liftToBlock)); + : undefined, ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); } else { node = ts.visitEachChild(node, visitor, context); @@ -52864,7 +57187,7 @@ var ts; var variable = _a[_i]; hoistVariableDeclaration(variable.name); } - node = ts.updateForIn(node, initializer.declarations[0].name, ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, /*optional*/ false, ts.liftToBlock)); + node = ts.updateForIn(node, initializer.declarations[0].name, ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); } else { node = ts.visitEachChild(node, visitor, context); @@ -52903,11 +57226,11 @@ var ts; return ts.visitEachChild(node, visitor, context); } function transformAndEmitReturnStatement(node) { - emitReturn(ts.visitNode(node.expression, visitor, ts.isExpression, /*optional*/ true), + emitReturn(ts.visitNode(node.expression, visitor, ts.isExpression), /*location*/ node); } function visitReturnStatement(node) { - return createInlineReturn(ts.visitNode(node.expression, visitor, ts.isExpression, /*optional*/ true), + return createInlineReturn(ts.visitNode(node.expression, visitor, ts.isExpression), /*location*/ node); } function transformAndEmitWithStatement(node) { @@ -52972,7 +57295,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 254 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 257 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -52985,7 +57308,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 253 /* CaseClause */) { + if (clause.kind === 256 /* CaseClause */) { var caseClause = clause; if (containsYield(caseClause.expression) && pendingClauses.length > 0) { break; @@ -53127,9 +57450,9 @@ var ts; } return -1; } - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (emitContext === 1 /* Expression */) { + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 /* Expression */) { return substituteExpression(node); } return node; @@ -53141,17 +57464,17 @@ var ts; return node; } function substituteExpressionIdentifier(node) { - if (renamedCatchVariables && ts.hasProperty(renamedCatchVariables, node.text)) { + if (!ts.isGeneratedIdentifier(node) && renamedCatchVariables && renamedCatchVariables.has(node.text)) { var original = ts.getOriginalNode(node); if (ts.isIdentifier(original) && original.parent) { var declaration = resolver.getReferencedValueDeclaration(original); if (declaration) { - var name_36 = ts.getProperty(renamedCatchVariableDeclarations, String(ts.getOriginalNodeId(declaration))); - if (name_36) { - var clone_6 = ts.getMutableClone(name_36); - ts.setSourceMapRange(clone_6, node); - ts.setCommentRange(clone_6, node); - return clone_6; + var name = renamedCatchVariableDeclarations[ts.getOriginalNodeId(declaration)]; + if (name) { + var clone_7 = ts.getMutableClone(name); + ts.setSourceMapRange(clone_7, node); + ts.setCommentRange(clone_7, node); + return clone_7; } } } @@ -53160,7 +57483,7 @@ var ts; } function cacheExpression(node) { var temp; - if (ts.isGeneratedIdentifier(node)) { + if (ts.isGeneratedIdentifier(node) || ts.getEmitFlags(node) & 4096 /* HelperName */) { return node; } temp = ts.createTempVariable(hoistVariableDeclaration); @@ -53288,15 +57611,23 @@ var ts; */ function beginCatchBlock(variable) { ts.Debug.assert(peekBlockKind() === 0 /* Exception */); - var text = variable.name.text; - var name = declareLocal(text); - if (!renamedCatchVariables) { - renamedCatchVariables = ts.createMap(); - renamedCatchVariableDeclarations = ts.createMap(); - context.enableSubstitution(70 /* Identifier */); + // generated identifiers should already be unique within a file + var name; + if (ts.isGeneratedIdentifier(variable.name)) { + name = variable.name; + hoistVariableDeclaration(variable.name); + } + else { + var text = variable.name.text; + name = declareLocal(text); + if (!renamedCatchVariables) { + renamedCatchVariables = ts.createMap(); + renamedCatchVariableDeclarations = []; + context.enableSubstitution(70 /* Identifier */); + } + renamedCatchVariables.set(text, true); + renamedCatchVariableDeclarations[ts.getOriginalNodeId(variable)] = name; } - renamedCatchVariables[text] = true; - renamedCatchVariableDeclarations[ts.getOriginalNodeId(variable)] = name; var exception = peekBlock(); ts.Debug.assert(exception.state < 1 /* Catch */); var endLabel = exception.endLabel; @@ -53566,7 +57897,7 @@ var ts; */ function createInstruction(instruction) { var literal = ts.createLiteral(instruction); - literal.trailingComment = instructionNames[instruction]; + ts.addSyntheticTrailingComment(literal, 3 /* MultiLineCommentTrivia */, getInstructionName(instruction)); return literal; } /** @@ -53577,10 +57908,10 @@ var ts; */ function createInlineBreak(label, location) { ts.Debug.assert(label > 0, "Invalid label: " + label); - return ts.createReturn(ts.createArrayLiteral([ + return ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3 /* Break */), createLabel(label) - ]), location); + ])), location); } /** * Creates a statement that can be used indicate a Return operation. @@ -53589,15 +57920,16 @@ var ts; * @param location An optional source map location for the statement. */ function createInlineReturn(expression, location) { - return ts.createReturn(ts.createArrayLiteral(expression + return ts.setTextRange(ts.createReturn(ts.createArrayLiteral(expression ? [createInstruction(2 /* Return */), expression] - : [createInstruction(2 /* Return */)]), location); + : [createInstruction(2 /* Return */)])), location); } /** * Creates an expression that can be used to resume from a Yield operation. */ function createGeneratorResume(location) { - return ts.createCall(ts.createPropertyAccess(state, "sent"), /*typeArguments*/ undefined, [], location); + return ts.setTextRange(ts.createCall(ts.createPropertyAccess(state, "sent"), + /*typeArguments*/ undefined, []), location); } /** * Emits an empty instruction. @@ -53743,7 +58075,6 @@ var ts; /*name*/ undefined, /*typeParameters*/ undefined, [ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, state)], /*type*/ undefined, ts.createBlock(buildResult, - /*location*/ undefined, /*multiLine*/ buildResult.length > 0)), 262144 /* ReuseTempVariableScope */)); } /** @@ -54014,7 +58345,7 @@ var ts; * @param operationLocation The source map location for the operation. */ function writeAssign(left, right, operationLocation) { - writeStatement(ts.createStatement(ts.createAssignment(left, right), operationLocation)); + writeStatement(ts.setTextRange(ts.createStatement(ts.createAssignment(left, right)), operationLocation)); } /** * Writes a Throw operation to the current label's statement list. @@ -54025,7 +58356,7 @@ var ts; function writeThrow(expression, operationLocation) { lastOperationWasAbrupt = true; lastOperationWasCompletion = true; - writeStatement(ts.createThrow(expression, operationLocation)); + writeStatement(ts.setTextRange(ts.createThrow(expression), operationLocation)); } /** * Writes a Return operation to the current label's statement list. @@ -54036,9 +58367,9 @@ var ts; function writeReturn(expression, operationLocation) { lastOperationWasAbrupt = true; lastOperationWasCompletion = true; - writeStatement(ts.createReturn(ts.createArrayLiteral(expression + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral(expression ? [createInstruction(2 /* Return */), expression] - : [createInstruction(2 /* Return */)]), operationLocation)); + : [createInstruction(2 /* Return */)])), operationLocation), 384 /* NoTokenSourceMaps */)); } /** * Writes a Break operation to the current label's statement list. @@ -54048,10 +58379,10 @@ var ts; */ function writeBreak(label, operationLocation) { lastOperationWasAbrupt = true; - writeStatement(ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3 /* Break */), createLabel(label) - ]), operationLocation)); + ])), operationLocation), 384 /* NoTokenSourceMaps */)); } /** * Writes a BreakWhenTrue operation to the current label's statement list. @@ -54061,10 +58392,10 @@ var ts; * @param operationLocation The source map location for the operation. */ function writeBreakWhenTrue(label, condition, operationLocation) { - writeStatement(ts.createIf(condition, ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.createIf(condition, ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3 /* Break */), createLabel(label) - ]), operationLocation))); + ])), operationLocation), 384 /* NoTokenSourceMaps */)), 1 /* SingleLine */)); } /** * Writes a BreakWhenFalse operation to the current label's statement list. @@ -54074,10 +58405,10 @@ var ts; * @param operationLocation The source map location for the operation. */ function writeBreakWhenFalse(label, condition, operationLocation) { - writeStatement(ts.createIf(ts.createLogicalNot(condition), ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.createIf(ts.createLogicalNot(condition), ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3 /* Break */), createLabel(label) - ]), operationLocation))); + ])), operationLocation), 384 /* NoTokenSourceMaps */)), 1 /* SingleLine */)); } /** * Writes a Yield operation to the current label's statement list. @@ -54087,9 +58418,9 @@ var ts; */ function writeYield(expression, operationLocation) { lastOperationWasAbrupt = true; - writeStatement(ts.createReturn(ts.createArrayLiteral(expression + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral(expression ? [createInstruction(4 /* Yield */), expression] - : [createInstruction(4 /* Yield */)]), operationLocation)); + : [createInstruction(4 /* Yield */)])), operationLocation), 384 /* NoTokenSourceMaps */)); } /** * Writes a YieldStar instruction to the current label's statement list. @@ -54099,10 +58430,10 @@ var ts; */ function writeYieldStar(expression, operationLocation) { lastOperationWasAbrupt = true; - writeStatement(ts.createReturn(ts.createArrayLiteral([ + writeStatement(ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(5 /* YieldStar */), expression - ]), operationLocation)); + ])), operationLocation), 384 /* NoTokenSourceMaps */)); } /** * Writes an Endfinally instruction to the current label's statement list. @@ -54183,157 +58514,918 @@ var ts; name: "typescript:generator", scoped: false, priority: 6, - text: "\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;\n return { next: verb(0), \"throw\": verb(1), \"return\": verb(2) };\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [0, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };" + text: "\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [0, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };" }; - var _a; -})(ts || (ts = {})); -/// -/// -/*@internal*/ -var ts; -(function (ts) { - /** - * Transforms ES5 syntax into ES3 syntax. - * - * @param context Context and state information for the transformation. - */ - function transformES5(context) { - var previousOnSubstituteNode = context.onSubstituteNode; - context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(177 /* PropertyAccessExpression */); - context.enableSubstitution(257 /* PropertyAssignment */); - return transformSourceFile; - /** - * Transforms an ES5 source file to ES3. - * - * @param node A SourceFile - */ - function transformSourceFile(node) { - return node; - } - /** - * Hooks node substitutions. - * - * @param emitContext The context for the emitter. - * @param node The node to substitute. - */ - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (ts.isPropertyAccessExpression(node)) { - return substitutePropertyAccessExpression(node); - } - else if (ts.isPropertyAssignment(node)) { - return substitutePropertyAssignment(node); - } - return node; - } - /** - * Substitutes a PropertyAccessExpression whose name is a reserved word. - * - * @param node A PropertyAccessExpression - */ - function substitutePropertyAccessExpression(node) { - var literalName = trySubstituteReservedName(node.name); - if (literalName) { - return ts.createElementAccess(node.expression, literalName, /*location*/ node); - } - return node; - } - /** - * Substitutes a PropertyAssignment whose name is a reserved word. - * - * @param node A PropertyAssignment - */ - function substitutePropertyAssignment(node) { - var literalName = ts.isIdentifier(node.name) && trySubstituteReservedName(node.name); - if (literalName) { - return ts.updatePropertyAssignment(node, literalName, node.initializer); - } - return node; - } - /** - * If an identifier name is a reserved word, returns a string literal for the name. - * - * @param name An Identifier - */ - function trySubstituteReservedName(name) { - var token = name.originalKeywordKind || (ts.nodeIsSynthesized(name) ? ts.stringToToken(name.text) : undefined); - if (token >= 71 /* FirstReservedWord */ && token <= 106 /* LastReservedWord */) { - return ts.createLiteral(name, /*location*/ name); - } - return undefined; - } - } - ts.transformES5 = transformES5; })(ts || (ts = {})); /// /// +/// /*@internal*/ var ts; (function (ts) { - function transformES2015Module(context) { + function transformModule(context) { + function getTransformModuleDelegate(moduleKind) { + switch (moduleKind) { + case ts.ModuleKind.AMD: return transformAMDModule; + case ts.ModuleKind.UMD: return transformUMDModule; + default: return transformCommonJSModule; + } + } + var startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; var compilerOptions = context.getCompilerOptions(); - var previousOnEmitNode = context.onEmitNode; + var resolver = context.getEmitResolver(); + var host = context.getEmitHost(); + var languageVersion = ts.getEmitScriptTarget(compilerOptions); + var moduleKind = ts.getEmitModuleKind(compilerOptions); var previousOnSubstituteNode = context.onSubstituteNode; - context.onEmitNode = onEmitNode; + var previousOnEmitNode = context.onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(261 /* SourceFile */); - context.enableSubstitution(70 /* Identifier */); - var currentSourceFile; + context.onEmitNode = onEmitNode; + context.enableSubstitution(70 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. + context.enableSubstitution(193 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(191 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(192 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(261 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(264 /* SourceFile */); // Restore state when substituting nodes in a file. + var moduleInfoMap = []; // The ExternalModuleInfo for each file. + var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. + var currentSourceFile; // The current file. + var currentModuleInfo; // The ExternalModuleInfo for the current file. + var noSubstitution; // Set of nodes for which substitution rules should be ignored. return transformSourceFile; + /** + * Transforms the module aspects of a SourceFile. + * + * @param node The SourceFile node. + */ function transformSourceFile(node) { - if (ts.isDeclarationFile(node)) { + if (ts.isDeclarationFile(node) || !(ts.isExternalModule(node) || compilerOptions.isolatedModules)) { return node; } - if (ts.isExternalModule(node) || compilerOptions.isolatedModules) { - var externalHelpersModuleName = ts.getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions); - if (externalHelpersModuleName) { - var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.statements); - ts.append(statements, ts.createImportDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText))); - ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset)); - return ts.updateSourceFileNode(node, ts.createNodeArray(statements, node.statements)); + currentSourceFile = node; + currentModuleInfo = ts.collectExternalModuleInfo(node, resolver, compilerOptions); + moduleInfoMap[ts.getOriginalNodeId(node)] = currentModuleInfo; + // Perform the transformation. + var transformModule = getTransformModuleDelegate(moduleKind); + var updated = transformModule(node); + currentSourceFile = undefined; + currentModuleInfo = undefined; + return ts.aggregateTransformFlags(updated); + } + function shouldEmitUnderscoreUnderscoreESModule() { + if (!currentModuleInfo.exportEquals && ts.isExternalModule(currentSourceFile)) { + return true; + } + return false; + } + /** + * Transforms a SourceFile into a CommonJS module. + * + * @param node The SourceFile node. + */ + function transformCommonJSModule(node) { + startLexicalEnvironment(); + var statements = []; + var ensureUseStrict = compilerOptions.alwaysStrict || (!compilerOptions.noImplicitUseStrict && ts.isExternalModule(currentSourceFile)); + var statementOffset = ts.addPrologue(statements, node.statements, ensureUseStrict, sourceElementVisitor); + if (shouldEmitUnderscoreUnderscoreESModule()) { + ts.append(statements, createUnderscoreUnderscoreESModule()); + } + ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement)); + ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); + addExportEqualsIfNeeded(statements, /*emitAsReturn*/ false); + ts.addRange(statements, endLexicalEnvironment()); + var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements)); + if (currentModuleInfo.hasExportStarsToExportValues) { + // If we have any `export * from ...` declarations + // we need to inform the emitter to add the __export helper. + ts.addEmitHelper(updated, exportStarHelper); + } + return updated; + } + /** + * Transforms a SourceFile into an AMD module. + * + * @param node The SourceFile node. + */ + function transformAMDModule(node) { + var define = ts.createIdentifier("define"); + var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions); + // An AMD define function has the following shape: + // + // define(id?, dependencies?, factory); + // + // This has the shape of the following: + // + // define(name, ["module1", "module2"], function (module1Alias) { ... } + // + // The location of the alias in the parameter list in the factory function needs to + // match the position of the module name in the dependency list. + // + // To ensure this is true in cases of modules with no aliases, e.g.: + // + // import "module" + // + // or + // + // /// + // + // we need to add modules without alias names to the end of the dependencies list + var _a = collectAsynchronousDependencies(node, /*includeNonAmdDependencies*/ true), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames; + // Create an updated SourceFile: + // + // define(moduleName?, ["module1", "module2"], function ... + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ + ts.createStatement(ts.createCall(define, + /*typeArguments*/ undefined, (moduleName ? [moduleName] : []).concat([ + // Add the dependency array argument: + // + // ["require", "exports", module1", "module2", ...] + ts.createArrayLiteral([ + ts.createLiteral("require"), + ts.createLiteral("exports") + ].concat(aliasedModuleNames, unaliasedModuleNames)), + // Add the module body function argument: + // + // function (require, exports, module1, module2) ... + ts.createFunctionExpression( + /*modifiers*/ undefined, + /*asteriskToken*/ undefined, + /*name*/ undefined, + /*typeParameters*/ undefined, [ + ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "require"), + ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "exports") + ].concat(importAliasNames), + /*type*/ undefined, transformAsynchronousModuleBody(node)) + ]))) + ]), + /*location*/ node.statements)); + } + /** + * Transforms a SourceFile into a UMD module. + * + * @param node The SourceFile node. + */ + function transformUMDModule(node) { + var _a = collectAsynchronousDependencies(node, /*includeNonAmdDependencies*/ false), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames; + var umdHeader = ts.createFunctionExpression( + /*modifiers*/ undefined, + /*asteriskToken*/ undefined, + /*name*/ undefined, + /*typeParameters*/ undefined, [ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "factory")], + /*type*/ undefined, ts.setTextRange(ts.createBlock([ + ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier("module"), "object"), ts.createTypeCheck(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), "object")), ts.createBlock([ + ts.createVariableStatement( + /*modifiers*/ undefined, [ + ts.createVariableDeclaration("v", + /*type*/ undefined, ts.createCall(ts.createIdentifier("factory"), + /*typeArguments*/ undefined, [ + ts.createIdentifier("require"), + ts.createIdentifier("exports") + ])) + ]), + ts.setEmitFlags(ts.createIf(ts.createStrictInequality(ts.createIdentifier("v"), ts.createIdentifier("undefined")), ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), ts.createIdentifier("v")))), 1 /* SingleLine */) + ]), ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier("define"), "function"), ts.createPropertyAccess(ts.createIdentifier("define"), "amd")), ts.createBlock([ + ts.createStatement(ts.createCall(ts.createIdentifier("define"), + /*typeArguments*/ undefined, [ + ts.createArrayLiteral([ + ts.createLiteral("require"), + ts.createLiteral("exports") + ].concat(aliasedModuleNames, unaliasedModuleNames)), + ts.createIdentifier("factory") + ])) + ]))) + ], + /*multiLine*/ true), + /*location*/ undefined)); + // Create an updated SourceFile: + // + // (function (factory) { + // if (typeof module === "object" && typeof module.exports === "object") { + // var v = factory(require, exports); + // if (v !== undefined) module.exports = v; + // } + // else if (typeof define === 'function' && define.amd) { + // define(["require", "exports"], factory); + // } + // })(function ...) + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ + ts.createStatement(ts.createCall(umdHeader, + /*typeArguments*/ undefined, [ + // Add the module body function argument: + // + // function (require, exports) ... + ts.createFunctionExpression( + /*modifiers*/ undefined, + /*asteriskToken*/ undefined, + /*name*/ undefined, + /*typeParameters*/ undefined, [ + ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "require"), + ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "exports") + ].concat(importAliasNames), + /*type*/ undefined, transformAsynchronousModuleBody(node)) + ])) + ]), + /*location*/ node.statements)); + } + /** + * Collect the additional asynchronous dependencies for the module. + * + * @param node The source file. + * @param includeNonAmdDependencies A value indicating whether to include non-AMD dependencies. + */ + function collectAsynchronousDependencies(node, includeNonAmdDependencies) { + // names of modules with corresponding parameter in the factory function + var aliasedModuleNames = []; + // names of modules with no corresponding parameters in factory function + var unaliasedModuleNames = []; + // names of the parameters in the factory function; these + // parameters need to match the indexes of the corresponding + // module names in aliasedModuleNames. + var importAliasNames = []; + // Fill in amd-dependency tags + for (var _i = 0, _a = node.amdDependencies; _i < _a.length; _i++) { + var amdDependency = _a[_i]; + if (amdDependency.name) { + aliasedModuleNames.push(ts.createLiteral(amdDependency.path)); + importAliasNames.push(ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, amdDependency.name)); } else { - return ts.visitEachChild(node, visitor, context); + unaliasedModuleNames.push(ts.createLiteral(amdDependency.path)); } } - return node; + for (var _b = 0, _c = currentModuleInfo.externalImports; _b < _c.length; _b++) { + var importNode = _c[_b]; + // Find the name of the external module + var externalModuleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions); + // Find the name of the module alias, if there is one + var importAliasName = ts.getLocalNameForExternalImport(importNode, currentSourceFile); + // It is possible that externalModuleName is undefined if it is not string literal. + // This can happen in the invalid import syntax. + // E.g : "import * from alias from 'someLib';" + if (externalModuleName) { + if (includeNonAmdDependencies && importAliasName) { + // Set emitFlags on the name of the classDeclaration + // This is so that when printer will not substitute the identifier + ts.setEmitFlags(importAliasName, 4 /* NoSubstitution */); + aliasedModuleNames.push(externalModuleName); + importAliasNames.push(ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, importAliasName)); + } + else { + unaliasedModuleNames.push(externalModuleName); + } + } + } + return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames }; } - function visitor(node) { + /** + * Transforms a SourceFile into an AMD or UMD module body. + * + * @param node The SourceFile node. + */ + function transformAsynchronousModuleBody(node) { + startLexicalEnvironment(); + var statements = []; + var statementOffset = ts.addPrologue(statements, node.statements, /*ensureUseStrict*/ !compilerOptions.noImplicitUseStrict, sourceElementVisitor); + if (shouldEmitUnderscoreUnderscoreESModule()) { + ts.append(statements, createUnderscoreUnderscoreESModule()); + } + // Visit each statement of the module body. + ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement)); + ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); + // Append the 'export =' statement if provided. + addExportEqualsIfNeeded(statements, /*emitAsReturn*/ true); + // End the lexical environment for the module body + // and merge any new lexical declarations. + ts.addRange(statements, endLexicalEnvironment()); + var body = ts.createBlock(statements, /*multiLine*/ true); + if (currentModuleInfo.hasExportStarsToExportValues) { + // If we have any `export * from ...` declarations + // we need to inform the emitter to add the __export helper. + ts.addEmitHelper(body, exportStarHelper); + } + return body; + } + /** + * Adds the down-level representation of `export=` to the statement list if one exists + * in the source file. + * + * @param statements The Statement list to modify. + * @param emitAsReturn A value indicating whether to emit the `export=` statement as a + * return statement. + */ + function addExportEqualsIfNeeded(statements, emitAsReturn) { + if (currentModuleInfo.exportEquals) { + if (emitAsReturn) { + var statement = ts.createReturn(currentModuleInfo.exportEquals.expression); + ts.setTextRange(statement, currentModuleInfo.exportEquals); + ts.setEmitFlags(statement, 384 /* NoTokenSourceMaps */ | 1536 /* NoComments */); + statements.push(statement); + } + else { + var statement = ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), currentModuleInfo.exportEquals.expression)); + ts.setTextRange(statement, currentModuleInfo.exportEquals); + ts.setEmitFlags(statement, 1536 /* NoComments */); + statements.push(statement); + } + } + } + // + // Top-Level Source Element Visitors + // + /** + * Visits a node at the top level of the source file. + * + * @param node The node to visit. + */ + function sourceElementVisitor(node) { switch (node.kind) { - case 234 /* ImportEqualsDeclaration */: - // Elide `import=` as it is not legal with --module ES6 - return undefined; - case 240 /* ExportAssignment */: + case 237 /* ImportDeclaration */: + return visitImportDeclaration(node); + case 236 /* ImportEqualsDeclaration */: + return visitImportEqualsDeclaration(node); + case 243 /* ExportDeclaration */: + return visitExportDeclaration(node); + case 242 /* ExportAssignment */: return visitExportAssignment(node); + case 207 /* VariableStatement */: + return visitVariableStatement(node); + case 227 /* FunctionDeclaration */: + return visitFunctionDeclaration(node); + case 228 /* ClassDeclaration */: + return visitClassDeclaration(node); + case 296 /* MergeDeclarationMarker */: + return visitMergeDeclarationMarker(node); + case 297 /* EndOfDeclarationMarker */: + return visitEndOfDeclarationMarker(node); + default: + // This visitor does not descend into the tree, as export/import statements + // are only transformed at the top level of a file. + return node; + } + } + /** + * Visits an ImportDeclaration node. + * + * @param node The node to visit. + */ + function visitImportDeclaration(node) { + var statements; + var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); + if (moduleKind !== ts.ModuleKind.AMD) { + if (!node.importClause) { + // import "mod"; + return ts.setTextRange(ts.createStatement(createRequireCall(node)), node); + } + else { + var variables = []; + if (namespaceDeclaration && !ts.isDefaultImport(node)) { + // import * as n from "mod"; + variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), + /*type*/ undefined, createRequireCall(node))); + } + else { + // import d from "mod"; + // import { x, y } from "mod"; + // import d, { x, y } from "mod"; + // import d, * as n from "mod"; + variables.push(ts.createVariableDeclaration(ts.getGeneratedNameForNode(node), + /*type*/ undefined, createRequireCall(node))); + if (namespaceDeclaration && ts.isDefaultImport(node)) { + variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), + /*type*/ undefined, ts.getGeneratedNameForNode(node))); + } + } + statements = ts.append(statements, ts.setTextRange(ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList(variables, languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */)), + /*location*/ node)); + } + } + else if (namespaceDeclaration && ts.isDefaultImport(node)) { + // import d, * as n from "mod"; + statements = ts.append(statements, ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList([ + ts.setTextRange(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), + /*type*/ undefined, ts.getGeneratedNameForNode(node)), + /*location*/ node) + ], languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */))); + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + // Defer exports until we encounter an EndOfDeclarationMarker node + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfImportDeclaration(deferredExports[id], node); + } + else { + statements = appendExportsOfImportDeclaration(statements, node); + } + return ts.singleOrMany(statements); + } + /** + * Creates a `require()` call to import an external module. + * + * @param importNode The declararation to import. + */ + function createRequireCall(importNode) { + var moduleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions); + var args = []; + if (moduleName) { + args.push(moduleName); + } + return ts.createCall(ts.createIdentifier("require"), /*typeArguments*/ undefined, args); + } + /** + * Visits an ImportEqualsDeclaration node. + * + * @param node The node to visit. + */ + function visitImportEqualsDeclaration(node) { + ts.Debug.assert(ts.isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer."); + var statements; + if (moduleKind !== ts.ModuleKind.AMD) { + if (ts.hasModifier(node, 1 /* Export */)) { + statements = ts.append(statements, ts.setTextRange(ts.createStatement(createExportExpression(node.name, createRequireCall(node))), node)); + } + else { + statements = ts.append(statements, ts.setTextRange(ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration(ts.getSynthesizedClone(node.name), + /*type*/ undefined, createRequireCall(node)) + ], + /*flags*/ languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */)), node)); + } + } + else { + if (ts.hasModifier(node, 1 /* Export */)) { + statements = ts.append(statements, ts.setTextRange(ts.createStatement(createExportExpression(ts.getExportName(node), ts.getLocalName(node))), node)); + } + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + // Defer exports until we encounter an EndOfDeclarationMarker node + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfImportEqualsDeclaration(deferredExports[id], node); + } + else { + statements = appendExportsOfImportEqualsDeclaration(statements, node); + } + return ts.singleOrMany(statements); + } + /** + * Visits an ExportDeclaration node. + * + * @param The node to visit. + */ + function visitExportDeclaration(node) { + if (!node.moduleSpecifier) { + // Elide export declarations with no module specifier as they are handled + // elsewhere. + return undefined; + } + var generatedName = ts.getGeneratedNameForNode(node); + if (node.exportClause) { + var statements = []; + // export { x, y } from "mod"; + if (moduleKind !== ts.ModuleKind.AMD) { + statements.push(ts.setTextRange(ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration(generatedName, + /*type*/ undefined, createRequireCall(node)) + ])), + /*location*/ node)); + } + for (var _i = 0, _a = node.exportClause.elements; _i < _a.length; _i++) { + var specifier = _a[_i]; + var exportedValue = ts.createPropertyAccess(generatedName, specifier.propertyName || specifier.name); + statements.push(ts.setTextRange(ts.createStatement(createExportExpression(ts.getExportName(specifier), exportedValue)), specifier)); + } + return ts.singleOrMany(statements); + } + else { + // export * from "mod"; + return ts.setTextRange(ts.createStatement(ts.createCall(ts.createIdentifier("__export"), + /*typeArguments*/ undefined, [ + moduleKind !== ts.ModuleKind.AMD + ? createRequireCall(node) + : generatedName + ])), node); + } + } + /** + * Visits an ExportAssignment node. + * + * @param node The node to visit. + */ + function visitExportAssignment(node) { + if (node.isExportEquals) { + return undefined; + } + var statements; + var original = node.original; + if (original && hasAssociatedEndOfDeclarationMarker(original)) { + // Defer exports until we encounter an EndOfDeclarationMarker node + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportStatement(deferredExports[id], ts.createIdentifier("default"), node.expression, /*location*/ node, /*allowComments*/ true); + } + else { + statements = appendExportStatement(statements, ts.createIdentifier("default"), node.expression, /*location*/ node, /*allowComments*/ true); + } + return ts.singleOrMany(statements); + } + /** + * Visits a FunctionDeclaration node. + * + * @param node The node to visit. + */ + function visitFunctionDeclaration(node) { + var statements; + if (ts.hasModifier(node, 1 /* Export */)) { + statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(ts.createFunctionDeclaration( + /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, ts.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), + /*typeParameters*/ undefined, node.parameters, + /*type*/ undefined, node.body), + /*location*/ node), + /*original*/ node)); + } + else { + statements = ts.append(statements, node); + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + // Defer exports until we encounter an EndOfDeclarationMarker node + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node); + } + else { + statements = appendExportsOfHoistedDeclaration(statements, node); + } + return ts.singleOrMany(statements); + } + /** + * Visits a ClassDeclaration node. + * + * @param node The node to visit. + */ + function visitClassDeclaration(node) { + var statements; + if (ts.hasModifier(node, 1 /* Export */)) { + statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(ts.createClassDeclaration( + /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), + /*typeParameters*/ undefined, node.heritageClauses, node.members), node), node)); + } + else { + statements = ts.append(statements, node); + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + // Defer exports until we encounter an EndOfDeclarationMarker node + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node); + } + else { + statements = appendExportsOfHoistedDeclaration(statements, node); + } + return ts.singleOrMany(statements); + } + /** + * Visits a VariableStatement node. + * + * @param node The node to visit. + */ + function visitVariableStatement(node) { + var statements; + var variables; + var expressions; + if (ts.hasModifier(node, 1 /* Export */)) { + var modifiers = void 0; + // If we're exporting these variables, then these just become assignments to 'exports.x'. + // We only want to emit assignments for variables with initializers. + for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { + var variable = _a[_i]; + if (ts.isIdentifier(variable.name) && ts.isLocalName(variable.name)) { + if (!modifiers) { + modifiers = ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier); + } + variables = ts.append(variables, variable); + } + else if (variable.initializer) { + expressions = ts.append(expressions, transformInitializedVariable(variable)); + } + } + if (variables) { + statements = ts.append(statements, ts.updateVariableStatement(node, modifiers, ts.updateVariableDeclarationList(node.declarationList, variables))); + } + if (expressions) { + statements = ts.append(statements, ts.setTextRange(ts.createStatement(ts.inlineExpressions(expressions)), node)); + } + } + else { + statements = ts.append(statements, node); + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + // Defer exports until we encounter an EndOfDeclarationMarker node + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node); + } + else { + statements = appendExportsOfVariableStatement(statements, node); + } + return ts.singleOrMany(statements); + } + /** + * Transforms an exported variable with an initializer into an expression. + * + * @param node The node to transform. + */ + function transformInitializedVariable(node) { + if (ts.isBindingPattern(node.name)) { + return ts.flattenDestructuringAssignment(node, + /*visitor*/ undefined, context, 0 /* All */, + /*needsValue*/ false, createExportExpression); + } + else { + return ts.createAssignment(ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), node.name), + /*location*/ node.name), node.initializer); + } + } + /** + * Visits a MergeDeclarationMarker used as a placeholder for the beginning of a merged + * and transformed declaration. + * + * @param node The node to visit. + */ + function visitMergeDeclarationMarker(node) { + // For an EnumDeclaration or ModuleDeclaration that merges with a preceeding + // declaration we do not emit a leading variable declaration. To preserve the + // begin/end semantics of the declararation and to properly handle exports + // we wrapped the leading variable declaration in a `MergeDeclarationMarker`. + // + // To balance the declaration, add the exports of the elided variable + // statement. + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 207 /* VariableStatement */) { + var id = ts.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } return node; } - function visitExportAssignment(node) { - // Elide `export=` as it is not legal with --module ES6 - return node.isExportEquals ? undefined : node; + /** + * Determines whether a node has an associated EndOfDeclarationMarker. + * + * @param node The node to test. + */ + function hasAssociatedEndOfDeclarationMarker(node) { + return (ts.getEmitFlags(node) & 2097152 /* HasEndOfDeclarationMarker */) !== 0; + } + /** + * Visits a DeclarationMarker used as a placeholder for the end of a transformed + * declaration. + * + * @param node The node to visit. + */ + function visitEndOfDeclarationMarker(node) { + // For some transformations we emit an `EndOfDeclarationMarker` to mark the actual + // end of the transformed declaration. We use this marker to emit any deferred exports + // of the declaration. + var id = ts.getOriginalNodeId(node); + var statements = deferredExports[id]; + if (statements) { + delete deferredExports[id]; + return ts.append(statements, node); + } + return node; + } + /** + * Appends the exports of an ImportDeclaration to a statement list, returning the + * statement list. + * + * @param statements A statement list to which the down-level export statements are to be + * appended. If `statements` is `undefined`, a new array is allocated if statements are + * appended. + * @param decl The declaration whose exports are to be recorded. + */ + function appendExportsOfImportDeclaration(statements, decl) { + if (currentModuleInfo.exportEquals) { + return statements; + } + var importClause = decl.importClause; + if (!importClause) { + return statements; + } + if (importClause.name) { + statements = appendExportsOfDeclaration(statements, importClause); + } + var namedBindings = importClause.namedBindings; + if (namedBindings) { + switch (namedBindings.kind) { + case 239 /* NamespaceImport */: + statements = appendExportsOfDeclaration(statements, namedBindings); + break; + case 240 /* NamedImports */: + for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { + var importBinding = _a[_i]; + statements = appendExportsOfDeclaration(statements, importBinding); + } + break; + } + } + return statements; + } + /** + * Appends the exports of an ImportEqualsDeclaration to a statement list, returning the + * statement list. + * + * @param statements A statement list to which the down-level export statements are to be + * appended. If `statements` is `undefined`, a new array is allocated if statements are + * appended. + * @param decl The declaration whose exports are to be recorded. + */ + function appendExportsOfImportEqualsDeclaration(statements, decl) { + if (currentModuleInfo.exportEquals) { + return statements; + } + return appendExportsOfDeclaration(statements, decl); + } + /** + * Appends the exports of a VariableStatement to a statement list, returning the statement + * list. + * + * @param statements A statement list to which the down-level export statements are to be + * appended. If `statements` is `undefined`, a new array is allocated if statements are + * appended. + * @param node The VariableStatement whose exports are to be recorded. + */ + function appendExportsOfVariableStatement(statements, node) { + if (currentModuleInfo.exportEquals) { + return statements; + } + for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + statements = appendExportsOfBindingElement(statements, decl); + } + return statements; + } + /** + * Appends the exports of a VariableDeclaration or BindingElement to a statement list, + * returning the statement list. + * + * @param statements A statement list to which the down-level export statements are to be + * appended. If `statements` is `undefined`, a new array is allocated if statements are + * appended. + * @param decl The declaration whose exports are to be recorded. + */ + function appendExportsOfBindingElement(statements, decl) { + if (currentModuleInfo.exportEquals) { + return statements; + } + if (ts.isBindingPattern(decl.name)) { + for (var _i = 0, _a = decl.name.elements; _i < _a.length; _i++) { + var element = _a[_i]; + if (!ts.isOmittedExpression(element)) { + statements = appendExportsOfBindingElement(statements, element); + } + } + } + else if (!ts.isGeneratedIdentifier(decl.name)) { + statements = appendExportsOfDeclaration(statements, decl); + } + return statements; + } + /** + * Appends the exports of a ClassDeclaration or FunctionDeclaration to a statement list, + * returning the statement list. + * + * @param statements A statement list to which the down-level export statements are to be + * appended. If `statements` is `undefined`, a new array is allocated if statements are + * appended. + * @param decl The declaration whose exports are to be recorded. + */ + function appendExportsOfHoistedDeclaration(statements, decl) { + if (currentModuleInfo.exportEquals) { + return statements; + } + if (ts.hasModifier(decl, 1 /* Export */)) { + var exportName = ts.hasModifier(decl, 512 /* Default */) ? ts.createIdentifier("default") : decl.name; + statements = appendExportStatement(statements, exportName, ts.getLocalName(decl), /*location*/ decl); + } + if (decl.name) { + statements = appendExportsOfDeclaration(statements, decl); + } + return statements; + } + /** + * Appends the exports of a declaration to a statement list, returning the statement list. + * + * @param statements A statement list to which the down-level export statements are to be + * appended. If `statements` is `undefined`, a new array is allocated if statements are + * appended. + * @param decl The declaration to export. + */ + function appendExportsOfDeclaration(statements, decl) { + var name = ts.getDeclarationName(decl); + var exportSpecifiers = currentModuleInfo.exportSpecifiers.get(name.text); + if (exportSpecifiers) { + for (var _i = 0, exportSpecifiers_1 = exportSpecifiers; _i < exportSpecifiers_1.length; _i++) { + var exportSpecifier = exportSpecifiers_1[_i]; + statements = appendExportStatement(statements, exportSpecifier.name, name, /*location*/ exportSpecifier.name); + } + } + return statements; + } + /** + * Appends the down-level representation of an export to a statement list, returning the + * statement list. + * + * @param statements A statement list to which the down-level export statements are to be + * appended. If `statements` is `undefined`, a new array is allocated if statements are + * appended. + * @param exportName The name of the export. + * @param expression The expression to export. + * @param location The location to use for source maps and comments for the export. + * @param allowComments Whether to allow comments on the export. + */ + function appendExportStatement(statements, exportName, expression, location, allowComments) { + statements = ts.append(statements, createExportStatement(exportName, expression, location, allowComments)); + return statements; + } + function createUnderscoreUnderscoreESModule() { + var statement; + if (languageVersion === 0 /* ES3 */) { + statement = ts.createStatement(createExportExpression(ts.createIdentifier("__esModule"), ts.createLiteral(/*value*/ true))); + } + else { + statement = ts.createStatement(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), + /*typeArguments*/ undefined, [ + ts.createIdentifier("exports"), + ts.createLiteral("__esModule"), + ts.createObjectLiteral([ + ts.createPropertyAssignment("value", ts.createLiteral(/*value*/ true)) + ]) + ])); + } + ts.setEmitFlags(statement, 524288 /* CustomPrologue */); + return statement; + } + /** + * Creates a call to the current file's export function to export a value. + * + * @param name The bound name of the export. + * @param value The exported value. + * @param location The location to use for source maps and comments for the export. + * @param allowComments An optional value indicating whether to emit comments for the statement. + */ + function createExportStatement(name, value, location, allowComments) { + var statement = ts.setTextRange(ts.createStatement(createExportExpression(name, value)), location); + ts.startOnNewLine(statement); + if (!allowComments) { + ts.setEmitFlags(statement, 1536 /* NoComments */); + } + return statement; + } + /** + * Creates a call to the current file's export function to export a value. + * + * @param name The bound name of the export. + * @param value The exported value. + * @param location The location to use for source maps and comments for the export. + */ + function createExportExpression(name, value, location) { + return ts.setTextRange(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(name)), value), location); + } + // + // Modifier Visitors + // + /** + * Visit nodes to elide module-specific modifiers. + * + * @param node The node to visit. + */ + function modifierVisitor(node) { + // Elide module-specific modifiers. + switch (node.kind) { + case 83 /* ExportKeyword */: + case 78 /* DefaultKeyword */: + return undefined; + } + return node; } // // Emit Notification // /** - * Hook for node emit. + * Hook for node emit notifications. * - * @param emitContext A context hint for the emitter. + * @param hint A hint as to the intended usage of the node. * @param node The node to emit. * @param emit A callback used to emit the node in the printer. */ - function onEmitNode(emitContext, node, emitCallback) { - if (ts.isSourceFile(node)) { + function onEmitNode(hint, node, emitCallback) { + if (node.kind === 264 /* SourceFile */) { currentSourceFile = node; - previousOnEmitNode(emitContext, node, emitCallback); + currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; + noSubstitution = []; + previousOnEmitNode(hint, node, emitCallback); currentSourceFile = undefined; + currentModuleInfo = undefined; + noSubstitution = undefined; } else { - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); } } // @@ -54342,30 +59434,192 @@ var ts; /** * Hooks node substitutions. * - * @param emitContext A context hint for the emitter. + * @param hint A hint as to the intended usage of the node. * @param node The node to substitute. */ - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (ts.isIdentifier(node) && emitContext === 1 /* Expression */) { - return substituteExpressionIdentifier(node); + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (node.id && noSubstitution[node.id]) { + return node; + } + if (hint === 1 /* Expression */) { + return substituteExpression(node); + } + else if (ts.isShorthandPropertyAssignment(node)) { + return substituteShorthandPropertyAssignment(node); } return node; } + /** + * Substitution for a ShorthandPropertyAssignment whose declaration name is an imported + * or exported symbol. + * + * @param node The node to substitute. + */ + function substituteShorthandPropertyAssignment(node) { + var name = node.name; + var exportedOrImportedName = substituteExpressionIdentifier(name); + if (exportedOrImportedName !== name) { + // A shorthand property with an assignment initializer is probably part of a + // destructuring assignment + if (node.objectAssignmentInitializer) { + var initializer = ts.createAssignment(exportedOrImportedName, node.objectAssignmentInitializer); + return ts.setTextRange(ts.createPropertyAssignment(name, initializer), node); + } + return ts.setTextRange(ts.createPropertyAssignment(name, exportedOrImportedName), node); + } + return node; + } + /** + * Substitution for an Expression that may contain an imported or exported symbol. + * + * @param node The node to substitute. + */ + function substituteExpression(node) { + switch (node.kind) { + case 70 /* Identifier */: + return substituteExpressionIdentifier(node); + case 193 /* BinaryExpression */: + return substituteBinaryExpression(node); + case 192 /* PostfixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: + return substituteUnaryExpression(node); + } + return node; + } + /** + * Substitution for an Identifier expression that may contain an imported or exported + * symbol. + * + * @param node The node to substitute. + */ function substituteExpressionIdentifier(node) { if (ts.getEmitFlags(node) & 4096 /* HelperName */) { var externalHelpersModuleName = ts.getExternalHelpersModuleName(currentSourceFile); if (externalHelpersModuleName) { return ts.createPropertyAccess(externalHelpersModuleName, node); } + return node; + } + if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { + var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); + if (exportContainer && exportContainer.kind === 264 /* SourceFile */) { + return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), + /*location*/ node); + } + var importDeclaration = resolver.getReferencedImportDeclaration(node); + if (importDeclaration) { + if (ts.isImportClause(importDeclaration)) { + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default")), + /*location*/ node); + } + else if (ts.isImportSpecifier(importDeclaration)) { + var name = importDeclaration.propertyName || importDeclaration.name; + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(name)), + /*location*/ node); + } + } } return node; } + /** + * Substitution for a BinaryExpression that may contain an imported or exported symbol. + * + * @param node The node to substitute. + */ + function substituteBinaryExpression(node) { + // When we see an assignment expression whose left-hand side is an exported symbol, + // we should ensure all exports of that symbol are updated with the correct value. + // + // - We do not substitute generated identifiers for any reason. + // - We do not substitute identifiers tagged with the LocalName flag. + // - We do not substitute identifiers that were originally the name of an enum or + // namespace due to how they are transformed in TypeScript. + // - We only substitute identifiers that are exported at the top level. + if (ts.isAssignmentOperator(node.operatorToken.kind) + && ts.isIdentifier(node.left) + && !ts.isGeneratedIdentifier(node.left) + && !ts.isLocalName(node.left) + && !ts.isDeclarationNameOfEnumOrNamespace(node.left)) { + var exportedNames = getExports(node.left); + if (exportedNames) { + // For each additional export of the declaration, apply an export assignment. + var expression = node; + for (var _i = 0, exportedNames_1 = exportedNames; _i < exportedNames_1.length; _i++) { + var exportName = exportedNames_1[_i]; + // Mark the node to prevent triggering this rule again. + noSubstitution[ts.getNodeId(expression)] = true; + expression = createExportExpression(exportName, expression, /*location*/ node); + } + return expression; + } + } + return node; + } + /** + * Substitution for a UnaryExpression that may contain an imported or exported symbol. + * + * @param node The node to substitute. + */ + function substituteUnaryExpression(node) { + // When we see a prefix or postfix increment expression whose operand is an exported + // symbol, we should ensure all exports of that symbol are updated with the correct + // value. + // + // - We do not substitute generated identifiers for any reason. + // - We do not substitute identifiers tagged with the LocalName flag. + // - We do not substitute identifiers that were originally the name of an enum or + // namespace due to how they are transformed in TypeScript. + // - We only substitute identifiers that are exported at the top level. + if ((node.operator === 42 /* PlusPlusToken */ || node.operator === 43 /* MinusMinusToken */) + && ts.isIdentifier(node.operand) + && !ts.isGeneratedIdentifier(node.operand) + && !ts.isLocalName(node.operand) + && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { + var exportedNames = getExports(node.operand); + if (exportedNames) { + var expression = node.kind === 192 /* PostfixUnaryExpression */ + ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 42 /* PlusPlusToken */ ? 58 /* PlusEqualsToken */ : 59 /* MinusEqualsToken */), ts.createLiteral(1)), + /*location*/ node) + : node; + for (var _i = 0, exportedNames_2 = exportedNames; _i < exportedNames_2.length; _i++) { + var exportName = exportedNames_2[_i]; + // Mark the node to prevent triggering this rule again. + noSubstitution[ts.getNodeId(expression)] = true; + expression = createExportExpression(exportName, expression); + } + return expression; + } + } + return node; + } + /** + * Gets the additional exports of a name. + * + * @param name The name. + */ + function getExports(name) { + if (!ts.isGeneratedIdentifier(name)) { + var valueDeclaration = resolver.getReferencedImportDeclaration(name) + || resolver.getReferencedValueDeclaration(name); + if (valueDeclaration) { + return currentModuleInfo + && currentModuleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]; + } + } + } } - ts.transformES2015Module = transformES2015Module; + ts.transformModule = transformModule; + // emit output for the __export helper function + var exportStarHelper = { + name: "typescript:export-star", + scoped: true, + text: "\n function __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n }" + }; })(ts || (ts = {})); /// /// +/// /*@internal*/ var ts; (function (ts) { @@ -54379,14 +59633,14 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(70 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(192 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(190 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(191 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableEmitNotification(261 /* SourceFile */); // Restore state when substituting nodes in a file. - var moduleInfoMap = ts.createMap(); // The ExternalModuleInfo for each file. - var deferredExports = ts.createMap(); // Exports to defer until an EndOfDeclarationMarker is found. - var exportFunctionsMap = ts.createMap(); // The export function associated with a source file. - var noSubstitutionMap = ts.createMap(); // Set of nodes for which substitution rules should be ignored for each file. + context.enableSubstitution(193 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(191 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(192 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableEmitNotification(264 /* SourceFile */); // Restore state when substituting nodes in a file. + var moduleInfoMap = []; // The ExternalModuleInfo for each file. + var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. + var exportFunctionsMap = []; // The export function associated with a source file. + var noSubstitutionMap = []; // Set of nodes for which substitution rules should be ignored for each file. var currentSourceFile; // The current file. var moduleInfo; // ExternalModuleInfo for the current file. var exportFunction; // The export function for the current file. @@ -54425,7 +59679,8 @@ var ts; moduleInfo = moduleInfoMap[id] = ts.collectExternalModuleInfo(node, resolver, compilerOptions); // Make sure that the name of the 'exports' function does not conflict with // existing identifiers. - exportFunction = exportFunctionsMap[id] = ts.createUniqueName("exports"); + exportFunction = ts.createUniqueName("exports"); + exportFunctionsMap[id] = exportFunction; contextObject = ts.createUniqueName("context"); // Add the body of the module. var dependencyGroups = collectDependencyGroups(moduleInfo.externalImports); @@ -54444,12 +59699,12 @@ var ts; // So the helper will be emit at the correct position instead of at the top of the source-file var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions); var dependencies = ts.createArrayLiteral(ts.map(dependencyGroups, function (dependencyGroup) { return dependencyGroup.name; })); - var updated = ts.updateSourceFileNode(node, ts.createNodeArray([ + var updated = ts.setEmitFlags(ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ ts.createStatement(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("System"), "register"), /*typeArguments*/ undefined, moduleName ? [moduleName, dependencies, moduleBodyFunction] : [dependencies, moduleBodyFunction])) - ], node.statements)); + ]), node.statements)), 1024 /* NoTrailingComments */); if (!(compilerOptions.outFile || compilerOptions.out)) { ts.moveEmitHelpers(updated, moduleBodyBlock, function (helper) { return !helper.scoped; }); } @@ -54476,18 +59731,20 @@ var ts; for (var i = 0; i < externalImports.length; i++) { var externalImport = externalImports[i]; var externalModuleName = ts.getExternalModuleNameLiteral(externalImport, currentSourceFile, host, resolver, compilerOptions); - var text = externalModuleName.text; - if (ts.hasProperty(groupIndices, text)) { - // deduplicate/group entries in dependency list by the dependency name - var groupIndex = groupIndices[text]; - dependencyGroups[groupIndex].externalImports.push(externalImport); - } - else { - groupIndices[text] = dependencyGroups.length; - dependencyGroups.push({ - name: externalModuleName, - externalImports: [externalImport] - }); + if (externalModuleName) { + var text = externalModuleName.text; + var groupIndex = groupIndices.get(text); + if (groupIndex !== undefined) { + // deduplicate/group entries in dependency list by the dependency name + dependencyGroups[groupIndex].externalImports.push(externalImport); + } + else { + groupIndices.set(text, dependencyGroups.length); + dependencyGroups.push({ + name: externalModuleName, + externalImports: [externalImport] + }); + } } } return dependencyGroups; @@ -54545,7 +59802,8 @@ var ts; // only in the outer module body and not in the inner one. startLexicalEnvironment(); // Add any prologue directives. - var statementOffset = ts.addPrologueDirectives(statements, node.statements, /*ensureUseStrict*/ !compilerOptions.noImplicitUseStrict, sourceElementVisitor); + var ensureUseStrict = compilerOptions.alwaysStrict || (!compilerOptions.noImplicitUseStrict && ts.isExternalModule(currentSourceFile)); + var statementOffset = ts.addPrologue(statements, node.statements, ensureUseStrict, sourceElementVisitor); // var __moduleName = context_1 && context_1.id; statements.push(ts.createVariableStatement( /*modifiers*/ undefined, ts.createVariableDeclarationList([ @@ -54553,7 +59811,7 @@ var ts; /*type*/ undefined, ts.createLogicalAnd(contextObject, ts.createPropertyAccess(contextObject, "id"))) ]))); // Visit the synthetic external helpers import declaration if present - ts.visitNode(moduleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement, /*optional*/ true); + ts.visitNode(moduleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement); // Visit the statements of the source file, emitting any transformations into // the `executeStatements` array. We do this *before* we fill the `setters` array // as we both emit transformations as well as aggregate some data used when creating @@ -54567,7 +59825,7 @@ var ts; // - Temporary variables will appear at the top rather than at the bottom of the file ts.addRange(statements, endLexicalEnvironment()); var exportStarFunction = addExportStarIfNeeded(statements); - statements.push(ts.createReturn(ts.setMultiLine(ts.createObjectLiteral([ + var moduleObject = ts.createObjectLiteral([ ts.createPropertyAssignment("setters", createSettersArray(exportStarFunction, dependencyGroups)), ts.createPropertyAssignment("execute", ts.createFunctionExpression( /*modifiers*/ undefined, @@ -54575,12 +59833,11 @@ var ts; /*name*/ undefined, /*typeParameters*/ undefined, /*parameters*/ [], - /*type*/ undefined, ts.createBlock(executeStatements, - /*location*/ undefined, - /*multiLine*/ true))) - ]), - /*multiLine*/ true))); - return ts.createBlock(statements, /*location*/ undefined, /*multiLine*/ true); + /*type*/ undefined, ts.createBlock(executeStatements, /*multiLine*/ true))) + ]); + moduleObject.multiLine = true; + statements.push(ts.createReturn(moduleObject)); + return ts.createBlock(statements, /*multiLine*/ true); } /** * Adds an exportStar function to a statement list if it is needed for the file. @@ -54596,13 +59853,13 @@ var ts; // to support this we store names of local/indirect exported entries in a set. // this set is used to filter names brought by star expors. // local names set should only be added if we have anything exported - if (!moduleInfo.exportedNames && ts.isEmpty(moduleInfo.exportSpecifiers)) { + if (!moduleInfo.exportedNames && moduleInfo.exportSpecifiers.size === 0) { // no exported declarations (export var ...) or export specifiers (export {x}) // check if we have any non star export declarations. var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 241 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 243 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -54622,12 +59879,12 @@ var ts; continue; } // write name of exported declaration, i.e 'export var x...' - exportedNames.push(ts.createPropertyAssignment(ts.createLiteral(exportedLocalName), ts.createLiteral(true))); + exportedNames.push(ts.createPropertyAssignment(ts.createLiteral(exportedLocalName), ts.createTrue())); } } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 241 /* ExportDeclaration */) { + if (externalImport.kind !== 243 /* ExportDeclaration */) { continue; } var exportDecl = externalImport; @@ -54638,14 +59895,14 @@ var ts; for (var _f = 0, _g = exportDecl.exportClause.elements; _f < _g.length; _f++) { var element = _g[_f]; // write name of indirectly exported entry, i.e. 'export {x} from ...' - exportedNames.push(ts.createPropertyAssignment(ts.createLiteral((element.name || element.propertyName).text), ts.createLiteral(true))); + exportedNames.push(ts.createPropertyAssignment(ts.createLiteral((element.name || element.propertyName).text), ts.createTrue())); } } var exportedNamesStorageRef = ts.createUniqueName("exportedNames"); statements.push(ts.createVariableStatement( /*modifiers*/ undefined, ts.createVariableDeclarationList([ ts.createVariableDeclaration(exportedNamesStorageRef, - /*type*/ undefined, ts.createObjectLiteral(exportedNames, /*location*/ undefined, /*multiline*/ true)) + /*type*/ undefined, ts.createObjectLiteral(exportedNames, /*multiline*/ true)) ]))); var exportStarFunction = createExportStarFunction(exportedNamesStorageRef); statements.push(exportStarFunction); @@ -54686,9 +59943,7 @@ var ts; ])), ts.createStatement(ts.createCall(exportFunction, /*typeArguments*/ undefined, [exports])) - ], - /*location*/ undefined, - /*multiline*/ true)); + ], /*multiline*/ true)); } /** * Creates an array setter callbacks for each dependency group. @@ -54708,19 +59963,19 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); switch (entry.kind) { - case 235 /* ImportDeclaration */: + case 237 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } - // fall-through - case 234 /* ImportEqualsDeclaration */: + // falls through + case 236 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(ts.createStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { // export {a, b as c} from 'foo' @@ -54737,7 +59992,7 @@ var ts; properties.push(ts.createPropertyAssignment(ts.createLiteral(e.name.text), ts.createElementAccess(parameterName, ts.createLiteral((e.propertyName || e.name).text)))); } statements.push(ts.createStatement(ts.createCall(exportFunction, - /*typeArguments*/ undefined, [ts.createObjectLiteral(properties, /*location*/ undefined, /*multiline*/ true)]))); + /*typeArguments*/ undefined, [ts.createObjectLiteral(properties, /*multiline*/ true)]))); } else { // export * from 'foo' @@ -54756,9 +60011,9 @@ var ts; /*asteriskToken*/ undefined, /*name*/ undefined, /*typeParameters*/ undefined, [ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, parameterName)], - /*type*/ undefined, ts.createBlock(statements, /*location*/ undefined, /*multiLine*/ true))); + /*type*/ undefined, ts.createBlock(statements, /*multiLine*/ true))); } - return ts.createArrayLiteral(setters, /*location*/ undefined, /*multiLine*/ true); + return ts.createArrayLiteral(setters, /*multiLine*/ true); } // // Top-level Source Element Visitors @@ -54770,15 +60025,15 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 235 /* ImportDeclaration */: + case 237 /* ImportDeclaration */: return visitImportDeclaration(node); - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: // ExportDeclarations are elided as they are handled via // `appendExportsOfDeclaration`. return undefined; - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -54851,7 +60106,7 @@ var ts; */ function visitFunctionDeclaration(node) { if (ts.hasModifier(node, 1 /* Export */)) { - hoistedStatements = ts.append(hoistedStatements, ts.updateFunctionDeclaration(node, node.decorators, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), + hoistedStatements = ts.append(hoistedStatements, ts.updateFunctionDeclaration(node, node.decorators, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, ts.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), /*typeParameters*/ undefined, ts.visitNodes(node.parameters, destructuringVisitor, ts.isParameterDeclaration), /*type*/ undefined, ts.visitNode(node.body, destructuringVisitor, ts.isBlock))); } @@ -54879,11 +60134,9 @@ var ts; var name = ts.getLocalName(node); hoistVariableDeclaration(name); // Rewrite the class declaration into an assignment of a class expression. - statements = ts.append(statements, ts.createStatement(ts.createAssignment(name, ts.createClassExpression( + statements = ts.append(statements, ts.setTextRange(ts.createStatement(ts.createAssignment(name, ts.setTextRange(ts.createClassExpression( /*modifiers*/ undefined, node.name, - /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, destructuringVisitor, ts.isHeritageClause), ts.visitNodes(node.members, destructuringVisitor, ts.isClassElement), - /*location*/ node)), - /*location*/ node)); + /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, destructuringVisitor, ts.isHeritageClause), ts.visitNodes(node.members, destructuringVisitor, ts.isClassElement)), node))), node)); if (hasAssociatedEndOfDeclarationMarker(node)) { // Defer exports until we encounter an EndOfDeclarationMarker node var id = ts.getOriginalNodeId(node); @@ -54918,7 +60171,7 @@ var ts; } var statements; if (expressions) { - statements = ts.append(statements, ts.createStatement(ts.inlineExpressions(expressions), /*location*/ node)); + statements = ts.append(statements, ts.setTextRange(ts.createStatement(ts.inlineExpressions(expressions)), node)); } if (isMarkedDeclaration) { // Defer exports until we encounter an EndOfDeclarationMarker node @@ -54956,7 +60209,7 @@ var ts; function shouldHoistVariableDeclarationList(node) { // hoist only non-block scoped declarations or block scoped declarations parented by source file return (ts.getEmitFlags(node) & 1048576 /* NoHoisting */) === 0 - && (enclosingBlockScopedContainer.kind === 261 /* SourceFile */ + && (enclosingBlockScopedContainer.kind === 264 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -55003,8 +60256,8 @@ var ts; function createVariableAssignment(name, value, location, isExportedDeclaration) { hoistVariableDeclaration(ts.getSynthesizedClone(name)); return isExportedDeclaration - ? createExportExpression(name, preventSubstitution(ts.createAssignment(name, value, location))) - : preventSubstitution(ts.createAssignment(name, value, location)); + ? createExportExpression(name, preventSubstitution(ts.setTextRange(ts.createAssignment(name, value), location))) + : preventSubstitution(ts.setTextRange(ts.createAssignment(name, value), location)); } /** * Visits a MergeDeclarationMarker used as a placeholder for the beginning of a merged @@ -55020,7 +60273,7 @@ var ts; // // To balance the declaration, we defer the exports of the elided variable // statement until we visit this declaration's `EndOfDeclarationMarker`. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 205 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 207 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -55076,10 +60329,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 237 /* NamespaceImport */: + case 239 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 238 /* NamedImports */: + case 240 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -55197,10 +60450,10 @@ var ts; return statements; } var name = ts.getDeclarationName(decl); - var exportSpecifiers = moduleInfo.exportSpecifiers[name.text]; + var exportSpecifiers = moduleInfo.exportSpecifiers.get(name.text); if (exportSpecifiers) { - for (var _i = 0, exportSpecifiers_1 = exportSpecifiers; _i < exportSpecifiers_1.length; _i++) { - var exportSpecifier = exportSpecifiers_1[_i]; + for (var _i = 0, exportSpecifiers_2 = exportSpecifiers; _i < exportSpecifiers_2.length; _i++) { + var exportSpecifier = exportSpecifiers_2[_i]; if (exportSpecifier.name.text !== excludeName) { statements = appendExportStatement(statements, exportSpecifier.name, name); } @@ -55258,43 +60511,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: return visitVariableStatement(node); - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: return visitClassDeclaration(node); - case 211 /* ForStatement */: + case 213 /* ForStatement */: return visitForStatement(node); - case 212 /* ForInStatement */: + case 214 /* ForInStatement */: return visitForInStatement(node); - case 213 /* ForOfStatement */: + case 215 /* ForOfStatement */: return visitForOfStatement(node); - case 209 /* DoStatement */: + case 211 /* DoStatement */: return visitDoStatement(node); - case 210 /* WhileStatement */: + case 212 /* WhileStatement */: return visitWhileStatement(node); - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: return visitLabeledStatement(node); - case 217 /* WithStatement */: + case 219 /* WithStatement */: return visitWithStatement(node); - case 218 /* SwitchStatement */: + case 220 /* SwitchStatement */: return visitSwitchStatement(node); - case 232 /* CaseBlock */: + case 234 /* CaseBlock */: return visitCaseBlock(node); - case 253 /* CaseClause */: + case 256 /* CaseClause */: return visitCaseClause(node); - case 254 /* DefaultClause */: + case 257 /* DefaultClause */: return visitDefaultClause(node); - case 221 /* TryStatement */: + case 223 /* TryStatement */: return visitTryStatement(node); - case 256 /* CatchClause */: + case 259 /* CatchClause */: return visitCatchClause(node); - case 204 /* Block */: + case 206 /* Block */: return visitBlock(node); - case 295 /* MergeDeclarationMarker */: + case 296 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 296 /* EndOfDeclarationMarker */: + case 297 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringVisitor(node); @@ -55308,7 +60561,7 @@ var ts; function visitForStatement(node) { var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; enclosingBlockScopedContainer = node; - node = ts.updateFor(node, visitForInitializer(node.initializer), ts.visitNode(node.condition, destructuringVisitor, ts.isExpression, /*optional*/ true), ts.visitNode(node.incrementor, destructuringVisitor, ts.isExpression, /*optional*/ true), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement)); + node = ts.updateFor(node, visitForInitializer(node.initializer), ts.visitNode(node.condition, destructuringVisitor, ts.isExpression), ts.visitNode(node.incrementor, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement)); enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; return node; } @@ -55320,7 +60573,7 @@ var ts; function visitForInStatement(node) { var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; enclosingBlockScopedContainer = node; - node = ts.updateForIn(node, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, /*optional*/ false, ts.liftToBlock)); + node = ts.updateForIn(node, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; return node; } @@ -55332,7 +60585,7 @@ var ts; function visitForOfStatement(node) { var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; enclosingBlockScopedContainer = node; - node = ts.updateForOf(node, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, /*optional*/ false, ts.liftToBlock)); + node = ts.updateForOf(node, node.awaitModifier, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; return node; } @@ -55352,6 +60605,9 @@ var ts; * @param node The node to visit. */ function visitForInitializer(node) { + if (!node) { + return node; + } if (shouldHoistForInitializer(node)) { var expressions = void 0; for (var _i = 0, _a = node.declarations; _i < _a.length; _i++) { @@ -55370,7 +60626,7 @@ var ts; * @param node The node to visit. */ function visitDoStatement(node) { - return ts.updateDo(node, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, /*optional*/ false, ts.liftToBlock), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression)); + return ts.updateDo(node, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock), ts.visitNode(node.expression, destructuringVisitor, ts.isExpression)); } /** * Visits the body of a WhileStatement to hoist declarations. @@ -55378,7 +60634,7 @@ var ts; * @param node The node to visit. */ function visitWhileStatement(node) { - return ts.updateWhile(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, /*optional*/ false, ts.liftToBlock)); + return ts.updateWhile(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); } /** * Visits the body of a LabeledStatement to hoist declarations. @@ -55386,7 +60642,7 @@ var ts; * @param node The node to visit. */ function visitLabeledStatement(node) { - return ts.updateLabel(node, node.label, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, /*optional*/ false, ts.liftToBlock)); + return ts.updateLabel(node, node.label, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); } /** * Visits the body of a WithStatement to hoist declarations. @@ -55394,7 +60650,7 @@ var ts; * @param node The node to visit. */ function visitWithStatement(node) { - return ts.updateWith(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, /*optional*/ false, ts.liftToBlock)); + return ts.updateWith(node, ts.visitNode(node.expression, destructuringVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock)); } /** * Visits the body of a SwitchStatement to hoist declarations. @@ -55474,7 +60730,7 @@ var ts; */ function destructuringVisitor(node) { if (node.transformFlags & 1024 /* DestructuringAssignment */ - && node.kind === 192 /* BinaryExpression */) { + && node.kind === 193 /* BinaryExpression */) { return visitDestructuringAssignment(node); } else if (node.transformFlags & 2048 /* ContainsDestructuringAssignment */) { @@ -55502,7 +60758,7 @@ var ts; * @param node The destructuring target. */ function hasExportedReferenceInDestructuringTarget(node) { - if (ts.isAssignmentExpression(node)) { + if (ts.isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { return hasExportedReferenceInDestructuringTarget(node.left); } else if (ts.isSpreadExpression(node)) { @@ -55522,7 +60778,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 261 /* SourceFile */; + return container !== undefined && container.kind === 264 /* SourceFile */; } else { return false; @@ -55550,12 +60806,12 @@ var ts; /** * Hook for node emit notifications. * - * @param emitContext A context hint for the emitter. + * @param hint A hint as to the intended usage of the node. * @param node The node to emit. - * @param emit A callback used to emit the node in the printer. + * @param emitCallback A callback used to emit the node in the printer. */ - function onEmitNode(emitContext, node, emitCallback) { - if (node.kind === 261 /* SourceFile */) { + function onEmitNode(hint, node, emitCallback) { + if (node.kind === 264 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -55564,14 +60820,14 @@ var ts; if (noSubstitution) { delete noSubstitutionMap[id]; } - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); currentSourceFile = undefined; moduleInfo = undefined; exportFunction = undefined; noSubstitution = undefined; } else { - previousOnEmitNode(emitContext, node, emitCallback); + previousOnEmitNode(hint, node, emitCallback); } } // @@ -55580,15 +60836,15 @@ var ts; /** * Hooks node substitutions. * - * @param emitContext A context hint for the emitter. + * @param hint A hint as to the intended usage of the node. * @param node The node to substitute. */ - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); if (isSubstitutionPrevented(node)) { return node; } - if (emitContext === 1 /* Expression */) { + if (hint === 1 /* Expression */) { return substituteExpression(node); } return node; @@ -55602,10 +60858,10 @@ var ts; switch (node.kind) { case 70 /* Identifier */: return substituteExpressionIdentifier(node); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return substituteBinaryExpression(node); - case 190 /* PrefixUnaryExpression */: - case 191 /* PostfixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -55633,1072 +60889,11 @@ var ts; var importDeclaration = resolver.getReferencedImportDeclaration(node); if (importDeclaration) { if (ts.isImportClause(importDeclaration)) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default"), + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default")), /*location*/ node); } else if (ts.isImportSpecifier(importDeclaration)) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(importDeclaration.propertyName || importDeclaration.name), - /*location*/ node); - } - } - } - return node; - } - /** - * Substitution for a BinaryExpression that may contain an imported or exported symbol. - * - * @param node The node to substitute. - */ - function substituteBinaryExpression(node) { - // When we see an assignment expression whose left-hand side is an exported symbol, - // we should ensure all exports of that symbol are updated with the correct value. - // - // - We do not substitute generated identifiers for any reason. - // - We do not substitute identifiers tagged with the LocalName flag. - // - We do not substitute identifiers that were originally the name of an enum or - // namespace due to how they are transformed in TypeScript. - // - We only substitute identifiers that are exported at the top level. - if (ts.isAssignmentOperator(node.operatorToken.kind) - && ts.isIdentifier(node.left) - && !ts.isGeneratedIdentifier(node.left) - && !ts.isLocalName(node.left) - && !ts.isDeclarationNameOfEnumOrNamespace(node.left)) { - var exportedNames = getExports(node.left); - if (exportedNames) { - // For each additional export of the declaration, apply an export assignment. - var expression = node; - for (var _i = 0, exportedNames_1 = exportedNames; _i < exportedNames_1.length; _i++) { - var exportName = exportedNames_1[_i]; - expression = createExportExpression(exportName, preventSubstitution(expression)); - } - return expression; - } - } - return node; - } - /** - * Substitution for a UnaryExpression that may contain an imported or exported symbol. - * - * @param node The node to substitute. - */ - function substituteUnaryExpression(node) { - // When we see a prefix or postfix increment expression whose operand is an exported - // symbol, we should ensure all exports of that symbol are updated with the correct - // value. - // - // - We do not substitute generated identifiers for any reason. - // - We do not substitute identifiers tagged with the LocalName flag. - // - We do not substitute identifiers that were originally the name of an enum or - // namespace due to how they are transformed in TypeScript. - // - We only substitute identifiers that are exported at the top level. - if ((node.operator === 42 /* PlusPlusToken */ || node.operator === 43 /* MinusMinusToken */) - && ts.isIdentifier(node.operand) - && !ts.isGeneratedIdentifier(node.operand) - && !ts.isLocalName(node.operand) - && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { - var exportedNames = getExports(node.operand); - if (exportedNames) { - var expression = node.kind === 191 /* PostfixUnaryExpression */ - ? ts.createPrefix(node.operator, node.operand, - /*location*/ node) - : node; - for (var _i = 0, exportedNames_2 = exportedNames; _i < exportedNames_2.length; _i++) { - var exportName = exportedNames_2[_i]; - expression = createExportExpression(exportName, preventSubstitution(expression)); - } - if (node.kind === 191 /* PostfixUnaryExpression */) { - expression = node.operator === 42 /* PlusPlusToken */ - ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) - : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); - } - return expression; - } - } - return node; - } - /** - * Gets the exports of a name. - * - * @param name The name. - */ - function getExports(name) { - var exportedNames; - if (!ts.isGeneratedIdentifier(name)) { - var valueDeclaration = resolver.getReferencedImportDeclaration(name) - || resolver.getReferencedValueDeclaration(name); - if (valueDeclaration) { - var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 261 /* SourceFile */) { - exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); - } - exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); - } - } - return exportedNames; - } - /** - * Prevent substitution of a node for this transformer. - * - * @param node The node which should not be substituted. - */ - function preventSubstitution(node) { - if (noSubstitution === undefined) - noSubstitution = ts.createMap(); - noSubstitution[ts.getNodeId(node)] = true; - return node; - } - /** - * Determines whether a node should not be substituted. - * - * @param node The node to test. - */ - function isSubstitutionPrevented(node) { - return noSubstitution && node.id && noSubstitution[node.id]; - } - } - ts.transformSystemModule = transformSystemModule; -})(ts || (ts = {})); -/// -/// -/*@internal*/ -var ts; -(function (ts) { - function transformModule(context) { - var transformModuleDelegates = ts.createMap((_a = {}, - _a[ts.ModuleKind.None] = transformCommonJSModule, - _a[ts.ModuleKind.CommonJS] = transformCommonJSModule, - _a[ts.ModuleKind.AMD] = transformAMDModule, - _a[ts.ModuleKind.UMD] = transformUMDModule, - _a)); - var startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; - var compilerOptions = context.getCompilerOptions(); - var resolver = context.getEmitResolver(); - var host = context.getEmitHost(); - var languageVersion = ts.getEmitScriptTarget(compilerOptions); - var moduleKind = ts.getEmitModuleKind(compilerOptions); - var previousOnSubstituteNode = context.onSubstituteNode; - var previousOnEmitNode = context.onEmitNode; - context.onSubstituteNode = onSubstituteNode; - context.onEmitNode = onEmitNode; - context.enableSubstitution(70 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(192 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(190 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(191 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(258 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(261 /* SourceFile */); // Restore state when substituting nodes in a file. - var moduleInfoMap = ts.createMap(); // The ExternalModuleInfo for each file. - var deferredExports = ts.createMap(); // Exports to defer until an EndOfDeclarationMarker is found. - var currentSourceFile; // The current file. - var currentModuleInfo; // The ExternalModuleInfo for the current file. - var noSubstitution; // Set of nodes for which substitution rules should be ignored. - return transformSourceFile; - /** - * Transforms the module aspects of a SourceFile. - * - * @param node The SourceFile node. - */ - function transformSourceFile(node) { - if (ts.isDeclarationFile(node) - || !(ts.isExternalModule(node) - || compilerOptions.isolatedModules)) { - return node; - } - currentSourceFile = node; - currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(node)] = ts.collectExternalModuleInfo(node, resolver, compilerOptions); - // Perform the transformation. - var transformModule = transformModuleDelegates[moduleKind] || transformModuleDelegates[ts.ModuleKind.None]; - var updated = transformModule(node); - currentSourceFile = undefined; - currentModuleInfo = undefined; - return ts.aggregateTransformFlags(updated); - } - /** - * Transforms a SourceFile into a CommonJS module. - * - * @param node The SourceFile node. - */ - function transformCommonJSModule(node) { - startLexicalEnvironment(); - var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.statements, /*ensureUseStrict*/ !compilerOptions.noImplicitUseStrict, sourceElementVisitor); - ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement, /*optional*/ true)); - ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); - ts.addRange(statements, endLexicalEnvironment()); - addExportEqualsIfNeeded(statements, /*emitAsReturn*/ false); - var updated = ts.updateSourceFileNode(node, ts.createNodeArray(statements, node.statements)); - if (currentModuleInfo.hasExportStarsToExportValues) { - ts.addEmitHelper(updated, exportStarHelper); - } - return updated; - } - /** - * Transforms a SourceFile into an AMD module. - * - * @param node The SourceFile node. - */ - function transformAMDModule(node) { - var define = ts.createIdentifier("define"); - var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions); - return transformAsynchronousModule(node, define, moduleName, /*includeNonAmdDependencies*/ true); - } - /** - * Transforms a SourceFile into a UMD module. - * - * @param node The SourceFile node. - */ - function transformUMDModule(node) { - var define = ts.createRawExpression(umdHelper); - return transformAsynchronousModule(node, define, /*moduleName*/ undefined, /*includeNonAmdDependencies*/ false); - } - /** - * Transforms a SourceFile into an AMD or UMD module. - * - * @param node The SourceFile node. - * @param define The expression used to define the module. - * @param moduleName An expression for the module name, if available. - * @param includeNonAmdDependencies A value indicating whether to incldue any non-AMD dependencies. - */ - function transformAsynchronousModule(node, define, moduleName, includeNonAmdDependencies) { - // An AMD define function has the following shape: - // - // define(id?, dependencies?, factory); - // - // This has the shape of the following: - // - // define(name, ["module1", "module2"], function (module1Alias) { ... } - // - // The location of the alias in the parameter list in the factory function needs to - // match the position of the module name in the dependency list. - // - // To ensure this is true in cases of modules with no aliases, e.g.: - // - // import "module" - // - // or - // - // /// - // - // we need to add modules without alias names to the end of the dependencies list - var _a = collectAsynchronousDependencies(node, includeNonAmdDependencies), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames; - // Create an updated SourceFile: - // - // define(moduleName?, ["module1", "module2"], function ... - return ts.updateSourceFileNode(node, ts.createNodeArray([ - ts.createStatement(ts.createCall(define, - /*typeArguments*/ undefined, (moduleName ? [moduleName] : []).concat([ - // Add the dependency array argument: - // - // ["require", "exports", module1", "module2", ...] - ts.createArrayLiteral([ - ts.createLiteral("require"), - ts.createLiteral("exports") - ].concat(aliasedModuleNames, unaliasedModuleNames)), - // Add the module body function argument: - // - // function (require, exports, module1, module2) ... - ts.createFunctionExpression( - /*modifiers*/ undefined, - /*asteriskToken*/ undefined, - /*name*/ undefined, - /*typeParameters*/ undefined, [ - ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "require"), - ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "exports") - ].concat(importAliasNames), - /*type*/ undefined, transformAsynchronousModuleBody(node)) - ]))) - ], - /*location*/ node.statements)); - } - /** - * Collect the additional asynchronous dependencies for the module. - * - * @param node The source file. - * @param includeNonAmdDependencies A value indicating whether to include non-AMD dependencies. - */ - function collectAsynchronousDependencies(node, includeNonAmdDependencies) { - // names of modules with corresponding parameter in the factory function - var aliasedModuleNames = []; - // names of modules with no corresponding parameters in factory function - var unaliasedModuleNames = []; - // names of the parameters in the factory function; these - // parameters need to match the indexes of the corresponding - // module names in aliasedModuleNames. - var importAliasNames = []; - // Fill in amd-dependency tags - for (var _i = 0, _a = node.amdDependencies; _i < _a.length; _i++) { - var amdDependency = _a[_i]; - if (amdDependency.name) { - aliasedModuleNames.push(ts.createLiteral(amdDependency.path)); - importAliasNames.push(ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, amdDependency.name)); - } - else { - unaliasedModuleNames.push(ts.createLiteral(amdDependency.path)); - } - } - for (var _b = 0, _c = currentModuleInfo.externalImports; _b < _c.length; _b++) { - var importNode = _c[_b]; - // Find the name of the external module - var externalModuleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions); - // Find the name of the module alias, if there is one - var importAliasName = ts.getLocalNameForExternalImport(importNode, currentSourceFile); - if (includeNonAmdDependencies && importAliasName) { - // Set emitFlags on the name of the classDeclaration - // This is so that when printer will not substitute the identifier - ts.setEmitFlags(importAliasName, 4 /* NoSubstitution */); - aliasedModuleNames.push(externalModuleName); - importAliasNames.push(ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, importAliasName)); - } - else { - unaliasedModuleNames.push(externalModuleName); - } - } - return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames }; - } - /** - * Transforms a SourceFile into an AMD or UMD module body. - * - * @param node The SourceFile node. - */ - function transformAsynchronousModuleBody(node) { - startLexicalEnvironment(); - var statements = []; - var statementOffset = ts.addPrologueDirectives(statements, node.statements, /*ensureUseStrict*/ !compilerOptions.noImplicitUseStrict, sourceElementVisitor); - // Visit each statement of the module body. - ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement, /*optional*/ true)); - ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); - // End the lexical environment for the module body - // and merge any new lexical declarations. - ts.addRange(statements, endLexicalEnvironment()); - // Append the 'export =' statement if provided. - addExportEqualsIfNeeded(statements, /*emitAsReturn*/ true); - var body = ts.createBlock(statements, /*location*/ undefined, /*multiLine*/ true); - if (currentModuleInfo.hasExportStarsToExportValues) { - // If we have any `export * from ...` declarations - // we need to inform the emitter to add the __export helper. - ts.addEmitHelper(body, exportStarHelper); - } - return body; - } - /** - * Adds the down-level representation of `export=` to the statement list if one exists - * in the source file. - * - * @param statements The Statement list to modify. - * @param emitAsReturn A value indicating whether to emit the `export=` statement as a - * return statement. - */ - function addExportEqualsIfNeeded(statements, emitAsReturn) { - if (currentModuleInfo.exportEquals) { - if (emitAsReturn) { - var statement = ts.createReturn(currentModuleInfo.exportEquals.expression, - /*location*/ currentModuleInfo.exportEquals); - ts.setEmitFlags(statement, 384 /* NoTokenSourceMaps */ | 1536 /* NoComments */); - statements.push(statement); - } - else { - var statement = ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), currentModuleInfo.exportEquals.expression), - /*location*/ currentModuleInfo.exportEquals); - ts.setEmitFlags(statement, 1536 /* NoComments */); - statements.push(statement); - } - } - } - // - // Top-Level Source Element Visitors - // - /** - * Visits a node at the top level of the source file. - * - * @param node The node to visit. - */ - function sourceElementVisitor(node) { - switch (node.kind) { - case 235 /* ImportDeclaration */: - return visitImportDeclaration(node); - case 234 /* ImportEqualsDeclaration */: - return visitImportEqualsDeclaration(node); - case 241 /* ExportDeclaration */: - return visitExportDeclaration(node); - case 240 /* ExportAssignment */: - return visitExportAssignment(node); - case 205 /* VariableStatement */: - return visitVariableStatement(node); - case 225 /* FunctionDeclaration */: - return visitFunctionDeclaration(node); - case 226 /* ClassDeclaration */: - return visitClassDeclaration(node); - case 295 /* MergeDeclarationMarker */: - return visitMergeDeclarationMarker(node); - case 296 /* EndOfDeclarationMarker */: - return visitEndOfDeclarationMarker(node); - default: - // This visitor does not descend into the tree, as export/import statements - // are only transformed at the top level of a file. - return node; - } - } - /** - * Visits an ImportDeclaration node. - * - * @param node The node to visit. - */ - function visitImportDeclaration(node) { - var statements; - var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); - if (moduleKind !== ts.ModuleKind.AMD) { - if (!node.importClause) { - // import "mod"; - return ts.createStatement(createRequireCall(node), /*location*/ node); - } - else { - var variables = []; - if (namespaceDeclaration && !ts.isDefaultImport(node)) { - // import * as n from "mod"; - variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), - /*type*/ undefined, createRequireCall(node))); - } - else { - // import d from "mod"; - // import { x, y } from "mod"; - // import d, { x, y } from "mod"; - // import d, * as n from "mod"; - variables.push(ts.createVariableDeclaration(ts.getGeneratedNameForNode(node), - /*type*/ undefined, createRequireCall(node))); - if (namespaceDeclaration && ts.isDefaultImport(node)) { - variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), - /*type*/ undefined, ts.getGeneratedNameForNode(node))); - } - } - statements = ts.append(statements, ts.createVariableStatement( - /*modifiers*/ undefined, ts.createVariableDeclarationList(variables, - /*location*/ undefined, languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */), - /*location*/ node)); - } - } - else if (namespaceDeclaration && ts.isDefaultImport(node)) { - // import d, * as n from "mod"; - statements = ts.append(statements, ts.createVariableStatement( - /*modifiers*/ undefined, ts.createVariableDeclarationList([ - ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), - /*type*/ undefined, ts.getGeneratedNameForNode(node), - /*location*/ node) - ], - /*location*/ undefined, languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */))); - } - if (hasAssociatedEndOfDeclarationMarker(node)) { - // Defer exports until we encounter an EndOfDeclarationMarker node - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfImportDeclaration(deferredExports[id], node); - } - else { - statements = appendExportsOfImportDeclaration(statements, node); - } - return ts.singleOrMany(statements); - } - /** - * Creates a `require()` call to import an external module. - * - * @param importNode The declararation to import. - */ - function createRequireCall(importNode) { - var moduleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions); - var args = []; - if (moduleName) { - args.push(moduleName); - } - return ts.createCall(ts.createIdentifier("require"), /*typeArguments*/ undefined, args); - } - /** - * Visits an ImportEqualsDeclaration node. - * - * @param node The node to visit. - */ - function visitImportEqualsDeclaration(node) { - ts.Debug.assert(ts.isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer."); - var statements; - if (moduleKind !== ts.ModuleKind.AMD) { - if (ts.hasModifier(node, 1 /* Export */)) { - statements = ts.append(statements, ts.createStatement(createExportExpression(node.name, createRequireCall(node)), - /*location*/ node)); - } - else { - statements = ts.append(statements, ts.createVariableStatement( - /*modifiers*/ undefined, ts.createVariableDeclarationList([ - ts.createVariableDeclaration(ts.getSynthesizedClone(node.name), - /*type*/ undefined, createRequireCall(node)) - ], - /*location*/ undefined, - /*flags*/ languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */), - /*location*/ node)); - } - } - else { - if (ts.hasModifier(node, 1 /* Export */)) { - statements = ts.append(statements, ts.createStatement(createExportExpression(ts.getExportName(node), ts.getLocalName(node)), - /*location*/ node)); - } - } - if (hasAssociatedEndOfDeclarationMarker(node)) { - // Defer exports until we encounter an EndOfDeclarationMarker node - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfImportEqualsDeclaration(deferredExports[id], node); - } - else { - statements = appendExportsOfImportEqualsDeclaration(statements, node); - } - return ts.singleOrMany(statements); - } - /** - * Visits an ExportDeclaration node. - * - * @param The node to visit. - */ - function visitExportDeclaration(node) { - if (!node.moduleSpecifier) { - // Elide export declarations with no module specifier as they are handled - // elsewhere. - return undefined; - } - var generatedName = ts.getGeneratedNameForNode(node); - if (node.exportClause) { - var statements = []; - // export { x, y } from "mod"; - if (moduleKind !== ts.ModuleKind.AMD) { - statements.push(ts.createVariableStatement( - /*modifiers*/ undefined, ts.createVariableDeclarationList([ - ts.createVariableDeclaration(generatedName, - /*type*/ undefined, createRequireCall(node)) - ]), - /*location*/ node)); - } - for (var _i = 0, _a = node.exportClause.elements; _i < _a.length; _i++) { - var specifier = _a[_i]; - var exportedValue = ts.createPropertyAccess(generatedName, specifier.propertyName || specifier.name); - statements.push(ts.createStatement(createExportExpression(ts.getExportName(specifier), exportedValue), - /*location*/ specifier)); - } - return ts.singleOrMany(statements); - } - else { - // export * from "mod"; - return ts.createStatement(ts.createCall(ts.createIdentifier("__export"), - /*typeArguments*/ undefined, [ - moduleKind !== ts.ModuleKind.AMD - ? createRequireCall(node) - : generatedName - ]), - /*location*/ node); - } - } - /** - * Visits an ExportAssignment node. - * - * @param node The node to visit. - */ - function visitExportAssignment(node) { - if (node.isExportEquals) { - return undefined; - } - var statements; - var original = node.original; - if (original && hasAssociatedEndOfDeclarationMarker(original)) { - // Defer exports until we encounter an EndOfDeclarationMarker node - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportStatement(deferredExports[id], ts.createIdentifier("default"), node.expression, /*location*/ node, /*allowComments*/ true); - } - else { - statements = appendExportStatement(statements, ts.createIdentifier("default"), node.expression, /*location*/ node, /*allowComments*/ true); - } - return ts.singleOrMany(statements); - } - /** - * Visits a FunctionDeclaration node. - * - * @param node The node to visit. - */ - function visitFunctionDeclaration(node) { - var statements; - if (ts.hasModifier(node, 1 /* Export */)) { - statements = ts.append(statements, ts.setOriginalNode(ts.createFunctionDeclaration( - /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, ts.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), - /*typeParameters*/ undefined, node.parameters, - /*type*/ undefined, node.body, - /*location*/ node), - /*original*/ node)); - } - else { - statements = ts.append(statements, node); - } - if (hasAssociatedEndOfDeclarationMarker(node)) { - // Defer exports until we encounter an EndOfDeclarationMarker node - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node); - } - else { - statements = appendExportsOfHoistedDeclaration(statements, node); - } - return ts.singleOrMany(statements); - } - /** - * Visits a ClassDeclaration node. - * - * @param node The node to visit. - */ - function visitClassDeclaration(node) { - var statements; - if (ts.hasModifier(node, 1 /* Export */)) { - statements = ts.append(statements, ts.setOriginalNode(ts.createClassDeclaration( - /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), - /*typeParameters*/ undefined, node.heritageClauses, node.members, - /*location*/ node), - /*original*/ node)); - } - else { - statements = ts.append(statements, node); - } - if (hasAssociatedEndOfDeclarationMarker(node)) { - // Defer exports until we encounter an EndOfDeclarationMarker node - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node); - } - else { - statements = appendExportsOfHoistedDeclaration(statements, node); - } - return ts.singleOrMany(statements); - } - /** - * Visits a VariableStatement node. - * - * @param node The node to visit. - */ - function visitVariableStatement(node) { - var statements; - var variables; - var expressions; - if (ts.hasModifier(node, 1 /* Export */)) { - var modifiers = void 0; - // If we're exporting these variables, then these just become assignments to 'exports.x'. - // We only want to emit assignments for variables with initializers. - for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { - var variable = _a[_i]; - if (ts.isIdentifier(variable.name) && ts.isLocalName(variable.name)) { - if (!modifiers) { - modifiers = ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier); - } - variables = ts.append(variables, variable); - } - else if (variable.initializer) { - expressions = ts.append(expressions, transformInitializedVariable(variable)); - } - } - if (variables) { - statements = ts.append(statements, ts.updateVariableStatement(node, modifiers, ts.updateVariableDeclarationList(node.declarationList, variables))); - } - if (expressions) { - statements = ts.append(statements, ts.createStatement(ts.inlineExpressions(expressions), /*location*/ node)); - } - } - else { - statements = ts.append(statements, node); - } - if (hasAssociatedEndOfDeclarationMarker(node)) { - // Defer exports until we encounter an EndOfDeclarationMarker node - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node); - } - else { - statements = appendExportsOfVariableStatement(statements, node); - } - return ts.singleOrMany(statements); - } - /** - * Transforms an exported variable with an initializer into an expression. - * - * @param node The node to transform. - */ - function transformInitializedVariable(node) { - if (ts.isBindingPattern(node.name)) { - return ts.flattenDestructuringAssignment(node, - /*visitor*/ undefined, context, 0 /* All */, - /*needsValue*/ false, createExportExpression); - } - else { - return ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("exports"), node.name, - /*location*/ node.name), node.initializer); - } - } - /** - * Visits a MergeDeclarationMarker used as a placeholder for the beginning of a merged - * and transformed declaration. - * - * @param node The node to visit. - */ - function visitMergeDeclarationMarker(node) { - // For an EnumDeclaration or ModuleDeclaration that merges with a preceeding - // declaration we do not emit a leading variable declaration. To preserve the - // begin/end semantics of the declararation and to properly handle exports - // we wrapped the leading variable declaration in a `MergeDeclarationMarker`. - // - // To balance the declaration, add the exports of the elided variable - // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 205 /* VariableStatement */) { - var id = ts.getOriginalNodeId(node); - deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); - } - return node; - } - /** - * Determines whether a node has an associated EndOfDeclarationMarker. - * - * @param node The node to test. - */ - function hasAssociatedEndOfDeclarationMarker(node) { - return (ts.getEmitFlags(node) & 2097152 /* HasEndOfDeclarationMarker */) !== 0; - } - /** - * Visits a DeclarationMarker used as a placeholder for the end of a transformed - * declaration. - * - * @param node The node to visit. - */ - function visitEndOfDeclarationMarker(node) { - // For some transformations we emit an `EndOfDeclarationMarker` to mark the actual - // end of the transformed declaration. We use this marker to emit any deferred exports - // of the declaration. - var id = ts.getOriginalNodeId(node); - var statements = deferredExports[id]; - if (statements) { - delete deferredExports[id]; - return ts.append(statements, node); - } - return node; - } - /** - * Appends the exports of an ImportDeclaration to a statement list, returning the - * statement list. - * - * @param statements A statement list to which the down-level export statements are to be - * appended. If `statements` is `undefined`, a new array is allocated if statements are - * appended. - * @param decl The declaration whose exports are to be recorded. - */ - function appendExportsOfImportDeclaration(statements, decl) { - if (currentModuleInfo.exportEquals) { - return statements; - } - var importClause = decl.importClause; - if (!importClause) { - return statements; - } - if (importClause.name) { - statements = appendExportsOfDeclaration(statements, importClause); - } - var namedBindings = importClause.namedBindings; - if (namedBindings) { - switch (namedBindings.kind) { - case 237 /* NamespaceImport */: - statements = appendExportsOfDeclaration(statements, namedBindings); - break; - case 238 /* NamedImports */: - for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { - var importBinding = _a[_i]; - statements = appendExportsOfDeclaration(statements, importBinding); - } - break; - } - } - return statements; - } - /** - * Appends the exports of an ImportEqualsDeclaration to a statement list, returning the - * statement list. - * - * @param statements A statement list to which the down-level export statements are to be - * appended. If `statements` is `undefined`, a new array is allocated if statements are - * appended. - * @param decl The declaration whose exports are to be recorded. - */ - function appendExportsOfImportEqualsDeclaration(statements, decl) { - if (currentModuleInfo.exportEquals) { - return statements; - } - return appendExportsOfDeclaration(statements, decl); - } - /** - * Appends the exports of a VariableStatement to a statement list, returning the statement - * list. - * - * @param statements A statement list to which the down-level export statements are to be - * appended. If `statements` is `undefined`, a new array is allocated if statements are - * appended. - * @param node The VariableStatement whose exports are to be recorded. - */ - function appendExportsOfVariableStatement(statements, node) { - if (currentModuleInfo.exportEquals) { - return statements; - } - for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { - var decl = _a[_i]; - statements = appendExportsOfBindingElement(statements, decl); - } - return statements; - } - /** - * Appends the exports of a VariableDeclaration or BindingElement to a statement list, - * returning the statement list. - * - * @param statements A statement list to which the down-level export statements are to be - * appended. If `statements` is `undefined`, a new array is allocated if statements are - * appended. - * @param decl The declaration whose exports are to be recorded. - */ - function appendExportsOfBindingElement(statements, decl) { - if (currentModuleInfo.exportEquals) { - return statements; - } - if (ts.isBindingPattern(decl.name)) { - for (var _i = 0, _a = decl.name.elements; _i < _a.length; _i++) { - var element = _a[_i]; - if (!ts.isOmittedExpression(element)) { - statements = appendExportsOfBindingElement(statements, element); - } - } - } - else if (!ts.isGeneratedIdentifier(decl.name)) { - statements = appendExportsOfDeclaration(statements, decl); - } - return statements; - } - /** - * Appends the exports of a ClassDeclaration or FunctionDeclaration to a statement list, - * returning the statement list. - * - * @param statements A statement list to which the down-level export statements are to be - * appended. If `statements` is `undefined`, a new array is allocated if statements are - * appended. - * @param decl The declaration whose exports are to be recorded. - */ - function appendExportsOfHoistedDeclaration(statements, decl) { - if (currentModuleInfo.exportEquals) { - return statements; - } - if (ts.hasModifier(decl, 1 /* Export */)) { - var exportName = ts.hasModifier(decl, 512 /* Default */) ? ts.createIdentifier("default") : decl.name; - statements = appendExportStatement(statements, exportName, ts.getLocalName(decl), /*location*/ decl); - } - if (decl.name) { - statements = appendExportsOfDeclaration(statements, decl); - } - return statements; - } - /** - * Appends the exports of a declaration to a statement list, returning the statement list. - * - * @param statements A statement list to which the down-level export statements are to be - * appended. If `statements` is `undefined`, a new array is allocated if statements are - * appended. - * @param decl The declaration to export. - */ - function appendExportsOfDeclaration(statements, decl) { - var name = ts.getDeclarationName(decl); - var exportSpecifiers = currentModuleInfo.exportSpecifiers[name.text]; - if (exportSpecifiers) { - for (var _i = 0, exportSpecifiers_2 = exportSpecifiers; _i < exportSpecifiers_2.length; _i++) { - var exportSpecifier = exportSpecifiers_2[_i]; - statements = appendExportStatement(statements, exportSpecifier.name, name, /*location*/ exportSpecifier.name); - } - } - return statements; - } - /** - * Appends the down-level representation of an export to a statement list, returning the - * statement list. - * - * @param statements A statement list to which the down-level export statements are to be - * appended. If `statements` is `undefined`, a new array is allocated if statements are - * appended. - * @param exportName The name of the export. - * @param expression The expression to export. - * @param location The location to use for source maps and comments for the export. - * @param allowComments Whether to allow comments on the export. - */ - function appendExportStatement(statements, exportName, expression, location, allowComments) { - if (exportName.text === "default") { - var sourceFile = ts.getOriginalNode(currentSourceFile, ts.isSourceFile); - if (sourceFile && !sourceFile.symbol.exports["___esModule"]) { - if (languageVersion === 0 /* ES3 */) { - statements = ts.append(statements, ts.createStatement(createExportExpression(ts.createIdentifier("__esModule"), ts.createLiteral(true)))); - } - else { - statements = ts.append(statements, ts.createStatement(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), - /*typeArguments*/ undefined, [ - ts.createIdentifier("exports"), - ts.createLiteral("__esModule"), - ts.createObjectLiteral([ - ts.createPropertyAssignment("value", ts.createLiteral(true)) - ]) - ]))); - } - } - } - statements = ts.append(statements, createExportStatement(exportName, expression, location, allowComments)); - return statements; - } - /** - * Creates a call to the current file's export function to export a value. - * - * @param name The bound name of the export. - * @param value The exported value. - * @param location The location to use for source maps and comments for the export. - * @param allowComments An optional value indicating whether to emit comments for the statement. - */ - function createExportStatement(name, value, location, allowComments) { - var statement = ts.createStatement(createExportExpression(name, value), location); - ts.startOnNewLine(statement); - if (!allowComments) { - ts.setEmitFlags(statement, 1536 /* NoComments */); - } - return statement; - } - /** - * Creates a call to the current file's export function to export a value. - * - * @param name The bound name of the export. - * @param value The exported value. - * @param location The location to use for source maps and comments for the export. - */ - function createExportExpression(name, value, location) { - return ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(name)), value, location); - } - // - // Modifier Visitors - // - /** - * Visit nodes to elide module-specific modifiers. - * - * @param node The node to visit. - */ - function modifierVisitor(node) { - // Elide module-specific modifiers. - switch (node.kind) { - case 83 /* ExportKeyword */: - case 78 /* DefaultKeyword */: - return undefined; - } - return node; - } - // - // Emit Notification - // - /** - * Hook for node emit notifications. - * - * @param emitContext A context hint for the emitter. - * @param node The node to emit. - * @param emit A callback used to emit the node in the printer. - */ - function onEmitNode(emitContext, node, emitCallback) { - if (node.kind === 261 /* SourceFile */) { - currentSourceFile = node; - currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; - noSubstitution = ts.createMap(); - previousOnEmitNode(emitContext, node, emitCallback); - currentSourceFile = undefined; - currentModuleInfo = undefined; - noSubstitution = undefined; - } - else { - previousOnEmitNode(emitContext, node, emitCallback); - } - } - // - // Substitutions - // - /** - * Hooks node substitutions. - * - * @param emitContext A context hint for the emitter. - * @param node The node to substitute. - */ - function onSubstituteNode(emitContext, node) { - node = previousOnSubstituteNode(emitContext, node); - if (node.id && noSubstitution[node.id]) { - return node; - } - if (emitContext === 1 /* Expression */) { - return substituteExpression(node); - } - else if (ts.isShorthandPropertyAssignment(node)) { - return substituteShorthandPropertyAssignment(node); - } - return node; - } - /** - * Substitution for a ShorthandPropertyAssignment whose declaration name is an imported - * or exported symbol. - * - * @param node The node to substitute. - */ - function substituteShorthandPropertyAssignment(node) { - var name = node.name; - var exportedOrImportedName = substituteExpressionIdentifier(name); - if (exportedOrImportedName !== name) { - // A shorthand property with an assignment initializer is probably part of a - // destructuring assignment - if (node.objectAssignmentInitializer) { - var initializer = ts.createAssignment(exportedOrImportedName, node.objectAssignmentInitializer); - return ts.createPropertyAssignment(name, initializer, /*location*/ node); - } - return ts.createPropertyAssignment(name, exportedOrImportedName, /*location*/ node); - } - return node; - } - /** - * Substitution for an Expression that may contain an imported or exported symbol. - * - * @param node The node to substitute. - */ - function substituteExpression(node) { - switch (node.kind) { - case 70 /* Identifier */: - return substituteExpressionIdentifier(node); - case 192 /* BinaryExpression */: - return substituteBinaryExpression(node); - case 191 /* PostfixUnaryExpression */: - case 190 /* PrefixUnaryExpression */: - return substituteUnaryExpression(node); - } - return node; - } - /** - * Substitution for an Identifier expression that may contain an imported or exported - * symbol. - * - * @param node The node to substitute. - */ - function substituteExpressionIdentifier(node) { - if (ts.getEmitFlags(node) & 4096 /* HelperName */) { - var externalHelpersModuleName = ts.getExternalHelpersModuleName(currentSourceFile); - if (externalHelpersModuleName) { - return ts.createPropertyAccess(externalHelpersModuleName, node); - } - return node; - } - if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { - var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 261 /* SourceFile */) { - return ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node), - /*location*/ node); - } - var importDeclaration = resolver.getReferencedImportDeclaration(node); - if (importDeclaration) { - if (ts.isImportClause(importDeclaration)) { - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default"), - /*location*/ node); - } - else if (ts.isImportSpecifier(importDeclaration)) { - var name_37 = importDeclaration.propertyName || importDeclaration.name; - return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(name_37), + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(importDeclaration.propertyName || importDeclaration.name)), /*location*/ node); } } @@ -56730,9 +60925,7 @@ var ts; var expression = node; for (var _i = 0, exportedNames_3 = exportedNames; _i < exportedNames_3.length; _i++) { var exportName = exportedNames_3[_i]; - // Mark the node to prevent triggering this rule again. - noSubstitution[ts.getNodeId(expression)] = true; - expression = createExportExpression(exportName, expression, /*location*/ node); + expression = createExportExpression(exportName, preventSubstitution(expression)); } return expression; } @@ -56761,15 +60954,17 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 191 /* PostfixUnaryExpression */ - ? ts.createBinary(node.operand, ts.createToken(node.operator === 42 /* PlusPlusToken */ ? 58 /* PlusEqualsToken */ : 59 /* MinusEqualsToken */), ts.createLiteral(1), - /*location*/ node) + var expression = node.kind === 192 /* PostfixUnaryExpression */ + ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_4 = exportedNames; _i < exportedNames_4.length; _i++) { var exportName = exportedNames_4[_i]; - // Mark the node to prevent triggering this rule again. - noSubstitution[ts.getNodeId(expression)] = true; - expression = createExportExpression(exportName, expression); + expression = createExportExpression(exportName, preventSubstitution(expression)); + } + if (node.kind === 192 /* PostfixUnaryExpression */) { + expression = node.operator === 42 /* PlusPlusToken */ + ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) + : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); } return expression; } @@ -56777,31 +60972,144 @@ var ts; return node; } /** - * Gets the additional exports of a name. + * Gets the exports of a name. * * @param name The name. */ function getExports(name) { + var exportedNames; if (!ts.isGeneratedIdentifier(name)) { var valueDeclaration = resolver.getReferencedImportDeclaration(name) || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { - return currentModuleInfo - && currentModuleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]; + var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); + if (exportContainer && exportContainer.kind === 264 /* SourceFile */) { + exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); + } + exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); } } + return exportedNames; + } + /** + * Prevent substitution of a node for this transformer. + * + * @param node The node which should not be substituted. + */ + function preventSubstitution(node) { + if (noSubstitution === undefined) + noSubstitution = []; + noSubstitution[ts.getNodeId(node)] = true; + return node; + } + /** + * Determines whether a node should not be substituted. + * + * @param node The node to test. + */ + function isSubstitutionPrevented(node) { + return noSubstitution && node.id && noSubstitution[node.id]; } - var _a; } - ts.transformModule = transformModule; - // emit output for the __export helper function - var exportStarHelper = { - name: "typescript:export-star", - scoped: true, - text: "\n function __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n }" - }; - // emit output for the UMD helper function. - var umdHelper = "\n (function (dependencies, factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define(dependencies, factory);\n }\n })"; + ts.transformSystemModule = transformSystemModule; +})(ts || (ts = {})); +/// +/// +/*@internal*/ +var ts; +(function (ts) { + function transformES2015Module(context) { + var compilerOptions = context.getCompilerOptions(); + var previousOnEmitNode = context.onEmitNode; + var previousOnSubstituteNode = context.onSubstituteNode; + context.onEmitNode = onEmitNode; + context.onSubstituteNode = onSubstituteNode; + context.enableEmitNotification(264 /* SourceFile */); + context.enableSubstitution(70 /* Identifier */); + var currentSourceFile; + return transformSourceFile; + function transformSourceFile(node) { + if (ts.isDeclarationFile(node)) { + return node; + } + if (ts.isExternalModule(node) || compilerOptions.isolatedModules) { + var externalHelpersModuleName = ts.getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions); + if (externalHelpersModuleName) { + var statements = []; + var statementOffset = ts.addPrologue(statements, node.statements); + ts.append(statements, ts.createImportDeclaration( + /*decorators*/ undefined, + /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText))); + ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset)); + return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements)); + } + else { + return ts.visitEachChild(node, visitor, context); + } + } + return node; + } + function visitor(node) { + switch (node.kind) { + case 236 /* ImportEqualsDeclaration */: + // Elide `import=` as it is not legal with --module ES6 + return undefined; + case 242 /* ExportAssignment */: + return visitExportAssignment(node); + } + return node; + } + function visitExportAssignment(node) { + // Elide `export=` as it is not legal with --module ES6 + return node.isExportEquals ? undefined : node; + } + // + // Emit Notification + // + /** + * Hook for node emit. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to emit. + * @param emit A callback used to emit the node in the printer. + */ + function onEmitNode(hint, node, emitCallback) { + if (ts.isSourceFile(node)) { + currentSourceFile = node; + previousOnEmitNode(hint, node, emitCallback); + currentSourceFile = undefined; + } + else { + previousOnEmitNode(hint, node, emitCallback); + } + } + // + // Substitutions + // + /** + * Hooks node substitutions. + * + * @param hint A hint as to the intended usage of the node. + * @param node The node to substitute. + */ + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (ts.isIdentifier(node) && hint === 1 /* Expression */) { + return substituteExpressionIdentifier(node); + } + return node; + } + function substituteExpressionIdentifier(node) { + if (ts.getEmitFlags(node) & 4096 /* HelperName */) { + var externalHelpersModuleName = ts.getExternalHelpersModuleName(currentSourceFile); + if (externalHelpersModuleName) { + return ts.createPropertyAccess(externalHelpersModuleName, node); + } + } + return node; + } + } + ts.transformES2015Module = transformES2015Module; })(ts || (ts = {})); /// /// @@ -56818,24 +61126,34 @@ var ts; /* @internal */ var ts; (function (ts) { - var moduleTransformerMap = ts.createMap((_a = {}, - _a[ts.ModuleKind.ES2015] = ts.transformES2015Module, - _a[ts.ModuleKind.System] = ts.transformSystemModule, - _a[ts.ModuleKind.AMD] = ts.transformModule, - _a[ts.ModuleKind.CommonJS] = ts.transformModule, - _a[ts.ModuleKind.UMD] = ts.transformModule, - _a[ts.ModuleKind.None] = ts.transformModule, - _a)); + function getModuleTransformer(moduleKind) { + switch (moduleKind) { + case ts.ModuleKind.ES2015: + return ts.transformES2015Module; + case ts.ModuleKind.System: + return ts.transformSystemModule; + default: + return ts.transformModule; + } + } + var TransformationState; + (function (TransformationState) { + TransformationState[TransformationState["Uninitialized"] = 0] = "Uninitialized"; + TransformationState[TransformationState["Initialized"] = 1] = "Initialized"; + TransformationState[TransformationState["Completed"] = 2] = "Completed"; + TransformationState[TransformationState["Disposed"] = 3] = "Disposed"; + })(TransformationState || (TransformationState = {})); var SyntaxKindFeatureFlags; (function (SyntaxKindFeatureFlags) { SyntaxKindFeatureFlags[SyntaxKindFeatureFlags["Substitution"] = 1] = "Substitution"; SyntaxKindFeatureFlags[SyntaxKindFeatureFlags["EmitNotifications"] = 2] = "EmitNotifications"; })(SyntaxKindFeatureFlags || (SyntaxKindFeatureFlags = {})); - function getTransformers(compilerOptions) { + function getTransformers(compilerOptions, customTransformers) { var jsx = compilerOptions.jsx; var languageVersion = ts.getEmitScriptTarget(compilerOptions); var moduleKind = ts.getEmitModuleKind(compilerOptions); var transformers = []; + ts.addRange(transformers, customTransformers && customTransformers.before); transformers.push(ts.transformTypeScript); if (jsx === 2 /* React */) { transformers.push(ts.transformJsx); @@ -56853,12 +61171,13 @@ var ts; transformers.push(ts.transformES2015); transformers.push(ts.transformGenerators); } - transformers.push(moduleTransformerMap[moduleKind] || moduleTransformerMap[ts.ModuleKind.None]); + transformers.push(getModuleTransformer(moduleKind)); // The ES5 transformer is last so that it can substitute expressions like `exports.default` // for ES3. if (languageVersion < 1 /* ES5 */) { transformers.push(ts.transformES5); } + ts.addRange(transformers, customTransformers && customTransformers.after); return transformers; } ts.getTransformers = getTransformers; @@ -56866,13 +61185,14 @@ var ts; * Transforms an array of SourceFiles by passing them through each transformer. * * @param resolver The emit resolver provided by the checker. - * @param host The emit host. - * @param sourceFiles An array of source files - * @param transforms An array of Transformers. + * @param host The emit host object used to interact with the file system. + * @param options Compiler options to surface in the `TransformationContext`. + * @param nodes An array of nodes to transform. + * @param transforms An array of `TransformerFactory` callbacks. + * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ - function transformFiles(resolver, host, sourceFiles, transformers) { + function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { var enabledSyntaxKindFeatures = new Array(298 /* Count */); - var lexicalEnvironmentDisabled = false; var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -56880,10 +61200,13 @@ var ts; var lexicalEnvironmentStackOffset = 0; var lexicalEnvironmentSuspended = false; var emitHelpers; + var onSubstituteNode = function (_, node) { return node; }; + var onEmitNode = function (hint, node, callback) { return callback(hint, node); }; + var state = 0 /* Uninitialized */; // The transformation context is provided to each transformer as part of transformer // initialization. var context = { - getCompilerOptions: function () { return host.getCompilerOptions(); }, + getCompilerOptions: function () { return options; }, getEmitResolver: function () { return resolver; }, getEmitHost: function () { return host; }, startLexicalEnvironment: startLexicalEnvironment, @@ -56894,39 +61217,53 @@ var ts; hoistFunctionDeclaration: hoistFunctionDeclaration, requestEmitHelper: requestEmitHelper, readEmitHelpers: readEmitHelpers, - onSubstituteNode: function (_emitContext, node) { return node; }, enableSubstitution: enableSubstitution, - isSubstitutionEnabled: isSubstitutionEnabled, - onEmitNode: function (node, emitContext, emitCallback) { return emitCallback(node, emitContext); }, enableEmitNotification: enableEmitNotification, - isEmitNotificationEnabled: isEmitNotificationEnabled + isSubstitutionEnabled: isSubstitutionEnabled, + isEmitNotificationEnabled: isEmitNotificationEnabled, + get onSubstituteNode() { return onSubstituteNode; }, + set onSubstituteNode(value) { + ts.Debug.assert(state < 1 /* Initialized */, "Cannot modify transformation hooks after initialization has completed."); + ts.Debug.assert(value !== undefined, "Value must not be 'undefined'"); + onSubstituteNode = value; + }, + get onEmitNode() { return onEmitNode; }, + set onEmitNode(value) { + ts.Debug.assert(state < 1 /* Initialized */, "Cannot modify transformation hooks after initialization has completed."); + ts.Debug.assert(value !== undefined, "Value must not be 'undefined'"); + onEmitNode = value; + } }; + // Ensure the parse tree is clean before applying transformations + for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { + var node = nodes_4[_i]; + ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node))); + } + ts.performance.mark("beforeTransform"); // Chain together and initialize each transformer. var transformation = ts.chain.apply(void 0, transformers)(context); - // Transform each source file. - var transformed = ts.map(sourceFiles, transformSourceFile); - // Disable modification of the lexical environment. - lexicalEnvironmentDisabled = true; + // prevent modification of transformation hooks. + state = 1 /* Initialized */; + // Transform each node. + var transformed = ts.map(nodes, allowDtsFiles ? transformation : transformRoot); + // prevent modification of the lexical environment. + state = 2 /* Completed */; + ts.performance.mark("afterTransform"); + ts.performance.measure("transformTime", "beforeTransform", "afterTransform"); return { transformed: transformed, - emitNodeWithSubstitution: emitNodeWithSubstitution, - emitNodeWithNotification: emitNodeWithNotification + substituteNode: substituteNode, + emitNodeWithNotification: emitNodeWithNotification, + dispose: dispose }; - /** - * Transforms a source file. - * - * @param sourceFile The source file to transform. - */ - function transformSourceFile(sourceFile) { - if (ts.isDeclarationFile(sourceFile)) { - return sourceFile; - } - return transformation(sourceFile); + function transformRoot(node) { + return node && (!ts.isSourceFile(node) || !ts.isDeclarationFile(node)) ? transformation(node) : node; } /** * Enables expression substitutions in the pretty printer for the provided SyntaxKind. */ function enableSubstitution(kind) { + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the transformation context after transformation has completed."); enabledSyntaxKindFeatures[kind] |= 1 /* Substitution */; } /** @@ -56939,26 +61276,19 @@ var ts; /** * Emits a node with possible substitution. * - * @param emitContext The current emit context. + * @param hint A hint as to the intended usage of the node. * @param node The node to emit. * @param emitCallback The callback used to emit the node or its substitute. */ - function emitNodeWithSubstitution(emitContext, node, emitCallback) { - if (node) { - if (isSubstitutionEnabled(node)) { - var substitute = context.onSubstituteNode(emitContext, node); - if (substitute && substitute !== node) { - emitCallback(emitContext, substitute); - return; - } - } - emitCallback(emitContext, node); - } + function substituteNode(hint, node) { + ts.Debug.assert(state < 3 /* Disposed */, "Cannot substitute a node after the result is disposed."); + return node && isSubstitutionEnabled(node) && onSubstituteNode(hint, node) || node; } /** * Enables before/after emit notifications in the pretty printer for the provided SyntaxKind. */ function enableEmitNotification(kind) { + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the transformation context after transformation has completed."); enabledSyntaxKindFeatures[kind] |= 2 /* EmitNotifications */; } /** @@ -56972,17 +61302,18 @@ var ts; /** * Emits a node with possible emit notification. * - * @param emitContext The current emit context. + * @param hint A hint as to the intended usage of the node. * @param node The node to emit. * @param emitCallback The callback used to emit the node. */ - function emitNodeWithNotification(emitContext, node, emitCallback) { + function emitNodeWithNotification(hint, node, emitCallback) { + ts.Debug.assert(state < 3 /* Disposed */, "Cannot invoke TransformationResult callbacks after the result is disposed."); if (node) { if (isEmitNotificationEnabled(node)) { - context.onEmitNode(emitContext, node, emitCallback); + onEmitNode(hint, node, emitCallback); } else { - emitCallback(emitContext, node); + emitCallback(hint, node); } } } @@ -56990,7 +61321,8 @@ var ts; * Records a hoisted variable declaration for the provided name within a lexical environment. */ function hoistVariableDeclaration(name) { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); var decl = ts.createVariableDeclaration(name); if (!lexicalEnvironmentVariableDeclarations) { lexicalEnvironmentVariableDeclarations = [decl]; @@ -57003,7 +61335,8 @@ var ts; * Records a hoisted function declaration within a lexical environment. */ function hoistFunctionDeclaration(func) { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); if (!lexicalEnvironmentFunctionDeclarations) { lexicalEnvironmentFunctionDeclarations = [func]; } @@ -57016,7 +61349,8 @@ var ts; * are pushed onto a stack, and the related storage variables are reset. */ function startLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot start a lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is suspended."); // Save the current lexical environment. Rather than resizing the array we adjust the // stack size variable. This allows us to reuse existing array slots we've @@ -57030,13 +61364,15 @@ var ts; } /** Suspends the current lexical environment, usually after visiting a parameter list. */ function suspendLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot suspend a lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is already suspended."); lexicalEnvironmentSuspended = true; } /** Resumes a suspended lexical environment, usually before visiting a function body. */ function resumeLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot resume a lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(lexicalEnvironmentSuspended, "Lexical environment is not suspended."); lexicalEnvironmentSuspended = false; } @@ -57045,7 +61381,8 @@ var ts; * any hoisted declarations added in this environment are returned. */ function endLexicalEnvironment() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot end a lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); ts.Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is suspended."); var statements; if (lexicalEnvironmentVariableDeclarations || lexicalEnvironmentFunctionDeclarations) { @@ -57074,19 +61411,39 @@ var ts; return statements; } function requestEmitHelper(helper) { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the transformation context during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the transformation context after transformation has completed."); ts.Debug.assert(!helper.scoped, "Cannot request a scoped emit helper."); emitHelpers = ts.append(emitHelpers, helper); } function readEmitHelpers() { - ts.Debug.assert(!lexicalEnvironmentDisabled, "Cannot modify the lexical environment during the print phase."); + ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the transformation context during initialization."); + ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the transformation context after transformation has completed."); var helpers = emitHelpers; emitHelpers = undefined; return helpers; } + function dispose() { + if (state < 3 /* Disposed */) { + // Clean up emit nodes on parse tree + for (var _i = 0, nodes_5 = nodes; _i < nodes_5.length; _i++) { + var node = nodes_5[_i]; + ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node))); + } + // Release references to external entries for GC purposes. + lexicalEnvironmentVariableDeclarations = undefined; + lexicalEnvironmentVariableDeclarationsStack = undefined; + lexicalEnvironmentFunctionDeclarations = undefined; + lexicalEnvironmentFunctionDeclarationsStack = undefined; + onSubstituteNode = undefined; + onEmitNode = undefined; + emitHelpers = undefined; + // Prevent further use of the transformation result. + state = 3 /* Disposed */; + } + } } - ts.transformFiles = transformFiles; - var _a; + ts.transformNodes = transformNodes; })(ts || (ts = {})); /// /* @internal */ @@ -57131,10 +61488,9 @@ var ts; * * @param filePath The path to the generated output file. * @param sourceMapFilePath The path to the output source map file. - * @param sourceFiles The input source files for the program. - * @param isBundledEmit A value indicating whether the generated output file is a bundle. + * @param sourceFileOrBundle The input source file or bundle for the program. */ - function initialize(filePath, sourceMapFilePath, sourceFiles, isBundledEmit) { + function initialize(filePath, sourceMapFilePath, sourceFileOrBundle) { if (disabled) { return; } @@ -57170,11 +61526,10 @@ var ts; } if (compilerOptions.mapRoot) { sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); - if (!isBundledEmit) { - ts.Debug.assert(sourceFiles.length === 1); + if (sourceFileOrBundle.kind === 264 /* SourceFile */) { // For modules or multiple emit files the mapRoot will have directory structure like the sources // So if src\a.ts and src\lib\b.ts are compiled together user would be moving the maps into mapRoot\a.js.map and mapRoot\lib\b.js.map - sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFiles[0], host, sourceMapDir)); + sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFileOrBundle, host, sourceMapDir)); } if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { // The relative paths are relative to the common directory @@ -57297,31 +61652,32 @@ var ts; /** * Emits a node with possible leading and trailing source maps. * + * @param hint A hint as to the intended usage of the node. * @param node The node to emit. * @param emitCallback The callback used to emit the node. */ - function emitNodeWithSourceMap(emitContext, node, emitCallback) { + function emitNodeWithSourceMap(hint, node, emitCallback) { if (disabled) { - return emitCallback(emitContext, node); + return emitCallback(hint, node); } if (node) { var emitNode = node.emitNode; var emitFlags = emitNode && emitNode.flags; var _a = emitNode && emitNode.sourceMapRange || node, pos = _a.pos, end = _a.end; - if (node.kind !== 293 /* NotEmittedStatement */ + if (node.kind !== 294 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitPos(ts.skipTrivia(currentSourceText, pos)); } if (emitFlags & 64 /* NoNestedSourceMaps */) { disabled = true; - emitCallback(emitContext, node); + emitCallback(hint, node); disabled = false; } else { - emitCallback(emitContext, node); + emitCallback(hint, node); } - if (node.kind !== 293 /* NotEmittedStatement */ + if (node.kind !== 294 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitPos(end); @@ -57391,7 +61747,7 @@ var ts; return; } encodeLastRecordedSourceMapSpan(); - return ts.stringify({ + return JSON.stringify({ version: 3, file: sourceMapData.sourceMapFile, sourceRoot: sourceMapData.sourceMapSourceRoot, @@ -57456,11 +61812,10 @@ var ts; /* @internal */ var ts; (function (ts) { - function createCommentWriter(host, writer, sourceMap) { - var compilerOptions = host.getCompilerOptions(); - var extendedDiagnostics = compilerOptions.extendedDiagnostics; - var newLine = host.getNewLine(); - var emitPos = sourceMap.emitPos; + function createCommentWriter(printerOptions, emitPos) { + var extendedDiagnostics = printerOptions.extendedDiagnostics; + var newLine = ts.getNewLineCharacter(printerOptions); + var writer; var containerPos = -1; var containerEnd = -1; var declarationListContainerEnd = -1; @@ -57469,38 +61824,35 @@ var ts; var currentLineMap; var detachedCommentsInfo; var hasWrittenComment = false; - var disabled = compilerOptions.removeComments; + var disabled = printerOptions.removeComments; return { reset: reset, + setWriter: setWriter, setSourceFile: setSourceFile, emitNodeWithComments: emitNodeWithComments, emitBodyWithDetachedComments: emitBodyWithDetachedComments, emitTrailingCommentsOfPosition: emitTrailingCommentsOfPosition, + emitLeadingCommentsOfPosition: emitLeadingCommentsOfPosition, }; - function emitNodeWithComments(emitContext, node, emitCallback) { + function emitNodeWithComments(hint, node, emitCallback) { if (disabled) { - emitCallback(emitContext, node); + emitCallback(hint, node); return; } if (node) { - var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var emitFlags = ts.getEmitFlags(node); + hasWrittenComment = false; + var emitNode = node.emitNode; + var emitFlags = emitNode && emitNode.flags; + var _a = emitNode && emitNode.commentRange || node, pos = _a.pos, end = _a.end; if ((pos < 0 && end < 0) || (pos === end)) { // Both pos and end are synthesized, so just emit the node without comments. - if (emitFlags & 2048 /* NoNestedComments */) { - disabled = true; - emitCallback(emitContext, node); - disabled = false; - } - else { - emitCallback(emitContext, node); - } + emitNodeWithSynthesizedComments(hint, node, emitNode, emitFlags, emitCallback); } else { if (extendedDiagnostics) { ts.performance.mark("preEmitNodeWithComment"); } - var isEmittedNode = node.kind !== 293 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 294 /* NotEmittedStatement */; var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0; var skipTrailingComments = end < 0 || (emitFlags & 1024 /* NoTrailingComments */) !== 0; // Emit leading comments if the position is not synthesized and the node @@ -57519,23 +61871,16 @@ var ts; containerEnd = end; // To avoid invalid comment emit in a down-level binding pattern, we // keep track of the last declaration list container's end - if (node.kind === 224 /* VariableDeclarationList */) { + if (node.kind === 226 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } if (extendedDiagnostics) { ts.performance.measure("commentTime", "preEmitNodeWithComment"); } - if (emitFlags & 2048 /* NoNestedComments */) { - disabled = true; - emitCallback(emitContext, node); - disabled = false; - } - else { - emitCallback(emitContext, node); - } + emitNodeWithSynthesizedComments(hint, node, emitNode, emitFlags, emitCallback); if (extendedDiagnostics) { - ts.performance.mark("beginEmitNodeWithComment"); + ts.performance.mark("postEmitNodeWithComment"); } // Restore previous container state. containerPos = savedContainerPos; @@ -57547,11 +61892,75 @@ var ts; emitTrailingComments(end); } if (extendedDiagnostics) { - ts.performance.measure("commentTime", "beginEmitNodeWithComment"); + ts.performance.measure("commentTime", "postEmitNodeWithComment"); } } } } + function emitNodeWithSynthesizedComments(hint, node, emitNode, emitFlags, emitCallback) { + var leadingComments = emitNode && emitNode.leadingComments; + if (ts.some(leadingComments)) { + if (extendedDiagnostics) { + ts.performance.mark("preEmitNodeWithSynthesizedComments"); + } + ts.forEach(leadingComments, emitLeadingSynthesizedComment); + if (extendedDiagnostics) { + ts.performance.measure("commentTime", "preEmitNodeWithSynthesizedComments"); + } + } + emitNodeWithNestedComments(hint, node, emitFlags, emitCallback); + var trailingComments = emitNode && emitNode.trailingComments; + if (ts.some(trailingComments)) { + if (extendedDiagnostics) { + ts.performance.mark("postEmitNodeWithSynthesizedComments"); + } + ts.forEach(trailingComments, emitTrailingSynthesizedComment); + if (extendedDiagnostics) { + ts.performance.measure("commentTime", "postEmitNodeWithSynthesizedComments"); + } + } + } + function emitLeadingSynthesizedComment(comment) { + if (comment.kind === 2 /* SingleLineCommentTrivia */) { + writer.writeLine(); + } + writeSynthesizedComment(comment); + if (comment.hasTrailingNewLine || comment.kind === 2 /* SingleLineCommentTrivia */) { + writer.writeLine(); + } + else { + writer.write(" "); + } + } + function emitTrailingSynthesizedComment(comment) { + if (!writer.isAtStartOfLine()) { + writer.write(" "); + } + writeSynthesizedComment(comment); + if (comment.hasTrailingNewLine) { + writer.writeLine(); + } + } + function writeSynthesizedComment(comment) { + var text = formatSynthesizedComment(comment); + var lineMap = comment.kind === 3 /* MultiLineCommentTrivia */ ? ts.computeLineStarts(text) : undefined; + ts.writeCommentRange(text, lineMap, writer, 0, text.length, newLine); + } + function formatSynthesizedComment(comment) { + return comment.kind === 3 /* MultiLineCommentTrivia */ + ? "/*" + comment.text + "*/" + : "//" + comment.text; + } + function emitNodeWithNestedComments(hint, node, emitFlags, emitCallback) { + if (emitFlags & 2048 /* NoNestedComments */) { + disabled = true; + emitCallback(hint, node); + disabled = false; + } + else { + emitCallback(hint, node); + } + } function emitBodyWithDetachedComments(node, detachedRange, emitCallback) { if (extendedDiagnostics) { ts.performance.mark("preEmitBodyWithDetachedComments"); @@ -57579,6 +61988,9 @@ var ts; } if (!skipTrailingComments) { emitLeadingComments(detachedRange.end, /*isEmittedNode*/ true); + if (hasWrittenComment && !writer.isAtStartOfLine()) { + writer.writeLine(); + } } if (extendedDiagnostics) { ts.performance.measure("commentTime", "beginEmitBodyWithDetachedCommetns"); @@ -57612,9 +62024,11 @@ var ts; hasWrittenComment = true; } // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); if (hasTrailingNewLine) { writer.writeLine(); } @@ -57622,6 +62036,12 @@ var ts; writer.write(" "); } } + function emitLeadingCommentsOfPosition(pos) { + if (disabled || pos === -1) { + return; + } + emitLeadingComments(pos, /*isEmittedNode*/ true); + } function emitTrailingComments(pos) { forEachTrailingCommentToEmit(pos, emitTrailingComment); } @@ -57630,9 +62050,11 @@ var ts; if (!writer.isAtStartOfLine()) { writer.write(" "); } - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); if (hasTrailingNewLine) { writer.writeLine(); } @@ -57651,9 +62073,11 @@ var ts; } function emitTrailingCommentOfPosition(commentPos, commentEnd, _kind, hasTrailingNewLine) { // trailing comments of a position are emitted at /*trailing comment1 */space/*trailing comment*/space - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); if (hasTrailingNewLine) { writer.writeLine(); } @@ -57684,6 +62108,9 @@ var ts; currentLineMap = undefined; detachedCommentsInfo = undefined; } + function setWriter(output) { + writer = output; + } function setSourceFile(sourceFile) { currentSourceFile = sourceFile; currentText = currentSourceFile.text; @@ -57716,15 +62143,17 @@ var ts; } } function writeComment(text, lineMap, writer, commentPos, commentEnd, newLine) { - emitPos(commentPos); + if (emitPos) + emitPos(commentPos); ts.writeCommentRange(text, lineMap, writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); + if (emitPos) + emitPos(commentEnd); } /** * Determine if the given comment is a triple-slash * * @return true if the comment is a triple-slash comment else false - **/ + */ function isTripleSlashComment(commentPos, commentEnd) { // Verify this is /// comment, but do the regexp match only when we first can find /// in the comment text // so that we don't end up computing comment string and doing match for all // comments @@ -57747,15 +62176,17 @@ var ts; (function (ts) { function getDeclarationDiagnostics(host, resolver, targetSourceFile) { var declarationDiagnostics = ts.createDiagnosticCollection(); - ts.forEachExpectedEmitFile(host, getDeclarationDiagnosticsFromFile, targetSourceFile); + ts.forEachEmittedFile(host, getDeclarationDiagnosticsFromFile, targetSourceFile); return declarationDiagnostics.getDiagnostics(targetSourceFile ? targetSourceFile.fileName : undefined); - function getDeclarationDiagnosticsFromFile(_a, sources, isBundledEmit) { + function getDeclarationDiagnosticsFromFile(_a, sourceFileOrBundle) { var declarationFilePath = _a.declarationFilePath; - emitDeclarations(host, resolver, declarationDiagnostics, declarationFilePath, sources, isBundledEmit, /*emitOnlyDtsFiles*/ false); + emitDeclarations(host, resolver, declarationDiagnostics, declarationFilePath, sourceFileOrBundle, /*emitOnlyDtsFiles*/ false); } } ts.getDeclarationDiagnostics = getDeclarationDiagnostics; - function emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFiles, isBundledEmit, emitOnlyDtsFiles) { + function emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles) { + var sourceFiles = sourceFileOrBundle.kind === 265 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; + var isBundledEmit = sourceFileOrBundle.kind === 265 /* Bundle */; var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); var write; @@ -57829,7 +62260,7 @@ var ts; var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { - ts.Debug.assert(aliasEmitInfo.node.kind === 235 /* ImportDeclaration */); + ts.Debug.assert(aliasEmitInfo.node.kind === 237 /* ImportDeclaration */); createAndSetNewTextWriterWithSymbolWriter(); ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit)); for (var i = 0; i < aliasEmitInfo.indent; i++) { @@ -57855,9 +62286,9 @@ var ts; } }); if (usedTypeDirectiveReferences) { - for (var directive in usedTypeDirectiveReferences) { + ts.forEachKey(usedTypeDirectiveReferences, function (directive) { referencesOutput += "/// " + newLine; - } + }); } return { reportedDeclarationError: reportedDeclarationError, @@ -57882,12 +62313,14 @@ var ts; var writer = ts.createTextWriter(newLine); writer.trackSymbol = trackSymbol; writer.reportInaccessibleThisError = reportInaccessibleThisError; + writer.reportIllegalExtends = reportIllegalExtends; writer.writeKeyword = writer.write; writer.writeOperator = writer.write; writer.writePunctuation = writer.write; writer.writeSpace = writer.write; writer.writeStringLiteral = writer.writeLiteral; writer.writeParameter = writer.write; + writer.writeProperty = writer.write; writer.writeSymbol = writer.write; setWriter(writer); } @@ -57903,10 +62336,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 223 /* VariableDeclaration */) { + if (declaration.kind === 225 /* VariableDeclaration */) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 238 /* NamedImports */ || declaration.kind === 239 /* ImportSpecifier */ || declaration.kind === 236 /* ImportClause */) { + else if (declaration.kind === 240 /* NamedImports */ || declaration.kind === 241 /* ImportSpecifier */ || declaration.kind === 238 /* ImportClause */) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -57924,7 +62357,7 @@ var ts; // Writing of function bar would mark alias declaration foo as visible but we haven't yet visited that declaration so do nothing, // we would write alias foo declaration when we visit it since it would now be marked as visible if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 235 /* ImportDeclaration */) { + if (moduleElementEmitInfo.node.kind === 237 /* ImportDeclaration */) { // we have to create asynchronous output only after we have collected complete information // because it is possible to enable multiple bindings as asynchronously visible moduleElementEmitInfo.isVisible = true; @@ -57934,12 +62367,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 230 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 232 /* ModuleDeclaration */) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 230 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 232 /* ModuleDeclaration */) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -57958,8 +62391,8 @@ var ts; } for (var _i = 0, typeReferenceDirectives_1 = typeReferenceDirectives; _i < typeReferenceDirectives_1.length; _i++) { var directive = typeReferenceDirectives_1[_i]; - if (!(directive in usedTypeDirectiveReferences)) { - usedTypeDirectiveReferences[directive] = directive; + if (!usedTypeDirectiveReferences.has(directive)) { + usedTypeDirectiveReferences.set(directive, directive); } } } @@ -57988,6 +62421,12 @@ var ts; handleSymbolAccessibilityError(resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning, /*shouldComputeAliasesToMakeVisible*/ true)); recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForSymbol(symbol, meaning)); } + function reportIllegalExtends() { + if (errorNameNode) { + reportedDeclarationError = true; + emitterDiagnostics.add(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.extends_clause_of_exported_class_0_refers_to_a_type_whose_name_cannot_be_referenced, ts.declarationNameToString(errorNameNode))); + } + } function reportInaccessibleThisError() { if (errorNameNode) { reportedDeclarationError = true; @@ -57997,13 +62436,19 @@ var ts; function writeTypeOfDeclaration(declaration, type, getSymbolAccessibilityDiagnostic) { writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; write(": "); - if (type) { + // use the checker's type, not the declared type, + // for non-optional initialized parameters that aren't a parameter property + var shouldUseResolverType = declaration.kind === 145 /* Parameter */ && + resolver.isRequiredInitializedParameter(declaration); + if (type && !shouldUseResolverType) { // Write the type emitType(type); } else { errorNameNode = declaration.name; - resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, 2 /* UseTypeOfFunction */ | 1024 /* UseTypeAliasValue */, writer); + var format = 2 /* UseTypeOfFunction */ | 1024 /* UseTypeAliasValue */ | + (shouldUseResolverType ? 4096 /* AddUndefined */ : 0); + resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, format, writer); errorNameNode = undefined; } } @@ -58021,15 +62466,15 @@ var ts; } } function emitLines(nodes) { - for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { - var node = nodes_4[_i]; + for (var _i = 0, nodes_6 = nodes; _i < nodes_6.length; _i++) { + var node = nodes_6[_i]; emit(node); } } function emitSeparatedList(nodes, separator, eachNodeEmitFn, canEmitFn) { var currentWriterPos = writer.getTextPos(); - for (var _i = 0, nodes_5 = nodes; _i < nodes_5.length; _i++) { - var node = nodes_5[_i]; + for (var _i = 0, nodes_7 = nodes; _i < nodes_7.length; _i++) { + var node = nodes_7[_i]; if (!canEmitFn || canEmitFn(node)) { if (currentWriterPos !== writer.getTextPos()) { write(separator); @@ -58057,49 +62502,50 @@ var ts; function emitType(type) { switch (type.kind) { case 118 /* AnyKeyword */: - case 134 /* StringKeyword */: + case 135 /* StringKeyword */: case 132 /* NumberKeyword */: case 121 /* BooleanKeyword */: - case 135 /* SymbolKeyword */: + case 133 /* ObjectKeyword */: + case 136 /* SymbolKeyword */: case 104 /* VoidKeyword */: - case 137 /* UndefinedKeyword */: + case 138 /* UndefinedKeyword */: case 94 /* NullKeyword */: case 129 /* NeverKeyword */: - case 167 /* ThisType */: - case 171 /* LiteralType */: + case 168 /* ThisType */: + case 172 /* LiteralType */: return writeTextOfNode(currentText, type); - case 199 /* ExpressionWithTypeArguments */: + case 200 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(type); - case 157 /* TypeReference */: + case 158 /* TypeReference */: return emitTypeReference(type); - case 160 /* TypeQuery */: + case 161 /* TypeQuery */: return emitTypeQuery(type); - case 162 /* ArrayType */: + case 163 /* ArrayType */: return emitArrayType(type); - case 163 /* TupleType */: + case 164 /* TupleType */: return emitTupleType(type); - case 164 /* UnionType */: + case 165 /* UnionType */: return emitUnionType(type); - case 165 /* IntersectionType */: + case 166 /* IntersectionType */: return emitIntersectionType(type); - case 166 /* ParenthesizedType */: + case 167 /* ParenthesizedType */: return emitParenType(type); - case 168 /* TypeOperator */: + case 169 /* TypeOperator */: return emitTypeOperator(type); - case 169 /* IndexedAccessType */: + case 170 /* IndexedAccessType */: return emitIndexedAccessType(type); - case 170 /* MappedType */: + case 171 /* MappedType */: return emitMappedType(type); - case 158 /* FunctionType */: - case 159 /* ConstructorType */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: return emitSignatureDeclarationWithJsDocComments(type); - case 161 /* TypeLiteral */: + case 162 /* TypeLiteral */: return emitTypeLiteral(type); case 70 /* Identifier */: return emitEntityName(type); - case 141 /* QualifiedName */: + case 142 /* QualifiedName */: return emitEntityName(type); - case 156 /* TypePredicate */: + case 157 /* TypePredicate */: return emitTypePredicate(type); } function writeEntityName(entityName) { @@ -58107,8 +62553,8 @@ var ts; writeTextOfNode(currentText, entityName); } else { - var left = entityName.kind === 141 /* QualifiedName */ ? entityName.left : entityName.expression; - var right = entityName.kind === 141 /* QualifiedName */ ? entityName.right : entityName.name; + var left = entityName.kind === 142 /* QualifiedName */ ? entityName.left : entityName.expression; + var right = entityName.kind === 142 /* QualifiedName */ ? entityName.right : entityName.name; writeEntityName(left); write("."); writeTextOfNode(currentText, right); @@ -58117,14 +62563,14 @@ var ts; function emitEntityName(entityName) { var visibilityResult = resolver.isEntityNameVisible(entityName, // Aliases can be written asynchronously so use correct enclosing declaration - entityName.parent.kind === 234 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); + entityName.parent.kind === 236 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForEntityName(entityName)); writeEntityName(entityName); } function emitExpressionWithTypeArguments(node) { if (ts.isEntityNameExpression(node.expression)) { - ts.Debug.assert(node.expression.kind === 70 /* Identifier */ || node.expression.kind === 177 /* PropertyAccessExpression */); + ts.Debug.assert(node.expression.kind === 70 /* Identifier */ || node.expression.kind === 178 /* PropertyAccessExpression */); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -58224,7 +62670,7 @@ var ts; currentIdentifiers = node.identifiers; isCurrentFileExternalModule = ts.isExternalModule(node); enclosingDeclaration = node; - ts.emitDetachedComments(currentText, currentLineMap, writer, ts.writeCommentRange, node, newLine, true /* remove comments */); + ts.emitDetachedComments(currentText, currentLineMap, writer, ts.writeCommentRange, node, newLine, /*removeComents*/ true); emitLines(node.statements); } // Return a temp variable name to be used in `export default` statements. @@ -58233,15 +62679,15 @@ var ts; // do not need to keep track of created temp names. function getExportDefaultTempVariableName() { var baseName = "_default"; - if (!(baseName in currentIdentifiers)) { + if (!currentIdentifiers.has(baseName)) { return baseName; } var count = 0; while (true) { count++; - var name_38 = baseName + "_" + count; - if (!(name_38 in currentIdentifiers)) { - return name_38; + var name = baseName + "_" + count; + if (!currentIdentifiers.has(name)) { + return name; } } } @@ -58288,10 +62734,10 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 234 /* ImportEqualsDeclaration */ || - (node.parent.kind === 261 /* SourceFile */ && isCurrentFileExternalModule)) { + else if (node.kind === 236 /* ImportEqualsDeclaration */ || + (node.parent.kind === 264 /* SourceFile */ && isCurrentFileExternalModule)) { var isVisible = void 0; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 261 /* SourceFile */) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 264 /* SourceFile */) { // Import declaration of another module that is visited async so lets put it in right spot asynchronousSubModuleDeclarationEmitInfo.push({ node: node, @@ -58301,7 +62747,7 @@ var ts; }); } else { - if (node.kind === 235 /* ImportDeclaration */) { + if (node.kind === 237 /* ImportDeclaration */) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -58319,23 +62765,23 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: return writeFunctionDeclaration(node); - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: return writeVariableStatement(node); - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: return writeInterfaceDeclaration(node); - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: return writeClassDeclaration(node); - case 228 /* TypeAliasDeclaration */: + case 230 /* TypeAliasDeclaration */: return writeTypeAliasDeclaration(node); - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: return writeEnumDeclaration(node); - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: return writeModuleDeclaration(node); - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: return writeImportEqualsDeclaration(node); - case 235 /* ImportDeclaration */: + case 237 /* ImportDeclaration */: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); @@ -58343,7 +62789,7 @@ var ts; } function emitModuleElementDeclarationFlags(node) { // If the node is parented in the current source file we need to emit export declare or just export - if (node.parent.kind === 261 /* SourceFile */) { + if (node.parent.kind === 264 /* SourceFile */) { var modifiers = ts.getModifierFlags(node); // If the node is exported if (modifiers & 1 /* Export */) { @@ -58352,7 +62798,7 @@ var ts; if (modifiers & 512 /* Default */) { write("default "); } - else if (node.kind !== 227 /* InterfaceDeclaration */ && !noDeclare) { + else if (node.kind !== 229 /* InterfaceDeclaration */ && !noDeclare) { write("declare "); } } @@ -58404,7 +62850,7 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 237 /* NamespaceImport */) { + if (namedBindings.kind === 239 /* NamespaceImport */) { return resolver.isDeclarationVisible(namedBindings); } else { @@ -58428,7 +62874,7 @@ var ts; // If the default binding was emitted, write the separated write(", "); } - if (node.importClause.namedBindings.kind === 237 /* NamespaceImport */) { + if (node.importClause.namedBindings.kind === 239 /* NamespaceImport */) { write("* as "); writeTextOfNode(currentText, node.importClause.namedBindings.name); } @@ -58449,13 +62895,13 @@ var ts; // the only case when it is not true is when we call it to emit correct name for module augmentation - d.ts files with just module augmentations are not considered // external modules since they are indistinguishable from script files with ambient modules. To fix this in such d.ts files we'll emit top level 'export {}' // so compiler will treat them as external modules. - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 230 /* ModuleDeclaration */; + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 232 /* ModuleDeclaration */; var moduleSpecifier; - if (parent.kind === 234 /* ImportEqualsDeclaration */) { + if (parent.kind === 236 /* ImportEqualsDeclaration */) { var node = parent; moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node); } - else if (parent.kind === 230 /* ModuleDeclaration */) { + else if (parent.kind === 232 /* ModuleDeclaration */) { moduleSpecifier = parent.name; } else { @@ -58525,7 +62971,7 @@ var ts; writeTextOfNode(currentText, node.name); } } - while (node.body && node.body.kind !== 231 /* ModuleBlock */) { + while (node.body && node.body.kind !== 233 /* ModuleBlock */) { node = node.body; write("."); writeTextOfNode(currentText, node.name); @@ -58595,7 +63041,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 149 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); + return node.parent.kind === 150 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -58606,53 +63052,70 @@ var ts; // If there is constraint present and this is not a type parameter of the private method emit the constraint if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 158 /* FunctionType */ || - node.parent.kind === 159 /* ConstructorType */ || - (node.parent.parent && node.parent.parent.kind === 161 /* TypeLiteral */)) { - ts.Debug.assert(node.parent.kind === 149 /* MethodDeclaration */ || - node.parent.kind === 148 /* MethodSignature */ || - node.parent.kind === 158 /* FunctionType */ || - node.parent.kind === 159 /* ConstructorType */ || - node.parent.kind === 153 /* CallSignature */ || - node.parent.kind === 154 /* ConstructSignature */); + if (node.parent.kind === 159 /* FunctionType */ || + node.parent.kind === 160 /* ConstructorType */ || + (node.parent.parent && node.parent.parent.kind === 162 /* TypeLiteral */)) { + ts.Debug.assert(node.parent.kind === 150 /* MethodDeclaration */ || + node.parent.kind === 149 /* MethodSignature */ || + node.parent.kind === 159 /* FunctionType */ || + node.parent.kind === 160 /* ConstructorType */ || + node.parent.kind === 154 /* CallSignature */ || + node.parent.kind === 155 /* ConstructSignature */); emitType(node.constraint); } else { emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.constraint, getTypeParameterConstraintVisibilityError); } } + if (node.default && !isPrivateMethodTypeParameter(node)) { + write(" = "); + if (node.parent.kind === 159 /* FunctionType */ || + node.parent.kind === 160 /* ConstructorType */ || + (node.parent.parent && node.parent.parent.kind === 162 /* TypeLiteral */)) { + ts.Debug.assert(node.parent.kind === 150 /* MethodDeclaration */ || + node.parent.kind === 149 /* MethodSignature */ || + node.parent.kind === 159 /* FunctionType */ || + node.parent.kind === 160 /* ConstructorType */ || + node.parent.kind === 154 /* CallSignature */ || + node.parent.kind === 155 /* ConstructSignature */); + emitType(node.default); + } + else { + emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.default, getTypeParameterConstraintVisibilityError); + } + } function getTypeParameterConstraintVisibilityError() { // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 154 /* ConstructSignature */: + case 155 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 153 /* CallSignature */: + case 154 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 226 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 228 /* ClassDeclaration */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 228 /* TypeAliasDeclaration */: + case 230 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -58671,7 +63134,7 @@ var ts; write(">"); } } - function emitHeritageClause(typeReferences, isImplementsList) { + function emitHeritageClause(className, typeReferences, isImplementsList) { if (typeReferences) { write(isImplementsList ? " implements " : " extends "); emitCommaList(typeReferences, emitTypeOfTypeReference); @@ -58685,20 +63148,22 @@ var ts; } else { writer.getSymbolAccessibilityDiagnostic = getHeritageClauseVisibilityError; + errorNameNode = className; resolver.writeBaseConstructorTypeOfClass(enclosingDeclaration, enclosingDeclaration, 2 /* UseTypeOfFunction */ | 1024 /* UseTypeAliasValue */, writer); + errorNameNode = undefined; } function getHeritageClauseVisibilityError() { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 226 /* ClassDeclaration */) { + if (node.parent.parent.kind === 228 /* ClassDeclaration */) { // Class or Interface implemented/extended is inaccessible diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : - ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; + ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1; } else { // interface is inaccessible - diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; + diagnosticMessage = ts.Diagnostics.extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; } return { diagnosticMessage: diagnosticMessage, @@ -58730,9 +63195,10 @@ var ts; emitTypeParameters(node.typeParameters); var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { - emitHeritageClause([baseTypeNode], /*isImplementsList*/ false); + node.name; + emitHeritageClause(node.name, [baseTypeNode], /*isImplementsList*/ false); } - emitHeritageClause(ts.getClassImplementsHeritageClauseElements(node), /*isImplementsList*/ true); + emitHeritageClause(node.name, ts.getClassImplementsHeritageClauseElements(node), /*isImplementsList*/ true); write(" {"); writeLine(); increaseIndent(); @@ -58753,7 +63219,7 @@ var ts; emitTypeParameters(node.typeParameters); var interfaceExtendsTypes = ts.filter(ts.getInterfaceBaseTypeNodes(node), function (base) { return ts.isEntityNameExpression(base.expression); }); if (interfaceExtendsTypes && interfaceExtendsTypes.length) { - emitHeritageClause(interfaceExtendsTypes, /*isImplementsList*/ false); + emitHeritageClause(node.name, interfaceExtendsTypes, /*isImplementsList*/ false); } write(" {"); writeLine(); @@ -58777,7 +63243,7 @@ var ts; function emitVariableDeclaration(node) { // If we are emitting property it isn't moduleElement and hence we already know it needs to be emitted // so there is no check needed to see if declaration is visible - if (node.kind !== 223 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { + if (node.kind !== 225 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } @@ -58788,11 +63254,11 @@ var ts; writeTextOfNode(currentText, node.name); // If optional property emit ? but in the case of parameterProperty declaration with "?" indicating optional parameter for the constructor // we don't want to emit property declaration with "?" - if ((node.kind === 147 /* PropertyDeclaration */ || node.kind === 146 /* PropertySignature */ || - (node.kind === 144 /* Parameter */ && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { + if ((node.kind === 148 /* PropertyDeclaration */ || node.kind === 147 /* PropertySignature */ || + (node.kind === 145 /* Parameter */ && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { write("?"); } - if ((node.kind === 147 /* PropertyDeclaration */ || node.kind === 146 /* PropertySignature */) && node.parent.kind === 161 /* TypeLiteral */) { + if ((node.kind === 148 /* PropertyDeclaration */ || node.kind === 147 /* PropertySignature */) && node.parent.kind === 162 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (resolver.isLiteralConstDeclaration(node)) { @@ -58805,14 +63271,14 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 223 /* VariableDeclaration */) { + if (node.kind === 225 /* VariableDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 147 /* PropertyDeclaration */ || node.kind === 146 /* PropertySignature */) { + else if (node.kind === 148 /* PropertyDeclaration */ || node.kind === 147 /* PropertySignature */) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -58821,7 +63287,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 226 /* ClassDeclaration */) { + else if (node.parent.kind === 228 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -58853,7 +63319,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 198 /* OmittedExpression */) { + if (element.kind !== 199 /* OmittedExpression */) { elements.push(element); } } @@ -58923,7 +63389,7 @@ var ts; var type = getTypeAnnotationFromAccessor(node); if (!type) { // couldn't get type for the first accessor, try the another one - var anotherAccessor = node.kind === 151 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 152 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -58936,7 +63402,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 151 /* GetAccessor */ + return accessor.kind === 152 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -58945,7 +63411,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 152 /* SetAccessor */) { + if (accessorWithTypeAnnotation.kind === 153 /* SetAccessor */) { // Setters have to have type named and cannot infer it so, the type should always be named if (ts.hasModifier(accessorWithTypeAnnotation.parent, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? @@ -58995,17 +63461,17 @@ var ts; // so no need to verify if the declaration is visible if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 225 /* FunctionDeclaration */) { + if (node.kind === 227 /* FunctionDeclaration */) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 149 /* MethodDeclaration */ || node.kind === 150 /* Constructor */) { + else if (node.kind === 150 /* MethodDeclaration */ || node.kind === 151 /* Constructor */) { emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); } - if (node.kind === 225 /* FunctionDeclaration */) { + if (node.kind === 227 /* FunctionDeclaration */) { write("function "); writeTextOfNode(currentText, node.name); } - else if (node.kind === 150 /* Constructor */) { + else if (node.kind === 151 /* Constructor */) { write("constructor"); } else { @@ -59025,17 +63491,17 @@ var ts; var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; var closeParenthesizedFunctionType = false; - if (node.kind === 155 /* IndexSignature */) { + if (node.kind === 156 /* IndexSignature */) { // Index signature can have readonly modifier emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); write("["); } else { // Construct signature or constructor type write new Signature - if (node.kind === 154 /* ConstructSignature */ || node.kind === 159 /* ConstructorType */) { + if (node.kind === 155 /* ConstructSignature */ || node.kind === 160 /* ConstructorType */) { write("new "); } - else if (node.kind === 158 /* FunctionType */) { + else if (node.kind === 159 /* FunctionType */) { var currentOutput = writer.getText(); // Do not generate incorrect type when function type with type parameters is type argument // This could happen if user used space between two '<' making it error free @@ -59050,22 +63516,22 @@ var ts; } // Parameters emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 155 /* IndexSignature */) { + if (node.kind === 156 /* IndexSignature */) { write("]"); } else { write(")"); } // If this is not a constructor and is not private, emit the return type - var isFunctionTypeOrConstructorType = node.kind === 158 /* FunctionType */ || node.kind === 159 /* ConstructorType */; - if (isFunctionTypeOrConstructorType || node.parent.kind === 161 /* TypeLiteral */) { + var isFunctionTypeOrConstructorType = node.kind === 159 /* FunctionType */ || node.kind === 160 /* ConstructorType */; + if (isFunctionTypeOrConstructorType || node.parent.kind === 162 /* TypeLiteral */) { // Emit type literal signature return type only if specified if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 150 /* Constructor */ && !ts.hasModifier(node, 8 /* Private */)) { + else if (node.kind !== 151 /* Constructor */ && !ts.hasModifier(node, 8 /* Private */)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -59079,26 +63545,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 154 /* ConstructSignature */: + case 155 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 153 /* CallSignature */: + case 154 /* CallSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 155 /* IndexSignature */: + case 156 /* IndexSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: if (ts.hasModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -59106,7 +63572,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 226 /* ClassDeclaration */) { + else if (node.parent.kind === 228 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -59120,7 +63586,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -59155,9 +63621,9 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 158 /* FunctionType */ || - node.parent.kind === 159 /* ConstructorType */ || - node.parent.parent.kind === 161 /* TypeLiteral */) { + if (node.parent.kind === 159 /* FunctionType */ || + node.parent.kind === 160 /* ConstructorType */ || + node.parent.parent.kind === 162 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!ts.hasModifier(node.parent, 8 /* Private */)) { @@ -59173,24 +63639,29 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 150 /* Constructor */: + case 151 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 154 /* ConstructSignature */: + case 155 /* ConstructSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 153 /* CallSignature */: + case 154 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 156 /* IndexSignature */: + // Interfaces cannot have parameter types that cannot be named + return symbolAccessibilityResult.errorModuleName ? + ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : + ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -59198,7 +63669,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 226 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 228 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -59211,7 +63682,7 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -59223,12 +63694,12 @@ var ts; } function emitBindingPattern(bindingPattern) { // We have to explicitly emit square bracket and bracket because these tokens are not store inside the node. - if (bindingPattern.kind === 172 /* ObjectBindingPattern */) { + if (bindingPattern.kind === 173 /* ObjectBindingPattern */) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 173 /* ArrayBindingPattern */) { + else if (bindingPattern.kind === 174 /* ArrayBindingPattern */) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -59239,7 +63710,7 @@ var ts; } } function emitBindingElement(bindingElement) { - if (bindingElement.kind === 198 /* OmittedExpression */) { + if (bindingElement.kind === 199 /* OmittedExpression */) { // If bindingElement is an omittedExpression (i.e. containing elision), // we will emit blank space (although this may differ from users' original code, // it allows emitSeparatedList to write separator appropriately) @@ -59248,7 +63719,7 @@ var ts; // emit : function foo([ , x, , ]) {} write(" "); } - else if (bindingElement.kind === 174 /* BindingElement */) { + else if (bindingElement.kind === 175 /* BindingElement */) { if (bindingElement.propertyName) { // bindingElement has propertyName property in the following case: // { y: [a,b,c] ...} -> bindingPattern will have a property called propertyName for "y" @@ -59287,40 +63758,40 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 225 /* FunctionDeclaration */: - case 230 /* ModuleDeclaration */: - case 234 /* ImportEqualsDeclaration */: - case 227 /* InterfaceDeclaration */: - case 226 /* ClassDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 229 /* EnumDeclaration */: + case 227 /* FunctionDeclaration */: + case 232 /* ModuleDeclaration */: + case 236 /* ImportEqualsDeclaration */: + case 229 /* InterfaceDeclaration */: + case 228 /* ClassDeclaration */: + case 230 /* TypeAliasDeclaration */: + case 231 /* EnumDeclaration */: return emitModuleElement(node, isModuleElementVisible(node)); - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: return emitModuleElement(node, isVariableStatementVisible(node)); - case 235 /* ImportDeclaration */: + case 237 /* ImportDeclaration */: // Import declaration without import clause is visible, otherwise it is not visible return emitModuleElement(node, /*isModuleElementVisible*/ !node.importClause); - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: return emitExportDeclaration(node); - case 150 /* Constructor */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 151 /* Constructor */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: return writeFunctionDeclaration(node); - case 154 /* ConstructSignature */: - case 153 /* CallSignature */: - case 155 /* IndexSignature */: + case 155 /* ConstructSignature */: + case 154 /* CallSignature */: + case 156 /* IndexSignature */: return emitSignatureDeclarationWithJsDocComments(node); - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: return emitAccessorDeclaration(node); - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: return emitPropertyDeclaration(node); - case 260 /* EnumMember */: + case 263 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: return emitExportAssignment(node); - case 261 /* SourceFile */: + case 264 /* SourceFile */: return emitSourceFile(node); } } @@ -59338,7 +63809,7 @@ var ts; } else { // Get the declaration file path - ts.forEachExpectedEmitFile(host, getDeclFileName, referencedFile, emitOnlyDtsFiles); + ts.forEachEmittedFile(host, getDeclFileName, referencedFile, emitOnlyDtsFiles); } if (declFileName) { declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(declarationFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, @@ -59346,8 +63817,9 @@ var ts; referencesOutput += "/// " + newLine; } return addedBundledEmitReference; - function getDeclFileName(emitFileNames, _sourceFiles, isBundledEmit) { + function getDeclFileName(emitFileNames, sourceFileOrBundle) { // Dont add reference path to this file if it is a bundled emit and caller asked not emit bundled file path + var isBundledEmit = sourceFileOrBundle.kind === 265 /* Bundle */; if (isBundledEmit && !addBundledFileReference) { return; } @@ -59358,10 +63830,11 @@ var ts; } } /* @internal */ - function writeDeclarationFile(declarationFilePath, sourceFiles, isBundledEmit, host, resolver, emitterDiagnostics, emitOnlyDtsFiles) { - var emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFiles, isBundledEmit, emitOnlyDtsFiles); + function writeDeclarationFile(declarationFilePath, sourceFileOrBundle, host, resolver, emitterDiagnostics, emitOnlyDtsFiles) { + var emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles); var emitSkipped = emitDeclarationResult.reportedDeclarationError || host.isEmitBlocked(declarationFilePath) || host.getCompilerOptions().noEmit; if (!emitSkipped) { + var sourceFiles = sourceFileOrBundle.kind === 265 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; var declarationOutput = emitDeclarationResult.referencesOutput + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); ts.writeFile(host, emitterDiagnostics, declarationFilePath, declarationOutput, host.getCompilerOptions().emitBOM, sourceFiles); @@ -59384,83 +63857,73 @@ var ts; } ts.writeDeclarationFile = writeDeclarationFile; })(ts || (ts = {})); -/// +/// /// -/// -/// +/// +/// /// -/* @internal */ var ts; (function (ts) { - // Flags enum to track count of temp variables and a few dedicated names - var TempFlags; - (function (TempFlags) { - TempFlags[TempFlags["Auto"] = 0] = "Auto"; - TempFlags[TempFlags["CountMask"] = 268435455] = "CountMask"; - TempFlags[TempFlags["_i"] = 268435456] = "_i"; - })(TempFlags || (TempFlags = {})); - var id = function (s) { return s; }; - var nullTransformers = [function (_) { return id; }]; + var delimiters = createDelimiterMap(); + var brackets = createBracketsMap(); + /*@internal*/ // targetSourceFile is when users only want one file in entire project to be emitted. This is used in compileOnSave feature - function emitFiles(resolver, host, targetSourceFile, emitOnlyDtsFiles) { - var delimiters = createDelimiterMap(); - var brackets = createBracketsMap(); + function emitFiles(resolver, host, targetSourceFile, emitOnlyDtsFiles, transformers) { var compilerOptions = host.getCompilerOptions(); - var languageVersion = ts.getEmitScriptTarget(compilerOptions); var moduleKind = ts.getEmitModuleKind(compilerOptions); var sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? [] : undefined; var emittedFilesList = compilerOptions.listEmittedFiles ? [] : undefined; var emitterDiagnostics = ts.createDiagnosticCollection(); var newLine = host.getNewLine(); - var transformers = emitOnlyDtsFiles ? nullTransformers : ts.getTransformers(compilerOptions); var writer = ts.createTextWriter(newLine); - var write = writer.write, writeLine = writer.writeLine, increaseIndent = writer.increaseIndent, decreaseIndent = writer.decreaseIndent; var sourceMap = ts.createSourceMapWriter(host, writer); - var emitNodeWithSourceMap = sourceMap.emitNodeWithSourceMap, emitTokenWithSourceMap = sourceMap.emitTokenWithSourceMap; - var comments = ts.createCommentWriter(host, writer, sourceMap); - var emitNodeWithComments = comments.emitNodeWithComments, emitBodyWithDetachedComments = comments.emitBodyWithDetachedComments, emitTrailingCommentsOfPosition = comments.emitTrailingCommentsOfPosition; - var nodeIdToGeneratedName; - var autoGeneratedIdToGeneratedName; - var generatedNameSet; - var tempFlags; var currentSourceFile; - var currentText; - var currentFileIdentifiers; var bundledHelpers; var isOwnFileEmit; var emitSkipped = false; var sourceFiles = ts.getSourceFilesToEmit(host, targetSourceFile); // Transform the source files - ts.performance.mark("beforeTransform"); - var _a = ts.transformFiles(resolver, host, sourceFiles, transformers), transformed = _a.transformed, emitNodeWithSubstitution = _a.emitNodeWithSubstitution, emitNodeWithNotification = _a.emitNodeWithNotification; - ts.performance.measure("transformTime", "beforeTransform"); + var transform = ts.transformNodes(resolver, host, compilerOptions, sourceFiles, transformers, /*allowDtsFiles*/ false); + // Create a printer to print the nodes + var printer = createPrinter(compilerOptions, { + // resolver hooks + hasGlobalName: resolver.hasGlobalName, + // transform hooks + onEmitNode: transform.emitNodeWithNotification, + substituteNode: transform.substituteNode, + // sourcemap hooks + onEmitSourceMapOfNode: sourceMap.emitNodeWithSourceMap, + onEmitSourceMapOfToken: sourceMap.emitTokenWithSourceMap, + onEmitSourceMapOfPosition: sourceMap.emitPos, + // emitter hooks + onEmitHelpers: emitHelpers, + onSetSourceFile: setSourceFile, + }); // Emit each output file ts.performance.mark("beforePrint"); - ts.forEachTransformedEmitFile(host, transformed, emitFile, emitOnlyDtsFiles); + ts.forEachEmittedFile(host, emitSourceFileOrBundle, transform.transformed, emitOnlyDtsFiles); ts.performance.measure("printTime", "beforePrint"); // Clean up emit nodes on parse tree - for (var _b = 0, sourceFiles_4 = sourceFiles; _b < sourceFiles_4.length; _b++) { - var sourceFile = sourceFiles_4[_b]; - ts.disposeEmitNodes(sourceFile); - } + transform.dispose(); return { emitSkipped: emitSkipped, diagnostics: emitterDiagnostics.getDiagnostics(), emittedFiles: emittedFilesList, sourceMaps: sourceMapDataList }; - function emitFile(jsFilePath, sourceMapFilePath, declarationFilePath, sourceFiles, isBundledEmit) { + function emitSourceFileOrBundle(_a, sourceFileOrBundle) { + var jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath; // Make sure not to write js file and source map file if any of them cannot be written if (!host.isEmitBlocked(jsFilePath) && !compilerOptions.noEmit) { if (!emitOnlyDtsFiles) { - printFile(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit); + printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle); } } else { emitSkipped = true; } if (declarationFilePath) { - emitSkipped = ts.writeDeclarationFile(declarationFilePath, ts.getOriginalSourceFiles(sourceFiles), isBundledEmit, host, resolver, emitterDiagnostics, emitOnlyDtsFiles) || emitSkipped; + emitSkipped = ts.writeDeclarationFile(declarationFilePath, ts.getOriginalSourceFileOrBundle(sourceFileOrBundle), host, resolver, emitterDiagnostics, emitOnlyDtsFiles) || emitSkipped; } if (!emitSkipped && emittedFilesList) { if (!emitOnlyDtsFiles) { @@ -59474,26 +63937,24 @@ var ts; } } } - function printFile(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit) { - sourceMap.initialize(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit); - nodeIdToGeneratedName = []; - autoGeneratedIdToGeneratedName = []; - generatedNameSet = ts.createMap(); - bundledHelpers = isBundledEmit ? ts.createMap() : undefined; - isOwnFileEmit = !isBundledEmit; - // Emit helpers from all the files - if (isBundledEmit && moduleKind) { - for (var _a = 0, sourceFiles_5 = sourceFiles; _a < sourceFiles_5.length; _a++) { - var sourceFile = sourceFiles_5[_a]; - emitHelpers(sourceFile, /*isBundle*/ true); - } + function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle) { + var bundle = sourceFileOrBundle.kind === 265 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 264 /* SourceFile */ ? sourceFileOrBundle : undefined; + var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; + sourceMap.initialize(jsFilePath, sourceMapFilePath, sourceFileOrBundle); + if (bundle) { + bundledHelpers = ts.createMap(); + isOwnFileEmit = false; + printer.writeBundle(bundle, writer); } - // Print each transformed source file. - ts.forEach(sourceFiles, printSourceFile); - writeLine(); + else { + isOwnFileEmit = true; + printer.writeFile(sourceFile, writer); + } + writer.writeLine(); var sourceMappingURL = sourceMap.getSourceMappingURL(); if (sourceMappingURL) { - write("//# " + "sourceMappingURL" + "=" + sourceMappingURL); // Sometimes tools can sometimes see this line as a source mapping url comment + writer.write("//# " + "sourceMappingURL" + "=" + sourceMappingURL); // Sometimes tools can sometimes see this line as a source mapping url comment } // Write the source map if (compilerOptions.sourceMap && !compilerOptions.inlineSourceMap) { @@ -59507,138 +63968,232 @@ var ts; ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), compilerOptions.emitBOM, sourceFiles); // Reset state sourceMap.reset(); - comments.reset(); writer.reset(); - tempFlags = 0 /* Auto */; currentSourceFile = undefined; - currentText = undefined; + bundledHelpers = undefined; isOwnFileEmit = false; } - function printSourceFile(node) { + function setSourceFile(node) { currentSourceFile = node; - currentText = node.text; - currentFileIdentifiers = node.identifiers; sourceMap.setSourceFile(node); - comments.setSourceFile(node); - pipelineEmitWithNotification(0 /* SourceFile */, node); } - /** - * Emits a node. - */ + function emitHelpers(node, writeLines) { + var helpersEmitted = false; + var bundle = node.kind === 265 /* Bundle */ ? node : undefined; + if (bundle && moduleKind === ts.ModuleKind.None) { + return; + } + var numNodes = bundle ? bundle.sourceFiles.length : 1; + for (var i = 0; i < numNodes; i++) { + var currentNode = bundle ? bundle.sourceFiles[i] : node; + var sourceFile = ts.isSourceFile(currentNode) ? currentNode : currentSourceFile; + var shouldSkip = compilerOptions.noEmitHelpers || (sourceFile && ts.getExternalHelpersModuleName(sourceFile) !== undefined); + var shouldBundle = ts.isSourceFile(currentNode) && !isOwnFileEmit; + var helpers = ts.getEmitHelpers(currentNode); + if (helpers) { + for (var _a = 0, _b = ts.stableSort(helpers, ts.compareEmitHelpers); _a < _b.length; _a++) { + var helper = _b[_a]; + if (!helper.scoped) { + // Skip the helper if it can be skipped and the noEmitHelpers compiler + // option is set, or if it can be imported and the importHelpers compiler + // option is set. + if (shouldSkip) + continue; + // Skip the helper if it can be bundled but hasn't already been emitted and we + // are emitting a bundled module. + if (shouldBundle) { + if (bundledHelpers.get(helper.name)) { + continue; + } + bundledHelpers.set(helper.name, true); + } + } + else if (bundle) { + // Skip the helper if it is scoped and we are emitting bundled helpers + continue; + } + writeLines(helper.text); + helpersEmitted = true; + } + } + } + return helpersEmitted; + } + } + ts.emitFiles = emitFiles; + function createPrinter(printerOptions, handlers) { + if (printerOptions === void 0) { printerOptions = {}; } + if (handlers === void 0) { handlers = {}; } + var hasGlobalName = handlers.hasGlobalName, onEmitSourceMapOfNode = handlers.onEmitSourceMapOfNode, onEmitSourceMapOfToken = handlers.onEmitSourceMapOfToken, onEmitSourceMapOfPosition = handlers.onEmitSourceMapOfPosition, onEmitNode = handlers.onEmitNode, onEmitHelpers = handlers.onEmitHelpers, onSetSourceFile = handlers.onSetSourceFile, substituteNode = handlers.substituteNode, onBeforeEmitNodeArray = handlers.onBeforeEmitNodeArray, onAfterEmitNodeArray = handlers.onAfterEmitNodeArray; + var newLine = ts.getNewLineCharacter(printerOptions); + var comments = ts.createCommentWriter(printerOptions, onEmitSourceMapOfPosition); + var emitNodeWithComments = comments.emitNodeWithComments, emitBodyWithDetachedComments = comments.emitBodyWithDetachedComments, emitTrailingCommentsOfPosition = comments.emitTrailingCommentsOfPosition, emitLeadingCommentsOfPosition = comments.emitLeadingCommentsOfPosition; + var currentSourceFile; + var nodeIdToGeneratedName; // Map of generated names for specific nodes. + var autoGeneratedIdToGeneratedName; // Map of generated names for temp and loop variables. + var generatedNames; // Set of names generated by the NameGenerator. + var tempFlagsStack; // Stack of enclosing name generation scopes. + var tempFlags; // TempFlags for the current name generation scope. + var writer; + var ownWriter; + reset(); + return { + // public API + printNode: printNode, + printFile: printFile, + printBundle: printBundle, + // internal API + writeNode: writeNode, + writeFile: writeFile, + writeBundle: writeBundle + }; + function printNode(hint, node, sourceFile) { + switch (hint) { + case 0 /* SourceFile */: + ts.Debug.assert(ts.isSourceFile(node), "Expected a SourceFile node."); + break; + case 2 /* IdentifierName */: + ts.Debug.assert(ts.isIdentifier(node), "Expected an Identifier node."); + break; + case 1 /* Expression */: + ts.Debug.assert(ts.isExpression(node), "Expected an Expression node."); + break; + } + switch (node.kind) { + case 264 /* SourceFile */: return printFile(node); + case 265 /* Bundle */: return printBundle(node); + } + writeNode(hint, node, sourceFile, beginPrint()); + return endPrint(); + } + function printBundle(bundle) { + writeBundle(bundle, beginPrint()); + return endPrint(); + } + function printFile(sourceFile) { + writeFile(sourceFile, beginPrint()); + return endPrint(); + } + function writeNode(hint, node, sourceFile, output) { + var previousWriter = writer; + setWriter(output); + print(hint, node, sourceFile); + reset(); + writer = previousWriter; + } + function writeBundle(bundle, output) { + var previousWriter = writer; + setWriter(output); + emitShebangIfNeeded(bundle); + emitPrologueDirectivesIfNeeded(bundle); + emitHelpersIndirect(bundle); + for (var _a = 0, _b = bundle.sourceFiles; _a < _b.length; _a++) { + var sourceFile = _b[_a]; + print(0 /* SourceFile */, sourceFile, sourceFile); + } + reset(); + writer = previousWriter; + } + function writeFile(sourceFile, output) { + var previousWriter = writer; + setWriter(output); + emitShebangIfNeeded(sourceFile); + emitPrologueDirectivesIfNeeded(sourceFile); + print(0 /* SourceFile */, sourceFile, sourceFile); + reset(); + writer = previousWriter; + } + function beginPrint() { + return ownWriter || (ownWriter = ts.createTextWriter(newLine)); + } + function endPrint() { + var text = ownWriter.getText(); + ownWriter.reset(); + return text; + } + function print(hint, node, sourceFile) { + setSourceFile(sourceFile); + pipelineEmitWithNotification(hint, node); + } + function setSourceFile(sourceFile) { + currentSourceFile = sourceFile; + comments.setSourceFile(sourceFile); + if (onSetSourceFile) { + onSetSourceFile(sourceFile); + } + } + function setWriter(output) { + writer = output; + comments.setWriter(output); + } + function reset() { + nodeIdToGeneratedName = []; + autoGeneratedIdToGeneratedName = []; + generatedNames = ts.createMap(); + tempFlagsStack = []; + tempFlags = 0 /* Auto */; + comments.reset(); + setWriter(/*output*/ undefined); + } function emit(node) { pipelineEmitWithNotification(3 /* Unspecified */, node); } - /** - * Emits an IdentifierName. - */ function emitIdentifierName(node) { pipelineEmitWithNotification(2 /* IdentifierName */, node); } - /** - * Emits an expression node. - */ function emitExpression(node) { pipelineEmitWithNotification(1 /* Expression */, node); } - /** - * Emits a node with possible notification. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called from printSourceFile, emit, emitExpression, or - * emitIdentifierName. - */ - function pipelineEmitWithNotification(emitContext, node) { - emitNodeWithNotification(emitContext, node, pipelineEmitWithComments); + function pipelineEmitWithNotification(hint, node) { + if (onEmitNode) { + onEmitNode(hint, node, pipelineEmitWithComments); + } + else { + pipelineEmitWithComments(hint, node); + } } - /** - * Emits a node with comments. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitWithNotification. - */ - function pipelineEmitWithComments(emitContext, node) { - // Do not emit comments for SourceFile - if (emitContext === 0 /* SourceFile */) { - pipelineEmitWithSourceMap(emitContext, node); + function pipelineEmitWithComments(hint, node) { + node = trySubstituteNode(hint, node); + if (emitNodeWithComments && hint !== 0 /* SourceFile */) { + emitNodeWithComments(hint, node, pipelineEmitWithSourceMap); + } + else { + pipelineEmitWithSourceMap(hint, node); + } + } + function pipelineEmitWithSourceMap(hint, node) { + if (onEmitSourceMapOfNode && hint !== 0 /* SourceFile */ && hint !== 2 /* IdentifierName */) { + onEmitSourceMapOfNode(hint, node, pipelineEmitWithHint); + } + else { + pipelineEmitWithHint(hint, node); + } + } + function pipelineEmitWithHint(hint, node) { + switch (hint) { + case 0 /* SourceFile */: return pipelineEmitSourceFile(node); + case 2 /* IdentifierName */: return pipelineEmitIdentifierName(node); + case 1 /* Expression */: return pipelineEmitExpression(node); + case 3 /* Unspecified */: return pipelineEmitUnspecified(node); + } + } + function pipelineEmitSourceFile(node) { + ts.Debug.assertNode(node, ts.isSourceFile); + emitSourceFile(node); + } + function pipelineEmitIdentifierName(node) { + ts.Debug.assertNode(node, ts.isIdentifier); + emitIdentifier(node); + } + function pipelineEmitUnspecified(node) { + var kind = node.kind; + // Reserved words + // Strict mode reserved words + // Contextual keywords + if (ts.isKeyword(kind)) { + writeTokenText(kind); return; } - emitNodeWithComments(emitContext, node, pipelineEmitWithSourceMap); - } - /** - * Emits a node with source maps. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitWithComments. - */ - function pipelineEmitWithSourceMap(emitContext, node) { - // Do not emit source mappings for SourceFile or IdentifierName - if (emitContext === 0 /* SourceFile */ - || emitContext === 2 /* IdentifierName */) { - pipelineEmitWithSubstitution(emitContext, node); - return; - } - emitNodeWithSourceMap(emitContext, node, pipelineEmitWithSubstitution); - } - /** - * Emits a node with possible substitution. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitWithSourceMap or - * pipelineEmitInUnspecifiedContext (when picking a more specific context). - */ - function pipelineEmitWithSubstitution(emitContext, node) { - emitNodeWithSubstitution(emitContext, node, pipelineEmitForContext); - } - /** - * Emits a node. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitWithSubstitution. - */ - function pipelineEmitForContext(emitContext, node) { - switch (emitContext) { - case 0 /* SourceFile */: return pipelineEmitInSourceFileContext(node); - case 2 /* IdentifierName */: return pipelineEmitInIdentifierNameContext(node); - case 3 /* Unspecified */: return pipelineEmitInUnspecifiedContext(node); - case 1 /* Expression */: return pipelineEmitInExpressionContext(node); - } - } - /** - * Emits a node in the SourceFile EmitContext. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitForContext. - */ - function pipelineEmitInSourceFileContext(node) { - var kind = node.kind; - switch (kind) { - // Top-level nodes - case 261 /* SourceFile */: - return emitSourceFile(node); - } - } - /** - * Emits a node in the IdentifierName EmitContext. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitForContext. - */ - function pipelineEmitInIdentifierNameContext(node) { - var kind = node.kind; - switch (kind) { - // Identifiers - case 70 /* Identifier */: - return emitIdentifier(node); - } - } - /** - * Emits a node in the Unspecified EmitContext. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitForContext. - */ - function pipelineEmitInUnspecifiedContext(node) { - var kind = node.kind; switch (kind) { // Pseudo-literals case 13 /* TemplateHead */: @@ -59648,254 +64203,217 @@ var ts; // Identifiers case 70 /* Identifier */: return emitIdentifier(node); - // Reserved words - case 75 /* ConstKeyword */: - case 78 /* DefaultKeyword */: - case 83 /* ExportKeyword */: - case 104 /* VoidKeyword */: - // Strict mode reserved words - case 111 /* PrivateKeyword */: - case 112 /* ProtectedKeyword */: - case 113 /* PublicKeyword */: - case 114 /* StaticKeyword */: - // Contextual keywords - case 116 /* AbstractKeyword */: - case 117 /* AsKeyword */: - case 118 /* AnyKeyword */: - case 119 /* AsyncKeyword */: - case 120 /* AwaitKeyword */: - case 121 /* BooleanKeyword */: - case 122 /* ConstructorKeyword */: - case 123 /* DeclareKeyword */: - case 124 /* GetKeyword */: - case 125 /* IsKeyword */: - case 127 /* ModuleKeyword */: - case 128 /* NamespaceKeyword */: - case 129 /* NeverKeyword */: - case 130 /* ReadonlyKeyword */: - case 131 /* RequireKeyword */: - case 132 /* NumberKeyword */: - case 133 /* SetKeyword */: - case 134 /* StringKeyword */: - case 135 /* SymbolKeyword */: - case 136 /* TypeKeyword */: - case 137 /* UndefinedKeyword */: - case 138 /* FromKeyword */: - case 139 /* GlobalKeyword */: - case 140 /* OfKeyword */: - writeTokenText(kind); - return; // Parse tree nodes // Names - case 141 /* QualifiedName */: + case 142 /* QualifiedName */: return emitQualifiedName(node); - case 142 /* ComputedPropertyName */: + case 143 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 143 /* TypeParameter */: + case 144 /* TypeParameter */: return emitTypeParameter(node); - case 144 /* Parameter */: + case 145 /* Parameter */: return emitParameter(node); - case 145 /* Decorator */: + case 146 /* Decorator */: return emitDecorator(node); // Type members - case 146 /* PropertySignature */: + case 147 /* PropertySignature */: return emitPropertySignature(node); - case 147 /* PropertyDeclaration */: + case 148 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 148 /* MethodSignature */: + case 149 /* MethodSignature */: return emitMethodSignature(node); - case 149 /* MethodDeclaration */: + case 150 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 150 /* Constructor */: + case 151 /* Constructor */: return emitConstructor(node); - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: return emitAccessorDeclaration(node); - case 153 /* CallSignature */: + case 154 /* CallSignature */: return emitCallSignature(node); - case 154 /* ConstructSignature */: + case 155 /* ConstructSignature */: return emitConstructSignature(node); - case 155 /* IndexSignature */: + case 156 /* IndexSignature */: return emitIndexSignature(node); // Types - case 156 /* TypePredicate */: + case 157 /* TypePredicate */: return emitTypePredicate(node); - case 157 /* TypeReference */: + case 158 /* TypeReference */: return emitTypeReference(node); - case 158 /* FunctionType */: + case 159 /* FunctionType */: return emitFunctionType(node); - case 159 /* ConstructorType */: + case 160 /* ConstructorType */: return emitConstructorType(node); - case 160 /* TypeQuery */: + case 161 /* TypeQuery */: return emitTypeQuery(node); - case 161 /* TypeLiteral */: + case 162 /* TypeLiteral */: return emitTypeLiteral(node); - case 162 /* ArrayType */: + case 163 /* ArrayType */: return emitArrayType(node); - case 163 /* TupleType */: + case 164 /* TupleType */: return emitTupleType(node); - case 164 /* UnionType */: + case 165 /* UnionType */: return emitUnionType(node); - case 165 /* IntersectionType */: + case 166 /* IntersectionType */: return emitIntersectionType(node); - case 166 /* ParenthesizedType */: + case 167 /* ParenthesizedType */: return emitParenthesizedType(node); - case 199 /* ExpressionWithTypeArguments */: + case 200 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 167 /* ThisType */: + case 168 /* ThisType */: return emitThisType(); - case 168 /* TypeOperator */: + case 169 /* TypeOperator */: return emitTypeOperator(node); - case 169 /* IndexedAccessType */: + case 170 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 170 /* MappedType */: + case 171 /* MappedType */: return emitMappedType(node); - case 171 /* LiteralType */: + case 172 /* LiteralType */: return emitLiteralType(node); // Binding patterns - case 172 /* ObjectBindingPattern */: + case 173 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 173 /* ArrayBindingPattern */: + case 174 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 174 /* BindingElement */: + case 175 /* BindingElement */: return emitBindingElement(node); // Misc - case 202 /* TemplateSpan */: + case 204 /* TemplateSpan */: return emitTemplateSpan(node); - case 203 /* SemicolonClassElement */: + case 205 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 204 /* Block */: + case 206 /* Block */: return emitBlock(node); - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: return emitVariableStatement(node); - case 206 /* EmptyStatement */: + case 208 /* EmptyStatement */: return emitEmptyStatement(); - case 207 /* ExpressionStatement */: + case 209 /* ExpressionStatement */: return emitExpressionStatement(node); - case 208 /* IfStatement */: + case 210 /* IfStatement */: return emitIfStatement(node); - case 209 /* DoStatement */: + case 211 /* DoStatement */: return emitDoStatement(node); - case 210 /* WhileStatement */: + case 212 /* WhileStatement */: return emitWhileStatement(node); - case 211 /* ForStatement */: + case 213 /* ForStatement */: return emitForStatement(node); - case 212 /* ForInStatement */: + case 214 /* ForInStatement */: return emitForInStatement(node); - case 213 /* ForOfStatement */: + case 215 /* ForOfStatement */: return emitForOfStatement(node); - case 214 /* ContinueStatement */: + case 216 /* ContinueStatement */: return emitContinueStatement(node); - case 215 /* BreakStatement */: + case 217 /* BreakStatement */: return emitBreakStatement(node); - case 216 /* ReturnStatement */: + case 218 /* ReturnStatement */: return emitReturnStatement(node); - case 217 /* WithStatement */: + case 219 /* WithStatement */: return emitWithStatement(node); - case 218 /* SwitchStatement */: + case 220 /* SwitchStatement */: return emitSwitchStatement(node); - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: return emitLabeledStatement(node); - case 220 /* ThrowStatement */: + case 222 /* ThrowStatement */: return emitThrowStatement(node); - case 221 /* TryStatement */: + case 223 /* TryStatement */: return emitTryStatement(node); - case 222 /* DebuggerStatement */: + case 224 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 223 /* VariableDeclaration */: + case 225 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 224 /* VariableDeclarationList */: + case 226 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 225 /* FunctionDeclaration */: + case 227 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: return emitClassDeclaration(node); - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 228 /* TypeAliasDeclaration */: + case 230 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 231 /* ModuleBlock */: + case 233 /* ModuleBlock */: return emitModuleBlock(node); - case 232 /* CaseBlock */: + case 234 /* CaseBlock */: return emitCaseBlock(node); - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 235 /* ImportDeclaration */: + case 237 /* ImportDeclaration */: return emitImportDeclaration(node); - case 236 /* ImportClause */: + case 238 /* ImportClause */: return emitImportClause(node); - case 237 /* NamespaceImport */: + case 239 /* NamespaceImport */: return emitNamespaceImport(node); - case 238 /* NamedImports */: + case 240 /* NamedImports */: return emitNamedImports(node); - case 239 /* ImportSpecifier */: + case 241 /* ImportSpecifier */: return emitImportSpecifier(node); - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: return emitExportAssignment(node); - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: return emitExportDeclaration(node); - case 242 /* NamedExports */: + case 244 /* NamedExports */: return emitNamedExports(node); - case 243 /* ExportSpecifier */: + case 245 /* ExportSpecifier */: return emitExportSpecifier(node); - case 244 /* MissingDeclaration */: + case 246 /* MissingDeclaration */: return; // Module references - case 245 /* ExternalModuleReference */: + case 247 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 10 /* JsxText */: return emitJsxText(node); - case 248 /* JsxOpeningElement */: + case 250 /* JsxOpeningElement */: return emitJsxOpeningElement(node); - case 249 /* JsxClosingElement */: + case 251 /* JsxClosingElement */: return emitJsxClosingElement(node); - case 250 /* JsxAttribute */: + case 252 /* JsxAttribute */: return emitJsxAttribute(node); - case 251 /* JsxSpreadAttribute */: + case 253 /* JsxAttributes */: + return emitJsxAttributes(node); + case 254 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 252 /* JsxExpression */: + case 255 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 253 /* CaseClause */: + case 256 /* CaseClause */: return emitCaseClause(node); - case 254 /* DefaultClause */: + case 257 /* DefaultClause */: return emitDefaultClause(node); - case 255 /* HeritageClause */: + case 258 /* HeritageClause */: return emitHeritageClause(node); - case 256 /* CatchClause */: + case 259 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 257 /* PropertyAssignment */: + case 260 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 258 /* ShorthandPropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 259 /* SpreadAssignment */: + case 262 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 260 /* EnumMember */: + case 263 /* EnumMember */: return emitEnumMember(node); } // If the node is an expression, try to emit it as an expression with // substitution. if (ts.isExpression(node)) { - return pipelineEmitWithSubstitution(1 /* Expression */, node); + return pipelineEmitExpression(trySubstituteNode(1 /* Expression */, node)); + } + if (ts.isToken(node)) { + writeTokenText(kind); + return; } } - /** - * Emits a node in the Expression EmitContext. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from pipelineEmitForContext. - */ - function pipelineEmitInExpressionContext(node) { + function pipelineEmitExpression(node) { var kind = node.kind; switch (kind) { // Literals @@ -59917,68 +64435,76 @@ var ts; writeTokenText(kind); return; // Expressions - case 175 /* ArrayLiteralExpression */: + case 176 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 176 /* ObjectLiteralExpression */: + case 177 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 177 /* PropertyAccessExpression */: + case 178 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 178 /* ElementAccessExpression */: + case 179 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 179 /* CallExpression */: + case 180 /* CallExpression */: return emitCallExpression(node); - case 180 /* NewExpression */: + case 181 /* NewExpression */: return emitNewExpression(node); - case 181 /* TaggedTemplateExpression */: + case 182 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 182 /* TypeAssertionExpression */: + case 183 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 183 /* ParenthesizedExpression */: + case 184 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 184 /* FunctionExpression */: + case 185 /* FunctionExpression */: return emitFunctionExpression(node); - case 185 /* ArrowFunction */: + case 186 /* ArrowFunction */: return emitArrowFunction(node); - case 186 /* DeleteExpression */: + case 187 /* DeleteExpression */: return emitDeleteExpression(node); - case 187 /* TypeOfExpression */: + case 188 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 188 /* VoidExpression */: + case 189 /* VoidExpression */: return emitVoidExpression(node); - case 189 /* AwaitExpression */: + case 190 /* AwaitExpression */: return emitAwaitExpression(node); - case 190 /* PrefixUnaryExpression */: + case 191 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 191 /* PostfixUnaryExpression */: + case 192 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: return emitBinaryExpression(node); - case 193 /* ConditionalExpression */: + case 194 /* ConditionalExpression */: return emitConditionalExpression(node); - case 194 /* TemplateExpression */: + case 195 /* TemplateExpression */: return emitTemplateExpression(node); - case 195 /* YieldExpression */: + case 196 /* YieldExpression */: return emitYieldExpression(node); - case 196 /* SpreadElement */: + case 197 /* SpreadElement */: return emitSpreadExpression(node); - case 197 /* ClassExpression */: + case 198 /* ClassExpression */: return emitClassExpression(node); - case 198 /* OmittedExpression */: + case 199 /* OmittedExpression */: return; - case 200 /* AsExpression */: + case 201 /* AsExpression */: return emitAsExpression(node); - case 201 /* NonNullExpression */: + case 202 /* NonNullExpression */: return emitNonNullExpression(node); + case 203 /* MetaProperty */: + return emitMetaProperty(node); // JSX - case 246 /* JsxElement */: + case 248 /* JsxElement */: return emitJsxElement(node); - case 247 /* JsxSelfClosingElement */: + case 249 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); // Transformation nodes - case 294 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 297 /* RawExpression */: - return writeLines(node.text); + } + } + function trySubstituteNode(hint, node) { + return node && substituteNode && substituteNode(hint, node) || node; + } + function emitHelpersIndirect(node) { + if (onEmitHelpers) { + onEmitHelpers(node, writeLines); } } // @@ -59987,9 +64513,6 @@ var ts; // SyntaxKind.NumericLiteral function emitNumericLiteral(node) { emitLiteral(node); - if (node.trailingComment) { - write(" /*" + node.trailingComment + "*/"); - } } // SyntaxKind.StringLiteral // SyntaxKind.RegularExpressionLiteral @@ -59999,7 +64522,7 @@ var ts; // SyntaxKind.TemplateTail function emitLiteral(node) { var text = getLiteralTextOfNode(node); - if ((compilerOptions.sourceMap || compilerOptions.inlineSourceMap) + if ((printerOptions.sourceMap || printerOptions.inlineSourceMap) && (node.kind === 9 /* StringLiteral */ || ts.isTemplateLiteralKind(node.kind))) { writer.writeLiteral(text); } @@ -60047,8 +64570,8 @@ var ts; writeIfPresent(node.dotDotDotToken, "..."); emit(node.name); writeIfPresent(node.questionToken, "?"); - emitExpressionWithPrefix(" = ", node.initializer); emitWithPrefix(": ", node.type); + emitExpressionWithPrefix(" = ", node.initializer); } function emitDecorator(decorator) { write("@"); @@ -60098,7 +64621,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write(node.kind === 151 /* GetAccessor */ ? "get " : "set "); + write(node.kind === 152 /* GetAccessor */ ? "get " : "set "); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); } @@ -60201,17 +64724,13 @@ var ts; write("{"); writeLine(); increaseIndent(); - if (node.readonlyToken) { - write("readonly "); - } + writeIfPresent(node.readonlyToken, "readonly "); write("["); emit(node.typeParameter.name); write(" in "); emit(node.typeParameter.constraint); write("]"); - if (node.questionToken) { - write("?"); - } + writeIfPresent(node.questionToken, "?"); write(": "); emit(node.type); write(";"); @@ -60277,7 +64796,7 @@ var ts; increaseIndent(); } var preferNewLine = node.multiLine ? 32768 /* PreferNewLine */ : 0 /* None */; - var allowTrailingComma = languageVersion >= 1 /* ES5 */ ? 32 /* AllowTrailingComma */ : 0 /* None */; + var allowTrailingComma = currentSourceFile.languageVersion >= 1 /* ES5 */ ? 32 /* AllowTrailingComma */ : 0 /* None */; emitList(node, properties, 978 /* ObjectLiteralExpressionProperties */ | allowTrailingComma | preferNewLine); if (indentedFlag) { decreaseIndent(); @@ -60289,7 +64808,7 @@ var ts; var indentAfterDot = false; if (!(ts.getEmitFlags(node) & 65536 /* NoIndentation */)) { var dotRangeStart = node.expression.end; - var dotRangeEnd = ts.skipTrivia(currentText, node.expression.end) + 1; + var dotRangeEnd = ts.skipTrivia(currentSourceFile.text, node.expression.end) + 1; var dotToken = { kind: 22 /* DotToken */, pos: dotRangeStart, end: dotRangeEnd }; indentBeforeDot = needsIndentation(node, node.expression, dotToken); indentAfterDot = needsIndentation(node, dotToken, node.name); @@ -60305,10 +64824,12 @@ var ts; // 1..toString is a valid property access, emit a dot after the literal // Also emit a dot if expression is a integer const enum value - it will appear in generated code as numeric literal function needsDotDotForPropertyAccess(expression) { - if (expression.kind === 8 /* NumericLiteral */) { - // check if numeric literal was originally written with a dot + expression = ts.skipPartiallyEmittedExpressions(expression); + if (ts.isNumericLiteral(expression)) { + // check if numeric literal is a decimal literal that was originally written with a dot var text = getLiteralTextOfNode(expression); - return text.indexOf(ts.tokenToString(22 /* DotToken */)) < 0; + return !expression.numericLiteralFlags + && text.indexOf(ts.tokenToString(22 /* DotToken */)) < 0; } else if (ts.isPropertyAccessExpression(expression) || ts.isElementAccessExpression(expression)) { // check if constant enum value is integer @@ -60316,7 +64837,7 @@ var ts; // isFinite handles cases when constantValue is undefined return isFinite(constantValue) && Math.floor(constantValue) === constantValue - && compilerOptions.removeComments; + && printerOptions.removeComments; } } function emitElementAccessExpression(node) { @@ -60342,11 +64863,9 @@ var ts; emitExpression(node.template); } function emitTypeAssertionExpression(node) { - if (node.type) { - write("<"); - emit(node.type); - write(">"); - } + write("<"); + emit(node.type); + write(">"); emitExpression(node.expression); } function emitParenthesizedExpression(node) { @@ -60405,7 +64924,7 @@ var ts; // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. var operand = node.operand; - return operand.kind === 190 /* PrefixUnaryExpression */ + return operand.kind === 191 /* PrefixUnaryExpression */ && ((node.operator === 36 /* PlusToken */ && (operand.operator === 36 /* PlusToken */ || operand.operator === 42 /* PlusPlusToken */)) || (node.operator === 37 /* MinusToken */ && (operand.operator === 37 /* MinusToken */ || operand.operator === 43 /* MinusMinusToken */))); } @@ -60471,6 +64990,11 @@ var ts; emitExpression(node.expression); write("!"); } + function emitMetaProperty(node) { + writeToken(node.keywordToken, node.pos); + write("."); + emit(node.name); + } // // Misc // @@ -60490,6 +65014,10 @@ var ts; else { writeToken(16 /* OpenBraceToken */, node.pos, /*contextNode*/ node); emitBlockStatements(node); + // We have to call emitLeadingComments explicitly here because otherwise leading comments of the close brace token will not be emitted + increaseIndent(); + emitLeadingCommentsOfPosition(node.statements.end); + decreaseIndent(); writeToken(17 /* CloseBraceToken */, node.statements.end, /*contextNode*/ node); } } @@ -60519,27 +65047,27 @@ var ts; writeToken(18 /* OpenParenToken */, openParenPos, node); emitExpression(node.expression); writeToken(19 /* CloseParenToken */, node.expression.end, node); - emitEmbeddedStatement(node.thenStatement); + emitEmbeddedStatement(node, node.thenStatement); if (node.elseStatement) { - writeLine(); + writeLineOrSpace(node); writeToken(81 /* ElseKeyword */, node.thenStatement.end, node); - if (node.elseStatement.kind === 208 /* IfStatement */) { + if (node.elseStatement.kind === 210 /* IfStatement */) { write(" "); emit(node.elseStatement); } else { - emitEmbeddedStatement(node.elseStatement); + emitEmbeddedStatement(node, node.elseStatement); } } } function emitDoStatement(node) { write("do"); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); if (ts.isBlock(node.statement)) { write(" "); } else { - writeLine(); + writeLineOrSpace(node); } write("while ("); emitExpression(node.expression); @@ -60549,7 +65077,7 @@ var ts; write("while ("); emitExpression(node.expression); write(")"); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitForStatement(node) { var openParenPos = writeToken(87 /* ForKeyword */, node.pos); @@ -60561,7 +65089,7 @@ var ts; write(";"); emitExpressionWithPrefix(" ", node.incrementor); write(")"); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitForInStatement(node) { var openParenPos = writeToken(87 /* ForKeyword */, node.pos); @@ -60571,21 +65099,22 @@ var ts; write(" in "); emitExpression(node.expression); writeToken(19 /* CloseParenToken */, node.expression.end); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitForOfStatement(node) { var openParenPos = writeToken(87 /* ForKeyword */, node.pos); write(" "); + emitWithSuffix(node.awaitModifier, " "); writeToken(18 /* OpenParenToken */, openParenPos); emitForBinding(node.initializer); write(" of "); emitExpression(node.expression); writeToken(19 /* CloseParenToken */, node.expression.end); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 224 /* VariableDeclarationList */) { + if (node.kind === 226 /* VariableDeclarationList */) { emit(node); } else { @@ -60612,7 +65141,7 @@ var ts; write("with ("); emitExpression(node.expression); write(")"); - emitEmbeddedStatement(node.statement); + emitEmbeddedStatement(node, node.statement); } function emitSwitchStatement(node) { var openParenPos = writeToken(97 /* SwitchKeyword */, node.pos); @@ -60636,9 +65165,12 @@ var ts; function emitTryStatement(node) { write("try "); emit(node.tryBlock); - emit(node.catchClause); + if (node.catchClause) { + writeLineOrSpace(node); + emit(node.catchClause); + } if (node.finallyBlock) { - writeLine(); + writeLineOrSpace(node); write("finally "); emit(node.finallyBlock); } @@ -60669,6 +65201,9 @@ var ts; emitIdentifierName(node.name); emitSignatureAndBody(node, emitSignatureHead); } + function emitBlockCallback(_hint, body) { + emitBlockFunctionBody(body); + } function emitSignatureAndBody(node, emitSignatureHead) { var body = node.body; if (body) { @@ -60679,14 +65214,23 @@ var ts; } if (ts.getEmitFlags(node) & 262144 /* ReuseTempVariableScope */) { emitSignatureHead(node); - emitBlockFunctionBody(body); + if (onEmitNode) { + onEmitNode(3 /* Unspecified */, body, emitBlockCallback); + } + else { + emitBlockFunctionBody(body); + } } else { - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); emitSignatureHead(node); - emitBlockFunctionBody(body); - tempFlags = savedTempFlags; + if (onEmitNode) { + onEmitNode(3 /* Unspecified */, body, emitBlockCallback); + } + else { + emitBlockFunctionBody(body); + } + popNameGenerationScope(); } if (indentedFlag) { decreaseIndent(); @@ -60741,9 +65285,15 @@ var ts; function emitBlockFunctionBody(body) { write(" {"); increaseIndent(); - emitBodyWithDetachedComments(body, body.statements, shouldEmitBlockFunctionBodyOnSingleLine(body) + var emitBlockFunctionBody = shouldEmitBlockFunctionBodyOnSingleLine(body) ? emitBlockFunctionBodyOnSingleLine - : emitBlockFunctionBodyWorker); + : emitBlockFunctionBodyWorker; + if (emitBodyWithDetachedComments) { + emitBodyWithDetachedComments(body, body.statements, emitBlockFunctionBody); + } + else { + emitBlockFunctionBody(body); + } decreaseIndent(); writeToken(17 /* CloseBraceToken */, body.statements.end, body); } @@ -60753,8 +65303,9 @@ var ts; function emitBlockFunctionBodyWorker(body, emitBlockFunctionBodyOnSingleLine) { // Emit all the prologue directives (like "use strict"). var statementOffset = emitPrologueDirectives(body.statements, /*startWithNewLine*/ true); - var helpersEmitted = emitHelpers(body); - if (statementOffset === 0 && !helpersEmitted && emitBlockFunctionBodyOnSingleLine) { + var pos = writer.getTextPos(); + emitHelpersIndirect(body); + if (statementOffset === 0 && pos === writer.getTextPos() && emitBlockFunctionBodyOnSingleLine) { decreaseIndent(); emitList(body, body.statements, 384 /* SingleLineFunctionBodyStatements */); increaseIndent(); @@ -60777,15 +65328,14 @@ var ts; } emitTypeParameters(node, node.typeParameters); emitList(node, node.heritageClauses, 256 /* ClassHeritageClauses */); - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); write(" {"); emitList(node, node.members, 65 /* ClassMembers */); write("}"); + popNameGenerationScope(); if (indentedFlag) { decreaseIndent(); } - tempFlags = savedTempFlags; } function emitInterfaceDeclaration(node) { emitDecorators(node, node.decorators); @@ -60812,19 +65362,18 @@ var ts; emitModifiers(node, node.modifiers); write("enum "); emit(node.name); - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); write(" {"); emitList(node, node.members, 81 /* EnumMembers */); write("}"); - tempFlags = savedTempFlags; + popNameGenerationScope(); } function emitModuleDeclaration(node) { emitModifiers(node, node.modifiers); write(node.flags & 16 /* Namespace */ ? "namespace " : "module "); emit(node.name); var body = node.body; - while (body.kind === 230 /* ModuleDeclaration */) { + while (body.kind === 232 /* ModuleDeclaration */) { write("."); emit(body.name); body = body.body; @@ -60837,13 +65386,11 @@ var ts; write("{ }"); } else { - var savedTempFlags = tempFlags; - tempFlags = 0; + pushNameGenerationScope(); write("{"); - increaseIndent(); emitBlockStatements(node); write("}"); - tempFlags = savedTempFlags; + popNameGenerationScope(); } } function emitCaseBlock(node) { @@ -60951,14 +65498,20 @@ var ts; write("<"); emitJsxTagName(node.tagName); write(" "); - emitList(node, node.attributes, 131328 /* JsxElementAttributes */); + // We are checking here so we won't re-enter the emiting pipeline and emit extra sourcemap + if (node.attributes.properties && node.attributes.properties.length > 0) { + emit(node.attributes); + } write("/>"); } function emitJsxOpeningElement(node) { write("<"); emitJsxTagName(node.tagName); - writeIfAny(node.attributes, " "); - emitList(node, node.attributes, 131328 /* JsxElementAttributes */); + writeIfAny(node.attributes.properties, " "); + // We are checking here so we won't re-enter the emitting pipeline and emit extra sourcemap + if (node.attributes.properties && node.attributes.properties.length > 0) { + emit(node.attributes); + } write(">"); } function emitJsxText(node) { @@ -60969,6 +65522,9 @@ var ts; emitJsxTagName(node.tagName); write(">"); } + function emitJsxAttributes(node) { + emitList(node, node.properties, 131328 /* JsxElementAttributes */); + } function emitJsxAttribute(node) { emit(node.name); emitWithPrefix("=", node.initializer); @@ -60981,6 +65537,9 @@ var ts; function emitJsxExpression(node) { if (node.expression) { write("{"); + if (node.dotDotDotToken) { + write("..."); + } emitExpression(node.expression); write("}"); } @@ -61028,7 +65587,6 @@ var ts; emitList(node, node.types, 272 /* HeritageClauseTypes */); } function emitCatchClause(node) { - writeLine(); var openParenPos = writeToken(73 /* CatchKeyword */, node.pos); write(" "); writeToken(18 /* OpenParenToken */, openParenPos); @@ -61051,7 +65609,7 @@ var ts; // "comment1" is not considered to be leading comment for node.initializer // but rather a trailing comment on the previous node. var initializer = node.initializer; - if ((ts.getEmitFlags(initializer) & 512 /* NoLeadingComments */) === 0) { + if (emitTrailingCommentsOfPosition && (ts.getEmitFlags(initializer) & 512 /* NoLeadingComments */) === 0) { var commentRange = ts.getCommentRange(initializer); emitTrailingCommentsOfPosition(commentRange.pos); } @@ -61082,17 +65640,27 @@ var ts; // function emitSourceFile(node) { writeLine(); - emitShebang(); - emitBodyWithDetachedComments(node, node.statements, emitSourceFileWorker); + var statements = node.statements; + if (emitBodyWithDetachedComments) { + // Emit detached comment if there are no prologue directives or if the first node is synthesized. + // The synthesized node will have no leading comment so some comments may be missed. + var shouldEmitDetachedComment = statements.length === 0 || + !ts.isPrologueDirective(statements[0]) || + ts.nodeIsSynthesized(statements[0]); + if (shouldEmitDetachedComment) { + emitBodyWithDetachedComments(node, statements, emitSourceFileWorker); + return; + } + } + emitSourceFileWorker(node); } function emitSourceFileWorker(node) { var statements = node.statements; - var statementOffset = emitPrologueDirectives(statements); - var savedTempFlags = tempFlags; - tempFlags = 0; - emitHelpers(node); - emitList(node, statements, 1 /* MultiLine */, statementOffset); - tempFlags = savedTempFlags; + pushNameGenerationScope(); + emitHelpersIndirect(node); + var index = ts.findIndex(statements, function (statement) { return !ts.isPrologueDirective(statement); }); + emitList(node, statements, 1 /* MultiLine */, index === -1 ? statements.length : index); + popNameGenerationScope(); } // Transformation nodes function emitPartiallyEmittedExpression(node) { @@ -61102,13 +65670,20 @@ var ts; * Emits any prologue directives at the start of a Statement list, returning the * number of prologue directives written to the output. */ - function emitPrologueDirectives(statements, startWithNewLine) { + function emitPrologueDirectives(statements, startWithNewLine, seenPrologueDirectives) { for (var i = 0; i < statements.length; i++) { - if (ts.isPrologueDirective(statements[i])) { - if (startWithNewLine || i > 0) { - writeLine(); + var statement = statements[i]; + if (ts.isPrologueDirective(statement)) { + var shouldEmitPrologueDirective = seenPrologueDirectives ? !seenPrologueDirectives.has(statement.expression.text) : true; + if (shouldEmitPrologueDirective) { + if (startWithNewLine || i > 0) { + writeLine(); + } + emit(statement); + if (seenPrologueDirectives) { + seenPrologueDirectives.set(statement.expression.text, statement.expression.text); + } } - emit(statements[i]); } else { // return index of the first non prologue directive @@ -61117,81 +65692,42 @@ var ts; } return statements.length; } - function emitHelpers(node, isBundle) { - var sourceFile = ts.isSourceFile(node) ? node : currentSourceFile; - var shouldSkip = compilerOptions.noEmitHelpers || (sourceFile && ts.getExternalHelpersModuleName(sourceFile) !== undefined); - var shouldBundle = ts.isSourceFile(node) && !isOwnFileEmit; - var helpersEmitted = false; - var helpers = ts.getEmitHelpers(node); - if (helpers) { - for (var _a = 0, _b = ts.stableSort(helpers, ts.compareEmitHelpers); _a < _b.length; _a++) { - var helper = _b[_a]; - if (!helper.scoped) { - // Skip the helper if it can be skipped and the noEmitHelpers compiler - // option is set, or if it can be imported and the importHelpers compiler - // option is set. - if (shouldSkip) - continue; - // Skip the helper if it can be bundled but hasn't already been emitted and we - // are emitting a bundled module. - if (shouldBundle) { - if (bundledHelpers[helper.name]) { - continue; - } - bundledHelpers[helper.name] = true; - } - } - else if (isBundle) { - // Skip the helper if it is scoped and we are emitting bundled helpers - continue; - } - writeLines(helper.text); - helpersEmitted = true; - } + function emitPrologueDirectivesIfNeeded(sourceFileOrBundle) { + if (ts.isSourceFile(sourceFileOrBundle)) { + setSourceFile(sourceFileOrBundle); + emitPrologueDirectives(sourceFileOrBundle.statements); } - if (helpersEmitted) { - writeLine(); - } - return helpersEmitted; - } - function writeLines(text) { - var lines = text.split(/\r\n?|\n/g); - var indentation = guessIndentation(lines); - for (var i = 0; i < lines.length; i++) { - var line = indentation ? lines[i].slice(indentation) : lines[i]; - if (line.length) { - if (i > 0) { - writeLine(); - } - write(line); + else { + var seenPrologueDirectives = ts.createMap(); + for (var _a = 0, _b = sourceFileOrBundle.sourceFiles; _a < _b.length; _a++) { + var sourceFile = _b[_a]; + setSourceFile(sourceFile); + emitPrologueDirectives(sourceFile.statements, /*startWithNewLine*/ true, seenPrologueDirectives); } } } - function guessIndentation(lines) { - var indentation; - for (var _a = 0, lines_1 = lines; _a < lines_1.length; _a++) { - var line = lines_1[_a]; - for (var i = 0; i < line.length && (indentation === undefined || i < indentation); i++) { - if (!ts.isWhiteSpace(line.charCodeAt(i))) { - if (indentation === undefined || i < indentation) { - indentation = i; - break; - } + function emitShebangIfNeeded(sourceFileOrBundle) { + if (ts.isSourceFile(sourceFileOrBundle)) { + var shebang = ts.getShebang(sourceFileOrBundle.text); + if (shebang) { + write(shebang); + writeLine(); + return true; + } + } + else { + for (var _a = 0, _b = sourceFileOrBundle.sourceFiles; _a < _b.length; _a++) { + var sourceFile = _b[_a]; + // Emit only the first encountered shebang + if (emitShebangIfNeeded(sourceFile)) { + break; } } } - return indentation; } // // Helpers // - function emitShebang() { - var shebang = ts.getShebang(currentText); - if (shebang) { - write(shebang); - writeLine(); - } - } function emitModifiers(node, modifiers) { if (modifiers && modifiers.length) { emitList(node, modifiers, 256 /* Modifiers */); @@ -61216,8 +65752,8 @@ var ts; write(suffix); } } - function emitEmbeddedStatement(node) { - if (ts.isBlock(node)) { + function emitEmbeddedStatement(parent, node) { + if (ts.isBlock(node) || ts.getEmitFlags(parent) & 1 /* SingleLine */) { write(" "); emit(node); } @@ -61274,6 +65810,9 @@ var ts; if (format & 7680 /* BracketsMask */) { write(getOpeningBracket(format)); } + if (onBeforeEmitNodeArray) { + onBeforeEmitNodeArray(children); + } if (isEmpty) { // Write a line terminator if the parent node was multi-line if (format & 1 /* MultiLine */) { @@ -61306,6 +65845,15 @@ var ts; var child = children[start + i]; // Write the delimiter if this is not the first node. if (previousSibling) { + // i.e + // function commentedParameters( + // /* Parameter a */ + // a + // /* End of parameter a */ -> this comment isn't considered to be trailing comment of parameter "a" due to newline + // , + if (delimiter && previousSibling.end !== parentNode.end) { + emitLeadingCommentsOfPosition(previousSibling.end); + } write(delimiter); // Write either a line terminator or whitespace to separate the elements. if (shouldWriteSeparatingLineTerminator(previousSibling, child, format)) { @@ -61322,14 +65870,16 @@ var ts; write(" "); } } + // Emit this child. if (shouldEmitInterveningComments) { - var commentRange = ts.getCommentRange(child); - emitTrailingCommentsOfPosition(commentRange.pos); + if (emitTrailingCommentsOfPosition) { + var commentRange = ts.getCommentRange(child); + emitTrailingCommentsOfPosition(commentRange.pos); + } } else { shouldEmitInterveningComments = mayEmitInterveningComments; } - // Emit this child. emit(child); if (shouldDecreaseIndentAfterEmit) { decreaseIndent(); @@ -61342,6 +65892,15 @@ var ts; if (format & 16 /* CommaDelimited */ && hasTrailingComma) { write(","); } + // Emit any trailing comment of the last element in the list + // i.e + // var array = [... + // 2 + // /* end of element 2 */ + // ]; + if (previousSibling && delimiter && previousSibling.end !== parentNode.end) { + emitLeadingCommentsOfPosition(previousSibling.end); + } // Decrease the indent, if requested. if (format & 64 /* Indented */) { decreaseIndent(); @@ -61354,28 +65913,80 @@ var ts; write(" "); } } + if (onAfterEmitNodeArray) { + onAfterEmitNodeArray(children); + } if (format & 7680 /* BracketsMask */) { write(getClosingBracket(format)); } } + function write(s) { + writer.write(s); + } + function writeLine() { + writer.writeLine(); + } + function increaseIndent() { + writer.increaseIndent(); + } + function decreaseIndent() { + writer.decreaseIndent(); + } function writeIfAny(nodes, text) { - if (nodes && nodes.length > 0) { + if (ts.some(nodes)) { write(text); } } function writeIfPresent(node, text) { - if (node !== undefined) { + if (node) { write(text); } } function writeToken(token, pos, contextNode) { - return emitTokenWithSourceMap(contextNode, token, pos, writeTokenText); + return onEmitSourceMapOfToken + ? onEmitSourceMapOfToken(contextNode, token, pos, writeTokenText) + : writeTokenText(token, pos); } function writeTokenText(token, pos) { var tokenString = ts.tokenToString(token); write(tokenString); return pos < 0 ? pos : pos + tokenString.length; } + function writeLineOrSpace(node) { + if (ts.getEmitFlags(node) & 1 /* SingleLine */) { + write(" "); + } + else { + writeLine(); + } + } + function writeLines(text) { + var lines = text.split(/\r\n?|\n/g); + var indentation = guessIndentation(lines); + for (var i = 0; i < lines.length; i++) { + var line = indentation ? lines[i].slice(indentation) : lines[i]; + if (line.length) { + writeLine(); + write(line); + writeLine(); + } + } + } + function guessIndentation(lines) { + var indentation; + for (var _a = 0, lines_1 = lines; _a < lines_1.length; _a++) { + var line = lines_1[_a]; + for (var i = 0; i < line.length && (indentation === undefined || i < indentation); i++) { + if (!ts.isWhiteSpace(line.charCodeAt(i))) { + if (indentation === undefined || i < indentation) { + indentation = i; + break; + } + } + } + } + return indentation; + } function increaseIndentIf(value, valueToWriteWhenNotIndenting) { if (value) { increaseIndent(); @@ -61485,15 +66096,23 @@ var ts; && !ts.nodeIsSynthesized(node2) && !ts.rangeEndIsOnSameLineAsRangeStart(node1, node2, currentSourceFile); } + function isSingleLineEmptyBlock(block) { + return !block.multiLine + && isEmptyBlock(block); + } + function isEmptyBlock(block) { + return block.statements.length === 0 + && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); + } function skipSynthesizedParentheses(node) { - while (node.kind === 183 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 184 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; } function getTextOfNode(node, includeTrivia) { if (ts.isGeneratedIdentifier(node)) { - return getGeneratedIdentifier(node); + return generateName(node); } else if (ts.isIdentifier(node) && (ts.nodeIsSynthesized(node) || !node.parent)) { return ts.unescapeIdentifier(node.text); @@ -61516,26 +66135,60 @@ var ts; return getLiteralTextOfNode(textSourceNode); } } - return ts.getLiteralText(node, currentSourceFile, languageVersion); + return ts.getLiteralText(node, currentSourceFile); } - function isSingleLineEmptyBlock(block) { - return !block.multiLine - && isEmptyBlock(block); + /** + * Push a new name generation scope. + */ + function pushNameGenerationScope() { + tempFlagsStack.push(tempFlags); + tempFlags = 0; } - function isEmptyBlock(block) { - return block.statements.length === 0 - && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); + /** + * Pop the current name generation scope. + */ + function popNameGenerationScope() { + tempFlags = tempFlagsStack.pop(); } + /** + * Generate the text for a generated identifier. + */ + function generateName(name) { + if (name.autoGenerateKind === 4 /* Node */) { + // Node names generate unique names based on their original node + // and are cached based on that node's id. + var node = getNodeForGeneratedName(name); + return generateNameCached(node); + } + else { + // Auto, Loop, and Unique names are cached based on their unique + // autoGenerateId. + var autoGenerateId = name.autoGenerateId; + return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = ts.unescapeIdentifier(makeName(name))); + } + } + function generateNameCached(node) { + var nodeId = ts.getNodeId(node); + return nodeIdToGeneratedName[nodeId] || (nodeIdToGeneratedName[nodeId] = ts.unescapeIdentifier(generateNameForNode(node))); + } + /** + * Returns a value indicating whether a name is unique globally, within the current file, + * or within the NameGenerator. + */ function isUniqueName(name) { - return !resolver.hasGlobalName(name) && - !ts.hasProperty(currentFileIdentifiers, name) && - !ts.hasProperty(generatedNameSet, name); + return !(hasGlobalName && hasGlobalName(name)) + && !currentSourceFile.identifiers.has(name) + && !generatedNames.has(name); } + /** + * Returns a value indicating whether a name is unique within a container. + */ function isUniqueLocalName(name, container) { for (var node = container; ts.isNodeDescendantOf(node, container); node = node.nextContainer) { - if (node.locals && ts.hasProperty(node.locals, name)) { + if (node.locals) { + var local = node.locals.get(name); // We conservatively include alias symbols to cover cases where they're emitted as locals - if (node.locals[name].flags & (107455 /* Value */ | 1048576 /* ExportValue */ | 8388608 /* Alias */)) { + if (local && local.flags & (107455 /* Value */ | 1048576 /* ExportValue */ | 8388608 /* Alias */)) { return false; } } @@ -61543,16 +66196,16 @@ var ts; return true; } /** - * Return the next available name in the pattern _a ... _z, _0, _1, ... - * TempFlags._i or TempFlags._n may be used to express a preference for that dedicated name. - * Note that names generated by makeTempVariableName and makeUniqueName will never conflict. - */ + * Return the next available name in the pattern _a ... _z, _0, _1, ... + * TempFlags._i or TempFlags._n may be used to express a preference for that dedicated name. + * Note that names generated by makeTempVariableName and makeUniqueName will never conflict. + */ function makeTempVariableName(flags) { if (flags && !(tempFlags & flags)) { - var name_39 = flags === 268435456 /* _i */ ? "_i" : "_n"; - if (isUniqueName(name_39)) { + var name = flags === 268435456 /* _i */ ? "_i" : "_n"; + if (isUniqueName(name)) { tempFlags |= flags; - return name_39; + return name; } } while (true) { @@ -61560,19 +66213,21 @@ var ts; tempFlags++; // Skip over 'i' and 'n' if (count !== 8 && count !== 13) { - var name_40 = count < 26 + var name = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26); - if (isUniqueName(name_40)) { - return name_40; + if (isUniqueName(name)) { + return name; } } } } - // Generate a name that is unique within the current file and doesn't conflict with any names - // in global scope. The name is formed by adding an '_n' suffix to the specified base name, - // where n is a positive integer. Note that names generated by makeTempVariableName and - // makeUniqueName are guaranteed to never conflict. + /** + * Generate a name that is unique within the current file and doesn't conflict with any names + * in global scope. The name is formed by adding an '_n' suffix to the specified base name, + * where n is a positive integer. Note that names generated by makeTempVariableName and + * makeUniqueName are guaranteed to never conflict. + */ function makeUniqueName(baseName) { // Find the first unique 'name_n', where n is a positive number if (baseName.charCodeAt(baseName.length - 1) !== 95 /* _ */) { @@ -61582,73 +66237,90 @@ var ts; while (true) { var generatedName = baseName + i; if (isUniqueName(generatedName)) { - return generatedNameSet[generatedName] = generatedName; + generatedNames.set(generatedName, generatedName); + return generatedName; } i++; } } + /** + * Generates a unique name for a ModuleDeclaration or EnumDeclaration. + */ function generateNameForModuleOrEnum(node) { var name = getTextOfNode(node.name); // Use module/enum name itself if it is unique, otherwise make a unique variation return isUniqueLocalName(name, node) ? name : makeUniqueName(name); } + /** + * Generates a unique name for an ImportDeclaration or ExportDeclaration. + */ function generateNameForImportOrExportDeclaration(node) { var expr = ts.getExternalModuleName(node); var baseName = expr.kind === 9 /* StringLiteral */ ? ts.escapeIdentifier(ts.makeIdentifierFromModuleName(expr.text)) : "module"; return makeUniqueName(baseName); } + /** + * Generates a unique name for a default export. + */ function generateNameForExportDefault() { return makeUniqueName("default"); } + /** + * Generates a unique name for a class expression. + */ function generateNameForClassExpression() { return makeUniqueName("class"); } + function generateNameForMethodOrAccessor(node) { + if (ts.isIdentifier(node.name)) { + return generateNameCached(node.name); + } + return makeTempVariableName(0 /* Auto */); + } /** * Generates a unique name from a node. - * - * @param node A node. */ function generateNameForNode(node) { switch (node.kind) { case 70 /* Identifier */: return makeUniqueName(getTextOfNode(node)); - case 230 /* ModuleDeclaration */: - case 229 /* EnumDeclaration */: + case 232 /* ModuleDeclaration */: + case 231 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 235 /* ImportDeclaration */: - case 241 /* ExportDeclaration */: + case 237 /* ImportDeclaration */: + case 243 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 225 /* FunctionDeclaration */: - case 226 /* ClassDeclaration */: - case 240 /* ExportAssignment */: + case 227 /* FunctionDeclaration */: + case 228 /* ClassDeclaration */: + case 242 /* ExportAssignment */: return generateNameForExportDefault(); - case 197 /* ClassExpression */: + case 198 /* ClassExpression */: return generateNameForClassExpression(); + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + return generateNameForMethodOrAccessor(node); default: return makeTempVariableName(0 /* Auto */); } } /** * Generates a unique identifier for a node. - * - * @param name A generated name. */ - function generateName(name) { + function makeName(name) { switch (name.autoGenerateKind) { case 1 /* Auto */: return makeTempVariableName(0 /* Auto */); case 2 /* Loop */: return makeTempVariableName(268435456 /* _i */); case 3 /* Unique */: - return makeUniqueName(name.text); + return makeUniqueName(ts.unescapeIdentifier(name.text)); } ts.Debug.fail("Unsupported GeneratedIdentifierKind."); } /** * Gets the node from which a name should be generated. - * - * @param name A generated name wrapper. */ function getNodeForGeneratedName(name) { var autoGenerateId = name.autoGenerateId; @@ -61668,53 +66340,40 @@ var ts; // otherwise, return the original node for the source; return node; } - /** - * Gets the generated identifier text from a generated identifier. - * - * @param name The generated identifier. - */ - function getGeneratedIdentifier(name) { - if (name.autoGenerateKind === 4 /* Node */) { - // Generated names generate unique names based on their original node - // and are cached based on that node's id - var node = getNodeForGeneratedName(name); - var nodeId = ts.getNodeId(node); - return nodeIdToGeneratedName[nodeId] || (nodeIdToGeneratedName[nodeId] = ts.unescapeIdentifier(generateNameForNode(node))); - } - else { - // Auto, Loop, and Unique names are cached based on their unique - // autoGenerateId. - var autoGenerateId = name.autoGenerateId; - return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = ts.unescapeIdentifier(generateName(name))); - } - } - function createDelimiterMap() { - var delimiters = []; - delimiters[0 /* None */] = ""; - delimiters[16 /* CommaDelimited */] = ","; - delimiters[4 /* BarDelimited */] = " |"; - delimiters[8 /* AmpersandDelimited */] = " &"; - return delimiters; - } - function getDelimiter(format) { - return delimiters[format & 28 /* DelimitersMask */]; - } - function createBracketsMap() { - var brackets = []; - brackets[512 /* Braces */] = ["{", "}"]; - brackets[1024 /* Parenthesis */] = ["(", ")"]; - brackets[2048 /* AngleBrackets */] = ["<", ">"]; - brackets[4096 /* SquareBrackets */] = ["[", "]"]; - return brackets; - } - function getOpeningBracket(format) { - return brackets[format & 7680 /* BracketsMask */][0]; - } - function getClosingBracket(format) { - return brackets[format & 7680 /* BracketsMask */][1]; - } } - ts.emitFiles = emitFiles; + ts.createPrinter = createPrinter; + function createDelimiterMap() { + var delimiters = []; + delimiters[0 /* None */] = ""; + delimiters[16 /* CommaDelimited */] = ","; + delimiters[4 /* BarDelimited */] = " |"; + delimiters[8 /* AmpersandDelimited */] = " &"; + return delimiters; + } + function getDelimiter(format) { + return delimiters[format & 28 /* DelimitersMask */]; + } + function createBracketsMap() { + var brackets = []; + brackets[512 /* Braces */] = ["{", "}"]; + brackets[1024 /* Parenthesis */] = ["(", ")"]; + brackets[2048 /* AngleBrackets */] = ["<", ">"]; + brackets[4096 /* SquareBrackets */] = ["[", "]"]; + return brackets; + } + function getOpeningBracket(format) { + return brackets[format & 7680 /* BracketsMask */][0]; + } + function getClosingBracket(format) { + return brackets[format & 7680 /* BracketsMask */][1]; + } + // Flags enum to track count of temp variables and a few dedicated names + var TempFlags; + (function (TempFlags) { + TempFlags[TempFlags["Auto"] = 0] = "Auto"; + TempFlags[TempFlags["CountMask"] = 268435455] = "CountMask"; + TempFlags[TempFlags["_i"] = 268435456] = "_i"; + })(TempFlags || (TempFlags = {})); var ListFormat; (function (ListFormat) { ListFormat[ListFormat["None"] = 0] = "None"; @@ -61790,6 +66449,7 @@ var ts; var ts; (function (ts) { var emptyArray = []; + var ignoreDiagnosticCommentRegEx = /(^\s*$)|(^\s*\/\/\/?\s*(@ts-ignore)?)/; function findConfigFile(searchPath, fileExists, configName) { if (configName === void 0) { configName = "tsconfig.json"; } while (true) { @@ -61824,7 +66484,8 @@ var ts; commonPathComponents = sourcePathComponents; return; } - for (var i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) { + var n = Math.min(commonPathComponents.length, sourcePathComponents.length); + for (var i = 0; i < n; i++) { if (getCanonicalFileName(commonPathComponents[i]) !== getCanonicalFileName(sourcePathComponents[i])) { if (i === 0) { // Failed to find any common path component @@ -61857,8 +66518,6 @@ var ts; // otherwise use toLowerCase as a canonical form. return ts.sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(); } - // returned by CScript sys environment - var unsupportedFileEncodingErrorCode = -2147024809; function getSourceFile(fileName, languageVersion, onError) { var text; try { @@ -61869,20 +66528,18 @@ var ts; } catch (e) { if (onError) { - onError(e.number === unsupportedFileEncodingErrorCode - ? ts.createCompilerDiagnostic(ts.Diagnostics.Unsupported_file_encoding).messageText - : e.message); + onError(e.message); } text = ""; } return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion, setParentNodes) : undefined; } function directoryExists(directoryPath) { - if (directoryPath in existingDirectories) { + if (existingDirectories.has(directoryPath)) { return true; } if (ts.sys.directoryExists(directoryPath)) { - existingDirectories[directoryPath] = true; + existingDirectories.set(directoryPath, true); return true; } return false; @@ -61901,10 +66558,11 @@ var ts; } var hash = ts.sys.createHash(data); var mtimeBefore = ts.sys.getModifiedTime(fileName); - if (mtimeBefore && fileName in outputFingerprints) { - var fingerprint = outputFingerprints[fileName]; + if (mtimeBefore) { + var fingerprint = outputFingerprints.get(fileName); // If output has not been changed, and the file has no external modification - if (fingerprint.byteOrderMark === writeByteOrderMark && + if (fingerprint && + fingerprint.byteOrderMark === writeByteOrderMark && fingerprint.hash === hash && fingerprint.mtime.getTime() === mtimeBefore.getTime()) { return; @@ -61912,11 +66570,11 @@ var ts; } ts.sys.writeFile(fileName, data, writeByteOrderMark); var mtimeAfter = ts.sys.getModifiedTime(fileName); - outputFingerprints[fileName] = { + outputFingerprints.set(fileName, { hash: hash, byteOrderMark: writeByteOrderMark, mtime: mtimeAfter - }; + }); } function writeFile(fileName, data, writeByteOrderMark, onError) { try { @@ -62015,10 +66673,14 @@ var ts; var resolutions = []; var cache = ts.createMap(); for (var _i = 0, names_1 = names; _i < names_1.length; _i++) { - var name_41 = names_1[_i]; - var result = name_41 in cache - ? cache[name_41] - : cache[name_41] = loader(name_41, containingFile); + var name = names_1[_i]; + var result = void 0; + if (cache.has(name)) { + result = cache.get(name); + } + else { + cache.set(name, result = loader(name, containingFile)); + } resolutions.push(result); } return resolutions; @@ -62030,6 +66692,8 @@ var ts; var diagnosticsProducingTypeChecker; var noDiagnosticsTypeChecker; var classifiableNames; + var cachedSemanticDiagnosticsForFile = {}; + var cachedDeclarationDiagnosticsForFile = {}; var resolvedTypeReferenceDirectives = ts.createMap(); var fileProcessingDiagnostics = ts.createDiagnosticCollection(); // The below settings are to track if a .js file should be add to the program if loaded via searching under node_modules. @@ -62054,6 +66718,7 @@ var ts; var supportedExtensions = ts.getSupportedExtensions(options); // Map storing if there is emit blocking diagnostics for given input var hasEmitBlockingDiagnostics = ts.createFileMap(getCanonicalFileName); + var moduleResolutionCache; var resolveModuleNamesWorker; if (host.resolveModuleNames) { resolveModuleNamesWorker = function (moduleNames, containingFile) { return host.resolveModuleNames(moduleNames, containingFile).map(function (resolved) { @@ -62067,7 +66732,8 @@ var ts; }); }; } else { - var loader_1 = function (moduleName, containingFile) { return ts.resolveModuleName(moduleName, containingFile, options, host).resolvedModule; }; + moduleResolutionCache = ts.createModuleResolutionCache(currentDirectory, function (x) { return host.getCanonicalFileName(x); }); + var loader_1 = function (moduleName, containingFile) { return ts.resolveModuleName(moduleName, containingFile, options, host, moduleResolutionCache).resolvedModule; }; resolveModuleNamesWorker = function (moduleNames, containingFile) { return loadWithLocalCache(moduleNames, containingFile, loader_1); }; } var resolveTypeReferenceDirectiveNamesWorker; @@ -62113,6 +66779,8 @@ var ts; } } } + // unconditionally set moduleResolutionCache to undefined to avoid unnecessary leaks + moduleResolutionCache = undefined; // unconditionally set oldProgram to undefined to prevent it from being captured in closure oldProgram = undefined; program = { @@ -62147,7 +66815,7 @@ var ts; return program; function getCommonSourceDirectory() { if (commonSourceDirectory === undefined) { - var emittedFiles = ts.filterSourceFilesInDirectory(files, isSourceFileFromExternalLibrary); + var emittedFiles = ts.filter(files, function (file) { return ts.sourceFileMayBeEmitted(file, options, isSourceFileFromExternalLibrary); }); if (options.rootDir && checkSourceFilesBelongToPath(emittedFiles, options.rootDir)) { // If a rootDir is specified and is valid use it as the commonSourceDirectory commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory); @@ -62171,7 +66839,7 @@ var ts; classifiableNames = ts.createMap(); for (var _i = 0, files_2 = files; _i < files_2.length; _i++) { var sourceFile = files_2[_i]; - ts.copyProperties(sourceFile.classifiableNames, classifiableNames); + ts.copyEntries(sourceFile.classifiableNames, classifiableNames); } } return classifiableNames; @@ -62245,7 +66913,7 @@ var ts; // combine results of resolutions and predicted results var j = 0; for (var i = 0; i < result.length; i++) { - if (result[i] == predictedToResolveToAmbientModuleMarker) { + if (result[i] === predictedToResolveToAmbientModuleMarker) { result[i] = undefined; } else { @@ -62378,7 +67046,7 @@ var ts; newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames; } // update fileName -> file mapping - for (var i = 0, len = newSourceFiles.length; i < len; i++) { + for (var i = 0; i < newSourceFiles.length; i++) { filesByName.set(filePaths[i], newSourceFiles[i]); } files = newSourceFiles; @@ -62407,7 +67075,7 @@ var ts; }; } function isSourceFileFromExternalLibrary(file) { - return sourceFilesFoundSearchingNodeModules[file.path]; + return sourceFilesFoundSearchingNodeModules.get(file.path); } function getDiagnosticsProducingTypeChecker() { return diagnosticsProducingTypeChecker || (diagnosticsProducingTypeChecker = ts.createTypeChecker(program, /*produceDiagnostics:*/ true)); @@ -62418,13 +67086,13 @@ var ts; function getTypeChecker() { return noDiagnosticsTypeChecker || (noDiagnosticsTypeChecker = ts.createTypeChecker(program, /*produceDiagnostics:*/ false)); } - function emit(sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles) { - return runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles); }); + function emit(sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers) { + return runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers); }); } function isEmitBlocked(emitFileName) { return hasEmitBlockingDiagnostics.contains(ts.toPath(emitFileName, currentDirectory, getCanonicalFileName)); } - function emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles) { + function emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, customTransformers) { var declarationDiagnostics = []; if (options.noEmit) { return { diagnostics: declarationDiagnostics, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true }; @@ -62456,7 +67124,8 @@ var ts; // checked is to not pass the file to getEmitResolver. var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile); ts.performance.mark("beforeEmit"); - var emitResult = ts.emitFiles(emitResolver, getEmitHost(writeFileCallback), sourceFile, emitOnlyDtsFiles); + var transformers = emitOnlyDtsFiles ? [] : ts.getTransformers(options, customTransformers); + var emitResult = ts.emitFiles(emitResolver, getEmitHost(writeFileCallback), sourceFile, emitOnlyDtsFiles, transformers); ts.performance.mark("afterEmit"); ts.performance.measure("Emit", "beforeEmit", "afterEmit"); return emitResult; @@ -62529,19 +67198,48 @@ var ts; } } function getSemanticDiagnosticsForFile(sourceFile, cancellationToken) { + return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedSemanticDiagnosticsForFile, getSemanticDiagnosticsForFileNoCache); + } + function getSemanticDiagnosticsForFileNoCache(sourceFile, cancellationToken) { return runWithCancellationToken(function () { var typeChecker = getDiagnosticsProducingTypeChecker(); ts.Debug.assert(!!sourceFile.bindDiagnostics); var bindDiagnostics = sourceFile.bindDiagnostics; - // For JavaScript files, we don't want to report semantic errors. - // Instead, we'll report errors for using TypeScript-only constructs from within a - // JavaScript file when we get syntactic diagnostics for the file. - var checkDiagnostics = ts.isSourceFileJavaScript(sourceFile) ? [] : typeChecker.getDiagnostics(sourceFile, cancellationToken); + // For JavaScript files, we don't want to report semantic errors unless explicitly requested. + var includeCheckDiagnostics = !ts.isSourceFileJavaScript(sourceFile) || ts.isCheckJsEnabledForFile(sourceFile, options); + var checkDiagnostics = includeCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : []; var fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName); var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName); - return bindDiagnostics.concat(checkDiagnostics, fileProcessingDiagnosticsInFile, programDiagnosticsInFile); + var diagnostics = bindDiagnostics.concat(checkDiagnostics, fileProcessingDiagnosticsInFile, programDiagnosticsInFile); + return ts.isSourceFileJavaScript(sourceFile) + ? ts.filter(diagnostics, shouldReportDiagnostic) + : diagnostics; }); } + /** + * Skip errors if previous line start with '// @ts-ignore' comment, not counting non-empty non-comment lines + */ + function shouldReportDiagnostic(diagnostic) { + var file = diagnostic.file, start = diagnostic.start; + if (file) { + var lineStarts = ts.getLineStarts(file); + var line = ts.computeLineAndCharacterOfPosition(lineStarts, start).line; + while (line > 0) { + var previousLineText = file.text.slice(lineStarts[line - 1], lineStarts[line]); + var result = ignoreDiagnosticCommentRegEx.exec(previousLineText); + if (!result) { + // non-empty line + return true; + } + if (result[3]) { + // @ts-ignore + return false; + } + line--; + } + } + return true; + } function getJavaScriptSyntacticDiagnosticsForFile(sourceFile) { return runWithCancellationToken(function () { var diagnostics = []; @@ -62552,23 +67250,23 @@ var ts; // Return directly from the case if the given node doesnt want to visit each child // Otherwise break to visit each child switch (parent.kind) { - case 144 /* Parameter */: - case 147 /* PropertyDeclaration */: + case 145 /* Parameter */: + case 148 /* PropertyDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, "?")); return; } - // Pass through - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: - case 185 /* ArrowFunction */: - case 225 /* FunctionDeclaration */: - case 223 /* VariableDeclaration */: + // falls through + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 185 /* FunctionExpression */: + case 227 /* FunctionDeclaration */: + case 186 /* ArrowFunction */: + case 227 /* FunctionDeclaration */: + case 225 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); @@ -62576,35 +67274,35 @@ var ts; } } switch (node.kind) { - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); return; - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); return; } break; - case 255 /* HeritageClause */: + case 258 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 107 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); return; } break; - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); return; - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); return; - case 228 /* TypeAliasDeclaration */: + case 230 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); return; - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); return; - case 182 /* TypeAssertionExpression */: + case 183 /* TypeAssertionExpression */: var typeAssertionExpression = node; diagnostics.push(createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); return; @@ -62619,29 +67317,29 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning)); } switch (parent.kind) { - case 226 /* ClassDeclaration */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: - case 185 /* ArrowFunction */: - case 225 /* FunctionDeclaration */: + case 228 /* ClassDeclaration */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 185 /* FunctionExpression */: + case 227 /* FunctionDeclaration */: + case 186 /* ArrowFunction */: + case 227 /* FunctionDeclaration */: // Check type parameters if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); return; } - // pass through - case 205 /* VariableStatement */: + // falls through + case 207 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - return checkModifiers(nodes, parent.kind === 205 /* VariableStatement */); + return checkModifiers(nodes, parent.kind === 207 /* VariableStatement */); } break; - case 147 /* PropertyDeclaration */: + case 148 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { @@ -62653,16 +67351,16 @@ var ts; return; } break; - case 144 /* Parameter */: + case 145 /* Parameter */: // Check modifiers of parameter declaration if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); return; } break; - case 179 /* CallExpression */: - case 180 /* NewExpression */: - case 199 /* ExpressionWithTypeArguments */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: + case 200 /* ExpressionWithTypeArguments */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); @@ -62670,8 +67368,8 @@ var ts; } break; } - for (var _b = 0, nodes_6 = nodes; _b < nodes_6.length; _b++) { - var node = nodes_6[_b]; + for (var _b = 0, nodes_8 = nodes; _b < nodes_8.length; _b++) { + var node = nodes_8[_b]; walk(node); } } @@ -62683,7 +67381,8 @@ var ts; if (isConstValid) { continue; } - // Fallthrough to report error + // to report error, + // falls through case 113 /* PublicKeyword */: case 111 /* PrivateKeyword */: case 112 /* ProtectedKeyword */: @@ -62711,12 +67410,34 @@ var ts; }); } function getDeclarationDiagnosticsWorker(sourceFile, cancellationToken) { + return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedDeclarationDiagnosticsForFile, getDeclarationDiagnosticsForFileNoCache); + } + function getDeclarationDiagnosticsForFileNoCache(sourceFile, cancellationToken) { return runWithCancellationToken(function () { var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile, cancellationToken); // Don't actually write any files since we're just getting diagnostics. return ts.getDeclarationDiagnostics(getEmitHost(ts.noop), resolver, sourceFile); }); } + function getAndCacheDiagnostics(sourceFile, cancellationToken, cache, getDiagnostics) { + var cachedResult = sourceFile + ? cache.perFile && cache.perFile.get(sourceFile.path) + : cache.allDiagnostics; + if (cachedResult) { + return cachedResult; + } + var result = getDiagnostics(sourceFile, cancellationToken) || emptyArray; + if (sourceFile) { + if (!cache.perFile) { + cache.perFile = ts.createFileMap(); + } + cache.perFile.set(sourceFile.path, result); + } + else { + cache.allDiagnostics = result; + } + return result; + } function getDeclarationDiagnosticsForFile(sourceFile, cancellationToken) { return ts.isDeclarationFile(sourceFile) ? [] : getDeclarationDiagnosticsWorker(sourceFile, cancellationToken); } @@ -62759,11 +67480,10 @@ var ts; && (options.isolatedModules || isExternalModuleFile) && !file.isDeclarationFile) { // synthesize 'import "tslib"' declaration - var externalHelpersModuleReference = ts.createSynthesizedNode(9 /* StringLiteral */); - externalHelpersModuleReference.text = ts.externalHelpersModuleNameText; - var importDecl = ts.createSynthesizedNode(235 /* ImportDeclaration */); - importDecl.parent = file; + var externalHelpersModuleReference = ts.createLiteral(ts.externalHelpersModuleNameText); + var importDecl = ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*importClause*/ undefined); externalHelpersModuleReference.parent = importDecl; + importDecl.parent = file; imports = [externalHelpersModuleReference]; } for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { @@ -62779,9 +67499,9 @@ var ts; return; function collectModuleReferences(node, inAmbientModule) { switch (node.kind) { - case 235 /* ImportDeclaration */: - case 234 /* ImportEqualsDeclaration */: - case 241 /* ExportDeclaration */: + case 237 /* ImportDeclaration */: + case 236 /* ImportEqualsDeclaration */: + case 243 /* ExportDeclaration */: var moduleNameExpr = ts.getExternalModuleName(node); if (!moduleNameExpr || moduleNameExpr.kind !== 9 /* StringLiteral */) { break; @@ -62796,7 +67516,7 @@ var ts; (imports || (imports = [])).push(moduleNameExpr); } break; - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: if (ts.isAmbientModule(node) && (inAmbientModule || ts.hasModifier(node, 2 /* Ambient */) || ts.isDeclarationFile(file))) { var moduleName = node.name; // Ambient module declarations can be interpreted as augmentations for some existing external modules. @@ -62896,18 +67616,18 @@ var ts; } // If the file was previously found via a node_modules search, but is now being processed as a root file, // then everything it sucks in may also be marked incorrectly, and needs to be checked again. - if (file_1 && sourceFilesFoundSearchingNodeModules[file_1.path] && currentNodeModulesDepth == 0) { - sourceFilesFoundSearchingNodeModules[file_1.path] = false; + if (file_1 && sourceFilesFoundSearchingNodeModules.get(file_1.path) && currentNodeModulesDepth === 0) { + sourceFilesFoundSearchingNodeModules.set(file_1.path, false); if (!options.noResolve) { processReferencedFiles(file_1, isDefaultLib); processTypeReferenceDirectives(file_1); } - modulesWithElidedImports[file_1.path] = false; + modulesWithElidedImports.set(file_1.path, false); processImportedModules(file_1); } - else if (file_1 && modulesWithElidedImports[file_1.path]) { + else if (file_1 && modulesWithElidedImports.get(file_1.path)) { if (currentNodeModulesDepth < maxNodeModuleJsDepth) { - modulesWithElidedImports[file_1.path] = false; + modulesWithElidedImports.set(file_1.path, false); processImportedModules(file_1); } } @@ -62924,7 +67644,7 @@ var ts; }); filesByName.set(path, file); if (file) { - sourceFilesFoundSearchingNodeModules[path] = (currentNodeModulesDepth > 0); + sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0); file.path = path; if (host.useCaseSensitiveFileNames()) { // for case-sensitive file systems check if we've already seen some file with similar filename ignoring case @@ -62973,7 +67693,7 @@ var ts; } function processTypeReferenceDirective(typeReferenceDirective, resolvedTypeReferenceDirective, refFile, refPos, refEnd) { // If we already found this library as a primary reference - nothing to do - var previousResolution = resolvedTypeReferenceDirectives[typeReferenceDirective]; + var previousResolution = resolvedTypeReferenceDirectives.get(typeReferenceDirective); if (previousResolution && previousResolution.primary) { return; } @@ -63007,7 +67727,7 @@ var ts; fileProcessingDiagnostics.add(createDiagnostic(refFile, refPos, refEnd, ts.Diagnostics.Cannot_find_type_definition_file_for_0, typeReferenceDirective)); } if (saveResolution) { - resolvedTypeReferenceDirectives[typeReferenceDirective] = resolvedTypeReferenceDirective; + resolvedTypeReferenceDirectives.set(typeReferenceDirective, resolvedTypeReferenceDirective); } } function createDiagnostic(refFile, refPos, refEnd, message) { @@ -63056,7 +67776,7 @@ var ts; // This may still end up being an untyped module -- the file won't be included but imports will be allowed. var shouldAddFile = resolvedFileName && !getResolutionDiagnostic(options, resolution) && !options.noResolve && i < file.imports.length && !elideImport; if (elideImport) { - modulesWithElidedImports[file.path] = true; + modulesWithElidedImports.set(file.path, true); } else if (shouldAddFile) { var path = ts.toPath(resolvedFileName, currentDirectory, getCanonicalFileName); @@ -63075,8 +67795,8 @@ var ts; } function computeCommonSourceDirectory(sourceFiles) { var fileNames = []; - for (var _i = 0, sourceFiles_6 = sourceFiles; _i < sourceFiles_6.length; _i++) { - var file = sourceFiles_6[_i]; + for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) { + var file = sourceFiles_2[_i]; if (!file.isDeclarationFile) { fileNames.push(file.fileName); } @@ -63087,8 +67807,8 @@ var ts; var allFilesBelongToPath = true; if (sourceFiles) { var absoluteRootDirectoryPath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(rootDirectory, currentDirectory)); - for (var _i = 0, sourceFiles_7 = sourceFiles; _i < sourceFiles_7.length; _i++) { - var sourceFile = sourceFiles_7[_i]; + for (var _i = 0, sourceFiles_3 = sourceFiles; _i < sourceFiles_3.length; _i++) { + var sourceFile = sourceFiles_3[_i]; if (!ts.isDeclarationFile(sourceFile)) { var absoluteSourceFilePath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { @@ -63182,7 +67902,7 @@ var ts; if (options.lib && options.noLib) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "lib", "noLib")); } - if (options.noImplicitUseStrict && options.alwaysStrict) { + if (options.noImplicitUseStrict && (options.alwaysStrict === undefined ? options.strict : options.alwaysStrict)) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "noImplicitUseStrict", "alwaysStrict")); } var languageVersion = options.target || 0 /* ES3 */; @@ -63228,6 +67948,9 @@ var ts; if (!options.noEmit && options.allowJs && options.declaration) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "allowJs", "declaration")); } + if (options.checkJs && !options.allowJs) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "checkJs", "allowJs")); + } if (options.emitDecoratorMetadata && !options.experimentalDecorators) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators")); @@ -63247,7 +67970,7 @@ var ts; if (!options.noEmit && !options.suppressOutputPathCheck) { var emitHost = getEmitHost(); var emitFilesSeen_1 = ts.createFileMap(!host.useCaseSensitiveFileNames() ? function (key) { return key.toLocaleLowerCase(); } : undefined); - ts.forEachExpectedEmitFile(emitHost, function (emitFileNames) { + ts.forEachEmittedFile(emitHost, function (emitFileNames) { verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen_1); verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen_1); }); @@ -63323,40 +68046,13 @@ var ts; ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean" }; /* @internal */ ts.optionDeclarations = [ - { - name: "charset", - type: "string", - }, - ts.compileOnSaveCommandLineOption, - { - name: "declaration", - shortName: "d", - type: "boolean", - description: ts.Diagnostics.Generates_corresponding_d_ts_file, - }, - { - name: "declarationDir", - type: "string", - isFilePath: true, - paramType: ts.Diagnostics.DIRECTORY, - }, - { - name: "diagnostics", - type: "boolean", - }, - { - name: "extendedDiagnostics", - type: "boolean", - experimental: true - }, - { - name: "emitBOM", - type: "boolean" - }, + // CommandLine only options { name: "help", shortName: "h", type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, description: ts.Diagnostics.Print_this_message, }, { @@ -63364,220 +68060,58 @@ var ts; shortName: "?", type: "boolean" }, + { + name: "all", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Show_all_compiler_options, + }, + { + name: "version", + shortName: "v", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Print_the_compiler_s_version, + }, { name: "init", type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, description: ts.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file, }, - { - name: "inlineSourceMap", - type: "boolean", - }, - { - name: "inlineSources", - type: "boolean", - }, - { - name: "jsx", - type: ts.createMap({ - "preserve": 1 /* Preserve */, - "react": 2 /* React */ - }), - paramType: ts.Diagnostics.KIND, - description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_or_react, - }, - { - name: "reactNamespace", - type: "string", - description: ts.Diagnostics.Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit - }, - { - name: "jsxFactory", - type: "string", - description: ts.Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h - }, - { - name: "listFiles", - type: "boolean", - }, - { - name: "locale", - type: "string", - }, - { - name: "mapRoot", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, - paramType: ts.Diagnostics.LOCATION, - }, - { - name: "module", - shortName: "m", - type: ts.createMap({ - "none": ts.ModuleKind.None, - "commonjs": ts.ModuleKind.CommonJS, - "amd": ts.ModuleKind.AMD, - "system": ts.ModuleKind.System, - "umd": ts.ModuleKind.UMD, - "es6": ts.ModuleKind.ES2015, - "es2015": ts.ModuleKind.ES2015, - }), - description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015, - paramType: ts.Diagnostics.KIND, - }, - { - name: "newLine", - type: ts.createMap({ - "crlf": 0 /* CarriageReturnLineFeed */, - "lf": 1 /* LineFeed */ - }), - description: ts.Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, - paramType: ts.Diagnostics.NEWLINE, - }, - { - name: "noEmit", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_outputs, - }, - { - name: "noEmitHelpers", - type: "boolean" - }, - { - name: "noEmitOnError", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported, - }, - { - name: "noErrorTruncation", - type: "boolean" - }, - { - name: "noImplicitAny", - type: "boolean", - description: ts.Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type, - }, - { - name: "noImplicitThis", - type: "boolean", - description: ts.Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type, - }, - { - name: "noUnusedLocals", - type: "boolean", - description: ts.Diagnostics.Report_errors_on_unused_locals, - }, - { - name: "noUnusedParameters", - type: "boolean", - description: ts.Diagnostics.Report_errors_on_unused_parameters, - }, - { - name: "noLib", - type: "boolean", - }, - { - name: "noResolve", - type: "boolean", - }, - { - name: "skipDefaultLibCheck", - type: "boolean", - }, - { - name: "skipLibCheck", - type: "boolean", - description: ts.Diagnostics.Skip_type_checking_of_declaration_files, - }, - { - name: "out", - type: "string", - isFilePath: false, - // for correct behaviour, please use outFile - paramType: ts.Diagnostics.FILE, - }, - { - name: "outFile", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Concatenate_and_emit_output_to_single_file, - paramType: ts.Diagnostics.FILE, - }, - { - name: "outDir", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Redirect_output_structure_to_the_directory, - paramType: ts.Diagnostics.DIRECTORY, - }, - { - name: "preserveConstEnums", - type: "boolean", - description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code - }, - { - name: "pretty", - description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental, - type: "boolean" - }, { name: "project", shortName: "p", type: "string", isFilePath: true, - description: ts.Diagnostics.Compile_the_project_in_the_given_directory, - paramType: ts.Diagnostics.DIRECTORY + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + paramType: ts.Diagnostics.FILE_OR_DIRECTORY, + description: ts.Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json, }, { - name: "removeComments", + name: "pretty", type: "boolean", - description: ts.Diagnostics.Do_not_emit_comments_to_output, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental }, { - name: "rootDir", - type: "string", - isFilePath: true, - paramType: ts.Diagnostics.LOCATION, - description: ts.Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, - }, - { - name: "isolatedModules", + name: "watch", + shortName: "w", type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Watch_input_files, }, - { - name: "sourceMap", - type: "boolean", - description: ts.Diagnostics.Generates_corresponding_map_file, - }, - { - name: "sourceRoot", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, - paramType: ts.Diagnostics.LOCATION, - }, - { - name: "suppressExcessPropertyErrors", - type: "boolean", - description: ts.Diagnostics.Suppress_excess_property_checks_for_object_literals, - experimental: true - }, - { - name: "suppressImplicitAnyIndexErrors", - type: "boolean", - description: ts.Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures, - }, - { - name: "stripInternal", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, - experimental: true - }, + // Basic { name: "target", shortName: "t", - type: ts.createMap({ + type: ts.createMapFromTemplate({ "es3": 0 /* ES3 */, "es5": 1 /* ES5 */, "es6": 2 /* ES2015 */, @@ -63586,144 +68120,34 @@ var ts; "es2017": 4 /* ES2017 */, "esnext": 5 /* ESNext */, }), - description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015, paramType: ts.Diagnostics.VERSION, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT, }, { - name: "version", - shortName: "v", - type: "boolean", - description: ts.Diagnostics.Print_the_compiler_s_version, - }, - { - name: "watch", - shortName: "w", - type: "boolean", - description: ts.Diagnostics.Watch_input_files, - }, - { - name: "experimentalDecorators", - type: "boolean", - description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators - }, - { - name: "emitDecoratorMetadata", - type: "boolean", - experimental: true, - description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators - }, - { - name: "moduleResolution", - type: ts.createMap({ - "node": ts.ModuleResolutionKind.NodeJs, - "classic": ts.ModuleResolutionKind.Classic, + name: "module", + shortName: "m", + type: ts.createMapFromTemplate({ + "none": ts.ModuleKind.None, + "commonjs": ts.ModuleKind.CommonJS, + "amd": ts.ModuleKind.AMD, + "system": ts.ModuleKind.System, + "umd": ts.ModuleKind.UMD, + "es6": ts.ModuleKind.ES2015, + "es2015": ts.ModuleKind.ES2015, }), - description: ts.Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6, - paramType: ts.Diagnostics.STRATEGY, - }, - { - name: "allowUnusedLabels", - type: "boolean", - description: ts.Diagnostics.Do_not_report_errors_on_unused_labels - }, - { - name: "noImplicitReturns", - type: "boolean", - description: ts.Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value - }, - { - name: "noFallthroughCasesInSwitch", - type: "boolean", - description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement - }, - { - name: "allowUnreachableCode", - type: "boolean", - description: ts.Diagnostics.Do_not_report_errors_on_unreachable_code - }, - { - name: "forceConsistentCasingInFileNames", - type: "boolean", - description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file - }, - { - name: "baseUrl", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Base_directory_to_resolve_non_absolute_module_names - }, - { - // this option can only be specified in tsconfig.json - // use type = object to copy the value as-is - name: "paths", - type: "object", - isTSConfigOnly: true - }, - { - // this option can only be specified in tsconfig.json - // use type = object to copy the value as-is - name: "rootDirs", - type: "list", - isTSConfigOnly: true, - element: { - name: "rootDirs", - type: "string", - isFilePath: true - } - }, - { - name: "typeRoots", - type: "list", - element: { - name: "typeRoots", - type: "string", - isFilePath: true - } - }, - { - name: "types", - type: "list", - element: { - name: "types", - type: "string" - }, - description: ts.Diagnostics.Type_declaration_files_to_be_included_in_compilation - }, - { - name: "traceResolution", - type: "boolean", - description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process - }, - { - name: "allowJs", - type: "boolean", - description: ts.Diagnostics.Allow_javascript_files_to_be_compiled - }, - { - name: "allowSyntheticDefaultImports", - type: "boolean", - description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking - }, - { - name: "noImplicitUseStrict", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_use_strict_directives_in_module_output - }, - { - name: "maxNodeModuleJsDepth", - type: "number", - description: ts.Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files - }, - { - name: "listEmittedFiles", - type: "boolean" + paramType: ts.Diagnostics.KIND, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015, }, { name: "lib", type: "list", element: { name: "lib", - type: ts.createMap({ + type: ts.createMapFromTemplate({ // JavaScript only "es5": "lib.es5.d.ts", "es6": "lib.es2015.d.ts", @@ -63731,6 +68155,7 @@ var ts; "es7": "lib.es2016.d.ts", "es2016": "lib.es2016.d.ts", "es2017": "lib.es2017.d.ts", + "esnext": "lib.esnext.d.ts", // Host only "dom": "lib.dom.d.ts", "dom.iterable": "lib.dom.iterable.d.ts", @@ -63750,28 +68175,487 @@ var ts; "es2017.object": "lib.es2017.object.d.ts", "es2017.sharedmemory": "lib.es2017.sharedmemory.d.ts", "es2017.string": "lib.es2017.string.d.ts", + "esnext.asynciterable": "lib.esnext.asynciterable.d.ts", }), }, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon }, { - name: "disableSizeLimit", - type: "boolean" + name: "allowJs", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Allow_javascript_files_to_be_compiled }, { - name: "strictNullChecks", + name: "checkJs", type: "boolean", - description: ts.Diagnostics.Enable_strict_null_checks + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Report_errors_in_js_files + }, + { + name: "jsx", + type: ts.createMapFromTemplate({ + "preserve": 1 /* Preserve */, + "react-native": 3 /* ReactNative */, + "react": 2 /* React */ + }), + paramType: ts.Diagnostics.KIND, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_react_native_or_react, + }, + { + name: "declaration", + shortName: "d", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Generates_corresponding_d_ts_file, + }, + { + name: "sourceMap", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Generates_corresponding_map_file, + }, + { + name: "outFile", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.FILE, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Concatenate_and_emit_output_to_single_file, + }, + { + name: "outDir", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.DIRECTORY, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Redirect_output_structure_to_the_directory, + }, + { + name: "rootDir", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.LOCATION, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, + }, + { + name: "removeComments", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Do_not_emit_comments_to_output, + }, + { + name: "noEmit", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Do_not_emit_outputs, }, { name: "importHelpers", type: "boolean", + category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Import_emit_helpers_from_tslib }, + { + name: "downlevelIteration", + type: "boolean", + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3 + }, + { + name: "isolatedModules", + type: "boolean", + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule + }, + // Strict Type Checks + { + name: "strict", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Enable_all_strict_type_checking_options + }, + { + name: "noImplicitAny", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type, + }, + { + name: "strictNullChecks", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Enable_strict_null_checks + }, + { + name: "noImplicitThis", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type, + }, { name: "alwaysStrict", type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, description: ts.Diagnostics.Parse_in_strict_mode_and_emit_use_strict_for_each_source_file + }, + // Additional Checks + { + name: "noUnusedLocals", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_errors_on_unused_locals, + }, + { + name: "noUnusedParameters", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_errors_on_unused_parameters, + }, + { + name: "noImplicitReturns", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value + }, + { + name: "noFallthroughCasesInSwitch", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement + }, + // Module Resolution + { + name: "moduleResolution", + type: ts.createMapFromTemplate({ + "node": ts.ModuleResolutionKind.NodeJs, + "classic": ts.ModuleResolutionKind.Classic, + }), + paramType: ts.Diagnostics.STRATEGY, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6, + }, + { + name: "baseUrl", + type: "string", + isFilePath: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Base_directory_to_resolve_non_absolute_module_names + }, + { + // this option can only be specified in tsconfig.json + // use type = object to copy the value as-is + name: "paths", + type: "object", + isTSConfigOnly: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl + }, + { + // this option can only be specified in tsconfig.json + // use type = object to copy the value as-is + name: "rootDirs", + type: "list", + isTSConfigOnly: true, + element: { + name: "rootDirs", + type: "string", + isFilePath: true + }, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime + }, + { + name: "typeRoots", + type: "list", + element: { + name: "typeRoots", + type: "string", + isFilePath: true + }, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.List_of_folders_to_include_type_definitions_from + }, + { + name: "types", + type: "list", + element: { + name: "types", + type: "string" + }, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Type_declaration_files_to_be_included_in_compilation + }, + { + name: "allowSyntheticDefaultImports", + type: "boolean", + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking + }, + // Source Maps + { + name: "sourceRoot", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.LOCATION, + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, + }, + { + name: "mapRoot", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.LOCATION, + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, + }, + { + name: "inlineSourceMap", + type: "boolean", + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file + }, + { + name: "inlineSources", + type: "boolean", + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set + }, + // Experimental + { + name: "experimentalDecorators", + type: "boolean", + category: ts.Diagnostics.Experimental_Options, + description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators + }, + { + name: "emitDecoratorMetadata", + type: "boolean", + category: ts.Diagnostics.Experimental_Options, + description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators + }, + // Advanced + { + name: "jsxFactory", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h + }, + { + name: "diagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_diagnostic_information + }, + { + name: "extendedDiagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_verbose_diagnostic_information + }, + { + name: "traceResolution", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process + }, + { + name: "listFiles", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Print_names_of_files_part_of_the_compilation + }, + { + name: "listEmittedFiles", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Print_names_of_generated_files_part_of_the_compilation + }, + { + name: "out", + type: "string", + isFilePath: false, + // for correct behaviour, please use outFile + category: ts.Diagnostics.Advanced_Options, + paramType: ts.Diagnostics.FILE, + description: ts.Diagnostics.Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file, + }, + { + name: "reactNamespace", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit + }, + { + name: "skipDefaultLibCheck", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files + }, + { + name: "charset", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.The_character_set_of_the_input_files + }, + { + name: "emitBOM", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files + }, + { + name: "locale", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.The_locale_used_when_displaying_messages_to_the_user_e_g_en_us + }, + { + name: "newLine", + type: ts.createMapFromTemplate({ + "crlf": 0 /* CarriageReturnLineFeed */, + "lf": 1 /* LineFeed */ + }), + paramType: ts.Diagnostics.NEWLINE, + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, + }, + { + name: "noErrorTruncation", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_truncate_error_messages + }, + { + name: "noLib", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_include_the_default_library_file_lib_d_ts + }, + { + name: "noResolve", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files + }, + { + name: "stripInternal", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, + }, + { + name: "disableSizeLimit", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Disable_size_limitations_on_JavaScript_projects + }, + { + name: "noImplicitUseStrict", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_emit_use_strict_directives_in_module_output + }, + { + name: "noEmitHelpers", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_generate_custom_helper_functions_like_extends_in_compiled_output + }, + { + name: "noEmitOnError", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported, + }, + { + name: "preserveConstEnums", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code + }, + { + name: "declarationDir", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.DIRECTORY, + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Output_directory_for_generated_declaration_files + }, + { + name: "skipLibCheck", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Skip_type_checking_of_declaration_files, + }, + { + name: "allowUnusedLabels", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_report_errors_on_unused_labels + }, + { + name: "allowUnreachableCode", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_report_errors_on_unreachable_code + }, + { + name: "suppressExcessPropertyErrors", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Suppress_excess_property_checks_for_object_literals, + }, + { + name: "suppressImplicitAnyIndexErrors", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures, + }, + { + name: "forceConsistentCasingInFileNames", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file + }, + { + name: "maxNodeModuleJsDepth", + type: "number", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files + }, + { + // A list of plugins to load in the language service + name: "plugins", + type: "list", + isTSConfigOnly: true, + element: { + name: "plugin", + type: "object" + }, + description: ts.Diagnostics.List_of_language_service_plugins } ]; /* @internal */ @@ -63808,8 +68692,7 @@ var ts; ts.defaultInitCompilerOptions = { module: ts.ModuleKind.CommonJS, target: 1 /* ES5 */, - noImplicitAny: false, - sourceMap: false, + strict: true }; var optionNameMapCache; /* @internal */ @@ -63834,9 +68717,9 @@ var ts; var optionNameMap = ts.createMap(); var shortOptionNames = ts.createMap(); ts.forEach(ts.optionDeclarations, function (option) { - optionNameMap[option.name.toLowerCase()] = option; + optionNameMap.set(option.name.toLowerCase(), option); if (option.shortName) { - shortOptionNames[option.shortName] = option.name; + shortOptionNames.set(option.shortName, option.name); } }); optionNameMapCache = { optionNameMap: optionNameMap, shortOptionNames: shortOptionNames }; @@ -63845,20 +68728,13 @@ var ts; ts.getOptionNameMap = getOptionNameMap; /* @internal */ function createCompilerDiagnosticForInvalidCustomType(opt) { - var namesOfType = Object.keys(opt.type).map(function (key) { return "'" + key + "'"; }).join(", "); + var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'" + key + "'"; }).join(", "); return ts.createCompilerDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType); } ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType; /* @internal */ function parseCustomTypeOption(opt, value, errors) { - var key = trimString((value || "")).toLowerCase(); - var map = opt.type; - if (key in map) { - return map[key]; - } - else { - errors.push(createCompilerDiagnosticForInvalidCustomType(opt)); - } + return convertJsonOptionOfCustomType(opt, trimString(value || ""), errors); } ts.parseCustomTypeOption = parseCustomTypeOption; /* @internal */ @@ -63882,7 +68758,6 @@ var ts; } } ts.parseListTypeOption = parseListTypeOption; - /* @internal */ function parseCommandLine(commandLine, readFile) { var options = {}; var fileNames = []; @@ -63905,11 +68780,12 @@ var ts; else if (s.charCodeAt(0) === 45 /* minus */) { s = s.slice(s.charCodeAt(1) === 45 /* minus */ ? 2 : 1).toLowerCase(); // Try to translate short option names to their full equivalents. - if (s in shortOptionNames) { - s = shortOptionNames[s]; + var short = shortOptionNames.get(s); + if (short !== undefined) { + s = short; } - if (s in optionNameMap) { - var opt = optionNameMap[s]; + var opt = optionNameMap.get(s); + if (opt) { if (opt.isTSConfigOnly) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file, opt.name)); } @@ -63997,9 +68873,9 @@ var ts; } ts.parseCommandLine = parseCommandLine; /** - * Read tsconfig.json file - * @param fileName The path to the config file - */ + * Read tsconfig.json file + * @param fileName The path to the config file + */ function readConfigFile(fileName, readFile) { var text = ""; try { @@ -64012,10 +68888,10 @@ var ts; } ts.readConfigFile = readConfigFile; /** - * Parse the text of the tsconfig.json file - * @param fileName The path to the config file - * @param jsonText The text of the config file - */ + * Parse the text of the tsconfig.json file + * @param fileName The path to the config file + * @param jsonText The text of the config file + */ function parseConfigFileTextToJson(fileName, jsonText, stripComments) { if (stripComments === void 0) { stripComments = true; } try { @@ -64033,7 +68909,7 @@ var ts; * @param fileNames array of filenames to be generated into tsconfig.json */ /* @internal */ - function generateTSConfig(options, fileNames) { + function generateTSConfig(options, fileNames, newLine) { var compilerOptions = ts.extend(options, ts.defaultInitCompilerOptions); var configurations = { compilerOptions: serializeCompilerOptions(compilerOptions) @@ -64042,7 +68918,7 @@ var ts; // only set the files property if we have at least one file configurations.files = fileNames; } - return configurations; + return writeConfigurations(); function getCustomTypeMapOfCommandLineOption(optionDefinition) { if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean") { // this is of a type CommandLineOptionOfPrimitiveType @@ -64057,58 +68933,130 @@ var ts; } function getNameOfCompilerOptionValue(value, customTypeMap) { // There is a typeMap associated with this command-line option so use it to map value back to its name - for (var key in customTypeMap) { - if (customTypeMap[key] === value) { + return ts.forEachEntry(customTypeMap, function (mapValue, key) { + if (mapValue === value) { return key; } - } - return undefined; + }); } function serializeCompilerOptions(options) { - var result = ts.createMap(); + var result = {}; var optionsNameMap = getOptionNameMap().optionNameMap; - for (var name_42 in options) { - if (ts.hasProperty(options, name_42)) { + for (var name in options) { + if (ts.hasProperty(options, name)) { // tsconfig only options cannot be specified via command line, // so we can assume that only types that can appear here string | number | boolean - switch (name_42) { - case "init": - case "watch": - case "version": - case "help": - case "project": - break; - default: - var value = options[name_42]; - var optionDefinition = optionsNameMap[name_42.toLowerCase()]; - if (optionDefinition) { - var customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition); - if (!customTypeMap) { - // There is no map associated with this compiler option then use the value as-is - // This is the case if the value is expect to be string, number, boolean or list of string - result[name_42] = value; - } - else { - if (optionDefinition.type === "list") { - var convertedValue = []; - for (var _i = 0, _a = value; _i < _a.length; _i++) { - var element = _a[_i]; - convertedValue.push(getNameOfCompilerOptionValue(element, customTypeMap)); - } - result[name_42] = convertedValue; - } - else { - // There is a typeMap associated with this command-line option so use it to map value back to its name - result[name_42] = getNameOfCompilerOptionValue(value, customTypeMap); - } + if (optionsNameMap.has(name) && optionsNameMap.get(name).category === ts.Diagnostics.Command_line_Options) { + continue; + } + var value = options[name]; + var optionDefinition = optionsNameMap.get(name.toLowerCase()); + if (optionDefinition) { + var customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition); + if (!customTypeMap) { + // There is no map associated with this compiler option then use the value as-is + // This is the case if the value is expect to be string, number, boolean or list of string + result[name] = value; + } + else { + if (optionDefinition.type === "list") { + var convertedValue = []; + for (var _i = 0, _a = value; _i < _a.length; _i++) { + var element = _a[_i]; + convertedValue.push(getNameOfCompilerOptionValue(element, customTypeMap)); } + result[name] = convertedValue; } - break; + else { + // There is a typeMap associated with this command-line option so use it to map value back to its name + result[name] = getNameOfCompilerOptionValue(value, customTypeMap); + } + } } } } return result; } + function getDefaultValueForOption(option) { + switch (option.type) { + case "number": + return 1; + case "boolean": + return true; + case "string": + return option.isFilePath ? "./" : ""; + case "list": + return []; + case "object": + return {}; + default: + return ts.arrayFrom(option.type.keys())[0]; + } + } + function makePadding(paddingLength) { + return Array(paddingLength + 1).join(" "); + } + function writeConfigurations() { + // Filter applicable options to place in the file + var categorizedOptions = ts.reduceLeft(ts.filter(ts.optionDeclarations, function (o) { return o.category !== ts.Diagnostics.Command_line_Options && o.category !== ts.Diagnostics.Advanced_Options; }), function (memo, value) { + if (value.category) { + var name = ts.getLocaleSpecificMessage(value.category); + (memo[name] || (memo[name] = [])).push(value); + } + return memo; + }, {}); + // Serialize all options and thier descriptions + var marginLength = 0; + var seenKnownKeys = 0; + var nameColumn = []; + var descriptionColumn = []; + var knownKeysCount = ts.getOwnKeys(configurations.compilerOptions).length; + for (var category in categorizedOptions) { + if (nameColumn.length !== 0) { + nameColumn.push(""); + descriptionColumn.push(""); + } + nameColumn.push("/* " + category + " */"); + descriptionColumn.push(""); + for (var _i = 0, _a = categorizedOptions[category]; _i < _a.length; _i++) { + var option = _a[_i]; + var optionName = void 0; + if (ts.hasProperty(configurations.compilerOptions, option.name)) { + optionName = "\"" + option.name + "\": " + JSON.stringify(configurations.compilerOptions[option.name]) + ((seenKnownKeys += 1) === knownKeysCount ? "" : ","); + } + else { + optionName = "// \"" + option.name + "\": " + JSON.stringify(getDefaultValueForOption(option)) + ","; + } + nameColumn.push(optionName); + descriptionColumn.push("/* " + (option.description && ts.getLocaleSpecificMessage(option.description) || option.name) + " */"); + marginLength = Math.max(optionName.length, marginLength); + } + } + // Write the output + var tab = makePadding(2); + var result = []; + result.push("{"); + result.push(tab + "\"compilerOptions\": {"); + // Print out each row, aligning all the descriptions on the same column. + for (var i = 0; i < nameColumn.length; i++) { + var optionName = nameColumn[i]; + var description = descriptionColumn[i]; + result.push(tab + tab + optionName + makePadding(marginLength - optionName.length + 2) + description); + } + if (configurations.files && configurations.files.length) { + result.push(tab + "},"); + result.push(tab + "\"files\": ["); + for (var i = 0; i < configurations.files.length; i++) { + result.push("" + tab + tab + JSON.stringify(configurations.files[i]) + (i === configurations.files.length - 1 ? "" : ",")); + } + result.push(tab + "]"); + } + else { + result.push(tab + "}"); + } + result.push("}"); + return result.join(newLine); + } } ts.generateTSConfig = generateTSConfig; /** @@ -64136,16 +69084,18 @@ var ts; return output; } /** - * Parse the contents of a config file (tsconfig.json). - * @param json The contents of the config file to parse - * @param host Instance of ParseConfigHost used to enumerate files in folder. - * @param basePath A root directory to resolve relative path entries in the config - * file to. e.g. outDir - */ - function parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack) { + * Parse the contents of a config file (tsconfig.json). + * @param json The contents of the config file to parse + * @param host Instance of ParseConfigHost used to enumerate files in folder. + * @param basePath A root directory to resolve relative path entries in the config + * file to. e.g. outDir + */ + function parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions) { if (existingOptions === void 0) { existingOptions = {}; } if (resolutionStack === void 0) { resolutionStack = []; } + if (extraFileExtensions === void 0) { extraFileExtensions = []; } var errors = []; + basePath = ts.normalizeSlashes(basePath); var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames); var resolvedPath = ts.toPath(configFileName || "", basePath, getCanonicalFileName); if (resolutionStack.indexOf(resolvedPath) >= 0) { @@ -64272,7 +69222,7 @@ var ts; if (fileNames === undefined && includeSpecs === undefined) { includeSpecs = ["**/*"]; } - var result = matchFileNames(fileNames, includeSpecs, excludeSpecs, basePath, options, host, errors); + var result = matchFileNames(fileNames, includeSpecs, excludeSpecs, basePath, options, host, errors, extraFileExtensions); if (result.fileNames.length === 0 && !ts.hasProperty(json, "files") && resolutionStack.length === 0) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, configFileName || "tsconfig.json", JSON.stringify(includeSpecs || []), JSON.stringify(excludeSpecs || []))); } @@ -64323,8 +69273,8 @@ var ts; } var optionNameMap = ts.arrayToMap(optionDeclarations, function (opt) { return opt.name; }); for (var id in jsonOptions) { - if (id in optionNameMap) { - var opt = optionNameMap[id]; + var opt = optionNameMap.get(id); + if (opt) { defaultOptions[opt.name] = convertJsonOption(opt, jsonOptions[id], basePath, errors); } else { @@ -64358,8 +69308,9 @@ var ts; } function convertJsonOptionOfCustomType(opt, value, errors) { var key = value.toLowerCase(); - if (key in opt.type) { - return opt.type[key]; + var val = opt.type.get(key); + if (val !== undefined) { + return val; } else { errors.push(createCompilerDiagnosticForInvalidCustomType(opt)); @@ -64449,7 +69400,7 @@ var ts; * @param host The host used to resolve files and directories. * @param errors An array for diagnostic reporting. */ - function matchFileNames(fileNames, include, exclude, basePath, options, host, errors) { + function matchFileNames(fileNames, include, exclude, basePath, options, host, errors, extraFileExtensions) { basePath = ts.normalizePath(basePath); // The exclude spec list is converted into a regular expression, which allows us to quickly // test whether a file or directory should be excluded before recursively traversing the @@ -64476,14 +69427,14 @@ var ts; var wildcardDirectories = getWildcardDirectories(include, exclude, basePath, host.useCaseSensitiveFileNames); // Rather than requery this for each file and filespec, we query the supported extensions // once and store it on the expansion context. - var supportedExtensions = ts.getSupportedExtensions(options); + var supportedExtensions = ts.getSupportedExtensions(options, extraFileExtensions); // Literal files are always included verbatim. An "include" or "exclude" specification cannot // remove a literal file. if (fileNames) { for (var _i = 0, fileNames_1 = fileNames; _i < fileNames_1.length; _i++) { var fileName = fileNames_1[_i]; var file = ts.combinePaths(basePath, fileName); - literalFileMap[keyMapper(file)] = file; + literalFileMap.set(keyMapper(file), file); } } if (include && include.length > 0) { @@ -64504,14 +69455,13 @@ var ts; // same directory, we should remove it. removeWildcardFilesWithLowerPriorityExtension(file, wildcardFileMap, supportedExtensions, keyMapper); var key = keyMapper(file); - if (!(key in literalFileMap) && !(key in wildcardFileMap)) { - wildcardFileMap[key] = file; + if (!literalFileMap.has(key) && !wildcardFileMap.has(key)) { + wildcardFileMap.set(key, file); } } } - var literalFiles = ts.reduceProperties(literalFileMap, addFileToOutput, []); - var wildcardFiles = ts.reduceProperties(wildcardFileMap, addFileToOutput, []); - wildcardFiles.sort(host.useCaseSensitiveFileNames ? ts.compareStrings : ts.compareStringsCaseInsensitive); + var literalFiles = ts.arrayFrom(literalFileMap.values()); + var wildcardFiles = ts.arrayFrom(wildcardFileMap.values()); return { fileNames: literalFiles.concat(wildcardFiles), wildcardDirectories: wildcardDirectories @@ -64519,8 +69469,8 @@ var ts; } function validateSpecs(specs, errors, allowTrailingRecursion) { var validSpecs = []; - for (var _i = 0, specs_2 = specs; _i < specs_2.length; _i++) { - var spec = specs_2[_i]; + for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) { + var spec = specs_1[_i]; if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); } @@ -64554,7 +69504,7 @@ var ts; // /a/b/a?z - Watch /a/b directly to catch any new file matching a?z var rawExcludeRegex = ts.getRegularExpressionForWildcard(exclude, path, "exclude"); var excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames ? "" : "i"); - var wildcardDirectories = ts.createMap(); + var wildcardDirectories = {}; if (include !== undefined) { var recursiveKeys = []; for (var _i = 0, include_1 = include; _i < include_1.length; _i++) { @@ -64576,14 +69526,15 @@ var ts; } } // Remove any subpaths under an existing recursively watched directory. - for (var key in wildcardDirectories) { - for (var _a = 0, recursiveKeys_1 = recursiveKeys; _a < recursiveKeys_1.length; _a++) { - var recursiveKey = recursiveKeys_1[_a]; - if (key !== recursiveKey && ts.containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) { - delete wildcardDirectories[key]; + for (var key in wildcardDirectories) + if (ts.hasProperty(wildcardDirectories, key)) { + for (var _a = 0, recursiveKeys_1 = recursiveKeys; _a < recursiveKeys_1.length; _a++) { + var recursiveKey = recursiveKeys_1[_a]; + if (key !== recursiveKey && ts.containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) { + delete wildcardDirectories[key]; + } } } - } } return wildcardDirectories; } @@ -64610,11 +69561,11 @@ var ts; */ function hasFileWithHigherPriorityExtension(file, literalFiles, wildcardFiles, extensions, keyMapper) { var extensionPriority = ts.getExtensionPriority(file, extensions); - var adjustedExtensionPriority = ts.adjustExtensionPriority(extensionPriority); + var adjustedExtensionPriority = ts.adjustExtensionPriority(extensionPriority, extensions); for (var i = 0 /* Highest */; i < adjustedExtensionPriority; i++) { var higherPriorityExtension = extensions[i]; var higherPriorityPath = keyMapper(ts.changeExtension(file, higherPriorityExtension)); - if (higherPriorityPath in literalFiles || higherPriorityPath in wildcardFiles) { + if (literalFiles.has(higherPriorityPath) || wildcardFiles.has(higherPriorityPath)) { return true; } } @@ -64630,23 +69581,13 @@ var ts; */ function removeWildcardFilesWithLowerPriorityExtension(file, wildcardFiles, extensions, keyMapper) { var extensionPriority = ts.getExtensionPriority(file, extensions); - var nextExtensionPriority = ts.getNextLowestExtensionPriority(extensionPriority); + var nextExtensionPriority = ts.getNextLowestExtensionPriority(extensionPriority, extensions); for (var i = nextExtensionPriority; i < extensions.length; i++) { var lowerPriorityExtension = extensions[i]; var lowerPriorityPath = keyMapper(ts.changeExtension(file, lowerPriorityExtension)); - delete wildcardFiles[lowerPriorityPath]; + wildcardFiles.delete(lowerPriorityPath); } } - /** - * Adds a file to an array of files. - * - * @param output The output array. - * @param file The file path. - */ - function addFileToOutput(output, file) { - output.push(file); - return output; - } /** * Gets a case sensitive key. * @@ -64673,7 +69614,9 @@ var ts; this.text = text; } StringScriptSnapshot.prototype.getText = function (start, end) { - return this.text.substring(start, end); + return start === 0 && end === this.text.length + ? this.text + : this.text.substring(start, end); }; StringScriptSnapshot.prototype.getLength = function () { return this.text.length; @@ -64783,8 +69726,7 @@ var ts; ScriptElementKind.typeElement = "type"; /** enum E */ ScriptElementKind.enumElement = "enum"; - // TODO: GH#9983 - ScriptElementKind.enumMemberElement = "const"; + ScriptElementKind.enumMemberElement = "enum member"; /** * Inside module and script only * const v = .. @@ -64827,6 +69769,10 @@ var ts; ScriptElementKind.letElement = "let"; ScriptElementKind.directory = "directory"; ScriptElementKind.externalModuleName = "external module name"; + /** + * + */ + ScriptElementKind.jsxAttribute = "JSX attribute"; })(ScriptElementKind = ts.ScriptElementKind || (ts.ScriptElementKind = {})); var ScriptElementKindModifier; (function (ScriptElementKindModifier) { @@ -64912,33 +69858,34 @@ var ts; })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 144 /* Parameter */: - case 223 /* VariableDeclaration */: - case 174 /* BindingElement */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 257 /* PropertyAssignment */: - case 258 /* ShorthandPropertyAssignment */: - case 260 /* EnumMember */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 256 /* CatchClause */: + case 145 /* Parameter */: + case 225 /* VariableDeclaration */: + case 175 /* BindingElement */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 260 /* PropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: + case 263 /* EnumMember */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 259 /* CatchClause */: + case 252 /* JsxAttribute */: return 1 /* Value */; - case 143 /* TypeParameter */: - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 161 /* TypeLiteral */: + case 144 /* TypeParameter */: + case 229 /* InterfaceDeclaration */: + case 230 /* TypeAliasDeclaration */: + case 162 /* TypeLiteral */: return 2 /* Type */; - case 226 /* ClassDeclaration */: - case 229 /* EnumDeclaration */: + case 228 /* ClassDeclaration */: + case 231 /* EnumDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: if (ts.isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } @@ -64948,22 +69895,25 @@ var ts; else { return 4 /* Namespace */; } - case 238 /* NamedImports */: - case 239 /* ImportSpecifier */: - case 234 /* ImportEqualsDeclaration */: - case 235 /* ImportDeclaration */: - case 240 /* ExportAssignment */: - case 241 /* ExportDeclaration */: + case 240 /* NamedImports */: + case 241 /* ImportSpecifier */: + case 236 /* ImportEqualsDeclaration */: + case 237 /* ImportDeclaration */: + case 242 /* ExportAssignment */: + case 243 /* ExportDeclaration */: return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; // An external module can be a Value - case 261 /* SourceFile */: + case 264 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { - if (node.parent.kind === 240 /* ExportAssignment */) { + if (node.kind === 264 /* SourceFile */) { + return 1 /* Value */; + } + else if (node.parent.kind === 242 /* ExportAssignment */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } else if (isInRightSideOfImport(node)) { @@ -64988,15 +69938,15 @@ var ts; // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - if (node.parent.kind === 141 /* QualifiedName */ && + if (node.parent.kind === 142 /* QualifiedName */ && node.parent.right === node && - node.parent.parent.kind === 234 /* ImportEqualsDeclaration */) { + node.parent.parent.kind === 236 /* ImportEqualsDeclaration */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } return 4 /* Namespace */; } function isInRightSideOfImport(node) { - while (node.parent.kind === 141 /* QualifiedName */) { + while (node.parent.kind === 142 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -65007,27 +69957,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 141 /* QualifiedName */) { - while (root.parent && root.parent.kind === 141 /* QualifiedName */) { + if (root.parent.kind === 142 /* QualifiedName */) { + while (root.parent && root.parent.kind === 142 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 157 /* TypeReference */ && !isLastClause; + return root.parent.kind === 158 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 177 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 177 /* PropertyAccessExpression */) { + if (root.parent.kind === 178 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 178 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 199 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 255 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 200 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 258 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 226 /* ClassDeclaration */ && root.parent.parent.token === 107 /* ImplementsKeyword */) || - (decl.kind === 227 /* InterfaceDeclaration */ && root.parent.parent.token === 84 /* ExtendsKeyword */); + return (decl.kind === 228 /* ClassDeclaration */ && root.parent.parent.token === 107 /* ImplementsKeyword */) || + (decl.kind === 229 /* InterfaceDeclaration */ && root.parent.parent.token === 84 /* ExtendsKeyword */); } return false; } @@ -65035,17 +69985,17 @@ var ts; if (ts.isRightSideOfQualifiedNameOrPropertyAccess(node)) { node = node.parent; } - return node.parent.kind === 157 /* TypeReference */ || - (node.parent.kind === 199 /* ExpressionWithTypeArguments */ && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || + return node.parent.kind === 158 /* TypeReference */ || + (node.parent.kind === 200 /* ExpressionWithTypeArguments */ && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || (node.kind === 98 /* ThisKeyword */ && !ts.isPartOfExpression(node)) || - node.kind === 167 /* ThisType */; + node.kind === 168 /* ThisType */; } function isCallExpressionTarget(node) { - return isCallOrNewExpressionTarget(node, 179 /* CallExpression */); + return isCallOrNewExpressionTarget(node, 180 /* CallExpression */); } ts.isCallExpressionTarget = isCallExpressionTarget; function isNewExpressionTarget(node) { - return isCallOrNewExpressionTarget(node, 180 /* NewExpression */); + return isCallOrNewExpressionTarget(node, 181 /* NewExpression */); } ts.isNewExpressionTarget = isNewExpressionTarget; function isCallOrNewExpressionTarget(node, kind) { @@ -65058,7 +70008,7 @@ var ts; ts.climbPastPropertyAccess = climbPastPropertyAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 219 /* LabeledStatement */ && referenceNode.label.text === labelName) { + if (referenceNode.kind === 221 /* LabeledStatement */ && referenceNode.label.text === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -65068,13 +70018,13 @@ var ts; ts.getTargetLabel = getTargetLabel; function isJumpStatementTarget(node) { return node.kind === 70 /* Identifier */ && - (node.parent.kind === 215 /* BreakStatement */ || node.parent.kind === 214 /* ContinueStatement */) && + (node.parent.kind === 217 /* BreakStatement */ || node.parent.kind === 216 /* ContinueStatement */) && node.parent.label === node; } ts.isJumpStatementTarget = isJumpStatementTarget; function isLabelOfLabeledStatement(node) { return node.kind === 70 /* Identifier */ && - node.parent.kind === 219 /* LabeledStatement */ && + node.parent.kind === 221 /* LabeledStatement */ && node.parent.label === node; } function isLabelName(node) { @@ -65082,15 +70032,15 @@ var ts; } ts.isLabelName = isLabelName; function isRightSideOfQualifiedName(node) { - return node.parent.kind === 141 /* QualifiedName */ && node.parent.right === node; + return node.parent.kind === 142 /* QualifiedName */ && node.parent.right === node; } ts.isRightSideOfQualifiedName = isRightSideOfQualifiedName; function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 177 /* PropertyAccessExpression */ && node.parent.name === node; + return node && node.parent && node.parent.kind === 178 /* PropertyAccessExpression */ && node.parent.name === node; } ts.isRightSideOfPropertyAccess = isRightSideOfPropertyAccess; function isNameOfModuleDeclaration(node) { - return node.parent.kind === 230 /* ModuleDeclaration */ && node.parent.name === node; + return node.parent.kind === 232 /* ModuleDeclaration */ && node.parent.name === node; } ts.isNameOfModuleDeclaration = isNameOfModuleDeclaration; function isNameOfFunctionDeclaration(node) { @@ -65101,19 +70051,19 @@ var ts; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) { switch (node.parent.kind) { - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 257 /* PropertyAssignment */: - case 260 /* EnumMember */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 230 /* ModuleDeclaration */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 260 /* PropertyAssignment */: + case 263 /* EnumMember */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 232 /* ModuleDeclaration */: return node.parent.name === node; - case 178 /* ElementAccessExpression */: + case 179 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 142 /* ComputedPropertyName */: + case 143 /* ComputedPropertyName */: return true; } } @@ -65162,17 +70112,17 @@ var ts; return undefined; } switch (node.kind) { - case 261 /* SourceFile */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 229 /* EnumDeclaration */: - case 230 /* ModuleDeclaration */: + case 264 /* SourceFile */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 228 /* ClassDeclaration */: + case 229 /* InterfaceDeclaration */: + case 231 /* EnumDeclaration */: + case 232 /* ModuleDeclaration */: return node; } } @@ -65180,46 +70130,46 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 261 /* SourceFile */: + case 264 /* SourceFile */: return ts.isExternalModule(node) ? ts.ScriptElementKind.moduleElement : ts.ScriptElementKind.scriptElement; - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: return ts.ScriptElementKind.moduleElement; - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: return ts.ScriptElementKind.classElement; - case 227 /* InterfaceDeclaration */: return ts.ScriptElementKind.interfaceElement; - case 228 /* TypeAliasDeclaration */: return ts.ScriptElementKind.typeElement; - case 229 /* EnumDeclaration */: return ts.ScriptElementKind.enumElement; - case 223 /* VariableDeclaration */: + case 229 /* InterfaceDeclaration */: return ts.ScriptElementKind.interfaceElement; + case 230 /* TypeAliasDeclaration */: return ts.ScriptElementKind.typeElement; + case 231 /* EnumDeclaration */: return ts.ScriptElementKind.enumElement; + case 225 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 174 /* BindingElement */: + case 175 /* BindingElement */: return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 185 /* ArrowFunction */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: return ts.ScriptElementKind.functionElement; - case 151 /* GetAccessor */: return ts.ScriptElementKind.memberGetAccessorElement; - case 152 /* SetAccessor */: return ts.ScriptElementKind.memberSetAccessorElement; - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 152 /* GetAccessor */: return ts.ScriptElementKind.memberGetAccessorElement; + case 153 /* SetAccessor */: return ts.ScriptElementKind.memberSetAccessorElement; + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: return ts.ScriptElementKind.memberFunctionElement; - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: return ts.ScriptElementKind.memberVariableElement; - case 155 /* IndexSignature */: return ts.ScriptElementKind.indexSignatureElement; - case 154 /* ConstructSignature */: return ts.ScriptElementKind.constructSignatureElement; - case 153 /* CallSignature */: return ts.ScriptElementKind.callSignatureElement; - case 150 /* Constructor */: return ts.ScriptElementKind.constructorImplementationElement; - case 143 /* TypeParameter */: return ts.ScriptElementKind.typeParameterElement; - case 260 /* EnumMember */: return ts.ScriptElementKind.enumMemberElement; - case 144 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? ts.ScriptElementKind.memberVariableElement : ts.ScriptElementKind.parameterElement; - case 234 /* ImportEqualsDeclaration */: - case 239 /* ImportSpecifier */: - case 236 /* ImportClause */: - case 243 /* ExportSpecifier */: - case 237 /* NamespaceImport */: + case 156 /* IndexSignature */: return ts.ScriptElementKind.indexSignatureElement; + case 155 /* ConstructSignature */: return ts.ScriptElementKind.constructSignatureElement; + case 154 /* CallSignature */: return ts.ScriptElementKind.callSignatureElement; + case 151 /* Constructor */: return ts.ScriptElementKind.constructorImplementationElement; + case 144 /* TypeParameter */: return ts.ScriptElementKind.typeParameterElement; + case 263 /* EnumMember */: return ts.ScriptElementKind.enumMemberElement; + case 145 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? ts.ScriptElementKind.memberVariableElement : ts.ScriptElementKind.parameterElement; + case 236 /* ImportEqualsDeclaration */: + case 241 /* ImportSpecifier */: + case 238 /* ImportClause */: + case 245 /* ExportSpecifier */: + case 239 /* NamespaceImport */: return ts.ScriptElementKind.alias; - case 285 /* JSDocTypedefTag */: + case 289 /* JSDocTypedefTag */: return ts.ScriptElementKind.typeElement; default: return ts.ScriptElementKind.unknown; @@ -65233,15 +70183,6 @@ var ts; } } ts.getNodeKind = getNodeKind; - function getStringLiteralTypeForNode(node, typeChecker) { - var searchNode = node.parent.kind === 171 /* LiteralType */ ? node.parent : node; - var type = typeChecker.getTypeAtLocation(searchNode); - if (type && type.flags & 32 /* StringLiteral */) { - return type; - } - return undefined; - } - ts.getStringLiteralTypeForNode = getStringLiteralTypeForNode; function isThis(node) { switch (node.kind) { case 98 /* ThisKeyword */: @@ -65249,7 +70190,7 @@ var ts; return true; case 70 /* Identifier */: // 'this' as a parameter - return ts.identifierIsThisKeyword(node) && node.parent.kind === 144 /* Parameter */; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 145 /* Parameter */; default: return false; } @@ -65258,7 +70199,7 @@ var ts; // Matches the beginning of a triple slash directive var tripleSlashDirectivePrefixRegex = /^\/\/\/\s*= node.end) { + if (c.kind === 293 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { return c; } }); @@ -65497,7 +70438,7 @@ var ts; if (includeJsDocComment === void 0) { includeJsDocComment = false; } var current = sourceFile; outer: while (true) { - if (isToken(current)) { + if (ts.isToken(current)) { // exit early return current; } @@ -65522,8 +70463,8 @@ var ts; } } // find the child that contains 'position' - for (var i = 0, n = current.getChildCount(sourceFile); i < n; i++) { - var child = current.getChildAt(i); + for (var _a = 0, _b = current.getChildren(); _a < _b.length; _a++) { + var child = _b[_a]; // all jsDocComment nodes were already visited if (ts.isJSDocNode(child)) { continue; @@ -65547,18 +70488,18 @@ var ts; } } /** - * The token on the left of the position is the token that strictly includes the position - * or sits to the left of the cursor if it is on a boundary. For example - * - * fo|o -> will return foo - * foo |bar -> will return foo - * - */ + * The token on the left of the position is the token that strictly includes the position + * or sits to the left of the cursor if it is on a boundary. For example + * + * fo|o -> will return foo + * foo |bar -> will return foo + * + */ function findTokenOnLeftOfPosition(file, position) { // Ideally, getTokenAtPosition should return a token. However, it is currently // broken, so we do a check to make sure the result was indeed a token. var tokenAtPosition = getTokenAtPosition(file, position); - if (isToken(tokenAtPosition) && position > tokenAtPosition.getStart(file) && position < tokenAtPosition.getEnd()) { + if (ts.isToken(tokenAtPosition) && position > tokenAtPosition.getStart(file) && position < tokenAtPosition.getEnd()) { return tokenAtPosition; } return findPrecedingToken(position, file); @@ -65567,7 +70508,7 @@ var ts; function findNextToken(previousToken, parent) { return find(parent); function find(n) { - if (isToken(n) && n.pos === previousToken.end) { + if (ts.isToken(n) && n.pos === previousToken.end) { // this is token that starts at the end of previous token - return it return n; } @@ -65590,7 +70531,7 @@ var ts; function findPrecedingToken(position, sourceFile, startNode) { return find(startNode || sourceFile); function findRightmostToken(n) { - if (isToken(n)) { + if (ts.isToken(n)) { return n; } var children = n.getChildren(); @@ -65598,11 +70539,11 @@ var ts; return candidate && findRightmostToken(candidate); } function find(n) { - if (isToken(n)) { + if (ts.isToken(n)) { return n; } var children = n.getChildren(); - for (var i = 0, len = children.length; i < len; i++) { + for (var i = 0; i < children.length; i++) { var child = children[i]; // condition 'position < child.end' checks if child node end after the position // in the example below this condition will be false for 'aaaa' and 'bbbb' and true for 'ccc' @@ -65627,7 +70568,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 261 /* SourceFile */); + ts.Debug.assert(startNode !== undefined || n.kind === 264 /* SourceFile */); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. // Try to find the rightmost token in the file without filtering. @@ -65686,17 +70627,17 @@ var ts; return true; } //
{ |
or
- if (token.kind === 26 /* LessThanToken */ && token.parent.kind === 252 /* JsxExpression */) { + if (token.kind === 26 /* LessThanToken */ && token.parent.kind === 255 /* JsxExpression */) { return true; } //
{ // | // } < /div> - if (token && token.kind === 17 /* CloseBraceToken */ && token.parent.kind === 252 /* JsxExpression */) { + if (token && token.kind === 17 /* CloseBraceToken */ && token.parent.kind === 255 /* JsxExpression */) { return true; } //
|
- if (token.kind === 26 /* LessThanToken */ && token.parent.kind === 249 /* JsxClosingElement */) { + if (token.kind === 26 /* LessThanToken */ && token.parent.kind === 251 /* JsxClosingElement */) { return true; } return false; @@ -65727,10 +70668,10 @@ var ts; // Internally, we represent the end of the comment at the newline and closing '/', respectively. return predicate ? ts.forEach(commentRanges, function (c) { return c.pos < position && - (c.kind == 2 /* SingleLineCommentTrivia */ ? position <= c.end : position < c.end) && + (c.kind === 2 /* SingleLineCommentTrivia */ ? position <= c.end : position < c.end) && predicate(c); }) : ts.forEach(commentRanges, function (c) { return c.pos < position && - (c.kind == 2 /* SingleLineCommentTrivia */ ? position <= c.end : position < c.end); }); + (c.kind === 2 /* SingleLineCommentTrivia */ ? position <= c.end : position < c.end); }); } return false; } @@ -65751,7 +70692,7 @@ var ts; */ function getJsDocTagAtPosition(sourceFile, position) { var node = ts.getTokenAtPosition(sourceFile, position); - if (isToken(node)) { + if (ts.isToken(node)) { switch (node.kind) { case 103 /* VarKeyword */: case 109 /* LetKeyword */: @@ -65808,19 +70749,15 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 157 /* TypeReference */ || node.kind === 179 /* CallExpression */) { + if (node.kind === 158 /* TypeReference */ || node.kind === 180 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 226 /* ClassDeclaration */ || node.kind === 227 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 228 /* ClassDeclaration */ || node.kind === 229 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; } ts.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList; - function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 140 /* LastToken */; - } - ts.isToken = isToken; function isWord(kind) { return kind === 70 /* Identifier */ || ts.isKeyword(kind); } @@ -65877,18 +70814,18 @@ var ts; } ts.compareDataObjects = compareDataObjects; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 175 /* ArrayLiteralExpression */ || - node.kind === 176 /* ObjectLiteralExpression */) { + if (node.kind === 176 /* ArrayLiteralExpression */ || + node.kind === 177 /* ObjectLiteralExpression */) { // [a,b,c] from: // [a, b, c] = someExpression; - if (node.parent.kind === 192 /* BinaryExpression */ && + if (node.parent.kind === 193 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 57 /* EqualsToken */) { return true; } // [a, b, c] from: // for([a, b, c] of expression) - if (node.parent.kind === 213 /* ForOfStatement */ && + if (node.parent.kind === 215 /* ForOfStatement */ && node.parent.initializer === node) { return true; } @@ -65896,7 +70833,7 @@ var ts; // [x, [a, b, c] ] = someExpression // or // {x, a: {a, b, c} } = someExpression - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 257 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 260 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -65924,12 +70861,47 @@ var ts; } } ts.isInNonReferenceComment = isInNonReferenceComment; + function createTextSpanFromNode(node, sourceFile) { + return ts.createTextSpanFromBounds(node.getStart(sourceFile), node.getEnd()); + } + ts.createTextSpanFromNode = createTextSpanFromNode; + function isTypeKeyword(kind) { + switch (kind) { + case 118 /* AnyKeyword */: + case 121 /* BooleanKeyword */: + case 129 /* NeverKeyword */: + case 132 /* NumberKeyword */: + case 133 /* ObjectKeyword */: + case 135 /* StringKeyword */: + case 136 /* SymbolKeyword */: + case 104 /* VoidKeyword */: + return true; + default: + return false; + } + } + ts.isTypeKeyword = isTypeKeyword; + /** True if the symbol is for an external module, as opposed to a namespace. */ + function isExternalModuleSymbol(moduleSymbol) { + ts.Debug.assert(!!(moduleSymbol.flags & 1536 /* Module */)); + return moduleSymbol.name.charCodeAt(0) === 34 /* doubleQuote */; + } + ts.isExternalModuleSymbol = isExternalModuleSymbol; + /** Returns `true` the first time it encounters a node and `false` afterwards. */ + function nodeSeenTracker() { + var seen = []; + return function (node) { + var id = ts.getNodeId(node); + return !seen[id] && (seen[id] = true); + }; + } + ts.nodeSeenTracker = nodeSeenTracker; })(ts || (ts = {})); // Display-part writer helpers /* @internal */ (function (ts) { function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 144 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 145 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -65946,13 +70918,15 @@ var ts; writeSpace: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.space); }, writeStringLiteral: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.stringLiteral); }, writeParameter: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.parameterName); }, + writeProperty: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.propertyName); }, writeSymbol: writeSymbol, writeLine: writeLine, increaseIndent: function () { indent++; }, decreaseIndent: function () { indent--; }, clear: resetWriter, trackSymbol: ts.noop, - reportInaccessibleThisError: ts.noop + reportInaccessibleThisError: ts.noop, + reportIllegalExtends: ts.noop }; function writeIndent() { if (lineStart) { @@ -66105,23 +71079,18 @@ var ts; function getDeclaredName(typeChecker, symbol, location) { // If this is an export or import specifier it could have been renamed using the 'as' syntax. // If so we want to search for whatever is under the cursor. - if (isImportOrExportSpecifierName(location)) { - return location.getText(); - } - else if (ts.isStringOrNumericLiteral(location) && - location.parent.kind === 142 /* ComputedPropertyName */) { + if (isImportOrExportSpecifierName(location) || ts.isStringOrNumericLiteral(location) && location.parent.kind === 143 /* ComputedPropertyName */) { return location.text; } // Try to get the local symbol if we're dealing with an 'export default' // since that symbol has the "true" name. var localExportDefaultSymbol = ts.getLocalSymbolForExportDefault(symbol); - var name = typeChecker.symbolToString(localExportDefaultSymbol || symbol); - return name; + return typeChecker.symbolToString(localExportDefaultSymbol || symbol); } ts.getDeclaredName = getDeclaredName; function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 239 /* ImportSpecifier */ || location.parent.kind === 243 /* ExportSpecifier */) && + (location.parent.kind === 241 /* ImportSpecifier */ || location.parent.kind === 245 /* ExportSpecifier */) && location.parent.propertyName === location; } ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName; @@ -66137,7 +71106,6 @@ var ts; (name.charCodeAt(0) === 34 /* doubleQuote */ || name.charCodeAt(0) === 39 /* singleQuote */)) { return name.substring(1, length - 1); } - ; return name; } ts.stripQuotes = stripQuotes; @@ -66188,6 +71156,22 @@ var ts; }; } ts.sanitizeConfigFile = sanitizeConfigFile; + function getFirstNonSpaceCharacterPosition(text, position) { + while (ts.isWhiteSpace(text.charCodeAt(position))) { + position += 1; + } + return position; + } + ts.getFirstNonSpaceCharacterPosition = getFirstNonSpaceCharacterPosition; + function getOpenBrace(constructor, sourceFile) { + // First token is the open curly, this is where we want to put the 'super' call. + return constructor.body.getFirstToken(sourceFile); + } + ts.getOpenBrace = getOpenBrace; + function getOpenBraceOfClassLike(declaration, sourceFile) { + return ts.getTokenAtPosition(sourceFile, declaration.members.pos - 1); + } + ts.getOpenBraceOfClassLike = getOpenBraceOfClassLike; })(ts || (ts = {})); var ts; (function (ts) { @@ -66236,7 +71220,7 @@ var ts; function canFollow(keyword1, keyword2) { if (ts.isAccessibilityModifier(keyword1)) { if (keyword2 === 124 /* GetKeyword */ || - keyword2 === 133 /* SetKeyword */ || + keyword2 === 134 /* SetKeyword */ || keyword2 === 122 /* ConstructorKeyword */ || keyword2 === 114 /* StaticKeyword */) { // Allow things like "public get", "public constructor" and "public static". @@ -66255,9 +71239,9 @@ var ts; var entries = []; var dense = classifications.spans; var lastEnd = 0; - for (var i = 0, n = dense.length; i < n; i += 3) { + for (var i = 0; i < dense.length; i += 3) { var start = dense[i]; - var length_4 = dense[i + 1]; + var length_5 = dense[i + 1]; var type = dense[i + 2]; // Make a whitespace entry between the last item and this one. if (lastEnd >= 0) { @@ -66266,8 +71250,8 @@ var ts; entries.push({ length: whitespaceLength_1, classification: ts.TokenClass.Whitespace }); } } - entries.push({ length: length_4, classification: convertClassification(type) }); - lastEnd = start + length_4; + entries.push({ length: length_5, classification: convertClassification(type) }); + lastEnd = start + length_5; } var whitespaceLength = text.length - lastEnd; if (whitespaceLength > 0) { @@ -66335,7 +71319,7 @@ var ts; case 5 /* InTemplateMiddleOrTail */: text = "}\n" + text; offset = 2; - // fallthrough + // falls through case 6 /* InTemplateSubstitutionPosition */: templateStack.push(13 /* TemplateHead */); break; @@ -66395,10 +71379,10 @@ var ts; angleBracketStack--; } else if (token === 118 /* AnyKeyword */ || - token === 134 /* StringKeyword */ || + token === 135 /* StringKeyword */ || token === 132 /* NumberKeyword */ || token === 121 /* BooleanKeyword */ || - token === 135 /* SymbolKeyword */) { + token === 136 /* SymbolKeyword */) { if (angleBracketStack > 0 && !syntacticClassifierAbsent) { // If it looks like we're could be in something generic, don't classify this // as a keyword. We may just get overwritten by the syntactic classifier, @@ -66570,7 +71554,7 @@ var ts; } } function isKeyword(token) { - return token >= 71 /* FirstKeyword */ && token <= 140 /* LastKeyword */; + return token >= 71 /* FirstKeyword */ && token <= 141 /* LastKeyword */; } function classFromKind(token) { if (isKeyword(token)) { @@ -66627,10 +71611,10 @@ var ts; // That means we're calling back into the host around every 1.2k of the file we process. // Lib.d.ts has similar numbers. switch (kind) { - case 230 /* ModuleDeclaration */: - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 225 /* FunctionDeclaration */: + case 232 /* ModuleDeclaration */: + case 228 /* ClassDeclaration */: + case 229 /* InterfaceDeclaration */: + case 227 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } @@ -66681,7 +71665,7 @@ var ts; */ function hasValueSideModule(symbol) { return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 230 /* ModuleDeclaration */ && + return declaration.kind === 232 /* ModuleDeclaration */ && ts.getModuleInstanceState(declaration) === 1 /* Instantiated */; }); } @@ -66696,7 +71680,7 @@ var ts; // Only bother calling into the typechecker if this is an identifier that // could possibly resolve to a type name. This makes classification run // in a third of the time it would normally take. - if (classifiableNames[identifier.text]) { + if (classifiableNames.get(identifier.text)) { var symbol = typeChecker.getSymbolAtLocation(node); if (symbol) { var type = classifySymbol(symbol, ts.getMeaningFromLocation(node)); @@ -66742,7 +71726,7 @@ var ts; ts.Debug.assert(classifications.spans.length % 3 === 0); var dense = classifications.spans; var result = []; - for (var i = 0, n = dense.length; i < n; i += 3) { + for (var i = 0; i < dense.length; i += 3) { result.push({ textSpan: ts.createTextSpan(dense[i], dense[i + 1]), classificationType: getClassificationTypeName(dense[i + 2]) @@ -66845,16 +71829,16 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); pos = tag.tagName.end; switch (tag.kind) { - case 281 /* JSDocParameterTag */: + case 285 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 284 /* JSDocTemplateTag */: + case 288 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); break; - case 283 /* JSDocTypeTag */: + case 287 /* JSDocTypeTag */: processElement(tag.typeExpression); break; - case 282 /* JSDocReturnTag */: + case 286 /* JSDocReturnTag */: processElement(tag.typeExpression); break; } @@ -66941,22 +71925,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 248 /* JsxOpeningElement */: + case 250 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 249 /* JsxClosingElement */: + case 251 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 247 /* JsxSelfClosingElement */: + case 249 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 250 /* JsxAttribute */: + case 252 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -66984,17 +71968,17 @@ var ts; if (token) { if (tokenKind === 57 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (token.parent.kind === 223 /* VariableDeclaration */ || - token.parent.kind === 147 /* PropertyDeclaration */ || - token.parent.kind === 144 /* Parameter */ || - token.parent.kind === 250 /* JsxAttribute */) { + if (token.parent.kind === 225 /* VariableDeclaration */ || + token.parent.kind === 148 /* PropertyDeclaration */ || + token.parent.kind === 145 /* Parameter */ || + token.parent.kind === 252 /* JsxAttribute */) { return 5 /* operator */; } } - if (token.parent.kind === 192 /* BinaryExpression */ || - token.parent.kind === 190 /* PrefixUnaryExpression */ || - token.parent.kind === 191 /* PostfixUnaryExpression */ || - token.parent.kind === 193 /* ConditionalExpression */) { + if (token.parent.kind === 193 /* BinaryExpression */ || + token.parent.kind === 191 /* PrefixUnaryExpression */ || + token.parent.kind === 192 /* PostfixUnaryExpression */ || + token.parent.kind === 194 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -67004,7 +71988,7 @@ var ts; return 4 /* numericLiteral */; } else if (tokenKind === 9 /* StringLiteral */) { - return token.parent.kind === 250 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token.parent.kind === 252 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 11 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. @@ -67020,32 +72004,32 @@ var ts; else if (tokenKind === 70 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 143 /* TypeParameter */: + case 144 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 144 /* Parameter */: + case 145 /* Parameter */: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -67062,9 +72046,8 @@ var ts; // Ignore nodes that don't intersect the original span to classify. if (ts.decodedTextSpanIntersectsWith(spanStart, spanLength, element.pos, element.getFullWidth())) { checkForClassificationCancellation(cancellationToken, element.kind); - var children = element.getChildren(sourceFile); - for (var i = 0, n = children.length; i < n; i++) { - var child = children[i]; + for (var _i = 0, _a = element.getChildren(sourceFile); _i < _a.length; _i++) { + var child = _a[_i]; if (!tryClassifyNode(child)) { // Recurse into our child nodes. processElement(child); @@ -67075,259 +72058,31 @@ var ts; } ts.getEncodedSyntacticClassifications = getEncodedSyntacticClassifications; })(ts || (ts = {})); -/// /* @internal */ var ts; (function (ts) { var Completions; (function (Completions) { - function getCompletionsAtPosition(host, typeChecker, log, compilerOptions, sourceFile, position) { - if (ts.isInReferenceComment(sourceFile, position)) { - return getTripleSlashReferenceCompletion(sourceFile, position); - } - if (ts.isInString(sourceFile, position)) { - return getStringLiteralCompletionEntries(sourceFile, position); - } - var completionData = getCompletionData(typeChecker, log, sourceFile, position); - if (!completionData) { - return undefined; - } - var symbols = completionData.symbols, isGlobalCompletion = completionData.isGlobalCompletion, isMemberCompletion = completionData.isMemberCompletion, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, isJsDocTagName = completionData.isJsDocTagName; - if (isJsDocTagName) { - // If the current position is a jsDoc tag name, only tag names should be provided for completion - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: ts.JsDoc.getAllJsDocCompletionEntries() }; - } - var entries = []; - if (ts.isSourceFileJavaScript(sourceFile)) { - var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true); - ts.addRange(entries, getJavaScriptCompletionEntries(sourceFile, location.pos, uniqueNames)); - } - else { - if (!symbols || symbols.length === 0) { - if (sourceFile.languageVariant === 1 /* JSX */ && - location.parent && location.parent.kind === 249 /* JsxClosingElement */) { - // In the TypeScript JSX element, if such element is not defined. When users query for completion at closing tag, - // instead of simply giving unknown value, the completion will return the tag-name of an associated opening-element. - // For example: - // var x =
completion list at "1" will contain "div" with type any - var tagName = location.parent.parent.openingElement.tagName; - entries.push({ - name: tagName.text, - kind: undefined, - kindModifiers: undefined, - sortText: "0", - }); - } - else { - return undefined; - } - } - getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true); - } - // Add keywords if this is not a member completion list - if (!isMemberCompletion && !isJsDocTagName) { - ts.addRange(entries, keywordCompletions); - } - return { isGlobalCompletion: isGlobalCompletion, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; - function getJavaScriptCompletionEntries(sourceFile, position, uniqueNames) { - var entries = []; - var nameTable = ts.getNameTable(sourceFile); - for (var name_43 in nameTable) { - // Skip identifiers produced only from the current location - if (nameTable[name_43] === position) { - continue; - } - if (!uniqueNames[name_43]) { - uniqueNames[name_43] = name_43; - var displayName = getCompletionEntryDisplayName(ts.unescapeIdentifier(name_43), compilerOptions.target, /*performCharacterChecks*/ true); - if (displayName) { - var entry = { - name: displayName, - kind: ts.ScriptElementKind.warning, - kindModifiers: "", - sortText: "1" - }; - entries.push(entry); - } - } - } - return entries; - } - function createCompletionEntry(symbol, location, performCharacterChecks) { - // Try to get a valid display name for this symbol, if we could not find one, then ignore it. - // We would like to only show things that can be added after a dot, so for instance numeric properties can - // not be accessed with a dot (a.1 <- invalid) - var displayName = getCompletionEntryDisplayNameForSymbol(typeChecker, symbol, compilerOptions.target, performCharacterChecks, location); - if (!displayName) { - return undefined; - } - // TODO(drosen): Right now we just permit *all* semantic meanings when calling - // 'getSymbolKind' which is permissible given that it is backwards compatible; but - // really we should consider passing the meaning for the node so that we don't report - // that a suggestion for a value is an interface. We COULD also just do what - // 'getSymbolModifiers' does, which is to use the first declaration. - // Use a 'sortText' of 0' so that all symbol completion entries come before any other - // entries (like JavaScript identifier entries). - return { - name: displayName, - kind: ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location), - kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), - sortText: "0", - }; - } - function getCompletionEntriesFromSymbols(symbols, entries, location, performCharacterChecks) { - var start = ts.timestamp(); - var uniqueNames = ts.createMap(); - if (symbols) { - for (var _i = 0, symbols_4 = symbols; _i < symbols_4.length; _i++) { - var symbol = symbols_4[_i]; - var entry = createCompletionEntry(symbol, location, performCharacterChecks); - if (entry) { - var id = ts.escapeIdentifier(entry.name); - if (!uniqueNames[id]) { - entries.push(entry); - uniqueNames[id] = id; - } - } - } - } - log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (ts.timestamp() - start)); - return uniqueNames; - } - function getStringLiteralCompletionEntries(sourceFile, position) { - var node = ts.findPrecedingToken(position, sourceFile); - if (!node || node.kind !== 9 /* StringLiteral */) { - return undefined; - } - if (node.parent.kind === 257 /* PropertyAssignment */ && - node.parent.parent.kind === 176 /* ObjectLiteralExpression */ && - node.parent.name === node) { - // Get quoted name of properties of the object literal expression - // i.e. interface ConfigFiles { - // 'jspm:dev': string - // } - // let files: ConfigFiles = { - // '/*completion position*/' - // } - // - // function foo(c: ConfigFiles) {} - // foo({ - // '/*completion position*/' - // }); - return getStringLiteralCompletionEntriesFromPropertyAssignment(node.parent); - } - else if (ts.isElementAccessExpression(node.parent) && node.parent.argumentExpression === node) { - // Get all names of properties on the expression - // i.e. interface A { - // 'prop1': string - // } - // let a: A; - // a['/*completion position*/'] - return getStringLiteralCompletionEntriesFromElementAccess(node.parent); - } - else if (node.parent.kind === 235 /* ImportDeclaration */ || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node) || ts.isRequireCall(node.parent, false)) { - // Get all known external module names or complete a path to a module - // i.e. import * as ns from "/*completion position*/"; - // import x = require("/*completion position*/"); - // var y = require("/*completion position*/"); - return getStringLiteralCompletionEntriesFromModuleNames(node); - } - else { - var argumentInfo = ts.SignatureHelp.getContainingArgumentInfo(node, position, sourceFile); - if (argumentInfo) { - // Get string literal completions from specialized signatures of the target - // i.e. declare function f(a: 'A'); - // f("/*completion position*/") - return getStringLiteralCompletionEntriesFromCallExpression(argumentInfo); - } - // Get completion for string literal from string literal type - // i.e. var x: "hi" | "hello" = "/*completion position*/" - return getStringLiteralCompletionEntriesFromContextualType(node); - } - } - function getStringLiteralCompletionEntriesFromPropertyAssignment(element) { - var type = typeChecker.getContextualType(element.parent); - var entries = []; - if (type) { - getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, element, /*performCharacterChecks*/ false); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; - } - } - } - function getStringLiteralCompletionEntriesFromCallExpression(argumentInfo) { - var candidates = []; - var entries = []; - typeChecker.getResolvedSignature(argumentInfo.invocation, candidates); - for (var _i = 0, candidates_3 = candidates; _i < candidates_3.length; _i++) { - var candidate = candidates_3[_i]; - if (candidate.parameters.length > argumentInfo.argumentIndex) { - var parameter = candidate.parameters[argumentInfo.argumentIndex]; - addStringLiteralCompletionsFromType(typeChecker.getTypeAtLocation(parameter.valueDeclaration), entries); - } - } - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: true, entries: entries }; - } - return undefined; - } - function getStringLiteralCompletionEntriesFromElementAccess(node) { - var type = typeChecker.getTypeAtLocation(node.expression); - var entries = []; - if (type) { - getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, node, /*performCharacterChecks*/ false); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; - } - } - return undefined; - } - function getStringLiteralCompletionEntriesFromContextualType(node) { - var type = typeChecker.getContextualType(node); - if (type) { - var entries_2 = []; - addStringLiteralCompletionsFromType(type, entries_2); - if (entries_2.length) { - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries_2 }; - } - } - return undefined; - } - function addStringLiteralCompletionsFromType(type, result) { - if (!type) { - return; - } - if (type.flags & 65536 /* Union */) { - ts.forEach(type.types, function (t) { return addStringLiteralCompletionsFromType(t, result); }); - } - else { - if (type.flags & 32 /* StringLiteral */) { - result.push({ - name: type.text, - kindModifiers: ts.ScriptElementKindModifier.none, - kind: ts.ScriptElementKind.variableElement, - sortText: "0" - }); - } - } - } - function getStringLiteralCompletionEntriesFromModuleNames(node) { + var PathCompletions; + (function (PathCompletions) { + function getStringLiteralCompletionEntriesFromModuleNames(node, compilerOptions, host, typeChecker) { var literalValue = ts.normalizeSlashes(node.text); var scriptPath = node.getSourceFile().path; var scriptDirectory = ts.getDirectoryPath(scriptPath); var span = getDirectoryFragmentTextSpan(node.text, node.getStart() + 1); var entries; if (isPathRelativeToScript(literalValue) || ts.isRootedDiskPath(literalValue)) { + var extensions = ts.getSupportedExtensions(compilerOptions); if (compilerOptions.rootDirs) { - entries = getCompletionEntriesForDirectoryFragmentWithRootDirs(compilerOptions.rootDirs, literalValue, scriptDirectory, ts.getSupportedExtensions(compilerOptions), /*includeExtensions*/ false, span, scriptPath); + entries = getCompletionEntriesForDirectoryFragmentWithRootDirs(compilerOptions.rootDirs, literalValue, scriptDirectory, extensions, /*includeExtensions*/ false, span, compilerOptions, host, scriptPath); } else { - entries = getCompletionEntriesForDirectoryFragment(literalValue, scriptDirectory, ts.getSupportedExtensions(compilerOptions), /*includeExtensions*/ false, span, scriptPath); + entries = getCompletionEntriesForDirectoryFragment(literalValue, scriptDirectory, extensions, /*includeExtensions*/ false, span, host, scriptPath); } } else { // Check for node modules - entries = getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, span); + entries = getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, span, compilerOptions, host, typeChecker); } return { isGlobalCompletion: false, @@ -67336,6 +72091,7 @@ var ts; entries: entries }; } + PathCompletions.getStringLiteralCompletionEntriesFromModuleNames = getStringLiteralCompletionEntriesFromModuleNames; /** * Takes a script path and returns paths for all potential folders that could be merged with its * containing folder via the "rootDirs" compiler option @@ -67355,21 +72111,21 @@ var ts; // Now find a path for each potential directory that is to be merged with the one containing the script return ts.deduplicate(ts.map(rootDirs, function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); })); } - function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptPath, extensions, includeExtensions, span, exclude) { + function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptPath, extensions, includeExtensions, span, compilerOptions, host, exclude) { var basePath = compilerOptions.project || host.getCurrentDirectory(); var ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); var baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptPath, ignoreCase); var result = []; for (var _i = 0, baseDirectories_1 = baseDirectories; _i < baseDirectories_1.length; _i++) { var baseDirectory = baseDirectories_1[_i]; - getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensions, includeExtensions, span, exclude, result); + getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensions, includeExtensions, span, host, exclude, result); } return result; } /** * Given a path ending at a directory, gets the completions for the path, and filters for those entries containing the basename. */ - function getCompletionEntriesForDirectoryFragment(fragment, scriptPath, extensions, includeExtensions, span, exclude, result) { + function getCompletionEntriesForDirectoryFragment(fragment, scriptPath, extensions, includeExtensions, span, host, exclude, result) { if (result === void 0) { result = []; } if (fragment === undefined) { fragment = ""; @@ -67405,13 +72161,13 @@ var ts; continue; } var foundFileName = includeExtensions ? ts.getBaseFileName(filePath) : ts.removeFileExtension(ts.getBaseFileName(filePath)); - if (!foundFiles[foundFileName]) { - foundFiles[foundFileName] = true; + if (!foundFiles.get(foundFileName)) { + foundFiles.set(foundFileName, true); } } - for (var foundFile in foundFiles) { + ts.forEachKey(foundFiles, function (foundFile) { result.push(createCompletionEntryForModule(foundFile, ts.ScriptElementKind.scriptElement, span)); - } + }); } // If possible, get folder completion as well var directories = tryGetDirectories(host, baseDirectory); @@ -67432,14 +72188,14 @@ var ts; * Modules from node_modules (i.e. those listed in package.json) * This includes all files that are found in node_modules/moduleName/ with acceptable file extensions */ - function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, span) { + function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, span, compilerOptions, host, typeChecker) { var baseUrl = compilerOptions.baseUrl, paths = compilerOptions.paths; var result; if (baseUrl) { var fileExtensions = ts.getSupportedExtensions(compilerOptions); var projectDir = compilerOptions.project || host.getCurrentDirectory(); var absolute = ts.isRootedDiskPath(baseUrl) ? baseUrl : ts.combinePaths(projectDir, baseUrl); - result = getCompletionEntriesForDirectoryFragment(fragment, ts.normalizePath(absolute), fileExtensions, /*includeExtensions*/ false, span); + result = getCompletionEntriesForDirectoryFragment(fragment, ts.normalizePath(absolute), fileExtensions, /*includeExtensions*/ false, span, host); if (paths) { for (var path in paths) { if (paths.hasOwnProperty(path)) { @@ -67447,7 +72203,7 @@ var ts; if (paths[path]) { for (var _i = 0, _a = paths[path]; _i < _a.length; _i++) { var pattern = _a[_i]; - for (var _b = 0, _c = getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions); _b < _c.length; _b++) { + for (var _b = 0, _c = getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host); _b < _c.length; _b++) { var match = _c[_b]; result.push(createCompletionEntryForModule(match, ts.ScriptElementKind.externalModuleName, span)); } @@ -67468,13 +72224,13 @@ var ts; result = []; } getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, span, result); - for (var _d = 0, _e = enumeratePotentialNonRelativeModules(fragment, scriptPath, compilerOptions); _d < _e.length; _d++) { + for (var _d = 0, _e = enumeratePotentialNonRelativeModules(fragment, scriptPath, compilerOptions, typeChecker, host); _d < _e.length; _d++) { var moduleName = _e[_d]; result.push(createCompletionEntryForModule(moduleName, ts.ScriptElementKind.externalModuleName, span)); } return result; } - function getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions) { + function getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host) { if (host.readDirectory) { var parsed = ts.hasZeroOrOneAsteriskCharacter(pattern) ? ts.tryParsePattern(pattern) : undefined; if (parsed) { @@ -67493,7 +72249,7 @@ var ts; // that encodes the suffix, but we would have to escape the character "?" which readDirectory // doesn't support. For now, this is safer but slower var includeGlob = normalizedSuffix ? "**/*" : "./*"; - var matches = tryReadDirectory(host, baseDirectory, fileExtensions, undefined, [includeGlob]); + var matches = tryReadDirectory(host, baseDirectory, fileExtensions, /*exclude*/ undefined, [includeGlob]); if (matches) { var result = []; // Trim away prefix and suffix @@ -67504,8 +72260,8 @@ var ts; continue; } var start = completePrefix.length; - var length_5 = normalizedMatch.length - start - normalizedSuffix.length; - result.push(ts.removeFileExtension(normalizedMatch.substr(start, length_5))); + var length_6 = normalizedMatch.length - start - normalizedSuffix.length; + result.push(ts.removeFileExtension(normalizedMatch.substr(start, length_6))); } return result; } @@ -67513,7 +72269,7 @@ var ts; } return undefined; } - function enumeratePotentialNonRelativeModules(fragment, scriptPath, options) { + function enumeratePotentialNonRelativeModules(fragment, scriptPath, options, typeChecker, host) { // Check If this is a nested module var isNestedModule = fragment.indexOf(ts.directorySeparator) !== -1; var moduleNameFragment = isNestedModule ? fragment.substr(0, fragment.lastIndexOf(ts.directorySeparator)) : undefined; @@ -67553,7 +72309,7 @@ var ts; } return ts.deduplicate(nonRelativeModules); } - function getTripleSlashReferenceCompletion(sourceFile, position) { + function getTripleSlashReferenceCompletion(sourceFile, position, compilerOptions, host) { var token = ts.getTokenAtPosition(sourceFile, position); if (!token) { return undefined; @@ -67589,7 +72345,7 @@ var ts; if (kind === "path") { // Give completions for a relative path var span_10 = getDirectoryFragmentTextSpan(toComplete, range.pos + prefix.length); - completionInfo.entries = getCompletionEntriesForDirectoryFragment(toComplete, scriptPath, ts.getSupportedExtensions(compilerOptions), /*includeExtensions*/ true, span_10, sourceFile.path); + completionInfo.entries = getCompletionEntriesForDirectoryFragment(toComplete, scriptPath, ts.getSupportedExtensions(compilerOptions), /*includeExtensions*/ true, span_10, host, sourceFile.path); } else { // Give completions based on the typings available @@ -67599,6 +72355,7 @@ var ts; } return completionInfo; } + PathCompletions.getTripleSlashReferenceCompletion = getTripleSlashReferenceCompletion; function getCompletionEntriesFromTypings(host, options, scriptPath, span, result) { if (result === void 0) { result = []; } // Check for typings specified in compiler options @@ -67624,7 +72381,7 @@ var ts; } if (host.getDirectories) { // Also get all @types typings installed in visible node_modules directories - for (var _c = 0, _d = findPackageJsons(scriptPath); _c < _d.length; _c++) { + for (var _c = 0, _d = findPackageJsons(scriptPath, host); _c < _d.length; _c++) { var packageJson = _d[_c]; var typesDir = ts.combinePaths(ts.getDirectoryPath(packageJson), "node_modules/@types"); getCompletionEntriesFromDirectories(host, typesDir, span, result); @@ -67644,7 +72401,7 @@ var ts; } } } - function findPackageJsons(currentDir) { + function findPackageJsons(currentDir, host) { var paths = []; var currentConfigPath; while (true) { @@ -67652,11 +72409,11 @@ var ts; if (currentConfigPath) { paths.push(currentConfigPath); currentDir = ts.getDirectoryPath(currentConfigPath); - var parent_13 = ts.getDirectoryPath(currentDir); - if (currentDir === parent_13) { + var parent = ts.getDirectoryPath(currentDir); + if (currentDir === parent) { break; } - currentDir = parent_13; + currentDir = parent; } else { break; @@ -67667,7 +72424,7 @@ var ts; function enumerateNodeModulesVisibleToScript(host, scriptPath) { var result = []; if (host.readFile && host.fileExists) { - for (var _i = 0, _a = findPackageJsons(scriptPath); _i < _a.length; _i++) { + for (var _i = 0, _a = findPackageJsons(scriptPath, host); _i < _a.length; _i++) { var packageJson = _a[_i]; var contents = tryReadingPackageJson(packageJson); if (!contents) { @@ -67731,26 +72488,326 @@ var ts; function normalizeAndPreserveTrailingSlash(path) { return ts.hasTrailingDirectorySeparator(path) ? ts.ensureTrailingDirectorySeparator(ts.normalizePath(path)) : ts.normalizePath(path); } + /** + * Matches a triple slash reference directive with an incomplete string literal for its path. Used + * to determine if the caret is currently within the string literal and capture the literal fragment + * for completions. + * For example, this matches + * + * /// +/* @internal */ +var ts; +(function (ts) { + var Completions; + (function (Completions) { + function getCompletionsAtPosition(host, typeChecker, log, compilerOptions, sourceFile, position) { + if (ts.isInReferenceComment(sourceFile, position)) { + return Completions.PathCompletions.getTripleSlashReferenceCompletion(sourceFile, position, compilerOptions, host); + } + if (ts.isInString(sourceFile, position)) { + return getStringLiteralCompletionEntries(sourceFile, position, typeChecker, compilerOptions, host, log); + } + var completionData = getCompletionData(typeChecker, log, sourceFile, position); + if (!completionData) { + return undefined; + } + var symbols = completionData.symbols, isGlobalCompletion = completionData.isGlobalCompletion, isMemberCompletion = completionData.isMemberCompletion, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, requestJsDocTagName = completionData.requestJsDocTagName, requestJsDocTag = completionData.requestJsDocTag; + if (requestJsDocTagName) { + // If the current position is a jsDoc tag name, only tag names should be provided for completion + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: ts.JsDoc.getJSDocTagNameCompletions() }; + } + if (requestJsDocTag) { + // If the current position is a jsDoc tag, only tags should be provided for completion + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: ts.JsDoc.getJSDocTagCompletions() }; + } + var entries = []; + if (ts.isSourceFileJavaScript(sourceFile)) { + var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true, typeChecker, compilerOptions.target, log); + ts.addRange(entries, getJavaScriptCompletionEntries(sourceFile, location.pos, uniqueNames, compilerOptions.target)); + } + else { + if (!symbols || symbols.length === 0) { + if (sourceFile.languageVariant === 1 /* JSX */ && + location.parent && location.parent.kind === 251 /* JsxClosingElement */) { + // In the TypeScript JSX element, if such element is not defined. When users query for completion at closing tag, + // instead of simply giving unknown value, the completion will return the tag-name of an associated opening-element. + // For example: + // var x =
completion list at "1" will contain "div" with type any + var tagName = location.parent.parent.openingElement.tagName; + entries.push({ + name: tagName.text, + kind: undefined, + kindModifiers: undefined, + sortText: "0", + }); + } + else { + return undefined; + } + } + getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true, typeChecker, compilerOptions.target, log); + } + // Add keywords if this is not a member completion list + if (!isMemberCompletion && !requestJsDocTag && !requestJsDocTagName) { + ts.addRange(entries, keywordCompletions); + } + return { isGlobalCompletion: isGlobalCompletion, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; } Completions.getCompletionsAtPosition = getCompletionsAtPosition; + function getJavaScriptCompletionEntries(sourceFile, position, uniqueNames, target) { + var entries = []; + var nameTable = ts.getNameTable(sourceFile); + nameTable.forEach(function (pos, name) { + // Skip identifiers produced only from the current location + if (pos === position) { + return; + } + if (!uniqueNames.get(name)) { + uniqueNames.set(name, name); + var displayName = getCompletionEntryDisplayName(ts.unescapeIdentifier(name), target, /*performCharacterChecks*/ true); + if (displayName) { + var entry = { + name: displayName, + kind: ts.ScriptElementKind.warning, + kindModifiers: "", + sortText: "1" + }; + entries.push(entry); + } + } + }); + return entries; + } + function createCompletionEntry(symbol, location, performCharacterChecks, typeChecker, target) { + // Try to get a valid display name for this symbol, if we could not find one, then ignore it. + // We would like to only show things that can be added after a dot, so for instance numeric properties can + // not be accessed with a dot (a.1 <- invalid) + var displayName = getCompletionEntryDisplayNameForSymbol(typeChecker, symbol, target, performCharacterChecks, location); + if (!displayName) { + return undefined; + } + // TODO(drosen): Right now we just permit *all* semantic meanings when calling + // 'getSymbolKind' which is permissible given that it is backwards compatible; but + // really we should consider passing the meaning for the node so that we don't report + // that a suggestion for a value is an interface. We COULD also just do what + // 'getSymbolModifiers' does, which is to use the first declaration. + // Use a 'sortText' of 0' so that all symbol completion entries come before any other + // entries (like JavaScript identifier entries). + return { + name: displayName, + kind: ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location), + kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), + sortText: "0", + }; + } + function getCompletionEntriesFromSymbols(symbols, entries, location, performCharacterChecks, typeChecker, target, log) { + var start = ts.timestamp(); + var uniqueNames = ts.createMap(); + if (symbols) { + for (var _i = 0, symbols_4 = symbols; _i < symbols_4.length; _i++) { + var symbol = symbols_4[_i]; + var entry = createCompletionEntry(symbol, location, performCharacterChecks, typeChecker, target); + if (entry) { + var id = ts.escapeIdentifier(entry.name); + if (!uniqueNames.get(id)) { + entries.push(entry); + uniqueNames.set(id, id); + } + } + } + } + log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (ts.timestamp() - start)); + return uniqueNames; + } + function getStringLiteralCompletionEntries(sourceFile, position, typeChecker, compilerOptions, host, log) { + var node = ts.findPrecedingToken(position, sourceFile); + if (!node || node.kind !== 9 /* StringLiteral */) { + return undefined; + } + if (node.parent.kind === 260 /* PropertyAssignment */ && + node.parent.parent.kind === 177 /* ObjectLiteralExpression */ && + node.parent.name === node) { + // Get quoted name of properties of the object literal expression + // i.e. interface ConfigFiles { + // 'jspm:dev': string + // } + // let files: ConfigFiles = { + // '/*completion position*/' + // } + // + // function foo(c: ConfigFiles) {} + // foo({ + // '/*completion position*/' + // }); + return getStringLiteralCompletionEntriesFromPropertyAssignment(node.parent, typeChecker, compilerOptions.target, log); + } + else if (ts.isElementAccessExpression(node.parent) && node.parent.argumentExpression === node) { + // Get all names of properties on the expression + // i.e. interface A { + // 'prop1': string + // } + // let a: A; + // a['/*completion position*/'] + return getStringLiteralCompletionEntriesFromElementAccess(node.parent, typeChecker, compilerOptions.target, log); + } + else if (node.parent.kind === 237 /* ImportDeclaration */ || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node) || ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false)) { + // Get all known external module names or complete a path to a module + // i.e. import * as ns from "/*completion position*/"; + // import x = require("/*completion position*/"); + // var y = require("/*completion position*/"); + return Completions.PathCompletions.getStringLiteralCompletionEntriesFromModuleNames(node, compilerOptions, host, typeChecker); + } + else if (isEqualityExpression(node.parent)) { + // Get completions from the type of the other operand + // i.e. switch (a) { + // case '/*completion position*/' + // } + return getStringLiteralCompletionEntriesFromType(typeChecker.getTypeAtLocation(node.parent.left === node ? node.parent.right : node.parent.left), typeChecker); + } + else if (ts.isCaseOrDefaultClause(node.parent)) { + // Get completions from the type of the switch expression + // i.e. x === '/*completion position' + return getStringLiteralCompletionEntriesFromType(typeChecker.getTypeAtLocation(node.parent.parent.parent.expression), typeChecker); + } + else { + var argumentInfo = ts.SignatureHelp.getImmediatelyContainingArgumentInfo(node, position, sourceFile); + if (argumentInfo) { + // Get string literal completions from specialized signatures of the target + // i.e. declare function f(a: 'A'); + // f("/*completion position*/") + return getStringLiteralCompletionEntriesFromCallExpression(argumentInfo, typeChecker); + } + // Get completion for string literal from string literal type + // i.e. var x: "hi" | "hello" = "/*completion position*/" + return getStringLiteralCompletionEntriesFromType(typeChecker.getContextualType(node), typeChecker); + } + } + function getStringLiteralCompletionEntriesFromPropertyAssignment(element, typeChecker, target, log) { + var type = typeChecker.getContextualType(element.parent); + var entries = []; + if (type) { + getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, element, /*performCharacterChecks*/ false, typeChecker, target, log); + if (entries.length) { + return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; + } + } + } + function getStringLiteralCompletionEntriesFromCallExpression(argumentInfo, typeChecker) { + var candidates = []; + var entries = []; + typeChecker.getResolvedSignature(argumentInfo.invocation, candidates); + for (var _i = 0, candidates_3 = candidates; _i < candidates_3.length; _i++) { + var candidate = candidates_3[_i]; + addStringLiteralCompletionsFromType(typeChecker.getParameterType(candidate, argumentInfo.argumentIndex), entries, typeChecker); + } + if (entries.length) { + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: true, entries: entries }; + } + return undefined; + } + function getStringLiteralCompletionEntriesFromElementAccess(node, typeChecker, target, log) { + var type = typeChecker.getTypeAtLocation(node.expression); + var entries = []; + if (type) { + getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, node, /*performCharacterChecks*/ false, typeChecker, target, log); + if (entries.length) { + return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; + } + } + return undefined; + } + function getStringLiteralCompletionEntriesFromType(type, typeChecker) { + if (type) { + var entries = []; + addStringLiteralCompletionsFromType(type, entries, typeChecker); + if (entries.length) { + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries }; + } + } + return undefined; + } + function addStringLiteralCompletionsFromType(type, result, typeChecker) { + if (type && type.flags & 16384 /* TypeParameter */) { + type = typeChecker.getApparentType(type); + } + if (!type) { + return; + } + if (type.flags & 65536 /* Union */) { + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var t = _a[_i]; + addStringLiteralCompletionsFromType(t, result, typeChecker); + } + } + else if (type.flags & 32 /* StringLiteral */) { + result.push({ + name: type.text, + kindModifiers: ts.ScriptElementKindModifier.none, + kind: ts.ScriptElementKind.variableElement, + sortText: "0" + }); + } + } function getCompletionEntryDetails(typeChecker, log, compilerOptions, sourceFile, position, entryName) { // Compute all the completion symbols again. var completionData = getCompletionData(typeChecker, log, sourceFile, position); if (completionData) { - var symbols = completionData.symbols, location_3 = completionData.location; + var symbols = completionData.symbols, location_1 = completionData.location; // Find the symbol with the matching entry name. // We don't need to perform character checks here because we're only comparing the // name against 'entryName' (which is known to be good), not building a new // completion entry. - var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(typeChecker, s, compilerOptions.target, /*performCharacterChecks*/ false, location_3) === entryName ? s : undefined; }); + var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(typeChecker, s, compilerOptions.target, /*performCharacterChecks*/ false, location_1) === entryName ? s : undefined; }); if (symbol) { - var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, location_3, location_3, 7 /* All */), displayParts = _a.displayParts, documentation = _a.documentation, symbolKind = _a.symbolKind; + var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, location_1, location_1, 7 /* All */), displayParts = _a.displayParts, documentation = _a.documentation, symbolKind = _a.symbolKind, tags = _a.tags; return { name: entryName, kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), kind: symbolKind, displayParts: displayParts, - documentation: documentation + documentation: documentation, + tags: tags }; } } @@ -67762,7 +72819,8 @@ var ts; kind: ts.ScriptElementKind.keyword, kindModifiers: ts.ScriptElementKindModifier.none, displayParts: [ts.displayPart(entryName, ts.SymbolDisplayPartKind.keyword)], - documentation: undefined + documentation: undefined, + tags: undefined }; } return undefined; @@ -67772,19 +72830,22 @@ var ts; // Compute all the completion symbols again. var completionData = getCompletionData(typeChecker, log, sourceFile, position); if (completionData) { - var symbols = completionData.symbols, location_4 = completionData.location; + var symbols = completionData.symbols, location_2 = completionData.location; // Find the symbol with the matching entry name. // We don't need to perform character checks here because we're only comparing the // name against 'entryName' (which is known to be good), not building a new // completion entry. - return ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(typeChecker, s, compilerOptions.target, /*performCharacterChecks*/ false, location_4) === entryName ? s : undefined; }); + return ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(typeChecker, s, compilerOptions.target, /*performCharacterChecks*/ false, location_2) === entryName ? s : undefined; }); } return undefined; } Completions.getCompletionEntrySymbol = getCompletionEntrySymbol; function getCompletionData(typeChecker, log, sourceFile, position) { var isJavaScriptFile = ts.isSourceFileJavaScript(sourceFile); - var isJsDocTagName = false; + // JsDoc tag-name is just the name of the JSDoc tagname (exclude "@") + var requestJsDocTagName = false; + // JsDoc tag includes both "@" and tag-name + var requestJsDocTag = false; var start = ts.timestamp(); var currentToken = ts.getTokenAtPosition(sourceFile, position); log("getCompletionData: Get current token: " + (ts.timestamp() - start)); @@ -67793,10 +72854,32 @@ var ts; var insideComment = ts.isInsideComment(sourceFile, currentToken, position); log("getCompletionData: Is inside comment: " + (ts.timestamp() - start)); if (insideComment) { - // The current position is next to the '@' sign, when no tag name being provided yet. - // Provide a full list of tag names - if (ts.hasDocComment(sourceFile, position) && sourceFile.text.charCodeAt(position - 1) === 64 /* at */) { - isJsDocTagName = true; + if (ts.hasDocComment(sourceFile, position)) { + // The current position is next to the '@' sign, when no tag name being provided yet. + // Provide a full list of tag names + if (sourceFile.text.charCodeAt(position - 1) === 64 /* at */) { + requestJsDocTagName = true; + } + else { + // When completion is requested without "@", we will have check to make sure that + // there are no comments prefix the request position. We will only allow "*" and space. + // e.g + // /** |c| /* + // + // /** + // |c| + // */ + // + // /** + // * |c| + // */ + // + // /** + // * |c| + // */ + var lineStart = ts.getLineStartPositionForPosition(position, sourceFile); + requestJsDocTag = !(sourceFile.text.substring(lineStart, position).match(/[^\*|\s|(/\*\*)]/)); + } } // Completion should work inside certain JsDoc tags. For example: // /** @type {number | string} */ @@ -67805,12 +72888,12 @@ var ts; var tag = ts.getJsDocTagAtPosition(sourceFile, position); if (tag) { if (tag.tagName.pos <= position && position <= tag.tagName.end) { - isJsDocTagName = true; + requestJsDocTagName = true; } switch (tag.kind) { - case 283 /* JSDocTypeTag */: - case 281 /* JSDocParameterTag */: - case 282 /* JSDocReturnTag */: + case 287 /* JSDocTypeTag */: + case 285 /* JSDocParameterTag */: + case 286 /* JSDocReturnTag */: var tagWithExpression = tag; if (tagWithExpression.typeExpression) { insideJsDocTagExpression = tagWithExpression.typeExpression.pos < position && position < tagWithExpression.typeExpression.end; @@ -67818,8 +72901,8 @@ var ts; break; } } - if (isJsDocTagName) { - return { symbols: undefined, isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, location: undefined, isRightOfDot: false, isJsDocTagName: isJsDocTagName }; + if (requestJsDocTagName || requestJsDocTag) { + return { symbols: undefined, isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, location: undefined, isRightOfDot: false, requestJsDocTagName: requestJsDocTagName, requestJsDocTag: requestJsDocTag }; } if (!insideJsDocTagExpression) { // Proceed if the current position is in jsDoc tag expression; otherwise it is a normal @@ -67855,13 +72938,13 @@ var ts; log("Returning an empty list because completion was requested in an invalid position."); return undefined; } - var parent_14 = contextToken.parent, kind = contextToken.kind; - if (kind === 22 /* DotToken */) { - if (parent_14.kind === 177 /* PropertyAccessExpression */) { + var parent = contextToken.parent; + if (contextToken.kind === 22 /* DotToken */) { + if (parent.kind === 178 /* PropertyAccessExpression */) { node = contextToken.parent.expression; isRightOfDot = true; } - else if (parent_14.kind === 141 /* QualifiedName */) { + else if (parent.kind === 142 /* QualifiedName */) { node = contextToken.parent.left; isRightOfDot = true; } @@ -67872,13 +72955,34 @@ var ts; } } else if (sourceFile.languageVariant === 1 /* JSX */) { - if (kind === 26 /* LessThanToken */) { - isRightOfOpenTag = true; - location = contextToken; + // + // If the tagname is a property access expression, we will then walk up to the top most of property access expression. + // Then, try to get a JSX container and its associated attributes type. + if (parent && parent.kind === 178 /* PropertyAccessExpression */) { + contextToken = parent; + parent = parent.parent; } - else if (kind === 40 /* SlashToken */ && contextToken.parent.kind === 249 /* JsxClosingElement */) { - isStartingCloseTag = true; - location = contextToken; + switch (parent.kind) { + case 251 /* JsxClosingElement */: + if (contextToken.kind === 40 /* SlashToken */) { + isStartingCloseTag = true; + location = contextToken; + } + break; + case 193 /* BinaryExpression */: + if (!(parent.left.flags & 32768 /* ThisNodeHasError */)) { + // It has a left-hand side, so we're not in an opening JSX tag. + break; + } + // falls through + case 249 /* JsxSelfClosingElement */: + case 248 /* JsxElement */: + case 250 /* JsxOpeningElement */: + if (contextToken.kind === 26 /* LessThanToken */) { + isRightOfOpenTag = true; + location = contextToken; + } + break; } } } @@ -67919,13 +73023,13 @@ var ts; } } log("getCompletionData: Semantic work: " + (ts.timestamp() - semanticStart)); - return { symbols: symbols, isGlobalCompletion: isGlobalCompletion, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, location: location, isRightOfDot: (isRightOfDot || isRightOfOpenTag), isJsDocTagName: isJsDocTagName }; + return { symbols: symbols, isGlobalCompletion: isGlobalCompletion, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, location: location, isRightOfDot: (isRightOfDot || isRightOfOpenTag), requestJsDocTagName: requestJsDocTagName, requestJsDocTag: requestJsDocTag }; function getTypeScriptMemberSymbols() { // Right of dot member completion list isGlobalCompletion = false; isMemberCompletion = true; isNewIdentifierLocation = false; - if (node.kind === 70 /* Identifier */ || node.kind === 141 /* QualifiedName */ || node.kind === 177 /* PropertyAccessExpression */) { + if (node.kind === 70 /* Identifier */ || node.kind === 142 /* QualifiedName */ || node.kind === 178 /* PropertyAccessExpression */) { var symbol = typeChecker.getSymbolAtLocation(node); // This is an alias, follow what it aliases if (symbol && symbol.flags & 8388608 /* Alias */) { @@ -67981,11 +73085,11 @@ var ts; } if (jsxContainer = tryGetContainingJsxElement(contextToken)) { var attrsType = void 0; - if ((jsxContainer.kind === 247 /* JsxSelfClosingElement */) || (jsxContainer.kind === 248 /* JsxOpeningElement */)) { + if ((jsxContainer.kind === 249 /* JsxSelfClosingElement */) || (jsxContainer.kind === 250 /* JsxOpeningElement */)) { // Cursor is inside a JSX self-closing element or opening element - attrsType = typeChecker.getJsxElementAttributesType(jsxContainer); + attrsType = typeChecker.getAllAttributesTypeFromJsxOpeningLikeElement(jsxContainer); if (attrsType) { - symbols = filterJsxAttributes(typeChecker.getPropertiesOfType(attrsType), jsxContainer.attributes); + symbols = filterJsxAttributes(typeChecker.getPropertiesOfType(attrsType), jsxContainer.attributes.properties); isMemberCompletion = true; isNewIdentifierLocation = false; return true; @@ -68029,9 +73133,9 @@ var ts; var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; if (scopeNode) { isGlobalCompletion = - scopeNode.kind === 261 /* SourceFile */ || - scopeNode.kind === 194 /* TemplateExpression */ || - scopeNode.kind === 252 /* JsxExpression */ || + scopeNode.kind === 264 /* SourceFile */ || + scopeNode.kind === 195 /* TemplateExpression */ || + scopeNode.kind === 255 /* JsxExpression */ || ts.isStatement(scopeNode); } /// TODO filter meaning based on the current context @@ -68064,11 +73168,11 @@ var ts; return true; } if (contextToken.kind === 28 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 248 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 250 /* JsxOpeningElement */) { return true; } - if (contextToken.parent.kind === 249 /* JsxClosingElement */ || contextToken.parent.kind === 247 /* JsxSelfClosingElement */) { - return contextToken.parent.parent && contextToken.parent.parent.kind === 246 /* JsxElement */; + if (contextToken.parent.kind === 251 /* JsxClosingElement */ || contextToken.parent.kind === 249 /* JsxSelfClosingElement */) { + return contextToken.parent.parent && contextToken.parent.parent.kind === 248 /* JsxElement */; } } return false; @@ -68078,40 +73182,40 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 25 /* CommaToken */: - return containingNodeKind === 179 /* CallExpression */ // func( a, | - || containingNodeKind === 150 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 180 /* NewExpression */ // new C(a, | - || containingNodeKind === 175 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 192 /* BinaryExpression */ // const x = (a, | - || containingNodeKind === 158 /* FunctionType */; // var x: (s: string, list| + return containingNodeKind === 180 /* CallExpression */ // func( a, | + || containingNodeKind === 151 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === 181 /* NewExpression */ // new C(a, | + || containingNodeKind === 176 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 193 /* BinaryExpression */ // const x = (a, | + || containingNodeKind === 159 /* FunctionType */; // var x: (s: string, list| case 18 /* OpenParenToken */: - return containingNodeKind === 179 /* CallExpression */ // func( | - || containingNodeKind === 150 /* Constructor */ // constructor( | - || containingNodeKind === 180 /* NewExpression */ // new C(a| - || containingNodeKind === 183 /* ParenthesizedExpression */ // const x = (a| - || containingNodeKind === 166 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + return containingNodeKind === 180 /* CallExpression */ // func( | + || containingNodeKind === 151 /* Constructor */ // constructor( | + || containingNodeKind === 181 /* NewExpression */ // new C(a| + || containingNodeKind === 184 /* ParenthesizedExpression */ // const x = (a| + || containingNodeKind === 167 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 20 /* OpenBracketToken */: - return containingNodeKind === 175 /* ArrayLiteralExpression */ // [ | - || containingNodeKind === 155 /* IndexSignature */ // [ | : string ] - || containingNodeKind === 142 /* ComputedPropertyName */; // [ | /* this can become an index signature */ + return containingNodeKind === 176 /* ArrayLiteralExpression */ // [ | + || containingNodeKind === 156 /* IndexSignature */ // [ | : string ] + || containingNodeKind === 143 /* ComputedPropertyName */; // [ | /* this can become an index signature */ case 127 /* ModuleKeyword */: // module | case 128 /* NamespaceKeyword */: return true; case 22 /* DotToken */: - return containingNodeKind === 230 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 232 /* ModuleDeclaration */; // module A.| case 16 /* OpenBraceToken */: - return containingNodeKind === 226 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 228 /* ClassDeclaration */; // class A{ | case 57 /* EqualsToken */: - return containingNodeKind === 223 /* VariableDeclaration */ // const x = a| - || containingNodeKind === 192 /* BinaryExpression */; // x = a| + return containingNodeKind === 225 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 193 /* BinaryExpression */; // x = a| case 13 /* TemplateHead */: - return containingNodeKind === 194 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 195 /* TemplateExpression */; // `aa ${| case 14 /* TemplateMiddle */: - return containingNodeKind === 202 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 204 /* TemplateSpan */; // `aa ${10} dd ${| case 113 /* PublicKeyword */: case 111 /* PrivateKeyword */: case 112 /* ProtectedKeyword */: - return containingNodeKind === 147 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 148 /* PropertyDeclaration */; // class A{ public | } // Previous token may have been a keyword that was converted to an identifier. switch (previousToken.getText()) { @@ -68154,7 +73258,7 @@ var ts; isMemberCompletion = true; var typeForObject; var existingMembers; - if (objectLikeContainer.kind === 176 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 177 /* ObjectLiteralExpression */) { // We are completing on contextual types, but may also include properties // other than those within the declared type. isNewIdentifierLocation = true; @@ -68164,7 +73268,7 @@ var ts; typeForObject = typeForObject && typeForObject.getNonNullableType(); existingMembers = objectLikeContainer.properties; } - else if (objectLikeContainer.kind === 172 /* ObjectBindingPattern */) { + else if (objectLikeContainer.kind === 173 /* ObjectBindingPattern */) { // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); @@ -68175,11 +73279,11 @@ var ts; // Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed - // type of parameter will flow in from the contextual type of the function var canGetType = !!(rootDeclaration.initializer || rootDeclaration.type); - if (!canGetType && rootDeclaration.kind === 144 /* Parameter */) { + if (!canGetType && rootDeclaration.kind === 145 /* Parameter */) { if (ts.isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); } - else if (rootDeclaration.parent.kind === 149 /* MethodDeclaration */ || rootDeclaration.parent.kind === 152 /* SetAccessor */) { + else if (rootDeclaration.parent.kind === 150 /* MethodDeclaration */ || rootDeclaration.parent.kind === 153 /* SetAccessor */) { canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -68221,9 +73325,9 @@ var ts; * @returns true if 'symbols' was successfully populated; false otherwise. */ function tryGetImportOrExportClauseCompletionSymbols(namedImportsOrExports) { - var declarationKind = namedImportsOrExports.kind === 238 /* NamedImports */ ? - 235 /* ImportDeclaration */ : - 241 /* ExportDeclaration */; + var declarationKind = namedImportsOrExports.kind === 240 /* NamedImports */ ? + 237 /* ImportDeclaration */ : + 243 /* ExportDeclaration */; var importOrExportDeclaration = ts.getAncestor(namedImportsOrExports, declarationKind); var moduleSpecifier = importOrExportDeclaration.moduleSpecifier; if (!moduleSpecifier) { @@ -68231,12 +73335,13 @@ var ts; } isMemberCompletion = true; isNewIdentifierLocation = false; - var exports; - var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(importOrExportDeclaration.moduleSpecifier); - if (moduleSpecifierSymbol) { - exports = typeChecker.getExportsOfModule(moduleSpecifierSymbol); + var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); + if (!moduleSpecifierSymbol) { + symbols = ts.emptyArray; + return true; } - symbols = exports ? filterNamedImportOrExportCompletionItems(exports, namedImportsOrExports.elements) : ts.emptyArray; + var exports = typeChecker.getExportsAndPropertiesOfModule(moduleSpecifierSymbol); + symbols = filterNamedImportOrExportCompletionItems(exports, namedImportsOrExports.elements); return true; } /** @@ -68248,9 +73353,9 @@ var ts; switch (contextToken.kind) { case 16 /* OpenBraceToken */: // const x = { | case 25 /* CommaToken */: - var parent_15 = contextToken.parent; - if (parent_15 && (parent_15.kind === 176 /* ObjectLiteralExpression */ || parent_15.kind === 172 /* ObjectBindingPattern */)) { - return parent_15; + var parent = contextToken.parent; + if (parent && (parent.kind === 177 /* ObjectLiteralExpression */ || parent.kind === 173 /* ObjectBindingPattern */)) { + return parent; } break; } @@ -68267,8 +73372,8 @@ var ts; case 16 /* OpenBraceToken */: // import { | case 25 /* CommaToken */: switch (contextToken.parent.kind) { - case 238 /* NamedImports */: - case 242 /* NamedExports */: + case 240 /* NamedImports */: + case 244 /* NamedExports */: return contextToken.parent; } } @@ -68277,37 +73382,55 @@ var ts; } function tryGetContainingJsxElement(contextToken) { if (contextToken) { - var parent_16 = contextToken.parent; + var parent = contextToken.parent; switch (contextToken.kind) { case 27 /* LessThanSlashToken */: case 40 /* SlashToken */: case 70 /* Identifier */: - case 250 /* JsxAttribute */: - case 251 /* JsxSpreadAttribute */: - if (parent_16 && (parent_16.kind === 247 /* JsxSelfClosingElement */ || parent_16.kind === 248 /* JsxOpeningElement */)) { - return parent_16; + case 178 /* PropertyAccessExpression */: + case 253 /* JsxAttributes */: + case 252 /* JsxAttribute */: + case 254 /* JsxSpreadAttribute */: + if (parent && (parent.kind === 249 /* JsxSelfClosingElement */ || parent.kind === 250 /* JsxOpeningElement */)) { + return parent; } - else if (parent_16.kind === 250 /* JsxAttribute */) { - return parent_16.parent; + else if (parent.kind === 252 /* JsxAttribute */) { + // Currently we parse JsxOpeningLikeElement as: + // JsxOpeningLikeElement + // attributes: JsxAttributes + // properties: NodeArray + return parent.parent.parent; } break; // The context token is the closing } or " of an attribute, which means // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 9 /* StringLiteral */: - if (parent_16 && ((parent_16.kind === 250 /* JsxAttribute */) || (parent_16.kind === 251 /* JsxSpreadAttribute */))) { - return parent_16.parent; + if (parent && ((parent.kind === 252 /* JsxAttribute */) || (parent.kind === 254 /* JsxSpreadAttribute */))) { + // Currently we parse JsxOpeningLikeElement as: + // JsxOpeningLikeElement + // attributes: JsxAttributes + // properties: NodeArray + return parent.parent.parent; } break; case 17 /* CloseBraceToken */: - if (parent_16 && - parent_16.kind === 252 /* JsxExpression */ && - parent_16.parent && - (parent_16.parent.kind === 250 /* JsxAttribute */)) { - return parent_16.parent.parent; + if (parent && + parent.kind === 255 /* JsxExpression */ && + parent.parent && parent.parent.kind === 252 /* JsxAttribute */) { + // Currently we parse JsxOpeningLikeElement as: + // JsxOpeningLikeElement + // attributes: JsxAttributes + // properties: NodeArray + // each JsxAttribute can have initializer as JsxExpression + return parent.parent.parent.parent; } - if (parent_16 && parent_16.kind === 251 /* JsxSpreadAttribute */) { - return parent_16.parent; + if (parent && parent.kind === 254 /* JsxSpreadAttribute */) { + // Currently we parse JsxOpeningLikeElement as: + // JsxOpeningLikeElement + // attributes: JsxAttributes + // properties: NodeArray + return parent.parent.parent; } break; } @@ -68315,20 +73438,17 @@ var ts; return undefined; } function isFunction(kind) { + if (!ts.isFunctionLikeKind(kind)) { + return false; + } switch (kind) { - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 225 /* FunctionDeclaration */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 155 /* IndexSignature */: + case 151 /* Constructor */: + case 160 /* ConstructorType */: + case 159 /* FunctionType */: + return false; + default: return true; } - return false; } /** * @returns true if we are certain that the currently edited location must define a new location; false otherwise. @@ -68337,66 +73457,66 @@ var ts; var containingNodeKind = contextToken.parent.kind; switch (contextToken.kind) { case 25 /* CommaToken */: - return containingNodeKind === 223 /* VariableDeclaration */ || - containingNodeKind === 224 /* VariableDeclarationList */ || - containingNodeKind === 205 /* VariableStatement */ || - containingNodeKind === 229 /* EnumDeclaration */ || + return containingNodeKind === 225 /* VariableDeclaration */ || + containingNodeKind === 226 /* VariableDeclarationList */ || + containingNodeKind === 207 /* VariableStatement */ || + containingNodeKind === 231 /* EnumDeclaration */ || isFunction(containingNodeKind) || - containingNodeKind === 226 /* ClassDeclaration */ || - containingNodeKind === 197 /* ClassExpression */ || - containingNodeKind === 227 /* InterfaceDeclaration */ || - containingNodeKind === 173 /* ArrayBindingPattern */ || - containingNodeKind === 228 /* TypeAliasDeclaration */; // type Map, K, | + containingNodeKind === 228 /* ClassDeclaration */ || + containingNodeKind === 198 /* ClassExpression */ || + containingNodeKind === 229 /* InterfaceDeclaration */ || + containingNodeKind === 174 /* ArrayBindingPattern */ || + containingNodeKind === 230 /* TypeAliasDeclaration */; // type Map, K, | case 22 /* DotToken */: - return containingNodeKind === 173 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 174 /* ArrayBindingPattern */; // var [.| case 55 /* ColonToken */: - return containingNodeKind === 174 /* BindingElement */; // var {x :html| + return containingNodeKind === 175 /* BindingElement */; // var {x :html| case 20 /* OpenBracketToken */: - return containingNodeKind === 173 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 174 /* ArrayBindingPattern */; // var [x| case 18 /* OpenParenToken */: - return containingNodeKind === 256 /* CatchClause */ || + return containingNodeKind === 259 /* CatchClause */ || isFunction(containingNodeKind); case 16 /* OpenBraceToken */: - return containingNodeKind === 229 /* EnumDeclaration */ || - containingNodeKind === 227 /* InterfaceDeclaration */ || - containingNodeKind === 161 /* TypeLiteral */; // const x : { | + return containingNodeKind === 231 /* EnumDeclaration */ || + containingNodeKind === 229 /* InterfaceDeclaration */ || + containingNodeKind === 162 /* TypeLiteral */; // const x : { | case 24 /* SemicolonToken */: - return containingNodeKind === 146 /* PropertySignature */ && + return containingNodeKind === 147 /* PropertySignature */ && contextToken.parent && contextToken.parent.parent && - (contextToken.parent.parent.kind === 227 /* InterfaceDeclaration */ || - contextToken.parent.parent.kind === 161 /* TypeLiteral */); // const x : { a; | + (contextToken.parent.parent.kind === 229 /* InterfaceDeclaration */ || + contextToken.parent.parent.kind === 162 /* TypeLiteral */); // const x : { a; | case 26 /* LessThanToken */: - return containingNodeKind === 226 /* ClassDeclaration */ || - containingNodeKind === 197 /* ClassExpression */ || - containingNodeKind === 227 /* InterfaceDeclaration */ || - containingNodeKind === 228 /* TypeAliasDeclaration */ || + return containingNodeKind === 228 /* ClassDeclaration */ || + containingNodeKind === 198 /* ClassExpression */ || + containingNodeKind === 229 /* InterfaceDeclaration */ || + containingNodeKind === 230 /* TypeAliasDeclaration */ || isFunction(containingNodeKind); case 114 /* StaticKeyword */: - return containingNodeKind === 147 /* PropertyDeclaration */; + return containingNodeKind === 148 /* PropertyDeclaration */; case 23 /* DotDotDotToken */: - return containingNodeKind === 144 /* Parameter */ || + return containingNodeKind === 145 /* Parameter */ || (contextToken.parent && contextToken.parent.parent && - contextToken.parent.parent.kind === 173 /* ArrayBindingPattern */); // var [...z| + contextToken.parent.parent.kind === 174 /* ArrayBindingPattern */); // var [...z| case 113 /* PublicKeyword */: case 111 /* PrivateKeyword */: case 112 /* ProtectedKeyword */: - return containingNodeKind === 144 /* Parameter */; + return containingNodeKind === 145 /* Parameter */; case 117 /* AsKeyword */: - return containingNodeKind === 239 /* ImportSpecifier */ || - containingNodeKind === 243 /* ExportSpecifier */ || - containingNodeKind === 237 /* NamespaceImport */; + return containingNodeKind === 241 /* ImportSpecifier */ || + containingNodeKind === 245 /* ExportSpecifier */ || + containingNodeKind === 239 /* NamespaceImport */; case 74 /* ClassKeyword */: case 82 /* EnumKeyword */: case 108 /* InterfaceKeyword */: case 88 /* FunctionKeyword */: case 103 /* VarKeyword */: case 124 /* GetKeyword */: - case 133 /* SetKeyword */: + case 134 /* SetKeyword */: case 90 /* ImportKeyword */: case 109 /* LetKeyword */: case 75 /* ConstKeyword */: case 115 /* YieldKeyword */: - case 136 /* TypeKeyword */: + case 137 /* TypeKeyword */: return true; } // Previous token may have been a keyword that was converted to an identifier. @@ -68444,13 +73564,13 @@ var ts; if (element.getStart() <= position && position <= element.getEnd()) { continue; } - var name_44 = element.propertyName || element.name; - existingImportsOrExports[name_44.text] = true; + var name = element.propertyName || element.name; + existingImportsOrExports.set(name.text, true); } - if (!ts.someProperties(existingImportsOrExports)) { + if (existingImportsOrExports.size === 0) { return ts.filter(exportsOfModule, function (e) { return e.name !== "default"; }); } - return ts.filter(exportsOfModule, function (e) { return e.name !== "default" && !existingImportsOrExports[e.name]; }); + return ts.filter(exportsOfModule, function (e) { return e.name !== "default" && !existingImportsOrExports.get(e.name); }); } /** * Filters out completion suggestions for named imports or exports. @@ -68466,12 +73586,12 @@ var ts; for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 257 /* PropertyAssignment */ && - m.kind !== 258 /* ShorthandPropertyAssignment */ && - m.kind !== 174 /* BindingElement */ && - m.kind !== 149 /* MethodDeclaration */ && - m.kind !== 151 /* GetAccessor */ && - m.kind !== 152 /* SetAccessor */) { + if (m.kind !== 260 /* PropertyAssignment */ && + m.kind !== 261 /* ShorthandPropertyAssignment */ && + m.kind !== 175 /* BindingElement */ && + m.kind !== 150 /* MethodDeclaration */ && + m.kind !== 152 /* GetAccessor */ && + m.kind !== 153 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -68479,7 +73599,7 @@ var ts; continue; } var existingName = void 0; - if (m.kind === 174 /* BindingElement */ && m.propertyName) { + if (m.kind === 175 /* BindingElement */ && m.propertyName) { // include only identifiers in completion list if (m.propertyName.kind === 70 /* Identifier */) { existingName = m.propertyName.text; @@ -68491,9 +73611,9 @@ var ts; // things like '__proto__' are not filtered out. existingName = m.name.text; } - existingMemberNames[existingName] = true; + existingMemberNames.set(existingName, true); } - return ts.filter(contextualMemberSymbols, function (m) { return !existingMemberNames[m.name]; }); + return ts.filter(contextualMemberSymbols, function (m) { return !existingMemberNames.get(m.name); }); } /** * Filters out completion suggestions from 'symbols' according to existing JSX attributes. @@ -68509,11 +73629,11 @@ var ts; if (attr.getStart() <= position && position <= attr.getEnd()) { continue; } - if (attr.kind === 250 /* JsxAttribute */) { - seenNames[attr.name.text] = true; + if (attr.kind === 252 /* JsxAttribute */) { + seenNames.set(attr.name.text, true); } } - return ts.filter(symbols, function (a) { return !seenNames[a.name]; }); + return ts.filter(symbols, function (a) { return !seenNames.get(a.name); }); } } /** @@ -68559,7 +73679,7 @@ var ts; } // A cache of completion entries for keywords, these do not change between sessions var keywordCompletions = []; - for (var i = 71 /* FirstKeyword */; i <= 140 /* LastKeyword */; i++) { + for (var i = 71 /* FirstKeyword */; i <= 141 /* LastKeyword */; i++) { keywordCompletions.push({ name: ts.tokenToString(i), kind: ts.ScriptElementKind.keyword, @@ -68567,49 +73687,14 @@ var ts; sortText: "0" }); } - /** - * Matches a triple slash reference directive with an incomplete string literal for its path. Used - * to determine if the caret is currently within the string literal and capture the literal fragment - * for completions. - * For example, this matches - * - * /// = 0; i--) { - if (pushKeywordIf(keywords, loopTokens[i], 105 /* WhileKeyword */)) { - break; - } - } - } - } - var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); - ts.forEach(breaksAndContinues, function (statement) { - if (ownsBreakOrContinueStatement(loopNode, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 71 /* BreakKeyword */, 76 /* ContinueKeyword */); - } - }); - return ts.map(keywords, getHighlightSpanForNode); - } - function getBreakOrContinueStatementOccurrences(breakOrContinueStatement) { - var owner = getBreakOrContinueOwner(breakOrContinueStatement); - if (owner) { - switch (owner.kind) { - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 209 /* DoStatement */: - case 210 /* WhileStatement */: - return getLoopBreakContinueOccurrences(owner); - case 218 /* SwitchStatement */: - return getSwitchCaseDefaultOccurrences(owner); - } - } - return undefined; - } - function getSwitchCaseDefaultOccurrences(switchStatement) { - var keywords = []; - pushKeywordIf(keywords, switchStatement.getFirstToken(), 97 /* SwitchKeyword */); - // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. - ts.forEach(switchStatement.caseBlock.clauses, function (clause) { - pushKeywordIf(keywords, clause.getFirstToken(), 72 /* CaseKeyword */, 78 /* DefaultKeyword */); - var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); - ts.forEach(breaksAndContinues, function (statement) { - if (ownsBreakOrContinueStatement(switchStatement, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 71 /* BreakKeyword */); - } - }); - }); - return ts.map(keywords, getHighlightSpanForNode); - } - function getTryCatchFinallyOccurrences(tryStatement) { - var keywords = []; - pushKeywordIf(keywords, tryStatement.getFirstToken(), 101 /* TryKeyword */); - if (tryStatement.catchClause) { - pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 73 /* CatchKeyword */); + // Exceptions thrown within a try block lacking a catch clause + // are "owned" in the current context. + aggregate(tryStatement.tryBlock); } if (tryStatement.finallyBlock) { - var finallyKeyword = ts.findChildOfKind(tryStatement, 86 /* FinallyKeyword */, sourceFile); - pushKeywordIf(keywords, finallyKeyword, 86 /* FinallyKeyword */); + aggregate(tryStatement.finallyBlock); } - return ts.map(keywords, getHighlightSpanForNode); } - function getThrowOccurrences(throwStatement) { - var owner = getThrowStatementOwner(throwStatement); - if (!owner) { - return undefined; - } - var keywords = []; - ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 99 /* ThrowKeyword */); - }); - // If the "owner" is a function, then we equate 'return' and 'throw' statements in their - // ability to "jump out" of the function, and include occurrences for both. - if (ts.isFunctionBlock(owner)) { - ts.forEachReturnStatement(owner, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 95 /* ReturnKeyword */); - }); - } - return ts.map(keywords, getHighlightSpanForNode); - } - function getReturnOccurrences(returnStatement) { - var func = ts.getContainingFunction(returnStatement); - // If we didn't find a containing function with a block body, bail out. - if (!(func && hasKind(func.body, 204 /* Block */))) { - return undefined; - } - var keywords = []; - ts.forEachReturnStatement(func.body, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 95 /* ReturnKeyword */); - }); - // Include 'throw' statements that do not occur within a try block. - ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 99 /* ThrowKeyword */); - }); - return ts.map(keywords, getHighlightSpanForNode); - } - function getIfElseOccurrences(ifStatement) { - var keywords = []; - // Traverse upwards through all parent if-statements linked by their else-branches. - while (hasKind(ifStatement.parent, 208 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { - ifStatement = ifStatement.parent; - } - // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. - while (ifStatement) { - var children = ifStatement.getChildren(); - pushKeywordIf(keywords, children[0], 89 /* IfKeyword */); - // Generally the 'else' keyword is second-to-last, so we traverse backwards. - for (var i = children.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, children[i], 81 /* ElseKeyword */)) { - break; - } - } - if (!hasKind(ifStatement.elseStatement, 208 /* IfStatement */)) { - break; - } - ifStatement = ifStatement.elseStatement; - } - var result = []; - // We'd like to highlight else/ifs together if they are only separated by whitespace - // (i.e. the keywords are separated by no comments, no newlines). - for (var i = 0; i < keywords.length; i++) { - if (keywords[i].kind === 81 /* ElseKeyword */ && i < keywords.length - 1) { - var elseKeyword = keywords[i]; - var ifKeyword = keywords[i + 1]; // this *should* always be an 'if' keyword. - var shouldCombindElseAndIf = true; - // Avoid recalculating getStart() by iterating backwards. - for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { - if (!ts.isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(j))) { - shouldCombindElseAndIf = false; - break; - } - } - if (shouldCombindElseAndIf) { - result.push({ - fileName: fileName, - textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), - kind: ts.HighlightSpanKind.reference - }); - i++; // skip the next keyword - continue; - } - } - // Ordinary case: just highlight the keyword. - result.push(getHighlightSpanForNode(keywords[i])); - } - return result; + else if (!ts.isFunctionLike(node)) { + ts.forEachChild(node, aggregate); } } } - DocumentHighlights.getDocumentHighlights = getDocumentHighlights; + /** + * For lack of a better name, this function takes a throw statement and returns the + * nearest ancestor that is a try-block (whose try statement has a catch clause), + * function-block, or source file. + */ + function getThrowStatementOwner(throwStatement) { + var child = throwStatement; + while (child.parent) { + var parent_2 = child.parent; + if (ts.isFunctionBlock(parent_2) || parent_2.kind === 264 /* SourceFile */) { + return parent_2; + } + // A throw-statement is only owned by a try-statement if the try-statement has + // a catch clause, and if the throw-statement occurs within the try block. + if (parent_2.kind === 223 /* TryStatement */) { + var tryStatement = parent_2; + if (tryStatement.tryBlock === child && tryStatement.catchClause) { + return child; + } + } + child = parent_2; + } + return undefined; + } + function aggregateAllBreakAndContinueStatements(node) { + var statementAccumulator = []; + aggregate(node); + return statementAccumulator; + function aggregate(node) { + if (node.kind === 217 /* BreakStatement */ || node.kind === 216 /* ContinueStatement */) { + statementAccumulator.push(node); + } + else if (!ts.isFunctionLike(node)) { + ts.forEachChild(node, aggregate); + } + } + } + function ownsBreakOrContinueStatement(owner, statement) { + var actualOwner = getBreakOrContinueOwner(statement); + return actualOwner && actualOwner === owner; + } + function getBreakOrContinueOwner(statement) { + for (var node = statement.parent; node; node = node.parent) { + switch (node.kind) { + case 220 /* SwitchStatement */: + if (statement.kind === 216 /* ContinueStatement */) { + continue; + } + // falls through + case 213 /* ForStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: + case 212 /* WhileStatement */: + case 211 /* DoStatement */: + if (!statement.label || isLabeledBy(node, statement.label.text)) { + return node; + } + break; + default: + // Don't cross function boundaries. + if (ts.isFunctionLike(node)) { + return undefined; + } + break; + } + } + return undefined; + } + function getModifierOccurrences(modifier, declaration) { + var container = declaration.parent; + // Make sure we only highlight the keyword when it makes sense to do so. + if (ts.isAccessibilityModifier(modifier)) { + if (!(container.kind === 228 /* ClassDeclaration */ || + container.kind === 198 /* ClassExpression */ || + (declaration.kind === 145 /* Parameter */ && hasKind(container, 151 /* Constructor */)))) { + return undefined; + } + } + else if (modifier === 114 /* StaticKeyword */) { + if (!(container.kind === 228 /* ClassDeclaration */ || container.kind === 198 /* ClassExpression */)) { + return undefined; + } + } + else if (modifier === 83 /* ExportKeyword */ || modifier === 123 /* DeclareKeyword */) { + if (!(container.kind === 233 /* ModuleBlock */ || container.kind === 264 /* SourceFile */)) { + return undefined; + } + } + else if (modifier === 116 /* AbstractKeyword */) { + if (!(container.kind === 228 /* ClassDeclaration */ || declaration.kind === 228 /* ClassDeclaration */)) { + return undefined; + } + } + else { + // unsupported modifier + return undefined; + } + var keywords = []; + var modifierFlag = getFlagFromModifier(modifier); + var nodes; + switch (container.kind) { + case 233 /* ModuleBlock */: + case 264 /* SourceFile */: + // Container is either a class declaration or the declaration is a classDeclaration + if (modifierFlag & 128 /* Abstract */) { + nodes = declaration.members.concat(declaration); + } + else { + nodes = container.statements; + } + break; + case 151 /* Constructor */: + nodes = container.parameters.concat(container.parent.members); + break; + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + nodes = container.members; + // If we're an accessibility modifier, we're in an instance member and should search + // the constructor's parameter list for instance members as well. + if (modifierFlag & 28 /* AccessibilityModifier */) { + var constructor = ts.forEach(container.members, function (member) { + return member.kind === 151 /* Constructor */ && member; + }); + if (constructor) { + nodes = nodes.concat(constructor.parameters); + } + } + else if (modifierFlag & 128 /* Abstract */) { + nodes = nodes.concat(container); + } + break; + default: + ts.Debug.fail("Invalid container kind."); + } + ts.forEach(nodes, function (node) { + if (ts.getModifierFlags(node) & modifierFlag) { + ts.forEach(node.modifiers, function (child) { return pushKeywordIf(keywords, child, modifier); }); + } + }); + return keywords; + function getFlagFromModifier(modifier) { + switch (modifier) { + case 113 /* PublicKeyword */: + return 4 /* Public */; + case 111 /* PrivateKeyword */: + return 8 /* Private */; + case 112 /* ProtectedKeyword */: + return 16 /* Protected */; + case 114 /* StaticKeyword */: + return 32 /* Static */; + case 83 /* ExportKeyword */: + return 1 /* Export */; + case 123 /* DeclareKeyword */: + return 2 /* Ambient */; + case 116 /* AbstractKeyword */: + return 128 /* Abstract */; + default: + ts.Debug.fail(); + } + } + } + function pushKeywordIf(keywordList, token) { + var expected = []; + for (var _i = 2; _i < arguments.length; _i++) { + expected[_i - 2] = arguments[_i]; + } + if (token && ts.contains(expected, token.kind)) { + keywordList.push(token); + return true; + } + return false; + } + function getGetAndSetOccurrences(accessorDeclaration) { + var keywords = []; + tryPushAccessorKeyword(accessorDeclaration.symbol, 152 /* GetAccessor */); + tryPushAccessorKeyword(accessorDeclaration.symbol, 153 /* SetAccessor */); + return keywords; + function tryPushAccessorKeyword(accessorSymbol, accessorKind) { + var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); + if (accessor) { + ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 124 /* GetKeyword */, 134 /* SetKeyword */); }); + } + } + } + function getConstructorOccurrences(constructorDeclaration) { + var declarations = constructorDeclaration.symbol.getDeclarations(); + var keywords = []; + ts.forEach(declarations, function (declaration) { + ts.forEach(declaration.getChildren(), function (token) { + return pushKeywordIf(keywords, token, 122 /* ConstructorKeyword */); + }); + }); + return keywords; + } + function getLoopBreakContinueOccurrences(loopNode) { + var keywords = []; + if (pushKeywordIf(keywords, loopNode.getFirstToken(), 87 /* ForKeyword */, 105 /* WhileKeyword */, 80 /* DoKeyword */)) { + // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. + if (loopNode.kind === 211 /* DoStatement */) { + var loopTokens = loopNode.getChildren(); + for (var i = loopTokens.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, loopTokens[i], 105 /* WhileKeyword */)) { + break; + } + } + } + } + var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); + ts.forEach(breaksAndContinues, function (statement) { + if (ownsBreakOrContinueStatement(loopNode, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), 71 /* BreakKeyword */, 76 /* ContinueKeyword */); + } + }); + return keywords; + } + function getBreakOrContinueStatementOccurrences(breakOrContinueStatement) { + var owner = getBreakOrContinueOwner(breakOrContinueStatement); + if (owner) { + switch (owner.kind) { + case 213 /* ForStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: + case 211 /* DoStatement */: + case 212 /* WhileStatement */: + return getLoopBreakContinueOccurrences(owner); + case 220 /* SwitchStatement */: + return getSwitchCaseDefaultOccurrences(owner); + } + } + return undefined; + } + function getSwitchCaseDefaultOccurrences(switchStatement) { + var keywords = []; + pushKeywordIf(keywords, switchStatement.getFirstToken(), 97 /* SwitchKeyword */); + // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. + ts.forEach(switchStatement.caseBlock.clauses, function (clause) { + pushKeywordIf(keywords, clause.getFirstToken(), 72 /* CaseKeyword */, 78 /* DefaultKeyword */); + var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); + ts.forEach(breaksAndContinues, function (statement) { + if (ownsBreakOrContinueStatement(switchStatement, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), 71 /* BreakKeyword */); + } + }); + }); + return keywords; + } + function getTryCatchFinallyOccurrences(tryStatement, sourceFile) { + var keywords = []; + pushKeywordIf(keywords, tryStatement.getFirstToken(), 101 /* TryKeyword */); + if (tryStatement.catchClause) { + pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 73 /* CatchKeyword */); + } + if (tryStatement.finallyBlock) { + var finallyKeyword = ts.findChildOfKind(tryStatement, 86 /* FinallyKeyword */, sourceFile); + pushKeywordIf(keywords, finallyKeyword, 86 /* FinallyKeyword */); + } + return keywords; + } + function getThrowOccurrences(throwStatement) { + var owner = getThrowStatementOwner(throwStatement); + if (!owner) { + return undefined; + } + var keywords = []; + ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { + pushKeywordIf(keywords, throwStatement.getFirstToken(), 99 /* ThrowKeyword */); + }); + // If the "owner" is a function, then we equate 'return' and 'throw' statements in their + // ability to "jump out" of the function, and include occurrences for both. + if (ts.isFunctionBlock(owner)) { + ts.forEachReturnStatement(owner, function (returnStatement) { + pushKeywordIf(keywords, returnStatement.getFirstToken(), 95 /* ReturnKeyword */); + }); + } + return keywords; + } + function getReturnOccurrences(returnStatement) { + var func = ts.getContainingFunction(returnStatement); + // If we didn't find a containing function with a block body, bail out. + if (!(func && hasKind(func.body, 206 /* Block */))) { + return undefined; + } + var keywords = []; + ts.forEachReturnStatement(func.body, function (returnStatement) { + pushKeywordIf(keywords, returnStatement.getFirstToken(), 95 /* ReturnKeyword */); + }); + // Include 'throw' statements that do not occur within a try block. + ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { + pushKeywordIf(keywords, throwStatement.getFirstToken(), 99 /* ThrowKeyword */); + }); + return keywords; + } + function getIfElseOccurrences(ifStatement, sourceFile) { + var keywords = []; + // Traverse upwards through all parent if-statements linked by their else-branches. + while (hasKind(ifStatement.parent, 210 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { + ifStatement = ifStatement.parent; + } + // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. + while (ifStatement) { + var children = ifStatement.getChildren(); + pushKeywordIf(keywords, children[0], 89 /* IfKeyword */); + // Generally the 'else' keyword is second-to-last, so we traverse backwards. + for (var i = children.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, children[i], 81 /* ElseKeyword */)) { + break; + } + } + if (!hasKind(ifStatement.elseStatement, 210 /* IfStatement */)) { + break; + } + ifStatement = ifStatement.elseStatement; + } + var result = []; + // We'd like to highlight else/ifs together if they are only separated by whitespace + // (i.e. the keywords are separated by no comments, no newlines). + for (var i = 0; i < keywords.length; i++) { + if (keywords[i].kind === 81 /* ElseKeyword */ && i < keywords.length - 1) { + var elseKeyword = keywords[i]; + var ifKeyword = keywords[i + 1]; // this *should* always be an 'if' keyword. + var shouldCombindElseAndIf = true; + // Avoid recalculating getStart() by iterating backwards. + for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { + if (!ts.isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(j))) { + shouldCombindElseAndIf = false; + break; + } + } + if (shouldCombindElseAndIf) { + result.push({ + fileName: sourceFile.fileName, + textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), + kind: ts.HighlightSpanKind.reference + }); + i++; // skip the next keyword + continue; + } + } + // Ordinary case: just highlight the keyword. + result.push(getHighlightSpanForNode(keywords[i], sourceFile)); + } + return result; + } /** * Whether or not a 'node' is preceded by a label of the given string. * Note: 'node' cannot be a SourceFile. */ function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 219 /* LabeledStatement */; owner = owner.parent) { + for (var owner = node.parent; owner.kind === 221 /* LabeledStatement */; owner = owner.parent) { if (owner.label.text === labelName) { return true; } @@ -69168,15 +74232,15 @@ var ts; return "_" + settings.target + "|" + settings.module + "|" + settings.noResolve + "|" + settings.jsx + "|" + settings.allowJs + "|" + settings.baseUrl + "|" + JSON.stringify(settings.typeRoots) + "|" + JSON.stringify(settings.rootDirs) + "|" + JSON.stringify(settings.paths); } function getBucketForCompilationSettings(key, createIfMissing) { - var bucket = buckets[key]; + var bucket = buckets.get(key); if (!bucket && createIfMissing) { - buckets[key] = bucket = ts.createFileMap(); + buckets.set(key, bucket = ts.createFileMap()); } return bucket; } function reportStats() { - var bucketInfoArray = Object.keys(buckets).filter(function (name) { return name && name.charAt(0) === "_"; }).map(function (name) { - var entries = buckets[name]; + var bucketInfoArray = ts.arrayFrom(buckets.keys()).filter(function (name) { return name && name.charAt(0) === "_"; }).map(function (name) { + var entries = buckets.get(name); var sourceFiles = []; entries.forEachValue(function (key, entry) { sourceFiles.push({ @@ -69269,41 +74333,764 @@ var ts; } ts.createDocumentRegistry = createDocumentRegistry; })(ts || (ts = {})); +/* Code for finding imports of an exported symbol. Used only by FindAllReferences. */ /* @internal */ var ts; (function (ts) { var FindAllReferences; (function (FindAllReferences) { - function findReferencedSymbols(typeChecker, cancellationToken, sourceFiles, sourceFile, position, findInStrings, findInComments) { - var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); - if (node === sourceFile) { + /** Creates the imports map and returns an ImportTracker that uses it. Call this lazily to avoid calling `getDirectImportsMap` unnecessarily. */ + function createImportTracker(sourceFiles, checker, cancellationToken) { + var allDirectImports = getDirectImportsMap(sourceFiles, checker, cancellationToken); + return function (exportSymbol, exportInfo, isForRename) { + var _a = getImportersForExport(sourceFiles, allDirectImports, exportInfo, checker, cancellationToken), directImports = _a.directImports, indirectUsers = _a.indirectUsers; + return __assign({ indirectUsers: indirectUsers }, getSearchesFromDirectImports(directImports, exportSymbol, exportInfo.exportKind, checker, isForRename)); + }; + } + FindAllReferences.createImportTracker = createImportTracker; + var ExportKind; + (function (ExportKind) { + ExportKind[ExportKind["Named"] = 0] = "Named"; + ExportKind[ExportKind["Default"] = 1] = "Default"; + ExportKind[ExportKind["ExportEquals"] = 2] = "ExportEquals"; + })(ExportKind = FindAllReferences.ExportKind || (FindAllReferences.ExportKind = {})); + var ImportExport; + (function (ImportExport) { + ImportExport[ImportExport["Import"] = 0] = "Import"; + ImportExport[ImportExport["Export"] = 1] = "Export"; + })(ImportExport = FindAllReferences.ImportExport || (FindAllReferences.ImportExport = {})); + /** Returns import statements that directly reference the exporting module, and a list of files that may access the module through a namespace. */ + function getImportersForExport(sourceFiles, allDirectImports, _a, checker, cancellationToken) { + var exportingModuleSymbol = _a.exportingModuleSymbol, exportKind = _a.exportKind; + var markSeenDirectImport = ts.nodeSeenTracker(); + var markSeenIndirectUser = ts.nodeSeenTracker(); + var directImports = []; + var isAvailableThroughGlobal = !!exportingModuleSymbol.globalExports; + var indirectUserDeclarations = isAvailableThroughGlobal ? undefined : []; + handleDirectImports(exportingModuleSymbol); + return { directImports: directImports, indirectUsers: getIndirectUsers() }; + function getIndirectUsers() { + if (isAvailableThroughGlobal) { + // It has `export as namespace`, so anything could potentially use it. + return sourceFiles; + } + // Module augmentations may use this module's exports without importing it. + for (var _i = 0, _a = exportingModuleSymbol.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + if (ts.isExternalModuleAugmentation(decl)) { + addIndirectUser(decl); + } + } + // This may return duplicates (if there are multiple module declarations in a single source file, all importing the same thing as a namespace), but `State.markSearchedSymbol` will handle that. + return indirectUserDeclarations.map(ts.getSourceFileOfNode); + } + function handleDirectImports(exportingModuleSymbol) { + var theseDirectImports = getDirectImports(exportingModuleSymbol); + if (theseDirectImports) + for (var _i = 0, theseDirectImports_1 = theseDirectImports; _i < theseDirectImports_1.length; _i++) { + var direct = theseDirectImports_1[_i]; + if (!markSeenDirectImport(direct)) { + continue; + } + cancellationToken.throwIfCancellationRequested(); + switch (direct.kind) { + case 180 /* CallExpression */: + if (!isAvailableThroughGlobal) { + var parent = direct.parent; + if (exportKind === 2 /* ExportEquals */ && parent.kind === 225 /* VariableDeclaration */) { + var name = parent.name; + if (name.kind === 70 /* Identifier */) { + directImports.push(name); + break; + } + } + // Don't support re-exporting 'require()' calls, so just add a single indirect user. + addIndirectUser(direct.getSourceFile()); + } + break; + case 236 /* ImportEqualsDeclaration */: + handleNamespaceImport(direct, direct.name, ts.hasModifier(direct, 1 /* Export */)); + break; + case 237 /* ImportDeclaration */: + var namedBindings = direct.importClause && direct.importClause.namedBindings; + if (namedBindings && namedBindings.kind === 239 /* NamespaceImport */) { + handleNamespaceImport(direct, namedBindings.name); + } + else { + directImports.push(direct); + } + break; + case 243 /* ExportDeclaration */: + if (!direct.exportClause) { + // This is `export * from "foo"`, so imports of this module may import the export too. + handleDirectImports(getContainingModuleSymbol(direct, checker)); + } + else { + // This is `export { foo } from "foo"` and creates an alias symbol, so recursive search will get handle re-exports. + directImports.push(direct); + } + break; + } + } + } + function handleNamespaceImport(importDeclaration, name, isReExport) { + if (exportKind === 2 /* ExportEquals */) { + // This is a direct import, not import-as-namespace. + directImports.push(importDeclaration); + } + else if (!isAvailableThroughGlobal) { + var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); + ts.Debug.assert(sourceFileLike.kind === 264 /* SourceFile */ || sourceFileLike.kind === 232 /* ModuleDeclaration */); + if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { + addIndirectUsers(sourceFileLike); + } + else { + addIndirectUser(sourceFileLike); + } + } + } + function addIndirectUser(sourceFileLike) { + ts.Debug.assert(!isAvailableThroughGlobal); + var isNew = markSeenIndirectUser(sourceFileLike); + if (isNew) { + indirectUserDeclarations.push(sourceFileLike); + } + return isNew; + } + /** Adds a module and all of its transitive dependencies as possible indirect users. */ + function addIndirectUsers(sourceFileLike) { + if (!addIndirectUser(sourceFileLike)) { + return; + } + var moduleSymbol = checker.getMergedSymbol(sourceFileLike.symbol); + ts.Debug.assert(!!(moduleSymbol.flags & 1536 /* Module */)); + var directImports = getDirectImports(moduleSymbol); + if (directImports) + for (var _i = 0, directImports_1 = directImports; _i < directImports_1.length; _i++) { + var directImport = directImports_1[_i]; + addIndirectUsers(getSourceFileLikeForImportDeclaration(directImport)); + } + } + function getDirectImports(moduleSymbol) { + return allDirectImports.get(ts.getSymbolId(moduleSymbol).toString()); + } + } + /** + * Given the set of direct imports of a module, we need to find which ones import the particular exported symbol. + * The returned `importSearches` will result in the entire source file being searched. + * But re-exports will be placed in 'singleReferences' since they cannot be locally referenced. + */ + function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, checker, isForRename) { + var exportName = exportSymbol.name; + var importSearches = []; + var singleReferences = []; + function addSearch(location, symbol) { + importSearches.push([location, symbol]); + } + if (directImports) + for (var _i = 0, directImports_2 = directImports; _i < directImports_2.length; _i++) { + var decl = directImports_2[_i]; + handleImport(decl); + } + return { importSearches: importSearches, singleReferences: singleReferences }; + function handleImport(decl) { + if (decl.kind === 236 /* ImportEqualsDeclaration */) { + if (isExternalModuleImportEquals(decl)) { + handleNamespaceImportLike(decl.name); + } + return; + } + if (decl.kind === 70 /* Identifier */) { + handleNamespaceImportLike(decl); + return; + } + // Ignore if there's a grammar error + if (decl.moduleSpecifier.kind !== 9 /* StringLiteral */) { + return; + } + if (decl.kind === 243 /* ExportDeclaration */) { + searchForNamedImport(decl.exportClause); + return; + } + var importClause = decl.importClause; + var namedBindings = importClause.namedBindings; + if (namedBindings && namedBindings.kind === 239 /* NamespaceImport */) { + handleNamespaceImportLike(namedBindings.name); + return; + } + if (exportKind === 0 /* Named */) { + searchForNamedImport(namedBindings); + } + else { + // `export =` might be imported by a default import if `--allowSyntheticDefaultImports` is on, so this handles both ExportKind.Default and ExportKind.ExportEquals + var name = importClause.name; + // If a default import has the same name as the default export, allow to rename it. + // Given `import f` and `export default function f`, we will rename both, but for `import g` we will rename just that. + if (name && (!isForRename || name.text === symbolName(exportSymbol))) { + var defaultImportAlias = checker.getSymbolAtLocation(name); + addSearch(name, defaultImportAlias); + } + // 'default' might be accessed as a named import `{ default as foo }`. + if (!isForRename && exportKind === 1 /* Default */) { + ts.Debug.assert(exportName === "default"); + searchForNamedImport(namedBindings); + } + } + } + /** + * `import x = require("./x") or `import * as x from "./x"`. + * An `export =` may be imported by this syntax, so it may be a direct import. + * If it's not a direct import, it will be in `indirectUsers`, so we don't have to do anything here. + */ + function handleNamespaceImportLike(importName) { + // Don't rename an import that already has a different name than the export. + if (exportKind === 2 /* ExportEquals */ && (!isForRename || importName.text === exportName)) { + addSearch(importName, checker.getSymbolAtLocation(importName)); + } + } + function searchForNamedImport(namedBindings) { + if (namedBindings) + for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { + var element = _a[_i]; + var name = element.name, propertyName = element.propertyName; + if ((propertyName || name).text !== exportName) { + continue; + } + if (propertyName) { + // This is `import { foo as bar } from "./a"` or `export { foo as bar } from "./a"`. `foo` isn't a local in the file, so just add it as a single reference. + singleReferences.push(propertyName); + if (!isForRename) { + // Search locally for `bar`. + addSearch(name, checker.getSymbolAtLocation(name)); + } + } + else { + var localSymbol = element.kind === 245 /* ExportSpecifier */ && element.propertyName + ? checker.getExportSpecifierLocalTargetSymbol(element) // For re-exporting under a different name, we want to get the re-exported symbol. + : checker.getSymbolAtLocation(name); + addSearch(name, localSymbol); + } + } + } + } + /** Returns 'true' is the namespace 'name' is re-exported from this module, and 'false' if it is only used locally. */ + function findNamespaceReExports(sourceFileLike, name, checker) { + var namespaceImportSymbol = checker.getSymbolAtLocation(name); + return forEachPossibleImportOrExportStatement(sourceFileLike, function (statement) { + if (statement.kind !== 243 /* ExportDeclaration */) + return; + var _a = statement, exportClause = _a.exportClause, moduleSpecifier = _a.moduleSpecifier; + if (moduleSpecifier || !exportClause) + return; + for (var _i = 0, _b = exportClause.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (checker.getExportSpecifierLocalTargetSymbol(element) === namespaceImportSymbol) { + return true; + } + } + }); + } + /** Returns a map from a module symbol Id to all import statements that directly reference the module. */ + function getDirectImportsMap(sourceFiles, checker, cancellationToken) { + var map = ts.createMap(); + for (var _i = 0, sourceFiles_4 = sourceFiles; _i < sourceFiles_4.length; _i++) { + var sourceFile = sourceFiles_4[_i]; + cancellationToken.throwIfCancellationRequested(); + forEachImport(sourceFile, function (importDecl, moduleSpecifier) { + var moduleSymbol = checker.getSymbolAtLocation(moduleSpecifier); + if (moduleSymbol) { + var id = ts.getSymbolId(moduleSymbol).toString(); + var imports = map.get(id); + if (!imports) { + map.set(id, imports = []); + } + imports.push(importDecl); + } + }); + } + return map; + } + /** Iterates over all statements at the top level or in module declarations. Returns the first truthy result. */ + function forEachPossibleImportOrExportStatement(sourceFileLike, action) { + return ts.forEach(sourceFileLike.kind === 264 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); + }); + } + /** Calls `action` for each import, re-export, or require() in a file. */ + function forEachImport(sourceFile, action) { + if (sourceFile.externalModuleIndicator) { + for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { + var moduleSpecifier = _a[_i]; + action(importerFromModuleSpecifier(moduleSpecifier), moduleSpecifier); + } + } + else { + forEachPossibleImportOrExportStatement(sourceFile, function (statement) { + switch (statement.kind) { + case 243 /* ExportDeclaration */: + case 237 /* ImportDeclaration */: { + var decl = statement; + if (decl.moduleSpecifier && decl.moduleSpecifier.kind === 9 /* StringLiteral */) { + action(decl, decl.moduleSpecifier); + } + break; + } + case 236 /* ImportEqualsDeclaration */: { + var decl = statement; + var moduleReference = decl.moduleReference; + if (moduleReference.kind === 247 /* ExternalModuleReference */ && + moduleReference.expression.kind === 9 /* StringLiteral */) { + action(decl, moduleReference.expression); + } + break; + } + } + }); + if (sourceFile.flags & 65536 /* JavaScriptFile */) { + // Find all 'require()' calls. + sourceFile.forEachChild(function recur(node) { + if (ts.isRequireCall(node, /*checkArgumentIsStringLiteral*/ true)) { + action(node, node.arguments[0]); + } + else { + node.forEachChild(recur); + } + }); + } + } + } + function importerFromModuleSpecifier(moduleSpecifier) { + var decl = moduleSpecifier.parent; + if (decl.kind === 237 /* ImportDeclaration */ || decl.kind === 243 /* ExportDeclaration */) { + return decl; + } + ts.Debug.assert(decl.kind === 247 /* ExternalModuleReference */); + return decl.parent; + } + /** + * Given a local reference, we might notice that it's an import/export and recursively search for references of that. + * If at an import, look locally for the symbol it imports. + * If an an export, look for all imports of it. + * This doesn't handle export specifiers; that is done in `getReferencesAtExportSpecifier`. + * @param comingFromExport If we are doing a search for all exports, don't bother looking backwards for the imported symbol, since that's the reason we're here. + */ + function getImportOrExportSymbol(node, symbol, checker, comingFromExport) { + return comingFromExport ? getExport() : getExport() || getImport(); + function getExport() { + var parent = node.parent; + if (symbol.flags & 7340032 /* Export */) { + if (parent.kind === 178 /* PropertyAccessExpression */) { + // When accessing an export of a JS module, there's no alias. The symbol will still be flagged as an export even though we're at the use. + // So check that we are at the declaration. + return symbol.declarations.some(function (d) { return d === parent; }) && parent.parent.kind === 193 /* BinaryExpression */ + ? getSpecialPropertyExport(parent.parent, /*useLhsSymbol*/ false) + : undefined; + } + else { + var exportSymbol = symbol.exportSymbol; + ts.Debug.assert(!!exportSymbol); + return exportInfo(exportSymbol, getExportKindForDeclaration(parent)); + } + } + else { + var exportNode = parent.kind === 225 /* VariableDeclaration */ ? ts.getAncestor(parent, 207 /* VariableStatement */) : parent; + if (ts.hasModifier(exportNode, 1 /* Export */)) { + if (exportNode.kind === 236 /* ImportEqualsDeclaration */ && exportNode.moduleReference === node) { + // We're at `Y` in `export import X = Y`. This is not the exported symbol, the left-hand-side is. So treat this as an import statement. + if (comingFromExport) { + return undefined; + } + var lhsSymbol = checker.getSymbolAtLocation(exportNode.name); + return { kind: 0 /* Import */, symbol: lhsSymbol, isNamedImport: false }; + } + else { + return exportInfo(symbol, getExportKindForDeclaration(exportNode)); + } + } + else if (parent.kind === 242 /* ExportAssignment */) { + // Get the symbol for the `export =` node; its parent is the module it's the export of. + var exportingModuleSymbol = parent.symbol.parent; + ts.Debug.assert(!!exportingModuleSymbol); + return { kind: 1 /* Export */, symbol: symbol, exportInfo: { exportingModuleSymbol: exportingModuleSymbol, exportKind: 2 /* ExportEquals */ } }; + } + else if (parent.kind === 193 /* BinaryExpression */) { + return getSpecialPropertyExport(parent, /*useLhsSymbol*/ true); + } + else if (parent.parent.kind === 193 /* BinaryExpression */) { + return getSpecialPropertyExport(parent.parent, /*useLhsSymbol*/ true); + } + } + function getSpecialPropertyExport(node, useLhsSymbol) { + var kind; + switch (ts.getSpecialPropertyAssignmentKind(node)) { + case 1 /* ExportsProperty */: + kind = 0 /* Named */; + break; + case 2 /* ModuleExports */: + kind = 2 /* ExportEquals */; + break; + default: + return undefined; + } + var sym = useLhsSymbol ? checker.getSymbolAtLocation(node.left.name) : symbol; + return sym && exportInfo(sym, kind); + } + } + function getImport() { + var isImport = isNodeImport(node); + if (!isImport) + return; + // A symbol being imported is always an alias. So get what that aliases to find the local symbol. + var importedSymbol = checker.getImmediateAliasedSymbol(symbol); + if (importedSymbol) { + // Search on the local symbol in the exporting module, not the exported symbol. + importedSymbol = skipExportSpecifierSymbol(importedSymbol, checker); + // Similarly, skip past the symbol for 'export =' + if (importedSymbol.name === "export=") { + importedSymbol = checker.getImmediateAliasedSymbol(importedSymbol); + } + if (symbolName(importedSymbol) === symbol.name) { + return __assign({ kind: 0 /* Import */, symbol: importedSymbol }, isImport); + } + } + } + function exportInfo(symbol, kind) { + var exportInfo = getExportInfo(symbol, kind, checker); + return exportInfo && { kind: 1 /* Export */, symbol: symbol, exportInfo: exportInfo }; + } + // Not meant for use with export specifiers or export assignment. + function getExportKindForDeclaration(node) { + return ts.hasModifier(node, 512 /* Default */) ? 1 /* Default */ : 0 /* Named */; + } + } + FindAllReferences.getImportOrExportSymbol = getImportOrExportSymbol; + function isNodeImport(node) { + var parent = node.parent; + switch (parent.kind) { + case 236 /* ImportEqualsDeclaration */: + return parent.name === node && isExternalModuleImportEquals(parent) + ? { isNamedImport: false } + : undefined; + case 241 /* ImportSpecifier */: + // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`. + return parent.propertyName ? undefined : { isNamedImport: true }; + case 238 /* ImportClause */: + case 239 /* NamespaceImport */: + ts.Debug.assert(parent.name === node); + return { isNamedImport: false }; + default: + return undefined; + } + } + function getExportInfo(exportSymbol, exportKind, checker) { + var exportingModuleSymbol = checker.getMergedSymbol(exportSymbol.parent); // Need to get merged symbol in case there's an augmentation. + // `export` may appear in a namespace. In that case, just rely on global search. + return ts.isExternalModuleSymbol(exportingModuleSymbol) ? { exportingModuleSymbol: exportingModuleSymbol, exportKind: exportKind } : undefined; + } + FindAllReferences.getExportInfo = getExportInfo; + function symbolName(symbol) { + if (symbol.name !== "default") { + return symbol.name; + } + var name = ts.forEach(symbol.declarations, function (_a) { + var name = _a.name; + return name && name.kind === 70 /* Identifier */ && name.text; + }); + ts.Debug.assert(!!name); + return name; + } + /** If at an export specifier, go to the symbol it refers to. */ + function skipExportSpecifierSymbol(symbol, checker) { + // For `export { foo } from './bar", there's nothing to skip, because it does not create a new alias. But `export { foo } does. + if (symbol.declarations) + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + if (ts.isExportSpecifier(declaration) && !declaration.propertyName && !declaration.parent.parent.moduleSpecifier) { + return checker.getExportSpecifierLocalTargetSymbol(declaration); + } + } + return symbol; + } + function getContainingModuleSymbol(importer, checker) { + return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); + } + function getSourceFileLikeForImportDeclaration(node) { + if (node.kind === 180 /* CallExpression */) { + return node.getSourceFile(); + } + var parent = node.parent; + if (parent.kind === 264 /* SourceFile */) { + return parent; + } + ts.Debug.assert(parent.kind === 233 /* ModuleBlock */ && isAmbientModuleDeclaration(parent.parent)); + return parent.parent; + } + function isAmbientModuleDeclaration(node) { + return node.kind === 232 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */; + } + function isExternalModuleImportEquals(_a) { + var moduleReference = _a.moduleReference; + return moduleReference.kind === 247 /* ExternalModuleReference */ && moduleReference.expression.kind === 9 /* StringLiteral */; + } + })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); +})(ts || (ts = {})); +/// +/* @internal */ +var ts; +(function (ts) { + var FindAllReferences; + (function (FindAllReferences) { + function nodeEntry(node, isInString) { + return { type: "node", node: node, isInString: isInString }; + } + FindAllReferences.nodeEntry = nodeEntry; + function findReferencedSymbols(checker, cancellationToken, sourceFiles, sourceFile, position) { + var referencedSymbols = findAllReferencedSymbols(checker, cancellationToken, sourceFiles, sourceFile, position); + if (!referencedSymbols || !referencedSymbols.length) { return undefined; } - switch (node.kind) { - case 8 /* NumericLiteral */: - if (!ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) { - break; - } - // Fallthrough - case 70 /* Identifier */: - case 98 /* ThisKeyword */: - // case SyntaxKind.SuperKeyword: TODO:GH#9268 - case 122 /* ConstructorKeyword */: - case 9 /* StringLiteral */: - return getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFiles, findInStrings, findInComments, /*implementations*/ false); + var out = []; + for (var _i = 0, referencedSymbols_1 = referencedSymbols; _i < referencedSymbols_1.length; _i++) { + var _a = referencedSymbols_1[_i], definition = _a.definition, references = _a.references; + // Only include referenced symbols that have a valid definition. + if (definition) { + out.push({ definition: definitionToReferencedSymbolDefinitionInfo(definition, checker), references: references.map(toReferenceEntry) }); + } } - return undefined; + return out; } FindAllReferences.findReferencedSymbols = findReferencedSymbols; - function getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFiles, findInStrings, findInComments, implementations) { - if (!implementations) { + function getImplementationsAtPosition(checker, cancellationToken, sourceFiles, sourceFile, position) { + var node = ts.getTouchingPropertyName(sourceFile, position); + var referenceEntries = getImplementationReferenceEntries(checker, cancellationToken, sourceFiles, node); + return ts.map(referenceEntries, function (entry) { return toImplementationLocation(entry, checker); }); + } + FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; + function getImplementationReferenceEntries(typeChecker, cancellationToken, sourceFiles, node) { + // If invoked directly on a shorthand property assignment, then return + // the declaration of the symbol being assigned (not the symbol being assigned to). + if (node.parent.kind === 261 /* ShorthandPropertyAssignment */) { + var result_4 = []; + FindAllReferences.Core.getReferenceEntriesForShorthandPropertyAssignment(node, typeChecker, function (node) { return result_4.push(nodeEntry(node)); }); + return result_4; + } + else if (node.kind === 96 /* SuperKeyword */ || ts.isSuperProperty(node.parent)) { + // References to and accesses on the super keyword only have one possible implementation, so no + // need to "Find all References" + var symbol = typeChecker.getSymbolAtLocation(node); + return symbol.valueDeclaration && [nodeEntry(symbol.valueDeclaration)]; + } + else { + // Perform "Find all References" and retrieve only those that are implementations + return getReferenceEntriesForNode(node, sourceFiles, typeChecker, cancellationToken, { implementations: true }); + } + } + function findReferencedEntries(checker, cancellationToken, sourceFiles, sourceFile, position, options) { + var x = flattenEntries(findAllReferencedSymbols(checker, cancellationToken, sourceFiles, sourceFile, position, options)); + return ts.map(x, toReferenceEntry); + } + FindAllReferences.findReferencedEntries = findReferencedEntries; + function getReferenceEntriesForNode(node, sourceFiles, checker, cancellationToken, options) { + if (options === void 0) { options = {}; } + return flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(node, sourceFiles, checker, cancellationToken, options)); + } + FindAllReferences.getReferenceEntriesForNode = getReferenceEntriesForNode; + function findAllReferencedSymbols(checker, cancellationToken, sourceFiles, sourceFile, position, options) { + var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); + return FindAllReferences.Core.getReferencedSymbolsForNode(node, sourceFiles, checker, cancellationToken, options); + } + function flattenEntries(referenceSymbols) { + return referenceSymbols && ts.flatMap(referenceSymbols, function (r) { return r.references; }); + } + function definitionToReferencedSymbolDefinitionInfo(def, checker) { + var info = (function () { + switch (def.type) { + case "symbol": { + var symbol = def.symbol, node_2 = def.node; + var declarations = symbol.declarations; + if (!declarations || declarations.length === 0) { + return undefined; + } + var _a = getDefinitionKindAndDisplayParts(symbol, node_2, checker), displayParts_1 = _a.displayParts, kind_1 = _a.kind; + var name_3 = displayParts_1.map(function (p) { return p.text; }).join(""); + return { node: node_2, name: name_3, kind: kind_1, displayParts: displayParts_1 }; + } + case "label": { + var node_3 = def.node; + return { node: node_3, name: node_3.text, kind: ts.ScriptElementKind.label, displayParts: [ts.displayPart(node_3.text, ts.SymbolDisplayPartKind.text)] }; + } + case "keyword": { + var node_4 = def.node; + var name_4 = ts.tokenToString(node_4.kind); + return { node: node_4, name: name_4, kind: ts.ScriptElementKind.keyword, displayParts: [{ text: name_4, kind: ts.ScriptElementKind.keyword }] }; + } + case "this": { + var node_5 = def.node; + var symbol = checker.getSymbolAtLocation(node_5); + var displayParts_2 = symbol && ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, node_5.getSourceFile(), ts.getContainerNode(node_5), node_5).displayParts; + return { node: node_5, name: "this", kind: ts.ScriptElementKind.variableElement, displayParts: displayParts_2 }; + } + case "string": { + var node_6 = def.node; + return { node: node_6, name: node_6.text, kind: ts.ScriptElementKind.variableElement, displayParts: [ts.displayPart(ts.getTextOfNode(node_6), ts.SymbolDisplayPartKind.stringLiteral)] }; + } + } + })(); + if (!info) { + return undefined; + } + var node = info.node, name = info.name, kind = info.kind, displayParts = info.displayParts; + var sourceFile = node.getSourceFile(); + return { + containerKind: "", + containerName: "", + fileName: sourceFile.fileName, + kind: kind, + name: name, + textSpan: ts.createTextSpanFromNode(node, sourceFile), + displayParts: displayParts + }; + } + function getDefinitionKindAndDisplayParts(symbol, node, checker) { + var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, node.getSourceFile(), ts.getContainerNode(node), node), displayParts = _a.displayParts, symbolKind = _a.symbolKind; + return { displayParts: displayParts, kind: symbolKind }; + } + function toReferenceEntry(entry) { + if (entry.type === "span") { + return { textSpan: entry.textSpan, fileName: entry.fileName, isWriteAccess: false, isDefinition: false }; + } + var node = entry.node, isInString = entry.isInString; + return { + fileName: node.getSourceFile().fileName, + textSpan: getTextSpan(node), + isWriteAccess: isWriteAccess(node), + isDefinition: ts.isDeclarationName(node) || ts.isLiteralComputedPropertyDeclarationName(node), + isInString: isInString + }; + } + function toImplementationLocation(entry, checker) { + if (entry.type === "node") { + var node = entry.node; + return __assign({ textSpan: getTextSpan(node), fileName: node.getSourceFile().fileName }, implementationKindDisplayParts(node, checker)); + } + else { + var textSpan = entry.textSpan, fileName = entry.fileName; + return { textSpan: textSpan, fileName: fileName, kind: ts.ScriptElementKind.unknown, displayParts: [] }; + } + } + function implementationKindDisplayParts(node, checker) { + var symbol = checker.getSymbolAtLocation(ts.isDeclaration(node) && node.name ? node.name : node); + if (symbol) { + return getDefinitionKindAndDisplayParts(symbol, node, checker); + } + else if (node.kind === 177 /* ObjectLiteralExpression */) { + return { + kind: ts.ScriptElementKind.interfaceElement, + displayParts: [ts.punctuationPart(18 /* OpenParenToken */), ts.textPart("object literal"), ts.punctuationPart(19 /* CloseParenToken */)] + }; + } + else if (node.kind === 198 /* ClassExpression */) { + return { + kind: ts.ScriptElementKind.localClassElement, + displayParts: [ts.punctuationPart(18 /* OpenParenToken */), ts.textPart("anonymous local class"), ts.punctuationPart(19 /* CloseParenToken */)] + }; + } + else { + return { kind: ts.getNodeKind(node), displayParts: [] }; + } + } + function toHighlightSpan(entry) { + if (entry.type === "span") { + var fileName_1 = entry.fileName, textSpan = entry.textSpan; + return { fileName: fileName_1, span: { textSpan: textSpan, kind: ts.HighlightSpanKind.reference } }; + } + var node = entry.node, isInString = entry.isInString; + var fileName = entry.node.getSourceFile().fileName; + var writeAccess = isWriteAccess(node); + var span = { + textSpan: getTextSpan(node), + kind: writeAccess ? ts.HighlightSpanKind.writtenReference : ts.HighlightSpanKind.reference, + isInString: isInString + }; + return { fileName: fileName, span: span }; + } + FindAllReferences.toHighlightSpan = toHighlightSpan; + function getTextSpan(node) { + var start = node.getStart(); + var end = node.getEnd(); + if (node.kind === 9 /* StringLiteral */) { + start += 1; + end -= 1; + } + return ts.createTextSpanFromBounds(start, end); + } + /** A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment */ + function isWriteAccess(node) { + if (node.kind === 70 /* Identifier */ && ts.isDeclarationName(node)) { + return true; + } + var parent = node.parent; + if (parent) { + if (parent.kind === 192 /* PostfixUnaryExpression */ || parent.kind === 191 /* PrefixUnaryExpression */) { + return true; + } + else if (parent.kind === 193 /* BinaryExpression */ && parent.left === node) { + var operator = parent.operatorToken.kind; + return 57 /* FirstAssignment */ <= operator && operator <= 69 /* LastAssignment */; + } + } + return false; + } + })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); +})(ts || (ts = {})); +/** Encapsulates the core find-all-references algorithm. */ +/* @internal */ +(function (ts) { + var FindAllReferences; + (function (FindAllReferences) { + var Core; + (function (Core) { + /** Core find-all-references algorithm. Handles special cases before delegating to `getReferencedSymbolsForSymbol`. */ + function getReferencedSymbolsForNode(node, sourceFiles, checker, cancellationToken, options) { + if (options === void 0) { options = {}; } + if (node.kind === 264 /* SourceFile */) { + return undefined; + } + if (!options.implementations) { + var special = getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken); + if (special) { + return special; + } + } + var symbol = checker.getSymbolAtLocation(node); + // Could not find a symbol e.g. unknown identifier + if (!symbol) { + // String literal might be a property (and thus have a symbol), so do this here rather than in getReferencedSymbolsSpecial. + if (!options.implementations && node.kind === 9 /* StringLiteral */) { + return getReferencesForStringLiteral(node, sourceFiles, cancellationToken); + } + // Can't have references to something that we have no symbol for. + return undefined; + } + // The symbol was an internal symbol and does not have a declaration e.g. undefined symbol + if (!symbol.declarations || !symbol.declarations.length) { + return undefined; + } + return getReferencedSymbolsForSymbol(symbol, node, sourceFiles, checker, cancellationToken, options); + } + Core.getReferencedSymbolsForNode = getReferencedSymbolsForNode; + /** getReferencedSymbols for special node kinds. */ + function getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken) { + if (ts.isTypeKeyword(node.kind)) { + return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken); + } // Labels if (ts.isLabelName(node)) { if (ts.isJumpStatementTarget(node)) { var labelDefinition = ts.getTargetLabel(node.parent, node.text); // if we have a label definition, look within its statement for references, if not, then // the label is undefined and we have no results.. - return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : undefined; + return labelDefinition && getLabelReferencesInNode(labelDefinition.parent, labelDefinition); } else { // it is a label definition and not a target, search within the parent labeledStatement @@ -69311,129 +75098,164 @@ var ts; } } if (ts.isThis(node)) { - return getReferencesForThisKeyword(node, sourceFiles); + return getReferencesForThisKeyword(node, sourceFiles, cancellationToken); } if (node.kind === 96 /* SuperKeyword */) { return getReferencesForSuperKeyword(node); } - } - // `getSymbolAtLocation` normally returns the symbol of the class when given the constructor keyword, - // so we have to specify that we want the constructor symbol. - var symbol = typeChecker.getSymbolAtLocation(node); - if (!implementations && !symbol && node.kind === 9 /* StringLiteral */) { - return getReferencesForStringLiteral(node, sourceFiles); - } - // Could not find a symbol e.g. unknown identifier - if (!symbol) { - // Can't have references to something that we have no symbol for. return undefined; } - var declarations = symbol.declarations; - // The symbol was an internal symbol and does not have a declaration e.g. undefined symbol - if (!declarations || !declarations.length) { - return undefined; + /** Core find-all-references algorithm for a normal symbol. */ + function getReferencedSymbolsForSymbol(symbol, node, sourceFiles, checker, cancellationToken, options) { + symbol = skipPastExportOrImportSpecifier(symbol, node, checker); + // Compute the meaning from the location and the symbol it references + var searchMeaning = getIntersectingMeaningFromDeclarations(ts.getMeaningFromLocation(node), symbol.declarations); + var result = []; + var state = createState(sourceFiles, node, checker, cancellationToken, searchMeaning, options, result); + var search = state.createSearch(node, symbol, /*comingFrom*/ undefined, { allSearchSymbols: populateSearchSymbolSet(symbol, node, checker, options.implementations) }); + // Try to get the smallest valid scope that we can limit our search to; + // otherwise we'll need to search globally (i.e. include each file). + var scope = getSymbolScope(symbol); + if (scope) { + getReferencesInContainer(scope, scope.getSourceFile(), search, state); + } + else { + // Global search + for (var _i = 0, _a = state.sourceFiles; _i < _a.length; _i++) { + var sourceFile = _a[_i]; + state.cancellationToken.throwIfCancellationRequested(); + searchForName(sourceFile, search, state); + } + } + return result; } - var result; - // Compute the meaning from the location and the symbol it references - var searchMeaning = getIntersectingMeaningFromDeclarations(ts.getMeaningFromLocation(node), declarations); - // Get the text to search for. - // Note: if this is an external module symbol, the name doesn't include quotes. - var declaredName = ts.stripQuotes(ts.getDeclaredName(typeChecker, symbol, node)); - // Try to get the smallest valid scope that we can limit our search to; - // otherwise we'll need to search globally (i.e. include each file). - var scope = getSymbolScope(symbol); - // Maps from a symbol ID to the ReferencedSymbol entry in 'result'. - var symbolToIndex = []; - if (scope) { - result = []; - getReferencesInNode(scope, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); + /** Handle a few special cases relating to export/import specifiers. */ + function skipPastExportOrImportSpecifier(symbol, node, checker) { + var parent = node.parent; + if (ts.isExportSpecifier(parent)) { + return getLocalSymbolForExportSpecifier(node, symbol, parent, checker); + } + if (ts.isImportSpecifier(parent) && parent.propertyName === node) { + // We're at `foo` in `import { foo as bar }`. Probably intended to find all refs on the original, not just on the import. + return checker.getImmediateAliasedSymbol(symbol); + } + return symbol; } - else { - var internedName = getInternedName(symbol, node); - for (var _i = 0, sourceFiles_8 = sourceFiles; _i < sourceFiles_8.length; _i++) { - var sourceFile = sourceFiles_8[_i]; - cancellationToken.throwIfCancellationRequested(); - var nameTable = ts.getNameTable(sourceFile); - if (nameTable[internedName] !== undefined) { - result = result || []; - getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); + function createState(sourceFiles, originalLocation, checker, cancellationToken, searchMeaning, options, result) { + var symbolIdToReferences = []; + var inheritsFromCache = ts.createMap(); + // Source file ID → symbol ID → Whether the symbol has been searched for in the source file. + var sourceFileToSeenSymbols = []; + var isForConstructor = originalLocation.kind === 122 /* ConstructorKeyword */; + var importTracker; + return __assign({}, options, { sourceFiles: sourceFiles, isForConstructor: isForConstructor, checker: checker, cancellationToken: cancellationToken, searchMeaning: searchMeaning, inheritsFromCache: inheritsFromCache, getImportSearches: getImportSearches, createSearch: createSearch, referenceAdder: referenceAdder, addStringOrCommentReference: addStringOrCommentReference, + markSearchedSymbol: markSearchedSymbol, markSeenContainingTypeReference: ts.nodeSeenTracker(), markSeenReExportRHS: ts.nodeSeenTracker() }); + function getImportSearches(exportSymbol, exportInfo) { + if (!importTracker) + importTracker = FindAllReferences.createImportTracker(sourceFiles, checker, cancellationToken); + return importTracker(exportSymbol, exportInfo, options.isForRename); + } + function createSearch(location, symbol, comingFrom, searchOptions) { + if (searchOptions === void 0) { searchOptions = {}; } + // Note: if this is an external module symbol, the name doesn't include quotes. + var _a = searchOptions.text, text = _a === void 0 ? ts.stripQuotes(ts.getDeclaredName(checker, symbol, location)) : _a, _b = searchOptions.allSearchSymbols, allSearchSymbols = _b === void 0 ? undefined : _b; + var escapedText = ts.escapeIdentifier(text); + var parents = options.implementations && getParentSymbolsOfPropertyAccess(location, symbol, checker); + return { location: location, symbol: symbol, comingFrom: comingFrom, text: text, escapedText: escapedText, parents: parents, includes: includes }; + function includes(referenceSymbol) { + return allSearchSymbols ? ts.contains(allSearchSymbols, referenceSymbol) : referenceSymbol === symbol; + } + } + function referenceAdder(referenceSymbol, searchLocation) { + var symbolId = ts.getSymbolId(referenceSymbol); + var references = symbolIdToReferences[symbolId]; + if (!references) { + references = symbolIdToReferences[symbolId] = []; + result.push({ definition: { type: "symbol", symbol: referenceSymbol, node: searchLocation }, references: references }); + } + return function (node) { return references.push(FindAllReferences.nodeEntry(node)); }; + } + function addStringOrCommentReference(fileName, textSpan) { + result.push({ + definition: undefined, + references: [{ type: "span", fileName: fileName, textSpan: textSpan }] + }); + } + function markSearchedSymbol(sourceFile, symbol) { + var sourceId = ts.getNodeId(sourceFile); + var symbolId = ts.getSymbolId(symbol); + var seenSymbols = sourceFileToSeenSymbols[sourceId] || (sourceFileToSeenSymbols[sourceId] = []); + return !seenSymbols[symbolId] && (seenSymbols[symbolId] = true); + } + } + /** Search for all imports of a given exported symbol using `State.getImportSearches`. */ + function searchForImportsOfExport(exportLocation, exportSymbol, exportInfo, state) { + var _a = state.getImportSearches(exportSymbol, exportInfo), importSearches = _a.importSearches, singleReferences = _a.singleReferences, indirectUsers = _a.indirectUsers; + // For `import { foo as bar }` just add the reference to `foo`, and don't otherwise search in the file. + if (singleReferences.length) { + var addRef = state.referenceAdder(exportSymbol, exportLocation); + for (var _i = 0, singleReferences_1 = singleReferences; _i < singleReferences_1.length; _i++) { + var singleRef = singleReferences_1[_i]; + addRef(singleRef); + } + } + // For each import, find all references to that import in its source file. + for (var _b = 0, importSearches_1 = importSearches; _b < importSearches_1.length; _b++) { + var _c = importSearches_1[_b], importLocation = _c[0], importSymbol = _c[1]; + getReferencesInSourceFile(importLocation.getSourceFile(), state.createSearch(importLocation, importSymbol, 1 /* Export */), state); + } + if (indirectUsers.length) { + var indirectSearch = void 0; + switch (exportInfo.exportKind) { + case 0 /* Named */: + indirectSearch = state.createSearch(exportLocation, exportSymbol, 1 /* Export */); + break; + case 1 /* Default */: + // Search for a property access to '.default'. This can't be renamed. + indirectSearch = state.isForRename ? undefined : state.createSearch(exportLocation, exportSymbol, 1 /* Export */, { text: "default" }); + break; + case 2 /* ExportEquals */: + break; + } + if (indirectSearch) { + for (var _d = 0, indirectUsers_1 = indirectUsers; _d < indirectUsers_1.length; _d++) { + var indirectUser = indirectUsers_1[_d]; + searchForName(indirectUser, indirectSearch, state); + } } } } - return result; - function getDefinition(symbol) { - var info = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, node.getSourceFile(), ts.getContainerNode(node), node); - var name = ts.map(info.displayParts, function (p) { return p.text; }).join(""); - var declarations = symbol.declarations; - if (!declarations || declarations.length === 0) { - return undefined; + // Go to the symbol we imported from and find references for it. + function searchForImportedSymbol(symbol, state) { + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + getReferencesInSourceFile(declaration.getSourceFile(), state.createSearch(declaration, symbol, 0 /* Import */), state); } - return { - containerKind: "", - containerName: "", - name: name, - kind: info.symbolKind, - fileName: declarations[0].getSourceFile().fileName, - textSpan: ts.createTextSpan(declarations[0].getStart(), 0), - displayParts: info.displayParts - }; } - function getAliasSymbolForPropertyNameSymbol(symbol, location) { - if (symbol.flags & 8388608 /* Alias */) { - // Default import get alias - var defaultImport = ts.getDeclarationOfKind(symbol, 236 /* ImportClause */); - if (defaultImport) { - return typeChecker.getAliasedSymbol(symbol); - } - var importOrExportSpecifier = ts.forEach(symbol.declarations, function (declaration) { return (declaration.kind === 239 /* ImportSpecifier */ || - declaration.kind === 243 /* ExportSpecifier */) ? declaration : undefined; }); - if (importOrExportSpecifier && - // export { a } - (!importOrExportSpecifier.propertyName || - // export {a as class } where a is location - importOrExportSpecifier.propertyName === location)) { - // If Import specifier -> get alias - // else Export specifier -> get local target - return importOrExportSpecifier.kind === 239 /* ImportSpecifier */ ? - typeChecker.getAliasedSymbol(symbol) : - typeChecker.getExportSpecifierLocalTargetSymbol(importOrExportSpecifier); - } + /** Search for all occurences of an identifier in a source file (and filter out the ones that match). */ + function searchForName(sourceFile, search, state) { + if (ts.getNameTable(sourceFile).get(search.escapedText) !== undefined) { + getReferencesInSourceFile(sourceFile, search, state); } - return undefined; } - function followAliasIfNecessary(symbol, location) { - return getAliasSymbolForPropertyNameSymbol(symbol, location) || symbol; - } - function getPropertySymbolOfDestructuringAssignment(location) { + function getPropertySymbolOfDestructuringAssignment(location, checker) { return ts.isArrayLiteralOrObjectLiteralDestructuringPattern(location.parent.parent) && - typeChecker.getPropertySymbolOfDestructuringAssignment(location); + checker.getPropertySymbolOfDestructuringAssignment(location); } function isObjectBindingPatternElementWithoutPropertyName(symbol) { - var bindingElement = ts.getDeclarationOfKind(symbol, 174 /* BindingElement */); + var bindingElement = ts.getDeclarationOfKind(symbol, 175 /* BindingElement */); return bindingElement && - bindingElement.parent.kind === 172 /* ObjectBindingPattern */ && + bindingElement.parent.kind === 173 /* ObjectBindingPattern */ && !bindingElement.propertyName; } - function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol) { + function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker) { if (isObjectBindingPatternElementWithoutPropertyName(symbol)) { - var bindingElement = ts.getDeclarationOfKind(symbol, 174 /* BindingElement */); - var typeOfPattern = typeChecker.getTypeAtLocation(bindingElement.parent); - return typeOfPattern && typeChecker.getPropertyOfType(typeOfPattern, bindingElement.name.text); + var bindingElement = ts.getDeclarationOfKind(symbol, 175 /* BindingElement */); + var typeOfPattern = checker.getTypeAtLocation(bindingElement.parent); + return typeOfPattern && checker.getPropertyOfType(typeOfPattern, bindingElement.name.text); } return undefined; } - function getInternedName(symbol, location) { - // If this is an export or import specifier it could have been renamed using the 'as' syntax. - // If so we want to search for whatever under the cursor. - if (ts.isImportOrExportSpecifierName(location)) { - return location.getText(); - } - // Try to get the local symbol if we're dealing with an 'export default' - // since that symbol has the "true" name. - var localExportDefaultSymbol = ts.getLocalSymbolForExportDefault(symbol); - symbol = localExportDefaultSymbol || symbol; - return ts.stripQuotes(symbol.name); - } /** * Determines the smallest scope in which a symbol may have named references. * Note that not every construct has been accounted for. This function can @@ -69445,55 +75267,57 @@ var ts; function getSymbolScope(symbol) { // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. - var valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 184 /* FunctionExpression */ || valueDeclaration.kind === 197 /* ClassExpression */)) { + var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; + if (valueDeclaration && (valueDeclaration.kind === 185 /* FunctionExpression */ || valueDeclaration.kind === 198 /* ClassExpression */)) { return valueDeclaration; } - // If this is private property or method, the scope is the containing class - if (symbol.flags & (4 /* Property */ | 8192 /* Method */)) { - var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (ts.getModifierFlags(d) & 8 /* Private */) ? d : undefined; }); - if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 226 /* ClassDeclaration */); - } - } - // If the symbol is an import we would like to find it if we are looking for what it imports. - // So consider it visible outside its declaration scope. - if (symbol.flags & 8388608 /* Alias */) { + if (!declarations) { return undefined; } + // If this is private property or method, the scope is the containing class + if (flags & (4 /* Property */ | 8192 /* Method */)) { + var privateDeclaration = ts.find(declarations, function (d) { return !!(ts.getModifierFlags(d) & 8 /* Private */); }); + if (privateDeclaration) { + return ts.getAncestor(privateDeclaration, 228 /* ClassDeclaration */); + } + } // If symbol is of object binding pattern element without property name we would want to // look for property too and that could be anywhere if (isObjectBindingPatternElementWithoutPropertyName(symbol)) { return undefined; } - // if this symbol is visible from its parent container, e.g. exported, then bail out - // if symbol correspond to the union property - bail out - if (symbol.parent || (symbol.flags & 268435456 /* SyntheticProperty */)) { + // If the symbol has a parent, it's globally visible. + // Unless that parent is an external module, then we should only search in the module (and recurse on the export later). + // But if the parent is a module that has `export as namespace`, then the symbol *is* globally visible. + if (parent && !((parent.flags & 1536 /* Module */) && ts.isExternalModuleSymbol(parent) && !parent.globalExports)) { + return undefined; + } + // If this is a synthetic property, it's a property and must be searched for globally. + if ((flags & 134217728 /* Transient */ && symbol.checkFlags & 6 /* Synthetic */)) { return undefined; } var scope; - var declarations = symbol.getDeclarations(); - if (declarations) { - for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { - var declaration = declarations_7[_i]; - var container = ts.getContainerNode(declaration); - if (!container) { - return undefined; - } - if (scope && scope !== container) { - // Different declarations have different containers, bail out - return undefined; - } - if (container.kind === 261 /* SourceFile */ && !ts.isExternalModule(container)) { - // This is a global variable and not an external module, any declaration defined - // within this scope is visible outside the file - return undefined; - } - // The search scope is the container node - scope = container; + for (var _i = 0, declarations_10 = declarations; _i < declarations_10.length; _i++) { + var declaration = declarations_10[_i]; + var container = ts.getContainerNode(declaration); + if (scope && scope !== container) { + // Different declarations have different containers, bail out + return undefined; } + if (!container || container.kind === 264 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { + // This is a global variable and not an external module, any declaration defined + // within this scope is visible outside the file + return undefined; + } + // The search scope is the container node + scope = container; } - return scope; + // If symbol.parent, this means we are in an export of an external module. (Otherwise we would have returned `undefined` above.) + // For an export of a module, we may be in a declaration file, and it may be accessed elsewhere. E.g.: + // declare module "a" { export type T = number; } + // declare module "b" { import { T } from "a"; export const x: T; } + // So we must search the whole source file. (Because we will mark the source file as seen, we we won't return to it when searching for imports.) + return parent ? scope.getSourceFile() : scope; } function getPossibleSymbolReferencePositions(sourceFile, symbolName, start, end) { var positions = []; @@ -69508,7 +75332,6 @@ var ts; var symbolNameLength = symbolName.length; var position = text.indexOf(symbolName, start); while (position >= 0) { - cancellationToken.throwIfCancellationRequested(); // If we are past the end, stop looking if (position > end) break; @@ -69529,279 +75352,320 @@ var ts; var sourceFile = container.getSourceFile(); var labelName = targetLabel.text; var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, labelName, container.getStart(), container.getEnd()); - ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); + for (var _i = 0, possiblePositions_1 = possiblePositions; _i < possiblePositions_1.length; _i++) { + var position = possiblePositions_1[_i]; var node = ts.getTouchingWord(sourceFile, position); if (!node || node.getWidth() !== labelName.length) { - return; + continue; } // Only pick labels that are either the target label, or have a target that is the target label if (node === targetLabel || (ts.isJumpStatementTarget(node) && ts.getTargetLabel(node, labelName) === targetLabel)) { - references.push(getReferenceEntryFromNode(node)); + references.push(FindAllReferences.nodeEntry(node)); } - }); - var definition = { - containerKind: "", - containerName: "", - fileName: targetLabel.getSourceFile().fileName, - kind: ts.ScriptElementKind.label, - name: labelName, - textSpan: ts.createTextSpanFromBounds(targetLabel.getStart(), targetLabel.getEnd()), - displayParts: [ts.displayPart(labelName, ts.SymbolDisplayPartKind.text)] - }; - return [{ definition: definition, references: references }]; + } + return [{ definition: { type: "label", node: targetLabel }, references: references }]; } function isValidReferencePosition(node, searchSymbolName) { - if (node) { - // Compare the length so we filter out strict superstrings of the symbol we are looking for - switch (node.kind) { - case 70 /* Identifier */: - return node.getWidth() === searchSymbolName.length; - case 9 /* StringLiteral */: - if (ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || - isNameOfExternalModuleImportOrDeclaration(node)) { - // For string literals we have two additional chars for the quotes - return node.getWidth() === searchSymbolName.length + 2; - } - break; - case 8 /* NumericLiteral */: - if (ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) { - return node.getWidth() === searchSymbolName.length; - } - break; - } + // Compare the length so we filter out strict superstrings of the symbol we are looking for + switch (node && node.kind) { + case 70 /* Identifier */: + return node.getWidth() === searchSymbolName.length; + case 9 /* StringLiteral */: + return (ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) && + // For string literals we have two additional chars for the quotes + node.getWidth() === searchSymbolName.length + 2; + case 8 /* NumericLiteral */: + return ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && node.getWidth() === searchSymbolName.length; + default: + return false; } - return false; } - /** Search within node "container" for references for a search value, where the search value is defined as a - * tuple of(searchSymbol, searchText, searchLocation, and searchMeaning). - * searchLocation: a node where the search value - */ - function getReferencesInNode(container, searchSymbol, searchText, searchLocation, searchMeaning, findInStrings, findInComments, result, symbolToIndex) { - var sourceFile = container.getSourceFile(); - var start = findInComments ? container.getFullStart() : container.getStart(); - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, searchText, start, container.getEnd()); - var parents = getParentSymbolsOfPropertyAccess(); - var inheritsFromCache = ts.createMap(); - if (possiblePositions.length) { - // Build the set of symbols to search for, initially it has only the current symbol - var searchSymbols_1 = populateSearchSymbolSet(searchSymbol, searchLocation); - ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); - var referenceLocation = ts.getTouchingPropertyName(sourceFile, position); - if (!isValidReferencePosition(referenceLocation, searchText)) { - // This wasn't the start of a token. Check to see if it might be a - // match in a comment or string if that's what the caller is asking - // for. - if (!implementations && ((findInStrings && ts.isInString(sourceFile, position)) || - (findInComments && ts.isInNonReferenceComment(sourceFile, position)))) { - // In the case where we're looking inside comments/strings, we don't have - // an actual definition. So just use 'undefined' here. Features like - // 'Rename' won't care (as they ignore the definitions), and features like - // 'FindReferences' will just filter out these results. - result.push({ - definition: undefined, - references: [{ - fileName: sourceFile.fileName, - textSpan: ts.createTextSpan(position, searchText.length), - isWriteAccess: false, - isDefinition: false - }] - }); - } - return; - } - if (!(ts.getMeaningFromLocation(referenceLocation) & searchMeaning)) { - return; - } - var referenceSymbol = typeChecker.getSymbolAtLocation(referenceLocation); - if (referenceSymbol) { - var referenceSymbolDeclaration = referenceSymbol.valueDeclaration; - var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration); - var relatedSymbol = getRelatedSymbol(searchSymbols_1, referenceSymbol, referenceLocation, - /*searchLocationIsConstructor*/ searchLocation.kind === 122 /* ConstructorKeyword */, parents, inheritsFromCache); - if (relatedSymbol) { - addReferenceToRelatedSymbol(referenceLocation, relatedSymbol); - } - else if (!(referenceSymbol.flags & 67108864 /* Transient */) && searchSymbols_1.indexOf(shorthandValueSymbol) >= 0) { - addReferenceToRelatedSymbol(referenceSymbolDeclaration.name, shorthandValueSymbol); - } - else if (searchLocation.kind === 122 /* ConstructorKeyword */) { - findAdditionalConstructorReferences(referenceSymbol, referenceLocation); - } - } - }); + function getAllReferencesForKeyword(sourceFiles, keywordKind, cancellationToken) { + var references = []; + for (var _i = 0, sourceFiles_5 = sourceFiles; _i < sourceFiles_5.length; _i++) { + var sourceFile = sourceFiles_5[_i]; + cancellationToken.throwIfCancellationRequested(); + addReferencesForKeywordInFile(sourceFile, keywordKind, ts.tokenToString(keywordKind), references); } - return; - /* If we are just looking for implementations and this is a property access expression, we need to get the - * symbol of the local type of the symbol the property is being accessed on. This is because our search - * symbol may have a different parent symbol if the local type's symbol does not declare the property - * being accessed (i.e. it is declared in some parent class or interface) + return references.length ? [{ definition: { type: "keyword", node: references[0].node }, references: references }] : undefined; + } + function addReferencesForKeywordInFile(sourceFile, kind, searchText, references) { + var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, searchText, sourceFile.getStart(), sourceFile.getEnd()); + for (var _i = 0, possiblePositions_2 = possiblePositions; _i < possiblePositions_2.length; _i++) { + var position = possiblePositions_2[_i]; + var referenceLocation = ts.getTouchingPropertyName(sourceFile, position); + if (referenceLocation.kind === kind) { + references.push(FindAllReferences.nodeEntry(referenceLocation)); + } + } + } + function getReferencesInSourceFile(sourceFile, search, state) { + state.cancellationToken.throwIfCancellationRequested(); + return getReferencesInContainer(sourceFile, sourceFile, search, state); + } + /** + * Search within node "container" for references for a search value, where the search value is defined as a + * tuple of(searchSymbol, searchText, searchLocation, and searchMeaning). + * searchLocation: a node where the search value + */ + function getReferencesInContainer(container, sourceFile, search, state) { + if (!state.markSearchedSymbol(sourceFile, search.symbol)) { + return; + } + var start = state.findInComments ? container.getFullStart() : container.getStart(); + var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, search.text, start, container.getEnd()); + for (var _i = 0, possiblePositions_3 = possiblePositions; _i < possiblePositions_3.length; _i++) { + var position = possiblePositions_3[_i]; + getReferencesAtLocation(sourceFile, position, search, state); + } + } + function getReferencesAtLocation(sourceFile, position, search, state) { + var referenceLocation = ts.getTouchingPropertyName(sourceFile, position); + if (!isValidReferencePosition(referenceLocation, search.text)) { + // This wasn't the start of a token. Check to see if it might be a + // match in a comment or string if that's what the caller is asking + // for. + if (!state.implementations && (state.findInStrings && ts.isInString(sourceFile, position) || state.findInComments && ts.isInNonReferenceComment(sourceFile, position))) { + // In the case where we're looking inside comments/strings, we don't have + // an actual definition. So just use 'undefined' here. Features like + // 'Rename' won't care (as they ignore the definitions), and features like + // 'FindReferences' will just filter out these results. + state.addStringOrCommentReference(sourceFile.fileName, ts.createTextSpan(position, search.text.length)); + } + return; + } + if (!(ts.getMeaningFromLocation(referenceLocation) & state.searchMeaning)) { + return; + } + var referenceSymbol = state.checker.getSymbolAtLocation(referenceLocation); + if (!referenceSymbol) { + return; + } + var parent = referenceLocation.parent; + if (ts.isImportSpecifier(parent) && parent.propertyName === referenceLocation) { + // This is added through `singleReferences` in ImportsResult. If we happen to see it again, don't add it again. + return; + } + if (ts.isExportSpecifier(parent)) { + ts.Debug.assert(referenceLocation.kind === 70 /* Identifier */); + getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, parent, search, state); + return; + } + var relatedSymbol = getRelatedSymbol(search, referenceSymbol, referenceLocation, state); + if (!relatedSymbol) { + getReferenceForShorthandProperty(referenceSymbol, search, state); + return; + } + if (state.isForConstructor) { + findConstructorReferences(referenceLocation, sourceFile, search, state); + } + else { + addReference(referenceLocation, relatedSymbol, search.location, state); + } + getImportOrExportReferences(referenceLocation, referenceSymbol, search, state); + } + function getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, search, state) { + var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name; + var exportDeclaration = parent.parent; + var localSymbol = getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, state.checker); + if (!search.includes(localSymbol)) { + return; + } + if (!propertyName) { + addRef(); + } + else if (referenceLocation === propertyName) { + // For `export { foo as bar } from "baz"`, "`foo`" will be added from the singleReferences for import searches of the original export. + // For `export { foo as bar };`, where `foo` is a local, so add it now. + if (!exportDeclaration.moduleSpecifier) { + addRef(); + } + if (!state.isForRename && state.markSeenReExportRHS(name)) { + addReference(name, referenceSymbol, name, state); + } + } + else { + if (state.markSeenReExportRHS(referenceLocation)) { + addRef(); + } + } + // For `export { foo as bar }`, rename `foo`, but not `bar`. + if (!(referenceLocation === propertyName && state.isForRename)) { + var exportKind = referenceLocation.originalKeywordKind === 78 /* DefaultKeyword */ ? 1 /* Default */ : 0 /* Named */; + var exportInfo = FindAllReferences.getExportInfo(referenceSymbol, exportKind, state.checker); + ts.Debug.assert(!!exportInfo); + searchForImportsOfExport(referenceLocation, referenceSymbol, exportInfo, state); + } + // At `export { x } from "foo"`, also search for the imported symbol `"foo".x`. + if (search.comingFrom !== 1 /* Export */ && exportDeclaration.moduleSpecifier && !propertyName) { + searchForImportedSymbol(state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier), state); + } + function addRef() { + addReference(referenceLocation, localSymbol, search.location, state); + } + } + function getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, checker) { + return isExportSpecifierAlias(referenceLocation, exportSpecifier) ? checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) : referenceSymbol; + } + function isExportSpecifierAlias(referenceLocation, exportSpecifier) { + var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name; + ts.Debug.assert(propertyName === referenceLocation || name === referenceLocation); + if (propertyName) { + // Given `export { foo as bar } [from "someModule"]`: It's an alias at `foo`, but at `bar` it's a new symbol. + return propertyName === referenceLocation; + } + else { + // `export { foo } from "foo"` is a re-export. + // `export { foo };` is not a re-export, it creates an alias for the local variable `foo`. + return !parent.parent.moduleSpecifier; + } + } + function getImportOrExportReferences(referenceLocation, referenceSymbol, search, state) { + var importOrExport = FindAllReferences.getImportOrExportSymbol(referenceLocation, referenceSymbol, state.checker, search.comingFrom === 1 /* Export */); + if (!importOrExport) + return; + var symbol = importOrExport.symbol; + if (importOrExport.kind === 0 /* Import */) { + if (!state.isForRename || importOrExport.isNamedImport) { + searchForImportedSymbol(symbol, state); + } + } + else { + // We don't check for `state.isForRename`, even for default exports, because importers that previously matched the export name should be updated to continue matching. + searchForImportsOfExport(referenceLocation, symbol, importOrExport.exportInfo, state); + } + } + function getReferenceForShorthandProperty(_a, search, state) { + var flags = _a.flags, valueDeclaration = _a.valueDeclaration; + var shorthandValueSymbol = state.checker.getShorthandAssignmentValueSymbol(valueDeclaration); + /* + * Because in short-hand property assignment, an identifier which stored as name of the short-hand property assignment + * has two meanings: property name and property value. Therefore when we do findAllReference at the position where + * an identifier is declared, the language service should return the position of the variable declaration as well as + * the position in short-hand property assignment excluding property accessing. However, if we do findAllReference at the + * position of property accessing, the referenceEntry of such position will be handled in the first case. */ - function getParentSymbolsOfPropertyAccess() { - if (implementations) { - var propertyAccessExpression = getPropertyAccessExpressionFromRightHandSide(searchLocation); - if (propertyAccessExpression) { - var localParentType = typeChecker.getTypeAtLocation(propertyAccessExpression.expression); - if (localParentType) { - if (localParentType.symbol && localParentType.symbol.flags & (32 /* Class */ | 64 /* Interface */) && localParentType.symbol !== searchSymbol.parent) { - return [localParentType.symbol]; - } - else if (localParentType.flags & 196608 /* UnionOrIntersection */) { - return getSymbolsForClassAndInterfaceComponents(localParentType); - } - } - } + if (!(flags & 134217728 /* Transient */) && search.includes(shorthandValueSymbol)) { + addReference(valueDeclaration.name, shorthandValueSymbol, search.location, state); + } + } + function addReference(referenceLocation, relatedSymbol, searchLocation, state) { + var addRef = state.referenceAdder(relatedSymbol, searchLocation); + if (state.implementations) { + addImplementationReferences(referenceLocation, addRef, state); + } + else { + addRef(referenceLocation); + } + } + /** Adds references when a constructor is used with `new this()` in its own class and `super()` calls in subclasses. */ + function findConstructorReferences(referenceLocation, sourceFile, search, state) { + if (ts.isNewExpressionTarget(referenceLocation)) { + addReference(referenceLocation, search.symbol, search.location, state); + } + var pusher = state.referenceAdder(search.symbol, search.location); + if (ts.isClassLike(referenceLocation.parent)) { + ts.Debug.assert(referenceLocation.parent.name === referenceLocation); + // This is the class declaration containing the constructor. + findOwnConstructorReferences(search.symbol, sourceFile, pusher); + } + else { + // If this class appears in `extends C`, then the extending class' "super" calls are references. + var classExtending = tryGetClassByExtendingIdentifier(referenceLocation); + if (classExtending && ts.isClassLike(classExtending)) { + findSuperConstructorAccesses(classExtending, pusher); } } - function getPropertyAccessExpressionFromRightHandSide(node) { - return ts.isRightSideOfPropertyAccess(node) && node.parent; + } + function getPropertyAccessExpressionFromRightHandSide(node) { + return ts.isRightSideOfPropertyAccess(node) && node.parent; + } + /** + * `classSymbol` is the class where the constructor was defined. + * Reference the constructor and all calls to `new this()`. + */ + function findOwnConstructorReferences(classSymbol, sourceFile, addNode) { + for (var _i = 0, _a = classSymbol.members.get("__constructor").declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + var ctrKeyword = ts.findChildOfKind(decl, 122 /* ConstructorKeyword */, sourceFile); + ts.Debug.assert(decl.kind === 151 /* Constructor */ && !!ctrKeyword); + addNode(ctrKeyword); } - /** Adds references when a constructor is used with `new this()` in its own class and `super()` calls in subclasses. */ - function findAdditionalConstructorReferences(referenceSymbol, referenceLocation) { - ts.Debug.assert(ts.isClassLike(searchSymbol.valueDeclaration)); - var referenceClass = referenceLocation.parent; - if (referenceSymbol === searchSymbol && ts.isClassLike(referenceClass)) { - ts.Debug.assert(referenceClass.name === referenceLocation); - // This is the class declaration containing the constructor. - addReferences(findOwnConstructorCalls(searchSymbol)); - } - else { - // If this class appears in `extends C`, then the extending class' "super" calls are references. - var classExtending = tryGetClassByExtendingIdentifier(referenceLocation); - if (classExtending && ts.isClassLike(classExtending) && followAliasIfNecessary(referenceSymbol, referenceLocation) === searchSymbol) { - addReferences(superConstructorAccesses(classExtending)); - } - } - } - function addReferences(references) { - if (references.length) { - var referencedSymbol = getReferencedSymbol(searchSymbol); - ts.addRange(referencedSymbol.references, ts.map(references, getReferenceEntryFromNode)); - } - } - /** `classSymbol` is the class where the constructor was defined. - * Reference the constructor and all calls to `new this()`. - */ - function findOwnConstructorCalls(classSymbol) { - var result = []; - for (var _i = 0, _a = classSymbol.members["__constructor"].declarations; _i < _a.length; _i++) { - var decl = _a[_i]; - ts.Debug.assert(decl.kind === 150 /* Constructor */); - var ctrKeyword = decl.getChildAt(0); - ts.Debug.assert(ctrKeyword.kind === 122 /* ConstructorKeyword */); - result.push(ctrKeyword); - } - ts.forEachProperty(classSymbol.exports, function (member) { - var decl = member.valueDeclaration; - if (decl && decl.kind === 149 /* MethodDeclaration */) { - var body = decl.body; - if (body) { - forEachDescendantOfKind(body, 98 /* ThisKeyword */, function (thisKeyword) { - if (ts.isNewExpressionTarget(thisKeyword)) { - result.push(thisKeyword); - } - }); - } - } - }); - return result; - } - /** Find references to `super` in the constructor of an extending class. */ - function superConstructorAccesses(cls) { - var symbol = cls.symbol; - var ctr = symbol.members["__constructor"]; - if (!ctr) { - return []; - } - var result = []; - for (var _i = 0, _a = ctr.declarations; _i < _a.length; _i++) { - var decl = _a[_i]; - ts.Debug.assert(decl.kind === 150 /* Constructor */); + classSymbol.exports.forEach(function (member) { + var decl = member.valueDeclaration; + if (decl && decl.kind === 150 /* MethodDeclaration */) { var body = decl.body; if (body) { - forEachDescendantOfKind(body, 96 /* SuperKeyword */, function (node) { - if (ts.isCallExpressionTarget(node)) { - result.push(node); + forEachDescendantOfKind(body, 98 /* ThisKeyword */, function (thisKeyword) { + if (ts.isNewExpressionTarget(thisKeyword)) { + addNode(thisKeyword); } }); } } - ; - return result; + }); + } + /** Find references to `super` in the constructor of an extending class. */ + function findSuperConstructorAccesses(cls, addNode) { + var symbol = cls.symbol; + var ctr = symbol.members.get("__constructor"); + if (!ctr) { + return; } - function getReferencedSymbol(symbol) { - var symbolId = ts.getSymbolId(symbol); - var index = symbolToIndex[symbolId]; - if (index === undefined) { - index = result.length; - symbolToIndex[symbolId] = index; - result.push({ - definition: getDefinition(symbol), - references: [] + for (var _i = 0, _a = ctr.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + ts.Debug.assert(decl.kind === 151 /* Constructor */); + var body = decl.body; + if (body) { + forEachDescendantOfKind(body, 96 /* SuperKeyword */, function (node) { + if (ts.isCallExpressionTarget(node)) { + addNode(node); + } }); } - return result[index]; - } - function addReferenceToRelatedSymbol(node, relatedSymbol) { - var references = getReferencedSymbol(relatedSymbol).references; - if (implementations) { - getImplementationReferenceEntryForNode(node, references); - } - else { - references.push(getReferenceEntryFromNode(node)); - } } } - function getImplementationReferenceEntryForNode(refNode, result) { + function addImplementationReferences(refNode, addReference, state) { // Check if we found a function/propertyAssignment/method with an implementation or initializer if (ts.isDeclarationName(refNode) && isImplementation(refNode.parent)) { - result.push(getReferenceEntryFromNode(refNode.parent)); + addReference(refNode.parent); + return; } - else if (refNode.kind === 70 /* Identifier */) { - if (refNode.parent.kind === 258 /* ShorthandPropertyAssignment */) { - // Go ahead and dereference the shorthand assignment by going to its definition - getReferenceEntriesForShorthandPropertyAssignment(refNode, typeChecker, result); - } - // Check if the node is within an extends or implements clause - var containingClass = getContainingClassIfInHeritageClause(refNode); - if (containingClass) { - result.push(getReferenceEntryFromNode(containingClass)); - return; - } - // If we got a type reference, try and see if the reference applies to any expressions that can implement an interface - var containingTypeReference = getContainingTypeReference(refNode); - if (containingTypeReference) { - var parent_18 = containingTypeReference.parent; - if (ts.isVariableLike(parent_18) && parent_18.type === containingTypeReference && parent_18.initializer && isImplementationExpression(parent_18.initializer)) { - maybeAdd(getReferenceEntryFromNode(parent_18.initializer)); - } - else if (ts.isFunctionLike(parent_18) && parent_18.type === containingTypeReference && parent_18.body) { - if (parent_18.body.kind === 204 /* Block */) { - ts.forEachReturnStatement(parent_18.body, function (returnStatement) { - if (returnStatement.expression && isImplementationExpression(returnStatement.expression)) { - maybeAdd(getReferenceEntryFromNode(returnStatement.expression)); - } - }); - } - else if (isImplementationExpression(parent_18.body)) { - maybeAdd(getReferenceEntryFromNode(parent_18.body)); - } - } - else if (ts.isAssertionExpression(parent_18) && isImplementationExpression(parent_18.expression)) { - maybeAdd(getReferenceEntryFromNode(parent_18.expression)); - } - } + if (refNode.kind !== 70 /* Identifier */) { + return; } - // Type nodes can contain multiple references to the same type. For example: - // let x: Foo & (Foo & Bar) = ... - // Because we are returning the implementation locations and not the identifier locations, - // duplicate entries would be returned here as each of the type references is part of - // the same implementation. For that reason, check before we add a new entry - function maybeAdd(a) { - if (!ts.forEach(result, function (b) { return a.fileName === b.fileName && a.textSpan.start === b.textSpan.start && a.textSpan.length === b.textSpan.length; })) { - result.push(a); + if (refNode.parent.kind === 261 /* ShorthandPropertyAssignment */) { + // Go ahead and dereference the shorthand assignment by going to its definition + getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); + } + // Check if the node is within an extends or implements clause + var containingClass = getContainingClassIfInHeritageClause(refNode); + if (containingClass) { + addReference(containingClass); + return; + } + // If we got a type reference, try and see if the reference applies to any expressions that can implement an interface + var containingTypeReference = getContainingTypeReference(refNode); + if (containingTypeReference && state.markSeenContainingTypeReference(containingTypeReference)) { + var parent = containingTypeReference.parent; + if (ts.isVariableLike(parent) && parent.type === containingTypeReference && parent.initializer && isImplementationExpression(parent.initializer)) { + addReference(parent.initializer); + } + else if (ts.isFunctionLike(parent) && parent.type === containingTypeReference && parent.body) { + if (parent.body.kind === 206 /* Block */) { + ts.forEachReturnStatement(parent.body, function (returnStatement) { + if (returnStatement.expression && isImplementationExpression(returnStatement.expression)) { + addReference(returnStatement.expression); + } + }); + } + else if (isImplementationExpression(parent.body)) { + addReference(parent.body); + } + } + else if (ts.isAssertionExpression(parent) && isImplementationExpression(parent.expression)) { + addReference(parent.expression); } } } @@ -69830,12 +75694,12 @@ var ts; } function getContainingClassIfInHeritageClause(node) { if (node && node.parent) { - if (node.kind === 199 /* ExpressionWithTypeArguments */ - && node.parent.kind === 255 /* HeritageClause */ + if (node.kind === 200 /* ExpressionWithTypeArguments */ + && node.parent.kind === 258 /* HeritageClause */ && ts.isClassLike(node.parent.parent)) { return node.parent.parent; } - else if (node.kind === 70 /* Identifier */ || node.kind === 177 /* PropertyAccessExpression */) { + else if (node.kind === 70 /* Identifier */ || node.kind === 178 /* PropertyAccessExpression */) { return getContainingClassIfInHeritageClause(node.parent); } } @@ -69845,15 +75709,18 @@ var ts; * Returns true if this is an expression that can be considered an implementation */ function isImplementationExpression(node) { - // Unwrap parentheses - if (node.kind === 183 /* ParenthesizedExpression */) { - return isImplementationExpression(node.expression); + switch (node.kind) { + case 184 /* ParenthesizedExpression */: + return isImplementationExpression(node.expression); + case 186 /* ArrowFunction */: + case 185 /* FunctionExpression */: + case 177 /* ObjectLiteralExpression */: + case 198 /* ClassExpression */: + case 176 /* ArrayLiteralExpression */: + return true; + default: + return false; } - return node.kind === 185 /* ArrowFunction */ || - node.kind === 184 /* FunctionExpression */ || - node.kind === 176 /* ObjectLiteralExpression */ || - node.kind === 197 /* ClassExpression */ || - node.kind === 175 /* ArrayLiteralExpression */; } /** * Determines if the parent symbol occurs somewhere in the child's ancestry. If the parent symbol @@ -69874,7 +75741,7 @@ var ts; * @param parent Another class or interface Symbol * @param cachedResults A map of symbol id pairs (i.e. "child,parent") to booleans indicating previous results */ - function explicitlyInheritsFrom(child, parent, cachedResults) { + function explicitlyInheritsFrom(child, parent, cachedResults, checker) { var parentIsInterface = parent.getFlags() & 64 /* Interface */; return searchHierarchy(child); function searchHierarchy(symbol) { @@ -69882,11 +75749,12 @@ var ts; return true; } var key = ts.getSymbolId(symbol) + "," + ts.getSymbolId(parent); - if (key in cachedResults) { - return cachedResults[key]; + var cached = cachedResults.get(key); + if (cached !== undefined) { + return cached; } // Set the key so that we don't infinitely recurse - cachedResults[key] = false; + cachedResults.set(key, false); var inherits = ts.forEach(symbol.getDeclarations(), function (declaration) { if (ts.isClassLike(declaration)) { if (parentIsInterface) { @@ -69902,19 +75770,19 @@ var ts; } return searchTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); } - else if (declaration.kind === 227 /* InterfaceDeclaration */) { + else if (declaration.kind === 229 /* InterfaceDeclaration */) { if (parentIsInterface) { return ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), searchTypeReference); } } return false; }); - cachedResults[key] = inherits; + cachedResults.set(key, inherits); return inherits; } function searchTypeReference(typeReference) { if (typeReference) { - var type = typeChecker.getTypeAtLocation(typeReference); + var type = checker.getTypeAtLocation(typeReference); if (type && type.symbol) { return searchHierarchy(type.symbol); } @@ -69930,13 +75798,13 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; @@ -69946,49 +75814,48 @@ var ts; var references = []; var sourceFile = searchSpaceNode.getSourceFile(); var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); - ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); + for (var _i = 0, possiblePositions_4 = possiblePositions; _i < possiblePositions_4.length; _i++) { + var position = possiblePositions_4[_i]; var node = ts.getTouchingWord(sourceFile, position); if (!node || node.kind !== 96 /* SuperKeyword */) { - return; + continue; } var container = ts.getSuperContainer(node, /*stopOnFunctions*/ false); // If we have a 'super' container, we must have an enclosing class. // Now make sure the owning class is the same as the search-space // and has the same static qualifier as the original 'super's owner. if (container && (32 /* Static */ & ts.getModifierFlags(container)) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) { - references.push(getReferenceEntryFromNode(node)); + references.push(FindAllReferences.nodeEntry(node)); } - }); - var definition = getDefinition(searchSpaceNode.symbol); - return [{ definition: definition, references: references }]; + } + return [{ definition: { type: "symbol", symbol: searchSpaceNode.symbol, node: superKeyword }, references: references }]; } - function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles) { + function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false); // Whether 'this' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } - // fall through - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + // falls through + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 261 /* SourceFile */: + case 264 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } - // Fall through - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: + // falls through + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. @@ -69997,8 +75864,9 @@ var ts; } var references = []; var possiblePositions; - if (searchSpaceNode.kind === 261 /* SourceFile */) { + if (searchSpaceNode.kind === 264 /* SourceFile */) { ts.forEach(sourceFiles, function (sourceFile) { + cancellationToken.throwIfCancellationRequested(); possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); }); @@ -70008,144 +75876,103 @@ var ts; possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, references); } - var thisOrSuperSymbol = typeChecker.getSymbolAtLocation(thisOrSuperKeyword); - var displayParts = thisOrSuperSymbol && ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, thisOrSuperSymbol, thisOrSuperKeyword.getSourceFile(), ts.getContainerNode(thisOrSuperKeyword), thisOrSuperKeyword).displayParts; return [{ - definition: { - containerKind: "", - containerName: "", - fileName: node.getSourceFile().fileName, - kind: ts.ScriptElementKind.variableElement, - name: "this", - textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()), - displayParts: displayParts - }, + definition: { type: "this", node: thisOrSuperKeyword }, references: references }]; function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result) { ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); var node = ts.getTouchingWord(sourceFile, position); if (!node || !ts.isThis(node)) { return; } var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); switch (searchSpaceNode.kind) { - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 227 /* FunctionDeclaration */: if (searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(node)); + result.push(FindAllReferences.nodeEntry(node)); } break; - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(node)); + result.push(FindAllReferences.nodeEntry(node)); } break; - case 197 /* ClassExpression */: - case 226 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 228 /* ClassDeclaration */: // Make sure the container belongs to the same class // and has the appropriate static modifier from the original container. if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32 /* Static */) === staticFlag) { - result.push(getReferenceEntryFromNode(node)); + result.push(FindAllReferences.nodeEntry(node)); } break; - case 261 /* SourceFile */: - if (container.kind === 261 /* SourceFile */ && !ts.isExternalModule(container)) { - result.push(getReferenceEntryFromNode(node)); + case 264 /* SourceFile */: + if (container.kind === 264 /* SourceFile */ && !ts.isExternalModule(container)) { + result.push(FindAllReferences.nodeEntry(node)); } break; } }); } } - function getReferencesForStringLiteral(node, sourceFiles) { - var type = ts.getStringLiteralTypeForNode(node, typeChecker); - if (!type) { - // nothing to do here. moving on - return undefined; - } + function getReferencesForStringLiteral(node, sourceFiles, cancellationToken) { var references = []; - for (var _i = 0, sourceFiles_9 = sourceFiles; _i < sourceFiles_9.length; _i++) { - var sourceFile = sourceFiles_9[_i]; - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, type.text, sourceFile.getStart(), sourceFile.getEnd()); - getReferencesForStringLiteralInFile(sourceFile, type, possiblePositions, references); + for (var _i = 0, sourceFiles_6 = sourceFiles; _i < sourceFiles_6.length; _i++) { + var sourceFile = sourceFiles_6[_i]; + cancellationToken.throwIfCancellationRequested(); + var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, node.text, sourceFile.getStart(), sourceFile.getEnd()); + getReferencesForStringLiteralInFile(sourceFile, node.text, possiblePositions, references); } return [{ - definition: { - containerKind: "", - containerName: "", - fileName: node.getSourceFile().fileName, - kind: ts.ScriptElementKind.variableElement, - name: type.text, - textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()), - displayParts: [ts.displayPart(ts.getTextOfNode(node), ts.SymbolDisplayPartKind.stringLiteral)] - }, + definition: { type: "string", node: node }, references: references }]; - function getReferencesForStringLiteralInFile(sourceFile, searchType, possiblePositions, references) { - for (var _i = 0, possiblePositions_1 = possiblePositions; _i < possiblePositions_1.length; _i++) { - var position = possiblePositions_1[_i]; - cancellationToken.throwIfCancellationRequested(); - var node_2 = ts.getTouchingWord(sourceFile, position); - if (!node_2 || node_2.kind !== 9 /* StringLiteral */) { - return; - } - var type_2 = ts.getStringLiteralTypeForNode(node_2, typeChecker); - if (type_2 === searchType) { - references.push(getReferenceEntryFromNode(node_2)); + function getReferencesForStringLiteralInFile(sourceFile, searchText, possiblePositions, references) { + for (var _i = 0, possiblePositions_5 = possiblePositions; _i < possiblePositions_5.length; _i++) { + var position = possiblePositions_5[_i]; + var node_7 = ts.getTouchingWord(sourceFile, position); + if (node_7 && node_7.kind === 9 /* StringLiteral */ && node_7.text === searchText) { + references.push(FindAllReferences.nodeEntry(node_7, /*isInString*/ true)); } } } } - function populateSearchSymbolSet(symbol, location) { + // For certain symbol kinds, we need to include other symbols in the search set. + // This is not needed when searching for re-exports. + function populateSearchSymbolSet(symbol, location, checker, implementations) { // The search set contains at least the current symbol var result = [symbol]; - // If the location is name of property symbol from object literal destructuring pattern - // Search the property symbol - // for ( { property: p2 } of elems) { } - var containingObjectLiteralElement = getContainingObjectLiteralElement(location); - if (containingObjectLiteralElement && containingObjectLiteralElement.kind !== 258 /* ShorthandPropertyAssignment */) { - var propertySymbol = getPropertySymbolOfDestructuringAssignment(location); - if (propertySymbol) { - result.push(propertySymbol); - } - } - // If the symbol is an alias, add what it aliases to the list - // import {a} from "mod"; - // export {a} - // If the symbol is an alias to default declaration, add what it aliases to the list - // declare "mod" { export default class B { } } - // import B from "mod"; - //// For export specifiers, the exported name can be referring to a local symbol, e.g.: - //// import {a} from "mod"; - //// export {a as somethingElse} - //// We want the *local* declaration of 'a' as declared in the import, - //// *not* as declared within "mod" (or farther) - var aliasSymbol = getAliasSymbolForPropertyNameSymbol(symbol, location); - if (aliasSymbol) { - result = result.concat(populateSearchSymbolSet(aliasSymbol, location)); - } - // If the location is in a context sensitive location (i.e. in an object literal) try - // to get a contextual type for it, and add the property symbol from the contextual - // type to the search set + var containingObjectLiteralElement = ts.getContainingObjectLiteralElement(location); if (containingObjectLiteralElement) { - ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement), function (contextualSymbol) { - ts.addRange(result, typeChecker.getRootSymbols(contextualSymbol)); + // If the location is name of property symbol from object literal destructuring pattern + // Search the property symbol + // for ( { property: p2 } of elems) { } + if (containingObjectLiteralElement.kind !== 261 /* ShorthandPropertyAssignment */) { + var propertySymbol = getPropertySymbolOfDestructuringAssignment(location, checker); + if (propertySymbol) { + result.push(propertySymbol); + } + } + // If the location is in a context sensitive location (i.e. in an object literal) try + // to get a contextual type for it, and add the property symbol from the contextual + // type to the search set + ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker), function (contextualSymbol) { + ts.addRange(result, checker.getRootSymbols(contextualSymbol)); }); /* Because in short-hand property assignment, location has two meaning : property name and as value of the property - * When we do findAllReference at the position of the short-hand property assignment, we would want to have references to position of - * property name and variable declaration of the identifier. - * Like in below example, when querying for all references for an identifier 'name', of the property assignment, the language service - * should show both 'name' in 'obj' and 'name' in variable declaration - * const name = "Foo"; - * const obj = { name }; - * In order to do that, we will populate the search set with the value symbol of the identifier as a value of the property assignment - * so that when matching with potential reference symbol, both symbols from property declaration and variable declaration - * will be included correctly. - */ - var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(location.parent); + * When we do findAllReference at the position of the short-hand property assignment, we would want to have references to position of + * property name and variable declaration of the identifier. + * Like in below example, when querying for all references for an identifier 'name', of the property assignment, the language service + * should show both 'name' in 'obj' and 'name' in variable declaration + * const name = "Foo"; + * const obj = { name }; + * In order to do that, we will populate the search set with the value symbol of the identifier as a value of the property assignment + * so that when matching with potential reference symbol, both symbols from property declaration and variable declaration + * will be included correctly. + */ + var shorthandValueSymbol = checker.getShorthandAssignmentValueSymbol(location.parent); if (shorthandValueSymbol) { result.push(shorthandValueSymbol); } @@ -70154,27 +75981,28 @@ var ts; // we should include both parameter declaration symbol and property declaration symbol // Parameter Declaration symbol is only visible within function scope, so the symbol is stored in constructor.locals. // Property Declaration symbol is a member of the class, so the symbol is stored in its class Declaration.symbol.members - if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 144 /* Parameter */ && + if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 145 /* Parameter */ && ts.isParameterPropertyDeclaration(symbol.valueDeclaration)) { - result = result.concat(typeChecker.getSymbolsOfParameterPropertyDeclaration(symbol.valueDeclaration, symbol.name)); + ts.addRange(result, checker.getSymbolsOfParameterPropertyDeclaration(symbol.valueDeclaration, symbol.name)); } // If this is symbol of binding element without propertyName declaration in Object binding pattern // Include the property in the search - var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol); + var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker); if (bindingElementPropertySymbol) { result.push(bindingElementPropertySymbol); } // If this is a union property, add all the symbols from all its source symbols in all unioned types. // If the symbol is an instantiation from a another symbol (e.g. widened symbol) , add the root the list - ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) { + for (var _i = 0, _a = checker.getRootSymbols(symbol); _i < _a.length; _i++) { + var rootSymbol = _a[_i]; if (rootSymbol !== symbol) { result.push(rootSymbol); } // Add symbol of properties/methods of the same name in base classes and implemented interfaces definitions if (!implementations && rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, /*previousIterationSymbolsCache*/ ts.createMap()); + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, /*previousIterationSymbolsCache*/ ts.createMap(), checker); } - }); + } return result; } /** @@ -70185,7 +76013,7 @@ var ts; * @param previousIterationSymbolsCache a cache of symbol from previous iterations of calling this function to prevent infinite revisiting of the same symbol. * The value of previousIterationSymbol is undefined when the function is first called. */ - function getPropertySymbolsFromBaseTypes(symbol, propertyName, result, previousIterationSymbolsCache) { + function getPropertySymbolsFromBaseTypes(symbol, propertyName, result, previousIterationSymbolsCache, checker) { if (!symbol) { return; } @@ -70200,7 +76028,7 @@ var ts; // the function will add any found symbol of the property-name, then its sub-routine will call // getPropertySymbolsFromBaseTypes again to walk up any base types to prevent revisiting already // visited symbol, interface "C", the sub-routine will pass the current symbol as previousIterationSymbol. - if (symbol.name in previousIterationSymbolsCache) { + if (previousIterationSymbolsCache.has(symbol.name)) { return; } if (symbol.flags & (32 /* Class */ | 64 /* Interface */)) { @@ -70209,7 +76037,7 @@ var ts; getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 227 /* InterfaceDeclaration */) { + else if (declaration.kind === 229 /* InterfaceDeclaration */) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -70217,37 +76045,30 @@ var ts; return; function getPropertySymbolFromTypeReference(typeReference) { if (typeReference) { - var type = typeChecker.getTypeAtLocation(typeReference); + var type = checker.getTypeAtLocation(typeReference); if (type) { - var propertySymbol = typeChecker.getPropertyOfType(type, propertyName); + var propertySymbol = checker.getPropertyOfType(type, propertyName); if (propertySymbol) { - result.push.apply(result, typeChecker.getRootSymbols(propertySymbol)); + result.push.apply(result, checker.getRootSymbols(propertySymbol)); } // Visit the typeReference as well to see if it directly or indirectly use that property - previousIterationSymbolsCache[symbol.name] = symbol; - getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result, previousIterationSymbolsCache); + previousIterationSymbolsCache.set(symbol.name, symbol); + getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result, previousIterationSymbolsCache, checker); } } } } - function getRelatedSymbol(searchSymbols, referenceSymbol, referenceLocation, searchLocationIsConstructor, parents, cache) { - if (ts.contains(searchSymbols, referenceSymbol)) { - // If we are searching for constructor uses, they must be 'new' expressions. - return (!searchLocationIsConstructor || ts.isNewExpressionTarget(referenceLocation)) && referenceSymbol; - } - // If the reference symbol is an alias, check if what it is aliasing is one of the search - // symbols but by looking up for related symbol of this alias so it can handle multiple level of indirectness. - var aliasSymbol = getAliasSymbolForPropertyNameSymbol(referenceSymbol, referenceLocation); - if (aliasSymbol) { - return getRelatedSymbol(searchSymbols, aliasSymbol, referenceLocation, searchLocationIsConstructor, parents, cache); + function getRelatedSymbol(search, referenceSymbol, referenceLocation, state) { + if (search.includes(referenceSymbol)) { + return referenceSymbol; } // If the reference location is in an object literal, try to get the contextual type for the // object literal, lookup the property symbol in the contextual type, and use this symbol to // compare to our searchSymbol - var containingObjectLiteralElement = getContainingObjectLiteralElement(referenceLocation); + var containingObjectLiteralElement = ts.getContainingObjectLiteralElement(referenceLocation); if (containingObjectLiteralElement) { - var contextualSymbol = ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement), function (contextualSymbol) { - return ts.forEach(typeChecker.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); + var contextualSymbol = ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement, state.checker), function (contextualSymbol) { + return ts.find(state.checker.getRootSymbols(contextualSymbol), search.includes); }); if (contextualSymbol) { return contextualSymbol; @@ -70256,23 +76077,23 @@ var ts; // Get the property symbol from the object literal's type and look if thats the search symbol // In below eg. get 'property' from type of elems iterating type // for ( { property: p2 } of elems) { } - var propertySymbol = getPropertySymbolOfDestructuringAssignment(referenceLocation); - if (propertySymbol && searchSymbols.indexOf(propertySymbol) >= 0) { + var propertySymbol = getPropertySymbolOfDestructuringAssignment(referenceLocation, state.checker); + if (propertySymbol && search.includes(propertySymbol)) { return propertySymbol; } } // If the reference location is the binding element and doesn't have property name // then include the binding element in the related symbols // let { a } : { a }; - var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(referenceSymbol); - if (bindingElementPropertySymbol && searchSymbols.indexOf(bindingElementPropertySymbol) >= 0) { + var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(referenceSymbol, state.checker); + if (bindingElementPropertySymbol && search.includes(bindingElementPropertySymbol)) { return bindingElementPropertySymbol; } // Unwrap symbols to get to the root (e.g. transient symbols as a result of widening) // Or a union property, use its underlying unioned symbols - return ts.forEach(typeChecker.getRootSymbols(referenceSymbol), function (rootSymbol) { + return ts.forEach(state.checker.getRootSymbols(referenceSymbol), function (rootSymbol) { // if it is in the list, then we are done - if (searchSymbols.indexOf(rootSymbol) >= 0) { + if (search.includes(rootSymbol)) { return rootSymbol; } // Finally, try all properties with the same name in any type the containing type extended or implemented, and @@ -70280,20 +76101,18 @@ var ts; // parent symbol if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { // Parents will only be defined if implementations is true - if (parents) { - if (!ts.forEach(parents, function (parent) { return explicitlyInheritsFrom(rootSymbol.parent, parent, cache); })) { - return undefined; - } + if (search.parents && !ts.some(search.parents, function (parent) { return explicitlyInheritsFrom(rootSymbol.parent, parent, state.inheritsFromCache, state.checker); })) { + return undefined; } - var result_4 = []; - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_4, /*previousIterationSymbolsCache*/ ts.createMap()); - return ts.forEach(result_4, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); + var result = []; + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, /*previousIterationSymbolsCache*/ ts.createMap(), state.checker); + return ts.find(result, search.includes); } return undefined; }); } function getNameFromObjectLiteralElement(node) { - if (node.name.kind === 142 /* ComputedPropertyName */) { + if (node.name.kind === 143 /* ComputedPropertyName */) { var nameExpression = node.name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteral(nameExpression)) { @@ -70303,15 +76122,16 @@ var ts; } return node.name.text; } - function getPropertySymbolsFromContextualType(node) { + /** Gets all symbols for one property. Does not get symbols for every property. */ + function getPropertySymbolsFromContextualType(node, checker) { var objectLiteral = node.parent; - var contextualType = typeChecker.getContextualType(objectLiteral); + var contextualType = checker.getContextualType(objectLiteral); var name = getNameFromObjectLiteralElement(node); if (name && contextualType) { var result_5 = []; - var symbol_2 = contextualType.getProperty(name); - if (symbol_2) { - result_5.push(symbol_2); + var symbol = contextualType.getProperty(name); + if (symbol) { + result_5.push(symbol); } if (contextualType.flags & 65536 /* Union */) { ts.forEach(contextualType.types, function (t) { @@ -70325,13 +76145,14 @@ var ts; } return undefined; } - /** Given an initial searchMeaning, extracted from a location, widen the search scope based on the declarations - * of the corresponding symbol. e.g. if we are searching for "Foo" in value position, but "Foo" references a class - * then we need to widen the search to include type positions as well. - * On the contrary, if we are searching for "Bar" in type position and we trace bar to an interface, and an uninstantiated - * module, we want to keep the search limited to only types, as the two declarations (interface and uninstantiated module) - * do not intersect in any of the three spaces. - */ + /** + * Given an initial searchMeaning, extracted from a location, widen the search scope based on the declarations + * of the corresponding symbol. e.g. if we are searching for "Foo" in value position, but "Foo" references a class + * then we need to widen the search to include type positions as well. + * On the contrary, if we are searching for "Bar" in type position and we trace bar to an interface, and an uninstantiated + * module, we want to keep the search limited to only types, as the two declarations (interface and uninstantiated module) + * do not intersect in any of the three spaces. + */ function getIntersectingMeaningFromDeclarations(meaning, declarations) { if (declarations) { var lastIterationMeaning = void 0; @@ -70342,8 +76163,8 @@ var ts; // To achieve that we will keep iterating until the result stabilizes. // Remember the last meaning lastIterationMeaning = meaning; - for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { - var declaration = declarations_8[_i]; + for (var _i = 0, declarations_11 = declarations; _i < declarations_11.length; _i++) { + var declaration = declarations_11[_i]; var declarationMeaning = ts.getMeaningFromDeclaration(declaration); if (declarationMeaning & meaning) { meaning |= declarationMeaning; @@ -70353,143 +76174,93 @@ var ts; } return meaning; } - } - FindAllReferences.getReferencedSymbolsForNode = getReferencedSymbolsForNode; - function convertReferences(referenceSymbols) { - if (!referenceSymbols) { - return undefined; - } - var referenceEntries = []; - for (var _i = 0, referenceSymbols_1 = referenceSymbols; _i < referenceSymbols_1.length; _i++) { - var referenceSymbol = referenceSymbols_1[_i]; - ts.addRange(referenceEntries, referenceSymbol.references); - } - return referenceEntries; - } - FindAllReferences.convertReferences = convertReferences; - function isImplementation(node) { - if (!node) { + function isImplementation(node) { + if (!node) { + return false; + } + else if (ts.isVariableLike(node)) { + if (node.initializer) { + return true; + } + else if (node.kind === 225 /* VariableDeclaration */) { + var parentStatement = getParentStatementOfVariableDeclaration(node); + return parentStatement && ts.hasModifier(parentStatement, 2 /* Ambient */); + } + } + else if (ts.isFunctionLike(node)) { + return !!node.body || ts.hasModifier(node, 2 /* Ambient */); + } + else { + switch (node.kind) { + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 231 /* EnumDeclaration */: + case 232 /* ModuleDeclaration */: + return true; + } + } return false; } - else if (ts.isVariableLike(node)) { - if (node.initializer) { - return true; - } - else if (node.kind === 223 /* VariableDeclaration */) { - var parentStatement = getParentStatementOfVariableDeclaration(node); - return parentStatement && ts.hasModifier(parentStatement, 2 /* Ambient */); + function getParentStatementOfVariableDeclaration(node) { + if (node.parent && node.parent.parent && node.parent.parent.kind === 207 /* VariableStatement */) { + ts.Debug.assert(node.parent.kind === 226 /* VariableDeclarationList */); + return node.parent.parent; } } - else if (ts.isFunctionLike(node)) { - return !!node.body || ts.hasModifier(node, 2 /* Ambient */); - } - else { - switch (node.kind) { - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 229 /* EnumDeclaration */: - case 230 /* ModuleDeclaration */: - return true; - } - } - return false; - } - function getParentStatementOfVariableDeclaration(node) { - if (node.parent && node.parent.parent && node.parent.parent.kind === 205 /* VariableStatement */) { - ts.Debug.assert(node.parent.kind === 224 /* VariableDeclarationList */); - return node.parent.parent; - } - } - function getReferenceEntriesForShorthandPropertyAssignment(node, typeChecker, result) { - var refSymbol = typeChecker.getSymbolAtLocation(node); - var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(refSymbol.valueDeclaration); - if (shorthandSymbol) { - for (var _i = 0, _a = shorthandSymbol.getDeclarations(); _i < _a.length; _i++) { - var declaration = _a[_i]; - if (ts.getMeaningFromDeclaration(declaration) & 1 /* Value */) { - result.push(getReferenceEntryFromNode(declaration)); + function getReferenceEntriesForShorthandPropertyAssignment(node, checker, addReference) { + var refSymbol = checker.getSymbolAtLocation(node); + var shorthandSymbol = checker.getShorthandAssignmentValueSymbol(refSymbol.valueDeclaration); + if (shorthandSymbol) { + for (var _i = 0, _a = shorthandSymbol.getDeclarations(); _i < _a.length; _i++) { + var declaration = _a[_i]; + if (ts.getMeaningFromDeclaration(declaration) & 1 /* Value */) { + addReference(declaration); + } } } } - } - FindAllReferences.getReferenceEntriesForShorthandPropertyAssignment = getReferenceEntriesForShorthandPropertyAssignment; - function getReferenceEntryFromNode(node) { - var start = node.getStart(); - var end = node.getEnd(); - if (node.kind === 9 /* StringLiteral */) { - start += 1; - end -= 1; - } - return { - fileName: node.getSourceFile().fileName, - textSpan: ts.createTextSpanFromBounds(start, end), - isWriteAccess: isWriteAccess(node), - isDefinition: ts.isDeclarationName(node) || ts.isLiteralComputedPropertyDeclarationName(node) - }; - } - FindAllReferences.getReferenceEntryFromNode = getReferenceEntryFromNode; - /** A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment */ - function isWriteAccess(node) { - if (node.kind === 70 /* Identifier */ && ts.isDeclarationName(node)) { - return true; - } - var parent = node.parent; - if (parent) { - if (parent.kind === 191 /* PostfixUnaryExpression */ || parent.kind === 190 /* PrefixUnaryExpression */) { - return true; - } - else if (parent.kind === 192 /* BinaryExpression */ && parent.left === node) { - var operator = parent.operatorToken.kind; - return 57 /* FirstAssignment */ <= operator && operator <= 69 /* LastAssignment */; - } - } - return false; - } - function forEachDescendantOfKind(node, kind, action) { - ts.forEachChild(node, function (child) { - if (child.kind === kind) { - action(child); - } - forEachDescendantOfKind(child, kind, action); - }); - } - /** - * Returns the containing object literal property declaration given a possible name node, e.g. "a" in x = { "a": 1 } - */ - function getContainingObjectLiteralElement(node) { - switch (node.kind) { - case 9 /* StringLiteral */: - case 8 /* NumericLiteral */: - if (node.parent.kind === 142 /* ComputedPropertyName */) { - return isObjectLiteralPropertyDeclaration(node.parent.parent) ? node.parent.parent : undefined; + Core.getReferenceEntriesForShorthandPropertyAssignment = getReferenceEntriesForShorthandPropertyAssignment; + function forEachDescendantOfKind(node, kind, action) { + ts.forEachChild(node, function (child) { + if (child.kind === kind) { + action(child); } - // intential fall through - case 70 /* Identifier */: - return isObjectLiteralPropertyDeclaration(node.parent) && node.parent.name === node ? node.parent : undefined; + forEachDescendantOfKind(child, kind, action); + }); } - return undefined; - } - function isObjectLiteralPropertyDeclaration(node) { - switch (node.kind) { - case 257 /* PropertyAssignment */: - case 258 /* ShorthandPropertyAssignment */: - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - return true; + /** Get `C` given `N` if `N` is in the position `class C extends N` or `class C extends foo.N` where `N` is an identifier. */ + function tryGetClassByExtendingIdentifier(node) { + return ts.tryGetClassExtendingExpressionWithTypeArguments(ts.climbPastPropertyAccess(node).parent); } - return false; - } - /** Get `C` given `N` if `N` is in the position `class C extends N` or `class C extends foo.N` where `N` is an identifier. */ - function tryGetClassByExtendingIdentifier(node) { - return ts.tryGetClassExtendingExpressionWithTypeArguments(ts.climbPastPropertyAccess(node).parent); - } - function isNameOfExternalModuleImportOrDeclaration(node) { - if (node.kind === 9 /* StringLiteral */) { - return ts.isNameOfModuleDeclaration(node) || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node); + function isNameOfExternalModuleImportOrDeclaration(node) { + if (node.kind === 9 /* StringLiteral */) { + return ts.isNameOfModuleDeclaration(node) || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node); + } + return false; } - return false; - } + /** + * If we are just looking for implementations and this is a property access expression, we need to get the + * symbol of the local type of the symbol the property is being accessed on. This is because our search + * symbol may have a different parent symbol if the local type's symbol does not declare the property + * being accessed (i.e. it is declared in some parent class or interface) + */ + function getParentSymbolsOfPropertyAccess(location, symbol, checker) { + var propertyAccessExpression = getPropertyAccessExpressionFromRightHandSide(location); + if (!propertyAccessExpression) { + return undefined; + } + var localParentType = checker.getTypeAtLocation(propertyAccessExpression.expression); + if (!localParentType) { + return undefined; + } + if (localParentType.symbol && localParentType.symbol.flags & (32 /* Class */ | 64 /* Interface */) && localParentType.symbol !== symbol.parent) { + return [localParentType.symbol]; + } + else if (localParentType.flags & 196608 /* UnionOrIntersection */) { + return getSymbolsForClassAndInterfaceComponents(localParentType); + } + } + })(Core = FindAllReferences.Core || (FindAllReferences.Core = {})); })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); /* @internal */ @@ -70510,11 +76281,9 @@ var ts; // Type reference directives var typeReferenceDirective = findReferenceInPosition(sourceFile.typeReferenceDirectives, position); if (typeReferenceDirective) { - var referenceFile = program.getResolvedTypeReferenceDirectives()[typeReferenceDirective.fileName]; - if (referenceFile && referenceFile.resolvedFileName) { - return [getDefinitionInfoForFileReference(typeReferenceDirective.fileName, referenceFile.resolvedFileName)]; - } - return undefined; + var referenceFile = program.getResolvedTypeReferenceDirectives().get(typeReferenceDirective.fileName); + return referenceFile && referenceFile.resolvedFileName && + [getDefinitionInfoForFileReference(typeReferenceDirective.fileName, referenceFile.resolvedFileName)]; } var node = ts.getTouchingPropertyName(sourceFile, position); if (node === sourceFile) { @@ -70524,7 +76293,7 @@ var ts; if (ts.isJumpStatementTarget(node)) { var labelName = node.text; var label = ts.getTargetLabel(node.parent, node.text); - return label ? [createDefinitionInfo(label, ts.ScriptElementKind.label, labelName, /*containerName*/ undefined)] : undefined; + return label ? [createDefinitionInfoFromName(label, ts.ScriptElementKind.label, labelName, /*containerName*/ undefined)] : undefined; } var typeChecker = program.getTypeChecker(); var calledDeclaration = tryGetSignatureDeclaration(typeChecker, node); @@ -70550,7 +76319,7 @@ var ts; // if (node.kind === 70 /* Identifier */ && (node.parent === declaration || - (declaration.kind === 239 /* ImportSpecifier */ && declaration.parent && declaration.parent.kind === 238 /* NamedImports */))) { + (declaration.kind === 241 /* ImportSpecifier */ && declaration.parent && declaration.parent.kind === 240 /* NamedImports */))) { symbol = typeChecker.getAliasedSymbol(symbol); } } @@ -70559,7 +76328,7 @@ var ts; // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. - if (node.parent.kind === 258 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 261 /* ShorthandPropertyAssignment */) { var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); if (!shorthandSymbol) { return []; @@ -70570,6 +76339,37 @@ var ts; var shorthandContainerName_1 = typeChecker.symbolToString(symbol.parent, node); return ts.map(shorthandDeclarations, function (declaration) { return createDefinitionInfo(declaration, shorthandSymbolKind_1, shorthandSymbolName_1, shorthandContainerName_1); }); } + if (ts.isJsxOpeningLikeElement(node.parent)) { + // If there are errors when trying to figure out stateless component function, just return the first declaration + // For example: + // declare function /*firstSource*/MainButton(buttonProps: ButtonProps): JSX.Element; + // declare function /*secondSource*/MainButton(linkProps: LinkProps): JSX.Element; + // declare function /*thirdSource*/MainButton(props: ButtonProps | LinkProps): JSX.Element; + // let opt =
; // Error - We get undefined for resolved signature indicating an error, then just return the first declaration + var _a = getSymbolInfo(typeChecker, symbol, node), symbolName = _a.symbolName, symbolKind = _a.symbolKind, containerName = _a.containerName; + return [createDefinitionInfo(symbol.valueDeclaration, symbolKind, symbolName, containerName)]; + } + // If the current location we want to find its definition is in an object literal, try to get the contextual type for the + // object literal, lookup the property symbol in the contextual type, and use this for goto-definition. + // For example + // interface Props{ + // /*first*/prop1: number + // prop2: boolean + // } + // function Foo(arg: Props) {} + // Foo( { pr/*1*/op1: 10, prop2: true }) + var element = ts.getContainingObjectLiteralElement(node); + if (element) { + if (typeChecker.getContextualType(element.parent)) { + var result = []; + var propertySymbols = ts.getPropertySymbolsFromContextualType(typeChecker, element); + for (var _i = 0, propertySymbols_1 = propertySymbols; _i < propertySymbols_1.length; _i++) { + var propertySymbol = propertySymbols_1[_i]; + result.push.apply(result, getDefinitionFromSymbol(typeChecker, propertySymbol, node)); + } + return result; + } + } return getDefinitionFromSymbol(typeChecker, symbol, node); } GoToDefinition.getDefinitionAtPosition = getDefinitionAtPosition; @@ -70639,31 +76439,47 @@ var ts; return false; } function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { + if (!signatureDeclarations) { + return false; + } var declarations = []; var definition; - ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 150 /* Constructor */) || - (!selectConstructors && (d.kind === 225 /* FunctionDeclaration */ || d.kind === 149 /* MethodDeclaration */ || d.kind === 148 /* MethodSignature */))) { + for (var _i = 0, signatureDeclarations_1 = signatureDeclarations; _i < signatureDeclarations_1.length; _i++) { + var d = signatureDeclarations_1[_i]; + if (selectConstructors ? d.kind === 151 /* Constructor */ : isSignatureDeclaration(d)) { declarations.push(d); if (d.body) definition = d; } - }); - if (definition) { - result.push(createDefinitionInfo(definition, symbolKind, symbolName, containerName)); - return true; } - else if (declarations.length) { - result.push(createDefinitionInfo(ts.lastOrUndefined(declarations), symbolKind, symbolName, containerName)); + if (declarations.length) { + result.push(createDefinitionInfo(definition || ts.lastOrUndefined(declarations), symbolKind, symbolName, containerName)); return true; } return false; } } + function isSignatureDeclaration(node) { + switch (node.kind) { + case 151 /* Constructor */: + case 227 /* FunctionDeclaration */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + return true; + default: + return false; + } + } + /** Creates a DefinitionInfo from a Declaration, using the declaration's name if possible. */ function createDefinitionInfo(node, symbolKind, symbolName, containerName) { + return createDefinitionInfoFromName(node.name || node, symbolKind, symbolName, containerName); + } + /** Creates a DefinitionInfo directly from the name of a declaration. */ + function createDefinitionInfoFromName(name, symbolKind, symbolName, containerName) { + var sourceFile = name.getSourceFile(); return { - fileName: node.getSourceFile().fileName, - textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()), + fileName: sourceFile.fileName, + textSpan: ts.createTextSpanFromNode(name, sourceFile), kind: symbolKind, name: symbolName, containerKind: undefined, @@ -70711,46 +76527,20 @@ var ts; } function tryGetSignatureDeclaration(typeChecker, node) { var callLike = getAncestorCallLikeExpression(node); - return callLike && typeChecker.getResolvedSignature(callLike).declaration; + var signature = callLike && typeChecker.getResolvedSignature(callLike); + if (signature) { + var decl = signature.declaration; + if (decl && isSignatureDeclaration(decl)) { + return decl; + } + } + // Don't go to a function type, go to the value having that type. + return undefined; } })(GoToDefinition = ts.GoToDefinition || (ts.GoToDefinition = {})); })(ts || (ts = {})); /* @internal */ var ts; -(function (ts) { - var GoToImplementation; - (function (GoToImplementation) { - function getImplementationAtPosition(typeChecker, cancellationToken, sourceFiles, node) { - // If invoked directly on a shorthand property assignment, then return - // the declaration of the symbol being assigned (not the symbol being assigned to). - if (node.parent.kind === 258 /* ShorthandPropertyAssignment */) { - var result = []; - ts.FindAllReferences.getReferenceEntriesForShorthandPropertyAssignment(node, typeChecker, result); - return result.length > 0 ? result : undefined; - } - else if (node.kind === 96 /* SuperKeyword */ || ts.isSuperProperty(node.parent)) { - // References to and accesses on the super keyword only have one possible implementation, so no - // need to "Find all References" - var symbol = typeChecker.getSymbolAtLocation(node); - return symbol.valueDeclaration && [ts.FindAllReferences.getReferenceEntryFromNode(symbol.valueDeclaration)]; - } - else { - // Perform "Find all References" and retrieve only those that are implementations - var referencedSymbols = ts.FindAllReferences.getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFiles, /*findInStrings*/ false, /*findInComments*/ false, /*implementations*/ true); - var result = ts.flatMap(referencedSymbols, function (symbol) { - return ts.map(symbol.references, function (_a) { - var textSpan = _a.textSpan, fileName = _a.fileName; - return ({ textSpan: textSpan, fileName: fileName }); - }); - }); - return result && result.length > 0 ? result : undefined; - } - } - GoToImplementation.getImplementationAtPosition = getImplementationAtPosition; - })(GoToImplementation = ts.GoToImplementation || (ts.GoToImplementation = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; (function (ts) { var JsDoc; (function (JsDoc) { @@ -70777,6 +76567,7 @@ var ts; "lends", "link", "memberOf", + "method", "name", "namespace", "param", @@ -70795,7 +76586,8 @@ var ts; "prop", "version" ]; - var jsDocCompletionEntries; + var jsDocTagNameCompletionEntries; + var jsDocTagCompletionEntries; function getJsDocCommentsFromDeclarations(declarations) { // Only collect doc comments from duplicate declarations once: // In case of a union property there might be same declaration multiple times @@ -70822,6 +76614,30 @@ var ts; return documentationComment; } JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; + function getJsDocTagsFromDeclarations(declarations) { + // Only collect doc comments from duplicate declarations once. + var tags = []; + forEachUnique(declarations, function (declaration) { + var jsDocs = ts.getJSDocs(declaration); + if (!jsDocs) { + return; + } + for (var _i = 0, jsDocs_1 = jsDocs; _i < jsDocs_1.length; _i++) { + var doc = jsDocs_1[_i]; + var tagsForDoc = doc.tags; + if (tagsForDoc) { + tags.push.apply(tags, tagsForDoc.filter(function (tag) { return tag.kind === 283 /* JSDocTag */; }).map(function (jsDocTag) { + return { + name: jsDocTag.tagName.text, + text: jsDocTag.comment + }; + })); + } + } + }); + return tags; + } + JsDoc.getJsDocTagsFromDeclarations = getJsDocTagsFromDeclarations; /** * Iterates through 'array' by index and performs the callback on each element of array until the callback * returns a truthy value, then returns that value. @@ -70829,7 +76645,7 @@ var ts; */ function forEachUnique(array, callback) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { if (ts.indexOf(array, array[i]) === i) { var result = callback(array[i], i); if (result) { @@ -70840,8 +76656,8 @@ var ts; } return undefined; } - function getAllJsDocCompletionEntries() { - return jsDocCompletionEntries || (jsDocCompletionEntries = ts.map(jsDocTagNames, function (tagName) { + function getJSDocTagNameCompletions() { + return jsDocTagNameCompletionEntries || (jsDocTagNameCompletionEntries = ts.map(jsDocTagNames, function (tagName) { return { name: tagName, kind: ts.ScriptElementKind.keyword, @@ -70850,7 +76666,18 @@ var ts; }; })); } - JsDoc.getAllJsDocCompletionEntries = getAllJsDocCompletionEntries; + JsDoc.getJSDocTagNameCompletions = getJSDocTagNameCompletions; + function getJSDocTagCompletions() { + return jsDocTagCompletionEntries || (jsDocTagCompletionEntries = ts.map(jsDocTagNames, function (tagName) { + return { + name: "@" + tagName, + kind: ts.ScriptElementKind.keyword, + kindModifiers: "", + sortText: "0" + }; + })); + } + JsDoc.getJSDocTagCompletions = getJSDocTagCompletions; /** * Checks if position points to a valid position to add JSDoc comments, and if so, * returns the appropriate template. Otherwise returns an empty string. @@ -70889,19 +76716,19 @@ var ts; var commentOwner; findOwner: for (commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) { switch (commentOwner.kind) { - case 225 /* FunctionDeclaration */: - case 149 /* MethodDeclaration */: - case 150 /* Constructor */: - case 226 /* ClassDeclaration */: - case 205 /* VariableStatement */: + case 227 /* FunctionDeclaration */: + case 150 /* MethodDeclaration */: + case 151 /* Constructor */: + case 228 /* ClassDeclaration */: + case 207 /* VariableStatement */: break findOwner; - case 261 /* SourceFile */: + case 264 /* SourceFile */: return undefined; - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: // If in walking up the tree, we hit a a nested namespace declaration, // then we must be somewhere within a dotted namespace name; however we don't // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. - if (commentOwner.parent.kind === 230 /* ModuleDeclaration */) { + if (commentOwner.parent.kind === 232 /* ModuleDeclaration */) { return undefined; } break findOwner; @@ -70913,14 +76740,21 @@ var ts; var parameters = getParametersForJsDocOwningNode(commentOwner); var posLineAndChar = sourceFile.getLineAndCharacterOfPosition(position); var lineStart = sourceFile.getLineStarts()[posLineAndChar.line]; - var indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character); + // replace non-whitespace characters in prefix with spaces. + var indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character).replace(/\S/i, function () { return " "; }); + var isJavaScriptFile = ts.hasJavaScriptFileExtension(sourceFile.fileName); var docParams = ""; - for (var i = 0, numParams = parameters.length; i < numParams; i++) { + for (var i = 0; i < parameters.length; i++) { var currentName = parameters[i].name; var paramName = currentName.kind === 70 /* Identifier */ ? currentName.text : "param" + i; - docParams += indentationStr + " * @param " + paramName + newLine; + if (isJavaScriptFile) { + docParams += indentationStr + " * @param {any} " + paramName + newLine; + } + else { + docParams += indentationStr + " * @param " + paramName + newLine; + } } // A doc comment consists of the following // * The opening comment line @@ -70942,7 +76776,7 @@ var ts; if (ts.isFunctionLike(commentOwner)) { return commentOwner.parameters; } - if (commentOwner.kind === 205 /* VariableStatement */) { + if (commentOwner.kind === 207 /* VariableStatement */) { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; if (varDeclarations.length === 1 && varDeclarations[0].initializer) { @@ -70960,17 +76794,17 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 183 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 184 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: return rightHandSide.parameters; - case 197 /* ClassExpression */: + case 198 /* ClassExpression */: for (var _i = 0, _a = rightHandSide.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 150 /* Constructor */) { + if (member.kind === 151 /* Constructor */) { return member.parameters; } } @@ -70990,8 +76824,6 @@ var ts; (function (ts) { var JsTyping; (function (JsTyping) { - ; - ; // A map of loose file names to library names // that we are confident require typings var safeList; @@ -71028,7 +76860,7 @@ var ts; }); if (!safeList) { var result = ts.readConfigFile(safeListPath, function (path) { return host.readFile(path); }); - safeList = result.config ? ts.createMap(result.config) : EmptySafeList; + safeList = result.config ? ts.createMapFromTemplate(result.config) : EmptySafeList; } var filesToWatch = []; // Directories to search for package.json, bower.json and other typing information @@ -71047,41 +76879,43 @@ var ts; getTypingNamesFromJson(packageJsonPath, filesToWatch); var bowerJsonPath = ts.combinePaths(searchDir, "bower.json"); getTypingNamesFromJson(bowerJsonPath, filesToWatch); + var bowerComponentsPath = ts.combinePaths(searchDir, "bower_components"); + getTypingNamesFromPackagesFolder(bowerComponentsPath); var nodeModulesPath = ts.combinePaths(searchDir, "node_modules"); - getTypingNamesFromNodeModuleFolder(nodeModulesPath); + getTypingNamesFromPackagesFolder(nodeModulesPath); } getTypingNamesFromSourceFileNames(fileNames); // add typings for unresolved imports if (unresolvedImports) { for (var _a = 0, unresolvedImports_1 = unresolvedImports; _a < unresolvedImports_1.length; _a++) { var moduleId = unresolvedImports_1[_a]; - var typingName = moduleId in nodeCoreModules ? "node" : moduleId; - if (!(typingName in inferredTypings)) { - inferredTypings[typingName] = undefined; + var typingName = nodeCoreModules.has(moduleId) ? "node" : moduleId; + if (!inferredTypings.has(typingName)) { + inferredTypings.set(typingName, undefined); } } } // Add the cached typing locations for inferred typings that are already installed - for (var name_45 in packageNameToTypingLocation) { - if (name_45 in inferredTypings && !inferredTypings[name_45]) { - inferredTypings[name_45] = packageNameToTypingLocation[name_45]; + packageNameToTypingLocation.forEach(function (typingLocation, name) { + if (inferredTypings.has(name) && inferredTypings.get(name) === undefined) { + inferredTypings.set(name, typingLocation); } - } + }); // Remove typings that the user has added to the exclude list for (var _b = 0, exclude_1 = exclude; _b < exclude_1.length; _b++) { var excludeTypingName = exclude_1[_b]; - delete inferredTypings[excludeTypingName]; + inferredTypings.delete(excludeTypingName); } var newTypingNames = []; var cachedTypingPaths = []; - for (var typing in inferredTypings) { - if (inferredTypings[typing] !== undefined) { - cachedTypingPaths.push(inferredTypings[typing]); + inferredTypings.forEach(function (inferred, typing) { + if (inferred !== undefined) { + cachedTypingPaths.push(inferred); } else { newTypingNames.push(typing); } - } + }); return { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch }; /** * Merge a given list of typingNames to the inferredTypings map @@ -71092,8 +76926,8 @@ var ts; } for (var _i = 0, typingNames_1 = typingNames; _i < typingNames_1.length; _i++) { var typing = typingNames_1[_i]; - if (!(typing in inferredTypings)) { - inferredTypings[typing] = undefined; + if (!inferredTypings.has(typing)) { + inferredTypings.set(typing, undefined); } } } @@ -71132,7 +76966,7 @@ var ts; var inferredTypingNames = ts.map(jsFileNames, function (f) { return ts.removeFileExtension(ts.getBaseFileName(f.toLowerCase())); }); var cleanedTypingNames = ts.map(inferredTypingNames, function (f) { return f.replace(/((?:\.|-)min(?=\.|$))|((?:-|\.)\d+)/g, ""); }); if (safeList !== EmptySafeList) { - mergeTypings(ts.filter(cleanedTypingNames, function (f) { return f in safeList; })); + mergeTypings(ts.filter(cleanedTypingNames, function (f) { return safeList.has(f); })); } var hasJsxFile = ts.forEach(fileNames, function (f) { return ts.ensureScriptKind(f, ts.getScriptKindFromFileName(f)) === 2 /* JSX */; }); if (hasJsxFile) { @@ -71140,20 +76974,22 @@ var ts; } } /** - * Infer typing names from node_module folder - * @param nodeModulesPath is the path to the "node_modules" folder + * Infer typing names from packages folder (ex: node_module, bower_components) + * @param packagesFolderPath is the path to the packages folder */ - function getTypingNamesFromNodeModuleFolder(nodeModulesPath) { + function getTypingNamesFromPackagesFolder(packagesFolderPath) { + filesToWatch.push(packagesFolderPath); // Todo: add support for ModuleResolutionHost too - if (!host.directoryExists(nodeModulesPath)) { + if (!host.directoryExists(packagesFolderPath)) { return; } var typingNames = []; - var fileNames = host.readDirectory(nodeModulesPath, [".json"], /*excludes*/ undefined, /*includes*/ undefined, /*depth*/ 2); + var fileNames = host.readDirectory(packagesFolderPath, [".json"], /*excludes*/ undefined, /*includes*/ undefined, /*depth*/ 2); for (var _i = 0, fileNames_2 = fileNames; _i < fileNames_2.length; _i++) { var fileName = fileNames_2[_i]; var normalizedFileName = ts.normalizePath(fileName); - if (ts.getBaseFileName(normalizedFileName) !== "package.json") { + var baseFileName = ts.getBaseFileName(normalizedFileName); + if (baseFileName !== "package.json" && baseFileName !== "bower.json") { continue; } var result = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); }); @@ -71164,7 +77000,7 @@ var ts; // npm 3's package.json contains a "_requiredBy" field // we should include all the top level module names for npm 2, and only module names whose // "_requiredBy" field starts with "#" or equals "/" for npm 3. - if (packageJson._requiredBy && + if (baseFileName === "package.json" && packageJson._requiredBy && ts.filter(packageJson._requiredBy, function (r) { return r[0] === "#" || r === "/"; }).length === 0) { continue; } @@ -71175,7 +77011,7 @@ var ts; } if (packageJson.typings) { var absolutePath = ts.getNormalizedAbsolutePath(packageJson.typings, ts.getDirectoryPath(normalizedFileName)); - inferredTypings[packageJson.name] = absolutePath; + inferredTypings.set(packageJson.name, absolutePath); } else { typingNames.push(packageJson.name); @@ -71195,47 +77031,49 @@ var ts; function getNavigateToItems(sourceFiles, checker, cancellationToken, searchValue, maxResultCount, excludeDtsFiles) { var patternMatcher = ts.createPatternMatcher(searchValue); var rawItems = []; - // Search the declarations in all files and output matched NavigateToItem into array of NavigateToItem[] - ts.forEach(sourceFiles, function (sourceFile) { + var _loop_4 = function (sourceFile) { cancellationToken.throwIfCancellationRequested(); if (excludeDtsFiles && ts.fileExtensionIs(sourceFile.fileName, ".d.ts")) { - return; + return "continue"; } - var nameToDeclarations = sourceFile.getNamedDeclarations(); - for (var name_46 in nameToDeclarations) { - var declarations = nameToDeclarations[name_46]; + ts.forEachEntry(sourceFile.getNamedDeclarations(), function (declarations, name) { if (declarations) { // First do a quick check to see if the name of the declaration matches the // last portion of the (possibly) dotted name they're searching for. - var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_46); + var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name); if (!matches) { - continue; + return; // continue to next named declarations } - for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) { - var declaration = declarations_9[_i]; + for (var _i = 0, declarations_12 = declarations; _i < declarations_12.length; _i++) { + var declaration = declarations_12[_i]; // It was a match! If the pattern has dots in it, then also see if the // declaration container matches as well. if (patternMatcher.patternContainsDots) { var containers = getContainers(declaration); if (!containers) { - return undefined; + return true; // Break out of named declarations and go to the next source file. } - matches = patternMatcher.getMatches(containers, name_46); + matches = patternMatcher.getMatches(containers, name); if (!matches) { - continue; + return; // continue to next named declarations } } var fileName = sourceFile.fileName; var matchKind = bestMatchKind(matches); - rawItems.push({ name: name_46, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); + rawItems.push({ name: name, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); } } - } - }); + }); + }; + // Search the declarations in all files and output matched NavigateToItem into array of NavigateToItem[] + for (var _i = 0, sourceFiles_7 = sourceFiles; _i < sourceFiles_7.length; _i++) { + var sourceFile = sourceFiles_7[_i]; + _loop_4(sourceFile); + } // Remove imports when the imported declaration is already in the list and has the same name. rawItems = ts.filter(rawItems, function (item) { var decl = item.declaration; - if (decl.kind === 236 /* ImportClause */ || decl.kind === 239 /* ImportSpecifier */ || decl.kind === 234 /* ImportEqualsDeclaration */) { + if (decl.kind === 238 /* ImportClause */ || decl.kind === 241 /* ImportSpecifier */ || decl.kind === 236 /* ImportEqualsDeclaration */) { var importer = checker.getSymbolAtLocation(decl.name); var imported = checker.getAliasedSymbol(importer); return importer.name !== imported.name; @@ -71277,7 +77115,7 @@ var ts; if (text !== undefined) { containers.unshift(text); } - else if (declaration.name.kind === 142 /* ComputedPropertyName */) { + else if (declaration.name.kind === 143 /* ComputedPropertyName */) { return tryAddComputedPropertyName(declaration.name.expression, containers, /*includeLastPortion*/ true); } else { @@ -71298,7 +77136,7 @@ var ts; } return true; } - if (expression.kind === 177 /* PropertyAccessExpression */) { + if (expression.kind === 178 /* PropertyAccessExpression */) { var propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); @@ -71311,7 +77149,7 @@ var ts; var containers = []; // First, if we started with a computed property name, then add all but the last // portion into the container array. - if (declaration.name.kind === 142 /* ComputedPropertyName */) { + if (declaration.name.kind === 143 /* ComputedPropertyName */) { if (!tryAddComputedPropertyName(declaration.name.expression, containers, /*includeLastPortion*/ false)) { return undefined; } @@ -71357,7 +77195,7 @@ var ts; matchKind: ts.PatternMatchKind[rawItem.matchKind], isCaseSensitive: rawItem.isCaseSensitive, fileName: rawItem.fileName, - textSpan: ts.createTextSpanFromBounds(declaration.getStart(), declaration.getEnd()), + textSpan: ts.createTextSpanFromNode(declaration), // TODO(jfreeman): What should be the containerName when the container has a computed name? containerName: container && container.name ? container.name.text : "", containerKind: container && container.name ? ts.getNodeKind(container) : "" @@ -71373,22 +77211,61 @@ var ts; (function (ts) { var NavigationBar; (function (NavigationBar) { - function getNavigationBarItems(sourceFile) { + /** + * Matches all whitespace characters in a string. Eg: + * + * "app. + * + * onactivated" + * + * matches because of the newline, whereas + * + * "app.onactivated" + * + * does not match. + */ + var whiteSpaceRegex = /\s+/g; + // Keep sourceFile handy so we don't have to search for it every time we need to call `getText`. + var curCancellationToken; + var curSourceFile; + /** + * For performance, we keep navigation bar parents on a stack rather than passing them through each recursion. + * `parent` is the current parent and is *not* stored in parentsStack. + * `startNode` sets a new parent and `endNode` returns to the previous parent. + */ + var parentsStack = []; + var parent; + // NavigationBarItem requires an array, but will not mutate it, so just give it this for performance. + var emptyChildItemArray = []; + function getNavigationBarItems(sourceFile, cancellationToken) { + curCancellationToken = cancellationToken; curSourceFile = sourceFile; - var result = ts.map(topLevelItems(rootNavigationBarNode(sourceFile)), convertToTopLevelItem); - curSourceFile = undefined; - return result; + try { + return ts.map(topLevelItems(rootNavigationBarNode(sourceFile)), convertToTopLevelItem); + } + finally { + reset(); + } } NavigationBar.getNavigationBarItems = getNavigationBarItems; - function getNavigationTree(sourceFile) { + function getNavigationTree(sourceFile, cancellationToken) { + curCancellationToken = cancellationToken; curSourceFile = sourceFile; - var result = convertToTree(rootNavigationBarNode(sourceFile)); - curSourceFile = undefined; - return result; + try { + return convertToTree(rootNavigationBarNode(sourceFile)); + } + finally { + reset(); + } } NavigationBar.getNavigationTree = getNavigationTree; - // Keep sourceFile handy so we don't have to search for it every time we need to call `getText`. - var curSourceFile; + function reset() { + curSourceFile = undefined; + curCancellationToken = undefined; + parentsStack = []; + parent = undefined; + emptyChildItemArray = []; + } function nodeText(node) { return node.getText(curSourceFile); } @@ -71403,13 +77280,6 @@ var ts; parent.children = [child]; } } - /* - For performance, we keep navigation bar parents on a stack rather than passing them through each recursion. - `parent` is the current parent and is *not* stored in parentsStack. - `startNode` sets a new parent and `endNode` returns to the previous parent. - */ - var parentsStack = []; - var parent; function rootNavigationBarNode(sourceFile) { ts.Debug.assert(!parentsStack.length); var root = { node: sourceFile, additionalNodes: undefined, parent: undefined, children: undefined, indent: 0 }; @@ -71460,11 +77330,12 @@ var ts; } /** Look for navigation bar items in node's subtree, adding them to the current `parent`. */ function addChildrenRecursively(node) { + curCancellationToken.throwIfCancellationRequested(); if (!node || ts.isToken(node)) { return; } switch (node.kind) { - case 150 /* Constructor */: + case 151 /* Constructor */: // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it. var ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); @@ -71476,21 +77347,21 @@ var ts; } } break; - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 148 /* MethodSignature */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 149 /* MethodSignature */: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 236 /* ImportClause */: + case 238 /* ImportClause */: var importClause = node; // Handle default import case e.g.: // import d from "mod"; @@ -71502,7 +77373,7 @@ var ts; // import {a, b as B} from "mod"; var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 237 /* NamespaceImport */) { + if (namedBindings.kind === 239 /* NamespaceImport */) { addLeafNode(namedBindings); } else { @@ -71513,12 +77384,12 @@ var ts; } } break; - case 174 /* BindingElement */: - case 223 /* VariableDeclaration */: + case 175 /* BindingElement */: + case 225 /* VariableDeclaration */: var decl = node; - var name_47 = decl.name; - if (ts.isBindingPattern(name_47)) { - addChildrenRecursively(name_47); + var name = decl.name; + if (ts.isBindingPattern(name)) { + addChildrenRecursively(name); } else if (decl.initializer && isFunctionOrClassExpression(decl.initializer)) { // For `const x = function() {}`, just use the function node, not the const. @@ -71528,12 +77399,12 @@ var ts; addNodeWithRecursiveChild(decl, decl.initializer); } break; - case 185 /* ArrowFunction */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: startNode(node); for (var _d = 0, _e = node.members; _d < _e.length; _d++) { var member = _e[_d]; @@ -71543,9 +77414,9 @@ var ts; } endNode(); break; - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 229 /* InterfaceDeclaration */: startNode(node); for (var _f = 0, _g = node.members; _f < _g.length; _f++) { var member = _g[_f]; @@ -71553,21 +77424,21 @@ var ts; } endNode(); break; - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 243 /* ExportSpecifier */: - case 234 /* ImportEqualsDeclaration */: - case 155 /* IndexSignature */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 228 /* TypeAliasDeclaration */: + case 245 /* ExportSpecifier */: + case 236 /* ImportEqualsDeclaration */: + case 156 /* IndexSignature */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 230 /* TypeAliasDeclaration */: addLeafNode(node); break; default: ts.forEach(node.jsDoc, function (jsDoc) { ts.forEach(jsDoc.tags, function (tag) { - if (tag.kind === 285 /* JSDocTypedefTag */) { + if (tag.kind === 289 /* JSDocTypedefTag */) { addLeafNode(tag); } }); @@ -71585,9 +77456,9 @@ var ts; // Anonymous items are never merged. return true; } - var itemsWithSameName = nameToItems[name]; + var itemsWithSameName = nameToItems.get(name); if (!itemsWithSameName) { - nameToItems[name] = child; + nameToItems.set(name, child); return true; } if (itemsWithSameName instanceof Array) { @@ -71605,7 +77476,7 @@ var ts; if (tryMerge(itemWithSameName, child)) { return false; } - nameToItems[name] = [itemWithSameName, child]; + nameToItems.set(name, [itemWithSameName, child]); return true; } function tryMerge(a, b) { @@ -71618,14 +77489,14 @@ var ts; }); /** a and b have the same name, but they may not be mergeable. */ function shouldReallyMerge(a, b) { - return a.kind === b.kind && (a.kind !== 230 /* ModuleDeclaration */ || areSameModule(a, b)); + return a.kind === b.kind && (a.kind !== 232 /* ModuleDeclaration */ || areSameModule(a, b)); // We use 1 NavNode to represent 'A.B.C', but there are multiple source nodes. // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'! function areSameModule(a, b) { if (a.body.kind !== b.body.kind) { return false; } - if (a.body.kind !== 230 /* ModuleDeclaration */) { + if (a.body.kind !== 232 /* ModuleDeclaration */) { return true; } return areSameModule(a.body, b.body); @@ -71653,39 +77524,20 @@ var ts; function compareChildren(child1, child2) { var name1 = tryGetName(child1.node), name2 = tryGetName(child2.node); if (name1 && name2) { - var cmp = localeCompareFix(name1, name2); + var cmp = ts.compareStringsCaseInsensitive(name1, name2); return cmp !== 0 ? cmp : navigationBarNodeKind(child1) - navigationBarNodeKind(child2); } else { return name1 ? 1 : name2 ? -1 : navigationBarNodeKind(child1) - navigationBarNodeKind(child2); } } - // Intl is missing in Safari, and node 0.10 treats "a" as greater than "B". - var localeCompareIsCorrect = ts.collator && ts.collator.compare("a", "B") < 0; - var localeCompareFix = localeCompareIsCorrect ? ts.collator.compare : function (a, b) { - // This isn't perfect, but it passes all of our tests. - for (var i = 0; i < Math.min(a.length, b.length); i++) { - var chA = a.charAt(i), chB = b.charAt(i); - if (chA === "\"" && chB === "'") { - return 1; - } - if (chA === "'" && chB === "\"") { - return -1; - } - var cmp = ts.compareStrings(chA.toLocaleLowerCase(), chB.toLocaleLowerCase()); - if (cmp !== 0) { - return cmp; - } - } - return a.length - b.length; - }; /** * This differs from getItemName because this is just used for sorting. * We only sort nodes by name that have a more-or-less "direct" name, as opposed to `new()` and the like. * So `new()` can still come before an `aardvark` method. */ function tryGetName(node) { - if (node.kind === 230 /* ModuleDeclaration */) { + if (node.kind === 232 /* ModuleDeclaration */) { return getModuleName(node); } var decl = node; @@ -71693,18 +77545,18 @@ var ts; return ts.getPropertyNameForPropertyNameNode(decl.name); } switch (node.kind) { - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 197 /* ClassExpression */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 198 /* ClassExpression */: return getFunctionOrClassName(node); - case 285 /* JSDocTypedefTag */: + case 289 /* JSDocTypedefTag */: return getJSDocTypedefTagName(node); default: return undefined; } } function getItemName(node) { - if (node.kind === 230 /* ModuleDeclaration */) { + if (node.kind === 232 /* ModuleDeclaration */) { return getModuleName(node); } var name = node.name; @@ -71715,16 +77567,16 @@ var ts; } } switch (node.kind) { - case 261 /* SourceFile */: + case 264 /* SourceFile */: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : ""; - case 185 /* ArrowFunction */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: + case 186 /* ArrowFunction */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: if (ts.getModifierFlags(node) & 512 /* Default */) { return "default"; } @@ -71732,15 +77584,15 @@ var ts; // (eg: "app\n.onactivated"), so we should remove the whitespace for readabiltiy in the // navigation bar. return getFunctionOrClassName(node); - case 150 /* Constructor */: + case 151 /* Constructor */: return "constructor"; - case 154 /* ConstructSignature */: + case 155 /* ConstructSignature */: return "new()"; - case 153 /* CallSignature */: + case 154 /* CallSignature */: return "()"; - case 155 /* IndexSignature */: + case 156 /* IndexSignature */: return "[]"; - case 285 /* JSDocTypedefTag */: + case 289 /* JSDocTypedefTag */: return getJSDocTypedefTagName(node); default: return ""; @@ -71752,7 +77604,7 @@ var ts; } else { var parentNode = node.parent && node.parent.parent; - if (parentNode && parentNode.kind === 205 /* VariableStatement */) { + if (parentNode && parentNode.kind === 207 /* VariableStatement */) { if (parentNode.declarationList.declarations.length > 0) { var nameIdentifier = parentNode.declarationList.declarations[0].name; if (nameIdentifier.kind === 70 /* Identifier */) { @@ -71781,24 +77633,24 @@ var ts; return topLevel; function isTopLevel(item) { switch (navigationBarNodeKind(item)) { - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 229 /* EnumDeclaration */: - case 227 /* InterfaceDeclaration */: - case 230 /* ModuleDeclaration */: - case 261 /* SourceFile */: - case 228 /* TypeAliasDeclaration */: - case 285 /* JSDocTypedefTag */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 231 /* EnumDeclaration */: + case 229 /* InterfaceDeclaration */: + case 232 /* ModuleDeclaration */: + case 264 /* SourceFile */: + case 230 /* TypeAliasDeclaration */: + case 289 /* JSDocTypedefTag */: return true; - case 150 /* Constructor */: - case 149 /* MethodDeclaration */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 223 /* VariableDeclaration */: + case 151 /* Constructor */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 225 /* VariableDeclaration */: return hasSomeImportantChild(item); - case 185 /* ArrowFunction */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -71808,10 +77660,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 231 /* ModuleBlock */: - case 261 /* SourceFile */: - case 149 /* MethodDeclaration */: - case 150 /* Constructor */: + case 233 /* ModuleBlock */: + case 264 /* SourceFile */: + case 150 /* MethodDeclaration */: + case 151 /* Constructor */: return true; default: return hasSomeImportantChild(item); @@ -71820,18 +77672,16 @@ var ts; function hasSomeImportantChild(item) { return ts.forEach(item.children, function (child) { var childKind = navigationBarNodeKind(child); - return childKind !== 223 /* VariableDeclaration */ && childKind !== 174 /* BindingElement */; + return childKind !== 225 /* VariableDeclaration */ && childKind !== 175 /* BindingElement */; }); } } } - // NavigationBarItem requires an array, but will not mutate it, so just give it this for performance. - var emptyChildItemArray = []; function convertToTree(n) { return { text: getItemName(n.node), kind: ts.getNodeKind(n.node), - kindModifiers: ts.getNodeModifiers(n.node), + kindModifiers: getModifiers(n.node), spans: getSpans(n), childItems: ts.map(n.children, convertToTree) }; @@ -71840,7 +77690,7 @@ var ts; return { text: getItemName(n.node), kind: ts.getNodeKind(n.node), - kindModifiers: ts.getNodeModifiers(n.node), + kindModifiers: getModifiers(n.node), spans: getSpans(n), childItems: ts.map(n.children, convertToChildItem) || emptyChildItemArray, indent: n.indent, @@ -71878,7 +77728,7 @@ var ts; // Otherwise, we need to aggregate each identifier to build up the qualified name. var result = []; result.push(moduleDeclaration.name.text); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 230 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 232 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(moduleDeclaration.name.text); } @@ -71889,28 +77739,34 @@ var ts; * We store 'A' as associated with a NavNode, and use getModuleName to traverse down again. */ function getInteriorModule(decl) { - return decl.body.kind === 230 /* ModuleDeclaration */ ? getInteriorModule(decl.body) : decl; + return decl.body.kind === 232 /* ModuleDeclaration */ ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 142 /* ComputedPropertyName */; + return !member.name || member.name.kind === 143 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 261 /* SourceFile */ + return node.kind === 264 /* SourceFile */ ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) - : ts.createTextSpanFromBounds(node.getStart(curSourceFile), node.getEnd()); + : ts.createTextSpanFromNode(node, curSourceFile); + } + function getModifiers(node) { + if (node.parent && node.parent.kind === 225 /* VariableDeclaration */) { + node = node.parent; + } + return ts.getNodeModifiers(node); } function getFunctionOrClassName(node) { if (node.name && ts.getFullWidth(node.name) > 0) { return ts.declarationNameToString(node.name); } - else if (node.parent.kind === 223 /* VariableDeclaration */) { + else if (node.parent.kind === 225 /* VariableDeclaration */) { return ts.declarationNameToString(node.parent.name); } - else if (node.parent.kind === 192 /* BinaryExpression */ && + else if (node.parent.kind === 193 /* BinaryExpression */ && node.parent.operatorToken.kind === 57 /* EqualsToken */) { return nodeText(node.parent.left).replace(whiteSpaceRegex, ""); } - else if (node.parent.kind === 257 /* PropertyAssignment */ && node.parent.name) { + else if (node.parent.kind === 260 /* PropertyAssignment */ && node.parent.name) { return nodeText(node.parent.name); } else if (ts.getModifierFlags(node) & 512 /* Default */) { @@ -71921,22 +77777,8 @@ var ts; } } function isFunctionOrClassExpression(node) { - return node.kind === 184 /* FunctionExpression */ || node.kind === 185 /* ArrowFunction */ || node.kind === 197 /* ClassExpression */; + return node.kind === 185 /* FunctionExpression */ || node.kind === 186 /* ArrowFunction */ || node.kind === 198 /* ClassExpression */; } - /** - * Matches all whitespace characters in a string. Eg: - * - * "app. - * - * onactivated" - * - * matches because of the newline, whereas - * - * "app.onactivated" - * - * does not match. - */ - var whiteSpaceRegex = /\s+/g; })(NavigationBar = ts.NavigationBar || (ts.NavigationBar = {})); })(ts || (ts = {})); /* @internal */ @@ -71944,29 +77786,29 @@ var ts; (function (ts) { var OutliningElementsCollector; (function (OutliningElementsCollector) { - function collectElements(sourceFile) { + function collectElements(sourceFile, cancellationToken) { var elements = []; var collapseText = "..."; function addOutliningSpan(hintSpanNode, startElement, endElement, autoCollapse) { if (hintSpanNode && startElement && endElement) { - var span_12 = { + var span_13 = { textSpan: ts.createTextSpanFromBounds(startElement.pos, endElement.end), - hintSpan: ts.createTextSpanFromBounds(hintSpanNode.getStart(), hintSpanNode.end), + hintSpan: ts.createTextSpanFromNode(hintSpanNode, sourceFile), bannerText: collapseText, autoCollapse: autoCollapse }; - elements.push(span_12); + elements.push(span_13); } } function addOutliningSpanComments(commentSpan, autoCollapse) { if (commentSpan) { - var span_13 = { + var span_14 = { textSpan: ts.createTextSpanFromBounds(commentSpan.pos, commentSpan.end), hintSpan: ts.createTextSpanFromBounds(commentSpan.pos, commentSpan.end), bannerText: collapseText, autoCollapse: autoCollapse }; - elements.push(span_13); + elements.push(span_14); } } function addOutliningForLeadingCommentsForNode(n) { @@ -71978,6 +77820,7 @@ var ts; var singleLineCommentCount = 0; for (var _i = 0, comments_4 = comments; _i < comments_4.length; _i++) { var currentComment = comments_4[_i]; + cancellationToken.throwIfCancellationRequested(); // For single line comments, combine consecutive ones (2 or more) into // a single span from the start of the first till the end of the last if (currentComment.kind === 2 /* SingleLineCommentTrivia */) { @@ -72003,19 +77846,20 @@ var ts; // Only outline spans of two or more consecutive single line comments if (count > 1) { var multipleSingleLineComments = { + kind: 2 /* SingleLineCommentTrivia */, pos: start, end: end, - kind: 2 /* SingleLineCommentTrivia */ }; addOutliningSpanComments(multipleSingleLineComments, /*autoCollapse*/ false); } } function autoCollapse(node) { - return ts.isFunctionBlock(node) && node.parent.kind !== 185 /* ArrowFunction */; + return ts.isFunctionBlock(node) && node.parent.kind !== 186 /* ArrowFunction */; } var depth = 0; var maxDepth = 20; function walk(n) { + cancellationToken.throwIfCancellationRequested(); if (depth > maxDepth) { return; } @@ -72023,30 +77867,30 @@ var ts; addOutliningForLeadingCommentsForNode(n); } switch (n.kind) { - case 204 /* Block */: + case 206 /* Block */: if (!ts.isFunctionBlock(n)) { - var parent_19 = n.parent; + var parent = n.parent; var openBrace = ts.findChildOfKind(n, 16 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 17 /* CloseBraceToken */, sourceFile); // Check if the block is standalone, or 'attached' to some parent statement. // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. - if (parent_19.kind === 209 /* DoStatement */ || - parent_19.kind === 212 /* ForInStatement */ || - parent_19.kind === 213 /* ForOfStatement */ || - parent_19.kind === 211 /* ForStatement */ || - parent_19.kind === 208 /* IfStatement */ || - parent_19.kind === 210 /* WhileStatement */ || - parent_19.kind === 217 /* WithStatement */ || - parent_19.kind === 256 /* CatchClause */) { - addOutliningSpan(parent_19, openBrace, closeBrace, autoCollapse(n)); + if (parent.kind === 211 /* DoStatement */ || + parent.kind === 214 /* ForInStatement */ || + parent.kind === 215 /* ForOfStatement */ || + parent.kind === 213 /* ForStatement */ || + parent.kind === 210 /* IfStatement */ || + parent.kind === 212 /* WhileStatement */ || + parent.kind === 219 /* WithStatement */ || + parent.kind === 259 /* CatchClause */) { + addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); break; } - if (parent_19.kind === 221 /* TryStatement */) { + if (parent.kind === 223 /* TryStatement */) { // Could be the try-block, or the finally-block. - var tryStatement = parent_19; + var tryStatement = parent; if (tryStatement.tryBlock === n) { - addOutliningSpan(parent_19, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); break; } else if (tryStatement.finallyBlock === n) { @@ -72056,36 +77900,37 @@ var ts; break; } } + // fall through. } // Block was a standalone block. In this case we want to only collapse // the span of the block, independent of any parent span. - var span_14 = ts.createTextSpanFromBounds(n.getStart(), n.end); + var span_15 = ts.createTextSpanFromNode(n); elements.push({ - textSpan: span_14, - hintSpan: span_14, + textSpan: span_15, + hintSpan: span_15, bannerText: collapseText, autoCollapse: autoCollapse(n) }); break; } - // Fallthrough. - case 231 /* ModuleBlock */: { + // falls through + case 233 /* ModuleBlock */: { var openBrace = ts.findChildOfKind(n, 16 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 17 /* CloseBraceToken */, sourceFile); addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); break; } - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: - case 229 /* EnumDeclaration */: - case 176 /* ObjectLiteralExpression */: - case 232 /* CaseBlock */: { + case 228 /* ClassDeclaration */: + case 229 /* InterfaceDeclaration */: + case 231 /* EnumDeclaration */: + case 177 /* ObjectLiteralExpression */: + case 234 /* CaseBlock */: { var openBrace = ts.findChildOfKind(n, 16 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 17 /* CloseBraceToken */, sourceFile); addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); break; } - case 175 /* ArrayLiteralExpression */: + case 176 /* ArrayLiteralExpression */: var openBracket = ts.findChildOfKind(n, 20 /* OpenBracketToken */, sourceFile); var closeBracket = ts.findChildOfKind(n, 21 /* CloseBracketToken */, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); @@ -72181,10 +78026,11 @@ var ts; return totalMatch; } function getWordSpans(word) { - if (!(word in stringToWordSpans)) { - stringToWordSpans[word] = breakIntoWordSpans(word); + var spans = stringToWordSpans.get(word); + if (!spans) { + stringToWordSpans.set(word, spans = breakIntoWordSpans(word)); } - return stringToWordSpans[word]; + return spans; } function matchTextChunk(candidate, chunk, punctuationStripped) { var index = indexOfIgnoringCase(candidate, chunk.textLowerCase); @@ -72212,10 +78058,10 @@ var ts; // But we would match 'FooAttribute' (since 'Attribute' starts with 'a'). var wordSpans = getWordSpans(candidate); for (var _i = 0, wordSpans_1 = wordSpans; _i < wordSpans_1.length; _i++) { - var span_15 = wordSpans_1[_i]; - if (partStartsWith(candidate, span_15, chunk.text, /*ignoreCase:*/ true)) { + var span_16 = wordSpans_1[_i]; + if (partStartsWith(candidate, span_16, chunk.text, /*ignoreCase:*/ true)) { return createPatternMatch(PatternMatchKind.substring, punctuationStripped, - /*isCaseSensitive:*/ partStartsWith(candidate, span_15, chunk.text, /*ignoreCase:*/ false)); + /*isCaseSensitive:*/ partStartsWith(candidate, span_16, chunk.text, /*ignoreCase:*/ false)); } } } @@ -72465,7 +78311,8 @@ var ts; } // Assumes 'value' is already lowercase. function indexOfIgnoringCase(string, value) { - for (var i = 0, n = string.length - value.length; i <= n; i++) { + var n = string.length - value.length; + for (var i = 0; i <= n; i++) { if (startsWithIgnoringCase(string, value, i)) { return i; } @@ -72474,7 +78321,7 @@ var ts; } // Assumes 'value' is already lowercase. function startsWithIgnoringCase(string, value, start) { - for (var i = 0, n = value.length; i < n; i++) { + for (var i = 0; i < value.length; i++) { var ch1 = toLowerCase(string.charCodeAt(i + start)); var ch2 = value.charCodeAt(i); if (ch1 !== ch2) { @@ -72546,7 +78393,7 @@ var ts; function breakIntoSpans(identifier, word) { var result = []; var wordStart = 0; - for (var i = 1, n = identifier.length; i < n; i++) { + for (var i = 1; i < identifier.length; i++) { var lastIsDigit = isDigit(identifier.charCodeAt(i - 1)); var currentIsDigit = isDigit(identifier.charCodeAt(i)); var hasTransitionFromLowerToUpper = transitionFromLowerToUpper(identifier, word, i); @@ -72758,7 +78605,7 @@ var ts; else { if (token === 70 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 138 /* FromKeyword */) { + if (token === 139 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import d from "mod"; @@ -72789,7 +78636,7 @@ var ts; } if (token === 17 /* CloseBraceToken */) { token = nextToken(); - if (token === 138 /* FromKeyword */) { + if (token === 139 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import {a as A} from "mod"; @@ -72805,7 +78652,7 @@ var ts; token = nextToken(); if (token === 70 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 138 /* FromKeyword */) { + if (token === 139 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import * as NS from "mod" @@ -72835,7 +78682,7 @@ var ts; } if (token === 17 /* CloseBraceToken */) { token = nextToken(); - if (token === 138 /* FromKeyword */) { + if (token === 139 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // export {a as A} from "mod"; @@ -72847,7 +78694,7 @@ var ts; } else if (token === 38 /* AsteriskToken */) { token = nextToken(); - if (token === 138 /* FromKeyword */) { + if (token === 139 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // export * from "mod" @@ -72999,93 +78846,89 @@ var ts; var Rename; (function (Rename) { function getRenameInfo(typeChecker, defaultLibFileName, getCanonicalFileName, sourceFile, position) { - var canonicalDefaultLibName = getCanonicalFileName(ts.normalizePath(defaultLibFileName)); + var getCanonicalDefaultLibName = ts.memoize(function () { return getCanonicalFileName(ts.normalizePath(defaultLibFileName)); }); var node = ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ true); - if (node) { - if (node.kind === 70 /* Identifier */ || - node.kind === 9 /* StringLiteral */ || - ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || - ts.isThis(node)) { - var symbol = typeChecker.getSymbolAtLocation(node); - // Only allow a symbol to be renamed if it actually has at least one declaration. - if (symbol) { - var declarations = symbol.getDeclarations(); - if (declarations && declarations.length > 0) { - // Disallow rename for elements that are defined in the standard TypeScript library. - if (ts.forEach(declarations, isDefinedInLibraryFile)) { - return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library)); - } - var displayName = ts.stripQuotes(ts.getDeclaredName(typeChecker, symbol, node)); - var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - if (kind) { - return { - canRename: true, - kind: kind, - displayName: displayName, - localizedErrorMessage: undefined, - fullDisplayName: typeChecker.getFullyQualifiedName(symbol), - kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), - triggerSpan: createTriggerSpanForNode(node, sourceFile) - }; - } - } - } - else if (node.kind === 9 /* StringLiteral */) { - var type = ts.getStringLiteralTypeForNode(node, typeChecker); - if (type) { - if (isDefinedInLibraryFile(node)) { - return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library)); - } - else { - var displayName = ts.stripQuotes(type.text); - return { - canRename: true, - kind: ts.ScriptElementKind.variableElement, - displayName: displayName, - localizedErrorMessage: undefined, - fullDisplayName: displayName, - kindModifiers: ts.ScriptElementKindModifier.none, - triggerSpan: createTriggerSpanForNode(node, sourceFile) - }; - } - } - } - } - } - return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_this_element)); - function getRenameInfoError(localizedErrorMessage) { - return { - canRename: false, - localizedErrorMessage: localizedErrorMessage, - displayName: undefined, - fullDisplayName: undefined, - kind: undefined, - kindModifiers: undefined, - triggerSpan: undefined - }; - } + var renameInfo = node && nodeIsEligibleForRename(node) + ? getRenameInfoForNode(node, typeChecker, sourceFile, isDefinedInLibraryFile) + : undefined; + return renameInfo || getRenameInfoError(ts.Diagnostics.You_cannot_rename_this_element); function isDefinedInLibraryFile(declaration) { - if (defaultLibFileName) { - var sourceFile_1 = declaration.getSourceFile(); - var canonicalName = getCanonicalFileName(ts.normalizePath(sourceFile_1.fileName)); - if (canonicalName === canonicalDefaultLibName) { - return true; - } + if (!defaultLibFileName) { + return false; } - return false; - } - function createTriggerSpanForNode(node, sourceFile) { - var start = node.getStart(sourceFile); - var width = node.getWidth(sourceFile); - if (node.kind === 9 /* StringLiteral */) { - // Exclude the quotes - start += 1; - width -= 2; - } - return ts.createTextSpan(start, width); + var sourceFile = declaration.getSourceFile(); + var canonicalName = getCanonicalFileName(ts.normalizePath(sourceFile.fileName)); + return canonicalName === getCanonicalDefaultLibName(); } } Rename.getRenameInfo = getRenameInfo; + function getRenameInfoForNode(node, typeChecker, sourceFile, isDefinedInLibraryFile) { + var symbol = typeChecker.getSymbolAtLocation(node); + // Only allow a symbol to be renamed if it actually has at least one declaration. + if (symbol) { + var declarations = symbol.getDeclarations(); + if (declarations && declarations.length > 0) { + // Disallow rename for elements that are defined in the standard TypeScript library. + if (ts.some(declarations, isDefinedInLibraryFile)) { + return getRenameInfoError(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); + } + // Cannot rename `default` as in `import { default as foo } from "./someModule"; + if (node.kind === 70 /* Identifier */ && + node.originalKeywordKind === 78 /* DefaultKeyword */ && + symbol.parent.flags & 1536 /* Module */) { + return undefined; + } + var displayName = ts.stripQuotes(ts.getDeclaredName(typeChecker, symbol, node)); + var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); + return kind ? getRenameInfoSuccess(displayName, typeChecker.getFullyQualifiedName(symbol), kind, ts.SymbolDisplay.getSymbolModifiers(symbol), node, sourceFile) : undefined; + } + } + else if (node.kind === 9 /* StringLiteral */) { + if (isDefinedInLibraryFile(node)) { + return getRenameInfoError(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); + } + var displayName = ts.stripQuotes(node.text); + return getRenameInfoSuccess(displayName, displayName, ts.ScriptElementKind.variableElement, ts.ScriptElementKindModifier.none, node, sourceFile); + } + } + function getRenameInfoSuccess(displayName, fullDisplayName, kind, kindModifiers, node, sourceFile) { + return { + canRename: true, + kind: kind, + displayName: displayName, + localizedErrorMessage: undefined, + fullDisplayName: fullDisplayName, + kindModifiers: kindModifiers, + triggerSpan: createTriggerSpanForNode(node, sourceFile) + }; + } + function getRenameInfoError(diagnostic) { + return { + canRename: false, + localizedErrorMessage: ts.getLocaleSpecificMessage(diagnostic), + displayName: undefined, + fullDisplayName: undefined, + kind: undefined, + kindModifiers: undefined, + triggerSpan: undefined + }; + } + function createTriggerSpanForNode(node, sourceFile) { + var start = node.getStart(sourceFile); + var width = node.getWidth(sourceFile); + if (node.kind === 9 /* StringLiteral */) { + // Exclude the quotes + start += 1; + width -= 2; + } + return ts.createTextSpan(start, width); + } + function nodeIsEligibleForRename(node) { + return node.kind === 70 /* Identifier */ || + node.kind === 9 /* StringLiteral */ || + ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || + ts.isThis(node); + } })(Rename = ts.Rename || (ts.Rename = {})); })(ts || (ts = {})); /// @@ -73140,7 +78983,7 @@ var ts; // stack++; // break; // case TypeScript.SyntaxKind.CommaToken: - // if (stack == 0) { + // if (stack === 0) { // argumentIndex++; // } // break; @@ -73232,6 +79075,7 @@ var ts; ArgumentListKind[ArgumentListKind["TypeArguments"] = 0] = "TypeArguments"; ArgumentListKind[ArgumentListKind["CallArguments"] = 1] = "CallArguments"; ArgumentListKind[ArgumentListKind["TaggedTemplateArguments"] = 2] = "TaggedTemplateArguments"; + ArgumentListKind[ArgumentListKind["JSXAttributesArguments"] = 3] = "JSXAttributesArguments"; })(ArgumentListKind = SignatureHelp.ArgumentListKind || (SignatureHelp.ArgumentListKind = {})); function getSignatureHelpItems(program, sourceFile, position, cancellationToken) { var typeChecker = program.getTypeChecker(); @@ -73263,7 +79107,7 @@ var ts; } SignatureHelp.getSignatureHelpItems = getSignatureHelpItems; function createJavaScriptSignatureHelpItems(argumentInfo, program) { - if (argumentInfo.invocation.kind !== 179 /* CallExpression */) { + if (argumentInfo.invocation.kind !== 180 /* CallExpression */) { return undefined; } // See if we can find some symbol with the call expression name that has call signatures. @@ -73271,7 +79115,7 @@ var ts; var expression = callExpression.expression; var name = expression.kind === 70 /* Identifier */ ? expression - : expression.kind === 177 /* PropertyAccessExpression */ + : expression.kind === 178 /* PropertyAccessExpression */ ? expression.name : undefined; if (!name || !name.text) { @@ -73281,10 +79125,10 @@ var ts; for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { var sourceFile = _a[_i]; var nameToDeclarations = sourceFile.getNamedDeclarations(); - var declarations = nameToDeclarations[name.text]; + var declarations = nameToDeclarations.get(name.text); if (declarations) { - for (var _b = 0, declarations_10 = declarations; _b < declarations_10.length; _b++) { - var declaration = declarations_10[_b]; + for (var _b = 0, declarations_13 = declarations; _b < declarations_13.length; _b++) { + var declaration = declarations_13[_b]; var symbol = declaration.symbol; if (symbol) { var type = typeChecker.getTypeOfSymbolAtLocation(symbol, declaration); @@ -73304,21 +79148,21 @@ var ts; * in the argument of an invocation; returns undefined otherwise. */ function getImmediatelyContainingArgumentInfo(node, position, sourceFile) { - if (node.parent.kind === 179 /* CallExpression */ || node.parent.kind === 180 /* NewExpression */) { + if (node.parent.kind === 180 /* CallExpression */ || node.parent.kind === 181 /* NewExpression */) { var callExpression = node.parent; // There are 3 cases to handle: - // 1. The token introduces a list, and should begin a sig help session + // 1. The token introduces a list, and should begin a signature help session // 2. The token is either not associated with a list, or ends a list, so the session should end - // 3. The token is buried inside a list, and should give sig help + // 3. The token is buried inside a list, and should give signature help // // The following are examples of each: // // Case 1: - // foo<#T, U>(#a, b) -> The token introduces a list, and should begin a sig help session + // foo<#T, U>(#a, b) -> The token introduces a list, and should begin a signature help session // Case 2: // fo#o#(a, b)# -> The token is either not associated with a list, or ends a list, so the session should end // Case 3: - // foo(a#, #b#) -> The token is buried inside a list, and should give sig help + // foo(a#, #b#) -> The token is buried inside a list, and should give signature help // Find out if 'node' is an argument, a type argument, or neither if (node.kind === 26 /* LessThanToken */ || node.kind === 18 /* OpenParenToken */) { @@ -73337,7 +79181,7 @@ var ts; } // findListItemInfo can return undefined if we are not in parent's argument list // or type argument list. This includes cases where the cursor is: - // - To the right of the closing paren, non-substitution template, or template tail. + // - To the right of the closing parenthesis, non-substitution template, or template tail. // - Between the type arguments and the arguments (greater than token) // - On the target of the call (parent.func) // - On the 'new' keyword in a 'new' expression @@ -73358,25 +79202,25 @@ var ts; } return undefined; } - else if (node.kind === 12 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 181 /* TaggedTemplateExpression */) { + else if (node.kind === 12 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 182 /* TaggedTemplateExpression */) { // Check if we're actually inside the template; // otherwise we'll fall out and return undefined. if (ts.isInsideTemplateLiteral(node, position)) { return getArgumentListInfoForTemplate(node.parent, /*argumentIndex*/ 0, sourceFile); } } - else if (node.kind === 13 /* TemplateHead */ && node.parent.parent.kind === 181 /* TaggedTemplateExpression */) { + else if (node.kind === 13 /* TemplateHead */ && node.parent.parent.kind === 182 /* TaggedTemplateExpression */) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 194 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 195 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } - else if (node.parent.kind === 202 /* TemplateSpan */ && node.parent.parent.parent.kind === 181 /* TaggedTemplateExpression */) { + else if (node.parent.kind === 204 /* TemplateSpan */ && node.parent.parent.parent.kind === 182 /* TaggedTemplateExpression */) { var templateSpan = node.parent; var templateExpression = templateSpan.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 194 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 195 /* TemplateExpression */); // If we're just after a template tail, don't show signature help. if (node.kind === 15 /* TemplateTail */ && !ts.isInsideTemplateLiteral(node, position)) { return undefined; @@ -73385,8 +79229,25 @@ var ts; var argumentIndex = getArgumentIndexForTemplatePiece(spanIndex, node, position); return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } + else if (node.parent && ts.isJsxOpeningLikeElement(node.parent)) { + // Provide a signature help for JSX opening element or JSX self-closing element. + // This is not guarantee that JSX tag-name is resolved into stateless function component. (that is done in "getSignatureHelpItems") + // i.e + // export function MainButton(props: ButtonProps, context: any): JSX.Element { ... } + // ' '' - // That will give us 2 non-commas. We then add one for the last comma, givin us an + // That will give us 2 non-commas. We then add one for the last comma, giving us an // arg count of 3. var listChildren = argumentsList.getChildren(); var argumentCount = ts.countWhere(listChildren, function (arg) { return arg.kind !== 25 /* CommaToken */; }); @@ -73494,7 +79355,7 @@ var ts; // // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 194 /* TemplateExpression */) { + if (template.kind === 195 /* TemplateExpression */) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -73503,7 +79364,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node, position, sourceFile) { - for (var n = node; n.kind !== 261 /* SourceFile */; n = n.parent) { + for (var n = node; n.kind !== 264 /* SourceFile */; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } @@ -73516,6 +79377,7 @@ var ts; if (argumentInfo) { return argumentInfo; } + // TODO: Handle generic call with incomplete syntax } return undefined; } @@ -73596,7 +79458,8 @@ var ts; suffixDisplayParts: suffixDisplayParts, separatorDisplayParts: [ts.punctuationPart(25 /* CommaToken */), ts.spacePart()], parameters: signatureHelpParameters, - documentation: candidateSignature.getDocumentationComment() + documentation: candidateSignature.getDocumentationComment(), + tags: candidateSignature.getJsDocTags() }; }); var argumentIndex = argumentListInfo.argumentIndex; @@ -73646,9 +79509,9 @@ var ts; (function (SymbolDisplay) { // TODO(drosen): use contextual SemanticMeaning. function getSymbolKind(typeChecker, symbol, location) { - var flags = symbol.getFlags(); + var flags = symbol.flags; if (flags & 32 /* Class */) - return ts.getDeclarationOfKind(symbol, 197 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 198 /* ClassExpression */) ? ts.ScriptElementKind.localClassElement : ts.ScriptElementKind.classElement; if (flags & 384 /* Enum */) return ts.ScriptElementKind.enumElement; @@ -73658,12 +79521,12 @@ var ts; return ts.ScriptElementKind.interfaceElement; if (flags & 262144 /* TypeParameter */) return ts.ScriptElementKind.typeParameterElement; - var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, flags, location); + var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location); if (result === ts.ScriptElementKind.unknown) { if (flags & 262144 /* TypeParameter */) return ts.ScriptElementKind.typeParameterElement; if (flags & 8 /* EnumMember */) - return ts.ScriptElementKind.variableElement; + return ts.ScriptElementKind.enumMemberElement; if (flags & 8388608 /* Alias */) return ts.ScriptElementKind.alias; if (flags & 1536 /* Module */) @@ -73672,7 +79535,7 @@ var ts; return result; } SymbolDisplay.getSymbolKind = getSymbolKind; - function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, flags, location) { + function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location) { if (typeChecker.isUndefinedSymbol(symbol)) { return ts.ScriptElementKind.variableElement; } @@ -73682,6 +79545,7 @@ var ts; if (location.kind === 98 /* ThisKeyword */ && ts.isExpression(location)) { return ts.ScriptElementKind.parameterElement; } + var flags = symbol.flags; if (flags & 3 /* Variable */) { if (ts.isFirstDeclarationOfSymbolParameter(symbol)) { return ts.ScriptElementKind.parameterElement; @@ -73705,7 +79569,7 @@ var ts; if (flags & 16384 /* Constructor */) return ts.ScriptElementKind.constructorImplementationElement; if (flags & 4 /* Property */) { - if (flags & 268435456 /* SyntheticProperty */) { + if (flags & 134217728 /* Transient */ && symbol.checkFlags & 6 /* Synthetic */) { // If union property is result of union of non method (property/accessors/variables), it is labeled as property var unionPropertyKind = ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) { var rootSymbolFlags = rootSymbol.getFlags(); @@ -73725,6 +79589,9 @@ var ts; } return unionPropertyKind; } + if (location.parent && ts.isJsxAttribute(location.parent)) { + return ts.ScriptElementKind.jsxAttribute; + } return ts.ScriptElementKind.memberVariableElement; } return ts.ScriptElementKind.unknown; @@ -73740,8 +79607,9 @@ var ts; if (semanticMeaning === void 0) { semanticMeaning = ts.getMeaningFromLocation(location); } var displayParts = []; var documentation; + var tags; var symbolFlags = symbol.flags; - var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, symbolFlags, location); + var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location); var hasAddedSymbolInfo; var isThisExpression = location.kind === 98 /* ThisKeyword */ && ts.isExpression(location); var type; @@ -73754,7 +79622,7 @@ var ts; var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (type) { - if (location.parent && location.parent.kind === 177 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 178 /* PropertyAccessExpression */) { var right = location.parent.name; // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { @@ -73762,21 +79630,24 @@ var ts; } } // try get the call/construct signature from the type if it matches - var callExpression = void 0; - if (location.kind === 179 /* CallExpression */ || location.kind === 180 /* NewExpression */) { - callExpression = location; + var callExpressionLike = void 0; + if (location.kind === 180 /* CallExpression */ || location.kind === 181 /* NewExpression */) { + callExpressionLike = location; } else if (ts.isCallExpressionTarget(location) || ts.isNewExpressionTarget(location)) { - callExpression = location.parent; + callExpressionLike = location.parent; } - if (callExpression) { + else if (location.parent && ts.isJsxOpeningLikeElement(location.parent) && ts.isFunctionLike(symbol.valueDeclaration)) { + callExpressionLike = location.parent; + } + if (callExpressionLike) { var candidateSignatures = []; - signature = typeChecker.getResolvedSignature(callExpression, candidateSignatures); + signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures); if (!signature && candidateSignatures.length) { // Use the first candidate: signature = candidateSignatures[0]; } - var useConstructSignatures = callExpression.kind === 180 /* NewExpression */ || callExpression.expression.kind === 96 /* SuperKeyword */; + var useConstructSignatures = callExpressionLike.kind === 181 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 96 /* SuperKeyword */); var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { // Get the first signature if there is one -- allSignatures may contain @@ -73803,6 +79674,7 @@ var ts; addPrefixForAnyFunctionOrVar(symbol, symbolKind); } switch (symbolKind) { + case ts.ScriptElementKind.jsxAttribute: case ts.ScriptElementKind.memberVariableElement: case ts.ScriptElementKind.variableElement: case ts.ScriptElementKind.constElement: @@ -73829,24 +79701,24 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304 /* Accessor */)) || - (location.kind === 122 /* ConstructorKeyword */ && location.parent.kind === 150 /* Constructor */)) { + (location.kind === 122 /* ConstructorKeyword */ && location.parent.kind === 151 /* Constructor */)) { // get the signature from the declaration and write it var functionDeclaration = location.parent; - var allSignatures = functionDeclaration.kind === 150 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration.kind === 151 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); } else { signature = allSignatures[0]; } - if (functionDeclaration.kind === 150 /* Constructor */) { + if (functionDeclaration.kind === 151 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = ts.ScriptElementKind.constructorImplementationElement; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 153 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 154 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -73855,7 +79727,7 @@ var ts; } } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { - if (ts.getDeclarationOfKind(symbol, 197 /* ClassExpression */)) { + if (ts.getDeclarationOfKind(symbol, 198 /* ClassExpression */)) { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class @@ -73878,7 +79750,7 @@ var ts; } if (symbolFlags & 524288 /* TypeAlias */) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(136 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(137 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); @@ -73899,7 +79771,7 @@ var ts; } if (symbolFlags & 1536 /* Module */) { addNewLineIfDisplayPartsExist(); - var declaration = ts.getDeclarationOfKind(symbol, 230 /* ModuleDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 232 /* ModuleDeclaration */); var isNamespace = declaration && declaration.name && declaration.name.kind === 70 /* Identifier */; displayParts.push(ts.keywordPart(isNamespace ? 128 /* NamespaceKeyword */ : 127 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); @@ -73920,28 +79792,28 @@ var ts; } else { // Method/function type parameter - var declaration = ts.getDeclarationOfKind(symbol, 143 /* TypeParameter */); + var declaration = ts.getDeclarationOfKind(symbol, 144 /* TypeParameter */); ts.Debug.assert(declaration !== undefined); declaration = declaration.parent; if (declaration) { if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); - if (declaration.kind === 154 /* ConstructSignature */) { + if (declaration.kind === 155 /* ConstructSignature */) { displayParts.push(ts.keywordPart(93 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 153 /* CallSignature */ && declaration.name) { + else if (declaration.kind !== 154 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } - else if (declaration.kind === 228 /* TypeAliasDeclaration */) { + else if (declaration.kind === 230 /* TypeAliasDeclaration */) { // Type alias type parameter // For example // type list = T[]; // Both T will go through same code path addInPrefix(); - displayParts.push(ts.keywordPart(136 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(137 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -73950,9 +79822,10 @@ var ts; } } if (symbolFlags & 8 /* EnumMember */) { + symbolKind = ts.ScriptElementKind.enumMemberElement; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 260 /* EnumMember */) { + if (declaration.kind === 263 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -73964,7 +79837,7 @@ var ts; } if (symbolFlags & 8388608 /* Alias */) { addNewLineIfDisplayPartsExist(); - if (symbol.declarations[0].kind === 233 /* NamespaceExportDeclaration */) { + if (symbol.declarations[0].kind === 235 /* NamespaceExportDeclaration */) { displayParts.push(ts.keywordPart(83 /* ExportKeyword */)); displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(128 /* NamespaceKeyword */)); @@ -73975,7 +79848,7 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 234 /* ImportEqualsDeclaration */) { + if (declaration.kind === 236 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); @@ -74011,6 +79884,7 @@ var ts; } // For properties, variables and local vars: show the type if (symbolKind === ts.ScriptElementKind.memberVariableElement || + symbolKind === ts.ScriptElementKind.jsxAttribute || symbolFlags & 3 /* Variable */ || symbolKind === ts.ScriptElementKind.localVariableElement || isThisExpression) { @@ -74044,14 +79918,15 @@ var ts; } if (!documentation) { documentation = symbol.getDocumentationComment(); + tags = symbol.getJsDocTags(); if (documentation.length === 0 && symbol.flags & 4 /* Property */) { - // For some special property access expressions like `experts.foo = foo` or `module.exports.foo = foo` + // For some special property access expressions like `exports.foo = foo` or `module.exports.foo = foo` // there documentation comments might be attached to the right hand side symbol of their declarations. // The pattern of such special property access is that the parent symbol is the symbol of the file. - if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 261 /* SourceFile */; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 264 /* SourceFile */; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 192 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 193 /* BinaryExpression */) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -74059,6 +79934,7 @@ var ts; continue; } documentation = rhsSymbol.getDocumentationComment(); + tags = rhsSymbol.getJsDocTags(); if (documentation.length > 0) { break; } @@ -74066,7 +79942,7 @@ var ts; } } } - return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind }; + return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind, tags: tags }; function addNewLineIfDisplayPartsExist() { if (displayParts.length) { displayParts.push(ts.lineBreakPart()); @@ -74117,6 +79993,7 @@ var ts; displayParts.push(ts.punctuationPart(19 /* CloseParenToken */)); } documentation = signature.getDocumentationComment(); + tags = signature.getJsDocTags(); } function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) { var typeParameterParts = ts.mapToDisplayParts(function (writer) { @@ -74132,16 +80009,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 184 /* FunctionExpression */) { + if (declaration.kind === 185 /* FunctionExpression */) { return true; } - if (declaration.kind !== 223 /* VariableDeclaration */ && declaration.kind !== 225 /* FunctionDeclaration */) { + if (declaration.kind !== 225 /* VariableDeclaration */ && declaration.kind !== 227 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable - for (var parent_20 = declaration.parent; !ts.isFunctionBlock(parent_20); parent_20 = parent_20.parent) { + for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { // Reached source file or module block - if (parent_20.kind === 261 /* SourceFile */ || parent_20.kind === 231 /* ModuleBlock */) { + if (parent.kind === 264 /* SourceFile */ || parent.kind === 233 /* ModuleBlock */) { return false; } } @@ -74194,7 +80071,7 @@ var ts; sourceFile.moduleName = transpileOptions.moduleName; } if (transpileOptions.renamedDependencies) { - sourceFile.renamedDependencies = ts.createMap(transpileOptions.renamedDependencies); + sourceFile.renamedDependencies = ts.createMapFromTemplate(transpileOptions.renamedDependencies); } var newLine = ts.getNewLineCharacter(options); // Output @@ -74246,13 +80123,14 @@ var ts; ts.transpile = transpile; var commandLineOptionsStringToEnum; /** JS users may pass in string values for enum compiler options (such as ModuleKind), so convert. */ + /*@internal*/ function fixupCompilerOptions(options, diagnostics) { // Lazily create this value to fix module loading errors. commandLineOptionsStringToEnum = commandLineOptionsStringToEnum || ts.filter(ts.optionDeclarations, function (o) { - return typeof o.type === "object" && !ts.forEachProperty(o.type, function (v) { return typeof v !== "number"; }); + return typeof o.type === "object" && !ts.forEachEntry(o.type, function (v) { return typeof v !== "number"; }); }); options = ts.clone(options); - var _loop_4 = function (opt) { + var _loop_5 = function (opt) { if (!ts.hasProperty(options, opt.name)) { return "continue"; } @@ -74263,7 +80141,7 @@ var ts; options[opt.name] = ts.parseCustomTypeOption(opt, value, diagnostics); } else { - if (!ts.forEachProperty(opt.type, function (v) { return v === value; })) { + if (!ts.forEachEntry(opt.type, function (v) { return v === value; })) { // Supplied value isn't a valid enum value. diagnostics.push(ts.createCompilerDiagnosticForInvalidCustomType(opt)); } @@ -74271,10 +80149,11 @@ var ts; }; for (var _i = 0, commandLineOptionsStringToEnum_1 = commandLineOptionsStringToEnum; _i < commandLineOptionsStringToEnum_1.length; _i++) { var opt = commandLineOptionsStringToEnum_1[_i]; - _loop_4(opt); + _loop_5(opt); } return options; } + ts.fixupCompilerOptions = fixupCompilerOptions; })(ts || (ts = {})); /// /// @@ -74298,10 +80177,10 @@ var ts; ScanAction[ScanAction["RescanJsxIdentifier"] = 4] = "RescanJsxIdentifier"; ScanAction[ScanAction["RescanJsxText"] = 5] = "RescanJsxText"; })(ScanAction || (ScanAction = {})); - function getFormattingScanner(sourceFile, startPos, endPos) { + function getFormattingScanner(text, languageVariant, startPos, endPos) { ts.Debug.assert(scanner === undefined, "Scanner should be undefined"); - scanner = sourceFile.languageVariant === 1 /* JSX */ ? jsxScanner : standardScanner; - scanner.setText(sourceFile.text); + scanner = languageVariant === 1 /* JSX */ ? jsxScanner : standardScanner; + scanner.setText(text); scanner.setTextPos(startPos); var wasNewLine = true; var leadingTrivia; @@ -74379,10 +80258,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 250 /* JsxAttribute */: - case 248 /* JsxOpeningElement */: - case 249 /* JsxClosingElement */: - case 247 /* JsxSelfClosingElement */: + case 252 /* JsxAttribute */: + case 250 /* JsxOpeningElement */: + case 251 /* JsxClosingElement */: + case 249 /* JsxSelfClosingElement */: return node.kind === 70 /* Identifier */; } } @@ -74503,8 +80382,8 @@ var ts; } function isOnToken() { ts.Debug.assert(scanner !== undefined); - var current = (lastTokenInfo && lastTokenInfo.token.kind) || scanner.getToken(); - var startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); + var current = lastTokenInfo ? lastTokenInfo.token.kind : scanner.getToken(); + var startPos = lastTokenInfo ? lastTokenInfo.token.pos : scanner.getStartPos(); return startPos < endPos && current !== 1 /* EndOfFileToken */ && !ts.isTrivia(current); } // when containing node in the tree is token @@ -74794,11 +80673,11 @@ var ts; this.NoSpaceAfterQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create3(54 /* QuestionToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); this.SpaceAfterSemicolon = new formatting.Rule(formatting.RuleDescriptor.create3(24 /* SemicolonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); // Space after }. - this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17 /* CloseBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2 /* Space */)); + this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17 /* CloseBraceToken */, formatting.Shared.TokenRange.FromRange(0 /* FirstToken */, 141 /* LastToken */, [19 /* CloseParenToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2 /* Space */)); // Special case for (}, else) and (}, while) since else & while tokens are not part of the tree which makes SpaceAfterCloseBrace rule not applied this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(17 /* CloseBraceToken */, 81 /* ElseKeyword */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(17 /* CloseBraceToken */, 105 /* WhileKeyword */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); - this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17 /* CloseBraceToken */, formatting.Shared.TokenRange.FromTokens([19 /* CloseParenToken */, 21 /* CloseBracketToken */, 25 /* CommaToken */, 24 /* SemicolonToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17 /* CloseBraceToken */, formatting.Shared.TokenRange.FromTokens([21 /* CloseBracketToken */, 25 /* CommaToken */, 24 /* SemicolonToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); // No space for dot this.NoSpaceBeforeDot = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 22 /* DotToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); this.NoSpaceAfterDot = new formatting.Rule(formatting.RuleDescriptor.create3(22 /* DotToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); @@ -74815,10 +80694,10 @@ var ts; this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([19 /* CloseParenToken */, 3 /* MultiLineCommentTrivia */, 80 /* DoKeyword */, 101 /* TryKeyword */, 86 /* FinallyKeyword */, 81 /* ElseKeyword */]); this.SpaceBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 16 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */); // Insert a space after { and before } in single-line contexts, but remove space from empty object literals {}. - this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2 /* Space */)); - this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2 /* Space */)); - this.NoSpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 8 /* Delete */)); - this.NoSpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 8 /* Delete */)); + this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsBraceWrappedContext), 2 /* Space */)); + this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsBraceWrappedContext), 2 /* Space */)); + this.NoSpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); this.NoSpaceBetweenEmptyBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(16 /* OpenBraceToken */, 17 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsObjectContext), 8 /* Delete */)); // Insert new line after { and before } in multi-line contexts. this.NewLineAfterOpenBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create3(16 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4 /* NewLine */)); @@ -74848,6 +80727,7 @@ var ts; this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([109 /* LetKeyword */, 75 /* ConstKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2 /* Space */)); this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionCallOrNewContext, Rules.IsPreviousTokenNotComma), 8 /* Delete */)); this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(88 /* FunctionKeyword */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); + this.SpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionDeclContext), 2 /* Space */)); this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionDeclContext), 8 /* Delete */)); this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(104 /* VoidKeyword */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsVoidOpContext), 2 /* Space */)); this.NoSpaceBetweenReturnAndSemicolon = new formatting.Rule(formatting.RuleDescriptor.create1(95 /* ReturnKeyword */, 24 /* SemicolonToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); @@ -74858,18 +80738,19 @@ var ts; this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([101 /* TryKeyword */, 86 /* FinallyKeyword */]), 16 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); // get x() {} // set x(val) {} - this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([124 /* GetKeyword */, 133 /* SetKeyword */]), 70 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); + this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([124 /* GetKeyword */, 134 /* SetKeyword */]), 70 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); // Special case for binary operators (that are keywords). For these we have to add a space and shouldn't follow any user options. this.SpaceBeforeBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryKeywordOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); this.SpaceAfterBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryKeywordOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); // TypeScript-specific higher priority rules // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses + this.SpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(122 /* ConstructorKeyword */, 18 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); this.NoSpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(122 /* ConstructorKeyword */, 18 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); // Use of module as a function call. e.g.: import m2 = module("m2"); this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([127 /* ModuleKeyword */, 131 /* RequireKeyword */]), 18 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); // Add a space around certain TypeScript keywords - this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([116 /* AbstractKeyword */, 74 /* ClassKeyword */, 123 /* DeclareKeyword */, 78 /* DefaultKeyword */, 82 /* EnumKeyword */, 83 /* ExportKeyword */, 84 /* ExtendsKeyword */, 124 /* GetKeyword */, 107 /* ImplementsKeyword */, 90 /* ImportKeyword */, 108 /* InterfaceKeyword */, 127 /* ModuleKeyword */, 128 /* NamespaceKeyword */, 111 /* PrivateKeyword */, 113 /* PublicKeyword */, 112 /* ProtectedKeyword */, 133 /* SetKeyword */, 114 /* StaticKeyword */, 136 /* TypeKeyword */, 138 /* FromKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); - this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([84 /* ExtendsKeyword */, 107 /* ImplementsKeyword */, 138 /* FromKeyword */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([116 /* AbstractKeyword */, 74 /* ClassKeyword */, 123 /* DeclareKeyword */, 78 /* DefaultKeyword */, 82 /* EnumKeyword */, 83 /* ExportKeyword */, 84 /* ExtendsKeyword */, 124 /* GetKeyword */, 107 /* ImplementsKeyword */, 90 /* ImportKeyword */, 108 /* InterfaceKeyword */, 127 /* ModuleKeyword */, 128 /* NamespaceKeyword */, 111 /* PrivateKeyword */, 113 /* PublicKeyword */, 112 /* ProtectedKeyword */, 130 /* ReadonlyKeyword */, 134 /* SetKeyword */, 114 /* StaticKeyword */, 137 /* TypeKeyword */, 139 /* FromKeyword */, 126 /* KeyOfKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([84 /* ExtendsKeyword */, 107 /* ImplementsKeyword */, 139 /* FromKeyword */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(9 /* StringLiteral */, 16 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2 /* Space */)); // Lambda expressions @@ -74889,7 +80770,7 @@ var ts; // decorators this.SpaceBeforeAt = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 56 /* AtToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); this.NoSpaceAfterAt = new formatting.Rule(formatting.RuleDescriptor.create3(56 /* AtToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); - this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([116 /* AbstractKeyword */, 70 /* Identifier */, 83 /* ExportKeyword */, 78 /* DefaultKeyword */, 74 /* ClassKeyword */, 114 /* StaticKeyword */, 113 /* PublicKeyword */, 111 /* PrivateKeyword */, 112 /* ProtectedKeyword */, 124 /* GetKeyword */, 133 /* SetKeyword */, 20 /* OpenBracketToken */, 38 /* AsteriskToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2 /* Space */)); + this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([116 /* AbstractKeyword */, 70 /* Identifier */, 83 /* ExportKeyword */, 78 /* DefaultKeyword */, 74 /* ClassKeyword */, 114 /* StaticKeyword */, 113 /* PublicKeyword */, 111 /* PrivateKeyword */, 112 /* ProtectedKeyword */, 124 /* GetKeyword */, 134 /* SetKeyword */, 20 /* OpenBracketToken */, 38 /* AsteriskToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2 /* Space */)); this.NoSpaceBetweenFunctionKeywordAndStar = new formatting.Rule(formatting.RuleDescriptor.create1(88 /* FunctionKeyword */, 38 /* AsteriskToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), 8 /* Delete */)); this.SpaceAfterStarInGeneratorDeclaration = new formatting.Rule(formatting.RuleDescriptor.create3(38 /* AsteriskToken */, formatting.Shared.TokenRange.FromTokens([70 /* Identifier */, 18 /* OpenParenToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), 2 /* Space */)); this.NoSpaceBetweenYieldKeywordAndStar = new formatting.Rule(formatting.RuleDescriptor.create1(115 /* YieldKeyword */, 38 /* AsteriskToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsYieldOrYieldStarWithOperand), 8 /* Delete */)); @@ -74905,6 +80786,8 @@ var ts; this.NoSpaceBeforeGreaterThanTokenInJsxOpeningElement = new formatting.Rule(formatting.RuleDescriptor.create1(40 /* SlashToken */, 28 /* GreaterThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxSelfClosingElementContext, Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); this.NoSpaceBeforeEqualInJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 57 /* EqualsToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxAttributeContext, Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); this.NoSpaceAfterEqualInJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create3(57 /* EqualsToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxAttributeContext, Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); + // No space before non-null assertion operator + this.NoSpaceBeforeNonNullAssertionOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 50 /* ExclamationToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonNullAssertionContext), 8 /* Delete */)); // These rules are higher in priority than user-configurable rules. this.HighPriorityCommonRules = [ this.IgnoreBeforeComment, this.IgnoreAfterLineComment, @@ -74935,7 +80818,7 @@ var ts; this.SpaceBeforeJsxAttribute, this.SpaceBeforeSlashInJsxOpeningElement, this.NoSpaceBeforeGreaterThanTokenInJsxOpeningElement, this.NoSpaceBeforeEqualInJsxAttribute, this.NoSpaceAfterEqualInJsxAttribute, // TypeScript-specific rules - this.NoSpaceAfterConstructor, this.NoSpaceAfterModuleImport, + this.NoSpaceAfterModuleImport, this.SpaceAfterCertainTypeScriptKeywords, this.SpaceBeforeCertainTypeScriptKeywords, this.SpaceAfterModuleName, this.SpaceBeforeArrow, this.SpaceAfterArrow, @@ -74950,6 +80833,7 @@ var ts; this.SpaceBeforeAt, this.NoSpaceAfterAt, this.SpaceAfterDecorator, + this.NoSpaceBeforeNonNullAssertionOperator ]; // These rules are lower in priority than user-configurable rules. this.LowPriorityCommonRules = [ @@ -74959,7 +80843,6 @@ var ts; this.NoSpaceBeforeOpenBracket, this.NoSpaceAfterCloseBracket, this.SpaceAfterSemicolon, - this.NoSpaceBeforeOpenParenInFuncDecl, this.SpaceBetweenStatements, this.SpaceAfterTryFinally ]; /// @@ -75017,9 +80900,9 @@ var ts; } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name_48 in o) { - if (o[name_48] === rule) { - return name_48; + for (var name in o) { + if (o[name] === rule) { + return name; } } throw new Error("Unknown rule"); @@ -75028,42 +80911,44 @@ var ts; /// Contexts /// Rules.IsForContext = function (context) { - return context.contextNode.kind === 211 /* ForStatement */; + return context.contextNode.kind === 213 /* ForStatement */; }; Rules.IsNotForContext = function (context) { return !Rules.IsForContext(context); }; Rules.IsBinaryOpContext = function (context) { switch (context.contextNode.kind) { - case 192 /* BinaryExpression */: - case 193 /* ConditionalExpression */: - case 200 /* AsExpression */: - case 243 /* ExportSpecifier */: - case 239 /* ImportSpecifier */: - case 156 /* TypePredicate */: - case 164 /* UnionType */: - case 165 /* IntersectionType */: + case 193 /* BinaryExpression */: + case 194 /* ConditionalExpression */: + case 201 /* AsExpression */: + case 245 /* ExportSpecifier */: + case 241 /* ImportSpecifier */: + case 157 /* TypePredicate */: + case 165 /* UnionType */: + case 166 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 174 /* BindingElement */: + case 175 /* BindingElement */: // equals in type X = ... - case 228 /* TypeAliasDeclaration */: + case 230 /* TypeAliasDeclaration */: // equal in import a = module('a'); - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: // equal in let a = 0; - case 223 /* VariableDeclaration */: + case 225 /* VariableDeclaration */: // equal in p = 0; - case 144 /* Parameter */: - case 260 /* EnumMember */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 145 /* Parameter */: + case 263 /* EnumMember */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: return context.currentTokenSpan.kind === 57 /* EqualsToken */ || context.nextTokenSpan.kind === 57 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 212 /* ForInStatement */: + case 214 /* ForInStatement */: + // "in" keyword in [P in keyof T]: T[P] + case 144 /* TypeParameter */: return context.currentTokenSpan.kind === 91 /* InKeyword */ || context.nextTokenSpan.kind === 91 /* InKeyword */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 213 /* ForOfStatement */: - return context.currentTokenSpan.kind === 140 /* OfKeyword */ || context.nextTokenSpan.kind === 140 /* OfKeyword */; + case 215 /* ForOfStatement */: + return context.currentTokenSpan.kind === 141 /* OfKeyword */ || context.nextTokenSpan.kind === 141 /* OfKeyword */; } return false; }; @@ -75071,7 +80956,7 @@ var ts; return !Rules.IsBinaryOpContext(context); }; Rules.IsConditionalOperatorContext = function (context) { - return context.contextNode.kind === 193 /* ConditionalExpression */; + return context.contextNode.kind === 194 /* ConditionalExpression */; }; Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { //// This check is mainly used inside SpaceBeforeOpenBraceInControl and SpaceBeforeOpenBraceInFunction. @@ -75092,6 +80977,9 @@ var ts; //// * ) and { are on different lines. We only need to format if the block is multiline context. So in this case we format. return context.TokensAreOnSameLine() || Rules.IsBeforeMultilineBlockContext(context); }; + Rules.IsBraceWrappedContext = function (context) { + return context.contextNode.kind === 173 /* ObjectBindingPattern */ || Rules.IsSingleLineBlockContext(context); + }; // This check is done before an open brace in a control construct, a function, or a typescript block declaration Rules.IsBeforeMultilineBlockContext = function (context) { return Rules.IsBeforeBlockContext(context) && !(context.NextNodeAllOnSameLine() || context.NextNodeBlockIsOnOneLine()); @@ -75115,97 +81003,103 @@ var ts; return true; } switch (node.kind) { - case 204 /* Block */: - case 232 /* CaseBlock */: - case 176 /* ObjectLiteralExpression */: - case 231 /* ModuleBlock */: + case 206 /* Block */: + case 234 /* CaseBlock */: + case 177 /* ObjectLiteralExpression */: + case 233 /* ModuleBlock */: return true; } return false; }; Rules.IsFunctionDeclContext = function (context) { switch (context.contextNode.kind) { - case 225 /* FunctionDeclaration */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 227 /* FunctionDeclaration */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: // case SyntaxKind.MemberFunctionDeclaration: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: // case SyntaxKind.MethodSignature: - case 153 /* CallSignature */: - case 184 /* FunctionExpression */: - case 150 /* Constructor */: - case 185 /* ArrowFunction */: + case 154 /* CallSignature */: + case 185 /* FunctionExpression */: + case 151 /* Constructor */: + case 186 /* ArrowFunction */: // case SyntaxKind.ConstructorDeclaration: // case SyntaxKind.SimpleArrowFunctionExpression: // case SyntaxKind.ParenthesizedArrowFunctionExpression: - case 227 /* InterfaceDeclaration */: + case 229 /* InterfaceDeclaration */: return true; } return false; }; Rules.IsFunctionDeclarationOrFunctionExpressionContext = function (context) { - return context.contextNode.kind === 225 /* FunctionDeclaration */ || context.contextNode.kind === 184 /* FunctionExpression */; + return context.contextNode.kind === 227 /* FunctionDeclaration */ || context.contextNode.kind === 185 /* FunctionExpression */; }; Rules.IsTypeScriptDeclWithBlockContext = function (context) { return Rules.NodeIsTypeScriptDeclWithBlockContext(context.contextNode); }; Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { switch (node.kind) { - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: - case 229 /* EnumDeclaration */: - case 161 /* TypeLiteral */: - case 230 /* ModuleDeclaration */: - case 241 /* ExportDeclaration */: - case 242 /* NamedExports */: - case 235 /* ImportDeclaration */: - case 238 /* NamedImports */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 229 /* InterfaceDeclaration */: + case 231 /* EnumDeclaration */: + case 162 /* TypeLiteral */: + case 232 /* ModuleDeclaration */: + case 243 /* ExportDeclaration */: + case 244 /* NamedExports */: + case 237 /* ImportDeclaration */: + case 240 /* NamedImports */: return true; } return false; }; Rules.IsAfterCodeBlockContext = function (context) { switch (context.currentTokenParent.kind) { - case 226 /* ClassDeclaration */: - case 230 /* ModuleDeclaration */: - case 229 /* EnumDeclaration */: - case 204 /* Block */: - case 256 /* CatchClause */: - case 231 /* ModuleBlock */: - case 218 /* SwitchStatement */: + case 228 /* ClassDeclaration */: + case 232 /* ModuleDeclaration */: + case 231 /* EnumDeclaration */: + case 259 /* CatchClause */: + case 233 /* ModuleBlock */: + case 220 /* SwitchStatement */: return true; + case 206 /* Block */: { + var blockParent = context.currentTokenParent.parent; + if (blockParent.kind !== 186 /* ArrowFunction */ && + blockParent.kind !== 185 /* FunctionExpression */) { + return true; + } + } } return false; }; Rules.IsControlDeclContext = function (context) { switch (context.contextNode.kind) { - case 208 /* IfStatement */: - case 218 /* SwitchStatement */: - case 211 /* ForStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 210 /* WhileStatement */: - case 221 /* TryStatement */: - case 209 /* DoStatement */: - case 217 /* WithStatement */: + case 210 /* IfStatement */: + case 220 /* SwitchStatement */: + case 213 /* ForStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: + case 212 /* WhileStatement */: + case 223 /* TryStatement */: + case 211 /* DoStatement */: + case 219 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: - case 256 /* CatchClause */: + case 259 /* CatchClause */: return true; default: return false; } }; Rules.IsObjectContext = function (context) { - return context.contextNode.kind === 176 /* ObjectLiteralExpression */; + return context.contextNode.kind === 177 /* ObjectLiteralExpression */; }; Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind === 179 /* CallExpression */; + return context.contextNode.kind === 180 /* CallExpression */; }; Rules.IsNewContext = function (context) { - return context.contextNode.kind === 180 /* NewExpression */; + return context.contextNode.kind === 181 /* NewExpression */; }; Rules.IsFunctionCallOrNewContext = function (context) { return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); @@ -75217,25 +81111,25 @@ var ts; return context.nextTokenSpan.kind !== 21 /* CloseBracketToken */; }; Rules.IsArrowFunctionContext = function (context) { - return context.contextNode.kind === 185 /* ArrowFunction */; + return context.contextNode.kind === 186 /* ArrowFunction */; }; Rules.IsNonJsxSameLineTokenContext = function (context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 10 /* JsxText */; }; Rules.IsNonJsxElementContext = function (context) { - return context.contextNode.kind !== 246 /* JsxElement */; + return context.contextNode.kind !== 248 /* JsxElement */; }; Rules.IsJsxExpressionContext = function (context) { - return context.contextNode.kind === 252 /* JsxExpression */; + return context.contextNode.kind === 255 /* JsxExpression */; }; Rules.IsNextTokenParentJsxAttribute = function (context) { - return context.nextTokenParent.kind === 250 /* JsxAttribute */; + return context.nextTokenParent.kind === 252 /* JsxAttribute */; }; Rules.IsJsxAttributeContext = function (context) { - return context.contextNode.kind === 250 /* JsxAttribute */; + return context.contextNode.kind === 252 /* JsxAttribute */; }; Rules.IsJsxSelfClosingElementContext = function (context) { - return context.contextNode.kind === 247 /* JsxSelfClosingElement */; + return context.contextNode.kind === 249 /* JsxSelfClosingElement */; }; Rules.IsNotBeforeBlockInFunctionDeclarationContext = function (context) { return !Rules.IsFunctionDeclContext(context) && !Rules.IsBeforeBlockContext(context); @@ -75250,41 +81144,42 @@ var ts; while (ts.isPartOfExpression(node)) { node = node.parent; } - return node.kind === 145 /* Decorator */; + return node.kind === 146 /* Decorator */; }; Rules.IsStartOfVariableDeclarationList = function (context) { - return context.currentTokenParent.kind === 224 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 226 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; }; Rules.IsNotFormatOnEnter = function (context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; }; Rules.IsModuleDeclContext = function (context) { - return context.contextNode.kind === 230 /* ModuleDeclaration */; + return context.contextNode.kind === 232 /* ModuleDeclaration */; }; Rules.IsObjectTypeContext = function (context) { - return context.contextNode.kind === 161 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 162 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; }; Rules.IsTypeArgumentOrParameterOrAssertion = function (token, parent) { if (token.kind !== 26 /* LessThanToken */ && token.kind !== 28 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 157 /* TypeReference */: - case 182 /* TypeAssertionExpression */: - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 179 /* CallExpression */: - case 180 /* NewExpression */: - case 199 /* ExpressionWithTypeArguments */: + case 158 /* TypeReference */: + case 183 /* TypeAssertionExpression */: + case 230 /* TypeAliasDeclaration */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 229 /* InterfaceDeclaration */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: + case 200 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -75295,13 +81190,16 @@ var ts; Rules.IsTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); }; Rules.IsTypeAssertionContext = function (context) { - return context.contextNode.kind === 182 /* TypeAssertionExpression */; + return context.contextNode.kind === 183 /* TypeAssertionExpression */; }; Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 104 /* VoidKeyword */ && context.currentTokenParent.kind === 188 /* VoidExpression */; + return context.currentTokenSpan.kind === 104 /* VoidKeyword */ && context.currentTokenParent.kind === 189 /* VoidExpression */; }; Rules.IsYieldOrYieldStarWithOperand = function (context) { - return context.contextNode.kind === 195 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 196 /* YieldExpression */ && context.contextNode.expression !== undefined; + }; + Rules.IsNonNullAssertionContext = function (context) { + return context.contextNode.kind === 202 /* NonNullExpression */; }; return Rules; }()); @@ -75325,7 +81223,7 @@ var ts; return result; }; RulesMap.prototype.Initialize = function (rules) { - this.mapRowLength = 140 /* LastToken */ + 1; + this.mapRowLength = 141 /* LastToken */ + 1; this.map = new Array(this.mapRowLength * this.mapRowLength); // new Array(this.mapRowLength * this.mapRowLength); // This array is used only during construction of the rulesbucket in the map var rulesBucketConstructionStateList = new Array(this.map.length); // new Array(this.map.length); @@ -75339,7 +81237,7 @@ var ts; }); }; RulesMap.prototype.GetRuleBucketIndex = function (row, column) { - ts.Debug.assert(row <= 140 /* LastKeyword */ && column <= 140 /* LastKeyword */, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 141 /* LastKeyword */ && column <= 141 /* LastKeyword */, "Must compute formatting context from tokens"); var rulesBucketIndex = (row * this.mapRowLength) + column; return rulesBucketIndex; }; @@ -75520,7 +81418,7 @@ var ts; } TokenAllAccess.prototype.GetTokens = function () { var result = []; - for (var token = 0 /* FirstToken */; token <= 140 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 141 /* LastToken */; token++) { result.push(token); } return result; @@ -75564,9 +81462,9 @@ var ts; }()); TokenRange.Any = TokenRange.AllTokens(); TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3 /* MultiLineCommentTrivia */])); - TokenRange.Keywords = TokenRange.FromRange(71 /* FirstKeyword */, 140 /* LastKeyword */); + TokenRange.Keywords = TokenRange.FromRange(71 /* FirstKeyword */, 141 /* LastKeyword */); TokenRange.BinaryOperators = TokenRange.FromRange(26 /* FirstBinaryOperator */, 69 /* LastBinaryOperator */); - TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([91 /* InKeyword */, 92 /* InstanceOfKeyword */, 140 /* OfKeyword */, 117 /* AsKeyword */, 125 /* IsKeyword */]); + TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([91 /* InKeyword */, 92 /* InstanceOfKeyword */, 141 /* OfKeyword */, 117 /* AsKeyword */, 125 /* IsKeyword */]); TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([42 /* PlusPlusToken */, 43 /* MinusMinusToken */, 51 /* TildeToken */, 50 /* ExclamationToken */]); TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([8 /* NumericLiteral */, 70 /* Identifier */, 18 /* OpenParenToken */, 20 /* OpenBracketToken */, 16 /* OpenBraceToken */, 98 /* ThisKeyword */, 93 /* NewKeyword */]); TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([70 /* Identifier */, 18 /* OpenParenToken */, 98 /* ThisKeyword */, 93 /* NewKeyword */]); @@ -75574,7 +81472,7 @@ var ts; TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([70 /* Identifier */, 18 /* OpenParenToken */, 98 /* ThisKeyword */, 93 /* NewKeyword */]); TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([70 /* Identifier */, 19 /* CloseParenToken */, 21 /* CloseBracketToken */, 93 /* NewKeyword */]); TokenRange.Comments = TokenRange.FromTokens([2 /* SingleLineCommentTrivia */, 3 /* MultiLineCommentTrivia */]); - TokenRange.TypeNames = TokenRange.FromTokens([70 /* Identifier */, 132 /* NumberKeyword */, 134 /* StringKeyword */, 121 /* BooleanKeyword */, 135 /* SymbolKeyword */, 104 /* VoidKeyword */, 118 /* AnyKeyword */]); + TokenRange.TypeNames = TokenRange.FromTokens([70 /* Identifier */, 132 /* NumberKeyword */, 135 /* StringKeyword */, 121 /* BooleanKeyword */, 136 /* SymbolKeyword */, 104 /* VoidKeyword */, 118 /* AnyKeyword */]); Shared.TokenRange = TokenRange; })(Shared = formatting.Shared || (formatting.Shared = {})); })(formatting = ts.formatting || (ts.formatting = {})); @@ -75610,6 +81508,9 @@ var ts; RulesProvider.prototype.getRulesMap = function () { return this.rulesMap; }; + RulesProvider.prototype.getFormatOptions = function () { + return this.options; + }; RulesProvider.prototype.ensureUpToDate = function (options) { if (!this.options || !ts.compareDataObjects(this.options, options)) { var activeRules = this.createActiveRules(options); @@ -75621,6 +81522,12 @@ var ts; }; RulesProvider.prototype.createActiveRules = function (options) { var rules = this.globalRules.HighPriorityCommonRules.slice(0); + if (options.insertSpaceAfterConstructor) { + rules.push(this.globalRules.SpaceAfterConstructor); + } + else { + rules.push(this.globalRules.NoSpaceAfterConstructor); + } if (options.insertSpaceAfterCommaDelimiter) { rules.push(this.globalRules.SpaceAfterComma); } @@ -75701,6 +81608,12 @@ var ts; rules.push(this.globalRules.NoSpaceBeforeBinaryOperator); rules.push(this.globalRules.NoSpaceAfterBinaryOperator); } + if (options.insertSpaceBeforeFunctionParenthesis) { + rules.push(this.globalRules.SpaceBeforeOpenParenInFuncDecl); + } + else { + rules.push(this.globalRules.NoSpaceBeforeOpenParenInFuncDecl); + } if (options.placeOpenBraceOnNewLineForControlBlocks) { rules.push(this.globalRules.NewLineBeforeOpenBraceInControl); } @@ -75833,17 +81746,17 @@ var ts; // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 226 /* ClassDeclaration */: - case 227 /* InterfaceDeclaration */: + case 228 /* ClassDeclaration */: + case 229 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: var body = parent.body; - return body && body.kind === 231 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); - case 261 /* SourceFile */: - case 204 /* Block */: - case 231 /* ModuleBlock */: + return body && body.kind === 233 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); + case 264 /* SourceFile */: + case 206 /* Block */: + case 233 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 256 /* CatchClause */: + case 259 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -75863,9 +81776,9 @@ var ts; } } /** formatting is not applied to ranges that contain parse errors. - * This function will return a predicate that for a given text range will tell - * if there are any parse errors that overlap with the range. - */ + * This function will return a predicate that for a given text range will tell + * if there are any parse errors that overlap with the range. + */ function prepareRangeContainsErrorFunction(errors, originalRange) { if (!errors.length) { return rangeHasNoErrors; @@ -75903,10 +81816,10 @@ var ts; } } /** - * Start of the original range might fall inside the comment - scanner will not yield appropriate results - * This function will look for token that is located before the start of target range - * and return its end as start position for the scanner. - */ + * Start of the original range might fall inside the comment - scanner will not yield appropriate results + * This function will look for token that is located before the start of target range + * and return its end as start position for the scanner. + */ function getScanStartPosition(enclosingNode, originalRange, sourceFile) { var start = enclosingNode.getStart(sourceFile); if (start === originalRange.pos && enclosingNode.end === originalRange.end) { @@ -75956,14 +81869,21 @@ var ts; } return 0; } + /* @internal */ + function formatNode(node, sourceFileLike, languageVariant, initialIndentation, delta, rulesProvider) { + var range = { pos: 0, end: sourceFileLike.text.length }; + return formatSpanWorker(range, node, initialIndentation, delta, formatting.getFormattingScanner(sourceFileLike.text, languageVariant, range.pos, range.end), rulesProvider.getFormatOptions(), rulesProvider, 1 /* FormatSelection */, function (_) { return false; }, // assume that node does not have any errors + sourceFileLike); + } + formatting.formatNode = formatNode; function formatSpan(originalRange, sourceFile, options, rulesProvider, requestKind) { - var rangeContainsError = prepareRangeContainsErrorFunction(sourceFile.parseDiagnostics, originalRange); - // formatting context is used by rules provider - var formattingContext = new formatting.FormattingContext(sourceFile, requestKind); // find the smallest node that fully wraps the range and compute the initial indentation for the node var enclosingNode = findEnclosingNode(originalRange, sourceFile); - var formattingScanner = formatting.getFormattingScanner(sourceFile, getScanStartPosition(enclosingNode, originalRange, sourceFile), originalRange.end); - var initialIndentation = formatting.SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, options); + return formatSpanWorker(originalRange, enclosingNode, formatting.SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, options), getOwnOrInheritedDelta(enclosingNode, options, sourceFile), formatting.getFormattingScanner(sourceFile.text, sourceFile.languageVariant, getScanStartPosition(enclosingNode, originalRange, sourceFile), originalRange.end), options, rulesProvider, requestKind, prepareRangeContainsErrorFunction(sourceFile.parseDiagnostics, originalRange), sourceFile); + } + function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delta, formattingScanner, options, rulesProvider, requestKind, rangeContainsError, sourceFile) { + // formatting context is used by rules provider + var formattingContext = new formatting.FormattingContext(sourceFile, requestKind); var previousRangeHasError; var previousRange; var previousParent; @@ -75978,13 +81898,12 @@ var ts; if (enclosingNode.decorators) { undecoratedStartLine = sourceFile.getLineAndCharacterOfPosition(ts.getNonDecoratorTokenPosOfNode(enclosingNode, sourceFile)).line; } - var delta = getOwnOrInheritedDelta(enclosingNode, options, sourceFile); processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta); } if (!formattingScanner.isOnToken()) { var leadingTrivia = formattingScanner.getCurrentLeadingTrivia(); if (leadingTrivia) { - processTrivia(leadingTrivia, enclosingNode, enclosingNode, undefined); + processTrivia(leadingTrivia, enclosingNode, enclosingNode, /*dynamicIndentation*/ undefined); trimTrailingWhitespacesForRemainingRange(); } } @@ -75992,12 +81911,12 @@ var ts; return edits; // local functions /** Tries to compute the indentation for a list element. - * If list element is not in range then - * function will pick its actual indentation - * so it can be pushed downstream as inherited indentation. - * If list element is in the range - its indentation will be equal - * to inherited indentation from its predecessors. - */ + * If list element is not in range then + * function will pick its actual indentation + * so it can be pushed downstream as inherited indentation. + * If list element is in the range - its indentation will be equal + * to inherited indentation from its predecessors. + */ function tryComputeIndentationForListItem(startPos, endPos, parentStartLine, range, inheritedIndentation) { if (ts.rangeOverlapsWithStartEnd(range, startPos, endPos) || ts.rangeContainsStartEnd(range, startPos, endPos) /* Not to miss zero-range nodes e.g. JsxText */) { @@ -76048,20 +81967,19 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 226 /* ClassDeclaration */: return 74 /* ClassKeyword */; - case 227 /* InterfaceDeclaration */: return 108 /* InterfaceKeyword */; - case 225 /* FunctionDeclaration */: return 88 /* FunctionKeyword */; - case 229 /* EnumDeclaration */: return 229 /* EnumDeclaration */; - case 151 /* GetAccessor */: return 124 /* GetKeyword */; - case 152 /* SetAccessor */: return 133 /* SetKeyword */; - case 149 /* MethodDeclaration */: + case 228 /* ClassDeclaration */: return 74 /* ClassKeyword */; + case 229 /* InterfaceDeclaration */: return 108 /* InterfaceKeyword */; + case 227 /* FunctionDeclaration */: return 88 /* FunctionKeyword */; + case 231 /* EnumDeclaration */: return 231 /* EnumDeclaration */; + case 152 /* GetAccessor */: return 124 /* GetKeyword */; + case 153 /* SetAccessor */: return 134 /* SetKeyword */; + case 150 /* MethodDeclaration */: if (node.asteriskToken) { return 38 /* AsteriskToken */; - } /* - fall-through - */ - case 147 /* PropertyDeclaration */: - case 144 /* Parameter */: + } + // falls through + case 148 /* PropertyDeclaration */: + case 145 /* Parameter */: return node.name.kind; } } @@ -76091,18 +82009,31 @@ var ts; // open and close brace, 'else' and 'while' (in do statement) tokens has indentation of the parent case 16 /* OpenBraceToken */: case 17 /* CloseBraceToken */: - case 20 /* OpenBracketToken */: - case 21 /* CloseBracketToken */: case 18 /* OpenParenToken */: case 19 /* CloseParenToken */: case 81 /* ElseKeyword */: case 105 /* WhileKeyword */: case 56 /* AtToken */: return indentation; - default: - // if token line equals to the line of containing node (this is a first token in the node) - use node indentation - return nodeStartLine !== line ? indentation + getEffectiveDelta(delta, container) : indentation; + case 40 /* SlashToken */: + case 28 /* GreaterThanToken */: { + if (container.kind === 250 /* JsxOpeningElement */ || + container.kind === 251 /* JsxClosingElement */ || + container.kind === 249 /* JsxSelfClosingElement */) { + return indentation; + } + break; + } + case 20 /* OpenBracketToken */: + case 21 /* CloseBracketToken */: { + if (container.kind !== 171 /* MappedType */) { + return indentation; + } + break; + } } + // if token line equals to the line of containing node (this is a first token in the node) - use node indentation + return nodeStartLine !== line ? indentation + getEffectiveDelta(delta, container) : indentation; }, getIndentation: function () { return indentation; }, getDelta: function (child) { return getEffectiveDelta(delta, child); }, @@ -76125,7 +82056,7 @@ var ts; }; function getEffectiveDelta(delta, child) { // Delta value should be zero when the node explicitly prevents indentation of the child node - return formatting.SmartIndenter.nodeWillIndentChild(node, child, true) ? delta : 0; + return formatting.SmartIndenter.nodeWillIndentChild(node, child, /*indentByDefault*/ true) ? delta : 0; } } function processNode(node, contextNode, nodeStartLine, undecoratedNodeStartLine, indentation, delta) { @@ -76158,7 +82089,7 @@ var ts; if (tokenInfo.token.end > node.end) { break; } - consumeTokenAndAdvanceScanner(tokenInfo, node, nodeDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, node, nodeDynamicIndentation, node); } function processChildNode(child, inheritedIndentation, parent, parentDynamicIndentation, parentStartLine, undecoratedParentStartLine, isListItem, isFirstListItem) { var childStartPos = child.getStart(sourceFile); @@ -76192,7 +82123,7 @@ var ts; // stop when formatting scanner advances past the beginning of the child break; } - consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, node); } if (!formattingScanner.isOnToken()) { return inheritedIndentation; @@ -76205,11 +82136,11 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 145 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 146 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); childContextNode = node; - if (isFirstListItem && parent.kind === 175 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent.kind === 176 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -76232,11 +82163,11 @@ var ts; startLine = sourceFile.getLineAndCharacterOfPosition(tokenInfo.token.pos).line; var indentation_1 = computeIndentation(tokenInfo.token, startLine, -1 /* Unknown */, parent, parentDynamicIndentation, parentStartLine); listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, indentation_1.indentation, indentation_1.delta); - consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation, parent); } else { // consume any tokens that precede the list as child elements of 'node' using its indentation scope - consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation, parent); } } } @@ -76254,7 +82185,7 @@ var ts; // without this check close paren will be interpreted as list end token for function expression which is wrong if (tokenInfo.token.kind === listEndToken && ts.rangeContainsRange(parent, tokenInfo.token)) { // consume list end token - consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation, parent); } } } @@ -76461,7 +82392,7 @@ var ts; } // shift all parts on the delta size var delta = indentation - nonWhitespaceColumnInFirstPart.column; - for (var i = startIndex, len = parts.length; i < len; i++, startLine++) { + for (var i = startIndex; i < parts.length; i++, startLine++) { var startLinePos_1 = ts.getStartPositionOfLine(startLine, sourceFile); var nonWhitespaceCharacterAndColumn = i === 0 ? nonWhitespaceColumnInFirstPart @@ -76566,12 +82497,12 @@ var ts; } function getOpenTokenForList(node, list) { switch (node.kind) { - case 150 /* Constructor */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 185 /* ArrowFunction */: + case 151 /* Constructor */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 186 /* ArrowFunction */: if (node.typeParameters === list) { return 26 /* LessThanToken */; } @@ -76579,8 +82510,8 @@ var ts; return 18 /* OpenParenToken */; } break; - case 179 /* CallExpression */: - case 180 /* NewExpression */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: if (node.typeArguments === list) { return 26 /* LessThanToken */; } @@ -76588,7 +82519,7 @@ var ts; return 18 /* OpenParenToken */; } break; - case 157 /* TypeReference */: + case 158 /* TypeReference */: if (node.typeArguments === list) { return 26 /* LessThanToken */; } @@ -76668,7 +82599,20 @@ var ts; (function (Value) { Value[Value["Unknown"] = -1] = "Unknown"; })(Value || (Value = {})); - function getIndentation(position, sourceFile, options) { + /** + * Computed indentation for a given position in source file + * @param position - position in file + * @param sourceFile - target source file + * @param options - set of editor options that control indentation + * @param assumeNewLineBeforeCloseBrace - false when getIndentation is called on the text from the real source file. + * true - when we need to assume that position is on the newline. This is usefult for codefixes, i.e. + * function f() { + * |} + * when inserting some text after open brace we would like to get the value of indentation as if newline was already there. + * However by default indentation at position | will be 0 so 'assumeNewLineBeforeCloseBrace' allows to override this behavior, + */ + function getIndentation(position, sourceFile, options, assumeNewLineBeforeCloseBrace) { + if (assumeNewLineBeforeCloseBrace === void 0) { assumeNewLineBeforeCloseBrace = false; } if (position > sourceFile.text.length) { return getBaseIndentation(options); // past EOF } @@ -76704,7 +82648,7 @@ var ts; var lineStart = ts.getLineStartPositionForPosition(current_1, sourceFile); return SmartIndenter.findFirstNonWhitespaceColumn(lineStart, current_1, sourceFile, options); } - if (precedingToken.kind === 25 /* CommaToken */ && precedingToken.parent.kind !== 192 /* BinaryExpression */) { + if (precedingToken.kind === 25 /* CommaToken */ && precedingToken.parent.kind !== 193 /* BinaryExpression */) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { @@ -76720,8 +82664,10 @@ var ts; while (current) { if (ts.positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current, previous)) { currentStart = getStartLineAndCharacterForNode(current, sourceFile); - if (nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile)) { - indentationDelta = 0; + var nextTokenKind = nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile); + if (nextTokenKind !== 0 /* Unknown */) { + // handle cases when codefix is about to be inserted before the close brace + indentationDelta = assumeNewLineBeforeCloseBrace && nextTokenKind === 2 /* CloseBrace */ ? options.indentSize : 0; } else { indentationDelta = lineAtPosition !== currentStart.line ? options.indentSize : 0; @@ -76827,20 +82773,26 @@ var ts; // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) && - (parent.kind === 261 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 264 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } return findColumnForFirstNonWhitespaceCharacterInLine(currentLineAndChar, sourceFile, options); } + var NextTokenKind; + (function (NextTokenKind) { + NextTokenKind[NextTokenKind["Unknown"] = 0] = "Unknown"; + NextTokenKind[NextTokenKind["OpenBrace"] = 1] = "OpenBrace"; + NextTokenKind[NextTokenKind["CloseBrace"] = 2] = "CloseBrace"; + })(NextTokenKind || (NextTokenKind = {})); function nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile) { var nextToken = ts.findNextToken(precedingToken, current); if (!nextToken) { - return false; + return 0 /* Unknown */; } if (nextToken.kind === 16 /* OpenBraceToken */) { // open braces are always indented at the parent level - return true; + return 1 /* OpenBrace */; } else if (nextToken.kind === 17 /* CloseBraceToken */) { // close braces are indented at the parent level if they are located on the same line with cursor @@ -76852,15 +82804,15 @@ var ts; // class A { // $} var nextTokenStartLine = getStartLineAndCharacterForNode(nextToken, sourceFile).line; - return lineAtPosition === nextTokenStartLine; + return lineAtPosition === nextTokenStartLine ? 2 /* CloseBrace */ : 0 /* Unknown */; } - return false; + return 0 /* Unknown */; } function getStartLineAndCharacterForNode(n, sourceFile) { return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); } function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 208 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 210 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 81 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -76869,53 +82821,49 @@ var ts; return false; } SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement = childStartsOnTheSameLineWithElseInIfStatement; + function getListIfStartEndIsInListRange(list, start, end) { + return list && ts.rangeContainsStartEnd(list, start, end) ? list : undefined; + } function getContainingList(node, sourceFile) { if (node.parent) { switch (node.parent.kind) { - case 157 /* TypeReference */: - if (node.parent.typeArguments && - ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { - return node.parent.typeArguments; - } - break; - case 176 /* ObjectLiteralExpression */: + case 158 /* TypeReference */: + return getListIfStartEndIsInListRange(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd()); + case 177 /* ObjectLiteralExpression */: return node.parent.properties; - case 175 /* ArrayLiteralExpression */: + case 176 /* ArrayLiteralExpression */: return node.parent.elements; - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: { + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 154 /* CallSignature */: + case 151 /* Constructor */: + case 160 /* ConstructorType */: + case 155 /* ConstructSignature */: { var start = node.getStart(sourceFile); - if (node.parent.typeParameters && - ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { - return node.parent.typeParameters; - } - if (ts.rangeContainsStartEnd(node.parent.parameters, start, node.getEnd())) { - return node.parent.parameters; - } - break; + return getListIfStartEndIsInListRange(node.parent.typeParameters, start, node.getEnd()) || + getListIfStartEndIsInListRange(node.parent.parameters, start, node.getEnd()); } - case 180 /* NewExpression */: - case 179 /* CallExpression */: { + case 228 /* ClassDeclaration */: + return getListIfStartEndIsInListRange(node.parent.typeParameters, node.getStart(sourceFile), node.getEnd()); + case 181 /* NewExpression */: + case 180 /* CallExpression */: { var start = node.getStart(sourceFile); - if (node.parent.typeArguments && - ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { - return node.parent.typeArguments; - } - if (node.parent.arguments && - ts.rangeContainsStartEnd(node.parent.arguments, start, node.getEnd())) { - return node.parent.arguments; - } - break; + return getListIfStartEndIsInListRange(node.parent.typeArguments, start, node.getEnd()) || + getListIfStartEndIsInListRange(node.parent.arguments, start, node.getEnd()); } + case 226 /* VariableDeclarationList */: + return getListIfStartEndIsInListRange(node.parent.declarations, node.getStart(sourceFile), node.getEnd()); + case 240 /* NamedImports */: + case 244 /* NamedExports */: + return getListIfStartEndIsInListRange(node.parent.elements, node.getStart(sourceFile), node.getEnd()); } } return undefined; } + SmartIndenter.getContainingList = getContainingList; function getActualIndentationForListItem(node, sourceFile, options) { var containingList = getContainingList(node, sourceFile); return containingList ? getActualIndentationFromList(containingList) : -1 /* Unknown */; @@ -76930,8 +82878,8 @@ var ts; if (node.kind === 19 /* CloseParenToken */) { return -1 /* Unknown */; } - if (node.parent && (node.parent.kind === 179 /* CallExpression */ || - node.parent.kind === 180 /* NewExpression */) && + if (node.parent && (node.parent.kind === 180 /* CallExpression */ || + node.parent.kind === 181 /* NewExpression */) && node.parent.expression !== node) { var fullCallOrNewExpression = node.parent.expression; var startingExpression = getStartingExpression(fullCallOrNewExpression); @@ -76949,10 +82897,10 @@ var ts; function getStartingExpression(node) { while (true) { switch (node.kind) { - case 179 /* CallExpression */: - case 180 /* NewExpression */: - case 177 /* PropertyAccessExpression */: - case 178 /* ElementAccessExpression */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: + case 178 /* PropertyAccessExpression */: + case 179 /* ElementAccessExpression */: node = node.expression; break; default: @@ -77016,48 +82964,49 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 207 /* ExpressionStatement */: - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: - case 229 /* EnumDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 175 /* ArrayLiteralExpression */: - case 204 /* Block */: - case 231 /* ModuleBlock */: - case 176 /* ObjectLiteralExpression */: - case 161 /* TypeLiteral */: - case 163 /* TupleType */: - case 232 /* CaseBlock */: - case 254 /* DefaultClause */: - case 253 /* CaseClause */: - case 183 /* ParenthesizedExpression */: - case 177 /* PropertyAccessExpression */: - case 179 /* CallExpression */: - case 180 /* NewExpression */: - case 205 /* VariableStatement */: - case 223 /* VariableDeclaration */: - case 240 /* ExportAssignment */: - case 216 /* ReturnStatement */: - case 193 /* ConditionalExpression */: - case 173 /* ArrayBindingPattern */: - case 172 /* ObjectBindingPattern */: - case 248 /* JsxOpeningElement */: - case 247 /* JsxSelfClosingElement */: - case 252 /* JsxExpression */: - case 148 /* MethodSignature */: - case 153 /* CallSignature */: - case 154 /* ConstructSignature */: - case 144 /* Parameter */: - case 158 /* FunctionType */: - case 159 /* ConstructorType */: - case 166 /* ParenthesizedType */: - case 181 /* TaggedTemplateExpression */: - case 189 /* AwaitExpression */: - case 242 /* NamedExports */: - case 238 /* NamedImports */: - case 243 /* ExportSpecifier */: - case 239 /* ImportSpecifier */: + case 209 /* ExpressionStatement */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 229 /* InterfaceDeclaration */: + case 231 /* EnumDeclaration */: + case 230 /* TypeAliasDeclaration */: + case 176 /* ArrayLiteralExpression */: + case 206 /* Block */: + case 233 /* ModuleBlock */: + case 177 /* ObjectLiteralExpression */: + case 162 /* TypeLiteral */: + case 171 /* MappedType */: + case 164 /* TupleType */: + case 234 /* CaseBlock */: + case 257 /* DefaultClause */: + case 256 /* CaseClause */: + case 184 /* ParenthesizedExpression */: + case 178 /* PropertyAccessExpression */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: + case 207 /* VariableStatement */: + case 225 /* VariableDeclaration */: + case 242 /* ExportAssignment */: + case 218 /* ReturnStatement */: + case 194 /* ConditionalExpression */: + case 174 /* ArrayBindingPattern */: + case 173 /* ObjectBindingPattern */: + case 250 /* JsxOpeningElement */: + case 249 /* JsxSelfClosingElement */: + case 255 /* JsxExpression */: + case 149 /* MethodSignature */: + case 154 /* CallSignature */: + case 155 /* ConstructSignature */: + case 145 /* Parameter */: + case 159 /* FunctionType */: + case 160 /* ConstructorType */: + case 167 /* ParenthesizedType */: + case 182 /* TaggedTemplateExpression */: + case 190 /* AwaitExpression */: + case 244 /* NamedExports */: + case 240 /* NamedImports */: + case 245 /* ExportSpecifier */: + case 241 /* ImportSpecifier */: return true; } return false; @@ -77066,27 +83015,27 @@ var ts; function nodeWillIndentChild(parent, child, indentByDefault) { var childKind = child ? child.kind : 0 /* Unknown */; switch (parent.kind) { - case 209 /* DoStatement */: - case 210 /* WhileStatement */: - case 212 /* ForInStatement */: - case 213 /* ForOfStatement */: - case 211 /* ForStatement */: - case 208 /* IfStatement */: - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 149 /* MethodDeclaration */: - case 185 /* ArrowFunction */: - case 150 /* Constructor */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - return childKind !== 204 /* Block */; - case 241 /* ExportDeclaration */: - return childKind !== 242 /* NamedExports */; - case 235 /* ImportDeclaration */: - return childKind !== 236 /* ImportClause */ || - (child.namedBindings && child.namedBindings.kind !== 238 /* NamedImports */); - case 246 /* JsxElement */: - return childKind !== 249 /* JsxClosingElement */; + case 211 /* DoStatement */: + case 212 /* WhileStatement */: + case 214 /* ForInStatement */: + case 215 /* ForOfStatement */: + case 213 /* ForStatement */: + case 210 /* IfStatement */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 150 /* MethodDeclaration */: + case 186 /* ArrowFunction */: + case 151 /* Constructor */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + return childKind !== 206 /* Block */; + case 243 /* ExportDeclaration */: + return childKind !== 244 /* NamedExports */; + case 237 /* ImportDeclaration */: + return childKind !== 238 /* ImportClause */ || + (child.namedBindings && child.namedBindings.kind !== 240 /* NamedImports */); + case 248 /* JsxElement */: + return childKind !== 251 /* JsxClosingElement */; } // No explicit rule for given nodes so the result will follow the default value argument return indentByDefault; @@ -77104,10 +83053,589 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var textChanges; + (function (textChanges) { + /** + * Currently for simplicity we store recovered positions on the node itself. + * It can be changed to side-table later if we decide that current design is too invasive. + */ + function getPos(n) { + return n["__pos"]; + } + function setPos(n, pos) { + n["__pos"] = pos; + } + function getEnd(n) { + return n["__end"]; + } + function setEnd(n, end) { + n["__end"] = end; + } + var Position; + (function (Position) { + Position[Position["FullStart"] = 0] = "FullStart"; + Position[Position["Start"] = 1] = "Start"; + })(Position = textChanges.Position || (textChanges.Position = {})); + function skipWhitespacesAndLineBreaks(text, start) { + return ts.skipTrivia(text, start, /*stopAfterLineBreak*/ false, /*stopAtComments*/ true); + } + function hasCommentsBeforeLineBreak(text, start) { + var i = start; + while (i < text.length) { + var ch = text.charCodeAt(i); + if (ts.isWhiteSpaceSingleLine(ch)) { + i++; + continue; + } + return ch === 47 /* slash */; + } + return false; + } + function getSeparatorCharacter(separator) { + return ts.tokenToString(separator.kind); + } + textChanges.getSeparatorCharacter = getSeparatorCharacter; + function getAdjustedStartPosition(sourceFile, node, options, position) { + if (options.useNonAdjustedStartPosition) { + return node.getFullStart(); + } + var fullStart = node.getFullStart(); + var start = node.getStart(sourceFile); + if (fullStart === start) { + return start; + } + var fullStartLine = ts.getLineStartPositionForPosition(fullStart, sourceFile); + var startLine = ts.getLineStartPositionForPosition(start, sourceFile); + if (startLine === fullStartLine) { + // full start and start of the node are on the same line + // a, b; + // ^ ^ + // | start + // fullstart + // when b is replaced - we usually want to keep the leading trvia + // when b is deleted - we delete it + return position === Position.Start ? start : fullStart; + } + // get start position of the line following the line that contains fullstart position + var adjustedStartPosition = ts.getStartPositionOfLine(ts.getLineOfLocalPosition(sourceFile, fullStartLine) + 1, sourceFile); + // skip whitespaces/newlines + adjustedStartPosition = skipWhitespacesAndLineBreaks(sourceFile.text, adjustedStartPosition); + return ts.getStartPositionOfLine(ts.getLineOfLocalPosition(sourceFile, adjustedStartPosition), sourceFile); + } + textChanges.getAdjustedStartPosition = getAdjustedStartPosition; + function getAdjustedEndPosition(sourceFile, node, options) { + if (options.useNonAdjustedEndPosition) { + return node.getEnd(); + } + var end = node.getEnd(); + var newEnd = ts.skipTrivia(sourceFile.text, end, /*stopAfterLineBreak*/ true); + // check if last character before newPos is linebreak + // if yes - considered all skipped trivia to be trailing trivia of the node + return newEnd !== end && ts.isLineBreak(sourceFile.text.charCodeAt(newEnd - 1)) + ? newEnd + : end; + } + textChanges.getAdjustedEndPosition = getAdjustedEndPosition; + /** + * Checks if 'candidate' argument is a legal separator in the list that contains 'node' as an element + */ + function isSeparator(node, candidate) { + return candidate && node.parent && (candidate.kind === 25 /* CommaToken */ || (candidate.kind === 24 /* SemicolonToken */ && node.parent.kind === 177 /* ObjectLiteralExpression */)); + } + function spaces(count) { + var s = ""; + for (var i = 0; i < count; i++) { + s += " "; + } + return s; + } + var ChangeTracker = (function () { + function ChangeTracker(newLine, rulesProvider, validator) { + this.newLine = newLine; + this.rulesProvider = rulesProvider; + this.validator = validator; + this.changes = []; + this.newLineCharacter = ts.getNewLineCharacter({ newLine: newLine }); + } + ChangeTracker.fromCodeFixContext = function (context) { + return new ChangeTracker(context.newLineCharacter === "\n" ? 1 /* LineFeed */ : 0 /* CarriageReturnLineFeed */, context.rulesProvider); + }; + ChangeTracker.prototype.deleteNode = function (sourceFile, node, options) { + if (options === void 0) { options = {}; } + var startPosition = getAdjustedStartPosition(sourceFile, node, options, Position.FullStart); + var endPosition = getAdjustedEndPosition(sourceFile, node, options); + this.changes.push({ sourceFile: sourceFile, options: options, range: { pos: startPosition, end: endPosition } }); + return this; + }; + ChangeTracker.prototype.deleteRange = function (sourceFile, range) { + this.changes.push({ sourceFile: sourceFile, range: range }); + return this; + }; + ChangeTracker.prototype.deleteNodeRange = function (sourceFile, startNode, endNode, options) { + if (options === void 0) { options = {}; } + var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.FullStart); + var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); + this.changes.push({ sourceFile: sourceFile, options: options, range: { pos: startPosition, end: endPosition } }); + return this; + }; + ChangeTracker.prototype.deleteNodeInList = function (sourceFile, node) { + var containingList = ts.formatting.SmartIndenter.getContainingList(node, sourceFile); + if (!containingList) { + ts.Debug.fail("node is not a list element"); + return this; + } + var index = containingList.indexOf(node); + if (index < 0) { + return this; + } + if (containingList.length === 1) { + this.deleteNode(sourceFile, node); + return this; + } + if (index !== containingList.length - 1) { + var nextToken = ts.getTokenAtPosition(sourceFile, node.end); + if (nextToken && isSeparator(node, nextToken)) { + // find first non-whitespace position in the leading trivia of the node + var startPosition = ts.skipTrivia(sourceFile.text, getAdjustedStartPosition(sourceFile, node, {}, Position.FullStart), /*stopAfterLineBreak*/ false, /*stopAtComments*/ true); + var nextElement = containingList[index + 1]; + /// find first non-whitespace position in the leading trivia of the next node + var endPosition = ts.skipTrivia(sourceFile.text, getAdjustedStartPosition(sourceFile, nextElement, {}, Position.FullStart), /*stopAfterLineBreak*/ false, /*stopAtComments*/ true); + // shift next node so its first non-whitespace position will be moved to the first non-whitespace position of the deleted node + this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); + } + } + else { + var previousToken = ts.getTokenAtPosition(sourceFile, containingList[index - 1].end); + if (previousToken && isSeparator(node, previousToken)) { + this.deleteNodeRange(sourceFile, previousToken, node); + } + } + return this; + }; + ChangeTracker.prototype.replaceRange = function (sourceFile, range, newNode, options) { + if (options === void 0) { options = {}; } + this.changes.push({ sourceFile: sourceFile, range: range, options: options, node: newNode }); + return this; + }; + ChangeTracker.prototype.replaceNode = function (sourceFile, oldNode, newNode, options) { + if (options === void 0) { options = {}; } + var startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); + var endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); + this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: endPosition } }); + return this; + }; + ChangeTracker.prototype.replaceNodeRange = function (sourceFile, startNode, endNode, newNode, options) { + if (options === void 0) { options = {}; } + var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); + var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); + this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: endPosition } }); + return this; + }; + ChangeTracker.prototype.insertNodeAt = function (sourceFile, pos, newNode, options) { + if (options === void 0) { options = {}; } + this.changes.push({ sourceFile: sourceFile, options: options, node: newNode, range: { pos: pos, end: pos } }); + return this; + }; + ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, options) { + if (options === void 0) { options = {}; } + var startPosition = getAdjustedStartPosition(sourceFile, before, options, Position.Start); + this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: startPosition } }); + return this; + }; + ChangeTracker.prototype.insertNodeAfter = function (sourceFile, after, newNode, options) { + if (options === void 0) { options = {}; } + if ((ts.isStatementButNotDeclaration(after)) || + after.kind === 148 /* PropertyDeclaration */ || + after.kind === 147 /* PropertySignature */ || + after.kind === 149 /* MethodSignature */) { + // check if previous statement ends with semicolon + // if not - insert semicolon to preserve the code from changing the meaning due to ASI + if (sourceFile.text.charCodeAt(after.end - 1) !== 59 /* semicolon */) { + this.changes.push({ + sourceFile: sourceFile, + options: {}, + range: { pos: after.end, end: after.end }, + node: ts.createToken(24 /* SemicolonToken */) + }); + } + } + var endPosition = getAdjustedEndPosition(sourceFile, after, options); + this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: endPosition, end: endPosition } }); + return this; + }; + /** + * This function should be used to insert nodes in lists when nodes don't carry separators as the part of the node range, + * i.e. arguments in arguments lists, parameters in parameter lists etc. + * Note that separators are part of the node in statements and class elements. + */ + ChangeTracker.prototype.insertNodeInListAfter = function (sourceFile, after, newNode) { + var containingList = ts.formatting.SmartIndenter.getContainingList(after, sourceFile); + if (!containingList) { + ts.Debug.fail("node is not a list element"); + return this; + } + var index = containingList.indexOf(after); + if (index < 0) { + return this; + } + var end = after.getEnd(); + if (index !== containingList.length - 1) { + // any element except the last one + // use next sibling as an anchor + var nextToken = ts.getTokenAtPosition(sourceFile, after.end); + if (nextToken && isSeparator(after, nextToken)) { + // for list + // a, b, c + // create change for adding 'e' after 'a' as + // - find start of next element after a (it is b) + // - use this start as start and end position in final change + // - build text of change by formatting the text of node + separator + whitespace trivia of b + // in multiline case it will work as + // a, + // b, + // c, + // result - '*' denotes leading trivia that will be inserted after new text (displayed as '#') + // a,* + // ***insertedtext# + // ###b, + // c, + // find line and character of the next element + var lineAndCharOfNextElement = ts.getLineAndCharacterOfPosition(sourceFile, skipWhitespacesAndLineBreaks(sourceFile.text, containingList[index + 1].getFullStart())); + // find line and character of the token that precedes next element (usually it is separator) + var lineAndCharOfNextToken = ts.getLineAndCharacterOfPosition(sourceFile, nextToken.end); + var prefix = void 0; + var startPos = void 0; + if (lineAndCharOfNextToken.line === lineAndCharOfNextElement.line) { + // next element is located on the same line with separator: + // a,$$$$b + // ^ ^ + // | |-next element + // |-separator + // where $$$ is some leading trivia + // for a newly inserted node we'll maintain the same relative position comparing to separator and replace leading trivia with spaces + // a, x,$$$$b + // ^ ^ ^ + // | | |-next element + // | |-new inserted node padded with spaces + // |-separator + startPos = nextToken.end; + prefix = spaces(lineAndCharOfNextElement.character - lineAndCharOfNextToken.character); + } + else { + // next element is located on different line that separator + // let insert position be the beginning of the line that contains next element + startPos = ts.getStartPositionOfLine(lineAndCharOfNextElement.line, sourceFile); + } + this.changes.push({ + sourceFile: sourceFile, + range: { pos: startPos, end: containingList[index + 1].getStart(sourceFile) }, + node: newNode, + useIndentationFromFile: true, + options: { + prefix: prefix, + // write separator and leading trivia of the next element as suffix + suffix: "" + ts.tokenToString(nextToken.kind) + sourceFile.text.substring(nextToken.end, containingList[index + 1].getStart(sourceFile)) + } + }); + } + } + else { + var afterStart = after.getStart(sourceFile); + var afterStartLinePosition = ts.getLineStartPositionForPosition(afterStart, sourceFile); + var separator = void 0; + var multilineList = false; + // insert element after the last element in the list that has more than one item + // pick the element preceding the after element to: + // - pick the separator + // - determine if list is a multiline + if (containingList.length === 1) { + // if list has only one element then we'll format is as multiline if node has comment in trailing trivia, or as singleline otherwise + // i.e. var x = 1 // this is x + // | new element will be inserted at this position + separator = 25 /* CommaToken */; + } + else { + // element has more than one element, pick separator from the list + var tokenBeforeInsertPosition = ts.findPrecedingToken(after.pos, sourceFile); + separator = isSeparator(after, tokenBeforeInsertPosition) ? tokenBeforeInsertPosition.kind : 25 /* CommaToken */; + // determine if list is multiline by checking lines of after element and element that precedes it. + var afterMinusOneStartLinePosition = ts.getLineStartPositionForPosition(containingList[index - 1].getStart(sourceFile), sourceFile); + multilineList = afterMinusOneStartLinePosition !== afterStartLinePosition; + } + if (hasCommentsBeforeLineBreak(sourceFile.text, after.end)) { + // in this case we'll always treat containing list as multiline + multilineList = true; + } + if (multilineList) { + // insert separator immediately following the 'after' node to preserve comments in trailing trivia + this.changes.push({ + sourceFile: sourceFile, + range: { pos: end, end: end }, + node: ts.createToken(separator), + options: {} + }); + // use the same indentation as 'after' item + var indentation = ts.formatting.SmartIndenter.findFirstNonWhitespaceColumn(afterStartLinePosition, afterStart, sourceFile, this.rulesProvider.getFormatOptions()); + // insert element before the line break on the line that contains 'after' element + var insertPos = ts.skipTrivia(sourceFile.text, end, /*stopAfterLineBreak*/ true, /*stopAtComments*/ false); + if (insertPos !== end && ts.isLineBreak(sourceFile.text.charCodeAt(insertPos - 1))) { + insertPos--; + } + this.changes.push({ + sourceFile: sourceFile, + range: { pos: insertPos, end: insertPos }, + node: newNode, + options: { indentation: indentation, prefix: this.newLineCharacter } + }); + } + else { + this.changes.push({ + sourceFile: sourceFile, + range: { pos: end, end: end }, + node: newNode, + options: { prefix: ts.tokenToString(separator) + " " } + }); + } + } + return this; + }; + ChangeTracker.prototype.getChanges = function () { + var _this = this; + var changesPerFile = ts.createFileMap(); + // group changes per file + for (var _i = 0, _a = this.changes; _i < _a.length; _i++) { + var c = _a[_i]; + var changesInFile = changesPerFile.get(c.sourceFile.path); + if (!changesInFile) { + changesPerFile.set(c.sourceFile.path, changesInFile = []); + } + changesInFile.push(c); + } + // convert changes + var fileChangesList = []; + changesPerFile.forEachValue(function (path) { + var changesInFile = changesPerFile.get(path); + var sourceFile = changesInFile[0].sourceFile; + var fileTextChanges = { fileName: sourceFile.fileName, textChanges: [] }; + for (var _i = 0, _a = ChangeTracker.normalize(changesInFile); _i < _a.length; _i++) { + var c = _a[_i]; + fileTextChanges.textChanges.push({ + span: _this.computeSpan(c, sourceFile), + newText: _this.computeNewText(c, sourceFile) + }); + } + fileChangesList.push(fileTextChanges); + }); + return fileChangesList; + }; + ChangeTracker.prototype.computeSpan = function (change, _sourceFile) { + return ts.createTextSpanFromBounds(change.range.pos, change.range.end); + }; + ChangeTracker.prototype.computeNewText = function (change, sourceFile) { + if (!change.node) { + // deletion case + return ""; + } + var options = change.options || {}; + var nonFormattedText = getNonformattedText(change.node, sourceFile, this.newLine); + if (this.validator) { + this.validator(nonFormattedText); + } + var formatOptions = this.rulesProvider.getFormatOptions(); + var pos = change.range.pos; + var posStartsLine = ts.getLineStartPositionForPosition(pos, sourceFile) === pos; + var initialIndentation = change.options.indentation !== undefined + ? change.options.indentation + : change.useIndentationFromFile + ? ts.formatting.SmartIndenter.getIndentation(change.range.pos, sourceFile, formatOptions, posStartsLine || (change.options.prefix === this.newLineCharacter)) + : 0; + var delta = change.options.delta !== undefined + ? change.options.delta + : ts.formatting.SmartIndenter.shouldIndentChildNode(change.node) + ? formatOptions.indentSize + : 0; + var text = applyFormatting(nonFormattedText, sourceFile, initialIndentation, delta, this.rulesProvider); + // strip initial indentation (spaces or tabs) if text will be inserted in the middle of the line + // however keep indentation if it is was forced + text = posStartsLine || change.options.indentation !== undefined ? text : text.replace(/^\s+/, ""); + return (options.prefix || "") + text + (options.suffix || ""); + }; + ChangeTracker.normalize = function (changes) { + // order changes by start position + var normalized = ts.stableSort(changes, function (a, b) { return a.range.pos - b.range.pos; }); + // verify that change intervals do not overlap, except possibly at end points. + for (var i = 0; i < normalized.length - 2; i++) { + ts.Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos); + } + return normalized; + }; + return ChangeTracker; + }()); + textChanges.ChangeTracker = ChangeTracker; + function getNonformattedText(node, sourceFile, newLine) { + var options = { newLine: newLine, target: sourceFile.languageVersion }; + var writer = new Writer(ts.getNewLineCharacter(options)); + var printer = ts.createPrinter(options, writer); + printer.writeNode(3 /* Unspecified */, node, sourceFile, writer); + return { text: writer.getText(), node: assignPositionsToNode(node) }; + } + textChanges.getNonformattedText = getNonformattedText; + function applyFormatting(nonFormattedText, sourceFile, initialIndentation, delta, rulesProvider) { + var lineMap = ts.computeLineStarts(nonFormattedText.text); + var file = { + text: nonFormattedText.text, + lineMap: lineMap, + getLineAndCharacterOfPosition: function (pos) { return ts.computeLineAndCharacterOfPosition(lineMap, pos); } + }; + var changes = ts.formatting.formatNode(nonFormattedText.node, file, sourceFile.languageVariant, initialIndentation, delta, rulesProvider); + return applyChanges(nonFormattedText.text, changes); + } + textChanges.applyFormatting = applyFormatting; + function applyChanges(text, changes) { + for (var i = changes.length - 1; i >= 0; i--) { + var change = changes[i]; + text = "" + text.substring(0, change.span.start) + change.newText + text.substring(ts.textSpanEnd(change.span)); + } + return text; + } + textChanges.applyChanges = applyChanges; + function isTrivia(s) { + return ts.skipTrivia(s, 0) === s.length; + } + var nullTransformationContext = { + enableEmitNotification: ts.noop, + enableSubstitution: ts.noop, + endLexicalEnvironment: function () { return undefined; }, + getCompilerOptions: ts.notImplemented, + getEmitHost: ts.notImplemented, + getEmitResolver: ts.notImplemented, + hoistFunctionDeclaration: ts.noop, + hoistVariableDeclaration: ts.noop, + isEmitNotificationEnabled: ts.notImplemented, + isSubstitutionEnabled: ts.notImplemented, + onEmitNode: ts.noop, + onSubstituteNode: ts.notImplemented, + readEmitHelpers: ts.notImplemented, + requestEmitHelper: ts.noop, + resumeLexicalEnvironment: ts.noop, + startLexicalEnvironment: ts.noop, + suspendLexicalEnvironment: ts.noop + }; + function assignPositionsToNode(node) { + var visited = ts.visitEachChild(node, assignPositionsToNode, nullTransformationContext, assignPositionsToNodeArray, assignPositionsToNode); + // create proxy node for non synthesized nodes + var newNode = ts.nodeIsSynthesized(visited) + ? visited + : (Proxy.prototype = visited, new Proxy()); + newNode.pos = getPos(node); + newNode.end = getEnd(node); + return newNode; + function Proxy() { } + } + function assignPositionsToNodeArray(nodes, visitor, test, start, count) { + var visited = ts.visitNodes(nodes, visitor, test, start, count); + if (!visited) { + return visited; + } + // clone nodearray if necessary + var nodeArray = visited === nodes ? ts.createNodeArray(visited.slice(0)) : visited; + nodeArray.pos = getPos(nodes); + nodeArray.end = getEnd(nodes); + return nodeArray; + } + var Writer = (function () { + function Writer(newLine) { + var _this = this; + this.lastNonTriviaPosition = 0; + this.writer = ts.createTextWriter(newLine); + this.onEmitNode = function (hint, node, printCallback) { + if (node) { + setPos(node, _this.lastNonTriviaPosition); + } + printCallback(hint, node); + if (node) { + setEnd(node, _this.lastNonTriviaPosition); + } + }; + this.onBeforeEmitNodeArray = function (nodes) { + if (nodes) { + setPos(nodes, _this.lastNonTriviaPosition); + } + }; + this.onAfterEmitNodeArray = function (nodes) { + if (nodes) { + setEnd(nodes, _this.lastNonTriviaPosition); + } + }; + } + Writer.prototype.setLastNonTriviaPosition = function (s, force) { + if (force || !isTrivia(s)) { + this.lastNonTriviaPosition = this.writer.getTextPos(); + var i = 0; + while (ts.isWhiteSpace(s.charCodeAt(s.length - i - 1))) { + i++; + } + // trim trailing whitespaces + this.lastNonTriviaPosition -= i; + } + }; + Writer.prototype.write = function (s) { + this.writer.write(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeTextOfNode = function (text, node) { + this.writer.writeTextOfNode(text, node); + }; + Writer.prototype.writeLine = function () { + this.writer.writeLine(); + }; + Writer.prototype.increaseIndent = function () { + this.writer.increaseIndent(); + }; + Writer.prototype.decreaseIndent = function () { + this.writer.decreaseIndent(); + }; + Writer.prototype.getText = function () { + return this.writer.getText(); + }; + Writer.prototype.rawWrite = function (s) { + this.writer.rawWrite(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeLiteral = function (s) { + this.writer.writeLiteral(s); + this.setLastNonTriviaPosition(s, /*force*/ true); + }; + Writer.prototype.getTextPos = function () { + return this.writer.getTextPos(); + }; + Writer.prototype.getLine = function () { + return this.writer.getLine(); + }; + Writer.prototype.getColumn = function () { + return this.writer.getColumn(); + }; + Writer.prototype.getIndent = function () { + return this.writer.getIndent(); + }; + Writer.prototype.isAtStartOfLine = function () { + return this.writer.isAtStartOfLine(); + }; + Writer.prototype.reset = function () { + this.writer.reset(); + this.lastNonTriviaPosition = 0; + }; + return Writer; + }()); + })(textChanges = ts.textChanges || (ts.textChanges = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var codefix; (function (codefix) { - var codeFixes = ts.createMap(); + var codeFixes = []; function registerCodeFix(action) { ts.forEach(action.errorCodes, function (error) { var fixes = codeFixes[error]; @@ -77142,25 +83670,226 @@ var ts; (function (ts) { var codefix; (function (codefix) { - function getOpenBraceEnd(constructor, sourceFile) { - // First token is the open curly, this is where we want to put the 'super' call. - return constructor.body.getFirstToken(sourceFile).getEnd(); - } codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code], - getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start); - if (token.kind !== 122 /* ConstructorKeyword */) { - return undefined; - } - var newPosition = getOpenBraceEnd(token.parent, sourceFile); - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_missing_super_call), - changes: [{ fileName: sourceFile.fileName, textChanges: [{ newText: "super();", span: { start: newPosition, length: 0 } }] }] - }]; - } + errorCodes: [ts.Diagnostics.Class_0_incorrectly_implements_interface_1.code], + getCodeActions: getActionForClassLikeIncorrectImplementsInterface }); + function getActionForClassLikeIncorrectImplementsInterface(context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + var token = ts.getTokenAtPosition(sourceFile, start); + var checker = context.program.getTypeChecker(); + var classDeclaration = ts.getContainingClass(token); + if (!classDeclaration) { + return undefined; + } + var openBrace = ts.getOpenBraceOfClassLike(classDeclaration, sourceFile); + var classType = checker.getTypeAtLocation(classDeclaration); + var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(classDeclaration); + var hasNumericIndexSignature = !!checker.getIndexTypeOfType(classType, 1 /* Number */); + var hasStringIndexSignature = !!checker.getIndexTypeOfType(classType, 0 /* String */); + var result = []; + for (var _i = 0, implementedTypeNodes_2 = implementedTypeNodes; _i < implementedTypeNodes_2.length; _i++) { + var implementedTypeNode = implementedTypeNodes_2[_i]; + // Note that this is ultimately derived from a map indexed by symbol names, + // so duplicates cannot occur. + var implementedType = checker.getTypeAtLocation(implementedTypeNode); + var implementedTypeSymbols = checker.getPropertiesOfType(implementedType); + var nonPrivateMembers = implementedTypeSymbols.filter(function (symbol) { return !(ts.getModifierFlags(symbol.valueDeclaration) & 8 /* Private */); }); + var newNodes = []; + createAndAddMissingIndexSignatureDeclaration(implementedType, 1 /* Number */, hasNumericIndexSignature, newNodes); + createAndAddMissingIndexSignatureDeclaration(implementedType, 0 /* String */, hasStringIndexSignature, newNodes); + newNodes = newNodes.concat(codefix.createMissingMemberNodes(classDeclaration, nonPrivateMembers, checker)); + var message = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_interface_0), [implementedTypeNode.getText()]); + if (newNodes.length > 0) { + pushAction(result, newNodes, message); + } + } + return result; + function createAndAddMissingIndexSignatureDeclaration(type, kind, hasIndexSigOfKind, newNodes) { + if (hasIndexSigOfKind) { + return; + } + var indexInfoOfKind = checker.getIndexInfoOfType(type, kind); + if (!indexInfoOfKind) { + return; + } + var newIndexSignatureDeclaration = checker.indexInfoToIndexSignatureDeclaration(indexInfoOfKind, kind, classDeclaration); + newNodes.push(newIndexSignatureDeclaration); + } + function pushAction(result, newNodes, description) { + var newAction = { + description: description, + changes: codefix.newNodesToChanges(newNodes, openBrace, context) + }; + result.push(newAction); + } + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Property_0_does_not_exist_on_type_1.code], + getCodeActions: getActionsForAddMissingMember + }); + function getActionsForAddMissingMember(context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + // This is the identifier of the missing property. eg: + // this.missing = 1; + // ^^^^^^^ + var token = ts.getTokenAtPosition(sourceFile, start); + if (token.kind !== 70 /* Identifier */) { + return undefined; + } + if (!ts.isPropertyAccessExpression(token.parent) || token.parent.expression.kind !== 98 /* ThisKeyword */) { + return undefined; + } + var classMemberDeclaration = ts.getThisContainer(token, /*includeArrowFunctions*/ false); + if (!ts.isClassElement(classMemberDeclaration)) { + return undefined; + } + var classDeclaration = classMemberDeclaration.parent; + if (!classDeclaration || !ts.isClassLike(classDeclaration)) { + return undefined; + } + var isStatic = ts.hasModifier(classMemberDeclaration, 32 /* Static */); + return ts.isInJavaScriptFile(sourceFile) ? getActionsForAddMissingMemberInJavaScriptFile() : getActionsForAddMissingMemberInTypeScriptFile(); + function getActionsForAddMissingMemberInJavaScriptFile() { + var memberName = token.getText(); + if (isStatic) { + if (classDeclaration.kind === 198 /* ClassExpression */) { + return undefined; + } + var className = classDeclaration.name.getText(); + return [{ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Initialize_static_property_0), [memberName]), + changes: [{ + fileName: sourceFile.fileName, + textChanges: [{ + span: { start: classDeclaration.getEnd(), length: 0 }, + newText: "" + context.newLineCharacter + className + "." + memberName + " = undefined;" + context.newLineCharacter + }] + }] + }]; + } + else { + var classConstructor = ts.getFirstConstructorWithBody(classDeclaration); + if (!classConstructor) { + return undefined; + } + return [{ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Initialize_property_0_in_the_constructor), [memberName]), + changes: [{ + fileName: sourceFile.fileName, + textChanges: [{ + span: { start: classConstructor.body.getEnd() - 1, length: 0 }, + newText: "this." + memberName + " = undefined;" + context.newLineCharacter + }] + }] + }]; + } + } + function getActionsForAddMissingMemberInTypeScriptFile() { + var typeNode; + if (token.parent.parent.kind === 193 /* BinaryExpression */) { + var binaryExpression = token.parent.parent; + var checker = context.program.getTypeChecker(); + var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(binaryExpression.right))); + typeNode = checker.typeToTypeNode(widenedType, classDeclaration); + } + typeNode = typeNode || ts.createKeywordTypeNode(118 /* AnyKeyword */); + var openBrace = ts.getOpenBraceOfClassLike(classDeclaration, sourceFile); + var property = ts.createProperty( + /*decorators*/ undefined, + /*modifiers*/ isStatic ? [ts.createToken(114 /* StaticKeyword */)] : undefined, token.getText(sourceFile), + /*questionToken*/ undefined, typeNode, + /*initializer*/ undefined); + var propertyChangeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + propertyChangeTracker.insertNodeAfter(sourceFile, openBrace, property, { suffix: context.newLineCharacter }); + var actions = [{ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_declaration_for_missing_property_0), [token.getText()]), + changes: propertyChangeTracker.getChanges() + }]; + if (!isStatic) { + var stringTypeNode = ts.createKeywordTypeNode(135 /* StringKeyword */); + var indexingParameter = ts.createParameter( + /*decorators*/ undefined, + /*modifiers*/ undefined, + /*dotDotDotToken*/ undefined, "x", + /*questionToken*/ undefined, stringTypeNode, + /*initializer*/ undefined); + var indexSignature = ts.createIndexSignatureDeclaration( + /*decorators*/ undefined, + /*modifiers*/ undefined, [indexingParameter], typeNode); + var indexSignatureChangeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + indexSignatureChangeTracker.insertNodeAfter(sourceFile, openBrace, indexSignature, { suffix: context.newLineCharacter }); + actions.push({ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_index_signature_for_missing_property_0), [token.getText()]), + changes: indexSignatureChangeTracker.getChanges() + }); + } + return actions; + } + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code], + getCodeActions: getActionForClassLikeMissingAbstractMember + }); + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code], + getCodeActions: getActionForClassLikeMissingAbstractMember + }); + function getActionForClassLikeMissingAbstractMember(context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + // This is the identifier in the case of a class declaration + // or the class keyword token in the case of a class expression. + var token = ts.getTokenAtPosition(sourceFile, start); + var checker = context.program.getTypeChecker(); + if (ts.isClassLike(token.parent)) { + var classDeclaration = token.parent; + var extendsNode = ts.getClassExtendsHeritageClauseElement(classDeclaration); + var instantiatedExtendsType = checker.getTypeAtLocation(extendsNode); + // Note that this is ultimately derived from a map indexed by symbol names, + // so duplicates cannot occur. + var extendsSymbols = checker.getPropertiesOfType(instantiatedExtendsType); + var abstractAndNonPrivateExtendsSymbols = extendsSymbols.filter(symbolPointsToNonPrivateAndAbstractMember); + var newNodes = codefix.createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, checker); + var changes = codefix.newNodesToChanges(newNodes, ts.getOpenBraceOfClassLike(classDeclaration, sourceFile), context); + if (changes && changes.length > 0) { + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_inherited_abstract_class), + changes: changes + }]; + } + } + return undefined; + } + function symbolPointsToNonPrivateAndAbstractMember(symbol) { + var decls = symbol.getDeclarations(); + ts.Debug.assert(!!(decls && decls.length > 0)); + var flags = ts.getModifierFlags(decls[0]); + return !(flags & 8 /* Private */) && !!(flags & 128 /* Abstract */); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { codefix.registerCodeFix({ errorCodes: [ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code], getCodeActions: function (context) { @@ -77174,9 +83903,9 @@ var ts; if (!superCall) { return undefined; } - // figure out if the this access is actuall inside the supercall + // figure out if the `this` access is actually inside the supercall // i.e. super(this.a), since in that case we won't suggest a fix - if (superCall.expression && superCall.expression.kind == 179 /* CallExpression */) { + if (superCall.expression && superCall.expression.kind === 180 /* CallExpression */) { var arguments_1 = superCall.expression.arguments; for (var i = 0; i < arguments_1.length; i++) { if (arguments_1[i].expression === token) { @@ -77184,23 +83913,15 @@ var ts; } } } - var newPosition = getOpenBraceEnd(constructor, sourceFile); - var changes = [{ - fileName: sourceFile.fileName, textChanges: [{ - newText: superCall.getText(sourceFile), - span: { start: newPosition, length: 0 } - }, - { - newText: "", - span: { start: superCall.getStart(sourceFile), length: superCall.getWidth(sourceFile) } - }] - }]; + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + changeTracker.insertNodeAfter(sourceFile, ts.getOpenBrace(constructor, sourceFile), superCall, { suffix: context.newLineCharacter }); + changeTracker.deleteNode(sourceFile, superCall); return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Make_super_call_the_first_statement_in_the_constructor), - changes: changes + changes: changeTracker.getChanges() }]; function findSuperCall(n) { - if (n.kind === 207 /* ExpressionStatement */ && ts.isSuperCall(n.expression)) { + if (n.kind === 209 /* ExpressionStatement */ && ts.isSuperCall(n.expression)) { return n; } if (ts.isFunctionLike(n)) { @@ -77214,6 +83935,265 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code], + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var token = ts.getTokenAtPosition(sourceFile, context.span.start); + if (token.kind !== 122 /* ConstructorKeyword */) { + return undefined; + } + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + var superCall = ts.createStatement(ts.createCall(ts.createSuper(), /*typeArguments*/ undefined, /*argumentsArray*/ ts.emptyArray)); + changeTracker.insertNodeAfter(sourceFile, ts.getOpenBrace(token.parent, sourceFile), superCall, { suffix: context.newLineCharacter }); + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_missing_super_call), + changes: changeTracker.getChanges() + }]; + } + }); + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code], + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + var token = ts.getTokenAtPosition(sourceFile, start); + var classDeclNode = ts.getContainingClass(token); + if (!(token.kind === 70 /* Identifier */ && ts.isClassLike(classDeclNode))) { + return undefined; + } + var heritageClauses = classDeclNode.heritageClauses; + if (!(heritageClauses && heritageClauses.length > 0)) { + return undefined; + } + var extendsToken = heritageClauses[0].getFirstToken(); + if (!(extendsToken && extendsToken.kind === 84 /* ExtendsKeyword */)) { + return undefined; + } + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + changeTracker.replaceNode(sourceFile, extendsToken, ts.createToken(107 /* ImplementsKeyword */)); + // We replace existing keywords with commas. + for (var i = 1; i < heritageClauses.length; i++) { + var keywordToken = heritageClauses[i].getFirstToken(); + if (keywordToken) { + changeTracker.replaceNode(sourceFile, keywordToken, ts.createToken(25 /* CommaToken */)); + } + } + var result = [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Change_extends_to_implements), + changes: changeTracker.getChanges() + }]; + return result; + } + }); + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code], + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var token = ts.getTokenAtPosition(sourceFile, context.span.start); + if (token.kind !== 70 /* Identifier */) { + return undefined; + } + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + changeTracker.replaceNode(sourceFile, token, ts.createPropertyAccess(ts.createThis(), token)); + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_this_to_unresolved_variable), + changes: changeTracker.getChanges() + }]; + } + }); + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ + ts.Diagnostics._0_is_declared_but_never_used.code, + ts.Diagnostics.Property_0_is_declared_but_never_used.code + ], + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var start = context.span.start; + var token = ts.getTokenAtPosition(sourceFile, start); + // this handles var ["computed"] = 12; + if (token.kind === 20 /* OpenBracketToken */) { + token = ts.getTokenAtPosition(sourceFile, start + 1); + } + switch (token.kind) { + case 70 /* Identifier */: + switch (token.parent.kind) { + case 225 /* VariableDeclaration */: + switch (token.parent.parent.parent.kind) { + case 213 /* ForStatement */: + var forStatement = token.parent.parent.parent; + var forInitializer = forStatement.initializer; + if (forInitializer.declarations.length === 1) { + return deleteNode(forInitializer); + } + else { + return deleteNodeInList(token.parent); + } + case 215 /* ForOfStatement */: + var forOfStatement = token.parent.parent.parent; + if (forOfStatement.initializer.kind === 226 /* VariableDeclarationList */) { + var forOfInitializer = forOfStatement.initializer; + return replaceNode(forOfInitializer.declarations[0], ts.createObjectLiteral()); + } + break; + case 214 /* ForInStatement */: + // There is no valid fix in the case of: + // for .. in + return undefined; + case 259 /* CatchClause */: + var catchClause = token.parent.parent; + var parameter = catchClause.variableDeclaration.getChildren()[0]; + return deleteNode(parameter); + default: + var variableStatement = token.parent.parent.parent; + if (variableStatement.declarationList.declarations.length === 1) { + return deleteNode(variableStatement); + } + else { + return deleteNodeInList(token.parent); + } + } + // TODO: #14885 + // falls through + case 144 /* TypeParameter */: + var typeParameters = token.parent.parent.typeParameters; + if (typeParameters.length === 1) { + var previousToken = ts.getTokenAtPosition(sourceFile, typeParameters.pos - 1); + if (!previousToken || previousToken.kind !== 26 /* LessThanToken */) { + return deleteRange(typeParameters); + } + var nextToken = ts.getTokenAtPosition(sourceFile, typeParameters.end); + if (!nextToken || nextToken.kind !== 28 /* GreaterThanToken */) { + return deleteRange(typeParameters); + } + return deleteNodeRange(previousToken, nextToken); + } + else { + return deleteNodeInList(token.parent); + } + case 145 /* Parameter */: + var functionDeclaration = token.parent.parent; + if (functionDeclaration.parameters.length === 1) { + return deleteNode(token.parent); + } + else { + return deleteNodeInList(token.parent); + } + // handle case where 'import a = A;' + case 236 /* ImportEqualsDeclaration */: + var importEquals = ts.getAncestor(token, 236 /* ImportEqualsDeclaration */); + return deleteNode(importEquals); + case 241 /* ImportSpecifier */: + var namedImports = token.parent.parent; + if (namedImports.elements.length === 1) { + // Only 1 import and it is unused. So the entire declaration should be removed. + var importSpec = ts.getAncestor(token, 237 /* ImportDeclaration */); + return deleteNode(importSpec); + } + else { + // delete import specifier + return deleteNodeInList(token.parent); + } + // handle case where "import d, * as ns from './file'" + // or "'import {a, b as ns} from './file'" + case 238 /* ImportClause */: + var importClause = token.parent; + if (!importClause.namedBindings) { + var importDecl = ts.getAncestor(importClause, 237 /* ImportDeclaration */); + return deleteNode(importDecl); + } + else { + // import |d,| * as ns from './file' + var start_4 = importClause.name.getStart(sourceFile); + var nextToken = ts.getTokenAtPosition(sourceFile, importClause.name.end); + if (nextToken && nextToken.kind === 25 /* CommaToken */) { + // shift first non-whitespace position after comma to the start position of the node + return deleteRange({ pos: start_4, end: ts.skipTrivia(sourceFile.text, nextToken.end, /*stopAfterLineBreaks*/ false, /*stopAtComments*/ true) }); + } + else { + return deleteNode(importClause.name); + } + } + case 239 /* NamespaceImport */: + var namespaceImport = token.parent; + if (namespaceImport.name === token && !namespaceImport.parent.name) { + var importDecl = ts.getAncestor(namespaceImport, 237 /* ImportDeclaration */); + return deleteNode(importDecl); + } + else { + var previousToken = ts.getTokenAtPosition(sourceFile, namespaceImport.pos - 1); + if (previousToken && previousToken.kind === 25 /* CommaToken */) { + var startPosition = ts.textChanges.getAdjustedStartPosition(sourceFile, previousToken, {}, ts.textChanges.Position.FullStart); + return deleteRange({ pos: startPosition, end: namespaceImport.end }); + } + return deleteRange(namespaceImport); + } + } + break; + case 148 /* PropertyDeclaration */: + case 239 /* NamespaceImport */: + return deleteNode(token.parent); + } + if (ts.isDeclarationName(token)) { + return deleteNode(token.parent); + } + else if (ts.isLiteralComputedPropertyDeclarationName(token)) { + return deleteNode(token.parent.parent); + } + else { + return undefined; + } + function deleteNode(n) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).deleteNode(sourceFile, n)); + } + function deleteRange(range) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).deleteRange(sourceFile, range)); + } + function deleteNodeInList(n) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).deleteNodeInList(sourceFile, n)); + } + function deleteNodeRange(start, end) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).deleteNodeRange(sourceFile, start, end)); + } + function replaceNode(n, newNode) { + return makeChange(ts.textChanges.ChangeTracker.fromCodeFixContext(context).replaceNode(sourceFile, n, newNode)); + } + function makeChange(changeTracker) { + return [{ + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Remove_declaration_for_Colon_0), { 0: token.getText() }), + changes: changeTracker.getChanges() + }]; + } + } + }); + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var codefix; (function (codefix) { @@ -77225,18 +84205,19 @@ var ts; })(ModuleSpecifierComparison || (ModuleSpecifierComparison = {})); var ImportCodeActionMap = (function () { function ImportCodeActionMap() { - this.symbolIdToActionMap = ts.createMap(); + this.symbolIdToActionMap = []; } ImportCodeActionMap.prototype.addAction = function (symbolId, newAction) { if (!newAction) { return; } - if (!this.symbolIdToActionMap[symbolId]) { + var actions = this.symbolIdToActionMap[symbolId]; + if (!actions) { this.symbolIdToActionMap[symbolId] = [newAction]; return; } if (newAction.kind === "CodeChange") { - this.symbolIdToActionMap[symbolId].push(newAction); + actions.push(newAction); return; } var updatedNewImports = []; @@ -77249,12 +84230,13 @@ var ts; } switch (this.compareModuleSpecifiers(existingAction.moduleSpecifier, newAction.moduleSpecifier)) { case ModuleSpecifierComparison.Better: - // the new one is not worth considering if it is a new improt. + // the new one is not worth considering if it is a new import. // However if it is instead a insertion into existing import, the user might want to use // the module specifier even it is worse by our standards. So keep it. if (newAction.kind === "NewImport") { return; } + // falls through case ModuleSpecifierComparison.Equal: // the current one is safe. But it is still possible that the new one is worse // than another existing one. For example, you may have new imports from "./foo/bar" @@ -77280,8 +84262,8 @@ var ts; }; ImportCodeActionMap.prototype.getAllActions = function () { var result = []; - for (var symbolId in this.symbolIdToActionMap) { - result = ts.concatenate(result, this.symbolIdToActionMap[symbolId]); + for (var key in this.symbolIdToActionMap) { + result = ts.concatenate(result, this.symbolIdToActionMap[key]); } return result; }; @@ -77313,7 +84295,11 @@ var ts; return ImportCodeActionMap; }()); codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Cannot_find_name_0.code], + errorCodes: [ + ts.Diagnostics.Cannot_find_name_0.code, + ts.Diagnostics.Cannot_find_namespace_0.code, + ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code + ], getCodeActions: function (context) { var sourceFile = context.sourceFile; var checker = context.program.getTypeChecker(); @@ -77323,18 +84309,22 @@ var ts; var name = token.getText(); var symbolIdActionMap = new ImportCodeActionMap(); // this is a module id -> module import declaration map - var cachedImportDeclarations = ts.createMap(); - var cachedNewImportInsertPosition; - var allPotentialModules = checker.getAmbientModules(); + var cachedImportDeclarations = []; + var lastImportDeclaration; + var currentTokenMeaning = ts.getMeaningFromLocation(token); + if (context.errorCode === ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code) { + var symbol = checker.getAliasedSymbol(checker.getSymbolAtLocation(token)); + return getCodeActionForImport(symbol, /*isDefault*/ false, /*isNamespaceImport*/ true); + } + var candidateModules = checker.getAmbientModules(); for (var _i = 0, allSourceFiles_1 = allSourceFiles; _i < allSourceFiles_1.length; _i++) { var otherSourceFile = allSourceFiles_1[_i]; if (otherSourceFile !== sourceFile && ts.isExternalOrCommonJsModule(otherSourceFile)) { - allPotentialModules.push(otherSourceFile.symbol); + candidateModules.push(otherSourceFile.symbol); } } - var currentTokenMeaning = ts.getMeaningFromLocation(token); - for (var _a = 0, allPotentialModules_1 = allPotentialModules; _a < allPotentialModules_1.length; _a++) { - var moduleSymbol = allPotentialModules_1[_a]; + for (var _a = 0, candidateModules_1 = candidateModules; _a < candidateModules_1.length; _a++) { + var moduleSymbol = candidateModules_1[_a]; context.cancellationToken.throwIfCancellationRequested(); // check the default export var defaultExport = checker.tryGetMemberInModuleExports("default", moduleSymbol); @@ -77356,8 +84346,9 @@ var ts; return symbolIdActionMap.getAllActions(); function getImportDeclarations(moduleSymbol) { var moduleSymbolId = getUniqueSymbolId(moduleSymbol); - if (cachedImportDeclarations[moduleSymbolId]) { - return cachedImportDeclarations[moduleSymbolId]; + var cached = cachedImportDeclarations[moduleSymbolId]; + if (cached) { + return cached; } var existingDeclarations = []; for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { @@ -77372,10 +84363,10 @@ var ts; function getImportDeclaration(moduleSpecifier) { var node = moduleSpecifier; while (node) { - if (node.kind === 235 /* ImportDeclaration */) { + if (node.kind === 237 /* ImportDeclaration */) { return node; } - if (node.kind === 234 /* ImportEqualsDeclaration */) { + if (node.kind === 236 /* ImportEqualsDeclaration */) { return node; } node = node.parent; @@ -77393,7 +84384,7 @@ var ts; var declarations = symbol.getDeclarations(); return declarations ? ts.some(symbol.declarations, function (decl) { return !!(ts.getMeaningFromDeclaration(decl) & meaning); }) : false; } - function getCodeActionForImport(moduleSymbol, isDefault) { + function getCodeActionForImport(moduleSymbol, isDefault, isNamespaceImport) { var existingDeclarations = getImportDeclarations(moduleSymbol); if (existingDeclarations.length > 0) { // With an existing import statement, there are more than one actions the user can do. @@ -77419,11 +84410,11 @@ var ts; var namespaceImportDeclaration; var namedImportDeclaration; var existingModuleSpecifier; - for (var _i = 0, declarations_11 = declarations; _i < declarations_11.length; _i++) { - var declaration = declarations_11[_i]; - if (declaration.kind === 235 /* ImportDeclaration */) { + for (var _i = 0, declarations_14 = declarations; _i < declarations_14.length; _i++) { + var declaration = declarations_14[_i]; + if (declaration.kind === 237 /* ImportDeclaration */) { var namedBindings = declaration.importClause && declaration.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 237 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 239 /* NamespaceImport */) { // case: // import * as ns from "foo" namespaceImportDeclaration = declaration; @@ -77447,15 +84438,15 @@ var ts; if (namespaceImportDeclaration) { actions.push(getCodeActionForNamespaceImport(namespaceImportDeclaration)); } - if (namedImportDeclaration && namedImportDeclaration.importClause && + if (!isNamespaceImport && namedImportDeclaration && namedImportDeclaration.importClause && (namedImportDeclaration.importClause.name || namedImportDeclaration.importClause.namedBindings)) { /** * If the existing import declaration already has a named import list, just * insert the identifier into that list. */ - var textChange = getTextChangeForImportClause(namedImportDeclaration.importClause); + var fileTextChanges = getTextChangeForImportClause(namedImportDeclaration.importClause); var moduleSpecifierWithoutQuotes = ts.stripQuotes(namedImportDeclaration.moduleSpecifier.getText()); - actions.push(createCodeAction(ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, [name, moduleSpecifierWithoutQuotes], textChange.newText, textChange.span, sourceFile.fileName, "InsertingIntoExistingImport", moduleSpecifierWithoutQuotes)); + actions.push(createCodeAction(ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, [name, moduleSpecifierWithoutQuotes], fileTextChanges, "InsertingIntoExistingImport", moduleSpecifierWithoutQuotes)); } else { // we need to create a new import statement, but the existing module specifier can be reused. @@ -77463,55 +84454,35 @@ var ts; } return actions; function getModuleSpecifierFromImportEqualsDeclaration(declaration) { - if (declaration.moduleReference && declaration.moduleReference.kind === 245 /* ExternalModuleReference */) { + if (declaration.moduleReference && declaration.moduleReference.kind === 247 /* ExternalModuleReference */) { return declaration.moduleReference.expression.getText(); } return declaration.moduleReference.getText(); } function getTextChangeForImportClause(importClause) { - var newImportText = isDefault ? "default as " + name : name; var importList = importClause.namedBindings; + var newImportSpecifier = ts.createImportSpecifier(/*propertyName*/ undefined, ts.createIdentifier(name)); // case 1: // original text: import default from "module" // change to: import default, { name } from "module" - if (!importList && importClause.name) { - var start = importClause.name.getEnd(); - return { - newText: ", { " + newImportText + " }", - span: { start: start, length: 0 } - }; - } // case 2: // original text: import {} from "module" // change to: import { name } from "module" - if (importList.elements.length === 0) { - var start = importList.getStart(); - return { - newText: "{ " + newImportText + " }", - span: { start: start, length: importList.getEnd() - start } - }; + if (!importList || importList.elements.length === 0) { + var newImportClause = ts.createImportClause(importClause.name, ts.createNamedImports([newImportSpecifier])); + return createChangeTracker().replaceNode(sourceFile, importClause, newImportClause).getChanges(); } - // case 3: - // original text: import { foo, bar } from "module" - // change to: import { foo, bar, name } from "module" - var insertPoint = importList.elements[importList.elements.length - 1].getEnd(); /** * If the import list has one import per line, preserve that. Otherwise, insert on same line as last element * import { * foo * } from "./module"; */ - var startLine = ts.getLineOfLocalPosition(sourceFile, importList.getStart()); - var endLine = ts.getLineOfLocalPosition(sourceFile, importList.getEnd()); - var oneImportPerLine = endLine - startLine > importList.elements.length; - return { - newText: "," + (oneImportPerLine ? context.newLineCharacter : " ") + newImportText, - span: { start: insertPoint, length: 0 } - }; + return createChangeTracker().insertNodeInListAfter(sourceFile, importList.elements[importList.elements.length - 1], newImportSpecifier).getChanges(); } function getCodeActionForNamespaceImport(declaration) { var namespacePrefix; - if (declaration.kind === 235 /* ImportDeclaration */) { + if (declaration.kind === 237 /* ImportDeclaration */) { namespacePrefix = declaration.importClause.namedBindings.name.getText(); } else { @@ -77528,47 +84499,52 @@ var ts; * namespace instead of altering the import declaration. For example, "foo" would * become "ns.foo" */ - return createCodeAction(ts.Diagnostics.Change_0_to_1, [name, namespacePrefix + "." + name], namespacePrefix + ".", { start: token.getStart(), length: 0 }, sourceFile.fileName, "CodeChange"); + return createCodeAction(ts.Diagnostics.Change_0_to_1, [name, namespacePrefix + "." + name], createChangeTracker().replaceNode(sourceFile, token, ts.createPropertyAccess(ts.createIdentifier(namespacePrefix), name)).getChanges(), "CodeChange"); } } function getCodeActionForNewImport(moduleSpecifier) { - if (!cachedNewImportInsertPosition) { + if (!lastImportDeclaration) { // insert after any existing imports - var lastModuleSpecifierEnd = -1; - for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { - var moduleSpecifier_1 = _a[_i]; - var end = moduleSpecifier_1.getEnd(); - if (!lastModuleSpecifierEnd || end > lastModuleSpecifierEnd) { - lastModuleSpecifierEnd = end; + for (var i = sourceFile.statements.length - 1; i >= 0; i--) { + var statement = sourceFile.statements[i]; + if (statement.kind === 236 /* ImportEqualsDeclaration */ || statement.kind === 237 /* ImportDeclaration */) { + lastImportDeclaration = statement; + break; } } - cachedNewImportInsertPosition = lastModuleSpecifierEnd > 0 ? sourceFile.getLineEndOfPosition(lastModuleSpecifierEnd) : sourceFile.getStart(); } var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); var moduleSpecifierWithoutQuotes = ts.stripQuotes(moduleSpecifier || getModuleSpecifierForNewImport()); - var importStatementText = isDefault - ? "import " + name + " from \"" + moduleSpecifierWithoutQuotes + "\"" - : "import { " + name + " } from \"" + moduleSpecifierWithoutQuotes + "\""; + var changeTracker = createChangeTracker(); + var importClause = isDefault + ? ts.createImportClause(ts.createIdentifier(name), /*namedBindings*/ undefined) + : isNamespaceImport + ? ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(ts.createIdentifier(name))) + : ts.createImportClause(/*name*/ undefined, ts.createNamedImports([ts.createImportSpecifier(/*propertyName*/ undefined, ts.createIdentifier(name))])); + var importDecl = ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, importClause, ts.createLiteral(moduleSpecifierWithoutQuotes)); + if (!lastImportDeclaration) { + changeTracker.insertNodeAt(sourceFile, sourceFile.getStart(), importDecl, { suffix: "" + context.newLineCharacter + context.newLineCharacter }); + } + else { + changeTracker.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl, { suffix: context.newLineCharacter }); + } // if this file doesn't have any import statements, insert an import statement and then insert a new line // between the only import statement and user code. Otherwise just insert the statement because chances // are there are already a new line seperating code and import statements. - var newText = cachedNewImportInsertPosition === sourceFile.getStart() - ? importStatementText + ";" + context.newLineCharacter + context.newLineCharacter - : "" + context.newLineCharacter + importStatementText + ";"; - return createCodeAction(ts.Diagnostics.Import_0_from_1, [name, "\"" + moduleSpecifierWithoutQuotes + "\""], newText, { start: cachedNewImportInsertPosition, length: 0 }, sourceFile.fileName, "NewImport", moduleSpecifierWithoutQuotes); + return createCodeAction(ts.Diagnostics.Import_0_from_1, [name, "\"" + moduleSpecifierWithoutQuotes + "\""], changeTracker.getChanges(), "NewImport", moduleSpecifierWithoutQuotes); function getModuleSpecifierForNewImport() { - var fileName = sourceFile.path; - var moduleFileName = moduleSymbol.valueDeclaration.getSourceFile().path; + var fileName = sourceFile.fileName; + var moduleFileName = moduleSymbol.valueDeclaration.getSourceFile().fileName; var sourceDirectory = ts.getDirectoryPath(fileName); var options = context.program.getCompilerOptions(); return tryGetModuleNameFromAmbientModule() || - tryGetModuleNameFromBaseUrl() || - tryGetModuleNameFromRootDirs() || tryGetModuleNameFromTypeRoots() || tryGetModuleNameAsNodeModule() || + tryGetModuleNameFromBaseUrl() || + tryGetModuleNameFromRootDirs() || ts.removeFileExtension(getRelativePath(moduleFileName, sourceDirectory)); function tryGetModuleNameFromAmbientModule() { - if (moduleSymbol.valueDeclaration.kind !== 261 /* SourceFile */) { + if (moduleSymbol.valueDeclaration.kind !== 264 /* SourceFile */) { return moduleSymbol.name; } } @@ -77576,11 +84552,11 @@ var ts; if (!options.baseUrl) { return undefined; } - var normalizedBaseUrl = ts.toPath(options.baseUrl, ts.getDirectoryPath(options.baseUrl), getCanonicalFileName); - var relativeName = tryRemoveParentDirectoryName(moduleFileName, normalizedBaseUrl); + var relativeName = getRelativePathIfInDirectory(moduleFileName, options.baseUrl); if (!relativeName) { return undefined; } + var relativeNameWithIndex = ts.removeFileExtension(relativeName); relativeName = removeExtensionAndIndexPostFix(relativeName); if (options.paths) { for (var key in options.paths) { @@ -77600,7 +84576,7 @@ var ts; return key.replace("\*", matchedStar); } } - else if (pattern === relativeName) { + else if (pattern === relativeName || pattern === relativeNameWithIndex) { return key; } } @@ -77610,9 +84586,8 @@ var ts; } function tryGetModuleNameFromRootDirs() { if (options.rootDirs) { - var normalizedRootDirs = ts.map(options.rootDirs, function (rootDir) { return ts.toPath(rootDir, /*basePath*/ undefined, getCanonicalFileName); }); - var normalizedTargetPath = getPathRelativeToRootDirs(moduleFileName, normalizedRootDirs); - var normalizedSourcePath = getPathRelativeToRootDirs(sourceDirectory, normalizedRootDirs); + var normalizedTargetPath = getPathRelativeToRootDirs(moduleFileName, options.rootDirs); + var normalizedSourcePath = getPathRelativeToRootDirs(sourceDirectory, options.rootDirs); if (normalizedTargetPath !== undefined) { var relativePath = normalizedSourcePath !== undefined ? getRelativePath(normalizedTargetPath, normalizedSourcePath) : normalizedTargetPath; return ts.removeFileExtension(relativePath); @@ -77676,7 +84651,7 @@ var ts; function getPathRelativeToRootDirs(path, rootDirs) { for (var _i = 0, rootDirs_2 = rootDirs; _i < rootDirs_2.length; _i++) { var rootDir = rootDirs_2[_i]; - var relativeName = tryRemoveParentDirectoryName(path, rootDir); + var relativeName = getRelativePathIfInDirectory(path, rootDir); if (relativeName !== undefined) { return relativeName; } @@ -77690,25 +84665,23 @@ var ts; } return fileName; } - function getRelativePath(path, directoryPath) { - var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, false); - return ts.moduleHasNonRelativeName(relativePath) ? "./" + relativePath : relativePath; + function getRelativePathIfInDirectory(path, directoryPath) { + var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); + return ts.isRootedDiskPath(relativePath) || ts.startsWith(relativePath, "..") ? undefined : relativePath; } - function tryRemoveParentDirectoryName(path, parentDirectory) { - var index = path.indexOf(parentDirectory); - if (index === 0) { - return ts.endsWith(parentDirectory, ts.directorySeparator) - ? path.substring(parentDirectory.length) - : path.substring(parentDirectory.length + 1); - } - return undefined; + function getRelativePath(path, directoryPath) { + var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); + return ts.moduleHasNonRelativeName(relativePath) ? "./" + relativePath : relativePath; } } } - function createCodeAction(description, diagnosticArgs, newText, span, fileName, kind, moduleSpecifier) { + function createChangeTracker() { + return ts.textChanges.ChangeTracker.fromCodeFixContext(context); + } + function createCodeAction(description, diagnosticArgs, changes, kind, moduleSpecifier) { return { description: ts.formatMessage.apply(undefined, [undefined, description].concat(diagnosticArgs)), - changes: [{ fileName: fileName, textChanges: [{ newText: newText, span: span }] }], + changes: changes, kind: kind, moduleSpecifier: moduleSpecifier }; @@ -77723,155 +84696,275 @@ var ts; var codefix; (function (codefix) { codefix.registerCodeFix({ - errorCodes: [ - ts.Diagnostics._0_is_declared_but_never_used.code, - ts.Diagnostics.Property_0_is_declared_but_never_used.code - ], - getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var start = context.span.start; - var token = ts.getTokenAtPosition(sourceFile, start); - // this handles var ["computed"] = 12; - if (token.kind === 20 /* OpenBracketToken */) { - token = ts.getTokenAtPosition(sourceFile, start + 1); + errorCodes: getApplicableDiagnosticCodes(), + getCodeActions: getDisableJsDiagnosticsCodeActions + }); + function getApplicableDiagnosticCodes() { + var allDiagnostcs = ts.Diagnostics; + return Object.keys(allDiagnostcs) + .filter(function (d) { return allDiagnostcs[d] && allDiagnostcs[d].category === ts.DiagnosticCategory.Error; }) + .map(function (d) { return allDiagnostcs[d].code; }); + } + function getIgnoreCommentLocationForLocation(sourceFile, position, newLineCharacter) { + var line = ts.getLineAndCharacterOfPosition(sourceFile, position).line; + var lineStartPosition = ts.getStartPositionOfLine(line, sourceFile); + var startPosition = ts.getFirstNonSpaceCharacterPosition(sourceFile.text, lineStartPosition); + // First try to see if we can put the '// @ts-ignore' on the previous line. + // We need to make sure that we are not in the middle of a string literal or a comment. + // We also want to check if the previous line holds a comment for a node on the next line + // if so, we do not want to separate the node from its comment if we can. + if (!ts.isInComment(sourceFile, startPosition) && !ts.isInString(sourceFile, startPosition) && !ts.isInTemplateString(sourceFile, startPosition)) { + var token = ts.getTouchingToken(sourceFile, startPosition); + var tokenLeadingCommnets = ts.getLeadingCommentRangesOfNode(token, sourceFile); + if (!tokenLeadingCommnets || !tokenLeadingCommnets.length || tokenLeadingCommnets[0].pos >= startPosition) { + return { + span: { start: startPosition, length: 0 }, + newText: "// @ts-ignore" + newLineCharacter + }; } - switch (token.kind) { - case 70 /* Identifier */: - switch (token.parent.kind) { - case 223 /* VariableDeclaration */: - switch (token.parent.parent.parent.kind) { - case 211 /* ForStatement */: - var forStatement = token.parent.parent.parent; - var forInitializer = forStatement.initializer; - if (forInitializer.declarations.length === 1) { - return createCodeFix("", forInitializer.pos, forInitializer.end - forInitializer.pos); - } - else { - return removeSingleItem(forInitializer.declarations, token); - } - case 213 /* ForOfStatement */: - var forOfStatement = token.parent.parent.parent; - if (forOfStatement.initializer.kind === 224 /* VariableDeclarationList */) { - var forOfInitializer = forOfStatement.initializer; - return createCodeFix("{}", forOfInitializer.declarations[0].pos, forOfInitializer.declarations[0].end - forOfInitializer.declarations[0].pos); - } - break; - case 212 /* ForInStatement */: - // There is no valid fix in the case of: - // for .. in - return undefined; - case 256 /* CatchClause */: - var catchClause = token.parent.parent; - var parameter = catchClause.variableDeclaration.getChildren()[0]; - return createCodeFix("", parameter.pos, parameter.end - parameter.pos); - default: - var variableStatement = token.parent.parent.parent; - if (variableStatement.declarationList.declarations.length === 1) { - return createCodeFix("", variableStatement.pos, variableStatement.end - variableStatement.pos); - } - else { - var declarations = variableStatement.declarationList.declarations; - return removeSingleItem(declarations, token); - } - } - case 143 /* TypeParameter */: - var typeParameters = token.parent.parent.typeParameters; - if (typeParameters.length === 1) { - return createCodeFix("", token.parent.pos - 1, token.parent.end - token.parent.pos + 2); - } - else { - return removeSingleItem(typeParameters, token); - } - case 144 /* Parameter */: - var functionDeclaration = token.parent.parent; - if (functionDeclaration.parameters.length === 1) { - return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos); - } - else { - return removeSingleItem(functionDeclaration.parameters, token); - } - // handle case where 'import a = A;' - case 234 /* ImportEqualsDeclaration */: - var importEquals = findImportDeclaration(token); - return createCodeFix("", importEquals.pos, importEquals.end - importEquals.pos); - case 239 /* ImportSpecifier */: - var namedImports = token.parent.parent; - if (namedImports.elements.length === 1) { - // Only 1 import and it is unused. So the entire declaration should be removed. - var importSpec = findImportDeclaration(token); - return createCodeFix("", importSpec.pos, importSpec.end - importSpec.pos); - } - else { - return removeSingleItem(namedImports.elements, token); - } - // handle case where "import d, * as ns from './file'" - // or "'import {a, b as ns} from './file'" - case 236 /* ImportClause */: - var importClause = token.parent; - if (!importClause.namedBindings) { - var importDecl = findImportDeclaration(importClause); - return createCodeFix("", importDecl.pos, importDecl.end - importDecl.pos); - } - else { - return createCodeFix("", importClause.name.pos, importClause.namedBindings.pos - importClause.name.pos); - } - case 237 /* NamespaceImport */: - var namespaceImport = token.parent; - if (namespaceImport.name == token && !namespaceImport.parent.name) { - var importDecl = findImportDeclaration(namespaceImport); - return createCodeFix("", importDecl.pos, importDecl.end - importDecl.pos); - } - else { - var start_4 = namespaceImport.parent.name.end; - return createCodeFix("", start_4, namespaceImport.parent.namedBindings.end - start_4); - } - } - break; - case 147 /* PropertyDeclaration */: - return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos); - case 237 /* NamespaceImport */: - return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos); - } - if (ts.isDeclarationName(token)) { - return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos); - } - else if (ts.isLiteralComputedPropertyDeclarationName(token)) { - return createCodeFix("", token.parent.parent.pos, token.parent.parent.end - token.parent.parent.pos); - } - else { - return undefined; - } - function findImportDeclaration(token) { - var importDecl = token; - while (importDecl.kind != 235 /* ImportDeclaration */ && importDecl.parent) { - importDecl = importDecl.parent; - } - return importDecl; - } - function createCodeFix(newText, start, length) { - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Remove_unused_identifiers), - changes: [{ - fileName: sourceFile.fileName, - textChanges: [{ newText: newText, span: { start: start, length: length } }] + } + // If all fails, add an extra new line immediatlly before the error span. + return { + span: { start: position, length: 0 }, + newText: (position === startPosition ? "" : newLineCharacter) + "// @ts-ignore" + newLineCharacter + }; + } + function getDisableJsDiagnosticsCodeActions(context) { + var sourceFile = context.sourceFile, program = context.program, newLineCharacter = context.newLineCharacter, span = context.span; + if (!ts.isInJavaScriptFile(sourceFile) || !ts.isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) { + return undefined; + } + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Ignore_this_error_message), + changes: [{ + fileName: sourceFile.fileName, + textChanges: [getIgnoreCommentLocationForLocation(sourceFile, span.start, newLineCharacter)] + }] + }, + { + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Disable_checking_for_this_file), + changes: [{ + fileName: sourceFile.fileName, + textChanges: [{ + span: { + start: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.pos : 0, + length: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.end - sourceFile.checkJsDirective.pos : 0 + }, + newText: "// @ts-nocheck" + newLineCharacter }] - }]; - } - function removeSingleItem(elements, token) { - if (elements[0] === token.parent) { - return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos + 1); + }] + }]; + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + function newNodesToChanges(newNodes, insertAfter, context) { + var sourceFile = context.sourceFile; + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + for (var _i = 0, newNodes_1 = newNodes; _i < newNodes_1.length; _i++) { + var newNode = newNodes_1[_i]; + changeTracker.insertNodeAfter(sourceFile, insertAfter, newNode, { suffix: context.newLineCharacter }); + } + var changes = changeTracker.getChanges(); + if (!ts.some(changes)) { + return changes; + } + ts.Debug.assert(changes.length === 1); + var consolidatedChanges = [{ + fileName: changes[0].fileName, + textChanges: [{ + span: changes[0].textChanges[0].span, + newText: changes[0].textChanges.reduce(function (prev, cur) { return prev + cur.newText; }, "") + }] + }]; + return consolidatedChanges; + } + codefix.newNodesToChanges = newNodesToChanges; + /** + * Finds members of the resolved type that are missing in the class pointed to by class decl + * and generates source code for the missing members. + * @param possiblyMissingSymbols The collection of symbols to filter and then get insertions for. + * @returns Empty string iff there are no member insertions. + */ + function createMissingMemberNodes(classDeclaration, possiblyMissingSymbols, checker) { + var classMembers = classDeclaration.symbol.members; + var missingMembers = possiblyMissingSymbols.filter(function (symbol) { return !classMembers.has(symbol.getName()); }); + var newNodes = []; + for (var _i = 0, missingMembers_1 = missingMembers; _i < missingMembers_1.length; _i++) { + var symbol = missingMembers_1[_i]; + var newNode = createNewNodeForMemberSymbol(symbol, classDeclaration, checker); + if (newNode) { + if (Array.isArray(newNode)) { + newNodes = newNodes.concat(newNode); } else { - return createCodeFix("", token.parent.pos - 1, token.parent.end - token.parent.pos + 1); + newNodes.push(newNode); } } } - }); + return newNodes; + } + codefix.createMissingMemberNodes = createMissingMemberNodes; + /** + * @returns Empty string iff there we can't figure out a representation for `symbol` in `enclosingDeclaration`. + */ + function createNewNodeForMemberSymbol(symbol, enclosingDeclaration, checker) { + var declarations = symbol.getDeclarations(); + if (!(declarations && declarations.length)) { + return undefined; + } + var declaration = declarations[0]; + // Clone name to remove leading trivia. + var name = ts.getSynthesizedClone(declaration.name); + var visibilityModifier = createVisibilityModifier(ts.getModifierFlags(declaration)); + var modifiers = visibilityModifier ? ts.createNodeArray([visibilityModifier]) : undefined; + var type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration)); + var optional = !!(symbol.flags & 67108864 /* Optional */); + switch (declaration.kind) { + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 147 /* PropertySignature */: + case 148 /* PropertyDeclaration */: + var typeNode = checker.typeToTypeNode(type, enclosingDeclaration); + var property = ts.createProperty( + /*decorators*/ undefined, modifiers, name, optional ? ts.createToken(54 /* QuestionToken */) : undefined, typeNode, + /*initializer*/ undefined); + return property; + case 149 /* MethodSignature */: + case 150 /* MethodDeclaration */: + // The signature for the implementation appears as an entry in `signatures` iff + // there is only one signature. + // If there are overloads and an implementation signature, it appears as an + // extra declaration that isn't a signature for `type`. + // If there is more than one overload but no implementation signature + // (eg: an abstract method or interface declaration), there is a 1-1 + // correspondence of declarations and signatures. + var signatures = checker.getSignaturesOfType(type, 0 /* Call */); + if (!ts.some(signatures)) { + return undefined; + } + if (declarations.length === 1) { + ts.Debug.assert(signatures.length === 1); + var signature = signatures[0]; + return signatureToMethodDeclaration(signature, enclosingDeclaration, createStubbedMethodBody()); + } + var signatureDeclarations = []; + for (var i = 0; i < signatures.length; i++) { + var signature = signatures[i]; + var methodDeclaration = signatureToMethodDeclaration(signature, enclosingDeclaration); + if (methodDeclaration) { + signatureDeclarations.push(methodDeclaration); + } + } + if (declarations.length > signatures.length) { + var signature = checker.getSignatureFromDeclaration(declarations[declarations.length - 1]); + var methodDeclaration = signatureToMethodDeclaration(signature, enclosingDeclaration, createStubbedMethodBody()); + if (methodDeclaration) { + signatureDeclarations.push(methodDeclaration); + } + } + else { + ts.Debug.assert(declarations.length === signatures.length); + var methodImplementingSignatures = createMethodImplementingSignatures(signatures, name, optional, modifiers); + signatureDeclarations.push(methodImplementingSignatures); + } + return signatureDeclarations; + default: + return undefined; + } + function signatureToMethodDeclaration(signature, enclosingDeclaration, body) { + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 150 /* MethodDeclaration */, enclosingDeclaration); + if (signatureDeclaration) { + signatureDeclaration.decorators = undefined; + signatureDeclaration.modifiers = modifiers; + signatureDeclaration.name = name; + signatureDeclaration.questionToken = optional ? ts.createToken(54 /* QuestionToken */) : undefined; + signatureDeclaration.body = body; + } + return signatureDeclaration; + } + } + function createMethodImplementingSignatures(signatures, name, optional, modifiers) { + /** This is *a* signature with the maximal number of arguments, + * such that if there is a "maximal" signature without rest arguments, + * this is one of them. + */ + var maxArgsSignature = signatures[0]; + var minArgumentCount = signatures[0].minArgumentCount; + var someSigHasRestParameter = false; + for (var i = 0; i < signatures.length; i++) { + var sig = signatures[i]; + minArgumentCount = Math.min(sig.minArgumentCount, minArgumentCount); + if (sig.hasRestParameter) { + someSigHasRestParameter = true; + } + if (sig.parameters.length >= maxArgsSignature.parameters.length && (!sig.hasRestParameter || maxArgsSignature.hasRestParameter)) { + maxArgsSignature = sig; + } + } + var maxNonRestArgs = maxArgsSignature.parameters.length - (maxArgsSignature.hasRestParameter ? 1 : 0); + var maxArgsParameterSymbolNames = maxArgsSignature.parameters.map(function (symbol) { return symbol.getName(); }); + var parameters = []; + for (var i = 0; i < maxNonRestArgs; i++) { + var anyType = ts.createKeywordTypeNode(118 /* AnyKeyword */); + var newParameter = ts.createParameter( + /*decorators*/ undefined, + /*modifiers*/ undefined, + /*dotDotDotToken*/ undefined, maxArgsParameterSymbolNames[i], + /*questionToken*/ i >= minArgumentCount ? ts.createToken(54 /* QuestionToken */) : undefined, anyType, + /*initializer*/ undefined); + parameters.push(newParameter); + } + if (someSigHasRestParameter) { + var anyArrayType = ts.createArrayTypeNode(ts.createKeywordTypeNode(118 /* AnyKeyword */)); + var restParameter = ts.createParameter( + /*decorators*/ undefined, + /*modifiers*/ undefined, ts.createToken(23 /* DotDotDotToken */), maxArgsParameterSymbolNames[maxNonRestArgs] || "rest", + /*questionToken*/ maxNonRestArgs >= minArgumentCount ? ts.createToken(54 /* QuestionToken */) : undefined, anyArrayType, + /*initializer*/ undefined); + parameters.push(restParameter); + } + return createStubbedMethod(modifiers, name, optional, + /*typeParameters*/ undefined, parameters, + /*returnType*/ undefined); + } + function createStubbedMethod(modifiers, name, optional, typeParameters, parameters, returnType) { + return ts.createMethodDeclaration( + /*decorators*/ undefined, modifiers, + /*asteriskToken*/ undefined, name, optional ? ts.createToken(54 /* QuestionToken */) : undefined, typeParameters, parameters, returnType, createStubbedMethodBody()); + } + codefix.createStubbedMethod = createStubbedMethod; + function createStubbedMethodBody() { + return ts.createBlock([ts.createThrow(ts.createNew(ts.createIdentifier("Error"), + /*typeArguments*/ undefined, [ts.createLiteral("Method not implemented.")]))], + /*multiline*/ true); + } + function createVisibilityModifier(flags) { + if (flags & 4 /* Public */) { + return ts.createToken(113 /* PublicKeyword */); + } + else if (flags & 16 /* Protected */) { + return ts.createToken(112 /* ProtectedKeyword */); + } + return undefined; + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); -/// -/// -/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// /// /// /// @@ -77883,7 +84976,6 @@ var ts; /// /// /// -/// /// /// /// @@ -77897,14 +84989,15 @@ var ts; /// /// /// -/// +/// +/// /// var ts; (function (ts) { /** The version of the language service API */ ts.servicesVersion = "0.5"; function createNode(kind, pos, end, parent) { - var node = kind >= 141 /* FirstNode */ ? new NodeObject(kind, pos, end) : + var node = kind >= 142 /* FirstNode */ ? new NodeObject(kind, pos, end) : kind === 70 /* Identifier */ ? new IdentifierObject(70 /* Identifier */, pos, end) : new TokenObject(kind, pos, end); node.parent = parent; @@ -77962,11 +85055,11 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(292 /* SyntaxList */, nodes.pos, nodes.end, this); + var list = createNode(293 /* SyntaxList */, nodes.pos, nodes.end, this); list._children = []; var pos = nodes.pos; - for (var _i = 0, nodes_7 = nodes; _i < nodes_7.length; _i++) { - var node = nodes_7[_i]; + for (var _i = 0, nodes_9 = nodes; _i < nodes_9.length; _i++) { + var node = nodes_9[_i]; if (pos < node.pos) { pos = this.addSyntheticNodes(list._children, pos, node.pos); } @@ -77981,11 +85074,11 @@ var ts; NodeObject.prototype.createChildren = function (sourceFile) { var _this = this; var children; - if (this.kind >= 141 /* FirstNode */) { + if (this.kind >= 142 /* FirstNode */) { ts.scanner.setText((sourceFile || this.getSourceFile()).text); children = []; var pos_3 = this.pos; - var useJSDocScanner_1 = this.kind >= 278 /* FirstJSDocTagNode */ && this.kind <= 291 /* LastJSDocTagNode */; + var useJSDocScanner_1 = this.kind >= 282 /* FirstJSDocTagNode */ && this.kind <= 292 /* LastJSDocTagNode */; var processNode = function (node) { var isJSDocTagNode = ts.isJSDocTag(node); if (!isJSDocTagNode && pos_3 < node.pos) { @@ -78042,8 +85135,10 @@ var ts; if (!children.length) { return undefined; } - var child = children[0]; - return child.kind < 141 /* FirstNode */ ? child : child.getFirstToken(sourceFile); + var child = ts.find(children, function (kid) { return kid.kind < 266 /* FirstJSDocNode */ || kid.kind > 292 /* LastJSDocNode */; }); + return child.kind < 142 /* FirstNode */ ? + child : + child.getFirstToken(sourceFile); }; NodeObject.prototype.getLastToken = function (sourceFile) { var children = this.getChildren(sourceFile); @@ -78051,7 +85146,10 @@ var ts; if (!child) { return undefined; } - return child.kind < 141 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 142 /* FirstNode */ ? child : child.getLastToken(sourceFile); + }; + NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { + return ts.forEachChild(this, cbNode, cbNodeArray); }; return NodeObject; }()); @@ -78105,6 +85203,9 @@ var ts; TokenOrIdentifierObject.prototype.getLastToken = function () { return undefined; }; + TokenOrIdentifierObject.prototype.forEachChild = function () { + return undefined; + }; return TokenOrIdentifierObject; }()); var SymbolObject = (function () { @@ -78127,6 +85228,12 @@ var ts; } return this.documentationComment; }; + SymbolObject.prototype.getJsDocTags = function () { + if (this.tags === undefined) { + this.tags = ts.JsDoc.getJsDocTagsFromDeclarations(this.declarations); + } + return this.tags; + }; return SymbolObject; }()); var TokenObject = (function (_super) { @@ -78210,6 +85317,12 @@ var ts; } return this.documentationComment; }; + SignatureObject.prototype.getJsDocTags = function () { + if (this.jsDocTags === undefined) { + this.jsDocTags = this.declaration ? ts.JsDoc.getJsDocTagsFromDeclarations([this.declaration]) : []; + } + return this.jsDocTags; + }; return SignatureObject; }()); var SourceFileObject = (function (_super) { @@ -78250,17 +85363,21 @@ var ts; return this.namedDeclarations; }; SourceFileObject.prototype.computeNamedDeclarations = function () { - var result = ts.createMap(); + var result = ts.createMultiMap(); ts.forEachChild(this, visit); return result; function addDeclaration(declaration) { var name = getDeclarationName(declaration); if (name) { - ts.multiMapAdd(result, name, declaration); + result.add(name, declaration); } } function getDeclarations(name) { - return result[name] || (result[name] = []); + var declarations = result.get(name); + if (!declarations) { + result.set(name, declarations = []); + } + return declarations; } function getDeclarationName(declaration) { if (declaration.name) { @@ -78268,9 +85385,9 @@ var ts; if (result_7 !== undefined) { return result_7; } - if (declaration.name.kind === 142 /* ComputedPropertyName */) { + if (declaration.name.kind === 143 /* ComputedPropertyName */) { var expr = declaration.name.expression; - if (expr.kind === 177 /* PropertyAccessExpression */) { + if (expr.kind === 178 /* PropertyAccessExpression */) { return expr.name.text; } return getTextOfIdentifierOrLiteral(expr); @@ -78290,10 +85407,10 @@ var ts; } function visit(node) { switch (node.kind) { - case 225 /* FunctionDeclaration */: - case 184 /* FunctionExpression */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: + case 227 /* FunctionDeclaration */: + case 185 /* FunctionExpression */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -78310,35 +85427,35 @@ var ts; else { declarations.push(functionDeclaration); } - ts.forEachChild(node, visit); } + ts.forEachChild(node, visit); break; - case 226 /* ClassDeclaration */: - case 197 /* ClassExpression */: - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: - case 229 /* EnumDeclaration */: - case 230 /* ModuleDeclaration */: - case 234 /* ImportEqualsDeclaration */: - case 243 /* ExportSpecifier */: - case 239 /* ImportSpecifier */: - case 234 /* ImportEqualsDeclaration */: - case 236 /* ImportClause */: - case 237 /* NamespaceImport */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 161 /* TypeLiteral */: + case 228 /* ClassDeclaration */: + case 198 /* ClassExpression */: + case 229 /* InterfaceDeclaration */: + case 230 /* TypeAliasDeclaration */: + case 231 /* EnumDeclaration */: + case 232 /* ModuleDeclaration */: + case 236 /* ImportEqualsDeclaration */: + case 245 /* ExportSpecifier */: + case 241 /* ImportSpecifier */: + case 236 /* ImportEqualsDeclaration */: + case 238 /* ImportClause */: + case 239 /* NamespaceImport */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 162 /* TypeLiteral */: addDeclaration(node); ts.forEachChild(node, visit); break; - case 144 /* Parameter */: + case 145 /* Parameter */: // Only consider parameter properties if (!ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { break; } - // fall through - case 223 /* VariableDeclaration */: - case 174 /* BindingElement */: { + // falls through + case 225 /* VariableDeclaration */: + case 175 /* BindingElement */: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -78347,19 +85464,20 @@ var ts; if (decl.initializer) visit(decl.initializer); } - case 260 /* EnumMember */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + // falls through + case 263 /* EnumMember */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: addDeclaration(node); break; - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 235 /* ImportDeclaration */: + case 237 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -78371,7 +85489,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 237 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 239 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -78620,6 +85738,36 @@ var ts; }; return CancellationTokenObject; }()); + /* @internal */ + /** A cancellation that throttles calls to the host */ + var ThrottledCancellationToken = (function () { + function ThrottledCancellationToken(hostCancellationToken, throttleWaitMilliseconds) { + if (throttleWaitMilliseconds === void 0) { throttleWaitMilliseconds = 20; } + this.hostCancellationToken = hostCancellationToken; + this.throttleWaitMilliseconds = throttleWaitMilliseconds; + // Store when we last tried to cancel. Checking cancellation can be expensive (as we have + // to marshall over to the host layer). So we only bother actually checking once enough + // time has passed. + this.lastCancellationCheckTime = 0; + } + ThrottledCancellationToken.prototype.isCancellationRequested = function () { + var time = ts.timestamp(); + var duration = Math.abs(time - this.lastCancellationCheckTime); + if (duration >= this.throttleWaitMilliseconds) { + // Check no more than once every throttle wait milliseconds + this.lastCancellationCheckTime = time; + return this.hostCancellationToken.isCancellationRequested(); + } + return false; + }; + ThrottledCancellationToken.prototype.throwIfCancellationRequested = function () { + if (this.isCancellationRequested()) { + throw new ts.OperationCanceledException(); + } + }; + return ThrottledCancellationToken; + }()); + ts.ThrottledCancellationToken = ThrottledCancellationToken; function createLanguageService(host, documentRegistry) { if (documentRegistry === void 0) { documentRegistry = ts.createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory()); } var syntaxTreeCache = new SyntaxTreeCache(host); @@ -78801,6 +85949,7 @@ var ts; ts.Debug.assert(hostFileInformation.scriptKind === oldSourceFile.scriptKind, "Registered script kind (" + oldSourceFile.scriptKind + ") should match new script kind (" + hostFileInformation.scriptKind + ") for file: " + path); return documentRegistry.updateDocumentWithKey(fileName, path, newSettings, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind); } + // We didn't already have the file. Fall through and acquire it from the registry. } // Could not find this file in the old program, create a new SourceFile for it. return documentRegistry.acquireDocumentWithKey(fileName, path, newSettings, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind); @@ -78901,10 +86050,10 @@ var ts; // Try getting just type at this position and show switch (node.kind) { case 70 /* Identifier */: - case 177 /* PropertyAccessExpression */: - case 141 /* QualifiedName */: + case 178 /* PropertyAccessExpression */: + case 142 /* QualifiedName */: case 98 /* ThisKeyword */: - case 167 /* ThisType */: + case 168 /* ThisType */: case 96 /* SuperKeyword */: // For the identifiers/this/super etc get the type at position var type = typeChecker.getTypeAtLocation(node); @@ -78914,7 +86063,8 @@ var ts; kindModifiers: ts.ScriptElementKindModifier.none, textSpan: ts.createTextSpan(node.getStart(), node.getWidth()), displayParts: ts.typeToDisplayParts(typeChecker, type, ts.getContainerNode(node)), - documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined + documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined, + tags: type.symbol ? type.symbol.getJsDocTags() : undefined }; } } @@ -78926,7 +86076,8 @@ var ts; kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), textSpan: ts.createTextSpan(node.getStart(), node.getWidth()), displayParts: displayPartsDocumentationsAndKind.displayParts, - documentation: displayPartsDocumentationsAndKind.documentation + documentation: displayPartsDocumentationsAndKind.documentation, + tags: displayPartsDocumentationsAndKind.tags }; } /// Goto definition @@ -78934,22 +86085,23 @@ var ts; synchronizeHostData(); return ts.GoToDefinition.getDefinitionAtPosition(program, getValidSourceFile(fileName), position); } - /// Goto implementation - function getImplementationAtPosition(fileName, position) { - synchronizeHostData(); - return ts.GoToImplementation.getImplementationAtPosition(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), ts.getTouchingPropertyName(getValidSourceFile(fileName), position)); - } function getTypeDefinitionAtPosition(fileName, position) { synchronizeHostData(); return ts.GoToDefinition.getTypeDefinitionAtPosition(program.getTypeChecker(), getValidSourceFile(fileName), position); } + /// Goto implementation + function getImplementationAtPosition(fileName, position) { + synchronizeHostData(); + return ts.FindAllReferences.getImplementationsAtPosition(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position); + } + /// References and Occurrences function getOccurrencesAtPosition(fileName, position) { var results = getOccurrencesAtPositionCore(fileName, position); if (results) { - var sourceFile_2 = getCanonicalFileName(ts.normalizeSlashes(fileName)); + var sourceFile_1 = getCanonicalFileName(ts.normalizeSlashes(fileName)); // Get occurrences only supports reporting occurrences for the file queried. So // filter down to that list. - results = ts.filter(results, function (r) { return getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile_2; }); + results = ts.filter(results, function (r) { return getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile_1; }); } return results; } @@ -78959,9 +86111,7 @@ var ts; var sourceFile = getValidSourceFile(fileName); return ts.DocumentHighlights.getDocumentHighlights(program.getTypeChecker(), cancellationToken, sourceFile, position, sourceFilesToSearch); } - /// References and Occurrences function getOccurrencesAtPositionCore(fileName, position) { - synchronizeHostData(); return convertDocumentHighlights(getDocumentHighlights(fileName, position, [fileName])); function convertDocumentHighlights(documentHighlights) { if (!documentHighlights) { @@ -78976,7 +86126,8 @@ var ts; fileName: entry.fileName, textSpan: highlightSpan.textSpan, isWriteAccess: highlightSpan.kind === ts.HighlightSpanKind.writtenReference, - isDefinition: false + isDefinition: false, + isInString: highlightSpan.isInString, }); } } @@ -78984,21 +86135,18 @@ var ts; } } function findRenameLocations(fileName, position, findInStrings, findInComments) { - var referencedSymbols = findReferencedSymbols(fileName, position, findInStrings, findInComments); - return ts.FindAllReferences.convertReferences(referencedSymbols); + return getReferences(fileName, position, { findInStrings: findInStrings, findInComments: findInComments, isForRename: true }); } function getReferencesAtPosition(fileName, position) { - var referencedSymbols = findReferencedSymbols(fileName, position, /*findInStrings*/ false, /*findInComments*/ false); - return ts.FindAllReferences.convertReferences(referencedSymbols); + return getReferences(fileName, position); + } + function getReferences(fileName, position, options) { + synchronizeHostData(); + return ts.FindAllReferences.findReferencedEntries(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position, options); } function findReferences(fileName, position) { - var referencedSymbols = findReferencedSymbols(fileName, position, /*findInStrings*/ false, /*findInComments*/ false); - // Only include referenced symbols that have a valid definition. - return ts.filter(referencedSymbols, function (rs) { return !!rs.definition; }); - } - function findReferencedSymbols(fileName, position, findInStrings, findInComments) { synchronizeHostData(); - return ts.FindAllReferences.findReferencedSymbols(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position, findInStrings, findInComments); + return ts.FindAllReferences.findReferencedSymbols(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position); } /// NavigateTo function getNavigateToItems(searchValue, maxResultCount, fileName, excludeDtsFiles) { @@ -79017,7 +86165,8 @@ var ts; text: data }); } - var emitOutput = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles); + var customTransformers = host.getCustomTransformers && host.getCustomTransformers(); + var emitOutput = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); return { outputFiles: outputFiles, emitSkipped: emitOutput.emitSkipped @@ -79047,15 +86196,15 @@ var ts; return; } switch (node.kind) { - case 177 /* PropertyAccessExpression */: - case 141 /* QualifiedName */: + case 178 /* PropertyAccessExpression */: + case 142 /* QualifiedName */: case 9 /* StringLiteral */: case 85 /* FalseKeyword */: case 100 /* TrueKeyword */: case 94 /* NullKeyword */: case 96 /* SuperKeyword */: case 98 /* ThisKeyword */: - case 167 /* ThisType */: + case 168 /* ThisType */: case 70 /* Identifier */: break; // Cant create the text span @@ -79072,7 +86221,7 @@ var ts; // If this is name of a module declarations, check if this is right side of dotted module name // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 230 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 232 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -79095,10 +86244,10 @@ var ts; return ts.BreakpointResolver.spanInSourceFileAtLocation(sourceFile, position); } function getNavigationBarItems(fileName) { - return ts.NavigationBar.getNavigationBarItems(syntaxTreeCache.getCurrentSourceFile(fileName)); + return ts.NavigationBar.getNavigationBarItems(syntaxTreeCache.getCurrentSourceFile(fileName), cancellationToken); } function getNavigationTree(fileName) { - return ts.NavigationBar.getNavigationTree(syntaxTreeCache.getCurrentSourceFile(fileName)); + return ts.NavigationBar.getNavigationTree(syntaxTreeCache.getCurrentSourceFile(fileName), cancellationToken); } function isTsOrTsxFile(fileName) { var kind = ts.getScriptKind(fileName, host); @@ -79131,7 +86280,7 @@ var ts; function getOutliningSpans(fileName) { // doesn't use compiler - no need to synchronize with host var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - return ts.OutliningElementsCollector.collectElements(sourceFile); + return ts.OutliningElementsCollector.collectElements(sourceFile, cancellationToken); } function getBraceMatchingAtPosition(fileName, position) { var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); @@ -79209,13 +86358,13 @@ var ts; } return []; } - function getCodeFixesAtPosition(fileName, start, end, errorCodes) { + function getCodeFixesAtPosition(fileName, start, end, errorCodes, formatOptions) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); var span = { start: start, length: end - start }; var newLineChar = ts.getNewLineOrDefaultFromHost(host); var allFixes = []; - ts.forEach(errorCodes, function (error) { + ts.forEach(ts.deduplicate(errorCodes), function (error) { cancellationToken.throwIfCancellationRequested(); var context = { errorCode: error, @@ -79224,7 +86373,8 @@ var ts; program: program, newLineCharacter: newLineChar, host: host, - cancellationToken: cancellationToken + cancellationToken: cancellationToken, + rulesProvider: getRuleProvider(formatOptions) }; var fixes = ts.codefix.getFixes(context); if (fixes) { @@ -79248,7 +86398,7 @@ var ts; } var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); // Check if in a context where we don't want to perform any insertion - if (ts.isInString(sourceFile, position) || ts.isInComment(sourceFile, position)) { + if (ts.isInString(sourceFile, position)) { return false; } if (ts.isInsideJsxElementOrAttribute(sourceFile, position)) { @@ -79304,7 +86454,7 @@ var ts; continue; } var descriptor = undefined; - for (var i = 0, n = descriptors.length; i < n; i++) { + for (var i = 0; i < descriptors.length; i++) { if (matchArray[i + firstDescriptorCaptureIndex]) { descriptor = descriptors[i]; } @@ -79435,6 +86585,7 @@ var ts; } ts.createLanguageService = createLanguageService; /* @internal */ + /** Names in the name table are escaped, so an identifier `__foo` will have a name table entry `___foo`. */ function getNameTable(sourceFile) { if (!sourceFile.nameTable) { initializeNameTable(sourceFile); @@ -79449,7 +86600,7 @@ var ts; function walk(node) { switch (node.kind) { case 70 /* Identifier */: - nameTable[node.text] = nameTable[node.text] === undefined ? node.pos : -1; + setNameTable(node.text, node); break; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: @@ -79458,10 +86609,10 @@ var ts; // then we want 'something' to be in the name table. Similarly, if we have // "a['propname']" then we want to store "propname" in the name table. if (ts.isDeclarationName(node) || - node.parent.kind === 245 /* ExternalModuleReference */ || + node.parent.kind === 247 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node)) { - nameTable[node.text] = nameTable[node.text] === undefined ? node.pos : -1; + setNameTable(node.text, node); } break; default: @@ -79474,18 +86625,79 @@ var ts; } } } + function setNameTable(text, node) { + nameTable.set(text, nameTable.get(text) === undefined ? node.pos : -1); + } } + function isObjectLiteralElement(node) { + switch (node.kind) { + case 252 /* JsxAttribute */: + case 254 /* JsxSpreadAttribute */: + case 260 /* PropertyAssignment */: + case 261 /* ShorthandPropertyAssignment */: + case 150 /* MethodDeclaration */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + return true; + } + return false; + } + /** + * Returns the containing object literal property declaration given a possible name node, e.g. "a" in x = { "a": 1 } + */ + /* @internal */ + function getContainingObjectLiteralElement(node) { + switch (node.kind) { + case 9 /* StringLiteral */: + case 8 /* NumericLiteral */: + if (node.parent.kind === 143 /* ComputedPropertyName */) { + return isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; + } + // falls through + case 70 /* Identifier */: + return isObjectLiteralElement(node.parent) && + (node.parent.parent.kind === 177 /* ObjectLiteralExpression */ || node.parent.parent.kind === 253 /* JsxAttributes */) && + node.parent.name === node ? node.parent : undefined; + } + return undefined; + } + ts.getContainingObjectLiteralElement = getContainingObjectLiteralElement; + /* @internal */ + function getPropertySymbolsFromContextualType(typeChecker, node) { + var objectLiteral = node.parent; + var contextualType = typeChecker.getContextualType(objectLiteral); + var name = ts.getTextOfPropertyName(node.name); + if (name && contextualType) { + var result_8 = []; + var symbol = contextualType.getProperty(name); + if (contextualType.flags & 65536 /* Union */) { + ts.forEach(contextualType.types, function (t) { + var symbol = t.getProperty(name); + if (symbol) { + result_8.push(symbol); + } + }); + return result_8; + } + if (symbol) { + result_8.push(symbol); + return result_8; + } + } + return undefined; + } + ts.getPropertySymbolsFromContextualType = getPropertySymbolsFromContextualType; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 178 /* ElementAccessExpression */ && + node.parent.kind === 179 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /** - * Get the path of the default library files (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ + * Get the path of the default library files (lib.d.ts) as distributed with the typescript + * node package. + * The functionality is not supported if the ts module is consumed outside of a node module. + */ function getDefaultLibFilePath(options) { // Check __dirname is defined and that we are on a node.js system. if (typeof __dirname !== "undefined") { @@ -79494,10 +86706,7 @@ var ts; throw new Error("getDefaultLibFilePath is only supported when consumed as a node module. "); } ts.getDefaultLibFilePath = getDefaultLibFilePath; - function initializeServices() { - ts.objectAllocator = getServicesObjectAllocator(); - } - initializeServices(); + ts.objectAllocator = getServicesObjectAllocator(); })(ts || (ts = {})); // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. @@ -79562,113 +86771,114 @@ var ts; function spanInNode(node) { if (node) { switch (node.kind) { - case 205 /* VariableStatement */: + case 207 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 223 /* VariableDeclaration */: - case 147 /* PropertyDeclaration */: - case 146 /* PropertySignature */: + case 225 /* VariableDeclaration */: + case 148 /* PropertyDeclaration */: + case 147 /* PropertySignature */: return spanInVariableDeclaration(node); - case 144 /* Parameter */: + case 145 /* Parameter */: return spanInParameterDeclaration(node); - case 225 /* FunctionDeclaration */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 150 /* Constructor */: - case 184 /* FunctionExpression */: - case 185 /* ArrowFunction */: + case 227 /* FunctionDeclaration */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 151 /* Constructor */: + case 185 /* FunctionExpression */: + case 186 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 204 /* Block */: + case 206 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } - // Fall through - case 231 /* ModuleBlock */: + // falls through + case 233 /* ModuleBlock */: return spanInBlock(node); - case 256 /* CatchClause */: + case 259 /* CatchClause */: return spanInBlock(node.block); - case 207 /* ExpressionStatement */: + case 209 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 216 /* ReturnStatement */: + case 218 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 210 /* WhileStatement */: + case 212 /* WhileStatement */: // Span on while(...) return textSpanEndingAtNextToken(node, node.expression); - case 209 /* DoStatement */: + case 211 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 222 /* DebuggerStatement */: + case 224 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 208 /* IfStatement */: + case 210 /* IfStatement */: // set on if(..) span return textSpanEndingAtNextToken(node, node.expression); - case 219 /* LabeledStatement */: + case 221 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 215 /* BreakStatement */: - case 214 /* ContinueStatement */: + case 217 /* BreakStatement */: + case 216 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 211 /* ForStatement */: + case 213 /* ForStatement */: return spanInForStatement(node); - case 212 /* ForInStatement */: + case 214 /* ForInStatement */: // span of for (a in ...) return textSpanEndingAtNextToken(node, node.expression); - case 213 /* ForOfStatement */: + case 215 /* ForOfStatement */: // span in initializer return spanInInitializerOfForLike(node); - case 218 /* SwitchStatement */: + case 220 /* SwitchStatement */: // span on switch(...) return textSpanEndingAtNextToken(node, node.expression); - case 253 /* CaseClause */: - case 254 /* DefaultClause */: + case 256 /* CaseClause */: + case 257 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 221 /* TryStatement */: + case 223 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 220 /* ThrowStatement */: + case 222 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 240 /* ExportAssignment */: + case 242 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 234 /* ImportEqualsDeclaration */: + case 236 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 235 /* ImportDeclaration */: + case 237 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 241 /* ExportDeclaration */: + case 243 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } - case 226 /* ClassDeclaration */: - case 229 /* EnumDeclaration */: - case 260 /* EnumMember */: - case 174 /* BindingElement */: + // falls through + case 228 /* ClassDeclaration */: + case 231 /* EnumDeclaration */: + case 263 /* EnumMember */: + case 175 /* BindingElement */: // span on complete node return textSpan(node); - case 217 /* WithStatement */: + case 219 /* WithStatement */: // span in statement return spanInNode(node.statement); - case 145 /* Decorator */: + case 146 /* Decorator */: return spanInNodeArray(node.parent.decorators); - case 172 /* ObjectBindingPattern */: - case 173 /* ArrayBindingPattern */: + case 173 /* ObjectBindingPattern */: + case 174 /* ArrayBindingPattern */: return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 227 /* InterfaceDeclaration */: - case 228 /* TypeAliasDeclaration */: + case 229 /* InterfaceDeclaration */: + case 230 /* TypeAliasDeclaration */: return undefined; // Tokens: case 24 /* SemicolonToken */: @@ -79698,7 +86908,7 @@ var ts; case 73 /* CatchKeyword */: case 86 /* FinallyKeyword */: return spanInNextNode(node); - case 140 /* OfKeyword */: + case 141 /* OfKeyword */: return spanInOfKeyword(node); default: // Destructuring pattern in destructuring assignment @@ -79711,13 +86921,13 @@ var ts; // a or ...c or d: x from // [a, b, ...c] or { a, b } or { d: x } from destructuring pattern if ((node.kind === 70 /* Identifier */ || - node.kind == 196 /* SpreadElement */ || - node.kind === 257 /* PropertyAssignment */ || - node.kind === 258 /* ShorthandPropertyAssignment */) && + node.kind === 197 /* SpreadElement */ || + node.kind === 260 /* PropertyAssignment */ || + node.kind === 261 /* ShorthandPropertyAssignment */) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { return textSpan(node); } - if (node.kind === 192 /* BinaryExpression */) { + if (node.kind === 193 /* BinaryExpression */) { var binaryExpression = node; // Set breakpoint in destructuring pattern if its destructuring assignment // [a, b, c] or {a, b, c} of @@ -79740,22 +86950,22 @@ var ts; } if (ts.isPartOfExpression(node)) { switch (node.parent.kind) { - case 209 /* DoStatement */: + case 211 /* DoStatement */: // Set span as if on while keyword return spanInPreviousNode(node); - case 145 /* Decorator */: + case 146 /* Decorator */: // Set breakpoint on the decorator emit return spanInNode(node.parent); - case 211 /* ForStatement */: - case 213 /* ForOfStatement */: + case 213 /* ForStatement */: + case 215 /* ForOfStatement */: return textSpan(node); - case 192 /* BinaryExpression */: + case 193 /* BinaryExpression */: if (node.parent.operatorToken.kind === 25 /* CommaToken */) { // If this is a comma expression, the breakpoint is possible in this expression return textSpan(node); } break; - case 185 /* ArrowFunction */: + case 186 /* ArrowFunction */: if (node.parent.body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); @@ -79764,13 +86974,13 @@ var ts; } } // If this is name of property assignment, set breakpoint in the initializer - if (node.parent.kind === 257 /* PropertyAssignment */ && + if (node.parent.kind === 260 /* PropertyAssignment */ && node.parent.name === node && !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } // Breakpoint in type assertion goes to its operand - if (node.parent.kind === 182 /* TypeAssertionExpression */ && node.parent.type === node) { + if (node.parent.kind === 183 /* TypeAssertionExpression */ && node.parent.type === node) { return spanInNextNode(node.parent.type); } // return type of function go to previous token @@ -79778,8 +86988,8 @@ var ts; return spanInPreviousNode(node); } // initializer of variable/parameter declaration go to previous node - if ((node.parent.kind === 223 /* VariableDeclaration */ || - node.parent.kind === 144 /* Parameter */)) { + if ((node.parent.kind === 225 /* VariableDeclaration */ || + node.parent.kind === 145 /* Parameter */)) { var paramOrVarDecl = node.parent; if (paramOrVarDecl.initializer === node || paramOrVarDecl.type === node || @@ -79787,7 +86997,7 @@ var ts; return spanInPreviousNode(node); } } - if (node.parent.kind === 192 /* BinaryExpression */) { + if (node.parent.kind === 193 /* BinaryExpression */) { var binaryExpression = node.parent; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left) && (binaryExpression.right === node || @@ -79801,8 +87011,8 @@ var ts; } } function textSpanFromVariableDeclaration(variableDeclaration) { - var declarations = variableDeclaration.parent.declarations; - if (declarations && declarations[0] === variableDeclaration) { + if (variableDeclaration.parent.kind === 226 /* VariableDeclarationList */ && + variableDeclaration.parent.declarations[0] === variableDeclaration) { // First declaration - include let keyword return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); } @@ -79813,7 +87023,7 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 212 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 214 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } // If this is a destructuring pattern, set breakpoint in binding pattern @@ -79824,11 +87034,11 @@ var ts; // or its declaration from 'for of' if (variableDeclaration.initializer || ts.hasModifier(variableDeclaration, 1 /* Export */) || - variableDeclaration.parent.parent.kind === 213 /* ForOfStatement */) { + variableDeclaration.parent.parent.kind === 215 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } - var declarations = variableDeclaration.parent.declarations; - if (declarations && declarations[0] !== variableDeclaration) { + if (variableDeclaration.parent.kind === 226 /* VariableDeclarationList */ && + variableDeclaration.parent.declarations[0] !== variableDeclaration) { // If we cannot set breakpoint on this declaration, set it on previous one // Because the variable declaration may be binding pattern and // we would like to set breakpoint in last binding element if that's the case, @@ -79864,7 +87074,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasModifier(functionDeclaration, 1 /* Export */) || - (functionDeclaration.parent.kind === 226 /* ClassDeclaration */ && functionDeclaration.kind !== 150 /* Constructor */); + (functionDeclaration.parent.kind === 228 /* ClassDeclaration */ && functionDeclaration.kind !== 151 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -79887,25 +87097,26 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 230 /* ModuleDeclaration */: + case 232 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } + // falls through // Set on parent if on same line otherwise on first statement - case 210 /* WhileStatement */: - case 208 /* IfStatement */: - case 212 /* ForInStatement */: + case 212 /* WhileStatement */: + case 210 /* IfStatement */: + case 214 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 211 /* ForStatement */: - case 213 /* ForOfStatement */: + case 213 /* ForStatement */: + case 215 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 224 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 226 /* VariableDeclarationList */) { // Declaration list - set breakpoint in first declaration var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -79930,23 +87141,23 @@ var ts; } function spanInBindingPattern(bindingPattern) { // Set breakpoint in first binding element - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 198 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 199 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } // Empty binding pattern of binding element, set breakpoint on binding element - if (bindingPattern.parent.kind === 174 /* BindingElement */) { + if (bindingPattern.parent.kind === 175 /* BindingElement */) { return textSpan(bindingPattern.parent); } // Variable declaration is used as the span return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 173 /* ArrayBindingPattern */ && node.kind !== 172 /* ObjectBindingPattern */); - var elements = node.kind === 175 /* ArrayLiteralExpression */ ? + ts.Debug.assert(node.kind !== 174 /* ArrayBindingPattern */ && node.kind !== 173 /* ObjectBindingPattern */); + var elements = node.kind === 176 /* ArrayLiteralExpression */ ? node.elements : node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 198 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 199 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } @@ -79954,18 +87165,18 @@ var ts; // just nested element in another destructuring assignment // set breakpoint on assignment when parent is destructuring assignment // Otherwise set breakpoint for this element - return textSpan(node.parent.kind === 192 /* BinaryExpression */ ? node.parent : node); + return textSpan(node.parent.kind === 193 /* BinaryExpression */ ? node.parent : node); } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 229 /* EnumDeclaration */: + case 231 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 226 /* ClassDeclaration */: + case 228 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 232 /* CaseBlock */: + case 234 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -79973,24 +87184,25 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 231 /* ModuleBlock */: + case 233 /* ModuleBlock */: // If this is not an instantiated module block, no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } - case 229 /* EnumDeclaration */: - case 226 /* ClassDeclaration */: + // falls through + case 231 /* EnumDeclaration */: + case 228 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 204 /* Block */: + case 206 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } - // fall through - case 256 /* CatchClause */: + // falls through + case 259 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 232 /* CaseBlock */: + case 234 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -79998,7 +87210,7 @@ var ts; return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 172 /* ObjectBindingPattern */: + case 173 /* ObjectBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -80014,7 +87226,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 173 /* ArrayBindingPattern */: + case 174 /* ArrayBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -80029,12 +87241,12 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 209 /* DoStatement */ || - node.parent.kind === 179 /* CallExpression */ || - node.parent.kind === 180 /* NewExpression */) { + if (node.parent.kind === 211 /* DoStatement */ || + node.parent.kind === 180 /* CallExpression */ || + node.parent.kind === 181 /* NewExpression */) { return spanInPreviousNode(node); } - if (node.parent.kind === 183 /* ParenthesizedExpression */) { + if (node.parent.kind === 184 /* ParenthesizedExpression */) { return spanInNextNode(node); } // Default to parent node @@ -80043,21 +87255,21 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 184 /* FunctionExpression */: - case 225 /* FunctionDeclaration */: - case 185 /* ArrowFunction */: - case 149 /* MethodDeclaration */: - case 148 /* MethodSignature */: - case 151 /* GetAccessor */: - case 152 /* SetAccessor */: - case 150 /* Constructor */: - case 210 /* WhileStatement */: - case 209 /* DoStatement */: - case 211 /* ForStatement */: - case 213 /* ForOfStatement */: - case 179 /* CallExpression */: - case 180 /* NewExpression */: - case 183 /* ParenthesizedExpression */: + case 185 /* FunctionExpression */: + case 227 /* FunctionDeclaration */: + case 186 /* ArrowFunction */: + case 150 /* MethodDeclaration */: + case 149 /* MethodSignature */: + case 152 /* GetAccessor */: + case 153 /* SetAccessor */: + case 151 /* Constructor */: + case 212 /* WhileStatement */: + case 211 /* DoStatement */: + case 213 /* ForStatement */: + case 215 /* ForOfStatement */: + case 180 /* CallExpression */: + case 181 /* NewExpression */: + case 184 /* ParenthesizedExpression */: return spanInPreviousNode(node); // Default to parent node default: @@ -80067,20 +87279,20 @@ var ts; function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration if (ts.isFunctionLike(node.parent) || - node.parent.kind === 257 /* PropertyAssignment */ || - node.parent.kind === 144 /* Parameter */) { + node.parent.kind === 260 /* PropertyAssignment */ || + node.parent.kind === 145 /* Parameter */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 182 /* TypeAssertionExpression */) { + if (node.parent.kind === 183 /* TypeAssertionExpression */) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 209 /* DoStatement */) { + if (node.parent.kind === 211 /* DoStatement */) { // Set span on while expression return textSpanEndingAtNextToken(node, node.parent.expression); } @@ -80088,7 +87300,7 @@ var ts; return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 213 /* ForOfStatement */) { + if (node.parent.kind === 215 /* ForOfStatement */) { // Set using next token return spanInNextNode(node); } @@ -80100,6 +87312,26 @@ var ts; BreakpointResolver.spanInSourceFileAtLocation = spanInSourceFileAtLocation; })(BreakpointResolver = ts.BreakpointResolver || (ts.BreakpointResolver = {})); })(ts || (ts = {})); +/// +/// +var ts; +(function (ts) { + /** + * Transform one or more nodes using the supplied transformers. + * @param source A single `Node` or an array of `Node` objects. + * @param transformers An array of `TransformerFactory` callbacks used to process the transformation. + * @param compilerOptions Optional compiler options. + */ + function transform(source, transformers, compilerOptions) { + var diagnostics = []; + compilerOptions = ts.fixupCompilerOptions(compilerOptions, diagnostics); + var nodes = ts.isArray(source) ? source : [source]; + var result = ts.transformNodes(/*resolver*/ undefined, /*emitHost*/ undefined, compilerOptions, nodes, transformers, /*allowDtsFiles*/ true); + result.diagnostics = ts.concatenate(result.diagnostics, diagnostics); + return result; + } + ts.transform = transform; +})(ts || (ts = {})); // // Copyright (c) Microsoft Corporation. All rights reserved. // @@ -80141,8 +87373,7 @@ var ts; ScriptSnapshotShimAdapter.prototype.getChangeRange = function (oldSnapshot) { var oldSnapshotShim = oldSnapshot; var encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim); - // TODO: should this be '==='? - if (encoded == null) { + if (encoded === null) { return null; } var decoded = JSON.parse(encoded); @@ -80215,11 +87446,13 @@ var ts; }; LanguageServiceShimHostAdapter.prototype.getCompilationSettings = function () { var settingsJson = this.shimHost.getCompilationSettings(); - // TODO: should this be '==='? - if (settingsJson == null || settingsJson == "") { + if (settingsJson === null || settingsJson === "") { throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings"); } - return JSON.parse(settingsJson); + var compilerOptions = JSON.parse(settingsJson); + // permit language service to handle all files (filtering should be performed on the host side) + compilerOptions.allowNonTsExtensions = true; + return compilerOptions; }; LanguageServiceShimHostAdapter.prototype.getScriptFileNames = function () { var encoded = this.shimHost.getScriptFileNames(); @@ -80242,7 +87475,7 @@ var ts; }; LanguageServiceShimHostAdapter.prototype.getLocalizedDiagnosticMessages = function () { var diagnosticMessagesJson = this.shimHost.getLocalizedDiagnosticMessages(); - if (diagnosticMessagesJson == null || diagnosticMessagesJson == "") { + if (diagnosticMessagesJson === null || diagnosticMessagesJson === "") { return null; } try { @@ -80255,7 +87488,7 @@ var ts; }; LanguageServiceShimHostAdapter.prototype.getCancellationToken = function () { var hostCancellationToken = this.shimHost.getCancellationToken(); - return new ThrottledCancellationToken(hostCancellationToken); + return new ts.ThrottledCancellationToken(hostCancellationToken); }; LanguageServiceShimHostAdapter.prototype.getCurrentDirectory = function () { return this.shimHost.getCurrentDirectory(); @@ -80279,27 +87512,6 @@ var ts; return LanguageServiceShimHostAdapter; }()); ts.LanguageServiceShimHostAdapter = LanguageServiceShimHostAdapter; - /** A cancellation that throttles calls to the host */ - var ThrottledCancellationToken = (function () { - function ThrottledCancellationToken(hostCancellationToken) { - this.hostCancellationToken = hostCancellationToken; - // Store when we last tried to cancel. Checking cancellation can be expensive (as we have - // to marshall over to the host layer). So we only bother actually checking once enough - // time has passed. - this.lastCancellationCheckTime = 0; - } - ThrottledCancellationToken.prototype.isCancellationRequested = function () { - var time = ts.timestamp(); - var duration = Math.abs(time - this.lastCancellationCheckTime); - if (duration > 10) { - // Check no more than once every 10 ms. - this.lastCancellationCheckTime = time; - return this.hostCancellationToken.isCancellationRequested(); - } - return false; - }; - return ThrottledCancellationToken; - }()); var CoreServicesShimHostAdapter = (function () { function CoreServicesShimHostAdapter(shimHost) { var _this = this; @@ -80727,12 +87939,6 @@ var ts; var compilerOptions = JSON.parse(compilerOptionsJson); var result = ts.resolveModuleName(moduleName, ts.normalizeSlashes(fileName), compilerOptions, _this.host); var resolvedFileName = result.resolvedModule ? result.resolvedModule.resolvedFileName : undefined; - if (resolvedFileName && !compilerOptions.allowJs && ts.fileExtensionIs(resolvedFileName, ".js")) { - return { - resolvedFileName: undefined, - failedLookupLocations: [] - }; - } return { resolvedFileName: resolvedFileName, failedLookupLocations: result.failedLookupLocations @@ -80877,7 +88083,7 @@ var ts; this._shims.push(shim); }; TypeScriptServicesFactory.prototype.unregisterShim = function (shim) { - for (var i = 0, n = this._shims.length; i < n; i++) { + for (var i = 0; i < this._shims.length; i++) { if (this._shims[i] === shim) { delete this._shims[i]; return; @@ -80906,4 +88112,4 @@ var TypeScript; // 'toolsVersion' gets consumed by the managed side, so it's not unused. // TODO: it should be moved into a namespace though. /* @internal */ -var toolsVersion = "2.2"; +var toolsVersion = "2.3"; diff --git a/node_modules/typescript/lib/typingsInstaller.js b/node_modules/typescript/lib/typingsInstaller.js index 904f1444d..3e48c048f 100644 --- a/node_modules/typescript/lib/typingsInstaller.js +++ b/node_modules/typescript/lib/typingsInstaller.js @@ -13,11 +13,16 @@ See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var ts; (function (ts) { var OperationCanceledException = (function () { @@ -32,6 +37,16 @@ var ts; ExitStatus[ExitStatus["DiagnosticsPresent_OutputsSkipped"] = 1] = "DiagnosticsPresent_OutputsSkipped"; ExitStatus[ExitStatus["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated"; })(ExitStatus = ts.ExitStatus || (ts.ExitStatus = {})); + var NodeBuilderFlags; + (function (NodeBuilderFlags) { + NodeBuilderFlags[NodeBuilderFlags["None"] = 0] = "None"; + NodeBuilderFlags[NodeBuilderFlags["allowThisInObjectLiteral"] = 1] = "allowThisInObjectLiteral"; + NodeBuilderFlags[NodeBuilderFlags["allowQualifedNameInPlaceOfIdentifier"] = 2] = "allowQualifedNameInPlaceOfIdentifier"; + NodeBuilderFlags[NodeBuilderFlags["allowTypeParameterInQualifiedName"] = 4] = "allowTypeParameterInQualifiedName"; + NodeBuilderFlags[NodeBuilderFlags["allowAnonymousIdentifier"] = 8] = "allowAnonymousIdentifier"; + NodeBuilderFlags[NodeBuilderFlags["allowEmptyUnionOrIntersection"] = 16] = "allowEmptyUnionOrIntersection"; + NodeBuilderFlags[NodeBuilderFlags["allowEmptyTuple"] = 32] = "allowEmptyTuple"; + })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {})); var TypeReferenceSerializationKind; (function (TypeReferenceSerializationKind) { TypeReferenceSerializationKind[TypeReferenceSerializationKind["Unknown"] = 0] = "Unknown"; @@ -93,32 +108,32 @@ var ts; var measures; function mark(markName) { if (enabled) { - marks[markName] = ts.timestamp(); - counts[markName] = (counts[markName] || 0) + 1; + marks.set(markName, ts.timestamp()); + counts.set(markName, (counts.get(markName) || 0) + 1); profilerEvent(markName); } } performance.mark = mark; function measure(measureName, startMarkName, endMarkName) { if (enabled) { - var end = endMarkName && marks[endMarkName] || ts.timestamp(); - var start = startMarkName && marks[startMarkName] || profilerStart; - measures[measureName] = (measures[measureName] || 0) + (end - start); + var end = endMarkName && marks.get(endMarkName) || ts.timestamp(); + var start = startMarkName && marks.get(startMarkName) || profilerStart; + measures.set(measureName, (measures.get(measureName) || 0) + (end - start)); } } performance.measure = measure; function getCount(markName) { - return counts && counts[markName] || 0; + return counts && counts.get(markName) || 0; } performance.getCount = getCount; function getDuration(measureName) { - return measures && measures[measureName] || 0; + return measures && measures.get(measureName) || 0; } performance.getDuration = getDuration; function forEachMeasure(cb) { - for (var key in measures) { - cb(key, measures[key]); - } + measures.forEach(function (measure, key) { + cb(key, measure); + }); } performance.forEachMeasure = forEachMeasure; function enable() { @@ -137,22 +152,96 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - ts.version = "2.2.0-dev.20161127"; + ts.version = "2.3.0-dev.20170419"; })(ts || (ts = {})); (function (ts) { - var createObject = Object.create; - ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined; - function createMap(template) { - var map = createObject(null); + ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator(undefined, { usage: "sort", sensitivity: "accent" }) : undefined; + ts.localeCompareIsCorrect = ts.collator && ts.collator.compare("a", "B") < 0; + function createDictionaryObject() { + var map = Object.create(null); map["__"] = undefined; delete map["__"]; + return map; + } + function createMap() { + return new MapCtr(); + } + ts.createMap = createMap; + function createMapFromTemplate(template) { + var map = new MapCtr(); for (var key in template) if (hasOwnProperty.call(template, key)) { - map[key] = template[key]; + map.set(key, template[key]); } return map; } - ts.createMap = createMap; + ts.createMapFromTemplate = createMapFromTemplate; + var MapCtr = typeof Map !== "undefined" && "entries" in Map.prototype ? Map : shimMap(); + function shimMap() { + var MapIterator = (function () { + function MapIterator(data, selector) { + this.index = 0; + this.data = data; + this.selector = selector; + this.keys = Object.keys(data); + } + MapIterator.prototype.next = function () { + var index = this.index; + if (index < this.keys.length) { + this.index++; + return { value: this.selector(this.data, this.keys[index]), done: false }; + } + return { value: undefined, done: true }; + }; + return MapIterator; + }()); + return (function () { + function class_1() { + this.data = createDictionaryObject(); + this.size = 0; + } + class_1.prototype.get = function (key) { + return this.data[key]; + }; + class_1.prototype.set = function (key, value) { + if (!this.has(key)) { + this.size++; + } + this.data[key] = value; + return this; + }; + class_1.prototype.has = function (key) { + return key in this.data; + }; + class_1.prototype.delete = function (key) { + if (this.has(key)) { + this.size--; + delete this.data[key]; + return true; + } + return false; + }; + class_1.prototype.clear = function () { + this.data = createDictionaryObject(); + this.size = 0; + }; + class_1.prototype.keys = function () { + return new MapIterator(this.data, function (_data, key) { return key; }); + }; + class_1.prototype.values = function () { + return new MapIterator(this.data, function (data, key) { return data[key]; }); + }; + class_1.prototype.entries = function () { + return new MapIterator(this.data, function (data, key) { return [key, data[key]]; }); + }; + class_1.prototype.forEach = function (action) { + for (var key in this.data) { + action(this.data[key], key); + } + }; + return class_1; + }()); + } function createFileMap(keyMapper) { var files = createMap(); return { @@ -165,32 +254,27 @@ var ts; clear: clear, }; function forEachValueInMap(f) { - for (var key in files) { - f(key, files[key]); - } + files.forEach(function (file, key) { + f(key, file); + }); } function getKeys() { - var keys = []; - for (var key in files) { - keys.push(key); - } - return keys; + return arrayFrom(files.keys()); } function get(path) { - return files[toKey(path)]; + return files.get(toKey(path)); } function set(path, value) { - files[toKey(path)] = value; + files.set(toKey(path), value); } function contains(path) { - return toKey(path) in files; + return files.has(toKey(path)); } function remove(path) { - var key = toKey(path); - delete files[key]; + files.delete(toKey(path)); } function clear() { - files = createMap(); + files.clear(); } function toKey(path) { return keyMapper ? keyMapper(path) : path; @@ -204,9 +288,13 @@ var ts; return getCanonicalFileName(nonCanonicalizedPath); } ts.toPath = toPath; + function length(array) { + return array ? array.length : 0; + } + ts.length = length; function forEach(array, callback) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { var result = callback(array[i], i); if (result) { return result; @@ -216,6 +304,20 @@ var ts; return undefined; } ts.forEach = forEach; + function findAncestor(node, callback) { + while (node) { + var result = callback(node); + if (result === "quit") { + return undefined; + } + else if (result) { + return node; + } + node = node.parent; + } + return undefined; + } + ts.findAncestor = findAncestor; function zipWith(arrayA, arrayB, callback) { Debug.assert(arrayA.length === arrayB.length); for (var i = 0; i < arrayA.length; i++) { @@ -225,7 +327,7 @@ var ts; ts.zipWith = zipWith; function every(array, callback) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { if (!callback(array[i], i)) { return false; } @@ -235,7 +337,7 @@ var ts; } ts.every = every; function find(array, predicate) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { var value = array[i]; if (predicate(value, i)) { return value; @@ -244,8 +346,17 @@ var ts; return undefined; } ts.find = find; + function findIndex(array, predicate) { + for (var i = 0; i < array.length; i++) { + if (predicate(array[i], i)) { + return i; + } + } + return -1; + } + ts.findIndex = findIndex; function findMap(array, callback) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { var result = callback(array[i], i); if (result) { return result; @@ -268,7 +379,7 @@ var ts; ts.contains = contains; function indexOf(array, value) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { + for (var i = 0; i < array.length; i++) { if (array[i] === value) { return i; } @@ -278,7 +389,7 @@ var ts; } ts.indexOf = indexOf; function indexOfAnyCharCode(text, charCodes, start) { - for (var i = start || 0, len = text.length; i < len; i++) { + for (var i = start || 0; i < text.length; i++) { if (contains(charCodes, text.charCodeAt(i))) { return i; } @@ -465,21 +576,18 @@ var ts; return result; } ts.spanMap = spanMap; - function mapObject(object, f) { - var result; - if (object) { - result = {}; - for (var _i = 0, _a = getOwnKeys(object); _i < _a.length; _i++) { - var v = _a[_i]; - var _b = f(v, object[v]) || [undefined, undefined], key = _b[0], value = _b[1]; - if (key !== undefined) { - result[key] = value; - } - } + function mapEntries(map, f) { + if (!map) { + return undefined; } + var result = createMap(); + map.forEach(function (value, key) { + var _a = f(key, value), newKey = _a[0], newValue = _a[1]; + result.set(newKey, newValue); + }); return result; } - ts.mapObject = mapObject; + ts.mapEntries = mapEntries; function some(array, predicate) { if (array) { if (predicate) { @@ -763,38 +871,55 @@ var ts; return keys; } ts.getOwnKeys = getOwnKeys; - function forEachProperty(map, callback) { - var result; - for (var key in map) { - if (result = callback(map[key], key)) - break; + function arrayFrom(iterator, map) { + var result = []; + for (var _a = iterator.next(), value = _a.value, done = _a.done; !done; _b = iterator.next(), value = _b.value, done = _b.done, _b) { + result.push(map ? map(value) : value); } return result; + var _b; } - ts.forEachProperty = forEachProperty; - function someProperties(map, predicate) { - for (var key in map) { - if (!predicate || predicate(map[key], key)) - return true; + ts.arrayFrom = arrayFrom; + function convertToArray(iterator, f) { + var result = []; + for (var _a = iterator.next(), value = _a.value, done = _a.done; !done; _b = iterator.next(), value = _b.value, done = _b.done, _b) { + result.push(f(value)); } - return false; + return result; + var _b; } - ts.someProperties = someProperties; - function copyProperties(source, target) { - for (var key in source) { - target[key] = source[key]; + ts.convertToArray = convertToArray; + function forEachEntry(map, callback) { + var iterator = map.entries(); + for (var _a = iterator.next(), pair = _a.value, done = _a.done; !done; _b = iterator.next(), pair = _b.value, done = _b.done, _b) { + var key = pair[0], value = pair[1]; + var result = callback(value, key); + if (result) { + return result; + } } + return undefined; + var _b; } - ts.copyProperties = copyProperties; - function appendProperty(map, key, value) { - if (key === undefined || value === undefined) - return map; - if (map === undefined) - map = createMap(); - map[key] = value; - return map; + ts.forEachEntry = forEachEntry; + function forEachKey(map, callback) { + var iterator = map.keys(); + for (var _a = iterator.next(), key = _a.value, done = _a.done; !done; _b = iterator.next(), key = _b.value, done = _b.done, _b) { + var result = callback(key); + if (result) { + return result; + } + } + return undefined; + var _b; } - ts.appendProperty = appendProperty; + ts.forEachKey = forEachKey; + function copyEntries(source, target) { + source.forEach(function (value, key) { + target.set(key, value); + }); + } + ts.copyEntries = copyEntries; function assign(t) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { @@ -802,31 +927,14 @@ var ts; } for (var _a = 0, args_1 = args; _a < args_1.length; _a++) { var arg = args_1[_a]; - for (var _b = 0, _c = getOwnKeys(arg); _b < _c.length; _b++) { - var p = _c[_b]; - t[p] = arg[p]; - } + for (var p in arg) + if (hasProperty(arg, p)) { + t[p] = arg[p]; + } } return t; } ts.assign = assign; - function reduceProperties(map, callback, initial) { - var result = initial; - for (var key in map) { - result = callback(result, map[key], String(key)); - } - return result; - } - ts.reduceProperties = reduceProperties; - function reduceOwnProperties(map, callback, initial) { - var result = initial; - for (var key in map) - if (hasOwnProperty.call(map, key)) { - result = callback(result, map[key], String(key)); - } - return result; - } - ts.reduceOwnProperties = reduceOwnProperties; function equalOwnProperties(left, right, equalityComparer) { if (left === right) return true; @@ -851,23 +959,14 @@ var ts; var result = createMap(); for (var _i = 0, array_8 = array; _i < array_8.length; _i++) { var value = array_8[_i]; - result[makeKey(value)] = makeValue ? makeValue(value) : value; + result.set(makeKey(value), makeValue ? makeValue(value) : value); } return result; } ts.arrayToMap = arrayToMap; - function isEmpty(map) { - for (var id in map) { - if (hasProperty(map, id)) { - return false; - } - } - return true; - } - ts.isEmpty = isEmpty; function cloneMap(map) { var clone = createMap(); - copyProperties(map, clone); + copyEntries(map, clone); return clone; } ts.cloneMap = cloneMap; @@ -894,27 +993,32 @@ var ts; return result; } ts.extend = extend; - function multiMapAdd(map, key, value) { - var values = map[key]; + function createMultiMap() { + var map = createMap(); + map.add = multiMapAdd; + map.remove = multiMapRemove; + return map; + } + ts.createMultiMap = createMultiMap; + function multiMapAdd(key, value) { + var values = this.get(key); if (values) { values.push(value); - return values; } else { - return map[key] = [value]; + this.set(key, values = [value]); } + return values; } - ts.multiMapAdd = multiMapAdd; - function multiMapRemove(map, key, value) { - var values = map[key]; + function multiMapRemove(key, value) { + var values = this.get(key); if (values) { unorderedRemoveItem(values, value); if (!values.length) { - delete map[key]; + this.delete(key); } } } - ts.multiMapRemove = multiMapRemove; function isArray(value) { return Array.isArray ? Array.isArray(value) : value instanceof Array; } @@ -990,6 +1094,7 @@ var ts; baseIndex = baseIndex || 0; return text.replace(/{(\d+)}/g, function (_match, index) { return args[+index + baseIndex]; }); } + ts.formatStringFromArgs = formatStringFromArgs; ts.localizedDiagnosticMessages = undefined; function getLocaleSpecificMessage(message) { return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message.key] || message.message; @@ -1091,8 +1196,10 @@ var ts; if (b === undefined) return 1; if (ignoreCase) { - if (ts.collator && String.prototype.localeCompare) { - var result = a.localeCompare(b, undefined, { usage: "sort", sensitivity: "accent" }); + if (ts.collator) { + var result = ts.localeCompareIsCorrect ? + ts.collator.compare(a, b) : + a.localeCompare(b, undefined, { usage: "sort", sensitivity: "accent" }); return result < 0 ? -1 : result > 0 ? 1 : 0; } a = a.toUpperCase(); @@ -1474,36 +1581,26 @@ var ts; var singleAsteriskRegexFragmentFiles = "([^./]|(\\.(?!min\\.js$))?)*"; var singleAsteriskRegexFragmentOther = "[^/]*"; function getRegularExpressionForWildcard(specs, basePath, usage) { + var patterns = getRegularExpressionsForWildcards(specs, basePath, usage); + if (!patterns || !patterns.length) { + return undefined; + } + var pattern = patterns.map(function (pattern) { return "(" + pattern + ")"; }).join("|"); + var terminator = usage === "exclude" ? "($|/)" : "$"; + return "^(" + pattern + ")" + terminator; + } + ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard; + function getRegularExpressionsForWildcards(specs, basePath, usage) { if (specs === undefined || specs.length === 0) { return undefined; } var replaceWildcardCharacter = usage === "files" ? replaceWildCardCharacterFiles : replaceWildCardCharacterOther; var singleAsteriskRegexFragment = usage === "files" ? singleAsteriskRegexFragmentFiles : singleAsteriskRegexFragmentOther; var doubleAsteriskRegexFragment = usage === "exclude" ? "(/.+?)?" : "(/[^/.][^/]*)*?"; - var pattern = ""; - var hasWrittenSubpattern = false; - for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) { - var spec = specs_1[_i]; - if (!spec) { - continue; - } - var subPattern = getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter); - if (subPattern === undefined) { - continue; - } - if (hasWrittenSubpattern) { - pattern += "|"; - } - pattern += "(" + subPattern + ")"; - hasWrittenSubpattern = true; - } - if (!pattern) { - return undefined; - } - var terminator = usage === "exclude" ? "($|/)" : "$"; - return "^(" + pattern + ")" + terminator; + return flatMap(specs, function (spec) { + return spec && getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter); + }); } - ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard; function isImplicitGlob(lastPathComponent) { return !/[.*?]/.test(lastPathComponent); } @@ -1573,6 +1670,7 @@ var ts; currentDirectory = normalizePath(currentDirectory); var absolutePath = combinePaths(currentDirectory, path); return { + includeFilePatterns: map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^" + pattern + "$"; }), includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"), includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"), excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"), @@ -1585,34 +1683,48 @@ var ts; currentDirectory = normalizePath(currentDirectory); var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory); var regexFlag = useCaseSensitiveFileNames ? "" : "i"; - var includeFileRegex = patterns.includeFilePattern && new RegExp(patterns.includeFilePattern, regexFlag); + var includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map(function (pattern) { return new RegExp(pattern, regexFlag); }); var includeDirectoryRegex = patterns.includeDirectoryPattern && new RegExp(patterns.includeDirectoryPattern, regexFlag); var excludeRegex = patterns.excludePattern && new RegExp(patterns.excludePattern, regexFlag); - var result = []; + var results = includeFileRegexes ? includeFileRegexes.map(function () { return []; }) : [[]]; + var comparer = useCaseSensitiveFileNames ? compareStrings : compareStringsCaseInsensitive; for (var _i = 0, _a = patterns.basePaths; _i < _a.length; _i++) { var basePath = _a[_i]; visitDirectory(basePath, combinePaths(currentDirectory, basePath)); } - return result; + return flatten(results); function visitDirectory(path, absolutePath) { var _a = getFileSystemEntries(path), files = _a.files, directories = _a.directories; + files = files.slice().sort(comparer); + directories = directories.slice().sort(comparer); + var _loop_1 = function (current) { + var name = combinePaths(path, current); + var absoluteName = combinePaths(absolutePath, current); + if (extensions && !fileExtensionIsAny(name, extensions)) + return "continue"; + if (excludeRegex && excludeRegex.test(absoluteName)) + return "continue"; + if (!includeFileRegexes) { + results[0].push(name); + } + else { + var includeIndex = findIndex(includeFileRegexes, function (re) { return re.test(absoluteName); }); + if (includeIndex !== -1) { + results[includeIndex].push(name); + } + } + }; for (var _i = 0, files_1 = files; _i < files_1.length; _i++) { var current = files_1[_i]; - var name_1 = combinePaths(path, current); - var absoluteName = combinePaths(absolutePath, current); - if ((!extensions || fileExtensionIsAny(name_1, extensions)) && - (!includeFileRegex || includeFileRegex.test(absoluteName)) && - (!excludeRegex || !excludeRegex.test(absoluteName))) { - result.push(name_1); - } + _loop_1(current); } for (var _b = 0, directories_1 = directories; _b < directories_1.length; _b++) { var current = directories_1[_b]; - var name_2 = combinePaths(path, current); + var name = combinePaths(path, current); var absoluteName = combinePaths(absolutePath, current); if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) && (!excludeRegex || !excludeRegex.test(absoluteName))) { - visitDirectory(name_2, absoluteName); + visitDirectory(name, absoluteName); } } } @@ -1628,14 +1740,14 @@ var ts; includeBasePaths.push(getIncludeBasePath(absolute)); } includeBasePaths.sort(useCaseSensitiveFileNames ? compareStrings : compareStringsCaseInsensitive); - var _loop_1 = function (includeBasePath) { + var _loop_2 = function (includeBasePath) { if (ts.every(basePaths, function (basePath) { return !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames); })) { basePaths.push(includeBasePath); } }; for (var _a = 0, includeBasePaths_1 = includeBasePaths; _a < includeBasePaths_1.length; _a++) { var includeBasePath = includeBasePaths_1[_a]; - _loop_1(includeBasePath); + _loop_2(includeBasePath); } } return basePaths; @@ -1673,8 +1785,19 @@ var ts; ts.supportedTypescriptExtensionsForExtractExtension = [".d.ts", ".ts", ".tsx"]; ts.supportedJavascriptExtensions = [".js", ".jsx"]; var allSupportedExtensions = ts.supportedTypeScriptExtensions.concat(ts.supportedJavascriptExtensions); - function getSupportedExtensions(options) { - return options && options.allowJs ? allSupportedExtensions : ts.supportedTypeScriptExtensions; + function getSupportedExtensions(options, extraFileExtensions) { + var needAllExtensions = options && options.allowJs; + if (!extraFileExtensions || extraFileExtensions.length === 0 || !needAllExtensions) { + return needAllExtensions ? allSupportedExtensions : ts.supportedTypeScriptExtensions; + } + var extensions = allSupportedExtensions.slice(0); + for (var _i = 0, extraFileExtensions_1 = extraFileExtensions; _i < extraFileExtensions_1.length; _i++) { + var extInfo = extraFileExtensions_1[_i]; + if (extensions.indexOf(extInfo.extension) === -1) { + extensions.push(extInfo.extension); + } + } + return extensions; } ts.getSupportedExtensions = getSupportedExtensions; function hasJavaScriptFileExtension(fileName) { @@ -1685,11 +1808,11 @@ var ts; return forEach(ts.supportedTypeScriptExtensions, function (extension) { return fileExtensionIs(fileName, extension); }); } ts.hasTypeScriptFileExtension = hasTypeScriptFileExtension; - function isSupportedSourceFileName(fileName, compilerOptions) { + function isSupportedSourceFileName(fileName, compilerOptions, extraFileExtensions) { if (!fileName) { return false; } - for (var _i = 0, _a = getSupportedExtensions(compilerOptions); _i < _a.length; _i++) { + for (var _i = 0, _a = getSupportedExtensions(compilerOptions, extraFileExtensions); _i < _a.length; _i++) { var extension = _a[_i]; if (fileExtensionIs(fileName, extension)) { return true; @@ -1701,30 +1824,30 @@ var ts; function getExtensionPriority(path, supportedExtensions) { for (var i = supportedExtensions.length - 1; i >= 0; i--) { if (fileExtensionIs(path, supportedExtensions[i])) { - return adjustExtensionPriority(i); + return adjustExtensionPriority(i, supportedExtensions); } } return 0; } ts.getExtensionPriority = getExtensionPriority; - function adjustExtensionPriority(extensionPriority) { + function adjustExtensionPriority(extensionPriority, supportedExtensions) { if (extensionPriority < 2) { return 0; } - else if (extensionPriority < 5) { + else if (extensionPriority < supportedExtensions.length) { return 2; } else { - return 5; + return supportedExtensions.length; } } ts.adjustExtensionPriority = adjustExtensionPriority; - function getNextLowestExtensionPriority(extensionPriority) { + function getNextLowestExtensionPriority(extensionPriority, supportedExtensions) { if (extensionPriority < 2) { return 2; } else { - return 5; + return supportedExtensions.length; } } ts.getNextLowestExtensionPriority = getNextLowestExtensionPriority; @@ -1933,136 +2056,29 @@ var ts; } } ts.tryGetExtensionFromPath = tryGetExtensionFromPath; + function isCheckJsEnabledForFile(sourceFile, compilerOptions) { + return sourceFile.checkJsDirective ? sourceFile.checkJsDirective.enabled : compilerOptions.checkJs; + } + ts.isCheckJsEnabledForFile = isCheckJsEnabledForFile; })(ts || (ts = {})); var ts; (function (ts) { - ts.sys = (function () { - function getWScriptSystem() { - var fso = new ActiveXObject("Scripting.FileSystemObject"); - var shell = new ActiveXObject("WScript.Shell"); - var fileStream = new ActiveXObject("ADODB.Stream"); - fileStream.Type = 2; - var binaryStream = new ActiveXObject("ADODB.Stream"); - binaryStream.Type = 1; - var args = []; - for (var i = 0; i < WScript.Arguments.length; i++) { - args[i] = WScript.Arguments.Item(i); - } - function readFile(fileName, encoding) { - if (!fso.FileExists(fileName)) { - return undefined; - } - fileStream.Open(); - try { - if (encoding) { - fileStream.Charset = encoding; - fileStream.LoadFromFile(fileName); - } - else { - fileStream.Charset = "x-ansi"; - fileStream.LoadFromFile(fileName); - var bom = fileStream.ReadText(2) || ""; - fileStream.Position = 0; - fileStream.Charset = bom.length >= 2 && (bom.charCodeAt(0) === 0xFF && bom.charCodeAt(1) === 0xFE || bom.charCodeAt(0) === 0xFE && bom.charCodeAt(1) === 0xFF) ? "unicode" : "utf-8"; - } - return fileStream.ReadText(); - } - catch (e) { - throw e; - } - finally { - fileStream.Close(); - } - } - function writeFile(fileName, data, writeByteOrderMark) { - fileStream.Open(); - binaryStream.Open(); - try { - fileStream.Charset = "utf-8"; - fileStream.WriteText(data); - if (writeByteOrderMark) { - fileStream.Position = 0; - } - else { - fileStream.Position = 3; - } - fileStream.CopyTo(binaryStream); - binaryStream.SaveToFile(fileName, 2); - } - finally { - binaryStream.Close(); - fileStream.Close(); - } - } - function getNames(collection) { - var result = []; - for (var e = new Enumerator(collection); !e.atEnd(); e.moveNext()) { - result.push(e.item().Name); - } - return result.sort(); - } - function getDirectories(path) { - var folder = fso.GetFolder(path); - return getNames(folder.subfolders); - } - function getAccessibleFileSystemEntries(path) { - try { - var folder = fso.GetFolder(path || "."); - var files = getNames(folder.files); - var directories = getNames(folder.subfolders); - return { files: files, directories: directories }; - } - catch (e) { - return { files: [], directories: [] }; - } - } - function readDirectory(path, extensions, excludes, includes) { - return ts.matchFiles(path, extensions, excludes, includes, false, shell.CurrentDirectory, getAccessibleFileSystemEntries); - } - var wscriptSystem = { - args: args, - newLine: "\r\n", - useCaseSensitiveFileNames: false, - write: function (s) { - WScript.StdOut.Write(s); - }, - readFile: readFile, - writeFile: writeFile, - resolvePath: function (path) { - return fso.GetAbsolutePathName(path); - }, - fileExists: function (path) { - return fso.FileExists(path); - }, - directoryExists: function (path) { - return fso.FolderExists(path); - }, - createDirectory: function (directoryName) { - if (!wscriptSystem.directoryExists(directoryName)) { - fso.CreateFolder(directoryName); - } - }, - getExecutingFilePath: function () { - return WScript.ScriptFullName; - }, - getCurrentDirectory: function () { - return shell.CurrentDirectory; - }, - getDirectories: getDirectories, - getEnvironmentVariable: function (name) { - return new ActiveXObject("WScript.Shell").ExpandEnvironmentStrings("%" + name + "%"); - }, - readDirectory: readDirectory, - exit: function (exitCode) { - try { - WScript.Quit(exitCode); - } - catch (e) { - } - } - }; - return wscriptSystem; + function getNodeMajorVersion() { + if (typeof process === "undefined") { + return undefined; } + var version = process.version; + if (!version) { + return undefined; + } + var dot = version.indexOf("."); + if (dot === -1) { + return undefined; + } + return parseInt(version.substring(1, dot)); + } + ts.getNodeMajorVersion = getNodeMajorVersion; + ts.sys = (function () { function getNodeSystem() { var _fs = require("fs"); var _path = require("path"); @@ -2071,32 +2087,32 @@ var ts; var useNonPollingWatchers = process.env["TSC_NONPOLLING_WATCHER"]; function createWatchedFileSet() { var dirWatchers = ts.createMap(); - var fileWatcherCallbacks = ts.createMap(); + var fileWatcherCallbacks = ts.createMultiMap(); return { addFile: addFile, removeFile: removeFile }; function reduceDirWatcherRefCountForFile(fileName) { var dirName = ts.getDirectoryPath(fileName); - var watcher = dirWatchers[dirName]; + var watcher = dirWatchers.get(dirName); if (watcher) { watcher.referenceCount -= 1; if (watcher.referenceCount <= 0) { watcher.close(); - delete dirWatchers[dirName]; + dirWatchers.delete(dirName); } } } function addDirWatcher(dirPath) { - var watcher = dirWatchers[dirPath]; + var watcher = dirWatchers.get(dirPath); if (watcher) { watcher.referenceCount += 1; return; } watcher = _fs.watch(dirPath, { persistent: true }, function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); watcher.referenceCount = 1; - dirWatchers[dirPath] = watcher; + dirWatchers.set(dirPath, watcher); return; } function addFileWatcherCallback(filePath, callback) { - ts.multiMapAdd(fileWatcherCallbacks, filePath, callback); + fileWatcherCallbacks.add(filePath, callback); } function addFile(fileName, callback) { addFileWatcherCallback(fileName, callback); @@ -2108,24 +2124,26 @@ var ts; reduceDirWatcherRefCountForFile(watchedFile.fileName); } function removeFileWatcherCallback(filePath, callback) { - ts.multiMapRemove(fileWatcherCallbacks, filePath, callback); + fileWatcherCallbacks.remove(filePath, callback); } function fileEventHandler(eventName, relativeFileName, baseDirPath) { var fileName = typeof relativeFileName !== "string" ? undefined : ts.getNormalizedAbsolutePath(relativeFileName, baseDirPath); - if ((eventName === "change" || eventName === "rename") && fileWatcherCallbacks[fileName]) { - for (var _i = 0, _a = fileWatcherCallbacks[fileName]; _i < _a.length; _i++) { - var fileCallback = _a[_i]; - fileCallback(fileName); + if ((eventName === "change" || eventName === "rename")) { + var callbacks = fileWatcherCallbacks.get(fileName); + if (callbacks) { + for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) { + var fileCallback = callbacks_1[_i]; + fileCallback(fileName); + } } } } } var watchedFileSet = createWatchedFileSet(); - function isNode4OrLater() { - return parseInt(process.version.charAt(1)) >= 4; - } + var nodeVersion = getNodeMajorVersion(); + var isNode4OrLater = nodeVersion >= 4; function isFileSystemCaseSensitive() { if (platform === "win32" || platform === "win64") { return false; @@ -2182,10 +2200,10 @@ var ts; if (entry === "." || entry === "..") { continue; } - var name_3 = ts.combinePaths(path, entry); + var name = ts.combinePaths(path, entry); var stat = void 0; try { - stat = _fs.statSync(name_3); + stat = _fs.statSync(name); } catch (e) { continue; @@ -2262,7 +2280,7 @@ var ts; if (!directoryExists(directoryName)) { return noOpFileWatcher; } - if (isNode4OrLater() && (process.platform === "win32" || process.platform === "darwin")) { + if (isNode4OrLater && (process.platform === "win32" || process.platform === "darwin")) { options = { persistent: true, recursive: !!recursive }; } else { @@ -2272,7 +2290,6 @@ var ts; if (eventName === "rename") { callback(!relativeFileName ? relativeFileName : ts.normalizePath(ts.combinePaths(directoryName, relativeFileName))); } - ; }); }, resolvePath: function (path) { @@ -2389,9 +2406,6 @@ var ts; if (typeof ChakraHost !== "undefined") { sys = getChakraSystem(); } - else if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { - sys = getWScriptSystem(); - } else if (typeof process !== "undefined" && process.nextTick && !process.browser && typeof require !== "undefined") { sys = getNodeSystem(); } @@ -2460,11 +2474,11 @@ var ts; Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value: { code: 1055, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055", message: "Type '{0}' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value." }, Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: ts.DiagnosticCategory.Error, key: "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056", message: "Accessors are only available when targeting ECMAScript 5 and higher." }, An_async_function_or_method_must_have_a_valid_awaitable_return_type: { code: 1057, category: ts.DiagnosticCategory.Error, key: "An_async_function_or_method_must_have_a_valid_awaitable_return_type_1057", message: "An async function or method must have a valid awaitable return type." }, - Operand_for_await_does_not_have_a_valid_callable_then_member: { code: 1058, category: ts.DiagnosticCategory.Error, key: "Operand_for_await_does_not_have_a_valid_callable_then_member_1058", message: "Operand for 'await' does not have a valid callable 'then' member." }, - Return_expression_in_async_function_does_not_have_a_valid_callable_then_member: { code: 1059, category: ts.DiagnosticCategory.Error, key: "Return_expression_in_async_function_does_not_have_a_valid_callable_then_member_1059", message: "Return expression in async function does not have a valid callable 'then' member." }, - Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member: { code: 1060, category: ts.DiagnosticCategory.Error, key: "Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member_1060", message: "Expression body for async arrow function does not have a valid callable 'then' member." }, + The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1058, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058", message: "The return type of an async function must either be a valid promise or must not contain a callable 'then' member." }, + A_promise_must_have_a_then_method: { code: 1059, category: ts.DiagnosticCategory.Error, key: "A_promise_must_have_a_then_method_1059", message: "A promise must have a 'then' method." }, + The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback: { code: 1060, category: ts.DiagnosticCategory.Error, key: "The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060", message: "The first parameter of the 'then' method of a promise must be a callback." }, Enum_member_must_have_initializer: { code: 1061, category: ts.DiagnosticCategory.Error, key: "Enum_member_must_have_initializer_1061", message: "Enum member must have initializer." }, - _0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: { code: 1062, category: ts.DiagnosticCategory.Error, key: "_0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062", message: "{0} is referenced directly or indirectly in the fulfillment callback of its own 'then' method." }, + Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: { code: 1062, category: ts.DiagnosticCategory.Error, key: "Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062", message: "Type is referenced directly or indirectly in the fulfillment callback of its own 'then' method." }, An_export_assignment_cannot_be_used_in_a_namespace: { code: 1063, category: ts.DiagnosticCategory.Error, key: "An_export_assignment_cannot_be_used_in_a_namespace_1063", message: "An export assignment cannot be used in a namespace." }, The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type: { code: 1064, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1064", message: "The return type of an async function or method must be the global Promise type." }, In_ambient_enum_declarations_member_initializer_must_be_constant_expression: { code: 1066, category: ts.DiagnosticCategory.Error, key: "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066", message: "In ambient enum declarations member initializer must be constant expression." }, @@ -2473,7 +2487,7 @@ var ts; _0_modifier_cannot_appear_on_an_index_signature: { code: 1071, category: ts.DiagnosticCategory.Error, key: "_0_modifier_cannot_appear_on_an_index_signature_1071", message: "'{0}' modifier cannot appear on an index signature." }, A_0_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: ts.DiagnosticCategory.Error, key: "A_0_modifier_cannot_be_used_with_an_import_declaration_1079", message: "A '{0}' modifier cannot be used with an import declaration." }, Invalid_reference_directive_syntax: { code: 1084, category: ts.DiagnosticCategory.Error, key: "Invalid_reference_directive_syntax_1084", message: "Invalid 'reference' directive syntax." }, - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: ts.DiagnosticCategory.Error, key: "Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_1085", message: "Octal literals are not available when targeting ECMAScript 5 and higher." }, + Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0: { code: 1085, category: ts.DiagnosticCategory.Error, key: "Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0_1085", message: "Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '{0}'." }, An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: ts.DiagnosticCategory.Error, key: "An_accessor_cannot_be_declared_in_an_ambient_context_1086", message: "An accessor cannot be declared in an ambient context." }, _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: ts.DiagnosticCategory.Error, key: "_0_modifier_cannot_appear_on_a_constructor_declaration_1089", message: "'{0}' modifier cannot appear on a constructor declaration." }, _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: ts.DiagnosticCategory.Error, key: "_0_modifier_cannot_appear_on_a_parameter_1090", message: "'{0}' modifier cannot appear on a parameter." }, @@ -2489,6 +2503,7 @@ var ts; Invalid_use_of_0_in_strict_mode: { code: 1100, category: ts.DiagnosticCategory.Error, key: "Invalid_use_of_0_in_strict_mode_1100", message: "Invalid use of '{0}' in strict mode." }, with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: ts.DiagnosticCategory.Error, key: "with_statements_are_not_allowed_in_strict_mode_1101", message: "'with' statements are not allowed in strict mode." }, delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: ts.DiagnosticCategory.Error, key: "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102", message: "'delete' cannot be called on an identifier in strict mode." }, + A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator: { code: 1103, category: ts.DiagnosticCategory.Error, key: "A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator_1103", message: "A 'for-await-of' statement is only allowed within an async function or async generator." }, A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: ts.DiagnosticCategory.Error, key: "A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104", message: "A 'continue' statement can only be used within an enclosing iteration statement." }, A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: ts.DiagnosticCategory.Error, key: "A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105", message: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, Jump_target_cannot_cross_function_boundary: { code: 1107, category: ts.DiagnosticCategory.Error, key: "Jump_target_cannot_cross_function_boundary_1107", message: "Jump target cannot cross function boundary." }, @@ -2496,7 +2511,7 @@ var ts; Expression_expected: { code: 1109, category: ts.DiagnosticCategory.Error, key: "Expression_expected_1109", message: "Expression expected." }, Type_expected: { code: 1110, category: ts.DiagnosticCategory.Error, key: "Type_expected_1110", message: "Type expected." }, A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: ts.DiagnosticCategory.Error, key: "A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113", message: "A 'default' clause cannot appear more than once in a 'switch' statement." }, - Duplicate_label_0: { code: 1114, category: ts.DiagnosticCategory.Error, key: "Duplicate_label_0_1114", message: "Duplicate label '{0}'" }, + Duplicate_label_0: { code: 1114, category: ts.DiagnosticCategory.Error, key: "Duplicate_label_0_1114", message: "Duplicate label '{0}'." }, A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: ts.DiagnosticCategory.Error, key: "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", message: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: ts.DiagnosticCategory.Error, key: "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", message: "A 'break' statement can only jump to a label of an enclosing statement." }, An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: ts.DiagnosticCategory.Error, key: "An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode_1117", message: "An object literal cannot have multiple properties with the same name in strict mode." }, @@ -2528,9 +2543,9 @@ var ts; Declaration_expected: { code: 1146, category: ts.DiagnosticCategory.Error, key: "Declaration_expected_1146", message: "Declaration expected." }, Import_declarations_in_a_namespace_cannot_reference_a_module: { code: 1147, category: ts.DiagnosticCategory.Error, key: "Import_declarations_in_a_namespace_cannot_reference_a_module_1147", message: "Import declarations in a namespace cannot reference a module." }, Cannot_use_imports_exports_or_module_augmentations_when_module_is_none: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148", message: "Cannot use imports, exports, or module augmentations when '--module' is 'none'." }, - File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", message: "File name '{0}' differs from already included file name '{1}' only in casing" }, + File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", message: "File name '{0}' differs from already included file name '{1}' only in casing." }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: ts.DiagnosticCategory.Error, key: "new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead_1150", message: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "const_declarations_must_be_initialized_1155", message: "'const' declarations must be initialized" }, + const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "const_declarations_must_be_initialized_1155", message: "'const' declarations must be initialized." }, const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: ts.DiagnosticCategory.Error, key: "const_declarations_can_only_be_declared_inside_a_block_1156", message: "'const' declarations can only be declared inside a block." }, let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: ts.DiagnosticCategory.Error, key: "let_declarations_can_only_be_declared_inside_a_block_1157", message: "'let' declarations can only be declared inside a block." }, Unterminated_template_literal: { code: 1160, category: ts.DiagnosticCategory.Error, key: "Unterminated_template_literal_1160", message: "Unterminated template literal." }, @@ -2579,11 +2594,12 @@ var ts; Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided_1208", message: "Cannot compile namespaces when the '--isolatedModules' flag is provided." }, Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided_1209", message: "Ambient const enums are not allowed when the '--isolatedModules' flag is provided." }, Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode_1210", message: "Invalid use of '{0}'. Class definitions are automatically in strict mode." }, - A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", message: "A class declaration without the 'default' modifier must have a name" }, - Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", message: "Identifier expected. '{0}' is a reserved word in strict mode" }, + A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", message: "A class declaration without the 'default' modifier must have a name." }, + Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", message: "Identifier expected. '{0}' is a reserved word in strict mode." }, Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213", message: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode: { code: 1214, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214", message: "Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode." }, Invalid_use_of_0_Modules_are_automatically_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215", message: "Invalid use of '{0}'. Modules are automatically in strict mode." }, + Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216", message: "Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules." }, Export_assignment_is_not_supported_when_module_flag_is_system: { code: 1218, category: ts.DiagnosticCategory.Error, key: "Export_assignment_is_not_supported_when_module_flag_is_system_1218", message: "Export assignment is not supported when '--module' flag is 'system'." }, Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning: { code: 1219, category: ts.DiagnosticCategory.Error, key: "Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219", message: "Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning." }, Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher: { code: 1220, category: ts.DiagnosticCategory.Error, key: "Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher_1220", message: "Generators are only available when targeting ECMAScript 2015 or higher." }, @@ -2629,6 +2645,11 @@ var ts; Global_module_exports_may_only_appear_in_declaration_files: { code: 1315, category: ts.DiagnosticCategory.Error, key: "Global_module_exports_may_only_appear_in_declaration_files_1315", message: "Global module exports may only appear in declaration files." }, Global_module_exports_may_only_appear_at_top_level: { code: 1316, category: ts.DiagnosticCategory.Error, key: "Global_module_exports_may_only_appear_at_top_level_1316", message: "Global module exports may only appear at top level." }, A_parameter_property_cannot_be_declared_using_a_rest_parameter: { code: 1317, category: ts.DiagnosticCategory.Error, key: "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317", message: "A parameter property cannot be declared using a rest parameter." }, + An_abstract_accessor_cannot_have_an_implementation: { code: 1318, category: ts.DiagnosticCategory.Error, key: "An_abstract_accessor_cannot_have_an_implementation_1318", message: "An abstract accessor cannot have an implementation." }, + A_default_export_can_only_be_used_in_an_ECMAScript_style_module: { code: 1319, category: ts.DiagnosticCategory.Error, key: "A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319", message: "A default export can only be used in an ECMAScript-style module." }, + Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1320, category: ts.DiagnosticCategory.Error, key: "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320", message: "Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member." }, + Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1321, category: ts.DiagnosticCategory.Error, key: "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321", message: "Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member." }, + Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1322, category: ts.DiagnosticCategory.Error, key: "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322", message: "Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member." }, Duplicate_identifier_0: { code: 2300, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_2300", message: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: ts.DiagnosticCategory.Error, key: "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", message: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: ts.DiagnosticCategory.Error, key: "Static_members_cannot_reference_class_type_parameters_2302", message: "Static members cannot reference class type parameters." }, @@ -2672,6 +2693,7 @@ var ts; Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: ts.DiagnosticCategory.Error, key: "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340", message: "Only public and protected methods of the base class are accessible via the 'super' keyword." }, Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: ts.DiagnosticCategory.Error, key: "Property_0_is_private_and_only_accessible_within_class_1_2341", message: "Property '{0}' is private and only accessible within class '{1}'." }, An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { code: 2342, category: ts.DiagnosticCategory.Error, key: "An_index_expression_argument_must_be_of_type_string_number_symbol_or_any_2342", message: "An index expression argument must be of type 'string', 'number', 'symbol', or 'any'." }, + This_syntax_requires_an_imported_helper_named_1_but_module_0_has_no_exported_member_1: { code: 2343, category: ts.DiagnosticCategory.Error, key: "This_syntax_requires_an_imported_helper_named_1_but_module_0_has_no_exported_member_1_2343", message: "This syntax requires an imported helper named '{1}', but module '{0}' has no exported member '{1}'." }, Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: ts.DiagnosticCategory.Error, key: "Type_0_does_not_satisfy_the_constraint_1_2344", message: "Type '{0}' does not satisfy the constraint '{1}'." }, Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: ts.DiagnosticCategory.Error, key: "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345", message: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: ts.DiagnosticCategory.Error, key: "Supplied_parameters_do_not_match_any_signature_of_call_target_2346", message: "Supplied parameters do not match any signature of call target." }, @@ -2682,19 +2704,20 @@ var ts; Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: ts.DiagnosticCategory.Error, key: "Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature_2351", message: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, Type_0_cannot_be_converted_to_type_1: { code: 2352, category: ts.DiagnosticCategory.Error, key: "Type_0_cannot_be_converted_to_type_1_2352", message: "Type '{0}' cannot be converted to type '{1}'." }, Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1: { code: 2353, category: ts.DiagnosticCategory.Error, key: "Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353", message: "Object literal may only specify known properties, and '{0}' does not exist in type '{1}'." }, + This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found: { code: 2354, category: ts.DiagnosticCategory.Error, key: "This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354", message: "This syntax requires an imported helper but module '{0}' cannot be found." }, A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value: { code: 2355, category: ts.DiagnosticCategory.Error, key: "A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_2355", message: "A function whose declared type is neither 'void' nor 'any' must return a value." }, An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: ts.DiagnosticCategory.Error, key: "An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type_2356", message: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access: { code: 2357, category: ts.DiagnosticCategory.Error, key: "The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357", message: "The operand of an increment or decrement operator must be a variable or a property access." }, The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358", message: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359", message: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { code: 2360, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol_2360", message: "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'." }, - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter_2361", message: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter_2361", message: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter." }, The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2362", message: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2363", message: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access: { code: 2364, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364", message: "The left-hand side of an assignment expression must be a variable or a property access." }, Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: ts.DiagnosticCategory.Error, key: "Operator_0_cannot_be_applied_to_types_1_and_2_2365", message: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined: { code: 2366, category: ts.DiagnosticCategory.Error, key: "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366", message: "Function lacks ending return statement and return type does not include 'undefined'." }, - Type_parameter_name_cannot_be_0: { code: 2368, category: ts.DiagnosticCategory.Error, key: "Type_parameter_name_cannot_be_0_2368", message: "Type parameter name cannot be '{0}'" }, + Type_parameter_name_cannot_be_0: { code: 2368, category: ts.DiagnosticCategory.Error, key: "Type_parameter_name_cannot_be_0_2368", message: "Type parameter name cannot be '{0}'." }, A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: ts.DiagnosticCategory.Error, key: "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369", message: "A parameter property is only allowed in a constructor implementation." }, A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: ts.DiagnosticCategory.Error, key: "A_rest_parameter_must_be_of_an_array_type_2370", message: "A rest parameter must be of an array type." }, A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: ts.DiagnosticCategory.Error, key: "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371", message: "A parameter initializer is only allowed in a function or constructor implementation." }, @@ -2734,12 +2757,12 @@ var ts; The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access: { code: 2406, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406", message: "The left-hand side of a 'for...in' statement must be a variable or a property access." }, The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: ts.DiagnosticCategory.Error, key: "The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_2407", message: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, Setters_cannot_return_a_value: { code: 2408, category: ts.DiagnosticCategory.Error, key: "Setters_cannot_return_a_value_2408", message: "Setters cannot return a value." }, - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: ts.DiagnosticCategory.Error, key: "Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409", message: "Return type of constructor signature must be assignable to the instance type of the class" }, + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: ts.DiagnosticCategory.Error, key: "Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409", message: "Return type of constructor signature must be assignable to the instance type of the class." }, The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any: { code: 2410, category: ts.DiagnosticCategory.Error, key: "The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410", message: "The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'." }, Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: ts.DiagnosticCategory.Error, key: "Property_0_of_type_1_is_not_assignable_to_string_index_type_2_2411", message: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: ts.DiagnosticCategory.Error, key: "Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2_2412", message: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: ts.DiagnosticCategory.Error, key: "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413", message: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, - Class_name_cannot_be_0: { code: 2414, category: ts.DiagnosticCategory.Error, key: "Class_name_cannot_be_0_2414", message: "Class name cannot be '{0}'" }, + Class_name_cannot_be_0: { code: 2414, category: ts.DiagnosticCategory.Error, key: "Class_name_cannot_be_0_2414", message: "Class name cannot be '{0}'." }, Class_0_incorrectly_extends_base_class_1: { code: 2415, category: ts.DiagnosticCategory.Error, key: "Class_0_incorrectly_extends_base_class_1_2415", message: "Class '{0}' incorrectly extends base class '{1}'." }, Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: ts.DiagnosticCategory.Error, key: "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", message: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, Class_0_incorrectly_implements_interface_1: { code: 2420, category: ts.DiagnosticCategory.Error, key: "Class_0_incorrectly_implements_interface_1_2420", message: "Class '{0}' incorrectly implements interface '{1}'." }, @@ -2748,19 +2771,19 @@ var ts; Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: ts.DiagnosticCategory.Error, key: "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424", message: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: ts.DiagnosticCategory.Error, key: "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425", message: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: ts.DiagnosticCategory.Error, key: "Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426", message: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Interface_name_cannot_be_0: { code: 2427, category: ts.DiagnosticCategory.Error, key: "Interface_name_cannot_be_0_2427", message: "Interface name cannot be '{0}'" }, + Interface_name_cannot_be_0: { code: 2427, category: ts.DiagnosticCategory.Error, key: "Interface_name_cannot_be_0_2427", message: "Interface name cannot be '{0}'." }, All_declarations_of_0_must_have_identical_type_parameters: { code: 2428, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_0_must_have_identical_type_parameters_2428", message: "All declarations of '{0}' must have identical type parameters." }, Interface_0_incorrectly_extends_interface_1: { code: 2430, category: ts.DiagnosticCategory.Error, key: "Interface_0_incorrectly_extends_interface_1_2430", message: "Interface '{0}' incorrectly extends interface '{1}'." }, - Enum_name_cannot_be_0: { code: 2431, category: ts.DiagnosticCategory.Error, key: "Enum_name_cannot_be_0_2431", message: "Enum name cannot be '{0}'" }, + Enum_name_cannot_be_0: { code: 2431, category: ts.DiagnosticCategory.Error, key: "Enum_name_cannot_be_0_2431", message: "Enum name cannot be '{0}'." }, In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: ts.DiagnosticCategory.Error, key: "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432", message: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433", message: "A namespace declaration cannot be in a different file from a class or function with which it is merged" }, - A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434", message: "A namespace declaration cannot be located prior to a class or function with which it is merged" }, + A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433", message: "A namespace declaration cannot be in a different file from a class or function with which it is merged." }, + A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: ts.DiagnosticCategory.Error, key: "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434", message: "A namespace declaration cannot be located prior to a class or function with which it is merged." }, Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces: { code: 2435, category: ts.DiagnosticCategory.Error, key: "Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435", message: "Ambient modules cannot be nested in other modules or namespaces." }, Ambient_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: ts.DiagnosticCategory.Error, key: "Ambient_module_declaration_cannot_specify_relative_module_name_2436", message: "Ambient module declaration cannot specify relative module name." }, - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: ts.DiagnosticCategory.Error, key: "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437", message: "Module '{0}' is hidden by a local declaration with the same name" }, - Import_name_cannot_be_0: { code: 2438, category: ts.DiagnosticCategory.Error, key: "Import_name_cannot_be_0_2438", message: "Import name cannot be '{0}'" }, + Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: ts.DiagnosticCategory.Error, key: "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437", message: "Module '{0}' is hidden by a local declaration with the same name." }, + Import_name_cannot_be_0: { code: 2438, category: ts.DiagnosticCategory.Error, key: "Import_name_cannot_be_0_2438", message: "Import name cannot be '{0}'." }, Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name: { code: 2439, category: ts.DiagnosticCategory.Error, key: "Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439", message: "Import or export declaration in an ambient module declaration cannot reference module through relative module name." }, - Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: ts.DiagnosticCategory.Error, key: "Import_declaration_conflicts_with_local_declaration_of_0_2440", message: "Import declaration conflicts with local declaration of '{0}'" }, + Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: ts.DiagnosticCategory.Error, key: "Import_declaration_conflicts_with_local_declaration_of_0_2440", message: "Import declaration conflicts with local declaration of '{0}'." }, Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module: { code: 2441, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441", message: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module." }, Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: ts.DiagnosticCategory.Error, key: "Types_have_separate_declarations_of_a_private_property_0_2442", message: "Types have separate declarations of a private property '{0}'." }, Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: ts.DiagnosticCategory.Error, key: "Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443", message: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, @@ -2769,18 +2792,20 @@ var ts; Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: ts.DiagnosticCategory.Error, key: "Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_2446", message: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: ts.DiagnosticCategory.Error, key: "The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447", message: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: ts.DiagnosticCategory.Error, key: "Block_scoped_variable_0_used_before_its_declaration_2448", message: "Block-scoped variable '{0}' used before its declaration." }, + Class_0_used_before_its_declaration: { code: 2449, category: ts.DiagnosticCategory.Error, key: "Class_0_used_before_its_declaration_2449", message: "Class '{0}' used before its declaration." }, + Enum_0_used_before_its_declaration: { code: 2450, category: ts.DiagnosticCategory.Error, key: "Enum_0_used_before_its_declaration_2450", message: "Enum '{0}' used before its declaration." }, Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_block_scoped_variable_0_2451", message: "Cannot redeclare block-scoped variable '{0}'." }, An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: ts.DiagnosticCategory.Error, key: "An_enum_member_cannot_have_a_numeric_name_2452", message: "An enum member cannot have a numeric name." }, The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: ts.DiagnosticCategory.Error, key: "The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_typ_2453", message: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, Variable_0_is_used_before_being_assigned: { code: 2454, category: ts.DiagnosticCategory.Error, key: "Variable_0_is_used_before_being_assigned_2454", message: "Variable '{0}' is used before being assigned." }, Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: ts.DiagnosticCategory.Error, key: "Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0_2455", message: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, Type_alias_0_circularly_references_itself: { code: 2456, category: ts.DiagnosticCategory.Error, key: "Type_alias_0_circularly_references_itself_2456", message: "Type alias '{0}' circularly references itself." }, - Type_alias_name_cannot_be_0: { code: 2457, category: ts.DiagnosticCategory.Error, key: "Type_alias_name_cannot_be_0_2457", message: "Type alias name cannot be '{0}'" }, + Type_alias_name_cannot_be_0: { code: 2457, category: ts.DiagnosticCategory.Error, key: "Type_alias_name_cannot_be_0_2457", message: "Type alias name cannot be '{0}'." }, An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: ts.DiagnosticCategory.Error, key: "An_AMD_module_cannot_have_multiple_name_assignments_2458", message: "An AMD module cannot have multiple name assignments." }, Type_0_has_no_property_1_and_no_string_index_signature: { code: 2459, category: ts.DiagnosticCategory.Error, key: "Type_0_has_no_property_1_and_no_string_index_signature_2459", message: "Type '{0}' has no property '{1}' and no string index signature." }, Type_0_has_no_property_1: { code: 2460, category: ts.DiagnosticCategory.Error, key: "Type_0_has_no_property_1_2460", message: "Type '{0}' has no property '{1}'." }, Type_0_is_not_an_array_type: { code: 2461, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_2461", message: "Type '{0}' is not an array type." }, - A_rest_element_must_be_last_in_a_destructuring_pattern: { code: 2462, category: ts.DiagnosticCategory.Error, key: "A_rest_element_must_be_last_in_a_destructuring_pattern_2462", message: "A rest element must be last in a destructuring pattern" }, + A_rest_element_must_be_last_in_a_destructuring_pattern: { code: 2462, category: ts.DiagnosticCategory.Error, key: "A_rest_element_must_be_last_in_a_destructuring_pattern_2462", message: "A rest element must be last in a destructuring pattern." }, A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { code: 2463, category: ts.DiagnosticCategory.Error, key: "A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463", message: "A binding pattern parameter cannot be optional in an implementation signature." }, A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { code: 2464, category: ts.DiagnosticCategory.Error, key: "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464", message: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." }, this_cannot_be_referenced_in_a_computed_property_name: { code: 2465, category: ts.DiagnosticCategory.Error, key: "this_cannot_be_referenced_in_a_computed_property_name_2465", message: "'this' cannot be referenced in a computed property name." }, @@ -2801,13 +2826,13 @@ var ts; let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2480, category: ts.DiagnosticCategory.Error, key: "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480", message: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2481, category: ts.DiagnosticCategory.Error, key: "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481", message: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." }, The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { code: 2483, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483", message: "The left-hand side of a 'for...of' statement cannot use a type annotation." }, - Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: ts.DiagnosticCategory.Error, key: "Export_declaration_conflicts_with_exported_declaration_of_0_2484", message: "Export declaration conflicts with exported declaration of '{0}'" }, + Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: ts.DiagnosticCategory.Error, key: "Export_declaration_conflicts_with_exported_declaration_of_0_2484", message: "Export declaration conflicts with exported declaration of '{0}'." }, The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access: { code: 2487, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487", message: "The left-hand side of a 'for...of' statement must be a variable or a property access." }, Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: ts.DiagnosticCategory.Error, key: "Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488", message: "Type must have a '[Symbol.iterator]()' method that returns an iterator." }, An_iterator_must_have_a_next_method: { code: 2489, category: ts.DiagnosticCategory.Error, key: "An_iterator_must_have_a_next_method_2489", message: "An iterator must have a 'next()' method." }, The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { code: 2490, category: ts.DiagnosticCategory.Error, key: "The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property_2490", message: "The type returned by the 'next()' method of an iterator must have a 'value' property." }, The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { code: 2491, category: ts.DiagnosticCategory.Error, key: "The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491", message: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." }, - Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_identifier_0_in_catch_clause_2492", message: "Cannot redeclare identifier '{0}' in catch clause" }, + Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_identifier_0_in_catch_clause_2492", message: "Cannot redeclare identifier '{0}' in catch clause." }, Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { code: 2493, category: ts.DiagnosticCategory.Error, key: "Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2_2493", message: "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'." }, Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { code: 2494, category: ts.DiagnosticCategory.Error, key: "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494", message: "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher." }, Type_0_is_not_an_array_type_or_a_string_type: { code: 2495, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_or_a_string_type_2495", message: "Type '{0}' is not an array type or a string type." }, @@ -2819,6 +2844,7 @@ var ts; A_rest_element_cannot_contain_a_binding_pattern: { code: 2501, category: ts.DiagnosticCategory.Error, key: "A_rest_element_cannot_contain_a_binding_pattern_2501", message: "A rest element cannot contain a binding pattern." }, _0_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 2502, category: ts.DiagnosticCategory.Error, key: "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502", message: "'{0}' is referenced directly or indirectly in its own type annotation." }, Cannot_find_namespace_0: { code: 2503, category: ts.DiagnosticCategory.Error, key: "Cannot_find_namespace_0_2503", message: "Cannot find namespace '{0}'." }, + Type_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator: { code: 2504, category: ts.DiagnosticCategory.Error, key: "Type_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504", message: "Type must have a '[Symbol.asyncIterator]()' method that returns an async iterator." }, A_generator_cannot_have_a_void_type_annotation: { code: 2505, category: ts.DiagnosticCategory.Error, key: "A_generator_cannot_have_a_void_type_annotation_2505", message: "A generator cannot have a 'void' type annotation." }, _0_is_referenced_directly_or_indirectly_in_its_own_base_expression: { code: 2506, category: ts.DiagnosticCategory.Error, key: "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506", message: "'{0}' is referenced directly or indirectly in its own base expression." }, Type_0_is_not_a_constructor_function_type: { code: 2507, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_a_constructor_function_type_2507", message: "Type '{0}' is not a constructor function type." }, @@ -2833,6 +2859,7 @@ var ts; All_declarations_of_an_abstract_method_must_be_consecutive: { code: 2516, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_an_abstract_method_must_be_consecutive_2516", message: "All declarations of an abstract method must be consecutive." }, Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: { code: 2517, category: ts.DiagnosticCategory.Error, key: "Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517", message: "Cannot assign an abstract constructor type to a non-abstract constructor type." }, A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: { code: 2518, category: ts.DiagnosticCategory.Error, key: "A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518", message: "A 'this'-based type guard is not compatible with a parameter-based type guard." }, + An_async_iterator_must_have_a_next_method: { code: 2519, category: ts.DiagnosticCategory.Error, key: "An_async_iterator_must_have_a_next_method_2519", message: "An async iterator must have a 'next()' method." }, Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: { code: 2520, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520", message: "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions." }, Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: { code: 2521, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions_2521", message: "Expression resolves to variable declaration '{0}' that compiler uses to support async functions." }, The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method: { code: 2522, category: ts.DiagnosticCategory.Error, key: "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522", message: "The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method." }, @@ -2856,23 +2883,33 @@ var ts; Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property: { code: 2540, category: ts.DiagnosticCategory.Error, key: "Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property_2540", message: "Cannot assign to '{0}' because it is a constant or a read-only property." }, The_target_of_an_assignment_must_be_a_variable_or_a_property_access: { code: 2541, category: ts.DiagnosticCategory.Error, key: "The_target_of_an_assignment_must_be_a_variable_or_a_property_access_2541", message: "The target of an assignment must be a variable or a property access." }, Index_signature_in_type_0_only_permits_reading: { code: 2542, category: ts.DiagnosticCategory.Error, key: "Index_signature_in_type_0_only_permits_reading_2542", message: "Index signature in type '{0}' only permits reading." }, + Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference: { code: 2543, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543", message: "Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference." }, + Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference: { code: 2544, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544", message: "Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference." }, + A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any: { code: 2545, category: ts.DiagnosticCategory.Error, key: "A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545", message: "A mixin class must have a constructor with a single rest parameter of type 'any[]'." }, + Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1: { code: 2546, category: ts.DiagnosticCategory.Error, key: "Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1_2546", message: "Property '{0}' has conflicting declarations and is inaccessible in type '{1}'." }, + The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property: { code: 2547, category: ts.DiagnosticCategory.Error, key: "The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value__2547", message: "The type returned by the 'next()' method of an async iterator must be a promise for a type with a 'value' property." }, + Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2548, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548", message: "Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator." }, + Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2549, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549", message: "Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator." }, + Generic_type_instantiation_is_excessively_deep_and_possibly_infinite: { code: 2550, category: ts.DiagnosticCategory.Error, key: "Generic_type_instantiation_is_excessively_deep_and_possibly_infinite_2550", message: "Generic type instantiation is excessively deep and possibly infinite." }, JSX_element_attributes_type_0_may_not_be_a_union_type: { code: 2600, category: ts.DiagnosticCategory.Error, key: "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", message: "JSX element attributes type '{0}' may not be a union type." }, The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: { code: 2601, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", message: "The return type of a JSX element constructor must return an object type." }, JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: { code: 2602, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", message: "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist." }, - Property_0_in_type_1_is_not_assignable_to_type_2: { code: 2603, category: ts.DiagnosticCategory.Error, key: "Property_0_in_type_1_is_not_assignable_to_type_2_2603", message: "Property '{0}' in type '{1}' is not assignable to type '{2}'" }, + Property_0_in_type_1_is_not_assignable_to_type_2: { code: 2603, category: ts.DiagnosticCategory.Error, key: "Property_0_in_type_1_is_not_assignable_to_type_2_2603", message: "Property '{0}' in type '{1}' is not assignable to type '{2}'." }, JSX_element_type_0_does_not_have_any_construct_or_call_signatures: { code: 2604, category: ts.DiagnosticCategory.Error, key: "JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604", message: "JSX element type '{0}' does not have any construct or call signatures." }, JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements: { code: 2605, category: ts.DiagnosticCategory.Error, key: "JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements_2605", message: "JSX element type '{0}' is not a constructor function for JSX elements." }, Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property: { code: 2606, category: ts.DiagnosticCategory.Error, key: "Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606", message: "Property '{0}' of JSX spread attribute is not assignable to target property." }, - JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property: { code: 2607, category: ts.DiagnosticCategory.Error, key: "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607", message: "JSX element class does not support attributes because it does not have a '{0}' property" }, - The_global_type_JSX_0_may_not_have_more_than_one_property: { code: 2608, category: ts.DiagnosticCategory.Error, key: "The_global_type_JSX_0_may_not_have_more_than_one_property_2608", message: "The global type 'JSX.{0}' may not have more than one property" }, - Cannot_emit_namespaced_JSX_elements_in_React: { code: 2650, category: ts.DiagnosticCategory.Error, key: "Cannot_emit_namespaced_JSX_elements_in_React_2650", message: "Cannot emit namespaced JSX elements in React" }, + JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property: { code: 2607, category: ts.DiagnosticCategory.Error, key: "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607", message: "JSX element class does not support attributes because it does not have a '{0}' property." }, + The_global_type_JSX_0_may_not_have_more_than_one_property: { code: 2608, category: ts.DiagnosticCategory.Error, key: "The_global_type_JSX_0_may_not_have_more_than_one_property_2608", message: "The global type 'JSX.{0}' may not have more than one property." }, + JSX_spread_child_must_be_an_array_type: { code: 2609, category: ts.DiagnosticCategory.Error, key: "JSX_spread_child_must_be_an_array_type_2609", message: "JSX spread child must be an array type." }, + Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: { code: 2649, category: ts.DiagnosticCategory.Error, key: "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", message: "Cannot augment module '{0}' with value exports because it resolves to a non-module entity." }, + Cannot_emit_namespaced_JSX_elements_in_React: { code: 2650, category: ts.DiagnosticCategory.Error, key: "Cannot_emit_namespaced_JSX_elements_in_React_2650", message: "Cannot emit namespaced JSX elements in React." }, A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: { code: 2651, category: ts.DiagnosticCategory.Error, key: "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", message: "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums." }, Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: { code: 2652, category: ts.DiagnosticCategory.Error, key: "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", message: "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead." }, Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1: { code: 2653, category: ts.DiagnosticCategory.Error, key: "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653", message: "Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'." }, Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_package_author_to_update_the_package_definition: { code: 2654, category: ts.DiagnosticCategory.Error, key: "Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_pack_2654", message: "Exported external package typings file cannot contain tripleslash references. Please contact the package author to update the package definition." }, Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition: { code: 2656, category: ts.DiagnosticCategory.Error, key: "Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_2656", message: "Exported external package typings file '{0}' is not a module. Please contact the package author to update the package definition." }, - JSX_expressions_must_have_one_parent_element: { code: 2657, category: ts.DiagnosticCategory.Error, key: "JSX_expressions_must_have_one_parent_element_2657", message: "JSX expressions must have one parent element" }, - Type_0_provides_no_match_for_the_signature_1: { code: 2658, category: ts.DiagnosticCategory.Error, key: "Type_0_provides_no_match_for_the_signature_1_2658", message: "Type '{0}' provides no match for the signature '{1}'" }, + JSX_expressions_must_have_one_parent_element: { code: 2657, category: ts.DiagnosticCategory.Error, key: "JSX_expressions_must_have_one_parent_element_2657", message: "JSX expressions must have one parent element." }, + Type_0_provides_no_match_for_the_signature_1: { code: 2658, category: ts.DiagnosticCategory.Error, key: "Type_0_provides_no_match_for_the_signature_1_2658", message: "Type '{0}' provides no match for the signature '{1}'." }, super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: { code: 2659, category: ts.DiagnosticCategory.Error, key: "super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659", message: "'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher." }, super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: { code: 2660, category: ts.DiagnosticCategory.Error, key: "super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660", message: "'super' can only be referenced in members of derived classes or object literal expressions." }, Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module: { code: 2661, category: ts.DiagnosticCategory.Error, key: "Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661", message: "Cannot export '{0}'. Only local declarations can be exported from a module." }, @@ -2904,7 +2941,6 @@ var ts; All_declarations_of_0_must_have_identical_modifiers: { code: 2687, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_0_must_have_identical_modifiers_2687", message: "All declarations of '{0}' must have identical modifiers." }, Cannot_find_type_definition_file_for_0: { code: 2688, category: ts.DiagnosticCategory.Error, key: "Cannot_find_type_definition_file_for_0_2688", message: "Cannot find type definition file for '{0}'." }, Cannot_extend_an_interface_0_Did_you_mean_implements: { code: 2689, category: ts.DiagnosticCategory.Error, key: "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", message: "Cannot extend an interface '{0}'. Did you mean 'implements'?" }, - A_class_must_be_declared_after_its_base_class: { code: 2690, category: ts.DiagnosticCategory.Error, key: "A_class_must_be_declared_after_its_base_class_2690", message: "A class must be declared after its base class." }, An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: { code: 2691, category: ts.DiagnosticCategory.Error, key: "An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691", message: "An import path cannot end with a '{0}' extension. Consider importing '{1}' instead." }, _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: { code: 2692, category: ts.DiagnosticCategory.Error, key: "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", message: "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible." }, _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: { code: 2693, category: ts.DiagnosticCategory.Error, key: "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", message: "'{0}' only refers to a type, but is being used as a value here." }, @@ -2913,9 +2949,17 @@ var ts; The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead: { code: 2696, category: ts.DiagnosticCategory.Error, key: "The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696", message: "The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?" }, An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: { code: 2697, category: ts.DiagnosticCategory.Error, key: "An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697", message: "An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your `--lib` option." }, Spread_types_may_only_be_created_from_object_types: { code: 2698, category: ts.DiagnosticCategory.Error, key: "Spread_types_may_only_be_created_from_object_types_2698", message: "Spread types may only be created from object types." }, + Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1: { code: 2699, category: ts.DiagnosticCategory.Error, key: "Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699", message: "Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'." }, Rest_types_may_only_be_created_from_object_types: { code: 2700, category: ts.DiagnosticCategory.Error, key: "Rest_types_may_only_be_created_from_object_types_2700", message: "Rest types may only be created from object types." }, The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access: { code: 2701, category: ts.DiagnosticCategory.Error, key: "The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701", message: "The target of an object rest assignment must be a variable or a property access." }, _0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here: { code: 2702, category: ts.DiagnosticCategory.Error, key: "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702", message: "'{0}' only refers to a type, but is being used as a namespace here." }, + The_operand_of_a_delete_operator_must_be_a_property_reference: { code: 2703, category: ts.DiagnosticCategory.Error, key: "The_operand_of_a_delete_operator_must_be_a_property_reference_2703", message: "The operand of a delete operator must be a property reference." }, + The_operand_of_a_delete_operator_cannot_be_a_read_only_property: { code: 2704, category: ts.DiagnosticCategory.Error, key: "The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704", message: "The operand of a delete operator cannot be a read-only property." }, + An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: { code: 2705, category: ts.DiagnosticCategory.Error, key: "An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705", message: "An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option." }, + Required_type_parameters_may_not_follow_optional_type_parameters: { code: 2706, category: ts.DiagnosticCategory.Error, key: "Required_type_parameters_may_not_follow_optional_type_parameters_2706", message: "Required type parameters may not follow optional type parameters." }, + Generic_type_0_requires_between_1_and_2_type_arguments: { code: 2707, category: ts.DiagnosticCategory.Error, key: "Generic_type_0_requires_between_1_and_2_type_arguments_2707", message: "Generic type '{0}' requires between {1} and {2} type arguments." }, + Cannot_use_namespace_0_as_a_value: { code: 2708, category: ts.DiagnosticCategory.Error, key: "Cannot_use_namespace_0_as_a_value_2708", message: "Cannot use namespace '{0}' as a value." }, + Cannot_use_namespace_0_as_a_type: { code: 2709, category: ts.DiagnosticCategory.Error, key: "Cannot_use_namespace_0_as_a_type_2709", message: "Cannot use namespace '{0}' as a type." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "Import_declaration_0_is_using_private_name_1_4000", message: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", message: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", message: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, @@ -2926,8 +2970,8 @@ var ts; Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014", message: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016", message: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: ts.DiagnosticCategory.Error, key: "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019", message: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: ts.DiagnosticCategory.Error, key: "Extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020", message: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: ts.DiagnosticCategory.Error, key: "Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022", message: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, + extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: ts.DiagnosticCategory.Error, key: "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020", message: "'extends' clause of exported class '{0}' has or is using private name '{1}'." }, + extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: ts.DiagnosticCategory.Error, key: "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022", message: "'extends' clause of exported interface '{0}' has or is using private name '{1}'." }, Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: ts.DiagnosticCategory.Error, key: "Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023", message: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: ts.DiagnosticCategory.Error, key: "Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024", message: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: ts.DiagnosticCategory.Error, key: "Exported_variable_0_has_or_is_using_private_name_1_4025", message: "Exported variable '{0}' has or is using private name '{1}'." }, @@ -2988,16 +3032,18 @@ var ts; Default_export_of_the_module_has_or_is_using_private_name_0: { code: 4082, category: ts.DiagnosticCategory.Error, key: "Default_export_of_the_module_has_or_is_using_private_name_0_4082", message: "Default export of the module has or is using private name '{0}'." }, Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: { code: 4083, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", message: "Type parameter '{0}' of exported type alias has or is using private name '{1}'." }, Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: { code: 4090, category: ts.DiagnosticCategory.Message, key: "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", message: "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict." }, + Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4091, category: ts.DiagnosticCategory.Error, key: "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", message: "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4092, category: ts.DiagnosticCategory.Error, key: "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", message: "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'." }, + extends_clause_of_exported_class_0_refers_to_a_type_whose_name_cannot_be_referenced: { code: 4093, category: ts.DiagnosticCategory.Error, key: "extends_clause_of_exported_class_0_refers_to_a_type_whose_name_cannot_be_referenced_4093", message: "'extends' clause of exported class '{0}' refers to a type whose name cannot be referenced." }, The_current_host_does_not_support_the_0_option: { code: 5001, category: ts.DiagnosticCategory.Error, key: "The_current_host_does_not_support_the_0_option_5001", message: "The current host does not support the '{0}' option." }, Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: ts.DiagnosticCategory.Error, key: "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", message: "Cannot find the common subdirectory path for the input files." }, File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: { code: 5010, category: ts.DiagnosticCategory.Error, key: "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", message: "File specification cannot end in a recursive directory wildcard ('**'): '{0}'." }, File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0: { code: 5011, category: ts.DiagnosticCategory.Error, key: "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011", message: "File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'." }, - Cannot_read_file_0_Colon_1: { code: 5012, category: ts.DiagnosticCategory.Error, key: "Cannot_read_file_0_Colon_1_5012", message: "Cannot read file '{0}': {1}" }, - Unsupported_file_encoding: { code: 5013, category: ts.DiagnosticCategory.Error, key: "Unsupported_file_encoding_5013", message: "Unsupported file encoding." }, + Cannot_read_file_0_Colon_1: { code: 5012, category: ts.DiagnosticCategory.Error, key: "Cannot_read_file_0_Colon_1_5012", message: "Cannot read file '{0}': {1}." }, Failed_to_parse_file_0_Colon_1: { code: 5014, category: ts.DiagnosticCategory.Error, key: "Failed_to_parse_file_0_Colon_1_5014", message: "Failed to parse file '{0}': {1}." }, Unknown_compiler_option_0: { code: 5023, category: ts.DiagnosticCategory.Error, key: "Unknown_compiler_option_0_5023", message: "Unknown compiler option '{0}'." }, Compiler_option_0_requires_a_value_of_type_1: { code: 5024, category: ts.DiagnosticCategory.Error, key: "Compiler_option_0_requires_a_value_of_type_1_5024", message: "Compiler option '{0}' requires a value of type {1}." }, - Could_not_write_file_0_Colon_1: { code: 5033, category: ts.DiagnosticCategory.Error, key: "Could_not_write_file_0_Colon_1_5033", message: "Could not write file '{0}': {1}" }, + Could_not_write_file_0_Colon_1: { code: 5033, category: ts.DiagnosticCategory.Error, key: "Could_not_write_file_0_Colon_1_5033", message: "Could not write file '{0}': {1}." }, Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: ts.DiagnosticCategory.Error, key: "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042", message: "Option 'project' cannot be mixed with source files on a command line." }, Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher: { code: 5047, category: ts.DiagnosticCategory.Error, key: "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047", message: "Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher." }, Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: { code: 5051, category: ts.DiagnosticCategory.Error, key: "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051", message: "Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided." }, @@ -3006,12 +3052,12 @@ var ts; A_tsconfig_json_file_is_already_defined_at_Colon_0: { code: 5054, category: ts.DiagnosticCategory.Error, key: "A_tsconfig_json_file_is_already_defined_at_Colon_0_5054", message: "A 'tsconfig.json' file is already defined at: '{0}'." }, Cannot_write_file_0_because_it_would_overwrite_input_file: { code: 5055, category: ts.DiagnosticCategory.Error, key: "Cannot_write_file_0_because_it_would_overwrite_input_file_5055", message: "Cannot write file '{0}' because it would overwrite input file." }, Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files: { code: 5056, category: ts.DiagnosticCategory.Error, key: "Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056", message: "Cannot write file '{0}' because it would be overwritten by multiple input files." }, - Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: { code: 5057, category: ts.DiagnosticCategory.Error, key: "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", message: "Cannot find a tsconfig.json file at the specified directory: '{0}'" }, - The_specified_path_does_not_exist_Colon_0: { code: 5058, category: ts.DiagnosticCategory.Error, key: "The_specified_path_does_not_exist_Colon_0_5058", message: "The specified path does not exist: '{0}'" }, + Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: { code: 5057, category: ts.DiagnosticCategory.Error, key: "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", message: "Cannot find a tsconfig.json file at the specified directory: '{0}'." }, + The_specified_path_does_not_exist_Colon_0: { code: 5058, category: ts.DiagnosticCategory.Error, key: "The_specified_path_does_not_exist_Colon_0_5058", message: "The specified path does not exist: '{0}'." }, Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: { code: 5059, category: ts.DiagnosticCategory.Error, key: "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", message: "Invalid value for '--reactNamespace'. '{0}' is not a valid identifier." }, Option_paths_cannot_be_used_without_specifying_baseUrl_option: { code: 5060, category: ts.DiagnosticCategory.Error, key: "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060", message: "Option 'paths' cannot be used without specifying '--baseUrl' option." }, - Pattern_0_can_have_at_most_one_Asterisk_character: { code: 5061, category: ts.DiagnosticCategory.Error, key: "Pattern_0_can_have_at_most_one_Asterisk_character_5061", message: "Pattern '{0}' can have at most one '*' character" }, - Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character: { code: 5062, category: ts.DiagnosticCategory.Error, key: "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062", message: "Substitution '{0}' in pattern '{1}' in can have at most one '*' character" }, + Pattern_0_can_have_at_most_one_Asterisk_character: { code: 5061, category: ts.DiagnosticCategory.Error, key: "Pattern_0_can_have_at_most_one_Asterisk_character_5061", message: "Pattern '{0}' can have at most one '*' character." }, + Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character: { code: 5062, category: ts.DiagnosticCategory.Error, key: "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062", message: "Substitution '{0}' in pattern '{1}' in can have at most one '*' character." }, Substitutions_for_pattern_0_should_be_an_array: { code: 5063, category: ts.DiagnosticCategory.Error, key: "Substitutions_for_pattern_0_should_be_an_array_5063", message: "Substitutions for pattern '{0}' should be an array." }, Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2: { code: 5064, category: ts.DiagnosticCategory.Error, key: "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064", message: "Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'." }, File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: { code: 5065, category: ts.DiagnosticCategory.Error, key: "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065", message: "File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'." }, @@ -3029,11 +3075,11 @@ var ts; Do_not_emit_outputs: { code: 6010, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_outputs_6010", message: "Do not emit outputs." }, Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: { code: 6011, category: ts.DiagnosticCategory.Message, key: "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", message: "Allow default imports from modules with no default export. This does not affect code emit, just typechecking." }, Skip_type_checking_of_declaration_files: { code: 6012, category: ts.DiagnosticCategory.Message, key: "Skip_type_checking_of_declaration_files_6012", message: "Skip type checking of declaration files." }, - Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015_6015", message: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES2015'" }, - Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015_6016", message: "Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'" }, + Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015", message: "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'." }, + Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015_6016", message: "Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'." }, Print_this_message: { code: 6017, category: ts.DiagnosticCategory.Message, key: "Print_this_message_6017", message: "Print this message." }, Print_the_compiler_s_version: { code: 6019, category: ts.DiagnosticCategory.Message, key: "Print_the_compiler_s_version_6019", message: "Print the compiler's version." }, - Compile_the_project_in_the_given_directory: { code: 6020, category: ts.DiagnosticCategory.Message, key: "Compile_the_project_in_the_given_directory_6020", message: "Compile the project in the given directory." }, + Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json: { code: 6020, category: ts.DiagnosticCategory.Message, key: "Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020", message: "Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'." }, Syntax_Colon_0: { code: 6023, category: ts.DiagnosticCategory.Message, key: "Syntax_Colon_0_6023", message: "Syntax: {0}" }, options: { code: 6024, category: ts.DiagnosticCategory.Message, key: "options_6024", message: "options" }, file: { code: 6025, category: ts.DiagnosticCategory.Message, key: "file_6025", message: "file" }, @@ -3048,11 +3094,12 @@ var ts; LOCATION: { code: 6037, category: ts.DiagnosticCategory.Message, key: "LOCATION_6037", message: "LOCATION" }, DIRECTORY: { code: 6038, category: ts.DiagnosticCategory.Message, key: "DIRECTORY_6038", message: "DIRECTORY" }, STRATEGY: { code: 6039, category: ts.DiagnosticCategory.Message, key: "STRATEGY_6039", message: "STRATEGY" }, + FILE_OR_DIRECTORY: { code: 6040, category: ts.DiagnosticCategory.Message, key: "FILE_OR_DIRECTORY_6040", message: "FILE OR DIRECTORY" }, Compilation_complete_Watching_for_file_changes: { code: 6042, category: ts.DiagnosticCategory.Message, key: "Compilation_complete_Watching_for_file_changes_6042", message: "Compilation complete. Watching for file changes." }, Generates_corresponding_map_file: { code: 6043, category: ts.DiagnosticCategory.Message, key: "Generates_corresponding_map_file_6043", message: "Generates corresponding '.map' file." }, Compiler_option_0_expects_an_argument: { code: 6044, category: ts.DiagnosticCategory.Error, key: "Compiler_option_0_expects_an_argument_6044", message: "Compiler option '{0}' expects an argument." }, Unterminated_quoted_string_in_response_file_0: { code: 6045, category: ts.DiagnosticCategory.Error, key: "Unterminated_quoted_string_in_response_file_0_6045", message: "Unterminated quoted string in response file '{0}'." }, - Argument_for_0_option_must_be_Colon_1: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument_for_0_option_must_be_Colon_1_6046", message: "Argument for '{0}' option must be: {1}" }, + Argument_for_0_option_must_be_Colon_1: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument_for_0_option_must_be_Colon_1_6046", message: "Argument for '{0}' option must be: {1}." }, Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: ts.DiagnosticCategory.Error, key: "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048", message: "Locale must be of the form or -. For example '{0}' or '{1}'." }, Unsupported_locale_0: { code: 6049, category: ts.DiagnosticCategory.Error, key: "Unsupported_locale_0_6049", message: "Unsupported locale '{0}'." }, Unable_to_open_file_0: { code: 6050, category: ts.DiagnosticCategory.Error, key: "Unable_to_open_file_0_6050", message: "Unable to open file '{0}'." }, @@ -3074,17 +3121,18 @@ var ts; Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file: { code: 6070, category: ts.DiagnosticCategory.Message, key: "Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070", message: "Initializes a TypeScript project and creates a tsconfig.json file." }, Successfully_created_a_tsconfig_json_file: { code: 6071, category: ts.DiagnosticCategory.Message, key: "Successfully_created_a_tsconfig_json_file_6071", message: "Successfully created a tsconfig.json file." }, Suppress_excess_property_checks_for_object_literals: { code: 6072, category: ts.DiagnosticCategory.Message, key: "Suppress_excess_property_checks_for_object_literals_6072", message: "Suppress excess property checks for object literals." }, - Stylize_errors_and_messages_using_color_and_context_experimental: { code: 6073, category: ts.DiagnosticCategory.Message, key: "Stylize_errors_and_messages_using_color_and_context_experimental_6073", message: "Stylize errors and messages using color and context. (experimental)" }, + Stylize_errors_and_messages_using_color_and_context_experimental: { code: 6073, category: ts.DiagnosticCategory.Message, key: "Stylize_errors_and_messages_using_color_and_context_experimental_6073", message: "Stylize errors and messages using color and context (experimental)." }, Do_not_report_errors_on_unused_labels: { code: 6074, category: ts.DiagnosticCategory.Message, key: "Do_not_report_errors_on_unused_labels_6074", message: "Do not report errors on unused labels." }, Report_error_when_not_all_code_paths_in_function_return_a_value: { code: 6075, category: ts.DiagnosticCategory.Message, key: "Report_error_when_not_all_code_paths_in_function_return_a_value_6075", message: "Report error when not all code paths in function return a value." }, Report_errors_for_fallthrough_cases_in_switch_statement: { code: 6076, category: ts.DiagnosticCategory.Message, key: "Report_errors_for_fallthrough_cases_in_switch_statement_6076", message: "Report errors for fallthrough cases in switch statement." }, Do_not_report_errors_on_unreachable_code: { code: 6077, category: ts.DiagnosticCategory.Message, key: "Do_not_report_errors_on_unreachable_code_6077", message: "Do not report errors on unreachable code." }, Disallow_inconsistently_cased_references_to_the_same_file: { code: 6078, category: ts.DiagnosticCategory.Message, key: "Disallow_inconsistently_cased_references_to_the_same_file_6078", message: "Disallow inconsistently-cased references to the same file." }, Specify_library_files_to_be_included_in_the_compilation_Colon: { code: 6079, category: ts.DiagnosticCategory.Message, key: "Specify_library_files_to_be_included_in_the_compilation_Colon_6079", message: "Specify library files to be included in the compilation: " }, - Specify_JSX_code_generation_Colon_preserve_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify_JSX_code_generation_Colon_preserve_or_react_6080", message: "Specify JSX code generation: 'preserve' or 'react'" }, + Specify_JSX_code_generation_Colon_preserve_react_native_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080", message: "Specify JSX code generation: 'preserve', 'react-native', or 'react'." }, + File_0_has_an_unsupported_extension_so_skipping_it: { code: 6081, category: ts.DiagnosticCategory.Message, key: "File_0_has_an_unsupported_extension_so_skipping_it_6081", message: "File '{0}' has an unsupported extension, so skipping it." }, Only_amd_and_system_modules_are_supported_alongside_0: { code: 6082, category: ts.DiagnosticCategory.Error, key: "Only_amd_and_system_modules_are_supported_alongside_0_6082", message: "Only 'amd' and 'system' modules are supported alongside --{0}." }, Base_directory_to_resolve_non_absolute_module_names: { code: 6083, category: ts.DiagnosticCategory.Message, key: "Base_directory_to_resolve_non_absolute_module_names_6083", message: "Base directory to resolve non-absolute module names." }, - Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit: { code: 6084, category: ts.DiagnosticCategory.Message, key: "Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit_6084", message: "Specify the object invoked for createElement and __spread when targeting 'react' JSX emit" }, + Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit: { code: 6084, category: ts.DiagnosticCategory.Message, key: "Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084", message: "[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit" }, Enable_tracing_of_the_name_resolution_process: { code: 6085, category: ts.DiagnosticCategory.Message, key: "Enable_tracing_of_the_name_resolution_process_6085", message: "Enable tracing of the name resolution process." }, Resolving_module_0_from_1: { code: 6086, category: ts.DiagnosticCategory.Message, key: "Resolving_module_0_from_1_6086", message: "======== Resolving module '{0}' from '{1}'. ========" }, Explicitly_specified_module_resolution_kind_Colon_0: { code: 6087, category: ts.DiagnosticCategory.Message, key: "Explicitly_specified_module_resolution_kind_Colon_0_6087", message: "Explicitly specified module resolution kind: '{0}'." }, @@ -3095,23 +3143,23 @@ var ts; Module_name_0_matched_pattern_1: { code: 6092, category: ts.DiagnosticCategory.Message, key: "Module_name_0_matched_pattern_1_6092", message: "Module name '{0}', matched pattern '{1}'." }, Trying_substitution_0_candidate_module_location_Colon_1: { code: 6093, category: ts.DiagnosticCategory.Message, key: "Trying_substitution_0_candidate_module_location_Colon_1_6093", message: "Trying substitution '{0}', candidate module location: '{1}'." }, Resolving_module_name_0_relative_to_base_url_1_2: { code: 6094, category: ts.DiagnosticCategory.Message, key: "Resolving_module_name_0_relative_to_base_url_1_2_6094", message: "Resolving module name '{0}' relative to base url '{1}' - '{2}'." }, - Loading_module_as_file_Slash_folder_candidate_module_location_0: { code: 6095, category: ts.DiagnosticCategory.Message, key: "Loading_module_as_file_Slash_folder_candidate_module_location_0_6095", message: "Loading module as file / folder, candidate module location '{0}'." }, + Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1: { code: 6095, category: ts.DiagnosticCategory.Message, key: "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1_6095", message: "Loading module as file / folder, candidate module location '{0}', target file type '{1}'." }, File_0_does_not_exist: { code: 6096, category: ts.DiagnosticCategory.Message, key: "File_0_does_not_exist_6096", message: "File '{0}' does not exist." }, File_0_exist_use_it_as_a_name_resolution_result: { code: 6097, category: ts.DiagnosticCategory.Message, key: "File_0_exist_use_it_as_a_name_resolution_result_6097", message: "File '{0}' exist - use it as a name resolution result." }, - Loading_module_0_from_node_modules_folder: { code: 6098, category: ts.DiagnosticCategory.Message, key: "Loading_module_0_from_node_modules_folder_6098", message: "Loading module '{0}' from 'node_modules' folder." }, + Loading_module_0_from_node_modules_folder_target_file_type_1: { code: 6098, category: ts.DiagnosticCategory.Message, key: "Loading_module_0_from_node_modules_folder_target_file_type_1_6098", message: "Loading module '{0}' from 'node_modules' folder, target file type '{1}'." }, Found_package_json_at_0: { code: 6099, category: ts.DiagnosticCategory.Message, key: "Found_package_json_at_0_6099", message: "Found 'package.json' at '{0}'." }, - package_json_does_not_have_a_types_or_main_field: { code: 6100, category: ts.DiagnosticCategory.Message, key: "package_json_does_not_have_a_types_or_main_field_6100", message: "'package.json' does not have a 'types' or 'main' field." }, + package_json_does_not_have_a_0_field: { code: 6100, category: ts.DiagnosticCategory.Message, key: "package_json_does_not_have_a_0_field_6100", message: "'package.json' does not have a '{0}' field." }, package_json_has_0_field_1_that_references_2: { code: 6101, category: ts.DiagnosticCategory.Message, key: "package_json_has_0_field_1_that_references_2_6101", message: "'package.json' has '{0}' field '{1}' that references '{2}'." }, Allow_javascript_files_to_be_compiled: { code: 6102, category: ts.DiagnosticCategory.Message, key: "Allow_javascript_files_to_be_compiled_6102", message: "Allow javascript files to be compiled." }, Option_0_should_have_array_of_strings_as_a_value: { code: 6103, category: ts.DiagnosticCategory.Error, key: "Option_0_should_have_array_of_strings_as_a_value_6103", message: "Option '{0}' should have array of strings as a value." }, Checking_if_0_is_the_longest_matching_prefix_for_1_2: { code: 6104, category: ts.DiagnosticCategory.Message, key: "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104", message: "Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'." }, Expected_type_of_0_field_in_package_json_to_be_string_got_1: { code: 6105, category: ts.DiagnosticCategory.Message, key: "Expected_type_of_0_field_in_package_json_to_be_string_got_1_6105", message: "Expected type of '{0}' field in 'package.json' to be 'string', got '{1}'." }, - baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1: { code: 6106, category: ts.DiagnosticCategory.Message, key: "baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106", message: "'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'" }, - rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0: { code: 6107, category: ts.DiagnosticCategory.Message, key: "rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107", message: "'rootDirs' option is set, using it to resolve relative module name '{0}'" }, - Longest_matching_prefix_for_0_is_1: { code: 6108, category: ts.DiagnosticCategory.Message, key: "Longest_matching_prefix_for_0_is_1_6108", message: "Longest matching prefix for '{0}' is '{1}'" }, - Loading_0_from_the_root_dir_1_candidate_location_2: { code: 6109, category: ts.DiagnosticCategory.Message, key: "Loading_0_from_the_root_dir_1_candidate_location_2_6109", message: "Loading '{0}' from the root dir '{1}', candidate location '{2}'" }, - Trying_other_entries_in_rootDirs: { code: 6110, category: ts.DiagnosticCategory.Message, key: "Trying_other_entries_in_rootDirs_6110", message: "Trying other entries in 'rootDirs'" }, - Module_resolution_using_rootDirs_has_failed: { code: 6111, category: ts.DiagnosticCategory.Message, key: "Module_resolution_using_rootDirs_has_failed_6111", message: "Module resolution using 'rootDirs' has failed" }, + baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1: { code: 6106, category: ts.DiagnosticCategory.Message, key: "baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106", message: "'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'." }, + rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0: { code: 6107, category: ts.DiagnosticCategory.Message, key: "rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107", message: "'rootDirs' option is set, using it to resolve relative module name '{0}'." }, + Longest_matching_prefix_for_0_is_1: { code: 6108, category: ts.DiagnosticCategory.Message, key: "Longest_matching_prefix_for_0_is_1_6108", message: "Longest matching prefix for '{0}' is '{1}'." }, + Loading_0_from_the_root_dir_1_candidate_location_2: { code: 6109, category: ts.DiagnosticCategory.Message, key: "Loading_0_from_the_root_dir_1_candidate_location_2_6109", message: "Loading '{0}' from the root dir '{1}', candidate location '{2}'." }, + Trying_other_entries_in_rootDirs: { code: 6110, category: ts.DiagnosticCategory.Message, key: "Trying_other_entries_in_rootDirs_6110", message: "Trying other entries in 'rootDirs'." }, + Module_resolution_using_rootDirs_has_failed: { code: 6111, category: ts.DiagnosticCategory.Message, key: "Module_resolution_using_rootDirs_has_failed_6111", message: "Module resolution using 'rootDirs' has failed." }, Do_not_emit_use_strict_directives_in_module_output: { code: 6112, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_use_strict_directives_in_module_output_6112", message: "Do not emit 'use strict' directives in module output." }, Enable_strict_null_checks: { code: 6113, category: ts.DiagnosticCategory.Message, key: "Enable_strict_null_checks_6113", message: "Enable strict null checks." }, Unknown_option_excludes_Did_you_mean_exclude: { code: 6114, category: ts.DiagnosticCategory.Error, key: "Unknown_option_excludes_Did_you_mean_exclude_6114", message: "Unknown option 'excludes'. Did you mean 'exclude'?" }, @@ -3121,32 +3169,67 @@ var ts; Resolving_from_node_modules_folder: { code: 6118, category: ts.DiagnosticCategory.Message, key: "Resolving_from_node_modules_folder_6118", message: "Resolving from node_modules folder..." }, Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2: { code: 6119, category: ts.DiagnosticCategory.Message, key: "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119", message: "======== Type reference directive '{0}' was successfully resolved to '{1}', primary: {2}. ========" }, Type_reference_directive_0_was_not_resolved: { code: 6120, category: ts.DiagnosticCategory.Message, key: "Type_reference_directive_0_was_not_resolved_6120", message: "======== Type reference directive '{0}' was not resolved. ========" }, - Resolving_with_primary_search_path_0: { code: 6121, category: ts.DiagnosticCategory.Message, key: "Resolving_with_primary_search_path_0_6121", message: "Resolving with primary search path '{0}'" }, + Resolving_with_primary_search_path_0: { code: 6121, category: ts.DiagnosticCategory.Message, key: "Resolving_with_primary_search_path_0_6121", message: "Resolving with primary search path '{0}'." }, Root_directory_cannot_be_determined_skipping_primary_search_paths: { code: 6122, category: ts.DiagnosticCategory.Message, key: "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122", message: "Root directory cannot be determined, skipping primary search paths." }, Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set: { code: 6123, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123", message: "======== Resolving type reference directive '{0}', containing file '{1}', root directory not set. ========" }, Type_declaration_files_to_be_included_in_compilation: { code: 6124, category: ts.DiagnosticCategory.Message, key: "Type_declaration_files_to_be_included_in_compilation_6124", message: "Type declaration files to be included in compilation." }, - Looking_up_in_node_modules_folder_initial_location_0: { code: 6125, category: ts.DiagnosticCategory.Message, key: "Looking_up_in_node_modules_folder_initial_location_0_6125", message: "Looking up in 'node_modules' folder, initial location '{0}'" }, + Looking_up_in_node_modules_folder_initial_location_0: { code: 6125, category: ts.DiagnosticCategory.Message, key: "Looking_up_in_node_modules_folder_initial_location_0_6125", message: "Looking up in 'node_modules' folder, initial location '{0}'." }, Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder: { code: 6126, category: ts.DiagnosticCategory.Message, key: "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126", message: "Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder." }, Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1: { code: 6127, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127", message: "======== Resolving type reference directive '{0}', containing file not set, root directory '{1}'. ========" }, Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set: { code: 6128, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128", message: "======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========" }, The_config_file_0_found_doesn_t_contain_any_source_files: { code: 6129, category: ts.DiagnosticCategory.Error, key: "The_config_file_0_found_doesn_t_contain_any_source_files_6129", message: "The config file '{0}' found doesn't contain any source files." }, - Resolving_real_path_for_0_result_1: { code: 6130, category: ts.DiagnosticCategory.Message, key: "Resolving_real_path_for_0_result_1_6130", message: "Resolving real path for '{0}', result '{1}'" }, + Resolving_real_path_for_0_result_1: { code: 6130, category: ts.DiagnosticCategory.Message, key: "Resolving_real_path_for_0_result_1_6130", message: "Resolving real path for '{0}', result '{1}'." }, Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system: { code: 6131, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131", message: "Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'." }, - File_name_0_has_a_1_extension_stripping_it: { code: 6132, category: ts.DiagnosticCategory.Message, key: "File_name_0_has_a_1_extension_stripping_it_6132", message: "File name '{0}' has a '{1}' extension - stripping it" }, + File_name_0_has_a_1_extension_stripping_it: { code: 6132, category: ts.DiagnosticCategory.Message, key: "File_name_0_has_a_1_extension_stripping_it_6132", message: "File name '{0}' has a '{1}' extension - stripping it." }, _0_is_declared_but_never_used: { code: 6133, category: ts.DiagnosticCategory.Error, key: "_0_is_declared_but_never_used_6133", message: "'{0}' is declared but never used." }, Report_errors_on_unused_locals: { code: 6134, category: ts.DiagnosticCategory.Message, key: "Report_errors_on_unused_locals_6134", message: "Report errors on unused locals." }, Report_errors_on_unused_parameters: { code: 6135, category: ts.DiagnosticCategory.Message, key: "Report_errors_on_unused_parameters_6135", message: "Report errors on unused parameters." }, - The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files: { code: 6136, category: ts.DiagnosticCategory.Message, key: "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136", message: "The maximum dependency depth to search under node_modules and load JavaScript files" }, - No_types_specified_in_package_json_so_returning_main_value_of_0: { code: 6137, category: ts.DiagnosticCategory.Message, key: "No_types_specified_in_package_json_so_returning_main_value_of_0_6137", message: "No types specified in 'package.json', so returning 'main' value of '{0}'" }, + The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files: { code: 6136, category: ts.DiagnosticCategory.Message, key: "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136", message: "The maximum dependency depth to search under node_modules and load JavaScript files." }, Property_0_is_declared_but_never_used: { code: 6138, category: ts.DiagnosticCategory.Error, key: "Property_0_is_declared_but_never_used_6138", message: "Property '{0}' is declared but never used." }, Import_emit_helpers_from_tslib: { code: 6139, category: ts.DiagnosticCategory.Message, key: "Import_emit_helpers_from_tslib_6139", message: "Import emit helpers from 'tslib'." }, Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2: { code: 6140, category: ts.DiagnosticCategory.Error, key: "Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140", message: "Auto discovery for typings is enabled in project '{0}'. Running extra resolution pass for module '{1}' using cache location '{2}'." }, - Parse_in_strict_mode_and_emit_use_strict_for_each_source_file: { code: 6141, category: ts.DiagnosticCategory.Message, key: "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141", message: "Parse in strict mode and emit \"use strict\" for each source file" }, + Parse_in_strict_mode_and_emit_use_strict_for_each_source_file: { code: 6141, category: ts.DiagnosticCategory.Message, key: "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141", message: "Parse in strict mode and emit \"use strict\" for each source file." }, Module_0_was_resolved_to_1_but_jsx_is_not_set: { code: 6142, category: ts.DiagnosticCategory.Error, key: "Module_0_was_resolved_to_1_but_jsx_is_not_set_6142", message: "Module '{0}' was resolved to '{1}', but '--jsx' is not set." }, Module_0_was_resolved_to_1_but_allowJs_is_not_set: { code: 6143, category: ts.DiagnosticCategory.Error, key: "Module_0_was_resolved_to_1_but_allowJs_is_not_set_6143", message: "Module '{0}' was resolved to '{1}', but '--allowJs' is not set." }, Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1: { code: 6144, category: ts.DiagnosticCategory.Message, key: "Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144", message: "Module '{0}' was resolved as locally declared ambient module in file '{1}'." }, Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified: { code: 6145, category: ts.DiagnosticCategory.Message, key: "Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified_6145", message: "Module '{0}' was resolved as ambient module declared in '{1}' since this file was not modified." }, Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h: { code: 6146, category: ts.DiagnosticCategory.Message, key: "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146", message: "Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'." }, + Resolution_for_module_0_was_found_in_cache: { code: 6147, category: ts.DiagnosticCategory.Message, key: "Resolution_for_module_0_was_found_in_cache_6147", message: "Resolution for module '{0}' was found in cache." }, + Directory_0_does_not_exist_skipping_all_lookups_in_it: { code: 6148, category: ts.DiagnosticCategory.Message, key: "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148", message: "Directory '{0}' does not exist, skipping all lookups in it." }, + Show_diagnostic_information: { code: 6149, category: ts.DiagnosticCategory.Message, key: "Show_diagnostic_information_6149", message: "Show diagnostic information." }, + Show_verbose_diagnostic_information: { code: 6150, category: ts.DiagnosticCategory.Message, key: "Show_verbose_diagnostic_information_6150", message: "Show verbose diagnostic information." }, + Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file: { code: 6151, category: ts.DiagnosticCategory.Message, key: "Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151", message: "Emit a single file with source maps instead of having a separate file." }, + Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set: { code: 6152, category: ts.DiagnosticCategory.Message, key: "Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152", message: "Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set." }, + Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule: { code: 6153, category: ts.DiagnosticCategory.Message, key: "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153", message: "Transpile each file as a separate module (similar to 'ts.transpileModule')." }, + Print_names_of_generated_files_part_of_the_compilation: { code: 6154, category: ts.DiagnosticCategory.Message, key: "Print_names_of_generated_files_part_of_the_compilation_6154", message: "Print names of generated files part of the compilation." }, + Print_names_of_files_part_of_the_compilation: { code: 6155, category: ts.DiagnosticCategory.Message, key: "Print_names_of_files_part_of_the_compilation_6155", message: "Print names of files part of the compilation." }, + The_locale_used_when_displaying_messages_to_the_user_e_g_en_us: { code: 6156, category: ts.DiagnosticCategory.Message, key: "The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156", message: "The locale used when displaying messages to the user (e.g. 'en-us')" }, + Do_not_generate_custom_helper_functions_like_extends_in_compiled_output: { code: 6157, category: ts.DiagnosticCategory.Message, key: "Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157", message: "Do not generate custom helper functions like '__extends' in compiled output." }, + Do_not_include_the_default_library_file_lib_d_ts: { code: 6158, category: ts.DiagnosticCategory.Message, key: "Do_not_include_the_default_library_file_lib_d_ts_6158", message: "Do not include the default library file (lib.d.ts)." }, + Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files: { code: 6159, category: ts.DiagnosticCategory.Message, key: "Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159", message: "Do not add triple-slash references or imported modules to the list of compiled files." }, + Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files: { code: 6160, category: ts.DiagnosticCategory.Message, key: "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160", message: "[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files." }, + List_of_folders_to_include_type_definitions_from: { code: 6161, category: ts.DiagnosticCategory.Message, key: "List_of_folders_to_include_type_definitions_from_6161", message: "List of folders to include type definitions from." }, + Disable_size_limitations_on_JavaScript_projects: { code: 6162, category: ts.DiagnosticCategory.Message, key: "Disable_size_limitations_on_JavaScript_projects_6162", message: "Disable size limitations on JavaScript projects." }, + The_character_set_of_the_input_files: { code: 6163, category: ts.DiagnosticCategory.Message, key: "The_character_set_of_the_input_files_6163", message: "The character set of the input files." }, + Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files: { code: 6164, category: ts.DiagnosticCategory.Message, key: "Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6164", message: "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files." }, + Do_not_truncate_error_messages: { code: 6165, category: ts.DiagnosticCategory.Message, key: "Do_not_truncate_error_messages_6165", message: "Do not truncate error messages." }, + Output_directory_for_generated_declaration_files: { code: 6166, category: ts.DiagnosticCategory.Message, key: "Output_directory_for_generated_declaration_files_6166", message: "Output directory for generated declaration files." }, + A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl: { code: 6167, category: ts.DiagnosticCategory.Message, key: "A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167", message: "A series of entries which re-map imports to lookup locations relative to the 'baseUrl'." }, + List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime: { code: 6168, category: ts.DiagnosticCategory.Message, key: "List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168", message: "List of root folders whose combined content represents the structure of the project at runtime." }, + Show_all_compiler_options: { code: 6169, category: ts.DiagnosticCategory.Message, key: "Show_all_compiler_options_6169", message: "Show all compiler options." }, + Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file: { code: 6170, category: ts.DiagnosticCategory.Message, key: "Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170", message: "[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file" }, + Command_line_Options: { code: 6171, category: ts.DiagnosticCategory.Message, key: "Command_line_Options_6171", message: "Command-line Options" }, + Basic_Options: { code: 6172, category: ts.DiagnosticCategory.Message, key: "Basic_Options_6172", message: "Basic Options" }, + Strict_Type_Checking_Options: { code: 6173, category: ts.DiagnosticCategory.Message, key: "Strict_Type_Checking_Options_6173", message: "Strict Type-Checking Options" }, + Module_Resolution_Options: { code: 6174, category: ts.DiagnosticCategory.Message, key: "Module_Resolution_Options_6174", message: "Module Resolution Options" }, + Source_Map_Options: { code: 6175, category: ts.DiagnosticCategory.Message, key: "Source_Map_Options_6175", message: "Source Map Options" }, + Additional_Checks: { code: 6176, category: ts.DiagnosticCategory.Message, key: "Additional_Checks_6176", message: "Additional Checks" }, + Experimental_Options: { code: 6177, category: ts.DiagnosticCategory.Message, key: "Experimental_Options_6177", message: "Experimental Options" }, + Advanced_Options: { code: 6178, category: ts.DiagnosticCategory.Message, key: "Advanced_Options_6178", message: "Advanced Options" }, + Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3: { code: 6179, category: ts.DiagnosticCategory.Message, key: "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179", message: "Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'." }, + Enable_all_strict_type_checking_options: { code: 6180, category: ts.DiagnosticCategory.Message, key: "Enable_all_strict_type_checking_options_6180", message: "Enable all strict type-checking options." }, + List_of_language_service_plugins: { code: 6181, category: ts.DiagnosticCategory.Message, key: "List_of_language_service_plugins_6181", message: "List of language service plugins." }, + Scoped_package_detected_looking_in_0: { code: 6182, category: ts.DiagnosticCategory.Message, key: "Scoped_package_detected_looking_in_0_6182", message: "Scoped package detected, looking in '{0}'" }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_an_1_type_7005", message: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter_0_implicitly_has_an_1_type_7006", message: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member_0_implicitly_has_an_1_type_7008", message: "Member '{0}' implicitly has an '{1}' type." }, @@ -3164,7 +3247,7 @@ var ts; _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7023, category: ts.DiagnosticCategory.Error, key: "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023", message: "'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7024, category: ts.DiagnosticCategory.Error, key: "Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024", message: "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type: { code: 7025, category: ts.DiagnosticCategory.Error, key: "Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_typ_7025", message: "Generator implicitly has type '{0}' because it does not yield any values. Consider supplying a return type." }, - JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: { code: 7026, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026", message: "JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists" }, + JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: { code: 7026, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026", message: "JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists." }, Unreachable_code_detected: { code: 7027, category: ts.DiagnosticCategory.Error, key: "Unreachable_code_detected_7027", message: "Unreachable code detected." }, Unused_label: { code: 7028, category: ts.DiagnosticCategory.Error, key: "Unused_label_7028", message: "Unused label." }, Fallthrough_case_in_switch: { code: 7029, category: ts.DiagnosticCategory.Error, key: "Fallthrough_case_in_switch_7029", message: "Fallthrough case in switch." }, @@ -3188,7 +3271,7 @@ var ts; parameter_modifiers_can_only_be_used_in_a_ts_file: { code: 8012, category: ts.DiagnosticCategory.Error, key: "parameter_modifiers_can_only_be_used_in_a_ts_file_8012", message: "'parameter modifiers' can only be used in a .ts file." }, enum_declarations_can_only_be_used_in_a_ts_file: { code: 8015, category: ts.DiagnosticCategory.Error, key: "enum_declarations_can_only_be_used_in_a_ts_file_8015", message: "'enum declarations' can only be used in a .ts file." }, type_assertion_expressions_can_only_be_used_in_a_ts_file: { code: 8016, category: ts.DiagnosticCategory.Error, key: "type_assertion_expressions_can_only_be_used_in_a_ts_file_8016", message: "'type assertion expressions' can only be used in a .ts file." }, - Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses: { code: 9002, category: ts.DiagnosticCategory.Error, key: "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002", message: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses." }, + Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clause: { code: 9002, category: ts.DiagnosticCategory.Error, key: "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002", message: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clause." }, class_expressions_are_not_currently_supported: { code: 9003, category: ts.DiagnosticCategory.Error, key: "class_expressions_are_not_currently_supported_9003", message: "'class' expressions are not currently supported." }, Language_service_is_disabled: { code: 9004, category: ts.DiagnosticCategory.Error, key: "Language_service_is_disabled_9004", message: "Language service is disabled." }, JSX_attributes_must_only_be_assigned_a_non_empty_expression: { code: 17000, category: ts.DiagnosticCategory.Error, key: "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", message: "JSX attributes must only be assigned a non-empty 'expression'." }, @@ -3196,28 +3279,40 @@ var ts; Expected_corresponding_JSX_closing_tag_for_0: { code: 17002, category: ts.DiagnosticCategory.Error, key: "Expected_corresponding_JSX_closing_tag_for_0_17002", message: "Expected corresponding JSX closing tag for '{0}'." }, JSX_attribute_expected: { code: 17003, category: ts.DiagnosticCategory.Error, key: "JSX_attribute_expected_17003", message: "JSX attribute expected." }, Cannot_use_JSX_unless_the_jsx_flag_is_provided: { code: 17004, category: ts.DiagnosticCategory.Error, key: "Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004", message: "Cannot use JSX unless the '--jsx' flag is provided." }, - A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: ts.DiagnosticCategory.Error, key: "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005", message: "A constructor cannot contain a 'super' call when its class extends 'null'" }, + A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: ts.DiagnosticCategory.Error, key: "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005", message: "A constructor cannot contain a 'super' call when its class extends 'null'." }, An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17006, category: ts.DiagnosticCategory.Error, key: "An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006", message: "An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17007, category: ts.DiagnosticCategory.Error, key: "A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007", message: "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, JSX_element_0_has_no_corresponding_closing_tag: { code: 17008, category: ts.DiagnosticCategory.Error, key: "JSX_element_0_has_no_corresponding_closing_tag_17008", message: "JSX element '{0}' has no corresponding closing tag." }, super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class: { code: 17009, category: ts.DiagnosticCategory.Error, key: "super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009", message: "'super' must be called before accessing 'this' in the constructor of a derived class." }, Unknown_type_acquisition_option_0: { code: 17010, category: ts.DiagnosticCategory.Error, key: "Unknown_type_acquisition_option_0_17010", message: "Unknown type acquisition option '{0}'." }, + super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class: { code: 17011, category: ts.DiagnosticCategory.Error, key: "super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011", message: "'super' must be called before accessing a property of 'super' in the constructor of a derived class." }, + _0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2: { code: 17012, category: ts.DiagnosticCategory.Error, key: "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012", message: "'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?" }, + Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor: { code: 17013, category: ts.DiagnosticCategory.Error, key: "Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013", message: "Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor." }, Circularity_detected_while_resolving_configuration_Colon_0: { code: 18000, category: ts.DiagnosticCategory.Error, key: "Circularity_detected_while_resolving_configuration_Colon_0_18000", message: "Circularity detected while resolving configuration: {0}" }, A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not: { code: 18001, category: ts.DiagnosticCategory.Error, key: "A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not_18001", message: "A path in an 'extends' option must be relative or rooted, but '{0}' is not." }, The_files_list_in_config_file_0_is_empty: { code: 18002, category: ts.DiagnosticCategory.Error, key: "The_files_list_in_config_file_0_is_empty_18002", message: "The 'files' list in config file '{0}' is empty." }, No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2: { code: 18003, category: ts.DiagnosticCategory.Error, key: "No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003", message: "No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'." }, Add_missing_super_call: { code: 90001, category: ts.DiagnosticCategory.Message, key: "Add_missing_super_call_90001", message: "Add missing 'super()' call." }, Make_super_call_the_first_statement_in_the_constructor: { code: 90002, category: ts.DiagnosticCategory.Message, key: "Make_super_call_the_first_statement_in_the_constructor_90002", message: "Make 'super()' call the first statement in the constructor." }, - Change_extends_to_implements: { code: 90003, category: ts.DiagnosticCategory.Message, key: "Change_extends_to_implements_90003", message: "Change 'extends' to 'implements'" }, - Remove_unused_identifiers: { code: 90004, category: ts.DiagnosticCategory.Message, key: "Remove_unused_identifiers_90004", message: "Remove unused identifiers" }, - Implement_interface_on_reference: { code: 90005, category: ts.DiagnosticCategory.Message, key: "Implement_interface_on_reference_90005", message: "Implement interface on reference" }, - Implement_interface_on_class: { code: 90006, category: ts.DiagnosticCategory.Message, key: "Implement_interface_on_class_90006", message: "Implement interface on class" }, - Implement_inherited_abstract_class: { code: 90007, category: ts.DiagnosticCategory.Message, key: "Implement_inherited_abstract_class_90007", message: "Implement inherited abstract class" }, - Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: { code: 90009, category: ts.DiagnosticCategory.Error, key: "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009", message: "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig" }, + Change_extends_to_implements: { code: 90003, category: ts.DiagnosticCategory.Message, key: "Change_extends_to_implements_90003", message: "Change 'extends' to 'implements'." }, + Remove_declaration_for_Colon_0: { code: 90004, category: ts.DiagnosticCategory.Message, key: "Remove_declaration_for_Colon_0_90004", message: "Remove declaration for: '{0}'." }, + Implement_interface_0: { code: 90006, category: ts.DiagnosticCategory.Message, key: "Implement_interface_0_90006", message: "Implement interface '{0}'." }, + Implement_inherited_abstract_class: { code: 90007, category: ts.DiagnosticCategory.Message, key: "Implement_inherited_abstract_class_90007", message: "Implement inherited abstract class." }, + Add_this_to_unresolved_variable: { code: 90008, category: ts.DiagnosticCategory.Message, key: "Add_this_to_unresolved_variable_90008", message: "Add 'this.' to unresolved variable." }, + Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: { code: 90009, category: ts.DiagnosticCategory.Error, key: "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009", message: "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig." }, Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: { code: 90010, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010", message: "Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated." }, - Import_0_from_1: { code: 90013, category: ts.DiagnosticCategory.Message, key: "Import_0_from_1_90013", message: "Import {0} from {1}" }, - Change_0_to_1: { code: 90014, category: ts.DiagnosticCategory.Message, key: "Change_0_to_1_90014", message: "Change {0} to {1}" }, - Add_0_to_existing_import_declaration_from_1: { code: 90015, category: ts.DiagnosticCategory.Message, key: "Add_0_to_existing_import_declaration_from_1_90015", message: "Add {0} to existing import declaration from {1}" }, + Import_0_from_1: { code: 90013, category: ts.DiagnosticCategory.Message, key: "Import_0_from_1_90013", message: "Import {0} from {1}." }, + Change_0_to_1: { code: 90014, category: ts.DiagnosticCategory.Message, key: "Change_0_to_1_90014", message: "Change {0} to {1}." }, + Add_0_to_existing_import_declaration_from_1: { code: 90015, category: ts.DiagnosticCategory.Message, key: "Add_0_to_existing_import_declaration_from_1_90015", message: "Add {0} to existing import declaration from {1}." }, + Add_declaration_for_missing_property_0: { code: 90016, category: ts.DiagnosticCategory.Message, key: "Add_declaration_for_missing_property_0_90016", message: "Add declaration for missing property '{0}'." }, + Add_index_signature_for_missing_property_0: { code: 90017, category: ts.DiagnosticCategory.Message, key: "Add_index_signature_for_missing_property_0_90017", message: "Add index signature for missing property '{0}'." }, + Disable_checking_for_this_file: { code: 90018, category: ts.DiagnosticCategory.Message, key: "Disable_checking_for_this_file_90018", message: "Disable checking for this file." }, + Ignore_this_error_message: { code: 90019, category: ts.DiagnosticCategory.Message, key: "Ignore_this_error_message_90019", message: "Ignore this error message." }, + Initialize_property_0_in_the_constructor: { code: 90020, category: ts.DiagnosticCategory.Message, key: "Initialize_property_0_in_the_constructor_90020", message: "Initialize property '{0}' in the constructor." }, + Initialize_static_property_0: { code: 90021, category: ts.DiagnosticCategory.Message, key: "Initialize_static_property_0_90021", message: "Initialize static property '{0}'." }, + Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0: { code: 8017, category: ts.DiagnosticCategory.Error, key: "Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0_8017", message: "Octal literal types must use ES2015 syntax. Use the syntax '{0}'." }, + Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0: { code: 8018, category: ts.DiagnosticCategory.Error, key: "Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0_8018", message: "Octal literals are not allowed in enums members initializer. Use the syntax '{0}'." }, + Report_errors_in_js_files: { code: 8019, category: ts.DiagnosticCategory.Message, key: "Report_errors_in_js_files_8019", message: "Report errors in .js files." }, }; })(ts || (ts = {})); var ts; @@ -3226,7 +3321,7 @@ var ts; return token >= 70; } ts.tokenIsIdentifierOrKeyword = tokenIsIdentifierOrKeyword; - var textToToken = ts.createMap({ + var textToToken = ts.createMapFromTemplate({ "abstract": 116, "any": 118, "as": 117, @@ -3250,7 +3345,7 @@ var ts; "false": 85, "finally": 86, "for": 87, - "from": 138, + "from": 139, "function": 88, "get": 124, "if": 89, @@ -3268,27 +3363,28 @@ var ts; "new": 93, "null": 94, "number": 132, + "object": 133, "package": 110, "private": 111, "protected": 112, "public": 113, "readonly": 130, "require": 131, - "global": 139, + "global": 140, "return": 95, - "set": 133, + "set": 134, "static": 114, - "string": 134, + "string": 135, "super": 96, "switch": 97, - "symbol": 135, + "symbol": 136, "this": 98, "throw": 99, "true": 100, "try": 101, - "type": 136, + "type": 137, "typeof": 102, - "undefined": 137, + "undefined": 138, "var": 103, "void": 104, "while": 105, @@ -3296,7 +3392,7 @@ var ts; "yield": 115, "async": 119, "await": 120, - "of": 140, + "of": 141, "{": 16, "}": 17, "(": 18, @@ -3391,9 +3487,9 @@ var ts; } function makeReverseMap(source) { var result = []; - for (var name_4 in source) { - result[source[name_4]] = name_4; - } + source.forEach(function (value, name) { + result[value] = name; + }); return result; } var tokenStrings = makeReverseMap(textToToken); @@ -3402,7 +3498,7 @@ var ts; } ts.tokenToString = tokenToString; function stringToToken(s) { - return textToToken[s]; + return textToToken.get(s); } ts.stringToToken = stringToToken; function computeLineStarts(text) { @@ -3462,7 +3558,6 @@ var ts; return computeLineAndCharacterOfPosition(getLineStarts(sourceFile), position); } ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; - var hasOwnProperty = Object.prototype.hasOwnProperty; function isWhiteSpace(ch) { return isWhiteSpaceSingleLine(ch) || isLineBreak(ch); } @@ -3598,7 +3693,7 @@ var ts; if (pos === 0 || isLineBreak(text.charCodeAt(pos - 1))) { var ch = text.charCodeAt(pos); if ((pos + mergeConflictMarkerLength) < text.length) { - for (var i = 0, n = mergeConflictMarkerLength; i < n; i++) { + for (var i = 0; i < mergeConflictMarkerLength; i++) { if (text.charCodeAt(pos + i) !== ch) { return false; } @@ -3751,7 +3846,7 @@ var ts; if (!comments) { comments = []; } - comments.push({ pos: pos, end: end, hasTrailingNewLine: hasTrailingNewLine, kind: kind }); + comments.push({ kind: kind, pos: pos, end: end, hasTrailingNewLine: hasTrailingNewLine }); return comments; } function getLeadingCommentRanges(text, pos) { @@ -3784,7 +3879,7 @@ var ts; if (!isIdentifierStart(name.charCodeAt(0), languageVersion)) { return false; } - for (var i = 1, n = name.length; i < n; i++) { + for (var i = 1; i < name.length; i++) { if (!isIdentifierPart(name.charCodeAt(i), languageVersion)) { return false; } @@ -3803,6 +3898,7 @@ var ts; var precedingLineBreak; var hasExtendedUnicodeEscape; var tokenIsUnterminated; + var numericLiteralFlags; setText(text, start, length); return { getStartPos: function () { return startPos; }, @@ -3816,6 +3912,7 @@ var ts; isIdentifier: function () { return token === 70 || token > 106; }, isReservedWord: function () { return token >= 71 && token <= 106; }, isUnterminated: function () { return tokenIsUnterminated; }, + getNumericLiteralFlags: function () { return numericLiteralFlags; }, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, reScanTemplateToken: reScanTemplateToken, @@ -3852,6 +3949,7 @@ var ts; var end = pos; if (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101) { pos++; + numericLiteralFlags = 2; if (text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) pos++; if (isDigit(text.charCodeAt(pos))) { @@ -4121,8 +4219,11 @@ var ts; var len = tokenValue.length; if (len >= 2 && len <= 11) { var ch = tokenValue.charCodeAt(0); - if (ch >= 97 && ch <= 122 && hasOwnProperty.call(textToToken, tokenValue)) { - return token = textToToken[tokenValue]; + if (ch >= 97 && ch <= 122) { + token = textToToken.get(tokenValue); + if (token !== undefined) { + return token; + } } } return token = 70; @@ -4151,6 +4252,7 @@ var ts; hasExtendedUnicodeEscape = false; precedingLineBreak = false; tokenIsUnterminated = false; + numericLiteralFlags = 0; while (true) { tokenPos = pos; if (pos >= end) { @@ -4332,6 +4434,7 @@ var ts; value = 0; } tokenValue = "" + value; + numericLiteralFlags = 8; return token = 8; } else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) { @@ -4342,6 +4445,7 @@ var ts; value = 0; } tokenValue = "" + value; + numericLiteralFlags = 16; return token = 8; } else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) { @@ -4352,10 +4456,12 @@ var ts; value = 0; } tokenValue = "" + value; + numericLiteralFlags = 32; return token = 8; } if (pos + 1 < end && isOctalDigit(text.charCodeAt(pos + 1))) { tokenValue = "" + scanOctalDigits(); + numericLiteralFlags = 4; return token = 8; } case 49: @@ -4602,7 +4708,14 @@ var ts; while (pos < end) { pos++; char = text.charCodeAt(pos); - if ((char === 123) || (char === 60)) { + if (char === 123) { + break; + } + if (char === 60) { + if (isConflictMarkerTrivia(text, pos)) { + pos = scanConflictMarkerTrivia(text, pos, error); + return token = 7; + } break; } } @@ -4776,40 +4889,12 @@ var ts; (function (ts) { ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean" }; ts.optionDeclarations = [ - { - name: "charset", - type: "string", - }, - ts.compileOnSaveCommandLineOption, - { - name: "declaration", - shortName: "d", - type: "boolean", - description: ts.Diagnostics.Generates_corresponding_d_ts_file, - }, - { - name: "declarationDir", - type: "string", - isFilePath: true, - paramType: ts.Diagnostics.DIRECTORY, - }, - { - name: "diagnostics", - type: "boolean", - }, - { - name: "extendedDiagnostics", - type: "boolean", - experimental: true - }, - { - name: "emitBOM", - type: "boolean" - }, { name: "help", shortName: "h", type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, description: ts.Diagnostics.Print_this_message, }, { @@ -4817,219 +4902,57 @@ var ts; shortName: "?", type: "boolean" }, + { + name: "all", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Show_all_compiler_options, + }, + { + name: "version", + shortName: "v", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Print_the_compiler_s_version, + }, { name: "init", type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, description: ts.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file, }, - { - name: "inlineSourceMap", - type: "boolean", - }, - { - name: "inlineSources", - type: "boolean", - }, - { - name: "jsx", - type: ts.createMap({ - "preserve": 1, - "react": 2 - }), - paramType: ts.Diagnostics.KIND, - description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_or_react, - }, - { - name: "reactNamespace", - type: "string", - description: ts.Diagnostics.Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit - }, - { - name: "jsxFactory", - type: "string", - description: ts.Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h - }, - { - name: "listFiles", - type: "boolean", - }, - { - name: "locale", - type: "string", - }, - { - name: "mapRoot", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, - paramType: ts.Diagnostics.LOCATION, - }, - { - name: "module", - shortName: "m", - type: ts.createMap({ - "none": ts.ModuleKind.None, - "commonjs": ts.ModuleKind.CommonJS, - "amd": ts.ModuleKind.AMD, - "system": ts.ModuleKind.System, - "umd": ts.ModuleKind.UMD, - "es6": ts.ModuleKind.ES2015, - "es2015": ts.ModuleKind.ES2015, - }), - description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015, - paramType: ts.Diagnostics.KIND, - }, - { - name: "newLine", - type: ts.createMap({ - "crlf": 0, - "lf": 1 - }), - description: ts.Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, - paramType: ts.Diagnostics.NEWLINE, - }, - { - name: "noEmit", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_outputs, - }, - { - name: "noEmitHelpers", - type: "boolean" - }, - { - name: "noEmitOnError", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported, - }, - { - name: "noErrorTruncation", - type: "boolean" - }, - { - name: "noImplicitAny", - type: "boolean", - description: ts.Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type, - }, - { - name: "noImplicitThis", - type: "boolean", - description: ts.Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type, - }, - { - name: "noUnusedLocals", - type: "boolean", - description: ts.Diagnostics.Report_errors_on_unused_locals, - }, - { - name: "noUnusedParameters", - type: "boolean", - description: ts.Diagnostics.Report_errors_on_unused_parameters, - }, - { - name: "noLib", - type: "boolean", - }, - { - name: "noResolve", - type: "boolean", - }, - { - name: "skipDefaultLibCheck", - type: "boolean", - }, - { - name: "skipLibCheck", - type: "boolean", - description: ts.Diagnostics.Skip_type_checking_of_declaration_files, - }, - { - name: "out", - type: "string", - isFilePath: false, - paramType: ts.Diagnostics.FILE, - }, - { - name: "outFile", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Concatenate_and_emit_output_to_single_file, - paramType: ts.Diagnostics.FILE, - }, - { - name: "outDir", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Redirect_output_structure_to_the_directory, - paramType: ts.Diagnostics.DIRECTORY, - }, - { - name: "preserveConstEnums", - type: "boolean", - description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code - }, - { - name: "pretty", - description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental, - type: "boolean" - }, { name: "project", shortName: "p", type: "string", isFilePath: true, - description: ts.Diagnostics.Compile_the_project_in_the_given_directory, - paramType: ts.Diagnostics.DIRECTORY + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + paramType: ts.Diagnostics.FILE_OR_DIRECTORY, + description: ts.Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json, }, { - name: "removeComments", + name: "pretty", type: "boolean", - description: ts.Diagnostics.Do_not_emit_comments_to_output, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental }, { - name: "rootDir", - type: "string", - isFilePath: true, - paramType: ts.Diagnostics.LOCATION, - description: ts.Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, - }, - { - name: "isolatedModules", + name: "watch", + shortName: "w", type: "boolean", - }, - { - name: "sourceMap", - type: "boolean", - description: ts.Diagnostics.Generates_corresponding_map_file, - }, - { - name: "sourceRoot", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, - paramType: ts.Diagnostics.LOCATION, - }, - { - name: "suppressExcessPropertyErrors", - type: "boolean", - description: ts.Diagnostics.Suppress_excess_property_checks_for_object_literals, - experimental: true - }, - { - name: "suppressImplicitAnyIndexErrors", - type: "boolean", - description: ts.Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures, - }, - { - name: "stripInternal", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, - experimental: true + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Watch_input_files, }, { name: "target", shortName: "t", - type: ts.createMap({ + type: ts.createMapFromTemplate({ "es3": 0, "es5": 1, "es6": 2, @@ -5038,146 +4961,41 @@ var ts; "es2017": 4, "esnext": 5, }), - description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015, paramType: ts.Diagnostics.VERSION, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT, }, { - name: "version", - shortName: "v", - type: "boolean", - description: ts.Diagnostics.Print_the_compiler_s_version, - }, - { - name: "watch", - shortName: "w", - type: "boolean", - description: ts.Diagnostics.Watch_input_files, - }, - { - name: "experimentalDecorators", - type: "boolean", - description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators - }, - { - name: "emitDecoratorMetadata", - type: "boolean", - experimental: true, - description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators - }, - { - name: "moduleResolution", - type: ts.createMap({ - "node": ts.ModuleResolutionKind.NodeJs, - "classic": ts.ModuleResolutionKind.Classic, + name: "module", + shortName: "m", + type: ts.createMapFromTemplate({ + "none": ts.ModuleKind.None, + "commonjs": ts.ModuleKind.CommonJS, + "amd": ts.ModuleKind.AMD, + "system": ts.ModuleKind.System, + "umd": ts.ModuleKind.UMD, + "es6": ts.ModuleKind.ES2015, + "es2015": ts.ModuleKind.ES2015, }), - description: ts.Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6, - paramType: ts.Diagnostics.STRATEGY, - }, - { - name: "allowUnusedLabels", - type: "boolean", - description: ts.Diagnostics.Do_not_report_errors_on_unused_labels - }, - { - name: "noImplicitReturns", - type: "boolean", - description: ts.Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value - }, - { - name: "noFallthroughCasesInSwitch", - type: "boolean", - description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement - }, - { - name: "allowUnreachableCode", - type: "boolean", - description: ts.Diagnostics.Do_not_report_errors_on_unreachable_code - }, - { - name: "forceConsistentCasingInFileNames", - type: "boolean", - description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file - }, - { - name: "baseUrl", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Base_directory_to_resolve_non_absolute_module_names - }, - { - name: "paths", - type: "object", - isTSConfigOnly: true - }, - { - name: "rootDirs", - type: "list", - isTSConfigOnly: true, - element: { - name: "rootDirs", - type: "string", - isFilePath: true - } - }, - { - name: "typeRoots", - type: "list", - element: { - name: "typeRoots", - type: "string", - isFilePath: true - } - }, - { - name: "types", - type: "list", - element: { - name: "types", - type: "string" - }, - description: ts.Diagnostics.Type_declaration_files_to_be_included_in_compilation - }, - { - name: "traceResolution", - type: "boolean", - description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process - }, - { - name: "allowJs", - type: "boolean", - description: ts.Diagnostics.Allow_javascript_files_to_be_compiled - }, - { - name: "allowSyntheticDefaultImports", - type: "boolean", - description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking - }, - { - name: "noImplicitUseStrict", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_use_strict_directives_in_module_output - }, - { - name: "maxNodeModuleJsDepth", - type: "number", - description: ts.Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files - }, - { - name: "listEmittedFiles", - type: "boolean" + paramType: ts.Diagnostics.KIND, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015, }, { name: "lib", type: "list", element: { name: "lib", - type: ts.createMap({ + type: ts.createMapFromTemplate({ "es5": "lib.es5.d.ts", "es6": "lib.es2015.d.ts", "es2015": "lib.es2015.d.ts", "es7": "lib.es2016.d.ts", "es2016": "lib.es2016.d.ts", "es2017": "lib.es2017.d.ts", + "esnext": "lib.esnext.d.ts", "dom": "lib.dom.d.ts", "dom.iterable": "lib.dom.iterable.d.ts", "webworker": "lib.webworker.d.ts", @@ -5195,28 +5013,475 @@ var ts; "es2017.object": "lib.es2017.object.d.ts", "es2017.sharedmemory": "lib.es2017.sharedmemory.d.ts", "es2017.string": "lib.es2017.string.d.ts", + "esnext.asynciterable": "lib.esnext.asynciterable.d.ts", }), }, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon }, { - name: "disableSizeLimit", - type: "boolean" + name: "allowJs", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Allow_javascript_files_to_be_compiled }, { - name: "strictNullChecks", + name: "checkJs", type: "boolean", - description: ts.Diagnostics.Enable_strict_null_checks + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Report_errors_in_js_files + }, + { + name: "jsx", + type: ts.createMapFromTemplate({ + "preserve": 1, + "react-native": 3, + "react": 2 + }), + paramType: ts.Diagnostics.KIND, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_react_native_or_react, + }, + { + name: "declaration", + shortName: "d", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Generates_corresponding_d_ts_file, + }, + { + name: "sourceMap", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Generates_corresponding_map_file, + }, + { + name: "outFile", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.FILE, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Concatenate_and_emit_output_to_single_file, + }, + { + name: "outDir", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.DIRECTORY, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Redirect_output_structure_to_the_directory, + }, + { + name: "rootDir", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.LOCATION, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, + }, + { + name: "removeComments", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Do_not_emit_comments_to_output, + }, + { + name: "noEmit", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Do_not_emit_outputs, }, { name: "importHelpers", type: "boolean", + category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Import_emit_helpers_from_tslib }, + { + name: "downlevelIteration", + type: "boolean", + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3 + }, + { + name: "isolatedModules", + type: "boolean", + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule + }, + { + name: "strict", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Enable_all_strict_type_checking_options + }, + { + name: "noImplicitAny", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type, + }, + { + name: "strictNullChecks", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Enable_strict_null_checks + }, + { + name: "noImplicitThis", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, + description: ts.Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type, + }, { name: "alwaysStrict", type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Strict_Type_Checking_Options, description: ts.Diagnostics.Parse_in_strict_mode_and_emit_use_strict_for_each_source_file + }, + { + name: "noUnusedLocals", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_errors_on_unused_locals, + }, + { + name: "noUnusedParameters", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_errors_on_unused_parameters, + }, + { + name: "noImplicitReturns", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value + }, + { + name: "noFallthroughCasesInSwitch", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Additional_Checks, + description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement + }, + { + name: "moduleResolution", + type: ts.createMapFromTemplate({ + "node": ts.ModuleResolutionKind.NodeJs, + "classic": ts.ModuleResolutionKind.Classic, + }), + paramType: ts.Diagnostics.STRATEGY, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6, + }, + { + name: "baseUrl", + type: "string", + isFilePath: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Base_directory_to_resolve_non_absolute_module_names + }, + { + name: "paths", + type: "object", + isTSConfigOnly: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl + }, + { + name: "rootDirs", + type: "list", + isTSConfigOnly: true, + element: { + name: "rootDirs", + type: "string", + isFilePath: true + }, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime + }, + { + name: "typeRoots", + type: "list", + element: { + name: "typeRoots", + type: "string", + isFilePath: true + }, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.List_of_folders_to_include_type_definitions_from + }, + { + name: "types", + type: "list", + element: { + name: "types", + type: "string" + }, + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Type_declaration_files_to_be_included_in_compilation + }, + { + name: "allowSyntheticDefaultImports", + type: "boolean", + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking + }, + { + name: "sourceRoot", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.LOCATION, + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, + }, + { + name: "mapRoot", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.LOCATION, + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, + }, + { + name: "inlineSourceMap", + type: "boolean", + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file + }, + { + name: "inlineSources", + type: "boolean", + category: ts.Diagnostics.Source_Map_Options, + description: ts.Diagnostics.Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set + }, + { + name: "experimentalDecorators", + type: "boolean", + category: ts.Diagnostics.Experimental_Options, + description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators + }, + { + name: "emitDecoratorMetadata", + type: "boolean", + category: ts.Diagnostics.Experimental_Options, + description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators + }, + { + name: "jsxFactory", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h + }, + { + name: "diagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_diagnostic_information + }, + { + name: "extendedDiagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_verbose_diagnostic_information + }, + { + name: "traceResolution", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process + }, + { + name: "listFiles", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Print_names_of_files_part_of_the_compilation + }, + { + name: "listEmittedFiles", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Print_names_of_generated_files_part_of_the_compilation + }, + { + name: "out", + type: "string", + isFilePath: false, + category: ts.Diagnostics.Advanced_Options, + paramType: ts.Diagnostics.FILE, + description: ts.Diagnostics.Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file, + }, + { + name: "reactNamespace", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit + }, + { + name: "skipDefaultLibCheck", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files + }, + { + name: "charset", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.The_character_set_of_the_input_files + }, + { + name: "emitBOM", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files + }, + { + name: "locale", + type: "string", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.The_locale_used_when_displaying_messages_to_the_user_e_g_en_us + }, + { + name: "newLine", + type: ts.createMapFromTemplate({ + "crlf": 0, + "lf": 1 + }), + paramType: ts.Diagnostics.NEWLINE, + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, + }, + { + name: "noErrorTruncation", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_truncate_error_messages + }, + { + name: "noLib", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_include_the_default_library_file_lib_d_ts + }, + { + name: "noResolve", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files + }, + { + name: "stripInternal", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, + }, + { + name: "disableSizeLimit", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Disable_size_limitations_on_JavaScript_projects + }, + { + name: "noImplicitUseStrict", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_emit_use_strict_directives_in_module_output + }, + { + name: "noEmitHelpers", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_generate_custom_helper_functions_like_extends_in_compiled_output + }, + { + name: "noEmitOnError", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported, + }, + { + name: "preserveConstEnums", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code + }, + { + name: "declarationDir", + type: "string", + isFilePath: true, + paramType: ts.Diagnostics.DIRECTORY, + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Output_directory_for_generated_declaration_files + }, + { + name: "skipLibCheck", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Skip_type_checking_of_declaration_files, + }, + { + name: "allowUnusedLabels", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_report_errors_on_unused_labels + }, + { + name: "allowUnreachableCode", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Do_not_report_errors_on_unreachable_code + }, + { + name: "suppressExcessPropertyErrors", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Suppress_excess_property_checks_for_object_literals, + }, + { + name: "suppressImplicitAnyIndexErrors", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures, + }, + { + name: "forceConsistentCasingInFileNames", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file + }, + { + name: "maxNodeModuleJsDepth", + type: "number", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files + }, + { + name: "plugins", + type: "list", + isTSConfigOnly: true, + element: { + name: "plugin", + type: "object" + }, + description: ts.Diagnostics.List_of_language_service_plugins } ]; ts.typeAcquisitionDeclarations = [ @@ -5248,8 +5513,7 @@ var ts; ts.defaultInitCompilerOptions = { module: ts.ModuleKind.CommonJS, target: 1, - noImplicitAny: false, - sourceMap: false, + strict: true }; var optionNameMapCache; function convertEnableAutoDiscoveryToEnable(typeAcquisition) { @@ -5271,9 +5535,9 @@ var ts; var optionNameMap = ts.createMap(); var shortOptionNames = ts.createMap(); ts.forEach(ts.optionDeclarations, function (option) { - optionNameMap[option.name.toLowerCase()] = option; + optionNameMap.set(option.name.toLowerCase(), option); if (option.shortName) { - shortOptionNames[option.shortName] = option.name; + shortOptionNames.set(option.shortName, option.name); } }); optionNameMapCache = { optionNameMap: optionNameMap, shortOptionNames: shortOptionNames }; @@ -5281,19 +5545,12 @@ var ts; } ts.getOptionNameMap = getOptionNameMap; function createCompilerDiagnosticForInvalidCustomType(opt) { - var namesOfType = Object.keys(opt.type).map(function (key) { return "'" + key + "'"; }).join(", "); + var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'" + key + "'"; }).join(", "); return ts.createCompilerDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType); } ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType; function parseCustomTypeOption(opt, value, errors) { - var key = trimString((value || "")).toLowerCase(); - var map = opt.type; - if (key in map) { - return map[key]; - } - else { - errors.push(createCompilerDiagnosticForInvalidCustomType(opt)); - } + return convertJsonOptionOfCustomType(opt, trimString(value || ""), errors); } ts.parseCustomTypeOption = parseCustomTypeOption; function parseListTypeOption(opt, value, errors) { @@ -5337,11 +5594,12 @@ var ts; } else if (s.charCodeAt(0) === 45) { s = s.slice(s.charCodeAt(1) === 45 ? 2 : 1).toLowerCase(); - if (s in shortOptionNames) { - s = shortOptionNames[s]; + var short = shortOptionNames.get(s); + if (short !== undefined) { + s = short; } - if (s in optionNameMap) { - var opt = optionNameMap[s]; + var opt = optionNameMap.get(s); + if (opt) { if (opt.isTSConfigOnly) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file, opt.name)); } @@ -5446,7 +5704,7 @@ var ts; } } ts.parseConfigFileTextToJson = parseConfigFileTextToJson; - function generateTSConfig(options, fileNames) { + function generateTSConfig(options, fileNames, newLine) { var compilerOptions = ts.extend(options, ts.defaultInitCompilerOptions); var configurations = { compilerOptions: serializeCompilerOptions(compilerOptions) @@ -5454,7 +5712,7 @@ var ts; if (fileNames && fileNames.length) { configurations.files = fileNames; } - return configurations; + return writeConfigurations(); function getCustomTypeMapOfCommandLineOption(optionDefinition) { if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean") { return undefined; @@ -5467,53 +5725,121 @@ var ts; } } function getNameOfCompilerOptionValue(value, customTypeMap) { - for (var key in customTypeMap) { - if (customTypeMap[key] === value) { + return ts.forEachEntry(customTypeMap, function (mapValue, key) { + if (mapValue === value) { return key; } - } - return undefined; + }); } function serializeCompilerOptions(options) { - var result = ts.createMap(); + var result = {}; var optionsNameMap = getOptionNameMap().optionNameMap; - for (var name_5 in options) { - if (ts.hasProperty(options, name_5)) { - switch (name_5) { - case "init": - case "watch": - case "version": - case "help": - case "project": - break; - default: - var value = options[name_5]; - var optionDefinition = optionsNameMap[name_5.toLowerCase()]; - if (optionDefinition) { - var customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition); - if (!customTypeMap) { - result[name_5] = value; - } - else { - if (optionDefinition.type === "list") { - var convertedValue = []; - for (var _i = 0, _a = value; _i < _a.length; _i++) { - var element = _a[_i]; - convertedValue.push(getNameOfCompilerOptionValue(element, customTypeMap)); - } - result[name_5] = convertedValue; - } - else { - result[name_5] = getNameOfCompilerOptionValue(value, customTypeMap); - } + for (var name in options) { + if (ts.hasProperty(options, name)) { + if (optionsNameMap.has(name) && optionsNameMap.get(name).category === ts.Diagnostics.Command_line_Options) { + continue; + } + var value = options[name]; + var optionDefinition = optionsNameMap.get(name.toLowerCase()); + if (optionDefinition) { + var customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition); + if (!customTypeMap) { + result[name] = value; + } + else { + if (optionDefinition.type === "list") { + var convertedValue = []; + for (var _i = 0, _a = value; _i < _a.length; _i++) { + var element = _a[_i]; + convertedValue.push(getNameOfCompilerOptionValue(element, customTypeMap)); } + result[name] = convertedValue; } - break; + else { + result[name] = getNameOfCompilerOptionValue(value, customTypeMap); + } + } } } } return result; } + function getDefaultValueForOption(option) { + switch (option.type) { + case "number": + return 1; + case "boolean": + return true; + case "string": + return option.isFilePath ? "./" : ""; + case "list": + return []; + case "object": + return {}; + default: + return ts.arrayFrom(option.type.keys())[0]; + } + } + function makePadding(paddingLength) { + return Array(paddingLength + 1).join(" "); + } + function writeConfigurations() { + var categorizedOptions = ts.reduceLeft(ts.filter(ts.optionDeclarations, function (o) { return o.category !== ts.Diagnostics.Command_line_Options && o.category !== ts.Diagnostics.Advanced_Options; }), function (memo, value) { + if (value.category) { + var name = ts.getLocaleSpecificMessage(value.category); + (memo[name] || (memo[name] = [])).push(value); + } + return memo; + }, {}); + var marginLength = 0; + var seenKnownKeys = 0; + var nameColumn = []; + var descriptionColumn = []; + var knownKeysCount = ts.getOwnKeys(configurations.compilerOptions).length; + for (var category in categorizedOptions) { + if (nameColumn.length !== 0) { + nameColumn.push(""); + descriptionColumn.push(""); + } + nameColumn.push("/* " + category + " */"); + descriptionColumn.push(""); + for (var _i = 0, _a = categorizedOptions[category]; _i < _a.length; _i++) { + var option = _a[_i]; + var optionName = void 0; + if (ts.hasProperty(configurations.compilerOptions, option.name)) { + optionName = "\"" + option.name + "\": " + JSON.stringify(configurations.compilerOptions[option.name]) + ((seenKnownKeys += 1) === knownKeysCount ? "" : ","); + } + else { + optionName = "// \"" + option.name + "\": " + JSON.stringify(getDefaultValueForOption(option)) + ","; + } + nameColumn.push(optionName); + descriptionColumn.push("/* " + (option.description && ts.getLocaleSpecificMessage(option.description) || option.name) + " */"); + marginLength = Math.max(optionName.length, marginLength); + } + } + var tab = makePadding(2); + var result = []; + result.push("{"); + result.push(tab + "\"compilerOptions\": {"); + for (var i = 0; i < nameColumn.length; i++) { + var optionName = nameColumn[i]; + var description = descriptionColumn[i]; + result.push(tab + tab + optionName + makePadding(marginLength - optionName.length + 2) + description); + } + if (configurations.files && configurations.files.length) { + result.push(tab + "},"); + result.push(tab + "\"files\": ["); + for (var i = 0; i < configurations.files.length; i++) { + result.push("" + tab + tab + JSON.stringify(configurations.files[i]) + (i === configurations.files.length - 1 ? "" : ",")); + } + result.push(tab + "]"); + } + else { + result.push(tab + "}"); + } + result.push("}"); + return result.join(newLine); + } } ts.generateTSConfig = generateTSConfig; function removeComments(jsonText) { @@ -5533,10 +5859,12 @@ var ts; } return output; } - function parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack) { + function parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions) { if (existingOptions === void 0) { existingOptions = {}; } if (resolutionStack === void 0) { resolutionStack = []; } + if (extraFileExtensions === void 0) { extraFileExtensions = []; } var errors = []; + basePath = ts.normalizeSlashes(basePath); var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames); var resolvedPath = ts.toPath(configFileName || "", basePath, getCanonicalFileName); if (resolutionStack.indexOf(resolvedPath) >= 0) { @@ -5658,7 +5986,7 @@ var ts; if (fileNames === undefined && includeSpecs === undefined) { includeSpecs = ["**/*"]; } - var result = matchFileNames(fileNames, includeSpecs, excludeSpecs, basePath, options, host, errors); + var result = matchFileNames(fileNames, includeSpecs, excludeSpecs, basePath, options, host, errors, extraFileExtensions); if (result.fileNames.length === 0 && !ts.hasProperty(json, "files") && resolutionStack.length === 0) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, configFileName || "tsconfig.json", JSON.stringify(includeSpecs || []), JSON.stringify(excludeSpecs || []))); } @@ -5709,8 +6037,8 @@ var ts; } var optionNameMap = ts.arrayToMap(optionDeclarations, function (opt) { return opt.name; }); for (var id in jsonOptions) { - if (id in optionNameMap) { - var opt = optionNameMap[id]; + var opt = optionNameMap.get(id); + if (opt) { defaultOptions[opt.name] = convertJsonOption(opt, jsonOptions[id], basePath, errors); } else { @@ -5744,8 +6072,9 @@ var ts; } function convertJsonOptionOfCustomType(opt, value, errors) { var key = value.toLowerCase(); - if (key in opt.type) { - return opt.type[key]; + var val = opt.type.get(key); + if (val !== undefined) { + return val; } else { errors.push(createCompilerDiagnosticForInvalidCustomType(opt)); @@ -5762,7 +6091,7 @@ var ts; var invalidDotDotAfterRecursiveWildcardPattern = /(^|\/)\*\*\/(.*\/)?\.\.($|\/)/; var watchRecursivePattern = /\/[^/]*?[*?][^/]*\//; var wildcardDirectoryPattern = /^[^*?]*(?=\/[^/]*[*?])/; - function matchFileNames(fileNames, include, exclude, basePath, options, host, errors) { + function matchFileNames(fileNames, include, exclude, basePath, options, host, errors, extraFileExtensions) { basePath = ts.normalizePath(basePath); var keyMapper = host.useCaseSensitiveFileNames ? caseSensitiveKeyMapper : caseInsensitiveKeyMapper; var literalFileMap = ts.createMap(); @@ -5774,12 +6103,12 @@ var ts; exclude = validateSpecs(exclude, errors, true); } var wildcardDirectories = getWildcardDirectories(include, exclude, basePath, host.useCaseSensitiveFileNames); - var supportedExtensions = ts.getSupportedExtensions(options); + var supportedExtensions = ts.getSupportedExtensions(options, extraFileExtensions); if (fileNames) { for (var _i = 0, fileNames_1 = fileNames; _i < fileNames_1.length; _i++) { var fileName = fileNames_1[_i]; var file = ts.combinePaths(basePath, fileName); - literalFileMap[keyMapper(file)] = file; + literalFileMap.set(keyMapper(file), file); } } if (include && include.length > 0) { @@ -5790,14 +6119,13 @@ var ts; } removeWildcardFilesWithLowerPriorityExtension(file, wildcardFileMap, supportedExtensions, keyMapper); var key = keyMapper(file); - if (!(key in literalFileMap) && !(key in wildcardFileMap)) { - wildcardFileMap[key] = file; + if (!literalFileMap.has(key) && !wildcardFileMap.has(key)) { + wildcardFileMap.set(key, file); } } } - var literalFiles = ts.reduceProperties(literalFileMap, addFileToOutput, []); - var wildcardFiles = ts.reduceProperties(wildcardFileMap, addFileToOutput, []); - wildcardFiles.sort(host.useCaseSensitiveFileNames ? ts.compareStrings : ts.compareStringsCaseInsensitive); + var literalFiles = ts.arrayFrom(literalFileMap.values()); + var wildcardFiles = ts.arrayFrom(wildcardFileMap.values()); return { fileNames: literalFiles.concat(wildcardFiles), wildcardDirectories: wildcardDirectories @@ -5805,8 +6133,8 @@ var ts; } function validateSpecs(specs, errors, allowTrailingRecursion) { var validSpecs = []; - for (var _i = 0, specs_2 = specs; _i < specs_2.length; _i++) { - var spec = specs_2[_i]; + for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) { + var spec = specs_1[_i]; if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); } @@ -5825,7 +6153,7 @@ var ts; function getWildcardDirectories(include, exclude, path, useCaseSensitiveFileNames) { var rawExcludeRegex = ts.getRegularExpressionForWildcard(exclude, path, "exclude"); var excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames ? "" : "i"); - var wildcardDirectories = ts.createMap(); + var wildcardDirectories = {}; if (include !== undefined) { var recursiveKeys = []; for (var _i = 0, include_1 = include; _i < include_1.length; _i++) { @@ -5846,14 +6174,15 @@ var ts; } } } - for (var key in wildcardDirectories) { - for (var _a = 0, recursiveKeys_1 = recursiveKeys; _a < recursiveKeys_1.length; _a++) { - var recursiveKey = recursiveKeys_1[_a]; - if (key !== recursiveKey && ts.containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) { - delete wildcardDirectories[key]; + for (var key in wildcardDirectories) + if (ts.hasProperty(wildcardDirectories, key)) { + for (var _a = 0, recursiveKeys_1 = recursiveKeys; _a < recursiveKeys_1.length; _a++) { + var recursiveKey = recursiveKeys_1[_a]; + if (key !== recursiveKey && ts.containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) { + delete wildcardDirectories[key]; + } } } - } } return wildcardDirectories; } @@ -5872,11 +6201,11 @@ var ts; } function hasFileWithHigherPriorityExtension(file, literalFiles, wildcardFiles, extensions, keyMapper) { var extensionPriority = ts.getExtensionPriority(file, extensions); - var adjustedExtensionPriority = ts.adjustExtensionPriority(extensionPriority); + var adjustedExtensionPriority = ts.adjustExtensionPriority(extensionPriority, extensions); for (var i = 0; i < adjustedExtensionPriority; i++) { var higherPriorityExtension = extensions[i]; var higherPriorityPath = keyMapper(ts.changeExtension(file, higherPriorityExtension)); - if (higherPriorityPath in literalFiles || higherPriorityPath in wildcardFiles) { + if (literalFiles.has(higherPriorityPath) || wildcardFiles.has(higherPriorityPath)) { return true; } } @@ -5884,17 +6213,13 @@ var ts; } function removeWildcardFilesWithLowerPriorityExtension(file, wildcardFiles, extensions, keyMapper) { var extensionPriority = ts.getExtensionPriority(file, extensions); - var nextExtensionPriority = ts.getNextLowestExtensionPriority(extensionPriority); + var nextExtensionPriority = ts.getNextLowestExtensionPriority(extensionPriority, extensions); for (var i = nextExtensionPriority; i < extensions.length; i++) { var lowerPriorityExtension = extensions[i]; var lowerPriorityPath = keyMapper(ts.changeExtension(file, lowerPriorityExtension)); - delete wildcardFiles[lowerPriorityPath]; + wildcardFiles.delete(lowerPriorityPath); } } - function addFileToOutput(output, file) { - output.push(file); - return output; - } function caseSensitiveKeyMapper(key) { return key; } @@ -5906,8 +6231,6 @@ var ts; (function (ts) { var JsTyping; (function (JsTyping) { - ; - ; var safeList; var EmptySafeList = ts.createMap(); JsTyping.nodeCoreModuleList = [ @@ -5930,7 +6253,7 @@ var ts; }); if (!safeList) { var result = ts.readConfigFile(safeListPath, function (path) { return host.readFile(path); }); - safeList = result.config ? ts.createMap(result.config) : EmptySafeList; + safeList = result.config ? ts.createMapFromTemplate(result.config) : EmptySafeList; } var filesToWatch = []; var searchDirs = []; @@ -5948,38 +6271,40 @@ var ts; getTypingNamesFromJson(packageJsonPath, filesToWatch); var bowerJsonPath = ts.combinePaths(searchDir, "bower.json"); getTypingNamesFromJson(bowerJsonPath, filesToWatch); + var bowerComponentsPath = ts.combinePaths(searchDir, "bower_components"); + getTypingNamesFromPackagesFolder(bowerComponentsPath); var nodeModulesPath = ts.combinePaths(searchDir, "node_modules"); - getTypingNamesFromNodeModuleFolder(nodeModulesPath); + getTypingNamesFromPackagesFolder(nodeModulesPath); } getTypingNamesFromSourceFileNames(fileNames); if (unresolvedImports) { for (var _a = 0, unresolvedImports_1 = unresolvedImports; _a < unresolvedImports_1.length; _a++) { var moduleId = unresolvedImports_1[_a]; - var typingName = moduleId in nodeCoreModules ? "node" : moduleId; - if (!(typingName in inferredTypings)) { - inferredTypings[typingName] = undefined; + var typingName = nodeCoreModules.has(moduleId) ? "node" : moduleId; + if (!inferredTypings.has(typingName)) { + inferredTypings.set(typingName, undefined); } } } - for (var name_6 in packageNameToTypingLocation) { - if (name_6 in inferredTypings && !inferredTypings[name_6]) { - inferredTypings[name_6] = packageNameToTypingLocation[name_6]; + packageNameToTypingLocation.forEach(function (typingLocation, name) { + if (inferredTypings.has(name) && inferredTypings.get(name) === undefined) { + inferredTypings.set(name, typingLocation); } - } + }); for (var _b = 0, exclude_1 = exclude; _b < exclude_1.length; _b++) { var excludeTypingName = exclude_1[_b]; - delete inferredTypings[excludeTypingName]; + inferredTypings.delete(excludeTypingName); } var newTypingNames = []; var cachedTypingPaths = []; - for (var typing in inferredTypings) { - if (inferredTypings[typing] !== undefined) { - cachedTypingPaths.push(inferredTypings[typing]); + inferredTypings.forEach(function (inferred, typing) { + if (inferred !== undefined) { + cachedTypingPaths.push(inferred); } else { newTypingNames.push(typing); } - } + }); return { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch }; function mergeTypings(typingNames) { if (!typingNames) { @@ -5987,8 +6312,8 @@ var ts; } for (var _i = 0, typingNames_1 = typingNames; _i < typingNames_1.length; _i++) { var typing = typingNames_1[_i]; - if (!(typing in inferredTypings)) { - inferredTypings[typing] = undefined; + if (!inferredTypings.has(typing)) { + inferredTypings.set(typing, undefined); } } } @@ -6018,23 +6343,25 @@ var ts; var inferredTypingNames = ts.map(jsFileNames, function (f) { return ts.removeFileExtension(ts.getBaseFileName(f.toLowerCase())); }); var cleanedTypingNames = ts.map(inferredTypingNames, function (f) { return f.replace(/((?:\.|-)min(?=\.|$))|((?:-|\.)\d+)/g, ""); }); if (safeList !== EmptySafeList) { - mergeTypings(ts.filter(cleanedTypingNames, function (f) { return f in safeList; })); + mergeTypings(ts.filter(cleanedTypingNames, function (f) { return safeList.has(f); })); } var hasJsxFile = ts.forEach(fileNames, function (f) { return ts.ensureScriptKind(f, ts.getScriptKindFromFileName(f)) === 2; }); if (hasJsxFile) { mergeTypings(["react"]); } } - function getTypingNamesFromNodeModuleFolder(nodeModulesPath) { - if (!host.directoryExists(nodeModulesPath)) { + function getTypingNamesFromPackagesFolder(packagesFolderPath) { + filesToWatch.push(packagesFolderPath); + if (!host.directoryExists(packagesFolderPath)) { return; } var typingNames = []; - var fileNames = host.readDirectory(nodeModulesPath, [".json"], undefined, undefined, 2); + var fileNames = host.readDirectory(packagesFolderPath, [".json"], undefined, undefined, 2); for (var _i = 0, fileNames_2 = fileNames; _i < fileNames_2.length; _i++) { var fileName = fileNames_2[_i]; var normalizedFileName = ts.normalizePath(fileName); - if (ts.getBaseFileName(normalizedFileName) !== "package.json") { + var baseFileName = ts.getBaseFileName(normalizedFileName); + if (baseFileName !== "package.json" && baseFileName !== "bower.json") { continue; } var result = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); }); @@ -6042,7 +6369,7 @@ var ts; continue; } var packageJson = result.config; - if (packageJson._requiredBy && + if (baseFileName === "package.json" && packageJson._requiredBy && ts.filter(packageJson._requiredBy, function (r) { return r[0] === "#" || r === "/"; }).length === 0) { continue; } @@ -6051,7 +6378,7 @@ var ts; } if (packageJson.typings) { var absolutePath = ts.getNormalizedAbsolutePath(packageJson.typings, ts.getDirectoryPath(normalizedFileName)); - inferredTypings[packageJson.name] = absolutePath; + inferredTypings.set(packageJson.name, absolutePath); } else { typingNames.push(packageJson.name); @@ -6069,12 +6396,15 @@ var ts; (function (server) { server.ActionSet = "action::set"; server.ActionInvalidate = "action::invalidate"; - server.EventInstall = "event::install"; + server.EventBeginInstallTypes = "event::beginInstallTypes"; + server.EventEndInstallTypes = "event::endInstallTypes"; + server.EventInitializationFailed = "event::initializationFailed"; var Arguments; (function (Arguments) { Arguments.GlobalCacheLocation = "--globalTypingsCacheLocation"; Arguments.LogFile = "--logFile"; Arguments.EnableTelemetry = "--enableTelemetry"; + Arguments.TypingSafeListLocation = "--typingSafeListLocation"; })(Arguments = server.Arguments || (server.Arguments = {})); function hasArgument(argumentName) { return ts.sys.args.indexOf(argumentName) >= 0; @@ -6099,6 +6429,12 @@ var ts; return compilerOptions.traceResolution && host.trace !== undefined; } ts.isTraceEnabled = isTraceEnabled; + var Extensions; + (function (Extensions) { + Extensions[Extensions["TypeScript"] = 0] = "TypeScript"; + Extensions[Extensions["JavaScript"] = 1] = "JavaScript"; + Extensions[Extensions["DtsOnly"] = 2] = "DtsOnly"; + })(Extensions || (Extensions = {})); function resolvedTypeScriptOnly(resolved) { if (!resolved) { return undefined; @@ -6106,9 +6442,6 @@ var ts; ts.Debug.assert(ts.extensionIsTypeScript(resolved.extension)); return resolved.path; } - function resolvedFromAnyFile(path) { - return { path: path, extension: ts.extensionFromPath(path) }; - } function resolvedModuleFromResolved(_a, isExternalLibraryImport) { var path = _a.path, extension = _a.extension; return { resolvedFileName: path, extension: extension, isExternalLibraryImport: isExternalLibraryImport }; @@ -6120,37 +6453,28 @@ var ts; return !(ts.isRootedDiskPath(moduleName) || ts.isExternalModuleNameRelative(moduleName)); } ts.moduleHasNonRelativeName = moduleHasNonRelativeName; - function tryReadTypesSection(extensions, packageJsonPath, baseDirectory, state) { + function tryReadPackageJsonFields(readTypes, packageJsonPath, baseDirectory, state) { var jsonContent = readJson(packageJsonPath, state.host); - switch (extensions) { - case 2: - case 0: - return tryReadFromField("typings") || tryReadFromField("types"); - case 1: - if (typeof jsonContent.main === "string") { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.No_types_specified_in_package_json_so_returning_main_value_of_0, jsonContent.main); - } - return ts.normalizePath(ts.combinePaths(baseDirectory, jsonContent.main)); - } - return undefined; - } + return readTypes ? tryReadFromField("typings") || tryReadFromField("types") : tryReadFromField("main"); function tryReadFromField(fieldName) { - if (ts.hasProperty(jsonContent, fieldName)) { - var typesFile = jsonContent[fieldName]; - if (typeof typesFile === "string") { - var typesFilePath = ts.normalizePath(ts.combinePaths(baseDirectory, typesFile)); - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.package_json_has_0_field_1_that_references_2, fieldName, typesFile, typesFilePath); - } - return typesFilePath; - } - else { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_string_got_1, fieldName, typeof typesFile); - } + if (!ts.hasProperty(jsonContent, fieldName)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.package_json_does_not_have_a_0_field, fieldName); } + return; } + var fileName = jsonContent[fieldName]; + if (typeof fileName !== "string") { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_string_got_1, fieldName, typeof fileName); + } + return; + } + var path = ts.normalizePath(ts.combinePaths(baseDirectory, fileName)); + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.package_json_has_0_field_1_that_references_2, fieldName, fileName, path); + } + return path; } } function readJson(path, host) { @@ -6183,11 +6507,12 @@ var ts; return [ts.combinePaths(currentDirectory, nodeModulesAtTypes)]; } var typeRoots; - forEachAncestorDirectory(currentDirectory, function (directory) { + forEachAncestorDirectory(ts.normalizePath(currentDirectory), function (directory) { var atTypes = ts.combinePaths(directory, nodeModulesAtTypes); if (host.directoryExists(atTypes)) { (typeRoots || (typeRoots = [])).push(atTypes); } + return undefined; }); return typeRoots; } @@ -6242,7 +6567,11 @@ var ts; return ts.forEach(typeRoots, function (typeRoot) { var candidate = ts.combinePaths(typeRoot, typeReferenceDirectiveName); var candidateDirectory = ts.getDirectoryPath(candidate); - return resolvedTypeScriptOnly(loadNodeModuleFromDirectory(2, candidate, failedLookupLocations, !directoryProbablyExists(candidateDirectory, host), moduleResolutionState)); + var directoryExists = directoryProbablyExists(candidateDirectory, host); + if (!directoryExists && traceEnabled) { + trace(host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, candidateDirectory); + } + return resolvedTypeScriptOnly(loadNodeModuleFromDirectory(Extensions.DtsOnly, candidate, failedLookupLocations, !directoryExists, moduleResolutionState)); }); } else { @@ -6258,7 +6587,8 @@ var ts; if (traceEnabled) { trace(host, ts.Diagnostics.Looking_up_in_node_modules_folder_initial_location_0, initialLocationForSecondaryLookup); } - resolvedFile = resolvedTypeScriptOnly(loadModuleFromNodeModules(2, typeReferenceDirectiveName, initialLocationForSecondaryLookup, failedLookupLocations, moduleResolutionState)); + var result = loadModuleFromNodeModules(Extensions.DtsOnly, typeReferenceDirectiveName, initialLocationForSecondaryLookup, failedLookupLocations, moduleResolutionState, undefined); + resolvedFile = resolvedTypeScriptOnly(result && result.value); if (!resolvedFile && traceEnabled) { trace(host, ts.Diagnostics.Type_reference_directive_0_was_not_resolved, typeReferenceDirectiveName); } @@ -6299,31 +6629,116 @@ var ts; return result; } ts.getAutomaticTypeDirectiveNames = getAutomaticTypeDirectiveNames; - function resolveModuleName(moduleName, containingFile, compilerOptions, host) { + function createModuleResolutionCache(currentDirectory, getCanonicalFileName) { + var directoryToModuleNameMap = ts.createFileMap(); + var moduleNameToDirectoryMap = ts.createMap(); + return { getOrCreateCacheForDirectory: getOrCreateCacheForDirectory, getOrCreateCacheForModuleName: getOrCreateCacheForModuleName }; + function getOrCreateCacheForDirectory(directoryName) { + var path = ts.toPath(directoryName, currentDirectory, getCanonicalFileName); + var perFolderCache = directoryToModuleNameMap.get(path); + if (!perFolderCache) { + perFolderCache = ts.createMap(); + directoryToModuleNameMap.set(path, perFolderCache); + } + return perFolderCache; + } + function getOrCreateCacheForModuleName(nonRelativeModuleName) { + if (!moduleHasNonRelativeName(nonRelativeModuleName)) { + return undefined; + } + var perModuleNameCache = moduleNameToDirectoryMap.get(nonRelativeModuleName); + if (!perModuleNameCache) { + perModuleNameCache = createPerModuleNameCache(); + moduleNameToDirectoryMap.set(nonRelativeModuleName, perModuleNameCache); + } + return perModuleNameCache; + } + function createPerModuleNameCache() { + var directoryPathMap = ts.createFileMap(); + return { get: get, set: set }; + function get(directory) { + return directoryPathMap.get(ts.toPath(directory, currentDirectory, getCanonicalFileName)); + } + function set(directory, result) { + var path = ts.toPath(directory, currentDirectory, getCanonicalFileName); + if (directoryPathMap.contains(path)) { + return; + } + directoryPathMap.set(path, result); + var resolvedFileName = result.resolvedModule && result.resolvedModule.resolvedFileName; + var commonPrefix = getCommonPrefix(path, resolvedFileName); + var current = path; + while (true) { + var parent = ts.getDirectoryPath(current); + if (parent === current || directoryPathMap.contains(parent)) { + break; + } + directoryPathMap.set(parent, result); + current = parent; + if (current === commonPrefix) { + break; + } + } + } + function getCommonPrefix(directory, resolution) { + if (resolution === undefined) { + return undefined; + } + var resolutionDirectory = ts.toPath(ts.getDirectoryPath(resolution), currentDirectory, getCanonicalFileName); + var i = 0; + while (i < Math.min(directory.length, resolutionDirectory.length) && directory.charCodeAt(i) === resolutionDirectory.charCodeAt(i)) { + i++; + } + var sep = directory.lastIndexOf(ts.directorySeparator, i); + if (sep < 0) { + return undefined; + } + return directory.substr(0, sep); + } + } + } + ts.createModuleResolutionCache = createModuleResolutionCache; + function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache) { var traceEnabled = isTraceEnabled(compilerOptions, host); if (traceEnabled) { trace(host, ts.Diagnostics.Resolving_module_0_from_1, moduleName, containingFile); } - var moduleResolution = compilerOptions.moduleResolution; - if (moduleResolution === undefined) { - moduleResolution = ts.getEmitModuleKind(compilerOptions) === ts.ModuleKind.CommonJS ? ts.ModuleResolutionKind.NodeJs : ts.ModuleResolutionKind.Classic; + var containingDirectory = ts.getDirectoryPath(containingFile); + var perFolderCache = cache && cache.getOrCreateCacheForDirectory(containingDirectory); + var result = perFolderCache && perFolderCache.get(moduleName); + if (result) { if (traceEnabled) { - trace(host, ts.Diagnostics.Module_resolution_kind_is_not_specified_using_0, ts.ModuleResolutionKind[moduleResolution]); + trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); } } else { - if (traceEnabled) { - trace(host, ts.Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0, ts.ModuleResolutionKind[moduleResolution]); + var moduleResolution = compilerOptions.moduleResolution; + if (moduleResolution === undefined) { + moduleResolution = ts.getEmitModuleKind(compilerOptions) === ts.ModuleKind.CommonJS ? ts.ModuleResolutionKind.NodeJs : ts.ModuleResolutionKind.Classic; + if (traceEnabled) { + trace(host, ts.Diagnostics.Module_resolution_kind_is_not_specified_using_0, ts.ModuleResolutionKind[moduleResolution]); + } + } + else { + if (traceEnabled) { + trace(host, ts.Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0, ts.ModuleResolutionKind[moduleResolution]); + } + } + switch (moduleResolution) { + case ts.ModuleResolutionKind.NodeJs: + result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache); + break; + case ts.ModuleResolutionKind.Classic: + result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache); + break; + } + if (perFolderCache) { + perFolderCache.set(moduleName, result); + var perModuleNameCache = cache.getOrCreateCacheForModuleName(moduleName); + if (perModuleNameCache) { + perModuleNameCache.set(containingDirectory, result); + } } - } - var result; - switch (moduleResolution) { - case ts.ModuleResolutionKind.NodeJs: - result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host); - break; - case ts.ModuleResolutionKind.Classic: - result = classicNameResolver(moduleName, containingFile, compilerOptions, host); - break; } if (traceEnabled) { if (result.resolvedModule) { @@ -6448,37 +6863,43 @@ var ts; return loader(extensions, candidate, failedLookupLocations, !directoryProbablyExists(ts.getDirectoryPath(candidate), state.host), state); } } - function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host) { + function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache) { + return nodeModuleNameResolverWorker(moduleName, containingFile, compilerOptions, host, cache, false); + } + ts.nodeModuleNameResolver = nodeModuleNameResolver; + function nodeModuleNameResolverWorker(moduleName, containingFile, compilerOptions, host, cache, jsOnly) { + if (jsOnly === void 0) { jsOnly = false; } var containingDirectory = ts.getDirectoryPath(containingFile); var traceEnabled = isTraceEnabled(compilerOptions, host); var failedLookupLocations = []; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; - var result = tryResolve(0) || tryResolve(1); - if (result) { - var resolved = result.resolved, isExternalLibraryImport = result.isExternalLibraryImport; + var result = jsOnly ? tryResolve(Extensions.JavaScript) : (tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript)); + if (result && result.value) { + var _a = result.value, resolved = _a.resolved, isExternalLibraryImport = _a.isExternalLibraryImport; return createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations); } return { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; function tryResolve(extensions) { - var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, nodeLoadModuleByRelativeName, failedLookupLocations, state); + var loader = function (extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { return nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, true); }; + var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, failedLookupLocations, state); if (resolved) { - return { resolved: resolved, isExternalLibraryImport: false }; + return toSearchResult({ resolved: resolved, isExternalLibraryImport: false }); } if (moduleHasNonRelativeName(moduleName)) { if (traceEnabled) { - trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder, moduleName); + trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1, moduleName, Extensions[extensions]); } - var resolved_1 = loadModuleFromNodeModules(extensions, moduleName, containingDirectory, failedLookupLocations, state); - return resolved_1 && { resolved: { path: realpath(resolved_1.path, host, traceEnabled), extension: resolved_1.extension }, isExternalLibraryImport: true }; + var resolved_1 = loadModuleFromNodeModules(extensions, moduleName, containingDirectory, failedLookupLocations, state, cache); + return resolved_1 && { value: resolved_1.value && { resolved: { path: realpath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }, isExternalLibraryImport: true } }; } else { var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, false, state); - return resolved_2 && { resolved: resolved_2, isExternalLibraryImport: false }; + var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, false, state, true); + return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: false }); } } } - ts.nodeModuleNameResolver = nodeModuleNameResolver; + ts.nodeModuleNameResolverWorker = nodeModuleNameResolverWorker; function realpath(path, host, traceEnabled) { if (!host.realpath) { return path; @@ -6489,12 +6910,35 @@ var ts; } return real; } - function nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { + function nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson) { if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0, candidate); + trace(state.host, ts.Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1, candidate, Extensions[extensions]); } - var resolvedFromFile = !ts.pathEndsWithDirectorySeparator(candidate) && loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); - return resolvedFromFile || loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); + if (!ts.pathEndsWithDirectorySeparator(candidate)) { + if (!onlyRecordFailures) { + var parentOfCandidate = ts.getDirectoryPath(candidate); + if (!directoryProbablyExists(parentOfCandidate, state.host)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, parentOfCandidate); + } + onlyRecordFailures = true; + } + } + var resolvedFromFile = loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); + if (resolvedFromFile) { + return resolvedFromFile; + } + } + if (!onlyRecordFailures) { + var candidateExists = directoryProbablyExists(candidate, state.host); + if (!candidateExists) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, candidate); + } + onlyRecordFailures = true; + } + } + return loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson); } function directoryProbablyExists(directoryName, host) { return !host.directoryExists || host.directoryExists(directoryName); @@ -6522,11 +6966,11 @@ var ts; } } switch (extensions) { - case 2: + case Extensions.DtsOnly: return tryExtension(".d.ts", ts.Extension.Dts); - case 0: + case Extensions.TypeScript: return tryExtension(".ts", ts.Extension.Ts) || tryExtension(".tsx", ts.Extension.Tsx) || tryExtension(".d.ts", ts.Extension.Dts); - case 1: + case Extensions.JavaScript: return tryExtension(".js", ts.Extension.Js) || tryExtension(".jsx", ts.Extension.Jsx); } function tryExtension(ext, extension) { @@ -6535,113 +6979,181 @@ var ts; } } function tryFile(fileName, failedLookupLocations, onlyRecordFailures, state) { - if (!onlyRecordFailures && state.host.fileExists(fileName)) { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName); - } - return fileName; - } - else { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.File_0_does_not_exist, fileName); - } - failedLookupLocations.push(fileName); - return undefined; - } - } - function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { - var packageJsonPath = pathToPackageJson(candidate); - var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); - if (directoryExists && state.host.fileExists(packageJsonPath)) { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); - } - var typesFile = tryReadTypesSection(extensions, packageJsonPath, candidate, state); - if (typesFile) { - var onlyRecordFailures_1 = !directoryProbablyExists(ts.getDirectoryPath(typesFile), state.host); - var fromFile = tryFile(typesFile, failedLookupLocations, onlyRecordFailures_1, state); - if (fromFile) { - return resolvedFromAnyFile(fromFile); - } - var x = tryAddingExtensions(typesFile, 0, failedLookupLocations, onlyRecordFailures_1, state); - if (x) { - return x; + if (!onlyRecordFailures) { + if (state.host.fileExists(fileName)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName); } + return fileName; } else { if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.package_json_does_not_have_a_types_or_main_field); + trace(state.host, ts.Diagnostics.File_0_does_not_exist, fileName); } } } - else { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.File_0_does_not_exist, packageJsonPath); + failedLookupLocations.push(fileName); + return undefined; + } + function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson) { + if (considerPackageJson === void 0) { considerPackageJson = true; } + var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); + if (considerPackageJson) { + var packageJsonPath = pathToPackageJson(candidate); + if (directoryExists && state.host.fileExists(packageJsonPath)) { + var fromPackageJson = loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state); + if (fromPackageJson) { + return fromPackageJson; + } + } + else { + if (directoryExists && state.traceEnabled) { + trace(state.host, ts.Diagnostics.File_0_does_not_exist, packageJsonPath); + } + failedLookupLocations.push(packageJsonPath); } - failedLookupLocations.push(packageJsonPath); } return loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state); } + function loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); + } + var file = tryReadPackageJsonFields(extensions !== Extensions.JavaScript, packageJsonPath, candidate, state); + if (!file) { + return undefined; + } + var onlyRecordFailures = !directoryProbablyExists(ts.getDirectoryPath(file), state.host); + var fromFile = tryFile(file, failedLookupLocations, onlyRecordFailures, state); + if (fromFile) { + var resolved = fromFile && resolvedIfExtensionMatches(extensions, fromFile); + if (resolved) { + return resolved; + } + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromFile); + } + } + var nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions; + return nodeLoadModuleByRelativeName(nextExtensions, file, failedLookupLocations, onlyRecordFailures, state, false); + } + function resolvedIfExtensionMatches(extensions, path) { + var extension = ts.tryGetExtensionFromPath(path); + return extension !== undefined && extensionIsOk(extensions, extension) ? { path: path, extension: extension } : undefined; + } + function extensionIsOk(extensions, extension) { + switch (extensions) { + case Extensions.JavaScript: + return extension === ts.Extension.Js || extension === ts.Extension.Jsx; + case Extensions.TypeScript: + return extension === ts.Extension.Ts || extension === ts.Extension.Tsx || extension === ts.Extension.Dts; + case Extensions.DtsOnly: + return extension === ts.Extension.Dts; + } + } function pathToPackageJson(directory) { return ts.combinePaths(directory, "package.json"); } - function loadModuleFromNodeModulesFolder(extensions, moduleName, directory, failedLookupLocations, state) { - var nodeModulesFolder = ts.combinePaths(directory, "node_modules"); - var nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, state.host); + function loadModuleFromNodeModulesFolder(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, failedLookupLocations, state) { var candidate = ts.normalizePath(ts.combinePaths(nodeModulesFolder, moduleName)); return loadModuleFromFile(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state) || loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state); } - function loadModuleFromNodeModules(extensions, moduleName, directory, failedLookupLocations, state) { - return loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, false); + function loadModuleFromNodeModules(extensions, moduleName, directory, failedLookupLocations, state, cache) { + return loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, false, cache); } function loadModuleFromNodeModulesAtTypes(moduleName, directory, failedLookupLocations, state) { - return loadModuleFromNodeModulesWorker(2, moduleName, directory, failedLookupLocations, state, true); + return loadModuleFromNodeModulesWorker(Extensions.DtsOnly, moduleName, directory, failedLookupLocations, state, true, undefined); } - function loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, typesOnly) { + function loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, typesOnly, cache) { + var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName); return forEachAncestorDirectory(ts.normalizeSlashes(directory), function (ancestorDirectory) { if (ts.getBaseFileName(ancestorDirectory) !== "node_modules") { - return loadModuleFromNodeModulesOneLevel(extensions, moduleName, ancestorDirectory, failedLookupLocations, state, typesOnly); + var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, ancestorDirectory, state.traceEnabled, state.host); + if (resolutionFromCache) { + return resolutionFromCache; + } + return toSearchResult(loadModuleFromNodeModulesOneLevel(extensions, moduleName, ancestorDirectory, failedLookupLocations, state, typesOnly)); } }); } function loadModuleFromNodeModulesOneLevel(extensions, moduleName, directory, failedLookupLocations, state, typesOnly) { if (typesOnly === void 0) { typesOnly = false; } - var packageResult = typesOnly ? undefined : loadModuleFromNodeModulesFolder(extensions, moduleName, directory, failedLookupLocations, state); + var nodeModulesFolder = ts.combinePaths(directory, "node_modules"); + var nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, state.host); + if (!nodeModulesFolderExists && state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesFolder); + } + var packageResult = typesOnly ? undefined : loadModuleFromNodeModulesFolder(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, failedLookupLocations, state); if (packageResult) { return packageResult; } - if (extensions !== 1) { - return loadModuleFromNodeModulesFolder(2, ts.combinePaths("@types", moduleName), directory, failedLookupLocations, state); + if (extensions !== Extensions.JavaScript) { + var nodeModulesAtTypes_1 = ts.combinePaths(nodeModulesFolder, "@types"); + var nodeModulesAtTypesExists = nodeModulesFolderExists; + if (nodeModulesFolderExists && !directoryProbablyExists(nodeModulesAtTypes_1, state.host)) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesAtTypes_1); + } + nodeModulesAtTypesExists = false; + } + return loadModuleFromNodeModulesFolder(Extensions.DtsOnly, mangleScopedPackage(moduleName, state), nodeModulesAtTypes_1, nodeModulesAtTypesExists, failedLookupLocations, state); } } - function classicNameResolver(moduleName, containingFile, compilerOptions, host) { + function mangleScopedPackage(moduleName, state) { + if (ts.startsWith(moduleName, "@")) { + var replaceSlash = moduleName.replace(ts.directorySeparator, "__"); + if (replaceSlash !== moduleName) { + var mangled = replaceSlash.slice(1); + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Scoped_package_detected_looking_in_0, mangled); + } + return mangled; + } + } + return moduleName; + } + function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, traceEnabled, host) { + var result = cache && cache.get(containingDirectory); + if (result) { + if (traceEnabled) { + trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); + } + return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension } }; + } + } + function classicNameResolver(moduleName, containingFile, compilerOptions, host, cache) { var traceEnabled = isTraceEnabled(compilerOptions, host); var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var failedLookupLocations = []; var containingDirectory = ts.getDirectoryPath(containingFile); - var resolved = tryResolve(0) || tryResolve(1); - return createResolvedModuleWithFailedLookupLocations(resolved, false, failedLookupLocations); + var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); + return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, false, failedLookupLocations); function tryResolve(extensions) { var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFile, failedLookupLocations, state); if (resolvedUsingSettings) { - return resolvedUsingSettings; + return { value: resolvedUsingSettings }; } + var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName); if (moduleHasNonRelativeName(moduleName)) { var resolved_3 = forEachAncestorDirectory(containingDirectory, function (directory) { + var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, directory, traceEnabled, host); + if (resolutionFromCache) { + return resolutionFromCache; + } var searchName = ts.normalizePath(ts.combinePaths(directory, moduleName)); - return loadModuleFromFile(extensions, searchName, failedLookupLocations, false, state); + return toSearchResult(loadModuleFromFile(extensions, searchName, failedLookupLocations, false, state)); }); if (resolved_3) { return resolved_3; } - if (extensions === 0) { + if (extensions === Extensions.TypeScript) { return loadModuleFromNodeModulesAtTypes(moduleName, containingDirectory, failedLookupLocations, state); } } else { var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - return loadModuleFromFile(extensions, candidate, failedLookupLocations, false, state); + return toSearchResult(loadModuleFromFile(extensions, candidate, failedLookupLocations, false, state)); } } } @@ -6653,10 +7165,13 @@ var ts; } var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var failedLookupLocations = []; - var resolved = loadModuleFromNodeModulesOneLevel(2, moduleName, globalCache, failedLookupLocations, state); + var resolved = loadModuleFromNodeModulesOneLevel(Extensions.DtsOnly, moduleName, globalCache, failedLookupLocations, state); return createResolvedModuleWithFailedLookupLocations(resolved, true, failedLookupLocations); } ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache; + function toSearchResult(value) { + return value !== undefined ? { value: value } : undefined; + } function forEachAncestorDirectory(directory, callback) { while (true) { var result = callback(directory); @@ -6727,13 +7242,12 @@ var ts; } typingsInstaller.validatePackageName = validatePackageName; var TypingsInstaller = (function () { - function TypingsInstaller(installTypingHost, globalCachePath, safeListPath, throttleLimit, telemetryEnabled, log) { + function TypingsInstaller(installTypingHost, globalCachePath, safeListPath, throttleLimit, log) { if (log === void 0) { log = nullLog; } this.installTypingHost = installTypingHost; this.globalCachePath = globalCachePath; this.safeListPath = safeListPath; this.throttleLimit = throttleLimit; - this.telemetryEnabled = telemetryEnabled; this.log = log; this.packageNameToTypingLocation = ts.createMap(); this.missingTypingsSet = ts.createMap(); @@ -6754,7 +7268,7 @@ var ts; if (this.log.isEnabled()) { this.log.writeLine("Closing file watchers for project '" + projectName + "'"); } - var watchers = this.projectWatchers[projectName]; + var watchers = this.projectWatchers.get(projectName); if (!watchers) { if (this.log.isEnabled()) { this.log.writeLine("No watchers are registered for project '" + projectName + "'"); @@ -6765,7 +7279,7 @@ var ts; var w = watchers_1[_i]; w.close(); } - delete this.projectWatchers[projectName]; + this.projectWatchers.delete(projectName); if (this.log.isEnabled()) { this.log.writeLine("Closing file watchers for project '" + projectName + "' - done."); } @@ -6799,7 +7313,7 @@ var ts; if (this.log.isEnabled()) { this.log.writeLine("Processing cache location '" + cacheLocation + "'"); } - if (this.knownCachesSet[cacheLocation]) { + if (this.knownCachesSet.get(cacheLocation)) { if (this.log.isEnabled()) { this.log.writeLine("Cache location was already processed..."); } @@ -6822,10 +7336,10 @@ var ts; } var typingFile = typingToFileName(cacheLocation, packageName, this.installTypingHost, this.log); if (!typingFile) { - this.missingTypingsSet[packageName] = true; + this.missingTypingsSet.set(packageName, true); continue; } - var existingTypingFile = this.packageNameToTypingLocation[packageName]; + var existingTypingFile = this.packageNameToTypingLocation.get(packageName); if (existingTypingFile === typingFile) { continue; } @@ -6837,14 +7351,14 @@ var ts; if (this.log.isEnabled()) { this.log.writeLine("Adding entry into typings cache: '" + packageName + "' => '" + typingFile + "'"); } - this.packageNameToTypingLocation[packageName] = typingFile; + this.packageNameToTypingLocation.set(packageName, typingFile); } } } if (this.log.isEnabled()) { this.log.writeLine("Finished processing cache location '" + cacheLocation + "'"); } - this.knownCachesSet[cacheLocation] = true; + this.knownCachesSet.set(cacheLocation, true); }; TypingsInstaller.prototype.filterTypings = function (typingsToInstall) { if (typingsToInstall.length === 0) { @@ -6853,12 +7367,12 @@ var ts; var result = []; for (var _i = 0, typingsToInstall_1 = typingsToInstall; _i < typingsToInstall_1.length; _i++) { var typing = typingsToInstall_1[_i]; - if (this.missingTypingsSet[typing] || this.packageNameToTypingLocation[typing]) { + if (this.missingTypingsSet.get(typing) || this.packageNameToTypingLocation.get(typing)) { continue; } var validationResult = validatePackageName(typing); if (validationResult === PackageNameValidationResult.Ok) { - if (typing in this.typesRegistry) { + if (this.typesRegistry.has(typing)) { result.push(typing); } else { @@ -6868,7 +7382,7 @@ var ts; } } else { - this.missingTypingsSet[typing] = true; + this.missingTypingsSet.set(typing, true); if (this.log.isEnabled()) { switch (validationResult) { case PackageNameValidationResult.EmptyName: @@ -6914,8 +7428,7 @@ var ts; this.log.writeLine("Installing typings " + JSON.stringify(typingsToInstall)); } var filteredTypings = this.filterTypings(typingsToInstall); - var scopedTypings = filteredTypings.map(function (x) { return "@types/" + x; }); - if (scopedTypings.length === 0) { + if (filteredTypings.length === 0) { if (this.log.isEnabled()) { this.log.writeLine("All typings are known to be missing or invalid - no need to go any further"); } @@ -6924,45 +7437,56 @@ var ts; this.ensurePackageDirectoryExists(cachePath); var requestId = this.installRunCount; this.installRunCount++; + this.sendResponse({ + kind: server.EventBeginInstallTypes, + eventId: requestId, + typingsInstallerVersion: ts.version, + projectName: req.projectName + }); + var scopedTypings = filteredTypings.map(typingsName); this.installTypingsAsync(requestId, scopedTypings, cachePath, function (ok) { - if (_this.telemetryEnabled) { + try { + if (!ok) { + if (_this.log.isEnabled()) { + _this.log.writeLine("install request failed, marking packages as missing to prevent repeated requests: " + JSON.stringify(filteredTypings)); + } + for (var _i = 0, filteredTypings_1 = filteredTypings; _i < filteredTypings_1.length; _i++) { + var typing = filteredTypings_1[_i]; + _this.missingTypingsSet.set(typing, true); + } + return; + } + if (_this.log.isEnabled()) { + _this.log.writeLine("Installed typings " + JSON.stringify(scopedTypings)); + } + var installedTypingFiles = []; + for (var _a = 0, filteredTypings_2 = filteredTypings; _a < filteredTypings_2.length; _a++) { + var packageName = filteredTypings_2[_a]; + var typingFile = typingToFileName(cachePath, packageName, _this.installTypingHost, _this.log); + if (!typingFile) { + _this.missingTypingsSet.set(packageName, true); + continue; + } + if (!_this.packageNameToTypingLocation.has(packageName)) { + _this.packageNameToTypingLocation.set(packageName, typingFile); + } + installedTypingFiles.push(typingFile); + } + if (_this.log.isEnabled()) { + _this.log.writeLine("Installed typing files " + JSON.stringify(installedTypingFiles)); + } + _this.sendResponse(_this.createSetTypings(req, currentlyCachedTypings.concat(installedTypingFiles))); + } + finally { _this.sendResponse({ - kind: server.EventInstall, + kind: server.EventEndInstallTypes, + eventId: requestId, + projectName: req.projectName, packagesToInstall: scopedTypings, installSuccess: ok, typingsInstallerVersion: ts.version }); } - if (!ok) { - if (_this.log.isEnabled()) { - _this.log.writeLine("install request failed, marking packages as missing to prevent repeated requests: " + JSON.stringify(filteredTypings)); - } - for (var _i = 0, filteredTypings_1 = filteredTypings; _i < filteredTypings_1.length; _i++) { - var typing = filteredTypings_1[_i]; - _this.missingTypingsSet[typing] = true; - } - return; - } - if (_this.log.isEnabled()) { - _this.log.writeLine("Installed typings " + JSON.stringify(scopedTypings)); - } - var installedTypingFiles = []; - for (var _a = 0, filteredTypings_2 = filteredTypings; _a < filteredTypings_2.length; _a++) { - var packageName = filteredTypings_2[_a]; - var typingFile = typingToFileName(cachePath, packageName, _this.installTypingHost, _this.log); - if (!typingFile) { - _this.missingTypingsSet[packageName] = true; - continue; - } - if (!_this.packageNameToTypingLocation[packageName]) { - _this.packageNameToTypingLocation[packageName] = typingFile; - } - installedTypingFiles.push(typingFile); - } - if (_this.log.isEnabled()) { - _this.log.writeLine("Installed typing files " + JSON.stringify(installedTypingFiles)); - } - _this.sendResponse(_this.createSetTypings(req, currentlyCachedTypings.concat(installedTypingFiles))); }); }; TypingsInstaller.prototype.ensureDirectoryExists = function (directory, host) { @@ -6995,7 +7519,7 @@ var ts; }, 2000); watchers.push(w); } - this.projectWatchers[projectName] = watchers; + this.projectWatchers.set(projectName, watchers); }; TypingsInstaller.prototype.createSetTypings = function (request, typings) { return { @@ -7013,7 +7537,7 @@ var ts; }; TypingsInstaller.prototype.executeWithThrottling = function () { var _this = this; - var _loop_2 = function () { + var _loop_3 = function () { this_1.inFlightRequestCount++; var request = this_1.pendingRunRequests.pop(); this_1.installWorker(request.requestId, request.args, request.cwd, function (ok) { @@ -7024,12 +7548,17 @@ var ts; }; var this_1 = this; while (this.inFlightRequestCount < this.throttleLimit && this.pendingRunRequests.length) { - _loop_2(); + _loop_3(); } }; return TypingsInstaller; }()); typingsInstaller.TypingsInstaller = TypingsInstaller; + function typingsName(packageName) { + return "@types/" + packageName + "@ts" + versionMajorMinor; + } + typingsInstaller.typingsName = typingsName; + var versionMajorMinor = ts.version.split(".").slice(0, 2).join("."); })(typingsInstaller = server.typingsInstaller || (server.typingsInstaller = {})); })(server = ts.server || (ts.server = {})); })(ts || (ts = {})); @@ -7044,17 +7573,23 @@ var ts; var FileLog = (function () { function FileLog(logFile) { this.logFile = logFile; + this.logEnabled = true; } FileLog.prototype.isEnabled = function () { - return this.logFile !== undefined; + return this.logEnabled && this.logFile !== undefined; }; FileLog.prototype.writeLine = function (text) { - fs.appendFileSync(this.logFile, text + ts.sys.newLine); + try { + fs.appendFileSync(this.logFile, text + ts.sys.newLine); + } + catch (e) { + this.logEnabled = false; + } }; return FileLog; }()); function getNPMLocation(processName) { - if (path.basename(processName).indexOf("node") == 0) { + if (path.basename(processName).indexOf("node") === 0) { return "\"" + path.join(path.dirname(process.argv[0]), "npm") + "\""; } else { @@ -7070,7 +7605,7 @@ var ts; } try { var content = JSON.parse(host.readFile(typesRegistryFilePath)); - return ts.createMap(content.entries); + return ts.createMapFromTemplate(content.entries); } catch (e) { if (log.isEnabled()) { @@ -7085,8 +7620,8 @@ var ts; } var NodeTypingsInstaller = (function (_super) { __extends(NodeTypingsInstaller, _super); - function NodeTypingsInstaller(globalTypingsCacheLocation, throttleLimit, telemetryEnabled, log) { - var _this = _super.call(this, ts.sys, globalTypingsCacheLocation, ts.toPath("typingSafeList.json", __dirname, ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)), throttleLimit, telemetryEnabled, log) || this; + function NodeTypingsInstaller(globalTypingsCacheLocation, typingSafeListLocation, throttleLimit, log) { + var _this = _super.call(this, ts.sys, globalTypingsCacheLocation, typingSafeListLocation ? ts.toPath(typingSafeListLocation, "", ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)) : ts.toPath("typingSafeList.json", __dirname, ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)), throttleLimit, log) || this; if (_this.log.isEnabled()) { _this.log.writeLine("Process id: " + process.pid); } @@ -7103,6 +7638,10 @@ var ts; if (_this.log.isEnabled()) { _this.log.writeLine("Error updating " + TypesRegistryPackageName + " package: " + e.message); } + _this.delayedInitializationError = { + kind: "event::initializationFailed", + message: e.message + }; } _this.typesRegistry = loadTypesRegistryFile(getTypesRegistryFileLocation(globalTypingsCacheLocation), _this.installTypingHost, _this.log); return _this; @@ -7110,6 +7649,10 @@ var ts; NodeTypingsInstaller.prototype.listen = function () { var _this = this; process.on("message", function (req) { + if (_this.delayedInitializationError) { + _this.sendResponse(_this.delayedInitializationError); + _this.delayedInitializationError = undefined; + } switch (req.kind) { case "discover": _this.install(req); @@ -7155,7 +7698,7 @@ var ts; typingsInstaller.NodeTypingsInstaller = NodeTypingsInstaller; var logFilePath = server.findArgument(server.Arguments.LogFile); var globalTypingsCacheLocation = server.findArgument(server.Arguments.GlobalCacheLocation); - var telemetryEnabled = server.hasArgument(server.Arguments.EnableTelemetry); + var typingSafeListLocation = server.findArgument(server.Arguments.TypingSafeListLocation); var log = new FileLog(logFilePath); if (log.isEnabled()) { process.on("uncaughtException", function (e) { @@ -7168,7 +7711,7 @@ var ts; } process.exit(0); }); - var installer = new NodeTypingsInstaller(globalTypingsCacheLocation, 5, telemetryEnabled, log); + var installer = new NodeTypingsInstaller(globalTypingsCacheLocation, typingSafeListLocation, 5, log); installer.listen(); })(typingsInstaller = server.typingsInstaller || (server.typingsInstaller = {})); })(server = ts.server || (ts.server = {})); diff --git a/node_modules/typescript/package.json b/node_modules/typescript/package.json index cd55aa06f..b39c4e759 100644 --- a/node_modules/typescript/package.json +++ b/node_modules/typescript/package.json @@ -2,7 +2,7 @@ "name": "typescript", "author": "Microsoft Corp.", "homepage": "http://typescriptlang.org/", - "version": "2.2.0-dev.20161127", + "version": "2.3.0-dev.20170419", "license": "Apache-2.0", "description": "TypeScript is a language for application scale JavaScript development", "keywords": [ @@ -26,7 +26,7 @@ "tsserver": "./bin/tsserver" }, "engines": { - "node": ">=0.8.0" + "node": ">=4.2.0" }, "devDependencies": { "@types/browserify": "latest", @@ -60,7 +60,7 @@ "gulp-insert": "latest", "gulp-newer": "latest", "gulp-sourcemaps": "latest", - "gulp-typescript": "latest", + "gulp-typescript": "3.1.5", "into-stream": "latest", "istanbul": "latest", "jake": "latest", diff --git a/node_modules/v8flags/README.md b/node_modules/v8flags/README.md index 7cc6bbc13..ca6065b22 100644 --- a/node_modules/v8flags/README.md +++ b/node_modules/v8flags/README.md @@ -23,6 +23,8 @@ v8flags(function (err, results) { ## Release History +* 2017-04-18 - v2.1.0 - hash username to support invalid path characters +* 2017-03-31 - v2.0.12 - don't pollute global namespace * 2015-12-07 - v2.0.11 - cache to temp directory if home is present but unwritable * 2015-07-28 - v2.0.10 - don't throw for electron runtime, just call back with empty array * 2015-06-25 - v2.0.9 - call back with flags even if cache file can't be written diff --git a/node_modules/v8flags/index.js b/node_modules/v8flags/index.js index a368b5ced..40404d005 100644 --- a/node_modules/v8flags/index.js +++ b/node_modules/v8flags/index.js @@ -5,12 +5,14 @@ const os = require('os'); const fs = require('fs'); const path = require('path'); +const crypto = require('crypto'); const execFile = require('child_process').execFile; const env = process.env; -const user = env.LOGNAME || env.USER || env.LNAME || env.USERNAME; -const configfile = '.v8flags.'+process.versions.v8+'.'+user+'.json'; +const user = env.LOGNAME || env.USER || env.LNAME || env.USERNAME || ''; const exclusions = ['--help']; +const configfile = '.v8flags.'+process.versions.v8+'.'+crypto.createHash('md5').update(user).digest('hex')+'.json'; + const failureMessage = [ 'Unable to cache a config file for v8flags to a your home directory', 'or a temporary folder. To fix this problem, please correct your', @@ -42,7 +44,7 @@ function tryOpenConfig (configpath, cb) { // if the config file is valid, it should be json and therefore // node should be able to require it directly. if this doesn't // throw, we're done! - content = require(configpath); + var content = require(configpath); process.nextTick(function () { cb(null, content); }); diff --git a/node_modules/v8flags/package.json b/node_modules/v8flags/package.json index 68001b170..b711a7282 100644 --- a/node_modules/v8flags/package.json +++ b/node_modules/v8flags/package.json @@ -1,7 +1,7 @@ { "name": "v8flags", "description": "Get available v8 flags.", - "version": "2.0.11", + "version": "2.1.1", "homepage": "https://github.com/tkellen/node-v8flags", "author": { "name": "Tyler Kellen", diff --git a/node_modules/vinyl-fs/node_modules/clone-stats/LICENSE.md b/node_modules/vinyl-fs/node_modules/clone-stats/LICENSE.md deleted file mode 100644 index 146cb32a7..000000000 --- a/node_modules/vinyl-fs/node_modules/clone-stats/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -## The MIT License (MIT) ## - -Copyright (c) 2014 Hugh Kennedy - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/vinyl-fs/node_modules/clone-stats/README.md b/node_modules/vinyl-fs/node_modules/clone-stats/README.md deleted file mode 100644 index 8b12b6fa5..000000000 --- a/node_modules/vinyl-fs/node_modules/clone-stats/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# clone-stats [![Flattr this!](https://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=hughskennedy&url=http://github.com/hughsk/clone-stats&title=clone-stats&description=hughsk/clone-stats%20on%20GitHub&language=en_GB&tags=flattr,github,javascript&category=software)[![experimental](http://hughsk.github.io/stability-badges/dist/experimental.svg)](http://github.com/hughsk/stability-badges) # - -Safely clone node's -[`fs.Stats`](http://nodejs.org/api/fs.html#fs_class_fs_stats) instances without -losing their class methods, i.e. `stat.isDirectory()` and co. - -## Usage ## - -[![clone-stats](https://nodei.co/npm/clone-stats.png?mini=true)](https://nodei.co/npm/clone-stats) - -### `copy = require('clone-stats')(stat)` ### - -Returns a clone of the original `fs.Stats` instance (`stat`). - -## License ## - -MIT. See [LICENSE.md](http://github.com/hughsk/clone-stats/blob/master/LICENSE.md) for details. diff --git a/node_modules/vinyl-fs/node_modules/clone-stats/index.js b/node_modules/vinyl-fs/node_modules/clone-stats/index.js deleted file mode 100644 index e797cfe6e..000000000 --- a/node_modules/vinyl-fs/node_modules/clone-stats/index.js +++ /dev/null @@ -1,13 +0,0 @@ -var Stat = require('fs').Stats - -module.exports = cloneStats - -function cloneStats(stats) { - var replacement = new Stat - - Object.keys(stats).forEach(function(key) { - replacement[key] = stats[key] - }) - - return replacement -} diff --git a/node_modules/vinyl-fs/node_modules/clone-stats/package.json b/node_modules/vinyl-fs/node_modules/clone-stats/package.json deleted file mode 100644 index 2880625c1..000000000 --- a/node_modules/vinyl-fs/node_modules/clone-stats/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "clone-stats", - "description": "Safely clone node's fs.Stats instances without losing their class methods", - "version": "0.0.1", - "main": "index.js", - "browser": "index.js", - "dependencies": {}, - "devDependencies": { - "tape": "~2.3.2" - }, - "scripts": { - "test": "node test" - }, - "author": "Hugh Kennedy (http://hughsk.io/)", - "license": "MIT", - "repository": { - "type": "git", - "url": "git://github.com/hughsk/clone-stats" - }, - "bugs": { - "url": "https://github.com/hughsk/clone-stats/issues" - }, - "homepage": "https://github.com/hughsk/clone-stats", - "keywords": [ - "stats", - "fs", - "clone", - "copy", - "prototype" - ] -} diff --git a/node_modules/vinyl-fs/node_modules/clone-stats/test.js b/node_modules/vinyl-fs/node_modules/clone-stats/test.js deleted file mode 100644 index e4bb2814d..000000000 --- a/node_modules/vinyl-fs/node_modules/clone-stats/test.js +++ /dev/null @@ -1,36 +0,0 @@ -var test = require('tape') -var clone = require('./') -var fs = require('fs') - -test('file', function(t) { - compare(t, fs.statSync(__filename)) - t.end() -}) - -test('directory', function(t) { - compare(t, fs.statSync(__dirname)) - t.end() -}) - -function compare(t, stat) { - var copy = clone(stat) - - t.deepEqual(stat, copy, 'clone has equal properties') - t.ok(stat instanceof fs.Stats, 'original is an fs.Stat') - t.ok(copy instanceof fs.Stats, 'copy is an fs.Stat') - - ;['isDirectory' - , 'isFile' - , 'isBlockDevice' - , 'isCharacterDevice' - , 'isSymbolicLink' - , 'isFIFO' - , 'isSocket' - ].forEach(function(method) { - t.equal( - stat[method].call(stat) - , copy[method].call(copy) - , 'equal value for stat.' + method + '()' - ) - }) -} diff --git a/node_modules/vinyl-fs/node_modules/replace-ext/.npmignore b/node_modules/vinyl-fs/node_modules/replace-ext/.npmignore deleted file mode 100644 index b5ef13a3c..000000000 --- a/node_modules/vinyl-fs/node_modules/replace-ext/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -.DS_Store -*.log -node_modules -build -*.node -components \ No newline at end of file diff --git a/node_modules/vinyl-fs/node_modules/replace-ext/.travis.yml b/node_modules/vinyl-fs/node_modules/replace-ext/.travis.yml deleted file mode 100644 index 8101b9fe7..000000000 --- a/node_modules/vinyl-fs/node_modules/replace-ext/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - "0.7" - - "0.8" - - "0.9" - - "0.10" -after_script: - - npm run coveralls \ No newline at end of file diff --git a/node_modules/vinyl-fs/node_modules/replace-ext/LICENSE b/node_modules/vinyl-fs/node_modules/replace-ext/LICENSE deleted file mode 100755 index 7cbe012c6..000000000 --- a/node_modules/vinyl-fs/node_modules/replace-ext/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2014 Fractal - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/vinyl-fs/node_modules/replace-ext/README.md b/node_modules/vinyl-fs/node_modules/replace-ext/README.md deleted file mode 100644 index 05b5d21fd..000000000 --- a/node_modules/vinyl-fs/node_modules/replace-ext/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# replace-ext [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Dependency Status][david-image]][david-url] - - -## Information - - - - - - - - - - - - - -
Packagereplace-ext
DescriptionReplaces a file extension with another one
Node Version>= 0.4
- -## Usage - -```javascript -var replaceExt = require('replace-ext'); - -var path = '/some/dir/file.js'; -var npath = replaceExt(path, '.coffee'); - -console.log(npath); // /some/dir/file.coffee -``` - -[npm-url]: https://npmjs.org/package/replace-ext -[npm-image]: https://badge.fury.io/js/replace-ext.png - -[travis-url]: https://travis-ci.org/wearefractal/replace-ext -[travis-image]: https://travis-ci.org/wearefractal/replace-ext.png?branch=master - -[coveralls-url]: https://coveralls.io/r/wearefractal/replace-ext -[coveralls-image]: https://coveralls.io/repos/wearefractal/replace-ext/badge.png - -[depstat-url]: https://david-dm.org/wearefractal/replace-ext -[depstat-image]: https://david-dm.org/wearefractal/replace-ext.png - -[david-url]: https://david-dm.org/wearefractal/replace-ext -[david-image]: https://david-dm.org/wearefractal/replace-ext.png?theme=shields.io \ No newline at end of file diff --git a/node_modules/vinyl-fs/node_modules/replace-ext/index.js b/node_modules/vinyl-fs/node_modules/replace-ext/index.js deleted file mode 100644 index 3f76938e4..000000000 --- a/node_modules/vinyl-fs/node_modules/replace-ext/index.js +++ /dev/null @@ -1,9 +0,0 @@ -var path = require('path'); - -module.exports = function(npath, ext) { - if (typeof npath !== 'string') return npath; - if (npath.length === 0) return npath; - - var nFileName = path.basename(npath, path.extname(npath))+ext; - return path.join(path.dirname(npath), nFileName); -}; \ No newline at end of file diff --git a/node_modules/vinyl-fs/node_modules/replace-ext/package.json b/node_modules/vinyl-fs/node_modules/replace-ext/package.json deleted file mode 100644 index 307d99b78..000000000 --- a/node_modules/vinyl-fs/node_modules/replace-ext/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name":"replace-ext", - "description":"Replaces a file extension with another one", - "version":"0.0.1", - "homepage":"http://github.com/wearefractal/replace-ext", - "repository":"git://github.com/wearefractal/replace-ext.git", - "author":"Fractal (http://wearefractal.com/)", - "main":"./index.js", - - "dependencies":{ - - }, - "devDependencies": { - "mocha": "~1.17.0", - "should": "~3.1.0", - "mocha-lcov-reporter": "~0.0.1", - "coveralls": "~2.6.1", - "istanbul": "~0.2.3", - "rimraf": "~2.2.5", - "jshint": "~2.4.1" - }, - "scripts": { - "test": "mocha --reporter spec && jshint", - "coveralls": "istanbul cover _mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage" - }, - "engines": { - "node": ">= 0.4" - }, - "licenses":[ - { - "type":"MIT", - "url":"http://github.com/wearefractal/replace-ext/raw/master/LICENSE" - } - ] -} diff --git a/node_modules/vinyl-fs/node_modules/replace-ext/test/main.js b/node_modules/vinyl-fs/node_modules/replace-ext/test/main.js deleted file mode 100644 index 51377021b..000000000 --- a/node_modules/vinyl-fs/node_modules/replace-ext/test/main.js +++ /dev/null @@ -1,51 +0,0 @@ -var replaceExt = require('../'); -var path = require('path'); -var should = require('should'); -require('mocha'); - -describe('replace-ext', function() { - it('should return a valid replaced extension on nested', function(done) { - var fname = path.join(__dirname, './fixtures/test.coffee'); - var expected = path.join(__dirname, './fixtures/test.js'); - var nu = replaceExt(fname, '.js'); - should.exist(nu); - nu.should.equal(expected); - done(); - }); - - it('should return a valid replaced extension on flat', function(done) { - var fname = 'test.coffee'; - var expected = 'test.js'; - var nu = replaceExt(fname, '.js'); - should.exist(nu); - nu.should.equal(expected); - done(); - }); - - it('should not return a valid replaced extension on empty string', function(done) { - var fname = ''; - var expected = ''; - var nu = replaceExt(fname, '.js'); - should.exist(nu); - nu.should.equal(expected); - done(); - }); - - it('should return a valid removed extension on nested', function(done) { - var fname = path.join(__dirname, './fixtures/test.coffee'); - var expected = path.join(__dirname, './fixtures/test'); - var nu = replaceExt(fname, ''); - should.exist(nu); - nu.should.equal(expected); - done(); - }); - - it('should return a valid added extension on nested', function(done) { - var fname = path.join(__dirname, './fixtures/test'); - var expected = path.join(__dirname, './fixtures/test.js'); - var nu = replaceExt(fname, '.js'); - should.exist(nu); - nu.should.equal(expected); - done(); - }); -}); diff --git a/node_modules/vinyl/index.js b/node_modules/vinyl/index.js index af91a1273..db5dc2a64 100644 --- a/node_modules/vinyl/index.js +++ b/node_modules/vinyl/index.js @@ -214,6 +214,8 @@ Object.defineProperty(File.prototype, 'base', { base = removeTrailingSep(normalize(base)); if (base !== this._cwd) { this._base = base; + } else { + delete this._base; } }, }); diff --git a/node_modules/vinyl/package.json b/node_modules/vinyl/package.json index 3f407f18c..dc94e7685 100644 --- a/node_modules/vinyl/package.json +++ b/node_modules/vinyl/package.json @@ -1,6 +1,6 @@ { "name": "vinyl", - "version": "2.0.0", + "version": "2.0.2", "description": "Virtual file format.", "author": "Gulp Team (http://gulpjs.com/)", "contributors": [ @@ -29,7 +29,7 @@ "clone": "^1.0.0", "clone-buffer": "^1.0.0", "clone-stats": "^1.0.0", - "cloneable-readable": "^0.5.0", + "cloneable-readable": "^1.0.0", "is-stream": "^1.1.0", "remove-trailing-separator": "^1.0.1", "replace-ext": "^1.0.0" diff --git a/node_modules/when/dist/browser/when.debug.js b/node_modules/when/dist/browser/when.debug.js index 8b1b356a2..4f0097946 100644 --- a/node_modules/when/dist/browser/when.debug.js +++ b/node_modules/when/dist/browser/when.debug.js @@ -1092,13 +1092,23 @@ define(function(require) { } function settleOne(p) { - var h = Promise._handler(p); - if(h.state() === 0) { + // Optimize the case where we get an already-resolved when.js promise + // by extracting its state: + var handler; + if (p instanceof Promise) { + // This is our own Promise type and we can reach its handler internals: + handler = p._handler.join(); + } + if((handler && handler.state() === 0) || !handler) { + // Either still pending, or not a Promise at all: return toPromise(p).then(state.fulfilled, state.rejected); } - h._unreport(); - return state.inspect(h); + // The promise is our own, but it is already resolved. Take a shortcut. + // Since we're not actually handling the resolution, we need to disable + // rejection reporting. + handler._unreport(); + return state.inspect(handler); } /** @@ -1705,8 +1715,8 @@ define(function(require) { } function hasMutationObserver () { - return (typeof MutationObserver === 'function' && MutationObserver) || - (typeof WebKitMutationObserver === 'function' && WebKitMutationObserver); + return (typeof MutationObserver !== 'undefined' && MutationObserver) || + (typeof WebKitMutationObserver !== 'undefined' && WebKitMutationObserver); } function initMutationObserver(MutationObserver) { @@ -2703,6 +2713,28 @@ define(function() { function noop() {} + function hasCustomEvent() { + if(typeof CustomEvent === 'function') { + try { + var ev = new CustomEvent('unhandledRejection'); + return ev instanceof CustomEvent; + } catch (ignoredException) {} + } + return false; + } + + function hasInternetExplorerCustomEvent() { + if(typeof document !== 'undefined' && typeof document.createEvent === 'function') { + try { + // Try to create one event to make sure it's supported + var ev = document.createEvent('CustomEvent'); + ev.initCustomEvent('eventType', false, true, {}); + return true; + } catch (ignoredException) {} + } + return false; + } + function initEmitRejection() { /*global process, self, CustomEvent*/ if(typeof process !== 'undefined' && process !== null @@ -2716,15 +2748,9 @@ define(function() { ? process.emit(type, rejection.value, rejection) : process.emit(type, rejection); }; - } else if(typeof self !== 'undefined' && typeof CustomEvent === 'function') { - return (function(noop, self, CustomEvent) { - var hasCustomEvent = false; - try { - var ev = new CustomEvent('unhandledRejection'); - hasCustomEvent = ev instanceof CustomEvent; - } catch (e) {} - - return !hasCustomEvent ? noop : function(type, rejection) { + } else if(typeof self !== 'undefined' && hasCustomEvent()) { + return (function (self, CustomEvent) { + return function (type, rejection) { var ev = new CustomEvent(type, { detail: { reason: rejection.value, @@ -2736,7 +2762,19 @@ define(function() { return !self.dispatchEvent(ev); }; - }(noop, self, CustomEvent)); + }(self, CustomEvent)); + } else if(typeof self !== 'undefined' && hasInternetExplorerCustomEvent()) { + return (function(self, document) { + return function(type, rejection) { + var ev = document.createEvent('CustomEvent'); + ev.initCustomEvent(type, false, true, { + reason: rejection.value, + key: rejection + }); + + return !self.dispatchEvent(ev); + }; + }(self, document)); } return noop; diff --git a/node_modules/when/dist/browser/when.debug.js.map b/node_modules/when/dist/browser/when.debug.js.map index f8fb33227..8f46e36d0 100644 --- a/node_modules/when/dist/browser/when.debug.js.map +++ b/node_modules/when/dist/browser/when.debug.js.map @@ -42,7 +42,7 @@ "when.js" ], "names": [], - "mappings": ";AAAA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA", + "mappings": ";AAAA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3SA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC37BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA", "sourcesContent": [ "require('../monitor/console');\nmodule.exports = require('./when.browserify.js');\n\n", "var when = module.exports = require('../when');\n\nwhen.callbacks = require('../callbacks');\nwhen.cancelable = require('../cancelable');\nwhen.delay = require('../delay');\nwhen.fn = require('../function');\nwhen.guard = require('../guard');\nwhen.keys = require('../keys');\nwhen.nodefn = when.node = require('../node');\nwhen.parallel = require('../parallel');\nwhen.pipeline = require('../pipeline');\nwhen.poll = require('../poll');\nwhen.sequence = require('../sequence');\nwhen.timeout = require('../timeout');\n", @@ -56,7 +56,7 @@ "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\t// Credit to Twisol (https://github.com/Twisol) for suggesting\n\t// this type of extensible queue + trampoline approach for next-tick conflation.\n\n\t/**\n\t * Async task scheduler\n\t * @param {function} async function to schedule a single async function\n\t * @constructor\n\t */\n\tfunction Scheduler(async) {\n\t\tthis._async = async;\n\t\tthis._running = false;\n\n\t\tthis._queue = this;\n\t\tthis._queueLen = 0;\n\t\tthis._afterQueue = {};\n\t\tthis._afterQueueLen = 0;\n\n\t\tvar self = this;\n\t\tthis.drain = function() {\n\t\t\tself._drain();\n\t\t};\n\t}\n\n\t/**\n\t * Enqueue a task\n\t * @param {{ run:function }} task\n\t */\n\tScheduler.prototype.enqueue = function(task) {\n\t\tthis._queue[this._queueLen++] = task;\n\t\tthis.run();\n\t};\n\n\t/**\n\t * Enqueue a task to run after the main task queue\n\t * @param {{ run:function }} task\n\t */\n\tScheduler.prototype.afterQueue = function(task) {\n\t\tthis._afterQueue[this._afterQueueLen++] = task;\n\t\tthis.run();\n\t};\n\n\tScheduler.prototype.run = function() {\n\t\tif (!this._running) {\n\t\t\tthis._running = true;\n\t\t\tthis._async(this.drain);\n\t\t}\n\t};\n\n\t/**\n\t * Drain the handler queue entirely, and then the after queue\n\t */\n\tScheduler.prototype._drain = function() {\n\t\tvar i = 0;\n\t\tfor (; i < this._queueLen; ++i) {\n\t\t\tthis._queue[i].run();\n\t\t\tthis._queue[i] = void 0;\n\t\t}\n\n\t\tthis._queueLen = 0;\n\t\tthis._running = false;\n\n\t\tfor (i = 0; i < this._afterQueueLen; ++i) {\n\t\t\tthis._afterQueue[i].run();\n\t\t\tthis._afterQueue[i] = void 0;\n\t\t}\n\n\t\tthis._afterQueueLen = 0;\n\t};\n\n\treturn Scheduler;\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n", "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\t/**\n\t * Custom error type for promises rejected by promise.timeout\n\t * @param {string} message\n\t * @constructor\n\t */\n\tfunction TimeoutError (message) {\n\t\tError.call(this);\n\t\tthis.message = message;\n\t\tthis.name = TimeoutError.name;\n\t\tif (typeof Error.captureStackTrace === 'function') {\n\t\t\tError.captureStackTrace(this, TimeoutError);\n\t\t}\n\t}\n\n\tTimeoutError.prototype = Object.create(Error.prototype);\n\tTimeoutError.prototype.constructor = TimeoutError;\n\n\treturn TimeoutError;\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));", "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\tmakeApply.tryCatchResolve = tryCatchResolve;\n\n\treturn makeApply;\n\n\tfunction makeApply(Promise, call) {\n\t\tif(arguments.length < 2) {\n\t\t\tcall = tryCatchResolve;\n\t\t}\n\n\t\treturn apply;\n\n\t\tfunction apply(f, thisArg, args) {\n\t\t\tvar p = Promise._defer();\n\t\t\tvar l = args.length;\n\t\t\tvar params = new Array(l);\n\t\t\tcallAndResolve({ f:f, thisArg:thisArg, args:args, params:params, i:l-1, call:call }, p._handler);\n\n\t\t\treturn p;\n\t\t}\n\n\t\tfunction callAndResolve(c, h) {\n\t\t\tif(c.i < 0) {\n\t\t\t\treturn call(c.f, c.thisArg, c.params, h);\n\t\t\t}\n\n\t\t\tvar handler = Promise._handler(c.args[c.i]);\n\t\t\thandler.fold(callAndResolveNext, c, void 0, h);\n\t\t}\n\n\t\tfunction callAndResolveNext(c, x, h) {\n\t\t\tc.params[c.i] = x;\n\t\t\tc.i -= 1;\n\t\t\tcallAndResolve(c, h);\n\t\t}\n\t}\n\n\tfunction tryCatchResolve(f, thisArg, args, resolver) {\n\t\ttry {\n\t\t\tresolver.resolve(f.apply(thisArg, args));\n\t\t} catch(e) {\n\t\t\tresolver.reject(e);\n\t\t}\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n\n\n", - "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar state = require('../state');\n\tvar applier = require('../apply');\n\n\treturn function array(Promise) {\n\n\t\tvar applyFold = applier(Promise);\n\t\tvar toPromise = Promise.resolve;\n\t\tvar all = Promise.all;\n\n\t\tvar ar = Array.prototype.reduce;\n\t\tvar arr = Array.prototype.reduceRight;\n\t\tvar slice = Array.prototype.slice;\n\n\t\t// Additional array combinators\n\n\t\tPromise.any = any;\n\t\tPromise.some = some;\n\t\tPromise.settle = settle;\n\n\t\tPromise.map = map;\n\t\tPromise.filter = filter;\n\t\tPromise.reduce = reduce;\n\t\tPromise.reduceRight = reduceRight;\n\n\t\t/**\n\t\t * When this promise fulfills with an array, do\n\t\t * onFulfilled.apply(void 0, array)\n\t\t * @param {function} onFulfilled function to apply\n\t\t * @returns {Promise} promise for the result of applying onFulfilled\n\t\t */\n\t\tPromise.prototype.spread = function(onFulfilled) {\n\t\t\treturn this.then(all).then(function(array) {\n\t\t\t\treturn onFulfilled.apply(this, array);\n\t\t\t});\n\t\t};\n\n\t\treturn Promise;\n\n\t\t/**\n\t\t * One-winner competitive race.\n\t\t * Return a promise that will fulfill when one of the promises\n\t\t * in the input array fulfills, or will reject when all promises\n\t\t * have rejected.\n\t\t * @param {array} promises\n\t\t * @returns {Promise} promise for the first fulfilled value\n\t\t */\n\t\tfunction any(promises) {\n\t\t\tvar p = Promise._defer();\n\t\t\tvar resolver = p._handler;\n\t\t\tvar l = promises.length>>>0;\n\n\t\t\tvar pending = l;\n\t\t\tvar errors = [];\n\n\t\t\tfor (var h, x, i = 0; i < l; ++i) {\n\t\t\t\tx = promises[i];\n\t\t\t\tif(x === void 0 && !(i in promises)) {\n\t\t\t\t\t--pending;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\th = Promise._handler(x);\n\t\t\t\tif(h.state() > 0) {\n\t\t\t\t\tresolver.become(h);\n\t\t\t\t\tPromise._visitRemaining(promises, i, h);\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\th.visit(resolver, handleFulfill, handleReject);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(pending === 0) {\n\t\t\t\tresolver.reject(new RangeError('any(): array must not be empty'));\n\t\t\t}\n\n\t\t\treturn p;\n\n\t\t\tfunction handleFulfill(x) {\n\t\t\t\t/*jshint validthis:true*/\n\t\t\t\terrors = null;\n\t\t\t\tthis.resolve(x); // this === resolver\n\t\t\t}\n\n\t\t\tfunction handleReject(e) {\n\t\t\t\t/*jshint validthis:true*/\n\t\t\t\tif(this.resolved) { // this === resolver\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\terrors.push(e);\n\t\t\t\tif(--pending === 0) {\n\t\t\t\t\tthis.reject(errors);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * N-winner competitive race\n\t\t * Return a promise that will fulfill when n input promises have\n\t\t * fulfilled, or will reject when it becomes impossible for n\n\t\t * input promises to fulfill (ie when promises.length - n + 1\n\t\t * have rejected)\n\t\t * @param {array} promises\n\t\t * @param {number} n\n\t\t * @returns {Promise} promise for the earliest n fulfillment values\n\t\t *\n\t\t * @deprecated\n\t\t */\n\t\tfunction some(promises, n) {\n\t\t\t/*jshint maxcomplexity:7*/\n\t\t\tvar p = Promise._defer();\n\t\t\tvar resolver = p._handler;\n\n\t\t\tvar results = [];\n\t\t\tvar errors = [];\n\n\t\t\tvar l = promises.length>>>0;\n\t\t\tvar nFulfill = 0;\n\t\t\tvar nReject;\n\t\t\tvar x, i; // reused in both for() loops\n\n\t\t\t// First pass: count actual array items\n\t\t\tfor(i=0; i nFulfill) {\n\t\t\t\tresolver.reject(new RangeError('some(): array must contain at least '\n\t\t\t\t+ n + ' item(s), but had ' + nFulfill));\n\t\t\t} else if(nFulfill === 0) {\n\t\t\t\tresolver.resolve(results);\n\t\t\t}\n\n\t\t\t// Second pass: observe each array item, make progress toward goals\n\t\t\tfor(i=0; i 2 ? ar.call(promises, liftCombine(f), arguments[2])\n\t\t\t\t\t: ar.call(promises, liftCombine(f));\n\t\t}\n\n\t\t/**\n\t\t * Traditional reduce function, similar to `Array.prototype.reduceRight()`, but\n\t\t * input may contain promises and/or values, and reduceFunc\n\t\t * may return either a value or a promise, *and* initialValue may\n\t\t * be a promise for the starting value.\n\t\t * @param {Array|Promise} promises array or promise for an array of anything,\n\t\t * may contain a mix of promises and values.\n\t\t * @param {function(accumulated:*, x:*, index:Number):*} f reduce function\n\t\t * @returns {Promise} that will resolve to the final reduced value\n\t\t */\n\t\tfunction reduceRight(promises, f /*, initialValue */) {\n\t\t\treturn arguments.length > 2 ? arr.call(promises, liftCombine(f), arguments[2])\n\t\t\t\t\t: arr.call(promises, liftCombine(f));\n\t\t}\n\n\t\tfunction liftCombine(f) {\n\t\t\treturn function(z, x, i) {\n\t\t\t\treturn applyFold(f, void 0, [z,x,i]);\n\t\t\t};\n\t\t}\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n", + "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar state = require('../state');\n\tvar applier = require('../apply');\n\n\treturn function array(Promise) {\n\n\t\tvar applyFold = applier(Promise);\n\t\tvar toPromise = Promise.resolve;\n\t\tvar all = Promise.all;\n\n\t\tvar ar = Array.prototype.reduce;\n\t\tvar arr = Array.prototype.reduceRight;\n\t\tvar slice = Array.prototype.slice;\n\n\t\t// Additional array combinators\n\n\t\tPromise.any = any;\n\t\tPromise.some = some;\n\t\tPromise.settle = settle;\n\n\t\tPromise.map = map;\n\t\tPromise.filter = filter;\n\t\tPromise.reduce = reduce;\n\t\tPromise.reduceRight = reduceRight;\n\n\t\t/**\n\t\t * When this promise fulfills with an array, do\n\t\t * onFulfilled.apply(void 0, array)\n\t\t * @param {function} onFulfilled function to apply\n\t\t * @returns {Promise} promise for the result of applying onFulfilled\n\t\t */\n\t\tPromise.prototype.spread = function(onFulfilled) {\n\t\t\treturn this.then(all).then(function(array) {\n\t\t\t\treturn onFulfilled.apply(this, array);\n\t\t\t});\n\t\t};\n\n\t\treturn Promise;\n\n\t\t/**\n\t\t * One-winner competitive race.\n\t\t * Return a promise that will fulfill when one of the promises\n\t\t * in the input array fulfills, or will reject when all promises\n\t\t * have rejected.\n\t\t * @param {array} promises\n\t\t * @returns {Promise} promise for the first fulfilled value\n\t\t */\n\t\tfunction any(promises) {\n\t\t\tvar p = Promise._defer();\n\t\t\tvar resolver = p._handler;\n\t\t\tvar l = promises.length>>>0;\n\n\t\t\tvar pending = l;\n\t\t\tvar errors = [];\n\n\t\t\tfor (var h, x, i = 0; i < l; ++i) {\n\t\t\t\tx = promises[i];\n\t\t\t\tif(x === void 0 && !(i in promises)) {\n\t\t\t\t\t--pending;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\th = Promise._handler(x);\n\t\t\t\tif(h.state() > 0) {\n\t\t\t\t\tresolver.become(h);\n\t\t\t\t\tPromise._visitRemaining(promises, i, h);\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\th.visit(resolver, handleFulfill, handleReject);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(pending === 0) {\n\t\t\t\tresolver.reject(new RangeError('any(): array must not be empty'));\n\t\t\t}\n\n\t\t\treturn p;\n\n\t\t\tfunction handleFulfill(x) {\n\t\t\t\t/*jshint validthis:true*/\n\t\t\t\terrors = null;\n\t\t\t\tthis.resolve(x); // this === resolver\n\t\t\t}\n\n\t\t\tfunction handleReject(e) {\n\t\t\t\t/*jshint validthis:true*/\n\t\t\t\tif(this.resolved) { // this === resolver\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\terrors.push(e);\n\t\t\t\tif(--pending === 0) {\n\t\t\t\t\tthis.reject(errors);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * N-winner competitive race\n\t\t * Return a promise that will fulfill when n input promises have\n\t\t * fulfilled, or will reject when it becomes impossible for n\n\t\t * input promises to fulfill (ie when promises.length - n + 1\n\t\t * have rejected)\n\t\t * @param {array} promises\n\t\t * @param {number} n\n\t\t * @returns {Promise} promise for the earliest n fulfillment values\n\t\t *\n\t\t * @deprecated\n\t\t */\n\t\tfunction some(promises, n) {\n\t\t\t/*jshint maxcomplexity:7*/\n\t\t\tvar p = Promise._defer();\n\t\t\tvar resolver = p._handler;\n\n\t\t\tvar results = [];\n\t\t\tvar errors = [];\n\n\t\t\tvar l = promises.length>>>0;\n\t\t\tvar nFulfill = 0;\n\t\t\tvar nReject;\n\t\t\tvar x, i; // reused in both for() loops\n\n\t\t\t// First pass: count actual array items\n\t\t\tfor(i=0; i nFulfill) {\n\t\t\t\tresolver.reject(new RangeError('some(): array must contain at least '\n\t\t\t\t+ n + ' item(s), but had ' + nFulfill));\n\t\t\t} else if(nFulfill === 0) {\n\t\t\t\tresolver.resolve(results);\n\t\t\t}\n\n\t\t\t// Second pass: observe each array item, make progress toward goals\n\t\t\tfor(i=0; i 2 ? ar.call(promises, liftCombine(f), arguments[2])\n\t\t\t\t\t: ar.call(promises, liftCombine(f));\n\t\t}\n\n\t\t/**\n\t\t * Traditional reduce function, similar to `Array.prototype.reduceRight()`, but\n\t\t * input may contain promises and/or values, and reduceFunc\n\t\t * may return either a value or a promise, *and* initialValue may\n\t\t * be a promise for the starting value.\n\t\t * @param {Array|Promise} promises array or promise for an array of anything,\n\t\t * may contain a mix of promises and values.\n\t\t * @param {function(accumulated:*, x:*, index:Number):*} f reduce function\n\t\t * @returns {Promise} that will resolve to the final reduced value\n\t\t */\n\t\tfunction reduceRight(promises, f /*, initialValue */) {\n\t\t\treturn arguments.length > 2 ? arr.call(promises, liftCombine(f), arguments[2])\n\t\t\t\t\t: arr.call(promises, liftCombine(f));\n\t\t}\n\n\t\tfunction liftCombine(f) {\n\t\t\treturn function(z, x, i) {\n\t\t\t\treturn applyFold(f, void 0, [z,x,i]);\n\t\t\t};\n\t\t}\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n", "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function flow(Promise) {\n\n\t\tvar resolve = Promise.resolve;\n\t\tvar reject = Promise.reject;\n\t\tvar origCatch = Promise.prototype['catch'];\n\n\t\t/**\n\t\t * Handle the ultimate fulfillment value or rejection reason, and assume\n\t\t * responsibility for all errors. If an error propagates out of result\n\t\t * or handleFatalError, it will be rethrown to the host, resulting in a\n\t\t * loud stack track on most platforms and a crash on some.\n\t\t * @param {function?} onResult\n\t\t * @param {function?} onError\n\t\t * @returns {undefined}\n\t\t */\n\t\tPromise.prototype.done = function(onResult, onError) {\n\t\t\tthis._handler.visit(this._handler.receiver, onResult, onError);\n\t\t};\n\n\t\t/**\n\t\t * Add Error-type and predicate matching to catch. Examples:\n\t\t * promise.catch(TypeError, handleTypeError)\n\t\t * .catch(predicate, handleMatchedErrors)\n\t\t * .catch(handleRemainingErrors)\n\t\t * @param onRejected\n\t\t * @returns {*}\n\t\t */\n\t\tPromise.prototype['catch'] = Promise.prototype.otherwise = function(onRejected) {\n\t\t\tif (arguments.length < 2) {\n\t\t\t\treturn origCatch.call(this, onRejected);\n\t\t\t}\n\n\t\t\tif(typeof onRejected !== 'function') {\n\t\t\t\treturn this.ensure(rejectInvalidPredicate);\n\t\t\t}\n\n\t\t\treturn origCatch.call(this, createCatchFilter(arguments[1], onRejected));\n\t\t};\n\n\t\t/**\n\t\t * Wraps the provided catch handler, so that it will only be called\n\t\t * if the predicate evaluates truthy\n\t\t * @param {?function} handler\n\t\t * @param {function} predicate\n\t\t * @returns {function} conditional catch handler\n\t\t */\n\t\tfunction createCatchFilter(handler, predicate) {\n\t\t\treturn function(e) {\n\t\t\t\treturn evaluatePredicate(e, predicate)\n\t\t\t\t\t? handler.call(this, e)\n\t\t\t\t\t: reject(e);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Ensures that onFulfilledOrRejected will be called regardless of whether\n\t\t * this promise is fulfilled or rejected. onFulfilledOrRejected WILL NOT\n\t\t * receive the promises' value or reason. Any returned value will be disregarded.\n\t\t * onFulfilledOrRejected may throw or return a rejected promise to signal\n\t\t * an additional error.\n\t\t * @param {function} handler handler to be called regardless of\n\t\t * fulfillment or rejection\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype['finally'] = Promise.prototype.ensure = function(handler) {\n\t\t\tif(typeof handler !== 'function') {\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\treturn this.then(function(x) {\n\t\t\t\treturn runSideEffect(handler, this, identity, x);\n\t\t\t}, function(e) {\n\t\t\t\treturn runSideEffect(handler, this, reject, e);\n\t\t\t});\n\t\t};\n\n\t\tfunction runSideEffect (handler, thisArg, propagate, value) {\n\t\t\tvar result = handler.call(thisArg);\n\t\t\treturn maybeThenable(result)\n\t\t\t\t? propagateValue(result, propagate, value)\n\t\t\t\t: propagate(value);\n\t\t}\n\n\t\tfunction propagateValue (result, propagate, x) {\n\t\t\treturn resolve(result).then(function () {\n\t\t\t\treturn propagate(x);\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Recover from a failure by returning a defaultValue. If defaultValue\n\t\t * is a promise, it's fulfillment value will be used. If defaultValue is\n\t\t * a promise that rejects, the returned promise will reject with the\n\t\t * same reason.\n\t\t * @param {*} defaultValue\n\t\t * @returns {Promise} new promise\n\t\t */\n\t\tPromise.prototype['else'] = Promise.prototype.orElse = function(defaultValue) {\n\t\t\treturn this.then(void 0, function() {\n\t\t\t\treturn defaultValue;\n\t\t\t});\n\t\t};\n\n\t\t/**\n\t\t * Shortcut for .then(function() { return value; })\n\t\t * @param {*} value\n\t\t * @return {Promise} a promise that:\n\t\t * - is fulfilled if value is not a promise, or\n\t\t * - if value is a promise, will fulfill with its value, or reject\n\t\t * with its reason.\n\t\t */\n\t\tPromise.prototype['yield'] = function(value) {\n\t\t\treturn this.then(function() {\n\t\t\t\treturn value;\n\t\t\t});\n\t\t};\n\n\t\t/**\n\t\t * Runs a side effect when this promise fulfills, without changing the\n\t\t * fulfillment value.\n\t\t * @param {function} onFulfilledSideEffect\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype.tap = function(onFulfilledSideEffect) {\n\t\t\treturn this.then(onFulfilledSideEffect)['yield'](this);\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n\tfunction rejectInvalidPredicate() {\n\t\tthrow new TypeError('catch predicate must be a function');\n\t}\n\n\tfunction evaluatePredicate(e, predicate) {\n\t\treturn isError(predicate) ? e instanceof predicate : predicate(e);\n\t}\n\n\tfunction isError(predicate) {\n\t\treturn predicate === Error\n\t\t\t|| (predicate != null && predicate.prototype instanceof Error);\n\t}\n\n\tfunction maybeThenable(x) {\n\t\treturn (typeof x === 'object' || typeof x === 'function') && x !== null;\n\t}\n\n\tfunction identity(x) {\n\t\treturn x;\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n", "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n/** @author Jeff Escalante */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function fold(Promise) {\n\n\t\tPromise.prototype.fold = function(f, z) {\n\t\t\tvar promise = this._beget();\n\n\t\t\tthis._handler.fold(function(z, x, to) {\n\t\t\t\tPromise._handler(z).fold(function(x, z, to) {\n\t\t\t\t\tto.resolve(f.call(this, z, x));\n\t\t\t\t}, x, this, to);\n\t\t\t}, z, promise._handler.receiver, promise._handler);\n\n\t\t\treturn promise;\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n", "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar inspect = require('../state').inspect;\n\n\treturn function inspection(Promise) {\n\n\t\tPromise.prototype.inspect = function() {\n\t\t\treturn inspect(Promise._handler(this));\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n", @@ -65,10 +65,10 @@ "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar env = require('../env');\n\tvar TimeoutError = require('../TimeoutError');\n\n\tfunction setTimeout(f, ms, x, y) {\n\t\treturn env.setTimer(function() {\n\t\t\tf(x, y, ms);\n\t\t}, ms);\n\t}\n\n\treturn function timed(Promise) {\n\t\t/**\n\t\t * Return a new promise whose fulfillment value is revealed only\n\t\t * after ms milliseconds\n\t\t * @param {number} ms milliseconds\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype.delay = function(ms) {\n\t\t\tvar p = this._beget();\n\t\t\tthis._handler.fold(handleDelay, ms, void 0, p._handler);\n\t\t\treturn p;\n\t\t};\n\n\t\tfunction handleDelay(ms, x, h) {\n\t\t\tsetTimeout(resolveDelay, ms, x, h);\n\t\t}\n\n\t\tfunction resolveDelay(x, h) {\n\t\t\th.resolve(x);\n\t\t}\n\n\t\t/**\n\t\t * Return a new promise that rejects after ms milliseconds unless\n\t\t * this promise fulfills earlier, in which case the returned promise\n\t\t * fulfills with the same value.\n\t\t * @param {number} ms milliseconds\n\t\t * @param {Error|*=} reason optional rejection reason to use, defaults\n\t\t * to a TimeoutError if not provided\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype.timeout = function(ms, reason) {\n\t\t\tvar p = this._beget();\n\t\t\tvar h = p._handler;\n\n\t\t\tvar t = setTimeout(onTimeout, ms, reason, p._handler);\n\n\t\t\tthis._handler.visit(h,\n\t\t\t\tfunction onFulfill(x) {\n\t\t\t\t\tenv.clearTimer(t);\n\t\t\t\t\tthis.resolve(x); // this = h\n\t\t\t\t},\n\t\t\t\tfunction onReject(x) {\n\t\t\t\t\tenv.clearTimer(t);\n\t\t\t\t\tthis.reject(x); // this = h\n\t\t\t\t},\n\t\t\t\th.notify);\n\n\t\t\treturn p;\n\t\t};\n\n\t\tfunction onTimeout(reason, h, ms) {\n\t\t\tvar e = typeof reason === 'undefined'\n\t\t\t\t? new TimeoutError('timed out after ' + ms + 'ms')\n\t\t\t\t: reason;\n\t\t\th.reject(e);\n\t\t}\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n", "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar setTimer = require('../env').setTimer;\n\tvar format = require('../format');\n\n\treturn function unhandledRejection(Promise) {\n\n\t\tvar logError = noop;\n\t\tvar logInfo = noop;\n\t\tvar localConsole;\n\n\t\tif(typeof console !== 'undefined') {\n\t\t\t// Alias console to prevent things like uglify's drop_console option from\n\t\t\t// removing console.log/error. Unhandled rejections fall into the same\n\t\t\t// category as uncaught exceptions, and build tools shouldn't silence them.\n\t\t\tlocalConsole = console;\n\t\t\tlogError = typeof localConsole.error !== 'undefined'\n\t\t\t\t? function (e) { localConsole.error(e); }\n\t\t\t\t: function (e) { localConsole.log(e); };\n\n\t\t\tlogInfo = typeof localConsole.info !== 'undefined'\n\t\t\t\t? function (e) { localConsole.info(e); }\n\t\t\t\t: function (e) { localConsole.log(e); };\n\t\t}\n\n\t\tPromise.onPotentiallyUnhandledRejection = function(rejection) {\n\t\t\tenqueue(report, rejection);\n\t\t};\n\n\t\tPromise.onPotentiallyUnhandledRejectionHandled = function(rejection) {\n\t\t\tenqueue(unreport, rejection);\n\t\t};\n\n\t\tPromise.onFatalRejection = function(rejection) {\n\t\t\tenqueue(throwit, rejection.value);\n\t\t};\n\n\t\tvar tasks = [];\n\t\tvar reported = [];\n\t\tvar running = null;\n\n\t\tfunction report(r) {\n\t\t\tif(!r.handled) {\n\t\t\t\treported.push(r);\n\t\t\t\tlogError('Potentially unhandled rejection [' + r.id + '] ' + format.formatError(r.value));\n\t\t\t}\n\t\t}\n\n\t\tfunction unreport(r) {\n\t\t\tvar i = reported.indexOf(r);\n\t\t\tif(i >= 0) {\n\t\t\t\treported.splice(i, 1);\n\t\t\t\tlogInfo('Handled previous rejection [' + r.id + '] ' + format.formatObject(r.value));\n\t\t\t}\n\t\t}\n\n\t\tfunction enqueue(f, x) {\n\t\t\ttasks.push(f, x);\n\t\t\tif(running === null) {\n\t\t\t\trunning = setTimer(flush, 0);\n\t\t\t}\n\t\t}\n\n\t\tfunction flush() {\n\t\t\trunning = null;\n\t\t\twhile(tasks.length > 0) {\n\t\t\t\ttasks.shift()(tasks.shift());\n\t\t\t}\n\t\t}\n\n\t\treturn Promise;\n\t};\n\n\tfunction throwit(e) {\n\t\tthrow e;\n\t}\n\n\tfunction noop() {}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n", "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function addWith(Promise) {\n\t\t/**\n\t\t * Returns a promise whose handlers will be called with `this` set to\n\t\t * the supplied receiver. Subsequent promises derived from the\n\t\t * returned promise will also have their handlers called with receiver\n\t\t * as `this`. Calling `with` with undefined or no arguments will return\n\t\t * a promise whose handlers will again be called in the usual Promises/A+\n\t\t * way (no `this`) thus safely undoing any previous `with` in the\n\t\t * promise chain.\n\t\t *\n\t\t * WARNING: Promises returned from `with`/`withThis` are NOT Promises/A+\n\t\t * compliant, specifically violating 2.2.5 (http://promisesaplus.com/#point-41)\n\t\t *\n\t\t * @param {object} receiver `this` value for all handlers attached to\n\t\t * the returned promise.\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype['with'] = Promise.prototype.withThis = function(receiver) {\n\t\t\tvar p = this._beget();\n\t\t\tvar child = p._handler;\n\t\t\tchild.receiver = receiver;\n\t\t\tthis._handler.chain(child, receiver);\n\t\t\treturn p;\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n\n", - "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n/*global process,document,setTimeout,clearTimeout,MutationObserver,WebKitMutationObserver*/\n(function(define) { 'use strict';\ndefine(function(require) {\n\t/*jshint maxcomplexity:6*/\n\n\t// Sniff \"best\" async scheduling option\n\t// Prefer process.nextTick or MutationObserver, then check for\n\t// setTimeout, and finally vertx, since its the only env that doesn't\n\t// have setTimeout\n\n\tvar MutationObs;\n\tvar capturedSetTimeout = typeof setTimeout !== 'undefined' && setTimeout;\n\n\t// Default env\n\tvar setTimer = function(f, ms) { return setTimeout(f, ms); };\n\tvar clearTimer = function(t) { return clearTimeout(t); };\n\tvar asap = function (f) { return capturedSetTimeout(f, 0); };\n\n\t// Detect specific env\n\tif (isNode()) { // Node\n\t\tasap = function (f) { return process.nextTick(f); };\n\n\t} else if (MutationObs = hasMutationObserver()) { // Modern browser\n\t\tasap = initMutationObserver(MutationObs);\n\n\t} else if (!capturedSetTimeout) { // vert.x\n\t\tvar vertxRequire = require;\n\t\tvar vertx = vertxRequire('vertx');\n\t\tsetTimer = function (f, ms) { return vertx.setTimer(ms, f); };\n\t\tclearTimer = vertx.cancelTimer;\n\t\tasap = vertx.runOnLoop || vertx.runOnContext;\n\t}\n\n\treturn {\n\t\tsetTimer: setTimer,\n\t\tclearTimer: clearTimer,\n\t\tasap: asap\n\t};\n\n\tfunction isNode () {\n\t\treturn typeof process !== 'undefined' &&\n\t\t\tObject.prototype.toString.call(process) === '[object process]';\n\t}\n\n\tfunction hasMutationObserver () {\n\t\treturn (typeof MutationObserver === 'function' && MutationObserver) ||\n\t\t\t(typeof WebKitMutationObserver === 'function' && WebKitMutationObserver);\n\t}\n\n\tfunction initMutationObserver(MutationObserver) {\n\t\tvar scheduled;\n\t\tvar node = document.createTextNode('');\n\t\tvar o = new MutationObserver(run);\n\t\to.observe(node, { characterData: true });\n\n\t\tfunction run() {\n\t\t\tvar f = scheduled;\n\t\t\tscheduled = void 0;\n\t\t\tf();\n\t\t}\n\n\t\tvar i = 0;\n\t\treturn function (f) {\n\t\t\tscheduled = f;\n\t\t\tnode.data = (i ^= 1);\n\t\t};\n\t}\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n", + "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n/*global process,document,setTimeout,clearTimeout,MutationObserver,WebKitMutationObserver*/\n(function(define) { 'use strict';\ndefine(function(require) {\n\t/*jshint maxcomplexity:6*/\n\n\t// Sniff \"best\" async scheduling option\n\t// Prefer process.nextTick or MutationObserver, then check for\n\t// setTimeout, and finally vertx, since its the only env that doesn't\n\t// have setTimeout\n\n\tvar MutationObs;\n\tvar capturedSetTimeout = typeof setTimeout !== 'undefined' && setTimeout;\n\n\t// Default env\n\tvar setTimer = function(f, ms) { return setTimeout(f, ms); };\n\tvar clearTimer = function(t) { return clearTimeout(t); };\n\tvar asap = function (f) { return capturedSetTimeout(f, 0); };\n\n\t// Detect specific env\n\tif (isNode()) { // Node\n\t\tasap = function (f) { return process.nextTick(f); };\n\n\t} else if (MutationObs = hasMutationObserver()) { // Modern browser\n\t\tasap = initMutationObserver(MutationObs);\n\n\t} else if (!capturedSetTimeout) { // vert.x\n\t\tvar vertxRequire = require;\n\t\tvar vertx = vertxRequire('vertx');\n\t\tsetTimer = function (f, ms) { return vertx.setTimer(ms, f); };\n\t\tclearTimer = vertx.cancelTimer;\n\t\tasap = vertx.runOnLoop || vertx.runOnContext;\n\t}\n\n\treturn {\n\t\tsetTimer: setTimer,\n\t\tclearTimer: clearTimer,\n\t\tasap: asap\n\t};\n\n\tfunction isNode () {\n\t\treturn typeof process !== 'undefined' &&\n\t\t\tObject.prototype.toString.call(process) === '[object process]';\n\t}\n\n\tfunction hasMutationObserver () {\n\t return (typeof MutationObserver !== 'undefined' && MutationObserver) ||\n\t\t\t(typeof WebKitMutationObserver !== 'undefined' && WebKitMutationObserver);\n\t}\n\n\tfunction initMutationObserver(MutationObserver) {\n\t\tvar scheduled;\n\t\tvar node = document.createTextNode('');\n\t\tvar o = new MutationObserver(run);\n\t\to.observe(node, { characterData: true });\n\n\t\tfunction run() {\n\t\t\tvar f = scheduled;\n\t\t\tscheduled = void 0;\n\t\t\tf();\n\t\t}\n\n\t\tvar i = 0;\n\t\treturn function (f) {\n\t\t\tscheduled = f;\n\t\t\tnode.data = (i ^= 1);\n\t\t};\n\t}\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n", "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn {\n\t\tformatError: formatError,\n\t\tformatObject: formatObject,\n\t\ttryStringify: tryStringify\n\t};\n\n\t/**\n\t * Format an error into a string. If e is an Error and has a stack property,\n\t * it's returned. Otherwise, e is formatted using formatObject, with a\n\t * warning added about e not being a proper Error.\n\t * @param {*} e\n\t * @returns {String} formatted string, suitable for output to developers\n\t */\n\tfunction formatError(e) {\n\t\tvar s = typeof e === 'object' && e !== null && (e.stack || e.message) ? e.stack || e.message : formatObject(e);\n\t\treturn e instanceof Error ? s : s + ' (WARNING: non-Error used)';\n\t}\n\n\t/**\n\t * Format an object, detecting \"plain\" objects and running them through\n\t * JSON.stringify if possible.\n\t * @param {Object} o\n\t * @returns {string}\n\t */\n\tfunction formatObject(o) {\n\t\tvar s = String(o);\n\t\tif(s === '[object Object]' && typeof JSON !== 'undefined') {\n\t\t\ts = tryStringify(o, s);\n\t\t}\n\t\treturn s;\n\t}\n\n\t/**\n\t * Try to return the result of JSON.stringify(x). If that fails, return\n\t * defaultValue\n\t * @param {*} x\n\t * @param {*} defaultValue\n\t * @returns {String|*} JSON.stringify(x) or defaultValue\n\t */\n\tfunction tryStringify(x, defaultValue) {\n\t\ttry {\n\t\t\treturn JSON.stringify(x);\n\t\t} catch(e) {\n\t\t\treturn defaultValue;\n\t\t}\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n", "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function liftAll(liftOne, combine, dst, src) {\n\t\tif(typeof combine === 'undefined') {\n\t\t\tcombine = defaultCombine;\n\t\t}\n\n\t\treturn Object.keys(src).reduce(function(dst, key) {\n\t\t\tvar f = src[key];\n\t\t\treturn typeof f === 'function' ? combine(dst, liftOne(f), key) : dst;\n\t\t}, typeof dst === 'undefined' ? defaultDst(src) : dst);\n\t};\n\n\tfunction defaultCombine(o, f, k) {\n\t\to[k] = f;\n\t\treturn o;\n\t}\n\n\tfunction defaultDst(src) {\n\t\treturn typeof src === 'function' ? src.bind() : Object.create(src);\n\t}\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n", - "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function makePromise(environment) {\n\n\t\tvar tasks = environment.scheduler;\n\t\tvar emitRejection = initEmitRejection();\n\n\t\tvar objectCreate = Object.create ||\n\t\t\tfunction(proto) {\n\t\t\t\tfunction Child() {}\n\t\t\t\tChild.prototype = proto;\n\t\t\t\treturn new Child();\n\t\t\t};\n\n\t\t/**\n\t\t * Create a promise whose fate is determined by resolver\n\t\t * @constructor\n\t\t * @returns {Promise} promise\n\t\t * @name Promise\n\t\t */\n\t\tfunction Promise(resolver, handler) {\n\t\t\tthis._handler = resolver === Handler ? handler : init(resolver);\n\t\t}\n\n\t\t/**\n\t\t * Run the supplied resolver\n\t\t * @param resolver\n\t\t * @returns {Pending}\n\t\t */\n\t\tfunction init(resolver) {\n\t\t\tvar handler = new Pending();\n\n\t\t\ttry {\n\t\t\t\tresolver(promiseResolve, promiseReject, promiseNotify);\n\t\t\t} catch (e) {\n\t\t\t\tpromiseReject(e);\n\t\t\t}\n\n\t\t\treturn handler;\n\n\t\t\t/**\n\t\t\t * Transition from pre-resolution state to post-resolution state, notifying\n\t\t\t * all listeners of the ultimate fulfillment or rejection\n\t\t\t * @param {*} x resolution value\n\t\t\t */\n\t\t\tfunction promiseResolve (x) {\n\t\t\t\thandler.resolve(x);\n\t\t\t}\n\t\t\t/**\n\t\t\t * Reject this promise with reason, which will be used verbatim\n\t\t\t * @param {Error|*} reason rejection reason, strongly suggested\n\t\t\t * to be an Error type\n\t\t\t */\n\t\t\tfunction promiseReject (reason) {\n\t\t\t\thandler.reject(reason);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * @deprecated\n\t\t\t * Issue a progress event, notifying all progress listeners\n\t\t\t * @param {*} x progress event payload to pass to all listeners\n\t\t\t */\n\t\t\tfunction promiseNotify (x) {\n\t\t\t\thandler.notify(x);\n\t\t\t}\n\t\t}\n\n\t\t// Creation\n\n\t\tPromise.resolve = resolve;\n\t\tPromise.reject = reject;\n\t\tPromise.never = never;\n\n\t\tPromise._defer = defer;\n\t\tPromise._handler = getHandler;\n\n\t\t/**\n\t\t * Returns a trusted promise. If x is already a trusted promise, it is\n\t\t * returned, otherwise returns a new trusted Promise which follows x.\n\t\t * @param {*} x\n\t\t * @return {Promise} promise\n\t\t */\n\t\tfunction resolve(x) {\n\t\t\treturn isPromise(x) ? x\n\t\t\t\t: new Promise(Handler, new Async(getHandler(x)));\n\t\t}\n\n\t\t/**\n\t\t * Return a reject promise with x as its reason (x is used verbatim)\n\t\t * @param {*} x\n\t\t * @returns {Promise} rejected promise\n\t\t */\n\t\tfunction reject(x) {\n\t\t\treturn new Promise(Handler, new Async(new Rejected(x)));\n\t\t}\n\n\t\t/**\n\t\t * Return a promise that remains pending forever\n\t\t * @returns {Promise} forever-pending promise.\n\t\t */\n\t\tfunction never() {\n\t\t\treturn foreverPendingPromise; // Should be frozen\n\t\t}\n\n\t\t/**\n\t\t * Creates an internal {promise, resolver} pair\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tfunction defer() {\n\t\t\treturn new Promise(Handler, new Pending());\n\t\t}\n\n\t\t// Transformation and flow control\n\n\t\t/**\n\t\t * Transform this promise's fulfillment value, returning a new Promise\n\t\t * for the transformed result. If the promise cannot be fulfilled, onRejected\n\t\t * is called with the reason. onProgress *may* be called with updates toward\n\t\t * this promise's fulfillment.\n\t\t * @param {function=} onFulfilled fulfillment handler\n\t\t * @param {function=} onRejected rejection handler\n\t\t * @param {function=} onProgress @deprecated progress handler\n\t\t * @return {Promise} new promise\n\t\t */\n\t\tPromise.prototype.then = function(onFulfilled, onRejected, onProgress) {\n\t\t\tvar parent = this._handler;\n\t\t\tvar state = parent.join().state();\n\n\t\t\tif ((typeof onFulfilled !== 'function' && state > 0) ||\n\t\t\t\t(typeof onRejected !== 'function' && state < 0)) {\n\t\t\t\t// Short circuit: value will not change, simply share handler\n\t\t\t\treturn new this.constructor(Handler, parent);\n\t\t\t}\n\n\t\t\tvar p = this._beget();\n\t\t\tvar child = p._handler;\n\n\t\t\tparent.chain(child, parent.receiver, onFulfilled, onRejected, onProgress);\n\n\t\t\treturn p;\n\t\t};\n\n\t\t/**\n\t\t * If this promise cannot be fulfilled due to an error, call onRejected to\n\t\t * handle the error. Shortcut for .then(undefined, onRejected)\n\t\t * @param {function?} onRejected\n\t\t * @return {Promise}\n\t\t */\n\t\tPromise.prototype['catch'] = function(onRejected) {\n\t\t\treturn this.then(void 0, onRejected);\n\t\t};\n\n\t\t/**\n\t\t * Creates a new, pending promise of the same type as this promise\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype._beget = function() {\n\t\t\treturn begetFrom(this._handler, this.constructor);\n\t\t};\n\n\t\tfunction begetFrom(parent, Promise) {\n\t\t\tvar child = new Pending(parent.receiver, parent.join().context);\n\t\t\treturn new Promise(Handler, child);\n\t\t}\n\n\t\t// Array combinators\n\n\t\tPromise.all = all;\n\t\tPromise.race = race;\n\t\tPromise._traverse = traverse;\n\n\t\t/**\n\t\t * Return a promise that will fulfill when all promises in the\n\t\t * input array have fulfilled, or will reject when one of the\n\t\t * promises rejects.\n\t\t * @param {array} promises array of promises\n\t\t * @returns {Promise} promise for array of fulfillment values\n\t\t */\n\t\tfunction all(promises) {\n\t\t\treturn traverseWith(snd, null, promises);\n\t\t}\n\n\t\t/**\n\t\t * Array> -> Promise>\n\t\t * @private\n\t\t * @param {function} f function to apply to each promise's value\n\t\t * @param {Array} promises array of promises\n\t\t * @returns {Promise} promise for transformed values\n\t\t */\n\t\tfunction traverse(f, promises) {\n\t\t\treturn traverseWith(tryCatch2, f, promises);\n\t\t}\n\n\t\tfunction traverseWith(tryMap, f, promises) {\n\t\t\tvar handler = typeof f === 'function' ? mapAt : settleAt;\n\n\t\t\tvar resolver = new Pending();\n\t\t\tvar pending = promises.length >>> 0;\n\t\t\tvar results = new Array(pending);\n\n\t\t\tfor (var i = 0, x; i < promises.length && !resolver.resolved; ++i) {\n\t\t\t\tx = promises[i];\n\n\t\t\t\tif (x === void 0 && !(i in promises)) {\n\t\t\t\t\t--pending;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttraverseAt(promises, handler, i, x, resolver);\n\t\t\t}\n\n\t\t\tif(pending === 0) {\n\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t}\n\n\t\t\treturn new Promise(Handler, resolver);\n\n\t\t\tfunction mapAt(i, x, resolver) {\n\t\t\t\tif(!resolver.resolved) {\n\t\t\t\t\ttraverseAt(promises, settleAt, i, tryMap(f, x, i), resolver);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction settleAt(i, x, resolver) {\n\t\t\t\tresults[i] = x;\n\t\t\t\tif(--pending === 0) {\n\t\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction traverseAt(promises, handler, i, x, resolver) {\n\t\t\tif (maybeThenable(x)) {\n\t\t\t\tvar h = getHandlerMaybeThenable(x);\n\t\t\t\tvar s = h.state();\n\n\t\t\t\tif (s === 0) {\n\t\t\t\t\th.fold(handler, i, void 0, resolver);\n\t\t\t\t} else if (s > 0) {\n\t\t\t\t\thandler(i, h.value, resolver);\n\t\t\t\t} else {\n\t\t\t\t\tresolver.become(h);\n\t\t\t\t\tvisitRemaining(promises, i+1, h);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thandler(i, x, resolver);\n\t\t\t}\n\t\t}\n\n\t\tPromise._visitRemaining = visitRemaining;\n\t\tfunction visitRemaining(promises, start, handler) {\n\t\t\tfor(var i=start; i 0) ||\n\t\t\t\t(typeof onRejected !== 'function' && state < 0)) {\n\t\t\t\t// Short circuit: value will not change, simply share handler\n\t\t\t\treturn new this.constructor(Handler, parent);\n\t\t\t}\n\n\t\t\tvar p = this._beget();\n\t\t\tvar child = p._handler;\n\n\t\t\tparent.chain(child, parent.receiver, onFulfilled, onRejected, onProgress);\n\n\t\t\treturn p;\n\t\t};\n\n\t\t/**\n\t\t * If this promise cannot be fulfilled due to an error, call onRejected to\n\t\t * handle the error. Shortcut for .then(undefined, onRejected)\n\t\t * @param {function?} onRejected\n\t\t * @return {Promise}\n\t\t */\n\t\tPromise.prototype['catch'] = function(onRejected) {\n\t\t\treturn this.then(void 0, onRejected);\n\t\t};\n\n\t\t/**\n\t\t * Creates a new, pending promise of the same type as this promise\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype._beget = function() {\n\t\t\treturn begetFrom(this._handler, this.constructor);\n\t\t};\n\n\t\tfunction begetFrom(parent, Promise) {\n\t\t\tvar child = new Pending(parent.receiver, parent.join().context);\n\t\t\treturn new Promise(Handler, child);\n\t\t}\n\n\t\t// Array combinators\n\n\t\tPromise.all = all;\n\t\tPromise.race = race;\n\t\tPromise._traverse = traverse;\n\n\t\t/**\n\t\t * Return a promise that will fulfill when all promises in the\n\t\t * input array have fulfilled, or will reject when one of the\n\t\t * promises rejects.\n\t\t * @param {array} promises array of promises\n\t\t * @returns {Promise} promise for array of fulfillment values\n\t\t */\n\t\tfunction all(promises) {\n\t\t\treturn traverseWith(snd, null, promises);\n\t\t}\n\n\t\t/**\n\t\t * Array> -> Promise>\n\t\t * @private\n\t\t * @param {function} f function to apply to each promise's value\n\t\t * @param {Array} promises array of promises\n\t\t * @returns {Promise} promise for transformed values\n\t\t */\n\t\tfunction traverse(f, promises) {\n\t\t\treturn traverseWith(tryCatch2, f, promises);\n\t\t}\n\n\t\tfunction traverseWith(tryMap, f, promises) {\n\t\t\tvar handler = typeof f === 'function' ? mapAt : settleAt;\n\n\t\t\tvar resolver = new Pending();\n\t\t\tvar pending = promises.length >>> 0;\n\t\t\tvar results = new Array(pending);\n\n\t\t\tfor (var i = 0, x; i < promises.length && !resolver.resolved; ++i) {\n\t\t\t\tx = promises[i];\n\n\t\t\t\tif (x === void 0 && !(i in promises)) {\n\t\t\t\t\t--pending;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttraverseAt(promises, handler, i, x, resolver);\n\t\t\t}\n\n\t\t\tif(pending === 0) {\n\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t}\n\n\t\t\treturn new Promise(Handler, resolver);\n\n\t\t\tfunction mapAt(i, x, resolver) {\n\t\t\t\tif(!resolver.resolved) {\n\t\t\t\t\ttraverseAt(promises, settleAt, i, tryMap(f, x, i), resolver);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction settleAt(i, x, resolver) {\n\t\t\t\tresults[i] = x;\n\t\t\t\tif(--pending === 0) {\n\t\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction traverseAt(promises, handler, i, x, resolver) {\n\t\t\tif (maybeThenable(x)) {\n\t\t\t\tvar h = getHandlerMaybeThenable(x);\n\t\t\t\tvar s = h.state();\n\n\t\t\t\tif (s === 0) {\n\t\t\t\t\th.fold(handler, i, void 0, resolver);\n\t\t\t\t} else if (s > 0) {\n\t\t\t\t\thandler(i, h.value, resolver);\n\t\t\t\t} else {\n\t\t\t\t\tresolver.become(h);\n\t\t\t\t\tvisitRemaining(promises, i+1, h);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thandler(i, x, resolver);\n\t\t\t}\n\t\t}\n\n\t\tPromise._visitRemaining = visitRemaining;\n\t\tfunction visitRemaining(promises, start, handler) {\n\t\t\tfor(var i=start; i 0 ? toFulfilledState(handler.value)\n\t\t\t : toRejectedState(handler.value);\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n", "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar PromiseMonitor = require('./monitor/PromiseMonitor');\n\tvar ConsoleReporter = require('./monitor/ConsoleReporter');\n\n\tvar promiseMonitor = new PromiseMonitor(new ConsoleReporter());\n\n\treturn function(Promise) {\n\t\treturn promiseMonitor.monitor(Promise);\n\t};\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n", "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar error = require('./error');\n\tvar unhandledRejectionsMsg = '[promises] Unhandled rejections: ';\n\tvar allHandledMsg = '[promises] All previously unhandled rejections have now been handled';\n\n\tfunction ConsoleReporter() {\n\t\tthis._previouslyReported = false;\n\t}\n\n\tConsoleReporter.prototype = initDefaultLogging();\n\n\tConsoleReporter.prototype.log = function(traces) {\n\t\tif(traces.length === 0) {\n\t\t\tif(this._previouslyReported) {\n\t\t\t\tthis._previouslyReported = false;\n\t\t\t\tthis.msg(allHandledMsg);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tthis._previouslyReported = true;\n\t\tthis.groupStart(unhandledRejectionsMsg + traces.length);\n\t\ttry {\n\t\t\tthis._log(traces);\n\t\t} finally {\n\t\t\tthis.groupEnd();\n\t\t}\n\t};\n\n\tConsoleReporter.prototype._log = function(traces) {\n\t\tfor(var i=0; i 1 ? slice.call(arguments, 1) : [];\n\t\treturn function() {\n\t\t\treturn _apply(f, this, args.concat(slice.call(arguments)));\n\t\t};\n\t}\n\n\t/**\n\t * Lift all the functions/methods on src\n\t * @param {object|function} src source whose functions will be lifted\n\t * @param {function?} combine optional function for customizing the lifting\n\t * process. It is passed dst, the lifted function, and the property name of\n\t * the original function on src.\n\t * @param {(object|function)?} dst option destination host onto which to place lifted\n\t * functions. If not provided, liftAll returns a new object.\n\t * @returns {*} If dst is provided, returns dst with lifted functions as\n\t * properties. If dst not provided, returns a new object with lifted functions.\n\t */\n\tfunction liftAll(src, combine, dst) {\n\t\treturn _liftAll(lift, combine, dst, src);\n\t}\n\n\t/**\n\t * `promisify` is a version of `lift` that allows fine-grained control over the\n\t * arguments that passed to the underlying function. It is intended to handle\n\t * functions that don't follow the common callback and errback positions.\n\t *\n\t * The control is done by passing an object whose 'callback' and/or 'errback'\n\t * keys, whose values are the corresponding 0-based indexes of the arguments on\n\t * the function. Negative values are interpreted as being relative to the end\n\t * of the arguments array.\n\t *\n\t * If arguments are given on the call to the 'promisified' function, they are\n\t * intermingled with the callback and errback. If a promise is given among them,\n\t * the execution of the function will only occur after its resolution.\n\t *\n\t * @example\n\t * var delay = callbacks.promisify(setTimeout, {\n\t *\t\tcallback: 0\n\t *\t});\n\t *\n\t * delay(100).then(function() {\n\t *\t\tconsole.log(\"This happens 100ms afterwards\");\n\t *\t});\n\t *\n\t * @example\n\t * function callbackAsLast(errback, followsStandards, callback) {\n\t *\t\tif(followsStandards) {\n\t *\t\t\tcallback(\"well done!\");\n\t *\t\t} else {\n\t *\t\t\terrback(\"some programmers just want to watch the world burn\");\n\t *\t\t}\n\t *\t}\n\t *\n\t * var promisified = callbacks.promisify(callbackAsLast, {\n\t *\t\tcallback: -1,\n\t *\t\terrback: 0,\n\t *\t});\n\t *\n\t * promisified(true).then(console.log, console.error);\n\t * promisified(false).then(console.log, console.error);\n\t *\n\t * @param {Function} asyncFunction traditional function to be decorated\n\t * @param {object} positions\n\t * @param {number} [positions.callback] index at which asyncFunction expects to\n\t * receive a success callback\n\t * @param {number} [positions.errback] index at which asyncFunction expects to\n\t * receive an error callback\n\t * @returns {function} promisified function that accepts\n\t *\n\t * @deprecated\n\t */\n\tfunction promisify(asyncFunction, positions) {\n\n\t\treturn function() {\n\t\t\tvar thisArg = this;\n\t\t\treturn Promise.all(arguments).then(function(args) {\n\t\t\t\tvar p = Promise._defer();\n\n\t\t\t\tvar callbackPos, errbackPos;\n\n\t\t\t\tif(typeof positions.callback === 'number') {\n\t\t\t\t\tcallbackPos = normalizePosition(args, positions.callback);\n\t\t\t\t}\n\n\t\t\t\tif(typeof positions.errback === 'number') {\n\t\t\t\t\terrbackPos = normalizePosition(args, positions.errback);\n\t\t\t\t}\n\n\t\t\t\tif(errbackPos < callbackPos) {\n\t\t\t\t\tinsertCallback(args, errbackPos, p._handler.reject, p._handler);\n\t\t\t\t\tinsertCallback(args, callbackPos, p._handler.resolve, p._handler);\n\t\t\t\t} else {\n\t\t\t\t\tinsertCallback(args, callbackPos, p._handler.resolve, p._handler);\n\t\t\t\t\tinsertCallback(args, errbackPos, p._handler.reject, p._handler);\n\t\t\t\t}\n\n\t\t\t\tasyncFunction.apply(thisArg, args);\n\n\t\t\t\treturn p;\n\t\t\t});\n\t\t};\n\t}\n\n\tfunction normalizePosition(args, pos) {\n\t\treturn pos < 0 ? (args.length + pos + 2) : pos;\n\t}\n\n\tfunction insertCallback(args, pos, callback, thisArg) {\n\t\tif(typeof pos === 'number') {\n\t\t\targs.splice(pos, 0, alwaysUnary(callback, thisArg));\n\t\t}\n\t}\n\n\tfunction alwaysUnary(fn, thisArg) {\n\t\treturn function() {\n\t\t\tif (arguments.length > 1) {\n\t\t\t\tfn.call(thisArg, slice.call(arguments));\n\t\t\t} else {\n\t\t\t\tfn.apply(thisArg, arguments);\n\t\t\t}\n\t\t};\n\t}\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n", @@ -49,7 +49,7 @@ "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\t// Credit to Twisol (https://github.com/Twisol) for suggesting\n\t// this type of extensible queue + trampoline approach for next-tick conflation.\n\n\t/**\n\t * Async task scheduler\n\t * @param {function} async function to schedule a single async function\n\t * @constructor\n\t */\n\tfunction Scheduler(async) {\n\t\tthis._async = async;\n\t\tthis._running = false;\n\n\t\tthis._queue = this;\n\t\tthis._queueLen = 0;\n\t\tthis._afterQueue = {};\n\t\tthis._afterQueueLen = 0;\n\n\t\tvar self = this;\n\t\tthis.drain = function() {\n\t\t\tself._drain();\n\t\t};\n\t}\n\n\t/**\n\t * Enqueue a task\n\t * @param {{ run:function }} task\n\t */\n\tScheduler.prototype.enqueue = function(task) {\n\t\tthis._queue[this._queueLen++] = task;\n\t\tthis.run();\n\t};\n\n\t/**\n\t * Enqueue a task to run after the main task queue\n\t * @param {{ run:function }} task\n\t */\n\tScheduler.prototype.afterQueue = function(task) {\n\t\tthis._afterQueue[this._afterQueueLen++] = task;\n\t\tthis.run();\n\t};\n\n\tScheduler.prototype.run = function() {\n\t\tif (!this._running) {\n\t\t\tthis._running = true;\n\t\t\tthis._async(this.drain);\n\t\t}\n\t};\n\n\t/**\n\t * Drain the handler queue entirely, and then the after queue\n\t */\n\tScheduler.prototype._drain = function() {\n\t\tvar i = 0;\n\t\tfor (; i < this._queueLen; ++i) {\n\t\t\tthis._queue[i].run();\n\t\t\tthis._queue[i] = void 0;\n\t\t}\n\n\t\tthis._queueLen = 0;\n\t\tthis._running = false;\n\n\t\tfor (i = 0; i < this._afterQueueLen; ++i) {\n\t\t\tthis._afterQueue[i].run();\n\t\t\tthis._afterQueue[i] = void 0;\n\t\t}\n\n\t\tthis._afterQueueLen = 0;\n\t};\n\n\treturn Scheduler;\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n", "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\t/**\n\t * Custom error type for promises rejected by promise.timeout\n\t * @param {string} message\n\t * @constructor\n\t */\n\tfunction TimeoutError (message) {\n\t\tError.call(this);\n\t\tthis.message = message;\n\t\tthis.name = TimeoutError.name;\n\t\tif (typeof Error.captureStackTrace === 'function') {\n\t\t\tError.captureStackTrace(this, TimeoutError);\n\t\t}\n\t}\n\n\tTimeoutError.prototype = Object.create(Error.prototype);\n\tTimeoutError.prototype.constructor = TimeoutError;\n\n\treturn TimeoutError;\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));", "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\tmakeApply.tryCatchResolve = tryCatchResolve;\n\n\treturn makeApply;\n\n\tfunction makeApply(Promise, call) {\n\t\tif(arguments.length < 2) {\n\t\t\tcall = tryCatchResolve;\n\t\t}\n\n\t\treturn apply;\n\n\t\tfunction apply(f, thisArg, args) {\n\t\t\tvar p = Promise._defer();\n\t\t\tvar l = args.length;\n\t\t\tvar params = new Array(l);\n\t\t\tcallAndResolve({ f:f, thisArg:thisArg, args:args, params:params, i:l-1, call:call }, p._handler);\n\n\t\t\treturn p;\n\t\t}\n\n\t\tfunction callAndResolve(c, h) {\n\t\t\tif(c.i < 0) {\n\t\t\t\treturn call(c.f, c.thisArg, c.params, h);\n\t\t\t}\n\n\t\t\tvar handler = Promise._handler(c.args[c.i]);\n\t\t\thandler.fold(callAndResolveNext, c, void 0, h);\n\t\t}\n\n\t\tfunction callAndResolveNext(c, x, h) {\n\t\t\tc.params[c.i] = x;\n\t\t\tc.i -= 1;\n\t\t\tcallAndResolve(c, h);\n\t\t}\n\t}\n\n\tfunction tryCatchResolve(f, thisArg, args, resolver) {\n\t\ttry {\n\t\t\tresolver.resolve(f.apply(thisArg, args));\n\t\t} catch(e) {\n\t\t\tresolver.reject(e);\n\t\t}\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n\n\n", - "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar state = require('../state');\n\tvar applier = require('../apply');\n\n\treturn function array(Promise) {\n\n\t\tvar applyFold = applier(Promise);\n\t\tvar toPromise = Promise.resolve;\n\t\tvar all = Promise.all;\n\n\t\tvar ar = Array.prototype.reduce;\n\t\tvar arr = Array.prototype.reduceRight;\n\t\tvar slice = Array.prototype.slice;\n\n\t\t// Additional array combinators\n\n\t\tPromise.any = any;\n\t\tPromise.some = some;\n\t\tPromise.settle = settle;\n\n\t\tPromise.map = map;\n\t\tPromise.filter = filter;\n\t\tPromise.reduce = reduce;\n\t\tPromise.reduceRight = reduceRight;\n\n\t\t/**\n\t\t * When this promise fulfills with an array, do\n\t\t * onFulfilled.apply(void 0, array)\n\t\t * @param {function} onFulfilled function to apply\n\t\t * @returns {Promise} promise for the result of applying onFulfilled\n\t\t */\n\t\tPromise.prototype.spread = function(onFulfilled) {\n\t\t\treturn this.then(all).then(function(array) {\n\t\t\t\treturn onFulfilled.apply(this, array);\n\t\t\t});\n\t\t};\n\n\t\treturn Promise;\n\n\t\t/**\n\t\t * One-winner competitive race.\n\t\t * Return a promise that will fulfill when one of the promises\n\t\t * in the input array fulfills, or will reject when all promises\n\t\t * have rejected.\n\t\t * @param {array} promises\n\t\t * @returns {Promise} promise for the first fulfilled value\n\t\t */\n\t\tfunction any(promises) {\n\t\t\tvar p = Promise._defer();\n\t\t\tvar resolver = p._handler;\n\t\t\tvar l = promises.length>>>0;\n\n\t\t\tvar pending = l;\n\t\t\tvar errors = [];\n\n\t\t\tfor (var h, x, i = 0; i < l; ++i) {\n\t\t\t\tx = promises[i];\n\t\t\t\tif(x === void 0 && !(i in promises)) {\n\t\t\t\t\t--pending;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\th = Promise._handler(x);\n\t\t\t\tif(h.state() > 0) {\n\t\t\t\t\tresolver.become(h);\n\t\t\t\t\tPromise._visitRemaining(promises, i, h);\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\th.visit(resolver, handleFulfill, handleReject);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(pending === 0) {\n\t\t\t\tresolver.reject(new RangeError('any(): array must not be empty'));\n\t\t\t}\n\n\t\t\treturn p;\n\n\t\t\tfunction handleFulfill(x) {\n\t\t\t\t/*jshint validthis:true*/\n\t\t\t\terrors = null;\n\t\t\t\tthis.resolve(x); // this === resolver\n\t\t\t}\n\n\t\t\tfunction handleReject(e) {\n\t\t\t\t/*jshint validthis:true*/\n\t\t\t\tif(this.resolved) { // this === resolver\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\terrors.push(e);\n\t\t\t\tif(--pending === 0) {\n\t\t\t\t\tthis.reject(errors);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * N-winner competitive race\n\t\t * Return a promise that will fulfill when n input promises have\n\t\t * fulfilled, or will reject when it becomes impossible for n\n\t\t * input promises to fulfill (ie when promises.length - n + 1\n\t\t * have rejected)\n\t\t * @param {array} promises\n\t\t * @param {number} n\n\t\t * @returns {Promise} promise for the earliest n fulfillment values\n\t\t *\n\t\t * @deprecated\n\t\t */\n\t\tfunction some(promises, n) {\n\t\t\t/*jshint maxcomplexity:7*/\n\t\t\tvar p = Promise._defer();\n\t\t\tvar resolver = p._handler;\n\n\t\t\tvar results = [];\n\t\t\tvar errors = [];\n\n\t\t\tvar l = promises.length>>>0;\n\t\t\tvar nFulfill = 0;\n\t\t\tvar nReject;\n\t\t\tvar x, i; // reused in both for() loops\n\n\t\t\t// First pass: count actual array items\n\t\t\tfor(i=0; i nFulfill) {\n\t\t\t\tresolver.reject(new RangeError('some(): array must contain at least '\n\t\t\t\t+ n + ' item(s), but had ' + nFulfill));\n\t\t\t} else if(nFulfill === 0) {\n\t\t\t\tresolver.resolve(results);\n\t\t\t}\n\n\t\t\t// Second pass: observe each array item, make progress toward goals\n\t\t\tfor(i=0; i 2 ? ar.call(promises, liftCombine(f), arguments[2])\n\t\t\t\t\t: ar.call(promises, liftCombine(f));\n\t\t}\n\n\t\t/**\n\t\t * Traditional reduce function, similar to `Array.prototype.reduceRight()`, but\n\t\t * input may contain promises and/or values, and reduceFunc\n\t\t * may return either a value or a promise, *and* initialValue may\n\t\t * be a promise for the starting value.\n\t\t * @param {Array|Promise} promises array or promise for an array of anything,\n\t\t * may contain a mix of promises and values.\n\t\t * @param {function(accumulated:*, x:*, index:Number):*} f reduce function\n\t\t * @returns {Promise} that will resolve to the final reduced value\n\t\t */\n\t\tfunction reduceRight(promises, f /*, initialValue */) {\n\t\t\treturn arguments.length > 2 ? arr.call(promises, liftCombine(f), arguments[2])\n\t\t\t\t\t: arr.call(promises, liftCombine(f));\n\t\t}\n\n\t\tfunction liftCombine(f) {\n\t\t\treturn function(z, x, i) {\n\t\t\t\treturn applyFold(f, void 0, [z,x,i]);\n\t\t\t};\n\t\t}\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n", + "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar state = require('../state');\n\tvar applier = require('../apply');\n\n\treturn function array(Promise) {\n\n\t\tvar applyFold = applier(Promise);\n\t\tvar toPromise = Promise.resolve;\n\t\tvar all = Promise.all;\n\n\t\tvar ar = Array.prototype.reduce;\n\t\tvar arr = Array.prototype.reduceRight;\n\t\tvar slice = Array.prototype.slice;\n\n\t\t// Additional array combinators\n\n\t\tPromise.any = any;\n\t\tPromise.some = some;\n\t\tPromise.settle = settle;\n\n\t\tPromise.map = map;\n\t\tPromise.filter = filter;\n\t\tPromise.reduce = reduce;\n\t\tPromise.reduceRight = reduceRight;\n\n\t\t/**\n\t\t * When this promise fulfills with an array, do\n\t\t * onFulfilled.apply(void 0, array)\n\t\t * @param {function} onFulfilled function to apply\n\t\t * @returns {Promise} promise for the result of applying onFulfilled\n\t\t */\n\t\tPromise.prototype.spread = function(onFulfilled) {\n\t\t\treturn this.then(all).then(function(array) {\n\t\t\t\treturn onFulfilled.apply(this, array);\n\t\t\t});\n\t\t};\n\n\t\treturn Promise;\n\n\t\t/**\n\t\t * One-winner competitive race.\n\t\t * Return a promise that will fulfill when one of the promises\n\t\t * in the input array fulfills, or will reject when all promises\n\t\t * have rejected.\n\t\t * @param {array} promises\n\t\t * @returns {Promise} promise for the first fulfilled value\n\t\t */\n\t\tfunction any(promises) {\n\t\t\tvar p = Promise._defer();\n\t\t\tvar resolver = p._handler;\n\t\t\tvar l = promises.length>>>0;\n\n\t\t\tvar pending = l;\n\t\t\tvar errors = [];\n\n\t\t\tfor (var h, x, i = 0; i < l; ++i) {\n\t\t\t\tx = promises[i];\n\t\t\t\tif(x === void 0 && !(i in promises)) {\n\t\t\t\t\t--pending;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\th = Promise._handler(x);\n\t\t\t\tif(h.state() > 0) {\n\t\t\t\t\tresolver.become(h);\n\t\t\t\t\tPromise._visitRemaining(promises, i, h);\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\th.visit(resolver, handleFulfill, handleReject);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(pending === 0) {\n\t\t\t\tresolver.reject(new RangeError('any(): array must not be empty'));\n\t\t\t}\n\n\t\t\treturn p;\n\n\t\t\tfunction handleFulfill(x) {\n\t\t\t\t/*jshint validthis:true*/\n\t\t\t\terrors = null;\n\t\t\t\tthis.resolve(x); // this === resolver\n\t\t\t}\n\n\t\t\tfunction handleReject(e) {\n\t\t\t\t/*jshint validthis:true*/\n\t\t\t\tif(this.resolved) { // this === resolver\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\terrors.push(e);\n\t\t\t\tif(--pending === 0) {\n\t\t\t\t\tthis.reject(errors);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * N-winner competitive race\n\t\t * Return a promise that will fulfill when n input promises have\n\t\t * fulfilled, or will reject when it becomes impossible for n\n\t\t * input promises to fulfill (ie when promises.length - n + 1\n\t\t * have rejected)\n\t\t * @param {array} promises\n\t\t * @param {number} n\n\t\t * @returns {Promise} promise for the earliest n fulfillment values\n\t\t *\n\t\t * @deprecated\n\t\t */\n\t\tfunction some(promises, n) {\n\t\t\t/*jshint maxcomplexity:7*/\n\t\t\tvar p = Promise._defer();\n\t\t\tvar resolver = p._handler;\n\n\t\t\tvar results = [];\n\t\t\tvar errors = [];\n\n\t\t\tvar l = promises.length>>>0;\n\t\t\tvar nFulfill = 0;\n\t\t\tvar nReject;\n\t\t\tvar x, i; // reused in both for() loops\n\n\t\t\t// First pass: count actual array items\n\t\t\tfor(i=0; i nFulfill) {\n\t\t\t\tresolver.reject(new RangeError('some(): array must contain at least '\n\t\t\t\t+ n + ' item(s), but had ' + nFulfill));\n\t\t\t} else if(nFulfill === 0) {\n\t\t\t\tresolver.resolve(results);\n\t\t\t}\n\n\t\t\t// Second pass: observe each array item, make progress toward goals\n\t\t\tfor(i=0; i 2 ? ar.call(promises, liftCombine(f), arguments[2])\n\t\t\t\t\t: ar.call(promises, liftCombine(f));\n\t\t}\n\n\t\t/**\n\t\t * Traditional reduce function, similar to `Array.prototype.reduceRight()`, but\n\t\t * input may contain promises and/or values, and reduceFunc\n\t\t * may return either a value or a promise, *and* initialValue may\n\t\t * be a promise for the starting value.\n\t\t * @param {Array|Promise} promises array or promise for an array of anything,\n\t\t * may contain a mix of promises and values.\n\t\t * @param {function(accumulated:*, x:*, index:Number):*} f reduce function\n\t\t * @returns {Promise} that will resolve to the final reduced value\n\t\t */\n\t\tfunction reduceRight(promises, f /*, initialValue */) {\n\t\t\treturn arguments.length > 2 ? arr.call(promises, liftCombine(f), arguments[2])\n\t\t\t\t\t: arr.call(promises, liftCombine(f));\n\t\t}\n\n\t\tfunction liftCombine(f) {\n\t\t\treturn function(z, x, i) {\n\t\t\t\treturn applyFold(f, void 0, [z,x,i]);\n\t\t\t};\n\t\t}\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n", "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function flow(Promise) {\n\n\t\tvar resolve = Promise.resolve;\n\t\tvar reject = Promise.reject;\n\t\tvar origCatch = Promise.prototype['catch'];\n\n\t\t/**\n\t\t * Handle the ultimate fulfillment value or rejection reason, and assume\n\t\t * responsibility for all errors. If an error propagates out of result\n\t\t * or handleFatalError, it will be rethrown to the host, resulting in a\n\t\t * loud stack track on most platforms and a crash on some.\n\t\t * @param {function?} onResult\n\t\t * @param {function?} onError\n\t\t * @returns {undefined}\n\t\t */\n\t\tPromise.prototype.done = function(onResult, onError) {\n\t\t\tthis._handler.visit(this._handler.receiver, onResult, onError);\n\t\t};\n\n\t\t/**\n\t\t * Add Error-type and predicate matching to catch. Examples:\n\t\t * promise.catch(TypeError, handleTypeError)\n\t\t * .catch(predicate, handleMatchedErrors)\n\t\t * .catch(handleRemainingErrors)\n\t\t * @param onRejected\n\t\t * @returns {*}\n\t\t */\n\t\tPromise.prototype['catch'] = Promise.prototype.otherwise = function(onRejected) {\n\t\t\tif (arguments.length < 2) {\n\t\t\t\treturn origCatch.call(this, onRejected);\n\t\t\t}\n\n\t\t\tif(typeof onRejected !== 'function') {\n\t\t\t\treturn this.ensure(rejectInvalidPredicate);\n\t\t\t}\n\n\t\t\treturn origCatch.call(this, createCatchFilter(arguments[1], onRejected));\n\t\t};\n\n\t\t/**\n\t\t * Wraps the provided catch handler, so that it will only be called\n\t\t * if the predicate evaluates truthy\n\t\t * @param {?function} handler\n\t\t * @param {function} predicate\n\t\t * @returns {function} conditional catch handler\n\t\t */\n\t\tfunction createCatchFilter(handler, predicate) {\n\t\t\treturn function(e) {\n\t\t\t\treturn evaluatePredicate(e, predicate)\n\t\t\t\t\t? handler.call(this, e)\n\t\t\t\t\t: reject(e);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Ensures that onFulfilledOrRejected will be called regardless of whether\n\t\t * this promise is fulfilled or rejected. onFulfilledOrRejected WILL NOT\n\t\t * receive the promises' value or reason. Any returned value will be disregarded.\n\t\t * onFulfilledOrRejected may throw or return a rejected promise to signal\n\t\t * an additional error.\n\t\t * @param {function} handler handler to be called regardless of\n\t\t * fulfillment or rejection\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype['finally'] = Promise.prototype.ensure = function(handler) {\n\t\t\tif(typeof handler !== 'function') {\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\treturn this.then(function(x) {\n\t\t\t\treturn runSideEffect(handler, this, identity, x);\n\t\t\t}, function(e) {\n\t\t\t\treturn runSideEffect(handler, this, reject, e);\n\t\t\t});\n\t\t};\n\n\t\tfunction runSideEffect (handler, thisArg, propagate, value) {\n\t\t\tvar result = handler.call(thisArg);\n\t\t\treturn maybeThenable(result)\n\t\t\t\t? propagateValue(result, propagate, value)\n\t\t\t\t: propagate(value);\n\t\t}\n\n\t\tfunction propagateValue (result, propagate, x) {\n\t\t\treturn resolve(result).then(function () {\n\t\t\t\treturn propagate(x);\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Recover from a failure by returning a defaultValue. If defaultValue\n\t\t * is a promise, it's fulfillment value will be used. If defaultValue is\n\t\t * a promise that rejects, the returned promise will reject with the\n\t\t * same reason.\n\t\t * @param {*} defaultValue\n\t\t * @returns {Promise} new promise\n\t\t */\n\t\tPromise.prototype['else'] = Promise.prototype.orElse = function(defaultValue) {\n\t\t\treturn this.then(void 0, function() {\n\t\t\t\treturn defaultValue;\n\t\t\t});\n\t\t};\n\n\t\t/**\n\t\t * Shortcut for .then(function() { return value; })\n\t\t * @param {*} value\n\t\t * @return {Promise} a promise that:\n\t\t * - is fulfilled if value is not a promise, or\n\t\t * - if value is a promise, will fulfill with its value, or reject\n\t\t * with its reason.\n\t\t */\n\t\tPromise.prototype['yield'] = function(value) {\n\t\t\treturn this.then(function() {\n\t\t\t\treturn value;\n\t\t\t});\n\t\t};\n\n\t\t/**\n\t\t * Runs a side effect when this promise fulfills, without changing the\n\t\t * fulfillment value.\n\t\t * @param {function} onFulfilledSideEffect\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype.tap = function(onFulfilledSideEffect) {\n\t\t\treturn this.then(onFulfilledSideEffect)['yield'](this);\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n\tfunction rejectInvalidPredicate() {\n\t\tthrow new TypeError('catch predicate must be a function');\n\t}\n\n\tfunction evaluatePredicate(e, predicate) {\n\t\treturn isError(predicate) ? e instanceof predicate : predicate(e);\n\t}\n\n\tfunction isError(predicate) {\n\t\treturn predicate === Error\n\t\t\t|| (predicate != null && predicate.prototype instanceof Error);\n\t}\n\n\tfunction maybeThenable(x) {\n\t\treturn (typeof x === 'object' || typeof x === 'function') && x !== null;\n\t}\n\n\tfunction identity(x) {\n\t\treturn x;\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n", "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n/** @author Jeff Escalante */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function fold(Promise) {\n\n\t\tPromise.prototype.fold = function(f, z) {\n\t\t\tvar promise = this._beget();\n\n\t\t\tthis._handler.fold(function(z, x, to) {\n\t\t\t\tPromise._handler(z).fold(function(x, z, to) {\n\t\t\t\t\tto.resolve(f.call(this, z, x));\n\t\t\t\t}, x, this, to);\n\t\t\t}, z, promise._handler.receiver, promise._handler);\n\n\t\t\treturn promise;\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n", "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar inspect = require('../state').inspect;\n\n\treturn function inspection(Promise) {\n\n\t\tPromise.prototype.inspect = function() {\n\t\t\treturn inspect(Promise._handler(this));\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n", @@ -58,10 +58,10 @@ "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar env = require('../env');\n\tvar TimeoutError = require('../TimeoutError');\n\n\tfunction setTimeout(f, ms, x, y) {\n\t\treturn env.setTimer(function() {\n\t\t\tf(x, y, ms);\n\t\t}, ms);\n\t}\n\n\treturn function timed(Promise) {\n\t\t/**\n\t\t * Return a new promise whose fulfillment value is revealed only\n\t\t * after ms milliseconds\n\t\t * @param {number} ms milliseconds\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype.delay = function(ms) {\n\t\t\tvar p = this._beget();\n\t\t\tthis._handler.fold(handleDelay, ms, void 0, p._handler);\n\t\t\treturn p;\n\t\t};\n\n\t\tfunction handleDelay(ms, x, h) {\n\t\t\tsetTimeout(resolveDelay, ms, x, h);\n\t\t}\n\n\t\tfunction resolveDelay(x, h) {\n\t\t\th.resolve(x);\n\t\t}\n\n\t\t/**\n\t\t * Return a new promise that rejects after ms milliseconds unless\n\t\t * this promise fulfills earlier, in which case the returned promise\n\t\t * fulfills with the same value.\n\t\t * @param {number} ms milliseconds\n\t\t * @param {Error|*=} reason optional rejection reason to use, defaults\n\t\t * to a TimeoutError if not provided\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype.timeout = function(ms, reason) {\n\t\t\tvar p = this._beget();\n\t\t\tvar h = p._handler;\n\n\t\t\tvar t = setTimeout(onTimeout, ms, reason, p._handler);\n\n\t\t\tthis._handler.visit(h,\n\t\t\t\tfunction onFulfill(x) {\n\t\t\t\t\tenv.clearTimer(t);\n\t\t\t\t\tthis.resolve(x); // this = h\n\t\t\t\t},\n\t\t\t\tfunction onReject(x) {\n\t\t\t\t\tenv.clearTimer(t);\n\t\t\t\t\tthis.reject(x); // this = h\n\t\t\t\t},\n\t\t\t\th.notify);\n\n\t\t\treturn p;\n\t\t};\n\n\t\tfunction onTimeout(reason, h, ms) {\n\t\t\tvar e = typeof reason === 'undefined'\n\t\t\t\t? new TimeoutError('timed out after ' + ms + 'ms')\n\t\t\t\t: reason;\n\t\t\th.reject(e);\n\t\t}\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n", "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar setTimer = require('../env').setTimer;\n\tvar format = require('../format');\n\n\treturn function unhandledRejection(Promise) {\n\n\t\tvar logError = noop;\n\t\tvar logInfo = noop;\n\t\tvar localConsole;\n\n\t\tif(typeof console !== 'undefined') {\n\t\t\t// Alias console to prevent things like uglify's drop_console option from\n\t\t\t// removing console.log/error. Unhandled rejections fall into the same\n\t\t\t// category as uncaught exceptions, and build tools shouldn't silence them.\n\t\t\tlocalConsole = console;\n\t\t\tlogError = typeof localConsole.error !== 'undefined'\n\t\t\t\t? function (e) { localConsole.error(e); }\n\t\t\t\t: function (e) { localConsole.log(e); };\n\n\t\t\tlogInfo = typeof localConsole.info !== 'undefined'\n\t\t\t\t? function (e) { localConsole.info(e); }\n\t\t\t\t: function (e) { localConsole.log(e); };\n\t\t}\n\n\t\tPromise.onPotentiallyUnhandledRejection = function(rejection) {\n\t\t\tenqueue(report, rejection);\n\t\t};\n\n\t\tPromise.onPotentiallyUnhandledRejectionHandled = function(rejection) {\n\t\t\tenqueue(unreport, rejection);\n\t\t};\n\n\t\tPromise.onFatalRejection = function(rejection) {\n\t\t\tenqueue(throwit, rejection.value);\n\t\t};\n\n\t\tvar tasks = [];\n\t\tvar reported = [];\n\t\tvar running = null;\n\n\t\tfunction report(r) {\n\t\t\tif(!r.handled) {\n\t\t\t\treported.push(r);\n\t\t\t\tlogError('Potentially unhandled rejection [' + r.id + '] ' + format.formatError(r.value));\n\t\t\t}\n\t\t}\n\n\t\tfunction unreport(r) {\n\t\t\tvar i = reported.indexOf(r);\n\t\t\tif(i >= 0) {\n\t\t\t\treported.splice(i, 1);\n\t\t\t\tlogInfo('Handled previous rejection [' + r.id + '] ' + format.formatObject(r.value));\n\t\t\t}\n\t\t}\n\n\t\tfunction enqueue(f, x) {\n\t\t\ttasks.push(f, x);\n\t\t\tif(running === null) {\n\t\t\t\trunning = setTimer(flush, 0);\n\t\t\t}\n\t\t}\n\n\t\tfunction flush() {\n\t\t\trunning = null;\n\t\t\twhile(tasks.length > 0) {\n\t\t\t\ttasks.shift()(tasks.shift());\n\t\t\t}\n\t\t}\n\n\t\treturn Promise;\n\t};\n\n\tfunction throwit(e) {\n\t\tthrow e;\n\t}\n\n\tfunction noop() {}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n", "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function addWith(Promise) {\n\t\t/**\n\t\t * Returns a promise whose handlers will be called with `this` set to\n\t\t * the supplied receiver. Subsequent promises derived from the\n\t\t * returned promise will also have their handlers called with receiver\n\t\t * as `this`. Calling `with` with undefined or no arguments will return\n\t\t * a promise whose handlers will again be called in the usual Promises/A+\n\t\t * way (no `this`) thus safely undoing any previous `with` in the\n\t\t * promise chain.\n\t\t *\n\t\t * WARNING: Promises returned from `with`/`withThis` are NOT Promises/A+\n\t\t * compliant, specifically violating 2.2.5 (http://promisesaplus.com/#point-41)\n\t\t *\n\t\t * @param {object} receiver `this` value for all handlers attached to\n\t\t * the returned promise.\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype['with'] = Promise.prototype.withThis = function(receiver) {\n\t\t\tvar p = this._beget();\n\t\t\tvar child = p._handler;\n\t\t\tchild.receiver = receiver;\n\t\t\tthis._handler.chain(child, receiver);\n\t\t\treturn p;\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n\n", - "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n/*global process,document,setTimeout,clearTimeout,MutationObserver,WebKitMutationObserver*/\n(function(define) { 'use strict';\ndefine(function(require) {\n\t/*jshint maxcomplexity:6*/\n\n\t// Sniff \"best\" async scheduling option\n\t// Prefer process.nextTick or MutationObserver, then check for\n\t// setTimeout, and finally vertx, since its the only env that doesn't\n\t// have setTimeout\n\n\tvar MutationObs;\n\tvar capturedSetTimeout = typeof setTimeout !== 'undefined' && setTimeout;\n\n\t// Default env\n\tvar setTimer = function(f, ms) { return setTimeout(f, ms); };\n\tvar clearTimer = function(t) { return clearTimeout(t); };\n\tvar asap = function (f) { return capturedSetTimeout(f, 0); };\n\n\t// Detect specific env\n\tif (isNode()) { // Node\n\t\tasap = function (f) { return process.nextTick(f); };\n\n\t} else if (MutationObs = hasMutationObserver()) { // Modern browser\n\t\tasap = initMutationObserver(MutationObs);\n\n\t} else if (!capturedSetTimeout) { // vert.x\n\t\tvar vertxRequire = require;\n\t\tvar vertx = vertxRequire('vertx');\n\t\tsetTimer = function (f, ms) { return vertx.setTimer(ms, f); };\n\t\tclearTimer = vertx.cancelTimer;\n\t\tasap = vertx.runOnLoop || vertx.runOnContext;\n\t}\n\n\treturn {\n\t\tsetTimer: setTimer,\n\t\tclearTimer: clearTimer,\n\t\tasap: asap\n\t};\n\n\tfunction isNode () {\n\t\treturn typeof process !== 'undefined' &&\n\t\t\tObject.prototype.toString.call(process) === '[object process]';\n\t}\n\n\tfunction hasMutationObserver () {\n\t\treturn (typeof MutationObserver === 'function' && MutationObserver) ||\n\t\t\t(typeof WebKitMutationObserver === 'function' && WebKitMutationObserver);\n\t}\n\n\tfunction initMutationObserver(MutationObserver) {\n\t\tvar scheduled;\n\t\tvar node = document.createTextNode('');\n\t\tvar o = new MutationObserver(run);\n\t\to.observe(node, { characterData: true });\n\n\t\tfunction run() {\n\t\t\tvar f = scheduled;\n\t\t\tscheduled = void 0;\n\t\t\tf();\n\t\t}\n\n\t\tvar i = 0;\n\t\treturn function (f) {\n\t\t\tscheduled = f;\n\t\t\tnode.data = (i ^= 1);\n\t\t};\n\t}\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n", + "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n/*global process,document,setTimeout,clearTimeout,MutationObserver,WebKitMutationObserver*/\n(function(define) { 'use strict';\ndefine(function(require) {\n\t/*jshint maxcomplexity:6*/\n\n\t// Sniff \"best\" async scheduling option\n\t// Prefer process.nextTick or MutationObserver, then check for\n\t// setTimeout, and finally vertx, since its the only env that doesn't\n\t// have setTimeout\n\n\tvar MutationObs;\n\tvar capturedSetTimeout = typeof setTimeout !== 'undefined' && setTimeout;\n\n\t// Default env\n\tvar setTimer = function(f, ms) { return setTimeout(f, ms); };\n\tvar clearTimer = function(t) { return clearTimeout(t); };\n\tvar asap = function (f) { return capturedSetTimeout(f, 0); };\n\n\t// Detect specific env\n\tif (isNode()) { // Node\n\t\tasap = function (f) { return process.nextTick(f); };\n\n\t} else if (MutationObs = hasMutationObserver()) { // Modern browser\n\t\tasap = initMutationObserver(MutationObs);\n\n\t} else if (!capturedSetTimeout) { // vert.x\n\t\tvar vertxRequire = require;\n\t\tvar vertx = vertxRequire('vertx');\n\t\tsetTimer = function (f, ms) { return vertx.setTimer(ms, f); };\n\t\tclearTimer = vertx.cancelTimer;\n\t\tasap = vertx.runOnLoop || vertx.runOnContext;\n\t}\n\n\treturn {\n\t\tsetTimer: setTimer,\n\t\tclearTimer: clearTimer,\n\t\tasap: asap\n\t};\n\n\tfunction isNode () {\n\t\treturn typeof process !== 'undefined' &&\n\t\t\tObject.prototype.toString.call(process) === '[object process]';\n\t}\n\n\tfunction hasMutationObserver () {\n\t return (typeof MutationObserver !== 'undefined' && MutationObserver) ||\n\t\t\t(typeof WebKitMutationObserver !== 'undefined' && WebKitMutationObserver);\n\t}\n\n\tfunction initMutationObserver(MutationObserver) {\n\t\tvar scheduled;\n\t\tvar node = document.createTextNode('');\n\t\tvar o = new MutationObserver(run);\n\t\to.observe(node, { characterData: true });\n\n\t\tfunction run() {\n\t\t\tvar f = scheduled;\n\t\t\tscheduled = void 0;\n\t\t\tf();\n\t\t}\n\n\t\tvar i = 0;\n\t\treturn function (f) {\n\t\t\tscheduled = f;\n\t\t\tnode.data = (i ^= 1);\n\t\t};\n\t}\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n", "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn {\n\t\tformatError: formatError,\n\t\tformatObject: formatObject,\n\t\ttryStringify: tryStringify\n\t};\n\n\t/**\n\t * Format an error into a string. If e is an Error and has a stack property,\n\t * it's returned. Otherwise, e is formatted using formatObject, with a\n\t * warning added about e not being a proper Error.\n\t * @param {*} e\n\t * @returns {String} formatted string, suitable for output to developers\n\t */\n\tfunction formatError(e) {\n\t\tvar s = typeof e === 'object' && e !== null && (e.stack || e.message) ? e.stack || e.message : formatObject(e);\n\t\treturn e instanceof Error ? s : s + ' (WARNING: non-Error used)';\n\t}\n\n\t/**\n\t * Format an object, detecting \"plain\" objects and running them through\n\t * JSON.stringify if possible.\n\t * @param {Object} o\n\t * @returns {string}\n\t */\n\tfunction formatObject(o) {\n\t\tvar s = String(o);\n\t\tif(s === '[object Object]' && typeof JSON !== 'undefined') {\n\t\t\ts = tryStringify(o, s);\n\t\t}\n\t\treturn s;\n\t}\n\n\t/**\n\t * Try to return the result of JSON.stringify(x). If that fails, return\n\t * defaultValue\n\t * @param {*} x\n\t * @param {*} defaultValue\n\t * @returns {String|*} JSON.stringify(x) or defaultValue\n\t */\n\tfunction tryStringify(x, defaultValue) {\n\t\ttry {\n\t\t\treturn JSON.stringify(x);\n\t\t} catch(e) {\n\t\t\treturn defaultValue;\n\t\t}\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n", "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function liftAll(liftOne, combine, dst, src) {\n\t\tif(typeof combine === 'undefined') {\n\t\t\tcombine = defaultCombine;\n\t\t}\n\n\t\treturn Object.keys(src).reduce(function(dst, key) {\n\t\t\tvar f = src[key];\n\t\t\treturn typeof f === 'function' ? combine(dst, liftOne(f), key) : dst;\n\t\t}, typeof dst === 'undefined' ? defaultDst(src) : dst);\n\t};\n\n\tfunction defaultCombine(o, f, k) {\n\t\to[k] = f;\n\t\treturn o;\n\t}\n\n\tfunction defaultDst(src) {\n\t\treturn typeof src === 'function' ? src.bind() : Object.create(src);\n\t}\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n", - "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function makePromise(environment) {\n\n\t\tvar tasks = environment.scheduler;\n\t\tvar emitRejection = initEmitRejection();\n\n\t\tvar objectCreate = Object.create ||\n\t\t\tfunction(proto) {\n\t\t\t\tfunction Child() {}\n\t\t\t\tChild.prototype = proto;\n\t\t\t\treturn new Child();\n\t\t\t};\n\n\t\t/**\n\t\t * Create a promise whose fate is determined by resolver\n\t\t * @constructor\n\t\t * @returns {Promise} promise\n\t\t * @name Promise\n\t\t */\n\t\tfunction Promise(resolver, handler) {\n\t\t\tthis._handler = resolver === Handler ? handler : init(resolver);\n\t\t}\n\n\t\t/**\n\t\t * Run the supplied resolver\n\t\t * @param resolver\n\t\t * @returns {Pending}\n\t\t */\n\t\tfunction init(resolver) {\n\t\t\tvar handler = new Pending();\n\n\t\t\ttry {\n\t\t\t\tresolver(promiseResolve, promiseReject, promiseNotify);\n\t\t\t} catch (e) {\n\t\t\t\tpromiseReject(e);\n\t\t\t}\n\n\t\t\treturn handler;\n\n\t\t\t/**\n\t\t\t * Transition from pre-resolution state to post-resolution state, notifying\n\t\t\t * all listeners of the ultimate fulfillment or rejection\n\t\t\t * @param {*} x resolution value\n\t\t\t */\n\t\t\tfunction promiseResolve (x) {\n\t\t\t\thandler.resolve(x);\n\t\t\t}\n\t\t\t/**\n\t\t\t * Reject this promise with reason, which will be used verbatim\n\t\t\t * @param {Error|*} reason rejection reason, strongly suggested\n\t\t\t * to be an Error type\n\t\t\t */\n\t\t\tfunction promiseReject (reason) {\n\t\t\t\thandler.reject(reason);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * @deprecated\n\t\t\t * Issue a progress event, notifying all progress listeners\n\t\t\t * @param {*} x progress event payload to pass to all listeners\n\t\t\t */\n\t\t\tfunction promiseNotify (x) {\n\t\t\t\thandler.notify(x);\n\t\t\t}\n\t\t}\n\n\t\t// Creation\n\n\t\tPromise.resolve = resolve;\n\t\tPromise.reject = reject;\n\t\tPromise.never = never;\n\n\t\tPromise._defer = defer;\n\t\tPromise._handler = getHandler;\n\n\t\t/**\n\t\t * Returns a trusted promise. If x is already a trusted promise, it is\n\t\t * returned, otherwise returns a new trusted Promise which follows x.\n\t\t * @param {*} x\n\t\t * @return {Promise} promise\n\t\t */\n\t\tfunction resolve(x) {\n\t\t\treturn isPromise(x) ? x\n\t\t\t\t: new Promise(Handler, new Async(getHandler(x)));\n\t\t}\n\n\t\t/**\n\t\t * Return a reject promise with x as its reason (x is used verbatim)\n\t\t * @param {*} x\n\t\t * @returns {Promise} rejected promise\n\t\t */\n\t\tfunction reject(x) {\n\t\t\treturn new Promise(Handler, new Async(new Rejected(x)));\n\t\t}\n\n\t\t/**\n\t\t * Return a promise that remains pending forever\n\t\t * @returns {Promise} forever-pending promise.\n\t\t */\n\t\tfunction never() {\n\t\t\treturn foreverPendingPromise; // Should be frozen\n\t\t}\n\n\t\t/**\n\t\t * Creates an internal {promise, resolver} pair\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tfunction defer() {\n\t\t\treturn new Promise(Handler, new Pending());\n\t\t}\n\n\t\t// Transformation and flow control\n\n\t\t/**\n\t\t * Transform this promise's fulfillment value, returning a new Promise\n\t\t * for the transformed result. If the promise cannot be fulfilled, onRejected\n\t\t * is called with the reason. onProgress *may* be called with updates toward\n\t\t * this promise's fulfillment.\n\t\t * @param {function=} onFulfilled fulfillment handler\n\t\t * @param {function=} onRejected rejection handler\n\t\t * @param {function=} onProgress @deprecated progress handler\n\t\t * @return {Promise} new promise\n\t\t */\n\t\tPromise.prototype.then = function(onFulfilled, onRejected, onProgress) {\n\t\t\tvar parent = this._handler;\n\t\t\tvar state = parent.join().state();\n\n\t\t\tif ((typeof onFulfilled !== 'function' && state > 0) ||\n\t\t\t\t(typeof onRejected !== 'function' && state < 0)) {\n\t\t\t\t// Short circuit: value will not change, simply share handler\n\t\t\t\treturn new this.constructor(Handler, parent);\n\t\t\t}\n\n\t\t\tvar p = this._beget();\n\t\t\tvar child = p._handler;\n\n\t\t\tparent.chain(child, parent.receiver, onFulfilled, onRejected, onProgress);\n\n\t\t\treturn p;\n\t\t};\n\n\t\t/**\n\t\t * If this promise cannot be fulfilled due to an error, call onRejected to\n\t\t * handle the error. Shortcut for .then(undefined, onRejected)\n\t\t * @param {function?} onRejected\n\t\t * @return {Promise}\n\t\t */\n\t\tPromise.prototype['catch'] = function(onRejected) {\n\t\t\treturn this.then(void 0, onRejected);\n\t\t};\n\n\t\t/**\n\t\t * Creates a new, pending promise of the same type as this promise\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype._beget = function() {\n\t\t\treturn begetFrom(this._handler, this.constructor);\n\t\t};\n\n\t\tfunction begetFrom(parent, Promise) {\n\t\t\tvar child = new Pending(parent.receiver, parent.join().context);\n\t\t\treturn new Promise(Handler, child);\n\t\t}\n\n\t\t// Array combinators\n\n\t\tPromise.all = all;\n\t\tPromise.race = race;\n\t\tPromise._traverse = traverse;\n\n\t\t/**\n\t\t * Return a promise that will fulfill when all promises in the\n\t\t * input array have fulfilled, or will reject when one of the\n\t\t * promises rejects.\n\t\t * @param {array} promises array of promises\n\t\t * @returns {Promise} promise for array of fulfillment values\n\t\t */\n\t\tfunction all(promises) {\n\t\t\treturn traverseWith(snd, null, promises);\n\t\t}\n\n\t\t/**\n\t\t * Array> -> Promise>\n\t\t * @private\n\t\t * @param {function} f function to apply to each promise's value\n\t\t * @param {Array} promises array of promises\n\t\t * @returns {Promise} promise for transformed values\n\t\t */\n\t\tfunction traverse(f, promises) {\n\t\t\treturn traverseWith(tryCatch2, f, promises);\n\t\t}\n\n\t\tfunction traverseWith(tryMap, f, promises) {\n\t\t\tvar handler = typeof f === 'function' ? mapAt : settleAt;\n\n\t\t\tvar resolver = new Pending();\n\t\t\tvar pending = promises.length >>> 0;\n\t\t\tvar results = new Array(pending);\n\n\t\t\tfor (var i = 0, x; i < promises.length && !resolver.resolved; ++i) {\n\t\t\t\tx = promises[i];\n\n\t\t\t\tif (x === void 0 && !(i in promises)) {\n\t\t\t\t\t--pending;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttraverseAt(promises, handler, i, x, resolver);\n\t\t\t}\n\n\t\t\tif(pending === 0) {\n\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t}\n\n\t\t\treturn new Promise(Handler, resolver);\n\n\t\t\tfunction mapAt(i, x, resolver) {\n\t\t\t\tif(!resolver.resolved) {\n\t\t\t\t\ttraverseAt(promises, settleAt, i, tryMap(f, x, i), resolver);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction settleAt(i, x, resolver) {\n\t\t\t\tresults[i] = x;\n\t\t\t\tif(--pending === 0) {\n\t\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction traverseAt(promises, handler, i, x, resolver) {\n\t\t\tif (maybeThenable(x)) {\n\t\t\t\tvar h = getHandlerMaybeThenable(x);\n\t\t\t\tvar s = h.state();\n\n\t\t\t\tif (s === 0) {\n\t\t\t\t\th.fold(handler, i, void 0, resolver);\n\t\t\t\t} else if (s > 0) {\n\t\t\t\t\thandler(i, h.value, resolver);\n\t\t\t\t} else {\n\t\t\t\t\tresolver.become(h);\n\t\t\t\t\tvisitRemaining(promises, i+1, h);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thandler(i, x, resolver);\n\t\t\t}\n\t\t}\n\n\t\tPromise._visitRemaining = visitRemaining;\n\t\tfunction visitRemaining(promises, start, handler) {\n\t\t\tfor(var i=start; i 0) ||\n\t\t\t\t(typeof onRejected !== 'function' && state < 0)) {\n\t\t\t\t// Short circuit: value will not change, simply share handler\n\t\t\t\treturn new this.constructor(Handler, parent);\n\t\t\t}\n\n\t\t\tvar p = this._beget();\n\t\t\tvar child = p._handler;\n\n\t\t\tparent.chain(child, parent.receiver, onFulfilled, onRejected, onProgress);\n\n\t\t\treturn p;\n\t\t};\n\n\t\t/**\n\t\t * If this promise cannot be fulfilled due to an error, call onRejected to\n\t\t * handle the error. Shortcut for .then(undefined, onRejected)\n\t\t * @param {function?} onRejected\n\t\t * @return {Promise}\n\t\t */\n\t\tPromise.prototype['catch'] = function(onRejected) {\n\t\t\treturn this.then(void 0, onRejected);\n\t\t};\n\n\t\t/**\n\t\t * Creates a new, pending promise of the same type as this promise\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype._beget = function() {\n\t\t\treturn begetFrom(this._handler, this.constructor);\n\t\t};\n\n\t\tfunction begetFrom(parent, Promise) {\n\t\t\tvar child = new Pending(parent.receiver, parent.join().context);\n\t\t\treturn new Promise(Handler, child);\n\t\t}\n\n\t\t// Array combinators\n\n\t\tPromise.all = all;\n\t\tPromise.race = race;\n\t\tPromise._traverse = traverse;\n\n\t\t/**\n\t\t * Return a promise that will fulfill when all promises in the\n\t\t * input array have fulfilled, or will reject when one of the\n\t\t * promises rejects.\n\t\t * @param {array} promises array of promises\n\t\t * @returns {Promise} promise for array of fulfillment values\n\t\t */\n\t\tfunction all(promises) {\n\t\t\treturn traverseWith(snd, null, promises);\n\t\t}\n\n\t\t/**\n\t\t * Array> -> Promise>\n\t\t * @private\n\t\t * @param {function} f function to apply to each promise's value\n\t\t * @param {Array} promises array of promises\n\t\t * @returns {Promise} promise for transformed values\n\t\t */\n\t\tfunction traverse(f, promises) {\n\t\t\treturn traverseWith(tryCatch2, f, promises);\n\t\t}\n\n\t\tfunction traverseWith(tryMap, f, promises) {\n\t\t\tvar handler = typeof f === 'function' ? mapAt : settleAt;\n\n\t\t\tvar resolver = new Pending();\n\t\t\tvar pending = promises.length >>> 0;\n\t\t\tvar results = new Array(pending);\n\n\t\t\tfor (var i = 0, x; i < promises.length && !resolver.resolved; ++i) {\n\t\t\t\tx = promises[i];\n\n\t\t\t\tif (x === void 0 && !(i in promises)) {\n\t\t\t\t\t--pending;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttraverseAt(promises, handler, i, x, resolver);\n\t\t\t}\n\n\t\t\tif(pending === 0) {\n\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t}\n\n\t\t\treturn new Promise(Handler, resolver);\n\n\t\t\tfunction mapAt(i, x, resolver) {\n\t\t\t\tif(!resolver.resolved) {\n\t\t\t\t\ttraverseAt(promises, settleAt, i, tryMap(f, x, i), resolver);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction settleAt(i, x, resolver) {\n\t\t\t\tresults[i] = x;\n\t\t\t\tif(--pending === 0) {\n\t\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction traverseAt(promises, handler, i, x, resolver) {\n\t\t\tif (maybeThenable(x)) {\n\t\t\t\tvar h = getHandlerMaybeThenable(x);\n\t\t\t\tvar s = h.state();\n\n\t\t\t\tif (s === 0) {\n\t\t\t\t\th.fold(handler, i, void 0, resolver);\n\t\t\t\t} else if (s > 0) {\n\t\t\t\t\thandler(i, h.value, resolver);\n\t\t\t\t} else {\n\t\t\t\t\tresolver.become(h);\n\t\t\t\t\tvisitRemaining(promises, i+1, h);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thandler(i, x, resolver);\n\t\t\t}\n\t\t}\n\n\t\tPromise._visitRemaining = visitRemaining;\n\t\tfunction visitRemaining(promises, start, handler) {\n\t\t\tfor(var i=start; i 0 ? toFulfilledState(handler.value)\n\t\t\t : toRejectedState(handler.value);\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n", "/** @license MIT License (c) copyright 2013 original author or authors */\n\n/**\n * Collection of helpers for interfacing with node-style asynchronous functions\n * using promises.\n *\n * @author Brian Cavalier\n * @contributor Renato Zannon\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar _liftAll = require('./lib/liftAll');\n\tvar setTimer = require('./lib/env').setTimer;\n\tvar slice = Array.prototype.slice;\n\n\tvar _apply = require('./lib/apply')(when.Promise, dispatch);\n\n\treturn {\n\t\tlift: lift,\n\t\tliftAll: liftAll,\n\t\tapply: apply,\n\t\tcall: call,\n\t\tcreateCallback: createCallback,\n\t\tbindCallback: bindCallback,\n\t\tliftCallback: liftCallback\n\t};\n\n\t/**\n\t * Takes a node-style async function and calls it immediately (with an optional\n\t * array of arguments or promises for arguments). It returns a promise whose\n\t * resolution depends on whether the async functions calls its callback with the\n\t * conventional error argument or not.\n\t *\n\t * With this it becomes possible to leverage existing APIs while still reaping\n\t * the benefits of promises.\n\t *\n\t * @example\n\t * function onlySmallNumbers(n, callback) {\n\t *\t\tif(n < 10) {\n\t *\t\t\tcallback(null, n + 10);\n\t *\t\t} else {\n\t *\t\t\tcallback(new Error(\"Calculation failed\"));\n\t *\t\t}\n\t *\t}\n\t *\n\t * var nodefn = require(\"when/node/function\");\n\t *\n\t * // Logs '15'\n\t * nodefn.apply(onlySmallNumbers, [5]).then(console.log, console.error);\n\t *\n\t * // Logs 'Calculation failed'\n\t * nodefn.apply(onlySmallNumbers, [15]).then(console.log, console.error);\n\t *\n\t * @param {function} f node-style function that will be called\n\t * @param {Array} [args] array of arguments to func\n\t * @returns {Promise} promise for the value func passes to its callback\n\t */\n\tfunction apply(f, args) {\n\t\treturn _apply(f, this, args || []);\n\t}\n\n\tfunction dispatch(f, thisArg, args, h) {\n\t\tvar cb = createCallback(h);\n\t\ttry {\n\t\t\tswitch(args.length) {\n\t\t\t\tcase 2: f.call(thisArg, args[0], args[1], cb); break;\n\t\t\t\tcase 1: f.call(thisArg, args[0], cb); break;\n\t\t\t\tcase 0: f.call(thisArg, cb); break;\n\t\t\t\tdefault:\n\t\t\t\t\targs.push(cb);\n\t\t\t\t\tf.apply(thisArg, args);\n\t\t\t}\n\t\t} catch(e) {\n\t\t\th.reject(e);\n\t\t}\n\t}\n\n\t/**\n\t * Has the same behavior that {@link apply} has, with the difference that the\n\t * arguments to the function are provided individually, while {@link apply} accepts\n\t * a single array.\n\t *\n\t * @example\n\t * function sumSmallNumbers(x, y, callback) {\n\t *\t\tvar result = x + y;\n\t *\t\tif(result < 10) {\n\t *\t\t\tcallback(null, result);\n\t *\t\t} else {\n\t *\t\t\tcallback(new Error(\"Calculation failed\"));\n\t *\t\t}\n\t *\t}\n\t *\n\t * // Logs '5'\n\t * nodefn.call(sumSmallNumbers, 2, 3).then(console.log, console.error);\n\t *\n\t * // Logs 'Calculation failed'\n\t * nodefn.call(sumSmallNumbers, 5, 10).then(console.log, console.error);\n\t *\n\t * @param {function} f node-style function that will be called\n\t * @param {...*} [args] arguments that will be forwarded to the function\n\t * @returns {Promise} promise for the value func passes to its callback\n\t */\n\tfunction call(f /*, args... */) {\n\t\treturn _apply(f, this, slice.call(arguments, 1));\n\t}\n\n\t/**\n\t * Takes a node-style function and returns new function that wraps the\n\t * original and, instead of taking a callback, returns a promise. Also, it\n\t * knows how to handle promises given as arguments, waiting for their\n\t * resolution before executing.\n\t *\n\t * Upon execution, the orginal function is executed as well. If it passes\n\t * a truthy value as the first argument to the callback, it will be\n\t * interpreted as an error condition, and the promise will be rejected\n\t * with it. Otherwise, the call is considered a resolution, and the promise\n\t * is resolved with the callback's second argument.\n\t *\n\t * @example\n\t * var fs = require(\"fs\"), nodefn = require(\"when/node/function\");\n\t *\n\t * var promiseRead = nodefn.lift(fs.readFile);\n\t *\n\t * // The promise is resolved with the contents of the file if everything\n\t * // goes ok\n\t * promiseRead('exists.txt').then(console.log, console.error);\n\t *\n\t * // And will be rejected if something doesn't work out\n\t * // (e.g. the files does not exist)\n\t * promiseRead('doesnt_exist.txt').then(console.log, console.error);\n\t *\n\t *\n\t * @param {Function} f node-style function to be lifted\n\t * @param {...*} [args] arguments to be prepended for the new function @deprecated\n\t * @returns {Function} a promise-returning function\n\t */\n\tfunction lift(f /*, args... */) {\n\t\tvar args1 = arguments.length > 1 ? slice.call(arguments, 1) : [];\n\t\treturn function() {\n\t\t\t// TODO: Simplify once partialing has been removed\n\t\t\tvar l = args1.length;\n\t\t\tvar al = arguments.length;\n\t\t\tvar args = new Array(al + l);\n\t\t\tvar i;\n\t\t\tfor(i=0; i 2) {\n\t\t\t\tresolver.resolve(slice.call(arguments, 1));\n\t\t\t} else {\n\t\t\t\tresolver.resolve(value);\n\t\t\t}\n\t\t};\n\t}\n\n\t/**\n\t * Attaches a node-style callback to a promise, ensuring the callback is\n\t * called for either fulfillment or rejection. Returns a promise with the same\n\t * state as the passed-in promise.\n\t *\n\t * @example\n\t *\tvar deferred = when.defer();\n\t *\n\t *\tfunction callback(err, value) {\n\t *\t\t// Handle err or use value\n\t *\t}\n\t *\n\t *\tbindCallback(deferred.promise, callback);\n\t *\n\t *\tdeferred.resolve('interesting value');\n\t *\n\t * @param {Promise} promise The promise to be attached to.\n\t * @param {Function} callback The node-style callback to attach.\n\t * @returns {Promise} A promise with the same state as the passed-in promise.\n\t */\n\tfunction bindCallback(promise, callback) {\n\t\tpromise = when(promise);\n\n\t\tif (callback) {\n\t\t\tpromise.then(success, wrapped);\n\t\t}\n\n\t\treturn promise;\n\n\t\tfunction success(value) {\n\t\t\twrapped(null, value);\n\t\t}\n\n\t\tfunction wrapped(err, value) {\n\t\t\tsetTimer(function () {\n\t\t\t\tcallback(err, value);\n\t\t\t}, 0);\n\t\t}\n\t}\n\n\t/**\n\t * Takes a node-style callback and returns new function that accepts a\n\t * promise, calling the original callback when the promise is either\n\t * fulfilled or rejected with the appropriate arguments.\n\t *\n\t * @example\n\t *\tvar deferred = when.defer();\n\t *\n\t *\tfunction callback(err, value) {\n\t *\t\t// Handle err or use value\n\t *\t}\n\t *\n\t *\tvar wrapped = liftCallback(callback);\n\t *\n\t *\t// `wrapped` can now be passed around at will\n\t *\twrapped(deferred.promise);\n\t *\n\t *\tdeferred.resolve('interesting value');\n\t *\n\t * @param {Function} callback The node-style callback to wrap.\n\t * @returns {Function} The lifted, promise-accepting function.\n\t */\n\tfunction liftCallback(callback) {\n\t\treturn function(promise) {\n\t\t\treturn bindCallback(promise, callback);\n\t\t};\n\t}\n});\n\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n\n", "/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * parallel.js\n *\n * Run a set of task functions in parallel. All tasks will\n * receive the same args\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar all = when.Promise.all;\n\tvar slice = Array.prototype.slice;\n\n\t/**\n\t * Run array of tasks in parallel\n\t * @param tasks {Array|Promise} array or promiseForArray of task functions\n\t * @param [args] {*} arguments to be passed to all tasks\n\t * @return {Promise} promise for array containing the\n\t * result of each task in the array position corresponding\n\t * to position of the task in the tasks array\n\t */\n\treturn function parallel(tasks /*, args... */) {\n\t\treturn all(slice.call(arguments, 1)).then(function(args) {\n\t\t\treturn when.map(tasks, function(task) {\n\t\t\t\treturn task.apply(void 0, args);\n\t\t\t});\n\t\t});\n\t};\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n", @@ -71,5 +71,5 @@ "/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * timeout.js\n *\n * Helper that returns a promise that rejects after a specified timeout,\n * if not explicitly resolved or rejected before that.\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\n /**\n\t * @deprecated Use when(trigger).timeout(ms)\n */\n return function timeout(msec, trigger) {\n\t\treturn when(trigger).timeout(msec);\n };\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n", "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n\n/**\n * Promises/A+ and when() implementation\n * when is part of the cujoJS family of libraries (http://cujojs.com/)\n * @author Brian Cavalier\n * @author John Hann\n */\n(function(define) { 'use strict';\ndefine(function (require) {\n\n\tvar timed = require('./lib/decorators/timed');\n\tvar array = require('./lib/decorators/array');\n\tvar flow = require('./lib/decorators/flow');\n\tvar fold = require('./lib/decorators/fold');\n\tvar inspect = require('./lib/decorators/inspect');\n\tvar generate = require('./lib/decorators/iterate');\n\tvar progress = require('./lib/decorators/progress');\n\tvar withThis = require('./lib/decorators/with');\n\tvar unhandledRejection = require('./lib/decorators/unhandledRejection');\n\tvar TimeoutError = require('./lib/TimeoutError');\n\n\tvar Promise = [array, flow, fold, generate, progress,\n\t\tinspect, withThis, timed, unhandledRejection]\n\t\t.reduce(function(Promise, feature) {\n\t\t\treturn feature(Promise);\n\t\t}, require('./lib/Promise'));\n\n\tvar apply = require('./lib/apply')(Promise);\n\n\t// Public API\n\n\twhen.promise = promise; // Create a pending promise\n\twhen.resolve = Promise.resolve; // Create a resolved promise\n\twhen.reject = Promise.reject; // Create a rejected promise\n\n\twhen.lift = lift; // lift a function to return promises\n\twhen['try'] = attempt; // call a function and return a promise\n\twhen.attempt = attempt; // alias for when.try\n\n\twhen.iterate = Promise.iterate; // DEPRECATED (use cujojs/most streams) Generate a stream of promises\n\twhen.unfold = Promise.unfold; // DEPRECATED (use cujojs/most streams) Generate a stream of promises\n\n\twhen.join = join; // Join 2 or more promises\n\n\twhen.all = all; // Resolve a list of promises\n\twhen.settle = settle; // Settle a list of promises\n\n\twhen.any = lift(Promise.any); // One-winner race\n\twhen.some = lift(Promise.some); // Multi-winner race\n\twhen.race = lift(Promise.race); // First-to-settle race\n\n\twhen.map = map; // Array.map() for promises\n\twhen.filter = filter; // Array.filter() for promises\n\twhen.reduce = lift(Promise.reduce); // Array.reduce() for promises\n\twhen.reduceRight = lift(Promise.reduceRight); // Array.reduceRight() for promises\n\n\twhen.isPromiseLike = isPromiseLike; // Is something promise-like, aka thenable\n\n\twhen.Promise = Promise; // Promise constructor\n\twhen.defer = defer; // Create a {promise, resolve, reject} tuple\n\n\t// Error types\n\n\twhen.TimeoutError = TimeoutError;\n\n\t/**\n\t * Get a trusted promise for x, or by transforming x with onFulfilled\n\t *\n\t * @param {*} x\n\t * @param {function?} onFulfilled callback to be called when x is\n\t * successfully fulfilled. If promiseOrValue is an immediate value, callback\n\t * will be invoked immediately.\n\t * @param {function?} onRejected callback to be called when x is\n\t * rejected.\n\t * @param {function?} onProgress callback to be called when progress updates\n\t * are issued for x. @deprecated\n\t * @returns {Promise} a new promise that will fulfill with the return\n\t * value of callback or errback or the completion value of promiseOrValue if\n\t * callback and/or errback is not supplied.\n\t */\n\tfunction when(x, onFulfilled, onRejected, onProgress) {\n\t\tvar p = Promise.resolve(x);\n\t\tif (arguments.length < 2) {\n\t\t\treturn p;\n\t\t}\n\n\t\treturn p.then(onFulfilled, onRejected, onProgress);\n\t}\n\n\t/**\n\t * Creates a new promise whose fate is determined by resolver.\n\t * @param {function} resolver function(resolve, reject, notify)\n\t * @returns {Promise} promise whose fate is determine by resolver\n\t */\n\tfunction promise(resolver) {\n\t\treturn new Promise(resolver);\n\t}\n\n\t/**\n\t * Lift the supplied function, creating a version of f that returns\n\t * promises, and accepts promises as arguments.\n\t * @param {function} f\n\t * @returns {Function} version of f that returns promises\n\t */\n\tfunction lift(f) {\n\t\treturn function() {\n\t\t\tfor(var i=0, l=arguments.length, a=new Array(l); i1?d.call(arguments,1):[];return function(){return v(t,this,n.concat(d.call(arguments)))}}function u(t,n,e){return p(i,n,e,t)}function c(t,n){return function(){var e=this;return h.all(arguments).then(function(r){var o,i,u=h._defer();return"number"==typeof n.callback&&(o=f(r,n.callback)),"number"==typeof n.errback&&(i=f(r,n.errback)),o>i?(a(r,i,u._handler.reject,u._handler),a(r,o,u._handler.resolve,u._handler)):(a(r,o,u._handler.resolve,u._handler),a(r,i,u._handler.reject,u._handler)),t.apply(e,r),u})}}function f(t,n){return 0>n?t.length+n+2:n}function a(t,n,e,r){"number"==typeof n&&t.splice(n,0,s(e,r))}function s(t,n){return function(){arguments.length>1?t.call(n,d.call(arguments)):t.apply(n,arguments)}}var l=t("./when"),h=l.Promise,p=t("./lib/liftAll"),d=Array.prototype.slice,y=t("./lib/apply"),v=y(h,e);return{lift:i,liftAll:u,apply:n,call:o,promisify:c}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./lib/apply":11,"./lib/liftAll":23,"./when":32}],3:[function(n,e,r){!function(t){t(function(){return function(t,n){return t.cancel=function(){try{t.reject(n(t))}catch(e){t.reject(e)}return t.promise},t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],4:[function(n,e,r){!function(t){t(function(t){var n=t("./when");return function(t,e){return n(e).delay(t)}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./when":32}],5:[function(n,e,r){!function(t){t(function(t){function n(t,n){return f(t,this,null==n?[]:a.call(n))}function e(t){var n=arguments.length>1?a.call(arguments,1):[];return function(){return f(t,this,n.concat(a.call(arguments)))}}function r(t,n,r){return c(e,n,r,t)}function o(t){var n=a.call(arguments,1);return function(){var e=this,r=a.call(arguments),o=u.apply(e,[t].concat(r));return i.reduce(n,function(t,n){return n.call(e,t)},o)}}var i=t("./when"),u=i["try"],c=t("./lib/liftAll"),f=t("./lib/apply")(i.Promise),a=Array.prototype.slice;return{lift:e,liftAll:r,call:u,apply:n,compose:o}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./lib/apply":11,"./lib/liftAll":23,"./when":32}],6:[function(n,e,r){!function(t){t(function(t){function n(t,n){return function(){var e=o.call(arguments);return r(t()).withThis(this).then(function(t){return r(n.apply(this,e))["finally"](t)})}}function e(t){function n(){e=Math.max(e-1,0),o.length>0&&o.shift()(n)}var e=0,o=[];return function(){return r.promise(function(r){t>e?r(n):o.push(r),e+=1})}}var r=t("./when"),o=Array.prototype.slice;return n.n=e,n})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./when":32}],7:[function(n,e,r){!function(t){"use strict";t(function(t){function n(t){function n(t,n,e){this[t]=n,0===--f&&e.resolve(i)}for(var e,r=u._defer(),o=u._handler(r),i={},c=Object.keys(t),f=c.length,a=0;a>>0,a=f,s=[],l=0;f>l;++l)if(i=n[l],void 0!==i||l in n){if(o=t._handler(i),o.state()>0){c.become(o),t._visitRemaining(n,l,o);break}o.visit(c,e,r)}else--a;return 0===a&&c.reject(new RangeError("any(): array must not be empty")),u}function o(n,e){function r(t){this.resolved||(s.push(t),0===--p&&(l=null,this.resolve(s)))}function o(t){this.resolved||(l.push(t),0===--i&&(s=null,this.reject(l)))}var i,u,c,f=t._defer(),a=f._handler,s=[],l=[],h=n.length>>>0,p=0;for(c=0;h>c;++c)u=n[c],(void 0!==u||c in n)&&++p;for(e=Math.max(e,0),i=p-e+1,p=Math.min(e,p),e>p?a.reject(new RangeError("some(): array must contain at least "+e+" item(s), but had "+p)):0===p&&a.resolve(s),c=0;h>c;++c)u=n[c],(void 0!==u||c in n)&&t._handler(u).visit(a,r,o,a.notify);return f}function i(n,e){return t._traverse(e,n)}function u(n,e){var r=b.call(n);return t._traverse(e,r).then(function(t){return c(r,t)})}function c(n,e){for(var r=e.length,o=new Array(r),i=0,u=0;r>i;++i)e[i]&&(o[u++]=t._handler(n[i]).value);return o.length=u,o}function f(t){return y(t.map(a))}function a(e){var r=t._handler(e);return 0===r.state()?d(e).then(n.fulfilled,n.rejected):(r._unreport(),n.inspect(r))}function s(t,n){return arguments.length>2?v.call(t,h(n),arguments[2]):v.call(t,h(n))}function l(t,n){return arguments.length>2?m.call(t,h(n),arguments[2]):m.call(t,h(n))}function h(t){return function(n,e,r){return p(t,void 0,[n,e,r])}}var p=e(t),d=t.resolve,y=t.all,v=Array.prototype.reduce,m=Array.prototype.reduceRight,b=Array.prototype.slice;return t.any=r,t.some=o,t.settle=f,t.map=i,t.filter=u,t.reduce=s,t.reduceRight=l,t.prototype.spread=function(t){return this.then(y).then(function(n){return t.apply(this,n)})},t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"../apply":11,"../state":25}],13:[function(n,e,r){!function(t){"use strict";t(function(){function t(){throw new TypeError("catch predicate must be a function")}function n(t,n){return e(n)?t instanceof n:n(t)}function e(t){return t===Error||null!=t&&t.prototype instanceof Error}function r(t){return("object"==typeof t||"function"==typeof t)&&null!==t}function o(t){return t}return function(e){function i(t,e){return function(r){return n(r,e)?t.call(this,r):a(r)}}function u(t,n,e,o){var i=t.call(n);return r(i)?c(i,e,o):e(o)}function c(t,n,e){return f(t).then(function(){return n(e)})}var f=e.resolve,a=e.reject,s=e.prototype["catch"];return e.prototype.done=function(t,n){this._handler.visit(this._handler.receiver,t,n)},e.prototype["catch"]=e.prototype.otherwise=function(n){return arguments.length<2?s.call(this,n):"function"!=typeof n?this.ensure(t):s.call(this,i(arguments[1],n))},e.prototype["finally"]=e.prototype.ensure=function(t){return"function"!=typeof t?this:this.then(function(n){return u(t,this,o,n)},function(n){return u(t,this,a,n)})},e.prototype["else"]=e.prototype.orElse=function(t){return this.then(void 0,function(){return t})},e.prototype["yield"]=function(t){return this.then(function(){return t})},e.prototype.tap=function(t){return this.then(t)["yield"](this)},e}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],14:[function(n,e,r){!function(t){"use strict";t(function(){return function(t){return t.prototype.fold=function(n,e){var r=this._beget();return this._handler.fold(function(e,r,o){t._handler(e).fold(function(t,e,r){r.resolve(n.call(this,e,t))},r,this,o)},e,r._handler.receiver,r._handler),r},t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],15:[function(n,e,r){!function(t){"use strict";t(function(t){var n=t("../state").inspect;return function(t){return t.prototype.inspect=function(){return n(t._handler(this))},t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"../state":25}],16:[function(n,e,r){!function(t){"use strict";t(function(){return function(t){function n(t,n,r,o){return e(function(n){return[n,t(n)]},n,r,o)}function e(t,n,o,i){function u(i,u){return r(o(i)).then(function(){return e(t,n,o,u)})}return r(i).then(function(e){return r(n(e)).then(function(n){return n?e:r(t(e)).spread(u)})})}var r=t.resolve;return t.iterate=n,t.unfold=e,t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],17:[function(n,e,r){!function(t){"use strict";t(function(){return function(t){return t.prototype.progress=function(t){return this.then(void 0,void 0,t)},t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],18:[function(n,e,r){!function(t){"use strict";t(function(t){function n(t,n,r,o){return e.setTimer(function(){t(r,o,n)},n)}var e=t("../env"),r=t("../TimeoutError");return function(t){function o(t,e,r){n(i,t,e,r)}function i(t,n){n.resolve(t)}function u(t,n,e){var o="undefined"==typeof t?new r("timed out after "+e+"ms"):t;n.reject(o)}return t.prototype.delay=function(t){var n=this._beget();return this._handler.fold(o,t,void 0,n._handler),n},t.prototype.timeout=function(t,r){var o=this._beget(),i=o._handler,c=n(u,t,r,o._handler);return this._handler.visit(i,function(t){e.clearTimer(c),this.resolve(t)},function(t){e.clearTimer(c),this.reject(t)},i.notify),o},t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"../TimeoutError":10,"../env":21}],19:[function(n,e,r){!function(t){"use strict";t(function(t){function n(t){throw t}function e(){}var r=t("../env").setTimer,o=t("../format");return function(t){function i(t){t.handled||(p.push(t),s("Potentially unhandled rejection ["+t.id+"] "+o.formatError(t.value)))}function u(t){var n=p.indexOf(t);n>=0&&(p.splice(n,1),l("Handled previous rejection ["+t.id+"] "+o.formatObject(t.value)))}function c(t,n){h.push(t,n),null===d&&(d=r(f,0))}function f(){for(d=null;h.length>0;)h.shift()(h.shift())}var a,s=e,l=e;"undefined"!=typeof console&&(a=console,s="undefined"!=typeof a.error?function(t){a.error(t)}:function(t){a.log(t)},l="undefined"!=typeof a.info?function(t){a.info(t)}:function(t){a.log(t)}),t.onPotentiallyUnhandledRejection=function(t){c(i,t)},t.onPotentiallyUnhandledRejectionHandled=function(t){c(u,t)},t.onFatalRejection=function(t){c(n,t.value)};var h=[],p=[],d=null;return t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"../env":21,"../format":22}],20:[function(n,e,r){!function(t){"use strict";t(function(){return function(t){return t.prototype["with"]=t.prototype.withThis=function(t){var n=this._beget(),e=n._handler;return e.receiver=t,this._handler.chain(e,t),n},t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],21:[function(n,e,r){!function(t){"use strict";t(function(t){function n(){return"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process)}function e(){return"function"==typeof MutationObserver&&MutationObserver||"function"==typeof WebKitMutationObserver&&WebKitMutationObserver}function r(t){function n(){var t=e;e=void 0,t()}var e,r=document.createTextNode(""),o=new t(n);o.observe(r,{characterData:!0});var i=0;return function(t){e=t,r.data=i^=1}}var o,i="undefined"!=typeof setTimeout&&setTimeout,u=function(t,n){return setTimeout(t,n)},c=function(t){return clearTimeout(t)},f=function(t){return i(t,0)};if(n())f=function(t){return process.nextTick(t)};else if(o=e())f=r(o);else if(!i){var a=t,s=a("vertx");u=function(t,n){return s.setTimer(n,t)},c=s.cancelTimer,f=s.runOnLoop||s.runOnContext}return{setTimer:u,clearTimer:c,asap:f}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{}],22:[function(n,e,r){!function(t){"use strict";t(function(){function t(t){var e="object"==typeof t&&null!==t&&(t.stack||t.message)?t.stack||t.message:n(t);return t instanceof Error?e:e+" (WARNING: non-Error used)"}function n(t){var n=String(t);return"[object Object]"===n&&"undefined"!=typeof JSON&&(n=e(t,n)),n}function e(t,n){try{return JSON.stringify(t)}catch(e){return n}}return{formatError:t,formatObject:n,tryStringify:e}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],23:[function(n,e,r){!function(t){"use strict";t(function(){function t(t,n,e){return t[e]=n,t}function n(t){return"function"==typeof t?t.bind():Object.create(t)}return function(e,r,o,i){return"undefined"==typeof r&&(r=t),Object.keys(i).reduce(function(t,n){var o=i[n];return"function"==typeof o?r(t,e(o),n):t},"undefined"==typeof o?n(i):o)}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],24:[function(n,e,r){!function(t){"use strict";t(function(){return function(t){function n(t,n){this._handler=t===g?n:e(t)}function e(t){function n(t){o.resolve(t)}function e(t){o.reject(t)}function r(t){o.notify(t)}var o=new w;try{t(n,e,r)}catch(i){e(i)}return o}function r(t){return L(t)?t:new n(g,new j(v(t)))}function o(t){return new n(g,new j(new A(t)))}function i(){return $}function u(){return new n(g,new w)}function c(t,n){var e=new w(t.receiver,t.join().context);return new n(g,e)}function f(t){return s(K,null,t)}function a(t,n){return s(N,t,n)}function s(t,e,r){function o(n,o,u){u.resolved||l(r,i,n,t(e,o,n),u)}function i(t,n,e){s[t]=n,0===--a&&e.become(new k(s))}for(var u,c="function"==typeof e?o:i,f=new w,a=r.length>>>0,s=new Array(a),h=0;h0?n(e,i.value,o):(o.become(i),h(t,e+1,i))}else n(e,r,o)}function h(t,n,e){for(var r=n;re&&t._unreport()}}function d(t){return"object"!=typeof t||null===t?o(new TypeError("non-iterable passed to race()")):0===t.length?i():1===t.length?r(t[0]):y(t)}function y(t){var e,r,o,i=new w;for(e=0;e0||"function"!=typeof n&&0>o)return new this.constructor(g,r);var i=this._beget(),u=i._handler;return r.chain(u,r.receiver,t,n,e),i},n.prototype["catch"]=function(t){return this.then(void 0,t)},n.prototype._beget=function(){return c(this._handler,this.constructor)},n.all=f,n.race=d,n._traverse=a,n._visitRemaining=h,g.prototype.when=g.prototype.become=g.prototype.notify=g.prototype.fail=g.prototype._unreport=g.prototype._report=D,g.prototype._state=0,g.prototype.state=function(){return this._state},g.prototype.join=function(){for(var t=this;void 0!==t.handler;)t=t.handler;return t},g.prototype.chain=function(t,n,e,r,o){this.when({resolver:t,receiver:n,fulfilled:e,rejected:r,progress:o})},g.prototype.visit=function(t,n,e,r){this.chain(X,t,n,e,r)},g.prototype.fold=function(t,n,e,r){this.when(new Q(t,n,e,r))},J(g,_),_.prototype.become=function(t){t.fail()};var X=new _;J(g,w),w.prototype._state=0,w.prototype.resolve=function(t){this.become(v(t))},w.prototype.reject=function(t){this.resolved||this.become(new A(t))},w.prototype.join=function(){if(!this.resolved)return this;for(var t=this;void 0!==t.handler;)if(t=t.handler,t===this)return this.handler=R();return t},w.prototype.run=function(){var t=this.consumers,n=this.handler;this.handler=this.handler.join(),this.consumers=void 0;for(var e=0;e0?e(r.value):n(r.value)}return{pending:t,fulfilled:e,rejected:n,inspect:r}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],26:[function(n,e,r){!function(t){t(function(t){function n(t,n){return p(t,this,n||[])}function e(t,n,e,r){var o=u(r);try{switch(e.length){case 2:t.call(n,e[0],e[1],o);break;case 1:t.call(n,e[0],o);break;case 0:t.call(n,o);break;default:e.push(o),t.apply(n,e)}}catch(i){r.reject(i)}}function r(t){return p(t,this,h.call(arguments,1))}function o(t){var n=arguments.length>1?h.call(arguments,1):[];return function(){var e,r=n.length,o=arguments.length,i=new Array(o+r);for(e=0;r>e;++e)i[e]=n[e];for(e=0;o>e;++e)i[e+r]=arguments[e];return p(t,this,i)}}function i(t,n,e){return s(o,n,e,t)}function u(t){return function(n,e){n?t.reject(n):arguments.length>2?t.resolve(h.call(arguments,1)):t.resolve(e)}}function c(t,n){function e(t){r(null,t)}function r(t,e){l(function(){n(t,e)},0)}return t=a(t),n&&t.then(e,r),t}function f(t){return function(n){return c(n,t)}}var a=t("./when"),s=t("./lib/liftAll"),l=t("./lib/env").setTimer,h=Array.prototype.slice,p=t("./lib/apply")(a.Promise,e);return{lift:o,liftAll:i,apply:n,call:r,createCallback:u,bindCallback:c,liftCallback:f}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./lib/apply":11,"./lib/env":21,"./lib/liftAll":23,"./when":32}],27:[function(n,e,r){!function(t){t(function(t){var n=t("./when"),e=n.Promise.all,r=Array.prototype.slice;return function(t){return e(r.call(arguments,1)).then(function(e){return n.map(t,function(t){return t.apply(void 0,e)})})}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./when":32}],28:[function(n,e,r){!function(t){t(function(t){var n=t("./when"),e=n.Promise.all,r=Array.prototype.slice;return function(t){var o=function(t,n){return o=function(t,n){return n(t)},n.apply(null,t)};return e(r.call(arguments,1)).then(function(e){return n.reduce(t,function(t,n){return o(t,n)},e)})}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./when":32}],29:[function(n,e,r){!function(t){"use strict";t(function(t){var n=t("./when"),e=n["try"],r=t("./cancelable");return function(t,o,i,u){function c(t){s.resolve(t)}function f(t){e(o).then(a,h),void 0!==t&&s.notify(t)}function a(){l||n(t(),function(t){n(i(t),function(n){return n?c(t):f(t)},function(){f(t)})},h)}var s,l,h;return l=!1,s=r(n.defer(),function(){l=!0}),h=s.reject,i=i||function(){return!1},"function"!=typeof o&&(o=function(t){return function(){return n().delay(t)}}(o)),u?f():a(),s.promise=Object.create(s.promise),s.promise.cancel=s.cancel,s.promise}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./cancelable":3,"./when":32}],30:[function(n,e,r){!function(t){t(function(t){var n=t("./when"),e=n.Promise.all,r=Array.prototype.slice;return function(t){function o(t){return i.push(t),i}var i=[];return e(r.call(arguments,1)).then(function(e){return n.reduce(t,function(t,r){return n(r.apply(void 0,e),o)},i)})}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./when":32}],31:[function(n,e,r){!function(t){t(function(t){var n=t("./when");return function(t,e){return n(e).timeout(t)}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./when":32}],32:[function(n,e,r){!function(t){"use strict";t(function(t){function n(t,n,e,r){var o=x.resolve(t);return arguments.length<2?o:o.then(n,e,r)}function e(t){return new x(t)}function r(t){return function(){for(var n=0,e=arguments.length,r=new Array(e);e>n;++n)r[n]=arguments[n];return k(t,this,r)}}function o(t){for(var n=0,e=arguments.length-1,r=new Array(e);e>n;++n)r[n]=arguments[n+1];return k(t,this,r)}function i(){return new u}function u(){function t(t){r._handler.resolve(t)}function n(t){r._handler.reject(t)}function e(t){r._handler.notify(t)}var r=x._defer();this.promise=r,this.resolve=t,this.reject=n,this.notify=e,this.resolver={resolve:t,reject:n,notify:e}}function c(t){return t&&"function"==typeof t.then}function f(){return x.all(arguments)}function a(t){return n(t,x.all)}function s(t){return n(t,x.settle)}function l(t,e){return n(t,function(t){return x.map(t,e)})}function h(t,e){return n(t,function(t){return x.filter(t,e)})}var p=t("./lib/decorators/timed"),d=t("./lib/decorators/array"),y=t("./lib/decorators/flow"),v=t("./lib/decorators/fold"),m=t("./lib/decorators/inspect"),b=t("./lib/decorators/iterate"),g=t("./lib/decorators/progress"),_=t("./lib/decorators/with"),w=t("./lib/decorators/unhandledRejection"),j=t("./lib/TimeoutError"),x=[d,y,v,b,g,m,_,p,w].reduce(function(t,n){return n(t)},t("./lib/Promise")),k=t("./lib/apply")(x);return n.promise=e,n.resolve=x.resolve,n.reject=x.reject,n.lift=r,n["try"]=o,n.attempt=o,n.iterate=x.iterate,n.unfold=x.unfold,n.join=f,n.all=a,n.settle=s,n.any=r(x.any),n.some=r(x.some),n.race=r(x.race),n.map=l,n.filter=h,n.reduce=r(x.reduce),n.reduceRight=r(x.reduceRight),n.isPromiseLike=c,n.Promise=x,n.defer=i,n.TimeoutError=j,n})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./lib/Promise":8,"./lib/TimeoutError":10,"./lib/apply":11,"./lib/decorators/array":12,"./lib/decorators/flow":13,"./lib/decorators/fold":14,"./lib/decorators/inspect":15,"./lib/decorators/iterate":16,"./lib/decorators/progress":17,"./lib/decorators/timed":18,"./lib/decorators/unhandledRejection":19,"./lib/decorators/with":20}]},{},[1])(1)}); -//# sourceMappingURL=when.min.js.map \ No newline at end of file +!function(t){"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):"undefined"!=typeof window?window.when=t():"undefined"!=typeof global?global.when=t():"undefined"!=typeof self&&(self.when=t())}(function(){var t;return function n(t,e,r){function o(u,c){if(!e[u]){if(!t[u]){var f="function"==typeof require&&require;if(!c&&f)return f(u,!0);if(i)return i(u,!0);throw new Error("Cannot find module '"+u+"'")}var a=e[u]={exports:{}};t[u][0].call(a.exports,function(n){var e=t[u][1][n];return o(e?e:n)},a,a.exports,n,t,e,r)}return e[u].exports}for(var i="function"==typeof require&&require,u=0;u1?d.call(arguments,1):[];return function(){return v(t,this,n.concat(d.call(arguments)))}}function u(t,n,e){return p(i,n,e,t)}function c(t,n){return function(){var e=this;return h.all(arguments).then(function(r){var o,i,u=h._defer();return"number"==typeof n.callback&&(o=f(r,n.callback)),"number"==typeof n.errback&&(i=f(r,n.errback)),o>i?(a(r,i,u._handler.reject,u._handler),a(r,o,u._handler.resolve,u._handler)):(a(r,o,u._handler.resolve,u._handler),a(r,i,u._handler.reject,u._handler)),t.apply(e,r),u})}}function f(t,n){return 0>n?t.length+n+2:n}function a(t,n,e,r){"number"==typeof n&&t.splice(n,0,s(e,r))}function s(t,n){return function(){arguments.length>1?t.call(n,d.call(arguments)):t.apply(n,arguments)}}var l=t("./when"),h=l.Promise,p=t("./lib/liftAll"),d=Array.prototype.slice,y=t("./lib/apply"),v=y(h,e);return{lift:i,liftAll:u,apply:n,call:o,promisify:c}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./lib/apply":11,"./lib/liftAll":23,"./when":32}],3:[function(n,e,r){!function(t){t(function(){return function(t,n){return t.cancel=function(){try{t.reject(n(t))}catch(e){t.reject(e)}return t.promise},t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],4:[function(n,e,r){!function(t){t(function(t){var n=t("./when");return function(t,e){return n(e).delay(t)}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./when":32}],5:[function(n,e,r){!function(t){t(function(t){function n(t,n){return f(t,this,null==n?[]:a.call(n))}function e(t){var n=arguments.length>1?a.call(arguments,1):[];return function(){return f(t,this,n.concat(a.call(arguments)))}}function r(t,n,r){return c(e,n,r,t)}function o(t){var n=a.call(arguments,1);return function(){var e=this,r=a.call(arguments),o=u.apply(e,[t].concat(r));return i.reduce(n,function(t,n){return n.call(e,t)},o)}}var i=t("./when"),u=i["try"],c=t("./lib/liftAll"),f=t("./lib/apply")(i.Promise),a=Array.prototype.slice;return{lift:e,liftAll:r,call:u,apply:n,compose:o}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./lib/apply":11,"./lib/liftAll":23,"./when":32}],6:[function(n,e,r){!function(t){t(function(t){function n(t,n){return function(){var e=o.call(arguments);return r(t()).withThis(this).then(function(t){return r(n.apply(this,e))["finally"](t)})}}function e(t){function n(){e=Math.max(e-1,0),o.length>0&&o.shift()(n)}var e=0,o=[];return function(){return r.promise(function(r){t>e?r(n):o.push(r),e+=1})}}var r=t("./when"),o=Array.prototype.slice;return n.n=e,n})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./when":32}],7:[function(n,e,r){!function(t){"use strict";t(function(t){function n(t){function n(t,n,e){this[t]=n,0===--f&&e.resolve(i)}for(var e,r=u._defer(),o=u._handler(r),i={},c=Object.keys(t),f=c.length,a=0;a>>0,a=f,s=[],l=0;f>l;++l)if(i=n[l],void 0!==i||l in n){if(o=t._handler(i),o.state()>0){c.become(o),t._visitRemaining(n,l,o);break}o.visit(c,e,r)}else--a;return 0===a&&c.reject(new RangeError("any(): array must not be empty")),u}function o(n,e){function r(t){this.resolved||(s.push(t),0===--p&&(l=null,this.resolve(s)))}function o(t){this.resolved||(l.push(t),0===--i&&(s=null,this.reject(l)))}var i,u,c,f=t._defer(),a=f._handler,s=[],l=[],h=n.length>>>0,p=0;for(c=0;h>c;++c)u=n[c],(void 0!==u||c in n)&&++p;for(e=Math.max(e,0),i=p-e+1,p=Math.min(e,p),e>p?a.reject(new RangeError("some(): array must contain at least "+e+" item(s), but had "+p)):0===p&&a.resolve(s),c=0;h>c;++c)u=n[c],(void 0!==u||c in n)&&t._handler(u).visit(a,r,o,a.notify);return f}function i(n,e){return t._traverse(e,n)}function u(n,e){var r=b.call(n);return t._traverse(e,r).then(function(t){return c(r,t)})}function c(n,e){for(var r=e.length,o=new Array(r),i=0,u=0;r>i;++i)e[i]&&(o[u++]=t._handler(n[i]).value);return o.length=u,o}function f(t){return y(t.map(a))}function a(e){var r;return e instanceof t&&(r=e._handler.join()),r&&0===r.state()||!r?d(e).then(n.fulfilled,n.rejected):(r._unreport(),n.inspect(r))}function s(t,n){return arguments.length>2?v.call(t,h(n),arguments[2]):v.call(t,h(n))}function l(t,n){return arguments.length>2?m.call(t,h(n),arguments[2]):m.call(t,h(n))}function h(t){return function(n,e,r){return p(t,void 0,[n,e,r])}}var p=e(t),d=t.resolve,y=t.all,v=Array.prototype.reduce,m=Array.prototype.reduceRight,b=Array.prototype.slice;return t.any=r,t.some=o,t.settle=f,t.map=i,t.filter=u,t.reduce=s,t.reduceRight=l,t.prototype.spread=function(t){return this.then(y).then(function(n){return t.apply(this,n)})},t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"../apply":11,"../state":25}],13:[function(n,e,r){!function(t){"use strict";t(function(){function t(){throw new TypeError("catch predicate must be a function")}function n(t,n){return e(n)?t instanceof n:n(t)}function e(t){return t===Error||null!=t&&t.prototype instanceof Error}function r(t){return("object"==typeof t||"function"==typeof t)&&null!==t}function o(t){return t}return function(e){function i(t,e){return function(r){return n(r,e)?t.call(this,r):a(r)}}function u(t,n,e,o){var i=t.call(n);return r(i)?c(i,e,o):e(o)}function c(t,n,e){return f(t).then(function(){return n(e)})}var f=e.resolve,a=e.reject,s=e.prototype["catch"];return e.prototype.done=function(t,n){this._handler.visit(this._handler.receiver,t,n)},e.prototype["catch"]=e.prototype.otherwise=function(n){return arguments.length<2?s.call(this,n):"function"!=typeof n?this.ensure(t):s.call(this,i(arguments[1],n))},e.prototype["finally"]=e.prototype.ensure=function(t){return"function"!=typeof t?this:this.then(function(n){return u(t,this,o,n)},function(n){return u(t,this,a,n)})},e.prototype["else"]=e.prototype.orElse=function(t){return this.then(void 0,function(){return t})},e.prototype["yield"]=function(t){return this.then(function(){return t})},e.prototype.tap=function(t){return this.then(t)["yield"](this)},e}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],14:[function(n,e,r){!function(t){"use strict";t(function(){return function(t){return t.prototype.fold=function(n,e){var r=this._beget();return this._handler.fold(function(e,r,o){t._handler(e).fold(function(t,e,r){r.resolve(n.call(this,e,t))},r,this,o)},e,r._handler.receiver,r._handler),r},t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],15:[function(n,e,r){!function(t){"use strict";t(function(t){var n=t("../state").inspect;return function(t){return t.prototype.inspect=function(){return n(t._handler(this))},t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"../state":25}],16:[function(n,e,r){!function(t){"use strict";t(function(){return function(t){function n(t,n,r,o){return e(function(n){return[n,t(n)]},n,r,o)}function e(t,n,o,i){function u(i,u){return r(o(i)).then(function(){return e(t,n,o,u)})}return r(i).then(function(e){return r(n(e)).then(function(n){return n?e:r(t(e)).spread(u)})})}var r=t.resolve;return t.iterate=n,t.unfold=e,t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],17:[function(n,e,r){!function(t){"use strict";t(function(){return function(t){return t.prototype.progress=function(t){return this.then(void 0,void 0,t)},t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],18:[function(n,e,r){!function(t){"use strict";t(function(t){function n(t,n,r,o){return e.setTimer(function(){t(r,o,n)},n)}var e=t("../env"),r=t("../TimeoutError");return function(t){function o(t,e,r){n(i,t,e,r)}function i(t,n){n.resolve(t)}function u(t,n,e){var o="undefined"==typeof t?new r("timed out after "+e+"ms"):t;n.reject(o)}return t.prototype.delay=function(t){var n=this._beget();return this._handler.fold(o,t,void 0,n._handler),n},t.prototype.timeout=function(t,r){var o=this._beget(),i=o._handler,c=n(u,t,r,o._handler);return this._handler.visit(i,function(t){e.clearTimer(c),this.resolve(t)},function(t){e.clearTimer(c),this.reject(t)},i.notify),o},t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"../TimeoutError":10,"../env":21}],19:[function(n,e,r){!function(t){"use strict";t(function(t){function n(t){throw t}function e(){}var r=t("../env").setTimer,o=t("../format");return function(t){function i(t){t.handled||(p.push(t),s("Potentially unhandled rejection ["+t.id+"] "+o.formatError(t.value)))}function u(t){var n=p.indexOf(t);n>=0&&(p.splice(n,1),l("Handled previous rejection ["+t.id+"] "+o.formatObject(t.value)))}function c(t,n){h.push(t,n),null===d&&(d=r(f,0))}function f(){for(d=null;h.length>0;)h.shift()(h.shift())}var a,s=e,l=e;"undefined"!=typeof console&&(a=console,s="undefined"!=typeof a.error?function(t){a.error(t)}:function(t){a.log(t)},l="undefined"!=typeof a.info?function(t){a.info(t)}:function(t){a.log(t)}),t.onPotentiallyUnhandledRejection=function(t){c(i,t)},t.onPotentiallyUnhandledRejectionHandled=function(t){c(u,t)},t.onFatalRejection=function(t){c(n,t.value)};var h=[],p=[],d=null;return t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"../env":21,"../format":22}],20:[function(n,e,r){!function(t){"use strict";t(function(){return function(t){return t.prototype["with"]=t.prototype.withThis=function(t){var n=this._beget(),e=n._handler;return e.receiver=t,this._handler.chain(e,t),n},t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],21:[function(n,e,r){!function(t){"use strict";t(function(t){function n(){return"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process)}function e(){return"undefined"!=typeof MutationObserver&&MutationObserver||"undefined"!=typeof WebKitMutationObserver&&WebKitMutationObserver}function r(t){function n(){var t=e;e=void 0,t()}var e,r=document.createTextNode(""),o=new t(n);o.observe(r,{characterData:!0});var i=0;return function(t){e=t,r.data=i^=1}}var o,i="undefined"!=typeof setTimeout&&setTimeout,u=function(t,n){return setTimeout(t,n)},c=function(t){return clearTimeout(t)},f=function(t){return i(t,0)};if(n())f=function(t){return process.nextTick(t)};else if(o=e())f=r(o);else if(!i){var a=t,s=a("vertx");u=function(t,n){return s.setTimer(n,t)},c=s.cancelTimer,f=s.runOnLoop||s.runOnContext}return{setTimer:u,clearTimer:c,asap:f}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{}],22:[function(n,e,r){!function(t){"use strict";t(function(){function t(t){var e="object"==typeof t&&null!==t&&(t.stack||t.message)?t.stack||t.message:n(t);return t instanceof Error?e:e+" (WARNING: non-Error used)"}function n(t){var n=String(t);return"[object Object]"===n&&"undefined"!=typeof JSON&&(n=e(t,n)),n}function e(t,n){try{return JSON.stringify(t)}catch(e){return n}}return{formatError:t,formatObject:n,tryStringify:e}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],23:[function(n,e,r){!function(t){"use strict";t(function(){function t(t,n,e){return t[e]=n,t}function n(t){return"function"==typeof t?t.bind():Object.create(t)}return function(e,r,o,i){return"undefined"==typeof r&&(r=t),Object.keys(i).reduce(function(t,n){var o=i[n];return"function"==typeof o?r(t,e(o),n):t},"undefined"==typeof o?n(i):o)}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],24:[function(n,e,r){!function(t){"use strict";t(function(){return function(t){function n(t,n){this._handler=t===g?n:e(t)}function e(t){function n(t){o.resolve(t)}function e(t){o.reject(t)}function r(t){o.notify(t)}var o=new w;try{t(n,e,r)}catch(i){e(i)}return o}function r(t){return L(t)?t:new n(g,new j(v(t)))}function o(t){return new n(g,new j(new k(t)))}function i(){return nt}function u(){return new n(g,new w)}function c(t,n){var e=new w(t.receiver,t.join().context);return new n(g,e)}function f(t){return s(K,null,t)}function a(t,n){return s(N,t,n)}function s(t,e,r){function o(n,o,u){u.resolved||l(r,i,n,t(e,o,n),u)}function i(t,n,e){s[t]=n,0===--a&&e.become(new E(s))}for(var u,c="function"==typeof e?o:i,f=new w,a=r.length>>>0,s=new Array(a),h=0;h0?n(e,i.value,o):(o.become(i),h(t,e+1,i))}else n(e,r,o)}function h(t,n,e){for(var r=n;re&&t._unreport()}}function d(t){return"object"!=typeof t||null===t?o(new TypeError("non-iterable passed to race()")):0===t.length?i():1===t.length?r(t[0]):y(t)}function y(t){var e,r,o,i=new w;for(e=0;e0||"function"!=typeof n&&0>o)return new this.constructor(g,r);var i=this._beget(),u=i._handler;return r.chain(u,r.receiver,t,n,e),i},n.prototype["catch"]=function(t){return this.then(void 0,t)},n.prototype._beget=function(){return c(this._handler,this.constructor)},n.all=f,n.race=d,n._traverse=a,n._visitRemaining=h,g.prototype.when=g.prototype.become=g.prototype.notify=g.prototype.fail=g.prototype._unreport=g.prototype._report=D,g.prototype._state=0,g.prototype.state=function(){return this._state},g.prototype.join=function(){for(var t=this;void 0!==t.handler;)t=t.handler;return t},g.prototype.chain=function(t,n,e,r,o){this.when({resolver:t,receiver:n,fulfilled:e,rejected:r,progress:o})},g.prototype.visit=function(t,n,e,r){this.chain(Z,t,n,e,r)},g.prototype.fold=function(t,n,e,r){this.when(new Q(t,n,e,r))},J(g,_),_.prototype.become=function(t){t.fail()};var Z=new _;J(g,w),w.prototype._state=0,w.prototype.resolve=function(t){this.become(v(t))},w.prototype.reject=function(t){this.resolved||this.become(new k(t))},w.prototype.join=function(){if(!this.resolved)return this;for(var t=this;void 0!==t.handler;)if(t=t.handler,t===this)return this.handler=C();return t},w.prototype.run=function(){var t=this.consumers,n=this.handler;this.handler=this.handler.join(),this.consumers=void 0;for(var e=0;e0?e(r.value):n(r.value)}return{pending:t,fulfilled:e,rejected:n,inspect:r}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],26:[function(n,e,r){!function(t){t(function(t){function n(t,n){return p(t,this,n||[])}function e(t,n,e,r){var o=u(r);try{switch(e.length){case 2:t.call(n,e[0],e[1],o);break;case 1:t.call(n,e[0],o);break;case 0:t.call(n,o);break;default:e.push(o),t.apply(n,e)}}catch(i){r.reject(i)}}function r(t){return p(t,this,h.call(arguments,1))}function o(t){var n=arguments.length>1?h.call(arguments,1):[];return function(){var e,r=n.length,o=arguments.length,i=new Array(o+r);for(e=0;r>e;++e)i[e]=n[e];for(e=0;o>e;++e)i[e+r]=arguments[e];return p(t,this,i)}}function i(t,n,e){return s(o,n,e,t)}function u(t){return function(n,e){n?t.reject(n):arguments.length>2?t.resolve(h.call(arguments,1)):t.resolve(e)}}function c(t,n){function e(t){r(null,t)}function r(t,e){l(function(){n(t,e)},0)}return t=a(t),n&&t.then(e,r),t}function f(t){return function(n){return c(n,t)}}var a=t("./when"),s=t("./lib/liftAll"),l=t("./lib/env").setTimer,h=Array.prototype.slice,p=t("./lib/apply")(a.Promise,e);return{lift:o,liftAll:i,apply:n,call:r,createCallback:u,bindCallback:c,liftCallback:f}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./lib/apply":11,"./lib/env":21,"./lib/liftAll":23,"./when":32}],27:[function(n,e,r){!function(t){t(function(t){var n=t("./when"),e=n.Promise.all,r=Array.prototype.slice;return function(t){return e(r.call(arguments,1)).then(function(e){return n.map(t,function(t){return t.apply(void 0,e)})})}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./when":32}],28:[function(n,e,r){!function(t){t(function(t){var n=t("./when"),e=n.Promise.all,r=Array.prototype.slice;return function(t){var o=function(t,n){return o=function(t,n){return n(t)},n.apply(null,t)};return e(r.call(arguments,1)).then(function(e){return n.reduce(t,function(t,n){return o(t,n)},e)})}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./when":32}],29:[function(n,e,r){!function(t){"use strict";t(function(t){var n=t("./when"),e=n["try"],r=t("./cancelable");return function(t,o,i,u){function c(t){s.resolve(t)}function f(t){e(o).then(a,h),void 0!==t&&s.notify(t)}function a(){l||n(t(),function(t){n(i(t),function(n){return n?c(t):f(t)},function(){f(t)})},h)}var s,l,h;return l=!1,s=r(n.defer(),function(){l=!0}),h=s.reject,i=i||function(){return!1},"function"!=typeof o&&(o=function(t){return function(){return n().delay(t)}}(o)),u?f():a(),s.promise=Object.create(s.promise),s.promise.cancel=s.cancel,s.promise}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./cancelable":3,"./when":32}],30:[function(n,e,r){!function(t){t(function(t){var n=t("./when"),e=n.Promise.all,r=Array.prototype.slice;return function(t){function o(t){return i.push(t),i}var i=[];return e(r.call(arguments,1)).then(function(e){return n.reduce(t,function(t,r){return n(r.apply(void 0,e),o)},i)})}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./when":32}],31:[function(n,e,r){!function(t){t(function(t){var n=t("./when");return function(t,e){return n(e).timeout(t)}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./when":32}],32:[function(n,e,r){!function(t){"use strict";t(function(t){function n(t,n,e,r){var o=x.resolve(t);return arguments.length<2?o:o.then(n,e,r)}function e(t){return new x(t)}function r(t){return function(){for(var n=0,e=arguments.length,r=new Array(e);e>n;++n)r[n]=arguments[n];return E(t,this,r)}}function o(t){for(var n=0,e=arguments.length-1,r=new Array(e);e>n;++n)r[n]=arguments[n+1];return E(t,this,r)}function i(){return new u}function u(){function t(t){r._handler.resolve(t)}function n(t){r._handler.reject(t)}function e(t){r._handler.notify(t)}var r=x._defer();this.promise=r,this.resolve=t,this.reject=n,this.notify=e,this.resolver={resolve:t,reject:n,notify:e}}function c(t){return t&&"function"==typeof t.then}function f(){return x.all(arguments)}function a(t){return n(t,x.all)}function s(t){return n(t,x.settle)}function l(t,e){return n(t,function(t){return x.map(t,e)})}function h(t,e){return n(t,function(t){return x.filter(t,e)})}var p=t("./lib/decorators/timed"),d=t("./lib/decorators/array"),y=t("./lib/decorators/flow"),v=t("./lib/decorators/fold"),m=t("./lib/decorators/inspect"),b=t("./lib/decorators/iterate"),g=t("./lib/decorators/progress"),_=t("./lib/decorators/with"),w=t("./lib/decorators/unhandledRejection"),j=t("./lib/TimeoutError"),x=[d,y,v,b,g,m,_,p,w].reduce(function(t,n){return n(t)},t("./lib/Promise")),E=t("./lib/apply")(x);return n.promise=e,n.resolve=x.resolve,n.reject=x.reject,n.lift=r,n["try"]=o,n.attempt=o,n.iterate=x.iterate,n.unfold=x.unfold,n.join=f,n.all=a,n.settle=s,n.any=r(x.any),n.some=r(x.some),n.race=r(x.race),n.map=l,n.filter=h,n.reduce=r(x.reduce),n.reduceRight=r(x.reduceRight),n.isPromiseLike=c,n.Promise=x,n.defer=i,n.TimeoutError=j,n})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./lib/Promise":8,"./lib/TimeoutError":10,"./lib/apply":11,"./lib/decorators/array":12,"./lib/decorators/flow":13,"./lib/decorators/fold":14,"./lib/decorators/inspect":15,"./lib/decorators/iterate":16,"./lib/decorators/progress":17,"./lib/decorators/timed":18,"./lib/decorators/unhandledRejection":19,"./lib/decorators/with":20}]},{},[1])(1)}); +//# sourceMappingURL=dist/browser/when.min.js.map \ No newline at end of file diff --git a/node_modules/when/dist/browser/when.min.js.map b/node_modules/when/dist/browser/when.min.js.map index 3d25b9dcf..178a1a2ed 100644 --- a/node_modules/when/dist/browser/when.min.js.map +++ b/node_modules/when/dist/browser/when.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["build/when.browserify.js","callbacks.js","cancelable.js","delay.js","function.js","guard.js","keys.js","lib/Promise.js","lib/Scheduler.js","lib/TimeoutError.js","lib/apply.js","lib/decorators/array.js","lib/decorators/flow.js","lib/decorators/fold.js","lib/decorators/inspect.js","lib/decorators/iterate.js","lib/decorators/progress.js","lib/decorators/timed.js","lib/decorators/unhandledRejection.js","lib/decorators/with.js","lib/env.js","lib/format.js","lib/liftAll.js","lib/makePromise.js","lib/state.js","node.js","parallel.js","pipeline.js","poll.js","sequence.js","timeout.js","when.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/build/when.browserify.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/callbacks.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/cancelable.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/delay.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/function.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/guard.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/keys.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/lib/Promise.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/lib/Scheduler.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/lib/TimeoutError.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/lib/apply.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/lib/decorators/array.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/lib/decorators/flow.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/lib/decorators/fold.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/lib/decorators/inspect.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/lib/decorators/iterate.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/lib/decorators/progress.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/lib/decorators/timed.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/lib/decorators/unhandledRejection.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/lib/decorators/with.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/lib/env.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/lib/format.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/lib/liftAll.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/lib/makePromise.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/lib/state.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/node.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/parallel.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/pipeline.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/poll.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/sequence.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/timeout.js","https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83/when.js"],"names":["when","module","exports","require","callbacks","cancelable","delay","fn","guard","keys","nodefn","node","parallel","pipeline","poll","sequence","timeout","define","apply","asyncFunction","extraAsyncArgs","_apply","this","dispatch","f","thisArg","args","h","push","alwaysUnary","resolve","reject","tryCatchResolve","resolver","e","call","slice","arguments","lift","length","concat","liftAll","src","combine","dst","_liftAll","promisify","positions","Promise","all","then","callbackPos","errbackPos","p","_defer","callback","normalizePosition","errback","insertCallback","_handler","pos","splice","Array","prototype","makeApply","amd","factory","deferred","canceler","cancel","promise","msec","value","compose","funcs","firstPromise","attempt","reduce","arg","func","condition","withThis","exit","n","allowed","count","Math","max","waiting","shift","object","settleKey","k","x","pending","results","Object","i","fold","map","mapWithKey","toPromise","o","settle","promises","states","populateResults","makePromise","Scheduler","async","asap","scheduler","_async","_running","_queue","_queueLen","_afterQueue","_afterQueueLen","self","drain","_drain","enqueue","task","run","afterQueue","TimeoutError","message","Error","name","captureStackTrace","create","constructor","l","params","callAndResolve","c","handler","callAndResolveNext","state","applier","any","handleFulfill","errors","handleReject","resolved","become","_visitRemaining","visit","RangeError","some","fulfill","nFulfill","nReject","min","notify","_traverse","filter","predicate","a","keep","filterSync","filtered","j","settleOne","fulfilled","rejected","_unreport","inspect","ar","liftCombine","reduceRight","arr","z","applyFold","spread","onFulfilled","array","rejectInvalidPredicate","TypeError","evaluatePredicate","isError","maybeThenable","identity","createCatchFilter","runSideEffect","propagate","result","propagateValue","origCatch","done","onResult","onError","receiver","otherwise","onRejected","ensure","orElse","defaultValue","tap","onFulfilledSideEffect","_beget","to","iterate","unfold","unspool","next","item","newSeed","seed","progress","onProgress","setTimeout","ms","y","env","setTimer","handleDelay","resolveDelay","onTimeout","reason","t","clearTimer","throwit","noop","format","report","r","handled","reported","logError","id","formatError","unreport","indexOf","logInfo","formatObject","tasks","running","flush","localConsole","console","error","log","info","onPotentiallyUnhandledRejection","rejection","onPotentiallyUnhandledRejectionHandled","onFatalRejection","child","chain","isNode","process","toString","hasMutationObserver","MutationObserver","WebKitMutationObserver","initMutationObserver","scheduled","document","createTextNode","observe","characterData","data","MutationObs","capturedSetTimeout","clearTimeout","nextTick","vertxRequire","vertx","cancelTimer","runOnLoop","runOnContext","s","stack","String","JSON","tryStringify","stringify","defaultCombine","defaultDst","bind","liftOne","key","environment","Handler","init","promiseResolve","promiseReject","promiseNotify","Pending","isPromise","Async","getHandler","Rejected","never","foreverPendingPromise","defer","begetFrom","parent","join","context","traverseWith","snd","traverse","tryCatch2","tryMap","mapAt","traverseAt","settleAt","Fulfilled","getHandlerMaybeThenable","visitRemaining","start","markAsHandled","race","runRace","getHandlerUntrusted","untrustedThen","Thenable","FailIfRejected","inheritedContext","createContext","consumers","thenable","AssimilateTask","errorId","_report","ReportTask","UnreportTask","cycle","ContinuationTask","continuation","ProgressTask","_then","tryAssimilate","Fold","failIfRejected","runContinuation1","enterContext","tryCatchReject","exitContext","runContinuation3","tryCatchReject3","runNotify","tryCatchReturn","b","inherit","Parent","Child","objectCreate","initEmitRejection","emit","type","CustomEvent","hasCustomEvent","ev","detail","bubbles","dispatchEvent","emitRejection","proto","fail","_state","q","cont","foreverPendingHandler","_resolve","_reject","_notify","toPendingState","toRejectedState","toFulfilledState","cb","createCallback","args1","al","err","bindCallback","success","wrapped","liftCallback","runTask","interval","verifier","delayInitialTask","certify","schedule","vote","canceled","verification","addResult","trigger","Deferred","isPromiseLike","mapFunc","timed","flow","generate","unhandledRejection","feature"],"mappings":"yqBgCAA,GAAAA,GAAAC,EAAAC,QAAAC,EAAA,UAEAH,GAAAI,UAAAD,EAAA,gBACAH,EAAAK,WAAAF,EAAA,iBACAH,EAAAM,MAAAH,EAAA,YACAH,EAAAO,GAAAJ,EAAA,eACAH,EAAAQ,MAAAL,EAAA,YACAH,EAAAS,KAAAN,EAAA,WACAH,EAAAU,OA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AAAjE,EAAAC,QAAAgE,EAAA/D;A/DnOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"generated.js","sourceRoot":"https://raw.githubusercontent.com/cujojs/when/1516d791439f28cbb8f1854d16fef15e904a8a83","sourcesContent":["var when = module.exports = require('../when');\n\nwhen.callbacks = require('../callbacks');\nwhen.cancelable = require('../cancelable');\nwhen.delay = require('../delay');\nwhen.fn = require('../function');\nwhen.guard = require('../guard');\nwhen.keys = require('../keys');\nwhen.nodefn = when.node = require('../node');\nwhen.parallel = require('../parallel');\nwhen.pipeline = require('../pipeline');\nwhen.poll = require('../poll');\nwhen.sequence = require('../sequence');\nwhen.timeout = require('../timeout');\n","/** @license MIT License (c) copyright 2013-2014 original author or authors */\n\n/**\n * Collection of helper functions for interacting with 'traditional',\n * callback-taking functions using a promise interface.\n *\n * @author Renato Zannon\n * @contributor Brian Cavalier\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar Promise = when.Promise;\n\tvar _liftAll = require('./lib/liftAll');\n\tvar slice = Array.prototype.slice;\n\n\tvar makeApply = require('./lib/apply');\n\tvar _apply = makeApply(Promise, dispatch);\n\n\treturn {\n\t\tlift: lift,\n\t\tliftAll: liftAll,\n\t\tapply: apply,\n\t\tcall: call,\n\t\tpromisify: promisify\n\t};\n\n\t/**\n\t * Takes a `traditional` callback-taking function and returns a promise for its\n\t * result, accepting an optional array of arguments (that might be values or\n\t * promises). It assumes that the function takes its callback and errback as\n\t * the last two arguments. The resolution of the promise depends on whether the\n\t * function will call its callback or its errback.\n\t *\n\t * @example\n\t * var domIsLoaded = callbacks.apply($);\n\t * domIsLoaded.then(function() {\n\t *\t\tdoMyDomStuff();\n\t *\t});\n\t *\n\t * @example\n\t * function existingAjaxyFunction(url, callback, errback) {\n\t *\t\t// Complex logic you'd rather not change\n\t *\t}\n\t *\n\t * var promise = callbacks.apply(existingAjaxyFunction, [\"/movies.json\"]);\n\t *\n\t * promise.then(function(movies) {\n\t *\t\t// Work with movies\n\t *\t}, function(reason) {\n\t *\t\t// Handle error\n\t *\t});\n\t *\n\t * @param {function} asyncFunction function to be called\n\t * @param {Array} [extraAsyncArgs] array of arguments to asyncFunction\n\t * @returns {Promise} promise for the callback value of asyncFunction\n\t */\n\tfunction apply(asyncFunction, extraAsyncArgs) {\n\t\treturn _apply(asyncFunction, this, extraAsyncArgs || []);\n\t}\n\n\t/**\n\t * Apply helper that allows specifying thisArg\n\t * @private\n\t */\n\tfunction dispatch(f, thisArg, args, h) {\n\t\targs.push(alwaysUnary(h.resolve, h), alwaysUnary(h.reject, h));\n\t\ttryCatchResolve(f, thisArg, args, h);\n\t}\n\n\tfunction tryCatchResolve(f, thisArg, args, resolver) {\n\t\ttry {\n\t\t\tf.apply(thisArg, args);\n\t\t} catch(e) {\n\t\t\tresolver.reject(e);\n\t\t}\n\t}\n\n\t/**\n\t * Works as `callbacks.apply` does, with the difference that the arguments to\n\t * the function are passed individually, instead of as an array.\n\t *\n\t * @example\n\t * function sumInFiveSeconds(a, b, callback) {\n\t *\t\tsetTimeout(function() {\n\t *\t\t\tcallback(a + b);\n\t *\t\t}, 5000);\n\t *\t}\n\t *\n\t * var sumPromise = callbacks.call(sumInFiveSeconds, 5, 10);\n\t *\n\t * // Logs '15' 5 seconds later\n\t * sumPromise.then(console.log);\n\t *\n\t * @param {function} asyncFunction function to be called\n\t * @param {...*} args arguments that will be forwarded to the function\n\t * @returns {Promise} promise for the callback value of asyncFunction\n\t */\n\tfunction call(asyncFunction/*, arg1, arg2...*/) {\n\t\treturn _apply(asyncFunction, this, slice.call(arguments, 1));\n\t}\n\n\t/**\n\t * Takes a 'traditional' callback/errback-taking function and returns a function\n\t * that returns a promise instead. The resolution/rejection of the promise\n\t * depends on whether the original function will call its callback or its\n\t * errback.\n\t *\n\t * If additional arguments are passed to the `lift` call, they will be prepended\n\t * on the calls to the original function, much like `Function.prototype.bind`.\n\t *\n\t * The resulting function is also \"promise-aware\", in the sense that, if given\n\t * promises as arguments, it will wait for their resolution before executing.\n\t *\n\t * @example\n\t * function traditionalAjax(method, url, callback, errback) {\n\t *\t\tvar xhr = new XMLHttpRequest();\n\t *\t\txhr.open(method, url);\n\t *\n\t *\t\txhr.onload = callback;\n\t *\t\txhr.onerror = errback;\n\t *\n\t *\t\txhr.send();\n\t *\t}\n\t *\n\t * var promiseAjax = callbacks.lift(traditionalAjax);\n\t * promiseAjax(\"GET\", \"/movies.json\").then(console.log, console.error);\n\t *\n\t * var promiseAjaxGet = callbacks.lift(traditionalAjax, \"GET\");\n\t * promiseAjaxGet(\"/movies.json\").then(console.log, console.error);\n\t *\n\t * @param {Function} f traditional async function to be decorated\n\t * @param {...*} [args] arguments to be prepended for the new function @deprecated\n\t * @returns {Function} a promise-returning function\n\t */\n\tfunction lift(f/*, args...*/) {\n\t\tvar args = arguments.length > 1 ? slice.call(arguments, 1) : [];\n\t\treturn function() {\n\t\t\treturn _apply(f, this, args.concat(slice.call(arguments)));\n\t\t};\n\t}\n\n\t/**\n\t * Lift all the functions/methods on src\n\t * @param {object|function} src source whose functions will be lifted\n\t * @param {function?} combine optional function for customizing the lifting\n\t * process. It is passed dst, the lifted function, and the property name of\n\t * the original function on src.\n\t * @param {(object|function)?} dst option destination host onto which to place lifted\n\t * functions. If not provided, liftAll returns a new object.\n\t * @returns {*} If dst is provided, returns dst with lifted functions as\n\t * properties. If dst not provided, returns a new object with lifted functions.\n\t */\n\tfunction liftAll(src, combine, dst) {\n\t\treturn _liftAll(lift, combine, dst, src);\n\t}\n\n\t/**\n\t * `promisify` is a version of `lift` that allows fine-grained control over the\n\t * arguments that passed to the underlying function. It is intended to handle\n\t * functions that don't follow the common callback and errback positions.\n\t *\n\t * The control is done by passing an object whose 'callback' and/or 'errback'\n\t * keys, whose values are the corresponding 0-based indexes of the arguments on\n\t * the function. Negative values are interpreted as being relative to the end\n\t * of the arguments array.\n\t *\n\t * If arguments are given on the call to the 'promisified' function, they are\n\t * intermingled with the callback and errback. If a promise is given among them,\n\t * the execution of the function will only occur after its resolution.\n\t *\n\t * @example\n\t * var delay = callbacks.promisify(setTimeout, {\n\t *\t\tcallback: 0\n\t *\t});\n\t *\n\t * delay(100).then(function() {\n\t *\t\tconsole.log(\"This happens 100ms afterwards\");\n\t *\t});\n\t *\n\t * @example\n\t * function callbackAsLast(errback, followsStandards, callback) {\n\t *\t\tif(followsStandards) {\n\t *\t\t\tcallback(\"well done!\");\n\t *\t\t} else {\n\t *\t\t\terrback(\"some programmers just want to watch the world burn\");\n\t *\t\t}\n\t *\t}\n\t *\n\t * var promisified = callbacks.promisify(callbackAsLast, {\n\t *\t\tcallback: -1,\n\t *\t\terrback: 0,\n\t *\t});\n\t *\n\t * promisified(true).then(console.log, console.error);\n\t * promisified(false).then(console.log, console.error);\n\t *\n\t * @param {Function} asyncFunction traditional function to be decorated\n\t * @param {object} positions\n\t * @param {number} [positions.callback] index at which asyncFunction expects to\n\t * receive a success callback\n\t * @param {number} [positions.errback] index at which asyncFunction expects to\n\t * receive an error callback\n\t * @returns {function} promisified function that accepts\n\t *\n\t * @deprecated\n\t */\n\tfunction promisify(asyncFunction, positions) {\n\n\t\treturn function() {\n\t\t\tvar thisArg = this;\n\t\t\treturn Promise.all(arguments).then(function(args) {\n\t\t\t\tvar p = Promise._defer();\n\n\t\t\t\tvar callbackPos, errbackPos;\n\n\t\t\t\tif(typeof positions.callback === 'number') {\n\t\t\t\t\tcallbackPos = normalizePosition(args, positions.callback);\n\t\t\t\t}\n\n\t\t\t\tif(typeof positions.errback === 'number') {\n\t\t\t\t\terrbackPos = normalizePosition(args, positions.errback);\n\t\t\t\t}\n\n\t\t\t\tif(errbackPos < callbackPos) {\n\t\t\t\t\tinsertCallback(args, errbackPos, p._handler.reject, p._handler);\n\t\t\t\t\tinsertCallback(args, callbackPos, p._handler.resolve, p._handler);\n\t\t\t\t} else {\n\t\t\t\t\tinsertCallback(args, callbackPos, p._handler.resolve, p._handler);\n\t\t\t\t\tinsertCallback(args, errbackPos, p._handler.reject, p._handler);\n\t\t\t\t}\n\n\t\t\t\tasyncFunction.apply(thisArg, args);\n\n\t\t\t\treturn p;\n\t\t\t});\n\t\t};\n\t}\n\n\tfunction normalizePosition(args, pos) {\n\t\treturn pos < 0 ? (args.length + pos + 2) : pos;\n\t}\n\n\tfunction insertCallback(args, pos, callback, thisArg) {\n\t\tif(typeof pos === 'number') {\n\t\t\targs.splice(pos, 0, alwaysUnary(callback, thisArg));\n\t\t}\n\t}\n\n\tfunction alwaysUnary(fn, thisArg) {\n\t\treturn function() {\n\t\t\tif (arguments.length > 1) {\n\t\t\t\tfn.call(thisArg, slice.call(arguments));\n\t\t\t} else {\n\t\t\t\tfn.apply(thisArg, arguments);\n\t\t\t}\n\t\t};\n\t}\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n","/** @license MIT License (c) copyright B Cavalier & J Hann */\n\n/**\n * cancelable.js\n * @deprecated\n *\n * Decorator that makes a deferred \"cancelable\". It adds a cancel() method that\n * will call a special cancel handler function and then reject the deferred. The\n * cancel handler can be used to do resource cleanup, or anything else that should\n * be done before any other rejection handlers are executed.\n *\n * Usage:\n *\n * var cancelableDeferred = cancelable(when.defer(), myCancelHandler);\n *\n * @author brian@hovercraftstudios.com\n */\n\n(function(define) {\ndefine(function() {\n\n /**\n * Makes deferred cancelable, adding a cancel() method.\n\t * @deprecated\n *\n * @param deferred {Deferred} the {@link Deferred} to make cancelable\n * @param canceler {Function} cancel handler function to execute when this deferred\n\t * is canceled. This is guaranteed to run before all other rejection handlers.\n\t * The canceler will NOT be executed if the deferred is rejected in the standard\n\t * way, i.e. deferred.reject(). It ONLY executes if the deferred is canceled,\n\t * i.e. deferred.cancel()\n *\n * @returns deferred, with an added cancel() method.\n */\n return function(deferred, canceler) {\n // Add a cancel method to the deferred to reject the delegate\n // with the special canceled indicator.\n deferred.cancel = function() {\n\t\t\ttry {\n\t\t\t\tdeferred.reject(canceler(deferred));\n\t\t\t} catch(e) {\n\t\t\t\tdeferred.reject(e);\n\t\t\t}\n\n\t\t\treturn deferred.promise;\n };\n\n return deferred;\n };\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(); });\n\n\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * delay.js\n *\n * Helper that returns a promise that resolves after a delay.\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\n /**\n\t * @deprecated Use when(value).delay(ms)\n */\n return function delay(msec, value) {\n\t\treturn when(value).delay(msec);\n };\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2013-2014 original author or authors */\n\n/**\n * Collection of helper functions for wrapping and executing 'traditional'\n * synchronous functions in a promise interface.\n *\n * @author Brian Cavalier\n * @contributor Renato Zannon\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar attempt = when['try'];\n\tvar _liftAll = require('./lib/liftAll');\n\tvar _apply = require('./lib/apply')(when.Promise);\n\tvar slice = Array.prototype.slice;\n\n\treturn {\n\t\tlift: lift,\n\t\tliftAll: liftAll,\n\t\tcall: attempt,\n\t\tapply: apply,\n\t\tcompose: compose\n\t};\n\n\t/**\n\t * Takes a function and an optional array of arguments (that might be promises),\n\t * and calls the function. The return value is a promise whose resolution\n\t * depends on the value returned by the function.\n\t * @param {function} f function to be called\n\t * @param {Array} [args] array of arguments to func\n\t * @returns {Promise} promise for the return value of func\n\t */\n\tfunction apply(f, args) {\n\t\t// slice args just in case the caller passed an Arguments instance\n\t\treturn _apply(f, this, args == null ? [] : slice.call(args));\n\t}\n\n\t/**\n\t * Takes a 'regular' function and returns a version of that function that\n\t * returns a promise instead of a plain value, and handles thrown errors by\n\t * returning a rejected promise. Also accepts a list of arguments to be\n\t * prepended to the new function, as does Function.prototype.bind.\n\t *\n\t * The resulting function is promise-aware, in the sense that it accepts\n\t * promise arguments, and waits for their resolution.\n\t * @param {Function} f function to be bound\n\t * @param {...*} [args] arguments to be prepended for the new function @deprecated\n\t * @returns {Function} a promise-returning function\n\t */\n\tfunction lift(f /*, args... */) {\n\t\tvar args = arguments.length > 1 ? slice.call(arguments, 1) : [];\n\t\treturn function() {\n\t\t\treturn _apply(f, this, args.concat(slice.call(arguments)));\n\t\t};\n\t}\n\n\t/**\n\t * Lift all the functions/methods on src\n\t * @param {object|function} src source whose functions will be lifted\n\t * @param {function?} combine optional function for customizing the lifting\n\t * process. It is passed dst, the lifted function, and the property name of\n\t * the original function on src.\n\t * @param {(object|function)?} dst option destination host onto which to place lifted\n\t * functions. If not provided, liftAll returns a new object.\n\t * @returns {*} If dst is provided, returns dst with lifted functions as\n\t * properties. If dst not provided, returns a new object with lifted functions.\n\t */\n\tfunction liftAll(src, combine, dst) {\n\t\treturn _liftAll(lift, combine, dst, src);\n\t}\n\n\t/**\n\t * Composes multiple functions by piping their return values. It is\n\t * transparent to whether the functions return 'regular' values or promises:\n\t * the piped argument is always a resolved value. If one of the functions\n\t * throws or returns a rejected promise, the composed promise will be also\n\t * rejected.\n\t *\n\t * The arguments (or promises to arguments) given to the returned function (if\n\t * any), are passed directly to the first function on the 'pipeline'.\n\t * @param {Function} f the function to which the arguments will be passed\n\t * @param {...Function} [funcs] functions that will be composed, in order\n\t * @returns {Function} a promise-returning composition of the functions\n\t */\n\tfunction compose(f /*, funcs... */) {\n\t\tvar funcs = slice.call(arguments, 1);\n\n\t\treturn function() {\n\t\t\tvar thisArg = this;\n\t\t\tvar args = slice.call(arguments);\n\t\t\tvar firstPromise = attempt.apply(thisArg, [f].concat(args));\n\n\t\t\treturn when.reduce(funcs, function(arg, func) {\n\t\t\t\treturn func.call(thisArg, arg);\n\t\t\t}, firstPromise);\n\t\t};\n\t}\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * Generalized promise concurrency guard\n * Adapted from original concept by Sakari Jokinen (Rocket Pack, Ltd.)\n *\n * @author Brian Cavalier\n * @author John Hann\n * @contributor Sakari Jokinen\n */\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar slice = Array.prototype.slice;\n\n\tguard.n = n;\n\n\treturn guard;\n\n\t/**\n\t * Creates a guarded version of f that can only be entered when the supplied\n\t * condition allows.\n\t * @param {function} condition represents a critical section that may only\n\t * be entered when allowed by the condition\n\t * @param {function} f function to guard\n\t * @returns {function} guarded version of f\n\t */\n\tfunction guard(condition, f) {\n\t\treturn function() {\n\t\t\tvar args = slice.call(arguments);\n\n\t\t\treturn when(condition()).withThis(this).then(function(exit) {\n\t\t\t\treturn when(f.apply(this, args))['finally'](exit);\n\t\t\t});\n\t\t};\n\t}\n\n\t/**\n\t * Creates a condition that allows only n simultaneous executions\n\t * of a guarded function\n\t * @param {number} allowed number of allowed simultaneous executions\n\t * @returns {function} condition function which returns a promise that\n\t * fulfills when the critical section may be entered. The fulfillment\n\t * value is a function (\"notifyExit\") that must be called when the critical\n\t * section has been exited.\n\t */\n\tfunction n(allowed) {\n\t\tvar count = 0;\n\t\tvar waiting = [];\n\n\t\treturn function enter() {\n\t\t\treturn when.promise(function(resolve) {\n\t\t\t\tif(count < allowed) {\n\t\t\t\t\tresolve(exit);\n\t\t\t\t} else {\n\t\t\t\t\twaiting.push(resolve);\n\t\t\t\t}\n\t\t\t\tcount += 1;\n\t\t\t});\n\t\t};\n\n\t\tfunction exit() {\n\t\t\tcount = Math.max(count - 1, 0);\n\t\t\tif(waiting.length > 0) {\n\t\t\t\twaiting.shift()(exit);\n\t\t\t}\n\t\t}\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * Licensed under the MIT License at:\n * http://www.opensource.org/licenses/mit-license.php\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar Promise = when.Promise;\n\tvar toPromise = when.resolve;\n\n\treturn {\n\t\tall: when.lift(all),\n\t\tmap: map,\n\t\tsettle: settle\n\t};\n\n\t/**\n\t * Resolve all the key-value pairs in the supplied object or promise\n\t * for an object.\n\t * @param {Promise|object} object or promise for object whose key-value pairs\n\t * will be resolved\n\t * @returns {Promise} promise for an object with the fully resolved key-value pairs\n\t */\n\tfunction all(object) {\n\t\tvar p = Promise._defer();\n\t\tvar resolver = Promise._handler(p);\n\n\t\tvar results = {};\n\t\tvar keys = Object.keys(object);\n\t\tvar pending = keys.length;\n\n\t\tfor(var i=0, k; i>>0;\n\n\t\t\tvar pending = l;\n\t\t\tvar errors = [];\n\n\t\t\tfor (var h, x, i = 0; i < l; ++i) {\n\t\t\t\tx = promises[i];\n\t\t\t\tif(x === void 0 && !(i in promises)) {\n\t\t\t\t\t--pending;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\th = Promise._handler(x);\n\t\t\t\tif(h.state() > 0) {\n\t\t\t\t\tresolver.become(h);\n\t\t\t\t\tPromise._visitRemaining(promises, i, h);\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\th.visit(resolver, handleFulfill, handleReject);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(pending === 0) {\n\t\t\t\tresolver.reject(new RangeError('any(): array must not be empty'));\n\t\t\t}\n\n\t\t\treturn p;\n\n\t\t\tfunction handleFulfill(x) {\n\t\t\t\t/*jshint validthis:true*/\n\t\t\t\terrors = null;\n\t\t\t\tthis.resolve(x); // this === resolver\n\t\t\t}\n\n\t\t\tfunction handleReject(e) {\n\t\t\t\t/*jshint validthis:true*/\n\t\t\t\tif(this.resolved) { // this === resolver\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\terrors.push(e);\n\t\t\t\tif(--pending === 0) {\n\t\t\t\t\tthis.reject(errors);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * N-winner competitive race\n\t\t * Return a promise that will fulfill when n input promises have\n\t\t * fulfilled, or will reject when it becomes impossible for n\n\t\t * input promises to fulfill (ie when promises.length - n + 1\n\t\t * have rejected)\n\t\t * @param {array} promises\n\t\t * @param {number} n\n\t\t * @returns {Promise} promise for the earliest n fulfillment values\n\t\t *\n\t\t * @deprecated\n\t\t */\n\t\tfunction some(promises, n) {\n\t\t\t/*jshint maxcomplexity:7*/\n\t\t\tvar p = Promise._defer();\n\t\t\tvar resolver = p._handler;\n\n\t\t\tvar results = [];\n\t\t\tvar errors = [];\n\n\t\t\tvar l = promises.length>>>0;\n\t\t\tvar nFulfill = 0;\n\t\t\tvar nReject;\n\t\t\tvar x, i; // reused in both for() loops\n\n\t\t\t// First pass: count actual array items\n\t\t\tfor(i=0; i nFulfill) {\n\t\t\t\tresolver.reject(new RangeError('some(): array must contain at least '\n\t\t\t\t+ n + ' item(s), but had ' + nFulfill));\n\t\t\t} else if(nFulfill === 0) {\n\t\t\t\tresolver.resolve(results);\n\t\t\t}\n\n\t\t\t// Second pass: observe each array item, make progress toward goals\n\t\t\tfor(i=0; i 2 ? ar.call(promises, liftCombine(f), arguments[2])\n\t\t\t\t\t: ar.call(promises, liftCombine(f));\n\t\t}\n\n\t\t/**\n\t\t * Traditional reduce function, similar to `Array.prototype.reduceRight()`, but\n\t\t * input may contain promises and/or values, and reduceFunc\n\t\t * may return either a value or a promise, *and* initialValue may\n\t\t * be a promise for the starting value.\n\t\t * @param {Array|Promise} promises array or promise for an array of anything,\n\t\t * may contain a mix of promises and values.\n\t\t * @param {function(accumulated:*, x:*, index:Number):*} f reduce function\n\t\t * @returns {Promise} that will resolve to the final reduced value\n\t\t */\n\t\tfunction reduceRight(promises, f /*, initialValue */) {\n\t\t\treturn arguments.length > 2 ? arr.call(promises, liftCombine(f), arguments[2])\n\t\t\t\t\t: arr.call(promises, liftCombine(f));\n\t\t}\n\n\t\tfunction liftCombine(f) {\n\t\t\treturn function(z, x, i) {\n\t\t\t\treturn applyFold(f, void 0, [z,x,i]);\n\t\t\t};\n\t\t}\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function flow(Promise) {\n\n\t\tvar resolve = Promise.resolve;\n\t\tvar reject = Promise.reject;\n\t\tvar origCatch = Promise.prototype['catch'];\n\n\t\t/**\n\t\t * Handle the ultimate fulfillment value or rejection reason, and assume\n\t\t * responsibility for all errors. If an error propagates out of result\n\t\t * or handleFatalError, it will be rethrown to the host, resulting in a\n\t\t * loud stack track on most platforms and a crash on some.\n\t\t * @param {function?} onResult\n\t\t * @param {function?} onError\n\t\t * @returns {undefined}\n\t\t */\n\t\tPromise.prototype.done = function(onResult, onError) {\n\t\t\tthis._handler.visit(this._handler.receiver, onResult, onError);\n\t\t};\n\n\t\t/**\n\t\t * Add Error-type and predicate matching to catch. Examples:\n\t\t * promise.catch(TypeError, handleTypeError)\n\t\t * .catch(predicate, handleMatchedErrors)\n\t\t * .catch(handleRemainingErrors)\n\t\t * @param onRejected\n\t\t * @returns {*}\n\t\t */\n\t\tPromise.prototype['catch'] = Promise.prototype.otherwise = function(onRejected) {\n\t\t\tif (arguments.length < 2) {\n\t\t\t\treturn origCatch.call(this, onRejected);\n\t\t\t}\n\n\t\t\tif(typeof onRejected !== 'function') {\n\t\t\t\treturn this.ensure(rejectInvalidPredicate);\n\t\t\t}\n\n\t\t\treturn origCatch.call(this, createCatchFilter(arguments[1], onRejected));\n\t\t};\n\n\t\t/**\n\t\t * Wraps the provided catch handler, so that it will only be called\n\t\t * if the predicate evaluates truthy\n\t\t * @param {?function} handler\n\t\t * @param {function} predicate\n\t\t * @returns {function} conditional catch handler\n\t\t */\n\t\tfunction createCatchFilter(handler, predicate) {\n\t\t\treturn function(e) {\n\t\t\t\treturn evaluatePredicate(e, predicate)\n\t\t\t\t\t? handler.call(this, e)\n\t\t\t\t\t: reject(e);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Ensures that onFulfilledOrRejected will be called regardless of whether\n\t\t * this promise is fulfilled or rejected. onFulfilledOrRejected WILL NOT\n\t\t * receive the promises' value or reason. Any returned value will be disregarded.\n\t\t * onFulfilledOrRejected may throw or return a rejected promise to signal\n\t\t * an additional error.\n\t\t * @param {function} handler handler to be called regardless of\n\t\t * fulfillment or rejection\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype['finally'] = Promise.prototype.ensure = function(handler) {\n\t\t\tif(typeof handler !== 'function') {\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\treturn this.then(function(x) {\n\t\t\t\treturn runSideEffect(handler, this, identity, x);\n\t\t\t}, function(e) {\n\t\t\t\treturn runSideEffect(handler, this, reject, e);\n\t\t\t});\n\t\t};\n\n\t\tfunction runSideEffect (handler, thisArg, propagate, value) {\n\t\t\tvar result = handler.call(thisArg);\n\t\t\treturn maybeThenable(result)\n\t\t\t\t? propagateValue(result, propagate, value)\n\t\t\t\t: propagate(value);\n\t\t}\n\n\t\tfunction propagateValue (result, propagate, x) {\n\t\t\treturn resolve(result).then(function () {\n\t\t\t\treturn propagate(x);\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Recover from a failure by returning a defaultValue. If defaultValue\n\t\t * is a promise, it's fulfillment value will be used. If defaultValue is\n\t\t * a promise that rejects, the returned promise will reject with the\n\t\t * same reason.\n\t\t * @param {*} defaultValue\n\t\t * @returns {Promise} new promise\n\t\t */\n\t\tPromise.prototype['else'] = Promise.prototype.orElse = function(defaultValue) {\n\t\t\treturn this.then(void 0, function() {\n\t\t\t\treturn defaultValue;\n\t\t\t});\n\t\t};\n\n\t\t/**\n\t\t * Shortcut for .then(function() { return value; })\n\t\t * @param {*} value\n\t\t * @return {Promise} a promise that:\n\t\t * - is fulfilled if value is not a promise, or\n\t\t * - if value is a promise, will fulfill with its value, or reject\n\t\t * with its reason.\n\t\t */\n\t\tPromise.prototype['yield'] = function(value) {\n\t\t\treturn this.then(function() {\n\t\t\t\treturn value;\n\t\t\t});\n\t\t};\n\n\t\t/**\n\t\t * Runs a side effect when this promise fulfills, without changing the\n\t\t * fulfillment value.\n\t\t * @param {function} onFulfilledSideEffect\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype.tap = function(onFulfilledSideEffect) {\n\t\t\treturn this.then(onFulfilledSideEffect)['yield'](this);\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n\tfunction rejectInvalidPredicate() {\n\t\tthrow new TypeError('catch predicate must be a function');\n\t}\n\n\tfunction evaluatePredicate(e, predicate) {\n\t\treturn isError(predicate) ? e instanceof predicate : predicate(e);\n\t}\n\n\tfunction isError(predicate) {\n\t\treturn predicate === Error\n\t\t\t|| (predicate != null && predicate.prototype instanceof Error);\n\t}\n\n\tfunction maybeThenable(x) {\n\t\treturn (typeof x === 'object' || typeof x === 'function') && x !== null;\n\t}\n\n\tfunction identity(x) {\n\t\treturn x;\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n/** @author Jeff Escalante */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function fold(Promise) {\n\n\t\tPromise.prototype.fold = function(f, z) {\n\t\t\tvar promise = this._beget();\n\n\t\t\tthis._handler.fold(function(z, x, to) {\n\t\t\t\tPromise._handler(z).fold(function(x, z, to) {\n\t\t\t\t\tto.resolve(f.call(this, z, x));\n\t\t\t\t}, x, this, to);\n\t\t\t}, z, promise._handler.receiver, promise._handler);\n\n\t\t\treturn promise;\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar inspect = require('../state').inspect;\n\n\treturn function inspection(Promise) {\n\n\t\tPromise.prototype.inspect = function() {\n\t\t\treturn inspect(Promise._handler(this));\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function generate(Promise) {\n\n\t\tvar resolve = Promise.resolve;\n\n\t\tPromise.iterate = iterate;\n\t\tPromise.unfold = unfold;\n\n\t\treturn Promise;\n\n\t\t/**\n\t\t * @deprecated Use github.com/cujojs/most streams and most.iterate\n\t\t * Generate a (potentially infinite) stream of promised values:\n\t\t * x, f(x), f(f(x)), etc. until condition(x) returns true\n\t\t * @param {function} f function to generate a new x from the previous x\n\t\t * @param {function} condition function that, given the current x, returns\n\t\t * truthy when the iterate should stop\n\t\t * @param {function} handler function to handle the value produced by f\n\t\t * @param {*|Promise} x starting value, may be a promise\n\t\t * @return {Promise} the result of the last call to f before\n\t\t * condition returns true\n\t\t */\n\t\tfunction iterate(f, condition, handler, x) {\n\t\t\treturn unfold(function(x) {\n\t\t\t\treturn [x, f(x)];\n\t\t\t}, condition, handler, x);\n\t\t}\n\n\t\t/**\n\t\t * @deprecated Use github.com/cujojs/most streams and most.unfold\n\t\t * Generate a (potentially infinite) stream of promised values\n\t\t * by applying handler(generator(seed)) iteratively until\n\t\t * condition(seed) returns true.\n\t\t * @param {function} unspool function that generates a [value, newSeed]\n\t\t * given a seed.\n\t\t * @param {function} condition function that, given the current seed, returns\n\t\t * truthy when the unfold should stop\n\t\t * @param {function} handler function to handle the value produced by unspool\n\t\t * @param x {*|Promise} starting value, may be a promise\n\t\t * @return {Promise} the result of the last value produced by unspool before\n\t\t * condition returns true\n\t\t */\n\t\tfunction unfold(unspool, condition, handler, x) {\n\t\t\treturn resolve(x).then(function(seed) {\n\t\t\t\treturn resolve(condition(seed)).then(function(done) {\n\t\t\t\t\treturn done ? seed : resolve(unspool(seed)).spread(next);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tfunction next(item, newSeed) {\n\t\t\t\treturn resolve(handler(item)).then(function() {\n\t\t\t\t\treturn unfold(unspool, condition, handler, newSeed);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function progress(Promise) {\n\n\t\t/**\n\t\t * @deprecated\n\t\t * Register a progress handler for this promise\n\t\t * @param {function} onProgress\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype.progress = function(onProgress) {\n\t\t\treturn this.then(void 0, void 0, onProgress);\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar env = require('../env');\n\tvar TimeoutError = require('../TimeoutError');\n\n\tfunction setTimeout(f, ms, x, y) {\n\t\treturn env.setTimer(function() {\n\t\t\tf(x, y, ms);\n\t\t}, ms);\n\t}\n\n\treturn function timed(Promise) {\n\t\t/**\n\t\t * Return a new promise whose fulfillment value is revealed only\n\t\t * after ms milliseconds\n\t\t * @param {number} ms milliseconds\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype.delay = function(ms) {\n\t\t\tvar p = this._beget();\n\t\t\tthis._handler.fold(handleDelay, ms, void 0, p._handler);\n\t\t\treturn p;\n\t\t};\n\n\t\tfunction handleDelay(ms, x, h) {\n\t\t\tsetTimeout(resolveDelay, ms, x, h);\n\t\t}\n\n\t\tfunction resolveDelay(x, h) {\n\t\t\th.resolve(x);\n\t\t}\n\n\t\t/**\n\t\t * Return a new promise that rejects after ms milliseconds unless\n\t\t * this promise fulfills earlier, in which case the returned promise\n\t\t * fulfills with the same value.\n\t\t * @param {number} ms milliseconds\n\t\t * @param {Error|*=} reason optional rejection reason to use, defaults\n\t\t * to a TimeoutError if not provided\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype.timeout = function(ms, reason) {\n\t\t\tvar p = this._beget();\n\t\t\tvar h = p._handler;\n\n\t\t\tvar t = setTimeout(onTimeout, ms, reason, p._handler);\n\n\t\t\tthis._handler.visit(h,\n\t\t\t\tfunction onFulfill(x) {\n\t\t\t\t\tenv.clearTimer(t);\n\t\t\t\t\tthis.resolve(x); // this = h\n\t\t\t\t},\n\t\t\t\tfunction onReject(x) {\n\t\t\t\t\tenv.clearTimer(t);\n\t\t\t\t\tthis.reject(x); // this = h\n\t\t\t\t},\n\t\t\t\th.notify);\n\n\t\t\treturn p;\n\t\t};\n\n\t\tfunction onTimeout(reason, h, ms) {\n\t\t\tvar e = typeof reason === 'undefined'\n\t\t\t\t? new TimeoutError('timed out after ' + ms + 'ms')\n\t\t\t\t: reason;\n\t\t\th.reject(e);\n\t\t}\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar setTimer = require('../env').setTimer;\n\tvar format = require('../format');\n\n\treturn function unhandledRejection(Promise) {\n\n\t\tvar logError = noop;\n\t\tvar logInfo = noop;\n\t\tvar localConsole;\n\n\t\tif(typeof console !== 'undefined') {\n\t\t\t// Alias console to prevent things like uglify's drop_console option from\n\t\t\t// removing console.log/error. Unhandled rejections fall into the same\n\t\t\t// category as uncaught exceptions, and build tools shouldn't silence them.\n\t\t\tlocalConsole = console;\n\t\t\tlogError = typeof localConsole.error !== 'undefined'\n\t\t\t\t? function (e) { localConsole.error(e); }\n\t\t\t\t: function (e) { localConsole.log(e); };\n\n\t\t\tlogInfo = typeof localConsole.info !== 'undefined'\n\t\t\t\t? function (e) { localConsole.info(e); }\n\t\t\t\t: function (e) { localConsole.log(e); };\n\t\t}\n\n\t\tPromise.onPotentiallyUnhandledRejection = function(rejection) {\n\t\t\tenqueue(report, rejection);\n\t\t};\n\n\t\tPromise.onPotentiallyUnhandledRejectionHandled = function(rejection) {\n\t\t\tenqueue(unreport, rejection);\n\t\t};\n\n\t\tPromise.onFatalRejection = function(rejection) {\n\t\t\tenqueue(throwit, rejection.value);\n\t\t};\n\n\t\tvar tasks = [];\n\t\tvar reported = [];\n\t\tvar running = null;\n\n\t\tfunction report(r) {\n\t\t\tif(!r.handled) {\n\t\t\t\treported.push(r);\n\t\t\t\tlogError('Potentially unhandled rejection [' + r.id + '] ' + format.formatError(r.value));\n\t\t\t}\n\t\t}\n\n\t\tfunction unreport(r) {\n\t\t\tvar i = reported.indexOf(r);\n\t\t\tif(i >= 0) {\n\t\t\t\treported.splice(i, 1);\n\t\t\t\tlogInfo('Handled previous rejection [' + r.id + '] ' + format.formatObject(r.value));\n\t\t\t}\n\t\t}\n\n\t\tfunction enqueue(f, x) {\n\t\t\ttasks.push(f, x);\n\t\t\tif(running === null) {\n\t\t\t\trunning = setTimer(flush, 0);\n\t\t\t}\n\t\t}\n\n\t\tfunction flush() {\n\t\t\trunning = null;\n\t\t\twhile(tasks.length > 0) {\n\t\t\t\ttasks.shift()(tasks.shift());\n\t\t\t}\n\t\t}\n\n\t\treturn Promise;\n\t};\n\n\tfunction throwit(e) {\n\t\tthrow e;\n\t}\n\n\tfunction noop() {}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function addWith(Promise) {\n\t\t/**\n\t\t * Returns a promise whose handlers will be called with `this` set to\n\t\t * the supplied receiver. Subsequent promises derived from the\n\t\t * returned promise will also have their handlers called with receiver\n\t\t * as `this`. Calling `with` with undefined or no arguments will return\n\t\t * a promise whose handlers will again be called in the usual Promises/A+\n\t\t * way (no `this`) thus safely undoing any previous `with` in the\n\t\t * promise chain.\n\t\t *\n\t\t * WARNING: Promises returned from `with`/`withThis` are NOT Promises/A+\n\t\t * compliant, specifically violating 2.2.5 (http://promisesaplus.com/#point-41)\n\t\t *\n\t\t * @param {object} receiver `this` value for all handlers attached to\n\t\t * the returned promise.\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype['with'] = Promise.prototype.withThis = function(receiver) {\n\t\t\tvar p = this._beget();\n\t\t\tvar child = p._handler;\n\t\t\tchild.receiver = receiver;\n\t\t\tthis._handler.chain(child, receiver);\n\t\t\treturn p;\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n/*global process,document,setTimeout,clearTimeout,MutationObserver,WebKitMutationObserver*/\n(function(define) { 'use strict';\ndefine(function(require) {\n\t/*jshint maxcomplexity:6*/\n\n\t// Sniff \"best\" async scheduling option\n\t// Prefer process.nextTick or MutationObserver, then check for\n\t// setTimeout, and finally vertx, since its the only env that doesn't\n\t// have setTimeout\n\n\tvar MutationObs;\n\tvar capturedSetTimeout = typeof setTimeout !== 'undefined' && setTimeout;\n\n\t// Default env\n\tvar setTimer = function(f, ms) { return setTimeout(f, ms); };\n\tvar clearTimer = function(t) { return clearTimeout(t); };\n\tvar asap = function (f) { return capturedSetTimeout(f, 0); };\n\n\t// Detect specific env\n\tif (isNode()) { // Node\n\t\tasap = function (f) { return process.nextTick(f); };\n\n\t} else if (MutationObs = hasMutationObserver()) { // Modern browser\n\t\tasap = initMutationObserver(MutationObs);\n\n\t} else if (!capturedSetTimeout) { // vert.x\n\t\tvar vertxRequire = require;\n\t\tvar vertx = vertxRequire('vertx');\n\t\tsetTimer = function (f, ms) { return vertx.setTimer(ms, f); };\n\t\tclearTimer = vertx.cancelTimer;\n\t\tasap = vertx.runOnLoop || vertx.runOnContext;\n\t}\n\n\treturn {\n\t\tsetTimer: setTimer,\n\t\tclearTimer: clearTimer,\n\t\tasap: asap\n\t};\n\n\tfunction isNode () {\n\t\treturn typeof process !== 'undefined' &&\n\t\t\tObject.prototype.toString.call(process) === '[object process]';\n\t}\n\n\tfunction hasMutationObserver () {\n\t\treturn (typeof MutationObserver === 'function' && MutationObserver) ||\n\t\t\t(typeof WebKitMutationObserver === 'function' && WebKitMutationObserver);\n\t}\n\n\tfunction initMutationObserver(MutationObserver) {\n\t\tvar scheduled;\n\t\tvar node = document.createTextNode('');\n\t\tvar o = new MutationObserver(run);\n\t\to.observe(node, { characterData: true });\n\n\t\tfunction run() {\n\t\t\tvar f = scheduled;\n\t\t\tscheduled = void 0;\n\t\t\tf();\n\t\t}\n\n\t\tvar i = 0;\n\t\treturn function (f) {\n\t\t\tscheduled = f;\n\t\t\tnode.data = (i ^= 1);\n\t\t};\n\t}\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn {\n\t\tformatError: formatError,\n\t\tformatObject: formatObject,\n\t\ttryStringify: tryStringify\n\t};\n\n\t/**\n\t * Format an error into a string. If e is an Error and has a stack property,\n\t * it's returned. Otherwise, e is formatted using formatObject, with a\n\t * warning added about e not being a proper Error.\n\t * @param {*} e\n\t * @returns {String} formatted string, suitable for output to developers\n\t */\n\tfunction formatError(e) {\n\t\tvar s = typeof e === 'object' && e !== null && (e.stack || e.message) ? e.stack || e.message : formatObject(e);\n\t\treturn e instanceof Error ? s : s + ' (WARNING: non-Error used)';\n\t}\n\n\t/**\n\t * Format an object, detecting \"plain\" objects and running them through\n\t * JSON.stringify if possible.\n\t * @param {Object} o\n\t * @returns {string}\n\t */\n\tfunction formatObject(o) {\n\t\tvar s = String(o);\n\t\tif(s === '[object Object]' && typeof JSON !== 'undefined') {\n\t\t\ts = tryStringify(o, s);\n\t\t}\n\t\treturn s;\n\t}\n\n\t/**\n\t * Try to return the result of JSON.stringify(x). If that fails, return\n\t * defaultValue\n\t * @param {*} x\n\t * @param {*} defaultValue\n\t * @returns {String|*} JSON.stringify(x) or defaultValue\n\t */\n\tfunction tryStringify(x, defaultValue) {\n\t\ttry {\n\t\t\treturn JSON.stringify(x);\n\t\t} catch(e) {\n\t\t\treturn defaultValue;\n\t\t}\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function liftAll(liftOne, combine, dst, src) {\n\t\tif(typeof combine === 'undefined') {\n\t\t\tcombine = defaultCombine;\n\t\t}\n\n\t\treturn Object.keys(src).reduce(function(dst, key) {\n\t\t\tvar f = src[key];\n\t\t\treturn typeof f === 'function' ? combine(dst, liftOne(f), key) : dst;\n\t\t}, typeof dst === 'undefined' ? defaultDst(src) : dst);\n\t};\n\n\tfunction defaultCombine(o, f, k) {\n\t\to[k] = f;\n\t\treturn o;\n\t}\n\n\tfunction defaultDst(src) {\n\t\treturn typeof src === 'function' ? src.bind() : Object.create(src);\n\t}\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function makePromise(environment) {\n\n\t\tvar tasks = environment.scheduler;\n\t\tvar emitRejection = initEmitRejection();\n\n\t\tvar objectCreate = Object.create ||\n\t\t\tfunction(proto) {\n\t\t\t\tfunction Child() {}\n\t\t\t\tChild.prototype = proto;\n\t\t\t\treturn new Child();\n\t\t\t};\n\n\t\t/**\n\t\t * Create a promise whose fate is determined by resolver\n\t\t * @constructor\n\t\t * @returns {Promise} promise\n\t\t * @name Promise\n\t\t */\n\t\tfunction Promise(resolver, handler) {\n\t\t\tthis._handler = resolver === Handler ? handler : init(resolver);\n\t\t}\n\n\t\t/**\n\t\t * Run the supplied resolver\n\t\t * @param resolver\n\t\t * @returns {Pending}\n\t\t */\n\t\tfunction init(resolver) {\n\t\t\tvar handler = new Pending();\n\n\t\t\ttry {\n\t\t\t\tresolver(promiseResolve, promiseReject, promiseNotify);\n\t\t\t} catch (e) {\n\t\t\t\tpromiseReject(e);\n\t\t\t}\n\n\t\t\treturn handler;\n\n\t\t\t/**\n\t\t\t * Transition from pre-resolution state to post-resolution state, notifying\n\t\t\t * all listeners of the ultimate fulfillment or rejection\n\t\t\t * @param {*} x resolution value\n\t\t\t */\n\t\t\tfunction promiseResolve (x) {\n\t\t\t\thandler.resolve(x);\n\t\t\t}\n\t\t\t/**\n\t\t\t * Reject this promise with reason, which will be used verbatim\n\t\t\t * @param {Error|*} reason rejection reason, strongly suggested\n\t\t\t * to be an Error type\n\t\t\t */\n\t\t\tfunction promiseReject (reason) {\n\t\t\t\thandler.reject(reason);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * @deprecated\n\t\t\t * Issue a progress event, notifying all progress listeners\n\t\t\t * @param {*} x progress event payload to pass to all listeners\n\t\t\t */\n\t\t\tfunction promiseNotify (x) {\n\t\t\t\thandler.notify(x);\n\t\t\t}\n\t\t}\n\n\t\t// Creation\n\n\t\tPromise.resolve = resolve;\n\t\tPromise.reject = reject;\n\t\tPromise.never = never;\n\n\t\tPromise._defer = defer;\n\t\tPromise._handler = getHandler;\n\n\t\t/**\n\t\t * Returns a trusted promise. If x is already a trusted promise, it is\n\t\t * returned, otherwise returns a new trusted Promise which follows x.\n\t\t * @param {*} x\n\t\t * @return {Promise} promise\n\t\t */\n\t\tfunction resolve(x) {\n\t\t\treturn isPromise(x) ? x\n\t\t\t\t: new Promise(Handler, new Async(getHandler(x)));\n\t\t}\n\n\t\t/**\n\t\t * Return a reject promise with x as its reason (x is used verbatim)\n\t\t * @param {*} x\n\t\t * @returns {Promise} rejected promise\n\t\t */\n\t\tfunction reject(x) {\n\t\t\treturn new Promise(Handler, new Async(new Rejected(x)));\n\t\t}\n\n\t\t/**\n\t\t * Return a promise that remains pending forever\n\t\t * @returns {Promise} forever-pending promise.\n\t\t */\n\t\tfunction never() {\n\t\t\treturn foreverPendingPromise; // Should be frozen\n\t\t}\n\n\t\t/**\n\t\t * Creates an internal {promise, resolver} pair\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tfunction defer() {\n\t\t\treturn new Promise(Handler, new Pending());\n\t\t}\n\n\t\t// Transformation and flow control\n\n\t\t/**\n\t\t * Transform this promise's fulfillment value, returning a new Promise\n\t\t * for the transformed result. If the promise cannot be fulfilled, onRejected\n\t\t * is called with the reason. onProgress *may* be called with updates toward\n\t\t * this promise's fulfillment.\n\t\t * @param {function=} onFulfilled fulfillment handler\n\t\t * @param {function=} onRejected rejection handler\n\t\t * @param {function=} onProgress @deprecated progress handler\n\t\t * @return {Promise} new promise\n\t\t */\n\t\tPromise.prototype.then = function(onFulfilled, onRejected, onProgress) {\n\t\t\tvar parent = this._handler;\n\t\t\tvar state = parent.join().state();\n\n\t\t\tif ((typeof onFulfilled !== 'function' && state > 0) ||\n\t\t\t\t(typeof onRejected !== 'function' && state < 0)) {\n\t\t\t\t// Short circuit: value will not change, simply share handler\n\t\t\t\treturn new this.constructor(Handler, parent);\n\t\t\t}\n\n\t\t\tvar p = this._beget();\n\t\t\tvar child = p._handler;\n\n\t\t\tparent.chain(child, parent.receiver, onFulfilled, onRejected, onProgress);\n\n\t\t\treturn p;\n\t\t};\n\n\t\t/**\n\t\t * If this promise cannot be fulfilled due to an error, call onRejected to\n\t\t * handle the error. Shortcut for .then(undefined, onRejected)\n\t\t * @param {function?} onRejected\n\t\t * @return {Promise}\n\t\t */\n\t\tPromise.prototype['catch'] = function(onRejected) {\n\t\t\treturn this.then(void 0, onRejected);\n\t\t};\n\n\t\t/**\n\t\t * Creates a new, pending promise of the same type as this promise\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype._beget = function() {\n\t\t\treturn begetFrom(this._handler, this.constructor);\n\t\t};\n\n\t\tfunction begetFrom(parent, Promise) {\n\t\t\tvar child = new Pending(parent.receiver, parent.join().context);\n\t\t\treturn new Promise(Handler, child);\n\t\t}\n\n\t\t// Array combinators\n\n\t\tPromise.all = all;\n\t\tPromise.race = race;\n\t\tPromise._traverse = traverse;\n\n\t\t/**\n\t\t * Return a promise that will fulfill when all promises in the\n\t\t * input array have fulfilled, or will reject when one of the\n\t\t * promises rejects.\n\t\t * @param {array} promises array of promises\n\t\t * @returns {Promise} promise for array of fulfillment values\n\t\t */\n\t\tfunction all(promises) {\n\t\t\treturn traverseWith(snd, null, promises);\n\t\t}\n\n\t\t/**\n\t\t * Array> -> Promise>\n\t\t * @private\n\t\t * @param {function} f function to apply to each promise's value\n\t\t * @param {Array} promises array of promises\n\t\t * @returns {Promise} promise for transformed values\n\t\t */\n\t\tfunction traverse(f, promises) {\n\t\t\treturn traverseWith(tryCatch2, f, promises);\n\t\t}\n\n\t\tfunction traverseWith(tryMap, f, promises) {\n\t\t\tvar handler = typeof f === 'function' ? mapAt : settleAt;\n\n\t\t\tvar resolver = new Pending();\n\t\t\tvar pending = promises.length >>> 0;\n\t\t\tvar results = new Array(pending);\n\n\t\t\tfor (var i = 0, x; i < promises.length && !resolver.resolved; ++i) {\n\t\t\t\tx = promises[i];\n\n\t\t\t\tif (x === void 0 && !(i in promises)) {\n\t\t\t\t\t--pending;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttraverseAt(promises, handler, i, x, resolver);\n\t\t\t}\n\n\t\t\tif(pending === 0) {\n\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t}\n\n\t\t\treturn new Promise(Handler, resolver);\n\n\t\t\tfunction mapAt(i, x, resolver) {\n\t\t\t\tif(!resolver.resolved) {\n\t\t\t\t\ttraverseAt(promises, settleAt, i, tryMap(f, x, i), resolver);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction settleAt(i, x, resolver) {\n\t\t\t\tresults[i] = x;\n\t\t\t\tif(--pending === 0) {\n\t\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction traverseAt(promises, handler, i, x, resolver) {\n\t\t\tif (maybeThenable(x)) {\n\t\t\t\tvar h = getHandlerMaybeThenable(x);\n\t\t\t\tvar s = h.state();\n\n\t\t\t\tif (s === 0) {\n\t\t\t\t\th.fold(handler, i, void 0, resolver);\n\t\t\t\t} else if (s > 0) {\n\t\t\t\t\thandler(i, h.value, resolver);\n\t\t\t\t} else {\n\t\t\t\t\tresolver.become(h);\n\t\t\t\t\tvisitRemaining(promises, i+1, h);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thandler(i, x, resolver);\n\t\t\t}\n\t\t}\n\n\t\tPromise._visitRemaining = visitRemaining;\n\t\tfunction visitRemaining(promises, start, handler) {\n\t\t\tfor(var i=start; i 0 ? toFulfilledState(handler.value)\n\t\t\t : toRejectedState(handler.value);\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2013 original author or authors */\n\n/**\n * Collection of helpers for interfacing with node-style asynchronous functions\n * using promises.\n *\n * @author Brian Cavalier\n * @contributor Renato Zannon\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar _liftAll = require('./lib/liftAll');\n\tvar setTimer = require('./lib/env').setTimer;\n\tvar slice = Array.prototype.slice;\n\n\tvar _apply = require('./lib/apply')(when.Promise, dispatch);\n\n\treturn {\n\t\tlift: lift,\n\t\tliftAll: liftAll,\n\t\tapply: apply,\n\t\tcall: call,\n\t\tcreateCallback: createCallback,\n\t\tbindCallback: bindCallback,\n\t\tliftCallback: liftCallback\n\t};\n\n\t/**\n\t * Takes a node-style async function and calls it immediately (with an optional\n\t * array of arguments or promises for arguments). It returns a promise whose\n\t * resolution depends on whether the async functions calls its callback with the\n\t * conventional error argument or not.\n\t *\n\t * With this it becomes possible to leverage existing APIs while still reaping\n\t * the benefits of promises.\n\t *\n\t * @example\n\t * function onlySmallNumbers(n, callback) {\n\t *\t\tif(n < 10) {\n\t *\t\t\tcallback(null, n + 10);\n\t *\t\t} else {\n\t *\t\t\tcallback(new Error(\"Calculation failed\"));\n\t *\t\t}\n\t *\t}\n\t *\n\t * var nodefn = require(\"when/node/function\");\n\t *\n\t * // Logs '15'\n\t * nodefn.apply(onlySmallNumbers, [5]).then(console.log, console.error);\n\t *\n\t * // Logs 'Calculation failed'\n\t * nodefn.apply(onlySmallNumbers, [15]).then(console.log, console.error);\n\t *\n\t * @param {function} f node-style function that will be called\n\t * @param {Array} [args] array of arguments to func\n\t * @returns {Promise} promise for the value func passes to its callback\n\t */\n\tfunction apply(f, args) {\n\t\treturn _apply(f, this, args || []);\n\t}\n\n\tfunction dispatch(f, thisArg, args, h) {\n\t\tvar cb = createCallback(h);\n\t\ttry {\n\t\t\tswitch(args.length) {\n\t\t\t\tcase 2: f.call(thisArg, args[0], args[1], cb); break;\n\t\t\t\tcase 1: f.call(thisArg, args[0], cb); break;\n\t\t\t\tcase 0: f.call(thisArg, cb); break;\n\t\t\t\tdefault:\n\t\t\t\t\targs.push(cb);\n\t\t\t\t\tf.apply(thisArg, args);\n\t\t\t}\n\t\t} catch(e) {\n\t\t\th.reject(e);\n\t\t}\n\t}\n\n\t/**\n\t * Has the same behavior that {@link apply} has, with the difference that the\n\t * arguments to the function are provided individually, while {@link apply} accepts\n\t * a single array.\n\t *\n\t * @example\n\t * function sumSmallNumbers(x, y, callback) {\n\t *\t\tvar result = x + y;\n\t *\t\tif(result < 10) {\n\t *\t\t\tcallback(null, result);\n\t *\t\t} else {\n\t *\t\t\tcallback(new Error(\"Calculation failed\"));\n\t *\t\t}\n\t *\t}\n\t *\n\t * // Logs '5'\n\t * nodefn.call(sumSmallNumbers, 2, 3).then(console.log, console.error);\n\t *\n\t * // Logs 'Calculation failed'\n\t * nodefn.call(sumSmallNumbers, 5, 10).then(console.log, console.error);\n\t *\n\t * @param {function} f node-style function that will be called\n\t * @param {...*} [args] arguments that will be forwarded to the function\n\t * @returns {Promise} promise for the value func passes to its callback\n\t */\n\tfunction call(f /*, args... */) {\n\t\treturn _apply(f, this, slice.call(arguments, 1));\n\t}\n\n\t/**\n\t * Takes a node-style function and returns new function that wraps the\n\t * original and, instead of taking a callback, returns a promise. Also, it\n\t * knows how to handle promises given as arguments, waiting for their\n\t * resolution before executing.\n\t *\n\t * Upon execution, the orginal function is executed as well. If it passes\n\t * a truthy value as the first argument to the callback, it will be\n\t * interpreted as an error condition, and the promise will be rejected\n\t * with it. Otherwise, the call is considered a resolution, and the promise\n\t * is resolved with the callback's second argument.\n\t *\n\t * @example\n\t * var fs = require(\"fs\"), nodefn = require(\"when/node/function\");\n\t *\n\t * var promiseRead = nodefn.lift(fs.readFile);\n\t *\n\t * // The promise is resolved with the contents of the file if everything\n\t * // goes ok\n\t * promiseRead('exists.txt').then(console.log, console.error);\n\t *\n\t * // And will be rejected if something doesn't work out\n\t * // (e.g. the files does not exist)\n\t * promiseRead('doesnt_exist.txt').then(console.log, console.error);\n\t *\n\t *\n\t * @param {Function} f node-style function to be lifted\n\t * @param {...*} [args] arguments to be prepended for the new function @deprecated\n\t * @returns {Function} a promise-returning function\n\t */\n\tfunction lift(f /*, args... */) {\n\t\tvar args1 = arguments.length > 1 ? slice.call(arguments, 1) : [];\n\t\treturn function() {\n\t\t\t// TODO: Simplify once partialing has been removed\n\t\t\tvar l = args1.length;\n\t\t\tvar al = arguments.length;\n\t\t\tvar args = new Array(al + l);\n\t\t\tvar i;\n\t\t\tfor(i=0; i 2) {\n\t\t\t\tresolver.resolve(slice.call(arguments, 1));\n\t\t\t} else {\n\t\t\t\tresolver.resolve(value);\n\t\t\t}\n\t\t};\n\t}\n\n\t/**\n\t * Attaches a node-style callback to a promise, ensuring the callback is\n\t * called for either fulfillment or rejection. Returns a promise with the same\n\t * state as the passed-in promise.\n\t *\n\t * @example\n\t *\tvar deferred = when.defer();\n\t *\n\t *\tfunction callback(err, value) {\n\t *\t\t// Handle err or use value\n\t *\t}\n\t *\n\t *\tbindCallback(deferred.promise, callback);\n\t *\n\t *\tdeferred.resolve('interesting value');\n\t *\n\t * @param {Promise} promise The promise to be attached to.\n\t * @param {Function} callback The node-style callback to attach.\n\t * @returns {Promise} A promise with the same state as the passed-in promise.\n\t */\n\tfunction bindCallback(promise, callback) {\n\t\tpromise = when(promise);\n\n\t\tif (callback) {\n\t\t\tpromise.then(success, wrapped);\n\t\t}\n\n\t\treturn promise;\n\n\t\tfunction success(value) {\n\t\t\twrapped(null, value);\n\t\t}\n\n\t\tfunction wrapped(err, value) {\n\t\t\tsetTimer(function () {\n\t\t\t\tcallback(err, value);\n\t\t\t}, 0);\n\t\t}\n\t}\n\n\t/**\n\t * Takes a node-style callback and returns new function that accepts a\n\t * promise, calling the original callback when the promise is either\n\t * fulfilled or rejected with the appropriate arguments.\n\t *\n\t * @example\n\t *\tvar deferred = when.defer();\n\t *\n\t *\tfunction callback(err, value) {\n\t *\t\t// Handle err or use value\n\t *\t}\n\t *\n\t *\tvar wrapped = liftCallback(callback);\n\t *\n\t *\t// `wrapped` can now be passed around at will\n\t *\twrapped(deferred.promise);\n\t *\n\t *\tdeferred.resolve('interesting value');\n\t *\n\t * @param {Function} callback The node-style callback to wrap.\n\t * @returns {Function} The lifted, promise-accepting function.\n\t */\n\tfunction liftCallback(callback) {\n\t\treturn function(promise) {\n\t\t\treturn bindCallback(promise, callback);\n\t\t};\n\t}\n});\n\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * parallel.js\n *\n * Run a set of task functions in parallel. All tasks will\n * receive the same args\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar all = when.Promise.all;\n\tvar slice = Array.prototype.slice;\n\n\t/**\n\t * Run array of tasks in parallel\n\t * @param tasks {Array|Promise} array or promiseForArray of task functions\n\t * @param [args] {*} arguments to be passed to all tasks\n\t * @return {Promise} promise for array containing the\n\t * result of each task in the array position corresponding\n\t * to position of the task in the tasks array\n\t */\n\treturn function parallel(tasks /*, args... */) {\n\t\treturn all(slice.call(arguments, 1)).then(function(args) {\n\t\t\treturn when.map(tasks, function(task) {\n\t\t\t\treturn task.apply(void 0, args);\n\t\t\t});\n\t\t});\n\t};\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * pipeline.js\n *\n * Run a set of task functions in sequence, passing the result\n * of the previous as an argument to the next. Like a shell\n * pipeline, e.g. `cat file.txt | grep 'foo' | sed -e 's/foo/bar/g'\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar all = when.Promise.all;\n\tvar slice = Array.prototype.slice;\n\n\t/**\n\t * Run array of tasks in a pipeline where the next\n\t * tasks receives the result of the previous. The first task\n\t * will receive the initialArgs as its argument list.\n\t * @param tasks {Array|Promise} array or promise for array of task functions\n\t * @param [initialArgs...] {*} arguments to be passed to the first task\n\t * @return {Promise} promise for return value of the final task\n\t */\n\treturn function pipeline(tasks /* initialArgs... */) {\n\t\t// Self-optimizing function to run first task with multiple\n\t\t// args using apply, but subsequence tasks via direct invocation\n\t\tvar runTask = function(args, task) {\n\t\t\trunTask = function(arg, task) {\n\t\t\t\treturn task(arg);\n\t\t\t};\n\n\t\t\treturn task.apply(null, args);\n\t\t};\n\n\t\treturn all(slice.call(arguments, 1)).then(function(args) {\n\t\t\treturn when.reduce(tasks, function(arg, task) {\n\t\t\t\treturn runTask(arg, task);\n\t\t\t}, args);\n\t\t});\n\t};\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2012-2013 original author or authors */\n\n/**\n * poll.js\n *\n * Helper that polls until cancelled or for a condition to become true.\n *\n * @author Scott Andrews\n */\n\n(function (define) { 'use strict';\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar attempt = when['try'];\n\tvar cancelable = require('./cancelable');\n\n\t/**\n\t * Periodically execute the task function on the msec delay. The result of\n\t * the task may be verified by watching for a condition to become true. The\n\t * returned deferred is cancellable if the polling needs to be cancelled\n\t * externally before reaching a resolved state.\n\t *\n\t * The next vote is scheduled after the results of the current vote are\n\t * verified and rejected.\n\t *\n\t * Polling may be terminated by the verifier returning a truthy value,\n\t * invoking cancel() on the returned promise, or the task function returning\n\t * a rejected promise.\n\t *\n\t * Usage:\n\t *\n\t * var count = 0;\n\t * function doSomething() { return count++ }\n\t *\n\t * // poll until cancelled\n\t * var p = poll(doSomething, 1000);\n\t * ...\n\t * p.cancel();\n\t *\n\t * // poll until condition is met\n\t * poll(doSomething, 1000, function(result) { return result > 10 })\n\t * .then(function(result) { assert result == 10 });\n\t *\n\t * // delay first vote\n\t * poll(doSomething, 1000, anyFunc, true);\n\t *\n\t * @param task {Function} function that is executed after every timeout\n\t * @param interval {number|Function} timeout in milliseconds\n\t * @param [verifier] {Function} function to evaluate the result of the vote.\n\t * May return a {Promise} or a {Boolean}. Rejecting the promise or a\n\t * falsey value will schedule the next vote.\n\t * @param [delayInitialTask] {boolean} if truthy, the first vote is scheduled\n\t * instead of immediate\n\t *\n\t * @returns {Promise}\n\t */\n\treturn function poll(task, interval, verifier, delayInitialTask) {\n\t\tvar deferred, canceled, reject;\n\n\t\tcanceled = false;\n\t\tdeferred = cancelable(when.defer(), function () { canceled = true; });\n\t\treject = deferred.reject;\n\n\t\tverifier = verifier || function () { return false; };\n\n\t\tif (typeof interval !== 'function') {\n\t\t\tinterval = (function (interval) {\n\t\t\t\treturn function () { return when().delay(interval); };\n\t\t\t})(interval);\n\t\t}\n\n\t\tfunction certify(result) {\n\t\t\tdeferred.resolve(result);\n\t\t}\n\n\t\tfunction schedule(result) {\n\t\t\tattempt(interval).then(vote, reject);\n\t\t\tif (result !== void 0) {\n\t\t\t\tdeferred.notify(result);\n\t\t\t}\n\t\t}\n\n\t\tfunction vote() {\n\t\t\tif (canceled) { return; }\n\t\t\twhen(task(),\n\t\t\t\tfunction (result) {\n\t\t\t\t\twhen(verifier(result),\n\t\t\t\t\t\tfunction (verification) {\n\t\t\t\t\t\t\treturn verification ? certify(result) : schedule(result);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction () { schedule(result); }\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\treject\n\t\t\t);\n\t\t}\n\n\t\tif (delayInitialTask) {\n\t\t\tschedule();\n\t\t} else {\n\t\t\t// if task() is blocking, vote will also block\n\t\t\tvote();\n\t\t}\n\n\t\t// make the promise cancelable\n\t\tdeferred.promise = Object.create(deferred.promise);\n\t\tdeferred.promise.cancel = deferred.cancel;\n\n\t\treturn deferred.promise;\n\t};\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * sequence.js\n *\n * Run a set of task functions in sequence. All tasks will\n * receive the same args.\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar all = when.Promise.all;\n\tvar slice = Array.prototype.slice;\n\n\t/**\n\t * Run array of tasks in sequence with no overlap\n\t * @param tasks {Array|Promise} array or promiseForArray of task functions\n\t * @param [args] {*} arguments to be passed to all tasks\n\t * @return {Promise} promise for an array containing\n\t * the result of each task in the array position corresponding\n\t * to position of the task in the tasks array\n\t */\n\treturn function sequence(tasks /*, args... */) {\n\t\tvar results = [];\n\n\t\treturn all(slice.call(arguments, 1)).then(function(args) {\n\t\t\treturn when.reduce(tasks, function(results, task) {\n\t\t\t\treturn when(task.apply(void 0, args), addResult);\n\t\t\t}, results);\n\t\t});\n\n\t\tfunction addResult(result) {\n\t\t\tresults.push(result);\n\t\t\treturn results;\n\t\t}\n\t};\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * timeout.js\n *\n * Helper that returns a promise that rejects after a specified timeout,\n * if not explicitly resolved or rejected before that.\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\n /**\n\t * @deprecated Use when(trigger).timeout(ms)\n */\n return function timeout(msec, trigger) {\n\t\treturn when(trigger).timeout(msec);\n };\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n\n/**\n * Promises/A+ and when() implementation\n * when is part of the cujoJS family of libraries (http://cujojs.com/)\n * @author Brian Cavalier\n * @author John Hann\n */\n(function(define) { 'use strict';\ndefine(function (require) {\n\n\tvar timed = require('./lib/decorators/timed');\n\tvar array = require('./lib/decorators/array');\n\tvar flow = require('./lib/decorators/flow');\n\tvar fold = require('./lib/decorators/fold');\n\tvar inspect = require('./lib/decorators/inspect');\n\tvar generate = require('./lib/decorators/iterate');\n\tvar progress = require('./lib/decorators/progress');\n\tvar withThis = require('./lib/decorators/with');\n\tvar unhandledRejection = require('./lib/decorators/unhandledRejection');\n\tvar TimeoutError = require('./lib/TimeoutError');\n\n\tvar Promise = [array, flow, fold, generate, progress,\n\t\tinspect, withThis, timed, unhandledRejection]\n\t\t.reduce(function(Promise, feature) {\n\t\t\treturn feature(Promise);\n\t\t}, require('./lib/Promise'));\n\n\tvar apply = require('./lib/apply')(Promise);\n\n\t// Public API\n\n\twhen.promise = promise; // Create a pending promise\n\twhen.resolve = Promise.resolve; // Create a resolved promise\n\twhen.reject = Promise.reject; // Create a rejected promise\n\n\twhen.lift = lift; // lift a function to return promises\n\twhen['try'] = attempt; // call a function and return a promise\n\twhen.attempt = attempt; // alias for when.try\n\n\twhen.iterate = Promise.iterate; // DEPRECATED (use cujojs/most streams) Generate a stream of promises\n\twhen.unfold = Promise.unfold; // DEPRECATED (use cujojs/most streams) Generate a stream of promises\n\n\twhen.join = join; // Join 2 or more promises\n\n\twhen.all = all; // Resolve a list of promises\n\twhen.settle = settle; // Settle a list of promises\n\n\twhen.any = lift(Promise.any); // One-winner race\n\twhen.some = lift(Promise.some); // Multi-winner race\n\twhen.race = lift(Promise.race); // First-to-settle race\n\n\twhen.map = map; // Array.map() for promises\n\twhen.filter = filter; // Array.filter() for promises\n\twhen.reduce = lift(Promise.reduce); // Array.reduce() for promises\n\twhen.reduceRight = lift(Promise.reduceRight); // Array.reduceRight() for promises\n\n\twhen.isPromiseLike = isPromiseLike; // Is something promise-like, aka thenable\n\n\twhen.Promise = Promise; // Promise constructor\n\twhen.defer = defer; // Create a {promise, resolve, reject} tuple\n\n\t// Error types\n\n\twhen.TimeoutError = TimeoutError;\n\n\t/**\n\t * Get a trusted promise for x, or by transforming x with onFulfilled\n\t *\n\t * @param {*} x\n\t * @param {function?} onFulfilled callback to be called when x is\n\t * successfully fulfilled. If promiseOrValue is an immediate value, callback\n\t * will be invoked immediately.\n\t * @param {function?} onRejected callback to be called when x is\n\t * rejected.\n\t * @param {function?} onProgress callback to be called when progress updates\n\t * are issued for x. @deprecated\n\t * @returns {Promise} a new promise that will fulfill with the return\n\t * value of callback or errback or the completion value of promiseOrValue if\n\t * callback and/or errback is not supplied.\n\t */\n\tfunction when(x, onFulfilled, onRejected, onProgress) {\n\t\tvar p = Promise.resolve(x);\n\t\tif (arguments.length < 2) {\n\t\t\treturn p;\n\t\t}\n\n\t\treturn p.then(onFulfilled, onRejected, onProgress);\n\t}\n\n\t/**\n\t * Creates a new promise whose fate is determined by resolver.\n\t * @param {function} resolver function(resolve, reject, notify)\n\t * @returns {Promise} promise whose fate is determine by resolver\n\t */\n\tfunction promise(resolver) {\n\t\treturn new Promise(resolver);\n\t}\n\n\t/**\n\t * Lift the supplied function, creating a version of f that returns\n\t * promises, and accepts promises as arguments.\n\t * @param {function} f\n\t * @returns {Function} version of f that returns promises\n\t */\n\tfunction lift(f) {\n\t\treturn function() {\n\t\t\tfor(var i=0, l=arguments.length, a=new Array(l); i 1 ? slice.call(arguments, 1) : [];\n\t\treturn function() {\n\t\t\treturn _apply(f, this, args.concat(slice.call(arguments)));\n\t\t};\n\t}\n\n\t/**\n\t * Lift all the functions/methods on src\n\t * @param {object|function} src source whose functions will be lifted\n\t * @param {function?} combine optional function for customizing the lifting\n\t * process. It is passed dst, the lifted function, and the property name of\n\t * the original function on src.\n\t * @param {(object|function)?} dst option destination host onto which to place lifted\n\t * functions. If not provided, liftAll returns a new object.\n\t * @returns {*} If dst is provided, returns dst with lifted functions as\n\t * properties. If dst not provided, returns a new object with lifted functions.\n\t */\n\tfunction liftAll(src, combine, dst) {\n\t\treturn _liftAll(lift, combine, dst, src);\n\t}\n\n\t/**\n\t * `promisify` is a version of `lift` that allows fine-grained control over the\n\t * arguments that passed to the underlying function. It is intended to handle\n\t * functions that don't follow the common callback and errback positions.\n\t *\n\t * The control is done by passing an object whose 'callback' and/or 'errback'\n\t * keys, whose values are the corresponding 0-based indexes of the arguments on\n\t * the function. Negative values are interpreted as being relative to the end\n\t * of the arguments array.\n\t *\n\t * If arguments are given on the call to the 'promisified' function, they are\n\t * intermingled with the callback and errback. If a promise is given among them,\n\t * the execution of the function will only occur after its resolution.\n\t *\n\t * @example\n\t * var delay = callbacks.promisify(setTimeout, {\n\t *\t\tcallback: 0\n\t *\t});\n\t *\n\t * delay(100).then(function() {\n\t *\t\tconsole.log(\"This happens 100ms afterwards\");\n\t *\t});\n\t *\n\t * @example\n\t * function callbackAsLast(errback, followsStandards, callback) {\n\t *\t\tif(followsStandards) {\n\t *\t\t\tcallback(\"well done!\");\n\t *\t\t} else {\n\t *\t\t\terrback(\"some programmers just want to watch the world burn\");\n\t *\t\t}\n\t *\t}\n\t *\n\t * var promisified = callbacks.promisify(callbackAsLast, {\n\t *\t\tcallback: -1,\n\t *\t\terrback: 0,\n\t *\t});\n\t *\n\t * promisified(true).then(console.log, console.error);\n\t * promisified(false).then(console.log, console.error);\n\t *\n\t * @param {Function} asyncFunction traditional function to be decorated\n\t * @param {object} positions\n\t * @param {number} [positions.callback] index at which asyncFunction expects to\n\t * receive a success callback\n\t * @param {number} [positions.errback] index at which asyncFunction expects to\n\t * receive an error callback\n\t * @returns {function} promisified function that accepts\n\t *\n\t * @deprecated\n\t */\n\tfunction promisify(asyncFunction, positions) {\n\n\t\treturn function() {\n\t\t\tvar thisArg = this;\n\t\t\treturn Promise.all(arguments).then(function(args) {\n\t\t\t\tvar p = Promise._defer();\n\n\t\t\t\tvar callbackPos, errbackPos;\n\n\t\t\t\tif(typeof positions.callback === 'number') {\n\t\t\t\t\tcallbackPos = normalizePosition(args, positions.callback);\n\t\t\t\t}\n\n\t\t\t\tif(typeof positions.errback === 'number') {\n\t\t\t\t\terrbackPos = normalizePosition(args, positions.errback);\n\t\t\t\t}\n\n\t\t\t\tif(errbackPos < callbackPos) {\n\t\t\t\t\tinsertCallback(args, errbackPos, p._handler.reject, p._handler);\n\t\t\t\t\tinsertCallback(args, callbackPos, p._handler.resolve, p._handler);\n\t\t\t\t} else {\n\t\t\t\t\tinsertCallback(args, callbackPos, p._handler.resolve, p._handler);\n\t\t\t\t\tinsertCallback(args, errbackPos, p._handler.reject, p._handler);\n\t\t\t\t}\n\n\t\t\t\tasyncFunction.apply(thisArg, args);\n\n\t\t\t\treturn p;\n\t\t\t});\n\t\t};\n\t}\n\n\tfunction normalizePosition(args, pos) {\n\t\treturn pos < 0 ? (args.length + pos + 2) : pos;\n\t}\n\n\tfunction insertCallback(args, pos, callback, thisArg) {\n\t\tif(typeof pos === 'number') {\n\t\t\targs.splice(pos, 0, alwaysUnary(callback, thisArg));\n\t\t}\n\t}\n\n\tfunction alwaysUnary(fn, thisArg) {\n\t\treturn function() {\n\t\t\tif (arguments.length > 1) {\n\t\t\t\tfn.call(thisArg, slice.call(arguments));\n\t\t\t} else {\n\t\t\t\tfn.apply(thisArg, arguments);\n\t\t\t}\n\t\t};\n\t}\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n","/** @license MIT License (c) copyright B Cavalier & J Hann */\n\n/**\n * cancelable.js\n * @deprecated\n *\n * Decorator that makes a deferred \"cancelable\". It adds a cancel() method that\n * will call a special cancel handler function and then reject the deferred. The\n * cancel handler can be used to do resource cleanup, or anything else that should\n * be done before any other rejection handlers are executed.\n *\n * Usage:\n *\n * var cancelableDeferred = cancelable(when.defer(), myCancelHandler);\n *\n * @author brian@hovercraftstudios.com\n */\n\n(function(define) {\ndefine(function() {\n\n /**\n * Makes deferred cancelable, adding a cancel() method.\n\t * @deprecated\n *\n * @param deferred {Deferred} the {@link Deferred} to make cancelable\n * @param canceler {Function} cancel handler function to execute when this deferred\n\t * is canceled. This is guaranteed to run before all other rejection handlers.\n\t * The canceler will NOT be executed if the deferred is rejected in the standard\n\t * way, i.e. deferred.reject(). It ONLY executes if the deferred is canceled,\n\t * i.e. deferred.cancel()\n *\n * @returns deferred, with an added cancel() method.\n */\n return function(deferred, canceler) {\n // Add a cancel method to the deferred to reject the delegate\n // with the special canceled indicator.\n deferred.cancel = function() {\n\t\t\ttry {\n\t\t\t\tdeferred.reject(canceler(deferred));\n\t\t\t} catch(e) {\n\t\t\t\tdeferred.reject(e);\n\t\t\t}\n\n\t\t\treturn deferred.promise;\n };\n\n return deferred;\n };\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(); });\n\n\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * delay.js\n *\n * Helper that returns a promise that resolves after a delay.\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\n /**\n\t * @deprecated Use when(value).delay(ms)\n */\n return function delay(msec, value) {\n\t\treturn when(value).delay(msec);\n };\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2013-2014 original author or authors */\n\n/**\n * Collection of helper functions for wrapping and executing 'traditional'\n * synchronous functions in a promise interface.\n *\n * @author Brian Cavalier\n * @contributor Renato Zannon\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar attempt = when['try'];\n\tvar _liftAll = require('./lib/liftAll');\n\tvar _apply = require('./lib/apply')(when.Promise);\n\tvar slice = Array.prototype.slice;\n\n\treturn {\n\t\tlift: lift,\n\t\tliftAll: liftAll,\n\t\tcall: attempt,\n\t\tapply: apply,\n\t\tcompose: compose\n\t};\n\n\t/**\n\t * Takes a function and an optional array of arguments (that might be promises),\n\t * and calls the function. The return value is a promise whose resolution\n\t * depends on the value returned by the function.\n\t * @param {function} f function to be called\n\t * @param {Array} [args] array of arguments to func\n\t * @returns {Promise} promise for the return value of func\n\t */\n\tfunction apply(f, args) {\n\t\t// slice args just in case the caller passed an Arguments instance\n\t\treturn _apply(f, this, args == null ? [] : slice.call(args));\n\t}\n\n\t/**\n\t * Takes a 'regular' function and returns a version of that function that\n\t * returns a promise instead of a plain value, and handles thrown errors by\n\t * returning a rejected promise. Also accepts a list of arguments to be\n\t * prepended to the new function, as does Function.prototype.bind.\n\t *\n\t * The resulting function is promise-aware, in the sense that it accepts\n\t * promise arguments, and waits for their resolution.\n\t * @param {Function} f function to be bound\n\t * @param {...*} [args] arguments to be prepended for the new function @deprecated\n\t * @returns {Function} a promise-returning function\n\t */\n\tfunction lift(f /*, args... */) {\n\t\tvar args = arguments.length > 1 ? slice.call(arguments, 1) : [];\n\t\treturn function() {\n\t\t\treturn _apply(f, this, args.concat(slice.call(arguments)));\n\t\t};\n\t}\n\n\t/**\n\t * Lift all the functions/methods on src\n\t * @param {object|function} src source whose functions will be lifted\n\t * @param {function?} combine optional function for customizing the lifting\n\t * process. It is passed dst, the lifted function, and the property name of\n\t * the original function on src.\n\t * @param {(object|function)?} dst option destination host onto which to place lifted\n\t * functions. If not provided, liftAll returns a new object.\n\t * @returns {*} If dst is provided, returns dst with lifted functions as\n\t * properties. If dst not provided, returns a new object with lifted functions.\n\t */\n\tfunction liftAll(src, combine, dst) {\n\t\treturn _liftAll(lift, combine, dst, src);\n\t}\n\n\t/**\n\t * Composes multiple functions by piping their return values. It is\n\t * transparent to whether the functions return 'regular' values or promises:\n\t * the piped argument is always a resolved value. If one of the functions\n\t * throws or returns a rejected promise, the composed promise will be also\n\t * rejected.\n\t *\n\t * The arguments (or promises to arguments) given to the returned function (if\n\t * any), are passed directly to the first function on the 'pipeline'.\n\t * @param {Function} f the function to which the arguments will be passed\n\t * @param {...Function} [funcs] functions that will be composed, in order\n\t * @returns {Function} a promise-returning composition of the functions\n\t */\n\tfunction compose(f /*, funcs... */) {\n\t\tvar funcs = slice.call(arguments, 1);\n\n\t\treturn function() {\n\t\t\tvar thisArg = this;\n\t\t\tvar args = slice.call(arguments);\n\t\t\tvar firstPromise = attempt.apply(thisArg, [f].concat(args));\n\n\t\t\treturn when.reduce(funcs, function(arg, func) {\n\t\t\t\treturn func.call(thisArg, arg);\n\t\t\t}, firstPromise);\n\t\t};\n\t}\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * Generalized promise concurrency guard\n * Adapted from original concept by Sakari Jokinen (Rocket Pack, Ltd.)\n *\n * @author Brian Cavalier\n * @author John Hann\n * @contributor Sakari Jokinen\n */\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar slice = Array.prototype.slice;\n\n\tguard.n = n;\n\n\treturn guard;\n\n\t/**\n\t * Creates a guarded version of f that can only be entered when the supplied\n\t * condition allows.\n\t * @param {function} condition represents a critical section that may only\n\t * be entered when allowed by the condition\n\t * @param {function} f function to guard\n\t * @returns {function} guarded version of f\n\t */\n\tfunction guard(condition, f) {\n\t\treturn function() {\n\t\t\tvar args = slice.call(arguments);\n\n\t\t\treturn when(condition()).withThis(this).then(function(exit) {\n\t\t\t\treturn when(f.apply(this, args))['finally'](exit);\n\t\t\t});\n\t\t};\n\t}\n\n\t/**\n\t * Creates a condition that allows only n simultaneous executions\n\t * of a guarded function\n\t * @param {number} allowed number of allowed simultaneous executions\n\t * @returns {function} condition function which returns a promise that\n\t * fulfills when the critical section may be entered. The fulfillment\n\t * value is a function (\"notifyExit\") that must be called when the critical\n\t * section has been exited.\n\t */\n\tfunction n(allowed) {\n\t\tvar count = 0;\n\t\tvar waiting = [];\n\n\t\treturn function enter() {\n\t\t\treturn when.promise(function(resolve) {\n\t\t\t\tif(count < allowed) {\n\t\t\t\t\tresolve(exit);\n\t\t\t\t} else {\n\t\t\t\t\twaiting.push(resolve);\n\t\t\t\t}\n\t\t\t\tcount += 1;\n\t\t\t});\n\t\t};\n\n\t\tfunction exit() {\n\t\t\tcount = Math.max(count - 1, 0);\n\t\t\tif(waiting.length > 0) {\n\t\t\t\twaiting.shift()(exit);\n\t\t\t}\n\t\t}\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * Licensed under the MIT License at:\n * http://www.opensource.org/licenses/mit-license.php\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar Promise = when.Promise;\n\tvar toPromise = when.resolve;\n\n\treturn {\n\t\tall: when.lift(all),\n\t\tmap: map,\n\t\tsettle: settle\n\t};\n\n\t/**\n\t * Resolve all the key-value pairs in the supplied object or promise\n\t * for an object.\n\t * @param {Promise|object} object or promise for object whose key-value pairs\n\t * will be resolved\n\t * @returns {Promise} promise for an object with the fully resolved key-value pairs\n\t */\n\tfunction all(object) {\n\t\tvar p = Promise._defer();\n\t\tvar resolver = Promise._handler(p);\n\n\t\tvar results = {};\n\t\tvar keys = Object.keys(object);\n\t\tvar pending = keys.length;\n\n\t\tfor(var i=0, k; i>>0;\n\n\t\t\tvar pending = l;\n\t\t\tvar errors = [];\n\n\t\t\tfor (var h, x, i = 0; i < l; ++i) {\n\t\t\t\tx = promises[i];\n\t\t\t\tif(x === void 0 && !(i in promises)) {\n\t\t\t\t\t--pending;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\th = Promise._handler(x);\n\t\t\t\tif(h.state() > 0) {\n\t\t\t\t\tresolver.become(h);\n\t\t\t\t\tPromise._visitRemaining(promises, i, h);\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\th.visit(resolver, handleFulfill, handleReject);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(pending === 0) {\n\t\t\t\tresolver.reject(new RangeError('any(): array must not be empty'));\n\t\t\t}\n\n\t\t\treturn p;\n\n\t\t\tfunction handleFulfill(x) {\n\t\t\t\t/*jshint validthis:true*/\n\t\t\t\terrors = null;\n\t\t\t\tthis.resolve(x); // this === resolver\n\t\t\t}\n\n\t\t\tfunction handleReject(e) {\n\t\t\t\t/*jshint validthis:true*/\n\t\t\t\tif(this.resolved) { // this === resolver\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\terrors.push(e);\n\t\t\t\tif(--pending === 0) {\n\t\t\t\t\tthis.reject(errors);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * N-winner competitive race\n\t\t * Return a promise that will fulfill when n input promises have\n\t\t * fulfilled, or will reject when it becomes impossible for n\n\t\t * input promises to fulfill (ie when promises.length - n + 1\n\t\t * have rejected)\n\t\t * @param {array} promises\n\t\t * @param {number} n\n\t\t * @returns {Promise} promise for the earliest n fulfillment values\n\t\t *\n\t\t * @deprecated\n\t\t */\n\t\tfunction some(promises, n) {\n\t\t\t/*jshint maxcomplexity:7*/\n\t\t\tvar p = Promise._defer();\n\t\t\tvar resolver = p._handler;\n\n\t\t\tvar results = [];\n\t\t\tvar errors = [];\n\n\t\t\tvar l = promises.length>>>0;\n\t\t\tvar nFulfill = 0;\n\t\t\tvar nReject;\n\t\t\tvar x, i; // reused in both for() loops\n\n\t\t\t// First pass: count actual array items\n\t\t\tfor(i=0; i nFulfill) {\n\t\t\t\tresolver.reject(new RangeError('some(): array must contain at least '\n\t\t\t\t+ n + ' item(s), but had ' + nFulfill));\n\t\t\t} else if(nFulfill === 0) {\n\t\t\t\tresolver.resolve(results);\n\t\t\t}\n\n\t\t\t// Second pass: observe each array item, make progress toward goals\n\t\t\tfor(i=0; i 2 ? ar.call(promises, liftCombine(f), arguments[2])\n\t\t\t\t\t: ar.call(promises, liftCombine(f));\n\t\t}\n\n\t\t/**\n\t\t * Traditional reduce function, similar to `Array.prototype.reduceRight()`, but\n\t\t * input may contain promises and/or values, and reduceFunc\n\t\t * may return either a value or a promise, *and* initialValue may\n\t\t * be a promise for the starting value.\n\t\t * @param {Array|Promise} promises array or promise for an array of anything,\n\t\t * may contain a mix of promises and values.\n\t\t * @param {function(accumulated:*, x:*, index:Number):*} f reduce function\n\t\t * @returns {Promise} that will resolve to the final reduced value\n\t\t */\n\t\tfunction reduceRight(promises, f /*, initialValue */) {\n\t\t\treturn arguments.length > 2 ? arr.call(promises, liftCombine(f), arguments[2])\n\t\t\t\t\t: arr.call(promises, liftCombine(f));\n\t\t}\n\n\t\tfunction liftCombine(f) {\n\t\t\treturn function(z, x, i) {\n\t\t\t\treturn applyFold(f, void 0, [z,x,i]);\n\t\t\t};\n\t\t}\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function flow(Promise) {\n\n\t\tvar resolve = Promise.resolve;\n\t\tvar reject = Promise.reject;\n\t\tvar origCatch = Promise.prototype['catch'];\n\n\t\t/**\n\t\t * Handle the ultimate fulfillment value or rejection reason, and assume\n\t\t * responsibility for all errors. If an error propagates out of result\n\t\t * or handleFatalError, it will be rethrown to the host, resulting in a\n\t\t * loud stack track on most platforms and a crash on some.\n\t\t * @param {function?} onResult\n\t\t * @param {function?} onError\n\t\t * @returns {undefined}\n\t\t */\n\t\tPromise.prototype.done = function(onResult, onError) {\n\t\t\tthis._handler.visit(this._handler.receiver, onResult, onError);\n\t\t};\n\n\t\t/**\n\t\t * Add Error-type and predicate matching to catch. Examples:\n\t\t * promise.catch(TypeError, handleTypeError)\n\t\t * .catch(predicate, handleMatchedErrors)\n\t\t * .catch(handleRemainingErrors)\n\t\t * @param onRejected\n\t\t * @returns {*}\n\t\t */\n\t\tPromise.prototype['catch'] = Promise.prototype.otherwise = function(onRejected) {\n\t\t\tif (arguments.length < 2) {\n\t\t\t\treturn origCatch.call(this, onRejected);\n\t\t\t}\n\n\t\t\tif(typeof onRejected !== 'function') {\n\t\t\t\treturn this.ensure(rejectInvalidPredicate);\n\t\t\t}\n\n\t\t\treturn origCatch.call(this, createCatchFilter(arguments[1], onRejected));\n\t\t};\n\n\t\t/**\n\t\t * Wraps the provided catch handler, so that it will only be called\n\t\t * if the predicate evaluates truthy\n\t\t * @param {?function} handler\n\t\t * @param {function} predicate\n\t\t * @returns {function} conditional catch handler\n\t\t */\n\t\tfunction createCatchFilter(handler, predicate) {\n\t\t\treturn function(e) {\n\t\t\t\treturn evaluatePredicate(e, predicate)\n\t\t\t\t\t? handler.call(this, e)\n\t\t\t\t\t: reject(e);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Ensures that onFulfilledOrRejected will be called regardless of whether\n\t\t * this promise is fulfilled or rejected. onFulfilledOrRejected WILL NOT\n\t\t * receive the promises' value or reason. Any returned value will be disregarded.\n\t\t * onFulfilledOrRejected may throw or return a rejected promise to signal\n\t\t * an additional error.\n\t\t * @param {function} handler handler to be called regardless of\n\t\t * fulfillment or rejection\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype['finally'] = Promise.prototype.ensure = function(handler) {\n\t\t\tif(typeof handler !== 'function') {\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\treturn this.then(function(x) {\n\t\t\t\treturn runSideEffect(handler, this, identity, x);\n\t\t\t}, function(e) {\n\t\t\t\treturn runSideEffect(handler, this, reject, e);\n\t\t\t});\n\t\t};\n\n\t\tfunction runSideEffect (handler, thisArg, propagate, value) {\n\t\t\tvar result = handler.call(thisArg);\n\t\t\treturn maybeThenable(result)\n\t\t\t\t? propagateValue(result, propagate, value)\n\t\t\t\t: propagate(value);\n\t\t}\n\n\t\tfunction propagateValue (result, propagate, x) {\n\t\t\treturn resolve(result).then(function () {\n\t\t\t\treturn propagate(x);\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Recover from a failure by returning a defaultValue. If defaultValue\n\t\t * is a promise, it's fulfillment value will be used. If defaultValue is\n\t\t * a promise that rejects, the returned promise will reject with the\n\t\t * same reason.\n\t\t * @param {*} defaultValue\n\t\t * @returns {Promise} new promise\n\t\t */\n\t\tPromise.prototype['else'] = Promise.prototype.orElse = function(defaultValue) {\n\t\t\treturn this.then(void 0, function() {\n\t\t\t\treturn defaultValue;\n\t\t\t});\n\t\t};\n\n\t\t/**\n\t\t * Shortcut for .then(function() { return value; })\n\t\t * @param {*} value\n\t\t * @return {Promise} a promise that:\n\t\t * - is fulfilled if value is not a promise, or\n\t\t * - if value is a promise, will fulfill with its value, or reject\n\t\t * with its reason.\n\t\t */\n\t\tPromise.prototype['yield'] = function(value) {\n\t\t\treturn this.then(function() {\n\t\t\t\treturn value;\n\t\t\t});\n\t\t};\n\n\t\t/**\n\t\t * Runs a side effect when this promise fulfills, without changing the\n\t\t * fulfillment value.\n\t\t * @param {function} onFulfilledSideEffect\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype.tap = function(onFulfilledSideEffect) {\n\t\t\treturn this.then(onFulfilledSideEffect)['yield'](this);\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n\tfunction rejectInvalidPredicate() {\n\t\tthrow new TypeError('catch predicate must be a function');\n\t}\n\n\tfunction evaluatePredicate(e, predicate) {\n\t\treturn isError(predicate) ? e instanceof predicate : predicate(e);\n\t}\n\n\tfunction isError(predicate) {\n\t\treturn predicate === Error\n\t\t\t|| (predicate != null && predicate.prototype instanceof Error);\n\t}\n\n\tfunction maybeThenable(x) {\n\t\treturn (typeof x === 'object' || typeof x === 'function') && x !== null;\n\t}\n\n\tfunction identity(x) {\n\t\treturn x;\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n/** @author Jeff Escalante */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function fold(Promise) {\n\n\t\tPromise.prototype.fold = function(f, z) {\n\t\t\tvar promise = this._beget();\n\n\t\t\tthis._handler.fold(function(z, x, to) {\n\t\t\t\tPromise._handler(z).fold(function(x, z, to) {\n\t\t\t\t\tto.resolve(f.call(this, z, x));\n\t\t\t\t}, x, this, to);\n\t\t\t}, z, promise._handler.receiver, promise._handler);\n\n\t\t\treturn promise;\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar inspect = require('../state').inspect;\n\n\treturn function inspection(Promise) {\n\n\t\tPromise.prototype.inspect = function() {\n\t\t\treturn inspect(Promise._handler(this));\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function generate(Promise) {\n\n\t\tvar resolve = Promise.resolve;\n\n\t\tPromise.iterate = iterate;\n\t\tPromise.unfold = unfold;\n\n\t\treturn Promise;\n\n\t\t/**\n\t\t * @deprecated Use github.com/cujojs/most streams and most.iterate\n\t\t * Generate a (potentially infinite) stream of promised values:\n\t\t * x, f(x), f(f(x)), etc. until condition(x) returns true\n\t\t * @param {function} f function to generate a new x from the previous x\n\t\t * @param {function} condition function that, given the current x, returns\n\t\t * truthy when the iterate should stop\n\t\t * @param {function} handler function to handle the value produced by f\n\t\t * @param {*|Promise} x starting value, may be a promise\n\t\t * @return {Promise} the result of the last call to f before\n\t\t * condition returns true\n\t\t */\n\t\tfunction iterate(f, condition, handler, x) {\n\t\t\treturn unfold(function(x) {\n\t\t\t\treturn [x, f(x)];\n\t\t\t}, condition, handler, x);\n\t\t}\n\n\t\t/**\n\t\t * @deprecated Use github.com/cujojs/most streams and most.unfold\n\t\t * Generate a (potentially infinite) stream of promised values\n\t\t * by applying handler(generator(seed)) iteratively until\n\t\t * condition(seed) returns true.\n\t\t * @param {function} unspool function that generates a [value, newSeed]\n\t\t * given a seed.\n\t\t * @param {function} condition function that, given the current seed, returns\n\t\t * truthy when the unfold should stop\n\t\t * @param {function} handler function to handle the value produced by unspool\n\t\t * @param x {*|Promise} starting value, may be a promise\n\t\t * @return {Promise} the result of the last value produced by unspool before\n\t\t * condition returns true\n\t\t */\n\t\tfunction unfold(unspool, condition, handler, x) {\n\t\t\treturn resolve(x).then(function(seed) {\n\t\t\t\treturn resolve(condition(seed)).then(function(done) {\n\t\t\t\t\treturn done ? seed : resolve(unspool(seed)).spread(next);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tfunction next(item, newSeed) {\n\t\t\t\treturn resolve(handler(item)).then(function() {\n\t\t\t\t\treturn unfold(unspool, condition, handler, newSeed);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function progress(Promise) {\n\n\t\t/**\n\t\t * @deprecated\n\t\t * Register a progress handler for this promise\n\t\t * @param {function} onProgress\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype.progress = function(onProgress) {\n\t\t\treturn this.then(void 0, void 0, onProgress);\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar env = require('../env');\n\tvar TimeoutError = require('../TimeoutError');\n\n\tfunction setTimeout(f, ms, x, y) {\n\t\treturn env.setTimer(function() {\n\t\t\tf(x, y, ms);\n\t\t}, ms);\n\t}\n\n\treturn function timed(Promise) {\n\t\t/**\n\t\t * Return a new promise whose fulfillment value is revealed only\n\t\t * after ms milliseconds\n\t\t * @param {number} ms milliseconds\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype.delay = function(ms) {\n\t\t\tvar p = this._beget();\n\t\t\tthis._handler.fold(handleDelay, ms, void 0, p._handler);\n\t\t\treturn p;\n\t\t};\n\n\t\tfunction handleDelay(ms, x, h) {\n\t\t\tsetTimeout(resolveDelay, ms, x, h);\n\t\t}\n\n\t\tfunction resolveDelay(x, h) {\n\t\t\th.resolve(x);\n\t\t}\n\n\t\t/**\n\t\t * Return a new promise that rejects after ms milliseconds unless\n\t\t * this promise fulfills earlier, in which case the returned promise\n\t\t * fulfills with the same value.\n\t\t * @param {number} ms milliseconds\n\t\t * @param {Error|*=} reason optional rejection reason to use, defaults\n\t\t * to a TimeoutError if not provided\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype.timeout = function(ms, reason) {\n\t\t\tvar p = this._beget();\n\t\t\tvar h = p._handler;\n\n\t\t\tvar t = setTimeout(onTimeout, ms, reason, p._handler);\n\n\t\t\tthis._handler.visit(h,\n\t\t\t\tfunction onFulfill(x) {\n\t\t\t\t\tenv.clearTimer(t);\n\t\t\t\t\tthis.resolve(x); // this = h\n\t\t\t\t},\n\t\t\t\tfunction onReject(x) {\n\t\t\t\t\tenv.clearTimer(t);\n\t\t\t\t\tthis.reject(x); // this = h\n\t\t\t\t},\n\t\t\t\th.notify);\n\n\t\t\treturn p;\n\t\t};\n\n\t\tfunction onTimeout(reason, h, ms) {\n\t\t\tvar e = typeof reason === 'undefined'\n\t\t\t\t? new TimeoutError('timed out after ' + ms + 'ms')\n\t\t\t\t: reason;\n\t\t\th.reject(e);\n\t\t}\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar setTimer = require('../env').setTimer;\n\tvar format = require('../format');\n\n\treturn function unhandledRejection(Promise) {\n\n\t\tvar logError = noop;\n\t\tvar logInfo = noop;\n\t\tvar localConsole;\n\n\t\tif(typeof console !== 'undefined') {\n\t\t\t// Alias console to prevent things like uglify's drop_console option from\n\t\t\t// removing console.log/error. Unhandled rejections fall into the same\n\t\t\t// category as uncaught exceptions, and build tools shouldn't silence them.\n\t\t\tlocalConsole = console;\n\t\t\tlogError = typeof localConsole.error !== 'undefined'\n\t\t\t\t? function (e) { localConsole.error(e); }\n\t\t\t\t: function (e) { localConsole.log(e); };\n\n\t\t\tlogInfo = typeof localConsole.info !== 'undefined'\n\t\t\t\t? function (e) { localConsole.info(e); }\n\t\t\t\t: function (e) { localConsole.log(e); };\n\t\t}\n\n\t\tPromise.onPotentiallyUnhandledRejection = function(rejection) {\n\t\t\tenqueue(report, rejection);\n\t\t};\n\n\t\tPromise.onPotentiallyUnhandledRejectionHandled = function(rejection) {\n\t\t\tenqueue(unreport, rejection);\n\t\t};\n\n\t\tPromise.onFatalRejection = function(rejection) {\n\t\t\tenqueue(throwit, rejection.value);\n\t\t};\n\n\t\tvar tasks = [];\n\t\tvar reported = [];\n\t\tvar running = null;\n\n\t\tfunction report(r) {\n\t\t\tif(!r.handled) {\n\t\t\t\treported.push(r);\n\t\t\t\tlogError('Potentially unhandled rejection [' + r.id + '] ' + format.formatError(r.value));\n\t\t\t}\n\t\t}\n\n\t\tfunction unreport(r) {\n\t\t\tvar i = reported.indexOf(r);\n\t\t\tif(i >= 0) {\n\t\t\t\treported.splice(i, 1);\n\t\t\t\tlogInfo('Handled previous rejection [' + r.id + '] ' + format.formatObject(r.value));\n\t\t\t}\n\t\t}\n\n\t\tfunction enqueue(f, x) {\n\t\t\ttasks.push(f, x);\n\t\t\tif(running === null) {\n\t\t\t\trunning = setTimer(flush, 0);\n\t\t\t}\n\t\t}\n\n\t\tfunction flush() {\n\t\t\trunning = null;\n\t\t\twhile(tasks.length > 0) {\n\t\t\t\ttasks.shift()(tasks.shift());\n\t\t\t}\n\t\t}\n\n\t\treturn Promise;\n\t};\n\n\tfunction throwit(e) {\n\t\tthrow e;\n\t}\n\n\tfunction noop() {}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function addWith(Promise) {\n\t\t/**\n\t\t * Returns a promise whose handlers will be called with `this` set to\n\t\t * the supplied receiver. Subsequent promises derived from the\n\t\t * returned promise will also have their handlers called with receiver\n\t\t * as `this`. Calling `with` with undefined or no arguments will return\n\t\t * a promise whose handlers will again be called in the usual Promises/A+\n\t\t * way (no `this`) thus safely undoing any previous `with` in the\n\t\t * promise chain.\n\t\t *\n\t\t * WARNING: Promises returned from `with`/`withThis` are NOT Promises/A+\n\t\t * compliant, specifically violating 2.2.5 (http://promisesaplus.com/#point-41)\n\t\t *\n\t\t * @param {object} receiver `this` value for all handlers attached to\n\t\t * the returned promise.\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype['with'] = Promise.prototype.withThis = function(receiver) {\n\t\t\tvar p = this._beget();\n\t\t\tvar child = p._handler;\n\t\t\tchild.receiver = receiver;\n\t\t\tthis._handler.chain(child, receiver);\n\t\t\treturn p;\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n/*global process,document,setTimeout,clearTimeout,MutationObserver,WebKitMutationObserver*/\n(function(define) { 'use strict';\ndefine(function(require) {\n\t/*jshint maxcomplexity:6*/\n\n\t// Sniff \"best\" async scheduling option\n\t// Prefer process.nextTick or MutationObserver, then check for\n\t// setTimeout, and finally vertx, since its the only env that doesn't\n\t// have setTimeout\n\n\tvar MutationObs;\n\tvar capturedSetTimeout = typeof setTimeout !== 'undefined' && setTimeout;\n\n\t// Default env\n\tvar setTimer = function(f, ms) { return setTimeout(f, ms); };\n\tvar clearTimer = function(t) { return clearTimeout(t); };\n\tvar asap = function (f) { return capturedSetTimeout(f, 0); };\n\n\t// Detect specific env\n\tif (isNode()) { // Node\n\t\tasap = function (f) { return process.nextTick(f); };\n\n\t} else if (MutationObs = hasMutationObserver()) { // Modern browser\n\t\tasap = initMutationObserver(MutationObs);\n\n\t} else if (!capturedSetTimeout) { // vert.x\n\t\tvar vertxRequire = require;\n\t\tvar vertx = vertxRequire('vertx');\n\t\tsetTimer = function (f, ms) { return vertx.setTimer(ms, f); };\n\t\tclearTimer = vertx.cancelTimer;\n\t\tasap = vertx.runOnLoop || vertx.runOnContext;\n\t}\n\n\treturn {\n\t\tsetTimer: setTimer,\n\t\tclearTimer: clearTimer,\n\t\tasap: asap\n\t};\n\n\tfunction isNode () {\n\t\treturn typeof process !== 'undefined' &&\n\t\t\tObject.prototype.toString.call(process) === '[object process]';\n\t}\n\n\tfunction hasMutationObserver () {\n\t\treturn (typeof MutationObserver === 'function' && MutationObserver) ||\n\t\t\t(typeof WebKitMutationObserver === 'function' && WebKitMutationObserver);\n\t}\n\n\tfunction initMutationObserver(MutationObserver) {\n\t\tvar scheduled;\n\t\tvar node = document.createTextNode('');\n\t\tvar o = new MutationObserver(run);\n\t\to.observe(node, { characterData: true });\n\n\t\tfunction run() {\n\t\t\tvar f = scheduled;\n\t\t\tscheduled = void 0;\n\t\t\tf();\n\t\t}\n\n\t\tvar i = 0;\n\t\treturn function (f) {\n\t\t\tscheduled = f;\n\t\t\tnode.data = (i ^= 1);\n\t\t};\n\t}\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn {\n\t\tformatError: formatError,\n\t\tformatObject: formatObject,\n\t\ttryStringify: tryStringify\n\t};\n\n\t/**\n\t * Format an error into a string. If e is an Error and has a stack property,\n\t * it's returned. Otherwise, e is formatted using formatObject, with a\n\t * warning added about e not being a proper Error.\n\t * @param {*} e\n\t * @returns {String} formatted string, suitable for output to developers\n\t */\n\tfunction formatError(e) {\n\t\tvar s = typeof e === 'object' && e !== null && (e.stack || e.message) ? e.stack || e.message : formatObject(e);\n\t\treturn e instanceof Error ? s : s + ' (WARNING: non-Error used)';\n\t}\n\n\t/**\n\t * Format an object, detecting \"plain\" objects and running them through\n\t * JSON.stringify if possible.\n\t * @param {Object} o\n\t * @returns {string}\n\t */\n\tfunction formatObject(o) {\n\t\tvar s = String(o);\n\t\tif(s === '[object Object]' && typeof JSON !== 'undefined') {\n\t\t\ts = tryStringify(o, s);\n\t\t}\n\t\treturn s;\n\t}\n\n\t/**\n\t * Try to return the result of JSON.stringify(x). If that fails, return\n\t * defaultValue\n\t * @param {*} x\n\t * @param {*} defaultValue\n\t * @returns {String|*} JSON.stringify(x) or defaultValue\n\t */\n\tfunction tryStringify(x, defaultValue) {\n\t\ttry {\n\t\t\treturn JSON.stringify(x);\n\t\t} catch(e) {\n\t\t\treturn defaultValue;\n\t\t}\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function liftAll(liftOne, combine, dst, src) {\n\t\tif(typeof combine === 'undefined') {\n\t\t\tcombine = defaultCombine;\n\t\t}\n\n\t\treturn Object.keys(src).reduce(function(dst, key) {\n\t\t\tvar f = src[key];\n\t\t\treturn typeof f === 'function' ? combine(dst, liftOne(f), key) : dst;\n\t\t}, typeof dst === 'undefined' ? defaultDst(src) : dst);\n\t};\n\n\tfunction defaultCombine(o, f, k) {\n\t\to[k] = f;\n\t\treturn o;\n\t}\n\n\tfunction defaultDst(src) {\n\t\treturn typeof src === 'function' ? src.bind() : Object.create(src);\n\t}\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function makePromise(environment) {\n\n\t\tvar tasks = environment.scheduler;\n\t\tvar emitRejection = initEmitRejection();\n\n\t\tvar objectCreate = Object.create ||\n\t\t\tfunction(proto) {\n\t\t\t\tfunction Child() {}\n\t\t\t\tChild.prototype = proto;\n\t\t\t\treturn new Child();\n\t\t\t};\n\n\t\t/**\n\t\t * Create a promise whose fate is determined by resolver\n\t\t * @constructor\n\t\t * @returns {Promise} promise\n\t\t * @name Promise\n\t\t */\n\t\tfunction Promise(resolver, handler) {\n\t\t\tthis._handler = resolver === Handler ? handler : init(resolver);\n\t\t}\n\n\t\t/**\n\t\t * Run the supplied resolver\n\t\t * @param resolver\n\t\t * @returns {Pending}\n\t\t */\n\t\tfunction init(resolver) {\n\t\t\tvar handler = new Pending();\n\n\t\t\ttry {\n\t\t\t\tresolver(promiseResolve, promiseReject, promiseNotify);\n\t\t\t} catch (e) {\n\t\t\t\tpromiseReject(e);\n\t\t\t}\n\n\t\t\treturn handler;\n\n\t\t\t/**\n\t\t\t * Transition from pre-resolution state to post-resolution state, notifying\n\t\t\t * all listeners of the ultimate fulfillment or rejection\n\t\t\t * @param {*} x resolution value\n\t\t\t */\n\t\t\tfunction promiseResolve (x) {\n\t\t\t\thandler.resolve(x);\n\t\t\t}\n\t\t\t/**\n\t\t\t * Reject this promise with reason, which will be used verbatim\n\t\t\t * @param {Error|*} reason rejection reason, strongly suggested\n\t\t\t * to be an Error type\n\t\t\t */\n\t\t\tfunction promiseReject (reason) {\n\t\t\t\thandler.reject(reason);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * @deprecated\n\t\t\t * Issue a progress event, notifying all progress listeners\n\t\t\t * @param {*} x progress event payload to pass to all listeners\n\t\t\t */\n\t\t\tfunction promiseNotify (x) {\n\t\t\t\thandler.notify(x);\n\t\t\t}\n\t\t}\n\n\t\t// Creation\n\n\t\tPromise.resolve = resolve;\n\t\tPromise.reject = reject;\n\t\tPromise.never = never;\n\n\t\tPromise._defer = defer;\n\t\tPromise._handler = getHandler;\n\n\t\t/**\n\t\t * Returns a trusted promise. If x is already a trusted promise, it is\n\t\t * returned, otherwise returns a new trusted Promise which follows x.\n\t\t * @param {*} x\n\t\t * @return {Promise} promise\n\t\t */\n\t\tfunction resolve(x) {\n\t\t\treturn isPromise(x) ? x\n\t\t\t\t: new Promise(Handler, new Async(getHandler(x)));\n\t\t}\n\n\t\t/**\n\t\t * Return a reject promise with x as its reason (x is used verbatim)\n\t\t * @param {*} x\n\t\t * @returns {Promise} rejected promise\n\t\t */\n\t\tfunction reject(x) {\n\t\t\treturn new Promise(Handler, new Async(new Rejected(x)));\n\t\t}\n\n\t\t/**\n\t\t * Return a promise that remains pending forever\n\t\t * @returns {Promise} forever-pending promise.\n\t\t */\n\t\tfunction never() {\n\t\t\treturn foreverPendingPromise; // Should be frozen\n\t\t}\n\n\t\t/**\n\t\t * Creates an internal {promise, resolver} pair\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tfunction defer() {\n\t\t\treturn new Promise(Handler, new Pending());\n\t\t}\n\n\t\t// Transformation and flow control\n\n\t\t/**\n\t\t * Transform this promise's fulfillment value, returning a new Promise\n\t\t * for the transformed result. If the promise cannot be fulfilled, onRejected\n\t\t * is called with the reason. onProgress *may* be called with updates toward\n\t\t * this promise's fulfillment.\n\t\t * @param {function=} onFulfilled fulfillment handler\n\t\t * @param {function=} onRejected rejection handler\n\t\t * @param {function=} onProgress @deprecated progress handler\n\t\t * @return {Promise} new promise\n\t\t */\n\t\tPromise.prototype.then = function(onFulfilled, onRejected, onProgress) {\n\t\t\tvar parent = this._handler;\n\t\t\tvar state = parent.join().state();\n\n\t\t\tif ((typeof onFulfilled !== 'function' && state > 0) ||\n\t\t\t\t(typeof onRejected !== 'function' && state < 0)) {\n\t\t\t\t// Short circuit: value will not change, simply share handler\n\t\t\t\treturn new this.constructor(Handler, parent);\n\t\t\t}\n\n\t\t\tvar p = this._beget();\n\t\t\tvar child = p._handler;\n\n\t\t\tparent.chain(child, parent.receiver, onFulfilled, onRejected, onProgress);\n\n\t\t\treturn p;\n\t\t};\n\n\t\t/**\n\t\t * If this promise cannot be fulfilled due to an error, call onRejected to\n\t\t * handle the error. Shortcut for .then(undefined, onRejected)\n\t\t * @param {function?} onRejected\n\t\t * @return {Promise}\n\t\t */\n\t\tPromise.prototype['catch'] = function(onRejected) {\n\t\t\treturn this.then(void 0, onRejected);\n\t\t};\n\n\t\t/**\n\t\t * Creates a new, pending promise of the same type as this promise\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype._beget = function() {\n\t\t\treturn begetFrom(this._handler, this.constructor);\n\t\t};\n\n\t\tfunction begetFrom(parent, Promise) {\n\t\t\tvar child = new Pending(parent.receiver, parent.join().context);\n\t\t\treturn new Promise(Handler, child);\n\t\t}\n\n\t\t// Array combinators\n\n\t\tPromise.all = all;\n\t\tPromise.race = race;\n\t\tPromise._traverse = traverse;\n\n\t\t/**\n\t\t * Return a promise that will fulfill when all promises in the\n\t\t * input array have fulfilled, or will reject when one of the\n\t\t * promises rejects.\n\t\t * @param {array} promises array of promises\n\t\t * @returns {Promise} promise for array of fulfillment values\n\t\t */\n\t\tfunction all(promises) {\n\t\t\treturn traverseWith(snd, null, promises);\n\t\t}\n\n\t\t/**\n\t\t * Array> -> Promise>\n\t\t * @private\n\t\t * @param {function} f function to apply to each promise's value\n\t\t * @param {Array} promises array of promises\n\t\t * @returns {Promise} promise for transformed values\n\t\t */\n\t\tfunction traverse(f, promises) {\n\t\t\treturn traverseWith(tryCatch2, f, promises);\n\t\t}\n\n\t\tfunction traverseWith(tryMap, f, promises) {\n\t\t\tvar handler = typeof f === 'function' ? mapAt : settleAt;\n\n\t\t\tvar resolver = new Pending();\n\t\t\tvar pending = promises.length >>> 0;\n\t\t\tvar results = new Array(pending);\n\n\t\t\tfor (var i = 0, x; i < promises.length && !resolver.resolved; ++i) {\n\t\t\t\tx = promises[i];\n\n\t\t\t\tif (x === void 0 && !(i in promises)) {\n\t\t\t\t\t--pending;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttraverseAt(promises, handler, i, x, resolver);\n\t\t\t}\n\n\t\t\tif(pending === 0) {\n\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t}\n\n\t\t\treturn new Promise(Handler, resolver);\n\n\t\t\tfunction mapAt(i, x, resolver) {\n\t\t\t\tif(!resolver.resolved) {\n\t\t\t\t\ttraverseAt(promises, settleAt, i, tryMap(f, x, i), resolver);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction settleAt(i, x, resolver) {\n\t\t\t\tresults[i] = x;\n\t\t\t\tif(--pending === 0) {\n\t\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction traverseAt(promises, handler, i, x, resolver) {\n\t\t\tif (maybeThenable(x)) {\n\t\t\t\tvar h = getHandlerMaybeThenable(x);\n\t\t\t\tvar s = h.state();\n\n\t\t\t\tif (s === 0) {\n\t\t\t\t\th.fold(handler, i, void 0, resolver);\n\t\t\t\t} else if (s > 0) {\n\t\t\t\t\thandler(i, h.value, resolver);\n\t\t\t\t} else {\n\t\t\t\t\tresolver.become(h);\n\t\t\t\t\tvisitRemaining(promises, i+1, h);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thandler(i, x, resolver);\n\t\t\t}\n\t\t}\n\n\t\tPromise._visitRemaining = visitRemaining;\n\t\tfunction visitRemaining(promises, start, handler) {\n\t\t\tfor(var i=start; i 0 ? toFulfilledState(handler.value)\n\t\t\t : toRejectedState(handler.value);\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2013 original author or authors */\n\n/**\n * Collection of helpers for interfacing with node-style asynchronous functions\n * using promises.\n *\n * @author Brian Cavalier\n * @contributor Renato Zannon\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar _liftAll = require('./lib/liftAll');\n\tvar setTimer = require('./lib/env').setTimer;\n\tvar slice = Array.prototype.slice;\n\n\tvar _apply = require('./lib/apply')(when.Promise, dispatch);\n\n\treturn {\n\t\tlift: lift,\n\t\tliftAll: liftAll,\n\t\tapply: apply,\n\t\tcall: call,\n\t\tcreateCallback: createCallback,\n\t\tbindCallback: bindCallback,\n\t\tliftCallback: liftCallback\n\t};\n\n\t/**\n\t * Takes a node-style async function and calls it immediately (with an optional\n\t * array of arguments or promises for arguments). It returns a promise whose\n\t * resolution depends on whether the async functions calls its callback with the\n\t * conventional error argument or not.\n\t *\n\t * With this it becomes possible to leverage existing APIs while still reaping\n\t * the benefits of promises.\n\t *\n\t * @example\n\t * function onlySmallNumbers(n, callback) {\n\t *\t\tif(n < 10) {\n\t *\t\t\tcallback(null, n + 10);\n\t *\t\t} else {\n\t *\t\t\tcallback(new Error(\"Calculation failed\"));\n\t *\t\t}\n\t *\t}\n\t *\n\t * var nodefn = require(\"when/node/function\");\n\t *\n\t * // Logs '15'\n\t * nodefn.apply(onlySmallNumbers, [5]).then(console.log, console.error);\n\t *\n\t * // Logs 'Calculation failed'\n\t * nodefn.apply(onlySmallNumbers, [15]).then(console.log, console.error);\n\t *\n\t * @param {function} f node-style function that will be called\n\t * @param {Array} [args] array of arguments to func\n\t * @returns {Promise} promise for the value func passes to its callback\n\t */\n\tfunction apply(f, args) {\n\t\treturn _apply(f, this, args || []);\n\t}\n\n\tfunction dispatch(f, thisArg, args, h) {\n\t\tvar cb = createCallback(h);\n\t\ttry {\n\t\t\tswitch(args.length) {\n\t\t\t\tcase 2: f.call(thisArg, args[0], args[1], cb); break;\n\t\t\t\tcase 1: f.call(thisArg, args[0], cb); break;\n\t\t\t\tcase 0: f.call(thisArg, cb); break;\n\t\t\t\tdefault:\n\t\t\t\t\targs.push(cb);\n\t\t\t\t\tf.apply(thisArg, args);\n\t\t\t}\n\t\t} catch(e) {\n\t\t\th.reject(e);\n\t\t}\n\t}\n\n\t/**\n\t * Has the same behavior that {@link apply} has, with the difference that the\n\t * arguments to the function are provided individually, while {@link apply} accepts\n\t * a single array.\n\t *\n\t * @example\n\t * function sumSmallNumbers(x, y, callback) {\n\t *\t\tvar result = x + y;\n\t *\t\tif(result < 10) {\n\t *\t\t\tcallback(null, result);\n\t *\t\t} else {\n\t *\t\t\tcallback(new Error(\"Calculation failed\"));\n\t *\t\t}\n\t *\t}\n\t *\n\t * // Logs '5'\n\t * nodefn.call(sumSmallNumbers, 2, 3).then(console.log, console.error);\n\t *\n\t * // Logs 'Calculation failed'\n\t * nodefn.call(sumSmallNumbers, 5, 10).then(console.log, console.error);\n\t *\n\t * @param {function} f node-style function that will be called\n\t * @param {...*} [args] arguments that will be forwarded to the function\n\t * @returns {Promise} promise for the value func passes to its callback\n\t */\n\tfunction call(f /*, args... */) {\n\t\treturn _apply(f, this, slice.call(arguments, 1));\n\t}\n\n\t/**\n\t * Takes a node-style function and returns new function that wraps the\n\t * original and, instead of taking a callback, returns a promise. Also, it\n\t * knows how to handle promises given as arguments, waiting for their\n\t * resolution before executing.\n\t *\n\t * Upon execution, the orginal function is executed as well. If it passes\n\t * a truthy value as the first argument to the callback, it will be\n\t * interpreted as an error condition, and the promise will be rejected\n\t * with it. Otherwise, the call is considered a resolution, and the promise\n\t * is resolved with the callback's second argument.\n\t *\n\t * @example\n\t * var fs = require(\"fs\"), nodefn = require(\"when/node/function\");\n\t *\n\t * var promiseRead = nodefn.lift(fs.readFile);\n\t *\n\t * // The promise is resolved with the contents of the file if everything\n\t * // goes ok\n\t * promiseRead('exists.txt').then(console.log, console.error);\n\t *\n\t * // And will be rejected if something doesn't work out\n\t * // (e.g. the files does not exist)\n\t * promiseRead('doesnt_exist.txt').then(console.log, console.error);\n\t *\n\t *\n\t * @param {Function} f node-style function to be lifted\n\t * @param {...*} [args] arguments to be prepended for the new function @deprecated\n\t * @returns {Function} a promise-returning function\n\t */\n\tfunction lift(f /*, args... */) {\n\t\tvar args1 = arguments.length > 1 ? slice.call(arguments, 1) : [];\n\t\treturn function() {\n\t\t\t// TODO: Simplify once partialing has been removed\n\t\t\tvar l = args1.length;\n\t\t\tvar al = arguments.length;\n\t\t\tvar args = new Array(al + l);\n\t\t\tvar i;\n\t\t\tfor(i=0; i 2) {\n\t\t\t\tresolver.resolve(slice.call(arguments, 1));\n\t\t\t} else {\n\t\t\t\tresolver.resolve(value);\n\t\t\t}\n\t\t};\n\t}\n\n\t/**\n\t * Attaches a node-style callback to a promise, ensuring the callback is\n\t * called for either fulfillment or rejection. Returns a promise with the same\n\t * state as the passed-in promise.\n\t *\n\t * @example\n\t *\tvar deferred = when.defer();\n\t *\n\t *\tfunction callback(err, value) {\n\t *\t\t// Handle err or use value\n\t *\t}\n\t *\n\t *\tbindCallback(deferred.promise, callback);\n\t *\n\t *\tdeferred.resolve('interesting value');\n\t *\n\t * @param {Promise} promise The promise to be attached to.\n\t * @param {Function} callback The node-style callback to attach.\n\t * @returns {Promise} A promise with the same state as the passed-in promise.\n\t */\n\tfunction bindCallback(promise, callback) {\n\t\tpromise = when(promise);\n\n\t\tif (callback) {\n\t\t\tpromise.then(success, wrapped);\n\t\t}\n\n\t\treturn promise;\n\n\t\tfunction success(value) {\n\t\t\twrapped(null, value);\n\t\t}\n\n\t\tfunction wrapped(err, value) {\n\t\t\tsetTimer(function () {\n\t\t\t\tcallback(err, value);\n\t\t\t}, 0);\n\t\t}\n\t}\n\n\t/**\n\t * Takes a node-style callback and returns new function that accepts a\n\t * promise, calling the original callback when the promise is either\n\t * fulfilled or rejected with the appropriate arguments.\n\t *\n\t * @example\n\t *\tvar deferred = when.defer();\n\t *\n\t *\tfunction callback(err, value) {\n\t *\t\t// Handle err or use value\n\t *\t}\n\t *\n\t *\tvar wrapped = liftCallback(callback);\n\t *\n\t *\t// `wrapped` can now be passed around at will\n\t *\twrapped(deferred.promise);\n\t *\n\t *\tdeferred.resolve('interesting value');\n\t *\n\t * @param {Function} callback The node-style callback to wrap.\n\t * @returns {Function} The lifted, promise-accepting function.\n\t */\n\tfunction liftCallback(callback) {\n\t\treturn function(promise) {\n\t\t\treturn bindCallback(promise, callback);\n\t\t};\n\t}\n});\n\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * parallel.js\n *\n * Run a set of task functions in parallel. All tasks will\n * receive the same args\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar all = when.Promise.all;\n\tvar slice = Array.prototype.slice;\n\n\t/**\n\t * Run array of tasks in parallel\n\t * @param tasks {Array|Promise} array or promiseForArray of task functions\n\t * @param [args] {*} arguments to be passed to all tasks\n\t * @return {Promise} promise for array containing the\n\t * result of each task in the array position corresponding\n\t * to position of the task in the tasks array\n\t */\n\treturn function parallel(tasks /*, args... */) {\n\t\treturn all(slice.call(arguments, 1)).then(function(args) {\n\t\t\treturn when.map(tasks, function(task) {\n\t\t\t\treturn task.apply(void 0, args);\n\t\t\t});\n\t\t});\n\t};\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * pipeline.js\n *\n * Run a set of task functions in sequence, passing the result\n * of the previous as an argument to the next. Like a shell\n * pipeline, e.g. `cat file.txt | grep 'foo' | sed -e 's/foo/bar/g'\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar all = when.Promise.all;\n\tvar slice = Array.prototype.slice;\n\n\t/**\n\t * Run array of tasks in a pipeline where the next\n\t * tasks receives the result of the previous. The first task\n\t * will receive the initialArgs as its argument list.\n\t * @param tasks {Array|Promise} array or promise for array of task functions\n\t * @param [initialArgs...] {*} arguments to be passed to the first task\n\t * @return {Promise} promise for return value of the final task\n\t */\n\treturn function pipeline(tasks /* initialArgs... */) {\n\t\t// Self-optimizing function to run first task with multiple\n\t\t// args using apply, but subsequence tasks via direct invocation\n\t\tvar runTask = function(args, task) {\n\t\t\trunTask = function(arg, task) {\n\t\t\t\treturn task(arg);\n\t\t\t};\n\n\t\t\treturn task.apply(null, args);\n\t\t};\n\n\t\treturn all(slice.call(arguments, 1)).then(function(args) {\n\t\t\treturn when.reduce(tasks, function(arg, task) {\n\t\t\t\treturn runTask(arg, task);\n\t\t\t}, args);\n\t\t});\n\t};\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2012-2013 original author or authors */\n\n/**\n * poll.js\n *\n * Helper that polls until cancelled or for a condition to become true.\n *\n * @author Scott Andrews\n */\n\n(function (define) { 'use strict';\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar attempt = when['try'];\n\tvar cancelable = require('./cancelable');\n\n\t/**\n\t * Periodically execute the task function on the msec delay. The result of\n\t * the task may be verified by watching for a condition to become true. The\n\t * returned deferred is cancellable if the polling needs to be cancelled\n\t * externally before reaching a resolved state.\n\t *\n\t * The next vote is scheduled after the results of the current vote are\n\t * verified and rejected.\n\t *\n\t * Polling may be terminated by the verifier returning a truthy value,\n\t * invoking cancel() on the returned promise, or the task function returning\n\t * a rejected promise.\n\t *\n\t * Usage:\n\t *\n\t * var count = 0;\n\t * function doSomething() { return count++ }\n\t *\n\t * // poll until cancelled\n\t * var p = poll(doSomething, 1000);\n\t * ...\n\t * p.cancel();\n\t *\n\t * // poll until condition is met\n\t * poll(doSomething, 1000, function(result) { return result > 10 })\n\t * .then(function(result) { assert result == 10 });\n\t *\n\t * // delay first vote\n\t * poll(doSomething, 1000, anyFunc, true);\n\t *\n\t * @param task {Function} function that is executed after every timeout\n\t * @param interval {number|Function} timeout in milliseconds\n\t * @param [verifier] {Function} function to evaluate the result of the vote.\n\t * May return a {Promise} or a {Boolean}. Rejecting the promise or a\n\t * falsey value will schedule the next vote.\n\t * @param [delayInitialTask] {boolean} if truthy, the first vote is scheduled\n\t * instead of immediate\n\t *\n\t * @returns {Promise}\n\t */\n\treturn function poll(task, interval, verifier, delayInitialTask) {\n\t\tvar deferred, canceled, reject;\n\n\t\tcanceled = false;\n\t\tdeferred = cancelable(when.defer(), function () { canceled = true; });\n\t\treject = deferred.reject;\n\n\t\tverifier = verifier || function () { return false; };\n\n\t\tif (typeof interval !== 'function') {\n\t\t\tinterval = (function (interval) {\n\t\t\t\treturn function () { return when().delay(interval); };\n\t\t\t})(interval);\n\t\t}\n\n\t\tfunction certify(result) {\n\t\t\tdeferred.resolve(result);\n\t\t}\n\n\t\tfunction schedule(result) {\n\t\t\tattempt(interval).then(vote, reject);\n\t\t\tif (result !== void 0) {\n\t\t\t\tdeferred.notify(result);\n\t\t\t}\n\t\t}\n\n\t\tfunction vote() {\n\t\t\tif (canceled) { return; }\n\t\t\twhen(task(),\n\t\t\t\tfunction (result) {\n\t\t\t\t\twhen(verifier(result),\n\t\t\t\t\t\tfunction (verification) {\n\t\t\t\t\t\t\treturn verification ? certify(result) : schedule(result);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction () { schedule(result); }\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\treject\n\t\t\t);\n\t\t}\n\n\t\tif (delayInitialTask) {\n\t\t\tschedule();\n\t\t} else {\n\t\t\t// if task() is blocking, vote will also block\n\t\t\tvote();\n\t\t}\n\n\t\t// make the promise cancelable\n\t\tdeferred.promise = Object.create(deferred.promise);\n\t\tdeferred.promise.cancel = deferred.cancel;\n\n\t\treturn deferred.promise;\n\t};\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * sequence.js\n *\n * Run a set of task functions in sequence. All tasks will\n * receive the same args.\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar all = when.Promise.all;\n\tvar slice = Array.prototype.slice;\n\n\t/**\n\t * Run array of tasks in sequence with no overlap\n\t * @param tasks {Array|Promise} array or promiseForArray of task functions\n\t * @param [args] {*} arguments to be passed to all tasks\n\t * @return {Promise} promise for an array containing\n\t * the result of each task in the array position corresponding\n\t * to position of the task in the tasks array\n\t */\n\treturn function sequence(tasks /*, args... */) {\n\t\tvar results = [];\n\n\t\treturn all(slice.call(arguments, 1)).then(function(args) {\n\t\t\treturn when.reduce(tasks, function(results, task) {\n\t\t\t\treturn when(task.apply(void 0, args), addResult);\n\t\t\t}, results);\n\t\t});\n\n\t\tfunction addResult(result) {\n\t\t\tresults.push(result);\n\t\t\treturn results;\n\t\t}\n\t};\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * timeout.js\n *\n * Helper that returns a promise that rejects after a specified timeout,\n * if not explicitly resolved or rejected before that.\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\n /**\n\t * @deprecated Use when(trigger).timeout(ms)\n */\n return function timeout(msec, trigger) {\n\t\treturn when(trigger).timeout(msec);\n };\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n\n/**\n * Promises/A+ and when() implementation\n * when is part of the cujoJS family of libraries (http://cujojs.com/)\n * @author Brian Cavalier\n * @author John Hann\n */\n(function(define) { 'use strict';\ndefine(function (require) {\n\n\tvar timed = require('./lib/decorators/timed');\n\tvar array = require('./lib/decorators/array');\n\tvar flow = require('./lib/decorators/flow');\n\tvar fold = require('./lib/decorators/fold');\n\tvar inspect = require('./lib/decorators/inspect');\n\tvar generate = require('./lib/decorators/iterate');\n\tvar progress = require('./lib/decorators/progress');\n\tvar withThis = require('./lib/decorators/with');\n\tvar unhandledRejection = require('./lib/decorators/unhandledRejection');\n\tvar TimeoutError = require('./lib/TimeoutError');\n\n\tvar Promise = [array, flow, fold, generate, progress,\n\t\tinspect, withThis, timed, unhandledRejection]\n\t\t.reduce(function(Promise, feature) {\n\t\t\treturn feature(Promise);\n\t\t}, require('./lib/Promise'));\n\n\tvar apply = require('./lib/apply')(Promise);\n\n\t// Public API\n\n\twhen.promise = promise; // Create a pending promise\n\twhen.resolve = Promise.resolve; // Create a resolved promise\n\twhen.reject = Promise.reject; // Create a rejected promise\n\n\twhen.lift = lift; // lift a function to return promises\n\twhen['try'] = attempt; // call a function and return a promise\n\twhen.attempt = attempt; // alias for when.try\n\n\twhen.iterate = Promise.iterate; // DEPRECATED (use cujojs/most streams) Generate a stream of promises\n\twhen.unfold = Promise.unfold; // DEPRECATED (use cujojs/most streams) Generate a stream of promises\n\n\twhen.join = join; // Join 2 or more promises\n\n\twhen.all = all; // Resolve a list of promises\n\twhen.settle = settle; // Settle a list of promises\n\n\twhen.any = lift(Promise.any); // One-winner race\n\twhen.some = lift(Promise.some); // Multi-winner race\n\twhen.race = lift(Promise.race); // First-to-settle race\n\n\twhen.map = map; // Array.map() for promises\n\twhen.filter = filter; // Array.filter() for promises\n\twhen.reduce = lift(Promise.reduce); // Array.reduce() for promises\n\twhen.reduceRight = lift(Promise.reduceRight); // Array.reduceRight() for promises\n\n\twhen.isPromiseLike = isPromiseLike; // Is something promise-like, aka thenable\n\n\twhen.Promise = Promise; // Promise constructor\n\twhen.defer = defer; // Create a {promise, resolve, reject} tuple\n\n\t// Error types\n\n\twhen.TimeoutError = TimeoutError;\n\n\t/**\n\t * Get a trusted promise for x, or by transforming x with onFulfilled\n\t *\n\t * @param {*} x\n\t * @param {function?} onFulfilled callback to be called when x is\n\t * successfully fulfilled. If promiseOrValue is an immediate value, callback\n\t * will be invoked immediately.\n\t * @param {function?} onRejected callback to be called when x is\n\t * rejected.\n\t * @param {function?} onProgress callback to be called when progress updates\n\t * are issued for x. @deprecated\n\t * @returns {Promise} a new promise that will fulfill with the return\n\t * value of callback or errback or the completion value of promiseOrValue if\n\t * callback and/or errback is not supplied.\n\t */\n\tfunction when(x, onFulfilled, onRejected, onProgress) {\n\t\tvar p = Promise.resolve(x);\n\t\tif (arguments.length < 2) {\n\t\t\treturn p;\n\t\t}\n\n\t\treturn p.then(onFulfilled, onRejected, onProgress);\n\t}\n\n\t/**\n\t * Creates a new promise whose fate is determined by resolver.\n\t * @param {function} resolver function(resolve, reject, notify)\n\t * @returns {Promise} promise whose fate is determine by resolver\n\t */\n\tfunction promise(resolver) {\n\t\treturn new Promise(resolver);\n\t}\n\n\t/**\n\t * Lift the supplied function, creating a version of f that returns\n\t * promises, and accepts promises as arguments.\n\t * @param {function} f\n\t * @returns {Function} version of f that returns promises\n\t */\n\tfunction lift(f) {\n\t\treturn function() {\n\t\t\tfor(var i=0, l=arguments.length, a=new Array(l); i 1 ? slice.call(arguments, 1) : [];\n\t\treturn function() {\n\t\t\treturn _apply(f, this, args.concat(slice.call(arguments)));\n\t\t};\n\t}\n\n\t/**\n\t * Lift all the functions/methods on src\n\t * @param {object|function} src source whose functions will be lifted\n\t * @param {function?} combine optional function for customizing the lifting\n\t * process. It is passed dst, the lifted function, and the property name of\n\t * the original function on src.\n\t * @param {(object|function)?} dst option destination host onto which to place lifted\n\t * functions. If not provided, liftAll returns a new object.\n\t * @returns {*} If dst is provided, returns dst with lifted functions as\n\t * properties. If dst not provided, returns a new object with lifted functions.\n\t */\n\tfunction liftAll(src, combine, dst) {\n\t\treturn _liftAll(lift, combine, dst, src);\n\t}\n\n\t/**\n\t * `promisify` is a version of `lift` that allows fine-grained control over the\n\t * arguments that passed to the underlying function. It is intended to handle\n\t * functions that don't follow the common callback and errback positions.\n\t *\n\t * The control is done by passing an object whose 'callback' and/or 'errback'\n\t * keys, whose values are the corresponding 0-based indexes of the arguments on\n\t * the function. Negative values are interpreted as being relative to the end\n\t * of the arguments array.\n\t *\n\t * If arguments are given on the call to the 'promisified' function, they are\n\t * intermingled with the callback and errback. If a promise is given among them,\n\t * the execution of the function will only occur after its resolution.\n\t *\n\t * @example\n\t * var delay = callbacks.promisify(setTimeout, {\n\t *\t\tcallback: 0\n\t *\t});\n\t *\n\t * delay(100).then(function() {\n\t *\t\tconsole.log(\"This happens 100ms afterwards\");\n\t *\t});\n\t *\n\t * @example\n\t * function callbackAsLast(errback, followsStandards, callback) {\n\t *\t\tif(followsStandards) {\n\t *\t\t\tcallback(\"well done!\");\n\t *\t\t} else {\n\t *\t\t\terrback(\"some programmers just want to watch the world burn\");\n\t *\t\t}\n\t *\t}\n\t *\n\t * var promisified = callbacks.promisify(callbackAsLast, {\n\t *\t\tcallback: -1,\n\t *\t\terrback: 0,\n\t *\t});\n\t *\n\t * promisified(true).then(console.log, console.error);\n\t * promisified(false).then(console.log, console.error);\n\t *\n\t * @param {Function} asyncFunction traditional function to be decorated\n\t * @param {object} positions\n\t * @param {number} [positions.callback] index at which asyncFunction expects to\n\t * receive a success callback\n\t * @param {number} [positions.errback] index at which asyncFunction expects to\n\t * receive an error callback\n\t * @returns {function} promisified function that accepts\n\t *\n\t * @deprecated\n\t */\n\tfunction promisify(asyncFunction, positions) {\n\n\t\treturn function() {\n\t\t\tvar thisArg = this;\n\t\t\treturn Promise.all(arguments).then(function(args) {\n\t\t\t\tvar p = Promise._defer();\n\n\t\t\t\tvar callbackPos, errbackPos;\n\n\t\t\t\tif(typeof positions.callback === 'number') {\n\t\t\t\t\tcallbackPos = normalizePosition(args, positions.callback);\n\t\t\t\t}\n\n\t\t\t\tif(typeof positions.errback === 'number') {\n\t\t\t\t\terrbackPos = normalizePosition(args, positions.errback);\n\t\t\t\t}\n\n\t\t\t\tif(errbackPos < callbackPos) {\n\t\t\t\t\tinsertCallback(args, errbackPos, p._handler.reject, p._handler);\n\t\t\t\t\tinsertCallback(args, callbackPos, p._handler.resolve, p._handler);\n\t\t\t\t} else {\n\t\t\t\t\tinsertCallback(args, callbackPos, p._handler.resolve, p._handler);\n\t\t\t\t\tinsertCallback(args, errbackPos, p._handler.reject, p._handler);\n\t\t\t\t}\n\n\t\t\t\tasyncFunction.apply(thisArg, args);\n\n\t\t\t\treturn p;\n\t\t\t});\n\t\t};\n\t}\n\n\tfunction normalizePosition(args, pos) {\n\t\treturn pos < 0 ? (args.length + pos + 2) : pos;\n\t}\n\n\tfunction insertCallback(args, pos, callback, thisArg) {\n\t\tif(typeof pos === 'number') {\n\t\t\targs.splice(pos, 0, alwaysUnary(callback, thisArg));\n\t\t}\n\t}\n\n\tfunction alwaysUnary(fn, thisArg) {\n\t\treturn function() {\n\t\t\tif (arguments.length > 1) {\n\t\t\t\tfn.call(thisArg, slice.call(arguments));\n\t\t\t} else {\n\t\t\t\tfn.apply(thisArg, arguments);\n\t\t\t}\n\t\t};\n\t}\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n","/** @license MIT License (c) copyright B Cavalier & J Hann */\n\n/**\n * cancelable.js\n * @deprecated\n *\n * Decorator that makes a deferred \"cancelable\". It adds a cancel() method that\n * will call a special cancel handler function and then reject the deferred. The\n * cancel handler can be used to do resource cleanup, or anything else that should\n * be done before any other rejection handlers are executed.\n *\n * Usage:\n *\n * var cancelableDeferred = cancelable(when.defer(), myCancelHandler);\n *\n * @author brian@hovercraftstudios.com\n */\n\n(function(define) {\ndefine(function() {\n\n /**\n * Makes deferred cancelable, adding a cancel() method.\n\t * @deprecated\n *\n * @param deferred {Deferred} the {@link Deferred} to make cancelable\n * @param canceler {Function} cancel handler function to execute when this deferred\n\t * is canceled. This is guaranteed to run before all other rejection handlers.\n\t * The canceler will NOT be executed if the deferred is rejected in the standard\n\t * way, i.e. deferred.reject(). It ONLY executes if the deferred is canceled,\n\t * i.e. deferred.cancel()\n *\n * @returns deferred, with an added cancel() method.\n */\n return function(deferred, canceler) {\n // Add a cancel method to the deferred to reject the delegate\n // with the special canceled indicator.\n deferred.cancel = function() {\n\t\t\ttry {\n\t\t\t\tdeferred.reject(canceler(deferred));\n\t\t\t} catch(e) {\n\t\t\t\tdeferred.reject(e);\n\t\t\t}\n\n\t\t\treturn deferred.promise;\n };\n\n return deferred;\n };\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(); });\n\n\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * delay.js\n *\n * Helper that returns a promise that resolves after a delay.\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\n /**\n\t * @deprecated Use when(value).delay(ms)\n */\n return function delay(msec, value) {\n\t\treturn when(value).delay(msec);\n };\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2013-2014 original author or authors */\n\n/**\n * Collection of helper functions for wrapping and executing 'traditional'\n * synchronous functions in a promise interface.\n *\n * @author Brian Cavalier\n * @contributor Renato Zannon\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar attempt = when['try'];\n\tvar _liftAll = require('./lib/liftAll');\n\tvar _apply = require('./lib/apply')(when.Promise);\n\tvar slice = Array.prototype.slice;\n\n\treturn {\n\t\tlift: lift,\n\t\tliftAll: liftAll,\n\t\tcall: attempt,\n\t\tapply: apply,\n\t\tcompose: compose\n\t};\n\n\t/**\n\t * Takes a function and an optional array of arguments (that might be promises),\n\t * and calls the function. The return value is a promise whose resolution\n\t * depends on the value returned by the function.\n\t * @param {function} f function to be called\n\t * @param {Array} [args] array of arguments to func\n\t * @returns {Promise} promise for the return value of func\n\t */\n\tfunction apply(f, args) {\n\t\t// slice args just in case the caller passed an Arguments instance\n\t\treturn _apply(f, this, args == null ? [] : slice.call(args));\n\t}\n\n\t/**\n\t * Takes a 'regular' function and returns a version of that function that\n\t * returns a promise instead of a plain value, and handles thrown errors by\n\t * returning a rejected promise. Also accepts a list of arguments to be\n\t * prepended to the new function, as does Function.prototype.bind.\n\t *\n\t * The resulting function is promise-aware, in the sense that it accepts\n\t * promise arguments, and waits for their resolution.\n\t * @param {Function} f function to be bound\n\t * @param {...*} [args] arguments to be prepended for the new function @deprecated\n\t * @returns {Function} a promise-returning function\n\t */\n\tfunction lift(f /*, args... */) {\n\t\tvar args = arguments.length > 1 ? slice.call(arguments, 1) : [];\n\t\treturn function() {\n\t\t\treturn _apply(f, this, args.concat(slice.call(arguments)));\n\t\t};\n\t}\n\n\t/**\n\t * Lift all the functions/methods on src\n\t * @param {object|function} src source whose functions will be lifted\n\t * @param {function?} combine optional function for customizing the lifting\n\t * process. It is passed dst, the lifted function, and the property name of\n\t * the original function on src.\n\t * @param {(object|function)?} dst option destination host onto which to place lifted\n\t * functions. If not provided, liftAll returns a new object.\n\t * @returns {*} If dst is provided, returns dst with lifted functions as\n\t * properties. If dst not provided, returns a new object with lifted functions.\n\t */\n\tfunction liftAll(src, combine, dst) {\n\t\treturn _liftAll(lift, combine, dst, src);\n\t}\n\n\t/**\n\t * Composes multiple functions by piping their return values. It is\n\t * transparent to whether the functions return 'regular' values or promises:\n\t * the piped argument is always a resolved value. If one of the functions\n\t * throws or returns a rejected promise, the composed promise will be also\n\t * rejected.\n\t *\n\t * The arguments (or promises to arguments) given to the returned function (if\n\t * any), are passed directly to the first function on the 'pipeline'.\n\t * @param {Function} f the function to which the arguments will be passed\n\t * @param {...Function} [funcs] functions that will be composed, in order\n\t * @returns {Function} a promise-returning composition of the functions\n\t */\n\tfunction compose(f /*, funcs... */) {\n\t\tvar funcs = slice.call(arguments, 1);\n\n\t\treturn function() {\n\t\t\tvar thisArg = this;\n\t\t\tvar args = slice.call(arguments);\n\t\t\tvar firstPromise = attempt.apply(thisArg, [f].concat(args));\n\n\t\t\treturn when.reduce(funcs, function(arg, func) {\n\t\t\t\treturn func.call(thisArg, arg);\n\t\t\t}, firstPromise);\n\t\t};\n\t}\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * Generalized promise concurrency guard\n * Adapted from original concept by Sakari Jokinen (Rocket Pack, Ltd.)\n *\n * @author Brian Cavalier\n * @author John Hann\n * @contributor Sakari Jokinen\n */\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar slice = Array.prototype.slice;\n\n\tguard.n = n;\n\n\treturn guard;\n\n\t/**\n\t * Creates a guarded version of f that can only be entered when the supplied\n\t * condition allows.\n\t * @param {function} condition represents a critical section that may only\n\t * be entered when allowed by the condition\n\t * @param {function} f function to guard\n\t * @returns {function} guarded version of f\n\t */\n\tfunction guard(condition, f) {\n\t\treturn function() {\n\t\t\tvar args = slice.call(arguments);\n\n\t\t\treturn when(condition()).withThis(this).then(function(exit) {\n\t\t\t\treturn when(f.apply(this, args))['finally'](exit);\n\t\t\t});\n\t\t};\n\t}\n\n\t/**\n\t * Creates a condition that allows only n simultaneous executions\n\t * of a guarded function\n\t * @param {number} allowed number of allowed simultaneous executions\n\t * @returns {function} condition function which returns a promise that\n\t * fulfills when the critical section may be entered. The fulfillment\n\t * value is a function (\"notifyExit\") that must be called when the critical\n\t * section has been exited.\n\t */\n\tfunction n(allowed) {\n\t\tvar count = 0;\n\t\tvar waiting = [];\n\n\t\treturn function enter() {\n\t\t\treturn when.promise(function(resolve) {\n\t\t\t\tif(count < allowed) {\n\t\t\t\t\tresolve(exit);\n\t\t\t\t} else {\n\t\t\t\t\twaiting.push(resolve);\n\t\t\t\t}\n\t\t\t\tcount += 1;\n\t\t\t});\n\t\t};\n\n\t\tfunction exit() {\n\t\t\tcount = Math.max(count - 1, 0);\n\t\t\tif(waiting.length > 0) {\n\t\t\t\twaiting.shift()(exit);\n\t\t\t}\n\t\t}\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * Licensed under the MIT License at:\n * http://www.opensource.org/licenses/mit-license.php\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar Promise = when.Promise;\n\tvar toPromise = when.resolve;\n\n\treturn {\n\t\tall: when.lift(all),\n\t\tmap: map,\n\t\tsettle: settle\n\t};\n\n\t/**\n\t * Resolve all the key-value pairs in the supplied object or promise\n\t * for an object.\n\t * @param {Promise|object} object or promise for object whose key-value pairs\n\t * will be resolved\n\t * @returns {Promise} promise for an object with the fully resolved key-value pairs\n\t */\n\tfunction all(object) {\n\t\tvar p = Promise._defer();\n\t\tvar resolver = Promise._handler(p);\n\n\t\tvar results = {};\n\t\tvar keys = Object.keys(object);\n\t\tvar pending = keys.length;\n\n\t\tfor(var i=0, k; i>>0;\n\n\t\t\tvar pending = l;\n\t\t\tvar errors = [];\n\n\t\t\tfor (var h, x, i = 0; i < l; ++i) {\n\t\t\t\tx = promises[i];\n\t\t\t\tif(x === void 0 && !(i in promises)) {\n\t\t\t\t\t--pending;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\th = Promise._handler(x);\n\t\t\t\tif(h.state() > 0) {\n\t\t\t\t\tresolver.become(h);\n\t\t\t\t\tPromise._visitRemaining(promises, i, h);\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\th.visit(resolver, handleFulfill, handleReject);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(pending === 0) {\n\t\t\t\tresolver.reject(new RangeError('any(): array must not be empty'));\n\t\t\t}\n\n\t\t\treturn p;\n\n\t\t\tfunction handleFulfill(x) {\n\t\t\t\t/*jshint validthis:true*/\n\t\t\t\terrors = null;\n\t\t\t\tthis.resolve(x); // this === resolver\n\t\t\t}\n\n\t\t\tfunction handleReject(e) {\n\t\t\t\t/*jshint validthis:true*/\n\t\t\t\tif(this.resolved) { // this === resolver\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\terrors.push(e);\n\t\t\t\tif(--pending === 0) {\n\t\t\t\t\tthis.reject(errors);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * N-winner competitive race\n\t\t * Return a promise that will fulfill when n input promises have\n\t\t * fulfilled, or will reject when it becomes impossible for n\n\t\t * input promises to fulfill (ie when promises.length - n + 1\n\t\t * have rejected)\n\t\t * @param {array} promises\n\t\t * @param {number} n\n\t\t * @returns {Promise} promise for the earliest n fulfillment values\n\t\t *\n\t\t * @deprecated\n\t\t */\n\t\tfunction some(promises, n) {\n\t\t\t/*jshint maxcomplexity:7*/\n\t\t\tvar p = Promise._defer();\n\t\t\tvar resolver = p._handler;\n\n\t\t\tvar results = [];\n\t\t\tvar errors = [];\n\n\t\t\tvar l = promises.length>>>0;\n\t\t\tvar nFulfill = 0;\n\t\t\tvar nReject;\n\t\t\tvar x, i; // reused in both for() loops\n\n\t\t\t// First pass: count actual array items\n\t\t\tfor(i=0; i nFulfill) {\n\t\t\t\tresolver.reject(new RangeError('some(): array must contain at least '\n\t\t\t\t+ n + ' item(s), but had ' + nFulfill));\n\t\t\t} else if(nFulfill === 0) {\n\t\t\t\tresolver.resolve(results);\n\t\t\t}\n\n\t\t\t// Second pass: observe each array item, make progress toward goals\n\t\t\tfor(i=0; i 2 ? ar.call(promises, liftCombine(f), arguments[2])\n\t\t\t\t\t: ar.call(promises, liftCombine(f));\n\t\t}\n\n\t\t/**\n\t\t * Traditional reduce function, similar to `Array.prototype.reduceRight()`, but\n\t\t * input may contain promises and/or values, and reduceFunc\n\t\t * may return either a value or a promise, *and* initialValue may\n\t\t * be a promise for the starting value.\n\t\t * @param {Array|Promise} promises array or promise for an array of anything,\n\t\t * may contain a mix of promises and values.\n\t\t * @param {function(accumulated:*, x:*, index:Number):*} f reduce function\n\t\t * @returns {Promise} that will resolve to the final reduced value\n\t\t */\n\t\tfunction reduceRight(promises, f /*, initialValue */) {\n\t\t\treturn arguments.length > 2 ? arr.call(promises, liftCombine(f), arguments[2])\n\t\t\t\t\t: arr.call(promises, liftCombine(f));\n\t\t}\n\n\t\tfunction liftCombine(f) {\n\t\t\treturn function(z, x, i) {\n\t\t\t\treturn applyFold(f, void 0, [z,x,i]);\n\t\t\t};\n\t\t}\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function flow(Promise) {\n\n\t\tvar resolve = Promise.resolve;\n\t\tvar reject = Promise.reject;\n\t\tvar origCatch = Promise.prototype['catch'];\n\n\t\t/**\n\t\t * Handle the ultimate fulfillment value or rejection reason, and assume\n\t\t * responsibility for all errors. If an error propagates out of result\n\t\t * or handleFatalError, it will be rethrown to the host, resulting in a\n\t\t * loud stack track on most platforms and a crash on some.\n\t\t * @param {function?} onResult\n\t\t * @param {function?} onError\n\t\t * @returns {undefined}\n\t\t */\n\t\tPromise.prototype.done = function(onResult, onError) {\n\t\t\tthis._handler.visit(this._handler.receiver, onResult, onError);\n\t\t};\n\n\t\t/**\n\t\t * Add Error-type and predicate matching to catch. Examples:\n\t\t * promise.catch(TypeError, handleTypeError)\n\t\t * .catch(predicate, handleMatchedErrors)\n\t\t * .catch(handleRemainingErrors)\n\t\t * @param onRejected\n\t\t * @returns {*}\n\t\t */\n\t\tPromise.prototype['catch'] = Promise.prototype.otherwise = function(onRejected) {\n\t\t\tif (arguments.length < 2) {\n\t\t\t\treturn origCatch.call(this, onRejected);\n\t\t\t}\n\n\t\t\tif(typeof onRejected !== 'function') {\n\t\t\t\treturn this.ensure(rejectInvalidPredicate);\n\t\t\t}\n\n\t\t\treturn origCatch.call(this, createCatchFilter(arguments[1], onRejected));\n\t\t};\n\n\t\t/**\n\t\t * Wraps the provided catch handler, so that it will only be called\n\t\t * if the predicate evaluates truthy\n\t\t * @param {?function} handler\n\t\t * @param {function} predicate\n\t\t * @returns {function} conditional catch handler\n\t\t */\n\t\tfunction createCatchFilter(handler, predicate) {\n\t\t\treturn function(e) {\n\t\t\t\treturn evaluatePredicate(e, predicate)\n\t\t\t\t\t? handler.call(this, e)\n\t\t\t\t\t: reject(e);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Ensures that onFulfilledOrRejected will be called regardless of whether\n\t\t * this promise is fulfilled or rejected. onFulfilledOrRejected WILL NOT\n\t\t * receive the promises' value or reason. Any returned value will be disregarded.\n\t\t * onFulfilledOrRejected may throw or return a rejected promise to signal\n\t\t * an additional error.\n\t\t * @param {function} handler handler to be called regardless of\n\t\t * fulfillment or rejection\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype['finally'] = Promise.prototype.ensure = function(handler) {\n\t\t\tif(typeof handler !== 'function') {\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\treturn this.then(function(x) {\n\t\t\t\treturn runSideEffect(handler, this, identity, x);\n\t\t\t}, function(e) {\n\t\t\t\treturn runSideEffect(handler, this, reject, e);\n\t\t\t});\n\t\t};\n\n\t\tfunction runSideEffect (handler, thisArg, propagate, value) {\n\t\t\tvar result = handler.call(thisArg);\n\t\t\treturn maybeThenable(result)\n\t\t\t\t? propagateValue(result, propagate, value)\n\t\t\t\t: propagate(value);\n\t\t}\n\n\t\tfunction propagateValue (result, propagate, x) {\n\t\t\treturn resolve(result).then(function () {\n\t\t\t\treturn propagate(x);\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Recover from a failure by returning a defaultValue. If defaultValue\n\t\t * is a promise, it's fulfillment value will be used. If defaultValue is\n\t\t * a promise that rejects, the returned promise will reject with the\n\t\t * same reason.\n\t\t * @param {*} defaultValue\n\t\t * @returns {Promise} new promise\n\t\t */\n\t\tPromise.prototype['else'] = Promise.prototype.orElse = function(defaultValue) {\n\t\t\treturn this.then(void 0, function() {\n\t\t\t\treturn defaultValue;\n\t\t\t});\n\t\t};\n\n\t\t/**\n\t\t * Shortcut for .then(function() { return value; })\n\t\t * @param {*} value\n\t\t * @return {Promise} a promise that:\n\t\t * - is fulfilled if value is not a promise, or\n\t\t * - if value is a promise, will fulfill with its value, or reject\n\t\t * with its reason.\n\t\t */\n\t\tPromise.prototype['yield'] = function(value) {\n\t\t\treturn this.then(function() {\n\t\t\t\treturn value;\n\t\t\t});\n\t\t};\n\n\t\t/**\n\t\t * Runs a side effect when this promise fulfills, without changing the\n\t\t * fulfillment value.\n\t\t * @param {function} onFulfilledSideEffect\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype.tap = function(onFulfilledSideEffect) {\n\t\t\treturn this.then(onFulfilledSideEffect)['yield'](this);\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n\tfunction rejectInvalidPredicate() {\n\t\tthrow new TypeError('catch predicate must be a function');\n\t}\n\n\tfunction evaluatePredicate(e, predicate) {\n\t\treturn isError(predicate) ? e instanceof predicate : predicate(e);\n\t}\n\n\tfunction isError(predicate) {\n\t\treturn predicate === Error\n\t\t\t|| (predicate != null && predicate.prototype instanceof Error);\n\t}\n\n\tfunction maybeThenable(x) {\n\t\treturn (typeof x === 'object' || typeof x === 'function') && x !== null;\n\t}\n\n\tfunction identity(x) {\n\t\treturn x;\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n/** @author Jeff Escalante */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function fold(Promise) {\n\n\t\tPromise.prototype.fold = function(f, z) {\n\t\t\tvar promise = this._beget();\n\n\t\t\tthis._handler.fold(function(z, x, to) {\n\t\t\t\tPromise._handler(z).fold(function(x, z, to) {\n\t\t\t\t\tto.resolve(f.call(this, z, x));\n\t\t\t\t}, x, this, to);\n\t\t\t}, z, promise._handler.receiver, promise._handler);\n\n\t\t\treturn promise;\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar inspect = require('../state').inspect;\n\n\treturn function inspection(Promise) {\n\n\t\tPromise.prototype.inspect = function() {\n\t\t\treturn inspect(Promise._handler(this));\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function generate(Promise) {\n\n\t\tvar resolve = Promise.resolve;\n\n\t\tPromise.iterate = iterate;\n\t\tPromise.unfold = unfold;\n\n\t\treturn Promise;\n\n\t\t/**\n\t\t * @deprecated Use github.com/cujojs/most streams and most.iterate\n\t\t * Generate a (potentially infinite) stream of promised values:\n\t\t * x, f(x), f(f(x)), etc. until condition(x) returns true\n\t\t * @param {function} f function to generate a new x from the previous x\n\t\t * @param {function} condition function that, given the current x, returns\n\t\t * truthy when the iterate should stop\n\t\t * @param {function} handler function to handle the value produced by f\n\t\t * @param {*|Promise} x starting value, may be a promise\n\t\t * @return {Promise} the result of the last call to f before\n\t\t * condition returns true\n\t\t */\n\t\tfunction iterate(f, condition, handler, x) {\n\t\t\treturn unfold(function(x) {\n\t\t\t\treturn [x, f(x)];\n\t\t\t}, condition, handler, x);\n\t\t}\n\n\t\t/**\n\t\t * @deprecated Use github.com/cujojs/most streams and most.unfold\n\t\t * Generate a (potentially infinite) stream of promised values\n\t\t * by applying handler(generator(seed)) iteratively until\n\t\t * condition(seed) returns true.\n\t\t * @param {function} unspool function that generates a [value, newSeed]\n\t\t * given a seed.\n\t\t * @param {function} condition function that, given the current seed, returns\n\t\t * truthy when the unfold should stop\n\t\t * @param {function} handler function to handle the value produced by unspool\n\t\t * @param x {*|Promise} starting value, may be a promise\n\t\t * @return {Promise} the result of the last value produced by unspool before\n\t\t * condition returns true\n\t\t */\n\t\tfunction unfold(unspool, condition, handler, x) {\n\t\t\treturn resolve(x).then(function(seed) {\n\t\t\t\treturn resolve(condition(seed)).then(function(done) {\n\t\t\t\t\treturn done ? seed : resolve(unspool(seed)).spread(next);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tfunction next(item, newSeed) {\n\t\t\t\treturn resolve(handler(item)).then(function() {\n\t\t\t\t\treturn unfold(unspool, condition, handler, newSeed);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function progress(Promise) {\n\n\t\t/**\n\t\t * @deprecated\n\t\t * Register a progress handler for this promise\n\t\t * @param {function} onProgress\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype.progress = function(onProgress) {\n\t\t\treturn this.then(void 0, void 0, onProgress);\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar env = require('../env');\n\tvar TimeoutError = require('../TimeoutError');\n\n\tfunction setTimeout(f, ms, x, y) {\n\t\treturn env.setTimer(function() {\n\t\t\tf(x, y, ms);\n\t\t}, ms);\n\t}\n\n\treturn function timed(Promise) {\n\t\t/**\n\t\t * Return a new promise whose fulfillment value is revealed only\n\t\t * after ms milliseconds\n\t\t * @param {number} ms milliseconds\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype.delay = function(ms) {\n\t\t\tvar p = this._beget();\n\t\t\tthis._handler.fold(handleDelay, ms, void 0, p._handler);\n\t\t\treturn p;\n\t\t};\n\n\t\tfunction handleDelay(ms, x, h) {\n\t\t\tsetTimeout(resolveDelay, ms, x, h);\n\t\t}\n\n\t\tfunction resolveDelay(x, h) {\n\t\t\th.resolve(x);\n\t\t}\n\n\t\t/**\n\t\t * Return a new promise that rejects after ms milliseconds unless\n\t\t * this promise fulfills earlier, in which case the returned promise\n\t\t * fulfills with the same value.\n\t\t * @param {number} ms milliseconds\n\t\t * @param {Error|*=} reason optional rejection reason to use, defaults\n\t\t * to a TimeoutError if not provided\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype.timeout = function(ms, reason) {\n\t\t\tvar p = this._beget();\n\t\t\tvar h = p._handler;\n\n\t\t\tvar t = setTimeout(onTimeout, ms, reason, p._handler);\n\n\t\t\tthis._handler.visit(h,\n\t\t\t\tfunction onFulfill(x) {\n\t\t\t\t\tenv.clearTimer(t);\n\t\t\t\t\tthis.resolve(x); // this = h\n\t\t\t\t},\n\t\t\t\tfunction onReject(x) {\n\t\t\t\t\tenv.clearTimer(t);\n\t\t\t\t\tthis.reject(x); // this = h\n\t\t\t\t},\n\t\t\t\th.notify);\n\n\t\t\treturn p;\n\t\t};\n\n\t\tfunction onTimeout(reason, h, ms) {\n\t\t\tvar e = typeof reason === 'undefined'\n\t\t\t\t? new TimeoutError('timed out after ' + ms + 'ms')\n\t\t\t\t: reason;\n\t\t\th.reject(e);\n\t\t}\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar setTimer = require('../env').setTimer;\n\tvar format = require('../format');\n\n\treturn function unhandledRejection(Promise) {\n\n\t\tvar logError = noop;\n\t\tvar logInfo = noop;\n\t\tvar localConsole;\n\n\t\tif(typeof console !== 'undefined') {\n\t\t\t// Alias console to prevent things like uglify's drop_console option from\n\t\t\t// removing console.log/error. Unhandled rejections fall into the same\n\t\t\t// category as uncaught exceptions, and build tools shouldn't silence them.\n\t\t\tlocalConsole = console;\n\t\t\tlogError = typeof localConsole.error !== 'undefined'\n\t\t\t\t? function (e) { localConsole.error(e); }\n\t\t\t\t: function (e) { localConsole.log(e); };\n\n\t\t\tlogInfo = typeof localConsole.info !== 'undefined'\n\t\t\t\t? function (e) { localConsole.info(e); }\n\t\t\t\t: function (e) { localConsole.log(e); };\n\t\t}\n\n\t\tPromise.onPotentiallyUnhandledRejection = function(rejection) {\n\t\t\tenqueue(report, rejection);\n\t\t};\n\n\t\tPromise.onPotentiallyUnhandledRejectionHandled = function(rejection) {\n\t\t\tenqueue(unreport, rejection);\n\t\t};\n\n\t\tPromise.onFatalRejection = function(rejection) {\n\t\t\tenqueue(throwit, rejection.value);\n\t\t};\n\n\t\tvar tasks = [];\n\t\tvar reported = [];\n\t\tvar running = null;\n\n\t\tfunction report(r) {\n\t\t\tif(!r.handled) {\n\t\t\t\treported.push(r);\n\t\t\t\tlogError('Potentially unhandled rejection [' + r.id + '] ' + format.formatError(r.value));\n\t\t\t}\n\t\t}\n\n\t\tfunction unreport(r) {\n\t\t\tvar i = reported.indexOf(r);\n\t\t\tif(i >= 0) {\n\t\t\t\treported.splice(i, 1);\n\t\t\t\tlogInfo('Handled previous rejection [' + r.id + '] ' + format.formatObject(r.value));\n\t\t\t}\n\t\t}\n\n\t\tfunction enqueue(f, x) {\n\t\t\ttasks.push(f, x);\n\t\t\tif(running === null) {\n\t\t\t\trunning = setTimer(flush, 0);\n\t\t\t}\n\t\t}\n\n\t\tfunction flush() {\n\t\t\trunning = null;\n\t\t\twhile(tasks.length > 0) {\n\t\t\t\ttasks.shift()(tasks.shift());\n\t\t\t}\n\t\t}\n\n\t\treturn Promise;\n\t};\n\n\tfunction throwit(e) {\n\t\tthrow e;\n\t}\n\n\tfunction noop() {}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function addWith(Promise) {\n\t\t/**\n\t\t * Returns a promise whose handlers will be called with `this` set to\n\t\t * the supplied receiver. Subsequent promises derived from the\n\t\t * returned promise will also have their handlers called with receiver\n\t\t * as `this`. Calling `with` with undefined or no arguments will return\n\t\t * a promise whose handlers will again be called in the usual Promises/A+\n\t\t * way (no `this`) thus safely undoing any previous `with` in the\n\t\t * promise chain.\n\t\t *\n\t\t * WARNING: Promises returned from `with`/`withThis` are NOT Promises/A+\n\t\t * compliant, specifically violating 2.2.5 (http://promisesaplus.com/#point-41)\n\t\t *\n\t\t * @param {object} receiver `this` value for all handlers attached to\n\t\t * the returned promise.\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype['with'] = Promise.prototype.withThis = function(receiver) {\n\t\t\tvar p = this._beget();\n\t\t\tvar child = p._handler;\n\t\t\tchild.receiver = receiver;\n\t\t\tthis._handler.chain(child, receiver);\n\t\t\treturn p;\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n/*global process,document,setTimeout,clearTimeout,MutationObserver,WebKitMutationObserver*/\n(function(define) { 'use strict';\ndefine(function(require) {\n\t/*jshint maxcomplexity:6*/\n\n\t// Sniff \"best\" async scheduling option\n\t// Prefer process.nextTick or MutationObserver, then check for\n\t// setTimeout, and finally vertx, since its the only env that doesn't\n\t// have setTimeout\n\n\tvar MutationObs;\n\tvar capturedSetTimeout = typeof setTimeout !== 'undefined' && setTimeout;\n\n\t// Default env\n\tvar setTimer = function(f, ms) { return setTimeout(f, ms); };\n\tvar clearTimer = function(t) { return clearTimeout(t); };\n\tvar asap = function (f) { return capturedSetTimeout(f, 0); };\n\n\t// Detect specific env\n\tif (isNode()) { // Node\n\t\tasap = function (f) { return process.nextTick(f); };\n\n\t} else if (MutationObs = hasMutationObserver()) { // Modern browser\n\t\tasap = initMutationObserver(MutationObs);\n\n\t} else if (!capturedSetTimeout) { // vert.x\n\t\tvar vertxRequire = require;\n\t\tvar vertx = vertxRequire('vertx');\n\t\tsetTimer = function (f, ms) { return vertx.setTimer(ms, f); };\n\t\tclearTimer = vertx.cancelTimer;\n\t\tasap = vertx.runOnLoop || vertx.runOnContext;\n\t}\n\n\treturn {\n\t\tsetTimer: setTimer,\n\t\tclearTimer: clearTimer,\n\t\tasap: asap\n\t};\n\n\tfunction isNode () {\n\t\treturn typeof process !== 'undefined' &&\n\t\t\tObject.prototype.toString.call(process) === '[object process]';\n\t}\n\n\tfunction hasMutationObserver () {\n\t return (typeof MutationObserver !== 'undefined' && MutationObserver) ||\n\t\t\t(typeof WebKitMutationObserver !== 'undefined' && WebKitMutationObserver);\n\t}\n\n\tfunction initMutationObserver(MutationObserver) {\n\t\tvar scheduled;\n\t\tvar node = document.createTextNode('');\n\t\tvar o = new MutationObserver(run);\n\t\to.observe(node, { characterData: true });\n\n\t\tfunction run() {\n\t\t\tvar f = scheduled;\n\t\t\tscheduled = void 0;\n\t\t\tf();\n\t\t}\n\n\t\tvar i = 0;\n\t\treturn function (f) {\n\t\t\tscheduled = f;\n\t\t\tnode.data = (i ^= 1);\n\t\t};\n\t}\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn {\n\t\tformatError: formatError,\n\t\tformatObject: formatObject,\n\t\ttryStringify: tryStringify\n\t};\n\n\t/**\n\t * Format an error into a string. If e is an Error and has a stack property,\n\t * it's returned. Otherwise, e is formatted using formatObject, with a\n\t * warning added about e not being a proper Error.\n\t * @param {*} e\n\t * @returns {String} formatted string, suitable for output to developers\n\t */\n\tfunction formatError(e) {\n\t\tvar s = typeof e === 'object' && e !== null && (e.stack || e.message) ? e.stack || e.message : formatObject(e);\n\t\treturn e instanceof Error ? s : s + ' (WARNING: non-Error used)';\n\t}\n\n\t/**\n\t * Format an object, detecting \"plain\" objects and running them through\n\t * JSON.stringify if possible.\n\t * @param {Object} o\n\t * @returns {string}\n\t */\n\tfunction formatObject(o) {\n\t\tvar s = String(o);\n\t\tif(s === '[object Object]' && typeof JSON !== 'undefined') {\n\t\t\ts = tryStringify(o, s);\n\t\t}\n\t\treturn s;\n\t}\n\n\t/**\n\t * Try to return the result of JSON.stringify(x). If that fails, return\n\t * defaultValue\n\t * @param {*} x\n\t * @param {*} defaultValue\n\t * @returns {String|*} JSON.stringify(x) or defaultValue\n\t */\n\tfunction tryStringify(x, defaultValue) {\n\t\ttry {\n\t\t\treturn JSON.stringify(x);\n\t\t} catch(e) {\n\t\t\treturn defaultValue;\n\t\t}\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function liftAll(liftOne, combine, dst, src) {\n\t\tif(typeof combine === 'undefined') {\n\t\t\tcombine = defaultCombine;\n\t\t}\n\n\t\treturn Object.keys(src).reduce(function(dst, key) {\n\t\t\tvar f = src[key];\n\t\t\treturn typeof f === 'function' ? combine(dst, liftOne(f), key) : dst;\n\t\t}, typeof dst === 'undefined' ? defaultDst(src) : dst);\n\t};\n\n\tfunction defaultCombine(o, f, k) {\n\t\to[k] = f;\n\t\treturn o;\n\t}\n\n\tfunction defaultDst(src) {\n\t\treturn typeof src === 'function' ? src.bind() : Object.create(src);\n\t}\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function makePromise(environment) {\n\n\t\tvar tasks = environment.scheduler;\n\t\tvar emitRejection = initEmitRejection();\n\n\t\tvar objectCreate = Object.create ||\n\t\t\tfunction(proto) {\n\t\t\t\tfunction Child() {}\n\t\t\t\tChild.prototype = proto;\n\t\t\t\treturn new Child();\n\t\t\t};\n\n\t\t/**\n\t\t * Create a promise whose fate is determined by resolver\n\t\t * @constructor\n\t\t * @returns {Promise} promise\n\t\t * @name Promise\n\t\t */\n\t\tfunction Promise(resolver, handler) {\n\t\t\tthis._handler = resolver === Handler ? handler : init(resolver);\n\t\t}\n\n\t\t/**\n\t\t * Run the supplied resolver\n\t\t * @param resolver\n\t\t * @returns {Pending}\n\t\t */\n\t\tfunction init(resolver) {\n\t\t\tvar handler = new Pending();\n\n\t\t\ttry {\n\t\t\t\tresolver(promiseResolve, promiseReject, promiseNotify);\n\t\t\t} catch (e) {\n\t\t\t\tpromiseReject(e);\n\t\t\t}\n\n\t\t\treturn handler;\n\n\t\t\t/**\n\t\t\t * Transition from pre-resolution state to post-resolution state, notifying\n\t\t\t * all listeners of the ultimate fulfillment or rejection\n\t\t\t * @param {*} x resolution value\n\t\t\t */\n\t\t\tfunction promiseResolve (x) {\n\t\t\t\thandler.resolve(x);\n\t\t\t}\n\t\t\t/**\n\t\t\t * Reject this promise with reason, which will be used verbatim\n\t\t\t * @param {Error|*} reason rejection reason, strongly suggested\n\t\t\t * to be an Error type\n\t\t\t */\n\t\t\tfunction promiseReject (reason) {\n\t\t\t\thandler.reject(reason);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * @deprecated\n\t\t\t * Issue a progress event, notifying all progress listeners\n\t\t\t * @param {*} x progress event payload to pass to all listeners\n\t\t\t */\n\t\t\tfunction promiseNotify (x) {\n\t\t\t\thandler.notify(x);\n\t\t\t}\n\t\t}\n\n\t\t// Creation\n\n\t\tPromise.resolve = resolve;\n\t\tPromise.reject = reject;\n\t\tPromise.never = never;\n\n\t\tPromise._defer = defer;\n\t\tPromise._handler = getHandler;\n\n\t\t/**\n\t\t * Returns a trusted promise. If x is already a trusted promise, it is\n\t\t * returned, otherwise returns a new trusted Promise which follows x.\n\t\t * @param {*} x\n\t\t * @return {Promise} promise\n\t\t */\n\t\tfunction resolve(x) {\n\t\t\treturn isPromise(x) ? x\n\t\t\t\t: new Promise(Handler, new Async(getHandler(x)));\n\t\t}\n\n\t\t/**\n\t\t * Return a reject promise with x as its reason (x is used verbatim)\n\t\t * @param {*} x\n\t\t * @returns {Promise} rejected promise\n\t\t */\n\t\tfunction reject(x) {\n\t\t\treturn new Promise(Handler, new Async(new Rejected(x)));\n\t\t}\n\n\t\t/**\n\t\t * Return a promise that remains pending forever\n\t\t * @returns {Promise} forever-pending promise.\n\t\t */\n\t\tfunction never() {\n\t\t\treturn foreverPendingPromise; // Should be frozen\n\t\t}\n\n\t\t/**\n\t\t * Creates an internal {promise, resolver} pair\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tfunction defer() {\n\t\t\treturn new Promise(Handler, new Pending());\n\t\t}\n\n\t\t// Transformation and flow control\n\n\t\t/**\n\t\t * Transform this promise's fulfillment value, returning a new Promise\n\t\t * for the transformed result. If the promise cannot be fulfilled, onRejected\n\t\t * is called with the reason. onProgress *may* be called with updates toward\n\t\t * this promise's fulfillment.\n\t\t * @param {function=} onFulfilled fulfillment handler\n\t\t * @param {function=} onRejected rejection handler\n\t\t * @param {function=} onProgress @deprecated progress handler\n\t\t * @return {Promise} new promise\n\t\t */\n\t\tPromise.prototype.then = function(onFulfilled, onRejected, onProgress) {\n\t\t\tvar parent = this._handler;\n\t\t\tvar state = parent.join().state();\n\n\t\t\tif ((typeof onFulfilled !== 'function' && state > 0) ||\n\t\t\t\t(typeof onRejected !== 'function' && state < 0)) {\n\t\t\t\t// Short circuit: value will not change, simply share handler\n\t\t\t\treturn new this.constructor(Handler, parent);\n\t\t\t}\n\n\t\t\tvar p = this._beget();\n\t\t\tvar child = p._handler;\n\n\t\t\tparent.chain(child, parent.receiver, onFulfilled, onRejected, onProgress);\n\n\t\t\treturn p;\n\t\t};\n\n\t\t/**\n\t\t * If this promise cannot be fulfilled due to an error, call onRejected to\n\t\t * handle the error. Shortcut for .then(undefined, onRejected)\n\t\t * @param {function?} onRejected\n\t\t * @return {Promise}\n\t\t */\n\t\tPromise.prototype['catch'] = function(onRejected) {\n\t\t\treturn this.then(void 0, onRejected);\n\t\t};\n\n\t\t/**\n\t\t * Creates a new, pending promise of the same type as this promise\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype._beget = function() {\n\t\t\treturn begetFrom(this._handler, this.constructor);\n\t\t};\n\n\t\tfunction begetFrom(parent, Promise) {\n\t\t\tvar child = new Pending(parent.receiver, parent.join().context);\n\t\t\treturn new Promise(Handler, child);\n\t\t}\n\n\t\t// Array combinators\n\n\t\tPromise.all = all;\n\t\tPromise.race = race;\n\t\tPromise._traverse = traverse;\n\n\t\t/**\n\t\t * Return a promise that will fulfill when all promises in the\n\t\t * input array have fulfilled, or will reject when one of the\n\t\t * promises rejects.\n\t\t * @param {array} promises array of promises\n\t\t * @returns {Promise} promise for array of fulfillment values\n\t\t */\n\t\tfunction all(promises) {\n\t\t\treturn traverseWith(snd, null, promises);\n\t\t}\n\n\t\t/**\n\t\t * Array> -> Promise>\n\t\t * @private\n\t\t * @param {function} f function to apply to each promise's value\n\t\t * @param {Array} promises array of promises\n\t\t * @returns {Promise} promise for transformed values\n\t\t */\n\t\tfunction traverse(f, promises) {\n\t\t\treturn traverseWith(tryCatch2, f, promises);\n\t\t}\n\n\t\tfunction traverseWith(tryMap, f, promises) {\n\t\t\tvar handler = typeof f === 'function' ? mapAt : settleAt;\n\n\t\t\tvar resolver = new Pending();\n\t\t\tvar pending = promises.length >>> 0;\n\t\t\tvar results = new Array(pending);\n\n\t\t\tfor (var i = 0, x; i < promises.length && !resolver.resolved; ++i) {\n\t\t\t\tx = promises[i];\n\n\t\t\t\tif (x === void 0 && !(i in promises)) {\n\t\t\t\t\t--pending;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttraverseAt(promises, handler, i, x, resolver);\n\t\t\t}\n\n\t\t\tif(pending === 0) {\n\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t}\n\n\t\t\treturn new Promise(Handler, resolver);\n\n\t\t\tfunction mapAt(i, x, resolver) {\n\t\t\t\tif(!resolver.resolved) {\n\t\t\t\t\ttraverseAt(promises, settleAt, i, tryMap(f, x, i), resolver);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction settleAt(i, x, resolver) {\n\t\t\t\tresults[i] = x;\n\t\t\t\tif(--pending === 0) {\n\t\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction traverseAt(promises, handler, i, x, resolver) {\n\t\t\tif (maybeThenable(x)) {\n\t\t\t\tvar h = getHandlerMaybeThenable(x);\n\t\t\t\tvar s = h.state();\n\n\t\t\t\tif (s === 0) {\n\t\t\t\t\th.fold(handler, i, void 0, resolver);\n\t\t\t\t} else if (s > 0) {\n\t\t\t\t\thandler(i, h.value, resolver);\n\t\t\t\t} else {\n\t\t\t\t\tresolver.become(h);\n\t\t\t\t\tvisitRemaining(promises, i+1, h);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thandler(i, x, resolver);\n\t\t\t}\n\t\t}\n\n\t\tPromise._visitRemaining = visitRemaining;\n\t\tfunction visitRemaining(promises, start, handler) {\n\t\t\tfor(var i=start; i 0 ? toFulfilledState(handler.value)\n\t\t\t : toRejectedState(handler.value);\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2013 original author or authors */\n\n/**\n * Collection of helpers for interfacing with node-style asynchronous functions\n * using promises.\n *\n * @author Brian Cavalier\n * @contributor Renato Zannon\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar _liftAll = require('./lib/liftAll');\n\tvar setTimer = require('./lib/env').setTimer;\n\tvar slice = Array.prototype.slice;\n\n\tvar _apply = require('./lib/apply')(when.Promise, dispatch);\n\n\treturn {\n\t\tlift: lift,\n\t\tliftAll: liftAll,\n\t\tapply: apply,\n\t\tcall: call,\n\t\tcreateCallback: createCallback,\n\t\tbindCallback: bindCallback,\n\t\tliftCallback: liftCallback\n\t};\n\n\t/**\n\t * Takes a node-style async function and calls it immediately (with an optional\n\t * array of arguments or promises for arguments). It returns a promise whose\n\t * resolution depends on whether the async functions calls its callback with the\n\t * conventional error argument or not.\n\t *\n\t * With this it becomes possible to leverage existing APIs while still reaping\n\t * the benefits of promises.\n\t *\n\t * @example\n\t * function onlySmallNumbers(n, callback) {\n\t *\t\tif(n < 10) {\n\t *\t\t\tcallback(null, n + 10);\n\t *\t\t} else {\n\t *\t\t\tcallback(new Error(\"Calculation failed\"));\n\t *\t\t}\n\t *\t}\n\t *\n\t * var nodefn = require(\"when/node/function\");\n\t *\n\t * // Logs '15'\n\t * nodefn.apply(onlySmallNumbers, [5]).then(console.log, console.error);\n\t *\n\t * // Logs 'Calculation failed'\n\t * nodefn.apply(onlySmallNumbers, [15]).then(console.log, console.error);\n\t *\n\t * @param {function} f node-style function that will be called\n\t * @param {Array} [args] array of arguments to func\n\t * @returns {Promise} promise for the value func passes to its callback\n\t */\n\tfunction apply(f, args) {\n\t\treturn _apply(f, this, args || []);\n\t}\n\n\tfunction dispatch(f, thisArg, args, h) {\n\t\tvar cb = createCallback(h);\n\t\ttry {\n\t\t\tswitch(args.length) {\n\t\t\t\tcase 2: f.call(thisArg, args[0], args[1], cb); break;\n\t\t\t\tcase 1: f.call(thisArg, args[0], cb); break;\n\t\t\t\tcase 0: f.call(thisArg, cb); break;\n\t\t\t\tdefault:\n\t\t\t\t\targs.push(cb);\n\t\t\t\t\tf.apply(thisArg, args);\n\t\t\t}\n\t\t} catch(e) {\n\t\t\th.reject(e);\n\t\t}\n\t}\n\n\t/**\n\t * Has the same behavior that {@link apply} has, with the difference that the\n\t * arguments to the function are provided individually, while {@link apply} accepts\n\t * a single array.\n\t *\n\t * @example\n\t * function sumSmallNumbers(x, y, callback) {\n\t *\t\tvar result = x + y;\n\t *\t\tif(result < 10) {\n\t *\t\t\tcallback(null, result);\n\t *\t\t} else {\n\t *\t\t\tcallback(new Error(\"Calculation failed\"));\n\t *\t\t}\n\t *\t}\n\t *\n\t * // Logs '5'\n\t * nodefn.call(sumSmallNumbers, 2, 3).then(console.log, console.error);\n\t *\n\t * // Logs 'Calculation failed'\n\t * nodefn.call(sumSmallNumbers, 5, 10).then(console.log, console.error);\n\t *\n\t * @param {function} f node-style function that will be called\n\t * @param {...*} [args] arguments that will be forwarded to the function\n\t * @returns {Promise} promise for the value func passes to its callback\n\t */\n\tfunction call(f /*, args... */) {\n\t\treturn _apply(f, this, slice.call(arguments, 1));\n\t}\n\n\t/**\n\t * Takes a node-style function and returns new function that wraps the\n\t * original and, instead of taking a callback, returns a promise. Also, it\n\t * knows how to handle promises given as arguments, waiting for their\n\t * resolution before executing.\n\t *\n\t * Upon execution, the orginal function is executed as well. If it passes\n\t * a truthy value as the first argument to the callback, it will be\n\t * interpreted as an error condition, and the promise will be rejected\n\t * with it. Otherwise, the call is considered a resolution, and the promise\n\t * is resolved with the callback's second argument.\n\t *\n\t * @example\n\t * var fs = require(\"fs\"), nodefn = require(\"when/node/function\");\n\t *\n\t * var promiseRead = nodefn.lift(fs.readFile);\n\t *\n\t * // The promise is resolved with the contents of the file if everything\n\t * // goes ok\n\t * promiseRead('exists.txt').then(console.log, console.error);\n\t *\n\t * // And will be rejected if something doesn't work out\n\t * // (e.g. the files does not exist)\n\t * promiseRead('doesnt_exist.txt').then(console.log, console.error);\n\t *\n\t *\n\t * @param {Function} f node-style function to be lifted\n\t * @param {...*} [args] arguments to be prepended for the new function @deprecated\n\t * @returns {Function} a promise-returning function\n\t */\n\tfunction lift(f /*, args... */) {\n\t\tvar args1 = arguments.length > 1 ? slice.call(arguments, 1) : [];\n\t\treturn function() {\n\t\t\t// TODO: Simplify once partialing has been removed\n\t\t\tvar l = args1.length;\n\t\t\tvar al = arguments.length;\n\t\t\tvar args = new Array(al + l);\n\t\t\tvar i;\n\t\t\tfor(i=0; i 2) {\n\t\t\t\tresolver.resolve(slice.call(arguments, 1));\n\t\t\t} else {\n\t\t\t\tresolver.resolve(value);\n\t\t\t}\n\t\t};\n\t}\n\n\t/**\n\t * Attaches a node-style callback to a promise, ensuring the callback is\n\t * called for either fulfillment or rejection. Returns a promise with the same\n\t * state as the passed-in promise.\n\t *\n\t * @example\n\t *\tvar deferred = when.defer();\n\t *\n\t *\tfunction callback(err, value) {\n\t *\t\t// Handle err or use value\n\t *\t}\n\t *\n\t *\tbindCallback(deferred.promise, callback);\n\t *\n\t *\tdeferred.resolve('interesting value');\n\t *\n\t * @param {Promise} promise The promise to be attached to.\n\t * @param {Function} callback The node-style callback to attach.\n\t * @returns {Promise} A promise with the same state as the passed-in promise.\n\t */\n\tfunction bindCallback(promise, callback) {\n\t\tpromise = when(promise);\n\n\t\tif (callback) {\n\t\t\tpromise.then(success, wrapped);\n\t\t}\n\n\t\treturn promise;\n\n\t\tfunction success(value) {\n\t\t\twrapped(null, value);\n\t\t}\n\n\t\tfunction wrapped(err, value) {\n\t\t\tsetTimer(function () {\n\t\t\t\tcallback(err, value);\n\t\t\t}, 0);\n\t\t}\n\t}\n\n\t/**\n\t * Takes a node-style callback and returns new function that accepts a\n\t * promise, calling the original callback when the promise is either\n\t * fulfilled or rejected with the appropriate arguments.\n\t *\n\t * @example\n\t *\tvar deferred = when.defer();\n\t *\n\t *\tfunction callback(err, value) {\n\t *\t\t// Handle err or use value\n\t *\t}\n\t *\n\t *\tvar wrapped = liftCallback(callback);\n\t *\n\t *\t// `wrapped` can now be passed around at will\n\t *\twrapped(deferred.promise);\n\t *\n\t *\tdeferred.resolve('interesting value');\n\t *\n\t * @param {Function} callback The node-style callback to wrap.\n\t * @returns {Function} The lifted, promise-accepting function.\n\t */\n\tfunction liftCallback(callback) {\n\t\treturn function(promise) {\n\t\t\treturn bindCallback(promise, callback);\n\t\t};\n\t}\n});\n\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * parallel.js\n *\n * Run a set of task functions in parallel. All tasks will\n * receive the same args\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar all = when.Promise.all;\n\tvar slice = Array.prototype.slice;\n\n\t/**\n\t * Run array of tasks in parallel\n\t * @param tasks {Array|Promise} array or promiseForArray of task functions\n\t * @param [args] {*} arguments to be passed to all tasks\n\t * @return {Promise} promise for array containing the\n\t * result of each task in the array position corresponding\n\t * to position of the task in the tasks array\n\t */\n\treturn function parallel(tasks /*, args... */) {\n\t\treturn all(slice.call(arguments, 1)).then(function(args) {\n\t\t\treturn when.map(tasks, function(task) {\n\t\t\t\treturn task.apply(void 0, args);\n\t\t\t});\n\t\t});\n\t};\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * pipeline.js\n *\n * Run a set of task functions in sequence, passing the result\n * of the previous as an argument to the next. Like a shell\n * pipeline, e.g. `cat file.txt | grep 'foo' | sed -e 's/foo/bar/g'\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar all = when.Promise.all;\n\tvar slice = Array.prototype.slice;\n\n\t/**\n\t * Run array of tasks in a pipeline where the next\n\t * tasks receives the result of the previous. The first task\n\t * will receive the initialArgs as its argument list.\n\t * @param tasks {Array|Promise} array or promise for array of task functions\n\t * @param [initialArgs...] {*} arguments to be passed to the first task\n\t * @return {Promise} promise for return value of the final task\n\t */\n\treturn function pipeline(tasks /* initialArgs... */) {\n\t\t// Self-optimizing function to run first task with multiple\n\t\t// args using apply, but subsequence tasks via direct invocation\n\t\tvar runTask = function(args, task) {\n\t\t\trunTask = function(arg, task) {\n\t\t\t\treturn task(arg);\n\t\t\t};\n\n\t\t\treturn task.apply(null, args);\n\t\t};\n\n\t\treturn all(slice.call(arguments, 1)).then(function(args) {\n\t\t\treturn when.reduce(tasks, function(arg, task) {\n\t\t\t\treturn runTask(arg, task);\n\t\t\t}, args);\n\t\t});\n\t};\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2012-2013 original author or authors */\n\n/**\n * poll.js\n *\n * Helper that polls until cancelled or for a condition to become true.\n *\n * @author Scott Andrews\n */\n\n(function (define) { 'use strict';\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar attempt = when['try'];\n\tvar cancelable = require('./cancelable');\n\n\t/**\n\t * Periodically execute the task function on the msec delay. The result of\n\t * the task may be verified by watching for a condition to become true. The\n\t * returned deferred is cancellable if the polling needs to be cancelled\n\t * externally before reaching a resolved state.\n\t *\n\t * The next vote is scheduled after the results of the current vote are\n\t * verified and rejected.\n\t *\n\t * Polling may be terminated by the verifier returning a truthy value,\n\t * invoking cancel() on the returned promise, or the task function returning\n\t * a rejected promise.\n\t *\n\t * Usage:\n\t *\n\t * var count = 0;\n\t * function doSomething() { return count++ }\n\t *\n\t * // poll until cancelled\n\t * var p = poll(doSomething, 1000);\n\t * ...\n\t * p.cancel();\n\t *\n\t * // poll until condition is met\n\t * poll(doSomething, 1000, function(result) { return result > 10 })\n\t * .then(function(result) { assert result == 10 });\n\t *\n\t * // delay first vote\n\t * poll(doSomething, 1000, anyFunc, true);\n\t *\n\t * @param task {Function} function that is executed after every timeout\n\t * @param interval {number|Function} timeout in milliseconds\n\t * @param [verifier] {Function} function to evaluate the result of the vote.\n\t * May return a {Promise} or a {Boolean}. Rejecting the promise or a\n\t * falsey value will schedule the next vote.\n\t * @param [delayInitialTask] {boolean} if truthy, the first vote is scheduled\n\t * instead of immediate\n\t *\n\t * @returns {Promise}\n\t */\n\treturn function poll(task, interval, verifier, delayInitialTask) {\n\t\tvar deferred, canceled, reject;\n\n\t\tcanceled = false;\n\t\tdeferred = cancelable(when.defer(), function () { canceled = true; });\n\t\treject = deferred.reject;\n\n\t\tverifier = verifier || function () { return false; };\n\n\t\tif (typeof interval !== 'function') {\n\t\t\tinterval = (function (interval) {\n\t\t\t\treturn function () { return when().delay(interval); };\n\t\t\t})(interval);\n\t\t}\n\n\t\tfunction certify(result) {\n\t\t\tdeferred.resolve(result);\n\t\t}\n\n\t\tfunction schedule(result) {\n\t\t\tattempt(interval).then(vote, reject);\n\t\t\tif (result !== void 0) {\n\t\t\t\tdeferred.notify(result);\n\t\t\t}\n\t\t}\n\n\t\tfunction vote() {\n\t\t\tif (canceled) { return; }\n\t\t\twhen(task(),\n\t\t\t\tfunction (result) {\n\t\t\t\t\twhen(verifier(result),\n\t\t\t\t\t\tfunction (verification) {\n\t\t\t\t\t\t\treturn verification ? certify(result) : schedule(result);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction () { schedule(result); }\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\treject\n\t\t\t);\n\t\t}\n\n\t\tif (delayInitialTask) {\n\t\t\tschedule();\n\t\t} else {\n\t\t\t// if task() is blocking, vote will also block\n\t\t\tvote();\n\t\t}\n\n\t\t// make the promise cancelable\n\t\tdeferred.promise = Object.create(deferred.promise);\n\t\tdeferred.promise.cancel = deferred.cancel;\n\n\t\treturn deferred.promise;\n\t};\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * sequence.js\n *\n * Run a set of task functions in sequence. All tasks will\n * receive the same args.\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar all = when.Promise.all;\n\tvar slice = Array.prototype.slice;\n\n\t/**\n\t * Run array of tasks in sequence with no overlap\n\t * @param tasks {Array|Promise} array or promiseForArray of task functions\n\t * @param [args] {*} arguments to be passed to all tasks\n\t * @return {Promise} promise for an array containing\n\t * the result of each task in the array position corresponding\n\t * to position of the task in the tasks array\n\t */\n\treturn function sequence(tasks /*, args... */) {\n\t\tvar results = [];\n\n\t\treturn all(slice.call(arguments, 1)).then(function(args) {\n\t\t\treturn when.reduce(tasks, function(results, task) {\n\t\t\t\treturn when(task.apply(void 0, args), addResult);\n\t\t\t}, results);\n\t\t});\n\n\t\tfunction addResult(result) {\n\t\t\tresults.push(result);\n\t\t\treturn results;\n\t\t}\n\t};\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * timeout.js\n *\n * Helper that returns a promise that rejects after a specified timeout,\n * if not explicitly resolved or rejected before that.\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\n /**\n\t * @deprecated Use when(trigger).timeout(ms)\n */\n return function timeout(msec, trigger) {\n\t\treturn when(trigger).timeout(msec);\n };\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n\n/**\n * Promises/A+ and when() implementation\n * when is part of the cujoJS family of libraries (http://cujojs.com/)\n * @author Brian Cavalier\n * @author John Hann\n */\n(function(define) { 'use strict';\ndefine(function (require) {\n\n\tvar timed = require('./lib/decorators/timed');\n\tvar array = require('./lib/decorators/array');\n\tvar flow = require('./lib/decorators/flow');\n\tvar fold = require('./lib/decorators/fold');\n\tvar inspect = require('./lib/decorators/inspect');\n\tvar generate = require('./lib/decorators/iterate');\n\tvar progress = require('./lib/decorators/progress');\n\tvar withThis = require('./lib/decorators/with');\n\tvar unhandledRejection = require('./lib/decorators/unhandledRejection');\n\tvar TimeoutError = require('./lib/TimeoutError');\n\n\tvar Promise = [array, flow, fold, generate, progress,\n\t\tinspect, withThis, timed, unhandledRejection]\n\t\t.reduce(function(Promise, feature) {\n\t\t\treturn feature(Promise);\n\t\t}, require('./lib/Promise'));\n\n\tvar apply = require('./lib/apply')(Promise);\n\n\t// Public API\n\n\twhen.promise = promise; // Create a pending promise\n\twhen.resolve = Promise.resolve; // Create a resolved promise\n\twhen.reject = Promise.reject; // Create a rejected promise\n\n\twhen.lift = lift; // lift a function to return promises\n\twhen['try'] = attempt; // call a function and return a promise\n\twhen.attempt = attempt; // alias for when.try\n\n\twhen.iterate = Promise.iterate; // DEPRECATED (use cujojs/most streams) Generate a stream of promises\n\twhen.unfold = Promise.unfold; // DEPRECATED (use cujojs/most streams) Generate a stream of promises\n\n\twhen.join = join; // Join 2 or more promises\n\n\twhen.all = all; // Resolve a list of promises\n\twhen.settle = settle; // Settle a list of promises\n\n\twhen.any = lift(Promise.any); // One-winner race\n\twhen.some = lift(Promise.some); // Multi-winner race\n\twhen.race = lift(Promise.race); // First-to-settle race\n\n\twhen.map = map; // Array.map() for promises\n\twhen.filter = filter; // Array.filter() for promises\n\twhen.reduce = lift(Promise.reduce); // Array.reduce() for promises\n\twhen.reduceRight = lift(Promise.reduceRight); // Array.reduceRight() for promises\n\n\twhen.isPromiseLike = isPromiseLike; // Is something promise-like, aka thenable\n\n\twhen.Promise = Promise; // Promise constructor\n\twhen.defer = defer; // Create a {promise, resolve, reject} tuple\n\n\t// Error types\n\n\twhen.TimeoutError = TimeoutError;\n\n\t/**\n\t * Get a trusted promise for x, or by transforming x with onFulfilled\n\t *\n\t * @param {*} x\n\t * @param {function?} onFulfilled callback to be called when x is\n\t * successfully fulfilled. If promiseOrValue is an immediate value, callback\n\t * will be invoked immediately.\n\t * @param {function?} onRejected callback to be called when x is\n\t * rejected.\n\t * @param {function?} onProgress callback to be called when progress updates\n\t * are issued for x. @deprecated\n\t * @returns {Promise} a new promise that will fulfill with the return\n\t * value of callback or errback or the completion value of promiseOrValue if\n\t * callback and/or errback is not supplied.\n\t */\n\tfunction when(x, onFulfilled, onRejected, onProgress) {\n\t\tvar p = Promise.resolve(x);\n\t\tif (arguments.length < 2) {\n\t\t\treturn p;\n\t\t}\n\n\t\treturn p.then(onFulfilled, onRejected, onProgress);\n\t}\n\n\t/**\n\t * Creates a new promise whose fate is determined by resolver.\n\t * @param {function} resolver function(resolve, reject, notify)\n\t * @returns {Promise} promise whose fate is determine by resolver\n\t */\n\tfunction promise(resolver) {\n\t\treturn new Promise(resolver);\n\t}\n\n\t/**\n\t * Lift the supplied function, creating a version of f that returns\n\t * promises, and accepts promises as arguments.\n\t * @param {function} f\n\t * @returns {Function} version of f that returns promises\n\t */\n\tfunction lift(f) {\n\t\treturn function() {\n\t\t\tfor(var i=0, l=arguments.length, a=new Array(l); i 1 ? slice.call(arguments, 1) : [];\n\t\treturn function() {\n\t\t\treturn _apply(f, this, args.concat(slice.call(arguments)));\n\t\t};\n\t}\n\n\t/**\n\t * Lift all the functions/methods on src\n\t * @param {object|function} src source whose functions will be lifted\n\t * @param {function?} combine optional function for customizing the lifting\n\t * process. It is passed dst, the lifted function, and the property name of\n\t * the original function on src.\n\t * @param {(object|function)?} dst option destination host onto which to place lifted\n\t * functions. If not provided, liftAll returns a new object.\n\t * @returns {*} If dst is provided, returns dst with lifted functions as\n\t * properties. If dst not provided, returns a new object with lifted functions.\n\t */\n\tfunction liftAll(src, combine, dst) {\n\t\treturn _liftAll(lift, combine, dst, src);\n\t}\n\n\t/**\n\t * `promisify` is a version of `lift` that allows fine-grained control over the\n\t * arguments that passed to the underlying function. It is intended to handle\n\t * functions that don't follow the common callback and errback positions.\n\t *\n\t * The control is done by passing an object whose 'callback' and/or 'errback'\n\t * keys, whose values are the corresponding 0-based indexes of the arguments on\n\t * the function. Negative values are interpreted as being relative to the end\n\t * of the arguments array.\n\t *\n\t * If arguments are given on the call to the 'promisified' function, they are\n\t * intermingled with the callback and errback. If a promise is given among them,\n\t * the execution of the function will only occur after its resolution.\n\t *\n\t * @example\n\t * var delay = callbacks.promisify(setTimeout, {\n\t *\t\tcallback: 0\n\t *\t});\n\t *\n\t * delay(100).then(function() {\n\t *\t\tconsole.log(\"This happens 100ms afterwards\");\n\t *\t});\n\t *\n\t * @example\n\t * function callbackAsLast(errback, followsStandards, callback) {\n\t *\t\tif(followsStandards) {\n\t *\t\t\tcallback(\"well done!\");\n\t *\t\t} else {\n\t *\t\t\terrback(\"some programmers just want to watch the world burn\");\n\t *\t\t}\n\t *\t}\n\t *\n\t * var promisified = callbacks.promisify(callbackAsLast, {\n\t *\t\tcallback: -1,\n\t *\t\terrback: 0,\n\t *\t});\n\t *\n\t * promisified(true).then(console.log, console.error);\n\t * promisified(false).then(console.log, console.error);\n\t *\n\t * @param {Function} asyncFunction traditional function to be decorated\n\t * @param {object} positions\n\t * @param {number} [positions.callback] index at which asyncFunction expects to\n\t * receive a success callback\n\t * @param {number} [positions.errback] index at which asyncFunction expects to\n\t * receive an error callback\n\t * @returns {function} promisified function that accepts\n\t *\n\t * @deprecated\n\t */\n\tfunction promisify(asyncFunction, positions) {\n\n\t\treturn function() {\n\t\t\tvar thisArg = this;\n\t\t\treturn Promise.all(arguments).then(function(args) {\n\t\t\t\tvar p = Promise._defer();\n\n\t\t\t\tvar callbackPos, errbackPos;\n\n\t\t\t\tif(typeof positions.callback === 'number') {\n\t\t\t\t\tcallbackPos = normalizePosition(args, positions.callback);\n\t\t\t\t}\n\n\t\t\t\tif(typeof positions.errback === 'number') {\n\t\t\t\t\terrbackPos = normalizePosition(args, positions.errback);\n\t\t\t\t}\n\n\t\t\t\tif(errbackPos < callbackPos) {\n\t\t\t\t\tinsertCallback(args, errbackPos, p._handler.reject, p._handler);\n\t\t\t\t\tinsertCallback(args, callbackPos, p._handler.resolve, p._handler);\n\t\t\t\t} else {\n\t\t\t\t\tinsertCallback(args, callbackPos, p._handler.resolve, p._handler);\n\t\t\t\t\tinsertCallback(args, errbackPos, p._handler.reject, p._handler);\n\t\t\t\t}\n\n\t\t\t\tasyncFunction.apply(thisArg, args);\n\n\t\t\t\treturn p;\n\t\t\t});\n\t\t};\n\t}\n\n\tfunction normalizePosition(args, pos) {\n\t\treturn pos < 0 ? (args.length + pos + 2) : pos;\n\t}\n\n\tfunction insertCallback(args, pos, callback, thisArg) {\n\t\tif(typeof pos === 'number') {\n\t\t\targs.splice(pos, 0, alwaysUnary(callback, thisArg));\n\t\t}\n\t}\n\n\tfunction alwaysUnary(fn, thisArg) {\n\t\treturn function() {\n\t\t\tif (arguments.length > 1) {\n\t\t\t\tfn.call(thisArg, slice.call(arguments));\n\t\t\t} else {\n\t\t\t\tfn.apply(thisArg, arguments);\n\t\t\t}\n\t\t};\n\t}\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n","/** @license MIT License (c) copyright B Cavalier & J Hann */\n\n/**\n * cancelable.js\n * @deprecated\n *\n * Decorator that makes a deferred \"cancelable\". It adds a cancel() method that\n * will call a special cancel handler function and then reject the deferred. The\n * cancel handler can be used to do resource cleanup, or anything else that should\n * be done before any other rejection handlers are executed.\n *\n * Usage:\n *\n * var cancelableDeferred = cancelable(when.defer(), myCancelHandler);\n *\n * @author brian@hovercraftstudios.com\n */\n\n(function(define) {\ndefine(function() {\n\n /**\n * Makes deferred cancelable, adding a cancel() method.\n\t * @deprecated\n *\n * @param deferred {Deferred} the {@link Deferred} to make cancelable\n * @param canceler {Function} cancel handler function to execute when this deferred\n\t * is canceled. This is guaranteed to run before all other rejection handlers.\n\t * The canceler will NOT be executed if the deferred is rejected in the standard\n\t * way, i.e. deferred.reject(). It ONLY executes if the deferred is canceled,\n\t * i.e. deferred.cancel()\n *\n * @returns deferred, with an added cancel() method.\n */\n return function(deferred, canceler) {\n // Add a cancel method to the deferred to reject the delegate\n // with the special canceled indicator.\n deferred.cancel = function() {\n\t\t\ttry {\n\t\t\t\tdeferred.reject(canceler(deferred));\n\t\t\t} catch(e) {\n\t\t\t\tdeferred.reject(e);\n\t\t\t}\n\n\t\t\treturn deferred.promise;\n };\n\n return deferred;\n };\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(); });\n\n\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * delay.js\n *\n * Helper that returns a promise that resolves after a delay.\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\n /**\n\t * @deprecated Use when(value).delay(ms)\n */\n return function delay(msec, value) {\n\t\treturn when(value).delay(msec);\n };\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2013-2014 original author or authors */\n\n/**\n * Collection of helper functions for wrapping and executing 'traditional'\n * synchronous functions in a promise interface.\n *\n * @author Brian Cavalier\n * @contributor Renato Zannon\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar attempt = when['try'];\n\tvar _liftAll = require('./lib/liftAll');\n\tvar _apply = require('./lib/apply')(when.Promise);\n\tvar slice = Array.prototype.slice;\n\n\treturn {\n\t\tlift: lift,\n\t\tliftAll: liftAll,\n\t\tcall: attempt,\n\t\tapply: apply,\n\t\tcompose: compose\n\t};\n\n\t/**\n\t * Takes a function and an optional array of arguments (that might be promises),\n\t * and calls the function. The return value is a promise whose resolution\n\t * depends on the value returned by the function.\n\t * @param {function} f function to be called\n\t * @param {Array} [args] array of arguments to func\n\t * @returns {Promise} promise for the return value of func\n\t */\n\tfunction apply(f, args) {\n\t\t// slice args just in case the caller passed an Arguments instance\n\t\treturn _apply(f, this, args == null ? [] : slice.call(args));\n\t}\n\n\t/**\n\t * Takes a 'regular' function and returns a version of that function that\n\t * returns a promise instead of a plain value, and handles thrown errors by\n\t * returning a rejected promise. Also accepts a list of arguments to be\n\t * prepended to the new function, as does Function.prototype.bind.\n\t *\n\t * The resulting function is promise-aware, in the sense that it accepts\n\t * promise arguments, and waits for their resolution.\n\t * @param {Function} f function to be bound\n\t * @param {...*} [args] arguments to be prepended for the new function @deprecated\n\t * @returns {Function} a promise-returning function\n\t */\n\tfunction lift(f /*, args... */) {\n\t\tvar args = arguments.length > 1 ? slice.call(arguments, 1) : [];\n\t\treturn function() {\n\t\t\treturn _apply(f, this, args.concat(slice.call(arguments)));\n\t\t};\n\t}\n\n\t/**\n\t * Lift all the functions/methods on src\n\t * @param {object|function} src source whose functions will be lifted\n\t * @param {function?} combine optional function for customizing the lifting\n\t * process. It is passed dst, the lifted function, and the property name of\n\t * the original function on src.\n\t * @param {(object|function)?} dst option destination host onto which to place lifted\n\t * functions. If not provided, liftAll returns a new object.\n\t * @returns {*} If dst is provided, returns dst with lifted functions as\n\t * properties. If dst not provided, returns a new object with lifted functions.\n\t */\n\tfunction liftAll(src, combine, dst) {\n\t\treturn _liftAll(lift, combine, dst, src);\n\t}\n\n\t/**\n\t * Composes multiple functions by piping their return values. It is\n\t * transparent to whether the functions return 'regular' values or promises:\n\t * the piped argument is always a resolved value. If one of the functions\n\t * throws or returns a rejected promise, the composed promise will be also\n\t * rejected.\n\t *\n\t * The arguments (or promises to arguments) given to the returned function (if\n\t * any), are passed directly to the first function on the 'pipeline'.\n\t * @param {Function} f the function to which the arguments will be passed\n\t * @param {...Function} [funcs] functions that will be composed, in order\n\t * @returns {Function} a promise-returning composition of the functions\n\t */\n\tfunction compose(f /*, funcs... */) {\n\t\tvar funcs = slice.call(arguments, 1);\n\n\t\treturn function() {\n\t\t\tvar thisArg = this;\n\t\t\tvar args = slice.call(arguments);\n\t\t\tvar firstPromise = attempt.apply(thisArg, [f].concat(args));\n\n\t\t\treturn when.reduce(funcs, function(arg, func) {\n\t\t\t\treturn func.call(thisArg, arg);\n\t\t\t}, firstPromise);\n\t\t};\n\t}\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * Generalized promise concurrency guard\n * Adapted from original concept by Sakari Jokinen (Rocket Pack, Ltd.)\n *\n * @author Brian Cavalier\n * @author John Hann\n * @contributor Sakari Jokinen\n */\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar slice = Array.prototype.slice;\n\n\tguard.n = n;\n\n\treturn guard;\n\n\t/**\n\t * Creates a guarded version of f that can only be entered when the supplied\n\t * condition allows.\n\t * @param {function} condition represents a critical section that may only\n\t * be entered when allowed by the condition\n\t * @param {function} f function to guard\n\t * @returns {function} guarded version of f\n\t */\n\tfunction guard(condition, f) {\n\t\treturn function() {\n\t\t\tvar args = slice.call(arguments);\n\n\t\t\treturn when(condition()).withThis(this).then(function(exit) {\n\t\t\t\treturn when(f.apply(this, args))['finally'](exit);\n\t\t\t});\n\t\t};\n\t}\n\n\t/**\n\t * Creates a condition that allows only n simultaneous executions\n\t * of a guarded function\n\t * @param {number} allowed number of allowed simultaneous executions\n\t * @returns {function} condition function which returns a promise that\n\t * fulfills when the critical section may be entered. The fulfillment\n\t * value is a function (\"notifyExit\") that must be called when the critical\n\t * section has been exited.\n\t */\n\tfunction n(allowed) {\n\t\tvar count = 0;\n\t\tvar waiting = [];\n\n\t\treturn function enter() {\n\t\t\treturn when.promise(function(resolve) {\n\t\t\t\tif(count < allowed) {\n\t\t\t\t\tresolve(exit);\n\t\t\t\t} else {\n\t\t\t\t\twaiting.push(resolve);\n\t\t\t\t}\n\t\t\t\tcount += 1;\n\t\t\t});\n\t\t};\n\n\t\tfunction exit() {\n\t\t\tcount = Math.max(count - 1, 0);\n\t\t\tif(waiting.length > 0) {\n\t\t\t\twaiting.shift()(exit);\n\t\t\t}\n\t\t}\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * Licensed under the MIT License at:\n * http://www.opensource.org/licenses/mit-license.php\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar Promise = when.Promise;\n\tvar toPromise = when.resolve;\n\n\treturn {\n\t\tall: when.lift(all),\n\t\tmap: map,\n\t\tsettle: settle\n\t};\n\n\t/**\n\t * Resolve all the key-value pairs in the supplied object or promise\n\t * for an object.\n\t * @param {Promise|object} object or promise for object whose key-value pairs\n\t * will be resolved\n\t * @returns {Promise} promise for an object with the fully resolved key-value pairs\n\t */\n\tfunction all(object) {\n\t\tvar p = Promise._defer();\n\t\tvar resolver = Promise._handler(p);\n\n\t\tvar results = {};\n\t\tvar keys = Object.keys(object);\n\t\tvar pending = keys.length;\n\n\t\tfor(var i=0, k; i>>0;\n\n\t\t\tvar pending = l;\n\t\t\tvar errors = [];\n\n\t\t\tfor (var h, x, i = 0; i < l; ++i) {\n\t\t\t\tx = promises[i];\n\t\t\t\tif(x === void 0 && !(i in promises)) {\n\t\t\t\t\t--pending;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\th = Promise._handler(x);\n\t\t\t\tif(h.state() > 0) {\n\t\t\t\t\tresolver.become(h);\n\t\t\t\t\tPromise._visitRemaining(promises, i, h);\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\th.visit(resolver, handleFulfill, handleReject);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(pending === 0) {\n\t\t\t\tresolver.reject(new RangeError('any(): array must not be empty'));\n\t\t\t}\n\n\t\t\treturn p;\n\n\t\t\tfunction handleFulfill(x) {\n\t\t\t\t/*jshint validthis:true*/\n\t\t\t\terrors = null;\n\t\t\t\tthis.resolve(x); // this === resolver\n\t\t\t}\n\n\t\t\tfunction handleReject(e) {\n\t\t\t\t/*jshint validthis:true*/\n\t\t\t\tif(this.resolved) { // this === resolver\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\terrors.push(e);\n\t\t\t\tif(--pending === 0) {\n\t\t\t\t\tthis.reject(errors);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * N-winner competitive race\n\t\t * Return a promise that will fulfill when n input promises have\n\t\t * fulfilled, or will reject when it becomes impossible for n\n\t\t * input promises to fulfill (ie when promises.length - n + 1\n\t\t * have rejected)\n\t\t * @param {array} promises\n\t\t * @param {number} n\n\t\t * @returns {Promise} promise for the earliest n fulfillment values\n\t\t *\n\t\t * @deprecated\n\t\t */\n\t\tfunction some(promises, n) {\n\t\t\t/*jshint maxcomplexity:7*/\n\t\t\tvar p = Promise._defer();\n\t\t\tvar resolver = p._handler;\n\n\t\t\tvar results = [];\n\t\t\tvar errors = [];\n\n\t\t\tvar l = promises.length>>>0;\n\t\t\tvar nFulfill = 0;\n\t\t\tvar nReject;\n\t\t\tvar x, i; // reused in both for() loops\n\n\t\t\t// First pass: count actual array items\n\t\t\tfor(i=0; i nFulfill) {\n\t\t\t\tresolver.reject(new RangeError('some(): array must contain at least '\n\t\t\t\t+ n + ' item(s), but had ' + nFulfill));\n\t\t\t} else if(nFulfill === 0) {\n\t\t\t\tresolver.resolve(results);\n\t\t\t}\n\n\t\t\t// Second pass: observe each array item, make progress toward goals\n\t\t\tfor(i=0; i 2 ? ar.call(promises, liftCombine(f), arguments[2])\n\t\t\t\t\t: ar.call(promises, liftCombine(f));\n\t\t}\n\n\t\t/**\n\t\t * Traditional reduce function, similar to `Array.prototype.reduceRight()`, but\n\t\t * input may contain promises and/or values, and reduceFunc\n\t\t * may return either a value or a promise, *and* initialValue may\n\t\t * be a promise for the starting value.\n\t\t * @param {Array|Promise} promises array or promise for an array of anything,\n\t\t * may contain a mix of promises and values.\n\t\t * @param {function(accumulated:*, x:*, index:Number):*} f reduce function\n\t\t * @returns {Promise} that will resolve to the final reduced value\n\t\t */\n\t\tfunction reduceRight(promises, f /*, initialValue */) {\n\t\t\treturn arguments.length > 2 ? arr.call(promises, liftCombine(f), arguments[2])\n\t\t\t\t\t: arr.call(promises, liftCombine(f));\n\t\t}\n\n\t\tfunction liftCombine(f) {\n\t\t\treturn function(z, x, i) {\n\t\t\t\treturn applyFold(f, void 0, [z,x,i]);\n\t\t\t};\n\t\t}\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function flow(Promise) {\n\n\t\tvar resolve = Promise.resolve;\n\t\tvar reject = Promise.reject;\n\t\tvar origCatch = Promise.prototype['catch'];\n\n\t\t/**\n\t\t * Handle the ultimate fulfillment value or rejection reason, and assume\n\t\t * responsibility for all errors. If an error propagates out of result\n\t\t * or handleFatalError, it will be rethrown to the host, resulting in a\n\t\t * loud stack track on most platforms and a crash on some.\n\t\t * @param {function?} onResult\n\t\t * @param {function?} onError\n\t\t * @returns {undefined}\n\t\t */\n\t\tPromise.prototype.done = function(onResult, onError) {\n\t\t\tthis._handler.visit(this._handler.receiver, onResult, onError);\n\t\t};\n\n\t\t/**\n\t\t * Add Error-type and predicate matching to catch. Examples:\n\t\t * promise.catch(TypeError, handleTypeError)\n\t\t * .catch(predicate, handleMatchedErrors)\n\t\t * .catch(handleRemainingErrors)\n\t\t * @param onRejected\n\t\t * @returns {*}\n\t\t */\n\t\tPromise.prototype['catch'] = Promise.prototype.otherwise = function(onRejected) {\n\t\t\tif (arguments.length < 2) {\n\t\t\t\treturn origCatch.call(this, onRejected);\n\t\t\t}\n\n\t\t\tif(typeof onRejected !== 'function') {\n\t\t\t\treturn this.ensure(rejectInvalidPredicate);\n\t\t\t}\n\n\t\t\treturn origCatch.call(this, createCatchFilter(arguments[1], onRejected));\n\t\t};\n\n\t\t/**\n\t\t * Wraps the provided catch handler, so that it will only be called\n\t\t * if the predicate evaluates truthy\n\t\t * @param {?function} handler\n\t\t * @param {function} predicate\n\t\t * @returns {function} conditional catch handler\n\t\t */\n\t\tfunction createCatchFilter(handler, predicate) {\n\t\t\treturn function(e) {\n\t\t\t\treturn evaluatePredicate(e, predicate)\n\t\t\t\t\t? handler.call(this, e)\n\t\t\t\t\t: reject(e);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Ensures that onFulfilledOrRejected will be called regardless of whether\n\t\t * this promise is fulfilled or rejected. onFulfilledOrRejected WILL NOT\n\t\t * receive the promises' value or reason. Any returned value will be disregarded.\n\t\t * onFulfilledOrRejected may throw or return a rejected promise to signal\n\t\t * an additional error.\n\t\t * @param {function} handler handler to be called regardless of\n\t\t * fulfillment or rejection\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype['finally'] = Promise.prototype.ensure = function(handler) {\n\t\t\tif(typeof handler !== 'function') {\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\treturn this.then(function(x) {\n\t\t\t\treturn runSideEffect(handler, this, identity, x);\n\t\t\t}, function(e) {\n\t\t\t\treturn runSideEffect(handler, this, reject, e);\n\t\t\t});\n\t\t};\n\n\t\tfunction runSideEffect (handler, thisArg, propagate, value) {\n\t\t\tvar result = handler.call(thisArg);\n\t\t\treturn maybeThenable(result)\n\t\t\t\t? propagateValue(result, propagate, value)\n\t\t\t\t: propagate(value);\n\t\t}\n\n\t\tfunction propagateValue (result, propagate, x) {\n\t\t\treturn resolve(result).then(function () {\n\t\t\t\treturn propagate(x);\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Recover from a failure by returning a defaultValue. If defaultValue\n\t\t * is a promise, it's fulfillment value will be used. If defaultValue is\n\t\t * a promise that rejects, the returned promise will reject with the\n\t\t * same reason.\n\t\t * @param {*} defaultValue\n\t\t * @returns {Promise} new promise\n\t\t */\n\t\tPromise.prototype['else'] = Promise.prototype.orElse = function(defaultValue) {\n\t\t\treturn this.then(void 0, function() {\n\t\t\t\treturn defaultValue;\n\t\t\t});\n\t\t};\n\n\t\t/**\n\t\t * Shortcut for .then(function() { return value; })\n\t\t * @param {*} value\n\t\t * @return {Promise} a promise that:\n\t\t * - is fulfilled if value is not a promise, or\n\t\t * - if value is a promise, will fulfill with its value, or reject\n\t\t * with its reason.\n\t\t */\n\t\tPromise.prototype['yield'] = function(value) {\n\t\t\treturn this.then(function() {\n\t\t\t\treturn value;\n\t\t\t});\n\t\t};\n\n\t\t/**\n\t\t * Runs a side effect when this promise fulfills, without changing the\n\t\t * fulfillment value.\n\t\t * @param {function} onFulfilledSideEffect\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype.tap = function(onFulfilledSideEffect) {\n\t\t\treturn this.then(onFulfilledSideEffect)['yield'](this);\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n\tfunction rejectInvalidPredicate() {\n\t\tthrow new TypeError('catch predicate must be a function');\n\t}\n\n\tfunction evaluatePredicate(e, predicate) {\n\t\treturn isError(predicate) ? e instanceof predicate : predicate(e);\n\t}\n\n\tfunction isError(predicate) {\n\t\treturn predicate === Error\n\t\t\t|| (predicate != null && predicate.prototype instanceof Error);\n\t}\n\n\tfunction maybeThenable(x) {\n\t\treturn (typeof x === 'object' || typeof x === 'function') && x !== null;\n\t}\n\n\tfunction identity(x) {\n\t\treturn x;\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n/** @author Jeff Escalante */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function fold(Promise) {\n\n\t\tPromise.prototype.fold = function(f, z) {\n\t\t\tvar promise = this._beget();\n\n\t\t\tthis._handler.fold(function(z, x, to) {\n\t\t\t\tPromise._handler(z).fold(function(x, z, to) {\n\t\t\t\t\tto.resolve(f.call(this, z, x));\n\t\t\t\t}, x, this, to);\n\t\t\t}, z, promise._handler.receiver, promise._handler);\n\n\t\t\treturn promise;\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar inspect = require('../state').inspect;\n\n\treturn function inspection(Promise) {\n\n\t\tPromise.prototype.inspect = function() {\n\t\t\treturn inspect(Promise._handler(this));\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function generate(Promise) {\n\n\t\tvar resolve = Promise.resolve;\n\n\t\tPromise.iterate = iterate;\n\t\tPromise.unfold = unfold;\n\n\t\treturn Promise;\n\n\t\t/**\n\t\t * @deprecated Use github.com/cujojs/most streams and most.iterate\n\t\t * Generate a (potentially infinite) stream of promised values:\n\t\t * x, f(x), f(f(x)), etc. until condition(x) returns true\n\t\t * @param {function} f function to generate a new x from the previous x\n\t\t * @param {function} condition function that, given the current x, returns\n\t\t * truthy when the iterate should stop\n\t\t * @param {function} handler function to handle the value produced by f\n\t\t * @param {*|Promise} x starting value, may be a promise\n\t\t * @return {Promise} the result of the last call to f before\n\t\t * condition returns true\n\t\t */\n\t\tfunction iterate(f, condition, handler, x) {\n\t\t\treturn unfold(function(x) {\n\t\t\t\treturn [x, f(x)];\n\t\t\t}, condition, handler, x);\n\t\t}\n\n\t\t/**\n\t\t * @deprecated Use github.com/cujojs/most streams and most.unfold\n\t\t * Generate a (potentially infinite) stream of promised values\n\t\t * by applying handler(generator(seed)) iteratively until\n\t\t * condition(seed) returns true.\n\t\t * @param {function} unspool function that generates a [value, newSeed]\n\t\t * given a seed.\n\t\t * @param {function} condition function that, given the current seed, returns\n\t\t * truthy when the unfold should stop\n\t\t * @param {function} handler function to handle the value produced by unspool\n\t\t * @param x {*|Promise} starting value, may be a promise\n\t\t * @return {Promise} the result of the last value produced by unspool before\n\t\t * condition returns true\n\t\t */\n\t\tfunction unfold(unspool, condition, handler, x) {\n\t\t\treturn resolve(x).then(function(seed) {\n\t\t\t\treturn resolve(condition(seed)).then(function(done) {\n\t\t\t\t\treturn done ? seed : resolve(unspool(seed)).spread(next);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tfunction next(item, newSeed) {\n\t\t\t\treturn resolve(handler(item)).then(function() {\n\t\t\t\t\treturn unfold(unspool, condition, handler, newSeed);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function progress(Promise) {\n\n\t\t/**\n\t\t * @deprecated\n\t\t * Register a progress handler for this promise\n\t\t * @param {function} onProgress\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype.progress = function(onProgress) {\n\t\t\treturn this.then(void 0, void 0, onProgress);\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar env = require('../env');\n\tvar TimeoutError = require('../TimeoutError');\n\n\tfunction setTimeout(f, ms, x, y) {\n\t\treturn env.setTimer(function() {\n\t\t\tf(x, y, ms);\n\t\t}, ms);\n\t}\n\n\treturn function timed(Promise) {\n\t\t/**\n\t\t * Return a new promise whose fulfillment value is revealed only\n\t\t * after ms milliseconds\n\t\t * @param {number} ms milliseconds\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype.delay = function(ms) {\n\t\t\tvar p = this._beget();\n\t\t\tthis._handler.fold(handleDelay, ms, void 0, p._handler);\n\t\t\treturn p;\n\t\t};\n\n\t\tfunction handleDelay(ms, x, h) {\n\t\t\tsetTimeout(resolveDelay, ms, x, h);\n\t\t}\n\n\t\tfunction resolveDelay(x, h) {\n\t\t\th.resolve(x);\n\t\t}\n\n\t\t/**\n\t\t * Return a new promise that rejects after ms milliseconds unless\n\t\t * this promise fulfills earlier, in which case the returned promise\n\t\t * fulfills with the same value.\n\t\t * @param {number} ms milliseconds\n\t\t * @param {Error|*=} reason optional rejection reason to use, defaults\n\t\t * to a TimeoutError if not provided\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype.timeout = function(ms, reason) {\n\t\t\tvar p = this._beget();\n\t\t\tvar h = p._handler;\n\n\t\t\tvar t = setTimeout(onTimeout, ms, reason, p._handler);\n\n\t\t\tthis._handler.visit(h,\n\t\t\t\tfunction onFulfill(x) {\n\t\t\t\t\tenv.clearTimer(t);\n\t\t\t\t\tthis.resolve(x); // this = h\n\t\t\t\t},\n\t\t\t\tfunction onReject(x) {\n\t\t\t\t\tenv.clearTimer(t);\n\t\t\t\t\tthis.reject(x); // this = h\n\t\t\t\t},\n\t\t\t\th.notify);\n\n\t\t\treturn p;\n\t\t};\n\n\t\tfunction onTimeout(reason, h, ms) {\n\t\t\tvar e = typeof reason === 'undefined'\n\t\t\t\t? new TimeoutError('timed out after ' + ms + 'ms')\n\t\t\t\t: reason;\n\t\t\th.reject(e);\n\t\t}\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function(require) {\n\n\tvar setTimer = require('../env').setTimer;\n\tvar format = require('../format');\n\n\treturn function unhandledRejection(Promise) {\n\n\t\tvar logError = noop;\n\t\tvar logInfo = noop;\n\t\tvar localConsole;\n\n\t\tif(typeof console !== 'undefined') {\n\t\t\t// Alias console to prevent things like uglify's drop_console option from\n\t\t\t// removing console.log/error. Unhandled rejections fall into the same\n\t\t\t// category as uncaught exceptions, and build tools shouldn't silence them.\n\t\t\tlocalConsole = console;\n\t\t\tlogError = typeof localConsole.error !== 'undefined'\n\t\t\t\t? function (e) { localConsole.error(e); }\n\t\t\t\t: function (e) { localConsole.log(e); };\n\n\t\t\tlogInfo = typeof localConsole.info !== 'undefined'\n\t\t\t\t? function (e) { localConsole.info(e); }\n\t\t\t\t: function (e) { localConsole.log(e); };\n\t\t}\n\n\t\tPromise.onPotentiallyUnhandledRejection = function(rejection) {\n\t\t\tenqueue(report, rejection);\n\t\t};\n\n\t\tPromise.onPotentiallyUnhandledRejectionHandled = function(rejection) {\n\t\t\tenqueue(unreport, rejection);\n\t\t};\n\n\t\tPromise.onFatalRejection = function(rejection) {\n\t\t\tenqueue(throwit, rejection.value);\n\t\t};\n\n\t\tvar tasks = [];\n\t\tvar reported = [];\n\t\tvar running = null;\n\n\t\tfunction report(r) {\n\t\t\tif(!r.handled) {\n\t\t\t\treported.push(r);\n\t\t\t\tlogError('Potentially unhandled rejection [' + r.id + '] ' + format.formatError(r.value));\n\t\t\t}\n\t\t}\n\n\t\tfunction unreport(r) {\n\t\t\tvar i = reported.indexOf(r);\n\t\t\tif(i >= 0) {\n\t\t\t\treported.splice(i, 1);\n\t\t\t\tlogInfo('Handled previous rejection [' + r.id + '] ' + format.formatObject(r.value));\n\t\t\t}\n\t\t}\n\n\t\tfunction enqueue(f, x) {\n\t\t\ttasks.push(f, x);\n\t\t\tif(running === null) {\n\t\t\t\trunning = setTimer(flush, 0);\n\t\t\t}\n\t\t}\n\n\t\tfunction flush() {\n\t\t\trunning = null;\n\t\t\twhile(tasks.length > 0) {\n\t\t\t\ttasks.shift()(tasks.shift());\n\t\t\t}\n\t\t}\n\n\t\treturn Promise;\n\t};\n\n\tfunction throwit(e) {\n\t\tthrow e;\n\t}\n\n\tfunction noop() {}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function addWith(Promise) {\n\t\t/**\n\t\t * Returns a promise whose handlers will be called with `this` set to\n\t\t * the supplied receiver. Subsequent promises derived from the\n\t\t * returned promise will also have their handlers called with receiver\n\t\t * as `this`. Calling `with` with undefined or no arguments will return\n\t\t * a promise whose handlers will again be called in the usual Promises/A+\n\t\t * way (no `this`) thus safely undoing any previous `with` in the\n\t\t * promise chain.\n\t\t *\n\t\t * WARNING: Promises returned from `with`/`withThis` are NOT Promises/A+\n\t\t * compliant, specifically violating 2.2.5 (http://promisesaplus.com/#point-41)\n\t\t *\n\t\t * @param {object} receiver `this` value for all handlers attached to\n\t\t * the returned promise.\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype['with'] = Promise.prototype.withThis = function(receiver) {\n\t\t\tvar p = this._beget();\n\t\t\tvar child = p._handler;\n\t\t\tchild.receiver = receiver;\n\t\t\tthis._handler.chain(child, receiver);\n\t\t\treturn p;\n\t\t};\n\n\t\treturn Promise;\n\t};\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n/*global process,document,setTimeout,clearTimeout,MutationObserver,WebKitMutationObserver*/\n(function(define) { 'use strict';\ndefine(function(require) {\n\t/*jshint maxcomplexity:6*/\n\n\t// Sniff \"best\" async scheduling option\n\t// Prefer process.nextTick or MutationObserver, then check for\n\t// setTimeout, and finally vertx, since its the only env that doesn't\n\t// have setTimeout\n\n\tvar MutationObs;\n\tvar capturedSetTimeout = typeof setTimeout !== 'undefined' && setTimeout;\n\n\t// Default env\n\tvar setTimer = function(f, ms) { return setTimeout(f, ms); };\n\tvar clearTimer = function(t) { return clearTimeout(t); };\n\tvar asap = function (f) { return capturedSetTimeout(f, 0); };\n\n\t// Detect specific env\n\tif (isNode()) { // Node\n\t\tasap = function (f) { return process.nextTick(f); };\n\n\t} else if (MutationObs = hasMutationObserver()) { // Modern browser\n\t\tasap = initMutationObserver(MutationObs);\n\n\t} else if (!capturedSetTimeout) { // vert.x\n\t\tvar vertxRequire = require;\n\t\tvar vertx = vertxRequire('vertx');\n\t\tsetTimer = function (f, ms) { return vertx.setTimer(ms, f); };\n\t\tclearTimer = vertx.cancelTimer;\n\t\tasap = vertx.runOnLoop || vertx.runOnContext;\n\t}\n\n\treturn {\n\t\tsetTimer: setTimer,\n\t\tclearTimer: clearTimer,\n\t\tasap: asap\n\t};\n\n\tfunction isNode () {\n\t\treturn typeof process !== 'undefined' &&\n\t\t\tObject.prototype.toString.call(process) === '[object process]';\n\t}\n\n\tfunction hasMutationObserver () {\n\t return (typeof MutationObserver !== 'undefined' && MutationObserver) ||\n\t\t\t(typeof WebKitMutationObserver !== 'undefined' && WebKitMutationObserver);\n\t}\n\n\tfunction initMutationObserver(MutationObserver) {\n\t\tvar scheduled;\n\t\tvar node = document.createTextNode('');\n\t\tvar o = new MutationObserver(run);\n\t\to.observe(node, { characterData: true });\n\n\t\tfunction run() {\n\t\t\tvar f = scheduled;\n\t\t\tscheduled = void 0;\n\t\t\tf();\n\t\t}\n\n\t\tvar i = 0;\n\t\treturn function (f) {\n\t\t\tscheduled = f;\n\t\t\tnode.data = (i ^= 1);\n\t\t};\n\t}\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn {\n\t\tformatError: formatError,\n\t\tformatObject: formatObject,\n\t\ttryStringify: tryStringify\n\t};\n\n\t/**\n\t * Format an error into a string. If e is an Error and has a stack property,\n\t * it's returned. Otherwise, e is formatted using formatObject, with a\n\t * warning added about e not being a proper Error.\n\t * @param {*} e\n\t * @returns {String} formatted string, suitable for output to developers\n\t */\n\tfunction formatError(e) {\n\t\tvar s = typeof e === 'object' && e !== null && (e.stack || e.message) ? e.stack || e.message : formatObject(e);\n\t\treturn e instanceof Error ? s : s + ' (WARNING: non-Error used)';\n\t}\n\n\t/**\n\t * Format an object, detecting \"plain\" objects and running them through\n\t * JSON.stringify if possible.\n\t * @param {Object} o\n\t * @returns {string}\n\t */\n\tfunction formatObject(o) {\n\t\tvar s = String(o);\n\t\tif(s === '[object Object]' && typeof JSON !== 'undefined') {\n\t\t\ts = tryStringify(o, s);\n\t\t}\n\t\treturn s;\n\t}\n\n\t/**\n\t * Try to return the result of JSON.stringify(x). If that fails, return\n\t * defaultValue\n\t * @param {*} x\n\t * @param {*} defaultValue\n\t * @returns {String|*} JSON.stringify(x) or defaultValue\n\t */\n\tfunction tryStringify(x, defaultValue) {\n\t\ttry {\n\t\t\treturn JSON.stringify(x);\n\t\t} catch(e) {\n\t\t\treturn defaultValue;\n\t\t}\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function liftAll(liftOne, combine, dst, src) {\n\t\tif(typeof combine === 'undefined') {\n\t\t\tcombine = defaultCombine;\n\t\t}\n\n\t\treturn Object.keys(src).reduce(function(dst, key) {\n\t\t\tvar f = src[key];\n\t\t\treturn typeof f === 'function' ? combine(dst, liftOne(f), key) : dst;\n\t\t}, typeof dst === 'undefined' ? defaultDst(src) : dst);\n\t};\n\n\tfunction defaultCombine(o, f, k) {\n\t\to[k] = f;\n\t\treturn o;\n\t}\n\n\tfunction defaultDst(src) {\n\t\treturn typeof src === 'function' ? src.bind() : Object.create(src);\n\t}\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function makePromise(environment) {\n\n\t\tvar tasks = environment.scheduler;\n\t\tvar emitRejection = initEmitRejection();\n\n\t\tvar objectCreate = Object.create ||\n\t\t\tfunction(proto) {\n\t\t\t\tfunction Child() {}\n\t\t\t\tChild.prototype = proto;\n\t\t\t\treturn new Child();\n\t\t\t};\n\n\t\t/**\n\t\t * Create a promise whose fate is determined by resolver\n\t\t * @constructor\n\t\t * @returns {Promise} promise\n\t\t * @name Promise\n\t\t */\n\t\tfunction Promise(resolver, handler) {\n\t\t\tthis._handler = resolver === Handler ? handler : init(resolver);\n\t\t}\n\n\t\t/**\n\t\t * Run the supplied resolver\n\t\t * @param resolver\n\t\t * @returns {Pending}\n\t\t */\n\t\tfunction init(resolver) {\n\t\t\tvar handler = new Pending();\n\n\t\t\ttry {\n\t\t\t\tresolver(promiseResolve, promiseReject, promiseNotify);\n\t\t\t} catch (e) {\n\t\t\t\tpromiseReject(e);\n\t\t\t}\n\n\t\t\treturn handler;\n\n\t\t\t/**\n\t\t\t * Transition from pre-resolution state to post-resolution state, notifying\n\t\t\t * all listeners of the ultimate fulfillment or rejection\n\t\t\t * @param {*} x resolution value\n\t\t\t */\n\t\t\tfunction promiseResolve (x) {\n\t\t\t\thandler.resolve(x);\n\t\t\t}\n\t\t\t/**\n\t\t\t * Reject this promise with reason, which will be used verbatim\n\t\t\t * @param {Error|*} reason rejection reason, strongly suggested\n\t\t\t * to be an Error type\n\t\t\t */\n\t\t\tfunction promiseReject (reason) {\n\t\t\t\thandler.reject(reason);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * @deprecated\n\t\t\t * Issue a progress event, notifying all progress listeners\n\t\t\t * @param {*} x progress event payload to pass to all listeners\n\t\t\t */\n\t\t\tfunction promiseNotify (x) {\n\t\t\t\thandler.notify(x);\n\t\t\t}\n\t\t}\n\n\t\t// Creation\n\n\t\tPromise.resolve = resolve;\n\t\tPromise.reject = reject;\n\t\tPromise.never = never;\n\n\t\tPromise._defer = defer;\n\t\tPromise._handler = getHandler;\n\n\t\t/**\n\t\t * Returns a trusted promise. If x is already a trusted promise, it is\n\t\t * returned, otherwise returns a new trusted Promise which follows x.\n\t\t * @param {*} x\n\t\t * @return {Promise} promise\n\t\t */\n\t\tfunction resolve(x) {\n\t\t\treturn isPromise(x) ? x\n\t\t\t\t: new Promise(Handler, new Async(getHandler(x)));\n\t\t}\n\n\t\t/**\n\t\t * Return a reject promise with x as its reason (x is used verbatim)\n\t\t * @param {*} x\n\t\t * @returns {Promise} rejected promise\n\t\t */\n\t\tfunction reject(x) {\n\t\t\treturn new Promise(Handler, new Async(new Rejected(x)));\n\t\t}\n\n\t\t/**\n\t\t * Return a promise that remains pending forever\n\t\t * @returns {Promise} forever-pending promise.\n\t\t */\n\t\tfunction never() {\n\t\t\treturn foreverPendingPromise; // Should be frozen\n\t\t}\n\n\t\t/**\n\t\t * Creates an internal {promise, resolver} pair\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tfunction defer() {\n\t\t\treturn new Promise(Handler, new Pending());\n\t\t}\n\n\t\t// Transformation and flow control\n\n\t\t/**\n\t\t * Transform this promise's fulfillment value, returning a new Promise\n\t\t * for the transformed result. If the promise cannot be fulfilled, onRejected\n\t\t * is called with the reason. onProgress *may* be called with updates toward\n\t\t * this promise's fulfillment.\n\t\t * @param {function=} onFulfilled fulfillment handler\n\t\t * @param {function=} onRejected rejection handler\n\t\t * @param {function=} onProgress @deprecated progress handler\n\t\t * @return {Promise} new promise\n\t\t */\n\t\tPromise.prototype.then = function(onFulfilled, onRejected, onProgress) {\n\t\t\tvar parent = this._handler;\n\t\t\tvar state = parent.join().state();\n\n\t\t\tif ((typeof onFulfilled !== 'function' && state > 0) ||\n\t\t\t\t(typeof onRejected !== 'function' && state < 0)) {\n\t\t\t\t// Short circuit: value will not change, simply share handler\n\t\t\t\treturn new this.constructor(Handler, parent);\n\t\t\t}\n\n\t\t\tvar p = this._beget();\n\t\t\tvar child = p._handler;\n\n\t\t\tparent.chain(child, parent.receiver, onFulfilled, onRejected, onProgress);\n\n\t\t\treturn p;\n\t\t};\n\n\t\t/**\n\t\t * If this promise cannot be fulfilled due to an error, call onRejected to\n\t\t * handle the error. Shortcut for .then(undefined, onRejected)\n\t\t * @param {function?} onRejected\n\t\t * @return {Promise}\n\t\t */\n\t\tPromise.prototype['catch'] = function(onRejected) {\n\t\t\treturn this.then(void 0, onRejected);\n\t\t};\n\n\t\t/**\n\t\t * Creates a new, pending promise of the same type as this promise\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype._beget = function() {\n\t\t\treturn begetFrom(this._handler, this.constructor);\n\t\t};\n\n\t\tfunction begetFrom(parent, Promise) {\n\t\t\tvar child = new Pending(parent.receiver, parent.join().context);\n\t\t\treturn new Promise(Handler, child);\n\t\t}\n\n\t\t// Array combinators\n\n\t\tPromise.all = all;\n\t\tPromise.race = race;\n\t\tPromise._traverse = traverse;\n\n\t\t/**\n\t\t * Return a promise that will fulfill when all promises in the\n\t\t * input array have fulfilled, or will reject when one of the\n\t\t * promises rejects.\n\t\t * @param {array} promises array of promises\n\t\t * @returns {Promise} promise for array of fulfillment values\n\t\t */\n\t\tfunction all(promises) {\n\t\t\treturn traverseWith(snd, null, promises);\n\t\t}\n\n\t\t/**\n\t\t * Array> -> Promise>\n\t\t * @private\n\t\t * @param {function} f function to apply to each promise's value\n\t\t * @param {Array} promises array of promises\n\t\t * @returns {Promise} promise for transformed values\n\t\t */\n\t\tfunction traverse(f, promises) {\n\t\t\treturn traverseWith(tryCatch2, f, promises);\n\t\t}\n\n\t\tfunction traverseWith(tryMap, f, promises) {\n\t\t\tvar handler = typeof f === 'function' ? mapAt : settleAt;\n\n\t\t\tvar resolver = new Pending();\n\t\t\tvar pending = promises.length >>> 0;\n\t\t\tvar results = new Array(pending);\n\n\t\t\tfor (var i = 0, x; i < promises.length && !resolver.resolved; ++i) {\n\t\t\t\tx = promises[i];\n\n\t\t\t\tif (x === void 0 && !(i in promises)) {\n\t\t\t\t\t--pending;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttraverseAt(promises, handler, i, x, resolver);\n\t\t\t}\n\n\t\t\tif(pending === 0) {\n\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t}\n\n\t\t\treturn new Promise(Handler, resolver);\n\n\t\t\tfunction mapAt(i, x, resolver) {\n\t\t\t\tif(!resolver.resolved) {\n\t\t\t\t\ttraverseAt(promises, settleAt, i, tryMap(f, x, i), resolver);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction settleAt(i, x, resolver) {\n\t\t\t\tresults[i] = x;\n\t\t\t\tif(--pending === 0) {\n\t\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction traverseAt(promises, handler, i, x, resolver) {\n\t\t\tif (maybeThenable(x)) {\n\t\t\t\tvar h = getHandlerMaybeThenable(x);\n\t\t\t\tvar s = h.state();\n\n\t\t\t\tif (s === 0) {\n\t\t\t\t\th.fold(handler, i, void 0, resolver);\n\t\t\t\t} else if (s > 0) {\n\t\t\t\t\thandler(i, h.value, resolver);\n\t\t\t\t} else {\n\t\t\t\t\tresolver.become(h);\n\t\t\t\t\tvisitRemaining(promises, i+1, h);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thandler(i, x, resolver);\n\t\t\t}\n\t\t}\n\n\t\tPromise._visitRemaining = visitRemaining;\n\t\tfunction visitRemaining(promises, start, handler) {\n\t\t\tfor(var i=start; i 0 ? toFulfilledState(handler.value)\n\t\t\t : toRejectedState(handler.value);\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2013 original author or authors */\n\n/**\n * Collection of helpers for interfacing with node-style asynchronous functions\n * using promises.\n *\n * @author Brian Cavalier\n * @contributor Renato Zannon\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar _liftAll = require('./lib/liftAll');\n\tvar setTimer = require('./lib/env').setTimer;\n\tvar slice = Array.prototype.slice;\n\n\tvar _apply = require('./lib/apply')(when.Promise, dispatch);\n\n\treturn {\n\t\tlift: lift,\n\t\tliftAll: liftAll,\n\t\tapply: apply,\n\t\tcall: call,\n\t\tcreateCallback: createCallback,\n\t\tbindCallback: bindCallback,\n\t\tliftCallback: liftCallback\n\t};\n\n\t/**\n\t * Takes a node-style async function and calls it immediately (with an optional\n\t * array of arguments or promises for arguments). It returns a promise whose\n\t * resolution depends on whether the async functions calls its callback with the\n\t * conventional error argument or not.\n\t *\n\t * With this it becomes possible to leverage existing APIs while still reaping\n\t * the benefits of promises.\n\t *\n\t * @example\n\t * function onlySmallNumbers(n, callback) {\n\t *\t\tif(n < 10) {\n\t *\t\t\tcallback(null, n + 10);\n\t *\t\t} else {\n\t *\t\t\tcallback(new Error(\"Calculation failed\"));\n\t *\t\t}\n\t *\t}\n\t *\n\t * var nodefn = require(\"when/node/function\");\n\t *\n\t * // Logs '15'\n\t * nodefn.apply(onlySmallNumbers, [5]).then(console.log, console.error);\n\t *\n\t * // Logs 'Calculation failed'\n\t * nodefn.apply(onlySmallNumbers, [15]).then(console.log, console.error);\n\t *\n\t * @param {function} f node-style function that will be called\n\t * @param {Array} [args] array of arguments to func\n\t * @returns {Promise} promise for the value func passes to its callback\n\t */\n\tfunction apply(f, args) {\n\t\treturn _apply(f, this, args || []);\n\t}\n\n\tfunction dispatch(f, thisArg, args, h) {\n\t\tvar cb = createCallback(h);\n\t\ttry {\n\t\t\tswitch(args.length) {\n\t\t\t\tcase 2: f.call(thisArg, args[0], args[1], cb); break;\n\t\t\t\tcase 1: f.call(thisArg, args[0], cb); break;\n\t\t\t\tcase 0: f.call(thisArg, cb); break;\n\t\t\t\tdefault:\n\t\t\t\t\targs.push(cb);\n\t\t\t\t\tf.apply(thisArg, args);\n\t\t\t}\n\t\t} catch(e) {\n\t\t\th.reject(e);\n\t\t}\n\t}\n\n\t/**\n\t * Has the same behavior that {@link apply} has, with the difference that the\n\t * arguments to the function are provided individually, while {@link apply} accepts\n\t * a single array.\n\t *\n\t * @example\n\t * function sumSmallNumbers(x, y, callback) {\n\t *\t\tvar result = x + y;\n\t *\t\tif(result < 10) {\n\t *\t\t\tcallback(null, result);\n\t *\t\t} else {\n\t *\t\t\tcallback(new Error(\"Calculation failed\"));\n\t *\t\t}\n\t *\t}\n\t *\n\t * // Logs '5'\n\t * nodefn.call(sumSmallNumbers, 2, 3).then(console.log, console.error);\n\t *\n\t * // Logs 'Calculation failed'\n\t * nodefn.call(sumSmallNumbers, 5, 10).then(console.log, console.error);\n\t *\n\t * @param {function} f node-style function that will be called\n\t * @param {...*} [args] arguments that will be forwarded to the function\n\t * @returns {Promise} promise for the value func passes to its callback\n\t */\n\tfunction call(f /*, args... */) {\n\t\treturn _apply(f, this, slice.call(arguments, 1));\n\t}\n\n\t/**\n\t * Takes a node-style function and returns new function that wraps the\n\t * original and, instead of taking a callback, returns a promise. Also, it\n\t * knows how to handle promises given as arguments, waiting for their\n\t * resolution before executing.\n\t *\n\t * Upon execution, the orginal function is executed as well. If it passes\n\t * a truthy value as the first argument to the callback, it will be\n\t * interpreted as an error condition, and the promise will be rejected\n\t * with it. Otherwise, the call is considered a resolution, and the promise\n\t * is resolved with the callback's second argument.\n\t *\n\t * @example\n\t * var fs = require(\"fs\"), nodefn = require(\"when/node/function\");\n\t *\n\t * var promiseRead = nodefn.lift(fs.readFile);\n\t *\n\t * // The promise is resolved with the contents of the file if everything\n\t * // goes ok\n\t * promiseRead('exists.txt').then(console.log, console.error);\n\t *\n\t * // And will be rejected if something doesn't work out\n\t * // (e.g. the files does not exist)\n\t * promiseRead('doesnt_exist.txt').then(console.log, console.error);\n\t *\n\t *\n\t * @param {Function} f node-style function to be lifted\n\t * @param {...*} [args] arguments to be prepended for the new function @deprecated\n\t * @returns {Function} a promise-returning function\n\t */\n\tfunction lift(f /*, args... */) {\n\t\tvar args1 = arguments.length > 1 ? slice.call(arguments, 1) : [];\n\t\treturn function() {\n\t\t\t// TODO: Simplify once partialing has been removed\n\t\t\tvar l = args1.length;\n\t\t\tvar al = arguments.length;\n\t\t\tvar args = new Array(al + l);\n\t\t\tvar i;\n\t\t\tfor(i=0; i 2) {\n\t\t\t\tresolver.resolve(slice.call(arguments, 1));\n\t\t\t} else {\n\t\t\t\tresolver.resolve(value);\n\t\t\t}\n\t\t};\n\t}\n\n\t/**\n\t * Attaches a node-style callback to a promise, ensuring the callback is\n\t * called for either fulfillment or rejection. Returns a promise with the same\n\t * state as the passed-in promise.\n\t *\n\t * @example\n\t *\tvar deferred = when.defer();\n\t *\n\t *\tfunction callback(err, value) {\n\t *\t\t// Handle err or use value\n\t *\t}\n\t *\n\t *\tbindCallback(deferred.promise, callback);\n\t *\n\t *\tdeferred.resolve('interesting value');\n\t *\n\t * @param {Promise} promise The promise to be attached to.\n\t * @param {Function} callback The node-style callback to attach.\n\t * @returns {Promise} A promise with the same state as the passed-in promise.\n\t */\n\tfunction bindCallback(promise, callback) {\n\t\tpromise = when(promise);\n\n\t\tif (callback) {\n\t\t\tpromise.then(success, wrapped);\n\t\t}\n\n\t\treturn promise;\n\n\t\tfunction success(value) {\n\t\t\twrapped(null, value);\n\t\t}\n\n\t\tfunction wrapped(err, value) {\n\t\t\tsetTimer(function () {\n\t\t\t\tcallback(err, value);\n\t\t\t}, 0);\n\t\t}\n\t}\n\n\t/**\n\t * Takes a node-style callback and returns new function that accepts a\n\t * promise, calling the original callback when the promise is either\n\t * fulfilled or rejected with the appropriate arguments.\n\t *\n\t * @example\n\t *\tvar deferred = when.defer();\n\t *\n\t *\tfunction callback(err, value) {\n\t *\t\t// Handle err or use value\n\t *\t}\n\t *\n\t *\tvar wrapped = liftCallback(callback);\n\t *\n\t *\t// `wrapped` can now be passed around at will\n\t *\twrapped(deferred.promise);\n\t *\n\t *\tdeferred.resolve('interesting value');\n\t *\n\t * @param {Function} callback The node-style callback to wrap.\n\t * @returns {Function} The lifted, promise-accepting function.\n\t */\n\tfunction liftCallback(callback) {\n\t\treturn function(promise) {\n\t\t\treturn bindCallback(promise, callback);\n\t\t};\n\t}\n});\n\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * parallel.js\n *\n * Run a set of task functions in parallel. All tasks will\n * receive the same args\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar all = when.Promise.all;\n\tvar slice = Array.prototype.slice;\n\n\t/**\n\t * Run array of tasks in parallel\n\t * @param tasks {Array|Promise} array or promiseForArray of task functions\n\t * @param [args] {*} arguments to be passed to all tasks\n\t * @return {Promise} promise for array containing the\n\t * result of each task in the array position corresponding\n\t * to position of the task in the tasks array\n\t */\n\treturn function parallel(tasks /*, args... */) {\n\t\treturn all(slice.call(arguments, 1)).then(function(args) {\n\t\t\treturn when.map(tasks, function(task) {\n\t\t\t\treturn task.apply(void 0, args);\n\t\t\t});\n\t\t});\n\t};\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * pipeline.js\n *\n * Run a set of task functions in sequence, passing the result\n * of the previous as an argument to the next. Like a shell\n * pipeline, e.g. `cat file.txt | grep 'foo' | sed -e 's/foo/bar/g'\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar all = when.Promise.all;\n\tvar slice = Array.prototype.slice;\n\n\t/**\n\t * Run array of tasks in a pipeline where the next\n\t * tasks receives the result of the previous. The first task\n\t * will receive the initialArgs as its argument list.\n\t * @param tasks {Array|Promise} array or promise for array of task functions\n\t * @param [initialArgs...] {*} arguments to be passed to the first task\n\t * @return {Promise} promise for return value of the final task\n\t */\n\treturn function pipeline(tasks /* initialArgs... */) {\n\t\t// Self-optimizing function to run first task with multiple\n\t\t// args using apply, but subsequence tasks via direct invocation\n\t\tvar runTask = function(args, task) {\n\t\t\trunTask = function(arg, task) {\n\t\t\t\treturn task(arg);\n\t\t\t};\n\n\t\t\treturn task.apply(null, args);\n\t\t};\n\n\t\treturn all(slice.call(arguments, 1)).then(function(args) {\n\t\t\treturn when.reduce(tasks, function(arg, task) {\n\t\t\t\treturn runTask(arg, task);\n\t\t\t}, args);\n\t\t});\n\t};\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2012-2013 original author or authors */\n\n/**\n * poll.js\n *\n * Helper that polls until cancelled or for a condition to become true.\n *\n * @author Scott Andrews\n */\n\n(function (define) { 'use strict';\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar attempt = when['try'];\n\tvar cancelable = require('./cancelable');\n\n\t/**\n\t * Periodically execute the task function on the msec delay. The result of\n\t * the task may be verified by watching for a condition to become true. The\n\t * returned deferred is cancellable if the polling needs to be cancelled\n\t * externally before reaching a resolved state.\n\t *\n\t * The next vote is scheduled after the results of the current vote are\n\t * verified and rejected.\n\t *\n\t * Polling may be terminated by the verifier returning a truthy value,\n\t * invoking cancel() on the returned promise, or the task function returning\n\t * a rejected promise.\n\t *\n\t * Usage:\n\t *\n\t * var count = 0;\n\t * function doSomething() { return count++ }\n\t *\n\t * // poll until cancelled\n\t * var p = poll(doSomething, 1000);\n\t * ...\n\t * p.cancel();\n\t *\n\t * // poll until condition is met\n\t * poll(doSomething, 1000, function(result) { return result > 10 })\n\t * .then(function(result) { assert result == 10 });\n\t *\n\t * // delay first vote\n\t * poll(doSomething, 1000, anyFunc, true);\n\t *\n\t * @param task {Function} function that is executed after every timeout\n\t * @param interval {number|Function} timeout in milliseconds\n\t * @param [verifier] {Function} function to evaluate the result of the vote.\n\t * May return a {Promise} or a {Boolean}. Rejecting the promise or a\n\t * falsey value will schedule the next vote.\n\t * @param [delayInitialTask] {boolean} if truthy, the first vote is scheduled\n\t * instead of immediate\n\t *\n\t * @returns {Promise}\n\t */\n\treturn function poll(task, interval, verifier, delayInitialTask) {\n\t\tvar deferred, canceled, reject;\n\n\t\tcanceled = false;\n\t\tdeferred = cancelable(when.defer(), function () { canceled = true; });\n\t\treject = deferred.reject;\n\n\t\tverifier = verifier || function () { return false; };\n\n\t\tif (typeof interval !== 'function') {\n\t\t\tinterval = (function (interval) {\n\t\t\t\treturn function () { return when().delay(interval); };\n\t\t\t})(interval);\n\t\t}\n\n\t\tfunction certify(result) {\n\t\t\tdeferred.resolve(result);\n\t\t}\n\n\t\tfunction schedule(result) {\n\t\t\tattempt(interval).then(vote, reject);\n\t\t\tif (result !== void 0) {\n\t\t\t\tdeferred.notify(result);\n\t\t\t}\n\t\t}\n\n\t\tfunction vote() {\n\t\t\tif (canceled) { return; }\n\t\t\twhen(task(),\n\t\t\t\tfunction (result) {\n\t\t\t\t\twhen(verifier(result),\n\t\t\t\t\t\tfunction (verification) {\n\t\t\t\t\t\t\treturn verification ? certify(result) : schedule(result);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction () { schedule(result); }\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\treject\n\t\t\t);\n\t\t}\n\n\t\tif (delayInitialTask) {\n\t\t\tschedule();\n\t\t} else {\n\t\t\t// if task() is blocking, vote will also block\n\t\t\tvote();\n\t\t}\n\n\t\t// make the promise cancelable\n\t\tdeferred.promise = Object.create(deferred.promise);\n\t\tdeferred.promise.cancel = deferred.cancel;\n\n\t\treturn deferred.promise;\n\t};\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * sequence.js\n *\n * Run a set of task functions in sequence. All tasks will\n * receive the same args.\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\tvar all = when.Promise.all;\n\tvar slice = Array.prototype.slice;\n\n\t/**\n\t * Run array of tasks in sequence with no overlap\n\t * @param tasks {Array|Promise} array or promiseForArray of task functions\n\t * @param [args] {*} arguments to be passed to all tasks\n\t * @return {Promise} promise for an array containing\n\t * the result of each task in the array position corresponding\n\t * to position of the task in the tasks array\n\t */\n\treturn function sequence(tasks /*, args... */) {\n\t\tvar results = [];\n\n\t\treturn all(slice.call(arguments, 1)).then(function(args) {\n\t\t\treturn when.reduce(tasks, function(results, task) {\n\t\t\t\treturn when(task.apply(void 0, args), addResult);\n\t\t\t}, results);\n\t\t});\n\n\t\tfunction addResult(result) {\n\t\t\tresults.push(result);\n\t\t\treturn results;\n\t\t}\n\t};\n\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * timeout.js\n *\n * Helper that returns a promise that rejects after a specified timeout,\n * if not explicitly resolved or rejected before that.\n *\n * @author Brian Cavalier\n * @author John Hann\n */\n\n(function(define) {\ndefine(function(require) {\n\n\tvar when = require('./when');\n\n /**\n\t * @deprecated Use when(trigger).timeout(ms)\n */\n return function timeout(msec, trigger) {\n\t\treturn when(trigger).timeout(msec);\n };\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });\n\n\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n\n/**\n * Promises/A+ and when() implementation\n * when is part of the cujoJS family of libraries (http://cujojs.com/)\n * @author Brian Cavalier\n * @author John Hann\n */\n(function(define) { 'use strict';\ndefine(function (require) {\n\n\tvar timed = require('./lib/decorators/timed');\n\tvar array = require('./lib/decorators/array');\n\tvar flow = require('./lib/decorators/flow');\n\tvar fold = require('./lib/decorators/fold');\n\tvar inspect = require('./lib/decorators/inspect');\n\tvar generate = require('./lib/decorators/iterate');\n\tvar progress = require('./lib/decorators/progress');\n\tvar withThis = require('./lib/decorators/with');\n\tvar unhandledRejection = require('./lib/decorators/unhandledRejection');\n\tvar TimeoutError = require('./lib/TimeoutError');\n\n\tvar Promise = [array, flow, fold, generate, progress,\n\t\tinspect, withThis, timed, unhandledRejection]\n\t\t.reduce(function(Promise, feature) {\n\t\t\treturn feature(Promise);\n\t\t}, require('./lib/Promise'));\n\n\tvar apply = require('./lib/apply')(Promise);\n\n\t// Public API\n\n\twhen.promise = promise; // Create a pending promise\n\twhen.resolve = Promise.resolve; // Create a resolved promise\n\twhen.reject = Promise.reject; // Create a rejected promise\n\n\twhen.lift = lift; // lift a function to return promises\n\twhen['try'] = attempt; // call a function and return a promise\n\twhen.attempt = attempt; // alias for when.try\n\n\twhen.iterate = Promise.iterate; // DEPRECATED (use cujojs/most streams) Generate a stream of promises\n\twhen.unfold = Promise.unfold; // DEPRECATED (use cujojs/most streams) Generate a stream of promises\n\n\twhen.join = join; // Join 2 or more promises\n\n\twhen.all = all; // Resolve a list of promises\n\twhen.settle = settle; // Settle a list of promises\n\n\twhen.any = lift(Promise.any); // One-winner race\n\twhen.some = lift(Promise.some); // Multi-winner race\n\twhen.race = lift(Promise.race); // First-to-settle race\n\n\twhen.map = map; // Array.map() for promises\n\twhen.filter = filter; // Array.filter() for promises\n\twhen.reduce = lift(Promise.reduce); // Array.reduce() for promises\n\twhen.reduceRight = lift(Promise.reduceRight); // Array.reduceRight() for promises\n\n\twhen.isPromiseLike = isPromiseLike; // Is something promise-like, aka thenable\n\n\twhen.Promise = Promise; // Promise constructor\n\twhen.defer = defer; // Create a {promise, resolve, reject} tuple\n\n\t// Error types\n\n\twhen.TimeoutError = TimeoutError;\n\n\t/**\n\t * Get a trusted promise for x, or by transforming x with onFulfilled\n\t *\n\t * @param {*} x\n\t * @param {function?} onFulfilled callback to be called when x is\n\t * successfully fulfilled. If promiseOrValue is an immediate value, callback\n\t * will be invoked immediately.\n\t * @param {function?} onRejected callback to be called when x is\n\t * rejected.\n\t * @param {function?} onProgress callback to be called when progress updates\n\t * are issued for x. @deprecated\n\t * @returns {Promise} a new promise that will fulfill with the return\n\t * value of callback or errback or the completion value of promiseOrValue if\n\t * callback and/or errback is not supplied.\n\t */\n\tfunction when(x, onFulfilled, onRejected, onProgress) {\n\t\tvar p = Promise.resolve(x);\n\t\tif (arguments.length < 2) {\n\t\t\treturn p;\n\t\t}\n\n\t\treturn p.then(onFulfilled, onRejected, onProgress);\n\t}\n\n\t/**\n\t * Creates a new promise whose fate is determined by resolver.\n\t * @param {function} resolver function(resolve, reject, notify)\n\t * @returns {Promise} promise whose fate is determine by resolver\n\t */\n\tfunction promise(resolver) {\n\t\treturn new Promise(resolver);\n\t}\n\n\t/**\n\t * Lift the supplied function, creating a version of f that returns\n\t * promises, and accepts promises as arguments.\n\t * @param {function} f\n\t * @returns {Function} version of f that returns promises\n\t */\n\tfunction lift(f) {\n\t\treturn function() {\n\t\t\tfor(var i=0, l=arguments.length, a=new Array(l); i= 0) {\n\t\t\t\treported.splice(i, 1);\n\t\t\t\tlogInfo('Handled previous rejection [' + r.id + '] ' + format.formatObject(r.value));\n\t\t\t}\n\t\t}\n\n\t\tfunction enqueue(f, x) {\n\t\t\ttasks.push(f, x);\n\t\t\tif(running === null) {\n\t\t\t\trunning = setTimer(flush, 0);\n\t\t\t}\n\t\t}\n\n\t\tfunction flush() {\n\t\t\trunning = null;\n\t\t\twhile(tasks.length > 0) {\n\t\t\t\ttasks.shift()(tasks.shift());\n\t\t\t}\n\t\t}\n\n\t\treturn Promise;\n\t};\n\n\tfunction throwit(e) {\n\t\tthrow e;\n\t}\n\n\tfunction noop() {}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n", - "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n/*global process,document,setTimeout,clearTimeout,MutationObserver,WebKitMutationObserver*/\n(function(define) { 'use strict';\ndefine(function(require) {\n\t/*jshint maxcomplexity:6*/\n\n\t// Sniff \"best\" async scheduling option\n\t// Prefer process.nextTick or MutationObserver, then check for\n\t// setTimeout, and finally vertx, since its the only env that doesn't\n\t// have setTimeout\n\n\tvar MutationObs;\n\tvar capturedSetTimeout = typeof setTimeout !== 'undefined' && setTimeout;\n\n\t// Default env\n\tvar setTimer = function(f, ms) { return setTimeout(f, ms); };\n\tvar clearTimer = function(t) { return clearTimeout(t); };\n\tvar asap = function (f) { return capturedSetTimeout(f, 0); };\n\n\t// Detect specific env\n\tif (isNode()) { // Node\n\t\tasap = function (f) { return process.nextTick(f); };\n\n\t} else if (MutationObs = hasMutationObserver()) { // Modern browser\n\t\tasap = initMutationObserver(MutationObs);\n\n\t} else if (!capturedSetTimeout) { // vert.x\n\t\tvar vertxRequire = require;\n\t\tvar vertx = vertxRequire('vertx');\n\t\tsetTimer = function (f, ms) { return vertx.setTimer(ms, f); };\n\t\tclearTimer = vertx.cancelTimer;\n\t\tasap = vertx.runOnLoop || vertx.runOnContext;\n\t}\n\n\treturn {\n\t\tsetTimer: setTimer,\n\t\tclearTimer: clearTimer,\n\t\tasap: asap\n\t};\n\n\tfunction isNode () {\n\t\treturn typeof process !== 'undefined' &&\n\t\t\tObject.prototype.toString.call(process) === '[object process]';\n\t}\n\n\tfunction hasMutationObserver () {\n\t\treturn (typeof MutationObserver === 'function' && MutationObserver) ||\n\t\t\t(typeof WebKitMutationObserver === 'function' && WebKitMutationObserver);\n\t}\n\n\tfunction initMutationObserver(MutationObserver) {\n\t\tvar scheduled;\n\t\tvar node = document.createTextNode('');\n\t\tvar o = new MutationObserver(run);\n\t\to.observe(node, { characterData: true });\n\n\t\tfunction run() {\n\t\t\tvar f = scheduled;\n\t\t\tscheduled = void 0;\n\t\t\tf();\n\t\t}\n\n\t\tvar i = 0;\n\t\treturn function (f) {\n\t\t\tscheduled = f;\n\t\t\tnode.data = (i ^= 1);\n\t\t};\n\t}\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n", + "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n/*global process,document,setTimeout,clearTimeout,MutationObserver,WebKitMutationObserver*/\n(function(define) { 'use strict';\ndefine(function(require) {\n\t/*jshint maxcomplexity:6*/\n\n\t// Sniff \"best\" async scheduling option\n\t// Prefer process.nextTick or MutationObserver, then check for\n\t// setTimeout, and finally vertx, since its the only env that doesn't\n\t// have setTimeout\n\n\tvar MutationObs;\n\tvar capturedSetTimeout = typeof setTimeout !== 'undefined' && setTimeout;\n\n\t// Default env\n\tvar setTimer = function(f, ms) { return setTimeout(f, ms); };\n\tvar clearTimer = function(t) { return clearTimeout(t); };\n\tvar asap = function (f) { return capturedSetTimeout(f, 0); };\n\n\t// Detect specific env\n\tif (isNode()) { // Node\n\t\tasap = function (f) { return process.nextTick(f); };\n\n\t} else if (MutationObs = hasMutationObserver()) { // Modern browser\n\t\tasap = initMutationObserver(MutationObs);\n\n\t} else if (!capturedSetTimeout) { // vert.x\n\t\tvar vertxRequire = require;\n\t\tvar vertx = vertxRequire('vertx');\n\t\tsetTimer = function (f, ms) { return vertx.setTimer(ms, f); };\n\t\tclearTimer = vertx.cancelTimer;\n\t\tasap = vertx.runOnLoop || vertx.runOnContext;\n\t}\n\n\treturn {\n\t\tsetTimer: setTimer,\n\t\tclearTimer: clearTimer,\n\t\tasap: asap\n\t};\n\n\tfunction isNode () {\n\t\treturn typeof process !== 'undefined' &&\n\t\t\tObject.prototype.toString.call(process) === '[object process]';\n\t}\n\n\tfunction hasMutationObserver () {\n\t return (typeof MutationObserver !== 'undefined' && MutationObserver) ||\n\t\t\t(typeof WebKitMutationObserver !== 'undefined' && WebKitMutationObserver);\n\t}\n\n\tfunction initMutationObserver(MutationObserver) {\n\t\tvar scheduled;\n\t\tvar node = document.createTextNode('');\n\t\tvar o = new MutationObserver(run);\n\t\to.observe(node, { characterData: true });\n\n\t\tfunction run() {\n\t\t\tvar f = scheduled;\n\t\t\tscheduled = void 0;\n\t\t\tf();\n\t\t}\n\n\t\tvar i = 0;\n\t\treturn function (f) {\n\t\t\tscheduled = f;\n\t\t\tnode.data = (i ^= 1);\n\t\t};\n\t}\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n", "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn {\n\t\tformatError: formatError,\n\t\tformatObject: formatObject,\n\t\ttryStringify: tryStringify\n\t};\n\n\t/**\n\t * Format an error into a string. If e is an Error and has a stack property,\n\t * it's returned. Otherwise, e is formatted using formatObject, with a\n\t * warning added about e not being a proper Error.\n\t * @param {*} e\n\t * @returns {String} formatted string, suitable for output to developers\n\t */\n\tfunction formatError(e) {\n\t\tvar s = typeof e === 'object' && e !== null && (e.stack || e.message) ? e.stack || e.message : formatObject(e);\n\t\treturn e instanceof Error ? s : s + ' (WARNING: non-Error used)';\n\t}\n\n\t/**\n\t * Format an object, detecting \"plain\" objects and running them through\n\t * JSON.stringify if possible.\n\t * @param {Object} o\n\t * @returns {string}\n\t */\n\tfunction formatObject(o) {\n\t\tvar s = String(o);\n\t\tif(s === '[object Object]' && typeof JSON !== 'undefined') {\n\t\t\ts = tryStringify(o, s);\n\t\t}\n\t\treturn s;\n\t}\n\n\t/**\n\t * Try to return the result of JSON.stringify(x). If that fails, return\n\t * defaultValue\n\t * @param {*} x\n\t * @param {*} defaultValue\n\t * @returns {String|*} JSON.stringify(x) or defaultValue\n\t */\n\tfunction tryStringify(x, defaultValue) {\n\t\ttry {\n\t\t\treturn JSON.stringify(x);\n\t\t} catch(e) {\n\t\t\treturn defaultValue;\n\t\t}\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n", - "/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function makePromise(environment) {\n\n\t\tvar tasks = environment.scheduler;\n\t\tvar emitRejection = initEmitRejection();\n\n\t\tvar objectCreate = Object.create ||\n\t\t\tfunction(proto) {\n\t\t\t\tfunction Child() {}\n\t\t\t\tChild.prototype = proto;\n\t\t\t\treturn new Child();\n\t\t\t};\n\n\t\t/**\n\t\t * Create a promise whose fate is determined by resolver\n\t\t * @constructor\n\t\t * @returns {Promise} promise\n\t\t * @name Promise\n\t\t */\n\t\tfunction Promise(resolver, handler) {\n\t\t\tthis._handler = resolver === Handler ? handler : init(resolver);\n\t\t}\n\n\t\t/**\n\t\t * Run the supplied resolver\n\t\t * @param resolver\n\t\t * @returns {Pending}\n\t\t */\n\t\tfunction init(resolver) {\n\t\t\tvar handler = new Pending();\n\n\t\t\ttry {\n\t\t\t\tresolver(promiseResolve, promiseReject, promiseNotify);\n\t\t\t} catch (e) {\n\t\t\t\tpromiseReject(e);\n\t\t\t}\n\n\t\t\treturn handler;\n\n\t\t\t/**\n\t\t\t * Transition from pre-resolution state to post-resolution state, notifying\n\t\t\t * all listeners of the ultimate fulfillment or rejection\n\t\t\t * @param {*} x resolution value\n\t\t\t */\n\t\t\tfunction promiseResolve (x) {\n\t\t\t\thandler.resolve(x);\n\t\t\t}\n\t\t\t/**\n\t\t\t * Reject this promise with reason, which will be used verbatim\n\t\t\t * @param {Error|*} reason rejection reason, strongly suggested\n\t\t\t * to be an Error type\n\t\t\t */\n\t\t\tfunction promiseReject (reason) {\n\t\t\t\thandler.reject(reason);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * @deprecated\n\t\t\t * Issue a progress event, notifying all progress listeners\n\t\t\t * @param {*} x progress event payload to pass to all listeners\n\t\t\t */\n\t\t\tfunction promiseNotify (x) {\n\t\t\t\thandler.notify(x);\n\t\t\t}\n\t\t}\n\n\t\t// Creation\n\n\t\tPromise.resolve = resolve;\n\t\tPromise.reject = reject;\n\t\tPromise.never = never;\n\n\t\tPromise._defer = defer;\n\t\tPromise._handler = getHandler;\n\n\t\t/**\n\t\t * Returns a trusted promise. If x is already a trusted promise, it is\n\t\t * returned, otherwise returns a new trusted Promise which follows x.\n\t\t * @param {*} x\n\t\t * @return {Promise} promise\n\t\t */\n\t\tfunction resolve(x) {\n\t\t\treturn isPromise(x) ? x\n\t\t\t\t: new Promise(Handler, new Async(getHandler(x)));\n\t\t}\n\n\t\t/**\n\t\t * Return a reject promise with x as its reason (x is used verbatim)\n\t\t * @param {*} x\n\t\t * @returns {Promise} rejected promise\n\t\t */\n\t\tfunction reject(x) {\n\t\t\treturn new Promise(Handler, new Async(new Rejected(x)));\n\t\t}\n\n\t\t/**\n\t\t * Return a promise that remains pending forever\n\t\t * @returns {Promise} forever-pending promise.\n\t\t */\n\t\tfunction never() {\n\t\t\treturn foreverPendingPromise; // Should be frozen\n\t\t}\n\n\t\t/**\n\t\t * Creates an internal {promise, resolver} pair\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tfunction defer() {\n\t\t\treturn new Promise(Handler, new Pending());\n\t\t}\n\n\t\t// Transformation and flow control\n\n\t\t/**\n\t\t * Transform this promise's fulfillment value, returning a new Promise\n\t\t * for the transformed result. If the promise cannot be fulfilled, onRejected\n\t\t * is called with the reason. onProgress *may* be called with updates toward\n\t\t * this promise's fulfillment.\n\t\t * @param {function=} onFulfilled fulfillment handler\n\t\t * @param {function=} onRejected rejection handler\n\t\t * @param {function=} onProgress @deprecated progress handler\n\t\t * @return {Promise} new promise\n\t\t */\n\t\tPromise.prototype.then = function(onFulfilled, onRejected, onProgress) {\n\t\t\tvar parent = this._handler;\n\t\t\tvar state = parent.join().state();\n\n\t\t\tif ((typeof onFulfilled !== 'function' && state > 0) ||\n\t\t\t\t(typeof onRejected !== 'function' && state < 0)) {\n\t\t\t\t// Short circuit: value will not change, simply share handler\n\t\t\t\treturn new this.constructor(Handler, parent);\n\t\t\t}\n\n\t\t\tvar p = this._beget();\n\t\t\tvar child = p._handler;\n\n\t\t\tparent.chain(child, parent.receiver, onFulfilled, onRejected, onProgress);\n\n\t\t\treturn p;\n\t\t};\n\n\t\t/**\n\t\t * If this promise cannot be fulfilled due to an error, call onRejected to\n\t\t * handle the error. Shortcut for .then(undefined, onRejected)\n\t\t * @param {function?} onRejected\n\t\t * @return {Promise}\n\t\t */\n\t\tPromise.prototype['catch'] = function(onRejected) {\n\t\t\treturn this.then(void 0, onRejected);\n\t\t};\n\n\t\t/**\n\t\t * Creates a new, pending promise of the same type as this promise\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype._beget = function() {\n\t\t\treturn begetFrom(this._handler, this.constructor);\n\t\t};\n\n\t\tfunction begetFrom(parent, Promise) {\n\t\t\tvar child = new Pending(parent.receiver, parent.join().context);\n\t\t\treturn new Promise(Handler, child);\n\t\t}\n\n\t\t// Array combinators\n\n\t\tPromise.all = all;\n\t\tPromise.race = race;\n\t\tPromise._traverse = traverse;\n\n\t\t/**\n\t\t * Return a promise that will fulfill when all promises in the\n\t\t * input array have fulfilled, or will reject when one of the\n\t\t * promises rejects.\n\t\t * @param {array} promises array of promises\n\t\t * @returns {Promise} promise for array of fulfillment values\n\t\t */\n\t\tfunction all(promises) {\n\t\t\treturn traverseWith(snd, null, promises);\n\t\t}\n\n\t\t/**\n\t\t * Array> -> Promise>\n\t\t * @private\n\t\t * @param {function} f function to apply to each promise's value\n\t\t * @param {Array} promises array of promises\n\t\t * @returns {Promise} promise for transformed values\n\t\t */\n\t\tfunction traverse(f, promises) {\n\t\t\treturn traverseWith(tryCatch2, f, promises);\n\t\t}\n\n\t\tfunction traverseWith(tryMap, f, promises) {\n\t\t\tvar handler = typeof f === 'function' ? mapAt : settleAt;\n\n\t\t\tvar resolver = new Pending();\n\t\t\tvar pending = promises.length >>> 0;\n\t\t\tvar results = new Array(pending);\n\n\t\t\tfor (var i = 0, x; i < promises.length && !resolver.resolved; ++i) {\n\t\t\t\tx = promises[i];\n\n\t\t\t\tif (x === void 0 && !(i in promises)) {\n\t\t\t\t\t--pending;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttraverseAt(promises, handler, i, x, resolver);\n\t\t\t}\n\n\t\t\tif(pending === 0) {\n\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t}\n\n\t\t\treturn new Promise(Handler, resolver);\n\n\t\t\tfunction mapAt(i, x, resolver) {\n\t\t\t\tif(!resolver.resolved) {\n\t\t\t\t\ttraverseAt(promises, settleAt, i, tryMap(f, x, i), resolver);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction settleAt(i, x, resolver) {\n\t\t\t\tresults[i] = x;\n\t\t\t\tif(--pending === 0) {\n\t\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction traverseAt(promises, handler, i, x, resolver) {\n\t\t\tif (maybeThenable(x)) {\n\t\t\t\tvar h = getHandlerMaybeThenable(x);\n\t\t\t\tvar s = h.state();\n\n\t\t\t\tif (s === 0) {\n\t\t\t\t\th.fold(handler, i, void 0, resolver);\n\t\t\t\t} else if (s > 0) {\n\t\t\t\t\thandler(i, h.value, resolver);\n\t\t\t\t} else {\n\t\t\t\t\tresolver.become(h);\n\t\t\t\t\tvisitRemaining(promises, i+1, h);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thandler(i, x, resolver);\n\t\t\t}\n\t\t}\n\n\t\tPromise._visitRemaining = visitRemaining;\n\t\tfunction visitRemaining(promises, start, handler) {\n\t\t\tfor(var i=start; i 0) ||\n\t\t\t\t(typeof onRejected !== 'function' && state < 0)) {\n\t\t\t\t// Short circuit: value will not change, simply share handler\n\t\t\t\treturn new this.constructor(Handler, parent);\n\t\t\t}\n\n\t\t\tvar p = this._beget();\n\t\t\tvar child = p._handler;\n\n\t\t\tparent.chain(child, parent.receiver, onFulfilled, onRejected, onProgress);\n\n\t\t\treturn p;\n\t\t};\n\n\t\t/**\n\t\t * If this promise cannot be fulfilled due to an error, call onRejected to\n\t\t * handle the error. Shortcut for .then(undefined, onRejected)\n\t\t * @param {function?} onRejected\n\t\t * @return {Promise}\n\t\t */\n\t\tPromise.prototype['catch'] = function(onRejected) {\n\t\t\treturn this.then(void 0, onRejected);\n\t\t};\n\n\t\t/**\n\t\t * Creates a new, pending promise of the same type as this promise\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype._beget = function() {\n\t\t\treturn begetFrom(this._handler, this.constructor);\n\t\t};\n\n\t\tfunction begetFrom(parent, Promise) {\n\t\t\tvar child = new Pending(parent.receiver, parent.join().context);\n\t\t\treturn new Promise(Handler, child);\n\t\t}\n\n\t\t// Array combinators\n\n\t\tPromise.all = all;\n\t\tPromise.race = race;\n\t\tPromise._traverse = traverse;\n\n\t\t/**\n\t\t * Return a promise that will fulfill when all promises in the\n\t\t * input array have fulfilled, or will reject when one of the\n\t\t * promises rejects.\n\t\t * @param {array} promises array of promises\n\t\t * @returns {Promise} promise for array of fulfillment values\n\t\t */\n\t\tfunction all(promises) {\n\t\t\treturn traverseWith(snd, null, promises);\n\t\t}\n\n\t\t/**\n\t\t * Array> -> Promise>\n\t\t * @private\n\t\t * @param {function} f function to apply to each promise's value\n\t\t * @param {Array} promises array of promises\n\t\t * @returns {Promise} promise for transformed values\n\t\t */\n\t\tfunction traverse(f, promises) {\n\t\t\treturn traverseWith(tryCatch2, f, promises);\n\t\t}\n\n\t\tfunction traverseWith(tryMap, f, promises) {\n\t\t\tvar handler = typeof f === 'function' ? mapAt : settleAt;\n\n\t\t\tvar resolver = new Pending();\n\t\t\tvar pending = promises.length >>> 0;\n\t\t\tvar results = new Array(pending);\n\n\t\t\tfor (var i = 0, x; i < promises.length && !resolver.resolved; ++i) {\n\t\t\t\tx = promises[i];\n\n\t\t\t\tif (x === void 0 && !(i in promises)) {\n\t\t\t\t\t--pending;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttraverseAt(promises, handler, i, x, resolver);\n\t\t\t}\n\n\t\t\tif(pending === 0) {\n\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t}\n\n\t\t\treturn new Promise(Handler, resolver);\n\n\t\t\tfunction mapAt(i, x, resolver) {\n\t\t\t\tif(!resolver.resolved) {\n\t\t\t\t\ttraverseAt(promises, settleAt, i, tryMap(f, x, i), resolver);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction settleAt(i, x, resolver) {\n\t\t\t\tresults[i] = x;\n\t\t\t\tif(--pending === 0) {\n\t\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction traverseAt(promises, handler, i, x, resolver) {\n\t\t\tif (maybeThenable(x)) {\n\t\t\t\tvar h = getHandlerMaybeThenable(x);\n\t\t\t\tvar s = h.state();\n\n\t\t\t\tif (s === 0) {\n\t\t\t\t\th.fold(handler, i, void 0, resolver);\n\t\t\t\t} else if (s > 0) {\n\t\t\t\t\thandler(i, h.value, resolver);\n\t\t\t\t} else {\n\t\t\t\t\tresolver.become(h);\n\t\t\t\t\tvisitRemaining(promises, i+1, h);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thandler(i, x, resolver);\n\t\t\t}\n\t\t}\n\n\t\tPromise._visitRemaining = visitRemaining;\n\t\tfunction visitRemaining(promises, start, handler) {\n\t\t\tfor(var i=start; i=0&&(l.splice(e,1),h("Handled previous rejection ["+t.id+"] "+r.formatObject(t.value)))}function c(t,e){p.push(t,e),null===d&&(d=o(f,0))}function f(){for(d=null;p.length>0;)p.shift()(p.shift())}var s,a=n,h=n;"undefined"!=typeof console&&(s=console,a="undefined"!=typeof s.error?function(t){s.error(t)}:function(t){s.log(t)},h="undefined"!=typeof s.info?function(t){s.info(t)}:function(t){s.log(t)}),t.onPotentiallyUnhandledRejection=function(t){c(i,t)},t.onPotentiallyUnhandledRejectionHandled=function(t){c(u,t)},t.onFatalRejection=function(t){c(e,t.value)};var p=[],l=[],d=null;return t}})}("function"==typeof t&&t.amd?t:function(t){n.exports=t(e)})},{"../env":5,"../format":6}],5:[function(e,n,o){!function(t){"use strict";t(function(t){function e(){return"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process)}function n(){return"function"==typeof MutationObserver&&MutationObserver||"function"==typeof WebKitMutationObserver&&WebKitMutationObserver}function o(t){function e(){var t=n;n=void 0,t()}var n,o=document.createTextNode(""),r=new t(e);r.observe(o,{characterData:!0});var i=0;return function(t){n=t,o.data=i^=1}}var r,i="undefined"!=typeof setTimeout&&setTimeout,u=function(t,e){return setTimeout(t,e)},c=function(t){return clearTimeout(t)},f=function(t){return i(t,0)};if(e())f=function(t){return process.nextTick(t)};else if(r=n())f=o(r);else if(!i){var s=t,a=s("vertx");u=function(t,e){return a.setTimer(e,t)},c=a.cancelTimer,f=a.runOnLoop||a.runOnContext}return{setTimer:u,clearTimer:c,asap:f}})}("function"==typeof t&&t.amd?t:function(t){n.exports=t(e)})},{}],6:[function(e,n,o){!function(t){"use strict";t(function(){function t(t){var n="object"==typeof t&&null!==t&&(t.stack||t.message)?t.stack||t.message:e(t);return t instanceof Error?n:n+" (WARNING: non-Error used)"}function e(t){var e=String(t);return"[object Object]"===e&&"undefined"!=typeof JSON&&(e=n(t,e)),e}function n(t,e){try{return JSON.stringify(t)}catch(n){return e}}return{formatError:t,formatObject:e,tryStringify:n}})}("function"==typeof t&&t.amd?t:function(t){n.exports=t()})},{}],7:[function(e,n,o){!function(t){"use strict";t(function(){return function(t){function e(t,e){this._handler=t===_?e:n(t)}function n(t){function e(t){r.resolve(t)}function n(t){r.reject(t)}function o(t){r.notify(t)}var r=new b;try{t(e,n,o)}catch(i){n(i)}return r}function o(t){return S(t)?t:new e(_,new x(y(t)))}function r(t){return new e(_,new x(new P(t)))}function i(){return $}function u(){return new e(_,new b)}function c(t,e){var n=new b(t.receiver,t.join().context);return new e(_,n)}function f(t){return a(K,null,t)}function s(t,e){return a(F,t,e)}function a(t,n,o){function r(e,r,u){u.resolved||h(o,i,e,t(n,r,e),u)}function i(t,e,n){a[t]=e,0===--s&&n.become(new q(a))}for(var u,c="function"==typeof n?r:i,f=new b,s=o.length>>>0,a=new Array(s),p=0;p0?e(n,i.value,r):(r.become(i),p(t,n+1,i))}else e(n,o,r)}function p(t,e,n){for(var o=e;on&&t._unreport()}}function d(t){return"object"!=typeof t||null===t?r(new TypeError("non-iterable passed to race()")):0===t.length?i():1===t.length?o(t[0]):v(t)}function v(t){var n,o,r,i=new b;for(n=0;n0||"function"!=typeof e&&0>r)return new this.constructor(_,o);var i=this._beget(),u=i._handler;return o.chain(u,o.receiver,t,e,n),i},e.prototype["catch"]=function(t){return this.then(void 0,t)},e.prototype._beget=function(){return c(this._handler,this.constructor)},e.all=f,e.race=d,e._traverse=s,e._visitRemaining=p,_.prototype.when=_.prototype.become=_.prototype.notify=_.prototype.fail=_.prototype._unreport=_.prototype._report=D,_.prototype._state=0,_.prototype.state=function(){return this._state},_.prototype.join=function(){for(var t=this;void 0!==t.handler;)t=t.handler;return t},_.prototype.chain=function(t,e,n,o,r){this.when({resolver:t,receiver:e,fulfilled:n,rejected:o,progress:r})},_.prototype.visit=function(t,e,n,o){this.chain(X,t,e,n,o)},_.prototype.fold=function(t,e,n,o){this.when(new k(t,e,n,o))},J(_,w),w.prototype.become=function(t){t.fail()};var X=new w;J(_,b),b.prototype._state=0,b.prototype.resolve=function(t){this.become(y(t))},b.prototype.reject=function(t){this.resolved||this.become(new P(t))},b.prototype.join=function(){if(!this.resolved)return this;for(var t=this;void 0!==t.handler;)if(t=t.handler,t===this)return this.handler=O();return t},b.prototype.run=function(){var t=this.consumers,e=this.handler;this.handler=this.handler.join(),this.consumers=void 0;for(var n=0;n=0&&(l.splice(e,1),h("Handled previous rejection ["+t.id+"] "+r.formatObject(t.value)))}function c(t,e){p.push(t,e),null===d&&(d=o(f,0))}function f(){for(d=null;p.length>0;)p.shift()(p.shift())}var s,a=n,h=n;"undefined"!=typeof console&&(s=console,a="undefined"!=typeof s.error?function(t){s.error(t)}:function(t){s.log(t)},h="undefined"!=typeof s.info?function(t){s.info(t)}:function(t){s.log(t)}),t.onPotentiallyUnhandledRejection=function(t){c(i,t)},t.onPotentiallyUnhandledRejectionHandled=function(t){c(u,t)},t.onFatalRejection=function(t){c(e,t.value)};var p=[],l=[],d=null;return t}})}("function"==typeof t&&t.amd?t:function(t){n.exports=t(e)})},{"../env":5,"../format":6}],5:[function(e,n,o){!function(t){"use strict";t(function(t){function e(){return"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process)}function n(){return"undefined"!=typeof MutationObserver&&MutationObserver||"undefined"!=typeof WebKitMutationObserver&&WebKitMutationObserver}function o(t){function e(){var t=n;n=void 0,t()}var n,o=document.createTextNode(""),r=new t(e);r.observe(o,{characterData:!0});var i=0;return function(t){n=t,o.data=i^=1}}var r,i="undefined"!=typeof setTimeout&&setTimeout,u=function(t,e){return setTimeout(t,e)},c=function(t){return clearTimeout(t)},f=function(t){return i(t,0)};if(e())f=function(t){return process.nextTick(t)};else if(r=n())f=o(r);else if(!i){var s=t,a=s("vertx");u=function(t,e){return a.setTimer(e,t)},c=a.cancelTimer,f=a.runOnLoop||a.runOnContext}return{setTimer:u,clearTimer:c,asap:f}})}("function"==typeof t&&t.amd?t:function(t){n.exports=t(e)})},{}],6:[function(e,n,o){!function(t){"use strict";t(function(){function t(t){var n="object"==typeof t&&null!==t&&(t.stack||t.message)?t.stack||t.message:e(t);return t instanceof Error?n:n+" (WARNING: non-Error used)"}function e(t){var e=String(t);return"[object Object]"===e&&"undefined"!=typeof JSON&&(e=n(t,e)),e}function n(t,e){try{return JSON.stringify(t)}catch(n){return e}}return{formatError:t,formatObject:e,tryStringify:n}})}("function"==typeof t&&t.amd?t:function(t){n.exports=t()})},{}],7:[function(e,n,o){!function(t){"use strict";t(function(){return function(t){function e(t,e){this._handler=t===_?e:n(t)}function n(t){function e(t){r.resolve(t)}function n(t){r.reject(t)}function o(t){r.notify(t)}var r=new b;try{t(e,n,o)}catch(i){n(i)}return r}function o(t){return S(t)?t:new e(_,new x(y(t)))}function r(t){return new e(_,new x(new E(t)))}function i(){return et}function u(){return new e(_,new b)}function c(t,e){var n=new b(t.receiver,t.join().context);return new e(_,n)}function f(t){return a(K,null,t)}function s(t,e){return a(F,t,e)}function a(t,n,o){function r(e,r,u){u.resolved||h(o,i,e,t(n,r,e),u)}function i(t,e,n){a[t]=e,0===--s&&n.become(new C(a))}for(var u,c="function"==typeof n?r:i,f=new b,s=o.length>>>0,a=new Array(s),p=0;p0?e(n,i.value,r):(r.become(i),p(t,n+1,i))}else e(n,o,r)}function p(t,e,n){for(var o=e;on&&t._unreport()}}function d(t){return"object"!=typeof t||null===t?r(new TypeError("non-iterable passed to race()")):0===t.length?i():1===t.length?o(t[0]):v(t)}function v(t){var n,o,r,i=new b;for(n=0;n0||"function"!=typeof e&&0>r)return new this.constructor(_,o);var i=this._beget(),u=i._handler;return o.chain(u,o.receiver,t,e,n),i},e.prototype["catch"]=function(t){return this.then(void 0,t)},e.prototype._beget=function(){return c(this._handler,this.constructor)},e.all=f,e.race=d,e._traverse=s,e._visitRemaining=p,_.prototype.when=_.prototype.become=_.prototype.notify=_.prototype.fail=_.prototype._unreport=_.prototype._report=D,_.prototype._state=0,_.prototype.state=function(){return this._state},_.prototype.join=function(){for(var t=this;void 0!==t.handler;)t=t.handler;return t},_.prototype.chain=function(t,e,n,o,r){this.when({resolver:t,receiver:e,fulfilled:n,rejected:o,progress:r})},_.prototype.visit=function(t,e,n,o){this.chain(Z,t,e,n,o)},_.prototype.fold=function(t,e,n,o){this.when(new k(t,e,n,o))},J(_,w),w.prototype.become=function(t){t.fail()};var Z=new w;J(_,b),b.prototype._state=0,b.prototype.resolve=function(t){this.become(y(t))},b.prototype.reject=function(t){this.resolved||this.become(new E(t))},b.prototype.join=function(){if(!this.resolved)return this;for(var t=this;void 0!==t.handler;)if(t=t.handler,t===this)return this.handler=R();return t},b.prototype.run=function(){var t=this.consumers,e=this.handler;this.handler=this.handler.join(),this.consumers=void 0;for(var n=0;n= 0) {\n\t\t\t\treported.splice(i, 1);\n\t\t\t\tlogInfo('Handled previous rejection [' + r.id + '] ' + format.formatObject(r.value));\n\t\t\t}\n\t\t}\n\n\t\tfunction enqueue(f, x) {\n\t\t\ttasks.push(f, x);\n\t\t\tif(running === null) {\n\t\t\t\trunning = setTimer(flush, 0);\n\t\t\t}\n\t\t}\n\n\t\tfunction flush() {\n\t\t\trunning = null;\n\t\t\twhile(tasks.length > 0) {\n\t\t\t\ttasks.shift()(tasks.shift());\n\t\t\t}\n\t\t}\n\n\t\treturn Promise;\n\t};\n\n\tfunction throwit(e) {\n\t\tthrow e;\n\t}\n\n\tfunction noop() {}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n/*global process,document,setTimeout,clearTimeout,MutationObserver,WebKitMutationObserver*/\n(function(define) { 'use strict';\ndefine(function(require) {\n\t/*jshint maxcomplexity:6*/\n\n\t// Sniff \"best\" async scheduling option\n\t// Prefer process.nextTick or MutationObserver, then check for\n\t// setTimeout, and finally vertx, since its the only env that doesn't\n\t// have setTimeout\n\n\tvar MutationObs;\n\tvar capturedSetTimeout = typeof setTimeout !== 'undefined' && setTimeout;\n\n\t// Default env\n\tvar setTimer = function(f, ms) { return setTimeout(f, ms); };\n\tvar clearTimer = function(t) { return clearTimeout(t); };\n\tvar asap = function (f) { return capturedSetTimeout(f, 0); };\n\n\t// Detect specific env\n\tif (isNode()) { // Node\n\t\tasap = function (f) { return process.nextTick(f); };\n\n\t} else if (MutationObs = hasMutationObserver()) { // Modern browser\n\t\tasap = initMutationObserver(MutationObs);\n\n\t} else if (!capturedSetTimeout) { // vert.x\n\t\tvar vertxRequire = require;\n\t\tvar vertx = vertxRequire('vertx');\n\t\tsetTimer = function (f, ms) { return vertx.setTimer(ms, f); };\n\t\tclearTimer = vertx.cancelTimer;\n\t\tasap = vertx.runOnLoop || vertx.runOnContext;\n\t}\n\n\treturn {\n\t\tsetTimer: setTimer,\n\t\tclearTimer: clearTimer,\n\t\tasap: asap\n\t};\n\n\tfunction isNode () {\n\t\treturn typeof process !== 'undefined' &&\n\t\t\tObject.prototype.toString.call(process) === '[object process]';\n\t}\n\n\tfunction hasMutationObserver () {\n\t\treturn (typeof MutationObserver === 'function' && MutationObserver) ||\n\t\t\t(typeof WebKitMutationObserver === 'function' && WebKitMutationObserver);\n\t}\n\n\tfunction initMutationObserver(MutationObserver) {\n\t\tvar scheduled;\n\t\tvar node = document.createTextNode('');\n\t\tvar o = new MutationObserver(run);\n\t\to.observe(node, { characterData: true });\n\n\t\tfunction run() {\n\t\t\tvar f = scheduled;\n\t\t\tscheduled = void 0;\n\t\t\tf();\n\t\t}\n\n\t\tvar i = 0;\n\t\treturn function (f) {\n\t\t\tscheduled = f;\n\t\t\tnode.data = (i ^= 1);\n\t\t};\n\t}\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn {\n\t\tformatError: formatError,\n\t\tformatObject: formatObject,\n\t\ttryStringify: tryStringify\n\t};\n\n\t/**\n\t * Format an error into a string. If e is an Error and has a stack property,\n\t * it's returned. Otherwise, e is formatted using formatObject, with a\n\t * warning added about e not being a proper Error.\n\t * @param {*} e\n\t * @returns {String} formatted string, suitable for output to developers\n\t */\n\tfunction formatError(e) {\n\t\tvar s = typeof e === 'object' && e !== null && (e.stack || e.message) ? e.stack || e.message : formatObject(e);\n\t\treturn e instanceof Error ? s : s + ' (WARNING: non-Error used)';\n\t}\n\n\t/**\n\t * Format an object, detecting \"plain\" objects and running them through\n\t * JSON.stringify if possible.\n\t * @param {Object} o\n\t * @returns {string}\n\t */\n\tfunction formatObject(o) {\n\t\tvar s = String(o);\n\t\tif(s === '[object Object]' && typeof JSON !== 'undefined') {\n\t\t\ts = tryStringify(o, s);\n\t\t}\n\t\treturn s;\n\t}\n\n\t/**\n\t * Try to return the result of JSON.stringify(x). If that fails, return\n\t * defaultValue\n\t * @param {*} x\n\t * @param {*} defaultValue\n\t * @returns {String|*} JSON.stringify(x) or defaultValue\n\t */\n\tfunction tryStringify(x, defaultValue) {\n\t\ttry {\n\t\t\treturn JSON.stringify(x);\n\t\t} catch(e) {\n\t\t\treturn defaultValue;\n\t\t}\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function makePromise(environment) {\n\n\t\tvar tasks = environment.scheduler;\n\t\tvar emitRejection = initEmitRejection();\n\n\t\tvar objectCreate = Object.create ||\n\t\t\tfunction(proto) {\n\t\t\t\tfunction Child() {}\n\t\t\t\tChild.prototype = proto;\n\t\t\t\treturn new Child();\n\t\t\t};\n\n\t\t/**\n\t\t * Create a promise whose fate is determined by resolver\n\t\t * @constructor\n\t\t * @returns {Promise} promise\n\t\t * @name Promise\n\t\t */\n\t\tfunction Promise(resolver, handler) {\n\t\t\tthis._handler = resolver === Handler ? handler : init(resolver);\n\t\t}\n\n\t\t/**\n\t\t * Run the supplied resolver\n\t\t * @param resolver\n\t\t * @returns {Pending}\n\t\t */\n\t\tfunction init(resolver) {\n\t\t\tvar handler = new Pending();\n\n\t\t\ttry {\n\t\t\t\tresolver(promiseResolve, promiseReject, promiseNotify);\n\t\t\t} catch (e) {\n\t\t\t\tpromiseReject(e);\n\t\t\t}\n\n\t\t\treturn handler;\n\n\t\t\t/**\n\t\t\t * Transition from pre-resolution state to post-resolution state, notifying\n\t\t\t * all listeners of the ultimate fulfillment or rejection\n\t\t\t * @param {*} x resolution value\n\t\t\t */\n\t\t\tfunction promiseResolve (x) {\n\t\t\t\thandler.resolve(x);\n\t\t\t}\n\t\t\t/**\n\t\t\t * Reject this promise with reason, which will be used verbatim\n\t\t\t * @param {Error|*} reason rejection reason, strongly suggested\n\t\t\t * to be an Error type\n\t\t\t */\n\t\t\tfunction promiseReject (reason) {\n\t\t\t\thandler.reject(reason);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * @deprecated\n\t\t\t * Issue a progress event, notifying all progress listeners\n\t\t\t * @param {*} x progress event payload to pass to all listeners\n\t\t\t */\n\t\t\tfunction promiseNotify (x) {\n\t\t\t\thandler.notify(x);\n\t\t\t}\n\t\t}\n\n\t\t// Creation\n\n\t\tPromise.resolve = resolve;\n\t\tPromise.reject = reject;\n\t\tPromise.never = never;\n\n\t\tPromise._defer = defer;\n\t\tPromise._handler = getHandler;\n\n\t\t/**\n\t\t * Returns a trusted promise. If x is already a trusted promise, it is\n\t\t * returned, otherwise returns a new trusted Promise which follows x.\n\t\t * @param {*} x\n\t\t * @return {Promise} promise\n\t\t */\n\t\tfunction resolve(x) {\n\t\t\treturn isPromise(x) ? x\n\t\t\t\t: new Promise(Handler, new Async(getHandler(x)));\n\t\t}\n\n\t\t/**\n\t\t * Return a reject promise with x as its reason (x is used verbatim)\n\t\t * @param {*} x\n\t\t * @returns {Promise} rejected promise\n\t\t */\n\t\tfunction reject(x) {\n\t\t\treturn new Promise(Handler, new Async(new Rejected(x)));\n\t\t}\n\n\t\t/**\n\t\t * Return a promise that remains pending forever\n\t\t * @returns {Promise} forever-pending promise.\n\t\t */\n\t\tfunction never() {\n\t\t\treturn foreverPendingPromise; // Should be frozen\n\t\t}\n\n\t\t/**\n\t\t * Creates an internal {promise, resolver} pair\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tfunction defer() {\n\t\t\treturn new Promise(Handler, new Pending());\n\t\t}\n\n\t\t// Transformation and flow control\n\n\t\t/**\n\t\t * Transform this promise's fulfillment value, returning a new Promise\n\t\t * for the transformed result. If the promise cannot be fulfilled, onRejected\n\t\t * is called with the reason. onProgress *may* be called with updates toward\n\t\t * this promise's fulfillment.\n\t\t * @param {function=} onFulfilled fulfillment handler\n\t\t * @param {function=} onRejected rejection handler\n\t\t * @param {function=} onProgress @deprecated progress handler\n\t\t * @return {Promise} new promise\n\t\t */\n\t\tPromise.prototype.then = function(onFulfilled, onRejected, onProgress) {\n\t\t\tvar parent = this._handler;\n\t\t\tvar state = parent.join().state();\n\n\t\t\tif ((typeof onFulfilled !== 'function' && state > 0) ||\n\t\t\t\t(typeof onRejected !== 'function' && state < 0)) {\n\t\t\t\t// Short circuit: value will not change, simply share handler\n\t\t\t\treturn new this.constructor(Handler, parent);\n\t\t\t}\n\n\t\t\tvar p = this._beget();\n\t\t\tvar child = p._handler;\n\n\t\t\tparent.chain(child, parent.receiver, onFulfilled, onRejected, onProgress);\n\n\t\t\treturn p;\n\t\t};\n\n\t\t/**\n\t\t * If this promise cannot be fulfilled due to an error, call onRejected to\n\t\t * handle the error. Shortcut for .then(undefined, onRejected)\n\t\t * @param {function?} onRejected\n\t\t * @return {Promise}\n\t\t */\n\t\tPromise.prototype['catch'] = function(onRejected) {\n\t\t\treturn this.then(void 0, onRejected);\n\t\t};\n\n\t\t/**\n\t\t * Creates a new, pending promise of the same type as this promise\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype._beget = function() {\n\t\t\treturn begetFrom(this._handler, this.constructor);\n\t\t};\n\n\t\tfunction begetFrom(parent, Promise) {\n\t\t\tvar child = new Pending(parent.receiver, parent.join().context);\n\t\t\treturn new Promise(Handler, child);\n\t\t}\n\n\t\t// Array combinators\n\n\t\tPromise.all = all;\n\t\tPromise.race = race;\n\t\tPromise._traverse = traverse;\n\n\t\t/**\n\t\t * Return a promise that will fulfill when all promises in the\n\t\t * input array have fulfilled, or will reject when one of the\n\t\t * promises rejects.\n\t\t * @param {array} promises array of promises\n\t\t * @returns {Promise} promise for array of fulfillment values\n\t\t */\n\t\tfunction all(promises) {\n\t\t\treturn traverseWith(snd, null, promises);\n\t\t}\n\n\t\t/**\n\t\t * Array> -> Promise>\n\t\t * @private\n\t\t * @param {function} f function to apply to each promise's value\n\t\t * @param {Array} promises array of promises\n\t\t * @returns {Promise} promise for transformed values\n\t\t */\n\t\tfunction traverse(f, promises) {\n\t\t\treturn traverseWith(tryCatch2, f, promises);\n\t\t}\n\n\t\tfunction traverseWith(tryMap, f, promises) {\n\t\t\tvar handler = typeof f === 'function' ? mapAt : settleAt;\n\n\t\t\tvar resolver = new Pending();\n\t\t\tvar pending = promises.length >>> 0;\n\t\t\tvar results = new Array(pending);\n\n\t\t\tfor (var i = 0, x; i < promises.length && !resolver.resolved; ++i) {\n\t\t\t\tx = promises[i];\n\n\t\t\t\tif (x === void 0 && !(i in promises)) {\n\t\t\t\t\t--pending;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttraverseAt(promises, handler, i, x, resolver);\n\t\t\t}\n\n\t\t\tif(pending === 0) {\n\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t}\n\n\t\t\treturn new Promise(Handler, resolver);\n\n\t\t\tfunction mapAt(i, x, resolver) {\n\t\t\t\tif(!resolver.resolved) {\n\t\t\t\t\ttraverseAt(promises, settleAt, i, tryMap(f, x, i), resolver);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction settleAt(i, x, resolver) {\n\t\t\t\tresults[i] = x;\n\t\t\t\tif(--pending === 0) {\n\t\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction traverseAt(promises, handler, i, x, resolver) {\n\t\t\tif (maybeThenable(x)) {\n\t\t\t\tvar h = getHandlerMaybeThenable(x);\n\t\t\t\tvar s = h.state();\n\n\t\t\t\tif (s === 0) {\n\t\t\t\t\th.fold(handler, i, void 0, resolver);\n\t\t\t\t} else if (s > 0) {\n\t\t\t\t\thandler(i, h.value, resolver);\n\t\t\t\t} else {\n\t\t\t\t\tresolver.become(h);\n\t\t\t\t\tvisitRemaining(promises, i+1, h);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thandler(i, x, resolver);\n\t\t\t}\n\t\t}\n\n\t\tPromise._visitRemaining = visitRemaining;\n\t\tfunction visitRemaining(promises, start, handler) {\n\t\t\tfor(var i=start; i= 0) {\n\t\t\t\treported.splice(i, 1);\n\t\t\t\tlogInfo('Handled previous rejection [' + r.id + '] ' + format.formatObject(r.value));\n\t\t\t}\n\t\t}\n\n\t\tfunction enqueue(f, x) {\n\t\t\ttasks.push(f, x);\n\t\t\tif(running === null) {\n\t\t\t\trunning = setTimer(flush, 0);\n\t\t\t}\n\t\t}\n\n\t\tfunction flush() {\n\t\t\trunning = null;\n\t\t\twhile(tasks.length > 0) {\n\t\t\t\ttasks.shift()(tasks.shift());\n\t\t\t}\n\t\t}\n\n\t\treturn Promise;\n\t};\n\n\tfunction throwit(e) {\n\t\tthrow e;\n\t}\n\n\tfunction noop() {}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n/*global process,document,setTimeout,clearTimeout,MutationObserver,WebKitMutationObserver*/\n(function(define) { 'use strict';\ndefine(function(require) {\n\t/*jshint maxcomplexity:6*/\n\n\t// Sniff \"best\" async scheduling option\n\t// Prefer process.nextTick or MutationObserver, then check for\n\t// setTimeout, and finally vertx, since its the only env that doesn't\n\t// have setTimeout\n\n\tvar MutationObs;\n\tvar capturedSetTimeout = typeof setTimeout !== 'undefined' && setTimeout;\n\n\t// Default env\n\tvar setTimer = function(f, ms) { return setTimeout(f, ms); };\n\tvar clearTimer = function(t) { return clearTimeout(t); };\n\tvar asap = function (f) { return capturedSetTimeout(f, 0); };\n\n\t// Detect specific env\n\tif (isNode()) { // Node\n\t\tasap = function (f) { return process.nextTick(f); };\n\n\t} else if (MutationObs = hasMutationObserver()) { // Modern browser\n\t\tasap = initMutationObserver(MutationObs);\n\n\t} else if (!capturedSetTimeout) { // vert.x\n\t\tvar vertxRequire = require;\n\t\tvar vertx = vertxRequire('vertx');\n\t\tsetTimer = function (f, ms) { return vertx.setTimer(ms, f); };\n\t\tclearTimer = vertx.cancelTimer;\n\t\tasap = vertx.runOnLoop || vertx.runOnContext;\n\t}\n\n\treturn {\n\t\tsetTimer: setTimer,\n\t\tclearTimer: clearTimer,\n\t\tasap: asap\n\t};\n\n\tfunction isNode () {\n\t\treturn typeof process !== 'undefined' &&\n\t\t\tObject.prototype.toString.call(process) === '[object process]';\n\t}\n\n\tfunction hasMutationObserver () {\n\t\treturn (typeof MutationObserver === 'function' && MutationObserver) ||\n\t\t\t(typeof WebKitMutationObserver === 'function' && WebKitMutationObserver);\n\t}\n\n\tfunction initMutationObserver(MutationObserver) {\n\t\tvar scheduled;\n\t\tvar node = document.createTextNode('');\n\t\tvar o = new MutationObserver(run);\n\t\to.observe(node, { characterData: true });\n\n\t\tfunction run() {\n\t\t\tvar f = scheduled;\n\t\t\tscheduled = void 0;\n\t\t\tf();\n\t\t}\n\n\t\tvar i = 0;\n\t\treturn function (f) {\n\t\t\tscheduled = f;\n\t\t\tnode.data = (i ^= 1);\n\t\t};\n\t}\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn {\n\t\tformatError: formatError,\n\t\tformatObject: formatObject,\n\t\ttryStringify: tryStringify\n\t};\n\n\t/**\n\t * Format an error into a string. If e is an Error and has a stack property,\n\t * it's returned. Otherwise, e is formatted using formatObject, with a\n\t * warning added about e not being a proper Error.\n\t * @param {*} e\n\t * @returns {String} formatted string, suitable for output to developers\n\t */\n\tfunction formatError(e) {\n\t\tvar s = typeof e === 'object' && e !== null && (e.stack || e.message) ? e.stack || e.message : formatObject(e);\n\t\treturn e instanceof Error ? s : s + ' (WARNING: non-Error used)';\n\t}\n\n\t/**\n\t * Format an object, detecting \"plain\" objects and running them through\n\t * JSON.stringify if possible.\n\t * @param {Object} o\n\t * @returns {string}\n\t */\n\tfunction formatObject(o) {\n\t\tvar s = String(o);\n\t\tif(s === '[object Object]' && typeof JSON !== 'undefined') {\n\t\t\ts = tryStringify(o, s);\n\t\t}\n\t\treturn s;\n\t}\n\n\t/**\n\t * Try to return the result of JSON.stringify(x). If that fails, return\n\t * defaultValue\n\t * @param {*} x\n\t * @param {*} defaultValue\n\t * @returns {String|*} JSON.stringify(x) or defaultValue\n\t */\n\tfunction tryStringify(x, defaultValue) {\n\t\ttry {\n\t\t\treturn JSON.stringify(x);\n\t\t} catch(e) {\n\t\t\treturn defaultValue;\n\t\t}\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function makePromise(environment) {\n\n\t\tvar tasks = environment.scheduler;\n\t\tvar emitRejection = initEmitRejection();\n\n\t\tvar objectCreate = Object.create ||\n\t\t\tfunction(proto) {\n\t\t\t\tfunction Child() {}\n\t\t\t\tChild.prototype = proto;\n\t\t\t\treturn new Child();\n\t\t\t};\n\n\t\t/**\n\t\t * Create a promise whose fate is determined by resolver\n\t\t * @constructor\n\t\t * @returns {Promise} promise\n\t\t * @name Promise\n\t\t */\n\t\tfunction Promise(resolver, handler) {\n\t\t\tthis._handler = resolver === Handler ? handler : init(resolver);\n\t\t}\n\n\t\t/**\n\t\t * Run the supplied resolver\n\t\t * @param resolver\n\t\t * @returns {Pending}\n\t\t */\n\t\tfunction init(resolver) {\n\t\t\tvar handler = new Pending();\n\n\t\t\ttry {\n\t\t\t\tresolver(promiseResolve, promiseReject, promiseNotify);\n\t\t\t} catch (e) {\n\t\t\t\tpromiseReject(e);\n\t\t\t}\n\n\t\t\treturn handler;\n\n\t\t\t/**\n\t\t\t * Transition from pre-resolution state to post-resolution state, notifying\n\t\t\t * all listeners of the ultimate fulfillment or rejection\n\t\t\t * @param {*} x resolution value\n\t\t\t */\n\t\t\tfunction promiseResolve (x) {\n\t\t\t\thandler.resolve(x);\n\t\t\t}\n\t\t\t/**\n\t\t\t * Reject this promise with reason, which will be used verbatim\n\t\t\t * @param {Error|*} reason rejection reason, strongly suggested\n\t\t\t * to be an Error type\n\t\t\t */\n\t\t\tfunction promiseReject (reason) {\n\t\t\t\thandler.reject(reason);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * @deprecated\n\t\t\t * Issue a progress event, notifying all progress listeners\n\t\t\t * @param {*} x progress event payload to pass to all listeners\n\t\t\t */\n\t\t\tfunction promiseNotify (x) {\n\t\t\t\thandler.notify(x);\n\t\t\t}\n\t\t}\n\n\t\t// Creation\n\n\t\tPromise.resolve = resolve;\n\t\tPromise.reject = reject;\n\t\tPromise.never = never;\n\n\t\tPromise._defer = defer;\n\t\tPromise._handler = getHandler;\n\n\t\t/**\n\t\t * Returns a trusted promise. If x is already a trusted promise, it is\n\t\t * returned, otherwise returns a new trusted Promise which follows x.\n\t\t * @param {*} x\n\t\t * @return {Promise} promise\n\t\t */\n\t\tfunction resolve(x) {\n\t\t\treturn isPromise(x) ? x\n\t\t\t\t: new Promise(Handler, new Async(getHandler(x)));\n\t\t}\n\n\t\t/**\n\t\t * Return a reject promise with x as its reason (x is used verbatim)\n\t\t * @param {*} x\n\t\t * @returns {Promise} rejected promise\n\t\t */\n\t\tfunction reject(x) {\n\t\t\treturn new Promise(Handler, new Async(new Rejected(x)));\n\t\t}\n\n\t\t/**\n\t\t * Return a promise that remains pending forever\n\t\t * @returns {Promise} forever-pending promise.\n\t\t */\n\t\tfunction never() {\n\t\t\treturn foreverPendingPromise; // Should be frozen\n\t\t}\n\n\t\t/**\n\t\t * Creates an internal {promise, resolver} pair\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tfunction defer() {\n\t\t\treturn new Promise(Handler, new Pending());\n\t\t}\n\n\t\t// Transformation and flow control\n\n\t\t/**\n\t\t * Transform this promise's fulfillment value, returning a new Promise\n\t\t * for the transformed result. If the promise cannot be fulfilled, onRejected\n\t\t * is called with the reason. onProgress *may* be called with updates toward\n\t\t * this promise's fulfillment.\n\t\t * @param {function=} onFulfilled fulfillment handler\n\t\t * @param {function=} onRejected rejection handler\n\t\t * @param {function=} onProgress @deprecated progress handler\n\t\t * @return {Promise} new promise\n\t\t */\n\t\tPromise.prototype.then = function(onFulfilled, onRejected, onProgress) {\n\t\t\tvar parent = this._handler;\n\t\t\tvar state = parent.join().state();\n\n\t\t\tif ((typeof onFulfilled !== 'function' && state > 0) ||\n\t\t\t\t(typeof onRejected !== 'function' && state < 0)) {\n\t\t\t\t// Short circuit: value will not change, simply share handler\n\t\t\t\treturn new this.constructor(Handler, parent);\n\t\t\t}\n\n\t\t\tvar p = this._beget();\n\t\t\tvar child = p._handler;\n\n\t\t\tparent.chain(child, parent.receiver, onFulfilled, onRejected, onProgress);\n\n\t\t\treturn p;\n\t\t};\n\n\t\t/**\n\t\t * If this promise cannot be fulfilled due to an error, call onRejected to\n\t\t * handle the error. Shortcut for .then(undefined, onRejected)\n\t\t * @param {function?} onRejected\n\t\t * @return {Promise}\n\t\t */\n\t\tPromise.prototype['catch'] = function(onRejected) {\n\t\t\treturn this.then(void 0, onRejected);\n\t\t};\n\n\t\t/**\n\t\t * Creates a new, pending promise of the same type as this promise\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype._beget = function() {\n\t\t\treturn begetFrom(this._handler, this.constructor);\n\t\t};\n\n\t\tfunction begetFrom(parent, Promise) {\n\t\t\tvar child = new Pending(parent.receiver, parent.join().context);\n\t\t\treturn new Promise(Handler, child);\n\t\t}\n\n\t\t// Array combinators\n\n\t\tPromise.all = all;\n\t\tPromise.race = race;\n\t\tPromise._traverse = traverse;\n\n\t\t/**\n\t\t * Return a promise that will fulfill when all promises in the\n\t\t * input array have fulfilled, or will reject when one of the\n\t\t * promises rejects.\n\t\t * @param {array} promises array of promises\n\t\t * @returns {Promise} promise for array of fulfillment values\n\t\t */\n\t\tfunction all(promises) {\n\t\t\treturn traverseWith(snd, null, promises);\n\t\t}\n\n\t\t/**\n\t\t * Array> -> Promise>\n\t\t * @private\n\t\t * @param {function} f function to apply to each promise's value\n\t\t * @param {Array} promises array of promises\n\t\t * @returns {Promise} promise for transformed values\n\t\t */\n\t\tfunction traverse(f, promises) {\n\t\t\treturn traverseWith(tryCatch2, f, promises);\n\t\t}\n\n\t\tfunction traverseWith(tryMap, f, promises) {\n\t\t\tvar handler = typeof f === 'function' ? mapAt : settleAt;\n\n\t\t\tvar resolver = new Pending();\n\t\t\tvar pending = promises.length >>> 0;\n\t\t\tvar results = new Array(pending);\n\n\t\t\tfor (var i = 0, x; i < promises.length && !resolver.resolved; ++i) {\n\t\t\t\tx = promises[i];\n\n\t\t\t\tif (x === void 0 && !(i in promises)) {\n\t\t\t\t\t--pending;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttraverseAt(promises, handler, i, x, resolver);\n\t\t\t}\n\n\t\t\tif(pending === 0) {\n\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t}\n\n\t\t\treturn new Promise(Handler, resolver);\n\n\t\t\tfunction mapAt(i, x, resolver) {\n\t\t\t\tif(!resolver.resolved) {\n\t\t\t\t\ttraverseAt(promises, settleAt, i, tryMap(f, x, i), resolver);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction settleAt(i, x, resolver) {\n\t\t\t\tresults[i] = x;\n\t\t\t\tif(--pending === 0) {\n\t\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction traverseAt(promises, handler, i, x, resolver) {\n\t\t\tif (maybeThenable(x)) {\n\t\t\t\tvar h = getHandlerMaybeThenable(x);\n\t\t\t\tvar s = h.state();\n\n\t\t\t\tif (s === 0) {\n\t\t\t\t\th.fold(handler, i, void 0, resolver);\n\t\t\t\t} else if (s > 0) {\n\t\t\t\t\thandler(i, h.value, resolver);\n\t\t\t\t} else {\n\t\t\t\t\tresolver.become(h);\n\t\t\t\t\tvisitRemaining(promises, i+1, h);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thandler(i, x, resolver);\n\t\t\t}\n\t\t}\n\n\t\tPromise._visitRemaining = visitRemaining;\n\t\tfunction visitRemaining(promises, start, handler) {\n\t\t\tfor(var i=start; i= 0) {\n\t\t\t\treported.splice(i, 1);\n\t\t\t\tlogInfo('Handled previous rejection [' + r.id + '] ' + format.formatObject(r.value));\n\t\t\t}\n\t\t}\n\n\t\tfunction enqueue(f, x) {\n\t\t\ttasks.push(f, x);\n\t\t\tif(running === null) {\n\t\t\t\trunning = setTimer(flush, 0);\n\t\t\t}\n\t\t}\n\n\t\tfunction flush() {\n\t\t\trunning = null;\n\t\t\twhile(tasks.length > 0) {\n\t\t\t\ttasks.shift()(tasks.shift());\n\t\t\t}\n\t\t}\n\n\t\treturn Promise;\n\t};\n\n\tfunction throwit(e) {\n\t\tthrow e;\n\t}\n\n\tfunction noop() {}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n/*global process,document,setTimeout,clearTimeout,MutationObserver,WebKitMutationObserver*/\n(function(define) { 'use strict';\ndefine(function(require) {\n\t/*jshint maxcomplexity:6*/\n\n\t// Sniff \"best\" async scheduling option\n\t// Prefer process.nextTick or MutationObserver, then check for\n\t// setTimeout, and finally vertx, since its the only env that doesn't\n\t// have setTimeout\n\n\tvar MutationObs;\n\tvar capturedSetTimeout = typeof setTimeout !== 'undefined' && setTimeout;\n\n\t// Default env\n\tvar setTimer = function(f, ms) { return setTimeout(f, ms); };\n\tvar clearTimer = function(t) { return clearTimeout(t); };\n\tvar asap = function (f) { return capturedSetTimeout(f, 0); };\n\n\t// Detect specific env\n\tif (isNode()) { // Node\n\t\tasap = function (f) { return process.nextTick(f); };\n\n\t} else if (MutationObs = hasMutationObserver()) { // Modern browser\n\t\tasap = initMutationObserver(MutationObs);\n\n\t} else if (!capturedSetTimeout) { // vert.x\n\t\tvar vertxRequire = require;\n\t\tvar vertx = vertxRequire('vertx');\n\t\tsetTimer = function (f, ms) { return vertx.setTimer(ms, f); };\n\t\tclearTimer = vertx.cancelTimer;\n\t\tasap = vertx.runOnLoop || vertx.runOnContext;\n\t}\n\n\treturn {\n\t\tsetTimer: setTimer,\n\t\tclearTimer: clearTimer,\n\t\tasap: asap\n\t};\n\n\tfunction isNode () {\n\t\treturn typeof process !== 'undefined' &&\n\t\t\tObject.prototype.toString.call(process) === '[object process]';\n\t}\n\n\tfunction hasMutationObserver () {\n\t return (typeof MutationObserver !== 'undefined' && MutationObserver) ||\n\t\t\t(typeof WebKitMutationObserver !== 'undefined' && WebKitMutationObserver);\n\t}\n\n\tfunction initMutationObserver(MutationObserver) {\n\t\tvar scheduled;\n\t\tvar node = document.createTextNode('');\n\t\tvar o = new MutationObserver(run);\n\t\to.observe(node, { characterData: true });\n\n\t\tfunction run() {\n\t\t\tvar f = scheduled;\n\t\t\tscheduled = void 0;\n\t\t\tf();\n\t\t}\n\n\t\tvar i = 0;\n\t\treturn function (f) {\n\t\t\tscheduled = f;\n\t\t\tnode.data = (i ^= 1);\n\t\t};\n\t}\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn {\n\t\tformatError: formatError,\n\t\tformatObject: formatObject,\n\t\ttryStringify: tryStringify\n\t};\n\n\t/**\n\t * Format an error into a string. If e is an Error and has a stack property,\n\t * it's returned. Otherwise, e is formatted using formatObject, with a\n\t * warning added about e not being a proper Error.\n\t * @param {*} e\n\t * @returns {String} formatted string, suitable for output to developers\n\t */\n\tfunction formatError(e) {\n\t\tvar s = typeof e === 'object' && e !== null && (e.stack || e.message) ? e.stack || e.message : formatObject(e);\n\t\treturn e instanceof Error ? s : s + ' (WARNING: non-Error used)';\n\t}\n\n\t/**\n\t * Format an object, detecting \"plain\" objects and running them through\n\t * JSON.stringify if possible.\n\t * @param {Object} o\n\t * @returns {string}\n\t */\n\tfunction formatObject(o) {\n\t\tvar s = String(o);\n\t\tif(s === '[object Object]' && typeof JSON !== 'undefined') {\n\t\t\ts = tryStringify(o, s);\n\t\t}\n\t\treturn s;\n\t}\n\n\t/**\n\t * Try to return the result of JSON.stringify(x). If that fails, return\n\t * defaultValue\n\t * @param {*} x\n\t * @param {*} defaultValue\n\t * @returns {String|*} JSON.stringify(x) or defaultValue\n\t */\n\tfunction tryStringify(x, defaultValue) {\n\t\ttry {\n\t\t\treturn JSON.stringify(x);\n\t\t} catch(e) {\n\t\t\treturn defaultValue;\n\t\t}\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function makePromise(environment) {\n\n\t\tvar tasks = environment.scheduler;\n\t\tvar emitRejection = initEmitRejection();\n\n\t\tvar objectCreate = Object.create ||\n\t\t\tfunction(proto) {\n\t\t\t\tfunction Child() {}\n\t\t\t\tChild.prototype = proto;\n\t\t\t\treturn new Child();\n\t\t\t};\n\n\t\t/**\n\t\t * Create a promise whose fate is determined by resolver\n\t\t * @constructor\n\t\t * @returns {Promise} promise\n\t\t * @name Promise\n\t\t */\n\t\tfunction Promise(resolver, handler) {\n\t\t\tthis._handler = resolver === Handler ? handler : init(resolver);\n\t\t}\n\n\t\t/**\n\t\t * Run the supplied resolver\n\t\t * @param resolver\n\t\t * @returns {Pending}\n\t\t */\n\t\tfunction init(resolver) {\n\t\t\tvar handler = new Pending();\n\n\t\t\ttry {\n\t\t\t\tresolver(promiseResolve, promiseReject, promiseNotify);\n\t\t\t} catch (e) {\n\t\t\t\tpromiseReject(e);\n\t\t\t}\n\n\t\t\treturn handler;\n\n\t\t\t/**\n\t\t\t * Transition from pre-resolution state to post-resolution state, notifying\n\t\t\t * all listeners of the ultimate fulfillment or rejection\n\t\t\t * @param {*} x resolution value\n\t\t\t */\n\t\t\tfunction promiseResolve (x) {\n\t\t\t\thandler.resolve(x);\n\t\t\t}\n\t\t\t/**\n\t\t\t * Reject this promise with reason, which will be used verbatim\n\t\t\t * @param {Error|*} reason rejection reason, strongly suggested\n\t\t\t * to be an Error type\n\t\t\t */\n\t\t\tfunction promiseReject (reason) {\n\t\t\t\thandler.reject(reason);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * @deprecated\n\t\t\t * Issue a progress event, notifying all progress listeners\n\t\t\t * @param {*} x progress event payload to pass to all listeners\n\t\t\t */\n\t\t\tfunction promiseNotify (x) {\n\t\t\t\thandler.notify(x);\n\t\t\t}\n\t\t}\n\n\t\t// Creation\n\n\t\tPromise.resolve = resolve;\n\t\tPromise.reject = reject;\n\t\tPromise.never = never;\n\n\t\tPromise._defer = defer;\n\t\tPromise._handler = getHandler;\n\n\t\t/**\n\t\t * Returns a trusted promise. If x is already a trusted promise, it is\n\t\t * returned, otherwise returns a new trusted Promise which follows x.\n\t\t * @param {*} x\n\t\t * @return {Promise} promise\n\t\t */\n\t\tfunction resolve(x) {\n\t\t\treturn isPromise(x) ? x\n\t\t\t\t: new Promise(Handler, new Async(getHandler(x)));\n\t\t}\n\n\t\t/**\n\t\t * Return a reject promise with x as its reason (x is used verbatim)\n\t\t * @param {*} x\n\t\t * @returns {Promise} rejected promise\n\t\t */\n\t\tfunction reject(x) {\n\t\t\treturn new Promise(Handler, new Async(new Rejected(x)));\n\t\t}\n\n\t\t/**\n\t\t * Return a promise that remains pending forever\n\t\t * @returns {Promise} forever-pending promise.\n\t\t */\n\t\tfunction never() {\n\t\t\treturn foreverPendingPromise; // Should be frozen\n\t\t}\n\n\t\t/**\n\t\t * Creates an internal {promise, resolver} pair\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tfunction defer() {\n\t\t\treturn new Promise(Handler, new Pending());\n\t\t}\n\n\t\t// Transformation and flow control\n\n\t\t/**\n\t\t * Transform this promise's fulfillment value, returning a new Promise\n\t\t * for the transformed result. If the promise cannot be fulfilled, onRejected\n\t\t * is called with the reason. onProgress *may* be called with updates toward\n\t\t * this promise's fulfillment.\n\t\t * @param {function=} onFulfilled fulfillment handler\n\t\t * @param {function=} onRejected rejection handler\n\t\t * @param {function=} onProgress @deprecated progress handler\n\t\t * @return {Promise} new promise\n\t\t */\n\t\tPromise.prototype.then = function(onFulfilled, onRejected, onProgress) {\n\t\t\tvar parent = this._handler;\n\t\t\tvar state = parent.join().state();\n\n\t\t\tif ((typeof onFulfilled !== 'function' && state > 0) ||\n\t\t\t\t(typeof onRejected !== 'function' && state < 0)) {\n\t\t\t\t// Short circuit: value will not change, simply share handler\n\t\t\t\treturn new this.constructor(Handler, parent);\n\t\t\t}\n\n\t\t\tvar p = this._beget();\n\t\t\tvar child = p._handler;\n\n\t\t\tparent.chain(child, parent.receiver, onFulfilled, onRejected, onProgress);\n\n\t\t\treturn p;\n\t\t};\n\n\t\t/**\n\t\t * If this promise cannot be fulfilled due to an error, call onRejected to\n\t\t * handle the error. Shortcut for .then(undefined, onRejected)\n\t\t * @param {function?} onRejected\n\t\t * @return {Promise}\n\t\t */\n\t\tPromise.prototype['catch'] = function(onRejected) {\n\t\t\treturn this.then(void 0, onRejected);\n\t\t};\n\n\t\t/**\n\t\t * Creates a new, pending promise of the same type as this promise\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype._beget = function() {\n\t\t\treturn begetFrom(this._handler, this.constructor);\n\t\t};\n\n\t\tfunction begetFrom(parent, Promise) {\n\t\t\tvar child = new Pending(parent.receiver, parent.join().context);\n\t\t\treturn new Promise(Handler, child);\n\t\t}\n\n\t\t// Array combinators\n\n\t\tPromise.all = all;\n\t\tPromise.race = race;\n\t\tPromise._traverse = traverse;\n\n\t\t/**\n\t\t * Return a promise that will fulfill when all promises in the\n\t\t * input array have fulfilled, or will reject when one of the\n\t\t * promises rejects.\n\t\t * @param {array} promises array of promises\n\t\t * @returns {Promise} promise for array of fulfillment values\n\t\t */\n\t\tfunction all(promises) {\n\t\t\treturn traverseWith(snd, null, promises);\n\t\t}\n\n\t\t/**\n\t\t * Array> -> Promise>\n\t\t * @private\n\t\t * @param {function} f function to apply to each promise's value\n\t\t * @param {Array} promises array of promises\n\t\t * @returns {Promise} promise for transformed values\n\t\t */\n\t\tfunction traverse(f, promises) {\n\t\t\treturn traverseWith(tryCatch2, f, promises);\n\t\t}\n\n\t\tfunction traverseWith(tryMap, f, promises) {\n\t\t\tvar handler = typeof f === 'function' ? mapAt : settleAt;\n\n\t\t\tvar resolver = new Pending();\n\t\t\tvar pending = promises.length >>> 0;\n\t\t\tvar results = new Array(pending);\n\n\t\t\tfor (var i = 0, x; i < promises.length && !resolver.resolved; ++i) {\n\t\t\t\tx = promises[i];\n\n\t\t\t\tif (x === void 0 && !(i in promises)) {\n\t\t\t\t\t--pending;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttraverseAt(promises, handler, i, x, resolver);\n\t\t\t}\n\n\t\t\tif(pending === 0) {\n\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t}\n\n\t\t\treturn new Promise(Handler, resolver);\n\n\t\t\tfunction mapAt(i, x, resolver) {\n\t\t\t\tif(!resolver.resolved) {\n\t\t\t\t\ttraverseAt(promises, settleAt, i, tryMap(f, x, i), resolver);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction settleAt(i, x, resolver) {\n\t\t\t\tresults[i] = x;\n\t\t\t\tif(--pending === 0) {\n\t\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction traverseAt(promises, handler, i, x, resolver) {\n\t\t\tif (maybeThenable(x)) {\n\t\t\t\tvar h = getHandlerMaybeThenable(x);\n\t\t\t\tvar s = h.state();\n\n\t\t\t\tif (s === 0) {\n\t\t\t\t\th.fold(handler, i, void 0, resolver);\n\t\t\t\t} else if (s > 0) {\n\t\t\t\t\thandler(i, h.value, resolver);\n\t\t\t\t} else {\n\t\t\t\t\tresolver.become(h);\n\t\t\t\t\tvisitRemaining(promises, i+1, h);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thandler(i, x, resolver);\n\t\t\t}\n\t\t}\n\n\t\tPromise._visitRemaining = visitRemaining;\n\t\tfunction visitRemaining(promises, start, handler) {\n\t\t\tfor(var i=start; i= 0) {\n\t\t\t\treported.splice(i, 1);\n\t\t\t\tlogInfo('Handled previous rejection [' + r.id + '] ' + format.formatObject(r.value));\n\t\t\t}\n\t\t}\n\n\t\tfunction enqueue(f, x) {\n\t\t\ttasks.push(f, x);\n\t\t\tif(running === null) {\n\t\t\t\trunning = setTimer(flush, 0);\n\t\t\t}\n\t\t}\n\n\t\tfunction flush() {\n\t\t\trunning = null;\n\t\t\twhile(tasks.length > 0) {\n\t\t\t\ttasks.shift()(tasks.shift());\n\t\t\t}\n\t\t}\n\n\t\treturn Promise;\n\t};\n\n\tfunction throwit(e) {\n\t\tthrow e;\n\t}\n\n\tfunction noop() {}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n/*global process,document,setTimeout,clearTimeout,MutationObserver,WebKitMutationObserver*/\n(function(define) { 'use strict';\ndefine(function(require) {\n\t/*jshint maxcomplexity:6*/\n\n\t// Sniff \"best\" async scheduling option\n\t// Prefer process.nextTick or MutationObserver, then check for\n\t// setTimeout, and finally vertx, since its the only env that doesn't\n\t// have setTimeout\n\n\tvar MutationObs;\n\tvar capturedSetTimeout = typeof setTimeout !== 'undefined' && setTimeout;\n\n\t// Default env\n\tvar setTimer = function(f, ms) { return setTimeout(f, ms); };\n\tvar clearTimer = function(t) { return clearTimeout(t); };\n\tvar asap = function (f) { return capturedSetTimeout(f, 0); };\n\n\t// Detect specific env\n\tif (isNode()) { // Node\n\t\tasap = function (f) { return process.nextTick(f); };\n\n\t} else if (MutationObs = hasMutationObserver()) { // Modern browser\n\t\tasap = initMutationObserver(MutationObs);\n\n\t} else if (!capturedSetTimeout) { // vert.x\n\t\tvar vertxRequire = require;\n\t\tvar vertx = vertxRequire('vertx');\n\t\tsetTimer = function (f, ms) { return vertx.setTimer(ms, f); };\n\t\tclearTimer = vertx.cancelTimer;\n\t\tasap = vertx.runOnLoop || vertx.runOnContext;\n\t}\n\n\treturn {\n\t\tsetTimer: setTimer,\n\t\tclearTimer: clearTimer,\n\t\tasap: asap\n\t};\n\n\tfunction isNode () {\n\t\treturn typeof process !== 'undefined' &&\n\t\t\tObject.prototype.toString.call(process) === '[object process]';\n\t}\n\n\tfunction hasMutationObserver () {\n\t return (typeof MutationObserver !== 'undefined' && MutationObserver) ||\n\t\t\t(typeof WebKitMutationObserver !== 'undefined' && WebKitMutationObserver);\n\t}\n\n\tfunction initMutationObserver(MutationObserver) {\n\t\tvar scheduled;\n\t\tvar node = document.createTextNode('');\n\t\tvar o = new MutationObserver(run);\n\t\to.observe(node, { characterData: true });\n\n\t\tfunction run() {\n\t\t\tvar f = scheduled;\n\t\t\tscheduled = void 0;\n\t\t\tf();\n\t\t}\n\n\t\tvar i = 0;\n\t\treturn function (f) {\n\t\t\tscheduled = f;\n\t\t\tnode.data = (i ^= 1);\n\t\t};\n\t}\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn {\n\t\tformatError: formatError,\n\t\tformatObject: formatObject,\n\t\ttryStringify: tryStringify\n\t};\n\n\t/**\n\t * Format an error into a string. If e is an Error and has a stack property,\n\t * it's returned. Otherwise, e is formatted using formatObject, with a\n\t * warning added about e not being a proper Error.\n\t * @param {*} e\n\t * @returns {String} formatted string, suitable for output to developers\n\t */\n\tfunction formatError(e) {\n\t\tvar s = typeof e === 'object' && e !== null && (e.stack || e.message) ? e.stack || e.message : formatObject(e);\n\t\treturn e instanceof Error ? s : s + ' (WARNING: non-Error used)';\n\t}\n\n\t/**\n\t * Format an object, detecting \"plain\" objects and running them through\n\t * JSON.stringify if possible.\n\t * @param {Object} o\n\t * @returns {string}\n\t */\n\tfunction formatObject(o) {\n\t\tvar s = String(o);\n\t\tif(s === '[object Object]' && typeof JSON !== 'undefined') {\n\t\t\ts = tryStringify(o, s);\n\t\t}\n\t\treturn s;\n\t}\n\n\t/**\n\t * Try to return the result of JSON.stringify(x). If that fails, return\n\t * defaultValue\n\t * @param {*} x\n\t * @param {*} defaultValue\n\t * @returns {String|*} JSON.stringify(x) or defaultValue\n\t */\n\tfunction tryStringify(x, defaultValue) {\n\t\ttry {\n\t\t\treturn JSON.stringify(x);\n\t\t} catch(e) {\n\t\t\treturn defaultValue;\n\t\t}\n\t}\n\n});\n}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));\n","/** @license MIT License (c) copyright 2010-2014 original author or authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\n(function(define) { 'use strict';\ndefine(function() {\n\n\treturn function makePromise(environment) {\n\n\t\tvar tasks = environment.scheduler;\n\t\tvar emitRejection = initEmitRejection();\n\n\t\tvar objectCreate = Object.create ||\n\t\t\tfunction(proto) {\n\t\t\t\tfunction Child() {}\n\t\t\t\tChild.prototype = proto;\n\t\t\t\treturn new Child();\n\t\t\t};\n\n\t\t/**\n\t\t * Create a promise whose fate is determined by resolver\n\t\t * @constructor\n\t\t * @returns {Promise} promise\n\t\t * @name Promise\n\t\t */\n\t\tfunction Promise(resolver, handler) {\n\t\t\tthis._handler = resolver === Handler ? handler : init(resolver);\n\t\t}\n\n\t\t/**\n\t\t * Run the supplied resolver\n\t\t * @param resolver\n\t\t * @returns {Pending}\n\t\t */\n\t\tfunction init(resolver) {\n\t\t\tvar handler = new Pending();\n\n\t\t\ttry {\n\t\t\t\tresolver(promiseResolve, promiseReject, promiseNotify);\n\t\t\t} catch (e) {\n\t\t\t\tpromiseReject(e);\n\t\t\t}\n\n\t\t\treturn handler;\n\n\t\t\t/**\n\t\t\t * Transition from pre-resolution state to post-resolution state, notifying\n\t\t\t * all listeners of the ultimate fulfillment or rejection\n\t\t\t * @param {*} x resolution value\n\t\t\t */\n\t\t\tfunction promiseResolve (x) {\n\t\t\t\thandler.resolve(x);\n\t\t\t}\n\t\t\t/**\n\t\t\t * Reject this promise with reason, which will be used verbatim\n\t\t\t * @param {Error|*} reason rejection reason, strongly suggested\n\t\t\t * to be an Error type\n\t\t\t */\n\t\t\tfunction promiseReject (reason) {\n\t\t\t\thandler.reject(reason);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * @deprecated\n\t\t\t * Issue a progress event, notifying all progress listeners\n\t\t\t * @param {*} x progress event payload to pass to all listeners\n\t\t\t */\n\t\t\tfunction promiseNotify (x) {\n\t\t\t\thandler.notify(x);\n\t\t\t}\n\t\t}\n\n\t\t// Creation\n\n\t\tPromise.resolve = resolve;\n\t\tPromise.reject = reject;\n\t\tPromise.never = never;\n\n\t\tPromise._defer = defer;\n\t\tPromise._handler = getHandler;\n\n\t\t/**\n\t\t * Returns a trusted promise. If x is already a trusted promise, it is\n\t\t * returned, otherwise returns a new trusted Promise which follows x.\n\t\t * @param {*} x\n\t\t * @return {Promise} promise\n\t\t */\n\t\tfunction resolve(x) {\n\t\t\treturn isPromise(x) ? x\n\t\t\t\t: new Promise(Handler, new Async(getHandler(x)));\n\t\t}\n\n\t\t/**\n\t\t * Return a reject promise with x as its reason (x is used verbatim)\n\t\t * @param {*} x\n\t\t * @returns {Promise} rejected promise\n\t\t */\n\t\tfunction reject(x) {\n\t\t\treturn new Promise(Handler, new Async(new Rejected(x)));\n\t\t}\n\n\t\t/**\n\t\t * Return a promise that remains pending forever\n\t\t * @returns {Promise} forever-pending promise.\n\t\t */\n\t\tfunction never() {\n\t\t\treturn foreverPendingPromise; // Should be frozen\n\t\t}\n\n\t\t/**\n\t\t * Creates an internal {promise, resolver} pair\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tfunction defer() {\n\t\t\treturn new Promise(Handler, new Pending());\n\t\t}\n\n\t\t// Transformation and flow control\n\n\t\t/**\n\t\t * Transform this promise's fulfillment value, returning a new Promise\n\t\t * for the transformed result. If the promise cannot be fulfilled, onRejected\n\t\t * is called with the reason. onProgress *may* be called with updates toward\n\t\t * this promise's fulfillment.\n\t\t * @param {function=} onFulfilled fulfillment handler\n\t\t * @param {function=} onRejected rejection handler\n\t\t * @param {function=} onProgress @deprecated progress handler\n\t\t * @return {Promise} new promise\n\t\t */\n\t\tPromise.prototype.then = function(onFulfilled, onRejected, onProgress) {\n\t\t\tvar parent = this._handler;\n\t\t\tvar state = parent.join().state();\n\n\t\t\tif ((typeof onFulfilled !== 'function' && state > 0) ||\n\t\t\t\t(typeof onRejected !== 'function' && state < 0)) {\n\t\t\t\t// Short circuit: value will not change, simply share handler\n\t\t\t\treturn new this.constructor(Handler, parent);\n\t\t\t}\n\n\t\t\tvar p = this._beget();\n\t\t\tvar child = p._handler;\n\n\t\t\tparent.chain(child, parent.receiver, onFulfilled, onRejected, onProgress);\n\n\t\t\treturn p;\n\t\t};\n\n\t\t/**\n\t\t * If this promise cannot be fulfilled due to an error, call onRejected to\n\t\t * handle the error. Shortcut for .then(undefined, onRejected)\n\t\t * @param {function?} onRejected\n\t\t * @return {Promise}\n\t\t */\n\t\tPromise.prototype['catch'] = function(onRejected) {\n\t\t\treturn this.then(void 0, onRejected);\n\t\t};\n\n\t\t/**\n\t\t * Creates a new, pending promise of the same type as this promise\n\t\t * @private\n\t\t * @returns {Promise}\n\t\t */\n\t\tPromise.prototype._beget = function() {\n\t\t\treturn begetFrom(this._handler, this.constructor);\n\t\t};\n\n\t\tfunction begetFrom(parent, Promise) {\n\t\t\tvar child = new Pending(parent.receiver, parent.join().context);\n\t\t\treturn new Promise(Handler, child);\n\t\t}\n\n\t\t// Array combinators\n\n\t\tPromise.all = all;\n\t\tPromise.race = race;\n\t\tPromise._traverse = traverse;\n\n\t\t/**\n\t\t * Return a promise that will fulfill when all promises in the\n\t\t * input array have fulfilled, or will reject when one of the\n\t\t * promises rejects.\n\t\t * @param {array} promises array of promises\n\t\t * @returns {Promise} promise for array of fulfillment values\n\t\t */\n\t\tfunction all(promises) {\n\t\t\treturn traverseWith(snd, null, promises);\n\t\t}\n\n\t\t/**\n\t\t * Array> -> Promise>\n\t\t * @private\n\t\t * @param {function} f function to apply to each promise's value\n\t\t * @param {Array} promises array of promises\n\t\t * @returns {Promise} promise for transformed values\n\t\t */\n\t\tfunction traverse(f, promises) {\n\t\t\treturn traverseWith(tryCatch2, f, promises);\n\t\t}\n\n\t\tfunction traverseWith(tryMap, f, promises) {\n\t\t\tvar handler = typeof f === 'function' ? mapAt : settleAt;\n\n\t\t\tvar resolver = new Pending();\n\t\t\tvar pending = promises.length >>> 0;\n\t\t\tvar results = new Array(pending);\n\n\t\t\tfor (var i = 0, x; i < promises.length && !resolver.resolved; ++i) {\n\t\t\t\tx = promises[i];\n\n\t\t\t\tif (x === void 0 && !(i in promises)) {\n\t\t\t\t\t--pending;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttraverseAt(promises, handler, i, x, resolver);\n\t\t\t}\n\n\t\t\tif(pending === 0) {\n\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t}\n\n\t\t\treturn new Promise(Handler, resolver);\n\n\t\t\tfunction mapAt(i, x, resolver) {\n\t\t\t\tif(!resolver.resolved) {\n\t\t\t\t\ttraverseAt(promises, settleAt, i, tryMap(f, x, i), resolver);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction settleAt(i, x, resolver) {\n\t\t\t\tresults[i] = x;\n\t\t\t\tif(--pending === 0) {\n\t\t\t\t\tresolver.become(new Fulfilled(results));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction traverseAt(promises, handler, i, x, resolver) {\n\t\t\tif (maybeThenable(x)) {\n\t\t\t\tvar h = getHandlerMaybeThenable(x);\n\t\t\t\tvar s = h.state();\n\n\t\t\t\tif (s === 0) {\n\t\t\t\t\th.fold(handler, i, void 0, resolver);\n\t\t\t\t} else if (s > 0) {\n\t\t\t\t\thandler(i, h.value, resolver);\n\t\t\t\t} else {\n\t\t\t\t\tresolver.become(h);\n\t\t\t\t\tvisitRemaining(promises, i+1, h);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thandler(i, x, resolver);\n\t\t\t}\n\t\t}\n\n\t\tPromise._visitRemaining = visitRemaining;\n\t\tfunction visitRemaining(promises, start, handler) {\n\t\t\tfor(var i=start; ies6-shim/Promise.js", - "browserify-when": "mkdir -p dist/browser && browserify -s when build/when.browserify.js --no-detect-globals --debug | exorcist -b . -r https://raw.githubusercontent.com/cujojs/when/`git rev-parse HEAD` dist/browser/when.js.map >dist/browser/when.js", - "browserify-debug": "mkdir -p dist/browser && browserify -s when build/when.browserify-debug.js --no-detect-globals --debug | exorcist -b . -r https://raw.githubusercontent.com/cujojs/when/`git rev-parse HEAD` dist/browser/when.debug.js.map >dist/browser/when.debug.js", + "browserify-es6": "node scripts/browserify.js es6", + "browserify-when": "node scripts/browserify.js when", + "browserify-debug": "node scripts/browserify.js debug", "uglify": "npm run uglify-es6 && npm run uglify-when", - "uglify-es6": "cd es6-shim; uglifyjs Promise.js --compress --mangle --in-source-map Promise.js.map --source-map Promise.min.js.map -o Promise.min.js; cd ../..", - "uglify-when": "cd dist/browser; uglifyjs when.js --compress --mangle --in-source-map when.js.map --source-map when.min.js.map -o when.min.js; cd ../.." + "uglify-es6": "uglifyjs es6-shim/Promise.js --compress --mangle --in-source-map es6-shim/Promise.js.map --source-map es6-shim/Promise.min.js.map -o es6-shim/Promise.min.js", + "uglify-when": "uglifyjs dist/browser/when.js --compress --mangle --in-source-map dist/browser/when.js.map --source-map dist/browser/when.min.js.map -o dist/browser/when.min.js" } } diff --git a/node_modules/which/CHANGELOG.md b/node_modules/which/CHANGELOG.md index 698e8edb0..c44cfbec5 100644 --- a/node_modules/which/CHANGELOG.md +++ b/node_modules/which/CHANGELOG.md @@ -1,6 +1,18 @@ # Changes +## v1.2.14 + +* appveyor: drop node 5 and 0.x +* travis-ci: add node 6, drop 0.x + +## v1.2.13 + +* test: Pass missing option to pass on windows +* update tap +* update isexe to 2.0.0 +* neveragain.tech pledge request + ## v1.2.12 * Removed unused require diff --git a/node_modules/which/package.json b/node_modules/which/package.json index 9c7de7d9d..a67870ed1 100644 --- a/node_modules/which/package.json +++ b/node_modules/which/package.json @@ -2,7 +2,7 @@ "author": "Isaac Z. Schlueter (http://blog.izs.me)", "name": "which", "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", - "version": "1.2.12", + "version": "1.2.14", "repository": { "type": "git", "url": "git://github.com/isaacs/node-which.git" @@ -11,12 +11,12 @@ "bin": "./bin/which", "license": "ISC", "dependencies": { - "isexe": "^1.1.1" + "isexe": "^2.0.0" }, "devDependencies": { "mkdirp": "^0.5.0", "rimraf": "^2.3.3", - "tap": "^5.1.1" + "tap": "^10.3.0" }, "scripts": { "test": "tap test/*.js --cov", diff --git a/node_modules/zip-stream/README.md b/node_modules/zip-stream/README.md index 7169cdcef..ffc846a1e 100644 --- a/node_modules/zip-stream/README.md +++ b/node_modules/zip-stream/README.md @@ -1,4 +1,4 @@ -# zip-stream v1.1.0 [![Build Status](https://travis-ci.org/archiverjs/node-zip-stream.svg?branch=master)](https://travis-ci.org/archiverjs/node-zip-stream) [![Build status](https://ci.appveyor.com/api/projects/status/2sraarbaadwbtti2/branch/master?svg=true)](https://ci.appveyor.com/project/ctalkington/node-zip-stream/branch/master) +# ZipStream v1.1.1 [![Build Status](https://travis-ci.org/archiverjs/node-zip-stream.svg?branch=master)](https://travis-ci.org/archiverjs/node-zip-stream) [![Build status](https://ci.appveyor.com/api/projects/status/2sraarbaadwbtti2/branch/master?svg=true)](https://ci.appveyor.com/project/ctalkington/node-zip-stream/branch/master) zip-stream is a streaming zip archive generator based on the `ZipArchiveOutputStream` prototype found in the [compress-commons](https://www.npmjs.org/package/compress-commons) project. @@ -40,12 +40,6 @@ archive.entry('string contents', { name: 'string.txt' }, function(err, entry) { }); ``` -## Things of Interest - -- [Releases](https://github.com/archiverjs/node-zip-stream/releases) -- [Contributing](https://github.com/archiverjs/node-zip-stream/blob/master/CONTRIBUTING.md) -- [MIT License](https://github.com/archiverjs/node-zip-stream/blob/master/LICENSE) - ## Credits Concept inspired by Antoine van Wel's [zipstream](https://npmjs.org/package/zipstream) module, which is no longer being updated. \ No newline at end of file diff --git a/node_modules/zip-stream/index.js b/node_modules/zip-stream/index.js index 71f9fc4e7..0c3248bf8 100644 --- a/node_modules/zip-stream/index.js +++ b/node_modules/zip-stream/index.js @@ -38,7 +38,7 @@ var ZipStream = module.exports = function(options) { delete options.level; } - if (options.zlib.level && options.zlib.level === 0) { + if (typeof options.zlib.level === 'number' && options.zlib.level === 0) { options.store = true; } diff --git a/node_modules/zip-stream/package.json b/node_modules/zip-stream/package.json index 1fb2cf6fa..874dd0be5 100644 --- a/node_modules/zip-stream/package.json +++ b/node_modules/zip-stream/package.json @@ -1,6 +1,6 @@ { "name": "zip-stream", - "version": "1.1.0", + "version": "1.1.1", "description": "a streaming zip archive generator.", "homepage": "https://github.com/archiverjs/node-zip-stream", "author": { @@ -24,7 +24,7 @@ }, "scripts": { "test": "mocha --reporter dot", - "gendocs": "jsdoc -c jsdoc.json readme.md" + "jsdoc": "jsdoc -c jsdoc.json README.md" }, "dependencies": { "archiver-utils": "^1.3.0", @@ -33,10 +33,11 @@ "readable-stream": "^2.0.0" }, "devDependencies": { + "archiver-jsdoc-theme": "^1.0.0", + "jsdoc": "~3.4.0", "chai": "^3.4.0", - "jsdoc": "^3.4.0", "minami": "^1.1.0", - "mocha": "^2.3.3", + "mocha": "^3.2.0", "rimraf": "^2.4.3", "mkdirp": "^0.5.0" }, diff --git a/package.json b/package.json index 9c8dbc4eb..d750c3519 100644 --- a/package.json +++ b/package.json @@ -38,13 +38,24 @@ "selenium-webdriver": "^3.0.1", "serve-static": "^1.11.1", "systemjs": "^0.19.14", + "talertest": "file:tooling/talertest/", "through2": "^2.0.1", + "ts-loader": "^2.0.3", "typescript": "next", "typhonjs-istanbul-instrument-jspm": "^0.1.0", + "uglify-js": "git://github.com/mishoo/UglifyJS2#harmony", "vinyl": "^2.0.0", "vinyl-fs": "^2.4.3" }, "dependencies": { - "async": "^2.1.2" + "@types/react": "^15.0.22", + "@types/react-dom": "^15.5.0", + "async": "^2.1.2", + "html-webpack-plugin": "^2.28.0", + "jed": "^1.1.1", + "react": "^15.5.4", + "react-dom": "^15.5.4", + "urijs": "^1.18.10", + "webpack": "^2.4.1" } } diff --git a/src/background/background.html b/src/background/background.html index 621e0fbb9..962542f9a 100644 --- a/src/background/background.html +++ b/src/background/background.html @@ -1,9 +1,7 @@ - - - + (wallet bg page) diff --git a/src/background/background.ts b/src/background/background.ts index fe2359812..9b50caf9c 100644 --- a/src/background/background.ts +++ b/src/background/background.ts @@ -20,22 +20,9 @@ * @author Florian Dold */ -"use strict"; + +import {wxMain} from "./../wxBackend"; window.addEventListener("load", () => { - - // TypeScript does not allow ".js" extensions in the - // module name, so SystemJS must add it. - System.config({ - defaultJSExtensions: true, - }); - - System.import("../wxBackend") - .then((wxMessaging: any) => { - // Export as global for debugger - (window as any).wx = wxMessaging; - wxMessaging.wxMain(); - }).catch((e: Error) => { - console.error("Loading Taler wallet background page failed.", e); - }); + wxMain(); }); diff --git a/src/components.ts b/src/components.ts index 066e6d07f..4ed746f67 100644 --- a/src/components.ts +++ b/src/components.ts @@ -21,6 +21,8 @@ * @author Florian Dold */ +import * as React from "react"; + export interface StateHolder { (): T; (newState: T): void; diff --git a/src/content_scripts/notify.ts b/src/content_scripts/notify.ts index bf91b79c9..8a25dd500 100644 --- a/src/content_scripts/notify.ts +++ b/src/content_scripts/notify.ts @@ -25,6 +25,8 @@ "use strict"; +import URI = require("urijs"); + declare var cloneInto: any; // Make sure we don't pollute the namespace too much. @@ -65,7 +67,7 @@ namespace TalerNotify { type: "hash-contract", detail: {contract} }; - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { chrome.runtime.sendMessage(walletHashContractMsg, (resp: any) => { if (!resp.hash) { console.log("error", resp); @@ -95,7 +97,7 @@ namespace TalerNotify { historyEntry, }, }; - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { chrome.runtime.sendMessage(walletMsg, (resp: any) => { resolve(); }); @@ -114,7 +116,7 @@ namespace TalerNotify { }, }, }; - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { chrome.runtime.sendMessage(walletMsg, (resp: any) => { if (resp && resp.error) { reject(resp); @@ -162,7 +164,7 @@ namespace TalerNotify { const walletMsg = { type: "generate-nonce", }; - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { chrome.runtime.sendMessage(walletMsg, (resp: any) => { resolve(resp); }); @@ -170,7 +172,7 @@ namespace TalerNotify { } function downloadContract(url: string, nonce: string): Promise { - let parsed_url = URI(url); + let parsed_url = new URI(url); url = parsed_url.setQuery({nonce}).href(); // FIXME: include and check nonce! return new Promise((resolve, reject) => { @@ -243,7 +245,7 @@ namespace TalerNotify { await putHistory(historyEntry); let offerId = await saveOffer(proposal); - const uri = URI(chrome.extension.getURL( + const uri = new URI(chrome.extension.getURL( "/src/pages/confirm-contract.html")); const params = { offerId: offerId.toString(), @@ -294,13 +296,13 @@ namespace TalerNotify { addHandler("taler-create-reserve", (msg: any) => { let params = { amount: JSON.stringify(msg.amount), - callback_url: URI(msg.callback_url) + callback_url: new URI(msg.callback_url) .absoluteTo(document.location.href), bank_url: document.location.href, wt_types: JSON.stringify(msg.wt_types), suggested_exchange_url: msg.suggested_exchange_url, }; - let uri = URI(chrome.extension.getURL("/src/pages/confirm-create-reserve.html")); + let uri = new URI(chrome.extension.getURL("/src/pages/confirm-create-reserve.html")); let redirectUrl = uri.query(params).href(); window.location.href = redirectUrl; }); @@ -309,7 +311,7 @@ namespace TalerNotify { let params = { req: JSON.stringify(msg), }; - let uri = URI(chrome.extension.getURL("/src/pages/add-auditor.html")); + let uri = new URI(chrome.extension.getURL("/src/pages/add-auditor.html")); let redirectUrl = uri.query(params).href(); window.location.href = redirectUrl; }); @@ -340,7 +342,7 @@ namespace TalerNotify { addHandler("taler-pay", async(msg: any, sendResponse: any) => { // current URL without fragment - let url = URI(document.location.href).fragment("").href(); + let url = new URI(document.location.href).fragment("").href(); let res = await queryPayment(url); logVerbose && console.log("taler-pay: got response", res); if (res && res.payReq) { diff --git a/src/cryptoApi-test.ts b/src/cryptoApi-test.ts index 8024b2c75..dde3ea899 100644 --- a/src/cryptoApi-test.ts +++ b/src/cryptoApi-test.ts @@ -1,6 +1,6 @@ import {CryptoApi} from "./cryptoApi"; -import {ReserveRecord, DenominationRecord, denominationRecordFromKeys} from "src/types"; -import {test, TestLib} from "testlib/talertest"; +import {ReserveRecord, DenominationRecord, denominationRecordFromKeys} from "./types"; +import {test, TestLib} from "talertest"; let masterPub1: string = "CQQZ9DY3MZ1ARMN5K1VKDETS04Y2QCKMMCFHZSWJWWVN82BTTH00"; diff --git a/src/cryptoApi.ts b/src/cryptoApi.ts index dbadb45e4..672b90d74 100644 --- a/src/cryptoApi.ts +++ b/src/cryptoApi.ts @@ -86,7 +86,7 @@ export class CryptoApi { ws.currentWorkItem = work; this.numBusy++; if (!ws.w) { - let w = new Worker("/src/cryptoWorker.js"); + let w = new Worker("/dist/cryptoWorker-bundle.js"); w.onmessage = (m: MessageEvent) => this.handleWorkerMessage(ws, m); w.onerror = (e: ErrorEvent) => this.handleWorkerError(ws, e); ws.w = w; @@ -215,7 +215,7 @@ export class CryptoApi { throw Error("assertion failed"); }); - return p.then((r) => { + return p.then((r: T) => { console.log(`rpc ${operation} took ${performance.now() - start}ms`); return r; }); @@ -223,29 +223,29 @@ export class CryptoApi { createPreCoin(denom: DenominationRecord, reserve: ReserveRecord): Promise { - return this.doRpc("createPreCoin", 1, denom, reserve); + return this.doRpc("createPreCoin", 1, denom, reserve); } hashString(str: string): Promise { - return this.doRpc("hashString", 1, str); + return this.doRpc("hashString", 1, str); } isValidDenom(denom: DenominationRecord, masterPub: string): Promise { - return this.doRpc("isValidDenom", 2, denom, masterPub); + return this.doRpc("isValidDenom", 2, denom, masterPub); } signDeposit(offer: OfferRecord, cds: CoinWithDenom[]): Promise { - return this.doRpc("signDeposit", 3, offer, cds); + return this.doRpc("signDeposit", 3, offer, cds); } createEddsaKeypair(): Promise<{priv: string, pub: string}> { - return this.doRpc("createEddsaKeypair", 1); + return this.doRpc<{priv: string, pub: string}>("createEddsaKeypair", 1); } rsaUnblind(sig: string, bk: string, pk: string): Promise { - return this.doRpc("rsaUnblind", 4, sig, bk, pk); + return this.doRpc("rsaUnblind", 4, sig, bk, pk); } createRefreshSession(exchangeBaseUrl: string, @@ -253,7 +253,7 @@ export class CryptoApi { meltCoin: CoinRecord, newCoinDenoms: DenominationRecord[], meltFee: AmountJson): Promise { - return this.doRpc("createRefreshSession", + return this.doRpc("createRefreshSession", 4, exchangeBaseUrl, kappa, diff --git a/src/cryptoLib.ts b/src/cryptoLib.ts deleted file mode 100644 index 717a681f4..000000000 --- a/src/cryptoLib.ts +++ /dev/null @@ -1,359 +0,0 @@ -/* - This file is part of TALER - (C) 2016 GNUnet e.V. - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see - */ - -/** - * Web worker for crypto operations. - * @author Florian Dold - */ - -"use strict"; - -import * as native from "./emscriptif"; -import { - PreCoinRecord, PayCoinInfo, AmountJson, - RefreshSessionRecord, RefreshPreCoinRecord, ReserveRecord, CoinStatus, -} from "./types"; -import create = chrome.alarms.create; -import {OfferRecord} from "./wallet"; -import {CoinWithDenom} from "./wallet"; -import {CoinPaySig, CoinRecord} from "./types"; -import {DenominationRecord, Amounts} from "./types"; -import {Amount} from "./emscriptif"; -import {HashContext} from "./emscriptif"; -import {RefreshMeltCoinAffirmationPS} from "./emscriptif"; -import {EddsaPublicKey} from "./emscriptif"; -import {HashCode} from "./emscriptif"; - - -export function main(worker: Worker) { - worker.onmessage = (msg: MessageEvent) => { - if (!Array.isArray(msg.data.args)) { - console.error("args must be array"); - return; - } - if (typeof msg.data.id != "number") { - console.error("RPC id must be number"); - } - if (typeof msg.data.operation != "string") { - console.error("RPC operation must be string"); - } - let f = (RpcFunctions as any)[msg.data.operation]; - if (!f) { - console.error(`unknown operation: '${msg.data.operation}'`); - return; - } - let res = f(...msg.data.args); - worker.postMessage({result: res, id: msg.data.id}); - } -} - - -namespace RpcFunctions { - - /** - * Create a pre-coin of the given denomination to be withdrawn from then given - * reserve. - */ - export function createPreCoin(denom: DenominationRecord, - reserve: ReserveRecord): PreCoinRecord { - let reservePriv = new native.EddsaPrivateKey(); - reservePriv.loadCrock(reserve.reserve_priv); - let reservePub = new native.EddsaPublicKey(); - reservePub.loadCrock(reserve.reserve_pub); - let denomPub = native.RsaPublicKey.fromCrock(denom.denomPub); - let coinPriv = native.EddsaPrivateKey.create(); - let coinPub = coinPriv.getPublicKey(); - let blindingFactor = native.RsaBlindingKeySecret.create(); - let pubHash: native.HashCode = coinPub.hash(); - let ev = native.rsaBlind(pubHash, - blindingFactor, - denomPub); - - if (!ev) { - throw Error("couldn't blind (malicious exchange key?)"); - } - - if (!denom.feeWithdraw) { - throw Error("Field fee_withdraw missing"); - } - - let amountWithFee = new native.Amount(denom.value); - amountWithFee.add(new native.Amount(denom.feeWithdraw)); - let withdrawFee = new native.Amount(denom.feeWithdraw); - - // Signature - let withdrawRequest = new native.WithdrawRequestPS({ - reserve_pub: reservePub, - amount_with_fee: amountWithFee.toNbo(), - withdraw_fee: withdrawFee.toNbo(), - h_denomination_pub: denomPub.encode().hash(), - h_coin_envelope: ev.hash() - }); - - var sig = native.eddsaSign(withdrawRequest.toPurpose(), reservePriv); - - let preCoin: PreCoinRecord = { - reservePub: reservePub.toCrock(), - blindingKey: blindingFactor.toCrock(), - coinPub: coinPub.toCrock(), - coinPriv: coinPriv.toCrock(), - denomPub: denomPub.encode().toCrock(), - exchangeBaseUrl: reserve.exchange_base_url, - withdrawSig: sig.toCrock(), - coinEv: ev.toCrock(), - coinValue: denom.value - }; - return preCoin; - } - - - export function isValidDenom(denom: DenominationRecord, - masterPub: string): boolean { - let p = new native.DenominationKeyValidityPS({ - master: native.EddsaPublicKey.fromCrock(masterPub), - denom_hash: native.RsaPublicKey.fromCrock(denom.denomPub) - .encode() - .hash(), - expire_legal: native.AbsoluteTimeNbo.fromTalerString(denom.stampExpireLegal), - expire_spend: native.AbsoluteTimeNbo.fromTalerString(denom.stampExpireDeposit), - expire_withdraw: native.AbsoluteTimeNbo.fromTalerString(denom.stampExpireWithdraw), - start: native.AbsoluteTimeNbo.fromTalerString(denom.stampStart), - value: (new native.Amount(denom.value)).toNbo(), - fee_deposit: (new native.Amount(denom.feeDeposit)).toNbo(), - fee_refresh: (new native.Amount(denom.feeRefresh)).toNbo(), - fee_withdraw: (new native.Amount(denom.feeWithdraw)).toNbo(), - fee_refund: (new native.Amount(denom.feeRefund)).toNbo(), - }); - - let nativeSig = new native.EddsaSignature(); - nativeSig.loadCrock(denom.masterSig); - - let nativePub = native.EddsaPublicKey.fromCrock(masterPub); - - return native.eddsaVerify(native.SignaturePurpose.MASTER_DENOMINATION_KEY_VALIDITY, - p.toPurpose(), - nativeSig, - nativePub); - - } - - - export function createEddsaKeypair(): {priv: string, pub: string} { - const priv = native.EddsaPrivateKey.create(); - const pub = priv.getPublicKey(); - return {priv: priv.toCrock(), pub: pub.toCrock()}; - } - - - export function rsaUnblind(sig: string, bk: string, pk: string): string { - let denomSig = native.rsaUnblind(native.RsaSignature.fromCrock(sig), - native.RsaBlindingKeySecret.fromCrock(bk), - native.RsaPublicKey.fromCrock(pk)); - return denomSig.encode().toCrock() - } - - - /** - * Generate updated coins (to store in the database) - * and deposit permissions for each given coin. - */ - export function signDeposit(offer: OfferRecord, - cds: CoinWithDenom[]): PayCoinInfo { - let ret: PayCoinInfo = []; - - - let feeList: AmountJson[] = cds.map((x) => x.denom.feeDeposit); - let fees = Amounts.add(Amounts.getZero(feeList[0].currency), ...feeList).amount; - // okay if saturates - fees = Amounts.sub(fees, offer.contract.max_fee).amount; - let total = Amounts.add(fees, offer.contract.amount).amount; - - let amountSpent = native.Amount.getZero(cds[0].coin.currentAmount.currency); - let amountRemaining = new native.Amount(total); - for (let cd of cds) { - let coinSpend: Amount; - - if (amountRemaining.value == 0 && amountRemaining.fraction == 0) { - break; - } - - if (amountRemaining.cmp(new native.Amount(cd.coin.currentAmount)) < 0) { - coinSpend = new native.Amount(amountRemaining.toJson()); - } else { - coinSpend = new native.Amount(cd.coin.currentAmount); - } - - amountSpent.add(coinSpend); - amountRemaining.sub(coinSpend); - - let feeDeposit: Amount = new native.Amount(cd.denom.feeDeposit); - - // Give the merchant at least the deposit fee, otherwise it'll reject - // the coin. - if (coinSpend.cmp(feeDeposit) < 0) { - coinSpend = feeDeposit; - } - - let newAmount = new native.Amount(cd.coin.currentAmount); - newAmount.sub(coinSpend); - cd.coin.currentAmount = newAmount.toJson(); - cd.coin.status = CoinStatus.TransactionPending; - - let d = new native.DepositRequestPS({ - h_contract: native.HashCode.fromCrock(offer.H_contract), - h_wire: native.HashCode.fromCrock(offer.contract.H_wire), - amount_with_fee: coinSpend.toNbo(), - coin_pub: native.EddsaPublicKey.fromCrock(cd.coin.coinPub), - deposit_fee: new native.Amount(cd.denom.feeDeposit).toNbo(), - merchant: native.EddsaPublicKey.fromCrock(offer.contract.merchant_pub), - refund_deadline: native.AbsoluteTimeNbo.fromTalerString(offer.contract.refund_deadline), - timestamp: native.AbsoluteTimeNbo.fromTalerString(offer.contract.timestamp), - }); - - let coinSig = native.eddsaSign(d.toPurpose(), - native.EddsaPrivateKey.fromCrock(cd.coin.coinPriv)) - .toCrock(); - - let s: CoinPaySig = { - coin_sig: coinSig, - coin_pub: cd.coin.coinPub, - ub_sig: cd.coin.denomSig, - denom_pub: cd.coin.denomPub, - f: coinSpend.toJson(), - }; - ret.push({sig: s, updatedCoin: cd.coin}); - } - return ret; - } - - - export function createRefreshSession(exchangeBaseUrl: string, - kappa: number, - meltCoin: CoinRecord, - newCoinDenoms: DenominationRecord[], - meltFee: AmountJson): RefreshSessionRecord { - - let valueWithFee = Amounts.getZero(newCoinDenoms[0].value.currency); - - for (let ncd of newCoinDenoms) { - valueWithFee = Amounts.add(valueWithFee, - ncd.value, - ncd.feeWithdraw).amount; - } - - // melt fee - valueWithFee = Amounts.add(valueWithFee, meltFee).amount; - - let sessionHc = new HashContext(); - - let transferPubs: string[] = []; - let transferPrivs: string[] = []; - - let preCoinsForGammas: RefreshPreCoinRecord[][] = []; - - for (let i = 0; i < kappa; i++) { - let t = native.EcdhePrivateKey.create(); - let pub = t.getPublicKey(); - sessionHc.read(pub); - transferPrivs.push(t.toCrock()); - transferPubs.push(pub.toCrock()); - } - - for (let i = 0; i < newCoinDenoms.length; i++) { - let r = native.RsaPublicKey.fromCrock(newCoinDenoms[i].denomPub); - sessionHc.read(r.encode()); - } - - sessionHc.read(native.EddsaPublicKey.fromCrock(meltCoin.coinPub)); - sessionHc.read((new native.Amount(valueWithFee)).toNbo()); - - for (let i = 0; i < kappa; i++) { - let preCoins: RefreshPreCoinRecord[] = []; - for (let j = 0; j < newCoinDenoms.length; j++) { - - let transferPriv = native.EcdhePrivateKey.fromCrock(transferPrivs[i]); - let oldCoinPub = native.EddsaPublicKey.fromCrock(meltCoin.coinPub); - let transferSecret = native.ecdhEddsa(transferPriv, oldCoinPub); - - let fresh = native.setupFreshCoin(transferSecret, j); - - let coinPriv = fresh.priv; - let coinPub = coinPriv.getPublicKey(); - let blindingFactor = fresh.blindingKey; - let pubHash: native.HashCode = coinPub.hash(); - let denomPub = native.RsaPublicKey.fromCrock(newCoinDenoms[j].denomPub); - let ev = native.rsaBlind(pubHash, - blindingFactor, - denomPub); - if (!ev) { - throw Error("couldn't blind (malicious exchange key?)"); - } - let preCoin: RefreshPreCoinRecord = { - blindingKey: blindingFactor.toCrock(), - coinEv: ev.toCrock(), - publicKey: coinPub.toCrock(), - privateKey: coinPriv.toCrock(), - }; - preCoins.push(preCoin); - sessionHc.read(ev); - } - preCoinsForGammas.push(preCoins); - } - - let sessionHash = new HashCode(); - sessionHash.alloc(); - sessionHc.finish(sessionHash); - - let confirmData = new RefreshMeltCoinAffirmationPS({ - coin_pub: EddsaPublicKey.fromCrock(meltCoin.coinPub), - amount_with_fee: (new Amount(valueWithFee)).toNbo(), - session_hash: sessionHash, - melt_fee: (new Amount(meltFee)).toNbo() - }); - - - let confirmSig: string = native.eddsaSign(confirmData.toPurpose(), - native.EddsaPrivateKey.fromCrock( - meltCoin.coinPriv)).toCrock(); - - let valueOutput = Amounts.getZero(newCoinDenoms[0].value.currency); - for (let denom of newCoinDenoms) { - valueOutput = Amounts.add(valueOutput, denom.value).amount; - } - - let refreshSession: RefreshSessionRecord = { - meltCoinPub: meltCoin.coinPub, - newDenoms: newCoinDenoms.map((d) => d.denomPub), - confirmSig, - valueWithFee, - transferPubs, - preCoinsForGammas, - hash: sessionHash.toCrock(), - norevealIndex: undefined, - exchangeBaseUrl, - transferPrivs, - finished: false, - valueOutput, - }; - - return refreshSession; - } - - export function hashString(str: string): string { - const b = native.ByteArray.fromStringWithNull(str); - return b.hash().toCrock(); - } -} diff --git a/src/cryptoWorker.ts b/src/cryptoWorker.ts index 661b6e174..0abcb36ff 100644 --- a/src/cryptoWorker.ts +++ b/src/cryptoWorker.ts @@ -21,44 +21,339 @@ "use strict"; - -importScripts("/src/emscripten/taler-emscripten-lib.js", - "/src/vendor/system-csp-production.src.js"); +import * as native from "./emscriptif"; +import { + PreCoinRecord, PayCoinInfo, AmountJson, + RefreshSessionRecord, RefreshPreCoinRecord, ReserveRecord, CoinStatus, +} from "./types"; +import create = chrome.alarms.create; +import {OfferRecord} from "./wallet"; +import {CoinWithDenom} from "./wallet"; +import {CoinPaySig, CoinRecord} from "./types"; +import {DenominationRecord, Amounts} from "./types"; +import {Amount} from "./emscriptif"; +import {HashContext} from "./emscriptif"; +import {RefreshMeltCoinAffirmationPS} from "./emscriptif"; +import {EddsaPublicKey} from "./emscriptif"; +import {HashCode} from "./emscriptif"; -// TypeScript does not allow ".js" extensions in the -// module name, so SystemJS must add it. -System.config({ - defaultJSExtensions: true, - map: { - "src": "/src", - }, -}); +namespace RpcFunctions { -// We expect that in the manifest, the emscripten js is loaded -// becore the background page. -// Currently it is not possible to use SystemJS to load the emscripten js. -declare var Module: any; -if ("object" !== typeof Module) { - throw Error("emscripten not loaded, no 'Module' defined"); -} + /** + * Create a pre-coin of the given denomination to be withdrawn from then given + * reserve. + */ + export function createPreCoin(denom: DenominationRecord, + reserve: ReserveRecord): PreCoinRecord { + let reservePriv = new native.EddsaPrivateKey(); + reservePriv.loadCrock(reserve.reserve_priv); + let reservePub = new native.EddsaPublicKey(); + reservePub.loadCrock(reserve.reserve_pub); + let denomPub = native.RsaPublicKey.fromCrock(denom.denomPub); + let coinPriv = native.EddsaPrivateKey.create(); + let coinPub = coinPriv.getPublicKey(); + let blindingFactor = native.RsaBlindingKeySecret.create(); + let pubHash: native.HashCode = coinPub.hash(); + let ev = native.rsaBlind(pubHash, + blindingFactor, + denomPub); + + if (!ev) { + throw Error("couldn't blind (malicious exchange key?)"); + } + + if (!denom.feeWithdraw) { + throw Error("Field fee_withdraw missing"); + } + + let amountWithFee = new native.Amount(denom.value); + amountWithFee.add(new native.Amount(denom.feeWithdraw)); + let withdrawFee = new native.Amount(denom.feeWithdraw); + + // Signature + let withdrawRequest = new native.WithdrawRequestPS({ + reserve_pub: reservePub, + amount_with_fee: amountWithFee.toNbo(), + withdraw_fee: withdrawFee.toNbo(), + h_denomination_pub: denomPub.encode().hash(), + h_coin_envelope: ev.hash() + }); + + var sig = native.eddsaSign(withdrawRequest.toPurpose(), reservePriv); + + let preCoin: PreCoinRecord = { + reservePub: reservePub.toCrock(), + blindingKey: blindingFactor.toCrock(), + coinPub: coinPub.toCrock(), + coinPriv: coinPriv.toCrock(), + denomPub: denomPub.encode().toCrock(), + exchangeBaseUrl: reserve.exchange_base_url, + withdrawSig: sig.toCrock(), + coinEv: ev.toCrock(), + coinValue: denom.value + }; + return preCoin; + } -// Manually register the emscripten js as a SystemJS, so that -// we can use it from TypeScript by importing it. + export function isValidDenom(denom: DenominationRecord, + masterPub: string): boolean { + let p = new native.DenominationKeyValidityPS({ + master: native.EddsaPublicKey.fromCrock(masterPub), + denom_hash: native.RsaPublicKey.fromCrock(denom.denomPub) + .encode() + .hash(), + expire_legal: native.AbsoluteTimeNbo.fromTalerString(denom.stampExpireLegal), + expire_spend: native.AbsoluteTimeNbo.fromTalerString(denom.stampExpireDeposit), + expire_withdraw: native.AbsoluteTimeNbo.fromTalerString(denom.stampExpireWithdraw), + start: native.AbsoluteTimeNbo.fromTalerString(denom.stampStart), + value: (new native.Amount(denom.value)).toNbo(), + fee_deposit: (new native.Amount(denom.feeDeposit)).toNbo(), + fee_refresh: (new native.Amount(denom.feeRefresh)).toNbo(), + fee_withdraw: (new native.Amount(denom.feeWithdraw)).toNbo(), + fee_refund: (new native.Amount(denom.feeRefund)).toNbo(), + }); -{ - let mod = System.newModule({Module: Module, default: Module}); - let modName = System.normalizeSync("/src/emscripten/taler-emscripten-lib"); - console.log("registering", modName); - System.set(modName, mod); -} + let nativeSig = new native.EddsaSignature(); + nativeSig.loadCrock(denom.masterSig); -System.import("/src/cryptoLib") - .then((m: any) => { - m.main(self); - }) - .catch((e: Error) => { - console.log("crypto worker failed"); - console.error(e.stack); + let nativePub = native.EddsaPublicKey.fromCrock(masterPub); + + return native.eddsaVerify(native.SignaturePurpose.MASTER_DENOMINATION_KEY_VALIDITY, + p.toPurpose(), + nativeSig, + nativePub); + + } + + + export function createEddsaKeypair(): {priv: string, pub: string} { + const priv = native.EddsaPrivateKey.create(); + const pub = priv.getPublicKey(); + return {priv: priv.toCrock(), pub: pub.toCrock()}; + } + + + export function rsaUnblind(sig: string, bk: string, pk: string): string { + let denomSig = native.rsaUnblind(native.RsaSignature.fromCrock(sig), + native.RsaBlindingKeySecret.fromCrock(bk), + native.RsaPublicKey.fromCrock(pk)); + return denomSig.encode().toCrock() + } + + + /** + * Generate updated coins (to store in the database) + * and deposit permissions for each given coin. + */ + export function signDeposit(offer: OfferRecord, + cds: CoinWithDenom[]): PayCoinInfo { + let ret: PayCoinInfo = []; + + + let feeList: AmountJson[] = cds.map((x) => x.denom.feeDeposit); + let fees = Amounts.add(Amounts.getZero(feeList[0].currency), ...feeList).amount; + // okay if saturates + fees = Amounts.sub(fees, offer.contract.max_fee).amount; + let total = Amounts.add(fees, offer.contract.amount).amount; + + let amountSpent = native.Amount.getZero(cds[0].coin.currentAmount.currency); + let amountRemaining = new native.Amount(total); + for (let cd of cds) { + let coinSpend: Amount; + + if (amountRemaining.value == 0 && amountRemaining.fraction == 0) { + break; + } + + if (amountRemaining.cmp(new native.Amount(cd.coin.currentAmount)) < 0) { + coinSpend = new native.Amount(amountRemaining.toJson()); + } else { + coinSpend = new native.Amount(cd.coin.currentAmount); + } + + amountSpent.add(coinSpend); + amountRemaining.sub(coinSpend); + + let feeDeposit: Amount = new native.Amount(cd.denom.feeDeposit); + + // Give the merchant at least the deposit fee, otherwise it'll reject + // the coin. + if (coinSpend.cmp(feeDeposit) < 0) { + coinSpend = feeDeposit; + } + + let newAmount = new native.Amount(cd.coin.currentAmount); + newAmount.sub(coinSpend); + cd.coin.currentAmount = newAmount.toJson(); + cd.coin.status = CoinStatus.TransactionPending; + + let d = new native.DepositRequestPS({ + h_contract: native.HashCode.fromCrock(offer.H_contract), + h_wire: native.HashCode.fromCrock(offer.contract.H_wire), + amount_with_fee: coinSpend.toNbo(), + coin_pub: native.EddsaPublicKey.fromCrock(cd.coin.coinPub), + deposit_fee: new native.Amount(cd.denom.feeDeposit).toNbo(), + merchant: native.EddsaPublicKey.fromCrock(offer.contract.merchant_pub), + refund_deadline: native.AbsoluteTimeNbo.fromTalerString(offer.contract.refund_deadline), + timestamp: native.AbsoluteTimeNbo.fromTalerString(offer.contract.timestamp), }); + + let coinSig = native.eddsaSign(d.toPurpose(), + native.EddsaPrivateKey.fromCrock(cd.coin.coinPriv)) + .toCrock(); + + let s: CoinPaySig = { + coin_sig: coinSig, + coin_pub: cd.coin.coinPub, + ub_sig: cd.coin.denomSig, + denom_pub: cd.coin.denomPub, + f: coinSpend.toJson(), + }; + ret.push({sig: s, updatedCoin: cd.coin}); + } + return ret; + } + + + export function createRefreshSession(exchangeBaseUrl: string, + kappa: number, + meltCoin: CoinRecord, + newCoinDenoms: DenominationRecord[], + meltFee: AmountJson): RefreshSessionRecord { + + let valueWithFee = Amounts.getZero(newCoinDenoms[0].value.currency); + + for (let ncd of newCoinDenoms) { + valueWithFee = Amounts.add(valueWithFee, + ncd.value, + ncd.feeWithdraw).amount; + } + + // melt fee + valueWithFee = Amounts.add(valueWithFee, meltFee).amount; + + let sessionHc = new HashContext(); + + let transferPubs: string[] = []; + let transferPrivs: string[] = []; + + let preCoinsForGammas: RefreshPreCoinRecord[][] = []; + + for (let i = 0; i < kappa; i++) { + let t = native.EcdhePrivateKey.create(); + let pub = t.getPublicKey(); + sessionHc.read(pub); + transferPrivs.push(t.toCrock()); + transferPubs.push(pub.toCrock()); + } + + for (let i = 0; i < newCoinDenoms.length; i++) { + let r = native.RsaPublicKey.fromCrock(newCoinDenoms[i].denomPub); + sessionHc.read(r.encode()); + } + + sessionHc.read(native.EddsaPublicKey.fromCrock(meltCoin.coinPub)); + sessionHc.read((new native.Amount(valueWithFee)).toNbo()); + + for (let i = 0; i < kappa; i++) { + let preCoins: RefreshPreCoinRecord[] = []; + for (let j = 0; j < newCoinDenoms.length; j++) { + + let transferPriv = native.EcdhePrivateKey.fromCrock(transferPrivs[i]); + let oldCoinPub = native.EddsaPublicKey.fromCrock(meltCoin.coinPub); + let transferSecret = native.ecdhEddsa(transferPriv, oldCoinPub); + + let fresh = native.setupFreshCoin(transferSecret, j); + + let coinPriv = fresh.priv; + let coinPub = coinPriv.getPublicKey(); + let blindingFactor = fresh.blindingKey; + let pubHash: native.HashCode = coinPub.hash(); + let denomPub = native.RsaPublicKey.fromCrock(newCoinDenoms[j].denomPub); + let ev = native.rsaBlind(pubHash, + blindingFactor, + denomPub); + if (!ev) { + throw Error("couldn't blind (malicious exchange key?)"); + } + let preCoin: RefreshPreCoinRecord = { + blindingKey: blindingFactor.toCrock(), + coinEv: ev.toCrock(), + publicKey: coinPub.toCrock(), + privateKey: coinPriv.toCrock(), + }; + preCoins.push(preCoin); + sessionHc.read(ev); + } + preCoinsForGammas.push(preCoins); + } + + let sessionHash = new HashCode(); + sessionHash.alloc(); + sessionHc.finish(sessionHash); + + let confirmData = new RefreshMeltCoinAffirmationPS({ + coin_pub: EddsaPublicKey.fromCrock(meltCoin.coinPub), + amount_with_fee: (new Amount(valueWithFee)).toNbo(), + session_hash: sessionHash, + melt_fee: (new Amount(meltFee)).toNbo() + }); + + + let confirmSig: string = native.eddsaSign(confirmData.toPurpose(), + native.EddsaPrivateKey.fromCrock( + meltCoin.coinPriv)).toCrock(); + + let valueOutput = Amounts.getZero(newCoinDenoms[0].value.currency); + for (let denom of newCoinDenoms) { + valueOutput = Amounts.add(valueOutput, denom.value).amount; + } + + let refreshSession: RefreshSessionRecord = { + meltCoinPub: meltCoin.coinPub, + newDenoms: newCoinDenoms.map((d) => d.denomPub), + confirmSig, + valueWithFee, + transferPubs, + preCoinsForGammas, + hash: sessionHash.toCrock(), + norevealIndex: undefined, + exchangeBaseUrl, + transferPrivs, + finished: false, + valueOutput, + }; + + return refreshSession; + } + + export function hashString(str: string): string { + const b = native.ByteArray.fromStringWithNull(str); + return b.hash().toCrock(); + } +} + + +let worker: Worker = (self as any) as Worker; + +worker.onmessage = (msg: MessageEvent) => { + if (!Array.isArray(msg.data.args)) { + console.error("args must be array"); + return; + } + if (typeof msg.data.id != "number") { + console.error("RPC id must be number"); + } + if (typeof msg.data.operation != "string") { + console.error("RPC operation must be string"); + } + let f = (RpcFunctions as any)[msg.data.operation]; + if (!f) { + console.error(`unknown operation: '${msg.data.operation}'`); + return; + } + let res = f(...msg.data.args); + worker.postMessage({result: res, id: msg.data.id}); +} diff --git a/src/emscripten/taler-emscripten-lib.d.ts b/src/emscripten/taler-emscripten-lib.d.ts index 97821d9ef..25cfc623e 100644 --- a/src/emscripten/taler-emscripten-lib.d.ts +++ b/src/emscripten/taler-emscripten-lib.d.ts @@ -30,27 +30,23 @@ export interface EmscFunGen { } -export declare namespace Module { - var cwrap: EmscFunGen; +export var cwrap: EmscFunGen; - function ccall(name: string, ret:"number"|"string", argTypes: any[], args: any[]): any +export function ccall(name: string, ret:"number"|"string", argTypes: any[], args: any[]): any - function stringToUTF8(s: string, addr: number, maxLength: number): void +export function stringToUTF8(s: string, addr: number, maxLength: number): void - function _free(ptr: number): void; +export function _free(ptr: number): void; - function _malloc(n: number): number; +export function _malloc(n: number): number; - function Pointer_stringify(p: number, len?: number): string; +export function Pointer_stringify(p: number, len?: number): string; - function getValue(ptr: number, type: string, noSafe?: boolean): number; +export function getValue(ptr: number, type: string, noSafe?: boolean): number; - function setValue(ptr: number, value: number, type: string, - noSafe?: boolean): void; +export function setValue(ptr: number, value: number, type: string, + noSafe?: boolean): void; - function writeStringToMemory(s: string, - buffer: number, - dontAddNull?: boolean): void; -} - -export default Module; +export function writeStringToMemory(s: string, + buffer: number, + dontAddNull?: boolean): void; diff --git a/src/emscripten/taler-emscripten-lib.js b/src/emscripten/taler-emscripten-lib.js index 9fe21d686..dcbea842c 100644 --- a/src/emscripten/taler-emscripten-lib.js +++ b/src/emscripten/taler-emscripten-lib.js @@ -1,23 +1,21 @@ -var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;if(Module["ENVIRONMENT"]){if(Module["ENVIRONMENT"]==="WEB"){ENVIRONMENT_IS_WEB=true}else if(Module["ENVIRONMENT"]==="WORKER"){ENVIRONMENT_IS_WORKER=true}else if(Module["ENVIRONMENT"]==="NODE"){ENVIRONMENT_IS_NODE=true}else if(Module["ENVIRONMENT"]==="SHELL"){ENVIRONMENT_IS_SHELL=true}else{throw new Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.")}}else{ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER}if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=console.log;if(!Module["printErr"])Module["printErr"]=console.warn;var nodeFS;var nodePath;Module["read"]=function read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](filename);return binary?ret:ret.toString()};Module["readBinary"]=function readBinary(filename){var ret=Module["read"](filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};Module["load"]=function load(f){globalEval(read(f))};if(!Module["thisProgram"]){if(process["argv"].length>1){Module["thisProgram"]=process["argv"][1].replace(/\\/g,"/")}else{Module["thisProgram"]="unknown-program"}}Module["arguments"]=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",(function(ex){if(!(ex instanceof ExitStatus)){throw ex}}));Module["inspect"]=(function(){return"[Emscripten Module object]"})}else if(ENVIRONMENT_IS_SHELL){if(!Module["print"])Module["print"]=print;if(typeof printErr!="undefined")Module["printErr"]=printErr;if(typeof read!="undefined"){Module["read"]=read}else{Module["read"]=function read(){throw"no read() available"}}Module["readBinary"]=function readBinary(f){if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}var data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){Module["arguments"]=scriptArgs}else if(typeof arguments!="undefined"){Module["arguments"]=arguments}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){Module["read"]=function read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};Module["readAsync"]=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response)}else{onerror()}};xhr.onerror=onerror;xhr.send(null)};if(typeof arguments!="undefined"){Module["arguments"]=arguments}if(typeof console!=="undefined"){if(!Module["print"])Module["print"]=function print(x){console.log(x)};if(!Module["printErr"])Module["printErr"]=function printErr(x){console.warn(x)}}else{var TRY_USE_DUMP=false;if(!Module["print"])Module["print"]=TRY_USE_DUMP&&typeof dump!=="undefined"?(function(x){dump(x)}):(function(x){})}if(ENVIRONMENT_IS_WORKER){Module["load"]=importScripts}if(typeof Module["setWindowTitle"]==="undefined"){Module["setWindowTitle"]=(function(title){document.title=title})}}else{throw"Unknown runtime environment. Where are we?"}function globalEval(x){abort("NO_DYNAMIC_EXECUTION=1 was set, cannot eval")}if(!Module["load"]&&Module["read"]){Module["load"]=function load(f){globalEval(Module["read"](f))}}if(!Module["print"]){Module["print"]=(function(){})}if(!Module["printErr"]){Module["printErr"]=Module["print"]}if(!Module["arguments"]){Module["arguments"]=[]}if(!Module["thisProgram"]){Module["thisProgram"]="./this.program"}Module.print=Module["print"];Module.printErr=Module["printErr"];Module["preRun"]=[];Module["postRun"]=[];for(var key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=undefined;var Runtime={setTempRet0:(function(value){tempRet0=value}),getTempRet0:(function(){return tempRet0}),stackSave:(function(){return STACKTOP}),stackRestore:(function(stackTop){STACKTOP=stackTop}),getNativeTypeSize:(function(type){switch(type){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(type[type.length-1]==="*"){return Runtime.QUANTUM_SIZE}else if(type[0]==="i"){var bits=parseInt(type.substr(1));assert(bits%8===0);return bits/8}else{return 0}}}}),getNativeFieldSize:(function(type){return Math.max(Runtime.getNativeTypeSize(type),Runtime.QUANTUM_SIZE)}),STACK_ALIGN:16,prepVararg:(function(ptr,type){if(type==="double"||type==="i64"){if(ptr&7){assert((ptr&7)===4);ptr+=4}}else{assert((ptr&3)===0)}return ptr}),getAlignSize:(function(type,size,vararg){if(!vararg&&(type=="i64"||type=="double"))return 8;if(!type)return Math.min(size,8);return Math.min(size||(type?Runtime.getNativeFieldSize(type):0),Runtime.QUANTUM_SIZE)}),dynCall:(function(sig,ptr,args){if(args&&args.length){assert(args.length==sig.length-1);assert("dynCall_"+sig in Module,"bad function pointer type - no table for sig '"+sig+"'");return Module["dynCall_"+sig].apply(null,[ptr].concat(args))}else{assert(sig.length==1);assert("dynCall_"+sig in Module,"bad function pointer type - no table for sig '"+sig+"'");return Module["dynCall_"+sig].call(null,ptr)}}),functionPointers:[],addFunction:(function(func){for(var i=0;i>2];var end=(ret+size+15|0)&-16;HEAP32[DYNAMICTOP_PTR>>2]=end;if(end>=TOTAL_MEMORY){var success=enlargeMemory();if(!success){HEAP32[DYNAMICTOP_PTR>>2]=ret;return 0}}return ret}),alignMemory:(function(size,quantum){var ret=size=Math.ceil(size/(quantum?quantum:16))*(quantum?quantum:16);return ret}),makeBigInt:(function(low,high,unsigned){var ret=unsigned?+(low>>>0)+ +(high>>>0)*+4294967296:+(low>>>0)+ +(high|0)*+4294967296;return ret}),GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module["Runtime"]=Runtime;var ABORT=0;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];if(!func){abort("NO_DYNAMIC_EXECUTION=1 was set, cannot eval")}assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)");return func}var cwrap,ccall;((function(){var JSfuncs={"stackSave":(function(){Runtime.stackSave()}),"stackRestore":(function(){Runtime.stackRestore()}),"arrayToC":(function(arr){var ret=Runtime.stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}),"stringToC":(function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=Runtime.stackAlloc(len);stringToUTF8(str,ret,len)}return ret})};var toC={"string":JSfuncs["stringToC"],"array":JSfuncs["arrayToC"]};ccall=function ccallFunc(ident,returnType,argTypes,args,opts){var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":tempI64=[value>>>0,(tempDouble=value,+Math_abs(tempDouble)>=+1?tempDouble>+0?(Math_min(+Math_floor(tempDouble/+4294967296),+4294967295)|0)>>>0:~~+Math_ceil((tempDouble- +(~~tempDouble>>>0))/+4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;default:abort("invalid type for setValue: "+type)}}Module["setValue"]=setValue;function getValue(ptr,type,noSafe){type=type||"i8";if(type.charAt(type.length-1)==="*")type="i32";switch(type){case"i1":return HEAP8[ptr>>0];case"i8":return HEAP8[ptr>>0];case"i16":return HEAP16[ptr>>1];case"i32":return HEAP32[ptr>>2];case"i64":return HEAP32[ptr>>2];case"float":return HEAPF32[ptr>>2];case"double":return HEAPF64[ptr>>3];default:abort("invalid type for setValue: "+type)}return null}Module["getValue"]=getValue;var ALLOC_NORMAL=0;var ALLOC_STACK=1;var ALLOC_STATIC=2;var ALLOC_DYNAMIC=3;var ALLOC_NONE=4;Module["ALLOC_NORMAL"]=ALLOC_NORMAL;Module["ALLOC_STACK"]=ALLOC_STACK;Module["ALLOC_STATIC"]=ALLOC_STATIC;Module["ALLOC_DYNAMIC"]=ALLOC_DYNAMIC;Module["ALLOC_NONE"]=ALLOC_NONE;function allocate(slab,types,allocator,ptr){var zeroinit,size;if(typeof slab==="number"){zeroinit=true;size=slab}else{zeroinit=false;size=slab.length}var singleType=typeof types==="string"?types:null;var ret;if(allocator==ALLOC_NONE){ret=ptr}else{ret=[typeof _malloc==="function"?_malloc:Runtime.staticAlloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][allocator===undefined?ALLOC_STATIC:allocator](Math.max(size,singleType?1:types.length))}if(zeroinit){var ptr=ret,stop;assert((ret&3)==0);stop=ret+(size&~3);for(;ptr>2]=0}stop=ret+size;while(ptr>0]=0}return ret}if(singleType==="i8"){if(slab.subarray||slab.slice){HEAPU8.set(slab,ret)}else{HEAPU8.set(new Uint8Array(slab),ret)}return ret}var i=0,type,typeSize,previousType;while(i>0];hasUtf|=t;if(t==0&&!length)break;i++;if(length&&i==length)break}if(!length)length=i;var ret="";if(hasUtf<128){var MAX_CHUNK=1024;var curr;while(length>0){curr=String.fromCharCode.apply(String,HEAPU8.subarray(ptr,ptr+Math.min(length,MAX_CHUNK)));ret=ret?ret+curr:curr;ptr+=MAX_CHUNK;length-=MAX_CHUNK}return ret}return Module["UTF8ToString"](ptr)}Module["Pointer_stringify"]=Pointer_stringify;function AsciiToString(ptr){var str="";while(1){var ch=HEAP8[ptr++>>0];if(!ch)return str;str+=String.fromCharCode(ch)}}Module["AsciiToString"]=AsciiToString;function stringToAscii(str,outPtr){return writeAsciiToMemory(str,outPtr,false)}Module["stringToAscii"]=stringToAscii;var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(u8Array,idx){var endPtr=idx;while(u8Array[endPtr])++endPtr;if(endPtr-idx>16&&u8Array.subarray&&UTF8Decoder){return UTF8Decoder.decode(u8Array.subarray(idx,endPtr))}else{var u0,u1,u2,u3,u4,u5;var str="";while(1){u0=u8Array[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}u1=u8Array[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}u2=u8Array[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u3=u8Array[idx++]&63;if((u0&248)==240){u0=(u0&7)<<18|u1<<12|u2<<6|u3}else{u4=u8Array[idx++]&63;if((u0&252)==248){u0=(u0&3)<<24|u1<<18|u2<<12|u3<<6|u4}else{u5=u8Array[idx++]&63;u0=(u0&1)<<30|u1<<24|u2<<18|u3<<12|u4<<6|u5}}}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}}}Module["UTF8ArrayToString"]=UTF8ArrayToString;function UTF8ToString(ptr){return UTF8ArrayToString(HEAPU8,ptr)}Module["UTF8ToString"]=UTF8ToString;function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=2097151){if(outIdx+3>=endIdx)break;outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=67108863){if(outIdx+4>=endIdx)break;outU8Array[outIdx++]=248|u>>24;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+5>=endIdx)break;outU8Array[outIdx++]=252|u>>30;outU8Array[outIdx++]=128|u>>24&63;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}Module["stringToUTF8Array"]=stringToUTF8Array;function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}Module["stringToUTF8"]=stringToUTF8;function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){++len}else if(u<=2047){len+=2}else if(u<=65535){len+=3}else if(u<=2097151){len+=4}else if(u<=67108863){len+=5}else{len+=6}}return len}Module["lengthBytesUTF8"]=lengthBytesUTF8;var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function demangle(func){var __cxa_demangle_func=Module["___cxa_demangle"]||Module["__cxa_demangle"];if(__cxa_demangle_func){try{var s=func.substr(1);var len=lengthBytesUTF8(s)+1;var buf=_malloc(len);stringToUTF8(s,buf,len);var status=_malloc(4);var ret=__cxa_demangle_func(buf,0,0,status);if(getValue(status,"i32")===0&&ret){return Pointer_stringify(ret)}}catch(e){}finally{if(buf)_free(buf);if(status)_free(status);if(ret)_free(ret)}return func}Runtime.warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return func}function demangleAll(text){var regex=/__Z[\w\d_]+/g;return text.replace(regex,(function(x){var y=demangle(x);return x===y?x:x+" ["+y+"]"}))}function jsStackTrace(){var err=new Error;if(!err.stack){try{throw new Error(0)}catch(e){err=e}if(!err.stack){return"(no stack trace available)"}}return err.stack.toString()}function stackTrace(){var js=jsStackTrace();if(Module["extraStackTrace"])js+="\n"+Module["extraStackTrace"]();return demangleAll(js)}Module["stackTrace"]=stackTrace;var PAGE_SIZE=4096;var HEAP;var buffer;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferViews(){Module["HEAP8"]=HEAP8=new Int8Array(buffer);Module["HEAP16"]=HEAP16=new Int16Array(buffer);Module["HEAP32"]=HEAP32=new Int32Array(buffer);Module["HEAPU8"]=HEAPU8=new Uint8Array(buffer);Module["HEAPU16"]=HEAPU16=new Uint16Array(buffer);Module["HEAPU32"]=HEAPU32=new Uint32Array(buffer);Module["HEAPF32"]=HEAPF32=new Float32Array(buffer);Module["HEAPF64"]=HEAPF64=new Float64Array(buffer)}var STATIC_BASE,STATICTOP,staticSealed;var STACK_BASE,STACKTOP,STACK_MAX;var DYNAMIC_BASE,DYNAMICTOP_PTR;STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0;staticSealed=false;function writeStackCookie(){assert((STACK_MAX&3)==0);HEAPU32[(STACK_MAX>>2)-1]=34821223;HEAPU32[(STACK_MAX>>2)-2]=2310721022}function checkStackCookie(){if(HEAPU32[(STACK_MAX>>2)-1]!=34821223||HEAPU32[(STACK_MAX>>2)-2]!=2310721022){abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x02135467, but received 0x"+HEAPU32[(STACK_MAX>>2)-2].toString(16)+" "+HEAPU32[(STACK_MAX>>2)-1].toString(16))}if(HEAP32[0]!==1668509029)throw"Runtime error: The application has corrupted its heap memory area (address zero)!"}function abortStackOverflow(allocSize){abort("Stack overflow! Attempted to allocate "+allocSize+" bytes on the stack, but stack has only "+(STACK_MAX-asm.stackSave()+allocSize)+" bytes available!")}function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function enlargeMemory(){abortOnCannotGrowMemory()}var TOTAL_STACK=Module["TOTAL_STACK"]||5242880;var TOTAL_MEMORY=Module["TOTAL_MEMORY"]||16777216;var WASM_PAGE_SIZE=64*1024;var totalMemory=WASM_PAGE_SIZE;while(totalMemory0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){checkStackCookie();if(runtimeInitialized)return;runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){checkStackCookie();callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){checkStackCookie();callRuntimeCallbacks(__ATEXIT__);runtimeExited=true}function postRun(){checkStackCookie();if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}Module["addOnPreRun"]=addOnPreRun;function addOnInit(cb){__ATINIT__.unshift(cb)}Module["addOnInit"]=addOnInit;function addOnPreMain(cb){__ATMAIN__.unshift(cb)}Module["addOnPreMain"]=addOnPreMain;function addOnExit(cb){__ATEXIT__.unshift(cb)}Module["addOnExit"]=addOnExit;function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}Module["addOnPostRun"]=addOnPostRun;function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}Module["intArrayFromString"]=intArrayFromString;function intArrayToString(array){var ret=[];for(var i=0;i255){assert(false,"Character code "+chr+" ("+String.fromCharCode(chr)+") at offset "+i+" not in 0x00-0xFF.");chr&=255}ret.push(String.fromCharCode(chr))}return ret.join("")}Module["intArrayToString"]=intArrayToString;function writeStringToMemory(string,buffer,dontAddNull){Runtime.warnOnce("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!");var lastChar,end;if(dontAddNull){end=buffer+lengthBytesUTF8(string);lastChar=HEAP8[end]}stringToUTF8(string,buffer,Infinity);if(dontAddNull)HEAP8[end]=lastChar}Module["writeStringToMemory"]=writeStringToMemory;function writeArrayToMemory(array,buffer){assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");HEAP8.set(array,buffer)}Module["writeArrayToMemory"]=writeArrayToMemory;function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}Module["writeAsciiToMemory"]=writeAsciiToMemory;if(!Math["imul"]||Math["imul"](4294967295,5)!==-5)Math["imul"]=function imul(a,b){var ah=a>>>16;var al=a&65535;var bh=b>>>16;var bl=b&65535;return al*bl+(ah*bl+al*bh<<16)|0};Math.imul=Math["imul"];if(!Math["clz32"])Math["clz32"]=(function(x){x=x>>>0;for(var i=0;i<32;i++){if(x&1<<31-i)return i}return 32});Math.clz32=Math["clz32"];if(!Math["trunc"])Math["trunc"]=(function(x){return x<0?Math.ceil(x):Math.floor(x)});Math.trunc=Math["trunc"];var Math_abs=Math.abs;var Math_cos=Math.cos;var Math_sin=Math.sin;var Math_tan=Math.tan;var Math_acos=Math.acos;var Math_asin=Math.asin;var Math_atan=Math.atan;var Math_atan2=Math.atan2;var Math_exp=Math.exp;var Math_log=Math.log;var Math_sqrt=Math.sqrt;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_pow=Math.pow;var Math_imul=Math.imul;var Math_fround=Math.fround;var Math_round=Math.round;var Math_min=Math.min;var Math_clz32=Math.clz32;var Math_trunc=Math.trunc;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function getUniqueRunDependency(id){var orig=id;while(1){if(!runDependencyTracking[id])return id;id=orig+Math.random()}return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!=="undefined"){runDependencyWatcher=setInterval((function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;Module.printErr("still waiting on run dependencies:")}Module.printErr("dependency: "+dep)}if(shown){Module.printErr("(end of list)")}}),1e4)}}else{Module.printErr("warning: run dependency added without ID")}}Module["addRunDependency"]=addRunDependency;function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id]}else{Module.printErr("warning: run dependency removed without ID")}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["removeRunDependency"]=removeRunDependency;Module["preloadedImages"]={};Module["preloadedAudios"]={};var ASM_CONSTS=[];STATIC_BASE=8;STATICTOP=STATIC_BASE+73360;__ATINIT__.push({func:(function(){_GNUNET_util_cl_init()})},{func:(function(){_GNUNET_CRYPTO_random_init()})},{func:(function(){_gpg_err_init()})},{func:(function(){_TALER_gcrypt_init()})});allocate([0,0,0,0,0,0,0,0,102,154,0,127,199,106,69,159,152,186,249,23,254,223,149,34,17,154,0,127,199,106,69,159,152,186,249,23,254,223,149,51,6,154,0,127,199,106,69,159,152,186,249,23,254,223,149,33,255,255,255,255,255,255,255,255,34,174,40,215,152,47,138,66,205,101,239,35,145,68,55,113,47,59,77,236,207,251,192,181,188,219,137,129,165,219,181,233,56,181,72,243,91,194,86,57,25,208,5,182,241,17,241,89,155,79,25,175,164,130,63,146,24,129,109,218,213,94,28,171,66,2,3,163,152,170,7,216,190,111,112,69,1,91,131,18,140,178,228,78,190,133,49,36,226,180,255,213,195,125,12,85,111,137,123,242,116,93,190,114,177,150,22,59,254,177,222,128,53,18,199,37,167,6,220,155,148,38,105,207,116,241,155,193,210,74,241,158,193,105,155,228,227,37,79,56,134,71,190,239,181,213,140,139,198,157,193,15,101,156,172,119,204,161,12,36,117,2,43,89,111,44,233,45,131,228,166,110,170,132,116,74,212,251,65,189,220,169,176,92,181,83,17,131,218,136,249,118,171,223,102,238,82,81,62,152,16,50,180,45,109,198,49,168,63,33,251,152,200,39,3,176,228,14,239,190,199,127,89,191,194,143,168,61,243,11,224,198,37,167,10,147,71,145,167,213,111,130,3,224,81,99,202,6,112,110,14,10,103,41,41,20,252,47,210,70,133,10,183,39,38,201,38,92,56,33,27,46,237,42,196,90,252,109,44,77,223,179,149,157,19,13,56,83,222,99,175,139,84,115,10,101,168,178,119,60,187,10,106,118,230,174,237,71,46,201,194,129,59,53,130,20,133,44,114,146,100,3,241,76,161,232,191,162,1,48,66,188,75,102,26,168,145,151,248,208,112,139,75,194,48,190,84,6,163,81,108,199,24,82,239,214,25,232,146,209,16,169,101,85,36,6,153,214,42,32,113,87,133,53,14,244,184,209,187,50,112,160,106,16,200,208,210,184,22,193,164,25,83,171,65,81,8,108,55,30,153,235,142,223,76,119,72,39,168,72,155,225,181,188,176,52,99,90,201,197,179,12,28,57,203,138,65,227,74,170,216,78,115,227,99,119,79,202,156,91,163,184,178,214,243,111,46,104,252,178,239,93,238,130,143,116,96,47,23,67,111,99,165,120,114,171,240,161,20,120,200,132,236,57,100,26,8,2,199,140,40,30,99,35,250,255,190,144,233,189,130,222,235,108,80,164,21,121,198,178,247,163,249,190,43,83,114,227,242,120,113,198,156,97,38,234,206,62,39,202,7,194,192,33,199,184,134,209,30,235,224,205,214,125,218,234,120,209,110,238,127,79,125,245,186,111,23,114,170,103,240,6,166,152,200,162,197,125,99,10,174,13,249,190,4,152,63,17,27,71,28,19,53,11,113,27,132,125,4,35,245,119,219,40,147,36,199,64,123,171,202,50,188,190,201,21,10,190,158,60,76,13,16,156,196,103,29,67,182,66,62,203,190,212,197,76,42,126,101,252,156,41,127,89,236,250,214,58,171,111,203,95,23,88,71,74,140,25,68,108,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,102,85,0,0,255,255,255,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,37,89,0,0,2,0,0,0,49,89,0,0,4,0,0,0,61,89,0,0,8,0,0,0,73,89,0,0,16,0,0,0,86,89,0,0,32,0,0,0,96,89,0,0,64,0,0,0,107,89,0,0,128,0,0,0,119,89,0,0,0,1,0,0,132,89,0,0,0,2,0,0,144,89,0,0,0,4,0,0,157,89,0,0,0,8,0,0,167,89,0,0,0,16,0,0,178,89,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,17,0,0,0,0,0,0,0,2,0,0,0,11,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,0,0,0,0,2,0,0,0,11,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,0,0,0,0,2,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0,0,0,0,0,164,17,0,0,220,28,0,0,80,29,0,0,176,32,0,0,240,48,0,0,0,0,0,0,210,140,0,0,0,1,0,0,0,0,0,0,2,0,0,0,1,0,0,0,102,96,0,0,169,96,0,0,175,96,0,0,243,96,0,0,54,97,0,0,121,97,0,0,188,97,0,0,193,97,0,0,192,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,204,97,0,0,255,97,0,0,50,98,0,0,101,98,0,0,152,98,0,0,203,98,0,0,254,98,0,0,3,99,0,0,224,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,14,99,0,0,73,99,0,0,132,99,0,0,191,99,0,0,250,99,0,0,53,100,0,0,254,98,0,0,112,100,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,123,100,0,0,190,100,0,0,1,101,0,0,68,101,0,0,135,101,0,0,202,101,0,0,254,98,0,0,13,102,0,0,128,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,24,102,0,0,123,102,0,0,222,102,0,0,65,103,0,0,164,103,0,0,7,104,0,0,254,98,0,0,106,104,0,0,9,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,117,104,0,0,252,104,0,0,131,105,0,0,9,106,0,0,143,106,0,0,22,107,0,0,254,98,0,0,157,107,0,0,160,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,107,0,0,216,107,0,0,3,108,0,0,46,108,0,0,89,108,0,0,132,108,0,0,254,98,0,0,175,108,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,191,108,0,0,242,108,0,0,37,109,0,0,88,109,0,0,139,109,0,0,190,109,0,0,254,98,0,0,241,109,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,110,0,0,60,110,0,0,119,110,0,0,178,110,0,0,237,110,0,0,40,111,0,0,254,98,0,0,99,111,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,115,111,0,0,182,111,0,0,249,111,0,0,60,112,0,0,127,112,0,0,194,112,0,0,254,98,0,0,5,113,0,0,64,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,113,0,0,104,113,0,0,187,113,0,0,14,114,0,0,97,114,0,0,180,114,0,0,254,98,0,0,7,115,0,0,128,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,115,0,0,122,115,0,0,221,115,0,0,64,116,0,0,163,116,0,0,6,117,0,0,254,98,0,0,105,117,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,121,117,0,0,252,117,0,0,127,118,0,0,2,119,0,0,133,119,0,0,8,120,0,0,254,98,0,0,139,120,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,153,120,0,0,220,120,0,0,31,121,0,0,98,121,0,0,165,121,0,0,232,121,0,0,254,98,0,0,43,122,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,122,0,0,131,122,0,0,198,122,0,0,9,123,0,0,76,123,0,0,143,123,0,0,254,98,0,0,210,123,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,231,123,0,0,42,124,0,0,109,124,0,0,176,124,0,0,76,123,0,0,243,124,0,0,254,98,0,0,54,125,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,75,125,0,0,142,125,0,0,209,125,0,0,20,126,0,0,87,126,0,0,154,126,0,0,254,98,0,0,221,126,0,0,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,235,126,0,0,220,120,0,0,110,127,0,0,241,127,0,0,116,128,0,0,247,128,0,0,254,98,0,0,122,129,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,129,0,0,13,130,0,0,144,130,0,0,19,131,0,0,150,131,0,0,25,132,0,0,254,98,0,0,156,132,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,132,0,0,47,133,0,0,178,133,0,0,53,134,0,0,184,134,0,0,59,135,0,0,254,98,0,0,190,135,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,135,0,0,87,126,0,0,220,120,0,0,11,136,0,0,78,136,0,0,145,136,0,0,254,98,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,210,140,0,0,212,136,0,0,193,97,0,0,235,136,0,0,193,97,0,0,255,136,0,0,193,97,0,0,10,137,0,0,193,97,0,0,20,137,0,0,3,99,0,0,29,137,0,0,3,99,0,0,39,137,0,0,3,99,0,0,52,137,0,0,112,100,0,0,61,137,0,0,112,100,0,0,81,137,0,0,112,100,0,0,92,137,0,0,112,100,0,0,102,137,0,0,13,102,0,0,111,137,0,0,13,102,0,0,121,137,0,0,13,102,0,0,134,137,0,0,106,104,0,0,143,137,0,0,106,104,0,0,153,137,0,0,106,104,0,0,166,137,0,0,157,107,0,0,175,137,0,0,175,108,0,0,196,137,0,0,241,109,0,0,217,137,0,0,99,111,0,0,238,137,0,0,5,113,0,0,3,138,0,0,7,115,0,0,24,138,0,0,105,117,0,0,46,138,0,0,139,120,0,0,68,138,0,0,43,122,0,0,85,138,0,0,210,123,0,0,102,138,0,0,54,125,0,0,119,138,0,0,43,122,0,0,136,138,0,0,54,125,0,0,160,138,0,0,43,122,0,0,184,138,0,0,54,125,0,0,201,138,0,0,122,129,0,0,218,138,0,0,156,132,0,0,238,138,0,0,190,135,0,0,2,139,0,0,0,0,0,0,0,0,0,0,110,141,0,0,124,141,0,0,153,141,0,0,22,75,122,123,252,248,25,226,227,149,251,231,59,86,224,163,135,189,100,34,46,131,31,214,16,39,12,215,234,37,5,84,151,88,191,117,192,90,153,74,109,3,79,101,248,240,230,253,202,234,177,163,77,74,107,75,99,110,7,10,56,188,231,55,158,141,0,0,172,141,0,0,181,141,0,0,135,170,124,222,165,239,97,157,79,240,180,36,26,29,108,176,35,121,244,226,206,78,194,120,122,208,179,5,69,225,124,222,218,168,51,183,214,184,167,2,3,139,39,78,174,163,244,228,190,157,145,78,235,97,241,112,46,105,108,32,58,18,104,84,202,141,0,0,217,141,0,0,12,142,0,0,250,115,176,8,157,86,162,132,239,176,240,117,108,137,11,233,177,181,219,221,142,232,26,54,85,248,62,51,178,39,157,57,191,62,132,130,121,167,34,200,6,180,133,164,126,103,200,7,185,70,163,55,190,232,148,38,116,39,136,89,225,50,146,251,33,142,0,0,48,142,0,0,99,142,0,0,176,186,70,86,55,69,140,105,144,229,168,197,246,29,74,247,229,118,217,127,249,75,135,45,231,111,128,80,54,30,227,219,169,28,165,193,26,162,94,180,214,121,39,92,197,120,128,99,165,241,151,65,18,12,79,45,226,173,235,235,16,162,152,221,125,142,0,0,141,142,0,0,196,142,0,0,128,178,66,99,199,193,163,235,183,20,147,193,221,123,232,180,155,70,209,244,27,74,238,193,18,27,1,55,131,248,243,82,107,86,208,55,224,95,37,152,189,15,210,33,93,106,30,82,149,230,79,115,246,63,10,236,139,145,90,152,93,120,101,152,72,143,0,0,89,143,0,0,196,142,0,0,227,123,106,119,93,200,125,186,164,223,169,249,110,94,63,253,222,189,113,248,134,114,137,134,93,245,163,45,32,205,201,68,182,2,44,172,60,73,130,177,13,94,235,85,195,228,222,21,19,70,118,251,109,224,68,96,101,201,116,64,250,140,106,88,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,110,141,0,0,124,141,0,0,153,141,0,0,175,69,210,227,118,72,64,49,97,127,120,210,181,138,107,27,156,126,244,100,245,160,27,71,228,46,195,115,99,34,68,94,142,34,64,202,94,105,226,199,139,50,57,236,250,178,22,73,158,141,0,0,172,141,0,0,181,141,0,0,175,208,57,68,216,72,149,98,107,8,37,244,171,70,144,127,21,249,218,219,228,16,30,198,130,170,3,76,124,235,197,156,250,234,158,169,7,110,222,127,74,241,82,232,178,250,156,182,202,141,0,0,217,141,0,0,12,142,0,0,136,6,38,8,211,230,173,138,10,162,172,224,20,200,168,111,10,166,53,217,71,172,159,235,232,62,244,229,89,102,20,75,42,90,179,157,193,56,20,185,78,58,182,225,1,163,79,39,33,142,0,0,48,142,0,0,99,142,0,0,62,138,105,183,120,60,37,133,25,51,171,98,144,175,108,167,122,153,129,72,8,80,0,156,197,87,124,110,31,87,59,78,104,1,221,35,196,167,214,121,204,248,163,134,198,116,207,251,125,142,0,0,141,142,0,0,196,142,0,0,78,206,8,68,133,129,62,144,136,210,198,58,4,27,197,180,79,158,241,1,42,43,88,143,60,209,31,5,3,58,196,198,12,46,246,171,64,48,254,130,150,36,141,241,99,244,73,82,72,143,0,0,89,143,0,0,196,142,0,0,102,23,23,142,148,31,2,13,53,30,47,37,78,143,211,44,96,36,32,254,176,184,251,154,220,206,187,130,70,30,153,197,166,120,204,49,231,153,23,109,56,96,230,17,12,70,82,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,110,141,0,0,124,141,0,0,153,141,0,0,91,220,193,70,191,96,117,78,106,4,36,38,8,149,117,199,90,0,63,8,157,39,57,131,157,236,88,185,100,236,56,67,158,141,0,0,172,141,0,0,181,141,0,0,176,52,76,97,216,219,56,83,92,168,175,206,175,11,241,43,136,29,194,0,201,131,61,167,38,233,55,108,46,50,207,247,202,141,0,0,217,141,0,0,12,142,0,0,119,62,169,30,54,128,14,70,133,77,184,235,208,145,129,167,41,89,9,139,62,248,193,34,217,99,85,20,206,213,101,254,33,142,0,0,48,142,0,0,99,142,0,0,130,85,138,56,154,68,60,14,164,204,129,152,153,242,8,58,133,240,250,163,229,120,248,7,122,46,63,244,103,41,102,91,125,142,0,0,141,142,0,0,196,142,0,0,96,228,49,89,30,224,182,127,13,138,38,170,203,245,183,127,142,11,198,33,55,40,197,20,5,70,4,15,14,227,127,84,72,143,0,0,89,143,0,0,196,142,0,0,155,9,255,167,27,148,47,203,39,99,95,188,213,176,233,68,191,220,99,100,79,7,19,147,138,127,81,83,92,58,53,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,110,141,0,0,124,141,0,0,153,141,0,0,163,14,1,9,139,198,219,191,69,105,15,58,126,158,109,15,139,190,162,163,158,97,72,0,143,208,94,68,158,141,0,0,172,141,0,0,181,141,0,0,137,111,177,18,138,187,223,25,104,50,16,124,212,157,243,63,71,180,177,22,153,18,186,79,83,104,75,34,202,141,0,0,217,141,0,0,12,142,0,0,127,179,203,53,136,198,193,246,255,169,105,77,125,106,210,100,147,101,176,193,246,93,105,209,236,131,51,234,33,142,0,0,48,142,0,0,99,142,0,0,108,17,80,104,116,1,60,172,106,42,188,27,179,130,98,124,236,106,144,216,110,252,1,45,231,175,236,90,125,142,0,0,141,142,0,0,196,142,0,0,149,233,160,219,150,32,149,173,174,190,155,45,111,13,188,226,212,153,241,18,242,210,183,39,63,166,135,14,72,143,0,0,89,143,0,0,196,142,0,0,58,133,65,102,172,93,159,2,63,84,213,23,208,179,157,189,148,103,112,219,156,43,149,201,246,245,101,209,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,104,30,0,0,240,31,0,0,180,30,0,0,48,32,0,0,112,32,0,0,196,29,0,0,0,0,0,0,156,2,0,0,247,147,0,0,2,0,0,0,252,147,0,0,1,0,0,0,0,148,0,0,8,0,0,0,7,148,0,0,3,0,0,0,17,148,0,0,3,0,0,0,24,148,0,0,9,0,0,0,31,148,0,0,10,0,0,0,38,148,0,0,11,0,0,0,45,148,0,0,5,0,0,0,49,148,0,0,45,1,0,0,53,148,0,0,6,0,0,0,59,148,0,0,7,0,0,0,0,0,0,0,0,0,0,0,92,50,0,0,4,30,0,0,0,0,0,0,7,0,0,0,2,0,0,0,187,148,0,0,228,17,0,0,244,17,0,0,16,0,0,0,128,0,0,0,248,1,0,0,1,0,0,0,2,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,3,151,0,0,12,151,0,0,19,151,0,0,0,0,0,0,167,150,0,0,1,0,0,0,190,150,0,0,3,0,0,0,213,150,0,0,5,0,0,0,236,150,0,0,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,43,126,21,22,40,174,210,166,171,247,21,136,9,207,79,60,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,107,193,190,226,46,64,159,150,233,61,126,17,115,147,23,42,59,63,217,46,183,45,173,32,51,52,73,248,232,60,251,74,174,45,138,87,30,3,172,156,158,183,111,172,69,175,142,81,200,166,69,55,160,179,169,63,205,227,205,173,159,28,229,139,48,200,28,70,163,92,228,17,229,251,193,25,26,10,82,239,38,117,31,103,163,203,177,64,177,128,140,241,135,164,244,223,246,159,36,69,223,79,155,23,173,43,65,123,230,108,55,16,192,75,5,53,124,93,28,14,234,196,198,111,159,247,242,230,5,0,0,0,43,126,21,22,40,174,210,166,171,247,21,136,9,207,79,60,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,107,193,190,226,46,64,159,150,233,61,126,17,115,147,23,42,59,63,217,46,183,45,173,32,51,52,73,248,232,60,251,74,174,45,138,87,30,3,172,156,158,183,111,172,69,175,142,81,119,137,80,141,22,145,143,3,245,60,82,218,197,78,216,37,48,200,28,70,163,92,228,17,229,251,193,25,26,10,82,239,151,64,5,30,156,95,236,246,67,68,247,168,34,96,237,204,246,159,36,69,223,79,155,23,173,43,65,123,230,108,55,16,48,76,101,40,246,89,199,120,102,165,16,217,193,214,174,94,198,99,99,165,248,124,124,132,238,119,119,153,246,123,123,141,255,242,242,13,214,107,107,189,222,111,111,177,145,197,197,84,96,48,48,80,2,1,1,3,206,103,103,169,86,43,43,125,231,254,254,25,181,215,215,98,77,171,171,230,236,118,118,154,143,202,202,69,31,130,130,157,137,201,201,64,250,125,125,135,239,250,250,21,178,89,89,235,142,71,71,201,251,240,240,11,65,173,173,236,179,212,212,103,95,162,162,253,69,175,175,234,35,156,156,191,83,164,164,247,228,114,114,150,155,192,192,91,117,183,183,194,225,253,253,28,61,147,147,174,76,38,38,106,108,54,54,90,126,63,63,65,245,247,247,2,131,204,204,79,104,52,52,92,81,165,165,244,209,229,229,52,249,241,241,8,226,113,113,147,171,216,216,115,98,49,49,83,42,21,21,63,8,4,4,12,149,199,199,82,70,35,35,101,157,195,195,94,48,24,24,40,55,150,150,161,10,5,5,15,47,154,154,181,14,7,7,9,36,18,18,54,27,128,128,155,223,226,226,61,205,235,235,38,78,39,39,105,127,178,178,205,234,117,117,159,18,9,9,27,29,131,131,158,88,44,44,116,52,26,26,46,54,27,27,45,220,110,110,178,180,90,90,238,91,160,160,251,164,82,82,246,118,59,59,77,183,214,214,97,125,179,179,206,82,41,41,123,221,227,227,62,94,47,47,113,19,132,132,151,166,83,83,245,185,209,209,104,0,0,0,0,193,237,237,44,64,32,32,96,227,252,252,31,121,177,177,200,182,91,91,237,212,106,106,190,141,203,203,70,103,190,190,217,114,57,57,75,148,74,74,222,152,76,76,212,176,88,88,232,133,207,207,74,187,208,208,107,197,239,239,42,79,170,170,229,237,251,251,22,134,67,67,197,154,77,77,215,102,51,51,85,17,133,133,148,138,69,69,207,233,249,249,16,4,2,2,6,254,127,127,129,160,80,80,240,120,60,60,68,37,159,159,186,75,168,168,227,162,81,81,243,93,163,163,254,128,64,64,192,5,143,143,138,63,146,146,173,33,157,157,188,112,56,56,72,241,245,245,4,99,188,188,223,119,182,182,193,175,218,218,117,66,33,33,99,32,16,16,48,229,255,255,26,253,243,243,14,191,210,210,109,129,205,205,76,24,12,12,20,38,19,19,53,195,236,236,47,190,95,95,225,53,151,151,162,136,68,68,204,46,23,23,57,147,196,196,87,85,167,167,242,252,126,126,130,122,61,61,71,200,100,100,172,186,93,93,231,50,25,25,43,230,115,115,149,192,96,96,160,25,129,129,152,158,79,79,209,163,220,220,127,68,34,34,102,84,42,42,126,59,144,144,171,11,136,136,131,140,70,70,202,199,238,238,41,107,184,184,211,40,20,20,60,167,222,222,121,188,94,94,226,22,11,11,29,173,219,219,118,219,224,224,59,100,50,50,86,116,58,58,78,20,10,10,30,146,73,73,219,12,6,6,10,72,36,36,108,184,92,92,228,159,194,194,93,189,211,211,110,67,172,172,239,196,98,98,166,57,145,145,168,49,149,149,164,211,228,228,55,242,121,121,139,213,231,231,50,139,200,200,67,110,55,55,89,218,109,109,183,1,141,141,140,177,213,213,100,156,78,78,210,73,169,169,224,216,108,108,180,172,86,86,250,243,244,244,7,207,234,234,37,202,101,101,175,244,122,122,142,71,174,174,233,16,8,8,24,111,186,186,213,240,120,120,136,74,37,37,111,92,46,46,114,56,28,28,36,87,166,166,241,115,180,180,199,151,198,198,81,203,232,232,35,161,221,221,124,232,116,116,156,62,31,31,33,150,75,75,221,97,189,189,220,13,139,139,134,15,138,138,133,224,112,112,144,124,62,62,66,113,181,181,196,204,102,102,170,144,72,72,216,6,3,3,5,247,246,246,1,28,14,14,18,194,97,97,163,106,53,53,95,174,87,87,249,105,185,185,208,23,134,134,145,153,193,193,88,58,29,29,39,39,158,158,185,217,225,225,56,235,248,248,19,43,152,152,179,34,17,17,51,210,105,105,187,169,217,217,112,7,142,142,137,51,148,148,167,45,155,155,182,60,30,30,34,21,135,135,146,201,233,233,32,135,206,206,73,170,85,85,255,80,40,40,120,165,223,223,122,3,140,140,143,89,161,161,248,9,137,137,128,26,13,13,23,101,191,191,218,215,230,230,49,132,66,66,198,208,104,104,184,130,65,65,195,41,153,153,176,90,45,45,119,30,15,15,17,123,176,176,203,168,84,84,252,109,187,187,214,44,22,22,58,81,244,167,80,126,65,101,83,26,23,164,195,58,39,94,150,59,171,107,203,31,157,69,241,172,250,88,171,75,227,3,147,32,48,250,85,173,118,109,246,136,204,118,145,245,2,76,37,79,229,215,252,197,42,203,215,38,53,68,128,181,98,163,143,222,177,90,73,37,186,27,103,69,234,14,152,93,254,192,225,195,47,117,2,129,76,240,18,141,70,151,163,107,211,249,198,3,143,95,231,21,146,156,149,191,109,122,235,149,82,89,218,212,190,131,45,88,116,33,211,73,224,105,41,142,201,200,68,117,194,137,106,244,142,121,120,153,88,62,107,39,185,113,221,190,225,79,182,240,136,173,23,201,32,172,102,125,206,58,180,99,223,74,24,229,26,49,130,151,81,51,96,98,83,127,69,177,100,119,224,187,107,174,132,254,129,160,28,249,8,43,148,112,72,104,88,143,69,253,25,148,222,108,135,82,123,248,183,171,115,211,35,114,75,2,226,227,31,143,87,102,85,171,42,178,235,40,7,47,181,194,3,134,197,123,154,211,55,8,165,48,40,135,242,35,191,165,178,2,3,106,186,237,22,130,92,138,207,28,43,167,121,180,146,243,7,242,240,78,105,226,161,101,218,244,205,6,5,190,213,209,52,98,31,196,166,254,138,52,46,83,157,162,243,85,160,5,138,225,50,164,246,235,117,11,131,236,57,64,96,239,170,94,113,159,6,189,110,16,81,62,33,138,249,150,221,6,61,221,62,5,174,77,230,189,70,145,84,141,181,113,196,93,5,4,6,212,111,96,80,21,255,25,152,251,36,214,189,233,151,137,64,67,204,103,217,158,119,176,232,66,189,7,137,139,136,231,25,91,56,121,200,238,219,161,124,10,71,124,66,15,233,248,132,30,201,0,0,0,0,9,128,134,131,50,43,237,72,30,17,112,172,108,90,114,78,253,14,255,251,15,133,56,86,61,174,213,30,54,45,57,39,10,15,217,100,104,92,166,33,155,91,84,209,36,54,46,58,12,10,103,177,147,87,231,15,180,238,150,210,27,155,145,158,128,192,197,79,97,220,32,162,90,119,75,105,28,18,26,22,226,147,186,10,192,160,42,229,60,34,224,67,18,27,23,29,14,9,13,11,242,139,199,173,45,182,168,185,20,30,169,200,87,241,25,133,175,117,7,76,238,153,221,187,163,127,96,253,247,1,38,159,92,114,245,188,68,102,59,197,91,251,126,52,139,67,41,118,203,35,198,220,182,237,252,104,184,228,241,99,215,49,220,202,66,99,133,16,19,151,34,64,132,198,17,32,133,74,36,125,210,187,61,248,174,249,50,17,199,41,161,109,29,158,47,75,220,178,48,243,13,134,82,236,119,193,227,208,43,179,22,108,169,112,185,153,17,148,72,250,71,233,100,34,168,252,140,196,160,240,63,26,86,125,44,216,34,51,144,239,135,73,78,199,217,56,209,193,140,202,162,254,152,212,11,54,166,245,129,207,165,122,222,40,218,183,142,38,63,173,191,164,44,58,157,228,80,120,146,13,106,95,204,155,84,126,70,98,246,141,19,194,144,216,184,232,46,57,247,94,130,195,175,245,159,93,128,190,105,208,147,124,111,213,45,169,207,37,18,179,200,172,153,59,16,24,125,167,232,156,99,110,219,59,187,123,205,38,120,9,110,89,24,244,236,154,183,1,131,79,154,168,230,149,110,101,170,255,230,126,33,188,207,8,239,21,232,230,186,231,155,217,74,111,54,206,234,159,9,212,41,176,124,214,49,164,178,175,42,63,35,49,198,165,148,48,53,162,102,192,116,78,188,55,252,130,202,166,224,144,208,176,51,167,216,21,241,4,152,74,65,236,218,247,127,205,80,14,23,145,246,47,118,77,214,141,67,239,176,77,204,170,77,84,228,150,4,223,158,209,181,227,76,106,136,27,193,44,31,184,70,101,81,127,157,94,234,4,1,140,53,93,250,135,116,115,251,11,65,46,179,103,29,90,146,219,210,82,233,16,86,51,109,214,71,19,154,215,97,140,55,161,12,122,89,248,20,142,235,19,60,137,206,169,39,238,183,97,201,53,225,28,229,237,122,71,177,60,156,210,223,89,85,242,115,63,24,20,206,121,115,199,55,191,83,247,205,234,95,253,170,91,223,61,111,20,120,68,219,134,202,175,243,129,185,104,196,62,56,36,52,44,194,163,64,95,22,29,195,114,188,226,37,12,40,60,73,139,255,13,149,65,57,168,1,113,8,12,179,222,216,180,228,156,100,86,193,144,123,203,132,97,213,50,182,112,72,108,92,116,208,184,87,66,82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125,1,0,0,0,2,0,0,0,4,0,0,0,8,0,0,0,16,0,0,0,32,0,0,0,64,0,0,0,128,0,0,0,27,0,0,0,54,0,0,0,108,0,0,0,216,0,0,0,171,0,0,0,77,0,0,0,154,0,0,0,47,0,0,0,94,0,0,0,188,0,0,0,99,0,0,0,198,0,0,0,151,0,0,0,53,0,0,0,106,0,0,0,212,0,0,0,179,0,0,0,125,0,0,0,250,0,0,0,239,0,0,0,197,0,0,0,145,0,0,0,8,0,0,0,2,0,0,0,27,151,0,0,28,29,0,0,40,29,0,0,16,0,0,0,192,0,0,0,248,1,0,0,1,0,0,0,2,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,130,151,0,0,142,151,0,0,0,0,0,0,34,151,0,0,1,0,0,0,58,151,0,0,3,0,0,0,82,151,0,0,5,0,0,0,106,151,0,0,2,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,2,0,0,0,150,151,0,0,144,29,0,0,156,29,0,0,16,0,0,0,0,1,0,0,248,1,0,0,1,0,0,0,2,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,253,151,0,0,9,152,0,0,0,0,0,0,157,151,0,0,1,0,0,0,181,151,0,0,3,0,0,0,205,151,0,0,5,0,0,0,229,151,0,0,2,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,17,152,0,0,27,152,0,0,15,0,0,0,248,29,0,0,20,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,184,0,0,0,0,0,0,0,42,152,0,0,57,152,0,0,0,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,189,153,0,0,88,30,0,0,193,153,0,0,196,153,0,0,203,153,0,0,205,153,0,0,207,153,0,0,1,0,0,0,2,0,0,0,5,0,0,0,6,0,0,0,7,0,0,0,8,0,0,0,3,0,0,0,9,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,255,159,0,0,27,165,0,0,39,165,0,0,0,0,0,0,2,0,0,0,2,0,0,0,64,165,0,0,69,165,0,0,15,0,0,0,156,30,0,0,20,0,0,0,2,0,0,0,1,0,0,0,2,0,0,0,4,0,0,0,184,0,0,0,10,0,0,0,147,165,0,0,168,165,0,0,186,165,0,0,200,165,0,0,214,165,0,0,0,0,0,0,11,0,0,0,2,0,0,0,232,165,0,0,239,165,0,0,19,0,0,0,232,30,0,0,28,0,0,0,3,0,0,0,1,0,0,0,3,0,0,0,5,0,0,0,192,0,0,0,11,0,0,0,245,166,0,0,0,0,0,0,152,47,138,66,145,68,55,113,207,251,192,181,165,219,181,233,91,194,86,57,241,17,241,89,164,130,63,146,213,94,28,171,152,170,7,216,1,91,131,18,190,133,49,36,195,125,12,85,116,93,190,114,254,177,222,128,167,6,220,155,116,241,155,193,193,105,155,228,134,71,190,239,198,157,193,15,204,161,12,36,111,44,233,45,170,132,116,74,220,169,176,92,218,136,249,118,82,81,62,152,109,198,49,168,200,39,3,176,199,127,89,191,243,11,224,198,71,145,167,213,81,99,202,6,103,41,41,20,133,10,183,39,56,33,27,46,252,109,44,77,19,13,56,83,84,115,10,101,187,10,106,118,46,201,194,129,133,44,114,146,161,232,191,162,75,102,26,168,112,139,75,194,163,81,108,199,25,232,146,209,36,6,153,214,133,53,14,244,112,160,106,16,22,193,164,25,8,108,55,30,76,119,72,39,181,188,176,52,179,12,28,57,74,170,216,78,79,202,156,91,243,111,46,104,238,130,143,116,111,99,165,120,20,120,200,132,8,2,199,140,250,255,190,144,235,108,80,164,247,163,249,190,242,120,113,198,8,0,0,0,2,0,0,0,12,167,0,0,19,167,0,0,19,0,0,0,36,32,0,0,32,0,0,0,4,0,0,0,1,0,0,0,3,0,0,0,5,0,0,0,192,0,0,0,11,0,0,0,38,167,0,0,61,167,0,0,0,0,0,0,10,0,0,0,2,0,0,0,83,167,0,0,90,167,0,0,19,0,0,0,100,32,0,0,64,0,0,0,5,0,0,0,1,0,0,0,4,0,0,0,6,0,0,0,224,0,0,0,12,0,0,0,104,169,0,0,127,169,0,0,0,0,0,0,9,0,0,0,2,0,0,0,149,169,0,0,156,169,0,0,19,0,0,0,164,32,0,0,48,0,0,0,6,0,0,0,1,0,0,0,4,0,0,0,6,0,0,0,224,0,0,0,12,0,0,0,175,169,0,0,198,169,0,0,0,0,0,0,10,0,0,0,0,0,0,0,220,169,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,1,0,0,160,16,0,0,13,0,0,0,14,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,117,50,188,188,243,33,236,236,198,67,32,32,244,201,179,179,219,3,218,218,123,139,2,2,251,43,226,226,200,250,158,158,74,236,201,201,211,9,212,212,230,107,24,24,107,159,30,30,69,14,152,152,125,56,178,178,232,210,166,166,75,183,38,38,214,87,60,60,50,138,147,147,216,238,130,130,253,152,82,82,55,212,123,123,113,55,187,187,241,151,91,91,225,131,71,71,48,60,36,36,15,226,81,81,248,198,186,186,27,243,74,74,135,72,191,191,250,112,13,13,6,179,176,176,63,222,117,117,94,253,210,210,186,32,125,125,174,49,102,102,91,163,58,58,138,28,89,89,0,0,0,0,188,147,205,205,157,224,26,26,109,44,174,174,193,171,127,127,177,199,43,43,14,185,190,190,128,160,224,224,93,16,138,138,210,82,59,59,213,186,100,100,160,136,216,216,132,165,231,231,7,232,95,95,20,17,27,27,181,194,44,44,144,180,252,252,44,39,49,49,163,101,128,128,178,42,115,115,115,129,12,12,76,95,121,121,84,65,107,107,146,2,75,75,116,105,83,83,54,143,148,148,81,31,131,131,56,54,42,42,176,156,196,196,189,200,34,34,90,248,213,213,252,195,189,189,96,120,72,72,98,206,255,255,150,7,76,76,108,119,65,65,66,230,199,199,247,36,235,235,16,20,28,28,124,99,93,93,40,34,54,54,39,192,103,103,140,175,233,233,19,249,68,68,149,234,20,20,156,187,245,245,199,24,207,207,36,45,63,63,70,227,192,192,59,219,114,114,112,108,84,84,202,76,41,41,227,53,240,240,133,254,8,8,203,23,198,198,17,79,243,243,208,228,140,140,147,89,164,164,184,150,202,202,166,59,104,104,131,77,184,184,32,40,56,56,255,46,229,229,159,86,173,173,119,132,11,11,195,29,200,200,204,255,153,153,3,237,88,88,111,154,25,25,8,10,14,14,191,126,149,149,64,80,112,112,231,48,247,247,43,207,110,110,226,110,31,31,121,61,181,181,12,15,9,9,170,52,97,97,130,22,87,87,65,11,159,159,58,128,157,157,234,100,17,17,185,205,37,37,228,221,175,175,154,8,69,69,164,141,223,223,151,92,163,163,126,213,234,234,218,88,53,53,122,208,237,237,23,252,67,67,102,203,248,248,148,177,251,251,161,211,55,55,29,64,250,250,61,104,194,194,240,204,180,180,222,93,50,50,179,113,156,156,11,231,86,86,114,218,227,227,167,96,135,135,28,27,21,21,239,58,249,249,209,191,99,99,83,169,52,52,62,133,154,154,143,66,177,177,51,209,124,124,38,155,136,136,95,166,61,61,236,215,161,161,118,223,228,228,42,148,129,129,73,1,145,145,129,251,15,15,136,170,238,238,238,97,22,22,33,115,215,215,196,245,151,151,26,168,165,165,235,63,254,254,217,181,109,109,197,174,120,120,57,109,197,197,153,229,29,29,205,164,118,118,173,220,62,62,49,103,203,203,139,71,182,182,1,91,239,239,24,30,18,18,35,197,96,96,221,176,106,106,31,246,77,77,78,233,206,206,45,124,222,222,249,157,85,85,72,90,126,126,79,178,33,33,242,122,3,3,101,38,160,160,142,25,94,94,120,102,90,90,92,75,101,101,88,78,98,98,25,69,253,253,141,244,6,6,229,134,64,64,152,190,242,242,87,172,51,51,103,144,23,23,127,142,5,5,5,94,232,232,100,125,79,79,175,106,137,137,99,149,16,16,182,47,116,116,254,117,10,10,245,146,92,92,183,116,155,155,60,51,45,45,165,214,48,48,206,73,46,46,233,137,73,73,104,114,70,70,68,85,119,119,224,216,168,168,77,4,150,150,67,189,40,40,105,41,169,169,41,121,217,217,46,145,134,134,172,135,209,209,21,74,244,244,89,21,141,141,168,130,214,214,10,188,185,185,158,13,66,66,110,193,246,246,71,184,47,47,223,6,221,221,52,57,35,35,53,98,204,204,106,196,241,241,207,18,193,193,220,235,133,133,34,158,143,143,201,161,113,113,192,240,144,144,155,83,170,170,137,241,1,1,212,225,139,139,237,140,78,78,171,111,142,142,18,162,171,171,162,62,111,111,13,84,230,230,82,242,219,219,187,123,146,146,2,182,183,183,47,202,105,105,169,217,57,57,215,12,211,211,97,35,167,167,30,173,162,162,180,153,195,195,80,68,108,108,4,5,7,7,246,127,4,4,194,70,39,39,22,167,172,172,37,118,208,208,134,19,80,80,86,247,220,220,85,26,132,132,9,81,225,225,190,37,122,122,145,239,19,19,57,57,217,169,23,23,144,103,156,156,113,179,166,166,210,232,7,7,5,4,82,82,152,253,128,128,101,163,228,228,223,118,69,69,8,154,75,75,2,146,224,224,160,128,90,90,102,120,175,175,221,228,106,106,176,221,99,99,191,209,42,42,54,56,230,230,84,13,32,32,67,198,204,204,98,53,242,242,190,152,18,18,30,24,235,235,36,247,161,161,215,236,65,65,119,108,40,40,189,67,188,188,50,117,123,123,212,55,136,136,155,38,13,13,112,250,68,68,249,19,251,251,177,148,126,126,90,72,3,3,122,242,140,140,228,208,182,182,71,139,36,36,60,48,231,231,165,132,107,107,65,84,221,221,6,223,96,96,197,35,253,253,69,25,58,58,163,91,194,194,104,61,141,141,21,89,236,236,33,243,102,102,49,174,111,111,62,162,87,87,22,130,16,16,149,99,239,239,91,1,184,184,77,131,134,134,145,46,109,109,181,217,131,131,31,81,170,170,83,155,93,93,99,124,104,104,59,166,254,254,63,235,48,48,214,165,122,122,37,190,172,172,167,22,9,9,15,12,240,240,53,227,167,167,35,97,144,144,240,192,233,233,175,140,157,157,128,58,92,92,146,245,12,12,129,115,49,49,39,44,208,208,118,37,86,86,231,11,146,146,123,187,206,206,233,78,1,1,241,137,30,30,159,107,52,52,169,83,241,241,196,106,195,195,153,180,91,91,151,241,71,71,131,225,24,24,107,230,34,34,200,189,152,152,14,69,31,31,110,226,179,179,201,244,116,116,47,182,248,248,203,102,153,153,255,204,20,20,234,149,88,88,237,3,220,220,247,86,139,139,225,212,21,21,27,28,162,162,173,30,211,211,12,215,226,226,43,251,200,200,29,195,94,94,25,142,44,44,194,181,73,73,137,233,193,193,18,207,149,149,126,191,125,125,32,186,17,17,100,234,11,11,132,119,197,197,109,57,137,137,106,175,124,124,209,51,113,113,161,201,255,255,206,98,187,187,55,113,15,15,251,129,181,181,61,121,225,225,81,9,62,62,220,173,63,63,45,36,118,118,164,205,85,85,157,249,130,130,238,216,64,64,134,229,120,120,174,197,37,37,205,185,150,150,4,77,119,119,85,68,14,14,10,8,80,80,19,134,247,247,48,231,55,55,211,161,250,250,64,29,97,97,52,170,78,78,140,237,176,176,179,6,84,84,108,112,115,115,42,178,59,59,82,210,159,159,11,65,2,2,139,123,216,216,136,160,243,243,79,17,203,203,103,49,39,39,70,194,103,103,192,39,252,252,180,144,56,56,40,32,4,4,127,246,72,72,120,96,229,229,46,255,76,76,7,150,101,101,75,92,43,43,199,177,142,142,111,171,66,66,13,158,245,245,187,156,219,219,242,82,74,74,243,27,61,61,166,95,164,164,89,147,185,185,188,10,249,249,58,239,19,19,239,145,8,8,254,133,145,145,1,73,22,22,97,238,222,222,124,45,33,33,178,79,177,177,66,143,114,114,219,59,47,47,184,71,191,191,72,135,174,174,44,109,192,192,227,70,60,60,87,214,154,154,133,62,169,169,41,105,79,79,125,100,129,129,148,42,46,46,73,206,198,198,23,203,105,105,202,47,189,189,195,252,163,163,92,151,232,232,94,5,237,237,208,122,209,209,135,172,5,5,142,127,100,100,186,213,165,165,168,26,38,38,183,75,190,190,185,14,135,135,96,167,213,213,248,90,54,54,34,40,27,27,17,20,117,117,222,63,217,217,121,41,238,238,170,136,45,45,51,60],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE);allocate([121,121,95,76,183,183,182,2,202,202,150,184,53,53,88,218,196,196,156,176,67,67,252,23,132,132,26,85,77,77,246,31,89,89,28,138,178,178,56,125,51,51,172,87,207,207,24,199,6,6,244,141,83,83,105,116,155,155,116,183,151,151,245,196,173,173,86,159,227,227,218,114,234,234,213,126,244,244,74,21,143,143,158,34,171,171,162,18,98,98,78,88,95,95,232,7,29,29,229,153,35,35,57,52,246,246,193,110,108,108,68,80,50,50,93,222,70,70,114,104,160,160,38,101,205,205,147,188,218,218,3,219,186,186,198,248,158,158,250,200,214,214,130,168,110,110,207,43,112,112,80,64,133,133,235,220,10,10,117,254,147,147,138,50,223,223,141,164,41,41,76,202,28,28,20,16,215,215,115,33,180,180,204,240,212,212,9,211,138,138,16,93,81,81,226,15,0,0,0,0,25,25,154,111,26,26,224,157,148,148,143,54,199,199,230,66,201,201,236,74,210,210,253,94,127,127,171,193,168,168,216,224,50,188,117,188,33,236,243,236,67,32,198,32,201,179,244,179,3,218,219,218,139,2,123,2,43,226,251,226,250,158,200,158,236,201,74,201,9,212,211,212,107,24,230,24,159,30,107,30,14,152,69,152,56,178,125,178,210,166,232,166,183,38,75,38,87,60,214,60,138,147,50,147,238,130,216,130,152,82,253,82,212,123,55,123,55,187,113,187,151,91,241,91,131,71,225,71,60,36,48,36,226,81,15,81,198,186,248,186,243,74,27,74,72,191,135,191,112,13,250,13,179,176,6,176,222,117,63,117,253,210,94,210,32,125,186,125,49,102,174,102,163,58,91,58,28,89,138,89,0,0,0,0,147,205,188,205,224,26,157,26,44,174,109,174,171,127,193,127,199,43,177,43,185,190,14,190,160,224,128,224,16,138,93,138,82,59,210,59,186,100,213,100,136,216,160,216,165,231,132,231,232,95,7,95,17,27,20,27,194,44,181,44,180,252,144,252,39,49,44,49,101,128,163,128,42,115,178,115,129,12,115,12,95,121,76,121,65,107,84,107,2,75,146,75,105,83,116,83,143,148,54,148,31,131,81,131,54,42,56,42,156,196,176,196,200,34,189,34,248,213,90,213,195,189,252,189,120,72,96,72,206,255,98,255,7,76,150,76,119,65,108,65,230,199,66,199,36,235,247,235,20,28,16,28,99,93,124,93,34,54,40,54,192,103,39,103,175,233,140,233,249,68,19,68,234,20,149,20,187,245,156,245,24,207,199,207,45,63,36,63,227,192,70,192,219,114,59,114,108,84,112,84,76,41,202,41,53,240,227,240,254,8,133,8,23,198,203,198,79,243,17,243,228,140,208,140,89,164,147,164,150,202,184,202,59,104,166,104,77,184,131,184,40,56,32,56,46,229,255,229,86,173,159,173,132,11,119,11,29,200,195,200,255,153,204,153,237,88,3,88,154,25,111,25,10,14,8,14,126,149,191,149,80,112,64,112,48,247,231,247,207,110,43,110,110,31,226,31,61,181,121,181,15,9,12,9,52,97,170,97,22,87,130,87,11,159,65,159,128,157,58,157,100,17,234,17,205,37,185,37,221,175,228,175,8,69,154,69,141,223,164,223,92,163,151,163,213,234,126,234,88,53,218,53,208,237,122,237,252,67,23,67,203,248,102,248,177,251,148,251,211,55,161,55,64,250,29,250,104,194,61,194,204,180,240,180,93,50,222,50,113,156,179,156,231,86,11,86,218,227,114,227,96,135,167,135,27,21,28,21,58,249,239,249,191,99,209,99,169,52,83,52,133,154,62,154,66,177,143,177,209,124,51,124,155,136,38,136,166,61,95,61,215,161,236,161,223,228,118,228,148,129,42,129,1,145,73,145,251,15,129,15,170,238,136,238,97,22,238,22,115,215,33,215,245,151,196,151,168,165,26,165,63,254,235,254,181,109,217,109,174,120,197,120,109,197,57,197,229,29,153,29,164,118,205,118,220,62,173,62,103,203,49,203,71,182,139,182,91,239,1,239,30,18,24,18,197,96,35,96,176,106,221,106,246,77,31,77,233,206,78,206,124,222,45,222,157,85,249,85,90,126,72,126,178,33,79,33,122,3,242,3,38,160,101,160,25,94,142,94,102,90,120,90,75,101,92,101,78,98,88,98,69,253,25,253,244,6,141,6,134,64,229,64,190,242,152,242,172,51,87,51,144,23,103,23,142,5,127,5,94,232,5,232,125,79,100,79,106,137,175,137,149,16,99,16,47,116,182,116,117,10,254,10,146,92,245,92,116,155,183,155,51,45,60,45,214,48,165,48,73,46,206,46,137,73,233,73,114,70,104,70,85,119,68,119,216,168,224,168,4,150,77,150,189,40,67,40,41,169,105,169,121,217,41,217,145,134,46,134,135,209,172,209,74,244,21,244,21,141,89,141,130,214,168,214,188,185,10,185,13,66,158,66,193,246,110,246,184,47,71,47,6,221,223,221,57,35,52,35,98,204,53,204,196,241,106,241,18,193,207,193,235,133,220,133,158,143,34,143,161,113,201,113,240,144,192,144,83,170,155,170,241,1,137,1,225,139,212,139,140,78,237,78,111,142,171,142,162,171,18,171,62,111,162,111,84,230,13,230,242,219,82,219,123,146,187,146,182,183,2,183,202,105,47,105,217,57,169,57,12,211,215,211,35,167,97,167,173,162,30,162,153,195,180,195,68,108,80,108,5,7,4,7,127,4,246,4,70,39,194,39,167,172,22,172,118,208,37,208,19,80,134,80,247,220,86,220,26,132,85,132,81,225,9,225,37,122,190,122,239,19,145,19,217,169,57,217,144,103,23,144,113,179,156,113,210,232,166,210,5,4,7,5,152,253,82,152,101,163,128,101,223,118,228,223,8,154,69,8,2,146,75,2,160,128,224,160,102,120,90,102,221,228,175,221,176,221,106,176,191,209,99,191,54,56,42,54,84,13,230,84,67,198,32,67,98,53,204,98,190,152,242,190,30,24,18,30,36,247,235,36,215,236,161,215,119,108,65,119,189,67,40,189,50,117,188,50,212,55,123,212,155,38,136,155,112,250,13,112,249,19,68,249,177,148,251,177,90,72,126,90,122,242,3,122,228,208,140,228,71,139,182,71,60,48,36,60,165,132,231,165,65,84,107,65,6,223,221,6,197,35,96,197,69,25,253,69,163,91,58,163,104,61,194,104,21,89,141,21,33,243,236,33,49,174,102,49,62,162,111,62,22,130,87,22,149,99,16,149,91,1,239,91,77,131,184,77,145,46,134,145,181,217,109,181,31,81,131,31,83,155,170,83,99,124,93,99,59,166,104,59,63,235,254,63,214,165,48,214,37,190,122,37,167,22,172,167,15,12,9,15,53,227,240,53,35,97,167,35,240,192,144,240,175,140,233,175,128,58,157,128,146,245,92,146,129,115,12,129,39,44,49,39,118,37,208,118,231,11,86,231,123,187,146,123,233,78,206,233,241,137,1,241,159,107,30,159,169,83,52,169,196,106,241,196,153,180,195,153,151,241,91,151,131,225,71,131,107,230,24,107,200,189,34,200,14,69,152,14,110,226,31,110,201,244,179,201,47,182,116,47,203,102,248,203,255,204,153,255,234,149,20,234,237,3,88,237,247,86,220,247,225,212,139,225,27,28,21,27,173,30,162,173,12,215,211,12,43,251,226,43,29,195,200,29,25,142,94,25,194,181,44,194,137,233,73,137,18,207,193,18,126,191,149,126,32,186,125,32,100,234,17,100,132,119,11,132,109,57,197,109,106,175,137,106,209,51,124,209,161,201,113,161,206,98,255,206,55,113,187,55,251,129,15,251,61,121,181,61,81,9,225,81,220,173,62,220,45,36,63,45,164,205,118,164,157,249,85,157,238,216,130,238,134,229,64,134,174,197,120,174,205,185,37,205,4,77,150,4,85,68,119,85,10,8,14,10,19,134,80,19,48,231,247,48,211,161,55,211,64,29,250,64,52,170,97,52,140,237,78,140,179,6,176,179,108,112,84,108,42,178,115,42,82,210,59,82,11,65,159,11,139,123,2,139,136,160,216,136,79,17,243,79,103,49,203,103,70,194,39,70,192,39,103,192,180,144,252,180,40,32,56,40,127,246,4,127,120,96,72,120,46,255,229,46,7,150,76,7,75,92,101,75,199,177,43,199,111,171,142,111,13,158,66,13,187,156,245,187,242,82,219,242,243,27,74,243,166,95,61,166,89,147,164,89,188,10,185,188,58,239,249,58,239,145,19,239,254,133,8,254,1,73,145,1,97,238,22,97,124,45,222,124,178,79,33,178,66,143,177,66,219,59,114,219,184,71,47,184,72,135,191,72,44,109,174,44,227,70,192,227,87,214,60,87,133,62,154,133,41,105,169,41,125,100,79,125,148,42,129,148,73,206,46,73,23,203,198,23,202,47,105,202,195,252,189,195,92,151,163,92,94,5,232,94,208,122,237,208,135,172,209,135,142,127,5,142,186,213,100,186,168,26,165,168,183,75,38,183,185,14,190,185,96,167,135,96,248,90,213,248,34,40,54,34,17,20,27,17,222,63,117,222,121,41,217,121,170,136,238,170,51,60,45,51,95,76,121,95,182,2,183,182,150,184,202,150,88,218,53,88,156,176,196,156,252,23,67,252,26,85,132,26,246,31,77,246,28,138,89,28,56,125,178,56,172,87,51,172,24,199,207,24,244,141,6,244,105,116,83,105,116,183,155,116,245,196,151,245,86,159,173,86,218,114,227,218,213,126,234,213,74,21,244,74,158,34,143,158,162,18,171,162,78,88,98,78,232,7,95,232,229,153,29,229,57,52,35,57,193,110,246,193,68,80,108,68,93,222,50,93,114,104,70,114,38,101,160,38,147,188,205,147,3,219,218,3,198,248,186,198,250,200,158,250,130,168,214,130,207,43,110,207,80,64,112,80,235,220,133,235,117,254,10,117,138,50,147,138,141,164,223,141,76,202,41,76,20,16,28,20,115,33,215,115,204,240,180,204,9,211,212,9,16,93,138,16,226,15,81,226,0,0,0,0,154,111,25,154,224,157,26,224,143,54,148,143,230,66,199,230,236,74,201,236,253,94,210,253,171,193,127,171,216,224,168,216,47,1,0,0,0,0,0,0,211,177,0,0,0,0,0,0,0,0,0,0,16,0,0,0,128,0,0,0,160,16,0,0,13,0,0,0,14,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152,47,138,66,145,68,55,113,207,251,192,181,165,219,181,233,91,194,86,57,241,17,241,89,164,130,63,146,213,94,28,171,152,170,7,216,1,91,131,18,190,133,49,36,195,125,12,85,116,93,190,114,254,177,222,128,167,6,220,155,116,241,155,193,193,105,155,228,134,71,190,239,198,157,193,15,204,161,12,36,111,44,233,45,170,132,116,74,220,169,176,92,218,136,249,118,82,81,62,152,109,198,49,168,200,39,3,176,199,127,89,191,243,11,224,198,71,145,167,213,81,99,202,6,103,41,41,20,133,10,183,39,56,33,27,46,252,109,44,77,19,13,56,83,84,115,10,101,187,10,106,118,46,201,194,129,133,44,114,146,161,232,191,162,75,102,26,168,112,139,75,194,163,81,108,199,25,232,146,209,36,6,153,214,133,53,14,244,112,160,106,16,22,193,164,25,8,108,55,30,76,119,72,39,181,188,176,52,179,12,28,57,74,170,216,78,79,202,156,91,243,111,46,104,238,130,143,116,111,99,165,120,20,120,200,132,8,2,199,140,250,255,190,144,235,108,80,164,247,163,249,190,242,120,113,198,18,0,0,0,0,0,0,0,3,0,0,0,47,184,0,0,176,50,0,0,51,184,0,0,59,184,0,0,68,184,0,0,71,184,0,0,51,184,0,0,3,0,0,0,7,0,0,0,16,0,0,0,17,0,0,0,18,0,0,0,19,0,0,0,8,0,0,0,20,0,0,0,4,0,0,0,21,0,0,0,9,0,0,0,245,194,0,0,249,194,0,0,255,194,0,0,4,195,0,0,10,195,0,0,0,0,0,0,16,0,0,0,7,0,0,0,22,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,22,0,0,0,37,0,0,0,63,0,0,0,92,0,0,0,117,0,0,0,132,0,0,0,147,0,0,0,161,0,0,0,175,0,0,0,190,0,0,0,205,0,0,0,230,0,0,0,243,0,0,0,2,1,0,0,16,1,0,0,27,1,0,0,41,1,0,0,63,1,0,0,79,1,0,0,109,1,0,0,129,1,0,0,153,1,0,0,179,1,0,0,204,1,0,0,222,1,0,0,231,1,0,0,241,1,0,0,1,2,0,0,14,2,0,0,28,2,0,0,47,2,0,0,71,2,0,0,91,2,0,0,107,2,0,0,122,2,0,0,138,2,0,0,154,2,0,0,171,2,0,0,185,2,0,0,201,2,0,0,228,2,0,0,245,2,0,0,9,3,0,0,28,3,0,0,45,3,0,0,65,3,0,0,77,3,0,0,91,3,0,0,104,3,0,0,120,3,0,0,139,3,0,0,158,3,0,0,178,3,0,0,198,3,0,0,212,3,0,0,234,3,0,0,254,3,0,0,6,4,0,0,10,4,0,0,24,4,0,0,47,4,0,0,55,4,0,0,70,4,0,0,83,4,0,0,98,4,0,0,127,4,0,0,156,4,0,0,179,4,0,0,195,4,0,0,211,4,0,0,231,4,0,0,244,4,0,0,3,5,0,0,20,5,0,0,36,5,0,0,53,5,0,0,70,5,0,0,82,5,0,0,95,5,0,0,126,5,0,0,147,5,0,0,167,5,0,0,188,5,0,0,210,5,0,0,222,5,0,0,237,5,0,0,245,5,0,0,2,6,0,0,11,6,0,0,29,6,0,0,40,6,0,0,51,6,0,0,65,6,0,0,85,6,0,0,98,6,0,0,110,6,0,0,124,6,0,0,136,6,0,0,156,6,0,0,175,6,0,0,195,6,0,0,217,6,0,0,241,6,0,0,6,7,0,0,29,7,0,0,50,7,0,0,65,7,0,0,76,7,0,0,96,7,0,0,109,7,0,0,122,7,0,0,139,7,0,0,161,7,0,0,175,7,0,0,195,7,0,0,211,7,0,0,225,7,0,0,236,7,0,0,0,8,0,0,23,8,0,0,44,8,0,0,59,8,0,0,80,8,0,0,102,8,0,0,118,8,0,0,132,8,0,0,148,8,0,0,162,8,0,0,179,8,0,0,191,8,0,0,223,8,0,0,243,8,0,0,255,8,0,0,9,9,0,0,21,9,0,0,39,9,0,0,60,9,0,0,72,9,0,0,87,9,0,0,104,9,0,0,119,9,0,0,135,9,0,0,149,9,0,0,168,9,0,0,187,9,0,0,210,9,0,0,231,9,0,0,255,9,0,0,17,10,0,0,39,10,0,0,62,10,0,0,80,10,0,0,92,10,0,0,110,10,0,0,127,10,0,0,141,10,0,0,158,10,0,0,173,10,0,0,196,10,0,0,215,10,0,0,228,10,0,0,247,10,0,0,15,11,0,0,42,11,0,0,55,11,0,0,80,11,0,0,91,11,0,0,110,11,0,0,122,11,0,0,138,11,0,0,156,11,0,0,183,11,0,0,190,11,0,0,205,11,0,0,221,11,0,0,237,11,0,0,1,12,0,0,14,12,0,0,26,12,0,0,43,12,0,0,55,12,0,0,72,12,0,0,86,12,0,0,102,12,0,0,129,12,0,0,152,12,0,0,175,12,0,0,198,12,0,0,213,12,0,0,230,12,0,0,248,12,0,0,13,13,0,0,32,13,0,0,63,13,0,0,81,13,0,0,99,13,0,0,121,13,0,0,147,13,0,0,174,13,0,0,191,13,0,0,232,13,0,0,8,14,0,0,46,14,0,0,73,14,0,0,103,14,0,0,133,14,0,0,161,14,0,0,198,14,0,0,222,14,0,0,14,15,0,0,56,15,0,0,96,15,0,0,132,15,0,0,143,15,0,0,161,15,0,0,178,15,0,0,209,15,0,0,230,15,0,0,255,15,0,0,14,16,0,0,38,16,0,0,57,16,0,0,93,16,0,0,114,16,0,0,143,16,0,0,163,16,0,0,190,16,0,0,218,16,0,0,233,16,0,0,244,16,0,0,5,17,0,0,42,17,0,0,87,17,0,0,131,17,0,0,171,17,0,0,209,17,0,0,247,17,0,0,33,18,0,0,67,18,0,0,112,18,0,0,157,18,0,0,170,18,0,0,180,18,0,0,193,18,0,0,228,18,0,0,248,18,0,0,10,19,0,0,33,19,0,0,57,19,0,0,78,19,0,0,106,19,0,0,136,19,0,0,164,19,0,0,184,19,0,0,208,19,0,0,235,19,0,0,253,19,0,0,15,20,0,0,43,20,0,0,58,20,0,0,74,20,0,0,102,20,0,0,125,20,0,0,145,20,0,0,162,20,0,0,190,20,0,0,214,20,0,0,239,20,0,0,3,21,0,0,23,21,0,0,42,21,0,0,71,21,0,0,95,21,0,0,123,21,0,0,150,21,0,0,176,21,0,0,205,21,0,0,229,21,0,0,254,21,0,0,25,22,0,0,54,22,0,0,71,22,0,0,96,22,0,0,119,22,0,0,141,22,0,0,160,22,0,0,182,22,0,0,215,22,0,0,245,22,0,0,12,23,0,0,47,23,0,0,63,23,0,0,83,23,0,0,103,23,0,0,120,23,0,0,147,23,0,0,160,23,0,0,182,23,0,0,202,23,0,0,230,23,0,0,2,24,0,0,21,24,0,0,39,24,0,0,80,24,0,0,120,24,0,0,159,24,0,0,173,24,0,0,208,24,0,0,247,24,0,0,24,25,0,0,51,25,0,0,74,25,0,0,104,25,0,0,135,25,0,0,164,25,0,0,190,25,0,0,213,25,0,0,233,25,0,0,252,25,0,0,22,26,0,0,43,26,0,0,76,26,0,0,113,26,0,0,147,26,0,0,172,26,0,0,201,26,0,0,221,26,0,0,248,26,0,0,28,27,0,0,50,27,0,0,72,27,0,0,100,27,0,0,139,27,0,0,173,27,0,0,195,27,0,0,227,27,0,0,250,27,0,0,31,28,0,0,60,28,0,0,77,28,0,0,105,28,0,0,132,28,0,0,153,28,0,0,180,28,0,0,204,28,0,0,219,28,0,0,247,28,0,0,15,29,0,0,34,29,0,0,56,29,0,0,93,29,0,0,119,29,0,0,145,29,0,0,171,29,0,0,197,29,0,0,223,29,0,0,249,29,0,0,19,30,0,0,45,30,0,0,71,30,0,0,98,30,0,0,125,30,0,0,152,30,0,0,179,30,0,0,206,30,0,0,233,30,0,0,4,31,0,0,27,31,0,0,48,31,0,0,60,31,0,0,7,0,0,0,13,0,0,0,98,0,0,0,99,0,0,0,68,0,0,0,97,0,0,0,11,0,0,0,114,0,0,0,0,0,0,0,0,0,0,0,52,0,0,0,9,0,0,0,77,0,0,0,74,0,0,0,53,0,0,0,0,0,0,0,56,0,0,0,57,0,0,0,59,0,0,0,16,0,0,0,125,0,0,0,10,0,0,0,44,0,0,0,70,0,0,0,103,0,0,0,111,0,0,0,104,0,0,0,0,0,0,0,35,0,0,0,35,0,0,0,89,0,0,0,0,0,0,0,33,0,0,0,73,0,0,0,122,0,0,0,17,0,0,0,14,0,0,0,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,0,0,113,0,0,0,43,0,0,0,0,0,0,0,84,0,0,0,115,0,0,0,4,0,0,0,22,0,0,0,5,0,0,0,106,0,0,0,21,0,0,0,120,0,0,0,51,0,0,0,45,0,0,0,46,0,0,0,47,0,0,0,79,0,0,0,80,0,0,0,83,0,0,0,82,0,0,0,81,0,0,0,48,0,0,0,40,0,0,0,124,0,0,0,24,0,0,0,31,0,0,0,90,0,0,0,72,0,0,0,36,0,0,0,119,0,0,0,0,0,0,0,100,0,0,0,102,0,0,0,101,0,0,0,23,0,0,0,55,0,0,0,105,0,0,0,50,0,0,0,61,0,0,0,19,0,0,0,2,0,0,0,8,0,0,0,37,0,0,0,67,0,0,0,123,0,0,0,12,0,0,0,42,0,0,0,64,0,0,0,65,0,0,0,92,0,0,0,28,0,0,0,63,0,0,0,60,0,0,0,38,0,0,0,15,0,0,0,107,0,0,0,20,0,0,0,39,0,0,0,118,0,0,0,88,0,0,0,95,0,0,0,25,0,0,0,76,0,0,0,6,0,0,0,95,0,0,0,75,0,0,0,1,0,0,0,96,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,0,0,0,93,0,0,0,91,0,0,0,34,0,0,0,78,0,0,0,66,0,0,0,121,0,0,0,85,0,0,0,30,0,0,0,0,0,0,0,108,0,0,0,94,0,0,0,29,0,0,0,3,0,0,0,69,0,0,0,116,0,0,0,86,0,0,0,62,0,0,0,110,0,0,0,109,0,0,0,26,0,0,0,117,0,0,0,49,0,0,0,87,0,0,0,11,0,0,0,18,0,0,0,54,0,0,0,107,128,0,0,81,128,0,0,127,128,0,0,47,128,0,0,49,128,0,0,104,128,0,0,0,128,0,0,82,128,0,0,11,128,0,0,21,128,0,0,6,128,0,0,138,128,0,0,86,128,0,0,1,128,0,0,36,128,0,0,95,128,0,0,19,128,0,0,35,128,0,0,139,128,0,0,80,128,0,0,97,128,0,0,51,128,0,0,48,128,0,0,75,128,0,0,65,128,0,0,102,128,0,0,134,128,0,0,37,128,0,0,91,128,0,0,126,128,0,0,122,128,0,0,66,128,0,0,109,128,0,0,32,128,0,0,117,128,0,0,28,128,0,0,29,128,0,0,69,128,0,0,83,128,0,0,94,128,0,0,98,128,0,0,63,128,0,0,87,128,0,0,43,128,0,0,22,128,0,0,54,128,0,0,55,128,0,0,56,128,0,0,62,128,0,0,136,128,0,0,78,128,0,0,53,128,0,0,10,128,0,0,14,128,0,0,140,128,0,0,76,128,0,0,16,128,0,0,17,128,0,0,18,128,0,0,93,128,0,0,79,128,0,0,131,128,0,0,92,128,0,0,88,128,0,0,89,128,0,0,119,128,0,0,84,128,0,0,4,128,0,0,128,128,0,0,23,128,0,0,114,128,0,0,68,128,0,0,33,128,0,0,13,128,0,0,106,128,0,0,103,128,0,0,12,128,0,0,118,128,0,0,57,128,0,0,58,128,0,0,61,128,0,0,60,128,0,0,59,128,0,0,45,128,0,0,121,128,0,0,130,128,0,0,137,128,0,0,100,128,0,0,30,128,0,0,67,128,0,0,116,128,0,0,90,128,0,0,115,128,0,0,125,128,0,0,101,128,0,0,105,128,0,0,108,128,0,0,5,128,0,0,2,128,0,0,3,128,0,0,72,128,0,0,74,128,0,0,73,128,0,0,24,128,0,0,26,128,0,0,77,128,0,0,50,128,0,0,96,128,0,0,124,128,0,0,133,128,0,0,132,128,0,0,25,128,0,0,41,128,0,0,42,128,0,0,7,128,0,0,46,128,0,0,129,128,0,0,135,128,0,0,99,128,0,0,70,128,0,0,52,128,0,0,120,128,0,0,34,128,0,0,85,128,0,0,64,128,0,0,20,128,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,5,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,0,0,0,24,0,0,0,136,26,1,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,61,0,0,40,62,0,0,5,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,0,0,0,24,0,0,0,144,30,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,192,3,0,0,192,4,0,0,192,5,0,0,192,6,0,0,192,7,0,0,192,8,0,0,192,9,0,0,192,10,0,0,192,11,0,0,192,12,0,0,192,13,0,0,192,14,0,0,192,15,0,0,192,16,0,0,192,17,0,0,192,18,0,0,192,19,0,0,192,20,0,0,192,21,0,0,192,22,0,0,192,23,0,0,192,24,0,0,192,25,0,0,192,26,0,0,192,27,0,0,192,28,0,0,192,29,0,0,192,30,0,0,192,31,0,0,192,0,0,0,179,1,0,0,195,2,0,0,195,3,0,0,195,4,0,0,195,5,0,0,195,6,0,0,195,7,0,0,195,8,0,0,195,9,0,0,195,10,0,0,195,11,0,0,195,12,0,0,195,13,0,0,211,14,0,0,195,15,0,0,195,0,0,12,187,1,0,12,195,2,0,12,195,3,0,12,195,4,0,12,211,32,0,0,0,9,0,0,0,10,0,0,0,13,0,0,0,11,0,0,0,12,0,0,0,133,0,0,0,0,32,0,0,1,32,0,0,2,32,0,0,3,32,0,0,4,32,0,0,5,32,0,0,6,32,0,0,8,32,0,0,9,32,0,0,10,32,0,0,40,32,0,0,41,32,0,0,95,32,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,60,64,0,0,3,0,0,0,0,0,0,0,45,244,81,88,207,140,177,192,70,246,181,203,41,49,3,199,4,91,112,48,180,93,253,32,120,127,139,154,216,89,41,80,104,72,137,171,167,86,3,108,255,183,205,136,63,212,119,180,43,165,163,112,241,186,228,168,252,65,131,253,217,111,225,138,122,47,45,116,150,7,31,13,9,94,3,118,44,112,247,64,165,44,167,111,87,65,168,170,116,223,160,88,100,3,74,199,196,60,83,174,175,95,24,4,21,177,227,109,40,134,171,12,164,191,67,240,233,80,129,57,87,22,82,55,3,0,5,0,7,0,11,0,13,0,17,0,19,0,23,0,29,0,31,0,37,0,41,0,43,0,47,0,53,0,59,0,61,0,67,0,71,0,73,0,79,0,83,0,89,0,97,0,101,0,103,0,107,0,109,0,113,0,127,0,131,0,137,0,139,0,149,0,151,0,157,0,163,0,167,0,173,0,179,0,181,0,191,0,193,0,197,0,199,0,211,0,223,0,227,0,229,0,233,0,239,0,241,0,251,0,1,1,7,1,13,1,15,1,21,1,25,1,27,1,37,1,51,1,55,1,57,1,61,1,75,1,81,1,91,1,93,1,97,1,103,1,111,1,117,1,123,1,127,1,133,1,141,1,145,1,153,1,163,1,165,1,175,1,177,1,183,1,187,1,193,1,201,1,205,1,207,1,211,1,223,1,231,1,235,1,243,1,247,1,253,1,9,2,11,2,29,2,35,2,45,2,51,2,57,2,59,2,65,2,75,2,81,2,87,2,89,2,95,2,101,2,105,2,107,2,119,2,129,2,131,2,135,2,141,2,147,2,149,2,161,2,165,2,171,2,179,2,189,2,197,2,207,2,215,2,221,2,227,2,231,2,239,2,245,2,249,2,1,3,5,3,19,3,29,3,41,3,43,3,53,3,55,3,59,3,61,3,71,3,85,3,89,3,91,3,95,3,109,3,113,3,115,3,119,3,139,3,143,3,151,3,161,3,169,3,173,3,179,3,185,3,199,3,203,3,209,3,215,3,223,3,229,3,241,3,245,3,251,3,253,3,7,4,9,4,15,4,25,4,27,4,37,4,39,4,45,4,63,4,67,4,69,4,73,4,79,4,85,4,93,4,99,4,105,4,127,4,129,4,139,4,147,4,157,4,163,4,169,4,177,4,189,4,193,4,199,4,205,4,207,4,213,4,225,4,235,4,253,4,255,4,3,5,9,5,11,5,17,5,21,5,23,5,27,5,39,5,41,5,47,5,81,5,87,5,93,5,101,5,119,5,129,5,143,5,147,5,149,5,153,5,159,5,167,5,171,5,173,5,179,5,191,5,201,5,203,5,207,5,209,5,213,5,219,5,231,5,243,5,251,5,7,6,13,6,17,6,23,6,31,6,35,6,43,6,47,6,61,6,65,6,71,6,73,6,77,6,83,6,85,6,91,6,101,6,121,6,127,6,131,6,133,6,157,6,161,6,163,6,173,6,185,6,187,6,197,6,205,6,211,6,217,6,223,6,241,6,247,6,251,6,253,6,9,7,19,7,31,7,39,7,55,7,69,7,75,7,79,7,81,7,85,7,87,7,97,7,109,7,115,7,121,7,139,7,141,7,157,7,159,7,181,7,187,7,195,7,201,7,205,7,207,7,211,7,219,7,225,7,235,7,237,7,247,7,5,8,15,8,21,8,33,8,35,8,39,8,41,8,51,8,63,8,65,8,81,8,83,8,89,8,93,8,95,8,105,8,113,8,131,8,155,8,159,8,165,8,173,8,189,8,191,8,195,8,203,8,219,8,221,8,225,8,233,8,239,8,245,8,249,8,5,9,7,9,29,9,35,9,37,9,43,9,47,9,53,9,67,9,73,9,77,9,79,9,85,9,89,9,95,9,107,9,113,9,119,9,133,9,137,9,143,9,155,9,163,9,169,9,173,9,199,9,217,9,227,9,235,9,239,9,245,9,247,9,253,9,19,10,31,10,33,10,49,10,57,10,61,10,73,10,87,10,97,10,99,10,103,10,111,10,117,10,123,10,127,10,129,10,133,10,139,10,147,10,151,10,153,10,159,10,169,10,171,10,181,10,189,10,193,10,207,10,217,10,229,10,231,10,237,10,241,10,243,10,3,11,17,11,21,11,27,11,35,11,41,11,45,11,63,11,71,11,81,11,87,11,93,11,101,11,111,11,123,11,137,11,141,11,147,11,153,11,155,11,183,11,185,11,195,11,203,11,207,11,221,11,225,11,233,11,245,11,251,11,7,12,11,12,17,12,37,12,47,12,49,12,65,12,91,12,95,12,97,12,109,12,115,12,119,12,131,12,137,12,145,12,149,12,157,12,179,12,181,12,185,12,187,12,199,12,227,12,229,12,235,12,241,12,247,12,251,12,1,13,3,13,15,13,19,13,31,13,33,13,43,13,45,13,61,13,63,13,79,13,85,13,105,13,121,13,129,13,133,13,135,13,139,13,141,13,163,13,171,13,183,13,189,13,199,13,201,13,205,13,211,13,213,13,219,13,229,13,231,13,243,13,253,13,255,13,9,14,23,14,29,14,33,14,39,14,47,14,53,14,59,14,75,14,87,14,89,14,93,14,107,14,113,14,117,14,125,14,135,14,143,14,149,14,155,14,177,14,183,14,185,14,195,14,209,14,213,14,219,14,237,14,239,14,249,14,7,15,11,15,13,15,23,15,37,15,41,15,49,15,67,15,71,15,77,15,79,15,83,15,89,15,91,15,103,15,107,15,127,15,149,15,161,15,163,15,167,15,173,15,179,15,181,15,187,15,209,15,211,15,217,15,233,15,239,15,251,15,253,15,3,16,15,16,31,16,33,16,37,16,43,16,57,16,61,16,63,16,81,16,105,16,115,16,121,16,123,16,133,16,135,16,145,16,147,16,157,16,163,16,165,16,175,16,177,16,187,16,193,16,201,16,231,16,241,16,243,16,253,16,5,17,11,17,21,17,39,17,45,17,57,17,69,17,71,17,89,17,95,17,99,17,105,17,111,17,129,17,131,17,141,17,155,17,161,17,165,17,167,17,171,17,195,17,197,17,209,17,215,17,231,17,239,17,245,17,251,17,13,18,29,18,31,18,35,18,41,18,43,18,49,18,55,18,65,18,71,18,83,18,95,18,113,18,115,18,121,18,125,18,143,18,151,18,175,18,179,18,181,18,185,18,191,18,193,18,205,18,209,18,223,18,253,18,7,19,13,19,25,19,39,19,45,19,55,19,67,19,69,19,73,19,79,19,87,19,93,19,103,19,105,19,109,19,123,19,129,19,135,19,0,0,0,0,194,1,132,3,70,2,8,7,202,6,140,4,78,5,16,14,210,15,148,13,86,12,24,9,218,8,156,10,94,11,32,28,226,29,164,31,102,30,40,27,234,26,172,24,110,25,48,18,242,19,180,17,118,16,56,21,250,20,188,22,126,23,64,56,130,57,196,59,6,58,72,63,138,62,204,60,14,61,80,54,146,55,212,53,22,52,88,49,154,48,220,50,30,51,96,36,162,37,228,39,38,38,104,35,170,34,236,32,46,33,112,42,178,43,244,41,54,40,120,45,186,44,252,46,62,47,128,112,66,113,4,115,198,114,136,119,74,118,12,116,206,117,144,126,82,127,20,125,214,124,152,121,90,120,28,122,222,123,160,108,98,109,36,111,230,110,168,107,106,106,44,104,238,105,176,98,114,99,52,97,246,96,184,101,122,100,60,102,254,103,192,72,2,73,68,75,134,74,200,79,10,78,76,76,142,77,208,70,18,71,84,69,150,68,216,65,26,64,92,66,158,67,224,84,34,85,100,87,166,86,232,83,42,82,108,80,174,81,240,90,50,91,116,89,182,88,248,93,58,92,124,94,190,95,0,225,194,224,132,226,70,227,8,230,202,231,140,229,78,228,16,239,210,238,148,236,86,237,24,232,218,233,156,235,94,234,32,253,226,252,164,254,102,255,40,250,234,251,172,249,110,248,48,243,242,242,180,240,118,241,56,244,250,245,188,247,126,246,64,217,130,216,196,218,6,219,72,222,138,223,204,221,14,220,80,215,146,214,212,212,22,213,88,208,154,209,220,211,30,210,96,197,162,196,228,198,38,199,104,194,170,195,236,193,46,192,112,203,178,202,244,200,54,201,120,204,186,205,252,207,62,206,128,145,66,144,4,146,198,147,136,150,74,151,12,149,206,148,144,159,82,158,20,156,214,157,152,152,90,153,28,155,222,154,160,141,98,140,36,142,230,143,168,138,106,139,44,137,238,136,176,131,114,130,52,128,246,129,184,132,122,133,60,135,254,134,192,169,2,168,68,170,134,171,200,174,10,175,76,173,142,172,208,167,18,166,84,164,150,165,216,160,26,161,92,163,158,162,224,181,34,180,100,182,166,183,232,178,42,179,108,177,174,176,240,187,50,186,116,184,182,185,248,188,58,189,124,191,190,190,73,0,49,1,83,0,127,1,48,1,105,0,120,1,255,0,129,1,83,2,130,1,131,1,132,1,133,1,134,1,84,2,135,1,136,1,137,1,86,2,138,1,87,2,139,1,140,1,142,1,221,1,143,1,89,2,144,1,91,2,145,1,146,1,147,1,96,2,148,1,99,2,150,1,105,2,151,1,104,2,152,1,153,1,156,1,111,2,157,1,114,2,159,1,117,2,166,1,128,2,167,1,168,1,169,1,131,2,172,1,173,1,174,1,136,2,175,1,176,1,177,1,138,2,178,1,139,2,183,1,146,2,184,1,185,1,188,1,189,1,196,1,198,1,196,1,197,1,197,1,198,1,199,1,201,1,199,1,200,1,200,1,201,1,202,1,204,1,202,1,203,1,203,1,204,1,241,1,243,1,241,1,242,1,242,1,243,1,244,1,245,1,246,1,149,1,247,1,191,1,32,2,158,1,134,3,172,3,136,3,173,3,137,3,174,3,138,3,175,3,140,3,204,3,142,3,205,3,143,3,206,3,153,3,69,3,153,3,190,31,163,3,194,3,247,3,248,3,250,3,251,3,96,30,155,30,223,0,223,0,158,30,223,0,89,31,81,31,91,31,83,31,93,31,85,31,95,31,87,31,188,31,179,31,204,31,195,31,236,31,229,31,252,31,243,31,58,2,101,44,59,2,60,2,61,2,154,1,62,2,102,44,65,2,66,2,67,2,128,1,68,2,137,2,69,2,140,2,244,3,184,3,249,3,242,3,253,3,123,3,254,3,124,3,255,3,125,3,192,4,207,4,38,33,201,3,42,33,107,0,43,33,229,0,50,33,78,33,131,33,132,33,96,44,97,44,98,44,107,2,99,44,125,29,100,44,125,2,109,44,81,2,110,44,113,2,111,44,80,2,112,44,82,2,114,44,115,44,117,44,118,44,126,44,63,2,127,44,64,2,242,44,243,44,125,167,121,29,139,167,140,167,141,167,101,2,170,167,102,2,199,16,39,45,205,16,45,45,118,3,119,3,156,3,181,0,146,3,208,3,152,3,209,3,166,3,213,3,160,3,214,3,154,3,240,3,161,3,241,3,149,3,245,3,207,3,215,3,0,0,0,0,65,0,32,26,192,0,32,31,0,1,1,47,50,1,1,5,57,1,1,15,74,1,1,45,121,1,1,5,112,3,1,3,145,3,32,17,163,3,32,9,0,4,80,16,16,4,32,32,96,4,1,33,138,4,1,53,193,4,1,13,208,4,1,63,20,5,1,19,49,5,48,38,160,1,1,5,179,1,1,3,205,1,1,15,222,1,1,17,248,1,1,39,34,2,1,17,216,3,1,23,0,30,1,149,160,30,1,95,8,31,248,8,24,31,248,6,40,31,248,8,56,31,248,8,72,31,248,6,104,31,248,8,136,31,248,8,152,31,248,8,168,31,248,8,184,31,248,2,186,31,182,2,200,31,170,4,216,31,248,2,218,31,156,2,232,31,248,2,234,31,144,2,248,31,128,2,250,31,130,2,70,2,1,9,16,5,1,3,96,33,16,16,0,44,48,47,103,44,1,5,128,44,1,99,235,44,1,3,64,166,1,45,128,166,1,23,34,167,1,13,50,167,1,61,121,167,1,3,126,167,1,9,144,167,1,3,160,167,1,9,33,255,32,26,0,0,0,0,119,114,97,112,46,99,0,99,111,109,109,111,110,95,97,108,108,111,99,97,116,105,111,110,46,99,0,71,78,85,78,69,84,95,120,109,97,108,108,111,99,95,0,109,97,108,108,111,99,0,71,78,85,78,69,84,95,120,102,114,101,101,95,0,71,78,85,78,69,84,95,115,110,112,114,105,110,116,102,0,99,111,109,109,111,110,95,108,111,103,103,105,110,103,46,99,0,37,115,45,37,100,0,109,121,108,111,103,0,108,111,99,97,108,116,105,109,101,32,101,114,114,111,114,0,37,98,32,37,100,32,37,72,58,37,77,58,37,83,45,37,37,48,54,117,0,42,32,37,115,0,37,115,32,37,115,32,37,115,32,37,115,0,69,82,82,79,82,0,87,65,82,78,73,78,71,0,77,69,83,83,65,71,69,0,73,78,70,79,0,68,69,66,85,71,0,78,79,78,69,0,73,78,86,65,76,73,68,0,77,101,115,115,97,103,101,32,96,37,46,42,115,39,32,114,101,112,101,97,116,101,100,32,37,117,32,116,105,109,101,115,32,105,110,32,116,104,101,32,108,97,115,116,32,37,115,10,0,71,78,85,78,69,84,95,108,111,103,95,115,107,105,112,0,99,114,121,112,116,111,95,115,121,109,109,101,116,114,105,99,46,99,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,115,121,109,109,101,116,114,105,99,95,101,110,99,114,121,112,116,0,115,101,116,117,112,95,99,105,112,104,101,114,95,116,119,111,102,105,115,104,0,115,101,116,117,112,95,99,105,112,104,101,114,95,97,101,115,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,115,121,109,109,101,116,114,105,99,95,100,101,99,114,121,112,116,0,99,114,121,112,116,111,95,101,99,99,46,99,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,99,100,115,97,95,107,101,121,95,103,101,116,95,112,117,98,108,105,99,0,113,64,101,100,100,115,97,0,40,112,114,105,118,97,116,101,45,107,101,121,40,101,99,99,40,99,117,114,118,101,32,34,69,100,50,53,53,49,57,34,41,40,100,32,37,98,41,41,41,0,100,101,99,111,100,101,95,112,114,105,118,97,116,101,95,101,99,100,115,97,95,107,101,121,0,103,99,114,121,95,115,101,120,112,95,98,117,105,108,100,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,100,100,115,97,95,107,101,121,95,103,101,116,95,112,117,98,108,105,99,0,40,112,114,105,118,97,116,101,45,107,101,121,40,101,99,99,40,99,117,114,118,101,32,34,69,100,50,53,53,49,57,34,41,40,102,108,97,103,115,32,101,100,100,115,97,41,40,100,32,37,98,41,41,41,0,100,101,99,111,100,101,95,112,114,105,118,97,116,101,95,101,100,100,115,97,95,107,101,121,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,99,100,104,101,95,107,101,121,95,103,101,116,95,112,117,98,108,105,99,0,100,101,99,111,100,101,95,112,114,105,118,97,116,101,95,101,99,100,104,101,95,107,101,121,0,40,103,101,110,107,101,121,40,101,99,99,40,99,117,114,118,101,32,34,69,100,50,53,53,49,57,34,41,40,102,108,97,103,115,32,101,100,100,115,97,32,110,111,45,107,101,121,116,101,115,116,41,41,41,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,99,100,104,101,95,107,101,121,95,99,114,101,97,116,101,0,103,99,114,121,95,112,107,95,103,101,110,107,101,121,0,107,101,121,95,102,114,111,109,95,115,101,120,112,0,40,103,101,110,107,101,121,40,101,99,99,40,99,117,114,118,101,32,34,69,100,50,53,53,49,57,34,41,40,102,108,97,103,115,41,41,41,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,99,100,115,97,95,107,101,121,95,99,114,101,97,116,101,0,40,103,101,110,107,101,121,40,101,99,99,40,99,117,114,118,101,32,34,69,100,50,53,53,49,57,34,41,40,102,108,97,103,115,32,101,100,100,115,97,41,41,41,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,100,100,115,97,95,107,101,121,95,99,114,101,97,116,101,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,100,100,115,97,95,115,105,103,110,0,69,100,68,83,65,32,115,105,103,110,105,110,103,32,102,97,105,108,101,100,32,97,116,32,37,115,58,37,100,58,32,37,115,10,0,40,100,97,116,97,40,102,108,97,103,115,32,101,100,100,115,97,41,40,104,97,115,104,45,97,108,103,111,32,37,115,41,40,118,97,108,117,101,32,37,98,41,41,0,100,97,116,97,95,116,111,95,101,100,100,115,97,95,118,97,108,117,101,0,40,112,117,98,108,105,99,45,107,101,121,40,101,99,99,40,99,117,114,118,101,32,69,100,50,53,53,49,57,41,40,113,32,37,98,41,41,41,0,40,115,105,103,45,118,97,108,40,101,100,100,115,97,40,114,32,37,98,41,40,115,32,37,98,41,41,41,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,100,100,115,97,95,118,101,114,105,102,121,0,40,112,117,98,108,105,99,45,107,101,121,40,101,99,99,40,99,117,114,118,101,32,69,100,50,53,53,49,57,41,40,102,108,97,103,115,32,101,100,100,115,97,41,40,113,32,37,98,41,41,41,0,69,100,68,83,65,32,115,105,103,110,97,116,117,114,101,32,118,101,114,105,102,105,99,97,116,105,111,110,32,102,97,105,108,101,100,32,97,116,32,37,115,58,37,100,58,32,37,115,10,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,99,99,95,101,99,100,104,0,103,101,116,95,97,102,102,105,110,101,32,102,97,105,108,101,100],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+10240);allocate([71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,99,100,104,95,101,100,100,115,97,0,99,114,121,112,116,111,95,104,97,115,104,46,99,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,104,97,115,104,95,99,111,110,116,101,120,116,95,115,116,97,114,116,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,104,97,115,104,95,99,111,110,116,101,120,116,95,102,105,110,105,115,104,0,99,114,121,112,116,111,95,107,100,102,46,99,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,107,100,102,95,109,111,100,95,109,112,105,0,99,114,121,112,116,111,95,109,112,105,46,99,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,109,112,105,95,112,114,105,110,116,95,117,110,115,105,103,110,101,100,0,96,37,115,39,32,102,97,105,108,101,100,32,97,116,32,37,115,58,37,100,32,119,105,116,104,32,101,114,114,111,114,58,32,37,115,10,0,103,99,114,121,95,109,112,105,95,112,114,105,110,116,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,109,112,105,95,115,99,97,110,95,117,110,115,105,103,110,101,100,0,103,99,114,121,95,109,112,105,95,115,99,97,110,0,49,46,54,46,48,0,108,105,98,103,99,114,121,112,116,32,104,97,115,32,110,111,116,32,116,104,101,32,101,120,112,101,99,116,101,100,32,118,101,114,115,105,111,110,32,40,118,101,114,115,105,111,110,32,37,115,32,105,115,32,114,101,113,117,105,114,101,100,41,46,10,0,99,114,121,112,116,111,95,114,97,110,100,111,109,46,99,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,97,110,100,111,109,95,105,110,105,116,0,70,97,105,108,101,100,32,116,111,32,115,101,116,32,108,105,98,103,99,114,121,112,116,32,111,112,116,105,111,110,32,37,115,58,32,37,115,10,0,68,73,83,65,66,76,69,95,83,69,67,77,69,77,0,69,78,65,66,76,69,95,81,85,73,67,75,95,82,65,78,68,79,77,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,97,110,100,111,109,95,117,51,50,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,97,110,100,111,109,95,98,108,111,99,107,0,40,103,101,110,107,101,121,40,114,115,97,40,110,98,105,116,115,32,37,100,41,41,41,0,99,114,121,112,116,111,95,114,115,97,46,99,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,112,114,105,118,97,116,101,95,107,101,121,95,99,114,101,97,116,101,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,112,114,105,118,97,116,101,95,107,101,121,95,101,110,99,111,100,101,0,117,116,105,108,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,112,114,105,118,97,116,101,95,107,101,121,95,100,101,99,111,100,101,0,68,101,99,111,100,101,100,32,112,114,105,118,97,116,101,32,107,101,121,32,105,115,32,110,111,116,32,118,97,108,105,100,10,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,112,114,105,118,97,116,101,95,107,101,121,95,103,101,116,95,112,117,98,108,105,99,0,69,120,116,101,114,110,97,108,32,112,114,111,116,111,99,111,108,32,118,105,111,108,97,116,105,111,110,32,100,101,116,101,99,116,101,100,32,97,116,32,37,115,58,37,100,46,10,0,40,112,117,98,108,105,99,45,107,101,121,40,114,115,97,40,110,32,37,109,41,40,101,32,37,109,41,41,41,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,112,117,98,108,105,99,95,107,101,121,95,101,110,99,111,100,101,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,112,117,98,108,105,99,95,107,101,121,95,100,101,99,111,100,101,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,115,105,103,110,97,116,117,114,101,95,101,110,99,111,100,101,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,98,108,105,110,100,0,110,117,109,101,114,105,99,95,109,112,105,95,97,108,108,111,99,95,110,95,112,114,105,110,116,0,66,108,105,110,100,105,110,103,32,75,68,70,32,101,120,116,114,97,116,111,114,32,72,77,65,67,32,107,101,121,0,114,115,97,95,98,108,105,110,100,105,110,103,95,107,101,121,95,100,101,114,105,118,101,0,66,108,105,110,100,105,110,103,32,75,68,70,0,114,115,97,95,102,117,108,108,95,100,111,109,97,105,110,95,104,97,115,104,0,82,83,65,45,70,68,65,32,70,84,112,115,87,33,0,40,100,97,116,97,32,40,102,108,97,103,115,32,114,97,119,41,32,40,118,97,108,117,101,32,37,77,41,41,0,109,112,105,95,116,111,95,115,101,120,112,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,115,105,103,110,97,116,117,114,101,95,100,101,99,111,100,101,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,117,110,98,108,105,110,100,0,40,115,105,103,45,118,97,108,32,40,114,115,97,32,40,115,32,37,77,41,41,41,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,118,101,114,105,102,121,0,82,83,65,32,115,105,103,110,97,116,117,114,101,32,118,101,114,105,102,105,99,97,116,105,111,110,32,102,97,105,108,101,100,32,97,116,32,37,115,58,37,100,58,32,37,115,10,0,115,116,114,105,110,103,115,46,99,0,37,108,108,117,32,37,115,0,102,111,114,101,118,101,114,0,109,115,0,109,0,100,97,121,0,100,97,121,115,0,194,181,115,0,48,32,109,115,0,71,78,85,78,69,84,95,83,84,82,73,78,71,83,95,100,97,116,97,95,116,111,95,115,116,114,105,110,103,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,71,72,74,75,77,78,80,81,82,83,84,86,87,88,89,90,0,71,78,85,78,69,84,95,83,84,82,73,78,71,83,95,115,116,114,105,110,103,95,116,111,95,100,97,116,97,0,118,105,115,105,98,105,108,105,116,121,46,99,0,103,99,114,121,95,109,100,95,104,97,115,104,95,98,117,102,102,101,114,0,99,97,108,108,101,100,32,105,110,32,110,111,110,45,111,112,101,114,97,116,105,111,110,97,108,32,115,116,97,116,101,0,103,99,114,121,95,109,100,95,103,101,116,95,97,108,103,111,0,117,115,101,100,32,105,110,32,110,111,110,45,111,112,101,114,97,116,105,111,110,97,108,32,115,116,97,116,101,0,103,99,114,121,95,114,97,110,100,111,109,105,122,101,0,103,99,114,121,95,99,114,101,97,116,101,95,110,111,110,99,101,0,109,105,115,99,46,99,0,95,103,99,114,121,95,102,97,116,97,108,95,101,114,114,111,114,0,10,70,97,116,97,108,32,101,114,114,111,114,58,32,0,70,97,116,97,108,58,32,0,79,104,104,104,104,32,106,101,101,101,101,58,32,0,68,66,71,58,32,0,91,85,110,107,110,111,119,110,32,108,111,103,32,108,101,118,101,108,32,37,100,93,58,32,0,95,103,99,114,121,95,108,111,103,118,0,105,110,116,101,114,110,97,108,32,101,114,114,111,114,32,40,102,97,116,97,108,32,111,114,32,98,117,103,41,0,46,46,46,32,116,104,105,115,32,105,115,32,97,32,98,117,103,32,40,37,115,58,37,100,58,37,115,41,10,0,65,115,115,101,114,116,105,111,110,32,96,37,115,39,32,102,97,105,108,101,100,32,40,37,115,58,37,100,58,37,115,41,10,0,32,0,37,115,58,37,115,0,37,42,115,32,32,0,37,48,50,120,0,32,92,10,0,37,42,115,32,37,42,115,0,32,40,110,117,108,108,41,0,32,91,37,117,32,98,105,116,93,0,32,91,111,117,116,32,111,102,32,99,111,114,101,93,0,45,0,43,0,100,105,118,105,100,101,32,98,121,32,122,101,114,111,0,103,108,111,98,97,108,46,99,0,103,108,111,98,97,108,95,105,110,105,116,0,49,46,55,46,48,45,98,101,116,97,50,51,48,0,118,101,114,115,105,111,110,58,37,115,58,10,0,99,105,112,104,101,114,115,58,37,115,58,10,0,97,101,115,58,116,119,111,102,105,115,104,0,112,117,98,107,101,121,115,58,37,115,58,10,0,114,115,97,58,101,99,99,0,100,105,103,101,115,116,115,58,37,115,58,10,0,115,104,97,50,53,54,58,115,104,97,53,49,50,0,114,110,100,45,109,111,100,58,108,105,110,117,120,58,10,0,99,112,117,45,97,114,99,104,58,58,10,0,109,112,105,45,97,115,109,58,37,115,58,10,0,104,119,102,108,105,115,116,58,0,37,115,58,0,10,0,102,105,112,115,45,109,111,100,101,58,37,99,58,37,99,58,10,0,115,116,97,110,100,97,114,100,0,102,105,112,115,0,115,121,115,116,101,109,0,112,114,105,110,116,95,99,111,110,102,105,103,0,114,110,103,45,116,121,112,101,58,37,115,58,37,100,58,10,0,111,117,116,32,111,102,32,99,111,114,101,32,105,110,32,115,101,99,117,114,101,32,109,101,109,111,114,121,0,92,120,37,48,50,120,0,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,48,49,50,51,52,53,54,55,56,57,45,46,47,95,58,42,43,61,0,115,101,120,112,46,99,0,100,111,95,118,115,101,120,112,95,115,115,99,97,110,0,37,100,0,37,117,0,38,92,0,95,103,99,114,121,95,115,101,120,112,95,102,105,110,100,95,116,111,107,101,110,0,95,103,99,114,121,95,115,101,120,112,95,110,116,104,0,3,4,0,37,117,58,0,95,103,99,114,121,95,115,101,120,112,95,115,112,114,105,110,116,0,37,48,50,88,0,8,9,11,10,12,13,34,39,92,0,45,46,47,95,58,42,43,61,0,112,97,100,108,111,99,107,45,114,110,103,0,112,97,100,108,111,99,107,45,97,101,115,0,112,97,100,108,111,99,107,45,115,104,97,0,112,97,100,108,111,99,107,45,109,109,117,108,0,105,110,116,101,108,45,99,112,117,0,105,110,116,101,108,45,98,109,105,50,0,105,110,116,101,108,45,115,115,115,101,51,0,105,110,116,101,108,45,112,99,108,109,117,108,0,105,110,116,101,108,45,97,101,115,110,105,0,105,110,116,101,108,45,114,100,114,97,110,100,0,105,110,116,101,108,45,97,118,120,0,105,110,116,101,108,45,97,118,120,50,0,97,114,109,45,110,101,111,110,0,47,101,116,99,47,103,99,114,121,112,116,47,104,119,102,46,100,101,110,121,0,109,101,109,111,114,121,32,97,116,32,37,112,32,99,111,114,114,117,112,116,101,100,32,40,117,110,100,101,114,102,108,111,119,61,37,48,50,120,41,10,0,109,101,109,111,114,121,32,97,116,32,37,112,32,99,111,114,114,117,112,116,101,100,32,40,111,118,101,114,102,108,111,119,61,37,48,50,120,41,10,0,87,97,114,110,105,110,103,58,32,117,115,105,110,103,32,105,110,115,101,99,117,114,101,32,109,101,109,111,114,121,33,10,0,102,97,105,108,101,100,32,116,111,32,100,114,111,112,32,115,101,116,117,105,100,10,0,79,111,112,115,44,32,115,101,99,117,114,101,32,109,101,109,111,114,121,32,112,111,111,108,32,97,108,114,101,97,100,121,32,105,110,105,116,105,97,108,105,122,101,100,10,0,80,108,101,97,115,101,32,110,111,116,101,32,116,104,97,116,32,121,111,117,32,100,111,110,39,116,32,104,97,118,101,32,115,101,99,117,114,101,32,109,101,109,111,114,121,32,111,110,32,116,104,105,115,32,115,121,115,116,101,109,10,0,115,101,99,117,114,101,32,109,101,109,111,114,121,32,105,115,32,100,105,115,97,98,108,101,100,0,99,97,110,39,116,32,109,109,97,112,32,112,111,111,108,32,111,102,32,37,117,32,98,121,116,101,115,58,32,37,115,32,45,32,117,115,105,110,103,32,109,97,108,108,111,99,10,0,99,97,110,39,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,112,111,111,108,32,111,102,32,37,117,32,98,121,116,101,115,10,0,111,112,101,114,97,116,105,111,110,32,105,115,32,110,111,116,32,112,111,115,115,105,98,108,101,32,119,105,116,104,111,117,116,32,105,110,105,116,105,97,108,105,122,101,100,32,115,101,99,117,114,101,32,109,101,109,111,114,121,10,0,115,101,99,117,114,101,32,109,101,109,111,114,121,32,112,111,111,108,32,105,115,32,110,111,116,32,108,111,99,107,101,100,32,119,104,105,108,101,32,105,110,32,70,73,80,83,32,109,111,100,101,10,0,115,101,99,109,101,109,32,117,115,97,103,101,58,32,37,117,47,37,108,117,32,98,121,116,101,115,32,105,110,32,37,117,32,98,108,111,99,107,115,10,0,33,100,111,110,101,0,102,105,112,115,46,99,0,95,103,99,114,121,95,105,110,105,116,105,97,108,105,122,101,95,102,105,112,115,95,109,111,100,101,0,33,110,111,95,102,105,112,115,95,109,111,100,101,95,114,101,113,117,105,114,101,100,0,47,101,116,99,47,103,99,114,121,112,116,47,102,105,112,115,95,101,110,97,98,108,101,100,0,47,112,114,111,99,47,115,121,115,47,99,114,121,112,116,111,47,102,105,112,115,95,101,110,97,98,108,101,100,0,114,0,47,112,114,111,99,47,118,101,114,115,105,111,110,0,70,65,84,65,76,58,32,101,114,114,111,114,32,114,101,97,100,105,110,103,32,96,37,115,39,32,105,110,32,108,105,98,103,99,114,121,112,116,58,32,37,115,10,0,70,65,84,65,76,58,32,102,97,105,108,101,100,32,116,111,32,99,114,101,97,116,101,32,116,104,101,32,70,83,77,32,108,111,99,107,32,105,110,32,108,105,98,103,99,114,121,112,116,58,32,37,115,10,0,103,114,97,110,116,101,100,0,100,101,110,105,101,100,0,108,105,98,103,99,114,121,112,116,32,115,116,97,116,101,32,116,114,97,110,115,105,116,105,111,110,32,37,115,32,61,62,32,37,115,32,37,115,10,0,80,111,119,101,114,45,79,110,0,73,110,105,116,0,83,101,108,102,45,84,101,115,116,0,79,112,101,114,97,116,105,111,110,97,108,0,69,114,114,111,114,0,70,97,116,97,108,45,69,114,114,111,114,0,83,104,117,116,100,111,119,110,0,70,65,84,65,76,58,32,102,97,105,108,101,100,32,116,111,32,114,101,108,101,97,115,101,32,116,104,101,32,70,83,77,32,108,111,99,107,32,105,110,32,108,105,98,103,114,121,112,116,58,32,37,115,10,0,70,65,84,65,76,58,32,102,97,105,108,101,100,32,116,111,32,97,99,113,117,105,114,101,32,116,104,101,32,70,83,77,32,108,111,99,107,32,105,110,32,108,105,98,103,114,121,112,116,58,32,37,115,10,0,95,103,99,114,121,95,102,105,112,115,95,109,111,100,101,32,40,41,0,95,103,99,114,121,95,105,110,97,99,116,105,118,97,116,101,95,102,105,112,115,95,109,111,100,101,0,102,97,116,97,108,32,0,44,32,102,117,110,99,116,105,111,110,32,0,110,111,32,100,101,115,99,114,105,112,116,105,111,110,32,97,118,97,105,108,97,98,108,101,0,37,115,101,114,114,111,114,32,105,110,32,108,105,98,103,99,114,121,112,116,44,32,102,105,108,101,32,37,115,44,32,108,105,110,101,32,37,100,37,115,37,115,58,32,37,115,10,0,72,77,65,67,45,0,79,107,97,121,0,32,40,0,108,105,98,103,99,114,121,112,116,32,115,101,108,102,116,101,115,116,58,32,37,115,32,37,115,37,115,32,40,37,100,41,58,32,37,115,37,115,37,115,37,115,10,0,98,97,100,32,99,111,110,116,101,120,116,32,116,121,112,101,32,37,100,32,103,105,118,101,110,32,116,111,32,95,103,99,114,121,95,99,116,120,95,97,108,108,111,99,10,0,99,84,120,0,98,97,100,32,112,111,105,110,116,101,114,32,37,112,32,112,97,115,115,101,100,32,116,111,32,95,103,99,114,121,95,99,116,120,95,103,101,116,95,112,111,105,110,116,101,114,10,0,119,114,111,110,103,32,99,111,110,116,101,120,116,32,116,121,112,101,32,37,100,32,114,101,113,117,101,115,116,32,102,111,114,32,99,111,110,116,101,120,116,32,37,112,32,111,102,32,116,121,112,101,32,37,100,10,0,98,97,100,32,112,111,105,110,116,101,114,32,37,112,32,112,97,115,115,101,100,32,116,111,32,103,99,114,121,95,99,116,120,95,114,101,108,97,115,101,10,0,98,97,100,32,99,111,110,116,101,120,116,32,116,121,112,101,32,37,100,32,100,101,116,101,99,116,101,100,32,105,110,32,103,99,114,121,95,99,116,120,95,114,101,108,97,115,101,10,0,103,99,114,121,95,99,105,112,104,101,114,95,99,108,111,115,101,58,32,97,108,114,101,97,100,121,32,99,108,111,115,101,100,47,105,110,118,97,108,105,100,32,104,97,110,100,108,101,0,99,105,112,104,101,114,46,99,0,99,105,112,104,101,114,95,101,110,99,114,121,112,116,0,99,105,112,104,101,114,32,109,111,100,101,32,78,79,78,69,32,117,115,101,100,0,99,105,112,104,101,114,95,101,110,99,114,121,112,116,58,32,105,110,118,97,108,105,100,32,109,111,100,101,32,37,100,10,0,99,105,112,104,101,114,95,100,101,99,114,121,112,116,0,99,105,112,104,101,114,95,100,101,99,114,121,112,116,58,32,105,110,118,97,108,105,100,32,109,111,100,101,32,37,100,10,0,87,65,82,78,73,78,71,58,32,99,105,112,104,101,114,95,115,101,116,105,118,58,32,105,118,108,101,110,61,37,117,32,98,108,107,108,101,110,61,37,117,10,0,99,105,112,104,101,114,95,115,101,116,105,118,0,73,86,32,108,101,110,103,116,104,32,100,111,101,115,32,110,111,116,32,109,97,116,99,104,32,98,108,111,99,107,108,101,110,103,116,104,0,48,120,55,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,69,68,0,45,48,120,48,49,0,45,48,120,50,68,70,67,57,51,49,49,68,52,57,48,48,49,56,67,55,51,51,56,66,70,56,54,56,56,56,54,49,55,54,55,70,70,56,70,70,53,66,50,66,69,66,69,50,55,53,52,56,65,49,52,66,50,51,53,69,67,65,54,56,55,52,65,0,48,120,49,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,49,52,68,69,70,57,68,69,65,50,70,55,57,67,68,54,53,56,49,50,54,51,49,65,53,67,70,53,68,51,69,68,0,48,120,50,49,54,57,51,54,68,51,67,68,54,69,53,51,70,69,67,48,65,52,69,50,51,49,70,68,68,54,68,67,53,67,54,57,50,67,67,55,54,48,57,53,50,53,65,55,66,50,67,57,53,54,50,68,54,48,56,70,50,53,68,53,49,65,0,48,120,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,53,56,0,48,120,48,56,0,78,73,83,84,32,80,45,49,57,50,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,101,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,101,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,99,0,48,120,54,52,50,49,48,53,49,57,101,53,57,99,56,48,101,55,48,102,97,55,101,57,97,98,55,50,50,52,51,48,52,57,102,101,98,56,100,101,101,99,99,49,52,54,98,57,98,49,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,57,57,100,101,102,56,51,54,49,52,54,98,99,57,98,49,98,52,100,50,50,56,51,49,0,48,120,49,56,56,100,97,56,48,101,98,48,51,48,57,48,102,54,55,99,98,102,50,48,101,98,52,51,97,49,56,56,48,48,102,52,102,102,48,97,102,100,56,50,102,102,49,48,49,50,0,48,120,48,55,49,57,50,98,57,53,102,102,99,56,100,97,55,56,54,51,49,48,49,49,101,100,54,98,50,52,99,100,100,53,55,51,102,57,55,55,97,49,49,101,55,57,52,56,49,49,0,48,120,48,49,0,78,73,83,84,32,80,45,50,50,52,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,49,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,101,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,101,0,48,120,98,52,48,53,48,97,56,53,48,99,48,52,98,51,97,98,102,53,52,49,51,50,53,54,53,48,52,52,98,48,98,55,100,55,98,102,100,56,98,97,50,55,48,98,51,57,52,51,50,51,53,53,102,102,98,52,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,49,54,97,50,101,48,98,56,102,48,51,101,49,51,100,100,50,57,52,53,53,99,53,99,50,97,51,100,0,48,120,98,55,48,101,48,99,98,100,54,98,98,52,98,102,55,102,51,50,49,51,57,48,98,57,52,97,48,51,99,49,100,51,53,54,99,50,49,49,50,50,51,52,51,50,56,48,100,54,49,49,53,99,49,100,50,49,0,48,120,98,100,51,55,54,51,56,56,98,53,102,55,50,51,102,98,52,99,50,50,100,102,101,54,99,100,52,51,55,53,97,48,53,97,48,55,52,55,54,52,52,52,100,53,56,49,57,57,56,53,48,48,55,101,51,52,0,78,73,83,84,32,80,45,50,53,54,0,48,120,102,102,102,102,102,102,102,102,48,48,48,48,48,48,48,49,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,0,48,120,102,102,102,102,102,102,102,102,48,48,48,48,48,48,48,49,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,99,0,48,120,53,97,99,54,51,53,100,56,97,97,51,97,57,51,101,55,98,51,101,98,98,100,53,53,55,54,57,56,56,54,98,99,54,53,49,100,48,54,98,48,99,99,53,51,98,48,102,54,51,98,99,101,51,99,51,101,50,55,100,50,54,48,52,98,0,48,120,102,102,102,102,102,102,102,102,48,48,48,48,48,48,48,48,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,98,99,101,54,102,97,97,100,97,55,49,55,57,101,56,52,102,51,98,57,99,97,99,50,102,99,54,51,50,53,53,49,0,48,120,54,98,49,55,100,49,102,50,101,49,50,99,52,50,52,55,102,56,98,99,101,54,101,53,54,51,97,52,52,48,102,50,55,55,48,51,55,100,56,49,50,100,101,98,51,51,97,48,102,52,97,49,51,57,52,53,100,56,57,56,99,50,57,54,0,48,120,52,102,101,51,52,50,101,50,102,101,49,97,55,102,57,98,56,101,101,55,101,98,52,97,55,99,48,102,57,101,49,54,50,98,99,101,51,51,53,55,54,98,51,49,53,101,99,101,99,98,98,54,52,48,54,56,51,55,98,102,53,49,102,53,0,78,73,83,84,32,80,45,51,56,52,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,101,102,102,102,102,102,102,102,102,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,102,102,102,102,102,102,102,102,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,101,102,102,102,102,102,102,102,102,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,102,102,102,102,102,102,102,99,0,48,120,98,51,51,49,50,102,97,55,101,50,51,101,101,55,101,52,57,56,56,101,48,53,54,98,101,51,102,56,50,100,49,57,49,56,49,100,57,99,54,101,102,101,56,49,52,49,49,50,48,51,49,52,48,56,56,102,53,48,49,51,56,55,53,97,99,54,53,54,51,57,56,100,56,97,50,101,100,49,57,100,50,97,56,53,99,56,101,100,100,51,101,99,50,97,101,102,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,99,55,54,51,52,100,56,49,102,52,51,55,50,100,100,102,53,56,49,97,48,100,98,50,52,56,98,48,97,55,55,97,101,99,101,99,49,57,54,97,99,99,99,53,50,57,55,51,0,48,120,97,97,56,55,99,97,50,50,98,101,56,98,48,53,51,55,56,101,98,49,99,55,49,101,102,51,50,48,97,100,55,52,54,101,49,100,51,98,54,50,56,98,97,55,57,98,57,56,53,57,102,55,52,49,101,48,56,50,53,52,50,97,51,56,53,53,48,50,102,50,53,100,98,102,53,53,50,57,54,99,51,97,53,52,53,101,51,56,55,50,55,54,48,97,98,55,0,48,120,51,54,49,55,100,101,52,97,57,54,50,54,50,99,54,102,53,100,57,101,57,56,98,102,57,50,57,50,100,99,50,57,102,56,102,52,49,100,98,100,50,56,57,97,49,52,55,99,101,57,100,97,51,49,49,51,98,53,102,48,98,56,99,48,48,97,54,48,98,49,99,101,49,100,55,101,56,49,57,100,55,97,52,51,49,100,55,99,57,48,101,97,48,101,53,102,0,78,73,83,84,32,80,45,53,50,49,0,48,120,48,49,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,0,48,120,48,49,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,99,0,48,120,48,53,49,57,53,51,101,98,57,54,49,56,101,49,99,57,97,49,102,57,50,57,97,50,49,97,48,98,54,56,53,52,48,101,101,97,50,100,97,55,50,53,98,57,57,98,51,49,53,102,51,98,56,98,52,56,57,57,49,56,101,102,49,48,57,101,49,53,54,49,57,51,57,53,49,101,99,55,101,57,51,55,98,49,54,53,50,99,48,98,100,51,98,98,49,98,102,48,55,51,53,55,51,100,102,56,56,51,100,50,99,51,52,102,49,101,102,52,53,49,102,100,52,54,98,53,48,51,102,48,48,0,48,120,49,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,97,53,49,56,54,56,55,56,51,98,102,50,102,57,54,54,98,55,102,99,99,48,49,52,56,102,55,48,57,97,53,100,48,51,98,98,53,99,57,98,56,56,57,57,99,52,55,97,101,98,98,54,102,98,55,49,101,57,49,51,56,54,52,48,57,0,48,120,48,48,99,54,56,53,56,101,48,54,98,55,48,52,48,52,101,57,99,100,57,101,51,101,99,98,54,54,50,51,57,53,98,52,52,50,57,99,54,52,56,49,51,57,48,53,51,102,98,53,50,49,102,56,50,56,97,102,54,48,54,98,52,100,51,100,98,97,97,49,52,98,53,101,55,55,101,102,101,55,53,57,50,56,102,101,49,100,99,49,50,55,97,50,102,102,97,56,100,101,51,51,52,56,98,51,99,49,56,53,54,97,52,50,57,98,102,57,55,101,55,101,51,49,99,50,101,53,98,100,54,54,0,48,120,48,49,49,56,51,57,50,57,54,97,55,56,57,97,51,98,99,48,48,52,53,99,56,97,53,102,98,52,50,99,55,100,49,98,100,57,57,56,102,53,52,52,52,57,53,55,57,98,52,52,54,56,49,55,97,102,98,100,49,55,50,55,51,101,54,54,50,99,57,55,101,101,55,50,57,57,53,101,102,52,50,54,52,48,99,53,53,48,98,57,48,49,51,102,97,100,48,55,54,49,51,53,51,99,55,48,56,54,97,50,55,50,99,50,52,48,56,56,98,101,57,52,55,54,57,102,100,49,54,54,53,48,0,98,114,97,105,110,112,111,111,108,80,49,54,48,114,49,0,48,120,101,57,53,101,52,97,53,102,55,51,55,48,53,57,100,99,54,48,100,102,99,55,97,100,57,53,98,51,100,56,49,51,57,53,49,53,54,50,48,102,0,48,120,51,52,48,101,55,98,101,50,97,50,56,48,101,98,55,52,101,50,98,101,54,49,98,97,100,97,55,52,53,100,57,55,101,56,102,55,99,51,48,48,0,48,120,49,101,53,56,57,97,56,53,57,53,52,50,51,52,49,50,49,51,52,102,97,97,50,100,98,100,101,99,57,53,99,56,100,56,54,55,53,101,53,56,0,48,120,101,57,53,101,52,97,53,102,55,51,55,48,53,57,100,99,54,48,100,102,53,57,57,49,100,52,53,48,50,57,52,48,57,101,54,48,102,99,48,57,0,48,120,98,101,100,53,97,102,49,54,101,97,51,102,54,97,52,102,54,50,57,51,56,99,52,54,51,49,101,98,53,97,102,55,98,100,98,99,100,98,99,51,0,48,120,49,54,54,55,99,98,52,55,55,97,49,97,56,101,99,51,51,56,102,57,52,55,52,49,54,54,57,99,57,55,54,51,49,54,100,97,54,51,50,49,0,98,114,97,105,110,112,111,111,108,80,49,57,50,114,49,0,48,120,99,51,48,50,102,52,49,100,57,51,50,97,51,54,99,100,97,55,97,51,52,54,51,48,57,51,100,49,56,100,98,55,56,102,99,101,52,55,54,100,101,49,97,56,54,50,57,55,0,48,120,54,97,57,49,49,55,52,48,55,54,98,49,101,48,101,49,57,99,51,57,99,48,51,49,102,101,56,54,56,53,99,49,99,97,101,48,52,48,101,53,99,54,57,97,50,56,101,102,0,48,120,52,54,57,97,50,56,101,102,55,99,50,56,99,99,97,51,100,99,55,50,49,100,48,52,52,102,52,52,57,54,98,99,99,97,55,101,102,52,49,52,54,102,98,102,50,53,99,57,0,48,120,99,51,48,50,102,52,49,100,57,51,50,97,51,54,99,100,97,55,97,51,52,54,50,102,57,101,57,101,57,49,54,98,53,98,101,56,102,49,48,50,57,97,99,52,97,99,99,49,0,48,120,99,48,97,48,54,52,55,101,97,97,98,54,97,52,56,55,53,51,98,48,51,51,99,53,54,99,98,48,102,48,57,48,48,97,50,102,53,99,52,56,53,51,51,55,53,102,100,54,0,48,120,49,52,98,54,57,48,56,54,54,97,98,100,53,98,98,56,56,98,53,102,52,56,50,56,99,49,52,57,48,48,48,50,101,54,55,55,51,102,97,50,102,97,50,57,57,98,56,102,0,98,114,97,105,110,112,111,111,108,80,50,50,52,114,49,0,48,120,100,55,99,49,51,52,97,97,50,54,52,51,54,54,56,54,50,97,49,56,51,48,50,53,55,53,100,49,100,55,56,55,98,48,57,102,48,55,53,55,57,55,100,97,56,57,102,53,55,101,99,56,99,48,102,102,0,48,120,54,56,97,53,101,54,50,99,97,57,99,101,54,99,49,99,50,57,57,56,48,51,97,54,99,49,53,51,48,98,53,49,52,101,49,56,50,97,100,56,98,48,48,52,50,97,53,57,99,97,100,50,57,102,52,51,0,48,120,50,53,56,48,102,54,51,99,99,102,101,52,52,49,51,56,56,55,48,55,49,51,98,49,97,57,50,51,54,57,101,51,51,101,50,49,51,53,100,50,54,54,100,98,98,51,55,50,51,56,54,99,52,48,48,98,0,48,120,100,55,99,49,51,52,97,97,50,54,52,51,54,54,56,54,50,97,49,56,51,48,50,53,55,53,100,48,102,98,57,56,100,49,49,54,98,99,52,98,54,100,100,101,98,99,97,51,97,53,97,55,57,51,57,102,0,48,120,48,100,57,48,50,57,97,100,50,99,55,101,53,99,102,52,51,52,48,56,50,51,98,50,97,56,55,100,99,54,56,99,57,101,52,99,101,51,49,55,52,99,49,101,54,101,102,100,101,101,49,50,99,48,55,100,0,48,120,53,56,97,97,53,54,102,55,55,50,99,48,55,50,54,102,50,52,99,54,98,56,57,101,52,101,99,100,97,99,50,52,51,53,52,98,57,101,57,57,99,97,97,51,102,54,100,51,55,54,49,52,48,50,99,100,0,98,114,97,105,110,112,111,111,108,80,50,53,54,114,49,0,48,120,97,57,102,98,53,55,100,98,97,49,101,101,97,57,98,99,51,101,54,54,48,97,57,48,57,100,56,51,56,100,55,50,54,101,51,98,102,54,50,51,100,53,50,54,50,48,50,56,50,48,49,51,52,56,49,100,49,102,54,101,53,51,55,55,0,48,120,55,100,53,97,48,57,55,53,102,99,50,99,51,48,53,55,101,101,102,54,55,53,51,48,52,49,55,97,102,102,101,55,102,98,56,48,53,53,99,49,50,54,100,99,53,99,54,99,101,57,52,97,52,98,52,52,102,51,51,48,98,53,100,57,0,48,120,50,54,100,99,53,99,54,99,101,57,52,97,52,98,52,52,102,51,51,48,98,53,100,57,98,98,100,55,55,99,98,102,57,53,56,52,49,54,50,57,53,99,102,55,101,49,99,101,54,98,99,99,100,99,49,56,102,102,56,99,48,55,98,54,0,48,120,97,57,102,98,53,55,100,98,97,49,101,101,97,57,98,99,51,101,54,54,48,97,57,48,57,100,56,51,56,100,55,49,56,99,51,57,55,97,97,51,98,53,54,49,97,54,102,55,57,48,49,101,48,101,56,50,57,55,52,56,53,54,97,55,0,48,120,56,98,100,50,97,101,98,57,99,98,55,101,53,55,99,98,50,99,52,98,52,56,50,102,102,99,56,49,98,55,97,102,98,57,100,101,50,55,101,49,101,51,98,100,50,51,99,50,51,97,52,52,53,51,98,100,57,97,99,101,51,50,54,50,0,48,120,53,52,55,101,102,56,51,53,99,51,100,97,99,52,102,100,57,55,102,56,52,54,49,97,49,52,54,49,49,100,99,57,99,50,55,55,52,53,49,51,50,100,101,100,56,101,53,52,53,99,49,100,53,52,99,55,50,102,48,52,54,57,57,55,0,98,114,97,105,110,112,111,111,108,80,51,50,48,114,49,0,48,120,100,51,53,101,52,55,50,48,51,54,98,99,52,102,98,55,101,49,51,99,55,56,53,101,100,50,48,49,101,48,54,53,102,57,56,102,99,102,97,54,102,54,102,52,48,100,101,102,52,102,57,50,98,57,101,99,55,56,57,51,101,99,50,56,102,99,100,52,49,50,98,49,102,49,98,51,50,101,50,55,0,48,120,51,101,101,51,48,98,53,54,56,102,98,97,98,48,102,56,56,51,99,99,101,98,100,52,54,100,51,102,51,98,98,56,97,50,97,55,51,53,49,51,102,53,101,98,55,57,100,97,54,54,49,57,48,101,98,48,56,53,102,102,97,57,102,52,57,50,102,51,55,53,97,57,55,100,56,54,48,101,98,52,0,48,120,53,50,48,56,56,51,57,52,57,100,102,100,98,99,52,50,100,51,97,100,49,57,56,54,52,48,54,56,56,97,54,102,101,49,51,102,52,49,51,52,57,53,53,52,98,52,57,97,99,99,51,49,100,99,99,100,56,56,52,53,51,57,56,49,54,102,53,101,98,52,97,99,56,102,98,49,102,49,97,54,0,48,120,100,51,53,101,52,55,50,48,51,54,98,99,52,102,98,55,101,49,51,99,55,56,53,101,100,50,48,49,101,48,54,53,102,57,56,102,99,102,97,53,98,54,56,102,49,50,97,51,50,100,52,56,50,101,99,55,101,101,56,54,53,56,101,57,56,54,57,49,53,53,53,98,52,52,99,53,57,51,49,49,0,48,120,52,51,98,100,55,101,57,97,102,98,53,51,100,56,98,56,53,50,56,57,98,99,99,52,56,101,101,53,98,102,101,54,102,50,48,49,51,55,100,49,48,97,48,56,55,101,98,54,101,55,56,55,49,101,50,97,49,48,97,53,57,57,99,55,49,48,97,102,56,100,48,100,51,57,101,50,48,54,49,49,0,48,120,49,52,102,100,100,48,53,53,52,53,101,99,49,99,99,56,97,98,52,48,57,51,50,52,55,102,55,55,50,55,53,101,48,55,52,51,102,102,101,100,49,49,55,49,56,50,101,97,97,57,99,55,55,56,55,55,97,97,97,99,54,97,99,55,100,51,53,50,52,53,100,49,54,57,50,101,56,101,101,49,0,98,114,97,105,110,112,111,111,108,80,51,56,52,114,49,0,48,120,56,99,98,57,49,101,56,50,97,51,51,56,54,100,50,56,48,102,53,100,54,102,55,101,53,48,101,54,52,49,100,102,49,53,50,102,55,49,48,57,101,100,53,52,53,54,98,52,49,50,98,49,100,97,49,57,55,102,98,55,49,49,50,51,97,99,100,51,97,55,50,57,57,48,49,100,49,97,55,49,56,55,52,55,48,48,49,51,51,49,48,55,101,99,53,51,0,48,120,55,98,99,51,56,50,99,54,51,100,56,99,49,53,48,99,51,99,55,50,48,56,48,97,99,101,48,53,97,102,97,48,99,50,98,101,97,50,56,101,52,102,98,50,50,55,56,55,49,51,57,49,54,53,101,102,98,97,57,49,102,57,48,102,56,97,97,53,56,49,52,97,53,48,51,97,100,52,101,98,48,52,97,56,99,55,100,100,50,50,99,101,50,56,50,54,0,48,120,48,52,97,56,99,55,100,100,50,50,99,101,50,56,50,54,56,98,51,57,98,53,53,52,49,54,102,48,52,52,55,99,50,102,98,55,55,100,101,49,48,55,100,99,100,50,97,54,50,101,56,56,48,101,97,53,51,101,101,98,54,50,100,53,55,99,98,52,51,57,48,50,57,53,100,98,99,57,57,52,51,97,98,55,56,54,57,54,102,97,53,48,52,99,49,49,0,48,120,56,99,98,57,49,101,56,50,97,51,51,56,54,100,50,56,48,102,53,100,54,102,55,101,53,48,101,54,52,49,100,102,49,53,50,102,55,49,48,57,101,100,53,52,53,54,98,51,49,102,49,54,54,101,54,99,97,99,48,52,50,53,97,55,99,102,51,97,98,54,97,102,54,98,55,102,99,51,49,48,51,98,56,56,51,50,48,50,101,57,48,52,54,53,54,53,0,48,120,49,100,49,99,54,52,102,48,54,56,99,102,52,53,102,102,97,50,97,54,51,97,56,49,98,55,99,49,51,102,54,98,56,56,52,55,97,51,101,55,55,101,102,49,52,102,101,51,100,98,55,102,99,97,102,101,48,99,98,100,49,48,101,56,101,56,50,54,101,48,51,52,51,54,100,54,52,54,97,97,101,102,56,55,98,50,101,50,52,55,100,52,97,102,49,101,0,48,120,56,97,98,101,49,100,55,53,50,48,102,57,99,50,97,52,53,99,98,49,101,98,56,101,57,53,99,102,100,53,53,50,54,50,98,55,48,98,50,57,102,101,101,99,53,56,54,52,101,49,57,99,48,53,52,102,102,57,57,49,50,57,50,56,48,101,52,54,52,54,50,49,55,55,57,49,56,49,49,49,52,50,56,50,48,51,52,49,50,54,51,99,53,51,49,53,0,98,114,97,105,110,112,111,111,108,80,53,49,50,114,49,0,48,120,97,97,100,100,57,100,98,56,100,98,101,57,99,52,56,98,51,102,100,52,101,54,97,101,51,51,99,57,102,99,48,55,99,98,51,48,56,100,98,51,98,51,99,57,100,50,48,101,100,54,54,51,57,99,99,97,55,48,51,51,48,56,55,49,55,100,52,100,57,98,48,48,57,98,99,54,54,56,52,50,97,101,99,100,97,49,50,97,101,54,97,51,56,48,101,54,50,56,56,49,102,102,50,102,50,100,56,50,99,54,56,53,50,56,97,97,54,48,53,54,53,56,51,97,52,56,102,51,0,48,120,55,56,51,48,97,51,51,49,56,98,54,48,51,98,56,57,101,50,51,50,55,49,52,53,97,99,50,51,52,99,99,53,57,52,99,98,100,100,56,100,51,100,102,57,49,54,49,48,97,56,51,52,52,49,99,97,101,97,57,56,54,51,98,99,50,100,101,100,53,100,53,97,97,56,50,53,51,97,97,49,48,97,50,101,102,49,99,57,56,98,57,97,99,56,98,53,55,102,49,49,49,55,97,55,50,98,102,50,99,55,98,57,101,55,99,49,97,99,52,100,55,55,102,99,57,52,99,97,0,48,120,51,100,102,57,49,54,49,48,97,56,51,52,52,49,99,97,101,97,57,56,54,51,98,99,50,100,101,100,53,100,53,97,97,56,50,53,51,97,97,49,48,97,50,101,102,49,99,57,56,98,57,97,99,56,98,53,55,102,49,49,49,55,97,55,50,98,102,50,99,55,98,57,101,55,99,49,97,99,52,100,55,55,102,99,57,52,99,97,100,99,48,56,51,101,54,55,57,56,52,48,53,48,98,55,53,101,98,97,101,53,100,100,50,56,48,57,98,100,54,51,56,48,49,54,102,55,50,51,0,48,120,97,97,100,100,57,100,98,56,100,98,101,57,99,52,56,98,51,102,100,52,101,54,97,101,51,51,99,57,102,99,48,55,99,98,51,48,56,100,98,51,98,51,99,57,100,50,48,101,100,54,54,51,57,99,99,97,55,48,51,51,48,56,55,48,53,53,51,101,53,99,52,49,52,99,97,57,50,54,49,57,52,49,56,54,54,49,49,57,55,102,97,99,49,48,52,55,49,100,98,49,100,51,56,49,48,56,53,100,100,97,100,100,98,53,56,55,57,54,56,50,57,99,97,57,48,48,54,57,0,48,120,56,49,97,101,101,52,98,100,100,56,50,101,100,57,54,52,53,97,50,49,51,50,50,101,57,99,52,99,54,97,57,51,56,53,101,100,57,102,55,48,98,53,100,57,49,54,99,49,98,52,51,98,54,50,101,101,102,52,100,48,48,57,56,101,102,102,51,98,49,102,55,56,101,50,100,48,100,52,56,100,53,48,100,49,54,56,55,98,57,51,98,57,55,100,53,102,55,99,54,100,53,48,52,55,52,48,54,97,53,101,54,56,56,98,51,53,50,50,48,57,98,99,98,57,102,56,50,50],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+20480);allocate([48,120,55,100,100,101,51,56,53,100,53,54,54,51,51,50,101,99,99,48,101,97,98,102,97,57,99,102,55,56,50,50,102,100,102,50,48,57,102,55,48,48,50,52,97,53,55,98,49,97,97,48,48,48,99,53,53,98,56,56,49,102,56,49,49,49,98,50,100,99,100,101,52,57,52,97,53,102,52,56,53,101,53,98,99,97,52,98,100,56,56,97,50,55,54,51,97,101,100,49,99,97,50,98,50,102,97,56,102,48,53,52,48,54,55,56,99,100,49,101,48,102,51,97,100,56,48,56,57,50,0,71,79,83,84,50,48,48,49,45,116,101,115,116,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,52,51,49,0,48,120,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,55,0,48,120,53,102,98,102,102,52,57,56,97,97,57,51,56,99,101,55,51,57,98,56,101,48,50,50,102,98,97,102,101,102,52,48,53,54,51,102,54,101,54,97,51,52,55,50,102,99,50,97,53,49,52,99,48,99,101,57,100,97,101,50,51,98,55,101,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,49,53,48,102,101,56,97,49,56,57,50,57,55,54,49,53,52,99,53,57,99,102,99,49,57,51,97,99,99,102,53,98,51,0,48,120,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,50,0,48,120,48,56,101,50,97,56,97,48,101,54,53,49,52,55,100,52,98,100,54,51,49,54,48,51,48,101,49,54,100,49,57,99,56,53,99,57,55,102,48,97,57,99,97,50,54,55,49,50,50,98,57,54,97,98,98,99,101,97,55,101,56,102,99,56,0,71,79,83,84,50,48,48,49,45,67,114,121,112,116,111,80,114,111,45,65,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,100,57,55,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,100,57,52,0,48,120,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,97,54,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,54,99,54,49,49,48,55,48,57,57,53,97,100,49,48,48,52,53,56,52,49,98,48,57,98,55,54,49,98,56,57,51,0,48,120,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,49,0,48,120,56,100,57,49,101,52,55,49,101,48,57,56,57,99,100,97,50,55,100,102,53,48,53,97,52,53,51,102,50,98,55,54,51,53,50,57,52,102,50,100,100,102,50,51,101,51,98,49,50,50,97,99,99,57,57,99,57,101,57,102,49,101,49,52,0,71,79,83,84,50,48,48,49,45,67,114,121,112,116,111,80,114,111,45,66,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,99,57,57,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,99,57,54,0,48,120,51,101,49,97,102,52,49,57,97,50,54,57,97,53,102,56,54,54,97,55,100,51,99,50,53,99,51,100,102,56,48,97,101,57,55,57,50,53,57,51,55,51,102,102,50,98,49,56,50,102,52,57,100,52,99,101,55,101,49,98,98,99,56,98,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,49,53,102,55,48,48,99,102,102,102,49,97,54,50,52,101,53,101,52,57,55,49,54,49,98,99,99,56,97,49,57,56,102,0,48,120,51,102,97,56,49,50,52,51,53,57,102,57,54,54,56,48,98,56,51,100,49,99,51,101,98,50,99,48,55,48,101,53,99,53,52,53,99,57,56,53,56,100,48,51,101,99,102,98,55,52,52,98,102,56,100,55,49,55,55,49,55,101,102,99,0,71,79,83,84,50,48,48,49,45,67,114,121,112,116,111,80,114,111,45,67,0,48,120,57,98,57,102,54,48,53,102,53,97,56,53,56,49,48,55,97,98,49,101,99,56,53,101,54,98,52,49,99,56,97,97,99,102,56,52,54,101,56,54,55,56,57,48,53,49,100,51,55,57,57,56,102,55,98,57,48,50,50,100,55,53,57,98,0,48,120,57,98,57,102,54,48,53,102,53,97,56,53,56,49,48,55,97,98,49,101,99,56,53,101,54,98,52,49,99,56,97,97,99,102,56,52,54,101,56,54,55,56,57,48,53,49,100,51,55,57,57,56,102,55,98,57,48,50,50,100,55,53,57,56,0,48,120,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,56,48,53,97,0,48,120,57,98,57,102,54,48,53,102,53,97,56,53,56,49,48,55,97,98,49,101,99,56,53,101,54,98,52,49,99,56,97,97,53,56,50,99,97,51,53,49,49,101,100,100,102,98,55,52,102,48,50,102,51,97,54,53,57,56,57,56,48,98,98,57,0,48,120,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,0,48,120,52,49,101,99,101,53,53,55,52,51,55,49,49,97,56,99,51,99,98,102,51,55,56,51,99,100,48,56,99,48,101,101,52,100,52,100,99,52,52,48,100,52,54,52,49,97,56,102,51,54,54,101,53,53,48,100,102,100,98,51,98,98,54,55,0,71,79,83,84,50,48,49,50,45,116,101,115,116,0,48,120,52,53,51,49,97,99,100,49,102,101,48,48,50,51,99,55,53,53,48,100,50,54,55,98,54,98,50,102,101,101,56,48,57,50,50,98,49,52,98,50,102,102,98,57,48,102,48,52,100,52,101,98,55,99,48,57,98,53,100,50,100,49,53,100,102,49,100,56,53,50,55,52,49,97,102,52,55,48,52,97,48,52,53,56,48,52,55,101,56,48,101,52,53,52,54,100,51,53,98,56,51,51,54,102,97,99,50,50,52,100,100,56,49,54,54,52,98,98,102,53,50,56,98,101,54,51,55,51,0,48,120,49,99,102,102,48,56,48,54,97,51,49,49,49,54,100,97,50,57,100,56,99,102,97,53,52,101,53,55,101,98,55,52,56,98,99,53,102,51,55,55,101,52,57,52,48,48,102,100,100,55,56,56,98,54,52,57,101,99,97,49,97,99,52,51,54,49,56,51,52,48,49,51,98,50,97,100,55,51,50,50,52,56,48,97,56,57,99,97,53,56,101,48,99,102,55,52,98,99,57,101,53,52,48,99,50,97,100,100,54,56,57,55,102,97,100,48,97,51,48,56,52,102,51,48,50,97,100,99,0,48,120,52,53,51,49,97,99,100,49,102,101,48,48,50,51,99,55,53,53,48,100,50,54,55,98,54,98,50,102,101,101,56,48,57,50,50,98,49,52,98,50,102,102,98,57,48,102,48,52,100,52,101,98,55,99,48,57,98,53,100,50,100,49,53,100,97,56,50,102,50,100,55,101,99,98,49,100,98,97,99,55,49,57,57,48,53,99,53,101,101,99,99,52,50,51,102,49,100,56,54,101,50,53,101,100,98,101,50,51,99,53,57,53,100,54,52,52,97,97,102,49,56,55,101,54,101,54,100,102,0,48,120,50,52,100,49,57,99,99,54,52,53,55,50,101,101,51,48,102,51,57,54,98,102,54,101,98,98,102,100,55,97,54,99,53,50,49,51,98,51,98,51,100,55,48,53,55,99,99,56,50,53,102,57,49,48,57,51,97,54,56,99,100,55,54,50,102,100,54,48,54,49,49,50,54,50,99,100,56,51,56,100,99,54,98,54,48,97,97,55,101,101,101,56,48,52,101,50,56,98,99,56,52,57,57,55,55,102,97,99,51,51,98,52,98,53,51,48,102,49,98,49,50,48,50,52,56,97,57,97,0,48,120,50,98,98,51,49,50,97,52,51,98,100,50,99,101,54,101,48,100,48,50,48,54,49,51,99,56,53,55,97,99,100,100,99,102,98,102,48,54,49,101,57,49,101,53,102,50,99,51,102,51,50,52,52,55,99,50,53,57,102,51,57,98,50,99,56,51,97,98,49,53,54,100,55,55,102,49,52,57,54,98,102,55,101,98,51,51,53,49,101,49,101,101,52,101,52,51,100,99,49,97,49,56,98,57,49,98,50,52,54,52,48,98,54,100,98,98,57,50,99,98,49,97,100,100,51,55,49,101,0,71,79,83,84,50,48,49,50,45,116,99,50,54,45,65,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,100,99,55,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,100,99,52,0,48,120,101,56,99,50,53,48,53,100,101,100,102,99,56,54,100,100,99,49,98,100,48,98,50,98,54,54,54,55,102,49,100,97,51,52,98,56,50,53,55,52,55,54,49,99,98,48,101,56,55,57,98,100,48,56,49,99,102,100,48,98,54,50,54,53,101,101,51,99,98,48,57,48,102,51,48,100,50,55,54,49,52,99,98,52,53,55,52,48,49,48,100,97,57,48,100,100,56,54,50,101,102,57,100,52,101,98,101,101,52,55,54,49,53,48,51,49,57,48,55,56,53,97,55,49,99,55,54,48,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,50,55,101,54,57,53,51,50,102,52,56,100,56,57,49,49,54,102,102,50,50,98,56,100,52,101,48,53,54,48,54,48,57,98,52,98,51,56,97,98,102,97,100,50,98,56,53,100,99,97,99,100,98,49,52,49,49,102,49,48,98,50,55,53,0,48,120,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,51,0,48,120,55,53,48,51,99,102,101,56,55,97,56,51,54,97,101,51,97,54,49,98,56,56,49,54,101,50,53,52,53,48,101,54,99,101,53,101,49,99,57,51,97,99,102,49,97,98,99,49,55,55,56,48,54,52,102,100,99,98,101,102,97,57,50,49,100,102,49,54,50,54,98,101,52,102,100,48,51,54,101,57,51,100,55,53,101,54,97,53,48,101,51,97,52,49,101,57,56,48,50,56,102,101,53,102,99,50,51,53,102,53,98,56,56,57,97,53,56,57,99,98,53,50,49,53,102,50,97,52,0,71,79,83,84,50,48,49,50,45,116,99,50,54,45,66,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,54,102,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,54,99,0,48,120,54,56,55,100,49,98,52,53,57,100,99,56,52,49,52,53,55,101,51,101,48,54,99,102,54,102,53,101,50,53,49,55,98,57,55,99,55,100,54,49,52,97,102,49,51,56,98,99,98,102,56,53,100,99,56,48,54,99,52,98,50,56,57,102,51,101,57,54,53,100,50,100,98,49,52,49,54,100,50,49,55,102,56,98,50,55,54,102,97,100,49,97,98,54,57,99,53,48,102,55,56,98,101,101,49,102,97,51,49,48,54,101,102,98,56,99,99,98,99,55,99,53,49,52,48,49,49,54,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,49,52,57,97,49,101,99,49,52,50,53,54,53,97,53,52,53,97,99,102,100,98,55,55,98,100,57,100,52,48,99,102,97,56,98,57,57,54,55,49,50,49,48,49,98,101,97,48,101,99,54,51,52,54,99,53,52,51,55,52,102,50,53,98,100,0,48,120,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,50,0,48,120,49,97,56,102,55,101,100,97,51,56,57,98,48,57,52,99,50,99,48,55,49,101,51,54,52,55,97,56,57,52,48,102,51,99,49,50,51,98,54,57,55,53,55,56,99,50,49,51,98,101,54,100,100,57,101,54,99,56,101,99,55,51,51,53,100,99,98,50,50,56,102,100,49,101,100,102,52,97,51,57,49,53,50,99,98,99,97,97,102,56,99,48,51,57,56,56,50,56,48,52,49,48,53,53,102,57,52,99,101,101,101,99,55,101,50,49,51,52,48,55,56,48,102,101,52,49,98,100,0,115,101,99,112,50,53,54,107,49,0,48,120,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,69,70,70,70,70,70,67,50,70,0,48,120,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,69,66,65,65,69,68,67,69,54,65,70,52,56,65,48,51,66,66,70,68,50,53,69,56,67,68,48,51,54,52,49,52,49,0,48,120,55,57,66,69,54,54,55,69,70,57,68,67,66,66,65,67,53,53,65,48,54,50,57,53,67,69,56,55,48,66,48,55,48,50,57,66,70,67,68,66,50,68,67,69,50,56,68,57,53,57,70,50,56,49,53,66,49,54,70,56,49,55,57,56,0,48,120,52,56,51,65,68,65,55,55,50,54,65,51,67,52,54,53,53,68,65,52,70,66,70,67,48,69,49,49,48,56,65,56,70,68,49,55,66,52,52,56,65,54,56,53,53,52,49,57,57,67,52,55,68,48,56,70,70,66,49,48,68,52,66,56,0,49,46,51,46,54,46,49,46,52,46,49,46,49,49,53,57,49,46,49,53,46,49,0,49,46,50,46,56,52,48,46,49,48,48,52,53,46,51,46,49,46,49,0,112,114,105,109,101,49,57,50,118,49,0,115,101,99,112,49,57,50,114,49,0,110,105,115,116,112,49,57,50,0,115,101,99,112,50,50,52,114,49,0,49,46,51,46,49,51,50,46,48,46,51,51,0,110,105,115,116,112,50,50,52,0,49,46,50,46,56,52,48,46,49,48,48,52,53,46,51,46,49,46,55,0,112,114,105,109,101,50,53,54,118,49,0,115,101,99,112,50,53,54,114,49,0,110,105,115,116,112,50,53,54,0,115,101,99,112,51,56,52,114,49,0,49,46,51,46,49,51,50,46,48,46,51,52,0,110,105,115,116,112,51,56,52,0,115,101,99,112,53,50,49,114,49,0,49,46,51,46,49,51,50,46,48,46,51,53,0,110,105,115,116,112,53,50,49,0,49,46,51,46,51,54,46,51,46,51,46,50,46,56,46,49,46,49,46,49,0,49,46,51,46,51,54,46,51,46,51,46,50,46,56,46,49,46,49,46,51,0,49,46,51,46,51,54,46,51,46,51,46,50,46,56,46,49,46,49,46,53,0,49,46,51,46,51,54,46,51,46,51,46,50,46,56,46,49,46,49,46,55,0,49,46,51,46,51,54,46,51,46,51,46,50,46,56,46,49,46,49,46,57,0,49,46,51,46,51,54,46,51,46,51,46,50,46,56,46,49,46,49,46,49,49,0,49,46,51,46,51,54,46,51,46,51,46,50,46,56,46,49,46,49,46,49,51,0,49,46,50,46,54,52,51,46,50,46,50,46,51,53,46,48,0,49,46,50,46,54,52,51,46,50,46,50,46,51,53,46,49,0,49,46,50,46,54,52,51,46,50,46,50,46,51,53,46,50,0,49,46,50,46,54,52,51,46,50,46,50,46,51,53,46,51,0,71,79,83,84,50,48,48,49,45,67,114,121,112,116,111,80,114,111,45,88,99,104,65,0,71,79,83,84,50,48,48,49,45,67,114,121,112,116,111,80,114,111,45,88,99,104,66,0,49,46,50,46,54,52,51,46,50,46,50,46,51,54,46,48,0,49,46,50,46,54,52,51,46,50,46,50,46,51,54,46,49,0,49,46,50,46,54,52,51,46,55,46,49,46,50,46,49,46,50,46,49,0,49,46,50,46,54,52,51,46,55,46,49,46,50,46,49,46,50,46,50,0,49,46,51,46,49,51,50,46,48,46,49,48,0,48,120,48,52,0,45,112,97,98,103,110,104,0,98,0,103,0,104,0,100,0,46,120,0,46,121,0,46,122,0,101,99,99,32,103,101,116,32,112,97,114,97,109,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,10,0,40,112,117,98,108,105,99,45,107,101,121,40,101,99,99,40,112,37,109,41,40,97,37,109,41,40,98,37,109,41,40,103,37,109,41,40,110,37,109,41,40,104,37,109,41,41,41,0,103,46,120,0,103,46,121,0,113,46,120,0,113,46,121,0,101,100,100,115,97,95,101,110,99,111,100,101,112,111,105,110,116,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,10,0,48,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,68,0,50,66,56,51,50,52,56,48,52,70,67,49,68,70,48,66,50,66,52,68,48,48,57,57,51,68,70,66,68,55,65,55,50,70,52,51,49,56,48,54,65,68,50,70,69,52,55,56,67,52,69,69,49,66,50,55,52,65,48,69,65,48,66,48,0,115,99,97,110,110,105,110,103,32,69,67,67,32,112,97,114,97,109,101,116,101,114,32,102,97,105,108,101,100,58,32,37,115,10,0,101,99,103,101,110,32,32,32,32,32,32,112,107,0,42,32,101,95,112,107,0,32,32,101,95,112,107,0,32,32,32,32,32,109,0,32,32,32,114,0,32,32,32,101,95,114,0,32,72,40,82,43,41,0,32,32,32,101,95,115,0,87,101,105,101,114,115,116,114,97,115,115,0,69,100,119,97,114,100,115,0,83,116,97,110,100,97,114,100,0,69,100,50,53,53,49,57,0,109,112,105,95,112,114,105,110,116,32,102,97,105,108,101,100,58,32,37,115,10,0,109,112,105,95,115,99,97,110,32,102,97,105,108,101,100,58,32,37,115,10,0,104,109,97,99,0,97,108,103,111,114,105,116,104,109,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,105,110,118,97,108,105,100,32,116,101,115,116,115,32,100,97,116,97,0,103,99,114,121,95,109,100,95,115,101,116,107,101,121,32,102,97,105,108,101,100,0,103,99,114,121,95,109,100,95,114,101,97,100,32,102,97,105,108,101,100,0,100,111,101,115,32,110,111,116,32,109,97,116,99,104,0,100,97,116,97,45,50,56,32,107,101,121,45,52,0,119,104,97,116,32,100,111,32,121,97,32,119,97,110,116,32,102,111,114,32,110,111,116,104,105,110,103,63,0,74,101,102,101,0,100,97,116,97,45,57,32,107,101,121,45,50,48,0,72,105,32,84,104,101,114,101,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,100,97,116,97,45,53,48,32,107,101,121,45,50,48,0,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,0,100,97,116,97,45,53,48,32,107,101,121,45,50,54,0,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,0,100,97,116,97,45,53,52,32,107,101,121,45,49,51,49,0,84,101,115,116,32,85,115,105,110,103,32,76,97,114,103,101,114,32,84,104,97,110,32,66,108,111,99,107,45,83,105,122,101,32,75,101,121,32,45,32,72,97,115,104,32,75,101,121,32,70,105,114,115,116,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,0,100,97,116,97,45,49,53,50,32,107,101,121,45,49,51,49,0,84,104,105,115,32,105,115,32,97,32,116,101,115,116,32,117,115,105,110,103,32,97,32,108,97,114,103,101,114,32,116,104,97,110,32,98,108,111,99,107,45,115,105,122,101,32,107,101,121,32,97,110,100,32,97,32,108,97,114,103,101,114,32,116,104,97,110,32,98,108,111,99,107,45,115,105,122,101,32,100,97,116,97,46,32,84,104,101,32,107,101,121,32,110,101,101,100,115,32,116,111,32,98,101,32,104,97,115,104,101,100,32,98,101,102,111,114,101,32,98,101,105,110,103,32,117,115,101,100,32,98,121,32,116,104,101,32,72,77,65,67,32,97,108,103,111,114,105,116,104,109,46,0,95,103,99,114,121,95,104,109,97,99,50,53,54,95,110,101,119,32,102,97,105,108,101,100,0,95,103,99,114,121,95,104,109,97,99,50,53,54,95,102,105,110,97,108,105,122,101,32,102,97,105,108,101,100,0,100,111,101,115,32,110,111,116,32,109,97,116,99,104,32,105,110,32,115,101,99,111,110,100,32,105,109,112,108,101,109,101,110,116,97,116,105,111,110,0,70,73,80,83,45,49,57,56,97,44,32,65,46,49,0,83,97,109,112,108,101,32,35,49,0,79,76,163,213,214,139,167,204,10,18,8,201,198,30,156,93,160,64,60,10,0,70,73,80,83,45,49,57,56,97,44,32,65,46,50,0,83,97,109,112,108,101,32,35,50,0,9,34,211,64,95,170,61,25,79,130,164,88,48,115,125,92,198,199,93,36,0,70,73,80,83,45,49,57,56,97,44,32,65,46,51,0,83,97,109,112,108,101,32,35,51,0,188,244,30,171,139,178,216,2,243,208,92,175,124,176,146,236,248,209,163,170,0,70,73,80,83,45,49,57,56,97,44,32,65,46,52,0,83,97,109,112,108,101,32,35,52,0,158,168,134,239,226,104,219,236,206,66,12,117,36,223,50,224,117,26,42,38,0,111,105,100,46,0,79,73,68,46,0,109,100,95,101,110,97,98,108,101,58,32,97,108,103,111,114,105,116,104,109,32,37,100,32,110,111,116,32,97,118,97,105,108,97,98,108,101,10,0,77,68,53,32,117,115,101,100,0,109,100,46,99,0,109,100,95,119,114,105,116,101,0,79,111,112,115,58,32,109,100,32,100,101,98,117,103,32,97,108,114,101,97,100,121,32,115,116,97,114,116,101,100,10,0,100,98,103,109,100,45,37,48,53,100,46,37,46,49,48,115,0,119,0,109,100,32,100,101,98,117,103,58,32,99,97,110,39,116,32,111,112,101,110,32,37,115,10,0,109,111,114,101,32,116,104,97,110,32,111,110,101,32,97,108,103,111,114,105,116,104,109,32,105,110,32,109,100,95,114,101,97,100,40,48,41,10,0,109,100,95,114,101,97,100,0,109,100,95,103,101,116,95,97,108,103,111,0,112,111,115,115,105,98,108,101,32,117,115,97,103,101,32,101,114,114,111,114,0,87,65,82,78,73,78,71,58,32,109,111,114,101,32,116,104,97,110,32,111,110,101,32,97,108,103,111,114,105,116,104,109,32,105,110,32,109,100,95,103,101,116,95,97,108,103,111,40,41,10,0,107,101,121,108,101,110,32,60,61,32,104,100,45,62,99,116,120,45,62,109,97,99,112,97,100,115,95,66,115,105,122,101,0,112,114,101,112,97,114,101,95,109,97,99,112,97,100,115,0,103,99,114,121,95,109,100,95,111,112,101,110,32,102,97,105,108,101,100,32,102,111,114,32,97,108,103,111,32,37,100,58,32,37,115,0,110,111,32,65,83,78,46,49,32,79,73,68,32,102,111,114,32,109,100,32,97,108,103,111,32,37,100,10,0,112,114,105,109,101,103,101,110,0,99,97,110,39,116,32,103,101,110,101,114,97,116,101,32,97,32,112,114,105,109,101,32,119,105,116,104,32,108,101,115,115,32,116,104,97,110,32,37,100,32,98,105,116,115,10,0,111,118,101,114,102,108,111,119,32,105,110,32,112,114,105,109,101,32,103,101,110,101,114,97,116,105,111,110,10,0,95,103,99,114,121,95,109,112,105,95,99,109,112,40,32,40,120,41,44,32,40,110,109,105,110,117,115,49,41,32,41,32,60,32,48,32,38,38,32,95,103,99,114,121,95,109,112,105,95,99,109,112,95,117,105,40,32,40,120,41,44,32,40,49,41,32,41,32,62,32,48,0,112,114,105,109,101,103,101,110,46,99,0,105,115,95,112,114,105,109,101,0,112,115,115,0,114,97,119,0,99,111,109,112,0,111,97,101,112,0,112,107,99,115,49,0,112,97,114,97,109,0,110,111,99,111,109,112,0,114,102,99,54,57,55,57,0,110,111,112,97,114,97,109,0,112,107,99,115,49,45,114,97,119,0,105,103,110,105,110,118,102,108,97,103,0,110,111,45,107,101,121,116,101,115,116,0,110,111,45,98,108,105,110,100,105,110,103,0,117,115,101,45,102,105,112,115,49,56,54,0,117,115,101,45,102,105,112,115,49,56,54,45,50,0,110,98,105,116,115,0,114,115,97,45,117,115,101,45,101,0,115,105,103,45,118,97,108,0,104,97,115,104,45,97,108,103,111,0,108,97,98,101,108,0,114,97,110,100,111,109,45,111,118,101,114,114,105,100,101,0,115,104,97,49,0,109,100,53,0,115,104,97,50,53,54,0,114,105,112,101,109,100,49,54,48,0,114,109,100,49,54,48,0,115,104,97,51,56,52,0,115,104,97,53,49,50,0,115,104,97,50,50,52,0,109,100,50,0,109,100,52,0,116,105,103,101,114,0,104,97,118,97,108,0,100,97,116,97,0,104,97,115,104,0,115,97,108,116,45,108,101,110,103,116,104,0,63,0,112,114,105,118,97,116,101,45,107,101,121,0,112,117,98,108,105,99,45,107,101,121,0,103,101,110,107,101,121,0,97,108,103,111,114,105,116,104,109,32,100,105,115,97,98,108,101,100,0,97,108,103,111,114,105,116,104,109,32,110,111,116,32,102,111,117,110,100,0,110,111,32,115,101,108,102,116,101,115,116,32,97,118,97,105,108,97,98,108,101,0,109,111,100,117,108,101,0,65,69,83,0,99,105,112,104,101,114,0,8,9,10,11,13,14,15,16,18,19,20,21,23,24,25,26,28,29,30,31,33,34,35,36,38,39,40,41,43,44,45,46,6,154,0,127,199,106,69,159,152,186,249,23,254,223,149,33,8,14,149,23,235,22,119,113,154,207,114,128,134,4,10,227,65,69,83,45,50,53,54,32,116,101,115,116,32,101,110,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,65,69,83,45,50,53,54,32,116,101,115,116,32,100,101,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,4,5,6,7,9,10,11,12,14,15,16,17,19,20,21,22,24,25,26,27,29,30,31,32,118,119,116,117,241,242,243,244,248,249,230,231,119,112,113,114,93,30,242,13,206,214,188,188,18,19,26,199,197,71,136,170,65,69,83,45,49,57,50,32,116,101,115,116,32,101,110,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,65,69,83,45,49,57,50,32,116,101,115,116,32,100,101,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,99,102,98,0,111,102,98,0,110,111,32,116,101,115,116,32,100,97,116,97,32,102,111,114,32,116,104,105,115,32,109,111,100,101,0,111,112,101,110,0,115,101,116,32,107,101,121,0,115,101,116,32,73,86,0,101,110,99,114,121,112,116,32,99,111,109,109,97,110,100,0,101,110,99,114,121,112,116,32,109,105,115,109,97,116,99,104,0,100,101,99,114,121,112,116,32,99,111,109,109,97,110,100,0,100,101,99,114,121,112,116,32,109,105,115,109,97,116,99,104,0,232,233,234,235,237,238,239,240,242,243,244,245,247,248,249,250,1,75,175,34,120,166,157,51,29,81,128,16,54,67,233,154,103,67,195,209,81,154,180,242,205,154,120,171,9,165,17,189,65,69,83,45,49,50,56,32,116,101,115,116,32,101,110,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,65,69,83,45,49,50,56,32,116,101,115,116,32,100,101,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,49,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,50,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,51,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,52,0,82,73,74,78,68,65,69,76,0,65,69,83,49,50,56,0,65,69,83,45,49,50,56,0,65,69,83,49,57,50,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,50,49,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,50,50,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,50,51,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,50,52,0,82,73,74,78,68,65,69,76,49,57,50,0,65,69,83,45,49,57,50,0,65,69,83,50,53,54,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,52,49,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,52,50,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,52,51,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,52,52,0,82,73,74,78,68,65,69,76,50,53,54,0,65,69,83,45,50,53,54,0,82,73,80,69,77,68,49,54,48,0,48,33,48,9,6,5,43,36,3,2,1,5,0,4,20,49,46,51,46,51,54,46,51,46,51,46,49,46,50,0,49,46,51,46,51,54,46,51,46,50,46,49,0,105,32,62,32,48,0,114,115,97,45,99,111,109,109,111,110,46,99,0,95,103,99,114,121,95,114,115,97,95,112,107,99,115,49,95,101,110,99,111,100,101,95,102,111,114,95,101,110,99,0,110,32,61,61,32,110,102,114,97,109,101,0,80,75,67,83,35,49,32,98,108,111,99,107,32,116,121,112,101,32,50,32,101,110,99,111,100,101,100,32,100,97,116,97,0,118,97,108,117,101,32,101,120,116,114,97,99,116,101,100,32,102,114,111,109,32,80,75,67,83,35,49,32,98,108,111,99,107,32,116,121,112,101,32,50,32,101,110,99,111,100,101,100,32,100,97,116,97,0,105,32,62,32,49,0,95,103,99,114,121,95,114,115,97,95,112,107,99,115,49,95,101,110,99,111,100,101,95,102,111,114,95,115,105,103,0,80,75,67,83,35,49,32,98,108,111,99,107,32,116,121,112,101,32,49,32,101,110,99,111,100,101,100,32,100,97,116,97,0,95,103,99,114,121,95,114,115,97,95,112,107,99,115,49,95,101,110,99,111,100,101,95,114,97,119,95,102,111,114,95,115,105,103,0,79,65,69,80,32,101,110,99,111,100,101,100,32,100,97,116,97,0,118,97,108,117,101,32,101,120,116,114,97,99,116,101,100,32,102,114,111,109,32,79,65,69,80,32,101,110,99,111,100,101,100,32,100,97,116,97,0,104,108,101,110,0,95,103,99,114,121,95,114,115,97,95,112,115,115,95,101,110,99,111,100,101,0,80,83,83,32,101,110,99,111,100,101,100,32,100,97,116,97,0,95,103,99,114,121,95,114,115,97,95,112,115,115,95,118,101,114,105,102,121,0,82,83,65,0,110,101,0,110,101,100,112,113,117,0,97,0,115,0,110,0,99,111,110,118,101,114,116,0,40,112,114,105,118,97,116,101,45,107,101,121,32,40,114,115,97,32,32,40,110,32,35,48,48,101,48,99,101,57,54,102,57,48,98,54,99,57,101,48,50,102,51,57,50,50,98,101,97,100,97,57,51,102,101,53,48,97,56,55,53,101,97,99,54,98,99,99,49,56,98,98,57,97,57,99,102,50,101,56,52,57,54,53,99,97,97,32,32,32,32,32,32,50,100,49,102,102,57,53,97,55,102,53,52,50,52,54,53,99,54,99,48,99,49,57,100,50,55,54,101,52,53,50,54,99,101,48,52,56,56,54,56,97,55,97,57,49,52,102,100,51,52,51,99,99,51,97,56,55,100,100,55,52,50,57,49,32,32,32,32,32,32,102,102,99,53,54,53,53,48,54,100,53,98,98,98,50,53,99,98,97,99,54,97,48,101,50,100,100,49,102,56,98,99,97,97,98,48,100,52,97,50,57,99,50,102,51,55,99,57,53,48,102,51,54,51,52,56,52,98,102,50,54,57,102,55,32,32,32,32,32,32,56,57,49,52,52,48,52,54,52,98,97,102,55,57,56,50,55,101,48,51,97,51,54,101,55,48,98,56,49,52,57,51,56,101,101,98,100,99,54,51,101,57,54,52,50,52,55,98,101,55,53,100,99,53,56,98,48,49,52,98,55,101,97,50,53,49,35,41,32,32,40,101,32,35,48,49,48,48,48,49,35,41,32,32,40,100,32,35,48,52,54,49,50,57,102,50,52,56,57,100,55,49,53,55,57,98,101,48,97,55,53,102,101,48,50,57,98,100,54,99,100,98,53,55,52,101,98,102,53,55,101,97,56,97,53,98,48,102,100,97,57,52,50,99,97,98,57,52,51,98,49,49,32,32,32,32,32,32,55,100,55,98,98,57,53,101,53,100,50,56,56,55,53,101,48,102,57,102,99,53,102,99,99,48,54,97,55,50,102,54,100,53,48,50,52,54,52,100,97,98,100,101,100,55,56,101,102,54,98,55,49,54,49,55,55,98,56,51,100,53,98,100,32,32,32,32,32,32,99,53,52,51,100,99,53,100,51,102,101,100,57,51,50,101,53,57,102,53,56,57,55,101,57,50,101,54,102,53,56,97,48,102,51,51,52,50,52,49,48,54,97,51,98,54,102,97,50,99,98,102,56,55,55,53,49,48,101,52,97,99,50,49,32,32,32,32,32,32,99,51,101,101,52,55,56,53,49,101,57,55,100,49,50,57,57,54,50,50,50,97,99,51,53,54,54,100,52,99,99,98,48,98,56,51,100,49,54,52,48,55,52,97,98,102,55,100,101,54,53,53,102,99,50,52,52,54,100,97,49,55,56,49,35,41,32,32,40,112,32,35,48,48,101,56,54,49,98,55,48,48,101,49,55,101,56,97,102,101,54,56,51,55,101,55,53,49,50,101,51,53,98,54,99,97,49,49,100,48,97,101,52,55,100,56,98,56,53,49,54,49,99,54,55,98,97,102,54,52,51,55,55,50,49,51,32,32,32,32,32,32,102,101,53,50,100,55,55,50,102,50,48,51,53,98,51,99,97,56,51,48,97,102,52,49,100,56,97,52,49,50,48,101,49,99,49,99,55,48,100,49,50,99,99,50,50,102,48,48,100,50,56,100,51,49,100,100,52,56,97,56,100,52,50,52,102,49,35,41,32,32,40,113,32,35,48,48,102,55,97,55,99,97,53,51,54,55,99,54,54,49,102,56,101,54,50,100,102,51,52,102,48,100,48,53,99,49,48,99,56,56,101,53,52,57,50,51,52,56,100,100,55,98,100,100,99,57,52,50,99,57,97,56,102,51,54,57,102,57,32,32,32,32,32,32,51,53,97,48,55,55,56,53,100,50,100,98,56,48,53,50,49,53,101,100,55,56,54,101,52,50,56,53,100,102,49,54,53,56,101,101,100,51,99,101,56,52,102,52,54,57,98,56,49,98,53,48,100,51,53,56,52,48,55,98,52,97,100,51,54,49,35,41,32,32,40,117,32,35,51,48,52,53,53,57,97,57,101,97,100,53,54,100,50,51,48,57,100,50,48,51,56,49,49,97,54,52,49,98,98,49,97,48,57,54,50,54,98,99,56,101,98,51,54,102,102,102,97,50,51,99,57,54,56,101,99,53,98,100,56,57,49,101,32,32,32,32,32,32,101,98,98,97,102,99,55,51,97,101,54,54,54,101,48,49,98,97,55,99,56,57,57,48,98,97,101,48,54,99,99,50,98,98,101,49,48,98,55,53,101,54,57,102,99,97,99,98,51,53,51,97,54,52,55,51,48,55,57,100,56,101,57,98,35,41,41,41,0,40,112,117,98,108,105,99,45,107,101,121,32,40,114,115,97,32,32,40,110,32,35,48,48,101,48,99,101,57,54,102,57,48,98,54,99,57,101,48,50,102,51,57,50,50,98,101,97,100,97,57,51,102,101,53,48,97,56,55,53,101,97,99,54,98,99,99,49,56,98,98,57,97,57,99,102,50,101,56,52,57,54,53,99,97,97,32,32,32,32,32,32,50,100,49,102,102,57,53,97,55,102,53,52,50,52,54,53,99,54,99,48,99,49,57,100,50,55,54,101,52,53,50,54,99,101,48,52,56,56,54,56,97,55,97,57,49,52,102,100,51,52,51,99,99,51,97,56,55,100,100,55,52,50,57,49,32,32,32,32,32,32,102,102,99,53,54,53,53,48,54,100,53,98,98,98,50,53,99,98,97,99,54,97,48,101,50,100,100,49,102,56,98,99,97,97,98,48,100,52,97,50,57,99,50,102,51,55,99,57,53,48,102,51,54,51,52,56,52,98,102,50,54,57,102,55,32,32,32,32,32,32,56,57,49,52,52,48,52,54,52,98,97,102,55,57,56,50,55,101,48,51,97,51,54,101,55,48,98,56,49,52,57,51,56,101,101,98,100,99,54,51,101,57,54,52,50,52,55,98,101,55,53,100,99,53,56,98,48,49,52,98,55,101,97,50,53,49,35,41,32,32,40,101,32,35,48,49,48,48,48,49,35,41,41,41,0,107,101,121,32,99,111,110,115,105,115,116,101,110,99,121,0,115,105,103,110,0,101,110,99,114,121,112,116,0,40,100,97,116,97,32,40,102,108,97,103,115,32,114,97,119,41,32,40,118,97,108,117,101,32,37,109,41,41,0,99,111,110,118,101,114,116,105,110,103,32,100,97,116,97,32,102,97,105,108,101,100,0,101,110,99,114,121,112,116,32,102,97,105,108,101,100,0,103,99,114,121,95,112,107,95,100,101,99,114,121,112,116,32,114,101,116,117,114,110,101,100,32,103,97,114,98,97,103,101,0,99,105,112,104,101,114,116,101,120,116,32,109,97,116,99,104,101,115,32,112,108,97,105,110,116,101,120,116,0,100,101,99,114,121,112,116,32,102,97,105,108,101,100,0,118,97,108,117,101,0,100,101,99,114,121,112,116,32,114,101,116,117,114,110,101,100,32,110,111,32,112,108,97,105,110,116,101,120,116,0,109,105,115,109,97,116,99,104,0,101,110,99,45,118,97,108,0,114,115,97,0,40,100,97,116,97],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+30720);allocate([32,40,102,108,97,103,115,32,112,107,99,115,49,41,32,40,104,97,115,104,32,115,104,97,49,32,35,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,48,48,97,97,98,98,99,99,100,100,101,101,102,102,49,48,50,48,51,48,52,48,35,41,41,0,40,100,97,116,97,32,40,102,108,97,103,115,32,112,107,99,115,49,41,32,40,104,97,115,104,32,115,104,97,49,32,35,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,48,48,97,97,98,98,99,99,100,100,101,101,102,102,56,48,50,48,51,48,52,48,35,41,41,0,115,105,103,110,105,110,103,32,102,97,105,108,101,100,0,118,101,114,105,102,121,32,102,97,105,108,101,100,0,98,97,100,32,115,105,103,110,97,116,117,114,101,32,110,111,116,32,100,101,116,101,99,116,101,100,0,114,115,97,95,118,101,114,105,102,121,32,100,97,116,97,0,114,115,97,95,118,101,114,105,102,121,32,32,115,105,103,0,114,115,97,95,118,101,114,105,102,121,32,32,32,32,110,0,114,115,97,95,118,101,114,105,102,121,32,32,32,32,101,0,114,115,97,95,118,101,114,105,102,121,32,32,99,109,112,0,114,115,97,95,118,101,114,105,102,121,32,32,32,32,61,62,32,37,115,10,0,114,115,97,95,115,105,103,110,32,32,32,100,97,116,97,0,110,101,100,112,63,113,63,117,63,0,114,115,97,95,115,105,103,110,32,32,32,32,32,32,110,0,114,115,97,95,115,105,103,110,32,32,32,32,32,32,101,0,114,115,97,95,115,105,103,110,32,32,32,32,32,32,100,0,114,115,97,95,115,105,103,110,32,32,32,32,32,32,112,0,114,115,97,95,115,105,103,110,32,32,32,32,32,32,113,0,114,115,97,95,115,105,103,110,32,32,32,32,32,32,117,0,114,115,97,95,115,105,103,110,32,32,32,32,114,101,115,0,40,115,105,103,45,118,97,108,40,114,115,97,40,115,37,98,41,41,41,0,40,115,105,103,45,118,97,108,40,114,115,97,40,115,37,77,41,41,41,0,114,115,97,95,115,105,103,110,32,32,32,32,32,32,61,62,32,37,115,10,0,114,115,97,95,100,101,99,114,121,112,116,32,100,97,116,97,0,114,115,97,95,100,101,99,114,121,112,116,32,32,32,32,110,0,114,115,97,95,100,101,99,114,121,112,116,32,32,32,32,101,0,114,115,97,95,100,101,99,114,121,112,116,32,32,32,32,100,0,114,115,97,95,100,101,99,114,121,112,116,32,32,32,32,112,0,114,115,97,95,100,101,99,114,121,112,116,32,32,32,32,113,0,114,115,97,95,100,101,99,114,121,112,116,32,32,32,32,117,0,114,115,97,95,100,101,99,114,121,112,116,32,32,114,101,115,0,40,118,97,108,117,101,32,37,98,41,0,37,109,0,114,115,97,95,100,101,99,114,121,112,116,32,32,32,32,61,62,32,37,115,10,0,114,115,97,95,101,110,99,114,121,112,116,32,100,97,116,97,0,114,115,97,95,101,110,99,114,121,112,116,32,32,32,32,110,0,114,115,97,95,101,110,99,114,121,112,116,32,32,32,32,101,0,114,115,97,95,101,110,99,114,121,112,116,32,32,114,101,115,0,40,101,110,99,45,118,97,108,40,114,115,97,40,97,37,98,41,41,41,0,40,101,110,99,45,118,97,108,40,114,115,97,40,97,37,109,41,41,41,0,114,115,97,95,101,110,99,114,121,112,116,32,32,32,32,61,62,32,37,115,10,0,114,115,97,95,116,101,115,116,107,101,121,32,32,32,32,61,62,32,37,115,10,0,100,101,114,105,118,101,45,112,97,114,109,115,0,117,115,101,45,120,57,51,49,0,40,109,105,115,99,45,107,101,121,45,105,110,102,111,40,112,45,113,45,115,119,97,112,112,101,100,41,41,0,40,107,101,121,45,100,97,116,97,32,40,112,117,98,108,105,99,45,107,101,121,32,32,40,114,115,97,40,110,37,109,41,40,101,37,109,41,41,41,32,40,112,114,105,118,97,116,101,45,107,101,121,32,32,40,114,115,97,40,110,37,109,41,40,101,37,109,41,40,100,37,109,41,40,112,37,109,41,40,113,37,109,41,40,117,37,109,41,41,41,32,37,83,41,0,114,115,97,46,99,0,103,101,110,101,114,97,116,101,95,115,116,100,0,32,32,112,61,32,0,32,32,113,61,32,0,112,104,105,61,32,0,32,32,103,61,32,0,32,32,102,61,32,0,32,32,110,61,32,0,32,32,101,61,32,0,32,32,100,61,32,0,32,32,117,61,32,0,115,101,108,102,45,116,101,115,116,32,97,102,116,101,114,32,107,101,121,32,103,101,110,101,114,97,116,105,111,110,32,102,97,105,108,101,100,0,88,112,49,0,88,112,50,0,88,112,0,88,113,49,0,88,113,50,0,88,113,0,95,103,99,114,121,95,109,112,105,95,103,99,100,32,40,32,40,103,41,44,32,40,101,41,44,32,40,112,104,105,41,32,41,0,103,101,110,101,114,97,116,101,95,120,57,51,49,0,112,32,97,110,100,32,113,32,97,114,101,32,115,119,97,112,112,101,100,10,0,32,32,113,0,32,32,110,0,32,32,101,0,32,32,100,0,32,32,117,0,95,103,99,114,121,95,109,112,105,95,103,101,116,95,110,98,105,116,115,32,40,40,120,105,41,41,32,61,61,32,49,48,49,0,103,101,110,95,120,57,51,49,95,112,97,114,109,95,120,105,0,95,103,99,114,121,95,109,112,105,95,103,101,116,95,110,98,105,116,115,32,40,40,120,112,41,41,32,61,61,32,110,98,105,116,115,0,103,101,110,95,120,57,51,49,95,112,97,114,109,95,120,112,0,111,112,101,110,112,103,112,45,114,115,97,0,111,105,100,46,49,46,50,46,56,52,48,46,49,49,51,53,52,57,46,49,46,49,46,49,0,83,72,65,49,0,48,33,48,9,6,5,43,14,3,2,26,5,0,4,20,169,153,62,54,71,6,129,106,186,62,37,113,120,80,194,108,156,208,216,157,0,132,152,62,68,28,59,210,110,186,174,74,161,249,81,41,229,229,70,112,241,0,52,170,151,60,212,196,218,164,246,30,235,43,219,173,39,49,101,52,1,111,0,49,46,50,46,56,52,48,46,49,49,51,53,52,57,46,49,46,49,46,53,0,49,46,50,46,56,52,48,46,49,48,48,52,48,46,52,46,51,0,49,46,51,46,49,52,46,51,46,50,46,50,54,0,49,46,51,46,49,52,46,51,46,50,46,50,57,0,49,46,50,46,56,52,48,46,49,48,48,52,53,46,52,46,49,0,83,72,65,50,50,52,0,48,45,48,13,6,9,96,134,72,1,101,3,4,2,4,5,0,4,28,186,120,22,191,143,1,207,234,65,65,64,222,93,174,34,35,176,3,97,163,150,23,122,156,180,16,255,97,242,0,21,173,0,97,98,99,100,98,99,100,101,99,100,101,102,100,101,102,103,101,102,103,104,102,103,104,105,103,104,105,106,104,105,106,107,105,106,107,108,106,107,108,109,107,108,109,110,108,109,110,111,109,110,111,112,110,111,112,113,0,36,141,106,97,210,6,56,184,229,192,38,147,12,62,96,57,163,60,228,89,100,255,33,103,246,236,237,212,25,219,6,193,0,205,199,110,92,153,20,251,146,129,161,199,226,132,215,62,103,241,128,154,72,164,151,32,14,4,109,57,204,199,17,44,208,0,35,9,125,34,52,5,216,34,134,66,164,119,189,162,85,179,42,173,188,228,189,160,179,247,227,108,157,167,0,117,56,139,22,81,39,118,204,93,186,93,161,253,137,1,80,176,198,69,92,180,245,139,25,82,82,37,37,0,32,121,70,85,152,12,145,216,187,180,193,234,151,97,138,75,240,63,66,88,25,72,178,238,78,231,173,103,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,50,46,52,0,83,72,65,50,53,54,0,48,49,48,13,6,9,96,134,72,1,101,3,4,2,1,5,0,4,32,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,50,46,49,0,49,46,50,46,56,52,48,46,49,49,51,53,52,57,46,49,46,49,46,49,49,0,83,72,65,53,49,50,0,48,81,48,13,6,9,96,134,72,1,101,3,4,2,3,5,0,4,64,115,104,111,114,116,32,115,116,114,105,110,103,0,97,98,99,0,221,175,53,161,147,97,122,186,204,65,115,73,174,32,65,49,18,230,250,78,137,169,126,162,10,158,238,230,75,85,211,154,33,146,153,42,39,79,193,168,54,186,60,35,163,254,235,189,69,77,68,35,100,60,232,14,42,154,201,79,165,76,164,159,0,108,111,110,103,32,115,116,114,105,110,103,0,97,98,99,100,101,102,103,104,98,99,100,101,102,103,104,105,99,100,101,102,103,104,105,106,100,101,102,103,104,105,106,107,101,102,103,104,105,106,107,108,102,103,104,105,106,107,108,109,103,104,105,106,107,108,109,110,104,105,106,107,108,109,110,111,105,106,107,108,109,110,111,112,106,107,108,109,110,111,112,113,107,108,109,110,111,112,113,114,108,109,110,111,112,113,114,115,109,110,111,112,113,114,115,116,110,111,112,113,114,115,116,117,0,142,149,155,117,218,227,19,218,140,244,247,40,20,252,20,63,143,119,121,198,235,159,127,161,114,153,174,173,182,136,144,24,80,29,40,158,73,0,247,228,51,27,153,222,196,181,67,58,199,211,41,238,182,221,38,84,94,150,229,91,135,75,233,9,0,111,110,101,32,109,105,108,108,105,111,110,32,34,97,34,0,231,24,72,61,12,231,105,100,78,46,66,199,188,21,180,99,142,31,152,177,59,32,68,40,86,50,168,3,175,169,115,235,222,15,242,68,135,126,166,10,76,176,67,44,229,119,195,27,235,0,156,92,44,73,170,46,78,173,178,23,173,140,192,155,0,100,105,103,101,115,116,0,203,0,117,63,69,163,94,139,181,160,61,105,154,198,80,7,39,44,50,171,14,222,209,99,26,139,96,90,67,255,91,237,128,134,7,43,161,231,204,35,88,186,236,161,52,200,37,167,0,9,51,12,51,247,17,71,232,61,25,47,199,130,205,27,71,83,17,27,23,59,59,5,210,47,160,128,134,227,176,247,18,252,199,199,26,85,126,45,185,102,195,233,250,145,116,96,57,0,157,14,24,9,113,100,116,203,8,110,131,78,49,10,74,28,237,20,158,156,0,242,72,82,121,114,206,197,112,76,42,91,7,184,179,220,56,236,196,235,174,151,221,216,127,61,137,133,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,50,46,51,0,49,46,50,46,56,52,48,46,49,49,51,53,52,57,46,49,46,49,46,49,51,0,83,72,65,51,56,52,0,48,65,48,13,6,9,96,134,72,1,101,3,4,2,2,5,0,4,48,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,50,46,50,0,49,46,50,46,56,52,48,46,49,49,51,53,52,57,46,49,46,49,46,49,50,0,84,87,79,70,73,83,72,0,37,115,10,0,0,1,23,2,46,24,83,3,106,47,147,25,52,84,69,4,92,107,182,48,166,148,75,26,140,53,129,85,170,70,13,5,36,93,135,108,155,183,193,49,43,167,163,149,152,76,202,27,230,141,115,54,205,130,18,86,98,171,240,71,79,14,189,6,212,37,210,94,39,136,102,109,214,156,121,184,8,194,223,50,104,44,253,168,138,164,90,150,41,153,34,77,96,203,228,28,123,231,59,142,158,116,244,55,216,206,249,131,111,19,178,87,225,99,220,172,196,241,175,72,10,80,66,15,186,190,199,7,222,213,120,38,101,211,209,95,227,40,33,137,89,103,252,110,177,215,248,157,243,122,58,185,198,9,65,195,174,224,219,51,68,105,146,45,82,254,22,169,12,139,128,165,74,91,181,151,201,42,162,154,192,35,134,78,188,97,239,204,17,229,114,29,61,124,235,232,233,60,234,143,125,159,236,117,30,245,62,56,246,217,63,207,118,250,31,132,160,112,237,20,144,179,126,88,251,226,32,100,208,221,119,173,218,197,64,242,57,176,247,73,180,11,127,81,21,67,145,16,113,187,238,191,133,200,161,1,2,4,8,16,32,64,128,77,154,121,242,169,31,62,124,248,189,55,110,220,245,167,3,6,12,24,48,96,192,205,215,227,139,91,182,33,66,132,69,138,89,178,41,82,164,5,10,20,40,80,160,13,26,52,104,208,237,151,99,198,193,207,211,235,155,123,246,161,15,30,60,120,240,173,23,46,92,184,61,122,244,165,7,14,28,56,112,224,141,87,174,17,34,68,136,93,186,57,114,228,133,71,142,81,162,9,18,36,72,144,109,218,249,191,51,102,204,213,231,131,75,150,97,194,201,223,243,171,27,54,108,216,253,183,35,70,140,85,170,25,50,100,200,221,247,163,11,22,44,88,176,45,90,180,37,74,148,101,202,217,255,179,43,86,172,21,42,84,168,29,58,116,232,157,119,238,145,111,222,241,175,19,38,76,152,125,250,185,63,126,252,181,39,78,156,117,234,153,127,254,177,47,94,188,53,106,212,229,135,67,134,65,130,73,146,105,210,233,159,115,230,129,79,158,113,226,137,95,190,49,98,196,197,199,195,203,219,251,187,59,118,236,149,103,206,209,239,147,107,214,225,143,83,166,1,2,4,8,16,32,64,128,77,154,121,242,169,31,62,124,248,189,55,110,220,245,167,3,6,12,24,48,96,192,205,215,227,139,91,182,33,66,132,69,138,89,178,41,82,164,5,10,20,40,80,160,13,26,52,104,208,237,151,99,198,193,207,211,235,155,123,246,161,15,30,60,120,240,173,23,46,92,184,61,122,244,165,7,14,28,56,112,224,141,87,174,17,34,68,136,93,186,57,114,228,133,71,142,81,162,9,18,36,72,144,109,218,249,191,51,102,204,213,231,131,75,150,97,194,201,223,243,171,27,54,108,216,253,183,35,70,140,85,170,25,50,100,200,221,247,163,11,22,44,88,176,45,90,180,37,74,148,101,202,217,255,179,43,86,172,21,42,84,168,29,58,116,232,157,119,238,145,111,222,241,175,19,38,76,152,125,250,185,63,126,252,181,39,78,156,117,234,153,127,254,177,47,94,188,53,106,212,229,135,67,134,65,130,73,146,105,210,233,159,115,230,129,79,158,113,226,137,95,190,49,98,196,197,199,195,203,169,117,103,243,179,198,232,244,4,219,253,123,163,251,118,200,154,74,146,211,128,230,120,107,228,69,221,125,209,232,56,75,13,214,198,50,53,216,152,253,24,55,247,113,236,241,108,225,67,48,117,15,55,248,38,27,250,135,19,250,148,6,72,63,242,94,208,186,139,174,48,91,132,138,84,0,223,188,35,157,25,109,91,193,61,177,89,14,243,128,174,93,162,210,130,213,99,160,1,132,131,7,46,20,217,181,81,144,155,44,124,163,166,178,235,115,165,76,190,84,22,146,12,116,227,54,97,81,192,56,140,176,58,189,245,90,115,252,44,96,37,98,11,150,187,108,78,66,137,247,107,16,83,124,106,40,180,39,241,140,225,19,230,149,189,156,69,199,226,36,244,70,182,59,102,112,204,202,149,227,3,133,86,203,212,17,28,208,30,147,215,184,251,166,195,131,142,32,181,255,233,159,207,119,191,195,186,204,234,3,119,111,57,8,175,191,51,64,201,231,98,43,113,226,129,121,121,12,9,170,173,130,36,65,205,58,249,234,216,185,229,228,197,154,185,164,77,151,68,126,8,218,134,122,231,23,161,102,29,148,170,161,237,29,6,61,112,240,178,222,210,179,65,11,123,114,160,167,17,28,49,239,194,209,39,83,144,62,32,143,246,51,96,38,255,95,150,236,92,118,177,42,171,73,158,129,156,136,82,238,27,33,95,196,147,26,10,235,239,217,145,197,133,57,73,153,238,205,45,173,79,49,143,139,59,1,71,24,135,35,109,221,70,31,214,78,62,45,105,249,100,72,42,79,206,242,203,101,47,142,252,120,151,92,5,88,122,25,172,141,127,229,213,152,26,87,75,103,14,127,167,5,90,100,40,175,20,99,63,182,41,254,136,245,60,183,76,60,2,165,184,206,218,233,176,104,23,68,85,224,31,77,138,67,125,105,87,41,199,46,141,172,116,21,183,89,196,168,159,10,114,158,126,110,21,71,34,223,18,52,88,53,7,106,153,207,52,220,110,34,80,201,222,192,104,155,101,137,188,212,219,237,248,171,200,18,168,162,43,13,64,82,220,187,254,2,50,47,164,169,202,215,16,97,33,30,240,180,211,80,93,4,15,246,0,194,111,22,157,37,54,134,66,86,74,85,94,9,193,190,224,145,117,243,198,244,219,123,251,200,74,211,230,107,69,125,232,75,214,50,216,253,55,113,241,225,48,15,248,27,135,250,6,63,94,186,174,91,138,0,188,157,109,193,177,14,128,93,210,213,160,132,7,20,181,144,44,163,178,115,76,84,146,116,54,81,56,176,189,90,252,96,98,150,108,66,247,16,124,40,39,140,19,149,156,199,36,70,59,112,202,227,133,203,17,208,147,184,166,131,32,255,159,119,195,204,3,111,8,191,64,231,43,226,121,12,170,130,65,58,234,185,228,154,164,151,126,218,122,23,102,148,161,29,61,240,222,179,11,114,167,28,239,209,83,62,143,51,38,95,236,118,42,73,129,136,238,33,196,26,235,217,197,57,153,205,173,49,139,1,24,35,221,31,78,45,249,72,79,242,101,142,120,92,88,25,141,229,152,87,103,127,5,100,175,99,182,254,245,183,60,165,206,233,104,68,224,77,67,105,41,46,172,21,89,168,10,158,110,71,223,52,53,106,207,220,34,201,192,155,137,212,237,171,18,162,13,82,187,2,47,169,215,97,30,180,80,4,246,194,22,37,134,86,85,9,190,145,169,103,179,232,4,253,163,118,154,146,128,120,228,221,209,56,13,198,53,152,24,247,236,108,67,117,55,38,250,19,148,72,242,208,139,48,132,84,223,35,25,91,61,89,243,174,162,130,99,1,131,46,217,81,155,124,166,235,165,190,22,12,227,97,192,140,58,245,115,44,37,11,187,78,137,107,83,106,180,241,225,230,189,69,226,244,182,102,204,149,3,86,212,28,30,215,251,195,142,181,233,207,191,186,234,119,57,175,51,201,98,113,129,121,9,173,36,205,249,216,229,197,185,77,68,8,134,231,161,29,170,237,6,112,178,210,65,123,160,17,49,194,39,144,32,246,96,255,150,92,177,171,158,156,82,27,95,147,10,239,145,133,73,238,45,79,143,59,71,135,109,70,214,62,105,100,42,206,203,47,252,151,5,122,172,127,213,26,75,14,167,90,40,20,63,41,136,60,76,2,184,218,176,23,85,31,138,125,87,199,141,116,183,196,159,114,126,21,34,18,88,7,153,52,110,80,222,104,101,188,219,248,200,168,43,64,220,254,50,164,202,16,33,240,211,93,15,0,111,157,54,66,74,94,193,224,159,88,159,92,246,18,44,50,182,191,236,47,42,232,195,90,212,145,219,22,231,177,195,158,134,203,8,107,120,159,84,25,1,159,152,9,222,23,17,133,143,170,195,163,186,32,251,195,84,119,111,102,105,115,104,45,49,50,56,32,116,101,115,116,32,101,110,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,84,119,111,102,105,115,104,45,49,50,56,32,116,101,115,116,32,100,101,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,212,59,183,85,110,163,46,70,242,162,130,183,212,91,78,13,87,255,115,157,77,201,44,27,215,252,1,112,12,200,33,111,144,175,233,27,178,136,84,79,44,50,220,35,155,38,53,230,108,180,86,28,64,191,10,151,5,147,28,182,212,8,231,250,84,119,111,102,105,115,104,45,50,53,54,32,116,101,115,116,32,101,110,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,84,119,111,102,105,115,104,45,50,53,54,32,116,101,115,116,32,100,101,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,84,87,79,70,73,83,72,49,50,56,0,102,97,105,108,101,100,32,116,111,32,97,99,113,117,105,114,101,32,116,104,101,32,110,111,110,99,101,32,98,117,102,102,101,114,32,108,111,99,107,58,32,37,115,10,0,102,97,105,108,101,100,32,116,111,32,114,101,108,101,97,115,101,32,116,104,101,32,110,111,110,99,101,32,98,117,102,102,101,114,32,108,111,99,107,58,32,37,115,10,0,37,115,46,42,0,37,115,46,88,0,37,115,58,32,71,101,116,116,105,110,103,32,89,45,99,111,111,114,100,105,110,97,116,101,32,111,110,32,37,115,32,105,115,32,110,111,116,32,115,117,112,112,111,114,116,101,100,10,0,95,103,99,114,121,95,109,112,105,95,101,99,95,103,101,116,95,97,102,102,105,110,101,0,77,111,110,116,103,111,109,101,114,121,0,101,99,95,105,110,118,109,58,32,105,110,118,101,114,115,101,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,58,10,0,32,32,97,0,32,32,112,0,71,67,82,89,80,84,95,66,65,82,82,69,84,84,0,37,115,58,32,37,115,32,110,111,116,32,121,101,116,32,115,117,112,112,111,114,116,101,100,10,0,95,103,99,114,121,95,109,112,105,95,101,99,95,100,117,112,95,112,111,105,110,116,0,95,103,99,114,121,95,109,112,105,95,101,99,95,97,100,100,95,112,111,105,110,116,115,0,0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,33,98,112,95,109,97,114,107,101,114,0,109,112,105,45,112,111,119,46,99,0,95,103,99,114,121,95,109,112,105,95,112,111,119,109,0,114,101,115,45,62,100,32,61,61,32,114,112,0,105,32,61,61,32,110,108,105,109,98,115,0,109,112,105,99,111,100,101,114,46,99,0,95,103,99,114,121,95,109,112,105,95,115,101,116,95,98,117,102,102,101,114,0,58,103,101,110,101,114,105,99,47,109,112,105,104,45,97,100,100,49,46,99,58,103,101,110,101,114,105,99,47,109,112,105,104,45,115,117,98,49,46,99,58,103,101,110,101,114,105,99,47,109,112,105,104,45,109,117,108,49,46,99,58,103,101,110,101,114,105,99,47,109,112,105,104,45,109,117,108,50,46,99,58,103,101,110,101,114,105,99,47,109,112,105,104,45,109,117,108,51,46,99,58,103,101,110,101,114,105,99,47,109,112,105,104,45,108,115,104,105,102,116,46,99,58,103,101,110,101,114,105,99,47,109,112,105,104,45,114,115,104,105,102,116,46,99,0,105,110,118,97,108,105,100,32,109,112,105,95,99,111,110,115,116,32,115,101,108,101,99,116,111,114,32,37,100,10,0,87,97,114,110,105,110,103,58,32,116,114,121,105,110,103,32,116,111,32,99,104,97,110,103,101,32,97,110,32,105,109,109,117,116,97,98,108,101,32,77,80,73,10,0,105,110,118,97,108,105,100,32,102,108,97,103,32,118,97,108,117,101,32,105,110,32,109,112,105,95,102,114,101,101,10,0,109,112,105,95,103,101,116,95,111,112,97,113,117,101,32,111,110,32,110,111,114,109,97,108,32,109,112,105,10,0,109,112,105,95,115,101,116,95,99,111,110,100,58,32,100,105,102,102,101,114,101,110,116,32,115,105,122,101,115,10,0,109,112,105,95,115,119,97,112,95,99,111,110,100,58,32,100,105,102,102,101,114,101,110,116,32,115,105,122,101,115,10,0,105,110,118,97,108,105,100,32,102,108,97,103,32,118,97,108,117,101,10,0,77,80,73,32,115,117,98,115,121,115,116,101,109,32,110,111,116,32,105,110,105,116,105,97,108,105,122,101,100,10,0,10,10,84,104,105,115,32,105,115,32,76,105,98,103,99,114,121,112,116,32,49,46,55,46,48,45,98,101,116,97,50,51,48,32,45,32,84,104,101,32,71,78,85,32,67,114,121,112,116,111,32,76,105,98,114,97,114,121,10,67,111,112,121,114,105,103,104,116,32,40,67,41,32,50,48,48,48,45,50,48,49,50,32,70,114,101,101,32,83,111,102,116,119,97,114,101,32,70,111,117,110,100,97,116,105,111,110,44,32,73,110,99,46,10,67,111,112,121,114,105,103,104,116,32,40,67,41,32,50,48,49,50,45,50,48,49,52,32,103,49,48,32,67,111,100,101,32,71,109,98,72,10,67,111,112,121,114,105,103,104,116,32,40,67,41,32,50,48,49,51,45,50,48,49,52,32,74,117,115,115,105,32,75,105,118,105,108,105,110,110,97,10,10,40,97,51,54,101,101,55,53,48,32,50,48,49,55,45,48,51,45,48,57,84,49,51,58,51,57,43,48,48,48,48,41,10,10,10,0,99,105,112,104,101,114,45,99,109,97,99,46,99,0,99,109,97,99,95,103,101,110,101,114,97,116,101,95,115,117,98,107,101,121,115,0,99,45,62,117,110,117,115,101,100,32,60,32,98,108,111,99,107,115,105,122,101,0,99,105,112,104,101,114,45,99,116,114,46,99,0,95,103,99,114,121,95,99,105,112,104,101,114,95,99,116,114,95,101,110,99,114,121,112,116,0,117,110,117,115,101,100,32,61,61,32,98,108,111,99,107,115,105,122,101,0,99,105,112,104,101,114,45,103,99,109,46,99,0,100,111,95,103,104,97,115,104,95,98,117,102,0,102,97,105,108,101,100,32,116,111,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,0,115,101,116,107,101,121,32,102,97,105,108,101,100,0,115,101,108,102,116,101,115,116,32,102,111,114,32,67,66,67,32,102,97,105,108,101,100,32,45,32,115,101,101,32,115,121,115,108,111,103,32,102,111,114,32,100,101,116,97,105,108,115,0,115,101,108,102,116,101,115,116,32,102,111,114,32,67,70,66,32,102,97,105,108,101,100,32,45,32,115,101,101,32,115,121,115,108,111,103,32,102,111,114,32,100,101,116,97,105,108,115,0,115,101,108,102,116,101,115,116,32,102,111,114,32,67,84,82,32,102,97,105,108,101,100,32,45,32,115,101,101,32,115,121,115,108,111,103,32,102,111,114,32,100,101,116,97,105,108,115,0,69,67,67,0,112,97,98,103,110,104,113,0,112,97,98,103,110,104,113,100,0,115,119,0,114,115,0,102,108,97,103,115,0,112,63,97,63,98,63,103,63,110,63,104,63,47,113,0,112,63,97,63,98,63,103,63,110,63,104,63,113,0,47,113,0,113,0,99,117,114,118,101,0,112,97,98,103,110,104,113,40,49,58,37,99,37,117,58,0,41,0,108,111,119,45,108,101,118,101,108,0,112,117,98,107,101,121,0,112,0,101,99,99,95,118,101,114,105,102,121,32,100,97,116,97,0,47,114,115,0,101,99,99,95,118,101,114,105,102,121,32,32,115,95,114,0,101,99,99,95,118,101,114,105,102,121,32,32,115,95,115,0,45,112,63,97,63,98,63,103,63,110,63,104,63,47,113,0,43,69,100,68,83,65,0,101,99,99,95,118,101,114,105,102,121,32,105,110,102,111,58,32,37,115,47,37,115,37,115,10,0,101,99,99,95,118,101,114,105,102,121,32,110,97,109,101,58,32,37,115,10,0,101,99,99,95,118,101,114,105,102,121,32,32,32,32,112,0,101,99,99,95,118,101,114,105,102,121,32,32,32,32,97,0,101,99,99,95,118,101,114,105,102,121,32,32,32,32,98,0,101,99,99,95,118,101,114,105,102,121,32,32,103,0,101,99,99,95,118,101,114,105,102,121,32,32,32,32,110,0,101,99,99,95,118,101,114,105,102,121,32,32,32,32,104,0,101,99,99,95,118,101,114,105,102,121,32,32,32,32,113,0,71,111,111,100,0,101,99,99,95,118,101,114,105,102,121,32,32,32,32,61,62,32,37,115,10,0,101,99,99,95,115,105,103,110,32,32,32,100,97,116,97,0,45,112,63,97,63,98,63,103,63,110,63,104,63,47,113,63,43,100,0,47,113,63,43,100,0,101,99,99,95,115,105,103,110,32,32,32,105,110,102,111,58,32,37,115,47,37,115,37,115,10,0,101,99,99,95,115,105,103,110,32,32,32,110,97,109,101,58,32,37,115,10,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,112,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,97,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,98,0,101,99,99,95,115,105,103,110,32,32,32,32,103,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,110,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,104,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,113,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,100,0,40,115,105,103,45,118,97,108,40,101,100,100,115,97,40,114,37,77,41,40,115,37,77,41,41,41,0,40,115,105,103,45,118,97,108,40,103,111,115,116,40,114,37,77,41,40,115,37,77,41,41,41,0,40,115,105,103,45,118,97,108,40,101,99,100,115,97,40,114,37,77,41,40,115,37,77,41,41,41,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,61,62,32,37,115,10,0,101,0,101,99,99,95,100,101,99,114,121,112,116,32,32,100,95,101,0,45,112,63,97,63,98,63,103,63,110,63,104,63,43,100,0,101,99,99,95,100,101,99,114,121,112,116,32,105,110,102,111,58,32,37,115,47,37,115,10,0,101,99,99,95,100,101,99,114,121,112,116,32,110,97,109,101,58,32,37,115,10,0,101,99,99,95,100,101,99,114,121,112,116,32,32,32,32,112,0,101,99,99,95,100,101,99,114,121,112,116,32,32,32,32,97,0,101,99,99,95,100,101,99,114,121,112,116,32,32,32,32,98,0,101,99,99,95,100,101,99,114,121,112,116,32,32,103,0,101,99,99,95,100,101,99,114,121,112,116,32,32,32,32,110,0,101,99,99,95,100,101,99,114,121,112,116,32,32,32,32,104,0,101,99,99,95,100,101,99,114,121,112,116,32,32,32,32,100,0,101,99,100,104,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,10,0,101,99,99,95,100,101,99,114,121,112,116,32,32,114,101,115,0,40,118,97,108,117,101,32,37,109,41,0,101,99,99,95,100,101,99,114,121,112,116,32,32,32,32,61,62,32,37,115,10,0,101,99,99,95,101,110,99,114,121,112,116,32,100,97,116,97,0,45,112,63,97,63,98,63,103,63,110,63,104,63,43,113,0,101,99,99,95,101,110,99,114,121,112,116,32,105,110,102,111,58,32,37,115,47,37,115,10,0,101,99,99,95,101,110,99,114,121,112,116,32,110,97,109,101,58,32,37,115,10,0,101,99,99,95,101,110,99,114,121,112,116,32,32,32,32,112,0,101,99,99,95,101,110,99,114,121,112,116,32,32,32,32,97,0,101,99,99,95,101,110,99,114,121,112,116,32,32,32,32,98,0,101,99,99,95,101,110,99,114,121,112,116,32,32,103,0,101,99,99,95,101,110,99,114,121,112,116,32,32,32,32,110,0,101,99,99,95,101,110,99,114,121,112,116,32,32,32,32,104,0,101,99,99,95,101,110,99,114,121,112,116,32,32,32,32,113,0,101,99,100,104,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,32,102,111,114,32,107,100,71,10,0,101,99,100,104,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,32,102,111,114,32,107,71,10,0,40,101,110,99,45,118,97,108,40,101,99,100,104,40,115,37,109,41,40,101,37,109,41,41,41,0,101,99,99,95,101,110,99,114,121,112,116,32,32,32,32,61,62,32,37,115,10,0,101,99,99,95,116,101,115,116,107,101,121,32,105,110,102,58,32,37,115,47,37,115,10,0,101,99,99,95,116,101,115,116,107,101,121,32,110,97,109,58,32,37,115,10,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,112,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,97,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,98,0,101,99,99,95,116,101,115,116,107,101,121,32,103,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,110,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,104,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,113,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,100,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,61,62,32,37,115,10,0,66,97,100,32,99,104,101,99,107,58,32,80,111,105,110,116,32,39,71,39,32,100,111,101,115,32,110,111,116,32,98,101,108,111,110,103,32,116,111,32,99,117,114,118,101,32,39,69,39,33,10,0,66,97,100,32,99,104,101,99,107,58,32,39,71,39,32,99,97,110,110,111,116,32,98,101,32,80,111,105,110,116,32,97,116,32,73,110,102,105,110,105,116,121,33,10,0,99,104,101,99,107,95,115,101,99,114,101,116,95,107,101,121,58,32,69,32,105,115,32,110,111,116,32,97,32,99,117,114,118,101,32,111,102,32,111,114,100,101,114,32,110,10,0,66,97,100,32,99,104,101,99,107,58,32,81,32,99,97,110,32,110,111,116,32,98,101,32,97,32,80,111,105,110,116,32,97,116,32,73,110,102,105,110,105,116,121,33,10,0,66,97,100,32,99,104,101,99,107,58,32,99,111,109,112,117,116,97,116,105,111,110,32,111,102,32,100,71,32,102,97,105,108,101,100,10,0,66,97,100,32,99,104,101,99,107,58,32,84,104,101,114,101,32,105,115,32,78,79,32,99,111,114,114,101,115,112,111,110,100,101,110,99,101,32,98,101,116,119,101,101,110,32,39,100,39,32,97,110,100,32,39,81,39,33,10,0,116,114,97,110,115,105,101,110,116,45,107,101,121,0,101,99,103,101,110,32,99,117,114,118,101,32,105,110,102,111,58,32,37,115,47,37,115,10,0,101,99,103,101,110,32,99,117,114,118,101,32,117,115,101,100,58,32,37,115,10,0,101,99,103,101,110,32,99,117,114,118,101,32,32,32,112,0,101,99,103,101,110,32,99,117,114,118,101,32,32,32,97,0,101,99,103,101,110,32,99,117,114,118,101,32,32,32,98,0,101,99,103,101,110,32,99,117,114,118,101,32,32,32,110,0,101,99,103,101,110,32,99,117,114,118,101,32,32,32,104,0,101,99,103,101,110,32,99,117,114,118,101,32,71,0,101,99,103,101,110,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,32,102,111,114,32,37,115,10,0,71,0,81,0,40,99,117,114,118,101,32,37,115,41,0,40,102,108,97,103,115,32,112,97,114,97,109,41,0,40,102,108,97,103,115,32,101,100,100,115,97,41,0,40,102,108,97,103,115,32,112,97,114,97,109,32,101,100,100,115,97,41,0,40,107,101,121,45,100,97,116,97,32,40,112,117,98,108,105,99,45,107,101,121,32,32,40,101,99,99,37,83,37,83,40,112,37,109,41,40,97,37,109,41,40,98,37,109,41,40,103,37,109,41,40,110,37,109,41,40,104,37,109,41,40,113,37,109,41,41,41,32,40,112,114,105,118,97,116,101,45,107,101,121,32,32,40,101,99,99,37,83,37,83,40,112,37,109,41,40,97,37,109,41,40,98,37,109,41,40,103,37,109,41,40,110,37,109,41,40,104,37,109,41,40,113,37,109,41,40,100,37,109,41,41,41,32,41,0,40,107,101,121,45,100,97,116,97,32,40,112,117,98,108,105,99,45,107,101,121,32,32,40,101,99,99,37,83,37,83,40,113,37,109,41,41,41,32,40,112,114,105,118,97,116,101,45,107,101,121,32,32,40,101,99,99,37,83,37,83,40,113,37,109,41,40,100,37,109,41,41,41,32,41,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,112,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,97,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,98,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,71,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,110,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,104,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,81,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,100,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,117,115,105,110,103,32,69,100,50,53,53,49,57,43,69,100,68,83,65,10,0,101,99,103,101,110,32,99,111,110,118,101,114,116,101,100,32,81,32,116,111,32,97,32,99,111,109,112,108,105,97,110,116,32,112,111,105,110,116,10,0,101,99,103,101,110,32,100,105,100,110,39,116,32,110,101,101,100,32,116,111,32,99,111,110,118,101,114,116,32,81,32,116,111,32,97,32,99,111,109,112,108,105,97,110,116,32,112,111,105,110,116,10,0,84,101,115,116,105,110,103,32,107,101,121,46,10,0,101,99,100,104,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,32,102,111,114,32,104,107,81,10,0,101,99,100,104,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,32,102,111,114,32,104,100,107,71,10,0,69,67,68,72,32,116,101,115,116,32,102,97,105,108,101,100,46,10,0,69,67,68,83,65,32,111,112,101,114,97,116,105,111,110,58,32,115,105,103,110,32,102,97,105,108,101,100,10,0,69,67,68,83,65,32,111,112,101,114,97,116,105,111,110,58,32,115,105,103,110,44,32,118,101,114,105,102,121,32,102,97,105,108,101,100,10,0,69,67,68,83,65,32,111,112,101,114,97,116,105,111,110,58,32,115,105,103,110,44,32,118,101,114,105,102,121,32,111,107,46,10,0,101,99,99,0,101,99,100,115,97,0,101,99,100,104,0,101,100,100,115,97,0,103,111,115,116,0,100,105,103,101,115,116,32,115,105,122,101,32,100,111,101,115,32,110,111,116,32,109,97,116,99,104,32,101,120,112,101,99,116,101,100,32,115,105,122,101,0,103,99,114,121,95,109,100,95,111,112,101,110,32,102,97,105,108,101,100,0,105,110,118,97,108,105,100,32,68,65,84,65,77,79,68,69,0,100,105,103,101,115,116,32,109,105,115,109,97,116,99,104,0,104,97,115,104,45,99,111,109,109,111,110,46,99,0,95,103,99,114,121,95,109,100,95,98,108,111,99,107,95,119,114,105,116,101,0,80,111,108,121,49,51,48,53,32,115,101,108,102,116,101,115,116,32,102,97,105,108,101,100,32,40,37,115,41,10,0,142,153,59,159,72,104,18,115,194,150,80,186,50,252,118,206,72,51,46,167,22,77,150,164,71,111,184,197,49,161,24,106,192,223,193,124,152,220,232,123,77,167,240,17,236,72,201,114,113,210,194,15,155,146,143,226,39,13,111,184,99,213,23,56,180,142,238,227,20,167,204,138,185,50,22,69,72,229,38,174,144,34,67,104,81,122,207,234,189,107,179,115,43,192,233,218,153,131,43,97,202,1,182,222,86,36,74,158,136,213,249,179,121,115,246,34,164,61,20,166,89,155,31,101,76,180,90,116,227,85,165,238,166,167,37,28,30,114,145,109,17,194,203,33,77,60,37,37,57,18,29,142,35,78,101,45,101,31,164,200,207,248,128,243,255,199,112,63,148,0,229,42,125,251,75,61,51,5,217,80,111,108,121,49,51,48,53,32,116,101,115,116,32,49,32,102,97,105,108,101,100,46,0,80,111,108,121,49,51,48,53,32,116,101,115,116,32,50,32,102,97,105,108,101,100,46,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,111,108,121,49,51,48,53,32,116,101,115,116,32,51,32,102,97,105,108,101,100,46,0,1,2,3,4,5,6,7,255,254,253,252,251,250,249,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,100,175,226,232,214,173,123,189,210,135,249,124,68,98,61,57,80,111,108,121,49,51,48,53,32,116,101,115,116,32,52,32,102,97,105,108,101,100,46,0,102,97,105,108,101,100,32,116,111,32,114,101,108,101,97,115,101,32,116,104,101,32,112,111,111,108,32,108,111,99,107,58,32,37,115,10,0,87,65,82,78,73,78,71,58,32,117,115,105,110,103,32,105,110,115,101,99,117,114,101,32,114,97,110,100,111,109,32,110,117,109,98,101,114,32,103,101,110,101,114,97,116,111,114,33,33,10,0,112,111,111,108,95,105,115,95,108,111,99,107,101,100,0,114,97,110,100,111,109,45,99,115,112,114,110,103,46,99,0,97,100,100,95,114,97,110,100,111,109,110,101,115,115,0,109,105,120,95,112,111,111,108,0,110,111,32,101,110,116,114,111,112,121,32,103,97,116,104,101,114,105,110,103,32,109,111,100,117,108,101,32,100,101,116,101,99,116,101,100,10,0,102,97,105,108,101,100,32,116,111,32,97,99,113,117,105,114,101,32,116,104,101,32,112,111,111,108,32,108,111,99,107,58,32,37,115,10,0,32,40,104,119,114,110,103,32,102,97,105,108,101,100,41,0,114,97,110,100,111,109,32,117,115,97,103,101,58,32,112,111,111,108,115,105,122,101,61,37,100,32,109,105,120,101,100,61,37,108,117,32,112,111,108,108,115,61,37,108,117,47,37,108,117,32,97,100,100,101,100,61,37,108,117,47,37,108,117,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,111,117,116,109,105,120,61,37,108,117,32,103,101,116,108,118,108,49,61,37,108,117,47,37,108,117,32,103,101,116,108,118,108,50,61,37,108,117,47,37,108,117,37,115,10,0,114,101,97,100,95,112,111,111,108,0,116,111,111,32,109,97,110,121,32,114,97,110,100,111,109,32,98,105,116,115,32,114,101,113,117,101,115,116,101,100,10,0,100,111,95,102,97,115,116,95,114,97,110,100,111,109,95,112,111,108,108,0,83,108,111,119,32,101,110,116,114,111,112,121,32,103,97,116,104,101,114,105,110,103,32,109,111,100,117,108,101,32,110,111,116,32,121,101,116,32,105,110,105,116,105,97,108,105,122,101,100,10,0,78,111,32,119,97,121,32,116,111,32,103,97,116,104,101,114,32,101,110,116,114,111,112,121,32,102,111,114,32,116,104,101,32,82,78,71,10,0,114,101,97,100,95,115,101,101,100,95,102,105,108,101,0,99,97,110,39,116,32,111,112,101,110,32,96,37,115,39,58,32,37,115,10,0,99,97,110,39,116,32,115,116,97,116,32,96,37,115,39,58,32,37,115,10,0,96,37,115,39,32,105,115,32,110,111,116,32,97,32,114,101,103,117,108,97,114,32,102,105,108,101,32,45,32,105,103,110,111,114,101,100,10,0,110,111,116,101,58,32,114,97,110,100,111,109,95,115,101,101,100,32,102,105,108,101,32,105,115,32,101,109,112,116,121,10,0,119,97,114,110,105,110,103,58,32,105,110,118,97,108,105,100,32,115,105,122,101,32,111,102,32,114,97,110,100,111,109,95,115,101,101,100,32,102,105,108,101,32,45,32,110,111,116,32,117,115,101,100,10,0,99,97,110,39,116,32,114,101,97,100,32,96,37,115,39,58,32,37,115,10,0,99,97,110,39,116,32,108,111,99,107,32,96,37,115],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+40960);allocate([39,58,32,37,115,10,0,119,97,105,116,105,110,103,32,102,111,114,32,108,111,99,107,32,111,110,32,96,37,115,39,46,46,46,10,0,95,103,99,114,121,95,114,110,103,99,115,112,114,110,103,95,115,101,116,95,115,101,101,100,95,102,105,108,101,0,110,111,116,101,58,32,114,97,110,100,111,109,95,115,101,101,100,32,102,105,108,101,32,110,111,116,32,117,112,100,97,116,101,100,10,0,99,97,110,39,116,32,99,114,101,97,116,101,32,96,37,115,39,58,32,37,115,10,0,99,97,110,39,116,32,119,114,105,116,101,32,96,37,115,39,58,32,37,115,10,0,99,97,110,39,116,32,99,108,111,115,101,32,96,37,115,39,58,32,37,115,10,0,33,110,111,110,99,101,95,99,111,110,116,101,120,116,45,62,116,101,115,116,95,100,116,95,112,116,114,0,114,97,110,100,111,109,45,102,105,112,115,46,99,0,95,103,99,114,121,95,114,110,103,102,105,112,115,95,105,110,105,116,105,97,108,105,122,101,0,33,115,116,100,95,114,110,103,95,99,111,110,116,101,120,116,45,62,116,101,115,116,95,100,116,95,112,116,114,0,33,115,116,114,111,110,103,95,114,110,103,95,99,111,110,116,101,120,116,45,62,116,101,115,116,95,100,116,95,112,116,114,0,102,97,105,108,101,100,32,116,111,32,114,101,108,101,97,115,101,32,116,104,101,32,82,78,71,32,108,111,99,107,58,32,37,115,10,0,109,101,109,111,114,121,32,99,111,114,114,117,112,116,105,111,110,32,100,101,116,101,99,116,101,100,32,105,110,32,82,78,71,32,99,111,110,116,101,120,116,32,37,112,10,0,102,97,105,108,101,100,32,116,111,32,97,99,113,117,105,114,101,32,116,104,101,32,82,78,71,32,108,111,99,107,58,32,37,115,10,0,114,110,103,95,99,116,120,0,102,111,114,107,32,119,105,116,104,111,117,116,32,112,114,111,112,101,114,32,114,101,45,105,110,105,116,105,97,108,105,122,97,116,105,111,110,32,100,101,116,101,99,116,101,100,32,105,110,32,82,78,71,0,115,101,118,101,114,101,32,101,114,114,111,114,32,103,101,116,116,105,110,103,32,114,97,110,100,111,109,10,0,102,105,112,115,95,114,110,103,95,105,115,95,108,111,99,107,101,100,0,120,57,51,49,95,97,101,115,95,100,114,105,118,101,114,0,114,110,103,95,99,116,120,45,62,99,105,112,104,101,114,95,104,100,0,114,110,103,95,99,116,120,45,62,105,115,95,115,101,101,100,101,100,0,116,101,109,112,118,97,108,117,101,95,102,111,114,95,120,57,51,49,95,97,101,115,95,100,114,105,118,101,114,0,100,117,112,108,105,99,97,116,101,32,49,50,56,32,98,105,116,32,98,108,111,99,107,32,114,101,116,117,114,110,101,100,32,98,121,32,82,78,71,0,108,101,110,103,116,104,32,61,61,32,49,54,0,101,110,99,114,121,112,116,95,97,101,115,0,65,69,83,32,101,110,99,114,121,112,116,105,111,110,32,105,110,32,82,78,71,32,102,97,105,108,101,100,58,32,37,115,10,0,120,57,51,49,95,103,101,116,95,100,116,0,103,101,116,116,105,109,101,111,102,100,97,121,40,41,32,102,97,105,108,101,100,58,32,37,115,10,0,120,57,51,49,95,114,101,115,101,101,100,0,120,57,51,49,95,103,101,110,101,114,97,116,101,95,115,101,101,100,0,33,101,110,116,114,111,112,121,95,99,111,108,108,101,99,116,95,98,117,102,102,101,114,0,103,101,116,95,101,110,116,114,111,112,121,0,101,114,114,111,114,32,103,101,116,116,105,110,103,32,101,110,116,114,111,112,121,32,100,97,116,97,10,0,101,110,116,114,111,112,121,95,99,111,108,108,101,99,116,95,99,98,0,101,110,116,114,111,112,121,95,99,111,108,108,101,99,116,95,98,117,102,102,101,114,0,120,57,51,49,95,103,101,110,101,114,97,116,101,95,107,101,121,0,101,114,114,111,114,32,99,114,101,97,116,105,110,103,32,99,105,112,104,101,114,32,99,111,110,116,101,120,116,32,102,111,114,32,82,78,71,58,32,37,115,10,0,101,114,114,111,114,32,99,114,101,97,116,105,110,103,32,107,101,121,32,102,111,114,32,82,78,71,58,32,37,115,10,0,115,101,108,102,116,101,115,116,95,107,97,116,0,101,114,114,111,114,32,99,114,101,97,116,105,110,103,32,99,105,112,104,101,114,32,99,111,110,116,101,120,116,32,102,111,114,32,82,78,71,0,185,202,127,214,160,245,211,66,25,109,132,145,118,28,59,190,72,178,130,152,104,194,128,0,0,0,40,24,0,0,37,0,82,23,141,41,162,213,132,18,157,137,154,69,130,2,247,119,66,156,8,61,130,244,138,64,102,181,73,39,171,66,199,195,14,183,97,60,254,176,190,115,247,110,109,111,29,163,20,250,187,75,193,14,197,251,205,70,190,40,97,231,3,43,55,125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,247,149,189,74,82,226,158,215,19,211,19,250,32,233,141,188,200,209,229,17,89,82,247,250,55,56,180,197,206,178,176,154,13,156,197,13,22,225,188,237,207,96,98,9,157,32,131,126,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,128,0,129,1,130,2,131,3,160,32,161,33,162,34,163,35,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,150,237,204,195,221,4,127,117,99,25,55,111,21,34,87,86,122,20,118,119,149,23,126,200,146,232,221,21,203,31,188,177,37,62,46,162,65,27,221,245,33,72,65,113,179,141,47,76,101,114,114,111,114,32,115,101,116,116,105,110,103,32,107,101,121,32,102,111,114,32,82,78,71,0,88,57,46,51,49,32,82,78,71,32,99,111,114,101,32,102,117,110,99,116,105,111,110,32,102,97,105,108,101,100,0,82,78,71,32,111,117,116,112,117,116,32,100,111,101,115,32,110,111,116,32,109,97,116,99,104,32,107,110,111,119,110,32,118,97,108,117,101,0,102,111,114,107,32,100,101,116,101,99,116,105,111,110,32,102,97,105,108,101,100,0,114,97,110,100,111,109,0,75,65,84,0,102,97,105,108,101,100,32,116,111,32,114,101,108,101,97,115,101,32,116,104,101,32,83,121,115,116,101,109,32,82,78,71,32,108,111,99,107,58,32,37,115,10,0,102,97,105,108,101,100,32,116,111,32,97,99,113,117,105,114,101,32,116,104,101,32,83,121,115,116,101,109,32,82,78,71,32,108,111,99,107,58,32,37,115,10,0,98,117,102,102,101,114,0,114,97,110,100,111,109,45,115,121,115,116,101,109,46,99,0,103,101,116,95,114,97,110,100,111,109,0,101,114,114,111,114,32,114,101,97,100,105,110,103,32,114,97,110,100,111,109,32,102,114,111,109,32,115,121,115,116,101,109,32,82,78,71,32,40,114,99,61,37,100,41,10,0,115,121,115,116,101,109,95,114,110,103,95,105,115,95,108,111,99,107,101,100,0,114,101,97,100,95,99,98,0,114,101,97,100,95,99,98,95,98,117,102,102,101,114,0,47,100,101,118,47,114,97,110,100,111,109,0,47,100,101,118,47,117,114,97,110,100,111,109,0,110,101,101,100,95,101,110,116,114,111,112,121,0,115,101,108,101,99,116,40,41,32,101,114,114,111,114,58,32,37,115,10,0,98,111,103,117,115,32,114,101,97,100,32,102,114,111,109,32,114,97,110,100,111,109,32,100,101,118,105,99,101,32,40,110,61,37,100,41,10,0,114,101,97,100,32,101,114,114,111,114,32,111,110,32,114,97,110,100,111,109,32,100,101,118,105,99,101,58,32,37,115,10,0,111,112,101,110,95,100,101,118,95,114,97,110,100,111,109,0,119,97,105,116,95,100,101,118,95,114,97,110,100,111,109,0,99,97,110,39,116,32,111,112,101,110,32,37,115,58,32,37,115,10,0,101,114,114,111,114,32,115,101,116,116,105,110,103,32,70,68,95,67,76,79,69,88,69,67,32,111,110,32,102,100,32,37,100,58,32,37,115,10,0,99,104,111,111,115,105,110,103,32,97,32,114,97,110,100,111,109,32,107,32,111,102,32,37,117,32,98,105,116,115,32,97,116,32,115,101,99,108,101,118,101,108,32,37,100,10,0,9,107,32,116,111,111,32,108,97,114,103,101,32,45,32,97,103,97,105,110,10,0,9,107,32,105,115,32,122,101,114,111,32,45,32,97,103,97,105,110,10,0,1,0,101,99,100,115,97,32,115,105,103,110,32,104,97,115,104,32,32,0,101,99,100,115,97,32,115,105,103,110,32,114,101,115,117,108,116,32,114,32,0,101,99,100,115,97,32,115,105,103,110,32,114,101,115,117,108,116,32,115,32,0,103,111,115,116,32,115,105,103,110,32,104,97,115,104,32,32,0,101,99,99,32,115,105,103,110,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,10,0,103,111,115,116,32,115,105,103,110,32,114,101,115,117,108,116,32,114,32,0,103,111,115,116,32,115,105,103,110,32,114,101,115,117,108,116,32,115,32,0,101,99,99,32,118,101,114,105,102,121,58,32,82,101,106,101,99,116,101,100,10,0,101,99,99,32,118,101,114,105,102,121,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,10,0,32,32,32,32,32,120,0,32,32,32,32,32,114,0,32,32,32,32,32,115,0,101,99,99,32,118,101,114,105,102,121,58,32,78,111,116,32,118,101,114,105,102,105,101,100,10,0,101,99,99,32,118,101,114,105,102,121,58,32,65,99,99,101,112,116,101,100,10,0,33,34,108,111,99,107,32,65,66,73,32,118,101,114,115,105,111,110,34,0,112,111,115,105,120,45,108,111,99,107,46,99,0,103,101,116,95,108,111,99,107,95,111,98,106,101,99,116,0,33,115,116,114,101,97,109,45,62,102,108,97,103,115,46,119,114,105,116,105,110,103,0,101,115,116,114,101,97,109,46,99,0,101,115,95,101,109,112,116,121,0,115,116,114,101,97,109,45,62,102,108,97,103,115,46,119,114,105,116,105,110,103,0,101,115,95,102,108,117,115,104,0,83,117,99,99,101,115,115,0,71,101,110,101,114,97,108,32,101,114,114,111,114,0,85,110,107,110,111,119,110,32,112,97,99,107,101,116,0,85,110,107,110,111,119,110,32,118,101,114,115,105,111,110,32,105,110,32,112,97,99,107,101,116,0,73,110,118,97,108,105,100,32,112,117,98,108,105,99,32,107,101,121,32,97,108,103,111,114,105,116,104,109,0,73,110,118,97,108,105,100,32,100,105,103,101,115,116,32,97,108,103,111,114,105,116,104,109,0,66,97,100,32,112,117,98,108,105,99,32,107,101,121,0,66,97,100,32,115,101,99,114,101,116,32,107,101,121,0,66,97,100,32,115,105,103,110,97,116,117,114,101,0,78,111,32,112,117,98,108,105,99,32,107,101,121,0,67,104,101,99,107,115,117,109,32,101,114,114,111,114,0,66,97,100,32,112,97,115,115,112,104,114,97,115,101,0,73,110,118,97,108,105,100,32,99,105,112,104,101,114,32,97,108,103,111,114,105,116,104,109,0,75,101,121,114,105,110,103,32,111,112,101,110,0,73,110,118,97,108,105,100,32,112,97,99,107,101,116,0,73,110,118,97,108,105,100,32,97,114,109,111,114,0,78,111,32,117,115,101,114,32,73,68,0,78,111,32,115,101,99,114,101,116,32,107,101,121,0,87,114,111,110,103,32,115,101,99,114,101,116,32,107,101,121,32,117,115,101,100,0,66,97,100,32,115,101,115,115,105,111,110,32,107,101,121,0,85,110,107,110,111,119,110,32,99,111,109,112,114,101,115,115,105,111,110,32,97,108,103,111,114,105,116,104,109,0,78,117,109,98,101,114,32,105,115,32,110,111,116,32,112,114,105,109,101,0,73,110,118,97,108,105,100,32,101,110,99,111,100,105,110,103,32,109,101,116,104,111,100,0,73,110,118,97,108,105,100,32,101,110,99,114,121,112,116,105,111,110,32,115,99,104,101,109,101,0,73,110,118,97,108,105,100,32,115,105,103,110,97,116,117,114,101,32,115,99,104,101,109,101,0,73,110,118,97,108,105,100,32,97,116,116,114,105,98,117,116,101,0,78,111,32,118,97,108,117,101,0,78,111,116,32,102,111,117,110,100,0,86,97,108,117,101,32,110,111,116,32,102,111,117,110,100,0,83,121,110,116,97,120,32,101,114,114,111,114,0,66,97,100,32,77,80,73,32,118,97,108,117,101,0,73,110,118,97,108,105,100,32,112,97,115,115,112,104,114,97,115,101,0,73,110,118,97,108,105,100,32,115,105,103,110,97,116,117,114,101,32,99,108,97,115,115,0,82,101,115,111,117,114,99,101,115,32,101,120,104,97,117,115,116,101,100,0,73,110,118,97,108,105,100,32,107,101,121,114,105,110,103,0,84,114,117,115,116,32,68,66,32,101,114,114,111,114,0,66,97,100,32,99,101,114,116,105,102,105,99,97,116,101,0,73,110,118,97,108,105,100,32,117,115,101,114,32,73,68,0,85,110,101,120,112,101,99,116,101,100,32,101,114,114,111,114,0,84,105,109,101,32,99,111,110,102,108,105,99,116,0,75,101,121,115,101,114,118,101,114,32,101,114,114,111,114,0,87,114,111,110,103,32,112,117,98,108,105,99,32,107,101,121,32,97,108,103,111,114,105,116,104,109,0,84,114,105,98,117,116,101,32,116,111,32,68,46,32,65,46,0,87,101,97,107,32,101,110,99,114,121,112,116,105,111,110,32,107,101,121,0,73,110,118,97,108,105,100,32,107,101,121,32,108,101,110,103,116,104,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,83,121,110,116,97,120,32,101,114,114,111,114,32,105,110,32,85,82,73,0,73,110,118,97,108,105,100,32,85,82,73,0,78,101,116,119,111,114,107,32,101,114,114,111,114,0,85,110,107,110,111,119,110,32,104,111,115,116,0,83,101,108,102,116,101,115,116,32,102,97,105,108,101,100,0,68,97,116,97,32,110,111,116,32,101,110,99,114,121,112,116,101,100,0,68,97,116,97,32,110,111,116,32,112,114,111,99,101,115,115,101,100,0,85,110,117,115,97,98,108,101,32,112,117,98,108,105,99,32,107,101,121,0,85,110,117,115,97,98,108,101,32,115,101,99,114,101,116,32,107,101,121,0,73,110,118,97,108,105,100,32,118,97,108,117,101,0,66,97,100,32,99,101,114,116,105,102,105,99,97,116,101,32,99,104,97,105,110,0,77,105,115,115,105,110,103,32,99,101,114,116,105,102,105,99,97,116,101,0,78,111,32,100,97,116,97,0,66,117,103,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,73,110,118,97,108,105,100,32,111,112,101,114,97,116,105,111,110,32,99,111,100,101,0,84,105,109,101,111,117,116,0,73,110,116,101,114,110,97,108,32,101,114,114,111,114,0,69,79,70,32,40,103,99,114,121,112,116,41,0,73,110,118,97,108,105,100,32,111,98,106,101,99,116,0,80,114,111,118,105,100,101,100,32,111,98,106,101,99,116,32,105,115,32,116,111,111,32,115,104,111,114,116,0,80,114,111,118,105,100,101,100,32,111,98,106,101,99,116,32,105,115,32,116,111,111,32,108,97,114,103,101,0,77,105,115,115,105,110,103,32,105,116,101,109,32,105,110,32,111,98,106,101,99,116,0,78,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,67,111,110,102,108,105,99,116,105,110,103,32,117,115,101,0,73,110,118,97,108,105,100,32,99,105,112,104,101,114,32,109,111,100,101,0,73,110,118,97,108,105,100,32,102,108,97,103,0,73,110,118,97,108,105,100,32,104,97,110,100,108,101,0,82,101,115,117,108,116,32,116,114,117,110,99,97,116,101,100,0,73,110,99,111,109,112,108,101,116,101,32,108,105,110,101,0,73,110,118,97,108,105,100,32,114,101,115,112,111,110,115,101,0,78,111,32,97,103,101,110,116,32,114,117,110,110,105,110,103,0,65,103,101,110,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,100,97,116,97,0,85,110,115,112,101,99,105,102,105,99,32,65,115,115,117,97,110,32,115,101,114,118,101,114,32,102,97,117,108,116,0,71,101,110,101,114,97,108,32,65,115,115,117,97,110,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,115,101,115,115,105,111,110,32,107,101,121,0,73,110,118,97,108,105,100,32,83,45,101,120,112,114,101,115,115,105,111,110,0,85,110,115,117,112,112,111,114,116,101,100,32,97,108,103,111,114,105,116,104,109,0,78,111,32,112,105,110,101,110,116,114,121,0,112,105,110,101,110,116,114,121,32,101,114,114,111,114,0,66,97,100,32,80,73,78,0,73,110,118,97,108,105,100,32,110,97,109,101,0,66,97,100,32,100,97,116,97,0,73,110,118,97,108,105,100,32,112,97,114,97,109,101,116,101,114,0,87,114,111,110,103,32,99,97,114,100,0,78,111,32,100,105,114,109,110,103,114,0,100,105,114,109,110,103,114,32,101,114,114,111,114,0,67,101,114,116,105,102,105,99,97,116,101,32,114,101,118,111,107,101,100,0,78,111,32,67,82,76,32,107,110,111,119,110,0,67,82,76,32,116,111,111,32,111,108,100,0,76,105,110,101,32,116,111,111,32,108,111,110,103,0,78,111,116,32,116,114,117,115,116,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,108,101,100,0,66,97,100,32,67,65,32,99,101,114,116,105,102,105,99,97,116,101,0,67,101,114,116,105,102,105,99,97,116,101,32,101,120,112,105,114,101,100,0,67,101,114,116,105,102,105,99,97,116,101,32,116,111,111,32,121,111,117,110,103,0,85,110,115,117,112,112,111,114,116,101,100,32,99,101,114,116,105,102,105,99,97,116,101,0,85,110,107,110,111,119,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,85,110,115,117,112,112,111,114,116,101,100,32,112,114,111,116,101,99,116,105,111,110,0,67,111,114,114,117,112,116,101,100,32,112,114,111,116,101,99,116,105,111,110,0,65,109,98,105,103,117,111,117,115,32,110,97,109,101,0,67,97,114,100,32,101,114,114,111,114,0,67,97,114,100,32,114,101,115,101,116,32,114,101,113,117,105,114,101,100,0,67,97,114,100,32,114,101,109,111,118,101,100,0,73,110,118,97,108,105,100,32,99,97,114,100,0,67,97,114,100,32,110,111,116,32,112,114,101,115,101,110,116,0,78,111,32,80,75,67,83,49,53,32,97,112,112,108,105,99,97,116,105,111,110,0,78,111,116,32,99,111,110,102,105,114,109,101,100,0,67,111,110,102,105,103,117,114,97,116,105,111,110,32,101,114,114,111,114,0,78,111,32,112,111,108,105,99,121,32,109,97,116,99,104,0,73,110,118,97,108,105,100,32,105,110,100,101,120,0,73,110,118,97,108,105,100,32,73,68,0,78,111,32,83,109,97,114,116,67,97,114,100,32,100,97,101,109,111,110,0,83,109,97,114,116,67,97,114,100,32,100,97,101,109,111,110,32,101,114,114,111,114,0,85,110,115,117,112,112,111,114,116,101,100,32,112,114,111,116,111,99,111,108,0,66,97,100,32,80,73,78,32,109,101,116,104,111,100,0,67,97,114,100,32,110,111,116,32,105,110,105,116,105,97,108,105,122,101,100,0,85,110,115,117,112,112,111,114,116,101,100,32,111,112,101,114,97,116,105,111,110,0,87,114,111,110,103,32,107,101,121,32,117,115,97,103,101,0,78,111,116,104,105,110,103,32,102,111,117,110,100,0,87,114,111,110,103,32,98,108,111,98,32,116,121,112,101,0,77,105,115,115,105,110,103,32,118,97,108,117,101,0,72,97,114,100,119,97,114,101,32,112,114,111,98,108,101,109,0,80,73,78,32,98,108,111,99,107,101,100,0,67,111,110,100,105,116,105,111,110,115,32,111,102,32,117,115,101,32,110,111,116,32,115,97,116,105,115,102,105,101,100,0,80,73,78,115,32,97,114,101,32,110,111,116,32,115,121,110,99,101,100,0,73,110,118,97,108,105,100,32,67,82,76,0,66,69,82,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,66,69,82,0,69,108,101,109,101,110,116,32,110,111,116,32,102,111,117,110,100,0,73,100,101,110,116,105,102,105,101,114,32,110,111,116,32,102,111,117,110,100,0,73,110,118,97,108,105,100,32,116,97,103,0,73,110,118,97,108,105,100,32,108,101,110,103,116,104,0,73,110,118,97,108,105,100,32,107,101,121,32,105,110,102,111,0,85,110,101,120,112,101,99,116,101,100,32,116,97,103,0,78,111,116,32,68,69,82,32,101,110,99,111,100,101,100,0,78,111,32,67,77,83,32,111,98,106,101,99,116,0,73,110,118,97,108,105,100,32,67,77,83,32,111,98,106,101,99,116,0,85,110,107,110,111,119,110,32,67,77,83,32,111,98,106,101,99,116,0,85,110,115,117,112,112,111,114,116,101,100,32,67,77,83,32,111,98,106,101,99,116,0,85,110,115,117,112,112,111,114,116,101,100,32,101,110,99,111,100,105,110,103,0,85,110,115,117,112,112,111,114,116,101,100,32,67,77,83,32,118,101,114,115,105,111,110,0,85,110,107,110,111,119,110,32,97,108,103,111,114,105,116,104,109,0,73,110,118,97,108,105,100,32,99,114,121,112,116,111,32,101,110,103,105,110,101,0,80,117,98,108,105,99,32,107,101,121,32,110,111,116,32,116,114,117,115,116,101,100,0,68,101,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,0,75,101,121,32,101,120,112,105,114,101,100,0,83,105,103,110,97,116,117,114,101,32,101,120,112,105,114,101,100,0,69,110,99,111,100,105,110,103,32,112,114,111,98,108,101,109,0,73,110,118,97,108,105,100,32,115,116,97,116,101,0,68,117,112,108,105,99,97,116,101,100,32,118,97,108,117,101,0,77,105,115,115,105,110,103,32,97,99,116,105,111,110,0,65,83,78,46,49,32,109,111,100,117,108,101,32,110,111,116,32,102,111,117,110,100,0,73,110,118,97,108,105,100,32,79,73,68,32,115,116,114,105,110,103,0,73,110,118,97,108,105,100,32,116,105,109,101,0,73,110,118,97,108,105,100,32,67,82,76,32,111,98,106,101,99,116,0,85,110,115,117,112,112,111,114,116,101,100,32,67,82,76,32,118,101,114,115,105,111,110,0,73,110,118,97,108,105,100,32,99,101,114,116,105,102,105,99,97,116,101,32,111,98,106,101,99,116,0,85,110,107,110,111,119,110,32,110,97,109,101,0,65,32,108,111,99,97,108,101,32,102,117,110,99,116,105,111,110,32,102,97,105,108,101,100,0,78,111,116,32,108,111,99,107,101,100,0,80,114,111,116,111,99,111,108,32,118,105,111,108,97,116,105,111,110,0,73,110,118,97,108,105,100,32,77,65,67,0,73,110,118,97,108,105,100,32,114,101,113,117,101,115,116,0,85,110,107,110,111,119,110,32,101,120,116,101,110,115,105,111,110,0,85,110,107,110,111,119,110,32,99,114,105,116,105,99,97,108,32,101,120,116,101,110,115,105,111,110,0,76,111,99,107,101,100,0,85,110,107,110,111,119,110,32,111,112,116,105,111,110,0,85,110,107,110,111,119,110,32,99,111,109,109,97,110,100,0,78,111,116,32,111,112,101,114,97,116,105,111,110,97,108,0,78,111,32,112,97,115,115,112,104,114,97,115,101,32,103,105,118,101,110,0,78,111,32,80,73,78,32,103,105,118,101,110,0,78,111,116,32,101,110,97,98,108,101,100,0,78,111,32,99,114,121,112,116,111,32,101,110,103,105,110,101,0,77,105,115,115,105,110,103,32,107,101,121,0,84,111,111,32,109,97,110,121,32,111,98,106,101,99,116,115,0,76,105,109,105,116,32,114,101,97,99,104,101,100,0,78,111,116,32,105,110,105,116,105,97,108,105,122,101,100,0,77,105,115,115,105,110,103,32,105,115,115,117,101,114,32,99,101,114,116,105,102,105,99,97,116,101,0,78,111,32,107,101,121,115,101,114,118,101,114,32,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,101,108,108,105,112,116,105,99,32,99,117,114,118,101,0,85,110,107,110,111,119,110,32,101,108,108,105,112,116,105,99,32,99,117,114,118,101,0,68,117,112,108,105,99,97,116,101,100,32,107,101,121,0,65,109,98,105,103,117,111,117,115,32,114,101,115,117,108,116,0,78,111,32,99,114,121,112,116,111,32,99,111,110,116,101,120,116,0,87,114,111,110,103,32,99,114,121,112,116,111,32,99,111,110,116,101,120,116,0,66,97,100,32,99,114,121,112,116,111,32,99,111,110,116,101,120,116,0,67,111,110,102,108,105,99,116,32,105,110,32,116,104,101,32,99,114,121,112,116,111,32,99,111,110,116,101,120,116,0,66,114,111,107,101,110,32,112,117,98,108,105,99,32,107,101,121,0,66,114,111,107,101,110,32,115,101,99,114,101,116,32,107,101,121,0,73,110,118,97,108,105,100,32,77,65,67,32,97,108,103,111,114,105,116,104,109,0,79,112,101,114,97,116,105,111,110,32,102,117,108,108,121,32,99,97,110,99,101,108,108,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,121,101,116,32,102,105,110,105,115,104,101,100,0,66,117,102,102,101,114,32,116,111,111,32,115,104,111,114,116,0,73,110,118,97,108,105,100,32,108,101,110,103,116,104,32,115,112,101,99,105,102,105,101,114,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,83,116,114,105,110,103,32,116,111,111,32,108,111,110,103,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,85,110,109,97,116,99,104,101,100,32,112,97,114,101,110,116,104,101,115,101,115,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,83,45,101,120,112,114,101,115,115,105,111,110,32,110,111,116,32,99,97,110,111,110,105,99,97,108,0,66,97,100,32,99,104,97,114,97,99,116,101,114,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,66,97,100,32,113,117,111,116,97,116,105,111,110,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,90,101,114,111,32,112,114,101,102,105,120,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,78,101,115,116,101,100,32,100,105,115,112,108,97,121,32,104,105,110,116,115,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,85,110,109,97,116,99,104,101,100,32,100,105,115,112,108,97,121,32,104,105,110,116,115,0,85,110,101,120,112,101,99,116,101,100,32,114,101,115,101,114,118,101,100,32,112,117,110,99,116,117,97,116,105,111,110,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,66,97,100,32,104,101,120,97,100,101,99,105,109,97,108,32,99,104,97,114,97,99,116,101,114,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,79,100,100,32,104,101,120,97,100,101,99,105,109,97,108,32,110,117,109,98,101,114,115,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,66,97,100,32,111,99,116,97,108,32,99,104,97,114,97,99,116,101,114,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,76,101,103,97,99,121,32,107,101,121,0,82,101,113,117,101,115,116,32,116,111,111,32,115,104,111,114,116,0,82,101,113,117,101,115,116,32,116,111,111,32,108,111,110,103,0,79,98,106,101,99,116,32,105,115,32,105,110,32,116,101,114,109,105,110,97,116,105,111,110,32,115,116,97,116,101,0,78,111,32,99,101,114,116,105,102,105,99,97,116,101,32,99,104,97,105,110,0,67,101,114,116,105,102,105,99,97,116,101,32,105,115,32,116,111,111,32,108,97,114,103,101,0,73,110,118,97,108,105,100,32,114,101,99,111,114,100,0,84,104,101,32,77,65,67,32,100,111,101,115,32,110,111,116,32,118,101,114,105,102,121,0,85,110,101,120,112,101,99,116,101,100,32,109,101,115,115,97,103,101,0,67,111,109,112,114,101,115,115,105,111,110,32,111,114,32,100,101,99,111,109,112,114,101,115,115,105,111,110,32,102,97,105,108,101,100,0,65,32,99,111,117,110,116,101,114,32,119,111,117,108,100,32,119,114,97,112,0,70,97,116,97,108,32,97,108,101,114,116,32,109,101,115,115,97,103,101,32,114,101,99,101,105,118,101,100,0,78,111,32,99,105,112,104,101,114,32,97,108,103,111,114,105,116,104,109,0,77,105,115,115,105,110,103,32,99,108,105,101,110,116,32,99,101,114,116,105,102,105,99,97,116,101,0,67,108,111,115,101,32,110,111,116,105,102,105,99,97,116,105,111,110,32,114,101,99,101,105,118,101,100,0,84,105,99,107,101,116,32,101,120,112,105,114,101,100,0,66,97,100,32,116,105,99,107,101,116,0,85,110,107,110,111,119,110,32,105,100,101,110,116,105,116,121,0,66,97,100,32,99,101,114,116,105,102,105,99,97,116,101,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,99,101,114,116,105,102,105,99,97,116,101,32,114,101,113,117,101,115,116,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,99,101,114,116,105,102,105,99,97,116,101,32,118,101,114,105,102,121,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,99,104,97,110,103,101,32,99,105,112,104,101,114,32,109,101,115,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,99,108,105,101,110,116,32,104,101,108,108,111,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,115,101,114,118,101,114,32,104,101,108,108,111,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,115,101,114,118,101,114,32,104,101,108,108,111,32,100,111,110,101,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,115,104,97,107,101,0,66,97,100,32,102,105,110,105,115,104,101,100,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,115,101,114,118,101,114,32,107,101,121,32,101,120,99,104,97,110,103,101,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,99,108,105,101,110,116,32,107,101,121,32,101,120,99,104,97,110,103,101,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,111,103,117,115,32,115,116,114,105,110,103,0,70,111,114,98,105,100,100,101,110,0,75,101,121,32,100,105,115,97,98,108,101,100,0,78,111,116,32,112,111,115,115,105,98,108,101,32,119,105,116,104,32,97,32,99,97,114,100,32,98,97,115,101,100,32,107,101,121,0,73,110,118,97,108,105,100,32,108,111,99,107,32,111,98,106,101,99,116,0,71,101,110,101,114,97,108,32,73,80,67,32,101,114,114,111,114,0,73,80,67,32,97,99,99,101,112,116,32,99,97,108,108,32,102,97,105,108,101,100,0,73,80,67,32,99,111,110,110,101,99,116,32,99,97,108,108,32,102,97,105,108,101,100,0,73,110,118,97,108,105,100,32,73,80,67,32,114,101,115,112,111,110,115,101,0,73,110,118,97,108,105,100,32,118,97,108,117,101,32,112,97,115,115,101,100,32,116,111,32,73,80,67,0,73,110,99,111,109,112,108,101,116,101,32,108,105,110,101,32,112,97,115,115,101,100,32,116,111,32,73,80,67,0,76,105,110,101,32,112,97,115,115,101,100,32,116,111,32,73,80,67,32,116,111,111,32,108,111,110,103,0,78,101,115,116,101,100,32,73,80,67,32,99,111,109,109,97,110,100,115,0,78,111,32,100,97,116,97,32,99,97,108,108,98,97,99,107,32,105,110,32,73,80,67,0,78,111,32,105,110,113,117,105,114,101,32,99,97,108,108,98,97,99,107,32,105,110,32,73,80,67,0,78,111,116,32,97,110,32,73,80,67,32,115,101,114,118,101,114,0,78,111,116,32,97,110,32,73,80,67,32,99,108,105,101,110,116,0,80,114,111,98,108,101,109,32,115,116,97,114,116,105,110,103,32,73,80,67,32,115,101,114,118,101,114,0,73,80,67,32,114,101,97,100,32,101,114,114,111,114,0,73,80,67,32,119,114,105,116,101,32,101,114,114,111,114,0,84,111,111,32,109,117,99,104,32,100,97,116,97,32,102,111,114,32,73,80,67,32,108,97,121,101,114,0,85,110,101,120,112,101,99,116,101,100,32,73,80,67,32,99,111,109,109,97,110,100,0,85,110,107,110,111,119,110,32,73,80,67,32,99,111,109,109,97,110,100,0,73,80,67,32,115,121,110,116,97,120,32,101,114,114,111,114,0,73,80,67,32,99,97,108,108,32,104,97,115,32,98,101,101,110,32,99,97,110,99,101,108,108,101,100,0,78,111,32,105,110,112,117,116,32,115,111,117,114,99,101,32,102,111,114,32,73,80,67,0,78,111,32,111,117,116,112,117,116,32,115,111,117,114,99,101,32,102,111,114,32,73,80,67,0,73,80,67,32,112,97,114,97,109,101,116,101,114,32,101,114,114,111,114,0,85,110,107,110,111,119,110,32,73,80,67,32,105,110,113,117,105,114,101,0,71,101,110,101,114,97,108,32,76,68,65,80,32,101,114,114,111,114,0,71,101,110,101,114,97,108,32,76,68,65,80,32,97,116,116,114,105,98,117,116,101,32,101,114,114,111,114,0,71,101,110,101,114,97,108,32,76,68,65,80,32,110,97,109,101,32,101,114,114,111,114,0,71,101,110,101,114,97,108,32,76,68,65,80,32,115,101,99,117,114,105,116,121,32,101,114,114,111,114,0,71,101,110,101,114,97,108,32,76,68,65,80,32,115,101,114,118,105,99,101,32,101,114,114,111,114,0,71,101,110,101,114,97,108,32,76,68,65,80,32,117,112,100,97,116,101,32,101,114,114,111,114,0,69,120,112,101,114,105,109,101,110,116,97,108,32,76,68,65,80,32,101,114,114,111,114,32,99,111,100,101,0,80,114,105,118,97,116,101,32,76,68,65,80,32,101,114,114,111,114,32,99,111,100,101,0,79,116,104,101,114,32,103,101,110,101,114,97,108,32,76,68,65,80,32,101,114,114,111,114,0,76,68,65,80,32,99,111,110,110,101,99,116,105,110,103,32,102,97,105,108,101,100,32,40,88,41,0,76,68,65,80,32,114,101,102,101,114,114,97,108,32,108,105,109,105,116,32,101,120,99,101,101,100,101,100,0,76,68,65,80,32,99,108,105,101,110,116,32,108,111,111,112,0,78,111,32,76,68,65,80,32,114,101,115,117,108,116,115,32,114,101,116,117,114,110,101,100,0,76,68,65,80,32,99,111,110,116,114,111,108,32,110,111,116,32,102,111,117,110,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,76,68,65,80,0,76,68,65,80,32,99,111,110,110,101,99,116,32,101,114,114,111,114,0,79,117,116,32,111,102,32,109,101,109,111,114,121,32,105,110,32,76,68,65,80,0,66,97,100,32,112,97,114,97,109,101,116,101,114,32,116,111,32,97,110,32,76,68,65,80,32,114,111,117,116,105,110,101,0,85,115,101,114,32,99,97,110,99,101,108,108,101,100,32,76,68,65,80,32,111,112,101,114,97,116,105,111,110,0,66,97,100,32,76,68,65,80,32,115,101,97,114,99,104,32,102,105,108,116,101,114,0,85,110,107,110,111,119,110,32,76,68,65,80,32,97,117,116,104,101,110,116,105,99,97,116,105,111,110,32,109,101,116,104,111,100,0,84,105,109,101,111,117,116,32,105,110,32,76,68,65,80,0,76,68,65,80,32,100,101,99,111,100,105,110,103,32,101,114,114,111,114,0,76,68,65,80,32,101,110,99,111,100,105,110,103,32,101,114,114,111,114,0,76,68,65,80,32,108,111,99,97,108,32,101,114,114,111,114,0,67,97,110,110,111,116,32,99,111,110,116,97,99,116,32,76,68,65,80,32,115,101,114,118,101,114,0,76,68,65,80,32,115,117,99,99,101,115,115,0,76,68,65,80,32,111,112,101,114,97,116,105,111,110,115,32,101,114,114,111,114,0,76,68,65,80,32,112,114,111,116,111,99,111,108,32,101,114,114,111,114,0,84,105,109,101,32,108,105,109,105,116,32,101,120,99,101,101,100,101,100,32,105,110,32,76,68,65,80,0,83,105,122,101,32,108,105,109,105,116,32,101,120,99,101,101,100,101,100,32,105,110,32,76,68,65,80,0,76,68,65,80,32,99,111,109,112,97,114,101,32,102,97,108,115,101,0,76,68,65,80,32,99,111,109,112,97,114,101,32,116,114,117,101,0,76,68,65,80,32,97,117,116,104,101,110,116,105,99,97,116,105,111,110,32,109,101,116,104,111,100,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,116,114,111,110,103,40,101,114,41,32,76,68,65,80,32,97,117,116,104,101,110,116,105,99,97,116,105,111,110,32,114,101,113,117,105,114,101,100,0,80,97,114,116,105,97,108,32,76,68,65,80,32,114,101,115,117,108,116,115,43,114,101,102,101,114,114,97,108,32,114,101,99,101,105,118,101,100,0,76,68,65,80,32,114,101,102,101,114,114,97,108,0,65,100,109,105,110,105,115,116,114,97,116,105,118,101,32,76,68,65,80,32,108,105,109,105,116,32,101,120,99,101,101,100,101,100,0,67,114,105,116,105,99,97,108,32,76,68,65,80,32,101,120,116,101,110,115,105,111,110,32,105,115,32,117,110,97,118,97,105,108,97,98,108,101,0,67,111,110,102,105,100,101,110,116,105,97,108,105,116,121,32,114,101,113,117,105,114,101,100,32,98,121,32,76,68,65,80,0,76,68,65,80,32,83,65,83,76,32,98,105,110,100,32,105,110,32,112,114,111,103,114,101,115,115,0,78,111,32,115,117,99,104,32,76,68,65,80,32,97,116,116,114,105,98,117,116,101,0,85,110,100,101,102,105,110,101,100,32,76,68,65,80,32,97,116,116,114,105,98,117,116,101,32,116,121,112,101,0,73,110,97,112,112,114,111,112,114,105,97,116,101,32,109,97,116,99,104,105,110,103,32,105,110,32,76,68,65,80,0,67,111,110,115,116,114,97,105,110,116,32,118,105,111,108,97,116,105,111,110,32,105,110,32,76,68,65,80,0,76,68,65,80,32,116,121,112,101,32,111,114,32,118,97,108,117,101,32,101,120,105,115,116,115,0,73,110,118,97,108,105,100,32,115,121,110,116,97,120,32,105,110,32,76,68,65,80,0,78,111,32,115,117,99,104,32,76,68,65,80,32,111,98,106,101,99,116,0,76,68,65,80,32,97,108,105,97,115,32,112,114,111,98,108,101,109,0,73,110,118,97,108,105,100,32,68,78,32,115,121,110,116,97,120,32,105,110,32,76,68,65,80,0,76,68,65,80,32,101,110,116,114,121,32,105,115,32,97,32,108,101,97,102,0,76,68,65,80,32,97,108,105,97,115,32,100,101,114,101,102,101,114,101,110,99,105,110,103,32,112,114,111,98,108,101,109,0,76,68,65,80,32,112,114,111,120,121,32,97,117,116,104,111,114,105,122,97,116,105,111,110,32,102,97,105,108,117,114,101,32,40,88,41,0,73,110,97,112,112,114,111,112,114,105,97,116,101,32,76,68,65,80,32,97,117,116,104,101,110,116,105,99,97,116,105,111,110,0,73,110,118,97,108,105,100,32,76,68,65,80,32,99,114,101,100,101,110,116,105,97,108,115,0,73,110,115,117,102,102,105,99,105,101,110,116,32,97,99,99,101,115,115,32,102,111,114,32,76,68,65,80,0,76,68,65,80,32,115,101,114,118,101,114,32,105,115,32,98,117,115,121,0,76,68,65,80,32,115,101,114,118,101,114,32,105,115,32,117,110,97,118,97,105,108,97,98,108,101,0,76,68,65,80,32,115,101,114,118,101,114,32,105,115,32,117,110,119,105,108,108,105,110,103,32,116,111,32,112,101,114,102,111,114,109,0,76,111,111,112,32,100,101,116,101,99,116,101,100,32,98,121,32,76,68,65,80,0,76,68,65,80,32,110,97,109,105,110,103,32,118,105,111,108,97,116,105,111,110,0,76,68,65,80,32,111,98,106,101,99,116,32,99,108,97,115,115,32,118,105,111,108,97,116,105,111,110,0,76,68,65,80,32,111,112,101,114,97,116,105,111,110,32,110,111,116,32,97,108,108,111,119,101,100,32,111,110,32,110,111,110,45,108,101,97,102,0,76,68,65,80,32,111,112,101,114,97,116,105,111,110,32,110,111,116,32,97,108,108,111,119,101,100,32,111,110,32,82,68,78,0,65,108,114,101,97,100,121,32,101,120,105,115,116,115,32,40,76,68,65,80,41,0,67,97,110,110,111,116,32,109,111,100,105,102,121,32,76,68,65,80,32,111,98,106,101,99,116,32,99,108,97,115,115,0,76,68,65,80,32,114,101,115,117,108,116,115,32,116,111,111,32,108,97,114,103,101,0,76,68,65,80,32,111,112,101,114,97,116,105,111,110,32,97,102,102,101,99,116,115,32,109,117,108,116,105,112,108,101,32,68,83,65,115,0,86,105,114,116,117,97,108,32,76,68,65,80,32,108,105,115,116,32,118,105,101,119,32,101,114,114,111,114,0,79,116,104,101,114,32,76,68,65,80,32,101,114,114,111,114,0,82,101,115,111,117,114,99,101,115,32,101,120,104,97,117,115,116,101,100,32,105,110,32,76,67,85,80,0,83,101,99,117,114,105,116,121,32,118,105,111,108,97,116,105,111,110,32,105,110,32,76,67,85,80,0,73,110,118,97,108,105,100,32,100,97,116,97,32,105,110,32,76,67,85,80,0,85,110,115,117,112,112,111,114,116,101,100,32,115,99,104,101,109,101,32,105,110,32,76,67,85,80,0,82,101,108,111,97,100,32,114,101,113,117,105,114,101,100,32,105,110,32,76,67,85,80,0,76,68,65,80,32,99,97,110,99,101,108,108,101,100,0,78,111,32,76,68,65,80,32,111,112,101,114,97,116,105,111,110,32,116,111,32,99,97,110,99,101,108,0,84,111,111,32,108,97,116,101,32,116,111,32,99,97,110,99,101,108,32,76,68,65,80,0,67,97,110,110,111,116,32,99,97,110,99,101,108,32,76,68,65,80,0,76,68,65,80,32,97,115,115,101,114,116,105,111,110,32,102,97,105,108,101,100,0,80,114,111,120,105,101,100,32,97,117,116,104,111,114,105,122,97,116,105,111,110,32,100,101,110,105,101,100,32,98,121,32,76,68,65,80,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,49,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,50,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,51,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,52,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,53,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,54,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,55,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,56,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,57,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,49,48,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,49,49,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,49,50,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+51200);allocate([101,32,49,51,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,49,52,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,49,53,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,49,54,0,83,121,115,116,101,109,32,101,114,114,111,114,32,119,47,111,32,101,114,114,110,111,0,85,110,107,110,111,119,110,32,115,121,115,116,101,109,32,101,114,114,111,114,0,69,110,100,32,111,102,32,102,105,108,101,0,85,110,107,110,111,119,110,32,101,114,114,111,114,32,99,111,100,101,0,97,109,111,117,110,116,46,99,0,84,65,76,69,82,95,97,109,111,117,110,116,95,99,109,112,0,84,65,76,69,82,95,97,109,111,117,110,116,95,115,117,98,116,114,97,99,116,0,84,65,76,69,82,95,97,109,111,117,110,116,95,97,100,100,0,49,46,54,46,49,0,108,105,98,103,99,114,121,112,116,32,118,101,114,115,105,111,110,32,109,105,115,109,97,116,99,104,10,0,70,97,116,97,108,32,101,114,114,111,114,32,105,110,32,108,105,98,103,99,114,121,112,116,58,32,37,115,10,0,99,114,121,112,116,111,46,99,0,65,115,115,101,114,116,105,111,110,32,102,97,105,108,101,100,32,97,116,32,37,115,58,37,100,46,10,0,116,97,108,101,114,45,99,111,105,110,45,100,101,114,105,118,97,116,105,111,110,0,84,65,76,69,82,95,115,101,116,117,112,95,102,114,101,115,104,95,99,111,105,110,0,18,17,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,17,34,35,36,17,37,38,39,40,41,42,43,44,17,45,46,47,16,16,48,16,16,16,16,16,16,16,49,50,51,16,52,53,16,16,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,54,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,55,17,17,17,17,56,17,57,58,59,60,61,62,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,63,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,64,65,17,66,67,68,69,70,71,72,73,16,16,16,74,75,76,77,78,16,16,16,79,80,16,16,16,16,81,16,16,16,16,16,16,16,16,16,17,17,17,82,83,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,84,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,85,16,16,16,16,86,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,87,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,88,89,90,91,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,92,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,254,255,255,7,254,255,255,7,0,0,0,0,0,4,32,4,255,255,127,255,255,255,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,195,255,3,0,31,80,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,223,60,64,215,255,255,251,255,255,255,255,255,255,255,255,255,191,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,3,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,254,255,255,255,127,2,254,255,255,255,255,0,0,0,0,0,255,191,182,0,255,255,255,7,7,0,0,0,255,7,255,255,255,255,255,255,255,254,255,195,255,255,255,255,255,255,255,255,255,255,255,255,239,31,254,225,255,159,0,0,255,255,255,255,255,255,0,224,255,255,255,255,255,255,255,255,255,255,255,255,3,0,255,255,255,255,255,7,48,4,255,255,255,252,255,31,0,0,255,255,255,1,0,0,0,0,0,0,0,0,253,31,0,0,0,0,0,0,240,3,255,127,255,255,255,255,255,255,255,239,255,223,225,255,207,255,254,254,238,159,249,255,255,253,197,227,159,89,128,176,207,255,3,0,238,135,249,255,255,253,109,195,135,25,2,94,192,255,63,0,238,191,251,255,255,253,237,227,191,27,1,0,207,255,0,0,238,159,249,255,255,253,237,227,159,25,192,176,207,255,2,0,236,199,61,214,24,199,255,195,199,29,129,0,192,255,0,0,238,223,253,255,255,253,239,227,223,29,96,3,207,255,0,0,236,223,253,255,255,253,239,227,223,29,96,64,207,255,6,0,236,223,253,255,255,255,255,231,223,93,128,0,207,255,0,252,236,255,127,252,255,255,251,47,127,128,95,255,0,0,12,0,254,255,255,255,255,127,255,7,63,32,255,3,0,0,0,0,150,37,240,254,174,236,255,59,95,32,255,243,0,0,0,0,1,0,0,0,255,3,0,0,255,254,255,255,255,31,254,255,3,255,255,254,255,255,255,31,0,0,0,0,0,0,0,0,255,255,255,255,255,255,127,249,255,3,255,255,231,193,255,255,127,64,255,51,255,255,255,255,191,32,255,255,255,255,255,247,255,255,255,255,255,255,255,255,255,61,127,61,255,255,255,255,255,61,255,255,255,255,61,127,61,255,127,255,255,255,255,255,255,255,61,255,255,255,255,255,255,255,255,135,0,0,0,0,255,255,0,0,255,255,255,255,255,255,255,255,255,255,31,0,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,159,255,255,254,255,255,7,255,255,255,255,255,255,255,255,255,199,1,0,255,223,15,0,255,255,15,0,255,255,15,0,255,223,13,0,255,255,255,255,255,255,207,255,255,1,128,16,255,3,0,0,0,0,255,3,255,255,255,255,255,255,255,255,255,255,255,0,255,255,255,255,255,7,255,255,255,255,255,255,255,255,63,0,255,255,255,31,255,15,255,1,192,255,255,255,255,63,31,0,255,255,255,255,255,15,255,255,255,3,255,3,0,0,0,0,255,255,255,15,255,255,255,255,255,255,255,127,254,255,31,0,255,3,255,3,128,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,239,255,239,15,255,3,0,0,0,0,255,255,255,255,255,243,255,255,255,255,255,255,191,255,3,0,255,255,255,255,255,255,63,0,255,227,255,255,255,255,255,63,0,0,0,0,0,0,0,0,0,0,0,0,0,222,111,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,255,255,63,63,255,255,255,255,63,63,255,170,255,255,255,63,255,255,255,255,255,255,223,95,220,31,207,15,255,31,220,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,128,0,0,255,31,0,0,0,0,0,0,0,0,0,0,0,0,132,252,47,62,80,189,255,243,224,67,0,0,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,255,255,255,255,255,255,3,0,0,255,255,255,255,255,127,255,255,255,255,255,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,120,12,0,255,255,255,255,191,32,255,255,255,255,255,255,255,128,0,0,255,255,127,0,127,127,127,127,127,127,127,127,255,255,255,255,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,0,0,0,254,3,62,31,254,255,255,255,255,255,255,255,255,255,127,224,254,255,255,255,255,255,255,255,255,255,255,247,224,255,255,255,255,63,254,255,255,255,255,255,255,255,255,255,255,127,0,0,255,255,255,7,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,0,0,0,0,0,0,0,255,255,255,255,255,63,255,31,255,255,255,15,0,0,255,255,255,255,255,127,240,143,255,255,255,128,255,255,255,255,255,255,255,255,255,255,0,0,0,0,128,255,252,255,255,255,255,255,255,255,255,255,255,255,255,121,15,0,255,7,0,0,0,0,0,0,0,0,0,255,187,247,255,255,255,0,0,0,255,255,255,255,255,255,15,0,255,255,255,255,255,255,255,255,15,0,255,3,0,0,252,8,255,255,255,255,255,7,255,255,255,255,7,0,255,255,255,31,255,255,255,255,255,255,247,255,0,128,255,3,0,0,0,0,255,255,255,255,255,255,127,0,255,63,255,3,255,255,127,4,255,255,255,255,255,255,255,127,5,0,0,56,255,255,60,0,126,126,126,0,127,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,7,255,3,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,0,255,255,127,248,255,255,255,255,255,15,255,255,255,255,255,255,255,255,255,255,255,255,255,63,255,255,255,255,255,255,255,255,255,255,255,255,255,3,0,0,0,0,127,0,248,224,255,253,127,95,219,255,255,255,255,255,255,255,255,255,255,255,255,255,3,0,0,0,248,255,255,255,255,255,255,255,255,255,255,255,255,63,0,0,255,255,255,255,255,255,255,255,252,255,255,255,255,255,255,0,0,0,0,0,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,223,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,0,255,3,254,255,255,7,254,255,255,7,192,255,255,255,255,255,255,255,255,255,255,127,252,252,252,28,0,0,0,0,255,239,255,255,127,255,255,183,255,63,255,63,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,7,0,0,0,0,0,0,0,0,255,255,255,255,255,255,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,31,255,255,255,255,255,255,1,0,0,0,0,0,255,255,255,127,0,0,255,255,255,7,0,0,0,0,0,0,255,255,255,63,255,255,255,255,15,255,62,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,255,3,0,0,0,0,0,0,0,0,0,0,63,253,255,255,255,255,191,145,255,255,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,63,0,255,255,255,3,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,192,0,0,0,0,0,0,0,0,111,240,239,254,255,255,15,0,0,0,0,0,255,255,255,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,63,0,255,255,63,0,255,255,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,63,0,0,0,192,255,0,0,252,255,255,255,255,255,255,1,0,0,255,255,255,1,255,3,255,255,255,255,255,255,199,255,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,30,0,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,63,0,255,3,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,31,0,255,255,255,255,255,127,0,0,248,255,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,223,255,255,255,255,255,255,255,255,223,100,222,255,235,239,255,255,255,255,255,255,255,191,231,223,223,255,255,255,123,95,252,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,255,255,255,253,255,255,247,255,255,255,247,255,255,223,255,255,255,223,255,255,127,255,255,255,127,255,255,255,253,255,255,255,253,255,255,247,207,255,255,255,255,255,255,239,255,255,255,150,254,247,10,132,234,150,170,150,247,247,94,255,251,255,15,238,251,255,15,0,0,0,0,0,0,0,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0,18,16,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,16,16,34,35,16,36,37,38,39,40,41,42,43,16,44,45,46,17,47,48,17,17,49,17,17,17,50,51,52,53,54,55,56,57,17,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,58,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,59,16,60,61,62,63,64,65,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,66,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,67,16,16,68,16,69,70,71,16,72,16,73,16,16,16,16,74,75,76,77,16,16,78,16,79,80,16,16,16,16,81,16,16,16,16,16,16,16,16,16,16,16,16,16,82,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,83,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,84,85,86,87,16,16,88,89,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,90,16,91,92,93,94,95,96,97,98,16,16,16,16,16,16,16,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,254,255,0,252,1,0,0,248,1,0,0,120,0,0,0,0,255,251,223,251,0,0,128,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,0,252,255,224,175,255,255,255,255,255,255,255,255,255,255,223,255,255,255,255,255,32,64,176,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,0,0,0,0,0,134,254,255,255,255,0,64,73,0,0,0,0,0,24,0,223,255,0,200,0,0,0,0,0,0,0,1,0,60,0,0,0,0,0,0,0,0,0,0,0,0,16,224,1,30,0,96,255,191,0,0,0,0,0,0,255,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,207,3,0,0,0,3,0,32,255,127,0,0,0,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,0,0,0,0,0,0,0,0,0,16,0,32,30,0,48,0,1,0,0,0,0,0,0,0,0,16,0,32,0,0,0,0,252,15,0,0,0,0,0,0,0,16,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,32,0,0,0,0,3,0,0,0,0,0,0,0,0,16,0,32,0,0,0,0,253,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,255,7,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,255,0,0,0,0,0,0,0,16,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,63,2,0,0,0,0,0,0,0,0,0,4,0,0,0,0,16,0,0,0,0,0,0,128,0,128,192,223,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,254,255,255,255,0,252,255,255,0,0,0,0,0,0,0,0,252,0,0,0,0,0,0,192,255,223,255,7,0,0,0,0,0,0,0,0,0,0,128,6,0,252,0,0,24,62,0,0,128,191,0,204,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,96,255,255,255,31,0,0,255,3,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,1,0,0,24,0,0,0,0,0,0,0,0,0,56,0,0,0,0,16,0,0,0,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,254,127,47,0,0,255,3,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,196,255,255,255,255,0,0,0,192,0,0,0,0,0,0,0,0,1,0,224,159,0,0,0,0,127,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,16,0,0,252,255,255,255,31,0,0,0,0,0,12,0,0,0,0,0,0,64,0,12,240,0,0,0,0,0,0,192,248,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,255,0,255,255,255,33,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,127,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,3,224,0,224,0,224,0,96,128,248,255,255,255,252,255,255,255,255,255,127,31,252,241,127,255,127,0,0,255,255,255,3,0,0,255,255,255,255,1,0,123,3,208,193,175,66,0,12,31,188,255,255,0,0,0,0,0,2,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,0,255,255,255,255,127,0,0,0,255,7,0,0,255,255,255,255,255,255,255,255,255,255,63,0,0,0,0,0,0,252,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,135,3,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,127,255,15,0,0,0,0,0,0,0,0,255,255,255,251,255,255,255,255,255,255,255,255,255,255,15,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,0,0,0,255,15,30,255,255,255,1,252,193,224,0,0,0,0,0,0,0,0,0,0,0,30,1,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,0,255,255,255,255,15,0,0,0,255,255,255,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,127,0,0,0,0,0,0,192,0,224,0,0,0,0,0,0,0,0,0,0,0,128,15,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,255,255,127,0,3,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,8,0,0,0,15,255,3,0,0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,16,192,0,0,255,255,3,7,0,0,0,0,0,248,0,0,0,0,8,128,0,0,0,0,0,0,0,0,0,0,8,0,255,63,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,0,0,128,11,0,0,0,0,0,0,0,128,2,0,0,192,0,0,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,255,255,255,3,127,0,255,255,255,255,247,255,127,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,254,255,0,252,1,0,0,248,1,0,0,248,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,127,0,48,135,255,255,255,255,255,143,255,0,0,0,0,0,0,224,255,255,7,255,15,0,0,0,0,0,0,255,255,255,255,255,63,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,143,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,135,255,0,255,1,0,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254,0,0,0,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,63,252,255,63,0,0,0,3,0,0,0,0,0,0,254,3,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,225,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,7,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,0,255,255,255,255,127,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,0,0,0,0,255,255,255,255,255,255,255,255,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,127,0,255,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,8,0,0,0,8,0,0,32,0,0,0,32,0,0,128,0,0,0,128,0,0,0,2,0,0,0,2,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,255,255,255,255,255,15,255,255,255,255,255,255,255,255,255,255,255,255,15,0,255,127,254,127,254,255,254,255,0,0,0,0,255,7,255,255,255,127,255,255,255,255,255,255,255,15,255,255,255,255,255,7,0,0,0,0,0,0,0,0,192,255,255,255,7,0,255,255,255,255,255,7,255,1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,191,255,255,255,255,255,255,255,255,31,255,255,15,0,255,255,255,255,223,7,0,0,255,255,1,0,255,255,255,255,255,255,255,127,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,30,255,255,255,255,255,255,255,63,15,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,255,255,255,255,255,255,255,255,225,255,0,0,0,0,0,0,255,255,255,255,255,255,255,255,63,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,255,255,255,255,255,255,255,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,255,255,255,255,255,255,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,1,2,4,7,3,6,5,0,114,119,97,0,47,112,114,111,99,47,115,101,108,102,47,102,100,47,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+61440);var tempDoublePtr=STATICTOP;STATICTOP+=16;assert(tempDoublePtr%8==0);var PROCINFO={ppid:1,pid:42,sid:42,pgid:42};var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};var ERRNO_MESSAGES={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module["___errno_location"]()>>2]=value;else Module.printErr("failed to set errno from JS");return value}var PATH={splitPath:(function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)}),normalizeArray:(function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}),normalize:(function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter((function(p){return!!p})),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path}),dirname:(function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir}),basename:(function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)}),extname:(function(path){return PATH.splitPath(path)[3]}),join:(function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))}),join2:(function(l,r){return PATH.normalize(l+"/"+r)}),resolve:(function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter((function(p){return!!p})),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."}),relative:(function(from,to){from=PATH.resolve(from).substr(1);to=PATH.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()}),put_char:(function(tty,val){if(val===null||val===10){Module["print"](UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}}),flush:(function(tty){if(tty.output&&tty.output.length>0){Module["print"](UTF8ArrayToString(tty.output,0));tty.output=[]}})},default_tty1_ops:{put_char:(function(tty,val){if(val===null||val===10){Module["printErr"](UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}}),flush:(function(tty){if(tty.output&&tty.output.length>0){Module["printErr"](UTF8ArrayToString(tty.output,0));tty.output=[]}})}};var MEMFS={ops_table:null,mount:(function(mount){return MEMFS.createNode(null,"/",16384|511,0)}),createNode:(function(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(!MEMFS.ops_table){MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}}}var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={}}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream}node.timestamp=Date.now();if(parent){parent.contents[name]=node}return node}),getFileDataAsRegularArray:(function(node){if(node.contents&&node.contents.subarray){var arr=[];for(var i=0;inode.contents.length){node.contents=MEMFS.getFileDataAsRegularArray(node);node.usedBytes=node.contents.length}if(!node.contents||node.contents.subarray){var prevCapacity=node.contents?node.contents.length:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity0)node.contents.set(oldContents.subarray(0,node.usedBytes),0);return}if(!node.contents&&newCapacity>0)node.contents=[];while(node.contents.lengthnewSize)node.contents.length=newSize;else while(node.contents.length=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);assert(size>=0);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+lengthe2.timestamp){create.push(key);total++}}));var remove=[];Object.keys(dst.entries).forEach((function(key){var e=dst.entries[key];var e2=src.entries[key];if(!e2){remove.push(key);total++}}));if(!total){return callback(null)}var completed=0;var db=src.type==="remote"?src.db:dst.db;var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readwrite");var store=transaction.objectStore(IDBFS.DB_STORE_NAME);function done(err){if(err){if(!done.errored){done.errored=true;return callback(err)}return}if(++completed>=total){return callback(null)}}transaction.onerror=(function(e){done(this.error);e.preventDefault()});create.sort().forEach((function(path){if(dst.type==="local"){IDBFS.loadRemoteEntry(store,path,(function(err,entry){if(err)return done(err);IDBFS.storeLocalEntry(path,entry,done)}))}else{IDBFS.loadLocalEntry(path,(function(err,entry){if(err)return done(err);IDBFS.storeRemoteEntry(store,path,entry,done)}))}}));remove.sort().reverse().forEach((function(path){if(dst.type==="local"){IDBFS.removeLocalEntry(path,done)}else{IDBFS.removeRemoteEntry(store,path,done)}}))})};var NODEFS={isWindows:false,staticInit:(function(){NODEFS.isWindows=!!process.platform.match(/^win/)}),mount:(function(mount){assert(ENVIRONMENT_IS_NODE);return NODEFS.createNode(null,"/",NODEFS.getMode(mount.opts.root),0)}),createNode:(function(parent,name,mode,dev){if(!FS.isDir(mode)&&!FS.isFile(mode)&&!FS.isLink(mode)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node=FS.createNode(parent,name,mode);node.node_ops=NODEFS.node_ops;node.stream_ops=NODEFS.stream_ops;return node}),getMode:(function(path){var stat;try{stat=fs.lstatSync(path);if(NODEFS.isWindows){stat.mode=stat.mode|(stat.mode&146)>>1}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return stat.mode}),realPath:(function(node){var parts=[];while(node.parent!==node){parts.push(node.name);node=node.parent}parts.push(node.mount.opts.root);parts.reverse();return PATH.join.apply(null,parts)}),flagsToPermissionStringMap:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},flagsToPermissionString:(function(flags){flags&=~2097152;flags&=~2048;flags&=~32768;flags&=~524288;if(flags in NODEFS.flagsToPermissionStringMap){return NODEFS.flagsToPermissionStringMap[flags]}else{throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}}),node_ops:{getattr:(function(node){var path=NODEFS.realPath(node);var stat;try{stat=fs.lstatSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}if(NODEFS.isWindows&&!stat.blksize){stat.blksize=4096}if(NODEFS.isWindows&&!stat.blocks){stat.blocks=(stat.size+stat.blksize-1)/stat.blksize|0}return{dev:stat.dev,ino:stat.ino,mode:stat.mode,nlink:stat.nlink,uid:stat.uid,gid:stat.gid,rdev:stat.rdev,size:stat.size,atime:stat.atime,mtime:stat.mtime,ctime:stat.ctime,blksize:stat.blksize,blocks:stat.blocks}}),setattr:(function(node,attr){var path=NODEFS.realPath(node);try{if(attr.mode!==undefined){fs.chmodSync(path,attr.mode);node.mode=attr.mode}if(attr.timestamp!==undefined){var date=new Date(attr.timestamp);fs.utimesSync(path,date,date)}if(attr.size!==undefined){fs.truncateSync(path,attr.size)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),lookup:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);var mode=NODEFS.getMode(path);return NODEFS.createNode(parent,name,mode)}),mknod:(function(parent,name,mode,dev){var node=NODEFS.createNode(parent,name,mode,dev);var path=NODEFS.realPath(node);try{if(FS.isDir(node.mode)){fs.mkdirSync(path,node.mode)}else{fs.writeFileSync(path,"",{mode:node.mode})}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return node}),rename:(function(oldNode,newDir,newName){var oldPath=NODEFS.realPath(oldNode);var newPath=PATH.join2(NODEFS.realPath(newDir),newName);try{fs.renameSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),unlink:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.unlinkSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),rmdir:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.rmdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),readdir:(function(node){var path=NODEFS.realPath(node);try{return fs.readdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),symlink:(function(parent,newName,oldPath){var newPath=PATH.join2(NODEFS.realPath(parent),newName);try{fs.symlinkSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),readlink:(function(node){var path=NODEFS.realPath(node);try{path=fs.readlinkSync(path);path=NODEJS_PATH.relative(NODEJS_PATH.resolve(node.mount.opts.root),path);return path}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}})},stream_ops:{open:(function(stream){var path=NODEFS.realPath(stream.node);try{if(FS.isFile(stream.node.mode)){stream.nfd=fs.openSync(path,NODEFS.flagsToPermissionString(stream.flags))}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),close:(function(stream){try{if(FS.isFile(stream.node.mode)&&stream.nfd){fs.closeSync(stream.nfd)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),read:(function(stream,buffer,offset,length,position){if(length===0)return 0;var nbuffer=new Buffer(length);var res;try{res=fs.readSync(stream.nfd,nbuffer,0,length,position)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}if(res>0){for(var i=0;i=stream.node.size)return 0;var chunk=stream.node.contents.slice(position,position+length);var ab=WORKERFS.reader.readAsArrayBuffer(chunk);buffer.set(new Uint8Array(ab),offset);return chunk.size}),write:(function(stream,buffer,offset,length,position){throw new FS.ErrnoError(ERRNO_CODES.EIO)}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){position+=stream.node.size}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position})}};STATICTOP+=16;STATICTOP+=16;STATICTOP+=16;var FS={root:null,mounts:[],devices:[null],streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:(function(e){if(!(e instanceof FS.ErrnoError))throw e+" : "+stackTrace();return ___setErrNo(e.errno)}),lookupPath:(function(path,opts){path=PATH.resolve(FS.cwd(),path);opts=opts||{};if(!path)return{path:"",node:null};var defaults={follow_mount:true,recurse_count:0};for(var key in defaults){if(opts[key]===undefined){opts[key]=defaults[key]}}if(opts.recurse_count>8){throw new FS.ErrnoError(ERRNO_CODES.ELOOP)}var parts=PATH.normalizeArray(path.split("/").filter((function(p){return!!p})),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(ERRNO_CODES.ELOOP)}}}}return{path:current_path,node:current}}),getPath:(function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}}),hashName:(function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length}),hashAddNode:(function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node}),hashRemoveNode:(function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}}),lookupNode:(function(parent,name){var err=FS.mayLookup(parent);if(err){throw new FS.ErrnoError(err,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)}),createNode:(function(parent,name,mode,rdev){if(!FS.FSNode){FS.FSNode=(function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev});FS.FSNode.prototype={};var readMode=292|73;var writeMode=146;Object.defineProperties(FS.FSNode.prototype,{read:{get:(function(){return(this.mode&readMode)===readMode}),set:(function(val){val?this.mode|=readMode:this.mode&=~readMode})},write:{get:(function(){return(this.mode&writeMode)===writeMode}),set:(function(val){val?this.mode|=writeMode:this.mode&=~writeMode})},isFolder:{get:(function(){return FS.isDir(this.mode)})},isDevice:{get:(function(){return FS.isChrdev(this.mode)})}})}var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node}),destroyNode:(function(node){FS.hashRemoveNode(node)}),isRoot:(function(node){return node===node.parent}),isMountpoint:(function(node){return!!node.mounted}),isFile:(function(mode){return(mode&61440)===32768}),isDir:(function(mode){return(mode&61440)===16384}),isLink:(function(mode){return(mode&61440)===40960}),isChrdev:(function(mode){return(mode&61440)===8192}),isBlkdev:(function(mode){return(mode&61440)===24576}),isFIFO:(function(mode){return(mode&61440)===4096}),isSocket:(function(mode){return(mode&49152)===49152}),flagModes:{"r":0,"rs":1052672,"r+":2,"w":577,"wx":705,"xw":705,"w+":578,"wx+":706,"xw+":706,"a":1089,"ax":1217,"xa":1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:(function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags}),flagsToPermissionString:(function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms}),nodePermissions:(function(node,perms){if(FS.ignorePermissions){return 0}if(perms.indexOf("r")!==-1&&!(node.mode&292)){return ERRNO_CODES.EACCES}else if(perms.indexOf("w")!==-1&&!(node.mode&146)){return ERRNO_CODES.EACCES}else if(perms.indexOf("x")!==-1&&!(node.mode&73)){return ERRNO_CODES.EACCES}return 0}),mayLookup:(function(dir){var err=FS.nodePermissions(dir,"x");if(err)return err;if(!dir.node_ops.lookup)return ERRNO_CODES.EACCES;return 0}),mayCreate:(function(dir,name){try{var node=FS.lookupNode(dir,name);return ERRNO_CODES.EEXIST}catch(e){}return FS.nodePermissions(dir,"wx")}),mayDelete:(function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var err=FS.nodePermissions(dir,"wx");if(err){return err}if(isdir){if(!FS.isDir(node.mode)){return ERRNO_CODES.ENOTDIR}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return ERRNO_CODES.EBUSY}}else{if(FS.isDir(node.mode)){return ERRNO_CODES.EISDIR}}return 0}),mayOpen:(function(node,flags){if(!node){return ERRNO_CODES.ENOENT}if(FS.isLink(node.mode)){return ERRNO_CODES.ELOOP}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return ERRNO_CODES.EISDIR}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))}),MAX_OPEN_FDS:4096,nextfd:(function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(ERRNO_CODES.EMFILE)}),getStream:(function(fd){return FS.streams[fd]}),createStream:(function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=(function(){});FS.FSStream.prototype={};Object.defineProperties(FS.FSStream.prototype,{object:{get:(function(){return this.node}),set:(function(val){this.node=val})},isRead:{get:(function(){return(this.flags&2097155)!==1})},isWrite:{get:(function(){return(this.flags&2097155)!==0})},isAppend:{get:(function(){return this.flags&1024})}})}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream}),closeStream:(function(fd){FS.streams[fd]=null}),chrdev_stream_ops:{open:(function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}}),llseek:(function(){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)})},major:(function(dev){return dev>>8}),minor:(function(dev){return dev&255}),makedev:(function(ma,mi){return ma<<8|mi}),registerDevice:(function(dev,ops){FS.devices[dev]={stream_ops:ops}}),getDevice:(function(dev){return FS.devices[dev]}),getMounts:(function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts}),syncfs:(function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){console.log("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(err){assert(FS.syncFSRequests>0);FS.syncFSRequests--;return callback(err)}function done(err){if(err){if(!done.errored){done.errored=true;return doCallback(err)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach((function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)}))}),mount:(function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot}),unmount:(function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach((function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.indexOf(current.mount)!==-1){FS.destroyNode(current)}current=next}}));node.mounted=null;var idx=node.mount.mounts.indexOf(mount);assert(idx!==-1);node.mount.mounts.splice(idx,1)}),lookup:(function(parent,name){return parent.node_ops.lookup(parent,name)}),mknod:(function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var err=FS.mayCreate(parent,name);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}return parent.node_ops.mknod(parent,name,mode,dev)}),create:(function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)}),mkdir:(function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)}),mkdirTree:(function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=(function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}});var lazyArray=this;lazyArray.setDataGetter((function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]}));if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;console.log("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:(function(){if(!this.lengthKnown){this.cacheLength()}return this._length})},chunkSize:{get:(function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize})}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:(function(){return this.contents.length})}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach((function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(ERRNO_CODES.EIO)}return fn.apply(null,arguments)}}));stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(ERRNO_CODES.EIO)}var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);assert(size>=0);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;HEAP32[buf+36>>2]=stat.size;HEAP32[buf+40>>2]=4096;HEAP32[buf+44>>2]=stat.blocks;HEAP32[buf+48>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+52>>2]=0;HEAP32[buf+56>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ino;return 0}),doMsync:(function(addr,stream,len,flags){var buffer=new Uint8Array(HEAPU8.subarray(addr,addr+len));FS.msync(stream,buffer,0,len,flags)}),doMkdir:(function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0}),doMknod:(function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-ERRNO_CODES.EINVAL}FS.mknod(path,mode,dev);return 0}),doReadlink:(function(path,buf,bufsize){if(bufsize<=0)return-ERRNO_CODES.EINVAL;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len}),doAccess:(function(path,amode){if(amode&~7){return-ERRNO_CODES.EINVAL}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-ERRNO_CODES.EACCES}return 0}),doDup:(function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd}),doReadv:(function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret}),varargs:0,get:(function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret}),getStr:(function(){var ret=Pointer_stringify(SYSCALLS.get());return ret}),getStreamFromFD:(function(){var stream=FS.getStream(SYSCALLS.get());if(!stream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return stream}),getSocketFromFD:(function(){var socket=SOCKFS.getSocket(SYSCALLS.get());if(!socket)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return socket}),getSocketAddress:(function(allowNull){var addrp=SYSCALLS.get(),addrlen=SYSCALLS.get();if(allowNull&&addrp===0)return null;var info=__read_sockaddr(addrp,addrlen);if(info.errno)throw new FS.ErrnoError(info.errno);info.addr=DNS.lookup_addr(info.addr)||info.addr;return info}),get64:(function(){var low=SYSCALLS.get(),high=SYSCALLS.get();if(low>=0)assert(high===0);else assert(high===-1);return low}),getZero:(function(){assert(SYSCALLS.get()===0)})};function ___syscall64(which,varargs){SYSCALLS.varargs=varargs;try{return PROCINFO.ppid}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}Module["_i64Subtract"]=_i64Subtract;function _sysconf(name){switch(name){case 30:return PAGE_SIZE;case 85:return totalMemory/PAGE_SIZE;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator==="object")return navigator["hardwareConcurrency"]||1;return 1}}___setErrNo(ERRNO_CODES.EINVAL);return-1}function ___syscall20(which,varargs){SYSCALLS.varargs=varargs;try{return PROCINFO.pid}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function _pthread_mutex_destroy(){}Module["_memset"]=_memset;function ___syscall75(which,varargs){SYSCALLS.varargs=varargs;try{return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}Module["_pthread_mutex_lock"]=_pthread_mutex_lock;function _atexit(func,arg){__ATEXIT__.unshift({func:func,arg:arg})}function _abort(){Module["abort"]()}function ___syscall195(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),buf=SYSCALLS.get();return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall194(which,varargs){SYSCALLS.varargs=varargs;try{var fd=SYSCALLS.get(),zero=SYSCALLS.getZero(),length=SYSCALLS.get64();FS.ftruncate(fd,length);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall197(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),buf=SYSCALLS.get();return SYSCALLS.doStat(FS.stat,stream.path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall202(which,varargs){SYSCALLS.varargs=varargs;try{return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall199(){return ___syscall202.apply(null,arguments)}Module["_i64Add"]=_i64Add;var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",ALLOC_STATIC);Module["_llvm_cttz_i32"]=_llvm_cttz_i32;Module["___udivmoddi4"]=___udivmoddi4;Module["___divdi3"]=___divdi3;function _pthread_mutex_init(){}function ___lock(){}function ___unlock(){}function ___assert_fail(condition,filename,line,func){ABORT=true;throw"Assertion failed: "+Pointer_stringify(condition)+", at: "+[filename?Pointer_stringify(filename):"unknown filename",line,func?Pointer_stringify(func):"unknown function"]+" at "+stackTrace()}function _clock(){if(_clock.start===undefined)_clock.start=Date.now();return(Date.now()-_clock.start)*(1e6/1e3)|0}function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest);return dest}Module["_memcpy"]=_memcpy;Module["_memmove"]=_memmove;function ___syscall91(which,varargs){SYSCALLS.varargs=varargs;try{var addr=SYSCALLS.get(),len=SYSCALLS.get();var info=SYSCALLS.mappings[addr];if(!info)return 0;if(len===info.len){var stream=FS.getStream(info.fd);SYSCALLS.doMsync(addr,stream,len,info.flags);FS.munmap(stream);SYSCALLS.mappings[addr]=null;if(info.allocated){_free(info.malloc)}}return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}Module["_llvm_bswap_i32"]=_llvm_bswap_i32;function ___syscall6(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD();FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall54(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),op=SYSCALLS.get();switch(op){case 21505:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};case 21506:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};case 21519:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0};case 21520:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return-ERRNO_CODES.EINVAL};case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)};default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}var ___tm_current=STATICTOP;STATICTOP+=48;var ___tm_timezone=allocate(intArrayFromString("GMT"),"i8",ALLOC_STATIC);var _tzname=STATICTOP;STATICTOP+=16;var _daylight=STATICTOP;STATICTOP+=16;var _timezone=STATICTOP;STATICTOP+=16;function _tzset(){if(_tzset.called)return;_tzset.called=true;HEAP32[_timezone>>2]=-(new Date).getTimezoneOffset()*60;var winter=new Date(2e3,0,1);var summer=new Date(2e3,6,1);HEAP32[_daylight>>2]=Number(winter.getTimezoneOffset()!=summer.getTimezoneOffset());function extractZone(date){var match=date.toTimeString().match(/\(([A-Za-z ]+)\)$/);return match?match[1]:"GMT"}var winterName=extractZone(winter);var summerName=extractZone(summer);var winterNamePtr=allocate(intArrayFromString(winterName),"i8",ALLOC_NORMAL);var summerNamePtr=allocate(intArrayFromString(summerName),"i8",ALLOC_NORMAL);if(summer.getTimezoneOffset()>2]=winterNamePtr;HEAP32[_tzname+4>>2]=summerNamePtr}else{HEAP32[_tzname>>2]=summerNamePtr;HEAP32[_tzname+4>>2]=winterNamePtr}}function _localtime_r(time,tmPtr){_tzset();var date=new Date(HEAP32[time>>2]*1e3);HEAP32[tmPtr>>2]=date.getSeconds();HEAP32[tmPtr+4>>2]=date.getMinutes();HEAP32[tmPtr+8>>2]=date.getHours();HEAP32[tmPtr+12>>2]=date.getDate();HEAP32[tmPtr+16>>2]=date.getMonth();HEAP32[tmPtr+20>>2]=date.getFullYear()-1900;HEAP32[tmPtr+24>>2]=date.getDay();var start=new Date(date.getFullYear(),0,1);var yday=(date.getTime()-start.getTime())/(1e3*60*60*24)|0;HEAP32[tmPtr+28>>2]=yday;HEAP32[tmPtr+36>>2]=-(date.getTimezoneOffset()*60);var summerOffset=(new Date(2e3,6,1)).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dst=date.getTimezoneOffset()==Math.min(winterOffset,summerOffset)|0;HEAP32[tmPtr+32>>2]=dst;var zonePtr=HEAP32[_tzname+(dst?Runtime.QUANTUM_SIZE:0)>>2];HEAP32[tmPtr+40>>2]=zonePtr;return tmPtr}function _localtime(time){return _localtime_r(time,___tm_current)}function ___syscall77(which,varargs){SYSCALLS.varargs=varargs;try{var who=SYSCALLS.get(),usage=SYSCALLS.get();_memset(usage,0,136);HEAP32[usage>>2]=1;HEAP32[usage+4>>2]=2;HEAP32[usage+8>>2]=3;HEAP32[usage+12>>2]=4;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}Module["_bitshift64Ashr"]=_bitshift64Ashr;Module["_bitshift64Lshr"]=_bitshift64Lshr;function ___syscall33(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),amode=SYSCALLS.get();return SYSCALLS.doAccess(path,amode)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function _pthread_cleanup_push(routine,arg){__ATEXIT__.push((function(){Module["dynCall_vi"](routine,arg)}));_pthread_cleanup_push.level=__ATEXIT__.length}var _environ=STATICTOP;STATICTOP+=16;function ___buildEnvironment(env){var MAX_ENV_VALUES=64;var TOTAL_ENV_SIZE=1024;var poolPtr;var envPtr;if(!___buildEnvironment.called){___buildEnvironment.called=true;ENV["USER"]=ENV["LOGNAME"]="web_user";ENV["PATH"]="/";ENV["PWD"]="/";ENV["HOME"]="/home/web_user";ENV["LANG"]="C";ENV["_"]=Module["thisProgram"];poolPtr=allocate(TOTAL_ENV_SIZE,"i8",ALLOC_STATIC);envPtr=allocate(MAX_ENV_VALUES*4,"i8*",ALLOC_STATIC);HEAP32[envPtr>>2]=poolPtr;HEAP32[_environ>>2]=envPtr}else{envPtr=HEAP32[_environ>>2];poolPtr=HEAP32[envPtr>>2]}var strings=[];var totalSize=0;for(var key in env){if(typeof env[key]==="string"){var line=key+"="+env[key];strings.push(line);totalSize+=line.length}}if(totalSize>TOTAL_ENV_SIZE){throw new Error("Environment size exceeded TOTAL_ENV_SIZE!")}var ptrSize=4;for(var i=0;i>2]=poolPtr;poolPtr+=line.length+1}HEAP32[envPtr+strings.length*ptrSize>>2]=0}var ENV={};function _getenv(name){if(name===0)return 0;name=Pointer_stringify(name);if(!ENV.hasOwnProperty(name))return 0;if(_getenv.ret)_free(_getenv.ret);_getenv.ret=allocate(intArrayFromString(ENV[name]),"i8",ALLOC_NORMAL);return _getenv.ret}function _gettimeofday(ptr){var now=Date.now();HEAP32[ptr>>2]=now/1e3|0;HEAP32[ptr+4>>2]=now%1e3*1e3|0;return 0}Module["_pthread_mutex_unlock"]=_pthread_mutex_unlock;function ___syscall3(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),buf=SYSCALLS.get(),count=SYSCALLS.get();return FS.read(stream,HEAP8,buf,count)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall5(which,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(),flags=SYSCALLS.get(),mode=SYSCALLS.get();var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function _llvm_stackrestore(p){var self=_llvm_stacksave;var ret=self.LLVM_SAVEDSTACKS[p];self.LLVM_SAVEDSTACKS.splice(p,1);Runtime.stackRestore(ret)}Module["___udivdi3"]=___udivdi3;Module["___muldsi3"]=___muldsi3;Module["___muldi3"]=___muldi3;Module["_sbrk"]=_sbrk;Module["_bitshift64Shl"]=_bitshift64Shl;function _llvm_stacksave(){var self=_llvm_stacksave;if(!self.LLVM_SAVEDSTACKS){self.LLVM_SAVEDSTACKS=[]}self.LLVM_SAVEDSTACKS.push(Runtime.stackSave());return self.LLVM_SAVEDSTACKS.length-1}function _pthread_cleanup_pop(){assert(_pthread_cleanup_push.level==__ATEXIT__.length,"cannot pop if something else added meanwhile!");__ATEXIT__.pop();_pthread_cleanup_push.level=__ATEXIT__.length}Module["___uremdi3"]=___uremdi3;function ___syscall340(which,varargs){SYSCALLS.varargs=varargs;try{var pid=SYSCALLS.get(),resource=SYSCALLS.get(),new_limit=SYSCALLS.get(),old_limit=SYSCALLS.get();if(old_limit){HEAP32[old_limit>>2]=-1;HEAP32[old_limit+4>>2]=-1;HEAP32[old_limit+8>>2]=-1;HEAP32[old_limit+12>>2]=-1}return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall4(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),buf=SYSCALLS.get(),count=SYSCALLS.get();return FS.write(stream,HEAP8,buf,count)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall192(which,varargs){SYSCALLS.varargs=varargs;try{var addr=SYSCALLS.get(),len=SYSCALLS.get(),prot=SYSCALLS.get(),flags=SYSCALLS.get(),fd=SYSCALLS.get(),off=SYSCALLS.get();off<<=12;var ptr;var allocated=false;if(fd===-1){ptr=_memalign(PAGE_SIZE,len);if(!ptr)return-ERRNO_CODES.ENOMEM;_memset(ptr,0,len);allocated=true}else{var info=FS.getStream(fd);if(!info)return-ERRNO_CODES.EBADF;var res=FS.mmap(info,HEAPU8,addr,len,off,prot,flags);ptr=res.ptr;allocated=res.allocated}SYSCALLS.mappings[ptr]={malloc:ptr,len:len,allocated:allocated,fd:fd,flags:flags};return ptr}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall201(){return ___syscall202.apply(null,arguments)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]);return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?Pointer_stringify(tm_zone):""};var pattern=Pointer_stringify(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":(function(date){return WEEKDAYS[date.tm_wday].substring(0,3)}),"%A":(function(date){return WEEKDAYS[date.tm_wday]}),"%b":(function(date){return MONTHS[date.tm_mon].substring(0,3)}),"%B":(function(date){return MONTHS[date.tm_mon]}),"%C":(function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)}),"%d":(function(date){return leadingNulls(date.tm_mday,2)}),"%e":(function(date){return leadingSomething(date.tm_mday,2," ")}),"%g":(function(date){return getWeekBasedYear(date).toString().substring(2)}),"%G":(function(date){return getWeekBasedYear(date)}),"%H":(function(date){return leadingNulls(date.tm_hour,2)}),"%I":(function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)}),"%j":(function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)}),"%m":(function(date){return leadingNulls(date.tm_mon+1,2)}),"%M":(function(date){return leadingNulls(date.tm_min,2)}),"%n":(function(){return"\n"}),"%p":(function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}}),"%S":(function(date){return leadingNulls(date.tm_sec,2)}),"%t":(function(){return"\t"}),"%u":(function(date){var day=new Date(date.tm_year+1900,date.tm_mon+1,date.tm_mday,0,0,0,0);return day.getDay()||7}),"%U":(function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"}),"%V":(function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)}),"%Z":(function(date){return date.tm_zone}),"%%":(function(){return"%"})};for(var rule in EXPANSION_RULES_2){if(pattern.indexOf(rule)>=0){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function ___syscall191(which,varargs){SYSCALLS.varargs=varargs;try{var resource=SYSCALLS.get(),rlim=SYSCALLS.get();HEAP32[rlim>>2]=-1;HEAP32[rlim+4>>2]=-1;HEAP32[rlim+8>>2]=-1;HEAP32[rlim+12>>2]=-1;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function _time(ptr){var ret=Date.now()/1e3|0;if(ptr){HEAP32[ptr>>2]=ret}return ret}function ___syscall142(which,varargs){SYSCALLS.varargs=varargs;try{var nfds=SYSCALLS.get(),readfds=SYSCALLS.get(),writefds=SYSCALLS.get(),exceptfds=SYSCALLS.get(),timeout=SYSCALLS.get();assert(nfds<=64,"nfds must be less than or equal to 64");assert(!exceptfds,"exceptfds not supported");var total=0;var srcReadLow=readfds?HEAP32[readfds>>2]:0,srcReadHigh=readfds?HEAP32[readfds+4>>2]:0;var srcWriteLow=writefds?HEAP32[writefds>>2]:0,srcWriteHigh=writefds?HEAP32[writefds+4>>2]:0;var srcExceptLow=exceptfds?HEAP32[exceptfds>>2]:0,srcExceptHigh=exceptfds?HEAP32[exceptfds+4>>2]:0;var dstReadLow=0,dstReadHigh=0;var dstWriteLow=0,dstWriteHigh=0;var dstExceptLow=0,dstExceptHigh=0;var allLow=(readfds?HEAP32[readfds>>2]:0)|(writefds?HEAP32[writefds>>2]:0)|(exceptfds?HEAP32[exceptfds>>2]:0);var allHigh=(readfds?HEAP32[readfds+4>>2]:0)|(writefds?HEAP32[writefds+4>>2]:0)|(exceptfds?HEAP32[exceptfds+4>>2]:0);function check(fd,low,high,val){return fd<32?low&val:high&val}for(var fd=0;fd>2]=dstReadLow;HEAP32[readfds+4>>2]=dstReadHigh}if(writefds){HEAP32[writefds>>2]=dstWriteLow;HEAP32[writefds+4>>2]=dstWriteHigh}if(exceptfds){HEAP32[exceptfds>>2]=dstExceptLow;HEAP32[exceptfds+4>>2]=dstExceptHigh}return total}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}Module["_pthread_self"]=_pthread_self;function ___syscall140(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),offset_high=SYSCALLS.get(),offset_low=SYSCALLS.get(),result=SYSCALLS.get(),whence=SYSCALLS.get();var offset=offset_low;assert(offset_high===0);FS.llseek(stream,offset,whence);HEAP32[result>>2]=stream.position;if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall146(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();return SYSCALLS.doWritev(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}Module["___remdi3"]=___remdi3;function ___syscall221(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),cmd=SYSCALLS.get();switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-ERRNO_CODES.EINVAL}var newStream;newStream=FS.open(stream.path,stream.flags,0,arg);return newStream.fd};case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0};case 12:case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0};case 13:case 14:case 13:case 14:return 0;case 16:case 8:return-ERRNO_CODES.EINVAL;case 9:___setErrNo(ERRNO_CODES.EINVAL);return-1;default:{return-ERRNO_CODES.EINVAL}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall145(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();return SYSCALLS.doReadv(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}FS.staticInit();__ATINIT__.unshift((function(){if(!Module["noFSInit"]&&!FS.init.initialized)FS.init()}));__ATMAIN__.push((function(){FS.ignorePermissions=false}));__ATEXIT__.push((function(){FS.quit()}));Module["FS_createFolder"]=FS.createFolder;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createLink"]=FS.createLink;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;__ATINIT__.unshift((function(){TTY.init()}));__ATEXIT__.push((function(){TTY.shutdown()}));if(ENVIRONMENT_IS_NODE){var fs=require("fs");var NODEJS_PATH=require("path");NODEFS.staticInit()}___buildEnvironment(ENV);DYNAMICTOP_PTR=allocate(1,"i32",ALLOC_STATIC);STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP);STACK_MAX=STACK_BASE+TOTAL_STACK;DYNAMIC_BASE=Runtime.alignMemory(STACK_MAX);HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE;staticSealed=true;assert(DYNAMIC_BASE1){Module["thisProgram"]=process["argv"][1].replace(/\\/g,"/")}else{Module["thisProgram"]="unknown-program"}}Module["arguments"]=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",(function(ex){if(!(ex instanceof ExitStatus)){throw ex}}));Module["inspect"]=(function(){return"[Emscripten Module object]"})}else if(ENVIRONMENT_IS_SHELL){if(!Module["print"])Module["print"]=print;if(typeof printErr!="undefined")Module["printErr"]=printErr;if(typeof read!="undefined"){Module["read"]=read}else{Module["read"]=function read(){throw"no read() available"}}Module["readBinary"]=function readBinary(f){if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}var data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){Module["arguments"]=scriptArgs}else if(typeof arguments!="undefined"){Module["arguments"]=arguments}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){Module["read"]=function read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};Module["readAsync"]=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response)}else{onerror()}};xhr.onerror=onerror;xhr.send(null)};if(typeof arguments!="undefined"){Module["arguments"]=arguments}if(typeof console!=="undefined"){if(!Module["print"])Module["print"]=function print(x){console.log(x)};if(!Module["printErr"])Module["printErr"]=function printErr(x){console.warn(x)}}else{var TRY_USE_DUMP=false;if(!Module["print"])Module["print"]=TRY_USE_DUMP&&typeof dump!=="undefined"?(function(x){dump(x)}):(function(x){})}if(ENVIRONMENT_IS_WORKER){Module["load"]=importScripts}if(typeof Module["setWindowTitle"]==="undefined"){Module["setWindowTitle"]=(function(title){document.title=title})}}else{throw"Unknown runtime environment. Where are we?"}function globalEval(x){abort("NO_DYNAMIC_EXECUTION=1 was set, cannot eval")}if(!Module["load"]&&Module["read"]){Module["load"]=function load(f){globalEval(Module["read"](f))}}if(!Module["print"]){Module["print"]=(function(){})}if(!Module["printErr"]){Module["printErr"]=Module["print"]}if(!Module["arguments"]){Module["arguments"]=[]}if(!Module["thisProgram"]){Module["thisProgram"]="./this.program"}Module.print=Module["print"];Module.printErr=Module["printErr"];Module["preRun"]=[];Module["postRun"]=[];for(var key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=undefined;var Runtime={setTempRet0:(function(value){tempRet0=value;return value}),getTempRet0:(function(){return tempRet0}),stackSave:(function(){return STACKTOP}),stackRestore:(function(stackTop){STACKTOP=stackTop}),getNativeTypeSize:(function(type){switch(type){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(type[type.length-1]==="*"){return Runtime.QUANTUM_SIZE}else if(type[0]==="i"){var bits=parseInt(type.substr(1));assert(bits%8===0);return bits/8}else{return 0}}}}),getNativeFieldSize:(function(type){return Math.max(Runtime.getNativeTypeSize(type),Runtime.QUANTUM_SIZE)}),STACK_ALIGN:16,prepVararg:(function(ptr,type){if(type==="double"||type==="i64"){if(ptr&7){assert((ptr&7)===4);ptr+=4}}else{assert((ptr&3)===0)}return ptr}),getAlignSize:(function(type,size,vararg){if(!vararg&&(type=="i64"||type=="double"))return 8;if(!type)return Math.min(size,8);return Math.min(size||(type?Runtime.getNativeFieldSize(type):0),Runtime.QUANTUM_SIZE)}),dynCall:(function(sig,ptr,args){if(args&&args.length){assert(args.length==sig.length-1);assert("dynCall_"+sig in Module,"bad function pointer type - no table for sig '"+sig+"'");return Module["dynCall_"+sig].apply(null,[ptr].concat(args))}else{assert(sig.length==1);assert("dynCall_"+sig in Module,"bad function pointer type - no table for sig '"+sig+"'");return Module["dynCall_"+sig].call(null,ptr)}}),functionPointers:[],addFunction:(function(func){for(var i=0;i>2];var end=(ret+size+15|0)&-16;HEAP32[DYNAMICTOP_PTR>>2]=end;if(end>=TOTAL_MEMORY){var success=enlargeMemory();if(!success){HEAP32[DYNAMICTOP_PTR>>2]=ret;return 0}}return ret}),alignMemory:(function(size,quantum){var ret=size=Math.ceil(size/(quantum?quantum:16))*(quantum?quantum:16);return ret}),makeBigInt:(function(low,high,unsigned){var ret=unsigned?+(low>>>0)+ +(high>>>0)*+4294967296:+(low>>>0)+ +(high|0)*+4294967296;return ret}),GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module["Runtime"]=Runtime;var ABORT=0;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];if(!func){abort("NO_DYNAMIC_EXECUTION=1 was set, cannot eval")}assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)");return func}var cwrap,ccall;((function(){var JSfuncs={"stackSave":(function(){Runtime.stackSave()}),"stackRestore":(function(){Runtime.stackRestore()}),"arrayToC":(function(arr){var ret=Runtime.stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}),"stringToC":(function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=Runtime.stackAlloc(len);stringToUTF8(str,ret,len)}return ret})};var toC={"string":JSfuncs["stringToC"],"array":JSfuncs["arrayToC"]};ccall=function ccallFunc(ident,returnType,argTypes,args,opts){var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":tempI64=[value>>>0,(tempDouble=value,+Math_abs(tempDouble)>=+1?tempDouble>+0?(Math_min(+Math_floor(tempDouble/+4294967296),+4294967295)|0)>>>0:~~+Math_ceil((tempDouble- +(~~tempDouble>>>0))/+4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;default:abort("invalid type for setValue: "+type)}}Module["setValue"]=setValue;function getValue(ptr,type,noSafe){type=type||"i8";if(type.charAt(type.length-1)==="*")type="i32";switch(type){case"i1":return HEAP8[ptr>>0];case"i8":return HEAP8[ptr>>0];case"i16":return HEAP16[ptr>>1];case"i32":return HEAP32[ptr>>2];case"i64":return HEAP32[ptr>>2];case"float":return HEAPF32[ptr>>2];case"double":return HEAPF64[ptr>>3];default:abort("invalid type for setValue: "+type)}return null}Module["getValue"]=getValue;var ALLOC_NORMAL=0;var ALLOC_STACK=1;var ALLOC_STATIC=2;var ALLOC_DYNAMIC=3;var ALLOC_NONE=4;Module["ALLOC_NORMAL"]=ALLOC_NORMAL;Module["ALLOC_STACK"]=ALLOC_STACK;Module["ALLOC_STATIC"]=ALLOC_STATIC;Module["ALLOC_DYNAMIC"]=ALLOC_DYNAMIC;Module["ALLOC_NONE"]=ALLOC_NONE;function allocate(slab,types,allocator,ptr){var zeroinit,size;if(typeof slab==="number"){zeroinit=true;size=slab}else{zeroinit=false;size=slab.length}var singleType=typeof types==="string"?types:null;var ret;if(allocator==ALLOC_NONE){ret=ptr}else{ret=[typeof _malloc==="function"?_malloc:Runtime.staticAlloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][allocator===undefined?ALLOC_STATIC:allocator](Math.max(size,singleType?1:types.length))}if(zeroinit){var ptr=ret,stop;assert((ret&3)==0);stop=ret+(size&~3);for(;ptr>2]=0}stop=ret+size;while(ptr>0]=0}return ret}if(singleType==="i8"){if(slab.subarray||slab.slice){HEAPU8.set(slab,ret)}else{HEAPU8.set(new Uint8Array(slab),ret)}return ret}var i=0,type,typeSize,previousType;while(i>0];hasUtf|=t;if(t==0&&!length)break;i++;if(length&&i==length)break}if(!length)length=i;var ret="";if(hasUtf<128){var MAX_CHUNK=1024;var curr;while(length>0){curr=String.fromCharCode.apply(String,HEAPU8.subarray(ptr,ptr+Math.min(length,MAX_CHUNK)));ret=ret?ret+curr:curr;ptr+=MAX_CHUNK;length-=MAX_CHUNK}return ret}return Module["UTF8ToString"](ptr)}Module["Pointer_stringify"]=Pointer_stringify;function AsciiToString(ptr){var str="";while(1){var ch=HEAP8[ptr++>>0];if(!ch)return str;str+=String.fromCharCode(ch)}}Module["AsciiToString"]=AsciiToString;function stringToAscii(str,outPtr){return writeAsciiToMemory(str,outPtr,false)}Module["stringToAscii"]=stringToAscii;var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(u8Array,idx){var endPtr=idx;while(u8Array[endPtr])++endPtr;if(endPtr-idx>16&&u8Array.subarray&&UTF8Decoder){return UTF8Decoder.decode(u8Array.subarray(idx,endPtr))}else{var u0,u1,u2,u3,u4,u5;var str="";while(1){u0=u8Array[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}u1=u8Array[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}u2=u8Array[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u3=u8Array[idx++]&63;if((u0&248)==240){u0=(u0&7)<<18|u1<<12|u2<<6|u3}else{u4=u8Array[idx++]&63;if((u0&252)==248){u0=(u0&3)<<24|u1<<18|u2<<12|u3<<6|u4}else{u5=u8Array[idx++]&63;u0=(u0&1)<<30|u1<<24|u2<<18|u3<<12|u4<<6|u5}}}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}}}Module["UTF8ArrayToString"]=UTF8ArrayToString;function UTF8ToString(ptr){return UTF8ArrayToString(HEAPU8,ptr)}Module["UTF8ToString"]=UTF8ToString;function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=2097151){if(outIdx+3>=endIdx)break;outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=67108863){if(outIdx+4>=endIdx)break;outU8Array[outIdx++]=248|u>>24;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+5>=endIdx)break;outU8Array[outIdx++]=252|u>>30;outU8Array[outIdx++]=128|u>>24&63;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}Module["stringToUTF8Array"]=stringToUTF8Array;function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}Module["stringToUTF8"]=stringToUTF8;function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){++len}else if(u<=2047){len+=2}else if(u<=65535){len+=3}else if(u<=2097151){len+=4}else if(u<=67108863){len+=5}else{len+=6}}return len}Module["lengthBytesUTF8"]=lengthBytesUTF8;var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function demangle(func){var __cxa_demangle_func=Module["___cxa_demangle"]||Module["__cxa_demangle"];if(__cxa_demangle_func){try{var s=func.substr(1);var len=lengthBytesUTF8(s)+1;var buf=_malloc(len);stringToUTF8(s,buf,len);var status=_malloc(4);var ret=__cxa_demangle_func(buf,0,0,status);if(getValue(status,"i32")===0&&ret){return Pointer_stringify(ret)}}catch(e){}finally{if(buf)_free(buf);if(status)_free(status);if(ret)_free(ret)}return func}Runtime.warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return func}function demangleAll(text){var regex=/__Z[\w\d_]+/g;return text.replace(regex,(function(x){var y=demangle(x);return x===y?x:x+" ["+y+"]"}))}function jsStackTrace(){var err=new Error;if(!err.stack){try{throw new Error(0)}catch(e){err=e}if(!err.stack){return"(no stack trace available)"}}return err.stack.toString()}function stackTrace(){var js=jsStackTrace();if(Module["extraStackTrace"])js+="\n"+Module["extraStackTrace"]();return demangleAll(js)}Module["stackTrace"]=stackTrace;var PAGE_SIZE=16384;var HEAP;var buffer;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferViews(){Module["HEAP8"]=HEAP8=new Int8Array(buffer);Module["HEAP16"]=HEAP16=new Int16Array(buffer);Module["HEAP32"]=HEAP32=new Int32Array(buffer);Module["HEAPU8"]=HEAPU8=new Uint8Array(buffer);Module["HEAPU16"]=HEAPU16=new Uint16Array(buffer);Module["HEAPU32"]=HEAPU32=new Uint32Array(buffer);Module["HEAPF32"]=HEAPF32=new Float32Array(buffer);Module["HEAPF64"]=HEAPF64=new Float64Array(buffer)}var STATIC_BASE,STATICTOP,staticSealed;var STACK_BASE,STACKTOP,STACK_MAX;var DYNAMIC_BASE,DYNAMICTOP_PTR;STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0;staticSealed=false;function writeStackCookie(){assert((STACK_MAX&3)==0);HEAPU32[(STACK_MAX>>2)-1]=34821223;HEAPU32[(STACK_MAX>>2)-2]=2310721022}function checkStackCookie(){if(HEAPU32[(STACK_MAX>>2)-1]!=34821223||HEAPU32[(STACK_MAX>>2)-2]!=2310721022){abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x02135467, but received 0x"+HEAPU32[(STACK_MAX>>2)-2].toString(16)+" "+HEAPU32[(STACK_MAX>>2)-1].toString(16))}if(HEAP32[0]!==1668509029)throw"Runtime error: The application has corrupted its heap memory area (address zero)!"}function abortStackOverflow(allocSize){abort("Stack overflow! Attempted to allocate "+allocSize+" bytes on the stack, but stack has only "+(STACK_MAX-asm.stackSave()+allocSize)+" bytes available!")}function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function enlargeMemory(){abortOnCannotGrowMemory()}var TOTAL_STACK=Module["TOTAL_STACK"]||5242880;var TOTAL_MEMORY=Module["TOTAL_MEMORY"]||16777216;if(TOTAL_MEMORY0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){checkStackCookie();if(runtimeInitialized)return;runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){checkStackCookie();callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){checkStackCookie();callRuntimeCallbacks(__ATEXIT__);runtimeExited=true}function postRun(){checkStackCookie();if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}Module["addOnPreRun"]=addOnPreRun;function addOnInit(cb){__ATINIT__.unshift(cb)}Module["addOnInit"]=addOnInit;function addOnPreMain(cb){__ATMAIN__.unshift(cb)}Module["addOnPreMain"]=addOnPreMain;function addOnExit(cb){__ATEXIT__.unshift(cb)}Module["addOnExit"]=addOnExit;function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}Module["addOnPostRun"]=addOnPostRun;function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}Module["intArrayFromString"]=intArrayFromString;function intArrayToString(array){var ret=[];for(var i=0;i255){assert(false,"Character code "+chr+" ("+String.fromCharCode(chr)+") at offset "+i+" not in 0x00-0xFF.");chr&=255}ret.push(String.fromCharCode(chr))}return ret.join("")}Module["intArrayToString"]=intArrayToString;function writeStringToMemory(string,buffer,dontAddNull){Runtime.warnOnce("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!");var lastChar,end;if(dontAddNull){end=buffer+lengthBytesUTF8(string);lastChar=HEAP8[end]}stringToUTF8(string,buffer,Infinity);if(dontAddNull)HEAP8[end]=lastChar}Module["writeStringToMemory"]=writeStringToMemory;function writeArrayToMemory(array,buffer){assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");HEAP8.set(array,buffer)}Module["writeArrayToMemory"]=writeArrayToMemory;function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}Module["writeAsciiToMemory"]=writeAsciiToMemory;if(!Math["imul"]||Math["imul"](4294967295,5)!==-5)Math["imul"]=function imul(a,b){var ah=a>>>16;var al=a&65535;var bh=b>>>16;var bl=b&65535;return al*bl+(ah*bl+al*bh<<16)|0};Math.imul=Math["imul"];if(!Math["clz32"])Math["clz32"]=(function(x){x=x>>>0;for(var i=0;i<32;i++){if(x&1<<31-i)return i}return 32});Math.clz32=Math["clz32"];if(!Math["trunc"])Math["trunc"]=(function(x){return x<0?Math.ceil(x):Math.floor(x)});Math.trunc=Math["trunc"];var Math_abs=Math.abs;var Math_cos=Math.cos;var Math_sin=Math.sin;var Math_tan=Math.tan;var Math_acos=Math.acos;var Math_asin=Math.asin;var Math_atan=Math.atan;var Math_atan2=Math.atan2;var Math_exp=Math.exp;var Math_log=Math.log;var Math_sqrt=Math.sqrt;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_pow=Math.pow;var Math_imul=Math.imul;var Math_fround=Math.fround;var Math_round=Math.round;var Math_min=Math.min;var Math_clz32=Math.clz32;var Math_trunc=Math.trunc;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function getUniqueRunDependency(id){var orig=id;while(1){if(!runDependencyTracking[id])return id;id=orig+Math.random()}return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!=="undefined"){runDependencyWatcher=setInterval((function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;Module.printErr("still waiting on run dependencies:")}Module.printErr("dependency: "+dep)}if(shown){Module.printErr("(end of list)")}}),1e4)}}else{Module.printErr("warning: run dependency added without ID")}}Module["addRunDependency"]=addRunDependency;function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id]}else{Module.printErr("warning: run dependency removed without ID")}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["removeRunDependency"]=removeRunDependency;Module["preloadedImages"]={};Module["preloadedAudios"]={};var ASM_CONSTS=[];STATIC_BASE=8;STATICTOP=STATIC_BASE+72896;__ATINIT__.push({func:(function(){_GNUNET_util_cl_init()})},{func:(function(){_GNUNET_CRYPTO_random_init()})},{func:(function(){_gpg_err_init()})},{func:(function(){_TALER_gcrypt_init()})});allocate([0,0,0,0,0,0,0,0,102,154,0,127,199,106,69,159,152,186,249,23,254,223,149,34,17,154,0,127,199,106,69,159,152,186,249,23,254,223,149,51,6,154,0,127,199,106,69,159,152,186,249,23,254,223,149,33,255,255,255,255,255,255,255,255,34,174,40,215,152,47,138,66,205,101,239,35,145,68,55,113,47,59,77,236,207,251,192,181,188,219,137,129,165,219,181,233,56,181,72,243,91,194,86,57,25,208,5,182,241,17,241,89,155,79,25,175,164,130,63,146,24,129,109,218,213,94,28,171,66,2,3,163,152,170,7,216,190,111,112,69,1,91,131,18,140,178,228,78,190,133,49,36,226,180,255,213,195,125,12,85,111,137,123,242,116,93,190,114,177,150,22,59,254,177,222,128,53,18,199,37,167,6,220,155,148,38,105,207,116,241,155,193,210,74,241,158,193,105,155,228,227,37,79,56,134,71,190,239,181,213,140,139,198,157,193,15,101,156,172,119,204,161,12,36,117,2,43,89,111,44,233,45,131,228,166,110,170,132,116,74,212,251,65,189,220,169,176,92,181,83,17,131,218,136,249,118,171,223,102,238,82,81,62,152,16,50,180,45,109,198,49,168,63,33,251,152,200,39,3,176,228,14,239,190,199,127,89,191,194,143,168,61,243,11,224,198,37,167,10,147,71,145,167,213,111,130,3,224,81,99,202,6,112,110,14,10,103,41,41,20,252,47,210,70,133,10,183,39,38,201,38,92,56,33,27,46,237,42,196,90,252,109,44,77,223,179,149,157,19,13,56,83,222,99,175,139,84,115,10,101,168,178,119,60,187,10,106,118,230,174,237,71,46,201,194,129,59,53,130,20,133,44,114,146,100,3,241,76,161,232,191,162,1,48,66,188,75,102,26,168,145,151,248,208,112,139,75,194,48,190,84,6,163,81,108,199,24,82,239,214,25,232,146,209,16,169,101,85,36,6,153,214,42,32,113,87,133,53,14,244,184,209,187,50,112,160,106,16,200,208,210,184,22,193,164,25,83,171,65,81,8,108,55,30,153,235,142,223,76,119,72,39,168,72,155,225,181,188,176,52,99,90,201,197,179,12,28,57,203,138,65,227,74,170,216,78,115,227,99,119,79,202,156,91,163,184,178,214,243,111,46,104,252,178,239,93,238,130,143,116,96,47,23,67,111,99,165,120,114,171,240,161,20,120,200,132,236,57,100,26,8,2,199,140,40,30,99,35,250,255,190,144,233,189,130,222,235,108,80,164,21,121,198,178,247,163,249,190,43,83,114,227,242,120,113,198,156,97,38,234,206,62,39,202,7,194,192,33,199,184,134,209,30,235,224,205,214,125,218,234,120,209,110,238,127,79,125,245,186,111,23,114,170,103,240,6,166,152,200,162,197,125,99,10,174,13,249,190,4,152,63,17,27,71,28,19,53,11,113,27,132,125,4,35,245,119,219,40,147,36,199,64,123,171,202,50,188,190,201,21,10,190,158,60,76,13,16,156,196,103,29,67,182,66,62,203,190,212,197,76,42,126,101,252,156,41,127,89,236,250,214,58,171,111,203,95,23,88,71,74,140,25,68,108,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,210,84,0,0,255,255,255,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,145,88,0,0,2,0,0,0,157,88,0,0,4,0,0,0,169,88,0,0,8,0,0,0,181,88,0,0,16,0,0,0,194,88,0,0,32,0,0,0,204,88,0,0,64,0,0,0,215,88,0,0,128,0,0,0,227,88,0,0,0,1,0,0,240,88,0,0,0,2,0,0,252,88,0,0,0,4,0,0,9,89,0,0,0,8,0,0,19,89,0,0,0,16,0,0,30,89,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,223,139,0,0,0,1,0,0,0,0,0,0,2,0,0,0,1,0,0,0,213,98,0,0,24,99,0,0,30,99,0,0,98,99,0,0,165,99,0,0,232,99,0,0,43,100,0,0,147,95,0,0,192,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,48,100,0,0,99,100,0,0,150,100,0,0,201,100,0,0,252,100,0,0,47,101,0,0,98,101,0,0,208,95,0,0,224,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,103,101,0,0,162,101,0,0,221,101,0,0,24,102,0,0,83,102,0,0,142,102,0,0,98,101,0,0,251,95,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,201,102,0,0,12,103,0,0,79,103,0,0,146,103,0,0,213,103,0,0,24,104,0,0,98,101,0,0,56,96,0,0,128,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,91,104,0,0,190,104,0,0,33,105,0,0,132,105,0,0,231,105,0,0,74,106,0,0,98,101,0,0,99,96,0,0,9,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,173,106,0,0,52,107,0,0,187,107,0,0,65,108,0,0,199,108,0,0,78,109,0,0,98,101,0,0,142,96,0,0,160,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,213,109,0,0,0,110,0,0,43,110,0,0,86,110,0,0,129,110,0,0,172,110,0,0,98,101,0,0,179,96,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,110,0,0,10,111,0,0,61,111,0,0,112,111,0,0,163,111,0,0,214,111,0,0,98,101,0,0,216,96,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,112,0,0,68,112,0,0,127,112,0,0,186,112,0,0,245,112,0,0,48,113,0,0,98,101,0,0,253,96,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,107,113,0,0,174,113,0,0,241,113,0,0,52,114,0,0,119,114,0,0,186,114,0,0,98,101,0,0,34,97,0,0,64,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,114,0,0,80,115,0,0,163,115,0,0,246,115,0,0,73,116,0,0,156,116,0,0,98,101,0,0,71,97,0,0,128,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,239,116,0,0,82,117,0,0,181,117,0,0,24,118,0,0,123,118,0,0,222,118,0,0,98,101,0,0,109,97,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,119,0,0,196,119,0,0,71,120,0,0,202,120,0,0,77,121,0,0,208,121,0,0,98,101,0,0,147,97,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,83,122,0,0,150,122,0,0,217,122,0,0,28,123,0,0,95,123,0,0,162,123,0,0,98,101,0,0,178,97,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,229,123,0,0,40,124,0,0,107,124,0,0,174,124,0,0,241,124,0,0,52,125,0,0,98,101,0,0,216,97,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,119,125,0,0,186,125,0,0,253,125,0,0,64,126,0,0,241,124,0,0,131,126,0,0,98,101,0,0,254,97,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,198,126,0,0,9,127,0,0,76,127,0,0,143,127,0,0,210,127,0,0,21,128,0,0,98,101,0,0,88,128,0,0,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,128,0,0,150,122,0,0,233,128,0,0,108,129,0,0,239,129,0,0,114,130,0,0,98,101,0,0,118,98,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,245,130,0,0,120,131,0,0,251,131,0,0,126,132,0,0,1,133,0,0,132,133,0,0,98,101,0,0,154,98,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,134,0,0,138,134,0,0,13,135,0,0,144,135,0,0,19,136,0,0,150,136,0,0,98,101,0,0,190,98,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,137,0,0,210,127,0,0,150,122,0,0,92,137,0,0,159,137,0,0,226,137,0,0,98,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,223,139,0,0,124,95,0,0,147,95,0,0,158,95,0,0,147,95,0,0,178,95,0,0,147,95,0,0,189,95,0,0,147,95,0,0,199,95,0,0,208,95,0,0,219,95,0,0,208,95,0,0,229,95,0,0,208,95,0,0,242,95,0,0,251,95,0,0,6,96,0,0,251,95,0,0,26,96,0,0,251,95,0,0,37,96,0,0,251,95,0,0,47,96,0,0,56,96,0,0,67,96,0,0,56,96,0,0,77,96,0,0,56,96,0,0,90,96,0,0,99,96,0,0,110,96,0,0,99,96,0,0,120,96,0,0,99,96,0,0,133,96,0,0,142,96,0,0,158,96,0,0,179,96,0,0,195,96,0,0,216,96,0,0,232,96,0,0,253,96,0,0,13,97,0,0,34,97,0,0,50,97,0,0,71,97,0,0,87,97,0,0,109,97,0,0,125,97,0,0,147,97,0,0,161,97,0,0,178,97,0,0,199,97,0,0,216,97,0,0,237,97,0,0,254,97,0,0,19,98,0,0,178,97,0,0,36,98,0,0,254,97,0,0,60,98,0,0,178,97,0,0,84,98,0,0,254,97,0,0,101,98,0,0,118,98,0,0,134,98,0,0,154,98,0,0,170,98,0,0,190,98,0,0,200,98,0,0,0,0,0,0,0,0,0,0,79,141,0,0,93,141,0,0,122,141,0,0,163,14,1,9,139,198,219,191,69,105,15,58,126,158,109,15,139,190,162,163,158,97,72,0,143,208,94,68,127,141,0,0,141,141,0,0,150,141,0,0,137,111,177,18,138,187,223,25,104,50,16,124,212,157,243,63,71,180,177,22,153,18,186,79,83,104,75,34,171,141,0,0,186,141,0,0,237,141,0,0,127,179,203,53,136,198,193,246,255,169,105,77,125,106,210,100,147,101,176,193,246,93,105,209,236,131,51,234,2,142,0,0,17,142,0,0,68,142,0,0,108,17,80,104,116,1,60,172,106,42,188,27,179,130,98,124,236,106,144,216,110,252,1,45,231,175,236,90,94,142,0,0,110,142,0,0,165,142,0,0,149,233,160,219,150,32,149,173,174,190,155,45,111,13,188,226,212,153,241,18,242,210,183,39,63,166,135,14,41,143,0,0,58,143,0,0,165,142,0,0,58,133,65,102,172,93,159,2,63,84,213,23,208,179,157,189,148,103,112,219,156,43,149,201,246,245,101,209,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,79,141,0,0,93,141,0,0,122,141,0,0,91,220,193,70,191,96,117,78,106,4,36,38,8,149,117,199,90,0,63,8,157,39,57,131,157,236,88,185,100,236,56,67,127,141,0,0,141,141,0,0,150,141,0,0,176,52,76,97,216,219,56,83,92,168,175,206,175,11,241,43,136,29,194,0,201,131,61,167,38,233,55,108,46,50,207,247,171,141,0,0,186,141,0,0,237,141,0,0,119,62,169,30,54,128,14,70,133,77,184,235,208,145,129,167,41,89,9,139,62,248,193,34,217,99,85,20,206,213,101,254,2,142,0,0,17,142,0,0,68,142,0,0,130,85,138,56,154,68,60,14,164,204,129,152,153,242,8,58,133,240,250,163,229,120,248,7,122,46,63,244,103,41,102,91,94,142,0,0,110,142,0,0,165,142,0,0,96,228,49,89,30,224,182,127,13,138,38,170,203,245,183,127,142,11,198,33,55,40,197,20,5,70,4,15,14,227,127,84,41,143,0,0,58,143,0,0,165,142,0,0,155,9,255,167,27,148,47,203,39,99,95,188,213,176,233,68,191,220,99,100,79,7,19,147,138,127,81,83,92,58,53,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,79,141,0,0,93,141,0,0,122,141,0,0,175,69,210,227,118,72,64,49,97,127,120,210,181,138,107,27,156,126,244,100,245,160,27,71,228,46,195,115,99,34,68,94,142,34,64,202,94,105,226,199,139,50,57,236,250,178,22,73,127,141,0,0,141,141,0,0,150,141,0,0,175,208,57,68,216,72,149,98,107,8,37,244,171,70,144,127,21,249,218,219,228,16,30,198,130,170,3,76,124,235,197,156,250,234,158,169,7,110,222,127,74,241,82,232,178,250,156,182,171,141,0,0,186,141,0,0,237,141,0,0,136,6,38,8,211,230,173,138,10,162,172,224,20,200,168,111,10,166,53,217,71,172,159,235,232,62,244,229,89,102,20,75,42,90,179,157,193,56,20,185,78,58,182,225,1,163,79,39,2,142,0,0,17,142,0,0,68,142,0,0,62,138,105,183,120,60,37,133,25,51,171,98,144,175,108,167,122,153,129,72,8,80,0,156,197,87,124,110,31,87,59,78,104,1,221,35,196,167,214,121,204,248,163,134,198,116,207,251,94,142,0,0,110,142,0,0,165,142,0,0,78,206,8,68,133,129,62,144,136,210,198,58,4,27,197,180,79,158,241,1,42,43,88,143,60,209,31,5,3,58,196,198,12,46,246,171,64,48,254,130,150,36,141,241,99,244,73,82,41,143,0,0,58,143,0,0,165,142,0,0,102,23,23,142,148,31,2,13,53,30,47,37,78,143,211,44,96,36,32,254,176,184,251,154,220,206,187,130,70,30,153,197,166,120,204,49,231,153,23,109,56,96,230,17,12,70,82,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,79,141,0,0,93,141,0,0,122,141,0,0,22,75,122,123,252,248,25,226,227,149,251,231,59,86,224,163,135,189,100,34,46,131,31,214,16,39,12,215,234,37,5,84,151,88,191,117,192,90,153,74,109,3,79,101,248,240,230,253,202,234,177,163,77,74,107,75,99,110,7,10,56,188,231,55,127,141,0,0,141,141,0,0,150,141,0,0,135,170,124,222,165,239,97,157,79,240,180,36,26,29,108,176,35,121,244,226,206,78,194,120,122,208,179,5,69,225,124,222,218,168,51,183,214,184,167,2,3,139,39,78,174,163,244,228,190,157,145,78,235,97,241,112,46,105,108,32,58,18,104,84,171,141,0,0,186,141,0,0,237,141,0,0,250,115,176,8,157,86,162,132,239,176,240,117,108,137,11,233,177,181,219,221,142,232,26,54,85,248,62,51,178,39,157,57,191,62,132,130,121,167,34,200,6,180,133,164,126,103,200,7,185,70,163,55,190,232,148,38,116,39,136,89,225,50,146,251,2,142,0,0,17,142,0,0,68,142,0,0,176,186,70,86,55,69,140,105,144,229,168,197,246,29,74,247,229,118,217,127,249,75,135,45,231,111,128,80,54,30,227,219,169,28,165,193,26,162,94,180,214,121,39,92,197,120,128,99,165,241,151,65,18,12,79,45,226,173,235,235,16,162,152,221,94,142,0,0,110,142,0,0,165,142,0,0,128,178,66,99,199,193,163,235,183,20,147,193,221,123,232,180,155,70,209,244,27,74,238,193,18,27,1,55,131,248,243,82,107,86,208,55,224,95,37,152,189,15,210,33,93,106,30,82,149,230,79,115,246,63,10,236,139,145,90,152,93,120,101,152,41,143,0,0,58,143,0,0,165,142,0,0,227,123,106,119,93,200,125,186,164,223,169,249,110,94,63,253,222,189,113,248,134,114,137,134,93,245,163,45,32,205,201,68,182,2,44,172,60,73,130,177,13,94,235,85,195,228,222,21,19,70,118,251,109,224,68,96,101,201,116,64,250,140,106,88,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,193,146,0,0,2,0,0,0,198,146,0,0,1,0,0,0,202,146,0,0,8,0,0,0,209,146,0,0,3,0,0,0,219,146,0,0,3,0,0,0,226,146,0,0,9,0,0,0,233,146,0,0,10,0,0,0,240,146,0,0,11,0,0,0,247,146,0,0,5,0,0,0,251,146,0,0,45,1,0,0,255,146,0,0,6,0,0,0,5,147,0,0,7,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,2,0,0,0,133,147,0,0,64,17,0,0,80,17,0,0,16,0,0,0,128,0,0,0,248,1,0,0,1,0,0,0,2,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,215,149,0,0,224,149,0,0,231,149,0,0,0,0,0,0,123,149,0,0,1,0,0,0,146,149,0,0,3,0,0,0,169,149,0,0,5,0,0,0,192,149,0,0,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,43,126,21,22,40,174,210,166,171,247,21,136,9,207,79,60,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,107,193,190,226,46,64,159,150,233,61,126,17,115,147,23,42,59,63,217,46,183,45,173,32,51,52,73,248,232,60,251,74,174,45,138,87,30,3,172,156,158,183,111,172,69,175,142,81,200,166,69,55,160,179,169,63,205,227,205,173,159,28,229,139,48,200,28,70,163,92,228,17,229,251,193,25,26,10,82,239,38,117,31,103,163,203,177,64,177,128,140,241,135,164,244,223,246,159,36,69,223,79,155,23,173,43,65,123,230,108,55,16,192,75,5,53,124,93,28,14,234,196,198,111,159,247,242,230,5,0,0,0,43,126,21,22,40,174,210,166,171,247,21,136,9,207,79,60,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,107,193,190,226,46,64,159,150,233,61,126,17,115,147,23,42,59,63,217,46,183,45,173,32,51,52,73,248,232,60,251,74,174,45,138,87,30,3,172,156,158,183,111,172,69,175,142,81,119,137,80,141,22,145,143,3,245,60,82,218,197,78,216,37,48,200,28,70,163,92,228,17,229,251,193,25,26,10,82,239,151,64,5,30,156,95,236,246,67,68,247,168,34,96,237,204,246,159,36,69,223,79,155,23,173,43,65,123,230,108,55,16,48,76,101,40,246,89,199,120,102,165,16,217,193,214,174,94,198,99,99,165,248,124,124,132,238,119,119,153,246,123,123,141,255,242,242,13,214,107,107,189,222,111,111,177,145,197,197,84,96,48,48,80,2,1,1,3,206,103,103,169,86,43,43,125,231,254,254,25,181,215,215,98,77,171,171,230,236,118,118,154,143,202,202,69,31,130,130,157,137,201,201,64,250,125,125,135,239,250,250,21,178,89,89,235,142,71,71,201,251,240,240,11,65,173,173,236,179,212,212,103,95,162,162,253,69,175,175,234,35,156,156,191,83,164,164,247,228,114,114,150,155,192,192,91,117,183,183,194,225,253,253,28,61,147,147,174,76,38,38,106,108,54,54,90,126,63,63,65,245,247,247,2,131,204,204,79,104,52,52,92,81,165,165,244,209,229,229,52,249,241,241,8,226,113,113,147,171,216,216,115,98,49,49,83,42,21,21,63,8,4,4,12,149,199,199,82,70,35,35,101,157,195,195,94,48,24,24,40,55,150,150,161,10,5,5,15,47,154,154,181,14,7,7,9,36,18,18,54,27,128,128,155,223,226,226,61,205,235,235,38,78,39,39,105,127,178,178,205,234,117,117,159,18,9,9,27,29,131,131,158,88,44,44,116,52,26,26,46,54,27,27,45,220,110,110,178,180,90,90,238,91,160,160,251,164,82,82,246,118,59,59,77,183,214,214,97,125,179,179,206,82,41,41,123,221,227,227,62,94,47,47,113,19,132,132,151,166,83,83,245,185,209,209,104,0,0,0,0,193,237,237,44,64,32,32,96,227,252,252,31,121,177,177,200,182,91,91,237,212,106,106,190,141,203,203,70,103,190,190,217,114,57,57,75,148,74,74,222,152,76,76,212,176,88,88,232,133,207,207,74,187,208,208,107,197,239,239,42,79,170,170,229,237,251,251,22,134,67,67,197,154,77,77,215,102,51,51,85,17,133,133,148,138,69,69,207,233,249,249,16,4,2,2,6,254,127,127,129,160,80,80,240,120,60,60,68,37,159,159,186,75,168,168,227,162,81,81,243,93,163,163,254,128,64,64,192,5,143,143,138,63,146,146,173,33,157,157,188,112,56,56,72,241,245,245,4,99,188,188,223,119,182,182,193,175,218,218,117,66,33,33,99,32,16,16,48,229,255,255,26,253,243,243,14,191,210,210,109,129,205,205,76,24,12,12,20,38,19,19,53,195,236,236,47,190,95,95,225,53,151,151,162,136,68,68,204,46,23,23,57,147,196,196,87,85,167,167,242,252,126,126,130,122,61,61,71,200,100,100,172,186,93,93,231,50,25,25,43,230,115,115,149,192,96,96,160,25,129,129,152,158,79,79,209,163,220,220,127,68,34,34,102,84,42,42,126,59,144,144,171,11,136,136,131,140,70,70,202,199,238,238,41,107,184,184,211,40,20,20,60,167,222,222,121,188,94,94,226,22,11,11,29,173,219,219,118,219,224,224,59,100,50,50,86,116,58,58,78,20,10,10,30,146,73,73,219,12,6,6,10,72,36,36,108,184,92,92,228,159,194,194,93,189,211,211,110,67,172,172,239,196,98,98,166,57,145,145,168,49,149,149,164,211,228,228,55,242,121,121,139,213,231,231,50,139,200,200,67,110,55,55,89,218,109,109,183,1,141,141,140,177,213,213,100,156,78,78,210,73,169,169,224,216,108,108,180,172,86,86,250,243,244,244,7,207,234,234,37,202,101,101,175,244,122,122,142,71,174,174,233,16,8,8,24,111,186,186,213,240,120,120,136,74,37,37,111,92,46,46,114,56,28,28,36,87,166,166,241,115,180,180,199,151,198,198,81,203,232,232,35,161,221,221,124,232,116,116,156,62,31,31,33,150,75,75,221,97,189,189,220,13,139,139,134,15,138,138,133,224,112,112,144,124,62,62,66,113,181,181,196,204,102,102,170,144,72,72,216,6,3,3,5,247,246,246,1,28,14,14,18,194,97,97,163,106,53,53,95,174,87,87,249,105,185,185,208,23,134,134,145,153,193,193,88,58,29,29,39,39,158,158,185,217,225,225,56,235,248,248,19,43,152,152,179,34,17,17,51,210,105,105,187,169,217,217,112,7,142,142,137,51,148,148,167,45,155,155,182,60,30,30,34,21,135,135,146,201,233,233,32,135,206,206,73,170,85,85,255,80,40,40,120,165,223,223,122,3,140,140,143,89,161,161,248,9,137,137,128,26,13,13,23,101,191,191,218,215,230,230,49,132,66,66,198,208,104,104,184,130,65,65,195,41,153,153,176,90,45,45,119,30,15,15,17,123,176,176,203,168,84,84,252,109,187,187,214,44,22,22,58,81,244,167,80,126,65,101,83,26,23,164,195,58,39,94,150,59,171,107,203,31,157,69,241,172,250,88,171,75,227,3,147,32,48,250,85,173,118,109,246,136,204,118,145,245,2,76,37,79,229,215,252,197,42,203,215,38,53,68,128,181,98,163,143,222,177,90,73,37,186,27,103,69,234,14,152,93,254,192,225,195,47,117,2,129,76,240,18,141,70,151,163,107,211,249,198,3,143,95,231,21,146,156,149,191,109,122,235,149,82,89,218,212,190,131,45,88,116,33,211,73,224,105,41,142,201,200,68,117,194,137,106,244,142,121,120,153,88,62,107,39,185,113,221,190,225,79,182,240,136,173,23,201,32,172,102,125,206,58,180,99,223,74,24,229,26,49,130,151,81,51,96,98,83,127,69,177,100,119,224,187,107,174,132,254,129,160,28,249,8,43,148,112,72,104,88,143,69,253,25,148,222,108,135,82,123,248,183,171,115,211,35,114,75,2,226,227,31,143,87,102,85,171,42,178,235,40,7,47,181,194,3,134,197,123,154,211,55,8,165,48,40,135,242,35,191,165,178,2,3,106,186,237,22,130,92,138,207,28,43,167,121,180,146,243,7,242,240,78,105,226,161,101,218,244,205,6,5,190,213,209,52,98,31,196,166,254,138,52,46,83,157,162,243,85,160,5,138,225,50,164,246,235,117,11,131,236,57,64,96,239,170,94,113,159,6,189,110,16,81,62,33,138,249,150,221,6,61,221,62,5,174,77,230,189,70,145,84,141,181,113,196,93,5,4,6,212,111,96,80,21,255,25,152,251,36,214,189,233,151,137,64,67,204,103,217,158,119,176,232,66,189,7,137,139,136,231,25,91,56,121,200,238,219,161,124,10,71,124,66,15,233,248,132,30,201,0,0,0,0,9,128,134,131,50,43,237,72,30,17,112,172,108,90,114,78,253,14,255,251,15,133,56,86,61,174,213,30,54,45,57,39,10,15,217,100,104,92,166,33,155,91,84,209,36,54,46,58,12,10,103,177,147,87,231,15,180,238,150,210,27,155,145,158,128,192,197,79,97,220,32,162,90,119,75,105,28,18,26,22,226,147,186,10,192,160,42,229,60,34,224,67,18,27,23,29,14,9,13,11,242,139,199,173,45,182,168,185,20,30,169,200,87,241,25,133,175,117,7,76,238,153,221,187,163,127,96,253,247,1,38,159,92,114,245,188,68,102,59,197,91,251,126,52,139,67,41,118,203,35,198,220,182,237,252,104,184,228,241,99,215,49,220,202,66,99,133,16,19,151,34,64,132,198,17,32,133,74,36,125,210,187,61,248,174,249,50,17,199,41,161,109,29,158,47,75,220,178,48,243,13,134,82,236,119,193,227,208,43,179,22,108,169,112,185,153,17,148,72,250,71,233,100,34,168,252,140,196,160,240,63,26,86,125,44,216,34,51,144,239,135,73,78,199,217,56,209,193,140,202,162,254,152,212,11,54,166,245,129,207,165,122,222,40,218,183,142,38,63,173,191,164,44,58,157,228,80,120,146,13,106,95,204,155,84,126,70,98,246,141,19,194,144,216,184,232,46,57,247,94,130,195,175,245,159,93,128,190,105,208,147,124,111,213,45,169,207,37,18,179,200,172,153,59,16,24,125,167,232,156,99,110,219,59,187,123,205,38,120,9,110,89,24,244,236,154,183,1,131,79,154,168,230,149,110,101,170,255,230,126,33,188,207,8,239,21,232,230,186,231,155,217,74,111,54,206,234,159,9,212,41,176,124,214,49,164,178,175,42,63,35,49,198,165,148,48,53,162,102,192,116,78,188,55,252,130,202,166,224,144,208,176,51,167,216,21,241,4,152,74,65,236,218,247,127,205,80,14,23,145,246,47,118,77,214,141,67,239,176,77,204,170,77,84,228,150,4,223,158,209,181,227,76,106,136,27,193,44,31,184,70,101,81,127,157,94,234,4,1,140,53,93,250,135,116,115,251,11,65,46,179,103,29,90,146,219,210,82,233,16,86,51,109,214,71,19,154,215,97,140,55,161,12,122,89,248,20,142,235,19,60,137,206,169,39,238,183,97,201,53,225,28,229,237,122,71,177,60,156,210,223,89,85,242,115,63,24,20,206,121,115,199,55,191,83,247,205,234,95,253,170,91,223,61,111,20,120,68,219,134,202,175,243,129,185,104,196,62,56,36,52,44,194,163,64,95,22,29,195,114,188,226,37,12,40,60,73,139,255,13,149,65,57,168,1,113,8,12,179,222,216,180,228,156,100,86,193,144,123,203,132,97,213,50,182,112,72,108,92,116,208,184,87,66,82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125,1,0,0,0,2,0,0,0,4,0,0,0,8,0,0,0,16,0,0,0,32,0,0,0,64,0,0,0,128,0,0,0,27,0,0,0,54,0,0,0,108,0,0,0,216,0,0,0,171,0,0,0,77,0,0,0,154,0,0,0,47,0,0,0,94,0,0,0,188,0,0,0,99,0,0,0,198,0,0,0,151,0,0,0,53,0,0,0,106,0,0,0,212,0,0,0,179,0,0,0,125,0,0,0,250,0,0,0,239,0,0,0,197,0,0,0,145,0,0,0,8,0,0,0,2,0,0,0,239,149,0,0,120,28,0,0,132,28,0,0,16,0,0,0,192,0,0,0,248,1,0,0,1,0,0,0,2,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,86,150,0,0,98,150,0,0,0,0,0,0,246,149,0,0,1,0,0,0,14,150,0,0,3,0,0,0,38,150,0,0,5,0,0,0,62,150,0,0,2,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,2,0,0,0,106,150,0,0,236,28,0,0,248,28,0,0,16,0,0,0,0,1,0,0,248,1,0,0,1,0,0,0,2,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,209,150,0,0,221,150,0,0,0,0,0,0,113,150,0,0,1,0,0,0,137,150,0,0,3,0,0,0,161,150,0,0,5,0,0,0,185,150,0,0,2,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,229,150,0,0,239,150,0,0,15,0,0,0,84,29,0,0,20,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,184,0,0,0,0,0,0,0,254,150,0,0,13,151,0,0,0,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,145,152,0,0,180,29,0,0,149,152,0,0,152,152,0,0,159,152,0,0,161,152,0,0,163,152,0,0,1,0,0,0,2,0,0,0,5,0,0,0,6,0,0,0,7,0,0,0,8,0,0,0,3,0,0,0,9,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,245,158,0,0,246,163,0,0,2,164,0,0,0,0,0,0,2,0,0,0,2,0,0,0,27,164,0,0,32,164,0,0,15,0,0,0,248,29,0,0,20,0,0,0,2,0,0,0,1,0,0,0,2,0,0,0,4,0,0,0,184,0,0,0,10,0,0,0,110,164,0,0,131,164,0,0,149,164,0,0,163,164,0,0,177,164,0,0,0,0,0,0,11,0,0,0,2,0,0,0,195,164,0,0,202,164,0,0,19,0,0,0,68,30,0,0,28,0,0,0,3,0,0,0,1,0,0,0,3,0,0,0,5,0,0,0,192,0,0,0,11,0,0,0,208,165,0,0,0,0,0,0,8,0,0,0,2,0,0,0,231,165,0,0,238,165,0,0,19,0,0,0,128,30,0,0,32,0,0,0,4,0,0,0,1,0,0,0,3,0,0,0,5,0,0,0,192,0,0,0,11,0,0,0,1,166,0,0,24,166,0,0,0,0,0,0,10,0,0,0,2,0,0,0,46,166,0,0,53,166,0,0,19,0,0,0,192,30,0,0,64,0,0,0,5,0,0,0,1,0,0,0,4,0,0,0,6,0,0,0,224,0,0,0,12,0,0,0,67,168,0,0,90,168,0,0,0,0,0,0,9,0,0,0,2,0,0,0,112,168,0,0,119,168,0,0,19,0,0,0,0,31,0,0,48,0,0,0,6,0,0,0,1,0,0,0,4,0,0,0,6,0,0,0,224,0,0,0,12,0,0,0,138,168,0,0,161,168,0,0,0,0,0,0,10,0,0,0,0,0,0,0,183,168,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,1,0,0,160,16,0,0,13,0,0,0,14,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,117,50,188,188,243,33,236,236,198,67,32,32,244,201,179,179,219,3,218,218,123,139,2,2,251,43,226,226,200,250,158,158,74,236,201,201,211,9,212,212,230,107,24,24,107,159,30,30,69,14,152,152,125,56,178,178,232,210,166,166,75,183,38,38,214,87,60,60,50,138,147,147,216,238,130,130,253,152,82,82,55,212,123,123,113,55,187,187,241,151,91,91,225,131,71,71,48,60,36,36,15,226,81,81,248,198,186,186,27,243,74,74,135,72,191,191,250,112,13,13,6,179,176,176,63,222,117,117,94,253,210,210,186,32,125,125,174,49,102,102,91,163,58,58,138,28,89,89,0,0,0,0,188,147,205,205,157,224,26,26,109,44,174,174,193,171,127,127,177,199,43,43,14,185,190,190,128,160,224,224,93,16,138,138,210,82,59,59,213,186,100,100,160,136,216,216,132,165,231,231,7,232,95,95,20,17,27,27,181,194,44,44,144,180,252,252,44,39,49,49,163,101,128,128,178,42,115,115,115,129,12,12,76,95,121,121,84,65,107,107,146,2,75,75,116,105,83,83,54,143,148,148,81,31,131,131,56,54,42,42,176,156,196,196,189,200,34,34,90,248,213,213,252,195,189,189,96,120,72,72,98,206,255,255,150,7,76,76,108,119,65,65,66,230,199,199,247,36,235,235,16,20,28,28,124,99,93,93,40,34,54,54,39,192,103,103,140,175,233,233,19,249,68,68,149,234,20,20,156,187,245,245,199,24,207,207,36,45,63,63,70,227,192,192,59,219,114,114,112,108,84,84,202,76,41,41,227,53,240,240,133,254,8,8,203,23,198,198,17,79,243,243,208,228,140,140,147,89,164,164,184,150,202,202,166,59,104,104,131,77,184,184,32,40,56,56,255,46,229,229,159,86,173,173,119,132,11,11,195,29,200,200,204,255,153,153,3,237,88,88,111,154,25,25,8,10,14,14,191,126,149,149,64,80,112,112,231,48,247,247,43,207,110,110,226,110,31,31,121,61,181,181,12,15,9,9,170,52,97,97,130,22,87,87,65,11,159,159,58,128,157,157,234,100,17,17,185,205,37,37,228,221,175,175,154,8,69,69,164,141,223,223,151,92,163,163,126,213,234,234,218,88,53,53,122,208,237,237,23,252,67,67,102,203,248,248,148,177,251,251,161,211,55,55,29,64,250,250,61,104,194,194,240,204,180,180,222,93,50,50,179,113,156,156,11,231,86,86,114,218,227,227,167,96,135,135,28,27,21,21,239,58,249,249,209,191,99,99,83,169,52,52,62,133,154,154,143,66,177,177,51,209,124,124,38,155,136,136,95,166,61,61,236,215,161,161,118,223,228,228,42,148,129,129,73,1,145,145,129,251,15,15,136,170,238,238,238,97,22,22,33,115,215,215,196,245,151,151,26,168,165,165,235,63,254,254,217,181,109,109,197,174,120,120,57,109,197,197,153,229,29,29,205,164,118,118,173,220,62,62,49,103,203,203,139,71,182,182,1,91,239,239,24,30,18,18,35,197,96,96,221,176,106,106,31,246,77,77,78,233,206,206,45,124,222,222,249,157,85,85,72,90,126,126,79,178,33,33,242,122,3,3,101,38,160,160,142,25,94,94,120,102,90,90,92,75,101,101,88,78,98,98,25,69,253,253,141,244,6,6,229,134,64,64,152,190,242,242,87,172,51,51,103,144,23,23,127,142,5,5,5,94,232,232,100,125,79,79,175,106,137,137,99,149,16,16,182,47,116,116,254,117,10,10,245,146,92,92,183,116,155,155,60,51,45,45,165,214,48,48,206,73,46,46,233,137,73,73,104,114,70,70,68,85,119,119,224,216,168,168,77,4,150,150,67,189,40,40,105,41,169,169,41,121,217,217,46,145,134,134,172,135,209,209,21,74,244,244,89,21,141,141,168,130,214,214,10,188,185,185,158,13,66,66,110,193,246,246,71,184,47,47,223,6,221,221,52,57,35,35,53,98,204,204,106,196,241,241,207,18,193,193,220,235,133,133,34,158,143,143,201,161,113,113,192,240,144,144,155,83,170,170,137,241,1,1,212,225,139,139,237,140,78,78,171,111,142,142,18,162,171,171,162,62,111,111,13,84,230,230,82,242,219,219,187,123,146,146,2,182,183,183,47,202,105,105,169,217,57,57,215,12,211,211,97,35,167,167,30,173,162,162,180,153,195,195,80,68,108,108,4,5,7,7,246,127,4,4,194,70,39,39,22,167,172,172,37,118,208,208,134,19,80,80,86,247,220,220,85,26,132,132,9,81,225,225,190,37,122,122,145,239,19,19,57,57,217,169,23,23,144,103,156,156,113,179,166,166,210,232,7,7,5,4,82,82,152,253,128,128,101,163,228,228,223,118,69,69,8,154,75,75,2,146,224,224,160,128,90,90,102,120,175,175,221,228,106,106,176,221,99,99,191,209,42,42,54,56,230,230,84,13,32,32,67,198,204,204,98,53,242,242,190,152,18,18,30,24,235,235,36,247,161,161,215,236,65,65,119,108,40,40,189,67,188,188,50,117,123,123,212,55,136,136,155,38,13,13,112,250,68,68,249,19,251,251,177,148,126,126,90,72,3,3,122,242,140,140,228,208,182,182,71,139,36,36,60,48,231,231,165,132,107,107,65,84,221,221,6,223,96,96,197,35,253,253,69,25,58,58,163,91,194,194,104,61,141,141,21,89,236,236,33,243,102,102,49,174,111,111,62,162,87,87,22,130,16,16,149,99,239,239,91,1,184,184,77,131,134,134,145,46,109,109,181,217,131,131,31,81,170,170,83,155,93,93,99,124,104,104,59,166,254,254,63,235,48,48,214,165,122,122,37,190,172,172,167,22,9,9,15,12,240,240,53,227,167,167,35,97,144,144,240,192,233,233,175,140,157,157,128,58,92,92,146,245,12,12,129,115,49,49,39,44,208,208,118,37,86,86,231,11,146,146,123,187,206,206,233,78,1,1,241,137,30,30,159,107,52,52,169,83,241,241,196,106,195,195,153,180,91,91,151,241,71,71,131,225,24,24,107,230,34,34,200,189,152,152,14,69,31,31,110,226,179,179,201,244,116,116,47,182,248,248,203,102,153,153,255,204,20,20,234,149,88,88,237,3,220,220,247,86,139,139,225,212,21,21,27,28,162,162,173,30,211,211,12,215,226,226,43,251,200,200,29,195,94,94,25,142,44,44,194,181,73,73,137,233,193,193,18,207,149,149,126,191,125,125,32,186,17,17,100,234,11,11,132,119,197,197,109,57,137,137,106,175,124,124,209,51,113,113,161,201,255,255,206,98,187,187,55,113,15,15,251,129,181,181,61,121,225,225,81,9,62,62,220,173,63,63,45,36,118,118,164,205,85,85,157,249,130,130,238,216,64,64,134,229,120,120,174,197,37,37,205,185,150,150,4,77,119,119,85,68,14,14,10,8,80,80,19,134,247,247,48,231,55,55,211,161,250,250,64,29,97,97,52,170,78,78,140,237,176,176,179,6,84,84,108,112,115,115,42,178,59,59,82,210,159,159,11,65,2,2,139,123,216,216,136,160,243,243,79,17,203,203,103,49,39,39,70,194,103,103,192,39,252,252,180,144,56,56,40,32,4,4,127,246,72,72,120,96,229,229,46,255,76,76,7,150,101,101,75,92,43,43,199,177,142,142,111,171,66,66,13,158,245,245,187,156,219,219,242,82,74,74,243,27,61,61,166,95,164,164,89,147,185,185,188,10,249,249,58,239,19,19,239,145,8,8,254,133,145,145,1,73,22,22,97,238,222,222,124,45,33,33,178,79,177,177,66,143,114,114,219,59,47,47,184,71,191,191,72,135,174,174,44,109,192,192,227,70,60,60,87,214,154,154,133,62,169,169,41,105,79,79,125,100,129,129,148,42,46,46,73,206,198,198,23,203,105,105,202,47,189,189,195,252,163,163,92,151,232,232,94,5,237,237,208,122,209,209,135,172,5,5,142,127,100,100,186,213,165,165,168,26,38,38,183,75,190,190,185,14,135,135,96,167,213,213,248,90,54,54,34,40,27,27,17,20,117,117,222,63,217,217,121,41,238,238,170,136,45,45,51,60,121,121,95,76,183,183,182,2,202,202,150,184,53,53,88,218,196,196,156,176,67,67,252,23,132,132,26,85,77,77,246,31,89,89,28,138,178,178,56,125,51,51,172,87,207,207,24,199,6,6,244,141,83,83,105,116,155,155,116,183,151,151,245,196,173,173,86,159,227,227,218,114,234,234,213,126,244,244,74,21,143,143,158,34,171,171,162,18,98,98,78,88,95,95,232,7,29,29,229,153,35,35,57,52,246,246,193,110,108,108,68,80,50,50,93,222,70,70,114,104,160,160,38,101,205,205,147,188,218,218,3,219,186,186,198,248,158,158,250,200,214,214,130,168,110,110,207,43,112,112,80,64,133,133,235,220,10,10,117,254,147,147,138,50,223,223,141,164,41,41,76,202,28,28,20,16,215,215,115,33,180,180,204,240,212,212,9,211,138,138,16,93,81,81,226,15,0,0,0,0,25,25,154,111,26,26,224,157,148,148,143,54,199,199,230,66,201,201,236,74,210,210,253,94,127,127,171,193,168,168,216,224,50,188,117,188,33,236,243,236,67,32,198,32,201,179,244,179,3,218,219,218,139,2,123,2,43,226,251,226,250,158,200,158,236,201,74,201,9,212,211,212,107,24,230,24,159,30,107,30,14,152,69,152,56,178,125,178,210,166,232,166,183,38,75,38,87,60,214,60,138,147,50,147,238,130,216,130,152,82,253,82,212,123,55,123,55,187,113,187,151,91,241,91,131,71,225,71,60,36,48,36,226,81,15,81,198,186,248,186,243,74,27,74,72,191,135,191,112,13,250,13,179,176,6,176,222,117,63,117,253,210,94,210,32,125,186,125,49,102,174,102,163,58,91,58,28,89,138,89,0,0,0,0,147,205,188,205,224,26,157,26,44,174,109,174,171,127,193,127,199,43,177,43,185,190,14,190,160,224,128,224,16,138,93,138,82,59,210,59],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE);allocate([186,100,213,100,136,216,160,216,165,231,132,231,232,95,7,95,17,27,20,27,194,44,181,44,180,252,144,252,39,49,44,49,101,128,163,128,42,115,178,115,129,12,115,12,95,121,76,121,65,107,84,107,2,75,146,75,105,83,116,83,143,148,54,148,31,131,81,131,54,42,56,42,156,196,176,196,200,34,189,34,248,213,90,213,195,189,252,189,120,72,96,72,206,255,98,255,7,76,150,76,119,65,108,65,230,199,66,199,36,235,247,235,20,28,16,28,99,93,124,93,34,54,40,54,192,103,39,103,175,233,140,233,249,68,19,68,234,20,149,20,187,245,156,245,24,207,199,207,45,63,36,63,227,192,70,192,219,114,59,114,108,84,112,84,76,41,202,41,53,240,227,240,254,8,133,8,23,198,203,198,79,243,17,243,228,140,208,140,89,164,147,164,150,202,184,202,59,104,166,104,77,184,131,184,40,56,32,56,46,229,255,229,86,173,159,173,132,11,119,11,29,200,195,200,255,153,204,153,237,88,3,88,154,25,111,25,10,14,8,14,126,149,191,149,80,112,64,112,48,247,231,247,207,110,43,110,110,31,226,31,61,181,121,181,15,9,12,9,52,97,170,97,22,87,130,87,11,159,65,159,128,157,58,157,100,17,234,17,205,37,185,37,221,175,228,175,8,69,154,69,141,223,164,223,92,163,151,163,213,234,126,234,88,53,218,53,208,237,122,237,252,67,23,67,203,248,102,248,177,251,148,251,211,55,161,55,64,250,29,250,104,194,61,194,204,180,240,180,93,50,222,50,113,156,179,156,231,86,11,86,218,227,114,227,96,135,167,135,27,21,28,21,58,249,239,249,191,99,209,99,169,52,83,52,133,154,62,154,66,177,143,177,209,124,51,124,155,136,38,136,166,61,95,61,215,161,236,161,223,228,118,228,148,129,42,129,1,145,73,145,251,15,129,15,170,238,136,238,97,22,238,22,115,215,33,215,245,151,196,151,168,165,26,165,63,254,235,254,181,109,217,109,174,120,197,120,109,197,57,197,229,29,153,29,164,118,205,118,220,62,173,62,103,203,49,203,71,182,139,182,91,239,1,239,30,18,24,18,197,96,35,96,176,106,221,106,246,77,31,77,233,206,78,206,124,222,45,222,157,85,249,85,90,126,72,126,178,33,79,33,122,3,242,3,38,160,101,160,25,94,142,94,102,90,120,90,75,101,92,101,78,98,88,98,69,253,25,253,244,6,141,6,134,64,229,64,190,242,152,242,172,51,87,51,144,23,103,23,142,5,127,5,94,232,5,232,125,79,100,79,106,137,175,137,149,16,99,16,47,116,182,116,117,10,254,10,146,92,245,92,116,155,183,155,51,45,60,45,214,48,165,48,73,46,206,46,137,73,233,73,114,70,104,70,85,119,68,119,216,168,224,168,4,150,77,150,189,40,67,40,41,169,105,169,121,217,41,217,145,134,46,134,135,209,172,209,74,244,21,244,21,141,89,141,130,214,168,214,188,185,10,185,13,66,158,66,193,246,110,246,184,47,71,47,6,221,223,221,57,35,52,35,98,204,53,204,196,241,106,241,18,193,207,193,235,133,220,133,158,143,34,143,161,113,201,113,240,144,192,144,83,170,155,170,241,1,137,1,225,139,212,139,140,78,237,78,111,142,171,142,162,171,18,171,62,111,162,111,84,230,13,230,242,219,82,219,123,146,187,146,182,183,2,183,202,105,47,105,217,57,169,57,12,211,215,211,35,167,97,167,173,162,30,162,153,195,180,195,68,108,80,108,5,7,4,7,127,4,246,4,70,39,194,39,167,172,22,172,118,208,37,208,19,80,134,80,247,220,86,220,26,132,85,132,81,225,9,225,37,122,190,122,239,19,145,19,217,169,57,217,144,103,23,144,113,179,156,113,210,232,166,210,5,4,7,5,152,253,82,152,101,163,128,101,223,118,228,223,8,154,69,8,2,146,75,2,160,128,224,160,102,120,90,102,221,228,175,221,176,221,106,176,191,209,99,191,54,56,42,54,84,13,230,84,67,198,32,67,98,53,204,98,190,152,242,190,30,24,18,30,36,247,235,36,215,236,161,215,119,108,65,119,189,67,40,189,50,117,188,50,212,55,123,212,155,38,136,155,112,250,13,112,249,19,68,249,177,148,251,177,90,72,126,90,122,242,3,122,228,208,140,228,71,139,182,71,60,48,36,60,165,132,231,165,65,84,107,65,6,223,221,6,197,35,96,197,69,25,253,69,163,91,58,163,104,61,194,104,21,89,141,21,33,243,236,33,49,174,102,49,62,162,111,62,22,130,87,22,149,99,16,149,91,1,239,91,77,131,184,77,145,46,134,145,181,217,109,181,31,81,131,31,83,155,170,83,99,124,93,99,59,166,104,59,63,235,254,63,214,165,48,214,37,190,122,37,167,22,172,167,15,12,9,15,53,227,240,53,35,97,167,35,240,192,144,240,175,140,233,175,128,58,157,128,146,245,92,146,129,115,12,129,39,44,49,39,118,37,208,118,231,11,86,231,123,187,146,123,233,78,206,233,241,137,1,241,159,107,30,159,169,83,52,169,196,106,241,196,153,180,195,153,151,241,91,151,131,225,71,131,107,230,24,107,200,189,34,200,14,69,152,14,110,226,31,110,201,244,179,201,47,182,116,47,203,102,248,203,255,204,153,255,234,149,20,234,237,3,88,237,247,86,220,247,225,212,139,225,27,28,21,27,173,30,162,173,12,215,211,12,43,251,226,43,29,195,200,29,25,142,94,25,194,181,44,194,137,233,73,137,18,207,193,18,126,191,149,126,32,186,125,32,100,234,17,100,132,119,11,132,109,57,197,109,106,175,137,106,209,51,124,209,161,201,113,161,206,98,255,206,55,113,187,55,251,129,15,251,61,121,181,61,81,9,225,81,220,173,62,220,45,36,63,45,164,205,118,164,157,249,85,157,238,216,130,238,134,229,64,134,174,197,120,174,205,185,37,205,4,77,150,4,85,68,119,85,10,8,14,10,19,134,80,19,48,231,247,48,211,161,55,211,64,29,250,64,52,170,97,52,140,237,78,140,179,6,176,179,108,112,84,108,42,178,115,42,82,210,59,82,11,65,159,11,139,123,2,139,136,160,216,136,79,17,243,79,103,49,203,103,70,194,39,70,192,39,103,192,180,144,252,180,40,32,56,40,127,246,4,127,120,96,72,120,46,255,229,46,7,150,76,7,75,92,101,75,199,177,43,199,111,171,142,111,13,158,66,13,187,156,245,187,242,82,219,242,243,27,74,243,166,95,61,166,89,147,164,89,188,10,185,188,58,239,249,58,239,145,19,239,254,133,8,254,1,73,145,1,97,238,22,97,124,45,222,124,178,79,33,178,66,143,177,66,219,59,114,219,184,71,47,184,72,135,191,72,44,109,174,44,227,70,192,227,87,214,60,87,133,62,154,133,41,105,169,41,125,100,79,125,148,42,129,148,73,206,46,73,23,203,198,23,202,47,105,202,195,252,189,195,92,151,163,92,94,5,232,94,208,122,237,208,135,172,209,135,142,127,5,142,186,213,100,186,168,26,165,168,183,75,38,183,185,14,190,185,96,167,135,96,248,90,213,248,34,40,54,34,17,20,27,17,222,63,117,222,121,41,217,121,170,136,238,170,51,60,45,51,95,76,121,95,182,2,183,182,150,184,202,150,88,218,53,88,156,176,196,156,252,23,67,252,26,85,132,26,246,31,77,246,28,138,89,28,56,125,178,56,172,87,51,172,24,199,207,24,244,141,6,244,105,116,83,105,116,183,155,116,245,196,151,245,86,159,173,86,218,114,227,218,213,126,234,213,74,21,244,74,158,34,143,158,162,18,171,162,78,88,98,78,232,7,95,232,229,153,29,229,57,52,35,57,193,110,246,193,68,80,108,68,93,222,50,93,114,104,70,114,38,101,160,38,147,188,205,147,3,219,218,3,198,248,186,198,250,200,158,250,130,168,214,130,207,43,110,207,80,64,112,80,235,220,133,235,117,254,10,117,138,50,147,138,141,164,223,141,76,202,41,76,20,16,28,20,115,33,215,115,204,240,180,204,9,211,212,9,16,93,138,16,226,15,81,226,0,0,0,0,154,111,25,154,224,157,26,224,143,54,148,143,230,66,199,230,236,74,201,236,253,94,210,253,171,193,127,171,216,224,168,216,47,1,0,0,0,0,0,0,174,176,0,0,0,0,0,0,0,0,0,0,16,0,0,0,128,0,0,0,160,16,0,0,13,0,0,0,14,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152,47,138,66,145,68,55,113,207,251,192,181,165,219,181,233,91,194,86,57,241,17,241,89,164,130,63,146,213,94,28,171,152,170,7,216,1,91,131,18,190,133,49,36,195,125,12,85,116,93,190,114,254,177,222,128,167,6,220,155,116,241,155,193,193,105,155,228,134,71,190,239,198,157,193,15,204,161,12,36,111,44,233,45,170,132,116,74,220,169,176,92,218,136,249,118,82,81,62,152,109,198,49,168,200,39,3,176,199,127,89,191,243,11,224,198,71,145,167,213,81,99,202,6,103,41,41,20,133,10,183,39,56,33,27,46,252,109,44,77,19,13,56,83,84,115,10,101,187,10,106,118,46,201,194,129,133,44,114,146,161,232,191,162,75,102,26,168,112,139,75,194,163,81,108,199,25,232,146,209,36,6,153,214,133,53,14,244,112,160,106,16,22,193,164,25,8,108,55,30,76,119,72,39,181,188,176,52,179,12,28,57,74,170,216,78,79,202,156,91,243,111,46,104,238,130,143,116,111,99,165,120,20,120,200,132,8,2,199,140,250,255,190,144,235,108,80,164,247,163,249,190,242,120,113,198,18,0,0,0,0,0,0,0,3,0,0,0,10,183,0,0,12,49,0,0,14,183,0,0,22,183,0,0,31,183,0,0,34,183,0,0,14,183,0,0,3,0,0,0,7,0,0,0,16,0,0,0,17,0,0,0,18,0,0,0,19,0,0,0,8,0,0,0,20,0,0,0,4,0,0,0,21,0,0,0,9,0,0,0,191,193,0,0,195,193,0,0,201,193,0,0,206,193,0,0,212,193,0,0,0,0,0,0,16,0,0,0,7,0,0,0,22,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,22,0,0,0,37,0,0,0,63,0,0,0,92,0,0,0,117,0,0,0,132,0,0,0,147,0,0,0,161,0,0,0,175,0,0,0,190,0,0,0,205,0,0,0,230,0,0,0,243,0,0,0,2,1,0,0,16,1,0,0,27,1,0,0,41,1,0,0,63,1,0,0,79,1,0,0,109,1,0,0,129,1,0,0,153,1,0,0,179,1,0,0,204,1,0,0,222,1,0,0,231,1,0,0,241,1,0,0,1,2,0,0,14,2,0,0,28,2,0,0,47,2,0,0,71,2,0,0,91,2,0,0,107,2,0,0,122,2,0,0,138,2,0,0,154,2,0,0,171,2,0,0,185,2,0,0,201,2,0,0,228,2,0,0,245,2,0,0,9,3,0,0,28,3,0,0,45,3,0,0,65,3,0,0,77,3,0,0,91,3,0,0,104,3,0,0,120,3,0,0,139,3,0,0,158,3,0,0,178,3,0,0,198,3,0,0,212,3,0,0,234,3,0,0,254,3,0,0,6,4,0,0,10,4,0,0,24,4,0,0,47,4,0,0,55,4,0,0,70,4,0,0,83,4,0,0,98,4,0,0,127,4,0,0,156,4,0,0,179,4,0,0,195,4,0,0,211,4,0,0,231,4,0,0,244,4,0,0,3,5,0,0,20,5,0,0,36,5,0,0,53,5,0,0,70,5,0,0,82,5,0,0,95,5,0,0,126,5,0,0,147,5,0,0,167,5,0,0,188,5,0,0,210,5,0,0,222,5,0,0,237,5,0,0,245,5,0,0,2,6,0,0,11,6,0,0,29,6,0,0,40,6,0,0,51,6,0,0,65,6,0,0,85,6,0,0,98,6,0,0,110,6,0,0,124,6,0,0,136,6,0,0,156,6,0,0,175,6,0,0,195,6,0,0,217,6,0,0,241,6,0,0,6,7,0,0,29,7,0,0,50,7,0,0,65,7,0,0,76,7,0,0,96,7,0,0,109,7,0,0,122,7,0,0,139,7,0,0,161,7,0,0,175,7,0,0,195,7,0,0,211,7,0,0,225,7,0,0,236,7,0,0,0,8,0,0,23,8,0,0,44,8,0,0,59,8,0,0,80,8,0,0,102,8,0,0,118,8,0,0,132,8,0,0,148,8,0,0,162,8,0,0,179,8,0,0,191,8,0,0,223,8,0,0,243,8,0,0,255,8,0,0,9,9,0,0,21,9,0,0,39,9,0,0,60,9,0,0,72,9,0,0,87,9,0,0,104,9,0,0,119,9,0,0,135,9,0,0,149,9,0,0,168,9,0,0,187,9,0,0,210,9,0,0,231,9,0,0,255,9,0,0,17,10,0,0,39,10,0,0,62,10,0,0,80,10,0,0,92,10,0,0,110,10,0,0,127,10,0,0,141,10,0,0,158,10,0,0,173,10,0,0,196,10,0,0,215,10,0,0,228,10,0,0,247,10,0,0,15,11,0,0,42,11,0,0,55,11,0,0,80,11,0,0,91,11,0,0,110,11,0,0,122,11,0,0,138,11,0,0,156,11,0,0,183,11,0,0,190,11,0,0,205,11,0,0,221,11,0,0,237,11,0,0,1,12,0,0,14,12,0,0,26,12,0,0,43,12,0,0,55,12,0,0,72,12,0,0,86,12,0,0,102,12,0,0,129,12,0,0,152,12,0,0,175,12,0,0,198,12,0,0,213,12,0,0,230,12,0,0,248,12,0,0,13,13,0,0,32,13,0,0,63,13,0,0,81,13,0,0,99,13,0,0,121,13,0,0,147,13,0,0,174,13,0,0,191,13,0,0,232,13,0,0,8,14,0,0,46,14,0,0,73,14,0,0,103,14,0,0,133,14,0,0,161,14,0,0,198,14,0,0,222,14,0,0,14,15,0,0,56,15,0,0,96,15,0,0,132,15,0,0,143,15,0,0,161,15,0,0,178,15,0,0,209,15,0,0,230,15,0,0,255,15,0,0,14,16,0,0,38,16,0,0,57,16,0,0,93,16,0,0,114,16,0,0,143,16,0,0,163,16,0,0,190,16,0,0,218,16,0,0,233,16,0,0,244,16,0,0,5,17,0,0,42,17,0,0,87,17,0,0,131,17,0,0,171,17,0,0,209,17,0,0,247,17,0,0,33,18,0,0,67,18,0,0,112,18,0,0,157,18,0,0,170,18,0,0,180,18,0,0,193,18,0,0,228,18,0,0,248,18,0,0,10,19,0,0,33,19,0,0,57,19,0,0,78,19,0,0,106,19,0,0,136,19,0,0,164,19,0,0,184,19,0,0,208,19,0,0,235,19,0,0,253,19,0,0,15,20,0,0,43,20,0,0,58,20,0,0,74,20,0,0,102,20,0,0,125,20,0,0,145,20,0,0,162,20,0,0,190,20,0,0,214,20,0,0,239,20,0,0,3,21,0,0,23,21,0,0,42,21,0,0,71,21,0,0,95,21,0,0,123,21,0,0,150,21,0,0,176,21,0,0,205,21,0,0,229,21,0,0,254,21,0,0,25,22,0,0,54,22,0,0,71,22,0,0,96,22,0,0,119,22,0,0,141,22,0,0,160,22,0,0,182,22,0,0,215,22,0,0,245,22,0,0,12,23,0,0,47,23,0,0,63,23,0,0,83,23,0,0,103,23,0,0,120,23,0,0,147,23,0,0,160,23,0,0,182,23,0,0,202,23,0,0,230,23,0,0,2,24,0,0,21,24,0,0,39,24,0,0,80,24,0,0,120,24,0,0,159,24,0,0,173,24,0,0,208,24,0,0,247,24,0,0,24,25,0,0,51,25,0,0,74,25,0,0,104,25,0,0,135,25,0,0,164,25,0,0,190,25,0,0,213,25,0,0,233,25,0,0,252,25,0,0,22,26,0,0,43,26,0,0,76,26,0,0,113,26,0,0,147,26,0,0,172,26,0,0,201,26,0,0,221,26,0,0,248,26,0,0,28,27,0,0,50,27,0,0,72,27,0,0,100,27,0,0,139,27,0,0,173,27,0,0,195,27,0,0,227,27,0,0,250,27,0,0,31,28,0,0,60,28,0,0,77,28,0,0,105,28,0,0,132,28,0,0,153,28,0,0,180,28,0,0,204,28,0,0,219,28,0,0,247,28,0,0,15,29,0,0,34,29,0,0,56,29,0,0,93,29,0,0,119,29,0,0,145,29,0,0,171,29,0,0,197,29,0,0,223,29,0,0,249,29,0,0,19,30,0,0,45,30,0,0,71,30,0,0,98,30,0,0,125,30,0,0,152,30,0,0,179,30,0,0,206,30,0,0,233,30,0,0,4,31,0,0,27,31,0,0,48,31,0,0,60,31,0,0,7,0,0,0,13,0,0,0,98,0,0,0,99,0,0,0,68,0,0,0,97,0,0,0,11,0,0,0,114,0,0,0,0,0,0,0,0,0,0,0,52,0,0,0,9,0,0,0,77,0,0,0,74,0,0,0,53,0,0,0,0,0,0,0,56,0,0,0,57,0,0,0,59,0,0,0,16,0,0,0,125,0,0,0,10,0,0,0,44,0,0,0,70,0,0,0,103,0,0,0,111,0,0,0,104,0,0,0,0,0,0,0,35,0,0,0,35,0,0,0,89,0,0,0,0,0,0,0,33,0,0,0,73,0,0,0,122,0,0,0,17,0,0,0,14,0,0,0,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,0,0,113,0,0,0,43,0,0,0,0,0,0,0,84,0,0,0,115,0,0,0,4,0,0,0,22,0,0,0,5,0,0,0,106,0,0,0,21,0,0,0,120,0,0,0,51,0,0,0,45,0,0,0,46,0,0,0,47,0,0,0,79,0,0,0,80,0,0,0,83,0,0,0,82,0,0,0,81,0,0,0,48,0,0,0,40,0,0,0,124,0,0,0,24,0,0,0,31,0,0,0,90,0,0,0,72,0,0,0,36,0,0,0,119,0,0,0,0,0,0,0,100,0,0,0,102,0,0,0,101,0,0,0,23,0,0,0,55,0,0,0,105,0,0,0,50,0,0,0,61,0,0,0,19,0,0,0,2,0,0,0,8,0,0,0,37,0,0,0,67,0,0,0,123,0,0,0,12,0,0,0,42,0,0,0,64,0,0,0,65,0,0,0,92,0,0,0,28,0,0,0,63,0,0,0,60,0,0,0,38,0,0,0,15,0,0,0,107,0,0,0,20,0,0,0,39,0,0,0,118,0,0,0,88,0,0,0,95,0,0,0,25,0,0,0,76,0,0,0,6,0,0,0,95,0,0,0,75,0,0,0,1,0,0,0,96,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,0,0,0,93,0,0,0,91,0,0,0,34,0,0,0,78,0,0,0,66,0,0,0,121,0,0,0,85,0,0,0,30,0,0,0,0,0,0,0,108,0,0,0,94,0,0,0,29,0,0,0,3,0,0,0,69,0,0,0,116,0,0,0,86,0,0,0,62,0,0,0,110,0,0,0,109,0,0,0,26,0,0,0,117,0,0,0,49,0,0,0,87,0,0,0,11,0,0,0,18,0,0,0,54,0,0,0,107,128,0,0,81,128,0,0,127,128,0,0,47,128,0,0,49,128,0,0,104,128,0,0,0,128,0,0,82,128,0,0,11,128,0,0,21,128,0,0,6,128,0,0,138,128,0,0,86,128,0,0,1,128,0,0,36,128,0,0,95,128,0,0,19,128,0,0,35,128,0,0,139,128,0,0,80,128,0,0,97,128,0,0,51,128,0,0,48,128,0,0,75,128,0,0,65,128,0,0,102,128,0,0,134,128,0,0,37,128,0,0,91,128,0,0,126,128,0,0,122,128,0,0,66,128,0,0,109,128,0,0,32,128,0,0,117,128,0,0,28,128,0,0,29,128,0,0,69,128,0,0,83,128,0,0,94,128,0,0,98,128,0,0,63,128,0,0,87,128,0,0,43,128,0,0,22,128,0,0,54,128,0,0,55,128,0,0,56,128,0,0,62,128,0,0,136,128,0,0,78,128,0,0,53,128,0,0,10,128,0,0,14,128,0,0,140,128,0,0,76,128,0,0,16,128,0,0,17,128,0,0,18,128,0,0,93,128,0,0,79,128,0,0,131,128,0,0,92,128,0,0,88,128,0,0,89,128,0,0,119,128,0,0,84,128,0,0,4,128,0,0,128,128,0,0,23,128,0,0,114,128,0,0,68,128,0,0,33,128,0,0,13,128,0,0,106,128,0,0,103,128,0,0,12,128,0,0,118,128,0,0,57,128,0,0,58,128,0,0,61,128,0,0,60,128,0,0,59,128,0,0,45,128,0,0,121,128,0,0,130,128,0,0,137,128,0,0,100,128,0,0,30,128,0,0,67,128,0,0,116,128,0,0,90,128,0,0,115,128,0,0,125,128,0,0,101,128,0,0,105,128,0,0,108,128,0,0,5,128,0,0,2,128,0,0,3,128,0,0,72,128,0,0,74,128,0,0,73,128,0,0,24,128,0,0,26,128,0,0,77,128,0,0,50,128,0,0,96,128,0,0,124,128,0,0,133,128,0,0,132,128,0,0,25,128,0,0,41,128,0,0,42,128,0,0,7,128,0,0,46,128,0,0,129,128,0,0,135,128,0,0,99,128,0,0,70,128,0,0,52,128,0,0,120,128,0,0,34,128,0,0,85,128,0,0,64,128,0,0,20,128,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,5,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,0,0,0,24,0,0,0,176,24,1,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,20,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,60,0,0,128,61,0,0,5,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,0,0,0,24,0,0,0,184,28,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,192,3,0,0,192,4,0,0,192,5,0,0,192,6,0,0,192,7,0,0,192,8,0,0,192,9,0,0,192,10,0,0,192,11,0,0,192,12,0,0,192,13,0,0,192,14,0,0,192,15,0,0,192,16,0,0,192,17,0,0,192,18,0,0,192,19,0,0,192,20,0,0,192,21,0,0,192,22,0,0,192,23,0,0,192,24,0,0,192,25,0,0,192,26,0,0,192,27,0,0,192,28,0,0,192,29,0,0,192,30,0,0,192,31,0,0,192,0,0,0,179,1,0,0,195,2,0,0,195,3,0,0,195,4,0,0,195,5,0,0,195,6,0,0,195,7,0,0,195,8,0,0,195,9,0,0,195,10,0,0,195,11,0,0,195,12,0,0,195,13,0,0,211,14,0,0,195,15,0,0,195,0,0,12,187,1,0,12,195,2,0,12,195,3,0,12,195,4,0,12,211,32,0,0,0,9,0,0,0,10,0,0,0,13,0,0,0,11,0,0,0,12,0,0,0,133,0,0,0,0,32,0,0,1,32,0,0,2,32,0,0,3,32,0,0,4,32,0,0,5,32,0,0,6,32,0,0,8,32,0,0,9,32,0,0,10,32,0,0,40,32,0,0,41,32,0,0,95,32,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,172,63,0,0,3,0,0,0,0,0,0,0,45,244,81,88,207,140,177,192,70,246,181,203,41,49,3,199,4,91,112,48,180,93,253,32,120,127,139,154,216,89,41,80,104,72,137,171,167,86,3,108,255,183,205,136,63,212,119,180,43,165,163,112,241,186,228,168,252,65,131,253,217,111,225,138,122,47,45,116,150,7,31,13,9,94,3,118,44,112,247,64,165,44,167,111,87,65,168,170,116,223,160,88,100,3,74,199,196,60,83,174,175,95,24,4,21,177,227,109,40,134,171,12,164,191,67,240,233,80,129,57,87,22,82,55,3,0,5,0,7,0,11,0,13,0,17,0,19,0,23,0,29,0,31,0,37,0,41,0,43,0,47,0,53,0,59,0,61,0,67,0,71,0,73,0,79,0,83,0,89,0,97,0,101,0,103,0,107,0,109,0,113,0,127,0,131,0,137,0,139,0,149,0,151,0,157,0,163,0,167,0,173,0,179,0,181,0,191,0,193,0,197,0,199,0,211,0,223,0,227,0,229,0,233,0,239,0,241,0,251,0,1,1,7,1,13,1,15,1,21,1,25,1,27,1,37,1,51,1,55,1,57,1,61,1,75,1,81,1,91,1,93,1,97,1,103,1,111,1,117,1,123,1,127,1,133,1,141,1,145,1,153,1,163,1,165,1,175,1,177,1,183,1,187,1,193,1,201,1,205,1,207,1,211,1,223,1,231,1,235,1,243,1,247,1,253,1,9,2,11,2,29,2,35,2,45,2,51,2,57,2,59,2,65,2,75,2,81,2,87,2,89,2,95,2,101,2,105,2,107,2,119,2,129,2,131,2,135,2,141,2,147,2,149,2,161,2,165,2,171,2,179,2,189,2,197,2,207,2,215,2,221,2,227,2,231,2,239,2,245,2,249,2,1,3,5,3,19,3,29,3,41,3,43,3,53,3,55,3,59,3,61,3,71,3,85,3,89,3,91,3,95,3,109,3,113,3,115,3,119,3,139,3,143,3,151,3,161,3,169,3,173,3,179,3,185,3,199,3,203,3,209,3,215,3,223,3,229,3,241,3,245,3,251,3,253,3,7,4,9,4,15,4,25,4,27,4,37,4,39,4,45,4,63,4,67,4,69,4,73,4,79,4,85,4,93,4,99,4,105,4,127,4,129,4,139,4,147,4,157,4,163,4,169,4,177,4,189,4,193,4,199,4,205,4,207,4,213,4,225,4,235,4,253,4,255,4,3,5,9,5,11,5,17,5,21,5,23,5,27,5,39,5,41,5,47,5,81,5,87,5,93,5,101,5,119,5,129,5,143,5,147,5,149,5,153,5,159,5,167,5,171,5,173,5,179,5,191,5,201,5,203,5,207,5,209,5,213,5,219,5,231,5,243,5,251,5,7,6,13,6,17,6,23,6,31,6,35,6,43,6,47,6,61,6,65,6,71,6,73,6,77,6,83,6,85,6,91,6,101,6,121,6,127,6,131,6,133,6,157,6,161,6,163,6,173,6,185,6,187,6,197,6,205,6,211,6,217,6,223,6,241,6,247,6,251,6,253,6,9,7,19,7,31,7,39,7,55,7,69,7,75,7,79,7,81,7,85,7,87,7,97,7,109,7,115,7,121,7,139,7,141,7,157,7,159,7,181,7,187,7,195,7,201,7,205,7,207,7,211,7,219,7,225,7,235,7,237,7,247,7,5,8,15,8,21,8,33,8,35,8,39,8,41,8,51,8,63,8,65,8,81,8,83,8,89,8,93,8,95,8,105,8,113,8,131,8,155,8,159,8,165,8,173,8,189,8,191,8,195,8,203,8,219,8,221,8,225,8,233,8,239,8,245,8,249,8,5,9,7,9,29,9,35,9,37,9,43,9,47,9,53,9,67,9,73,9,77,9,79,9,85,9,89,9,95,9,107,9,113,9,119,9,133,9,137,9,143,9,155,9,163,9,169,9,173,9,199,9,217,9,227,9,235,9,239,9,245,9,247,9,253,9,19,10,31,10,33,10,49,10,57,10,61,10,73,10,87,10,97,10,99,10,103,10,111,10,117,10,123,10,127,10,129,10,133,10,139,10,147,10,151,10,153,10,159,10,169,10,171,10,181,10,189,10,193,10,207,10,217,10,229,10,231,10,237,10,241,10,243,10,3,11,17,11,21,11,27,11,35,11,41,11,45,11,63,11,71,11,81,11,87,11,93,11,101,11,111,11,123,11,137,11,141,11,147,11,153,11,155,11,183,11,185,11,195,11,203,11,207,11,221,11,225,11,233,11,245,11,251,11,7,12,11,12,17,12,37,12,47,12,49,12,65,12,91,12,95,12,97,12,109,12,115,12,119,12,131,12,137,12,145,12,149,12,157,12,179,12,181,12,185,12,187,12,199,12,227,12,229,12,235,12,241,12,247,12,251,12,1,13,3,13,15,13,19,13,31,13,33,13,43,13,45,13,61,13,63,13,79,13,85,13,105,13,121,13,129,13,133,13,135,13,139,13,141,13,163,13,171,13,183,13,189,13,199,13,201,13,205,13,211,13,213,13,219,13,229,13,231,13,243,13,253,13,255,13,9,14,23,14,29,14,33,14,39,14,47,14,53,14,59,14,75,14,87,14,89,14,93,14,107,14,113,14,117,14,125,14,135,14,143,14,149,14,155,14,177,14,183,14,185,14,195,14,209,14,213,14,219,14,237,14,239,14,249,14,7,15,11,15,13,15,23,15,37,15,41,15,49,15,67,15,71,15,77,15,79,15,83,15,89,15,91,15,103,15,107,15,127,15,149,15,161,15,163,15,167,15,173,15,179,15,181,15,187,15,209,15,211,15,217,15,233,15,239,15,251,15,253,15,3,16,15,16,31,16,33,16,37,16,43,16,57,16,61,16,63,16,81,16,105,16,115,16,121,16,123,16,133,16,135,16,145,16,147,16,157,16,163,16,165,16,175,16,177,16,187,16,193,16,201,16,231,16,241,16,243,16,253,16,5,17,11,17,21,17,39,17,45,17,57,17,69,17,71,17,89,17,95,17,99,17,105,17,111,17,129,17,131,17,141,17,155,17,161,17,165,17,167,17,171,17,195,17,197,17,209,17,215,17,231,17,239,17,245,17,251,17,13,18,29,18,31,18,35,18,41,18,43,18,49,18,55,18,65,18,71,18,83,18,95,18,113,18,115,18,121,18,125,18,143,18,151,18,175,18,179,18,181,18,185,18,191,18,193,18,205,18,209,18,223,18,253,18,7,19,13,19,25,19,39,19,45,19,55,19,67,19,69,19,73,19,79,19,87,19,93,19,103,19,105,19,109,19,123,19,129,19,135,19,0,0,0,0,194,1,132,3,70,2,8,7,202,6,140,4,78,5,16,14,210,15,148,13,86,12,24,9,218,8,156,10,94,11,32,28,226,29,164,31,102,30,40,27,234,26,172,24,110,25,48,18,242,19,180,17,118,16,56,21,250,20,188,22,126,23,64,56,130,57,196,59,6,58,72,63,138,62,204,60,14,61,80,54,146,55,212,53,22,52,88,49,154,48,220,50,30,51,96,36,162,37,228,39,38,38,104,35,170,34,236,32,46,33,112,42,178,43,244,41,54,40,120,45,186,44,252,46,62,47,128,112,66,113,4,115,198,114,136,119,74,118,12,116,206,117,144,126,82,127,20,125,214,124,152,121,90,120,28,122,222,123,160,108,98,109,36,111,230,110,168,107,106,106,44,104,238,105,176,98,114,99,52,97,246,96,184,101,122,100,60,102,254,103,192,72,2,73,68,75,134,74,200,79,10,78,76,76,142,77,208,70,18,71,84,69,150,68,216,65,26,64,92,66,158,67,224,84,34,85,100,87,166,86,232,83,42,82,108,80,174,81,240,90,50,91,116,89,182,88,248,93,58,92,124,94,190,95,0,225,194,224,132,226,70,227,8,230,202,231,140,229,78,228,16,239,210,238,148,236,86,237,24,232,218,233,156,235,94,234,32,253,226,252,164,254,102,255,40,250,234,251,172,249,110,248,48,243,242,242,180,240,118,241,56,244,250,245,188,247,126,246,64,217,130,216,196,218,6,219,72,222,138,223,204,221,14,220,80,215,146,214,212,212,22,213,88,208,154,209,220,211,30,210,96,197,162,196,228,198,38,199,104,194,170,195,236,193,46,192,112,203,178,202,244,200,54,201,120,204,186,205,252,207,62,206,128,145,66,144,4,146,198,147,136,150,74,151,12,149,206,148,144,159,82,158,20,156,214,157,152,152,90,153,28,155,222,154,160,141,98,140,36,142,230,143,168,138,106,139,44,137,238,136,176,131,114,130,52,128,246,129,184,132,122,133,60,135,254,134,192,169,2,168,68,170,134,171,200,174,10,175,76,173,142,172,208,167,18,166,84,164,150,165,216,160,26,161,92,163,158,162,224,181,34,180,100,182,166,183,232,178,42,179,108,177,174,176,240,187,50,186,116,184,182,185,248,188,58,189,124,191,190,190,73,0,49,1,83,0,127,1,48,1,105,0,120,1,255,0,129,1,83,2,130,1,131,1,132,1,133,1,134,1,84,2,135,1,136,1,137,1,86,2,138,1,87,2,139,1,140,1,142,1,221,1,143,1,89,2,144,1,91,2,145,1,146,1,147,1,96,2,148,1,99,2,150,1,105,2,151,1,104,2,152,1,153,1,156,1,111,2,157,1,114,2,159,1,117,2,166,1,128,2,167,1,168,1,169,1,131,2,172,1,173,1,174,1,136,2,175,1,176,1,177,1,138,2,178,1,139,2,183,1,146,2,184,1,185,1,188,1,189,1,196,1,198,1,196,1,197,1,197,1,198,1,199,1,201,1,199,1,200,1,200,1,201,1,202,1,204,1,202,1,203,1,203,1,204,1,241,1,243,1,241,1,242,1,242,1,243,1,244,1,245,1,246,1,149,1,247,1,191,1,32,2,158,1,134,3,172,3,136,3,173,3,137,3,174,3,138,3,175,3,140,3,204,3,142,3,205,3,143,3,206,3,153,3,69,3,153,3,190,31,163,3,194,3,247,3,248,3,250,3,251,3,96,30,155,30,158,30,223,0,89,31,81,31,91,31,83,31,93,31,85,31,95,31,87,31,188,31,179,31,204,31,195,31,236,31,229,31,252,31,243,31,58,2,101,44,59,2,60,2,61,2,154,1,62,2,102,44,65,2,66,2,67,2,128,1,68,2,137,2,69,2,140,2,244,3,184,3,249,3,242,3,253,3,123,3,254,3,124,3,255,3,125,3,192,4,207,4,38,33,201,3,42,33,107,0,43,33,229,0,50,33,78,33,131,33,132,33,96,44,97,44,98,44,107,2,99,44,125,29,100,44,125,2,109,44,81,2,110,44,113,2,111,44,80,2,112,44,82,2,114,44,115,44,117,44,118,44,126,44,63,2,127,44,64,2,242,44,243,44,125,167,121,29,139,167,140,167,141,167,101,2,170,167,102,2,199,16,39,45,205,16,45,45,118,3,119,3,156,3,181,0,146,3,208,3,152,3,209,3,166,3,213,3,160,3,214,3,154,3,240,3,161,3,241,3,149,3,245,3,207,3,215,3,0,0,0,0,65,0,32,26,192,0,32,31,0,1,1,47,50,1,1,5,57,1,1,15,74,1,1,45,121,1,1,5,112,3,1,3,145,3,32,17,163,3,32,9,0,4,80,16,16,4,32,32,96,4,1,33,138,4,1,53,193,4,1,13,208,4,1,63,20,5,1,19,49,5,48,38,160,1,1,5,179,1,1,3,205,1,1,15,222,1,1,17,248,1,1,39,34,2,1,17,216,3,1,23,0,30,1,149,160,30,1,95,8,31,248,8,24,31,248,6,40,31,248,8,56,31,248,8,72,31,248,6,104,31,248,8,136,31,248,8,152,31,248,8,168,31,248,8,184,31,248,2,186,31,182,2,200,31,170,4,216,31,248,2,218,31,156,2,232,31,248,2,234,31,144,2,248,31,128,2,250,31,130,2,70,2,1,9,16,5,1,3,96,33,16,16,0,44,48,47,103,44,1,5,128,44,1,99,235,44,1,3,64,166,1,45,128,166,1,23,34,167,1,13,50,167,1,61,121,167,1,3,126,167,1,9,144,167,1,3,160,167,1,9,33,255,32,26,0,0,0,0,119,114,97,112,46,99,0,99,111,109,109,111,110,95,97,108,108,111,99,97,116,105,111,110,46,99,0,71,78,85,78,69,84,95,120,109,97,108,108,111,99,95,0,109,97,108,108,111,99,0,71,78,85,78,69,84,95,120,102,114,101,101,95,0,71,78,85,78,69,84,95,115,110,112,114,105,110,116,102,0,99,111,109,109,111,110,95,108,111,103,103,105,110,103,46,99,0,37,115,45,37,100,0,109,121,108,111,103,0,108,111,99,97,108,116,105,109,101,32,101,114,114,111,114,0,37,98,32,37,100,32,37,72,58,37,77,58,37,83,45,37,37,48,54,117,0,42,32,37,115,0,37,115,32,37,115,32,37,115,32,37,115,0,69,82,82,79,82,0,87,65,82,78,73,78,71,0,77,69,83,83,65,71,69,0,73,78,70,79,0,68,69,66,85,71,0,78,79,78,69,0,73,78,86,65,76,73,68,0,77,101,115,115,97,103,101,32,96,37,46,42,115,39,32,114,101,112,101,97,116,101,100,32,37,117,32,116,105,109,101,115,32,105,110,32,116,104,101,32,108,97,115,116,32,37,115,10,0,71,78,85,78,69,84,95,108,111,103,95,115,107,105,112,0,99,114,121,112,116,111,95,115,121,109,109,101,116,114,105,99,46,99,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,115,121,109,109,101,116,114,105,99,95,101,110,99,114,121,112,116,0,115,101,116,117,112,95,99,105,112,104,101,114,95,116,119,111,102,105,115,104,0,115,101,116,117,112,95,99,105,112,104,101,114,95,97,101,115,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,115,121,109,109,101,116,114,105,99,95,100,101,99,114,121,112,116,0,99,114,121,112,116,111,95,101,99,99,46,99,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,99,100,115,97,95,107,101,121,95,103,101,116,95,112,117,98,108,105,99,0,113,64,101,100,100,115,97,0,40,112,114,105,118,97,116,101,45,107,101,121,40,101,99,99,40,99,117,114,118,101,32,34,69,100,50,53,53,49,57,34,41,40,100,32,37,98,41,41,41,0,100,101,99,111,100,101,95,112,114,105,118,97,116,101,95,101,99,100,115,97,95,107,101,121,0,103,99,114,121,95,115,101,120,112,95,98,117,105,108,100,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,100,100,115,97,95,107,101,121,95,103,101,116,95,112,117,98,108,105,99,0,40,112,114,105,118,97,116,101,45,107,101,121,40,101,99,99,40,99,117,114,118,101,32,34,69,100,50,53,53,49,57,34,41,40,102,108,97,103,115,32,101,100,100,115,97,41,40,100,32,37,98,41,41,41,0,100,101,99,111,100,101,95,112,114,105,118,97,116,101,95,101,100,100,115,97,95,107,101,121,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,99,100,104,101,95,107,101,121,95,103,101,116,95,112,117,98,108,105,99,0,100,101,99,111,100,101,95,112,114,105,118,97,116,101,95,101,99,100,104,101,95,107,101,121,0,40,103,101,110,107,101,121,40,101,99,99,40,99,117,114,118,101,32,34,69,100,50,53,53,49,57,34,41,40,102,108,97,103,115,32,101,100,100,115,97,32,110,111,45,107,101,121,116,101,115,116,41,41,41,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,99,100,104,101,95,107,101,121,95,99,114,101,97,116,101,0,103,99,114,121,95,112,107,95,103,101,110,107,101,121,0,107,101,121,95,102,114,111,109,95,115,101,120,112,0,40,103,101,110,107,101,121,40,101,99,99,40,99,117,114,118,101,32,34,69,100,50,53,53,49,57,34,41,40,102,108,97,103,115,41,41,41,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,99,100,115,97,95,107,101,121,95,99,114,101,97,116,101,0,40,103,101,110,107,101,121,40,101,99,99,40,99,117,114,118,101,32,34,69,100,50,53,53,49,57,34,41,40,102,108,97,103,115,32,101,100,100,115,97,41,41,41,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,100,100,115,97,95,107,101,121,95,99,114,101,97,116,101,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,100,100,115,97,95,115,105,103,110,0,69,100,68,83,65,32,115,105,103,110,105,110,103,32,102,97,105,108,101,100,32,97,116,32,37,115,58,37,100,58,32,37,115,10,0,40,100,97,116,97,40,102,108,97,103,115,32,101,100,100,115,97,41,40,104,97,115,104,45,97,108,103,111,32,37,115,41,40,118,97,108,117,101,32,37,98,41,41,0,100,97,116,97,95,116,111,95,101,100,100,115,97,95,118,97,108,117,101,0,40,112,117,98,108,105,99,45,107,101,121,40,101,99,99,40,99,117,114,118,101,32,69,100,50,53,53,49,57,41,40,113,32,37,98,41,41,41,0,40,115,105,103,45,118,97,108,40,101,100,100,115,97,40,114,32,37,98,41,40,115,32,37,98,41,41,41,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,100,100,115,97,95,118,101,114,105,102,121,0,40,112,117,98,108,105,99,45,107,101,121,40,101,99,99,40,99,117,114,118,101,32,69,100,50,53,53,49,57,41,40,102,108,97,103,115,32,101,100,100,115,97,41,40,113,32,37,98,41,41,41,0,69,100,68,83,65,32,115,105,103,110,97,116,117,114,101,32,118,101,114,105,102,105,99,97,116,105,111,110,32,102,97,105,108,101,100,32,97,116,32,37,115,58,37,100,58,32,37,115,10,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,99,99,95,101,99,100,104,0,103,101,116,95,97,102,102,105,110,101,32,102,97,105,108,101,100,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,99,100,104,95,101,100,100,115,97,0,99,114,121,112,116,111,95,104,97,115,104,46,99,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,104,97,115,104,95,99,111,110,116,101,120,116,95,115,116,97,114,116,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,104,97,115,104,95,99,111,110,116,101,120,116,95,102,105,110,105,115,104,0,99,114,121,112,116,111,95,107,100,102,46,99,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,107,100,102,95,109,111,100,95,109,112,105,0,99,114,121],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+10240);allocate([112,116,111,95,109,112,105,46,99,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,109,112,105,95,112,114,105,110,116,95,117,110,115,105,103,110,101,100,0,96,37,115,39,32,102,97,105,108,101,100,32,97,116,32,37,115,58,37,100,32,119,105,116,104,32,101,114,114,111,114,58,32,37,115,10,0,103,99,114,121,95,109,112,105,95,112,114,105,110,116,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,109,112,105,95,115,99,97,110,95,117,110,115,105,103,110,101,100,0,103,99,114,121,95,109,112,105,95,115,99,97,110,0,49,46,54,46,48,0,108,105,98,103,99,114,121,112,116,32,104,97,115,32,110,111,116,32,116,104,101,32,101,120,112,101,99,116,101,100,32,118,101,114,115,105,111,110,32,40,118,101,114,115,105,111,110,32,37,115,32,105,115,32,114,101,113,117,105,114,101,100,41,46,10,0,99,114,121,112,116,111,95,114,97,110,100,111,109,46,99,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,97,110,100,111,109,95,105,110,105,116,0,70,97,105,108,101,100,32,116,111,32,115,101,116,32,108,105,98,103,99,114,121,112,116,32,111,112,116,105,111,110,32,37,115,58,32,37,115,10,0,68,73,83,65,66,76,69,95,83,69,67,77,69,77,0,69,78,65,66,76,69,95,81,85,73,67,75,95,82,65,78,68,79,77,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,97,110,100,111,109,95,117,51,50,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,97,110,100,111,109,95,98,108,111,99,107,0,40,103,101,110,107,101,121,40,114,115,97,40,110,98,105,116,115,32,37,100,41,41,41,0,99,114,121,112,116,111,95,114,115,97,46,99,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,112,114,105,118,97,116,101,95,107,101,121,95,99,114,101,97,116,101,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,112,114,105,118,97,116,101,95,107,101,121,95,101,110,99,111,100,101,0,117,116,105,108,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,112,114,105,118,97,116,101,95,107,101,121,95,100,101,99,111,100,101,0,68,101,99,111,100,101,100,32,112,114,105,118,97,116,101,32,107,101,121,32,105,115,32,110,111,116,32,118,97,108,105,100,10,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,112,114,105,118,97,116,101,95,107,101,121,95,103,101,116,95,112,117,98,108,105,99,0,69,120,116,101,114,110,97,108,32,112,114,111,116,111,99,111,108,32,118,105,111,108,97,116,105,111,110,32,100,101,116,101,99,116,101,100,32,97,116,32,37,115,58,37,100,46,10,0,40,112,117,98,108,105,99,45,107,101,121,40,114,115,97,40,110,32,37,109,41,40,101,32,37,109,41,41,41,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,112,117,98,108,105,99,95,107,101,121,95,101,110,99,111,100,101,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,112,117,98,108,105,99,95,107,101,121,95,100,101,99,111,100,101,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,115,105,103,110,97,116,117,114,101,95,101,110,99,111,100,101,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,98,108,105,110,100,0,110,117,109,101,114,105,99,95,109,112,105,95,97,108,108,111,99,95,110,95,112,114,105,110,116,0,66,108,105,110,100,105,110,103,32,75,68,70,32,101,120,116,114,97,116,111,114,32,72,77,65,67,32,107,101,121,0,114,115,97,95,98,108,105,110,100,105,110,103,95,107,101,121,95,100,101,114,105,118,101,0,66,108,105,110,100,105,110,103,32,75,68,70,0,114,115,97,95,102,117,108,108,95,100,111,109,97,105,110,95,104,97,115,104,0,82,83,65,45,70,68,65,32,70,84,112,115,87,33,0,40,100,97,116,97,32,40,102,108,97,103,115,32,114,97,119,41,32,40,118,97,108,117,101,32,37,77,41,41,0,109,112,105,95,116,111,95,115,101,120,112,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,115,105,103,110,97,116,117,114,101,95,100,101,99,111,100,101,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,117,110,98,108,105,110,100,0,40,115,105,103,45,118,97,108,32,40,114,115,97,32,40,115,32,37,77,41,41,41,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,118,101,114,105,102,121,0,82,83,65,32,115,105,103,110,97,116,117,114,101,32,118,101,114,105,102,105,99,97,116,105,111,110,32,102,97,105,108,101,100,32,97,116,32,37,115,58,37,100,58,32,37,115,10,0,115,116,114,105,110,103,115,46,99,0,37,108,108,117,32,37,115,0,102,111,114,101,118,101,114,0,109,115,0,109,0,100,97,121,0,100,97,121,115,0,194,181,115,0,48,32,109,115,0,71,78,85,78,69,84,95,83,84,82,73,78,71,83,95,100,97,116,97,95,116,111,95,115,116,114,105,110,103,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,71,72,74,75,77,78,80,81,82,83,84,86,87,88,89,90,0,71,78,85,78,69,84,95,83,84,82,73,78,71,83,95,115,116,114,105,110,103,95,116,111,95,100,97,116,97,0,118,105,115,105,98,105,108,105,116,121,46,99,0,103,99,114,121,95,109,100,95,104,97,115,104,95,98,117,102,102,101,114,0,99,97,108,108,101,100,32,105,110,32,110,111,110,45,111,112,101,114,97,116,105,111,110,97,108,32,115,116,97,116,101,0,103,99,114,121,95,109,100,95,103,101,116,95,97,108,103,111,0,117,115,101,100,32,105,110,32,110,111,110,45,111,112,101,114,97,116,105,111,110,97,108,32,115,116,97,116,101,0,103,99,114,121,95,114,97,110,100,111,109,105,122,101,0,103,99,114,121,95,99,114,101,97,116,101,95,110,111,110,99,101,0,109,105,115,99,46,99,0,95,103,99,114,121,95,102,97,116,97,108,95,101,114,114,111,114,0,10,70,97,116,97,108,32,101,114,114,111,114,58,32,0,70,97,116,97,108,58,32,0,79,104,104,104,104,32,106,101,101,101,101,58,32,0,68,66,71,58,32,0,91,85,110,107,110,111,119,110,32,108,111,103,32,108,101,118,101,108,32,37,100,93,58,32,0,95,103,99,114,121,95,108,111,103,118,0,105,110,116,101,114,110,97,108,32,101,114,114,111,114,32,40,102,97,116,97,108,32,111,114,32,98,117,103,41,0,46,46,46,32,116,104,105,115,32,105,115,32,97,32,98,117,103,32,40,37,115,58,37,100,58,37,115,41,10,0,65,115,115,101,114,116,105,111,110,32,96,37,115,39,32,102,97,105,108,101,100,32,40,37,115,58,37,100,58,37,115,41,10,0,32,0,37,115,58,37,115,0,37,42,115,32,32,0,37,48,50,120,0,32,92,10,0,37,42,115,32,37,42,115,0,32,40,110,117,108,108,41,0,32,91,37,117,32,98,105,116,93,0,32,91,111,117,116,32,111,102,32,99,111,114,101,93,0,45,0,43,0,100,105,118,105,100,101,32,98,121,32,122,101,114,111,0,103,108,111,98,97,108,46,99,0,103,108,111,98,97,108,95,105,110,105,116,0,49,46,55,46,48,45,98,101,116,97,50,51,48,0,118,101,114,115,105,111,110,58,37,115,58,10,0,99,105,112,104,101,114,115,58,37,115,58,10,0,97,101,115,58,116,119,111,102,105,115,104,0,112,117,98,107,101,121,115,58,37,115,58,10,0,114,115,97,58,101,99,99,0,100,105,103,101,115,116,115,58,37,115,58,10,0,115,104,97,50,53,54,58,115,104,97,53,49,50,0,114,110,100,45,109,111,100,58,108,105,110,117,120,58,10,0,99,112,117,45,97,114,99,104,58,58,10,0,109,112,105,45,97,115,109,58,37,115,58,10,0,104,119,102,108,105,115,116,58,0,37,115,58,0,10,0,102,105,112,115,45,109,111,100,101,58,37,99,58,37,99,58,10,0,112,114,105,110,116,95,99,111,110,102,105,103,0,115,121,115,116,101,109,0,102,105,112,115,0,115,116,97,110,100,97,114,100,0,114,110,103,45,116,121,112,101,58,37,115,58,37,100,58,10,0,111,117,116,32,111,102,32,99,111,114,101,32,105,110,32,115,101,99,117,114,101,32,109,101,109,111,114,121,0,92,120,37,48,50,120,0,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,48,49,50,51,52,53,54,55,56,57,45,46,47,95,58,42,43,61,0,115,101,120,112,46,99,0,100,111,95,118,115,101,120,112,95,115,115,99,97,110,0,37,100,0,37,117,0,38,92,0,95,103,99,114,121,95,115,101,120,112,95,102,105,110,100,95,116,111,107,101,110,0,95,103,99,114,121,95,115,101,120,112,95,110,116,104,0,3,4,0,8,9,11,10,12,13,34,39,92,0,45,46,47,95,58,42,43,61,0,37,48,50,88,0,37,117,58,0,95,103,99,114,121,95,115,101,120,112,95,115,112,114,105,110,116,0,112,97,100,108,111,99,107,45,114,110,103,0,112,97,100,108,111,99,107,45,97,101,115,0,112,97,100,108,111,99,107,45,115,104,97,0,112,97,100,108,111,99,107,45,109,109,117,108,0,105,110,116,101,108,45,99,112,117,0,105,110,116,101,108,45,98,109,105,50,0,105,110,116,101,108,45,115,115,115,101,51,0,105,110,116,101,108,45,112,99,108,109,117,108,0,105,110,116,101,108,45,97,101,115,110,105,0,105,110,116,101,108,45,114,100,114,97,110,100,0,105,110,116,101,108,45,97,118,120,0,105,110,116,101,108,45,97,118,120,50,0,97,114,109,45,110,101,111,110,0,47,101,116,99,47,103,99,114,121,112,116,47,104,119,102,46,100,101,110,121,0,109,101,109,111,114,121,32,97,116,32,37,112,32,99,111,114,114,117,112,116,101,100,32,40,117,110,100,101,114,102,108,111,119,61,37,48,50,120,41,10,0,109,101,109,111,114,121,32,97,116,32,37,112,32,99,111,114,114,117,112,116,101,100,32,40,111,118,101,114,102,108,111,119,61,37,48,50,120,41,10,0,102,97,105,108,101,100,32,116,111,32,100,114,111,112,32,115,101,116,117,105,100,10,0,115,101,99,117,114,101,32,109,101,109,111,114,121,32,105,115,32,100,105,115,97,98,108,101,100,0,99,97,110,39,116,32,109,109,97,112,32,112,111,111,108,32,111,102,32,37,117,32,98,121,116,101,115,58,32,37,115,32,45,32,117,115,105,110,103,32,109,97,108,108,111,99,10,0,99,97,110,39,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,112,111,111,108,32,111,102,32,37,117,32,98,121,116,101,115,10,0,80,108,101,97,115,101,32,110,111,116,101,32,116,104,97,116,32,121,111,117,32,100,111,110,39,116,32,104,97,118,101,32,115,101,99,117,114,101,32,109,101,109,111,114,121,32,111,110,32,116,104,105,115,32,115,121,115,116,101,109,10,0,79,111,112,115,44,32,115,101,99,117,114,101,32,109,101,109,111,114,121,32,112,111,111,108,32,97,108,114,101,97,100,121,32,105,110,105,116,105,97,108,105,122,101,100,10,0,111,112,101,114,97,116,105,111,110,32,105,115,32,110,111,116,32,112,111,115,115,105,98,108,101,32,119,105,116,104,111,117,116,32,105,110,105,116,105,97,108,105,122,101,100,32,115,101,99,117,114,101,32,109,101,109,111,114,121,10,0,115,101,99,109,101,109,32,117,115,97,103,101,58,32,37,117,47,37,108,117,32,98,121,116,101,115,32,105,110,32,37,117,32,98,108,111,99,107,115,10,0,33,100,111,110,101,0,102,105,112,115,46,99,0,95,103,99,114,121,95,105,110,105,116,105,97,108,105,122,101,95,102,105,112,115,95,109,111,100,101,0,33,110,111,95,102,105,112,115,95,109,111,100,101,95,114,101,113,117,105,114,101,100,0,47,101,116,99,47,103,99,114,121,112,116,47,102,105,112,115,95,101,110,97,98,108,101,100,0,47,112,114,111,99,47,115,121,115,47,99,114,121,112,116,111,47,102,105,112,115,95,101,110,97,98,108,101,100,0,114,0,47,112,114,111,99,47,118,101,114,115,105,111,110,0,70,65,84,65,76,58,32,101,114,114,111,114,32,114,101,97,100,105,110,103,32,96,37,115,39,32,105,110,32,108,105,98,103,99,114,121,112,116,58,32,37,115,10,0,70,65,84,65,76,58,32,102,97,105,108,101,100,32,116,111,32,99,114,101,97,116,101,32,116,104,101,32,70,83,77,32,108,111,99,107,32,105,110,32,108,105,98,103,99,114,121,112,116,58,32,37,115,10,0,70,65,84,65,76,58,32,102,97,105,108,101,100,32,116,111,32,97,99,113,117,105,114,101,32,116,104,101,32,70,83,77,32,108,111,99,107,32,105,110,32,108,105,98,103,114,121,112,116,58,32,37,115,10,0,70,65,84,65,76,58,32,102,97,105,108,101,100,32,116,111,32,114,101,108,101,97,115,101,32,116,104,101,32,70,83,77,32,108,111,99,107,32,105,110,32,108,105,98,103,114,121,112,116,58,32,37,115,10,0,83,104,117,116,100,111,119,110,0,70,97,116,97,108,45,69,114,114,111,114,0,69,114,114,111,114,0,79,112,101,114,97,116,105,111,110,97,108,0,83,101,108,102,45,84,101,115,116,0,73,110,105,116,0,80,111,119,101,114,45,79,110,0,103,114,97,110,116,101,100,0,100,101,110,105,101,100,0,108,105,98,103,99,114,121,112,116,32,115,116,97,116,101,32,116,114,97,110,115,105,116,105,111,110,32,37,115,32,61,62,32,37,115,32,37,115,10,0,95,103,99,114,121,95,102,105,112,115,95,109,111,100,101,32,40,41,0,95,103,99,114,121,95,105,110,97,99,116,105,118,97,116,101,95,102,105,112,115,95,109,111,100,101,0,110,111,32,100,101,115,99,114,105,112,116,105,111,110,32,97,118,97,105,108,97,98,108,101,0,37,115,101,114,114,111,114,32,105,110,32,108,105,98,103,99,114,121,112,116,44,32,102,105,108,101,32,37,115,44,32,108,105,110,101,32,37,100,37,115,37,115,58,32,37,115,10,0,44,32,102,117,110,99,116,105,111,110,32,0,102,97,116,97,108,32,0,72,77,65,67,45,0,79,107,97,121,0,32,40,0,108,105,98,103,99,114,121,112,116,32,115,101,108,102,116,101,115,116,58,32,37,115,32,37,115,37,115,32,40,37,100,41,58,32,37,115,37,115,37,115,37,115,10,0,98,97,100,32,99,111,110,116,101,120,116,32,116,121,112,101,32,37,100,32,103,105,118,101,110,32,116,111,32,95,103,99,114,121,95,99,116,120,95,97,108,108,111,99,10,0,99,84,120,0,98,97,100,32,112,111,105,110,116,101,114,32,37,112,32,112,97,115,115,101,100,32,116,111,32,95,103,99,114,121,95,99,116,120,95,103,101,116,95,112,111,105,110,116,101,114,10,0,119,114,111,110,103,32,99,111,110,116,101,120,116,32,116,121,112,101,32,37,100,32,114,101,113,117,101,115,116,32,102,111,114,32,99,111,110,116,101,120,116,32,37,112,32,111,102,32,116,121,112,101,32,37,100,10,0,98,97,100,32,112,111,105,110,116,101,114,32,37,112,32,112,97,115,115,101,100,32,116,111,32,103,99,114,121,95,99,116,120,95,114,101,108,97,115,101,10,0,98,97,100,32,99,111,110,116,101,120,116,32,116,121,112,101,32,37,100,32,100,101,116,101,99,116,101,100,32,105,110,32,103,99,114,121,95,99,116,120,95,114,101,108,97,115,101,10,0,103,99,114,121,95,99,105,112,104,101,114,95,99,108,111,115,101,58,32,97,108,114,101,97,100,121,32,99,108,111,115,101,100,47,105,110,118,97,108,105,100,32,104,97,110,100,108,101,0,99,105,112,104,101,114,46,99,0,99,105,112,104,101,114,95,101,110,99,114,121,112,116,0,99,105,112,104,101,114,32,109,111,100,101,32,78,79,78,69,32,117,115,101,100,0,99,105,112,104,101,114,95,101,110,99,114,121,112,116,58,32,105,110,118,97,108,105,100,32,109,111,100,101,32,37,100,10,0,99,105,112,104,101,114,95,100,101,99,114,121,112,116,0,99,105,112,104,101,114,95,100,101,99,114,121,112,116,58,32,105,110,118,97,108,105,100,32,109,111,100,101,32,37,100,10,0,87,65,82,78,73,78,71,58,32,99,105,112,104,101,114,95,115,101,116,105,118,58,32,105,118,108,101,110,61,37,117,32,98,108,107,108,101,110,61,37,117,10,0,99,105,112,104,101,114,95,115,101,116,105,118,0,73,86,32,108,101,110,103,116,104,32,100,111,101,115,32,110,111,116,32,109,97,116,99,104,32,98,108,111,99,107,108,101,110,103,116,104,0,49,46,51,46,54,46,49,46,52,46,49,46,49,49,53,57,49,46,49,53,46,49,0,78,73,83,84,32,80,45,49,57,50,0,49,46,50,46,56,52,48,46,49,48,48,52,53,46,51,46,49,46,49,0,112,114,105,109,101,49,57,50,118,49,0,115,101,99,112,49,57,50,114,49,0,110,105,115,116,112,49,57,50,0,78,73,83,84,32,80,45,50,50,52,0,115,101,99,112,50,50,52,114,49,0,49,46,51,46,49,51,50,46,48,46,51,51,0,110,105,115,116,112,50,50,52,0,78,73,83,84,32,80,45,50,53,54,0,49,46,50,46,56,52,48,46,49,48,48,52,53,46,51,46,49,46,55,0,112,114,105,109,101,50,53,54,118,49,0,115,101,99,112,50,53,54,114,49,0,110,105,115,116,112,50,53,54,0,78,73,83,84,32,80,45,51,56,52,0,115,101,99,112,51,56,52,114,49,0,49,46,51,46,49,51,50,46,48,46,51,52,0,110,105,115,116,112,51,56,52,0,78,73,83,84,32,80,45,53,50,49,0,115,101,99,112,53,50,49,114,49,0,49,46,51,46,49,51,50,46,48,46,51,53,0,110,105,115,116,112,53,50,49,0,98,114,97,105,110,112,111,111,108,80,49,54,48,114,49,0,49,46,51,46,51,54,46,51,46,51,46,50,46,56,46,49,46,49,46,49,0,98,114,97,105,110,112,111,111,108,80,49,57,50,114,49,0,49,46,51,46,51,54,46,51,46,51,46,50,46,56,46,49,46,49,46,51,0,98,114,97,105,110,112,111,111,108,80,50,50,52,114,49,0,49,46,51,46,51,54,46,51,46,51,46,50,46,56,46,49,46,49,46,53,0,98,114,97,105,110,112,111,111,108,80,50,53,54,114,49,0,49,46,51,46,51,54,46,51,46,51,46,50,46,56,46,49,46,49,46,55,0,98,114,97,105,110,112,111,111,108,80,51,50,48,114,49,0,49,46,51,46,51,54,46,51,46,51,46,50,46,56,46,49,46,49,46,57,0,98,114,97,105,110,112,111,111,108,80,51,56,52,114,49,0,49,46,51,46,51,54,46,51,46,51,46,50,46,56,46,49,46,49,46,49,49,0,98,114,97,105,110,112,111,111,108,80,53,49,50,114,49,0,49,46,51,46,51,54,46,51,46,51,46,50,46,56,46,49,46,49,46,49,51,0,71,79,83,84,50,48,48,49,45,116,101,115,116,0,49,46,50,46,54,52,51,46,50,46,50,46,51,53,46,48,0,71,79,83,84,50,48,48,49,45,67,114,121,112,116,111,80,114,111,45,65,0,49,46,50,46,54,52,51,46,50,46,50,46,51,53,46,49,0,71,79,83,84,50,48,48,49,45,67,114,121,112,116,111,80,114,111,45,66,0,49,46,50,46,54,52,51,46,50,46,50,46,51,53,46,50,0,71,79,83,84,50,48,48,49,45,67,114,121,112,116,111,80,114,111,45,67,0,49,46,50,46,54,52,51,46,50,46,50,46,51,53,46,51,0,71,79,83,84,50,48,48,49,45,67,114,121,112,116,111,80,114,111,45,88,99,104,65,0,71,79,83,84,50,48,48,49,45,67,114,121,112,116,111,80,114,111,45,88,99,104,66,0,49,46,50,46,54,52,51,46,50,46,50,46,51,54,46,48,0,49,46,50,46,54,52,51,46,50,46,50,46,51,54,46,49,0,71,79,83,84,50,48,49,50,45,116,99,50,54,45,65,0,49,46,50,46,54,52,51,46,55,46,49,46,50,46,49,46,50,46,49,0,71,79,83,84,50,48,49,50,45,116,99,50,54,45,66,0,49,46,50,46,54,52,51,46,55,46,49,46,50,46,49,46,50,46,50,0,115,101,99,112,50,53,54,107,49,0,49,46,51,46,49,51,50,46,48,46,49,48,0,48,120,55,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,69,68,0,45,48,120,48,49,0,45,48,120,50,68,70,67,57,51,49,49,68,52,57,48,48,49,56,67,55,51,51,56,66,70,56,54,56,56,56,54,49,55,54,55,70,70,56,70,70,53,66,50,66,69,66,69,50,55,53,52,56,65,49,52,66,50,51,53,69,67,65,54,56,55,52,65,0,48,120,49,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,49,52,68,69,70,57,68,69,65,50,70,55,57,67,68,54,53,56,49,50,54,51,49,65,53,67,70,53,68,51,69,68,0,48,120,50,49,54,57,51,54,68,51,67,68,54,69,53,51,70,69,67,48,65,52,69,50,51,49,70,68,68,54,68,67,53,67,54,57,50,67,67,55,54,48,57,53,50,53,65,55,66,50,67,57,53,54,50,68,54,48,56,70,50,53,68,53,49,65,0,48,120,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,53,56,0,48,120,48,56,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,101,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,101,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,99,0,48,120,54,52,50,49,48,53,49,57,101,53,57,99,56,48,101,55,48,102,97,55,101,57,97,98,55,50,50,52,51,48,52,57,102,101,98,56,100,101,101,99,99,49,52,54,98,57,98,49,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,57,57,100,101,102,56,51,54,49,52,54,98,99,57,98,49,98,52,100,50,50,56,51,49,0,48,120,49,56,56,100,97,56,48,101,98,48,51,48,57,48,102,54,55,99,98,102,50,48,101,98,52,51,97,49,56,56,48,48,102,52,102,102,48,97,102,100,56,50,102,102,49,48,49,50,0,48,120,48,55,49,57,50,98,57,53,102,102,99,56,100,97,55,56,54,51,49,48,49,49,101,100,54,98,50,52,99,100,100,53,55,51,102,57,55,55,97,49,49,101,55,57,52,56,49,49,0,48,120,48,49,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,49,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,101,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,101,0,48,120,98,52,48,53,48,97,56,53,48,99,48,52,98,51,97,98,102,53,52,49,51,50,53,54,53,48,52,52,98,48,98,55,100,55,98,102,100,56,98,97,50,55,48,98,51,57,52,51,50,51,53,53,102,102,98,52,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,49,54,97,50,101,48,98,56,102,48,51,101,49,51,100,100,50,57,52,53,53,99,53,99,50,97,51,100,0,48,120,98,55,48,101,48,99,98,100,54,98,98,52,98,102,55,102,51,50,49,51,57,48,98,57,52,97,48,51,99,49,100,51,53,54,99,50,49,49,50,50,51,52,51,50,56,48,100,54,49,49,53,99,49,100,50,49,0,48,120,98,100,51,55,54,51,56,56,98,53,102,55,50,51,102,98,52,99,50,50,100,102,101,54,99,100,52,51,55,53,97,48,53,97,48,55,52,55,54,52,52,52,100,53,56,49,57,57,56,53,48,48,55,101,51,52,0,48,120,102,102,102,102,102,102,102,102,48,48,48,48,48,48,48,49,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,0,48,120,102,102,102,102,102,102,102,102,48,48,48,48,48,48,48,49,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,99,0,48,120,53,97,99,54,51,53,100,56,97,97,51,97,57,51,101,55,98,51,101,98,98,100,53,53,55,54,57,56,56,54,98,99,54,53,49,100,48,54,98,48,99,99,53,51,98,48,102,54,51,98,99,101,51,99,51,101,50,55,100,50,54,48,52,98,0,48,120,102,102,102,102,102,102,102,102,48,48,48,48,48,48,48,48,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,98,99,101,54,102,97,97,100,97,55,49,55,57,101,56,52,102,51,98,57,99,97,99,50,102,99,54,51,50,53,53,49,0,48,120,54,98,49,55,100,49,102,50,101,49,50,99,52,50,52,55,102,56,98,99,101,54,101,53,54,51,97,52,52,48,102,50,55,55,48,51,55,100,56,49,50,100,101,98,51,51,97,48,102,52,97,49,51,57,52,53,100,56,57,56,99,50,57,54,0,48,120,52,102,101,51,52,50,101,50,102,101,49,97,55,102,57,98,56,101,101,55,101,98,52,97,55,99,48,102,57,101,49,54,50,98,99,101,51,51,53,55,54,98,51,49,53,101,99,101,99,98,98,54,52,48,54,56,51,55,98,102,53,49,102,53,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,101,102,102,102,102,102,102,102,102,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,102,102,102,102,102,102,102,102,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,101,102,102,102,102,102,102,102,102,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,102,102,102,102,102,102,102,99,0,48,120,98,51,51,49,50,102,97,55,101,50,51,101,101,55,101,52,57,56,56,101,48,53,54,98,101,51,102,56,50,100,49,57,49,56,49,100,57,99,54,101,102,101,56,49,52,49,49,50,48,51,49,52,48,56,56,102,53,48,49,51,56,55,53,97,99,54,53,54,51,57,56,100,56,97,50,101,100,49,57,100,50,97,56,53,99,56,101,100,100,51,101,99,50,97,101,102,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,99,55,54,51,52,100,56,49,102,52,51,55,50,100,100,102,53,56,49,97,48,100,98,50,52,56,98,48,97,55,55,97,101,99,101,99,49,57,54,97,99,99,99,53,50,57,55,51,0,48,120,97,97,56,55,99,97,50,50,98,101,56,98,48,53,51,55,56,101,98,49,99,55,49,101,102,51,50,48,97,100,55,52,54,101,49,100,51,98,54,50,56,98,97,55,57,98,57,56,53,57,102,55,52,49,101,48,56,50,53,52,50,97,51,56,53,53,48,50,102,50,53,100,98,102,53,53,50,57,54,99,51,97,53,52,53,101,51,56,55,50,55,54,48,97,98,55,0,48,120,51,54,49,55,100,101,52,97,57,54,50,54,50,99,54,102,53,100,57,101,57,56,98,102,57,50,57,50,100,99,50,57,102,56,102,52,49,100,98,100,50,56,57,97,49,52,55,99,101,57,100,97,51,49,49,51,98,53,102,48,98,56,99,48,48,97,54,48,98,49,99,101,49,100,55,101,56,49,57,100,55,97,52,51,49,100,55,99,57,48,101,97,48,101,53,102,0,48,120,48,49,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,0,48,120,48,49,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,99,0,48,120,48,53,49,57,53,51,101,98,57,54,49,56,101,49,99,57,97,49,102,57,50,57,97,50,49,97,48,98,54,56,53,52,48,101,101,97,50,100,97,55,50,53,98,57,57,98,51,49,53,102,51,98,56,98,52,56,57,57,49,56,101,102,49,48,57,101,49,53,54,49,57,51,57,53,49,101,99,55,101,57,51,55,98,49,54,53,50,99,48,98,100,51,98,98,49,98,102,48,55,51,53,55,51,100,102,56,56,51,100,50,99,51,52,102,49,101,102,52,53,49,102,100,52,54,98,53,48,51,102,48,48,0,48,120,49,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,97,53,49,56,54,56,55,56,51,98,102,50,102,57,54,54,98,55,102,99,99,48,49,52,56,102,55,48,57,97,53,100,48,51,98,98,53,99,57,98,56,56,57,57,99,52,55,97,101,98,98,54,102,98,55,49,101,57,49,51,56,54,52,48,57,0,48,120,48,48,99,54,56,53,56,101,48,54,98,55,48,52,48,52,101,57,99,100,57,101,51,101,99,98,54,54,50,51,57,53,98,52,52,50,57,99,54,52,56,49,51,57,48,53,51,102,98,53,50,49,102,56,50,56,97,102,54,48,54,98,52,100,51,100,98,97,97,49,52,98,53,101,55,55,101,102,101,55,53,57,50,56,102,101,49,100,99,49,50,55,97,50,102,102,97,56,100,101,51,51,52,56,98,51,99,49,56,53,54,97,52,50,57,98,102,57,55,101,55,101,51,49,99,50,101,53,98,100,54,54,0,48,120,48,49,49,56,51,57,50,57,54,97,55,56,57,97,51,98,99,48,48,52,53,99,56,97,53,102,98,52,50,99,55,100,49,98,100,57,57,56,102,53,52,52,52,57,53,55,57,98,52,52,54,56,49,55,97,102,98,100,49,55,50,55,51,101,54,54,50,99,57,55,101,101,55,50,57,57,53,101,102,52,50,54,52,48,99,53,53,48,98,57,48,49,51,102,97,100,48,55,54,49,51,53,51,99,55,48,56,54,97,50,55,50,99,50,52,48,56,56,98,101,57,52,55,54,57,102,100,49,54,54,53,48,0,48,120,101,57,53,101,52,97,53,102,55,51,55,48,53,57,100,99,54,48,100,102,99,55,97,100,57,53,98,51,100,56,49,51,57,53,49,53,54,50,48,102,0,48,120,51,52,48,101,55,98,101,50,97,50,56,48,101,98,55,52,101,50,98,101,54,49,98,97,100,97,55,52,53,100,57,55,101,56,102,55,99,51,48,48,0,48,120,49,101,53,56,57,97,56,53,57,53,52,50,51,52,49,50,49,51,52,102,97,97,50,100,98,100,101,99,57,53,99,56,100,56,54,55,53,101,53,56,0,48,120,101,57,53,101,52,97,53,102,55,51,55,48,53,57,100,99,54,48,100,102,53,57,57,49,100,52,53,48,50,57,52,48,57,101,54,48,102,99,48,57,0,48,120,98,101,100,53,97,102,49,54,101,97,51,102,54,97,52,102,54,50,57,51,56,99,52,54,51,49,101,98,53,97,102,55,98,100,98,99,100,98,99,51,0,48,120,49,54,54,55,99,98,52,55,55,97,49,97,56,101,99,51,51,56,102,57,52,55,52,49,54,54,57,99,57,55,54,51,49,54,100,97,54,51,50,49,0,48,120,99,51,48,50,102,52,49,100,57,51,50,97,51,54,99,100,97,55,97,51,52,54,51,48,57,51,100,49,56,100,98,55,56,102,99,101,52,55,54,100,101,49,97,56,54,50,57,55,0,48,120,54,97,57,49,49,55,52,48,55,54,98,49,101,48,101,49,57,99,51,57,99,48,51,49,102,101,56,54,56,53,99,49,99,97,101,48,52,48,101,53,99,54,57,97,50,56,101,102,0,48,120,52,54,57,97,50,56,101,102,55,99,50,56,99,99,97,51,100,99,55,50,49,100,48,52,52,102,52,52,57,54,98,99,99,97,55,101,102,52,49,52,54,102,98,102,50,53,99,57,0,48,120,99,51,48,50,102,52,49,100,57,51,50,97,51,54,99,100,97,55,97,51,52,54,50,102,57,101,57,101,57,49,54,98,53,98,101,56,102,49,48,50,57,97,99,52,97,99,99,49,0,48,120,99,48,97,48,54,52,55,101,97,97,98,54,97,52,56,55,53,51,98,48,51,51,99,53,54,99,98,48,102,48,57,48,48,97,50,102,53,99,52,56,53,51,51,55,53,102,100,54,0,48,120,49,52,98,54,57,48,56,54,54,97,98,100,53,98,98,56,56,98,53,102,52,56,50,56,99,49,52,57,48,48,48,50,101,54,55,55,51,102,97,50,102,97,50,57,57,98,56,102,0,48,120,100,55,99,49,51,52,97,97,50,54,52,51,54,54,56,54,50,97,49,56,51,48,50,53,55,53,100,49,100,55,56,55,98,48,57,102,48,55,53,55,57,55,100,97,56,57,102,53,55,101,99,56,99,48,102,102,0,48,120,54,56,97,53,101,54,50,99,97,57,99,101,54,99,49,99,50,57,57,56,48,51,97,54,99,49,53,51,48,98,53,49,52,101,49,56,50,97,100,56,98,48,48,52,50,97,53,57,99,97,100,50,57,102,52,51,0,48,120,50,53,56,48,102,54,51,99,99,102,101,52,52,49,51,56,56,55,48,55,49,51,98,49,97,57,50,51,54,57,101,51,51,101,50,49,51,53,100,50,54,54,100,98,98,51,55,50,51,56,54,99,52,48,48,98,0,48,120,100,55,99,49,51,52,97,97,50,54,52,51,54,54,56,54,50,97,49,56,51,48,50,53,55,53,100,48,102,98,57,56,100,49,49,54,98,99,52,98,54,100,100,101,98,99,97,51,97,53,97,55,57,51,57,102,0,48,120,48,100,57,48,50,57,97,100,50,99,55,101,53,99,102,52,51,52,48,56,50,51,98,50,97,56,55,100,99,54,56,99,57,101,52,99,101,51,49,55,52,99,49,101,54,101,102,100,101,101,49,50,99,48,55,100,0,48,120,53,56,97,97,53,54,102,55,55,50,99,48,55,50,54,102,50,52,99,54,98,56,57,101,52,101,99,100,97,99,50,52,51,53,52,98,57,101,57,57,99,97,97,51,102,54,100,51,55,54,49,52,48,50,99,100,0,48,120,97,57,102,98,53,55,100,98,97,49,101,101,97,57,98,99,51,101,54,54,48,97,57,48,57,100,56,51,56,100,55,50,54,101,51,98,102,54,50,51,100,53,50,54,50,48,50,56,50,48,49,51,52,56,49,100,49,102,54,101,53,51,55,55,0,48,120,55,100,53,97,48,57,55,53,102,99,50,99,51,48,53,55,101,101,102,54,55,53,51,48,52,49,55,97,102,102,101,55,102,98,56,48,53,53,99,49,50,54,100,99,53,99,54,99,101,57,52,97,52,98,52,52,102,51,51,48,98,53,100,57,0,48,120,50,54,100,99,53,99,54,99,101,57,52,97,52,98,52,52,102,51,51,48,98,53,100,57,98,98,100,55,55,99,98,102,57,53,56,52,49,54,50,57,53,99,102,55,101,49,99,101,54,98,99,99,100,99,49,56,102,102,56,99,48,55,98,54,0,48,120,97,57,102,98,53,55,100,98,97,49,101,101,97,57,98,99,51,101,54,54,48,97,57,48,57,100,56,51,56,100,55,49,56,99,51,57,55,97,97,51,98,53,54,49,97,54,102,55,57,48,49,101,48,101,56,50,57,55,52,56,53,54,97,55,0,48,120,56,98,100,50,97,101,98,57,99,98,55,101,53,55,99,98,50,99,52,98,52,56,50,102,102,99,56,49,98,55,97,102,98,57,100,101,50,55,101,49,101,51,98,100,50,51,99,50,51,97,52,52,53,51,98,100,57,97,99,101,51,50,54,50,0,48,120,53,52,55,101,102,56,51,53,99,51,100,97,99,52,102,100,57,55,102,56,52,54,49,97,49,52,54,49,49,100,99,57,99,50,55,55,52,53,49,51,50,100,101,100,56,101,53,52,53,99,49,100,53,52,99,55,50,102,48,52,54,57,57,55,0,48,120,100,51,53,101,52,55,50,48,51,54,98,99,52,102,98,55,101,49,51,99,55,56,53,101,100,50,48,49,101,48,54,53,102,57,56,102,99,102,97,54,102,54,102,52,48,100,101,102,52,102,57,50,98,57,101,99,55,56,57,51,101,99,50,56,102,99,100,52,49,50,98,49,102,49,98,51,50,101,50,55,0,48,120,51,101,101,51,48,98,53,54,56,102,98,97,98,48,102,56,56,51,99,99,101,98,100,52,54,100,51,102,51,98,98,56,97,50,97,55,51,53,49,51,102,53,101,98,55,57,100,97,54,54,49,57,48,101,98,48,56,53,102,102,97,57,102,52,57,50,102,51,55,53,97,57,55,100,56,54,48,101,98,52,0,48,120,53,50,48,56,56,51,57,52,57,100,102,100,98,99,52,50,100,51,97,100,49,57,56,54,52,48,54,56,56,97,54,102,101,49,51,102,52,49,51,52,57,53,53,52,98,52,57,97,99,99,51,49,100,99,99,100,56,56,52,53,51,57,56,49,54,102,53,101,98,52,97,99,56,102,98,49,102,49,97,54,0,48,120,100,51,53,101,52,55,50,48,51,54,98,99,52,102,98,55,101,49,51,99,55,56,53,101,100,50,48,49,101,48,54,53,102,57,56,102,99,102,97,53,98,54,56,102,49,50,97,51,50,100,52,56,50,101,99,55,101,101,56,54,53,56,101,57,56,54,57,49,53,53,53,98,52,52,99,53,57,51,49,49,0,48,120,52,51,98,100,55,101,57,97,102,98,53,51,100,56,98,56,53,50,56,57,98,99,99,52,56,101,101,53,98,102,101,54,102,50,48,49,51,55,100,49,48,97,48,56,55,101,98,54,101,55,56,55,49,101,50,97,49,48,97,53,57,57,99,55,49,48,97,102,56,100,48,100,51,57,101,50,48,54,49,49,0,48,120,49,52,102,100,100,48,53,53,52,53,101,99,49,99,99,56,97,98,52,48,57,51,50,52,55,102,55,55,50,55,53,101,48,55,52,51,102,102,101,100,49,49,55,49,56,50,101,97,97,57,99,55,55,56,55,55,97,97,97,99,54,97,99,55,100,51,53,50,52,53,100,49,54,57,50,101,56,101,101,49,0,48,120,56,99,98,57,49,101,56,50,97,51,51,56,54,100,50,56,48,102,53,100,54,102,55,101,53,48,101,54,52,49,100,102,49,53,50,102,55,49,48,57,101,100,53,52,53,54,98,52,49,50,98,49,100,97,49,57,55,102,98,55,49,49,50,51,97,99,100,51,97,55,50,57,57,48,49,100,49,97,55,49,56,55,52,55,48,48,49,51,51,49,48,55,101,99,53,51,0,48,120,55,98,99,51,56,50,99,54,51,100,56,99,49,53,48,99,51,99,55,50,48,56,48,97,99,101,48,53,97,102,97,48,99,50,98,101,97,50,56,101,52,102,98,50,50,55,56,55,49,51,57,49,54,53,101,102,98,97,57,49,102,57,48,102,56,97,97,53,56,49,52,97,53,48,51,97,100,52,101,98,48,52,97,56,99,55,100,100,50,50,99,101,50,56,50,54,0,48,120,48,52,97,56,99,55,100,100,50,50,99,101,50,56,50,54,56,98,51,57,98,53,53,52,49,54,102,48,52,52,55,99,50,102,98,55,55,100,101,49,48,55,100,99,100,50,97,54,50,101,56,56,48,101,97,53,51,101,101,98,54,50,100,53,55,99,98,52,51,57,48,50,57,53,100,98,99,57,57,52,51,97,98,55,56,54,57,54,102,97,53,48,52,99,49,49,0,48,120,56,99,98,57,49,101,56,50,97,51,51,56,54,100,50,56,48,102,53,100,54,102,55,101,53,48,101,54,52,49,100,102,49,53,50,102,55,49,48,57,101,100,53,52,53,54,98,51,49,102,49,54,54,101,54,99,97,99,48,52,50,53,97,55,99,102,51,97,98,54,97,102,54,98,55,102,99,51,49,48,51,98,56,56,51,50,48,50,101,57,48,52,54,53,54,53,0,48,120,49,100,49,99,54,52,102,48,54,56,99,102,52,53,102,102,97,50,97,54,51,97,56,49,98,55,99,49,51,102,54,98,56,56,52,55,97,51,101,55,55,101,102,49,52,102,101,51,100,98,55,102,99,97,102,101,48,99,98,100,49,48,101,56,101,56,50,54,101,48,51,52,51,54,100,54,52,54,97,97,101,102,56,55,98,50,101,50,52,55,100,52,97,102,49,101,0,48,120,56,97,98,101,49,100,55,53,50,48,102,57,99,50,97,52,53,99,98,49,101,98,56,101,57,53,99,102,100,53,53,50,54,50,98,55,48,98,50,57,102,101,101,99,53,56,54,52,101,49,57,99,48,53,52,102,102,57,57,49,50,57,50,56,48,101,52,54,52,54,50,49,55,55,57,49,56,49,49,49,52,50,56,50,48,51,52,49,50,54,51,99,53,51,49,53,0,48,120,97,97,100,100,57,100,98,56,100,98,101,57,99,52,56,98,51,102,100,52,101,54,97,101,51,51,99,57,102,99,48,55,99,98,51,48,56,100,98,51,98,51,99,57,100,50,48,101,100,54,54,51,57,99,99,97,55,48,51,51,48,56,55,49,55,100,52,100,57,98,48,48,57,98,99,54,54,56,52,50,97,101,99,100,97,49,50,97,101,54,97,51,56,48,101,54,50,56,56,49,102,102,50,102,50,100,56,50,99,54,56,53,50,56,97,97,54,48,53,54,53,56,51,97,52,56,102,51,0,48,120,55,56,51,48,97,51,51,49,56,98,54,48,51,98,56,57,101,50,51,50,55,49,52,53,97,99,50,51,52,99,99,53,57,52,99,98,100,100,56,100,51,100,102,57,49,54,49,48,97,56,51,52,52,49,99,97,101,97,57,56,54,51,98,99,50,100],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+20480);allocate([101,100,53,100,53,97,97,56,50,53,51,97,97,49,48,97,50,101,102,49,99,57,56,98,57,97,99,56,98,53,55,102,49,49,49,55,97,55,50,98,102,50,99,55,98,57,101,55,99,49,97,99,52,100,55,55,102,99,57,52,99,97,0,48,120,51,100,102,57,49,54,49,48,97,56,51,52,52,49,99,97,101,97,57,56,54,51,98,99,50,100,101,100,53,100,53,97,97,56,50,53,51,97,97,49,48,97,50,101,102,49,99,57,56,98,57,97,99,56,98,53,55,102,49,49,49,55,97,55,50,98,102,50,99,55,98,57,101,55,99,49,97,99,52,100,55,55,102,99,57,52,99,97,100,99,48,56,51,101,54,55,57,56,52,48,53,48,98,55,53,101,98,97,101,53,100,100,50,56,48,57,98,100,54,51,56,48,49,54,102,55,50,51,0,48,120,97,97,100,100,57,100,98,56,100,98,101,57,99,52,56,98,51,102,100,52,101,54,97,101,51,51,99,57,102,99,48,55,99,98,51,48,56,100,98,51,98,51,99,57,100,50,48,101,100,54,54,51,57,99,99,97,55,48,51,51,48,56,55,48,53,53,51,101,53,99,52,49,52,99,97,57,50,54,49,57,52,49,56,54,54,49,49,57,55,102,97,99,49,48,52,55,49,100,98,49,100,51,56,49,48,56,53,100,100,97,100,100,98,53,56,55,57,54,56,50,57,99,97,57,48,48,54,57,0,48,120,56,49,97,101,101,52,98,100,100,56,50,101,100,57,54,52,53,97,50,49,51,50,50,101,57,99,52,99,54,97,57,51,56,53,101,100,57,102,55,48,98,53,100,57,49,54,99,49,98,52,51,98,54,50,101,101,102,52,100,48,48,57,56,101,102,102,51,98,49,102,55,56,101,50,100,48,100,52,56,100,53,48,100,49,54,56,55,98,57,51,98,57,55,100,53,102,55,99,54,100,53,48,52,55,52,48,54,97,53,101,54,56,56,98,51,53,50,50,48,57,98,99,98,57,102,56,50,50,0,48,120,55,100,100,101,51,56,53,100,53,54,54,51,51,50,101,99,99,48,101,97,98,102,97,57,99,102,55,56,50,50,102,100,102,50,48,57,102,55,48,48,50,52,97,53,55,98,49,97,97,48,48,48,99,53,53,98,56,56,49,102,56,49,49,49,98,50,100,99,100,101,52,57,52,97,53,102,52,56,53,101,53,98,99,97,52,98,100,56,56,97,50,55,54,51,97,101,100,49,99,97,50,98,50,102,97,56,102,48,53,52,48,54,55,56,99,100,49,101,48,102,51,97,100,56,48,56,57,50,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,52,51,49,0,48,120,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,55,0,48,120,53,102,98,102,102,52,57,56,97,97,57,51,56,99,101,55,51,57,98,56,101,48,50,50,102,98,97,102,101,102,52,48,53,54,51,102,54,101,54,97,51,52,55,50,102,99,50,97,53,49,52,99,48,99,101,57,100,97,101,50,51,98,55,101,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,49,53,48,102,101,56,97,49,56,57,50,57,55,54,49,53,52,99,53,57,99,102,99,49,57,51,97,99,99,102,53,98,51,0,48,120,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,50,0,48,120,48,56,101,50,97,56,97,48,101,54,53,49,52,55,100,52,98,100,54,51,49,54,48,51,48,101,49,54,100,49,57,99,56,53,99,57,55,102,48,97,57,99,97,50,54,55,49,50,50,98,57,54,97,98,98,99,101,97,55,101,56,102,99,56,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,100,57,55,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,100,57,52,0,48,120,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,97,54,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,54,99,54,49,49,48,55,48,57,57,53,97,100,49,48,48,52,53,56,52,49,98,48,57,98,55,54,49,98,56,57,51,0,48,120,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,49,0,48,120,56,100,57,49,101,52,55,49,101,48,57,56,57,99,100,97,50,55,100,102,53,48,53,97,52,53,51,102,50,98,55,54,51,53,50,57,52,102,50,100,100,102,50,51,101,51,98,49,50,50,97,99,99,57,57,99,57,101,57,102,49,101,49,52,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,99,57,57,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,99,57,54,0,48,120,51,101,49,97,102,52,49,57,97,50,54,57,97,53,102,56,54,54,97,55,100,51,99,50,53,99,51,100,102,56,48,97,101,57,55,57,50,53,57,51,55,51,102,102,50,98,49,56,50,102,52,57,100,52,99,101,55,101,49,98,98,99,56,98,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,49,53,102,55,48,48,99,102,102,102,49,97,54,50,52,101,53,101,52,57,55,49,54,49,98,99,99,56,97,49,57,56,102,0,48,120,51,102,97,56,49,50,52,51,53,57,102,57,54,54,56,48,98,56,51,100,49,99,51,101,98,50,99,48,55,48,101,53,99,53,52,53,99,57,56,53,56,100,48,51,101,99,102,98,55,52,52,98,102,56,100,55,49,55,55,49,55,101,102,99,0,48,120,57,98,57,102,54,48,53,102,53,97,56,53,56,49,48,55,97,98,49,101,99,56,53,101,54,98,52,49,99,56,97,97,99,102,56,52,54,101,56,54,55,56,57,48,53,49,100,51,55,57,57,56,102,55,98,57,48,50,50,100,55,53,57,98,0,48,120,57,98,57,102,54,48,53,102,53,97,56,53,56,49,48,55,97,98,49,101,99,56,53,101,54,98,52,49,99,56,97,97,99,102,56,52,54,101,56,54,55,56,57,48,53,49,100,51,55,57,57,56,102,55,98,57,48,50,50,100,55,53,57,56,0,48,120,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,56,48,53,97,0,48,120,57,98,57,102,54,48,53,102,53,97,56,53,56,49,48,55,97,98,49,101,99,56,53,101,54,98,52,49,99,56,97,97,53,56,50,99,97,51,53,49,49,101,100,100,102,98,55,52,102,48,50,102,51,97,54,53,57,56,57,56,48,98,98,57,0,48,120,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,0,48,120,52,49,101,99,101,53,53,55,52,51,55,49,49,97,56,99,51,99,98,102,51,55,56,51,99,100,48,56,99,48,101,101,52,100,52,100,99,52,52,48,100,52,54,52,49,97,56,102,51,54,54,101,53,53,48,100,102,100,98,51,98,98,54,55,0,71,79,83,84,50,48,49,50,45,116,101,115,116,0,48,120,52,53,51,49,97,99,100,49,102,101,48,48,50,51,99,55,53,53,48,100,50,54,55,98,54,98,50,102,101,101,56,48,57,50,50,98,49,52,98,50,102,102,98,57,48,102,48,52,100,52,101,98,55,99,48,57,98,53,100,50,100,49,53,100,102,49,100,56,53,50,55,52,49,97,102,52,55,48,52,97,48,52,53,56,48,52,55,101,56,48,101,52,53,52,54,100,51,53,98,56,51,51,54,102,97,99,50,50,52,100,100,56,49,54,54,52,98,98,102,53,50,56,98,101,54,51,55,51,0,48,120,49,99,102,102,48,56,48,54,97,51,49,49,49,54,100,97,50,57,100,56,99,102,97,53,52,101,53,55,101,98,55,52,56,98,99,53,102,51,55,55,101,52,57,52,48,48,102,100,100,55,56,56,98,54,52,57,101,99,97,49,97,99,52,51,54,49,56,51,52,48,49,51,98,50,97,100,55,51,50,50,52,56,48,97,56,57,99,97,53,56,101,48,99,102,55,52,98,99,57,101,53,52,48,99,50,97,100,100,54,56,57,55,102,97,100,48,97,51,48,56,52,102,51,48,50,97,100,99,0,48,120,52,53,51,49,97,99,100,49,102,101,48,48,50,51,99,55,53,53,48,100,50,54,55,98,54,98,50,102,101,101,56,48,57,50,50,98,49,52,98,50,102,102,98,57,48,102,48,52,100,52,101,98,55,99,48,57,98,53,100,50,100,49,53,100,97,56,50,102,50,100,55,101,99,98,49,100,98,97,99,55,49,57,57,48,53,99,53,101,101,99,99,52,50,51,102,49,100,56,54,101,50,53,101,100,98,101,50,51,99,53,57,53,100,54,52,52,97,97,102,49,56,55,101,54,101,54,100,102,0,48,120,50,52,100,49,57,99,99,54,52,53,55,50,101,101,51,48,102,51,57,54,98,102,54,101,98,98,102,100,55,97,54,99,53,50,49,51,98,51,98,51,100,55,48,53,55,99,99,56,50,53,102,57,49,48,57,51,97,54,56,99,100,55,54,50,102,100,54,48,54,49,49,50,54,50,99,100,56,51,56,100,99,54,98,54,48,97,97,55,101,101,101,56,48,52,101,50,56,98,99,56,52,57,57,55,55,102,97,99,51,51,98,52,98,53,51,48,102,49,98,49,50,48,50,52,56,97,57,97,0,48,120,50,98,98,51,49,50,97,52,51,98,100,50,99,101,54,101,48,100,48,50,48,54,49,51,99,56,53,55,97,99,100,100,99,102,98,102,48,54,49,101,57,49,101,53,102,50,99,51,102,51,50,52,52,55,99,50,53,57,102,51,57,98,50,99,56,51,97,98,49,53,54,100,55,55,102,49,52,57,54,98,102,55,101,98,51,51,53,49,101,49,101,101,52,101,52,51,100,99,49,97,49,56,98,57,49,98,50,52,54,52,48,98,54,100,98,98,57,50,99,98,49,97,100,100,51,55,49,101,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,100,99,55,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,100,99,52,0,48,120,101,56,99,50,53,48,53,100,101,100,102,99,56,54,100,100,99,49,98,100,48,98,50,98,54,54,54,55,102,49,100,97,51,52,98,56,50,53,55,52,55,54,49,99,98,48,101,56,55,57,98,100,48,56,49,99,102,100,48,98,54,50,54,53,101,101,51,99,98,48,57,48,102,51,48,100,50,55,54,49,52,99,98,52,53,55,52,48,49,48,100,97,57,48,100,100,56,54,50,101,102,57,100,52,101,98,101,101,52,55,54,49,53,48,51,49,57,48,55,56,53,97,55,49,99,55,54,48,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,50,55,101,54,57,53,51,50,102,52,56,100,56,57,49,49,54,102,102,50,50,98,56,100,52,101,48,53,54,48,54,48,57,98,52,98,51,56,97,98,102,97,100,50,98,56,53,100,99,97,99,100,98,49,52,49,49,102,49,48,98,50,55,53,0,48,120,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,51,0,48,120,55,53,48,51,99,102,101,56,55,97,56,51,54,97,101,51,97,54,49,98,56,56,49,54,101,50,53,52,53,48,101,54,99,101,53,101,49,99,57,51,97,99,102,49,97,98,99,49,55,55,56,48,54,52,102,100,99,98,101,102,97,57,50,49,100,102,49,54,50,54,98,101,52,102,100,48,51,54,101,57,51,100,55,53,101,54,97,53,48,101,51,97,52,49,101,57,56,48,50,56,102,101,53,102,99,50,51,53,102,53,98,56,56,57,97,53,56,57,99,98,53,50,49,53,102,50,97,52,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,54,102,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,54,99,0,48,120,54,56,55,100,49,98,52,53,57,100,99,56,52,49,52,53,55,101,51,101,48,54,99,102,54,102,53,101,50,53,49,55,98,57,55,99,55,100,54,49,52,97,102,49,51,56,98,99,98,102,56,53,100,99,56,48,54,99,52,98,50,56,57,102,51,101,57,54,53,100,50,100,98,49,52,49,54,100,50,49,55,102,56,98,50,55,54,102,97,100,49,97,98,54,57,99,53,48,102,55,56,98,101,101,49,102,97,51,49,48,54,101,102,98,56,99,99,98,99,55,99,53,49,52,48,49,49,54,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,49,52,57,97,49,101,99,49,52,50,53,54,53,97,53,52,53,97,99,102,100,98,55,55,98,100,57,100,52,48,99,102,97,56,98,57,57,54,55,49,50,49,48,49,98,101,97,48,101,99,54,51,52,54,99,53,52,51,55,52,102,50,53,98,100,0,48,120,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,50,0,48,120,49,97,56,102,55,101,100,97,51,56,57,98,48,57,52,99,50,99,48,55,49,101,51,54,52,55,97,56,57,52,48,102,51,99,49,50,51,98,54,57,55,53,55,56,99,50,49,51,98,101,54,100,100,57,101,54,99,56,101,99,55,51,51,53,100,99,98,50,50,56,102,100,49,101,100,102,52,97,51,57,49,53,50,99,98,99,97,97,102,56,99,48,51,57,56,56,50,56,48,52,49,48,53,53,102,57,52,99,101,101,101,99,55,101,50,49,51,52,48,55,56,48,102,101,52,49,98,100,0,48,120,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,69,70,70,70,70,70,67,50,70,0,48,120,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,69,66,65,65,69,68,67,69,54,65,70,52,56,65,48,51,66,66,70,68,50,53,69,56,67,68,48,51,54,52,49,52,49,0,48,120,55,57,66,69,54,54,55,69,70,57,68,67,66,66,65,67,53,53,65,48,54,50,57,53,67,69,56,55,48,66,48,55,48,50,57,66,70,67,68,66,50,68,67,69,50,56,68,57,53,57,70,50,56,49,53,66,49,54,70,56,49,55,57,56,0,48,120,52,56,51,65,68,65,55,55,50,54,65,51,67,52,54,53,53,68,65,52,70,66,70,67,48,69,49,49,48,56,65,56,70,68,49,55,66,52,52,56,65,54,56,53,53,52,49,57,57,67,52,55,68,48,56,70,70,66,49,48,68,52,66,56,0,48,120,48,52,0,45,112,97,98,103,110,104,0,98,0,103,0,104,0,100,0,46,120,0,46,121,0,46,122,0,101,99,99,32,103,101,116,32,112,97,114,97,109,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,10,0,40,112,117,98,108,105,99,45,107,101,121,40,101,99,99,40,112,37,109,41,40,97,37,109,41,40,98,37,109,41,40,103,37,109,41,40,110,37,109,41,40,104,37,109,41,41,41,0,103,46,120,0,103,46,121,0,113,46,120,0,113,46,121,0,101,100,100,115,97,95,101,110,99,111,100,101,112,111,105,110,116,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,10,0,48,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,68,0,115,99,97,110,110,105,110,103,32,69,67,67,32,112,97,114,97,109,101,116,101,114,32,102,97,105,108,101,100,58,32,37,115,10,0,50,66,56,51,50,52,56,48,52,70,67,49,68,70,48,66,50,66,52,68,48,48,57,57,51,68,70,66,68,55,65,55,50,70,52,51,49,56,48,54,65,68,50,70,69,52,55,56,67,52,69,69,49,66,50,55,52,65,48,69,65,48,66,48,0,101,99,103,101,110,32,32,32,32,32,32,112,107,0,42,32,101,95,112,107,0,32,32,101,95,112,107,0,32,32,32,32,32,109,0,32,32,32,114,0,32,32,32,101,95,114,0,32,72,40,82,43,41,0,32,32,32,101,95,115,0,69,100,119,97,114,100,115,0,87,101,105,101,114,115,116,114,97,115,115,0,69,100,50,53,53,49,57,0,83,116,97,110,100,97,114,100,0,109,112,105,95,112,114,105,110,116,32,102,97,105,108,101,100,58,32,37,115,10,0,109,112,105,95,115,99,97,110,32,102,97,105,108,101,100,58,32,37,115,10,0,83,97,109,112,108,101,32,35,49,0,79,76,163,213,214,139,167,204,10,18,8,201,198,30,156,93,160,64,60,10,0,83,97,109,112,108,101,32,35,50,0,9,34,211,64,95,170,61,25,79,130,164,88,48,115,125,92,198,199,93,36,0,83,97,109,112,108,101,32,35,51,0,188,244,30,171,139,178,216,2,243,208,92,175,124,176,146,236,248,209,163,170,0,83,97,109,112,108,101,32,35,52,0,158,168,134,239,226,104,219,236,206,66,12,117,36,223,50,224,117,26,42,38,0,70,73,80,83,45,49,57,56,97,44,32,65,46,49,0,70,73,80,83,45,49,57,56,97,44,32,65,46,50,0,70,73,80,83,45,49,57,56,97,44,32,65,46,51,0,70,73,80,83,45,49,57,56,97,44,32,65,46,52,0,104,109,97,99,0,95,103,99,114,121,95,104,109,97,99,50,53,54,95,110,101,119,32,102,97,105,108,101,100,0,95,103,99,114,121,95,104,109,97,99,50,53,54,95,102,105,110,97,108,105,122,101,32,102,97,105,108,101,100,0,100,111,101,115,32,110,111,116,32,109,97,116,99,104,32,105,110,32,115,101,99,111,110,100,32,105,109,112,108,101,109,101,110,116,97,116,105,111,110,0,97,108,103,111,114,105,116,104,109,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,100,97,116,97,45,50,56,32,107,101,121,45,52,0,119,104,97,116,32,100,111,32,121,97,32,119,97,110,116,32,102,111,114,32,110,111,116,104,105,110,103,63,0,74,101,102,101,0,100,97,116,97,45,57,32,107,101,121,45,50,48,0,72,105,32,84,104,101,114,101,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,100,97,116,97,45,53,48,32,107,101,121,45,50,48,0,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,0,100,97,116,97,45,53,48,32,107,101,121,45,50,54,0,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,0,100,97,116,97,45,53,52,32,107,101,121,45,49,51,49,0,84,101,115,116,32,85,115,105,110,103,32,76,97,114,103,101,114,32,84,104,97,110,32,66,108,111,99,107,45,83,105,122,101,32,75,101,121,32,45,32,72,97,115,104,32,75,101,121,32,70,105,114,115,116,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,0,100,97,116,97,45,49,53,50,32,107,101,121,45,49,51,49,0,84,104,105,115,32,105,115,32,97,32,116,101,115,116,32,117,115,105,110,103,32,97,32,108,97,114,103,101,114,32,116,104,97,110,32,98,108,111,99,107,45,115,105,122,101,32,107,101,121,32,97,110,100,32,97,32,108,97,114,103,101,114,32,116,104,97,110,32,98,108,111,99,107,45,115,105,122,101,32,100,97,116,97,46,32,84,104,101,32,107,101,121,32,110,101,101,100,115,32,116,111,32,98,101,32,104,97,115,104,101,100,32,98,101,102,111,114,101,32,98,101,105,110,103,32,117,115,101,100,32,98,121,32,116,104,101,32,72,77,65,67,32,97,108,103,111,114,105,116,104,109,46,0,100,111,101,115,32,110,111,116,32,109,97,116,99,104,0,103,99,114,121,95,109,100,95,115,101,116,107,101,121,32,102,97,105,108,101,100,0,103,99,114,121,95,109,100,95,114,101,97,100,32,102,97,105,108,101,100,0,105,110,118,97,108,105,100,32,116,101,115,116,115,32,100,97,116,97,0,111,105,100,46,0,79,73,68,46,0,109,100,95,101,110,97,98,108,101,58,32,97,108,103,111,114,105,116,104,109,32,37,100,32,110,111,116,32,97,118,97,105,108,97,98,108,101,10,0,77,68,53,32,117,115,101,100,0,109,100,46,99,0,109,100,95,119,114,105,116,101,0,109,100,95,103,101,116,95,97,108,103,111,0,112,111,115,115,105,98,108,101,32,117,115,97,103,101,32,101,114,114,111,114,0,87,65,82,78,73,78,71,58,32,109,111,114,101,32,116,104,97,110,32,111,110,101,32,97,108,103,111,114,105,116,104,109,32,105,110,32,109,100,95,103,101,116,95,97,108,103,111,40,41,10,0,109,111,114,101,32,116,104,97,110,32,111,110,101,32,97,108,103,111,114,105,116,104,109,32,105,110,32,109,100,95,114,101,97,100,40,48,41,10,0,109,100,95,114,101,97,100,0,107,101,121,108,101,110,32,60,61,32,104,100,45,62,99,116,120,45,62,109,97,99,112,97,100,115,95,66,115,105,122,101,0,112,114,101,112,97,114,101,95,109,97,99,112,97,100,115,0,103,99,114,121,95,109,100,95,111,112,101,110,32,102,97,105,108,101,100,32,102,111,114,32,97,108,103,111,32,37,100,58,32,37,115,0,110,111,32,65,83,78,46,49,32,79,73,68,32,102,111,114,32,109,100,32,97,108,103,111,32,37,100,10,0,112,114,105,109,101,103,101,110,0,99,97,110,39,116,32,103,101,110,101,114,97,116,101,32,97,32,112,114,105,109,101,32,119,105,116,104,32,108,101,115,115,32,116,104,97,110,32,37,100,32,98,105,116,115,10,0,111,118,101,114,102,108,111,119,32,105,110,32,112,114,105,109,101,32,103,101,110,101,114,97,116,105,111,110,10,0,95,103,99,114,121,95,109,112,105,95,99,109,112,40,32,40,120,41,44,32,40,110,109,105,110,117,115,49,41,32,41,32,60,32,48,32,38,38,32,95,103,99,114,121,95,109,112,105,95,99,109,112,95,117,105,40,32,40,120,41,44,32,40,49,41,32,41,32,62,32,48,0,112,114,105,109,101,103,101,110,46,99,0,105,115,95,112,114,105,109,101,0,112,115,115,0,114,97,119,0,99,111,109,112,0,111,97,101,112,0,112,107,99,115,49,0,112,97,114,97,109,0,110,111,99,111,109,112,0,114,102,99,54,57,55,57,0,110,111,112,97,114,97,109,0,112,107,99,115,49,45,114,97,119,0,105,103,110,105,110,118,102,108,97,103,0,110,111,45,107,101,121,116,101,115,116,0,110,111,45,98,108,105,110,100,105,110,103,0,117,115,101,45,102,105,112,115,49,56,54,0,117,115,101,45,102,105,112,115,49,56,54,45,50,0,110,98,105,116,115,0,114,115,97,45,117,115,101,45,101,0,115,105,103,45,118,97,108,0,104,97,115,104,45,97,108,103,111,0,108,97,98,101,108,0,114,97,110,100,111,109,45,111,118,101,114,114,105,100,101,0,115,104,97,49,0,109,100,53,0,115,104,97,50,53,54,0,114,105,112,101,109,100,49,54,48,0,114,109,100,49,54,48,0,115,104,97,51,56,52,0,115,104,97,53,49,50,0,115,104,97,50,50,52,0,109,100,50,0,109,100,52,0,116,105,103,101,114,0,104,97,118,97,108,0,100,97,116,97,0,104,97,115,104,0,115,97,108,116,45,108,101,110,103,116,104,0,63,0,112,114,105,118,97,116,101,45,107,101,121,0,112,117,98,108,105,99,45,107,101,121,0,103,101,110,107,101,121,0,97,108,103,111,114,105,116,104,109,32,100,105,115,97,98,108,101,100,0,97,108,103,111,114,105,116,104,109,32,110,111,116,32,102,111,117,110,100,0,110,111,32,115,101,108,102,116,101,115,116,32,97,118,97,105,108,97,98,108,101,0,109,111,100,117,108,101,0,65,69,83,0,232,233,234,235,237,238,239,240,242,243,244,245,247,248,249,250,1,75,175,34,120,166,157,51,29,81,128,16,54,67,233,154,103,67,195,209,81,154,180,242,205,154,120,171,9,165,17,189,65,69,83,45,49,50,56,32,116,101,115,116,32,100,101,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,65,69,83,45,49,50,56,32,116,101,115,116,32,101,110,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,99,102,98,0,111,102,98,0,108,111,119,45,108,101,118,101,108,0,99,105,112,104,101,114,0,4,5,6,7,9,10,11,12,14,15,16,17,19,20,21,22,24,25,26,27,29,30,31,32,118,119,116,117,241,242,243,244,248,249,230,231,119,112,113,114,93,30,242,13,206,214,188,188,18,19,26,199,197,71,136,170,65,69,83,45,49,57,50,32,116,101,115,116,32,100,101,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,65,69,83,45,49,57,50,32,116,101,115,116,32,101,110,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,8,9,10,11,13,14,15,16,18,19,20,21,23,24,25,26,28,29,30,31,33,34,35,36,38,39,40,41,43,44,45,46,6,154,0,127,199,106,69,159,152,186,249,23,254,223,149,33,8,14,149,23,235,22,119,113,154,207,114,128,134,4,10,227,65,69,83,45,50,53,54,32,116,101,115,116,32,100,101,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,65,69,83,45,50,53,54,32,116,101,115,116,32,101,110,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,110,111,32,116,101,115,116,32,100,97,116,97,32,102,111,114,32,116,104,105,115,32,109,111,100,101,0,111,112,101,110,0,115,101,116,32,107,101,121,0,115,101,116,32,73,86,0,101,110,99,114,121,112,116,32,99,111,109,109,97,110,100,0,101,110,99,114,121,112,116,32,109,105,115,109,97,116,99,104,0,100,101,99,114,121,112,116,32,99,111,109,109,97,110,100,0,100,101,99,114,121,112,116,32,109,105,115,109,97,116,99,104,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,49,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,50,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,51,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,52,0,82,73,74,78,68,65,69,76,0,65,69,83,49,50,56,0,65,69,83,45,49,50,56,0,65,69,83,49,57,50,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,50,49,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,50,50,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,50,51,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,50,52,0,82,73,74,78,68,65,69,76,49,57,50,0,65,69,83,45,49,57,50,0,65,69,83,50,53,54,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,52,49,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,52,50,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,52,51,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,52,52,0,82,73,74,78,68,65,69,76,50,53,54,0,65,69,83,45,50,53,54,0,82,73,80,69,77,68,49,54,48,0,48,33,48,9,6,5,43,36,3,2,1,5,0,4,20,49,46,51,46,51,54,46,51,46,51,46,49,46,50,0,49,46,51,46,51,54,46,51,46,50,46,49,0,105,32,62,32,48,0,114,115,97,45,99,111,109,109,111,110,46,99,0,95,103,99,114,121,95,114,115,97,95,112,107,99,115,49,95,101,110,99,111,100,101,95,102,111,114,95,101,110,99,0,110,32,61,61,32,110,102,114,97,109,101,0,80,75,67,83,35,49,32,98,108,111,99,107,32,116,121,112,101,32,50,32,101,110,99,111,100,101,100,32,100,97,116,97,0,118,97,108,117,101,32,101,120,116,114,97,99,116,101,100,32,102,114,111,109,32,80,75,67,83,35,49,32,98,108,111,99,107,32,116,121,112,101,32,50,32,101,110,99,111,100,101,100,32,100,97,116,97,0,105,32,62,32,49,0,95,103,99,114,121,95,114,115,97,95,112,107,99,115,49,95,101,110,99,111,100,101,95,102,111,114,95,115,105,103,0,80,75,67,83,35,49,32,98,108,111,99,107,32,116,121,112,101,32,49,32,101,110,99,111,100,101,100,32,100,97,116,97,0,95,103,99,114,121,95,114,115,97,95,112,107,99,115,49,95,101,110,99,111,100,101,95,114,97,119,95,102,111,114,95,115,105,103,0,79,65,69,80,32,101,110,99,111,100,101,100,32,100,97,116,97,0,118,97,108,117,101,32,101,120,116,114,97,99,116,101,100,32,102,114,111,109,32,79,65,69,80,32,101,110,99,111,100,101,100,32,100,97,116,97,0,104,108,101,110,0,95,103,99,114,121,95,114,115,97,95,112,115,115,95,101,110,99,111,100,101,0,80,83,83,32,101,110,99,111,100,101,100,32,100,97,116,97,0,95,103,99,114,121,95,114,115,97,95,112,115,115,95,118,101,114,105,102,121,0,82,83,65,0,110,101,0,110,101,100,112,113,117,0,97,0,115,0,110,0,40,112,114,105,118,97,116,101,45,107,101,121,32,40,114,115,97,32,32,40,110,32,35,48,48,101,48,99,101,57,54,102,57,48,98,54,99,57,101,48,50,102,51,57,50,50,98,101,97,100,97,57,51,102,101,53,48,97,56,55,53,101,97,99,54,98,99,99,49,56,98,98,57,97,57,99,102,50,101,56,52,57,54,53,99,97,97,32,32,32,32,32,32,50,100,49,102,102,57,53,97,55,102,53,52,50,52,54,53,99,54,99,48,99,49,57,100,50,55,54,101,52,53,50,54,99,101,48,52,56,56,54,56,97,55,97,57,49,52,102,100,51,52,51,99,99,51,97,56,55,100,100,55,52,50,57,49,32,32,32,32,32,32,102,102,99,53,54,53,53,48,54,100,53,98,98,98,50,53,99,98,97,99,54,97,48,101,50,100,100,49,102,56,98,99,97,97,98,48,100,52,97,50,57,99,50,102,51,55,99,57,53,48,102,51,54,51,52,56,52,98,102,50,54,57,102,55,32,32,32,32,32,32,56,57,49,52,52,48,52,54,52,98,97,102,55,57,56,50,55,101,48,51,97,51,54,101,55,48,98,56,49,52,57,51,56,101,101,98,100,99,54,51,101,57,54,52,50,52,55,98,101,55,53,100,99,53,56,98,48,49,52,98,55,101,97,50,53,49,35,41,32,32,40,101,32,35,48,49,48,48,48,49,35,41,32,32,40,100,32,35,48,52,54,49,50,57,102,50,52,56,57,100,55,49,53,55,57,98,101,48,97,55,53,102,101,48,50,57,98,100,54,99,100,98,53,55,52,101,98,102,53,55,101,97,56,97,53,98,48,102,100,97,57,52,50,99,97,98,57,52,51,98,49,49,32,32,32,32,32,32,55,100,55,98,98,57,53,101,53,100,50,56,56,55,53,101,48,102,57,102,99,53,102,99,99,48,54,97,55,50,102,54,100,53,48,50,52,54,52,100,97,98,100,101,100,55,56,101,102,54,98,55,49,54,49,55,55,98,56,51,100,53,98,100,32,32,32,32,32,32,99,53,52,51,100,99,53,100,51,102,101,100,57,51,50,101,53,57,102,53,56,57,55,101,57,50,101,54,102,53,56,97,48,102,51,51,52,50,52,49,48,54,97,51,98,54,102,97,50,99,98,102,56,55,55,53,49,48,101,52,97,99,50,49,32,32,32,32,32,32,99,51,101,101,52,55,56,53,49,101,57,55,100,49,50,57,57,54,50,50,50,97,99,51,53,54,54,100,52,99,99,98,48,98,56,51,100,49,54,52,48,55,52,97,98,102,55,100,101,54,53,53,102,99,50,52,52,54,100,97,49,55,56,49,35,41,32,32,40,112,32,35,48,48,101,56,54,49,98,55,48,48,101,49,55,101,56,97,102,101,54,56,51,55,101,55,53,49,50,101,51,53,98,54,99,97,49,49,100,48,97,101,52,55,100,56,98,56,53,49,54,49,99,54,55,98,97,102,54,52,51,55,55,50,49,51,32,32,32,32,32,32,102,101,53,50,100,55,55,50,102,50,48,51,53,98,51,99,97,56,51,48,97,102,52,49,100,56,97,52,49,50,48,101,49,99,49,99,55,48,100,49,50,99,99,50,50,102,48,48,100,50,56,100,51,49,100,100,52,56,97,56,100,52,50,52,102,49,35,41,32,32,40,113,32,35,48,48,102,55,97,55,99,97,53,51,54,55,99,54,54,49,102,56,101,54,50,100,102,51,52,102,48,100,48,53,99,49,48,99,56,56,101,53,52,57,50,51,52,56,100,100,55,98,100,100,99,57,52,50,99,57,97,56,102,51,54,57,102,57,32,32,32,32,32,32,51,53,97,48,55,55,56,53,100,50,100,98,56,48,53,50,49,53,101,100,55,56,54,101,52,50,56,53,100,102,49,54,53,56,101,101,100,51,99,101,56,52,102,52,54,57,98,56,49,98,53,48,100,51,53,56,52,48,55,98,52,97,100,51,54,49,35,41,32,32,40,117,32,35,51,48,52,53,53,57,97,57,101,97,100,53,54,100,50,51,48,57,100,50,48,51,56,49,49,97,54,52,49,98,98,49,97,48,57,54,50,54,98,99,56,101,98,51,54,102,102,102,97,50,51,99,57,54,56,101,99,53,98,100,56,57,49,101,32,32,32,32,32,32,101,98,98,97,102,99,55,51,97,101,54,54,54,101,48,49,98,97,55,99,56,57,57,48,98,97,101,48,54,99,99,50,98,98,101,49,48,98,55,53,101,54,57,102,99,97,99,98,51,53,51,97,54,52,55,51,48,55,57,100,56,101,57,98,35,41,41,41,0,40,112,117,98,108,105,99,45,107,101,121,32,40,114,115,97,32,32,40,110,32,35,48,48,101,48,99,101,57,54,102,57,48,98,54,99,57,101,48,50,102,51,57,50,50,98,101,97,100,97,57,51,102,101,53,48,97,56,55,53,101,97,99,54,98,99,99,49,56,98,98,57,97,57,99,102,50,101,56,52,57,54,53,99,97,97,32,32,32,32,32,32,50,100,49,102,102,57,53,97,55,102,53,52,50,52,54,53,99,54,99,48,99,49,57,100,50,55,54,101,52,53,50,54,99,101,48,52,56,56,54,56,97,55,97,57,49,52,102,100,51,52,51,99,99,51,97,56,55,100,100,55,52,50,57,49,32,32,32,32,32,32,102,102,99,53,54,53,53,48,54,100,53,98,98,98,50,53,99,98,97,99,54,97,48,101,50,100,100,49,102,56,98,99,97,97,98,48,100,52,97,50,57,99,50,102,51,55,99,57,53,48,102,51,54,51,52,56,52,98,102,50,54,57,102,55,32,32,32,32,32,32,56,57,49,52,52,48,52,54,52,98,97,102,55,57,56,50,55,101,48,51,97,51,54,101,55,48,98,56,49,52,57,51,56,101,101,98,100,99,54,51,101,57,54,52,50,52,55,98,101,55,53,100,99,53,56,98,48,49,52,98,55,101,97,50,53,49,35,41,32,32,40,101,32,35,48,49,48,48,48,49,35,41,41,41,0,40,100,97,116,97,32,40,102,108,97,103,115,32,112,107,99,115,49,41,32,40,104,97,115,104,32,115,104,97,49,32,35,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,48,48,97,97,98,98,99,99,100,100,101,101,102,102,49,48,50,48,51,48,52,48,35,41,41,0,40,100,97,116,97,32,40,102,108,97,103,115,32,112,107,99,115,49,41,32,40,104,97,115,104,32,115,104,97,49,32,35,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,48,48,97,97,98,98,99,99,100,100,101,101,102,102,56,48,50,48,51,48,52,48,35,41,41,0,98,97,100,32,115,105,103,110,97,116,117,114,101,32,110,111,116,32,100,101,116,101,99,116,101,100,0,99,111,110,118,101,114,116,105,110,103,32,100,97,116,97,32,102,97,105,108,101,100,0,115,105,103,110,105,110,103,32,102,97,105,108,101,100,0,118,101,114,105,102,121,32,102,97,105,108,101,100,0,40,100,97,116,97,32,40,102,108,97,103,115,32,114,97,119,41,32,40,118,97,108,117,101,32,37,109,41,41,0,101,110,99,45,118,97,108,0,114,115,97,0,118,97,108,117,101,0,109,105,115,109,97,116,99,104,0,101,110,99,114,121,112,116,32,102,97,105,108,101,100,0,103,99,114,121,95,112,107,95,100,101,99,114,121,112,116,32,114,101,116,117,114,110,101,100,32,103,97,114,98,97,103,101,0,99,105,112,104,101,114,116,101,120,116,32,109,97,116,99,104,101,115,32,112,108,97,105,110,116,101,120,116,0,100,101,99,114,121,112,116,32,102,97,105,108,101,100,0,100,101,99,114,121,112,116,32,114,101,116,117,114,110,101,100,32,110,111,32,112,108,97,105,110,116,101,120,116,0,99,111,110,118,101,114,116,0,107,101,121,32,99,111,110,115,105,115,116,101,110,99,121,0,115,105,103,110,0,101,110,99,114,121,112,116,0,112,117,98,107,101,121,0,114,115,97,95,118,101,114,105,102,121,32,100,97,116,97,0,114,115,97,95,118,101,114,105,102,121,32,32,115,105,103,0,114,115,97,95,118,101,114,105,102,121,32,32,32,32,110,0,114,115,97,95,118,101,114,105,102,121,32,32,32,32,101,0,114,115,97,95,118,101,114,105,102,121,32,32,99,109,112,0,114,115,97,95,118,101,114,105,102,121],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+30720);allocate([32,32,32,32,61,62,32,37,115,10,0,114,115,97,95,115,105,103,110,32,32,32,100,97,116,97,0,110,101,100,112,63,113,63,117,63,0,114,115,97,95,115,105,103,110,32,32,32,32,32,32,110,0,114,115,97,95,115,105,103,110,32,32,32,32,32,32,101,0,114,115,97,95,115,105,103,110,32,32,32,32,32,32,100,0,114,115,97,95,115,105,103,110,32,32,32,32,32,32,112,0,114,115,97,95,115,105,103,110,32,32,32,32,32,32,113,0,114,115,97,95,115,105,103,110,32,32,32,32,32,32,117,0,114,115,97,95,115,105,103,110,32,32,32,32,114,101,115,0,40,115,105,103,45,118,97,108,40,114,115,97,40,115,37,98,41,41,41,0,40,115,105,103,45,118,97,108,40,114,115,97,40,115,37,77,41,41,41,0,114,115,97,95,115,105,103,110,32,32,32,32,32,32,61,62,32,37,115,10,0,114,115,97,95,100,101,99,114,121,112,116,32,100,97,116,97,0,114,115,97,95,100,101,99,114,121,112,116,32,32,32,32,110,0,114,115,97,95,100,101,99,114,121,112,116,32,32,32,32,101,0,114,115,97,95,100,101,99,114,121,112,116,32,32,32,32,100,0,114,115,97,95,100,101,99,114,121,112,116,32,32,32,32,112,0,114,115,97,95,100,101,99,114,121,112,116,32,32,32,32,113,0,114,115,97,95,100,101,99,114,121,112,116,32,32,32,32,117,0,114,115,97,95,100,101,99,114,121,112,116,32,32,114,101,115,0,40,118,97,108,117,101,32,37,98,41,0,37,109,0,114,115,97,95,100,101,99,114,121,112,116,32,32,32,32,61,62,32,37,115,10,0,114,115,97,95,101,110,99,114,121,112,116,32,100,97,116,97,0,114,115,97,95,101,110,99,114,121,112,116,32,32,32,32,110,0,114,115,97,95,101,110,99,114,121,112,116,32,32,32,32,101,0,114,115,97,95,101,110,99,114,121,112,116,32,32,114,101,115,0,40,101,110,99,45,118,97,108,40,114,115,97,40,97,37,98,41,41,41,0,40,101,110,99,45,118,97,108,40,114,115,97,40,97,37,109,41,41,41,0,114,115,97,95,101,110,99,114,121,112,116,32,32,32,32,61,62,32,37,115,10,0,114,115,97,95,116,101,115,116,107,101,121,32,32,32,32,61,62,32,37,115,10,0,100,101,114,105,118,101,45,112,97,114,109,115,0,117,115,101,45,120,57,51,49,0,95,103,99,114,121,95,109,112,105,95,103,101,116,95,110,98,105,116,115,32,40,40,120,112,41,41,32,61,61,32,110,98,105,116,115,0,114,115,97,46,99,0,103,101,110,95,120,57,51,49,95,112,97,114,109,95,120,112,0,95,103,99,114,121,95,109,112,105,95,103,101,116,95,110,98,105,116,115,32,40,40,120,105,41,41,32,61,61,32,49,48,49,0,103,101,110,95,120,57,51,49,95,112,97,114,109,95,120,105,0,88,112,49,0,88,112,50,0,88,112,0,88,113,49,0,88,113,50,0,88,113,0,95,103,99,114,121,95,109,112,105,95,103,99,100,32,40,32,40,103,41,44,32,40,101,41,44,32,40,112,104,105,41,32,41,0,103,101,110,101,114,97,116,101,95,120,57,51,49,0,112,32,97,110,100,32,113,32,97,114,101,32,115,119,97,112,112,101,100,10,0,32,32,113,0,32,32,110,0,32,32,101,0,32,32,100,0,32,32,117,0,115,101,108,102,45,116,101,115,116,32,97,102,116,101,114,32,107,101,121,32,103,101,110,101,114,97,116,105,111,110,32,102,97,105,108,101,100,0,40,109,105,115,99,45,107,101,121,45,105,110,102,111,40,112,45,113,45,115,119,97,112,112,101,100,41,41,0,103,101,110,101,114,97,116,101,95,115,116,100,0,32,32,112,61,32,0,32,32,113,61,32,0,112,104,105,61,32,0,32,32,103,61,32,0,32,32,102,61,32,0,32,32,110,61,32,0,32,32,101,61,32,0,32,32,100,61,32,0,32,32,117,61,32,0,40,107,101,121,45,100,97,116,97,32,40,112,117,98,108,105,99,45,107,101,121,32,32,40,114,115,97,40,110,37,109,41,40,101,37,109,41,41,41,32,40,112,114,105,118,97,116,101,45,107,101,121,32,32,40,114,115,97,40,110,37,109,41,40,101,37,109,41,40,100,37,109,41,40,112,37,109,41,40,113,37,109,41,40,117,37,109,41,41,41,32,37,83,41,0,111,112,101,110,112,103,112,45,114,115,97,0,111,105,100,46,49,46,50,46,56,52,48,46,49,49,51,53,52,57,46,49,46,49,46,49,0,83,72,65,49,0,48,33,48,9,6,5,43,14,3,2,26,5,0,4,20,169,153,62,54,71,6,129,106,186,62,37,113,120,80,194,108,156,208,216,157,0,132,152,62,68,28,59,210,110,186,174,74,161,249,81,41,229,229,70,112,241,0,52,170,151,60,212,196,218,164,246,30,235,43,219,173,39,49,101,52,1,111,0,49,46,50,46,56,52,48,46,49,49,51,53,52,57,46,49,46,49,46,53,0,49,46,50,46,56,52,48,46,49,48,48,52,48,46,52,46,51,0,49,46,51,46,49,52,46,51,46,50,46,50,54,0,49,46,51,46,49,52,46,51,46,50,46,50,57,0,49,46,50,46,56,52,48,46,49,48,48,52,53,46,52,46,49,0,83,72,65,50,50,52,0,48,45,48,13,6,9,96,134,72,1,101,3,4,2,4,5,0,4,28,35,9,125,34,52,5,216,34,134,66,164,119,189,162,85,179,42,173,188,228,189,160,179,247,227,108,157,167,0,97,98,99,100,98,99,100,101,99,100,101,102,100,101,102,103,101,102,103,104,102,103,104,105,103,104,105,106,104,105,106,107,105,106,107,108,106,107,108,109,107,108,109,110,108,109,110,111,109,110,111,112,110,111,112,113,0,117,56,139,22,81,39,118,204,93,186,93,161,253,137,1,80,176,198,69,92,180,245,139,25,82,82,37,37,0,32,121,70,85,152,12,145,216,187,180,193,234,151,97,138,75,240,63,66,88,25,72,178,238,78,231,173,103,0,186,120,22,191,143,1,207,234,65,65,64,222,93,174,34,35,176,3,97,163,150,23,122,156,180,16,255,97,242,0,21,173,0,36,141,106,97,210,6,56,184,229,192,38,147,12,62,96,57,163,60,228,89,100,255,33,103,246,236,237,212,25,219,6,193,0,205,199,110,92,153,20,251,146,129,161,199,226,132,215,62,103,241,128,154,72,164,151,32,14,4,109,57,204,199,17,44,208,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,50,46,52,0,83,72,65,50,53,54,0,48,49,48,13,6,9,96,134,72,1,101,3,4,2,1,5,0,4,32,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,50,46,49,0,49,46,50,46,56,52,48,46,49,49,51,53,52,57,46,49,46,49,46,49,49,0,83,72,65,53,49,50,0,48,81,48,13,6,9,96,134,72,1,101,3,4,2,3,5,0,4,64,97,98,99,0,203,0,117,63,69,163,94,139,181,160,61,105,154,198,80,7,39,44,50,171,14,222,209,99,26,139,96,90,67,255,91,237,128,134,7,43,161,231,204,35,88,186,236,161,52,200,37,167,0,97,98,99,100,101,102,103,104,98,99,100,101,102,103,104,105,99,100,101,102,103,104,105,106,100,101,102,103,104,105,106,107,101,102,103,104,105,106,107,108,102,103,104,105,106,107,108,109,103,104,105,106,107,108,109,110,104,105,106,107,108,109,110,111,105,106,107,108,109,110,111,112,106,107,108,109,110,111,112,113,107,108,109,110,111,112,113,114,108,109,110,111,112,113,114,115,109,110,111,112,113,114,115,116,110,111,112,113,114,115,116,117,0,9,51,12,51,247,17,71,232,61,25,47,199,130,205,27,71,83,17,27,23,59,59,5,210,47,160,128,134,227,176,247,18,252,199,199,26,85,126,45,185,102,195,233,250,145,116,96,57,0,157,14,24,9,113,100,116,203,8,110,131,78,49,10,74,28,237,20,158,156,0,242,72,82,121,114,206,197,112,76,42,91,7,184,179,220,56,236,196,235,174,151,221,216,127,61,137,133,0,115,104,111,114,116,32,115,116,114,105,110,103,0,108,111,110,103,32,115,116,114,105,110,103,0,111,110,101,32,109,105,108,108,105,111,110,32,34,97,34,0,100,105,103,101,115,116,0,221,175,53,161,147,97,122,186,204,65,115,73,174,32,65,49,18,230,250,78,137,169,126,162,10,158,238,230,75,85,211,154,33,146,153,42,39,79,193,168,54,186,60,35,163,254,235,189,69,77,68,35,100,60,232,14,42,154,201,79,165,76,164,159,0,142,149,155,117,218,227,19,218,140,244,247,40,20,252,20,63,143,119,121,198,235,159,127,161,114,153,174,173,182,136,144,24,80,29,40,158,73,0,247,228,51,27,153,222,196,181,67,58,199,211,41,238,182,221,38,84,94,150,229,91,135,75,233,9,0,231,24,72,61,12,231,105,100,78,46,66,199,188,21,180,99,142,31,152,177,59,32,68,40,86,50,168,3,175,169,115,235,222,15,242,68,135,126,166,10,76,176,67,44,229,119,195,27,235,0,156,92,44,73,170,46,78,173,178,23,173,140,192,155,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,50,46,51,0,49,46,50,46,56,52,48,46,49,49,51,53,52,57,46,49,46,49,46,49,51,0,83,72,65,51,56,52,0,48,65,48,13,6,9,96,134,72,1,101,3,4,2,2,5,0,4,48,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,50,46,50,0,49,46,50,46,56,52,48,46,49,49,51,53,52,57,46,49,46,49,46,49,50,0,84,87,79,70,73,83,72,0,159,88,159,92,246,18,44,50,182,191,236,47,42,232,195,90,212,145,219,22,231,177,195,158,134,203,8,107,120,159,84,25,1,159,152,9,222,23,17,133,143,170,195,163,186,32,251,195,212,59,183,85,110,163,46,70,242,162,130,183,212,91,78,13,87,255,115,157,77,201,44,27,215,252,1,112,12,200,33,111,144,175,233,27,178,136,84,79,44,50,220,35,155,38,53,230,108,180,86,28,64,191,10,151,5,147,28,182,212,8,231,250,84,119,111,102,105,115,104,45,50,53,54,32,116,101,115,116,32,100,101,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,84,119,111,102,105,115,104,45,50,53,54,32,116,101,115,116,32,101,110,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,84,119,111,102,105,115,104,45,49,50,56,32,116,101,115,116,32,100,101,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,84,119,111,102,105,115,104,45,49,50,56,32,116,101,115,116,32,101,110,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,37,115,10,0,0,1,23,2,46,24,83,3,106,47,147,25,52,84,69,4,92,107,182,48,166,148,75,26,140,53,129,85,170,70,13,5,36,93,135,108,155,183,193,49,43,167,163,149,152,76,202,27,230,141,115,54,205,130,18,86,98,171,240,71,79,14,189,6,212,37,210,94,39,136,102,109,214,156,121,184,8,194,223,50,104,44,253,168,138,164,90,150,41,153,34,77,96,203,228,28,123,231,59,142,158,116,244,55,216,206,249,131,111,19,178,87,225,99,220,172,196,241,175,72,10,80,66,15,186,190,199,7,222,213,120,38,101,211,209,95,227,40,33,137,89,103,252,110,177,215,248,157,243,122,58,185,198,9,65,195,174,224,219,51,68,105,146,45,82,254,22,169,12,139,128,165,74,91,181,151,201,42,162,154,192,35,134,78,188,97,239,204,17,229,114,29,61,124,235,232,233,60,234,143,125,159,236,117,30,245,62,56,246,217,63,207,118,250,31,132,160,112,237,20,144,179,126,88,251,226,32,100,208,221,119,173,218,197,64,242,57,176,247,73,180,11,127,81,21,67,145,16,113,187,238,191,133,200,161,1,2,4,8,16,32,64,128,77,154,121,242,169,31,62,124,248,189,55,110,220,245,167,3,6,12,24,48,96,192,205,215,227,139,91,182,33,66,132,69,138,89,178,41,82,164,5,10,20,40,80,160,13,26,52,104,208,237,151,99,198,193,207,211,235,155,123,246,161,15,30,60,120,240,173,23,46,92,184,61,122,244,165,7,14,28,56,112,224,141,87,174,17,34,68,136,93,186,57,114,228,133,71,142,81,162,9,18,36,72,144,109,218,249,191,51,102,204,213,231,131,75,150,97,194,201,223,243,171,27,54,108,216,253,183,35,70,140,85,170,25,50,100,200,221,247,163,11,22,44,88,176,45,90,180,37,74,148,101,202,217,255,179,43,86,172,21,42,84,168,29,58,116,232,157,119,238,145,111,222,241,175,19,38,76,152,125,250,185,63,126,252,181,39,78,156,117,234,153,127,254,177,47,94,188,53,106,212,229,135,67,134,65,130,73,146,105,210,233,159,115,230,129,79,158,113,226,137,95,190,49,98,196,197,199,195,203,219,251,187,59,118,236,149,103,206,209,239,147,107,214,225,143,83,166,1,2,4,8,16,32,64,128,77,154,121,242,169,31,62,124,248,189,55,110,220,245,167,3,6,12,24,48,96,192,205,215,227,139,91,182,33,66,132,69,138,89,178,41,82,164,5,10,20,40,80,160,13,26,52,104,208,237,151,99,198,193,207,211,235,155,123,246,161,15,30,60,120,240,173,23,46,92,184,61,122,244,165,7,14,28,56,112,224,141,87,174,17,34,68,136,93,186,57,114,228,133,71,142,81,162,9,18,36,72,144,109,218,249,191,51,102,204,213,231,131,75,150,97,194,201,223,243,171,27,54,108,216,253,183,35,70,140,85,170,25,50,100,200,221,247,163,11,22,44,88,176,45,90,180,37,74,148,101,202,217,255,179,43,86,172,21,42,84,168,29,58,116,232,157,119,238,145,111,222,241,175,19,38,76,152,125,250,185,63,126,252,181,39,78,156,117,234,153,127,254,177,47,94,188,53,106,212,229,135,67,134,65,130,73,146,105,210,233,159,115,230,129,79,158,113,226,137,95,190,49,98,196,197,199,195,203,169,117,103,243,179,198,232,244,4,219,253,123,163,251,118,200,154,74,146,211,128,230,120,107,228,69,221,125,209,232,56,75,13,214,198,50,53,216,152,253,24,55,247,113,236,241,108,225,67,48,117,15,55,248,38,27,250,135,19,250,148,6,72,63,242,94,208,186,139,174,48,91,132,138,84,0,223,188,35,157,25,109,91,193,61,177,89,14,243,128,174,93,162,210,130,213,99,160,1,132,131,7,46,20,217,181,81,144,155,44,124,163,166,178,235,115,165,76,190,84,22,146,12,116,227,54,97,81,192,56,140,176,58,189,245,90,115,252,44,96,37,98,11,150,187,108,78,66,137,247,107,16,83,124,106,40,180,39,241,140,225,19,230,149,189,156,69,199,226,36,244,70,182,59,102,112,204,202,149,227,3,133,86,203,212,17,28,208,30,147,215,184,251,166,195,131,142,32,181,255,233,159,207,119,191,195,186,204,234,3,119,111,57,8,175,191,51,64,201,231,98,43,113,226,129,121,121,12,9,170,173,130,36,65,205,58,249,234,216,185,229,228,197,154,185,164,77,151,68,126,8,218,134,122,231,23,161,102,29,148,170,161,237,29,6,61,112,240,178,222,210,179,65,11,123,114,160,167,17,28,49,239,194,209,39,83,144,62,32,143,246,51,96,38,255,95,150,236,92,118,177,42,171,73,158,129,156,136,82,238,27,33,95,196,147,26,10,235,239,217,145,197,133,57,73,153,238,205,45,173,79,49,143,139,59,1,71,24,135,35,109,221,70,31,214,78,62,45,105,249,100,72,42,79,206,242,203,101,47,142,252,120,151,92,5,88,122,25,172,141,127,229,213,152,26,87,75,103,14,127,167,5,90,100,40,175,20,99,63,182,41,254,136,245,60,183,76,60,2,165,184,206,218,233,176,104,23,68,85,224,31,77,138,67,125,105,87,41,199,46,141,172,116,21,183,89,196,168,159,10,114,158,126,110,21,71,34,223,18,52,88,53,7,106,153,207,52,220,110,34,80,201,222,192,104,155,101,137,188,212,219,237,248,171,200,18,168,162,43,13,64,82,220,187,254,2,50,47,164,169,202,215,16,97,33,30,240,180,211,80,93,4,15,246,0,194,111,22,157,37,54,134,66,86,74,85,94,9,193,190,224,145,117,243,198,244,219,123,251,200,74,211,230,107,69,125,232,75,214,50,216,253,55,113,241,225,48,15,248,27,135,250,6,63,94,186,174,91,138,0,188,157,109,193,177,14,128,93,210,213,160,132,7,20,181,144,44,163,178,115,76,84,146,116,54,81,56,176,189,90,252,96,98,150,108,66,247,16,124,40,39,140,19,149,156,199,36,70,59,112,202,227,133,203,17,208,147,184,166,131,32,255,159,119,195,204,3,111,8,191,64,231,43,226,121,12,170,130,65,58,234,185,228,154,164,151,126,218,122,23,102,148,161,29,61,240,222,179,11,114,167,28,239,209,83,62,143,51,38,95,236,118,42,73,129,136,238,33,196,26,235,217,197,57,153,205,173,49,139,1,24,35,221,31,78,45,249,72,79,242,101,142,120,92,88,25,141,229,152,87,103,127,5,100,175,99,182,254,245,183,60,165,206,233,104,68,224,77,67,105,41,46,172,21,89,168,10,158,110,71,223,52,53,106,207,220,34,201,192,155,137,212,237,171,18,162,13,82,187,2,47,169,215,97,30,180,80,4,246,194,22,37,134,86,85,9,190,145,169,103,179,232,4,253,163,118,154,146,128,120,228,221,209,56,13,198,53,152,24,247,236,108,67,117,55,38,250,19,148,72,242,208,139,48,132,84,223,35,25,91,61,89,243,174,162,130,99,1,131,46,217,81,155,124,166,235,165,190,22,12,227,97,192,140,58,245,115,44,37,11,187,78,137,107,83,106,180,241,225,230,189,69,226,244,182,102,204,149,3,86,212,28,30,215,251,195,142,181,233,207,191,186,234,119,57,175,51,201,98,113,129,121,9,173,36,205,249,216,229,197,185,77,68,8,134,231,161,29,170,237,6,112,178,210,65,123,160,17,49,194,39,144,32,246,96,255,150,92,177,171,158,156,82,27,95,147,10,239,145,133,73,238,45,79,143,59,71,135,109,70,214,62,105,100,42,206,203,47,252,151,5,122,172,127,213,26,75,14,167,90,40,20,63,41,136,60,76,2,184,218,176,23,85,31,138,125,87,199,141,116,183,196,159,114,126,21,34,18,88,7,153,52,110,80,222,104,101,188,219,248,200,168,43,64,220,254,50,164,202,16,33,240,211,93,15,0,111,157,54,66,74,94,193,224,84,87,79,70,73,83,72,49,50,56,0,102,97,105,108,101,100,32,116,111,32,97,99,113,117,105,114,101,32,116,104,101,32,110,111,110,99,101,32,98,117,102,102,101,114,32,108,111,99,107,58,32,37,115,10,0,102,97,105,108,101,100,32,116,111,32,114,101,108,101,97,115,101,32,116,104,101,32,110,111,110,99,101,32,98,117,102,102,101,114,32,108,111,99,107,58,32,37,115,10,0,37,115,46,42,0,37,115,46,88,0,101,99,95,105,110,118,109,58,32,105,110,118,101,114,115,101,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,58,10,0,32,32,97,0,32,32,112,0,37,115,58,32,71,101,116,116,105,110,103,32,89,45,99,111,111,114,100,105,110,97,116,101,32,111,110,32,37,115,32,105,115,32,110,111,116,32,115,117,112,112,111,114,116,101,100,10,0,95,103,99,114,121,95,109,112,105,95,101,99,95,103,101,116,95,97,102,102,105,110,101,0,77,111,110,116,103,111,109,101,114,121,0,71,67,82,89,80,84,95,66,65,82,82,69,84,84,0,37,115,58,32,37,115,32,110,111,116,32,121,101,116,32,115,117,112,112,111,114,116,101,100,10,0,95,103,99,114,121,95,109,112,105,95,101,99,95,100,117,112,95,112,111,105,110,116,0,95,103,99,114,121,95,109,112,105,95,101,99,95,97,100,100,95,112,111,105,110,116,115,0,0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,33,98,112,95,109,97,114,107,101,114,0,109,112,105,45,112,111,119,46,99,0,95,103,99,114,121,95,109,112,105,95,112,111,119,109,0,114,101,115,45,62,100,32,61,61,32,114,112,0,105,32,61,61,32,110,108,105,109,98,115,0,109,112,105,99,111,100,101,114,46,99,0,95,103,99,114,121,95,109,112,105,95,115,101,116,95,98,117,102,102,101,114,0,58,103,101,110,101,114,105,99,47,109,112,105,104,45,97,100,100,49,46,99,58,103,101,110,101,114,105,99,47,109,112,105,104,45,115,117,98,49,46,99,58,103,101,110,101,114,105,99,47,109,112,105,104,45,109,117,108,49,46,99,58,103,101,110,101,114,105,99,47,109,112,105,104,45,109,117,108,50,46,99,58,103,101,110,101,114,105,99,47,109,112,105,104,45,109,117,108,51,46,99,58,103,101,110,101,114,105,99,47,109,112,105,104,45,108,115,104,105,102,116,46,99,58,103,101,110,101,114,105,99,47,109,112,105,104,45,114,115,104,105,102,116,46,99,0,87,97,114,110,105,110,103,58,32,116,114,121,105,110,103,32,116,111,32,99,104,97,110,103,101,32,97,110,32,105,109,109,117,116,97,98,108,101,32,77,80,73,10,0,105,110,118,97,108,105,100,32,102,108,97,103,32,118,97,108,117,101,32,105,110,32,109,112,105,95,102,114,101,101,10,0,109,112,105,95,103,101,116,95,111,112,97,113,117,101,32,111,110,32,110,111,114,109,97,108,32,109,112,105,10,0,109,112,105,95,115,101,116,95,99,111,110,100,58,32,100,105,102,102,101,114,101,110,116,32,115,105,122,101,115,10,0,109,112,105,95,115,119,97,112,95,99,111,110,100,58,32,100,105,102,102,101,114,101,110,116,32,115,105,122,101,115,10,0,105,110,118,97,108,105,100,32,102,108,97,103,32,118,97,108,117,101,10,0,105,110,118,97,108,105,100,32,109,112,105,95,99,111,110,115,116,32,115,101,108,101,99,116,111,114,32,37,100,10,0,77,80,73,32,115,117,98,115,121,115,116,101,109,32,110,111,116,32,105,110,105,116,105,97,108,105,122,101,100,10,0,10,10,84,104,105,115,32,105,115,32,76,105,98,103,99,114,121,112,116,32,49,46,55,46,48,45,98,101,116,97,50,51,48,32,45,32,84,104,101,32,71,78,85,32,67,114,121,112,116,111,32,76,105,98,114,97,114,121,10,67,111,112,121,114,105,103,104,116,32,40,67,41,32,50,48,48,48,45,50,48,49,50,32,70,114,101,101,32,83,111,102,116,119,97,114,101,32,70,111,117,110,100,97,116,105,111,110,44,32,73,110,99,46,10,67,111,112,121,114,105,103,104,116,32,40,67,41,32,50,48,49,50,45,50,48,49,52,32,103,49,48,32,67,111,100,101,32,71,109,98,72,10,67,111,112,121,114,105,103,104,116,32,40,67,41,32,50,48,49,51,45,50,48,49,52,32,74,117,115,115,105,32,75,105,118,105,108,105,110,110,97,10,10,40,97,51,54,101,101,55,53,48,32,50,48,49,55,45,48,51,45,49,48,84,50,49,58,51,54,43,48,48,48,48,41,10,10,10,0,99,105,112,104,101,114,45,99,109,97,99,46,99,0,99,109,97,99,95,103,101,110,101,114,97,116,101,95,115,117,98,107,101,121,115,0,99,45,62,117,110,117,115,101,100,32,60,32,98,108,111,99,107,115,105,122,101,0,99,105,112,104,101,114,45,99,116,114,46,99,0,95,103,99,114,121,95,99,105,112,104,101,114,95,99,116,114,95,101,110,99,114,121,112,116,0,117,110,117,115,101,100,32,61,61,32,98,108,111,99,107,115,105,122,101,0,99,105,112,104,101,114,45,103,99,109,46,99,0,100,111,95,103,104,97,115,104,95,98,117,102,0,115,101,108,102,116,101,115,116,32,102,111,114,32,67,66,67,32,102,97,105,108,101,100,32,45,32,115,101,101,32,115,121,115,108,111,103,32,102,111,114,32,100,101,116,97,105,108,115,0,115,101,116,107,101,121,32,102,97,105,108,101,100,0,102,97,105,108,101,100,32,116,111,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,0,115,101,108,102,116,101,115,116,32,102,111,114,32,67,70,66,32,102,97,105,108,101,100,32,45,32,115,101,101,32,115,121,115,108,111,103,32,102,111,114,32,100,101,116,97,105,108,115,0,115,101,108,102,116,101,115,116,32,102,111,114,32,67,84,82,32,102,97,105,108,101,100,32,45,32,115,101,101,32,115,121,115,108,111,103,32,102,111,114,32,100,101,116,97,105,108,115,0,69,67,67,0,112,97,98,103,110,104,113,0,112,97,98,103,110,104,113,100,0,115,119,0,114,115,0,102,108,97,103,115,0,112,63,97,63,98,63,103,63,110,63,104,63,47,113,0,112,63,97,63,98,63,103,63,110,63,104,63,113,0,47,113,0,113,0,99,117,114,118,101,0,112,97,98,103,110,104,113,40,49,58,37,99,37,117,58,0,41,0,112,0,101,99,99,95,118,101,114,105,102,121,32,100,97,116,97,0,47,114,115,0,101,99,99,95,118,101,114,105,102,121,32,32,115,95,114,0,101,99,99,95,118,101,114,105,102,121,32,32,115,95,115,0,45,112,63,97,63,98,63,103,63,110,63,104,63,47,113,0,43,69,100,68,83,65,0,101,99,99,95,118,101,114,105,102,121,32,105,110,102,111,58,32,37,115,47,37,115,37,115,10,0,101,99,99,95,118,101,114,105,102,121,32,110,97,109,101,58,32,37,115,10,0,101,99,99,95,118,101,114,105,102,121,32,32,32,32,112,0,101,99,99,95,118,101,114,105,102,121,32,32,32,32,97,0,101,99,99,95,118,101,114,105,102,121,32,32,32,32,98,0,101,99,99,95,118,101,114,105,102,121,32,32,103,0,101,99,99,95,118,101,114,105,102,121,32,32,32,32,110,0,101,99,99,95,118,101,114,105,102,121,32,32,32,32,104,0,101,99,99,95,118,101,114,105,102,121,32,32,32,32,113,0,71,111,111,100,0,101,99,99,95,118,101,114,105,102,121,32,32,32,32,61,62,32,37,115,10,0,101,99,99,95,115,105,103,110,32,32,32,100,97,116,97,0,45,112,63,97,63,98,63,103,63,110,63,104,63,47,113,63,43,100,0,47,113,63,43,100,0,101,99,99,95,115,105,103,110,32,32,32,105,110,102,111,58,32,37,115,47,37,115,37,115,10,0,101,99,99,95,115,105,103,110,32,32,32,110,97,109,101,58,32,37,115,10,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,112,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,97,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,98,0,101,99,99,95,115,105,103,110,32,32,32,32,103,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,110,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,104,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,113,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,100,0,40,115,105,103,45,118,97,108,40,101,100,100,115,97,40,114,37,77,41,40,115,37,77,41,41,41,0,40,115,105,103,45,118,97,108,40,103,111,115,116,40,114,37,77,41,40,115,37,77,41,41,41,0,40,115,105,103,45,118,97,108,40,101,99,100,115,97,40,114,37,77,41,40,115,37,77,41,41,41,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,61,62,32,37,115,10,0,101,0,101,99,99,95,100,101,99,114,121,112,116,32,32,100,95,101,0,45,112,63,97,63,98,63,103,63,110,63,104,63,43,100,0,101,99,99,95,100,101,99,114,121,112,116,32,105,110,102,111,58,32,37,115,47,37,115,10,0,101,99,99,95,100,101,99,114,121,112,116,32,110,97,109,101,58,32,37,115,10,0,101,99,99,95,100,101,99,114,121,112,116,32,32,32,32,112,0,101,99,99,95,100,101,99,114,121,112,116,32,32,32,32,97,0,101,99,99,95,100,101,99,114,121,112,116,32,32,32,32,98,0,101,99,99,95,100,101,99,114,121,112,116,32,32,103,0,101,99,99,95,100,101,99,114,121,112,116,32,32,32,32,110,0,101,99,99,95,100,101,99,114,121,112,116,32,32,32,32,104,0,101,99,99,95,100,101,99,114,121,112,116,32,32,32,32,100,0,101,99,100,104,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,10,0,101,99,99,95,100,101,99,114,121,112,116,32,32,114,101,115,0,40,118,97,108,117,101,32,37,109,41,0,101,99,99,95,100,101,99,114,121,112,116,32,32,32,32,61,62,32,37,115,10,0,101,99,99,95,101,110,99,114,121,112,116,32,100,97,116,97,0,45,112,63,97,63,98,63,103,63,110,63,104,63,43,113,0,101,99,99,95,101,110,99,114,121,112,116,32,105,110,102,111,58,32,37,115,47,37,115,10,0,101,99,99,95,101,110,99,114,121,112,116,32,110,97,109,101,58,32,37,115,10,0,101,99,99,95,101,110,99,114,121,112,116,32,32,32,32,112,0,101,99,99,95,101,110,99,114,121,112,116,32,32,32,32,97,0,101,99,99,95,101,110,99,114,121,112,116,32,32,32,32,98,0,101,99,99,95,101,110,99,114,121,112,116,32,32,103,0,101,99,99,95,101,110,99,114,121,112,116,32,32,32,32,110,0,101,99,99,95,101,110,99,114,121,112,116,32,32,32,32,104,0,101,99,99,95,101,110,99,114,121,112,116,32,32,32,32,113,0,101,99,100,104,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,32,102,111,114,32,107,100,71,10,0,101,99,100,104,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,32,102,111,114,32,107,71,10,0,40,101,110,99,45,118,97,108,40,101,99,100,104,40,115,37,109,41,40,101,37,109,41,41,41,0,101,99,99,95,101,110,99,114,121,112,116,32,32,32,32,61,62,32,37,115,10,0,101,99,99,95,116,101,115,116,107,101,121,32,105,110,102,58,32,37,115,47,37,115,10,0,101,99,99,95,116,101,115,116,107,101,121,32,110,97,109,58,32,37,115,10,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,112,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,97,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,98,0,101,99,99,95,116,101,115,116,107,101,121,32,103,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,110,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,104,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,113,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,100,0,66,97,100,32,99,104,101,99,107,58,32,80,111,105,110,116,32,39,71,39,32,100,111,101,115,32,110,111,116,32,98,101,108,111,110,103,32,116,111,32,99,117,114,118,101,32,39,69,39,33,10,0,66,97,100,32,99,104,101,99,107,58,32,39,71,39,32,99,97,110,110,111,116,32,98,101,32,80,111,105,110,116,32,97,116,32,73,110,102,105,110,105,116,121,33,10,0,99,104,101,99,107,95,115,101,99,114,101,116,95,107,101,121,58,32,69,32,105,115,32,110,111,116,32,97,32,99,117,114,118,101,32,111,102,32,111,114,100,101,114,32,110,10,0,66,97,100,32,99,104,101,99,107,58,32,81,32,99,97,110,32,110,111,116,32,98,101,32,97,32,80,111,105,110,116,32,97,116,32,73,110,102,105,110,105,116,121,33,10,0,66,97,100,32,99,104,101,99,107,58,32,99,111,109,112,117,116,97,116,105,111,110,32,111,102,32,100,71,32,102,97,105,108,101,100,10,0,66,97,100,32,99,104,101,99,107,58,32,84,104,101,114,101,32,105,115,32,78,79,32,99,111,114,114,101,115,112,111,110,100,101,110,99,101,32,98,101,116,119,101,101,110,32,39,100,39,32,97,110,100,32,39,81,39,33,10,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,61,62,32,37,115,10,0,116,114,97,110,115,105,101,110,116,45,107,101,121,0,101,99,103,101,110,32,99,117,114,118,101,32,105,110,102,111,58,32,37,115,47,37,115,10,0,101,99,103,101,110,32,99,117,114,118,101,32,117,115,101,100,58,32,37,115,10,0,101,99,103,101,110,32,99,117,114,118,101,32,32,32,112,0,101,99,103,101,110,32,99,117,114,118,101,32,32,32,97,0,101,99,103,101,110,32,99,117,114,118,101,32,32,32,98,0,101,99,103,101,110,32,99,117,114,118,101,32,32,32,110,0,101,99,103,101,110,32,99,117,114,118,101,32,32,32,104,0,101,99,103,101,110,32,99,117,114,118,101,32,71,0,101,99,103,101,110,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,32,102,111,114,32,37,115,10,0,81,0,101,99,103,101,110,32,99,111,110,118,101,114,116,101,100,32,81,32,116,111,32,97,32,99,111,109,112,108,105,97,110,116,32,112,111,105,110,116,10,0,101,99,103,101,110,32,100,105,100,110,39,116,32,110,101,101,100,32,116,111,32,99,111,110,118,101,114,116,32,81,32,116,111,32,97,32,99,111,109,112,108,105,97,110,116,32,112,111,105,110,116,10,0,84,101,115,116,105,110,103,32,107,101,121,46,10,0,69,67,68,83,65,32,111,112,101,114,97,116,105,111,110,58,32,115,105,103,110,32,102,97,105,108,101,100,10,0,69,67,68,83,65,32,111,112,101,114,97,116,105,111,110,58,32,115,105,103,110,44,32,118,101,114,105,102,121,32,102,97,105,108,101,100,10,0,69,67,68,83,65,32,111,112,101,114,97,116,105,111,110,58,32,115,105,103,110,44,32,118,101,114,105,102,121,32,111,107,46,10,0,101,99,100,104,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,32,102,111,114,32,104,107,81,10,0,101,99,100,104,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,32,102,111,114,32,104,100,107,71,10,0,69,67,68,72,32,116,101,115,116,32,102,97,105,108,101,100,46,10,0,71,0,40,99,117,114,118,101,32,37,115,41,0,40,102,108,97,103,115,32,112,97,114,97,109,41,0,40,102,108,97,103,115,32,101,100,100,115,97,41,0,40,102,108,97,103,115,32,112,97,114,97,109,32,101,100,100,115,97,41,0,40,107,101,121,45,100,97,116,97,32,40,112,117,98,108,105,99,45,107,101,121,32,32,40,101,99,99,37,83,37,83,40,112,37,109,41,40,97,37,109,41,40,98,37,109,41,40,103,37,109,41,40,110,37,109,41,40,104,37,109,41,40,113,37,109,41,41,41,32,40,112,114,105,118,97,116,101,45,107,101,121,32,32,40,101,99,99,37,83,37,83,40,112,37,109,41,40,97,37,109,41,40,98,37,109,41,40,103,37,109,41,40,110,37,109,41,40,104,37,109,41,40,113,37,109,41,40,100,37,109,41,41,41,32,41,0,40,107,101,121,45,100,97,116,97,32,40,112,117,98,108,105,99,45,107,101,121,32,32,40,101,99,99,37,83,37,83,40,113,37,109,41,41,41,32,40,112,114,105,118,97,116,101,45,107,101,121,32,32,40,101,99,99,37,83,37,83,40,113,37,109,41,40,100,37,109,41,41,41,32,41,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,112,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,97,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,98,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,71,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,110,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,104,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,81,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,100,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,117,115,105,110,103,32,69,100,50,53,53,49,57,43,69,100,68,83,65,10,0,101,99,99,0,101,99,100,115,97,0,101,99,100,104,0,101,100,100,115,97,0,103,111,115,116,0,100,105,103,101,115,116,32,109,105,115,109,97,116,99,104,0,105,110,118,97,108,105,100,32,68,65,84,65,77,79,68,69,0,100,105,103,101,115,116,32,115,105,122,101,32,100,111,101,115,32,110,111,116,32,109,97,116,99,104,32,101,120,112,101,99,116,101,100,32,115,105,122,101,0,103,99,114,121,95,109,100,95,111,112,101,110,32,102,97,105,108,101,100,0,104,97,115,104,45,99,111,109,109,111,110,46,99,0,95,103,99,114,121,95,109,100,95,98,108,111,99,107,95,119,114,105,116,101,0,238,166,167,37,28,30,114,145,109,17,194,203,33,77,60,37,37,57,18,29,142,35,78,101,45,101,31,164,200,207,248,128,142,153,59,159,72,104,18,115,194,150,80,186,50,252,118,206,72,51,46,167,22,77,150,164,71,111,184,197,49,161,24,106,192,223,193,124,152,220,232,123,77,167,240,17,236,72,201,114,113,210,194,15,155,146,143,226,39,13,111,184,99,213,23,56,180,142,238,227,20,167,204,138,185,50,22,69,72,229,38,174,144,34,67,104,81,122,207,234,189,107,179,115,43,192,233,218,153,131,43,97,202,1,182,222,86,36,74,158,136,213,249,179,121,115,246,34,164,61,20,166,89,155,31,101,76,180,90,116,227,85,165,243,255,199,112,63,148,0,229,42,125,251,75,61,51,5,217,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,255,254,253,252,251,250,249,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,100,175,226,232,214,173,123,189,210,135,249,124,68,98,61,57,80,111,108,121,49,51,48,53,32,116,101,115,116,32,52,32,102,97,105,108,101,100,46,0,80,111,108,121,49,51,48,53,32,116,101,115,116,32,49,32,102,97,105,108,101,100,46,0,80,111,108,121,49,51,48,53,32,116,101,115,116,32,50,32,102,97,105,108,101,100,46,0,80,111,108,121,49,51,48,53,32,116,101,115,116,32,51,32,102,97,105,108,101,100,46,0,80,111,108,121,49,51,48,53,32,115,101,108,102,116,101,115,116,32,102,97,105,108,101,100,32,40,37,115,41,10,0,102,97,105,108,101,100,32,116,111,32,97,99,113,117,105,114,101,32,116,104,101,32,112,111,111,108,32,108,111,99,107,58,32,37,115,10,0,110,111,32,101,110,116,114,111,112,121,32,103,97,116,104,101,114,105,110,103,32,109,111,100,117,108,101,32,100,101,116,101,99,116,101,100,10,0,102,97,105,108,101,100,32,116,111,32,114,101,108,101,97,115,101,32,116,104,101,32,112,111,111,108,32,108,111,99,107,58,32,37,115,10,0,32,40,104,119,114,110,103,32,102,97,105,108,101,100,41,0,114,97,110,100,111,109,32,117,115,97,103,101,58,32,112,111,111,108,115,105,122,101,61,37,100,32,109,105,120,101,100,61,37,108,117,32,112,111,108,108,115,61,37,108,117,47,37,108,117,32,97,100,100,101,100,61,37,108,117,47,37,108,117,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,111,117,116,109,105,120,61,37,108,117,32,103,101,116,108,118,108,49,61,37,108,117,47,37,108,117,32,103,101,116,108,118,108,50,61,37,108,117,47,37,108,117,37,115,10,0,112,111,111,108,95,105,115,95,108,111,99,107,101,100,0,114,97,110,100,111,109,45,99,115,112,114,110,103,46,99,0,109,105,120,95,112,111,111,108,0,114,101,97,100,95,112,111,111,108,0,97,100,100,95,114,97,110,100,111,109,110,101,115,115,0,116,111,111,32,109,97,110,121,32,114,97,110,100,111,109,32,98,105,116,115,32,114,101,113,117,101,115,116,101,100,10,0,99,97,110,39,116,32,111,112,101,110,32,96,37,115,39,58,32,37,115,10,0,99,97,110,39,116,32,115,116,97,116,32,96,37,115,39,58,32,37,115,10,0,96,37,115,39,32,105,115,32,110,111,116,32,97,32,114,101,103,117,108,97,114,32,102,105,108,101,32,45,32,105,103,110,111,114,101,100,10,0,110,111,116,101,58,32,114,97,110,100,111,109,95,115,101,101,100,32,102,105,108,101,32,105,115,32,101,109,112,116,121,10,0,119,97,114,110,105,110,103,58,32,105,110,118,97,108,105,100,32,115,105,122,101,32,111,102,32,114,97,110,100,111,109,95,115,101,101,100,32,102,105,108,101,32,45,32,110,111,116,32,117,115,101,100,10,0,99,97,110,39,116,32,114,101,97,100,32,96,37,115,39,58,32,37,115,10,0,83,108,111,119,32,101,110,116,114,111,112,121,32,103,97,116,104,101,114,105,110,103,32,109,111,100,117,108,101,32,110,111,116,32,121,101,116,32,105,110,105,116,105,97,108,105,122,101,100,10,0,78,111,32,119,97,121,32,116,111,32,103,97,116,104,101,114,32,101,110,116,114,111,112,121,32,102,111,114,32,116,104,101,32,82,78,71,10,0,100,111,95,102,97,115,116,95,114,97,110,100,111,109,95,112,111,108,108,0,99,97,110,39,116,32,108,111,99,107,32,96,37,115,39,58,32,37,115,10,0,119,97,105,116,105,110,103,32,102,111,114,32,108,111,99,107,32,111,110,32,96,37,115,39,46,46,46,10,0,95,103,99,114,121,95,114,110,103,99,115,112,114,110,103,95,115,101,116,95,115,101,101,100,95,102,105,108,101,0,110,111,116,101,58,32,114,97,110,100,111,109,95,115,101,101,100,32,102,105,108,101,32,110,111,116,32,117,112,100,97,116,101,100,10,0,99,97,110,39,116,32,99,114,101,97,116,101,32,96,37,115,39,58,32,37,115,10,0,99,97,110,39,116,32,119,114,105,116,101,32,96,37,115,39,58,32,37,115,10,0,99,97,110,39,116,32,99,108,111,115,101,32,96,37,115,39,58,32,37,115,10,0,102,97,105,108,101,100,32,116,111,32,97,99,113,117,105,114,101,32,116,104,101,32,82,78,71,32,108,111,99,107,58,32,37,115,10,0,33,110,111,110,99,101,95,99,111,110,116,101,120,116,45,62,116,101,115,116,95,100,116,95,112,116,114,0,114,97,110,100,111,109,45,102,105,112,115,46,99,0,95,103,99,114,121,95,114,110,103,102,105,112,115,95,105,110,105,116,105,97,108,105,122,101,0,33,115,116,100,95,114,110,103,95,99,111,110,116,101,120,116,45,62,116,101,115,116,95,100,116,95,112,116,114,0,33,115,116,114,111,110,103,95,114,110,103,95,99,111,110,116,101,120,116,45,62,116,101,115,116,95,100,116,95,112,116,114,0,109,101,109,111,114,121,32,99,111,114,114,117,112,116,105,111,110,32,100,101,116,101,99,116,101,100,32,105,110,32,82,78,71,32,99,111,110,116,101,120,116],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+40960);allocate([32,37,112,10,0,102,97,105,108,101,100,32,116,111,32,114,101,108,101,97,115,101,32,116,104,101,32,82,78,71,32,108,111,99,107,58,32,37,115,10,0,114,110,103,95,99,116,120,0,102,111,114,107,32,119,105,116,104,111,117,116,32,112,114,111,112,101,114,32,114,101,45,105,110,105,116,105,97,108,105,122,97,116,105,111,110,32,100,101,116,101,99,116,101,100,32,105,110,32,82,78,71,0,115,101,118,101,114,101,32,101,114,114,111,114,32,103,101,116,116,105,110,103,32,114,97,110,100,111,109,10,0,102,105,112,115,95,114,110,103,95,105,115,95,108,111,99,107,101,100,0,120,57,51,49,95,97,101,115,95,100,114,105,118,101,114,0,114,110,103,95,99,116,120,45,62,99,105,112,104,101,114,95,104,100,0,114,110,103,95,99,116,120,45,62,105,115,95,115,101,101,100,101,100,0,116,101,109,112,118,97,108,117,101,95,102,111,114,95,120,57,51,49,95,97,101,115,95,100,114,105,118,101,114,0,120,57,51,49,95,103,101,116,95,100,116,0,103,101,116,116,105,109,101,111,102,100,97,121,40,41,32,102,97,105,108,101,100,58,32,37,115,10,0,65,69,83,32,101,110,99,114,121,112,116,105,111,110,32,105,110,32,82,78,71,32,102,97,105,108,101,100,58,32,37,115,10,0,100,117,112,108,105,99,97,116,101,32,49,50,56,32,98,105,116,32,98,108,111,99,107,32,114,101,116,117,114,110,101,100,32,98,121,32,82,78,71,0,120,57,51,49,95,114,101,115,101,101,100,0,33,101,110,116,114,111,112,121,95,99,111,108,108,101,99,116,95,98,117,102,102,101,114,0,103,101,116,95,101,110,116,114,111,112,121,0,101,114,114,111,114,32,103,101,116,116,105,110,103,32,101,110,116,114,111,112,121,32,100,97,116,97,10,0,101,110,116,114,111,112,121,95,99,111,108,108,101,99,116,95,99,98,0,101,110,116,114,111,112,121,95,99,111,108,108,101,99,116,95,98,117,102,102,101,114,0,120,57,51,49,95,103,101,110,101,114,97,116,101,95,107,101,121,0,101,114,114,111,114,32,99,114,101,97,116,105,110,103,32,99,105,112,104,101,114,32,99,111,110,116,101,120,116,32,102,111,114,32,82,78,71,58,32,37,115,10,0,101,114,114,111,114,32,99,114,101,97,116,105,110,103,32,107,101,121,32,102,111,114,32,82,78,71,58,32,37,115,10,0,115,101,108,102,116,101,115,116,95,107,97,116,0,185,202,127,214,160,245,211,66,25,109,132,145,118,28,59,190,72,178,130,152,104,194,128,0,0,0,40,24,0,0,37,0,82,23,141,41,162,213,132,18,157,137,154,69,130,2,247,119,66,156,8,61,130,244,138,64,102,181,73,39,171,66,199,195,14,183,97,60,254,176,190,115,247,110,109,111,29,163,20,250,187,75,193,14,197,251,205,70,190,40,97,231,3,43,55,125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,247,149,189,74,82,226,158,215,19,211,19,250,32,233,141,188,200,209,229,17,89,82,247,250,55,56,180,197,206,178,176,154,13,156,197,13,22,225,188,237,207,96,98,9,157,32,131,126,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,128,0,129,1,130,2,131,3,160,32,161,33,162,34,163,35,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,150,237,204,195,221,4,127,117,99,25,55,111,21,34,87,86,122,20,118,119,149,23,126,200,146,232,221,21,203,31,188,177,37,62,46,162,65,27,221,245,33,72,65,113,179,141,47,76,88,57,46,51,49,32,82,78,71,32,99,111,114,101,32,102,117,110,99,116,105,111,110,32,102,97,105,108,101,100,0,82,78,71,32,111,117,116,112,117,116,32,100,111,101,115,32,110,111,116,32,109,97,116,99,104,32,107,110,111,119,110,32,118,97,108,117,101,0,101,114,114,111,114,32,99,114,101,97,116,105,110,103,32,99,105,112,104,101,114,32,99,111,110,116,101,120,116,32,102,111,114,32,82,78,71,0,101,114,114,111,114,32,115,101,116,116,105,110,103,32,107,101,121,32,102,111,114,32,82,78,71,0,102,111,114,107,32,100,101,116,101,99,116,105,111,110,32,102,97,105,108,101,100,0,114,97,110,100,111,109,0,75,65,84,0,102,97,105,108,101,100,32,116,111,32,97,99,113,117,105,114,101,32,116,104,101,32,83,121,115,116,101,109,32,82,78,71,32,108,111,99,107,58,32,37,115,10,0,102,97,105,108,101,100,32,116,111,32,114,101,108,101,97,115,101,32,116,104,101,32,83,121,115,116,101,109,32,82,78,71,32,108,111,99,107,58,32,37,115,10,0,98,117,102,102,101,114,0,114,97,110,100,111,109,45,115,121,115,116,101,109,46,99,0,103,101,116,95,114,97,110,100,111,109,0,101,114,114,111,114,32,114,101,97,100,105,110,103,32,114,97,110,100,111,109,32,102,114,111,109,32,115,121,115,116,101,109,32,82,78,71,32,40,114,99,61,37,100,41,10,0,115,121,115,116,101,109,95,114,110,103,95,105,115,95,108,111,99,107,101,100,0,114,101,97,100,95,99,98,0,114,101,97,100,95,99,98,95,98,117,102,102,101,114,0,47,100,101,118,47,114,97,110,100,111,109,0,47,100,101,118,47,117,114,97,110,100,111,109,0,110,101,101,100,95,101,110,116,114,111,112,121,0,115,101,108,101,99,116,40,41,32,101,114,114,111,114,58,32,37,115,10,0,98,111,103,117,115,32,114,101,97,100,32,102,114,111,109,32,114,97,110,100,111,109,32,100,101,118,105,99,101,32,40,110,61,37,100,41,10,0,114,101,97,100,32,101,114,114,111,114,32,111,110,32,114,97,110,100,111,109,32,100,101,118,105,99,101,58,32,37,115,10,0,111,112,101,110,95,100,101,118,95,114,97,110,100,111,109,0,119,97,105,116,95,100,101,118,95,114,97,110,100,111,109,0,99,97,110,39,116,32,111,112,101,110,32,37,115,58,32,37,115,10,0,101,114,114,111,114,32,115,101,116,116,105,110,103,32,70,68,95,67,76,79,69,88,69,67,32,111,110,32,102,100,32,37,100,58,32,37,115,10,0,99,104,111,111,115,105,110,103,32,97,32,114,97,110,100,111,109,32,107,32,111,102,32,37,117,32,98,105,116,115,32,97,116,32,115,101,99,108,101,118,101,108,32,37,100,10,0,9,107,32,116,111,111,32,108,97,114,103,101,32,45,32,97,103,97,105,110,10,0,9,107,32,105,115,32,122,101,114,111,32,45,32,97,103,97,105,110,10,0,1,0,101,99,100,115,97,32,115,105,103,110,32,104,97,115,104,32,32,0,101,99,100,115,97,32,115,105,103,110,32,114,101,115,117,108,116,32,114,32,0,101,99,100,115,97,32,115,105,103,110,32,114,101,115,117,108,116,32,115,32,0,103,111,115,116,32,115,105,103,110,32,104,97,115,104,32,32,0,101,99,99,32,115,105,103,110,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,10,0,103,111,115,116,32,115,105,103,110,32,114,101,115,117,108,116,32,114,32,0,103,111,115,116,32,115,105,103,110,32,114,101,115,117,108,116,32,115,32,0,101,99,99,32,118,101,114,105,102,121,58,32,82,101,106,101,99,116,101,100,10,0,101,99,99,32,118,101,114,105,102,121,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,10,0,32,32,32,32,32,120,0,32,32,32,32,32,114,0,32,32,32,32,32,115,0,101,99,99,32,118,101,114,105,102,121,58,32,78,111,116,32,118,101,114,105,102,105,101,100,10,0,101,99,99,32,118,101,114,105,102,121,58,32,65,99,99,101,112,116,101,100,10,0,33,34,108,111,99,107,32,65,66,73,32,118,101,114,115,105,111,110,34,0,112,111,115,105,120,45,108,111,99,107,46,99,0,103,101,116,95,108,111,99,107,95,111,98,106,101,99,116,0,115,116,114,101,97,109,45,62,102,108,97,103,115,46,119,114,105,116,105,110,103,0,101,115,116,114,101,97,109,46,99,0,101,115,95,102,108,117,115,104,0,83,117,99,99,101,115,115,0,71,101,110,101,114,97,108,32,101,114,114,111,114,0,85,110,107,110,111,119,110,32,112,97,99,107,101,116,0,85,110,107,110,111,119,110,32,118,101,114,115,105,111,110,32,105,110,32,112,97,99,107,101,116,0,73,110,118,97,108,105,100,32,112,117,98,108,105,99,32,107,101,121,32,97,108,103,111,114,105,116,104,109,0,73,110,118,97,108,105,100,32,100,105,103,101,115,116,32,97,108,103,111,114,105,116,104,109,0,66,97,100,32,112,117,98,108,105,99,32,107,101,121,0,66,97,100,32,115,101,99,114,101,116,32,107,101,121,0,66,97,100,32,115,105,103,110,97,116,117,114,101,0,78,111,32,112,117,98,108,105,99,32,107,101,121,0,67,104,101,99,107,115,117,109,32,101,114,114,111,114,0,66,97,100,32,112,97,115,115,112,104,114,97,115,101,0,73,110,118,97,108,105,100,32,99,105,112,104,101,114,32,97,108,103,111,114,105,116,104,109,0,75,101,121,114,105,110,103,32,111,112,101,110,0,73,110,118,97,108,105,100,32,112,97,99,107,101,116,0,73,110,118,97,108,105,100,32,97,114,109,111,114,0,78,111,32,117,115,101,114,32,73,68,0,78,111,32,115,101,99,114,101,116,32,107,101,121,0,87,114,111,110,103,32,115,101,99,114,101,116,32,107,101,121,32,117,115,101,100,0,66,97,100,32,115,101,115,115,105,111,110,32,107,101,121,0,85,110,107,110,111,119,110,32,99,111,109,112,114,101,115,115,105,111,110,32,97,108,103,111,114,105,116,104,109,0,78,117,109,98,101,114,32,105,115,32,110,111,116,32,112,114,105,109,101,0,73,110,118,97,108,105,100,32,101,110,99,111,100,105,110,103,32,109,101,116,104,111,100,0,73,110,118,97,108,105,100,32,101,110,99,114,121,112,116,105,111,110,32,115,99,104,101,109,101,0,73,110,118,97,108,105,100,32,115,105,103,110,97,116,117,114,101,32,115,99,104,101,109,101,0,73,110,118,97,108,105,100,32,97,116,116,114,105,98,117,116,101,0,78,111,32,118,97,108,117,101,0,78,111,116,32,102,111,117,110,100,0,86,97,108,117,101,32,110,111,116,32,102,111,117,110,100,0,83,121,110,116,97,120,32,101,114,114,111,114,0,66,97,100,32,77,80,73,32,118,97,108,117,101,0,73,110,118,97,108,105,100,32,112,97,115,115,112,104,114,97,115,101,0,73,110,118,97,108,105,100,32,115,105,103,110,97,116,117,114,101,32,99,108,97,115,115,0,82,101,115,111,117,114,99,101,115,32,101,120,104,97,117,115,116,101,100,0,73,110,118,97,108,105,100,32,107,101,121,114,105,110,103,0,84,114,117,115,116,32,68,66,32,101,114,114,111,114,0,66,97,100,32,99,101,114,116,105,102,105,99,97,116,101,0,73,110,118,97,108,105,100,32,117,115,101,114,32,73,68,0,85,110,101,120,112,101,99,116,101,100,32,101,114,114,111,114,0,84,105,109,101,32,99,111,110,102,108,105,99,116,0,75,101,121,115,101,114,118,101,114,32,101,114,114,111,114,0,87,114,111,110,103,32,112,117,98,108,105,99,32,107,101,121,32,97,108,103,111,114,105,116,104,109,0,84,114,105,98,117,116,101,32,116,111,32,68,46,32,65,46,0,87,101,97,107,32,101,110,99,114,121,112,116,105,111,110,32,107,101,121,0,73,110,118,97,108,105,100,32,107,101,121,32,108,101,110,103,116,104,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,83,121,110,116,97,120,32,101,114,114,111,114,32,105,110,32,85,82,73,0,73,110,118,97,108,105,100,32,85,82,73,0,78,101,116,119,111,114,107,32,101,114,114,111,114,0,85,110,107,110,111,119,110,32,104,111,115,116,0,83,101,108,102,116,101,115,116,32,102,97,105,108,101,100,0,68,97,116,97,32,110,111,116,32,101,110,99,114,121,112,116,101,100,0,68,97,116,97,32,110,111,116,32,112,114,111,99,101,115,115,101,100,0,85,110,117,115,97,98,108,101,32,112,117,98,108,105,99,32,107,101,121,0,85,110,117,115,97,98,108,101,32,115,101,99,114,101,116,32,107,101,121,0,73,110,118,97,108,105,100,32,118,97,108,117,101,0,66,97,100,32,99,101,114,116,105,102,105,99,97,116,101,32,99,104,97,105,110,0,77,105,115,115,105,110,103,32,99,101,114,116,105,102,105,99,97,116,101,0,78,111,32,100,97,116,97,0,66,117,103,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,73,110,118,97,108,105,100,32,111,112,101,114,97,116,105,111,110,32,99,111,100,101,0,84,105,109,101,111,117,116,0,73,110,116,101,114,110,97,108,32,101,114,114,111,114,0,69,79,70,32,40,103,99,114,121,112,116,41,0,73,110,118,97,108,105,100,32,111,98,106,101,99,116,0,80,114,111,118,105,100,101,100,32,111,98,106,101,99,116,32,105,115,32,116,111,111,32,115,104,111,114,116,0,80,114,111,118,105,100,101,100,32,111,98,106,101,99,116,32,105,115,32,116,111,111,32,108,97,114,103,101,0,77,105,115,115,105,110,103,32,105,116,101,109,32,105,110,32,111,98,106,101,99,116,0,78,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,67,111,110,102,108,105,99,116,105,110,103,32,117,115,101,0,73,110,118,97,108,105,100,32,99,105,112,104,101,114,32,109,111,100,101,0,73,110,118,97,108,105,100,32,102,108,97,103,0,73,110,118,97,108,105,100,32,104,97,110,100,108,101,0,82,101,115,117,108,116,32,116,114,117,110,99,97,116,101,100,0,73,110,99,111,109,112,108,101,116,101,32,108,105,110,101,0,73,110,118,97,108,105,100,32,114,101,115,112,111,110,115,101,0,78,111,32,97,103,101,110,116,32,114,117,110,110,105,110,103,0,65,103,101,110,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,100,97,116,97,0,85,110,115,112,101,99,105,102,105,99,32,65,115,115,117,97,110,32,115,101,114,118,101,114,32,102,97,117,108,116,0,71,101,110,101,114,97,108,32,65,115,115,117,97,110,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,115,101,115,115,105,111,110,32,107,101,121,0,73,110,118,97,108,105,100,32,83,45,101,120,112,114,101,115,115,105,111,110,0,85,110,115,117,112,112,111,114,116,101,100,32,97,108,103,111,114,105,116,104,109,0,78,111,32,112,105,110,101,110,116,114,121,0,112,105,110,101,110,116,114,121,32,101,114,114,111,114,0,66,97,100,32,80,73,78,0,73,110,118,97,108,105,100,32,110,97,109,101,0,66,97,100,32,100,97,116,97,0,73,110,118,97,108,105,100,32,112,97,114,97,109,101,116,101,114,0,87,114,111,110,103,32,99,97,114,100,0,78,111,32,100,105,114,109,110,103,114,0,100,105,114,109,110,103,114,32,101,114,114,111,114,0,67,101,114,116,105,102,105,99,97,116,101,32,114,101,118,111,107,101,100,0,78,111,32,67,82,76,32,107,110,111,119,110,0,67,82,76,32,116,111,111,32,111,108,100,0,76,105,110,101,32,116,111,111,32,108,111,110,103,0,78,111,116,32,116,114,117,115,116,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,108,101,100,0,66,97,100,32,67,65,32,99,101,114,116,105,102,105,99,97,116,101,0,67,101,114,116,105,102,105,99,97,116,101,32,101,120,112,105,114,101,100,0,67,101,114,116,105,102,105,99,97,116,101,32,116,111,111,32,121,111,117,110,103,0,85,110,115,117,112,112,111,114,116,101,100,32,99,101,114,116,105,102,105,99,97,116,101,0,85,110,107,110,111,119,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,85,110,115,117,112,112,111,114,116,101,100,32,112,114,111,116,101,99,116,105,111,110,0,67,111,114,114,117,112,116,101,100,32,112,114,111,116,101,99,116,105,111,110,0,65,109,98,105,103,117,111,117,115,32,110,97,109,101,0,67,97,114,100,32,101,114,114,111,114,0,67,97,114,100,32,114,101,115,101,116,32,114,101,113,117,105,114,101,100,0,67,97,114,100,32,114,101,109,111,118,101,100,0,73,110,118,97,108,105,100,32,99,97,114,100,0,67,97,114,100,32,110,111,116,32,112,114,101,115,101,110,116,0,78,111,32,80,75,67,83,49,53,32,97,112,112,108,105,99,97,116,105,111,110,0,78,111,116,32,99,111,110,102,105,114,109,101,100,0,67,111,110,102,105,103,117,114,97,116,105,111,110,32,101,114,114,111,114,0,78,111,32,112,111,108,105,99,121,32,109,97,116,99,104,0,73,110,118,97,108,105,100,32,105,110,100,101,120,0,73,110,118,97,108,105,100,32,73,68,0,78,111,32,83,109,97,114,116,67,97,114,100,32,100,97,101,109,111,110,0,83,109,97,114,116,67,97,114,100,32,100,97,101,109,111,110,32,101,114,114,111,114,0,85,110,115,117,112,112,111,114,116,101,100,32,112,114,111,116,111,99,111,108,0,66,97,100,32,80,73,78,32,109,101,116,104,111,100,0,67,97,114,100,32,110,111,116,32,105,110,105,116,105,97,108,105,122,101,100,0,85,110,115,117,112,112,111,114,116,101,100,32,111,112,101,114,97,116,105,111,110,0,87,114,111,110,103,32,107,101,121,32,117,115,97,103,101,0,78,111,116,104,105,110,103,32,102,111,117,110,100,0,87,114,111,110,103,32,98,108,111,98,32,116,121,112,101,0,77,105,115,115,105,110,103,32,118,97,108,117,101,0,72,97,114,100,119,97,114,101,32,112,114,111,98,108,101,109,0,80,73,78,32,98,108,111,99,107,101,100,0,67,111,110,100,105,116,105,111,110,115,32,111,102,32,117,115,101,32,110,111,116,32,115,97,116,105,115,102,105,101,100,0,80,73,78,115,32,97,114,101,32,110,111,116,32,115,121,110,99,101,100,0,73,110,118,97,108,105,100,32,67,82,76,0,66,69,82,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,66,69,82,0,69,108,101,109,101,110,116,32,110,111,116,32,102,111,117,110,100,0,73,100,101,110,116,105,102,105,101,114,32,110,111,116,32,102,111,117,110,100,0,73,110,118,97,108,105,100,32,116,97,103,0,73,110,118,97,108,105,100,32,108,101,110,103,116,104,0,73,110,118,97,108,105,100,32,107,101,121,32,105,110,102,111,0,85,110,101,120,112,101,99,116,101,100,32,116,97,103,0,78,111,116,32,68,69,82,32,101,110,99,111,100,101,100,0,78,111,32,67,77,83,32,111,98,106,101,99,116,0,73,110,118,97,108,105,100,32,67,77,83,32,111,98,106,101,99,116,0,85,110,107,110,111,119,110,32,67,77,83,32,111,98,106,101,99,116,0,85,110,115,117,112,112,111,114,116,101,100,32,67,77,83,32,111,98,106,101,99,116,0,85,110,115,117,112,112,111,114,116,101,100,32,101,110,99,111,100,105,110,103,0,85,110,115,117,112,112,111,114,116,101,100,32,67,77,83,32,118,101,114,115,105,111,110,0,85,110,107,110,111,119,110,32,97,108,103,111,114,105,116,104,109,0,73,110,118,97,108,105,100,32,99,114,121,112,116,111,32,101,110,103,105,110,101,0,80,117,98,108,105,99,32,107,101,121,32,110,111,116,32,116,114,117,115,116,101,100,0,68,101,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,0,75,101,121,32,101,120,112,105,114,101,100,0,83,105,103,110,97,116,117,114,101,32,101,120,112,105,114,101,100,0,69,110,99,111,100,105,110,103,32,112,114,111,98,108,101,109,0,73,110,118,97,108,105,100,32,115,116,97,116,101,0,68,117,112,108,105,99,97,116,101,100,32,118,97,108,117,101,0,77,105,115,115,105,110,103,32,97,99,116,105,111,110,0,65,83,78,46,49,32,109,111,100,117,108,101,32,110,111,116,32,102,111,117,110,100,0,73,110,118,97,108,105,100,32,79,73,68,32,115,116,114,105,110,103,0,73,110,118,97,108,105,100,32,116,105,109,101,0,73,110,118,97,108,105,100,32,67,82,76,32,111,98,106,101,99,116,0,85,110,115,117,112,112,111,114,116,101,100,32,67,82,76,32,118,101,114,115,105,111,110,0,73,110,118,97,108,105,100,32,99,101,114,116,105,102,105,99,97,116,101,32,111,98,106,101,99,116,0,85,110,107,110,111,119,110,32,110,97,109,101,0,65,32,108,111,99,97,108,101,32,102,117,110,99,116,105,111,110,32,102,97,105,108,101,100,0,78,111,116,32,108,111,99,107,101,100,0,80,114,111,116,111,99,111,108,32,118,105,111,108,97,116,105,111,110,0,73,110,118,97,108,105,100,32,77,65,67,0,73,110,118,97,108,105,100,32,114,101,113,117,101,115,116,0,85,110,107,110,111,119,110,32,101,120,116,101,110,115,105,111,110,0,85,110,107,110,111,119,110,32,99,114,105,116,105,99,97,108,32,101,120,116,101,110,115,105,111,110,0,76,111,99,107,101,100,0,85,110,107,110,111,119,110,32,111,112,116,105,111,110,0,85,110,107,110,111,119,110,32,99,111,109,109,97,110,100,0,78,111,116,32,111,112,101,114,97,116,105,111,110,97,108,0,78,111,32,112,97,115,115,112,104,114,97,115,101,32,103,105,118,101,110,0,78,111,32,80,73,78,32,103,105,118,101,110,0,78,111,116,32,101,110,97,98,108,101,100,0,78,111,32,99,114,121,112,116,111,32,101,110,103,105,110,101,0,77,105,115,115,105,110,103,32,107,101,121,0,84,111,111,32,109,97,110,121,32,111,98,106,101,99,116,115,0,76,105,109,105,116,32,114,101,97,99,104,101,100,0,78,111,116,32,105,110,105,116,105,97,108,105,122,101,100,0,77,105,115,115,105,110,103,32,105,115,115,117,101,114,32,99,101,114,116,105,102,105,99,97,116,101,0,78,111,32,107,101,121,115,101,114,118,101,114,32,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,101,108,108,105,112,116,105,99,32,99,117,114,118,101,0,85,110,107,110,111,119,110,32,101,108,108,105,112,116,105,99,32,99,117,114,118,101,0,68,117,112,108,105,99,97,116,101,100,32,107,101,121,0,65,109,98,105,103,117,111,117,115,32,114,101,115,117,108,116,0,78,111,32,99,114,121,112,116,111,32,99,111,110,116,101,120,116,0,87,114,111,110,103,32,99,114,121,112,116,111,32,99,111,110,116,101,120,116,0,66,97,100,32,99,114,121,112,116,111,32,99,111,110,116,101,120,116,0,67,111,110,102,108,105,99,116,32,105,110,32,116,104,101,32,99,114,121,112,116,111,32,99,111,110,116,101,120,116,0,66,114,111,107,101,110,32,112,117,98,108,105,99,32,107,101,121,0,66,114,111,107,101,110,32,115,101,99,114,101,116,32,107,101,121,0,73,110,118,97,108,105,100,32,77,65,67,32,97,108,103,111,114,105,116,104,109,0,79,112,101,114,97,116,105,111,110,32,102,117,108,108,121,32,99,97,110,99,101,108,108,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,121,101,116,32,102,105,110,105,115,104,101,100,0,66,117,102,102,101,114,32,116,111,111,32,115,104,111,114,116,0,73,110,118,97,108,105,100,32,108,101,110,103,116,104,32,115,112,101,99,105,102,105,101,114,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,83,116,114,105,110,103,32,116,111,111,32,108,111,110,103,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,85,110,109,97,116,99,104,101,100,32,112,97,114,101,110,116,104,101,115,101,115,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,83,45,101,120,112,114,101,115,115,105,111,110,32,110,111,116,32,99,97,110,111,110,105,99,97,108,0,66,97,100,32,99,104,97,114,97,99,116,101,114,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,66,97,100,32,113,117,111,116,97,116,105,111,110,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,90,101,114,111,32,112,114,101,102,105,120,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,78,101,115,116,101,100,32,100,105,115,112,108,97,121,32,104,105,110,116,115,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,85,110,109,97,116,99,104,101,100,32,100,105,115,112,108,97,121,32,104,105,110,116,115,0,85,110,101,120,112,101,99,116,101,100,32,114,101,115,101,114,118,101,100,32,112,117,110,99,116,117,97,116,105,111,110,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,66,97,100,32,104,101,120,97,100,101,99,105,109,97,108,32,99,104,97,114,97,99,116,101,114,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,79,100,100,32,104,101,120,97,100,101,99,105,109,97,108,32,110,117,109,98,101,114,115,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,66,97,100,32,111,99,116,97,108,32,99,104,97,114,97,99,116,101,114,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,76,101,103,97,99,121,32,107,101,121,0,82,101,113,117,101,115,116,32,116,111,111,32,115,104,111,114,116,0,82,101,113,117,101,115,116,32,116,111,111,32,108,111,110,103,0,79,98,106,101,99,116,32,105,115,32,105,110,32,116,101,114,109,105,110,97,116,105,111,110,32,115,116,97,116,101,0,78,111,32,99,101,114,116,105,102,105,99,97,116,101,32,99,104,97,105,110,0,67,101,114,116,105,102,105,99,97,116,101,32,105,115,32,116,111,111,32,108,97,114,103,101,0,73,110,118,97,108,105,100,32,114,101,99,111,114,100,0,84,104,101,32,77,65,67,32,100,111,101,115,32,110,111,116,32,118,101,114,105,102,121,0,85,110,101,120,112,101,99,116,101,100,32,109,101,115,115,97,103,101,0,67,111,109,112,114,101,115,115,105,111,110,32,111,114,32,100,101,99,111,109,112,114,101,115,115,105,111,110,32,102,97,105,108,101,100,0,65,32,99,111,117,110,116,101,114,32,119,111,117,108,100,32,119,114,97,112,0,70,97,116,97,108,32,97,108,101,114,116,32,109,101,115,115,97,103,101,32,114,101,99,101,105,118,101,100,0,78,111,32,99,105,112,104,101,114,32,97,108,103,111,114,105,116,104,109,0,77,105,115,115,105,110,103,32,99,108,105,101,110,116,32,99,101,114,116,105,102,105,99,97,116,101,0,67,108,111,115,101,32,110,111,116,105,102,105,99,97,116,105,111,110,32,114,101,99,101,105,118,101,100,0,84,105,99,107,101,116,32,101,120,112,105,114,101,100,0,66,97,100,32,116,105,99,107,101,116,0,85,110,107,110,111,119,110,32,105,100,101,110,116,105,116,121,0,66,97,100,32,99,101,114,116,105,102,105,99,97,116,101,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,99,101,114,116,105,102,105,99,97,116,101,32,114,101,113,117,101,115,116,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,99,101,114,116,105,102,105,99,97,116,101,32,118,101,114,105,102,121,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,99,104,97,110,103,101,32,99,105,112,104,101,114,32,109,101,115,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,99,108,105,101,110,116,32,104,101,108,108,111,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,115,101,114,118,101,114,32,104,101,108,108,111,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,115,101,114,118,101,114,32,104,101,108,108,111,32,100,111,110,101,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,115,104,97,107,101,0,66,97,100,32,102,105,110,105,115,104,101,100,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,115,101,114,118,101,114,32,107,101,121,32,101,120,99,104,97,110,103,101,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,99,108,105,101,110,116,32,107,101,121,32,101,120,99,104,97,110,103,101,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,111,103,117,115,32,115,116,114,105,110,103,0,70,111,114,98,105,100,100,101,110,0,75,101,121,32,100,105,115,97,98,108,101,100,0,78,111,116,32,112,111,115,115,105,98,108,101,32,119,105,116,104,32,97,32,99,97,114,100,32,98,97,115,101,100,32,107,101,121,0,73,110,118,97,108,105,100,32,108,111,99,107,32,111,98,106,101,99,116,0,71,101,110,101,114,97,108,32,73,80,67,32,101,114,114,111,114,0,73,80,67,32,97,99,99,101,112,116,32,99,97,108,108,32,102,97,105,108,101,100,0,73,80,67,32,99,111,110,110,101,99,116,32,99,97,108,108,32,102,97,105,108,101,100,0,73,110,118,97,108,105,100,32,73,80,67,32,114,101,115,112,111,110,115,101,0,73,110,118,97,108,105,100,32,118,97,108,117,101,32,112,97,115,115,101,100,32,116,111,32,73,80,67,0,73,110,99,111,109,112,108,101,116,101,32,108,105,110,101,32,112,97,115,115,101,100,32,116,111,32,73,80,67,0,76,105,110,101,32,112,97,115,115,101,100,32,116,111,32,73,80,67,32,116,111,111,32,108,111,110,103,0,78,101,115,116,101,100,32,73,80,67,32,99,111,109,109,97,110,100,115,0,78,111,32,100,97,116,97,32,99,97,108,108,98,97,99,107,32,105,110,32,73,80,67,0,78,111,32,105,110,113,117,105,114,101,32,99,97,108,108,98,97,99,107,32,105,110,32,73,80,67,0,78,111,116,32,97,110,32,73,80,67,32,115,101,114,118,101,114,0,78,111,116,32,97,110,32,73,80,67,32,99,108,105,101,110,116,0,80,114,111,98,108,101,109,32,115,116,97,114,116,105,110,103,32,73,80,67,32,115,101,114,118,101,114,0,73,80,67,32,114,101,97,100,32,101,114,114,111,114,0,73,80,67,32,119,114,105,116,101,32,101,114,114,111,114,0,84,111,111,32,109,117,99,104,32,100,97,116,97,32,102,111,114,32,73,80,67,32,108,97,121,101,114,0,85,110,101,120,112,101,99,116,101,100,32,73,80,67,32,99,111,109,109,97,110,100,0,85,110,107,110,111,119,110,32,73,80,67,32,99,111,109,109,97,110,100,0,73,80,67,32,115,121,110,116,97,120,32,101,114,114,111,114,0,73,80,67,32,99,97,108,108,32,104,97,115,32,98,101,101,110,32,99,97,110,99,101,108,108,101,100,0,78,111,32,105,110,112,117,116,32,115,111,117,114,99,101,32,102,111,114,32,73,80,67,0,78,111,32,111,117,116,112,117,116,32,115,111,117,114,99,101,32,102,111,114,32,73,80,67,0,73,80,67,32,112,97,114,97,109,101,116,101,114,32,101,114,114,111,114,0,85,110,107,110,111,119,110,32,73,80,67,32,105,110,113,117,105,114,101,0,71,101,110,101,114,97,108,32,76,68,65,80,32,101,114,114,111,114,0,71,101,110,101,114,97,108,32,76,68,65,80,32,97,116,116,114,105,98,117,116,101,32,101,114,114,111,114,0,71,101,110,101,114,97,108,32,76,68,65,80,32,110,97,109,101,32,101,114,114,111,114,0,71,101,110,101,114,97,108,32,76,68,65,80,32,115,101,99,117,114,105,116,121,32,101,114,114,111,114,0,71,101,110,101,114,97,108,32,76,68,65,80,32,115,101,114,118,105,99,101,32,101,114,114,111,114,0,71,101,110,101,114,97,108,32,76,68,65,80,32,117,112,100,97,116,101,32,101,114,114,111,114,0,69,120,112,101,114,105,109,101,110,116,97,108,32,76,68,65,80,32,101,114,114,111,114,32,99,111,100,101,0,80,114,105,118,97,116,101,32,76,68,65,80,32,101,114,114,111,114,32,99,111,100,101,0,79,116,104,101,114,32,103,101,110,101,114,97,108,32,76,68,65,80,32,101,114,114,111,114,0,76,68,65,80,32,99,111,110,110,101,99,116,105,110,103,32,102,97,105,108,101,100,32,40,88,41,0,76,68,65,80,32,114,101,102,101,114,114,97,108,32,108,105,109,105,116,32,101,120,99,101,101,100,101,100,0,76,68,65,80,32,99,108,105,101,110,116,32,108,111,111,112,0,78,111,32,76,68,65,80,32,114,101,115,117,108,116,115,32,114,101,116,117,114,110,101,100,0,76,68,65,80,32,99,111,110,116,114,111,108,32,110,111,116,32,102,111,117,110,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,76,68,65,80,0,76,68,65,80,32,99,111,110,110,101,99,116,32,101,114,114,111,114,0,79,117,116,32,111,102,32,109,101,109,111,114,121,32,105,110,32,76,68,65,80,0,66,97,100,32,112,97,114,97,109,101,116,101,114,32,116,111,32,97,110,32,76,68,65,80,32,114,111,117,116,105,110,101,0,85,115,101,114,32,99,97,110,99,101,108,108,101,100,32,76,68,65,80,32,111,112,101,114,97,116,105,111,110,0,66,97,100,32,76,68,65,80,32,115,101,97,114,99,104,32,102,105,108,116,101,114,0,85,110,107,110,111,119,110,32,76,68,65,80,32,97,117,116,104,101,110,116,105,99,97,116,105,111,110,32,109,101,116,104,111,100,0,84,105,109,101,111,117,116,32,105,110,32,76,68,65,80,0,76,68,65,80,32,100,101,99,111,100,105,110,103,32,101,114,114,111,114,0,76,68,65,80,32,101,110,99,111,100,105,110,103,32,101,114,114,111,114,0,76,68,65,80,32,108,111,99,97,108,32,101,114,114,111,114,0,67,97,110,110,111,116,32,99,111,110,116,97,99,116,32,76,68,65,80,32,115,101,114,118,101,114,0,76,68,65,80,32,115,117,99,99,101,115,115,0,76,68,65,80,32,111,112,101,114,97,116,105,111,110,115,32,101,114,114,111,114,0,76,68,65,80,32,112,114,111,116,111,99,111,108,32,101,114,114,111,114,0,84,105,109,101,32,108,105,109,105,116,32,101,120,99,101,101,100,101,100,32,105,110,32,76,68,65,80,0,83,105,122,101,32,108,105,109,105,116,32,101,120,99,101,101,100,101,100,32,105,110,32,76,68,65,80,0,76,68,65,80,32,99,111,109,112,97,114,101,32,102,97,108,115,101,0,76,68,65,80,32,99,111,109,112,97,114,101,32,116,114,117,101,0,76,68,65,80,32,97,117,116,104,101,110,116,105,99,97,116,105,111,110,32,109,101,116,104,111,100,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,116,114,111,110,103,40,101,114,41,32,76,68,65,80,32,97,117,116,104,101,110,116,105,99,97,116,105,111,110,32,114,101,113,117,105,114,101,100,0,80,97,114,116,105,97,108,32,76,68,65,80,32,114,101,115,117,108,116,115,43,114,101,102,101,114,114,97,108,32,114,101,99,101,105,118,101,100,0,76,68,65,80,32,114,101,102,101,114,114,97,108,0,65,100,109,105,110,105,115,116,114,97,116,105,118,101,32,76,68,65,80,32,108,105,109,105,116,32,101,120,99,101,101,100,101,100,0,67,114,105,116,105,99,97,108,32,76,68,65,80,32,101,120,116,101,110,115,105,111,110,32,105,115,32,117,110,97,118,97,105,108,97,98,108,101,0,67,111,110,102,105,100,101,110,116,105,97,108,105,116,121,32,114,101,113,117,105,114,101,100,32,98,121,32,76,68,65,80,0,76,68,65,80,32,83,65,83,76,32,98,105,110,100,32,105,110,32,112,114,111,103,114,101,115,115,0,78,111,32,115,117,99,104,32,76,68,65,80,32,97,116,116,114,105,98,117,116,101,0,85,110,100,101,102,105,110,101,100,32,76,68,65,80,32,97,116,116,114,105,98,117,116,101,32,116,121,112,101,0,73,110,97,112,112,114,111,112,114,105,97,116,101,32,109,97,116,99,104,105,110,103,32,105,110,32,76,68,65,80,0,67,111,110,115,116,114,97,105,110,116,32,118,105,111,108,97,116,105,111,110,32,105,110,32,76,68,65,80,0,76,68,65,80,32,116,121,112,101,32,111,114,32,118,97,108,117,101,32,101,120,105,115,116,115,0,73,110,118,97,108,105,100,32,115,121,110,116,97,120,32,105,110,32,76,68,65,80,0,78,111,32,115,117,99,104,32,76,68,65,80,32,111,98,106,101,99,116,0,76,68,65,80,32,97,108,105,97,115,32,112,114,111,98,108,101,109,0,73,110,118,97,108,105,100,32,68,78,32,115,121,110,116,97,120,32,105,110,32,76,68,65,80,0,76,68,65,80,32,101,110,116,114,121,32,105,115,32,97,32,108,101,97,102,0,76,68,65,80,32,97,108,105,97,115,32,100,101,114,101,102,101,114,101,110,99,105,110,103,32,112,114,111,98,108,101,109,0,76,68,65,80,32,112,114,111,120,121,32,97,117,116,104,111,114,105,122,97,116,105,111,110,32,102,97,105,108,117,114,101,32,40,88,41,0,73,110,97,112,112,114,111,112,114,105,97,116,101,32,76,68,65,80,32,97,117,116,104,101,110,116,105,99,97,116,105,111,110,0,73,110,118,97,108,105,100,32,76,68,65,80,32,99,114,101,100,101,110,116,105,97,108,115,0,73,110,115,117,102,102,105,99,105,101,110,116,32,97,99,99,101,115,115,32,102,111,114,32,76,68,65,80,0,76,68,65,80,32,115,101,114,118,101,114,32,105,115,32,98,117,115,121,0,76,68,65,80,32,115,101,114,118,101,114,32,105,115,32,117,110,97,118,97,105,108,97,98,108,101,0,76,68,65,80,32,115,101,114,118,101,114,32,105,115,32,117,110,119,105,108,108,105,110,103,32,116,111,32,112,101,114,102,111,114,109,0,76,111,111,112,32,100,101,116,101,99,116,101,100,32,98,121,32,76,68,65,80,0,76,68,65,80,32,110,97,109,105,110,103,32,118,105,111,108,97,116,105,111,110,0,76,68,65,80,32,111,98,106,101,99,116,32,99,108,97,115,115,32,118,105,111,108,97,116,105,111,110,0,76,68,65,80,32,111,112,101,114,97,116,105,111,110,32,110,111,116,32,97,108,108,111,119,101,100,32,111,110,32,110,111,110,45,108,101,97,102,0,76,68,65,80,32,111,112,101,114,97,116,105,111,110,32,110,111,116,32,97,108,108,111,119,101,100,32,111,110,32,82,68,78,0,65,108,114,101,97,100,121,32,101,120,105,115,116,115,32,40,76,68,65,80,41,0,67,97,110,110,111,116,32,109,111,100,105,102,121,32,76,68,65,80,32,111,98,106,101,99,116,32,99,108,97,115,115,0,76,68,65,80,32,114,101,115,117,108,116,115,32,116,111,111,32,108,97,114,103,101,0,76,68,65,80,32,111,112,101,114,97,116,105,111,110,32,97,102,102,101,99,116,115,32,109,117,108,116,105,112,108,101,32,68,83,65,115,0,86,105,114,116,117,97,108,32,76,68,65,80,32,108,105,115,116,32,118,105,101,119,32,101,114,114,111,114,0,79,116,104,101,114,32,76,68,65,80,32,101,114,114,111,114,0,82,101,115,111,117,114,99,101,115,32,101,120,104,97,117,115,116,101,100,32,105,110,32,76,67,85,80,0,83,101,99,117,114,105,116,121,32,118,105,111,108,97,116,105,111,110,32,105,110,32,76,67,85,80,0,73,110,118,97,108,105,100,32,100,97,116,97,32,105,110,32,76,67,85,80,0,85,110,115,117,112,112,111,114,116,101,100,32,115,99,104,101,109,101,32,105,110,32,76,67,85,80,0,82,101,108,111,97,100,32,114,101,113,117,105,114,101,100,32,105,110,32,76,67,85,80,0,76,68,65,80,32,99,97,110,99,101,108,108,101,100,0,78,111,32,76,68,65,80,32,111,112,101,114,97,116,105,111,110,32,116,111,32,99,97,110,99,101,108,0,84,111,111,32,108,97,116,101,32,116,111,32,99,97,110,99,101,108,32,76,68,65,80,0,67,97,110,110,111,116,32,99,97,110,99,101,108,32,76,68,65,80,0,76,68,65,80,32,97,115,115,101,114,116,105,111,110,32,102,97,105,108,101,100,0,80,114,111,120,105,101,100,32,97,117,116,104,111,114,105,122,97,116,105,111,110,32,100,101,110,105,101,100,32,98,121,32,76,68,65,80,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,49,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,50,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,51,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,52,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,53,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,54,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,55,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,56,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,57,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,49,48,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,49,49,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,49,50,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,49,51,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,49,52,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,49,53,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,49,54,0,83,121,115,116,101,109,32,101,114,114,111,114,32,119,47,111,32,101,114,114,110,111,0,85,110,107,110,111,119,110,32,115,121,115,116,101,109,32,101,114,114,111,114,0,69,110,100,32,111,102,32,102,105,108,101,0,85,110,107,110,111,119,110,32,101,114,114,111,114,32,99,111,100,101,0,97,109,111,117,110,116,46,99,0,84,65,76,69,82,95,97,109,111,117,110,116,95,99,109,112,0,84,65,76,69,82,95,97,109,111,117,110,116,95,115,117,98,116,114,97,99,116,0,84,65,76,69,82,95,97,109,111,117,110,116,95,97,100,100,0,49,46,54,46,49,0,108,105,98,103,99,114,121,112,116,32,118,101,114,115,105,111,110,32,109,105,115,109,97,116,99,104,10,0,70,97,116,97,108,32,101,114,114,111,114,32,105,110,32,108,105,98,103,99,114,121,112,116,58,32,37,115,10,0,99,114,121,112,116,111,46,99,0,65,115,115,101,114,116,105,111,110,32,102,97,105,108,101,100,32,97,116,32,37,115,58,37,100,46,10,0,116,97,108,101,114,45,99,111,105,110,45,100,101,114,105,118,97,116,105,111,110,0,84,65,76,69,82,95,115,101,116,117,112,95,102,114,101,115,104,95,99,111,105,110,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,255,255,255,255,255,255,255,10,11,12,13,14,15,16,17,18,19,20,21,22,23],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+51200);allocate([24,25,26,27,28,29,30,31,32,33,34,35,255,255,255,255,255,255,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,1,2,4,7,3,6,5,0,18,17,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,17,34,35,36,17,37,38,39,40,41,42,43,44,17,45,46,47,16,16,48,16,16,16,16,16,16,16,49,50,51,16,52,53,16,16,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,54,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,55,17,17,17,17,56,17,57,58,59,60,61,62,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,63,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,64,65,17,66,67,68,69,70,71,72,73,16,16,16,74,75,76,77,78,16,16,16,79,80,16,16,16,16,81,16,16,16,16,16,16,16,16,16,17,17,17,82,83,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,84,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,85,16,16,16,16,86,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,87,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,88,89,90,91,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,92,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,254,255,255,7,254,255,255,7,0,0,0,0,0,4,32,4,255,255,127,255,255,255,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,195,255,3,0,31,80,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,223,60,64,215,255,255,251,255,255,255,255,255,255,255,255,255,191,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,3,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,254,255,255,255,127,2,254,255,255,255,255,0,0,0,0,0,255,191,182,0,255,255,255,7,7,0,0,0,255,7,255,255,255,255,255,255,255,254,255,195,255,255,255,255,255,255,255,255,255,255,255,255,239,31,254,225,255,159,0,0,255,255,255,255,255,255,0,224,255,255,255,255,255,255,255,255,255,255,255,255,3,0,255,255,255,255,255,7,48,4,255,255,255,252,255,31,0,0,255,255,255,1,0,0,0,0,0,0,0,0,253,31,0,0,0,0,0,0,240,3,255,127,255,255,255,255,255,255,255,239,255,223,225,255,207,255,254,254,238,159,249,255,255,253,197,227,159,89,128,176,207,255,3,0,238,135,249,255,255,253,109,195,135,25,2,94,192,255,63,0,238,191,251,255,255,253,237,227,191,27,1,0,207,255,0,0,238,159,249,255,255,253,237,227,159,25,192,176,207,255,2,0,236,199,61,214,24,199,255,195,199,29,129,0,192,255,0,0,238,223,253,255,255,253,239,227,223,29,96,3,207,255,0,0,236,223,253,255,255,253,239,227,223,29,96,64,207,255,6,0,236,223,253,255,255,255,255,231,223,93,128,0,207,255,0,252,236,255,127,252,255,255,251,47,127,128,95,255,0,0,12,0,254,255,255,255,255,127,255,7,63,32,255,3,0,0,0,0,150,37,240,254,174,236,255,59,95,32,255,243,0,0,0,0,1,0,0,0,255,3,0,0,255,254,255,255,255,31,254,255,3,255,255,254,255,255,255,31,0,0,0,0,0,0,0,0,255,255,255,255,255,255,127,249,255,3,255,255,231,193,255,255,127,64,255,51,255,255,255,255,191,32,255,255,255,255,255,247,255,255,255,255,255,255,255,255,255,61,127,61,255,255,255,255,255,61,255,255,255,255,61,127,61,255,127,255,255,255,255,255,255,255,61,255,255,255,255,255,255,255,255,135,0,0,0,0,255,255,0,0,255,255,255,255,255,255,255,255,255,255,31,0,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,159,255,255,254,255,255,7,255,255,255,255,255,255,255,255,255,199,1,0,255,223,15,0,255,255,15,0,255,255,15,0,255,223,13,0,255,255,255,255,255,255,207,255,255,1,128,16,255,3,0,0,0,0,255,3,255,255,255,255,255,255,255,255,255,255,255,0,255,255,255,255,255,7,255,255,255,255,255,255,255,255,63,0,255,255,255,31,255,15,255,1,192,255,255,255,255,63,31,0,255,255,255,255,255,15,255,255,255,3,255,3,0,0,0,0,255,255,255,15,255,255,255,255,255,255,255,127,254,255,31,0,255,3,255,3,128,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,239,255,239,15,255,3,0,0,0,0,255,255,255,255,255,243,255,255,255,255,255,255,191,255,3,0,255,255,255,255,255,255,63,0,255,227,255,255,255,255,255,63,0,0,0,0,0,0,0,0,0,0,0,0,0,222,111,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,255,255,63,63,255,255,255,255,63,63,255,170,255,255,255,63,255,255,255,255,255,255,223,95,220,31,207,15,255,31,220,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,128,0,0,255,31,0,0,0,0,0,0,0,0,0,0,0,0,132,252,47,62,80,189,255,243,224,67,0,0,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,255,255,255,255,255,255,3,0,0,255,255,255,255,255,127,255,255,255,255,255,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,120,12,0,255,255,255,255,191,32,255,255,255,255,255,255,255,128,0,0,255,255,127,0,127,127,127,127,127,127,127,127,255,255,255,255,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,0,0,0,254,3,62,31,254,255,255,255,255,255,255,255,255,255,127,224,254,255,255,255,255,255,255,255,255,255,255,247,224,255,255,255,255,63,254,255,255,255,255,255,255,255,255,255,255,127,0,0,255,255,255,7,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,0,0,0,0,0,0,0,255,255,255,255,255,63,255,31,255,255,255,15,0,0,255,255,255,255,255,127,240,143,255,255,255,128,255,255,255,255,255,255,255,255,255,255,0,0,0,0,128,255,252,255,255,255,255,255,255,255,255,255,255,255,255,121,15,0,255,7,0,0,0,0,0,0,0,0,0,255,187,247,255,255,255,0,0,0,255,255,255,255,255,255,15,0,255,255,255,255,255,255,255,255,15,0,255,3,0,0,252,8,255,255,255,255,255,7,255,255,255,255,7,0,255,255,255,31,255,255,255,255,255,255,247,255,0,128,255,3,0,0,0,0,255,255,255,255,255,255,127,0,255,63,255,3,255,255,127,4,255,255,255,255,255,255,255,127,5,0,0,56,255,255,60,0,126,126,126,0,127,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,7,255,3,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,0,255,255,127,248,255,255,255,255,255,15,255,255,255,255,255,255,255,255,255,255,255,255,255,63,255,255,255,255,255,255,255,255,255,255,255,255,255,3,0,0,0,0,127,0,248,224,255,253,127,95,219,255,255,255,255,255,255,255,255,255,255,255,255,255,3,0,0,0,248,255,255,255,255,255,255,255,255,255,255,255,255,63,0,0,255,255,255,255,255,255,255,255,252,255,255,255,255,255,255,0,0,0,0,0,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,223,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,0,255,3,254,255,255,7,254,255,255,7,192,255,255,255,255,255,255,255,255,255,255,127,252,252,252,28,0,0,0,0,255,239,255,255,127,255,255,183,255,63,255,63,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,7,0,0,0,0,0,0,0,0,255,255,255,255,255,255,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,31,255,255,255,255,255,255,1,0,0,0,0,0,255,255,255,127,0,0,255,255,255,7,0,0,0,0,0,0,255,255,255,63,255,255,255,255,15,255,62,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,255,3,0,0,0,0,0,0,0,0,0,0,63,253,255,255,255,255,191,145,255,255,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,63,0,255,255,255,3,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,192,0,0,0,0,0,0,0,0,111,240,239,254,255,255,15,0,0,0,0,0,255,255,255,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,63,0,255,255,63,0,255,255,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,63,0,0,0,192,255,0,0,252,255,255,255,255,255,255,1,0,0,255,255,255,1,255,3,255,255,255,255,255,255,199,255,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,30,0,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,63,0,255,3,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,31,0,255,255,255,255,255,127,0,0,248,255,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,223,255,255,255,255,255,255,255,255,223,100,222,255,235,239,255,255,255,255,255,255,255,191,231,223,223,255,255,255,123,95,252,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,255,255,255,253,255,255,247,255,255,255,247,255,255,223,255,255,255,223,255,255,127,255,255,255,127,255,255,255,253,255,255,255,253,255,255,247,207,255,255,255,255,255,255,239,255,255,255,150,254,247,10,132,234,150,170,150,247,247,94,255,251,255,15,238,251,255,15,0,0,0,0,0,0,0,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0,18,16,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,16,16,34,35,16,36,37,38,39,40,41,42,43,16,44,45,46,17,47,48,17,17,49,17,17,17,50,51,52,53,54,55,56,57,17,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,58,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,59,16,60,61,62,63,64,65,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,66,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,67,16,16,68,16,69,70,71,16,72,16,73,16,16,16,16,74,75,76,77,16,16,78,16,79,80,16,16,16,16,81,16,16,16,16,16,16,16,16,16,16,16,16,16,82,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,83,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,84,85,86,87,16,16,88,89,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,90,16,91,92,93,94,95,96,97,98,16,16,16,16,16,16,16,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,254,255,0,252,1,0,0,248,1,0,0,120,0,0,0,0,255,251,223,251,0,0,128,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,0,252,255,224,175,255,255,255,255,255,255,255,255,255,255,223,255,255,255,255,255,32,64,176,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,0,0,0,0,0,134,254,255,255,255,0,64,73,0,0,0,0,0,24,0,223,255,0,200,0,0,0,0,0,0,0,1,0,60,0,0,0,0,0,0,0,0,0,0,0,0,16,224,1,30,0,96,255,191,0,0,0,0,0,0,255,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,207,3,0,0,0,3,0,32,255,127,0,0,0,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,0,0,0,0,0,0,0,0,0,16,0,32,30,0,48,0,1,0,0,0,0,0,0,0,0,16,0,32,0,0,0,0,252,15,0,0,0,0,0,0,0,16,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,32,0,0,0,0,3,0,0,0,0,0,0,0,0,16,0,32,0,0,0,0,253,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,255,7,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,255,0,0,0,0,0,0,0,16,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,63,2,0,0,0,0,0,0,0,0,0,4,0,0,0,0,16,0,0,0,0,0,0,128,0,128,192,223,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,254,255,255,255,0,252,255,255,0,0,0,0,0,0,0,0,252,0,0,0,0,0,0,192,255,223,255,7,0,0,0,0,0,0,0,0,0,0,128,6,0,252,0,0,24,62,0,0,128,191,0,204,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,96,255,255,255,31,0,0,255,3,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,1,0,0,24,0,0,0,0,0,0,0,0,0,56,0,0,0,0,16,0,0,0,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,254,127,47,0,0,255,3,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,196,255,255,255,255,0,0,0,192,0,0,0,0,0,0,0,0,1,0,224,159,0,0,0,0,127,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,16,0,0,252,255,255,255,31,0,0,0,0,0,12,0,0,0,0,0,0,64,0,12,240,0,0,0,0,0,0,192,248,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,255,0,255,255,255,33,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,127,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,3,224,0,224,0,224,0,96,128,248,255,255,255,252,255,255,255,255,255,127,31,252,241,127,255,127,0,0,255,255,255,3,0,0,255,255,255,255,1,0,123,3,208,193,175,66,0,12,31,188,255,255,0,0,0,0,0,2,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,0,255,255,255,255,127,0,0,0,255,7,0,0,255,255,255,255,255,255,255,255,255,255,63,0,0,0,0,0,0,252,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,135,3,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,127,255,15,0,0,0,0,0,0,0,0,255,255,255,251,255,255,255,255,255,255,255,255,255,255,15,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,0,0,0,255,15,30,255,255,255,1,252,193,224,0,0,0,0,0,0,0,0,0,0,0,30,1,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,0,255,255,255,255,15,0,0,0,255,255,255,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,127,0,0,0,0,0,0,192,0,224,0,0,0,0,0,0,0,0,0,0,0,128,15,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,255,255,127,0,3,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,8,0,0,0,15,255,3,0,0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,16,192,0,0,255,255,3,7,0,0,0,0,0,248,0,0,0,0,8,128,0,0,0,0,0,0,0,0,0,0,8,0,255,63,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,0,0,128,11,0,0,0,0,0,0,0,128,2,0,0,192,0,0,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,255,255,255,3,127,0,255,255,255,255,247,255,127,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,254,255,0,252,1,0,0,248,1,0,0,248,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,127,0,48,135,255,255,255,255,255,143,255,0,0,0,0,0,0,224,255,255,7,255,15,0,0,0,0,0,0,255,255,255,255,255,63,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,143,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,135,255,0,255,1,0,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254,0,0,0,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,63,252,255,63,0,0,0,3,0,0,0,0,0,0,254,3,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,225,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,7,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,0,255,255,255,255,127,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,0,0,0,0,255,255,255,255,255,255,255,255,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,127,0,255,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,8,0,0,0,8,0,0,32,0,0,0,32,0,0,128,0,0,0,128,0,0,0,2,0,0,0,2,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,255,255,255,255,255,15,255,255,255,255,255,255,255,255,255,255,255,255,15,0,255,127,254,127,254,255,254,255,0,0,0,0,255,7,255,255,255,127,255,255,255,255,255,255,255,15,255,255,255,255,255,7,0,0,0,0,0,0,0,0,192,255,255,255,7,0,255,255,255,255,255,7,255,1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,191,255,255,255,255,255,255,255,255,31,255,255,15,0,255,255,255,255,223,7,0,0,255,255,1,0,255,255,255,255,255,255,255,127,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,30,255,255,255,255,255,255,255,63,15,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,255,255,255,255,255,255,255,255,225,255,0,0,0,0,0,0,255,255,255,255,255,255,255,255,63,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,114,119,97,0,47,112,114,111,99,47,115,101,108,102,47,102,100,47,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+61440);var tempDoublePtr=STATICTOP;STATICTOP+=16;assert(tempDoublePtr%8==0);var PROCINFO={ppid:1,pid:42,sid:42,pgid:42};var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};var ERRNO_MESSAGES={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module["___errno_location"]()>>2]=value;else Module.printErr("failed to set errno from JS");return value}var PATH={splitPath:(function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)}),normalizeArray:(function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}),normalize:(function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter((function(p){return!!p})),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path}),dirname:(function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir}),basename:(function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)}),extname:(function(path){return PATH.splitPath(path)[3]}),join:(function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))}),join2:(function(l,r){return PATH.normalize(l+"/"+r)}),resolve:(function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter((function(p){return!!p})),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."}),relative:(function(from,to){from=PATH.resolve(from).substr(1);to=PATH.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()}),put_char:(function(tty,val){if(val===null||val===10){Module["print"](UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}}),flush:(function(tty){if(tty.output&&tty.output.length>0){Module["print"](UTF8ArrayToString(tty.output,0));tty.output=[]}})},default_tty1_ops:{put_char:(function(tty,val){if(val===null||val===10){Module["printErr"](UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}}),flush:(function(tty){if(tty.output&&tty.output.length>0){Module["printErr"](UTF8ArrayToString(tty.output,0));tty.output=[]}})}};var MEMFS={ops_table:null,mount:(function(mount){return MEMFS.createNode(null,"/",16384|511,0)}),createNode:(function(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(!MEMFS.ops_table){MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}}}var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={}}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream}node.timestamp=Date.now();if(parent){parent.contents[name]=node}return node}),getFileDataAsRegularArray:(function(node){if(node.contents&&node.contents.subarray){var arr=[];for(var i=0;inode.contents.length){node.contents=MEMFS.getFileDataAsRegularArray(node);node.usedBytes=node.contents.length}if(!node.contents||node.contents.subarray){var prevCapacity=node.contents?node.contents.length:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity0)node.contents.set(oldContents.subarray(0,node.usedBytes),0);return}if(!node.contents&&newCapacity>0)node.contents=[];while(node.contents.lengthnewSize)node.contents.length=newSize;else while(node.contents.length=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);assert(size>=0);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+lengthe2.timestamp){create.push(key);total++}}));var remove=[];Object.keys(dst.entries).forEach((function(key){var e=dst.entries[key];var e2=src.entries[key];if(!e2){remove.push(key);total++}}));if(!total){return callback(null)}var completed=0;var db=src.type==="remote"?src.db:dst.db;var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readwrite");var store=transaction.objectStore(IDBFS.DB_STORE_NAME);function done(err){if(err){if(!done.errored){done.errored=true;return callback(err)}return}if(++completed>=total){return callback(null)}}transaction.onerror=(function(e){done(this.error);e.preventDefault()});create.sort().forEach((function(path){if(dst.type==="local"){IDBFS.loadRemoteEntry(store,path,(function(err,entry){if(err)return done(err);IDBFS.storeLocalEntry(path,entry,done)}))}else{IDBFS.loadLocalEntry(path,(function(err,entry){if(err)return done(err);IDBFS.storeRemoteEntry(store,path,entry,done)}))}}));remove.sort().reverse().forEach((function(path){if(dst.type==="local"){IDBFS.removeLocalEntry(path,done)}else{IDBFS.removeRemoteEntry(store,path,done)}}))})};var NODEFS={isWindows:false,staticInit:(function(){NODEFS.isWindows=!!process.platform.match(/^win/)}),mount:(function(mount){assert(ENVIRONMENT_IS_NODE);return NODEFS.createNode(null,"/",NODEFS.getMode(mount.opts.root),0)}),createNode:(function(parent,name,mode,dev){if(!FS.isDir(mode)&&!FS.isFile(mode)&&!FS.isLink(mode)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node=FS.createNode(parent,name,mode);node.node_ops=NODEFS.node_ops;node.stream_ops=NODEFS.stream_ops;return node}),getMode:(function(path){var stat;try{stat=fs.lstatSync(path);if(NODEFS.isWindows){stat.mode=stat.mode|(stat.mode&146)>>1}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return stat.mode}),realPath:(function(node){var parts=[];while(node.parent!==node){parts.push(node.name);node=node.parent}parts.push(node.mount.opts.root);parts.reverse();return PATH.join.apply(null,parts)}),flagsToPermissionStringMap:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},flagsToPermissionString:(function(flags){flags&=~2097152;flags&=~2048;flags&=~32768;flags&=~524288;if(flags in NODEFS.flagsToPermissionStringMap){return NODEFS.flagsToPermissionStringMap[flags]}else{throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}}),node_ops:{getattr:(function(node){var path=NODEFS.realPath(node);var stat;try{stat=fs.lstatSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}if(NODEFS.isWindows&&!stat.blksize){stat.blksize=4096}if(NODEFS.isWindows&&!stat.blocks){stat.blocks=(stat.size+stat.blksize-1)/stat.blksize|0}return{dev:stat.dev,ino:stat.ino,mode:stat.mode,nlink:stat.nlink,uid:stat.uid,gid:stat.gid,rdev:stat.rdev,size:stat.size,atime:stat.atime,mtime:stat.mtime,ctime:stat.ctime,blksize:stat.blksize,blocks:stat.blocks}}),setattr:(function(node,attr){var path=NODEFS.realPath(node);try{if(attr.mode!==undefined){fs.chmodSync(path,attr.mode);node.mode=attr.mode}if(attr.timestamp!==undefined){var date=new Date(attr.timestamp);fs.utimesSync(path,date,date)}if(attr.size!==undefined){fs.truncateSync(path,attr.size)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),lookup:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);var mode=NODEFS.getMode(path);return NODEFS.createNode(parent,name,mode)}),mknod:(function(parent,name,mode,dev){var node=NODEFS.createNode(parent,name,mode,dev);var path=NODEFS.realPath(node);try{if(FS.isDir(node.mode)){fs.mkdirSync(path,node.mode)}else{fs.writeFileSync(path,"",{mode:node.mode})}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return node}),rename:(function(oldNode,newDir,newName){var oldPath=NODEFS.realPath(oldNode);var newPath=PATH.join2(NODEFS.realPath(newDir),newName);try{fs.renameSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),unlink:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.unlinkSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),rmdir:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.rmdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),readdir:(function(node){var path=NODEFS.realPath(node);try{return fs.readdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),symlink:(function(parent,newName,oldPath){var newPath=PATH.join2(NODEFS.realPath(parent),newName);try{fs.symlinkSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),readlink:(function(node){var path=NODEFS.realPath(node);try{path=fs.readlinkSync(path);path=NODEJS_PATH.relative(NODEJS_PATH.resolve(node.mount.opts.root),path);return path}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}})},stream_ops:{open:(function(stream){var path=NODEFS.realPath(stream.node);try{if(FS.isFile(stream.node.mode)){stream.nfd=fs.openSync(path,NODEFS.flagsToPermissionString(stream.flags))}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),close:(function(stream){try{if(FS.isFile(stream.node.mode)&&stream.nfd){fs.closeSync(stream.nfd)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),read:(function(stream,buffer,offset,length,position){if(length===0)return 0;var nbuffer=new Buffer(length);var res;try{res=fs.readSync(stream.nfd,nbuffer,0,length,position)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}if(res>0){for(var i=0;i=stream.node.size)return 0;var chunk=stream.node.contents.slice(position,position+length);var ab=WORKERFS.reader.readAsArrayBuffer(chunk);buffer.set(new Uint8Array(ab),offset);return chunk.size}),write:(function(stream,buffer,offset,length,position){throw new FS.ErrnoError(ERRNO_CODES.EIO)}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){position+=stream.node.size}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position})}};STATICTOP+=16;STATICTOP+=16;STATICTOP+=16;var FS={root:null,mounts:[],devices:[null],streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:(function(e){if(!(e instanceof FS.ErrnoError))throw e+" : "+stackTrace();return ___setErrNo(e.errno)}),lookupPath:(function(path,opts){path=PATH.resolve(FS.cwd(),path);opts=opts||{};if(!path)return{path:"",node:null};var defaults={follow_mount:true,recurse_count:0};for(var key in defaults){if(opts[key]===undefined){opts[key]=defaults[key]}}if(opts.recurse_count>8){throw new FS.ErrnoError(ERRNO_CODES.ELOOP)}var parts=PATH.normalizeArray(path.split("/").filter((function(p){return!!p})),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(ERRNO_CODES.ELOOP)}}}}return{path:current_path,node:current}}),getPath:(function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}}),hashName:(function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length}),hashAddNode:(function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node}),hashRemoveNode:(function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}}),lookupNode:(function(parent,name){var err=FS.mayLookup(parent);if(err){throw new FS.ErrnoError(err,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)}),createNode:(function(parent,name,mode,rdev){if(!FS.FSNode){FS.FSNode=(function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev});FS.FSNode.prototype={};var readMode=292|73;var writeMode=146;Object.defineProperties(FS.FSNode.prototype,{read:{get:(function(){return(this.mode&readMode)===readMode}),set:(function(val){val?this.mode|=readMode:this.mode&=~readMode})},write:{get:(function(){return(this.mode&writeMode)===writeMode}),set:(function(val){val?this.mode|=writeMode:this.mode&=~writeMode})},isFolder:{get:(function(){return FS.isDir(this.mode)})},isDevice:{get:(function(){return FS.isChrdev(this.mode)})}})}var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node}),destroyNode:(function(node){FS.hashRemoveNode(node)}),isRoot:(function(node){return node===node.parent}),isMountpoint:(function(node){return!!node.mounted}),isFile:(function(mode){return(mode&61440)===32768}),isDir:(function(mode){return(mode&61440)===16384}),isLink:(function(mode){return(mode&61440)===40960}),isChrdev:(function(mode){return(mode&61440)===8192}),isBlkdev:(function(mode){return(mode&61440)===24576}),isFIFO:(function(mode){return(mode&61440)===4096}),isSocket:(function(mode){return(mode&49152)===49152}),flagModes:{"r":0,"rs":1052672,"r+":2,"w":577,"wx":705,"xw":705,"w+":578,"wx+":706,"xw+":706,"a":1089,"ax":1217,"xa":1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:(function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags}),flagsToPermissionString:(function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms}),nodePermissions:(function(node,perms){if(FS.ignorePermissions){return 0}if(perms.indexOf("r")!==-1&&!(node.mode&292)){return ERRNO_CODES.EACCES}else if(perms.indexOf("w")!==-1&&!(node.mode&146)){return ERRNO_CODES.EACCES}else if(perms.indexOf("x")!==-1&&!(node.mode&73)){return ERRNO_CODES.EACCES}return 0}),mayLookup:(function(dir){var err=FS.nodePermissions(dir,"x");if(err)return err;if(!dir.node_ops.lookup)return ERRNO_CODES.EACCES;return 0}),mayCreate:(function(dir,name){try{var node=FS.lookupNode(dir,name);return ERRNO_CODES.EEXIST}catch(e){}return FS.nodePermissions(dir,"wx")}),mayDelete:(function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var err=FS.nodePermissions(dir,"wx");if(err){return err}if(isdir){if(!FS.isDir(node.mode)){return ERRNO_CODES.ENOTDIR}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return ERRNO_CODES.EBUSY}}else{if(FS.isDir(node.mode)){return ERRNO_CODES.EISDIR}}return 0}),mayOpen:(function(node,flags){if(!node){return ERRNO_CODES.ENOENT}if(FS.isLink(node.mode)){return ERRNO_CODES.ELOOP}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return ERRNO_CODES.EISDIR}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))}),MAX_OPEN_FDS:4096,nextfd:(function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(ERRNO_CODES.EMFILE)}),getStream:(function(fd){return FS.streams[fd]}),createStream:(function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=(function(){});FS.FSStream.prototype={};Object.defineProperties(FS.FSStream.prototype,{object:{get:(function(){return this.node}),set:(function(val){this.node=val})},isRead:{get:(function(){return(this.flags&2097155)!==1})},isWrite:{get:(function(){return(this.flags&2097155)!==0})},isAppend:{get:(function(){return this.flags&1024})}})}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream}),closeStream:(function(fd){FS.streams[fd]=null}),chrdev_stream_ops:{open:(function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}}),llseek:(function(){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)})},major:(function(dev){return dev>>8}),minor:(function(dev){return dev&255}),makedev:(function(ma,mi){return ma<<8|mi}),registerDevice:(function(dev,ops){FS.devices[dev]={stream_ops:ops}}),getDevice:(function(dev){return FS.devices[dev]}),getMounts:(function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts}),syncfs:(function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){console.log("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(err){assert(FS.syncFSRequests>0);FS.syncFSRequests--;return callback(err)}function done(err){if(err){if(!done.errored){done.errored=true;return doCallback(err)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach((function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)}))}),mount:(function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot}),unmount:(function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach((function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.indexOf(current.mount)!==-1){FS.destroyNode(current)}current=next}}));node.mounted=null;var idx=node.mount.mounts.indexOf(mount);assert(idx!==-1);node.mount.mounts.splice(idx,1)}),lookup:(function(parent,name){return parent.node_ops.lookup(parent,name)}),mknod:(function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var err=FS.mayCreate(parent,name);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}return parent.node_ops.mknod(parent,name,mode,dev)}),create:(function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)}),mkdir:(function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)}),mkdirTree:(function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=(function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}});var lazyArray=this;lazyArray.setDataGetter((function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]}));if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;console.log("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:(function(){if(!this.lengthKnown){this.cacheLength()}return this._length})},chunkSize:{get:(function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize})}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:(function(){return this.contents.length})}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach((function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(ERRNO_CODES.EIO)}return fn.apply(null,arguments)}}));stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(ERRNO_CODES.EIO)}var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);assert(size>=0);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;HEAP32[buf+36>>2]=stat.size;HEAP32[buf+40>>2]=4096;HEAP32[buf+44>>2]=stat.blocks;HEAP32[buf+48>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+52>>2]=0;HEAP32[buf+56>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ino;return 0}),doMsync:(function(addr,stream,len,flags){var buffer=new Uint8Array(HEAPU8.subarray(addr,addr+len));FS.msync(stream,buffer,0,len,flags)}),doMkdir:(function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0}),doMknod:(function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-ERRNO_CODES.EINVAL}FS.mknod(path,mode,dev);return 0}),doReadlink:(function(path,buf,bufsize){if(bufsize<=0)return-ERRNO_CODES.EINVAL;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len}),doAccess:(function(path,amode){if(amode&~7){return-ERRNO_CODES.EINVAL}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-ERRNO_CODES.EACCES}return 0}),doDup:(function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd}),doReadv:(function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret}),varargs:0,get:(function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret}),getStr:(function(){var ret=Pointer_stringify(SYSCALLS.get());return ret}),getStreamFromFD:(function(){var stream=FS.getStream(SYSCALLS.get());if(!stream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return stream}),getSocketFromFD:(function(){var socket=SOCKFS.getSocket(SYSCALLS.get());if(!socket)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return socket}),getSocketAddress:(function(allowNull){var addrp=SYSCALLS.get(),addrlen=SYSCALLS.get();if(allowNull&&addrp===0)return null;var info=__read_sockaddr(addrp,addrlen);if(info.errno)throw new FS.ErrnoError(info.errno);info.addr=DNS.lookup_addr(info.addr)||info.addr;return info}),get64:(function(){var low=SYSCALLS.get(),high=SYSCALLS.get();if(low>=0)assert(high===0);else assert(high===-1);return low}),getZero:(function(){assert(SYSCALLS.get()===0)})};function ___syscall64(which,varargs){SYSCALLS.varargs=varargs;try{return PROCINFO.ppid}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}Module["_i64Subtract"]=_i64Subtract;function _sysconf(name){switch(name){case 30:return PAGE_SIZE;case 85:var maxHeapSize=2*1024*1024*1024-16777216;maxHeapSize=HEAPU8.length;return maxHeapSize/PAGE_SIZE;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator==="object")return navigator["hardwareConcurrency"]||1;return 1}}___setErrNo(ERRNO_CODES.EINVAL);return-1}function ___syscall20(which,varargs){SYSCALLS.varargs=varargs;try{return PROCINFO.pid}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function _pthread_mutex_destroy(){}Module["_memset"]=_memset;Module["_pthread_mutex_lock"]=_pthread_mutex_lock;function _atexit(func,arg){__ATEXIT__.unshift({func:func,arg:arg})}function _abort(){Module["abort"]()}function ___syscall195(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),buf=SYSCALLS.get();return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall194(which,varargs){SYSCALLS.varargs=varargs;try{var fd=SYSCALLS.get(),zero=SYSCALLS.getZero(),length=SYSCALLS.get64();FS.ftruncate(fd,length);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall197(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),buf=SYSCALLS.get();return SYSCALLS.doStat(FS.stat,stream.path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall202(which,varargs){SYSCALLS.varargs=varargs;try{return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall199(){return ___syscall202.apply(null,arguments)}Module["_i64Add"]=_i64Add;var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",ALLOC_STATIC);Module["_llvm_cttz_i32"]=_llvm_cttz_i32;Module["___udivmoddi4"]=___udivmoddi4;Module["___divdi3"]=___divdi3;function _pthread_mutex_init(){}function ___lock(){}function ___unlock(){}function ___assert_fail(condition,filename,line,func){ABORT=true;throw"Assertion failed: "+Pointer_stringify(condition)+", at: "+[filename?Pointer_stringify(filename):"unknown filename",line,func?Pointer_stringify(func):"unknown function"]+" at "+stackTrace()}function _clock(){if(_clock.start===undefined)_clock.start=Date.now();return(Date.now()-_clock.start)*(1e6/1e3)|0}function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest);return dest}Module["_memcpy"]=_memcpy;Module["_memmove"]=_memmove;function ___syscall91(which,varargs){SYSCALLS.varargs=varargs;try{var addr=SYSCALLS.get(),len=SYSCALLS.get();var info=SYSCALLS.mappings[addr];if(!info)return 0;if(len===info.len){var stream=FS.getStream(info.fd);SYSCALLS.doMsync(addr,stream,len,info.flags);FS.munmap(stream);SYSCALLS.mappings[addr]=null;if(info.allocated){_free(info.malloc)}}return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}Module["_llvm_bswap_i32"]=_llvm_bswap_i32;function ___syscall6(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD();FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall54(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),op=SYSCALLS.get();switch(op){case 21505:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};case 21506:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};case 21519:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0};case 21520:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return-ERRNO_CODES.EINVAL};case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)};case 21523:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}var ___tm_current=STATICTOP;STATICTOP+=48;var ___tm_timezone=allocate(intArrayFromString("GMT"),"i8",ALLOC_STATIC);var _tzname=STATICTOP;STATICTOP+=16;var _daylight=STATICTOP;STATICTOP+=16;var _timezone=STATICTOP;STATICTOP+=16;function _tzset(){if(_tzset.called)return;_tzset.called=true;HEAP32[_timezone>>2]=-(new Date).getTimezoneOffset()*60;var winter=new Date(2e3,0,1);var summer=new Date(2e3,6,1);HEAP32[_daylight>>2]=Number(winter.getTimezoneOffset()!=summer.getTimezoneOffset());function extractZone(date){var match=date.toTimeString().match(/\(([A-Za-z ]+)\)$/);return match?match[1]:"GMT"}var winterName=extractZone(winter);var summerName=extractZone(summer);var winterNamePtr=allocate(intArrayFromString(winterName),"i8",ALLOC_NORMAL);var summerNamePtr=allocate(intArrayFromString(summerName),"i8",ALLOC_NORMAL);if(summer.getTimezoneOffset()>2]=winterNamePtr;HEAP32[_tzname+4>>2]=summerNamePtr}else{HEAP32[_tzname>>2]=summerNamePtr;HEAP32[_tzname+4>>2]=winterNamePtr}}function _localtime_r(time,tmPtr){_tzset();var date=new Date(HEAP32[time>>2]*1e3);HEAP32[tmPtr>>2]=date.getSeconds();HEAP32[tmPtr+4>>2]=date.getMinutes();HEAP32[tmPtr+8>>2]=date.getHours();HEAP32[tmPtr+12>>2]=date.getDate();HEAP32[tmPtr+16>>2]=date.getMonth();HEAP32[tmPtr+20>>2]=date.getFullYear()-1900;HEAP32[tmPtr+24>>2]=date.getDay();var start=new Date(date.getFullYear(),0,1);var yday=(date.getTime()-start.getTime())/(1e3*60*60*24)|0;HEAP32[tmPtr+28>>2]=yday;HEAP32[tmPtr+36>>2]=-(date.getTimezoneOffset()*60);var summerOffset=(new Date(2e3,6,1)).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dst=date.getTimezoneOffset()==Math.min(winterOffset,summerOffset)|0;HEAP32[tmPtr+32>>2]=dst;var zonePtr=HEAP32[_tzname+(dst?Runtime.QUANTUM_SIZE:0)>>2];HEAP32[tmPtr+40>>2]=zonePtr;return tmPtr}function _localtime(time){return _localtime_r(time,___tm_current)}function ___syscall77(which,varargs){SYSCALLS.varargs=varargs;try{var who=SYSCALLS.get(),usage=SYSCALLS.get();_memset(usage,0,136);HEAP32[usage>>2]=1;HEAP32[usage+4>>2]=2;HEAP32[usage+8>>2]=3;HEAP32[usage+12>>2]=4;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}Module["_bitshift64Ashr"]=_bitshift64Ashr;Module["_bitshift64Lshr"]=_bitshift64Lshr;function ___syscall33(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),amode=SYSCALLS.get();return SYSCALLS.doAccess(path,amode)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}var _environ=STATICTOP;STATICTOP+=16;function ___buildEnvironment(env){var MAX_ENV_VALUES=64;var TOTAL_ENV_SIZE=1024;var poolPtr;var envPtr;if(!___buildEnvironment.called){___buildEnvironment.called=true;ENV["USER"]=ENV["LOGNAME"]="web_user";ENV["PATH"]="/";ENV["PWD"]="/";ENV["HOME"]="/home/web_user";ENV["LANG"]="C";ENV["_"]=Module["thisProgram"];poolPtr=allocate(TOTAL_ENV_SIZE,"i8",ALLOC_STATIC);envPtr=allocate(MAX_ENV_VALUES*4,"i8*",ALLOC_STATIC);HEAP32[envPtr>>2]=poolPtr;HEAP32[_environ>>2]=envPtr}else{envPtr=HEAP32[_environ>>2];poolPtr=HEAP32[envPtr>>2]}var strings=[];var totalSize=0;for(var key in env){if(typeof env[key]==="string"){var line=key+"="+env[key];strings.push(line);totalSize+=line.length}}if(totalSize>TOTAL_ENV_SIZE){throw new Error("Environment size exceeded TOTAL_ENV_SIZE!")}var ptrSize=4;for(var i=0;i>2]=poolPtr;poolPtr+=line.length+1}HEAP32[envPtr+strings.length*ptrSize>>2]=0}var ENV={};function _getenv(name){if(name===0)return 0;name=Pointer_stringify(name);if(!ENV.hasOwnProperty(name))return 0;if(_getenv.ret)_free(_getenv.ret);_getenv.ret=allocate(intArrayFromString(ENV[name]),"i8",ALLOC_NORMAL);return _getenv.ret}function _gettimeofday(ptr){var now=Date.now();HEAP32[ptr>>2]=now/1e3|0;HEAP32[ptr+4>>2]=now%1e3*1e3|0;return 0}Module["_pthread_mutex_unlock"]=_pthread_mutex_unlock;function ___syscall3(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),buf=SYSCALLS.get(),count=SYSCALLS.get();return FS.read(stream,HEAP8,buf,count)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall5(which,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(),flags=SYSCALLS.get(),mode=SYSCALLS.get();var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function _llvm_stackrestore(p){var self=_llvm_stacksave;var ret=self.LLVM_SAVEDSTACKS[p];self.LLVM_SAVEDSTACKS.splice(p,1);Runtime.stackRestore(ret)}Module["___udivdi3"]=___udivdi3;Module["___muldsi3"]=___muldsi3;Module["___muldi3"]=___muldi3;Module["_sbrk"]=_sbrk;Module["_bitshift64Shl"]=_bitshift64Shl;function _llvm_stacksave(){var self=_llvm_stacksave;if(!self.LLVM_SAVEDSTACKS){self.LLVM_SAVEDSTACKS=[]}self.LLVM_SAVEDSTACKS.push(Runtime.stackSave());return self.LLVM_SAVEDSTACKS.length-1}Module["___uremdi3"]=___uremdi3;function ___syscall4(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),buf=SYSCALLS.get(),count=SYSCALLS.get();return FS.write(stream,HEAP8,buf,count)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall192(which,varargs){SYSCALLS.varargs=varargs;try{var addr=SYSCALLS.get(),len=SYSCALLS.get(),prot=SYSCALLS.get(),flags=SYSCALLS.get(),fd=SYSCALLS.get(),off=SYSCALLS.get();off<<=12;var ptr;var allocated=false;if(fd===-1){ptr=_memalign(PAGE_SIZE,len);if(!ptr)return-ERRNO_CODES.ENOMEM;_memset(ptr,0,len);allocated=true}else{var info=FS.getStream(fd);if(!info)return-ERRNO_CODES.EBADF;var res=FS.mmap(info,HEAPU8,addr,len,off,prot,flags);ptr=res.ptr;allocated=res.allocated}SYSCALLS.mappings[ptr]={malloc:ptr,len:len,allocated:allocated,fd:fd,flags:flags};return ptr}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall201(){return ___syscall202.apply(null,arguments)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]);return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?Pointer_stringify(tm_zone):""};var pattern=Pointer_stringify(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":(function(date){return WEEKDAYS[date.tm_wday].substring(0,3)}),"%A":(function(date){return WEEKDAYS[date.tm_wday]}),"%b":(function(date){return MONTHS[date.tm_mon].substring(0,3)}),"%B":(function(date){return MONTHS[date.tm_mon]}),"%C":(function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)}),"%d":(function(date){return leadingNulls(date.tm_mday,2)}),"%e":(function(date){return leadingSomething(date.tm_mday,2," ")}),"%g":(function(date){return getWeekBasedYear(date).toString().substring(2)}),"%G":(function(date){return getWeekBasedYear(date)}),"%H":(function(date){return leadingNulls(date.tm_hour,2)}),"%I":(function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)}),"%j":(function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)}),"%m":(function(date){return leadingNulls(date.tm_mon+1,2)}),"%M":(function(date){return leadingNulls(date.tm_min,2)}),"%n":(function(){return"\n"}),"%p":(function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}}),"%S":(function(date){return leadingNulls(date.tm_sec,2)}),"%t":(function(){return"\t"}),"%u":(function(date){var day=new Date(date.tm_year+1900,date.tm_mon+1,date.tm_mday,0,0,0,0);return day.getDay()||7}),"%U":(function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"}),"%V":(function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)}),"%Z":(function(date){return date.tm_zone}),"%%":(function(){return"%"})};for(var rule in EXPANSION_RULES_2){if(pattern.indexOf(rule)>=0){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _time(ptr){var ret=Date.now()/1e3|0;if(ptr){HEAP32[ptr>>2]=ret}return ret}function ___syscall142(which,varargs){SYSCALLS.varargs=varargs;try{var nfds=SYSCALLS.get(),readfds=SYSCALLS.get(),writefds=SYSCALLS.get(),exceptfds=SYSCALLS.get(),timeout=SYSCALLS.get();assert(nfds<=64,"nfds must be less than or equal to 64");assert(!exceptfds,"exceptfds not supported");var total=0;var srcReadLow=readfds?HEAP32[readfds>>2]:0,srcReadHigh=readfds?HEAP32[readfds+4>>2]:0;var srcWriteLow=writefds?HEAP32[writefds>>2]:0,srcWriteHigh=writefds?HEAP32[writefds+4>>2]:0;var srcExceptLow=exceptfds?HEAP32[exceptfds>>2]:0,srcExceptHigh=exceptfds?HEAP32[exceptfds+4>>2]:0;var dstReadLow=0,dstReadHigh=0;var dstWriteLow=0,dstWriteHigh=0;var dstExceptLow=0,dstExceptHigh=0;var allLow=(readfds?HEAP32[readfds>>2]:0)|(writefds?HEAP32[writefds>>2]:0)|(exceptfds?HEAP32[exceptfds>>2]:0);var allHigh=(readfds?HEAP32[readfds+4>>2]:0)|(writefds?HEAP32[writefds+4>>2]:0)|(exceptfds?HEAP32[exceptfds+4>>2]:0);function check(fd,low,high,val){return fd<32?low&val:high&val}for(var fd=0;fd>2]=dstReadLow;HEAP32[readfds+4>>2]=dstReadHigh}if(writefds){HEAP32[writefds>>2]=dstWriteLow;HEAP32[writefds+4>>2]=dstWriteHigh}if(exceptfds){HEAP32[exceptfds>>2]=dstExceptLow;HEAP32[exceptfds+4>>2]=dstExceptHigh}return total}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall140(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),offset_high=SYSCALLS.get(),offset_low=SYSCALLS.get(),result=SYSCALLS.get(),whence=SYSCALLS.get();var offset=offset_low;assert(offset_high===0);FS.llseek(stream,offset,whence);HEAP32[result>>2]=stream.position;if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall146(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();return SYSCALLS.doWritev(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}Module["___remdi3"]=___remdi3;function ___syscall221(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),cmd=SYSCALLS.get();switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-ERRNO_CODES.EINVAL}var newStream;newStream=FS.open(stream.path,stream.flags,0,arg);return newStream.fd};case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0};case 12:case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0};case 13:case 14:case 13:case 14:return 0;case 16:case 8:return-ERRNO_CODES.EINVAL;case 9:___setErrNo(ERRNO_CODES.EINVAL);return-1;default:{return-ERRNO_CODES.EINVAL}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall145(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();return SYSCALLS.doReadv(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}FS.staticInit();__ATINIT__.unshift((function(){if(!Module["noFSInit"]&&!FS.init.initialized)FS.init()}));__ATMAIN__.push((function(){FS.ignorePermissions=false}));__ATEXIT__.push((function(){FS.quit()}));Module["FS_createFolder"]=FS.createFolder;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createLink"]=FS.createLink;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;__ATINIT__.unshift((function(){TTY.init()}));__ATEXIT__.push((function(){TTY.shutdown()}));if(ENVIRONMENT_IS_NODE){var fs=require("fs");var NODEJS_PATH=require("path");NODEFS.staticInit()}___buildEnvironment(ENV);DYNAMICTOP_PTR=allocate(1,"i32",ALLOC_STATIC);STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP);STACK_MAX=STACK_BASE+TOTAL_STACK;DYNAMIC_BASE=Runtime.alignMemory(STACK_MAX);HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE;staticSealed=true;assert(DYNAMIC_BASE=(m|0))$(a|0);return b|0}function Gb(){return l|0}function Hb(a){a=a|0;l=a}function Ib(a,b){a=a|0;b=b|0;l=a;m=b}function Jb(a,b){a=a|0;b=b|0;if(!o){o=a;p=b}}function Kb(a){a=a|0;D=a}function Lb(){return D|0}function Mb(a){a=a|0;var b=0;b=Ub(32,19158,38)|0;oc(a,b);return b|0}function Nb(a){a=a|0;var b=0;b=Ub(32,19158,56)|0;mc(a,b);return b|0}function Ob(a){a=a|0;var b=0;b=Ub(32,19158,73)|0;qc(a,b);return b|0}function Pb(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0;e=d+8|0;f=Ub(e,19158,87)|0;_w(f+8|0,c|0,d|0)|0;d=Iv(b)|0;b=f+4|0;a[b>>0]=d;a[b+1>>0]=d>>8;a[b+2>>0]=d>>16;a[b+3>>0]=d>>24;d=Iv(e)|0;a[f>>0]=d;a[f+1>>0]=d>>8;a[f+2>>0]=d>>16;a[f+3>>0]=d>>24;return f|0}function Qb(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f;if((iu(e,g)|0)!=1){h=0;l=f;return h|0}e=g;c[e>>2]=a;c[e+4>>2]=b;c[g+8>>2]=d;d=Ub(24,19158,117)|0;c[d>>2]=c[g>>2];c[d+4>>2]=c[g+4>>2];c[d+8>>2]=c[g+8>>2];c[d+12>>2]=c[g+12>>2];c[d+16>>2]=c[g+16>>2];c[d+20>>2]=c[g+20>>2];h=d;l=f;return h|0}function Rb(a){a=a|0;var b=0;b=a;D=c[b+4>>2]|0;return c[b>>2]|0}function Sb(a){a=a|0;return c[a+8>>2]|0}function Tb(a){a=a|0;return a+12|0}function Ub(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;e=l;l=l+64|0;if((l|0)>=(m|0))$(64);f=e+24|0;g=e+8|0;h=e;i=e+56|0;j=e+52|0;k=e+48|0;n=e+44|0;o=e+40|0;p=e+36|0;q=e+32|0;c[i>>2]=a;c[j>>2]=b;c[k>>2]=d;if((c[i>>2]|0)>>>0>41943040){c[o>>2]=74;if((c[182]|0)==-1)c[182]=$b(1,0,19165,19185,c[o>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[182]|0))_b();o=c[k>>2]|0;c[h>>2]=c[j>>2];c[h+4>>2]=o;cc(1,61747,h);_b()}c[n>>2]=Vb(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0)|0;if(c[n>>2]|0){l=e;return c[n>>2]|0}c[p>>2]=81;if((c[183]|0)==-1)c[183]=$b(1,21128,19165,19185,c[p>>2]|0)|0;if((ac()|0)<=0){if(c[183]|0){p=Nu(c[(xu()|0)>>2]|0)|0;c[g>>2]=19201;c[g+4>>2]=19165;c[g+8>>2]=81;c[g+12>>2]=p;hc(1,21128,20679,g)}}else bc(-1,0);c[q>>2]=82;if((c[184]|0)==-1)c[184]=$b(1,0,19165,19185,c[q>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[184]|0))_b();c[f>>2]=19165;c[f+4>>2]=82;cc(1,61747,f);_b();return 0}function Vb(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+16|0;g=e+12|0;h=e;c[g>>2]=a;c[e+8>>2]=b;c[e+4>>2]=d;c[h>>2]=Kw(c[g>>2]|0)|0;if(!(c[h>>2]|0)){c[f>>2]=0;i=c[f>>2]|0;l=e;return i|0}else{Uw(c[h>>2]|0,0,c[g>>2]|0)|0;c[f>>2]=c[h>>2];i=c[f>>2]|0;l=e;return i|0}return 0}function Wb(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e;g=e+20|0;h=e+16|0;i=e+12|0;j=e+8|0;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;if(c[g>>2]|0){Lw(c[g>>2]|0);l=e;return}c[j>>2]=311;if((c[185]|0)==-1)c[185]=$b(1,0,19165,19208,c[j>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[185]|0))_b();j=c[i>>2]|0;c[f>>2]=c[h>>2];c[f+4>>2]=j;cc(1,61747,f);_b()}function Xb(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;f=l;l=l+48|0;if((l|0)>=(m|0))$(48);g=f;h=f+44|0;i=f+40|0;j=f+36|0;k=f+32|0;n=f+16|0;o=f+8|0;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[n>>2]=e;c[k>>2]=Tu(c[h>>2]|0,c[i>>2]|0,c[j>>2]|0,n)|0;if((c[k>>2]|0)>>>0<(c[i>>2]|0)>>>0){l=f;return c[k>>2]|0}c[o>>2]=506;if((c[186]|0)==-1)c[186]=$b(1,0,19165,19222,c[o>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[186]|0))_b();c[g>>2]=19165;c[g+4>>2]=506;cc(1,61747,g);_b();return 0}function Yb(){c[17680]=c[3977];return}function Zb(){return}function _b(){Aa()}function $b(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;g=l;l=l+48|0;if((l|0)>=(m|0))$(48);h=g+32|0;i=g+28|0;j=g+24|0;k=g+20|0;n=g+16|0;o=g+12|0;p=g+8|0;q=g+4|0;r=g;c[i>>2]=a;c[j>>2]=b;c[k>>2]=d;c[n>>2]=e;c[o>>2]=f;if(!(c[j>>2]|0))c[j>>2]=c[17681];if((c[17682]|0)>=0&0==(c[17683]|0)){c[h>>2]=(c[i>>2]|0)<=(c[17682]|0)&1;s=c[h>>2]|0;l=g;return s|0}c[r>>2]=(c[17682]|0)>=0&1;c[q>>2]=0;while(1){if((c[q>>2]|0)>=(c[17684]|0))break;c[p>>2]=(c[17685]|0)+((c[q>>2]|0)*112|0);if(!(c[r>>2]|0?!(c[(c[p>>2]|0)+108>>2]|0):0))t=9;if((((((t|0)==9?(t=0,(c[o>>2]|0)>=(c[(c[p>>2]|0)+96>>2]|0)):0)?(c[o>>2]|0)<=(c[(c[p>>2]|0)+100>>2]|0):0)?0==(Gw(c[p>>2]|0,c[j>>2]|0,0,0,0)|0):0)?0==(Gw((c[p>>2]|0)+32|0,c[k>>2]|0,0,0,0)|0):0)?0==(Gw((c[p>>2]|0)+64|0,c[n>>2]|0,0,0,0)|0):0){t=14;break}c[q>>2]=(c[q>>2]|0)+1}if((t|0)==14){c[h>>2]=(c[i>>2]|0)<=(c[(c[p>>2]|0)+104>>2]|0)&1;s=c[h>>2]|0;l=g;return s|0}p=c[i>>2]|0;if((c[17682]|0)>=0){c[h>>2]=(p|0)<=(c[17682]|0)&1;s=c[h>>2]|0;l=g;return s|0}else{c[h>>2]=(p|0)<=4&1;s=c[h>>2]|0;l=g;return s|0}return 0}function ac(){return c[17690]|0}function bc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d;f=d+20|0;g=d+16|0;h=d+12|0;i=d+8|0;c[f>>2]=a;c[g>>2]=b;if(c[f>>2]|0){c[17690]=(c[17690]|0)+(c[f>>2]|0);l=d;return}c[h>>2]=0==(c[17690]|0)&1;c[17690]=0;if((c[g>>2]|0)==0|(c[h>>2]|0)!=0){l=d;return}c[i>>2]=906;if((c[188]|0)==-1)c[188]=$b(1,0,19238,19416,c[i>>2]|0)|0;if((ac()|0)>0){bc(-1,0);l=d;return}if(!(c[188]|0)){l=d;return}c[e>>2]=19238;c[e+4>>2]=906;cc(1,61747,e);l=d;return}function cc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+20|0;g=e+16|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;dc(c[f>>2]|0,c[17686]|0,c[g>>2]|0,h);l=e;return}function dc(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0;g=l;l=l+240|0;if((l|0)>=(m|0))$(240);h=g+40|0;i=g+32|0;j=g+24|0;k=g+108|0;n=g+104|0;o=g+100|0;p=g+96|0;q=g+176|0;r=g+112|0;s=g+92|0;t=g+88|0;u=g+72|0;v=g+68|0;w=g+64|0;x=g+16|0;y=g+56|0;z=g+8|0;A=g+48|0;B=g;c[k>>2]=b;c[n>>2]=d;c[o>>2]=e;c[p>>2]=f;c[u>>2]=c[c[p>>2]>>2];c[t>>2]=(Tu(0,0,c[o>>2]|0,u)|0)+1;if(!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C|0)|0;c[u>>2]=v;break}else{v=Ww(1e6,0,b|0,C|0)|0;C=y+4|0;b=c[C>>2]|0;u=Ww(b|0,((b|0)<0)<<31>>31|0,v|0,D|0)|0;c[C>>2]=u;c[y>>2]=(c[y>>2]|0)+-1;break}}while(0);c[s>>2]=pb(y|0)|0;if(!(c[s>>2]|0))tv(q,19267)|0;else{Sa(r|0,64,19283,c[s>>2]|0)|0;c[i>>2]=c[y+4>>2];Su(q,64,r,i)|0}Tu(j,c[t>>2]|0,c[o>>2]|0,c[p>>2]|0)|0;p=70688;if(0!=(c[k>>2]&64|0)&(0!=(c[p>>2]|0)?1:0!=(c[p+4>>2]|0))?0==(Hv(j,71806,256)|0):0){c[17687]=(c[17687]|0)+1;c[h>>2]=c[17672];c[h+4>>2]=c[17673];p=zd(h)|0;h=z;c[h>>2]=p;c[h+4>>2]=D;h=z;z=c[h+4>>2]|0;if(z>>>0>10|(z|0)==10&(c[h>>2]|0)>>>0>250327040|(c[17687]|0)>>>0>1e3)ec(q);c[A>>2]=1;E=c[w>>2]|0;Ea(E|0);l=g;return}ec(q);Nv(71806,j,256)|0;c[17687]=0;c[17688]=c[k>>2];h=xd()|0;z=B;c[z>>2]=h;c[z+4>>2]=D;c[17672]=c[B>>2];c[17673]=c[B+4>>2];Nv(72062,c[n>>2]|0,32)|0;fc(c[k>>2]|0,c[n>>2]|0,q,j);c[A>>2]=0;E=c[w>>2]|0;Ea(E|0);l=g;return}function ec(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;d=l;l=l+640|0;if((l|0)>=(m|0))$(640);e=d+32|0;f=d+16|0;g=d+52|0;h=d+56|0;i=d+48|0;j=d+44|0;k=d+40|0;n=d+8|0;o=d;c[g>>2]=b;b=70688;if((0==(c[b>>2]|0)?0==(c[b+4>>2]|0):0)|0==(c[17687]|0)){l=d;return}c[i>>2]=0;c[j>>2]=_u(71806,0,256)|0;if(c[j>>2]|0){if((c[j>>2]|0)!=71806)c[j>>2]=(c[j>>2]|0)+-1}else c[j>>2]=72061;if((a[c[j>>2]>>0]|0)==10){c[i>>2]=1;a[c[j>>2]>>0]=0};c[e>>2]=c[17672];c[e+4>>2]=c[17673];b=zd(e)|0;p=n;c[p>>2]=b;c[p+4>>2]=D;c[e>>2]=c[n>>2];c[e+4>>2]=c[n+4>>2];c[k>>2]=qd(e,1)|0;e=c[17687]|0;n=c[k>>2]|0;c[f>>2]=256;c[f+4>>2]=71806;c[f+8>>2]=e;c[f+12>>2]=n;Su(h,576,19367,f)|0;if((c[i>>2]|0)==1)a[c[j>>2]>>0]=10;fc(c[17688]|0,72062,c[g>>2]|0,h);h=xd()|0;g=o;c[g>>2]=h;c[g+4>>2]=D;c[17672]=c[o>>2];c[17673]=c[o+4>>2];c[17687]=0;l=d;return}function fc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;f=l;l=l+48|0;if((l|0)>=(m|0))$(48);g=f+8|0;h=f;i=f+40|0;j=f+36|0;k=f+32|0;n=f+28|0;o=f+24|0;c[i>>2]=a;c[j>>2]=b;c[k>>2]=d;c[n>>2]=e;if(0!=(c[17680]|0)&0==(c[17689]|0)){e=c[17680]|0;if((c[i>>2]|0)==4){c[h>>2]=c[n>>2];Fv(e,19304,h)|0}else{h=c[k>>2]|0;d=c[j>>2]|0;b=gc(c[i>>2]|0)|0;a=c[n>>2]|0;c[g>>2]=h;c[g+4>>2]=d;c[g+8>>2]=b;c[g+12>>2]=a;Fv(e,19309,g)|0}Rv(c[17680]|0)|0}c[o>>2]=c[17689];while(1){if(!(c[o>>2]|0))break;vb[c[(c[o>>2]|0)+4>>2]&15](c[(c[o>>2]|0)+8>>2]|0,c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0);c[o>>2]=c[c[o>>2]>>2]}l=f;return}function gc(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[e>>2]=a;do if((c[e>>2]&1|0)<=0){if((c[e>>2]&2|0)>0){c[d>>2]=19327;break}if((c[e>>2]&4|0)>0){c[d>>2]=19335;break}if((c[e>>2]&8|0)>0){c[d>>2]=19343;break}if((c[e>>2]&16|0)>0){c[d>>2]=19348;break}if(!(c[e>>2]&-65)){c[d>>2]=19354;break}else{c[d>>2]=19359;break}}else c[d>>2]=19321;while(0);l=b;return c[d>>2]|0}function hc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0;f=l;l=l+176|0;if((l|0)>=(m|0))$(176);g=f;h=f+32|0;i=f+28|0;j=f+24|0;k=f+8|0;n=f+40|0;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;if(!(c[i>>2]|0))c[i>>2]=c[17681];c[k>>2]=e;e=c[i>>2]|0;i=_v()|0;c[g>>2]=e;c[g+4>>2]=i;Xb(n,128,19255,g)|0;dc(c[h>>2]|0,n,c[j>>2]|0,k);l=f;return}function ic(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;g=l;l=l+64|0;if((l|0)>=(m|0))$(64);h=g+8|0;i=g;j=g+56|0;k=g+52|0;n=g+48|0;o=g+44|0;p=g+40|0;q=g+36|0;r=g+32|0;s=g+28|0;t=g+24|0;u=g+20|0;v=g+16|0;c[k>>2]=a;c[n>>2]=b;c[o>>2]=d;c[p>>2]=e;c[q>>2]=f;f=c[n>>2]|0;c[s>>2]=Za()|0;e=f;d=l;l=l+((1*e|0)+15&-16)|0;if((l|0)>=(m|0))$((1*e|0)+15&-16|0);if(1!=(jc(r,c[o>>2]|0,c[p>>2]|0)|0)){c[j>>2]=-1;c[t>>2]=1;w=c[s>>2]|0;Ea(w|0);x=c[j>>2]|0;l=g;return x|0}if(oe(c[r>>2]|0,d,c[n>>2]|0,c[k>>2]|0,c[n>>2]|0)|0){c[u>>2]=136;if((c[189]|0)==-1)c[189]=$b(1,0,19432,19451,c[u>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[189]|0))_b();c[i>>2]=19432;c[i+4>>2]=136;cc(1,61747,i);_b()}je(c[r>>2]|0);if(1!=(kc(r,c[o>>2]|0,c[p>>2]|0)|0)){c[j>>2]=-1;c[t>>2]=1;w=c[s>>2]|0;Ea(w|0);x=c[j>>2]|0;l=g;return x|0}if(!(oe(c[r>>2]|0,c[q>>2]|0,c[n>>2]|0,d,c[n>>2]|0)|0)){je(c[r>>2]|0);Uw(d|0,0,f|0)|0;c[j>>2]=c[n>>2];c[t>>2]=1;w=c[s>>2]|0;Ea(w|0);x=c[j>>2]|0;l=g;return x|0}c[v>>2]=140;if((c[190]|0)==-1)c[190]=$b(1,0,19432,19451,c[v>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[190]|0))_b();c[h>>2]=19432;c[h+4>>2]=140;cc(1,61747,h);_b();return 0}function jc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;e=l;l=l+64|0;if((l|0)>=(m|0))$(64);f=e+16|0;g=e+8|0;h=e;i=e+48|0;j=e+44|0;k=e+40|0;n=e+36|0;o=e+32|0;p=e+28|0;q=e+24|0;c[i>>2]=a;c[j>>2]=b;c[k>>2]=d;if(ie(c[i>>2]|0,9,2,0)|0){c[o>>2]=68;if((c[194]|0)==-1)c[194]=$b(1,0,19432,19504,c[o>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[194]|0))_b();c[h>>2]=19432;c[h+4>>2]=68;cc(1,61747,h);_b()}c[n>>2]=ke(c[c[i>>2]>>2]|0,c[j>>2]|0,32)|0;if(0!=(c[n>>2]|0)?((c[n>>2]&255)<<24>>24|0)!=43:0){c[p>>2]=72;if((c[195]|0)==-1)c[195]=$b(1,0,19432,19504,c[p>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[195]|0))_b();c[g>>2]=19432;c[g+4>>2]=72;cc(1,61747,g);_b()}c[n>>2]=ne(c[c[i>>2]>>2]|0,c[k>>2]|0,16)|0;if(!(c[n>>2]|0)){l=e;return 1}if(((c[n>>2]&255)<<24>>24|0)==43){l=e;return 1}c[q>>2]=76;if((c[196]|0)==-1)c[196]=$b(1,0,19432,19504,c[q>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[196]|0))_b();c[f>>2]=19432;c[f+4>>2]=76;cc(1,61747,f);_b();return 0}function kc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;e=l;l=l+64|0;if((l|0)>=(m|0))$(64);f=e+16|0;g=e+8|0;h=e;i=e+48|0;j=e+44|0;k=e+40|0;n=e+36|0;o=e+32|0;p=e+28|0;q=e+24|0;c[i>>2]=a;c[j>>2]=b;c[k>>2]=d;if(ie(c[i>>2]|0,10,2,0)|0){c[o>>2]=98;if((c[191]|0)==-1)c[191]=$b(1,0,19432,19483,c[o>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[191]|0))_b();c[h>>2]=19432;c[h+4>>2]=98;cc(1,61747,h);_b()}c[n>>2]=ke(c[c[i>>2]>>2]|0,(c[j>>2]|0)+32|0,32)|0;if(0!=(c[n>>2]|0)?((c[n>>2]&255)<<24>>24|0)!=43:0){c[p>>2]=102;if((c[192]|0)==-1)c[192]=$b(1,0,19432,19483,c[p>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[192]|0))_b();c[g>>2]=19432;c[g+4>>2]=102;cc(1,61747,g);_b()}c[n>>2]=ne(c[c[i>>2]>>2]|0,(c[k>>2]|0)+16|0,16)|0;if(!(c[n>>2]|0)){l=e;return 1}if(((c[n>>2]&255)<<24>>24|0)==43){l=e;return 1}c[q>>2]=106;if((c[193]|0)==-1)c[193]=$b(1,0,19432,19483,c[q>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[193]|0))_b();c[f>>2]=19432;c[f+4>>2]=106;cc(1,61747,f);_b();return 0}function lc(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;g=l;l=l+64|0;if((l|0)>=(m|0))$(64);h=g+8|0;i=g;j=g+56|0;k=g+52|0;n=g+48|0;o=g+44|0;p=g+40|0;q=g+36|0;r=g+32|0;s=g+28|0;t=g+24|0;u=g+20|0;v=g+16|0;c[k>>2]=a;c[n>>2]=b;c[o>>2]=d;c[p>>2]=e;c[q>>2]=f;f=c[n>>2]|0;c[s>>2]=Za()|0;e=f;d=l;l=l+((1*e|0)+15&-16)|0;if((l|0)>=(m|0))$((1*e|0)+15&-16|0);if(1!=(kc(r,c[o>>2]|0,c[p>>2]|0)|0)){c[j>>2]=-1;c[t>>2]=1;w=c[s>>2]|0;Ea(w|0);x=c[j>>2]|0;l=g;return x|0}if(pe(c[r>>2]|0,d,c[n>>2]|0,c[k>>2]|0,c[n>>2]|0)|0){c[u>>2]=172;if((c[197]|0)==-1)c[197]=$b(1,0,19432,19521,c[u>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[197]|0))_b();c[i>>2]=19432;c[i+4>>2]=172;cc(1,61747,i);_b()}je(c[r>>2]|0);if(1!=(jc(r,c[o>>2]|0,c[p>>2]|0)|0)){c[j>>2]=-1;c[t>>2]=1;w=c[s>>2]|0;Ea(w|0);x=c[j>>2]|0;l=g;return x|0}if(!(pe(c[r>>2]|0,c[q>>2]|0,c[n>>2]|0,d,c[n>>2]|0)|0)){je(c[r>>2]|0);Uw(d|0,0,f|0)|0;c[j>>2]=c[n>>2];c[t>>2]=1;w=c[s>>2]|0;Ea(w|0);x=c[j>>2]|0;l=g;return x|0}c[v>>2]=176;if((c[198]|0)==-1)c[198]=$b(1,0,19432,19521,c[v>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[198]|0))_b();c[h>>2]=19432;c[h+4>>2]=176;cc(1,61747,h);_b();return 0}function mc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;d=l;l=l+64|0;if((l|0)>=(m|0))$(64);e=d+16|0;f=d+8|0;g=d;h=d+52|0;i=d+48|0;j=d+44|0;k=d+40|0;n=d+36|0;o=d+32|0;p=d+28|0;q=d+24|0;c[h>>2]=a;c[i>>2]=b;c[j>>2]=nc(c[h>>2]|0)|0;if(!(c[j>>2]|0)){c[o>>2]=231;if((c[199]|0)==-1)c[199]=$b(1,0,19553,19566,c[o>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[199]|0))_b();c[g>>2]=19553;c[g+4>>2]=231;cc(1,61747,g);_b()}if(_d(k,c[j>>2]|0,0)|0){c[p>>2]=232;if((c[200]|0)==-1)c[200]=$b(1,0,19553,19566,c[p>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[200]|0))_b();c[f>>2]=19553;c[f+4>>2]=232;cc(1,61747,f);_b()}Kd(c[j>>2]|0);c[n>>2]=$d(19601,c[k>>2]|0,0)|0;if(c[n>>2]|0){Oc(c[i>>2]|0,32,c[n>>2]|0);Qd(c[n>>2]|0);Fe(c[k>>2]|0);l=d;return}c[q>>2]=235;if((c[201]|0)==-1)c[201]=$b(1,0,19553,19566,c[q>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[201]|0))_b();c[e>>2]=19553;c[e+4>>2]=235;cc(1,61747,e);_b()}function nc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;b=l;l=l+64|0;if((l|0)>=(m|0))$(64);d=b+24|0;e=b+8|0;f=b;g=b+48|0;h=b+44|0;i=b+40|0;j=b+36|0;k=b+32|0;c[g>>2]=a;a=c[g>>2]|0;c[f>>2]=32;c[f+4>>2]=a;c[i>>2]=Jd(h,0,19609,f)|0;if(!(c[i>>2]|0)){l=b;return c[h>>2]|0}c[j>>2]=136;if((c[202]|0)==-1)c[202]=$b(1,21128,19553,19651,c[j>>2]|0)|0;if((ac()|0)<=0){if(c[202]|0){j=Cd(c[i>>2]|0)|0;c[e>>2]=19676;c[e+4>>2]=19553;c[e+8>>2]=136;c[e+12>>2]=j;hc(1,21128,20679,e)}}else bc(-1,0);c[k>>2]=137;if((c[203]|0)==-1)c[203]=$b(1,0,19553,19651,c[k>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[203]|0))_b();c[d>>2]=19553;c[d+4>>2]=137;cc(1,61747,d);_b();return 0}function oc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;d=l;l=l+64|0;if((l|0)>=(m|0))$(64);e=d+16|0;f=d+8|0;g=d;h=d+52|0;i=d+48|0;j=d+44|0;k=d+40|0;n=d+36|0;o=d+32|0;p=d+28|0;q=d+24|0;c[h>>2]=a;c[i>>2]=b;c[j>>2]=pc(c[h>>2]|0)|0;if(!(c[j>>2]|0)){c[o>>2]=257;if((c[204]|0)==-1)c[204]=$b(1,0,19553,19692,c[o>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[204]|0))_b();c[g>>2]=19553;c[g+4>>2]=257;cc(1,61747,g);_b()}if(_d(k,c[j>>2]|0,0)|0){c[p>>2]=258;if((c[205]|0)==-1)c[205]=$b(1,0,19553,19692,c[p>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[205]|0))_b();c[f>>2]=19553;c[f+4>>2]=258;cc(1,61747,f);_b()}Kd(c[j>>2]|0);c[n>>2]=$d(19601,c[k>>2]|0,0)|0;if(c[n>>2]|0){Oc(c[i>>2]|0,32,c[n>>2]|0);Qd(c[n>>2]|0);Fe(c[k>>2]|0);l=d;return}c[q>>2]=261;if((c[206]|0)==-1)c[206]=$b(1,0,19553,19692,c[q>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[206]|0))_b();c[e>>2]=19553;c[e+4>>2]=261;cc(1,61747,e);_b()}function pc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;b=l;l=l+64|0;if((l|0)>=(m|0))$(64);d=b+24|0;e=b+8|0;f=b;g=b+48|0;h=b+44|0;i=b+40|0;j=b+36|0;k=b+32|0;c[g>>2]=a;a=c[g>>2]|0;c[f>>2]=32;c[f+4>>2]=a;c[i>>2]=Jd(h,0,19727,f)|0;if(!(c[i>>2]|0)){l=b;return c[h>>2]|0}c[j>>2]=169;if((c[207]|0)==-1)c[207]=$b(1,21128,19553,19782,c[j>>2]|0)|0;if((ac()|0)<=0){if(c[207]|0){j=Cd(c[i>>2]|0)|0;c[e>>2]=19676;c[e+4>>2]=19553;c[e+8>>2]=169;c[e+12>>2]=j;hc(1,21128,20679,e)}}else bc(-1,0);c[k>>2]=170;if((c[208]|0)==-1)c[208]=$b(1,0,19553,19782,c[k>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[208]|0))_b();c[d>>2]=19553;c[d+4>>2]=170;cc(1,61747,d);_b();return 0}function qc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;d=l;l=l+64|0;if((l|0)>=(m|0))$(64);e=d+16|0;f=d+8|0;g=d;h=d+52|0;i=d+48|0;j=d+44|0;k=d+40|0;n=d+36|0;o=d+32|0;p=d+28|0;q=d+24|0;c[h>>2]=a;c[i>>2]=b;c[j>>2]=rc(c[h>>2]|0)|0;if(!(c[j>>2]|0)){c[o>>2]=283;if((c[209]|0)==-1)c[209]=$b(1,0,19553,19807,c[o>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[209]|0))_b();c[g>>2]=19553;c[g+4>>2]=283;cc(1,61747,g);_b()}if(_d(k,c[j>>2]|0,0)|0){c[p>>2]=284;if((c[210]|0)==-1)c[210]=$b(1,0,19553,19807,c[p>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[210]|0))_b();c[f>>2]=19553;c[f+4>>2]=284;cc(1,61747,f);_b()}Kd(c[j>>2]|0);c[n>>2]=$d(19601,c[k>>2]|0,0)|0;if(c[n>>2]|0){Oc(c[i>>2]|0,32,c[n>>2]|0);Qd(c[n>>2]|0);Fe(c[k>>2]|0);l=d;return}c[q>>2]=287;if((c[211]|0)==-1)c[211]=$b(1,0,19553,19807,c[q>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[211]|0))_b();c[e>>2]=19553;c[e+4>>2]=287;cc(1,61747,e);_b()}function rc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;b=l;l=l+64|0;if((l|0)>=(m|0))$(64);d=b+24|0;e=b+8|0;f=b;g=b+48|0;h=b+44|0;i=b+40|0;j=b+36|0;k=b+32|0;c[g>>2]=a;a=c[g>>2]|0;c[f>>2]=32;c[f+4>>2]=a;c[i>>2]=Jd(h,0,19609,f)|0;if(!(c[i>>2]|0)){l=b;return c[h>>2]|0}c[j>>2]=202;if((c[212]|0)==-1)c[212]=$b(1,21128,19553,19842,c[j>>2]|0)|0;if((ac()|0)<=0){if(c[212]|0){j=Cd(c[i>>2]|0)|0;c[e>>2]=19676;c[e+4>>2]=19553;c[e+8>>2]=202;c[e+12>>2]=j;hc(1,21128,20679,e)}}else bc(-1,0);c[k>>2]=203;if((c[213]|0)==-1)c[213]=$b(1,0,19553,19842,c[k>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[213]|0))_b();c[d>>2]=19553;c[d+4>>2]=203;cc(1,61747,d);_b();return 0}function sc(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0;a=l;l=l+96|0;if((l|0)>=(m|0))$(96);b=a+40|0;d=a+24|0;e=a+8|0;f=a+88|0;g=a+84|0;h=a+80|0;i=a+76|0;j=a+72|0;k=a+68|0;n=a+64|0;o=a+60|0;p=a+56|0;q=Jd(i,0,19867,a)|0;c[k>>2]=q;if(q){c[n>>2]=505;if((c[214]|0)==-1)c[214]=$b(1,21128,19553,19922,c[n>>2]|0)|0;if((ac()|0)<=0){if(c[214]|0){n=Cd(c[k>>2]|0)|0;c[e>>2]=19676;c[e+4>>2]=19553;c[e+8>>2]=505;c[e+12>>2]=n;hc(1,21128,20679,e)}}else bc(-1,0);c[f>>2]=0;r=c[f>>2]|0;l=a;return r|0}e=te(h,c[i>>2]|0)|0;c[k>>2]=e;if(e){c[o>>2]=510;if((c[215]|0)==-1)c[215]=$b(1,21128,19553,19922,c[o>>2]|0)|0;if((ac()|0)<=0){if(c[215]|0){o=Cd(c[k>>2]|0)|0;c[d>>2]=19953;c[d+4>>2]=19553;c[d+8>>2]=510;c[d+12>>2]=o;hc(1,21128,20679,d)}}else bc(-1,0);Kd(c[i>>2]|0);c[f>>2]=0;r=c[f>>2]|0;l=a;return r|0}Kd(c[i>>2]|0);i=tc(j,c[h>>2]|0,37977,35618)|0;c[k>>2]=i;if(!i){Kd(c[h>>2]|0);c[g>>2]=Ub(32,19553,530)|0;Oc(c[g>>2]|0,32,c[j>>2]|0);Qd(c[j>>2]|0);c[f>>2]=c[g>>2];r=c[f>>2]|0;l=a;return r|0}c[p>>2]=525;if((c[216]|0)==-1)c[216]=$b(1,21128,19553,19922,c[p>>2]|0)|0;if((ac()|0)<=0){if(c[216]|0){p=Cd(c[k>>2]|0)|0;c[b>>2]=19968;c[b+4>>2]=19553;c[b+8>>2]=525;c[b+12>>2]=p;hc(1,21128,20679,b)}}else bc(-1,0);Kd(c[h>>2]|0);c[f>>2]=0;r=c[f>>2]|0;l=a;return r|0}function tc(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;g=l;l=l+48|0;if((l|0)>=(m|0))$(48);h=g+36|0;i=g+32|0;j=g+28|0;k=g+24|0;n=g+20|0;o=g+16|0;p=g+12|0;q=g+8|0;r=g+4|0;s=g;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;c[n>>2]=f;c[o>>2]=Md(c[j>>2]|0,c[k>>2]|0,0)|0;if(!(c[o>>2]|0)){c[h>>2]=1;t=c[h>>2]|0;l=g;return t|0}c[p>>2]=Nd(c[o>>2]|0)|0;Kd(c[o>>2]|0);c[o>>2]=c[p>>2];if(!(c[o>>2]|0)){c[h>>2]=2;t=c[h>>2]|0;l=g;return t|0}c[s>>2]=0;c[q>>2]=c[n>>2];while(1){u=c[o>>2]|0;if(!(a[c[q>>2]>>0]|0)){v=18;break}c[p>>2]=Md(u,c[q>>2]|0,1)|0;if(!(c[p>>2]|0)){v=8;break}n=Od(c[p>>2]|0,1,5)|0;c[(c[i>>2]|0)+(c[s>>2]<<2)>>2]=n;Kd(c[p>>2]|0);if(!(c[(c[i>>2]|0)+(c[s>>2]<<2)>>2]|0)){v=13;break}c[q>>2]=(c[q>>2]|0)+1;c[s>>2]=(c[s>>2]|0)+1}if((v|0)==8){c[r>>2]=0;while(1){if((c[r>>2]|0)>>>0>=(c[s>>2]|0)>>>0)break;Ie(c[(c[i>>2]|0)+(c[r>>2]<<2)>>2]|0);c[(c[i>>2]|0)+(c[r>>2]<<2)>>2]=0;c[r>>2]=(c[r>>2]|0)+1}Kd(c[o>>2]|0);c[h>>2]=3;t=c[h>>2]|0;l=g;return t|0}else if((v|0)==13){c[r>>2]=0;while(1){if((c[r>>2]|0)>>>0>=(c[s>>2]|0)>>>0)break;Ie(c[(c[i>>2]|0)+(c[r>>2]<<2)>>2]|0);c[(c[i>>2]|0)+(c[r>>2]<<2)>>2]=0;c[r>>2]=(c[r>>2]|0)+1}Kd(c[o>>2]|0);c[h>>2]=4;t=c[h>>2]|0;l=g;return t|0}else if((v|0)==18){Kd(u);c[h>>2]=0;t=c[h>>2]|0;l=g;return t|0}return 0}function uc(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0;a=l;l=l+96|0;if((l|0)>=(m|0))$(96);b=a+40|0;d=a+24|0;e=a+8|0;f=a+88|0;g=a+84|0;h=a+80|0;i=a+76|0;j=a+72|0;k=a+68|0;n=a+64|0;o=a+60|0;p=a+56|0;q=Jd(i,0,19982,a)|0;c[k>>2]=q;if(q){c[n>>2]=555;if((c[217]|0)==-1)c[217]=$b(1,21128,19553,20020,c[n>>2]|0)|0;if((ac()|0)<=0){if(c[217]|0){n=Cd(c[k>>2]|0)|0;c[e>>2]=19676;c[e+4>>2]=19553;c[e+8>>2]=555;c[e+12>>2]=n;hc(1,21128,20679,e)}}else bc(-1,0);c[f>>2]=0;r=c[f>>2]|0;l=a;return r|0}e=te(h,c[i>>2]|0)|0;c[k>>2]=e;if(e){c[o>>2]=560;if((c[218]|0)==-1)c[218]=$b(1,21128,19553,20020,c[o>>2]|0)|0;if((ac()|0)<=0){if(c[218]|0){o=Cd(c[k>>2]|0)|0;c[d>>2]=19953;c[d+4>>2]=19553;c[d+8>>2]=560;c[d+12>>2]=o;hc(1,21128,20679,d)}}else bc(-1,0);Kd(c[i>>2]|0);c[f>>2]=0;r=c[f>>2]|0;l=a;return r|0}Kd(c[i>>2]|0);i=tc(j,c[h>>2]|0,37977,35618)|0;c[k>>2]=i;if(!i){Kd(c[h>>2]|0);c[g>>2]=Ub(32,19553,580)|0;Oc(c[g>>2]|0,32,c[j>>2]|0);Qd(c[j>>2]|0);c[f>>2]=c[g>>2];r=c[f>>2]|0;l=a;return r|0}c[p>>2]=575;if((c[219]|0)==-1)c[219]=$b(1,21128,19553,20020,c[p>>2]|0)|0;if((ac()|0)<=0){if(c[219]|0){p=Cd(c[k>>2]|0)|0;c[b>>2]=19968;c[b+4>>2]=19553;c[b+8>>2]=575;c[b+12>>2]=p;hc(1,21128,20679,b)}}else bc(-1,0);Kd(c[h>>2]|0);c[f>>2]=0;r=c[f>>2]|0;l=a;return r|0}function vc(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0;a=l;l=l+96|0;if((l|0)>=(m|0))$(96);b=a+40|0;d=a+24|0;e=a+8|0;f=a+88|0;g=a+84|0;h=a+80|0;i=a+76|0;j=a+72|0;k=a+68|0;n=a+64|0;o=a+60|0;p=a+56|0;q=Jd(i,0,20051,a)|0;c[k>>2]=q;if(q){c[n>>2]=604;if((c[220]|0)==-1)c[220]=$b(1,21128,19553,20095,c[n>>2]|0)|0;if((ac()|0)<=0){if(c[220]|0){n=Cd(c[k>>2]|0)|0;c[e>>2]=19676;c[e+4>>2]=19553;c[e+8>>2]=604;c[e+12>>2]=n;hc(1,21128,20679,e)}}else bc(-1,0);c[f>>2]=0;r=c[f>>2]|0;l=a;return r|0}e=te(h,c[i>>2]|0)|0;c[k>>2]=e;if(e){c[o>>2]=609;if((c[221]|0)==-1)c[221]=$b(1,21128,19553,20095,c[o>>2]|0)|0;if((ac()|0)<=0){if(c[221]|0){o=Cd(c[k>>2]|0)|0;c[d>>2]=19953;c[d+4>>2]=19553;c[d+8>>2]=609;c[d+12>>2]=o;hc(1,21128,20679,d)}}else bc(-1,0);Kd(c[i>>2]|0);c[f>>2]=0;r=c[f>>2]|0;l=a;return r|0}Kd(c[i>>2]|0);i=tc(j,c[h>>2]|0,37977,35618)|0;c[k>>2]=i;if(!i){Kd(c[h>>2]|0);c[g>>2]=Ub(32,19553,629)|0;Oc(c[g>>2]|0,32,c[j>>2]|0);Qd(c[j>>2]|0);c[f>>2]=c[g>>2];r=c[f>>2]|0;l=a;return r|0}c[p>>2]=624;if((c[222]|0)==-1)c[222]=$b(1,21128,19553,20095,c[p>>2]|0)|0;if((ac()|0)<=0){if(c[222]|0){p=Cd(c[k>>2]|0)|0;c[b>>2]=19968;c[b+4>>2]=19553;c[b+8>>2]=624;c[b+12>>2]=p;hc(1,21128,20679,b)}}else bc(-1,0);Kd(c[h>>2]|0);c[f>>2]=0;r=c[f>>2]|0;l=a;return r|0}function wc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;e=l;l=l+80|0;if((l|0)>=(m|0))$(80);f=e+16|0;g=e;h=e+68|0;i=e+64|0;j=e+60|0;k=e+56|0;n=e+52|0;o=e+48|0;p=e+44|0;q=e+40|0;r=e+32|0;s=e+28|0;t=e+24|0;c[i>>2]=a;c[j>>2]=b;c[k>>2]=d;c[n>>2]=pc(c[i>>2]|0)|0;c[p>>2]=xc(c[j>>2]|0)|0;j=qe(o,c[p>>2]|0,c[n>>2]|0)|0;c[q>>2]=j;if(j){c[s>>2]=807;if((c[223]|0)==-1)c[223]=$b(2,21128,19553,20126,c[s>>2]|0)|0;if((ac()|0)<=0){if(c[223]|0){s=Cd(c[q>>2]|0)|0;c[g>>2]=19553;c[g+4>>2]=807;c[g+8>>2]=s;hc(2,21128,20151,g)}}else bc(-1,0);Kd(c[p>>2]|0);Kd(c[n>>2]|0);c[h>>2]=-1;u=c[h>>2]|0;l=e;return u|0}Kd(c[n>>2]|0);Kd(c[p>>2]|0);p=tc(r,c[o>>2]|0,37839,47175)|0;c[q>>2]=p;if(!p){Kd(c[o>>2]|0);Oc(c[k>>2]|0,32,c[r>>2]|0);Oc((c[k>>2]|0)+32|0,32,c[r+4>>2]|0);Qd(c[r>>2]|0);Qd(c[r+4>>2]|0);c[h>>2]=1;u=c[h>>2]|0;l=e;return u|0}c[t>>2]=819;if((c[224]|0)==-1)c[224]=$b(1,0,19553,20126,c[t>>2]|0)|0;if((ac()|0)<=0){if(c[224]|0){c[f>>2]=19553;c[f+4>>2]=819;cc(1,61747,f)}}else bc(-1,0);Kd(c[o>>2]|0);c[h>>2]=-1;u=c[h>>2]|0;l=e;return u|0}function xc(a){a=a|0;var b=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;b=l;l=l+128|0;if((l|0)>=(m|0))$(128);e=b+16|0;f=b;g=b+116|0;h=b+112|0;i=b+48|0;j=b+40|0;k=b+36|0;n=b+32|0;c[h>>2]=a;a=c[h>>2]|0;o=c[h>>2]|0;Bc(a,Mv(d[o>>0]|d[o+1>>0]<<8|d[o+2>>0]<<16|d[o+3>>0]<<24)|0,i);c[f>>2]=37919;c[f+4>>2]=64;c[f+8>>2]=i;i=Jd(j,0,20186,f)|0;c[k>>2]=i;if(!i){c[g>>2]=c[j>>2];p=c[g>>2]|0;l=b;return p|0}c[n>>2]=698;if((c[225]|0)==-1)c[225]=$b(1,21128,19553,20230,c[n>>2]|0)|0;if((ac()|0)<=0){if(c[225]|0){n=Cd(c[k>>2]|0)|0;c[e>>2]=19676;c[e+4>>2]=19553;c[e+8>>2]=698;c[e+12>>2]=n;hc(1,21128,20679,e)}}else bc(-1,0);c[g>>2]=0;p=c[g>>2]|0;l=b;return p|0}function yc(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;g=l;l=l+96|0;if((l|0)>=(m|0))$(96);h=g+40|0;i=g+32|0;j=g+16|0;k=g;n=g+92|0;o=g+88|0;p=g+84|0;q=g+80|0;r=g+76|0;s=g+72|0;t=g+68|0;u=g+64|0;v=g+60|0;w=g+56|0;x=g+52|0;c[o>>2]=a;c[p>>2]=b;c[q>>2]=e;c[r>>2]=f;f=c[o>>2]|0;o=(c[p>>2]|0)+4|0;if((f|0)!=(Mv(d[o>>0]|d[o+1>>0]<<8|d[o+2>>0]<<16|d[o+3>>0]<<24)|0)){c[n>>2]=-1;y=c[n>>2]|0;l=g;return y|0}o=c[q>>2]|0;f=(c[q>>2]|0)+32|0;c[k>>2]=32;c[k+4>>2]=o;c[k+8>>2]=32;c[k+12>>2]=f;f=Jd(t,0,20289,k)|0;c[v>>2]=f;if(f){c[w>>2]=918;if((c[226]|0)==-1)c[226]=$b(1,21128,19553,20318,c[w>>2]|0)|0;if((ac()|0)<=0){if(c[226]|0){w=Cd(c[v>>2]|0)|0;c[j>>2]=19676;c[j+4>>2]=19553;c[j+8>>2]=918;c[j+12>>2]=w;hc(1,21128,20679,j)}}else bc(-1,0);c[n>>2]=-1;y=c[n>>2]|0;l=g;return y|0}c[s>>2]=xc(c[p>>2]|0)|0;p=c[r>>2]|0;c[i>>2]=32;c[i+4>>2]=p;p=Jd(u,0,20345,i)|0;c[v>>2]=p;if(p){Kd(c[s>>2]|0);Kd(c[t>>2]|0);c[n>>2]=-1;y=c[n>>2]|0;l=g;return y|0}c[v>>2]=re(c[t>>2]|0,c[s>>2]|0,c[u>>2]|0)|0;Kd(c[u>>2]|0);Kd(c[s>>2]|0);Kd(c[t>>2]|0);if(!(c[v>>2]|0)){c[n>>2]=1;y=c[n>>2]|0;l=g;return y|0}c[x>>2]=938;if((c[227]|0)==-1)c[227]=$b(8,21128,19553,20318,c[x>>2]|0)|0;if((ac()|0)<=0){if(c[227]|0){x=Cd(c[v>>2]|0)|0;c[h>>2]=19553;c[h+4>>2]=938;c[h+8>>2]=x;hc(8,21128,20397,h)}}else bc(-1,0);c[n>>2]=-1;y=c[n>>2]|0;l=g;return y|0}function zc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;e=l;l=l+144|0;if((l|0)>=(m|0))$(144);f=e+40|0;g=e+32|0;h=e+16|0;i=e+8|0;j=e;k=e+104|0;n=e+100|0;o=e+96|0;p=e+92|0;q=e+88|0;r=e+84|0;s=e+80|0;t=e+76|0;u=e+72|0;v=e+68|0;w=e+112|0;x=e+64|0;y=e+60|0;z=e+56|0;A=e+52|0;B=e+48|0;c[n>>2]=a;c[o>>2]=b;c[p>>2]=d;d=c[o>>2]|0;c[j>>2]=32;c[j+4>>2]=d;if(Jd(u,0,20250,j)|0){c[k>>2]=-1;C=c[k>>2]|0;l=e;return C|0}if(_d(t,c[u>>2]|0,0)|0){c[y>>2]=972;if((c[228]|0)==-1)c[228]=$b(1,0,19553,20447,c[y>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[228]|0))_b();c[i>>2]=19553;c[i+4>>2]=972;cc(1,61747,i);_b()}Kd(c[u>>2]|0);c[r>>2]=ae(47216,c[t>>2]|0,0)|0;Qc(s,c[n>>2]|0,32);c[q>>2]=Yd(0)|0;ce(c[q>>2]|0,c[s>>2]|0,c[r>>2]|0,c[t>>2]|0);Zd(c[r>>2]|0);Qd(c[s>>2]|0);c[v>>2]=Pd(256)|0;if(be(c[v>>2]|0,0,c[q>>2]|0,c[t>>2]|0)|0){c[z>>2]=989;if((c[229]|0)==-1)c[229]=$b(1,21128,19553,20447,c[z>>2]|0)|0;if((ac()|0)<=0){if(c[229]|0){z=Cd(0)|0;c[h>>2]=20470;c[h+4>>2]=19553;c[h+8>>2]=989;c[h+12>>2]=z;hc(1,21128,20679,h)}}else bc(-1,0);Zd(c[q>>2]|0);Fe(c[t>>2]|0);c[k>>2]=-1;C=c[k>>2]|0;l=e;return C|0}Zd(c[q>>2]|0);Fe(c[t>>2]|0);c[x>>2]=32;if(he(c[v>>2]|0,2)|0){c[A>>2]=998;if((c[230]|0)==-1)c[230]=$b(1,0,19553,20447,c[A>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[230]|0))_b();c[g>>2]=19553;c[g+4>>2]=998;cc(1,61747,g);_b()}if(!(Td(1,w,c[x>>2]|0,x,c[v>>2]|0)|0)){Bc(w,c[x>>2]|0,c[p>>2]|0);Qd(c[v>>2]|0);c[k>>2]=1;C=c[k>>2]|0;l=e;return C|0}c[B>>2]=1005;if((c[231]|0)==-1)c[231]=$b(1,0,19553,20447,c[B>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[231]|0))_b();c[f>>2]=19553;c[f+4>>2]=1005;cc(1,61747,f);_b();return 0}function Ac(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;e=l;l=l+144|0;if((l|0)>=(m|0))$(144);f=e+40|0;g=e+32|0;h=e+16|0;i=e+8|0;j=e;k=e+104|0;n=e+100|0;o=e+96|0;p=e+92|0;q=e+88|0;r=e+84|0;s=e+80|0;t=e+76|0;u=e+72|0;v=e+68|0;w=e+112|0;x=e+64|0;y=e+60|0;z=e+56|0;A=e+52|0;B=e+48|0;c[n>>2]=a;c[o>>2]=b;c[p>>2]=d;d=c[o>>2]|0;c[j>>2]=32;c[j+4>>2]=d;if(Jd(u,0,20250,j)|0){c[k>>2]=-1;C=c[k>>2]|0;l=e;return C|0}if(_d(t,c[u>>2]|0,0)|0){c[y>>2]=1403;if((c[232]|0)==-1)c[232]=$b(1,0,19553,20488,c[y>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[232]|0))_b();c[i>>2]=19553;c[i+4>>2]=1403;cc(1,61747,i);_b()}Kd(c[u>>2]|0);c[r>>2]=ae(47216,c[t>>2]|0,0)|0;Qc(s,c[n>>2]|0,32);c[q>>2]=Yd(0)|0;ce(c[q>>2]|0,c[s>>2]|0,c[r>>2]|0,c[t>>2]|0);Zd(c[r>>2]|0);Qd(c[s>>2]|0);c[v>>2]=Pd(256)|0;if(be(c[v>>2]|0,0,c[q>>2]|0,c[t>>2]|0)|0){c[z>>2]=1420;if((c[233]|0)==-1)c[233]=$b(1,21128,19553,20488,c[z>>2]|0)|0;if((ac()|0)<=0){if(c[233]|0){z=Cd(0)|0;c[h>>2]=20470;c[h+4>>2]=19553;c[h+8>>2]=1420;c[h+12>>2]=z;hc(1,21128,20679,h)}}else bc(-1,0);Zd(c[q>>2]|0);Fe(c[t>>2]|0);c[k>>2]=-1;C=c[k>>2]|0;l=e;return C|0}Zd(c[q>>2]|0);Fe(c[t>>2]|0);c[x>>2]=32;if(he(c[v>>2]|0,2)|0){c[A>>2]=1429;if((c[234]|0)==-1)c[234]=$b(1,0,19553,20488,c[A>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[234]|0))_b();c[g>>2]=19553;c[g+4>>2]=1429;cc(1,61747,g);_b()}if(!(Td(1,w,c[x>>2]|0,x,c[v>>2]|0)|0)){Bc(w,c[x>>2]|0,c[p>>2]|0);Qd(c[v>>2]|0);c[k>>2]=1;C=c[k>>2]|0;l=e;return C|0}c[B>>2]=1436;if((c[235]|0)==-1)c[235]=$b(1,0,19553,20488,c[B>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[235]|0))_b();c[f>>2]=19553;c[f+4>>2]=1436;cc(1,61747,f);_b();return 0}function Bc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;ze(10,c[h>>2]|0,c[f>>2]|0,c[g>>2]|0);l=e;return}function Cc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+8|0;f=d+4|0;g=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=15;while(1){if((c[g>>2]|0)<0)break;b=Sc(c[e>>2]|0,-1)|0;c[(c[f>>2]|0)+(c[g>>2]<<2)>>2]=b;c[g>>2]=(c[g>>2]|0)+-1}l=d;return}function Dc(){var a=0,b=0,d=0,e=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;d=a+12|0;e=a+8|0;c[d>>2]=Ub(4,20513,425)|0;if(!(ue(c[d>>2]|0,10,0)|0)){l=a;return c[d>>2]|0}c[e>>2]=429;if((c[236]|0)==-1)c[236]=$b(1,0,20513,20527,c[e>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[236]|0))_b();c[b>>2]=20513;c[b+4>>2]=429;cc(1,61747,b);_b();return 0}function Ec(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;xe(c[c[f>>2]>>2]|0,c[g>>2]|0,c[h>>2]|0);l=e;return}function Fc(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e;g=e+20|0;h=e+16|0;i=e+12|0;j=e+8|0;c[g>>2]=b;c[h>>2]=d;c[i>>2]=ye(c[c[g>>2]>>2]|0,0)|0;if(c[i>>2]|0){if(!(c[h>>2]|0)){k=c[g>>2]|0;Gc(k);l=e;return}d=c[h>>2]|0;h=c[i>>2]|0;i=d+64|0;do{a[d>>0]=a[h>>0]|0;d=d+1|0;h=h+1|0}while((d|0)<(i|0));k=c[g>>2]|0;Gc(k);l=e;return}c[j>>2]=462;if((c[237]|0)==-1)c[237]=$b(1,0,20513,20560,c[j>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[237]|0))_b();c[f>>2]=20513;c[f+4>>2]=462;cc(1,61747,f);_b()}function Gc(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;ve(c[c[d>>2]>>2]|0);Wb(c[d>>2]|0,20513,480);l=b;return}function Hc(b,d,e,f,g,h,i,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=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jc(c[z>>2]|0,k,c[F>>2]|0,M,c[N>>2]|0)|0;if(!(c[A>>2]|0)){W=27;break}if(c[E>>2]|0)_w(c[p>>2]|0,c[A>>2]|0,c[E>>2]|0)|0;c[p>>2]=(c[p>>2]|0)+(c[E>>2]|0);c[B>>2]=(c[B>>2]|0)+1}if((W|0)==27){c[K>>2]=4;break}if((c[D>>2]|0)>>>0>0){if((c[C>>2]|0)>>>0>0){if(c[E>>2]|0)_w(M|0,(c[p>>2]|0)+(0-(c[E>>2]|0))|0,c[E>>2]|0)|0;c[B>>2]=(c[B>>2]|0)+1}Uw(M+(c[E>>2]|0)+(c[I>>2]|0)|0,c[B>>2]&255|0,1)|0;we(c[z>>2]|0);L=c[z>>2]|0;s=c[F>>2]|0;if((c[C>>2]|0)>>>0>0)c[A>>2]=Jc(L,k,s,M,c[N>>2]|0)|0;else c[A>>2]=Jc(L,k,s,M+(c[E>>2]|0)|0,(c[N>>2]|0)-(c[E>>2]|0)|0)|0;if(!(c[A>>2]|0)){c[K>>2]=4;break}if(c[D>>2]|0)_w(c[p>>2]|0,c[A>>2]|0,c[D>>2]|0)|0}c[H>>2]=1;c[K>>2]=22}while(0);Ea(c[O>>2]|0);switch(c[K>>2]|0){case 4:{W=45;break a;break}case 22:{break a;break}default:{}}U=c[G>>2]|0;Ea(U|0);V=c[o>>2]|0;l=n;return V|0}while(0);if((W|0)==45)c[H>>2]=-1;ve(c[y>>2]|0);ve(c[z>>2]|0);c[o>>2]=c[H>>2];c[K>>2]=1;U=c[G>>2]|0;Ea(U|0);V=c[o>>2]|0;l=n;return V|0}function Ic(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;h=l;l=l+32|0;if((l|0)>=(m|0))$(32);i=h+28|0;j=h+24|0;k=h+20|0;n=h+16|0;o=h+12|0;p=h+8|0;q=h+4|0;r=h;c[j>>2]=a;c[k>>2]=b;c[n>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2]=f;c[u>>2]=g;c[v>>2]=h;c[x>>2]=de(c[q>>2]|0)|0;c[z>>2]=0;while(1){h=((((c[x>>2]|0)-1|0)>>>0)/8|0)+1|0;c[A>>2]=Za()|0;g=h;f=l;l=l+((1*g|0)+15&-16)|0;if((l|0)>=(m|0))$((1*g|0)+15&-16|0);g=c[r>>2]|0;e=c[s>>2]|0;d=c[t>>2]|0;b=c[u>>2]|0;a=c[v>>2]|0;F=hv(c[v>>2]|0)|0;c[o>>2]=a;c[o+4>>2]=F;c[o+8>>2]=z;c[o+12>>2]=4;c[o+16>>2]=0;c[o+20>>2]=0;c[w>>2]=Mc(f,h,g,e,d,b,o)|0;if(1!=(c[w>>2]|0)){G=3;break}c[w>>2]=Sd(c[p>>2]|0,5,f,h,y)|0;if(c[w>>2]|0){G=11;break}fe(c[c[p>>2]>>2]|0,c[x>>2]|0);if(ee(c[c[p>>2]>>2]|0,c[x>>2]|0)|0){G=19;break}c[z>>2]=(c[z>>2]|0)+1;if(0>(Rd(c[c[p>>2]>>2]|0,c[q>>2]|0)|0))c[E>>2]=3;else{Qd(c[c[p>>2]>>2]|0);c[E>>2]=0}Ea(c[A>>2]|0);if((c[E>>2]|0)>>>0>=1){G=30;break}}if((G|0)==3){c[B>>2]=155;if((c[238]|0)==-1)c[238]=$b(1,0,20594,20607,c[B>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[238]|0))_b();c[n>>2]=20594;c[n+4>>2]=155;cc(1,61747,n);_b()}else if((G|0)==11){c[C>>2]=162;if((c[239]|0)==-1)c[239]=$b(1,0,20594,20607,c[C>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[239]|0))_b();c[k>>2]=20594;c[k+4>>2]=162;cc(1,61747,k);_b()}else if((G|0)==19){c[D>>2]=165;if((c[240]|0)==-1)c[240]=$b(1,0,20594,20607,c[D>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[240]|0))_b();c[j>>2]=20594;c[j+4>>2]=165;cc(1,61747,j);_b()}else if((G|0)==30){l=i;return}}function Oc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;e=l;l=l+80|0;if((l|0)>=(m|0))$(80);f=e+24|0;g=e+8|0;h=e;i=e+68|0;j=e+64|0;k=e+60|0;n=e+56|0;o=e+52|0;p=e+48|0;q=e+44|0;r=e+40|0;s=e+36|0;t=e+32|0;c[i>>2]=a;c[j>>2]=b;c[k>>2]=d;if(he(c[k>>2]|0,2)|0){c[q>>2]=ge(c[k>>2]|0,p)|0;if(c[q>>2]|0){c[n>>2]=(((c[p>>2]|0)+7|0)>>>0)/8|0;if((c[n>>2]|0)>>>0>(c[j>>2]|0)>>>0)c[n>>2]=c[j>>2];if(c[n>>2]|0)_w(c[i>>2]|0,c[q>>2]|0,c[n>>2]|0)|0;if((c[n>>2]|0)>>>0>=(c[j>>2]|0)>>>0){l=e;return}Uw((c[i>>2]|0)+(c[n>>2]|0)|0,0,(c[j>>2]|0)-(c[n>>2]|0)|0)|0;l=e;return}c[r>>2]=89;if((c[241]|0)==-1)c[241]=$b(1,0,20633,20646,c[r>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[241]|0))_b();c[h>>2]=20633;c[h+4>>2]=89;cc(1,61747,h);_b()}else{c[n>>2]=c[j>>2];h=Td(5,c[i>>2]|0,c[n>>2]|0,n,c[k>>2]|0)|0;c[o>>2]=h;if(!h){Pc(c[i>>2]|0,c[n>>2]|0,c[j>>2]|0);l=e;return}c[s>>2]=110;if((c[242]|0)==-1)c[242]=$b(1,21128,20633,20646,c[s>>2]|0)|0;if((ac()|0)<=0){if(c[242]|0){s=Cd(c[o>>2]|0)|0;c[g>>2]=20716;c[g+4>>2]=20633;c[g+8>>2]=110;c[g+12>>2]=s;hc(1,21128,20679,g)}}else bc(-1,0);c[t>>2]=111;if((c[243]|0)==-1)c[243]=$b(1,0,20633,20646,c[t>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[243]|0))_b();c[f>>2]=20633;c[f+4>>2]=111;cc(1,61747,f);_b()}}function Pc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[i>>2]=c[f>>2];if((c[g>>2]|0)>>>0>=(c[h>>2]|0)>>>0){l=e;return}$w((c[i>>2]|0)+((c[h>>2]|0)-(c[g>>2]|0))|0,c[f>>2]|0,c[g>>2]|0)|0;Uw(c[f>>2]|0,0,(c[h>>2]|0)-(c[g>>2]|0)|0)|0;l=e;return}function Qc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;e=l;l=l+48|0;if((l|0)>=(m|0))$(48);f=e+16|0;g=e;h=e+44|0;i=e+40|0;j=e+36|0;k=e+32|0;n=e+28|0;o=e+24|0;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;d=Sd(c[h>>2]|0,5,c[i>>2]|0,c[j>>2]|0,j)|0;c[k>>2]=d;if(!d){l=e;return}c[n>>2]=140;if((c[244]|0)==-1)c[244]=$b(1,21128,20633,20731,c[n>>2]|0)|0;if((ac()|0)<=0){if(c[244]|0){n=Cd(c[k>>2]|0)|0;c[g>>2]=20763;c[g+4>>2]=20633;c[g+8>>2]=140;c[g+12>>2]=n;hc(1,21128,20679,g)}}else bc(-1,0);c[o>>2]=141;if((c[245]|0)==-1)c[245]=$b(1,0,20633,20731,c[o>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[245]|0))_b();c[f>>2]=20633;c[f+4>>2]=141;cc(1,61747,f);_b()}function Rc(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0;a=l;l=l+80|0;if((l|0)>=(m|0))$(80);b=a+56|0;d=a+48|0;e=a+40|0;f=a+32|0;g=a+24|0;h=a+16|0;i=a+8|0;j=a;k=a+64|0;n=a+60|0;if(Gd(20777)|0){c[h>>2]=0;o=Hd(37,h)|0;c[k>>2]=o;if(o|0){o=c[3977]|0;h=Cd(c[k>>2]|0)|0;c[g>>2]=20930;c[g+4>>2]=h;Fv(o,20891,g)|0}c[f>>2]=0;g=Hd(44,f)|0;c[k>>2]=g;if(!g){c[d>>2]=0;Hd(38,d)|0;c[b>>2]=0;Hd(48,b)|0;p=kb(0)|0;q=Sc(2,-1)|0;r=p^q;Tc(r);l=a;return}g=c[3977]|0;f=Cd(c[k>>2]|0)|0;c[e>>2]=20945;c[e+4>>2]=f;Fv(g,20891,e)|0;c[d>>2]=0;Hd(38,d)|0;c[b>>2]=0;Hd(48,b)|0;p=kb(0)|0;q=Sc(2,-1)|0;r=p^q;Tc(r);l=a;return}a=c[3977]|0;c[j>>2]=20777;Fv(a,20783,j)|0;c[n>>2]=286;if((c[246]|0)==-1)c[246]=$b(1,0,20849,20865,c[n>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[246]|0))_b();c[i>>2]=20849;c[i+4>>2]=286;cc(1,61747,i);_b()}function Sc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0.0;d=l;l=l+64|0;if((l|0)>=(m|0))$(64);e=d+16|0;f=d+8|0;g=d;h=d+48|0;i=d+44|0;j=d+40|0;k=d+36|0;n=d+32|0;o=d+28|0;p=d+24|0;c[i>>2]=a;c[j>>2]=b;if((c[j>>2]|0)>>>0<=0){c[o>>2]=157;if((c[247]|0)==-1)c[247]=$b(1,0,20849,20965,c[o>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[247]|0))_b();c[g>>2]=20849;c[g+4>>2]=157;cc(1,61747,g);_b()}switch(c[i>>2]|0){case 1:{i=c[17691]|0;c[17691]=i+1;if(!((i>>>0)%256|0)){c[f>>2]=0;Hd(48,f)|0}c[n>>2]=-1-(4294967295%((c[j>>2]|0)>>>0)|0);do De(k,4,1);while((c[k>>2]|0)>>>0>=(c[n>>2]|0)>>>0);c[h>>2]=((c[k>>2]|0)>>>0)%((c[j>>2]|0)>>>0)|0;q=c[h>>2]|0;l=d;return q|0}case 2:{c[n>>2]=-1-(4294967295%((c[j>>2]|0)>>>0)|0);do Ee(k,4);while((c[k>>2]|0)>>>0>=(c[n>>2]|0)>>>0);c[h>>2]=((c[k>>2]|0)>>>0)%((c[j>>2]|0)>>>0)|0;q=c[h>>2]|0;l=d;return q|0}case 0:{r=+((c[j>>2]|0)>>>0);c[k>>2]=~~(r*+Uc())>>>0;if((c[k>>2]|0)>>>0>=(c[j>>2]|0)>>>0)c[k>>2]=(c[j>>2]|0)-1;c[h>>2]=c[k>>2];q=c[h>>2]|0;l=d;return q|0}default:{c[p>>2]=189;if((c[248]|0)==-1)c[248]=$b(1,0,20849,20965,c[p>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[248]|0))_b();c[e>>2]=20849;c[e+4>>2]=189;cc(1,61747,e);_b()}}return 0}function Tc(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;xw(c[d>>2]|0);l=b;return}function Uc(){return +(+(zw()|0)/2147483647.0)}function Vc(){Ge(0,0);return}function Wc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0;e=l;l=l+48|0;if((l|0)>=(m|0))$(48);f=e+16|0;g=e+8|0;h=e;i=e+36|0;j=e+32|0;k=e+28|0;n=e+24|0;c[i>>2]=a;c[j>>2]=b;c[k>>2]=d;switch(c[i>>2]|0){case 1:{i=c[17692]|0;c[17692]=i+1;if(!((i>>>0)%256|0)){c[h>>2]=0;Hd(48,h)|0}De(c[j>>2]|0,c[k>>2]|0,1);l=e;return}case 2:{Ee(c[j>>2]|0,c[k>>2]|0);l=e;return}case 0:{h=c[17692]|0;c[17692]=h+1;if(!((h>>>0)%256|0)){c[g>>2]=0;Hd(48,g)|0}De(c[j>>2]|0,c[k>>2]|0,0);l=e;return}default:{c[n>>2]=135;if((c[249]|0)==-1)c[249]=$b(1,0,20849,20990,c[n>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[249]|0))_b();c[f>>2]=20849;c[f+4>>2]=135;cc(1,61747,f);_b()}}}function Xc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0;b=l;l=l+48|0;if((l|0)>=(m|0))$(48);d=b+16|0;e=b+8|0;f=b;g=b+44|0;h=b+40|0;i=b+36|0;j=b+32|0;k=b+28|0;n=b+24|0;c[g>>2]=a;c[f>>2]=c[g>>2];if(Jd(j,0,21017,f)|0){c[k>>2]=155;if((c[250]|0)==-1)c[250]=$b(1,0,21041,21054,c[k>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[250]|0))_b();c[e>>2]=21041;c[e+4>>2]=155;cc(1,61747,e);_b()}if(!(te(i,c[j>>2]|0)|0)){Kd(c[j>>2]|0);c[h>>2]=Ub(4,21041,164)|0;c[c[h>>2]>>2]=c[i>>2];l=b;return c[h>>2]|0}c[n>>2]=158;if((c[251]|0)==-1)c[251]=$b(1,0,21041,21054,c[n>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[251]|0))_b();c[d>>2]=21041;c[d+4>>2]=158;cc(1,61747,d);_b();return 0}function Yc(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;Kd(c[c[d>>2]>>2]|0);Wb(c[d>>2]|0,21041,179);l=b;return}function Zc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d;f=d+24|0;g=d+20|0;h=d+16|0;i=d+12|0;j=d+8|0;c[f>>2]=a;c[g>>2]=b;c[h>>2]=Ld(c[c[f>>2]>>2]|0,0,0,0)|0;c[i>>2]=Ub(c[h>>2]|0,21041,202)|0;b=(c[h>>2]|0)-1|0;if((b|0)==(Ld(c[c[f>>2]>>2]|0,0,c[i>>2]|0,c[h>>2]|0)|0)){c[c[g>>2]>>2]=c[i>>2];l=d;return c[h>>2]|0}c[j>>2]=207;if((c[252]|0)==-1)c[252]=$b(1,0,21041,21091,c[j>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[252]|0))_b();c[e>>2]=21041;c[e+4>>2]=207;cc(1,61747,e);_b();return 0}function _c(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;d=l;l=l+48|0;if((l|0)>=(m|0))$(48);e=d+8|0;f=d;g=d+32|0;h=d+28|0;i=d+24|0;j=d+20|0;k=d+16|0;n=d+12|0;c[h>>2]=a;c[i>>2]=b;c[j>>2]=Ub(4,21041,226)|0;if(Id(c[j>>2]|0,c[h>>2]|0,c[i>>2]|0,0)|0){c[k>>2]=234;if((c[253]|0)==-1)c[253]=$b(2,21128,21041,21133,c[k>>2]|0)|0;if((ac()|0)<=0){if(c[253]|0)hc(2,21128,21170,f)}else bc(-1,0);Wb(c[j>>2]|0,21041,235);c[g>>2]=0;o=c[g>>2]|0;l=d;return o|0}if(!(se(c[c[j>>2]>>2]|0)|0)){c[g>>2]=c[j>>2];o=c[g>>2]|0;l=d;return o|0}c[n>>2]=241;if((c[254]|0)==-1)c[254]=$b(2,21128,21041,21133,c[n>>2]|0)|0;if((ac()|0)<=0){if(c[254]|0)hc(2,21128,21170,e)}else bc(-1,0);Yc(c[j>>2]|0);c[g>>2]=0;o=c[g>>2]|0;l=d;return o|0}function $c(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;b=l;l=l+64|0;if((l|0)>=(m|0))$(64);d=b+8|0;e=b;f=b+48|0;g=b+44|0;h=b+40|0;i=b+32|0;j=b+24|0;k=b+20|0;n=b+16|0;c[g>>2]=a;c[j>>2]=ad(i,c[c[g>>2]>>2]|0,37989,39361)|0;if(c[j>>2]|0)c[j>>2]=ad(i,c[c[g>>2]>>2]|0,37977,39361)|0;if(c[j>>2]|0)c[j>>2]=ad(i,c[c[g>>2]>>2]|0,40959,39361)|0;if(!(c[j>>2]|0)){g=c[i+4>>2]|0;c[d>>2]=c[i>>2];c[d+4>>2]=g;c[j>>2]=Jd(k,0,21293,d)|0;Qd(c[i>>2]|0);Qd(c[i+4>>2]|0);c[h>>2]=Ub(4,21041,280)|0;c[c[h>>2]>>2]=c[k>>2];c[f>>2]=c[h>>2];o=c[f>>2]|0;l=b;return o|0}c[n>>2]=270;if((c[255]|0)==-1)c[255]=$b(2,0,21041,21204,c[n>>2]|0)|0;if((ac()|0)<=0){if(c[255]|0){c[e>>2]=21041;c[e+4>>2]=270;cc(66,21245,e)}}else bc(-1,0);c[f>>2]=0;o=c[f>>2]|0;l=b;return o|0}function ad(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;g=l;l=l+48|0;if((l|0)>=(m|0))$(48);h=g+36|0;i=g+32|0;j=g+28|0;k=g+24|0;n=g+20|0;o=g+16|0;p=g+12|0;q=g+8|0;r=g+4|0;s=g;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;c[n>>2]=f;f=Md(c[j>>2]|0,c[k>>2]|0,0)|0;c[o>>2]=f;if(!f){c[h>>2]=1;t=c[h>>2]|0;l=g;return t|0}c[p>>2]=Nd(c[o>>2]|0)|0;Kd(c[o>>2]|0);c[o>>2]=c[p>>2];if(!(c[o>>2]|0)){c[h>>2]=2;t=c[h>>2]|0;l=g;return t|0}c[s>>2]=0;c[q>>2]=c[n>>2];while(1){u=c[o>>2]|0;if(!(a[c[q>>2]>>0]|0)){v=18;break}n=Md(u,c[q>>2]|0,1)|0;c[p>>2]=n;if(!n){v=8;break}n=Od(c[p>>2]|0,1,5)|0;c[(c[i>>2]|0)+(c[s>>2]<<2)>>2]=n;Kd(c[p>>2]|0);if(!(c[(c[i>>2]|0)+(c[s>>2]<<2)>>2]|0)){v=13;break}c[q>>2]=(c[q>>2]|0)+1;c[s>>2]=(c[s>>2]|0)+1}if((v|0)==8){c[r>>2]=0;while(1){if((c[r>>2]|0)>>>0>=(c[s>>2]|0)>>>0)break;Ie(c[(c[i>>2]|0)+(c[r>>2]<<2)>>2]|0);c[(c[i>>2]|0)+(c[r>>2]<<2)>>2]=0;c[r>>2]=(c[r>>2]|0)+1}Kd(c[o>>2]|0);c[h>>2]=3;t=c[h>>2]|0;l=g;return t|0}else if((v|0)==13){c[r>>2]=0;while(1){if((c[r>>2]|0)>>>0>=(c[s>>2]|0)>>>0)break;Ie(c[(c[i>>2]|0)+(c[r>>2]<<2)>>2]|0);c[(c[i>>2]|0)+(c[r>>2]<<2)>>2]=0;c[r>>2]=(c[r>>2]|0)+1}Kd(c[o>>2]|0);c[h>>2]=4;t=c[h>>2]|0;l=g;return t|0}else if((v|0)==18){Kd(u);c[h>>2]=0;t=c[h>>2]|0;l=g;return t|0}return 0}function bd(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;Kd(c[c[d>>2]>>2]|0);Wb(c[d>>2]|0,21041,295);l=b;return}function cd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d;f=d+24|0;g=d+20|0;h=d+16|0;i=d+12|0;j=d+8|0;c[f>>2]=a;c[g>>2]=b;c[h>>2]=Ld(c[c[f>>2]>>2]|0,3,0,0)|0;c[i>>2]=Ub(c[h>>2]|0,21041,318)|0;b=(c[h>>2]|0)-1|0;if((b|0)==(Ld(c[c[f>>2]>>2]|0,3,c[i>>2]|0,c[h>>2]|0)|0)){c[c[g>>2]>>2]=c[i>>2];l=d;return c[h>>2]|0}c[j>>2]=323;if((c[256]|0)==-1)c[256]=$b(1,0,21041,21323,c[j>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[256]|0))_b();c[e>>2]=21041;c[e+4>>2]=323;cc(1,61747,e);_b();return 0}function dd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;d=l;l=l+48|0;if((l|0)>=(m|0))$(48);e=d+8|0;f=d;g=d+44|0;h=d+40|0;i=d+36|0;j=d+32|0;k=d+28|0;n=d+24|0;o=d+20|0;p=d+16|0;c[h>>2]=a;c[i>>2]=b;c[j>>2]=Ub(4,21041,367)|0;if(Id(c[j>>2]|0,c[h>>2]|0,c[i>>2]|0,0)|0){c[o>>2]=374;if((c[257]|0)==-1)c[257]=$b(2,0,21041,21359,c[o>>2]|0)|0;if((ac()|0)<=0){if(c[257]|0){c[f>>2]=21041;c[f+4>>2]=374;cc(66,21245,f)}}else bc(-1,0);Wb(c[j>>2]|0,21041,375);c[g>>2]=0;q=c[g>>2]|0;l=d;return q|0}c[n>>2]=ad(k,c[c[j>>2]>>2]|0,37989,39375)|0;if(c[n>>2]|0)c[n>>2]=ad(k,c[c[j>>2]>>2]|0,40959,39375)|0;if(!(c[n>>2]|0)){Qd(c[k>>2]|0);c[g>>2]=c[j>>2];q=c[g>>2]|0;l=d;return q|0}c[p>>2]=385;if((c[258]|0)==-1)c[258]=$b(1,0,21041,21359,c[p>>2]|0)|0;if((ac()|0)<=0){if(c[258]|0){c[e>>2]=21041;c[e+4>>2]=385;cc(1,61747,e)}}else bc(-1,0);Kd(c[c[j>>2]>>2]|0);Wb(c[j>>2]|0,21041,387);c[g>>2]=0;q=c[g>>2]|0;l=d;return q|0}function ed(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d;f=d+24|0;g=d+20|0;h=d+16|0;i=d+12|0;j=d+8|0;c[f>>2]=a;c[g>>2]=b;c[h>>2]=Ld(c[c[f>>2]>>2]|0,3,0,0)|0;c[i>>2]=Ub(c[h>>2]|0,21041,958)|0;b=(c[h>>2]|0)-1|0;if((b|0)==(Ld(c[c[f>>2]>>2]|0,3,c[i>>2]|0,c[h>>2]|0)|0)){c[c[g>>2]>>2]=c[i>>2];l=d;return c[h>>2]|0}c[j>>2]=963;if((c[259]|0)==-1)c[259]=$b(1,0,21041,21395,c[j>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[259]|0))_b();c[e>>2]=21041;c[e+4>>2]=963;cc(1,61747,e);_b();return 0}function fd(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;g=l;l=l+80|0;if((l|0)>=(m|0))$(80);h=g+8|0;i=g;j=g+76|0;k=g+72|0;n=g+68|0;o=g+64|0;p=g+60|0;q=g+56|0;r=g+52|0;s=g+48|0;t=g+40|0;u=g+32|0;v=g+28|0;w=g+24|0;x=g+20|0;y=g+16|0;c[k>>2]=a;c[n>>2]=b;c[o>>2]=d;c[p>>2]=e;c[q>>2]=f;if(!((c[p>>2]|0)!=0&(c[q>>2]|0)!=0)){c[x>>2]=738;if((c[260]|0)==-1)c[260]=$b(1,0,21041,21430,c[x>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[260]|0))_b();c[i>>2]=21041;c[i+4>>2]=738;cc(1,61747,i);_b()}c[w>>2]=ad(t,c[c[o>>2]>>2]|0,37989,39361)|0;if(c[w>>2]|0)c[w>>2]=ad(t,c[c[o>>2]>>2]|0,40959,39361)|0;if(!(c[w>>2]|0)){c[s>>2]=gd(c[o>>2]|0,c[k>>2]|0)|0;do if(c[s>>2]|0){c[r>>2]=hd(c[o>>2]|0,c[n>>2]|0)|0;if(!(c[r>>2]|0)){Qd(c[s>>2]|0);break}c[u>>2]=Pd(0)|0;Vd(c[u>>2]|0,c[c[r>>2]>>2]|0,c[t+4>>2]|0,c[t>>2]|0);c[v>>2]=Pd(0)|0;Ud(c[v>>2]|0,c[s>>2]|0,c[u>>2]|0,c[t>>2]|0);Qd(c[s>>2]|0);Qd(c[t>>2]|0);Qd(c[t+4>>2]|0);Qd(c[u>>2]|0);id(c[r>>2]|0);k=jd(c[v>>2]|0,c[p>>2]|0)|0;c[c[q>>2]>>2]=k;Qd(c[v>>2]|0);c[j>>2]=1;z=c[j>>2]|0;l=g;return z|0}while(0);Qd(c[t>>2]|0);Qd(c[t+4>>2]|0);c[c[p>>2]>>2]=0;c[c[q>>2]>>2]=0;c[j>>2]=0;z=c[j>>2]|0;l=g;return z|0}c[y>>2]=744;if((c[261]|0)==-1)c[261]=$b(1,0,21041,21430,c[y>>2]|0)|0;if((ac()|0)<=0){if(c[261]|0){c[h>>2]=21041;c[h+4>>2]=744;cc(1,61747,h)}}else bc(-1,0);c[c[p>>2]>>2]=0;c[c[q>>2]>>2]=0;c[j>>2]=0;z=c[j>>2]|0;l=g;return z|0}function gd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;d=l;l=l+64|0;if((l|0)>=(m|0))$(64);e=d+8|0;f=d;g=d+52|0;h=d+48|0;i=d+44|0;j=d+40|0;k=d+36|0;n=d+32|0;o=d+28|0;p=d+24|0;q=d+20|0;r=d+16|0;c[h>>2]=a;c[i>>2]=b;if(ad(k,c[c[h>>2]>>2]|0,40959,39375)|0){c[q>>2]=689;if((c[266]|0)==-1)c[266]=$b(1,0,21041,21548,c[q>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[266]|0))_b();c[f>>2]=21041;c[f+4>>2]=689;cc(1,61747,f);_b()}if(!(he(c[k>>2]|0,2)|0)){c[o>>2]=cd(c[h>>2]|0,n)|0;Nc(j,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0,c[i>>2]|0,64,21569);Wb(c[n>>2]|0,21041,704);c[p>>2]=kd(c[j>>2]|0,c[k>>2]|0)|0;Qd(c[k>>2]|0);k=c[j>>2]|0;if(c[p>>2]|0){c[g>>2]=k;s=c[g>>2]|0;l=d;return s|0}else{Qd(k);c[g>>2]=0;s=c[g>>2]|0;l=d;return s|0}}c[r>>2]=691;if((c[267]|0)==-1)c[267]=$b(1,0,21041,21548,c[r>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[267]|0))_b();c[e>>2]=21041;c[e+4>>2]=691;cc(1,61747,e);_b();return 0}function hd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;d=l;l=l+64|0;if((l|0)>=(m|0))$(64);e=d+16|0;f=d+8|0;g=d;h=d+52|0;i=d+48|0;j=d+44|0;k=d+40|0;n=d+36|0;o=d+32|0;p=d+28|0;q=d+24|0;c[h>>2]=a;c[i>>2]=b;c[j>>2]=21480;c[k>>2]=Ub(4,21041,434)|0;if(!(c[k>>2]|0)){c[o>>2]=435;if((c[263]|0)==-1)c[263]=$b(1,0,21041,21511,c[o>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[263]|0))_b();c[g>>2]=21041;c[g+4>>2]=435;cc(1,61747,g);_b()}if(ad(n,c[c[h>>2]>>2]|0,40959,39375)|0){c[p>>2]=438;if((c[264]|0)==-1)c[264]=$b(1,0,21041,21511,c[p>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[264]|0))_b();c[f>>2]=21041;c[f+4>>2]=438;cc(1,61747,f);_b()}if(!(he(c[n>>2]|0,2)|0)){f=c[k>>2]|0;p=c[n>>2]|0;h=c[j>>2]|0;g=hv(c[j>>2]|0)|0;Nc(f,p,h,g,c[i>>2]|0,32,21535);if(kd(c[c[k>>2]>>2]|0,c[n>>2]|0)|0){r=c[n>>2]|0;Qd(r);s=c[k>>2]|0;l=d;return s|0}Wb(c[k>>2]|0,21041,448);c[k>>2]=0;r=c[n>>2]|0;Qd(r);s=c[k>>2]|0;l=d;return s|0}c[q>>2]=440;if((c[265]|0)==-1)c[265]=$b(1,0,21041,21511,c[q>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[265]|0))_b();c[e>>2]=21041;c[e+4>>2]=440;cc(1,61747,e);_b();return 0}function id(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;Qd(c[c[d>>2]>>2]|0);Wb(c[d>>2]|0,21041,631);l=b;return}function jd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d;f=d+28|0;g=d+24|0;h=d+20|0;i=d+16|0;j=d+8|0;c[f>>2]=a;c[g>>2]=b;Td(5,0,0,h,c[f>>2]|0)|0;c[i>>2]=Ub(c[h>>2]|0,21041,655)|0;if(!(Td(5,c[i>>2]|0,c[h>>2]|0,d+12|0,c[f>>2]|0)|0)){c[c[g>>2]>>2]=c[i>>2];l=d;return c[h>>2]|0}c[j>>2]=661;if((c[262]|0)==-1)c[262]=$b(1,0,21041,21454,c[j>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[262]|0))_b();c[e>>2]=21041;c[e+4>>2]=661;cc(1,61747,e);_b();return 0}function kd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=Pd(0)|0;c[h>>2]=Wd(c[g>>2]|0,c[e>>2]|0,c[f>>2]|0)|0;Qd(c[g>>2]|0);l=d;return c[h>>2]|0}function ld(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=l;l=l+32|0;if((l|0)>=(m|0))$(32);d=b+8|0;e=b;f=b+24|0;g=b+20|0;h=b+16|0;c[f>>2]=a;c[g>>2]=0;c[e>>2]=c[f>>2];if(!(Jd(g,0,21584,e)|0)){l=b;return c[g>>2]|0}c[h>>2]=806;if((c[268]|0)==-1)c[268]=$b(1,0,21041,21614,c[h>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[268]|0))_b();c[d>>2]=21041;c[d+4>>2]=806;cc(1,61747,d);_b();return 0}function md(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;Kd(c[c[d>>2]>>2]|0);Wb(c[d>>2]|0,21041,936);l=b;return}function nd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;d=l;l=l+48|0;if((l|0)>=(m|0))$(48);e=d+8|0;f=d;g=d+44|0;h=d+40|0;i=d+36|0;j=d+32|0;k=d+28|0;n=d+24|0;o=d+20|0;p=d+16|0;c[h>>2]=a;c[i>>2]=b;c[j>>2]=Ub(4,21041,985)|0;if(Id(c[j>>2]|0,c[h>>2]|0,c[i>>2]|0,0)|0){c[o>>2]=992;if((c[269]|0)==-1)c[269]=$b(2,0,21041,21626,c[o>>2]|0)|0;if((ac()|0)<=0){if(c[269]|0){c[f>>2]=21041;c[f+4>>2]=992;cc(66,21245,f)}}else bc(-1,0);Wb(c[j>>2]|0,21041,993);c[g>>2]=0;q=c[g>>2]|0;l=d;return q|0}c[k>>2]=ad(n,c[c[j>>2]>>2]|0,37839,39373)|0;if(c[k>>2]|0)c[k>>2]=ad(n,c[c[j>>2]>>2]|0,40959,39373)|0;if(!(c[k>>2]|0)){Qd(c[n>>2]|0);c[g>>2]=c[j>>2];q=c[g>>2]|0;l=d;return q|0}c[p>>2]=1003;if((c[270]|0)==-1)c[270]=$b(2,0,21041,21626,c[p>>2]|0)|0;if((ac()|0)<=0){if(c[270]|0){c[e>>2]=21041;c[e+4>>2]=1003;cc(66,21245,e)}}else bc(-1,0);Kd(c[c[j>>2]>>2]|0);Wb(c[j>>2]|0,21041,1005);c[g>>2]=0;q=c[g>>2]|0;l=d;return q|0}function od(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;e=l;l=l+112|0;if((l|0)>=(m|0))$(112);f=e+40|0;g=e+32|0;h=e+24|0;i=e+16|0;j=e+8|0;k=e;n=e+108|0;o=e+104|0;p=e+100|0;q=e+96|0;r=e+92|0;s=e+88|0;t=e+84|0;u=e+80|0;v=e+76|0;w=e+72|0;x=e+68|0;y=e+64|0;z=e+60|0;A=e+56|0;B=e+52|0;C=e+48|0;c[o>>2]=a;c[p>>2]=b;c[q>>2]=d;c[w>>2]=ad(s,c[c[q>>2]>>2]|0,37989,39375)|0;if(c[w>>2]|0)c[w>>2]=ad(s,c[c[q>>2]>>2]|0,40959,39375)|0;if(c[w>>2]|0){c[y>>2]=1066;if((c[271]|0)==-1)c[271]=$b(2,0,21041,21661,c[y>>2]|0)|0;if((ac()|0)<=0){if(c[271]|0){c[k>>2]=21041;c[k+4>>2]=1066;cc(66,21245,k)}}else bc(-1,0);c[n>>2]=0;D=c[n>>2]|0;l=e;return D|0}c[w>>2]=ad(t,c[c[o>>2]>>2]|0,37839,39373)|0;if(c[w>>2]|0)c[w>>2]=ad(t,c[c[o>>2]>>2]|0,40959,39373)|0;if(c[w>>2]|0){Qd(c[s>>2]|0);c[z>>2]=1075;if((c[272]|0)==-1)c[272]=$b(2,0,21041,21661,c[z>>2]|0)|0;if((ac()|0)<=0){if(c[272]|0){c[j>>2]=21041;c[j+4>>2]=1075;cc(66,21245,j)}}else bc(-1,0);c[n>>2]=0;D=c[n>>2]|0;l=e;return D|0}c[r>>2]=hd(c[q>>2]|0,c[p>>2]|0)|0;if(!(c[r>>2]|0)){c[A>>2]=1086;if((c[273]|0)==-1)c[273]=$b(2,0,21041,21661,c[A>>2]|0)|0;if((ac()|0)<=0){if(c[273]|0){c[i>>2]=21041;c[i+4>>2]=1086;cc(66,21245,i)}}else bc(-1,0);Qd(c[s>>2]|0);Qd(c[t>>2]|0);c[n>>2]=0;D=c[n>>2]|0;l=e;return D|0}c[u>>2]=Pd(0)|0;if(1!=(Xd(c[u>>2]|0,c[c[r>>2]>>2]|0,c[s>>2]|0)|0)){c[B>>2]=1100;if((c[274]|0)==-1)c[274]=$b(2,0,21041,21661,c[B>>2]|0)|0;if((ac()|0)<=0){if(c[274]|0){c[h>>2]=21041;c[h+4>>2]=1100;cc(66,21245,h)}}else bc(-1,0);Qd(c[u>>2]|0);id(c[r>>2]|0);Qd(c[s>>2]|0);Qd(c[t>>2]|0);c[n>>2]=0;D=c[n>>2]|0;l=e;return D|0}c[v>>2]=Pd(0)|0;Ud(c[v>>2]|0,c[t>>2]|0,c[u>>2]|0,c[s>>2]|0);Qd(c[s>>2]|0);Qd(c[u>>2]|0);Qd(c[t>>2]|0);id(c[r>>2]|0);c[x>>2]=Ub(4,21041,1115)|0;r=c[x>>2]|0;c[g>>2]=c[v>>2];if(!(Jd(r,0,21687,g)|0)){Qd(c[v>>2]|0);c[n>>2]=c[x>>2];D=c[n>>2]|0;l=e;return D|0}c[C>>2]=1120;if((c[275]|0)==-1)c[275]=$b(1,0,21041,21661,c[C>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[275]|0))_b();c[f>>2]=21041;c[f+4>>2]=1120;cc(1,61747,f);_b();return 0}function pd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;e=l;l=l+64|0;if((l|0)>=(m|0))$(64);f=e+8|0;g=e;h=e+52|0;i=e+48|0;j=e+44|0;k=e+40|0;n=e+36|0;o=e+32|0;p=e+28|0;q=e+24|0;r=e+20|0;c[i>>2]=a;c[j>>2]=b;c[k>>2]=d;c[o>>2]=gd(c[k>>2]|0,c[i>>2]|0)|0;if(!(c[o>>2]|0)){c[q>>2]=1146;if((c[276]|0)==-1)c[276]=$b(2,0,21041,21710,c[q>>2]|0)|0;if((ac()|0)<=0){if(c[276]|0){c[g>>2]=21041;c[g+4>>2]=1146;cc(66,21245,g)}}else bc(-1,0);c[h>>2]=0;s=c[h>>2]|0;l=e;return s|0}c[n>>2]=ld(c[o>>2]|0)|0;Qd(c[o>>2]|0);c[p>>2]=re(c[c[j>>2]>>2]|0,c[n>>2]|0,c[c[k>>2]>>2]|0)|0;Kd(c[n>>2]|0);if(!(c[p>>2]|0)){c[h>>2]=1;s=c[h>>2]|0;l=e;return s|0}c[r>>2]=1169;if((c[277]|0)==-1)c[277]=$b(2,21128,21041,21710,c[r>>2]|0)|0;if((ac()|0)<=0){if(c[277]|0){r=Cd(c[p>>2]|0)|0;c[f>>2]=21041;c[f+4>>2]=1168;c[f+8>>2]=r;hc(2,21128,21735,f)}}else bc(-1,0);c[h>>2]=-1;s=c[h>>2]|0;l=e;return s|0}function qd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;d=l;l=l+48|0;if((l|0)>=(m|0))$(48);e=d+16|0;f=d+40|0;g=d+36|0;h=d+32|0;i=d+8|0;j=d;c[g>>2]=b;c[h>>2]=21823;b=a;k=c[b+4>>2]|0;n=i;c[n>>2]=c[b>>2];c[n+4>>2]=k;k=wd()|0;n=j;c[n>>2]=k;c[n+4>>2]=D;n=j;j=a;if((c[n>>2]|0)==(c[j>>2]|0)?(c[n+4>>2]|0)==(c[j+4>>2]|0):0){c[f>>2]=21801;o=c[f>>2]|0;l=d;return o|0}j=a;if(0==(c[j>>2]|0)?0==(c[j+4>>2]|0):0){c[f>>2]=21827;o=c[f>>2]|0;l=d;return o|0}j=i;a=c[j+4>>2]|0;if(!(!(1==(c[g>>2]|0)&(a>>>0>0|(a|0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0==(c[a+4>>2]|0):0){c[h>>2]=21814;break}else{c[h>>2]=21818;break}}while(0);g=i;i=c[g+4>>2]|0;p=c[h>>2]|0;h=e;c[h>>2]=c[g>>2];c[h+4>>2]=i;c[e+8>>2]=p;Xb(72095,128,21793,e)|0;c[f>>2]=72095;o=c[f>>2]|0;l=d;return o|0}function rd(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;h=l;l=l+96|0;if((l|0)>=(m|0))$(96);i=h+24|0;j=h+16|0;k=h+8|0;n=h;o=h+84|0;p=h+80|0;q=h+76|0;r=h+72|0;s=h+68|0;t=h+64|0;u=h+60|0;v=h+56|0;w=h+52|0;x=h+48|0;y=h+44|0;z=h+40|0;A=h+36|0;B=h+32|0;c[p>>2]=b;c[q>>2]=e;c[r>>2]=f;c[s>>2]=g;c[x>>2]=c[p>>2];if((c[s>>2]|0)>>>0<((((c[q>>2]<<3)+4|0)>>>0)/5|0)>>>0){c[y>>2]=883;if((c[278]|0)==-1)c[278]=$b(1,0,21783,21832,c[y>>2]|0)|0;if((ac()|0)<=0){if(c[278]|0){c[n>>2]=21783;c[n+4>>2]=883;cc(1,61747,n)}}else bc(-1,0);c[o>>2]=0;C=c[o>>2]|0;l=h;return C|0}c[w>>2]=0;c[t>>2]=0;c[u>>2]=0;c[v>>2]=0;while(1){if(!((c[u>>2]|0)>>>0<(c[q>>2]|0)>>>0?1:(c[w>>2]|0)>>>0>0)){D=32;break}if((c[w>>2]|0)>>>0<5?(c[u>>2]|0)>>>0<(c[q>>2]|0)>>>0:0){n=c[v>>2]<<8;y=c[u>>2]|0;c[u>>2]=y+1;c[v>>2]=n|(d[(c[x>>2]|0)+y>>0]|0);c[w>>2]=(c[w>>2]|0)+8}if((c[w>>2]|0)>>>0<5){c[v>>2]=c[v>>2]<<5-(c[w>>2]|0);if((c[w>>2]|0)!=((c[q>>2]<<3>>>0)%5|0|0)){D=15;break}c[w>>2]=5}if((c[t>>2]|0)>>>0>=(c[s>>2]|0)>>>0){D=24;break}y=a[(c[281]|0)+((c[v>>2]|0)>>>((c[w>>2]|0)-5|0)&31)>>0]|0;n=c[t>>2]|0;c[t>>2]=n+1;a[(c[r>>2]|0)+n>>0]=y;c[w>>2]=(c[w>>2]|0)-5}if((D|0)==15){c[z>>2]=900;if((c[279]|0)==-1)c[279]=$b(1,0,21783,21832,c[z>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[279]|0))_b();c[k>>2]=21783;c[k+4>>2]=900;cc(1,61747,k);_b()}else if((D|0)==24){c[A>>2]=905;if((c[280]|0)==-1)c[280]=$b(1,0,21783,21832,c[A>>2]|0)|0;if((ac()|0)<=0){if(c[280]|0){c[j>>2]=21783;c[j+4>>2]=905;cc(1,61747,j)}}else bc(-1,0);c[o>>2]=0;C=c[o>>2]|0;l=h;return C|0}else if((D|0)==32){if(!(c[w>>2]|0)){if((c[t>>2]|0)>>>0<(c[s>>2]|0)>>>0)a[(c[r>>2]|0)+(c[t>>2]|0)>>0]=0;c[o>>2]=(c[r>>2]|0)+(c[t>>2]|0);C=c[o>>2]|0;l=h;return C|0}c[B>>2]=911;if((c[282]|0)==-1)c[282]=$b(1,0,21783,21832,c[B>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[282]|0))_b();c[i>>2]=21783;c[i+4>>2]=911;cc(1,61747,i);_b()}return 0}function sd(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+20|0;g=e+16|0;h=e+12|0;i=e+8|0;j=e+4|0;k=e;c[g>>2]=b;c[h>>2]=d;c[j>>2]=c[h>>2]<<3;if((((c[j>>2]|0)>>>0)%5|0)>>>0>0)c[j>>2]=(c[j>>2]|0)+(5-(((c[j>>2]|0)>>>0)%5|0));c[j>>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1;y=c[i>>2]|0;l=g;return y|0}if(-1==(c[t>>2]|0)){c[i>>2]=-1;y=c[i>>2]|0;l=g;return y|0}while(1){z=c[p>>2]|0;if((c[q>>2]|0)>>>0<=0){A=25;break}if(!z){A=14;break}k=(c[p>>2]|0)+-1|0;c[p>>2]=k;u=ud(a[(c[j>>2]|0)+k>>0]|0)|0;c[t>>2]=u;c[r>>2]=u<>2]|c[r>>2];if(-1==(c[t>>2]|0)){A=22;break}c[s>>2]=(c[s>>2]|0)+5;if((c[s>>2]|0)>>>0<8)continue;u=c[r>>2]&255;k=(c[q>>2]|0)+-1|0;c[q>>2]=k;a[(c[v>>2]|0)+k>>0]=u;c[r>>2]=(c[r>>2]|0)>>>8;c[s>>2]=(c[s>>2]|0)-8}if((A|0)==14){c[x>>2]=1003;if((c[283]|0)==-1)c[283]=$b(1,0,21783,21895,c[x>>2]|0)|0;if((ac()|0)<=0){if(c[283]|0){c[h>>2]=21783;c[h+4>>2]=1003;cc(1,61747,h)}}else bc(-1,0);c[i>>2]=-1;y=c[i>>2]|0;l=g;return y|0}else if((A|0)==22){c[i>>2]=-1;y=c[i>>2]|0;l=g;return y|0}else if((A|0)==25)if(0!=(z|0)|0!=(c[s>>2]|0)){c[i>>2]=-1;y=c[i>>2]|0;l=g;return y|0}else{c[i>>2]=1;y=c[i>>2]|0;l=g;return y|0}return 0}function ud(b){b=b|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+4|0;g=e+8|0;h=e;a[g>>0]=b;switch(d[g>>0]|0|0){case 111:case 79:{a[g>>0]=48;break}case 76:case 108:case 73:case 105:{a[g>>0]=49;break}case 85:case 117:{a[g>>0]=86;break}default:{}}if((d[g>>0]|0|0)>=48?(d[g>>0]|0|0)<=57:0){c[f>>2]=(d[g>>0]|0)-48;i=c[f>>2]|0;l=e;return i|0}if((d[g>>0]|0|0)>=97?(d[g>>0]|0|0)<=122:0)a[g>>0]=gv(d[g>>0]|0)|0;c[h>>2]=0;if((d[g>>0]|0|0)>=65?(d[g>>0]|0|0)<=90:0){if(73<(d[g>>0]|0|0))c[h>>2]=(c[h>>2]|0)+1;if(76<(d[g>>0]|0|0))c[h>>2]=(c[h>>2]|0)+1;if(79<(d[g>>0]|0|0))c[h>>2]=(c[h>>2]|0)+1;if(85<(d[g>>0]|0|0))c[h>>2]=(c[h>>2]|0)+1;c[f>>2]=(d[g>>0]|0)-65+10-(c[h>>2]|0);i=c[f>>2]|0;l=e;return i|0}c[f>>2]=-1;i=c[f>>2]|0;l=e;return i|0}function vd(){var a=0;a=70696;D=c[a+4>>2]|0;return c[a>>2]|0}function wd(){var a=0,b=0,d=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;c[b>>2]=c[16];c[b+4>>2]=c[17];d=b;D=c[d+4>>2]|0;l=a;return c[d>>2]|0}function xd(){var a=0,b=0,d=0,e=0,f=0,g=0;a=l;l=l+32|0;if((l|0)>=(m|0))$(32);b=a+8|0;d=a;e=a+16|0;lb(e|0,0)|0;f=c[e>>2]|0;g=gx(f|0,((f|0)<0)<<31>>31|0,1e3,0)|0;f=gx(g|0,D|0,1e3,0)|0;g=c[e+4>>2]|0;e=Ww(f|0,D|0,g|0,((g|0)<0)<<31>>31|0)|0;g=70696;f=Ww(e|0,D|0,c[g>>2]|0,c[g+4>>2]|0)|0;g=d;c[g>>2]=f;c[g+4>>2]=D;c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];d=b;D=c[d+4>>2]|0;l=a;return c[d>>2]|0}function yd(){var a=0,b=0,d=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;c[b>>2]=c[17676];c[b+4>>2]=c[17677];d=b;D=c[d+4>>2]|0;l=a;return c[d>>2]|0}function zd(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0;b=l;l=l+32|0;if((l|0)>=(m|0))$(32);d=b+24|0;e=b+16|0;f=b+8|0;g=b;h=xd()|0;i=g;c[i>>2]=h;c[i+4>>2]=D;c[e>>2]=c[g>>2];c[e+4>>2]=c[g+4>>2];g=a;i=c[g+4>>2]|0;h=e;j=c[h+4>>2]|0;if(i>>>0>j>>>0|((i|0)==(j|0)?(c[g>>2]|0)>>>0>(c[h>>2]|0)>>>0:0)){h=yd()|0;g=d;c[g>>2]=h;c[g+4>>2]=D;k=d;n=k;o=c[n>>2]|0;p=k+4|0;q=p;r=c[q>>2]|0;D=r;l=b;return o|0}else{g=e;e=a;a=Tw(c[g>>2]|0,c[g+4>>2]|0,c[e>>2]|0,c[e+4>>2]|0)|0;e=f;c[e>>2]=a;c[e+4>>2]=D;c[d>>2]=c[f>>2];c[d+4>>2]=c[f+4>>2];k=d;n=k;o=c[n>>2]|0;p=k+4|0;q=p;r=c[q>>2]|0;D=r;l=b;return o|0}return 0}function Ad(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d;f=e;c[f>>2]=a;c[f+4>>2]=b;b=Iv(c[e>>2]|0)|0;f=Ww(0,b|0,Iv(c[e+4>>2]|0)|0,0)|0;l=d;return f|0}function Bd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d;f=e;c[f>>2]=a;c[f+4>>2]=b;b=Mv(c[e>>2]|0)|0;f=Ww(0,b|0,Mv(c[e+4>>2]|0)|0,0)|0;l=d;return f|0}function Cd(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=Dd(c[d>>2]|0)|0;l=b;return a|0}function Dd(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=Bt(c[d>>2]|0)|0;l=b;return a|0}function Ed(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){g=0;l=d;return g|0}g=(c[e>>2]&127)<<24|c[f>>2]&65535;l=d;return g|0}function Fd(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=Ed(1,c[d>>2]|0)|0;l=b;return a|0}function Gd(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=gf(c[d>>2]|0)|0;l=b;return a|0}function Hd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+20|0;f=d+16|0;g=d;c[e>>2]=a;c[g>>2]=b;c[f>>2]=Fd(kf(c[e>>2]|0,g)|0)|0;l=d;return c[f>>2]|0}function Id(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+12|0;h=f+8|0;i=f+4|0;j=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;e=Fd(Sf(c[g>>2]|0,c[h>>2]|0,c[i>>2]|0,c[j>>2]|0)|0)|0;l=f;return e|0}function Jd(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+28|0;h=f+24|0;i=f+20|0;j=f+16|0;k=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[k>>2]=e;c[j>>2]=dg(c[g>>2]|0,c[h>>2]|0,c[i>>2]|0,k)|0;k=Fd(c[j>>2]|0)|0;l=f;return k|0}function Kd(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;Rf(c[d>>2]|0);l=b;return}function Ld(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+12|0;h=f+8|0;i=f+4|0;j=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;e=fg(c[g>>2]|0,c[h>>2]|0,c[i>>2]|0,c[j>>2]|0)|0;l=f;return e|0}function Md(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;d=Tf(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;l=e;return d|0}function Nd(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=bg(c[d>>2]|0)|0;l=b;return a|0}function Od(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;d=$f(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;l=e;return d|0}function Pd(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=Rp(c[d>>2]|0)|0;l=b;return a|0}function Qd(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;Tp(c[d>>2]|0);l=b;return}function Rd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=wo(c[e>>2]|0,c[f>>2]|0)|0;l=d;return b|0}function Sd(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g+16|0;i=g+12|0;j=g+8|0;k=g+4|0;n=g;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;c[n>>2]=f;f=Fd(Zo(c[h>>2]|0,c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0)|0)|0;l=g;return f|0}function Td(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g+16|0;i=g+12|0;j=g+8|0;k=g+4|0;n=g;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;c[n>>2]=f;f=Fd(bp(c[h>>2]|0,c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0)|0)|0;l=g;return f|0}function Ud(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+12|0;h=f+8|0;i=f+4|0;j=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;Ro(c[g>>2]|0,c[h>>2]|0,c[i>>2]|0,c[j>>2]|0);l=f;return}function Vd(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+12|0;h=f+8|0;i=f+4|0;j=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;So(c[g>>2]|0,c[h>>2]|0,c[i>>2]|0,c[j>>2]|0);l=f;return}function Wd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;d=Fo(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;l=e;return d|0}function Xd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;d=Lo(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;l=e;return d|0}function Yd(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=xn(c[d>>2]|0)|0;l=b;return a|0}function Zd(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;zn(c[d>>2]|0);l=b;return}function _d(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;d=Fd(Wh(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0)|0;l=e;return d|0}function $d(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;d=Jn(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;l=e;return d|0}function ae(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;d=Kn(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;l=e;return d|0}function be(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+12|0;h=f+8|0;i=f+4|0;j=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;e=c[g>>2]|0;g=c[h>>2]|0;h=c[i>>2]|0;i=tn(e,g,h,rh(c[j>>2]|0,1)|0)|0;l=f;return i|0}function ce(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+12|0;h=f+8|0;i=f+4|0;j=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;e=c[g>>2]|0;g=c[h>>2]|0;h=c[i>>2]|0;$n(e,g,h,rh(c[j>>2]|0,1)|0);l=f;return}function de(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=lo(c[d>>2]|0)|0;l=b;return a|0}function ee(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=mo(c[e>>2]|0,c[f>>2]|0)|0;l=d;return b|0}function fe(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;po(c[e>>2]|0,c[f>>2]|0);l=d;return}function ge(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=Gp(c[e>>2]|0,c[f>>2]|0)|0;l=d;return b|0}function he(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=Vp(c[e>>2]|0,c[f>>2]|0)|0;l=d;return b|0}function ie(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+16|0;h=f+12|0;i=f+8|0;j=f+4|0;k=f;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;e=(ef()|0)!=0;d=c[h>>2]|0;if(e){c[g>>2]=Fd(wh(d,c[i>>2]|0,c[j>>2]|0,c[k>>2]|0)|0)|0;n=c[g>>2]|0;l=f;return n|0}else{c[d>>2]=0;c[g>>2]=Fd(176)|0;n=c[g>>2]|0;l=f;return n|0}return 0}function je(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;Bh(c[d>>2]|0);l=b;return}function ke(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;if(ef()|0){c[f>>2]=le(Jh(c[g>>2]|0,c[h>>2]|0,c[i>>2]|0)|0)|0;j=c[f>>2]|0;l=e;return j|0}else{c[f>>2]=Fd(176)|0;j=c[f>>2]|0;l=e;return j|0}return 0}function le(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=me(32,c[d>>2]|0)|0;l=b;return a|0}function me(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=Ed(c[e>>2]|0,c[f>>2]|0)|0;l=d;return b|0}function ne(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;if(ef()|0){c[f>>2]=le(Lh(c[g>>2]|0,c[h>>2]|0,c[i>>2]|0)|0)|0;j=c[f>>2]|0;l=e;return j|0}else{c[f>>2]=Fd(176)|0;j=c[f>>2]|0;l=e;return j|0}return 0}function oe(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g+20|0;i=g+16|0;j=g+12|0;k=g+8|0;n=g+4|0;o=g;c[i>>2]=a;c[j>>2]=b;c[k>>2]=d;c[n>>2]=e;c[o>>2]=f;if(ef()|0){c[h>>2]=Fd(Ch(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0)|0)|0;p=c[h>>2]|0;l=g;return p|0}if(c[j>>2]|0)Uw(c[j>>2]|0,66,c[k>>2]|0)|0;c[h>>2]=Fd(176)|0;p=c[h>>2]|0;l=g;return p|0}function pe(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g+20|0;i=g+16|0;j=g+12|0;k=g+8|0;n=g+4|0;o=g;c[i>>2]=a;c[j>>2]=b;c[k>>2]=d;c[n>>2]=e;c[o>>2]=f;if(ef()|0){c[h>>2]=Fd(Gh(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0)|0)|0;p=c[h>>2]|0;l=g;return p|0}else{c[h>>2]=Fd(176)|0;p=c[h>>2]|0;l=g;return p|0}return 0}function qe(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;d=(ef()|0)!=0;b=c[g>>2]|0;if(d){c[f>>2]=Fd(Wj(b,c[h>>2]|0,c[i>>2]|0)|0)|0;j=c[f>>2]|0;l=e;return j|0}else{c[b>>2]=0;c[f>>2]=Fd(176)|0;j=c[f>>2]|0;l=e;return j|0}return 0}function re(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;if(ef()|0){c[f>>2]=Fd(Xj(c[g>>2]|0,c[h>>2]|0,c[i>>2]|0)|0)|0;j=c[f>>2]|0;l=e;return j|0}else{c[f>>2]=Fd(176)|0;j=c[f>>2]|0;l=e;return j|0}return 0}function se(a){a=a|0;var b=0,d=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[e>>2]=a;if(ef()|0){c[d>>2]=Fd(Yj(c[e>>2]|0)|0)|0;f=c[d>>2]|0;l=b;return f|0}else{c[d>>2]=Fd(176)|0;f=c[d>>2]|0;l=b;return f|0}return 0}function te(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+8|0;f=d+4|0;g=d;c[f>>2]=a;c[g>>2]=b;b=(ef()|0)!=0;a=c[f>>2]|0;if(b){c[e>>2]=Fd(Zj(a,c[g>>2]|0)|0)|0;h=c[e>>2]|0;l=d;return h|0}else{c[a>>2]=0;c[e>>2]=Fd(176)|0;h=c[e>>2]|0;l=d;return h|0}return 0}function ue(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;d=(ef()|0)!=0;b=c[g>>2]|0;if(d){c[f>>2]=Fd(Si(b,c[h>>2]|0,c[i>>2]|0)|0)|0;j=c[f>>2]|0;l=e;return j|0}else{c[b>>2]=0;c[f>>2]=Fd(176)|0;j=c[f>>2]|0;l=e;return j|0}return 0}function ve(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;_i(c[d>>2]|0);l=b;return}function we(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;Zi(c[d>>2]|0);l=b;return}function xe(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if(!(ef()|0)){l=e;return}$i(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);l=e;return}function ye(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=lj(c[e>>2]|0,c[f>>2]|0)|0;l=d;return b|0}function ze(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+12|0;h=f+8|0;i=f+4|0;j=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;if(!(ef()|0))dh(21925,1175,21938,0,21958);hj(c[g>>2]|0,c[h>>2]|0,c[i>>2]|0,c[j>>2]|0);l=f;return}function Ae(a){a=a|0;var b=0,d=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[e>>2]=a;if(ef()|0){c[d>>2]=nj(c[e>>2]|0)|0;f=c[d>>2]|0;l=b;return f|0}else{dh(21925,1198,21990,0,22007);c[d>>2]=0;f=c[d>>2]|0;l=b;return f|0}return 0}function Be(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=oj(c[d>>2]|0)|0;l=b;return a|0}function Ce(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;if(ef()|0){c[f>>2]=Fd(fj(c[g>>2]|0,c[h>>2]|0,c[i>>2]|0)|0)|0;j=c[f>>2]|0;l=e;return j|0}else{c[f>>2]=Fd(176)|0;j=c[f>>2]|0;l=e;return j|0}return 0}function De(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if(!(ef()|0)){dh(21925,1287,22037,1,21958);Yg()}jn(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);l=e;return}function Ee(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(ef()|0)){dh(21925,1340,22052,1,21958);Yg()}nn(c[e>>2]|0,c[f>>2]|0);l=d;return}function Fe(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;sh(c[d>>2]|0);l=b;return}function Ge(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;Gf(c[e>>2]|0,c[f>>2]|0);l=d;return}function He(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;Ke(c[e>>2]|0,c[f>>2]|0);l=d;return}function Ie(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;vf(c[d>>2]|0);l=b;return}function Je(a){a=a|0;var b=0,d=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[e>>2]=a;if(c[17693]|0){c[d>>2]=yb[c[17693]&15](c[e>>2]|0)|0;f=c[d>>2]|0;l=b;return f|0}else{c[d>>2]=c[e>>2];f=c[d>>2]|0;l=b;return f|0}return 0}function Ke(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;c[17694]=c[f>>2];c[17695]=c[e>>2];l=d;return}function Le(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0))c[f>>2]=Bt(c[e>>2]|0)|0;if(c[17695]|0?(Wg()|0)==0:0)zb[c[17695]&7](c[17694]|0,c[e>>2]|0,c[f>>2]|0);dh(22070,86,22077,1,c[f>>2]|0);Me(22095);Me(c[f>>2]|0);Me(22526);Tg();Aa()}function Me(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;c[d>>2]=a;a=c[d>>2]|0;c[b>>2]=ew(2,a,hv(c[d>>2]|0)|0)|0;l=b;return}function Ne(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;c[17698]=c[d>>2];l=b;return}function Oe(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;l=b;return (c[17698]|0)>=(c[d>>2]|0)|0}function Pe(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e;g=e+12|0;h=e+8|0;i=e+4|0;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;if(c[17696]|0)Eb[c[17696]&1](c[17697]|0,c[g>>2]|0,c[h>>2]|0,c[i>>2]|0);else{switch(c[g>>2]|0){case 30:case 20:case 10:case 0:break;case 40:{Yv(22110,c[3977]|0)|0;break}case 50:{Yv(22118,c[3977]|0)|0;break}case 100:{Yv(22132,c[3977]|0)|0;break}default:{d=c[3977]|0;c[f>>2]=c[g>>2];Fv(d,22138,f)|0}}Uu(c[3977]|0,c[h>>2]|0,c[i>>2]|0)|0}if((c[g>>2]|0)==40|(c[g>>2]|0)==50){dh(22070,140,22163,1,22174);Tg();Aa()}else{l=e;return}}function Qe(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+20|0;g=e+16|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;Pe(c[f>>2]|0,c[g>>2]|0,h);l=e;return}function Re(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e;g=e+20|0;h=e+16|0;i=e+12|0;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;d=c[h>>2]|0;h=c[i>>2]|0;c[f>>2]=c[g>>2];c[f+4>>2]=d;c[f+8>>2]=h;Qe(50,22204,f);Aa()}function Se(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f;h=f+28|0;i=f+24|0;j=f+20|0;k=f+16|0;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;e=c[i>>2]|0;i=c[j>>2]|0;j=c[k>>2]|0;c[g>>2]=c[h>>2];c[g+4>>2]=e;c[g+8>>2]=i;c[g+12>>2]=j;Qe(50,22234,g);Aa()}function Te(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d;c[e>>2]=a;c[f>>2]=b;Pe(10,c[e>>2]|0,f);l=d;return}function Ue(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+16|0;g=e;c[e+20>>2]=a;c[f>>2]=b;c[g>>2]=d;Pe(10,c[f>>2]|0,g);l=e;return 0}function Ve(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d;c[e>>2]=a;c[f>>2]=b;Pe(30,c[e>>2]|0,f);l=d;return}function We(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d;c[e>>2]=a;c[f>>2]=b;Pe(40,c[e>>2]|0,f);Aa()}function Xe(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d;c[e>>2]=a;c[f>>2]=b;Pe(50,c[e>>2]|0,f);Aa()}function Ye(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d;c[e>>2]=a;c[f>>2]=b;Pe(100,c[e>>2]|0,f);l=d;return}function Ze(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d;c[e>>2]=a;if(!(c[e>>2]|0)){l=d;return}c[f>>2]=b;Pe(0,c[e>>2]|0,f);l=d;return}function _e(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;$e(c[f>>2]|0,22268,c[g>>2]|0,c[h>>2]|0);l=e;return}function $e(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;h=l;l=l+96|0;if((l|0)>=(m|0))$(96);i=h+56|0;j=h+40|0;k=h+32|0;n=h+24|0;o=h+16|0;p=h+8|0;q=h;r=h+84|0;s=h+80|0;t=h+76|0;u=h+72|0;v=h+68|0;w=h+64|0;x=h+60|0;c[r>>2]=b;c[s>>2]=e;c[t>>2]=f;c[u>>2]=g;c[v>>2]=0;c[w>>2]=0;if((c[r>>2]|0?a[c[r>>2]>>0]|0:0)?(c[v>>2]=1,g=c[s>>2]|0,c[q>>2]=c[r>>2],c[q+4>>2]=g,Ye(22270,q),(c[u>>2]|0?(a[(c[s>>2]|0)+1>>0]|0)==91:0)&(c[t>>2]|0)!=0):0){Ze(22526,p);c[s>>2]=22268;c[o>>2]=hv(c[r>>2]|0)|0;c[o+4>>2]=72319;Ye(22276,o)}a:do if(c[u>>2]|0){c[x>>2]=c[t>>2];while(1){o=c[u>>2]|0;c[u>>2]=o+-1;if(!o)break a;c[n>>2]=d[c[x>>2]>>0];Ze(22282,n);if(c[v>>2]|0?(o=(c[w>>2]|0)+1|0,c[w>>2]=o,(o|0)==32&(c[u>>2]|0)!=0):0){c[w>>2]=0;Ze(22287,k);o=hv(c[r>>2]|0)|0;p=hv(c[s>>2]|0)|0;c[j>>2]=o;c[j+4>>2]=72319;c[j+8>>2]=p;c[j+12>>2]=72319;Ye(22291,j)}c[x>>2]=(c[x>>2]|0)+1}}while(0);if(!(c[r>>2]|0)){l=h;return}Ze(22526,i);l=h;return}function af(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;d=l;l=l+64|0;if((l|0)>=(m|0))$(64);e=d;f=d+28|0;g=d+24|0;h=d+20|0;i=d+16|0;j=d+12|0;k=d+8|0;n=d+4|0;o=d+32|0;c[f>>2]=a;c[g>>2]=b;if(!(c[g>>2]|0)){$e(c[f>>2]|0?c[f>>2]|0:22268,22299,0,0);l=d;return}if(c[g>>2]|0?c[(c[g>>2]|0)+12>>2]&4|0:0){c[n>>2]=Gp(c[g>>2]|0,k)|0;c[e>>2]=c[k>>2];Su(o,30,22307,e)|0;$e(c[f>>2]|0?c[f>>2]|0:22268,o,c[n>>2]|0,(((c[k>>2]|0)+7|0)>>>0)/8|0);l=d;return}c[h>>2]=Vo(c[g>>2]|0,0,i,j)|0;if(!(c[h>>2]|0)){$e(c[f>>2]|0?c[f>>2]|0:22268,22317,0,0);l=d;return}g=c[f>>2]|0;f=c[j>>2]|0?22332:22334;if(c[i>>2]|0)$e(g,f,c[h>>2]|0,c[i>>2]|0);else $e(g,f,72319,1);vf(c[h>>2]|0);l=d;return}function bf(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;e=l;l=l+48|0;if((l|0)>=(m|0))$(48);f=e+28|0;g=e+24|0;h=e+20|0;i=e+16|0;j=e+12|0;k=e+32|0;n=e;o=e+8|0;c[f>>2]=b;c[g>>2]=(((c[f>>2]|0)!=0^1)&1)+(c[f>>2]|0)+63&-64;f=c[g>>2]|0;c[h>>2]=Za()|0;g=f;b=l;l=l+((1*g|0)+15&-16)|0;if((l|0)>=(m|0))$((1*g|0)+15&-16|0);c[i>>2]=b;c[j>>2]=f;a[k>>0]=0;f=n;c[f>>2]=d[k>>0];c[f+4>>2]=0;while(1){if(!(c[i>>2]&7|0?(c[j>>2]|0)!=0:0))break;a[c[i>>2]>>0]=a[k>>0]|0;c[i>>2]=(c[i>>2]|0)+1;c[j>>2]=(c[j>>2]|0)+-1}if((c[j>>2]|0)>>>0>=8){f=n;b=gx(c[f>>2]|0,c[f+4>>2]|0,16843009,16843009)|0;f=n;c[f>>2]=b;c[f+4>>2]=D;do{c[o>>2]=c[i>>2];f=n;b=c[f+4>>2]|0;g=c[o>>2]|0;c[g>>2]=c[f>>2];c[g+4>>2]=b;c[j>>2]=(c[j>>2]|0)-8;c[i>>2]=(c[i>>2]|0)+8}while((c[j>>2]|0)>>>0>=8)}while(1){if(!(c[j>>2]|0))break;a[c[i>>2]>>0]=a[k>>0]|0;c[i>>2]=(c[i>>2]|0)+1;c[j>>2]=(c[j>>2]|0)+-1}Ea(c[h>>2]|0);l=e;return}function cf(){return}function df(){Ft(33);Le(Ct(c[(xu()|0)>>2]|0)|0,22336)}function ef(){if(!(c[17699]|0))ff();return fh()|0}function ff(){var a=0,b=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;c[b>>2]=0;if(c[17699]|0){l=a;return}c[17699]=1;Xm(0);Vg(c[17700]|0);rg();c[b>>2]=Nh()|0;if((((((c[b>>2]|0)==0?(c[b>>2]=vj()|0,(c[b>>2]|0)==0):0)?(c[b>>2]=_j()|0,(c[b>>2]|0)==0):0)?(c[b>>2]=wj()|0,(c[b>>2]|0)==0):0)?(c[b>>2]=Gg()|0,(c[b>>2]|0)==0):0)?(c[b>>2]=tp()|0,(c[b>>2]|0)==0):0){l=a;return}Re(22351,123,22360)}function gf(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;d=l;l=l+48|0;if((l|0)>=(m|0))$(48);e=d+36|0;f=d+32|0;g=d+28|0;h=d+24|0;i=d+20|0;j=d+16|0;k=d+12|0;n=d+8|0;o=d+4|0;p=d;c[f>>2]=b;c[g>>2]=22372;if((c[f>>2]|0?(a[c[f>>2]>>0]|0)==1:0)?(a[(c[f>>2]|0)+1>>0]|0)==1:0){c[e>>2]=Xp()|0;q=c[e>>2]|0;l=d;return q|0}ff();b=c[g>>2]|0;if(!(c[f>>2]|0)){c[e>>2]=b;q=c[e>>2]|0;l=d;return q|0}c[p>>2]=hf(b,h,i,j)|0;if(!(c[p>>2]|0)){c[e>>2]=0;q=c[e>>2]|0;l=d;return q|0}if(!(hf(c[f>>2]|0,k,n,o)|0)){c[e>>2]=0;q=c[e>>2]|0;l=d;return q|0}do if((c[h>>2]|0)<=(c[k>>2]|0)){if((c[h>>2]|0)==(c[k>>2]|0)?(c[i>>2]|0)>(c[n>>2]|0):0)break;if(((c[h>>2]|0)==(c[k>>2]|0)?(c[i>>2]|0)==(c[n>>2]|0):0)?(c[j>>2]|0)>(c[o>>2]|0):0)break;if(((c[h>>2]|0)==(c[k>>2]|0)?(c[i>>2]|0)==(c[n>>2]|0):0)?(c[j>>2]|0)==(c[o>>2]|0):0)break;c[e>>2]=0;q=c[e>>2]|0;l=d;return q|0}while(0);c[e>>2]=c[g>>2];q=c[e>>2]|0;l=d;return q|0}function hf(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g+16|0;i=g+12|0;j=g+8|0;k=g+4|0;n=g;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;c[n>>2]=f;c[i>>2]=jf(c[i>>2]|0,c[j>>2]|0)|0;if(c[i>>2]|0?(a[c[i>>2]>>0]|0)==46:0){c[i>>2]=(c[i>>2]|0)+1;c[i>>2]=jf(c[i>>2]|0,c[k>>2]|0)|0;if(c[i>>2]|0?(a[c[i>>2]>>0]|0)==46:0){c[i>>2]=(c[i>>2]|0)+1;c[i>>2]=jf(c[i>>2]|0,c[n>>2]|0)|0;if(c[i>>2]|0){c[h>>2]=c[i>>2];o=c[h>>2]|0;l=g;return o|0}else{c[h>>2]=0;o=c[h>>2]|0;l=g;return o|0}}c[h>>2]=0;o=c[h>>2]|0;l=g;return o|0}c[h>>2]=0;o=c[h>>2]|0;l=g;return o|0}function jf(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[g>>2]=b;c[h>>2]=d;c[i>>2]=0;if((a[c[g>>2]>>0]|0)==48?Cw(a[(c[g>>2]|0)+1>>0]|0)|0:0){c[f>>2]=0;j=c[f>>2]|0;l=e;return j|0}while(1){d=(Cw(a[c[g>>2]>>0]|0)|0)!=0;k=c[i>>2]|0;if(!d)break;c[i>>2]=k*10;c[i>>2]=(c[i>>2]|0)+((a[c[g>>2]>>0]|0)-48);c[g>>2]=(c[g>>2]|0)+1}c[c[h>>2]>>2]=k;c[f>>2]=(c[i>>2]|0)<0?0:c[g>>2]|0;j=c[f>>2]|0;l=e;return j|0}function kf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0;d=l;l=l+176|0;if((l|0)>=(m|0))$(176);e=d+168|0;f=d+164|0;g=d+160|0;h=d+156|0;i=d+152|0;j=d+148|0;k=d+144|0;n=d+140|0;o=d+136|0;p=d+132|0;q=d+128|0;r=d+124|0;s=d+120|0;t=d+116|0;u=d+112|0;v=d+108|0;w=d+104|0;x=d+100|0;y=d+96|0;z=d+92|0;A=d+88|0;B=d+84|0;C=d+80|0;D=d+76|0;E=d+72|0;F=d+68|0;G=d+64|0;H=d+60|0;I=d+56|0;J=d+52|0;K=d+48|0;L=d+44|0;M=d+40|0;N=d+36|0;O=d+32|0;P=d+28|0;Q=d+24|0;R=d+20|0;S=d+16|0;T=d+12|0;U=d+8|0;V=d+4|0;W=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=0;do switch(c[e>>2]|0){case 31:{tg();X=c[g>>2]|0;l=d;return X|0}case 44:{Xm(0);bn();X=c[g>>2]|0;l=d;return X|0}case 51:{if(!(en()|0)){X=c[g>>2]|0;l=d;return X|0}c[g>>2]=1;X=c[g>>2]|0;l=d;return X|0}case 13:{$m();X=c[g>>2]|0;l=d;return X|0}case 14:{Ug();X=c[g>>2]|0;l=d;return X|0}case 30:{ff();Cg(0);X=c[g>>2]|0;l=d;return X|0}case 37:{ff();c[17701]=1;X=c[g>>2]|0;l=d;return X|0}case 24:{ff();b=c[f>>2]|0;a=(c[b>>2]|0)+(4-1)&~(4-1);Y=c[a>>2]|0;c[b>>2]=a+4;c[h>>2]=Y;Cg(c[h>>2]|0);if(!((Bg()|0)&4)){X=c[g>>2]|0;l=d;return X|0}c[g>>2]=1;X=c[g>>2]|0;l=d;return X|0}case 25:{ff();Tg();X=c[g>>2]|0;l=d;return X|0}case 27:{Xm(0);zg(Bg()|0|1);X=c[g>>2]|0;l=d;return X|0}case 28:{Xm(0);zg(Bg()|0|2);X=c[g>>2]|0;l=d;return X|0}case 29:{Xm(0);zg((Bg()|0)&-3);X=c[g>>2]|0;l=d;return X|0}case 22:{ff();an();X=c[g>>2]|0;l=d;return X|0}case 45:{Xm(0);Y=c[f>>2]|0;a=(c[Y>>2]|0)+(4-1)&~(4-1);b=c[a>>2]|0;c[Y>>2]=a+4;c[i>>2]=b;kn(c[i>>2]|0);X=c[g>>2]|0;l=d;return X|0}case 46:{Xm(0);if(!(ef()|0)){X=c[g>>2]|0;l=d;return X|0}ln();X=c[g>>2]|0;l=d;return X|0}case 19:{Xm(0);b=c[f>>2]|0;a=(c[b>>2]|0)+(4-1)&~(4-1);Y=c[a>>2]|0;c[b>>2]=a+4;c[j>>2]=Y;Ne(c[j>>2]|0);X=c[g>>2]|0;l=d;return X|0}case 20:{Y=c[f>>2]|0;a=(c[Y>>2]|0)+(4-1)&~(4-1);b=c[a>>2]|0;c[Y>>2]=a+4;c[k>>2]=b;c[17702]=c[17702]|c[k>>2];X=c[g>>2]|0;l=d;return X|0}case 21:{b=c[f>>2]|0;a=(c[b>>2]|0)+(4-1)&~(4-1);Y=c[a>>2]|0;c[b>>2]=a+4;c[n>>2]=Y;c[17702]=c[17702]&~c[n>>2];X=c[g>>2]|0;l=d;return X|0}case 36:{ff();X=c[g>>2]|0;l=d;return X|0}case 40:{if(!(c[17699]|0)){X=c[g>>2]|0;l=d;return X|0}c[g>>2]=1;X=c[g>>2]|0;l=d;return X|0}case 39:{if(!(c[17703]|0)){X=c[g>>2]|0;l=d;return X|0}c[g>>2]=1;X=c[g>>2]|0;l=d;return X|0}case 38:{if(c[17703]|0){X=c[g>>2]|0;l=d;return X|0}ff();Ym(0);c[17703]=1;ef()|0;X=c[g>>2]|0;l=d;return X|0}case 47:{Xm(0);ff();X=c[g>>2]|0;l=d;return X|0}case 48:{Xm(0);Ym(1);if(!(ef()|0)){X=c[g>>2]|0;l=d;return X|0}mn();X=c[g>>2]|0;l=d;return X|0}case 52:{c[g>>2]=lf(60)|0;X=c[g>>2]|0;l=d;return X|0}case 49:{Xm(0);Y=c[f>>2]|0;a=(c[Y>>2]|0)+(4-1)&~(4-1);b=c[a>>2]|0;c[Y>>2]=a+4;c[o>>2]=b;cn(c[o>>2]|0);X=c[g>>2]|0;l=d;return X|0}case 50:{Xm(0);Ym(1);b=c[f>>2]|0;a=(c[b>>2]|0)+(4-1)&~(4-1);Y=c[a>>2]|0;c[b>>2]=a+4;c[p>>2]=Y;dn(((c[p>>2]|0)!=0^1^1)&1)|0;X=c[g>>2]|0;l=d;return X|0}case 70:{Zm();X=c[g>>2]|0;l=d;return X|0}case 53:{Y=c[f>>2]|0;a=(c[Y>>2]|0)+(4-1)&~(4-1);b=c[a>>2]|0;c[Y>>2]=a+4;c[r>>2]=b;c[q>>2]=c[r>>2];Xm(0);mf(c[q>>2]|0?28:27,c[q>>2]|0);X=c[g>>2]|0;l=d;return X|0}case 54:{Xm(0);if(!(oh()|0)){X=c[g>>2]|0;l=d;return X|0}c[g>>2]=1;X=c[g>>2]|0;l=d;return X|0}case 55:{if(!(Wg()|0)){X=c[g>>2]|0;l=d;return X|0}if((eh()|0)!=0|(c[17701]|0)!=0){X=c[g>>2]|0;l=d;return X|0}c[g>>2]=1;X=c[g>>2]|0;l=d;return X|0}case 56:{Xm(0);if(!(c[17699]|0)){c[17700]=1;X=c[g>>2]|0;l=d;return X|0}if(ph()|0)gh(1)|0;if(!(fh()|0)){X=c[g>>2]|0;l=d;return X|0}c[g>>2]=1;X=c[g>>2]|0;l=d;return X|0}case 57:{ff();c[g>>2]=gh(1)|0;X=c[g>>2]|0;l=d;return X|0}case 58:{b=c[f>>2]|0;a=(c[b>>2]|0)+(4-1)&~(4-1);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f>>2]|0;a=(c[b>>2]|0)+(4-1)&~(4-1);Y=c[a>>2]|0;c[b>>2]=a+4;c[N>>2]=Y;c[M>>2]=c[N>>2];if(ef()|0){c[g>>2]=qn(c[I>>2]|0,c[K>>2]|0,c[M>>2]|0)|0;X=c[g>>2]|0;l=d;return X|0}else{c[g>>2]=176;X=c[g>>2]|0;l=d;return X|0}break}case 60:{Y=c[f>>2]|0;a=(c[Y>>2]|0)+(4-1)&~(4-1);b=c[a>>2]|0;c[Y>>2]=a+4;c[P>>2]=b;c[O>>2]=c[P>>2];rn(c[O>>2]|0);X=c[g>>2]|0;l=d;return X|0}case 61:{b=c[f>>2]|0;a=(c[b>>2]|0)+(4-1)&~(4-1);Y=c[a>>2]|0;c[b>>2]=a+4;c[Q>>2]=Y;c[g>>2]=nf(c[Q>>2]|0)|0;X=c[g>>2]|0;l=d;return X|0}case 63:{Y=c[f>>2]|0;a=(c[Y>>2]|0)+(4-1)&~(4-1);b=c[a>>2]|0;c[Y>>2]=a+4;c[S>>2]=b;c[R>>2]=c[S>>2];c[g>>2]=og(c[R>>2]|0)|0;X=c[g>>2]|0;l=d;return X|0}case 64:{if(c[17699]|0){c[g>>2]=1;X=c[g>>2]|0;l=d;return X|0}else{Xm(0);bh();X=c[g>>2]|0;l=d;return X|0}break}case 65:{b=c[f>>2]|0;a=(c[b>>2]|0)+(4-1)&~(4-1);Y=c[a>>2]|0;c[b>>2]=a+4;c[U>>2]=Y;c[T>>2]=c[U>>2];if((c[T>>2]|0)<=0){X=c[g>>2]|0;l=d;return X|0}Xm(c[T>>2]|0);X=c[g>>2]|0;l=d;return X|0}case 66:{Y=c[f>>2]|0;a=(c[Y>>2]|0)+(4-1)&~(4-1);b=c[a>>2]|0;c[Y>>2]=a+4;c[W>>2]=b;c[V>>2]=c[W>>2];if(!(c[V>>2]|0)){X=c[g>>2]|0;l=d;return X|0}b=_m(((c[17699]|0)!=0^1)&1)|0;c[c[V>>2]>>2]=b;X=c[g>>2]|0;l=d;return X|0}case 67:{Xm(0);zg(Bg()|0|8);X=c[g>>2]|0;l=d;return X|0}case 68:{Xm(0);zg(Bg()|0|16);X=c[g>>2]|0;l=d;return X|0}case 72:case 71:{c[g>>2]=69;X=c[g>>2]|0;l=d;return X|0}case 62:case 23:{X=c[g>>2]|0;l=d;return X|0}default:{Xm(0);c[g>>2]=61;X=c[g>>2]|0;l=d;return X|0}}while(0);return 0}function lf(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=of(1,c[d>>2]|0)|0;l=b;return a|0}function mf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=l;l=l+128|0;if((l|0)>=(m|0))$(128);e=d+88|0;f=d+80|0;g=d+72|0;h=d+64|0;i=d+48|0;j=d+24|0;k=d+16|0;n=d+8|0;o=d;p=d+116|0;q=d+112|0;r=d+108|0;s=d+104|0;t=d+100|0;u=d+96|0;c[p>>2]=a;c[q>>2]=b;b=c[p>>2]|0;a=c[q>>2]|0;c[o>>2]=22372;ub[b&63](a,22386,o)|0;o=c[p>>2]|0;a=c[q>>2]|0;c[n>>2]=22412;ub[o&63](a,22399,n)|0;n=c[p>>2]|0;a=c[q>>2]|0;c[k>>2]=22437;ub[n&63](a,22424,k)|0;k=c[p>>2]|0;a=c[q>>2]|0;c[j>>2]=22458;ub[k&63](a,22445,j)|0;ub[c[p>>2]&63](c[q>>2]|0,22472,d+32|0)|0;ub[c[p>>2]&63](c[q>>2]|0,22488,d+40|0)|0;j=c[p>>2]|0;a=c[q>>2]|0;c[i>>2]=sp()|0;ub[j&63](a,22500,i)|0;c[r>>2]=pg()|0;ub[c[p>>2]&63](c[q>>2]|0,22513,d+56|0)|0;c[t>>2]=0;while(1){i=qg(c[t>>2]|0,s)|0;c[u>>2]=i;if(!i)break;if(c[r>>2]&c[s>>2]|0){i=c[p>>2]|0;a=c[q>>2]|0;c[h>>2]=c[u>>2];ub[i&63](a,22522,h)|0}c[t>>2]=(c[t>>2]|0)+1}ub[c[p>>2]&63](c[q>>2]|0,22526,g)|0;g=c[p>>2]|0;h=c[q>>2]|0;s=(Wg()|0)!=0;r=(ah()|0)!=0;c[f>>2]=s?121:110;c[f+4>>2]=r?121:110;ub[g&63](h,22528,f)|0;c[t>>2]=_m(0)|0;switch(c[t>>2]|0){case 1:{c[u>>2]=22546;v=c[p>>2]|0;w=c[q>>2]|0;x=c[u>>2]|0;y=c[t>>2]|0;c[e>>2]=x;z=e+4|0;c[z>>2]=y;ub[v&63](w,22580,e)|0;l=d;return}case 2:{c[u>>2]=22555;v=c[p>>2]|0;w=c[q>>2]|0;x=c[u>>2]|0;y=c[t>>2]|0;c[e>>2]=x;z=e+4|0;c[z>>2]=y;ub[v&63](w,22580,e)|0;l=d;return}case 3:{c[u>>2]=22560;v=c[p>>2]|0;w=c[q>>2]|0;x=c[u>>2]|0;y=c[t>>2]|0;c[e>>2]=x;z=e+4|0;c[z>>2]=y;ub[v&63](w,22580,e)|0;l=d;return}default:Re(22351,321,22567)}}function nf(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=0;switch(c[d>>2]|0){case 30111:{c[e>>2]=Gt(1136)|0;break}case 30112:{c[e>>2]=Ht(1136)|0;break}case 30113:{c[e>>2]=It(1136)|0;break}case 30114:{c[e>>2]=Jt(1136)|0;break}default:c[e>>2]=61}l=b;return c[e>>2]|0}function of(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){g=0;l=d;return g|0}g=(c[e>>2]&127)<<24|c[f>>2]&65535;l=d;return g|0}function pf(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=0;qf(c[d>>2]|0,0,e)|0;l=b;return c[e>>2]|0}function qf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+16|0;g=e+12|0;h=e+8|0;i=e+4|0;j=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[i>>2]=0;do if(c[g>>2]&1|0?!(rf()|0):0)if(c[17705]|0){c[j>>2]=yb[c[17705]&15](c[f>>2]|0)|0;break}else{c[j>>2]=vg(c[f>>2]|0)|0;break}else k=6;while(0);do if((k|0)==6)if(c[17704]|0){c[j>>2]=yb[c[17704]&15](c[f>>2]|0)|0;break}else{c[j>>2]=ug(c[f>>2]|0)|0;break}while(0);if(c[j>>2]|0){c[c[h>>2]>>2]=c[j>>2];n=c[i>>2]|0;l=e;return n|0}if(!(c[(xu()|0)>>2]|0))Ft(12);c[i>>2]=Ct(c[(xu()|0)>>2]|0)|0;n=c[i>>2]|0;l=e;return n|0}function rf(){var a=0,b=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;do if(c[17701]|0)if(ah()|0){c[17701]=0;c[b>>2]=0;break}else{c[b>>2]=c[17701];break}else c[b>>2]=0;while(0);l=a;return c[b>>2]|0}function sf(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=0;qf(c[d>>2]|0,1,e)|0;l=b;return c[e>>2]|0}function tf(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[e>>2]=a;do if(!(rf()|0))if(c[17706]|0){c[d>>2]=yb[c[17706]&15](c[e>>2]|0)|0;break}else{c[d>>2]=Sg(c[e>>2]|0)|0;break}else c[d>>2]=0;while(0);l=b;return c[d>>2]|0}function uf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[f>>2]=a;c[g>>2]=b;b=c[g>>2]|0;if(!(c[f>>2]|0)){c[e>>2]=pf(b)|0;i=c[e>>2]|0;l=d;return i|0}if(!b){vf(c[f>>2]|0);c[e>>2]=0;i=c[e>>2]|0;l=d;return i|0}if(c[17707]|0)c[h>>2]=Db[c[17707]&7](c[f>>2]|0,c[g>>2]|0)|0;else c[h>>2]=wg(c[f>>2]|0,c[g>>2]|0)|0;if((c[h>>2]|0)==0?(c[(xu()|0)>>2]|0)==0:0)Ft(12);c[e>>2]=c[h>>2];i=c[e>>2]|0;l=d;return i|0}function vf(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;if(!(c[d>>2]|0)){l=b;return}c[e>>2]=c[(xu()|0)>>2];if(c[17708]|0)wb[c[17708]&15](c[d>>2]|0);else yg(c[d>>2]|0);if(!(c[e>>2]|0)){l=b;return}Ft(c[e>>2]|0);l=b;return}function wf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;i=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=S(c[f>>2]|0,c[g>>2]|0)|0;if(c[g>>2]|0?(((c[h>>2]|0)>>>0)/((c[g>>2]|0)>>>0)|0|0)!=(c[f>>2]|0):0){Ft(12);c[e>>2]=0;j=c[e>>2]|0;l=d;return j|0}c[i>>2]=pf(c[h>>2]|0)|0;if(c[i>>2]|0)Uw(c[i>>2]|0,0,c[h>>2]|0)|0;c[e>>2]=c[i>>2];j=c[e>>2]|0;l=d;return j|0}function xf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;i=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=S(c[f>>2]|0,c[g>>2]|0)|0;if(c[g>>2]|0?(((c[h>>2]|0)>>>0)/((c[g>>2]|0)>>>0)|0|0)!=(c[f>>2]|0):0){Ft(12);c[e>>2]=0;j=c[e>>2]|0;l=d;return j|0}c[i>>2]=sf(c[h>>2]|0)|0;if(c[i>>2]|0)Uw(c[i>>2]|0,0,c[h>>2]|0)|0;c[e>>2]=c[i>>2];j=c[e>>2]|0;l=d;return j|0}function yf(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;c[e>>2]=0;c[f>>2]=0;c[f>>2]=hv(c[d>>2]|0)|0;a=(tf(c[d>>2]|0)|0)!=0;g=(c[f>>2]|0)+1|0;if(a)c[e>>2]=sf(g)|0;else c[e>>2]=pf(g)|0;if(!(c[e>>2]|0)){h=c[e>>2]|0;l=b;return h|0}tv(c[e>>2]|0,c[d>>2]|0)|0;h=c[e>>2]|0;l=b;return h|0}function zf(a){a=a|0;var b=0,d=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;while(1){a=pf(c[d>>2]|0)|0;c[e>>2]=a;if(!((a|0)!=0^1)){f=6;break}a=(Wg()|0)==0;if(!(a&(c[17709]|0)!=0)){f=5;break}if(!(ub[c[17709]&63](c[17710]|0,c[d>>2]|0,0)|0)){f=5;break}}if((f|0)==5)Le(Ct(c[(xu()|0)>>2]|0)|0,0);else if((f|0)==6){l=b;return c[e>>2]|0}return 0}function Af(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+8|0;f=d+4|0;g=d;c[e>>2]=a;c[f>>2]=b;while(1){b=uf(c[e>>2]|0,c[f>>2]|0)|0;c[g>>2]=b;if(!((b|0)!=0^1)){h=6;break}b=(Wg()|0)==0;if(!(b&(c[17709]|0)!=0)){h=5;break}b=c[17709]|0;a=c[17710]|0;i=c[f>>2]|0;j=(tf(c[e>>2]|0)|0)!=0;if(!(ub[b&63](a,i,j?3:2)|0)){h=5;break}}if((h|0)==5)Le(Ct(c[(xu()|0)>>2]|0)|0,0);else if((h|0)==6){l=d;return c[g>>2]|0}return 0}function Bf(a){a=a|0;var b=0,d=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;while(1){a=sf(c[d>>2]|0)|0;c[e>>2]=a;if(!((a|0)!=0^1)){f=6;break}a=(Wg()|0)==0;if(!(a&(c[17709]|0)!=0)){f=5;break}if(!(ub[c[17709]&63](c[17710]|0,c[d>>2]|0,1)|0)){f=5;break}}if((f|0)==5){d=Ct(c[(xu()|0)>>2]|0)|0;Le(d,Je(22597)|0)}else if((f|0)==6){l=b;return c[e>>2]|0}return 0}function Cf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=S(c[e>>2]|0,c[f>>2]|0)|0;if(c[f>>2]|0?(((c[g>>2]|0)>>>0)/((c[f>>2]|0)>>>0)|0|0)!=(c[e>>2]|0):0){Ft(12);Le(Ct(c[(xu()|0)>>2]|0)|0,0)}c[h>>2]=zf(c[g>>2]|0)|0;Uw(c[h>>2]|0,0,c[g>>2]|0)|0;l=d;return c[h>>2]|0}function Df(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=S(c[e>>2]|0,c[f>>2]|0)|0;if(c[f>>2]|0?(((c[g>>2]|0)>>>0)/((c[f>>2]|0)>>>0)|0|0)!=(c[e>>2]|0):0){Ft(12);Le(Ct(c[(xu()|0)>>2]|0)|0,0)}c[h>>2]=Bf(c[g>>2]|0)|0;Uw(c[h>>2]|0,0,c[g>>2]|0)|0;l=d;return c[h>>2]|0}function Ef(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[d>>2]=a;do{a=yf(c[d>>2]|0)|0;c[e>>2]=a;if(!((a|0)!=0^1)){h=8;break}c[f>>2]=hv(c[d>>2]|0)|0;c[g>>2]=((tf(c[d>>2]|0)|0)!=0^1^1)&1;a=(Wg()|0)==0;if(!(a&(c[17709]|0)!=0))break}while((ub[c[17709]&63](c[17710]|0,c[f>>2]|0,c[g>>2]|0)|0)!=0);if((h|0)==8){l=b;return c[e>>2]|0}e=Ct(c[(xu()|0)>>2]|0)|0;if(!(c[g>>2]|0)){i=0;Le(e,i)}i=Je(22597)|0;Le(e,i);return 0}function Ff(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[e>>2]=a;if(Wg()|0)c[d>>2]=0;else c[d>>2]=c[17702]&c[e>>2];l=b;return c[d>>2]|0}function Gf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;xj(c[e>>2]|0,c[f>>2]|0);Vm(c[e>>2]|0,c[f>>2]|0);l=d;return}function Hf(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;g=l;l=l+48|0;if((l|0)>=(m|0))$(48);h=g;i=g+32|0;j=g+28|0;k=g+24|0;n=g+20|0;o=g+16|0;p=g+12|0;q=g+8|0;r=g+4|0;c[j>>2]=a;c[k>>2]=b;c[n>>2]=d;c[o>>2]=e;c[p>>2]=f;if(!(c[j>>2]|0)){c[i>>2]=45;s=c[i>>2]|0;l=g;return s|0}c[c[j>>2]>>2]=0;if(!((((c[o>>2]|0)<0|(c[o>>2]|0)>1)^1)&(c[k>>2]|0)!=0)){c[i>>2]=45;s=c[i>>2]|0;l=g;return s|0}if((c[n>>2]|0)!=0|(c[o>>2]|0)!=0){if((c[n>>2]|0)==0&(c[o>>2]|0)!=0)c[n>>2]=hv(c[k>>2]|0)|0}else{c[n>>2]=If(c[k>>2]|0,0,0,q)|0;if(!(c[n>>2]|0)){c[i>>2]=c[q>>2];s=c[i>>2]|0;l=g;return s|0}}c[q>>2]=Jf(r,0,c[k>>2]|0,c[n>>2]|0,0,0,h)|0;if(c[q>>2]|0){c[i>>2]=c[q>>2];s=c[i>>2]|0;l=g;return s|0}c[c[j>>2]>>2]=c[r>>2];if(c[p>>2]|0)wb[c[p>>2]&15](c[k>>2]|0);c[i>>2]=0;s=c[i>>2]|0;l=g;return s|0}function If(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;g=l;l=l+48|0;if((l|0)>=(m|0))$(48);h=g+44|0;i=g+40|0;j=g+36|0;k=g+32|0;n=g+28|0;o=g+24|0;p=g+20|0;q=g+16|0;r=g+4|0;s=g;c[i>>2]=a;c[j>>2]=b;c[k>>2]=e;c[n>>2]=f;c[p>>2]=0;c[q>>2]=0;c[r>>2]=0;c[s>>2]=0;if(!(c[k>>2]|0))c[k>>2]=g+12;if(!(c[n>>2]|0))c[n>>2]=g+8;c[c[n>>2]>>2]=0;c[c[k>>2]>>2]=0;if(!(c[i>>2]|0)){c[h>>2]=0;t=c[h>>2]|0;l=g;return t|0}if((d[c[i>>2]>>0]|0|0)!=40){c[c[n>>2]>>2]=204;c[h>>2]=0;t=c[h>>2]|0;l=g;return t|0}c[o>>2]=c[i>>2];a:while(1){if(c[j>>2]|0?(c[r>>2]|0)>>>0>=(c[j>>2]|0)>>>0:0){u=12;break}i=d[c[o>>2]>>0]|0;do if(c[q>>2]|0)if((i|0)==58){if(c[j>>2]|0?((c[r>>2]|0)+(c[q>>2]|0)|0)>>>0>=(c[j>>2]|0)>>>0:0){u=17;break a}c[r>>2]=(c[r>>2]|0)+(c[q>>2]|0);c[o>>2]=(c[o>>2]|0)+(c[q>>2]|0);c[q>>2]=0;break}else{if((d[c[o>>2]>>0]|0|0)<48){u=22;break a}if((d[c[o>>2]>>0]|0|0)>57){u=22;break a}c[q>>2]=((c[q>>2]|0)*10|0)+((d[c[o>>2]>>0]|0)-48);break}else{if((i|0)==40){if(c[p>>2]|0){u=25;break a}c[s>>2]=(c[s>>2]|0)+1;break}if((d[c[o>>2]>>0]|0|0)==41){if(!(c[s>>2]|0)){u=29;break a}if(c[p>>2]|0){u=31;break a}f=(c[s>>2]|0)+-1|0;c[s>>2]=f;if(f|0)break;else{u=33;break a}}if((d[c[o>>2]>>0]|0|0)==91){if(c[p>>2]|0){u=36;break a}c[p>>2]=c[o>>2];break}if((d[c[o>>2]>>0]|0|0)==93){if(!(c[p>>2]|0)){u=40;break a}c[p>>2]=0;break}if((d[c[o>>2]>>0]|0|0)<48){u=47;break a}if((d[c[o>>2]>>0]|0|0)>57){u=47;break a}if((d[c[o>>2]>>0]|0|0)==48){u=45;break a}c[q>>2]=(d[c[o>>2]>>0]|0)-48}while(0);c[o>>2]=(c[o>>2]|0)+1;c[r>>2]=(c[r>>2]|0)+1}switch(u|0){case 12:{c[c[k>>2]>>2]=c[r>>2];c[c[n>>2]>>2]=202;c[h>>2]=0;t=c[h>>2]|0;l=g;return t|0}case 17:{c[c[k>>2]>>2]=c[r>>2];c[c[n>>2]>>2]=202;c[h>>2]=0;t=c[h>>2]|0;l=g;return t|0}case 22:{c[c[k>>2]>>2]=c[r>>2];c[c[n>>2]>>2]=201;c[h>>2]=0;t=c[h>>2]|0;l=g;return t|0}case 25:{c[c[k>>2]>>2]=c[r>>2];c[c[n>>2]>>2]=209;c[h>>2]=0;t=c[h>>2]|0;l=g;return t|0}case 29:{c[c[k>>2]>>2]=c[r>>2];c[c[n>>2]>>2]=203;c[h>>2]=0;t=c[h>>2]|0;l=g;return t|0}case 31:{c[c[k>>2]>>2]=c[r>>2];c[c[n>>2]>>2]=209;c[h>>2]=0;t=c[h>>2]|0;l=g;return t|0}case 33:{u=(c[r>>2]|0)+1|0;c[r>>2]=u;c[h>>2]=u;t=c[h>>2]|0;l=g;return t|0}case 36:{c[c[k>>2]>>2]=c[r>>2];c[c[n>>2]>>2]=208;c[h>>2]=0;t=c[h>>2]|0;l=g;return t|0}case 40:{c[c[k>>2]>>2]=c[r>>2];c[c[n>>2]>>2]=209;c[h>>2]=0;t=c[h>>2]|0;l=g;return t|0}case 45:{c[c[k>>2]>>2]=c[r>>2];c[c[n>>2]>>2]=207;c[h>>2]=0;t=c[h>>2]|0;l=g;return t|0}case 47:{if((d[c[o>>2]>>0]|0|0)!=38?(d[c[o>>2]>>0]|0|0)!=92:0){c[c[k>>2]>>2]=c[r>>2];c[c[n>>2]>>2]=205;c[h>>2]=0;t=c[h>>2]|0;l=g;return t|0}c[c[k>>2]>>2]=c[r>>2];c[c[n>>2]>>2]=210;c[h>>2]=0;t=c[h>>2]|0;l=g;return t|0}}return 0}function Jf(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;i=l;l=l+48|0;if((l|0)>=(m|0))$(48);j=i+40|0;k=i+36|0;n=i+32|0;o=i+28|0;p=i+24|0;q=i+20|0;r=i+16|0;s=i;c[j>>2]=a;c[k>>2]=b;c[n>>2]=d;c[o>>2]=e;c[p>>2]=f;c[q>>2]=g;c[s>>2]=h;c[r>>2]=Kf(c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0,c[p>>2]|0,c[q>>2]|0,s)|0;l=i;return c[r>>2]|0}function Kf(e,f,g,h,i,j,k){e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0,Qa=0,Ra=0,Sa=0,Ta=0,Ua=0,Va=0,Wa=0,Xa=0,Ya=0,Za=0,_a=0,$a=0,ab=0,bb=0,cb=0;n=l;l=l+432|0;if((l|0)>=(m|0))$(432);o=n+16|0;p=n+8|0;q=n+320|0;r=n+316|0;s=n+312|0;t=n+308|0;u=n+304|0;v=n+300|0;w=n+296|0;x=n+292|0;y=n+288|0;z=n+284|0;A=n+280|0;B=n+276|0;C=n+272|0;E=n+268|0;F=n+264|0;G=n+260|0;H=n+256|0;I=n+252|0;J=n+248|0;K=n+244|0;L=n+240|0;M=n+224|0;N=n+220|0;O=n+216|0;P=n+212|0;Q=n+344|0;R=n+208|0;S=n+204|0;T=n+200|0;U=n+342|0;V=n+340|0;W=n+196|0;X=n+338|0;Y=n+192|0;Z=n+188|0;_=n+336|0;aa=n+184|0;ba=n+180|0;ca=n+176|0;da=n+172|0;ea=n+168|0;fa=n+164|0;ga=n+160|0;ha=n+156|0;ia=n+152|0;ja=n+334|0;ka=n+148|0;la=n+144|0;ma=n+140|0;na=n+332|0;oa=n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;if(c[P>>2]|0){$a=18;break}k=M+8|0;j=c[k>>2]|0;c[k>>2]=j+1;a[j>>0]=1;b[Q>>1]=c[L>>2];j=c[M+8>>2]|0;a[j>>0]=a[Q>>0]|0;a[j+1>>0]=a[Q+1>>0]|0;j=M+8|0;c[j>>2]=(c[j>>2]|0)+2;_w(c[M+8>>2]|0,c[E>>2]|0,c[L>>2]|0)|0;j=M+8|0;c[j>>2]=(c[j>>2]|0)+(c[L>>2]|0);c[E>>2]=0;$a=20}}else $a=20;c:do if(($a|0)==20){$a=0;if(c[C>>2]|0){j=a[c[z>>2]>>0]|0;if(!(c[K>>2]|0)){if((j|0)==92){c[K>>2]=1;break}if((a[c[z>>2]>>0]|0)!=34)break;c[C>>2]=(c[C>>2]|0)+1;c[T>>2]=Lf(M,(c[z>>2]|0)-(c[C>>2]|0)|0)|0;if(c[T>>2]|0){$a=59;break b}k=M+8|0;i=c[k>>2]|0;c[k>>2]=i+1;a[i>>0]=1;c[R>>2]=c[M+8>>2];b[U>>1]=0;i=c[M+8>>2]|0;a[i>>0]=a[U>>0]|0;a[i+1>>0]=a[U+1>>0]|0;i=M+8|0;c[i>>2]=(c[i>>2]|0)+2;c[S>>2]=Mf(c[C>>2]|0,(c[z>>2]|0)-(c[C>>2]|0)|0,c[M+8>>2]|0)|0;i=M+8|0;c[i>>2]=(c[i>>2]|0)+(c[S>>2]|0);b[V>>1]=c[S>>2];i=c[R>>2]|0;a[i>>0]=a[V>>0]|0;a[i+1>>0]=a[V+1>>0]|0;c[R>>2]=(c[R>>2]|0)+2;c[C>>2]=0;break}switch(j|0){case 92:case 39:case 34:case 114:case 102:case 110:case 118:case 116:case 98:{c[K>>2]=0;break c;break}case 55:case 54:case 53:case 52:case 51:case 50:case 49:case 48:{if((c[A>>2]|0)>>>0<=2){$a=29;break b}if((a[(c[z>>2]|0)+1>>0]|0)<48){$a=29;break b}if((a[(c[z>>2]|0)+1>>0]|0)>55){$a=29;break b}if((a[(c[z>>2]|0)+2>>0]|0)<48){$a=29;break b}if((a[(c[z>>2]|0)+2>>0]|0)>55){$a=29;break b}c[z>>2]=(c[z>>2]|0)+2;c[A>>2]=(c[A>>2]|0)-2;c[K>>2]=0;break c;break}case 120:{if((c[A>>2]|0)>>>0<=2){$a=44;break b}if(!((a[(c[z>>2]|0)+1>>0]|0)>=48?(a[(c[z>>2]|0)+1>>0]|0)<=57:0))$a=34;do if(($a|0)==34){$a=0;if((a[(c[z>>2]|0)+1>>0]|0)>=65?(a[(c[z>>2]|0)+1>>0]|0)<=70:0)break;if((a[(c[z>>2]|0)+1>>0]|0)<97){$a=44;break b}if((a[(c[z>>2]|0)+1>>0]|0)>102){$a=44;break b}}while(0);if(!((a[(c[z>>2]|0)+2>>0]|0)>=48?(a[(c[z>>2]|0)+2>>0]|0)<=57:0))$a=40;do if(($a|0)==40){$a=0;if((a[(c[z>>2]|0)+2>>0]|0)>=65?(a[(c[z>>2]|0)+2>>0]|0)<=70:0)break;if((a[(c[z>>2]|0)+2>>0]|0)<97){$a=44;break b}if((a[(c[z>>2]|0)+2>>0]|0)>102){$a=44;break b}}while(0);c[z>>2]=(c[z>>2]|0)+2;c[A>>2]=(c[A>>2]|0)-2;c[K>>2]=0;break c;break}case 13:{if(c[A>>2]|0?(a[(c[z>>2]|0)+1>>0]|0)==10:0){c[z>>2]=(c[z>>2]|0)+1;c[A>>2]=(c[A>>2]|0)+-1}c[K>>2]=0;break c;break}case 10:{if(c[A>>2]|0?(a[(c[z>>2]|0)+1>>0]|0)==13:0){c[z>>2]=(c[z>>2]|0)+1;c[A>>2]=(c[A>>2]|0)+-1}c[K>>2]=0;break c;break}default:{$a=54;break b}}}if(c[F>>2]|0){if(Ru(a[c[z>>2]>>0]|0)|0){c[J>>2]=(c[J>>2]|0)+1;break}if((a[c[z>>2]>>0]|0)!=35)if(Nf(c[z>>2]|0)|0)break;else{$a=82;break b}if(c[J>>2]&1|0){$a=66;break b}c[L>>2]=(c[J>>2]|0)/2|0;c[W>>2]=Lf(M,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|0)|0;k=M+8|0;c[k>>2]=(c[k>>2]|0)+(c[L>>2]|0);c[A>>2]=(c[A>>2]|0)-(c[L>>2]|0);c[z>>2]=(c[z>>2]|0)+(c[L>>2]|0);break}if((a[c[z>>2]>>0]|0)==34){c[B>>2]=0;c[C>>2]=c[z>>2];c[K>>2]=0;break}if((a[c[z>>2]>>0]|0)==35){c[B>>2]=0;c[F>>2]=c[z>>2];c[J>>2]=0;break}if((a[c[z>>2]>>0]|0)!=124){$a=101;break b}c[B>>2]=0;c[G>>2]=c[z>>2];break}k=a[c[z>>2]>>0]|0;if(!(c[I>>2]|0)){if((k|0)==40){if(c[H>>2]|0){$a=179;break b}c[Sa>>2]=Lf(M,0)|0;if(c[Sa>>2]|0){$a=181;break b}i=M+8|0;j=c[i>>2]|0;c[i>>2]=j+1;a[j>>0]=3;c[O>>2]=(c[O>>2]|0)+1;break}if((a[c[z>>2]>>0]|0)==41){if(c[H>>2]|0){$a=185;break b}c[Ta>>2]=Lf(M,0)|0;if(c[Ta>>2]|0){$a=187;break b}j=M+8|0;i=c[j>>2]|0;c[j>>2]=i+1;a[i>>0]=4;c[O>>2]=(c[O>>2]|0)+-1;break}i=c[z>>2]|0;if((a[c[z>>2]>>0]|0)==34){c[C>>2]=i;c[K>>2]=0;break}j=c[z>>2]|0;if((a[i>>0]|0)==35){c[F>>2]=j;c[J>>2]=0;break}i=c[z>>2]|0;if((a[j>>0]|0)==124){c[G>>2]=i;break}if((a[i>>0]|0)==91){ab=c[z>>2]|0;if(c[H>>2]|0){$a=197;break b}c[H>>2]=ab;break}if((a[c[z>>2]>>0]|0)==93){if(!(c[H>>2]|0)){$a=201;break b}c[H>>2]=0;break}do if((a[c[z>>2]>>0]|0)>=48){if((a[c[z>>2]>>0]|0)>57)break;bb=c[z>>2]|0;if((a[c[z>>2]>>0]|0)==48){$a=206;break b}c[B>>2]=bb;break c}while(0);i=(Vv(22633,a[c[z>>2]>>0]|0)|0)!=0;j=c[z>>2]|0;if(i){c[E>>2]=j;break}if(Nf(j)|0)break;cb=c[z>>2]|0;if((a[c[z>>2]>>0]|0)==123){$a=212;break b}if(Vv(22732,a[cb>>0]|0)|0){$a=214;break b}if(!(c[v>>2]|0)){$a=218;break b}if((a[c[z>>2]>>0]|0)!=37){$a=218;break b}c[I>>2]=c[z>>2];break}do if((k|0)!=109?(a[c[z>>2]>>0]|0)!=77:0){if((a[c[z>>2]>>0]|0)==115){if(c[w>>2]|0){j=c[N>>2]|0;c[N>>2]=j+1;c[oa>>2]=c[c[(c[w>>2]|0)+(j<<2)>>2]>>2]}else{j=c[x>>2]|0;i=(c[j>>2]|0)+(4-1)&~(4-1);h=c[i>>2]|0;c[j>>2]=i+4;c[qa>>2]=h;c[oa>>2]=c[qa>>2]}c[pa>>2]=hv(c[oa>>2]|0)|0;c[ra>>2]=Lf(M,c[pa>>2]|0)|0;if(c[ra>>2]|0){$a=135;break b}h=M+8|0;i=c[h>>2]|0;c[h>>2]=i+1;a[i>>0]=1;b[sa>>1]=c[pa>>2];i=c[M+8>>2]|0;a[i>>0]=a[sa>>0]|0;a[i+1>>0]=a[sa+1>>0]|0;i=M+8|0;c[i>>2]=(c[i>>2]|0)+2;_w(c[M+8>>2]|0,c[oa>>2]|0,c[pa>>2]|0)|0;i=M+8|0;c[i>>2]=(c[i>>2]|0)+(c[pa>>2]|0);break}if((a[c[z>>2]>>0]|0)==98){if(c[w>>2]|0){i=c[N>>2]|0;c[N>>2]=i+1;c[ua>>2]=c[c[(c[w>>2]|0)+(i<<2)>>2]>>2]}else{i=c[x>>2]|0;h=(c[i>>2]|0)+(4-1)&~(4-1);j=c[h>>2]|0;c[i>>2]=h+4;c[va>>2]=j;c[ua>>2]=c[va>>2]}if(c[w>>2]|0){j=c[N>>2]|0;c[N>>2]=j+1;c[ta>>2]=c[c[(c[w>>2]|0)+(j<<2)>>2]>>2]}else{j=c[x>>2]|0;h=(c[j>>2]|0)+(4-1)&~(4-1);i=c[h>>2]|0;c[j>>2]=h+4;c[wa>>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>2]=sf(1+(c[M+4>>2]|0)-1|0)|0;if(!(c[la>>2]|0)){$a=125;break b}c[ma>>2]=c[la>>2];_w(c[ma>>2]|0,c[M>>2]|0,(c[M+8>>2]|0)-(c[M>>2]|0)|0)|0;c[M+8>>2]=(c[ma>>2]|0)+((c[M+8>>2]|0)-(c[M>>2]|0));vf(c[M>>2]|0);c[M>>2]=c[la>>2]}while(0);i=M+8|0;h=c[i>>2]|0;c[i>>2]=h+1;a[h>>0]=1;b[na>>1]=c[ba>>2];h=c[M+8>>2]|0;a[h>>0]=a[na>>0]|0;a[h+1>>0]=a[na+1>>0]|0;h=M+8|0;c[h>>2]=(c[h>>2]|0)+2;if(bp(c[ca>>2]|0,c[M+8>>2]|0,c[ba>>2]|0,ba,c[aa>>2]|0)|0){$a=128;break b}h=M+8|0;c[h>>2]=(c[h>>2]|0)+(c[ba>>2]|0)}while(0);c[I>>2]=0}while(0);c[z>>2]=(c[z>>2]|0)+1;c[A>>2]=(c[A>>2]|0)+-1}switch($a|0){case 18:{c[y>>2]=c[P>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 29:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=206;break a;break}case 44:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=206;break a;break}case 54:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=206;break a;break}case 59:{c[y>>2]=c[T>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 66:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=212;break a;break}case 68:{c[y>>2]=c[W>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 82:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=211;break a;break}case 91:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=202;break a;break}case 93:{c[y>>2]=c[Z>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 101:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=201;break a;break}case 111:{c[y>>2]=c[ga>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 115:{c[y>>2]=Ct(c[(xu()|0)>>2]|0)|0;break a;break}case 119:{Re(22704,1433,22711);break}case 121:{c[y>>2]=c[ka>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 125:{c[y>>2]=Ct(c[(xu()|0)>>2]|0)|0;break a;break}case 128:{Re(22704,1460,22711);break}case 135:{c[y>>2]=c[ra>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 145:{c[y>>2]=c[xa>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 150:{c[y>>2]=Ct(c[(xu()|0)>>2]|0)|0;break a;break}case 158:{c[y>>2]=c[Fa>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 165:{c[y>>2]=c[La>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 173:{c[y>>2]=c[Ra>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 175:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=201;break a;break}case 179:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=209;break a;break}case 181:{c[y>>2]=c[Sa>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 185:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=209;break a;break}case 187:{c[y>>2]=c[Ta>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 197:{c[c[s>>2]>>2]=ab-(c[t>>2]|0);c[y>>2]=208;break a;break}case 201:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=209;break a;break}case 206:{c[c[s>>2]>>2]=bb-(c[t>>2]|0);c[y>>2]=207;break a;break}case 212:{c[c[s>>2]>>2]=cb-(c[t>>2]|0);c[y>>2]=210;break a;break}case 214:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=210;break a;break}case 218:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=205;break a;break}case 220:{c[Ua>>2]=Lf(M,0)|0;if(c[Ua>>2]|0){c[y>>2]=c[Ua>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a}h=M+8|0;i=c[h>>2]|0;c[h>>2]=i+1;a[i>>0]=0;if((c[O>>2]|0)==0|(c[y>>2]|0)!=0)break a;c[y>>2]=203;break a;break}}}else{c[y>>2]=Ct(c[(xu()|0)>>2]|0)|0;c[c[s>>2]>>2]=0}while(0);s=c[M>>2]|0;if(c[y>>2]|0){if(s|0){d:do if(tf(c[M>>2]|0)|0){c[Va>>2]=c[M>>2];c[Wa>>2]=1+(c[M+4>>2]|0)-1;a[Xa>>0]=0;O=Ya;c[O>>2]=d[Xa>>0];c[O+4>>2]=0;while(1){if(!(c[Va>>2]&7|0?(c[Wa>>2]|0)!=0:0))break;a[c[Va>>2]>>0]=a[Xa>>0]|0;c[Va>>2]=(c[Va>>2]|0)+1;c[Wa>>2]=(c[Wa>>2]|0)+-1}if((c[Wa>>2]|0)>>>0>=8){O=Ya;t=gx(c[O>>2]|0,c[O+4>>2]|0,16843009,16843009)|0;O=Ya;c[O>>2]=t;c[O+4>>2]=D;do{c[Za>>2]=c[Va>>2];O=Ya;t=c[O+4>>2]|0;z=c[Za>>2]|0;c[z>>2]=c[O>>2];c[z+4>>2]=t;c[Wa>>2]=(c[Wa>>2]|0)-8;c[Va>>2]=(c[Va>>2]|0)+8}while((c[Wa>>2]|0)>>>0>=8)}while(1){if(!(c[Wa>>2]|0))break d;a[c[Va>>2]>>0]=a[Xa>>0]|0;c[Va>>2]=(c[Va>>2]|0)+1;c[Wa>>2]=(c[Wa>>2]|0)+-1}}while(0);vf(c[M>>2]|0)}}else{M=Qf(s)|0;c[c[r>>2]>>2]=M}c[q>>2]=c[y>>2];_a=c[q>>2]|0;l=n;return _a|0}function Lf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+24|0;f=d+20|0;g=d+16|0;h=d+12|0;i=d+8|0;j=d+4|0;k=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=(c[(c[f>>2]|0)+8>>2]|0)-(c[c[f>>2]>>2]|0);do if(((c[h>>2]|0)+(c[g>>2]|0)+2+1|0)>>>0>=(c[(c[f>>2]|0)+4>>2]|0)>>>0){c[k>>2]=(c[(c[f>>2]|0)+4>>2]|0)+((c[g>>2]|0)+2+1<<1);if((c[k>>2]|0)>>>0<=(c[(c[f>>2]|0)+4>>2]|0)>>>0){c[e>>2]=67;n=c[e>>2]|0;l=d;return n|0}c[i>>2]=uf(c[c[f>>2]>>2]|0,1+(c[k>>2]|0)-1|0)|0;if(c[i>>2]|0){c[(c[f>>2]|0)+4>>2]=c[k>>2];c[j>>2]=c[i>>2];c[(c[f>>2]|0)+8>>2]=(c[j>>2]|0)+(c[h>>2]|0);c[c[f>>2]>>2]=c[i>>2];break}c[e>>2]=Ct(c[(xu()|0)>>2]|0)|0;n=c[e>>2]|0;l=d;return n|0}while(0);c[e>>2]=0;n=c[e>>2]|0;l=d;return n|0}function Mf(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g+24|0;i=g+20|0;j=g+16|0;k=g+12|0;n=g+8|0;o=g+4|0;p=g;c[h>>2]=b;c[i>>2]=e;c[j>>2]=f;c[k>>2]=0;c[n>>2]=c[h>>2];c[o>>2]=c[j>>2];c[p>>2]=c[i>>2];while(1){if(!(c[p>>2]|0))break;i=d[c[n>>2]>>0]|0;do if(!(c[k>>2]|0))if((i|0)==92){c[k>>2]=1;break}else{h=a[c[n>>2]>>0]|0;f=c[o>>2]|0;c[o>>2]=f+1;a[f>>0]=h;break}else{a:do switch(i|0){case 98:{h=c[o>>2]|0;c[o>>2]=h+1;a[h>>0]=8;break}case 116:{h=c[o>>2]|0;c[o>>2]=h+1;a[h>>0]=9;break}case 118:{h=c[o>>2]|0;c[o>>2]=h+1;a[h>>0]=11;break}case 110:{h=c[o>>2]|0;c[o>>2]=h+1;a[h>>0]=10;break}case 102:{h=c[o>>2]|0;c[o>>2]=h+1;a[h>>0]=12;break}case 114:{h=c[o>>2]|0;c[o>>2]=h+1;a[h>>0]=13;break}case 34:{h=c[o>>2]|0;c[o>>2]=h+1;a[h>>0]=34;break}case 39:{h=c[o>>2]|0;c[o>>2]=h+1;a[h>>0]=39;break}case 92:{h=c[o>>2]|0;c[o>>2]=h+1;a[h>>0]=92;break}case 13:{if((c[p>>2]|0)>>>0>1?(d[(c[n>>2]|0)+1>>0]|0|0)==10:0){c[n>>2]=(c[n>>2]|0)+1;c[p>>2]=(c[p>>2]|0)+-1}break}case 10:{if((c[p>>2]|0)>>>0>1?(d[(c[n>>2]|0)+1>>0]|0|0)==13:0){c[n>>2]=(c[n>>2]|0)+1;c[p>>2]=(c[p>>2]|0)+-1}break}case 120:{if((c[p>>2]|0)>>>0>2){if(!((d[(c[n>>2]|0)+1>>0]|0|0)>=48?(d[(c[n>>2]|0)+1>>0]|0|0)<=57:0))q=23;do if((q|0)==23){q=0;if((d[(c[n>>2]|0)+1>>0]|0|0)>=65?(d[(c[n>>2]|0)+1>>0]|0|0)<=70:0)break;if((d[(c[n>>2]|0)+1>>0]|0|0)<97)break a;if((d[(c[n>>2]|0)+1>>0]|0|0)>102)break a}while(0);if(!((d[(c[n>>2]|0)+2>>0]|0|0)>=48?(d[(c[n>>2]|0)+2>>0]|0|0)<=57:0))q=29;do if((q|0)==29){q=0;if((d[(c[n>>2]|0)+2>>0]|0|0)>=65?(d[(c[n>>2]|0)+2>>0]|0|0)<=70:0)break;if((d[(c[n>>2]|0)+2>>0]|0|0)<97)break a;if((d[(c[n>>2]|0)+2>>0]|0|0)>102)break a}while(0);c[n>>2]=(c[n>>2]|0)+1;c[p>>2]=(c[p>>2]|0)+-1;h=d[c[n>>2]>>0]|0;if((d[c[n>>2]>>0]|0|0)<=57)r=h-48|0;else{f=d[c[n>>2]>>0]|0;r=((h|0)<=70?f-65|0:f-97|0)+10|0}f=d[(c[n>>2]|0)+1>>0]|0;if((d[(c[n>>2]|0)+1>>0]|0|0)<=57)s=f-48|0;else{h=d[(c[n>>2]|0)+1>>0]|0;s=((f|0)<=70?h-65|0:h-97|0)+10|0}h=c[o>>2]|0;c[o>>2]=h+1;a[h>>0]=(r<<4)+s;c[n>>2]=(c[n>>2]|0)+1;c[p>>2]=(c[p>>2]|0)+-1}break}default:if(((((((c[p>>2]|0)>>>0>2?(d[c[n>>2]>>0]|0|0)>=48:0)?(d[c[n>>2]>>0]|0|0)<=55:0)?(d[(c[n>>2]|0)+1>>0]|0|0)>=48:0)?(d[(c[n>>2]|0)+1>>0]|0|0)<=55:0)?(d[(c[n>>2]|0)+2>>0]|0|0)>=48:0)?(d[(c[n>>2]|0)+2>>0]|0|0)<=55:0){h=((d[c[n>>2]>>0]|0)-48<<6)+((d[(c[n>>2]|0)+1>>0]|0)-48<<3)+((d[(c[n>>2]|0)+2>>0]|0)-48)&255;f=c[o>>2]|0;c[o>>2]=f+1;a[f>>0]=h;c[n>>2]=(c[n>>2]|0)+2;c[p>>2]=(c[p>>2]|0)-2}}while(0);c[k>>2]=0}while(0);c[p>>2]=(c[p>>2]|0)+-1;c[n>>2]=(c[n>>2]|0)+1}l=g;return (c[o>>2]|0)-(c[j>>2]|0)|0}function Nf(b){b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[f>>2]=b;switch(a[c[f>>2]>>0]|0){case 10:case 13:case 12:case 11:case 9:case 32:{c[e>>2]=1;break}default:c[e>>2]=0}l=d;return c[e>>2]|0}function Of(a){a=a|0;var b=0,d=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[e>>2]=a;a=c[e>>2]|0;do if(!((c[e>>2]|0)>=48&(c[e>>2]|0)<=57)){f=c[e>>2]|0;if((a|0)>=65&(c[e>>2]|0)<=70){c[d>>2]=10+f-65;break}if((f|0)>=97&(c[e>>2]|0)<=102){c[d>>2]=10+(c[e>>2]|0)-97;break}else{c[d>>2]=0;break}}else c[d>>2]=a-48;while(0);l=b;return c[d>>2]|0}function Pf(b,f){b=b|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g+20|0;i=g+16|0;j=g+12|0;k=g+8|0;n=g+24|0;o=g+4|0;p=g;c[i>>2]=b;c[j>>2]=f;c[p>>2]=0;c[c[j>>2]>>2]=0;a:do if(c[i>>2]|0){c[k>>2]=c[i>>2];while(1){f=d[c[k>>2]>>0]|0;c[o>>2]=f;if(!f)break a;c[k>>2]=(c[k>>2]|0)+1;if((c[o>>2]|0)==1){f=c[k>>2]|0;a[n>>0]=a[f>>0]|0;a[n+1>>0]=a[f+1>>0]|0;c[k>>2]=(c[k>>2]|0)+(2+(e[n>>1]|0));continue}if((c[o>>2]|0)!=3){if((c[o>>2]|0)!=4)continue;c[p>>2]=(c[p>>2]|0)+-1;if(c[p>>2]|0)continue;else break}if(!(c[p>>2]|0))c[c[j>>2]>>2]=(c[k>>2]|0)+-1-(c[i>>2]|0);c[p>>2]=(c[p>>2]|0)+1}c[h>>2]=(c[k>>2]|0)-(c[i>>2]|0);q=c[h>>2]|0;l=g;return q|0}while(0);c[h>>2]=0;q=c[h>>2]|0;l=g;return q|0}function Qf(a){a=a|0;var b=0,e=0,f=0,g=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=b+8|0;f=b+4|0;g=b;c[f>>2]=a;do if(c[f>>2]|0){c[g>>2]=c[f>>2];if(!(d[c[g>>2]>>0]|0)){Rf(c[f>>2]|0);c[e>>2]=0;break}if((d[c[g>>2]>>0]|0|0)==3?(d[(c[g>>2]|0)+1>>0]|0|0)==4:0){Rf(c[f>>2]|0);c[e>>2]=0;break}c[e>>2]=c[f>>2]}else c[e>>2]=0;while(0);l=b;return c[e>>2]|0}function Rf(b){b=b|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;f=l;l=l+48|0;if((l|0)>=(m|0))$(48);g=f+28|0;h=f+24|0;i=f+20|0;j=f+32|0;k=f+16|0;n=f+12|0;o=f+34|0;p=f;q=f+8|0;c[g>>2]=b;if(!(c[g>>2]|0)){l=f;return}a:do if(tf(c[g>>2]|0)|0){c[h>>2]=c[g>>2];while(1){b=d[c[h>>2]>>0]|0;c[i>>2]=b;if(!b)break;c[h>>2]=(c[h>>2]|0)+1;if((c[i>>2]|0)!=1)continue;b=c[h>>2]|0;a[j>>0]=a[b>>0]|0;a[j+1>>0]=a[b+1>>0]|0;c[h>>2]=(c[h>>2]|0)+2;c[h>>2]=(c[h>>2]|0)+(e[j>>1]|0)}c[k>>2]=c[g>>2];c[n>>2]=(c[h>>2]|0)-(c[g>>2]|0);a[o>>0]=0;b=p;c[b>>2]=d[o>>0];c[b+4>>2]=0;while(1){if(!(c[k>>2]&7|0?(c[n>>2]|0)!=0:0))break;a[c[k>>2]>>0]=a[o>>0]|0;c[k>>2]=(c[k>>2]|0)+1;c[n>>2]=(c[n>>2]|0)+-1}if((c[n>>2]|0)>>>0>=8){b=p;r=gx(c[b>>2]|0,c[b+4>>2]|0,16843009,16843009)|0;b=p;c[b>>2]=r;c[b+4>>2]=D;do{c[q>>2]=c[k>>2];b=p;r=c[b+4>>2]|0;s=c[q>>2]|0;c[s>>2]=c[b>>2];c[s+4>>2]=r;c[n>>2]=(c[n>>2]|0)-8;c[k>>2]=(c[k>>2]|0)+8}while((c[n>>2]|0)>>>0>=8)}while(1){if(!(c[n>>2]|0))break a;a[c[k>>2]>>0]=a[o>>0]|0;c[k>>2]=(c[k>>2]|0)+1;c[n>>2]=(c[n>>2]|0)+-1}}while(0);vf(c[g>>2]|0);l=f;return}function Sf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+12|0;h=f+8|0;i=f+4|0;j=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;e=Hf(c[g>>2]|0,c[h>>2]|0,c[i>>2]|0,c[j>>2]|0,0)|0;l=f;return e|0}function Tf(f,g,h){f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;i=l;l=l+48|0;if((l|0)>=(m|0))$(48);j=i+32|0;k=i+28|0;n=i+24|0;o=i+20|0;p=i+16|0;q=i+36|0;r=i+12|0;s=i+8|0;t=i+4|0;u=i;c[k>>2]=f;c[n>>2]=g;c[o>>2]=h;if(!(c[k>>2]|0)){c[j>>2]=0;v=c[j>>2]|0;l=i;return v|0}if(!(c[o>>2]|0))c[o>>2]=hv(c[n>>2]|0)|0;c[p>>2]=c[k>>2];while(1){if(!(d[c[p>>2]>>0]|0)){w=29;break}if((d[c[p>>2]>>0]|0|0)==3?(d[(c[p>>2]|0)+1>>0]|0|0)==1:0){c[r>>2]=c[p>>2];c[p>>2]=(c[p>>2]|0)+2;k=c[p>>2]|0;a[q>>0]=a[k>>0]|0;a[q+1>>0]=a[k+1>>0]|0;c[p>>2]=(c[p>>2]|0)+2;if((e[q>>1]|0|0)==(c[o>>2]|0)?(Jv(c[p>>2]|0,c[n>>2]|0,c[o>>2]|0)|0)==0:0)break;c[p>>2]=(c[p>>2]|0)+(e[q>>1]|0);continue}if((d[c[p>>2]>>0]|0|0)==1){k=(c[p>>2]|0)+1|0;c[p>>2]=k;a[q>>0]=a[k>>0]|0;a[q+1>>0]=a[k+1>>0]|0;c[p>>2]=(c[p>>2]|0)+2;c[p>>2]=(c[p>>2]|0)+(e[q>>1]|0);continue}else{c[p>>2]=(c[p>>2]|0)+1;continue}}if((w|0)==29){c[j>>2]=0;v=c[j>>2]|0;l=i;return v|0}c[u>>2]=1;c[p>>2]=(c[p>>2]|0)+(e[q>>1]|0);a:while(1){x=c[p>>2]|0;if(!(c[u>>2]|0))break;do if((d[x>>0]|0|0)!=1){if((d[c[p>>2]>>0]|0|0)==3){c[u>>2]=(c[u>>2]|0)+1;break}if((d[c[p>>2]>>0]|0|0)!=4)if(!(d[c[p>>2]>>0]|0)){w=20;break a}else break;else{c[u>>2]=(c[u>>2]|0)+-1;break}}else{o=(c[p>>2]|0)+1|0;c[p>>2]=o;a[q>>0]=a[o>>0]|0;a[q+1>>0]=a[o+1>>0]|0;c[p>>2]=(c[p>>2]|0)+(2+(e[q>>1]|0));c[p>>2]=(c[p>>2]|0)+-1}while(0);c[p>>2]=(c[p>>2]|0)+1}if((w|0)==20)Re(22704,481,22735);b[q>>1]=x-(c[r>>2]|0);c[s>>2]=pf(1+(e[q>>1]|0)|0)|0;if(c[s>>2]|0){c[t>>2]=c[s>>2];_w(c[t>>2]|0,c[r>>2]|0,e[q>>1]|0|0)|0;c[t>>2]=(c[t>>2]|0)+(e[q>>1]|0);q=c[t>>2]|0;c[t>>2]=q+1;a[q>>0]=0;c[j>>2]=Qf(c[s>>2]|0)|0;v=c[j>>2]|0;l=i;return v|0}else{c[j>>2]=0;v=c[j>>2]|0;l=i;return v|0}return 0}function Uf(b){b=b|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+20|0;h=f+16|0;i=f+12|0;j=f+24|0;k=f+8|0;n=f+4|0;o=f;c[h>>2]=b;c[n>>2]=0;c[o>>2]=0;if(!(c[h>>2]|0)){c[g>>2]=0;p=c[g>>2]|0;l=f;return p|0}c[i>>2]=c[h>>2];while(1){h=d[c[i>>2]>>0]|0;c[k>>2]=h;if(!h)break;c[i>>2]=(c[i>>2]|0)+1;if((c[k>>2]|0)==1){h=c[i>>2]|0;a[j>>0]=a[h>>0]|0;a[j+1>>0]=a[h+1>>0]|0;c[i>>2]=(c[i>>2]|0)+(2+(e[j>>1]|0));if((c[o>>2]|0)!=1)continue;c[n>>2]=(c[n>>2]|0)+1;continue}if((c[k>>2]|0)!=3){if((c[k>>2]|0)!=4)continue;c[o>>2]=(c[o>>2]|0)+-1;continue}if((c[o>>2]|0)==1)c[n>>2]=(c[n>>2]|0)+1;c[o>>2]=(c[o>>2]|0)+1}c[g>>2]=c[n>>2];p=c[g>>2]|0;l=f;return p|0}function Vf(f,g){f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;h=l;l=l+48|0;if((l|0)>=(m|0))$(48);i=h+28|0;j=h+24|0;k=h+20|0;n=h+16|0;o=h+32|0;p=h+12|0;q=h+8|0;r=h+4|0;s=h;c[j>>2]=f;c[k>>2]=g;c[r>>2]=0;if(c[j>>2]|0?(d[c[j>>2]>>0]|0|0)==3:0){c[n>>2]=c[j>>2];while(1){j=(c[k>>2]|0)>0;c[n>>2]=(c[n>>2]|0)+1;t=(d[c[n>>2]>>0]|0|0)==1;if(!j)break;if(t){j=(c[n>>2]|0)+1|0;c[n>>2]=j;a[o>>0]=a[j>>0]|0;a[o+1>>0]=a[j+1>>0]|0;c[n>>2]=(c[n>>2]|0)+(2+(e[o>>1]|0));c[n>>2]=(c[n>>2]|0)+-1;if(c[r>>2]|0)continue;c[k>>2]=(c[k>>2]|0)+-1;continue}if((d[c[n>>2]>>0]|0|0)==3){c[r>>2]=(c[r>>2]|0)+1;continue}if((d[c[n>>2]>>0]|0|0)!=4)if(!(d[c[n>>2]>>0]|0)){u=15;break}else continue;c[r>>2]=(c[r>>2]|0)+-1;if(c[r>>2]|0)continue;c[k>>2]=(c[k>>2]|0)+-1}if((u|0)==15){c[i>>2]=0;v=c[i>>2]|0;l=h;return v|0}do if(t){k=(c[n>>2]|0)+1|0;a[o>>0]=a[k>>0]|0;a[o+1>>0]=a[k+1>>0]|0;c[p>>2]=pf(5+(e[o>>1]|0)+1|0)|0;if(c[p>>2]|0){c[q>>2]=c[p>>2];k=c[q>>2]|0;c[q>>2]=k+1;a[k>>0]=3;_w(c[q>>2]|0,c[n>>2]|0,3+(e[o>>1]|0)|0)|0;c[q>>2]=(c[q>>2]|0)+(3+(e[o>>1]|0));k=c[q>>2]|0;c[q>>2]=k+1;a[k>>0]=4;a[c[q>>2]>>0]=0;break}c[i>>2]=0;v=c[i>>2]|0;l=h;return v|0}else{if((d[c[n>>2]>>0]|0|0)!=3){c[p>>2]=0;break}c[s>>2]=c[n>>2];c[r>>2]=1;a:do{c[n>>2]=(c[n>>2]|0)+1;do if((d[c[n>>2]>>0]|0|0)!=1){if((d[c[n>>2]>>0]|0|0)==3){c[r>>2]=(c[r>>2]|0)+1;break}if((d[c[n>>2]>>0]|0|0)!=4)if(!(d[c[n>>2]>>0]|0)){u=29;break a}else break;else{c[r>>2]=(c[r>>2]|0)+-1;break}}else{k=(c[n>>2]|0)+1|0;c[n>>2]=k;a[o>>0]=a[k>>0]|0;a[o+1>>0]=a[k+1>>0]|0;c[n>>2]=(c[n>>2]|0)+(2+(e[o>>1]|0));c[n>>2]=(c[n>>2]|0)+-1}while(0)}while((c[r>>2]|0)!=0);if((u|0)==29)Re(22704,673,22757);b[o>>1]=(c[n>>2]|0)+1-(c[s>>2]|0);c[p>>2]=pf(1+(e[o>>1]|0)|0)|0;if(c[p>>2]|0){c[q>>2]=c[p>>2];_w(c[q>>2]|0,c[s>>2]|0,e[o>>1]|0|0)|0;c[q>>2]=(c[q>>2]|0)+(e[o>>1]|0);k=c[q>>2]|0;c[q>>2]=k+1;a[k>>0]=0;break}c[i>>2]=0;v=c[i>>2]|0;l=h;return v|0}while(0);c[i>>2]=Qf(c[p>>2]|0)|0;v=c[i>>2]|0;l=h;return v|0}c[i>>2]=0;v=c[i>>2]|0;l=h;return v|0}function Wf(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=Vf(c[d>>2]|0,0)|0;l=b;return a|0}function Xf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;d=Yf(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;l=e;return d|0}function Yf(b,f,g){b=b|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=l;l=l+32|0;if((l|0)>=(m|0))$(32);i=h+20|0;j=h+16|0;k=h+12|0;n=h+8|0;o=h+4|0;p=h+24|0;q=h;c[j>>2]=b;c[k>>2]=f;c[n>>2]=g;c[q>>2]=0;c[c[n>>2]>>2]=0;if(!(c[j>>2]|0)){c[i>>2]=0;r=c[i>>2]|0;l=h;return r|0}c[o>>2]=c[j>>2];if((d[c[o>>2]>>0]|0|0)!=3){if(c[k>>2]|0){c[i>>2]=0;r=c[i>>2]|0;l=h;return r|0}}else c[o>>2]=(c[o>>2]|0)+1;a:while(1){s=(d[c[o>>2]>>0]|0|0)==1;if((c[k>>2]|0)<=0)break;do if(s){j=(c[o>>2]|0)+1|0;c[o>>2]=j;a[p>>0]=a[j>>0]|0;a[p+1>>0]=a[j+1>>0]|0;c[o>>2]=(c[o>>2]|0)+(2+(e[p>>1]|0));c[o>>2]=(c[o>>2]|0)+-1;if(!(c[q>>2]|0))c[k>>2]=(c[k>>2]|0)+-1}else{if((d[c[o>>2]>>0]|0|0)==3){c[q>>2]=(c[q>>2]|0)+1;break}if((d[c[o>>2]>>0]|0|0)!=4)if(!(d[c[o>>2]>>0]|0)){t=17;break a}else break;c[q>>2]=(c[q>>2]|0)+-1;if(!(c[q>>2]|0))c[k>>2]=(c[k>>2]|0)+-1}while(0);c[o>>2]=(c[o>>2]|0)+1}if((t|0)==17){c[i>>2]=0;r=c[i>>2]|0;l=h;return r|0}if(s){s=(c[o>>2]|0)+1|0;c[o>>2]=s;a[p>>0]=a[s>>0]|0;a[p+1>>0]=a[s+1>>0]|0;c[c[n>>2]>>2]=e[p>>1];c[i>>2]=(c[o>>2]|0)+2;r=c[i>>2]|0;l=h;return r|0}else{c[i>>2]=0;r=c[i>>2]|0;l=h;return r|0}return 0}function Zf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+24|0;g=e+20|0;h=e+16|0;i=e+12|0;j=e+8|0;k=e+4|0;n=e;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[c[i>>2]>>2]=0;c[j>>2]=Yf(c[g>>2]|0,c[h>>2]|0,k)|0;if(!((c[j>>2]|0)!=0&(c[k>>2]|0)!=0)){c[f>>2]=0;o=c[f>>2]|0;l=e;return o|0}c[n>>2]=pf(c[k>>2]|0)|0;if(c[n>>2]|0){_w(c[n>>2]|0,c[j>>2]|0,c[k>>2]|0)|0;c[c[i>>2]>>2]=c[k>>2];c[f>>2]=c[n>>2];o=c[f>>2]|0;l=e;return o|0}else{c[f>>2]=0;o=c[f>>2]|0;l=e;return o|0}return 0}function _f(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+20|0;g=e+16|0;h=e+12|0;i=e+8|0;j=e+4|0;k=e;c[g>>2]=b;c[h>>2]=d;c[i>>2]=Yf(c[g>>2]|0,c[h>>2]|0,j)|0;if(!((c[i>>2]|0)==0|(c[j>>2]|0)>>>0<1)?((c[j>>2]|0)+1|0)>>>0>=1:0){c[k>>2]=pf((c[j>>2]|0)+1|0)|0;if(c[k>>2]|0){_w(c[k>>2]|0,c[i>>2]|0,c[j>>2]|0)|0;a[(c[k>>2]|0)+(c[j>>2]|0)>>0]=0;c[f>>2]=c[k>>2];n=c[f>>2]|0;l=e;return n|0}else{c[f>>2]=0;n=c[f>>2]|0;l=e;return n|0}}c[f>>2]=0;n=c[f>>2]|0;l=e;return n|0}function $f(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+28|0;g=e+24|0;h=e+20|0;i=e+16|0;j=e+12|0;k=e+8|0;n=e+4|0;o=e;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;do if((c[i>>2]|0)==8){c[n>>2]=Zf(c[g>>2]|0,c[h>>2]|0,j)|0;if(!(c[n>>2]|0)){c[f>>2]=0;p=c[f>>2]|0;l=e;return p|0}if(tf(c[g>>2]|0)|0)q=Sp(0)|0;else q=Rp(0)|0;c[k>>2]=q;if(c[k>>2]|0){Ep(c[k>>2]|0,c[n>>2]|0,c[j>>2]<<3)|0;break}else{vf(c[n>>2]|0);break}}else{if(!(c[i>>2]|0))c[i>>2]=1;c[o>>2]=Yf(c[g>>2]|0,c[h>>2]|0,j)|0;if(!(c[o>>2]|0)){c[f>>2]=0;p=c[f>>2]|0;l=e;return p|0}if(Zo(k,c[i>>2]|0,c[o>>2]|0,c[j>>2]|0,0)|0){c[f>>2]=0;p=c[f>>2]|0;l=e;return p|0}}while(0);c[f>>2]=c[k>>2];p=c[f>>2]|0;l=e;return p|0}function ag(f){f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;g=l;l=l+48|0;if((l|0)>=(m|0))$(48);h=g+28|0;i=g+24|0;j=g+20|0;k=g+16|0;n=g+32|0;o=g+12|0;p=g+8|0;q=g+4|0;r=g;c[i>>2]=f;c[q>>2]=0;c[r>>2]=1;if(c[i>>2]|0?(d[c[i>>2]>>0]|0|0)==3:0){c[j>>2]=c[i>>2];while(1){i=(c[r>>2]|0)>0;c[j>>2]=(c[j>>2]|0)+1;s=c[j>>2]|0;if(!i)break;if((d[s>>0]|0|0)==1){i=(c[j>>2]|0)+1|0;c[j>>2]=i;a[n>>0]=a[i>>0]|0;a[n+1>>0]=a[i+1>>0]|0;c[j>>2]=(c[j>>2]|0)+(2+(e[n>>1]|0));c[j>>2]=(c[j>>2]|0)+-1;if(c[q>>2]|0)continue;c[r>>2]=(c[r>>2]|0)+-1;continue}if((d[c[j>>2]>>0]|0|0)==3){c[q>>2]=(c[q>>2]|0)+1;continue}if((d[c[j>>2]>>0]|0|0)!=4)if(!(d[c[j>>2]>>0]|0)){t=15;break}else continue;c[q>>2]=(c[q>>2]|0)+-1;if(c[q>>2]|0)continue;c[r>>2]=(c[r>>2]|0)+-1}if((t|0)==15){c[h>>2]=0;u=c[h>>2]|0;l=g;return u|0}c[k>>2]=s;c[q>>2]=0;a:do{do if((d[c[j>>2]>>0]|0|0)!=1){if((d[c[j>>2]>>0]|0|0)==3){c[q>>2]=(c[q>>2]|0)+1;break}if((d[c[j>>2]>>0]|0|0)!=4)if(!(d[c[j>>2]>>0]|0)){t=24;break a}else break;else{c[q>>2]=(c[q>>2]|0)+-1;break}}else{s=(c[j>>2]|0)+1|0;c[j>>2]=s;a[n>>0]=a[s>>0]|0;a[n+1>>0]=a[s+1>>0]|0;c[j>>2]=(c[j>>2]|0)+(2+(e[n>>1]|0));c[j>>2]=(c[j>>2]|0)+-1}while(0);c[j>>2]=(c[j>>2]|0)+1}while((c[q>>2]|0)!=0);if((t|0)==24){c[h>>2]=0;u=c[h>>2]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=c[i>>2]|0;l=e;return j|0}b=(c[f>>2]|0)+48|0;a[b>>0]=a[b>>0]&-3|2;if(!(c[(c[f>>2]|0)+48+8>>2]|0)){b=vp(0)|0;c[(c[f>>2]|0)+48+8>>2]=b}b=c[(c[f>>2]|0)+48+8>>2]|0;k=Wp(2)|0;un(b,k,c[f>>2]|0);g=c[f>>2]|0;h=g+48|0;i=h+8|0;j=c[i>>2]|0;l=e;return j|0}function _n(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;Kp(c[c[e>>2]>>2]|0,c[c[f>>2]>>2]|0)|0;Kp(c[(c[e>>2]|0)+4>>2]|0,c[(c[f>>2]|0)+4>>2]|0)|0;Kp(c[(c[e>>2]|0)+8>>2]|0,c[(c[f>>2]|0)+8>>2]|0)|0;l=d;return}function $n(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0;f=l;l=l+176|0;if((l|0)>=(m|0))$(176);g=f+168|0;h=f+164|0;i=f+160|0;j=f+156|0;k=f+152|0;n=f+148|0;o=f+144|0;p=f+140|0;q=f+136|0;r=f+132|0;s=f+128|0;t=f+124|0;u=f+112|0;v=f+100|0;w=f+88|0;x=f+84|0;y=f+80|0;z=f+68|0;A=f+64|0;B=f+60|0;C=f+48|0;D=f+36|0;E=f+32|0;F=f+28|0;G=f+24|0;H=f+20|0;I=f+16|0;J=f+12|0;K=f+8|0;L=f+4|0;M=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;if((c[c[j>>2]>>2]|0)==2){c[x>>2]=lo(c[h>>2]|0)|0;Op(c[c[g>>2]>>2]|0,0)|0;Op(c[(c[g>>2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0,c[n>>2]|0)|0;c[p>>2]=c[n>>2];while(1){if((c[p>>2]|0)<=0)break;if(c[(c[i>>2]|0)+((c[p>>2]|0)-1<<2)>>2]|0)break;c[p>>2]=(c[p>>2]|0)+-1}if(!(c[q>>2]|0))break;c[s>>2]=1;break}}else{c[t>>2]=0;while(1){if((c[t>>2]|0)>=(c[n>>2]|0))break;c[(c[i>>2]|0)+(c[t>>2]<<2)>>2]=c[(c[j>>2]|0)+(c[t>>2]<<2)>>2];c[t>>2]=(c[t>>2]|0)+1}c[p>>2]=c[n>>2];c[s>>2]=c[q>>2]}while(0);c[(c[f>>2]|0)+4>>2]=c[p>>2];c[(c[f>>2]|0)+8>>2]=c[s>>2];l=e;return}function go(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;e=l;l=l+48|0;if((l|0)>=(m|0))$(48);f=e+36|0;g=e+32|0;h=e+28|0;i=e+24|0;j=e+20|0;k=e+16|0;n=e+12|0;o=e+8|0;p=e+4|0;q=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=c[(c[g>>2]|0)+4>>2];c[o>>2]=c[(c[g>>2]|0)+8>>2];c[p>>2]=0;c[n>>2]=(c[k>>2]|0)+1;if((c[c[f>>2]>>2]|0)<(c[n>>2]|0))Ap(c[f>>2]|0,c[n>>2]|0);c[j>>2]=c[(c[g>>2]|0)+16>>2];c[i>>2]=c[(c[f>>2]|0)+16>>2];do if(c[k>>2]|0){if(c[o>>2]|0){c[q>>2]=Go(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[h>>2]|0)|0;c[(c[i>>2]|0)+(c[k>>2]<<2)>>2]=c[q>>2];c[n>>2]=(c[k>>2]|0)+(c[q>>2]|0);break}if((c[k>>2]|0)==1?(c[c[j>>2]>>2]|0)>>>0<(c[h>>2]|0)>>>0:0){c[c[i>>2]>>2]=(c[h>>2]|0)-(c[c[j>>2]>>2]|0);c[n>>2]=1;c[p>>2]=1;break}Io(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[h>>2]|0)|0;c[n>>2]=(c[k>>2]|0)-((c[(c[i>>2]|0)+((c[k>>2]|0)-1<<2)>>2]|0)==0&1)}else{c[c[i>>2]>>2]=c[h>>2];c[n>>2]=c[h>>2]|0?1:0;c[p>>2]=1}while(0);c[(c[f>>2]|0)+4>>2]=c[n>>2];c[(c[f>>2]|0)+8>>2]=c[p>>2];l=e;return}function ho(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[i>>2]=Ip(c[h>>2]|0)|0;c[(c[i>>2]|0)+8>>2]=((c[(c[i>>2]|0)+8>>2]|0)!=0^1)&1;fo(c[f>>2]|0,c[g>>2]|0,c[i>>2]|0);Dp(c[i>>2]|0);l=e;return}function io(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+12|0;h=f+8|0;i=f+4|0;j=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;fo(c[g>>2]|0,c[h>>2]|0,c[i>>2]|0);Mo(c[g>>2]|0,c[g>>2]|0,c[j>>2]|0);l=f;return}function jo(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+12|0;h=f+8|0;i=f+4|0;j=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;ho(c[g>>2]|0,c[h>>2]|0,c[i>>2]|0);Mo(c[g>>2]|0,c[g>>2]|0,c[j>>2]|0);l=f;return}function ko(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;if(c[d>>2]|0?c[(c[d>>2]|0)+12>>2]&4|0:0){l=b;return}while(1){if(!(c[(c[d>>2]|0)+4>>2]|0)){e=6;break}if(!((c[(c[(c[d>>2]|0)+16>>2]|0)+((c[(c[d>>2]|0)+4>>2]|0)-1<<2)>>2]|0)!=0^1)){e=6;break}a=(c[d>>2]|0)+4|0;c[a>>2]=(c[a>>2]|0)+-1}if((e|0)==6){l=b;return}}function lo(a){a=a|0;var b=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;b=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=b+20|0;f=b+16|0;g=b+12|0;h=b+8|0;i=b+4|0;j=b;c[f>>2]=a;if(c[f>>2]|0?c[(c[f>>2]|0)+12>>2]&4|0:0){c[e>>2]=c[(c[f>>2]|0)+8>>2];k=c[e>>2]|0;l=b;return k|0}ko(c[f>>2]|0);if(c[(c[f>>2]|0)+4>>2]|0){c[h>>2]=c[(c[(c[f>>2]|0)+16>>2]|0)+((c[(c[f>>2]|0)+4>>2]|0)-1<<2)>>2];if(c[h>>2]|0){c[i>>2]=c[h>>2];h=c[i>>2]|0;c[j>>2]=(c[i>>2]|0)>>>0<65536?(h>>>0<256?0:8):h>>>0<16777216?16:24;c[g>>2]=32-((d[45848+((c[i>>2]|0)>>>(c[j>>2]|0))>>0]|0)+(c[j>>2]|0))}else c[g>>2]=32;c[g>>2]=32-(c[g>>2]|0)+((c[(c[f>>2]|0)+4>>2]|0)-1<<5)}else c[g>>2]=0;c[e>>2]=c[g>>2];k=c[e>>2]|0;l=b;return k|0}function mo(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+20|0;f=d+16|0;g=d+12|0;h=d+8|0;i=d+4|0;j=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=((c[g>>2]|0)>>>0)/32|0;c[i>>2]=((c[g>>2]|0)>>>0)%32|0;if((c[h>>2]|0)>>>0>=(c[(c[f>>2]|0)+4>>2]|0)>>>0){c[e>>2]=0;k=c[e>>2]|0;l=d;return k|0}else{c[j>>2]=c[(c[(c[f>>2]|0)+16>>2]|0)+(c[h>>2]<<2)>>2];c[e>>2]=c[j>>2]&1<>2]|0?1:0;k=c[e>>2]|0;l=d;return k|0}return 0}function no(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;i=d;c[e>>2]=a;c[f>>2]=b;if(c[e>>2]|0?c[(c[e>>2]|0)+12>>2]&16|0:0){Cp();l=d;return}c[h>>2]=((c[f>>2]|0)>>>0)/32|0;c[i>>2]=((c[f>>2]|0)>>>0)%32|0;if((c[h>>2]|0)>>>0>=(c[(c[e>>2]|0)+4>>2]|0)>>>0){c[g>>2]=c[(c[e>>2]|0)+4>>2];while(1){if((c[g>>2]|0)>>>0>=(c[c[e>>2]>>2]|0)>>>0)break;c[(c[(c[e>>2]|0)+16>>2]|0)+(c[g>>2]<<2)>>2]=0;c[g>>2]=(c[g>>2]|0)+1}Ap(c[e>>2]|0,(c[h>>2]|0)+1|0);c[(c[e>>2]|0)+4>>2]=(c[h>>2]|0)+1}g=(c[(c[e>>2]|0)+16>>2]|0)+(c[h>>2]<<2)|0;c[g>>2]=c[g>>2]|1<>2];l=d;return}function oo(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;i=d;c[e>>2]=a;c[f>>2]=b;if(c[e>>2]|0?c[(c[e>>2]|0)+12>>2]&16|0:0){Cp();l=d;return}c[h>>2]=((c[f>>2]|0)>>>0)/32|0;c[i>>2]=((c[f>>2]|0)>>>0)%32|0;if((c[h>>2]|0)>>>0>=(c[(c[e>>2]|0)+4>>2]|0)>>>0){c[g>>2]=c[(c[e>>2]|0)+4>>2];while(1){if((c[g>>2]|0)>>>0>=(c[c[e>>2]>>2]|0)>>>0)break;c[(c[(c[e>>2]|0)+16>>2]|0)+(c[g>>2]<<2)>>2]=0;c[g>>2]=(c[g>>2]|0)+1}Ap(c[e>>2]|0,(c[h>>2]|0)+1|0);c[(c[e>>2]|0)+4>>2]=(c[h>>2]|0)+1}g=(c[(c[e>>2]|0)+16>>2]|0)+(c[h>>2]<<2)|0;c[g>>2]=c[g>>2]|1<>2];c[i>>2]=(c[i>>2]|0)+1;while(1){if((c[i>>2]|0)>>>0>=32)break;g=(c[(c[e>>2]|0)+16>>2]|0)+(c[h>>2]<<2)|0;c[g>>2]=c[g>>2]&~(1<>2]);c[i>>2]=(c[i>>2]|0)+1}c[(c[e>>2]|0)+4>>2]=(c[h>>2]|0)+1;l=d;return}function po(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[e>>2]=a;c[f>>2]=b;if(c[e>>2]|0?c[(c[e>>2]|0)+12>>2]&16|0:0){Cp();l=d;return}c[g>>2]=((c[f>>2]|0)>>>0)/32|0;c[h>>2]=((c[f>>2]|0)>>>0)%32|0;if((c[g>>2]|0)>>>0>=(c[(c[e>>2]|0)+4>>2]|0)>>>0){l=d;return}while(1){if((c[h>>2]|0)>>>0>=32)break;f=(c[(c[e>>2]|0)+16>>2]|0)+(c[g>>2]<<2)|0;c[f>>2]=c[f>>2]&~(1<>2]);c[h>>2]=(c[h>>2]|0)+1}c[(c[e>>2]|0)+4>>2]=(c[g>>2]|0)+1;l=d;return}function qo(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[e>>2]=a;c[f>>2]=b;if(c[e>>2]|0?c[(c[e>>2]|0)+12>>2]&16|0:0){Cp();l=d;return}c[g>>2]=((c[f>>2]|0)>>>0)/32|0;c[h>>2]=((c[f>>2]|0)>>>0)%32|0;if((c[g>>2]|0)>>>0>=(c[(c[e>>2]|0)+4>>2]|0)>>>0){l=d;return}f=(c[(c[e>>2]|0)+16>>2]|0)+(c[g>>2]<<2)|0;c[f>>2]=c[f>>2]&~(1<>2]);l=d;return}function ro(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;i=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=c[(c[e>>2]|0)+16>>2];c[h>>2]=c[(c[e>>2]|0)+4>>2];if(c[e>>2]|0?c[(c[e>>2]|0)+12>>2]&16|0:0){Cp();l=d;return}if((c[f>>2]|0)>>>0>=(c[h>>2]|0)>>>0){c[(c[e>>2]|0)+4>>2]=0;l=d;return}c[i>>2]=0;while(1){j=c[i>>2]|0;if((c[i>>2]|0)>>>0>=((c[h>>2]|0)-(c[f>>2]|0)|0)>>>0)break;c[(c[g>>2]|0)+(c[i>>2]<<2)>>2]=c[(c[g>>2]|0)+(j+(c[f>>2]|0)<<2)>>2];c[i>>2]=(c[i>>2]|0)+1}c[(c[g>>2]|0)+(j<<2)>>2]=0;j=(c[e>>2]|0)+4|0;c[j>>2]=(c[j>>2]|0)-(c[f>>2]|0);l=d;return}function so(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+24|0;g=e+20|0;h=e+16|0;i=e+12|0;j=e+8|0;k=e+4|0;n=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=((c[h>>2]|0)>>>0)/32|0;c[n>>2]=((c[h>>2]|0)>>>0)%32|0;if(c[f>>2]|0?c[(c[f>>2]|0)+12>>2]&16|0:0){Cp();l=e;return}h=c[k>>2]|0;a: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while(1){p=c[j>>2]|0;if((c[j>>2]|0)>>>0>=(c[(c[g>>2]|0)+4>>2]|0)>>>0)break;c[(c[(c[f>>2]|0)+16>>2]|0)+(c[j>>2]<<2)>>2]=c[(c[(c[g>>2]|0)+16>>2]|0)+(p<<2)>>2];c[j>>2]=(c[j>>2]|0)+1}c[(c[f>>2]|0)+4>>2]=p;if((c[k>>2]|0)>>>0>=(c[(c[f>>2]|0)+4>>2]|0)>>>0){c[(c[f>>2]|0)+4>>2]=0;l=e;return}if(c[k>>2]|0){c[j>>2]=0;while(1){q=c[j>>2]|0;if((c[j>>2]|0)>>>0>=((c[(c[f>>2]|0)+4>>2]|0)-(c[k>>2]|0)|0)>>>0)break;c[(c[(c[f>>2]|0)+16>>2]|0)+(c[j>>2]<<2)>>2]=c[(c[(c[f>>2]|0)+16>>2]|0)+(q+(c[k>>2]|0)<<2)>>2];c[j>>2]=(c[j>>2]|0)+1}c[(c[(c[f>>2]|0)+16>>2]|0)+(q<<2)>>2]=0;d=(c[f>>2]|0)+4|0;c[d>>2]=(c[d>>2]|0)-(c[k>>2]|0)}if(c[n>>2]|0?(c[(c[f>>2]|0)+4>>2]|0)!=0:0)qp(c[(c[f>>2]|0)+16>>2]|0,c[(c[f>>2]|0)+16>>2]|0,c[(c[f>>2]|0)+4>>2]|0,c[n>>2]|0)|0}while(0);while(1){if((c[(c[f>>2]|0)+4>>2]|0)<=0){r=40;break}if(c[(c[(c[f>>2]|0)+16>>2]|0)+((c[(c[f>>2]|0)+4>>2]|0)-1<<2)>>2]|0){r=40;break}n=(c[f>>2]|0)+4|0;c[n>>2]=(c[n>>2]|0)+-1}if((r|0)==40){l=e;return}}function to(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;i=d;c[e>>2]=a;c[f>>2]=b;c[h>>2]=c[(c[e>>2]|0)+4>>2];if(!((c[f>>2]|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>>2]=c[(c[g>>2]|0)+16>>2];c[q>>2]=0;while(1){if((c[q>>2]|0)>>>0>=(c[k>>2]|0)>>>0)break;c[(c[o>>2]|0)+(c[q>>2]<<2)>>2]=c[(c[p>>2]|0)+(c[q>>2]<<2)>>2];c[q>>2]=(c[q>>2]|0)+1}c[(c[f>>2]|0)+4>>2]=c[k>>2];c[(c[f>>2]|0)+12>>2]=c[(c[g>>2]|0)+12>>2];c[(c[f>>2]|0)+8>>2]=c[n>>2]}if((c[i>>2]|0)==0|(c[j>>2]|0)!=0){if(c[h>>2]|0){to(c[f>>2]|0,(c[i>>2]|0)+1|0);so(c[f>>2]|0,c[f>>2]|0,32-(c[j>>2]|0)|0)}}else to(c[f>>2]|0,c[i>>2]|0);while(1){if((c[(c[f>>2]|0)+4>>2]|0)<=0){r=19;break}if(c[(c[(c[f>>2]|0)+16>>2]|0)+((c[(c[f>>2]|0)+4>>2]|0)-1<<2)>>2]|0){r=19;break}i=(c[f>>2]|0)+4|0;c[i>>2]=(c[i>>2]|0)+-1}if((r|0)==19){l=e;return}}function vo(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=c[g>>2];ko(c[f>>2]|0);do if(c[(c[f>>2]|0)+4>>2]|0){if(c[(c[f>>2]|0)+8>>2]|0){c[e>>2]=-1;break}if((c[(c[f>>2]|0)+4>>2]|0)!=1){c[e>>2]=1;break}if((c[c[(c[f>>2]|0)+16>>2]>>2]|0)>>>0>(c[h>>2]|0)>>>0){c[e>>2]=1;break}if((c[c[(c[f>>2]|0)+16>>2]>>2]|0)>>>0<(c[h>>2]|0)>>>0){c[e>>2]=-1;break}else{c[e>>2]=0;break}}else c[e>>2]=0-((c[h>>2]|0)!=0&1);while(0);l=d;return c[e>>2]|0}function wo(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+20|0;f=d+16|0;g=d+12|0;h=d+8|0;i=d+4|0;j=d;c[f>>2]=a;c[g>>2]=b;if(!(c[f>>2]|0?(c[(c[f>>2]|0)+12>>2]&4|0)!=0:0))k=3;do if((k|0)==3){if(c[g>>2]|0?c[(c[g>>2]|0)+12>>2]&4|0:0)break;ko(c[f>>2]|0);ko(c[g>>2]|0);c[h>>2]=c[(c[f>>2]|0)+4>>2];c[i>>2]=c[(c[g>>2]|0)+4>>2];if((c[(c[f>>2]|0)+8>>2]|0)==0?c[(c[g>>2]|0)+8>>2]|0:0){c[e>>2]=1;n=c[e>>2]|0;l=d;return n|0}if(c[(c[f>>2]|0)+8>>2]|0?(c[(c[g>>2]|0)+8>>2]|0)==0:0){c[e>>2]=-1;n=c[e>>2]|0;l=d;return n|0}if(((c[h>>2]|0)!=(c[i>>2]|0)?(c[(c[f>>2]|0)+8>>2]|0)==0:0)?(c[(c[g>>2]|0)+8>>2]|0)==0:0){c[e>>2]=(c[h>>2]|0)-(c[i>>2]|0);n=c[e>>2]|0;l=d;return n|0}if(((c[h>>2]|0)!=(c[i>>2]|0)?c[(c[f>>2]|0)+8>>2]|0:0)?c[(c[g>>2]|0)+8>>2]|0:0){c[e>>2]=(c[i>>2]|0)+(c[h>>2]|0);n=c[e>>2]|0;l=d;return n|0}if(!(c[h>>2]|0)){c[e>>2]=0;n=c[e>>2]|0;l=d;return n|0}b=Ko(c[(c[f>>2]|0)+16>>2]|0,c[(c[g>>2]|0)+16>>2]|0,c[h>>2]|0)|0;c[j>>2]=b;if(!b){c[e>>2]=0;n=c[e>>2]|0;l=d;return n|0}if((((c[j>>2]|0)<0?1:0)|0)==((c[(c[f>>2]|0)+8>>2]|0?1:0)|0)){c[e>>2]=1;n=c[e>>2]|0;l=d;return n|0}else{c[e>>2]=-1;n=c[e>>2]|0;l=d;return n|0}}while(0);do if(c[f>>2]|0?c[(c[f>>2]|0)+12>>2]&4|0:0){if(c[g>>2]|0?c[(c[g>>2]|0)+12>>2]&4|0:0)break;c[e>>2]=-1;n=c[e>>2]|0;l=d;return n|0}while(0);if(c[f>>2]|0){if(c[g>>2]|0?(c[(c[f>>2]|0)+12>>2]&4|0)==0:0)k=13}else if(c[g>>2]|0)k=13;if((k|0)==13?c[(c[g>>2]|0)+12>>2]&4|0:0){c[e>>2]=1;n=c[e>>2]|0;l=d;return n|0}if((c[(c[f>>2]|0)+8>>2]|0)==0?(c[(c[g>>2]|0)+8>>2]|0)==0:0){c[e>>2]=0;n=c[e>>2]|0;l=d;return n|0}if((c[(c[f>>2]|0)+8>>2]|0)<(c[(c[g>>2]|0)+8>>2]|0)){c[e>>2]=-1;n=c[e>>2]|0;l=d;return n|0}if((c[(c[f>>2]|0)+8>>2]|0)>(c[(c[g>>2]|0)+8>>2]|0)){c[e>>2]=1;n=c[e>>2]|0;l=d;return n|0}else{c[e>>2]=Jv(c[(c[f>>2]|0)+16>>2]|0,c[(c[g>>2]|0)+16>>2]|0,((c[(c[f>>2]|0)+8>>2]|0)+7|0)/8|0)|0;n=c[e>>2]|0;l=d;return n|0}return 0}function xo(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+16|0;g=e+12|0;h=e+8|0;i=e+4|0;j=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[i>>2]=c[(c[h>>2]|0)+8>>2];c[j>>2]=0;if((c[f>>2]|0)==(c[h>>2]|0)){c[j>>2]=Ip(c[h>>2]|0)|0;c[h>>2]=c[j>>2]}yo(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);if((c[i>>2]|0?1:0)^(c[(c[g>>2]|0)+8>>2]|0?1:0)|0?c[(c[f>>2]|0)+4>>2]|0:0)fo(c[f>>2]|0,c[f>>2]|0,c[h>>2]|0);if(!(c[j>>2]|0)){l=e;return}Dp(c[j>>2]|0);l=e;return}function yo(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;zo(0,c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);l=e;return}function zo(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0;g=l;l=l+160|0;if((l|0)>=(m|0))$(160);h=g+144|0;i=g+140|0;j=g+136|0;k=g+132|0;n=g+128|0;o=g+124|0;p=g+120|0;q=g+116|0;r=g+112|0;s=g+108|0;t=g+104|0;u=g+100|0;v=g+96|0;w=g+92|0;x=g+88|0;y=g+84|0;z=g+64|0;A=g+44|0;B=g+40|0;C=g+36|0;D=g+32|0;E=g+28|0;F=g+24|0;G=g+20|0;H=g+16|0;I=g+12|0;J=g+8|0;K=g+4|0;L=g;c[h>>2]=a;c[i>>2]=b;c[j>>2]=e;c[k>>2]=f;c[r>>2]=c[(c[j>>2]|0)+4>>2];c[s>>2]=c[(c[k>>2]|0)+4>>2];c[v>>2]=c[(c[j>>2]|0)+8>>2];c[w>>2]=c[(c[j>>2]|0)+8>>2]^c[(c[k>>2]|0)+8>>2];c[B>>2]=0;c[u>>2]=(c[r>>2]|0)+1;Ap(c[i>>2]|0,c[u>>2]|0);c[t>>2]=(c[u>>2]|0)-(c[s>>2]|0);if((c[t>>2]|0)<=0){a:do if((c[j>>2]|0)!=(c[i>>2]|0)){c[(c[i>>2]|0)+4>>2]=c[(c[j>>2]|0)+4>>2];c[(c[i>>2]|0)+8>>2]=c[(c[j>>2]|0)+8>>2];c[C>>2]=0;while(1){if((c[C>>2]|0)>=(c[r>>2]|0))break a;c[(c[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}}else c[p>>2]=(c[q>>2]|0)+(c[s>>2]<<2);while(0);c[F>>2]=c[(c[o>>2]|0)+((c[s>>2]|0)-1<<2)>>2];E=c[F>>2]|0;c[G>>2]=(c[F>>2]|0)>>>0<65536?(E>>>0<256?0:8):E>>>0<16777216?16:24;c[x>>2]=32-((d[45848+((c[F>>2]|0)>>>(c[G>>2]|0))>>0]|0)+(c[G>>2]|0));do if(c[x>>2]|0){c[A+(c[B>>2]<<2)>>2]=c[s>>2];if(c[k>>2]|0)N=(c[(c[k>>2]|0)+12>>2]&1|0)!=0;else N=0;G=wp(c[s>>2]|0,N&1)|0;F=c[B>>2]|0;c[B>>2]=F+1;c[z+(F<<2)>>2]=G;c[H>>2]=G;ip(c[H>>2]|0,c[o>>2]|0,c[s>>2]|0,c[x>>2]|0)|0;c[o>>2]=c[H>>2];c[I>>2]=ip(c[q>>2]|0,c[n>>2]|0,c[r>>2]|0,c[x>>2]|0)|0;if(c[I>>2]|0){c[(c[q>>2]|0)+(c[r>>2]<<2)>>2]=c[I>>2];c[u>>2]=(c[r>>2]|0)+1;break}else{c[u>>2]=c[r>>2];break}}else{if((c[o>>2]|0)!=(c[q>>2]|0)){if(c[h>>2]|0?(c[o>>2]|0)==(c[p>>2]|0):0)O=32}else O=32;if((O|0)==32){c[A+(c[B>>2]<<2)>>2]=c[s>>2];if(c[k>>2]|0)P=(c[(c[k>>2]|0)+12>>2]&1|0)!=0;else P=0;G=wp(c[s>>2]|0,P&1)|0;F=c[B>>2]|0;c[B>>2]=F+1;c[z+(F<<2)>>2]=G;c[J>>2]=G;c[K>>2]=0;while(1){if((c[K>>2]|0)>=(c[s>>2]|0))break;c[(c[J>>2]|0)+(c[K>>2]<<2)>>2]=c[(c[o>>2]|0)+(c[K>>2]<<2)>>2];c[K>>2]=(c[K>>2]|0)+1}c[o>>2]=c[J>>2]}c:do if((c[q>>2]|0)!=(c[n>>2]|0)){c[L>>2]=0;while(1){if((c[L>>2]|0)>=(c[r>>2]|0))break c;c[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>>2]|0)){j=c[i>>2]|0;l=e;return j|0}c[c[(c[f>>2]|0)+16>>2]>>2]=c[i>>2];c[(c[f>>2]|0)+4>>2]=c[i>>2]|0?1:0;j=c[i>>2]|0;l=e;return j|0}function Bo(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[i>>2]=vp(c[(c[f>>2]|0)+4>>2]|0)|0;Co(c[f>>2]|0,c[i>>2]|0,c[g>>2]|0,c[h>>2]|0);Dp(c[i>>2]|0);l=e;return}function Co(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+20|0;h=f+16|0;i=f+12|0;j=f+8|0;k=f+4|0;n=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;c[k>>2]=c[(c[j>>2]|0)+8>>2];c[n>>2]=0;if(!((c[g>>2]|0)!=(c[j>>2]|0)?(c[h>>2]|0)!=(c[j>>2]|0):0)){c[n>>2]=Ip(c[j>>2]|0)|0;c[j>>2]=c[n>>2]}zo(c[g>>2]|0,c[h>>2]|0,c[i>>2]|0,c[j>>2]|0);if(c[k>>2]^c[(c[i>>2]|0)+8>>2]|0?c[(c[h>>2]|0)+4>>2]|0:0){go(c[g>>2]|0,c[g>>2]|0,1);fo(c[h>>2]|0,c[h>>2]|0,c[j>>2]|0)}if(!(c[n>>2]|0)){l=f;return}Dp(c[n>>2]|0);l=f;return}function Do(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;e=l;l=l+48|0;if((l|0)>=(m|0))$(48);f=e+32|0;g=e+28|0;h=e+24|0;i=e+20|0;j=e+16|0;k=e+12|0;n=e+8|0;o=e+4|0;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>2]|0)+8>>2]=0;c[(c[j>>2]|0)+8>>2]=0;while(1){h=(vo(c[j>>2]|0,0)|0)!=0;k=c[f>>2]|0;n=c[i>>2]|0;if(!h)break;xo(k,n,c[j>>2]|0);Kp(c[i>>2]|0,c[j>>2]|0)|0;Kp(c[j>>2]|0,c[f>>2]|0)|0}Kp(k,n)|0;Dp(c[i>>2]|0);Dp(c[j>>2]|0);j=((vo(c[f>>2]|0,1)|0)!=0^1)&1;l=e;return j|0}function Go(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+24|0;h=f+20|0;i=f+16|0;j=f+12|0;k=f+8|0;n=f+4|0;o=f;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;e=c[i>>2]|0;c[i>>2]=e+4;c[n>>2]=c[e>>2];c[k>>2]=(c[k>>2]|0)+(c[n>>2]|0);e=c[k>>2]|0;d=c[h>>2]|0;c[h>>2]=d+4;c[d>>2]=e;a:do if((c[k>>2]|0)>>>0<(c[n>>2]|0)>>>0){while(1){e=(c[j>>2]|0)+-1|0;c[j>>2]=e;if(!e)break;e=c[i>>2]|0;c[i>>2]=e+4;c[n>>2]=(c[e>>2]|0)+1;e=c[n>>2]|0;d=c[h>>2]|0;c[h>>2]=d+4;c[d>>2]=e;if(c[n>>2]|0)break a}c[g>>2]=1;p=c[g>>2]|0;l=f;return p|0}while(0);b:do if((c[h>>2]|0)!=(c[i>>2]|0)){c[o>>2]=0;while(1){if((c[o>>2]|0)>=((c[j>>2]|0)-1|0))break b;c[(c[h>>2]|0)+(c[o>>2]<<2)>>2]=c[(c[i>>2]|0)+(c[o>>2]<<2)>>2];c[o>>2]=(c[o>>2]|0)+1}}while(0);c[g>>2]=0;p=c[g>>2]|0;l=f;return p|0}function Ho(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i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2)>>2]=c[(c[i>>2]|0)+(c[o>>2]<<2)>>2];c[o>>2]=(c[o>>2]|0)+1}}while(0);c[g>>2]=0;p=c[g>>2]|0;l=f;return p|0}function Jo(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g+20|0;i=g+16|0;j=g+12|0;k=g+8|0;n=g+4|0;o=g;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;c[n>>2]=f;c[o>>2]=0;if(c[n>>2]|0)c[o>>2]=rp(c[h>>2]|0,c[i>>2]|0,c[k>>2]|0,c[n>>2]|0)|0;if(!((c[j>>2]|0)-(c[n>>2]|0)|0)){p=c[o>>2]|0;l=g;return p|0}c[o>>2]=Io((c[h>>2]|0)+(c[n>>2]<<2)|0,(c[i>>2]|0)+(c[n>>2]<<2)|0,(c[j>>2]|0)-(c[n>>2]|0)|0,c[o>>2]|0)|0;p=c[o>>2]|0;l=g;return p|0}function Ko(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+24|0;g=e+20|0;h=e+16|0;i=e+12|0;j=e+8|0;k=e+4|0;n=e;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=(c[i>>2]|0)-1;while(1){if((c[j>>2]|0)<0){o=5;break}c[k>>2]=c[(c[g>>2]|0)+(c[j>>2]<<2)>>2];c[n>>2]=c[(c[h>>2]|0)+(c[j>>2]<<2)>>2];if((c[k>>2]|0)!=(c[n>>2]|0)){o=6;break}c[j>>2]=(c[j>>2]|0)+-1}if((o|0)==5){c[f>>2]=0;p=c[f>>2]|0;l=e;return p|0}else if((o|0)==6){c[f>>2]=(c[k>>2]|0)>>>0>(c[n>>2]|0)>>>0?1:-1;p=c[f>>2]|0;l=e;return p|0}return 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)+16>>2];c[j>>2]=c[(c[g>>2]|0)+4>>2];c[s>>2]=c[(c[g>>2]|0)+8>>2];if(c[g>>2]|0)E=(c[(c[g>>2]|0)+12>>2]&1|0)!=0;else E=0;c[u>>2]=E&1;c[o>>2]=c[(c[g>>2]|0)+16>>2]}else{c[i>>2]=c[(c[g>>2]|0)+4>>2];c[r>>2]=c[(c[g>>2]|0)+8>>2];if(c[g>>2]|0)F=(c[(c[g>>2]|0)+12>>2]&1|0)!=0;else F=0;c[t>>2]=F&1;c[n>>2]=c[(c[g>>2]|0)+16>>2];c[j>>2]=c[(c[h>>2]|0)+4>>2];c[s>>2]=c[(c[h>>2]|0)+8>>2];if(c[h>>2]|0)G=(c[(c[h>>2]|0)+12>>2]&1|0)!=0;else G=0;c[u>>2]=G&1;c[o>>2]=c[(c[h>>2]|0)+16>>2]}c[v>>2]=c[r>>2]^c[s>>2];c[p>>2]=c[(c[f>>2]|0)+16>>2];c[k>>2]=(c[i>>2]|0)+(c[j>>2]|0);if(c[f>>2]|0?c[(c[f>>2]|0)+12>>2]&1|0:0)H=19;else H=14;do if((H|0)==14){if(!(c[g>>2]|0?(c[(c[g>>2]|0)+12>>2]&1|0)!=0:0)){if(!(c[h>>2]|0)){H=19;break}if(!(c[(c[h>>2]|0)+12>>2]&1)){H=19;break}}c[p>>2]=wp(c[k>>2]|0,1)|0;c[w>>2]=2}while(0);a:do if((H|0)==19){h=(c[p>>2]|0)==(c[n>>2]|0);if((c[c[f>>2]>>2]|0)<(c[k>>2]|0)){if(!h?(c[p>>2]|0)!=(c[o>>2]|0):0){Ap(c[f>>2]|0,c[k>>2]|0);c[p>>2]=c[(c[f>>2]|0)+16>>2];break}if(c[f>>2]|0)I=(c[(c[f>>2]|0)+12>>2]&1|0)!=0;else I=0;c[p>>2]=wp(c[k>>2]|0,I&1)|0;c[w>>2]=1;break}if(!h){if((c[p>>2]|0)!=(c[o>>2]|0))break;c[y>>2]=c[j>>2];h=wp(c[j>>2]|0,c[u>>2]|0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2]|0,c[i>>2]|0);yo(c[g>>2]|0,c[g>>2]|0,c[j>>2]|0);l=f;return}function So(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0;g=l;l=l+512|0;if((l|0)>=(m|0))$(512);h=g+504|0;i=g+500|0;j=g+496|0;k=g+492|0;n=g+488|0;o=g+484|0;p=g+480|0;q=g+476|0;r=g+472|0;s=g+468|0;t=g+464|0;u=g+460|0;v=g+456|0;w=g+452|0;x=g+448|0;y=g+444|0;z=g+440|0;A=g+436|0;B=g+432|0;C=g+428|0;D=g+424|0;E=g+420|0;F=g+416|0;G=g+412|0;H=g+408|0;I=g+404|0;J=g+400|0;K=g+396|0;L=g+392|0;M=g+328|0;N=g+264|0;O=g+260|0;P=g+256|0;Q=g+252|0;R=g+248|0;S=g+244|0;T=g+240|0;U=g+236|0;V=g+232|0;W=g+228|0;X=g+224|0;Y=g+220|0;Z=g+216|0;_=g+212|0;aa=g+208|0;ba=g+204|0;ca=g+200|0;da=g+196|0;ea=g+192|0;fa=g+164|0;ga=g+160|0;ha=g+156|0;ia=g+152|0;ja=g+148|0;ka=g+144|0;la=g+140|0;ma=g+136|0;na=g+132|0;oa=g+128|0;pa=g+124|0;qa=g+120|0;ra=g+116|0;sa=g+112|0;ta=g+108|0;ua=g+104|0;va=g+100|0;wa=g+80|0;xa=g+60|0;ya=g+56|0;za=g+52|0;Aa=g+48|0;Ba=g+44|0;Ca=g+24|0;Da=g+4|0;Ea=g;c[h>>2]=a;c[i>>2]=b;c[j>>2]=e;c[k>>2]=f;c[E>>2]=0;c[F>>2]=0;c[G>>2]=0;c[H>>2]=0;c[I>>2]=0;c[J>>2]=0;c[K>>2]=0;c[L>>2]=0;c[r>>2]=c[(c[j>>2]|0)+4>>2];c[s>>2]=c[(c[k>>2]|0)+4>>2];c[B>>2]=c[s>>2]<<1;c[v>>2]=c[(c[k>>2]|0)+8>>2];do if((c[r>>2]<<5|0)<=512){if((c[r>>2]<<5|0)>256){c[O>>2]=4;break}if((c[r>>2]<<5|0)>128){c[O>>2]=3;break}if((c[r>>2]<<5|0)>64){c[O>>2]=2;break}else{c[O>>2]=1;break}}else c[O>>2]=5;while(0);if(c[j>>2]|0)Fa=(c[(c[j>>2]|0)+12>>2]&1|0)!=0;else Fa=0;c[y>>2]=Fa&1;if(c[k>>2]|0)Ga=(c[(c[k>>2]|0)+12>>2]&1|0)!=0;else Ga=0;c[z>>2]=Ga&1;if(c[i>>2]|0)Ha=(c[(c[i>>2]|0)+12>>2]&1|0)!=0;else Ha=0;c[A>>2]=Ha&1;c[n>>2]=c[(c[h>>2]|0)+16>>2];c[o>>2]=c[(c[j>>2]|0)+16>>2];if(!(c[s>>2]|0))df();do if(c[r>>2]|0){c[I>>2]=c[z>>2]|0?c[s>>2]|0:0;j=wp(c[s>>2]|0,c[z>>2]|0)|0;c[E>>2]=j;c[p>>2]=j;c[S>>2]=c[(c[(c[k>>2]|0)+16>>2]|0)+((c[s>>2]|0)-1<<2)>>2];j=c[S>>2]|0;c[T>>2]=(c[S>>2]|0)>>>0<65536?(j>>>0<256?0:8):j>>>0<16777216?16:24;c[C>>2]=32-((d[45848+((c[S>>2]|0)>>>(c[T>>2]|0))>>0]|0)+(c[T>>2]|0));a:do if(c[C>>2]|0)ip(c[p>>2]|0,c[(c[k>>2]|0)+16>>2]|0,c[s>>2]|0,c[C>>2]|0)|0;else{c[U>>2]=0;while(1){if((c[U>>2]|0)>=(c[s>>2]|0))break a;c[(c[p>>2]|0)+(c[U>>2]<<2)>>2]=c[(c[(c[k>>2]|0)+16>>2]|0)+(c[U>>2]<<2)>>2];c[U>>2]=(c[U>>2]|0)+1}}while(0);c[t>>2]=c[(c[i>>2]|0)+4>>2];c[w>>2]=c[(c[i>>2]|0)+8>>2];b:do if((c[t>>2]|0)>(c[s>>2]|0)){c[J>>2]=c[A>>2]|0?(c[t>>2]|0)+1|0:0;j=wp((c[t>>2]|0)+1|0,c[A>>2]|0)|0;c[F>>2]=j;c[q>>2]=j;c[V>>2]=0;while(1){if((c[V>>2]|0)>=(c[t>>2]|0))break;c[(c[q>>2]|0)+(c[V>>2]<<2)>>2]=c[(c[(c[i>>2]|0)+16>>2]|0)+(c[V>>2]<<2)>>2];c[V>>2]=(c[V>>2]|0)+1}gp((c[q>>2]|0)+(c[s>>2]<<2)|0,0,c[q>>2]|0,c[t>>2]|0,c[p>>2]|0,c[s>>2]|0)|0;c[t>>2]=c[s>>2];while(1){if((c[t>>2]|0)<=0)break b;if(c[(c[q>>2]|0)+((c[t>>2]|0)-1<<2)>>2]|0)break b;c[t>>2]=(c[t>>2]|0)+-1}}else c[q>>2]=c[(c[i>>2]|0)+16>>2];while(0);if(!(c[t>>2]|0)){c[(c[h>>2]|0)+4>>2]=0;c[(c[h>>2]|0)+8>>2]=0;break}c:do if((c[n>>2]|0)==(c[q>>2]|0)){if(c[F>>2]|0)Se(46104,46115,515,46125);c[J>>2]=c[A>>2]|0?c[t>>2]|0:0;j=wp(c[t>>2]|0,c[A>>2]|0)|0;c[F>>2]=j;c[q>>2]=j;c[W>>2]=0;while(1){if((c[W>>2]|0)>=(c[t>>2]|0))break c;c[(c[q>>2]|0)+(c[W>>2]<<2)>>2]=c[(c[n>>2]|0)+(c[W>>2]<<2)>>2];c[W>>2]=(c[W>>2]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|0:0);g:do if((c[D>>2]|0)!=0&(c[u>>2]|0)!=0){if(c[C>>2]|0)qp(c[p>>2]|0,c[p>>2]|0,c[s>>2]|0,c[C>>2]|0)|0;Jo(c[n>>2]|0,c[p>>2]|0,c[s>>2]|0,c[n>>2]|0,c[u>>2]|0)|0;c[u>>2]=c[s>>2];c[x>>2]=c[v>>2];while(1){if((c[u>>2]|0)<=0)break g;if(c[(c[n>>2]|0)+((c[u>>2]|0)-1<<2)>>2]|0)break g;c[u>>2]=(c[u>>2]|0)+-1}}while(0);if((c[(c[h>>2]|0)+16>>2]|0)==(c[n>>2]|0)){c[(c[h>>2]|0)+4>>2]=c[u>>2];c[(c[h>>2]|0)+8>>2]=c[x>>2];break}else Se(46140,46115,786,46125)}else{if((c[s>>2]|0)==1)La=(c[c[(c[k>>2]|0)+16>>2]>>2]|0)==1;else La=0;c[(c[h>>2]|0)+4>>2]=La?0:1;if(c[(c[h>>2]|0)+4>>2]|0){if((c[c[h>>2]>>2]|0)<1)Ap(c[h>>2]|0,1);c[n>>2]=c[(c[h>>2]|0)+16>>2];c[c[n>>2]>>2]=1}c[(c[h>>2]|0)+8>>2]=0}while(0);if(c[E>>2]|0)yp(c[E>>2]|0,c[I>>2]|0);if(c[F>>2]|0)yp(c[F>>2]|0,c[J>>2]|0);if(c[G>>2]|0)yp(c[G>>2]|0,c[K>>2]|0);if(!(c[H>>2]|0)){l=g;return}yp(c[H>>2]|0,c[L>>2]|0);l=g;return}function To(a,b,d,e,f,g,h,i,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;k=l;l=l+48|0;if((l|0)>=(m|0))$(48);n=k+32|0;o=k+28|0;p=k+24|0;q=k+20|0;r=k+16|0;s=k+12|0;t=k+8|0;u=k+4|0;v=k;c[n>>2]=a;c[o>>2]=b;c[p>>2]=d;c[q>>2]=e;c[r>>2]=f;c[s>>2]=g;c[t>>2]=h;c[u>>2]=i;c[v>>2]=j;j=c[n>>2]|0;i=c[p>>2]|0;p=c[q>>2]|0;h=c[r>>2]|0;r=c[s>>2]|0;if((c[s>>2]|0)<16)op(j,i,p,h,r)|0;else np(j,i,p,h,r,c[v>>2]|0);if(((c[q>>2]|0)+(c[s>>2]|0)|0)>(c[u>>2]|0)){gp((c[n>>2]|0)+(c[u>>2]<<2)|0,0,c[n>>2]|0,(c[q>>2]|0)+(c[s>>2]|0)|0,c[t>>2]|0,c[u>>2]|0)|0;c[c[o>>2]>>2]=c[u>>2];l=k;return}else{c[c[o>>2]>>2]=(c[q>>2]|0)+(c[s>>2]|0);l=k;return}}function Uo(a){a=a|0;var b=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;b=l;l=l+48|0;if((l|0)>=(m|0))$(48);e=b+32|0;f=b+28|0;g=b+24|0;h=b+20|0;i=b+16|0;j=b+12|0;k=b+8|0;n=b+4|0;o=b;c[e>>2]=a;c[g>>2]=0;c[f>>2]=0;while(1){if((c[f>>2]|0)>>>0>=(c[(c[e>>2]|0)+4>>2]|0)>>>0){p=6;break}if(c[(c[(c[e>>2]|0)+16>>2]|0)+(c[f>>2]<<2)>>2]|0)break;c[g>>2]=(c[g>>2]|0)+32;c[f>>2]=(c[f>>2]|0)+1}if((p|0)==6){q=c[g>>2]|0;l=b;return q|0}c[i>>2]=c[(c[(c[e>>2]|0)+16>>2]|0)+(c[f>>2]<<2)>>2];c[j>>2]=c[i>>2];c[n>>2]=c[j>>2]&0-(c[j>>2]|0);j=c[n>>2]|0;c[o>>2]=(c[n>>2]|0)>>>0<65536?(j>>>0<256?0:8):j>>>0<16777216?16:24;c[k>>2]=32-((d[45848+((c[n>>2]|0)>>>(c[o>>2]|0))>>0]|0)+(c[o>>2]|0));c[h>>2]=31-(c[k>>2]|0);c[g>>2]=(c[g>>2]|0)+(c[h>>2]|0);q=c[g>>2]|0;l=b;return q|0}function Vo(a,b,d,e){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)|0;else y=vp(x)|0;c[r>>2]=y;if(c[s>>2]|0?(Yo(c[r>>2]|0,c[u>>2]|0,c[s>>2]|0,0),c[(c[r>>2]|0)+8>>2]=(((d[c[u>>2]>>0]|0)&128|0)!=0^1^1)&1,c[(c[r>>2]|0)+8>>2]|0):0){_o(c[r>>2]|0);eo(c[r>>2]|0,c[r>>2]|0,1);c[(c[r>>2]|0)+8>>2]=1}u=c[r>>2]|0;if(c[j>>2]|0){ko(u);c[c[j>>2]>>2]=c[r>>2]}else Dp(u);if(c[p>>2]|0)c[c[p>>2]>>2]=c[s>>2];c[i>>2]=0;z=c[i>>2]|0;l=h;return z|0}if((c[k>>2]|0)==5){u=(((c[s>>2]|0)+4-1|0)>>>0)/4|0;if(c[t>>2]|0)A=xp(u)|0;else A=vp(u)|0;c[r>>2]=A;if(c[s>>2]|0)Yo(c[r>>2]|0,c[q>>2]|0,c[s>>2]|0,0);A=c[r>>2]|0;if(c[j>>2]|0){ko(A);c[c[j>>2]>>2]=c[r>>2]}else Dp(A);if(c[p>>2]|0)c[c[p>>2]>>2]=c[s>>2];c[i>>2]=0;z=c[i>>2]|0;l=h;return z|0}if((c[k>>2]|0)==2){c[r>>2]=$o(c[q>>2]|0,s,c[t>>2]|0)|0;if(c[p>>2]|0)c[c[p>>2]>>2]=c[s>>2];A=c[r>>2]|0;if(!((c[j>>2]|0)!=0&(c[r>>2]|0)!=0)){if(A|0){Dp(c[r>>2]|0);c[r>>2]=0}}else{ko(A);c[c[j>>2]>>2]=c[r>>2]}c[i>>2]=c[r>>2]|0?0:65;z=c[i>>2]|0;l=h;return z|0}if((c[k>>2]|0)!=3){if((c[k>>2]|0)!=4){c[i>>2]=45;z=c[i>>2]|0;l=h;return z|0}if(c[o>>2]|0){c[i>>2]=45;z=c[i>>2]|0;l=h;return z|0}if(c[t>>2]|0)B=xp(0)|0;else B=vp(0)|0;c[r>>2]=B;if(ap(c[r>>2]|0,c[q>>2]|0)|0){Dp(c[r>>2]|0);c[i>>2]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);c[k>>2]=4-(((c[s>>2]|0)>>>0)%4|0);c[k>>2]=(c[k>>2]|0)%4|0;s=c[t>>2]|0;c[(c[g>>2]|0)+4>>2]=s;c[n>>2]=s;c[(c[g>>2]|0)+8>>2]=c[i>>2];a:while(1){if((c[n>>2]|0)<=0){v=37;break}c[u>>2]=0;while(1){if((c[k>>2]|0)>=4)break;if(c[j>>2]|0){c[p>>2]=48;c[j>>2]=0}else{i=c[h>>2]|0;c[h>>2]=i+1;c[p>>2]=a[i>>0]}if(!(c[p>>2]|0)){v=18;break a}i=c[h>>2]|0;c[h>>2]=i+1;c[q>>2]=a[i>>0];if(!(c[q>>2]|0)){v=20;break a}i=c[p>>2]|0;do if((c[p>>2]|0)>=48&(c[p>>2]|0)<=57)c[o>>2]=i-48;else{s=c[p>>2]|0;if((i|0)>=97&(c[p>>2]|0)<=102){c[o>>2]=s-97+10;break}if(!((s|0)>=65&(c[p>>2]|0)<=70)){v=27;break a}c[o>>2]=(c[p>>2]|0)-65+10}while(0);c[o>>2]=c[o>>2]<<4;i=c[q>>2]|0;do if((c[q>>2]|0)>=48&(c[q>>2]|0)<=57)c[o>>2]=c[o>>2]|i-48;else{s=c[q>>2]|0;if((i|0)>=97&(c[q>>2]|0)<=102){c[o>>2]=c[o>>2]|s-97+10;break}if(!((s|0)>=65&(c[q>>2]|0)<=70)){v=34;break a}c[o>>2]=c[o>>2]|(c[q>>2]|0)-65+10}while(0);c[u>>2]=c[u>>2]<<8;c[u>>2]=c[u>>2]|c[o>>2];c[k>>2]=(c[k>>2]|0)+1}c[k>>2]=0;c[(c[(c[g>>2]|0)+16>>2]|0)+((c[n>>2]|0)-1<<2)>>2]=c[u>>2];c[n>>2]=(c[n>>2]|0)+-1}if((v|0)==18){Bp(c[g>>2]|0);c[f>>2]=1;w=c[f>>2]|0;l=e;return w|0}else if((v|0)==20){Bp(c[g>>2]|0);c[f>>2]=1;w=c[f>>2]|0;l=e;return w|0}else if((v|0)==27){Bp(c[g>>2]|0);c[f>>2]=1;w=c[f>>2]|0;l=e;return w|0}else if((v|0)==34){Bp(c[g>>2]|0);c[f>>2]=1;w=c[f>>2]|0;l=e;return w|0}else if((v|0)==37){c[f>>2]=0;w=c[f>>2]|0;l=e;return w|0}return 0}function bp(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0;i=l;l=l+128|0;if((l|0)>=(m|0))$(128);j=i+112|0;k=i+108|0;n=i+104|0;o=i+100|0;p=i+96|0;q=i+92|0;r=i+88|0;s=i+84|0;t=i+76|0;u=i+72|0;v=i+68|0;w=i+64|0;x=i+60|0;y=i+56|0;z=i+52|0;A=i+48|0;B=i+44|0;C=i+40|0;D=i+36|0;E=i+32|0;F=i+28|0;G=i+24|0;H=i+20|0;I=i+16|0;J=i+12|0;K=i+8|0;L=i+4|0;M=i;c[k>>2]=b;c[n>>2]=e;c[o>>2]=f;c[p>>2]=g;c[q>>2]=h;c[r>>2]=lo(c[q>>2]|0)|0;if(!(c[p>>2]|0))c[p>>2]=i+80;if(c[(c[q>>2]|0)+8>>2]|0?vo(c[q>>2]|0,0)|0:0)c[t>>2]=1;else c[t>>2]=0;c[s>>2]=c[o>>2];c[c[p>>2]>>2]=0;if((c[k>>2]|0)==1){c[v>>2]=0;c[u>>2]=Vo(c[q>>2]|0,0,w,0)|0;if(!(c[u>>2]|0)){c[j>>2]=Et()|0;N=c[j>>2]|0;l=i;return N|0}if(c[t>>2]|0){cp(c[u>>2]|0,c[w>>2]|0);if(!((d[c[u>>2]>>0]|0)&128)){c[w>>2]=(c[w>>2]|0)+1;c[v>>2]=2}}else if(c[w>>2]|0?(d[c[u>>2]>>0]|0)&128|0:0){c[w>>2]=(c[w>>2]|0)+1;c[v>>2]=1}if(c[n>>2]|0?(c[w>>2]|0)>>>0>(c[s>>2]|0)>>>0:0){vf(c[u>>2]|0);c[j>>2]=66;N=c[j>>2]|0;l=i;return N|0}if(c[n>>2]|0){c[x>>2]=c[n>>2];if((c[v>>2]|0)!=1){if(c[v>>2]|0){o=c[x>>2]|0;c[x>>2]=o+1;a[o>>0]=-1}}else{o=c[x>>2]|0;c[x>>2]=o+1;a[o>>0]=0}_w(c[x>>2]|0,c[u>>2]|0,(c[w>>2]|0)-(((c[v>>2]|0)!=0^1^1)&1)|0)|0}vf(c[u>>2]|0);c[c[p>>2]>>2]=c[w>>2];c[j>>2]=0;N=c[j>>2]|0;l=i;return N|0}if((c[k>>2]|0)==5){c[y>>2]=(((c[r>>2]|0)+7|0)>>>0)/8|0;if(c[n>>2]|0?(c[y>>2]|0)>>>0>(c[s>>2]|0)>>>0:0){c[j>>2]=66;N=c[j>>2]|0;l=i;return N|0}do if(c[n>>2]|0){c[z>>2]=Vo(c[q>>2]|0,0,y,0)|0;if(c[z>>2]|0){_w(c[n>>2]|0,c[z>>2]|0,c[y>>2]|0)|0;vf(c[z>>2]|0);break}c[j>>2]=Et()|0;N=c[j>>2]|0;l=i;return N|0}while(0);c[c[p>>2]>>2]=c[y>>2];c[j>>2]=0;N=c[j>>2]|0;l=i;return N|0}if((c[k>>2]|0)==2){c[A>>2]=(((c[r>>2]|0)+7|0)>>>0)/8|0;if(c[t>>2]|0){c[j>>2]=45;N=c[j>>2]|0;l=i;return N|0}if(c[n>>2]|0?((c[A>>2]|0)+2|0)>>>0>(c[s>>2]|0)>>>0:0){c[j>>2]=66;N=c[j>>2]|0;l=i;return N|0}do if(c[n>>2]|0){c[C>>2]=c[n>>2];a[c[C>>2]>>0]=(c[r>>2]|0)>>>8;a[(c[C>>2]|0)+1>>0]=c[r>>2];c[B>>2]=Vo(c[q>>2]|0,0,A,0)|0;if(c[B>>2]|0){_w((c[C>>2]|0)+2|0,c[B>>2]|0,c[A>>2]|0)|0;vf(c[B>>2]|0);break}c[j>>2]=Et()|0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2]|0)){c[j>>2]=Et()|0;N=c[j>>2]|0;l=i;return N|0}if(!(c[K>>2]|0?!((d[c[H>>2]>>0]|0)&128|0):0))c[J>>2]=2;if(c[n>>2]|0?((c[K>>2]<<1)+(c[J>>2]|0)+(c[t>>2]|0)+1|0)>>>0>(c[s>>2]|0)>>>0:0){vf(c[H>>2]|0);c[j>>2]=66;N=c[j>>2]|0;l=i;return N|0}if(c[n>>2]|0){c[L>>2]=c[n>>2];if(c[t>>2]|0){s=c[L>>2]|0;c[L>>2]=s+1;a[s>>0]=45}if(c[J>>2]|0){s=c[L>>2]|0;c[L>>2]=s+1;a[s>>0]=48;s=c[L>>2]|0;c[L>>2]=s+1;a[s>>0]=48}c[I>>2]=0;while(1){if((c[I>>2]|0)>>>0>=(c[K>>2]|0)>>>0)break;c[M>>2]=d[(c[H>>2]|0)+(c[I>>2]|0)>>0];s=(c[M>>2]|0)>>>4;q=((c[M>>2]|0)>>>4>>>0<10?48+s|0:65+s-10|0)&255;s=c[L>>2]|0;c[L>>2]=s+1;a[s>>0]=q;c[M>>2]=c[M>>2]&15;q=c[M>>2]|0;s=((c[M>>2]|0)>>>0<10?48+q|0:65+q-10|0)&255;q=c[L>>2]|0;c[L>>2]=q+1;a[q>>0]=s;c[I>>2]=(c[I>>2]|0)+1}I=c[L>>2]|0;c[L>>2]=I+1;a[I>>0]=0;c[c[p>>2]>>2]=(c[L>>2]|0)-(c[n>>2]|0)}else c[c[p>>2]>>2]=(c[K>>2]<<1)+(c[J>>2]|0)+(c[t>>2]|0)+1;vf(c[H>>2]|0);c[j>>2]=0;N=c[j>>2]|0;l=i;return N|0}function cp(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+8|0;h=f+4|0;i=f;c[g>>2]=b;c[h>>2]=e;c[i>>2]=(c[h>>2]|0)-1;while(1){if((c[i>>2]|0)<0)break;if(!((a[(c[g>>2]|0)+(c[i>>2]|0)>>0]|0)!=0^1))break;c[i>>2]=(c[i>>2]|0)+-1}if((c[i>>2]|0)<0){l=f;return}h=d[(c[g>>2]|0)+(c[i>>2]|0)>>0]|0;do if(!(d[(c[g>>2]|0)+(c[i>>2]|0)>>0]&1|0)){e=d[(c[g>>2]|0)+(c[i>>2]|0)>>0]|0;if(h&2|0){a[(c[g>>2]|0)+(c[i>>2]|0)>>0]=(e^252|2)&254;break}b=d[(c[g>>2]|0)+(c[i>>2]|0)>>0]|0;if(e&4|0){a[(c[g>>2]|0)+(c[i>>2]|0)>>0]=(b^248|4)&252;break}e=d[(c[g>>2]|0)+(c[i>>2]|0)>>0]|0;if(b&8|0){a[(c[g>>2]|0)+(c[i>>2]|0)>>0]=(e^240|8)&248;break}b=d[(c[g>>2]|0)+(c[i>>2]|0)>>0]|0;if(e&16|0){a[(c[g>>2]|0)+(c[i>>2]|0)>>0]=(b^224|16)&240;break}e=d[(c[g>>2]|0)+(c[i>>2]|0)>>0]|0;if(b&32|0){a[(c[g>>2]|0)+(c[i>>2]|0)>>0]=(e^192|32)&224;break}b=(c[g>>2]|0)+(c[i>>2]|0)|0;if(e&64|0){a[(c[g>>2]|0)+(c[i>>2]|0)>>0]=(d[b>>0]^128|64)&192;break}else{a[b>>0]=-128;break}}else a[(c[g>>2]|0)+(c[i>>2]|0)>>0]=h^254|1;while(0);c[i>>2]=(c[i>>2]|0)+-1;while(1){if((c[i>>2]|0)<0)break;h=(c[g>>2]|0)+(c[i>>2]|0)|0;a[h>>0]=d[h>>0]^255;c[i>>2]=(c[i>>2]|0)+-1}l=f;return}function dp(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;f=l;l=l+48|0;if((l|0)>=(m|0))$(48);g=f+36|0;h=f+32|0;i=f+28|0;j=f+24|0;k=f+20|0;n=f+16|0;o=f+12|0;p=f+8|0;q=f+4|0;r=f;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;if((((c[h>>2]|0)!=0^1)&1|0)==(((c[i>>2]|0)!=0^1)&1|0)){c[g>>2]=45;s=c[g>>2]|0;l=f;return s|0}if(c[h>>2]|0)c[c[h>>2]>>2]=0;c[n>>2]=bp(5,0,0,o,c[j>>2]|0)|0;if(c[n>>2]|0){c[g>>2]=c[n>>2];s=c[g>>2]|0;l=f;return s|0}if((c[o>>2]|0)>>>0>(c[k>>2]|0)>>>0){c[g>>2]=67;s=c[g>>2]|0;l=f;return s|0}if((c[o>>2]|0)>>>0<(c[k>>2]|0)>>>0)t=(c[k>>2]|0)-(c[o>>2]|0)|0;else t=0;c[p>>2]=t;c[q>>2]=(c[o>>2]|0)+(c[p>>2]|0);if(!(c[i>>2]|0)){if(c[j>>2]|0?c[(c[j>>2]|0)+12>>2]&1|0:0)u=sf(c[q>>2]|0)|0;else u=pf(c[q>>2]|0)|0;c[r>>2]=u;if(!(c[r>>2]|0)){c[n>>2]=Et()|0;c[g>>2]=c[n>>2];s=c[g>>2]|0;l=f;return s|0}}else c[r>>2]=c[i>>2];if(c[p>>2]|0)Uw(c[r>>2]|0,0,c[p>>2]|0)|0;c[o>>2]=(c[o>>2]|0)+(c[p>>2]|0);c[n>>2]=bp(5,(c[r>>2]|0)+(c[p>>2]|0)|0,(c[o>>2]|0)-(c[p>>2]|0)|0,0,c[j>>2]|0)|0;if(c[n>>2]|0){vf(c[r>>2]|0);c[g>>2]=c[n>>2];s=c[g>>2]|0;l=f;return s|0}if(c[h>>2]|0)c[c[h>>2]>>2]=c[r>>2];c[g>>2]=0;s=c[g>>2]|0;l=f;return s|0}function ep(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+28|0;h=f+24|0;i=f+20|0;j=f+16|0;k=f+12|0;n=f+8|0;o=f+4|0;p=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]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0;P=h+192|0;Q=h+188|0;R=h+184|0;T=h+180|0;U=h+176|0;V=h+172|0;W=h+168|0;X=h+164|0;Y=h+160|0;Z=h+156|0;_=h+152|0;aa=h+148|0;ba=h+144|0;ca=h+140|0;da=h+136|0;ea=h+132|0;fa=h+128|0;ga=h+124|0;ha=h+120|0;ia=h+116|0;ja=h+112|0;ka=h+108|0;la=h+104|0;ma=h+100|0;na=h+96|0;oa=h+92|0;pa=h+88|0;qa=h+84|0;ra=h+80|0;sa=h+76|0;ta=h+72|0;ua=h+68|0;va=h+64|0;wa=h+60|0;xa=h+56|0;ya=h+52|0;za=h+48|0;Aa=h+44|0;Ba=h+40|0;Ca=h+36|0;Da=h+32|0;Ea=h+28|0;Fa=h+24|0;Ga=h+20|0;Ha=h+16|0;Ia=h+12|0;Ja=h+8|0;Ka=h+4|0;La=h;c[i>>2]=a;c[j>>2]=b;c[k>>2]=d;c[n>>2]=e;c[o>>2]=f;c[p>>2]=g;c[q>>2]=0;switch(c[p>>2]|0){case 0:{df();break}case 1:{c[t>>2]=c[c[o>>2]>>2];c[s>>2]=c[(c[k>>2]|0)+((c[n>>2]|0)-1<<2)>>2];if((c[s>>2]|0)>>>0>=(c[t>>2]|0)>>>0){c[s>>2]=(c[s>>2]|0)-(c[t>>2]|0);c[q>>2]=1}c[i>>2]=(c[i>>2]|0)+(c[j>>2]<<2);c[r>>2]=(c[n>>2]|0)-2;while(1){if((c[r>>2]|0)<0)break;c[u>>2]=(c[t>>2]|0)>>>16;c[v>>2]=c[t>>2]&65535;c[y>>2]=((c[s>>2]|0)>>>0)%((c[u>>2]|0)>>>0)|0;c[w>>2]=((c[s>>2]|0)>>>0)/((c[u>>2]|0)>>>0)|0;c[A>>2]=S(c[w>>2]|0,c[v>>2]|0)|0;c[y>>2]=c[y>>2]<<16|(c[(c[k>>2]|0)+(c[r>>2]<<2)>>2]|0)>>>16;if(((c[y>>2]|0)>>>0<(c[A>>2]|0)>>>0?(c[w>>2]=(c[w>>2]|0)+-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[sa>>2]=kp(c[k>>2]|0,c[o>>2]|0,c[p>>2]|0,c[pa>>2]|0)|0;if((c[ra>>2]|0)!=(c[sa>>2]|0)){ep(c[k>>2]|0,c[k>>2]|0,c[o>>2]|0,c[p>>2]|0)|0;c[pa>>2]=(c[pa>>2]|0)+-1}c[(c[i>>2]|0)+(c[la>>2]<<2)>>2]=c[pa>>2];c[oa>>2]=c[(c[k>>2]|0)+((c[p>>2]|0)-1<<2)>>2];c[la>>2]=(c[la>>2]|0)+-1}Ma=c[q>>2]|0;l=h;return Ma|0}}return 0}function hp(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0;g=l;l=l+144|0;if((l|0)>=(m|0))$(144);h=g+128|0;i=g+124|0;j=g+120|0;k=g+116|0;n=g+112|0;o=g+108|0;p=g+104|0;q=g+100|0;r=g+96|0;s=g+92|0;t=g+88|0;u=g+84|0;v=g+80|0;w=g+76|0;x=g+72|0;y=g+68|0;z=g+64|0;A=g+60|0;B=g+56|0;C=g+52|0;D=g+48|0;E=g+44|0;F=g+40|0;G=g+36|0;H=g+32|0;I=g+28|0;J=g+24|0;K=g+20|0;L=g+16|0;M=g+12|0;N=g+8|0;O=g+4|0;P=g;c[i>>2]=a;c[j>>2]=b;c[k>>2]=e;c[n>>2]=f;if(!(c[k>>2]|0)){c[h>>2]=0;Q=c[h>>2]|0;l=g;return Q|0}c[t>>2]=c[n>>2];f=c[t>>2]|0;c[u>>2]=(c[t>>2]|0)>>>0<65536?(f>>>0<256?0:8):f>>>0<16777216?16:24;c[s>>2]=32-((d[45848+((c[t>>2]|0)>>>(c[u>>2]|0))>>0]|0)+(c[u>>2]|0));if(!(c[s>>2]|0)){c[o>>2]=(c[k>>2]|0)-1;c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>>2]=c[p>>2];i=(c[n>>2]|0)+1|0;c[n>>2]=i}while((i|0)!=0);l=f;return c[k>>2]|0}function lp(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;f=l;l=l+48|0;if((l|0)>=(m|0))$(48);g=f+32|0;h=f+28|0;i=f+24|0;j=f+20|0;k=f+16|0;n=f+12|0;o=f+8|0;p=f+4|0;q=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;c[o>>2]=c[c[i>>2]>>2];if((c[o>>2]|0)>>>0<=1){a:do if((c[o>>2]|0)==1){c[p>>2]=0;while(1){if((c[p>>2]|0)>=(c[j>>2]|0))break a;c[(c[g>>2]|0)+(c[p>>2]<<2)>>2]=c[(c[h>>2]|0)+(c[p>>2]<<2)>>2];c[p>>2]=(c[p>>2]|0)+1}}else{c[q>>2]=0;while(1){if((c[q>>2]|0)>=(c[j>>2]|0))break a;c[(c[g>>2]|0)+(c[q>>2]<<2)>>2]=0;c[q>>2]=(c[q>>2]|0)+1}}while(0);c[n>>2]=0}else c[n>>2]=jp(c[g>>2]|0,c[h>>2]|0,c[j>>2]|0,c[o>>2]|0)|0;c[(c[g>>2]|0)+(c[j>>2]<<2)>>2]=c[n>>2];c[g>>2]=(c[g>>2]|0)+4;c[k>>2]=1;while(1){if((c[k>>2]|0)>=(c[j>>2]|0))break;c[o>>2]=c[(c[i>>2]|0)+(c[k>>2]<<2)>>2];if((c[o>>2]|0)>>>0<=1){c[n>>2]=0;if((c[o>>2]|0)==1)c[n>>2]=ep(c[g>>2]|0,c[g>>2]|0,c[h>>2]|0,c[j>>2]|0)|0}else c[n>>2]=qt(c[g>>2]|0,c[h>>2]|0,c[j>>2]|0,c[o>>2]|0)|0;c[(c[g>>2]|0)+(c[j>>2]<<2)>>2]=c[n>>2];c[g>>2]=(c[g>>2]|0)+4;c[k>>2]=(c[k>>2]|0)+1}l=f;return c[n>>2]|0}function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1}}else{c[v>>2]=0;while(1){if((c[v>>2]|0)>=(c[k>>2]|0))break a;c[(c[i>>2]|0)+(c[v>>2]<<2)>>2]=0;c[v>>2]=(c[v>>2]|0)+1}}while(0);c[q>>2]=0}else c[q>>2]=jp(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[t>>2]|0)|0;c[(c[i>>2]|0)+(c[k>>2]<<2)>>2]=c[q>>2];c[i>>2]=(c[i>>2]|0)+4;c[s>>2]=1;while(1){if((c[s>>2]|0)>=(c[o>>2]|0))break;c[t>>2]=c[(c[n>>2]|0)+(c[s>>2]<<2)>>2];if((c[t>>2]|0)>>>0<=1){c[q>>2]=0;if((c[t>>2]|0)==1)c[q>>2]=ep(c[i>>2]|0,c[i>>2]|0,c[j>>2]|0,c[k>>2]|0)|0}else c[q>>2]=qt(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[t>>2]|0)|0;c[(c[i>>2]|0)+(c[k>>2]<<2)>>2]=c[q>>2];c[i>>2]=(c[i>>2]|0)+4;c[s>>2]=(c[s>>2]|0)+1}c[h>>2]=c[q>>2];w=c[h>>2]|0;l=g;return w|0}function pp(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;if(c[(c[d>>2]|0)+16>>2]|0)yp(c[(c[d>>2]|0)+16>>2]|0,c[(c[d>>2]|0)+20>>2]|0);if(c[(c[d>>2]|0)+4>>2]|0)yp(c[(c[d>>2]|0)+4>>2]|0,c[(c[d>>2]|0)+8>>2]|0);c[d>>2]=c[c[d>>2]>>2];while(1){if(!(c[d>>2]|0))break;c[e>>2]=c[c[d>>2]>>2];if(c[(c[d>>2]|0)+16>>2]|0)yp(c[(c[d>>2]|0)+16>>2]|0,c[(c[d>>2]|0)+20>>2]|0);if(c[(c[d>>2]|0)+4>>2]|0)yp(c[(c[d>>2]|0)+4>>2]|0,c[(c[d>>2]|0)+8>>2]|0);vf(c[d>>2]|0);c[d>>2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>>2]<<2)>>2];c[n>>2]=(c[n>>2]|0)+(c[o>>2]|0);c[o>>2]=(c[n>>2]|0)>>>0<(c[o>>2]|0)>>>0&1;c[n>>2]=(c[k>>2]|0)-(c[n>>2]|0);c[o>>2]=(c[o>>2]|0)+((c[n>>2]|0)>>>0>(c[k>>2]|0)>>>0&1);c[(c[g>>2]|0)+(c[p>>2]<<2)>>2]=c[n>>2];j=(c[p>>2]|0)+1|0;c[p>>2]=j}while((j|0)!=0);l=f;return c[o>>2]|0}function sp(){return 46198}function tp(){var a=0,b=0,d=0,e=0,f=0,g=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;d=a+8|0;e=a+4|0;c[d>>2]=0;a:while(1){if((c[d>>2]|0)>=6){f=12;break}switch(c[d>>2]|0){case 0:{c[e>>2]=0;break}case 1:{c[e>>2]=1;break}case 2:{c[e>>2]=2;break}case 3:{c[e>>2]=3;break}case 4:{c[e>>2]=4;break}case 5:{c[e>>2]=8;break}default:{f=10;break a}}g=up(c[e>>2]|0)|0;c[71004+(c[d>>2]<<2)>>2]=g;c[(c[71004+(c[d>>2]<<2)>>2]|0)+12>>2]=48;c[d>>2]=(c[d>>2]|0)+1}if((f|0)==10){c[b>>2]=c[d>>2];Xe(46342,b)}else if((f|0)==12){l=a;return 0}return 0}function up(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=vp(1)|0;c[c[(c[e>>2]|0)+16>>2]>>2]=c[d>>2];c[(c[e>>2]|0)+4>>2]=c[d>>2]|0?1:0;c[(c[e>>2]|0)+8>>2]=0;l=b;return c[e>>2]|0}function vp(a){a=a|0;var b=0,d=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=zf(20)|0;if(c[d>>2]|0)f=wp(c[d>>2]|0,0)|0;else f=0;c[(c[e>>2]|0)+16>>2]=f;c[c[e>>2]>>2]=c[d>>2];c[(c[e>>2]|0)+4>>2]=0;c[(c[e>>2]|0)+8>>2]=0;c[(c[e>>2]|0)+12>>2]=0;l=b;return c[e>>2]|0}function wp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[e>>2]=a;c[f>>2]=b;c[h>>2]=(c[e>>2]|0?c[e>>2]|0:1)<<2;b=c[h>>2]|0;if(c[f>>2]|0)i=Bf(b)|0;else i=zf(b)|0;c[g>>2]=i;if(c[e>>2]|0){j=c[g>>2]|0;l=d;return j|0}c[c[g>>2]>>2]=0;j=c[g>>2]|0;l=d;return j|0}function xp(a){a=a|0;var b=0,d=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=zf(20)|0;if(c[d>>2]|0)f=wp(c[d>>2]|0,1)|0;else f=0;c[(c[e>>2]|0)+16>>2]=f;c[c[e>>2]>>2]=c[d>>2];c[(c[e>>2]|0)+12>>2]=1;c[(c[e>>2]|0)+4>>2]=0;c[(c[e>>2]|0)+8>>2]=0;l=b;return c[e>>2]|0}function yp(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;f=l;l=l+48|0;if((l|0)>=(m|0))$(48);g=f+28|0;h=f+24|0;i=f+20|0;j=f+16|0;k=f+12|0;n=f+32|0;o=f;p=f+8|0;c[g>>2]=b;c[h>>2]=e;if(!(c[g>>2]|0)){l=f;return}c[i>>2]=c[h>>2]<<2;a:do if(c[i>>2]|0){c[j>>2]=c[g>>2];c[k>>2]=c[i>>2];a[n>>0]=0;h=o;c[h>>2]=d[n>>0];c[h+4>>2]=0;while(1){if(!(c[j>>2]&7|0?(c[k>>2]|0)!=0:0))break;a[c[j>>2]>>0]=a[n>>0]|0;c[j>>2]=(c[j>>2]|0)+1;c[k>>2]=(c[k>>2]|0)+-1}if((c[k>>2]|0)>>>0>=8){h=o;e=gx(c[h>>2]|0,c[h+4>>2]|0,16843009,16843009)|0;h=o;c[h>>2]=e;c[h+4>>2]=D;do{c[p>>2]=c[j>>2];h=o;e=c[h+4>>2]|0;b=c[p>>2]|0;c[b>>2]=c[h>>2];c[b+4>>2]=e;c[k>>2]=(c[k>>2]|0)-8;c[j>>2]=(c[j>>2]|0)+8}while((c[k>>2]|0)>>>0>=8)}while(1){if(!(c[k>>2]|0))break a;a[c[j>>2]>>0]=a[n>>0]|0;c[j>>2]=(c[j>>2]|0)+1;c[k>>2]=(c[k>>2]|0)+-1}}while(0);vf(c[g>>2]|0);l=f;return}function zp(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;yp(c[(c[f>>2]|0)+16>>2]|0,c[c[f>>2]>>2]|0);c[(c[f>>2]|0)+16>>2]=c[g>>2];c[c[f>>2]>>2]=c[h>>2];l=e;return}function Ap(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+8|0;f=d+4|0;g=d;c[e>>2]=a;c[f>>2]=b;b=c[e>>2]|0;if((c[f>>2]|0)>>>0<=(c[c[e>>2]>>2]|0)>>>0){c[g>>2]=c[b+4>>2];while(1){if((c[g>>2]|0)>>>0>=(c[c[e>>2]>>2]|0)>>>0)break;c[(c[(c[e>>2]|0)+16>>2]|0)+(c[g>>2]<<2)>>2]=0;c[g>>2]=(c[g>>2]|0)+1}l=d;return}a=c[e>>2]|0;a:do if(!(c[b+16>>2]|0)){h=c[f>>2]|0;if(c[a+12>>2]&1|0){i=Df(h,4)|0;c[(c[e>>2]|0)+16>>2]=i;break}else{i=Cf(h,4)|0;c[(c[e>>2]|0)+16>>2]=i;break}}else{i=Af(c[a+16>>2]|0,c[f>>2]<<2)|0;c[(c[e>>2]|0)+16>>2]=i;c[g>>2]=c[c[e>>2]>>2];while(1){if((c[g>>2]|0)>>>0>=(c[f>>2]|0)>>>0)break a;c[(c[(c[e>>2]|0)+16>>2]|0)+(c[g>>2]<<2)>>2]=0;c[g>>2]=(c[g>>2]|0)+1}}while(0);c[c[e>>2]>>2]=c[f>>2];l=d;return}function Bp(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;if(c[d>>2]|0?c[(c[d>>2]|0)+12>>2]&16|0:0){Cp();l=b;return}c[(c[d>>2]|0)+4>>2]=0;c[(c[d>>2]|0)+12>>2]=0;l=b;return}function Cp(){var a=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);Te(46373,a);l=a;return}function Dp(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;c[d>>2]=a;if(!(c[d>>2]|0)){l=b;return}if(c[(c[d>>2]|0)+12>>2]&32|0){l=b;return}a=c[(c[d>>2]|0)+16>>2]|0;if(c[(c[d>>2]|0)+12>>2]&4|0)vf(a);else yp(a,c[c[d>>2]>>2]|0);if(c[(c[d>>2]|0)+12>>2]&-3864|0)Xe(46417,b);vf(c[d>>2]|0);l=b;return}function Ep(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;if(!(c[g>>2]|0))c[g>>2]=vp(0)|0;if(c[g>>2]|0?c[(c[g>>2]|0)+12>>2]&16|0:0){Cp();c[f>>2]=c[g>>2];j=c[f>>2]|0;l=e;return j|0}d=c[(c[g>>2]|0)+16>>2]|0;if(c[(c[g>>2]|0)+12>>2]&4|0)vf(d);else yp(d,c[c[g>>2]>>2]|0);c[(c[g>>2]|0)+16>>2]=c[h>>2];c[c[g>>2]>>2]=0;c[(c[g>>2]|0)+4>>2]=0;c[(c[g>>2]|0)+8>>2]=c[i>>2];c[(c[g>>2]|0)+12>>2]=4|c[(c[g>>2]|0)+12>>2]&3840;if(tf(c[(c[g>>2]|0)+16>>2]|0)|0){i=(c[g>>2]|0)+12|0;c[i>>2]=c[i>>2]|1}c[f>>2]=c[g>>2];j=c[f>>2]|0;l=e;return j|0}function Fp(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+20|0;g=e+16|0;h=e+12|0;i=e+8|0;j=e+4|0;k=e;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[k>>2]=(((c[i>>2]|0)+7|0)>>>0)/8|0;d=(tf(c[h>>2]|0)|0)!=0;b=c[k>>2]|0;if(d)n=sf(b)|0;else n=pf(b)|0;c[j>>2]=n;if(c[j>>2]|0){_w(c[j>>2]|0,c[h>>2]|0,c[k>>2]|0)|0;c[f>>2]=Ep(c[g>>2]|0,c[j>>2]|0,c[i>>2]|0)|0;o=c[f>>2]|0;l=e;return o|0}else{c[f>>2]=0;o=c[f>>2]|0;l=e;return o|0}return 0}function Gp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+8|0;f=d+4|0;c[e>>2]=a;c[f>>2]=b;if(!(c[(c[e>>2]|0)+12>>2]&4))Xe(46449,d);if(c[f>>2]|0)c[c[f>>2]>>2]=c[(c[e>>2]|0)+8>>2];l=d;return c[(c[e>>2]|0)+16>>2]|0}function Hp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+20|0;f=d+16|0;g=d+12|0;h=d+8|0;i=d+4|0;j=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=Gp(c[f>>2]|0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;c[k>>2]=c[k>>2]&-49;c[e>>2]=0;while(1){if((c[e>>2]|0)>=(c[(c[f>>2]|0)+4>>2]|0))break;c[(c[(c[f>>2]|0)+16>>2]|0)+(c[e>>2]<<2)>>2]=c[(c[(c[d>>2]|0)+16>>2]|0)+(c[e>>2]<<2)>>2];c[e>>2]=(c[e>>2]|0)+1}j=c[f>>2]|0;l=b;return j|0}function Jp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=c[e>>2]|0;if((c[e>>2]|0)==(c[f>>2]|0)){if(b|0?c[(c[e>>2]|0)+12>>2]&16|0:0){Cp();l=d;return}}else Kp(b,c[f>>2]|0)|0;c[(c[e>>2]|0)+8>>2]=((c[(c[f>>2]|0)+8>>2]|0)!=0^1)&1;l=d;return}function Kp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+28|0;f=d+24|0;g=d+20|0;h=d+16|0;i=d+12|0;j=d+8|0;k=d+4|0;n=d;c[f>>2]=a;c[g>>2]=b;c[j>>2]=c[(c[g>>2]|0)+4>>2];c[k>>2]=c[(c[g>>2]|0)+8>>2];if(!(c[f>>2]|0))c[f>>2]=vp(c[(c[g>>2]|0)+4>>2]|0)|0;if(c[f>>2]|0?c[(c[f>>2]|0)+12>>2]&16|0:0){Cp();c[e>>2]=c[f>>2];o=c[e>>2]|0;l=d;return o|0}if((c[c[f>>2]>>2]|0)<(c[j>>2]|0))Ap(c[f>>2]|0,c[j>>2]|0);c[h>>2]=c[(c[f>>2]|0)+16>>2];c[i>>2]=c[(c[g>>2]|0)+16>>2];c[n>>2]=0;while(1){if((c[n>>2]|0)>=(c[j>>2]|0))break;c[(c[h>>2]|0)+(c[n>>2]<<2)>>2]=c[(c[i>>2]|0)+(c[n>>2]<<2)>>2];c[n>>2]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l+16|0;if((l|0)>=(m|0))$(16);e=d+8|0;f=d+4|0;g=d;c[f>>2]=a;c[g>>2]=b;if(!(c[f>>2]|0))c[f>>2]=vp(1)|0;if(c[f>>2]|0?c[(c[f>>2]|0)+12>>2]&16|0:0){Cp();c[e>>2]=c[f>>2];h=c[e>>2]|0;l=d;return h|0}if((c[c[f>>2]>>2]|0)<1)Ap(c[f>>2]|0,1);c[c[(c[f>>2]|0)+16>>2]>>2]=c[g>>2];c[(c[f>>2]|0)+4>>2]=c[g>>2]|0?1:0;c[(c[f>>2]|0)+8>>2]=0;c[(c[f>>2]|0)+12>>2]=0;c[e>>2]=c[f>>2];h=c[e>>2]|0;l=d;return h|0}function Pp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+24|0;f=d+20|0;g=d;c[e>>2]=a;c[f>>2]=b;b=c[e>>2]|0;c[g>>2]=c[b>>2];c[g+4>>2]=c[b+4>>2];c[g+8>>2]=c[b+8>>2];c[g+12>>2]=c[b+12>>2];c[g+16>>2]=c[b+16>>2];b=c[e>>2]|0;e=c[f>>2]|0;c[b>>2]=c[e>>2];c[b+4>>2]=c[e+4>>2];c[b+8>>2]=c[e+8>>2];c[b+12>>2]=c[e+12>>2];c[b+16>>2]=c[e+16>>2];e=c[f>>2]|0;c[e>>2]=c[g>>2];c[e+4>>2]=c[g+4>>2];c[e+8>>2]=c[g+8>>2];c[e+12>>2]=c[g+12>>2];c[e+16>>2]=c[g+16>>2];l=d;return}function Qp(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+28|0;g=e+24|0;h=e+20|0;i=e+16|0;j=e+12|0;k=e+8|0;n=e+4|0;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[j>>2]=c[c[f>>2]>>2];c[k>>2]=0-(((c[h>>2]|0)!=0^1^1)&1);if((c[c[f>>2]>>2]|0)!=(c[c[g>>2]>>2]|0))Xe(46510,e);c[i>>2]=0;while(1){o=c[k>>2]|0;if((c[i>>2]|0)>=(c[j>>2]|0))break;c[n>>2]=o&(c[(c[(c[f>>2]|0)+16>>2]|0)+(c[i>>2]<<2)>>2]^c[(c[(c[g>>2]|0)+16>>2]|0)+(c[i>>2]<<2)>>2]);c[(c[(c[f>>2]|0)+16>>2]|0)+(c[i>>2]<<2)>>2]=c[(c[(c[f>>2]|0)+16>>2]|0)+(c[i>>2]<<2)>>2]^c[n>>2];c[(c[(c[g>>2]|0)+16>>2]|0)+(c[i>>2]<<2)>>2]=c[(c[(c[g>>2]|0)+16>>2]|0)+(c[i>>2]<<2)>>2]^c[n>>2];c[i>>2]=(c[i>>2]|0)+1}c[n>>2]=o&(c[(c[f>>2]|0)+4>>2]^c[(c[g>>2]|0)+4>>2]);c[(c[f>>2]|0)+4>>2]=c[(c[f>>2]|0)+4>>2]^c[n>>2];c[(c[g>>2]|0)+4>>2]=c[(c[g>>2]|0)+4>>2]^c[n>>2];c[n>>2]=c[k>>2]&(c[(c[f>>2]|0)+8>>2]^c[(c[g>>2]|0)+8>>2]);c[(c[f>>2]|0)+8>>2]=c[(c[f>>2]|0)+8>>2]^c[n>>2];c[(c[g>>2]|0)+8>>2]=c[(c[g>>2]|0)+8>>2]^c[n>>2];l=e;return}function Rp(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=vp((((c[d>>2]|0)+32-1|0)>>>0)/32|0)|0;l=b;return a|0}function Sp(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=xp((((c[d>>2]|0)+32-1|0)>>>0)/32|0)|0;l=b;return a|0}function Tp(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;Dp(c[d>>2]|0);l=b;return}function Up(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+16|0;g=e+12|0;h=e+8|0;i=e+4|0;j=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[j>>2]=(((c[g>>2]|0)+7|0)>>>0)/8|0;if(c[f>>2]|0?c[(c[f>>2]|0)+12>>2]&16|0:0){Cp();l=e;return}g=(c[f>>2]|0)!=0;if(!(c[h>>2]|0)){if(g?c[(c[f>>2]|0)+12>>2]&1|0:0)k=Bf(c[j>>2]|0)|0;else k=zf(c[j>>2]|0)|0;c[i>>2]=k;nn(c[i>>2]|0,c[j>>2]|0)}else{if(g?c[(c[f>>2]|0)+12>>2]&1|0:0)n=hn(c[j>>2]|0,c[h>>2]|0)|0;else n=fn(c[j>>2]|0,c[h>>2]|0)|0;c[i>>2]=n}Yo(c[f>>2]|0,c[i>>2]|0,c[j>>2]|0,0);vf(c[i>>2]|0);l=e;return}function Vp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+12|0;f=d+8|0;g=d+4|0;c[f>>2]=a;c[g>>2]=b;switch(c[g>>2]|0){case 1:{c[e>>2]=((c[(c[f>>2]|0)+12>>2]&1|0)!=0^1^1)&1;h=c[e>>2]|0;l=d;return h|0}case 2:{c[e>>2]=((c[(c[f>>2]|0)+12>>2]&4|0)!=0^1^1)&1;h=c[e>>2]|0;l=d;return h|0}case 4:{c[e>>2]=((c[(c[f>>2]|0)+12>>2]&16|0)!=0^1^1)&1;h=c[e>>2]|0;l=d;return h|0}case 8:{c[e>>2]=((c[(c[f>>2]|0)+12>>2]&32|0)!=0^1^1)&1;h=c[e>>2]|0;l=d;return h|0}case 2048:case 1024:case 512:case 256:{c[e>>2]=((c[(c[f>>2]|0)+12>>2]&c[g>>2]|0)!=0^1^1)&1;h=c[e>>2]|0;l=d;return h|0}default:Xe(46542,d)}return 0}function Wp(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;e=b+12|0;c[e>>2]=a;a=c[e>>2]|0;if((c[e>>2]|0)<0|(c[e>>2]|0)>>>0>6){c[d>>2]=a;Xe(46342,d)}if(c[71004+(a<<2)>>2]|0){l=b;return c[71004+(c[e>>2]<<2)>>2]|0}else Xe(46562,b+8|0);return 0}function Xp(){return 46593}function Yp(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;f=l;l=l+96|0;if((l|0)>=(m|0))$(96);g=f+28|0;h=f+24|0;i=f+20|0;j=f+16|0;k=f+12|0;n=f+32|0;o=f+8|0;p=f+4|0;q=f;c[h>>2]=b;c[i>>2]=e;c[j>>2]=Kw(172)|0;if(!(c[j>>2]|0)){c[g>>2]=0;r=c[g>>2]|0;l=f;return r|0}c[c[j>>2]>>2]=1779033703;c[(c[j>>2]|0)+4>>2]=-1150833019;c[(c[j>>2]|0)+8>>2]=1013904242;c[(c[j>>2]|0)+12>>2]=-1521486534;c[(c[j>>2]|0)+16>>2]=1359893119;c[(c[j>>2]|0)+20>>2]=-1694144372;c[(c[j>>2]|0)+24>>2]=528734635;c[(c[j>>2]|0)+28>>2]=1541459225;c[(c[j>>2]|0)+32>>2]=0;c[(c[j>>2]|0)+36>>2]=0;e=(c[j>>2]|0)+40|0;a[e>>0]=a[e>>0]&-2;e=(c[j>>2]|0)+40|0;a[e>>0]=a[e>>0]&-3;a:do if(c[h>>2]|0){e=n;b=e+64|0;do{a[e>>0]=0;e=e+1|0}while((e|0)<(b|0));e=(c[j>>2]|0)+105|0;b=e+64|0;do{a[e>>0]=0;e=e+1|0}while((e|0)<(b|0));do if((c[i>>2]|0)>>>0<=64){_w(n|0,c[h>>2]|0,c[i>>2]|0)|0;_w((c[j>>2]|0)+105|0,c[h>>2]|0,c[i>>2]|0)|0}else{c[o>>2]=Yp(0,0)|0;if(c[o>>2]|0){Zp(c[o>>2]|0,c[h>>2]|0,c[i>>2]|0);_p(c[o>>2]|0);e=n;s=(c[o>>2]|0)+41|0;b=e+32|0;do{a[e>>0]=a[s>>0]|0;e=e+1|0;s=s+1|0}while((e|0)<(b|0));e=(c[j>>2]|0)+105|0;s=(c[o>>2]|0)+41|0;b=e+32|0;do{a[e>>0]=a[s>>0]|0;e=e+1|0;s=s+1|0}while((e|0)<(b|0));$p(c[o>>2]|0);break}Lw(c[j>>2]|0);c[g>>2]=0;r=c[g>>2]|0;l=f;return r|0}while(0);c[k>>2]=0;while(1){if((c[k>>2]|0)>=64)break;e=n+(c[k>>2]|0)|0;a[e>>0]=(d[e>>0]|0)^54;e=(c[j>>2]|0)+105+(c[k>>2]|0)|0;a[e>>0]=(d[e>>0]|0)^92;c[k>>2]=(c[k>>2]|0)+1}e=(c[j>>2]|0)+40|0;a[e>>0]=a[e>>0]&-3|2;Zp(c[j>>2]|0,n,64);c[p>>2]=n;c[q>>2]=64;while(1){if(!(c[q>>2]|0))break a;a[c[p>>2]>>0]=0;c[p>>2]=(c[p>>2]|0)+1;c[q>>2]=(c[q>>2]|0)+-1}}while(0);c[g>>2]=c[j>>2];r=c[g>>2]|0;l=f;return r|0}function Zp(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+12|0;h=f+8|0;i=f+4|0;j=f;c[g>>2]=b;c[h>>2]=d;c[i>>2]=e;c[j>>2]=c[h>>2];if((a[(c[g>>2]|0)+40>>0]<<7&255)<<24>>24>>7<<24>>24|0){l=f;return}if((c[(c[g>>2]|0)+36>>2]|0)==64){aq(c[g>>2]|0,(c[g>>2]|0)+41|0);c[(c[g>>2]|0)+36>>2]=0;h=(c[g>>2]|0)+32|0;c[h>>2]=(c[h>>2]|0)+1}if(!(c[j>>2]|0)){l=f;return}if(c[(c[g>>2]|0)+36>>2]|0){while(1){if(!(c[i>>2]|0))break;if((c[(c[g>>2]|0)+36>>2]|0)>=64)break;h=c[j>>2]|0;c[j>>2]=h+1;e=a[h>>0]|0;h=(c[g>>2]|0)+36|0;d=c[h>>2]|0;c[h>>2]=d+1;a[(c[g>>2]|0)+41+d>>0]=e;c[i>>2]=(c[i>>2]|0)+-1}Zp(c[g>>2]|0,0,0);if(!(c[i>>2]|0)){l=f;return}}while(1){if((c[i>>2]|0)>>>0<64)break;aq(c[g>>2]|0,c[j>>2]|0);c[(c[g>>2]|0)+36>>2]=0;e=(c[g>>2]|0)+32|0;c[e>>2]=(c[e>>2]|0)+1;c[i>>2]=(c[i>>2]|0)-64;c[j>>2]=(c[j>>2]|0)+64}while(1){if(!(c[i>>2]|0)){k=15;break}if((c[(c[g>>2]|0)+36>>2]|0)>=64){k=15;break}e=c[j>>2]|0;c[j>>2]=e+1;d=a[e>>0]|0;e=(c[g>>2]|0)+36|0;h=c[e>>2]|0;c[e>>2]=h+1;a[(c[g>>2]|0)+41+h>>0]=d;c[i>>2]=(c[i>>2]|0)+-1}if((k|0)==15){l=f;return}}function _p(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;i=d;c[e>>2]=b;if((a[(c[e>>2]|0)+40>>0]<<7&255)<<24>>24>>7<<24>>24|0){l=d;return}Zp(c[e>>2]|0,0,0);c[f>>2]=c[(c[e>>2]|0)+32>>2];c[h>>2]=c[f>>2]<<6;c[g>>2]=(c[f>>2]|0)>>>26;c[f>>2]=c[h>>2];b=(c[h>>2]|0)+(c[(c[e>>2]|0)+36>>2]|0)|0;c[h>>2]=b;if(b>>>0<(c[f>>2]|0)>>>0)c[g>>2]=(c[g>>2]|0)+1;c[f>>2]=c[h>>2];c[h>>2]=c[h>>2]<<3;c[g>>2]=c[g>>2]<<3;c[g>>2]=c[g>>2]|(c[f>>2]|0)>>>29;f=(c[(c[e>>2]|0)+36>>2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255;g=c[i>>2]|0;c[i>>2]=g+1;a[g>>0]=h;h=(c[(c[e>>2]|0)+20>>2]|0)>>>8&255;g=c[i>>2]|0;c[i>>2]=g+1;a[g>>0]=h;h=c[(c[e>>2]|0)+20>>2]&255;g=c[i>>2]|0;c[i>>2]=g+1;a[g>>0]=h;h=(c[(c[e>>2]|0)+24>>2]|0)>>>24&255;g=c[i>>2]|0;c[i>>2]=g+1;a[g>>0]=h;h=(c[(c[e>>2]|0)+24>>2]|0)>>>16&255;g=c[i>>2]|0;c[i>>2]=g+1;a[g>>0]=h;h=(c[(c[e>>2]|0)+24>>2]|0)>>>8&255;g=c[i>>2]|0;c[i>>2]=g+1;a[g>>0]=h;h=c[(c[e>>2]|0)+24>>2]&255;g=c[i>>2]|0;c[i>>2]=g+1;a[g>>0]=h;h=(c[(c[e>>2]|0)+28>>2]|0)>>>24&255;g=c[i>>2]|0;c[i>>2]=g+1;a[g>>0]=h;h=(c[(c[e>>2]|0)+28>>2]|0)>>>16&255;g=c[i>>2]|0;c[i>>2]=g+1;a[g>>0]=h;h=(c[(c[e>>2]|0)+28>>2]|0)>>>8&255;g=c[i>>2]|0;c[i>>2]=g+1;a[g>>0]=h;h=c[(c[e>>2]|0)+28>>2]&255;g=c[i>>2]|0;c[i>>2]=g+1;a[g>>0]=h;h=(c[e>>2]|0)+40|0;a[h>>0]=a[h>>0]&-2|1;l=d;return}function $p(b){b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+8|0;f=d+4|0;g=d;c[e>>2]=b;if(!(c[e>>2]|0)){l=d;return}a:do if((a[(c[e>>2]|0)+40>>0]<<6&255)<<24>>24>>7<<24>>24|0){c[f>>2]=(c[e>>2]|0)+105;c[g>>2]=64;while(1){if(!(c[g>>2]|0))break a;a[c[f>>2]>>0]=0;c[f>>2]=(c[f>>2]|0)+1;c[g>>2]=(c[g>>2]|0)+-1}}while(0);Lw(c[e>>2]|0);l=d;return}function aq(b,d){b=b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24|0;c[p>>2]=(c[p>>2]|0)+(c[q>>2]|0);q=(c[f>>2]|0)+28|0;c[q>>2]=(c[q>>2]|0)+(c[r>>2]|0);l=e;return}function bq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;l=d;return (c[e>>2]|0)>>>(c[f>>2]|0)|c[e>>2]<<32-(c[f>>2]|0)|0}function cq(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[g>>2]=b;c[h>>2]=d;_p(c[g>>2]|0);do if((a[(c[g>>2]|0)+40>>0]<<6&255)<<24>>24>>7<<24>>24|0){c[i>>2]=Yp(0,0)|0;if(c[i>>2]|0){Zp(c[i>>2]|0,(c[g>>2]|0)+105|0,64);Zp(c[i>>2]|0,(c[g>>2]|0)+41|0,32);_p(c[i>>2]|0);d=(c[g>>2]|0)+41|0;b=(c[i>>2]|0)+41|0;j=d+32|0;do{a[d>>0]=a[b>>0]|0;d=d+1|0;b=b+1|0}while((d|0)<(j|0));$p(c[i>>2]|0);break}Lw(c[g>>2]|0);c[f>>2]=0;k=c[f>>2]|0;l=e;return k|0}while(0);if(c[h>>2]|0)c[c[h>>2]>>2]=32;c[f>>2]=(c[g>>2]|0)+41;k=c[f>>2]|0;l=e;return k|0}function dq(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;i=l;l=l+80|0;if((l|0)>=(m|0))$(80);j=i+56|0;k=i+52|0;n=i+48|0;o=i+44|0;p=i+40|0;q=i+36|0;r=i+32|0;s=i+28|0;t=i+24|0;u=i+20|0;v=i+16|0;w=i+12|0;x=i+8|0;y=i+64|0;z=i+4|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);if((c[z>>2]|0)>>>0>0){bf((c[z>>2]|0)+16|0);cf()}c[j>>2]=c[r>>2]|0?10:0;B=c[j>>2]|0;l=i;return B|0} -function fg(b,f,g,h){b=b|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;i=l;l=l+80|0;if((l|0)>=(m|0))$(80);j=i;k=i+48|0;n=i+44|0;o=i+40|0;p=i+36|0;q=i+32|0;r=i+28|0;s=i+24|0;t=i+52|0;u=i+56|0;v=i+20|0;w=i+16|0;x=i+12|0;y=i+8|0;z=i+4|0;c[n>>2]=b;c[o>>2]=f;c[p>>2]=g;c[q>>2]=h;c[v>>2]=0;c[x>>2]=0;c[r>>2]=c[n>>2]|0?c[n>>2]|0:22772;c[s>>2]=c[p>>2];a:while(1){if(!(d[c[r>>2]>>0]|0)){A=55;break}switch(d[c[r>>2]>>0]|0|0){case 3:{c[r>>2]=(c[r>>2]|0)+1;if((c[o>>2]|0)!=1){if(c[x>>2]|0)c[v>>2]=(c[v>>2]|0)+1;c[v>>2]=(c[v>>2]|0)+(c[x>>2]|0)}c[v>>2]=(c[v>>2]|0)+1;if(c[p>>2]|0){if((c[v>>2]|0)>>>0>=(c[q>>2]|0)>>>0){A=10;break a}b:do if((c[o>>2]|0)!=1){if(c[x>>2]|0){n=c[s>>2]|0;c[s>>2]=n+1;a[n>>0]=10}c[w>>2]=0;while(1){if((c[w>>2]|0)>=(c[x>>2]|0))break b;n=c[s>>2]|0;c[s>>2]=n+1;a[n>>0]=32;c[w>>2]=(c[w>>2]|0)+1}}while(0);n=c[s>>2]|0;c[s>>2]=n+1;a[n>>0]=40}c[x>>2]=(c[x>>2]|0)+1;continue a;break}case 4:{c[r>>2]=(c[r>>2]|0)+1;c[v>>2]=(c[v>>2]|0)+1;if(c[p>>2]|0){if((c[v>>2]|0)>>>0>=(c[q>>2]|0)>>>0){A=21;break a}n=c[s>>2]|0;c[s>>2]=n+1;a[n>>0]=41}c[x>>2]=(c[x>>2]|0)+-1;if((d[c[r>>2]>>0]|0|0)==3)continue a;if(!((c[o>>2]|0)!=1?(d[c[r>>2]>>0]|0|0)!=0:0))continue a;c[v>>2]=(c[v>>2]|0)+1;c[v>>2]=(c[v>>2]|0)+(c[x>>2]|0);if(!(c[p>>2]|0))continue a;if((c[v>>2]|0)>>>0>=(c[q>>2]|0)>>>0){A=27;break a}n=c[s>>2]|0;c[s>>2]=n+1;a[n>>0]=10;c[w>>2]=0;while(1){if((c[w>>2]|0)>=(c[x>>2]|0))continue a;n=c[s>>2]|0;c[s>>2]=n+1;a[n>>0]=32;c[w>>2]=(c[w>>2]|0)+1}break}case 1:{c[r>>2]=(c[r>>2]|0)+1;n=c[r>>2]|0;a[t>>0]=a[n>>0]|0;a[t+1>>0]=a[n+1>>0]|0;c[r>>2]=(c[r>>2]|0)+2;if((c[o>>2]|0)==3){n=gg(c[r>>2]|0,e[t>>1]|0)|0;c[y>>2]=n;switch(n|0){case 1:{c[z>>2]=hg(c[r>>2]|0,e[t>>1]|0,0)|0;break}case 2:{c[z>>2]=ig(c[r>>2]|0,e[t>>1]|0,0)|0;break}default:c[z>>2]=jg(c[r>>2]|0,e[t>>1]|0,0)|0}c[v>>2]=(c[v>>2]|0)+(c[z>>2]|0);if(c[p>>2]|0){if((c[v>>2]|0)>>>0>=(c[q>>2]|0)>>>0){A=38;break a}switch(c[y>>2]|0){case 1:{hg(c[r>>2]|0,e[t>>1]|0,c[s>>2]|0)|0;break}case 2:{ig(c[r>>2]|0,e[t>>1]|0,c[s>>2]|0)|0;break}default:jg(c[r>>2]|0,e[t>>1]|0,c[s>>2]|0)|0}c[s>>2]=(c[s>>2]|0)+(c[z>>2]|0)}if((d[(c[r>>2]|0)+(e[t>>1]|0)>>0]|0|0)!=4?(c[v>>2]=(c[v>>2]|0)+1,c[p>>2]|0):0){if((c[v>>2]|0)>>>0>=(c[q>>2]|0)>>>0){A=47;break a}n=c[s>>2]|0;c[s>>2]=n+1;a[n>>0]=32}}else{c[j>>2]=e[t>>1];Dv(u,22775,j)|0;n=hv(u)|0;c[v>>2]=(c[v>>2]|0)+(n+(e[t>>1]|0));if(c[p>>2]|0){if((c[v>>2]|0)>>>0>=(c[q>>2]|0)>>>0){A=51;break a}c[s>>2]=uv(c[s>>2]|0,u)|0;_w(c[s>>2]|0,c[r>>2]|0,e[t>>1]|0|0)|0;c[s>>2]=(c[s>>2]|0)+(e[t>>1]|0)}}c[r>>2]=(c[r>>2]|0)+(e[t>>1]|0);continue a;break}default:{A=54;break a}}}if((A|0)==10){c[k>>2]=0;B=c[k>>2]|0;l=i;return B|0}else if((A|0)==21){c[k>>2]=0;B=c[k>>2]|0;l=i;return B|0}else if((A|0)==27){c[k>>2]=0;B=c[k>>2]|0;l=i;return B|0}else if((A|0)==38){c[k>>2]=0;B=c[k>>2]|0;l=i;return B|0}else if((A|0)==47){c[k>>2]=0;B=c[k>>2]|0;l=i;return B|0}else if((A|0)==51){c[k>>2]=0;B=c[k>>2]|0;l=i;return B|0}else if((A|0)==54)Re(22704,2008,22779);else if((A|0)==55){do if((c[o>>2]|0)!=1?(c[v>>2]=(c[v>>2]|0)+1,c[p>>2]|0):0){if((c[v>>2]|0)>>>0<(c[q>>2]|0)>>>0){A=c[s>>2]|0;c[s>>2]=A+1;a[A>>0]=10;break}c[k>>2]=0;B=c[k>>2]|0;l=i;return B|0}while(0);o=c[v>>2]|0;do if(c[p>>2]|0){if(o>>>0<(c[q>>2]|0)>>>0){A=c[s>>2]|0;c[s>>2]=A+1;a[A>>0]=0;break}c[k>>2]=0;B=c[k>>2]|0;l=i;return B|0}else c[v>>2]=o+1;while(0);c[k>>2]=c[v>>2];B=c[k>>2]|0;l=i;return B|0}return 0}function gg(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+16|0;h=f+12|0;i=f+8|0;j=f+4|0;k=f;c[h>>2]=b;c[i>>2]=e;c[k>>2]=1;if(!(c[i>>2]|0)){c[g>>2]=1;n=c[g>>2]|0;l=f;return n|0}if(d[c[h>>2]>>0]&128|0){c[g>>2]=0;n=c[g>>2]|0;l=f;return n|0}if(!(a[c[h>>2]>>0]|0)){c[g>>2]=0;n=c[g>>2]|0;l=f;return n|0}c[j>>2]=c[h>>2];while(1){if(!(c[i>>2]|0))break;if((d[c[j>>2]>>0]|0)>=32){if((d[c[j>>2]>>0]|0)>=127?(d[c[j>>2]>>0]|0)<=160:0)o=12}else o=12;if((o|0)==12?(o=0,(Vv(22802,d[c[j>>2]>>0]|0)|0)==0):0){o=13;break}do if(c[k>>2]|0){if((d[c[j>>2]>>0]|0)>=65?(d[c[j>>2]>>0]|0)<=90:0)break;if((d[c[j>>2]>>0]|0)>=97?(d[c[j>>2]>>0]|0)<=122:0)break;if((d[c[j>>2]>>0]|0)>=48?(d[c[j>>2]>>0]|0)<=57:0)break;if(!(Vv(22812,d[c[j>>2]>>0]|0)|0))c[k>>2]=0}while(0);c[j>>2]=(c[j>>2]|0)+1;c[i>>2]=(c[i>>2]|0)+-1}if((o|0)==13){c[g>>2]=0;n=c[g>>2]|0;l=f;return n|0}c[j>>2]=c[h>>2];do if(c[k>>2]|0){if((d[c[j>>2]>>0]|0)>=48?(d[c[j>>2]>>0]|0)<=57:0)break;c[g>>2]=2;n=c[g>>2]|0;l=f;return n|0}while(0);c[g>>2]=1;n=c[g>>2]|0;l=f;return n|0}function hg(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g;i=g+24|0;j=g+20|0;k=g+16|0;n=g+12|0;o=g+8|0;p=g+4|0;c[j>>2]=b;c[k>>2]=e;c[n>>2]=f;if(!(c[n>>2]|0)){c[p>>2]=2;while(1){if(!(c[k>>2]|0))break;a:do switch(d[c[j>>2]>>0]|0|0){case 92:case 39:case 34:case 13:case 12:case 10:case 11:case 9:case 8:{c[p>>2]=(c[p>>2]|0)+2;break}default:{do if((d[c[j>>2]>>0]|0|0)>=32){if((d[c[j>>2]>>0]|0|0)>=127?(d[c[j>>2]>>0]|0|0)<=160:0)break;c[p>>2]=(c[p>>2]|0)+1;break a}while(0);c[p>>2]=(c[p>>2]|0)+4}}while(0);c[k>>2]=(c[k>>2]|0)+-1;c[j>>2]=(c[j>>2]|0)+1}c[i>>2]=c[p>>2];q=c[i>>2]|0;l=g;return q|0}c[o>>2]=c[n>>2];p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=34;while(1){if(!(c[k>>2]|0))break;b:do switch(d[c[j>>2]>>0]|0|0){case 8:{p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=92;p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=98;break}case 9:{p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=92;p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=116;break}case 11:{p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=92;p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=118;break}case 10:{p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=92;p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=110;break}case 12:{p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=92;p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=102;break}case 13:{p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=92;p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=114;break}case 34:{p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=92;p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=34;break}case 39:{p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=92;p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=39;break}case 92:{p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=92;p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=92;break}default:{do if((d[c[j>>2]>>0]|0|0)>=32){if((d[c[j>>2]>>0]|0|0)>=127?(d[c[j>>2]>>0]|0|0)<=160:0)break;p=a[c[j>>2]>>0]|0;f=c[o>>2]|0;c[o>>2]=f+1;a[f>>0]=p;break b}while(0);p=c[o>>2]|0;c[h>>2]=d[c[j>>2]>>0];Dv(p,22626,h)|0;c[o>>2]=(c[o>>2]|0)+4}}while(0);c[k>>2]=(c[k>>2]|0)+-1;c[j>>2]=(c[j>>2]|0)+1}j=c[o>>2]|0;c[o>>2]=j+1;a[j>>0]=34;c[i>>2]=(c[o>>2]|0)-(c[n>>2]|0);q=c[i>>2]|0;l=g;return q|0}function ig(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if(!(c[h>>2]|0)){i=c[g>>2]|0;l=e;return i|0}_w(c[h>>2]|0,c[f>>2]|0,c[g>>2]|0)|0;i=c[g>>2]|0;l=e;return i|0}function jg(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g;i=g+16|0;j=g+12|0;k=g+8|0;n=g+4|0;c[i>>2]=b;c[j>>2]=e;c[k>>2]=f;if(!(c[k>>2]|0)){o=c[j>>2]|0;p=o<<1;q=p+2|0;l=g;return q|0}f=c[k>>2]|0;c[k>>2]=f+1;a[f>>0]=35;c[n>>2]=0;while(1){r=c[k>>2]|0;if((c[n>>2]|0)>>>0>=(c[j>>2]|0)>>>0)break;c[h>>2]=d[(c[i>>2]|0)+(c[n>>2]|0)>>0];Dv(r,22797,h)|0;c[n>>2]=(c[n>>2]|0)+1;c[k>>2]=(c[k>>2]|0)+2}c[k>>2]=r+1;a[r>>0]=35;o=c[j>>2]|0;p=o<<1;q=p+2|0;l=g;return q|0}function kg(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0;g=l;l=l+192|0;if((l|0)>=(m|0))$(192);h=g+164|0;i=g+160|0;j=g+156|0;k=g+152|0;n=g+148|0;o=g+144|0;p=g+140|0;q=g+136|0;r=g+56|0;s=g+168|0;t=g+48|0;u=g+44|0;v=g+40|0;w=g+36|0;x=g+32|0;y=g+28|0;z=g+24|0;A=g+20|0;B=g+16|0;C=g+12|0;D=g+8|0;E=g+4|0;F=g;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;c[n>>2]=f;c[v>>2]=43;c[w>>2]=0;f=s;e=f+20|0;do{a[f>>0]=0;f=f+1|0}while((f|0)<(e|0));c[p>>2]=c[k>>2];c[t>>2]=0;while(1){G=a[c[p>>2]>>0]|0;if(!(a[c[p>>2]>>0]|0?(c[t>>2]|0)>>>0<20:0)){H=18;break}if((((((G<<24>>24|0)!=38?(a[c[p>>2]>>0]|0)!=43:0)?(a[c[p>>2]>>0]|0)!=45:0)?(a[c[p>>2]>>0]|0)!=47:0)?(a[c[p>>2]>>0]|0)!=63:0)?(Nf(c[p>>2]|0)|0)==0:0){if((a[c[p>>2]>>0]|0)==39){c[p>>2]=(c[p>>2]|0)+1;c[q>>2]=Vv(c[p>>2]|0,39)|0;if(!(c[q>>2]|0)){H=12;break}if((c[q>>2]|0)==(c[p>>2]|0)){H=12;break}c[p>>2]=c[q>>2]}f=c[n>>2]|0;e=(c[f>>2]|0)+(4-1)&~(4-1);d=c[e>>2]|0;c[f>>2]=e+4;c[x>>2]=d;c[r+(c[t>>2]<<2)>>2]=c[x>>2];if(!(c[r+(c[t>>2]<<2)>>2]|0)){H=15;break}c[t>>2]=(c[t>>2]|0)+1}c[p>>2]=(c[p>>2]|0)+1}if((H|0)==12){c[h>>2]=29;I=c[h>>2]|0;l=g;return I|0}else if((H|0)==15){c[h>>2]=128;I=c[h>>2]|0;l=g;return I|0}else if((H|0)==18){if(G<<24>>24){c[h>>2]=183;I=c[h>>2]|0;l=g;return I|0}G=c[n>>2]|0;n=(c[G>>2]|0)+(4-1)&~(4-1);x=c[n>>2]|0;c[G>>2]=n+4;c[y>>2]=x;if(c[y>>2]|0){c[h>>2]=45;I=c[h>>2]|0;l=g;return I|0}while(1){if(!(c[j>>2]|0)){H=33;break}if(!(a[c[j>>2]>>0]|0)){H=33;break}c[p>>2]=Vv(c[j>>2]|0,33)|0;if((c[p>>2]|0)==(c[j>>2]|0)){H=25;break}if(c[p>>2]|0)J=(c[p>>2]|0)-(c[j>>2]|0)|0;else J=0;c[z>>2]=J;c[u>>2]=Tf(c[i>>2]|0,c[j>>2]|0,c[z>>2]|0)|0;if(!(c[u>>2]|0)){H=29;break}c[i>>2]=c[u>>2];c[u>>2]=0;Rf(c[w>>2]|0);c[w>>2]=c[i>>2];if(c[z>>2]|0){c[j>>2]=(c[j>>2]|0)+((c[z>>2]|0)+1);continue}else{c[j>>2]=0;continue}}do if((H|0)==25)c[o>>2]=27;else if((H|0)==29)c[o>>2]=27;else if((H|0)==33){c[p>>2]=c[k>>2];c[t>>2]=0;a:while(1){if(!(a[c[p>>2]>>0]|0)){H=76;break}if((((a[c[p>>2]>>0]|0)!=38?(a[c[p>>2]>>0]|0)!=43:0)?(a[c[p>>2]>>0]|0)!=45:0)?(a[c[p>>2]>>0]|0)!=47:0){if((Nf(c[p>>2]|0)|0)==0?(a[c[p>>2]>>0]|0)!=63:0){if((a[c[p>>2]>>0]|0)==39){c[p>>2]=(c[p>>2]|0)+1;c[q>>2]=Vv(c[p>>2]|0,39)|0;if(!(c[q>>2]|0)){H=45;break}if((c[q>>2]|0)==(c[p>>2]|0)){H=45;break}c[u>>2]=Tf(c[i>>2]|0,c[p>>2]|0,(c[q>>2]|0)-(c[p>>2]|0)|0)|0;c[p>>2]=c[q>>2]}else c[u>>2]=Tf(c[i>>2]|0,c[p>>2]|0,1)|0;do if(!(c[u>>2]|0)?(a[(c[p>>2]|0)+1>>0]|0)==63:0){j=c[r+(c[t>>2]<<2)>>2]|0;if((c[v>>2]|0)!=38){c[j>>2]=0;break}c[A>>2]=j;if(!(c[(c[A>>2]|0)+12>>2]|0)){c[c[A>>2]>>2]=0;c[(c[A>>2]|0)+4>>2]=0}c[(c[A>>2]|0)+8>>2]=0}else H=55;while(0);if((H|0)==55){H=0;if(!(c[u>>2]|0)){H=56;break}do if((c[v>>2]|0)!=38){if((c[v>>2]|0)==47){j=$f(c[u>>2]|0,1,8)|0;c[c[r+(c[t>>2]<<2)>>2]>>2]=j;break}j=c[u>>2]|0;if((c[v>>2]|0)==45){z=$f(j,1,1)|0;c[c[r+(c[t>>2]<<2)>>2]>>2]=z;break}else{z=$f(j,1,5)|0;c[c[r+(c[t>>2]<<2)>>2]>>2]=z;break}}else{c[B>>2]=c[r+(c[t>>2]<<2)>>2];z=c[u>>2]|0;if(!(c[(c[B>>2]|0)+12>>2]|0)){j=Zf(z,1,c[B>>2]|0)|0;c[(c[B>>2]|0)+12>>2]=j;if(!(c[(c[B>>2]|0)+12>>2]|0)){H=65;break a}c[(c[B>>2]|0)+8>>2]=c[c[B>>2]>>2];c[(c[B>>2]|0)+4>>2]=0;a[s+(c[t>>2]|0)>>0]=2;break}c[C>>2]=Xf(z,1,D)|0;if(!((c[C>>2]|0)!=0&(c[D>>2]|0)!=0)){H=60;break a}if(((c[(c[B>>2]|0)+4>>2]|0)+(c[D>>2]|0)|0)>>>0>(c[c[B>>2]>>2]|0)>>>0){H=62;break a}_w((c[(c[B>>2]|0)+12>>2]|0)+(c[(c[B>>2]|0)+4>>2]|0)|0,c[C>>2]|0,c[D>>2]|0)|0;c[(c[B>>2]|0)+8>>2]=c[D>>2];a[s+(c[t>>2]|0)>>0]=1}while(0);Rf(c[u>>2]|0);c[u>>2]=0;if(!(c[c[r+(c[t>>2]<<2)>>2]>>2]|0)){H=73;break}}c[t>>2]=(c[t>>2]|0)+1}}else c[v>>2]=a[c[p>>2]>>0];c[p>>2]=(c[p>>2]|0)+1}if((H|0)==45){c[o>>2]=29;break}else if((H|0)==56){c[o>>2]=68;break}else if((H|0)==60){c[o>>2]=65;break}else if((H|0)==62){c[o>>2]=200;break}else if((H|0)==65){c[o>>2]=65;break}else if((H|0)==73){c[o>>2]=65;break}else if((H|0)==76){Rf(c[w>>2]|0);c[h>>2]=0;I=c[h>>2]|0;l=g;return I|0}}while(0);Rf(c[w>>2]|0);Rf(c[u>>2]|0);while(1){u=c[t>>2]|0;c[t>>2]=u+-1;if(!u)break;u=c[t>>2]|0;if(!(a[s+(c[t>>2]|0)>>0]|0)){Tp(c[c[r+(u<<2)>>2]>>2]|0);c[c[r+(c[t>>2]<<2)>>2]>>2]=0;continue}w=c[r+(c[t>>2]<<2)>>2]|0;if((((a[s+u>>0]|0)!=0^1)&1|0)==1){c[E>>2]=w;c[(c[E>>2]|0)+8>>2]=0;continue}else{c[F>>2]=w;vf(c[(c[F>>2]|0)+12>>2]|0);c[(c[F>>2]|0)+12>>2]=0;c[(c[F>>2]|0)+8>>2]=0;c[(c[F>>2]|0)+4>>2]=0;c[c[F>>2]>>2]=0;continue}}c[h>>2]=c[o>>2];I=c[h>>2]|0;l=g;return I|0}return 0}function lg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+28|0;h=f+24|0;i=f+20|0;j=f+16|0;k=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[k>>2]=e;c[j>>2]=kg(c[g>>2]|0,c[h>>2]|0,c[i>>2]|0,k)|0;k=mg(c[j>>2]|0)|0;l=f;return k|0}function mg(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=ng(1,c[d>>2]|0)|0;l=b;return a|0}function ng(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){g=0;l=d;return g|0}g=(c[e>>2]&127)<<24|c[f>>2]&65535;l=d;return g|0}function og(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+8|0;e=b+4|0;f=b;c[e>>2]=a;c[f>>2]=0;while(1){if((c[f>>2]|0)>>>0>=13){g=6;break}a=(Fu(c[1180+(c[f>>2]<<3)+4>>2]|0,c[e>>2]|0)|0)!=0;h=c[f>>2]|0;if(!a){g=4;break}c[f>>2]=h+1}if((g|0)==4){c[17711]=c[17711]|c[1180+(h<<3)>>2];c[d>>2]=0;i=c[d>>2]|0;l=b;return i|0}else if((g|0)==6){c[d>>2]=88;i=c[d>>2]|0;l=b;return i|0}return 0}function pg(){return c[17712]|0}function qg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+8|0;f=d+4|0;g=d;c[f>>2]=a;c[g>>2]=b;if((c[f>>2]|0)<0|(c[f>>2]|0)>>>0>=13){c[e>>2]=0;h=c[e>>2]|0;l=d;return h|0}if(c[g>>2]|0)c[c[g>>2]>>2]=c[1180+(c[f>>2]<<3)>>2];c[e>>2]=c[1180+(c[f>>2]<<3)+4>>2];h=c[e>>2]|0;l=d;return h|0}function rg(){c[17712]=0;if(Wg()|0)return;sg();c[17712]=c[17712]&~c[17711];return}function sg(){var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;b=l;l=l+288|0;if((l|0)>=(m|0))$(288);d=b+20|0;e=b+16|0;f=b+24|0;g=b+12|0;h=b+8|0;i=b+4|0;j=b;c[d>>2]=22971;c[j>>2]=0;c[e>>2]=Pv(c[d>>2]|0,23624)|0;if(!(c[e>>2]|0)){l=b;return}while(1){if(!(Gv(f,256,c[e>>2]|0)|0))break;c[j>>2]=(c[j>>2]|0)+1;c[g>>2]=f;while(1){if(a[c[g>>2]>>0]&128|0)break;if(!(vv(a[c[g>>2]>>0]|0)|0))break;c[g>>2]=(c[g>>2]|0)+1}c[h>>2]=Vv(c[g>>2]|0,10)|0;if(c[h>>2]|0)a[c[h>>2]>>0]=0;d=c[g>>2]|0;if(a[c[g>>2]>>0]|0)k=(hv(c[g>>2]|0)|0)-1|0;else k=0;c[h>>2]=d+k;while(1){if((c[h>>2]|0)>>>0<=(c[g>>2]|0)>>>0)break;if((a[c[h>>2]>>0]&128|0)==0?vv(a[c[h>>2]>>0]|0)|0:0)a[c[h>>2]>>0]=0;c[h>>2]=(c[h>>2]|0)+-1}if(!(a[c[g>>2]>>0]|0))continue;if((a[c[g>>2]>>0]|0)==35)continue;c[i>>2]=0;while(1){if((c[i>>2]|0)>>>0>=13)break;d=(Fu(c[1180+(c[i>>2]<<3)+4>>2]|0,c[g>>2]|0)|0)!=0;n=c[i>>2]|0;if(!d){o=23;break}c[i>>2]=n+1}if((o|0)==23){o=0;c[17711]=c[17711]|c[1180+(n<<3)>>2]}}aw(c[e>>2]|0)|0;Qv(c[e>>2]|0)|0;l=b;return}function tg(){c[17713]=1;return}function ug(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+8|0;f=d+4|0;g=d;c[f>>2]=b;if(!(c[f>>2]|0)){Ft(22);c[e>>2]=0;h=c[e>>2]|0;l=d;return h|0}b=c[f>>2]|0;if(!(c[17713]|0)){c[e>>2]=Kw(b)|0;h=c[e>>2]|0;l=d;return h|0}i=Kw(b+0+5|0)|0;c[g>>2]=i;if(i|0){a[c[g>>2]>>0]=c[f>>2];a[(c[g>>2]|0)+1>>0]=(c[f>>2]|0)>>>8;a[(c[g>>2]|0)+2>>0]=(c[f>>2]|0)>>>16;a[(c[g>>2]|0)+3>>0]=85;a[(c[g>>2]|0)+(4+(c[f>>2]|0))>>0]=-86;c[e>>2]=(c[g>>2]|0)+4;h=c[e>>2]|0;l=d;return h|0}else{c[e>>2]=0;h=c[e>>2]|0;l=d;return h|0}return 0}function vg(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+8|0;f=d+4|0;g=d;c[f>>2]=b;if(!(c[f>>2]|0)){Ft(22);c[e>>2]=0;h=c[e>>2]|0;l=d;return h|0}b=c[f>>2]|0;if(!(c[17713]|0)){c[e>>2]=Hg(b)|0;h=c[e>>2]|0;l=d;return h|0}i=Hg(b+0+5|0)|0;c[g>>2]=i;if(i|0){a[c[g>>2]>>0]=c[f>>2];a[(c[g>>2]|0)+1>>0]=(c[f>>2]|0)>>>8;a[(c[g>>2]|0)+2>>0]=(c[f>>2]|0)>>>16;a[(c[g>>2]|0)+3>>0]=-52;a[(c[g>>2]|0)+(4+(c[f>>2]|0))>>0]=-86;c[e>>2]=(c[g>>2]|0)+4;h=c[e>>2]|0;l=d;return h|0}else{c[e>>2]=0;h=c[e>>2]|0;l=d;return h|0}return 0}function wg(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+20|0;g=e+16|0;h=e+12|0;i=e+8|0;j=e+4|0;k=e;c[g>>2]=a;c[h>>2]=b;b=c[g>>2]|0;if(!(c[17713]|0)){a=(Sg(b)|0)!=0;n=c[g>>2]|0;o=c[h>>2]|0;if(a){c[f>>2]=Rg(n,o)|0;p=c[f>>2]|0;l=e;return p|0}else{c[f>>2]=Nw(n,o)|0;p=c[f>>2]|0;l=e;return p|0}}c[i>>2]=b;if(!(c[g>>2]|0)){c[f>>2]=ug(c[h>>2]|0)|0;p=c[f>>2]|0;l=e;return p|0}xg(c[i>>2]|0);c[k>>2]=d[(c[i>>2]|0)+-4>>0];c[k>>2]=c[k>>2]|(d[(c[i>>2]|0)+-3>>0]|0)<<8;c[k>>2]=c[k>>2]|(d[(c[i>>2]|0)+-2>>0]|0)<<16;if((c[k>>2]|0)>>>0>=(c[h>>2]|0)>>>0){c[f>>2]=c[g>>2];p=c[f>>2]|0;l=e;return p|0}b=c[h>>2]|0;if((d[(c[i>>2]|0)+-1>>0]|0|0)==204)c[j>>2]=vg(b)|0;else c[j>>2]=ug(b)|0;if(c[j>>2]|0){_w(c[j>>2]|0,c[g>>2]|0,c[k>>2]|0)|0;Uw((c[j>>2]|0)+(c[k>>2]|0)|0,0,(c[h>>2]|0)-(c[k>>2]|0)|0)|0;yg(c[i>>2]|0);c[f>>2]=c[j>>2];p=c[f>>2]|0;l=e;return p|0}else{c[f>>2]=0;p=c[f>>2]|0;l=e;return p|0}return 0}function xg(a){a=a|0;var b=0,e=0,f=0,g=0,h=0,i=0;b=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=b+8|0;f=b;g=b+24|0;h=b+20|0;i=b+16|0;c[g>>2]=a;if(!(c[17713]|0)){l=b;return}c[h>>2]=c[g>>2];if(!(c[h>>2]|0)){l=b;return}if((d[(c[h>>2]|0)+-1>>0]|0|0)!=85?(d[(c[h>>2]|0)+-1>>0]|0|0)!=204:0){g=d[(c[h>>2]|0)+-1>>0]|0;c[f>>2]=c[h>>2];c[f+4>>2]=g;We(22992,f)}c[i>>2]=d[(c[h>>2]|0)+-4>>0];c[i>>2]=c[i>>2]|(d[(c[h>>2]|0)+-3>>0]|0)<<8;c[i>>2]=c[i>>2]|(d[(c[h>>2]|0)+-2>>0]|0)<<16;if((d[(c[h>>2]|0)+(c[i>>2]|0)>>0]|0|0)!=170){i=d[(c[h>>2]|0)+-1>>0]|0;c[e>>2]=c[h>>2];c[e+4>>2]=i;We(23033,e)}else{l=b;return}}function yg(a){a=a|0;var b=0,d=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=c[d>>2];if(!(c[e>>2]|0)){l=b;return}if(c[17713]|0){xg(c[e>>2]|0);a=(Sg(c[d>>2]|0)|0)!=0;f=(c[e>>2]|0)+-4|0;if(a){Pg(f);l=b;return}else{Lw(f);l=b;return}}else{f=(Sg(c[d>>2]|0)|0)!=0;d=c[e>>2]|0;if(f){Pg(d);l=b;return}else{Lw(d);l=b;return}}}function zg(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;Ht(1284)|0;c[e>>2]=c[17714];c[17715]=c[d>>2]&1;c[17714]=c[d>>2]&2;c[17716]=c[d>>2]&8;c[17717]=c[d>>2]&16;if(!((((c[e>>2]|0)==0|(c[17714]|0)!=0)^1)&(c[17718]|0)!=0)){It(1284)|0;l=b;return}c[17718]=0;Ag();It(1284)|0;l=b;return}function Ag(){var a=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);if(c[17715]|0){l=a;return}Te(Je(23073)|0,a);l=a;return}function Bg(){var a=0,b=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;Ht(1284)|0;c[b>>2]=c[17715]|0?1:0;c[b>>2]=c[b>>2]|(c[17714]|0?2:0);c[b>>2]=c[b>>2]|(c[17719]|0?4:0);c[b>>2]=c[b>>2]|(c[17716]|0?8:0);c[b>>2]=c[b>>2]|(c[17717]|0?16:0);It(1284)|0;l=a;return c[b>>2]|0}function Cg(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;Ht(1284)|0;Dg(c[d>>2]|0);It(1284)|0;l=b;return}function Dg(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=l;l=l+32|0;if((l|0)>=(m|0))$(32);d=b+8|0;e=b;f=b+16|0;g=b+12|0;c[f>>2]=a;if(c[f>>2]|0){if((c[f>>2]|0)>>>0<16384)c[f>>2]=16384;if(c[17721]|0){Ve(23129,d);l=b;return}else{Eg(c[f>>2]|0);Fg(c[17722]|0,c[f>>2]|0);l=b;return}}c[17720]=1;c[g>>2]=kw()|0;f=c[g>>2]|0;if((f|0)==(nw()|0)){l=b;return}if(ow(c[g>>2]|0)|0)We(23106,e);g=kw()|0;if((g|0)!=(nw()|0))We(23106,e);if(ow(0)|0){l=b;return}else We(23106,e)}function Eg(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;b=l;l=l+48|0;if((l|0)>=(m|0))$(48);d=b+16|0;e=b+8|0;f=b+32|0;g=b+28|0;h=b+24|0;i=b+20|0;c[f>>2]=a;c[17723]=c[f>>2];if(c[17720]|0)Xe(23237,b);c[h>>2]=Ra(30)|0;c[g>>2]=(c[h>>2]|0)!=-1&(c[h>>2]|0)>0?c[h>>2]|0:4096;c[17723]=(c[17723]|0)+(c[g>>2]|0)-1&~((c[g>>2]|0)-1);c[17722]=rw(0,c[17723]|0,3,34,-1,0)|0;if((c[17722]|0)==(-1|0)){g=c[17723]|0;h=Nu(c[(xu()|0)>>2]|0)|0;c[e>>2]=g;c[e+4>>2]=h;Te(23263,e)}else{c[17724]=1;c[17721]=1}if(c[17721]|0){j=c[17722]|0;c[i>>2]=j;k=c[17723]|0;n=c[i>>2]|0;c[n>>2]=k;o=c[i>>2]|0;p=o+4|0;c[p>>2]=0;l=b;return}c[17722]=Kw(c[17723]|0)|0;if(!(c[17722]|0)){c[d>>2]=c[17723];We(23311,d)}c[17721]=1;j=c[17722]|0;c[i>>2]=j;k=c[17723]|0;n=c[i>>2]|0;c[n>>2]=k;o=c[i>>2]|0;p=o+4|0;c[p>>2]=0;l=b;return}function Fg(a,b){a=a|0;b=b|0;var d=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);c[d+8>>2]=a;c[d+4>>2]=b;if(c[17716]|0){l=d;return}Te(23175,d);l=d;return}function Gg(){return 0}function Hg(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;Ht(1284)|0;c[e>>2]=Ig(c[d>>2]|0)|0;It(1284)|0;l=b;return c[e>>2]|0}function Ig(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;b=l;l=l+32|0;if((l|0)>=(m|0))$(32);d=b+8|0;e=b;f=b+20|0;g=b+16|0;h=b+12|0;c[g>>2]=a;if((c[17721]|0)==0?(Dg(32768),(c[17721]|0)==0):0){Te(Je(23351)|0,e);Ft(12);c[f>>2]=0;i=c[f>>2]|0;l=b;return i|0}if(c[17719]|0?Wg()|0:0){Te(Je(23412)|0,d);Ft(12);c[f>>2]=0;i=c[f>>2]|0;l=b;return i|0}if(!((c[17718]|0)==0|(c[17714]|0)!=0)){c[17718]=0;Ag()}c[g>>2]=((((c[g>>2]|0)+31|0)>>>0)/32|0)<<5;c[h>>2]=Jg(c[17722]|0,c[g>>2]|0)|0;if(c[h>>2]|0)Kg(c[g>>2]|0,0);c[f>>2]=c[h>>2]|0?(c[h>>2]|0)+8|0:0;i=c[f>>2]|0;l=b;return i|0}function Jg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=c[e>>2];while(1){if(!(Lg(c[g>>2]|0)|0))break;if((c[(c[g>>2]|0)+4>>2]&1|0)==0?(c[c[g>>2]>>2]|0)>>>0>=(c[f>>2]|0)>>>0:0){i=5;break}c[g>>2]=Ng(c[g>>2]|0)|0}if((i|0)==5?(i=(c[g>>2]|0)+4|0,c[i>>2]=c[i>>2]|1,((c[c[g>>2]>>2]|0)-(c[f>>2]|0)|0)>>>0>8):0){c[h>>2]=(c[g>>2]|0)+8+(c[f>>2]|0);c[c[h>>2]>>2]=(c[c[g>>2]>>2]|0)-(c[f>>2]|0)-8;c[(c[h>>2]|0)+4>>2]=0;c[c[g>>2]>>2]=c[f>>2];Mg(c[h>>2]|0)}if(Lg(c[g>>2]|0)|0){j=c[g>>2]|0;l=d;return j|0}Ft(12);c[g>>2]=0;j=c[g>>2]|0;l=d;return j|0}function Kg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(c[e>>2]|0){c[17725]=(c[17725]|0)+(c[e>>2]|0);c[17726]=(c[17726]|0)+1}if(!(c[f>>2]|0)){l=d;return}c[17725]=(c[17725]|0)-(c[f>>2]|0);c[17726]=(c[17726]|0)+-1;l=d;return}function Lg(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;c[e>>2]=c[d>>2];c[f>>2]=c[17722];if((c[e>>2]|0)>>>0<(c[f>>2]|0)>>>0){g=0;h=g&1;l=b;return h|0}g=(c[e>>2]|0)>>>0<((c[f>>2]|0)+(c[17723]|0)|0)>>>0;h=g&1;l=b;return h|0}function Mg(a){a=a|0;var b=0,d=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;c[e>>2]=Og(c[d>>2]|0)|0;c[f>>2]=Ng(c[d>>2]|0)|0;if(c[e>>2]|0?(c[(c[e>>2]|0)+4>>2]&1|0)==0:0){a=c[e>>2]|0;c[a>>2]=(c[a>>2]|0)+(8+(c[c[d>>2]>>2]|0));c[d>>2]=c[e>>2]}if(!(c[f>>2]|0)){l=b;return}if(c[(c[f>>2]|0)+4>>2]&1|0){l=b;return}e=c[d>>2]|0;c[e>>2]=(c[e>>2]|0)+(8+(c[c[f>>2]>>2]|0));l=b;return}function Ng(a){a=a|0;var b=0,d=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=(c[d>>2]|0)+8+(c[c[d>>2]>>2]|0);if(Lg(c[e>>2]|0)|0){f=c[e>>2]|0;l=b;return f|0}c[e>>2]=0;f=c[e>>2]|0;l=b;return f|0}function Og(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;if((c[d>>2]|0)==(c[17722]|0)){c[e>>2]=0;g=c[e>>2]|0;l=b;return g|0}c[e>>2]=c[17722];while(1){c[f>>2]=Ng(c[e>>2]|0)|0;if((c[f>>2]|0)==(c[d>>2]|0))break;c[e>>2]=c[f>>2]}g=c[e>>2]|0;l=b;return g|0}function Pg(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;Ht(1284)|0;Qg(c[d>>2]|0);It(1284)|0;l=b;return}function Qg(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0;e=l;l=l+96|0;if((l|0)>=(m|0))$(96);f=e+88|0;g=e+84|0;h=e+80|0;i=e+76|0;j=e+72|0;k=e+95|0;n=e+24|0;o=e+68|0;p=e+64|0;q=e+60|0;r=e+94|0;s=e+16|0;t=e+56|0;u=e+52|0;v=e+48|0;w=e+93|0;x=e+8|0;y=e+44|0;z=e+40|0;A=e+36|0;B=e+92|0;C=e;E=e+32|0;c[f>>2]=b;if(!(c[f>>2]|0)){l=e;return}c[g>>2]=(c[f>>2]|0)+-8;c[h>>2]=c[c[g>>2]>>2];c[i>>2]=(c[g>>2]|0)+8;c[j>>2]=c[h>>2];a[k>>0]=-1;f=n;c[f>>2]=d[k>>0];c[f+4>>2]=0;while(1){if(!(c[i>>2]&7|0?(c[j>>2]|0)!=0:0))break;a[c[i>>2]>>0]=a[k>>0]|0;c[i>>2]=(c[i>>2]|0)+1;c[j>>2]=(c[j>>2]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c[g>>2]=(c[e>>2]|0)+(0-8);c[h>>2]=c[c[g>>2]>>2];if((c[f>>2]|0)>>>0<(c[h>>2]|0)>>>0){c[i>>2]=c[e>>2];It(1284)|0;j=c[i>>2]|0;l=d;return j|0}c[i>>2]=Ig(c[f>>2]|0)|0;if(!(c[i>>2]|0)){It(1284)|0;j=c[i>>2]|0;l=d;return j|0}_w(c[i>>2]|0,c[e>>2]|0,c[h>>2]|0)|0;Uw((c[i>>2]|0)+(c[h>>2]|0)|0,0,(c[f>>2]|0)-(c[h>>2]|0)|0)|0;Qg(c[e>>2]|0);It(1284)|0;j=c[i>>2]|0;l=d;return j|0}function Sg(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;if(c[17721]|0)e=(Lg(c[d>>2]|0)|0)!=0;else e=0;l=b;return e&1|0}function Tg(){var b=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;b=l;l=l+96|0;if((l|0)>=(m|0))$(96);e=b+76|0;f=b+72|0;g=b+83|0;h=b+24|0;i=b+68|0;j=b+64|0;k=b+60|0;n=b+82|0;o=b+16|0;p=b+56|0;q=b+52|0;r=b+48|0;s=b+81|0;t=b+8|0;u=b+44|0;v=b+40|0;w=b+36|0;x=b+80|0;y=b;z=b+32|0;if(!(c[17721]|0)){l=b;return}c[e>>2]=c[17722];c[f>>2]=c[17723];a[g>>0]=-1;A=h;c[A>>2]=d[g>>0];c[A+4>>2]=0;while(1){if(!(c[e>>2]&7|0?(c[f>>2]|0)!=0:0))break;a[c[e>>2]>>0]=a[g>>0]|0;c[e>>2]=(c[e>>2]|0)+1;c[f>>2]=(c[f>>2]|0)+-1}if((c[f>>2]|0)>>>0>=8){A=h;B=gx(c[A>>2]|0,c[A+4>>2]|0,16843009,16843009)|0;A=h;c[A>>2]=B;c[A+4>>2]=D;do{c[i>>2]=c[e>>2];A=h;B=c[A+4>>2]|0;C=c[i>>2]|0;c[C>>2]=c[A>>2];c[C+4>>2]=B;c[f>>2]=(c[f>>2]|0)-8;c[e>>2]=(c[e>>2]|0)+8}while((c[f>>2]|0)>>>0>=8)}while(1){if(!(c[f>>2]|0))break;a[c[e>>2]>>0]=a[g>>0]|0;c[e>>2]=(c[e>>2]|0)+1;c[f>>2]=(c[f>>2]|0)+-1}c[j>>2]=c[17722];c[k>>2]=c[17723];a[n>>0]=-86;f=o;c[f>>2]=d[n>>0];c[f+4>>2]=0;while(1){if(!(c[j>>2]&7|0?(c[k>>2]|0)!=0:0))break;a[c[j>>2]>>0]=a[n>>0]|0;c[j>>2]=(c[j>>2]|0)+1;c[k>>2]=(c[k>>2]|0)+-1}if((c[k>>2]|0)>>>0>=8){f=o;e=gx(c[f>>2]|0,c[f+4>>2]|0,16843009,16843009)|0;f=o;c[f>>2]=e;c[f+4>>2]=D;do{c[p>>2]=c[j>>2];f=o;e=c[f+4>>2]|0;g=c[p>>2]|0;c[g>>2]=c[f>>2];c[g+4>>2]=e;c[k>>2]=(c[k>>2]|0)-8;c[j>>2]=(c[j>>2]|0)+8}while((c[k>>2]|0)>>>0>=8)}while(1){if(!(c[k>>2]|0))break;a[c[j>>2]>>0]=a[n>>0]|0;c[j>>2]=(c[j>>2]|0)+1;c[k>>2]=(c[k>>2]|0)+-1}c[q>>2]=c[17722];c[r>>2]=c[17723];a[s>>0]=85;k=t;c[k>>2]=d[s>>0];c[k+4>>2]=0;while(1){if(!(c[q>>2]&7|0?(c[r>>2]|0)!=0:0))break;a[c[q>>2]>>0]=a[s>>0]|0;c[q>>2]=(c[q>>2]|0)+1;c[r>>2]=(c[r>>2]|0)+-1}if((c[r>>2]|0)>>>0>=8){k=t;j=gx(c[k>>2]|0,c[k+4>>2]|0,16843009,16843009)|0;k=t;c[k>>2]=j;c[k+4>>2]=D;do{c[u>>2]=c[q>>2];k=t;j=c[k+4>>2]|0;n=c[u>>2]|0;c[n>>2]=c[k>>2];c[n+4>>2]=j;c[r>>2]=(c[r>>2]|0)-8;c[q>>2]=(c[q>>2]|0)+8}while((c[r>>2]|0)>>>0>=8)}while(1){if(!(c[r>>2]|0))break;a[c[q>>2]>>0]=a[s>>0]|0;c[q>>2]=(c[q>>2]|0)+1;c[r>>2]=(c[r>>2]|0)+-1}c[v>>2]=c[17722];c[w>>2]=c[17723];a[x>>0]=0;r=y;c[r>>2]=d[x>>0];c[r+4>>2]=0;while(1){if(!(c[v>>2]&7|0?(c[w>>2]|0)!=0:0))break;a[c[v>>2]>>0]=a[x>>0]|0;c[v>>2]=(c[v>>2]|0)+1;c[w>>2]=(c[w>>2]|0)+-1}if((c[w>>2]|0)>>>0>=8){r=y;q=gx(c[r>>2]|0,c[r+4>>2]|0,16843009,16843009)|0;r=y;c[r>>2]=q;c[r+4>>2]=D;do{c[z>>2]=c[v>>2];r=y;q=c[r+4>>2]|0;s=c[z>>2]|0;c[s>>2]=c[r>>2];c[s+4>>2]=q;c[w>>2]=(c[w>>2]|0)-8;c[v>>2]=(c[v>>2]|0)+8}while((c[w>>2]|0)>>>0>=8)}while(1){if(!(c[w>>2]|0))break;a[c[v>>2]>>0]=a[x>>0]|0;c[v>>2]=(c[v>>2]|0)+1;c[w>>2]=(c[w>>2]|0)+-1}if(c[17724]|0)uw(c[17722]|0,c[17723]|0)|0;c[17722]=0;c[17721]=0;c[17723]=0;c[17719]=0;l=b;return}function Ug(){var a=0,b=0,d=0,e=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;Ht(1284)|0;if(!(c[17721]|0)){It(1284)|0;l=a;return}d=c[17723]|0;e=c[17726]|0;c[b>>2]=c[17725];c[b+4>>2]=d;c[b+8>>2]=e;Te(23465,b);It(1284)|0;l=a;return}function Vg(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0;b=l;l=l+544|0;if((l|0)>=(m|0))$(544);d=b+8|0;e=b;f=b+28|0;g=b+24|0;h=b+20|0;i=b+16|0;j=b+288|0;k=b+12|0;n=b+32|0;c[f>>2]=a;if(c[17727]|0){if(Wg()|0){Xg(5);Yg()}if(c[17727]|0)Se(23506,23512,114,23519)}c[17727]=1;do if(c[f>>2]|0){if(c[17728]|0)Se(23546,23512,121,23519)}else{if(!($v(23569,0)|0)){if(!(c[17728]|0))break;Se(23546,23512,132,23519)}c[h>>2]=Pv(23594,23624)|0;if(!(c[h>>2]|0)){a=c[(xu()|0)>>2]|0;c[i>>2]=a;if((a|0)!=2&(c[i>>2]|0)!=13?($v(23626,0)|0)==0:0){a=Nu(c[i>>2]|0)|0;c[e>>2]=23594;c[e+4>>2]=a;Te(23640,e);Aa()}}else{if(Gv(j,256,c[h>>2]|0)|0?Aw(j)|0:0){Qv(c[h>>2]|0)|0;if(!(c[17728]|0))break;Se(23546,23512,151,23519)}Qv(c[h>>2]|0)|0}c[17728]=1}while(0);if(c[17728]|0){l=b;return}c[g>>2]=Gt(1328)|0;if(c[g>>2]|0){c[d>>2]=Bt(c[g>>2]|0)|0;Te(23684,d);Aa()}c[k>>2]=Pv(23569,23624)|0;if(c[k>>2]|0){if(Gv(n,256,c[k>>2]|0)|0?Aw(n)|0:0)c[17729]=1;Qv(c[k>>2]|0)|0}Xg(1);l=b;return}function Wg(){return ((c[17728]|0)!=0^1)&1|0}function Xg(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=l;l=l+32|0;if((l|0)>=(m|0))$(32);d=b;e=b+20|0;f=b+16|0;g=b+12|0;c[e>>2]=a;c[f>>2]=0;Zg();c[g>>2]=c[17730];switch(c[17730]|0){case 0:{if((c[e>>2]|0)==1|(c[e>>2]|0)==4|(c[e>>2]|0)==5)c[f>>2]=1;break}case 1:{if((c[e>>2]|0)==2|(c[e>>2]|0)==4|(c[e>>2]|0)==5)c[f>>2]=1;break}case 2:{if((c[e>>2]|0)==3|(c[e>>2]|0)==4|(c[e>>2]|0)==5)c[f>>2]=1;break}case 3:{if((c[e>>2]|0)==6|(c[e>>2]|0)==2|(c[e>>2]|0)==4|(c[e>>2]|0)==5)c[f>>2]=1;break}case 4:{if((c[e>>2]|0)==6|(c[e>>2]|0)==4|(c[e>>2]|0)==5|(c[e>>2]|0)==2)c[f>>2]=1;break}case 5:{if((c[e>>2]|0)==6)c[f>>2]=1;break}default:{}}if(c[f>>2]|0)c[17730]=c[e>>2];_g();if(!(c[f>>2]|0?!(Oe(2)|0):0)){a=$g(c[g>>2]|0)|0;g=$g(c[e>>2]|0)|0;e=c[f>>2]|0?23739:23747;c[d>>2]=a;c[d+4>>2]=g;c[d+8>>2]=e;Te(23754,d)}if(c[f>>2]|0){l=b;return}else{Yg();l=b;return}}function Yg(){Rv(0)|0;Aa()}function Zg(){var a=0,b=0,d=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;d=a+4|0;c[d>>2]=Ht(1328)|0;if(c[d>>2]|0){c[b>>2]=Bt(c[d>>2]|0)|0;Te(23912,b);Aa()}else{l=a;return}}function _g(){var a=0,b=0,d=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;d=a+4|0;c[d>>2]=It(1328)|0;if(c[d>>2]|0){c[b>>2]=Bt(c[d>>2]|0)|0;Te(23857,b);Aa()}else{l=a;return}}function $g(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;switch(c[d>>2]|0){case 0:{c[e>>2]=23794;break}case 1:{c[e>>2]=23803;break}case 2:{c[e>>2]=23808;break}case 3:{c[e>>2]=23818;break}case 4:{c[e>>2]=23830;break}case 5:{c[e>>2]=23836;break}case 6:{c[e>>2]=23848;break}default:c[e>>2]=37975}l=b;return c[e>>2]|0}function ah(){var a=0,b=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;if(Wg()|0)c[b>>2]=c[17729];else c[b>>2]=0;l=a;return c[b>>2]|0}function bh(){c[17729]=1;return}function ch(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;if(!(Wg()|0))Se(23967,23512,295,23986);if(ah()|0){dh(23512,300,23986,0,c[d>>2]|0);l=b;return}Zg();if(c[17731]|0){_g();l=b;return}else{c[17731]=1;_g();l=b;return}}function dh(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0;g=l;l=l+48|0;if((l|0)>=(m|0))$(48);h=g;i=g+40|0;j=g+36|0;k=g+32|0;n=g+28|0;o=g+24|0;c[i>>2]=a;c[j>>2]=b;c[k>>2]=d;c[n>>2]=e;c[o>>2]=f;if(!(Wg()|0)){l=g;return}Xg(c[n>>2]|0?5:4);f=c[i>>2]|0;i=c[j>>2]|0;j=c[k>>2]|0?24020:72319;e=c[k>>2]|0?c[k>>2]|0:72319;k=c[o>>2]|0?c[o>>2]|0:24032;c[h>>2]=c[n>>2]|0?24013:72319;c[h+4>>2]=f;c[h+8>>2]=i;c[h+12>>2]=j;c[h+16>>2]=e;c[h+20>>2]=k;Te(24057,h);l=g;return}function eh(){var a=0,b=0,d=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a+4|0;d=a;if(Wg()|0){Zg();c[d>>2]=c[17731];_g();c[b>>2]=c[d>>2]}else c[b>>2]=0;l=a;return c[b>>2]|0}function fh(){var a=0,b=0,d=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;if(!(Wg()|0)){c[b>>2]=1;d=c[b>>2]|0;l=a;return d|0}Zg();if((c[17730]|0)==1){_g();gh(0)|0;Zg()}c[b>>2]=(c[17730]|0)==3&1;_g();d=c[b>>2]|0;l=a;return d|0}function gh(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;c[e>>2]=4;c[f>>2]=50;if(Wg()|0)Xg(2);if((((((hh(c[d>>2]|0)|0)==0?(ih(c[d>>2]|0)|0)==0:0)?(jh(c[d>>2]|0)|0)==0:0)?(kh()|0)==0:0)?(lh(c[d>>2]|0)|0)==0:0)?(mh()|0)==0:0){c[e>>2]=3;c[f>>2]=0}if(!(Wg()|0)){g=c[f>>2]|0;l=b;return g|0}Xg(c[e>>2]|0);g=c[f>>2]|0;l=b;return g|0}function hh(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[d>>2]=a;c[g>>2]=0;c[e>>2]=0;while(1){if(!(c[1432+(c[e>>2]<<2)>>2]|0))break;c[f>>2]=Oh(c[1432+(c[e>>2]<<2)>>2]|0,c[d>>2]|0,1)|0;a=c[1432+(c[e>>2]<<2)>>2]|0;if(c[f>>2]|0)h=Bt(c[f>>2]|0)|0;else h=0;nh(38079,a,0,h);if(c[f>>2]|0)c[g>>2]=1;c[e>>2]=(c[e>>2]|0)+1}l=b;return c[g>>2]|0}function ih(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[d>>2]=a;c[g>>2]=0;c[e>>2]=0;while(1){if(!(c[1408+(c[e>>2]<<2)>>2]|0))break;c[f>>2]=sj(c[1408+(c[e>>2]<<2)>>2]|0,c[d>>2]|0,1)|0;a=c[1408+(c[e>>2]<<2)>>2]|0;if(c[f>>2]|0)h=Bt(c[f>>2]|0)|0;else h=0;nh(43214,a,0,h);if(c[f>>2]|0)c[g>>2]=1;c[e>>2]=(c[e>>2]|0)+1}l=b;return c[g>>2]|0}function jh(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[d>>2]=a;c[g>>2]=0;c[e>>2]=0;while(1){if(!(c[1384+(c[e>>2]<<2)>>2]|0))break;c[f>>2]=Bi(c[1384+(c[e>>2]<<2)>>2]|0,c[d>>2]|0,1)|0;a=c[1384+(c[e>>2]<<2)>>2]|0;if(c[f>>2]|0)h=Bt(c[f>>2]|0)|0;else h=0;nh(36101,a,0,h);if(c[f>>2]|0)c[g>>2]=1;c[e>>2]=(c[e>>2]|0)+1}l=b;return c[g>>2]|0}function kh(){var a=0,b=0,d=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;c[b>>2]=on(1)|0;if(c[b>>2]|0)d=Bt(c[b>>2]|0)|0;else d=0;nh(52643,0,0,d);l=a;return ((c[b>>2]|0)!=0^1^1)&1|0}function lh(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[d>>2]=a;c[g>>2]=0;c[e>>2]=0;while(1){if(!(c[1372+(c[e>>2]<<2)>>2]|0))break;c[f>>2]=$j(c[1372+(c[e>>2]<<2)>>2]|0,c[d>>2]|0,1)|0;a=c[1372+(c[e>>2]<<2)>>2]|0;if(c[f>>2]|0)h=Bt(c[f>>2]|0)|0;else h=0;nh(47252,a,0,h);if(c[f>>2]|0)c[g>>2]=1;c[e>>2]=(c[e>>2]|0)+1}l=b;return c[g>>2]|0}function mh(){return 0}function nh(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0;f=l;l=l+48|0;if((l|0)>=(m|0))$(48);g=f;h=f+44|0;i=f+40|0;j=f+36|0;k=f+32|0;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;if((c[k>>2]|0)==0?(Oe(2)|0)==0:0){l=f;return}e=(Fu(c[h>>2]|0,36101)|0)!=0;d=e?c[h>>2]|0:43214;e=(Fu(c[h>>2]|0,36101)|0)!=0^1;b=e?24105:72319;do if(Fu(c[h>>2]|0,38079)|0){if(!(Fu(c[h>>2]|0,43214)|0)){n=Pi(c[i>>2]|0)|0;break}if(!(Fu(c[h>>2]|0,36101)|0)){n=Pi(c[i>>2]|0)|0;break}if(Fu(c[h>>2]|0,47252)|0)n=72319;else n=Qj(c[i>>2]|0)|0}else n=th(c[i>>2]|0)|0;while(0);h=c[i>>2]|0;i=c[k>>2]|0?c[k>>2]|0:24111;k=c[j>>2]|0?24116:72319;e=c[j>>2]|0?c[j>>2]|0:72319;a=c[j>>2]|0?47240:72319;c[g>>2]=d;c[g+4>>2]=b;c[g+8>>2]=n;c[g+12>>2]=h;c[g+16>>2]=i;c[g+20>>2]=k;c[g+24>>2]=e;c[g+28>>2]=a;Te(24119,g);l=f;return}function oh(){var a=0,b=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;if(Wg()|0){Zg();c[b>>2]=(c[17730]|0)==3&1;_g()}else c[b>>2]=1;l=a;return c[b>>2]|0}function ph(){var a=0,b=0,d=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;if(Wg()|0){Zg();c[b>>2]=((c[17730]|0)==3?1:(c[17730]|0)==4)&1;_g();d=c[b>>2]|0;l=a;return d|0}else{c[b>>2]=1;d=c[b>>2]|0;l=a;return d|0}return 0}function qh(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f;h=f+20|0;i=f+16|0;j=f+12|0;k=f+8|0;n=f+4|0;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;if((c[i>>2]|0)!=1){c[g>>2]=c[i>>2];Xe(24163,g)}if((c[j>>2]|0)>>>0<8)c[j>>2]=8;c[n>>2]=wf(1,8+(c[j>>2]|0)|0)|0;if(c[n>>2]|0){j=c[n>>2]|0;a[j>>0]=a[24209]|0;a[j+1>>0]=a[24210]|0;a[j+2>>0]=a[24211]|0;a[(c[n>>2]|0)+3>>0]=c[i>>2];c[(c[n>>2]|0)+4>>2]=c[k>>2];c[h>>2]=c[n>>2];o=c[h>>2]|0;l=f;return o|0}else{c[h>>2]=0;o=c[h>>2]|0;l=f;return o|0}return 0}function rh(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+8|0;g=e;h=e+24|0;i=e+20|0;c[h>>2]=b;c[i>>2]=d;if(!(c[h>>2]|0)){j=c[h>>2]|0;c[g>>2]=j;We(24213,g)}if(Jv(c[h>>2]|0,24209,3)|0){j=c[h>>2]|0;c[g>>2]=j;We(24213,g)}if((a[(c[h>>2]|0)+3>>0]|0)!=(c[i>>2]|0)){g=c[h>>2]|0;j=a[(c[h>>2]|0)+3>>0]|0;c[f>>2]=c[i>>2];c[f+4>>2]=g;c[f+8>>2]=j;We(24261,f)}else{l=e;return (c[h>>2]|0)+8|0}return 0}function sh(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+8|0;f=d;g=d+12|0;c[g>>2]=b;if(!(c[g>>2]|0)){l=d;return}b=(Jv(c[g>>2]|0,24209,3)|0)!=0;h=c[g>>2]|0;if(b){c[f>>2]=h;We(24318,f)}f=c[g>>2]|0;if((a[h+3>>0]|0)!=1){c[e>>2]=a[f+3>>0];We(24360,e)}if(c[f+4>>2]|0)wb[c[(c[g>>2]|0)+4>>2]&15]((c[g>>2]|0)+8|0);vf(c[g>>2]|0);l=d;return}function th(a){a=a|0;var b=0,d=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=uh(c[d>>2]|0)|0;if(!(c[e>>2]|0)){f=37975;l=b;return f|0}f=c[(c[e>>2]|0)+8>>2]|0;l=b;return f|0}function uh(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[e>>2]=a;c[e>>2]=vh(c[e>>2]|0)|0;c[f>>2]=0;while(1){a=c[1452+(c[f>>2]<<2)>>2]|0;c[g>>2]=a;if(!a){h=6;break}if((c[e>>2]|0)==(c[c[g>>2]>>2]|0)){h=4;break}c[f>>2]=(c[f>>2]|0)+1}if((h|0)==4){c[d>>2]=c[g>>2];i=c[d>>2]|0;l=b;return i|0}else if((h|0)==6){c[d>>2]=0;i=c[d>>2]|0;l=b;return i|0}return 0}function vh(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;l=b;return c[d>>2]|0}function wh(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+20|0;h=f+16|0;i=f+12|0;j=f+8|0;k=f+4|0;n=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;c[n>>2]=0;if((c[i>>2]|0)>=65536)c[k>>2]=71;else c[k>>2]=xh(n,c[h>>2]|0,c[i>>2]|0,c[j>>2]|0)|0;c[c[g>>2]>>2]=c[k>>2]|0?0:c[n>>2]|0;l=f;return c[k>>2]|0}function xh(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;g=l;l=l+48|0;if((l|0)>=(m|0))$(48);h=g+36|0;i=g+32|0;j=g+28|0;k=g+24|0;n=g+20|0;o=g+16|0;p=g+12|0;q=g+8|0;r=g+4|0;s=g;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;c[k>>2]=f;c[n>>2]=c[k>>2]&1;c[p>>2]=0;mn();c[o>>2]=uh(c[i>>2]|0)|0;do if(c[o>>2]|0)if(a[(c[o>>2]|0)+4>>0]&1|0){c[q>>2]=12;break}else{c[q>>2]=0;break}else c[q>>2]=12;while(0);do if(!(c[q>>2]|0)){if((c[k>>2]&-16|0)==0?(c[k>>2]&0|0)==0:0)break;c[q>>2]=12}while(0);a:do if(!(c[q>>2]|0)){f=c[j>>2]|0;b:do if((f|0)<6)switch(f|0){case 5:case 2:case 3:case 1:{break b;break}case 4:{if(c[(c[o>>2]|0)+44>>2]|0?c[(c[o>>2]|0)+48>>2]|0:0)break a;c[q>>2]=71;break a;break}case 0:{if((Wg()|0)==0?Ff(0)|0:0)break a;c[q>>2]=71;break a;break}default:{t=37;break b}}else{if((f|0)<9){switch(f|0){case 7:case 6:{break b;break}case 8:break;default:{t=37;break b}}if((c[(c[o>>2]|0)+20>>2]|0)!=16)c[q>>2]=71;if(c[(c[o>>2]|0)+36>>2]|0?c[(c[o>>2]|0)+40>>2]|0:0)break a;c[q>>2]=71;break a}if((f|0)<11){switch(f|0){case 9:{break b;break}case 10:break;default:{t=37;break b}}if((c[(c[o>>2]|0)+44>>2]|0?c[(c[o>>2]|0)+48>>2]|0:0)?c[(c[o>>2]|0)+60>>2]|0:0){if((c[c[o>>2]>>2]|0)==316)break a;c[q>>2]=71;break a}c[q>>2]=71;break a}if((f|0)>=65537)switch(f|0){case 65537:{break b;break}default:{t=37;break b}}switch(f|0){case 11:break;default:{t=37;break b}}if(c[(c[o>>2]|0)+36>>2]|0?c[(c[o>>2]|0)+40>>2]|0:0){if((c[(c[o>>2]|0)+20>>2]|0)==16)break a;c[q>>2]=71;break a}c[q>>2]=71;break a}while(0);if((t|0)==37){c[q>>2]=71;break}if(c[(c[o>>2]|0)+36>>2]|0?c[(c[o>>2]|0)+40>>2]|0:0)break;c[q>>2]=71}while(0);if(c[q>>2]|0){u=c[q>>2]|0;v=(u|0)!=0;w=c[p>>2]|0;x=v?0:w;y=c[h>>2]|0;c[y>>2]=x;z=c[q>>2]|0;A=yh(z)|0;l=g;return A|0}c[r>>2]=512+(c[(c[o>>2]|0)+28>>2]<<1)-16+15;t=c[r>>2]|0;if(c[n>>2]|0)c[p>>2]=xf(1,t)|0;else c[p>>2]=wf(1,t)|0;if(!(c[p>>2]|0)){c[q>>2]=Et()|0;u=c[q>>2]|0;v=(u|0)!=0;w=c[p>>2]|0;x=v?0:w;y=c[h>>2]|0;c[y>>2]=x;z=c[q>>2]|0;A=yh(z)|0;l=g;return A|0}c[s>>2]=0;if(c[p>>2]&15|0){c[s>>2]=16-(c[p>>2]&15);c[p>>2]=(c[p>>2]|0)+(c[s>>2]|0)}c[c[p>>2]>>2]=c[n>>2]|0?1183944770:604576100;c[(c[p>>2]|0)+4>>2]=(c[r>>2]|0)-(c[s>>2]|0);c[(c[p>>2]|0)+8>>2]=c[s>>2];c[(c[p>>2]|0)+12>>2]=c[o>>2];c[(c[p>>2]|0)+16>>2]=c[i>>2];c[(c[p>>2]|0)+48>>2]=c[j>>2];c[(c[p>>2]|0)+52>>2]=c[k>>2];switch(c[i>>2]|0){case 9:case 8:case 7:{c[(c[p>>2]|0)+20>>2]=1;c[(c[p>>2]|0)+20+4>>2]=2;c[(c[p>>2]|0)+20+8>>2]=1;c[(c[p>>2]|0)+20+12>>2]=3;c[(c[p>>2]|0)+20+16>>2]=4;c[(c[p>>2]|0)+20+20>>2]=5;c[(c[p>>2]|0)+20+24>>2]=2;break}case 303:case 10:{c[(c[p>>2]|0)+20+12>>2]=6;c[(c[p>>2]|0)+20+4>>2]=7;c[(c[p>>2]|0)+20+16>>2]=8;break}default:{}}if((c[j>>2]|0)!=11){u=c[q>>2]|0;v=(u|0)!=0;w=c[p>>2]|0;x=v?0:w;y=c[h>>2]|0;c[y>>2]=x;z=c[q>>2]|0;A=yh(z)|0;l=g;return A|0}a[(c[p>>2]|0)+128+352>>0]=16;u=c[q>>2]|0;v=(u|0)!=0;w=c[p>>2]|0;x=v?0:w;y=c[h>>2]|0;c[y>>2]=x;z=c[q>>2]|0;A=yh(z)|0;l=g;return A|0}function yh(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=zh(32,c[d>>2]|0)|0;l=b;return a|0}function zh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=Ah(c[e>>2]|0,c[f>>2]|0)|0;l=d;return b|0}function Ah(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){g=0;l=d;return g|0}g=(c[e>>2]&127)<<24|c[f>>2]&65535;l=d;return g|0}function Bh(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+24|0;g=e+20|0;h=e+16|0;i=e+12|0;j=e+28|0;k=e;n=e+8|0;c[f>>2]=b;if(!(c[f>>2]|0)){l=e;return}if((c[c[f>>2]>>2]|0)!=1183944770?(c[c[f>>2]>>2]|0)!=604576100:0)Le(63,24409);c[c[f>>2]>>2]=0;c[g>>2]=c[(c[f>>2]|0)+8>>2];c[h>>2]=c[f>>2];c[i>>2]=c[(c[f>>2]|0)+4>>2];a[j>>0]=0;b=k;c[b>>2]=d[j>>0];c[b+4>>2]=0;while(1){if(!(c[h>>2]&7|0?(c[i>>2]|0)!=0:0))break;a[c[h>>2]>>0]=a[j>>0]|0;c[h>>2]=(c[h>>2]|0)+1;c[i>>2]=(c[i>>2]|0)+-1}if((c[i>>2]|0)>>>0>=8){b=k;o=gx(c[b>>2]|0,c[b+4>>2]|0,16843009,16843009)|0;b=k;c[b>>2]=o;c[b+4>>2]=D;do{c[n>>2]=c[h>>2];b=k;o=c[b+4>>2]|0;p=c[n>>2]|0;c[p>>2]=c[b>>2];c[p+4>>2]=o;c[i>>2]=(c[i>>2]|0)-8;c[h>>2]=(c[h>>2]|0)+8}while((c[i>>2]|0)>>>0>=8)}while(1){if(!(c[i>>2]|0))break;a[c[h>>2]>>0]=a[j>>0]|0;c[h>>2]=(c[h>>2]|0)+1;c[i>>2]=(c[i>>2]|0)+-1}vf((c[f>>2]|0)+(0-(c[g>>2]|0))|0);l=e;return}function Ch(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g+20|0;i=g+16|0;j=g+12|0;k=g+8|0;n=g+4|0;o=g;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;c[n>>2]=f;if(!(c[k>>2]|0)){c[k>>2]=c[i>>2];c[n>>2]=c[j>>2]}c[o>>2]=Dh(c[h>>2]|0,c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0)|0;if(!((c[o>>2]|0)!=0&(c[i>>2]|0)!=0)){p=c[o>>2]|0;l=g;return p|0}Uw(c[i>>2]|0,66,c[j>>2]|0)|0;p=c[o>>2]|0;l=g;return p|0}function Dh(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g;i=g+24|0;j=g+20|0;k=g+16|0;n=g+12|0;o=g+8|0;p=g+4|0;c[i>>2]=a;c[j>>2]=b;c[k>>2]=d;c[n>>2]=e;c[o>>2]=f;f=c[(c[i>>2]|0)+48>>2]|0;a:do if((f|0)>=6){if((f|0)<9)switch(f|0){case 6:{c[p>>2]=yq(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 7:{c[p>>2]=dq(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 8:{c[p>>2]=oq(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}default:{q=c[i>>2]|0;r=q+48|0;s=c[r>>2]|0;c[h>>2]=s;We(24504,h)}}if((f|0)<11)switch(f|0){case 9:{c[p>>2]=Bq(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 10:{c[p>>2]=nr(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}default:{q=c[i>>2]|0;r=q+48|0;s=c[r>>2]|0;c[h>>2]=s;We(24504,h)}}if((f|0)<65537)switch(f|0){case 11:{c[p>>2]=er(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}default:{q=c[i>>2]|0;r=q+48|0;s=c[r>>2]|0;c[h>>2]=s;We(24504,h)}}else switch(f|0){case 65537:{c[p>>2]=71;break a;break}default:{q=c[i>>2]|0;r=q+48|0;s=c[r>>2]|0;c[h>>2]=s;We(24504,h)}}}else switch(f|0){case 1:{c[p>>2]=Eh(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 3:{c[p>>2]=gq(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 2:{c[p>>2]=qq(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 5:{c[p>>2]=ir(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 4:{Eb[c[(c[(c[i>>2]|0)+12>>2]|0)+44>>2]&1]((c[i>>2]|0)+496|0,c[j>>2]|0,c[n>>2]|0,c[o>>2]|0);c[p>>2]=0;break a;break}case 0:{if((Wg()|0)==0?Ff(0)|0:0){if((c[n>>2]|0)!=(c[j>>2]|0))$w(c[j>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;c[p>>2]=0;break a}dh(24458,875,24467,0,24482);c[p>>2]=71;break a;break}default:{q=c[i>>2]|0;r=q+48|0;s=c[r>>2]|0;c[h>>2]=s;We(24504,h)}}while(0);l=g;return c[p>>2]|0}function Eh(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g+16|0;i=g+12|0;j=g+8|0;k=g+4|0;n=g;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;c[n>>2]=f;f=Fh(c[h>>2]|0,c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[(c[(c[h>>2]|0)+12>>2]|0)+36>>2]|0)|0;l=g;return f|0}function Fh(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;h=l;l=l+48|0;if((l|0)>=(m|0))$(48);i=h+44|0;j=h+40|0;k=h+36|0;n=h+32|0;o=h+28|0;p=h+24|0;q=h+20|0;r=h+16|0;s=h+12|0;t=h+8|0;u=h+4|0;v=h;c[j>>2]=a;c[k>>2]=b;c[n>>2]=d;c[o>>2]=e;c[p>>2]=f;c[q>>2]=g;c[r>>2]=c[(c[(c[j>>2]|0)+12>>2]|0)+20>>2];if((c[n>>2]|0)>>>0<(c[p>>2]|0)>>>0){c[i>>2]=200;w=c[i>>2]|0;l=h;return w|0}if(((c[p>>2]|0)>>>0)%((c[r>>2]|0)>>>0)|0|0){c[i>>2]=139;w=c[i>>2]|0;l=h;return w|0}c[t>>2]=((c[p>>2]|0)>>>0)/((c[r>>2]|0)>>>0)|0;c[u>>2]=0;c[s>>2]=0;while(1){if((c[s>>2]|0)>>>0>=(c[t>>2]|0)>>>0)break;c[v>>2]=ub[c[q>>2]&63]((c[j>>2]|0)+496|0,c[k>>2]|0,c[o>>2]|0)|0;c[u>>2]=(c[v>>2]|0)>>>0>(c[u>>2]|0)>>>0?c[v>>2]|0:c[u>>2]|0;c[o>>2]=(c[o>>2]|0)+(c[r>>2]|0);c[k>>2]=(c[k>>2]|0)+(c[r>>2]|0);c[s>>2]=(c[s>>2]|0)+1}if((c[u>>2]|0)>>>0>0){bf((c[u>>2]|0)+16|0);cf()}c[i>>2]=0;w=c[i>>2]|0;l=h;return w|0}function Gh(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g+16|0;i=g+12|0;j=g+8|0;k=g+4|0;n=g;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;c[n>>2]=f;if(!(c[k>>2]|0)){c[k>>2]=c[i>>2];c[n>>2]=c[j>>2]}f=Hh(c[h>>2]|0,c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0)|0;l=g;return f|0}function Hh(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g;i=g+24|0;j=g+20|0;k=g+16|0;n=g+12|0;o=g+8|0;p=g+4|0;c[i>>2]=a;c[j>>2]=b;c[k>>2]=d;c[n>>2]=e;c[o>>2]=f;f=c[(c[i>>2]|0)+48>>2]|0;a:do if((f|0)>=6){if((f|0)<9)switch(f|0){case 6:{c[p>>2]=yq(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 7:{c[p>>2]=fq(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 8:{c[p>>2]=pq(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}default:{q=c[i>>2]|0;r=q+48|0;s=c[r>>2]|0;c[h>>2]=s;We(24552,h)}}if((f|0)<11)switch(f|0){case 9:{c[p>>2]=Kq(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 10:{c[p>>2]=qr(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}default:{q=c[i>>2]|0;r=q+48|0;s=c[r>>2]|0;c[h>>2]=s;We(24552,h)}}if((f|0)<65537)switch(f|0){case 11:{c[p>>2]=hr(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}default:{q=c[i>>2]|0;r=q+48|0;s=c[r>>2]|0;c[h>>2]=s;We(24552,h)}}else switch(f|0){case 65537:{c[p>>2]=71;break a;break}default:{q=c[i>>2]|0;r=q+48|0;s=c[r>>2]|0;c[h>>2]=s;We(24552,h)}}}else switch(f|0){case 1:{c[p>>2]=Ih(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 3:{c[p>>2]=jq(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 2:{c[p>>2]=tq(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 5:{c[p>>2]=ir(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 4:{Eb[c[(c[(c[i>>2]|0)+12>>2]|0)+48>>2]&1]((c[i>>2]|0)+496|0,c[j>>2]|0,c[n>>2]|0,c[o>>2]|0);c[p>>2]=0;break a;break}case 0:{if((Wg()|0)==0?Ff(0)|0:0){if((c[n>>2]|0)!=(c[j>>2]|0))$w(c[j>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;c[p>>2]=0;break a}dh(24458,992,24537,0,24482);c[p>>2]=71;break a;break}default:{q=c[i>>2]|0;r=q+48|0;s=c[r>>2]|0;c[h>>2]=s;We(24552,h)}}while(0);l=g;return c[p>>2]|0}function Ih(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g+16|0;i=g+12|0;j=g+8|0;k=g+4|0;n=g;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;c[n>>2]=f;f=Fh(c[h>>2]|0,c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[(c[(c[h>>2]|0)+12>>2]|0)+40>>2]|0)|0;l=g;return f|0}function Jh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;d=Kh(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;l=e;return d|0}function Kh(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+12|0;h=f+8|0;i=f+4|0;j=f;c[g>>2]=b;c[h>>2]=d;c[i>>2]=e;c[j>>2]=ub[c[(c[(c[g>>2]|0)+12>>2]|0)+32>>2]&63]((c[g>>2]|0)+496|0,c[h>>2]|0,c[i>>2]|0)|0;i=c[g>>2]|0;a:do if(!(c[j>>2]|0)){_w(i+496+(c[(c[(c[g>>2]|0)+12>>2]|0)+28>>2]|0)|0,(c[g>>2]|0)+496|0,c[(c[(c[g>>2]|0)+12>>2]|0)+28>>2]|0)|0;h=(c[g>>2]|0)+56|0;a[h>>0]=a[h>>0]&-2|1;h=c[(c[g>>2]|0)+48>>2]|0;if((h|0)<10){switch(h|0){case 9:break;default:break a}Lq(c[g>>2]|0);break}if((h|0)<65537){switch(h|0){case 10:break;default:break a}rr(c[g>>2]|0);break}else{switch(h|0){case 65537:break;default:break a}wq(c[g>>2]|0)|0;break}}else{h=i+56|0;a[h>>0]=a[h>>0]&-2}while(0);l=f;return c[j>>2]|0}function Lh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[i>>2]=0;switch(c[(c[f>>2]|0)+48>>2]|0){case 8:{c[i>>2]=lq(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;break}case 9:{c[i>>2]=Cq(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;break}case 10:{c[i>>2]=mr(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;break}case 11:{c[i>>2]=ar(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;break}default:c[i>>2]=Mh(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0}l=e;return c[i>>2]|0}function Mh(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f;h=f+20|0;i=f+16|0;j=f+12|0;k=f+8|0;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;e=c[i>>2]|0;if(c[(c[(c[i>>2]|0)+12>>2]|0)+60>>2]|0){zb[c[(c[e+12>>2]|0)+60>>2]&7]((c[i>>2]|0)+496|0,c[j>>2]|0,c[k>>2]|0);c[h>>2]=0;n=c[h>>2]|0;l=f;return n|0}Uw(e+64|0,0,c[(c[(c[i>>2]|0)+12>>2]|0)+20>>2]|0)|0;if(c[j>>2]|0){if((c[k>>2]|0)!=(c[(c[(c[i>>2]|0)+12>>2]|0)+20>>2]|0)){e=c[(c[(c[i>>2]|0)+12>>2]|0)+20>>2]|0;c[g>>2]=c[k>>2];c[g+4>>2]=e;Te(24585,g);dh(24458,682,24628,0,24641)}if((c[k>>2]|0)>>>0>(c[(c[(c[i>>2]|0)+12>>2]|0)+20>>2]|0)>>>0)c[k>>2]=c[(c[(c[i>>2]|0)+12>>2]|0)+20>>2];_w((c[i>>2]|0)+64|0,c[j>>2]|0,c[k>>2]|0)|0;k=(c[i>>2]|0)+56|0;a[k>>0]=a[k>>0]&-3|2}else{k=(c[i>>2]|0)+56|0;a[k>>0]=a[k>>0]&-3}c[(c[i>>2]|0)+112>>2]=0;c[h>>2]=0;n=c[h>>2]|0;l=f;return n|0}function Nh(){return 0}function Oh(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+16|0;h=f+12|0;i=f+8|0;j=f+4|0;k=f;c[g>>2]=b;c[h>>2]=d;c[i>>2]=e;c[j>>2]=0;c[k>>2]=uh(c[g>>2]|0)|0;if((c[k>>2]|0?(a[(c[k>>2]|0)+4>>0]&1|0)==0:0)?c[(c[k>>2]|0)+52>>2]|0:0){c[j>>2]=ub[c[(c[k>>2]|0)+52>>2]&63](c[g>>2]|0,c[h>>2]|0,c[i>>2]|0)|0;n=c[j>>2]|0;o=Ph(n)|0;l=f;return o|0}c[j>>2]=12;if(!(c[i>>2]|0)){n=c[j>>2]|0;o=Ph(n)|0;l=f;return o|0}h=c[i>>2]|0;i=c[g>>2]|0;if(c[k>>2]|0?!(a[(c[k>>2]|0)+4>>0]&1|0):0)p=38046;else p=c[k>>2]|0?38007:38026;Eb[h&1](38079,i,38068,p);n=c[j>>2]|0;o=Ph(n)|0;l=f;return o|0}function Ph(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=Ah(1,c[d>>2]|0)|0;l=b;return a|0}function Qh(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g+24|0;i=g+20|0;j=g+16|0;k=g+12|0;n=g+8|0;o=g+4|0;p=g;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;c[n>>2]=f;c[p>>2]=0;if(!(c[j>>2]|0)){c[o>>2]=0;while(1){if(!(c[1476+((c[o>>2]|0)*48|0)>>2]|0))break;if((c[i>>2]|0)==(c[1476+((c[o>>2]|0)*48|0)+4>>2]|0)?(c[1476+((c[o>>2]|0)*48|0)+12>>2]|0)==0:0)break;c[o>>2]=(c[o>>2]|0)+1}if(!(c[1476+((c[o>>2]|0)*48|0)>>2]|0))c[o>>2]=-1}else c[o>>2]=Rh(c[j>>2]|0)|0;if((c[o>>2]|0)<0){c[h>>2]=188;q=c[h>>2]|0;l=g;return q|0}c[p>>2]=c[1476+((c[o>>2]|0)*48|0)>>2];if(Wg()|0?(a[1476+((c[o>>2]|0)*48|0)+8>>0]&1|0)==0:0){c[h>>2]=60;q=c[h>>2]|0;l=g;return q|0}if((c[1476+((c[o>>2]|0)*48|0)+12>>2]|0)>>>0>=3){c[h>>2]=59;q=c[h>>2]|0;l=g;return q|0}if(c[n>>2]|0)c[c[n>>2]>>2]=c[1476+((c[o>>2]|0)*48|0)+4>>2];if(c[k>>2]|0){c[c[k>>2]>>2]=c[1476+((c[o>>2]|0)*48|0)+12>>2];c[(c[k>>2]|0)+4>>2]=c[1476+((c[o>>2]|0)*48|0)+16>>2];if(!(c[(c[k>>2]|0)+8>>2]|0)){n=Sh(c[1476+((c[o>>2]|0)*48|0)+20>>2]|0)|0;c[(c[k>>2]|0)+8>>2]=n}if(!(c[(c[k>>2]|0)+12>>2]|0)){n=Sh(c[1476+((c[o>>2]|0)*48|0)+24>>2]|0)|0;c[(c[k>>2]|0)+12>>2]=n}if(!(c[(c[k>>2]|0)+16>>2]|0)){n=Sh(c[1476+((c[o>>2]|0)*48|0)+28>>2]|0)|0;c[(c[k>>2]|0)+16>>2]=n}if(!(c[(c[k>>2]|0)+32>>2]|0)){n=Sh(c[1476+((c[o>>2]|0)*48|0)+32>>2]|0)|0;c[(c[k>>2]|0)+32>>2]=n}if(!(c[(c[k>>2]|0)+36>>2]|0)){n=Sh(c[1476+((c[o>>2]|0)*48|0)+44>>2]|0)|0;c[(c[k>>2]|0)+36>>2]=n}if(!(c[(c[k>>2]|0)+20>>2]|0)){n=Sh(c[1476+((c[o>>2]|0)*48|0)+36>>2]|0)|0;c[(c[k>>2]|0)+20>>2]=n}if(!(c[(c[k>>2]|0)+20+4>>2]|0)){n=Sh(c[1476+((c[o>>2]|0)*48|0)+40>>2]|0)|0;c[(c[k>>2]|0)+20+4>>2]=n}if(!(c[(c[k>>2]|0)+20+8>>2]|0)){n=up(1)|0;c[(c[k>>2]|0)+20+8>>2]=n}if(!(c[(c[k>>2]|0)+40>>2]|0))c[(c[k>>2]|0)+40>>2]=c[p>>2]}c[h>>2]=0;q=c[h>>2]|0;l=g;return q|0}function Rh(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[e>>2]=a;c[f>>2]=0;while(1){if(!(c[1476+((c[f>>2]|0)*48|0)>>2]|0))break;a=(Fu(c[e>>2]|0,c[1476+((c[f>>2]|0)*48|0)>>2]|0)|0)!=0;h=c[f>>2]|0;if(!a){i=4;break}c[f>>2]=h+1}if((i|0)==4){c[d>>2]=h;j=c[d>>2]|0;l=b;return j|0}a:do if(!(c[1476+((c[f>>2]|0)*48|0)>>2]|0)){c[g>>2]=0;while(1){if(!(c[2532+(c[g>>2]<<3)>>2]|0))break;if(!(Fu(c[e>>2]|0,c[2532+(c[g>>2]<<3)+4>>2]|0)|0))break;c[g>>2]=(c[g>>2]|0)+1}if(c[2532+(c[g>>2]<<3)>>2]|0){c[f>>2]=0;while(1){if(!(c[1476+((c[f>>2]|0)*48|0)>>2]|0))break a;h=(Fu(c[2532+(c[g>>2]<<3)>>2]|0,c[1476+((c[f>>2]|0)*48|0)>>2]|0)|0)!=0;k=c[f>>2]|0;if(!h)break;c[f>>2]=k+1}c[d>>2]=k;j=c[d>>2]|0;l=b;return j|0}}while(0);c[d>>2]=-1;j=c[d>>2]|0;l=b;return j|0}function Sh(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;e=b+12|0;f=b+8|0;g=b+4|0;c[e>>2]=a;c[f>>2]=Zo(g,4,c[e>>2]|0,0,0)|0;if(c[f>>2]|0){c[d>>2]=Bt(c[f>>2]|0)|0;We(35925,d)}else{l=b;return c[g>>2]|0}return 0}function Th(a,b,d,e,f,g,h,i,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;k=l;l=l+64|0;if((l|0)>=(m|0))$(64);n=k+48|0;o=k+44|0;p=k+40|0;q=k+36|0;r=k+32|0;s=k+28|0;t=k+24|0;u=k+20|0;v=k+16|0;w=k+12|0;x=k+8|0;y=k+4|0;z=k;c[o>>2]=a;c[p>>2]=b;c[q>>2]=d;c[r>>2]=e;c[s>>2]=f;c[t>>2]=g;c[u>>2]=h;c[v>>2]=i;c[w>>2]=j;c[x>>2]=Rh(c[o>>2]|0)|0;if((c[x>>2]|0)<0){c[n>>2]=188;A=c[n>>2]|0;l=k;return A|0}do if(c[u>>2]|0){c[z>>2]=4;o=hv((c[1476+((c[x>>2]|0)*48|0)+36>>2]|0)+2|0)|0;c[z>>2]=(c[z>>2]|0)+o;o=hv((c[1476+((c[x>>2]|0)*48|0)+40>>2]|0)+2|0)|0;c[z>>2]=(c[z>>2]|0)+o;c[z>>2]=(c[z>>2]|0)+1;c[y>>2]=pf(c[z>>2]|0)|0;if(c[y>>2]|0){o=uv(c[y>>2]|0,35599)|0;j=uv(o,(c[1476+((c[x>>2]|0)*48|0)+36>>2]|0)+2|0)|0;tv(j,(c[1476+((c[x>>2]|0)*48|0)+40>>2]|0)+2|0)|0;Tp(c[c[u>>2]>>2]|0);j=Sh(c[y>>2]|0)|0;c[c[u>>2]>>2]=j;vf(c[y>>2]|0);break}c[n>>2]=Et()|0;A=c[n>>2]|0;l=k;return A|0}while(0);if(c[p>>2]|0)c[c[p>>2]>>2]=c[1476+((c[x>>2]|0)*48|0)+12>>2];if(c[q>>2]|0)c[c[q>>2]>>2]=c[1476+((c[x>>2]|0)*48|0)+16>>2];if(c[r>>2]|0){Tp(c[c[r>>2]>>2]|0);q=Sh(c[1476+((c[x>>2]|0)*48|0)+20>>2]|0)|0;c[c[r>>2]>>2]=q}if(c[s>>2]|0){Tp(c[c[s>>2]>>2]|0);q=Sh(c[1476+((c[x>>2]|0)*48|0)+24>>2]|0)|0;c[c[s>>2]>>2]=q}if(c[t>>2]|0){Tp(c[c[t>>2]>>2]|0);q=Sh(c[1476+((c[x>>2]|0)*48|0)+28>>2]|0)|0;c[c[t>>2]>>2]=q}if(c[v>>2]|0){Tp(c[c[v>>2]>>2]|0);q=Sh(c[1476+((c[x>>2]|0)*48|0)+32>>2]|0)|0;c[c[v>>2]>>2]=q}if(c[w>>2]|0){Tp(c[c[w>>2]>>2]|0);q=Sh(c[1476+((c[x>>2]|0)*48|0)+44>>2]|0)|0;c[c[w>>2]>>2]=q}c[n>>2]=0;A=c[n>>2]|0;l=k;return A|0}function Uh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;e=l;l=l+128|0;if((l|0)>=(m|0))$(128);f=e;g=e+112|0;h=e+108|0;i=e+104|0;j=e+100|0;k=e+96|0;n=e+92|0;o=e+48|0;p=e+44|0;q=e+40|0;r=e+36|0;s=e+32|0;t=e+28|0;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[n>>2]=0;c[p>>2]=0;c[q>>2]=0;d=o;b=d+44|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(b|0));if(c[j>>2]|0)c[c[j>>2]>>2]=0;if(!(c[h>>2]|0)){c[r>>2]=c[i>>2];if((c[r>>2]|0)>=0&(c[r>>2]|0)>>>0<22?(c[n>>2]=c[1476+((c[r>>2]|0)*48|0)>>2],c[j>>2]|0):0)c[c[j>>2]>>2]=c[1476+((c[r>>2]|0)*48|0)+4>>2];c[g>>2]=c[n>>2];u=c[g>>2]|0;l=e;return u|0}i=c[h>>2]|0;c[f>>2]=o+8;c[f+4>>2]=o+12;c[f+8>>2]=o+16;c[f+12>>2]=p;c[f+16>>2]=o+32;c[f+20>>2]=o+36;c[f+24>>2]=0;c[k>>2]=Vh(lg(i,0,35604,f)|0)|0;a:do if((c[k>>2]|0)==68){c[s>>2]=Tf(c[h>>2]|0,47218,5)|0;if(c[s>>2]|0?(c[t>>2]=_f(c[s>>2]|0,1)|0,Rf(c[s>>2]|0),c[t>>2]|0):0){c[r>>2]=Rh(c[t>>2]|0)|0;vf(c[t>>2]|0);if((c[r>>2]|0)>=0?(c[n>>2]=c[1476+((c[r>>2]|0)*48|0)>>2],c[j>>2]|0):0)c[c[j>>2]>>2]=c[1476+((c[r>>2]|0)*48|0)+4>>2];c[g>>2]=c[n>>2];u=c[g>>2]|0;l=e;return u|0}}else if(!(c[k>>2]|0)){if(c[p>>2]|0?(yn(o+20|0),zi(o+20|0,c[p>>2]|0)|0):0)break;c[r>>2]=0;while(1){if(!(c[1476+((c[r>>2]|0)*48|0)>>2]|0))break a;Dp(c[q>>2]|0);c[q>>2]=Sh(c[1476+((c[r>>2]|0)*48|0)+20>>2]|0)|0;if(((((((wo(c[q>>2]|0,c[o+8>>2]|0)|0)==0?(Dp(c[q>>2]|0),c[q>>2]=Sh(c[1476+((c[r>>2]|0)*48|0)+24>>2]|0)|0,(wo(c[q>>2]|0,c[o+12>>2]|0)|0)==0):0)?(Dp(c[q>>2]|0),c[q>>2]=Sh(c[1476+((c[r>>2]|0)*48|0)+28>>2]|0)|0,(wo(c[q>>2]|0,c[o+16>>2]|0)|0)==0):0)?(Dp(c[q>>2]|0),c[q>>2]=Sh(c[1476+((c[r>>2]|0)*48|0)+32>>2]|0)|0,(wo(c[q>>2]|0,c[o+32>>2]|0)|0)==0):0)?(Dp(c[q>>2]|0),c[q>>2]=Sh(c[1476+((c[r>>2]|0)*48|0)+44>>2]|0)|0,(wo(c[q>>2]|0,c[o+36>>2]|0)|0)==0):0)?(Dp(c[q>>2]|0),c[q>>2]=Sh(c[1476+((c[r>>2]|0)*48|0)+36>>2]|0)|0,(wo(c[q>>2]|0,c[o+20>>2]|0)|0)==0):0)?(Dp(c[q>>2]|0),c[q>>2]=Sh(c[1476+((c[r>>2]|0)*48|0)+40>>2]|0)|0,(wo(c[q>>2]|0,c[o+20+4>>2]|0)|0)==0):0)break;c[r>>2]=(c[r>>2]|0)+1}c[n>>2]=c[1476+((c[r>>2]|0)*48|0)>>2];if(c[j>>2]|0)c[c[j>>2]>>2]=c[1476+((c[r>>2]|0)*48|0)+4>>2]}while(0);Tp(c[q>>2]|0);Tp(c[o+8>>2]|0);Tp(c[o+12>>2]|0);Tp(c[o+16>>2]|0);Tp(c[p>>2]|0);An(o+20|0);Tp(c[o+32>>2]|0);Tp(c[o+36>>2]|0);c[g>>2]=c[n>>2];u=c[g>>2]|0;l=e;return u|0}function Vh(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;l=b;return c[d>>2]&65535|0}function Wh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;e=l;l=l+80|0;if((l|0)>=(m|0))$(80);f=e+76|0;g=e+72|0;h=e+68|0;i=e+64|0;j=e+60|0;k=e+56|0;n=e+52|0;o=e+48|0;p=e+44|0;q=e+40|0;r=e+36|0;s=e+32|0;t=e+28|0;u=e+24|0;v=e+20|0;w=e+16|0;x=e+12|0;y=e+8|0;z=e+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,q=0,r=0,s=0;b=l;l=l+144|0;if((l|0)>=(m|0))$(144);d=b+8|0;e=b;f=b+132|0;g=b+128|0;h=b+124|0;i=b+80|0;j=b+76|0;k=b+72|0;n=b+68|0;o=b+40|0;p=b+36|0;q=b+32|0;c[g>>2]=a;a=i;r=a+44|0;do{c[a>>2]=0;a=a+4|0}while((a|0)<(r|0));if(Qh(0,c[g>>2]|0,i,h)|0){c[f>>2]=0;s=c[f>>2]|0;l=b;return s|0}c[k>>2]=Rp(0)|0;c[n>>2]=Rp(0)|0;c[j>>2]=En(0,0,0,c[i+8>>2]|0,c[i+12>>2]|0,0)|0;if(tn(c[k>>2]|0,c[n>>2]|0,i+20|0,c[j>>2]|0)|0)We(35629,e);In(c[j>>2]|0);An(i+20|0);c[o>>2]=c[i+8>>2];c[o+4>>2]=c[i+12>>2];c[o+8>>2]=c[i+16>>2];c[o+12>>2]=xi(c[k>>2]|0,c[n>>2]|0,c[i+8>>2]|0)|0;c[o+16>>2]=c[i+32>>2];c[o+20>>2]=c[i+36>>2];c[o+24>>2]=0;Dp(c[k>>2]|0);Dp(c[n>>2]|0);n=c[o+4>>2]|0;k=c[o+8>>2]|0;i=c[o+12>>2]|0;j=c[o+16>>2]|0;e=c[o+20>>2]|0;c[d>>2]=c[o>>2];c[d+4>>2]=n;c[d+8>>2]=k;c[d+12>>2]=i;c[d+16>>2]=j;c[d+20>>2]=e;if(cg(p,0,35678,d)|0)c[p>>2]=0;c[q>>2]=0;while(1){if(!(c[o+(c[q>>2]<<2)>>2]|0))break;Tp(c[o+(c[q>>2]<<2)>>2]|0);c[q>>2]=(c[q>>2]|0)+1}c[f>>2]=c[p>>2];s=c[f>>2]|0;l=b;return s|0}function _h(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+20|0;h=f+16|0;i=f+12|0;j=f+8|0;k=f+4|0;n=f;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;if(!(a[c[h>>2]>>0]|0)){c[g>>2]=0;o=c[g>>2]|0;l=f;return o|0}if((Fu(c[h>>2]|0,47259)|0)==0?c[(c[i>>2]|0)+16>>2]|0:0){if(c[(c[i>>2]|0)+16>>2]|0?!(c[j>>2]|0?1:(c[(c[(c[i>>2]|0)+16>>2]|0)+12>>2]&32|0)==0):0)p=c[(c[i>>2]|0)+16>>2]|0;else p=Ip(c[(c[i>>2]|0)+16>>2]|0)|0;c[g>>2]=p;o=c[g>>2]|0;l=f;return o|0}if((Fu(c[h>>2]|0,39371)|0)==0?c[(c[i>>2]|0)+20>>2]|0:0){if(c[(c[i>>2]|0)+20>>2]|0?!(c[j>>2]|0?1:(c[(c[(c[i>>2]|0)+20>>2]|0)+12>>2]&32|0)==0):0)q=c[(c[i>>2]|0)+20>>2]|0;else q=Ip(c[(c[i>>2]|0)+20>>2]|0)|0;c[g>>2]=q;o=c[g>>2]|0;l=f;return o|0}if((Fu(c[h>>2]|0,35612)|0)==0?c[(c[i>>2]|0)+24>>2]|0:0){if(c[(c[i>>2]|0)+24>>2]|0?!(c[j>>2]|0?1:(c[(c[(c[i>>2]|0)+24>>2]|0)+12>>2]&32|0)==0):0)r=c[(c[i>>2]|0)+24>>2]|0;else r=Ip(c[(c[i>>2]|0)+24>>2]|0)|0;c[g>>2]=r;o=c[g>>2]|0;l=f;return o|0}if((Fu(c[h>>2]|0,39375)|0)==0?c[(c[i>>2]|0)+32>>2]|0:0){if(c[(c[i>>2]|0)+32>>2]|0?!(c[j>>2]|0?1:(c[(c[(c[i>>2]|0)+32>>2]|0)+12>>2]&32|0)==0):0)s=c[(c[i>>2]|0)+32>>2]|0;else s=Ip(c[(c[i>>2]|0)+32>>2]|0)|0;c[g>>2]=s;o=c[g>>2]|0;l=f;return o|0}if((Fu(c[h>>2]|0,35616)|0)==0?c[(c[i>>2]|0)+36>>2]|0:0){if(c[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]>>2]|0:0){if(c[c[(c[i>>2]|0)+40>>2]>>2]|0?!(c[j>>2]|0?1:(c[(c[c[(c[i>>2]|0)+40>>2]>>2]|0)+12>>2]&32|0)==0):0)x=c[c[(c[i>>2]|0)+40>>2]>>2]|0;else x=Ip(c[c[(c[i>>2]|0)+40>>2]>>2]|0)|0;c[g>>2]=x;o=c[g>>2]|0;l=f;return o|0}if(((Fu(c[h>>2]|0,35738)|0)==0?c[(c[i>>2]|0)+40>>2]|0:0)?c[(c[(c[i>>2]|0)+40>>2]|0)+4>>2]|0:0){if(c[(c[(c[i>>2]|0)+28>>2]|0)+4>>2]|0?!(c[j>>2]|0?1:(c[(c[(c[(c[i>>2]|0)+28>>2]|0)+4>>2]|0)+12>>2]&32|0)==0):0)y=c[(c[(c[i>>2]|0)+40>>2]|0)+4>>2]|0;else y=Ip(c[(c[(c[i>>2]|0)+40>>2]|0)+4>>2]|0)|0;c[g>>2]=y;o=c[g>>2]|0;l=f;return o|0}if((Fu(c[h>>2]|0,35614)|0)==0?c[(c[i>>2]|0)+28>>2]|0:0){c[g>>2]=yi(c[(c[i>>2]|0)+28>>2]|0,c[i>>2]|0)|0;o=c[g>>2]|0;l=f;return o|0}do if((a[c[h>>2]>>0]|0)==113){if(a[(c[h>>2]|0)+1>>0]|0?(a[(c[h>>2]|0)+1>>0]|0)!=64:0)break;if(!(c[(c[i>>2]|0)+40>>2]|0)){y=Ai(0,c[i>>2]|0,0,0)|0;c[(c[i>>2]|0)+40>>2]=y}if(!(c[(c[i>>2]|0)+40>>2]|0)){c[g>>2]=0;o=c[g>>2]|0;l=f;return o|0}if((a[(c[h>>2]|0)+1>>0]|0)!=64){c[g>>2]=yi(c[(c[i>>2]|0)+40>>2]|0,c[i>>2]|0)|0;o=c[g>>2]|0;l=f;return o|0}if((Fu((c[h>>2]|0)+2|0,49924)|0)==0?(c[c[i>>2]>>2]|0)==2:0){if(ci(c[(c[i>>2]|0)+40>>2]|0,c[i>>2]|0,0,0,0,k,n)|0)break;c[g>>2]=Ep(0,c[k>>2]|0,c[n>>2]<<3)|0;o=c[g>>2]|0;l=f;return o|0}}while(0);c[g>>2]=0;o=c[g>>2]|0;l=f;return o|0}function $h(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+8|0;f=d+4|0;g=d;c[f>>2]=a;c[g>>2]=b;if((Fu(c[f>>2]|0,35614)|0)==0?c[(c[g>>2]|0)+28>>2]|0:0){c[e>>2]=ai(c[(c[g>>2]|0)+28>>2]|0)|0;h=c[e>>2]|0;l=d;return h|0}if(!(Fu(c[f>>2]|0,47216)|0)){if(!(c[(c[g>>2]|0)+40>>2]|0)){f=Ai(0,c[g>>2]|0,0,0)|0;c[(c[g>>2]|0)+40>>2]=f}if(c[(c[g>>2]|0)+40>>2]|0){c[e>>2]=ai(c[(c[g>>2]|0)+40>>2]|0)|0;h=c[e>>2]|0;l=d;return h|0}}c[e>>2]=0;h=c[e>>2]|0;l=d;return h|0}function ai(a){a=a|0;var b=0,d=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;if(c[d>>2]|0){c[e>>2]=xn(0)|0;bi(c[e>>2]|0,c[d>>2]|0);f=c[e>>2]|0;l=b;return f|0}else{c[e>>2]=0;f=c[e>>2]|0;l=b;return f|0}return 0}function bi(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;Kp(c[c[e>>2]>>2]|0,c[c[f>>2]>>2]|0)|0;Kp(c[(c[e>>2]|0)+4>>2]|0,c[(c[f>>2]|0)+4>>2]|0)|0;Kp(c[(c[e>>2]|0)+8>>2]|0,c[(c[f>>2]|0)+8>>2]|0)|0;l=d;return}function ci(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0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]=pf(c[t>>2]|0?c[t>>2]|0:1)|0;if(c[s>>2]|0){_w(c[s>>2]|0,c[v>>2]|0,c[t>>2]|0)|0;ii(c[s>>2]|0,c[t>>2]|0);break}c[j>>2]=Et()|0;y=c[j>>2]|0;l=i;return y|0}else z=21;while(0);if((z|0)==21?(c[s>>2]=Vo(c[k>>2]|0,((c[(c[n>>2]|0)+12>>2]|0)>>>0)/8|0,t,0)|0,(c[s>>2]|0)==0):0){c[j>>2]=Et()|0;y=c[j>>2]|0;l=i;return y|0}if(c[t>>2]|0){c[u>>2]=(((d[c[s>>2]>>0]|0)&128|0)!=0^1^1)&1;k=c[s>>2]|0;a[k>>0]=(d[k>>0]|0)&127}else c[u>>2]=0;Yo(c[(c[o>>2]|0)+4>>2]|0,c[s>>2]|0,c[t>>2]|0,0);if(c[p>>2]|0){if((c[u>>2]|0)!=0&(c[t>>2]|0)!=0){k=c[s>>2]|0;a[k>>0]=d[k>>0]|0|128}ii(c[s>>2]|0,c[t>>2]|0);c[c[p>>2]>>2]=c[s>>2];if(c[q>>2]|0)c[c[q>>2]>>2]=c[t>>2]}else vf(c[s>>2]|0);c[r>>2]=fi(c[c[o>>2]>>2]|0,c[(c[o>>2]|0)+4>>2]|0,c[u>>2]|0,c[n>>2]|0)|0;Op(c[(c[o>>2]|0)+8>>2]|0,1)|0;c[j>>2]=c[r>>2];y=c[j>>2]|0;l=i;return y|0}function ii(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+12|0;h=f+8|0;i=f+4|0;j=f;c[g>>2]=b;c[h>>2]=e;c[j>>2]=0;while(1){if((c[j>>2]|0)>>>0>=(((c[h>>2]|0)>>>0)/2|0)>>>0)break;c[i>>2]=d[(c[g>>2]|0)+(c[j>>2]|0)>>0];a[(c[g>>2]|0)+(c[j>>2]|0)>>0]=a[(c[g>>2]|0)+((c[h>>2]|0)-1-(c[j>>2]|0))>>0]|0;a[(c[g>>2]|0)+((c[h>>2]|0)-1-(c[j>>2]|0))>>0]=c[i>>2];c[j>>2]=(c[j>>2]|0)+1}l=f;return}function ji(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;g=l;l=l+80|0;if((l|0)>=(m|0))$(80);h=g+68|0;i=g+64|0;j=g+60|0;k=g+56|0;n=g+52|0;o=g+48|0;p=g+44|0;q=g+40|0;r=g+8|0;s=g+4|0;t=g;c[i>>2]=b;c[j>>2]=e;c[k>>2]=f;c[o>>2]=0;c[c[i>>2]>>2]=0;c[s>>2]=10;if((c[s>>2]|0)!=10){c[h>>2]=5;u=c[h>>2]|0;l=g;return u|0}c[t>>2]=(((c[(c[k>>2]|0)+12>>2]|0)+7|0)>>>0)/8|0;if((c[t>>2]|0)!=32){c[h>>2]=63;u=c[h>>2]|0;l=g;return u|0}c[q>>2]=xf(2,c[t>>2]|0)|0;if(!(c[q>>2]|0)){c[h>>2]=Et()|0;u=c[h>>2]|0;l=g;return u|0};c[r>>2]=0;c[r+4>>2]=0;c[r+8>>2]=0;c[r+12>>2]=0;c[r+16>>2]=0;c[r+20>>2]=0;c[r+24>>2]=0;c[r+28>>2]=0;c[o>>2]=Vo(c[j>>2]|0,0,p,0)|0;j=c[q>>2]|0;if(!(c[o>>2]|0)){vf(j);c[h>>2]=Et()|0;u=c[h>>2]|0;l=g;return u|0}c[r+12>>2]=j;c[r+4>>2]=0;if((c[t>>2]|0)>>>0>(c[p>>2]|0)>>>0)v=(c[t>>2]|0)-(c[p>>2]|0)|0;else v=0;c[r+8>>2]=v;c[r+16+12>>2]=c[o>>2];c[r+16+4>>2]=0;c[r+16+8>>2]=c[p>>2];c[n>>2]=mj(c[s>>2]|0,0,c[q>>2]|0,r,2)|0;vf(c[o>>2]|0);o=c[q>>2]|0;if(c[n>>2]|0){vf(o);c[h>>2]=c[n>>2];u=c[h>>2]|0;l=g;return u|0}else{ii(o,32);a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0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=oi(1,c[d>>2]|0)|0;l=b;return a|0}function oi(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){g=0;l=d;return g|0}g=(c[e>>2]&127)<<24|c[f>>2]&65535;l=d;return g|0}function pi(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0;h=l;l=l+160|0;if((l|0)>=(m|0))$(160);i=h+156|0;j=h+152|0;k=h+148|0;n=h+144|0;o=h+140|0;p=h+136|0;q=h+132|0;r=h+128|0;s=h+124|0;t=h+120|0;u=h+116|0;v=h+112|0;w=h+64|0;x=h+60|0;y=h+56|0;z=h+52|0;A=h+48|0;B=h+44|0;C=h+40|0;D=h+28|0;E=h+16|0;F=h+12|0;G=h+8|0;H=h+4|0;I=h;c[j>>2]=a;c[k>>2]=b;c[n>>2]=d;c[o>>2]=e;c[p>>2]=f;c[q>>2]=g;c[s>>2]=0;c[z>>2]=0;c[B>>2]=0;g=w;f=g+48|0;do{c[g>>2]=0;g=g+4|0}while((g|0)<(f|0));if(c[j>>2]|0?c[(c[j>>2]|0)+12>>2]&4|0:0){yn(D);yn(E);c[F>>2]=Sp(0)|0;c[G>>2]=Rp(0)|0;c[H>>2]=Rp(0)|0;c[I>>2]=Rp(0)|0;c[s>>2]=En(c[c[k>>2]>>2]|0,c[(c[k>>2]|0)+4>>2]|0,0,c[(c[k>>2]|0)+8>>2]|0,c[(c[k>>2]|0)+12>>2]|0,c[(c[k>>2]|0)+16>>2]|0)|0;c[t>>2]=(((c[(c[s>>2]|0)+12>>2]|0)+7|0)>>>0)/8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];c[w+32+4>>2]=0;c[w+32+8>>2]=c[y>>2];c[r>>2]=mj(c[p>>2]|0,0,c[v>>2]|0,w,3)|0;if(!(c[r>>2]|0)){Ep(c[n>>2]|0,c[z>>2]|0,c[A>>2]<<3)|0;c[z>>2]=0;ii(c[v>>2]|0,64);if(Ff(1)|0)_e(36007,c[v>>2]|0,64);Yo(c[o>>2]|0,c[v>>2]|0,64,0);Ro(c[o>>2]|0,c[o>>2]|0,c[F>>2]|0,c[(c[k>>2]|0)+32>>2]|0);io(c[o>>2]|0,c[o>>2]|0,c[I>>2]|0,c[(c[k>>2]|0)+32>>2]|0);c[r>>2]=qi(c[o>>2]|0,c[t>>2]|0,z,A)|0;if(!(c[r>>2]|0)){if(Ff(1)|0)_e(36014,c[z>>2]|0,c[A>>2]|0);Ep(c[o>>2]|0,c[z>>2]|0,c[A>>2]<<3)|0;c[z>>2]=0;c[r>>2]=0}}}}}while(0);Tp(c[F>>2]|0);Tp(c[G>>2]|0);Tp(c[H>>2]|0);Tp(c[I>>2]|0);vf(c[v>>2]|0);In(c[s>>2]|0);An(D);An(E);vf(c[B>>2]|0);vf(c[z>>2]|0);c[i>>2]=c[r>>2];J=c[i>>2]|0;l=h;return J|0}c[i>>2]=79;J=c[i>>2]|0;l=h;return J|0}function qi(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+24|0;h=f+20|0;i=f+16|0;j=f+12|0;k=f+8|0;n=f+4|0;o=f;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;c[n>>2]=Vo(c[h>>2]|0,c[i>>2]|0,o,0)|0;if(c[n>>2]|0){c[c[j>>2]>>2]=c[n>>2];c[c[k>>2]>>2]=c[o>>2];c[g>>2]=0;p=c[g>>2]|0;l=f;return p|0}else{c[g>>2]=Et()|0;p=c[g>>2]|0;l=f;return p|0}return 0}function ri(a,b,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0;break a}while(0);c[r>>2]=8}}}while(0);vf(c[w>>2]|0);vf(c[A>>2]|0);In(c[s>>2]|0);Tp(c[H>>2]|0);Tp(c[G>>2]|0);An(I);An(J);An(v);c[i>>2]=c[r>>2];M=c[i>>2]|0;l=h;return M|0}c[i>>2]=79;M=c[i>>2]|0;l=h;return M|0}function si(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;Dp(c[(c[d>>2]|0)+8>>2]|0);c[(c[d>>2]|0)+8>>2]=0;Dp(c[(c[d>>2]|0)+12>>2]|0);c[(c[d>>2]|0)+12>>2]=0;Dp(c[(c[d>>2]|0)+16>>2]|0);c[(c[d>>2]|0)+16>>2]=0;An((c[d>>2]|0)+20|0);Dp(c[(c[d>>2]|0)+32>>2]|0);c[(c[d>>2]|0)+32>>2]=0;Dp(c[(c[d>>2]|0)+36>>2]|0);c[(c[d>>2]|0)+36>>2]=0;l=b;return}function ti(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+48|0;if((l|0)>=(m|0))$(48);e=d;c[e>>2]=c[b>>2];c[e+4>>2]=c[b+4>>2];c[e+40>>2]=c[b+40>>2];c[e+8>>2]=Ip(c[b+8>>2]|0)|0;c[e+12>>2]=Ip(c[b+12>>2]|0)|0;c[e+16>>2]=Ip(c[b+16>>2]|0)|0;yn(e+20|0);ui(e+20|0,b+20|0);c[e+32>>2]=Ip(c[b+32>>2]|0)|0;c[e+36>>2]=Ip(c[b+36>>2]|0)|0;b=a;a=e;e=b+44|0;do{c[b>>2]=c[a>>2];b=b+4|0;a=a+4|0}while((b|0)<(e|0));l=d;return}function ui(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;Kp(c[c[e>>2]>>2]|0,c[c[f>>2]>>2]|0)|0;Kp(c[(c[e>>2]|0)+4>>2]|0,c[(c[f>>2]|0)+4>>2]|0)|0;Kp(c[(c[e>>2]|0)+8>>2]|0,c[(c[f>>2]|0)+8>>2]|0)|0;l=d;return}function vi(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=37975;switch(c[d>>2]|0){case 0:{c[e>>2]=36021;break}case 1:{c[e>>2]=45707;break}case 2:{c[e>>2]=36033;break}default:{}}l=b;return c[e>>2]|0}function wi(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=37975;switch(c[d>>2]|0){case 0:{c[e>>2]=36041;break}case 1:{c[e>>2]=36050;break}default:{}}l=b;return c[e>>2]|0}function xi(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;f=l;l=l+64|0;if((l|0)>=(m|0))$(64);g=f+16|0;h=f+8|0;i=f;j=f+52|0;k=f+48|0;n=f+44|0;o=f+40|0;p=f+36|0;q=f+32|0;r=f+28|0;s=f+24|0;t=f+20|0;c[j>>2]=b;c[k>>2]=d;c[n>>2]=e;c[p>>2]=(((lo(c[n>>2]|0)|0)+7|0)>>>0)/8|0;c[r>>2]=zf(1+(c[p>>2]<<1)|0)|0;a[c[r>>2]>>0]=4;c[s>>2]=(c[r>>2]|0)+1;c[o>>2]=bp(5,c[s>>2]|0,c[p>>2]|0,q,c[j>>2]|0)|0;if(c[o>>2]|0){c[i>>2]=Bt(c[o>>2]|0)|0;We(36058,i)}if((c[q>>2]|0)>>>0<(c[p>>2]|0)>>>0){$w((c[s>>2]|0)+((c[p>>2]|0)-(c[q>>2]|0))|0,c[s>>2]|0,c[q>>2]|0)|0;Uw(c[s>>2]|0,0,(c[p>>2]|0)-(c[q>>2]|0)|0)|0}c[s>>2]=(c[s>>2]|0)+(c[p>>2]|0);c[o>>2]=bp(5,c[s>>2]|0,c[p>>2]|0,q,c[k>>2]|0)|0;if(c[o>>2]|0){c[h>>2]=Bt(c[o>>2]|0)|0;We(36058,h)}if((c[q>>2]|0)>>>0<(c[p>>2]|0)>>>0){$w((c[s>>2]|0)+((c[p>>2]|0)-(c[q>>2]|0))|0,c[s>>2]|0,c[q>>2]|0)|0;Uw(c[s>>2]|0,0,(c[p>>2]|0)-(c[q>>2]|0)|0)|0}c[o>>2]=Zo(t,5,c[r>>2]|0,1+(c[p>>2]<<1)|0,0)|0;if(c[o>>2]|0){c[g>>2]=Bt(c[o>>2]|0)|0;We(36080,g)}else{vf(c[r>>2]|0);l=f;return c[t>>2]|0}return 0}function yi(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;i=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=Rp(0)|0;c[h>>2]=Rp(0)|0;if(tn(c[g>>2]|0,c[h>>2]|0,c[e>>2]|0,c[f>>2]|0)|0)c[i>>2]=0;else c[i>>2]=xi(c[g>>2]|0,c[h>>2]|0,c[(c[f>>2]|0)+16>>2]|0)|0;Dp(c[g>>2]|0);Dp(c[h>>2]|0);l=d;return c[i>>2]|0}function zi(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;e=l;l=l+48|0;if((l|0)>=(m|0))$(48);f=e+36|0;g=e+32|0;h=e+28|0;i=e+24|0;j=e+20|0;k=e+16|0;n=e+12|0;o=e+8|0;p=e+4|0;q=e;c[g>>2]=a;c[h>>2]=b;do if(c[h>>2]|0?c[(c[h>>2]|0)+12>>2]&4|0:0){c[k>>2]=Gp(c[h>>2]|0,q)|0;if(c[k>>2]|0){c[j>>2]=(((c[q>>2]|0)+7|0)>>>0)/8|0;c[n>>2]=0;break}c[f>>2]=65;r=c[f>>2]|0;l=e;return r|0}else s=6;while(0);do if((s|0)==6){c[j>>2]=(((lo(c[h>>2]|0)|0)+7|0)>>>0)/8|0;c[n>>2]=zf(c[j>>2]|0)|0;c[i>>2]=bp(5,c[n>>2]|0,c[j>>2]|0,j,c[h>>2]|0)|0;q=c[n>>2]|0;if(!(c[i>>2]|0)){c[k>>2]=q;break}vf(q);c[f>>2]=c[i>>2];r=c[f>>2]|0;l=e;return r|0}while(0);if((c[j>>2]|0)>>>0<1){vf(c[n>>2]|0);c[f>>2]=65;r=c[f>>2]|0;l=e;return r|0}if((d[c[k>>2]>>0]|0|0)!=4){vf(c[n>>2]|0);c[f>>2]=69;r=c[f>>2]|0;l=e;return r|0}if((((c[j>>2]|0)-1|0)>>>0)%2|0|0){vf(c[n>>2]|0);c[f>>2]=65;r=c[f>>2]|0;l=e;return r|0}c[j>>2]=(((c[j>>2]|0)-1|0)>>>0)/2|0;c[i>>2]=Zo(o,5,(c[k>>2]|0)+1|0,c[j>>2]|0,0)|0;if(c[i>>2]|0){vf(c[n>>2]|0);c[f>>2]=c[i>>2];r=c[f>>2]|0;l=e;return r|0}c[i>>2]=Zo(p,5,(c[k>>2]|0)+1+(c[j>>2]|0)|0,c[j>>2]|0,0)|0;vf(c[n>>2]|0);if(c[i>>2]|0){Dp(c[o>>2]|0);c[f>>2]=c[i>>2];r=c[f>>2]|0;l=e;return r|0}else{Kp(c[c[g>>2]>>2]|0,c[o>>2]|0)|0;Kp(c[(c[g>>2]|0)+4>>2]|0,c[p>>2]|0)|0;Op(c[(c[g>>2]|0)+8>>2]|0,1)|0;Dp(c[o>>2]|0);Dp(c[p>>2]|0);c[f>>2]=0;r=c[f>>2]|0;l=e;return r|0}return 0}function Ai(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+24|0;h=f+20|0;i=f+16|0;j=f+12|0;k=f+8|0;n=f+4|0;o=f;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;if(!(c[j>>2]|0))c[j>>2]=c[(c[i>>2]|0)+28>>2];if(!(c[k>>2]|0))c[k>>2]=c[(c[i>>2]|0)+44>>2];if(((c[k>>2]|0)!=0&(c[j>>2]|0)!=0?c[(c[i>>2]|0)+16>>2]|0:0)?c[(c[i>>2]|0)+20>>2]|0:0){if((c[c[i>>2]>>2]|0)==2?(c[(c[i>>2]|0)+24>>2]|0)==0:0){c[g>>2]=0;p=c[g>>2]|0;l=f;return p|0}if((c[(c[i>>2]|0)+4>>2]|0)==1?c[(c[i>>2]|0)+8>>2]&4096|0:0){if(ji(o,c[k>>2]|0,c[i>>2]|0)|0){c[g>>2]=0;p=c[g>>2]|0;l=f;return p|0}c[n>>2]=Sp(0)|0;Yo(c[n>>2]|0,c[o>>2]|0,32,0);vf(c[o>>2]|0);if(!(c[h>>2]|0))c[h>>2]=xn(0)|0;if(c[h>>2]|0)$n(c[h>>2]|0,c[n>>2]|0,c[j>>2]|0,c[i>>2]|0);Dp(c[n>>2]|0)}else{if(!(c[h>>2]|0))c[h>>2]=xn(0)|0;if(c[h>>2]|0)$n(c[h>>2]|0,c[k>>2]|0,c[j>>2]|0,c[i>>2]|0)}c[g>>2]=c[h>>2];p=c[g>>2]|0;l=f;return p|0}c[g>>2]=0;p=c[g>>2]|0;l=f;return p|0}function Bi(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[i>>2]=0;if(pj(c[f>>2]|0,8,0,0)|0){c[i>>2]=5;if(c[h>>2]|0)Eb[c[h>>2]&1](36101,c[f>>2]|0,38068,36106)}else c[i>>2]=Ci(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;h=Di(c[i>>2]|0)|0;l=e;return h|0}function Ci(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;switch(c[f>>2]|0){case 2:{c[i>>2]=Fi(c[g>>2]|0,c[h>>2]|0)|0;break}case 11:{c[i>>2]=Gi(c[g>>2]|0,c[h>>2]|0)|0;break}case 8:{c[i>>2]=Hi(c[g>>2]|0,c[h>>2]|0)|0;break}case 9:{c[i>>2]=Ii(c[g>>2]|0,c[h>>2]|0)|0;break}case 10:{c[i>>2]=Ji(c[g>>2]|0,c[h>>2]|0)|0;break}default:c[i>>2]=5}l=e;return c[i>>2]|0}function Di(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=Ei(1,c[d>>2]|0)|0;l=b;return a|0}function Ei(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){g=0;l=d;return g|0}g=(c[e>>2]&127)<<24|c[f>>2]&65535;l=d;return g|0}function Fi(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;e=l;l=l+160|0;if((l|0)>=(m|0))$(160);f=e+24|0;g=e+20|0;h=e+16|0;i=e+12|0;j=e+8|0;k=e+32|0;n=e+4|0;o=e;c[g>>2]=b;c[h>>2]=d;c[i>>2]=36945;c[n>>2]=0;while(1){if((c[n>>2]|0)>=64)break;a[k+(c[n>>2]|0)>>0]=c[n>>2];c[n>>2]=(c[n>>2]|0)+1}c[j>>2]=Ki(2,36960,9,k,64,36970,20)|0;do if(!(c[j>>2]|0)){if(c[g>>2]|0){c[i>>2]=36991;c[n>>2]=0;c[o>>2]=48;while(1){if((c[n>>2]|0)>=20)break;d=c[o>>2]|0;c[o>>2]=d+1;a[k+(c[n>>2]|0)>>0]=d;c[n>>2]=(c[n>>2]|0)+1}c[j>>2]=Ki(2,37006,9,k,20,37016,20)|0;if(c[j>>2]|0)break;c[i>>2]=37037;c[n>>2]=0;c[o>>2]=80;while(1){if((c[n>>2]|0)>=100)break;d=c[o>>2]|0;c[o>>2]=d+1;a[k+(c[n>>2]|0)>>0]=d;c[n>>2]=(c[n>>2]|0)+1}c[j>>2]=Ki(2,37052,9,k,100,37062,20)|0;if(c[j>>2]|0)break;c[i>>2]=37083;c[n>>2]=0;c[o>>2]=112;while(1){if((c[n>>2]|0)>=49)break;d=c[o>>2]|0;c[o>>2]=d+1;a[k+(c[n>>2]|0)>>0]=d;c[n>>2]=(c[n>>2]|0)+1}c[j>>2]=Ki(2,37098,9,k,49,37108,20)|0;if(c[j>>2]|0)break}c[f>>2]=0;p=c[f>>2]|0;l=e;return p|0}while(0);if(c[h>>2]|0)Eb[c[h>>2]&1](36101,2,c[i>>2]|0,c[j>>2]|0);c[f>>2]=50;p=c[f>>2]|0;l=e;return p|0}function Gi(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+20|0;f=d+16|0;g=d+12|0;h=d+8|0;i=d+4|0;j=d;c[f>>2]=a;c[g>>2]=b;c[j>>2]=0;while(1){if(!(c[4088+((c[j>>2]|0)*40|0)>>2]|0)){k=6;break}c[h>>2]=c[4088+((c[j>>2]|0)*40|0)>>2];b=c[4088+((c[j>>2]|0)*40|0)+4>>2]|0;a=hv(c[4088+((c[j>>2]|0)*40|0)+4>>2]|0)|0;n=c[4088+((c[j>>2]|0)*40|0)+8>>2]|0;o=hv(c[4088+((c[j>>2]|0)*40|0)+8>>2]|0)|0;c[i>>2]=Ki(11,b,a,n,o,4088+((c[j>>2]|0)*40|0)+12|0,28)|0;if(c[i>>2]|0)break;if(!(c[f>>2]|0)){k=6;break}c[j>>2]=(c[j>>2]|0)+1}if((k|0)==6){c[e>>2]=0;p=c[e>>2]|0;l=d;return p|0}if(c[g>>2]|0)Eb[c[g>>2]&1](36101,11,c[h>>2]|0,c[i>>2]|0);c[e>>2]=50;p=c[e>>2]|0;l=d;return p|0}function Hi(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;d=l;l=l+48|0;if((l|0)>=(m|0))$(48);e=d+32|0;f=d+28|0;g=d+24|0;h=d+20|0;i=d+16|0;j=d+12|0;k=d+8|0;n=d+4|0;o=d;c[f>>2]=a;c[g>>2]=b;c[j>>2]=0;while(1){if(!(c[3780+((c[j>>2]|0)*44|0)>>2]|0)){p=13;break}c[h>>2]=c[3780+((c[j>>2]|0)*44|0)>>2];b=c[3780+((c[j>>2]|0)*44|0)+4>>2]|0;a=hv(c[3780+((c[j>>2]|0)*44|0)+4>>2]|0)|0;q=c[3780+((c[j>>2]|0)*44|0)+8>>2]|0;r=hv(c[3780+((c[j>>2]|0)*44|0)+8>>2]|0)|0;c[i>>2]=Ki(8,b,a,q,r,3780+((c[j>>2]|0)*44|0)+12|0,32)|0;if(c[i>>2]|0)break;r=c[3780+((c[j>>2]|0)*44|0)+8>>2]|0;c[k>>2]=Yp(r,hv(c[3780+((c[j>>2]|0)*44|0)+8>>2]|0)|0)|0;if(!(c[k>>2]|0)){p=5;break}r=c[k>>2]|0;q=c[3780+((c[j>>2]|0)*44|0)+4>>2]|0;Zp(r,q,hv(c[3780+((c[j>>2]|0)*44|0)+4>>2]|0)|0);c[n>>2]=cq(c[k>>2]|0,o)|0;if(!(c[n>>2]|0)){p=7;break}if((c[o>>2]|0)!=32){p=10;break}if(Jv(c[n>>2]|0,3780+((c[j>>2]|0)*44|0)+12|0,32)|0){p=10;break}$p(c[k>>2]|0);if(!(c[f>>2]|0)){p=13;break}c[j>>2]=(c[j>>2]|0)+1}if((p|0)==5)c[i>>2]=36850;else if((p|0)==7){c[i>>2]=36875;$p(c[k>>2]|0)}else if((p|0)==10){c[i>>2]=36905;$p(c[k>>2]|0)}else if((p|0)==13){c[e>>2]=0;s=c[e>>2]|0;l=d;return s|0}if(c[g>>2]|0)Eb[c[g>>2]&1](36101,8,c[h>>2]|0,c[i>>2]|0);c[e>>2]=50;s=c[e>>2]|0;l=d;return s|0}function Ii(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+20|0;f=d+16|0;g=d+12|0;h=d+8|0;i=d+4|0;j=d;c[f>>2]=a;c[g>>2]=b;c[j>>2]=0;while(1){if(!(c[3360+((c[j>>2]|0)*60|0)>>2]|0)){k=6;break}c[h>>2]=c[3360+((c[j>>2]|0)*60|0)>>2];b=c[3360+((c[j>>2]|0)*60|0)+4>>2]|0;a=hv(c[3360+((c[j>>2]|0)*60|0)+4>>2]|0)|0;n=c[3360+((c[j>>2]|0)*60|0)+8>>2]|0;o=hv(c[3360+((c[j>>2]|0)*60|0)+8>>2]|0)|0;c[i>>2]=Ki(9,b,a,n,o,3360+((c[j>>2]|0)*60|0)+12|0,48)|0;if(c[i>>2]|0)break;if(!(c[f>>2]|0)){k=6;break}c[j>>2]=(c[j>>2]|0)+1}if((k|0)==6){c[e>>2]=0;p=c[e>>2]|0;l=d;return p|0}if(c[g>>2]|0)Eb[c[g>>2]&1](36101,9,c[h>>2]|0,c[i>>2]|0);c[e>>2]=50;p=c[e>>2]|0;l=d;return p|0}function Ji(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+20|0;f=d+16|0;g=d+12|0;h=d+8|0;i=d+4|0;j=d;c[f>>2]=a;c[g>>2]=b;c[j>>2]=0;while(1){if(!(c[2828+((c[j>>2]|0)*76|0)>>2]|0)){k=6;break}c[h>>2]=c[2828+((c[j>>2]|0)*76|0)>>2];b=c[2828+((c[j>>2]|0)*76|0)+4>>2]|0;a=hv(c[2828+((c[j>>2]|0)*76|0)+4>>2]|0)|0;n=c[2828+((c[j>>2]|0)*76|0)+8>>2]|0;o=hv(c[2828+((c[j>>2]|0)*76|0)+8>>2]|0)|0;c[i>>2]=Ki(10,b,a,n,o,2828+((c[j>>2]|0)*76|0)+12|0,64)|0;if(c[i>>2]|0)break;if(!(c[f>>2]|0)){k=6;break}c[j>>2]=(c[j>>2]|0)+1}if((k|0)==6){c[e>>2]=0;p=c[e>>2]|0;l=d;return p|0}if(c[g>>2]|0)Eb[c[g>>2]&1](36101,10,c[h>>2]|0,c[i>>2]|0);c[e>>2]=50;p=c[e>>2]|0;l=d;return p|0}function Ki(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;i=l;l=l+48|0;if((l|0)>=(m|0))$(48);j=i+36|0;k=i+32|0;n=i+28|0;o=i+24|0;p=i+20|0;q=i+16|0;r=i+12|0;s=i+8|0;t=i+4|0;u=i;c[k>>2]=a;c[n>>2]=b;c[o>>2]=d;c[p>>2]=e;c[q>>2]=f;c[r>>2]=g;c[s>>2]=h;h=oj(c[k>>2]|0)|0;do if((h|0)==(c[s>>2]|0)){if(Si(t,c[k>>2]|0,2)|0){c[j>>2]=49976;break}g=(fj(c[t>>2]|0,c[p>>2]|0,c[q>>2]|0)|0)!=0;f=c[t>>2]|0;if(g){_i(f);c[j>>2]=36149;break}$i(f,c[n>>2]|0,c[o>>2]|0);c[u>>2]=lj(c[t>>2]|0,c[k>>2]|0)|0;if(!(c[u>>2]|0)){_i(c[t>>2]|0);c[j>>2]=36171;break}f=(Jv(c[u>>2]|0,c[r>>2]|0,c[s>>2]|0)|0)!=0;_i(c[t>>2]|0);if(f){c[j>>2]=36191;break}else{c[j>>2]=0;break}}else c[j>>2]=36130;while(0);l=i;return c[j>>2]|0}function Li(a){a=a|0;var b=0,d=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+8|0;e=b+4|0;f=b;c[e>>2]=a;do if(c[e>>2]|0){c[f>>2]=Mi(c[e>>2]|0,0)|0;if(c[f>>2]|0){c[d>>2]=c[c[f>>2]>>2];break}c[f>>2]=Ni(c[e>>2]|0)|0;if(c[f>>2]|0){c[d>>2]=c[c[f>>2]>>2];break}else{c[d>>2]=0;break}}else c[d>>2]=0;while(0);l=b;return c[d>>2]|0}function Mi(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;i=d;c[f>>2]=a;c[g>>2]=b;do if(c[f>>2]|0){if(Hv(c[f>>2]|0,37129,4)|0?Hv(c[f>>2]|0,37134,4)|0:0)break;c[f>>2]=(c[f>>2]|0)+4}while(0);c[h>>2]=Oi(c[f>>2]|0)|0;a:do if(c[h>>2]|0?c[(c[h>>2]|0)+20>>2]|0:0){c[i>>2]=0;while(1){if(!(c[(c[(c[h>>2]|0)+20>>2]|0)+(c[i>>2]<<2)>>2]|0))break a;if(!(sv(c[f>>2]|0,c[(c[(c[h>>2]|0)+20>>2]|0)+(c[i>>2]<<2)>>2]|0)|0))break;c[i>>2]=(c[i>>2]|0)+1}if(c[g>>2]|0)c[c[g>>2]>>2]=c[(c[(c[h>>2]|0)+20>>2]|0)+(c[i>>2]<<2)>>2];c[e>>2]=c[h>>2];j=c[e>>2]|0;l=d;return j|0}while(0);c[e>>2]=0;j=c[e>>2]|0;l=d;return j|0}function Ni(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[e>>2]=a;c[g>>2]=0;while(1){a=c[4368+(c[g>>2]<<2)>>2]|0;c[f>>2]=a;if(!a){h=6;break}if(!(sv(c[e>>2]|0,c[(c[f>>2]|0)+8>>2]|0)|0)){h=4;break}c[g>>2]=(c[g>>2]|0)+1}if((h|0)==4){c[d>>2]=c[f>>2];i=c[d>>2]|0;l=b;return i|0}else if((h|0)==6){c[d>>2]=0;i=c[d>>2]|0;l=b;return i|0}return 0}function Oi(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;b=l;l=l+32|0;if((l|0)>=(m|0))$(32);d=b+20|0;e=b+16|0;f=b+12|0;g=b+8|0;h=b+4|0;i=b;c[e>>2]=a;c[h>>2]=0;a:while(1){a=c[4368+(c[h>>2]<<2)>>2]|0;c[f>>2]=a;if(!a){j=10;break}c[g>>2]=c[(c[f>>2]|0)+20>>2];b:do if(c[g>>2]|0){c[i>>2]=0;while(1){if(!(c[(c[g>>2]|0)+(c[i>>2]<<2)>>2]|0))break b;if(!(sv(c[e>>2]|0,c[(c[g>>2]|0)+(c[i>>2]<<2)>>2]|0)|0)){j=7;break a}c[i>>2]=(c[i>>2]|0)+1}}while(0);c[h>>2]=(c[h>>2]|0)+1}if((j|0)==7){c[d>>2]=c[f>>2];k=c[d>>2]|0;l=b;return k|0}else if((j|0)==10){c[d>>2]=0;k=c[d>>2]|0;l=b;return k|0}return 0}function Pi(a){a=a|0;var b=0,d=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=Qi(c[d>>2]|0)|0;if(!(c[e>>2]|0)){f=37975;l=b;return f|0}f=c[(c[e>>2]|0)+8>>2]|0;l=b;return f|0}function Qi(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[e>>2]=a;c[e>>2]=Ri(c[e>>2]|0)|0;c[f>>2]=0;while(1){a=c[4368+(c[f>>2]<<2)>>2]|0;c[g>>2]=a;if(!a){h=6;break}if((c[e>>2]|0)==(c[c[g>>2]>>2]|0)){h=4;break}c[f>>2]=(c[f>>2]|0)+1}if((h|0)==4){c[d>>2]=c[g>>2];i=c[d>>2]|0;l=b;return i|0}else if((h|0)==6){c[d>>2]=0;i=c[d>>2]|0;l=b;return i|0}return 0}function Ri(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;l=b;return c[d>>2]|0}function Si(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+16|0;g=e+12|0;h=e+8|0;i=e+4|0;j=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if(c[h>>2]&-260|0)c[i>>2]=45;else c[i>>2]=Ti(j,c[g>>2]|0,c[h>>2]|0)|0;c[c[f>>2]>>2]=c[i>>2]|0?0:c[j>>2]|0;l=e;return c[i>>2]|0}function Ti(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;f=l;l=l+48|0;if((l|0)>=(m|0))$(48);g=f+36|0;h=f+32|0;i=f+28|0;j=f+24|0;k=f+20|0;n=f+16|0;o=f+12|0;p=f+8|0;q=f+4|0;r=f;c[g>>2]=b;c[h>>2]=d;c[i>>2]=e;c[j>>2]=0;c[k>>2]=((c[i>>2]&1|0)!=0^1^1)&1;c[n>>2]=((c[i>>2]&2|0)!=0^1^1)&1;c[o>>2]=c[k>>2]|0?512:1024;c[r>>2]=16+(c[o>>2]|0);c[r>>2]=((((c[r>>2]|0)+8-1|0)>>>0)/8|0)<<3;o=(c[r>>2]|0)+28|0;if(c[k>>2]|0)c[q>>2]=sf(o)|0;else c[q>>2]=pf(o)|0;if(!(c[q>>2]|0))c[j>>2]=Ct(c[(xu()|0)>>2]|0)|0;if((c[j>>2]|0)==0?(o=(c[q>>2]|0)+(c[r>>2]|0)|0,c[p>>2]=o,c[c[q>>2]>>2]=o,c[(c[q>>2]|0)+8>>2]=(c[r>>2]|0)-16+1,c[(c[q>>2]|0)+4>>2]=0,o=c[c[q>>2]>>2]|0,c[o>>2]=0,c[o+4>>2]=0,c[o+8>>2]=0,c[o+12>>2]=0,c[o+16>>2]=0,c[o+20>>2]=0,c[o+24>>2]=0,c[c[p>>2]>>2]=c[k>>2]|0?378630161:285677921,c[(c[p>>2]|0)+4>>2]=(c[r>>2]|0)+28,r=(c[p>>2]|0)+12|0,a[r>>0]=a[r>>0]&-2|c[k>>2]&1,k=(c[p>>2]|0)+12|0,a[k>>0]=a[k>>0]&-5|(((c[i>>2]&256|0)!=0^1^1)&1)<<2&255,c[n>>2]|0):0){switch(c[h>>2]|0){case 10:case 9:{c[(c[p>>2]|0)+24>>2]=128;break}case 311:case 308:{c[(c[p>>2]|0)+24>>2]=32;break}default:c[(c[p>>2]|0)+24>>2]=64}n=sf(c[(c[p>>2]|0)+24>>2]<<1)|0;c[(c[p>>2]|0)+20>>2]=n;if(!(c[(c[p>>2]|0)+20>>2]|0)){c[j>>2]=Ct(c[(xu()|0)>>2]|0)|0;Ui(c[q>>2]|0)}}if(((c[j>>2]|0)==0?(mn(),c[h>>2]|0):0)?(c[j>>2]=Vi(c[q>>2]|0,c[h>>2]|0)|0,c[j>>2]|0):0)Ui(c[q>>2]|0);if(c[j>>2]|0){s=c[j>>2]|0;l=f;return s|0}c[c[g>>2]>>2]=c[q>>2];s=c[j>>2]|0;l=f;return s|0}function Ui(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;e=l;l=l+80|0;if((l|0)>=(m|0))$(80);f=e+68|0;g=e+64|0;h=e+60|0;i=e+56|0;j=e+52|0;k=e+74|0;n=e+16|0;o=e+48|0;p=e+44|0;q=e+40|0;r=e+73|0;s=e+8|0;t=e+36|0;u=e+32|0;v=e+28|0;w=e+72|0;x=e;y=e+24|0;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(c[k>>2]|0)+16>>2];while(1){if(!(c[o>>2]|0))break;if((c[c[c[o>>2]>>2]>>2]|0)==(c[j>>2]|0)){r=4;break}c[o>>2]=c[(c[o>>2]|0)+4>>2]}if((r|0)==4){c[h>>2]=0;s=c[h>>2]|0;l=f;return s|0}c[n>>2]=Qi(c[j>>2]|0)|0;if(!(c[n>>2]|0)){c[g>>2]=c[j>>2];Ye(37139,g);c[p>>2]=5}if(((c[p>>2]|0)==0&(c[j>>2]|0)==1?Wg()|0:0)?(ch(37178),ah()|0):0)c[p>>2]=5;do if(!(c[p>>2]|0)){c[q>>2]=24+(c[(c[n>>2]|0)+44>>2]|0)-8;j=c[q>>2]|0;if(a[(c[k>>2]|0)+12>>0]&1|0)c[o>>2]=sf(j)|0;else c[o>>2]=pf(j)|0;if(c[o>>2]|0){c[c[o>>2]>>2]=c[n>>2];c[(c[o>>2]|0)+4>>2]=c[(c[k>>2]|0)+16>>2];c[(c[o>>2]|0)+8>>2]=c[q>>2];c[(c[k>>2]|0)+16>>2]=c[o>>2];xb[c[(c[c[o>>2]>>2]|0)+28>>2]&7]((c[o>>2]|0)+16|0,(d[(c[k>>2]|0)+12>>0]|0)>>>2&1|0?256:0);break}else{c[p>>2]=Ct(c[(xu()|0)>>2]|0)|0;break}}while(0);c[h>>2]=c[p>>2];s=c[h>>2]|0;l=f;return s|0}function Wi(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=l;l=l+32|0;if((l|0)>=(m|0))$(32);d=b+20|0;e=b+16|0;f=b+8|0;g=b;c[d>>2]=a;if(c[(c[c[d>>2]>>2]|0)+8>>2]|0){if(c[(c[d>>2]|0)+4>>2]|0)Xi(c[d>>2]|0,0,0);Qv(c[(c[c[d>>2]>>2]|0)+8>>2]|0)|0;c[(c[c[d>>2]>>2]|0)+8>>2]=0}c[e>>2]=c[d>>2];d=f;c[d>>2]=42;c[d+4>>2]=0;d=f;f=gx(c[e>>2]|0,0,c[d>>2]|0,c[d+4>>2]|0)|0;d=g;c[d>>2]=f;c[d+4>>2]=D;l=b;return}function Xi(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if(c[(c[c[f>>2]>>2]|0)+8>>2]|0){if(c[(c[f>>2]|0)+4>>2]|0?(Zv((c[f>>2]|0)+12|0,c[(c[f>>2]|0)+4>>2]|0,1,c[(c[c[f>>2]>>2]|0)+8>>2]|0)|0)!=1:0)Re(37187,630,37192);if(c[h>>2]|0?(Zv(c[g>>2]|0,c[h>>2]|0,1,c[(c[c[f>>2]>>2]|0)+8>>2]|0)|0)!=1:0)Re(37187,632,37192)}c[i>>2]=c[(c[c[f>>2]>>2]|0)+16>>2];while(1){j=(c[f>>2]|0)+4|0;if(!(c[i>>2]|0))break;if(c[j>>2]|0)zb[c[(c[c[i>>2]>>2]|0)+32>>2]&7]((c[i>>2]|0)+16|0,(c[f>>2]|0)+12|0,c[(c[f>>2]|0)+4>>2]|0);zb[c[(c[c[i>>2]>>2]|0)+32>>2]&7]((c[i>>2]|0)+16|0,c[g>>2]|0,c[h>>2]|0);c[i>>2]=c[(c[i>>2]|0)+4>>2]}c[j>>2]=0;l=e;return}function Yi(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;d=l;l=l+80|0;if((l|0)>=(m|0))$(80);e=d+16|0;f=d+8|0;g=d+24|0;h=d+20|0;i=d+28|0;c[g>>2]=a;c[h>>2]=b;if(Wg()|0){l=d;return}if(c[(c[c[g>>2]>>2]|0)+8>>2]|0){Ye(37201,d);l=d;return}c[17735]=(c[17735]|0)+1;b=c[h>>2]|0;c[f>>2]=c[17735];c[f+4>>2]=b;Su(i,49,37233,f)|0;f=Pv(i,37250)|0;c[(c[c[g>>2]>>2]|0)+8>>2]=f;if(c[(c[c[g>>2]>>2]|0)+8>>2]|0){l=d;return}c[e>>2]=i;Ye(37252,e);l=d;return}function Zi(b){b=b|0;var e=0,f=0,g=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+4|0;g=e;c[f>>2]=b;b=(c[c[f>>2]>>2]|0)+12|0;a[b>>0]=a[b>>0]&-3;c[(c[f>>2]|0)+4>>2]=0;c[g>>2]=c[(c[c[f>>2]>>2]|0)+16>>2];while(1){if(!(c[g>>2]|0))break;Uw((c[g>>2]|0)+16|0,0,c[(c[c[g>>2]>>2]|0)+44>>2]|0)|0;xb[c[(c[c[g>>2]>>2]|0)+28>>2]&7]((c[g>>2]|0)+16|0,(d[(c[c[f>>2]>>2]|0)+12>>0]|0)>>>2&1|0?256:0);c[g>>2]=c[(c[g>>2]|0)+4>>2]}if(!(c[(c[c[f>>2]>>2]|0)+20>>2]|0)){l=e;return}Xi(c[f>>2]|0,c[(c[c[f>>2]>>2]|0)+20>>2]|0,c[(c[c[f>>2]>>2]|0)+24>>2]|0);l=e;return}function _i(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;Ui(c[d>>2]|0);l=b;return}function $i(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;Xi(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);l=e;return}function aj(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+16|0;h=f+12|0;i=f+8|0;j=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[f+4>>2]=e;c[j>>2]=0;switch(c[h>>2]|0){case 5:{bj(c[g>>2]|0);break}case 32:{Yi(c[g>>2]|0,c[i>>2]|0);break}case 33:{Wi(c[g>>2]|0);break}default:c[j>>2]=61}l=f;return c[j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]|0?c[(c[f>>2]|0)+4>>2]|0:0){dh(37187,980,37324,0,37336);Ve(37357,d)}if(!(c[f>>2]|0)){g=0;l=b;return g|0}g=c[c[c[f>>2]>>2]>>2]|0;l=b;return g|0}function dj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d;f=d+16|0;g=d+12|0;h=d+8|0;i=d+4|0;c[g>>2]=a;c[h>>2]=b;c[i>>2]=c[(c[c[g>>2]>>2]|0)+16>>2];if(!(c[h>>2]|0)){if(!(c[i>>2]|0))Re(37187,816,37316);if(c[(c[i>>2]|0)+4>>2]|0)Ye(37277,e);c[f>>2]=yb[c[(c[c[i>>2]>>2]|0)+40>>2]&15]((c[i>>2]|0)+16|0)|0;j=c[f>>2]|0;l=d;return j|0}c[i>>2]=c[(c[c[g>>2]>>2]|0)+16>>2];while(1){if(!(c[i>>2]|0)){k=11;break}n=c[i>>2]|0;if((c[c[c[i>>2]>>2]>>2]|0)==(c[h>>2]|0))break;c[i>>2]=c[n+4>>2]}if((k|0)==11)Re(37187,816,37316);c[f>>2]=yb[c[(c[n>>2]|0)+40>>2]&15]((c[i>>2]|0)+16|0)|0;j=c[f>>2]|0;l=d;return j|0}function ej(a){a=a|0;var b=0,d=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=Qi(c[d>>2]|0)|0;if(!(c[e>>2]|0)){f=0;l=b;return f|0}f=c[(c[e>>2]|0)+24>>2]|0;l=b;return f|0}function fj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if(c[(c[c[f>>2]>>2]|0)+20>>2]|0){c[i>>2]=gj(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;if(!(c[i>>2]|0))Zi(c[f>>2]|0)}else c[i>>2]=70;l=e;return c[i>>2]|0}function gj(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;g=l;l=l+48|0;if((l|0)>=(m|0))$(48);h=g+32|0;i=g+28|0;j=g+24|0;k=g+20|0;n=g+16|0;o=g+12|0;p=g+8|0;q=g+4|0;r=g;c[i>>2]=b;c[j>>2]=e;c[k>>2]=f;c[o>>2]=cj(c[i>>2]|0)|0;c[p>>2]=0;if(!(c[o>>2]|0)){c[h>>2]=5;s=c[h>>2]|0;l=g;return s|0}do if((c[k>>2]|0)>>>0>(c[(c[c[i>>2]>>2]|0)+24>>2]|0)>>>0){c[p>>2]=sf(ej(c[o>>2]|0)|0)|0;if(c[p>>2]|0){hj(c[o>>2]|0,c[p>>2]|0,c[j>>2]|0,c[k>>2]|0);c[j>>2]=c[p>>2];c[k>>2]=ej(c[o>>2]|0)|0;if((c[k>>2]|0)>>>0<=(c[(c[c[i>>2]>>2]|0)+24>>2]|0)>>>0)break;Se(37408,37187,716,37441)}else{c[h>>2]=Ct(c[(xu()|0)>>2]|0)|0;s=c[h>>2]|0;l=g;return s|0}}while(0);Uw(c[(c[c[i>>2]>>2]|0)+20>>2]|0,0,c[(c[c[i>>2]>>2]|0)+24>>2]<<1|0)|0;c[q>>2]=c[(c[c[i>>2]>>2]|0)+20>>2];c[r>>2]=(c[(c[c[i>>2]>>2]|0)+20>>2]|0)+(c[(c[c[i>>2]>>2]|0)+24>>2]|0);_w(c[q>>2]|0,c[j>>2]|0,c[k>>2]|0)|0;_w(c[r>>2]|0,c[j>>2]|0,c[k>>2]|0)|0;c[n>>2]=0;while(1){if((c[n>>2]|0)>=(c[(c[c[i>>2]>>2]|0)+24>>2]|0))break;k=(c[q>>2]|0)+(c[n>>2]|0)|0;a[k>>0]=(d[k>>0]|0)^54;k=(c[r>>2]|0)+(c[n>>2]|0)|0;a[k>>0]=(d[k>>0]|0)^92;c[n>>2]=(c[n>>2]|0)+1}vf(c[p>>2]|0);c[h>>2]=0;s=c[h>>2]|0;l=g;return s|0}function hj(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f;h=f+28|0;i=f+24|0;j=f+20|0;k=f+16|0;n=f+12|0;o=f+8|0;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;if((c[h>>2]|0)==2){Xl(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0);l=f;return}if((c[h>>2]|0)==3?(Wg()|0)==0:0){bl(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0);l=f;return}if(((c[h>>2]|0)==1?Wg()|0:0)?(ch(37178),ah()|0):0)Yg();c[o>>2]=Ti(n,c[h>>2]|0,0)|0;if(c[o>>2]|0){e=c[h>>2]|0;d=Bt(ij(c[o>>2]|0)|0)|0;c[g>>2]=e;c[g+4>>2]=d;Xe(37457,g)}Xi(c[n>>2]|0,c[j>>2]|0,c[k>>2]|0);bj(c[n>>2]|0);k=c[i>>2]|0;i=dj(c[n>>2]|0,c[h>>2]|0)|0;_w(k|0,i|0,ej(c[h>>2]|0)|0)|0;Ui(c[n>>2]|0);l=f;return}function ij(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=jj(32,c[d>>2]|0)|0;l=b;return a|0}function jj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=kj(c[e>>2]|0,c[f>>2]|0)|0;l=d;return b|0}function kj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){g=0;l=d;return g|0}g=(c[e>>2]&127)<<24|c[f>>2]&65535;l=d;return g|0}function lj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;aj(c[e>>2]|0,5,0,0)|0;b=dj(c[e>>2]|0,c[f>>2]|0)|0;l=d;return b|0}function mj(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;g=l;l=l+48|0;if((l|0)>=(m|0))$(48);h=g+32|0;i=g+28|0;j=g+24|0;k=g+20|0;n=g+16|0;o=g+12|0;p=g+8|0;q=g+4|0;r=g;c[i>>2]=a;c[j>>2]=b;c[k>>2]=d;c[n>>2]=e;c[o>>2]=f;if((c[n>>2]|0)==0|(c[o>>2]|0)<0){c[h>>2]=45;s=c[h>>2]|0;l=g;return s|0}if(c[j>>2]&-3|0){c[h>>2]=45;s=c[h>>2]|0;l=g;return s|0}c[p>>2]=((c[j>>2]&2|0)!=0^1^1)&1;if((c[p>>2]|0)!=0&(c[o>>2]|0)<1){c[h>>2]=45;s=c[h>>2]|0;l=g;return s|0}if((c[i>>2]|0)!=2|(c[p>>2]|0)!=0){if(((c[i>>2]|0)==1?Wg()|0:0)?(ch(37178),ah()|0):0)Yg();c[r>>2]=Ti(q,c[i>>2]|0,c[p>>2]|0?2:0)|0;if(c[r>>2]|0){c[h>>2]=c[r>>2];s=c[h>>2]|0;l=g;return s|0}do if(c[p>>2]|0){c[r>>2]=fj(c[q>>2]|0,(c[(c[n>>2]|0)+12>>2]|0)+(c[(c[n>>2]|0)+4>>2]|0)|0,c[(c[n>>2]|0)+8>>2]|0)|0;if(!(c[r>>2]|0)){c[n>>2]=(c[n>>2]|0)+16;c[o>>2]=(c[o>>2]|0)+-1;break}Ui(c[q>>2]|0);c[h>>2]=c[r>>2];s=c[h>>2]|0;l=g;return s|0}while(0);while(1){t=c[q>>2]|0;if(!(c[o>>2]|0))break;Xi(t,(c[(c[n>>2]|0)+12>>2]|0)+(c[(c[n>>2]|0)+4>>2]|0)|0,c[(c[n>>2]|0)+8>>2]|0);c[n>>2]=(c[n>>2]|0)+16;c[o>>2]=(c[o>>2]|0)+-1}bj(t);t=c[k>>2]|0;r=dj(c[q>>2]|0,c[i>>2]|0)|0;_w(t|0,r|0,ej(c[i>>2]|0)|0)|0;Ui(c[q>>2]|0)}else Yl(c[k>>2]|0,c[n>>2]|0,c[o>>2]|0);c[h>>2]=0;s=c[h>>2]|0;l=g;return s|0}function nj(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=cj(c[d>>2]|0)|0;l=b;return a|0}function oj(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=ej(c[d>>2]|0)|0;l=b;return a|0}function pj(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+24|0;h=f+20|0;i=f+16|0;j=f+12|0;k=f+8|0;n=f+4|0;o=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;a:do switch(c[h>>2]|0){case 8:{if((c[i>>2]|0)!=0|(c[j>>2]|0)!=0){c[k>>2]=45;break a}else{c[k>>2]=qj(c[g>>2]|0)|0;break a}break}case 10:{c[k>>2]=qj(c[g>>2]|0)|0;if(!(c[k>>2]|0)){c[n>>2]=rj(c[g>>2]|0,o,0)|0;if(c[i>>2]|0?(c[c[j>>2]>>2]|0)>>>0>=(c[o>>2]|0)>>>0:0){_w(c[i>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;c[c[j>>2]>>2]=c[o>>2];break a}if((c[i>>2]|0)==0&(c[j>>2]|0)!=0){c[c[j>>2]>>2]=c[o>>2];break a}if(c[i>>2]|0){c[k>>2]=66;break a}else{c[k>>2]=45;break a}}break}case 57:{if(c[j>>2]|0)p=c[c[j>>2]>>2]|0;else p=0;c[k>>2]=tj(sj(c[g>>2]|0,p,0)|0)|0;break}default:c[k>>2]=61}while(0);l=f;return c[k>>2]|0}function qj(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+8|0;f=d+4|0;g=d;c[f>>2]=b;c[g>>2]=Qi(c[f>>2]|0)|0;if(c[g>>2]|0?(a[(c[g>>2]|0)+4>>0]&1|0)==0:0){c[e>>2]=0;h=c[e>>2]|0;l=d;return h|0}c[e>>2]=5;h=c[e>>2]|0;l=d;return h|0}function rj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e;g=e+20|0;h=e+16|0;i=e+12|0;j=e+8|0;k=e+4|0;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[k>>2]=0;c[j>>2]=Qi(c[g>>2]|0)|0;if(!(c[j>>2]|0)){c[f>>2]=c[g>>2];Xe(37493,f)}if(c[h>>2]|0)c[c[h>>2]>>2]=c[(c[j>>2]|0)+16>>2];if(!(c[i>>2]|0)){n=c[j>>2]|0;o=n+12|0;p=c[o>>2]|0;c[k>>2]=p;q=c[k>>2]|0;l=e;return q|0}c[c[i>>2]>>2]=c[(c[j>>2]|0)+24>>2];n=c[j>>2]|0;o=n+12|0;p=c[o>>2]|0;c[k>>2]=p;q=c[k>>2]|0;l=e;return q|0}function sj(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+16|0;h=f+12|0;i=f+8|0;j=f+4|0;k=f;c[g>>2]=b;c[h>>2]=d;c[i>>2]=e;c[j>>2]=0;c[k>>2]=Qi(c[g>>2]|0)|0;if((c[k>>2]|0?(a[(c[k>>2]|0)+4>>0]&1|0)==0:0)?c[(c[k>>2]|0)+48>>2]|0:0){c[j>>2]=ub[c[(c[k>>2]|0)+48>>2]&63](c[g>>2]|0,c[h>>2]|0,c[i>>2]|0)|0;n=c[j>>2]|0;o=uj(n)|0;l=f;return o|0}if(c[k>>2]|0)p=(c[(c[k>>2]|0)+48>>2]|0)!=0;else p=0;c[j>>2]=p?5:69;if(!(c[i>>2]|0)){n=c[j>>2]|0;o=uj(n)|0;l=f;return o|0}p=c[i>>2]|0;i=c[g>>2]|0;if(c[k>>2]|0?!(a[(c[k>>2]|0)+4>>0]&1|0):0)q=38046;else q=c[k>>2]|0?38007:38026;Eb[p&1](43214,i,38068,q);n=c[j>>2]|0;o=uj(n)|0;l=f;return o|0}function tj(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;l=b;return c[d>>2]&65535|0}function uj(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=kj(1,c[d>>2]|0)|0;l=b;return a|0}function vj(){return 0}function wj(){return 0}function xj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;c[17736]=c[e>>2];c[17737]=c[f>>2];l=d;return}function yj(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+16|0;h=f+12|0;i=f+8|0;j=f+4|0;k=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;c[k>>2]=zj(c[g>>2]|0,1,c[h>>2]|0,c[i>>2]|0,c[j>>2]|0)|0;Aj(10);l=f;return c[k>>2]|0}function zj(a,b,d,f,g){a=a|0;b=b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(c[z>>2]|0)|0)>>>0<(c[y>>2]|0)>>>0)break;E=(c[C>>2]|0)+(c[x>>2]<<2)|0;c[E>>2]=(c[E>>2]|0)-(c[y>>2]|0)}if(!((c[(c[C>>2]|0)+(c[x>>2]<<2)>>2]|0)+(c[z>>2]|0)|0))break;c[x>>2]=(c[x>>2]|0)+1}if(!(c[y>>2]|0)){eo(c[s>>2]|0,c[r>>2]|0,c[z>>2]|0);c[B>>2]=(c[B>>2]|0)+1;go(c[t>>2]|0,c[s>>2]|0,1);So(c[w>>2]|0,c[u>>2]|0,c[t>>2]|0,c[s>>2]|0);if((vo(c[w>>2]|0,1)|0)==0?Bj(c[s>>2]|0,5,B)|0:0){if(!(mo(c[s>>2]|0,(c[k>>2]|0)-1-(c[n>>2]|0)|0)|0)){F=24;break}if(!(c[p>>2]|0)){F=28;break a}if(!(Db[c[p>>2]&7](c[q>>2]|0,c[s>>2]|0)|0)){F=28;break a}Aj(47)}E=(c[D>>2]|0)+1|0;c[D>>2]=E;if((E|0)==10){Aj(46);c[D>>2]=0}}c[z>>2]=(c[z>>2]|0)+2}if((F|0)==24){F=0;Aj(10);Ye(37578,i)}Aj(58)}if((F|0)==28){Dp(c[u>>2]|0);Dp(c[v>>2]|0);Dp(c[w>>2]|0);Dp(c[t>>2]|0);Dp(c[r>>2]|0);vf(c[C>>2]|0);l=h;return c[s>>2]|0}return 0}function Aj(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;if(!(c[17736]|0)){l=b;return}vb[c[17736]&15](c[17737]|0,37522,c[d>>2]|0,0,0);l=b;return}function Bj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;e=l;l=l+64|0;if((l|0)>=(m|0))$(64);f=e+52|0;g=e+48|0;h=e+44|0;i=e+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)+1}if(wo(x,c[n>>2]|0)|0){v=23;break}}Aj(43);c[q>>2]=(c[q>>2]|0)+1}if((v|0)==11)Se(37608,37680,951,37691);else if((v|0)==22){c[t>>2]=1;y=c[i>>2]|0;Dp(y);z=c[j>>2]|0;Dp(z);A=c[k>>2]|0;Dp(A);B=c[n>>2]|0;Dp(B);C=c[p>>2]|0;Dp(C);D=c[o>>2]|0;Dp(D);E=c[t>>2]|0;l=e;return E|0}else if((v|0)==23){y=c[i>>2]|0;Dp(y);z=c[j>>2]|0;Dp(z);A=c[k>>2]|0;Dp(A);B=c[n>>2]|0;Dp(B);C=c[p>>2]|0;Dp(C);D=c[o>>2]|0;Dp(D);E=c[t>>2]|0;l=e;return E|0}return 0}function Cj(a,b,d,f,g){a=a|0;b=b|0;d=d|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;h=l;l=l+48|0;if((l|0)>=(m|0))$(48);i=h+40|0;j=h+36|0;k=h+32|0;n=h+28|0;o=h+24|0;p=h+20|0;q=h+16|0;r=h+12|0;s=h+8|0;t=h+4|0;u=h;c[j>>2]=a;c[k>>2]=b;c[n>>2]=d;c[o>>2]=f;c[p>>2]=g;c[s>>2]=0;c[q>>2]=0;while(1){g=e[16568+(c[q>>2]<<1)>>1]|0;c[r>>2]=g;v=c[j>>2]|0;if(!g)break;if(Eo(v,c[r>>2]|0)|0){w=4;break}c[q>>2]=(c[q>>2]|0)+1}if((w|0)==4){c[i>>2]=((vo(c[j>>2]|0,c[r>>2]|0)|0)!=0^1)&1;x=c[i>>2]|0;l=h;return x|0}c[t>>2]=Lp(v)|0;c[u>>2]=Lp(c[j>>2]|0)|0;go(c[u>>2]|0,c[j>>2]|0,1);So(c[t>>2]|0,c[k>>2]|0,c[u>>2]|0,c[j>>2]|0);Dp(c[u>>2]|0);u=(vo(c[t>>2]|0,1)|0)!=0;Dp(c[t>>2]|0);if(u){Aj(46);c[i>>2]=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j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;e=l;l=l+48|0;if((l|0)>=(m|0))$(48);f=e+36|0;g=e+32|0;h=e+28|0;i=e+24|0;j=e+20|0;k=e+16|0;n=e+12|0;o=e+8|0;p=e+4|0;q=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[i>>2]=0;c[o>>2]=5;c[p>>2]=0;c[q>>2]=0;if(c[f>>2]|0)r=(Uf(c[f>>2]|0)|0)-1|0;else r=0;c[n>>2]=r;while(1){if((c[n>>2]|0)<=0)break;c[j>>2]=Xf(c[f>>2]|0,c[n>>2]|0,k)|0;a:do if(c[j>>2]|0)do switch(c[k>>2]|0){case 3:{if((Jv(c[j>>2]|0,37700,3)|0)==0&(c[o>>2]|0)==5){c[o>>2]=4;c[p>>2]=c[p>>2]|4;break a}if((Jv(c[j>>2]|0,37704,3)|0)==0&(c[o>>2]|0)==5){c[o>>2]=0;c[p>>2]=c[p>>2]|16;break a}if(c[q>>2]|0)break a;c[i>>2]=72;break a;break}case 4:{if(!(Jv(c[j>>2]|0,37708,4)|0)){c[p>>2]=c[p>>2]|1024;break a}if((Jv(c[j>>2]|0,37713,4)|0)==0&(c[o>>2]|0)==5){c[o>>2]=3;c[p>>2]=c[p>>2]|4;break a}if(!(Jv(c[j>>2]|0,49930,4)|0)){c[o>>2]=0;c[p>>2]=c[p>>2]|8192;break a}if(c[q>>2]|0)break a;c[i>>2]=72;break a;break}case 5:{if(!(Jv(c[j>>2]|0,49924,5)|0)){c[o>>2]=0;c[p>>2]=c[p>>2]|4096;break a}if((Jv(c[j>>2]|0,37718,5)|0)==0&(c[o>>2]|0)==5){c[o>>2]=1;c[p>>2]=c[p>>2]|4;break a}if(!(Jv(c[j>>2]|0,37724,5)|0)){c[p>>2]=c[p>>2]|512;break a}if(c[q>>2]|0)break a;c[i>>2]=72;break a;break}case 6:{if(!(Jv(c[j>>2]|0,37730,6)|0)){c[p>>2]=c[p>>2]|2048;break a}if(c[q>>2]|0)break a;c[i>>2]=72;break a;break}case 7:{if(!(Jv(c[j>>2]|0,37737,7)|0)){c[p>>2]=c[p>>2]|2;break a}if((Jv(c[j>>2]|0,37745,7)|0)==0|(c[q>>2]|0)!=0)break a;c[i>>2]=72;break a;break}case 8:{if(!(Jv(c[j>>2]|0,41808,8)|0)){c[p>>2]=c[p>>2]|64;break a}if(c[q>>2]|0)break a;c[i>>2]=72;break a;break}case 9:{if((Jv(c[j>>2]|0,37753,9)|0)==0&(c[o>>2]|0)==5){c[o>>2]=2;c[p>>2]=c[p>>2]|4;break a}if(c[q>>2]|0)break a;c[i>>2]=72;break a;break}case 10:{if(!(Jv(c[j>>2]|0,37763,10)|0)){c[q>>2]=1;break a}if(!(Jv(c[j>>2]|0,37774,10)|0)){c[p>>2]=c[p>>2]|16384;break a}if(c[q>>2]|0)break a;c[i>>2]=72;break a;break}case 11:{if(!(Jv(c[j>>2]|0,37785,11)|0)){c[p>>2]=c[p>>2]|1;break a}if(!(Jv(c[j>>2]|0,37797,11)|0)){c[p>>2]=c[p>>2]|128;break a}if(c[q>>2]|0)break a;c[i>>2]=72;break a;break}case 13:{if(!(Jv(c[j>>2]|0,37809,13)|0)){c[p>>2]=c[p>>2]|256;break a}if(!(Jv(c[j>>2]|0,48942,13)|0)){c[p>>2]=c[p>>2]|32;break a}if(c[q>>2]|0)break a;c[i>>2]=72;break a;break}default:{if(c[q>>2]|0)break a;c[i>>2]=72;break a}}while(0);while(0);c[n>>2]=(c[n>>2]|0)+-1}if(c[g>>2]|0)c[c[g>>2]>>2]=c[p>>2];if(!(c[h>>2]|0)){s=c[i>>2]|0;l=e;return s|0}c[c[h>>2]>>2]=c[o>>2];s=c[i>>2]|0;l=e;return s|0}function Gj(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0;e=l;l=l+80|0;if((l|0)>=(m|0))$(80);f=e+16|0;g=e+12|0;h=e+8|0;i=e+20|0;j=e+4|0;k=e;c[g>>2]=b;c[h>>2]=d;c[c[h>>2]>>2]=0;c[g>>2]=Tf(c[g>>2]|0,37823,0)|0;if(!(c[g>>2]|0)){c[f>>2]=0;n=c[f>>2]|0;l=e;return n|0}c[j>>2]=Xf(c[g>>2]|0,1,k)|0;if((c[j>>2]|0)==0|(c[k>>2]|0)>>>0>=49){Rf(c[g>>2]|0);c[f>>2]=65;n=c[f>>2]|0;l=e;return n|0}else{_w(i|0,c[j>>2]|0,c[k>>2]|0)|0;a[i+(c[k>>2]|0)>>0]=0;k=wv(i,0,0)|0;c[c[h>>2]>>2]=k;Rf(c[g>>2]|0);c[f>>2]=0;n=c[f>>2]|0;l=e;return n|0}return 0}function Hj(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0;e=l;l=l+80|0;if((l|0)>=(m|0))$(80);f=e+16|0;g=e+12|0;h=e+8|0;i=e+20|0;j=e+4|0;k=e;c[g>>2]=b;c[h>>2]=d;c[c[h>>2]>>2]=0;c[g>>2]=Tf(c[g>>2]|0,37829,0)|0;if(!(c[g>>2]|0)){c[c[h>>2]>>2]=65537;c[f>>2]=0;n=c[f>>2]|0;l=e;return n|0}c[j>>2]=Xf(c[g>>2]|0,1,k)|0;if((c[j>>2]|0)==0|(c[k>>2]|0)>>>0>=49){Rf(c[g>>2]|0);c[f>>2]=65;n=c[f>>2]|0;l=e;return n|0}else{_w(i|0,c[j>>2]|0,c[k>>2]|0)|0;a[i+(c[k>>2]|0)>>0]=0;k=wv(i,0,0)|0;c[c[h>>2]>>2]=k;Rf(c[g>>2]|0);c[f>>2]=0;n=c[f>>2]|0;l=e;return n|0}return 0}function Ij(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;f=l;l=l+48|0;if((l|0)>=(m|0))$(48);g=f+32|0;h=f+28|0;i=f+24|0;j=f+20|0;k=f+16|0;n=f+12|0;o=f+8|0;p=f+4|0;q=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;c[n>>2]=0;c[o>>2]=0;c[p>>2]=0;c[c[i>>2]>>2]=0;if(c[j>>2]|0)c[c[j>>2]>>2]=0;c[n>>2]=Tf(c[g>>2]|0,37839,0)|0;do if(c[n>>2]|0){c[o>>2]=Vf(c[n>>2]|0,1)|0;if(!(c[o>>2]|0)){c[k>>2]=68;break}c[p>>2]=_f(c[o>>2]|0,0)|0;if(!(c[p>>2]|0)){c[k>>2]=65;break}if(!(Fu(c[p>>2]|0,47178)|0)){Rf(c[o>>2]|0);c[o>>2]=Vf(c[n>>2]|0,2)|0;if(!(c[o>>2]|0)){c[k>>2]=65;break}vf(c[p>>2]|0);c[p>>2]=_f(c[o>>2]|0,0)|0;if(!(c[p>>2]|0)){c[k>>2]=65;break}}c[q>>2]=0;while(1){if(!(c[(c[h>>2]|0)+(c[q>>2]<<2)>>2]|0))break;if(!(sv(c[p>>2]|0,c[(c[h>>2]|0)+(c[q>>2]<<2)>>2]|0)|0))break;c[q>>2]=(c[q>>2]|0)+1}if(!(c[(c[h>>2]|0)+(c[q>>2]<<2)>>2]|0)){c[k>>2]=70;break}if(c[j>>2]|0){if(!(Fu(c[p>>2]|0,49924)|0))c[c[j>>2]>>2]=4096;if(!(Fu(c[p>>2]|0,49930)|0))c[c[j>>2]>>2]=8192}c[c[i>>2]>>2]=c[o>>2];c[o>>2]=0;c[k>>2]=0}else c[k>>2]=65;while(0);vf(c[p>>2]|0);Rf(c[o>>2]|0);Rf(c[n>>2]|0);l=f;return c[k>>2]|0}function Jj(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;f=l;l=l+48|0;if((l|0)>=(m|0))$(48);g=f+44|0;h=f+40|0;i=f+36|0;j=f+32|0;k=f+28|0;n=f+24|0;o=f+20|0;p=f+16|0;q=f+12|0;r=f+8|0;s=f+4|0;t=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;c[k>>2]=0;c[n>>2]=0;c[o>>2]=0;c[p>>2]=0;c[r>>2]=0;c[c[i>>2]>>2]=0;c[n>>2]=Tf(c[g>>2]|0,40951,0)|0;do if(c[n>>2]|0){c[o>>2]=Vf(c[n>>2]|0,1)|0;if(!(c[o>>2]|0)){c[k>>2]=68;break}c[p>>2]=_f(c[o>>2]|0,0)|0;if(!(c[p>>2]|0)){c[k>>2]=65;break}if(!(Fu(c[p>>2]|0,47178)|0)){c[k>>2]=Fj(c[o>>2]|0,r,(c[j>>2]|0)+8|0)|0;if(c[k>>2]|0)break;if((c[(c[j>>2]|0)+8>>2]|0)==4){c[k>>2]=70;break}if((c[(c[j>>2]|0)+8>>2]|0)==3){Rf(c[o>>2]|0);c[o>>2]=Tf(c[n>>2]|0,37847,0)|0;if(c[o>>2]|0){c[t>>2]=Xf(c[o>>2]|0,1,q)|0;if(c[t>>2]|0){g=Kj(c[t>>2]|0,c[q>>2]|0)|0;c[(c[j>>2]|0)+16>>2]=g;if(!(c[(c[j>>2]|0)+16>>2]|0))c[k>>2]=5}else c[k>>2]=68;if(c[k>>2]|0)break}Rf(c[o>>2]|0);c[o>>2]=Tf(c[n>>2]|0,37857,0)|0;if(c[o>>2]|0){c[t>>2]=Xf(c[o>>2]|0,1,q)|0;do if(c[t>>2]|0){if((c[q>>2]|0)>>>0>0){g=pf(c[q>>2]|0)|0;c[(c[j>>2]|0)+20>>2]=g;if(c[(c[j>>2]|0)+20>>2]|0){_w(c[(c[j>>2]|0)+20>>2]|0,c[t>>2]|0,c[q>>2]|0)|0;c[(c[j>>2]|0)+24>>2]=c[q>>2];break}else{c[k>>2]=Et()|0;break}}}else c[k>>2]=68;while(0);if(c[k>>2]|0)break}}c[s>>2]=2;a:while(1){Rf(c[o>>2]|0);g=Vf(c[n>>2]|0,c[s>>2]|0)|0;c[o>>2]=g;if(!g)break;c[t>>2]=Xf(c[o>>2]|0,0,q)|0;if(!((c[q>>2]|0)==9?!(Jv(c[t>>2]|0,37847,9)|0):0))u=30;do if((u|0)==30){u=0;if((c[q>>2]|0)==5?(Jv(c[t>>2]|0,37857,5)|0)==0:0)break;if((c[q>>2]|0)!=15)break a;if(Jv(c[t>>2]|0,37863,15)|0)break a}while(0);c[s>>2]=(c[s>>2]|0)+1}if(!(c[o>>2]|0)){c[k>>2]=68;break}vf(c[p>>2]|0);c[p>>2]=_f(c[o>>2]|0,0)|0;if(!(c[p>>2]|0)){c[k>>2]=65;break}}else c[r>>2]=c[r>>2]|8;c[s>>2]=0;while(1){if(!(c[(c[h>>2]|0)+(c[s>>2]<<2)>>2]|0))break;if(!(sv(c[p>>2]|0,c[(c[h>>2]|0)+(c[s>>2]<<2)>>2]|0)|0))break;c[s>>2]=(c[s>>2]|0)+1}if(c[(c[h>>2]|0)+(c[s>>2]<<2)>>2]|0){c[c[i>>2]>>2]=c[o>>2];c[o>>2]=0;g=(c[j>>2]|0)+12|0;c[g>>2]=c[g>>2]|c[r>>2];c[k>>2]=0;break}else{c[k>>2]=70;break}}else c[k>>2]=65;while(0);vf(c[p>>2]|0);Rf(c[o>>2]|0);Rf(c[n>>2]|0);l=f;return c[k>>2]|0}function Kj(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+16|0;g=e+12|0;h=e+8|0;i=e+4|0;j=e;c[f>>2]=b;c[g>>2]=d;c[i>>2]=0;while(1){if(!(c[4400+(c[i>>2]<<3)>>2]|0))break;d=hv(c[4400+(c[i>>2]<<3)>>2]|0)|0;if((d|0)==(c[g>>2]|0)?(Jv(c[4400+(c[i>>2]<<3)>>2]|0,c[f>>2]|0,c[g>>2]|0)|0)==0:0)break;c[i>>2]=(c[i>>2]|0)+1}if(c[4400+(c[i>>2]<<3)>>2]|0){c[h>>2]=c[4400+(c[i>>2]<<3)+4>>2];k=c[h>>2]|0;l=e;return k|0}c[j>>2]=pf((c[g>>2]|0)+1|0)|0;if(c[j>>2]|0){_w(c[j>>2]|0,c[f>>2]|0,c[g>>2]|0)|0;a[(c[j>>2]|0)+(c[g>>2]|0)>>0]=0;c[h>>2]=Li(c[j>>2]|0)|0;vf(c[j>>2]|0);k=c[h>>2]|0;l=e;return k|0}else{c[h>>2]=0;k=c[h>>2]|0;l=e;return k|0}return 0}function Lj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[c[f>>2]>>2]=c[g>>2];c[(c[f>>2]|0)+4>>2]=c[h>>2];c[(c[f>>2]|0)+8>>2]=5;c[(c[f>>2]|0)+12>>2]=0;c[(c[f>>2]|0)+16>>2]=2;c[(c[f>>2]|0)+20>>2]=0;c[(c[f>>2]|0)+24>>2]=0;c[(c[f>>2]|0)+28>>2]=20;c[(c[f>>2]|0)+32>>2]=0;c[(c[f>>2]|0)+36>>2]=0;l=e;return}function Mj(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;vf(c[(c[d>>2]|0)+20>>2]|0);l=b;return} -function gq(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;i=l;l=l+64|0;if((l|0)>=(m|0))$(64);j=i+56|0;k=i+52|0;n=i+48|0;o=i+44|0;p=i+40|0;q=i+36|0;r=i+32|0;s=i+28|0;t=i+24|0;u=i+20|0;v=i+16|0;w=i+12|0;x=i+8|0;y=i+4|0;z=i;A=i+60|0;c[k>>2]=b;c[n>>2]=e;c[o>>2]=f;c[p>>2]=g;c[q>>2]=h;c[u>>2]=c[(c[(c[k>>2]|0)+12>>2]|0)+20>>2];c[v>>2]=c[(c[(c[k>>2]|0)+12>>2]|0)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];c[k>>2]=c[o>>2]}while(1){if(!(c[i>>2]|0))break;o=c[k>>2]|0;c[k>>2]=o+1;n=a[o>>0]|0;o=c[j>>2]|0;c[j>>2]=o+1;a[o>>0]=n;c[i>>2]=(c[i>>2]|0)+-1}l=f;return}function jq(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;h=l;l=l+64|0;if((l|0)>=(m|0))$(64);i=h+52|0;j=h+48|0;k=h+44|0;n=h+40|0;o=h+36|0;p=h+32|0;q=h+28|0;r=h+24|0;s=h+20|0;t=h+16|0;u=h+12|0;v=h+8|0;w=h+4|0;x=h;c[j>>2]=b;c[k>>2]=d;c[n>>2]=e;c[o>>2]=f;c[p>>2]=g;c[s>>2]=c[(c[(c[j>>2]|0)+12>>2]|0)+20>>2];c[t>>2]=c[(c[(c[j>>2]|0)+12>>2]|0)+40>>2];c[u>>2]=((c[p>>2]|0)>>>0)/((c[s>>2]|0)>>>0)|0;if((c[n>>2]|0)>>>0<(c[p>>2]|0)>>>0){c[i>>2]=200;y=c[i>>2]|0;l=h;return y|0}do if(((c[p>>2]|0)>>>0)%((c[s>>2]|0)>>>0)|0|0){if((c[p>>2]|0)>>>0>(c[s>>2]|0)>>>0?c[(c[j>>2]|0)+52>>2]&4|0:0)break;c[i>>2]=139;y=c[i>>2]|0;l=h;return y|0}while(0);c[v>>2]=0;if(c[(c[j>>2]|0)+52>>2]&4|0?(c[p>>2]|0)>>>0>(c[s>>2]|0)>>>0:0){c[u>>2]=(c[u>>2]|0)+-1;if(!(((c[p>>2]|0)>>>0)%((c[s>>2]|0)>>>0)|0))c[u>>2]=(c[u>>2]|0)+-1;iq((c[j>>2]|0)+96|0,(c[j>>2]|0)+64|0,c[s>>2]|0)}a:do if(c[(c[j>>2]|0)+20+12>>2]|0){vb[c[(c[j>>2]|0)+20+12>>2]&15]((c[j>>2]|0)+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>2]|0)+64+1|0,c[i>>2]|0,c[j>>2]|0)|0;Uw((c[h>>2]|0)+64+(1+(c[j>>2]|0))|0,0,c[k>>2]|0)|0;k=(c[h>>2]|0)+128+56|0;a[k>>0]=a[k>>0]&-2|1;c[g>>2]=0;o=c[g>>2]|0;l=f;return o|0}return 0}function mq(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;h=l;l=l+96|0;if((l|0)>=(m|0))$(96);i=h+64|0;j=h+60|0;k=h+56|0;n=h+52|0;o=h+48|0;p=h+40|0;q=h+72|0;r=h+36|0;s=h+32|0;t=h+28|0;u=h+24|0;v=h+20|0;w=h+16|0;x=h+68|0;y=h;z=h+12|0;A=h+8|0;c[j>>2]=b;c[k>>2]=e;c[n>>2]=f;c[o>>2]=g;c[h+44>>2]=16;c[p>>2]=c[(c[(c[j>>2]|0)+12>>2]|0)+36>>2];c[r>>2]=0;c[s>>2]=c[(c[j>>2]|0)+128+36>>2];if((c[n>>2]|0)==0?!((c[s>>2]|0)!=0&(c[o>>2]|0)!=0):0){c[i>>2]=0;B=c[i>>2]|0;l=h;return B|0}a:do{b:do if((c[s>>2]|0)>>>0>0?1:((c[n>>2]|0)+(c[s>>2]|0)|0)>>>0<16)while(1){if(!(c[n>>2]|0?(c[s>>2]|0)>>>0<16:0))break b;g=c[k>>2]|0;c[k>>2]=g+1;f=a[g>>0]|0;g=c[s>>2]|0;c[s>>2]=g+1;a[(c[j>>2]|0)+128+20+g>>0]=f;c[n>>2]=(c[n>>2]|0)+-1}while(0);c:do if(!(c[n>>2]|0)){if(!(c[o>>2]|0))break a;while(1){if((c[s>>2]|0)>>>0>=16)break c;f=c[s>>2]|0;c[s>>2]=f+1;a[(c[j>>2]|0)+128+20+f>>0]=0}}while(0);if((c[s>>2]|0)>>>0>0){nq((c[j>>2]|0)+64|0,(c[j>>2]|0)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>>>0>(c[A>>2]|0)>>>0?c[r>>2]|0:c[A>>2]|0;c[n>>2]=(c[n>>2]|0)-16;c[k>>2]=(c[k>>2]|0)+16}while(0)}while((c[n>>2]|0)>>>0>0);c[(c[j>>2]|0)+128+36>>2]=c[s>>2];if(c[r>>2]|0)c[r>>2]=(c[r>>2]|0)+16;c[i>>2]=c[r>>2];B=c[i>>2]|0;l=h;return B|0}function nq(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=l;l=l+48|0;if((l|0)>=(m|0))$(48);i=h+40|0;j=h+36|0;k=h+32|0;n=h+28|0;o=h+24|0;p=h+20|0;q=h+16|0;r=h+12|0;s=h+8|0;t=h+4|0;c[i>>2]=b;c[j>>2]=e;c[k>>2]=f;c[n>>2]=g;c[o>>2]=c[i>>2];c[p>>2]=c[j>>2];c[q>>2]=c[k>>2];c[h>>2]=3;if(!((c[o>>2]|c[p>>2]|c[q>>2])&3)){c[r>>2]=c[o>>2];c[s>>2]=c[p>>2];c[t>>2]=c[q>>2];while(1){if((c[n>>2]|0)>>>0<4)break;k=c[s>>2]|0;c[s>>2]=k+4;j=c[k>>2]|0;k=c[t>>2]|0;c[t>>2]=k+4;i=j^c[k>>2];k=c[r>>2]|0;c[r>>2]=k+4;c[k>>2]=i;c[n>>2]=(c[n>>2]|0)-4}c[o>>2]=c[r>>2];c[p>>2]=c[s>>2];c[q>>2]=c[t>>2]}while(1){if(!(c[n>>2]|0))break;t=c[p>>2]|0;c[p>>2]=t+1;s=d[t>>0]|0;t=c[q>>2]|0;c[q>>2]=t+1;r=(s^(d[t>>0]|0))&255;t=c[o>>2]|0;c[o>>2]=t+1;a[t>>0]=r;c[n>>2]=(c[n>>2]|0)+-1}l=h;return}function oq(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;i=l;l=l+32|0;if((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>>2]=0}if((c[t>>2]|0)>>>0>0){bf((c[t>>2]|0)+16|0);cf()}c[h>>2]=0;w=c[h>>2]|0;l=g;return w|0}function rq(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=l;l=l+48|0;if((l|0)>=(m|0))$(48);i=h+40|0;j=h+36|0;k=h+32|0;n=h+28|0;o=h+24|0;p=h+20|0;q=h+16|0;r=h+12|0;s=h+8|0;t=h+4|0;c[i>>2]=b;c[j>>2]=e;c[k>>2]=f;c[n>>2]=g;c[o>>2]=c[i>>2];c[p>>2]=c[j>>2];c[q>>2]=c[k>>2];c[h>>2]=3;if(!((c[q>>2]|c[o>>2]|c[p>>2])&3)){c[r>>2]=c[o>>2];c[s>>2]=c[p>>2];c[t>>2]=c[q>>2];while(1){if((c[n>>2]|0)>>>0<4)break;k=c[t>>2]|0;c[t>>2]=k+4;j=c[k>>2]|0;k=c[s>>2]|0;c[s>>2]=k+4;i=c[k>>2]^j;c[k>>2]=i;k=c[r>>2]|0;c[r>>2]=k+4;c[k>>2]=i;c[n>>2]=(c[n>>2]|0)-4}c[o>>2]=c[r>>2];c[p>>2]=c[s>>2];c[q>>2]=c[t>>2]}while(1){if(!(c[n>>2]|0))break;t=c[q>>2]|0;c[q>>2]=t+1;s=d[t>>0]|0;t=c[p>>2]|0;c[p>>2]=t+1;r=((d[t>>0]|0)^s)&255;a[t>>0]=r;t=c[o>>2]|0;c[o>>2]=t+1;a[t>>0]=r;c[n>>2]=(c[n>>2]|0)+-1}l=h;return}function sq(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+28|0;h=f+24|0;i=f+20|0;j=f+16|0;k=f+12|0;n=f+8|0;o=f+4|0;c[g>>2]=b;c[h>>2]=d;c[i>>2]=e;c[j>>2]=c[g>>2];c[k>>2]=c[h>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=b;return 0}function xq(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;e=l;l=l+80|0;if((l|0)>=(m|0))$(80);f=e+56|0;g=e+52|0;h=e+64|0;i=e+63|0;j=e+62|0;k=e+61|0;n=e+48|0;o=e+44|0;p=e+40|0;q=e+24|0;r=e+16|0;s=e+12|0;t=e+60|0;u=e;v=e+8|0;c[f>>2]=b;c[g>>2]=c[(c[(c[f>>2]|0)+12>>2]|0)+20>>2];if(16<(c[g>>2]|0)>>>0)Re(46822,113,46836);Uw(q|0,0,c[g>>2]|0)|0;c[n>>2]=ub[c[(c[(c[f>>2]|0)+12>>2]|0)+36>>2]&63]((c[f>>2]|0)+496|0,q,q)|0;a[h>>0]=(c[g>>2]|0)==16?135:27;c[p>>2]=0;while(1){if((c[p>>2]|0)>=2)break;a[i>>0]=0;c[o>>2]=(c[g>>2]|0)-1;while(1){if((c[o>>2]|0)<0)break;a[k>>0]=a[q+(c[o>>2]|0)>>0]|0;a[j>>0]=d[i>>0]|0|(d[k>>0]|0)<<1;a[i>>0]=(d[k>>0]|0)>>7;a[q+(c[o>>2]|0)>>0]=d[j>>0]|0;a[(c[f>>2]|0)+128+1+(c[p>>2]<<4)+(c[o>>2]|0)>>0]=a[q+(c[o>>2]|0)>>0]|0;c[o>>2]=(c[o>>2]|0)+-1}b=q+((c[g>>2]|0)-1)|0;a[b>>0]=(d[b>>0]|0)^(d[i>>0]|0|0?d[h>>0]|0:0);a[(c[f>>2]|0)+128+1+(c[p>>2]<<4)+((c[g>>2]|0)-1)>>0]=a[q+((c[g>>2]|0)-1)>>0]|0;c[p>>2]=(c[p>>2]|0)+1}c[r>>2]=q;c[s>>2]=16;a[t>>0]=0;q=u;c[q>>2]=d[t>>0];c[q+4>>2]=0;while(1){if(!(c[r>>2]&7|0?(c[s>>2]|0)!=0:0))break;a[c[r>>2]>>0]=a[t>>0]|0;c[r>>2]=(c[r>>2]|0)+1;c[s>>2]=(c[s>>2]|0)+-1}if((c[s>>2]|0)>>>0>=8){q=u;p=gx(c[q>>2]|0,c[q+4>>2]|0,16843009,16843009)|0;q=u;c[q>>2]=p;c[q+4>>2]=D;do{c[v>>2]=c[r>>2];q=u;p=c[q+4>>2]|0;g=c[v>>2]|0;c[g>>2]=c[q>>2];c[g+4>>2]=p;c[s>>2]=(c[s>>2]|0)-8;c[r>>2]=(c[r>>2]|0)+8}while((c[s>>2]|0)>>>0>=8)}while(1){if(!(c[s>>2]|0))break;a[c[r>>2]>>0]=a[t>>0]|0;c[r>>2]=(c[r>>2]|0)+1;c[s>>2]=(c[s>>2]|0)+-1}if(!(c[n>>2]|0)){l=e;return}bf((c[n>>2]|0)+16|0);cf();l=e;return}function yq(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0;i=l;l=l+96|0;if((l|0)>=(m|0))$(96);j=i+68|0;k=i+64|0;n=i+60|0;o=i+56|0;p=i+52|0;q=i+48|0;r=i+44|0;s=i+40|0;t=i+36|0;u=i+32|0;v=i+28|0;w=i+24|0;x=i+20|0;y=i+80|0;z=i+16|0;A=i+12|0;B=i+72|0;C=i;E=i+8|0;c[k>>2]=b;c[n>>2]=e;c[o>>2]=f;c[p>>2]=g;c[q>>2]=h;c[t>>2]=c[(c[(c[k>>2]|0)+12>>2]|0)+36>>2];c[u>>2]=c[(c[(c[k>>2]|0)+12>>2]|0)+20>>2];if((c[o>>2]|0)>>>0<(c[q>>2]|0)>>>0){c[j>>2]=200;F=c[j>>2]|0;l=i;return F|0}c[w>>2]=0;if(c[(c[k>>2]|0)+112>>2]|0){if((c[(c[k>>2]|0)+112>>2]|0)>>>0>=(c[u>>2]|0)>>>0)Se(46858,46880,53,46893);c[s>>2]=(c[u>>2]|0)-(c[(c[k>>2]|0)+112>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[q>>2]|0)-(c[r>>2]|0);c[n>>2]=(c[n>>2]|0)+(c[r>>2]|0);c[p>>2]=(c[p>>2]|0)+(c[r>>2]|0)}while((c[q>>2]|0)!=0);c[(c[k>>2]|0)+112>>2]=(c[u>>2]|0)-(c[r>>2]|0);if(c[(c[k>>2]|0)+112>>2]|0)Aq((c[k>>2]|0)+96+(c[r>>2]|0)|0,y+(c[r>>2]|0)|0,c[(c[k>>2]|0)+112>>2]|0);c[z>>2]=y;c[A>>2]=16;a[B>>0]=0;G=C;c[G>>2]=d[B>>0];c[G+4>>2]=0;while(1){if(!(c[z>>2]&7|0?(c[A>>2]|0)!=0:0))break;a[c[z>>2]>>0]=a[B>>0]|0;c[z>>2]=(c[z>>2]|0)+1;c[A>>2]=(c[A>>2]|0)+-1}if((c[A>>2]|0)>>>0>=8){G=C;v=gx(c[G>>2]|0,c[G+4>>2]|0,16843009,16843009)|0;G=C;c[G>>2]=v;c[G+4>>2]=D;do{c[E>>2]=c[z>>2];G=C;v=c[G+4>>2]|0;o=c[E>>2]|0;c[o>>2]=c[G>>2];c[o+4>>2]=v;c[A>>2]=(c[A>>2]|0)-8;c[z>>2]=(c[z>>2]|0)+8}while((c[A>>2]|0)>>>0>=8)}while(1){if(!(c[A>>2]|0))break a;a[c[z>>2]>>0]=a[B>>0]|0;c[z>>2]=(c[z>>2]|0)+1;c[A>>2]=(c[A>>2]|0)+-1}}while(0);if((c[w>>2]|0)>>>0>0){bf((c[w>>2]|0)+16|0);cf()}c[j>>2]=0;F=c[j>>2]|0;l=i;return F|0}function zq(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=l;l=l+48|0;if((l|0)>=(m|0))$(48);i=h+40|0;j=h+36|0;k=h+32|0;n=h+28|0;o=h+24|0;p=h+20|0;q=h+16|0;r=h+12|0;s=h+8|0;t=h+4|0;c[i>>2]=b;c[j>>2]=e;c[k>>2]=f;c[n>>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-1}l=f;return}function Bq(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;i=l;l=l+32|0;if((l|0)>=(m|0))$(32);j=i+24|0;k=i+20|0;n=i+16|0;o=i+12|0;p=i+8|0;q=i+4|0;r=i;c[k>>2]=b;c[n>>2]=e;c[o>>2]=f;c[p>>2]=g;c[q>>2]=h;if((c[(c[(c[k>>2]|0)+12>>2]|0)+20>>2]|0)!=16){c[j>>2]=12;s=c[j>>2]|0;l=i;return s|0}if((c[o>>2]|0)>>>0<(c[q>>2]|0)>>>0){c[j>>2]=200;s=c[j>>2]|0;l=i;return s|0}if((d[(c[k>>2]|0)+128+68>>0]|0)>>>2&1|0){c[j>>2]=139;s=c[j>>2]|0;l=i;return s|0}if(((d[(c[k>>2]|0)+56>>0]|0)>>>2&1|0)==0?(a[(c[k>>2]|0)+128+68>>0]&1|0)==0:0){if(!((d[(c[k>>2]|0)+56>>0]|0)>>>1&1))Cq(c[k>>2]|0,72251,16)|0;if((d[(c[k>>2]|0)+128+68>>0]|0)>>>3&1|0){c[j>>2]=156;s=c[j>>2]|0;l=i;return s|0}if(!((d[(c[k>>2]|0)+128+68>>0]|0)>>>1&1)){Dq(c[k>>2]|0,(c[k>>2]|0)+128|0,0,0,1);h=(c[k>>2]|0)+128+68|0;a[h>>0]=a[h>>0]&-3|2}Eq((c[k>>2]|0)+128+44|0,c[q>>2]|0);h=(Fq((c[k>>2]|0)+128+44|0)|0)!=0;g=c[k>>2]|0;if(!h){h=g+128+68|0;a[h>>0]=a[h>>0]&-5|4;c[j>>2]=139;s=c[j>>2]|0;l=i;return s|0}c[r>>2]=yq(g,c[n>>2]|0,c[o>>2]|0,c[p>>2]|0,c[q>>2]|0)|0;if(c[r>>2]|0){c[j>>2]=c[r>>2];s=c[j>>2]|0;l=i;return s|0}else{Dq(c[k>>2]|0,(c[k>>2]|0)+128|0,c[n>>2]|0,c[q>>2]|0,0);c[j>>2]=0;s=c[j>>2]|0;l=i;return s|0}}c[j>>2]=156;s=c[j>>2]|0;l=i;return s|0}function Cq(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+8|0;h=f+4|0;i=f;c[g>>2]=b;c[h>>2]=d;c[i>>2]=e;e=(c[g>>2]|0)+56|0;a[e>>0]=a[e>>0]&-3;e=(c[g>>2]|0)+56|0;a[e>>0]=a[e>>0]&-5;e=(c[g>>2]|0)+128+68|0;a[e>>0]=a[e>>0]&-9;if(!(Wg()|0)){j=c[g>>2]|0;k=c[h>>2]|0;n=c[i>>2]|0;o=Hq(j,k,n)|0;l=f;return o|0}e=(c[g>>2]|0)+128+68|0;a[e>>0]=a[e>>0]&-9|8;j=c[g>>2]|0;k=c[h>>2]|0;n=c[i>>2]|0;o=Hq(j,k,n)|0;l=f;return o|0}function Dq(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;h=l;l=l+48|0;if((l|0)>=(m|0))$(48);i=h+40|0;j=h+36|0;k=h+32|0;n=h+28|0;o=h+24|0;p=h+20|0;q=h+16|0;r=h+12|0;s=h+8|0;t=h+4|0;u=h;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;c[n>>2]=f;c[o>>2]=g;c[p>>2]=16;c[q>>2]=c[(c[i>>2]|0)+128+32>>2];c[r>>2]=c[(c[i>>2]|0)+128+96>>2];c[u>>2]=0;if((c[n>>2]|0)==0?!((c[q>>2]|0)!=0&(c[o>>2]|0)!=0):0){l=h;return}a:do{if((c[q>>2]|0)>>>0>0?1:((c[n>>2]|0)+(c[q>>2]|0)|0)>>>0<(c[p>>2]|0)>>>0){c[t>>2]=(c[p>>2]|0)-(c[q>>2]|0);c[t>>2]=(c[t>>2]|0)>>>0<(c[n>>2]|0)>>>0?c[t>>2]|0:c[n>>2]|0;Gq((c[i>>2]|0)+128+16+(c[q>>2]|0)|0,c[k>>2]|0,c[t>>2]|0);c[q>>2]=(c[q>>2]|0)+(c[t>>2]|0);c[k>>2]=(c[k>>2]|0)+(c[t>>2]|0);c[n>>2]=(c[n>>2]|0)-(c[t>>2]|0)}b:do if(!(c[n>>2]|0)){if(!(c[o>>2]|0))break a;while(1){if((c[q>>2]|0)>>>0>=(c[p>>2]|0)>>>0)break b;g=c[q>>2]|0;c[q>>2]=g+1;a[(c[i>>2]|0)+128+16+g>>0]=0}}while(0);if((c[q>>2]|0)>>>0>0){if((c[q>>2]|0)!=(c[p>>2]|0)){v=11;break}c[u>>2]=Bb[c[r>>2]&7](c[i>>2]|0,c[j>>2]|0,(c[i>>2]|0)+128+16|0,1)|0;c[q>>2]=0}c[s>>2]=((c[n>>2]|0)>>>0)/((c[p>>2]|0)>>>0)|0;if(c[s>>2]|0){c[u>>2]=Bb[c[r>>2]&7](c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[s>>2]|0)|0;g=S(c[p>>2]|0,c[s>>2]|0)|0;c[k>>2]=(c[k>>2]|0)+g;g=S(c[p>>2]|0,c[s>>2]|0)|0;c[n>>2]=(c[n>>2]|0)-g}}while((c[n>>2]|0)>>>0>0);if((v|0)==11)Se(46918,46938,499,46951);c[(c[i>>2]|0)+128+32>>2]=c[q>>2];if(!(c[u>>2]|0)){l=h;return}bf(c[u>>2]|0);cf();l=h;return}function Eq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=c[e>>2]|0;c[b>>2]=(c[b>>2]|0)+(c[f>>2]|0);if((c[c[e>>2]>>2]|0)>>>0>=(c[f>>2]|0)>>>0){l=d;return}f=(c[e>>2]|0)+4|0;c[f>>2]=(c[f>>2]|0)+1;l=d;return}function Fq(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[e>>2]=a;do if((c[(c[e>>2]|0)+4>>2]|0)>>>0<=15){if((c[(c[e>>2]|0)+4>>2]|0)>>>0<15){c[d>>2]=1;break}if((c[c[e>>2]>>2]|0)>>>0<=4294967264){c[d>>2]=1;break}else{c[d>>2]=0;break}}else c[d>>2]=0;while(0);l=b;return c[d>>2]|0}function Gq(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+28|0;h=f+24|0;i=f+20|0;j=f+16|0;k=f+12|0;n=f+8|0;o=f+4|0;c[g>>2]=b;c[h>>2]=d;c[i>>2]=e;c[j>>2]=c[g>>2];c[k>>2]=c[h>>2];c[f>>2]=3;if(!((c[j>>2]|c[k>>2])&3)){c[n>>2]=c[j>>2];c[o>>2]=c[k>>2];while(1){if((c[i>>2]|0)>>>0<4)break;h=c[o>>2]|0;c[o>>2]=h+4;g=c[h>>2]|0;h=c[n>>2]|0;c[n>>2]=h+4;c[h>>2]=g;c[i>>2]=(c[i>>2]|0)-4}c[j>>2]=c[n>>2];c[k>>2]=c[o>>2]}while(1){if(!(c[i>>2]|0))break;o=c[k>>2]|0;c[k>>2]=o+1;n=a[o>>0]|0;o=c[j>>2]|0;c[j>>2]=o+1;a[o>>0]=n;c[i>>2]=(c[i>>2]|0)+-1}l=f;return}function Hq(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;g=l;l=l+96|0;if((l|0)>=(m|0))$(96);h=g+76|0;i=g+72|0;j=g+68|0;k=g+64|0;n=g+56|0;o=g+40|0;p=g+36|0;q=g+32|0;r=g+81|0;s=g+8|0;t=g+28|0;u=g+24|0;v=g+20|0;w=g+80|0;x=g;y=g+16|0;c[i>>2]=b;c[j>>2]=e;c[k>>2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=c[h>>2]|0;l=g;return z|0}function Iq(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[e>>2]=a;do if((c[(c[e>>2]|0)+4>>2]|0)>>>0<=536870911){if((c[(c[e>>2]|0)+4>>2]|0)>>>0<536870911){c[d>>2]=1;break}if((c[c[e>>2]>>2]|0)>>>0<=4294967295){c[d>>2]=1;break}else{c[d>>2]=0;break}}else c[d>>2]=0;while(0);l=b;return c[d>>2]|0}function Jq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d+12|0;g=d+4|0;h=d;c[e>>2]=a;c[f>>2]=b;c[d+8>>2]=16;c[g>>2]=(c[e>>2]|0)+16+-4;e=ax(c[c[g>>2]>>2]|0)|0;c[h>>2]=e+(c[f>>2]|0);f=ax(c[h>>2]|0)|0;c[c[g>>2]>>2]=f;l=d;return c[h>>2]|0}function Kq(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0;i=l;l=l+32|0;if((l|0)>=(m|0))$(32);j=i+20|0;k=i+16|0;n=i+12|0;o=i+8|0;p=i+4|0;q=i;c[k>>2]=b;c[n>>2]=e;c[o>>2]=f;c[p>>2]=g;c[q>>2]=h;if((c[(c[(c[k>>2]|0)+12>>2]|0)+20>>2]|0)!=16){c[j>>2]=12;r=c[j>>2]|0;l=i;return r|0}if((c[o>>2]|0)>>>0<(c[q>>2]|0)>>>0){c[j>>2]=200;r=c[j>>2]|0;l=i;return r|0}if((d[(c[k>>2]|0)+128+68>>0]|0)>>>2&1|0){c[j>>2]=139;r=c[j>>2]|0;l=i;return r|0}if(((d[(c[k>>2]|0)+56>>0]|0)>>>2&1|0)==0?(a[(c[k>>2]|0)+128+68>>0]&1|0)==0:0){if(!((d[(c[k>>2]|0)+56>>0]|0)>>>1&1))Cq(c[k>>2]|0,72267,16)|0;if(!((d[(c[k>>2]|0)+128+68>>0]|0)>>>1&1)){Dq(c[k>>2]|0,(c[k>>2]|0)+128|0,0,0,1);h=(c[k>>2]|0)+128+68|0;a[h>>0]=a[h>>0]&-3|2}Eq((c[k>>2]|0)+128+44|0,c[q>>2]|0);h=(Fq((c[k>>2]|0)+128+44|0)|0)!=0;g=c[k>>2]|0;if(h){Dq(g,(c[k>>2]|0)+128|0,c[p>>2]|0,c[q>>2]|0,0);c[j>>2]=yq(c[k>>2]|0,c[n>>2]|0,c[o>>2]|0,c[p>>2]|0,c[q>>2]|0)|0;r=c[j>>2]|0;l=i;return r|0}else{q=g+128+68|0;a[q>>0]=a[q>>0]&-5|4;c[j>>2]=139;r=c[j>>2]|0;l=i;return r|0}}c[j>>2]=156;r=c[j>>2]|0;l=i;return r|0}function Lq(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=(c[d>>2]|0)+128+80|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;ub[c[(c[(c[d>>2]|0)+12>>2]|0)+36>>2]&63]((c[d>>2]|0)+496|0,(c[d>>2]|0)+128+80|0,(c[d>>2]|0)+128+80|0)|0;Mq(c[d>>2]|0);l=b;return}function Mq(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;c[(c[d>>2]|0)+128+96>>2]=2;Oq((c[d>>2]|0)+128+80|0,(c[d>>2]|0)+128+100|0);l=b;return}function Nq(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+20|0;h=f+16|0;i=f+12|0;j=f+8|0;k=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;c[f+4>>2]=16;c[k>>2]=0;while(1){if(!(c[j>>2]|0))break;c[k>>2]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c[b>>2]=d;c[b+4>>2]=e;e=j;c[k>>2]=Vq(c[e>>2]|0,c[e+4>>2]|0)|0;if((c[k>>2]|0)<16){c[g>>2]=(c[h>>2]|0)+128+32+(c[k>>2]<<4);n=c[g>>2]|0;l=f;return n|0}Wq(c[i>>2]|0,(c[h>>2]|0)+128+32+240|0);c[k>>2]=(c[k>>2]|0)-16;while(1){o=c[i>>2]|0;if(!(c[k>>2]|0))break;Xq(o);c[k>>2]=(c[k>>2]|0)+-1}c[g>>2]=o;n=c[g>>2]|0;l=f;return n|0}function Vq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+8|0;f=d;g=f;c[g>>2]=a;c[g+4>>2]=b;b=f;g=c[b+4>>2]|0;if((c[f>>2]|0)!=0|0!=0){c[e>>2]=$q(c[b>>2]|0)|0;h=c[e>>2]|0;l=d;return h|0}else{c[e>>2]=32+($q(g)|0);h=c[e>>2]|0;l=d;return h|0}return 0}function Wq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if((c[e>>2]|0)!=(c[f>>2]|0))_q(c[e>>2]|0,c[f>>2]|0,16);Xq(c[e>>2]|0);l=d;return}function Xq(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;b=l;l=l+32|0;if((l|0)>=(m|0))$(32);d=b+24|0;e=b+16|0;f=b+8|0;g=b;c[d>>2]=a;a=Yq(c[d>>2]|0)|0;h=f;c[h>>2]=a;c[h+4>>2]=D;h=Yq((c[d>>2]|0)+8|0)|0;a=g;c[a>>2]=h;c[a+4>>2]=D;a=f;h=bx(c[a>>2]|0,c[a+4>>2]|0,63)|0;a=e;c[a>>2]=h;c[a+4>>2]=D;a=f;h=f;i=Ww(c[a>>2]|0,c[a+4>>2]|0,c[h>>2]|0,c[h+4>>2]|0)|0;h=D;a=g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(c[e>>2]|0,c[e+4>>2]|0,24)|0;a[(c[i>>2]|0)+4>>0]=g;g=h;e=cx(c[g>>2]|0,c[g+4>>2]|0,16)|0;a[(c[i>>2]|0)+5>>0]=e;e=h;g=cx(c[e>>2]|0,c[e+4>>2]|0,8)|0;a[(c[i>>2]|0)+6>>0]=g;a[(c[i>>2]|0)+7>>0]=c[h>>2];l=f;return}function _q(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+28|0;h=f+24|0;i=f+20|0;j=f+16|0;k=f+12|0;n=f+8|0;o=f+4|0;c[g>>2]=b;c[h>>2]=d;c[i>>2]=e;c[j>>2]=c[g>>2];c[k>>2]=c[h>>2];c[f>>2]=3;if(!((c[j>>2]|c[k>>2])&3)){c[n>>2]=c[j>>2];c[o>>2]=c[k>>2];while(1){if((c[i>>2]|0)>>>0<4)break;h=c[o>>2]|0;c[o>>2]=h+4;g=c[h>>2]|0;h=c[n>>2]|0;c[n>>2]=h+4;c[h>>2]=g;c[i>>2]=(c[i>>2]|0)-4}c[j>>2]=c[n>>2];c[k>>2]=c[o>>2]}while(1){if(!(c[i>>2]|0))break;o=c[k>>2]|0;c[k>>2]=o+1;n=a[o>>0]|0;o=c[j>>2]|0;c[j>>2]=o+1;a[o>>0]=n;c[i>>2]=(c[i>>2]|0)+-1}l=f;return}function $q(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=(c[d>>2]|0)!=0;e=Xw(c[d>>2]|0)|0;l=b;return (a?e:32)|0}function ar(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0;g=l;l=l+128|0;if((l|0)>=(m|0))$(128);h=g+68|0;i=g+64|0;j=g+60|0;k=g+56|0;n=g+104|0;o=g+80|0;p=g+52|0;q=g+48|0;r=g+44|0;s=g+40|0;t=g+36|0;u=g+32|0;v=g+73|0;w=g+8|0;x=g+28|0;y=g+24|0;z=g+20|0;A=g+72|0;B=g;C=g+16|0;c[i>>2]=b;c[j>>2]=e;c[k>>2]=f;c[r>>2]=0;if(!(a[(c[i>>2]|0)+56>>0]&1)){c[h>>2]=156;E=c[h>>2]|0;l=g;return E|0}switch(d[(c[i>>2]|0)+128+352>>0]|0|0){case 16:case 12:case 8:break;default:{c[h>>2]=59;E=c[h>>2]|0;l=g;return E|0}}if((c[(c[(c[i>>2]|0)+12>>2]|0)+20>>2]|0)!=16){c[h>>2]=12;E=c[h>>2]|0;l=g;return E|0}if(!(c[j>>2]|0)){c[h>>2]=45;E=c[h>>2]|0;l=g;return E|0}if((c[k>>2]|0)>>>0>15|(c[k>>2]|0)>>>0<8|(c[k>>2]|0)>>>0>=16){c[h>>2]=139;E=c[h>>2]|0;l=g;return E|0}f=n;e=f+16|0;do{a[f>>0]=0;f=f+1|0}while((f|0)<(e|0));c[s>>2]=ub[c[(c[(c[i>>2]|0)+12>>2]|0)+36>>2]&63]((c[i>>2]|0)+496|0,(c[i>>2]|0)+128|0,n)|0;c[r>>2]=(c[s>>2]|0)>>>0>(c[r>>2]|0)>>>0?c[s>>2]|0:c[r>>2]|0;Wq((c[i>>2]|0)+128+16|0,(c[i>>2]|0)+128|0);Wq((c[i>>2]|0)+128+32|0,(c[i>>2]|0)+128+16|0);c[q>>2]=1;while(1){if((c[q>>2]|0)>=16)break;Wq((c[i>>2]|0)+128+32+(c[q>>2]<<4)|0,(c[i>>2]|0)+128+32+((c[q>>2]|0)-1<<4)|0);c[q>>2]=(c[q>>2]|0)+1}Uw(n|0,0,16-(c[k>>2]|0)|0)|0;_q(n+(16-(c[k>>2]|0))|0,c[j>>2]|0,c[k>>2]|0);a[n>>0]=(((d[(c[i>>2]|0)+128+352>>0]|0)<<3|0)%128|0)<<1;j=n+(16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){n=w;p=gx(c[n>>2]|0,c[n+4>>2]|0,16843009,16843009)|0;n=w;c[n>>2]=p;c[n+4>>2]=D;do{c[x>>2]=c[t>>2];n=w;p=c[n+4>>2]|0;i=c[x>>2]|0;c[i>>2]=c[n>>2];c[i+4>>2]=p;c[u>>2]=(c[u>>2]|0)-8;c[t>>2]=(c[t>>2]|0)+8}while((c[u>>2]|0)>>>0>=8)}while(1){if(!(c[u>>2]|0))break;a[c[t>>2]>>0]=a[v>>0]|0;c[t>>2]=(c[t>>2]|0)+1;c[u>>2]=(c[u>>2]|0)+-1}c[y>>2]=o;c[z>>2]=24;a[A>>0]=0;o=B;c[o>>2]=d[A>>0];c[o+4>>2]=0;while(1){if(!(c[y>>2]&7|0?(c[z>>2]|0)!=0:0))break;a[c[y>>2]>>0]=a[A>>0]|0;c[y>>2]=(c[y>>2]|0)+1;c[z>>2]=(c[z>>2]|0)+-1}if((c[z>>2]|0)>>>0>=8){o=B;u=gx(c[o>>2]|0,c[o+4>>2]|0,16843009,16843009)|0;o=B;c[o>>2]=u;c[o+4>>2]=D;do{c[C>>2]=c[y>>2];o=B;u=c[o+4>>2]|0;t=c[C>>2]|0;c[t>>2]=c[o>>2];c[t+4>>2]=u;c[z>>2]=(c[z>>2]|0)-8;c[y>>2]=(c[y>>2]|0)+8}while((c[z>>2]|0)>>>0>=8)}while(1){if(!(c[z>>2]|0))break;a[c[y>>2]>>0]=a[A>>0]|0;c[y>>2]=(c[y>>2]|0)+1;c[z>>2]=(c[z>>2]|0)+-1}if((c[r>>2]|0)>>>0>0){bf((c[r>>2]|0)+16|0);cf()}c[h>>2]=0;E=c[h>>2]|0;l=g;return E|0}function br(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=l;l=l+48|0;if((l|0)>=(m|0))$(48);i=h+40|0;j=h+36|0;k=h+32|0;n=h+28|0;o=h+24|0;p=h+20|0;q=h+16|0;r=h+12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]=(c[n>>2]|0)+-1;c[i>>2]=(c[i>>2]|0)+1;c[j>>2]=(c[j>>2]|0)+1}l=h;return}}function dr(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g+28|0;i=g+24|0;j=g+20|0;k=g+16|0;n=g+12|0;o=g+8|0;p=g+4|0;c[h>>2]=b;c[i>>2]=e;c[j>>2]=f;c[k>>2]=c[h>>2];c[n>>2]=c[i>>2];c[g>>2]=3;if(!((c[k>>2]|c[n>>2])&3)){c[o>>2]=c[k>>2];c[p>>2]=c[n>>2];while(1){if((c[j>>2]|0)>>>0<4)break;i=c[p>>2]|0;c[p>>2]=i+4;h=c[i>>2]|0;i=c[o>>2]|0;c[o>>2]=i+4;c[i>>2]=c[i>>2]^h;c[j>>2]=(c[j>>2]|0)-4}c[k>>2]=c[o>>2];c[n>>2]=c[p>>2]}while(1){if(!(c[j>>2]|0))break;p=c[n>>2]|0;c[n>>2]=p+1;o=d[p>>0]|0;p=c[k>>2]|0;c[k>>2]=p+1;a[p>>0]=(d[p>>0]|0)^o;c[j>>2]=(c[j>>2]|0)+-1}l=g;return}function er(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g+16|0;i=g+12|0;j=g+8|0;k=g+4|0;n=g;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;c[n>>2]=f;f=fr(c[h>>2]|0,1,c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0)|0;l=g;return f|0}function fr(b,e,f,g,h,i){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;j=l;l=l+80|0;if((l|0)>=(m|0))$(80);k=j+40|0;n=j+36|0;o=j+32|0;p=j+28|0;q=j+24|0;r=j+20|0;s=j+16|0;t=j+64|0;u=j+12|0;v=j+8|0;w=j+4|0;x=j;y=j+48|0;c[n>>2]=b;c[o>>2]=e;c[p>>2]=f;c[q>>2]=g;c[r>>2]=h;c[s>>2]=i;c[u>>2]=0;c[w>>2]=((c[s>>2]|0)>>>0)/16|0;if((d[(c[n>>2]|0)+56>>0]|0)>>>1&1|0?(a[(c[n>>2]|0)+128+353>>0]&1|0)==0:0){if((c[(c[(c[n>>2]|0)+12>>2]|0)+20>>2]|0)!=16){c[k>>2]=12;z=c[k>>2]|0;l=j;return z|0}if((c[q>>2]|0)>>>0<(c[s>>2]|0)>>>0){c[k>>2]=200;z=c[k>>2]|0;l=j;return z|0}if(((d[(c[n>>2]|0)+56>>0]|0)>>>3&1|0)==0?((c[s>>2]|0)>>>0)%16|0|0:0){c[k>>2]=139;z=c[k>>2]|0;l=j;return z|0}if(c[w>>2]|0?c[(c[n>>2]|0)+20+20>>2]|0:0){vb[c[(c[n>>2]|0)+20+20>>2]&15](c[n>>2]|0,c[p>>2]|0,c[r>>2]|0,c[w>>2]|0,c[o>>2]|0);c[r>>2]=(c[r>>2]|0)+(c[w>>2]<<4);c[p>>2]=(c[p>>2]|0)+(c[w>>2]<<4);c[s>>2]=(c[s>>2]|0)-(c[w>>2]<<4);c[q>>2]=(c[q>>2]|0)-(c[w>>2]<<4);c[w>>2]=0}if(c[w>>2]|0){i=c[(c[n>>2]|0)+12>>2]|0;if(c[o>>2]|0)A=c[i+36>>2]|0;else A=c[i+40>>2]|0;c[x>>2]=A;if(c[o>>2]|0)gr((c[n>>2]|0)+80|0,c[r>>2]|0,c[w>>2]|0);while(1){if((c[s>>2]|0)>>>0<16)break;A=(c[n>>2]|0)+128+336|0;i=A;h=Ww(c[i>>2]|0,c[i+4>>2]|0,1,0)|0;i=A;c[i>>2]=h;c[i+4>>2]=D;i=(c[n>>2]|0)+64|0;h=(c[n>>2]|0)+128+336|0;dr(i,Uq(c[n>>2]|0,t,c[h>>2]|0,c[h+4>>2]|0)|0,16);br(c[p>>2]|0,(c[n>>2]|0)+64|0,c[r>>2]|0,16);c[v>>2]=ub[c[x>>2]&63]((c[n>>2]|0)+496|0,c[p>>2]|0,c[p>>2]|0)|0;c[u>>2]=(c[v>>2]|0)>>>0>(c[u>>2]|0)>>>0?c[v>>2]|0:c[u>>2]|0;dr(c[p>>2]|0,(c[n>>2]|0)+64|0,16);c[r>>2]=(c[r>>2]|0)+16;c[s>>2]=(c[s>>2]|0)-16;c[p>>2]=(c[p>>2]|0)+16;c[q>>2]=-16}if(!(c[o>>2]|0))gr((c[n>>2]|0)+80|0,(c[p>>2]|0)+(0-(c[w>>2]<<4))|0,c[w>>2]|0)}do if(c[s>>2]|0){dr((c[n>>2]|0)+64|0,(c[n>>2]|0)+128|0,16);c[v>>2]=ub[c[(c[(c[n>>2]|0)+12>>2]|0)+36>>2]&63]((c[n>>2]|0)+496|0,y,(c[n>>2]|0)+64|0)|0;c[u>>2]=(c[v>>2]|0)>>>0>(c[u>>2]|0)>>>0?c[v>>2]|0:c[u>>2]|0;if(c[o>>2]|0){_q(t,c[r>>2]|0,c[s>>2]|0);Uw(t+(c[s>>2]|0)|0,0,16-(c[s>>2]|0)|0)|0;a[t+(c[s>>2]|0)>>0]=-128;dr((c[n>>2]|0)+80|0,t,16);br(c[p>>2]|0,c[r>>2]|0,y,c[s>>2]|0);break}else{_q(t,y,16);_q(t,c[r>>2]|0,c[s>>2]|0);dr(t,y,16);a[t+(c[s>>2]|0)>>0]=-128;_q(c[p>>2]|0,t,c[s>>2]|0);dr((c[n>>2]|0)+80|0,t,16);break}}while(0);if((d[(c[n>>2]|0)+56>>0]|0)>>>3&1|0){br((c[n>>2]|0)+128+288|0,(c[n>>2]|0)+80|0,(c[n>>2]|0)+64|0,16);dr((c[n>>2]|0)+128+288|0,(c[n>>2]|0)+128+16|0,16);c[v>>2]=ub[c[(c[(c[n>>2]|0)+12>>2]|0)+36>>2]&63]((c[n>>2]|0)+496|0,(c[n>>2]|0)+128+288|0,(c[n>>2]|0)+128+288|0)|0;c[u>>2]=(c[v>>2]|0)>>>0>(c[u>>2]|0)>>>0?c[v>>2]|0:c[u>>2]|0;v=(c[n>>2]|0)+128+353|0;a[v>>0]=a[v>>0]&-2|1}if((c[u>>2]|0)>>>0>0){bf((c[u>>2]|0)+16|0);cf()}c[k>>2]=0;z=c[k>>2]|0;l=j;return z|0}c[k>>2]=156;z=c[k>>2]|0;l=j;return z|0}function gr(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;while(1){if((c[h>>2]|0)>>>0<=0)break;dr(c[f>>2]|0,c[g>>2]|0,16);c[g>>2]=(c[g>>2]|0)+16;c[h>>2]=(c[h>>2]|0)+-1}l=e;return}function hr(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g+16|0;i=g+12|0;j=g+8|0;k=g+4|0;n=g;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;c[n>>2]=f;f=fr(c[h>>2]|0,0,c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0)|0;l=g;return f|0}function ir(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;g=l;l=l+48|0;if((l|0)>=(m|0))$(48);h=g+40|0;i=g+36|0;j=g+32|0;k=g+28|0;n=g+24|0;o=g+20|0;p=g+16|0;q=g+12|0;r=g+8|0;s=g+4|0;t=g;c[i>>2]=a;c[j>>2]=b;c[k>>2]=d;c[n>>2]=e;c[o>>2]=f;c[q>>2]=c[(c[(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>2]|0;c[o>>2]=t+1;a[t>>0]=r;c[n>>2]=(c[n>>2]|0)+-1}l=h;return}function kr(b){b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d;f=d+8|0;c[e>>2]=b;a[f>>0]=0;a[f+1>>0]=0;a[f+2>>0]=0;a[f+3>>0]=0;a[f+4>>0]=0;a[f+5>>0]=0;a[f+6>>0]=0;a[f+7>>0]=0;b=mr(c[e>>2]|0,f,8)|0;l=d;return b|0}function lr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=0;b=c[f>>2]|0;c[b>>2]=(c[b>>2]|0)+(c[g>>2]|0);if((c[c[f>>2]>>2]|0)>>>0>=(c[g>>2]|0)>>>0){c[e>>2]=c[h>>2];i=c[e>>2]|0;l=d;return i|0}else{g=(c[f>>2]|0)+4|0;c[g>>2]=(c[g>>2]|0)+1;c[e>>2]=((c[(c[f>>2]|0)+4>>2]|0)>>>0<1?1:(c[h>>2]|0)!=0)&1;i=c[e>>2]|0;l=d;return i|0}return 0}function mr(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;g=l;l=l+112|0;if((l|0)>=(m|0))$(112);h=g+36|0;i=g+32|0;j=g+28|0;k=g+24|0;n=g+48|0;o=g+20|0;p=g+16|0;q=g+12|0;r=g+40|0;s=g;t=g+8|0;c[i>>2]=b;c[j>>2]=e;c[k>>2]=f;if((c[j>>2]|0)==0&(c[k>>2]|0)!=12){c[h>>2]=45;u=c[h>>2]|0;l=g;return u|0}f=(c[i>>2]|0)+128+20|0;e=f+92|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(e|0));c[(c[i>>2]|0)+128>>2]=0;c[(c[i>>2]|0)+128+4>>2]=0;c[(c[i>>2]|0)+128+8>>2]=0;c[(c[i>>2]|0)+128+8+4>>2]=0;b=(c[i>>2]|0)+128+16|0;a[b>>0]=a[b>>0]&-3;b=(c[i>>2]|0)+128+16|0;a[b>>0]=a[b>>0]&-2;b=(c[i>>2]|0)+56|0;a[b>>0]=a[b>>0]&-5;b=(c[i>>2]|0)+56|0;a[b>>0]=a[b>>0]&-3;zb[c[(c[(c[i>>2]|0)+12>>2]|0)+60>>2]&7]((c[i>>2]|0)+496|0,c[j>>2]|0,c[k>>2]|0);f=n;e=f+64|0;do{a[f>>0]=0;f=f+1|0}while((f|0)<(e|0));Eb[c[(c[(c[i>>2]|0)+12>>2]|0)+44>>2]&1]((c[i>>2]|0)+496|0,n,n,64);c[o>>2]=Sr((c[i>>2]|0)+128+20|0,n,32)|0;c[p>>2]=n;c[q>>2]=64;a[r>>0]=0;n=s;c[n>>2]=d[r>>0];c[n+4>>2]=0;while(1){if(!(c[p>>2]&7|0?(c[q>>2]|0)!=0:0))break;a[c[p>>2]>>0]=a[r>>0]|0;c[p>>2]=(c[p>>2]|0)+1;c[q>>2]=(c[q>>2]|0)+-1}if((c[q>>2]|0)>>>0>=8){n=s;f=gx(c[n>>2]|0,c[n+4>>2]|0,16843009,16843009)|0;n=s;c[n>>2]=f;c[n+4>>2]=D;do{c[t>>2]=c[p>>2];n=s;f=c[n+4>>2]|0;e=c[t>>2]|0;c[e>>2]=c[n>>2];c[e+4>>2]=f;c[q>>2]=(c[q>>2]|0)-8;c[p>>2]=(c[p>>2]|0)+8}while((c[q>>2]|0)>>>0>=8)}while(1){if(!(c[q>>2]|0))break;a[c[p>>2]>>0]=a[r>>0]|0;c[p>>2]=(c[p>>2]|0)+1;c[q>>2]=(c[q>>2]|0)+-1}if(c[o>>2]|0){c[h>>2]=c[o>>2];u=c[h>>2]|0;l=g;return u|0}else{o=(c[i>>2]|0)+56|0;a[o>>0]=a[o>>0]&-3|2;c[h>>2]=0;u=c[h>>2]|0;l=g;return u|0}return 0}function nr(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;i=l;l=l+32|0;if((l|0)>=(m|0))$(32);j=i+24|0;k=i+20|0;n=i+16|0;o=i+12|0;p=i+8|0;q=i+4|0;r=i;c[k>>2]=b;c[n>>2]=e;c[o>>2]=f;c[p>>2]=g;c[q>>2]=h;if((c[o>>2]|0)>>>0<(c[q>>2]|0)>>>0){c[j>>2]=200;s=c[j>>2]|0;l=i;return s|0}if((d[(c[k>>2]|0)+56>>0]|0)>>>2&1|0){c[j>>2]=156;s=c[j>>2]|0;l=i;return s|0}if((d[(c[k>>2]|0)+128+16>>0]|0)>>>1&1|0){c[j>>2]=139;s=c[j>>2]|0;l=i;return s|0}if(((d[(c[k>>2]|0)+56>>0]|0)>>>1&1|0)==0?(c[r>>2]=kr(c[k>>2]|0)|0,c[r>>2]|0):0){c[j>>2]=c[r>>2];s=c[j>>2]|0;l=i;return s|0}if(!(a[(c[k>>2]|0)+128+16>>0]&1))or(c[k>>2]|0);r=(lr((c[k>>2]|0)+128+8|0,c[q>>2]|0)|0)!=0;o=c[k>>2]|0;if(r){r=o+128+16|0;a[r>>0]=a[r>>0]&-3|2;c[j>>2]=139;s=c[j>>2]|0;l=i;return s|0}else{Eb[c[(c[o+12>>2]|0)+44>>2]&1]((c[k>>2]|0)+496|0,c[n>>2]|0,c[p>>2]|0,c[q>>2]|0);Or((c[k>>2]|0)+128+20|0,c[n>>2]|0,c[q>>2]|0);c[j>>2]=0;s=c[j>>2]|0;l=i;return s|0}return 0}function or(b){b=b|0;var d=0,e=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d;c[e>>2]=b;pr(c[e>>2]|0,(c[e>>2]|0)+128|0);b=(c[e>>2]|0)+128+16|0;a[b>>0]=a[b>>0]&-2|1;c[(c[e>>2]|0)+128+8>>2]=0;c[(c[e>>2]|0)+128+8+4>>2]=0;l=d;return}function pr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+8|0;f=d+4|0;g=d;c[e>>2]=a;c[f>>2]=b;if((((c[c[f>>2]>>2]|0)>>>0)%16|0)>>>0<=0){l=d;return}c[g>>2]=16-(((c[c[f>>2]>>2]|0)>>>0)%16|0);Or((c[e>>2]|0)+128+20|0,72283,c[g>>2]|0);l=d;return}function qr(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;i=l;l=l+32|0;if((l|0)>=(m|0))$(32);j=i+24|0;k=i+20|0;n=i+16|0;o=i+12|0;p=i+8|0;q=i+4|0;r=i;c[k>>2]=b;c[n>>2]=e;c[o>>2]=f;c[p>>2]=g;c[q>>2]=h;if((c[o>>2]|0)>>>0<(c[q>>2]|0)>>>0){c[j>>2]=200;s=c[j>>2]|0;l=i;return s|0}if((d[(c[k>>2]|0)+56>>0]|0)>>>2&1|0){c[j>>2]=156;s=c[j>>2]|0;l=i;return s|0}if((d[(c[k>>2]|0)+128+16>>0]|0)>>>1&1|0){c[j>>2]=139;s=c[j>>2]|0;l=i;return s|0}if(((d[(c[k>>2]|0)+56>>0]|0)>>>1&1|0)==0?(c[r>>2]=kr(c[k>>2]|0)|0,c[r>>2]|0):0){c[j>>2]=c[r>>2];s=c[j>>2]|0;l=i;return s|0}if(!(a[(c[k>>2]|0)+128+16>>0]&1))or(c[k>>2]|0);r=(lr((c[k>>2]|0)+128+8|0,c[q>>2]|0)|0)!=0;o=(c[k>>2]|0)+128|0;if(r){r=o+16|0;a[r>>0]=a[r>>0]&-3|2;c[j>>2]=139;s=c[j>>2]|0;l=i;return s|0}else{Or(o+20|0,c[p>>2]|0,c[q>>2]|0);Eb[c[(c[(c[k>>2]|0)+12>>2]|0)+48>>2]&1]((c[k>>2]|0)+496|0,c[n>>2]|0,c[p>>2]|0,c[q>>2]|0);c[j>>2]=0;s=c[j>>2]|0;l=i;return s|0}return 0}function rr(b){b=b|0;var d=0,e=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d;c[e>>2]=b;c[(c[e>>2]|0)+128>>2]=0;c[(c[e>>2]|0)+128+4>>2]=0;c[(c[e>>2]|0)+128+8>>2]=0;c[(c[e>>2]|0)+128+8+4>>2]=0;b=(c[e>>2]|0)+128+16|0;a[b>>0]=a[b>>0]&-3;b=(c[e>>2]|0)+128+16|0;a[b>>0]=a[b>>0]&-2;b=(c[e>>2]|0)+56|0;a[b>>0]=a[b>>0]&-5;b=(c[e>>2]|0)+56|0;a[b>>0]=a[b>>0]&-3;l=d;return}function sr(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;j=l;l=l+80|0;if((l|0)>=(m|0))$(80);k=j+72|0;n=j+64|0;o=j+60|0;p=j+56|0;q=j+52|0;r=j+48|0;s=j+44|0;t=j+40|0;u=j+36|0;v=j+32|0;w=j+28|0;x=j+24|0;y=j+20|0;z=j+16|0;A=j+12|0;B=j+8|0;C=j+4|0;D=j;c[j+68>>2]=b;c[n>>2]=d;c[o>>2]=e;c[p>>2]=f;c[q>>2]=g;c[r>>2]=h;c[s>>2]=i;c[C>>2]=(c[s>>2]|0)+15;c[C>>2]=(c[C>>2]|0)-(c[C>>2]&15);c[D>>2]=(c[C>>2]|0)+(c[r>>2]<<1)+((S(c[r>>2]|0,c[q>>2]|0)|0)*3|0)+16;c[B>>2]=wf(1,c[D>>2]|0)|0;if(!(c[B>>2]|0)){c[k>>2]=46964;E=c[k>>2]|0;l=j;return E|0}c[u>>2]=16-(c[B>>2]&15)&15;c[v>>2]=(c[B>>2]|0)+(c[u>>2]|0);c[z>>2]=(c[v>>2]|0)+(c[C>>2]|0);c[A>>2]=(c[z>>2]|0)+(c[r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E=c[k>>2]|0;l=j;return E|0}q=(Jv(c[A>>2]|0,c[z>>2]|0,c[r>>2]|0)|0)!=0;vf(c[B>>2]|0);if(q){c[k>>2]=47053;E=c[k>>2]|0;l=j;return E|0}else{c[k>>2]=0;E=c[k>>2]|0;l=j;return E|0}return 0}function vr(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=l;l=l+48|0;if((l|0)>=(m|0))$(48);i=h+40|0;j=h+36|0;k=h+32|0;n=h+28|0;o=h+24|0;p=h+20|0;q=h+16|0;r=h+12|0;s=h+8|0;t=h+4|0;c[i>>2]=b;c[j>>2]=e;c[k>>2]=f;c[n>>2]=g;c[o>>2]=c[i>>2];c[p>>2]=c[j>>2];c[q>>2]=c[k>>2];c[h>>2]=3;if(!((c[q>>2]|c[o>>2]|c[p>>2])&3)){c[r>>2]=c[o>>2];c[s>>2]=c[p>>2];c[t>>2]=c[q>>2];while(1){if((c[n>>2]|0)>>>0<4)break;k=c[t>>2]|0;c[t>>2]=k+4;j=c[k>>2]|0;k=c[s>>2]|0;c[s>>2]=k+4;i=c[k>>2]^j;c[k>>2]=i;k=c[r>>2]|0;c[r>>2]=k+4;c[k>>2]=i;c[n>>2]=(c[n>>2]|0)-4}c[o>>2]=c[r>>2];c[p>>2]=c[s>>2];c[q>>2]=c[t>>2]}while(1){if(!(c[n>>2]|0))break;t=c[q>>2]|0;c[q>>2]=t+1;s=d[t>>0]|0;t=c[p>>2]|0;c[p>>2]=t+1;r=((d[t>>0]|0)^s)&255;a[t>>0]=r;t=c[o>>2]|0;c[o>>2]=t+1;a[t>>0]=r;c[n>>2]=(c[n>>2]|0)+-1}l=h;return}function wr(b,e,f,g,h,i,j){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=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=o;c[u>>2]=(c[u>>2]|0)+1}c[u>>2]=0;while(1){if((c[u>>2]|0)>=(S(c[s>>2]|0,c[r>>2]|0)|0))break;ub[c[p>>2]&63](c[y>>2]|0,(c[B>>2]|0)+(c[u>>2]|0)|0,c[D>>2]|0)|0;c[v>>2]=0;while(1){if((c[v>>2]|0)>=(c[s>>2]|0))break;o=(c[B>>2]|0)+((c[u>>2]|0)+(c[v>>2]|0))|0;a[o>>0]=d[o>>0]^d[(c[z>>2]|0)+((c[u>>2]|0)+(c[v>>2]|0))>>0];c[v>>2]=(c[v>>2]|0)+1}c[v>>2]=c[s>>2];while(1){if((c[v>>2]|0)<=0)break;o=(c[D>>2]|0)+((c[v>>2]|0)-1)|0;a[o>>0]=(a[o>>0]|0)+1<<24>>24;if(a[(c[D>>2]|0)+((c[v>>2]|0)-1)>>0]|0)break;c[v>>2]=(c[v>>2]|0)+-1}c[u>>2]=(c[u>>2]|0)+(c[s>>2]|0)}vb[c[q>>2]&15](c[y>>2]|0,c[E>>2]|0,c[C>>2]|0,c[A>>2]|0,c[r>>2]|0);if(Jv(c[C>>2]|0,c[B>>2]|0,S(c[s>>2]|0,c[r>>2]|0)|0)|0){vf(c[F>>2]|0);c[n>>2]=47102;I=c[n>>2]|0;l=k;return I|0}if(Jv(c[E>>2]|0,c[D>>2]|0,c[s>>2]|0)|0){vf(c[F>>2]|0);c[n>>2]=47102;I=c[n>>2]|0;l=k;return I|0}c[x>>2]=0;while(1){if((c[x>>2]|0)>=(c[r>>2]|0)){J=56;break}Uw(c[D>>2]|0,-1,c[s>>2]|0)|0;C=(c[D>>2]|0)+((c[s>>2]|0)-1)|0;a[C>>0]=(d[C>>0]|0)-(c[x>>2]|0);a[(c[D>>2]|0)+1>>0]=0;a[c[D>>2]>>0]=0;a[(c[D>>2]|0)+2>>0]=7;c[u>>2]=0;while(1){if((c[u>>2]|0)>=(S(c[s>>2]|0,c[r>>2]|0)|0))break;a[(c[z>>2]|0)+(c[u>>2]|0)>>0]=c[u>>2];c[u>>2]=(c[u>>2]|0)+1}c[u>>2]=0;while(1){if((c[u>>2]|0)>=(S(c[s>>2]|0,c[r>>2]|0)|0))break;ub[c[p>>2]&63](c[y>>2]|0,(c[B>>2]|0)+(c[u>>2]|0)|0,c[D>>2]|0)|0;c[v>>2]=0;while(1){if((c[v>>2]|0)>=(c[s>>2]|0))break;C=(c[B>>2]|0)+((c[u>>2]|0)+(c[v>>2]|0))|0;a[C>>0]=d[C>>0]^d[(c[z>>2]|0)+((c[u>>2]|0)+(c[v>>2]|0))>>0];c[v>>2]=(c[v>>2]|0)+1}c[v>>2]=c[s>>2];while(1){if((c[v>>2]|0)<=0)break;C=(c[D>>2]|0)+((c[v>>2]|0)-1)|0;a[C>>0]=(a[C>>0]|0)+1<<24>>24;if(a[(c[D>>2]|0)+((c[v>>2]|0)-1)>>0]|0)break;c[v>>2]=(c[v>>2]|0)+-1}c[u>>2]=(c[u>>2]|0)+(c[s>>2]|0)}Uw(c[E>>2]|0,-1,c[s>>2]|0)|0;C=(c[E>>2]|0)+((c[s>>2]|0)-1)|0;a[C>>0]=(d[C>>0]|0)-(c[x>>2]|0);a[(c[E>>2]|0)+1>>0]=0;a[c[E>>2]>>0]=0;a[(c[E>>2]|0)+2>>0]=7;vb[c[q>>2]&15](c[y>>2]|0,c[E>>2]|0,c[A>>2]|0,c[B>>2]|0,c[r>>2]|0);if(Jv(c[A>>2]|0,c[z>>2]|0,S(c[s>>2]|0,c[r>>2]|0)|0)|0){J=52;break}if(Jv(c[E>>2]|0,c[D>>2]|0,c[s>>2]|0)|0){J=54;break}c[x>>2]=(c[x>>2]|0)+1}if((J|0)==52){vf(c[F>>2]|0);c[n>>2]=47102;I=c[n>>2]|0;l=k;return I|0}else if((J|0)==54){vf(c[F>>2]|0);c[n>>2]=47102;I=c[n>>2]|0;l=k;return I|0}else if((J|0)==56){vf(c[F>>2]|0);c[n>>2]=0;I=c[n>>2]|0;l=k;return I|0}return 0}function xr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,aa=0,ba=0,ca=0,da=0;d=l;l=l+352|0;if((l|0)>=(m|0))$(352);e=d+160|0;f=d+128|0;g=d+48|0;h=d+40|0;i=d+32|0;j=d+24|0;k=d+16|0;n=d+8|0;o=d;p=d+344|0;q=d+340|0;r=d+336|0;s=d+332|0;t=d+328|0;u=d+284|0;v=d+224|0;w=d+220|0;x=d+216|0;y=d+212|0;z=d+208|0;A=d+204|0;B=d+200|0;C=d+196|0;D=d+192|0;E=d+188|0;F=d+184|0;G=d+180|0;H=d+176|0;I=d+172|0;J=d+168|0;K=d+164|0;c[q>>2]=a;c[r>>2]=b;c[w>>2]=0;c[x>>2]=0;c[y>>2]=0;c[z>>2]=0;c[A>>2]=0;c[C>>2]=0;c[D>>2]=0;c[E>>2]=0;c[F>>2]=0;c[G>>2]=0;c[H>>2]=0;c[I>>2]=0;b=u;a=b+44|0;do{c[b>>2]=0;b=b+4|0}while((b|0)<(a|0));b=v;a=b+60|0;do{c[b>>2]=0;b=b+4|0}while((b|0)<(a|0));c[s>>2]=Gj(c[q>>2]|0,t)|0;if(c[s>>2]|0){c[p>>2]=c[s>>2];L=c[p>>2]|0;l=d;return L|0}c[B>>2]=Tf(c[q>>2]|0,47218,0)|0;if(c[B>>2]|0?(c[A>>2]=_f(c[B>>2]|0,1)|0,Rf(c[B>>2]|0),(c[A>>2]|0)==0):0){c[p>>2]=65;L=c[p>>2]|0;l=d;return L|0}c[B>>2]=Tf(c[q>>2]|0,47178,0)|0;if(!(c[B>>2]|0?(c[s>>2]=Fj(c[B>>2]|0,I,0)|0,Rf(c[B>>2]|0),(c[s>>2]|0)!=0):0))M=8;do if((M|0)==8){c[B>>2]=Tf(c[q>>2]|0,48942,0)|0;if(c[B>>2]|0){c[I>>2]=c[I>>2]|32;Rf(c[B>>2]|0)}if(!((c[t>>2]|0)!=0|(c[A>>2]|0)!=0)){c[p>>2]=68;L=c[p>>2]|0;l=d;return L|0}c[s>>2]=Qh(c[t>>2]|0,c[A>>2]|0,u,t)|0;vf(c[A>>2]|0);c[A>>2]=0;if(!(c[s>>2]|0)){if(Ff(1)|0){b=vi(c[u>>2]|0)|0;a=wi(c[u+4>>2]|0)|0;c[o>>2]=b;c[o+4>>2]=a;Ye(48956,o);if(c[u+40>>2]|0){c[n>>2]=c[u+40>>2];Ye(48981,n)}af(49003,c[u+8>>2]|0);af(49019,c[u+12>>2]|0);af(49035,c[u+16>>2]|0);af(49051,c[u+32>>2]|0);af(49067,c[u+36>>2]|0);sn(49083,u+20|0,0)}c[C>>2]=En(c[u>>2]|0,c[u+4>>2]|0,0,c[u+8>>2]|0,c[u+12>>2]|0,c[u+16>>2]|0)|0;a=c[C>>2]|0;b=c[I>>2]|0;if(c[I>>2]&4096|0)c[s>>2]=ki(v,u,a,b)|0;else c[s>>2]=Ir(v,u,a,b,c[t>>2]|0,y,z)|0;if(!(c[s>>2]|0)){c[w>>2]=Rp(0)|0;c[x>>2]=Rp(0)|0;if(tn(c[w>>2]|0,c[x>>2]|0,v+20|0,c[C>>2]|0)|0){c[k>>2]=49145;We(49097,k)}c[F>>2]=xi(c[w>>2]|0,c[x>>2]|0,c[v+8>>2]|0)|0;do if((c[v+4>>2]|0)==1?!(c[I>>2]&2048|0):0){c[s>>2]=ci(v+44|0,c[C>>2]|0,c[w>>2]|0,c[x>>2]|0,((c[I>>2]&1024|0)!=0^1^1)&1,J,K)|0;if(!(c[s>>2]|0)){c[G>>2]=Rp(0)|0;Ep(c[G>>2]|0,c[J>>2]|0,c[K>>2]<<3)|0;c[J>>2]=0;break}c[p>>2]=c[s>>2];L=c[p>>2]|0;l=d;return L|0}else M=28;while(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]|0;c[f>>2]=c[D>>2];c[f+4>>2]=da;c[f+8>>2]=ca;c[f+12>>2]=ba;c[f+16>>2]=aa;c[f+20>>2]=_;c[f+24>>2]=Z;c[s>>2]=cg(b,0,49344,f)|0}if(((c[s>>2]|0)==0?Ff(1)|0:0)?(af(49420,c[v+8>>2]|0),af(49436,c[v+12>>2]|0),af(49452,c[v+16>>2]|0),af(49468,c[F>>2]|0),af(49484,c[v+32>>2]|0),af(49500,c[v+36>>2]|0),af(49516,c[G>>2]|0),af(49532,c[H>>2]|0),c[I>>2]&4096|0):0)Ye(49548,e)}}}while(0);Dp(c[H>>2]|0);Dp(c[G>>2]|0);Dp(c[F>>2]|0);si(v);An(v+44|0);Dp(c[v+56>>2]|0);si(u);Dp(c[w>>2]|0);Dp(c[x>>2]|0);Dp(c[y>>2]|0);Dp(c[z>>2]|0);In(c[C>>2]|0);Rf(c[E>>2]|0);Rf(c[D>>2]|0);c[p>>2]=c[s>>2];L=c[p>>2]|0;l=d;return L|0}function yr(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;b=l;l=l+176|0;if((l|0)>=(m|0))$(176);d=b+72|0;e=b+64|0;f=b+56|0;g=b+40|0;h=b;i=b+168|0;j=b+164|0;k=b+160|0;n=b+156|0;o=b+152|0;p=b+148|0;q=b+144|0;r=b+140|0;s=b+80|0;t=b+76|0;c[j>>2]=a;c[n>>2]=0;c[o>>2]=0;c[p>>2]=0;c[q>>2]=0;c[r>>2]=0;c[t>>2]=0;a=s;u=a+60|0;do{c[a>>2]=0;a=a+4|0}while((a|0)<(u|0));c[n>>2]=Tf(c[j>>2]|0,47178,0)|0;if(!(c[n>>2]|0?(c[k>>2]=Fj(c[n>>2]|0,o,0)|0,(c[k>>2]|0)!=0):0))v=3;do if((v|0)==3){a=c[j>>2]|0;if(c[o>>2]&512|0){c[h>>2]=s+8;c[h+4>>2]=s+12;c[h+8>>2]=s+16;c[h+12>>2]=q;c[h+16>>2]=s+32;c[h+20>>2]=s+36;c[h+24>>2]=r;c[h+28>>2]=s+56;c[h+32>>2]=0;c[k>>2]=lg(a,0,47535,h)|0}else{c[g>>2]=r;c[g+4>>2]=s+56;c[g+8>>2]=0;c[k>>2]=lg(a,0,47554,g)|0}if(!(c[k>>2]|0)){Rf(c[n>>2]|0);c[n>>2]=Tf(c[j>>2]|0,47218,5)|0;if((c[n>>2]|0?(c[p>>2]=_f(c[n>>2]|0,1)|0,c[p>>2]|0):0)?(c[k>>2]=Th(c[p>>2]|0,s,s+4|0,s+8|0,s+12|0,s+16|0,q,s+32|0,s+36|0)|0,c[k>>2]|0):0){c[i>>2]=c[k>>2];w=c[i>>2]|0;l=b;return w|0}if(c[q>>2]|0?(yn(s+20|0),c[k>>2]=zi(s+20|0,c[q>>2]|0)|0,c[k>>2]|0):0)break;if(!(c[p>>2]|0)){c[s>>2]=c[o>>2]&4096|0?2:0;c[s+4>>2]=c[o>>2]&4096|0?1:0}if(Ff(1)|0){a=vi(c[s>>2]|0)|0;u=wi(c[s+4>>2]|0)|0;c[f>>2]=a;c[f+4>>2]=u;Ye(48463,f);if(c[s+40>>2]|0){c[e>>2]=c[s+40>>2];Ye(48487,e)}af(48508,c[s+8>>2]|0);af(48524,c[s+12>>2]|0);af(48540,c[s+16>>2]|0);sn(48556,s+20|0,0);af(48570,c[s+32>>2]|0);af(48586,c[s+36>>2]|0);af(48602,c[r>>2]|0);if(!(Wg()|0))af(48618,c[s+56>>2]|0)}if((((((c[s+8>>2]|0?c[s+12>>2]|0:0)?c[s+16>>2]|0:0)?c[s+20>>2]|0:0)?c[s+32>>2]|0:0)?c[s+36>>2]|0:0)?c[s+56>>2]|0:0){c[t>>2]=En(c[s>>2]|0,c[s+4>>2]|0,0,c[s+8>>2]|0,c[s+12>>2]|0,c[s+16>>2]|0)|0;if(!(c[r>>2]|0)){c[k>>2]=68;break}yn(s+44|0);if((c[(c[t>>2]|0)+4>>2]|0)==1)c[k>>2]=hi(c[r>>2]|0,c[t>>2]|0,s+44|0,0,0)|0;else c[k>>2]=zi(s+44|0,c[r>>2]|0)|0;if(c[k>>2]|0)break;if(!(Hr(s,c[t>>2]|0,c[o>>2]|0)|0))break;c[k>>2]=7;break}c[k>>2]=68}}while(0);In(c[t>>2]|0);Tp(c[s+8>>2]|0);Tp(c[s+12>>2]|0);Tp(c[s+16>>2]|0);Tp(c[q>>2]|0);An(s+20|0);Tp(c[s+32>>2]|0);Tp(c[s+36>>2]|0);Tp(c[r>>2]|0);An(s+44|0);Tp(c[s+56>>2]|0);vf(c[p>>2]|0);Rf(c[n>>2]|0);if(Ff(1)|0){c[d>>2]=Bt(c[k>>2]|0)|0;Ye(48634,d)}c[i>>2]=c[k>>2];w=c[i>>2]|0;l=b;return w|0}function zr(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;e=l;l=l+256|0;if((l|0)>=(m|0))$(256);f=e+72|0;g=e+64|0;h=e+56|0;i=e+48|0;j=e+40|0;k=e+32|0;n=e;o=e+248|0;p=e+244|0;q=e+240|0;r=e+236|0;s=e+232|0;t=e+192|0;u=e+184|0;v=e+180|0;w=e+176|0;x=e+172|0;y=e+168|0;z=e+164|0;A=e+160|0;B=e+104|0;C=e+96|0;D=e+84|0;E=e+80|0;F=e+76|0;c[p>>2]=a;c[q>>2]=b;c[r>>2]=d;c[u>>2]=0;c[v>>2]=0;c[w>>2]=0;c[x>>2]=0;c[y>>2]=0;c[z>>2]=0;c[A>>2]=0;c[C>>2]=0;d=B;b=d+56|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(b|0));Lj(t,0,Dr(c[r>>2]|0)|0);c[s>>2]=Nj(c[q>>2]|0,A,t)|0;do if(!(c[s>>2]|0)){if(Ff(1)|0)af(48123,c[A>>2]|0);if(c[A>>2]|0?c[(c[A>>2]|0)+12>>2]&4|0:0){c[s>>2]=79;break}q=c[r>>2]|0;c[n>>2]=B+8;c[n+4>>2]=B+12;c[n+8>>2]=B+16;c[n+12>>2]=w;c[n+16>>2]=B+32;c[n+20>>2]=B+36;c[n+24>>2]=x;c[n+28>>2]=0;c[s>>2]=lg(q,0,48140,n)|0;if(!(c[s>>2]|0)){if(c[w>>2]|0?(yn(B+20|0),c[s>>2]=zi(B+20|0,c[w>>2]|0)|0,c[s>>2]|0):0)break;Rf(c[u>>2]|0);c[u>>2]=Tf(c[r>>2]|0,47218,5)|0;if((c[u>>2]|0?(c[v>>2]=_f(c[u>>2]|0,1)|0,c[v>>2]|0):0)?(c[s>>2]=Qh(0,c[v>>2]|0,B,0)|0,c[s>>2]|0):0){c[o>>2]=c[s>>2];G=c[o>>2]|0;l=e;return G|0}if(!(c[v>>2]|0)){c[B>>2]=0;c[B+4>>2]=0}if(Ff(1)|0){q=vi(c[B>>2]|0)|0;d=wi(c[B+4>>2]|0)|0;c[k>>2]=q;c[k+4>>2]=d;Ye(48156,k);if(c[B+40>>2]|0){c[j>>2]=c[B+40>>2];Ye(48181,j)}af(48203,c[B+8>>2]|0);af(48220,c[B+12>>2]|0);af(48237,c[B+16>>2]|0);sn(48254,B+20|0,0);af(48269,c[B+32>>2]|0);af(48286,c[B+36>>2]|0);af(48303,c[x>>2]|0)}if(((((c[B+8>>2]|0?c[B+12>>2]|0:0)?c[B+16>>2]|0:0)?c[B+20>>2]|0:0)?c[B+32>>2]|0:0)?(c[B+36>>2]|0)!=0&(c[x>>2]|0)!=0:0){if(c[x>>2]|0?(yn(B+44|0),c[s>>2]=zi(B+44|0,c[x>>2]|0)|0,c[s>>2]|0):0)break;c[C>>2]=En(c[B>>2]|0,c[B+4>>2]|0,0,c[B+8>>2]|0,c[B+12>>2]|0,c[B+16>>2]|0)|0;c[E>>2]=Rp(0)|0;c[F>>2]=Rp(0)|0;yn(D);$n(D,c[A>>2]|0,B+44|0,c[C>>2]|0);if(tn(c[E>>2]|0,c[F>>2]|0,D,c[C>>2]|0)|0)We(48320,i);c[y>>2]=xi(c[E>>2]|0,c[F>>2]|0,c[B+8>>2]|0)|0;$n(D,c[A>>2]|0,B+20|0,c[C>>2]|0);if(tn(c[E>>2]|0,c[F>>2]|0,D,c[C>>2]|0)|0)We(48368,h);else{c[z>>2]=xi(c[E>>2]|0,c[F>>2]|0,c[B+8>>2]|0)|0;Dp(c[E>>2]|0);Dp(c[F>>2]|0);An(D);d=c[p>>2]|0;q=c[z>>2]|0;c[g>>2]=c[y>>2];c[g+4>>2]=q;c[s>>2]=cg(d,0,48415,g)|0;break}}c[s>>2]=68}}while(0);Tp(c[B+8>>2]|0);Tp(c[B+12>>2]|0);Tp(c[B+16>>2]|0);Tp(c[w>>2]|0);An(B+20|0);Tp(c[B+32>>2]|0);Tp(c[B+36>>2]|0);Tp(c[x>>2]|0);An(B+44|0);Tp(c[A>>2]|0);Tp(c[y>>2]|0);Tp(c[z>>2]|0);vf(c[v>>2]|0);In(c[C>>2]|0);Mj(t);if(Ff(1)|0){c[f>>2]=Bt(c[s>>2]|0)|0;Ye(48441,f)}c[o>>2]=c[s>>2];G=c[o>>2]|0;l=e;return G|0}function Ar(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;e=l;l=l+256|0;if((l|0)>=(m|0))$(256);f=e+72|0;g=e+64|0;h=e+56|0;i=e+48|0;j=e+40|0;k=e+8|0;n=e;o=e+248|0;p=e+244|0;q=e+240|0;r=e+236|0;s=e+232|0;t=e+192|0;u=e+188|0;v=e+184|0;w=e+124|0;x=e+120|0;y=e+116|0;z=e+112|0;A=e+100|0;B=e+88|0;C=e+84|0;D=e+80|0;E=e+76|0;c[p>>2]=a;c[q>>2]=b;c[r>>2]=d;c[u>>2]=0;c[v>>2]=0;c[x>>2]=0;c[y>>2]=0;c[z>>2]=0;c[C>>2]=0;d=w;b=d+60|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(b|0));yn(A);yn(B);Lj(t,1,Dr(c[r>>2]|0)|0);c[s>>2]=Jj(c[q>>2]|0,12976,u,t)|0;do if((c[s>>2]|0)==0?(q=c[u>>2]|0,c[n>>2]=v,c[n+4>>2]=0,c[s>>2]=lg(q,0,47834,n)|0,(c[s>>2]|0)==0):0){if(Ff(1)|0)af(47836,c[v>>2]|0);if(c[v>>2]|0?c[(c[v>>2]|0)+12>>2]&4|0:0){c[s>>2]=79;break}q=c[r>>2]|0;c[k>>2]=w+8;c[k+4>>2]=w+12;c[k+8>>2]=w+16;c[k+12>>2]=x;c[k+16>>2]=w+32;c[k+20>>2]=w+36;c[k+24>>2]=w+56;c[k+28>>2]=0;c[s>>2]=lg(q,0,47853,k)|0;if(!(c[s>>2]|0)){if(c[x>>2]|0?(yn(w+20|0),c[s>>2]=zi(w+20|0,c[x>>2]|0)|0,c[s>>2]|0):0)break;Rf(c[u>>2]|0);c[u>>2]=Tf(c[r>>2]|0,47218,5)|0;if((c[u>>2]|0?(c[y>>2]=_f(c[u>>2]|0,1)|0,c[y>>2]|0):0)?(c[s>>2]=Qh(0,c[y>>2]|0,w,0)|0,c[s>>2]|0):0){c[o>>2]=c[s>>2];F=c[o>>2]|0;l=e;return F|0}if(!(c[y>>2]|0)){c[w>>2]=0;c[w+4>>2]=0}if(Ff(1)|0){q=vi(c[w>>2]|0)|0;d=wi(c[w+4>>2]|0)|0;c[j>>2]=q;c[j+4>>2]=d;Ye(47869,j);if(c[w+40>>2]|0){c[i>>2]=c[w+40>>2];Ye(47894,i)}af(47916,c[w+8>>2]|0);af(47933,c[w+12>>2]|0);af(47950,c[w+16>>2]|0);sn(47967,w+20|0,0);af(47982,c[w+32>>2]|0);af(47999,c[w+36>>2]|0);if(!(Wg()|0))af(48016,c[w+56>>2]|0)}if((((((c[w+8>>2]|0?c[w+12>>2]|0:0)?c[w+16>>2]|0:0)?c[w+20>>2]|0:0)?c[w+32>>2]|0:0)?c[w+36>>2]|0:0)?c[w+56>>2]|0:0){c[s>>2]=zi(A,c[v>>2]|0)|0;if(c[s>>2]|0){An(A);c[o>>2]=c[s>>2];F=c[o>>2]|0;l=e;return F|0}c[z>>2]=En(c[w>>2]|0,c[w+4>>2]|0,0,c[w+8>>2]|0,c[w+12>>2]|0,c[w+16>>2]|0)|0;$n(B,c[w+56>>2]|0,A,c[z>>2]|0);c[D>>2]=Rp(0)|0;c[E>>2]=Rp(0)|0;if(tn(c[D>>2]|0,c[E>>2]|0,B,c[z>>2]|0)|0)We(48033,h);c[C>>2]=xi(c[D>>2]|0,c[E>>2]|0,c[w+8>>2]|0)|0;if(c[C>>2]|0)c[s>>2]=0;else c[s>>2]=Et()|0;Dp(c[D>>2]|0);Dp(c[E>>2]|0);if(Ff(1)|0)af(48073,c[C>>2]|0);if(c[s>>2]|0)break;d=c[p>>2]|0;c[g>>2]=c[C>>2];c[s>>2]=cg(d,0,48090,g)|0;break}c[s>>2]=68}}while(0);An(B);An(A);Tp(c[C>>2]|0);Tp(c[w+8>>2]|0);Tp(c[w+12>>2]|0);Tp(c[w+16>>2]|0);Tp(c[x>>2]|0);An(w+20|0);Tp(c[w+32>>2]|0);Tp(c[w+36>>2]|0);Tp(c[w+56>>2]|0);Tp(c[v>>2]|0);vf(c[y>>2]|0);Rf(c[u>>2]|0);In(c[z>>2]|0);Mj(t);if(Ff(1)|0){c[f>>2]=Bt(c[s>>2]|0)|0;Ye(48101,f)}c[o>>2]=c[s>>2];F=c[o>>2]|0;l=e;return F|0}function Br(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;e=l;l=l+272|0;if((l|0)>=(m|0))$(272);f=e+104|0;g=e+96|0;h=e+88|0;i=e+80|0;j=e+72|0;k=e+56|0;n=e+40|0;o=e;p=e+256|0;q=e+252|0;r=e+248|0;s=e+244|0;t=e+240|0;u=e+200|0;v=e+192|0;w=e+188|0;x=e+184|0;y=e+180|0;z=e+176|0;A=e+116|0;B=e+112|0;C=e+108|0;c[q>>2]=a;c[r>>2]=b;c[s>>2]=d;c[v>>2]=0;c[w>>2]=0;c[x>>2]=0;c[y>>2]=0;c[z>>2]=0;c[B>>2]=0;c[C>>2]=0;d=A;b=d+60|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(b|0));Lj(u,2,0);c[t>>2]=Nj(c[r>>2]|0,v,u)|0;do if(!(c[t>>2]|0)){if(Ff(1)|0)af(47519,c[v>>2]|0);r=c[s>>2]|0;if(c[u+12>>2]&512|0){c[o>>2]=A+8;c[o+4>>2]=A+12;c[o+8>>2]=A+16;c[o+12>>2]=y;c[o+16>>2]=A+32;c[o+20>>2]=A+36;c[o+24>>2]=z;c[o+28>>2]=A+56;c[o+32>>2]=0;c[t>>2]=lg(r,0,47535,o)|0}else{c[n>>2]=z;c[n+4>>2]=A+56;c[n+8>>2]=0;c[t>>2]=lg(r,0,47554,n)|0}if(!(c[t>>2]|0)){if(c[y>>2]|0?(yn(A+20|0),c[t>>2]=zi(A+20|0,c[y>>2]|0)|0,c[t>>2]|0):0)break;Rf(c[w>>2]|0);c[w>>2]=Tf(c[s>>2]|0,47218,5)|0;if((c[w>>2]|0?(c[x>>2]=_f(c[w>>2]|0,1)|0,c[x>>2]|0):0)?(c[t>>2]=Qh(0,c[x>>2]|0,A,0)|0,c[t>>2]|0):0){c[p>>2]=c[t>>2];D=c[p>>2]|0;l=e;return D|0}if(!(c[x>>2]|0)){c[A>>2]=c[u+12>>2]&4096|0?2:0;c[A+4>>2]=c[u+12>>2]&4096|0?1:0}if(Ff(1)|0){r=vi(c[A>>2]|0)|0;d=wi(c[A+4>>2]|0)|0;b=c[u+12>>2]&4096|0?47329:72319;c[k>>2]=r;c[k+4>>2]=d;c[k+8>>2]=b;Ye(47560,k);if(c[A+40>>2]|0){c[j>>2]=c[A+40>>2];Ye(47586,j)}af(47607,c[A+8>>2]|0);af(47623,c[A+12>>2]|0);af(47639,c[A+16>>2]|0);sn(47655,A+20|0,0);af(47669,c[A+32>>2]|0);af(47685,c[A+36>>2]|0);af(47701,c[z>>2]|0);if(!(Wg()|0))af(47717,c[A+56>>2]|0)}if((((((c[A+8>>2]|0?c[A+12>>2]|0:0)?c[A+16>>2]|0:0)?c[A+20>>2]|0:0)?c[A+32>>2]|0:0)?c[A+36>>2]|0:0)?c[A+56>>2]|0:0){c[B>>2]=Rp(0)|0;c[C>>2]=Rp(0)|0;if(c[u+12>>2]&4096|0){c[t>>2]=pi(c[v>>2]|0,A,c[B>>2]|0,c[C>>2]|0,c[u+16>>2]|0,c[z>>2]|0)|0;if(c[t>>2]|0)break;b=c[q>>2]|0;d=c[C>>2]|0;c[i>>2]=c[B>>2];c[i+4>>2]=d;c[t>>2]=cg(b,0,47733,i)|0;break}b=c[v>>2]|0;d=c[B>>2]|0;r=c[C>>2]|0;if(c[u+12>>2]&8192|0){c[t>>2]=yt(b,A,d,r)|0;if(c[t>>2]|0)break;a=c[q>>2]|0;E=c[C>>2]|0;c[h>>2]=c[B>>2];c[h+4>>2]=E;c[t>>2]=cg(a,0,47760,h)|0;break}else{c[t>>2]=wt(b,A,d,r,c[u+12>>2]|0,c[u+16>>2]|0)|0;if(c[t>>2]|0)break;r=c[q>>2]|0;d=c[C>>2]|0;c[g>>2]=c[B>>2];c[g+4>>2]=d;c[t>>2]=cg(r,0,47786,g)|0;break}}c[t>>2]=68}}while(0);Tp(c[A+8>>2]|0);Tp(c[A+12>>2]|0);Tp(c[A+16>>2]|0);Tp(c[y>>2]|0);An(A+20|0);Tp(c[A+32>>2]|0);Tp(c[A+36>>2]|0);Tp(c[z>>2]|0);An(A+44|0);Tp(c[A+56>>2]|0);Tp(c[B>>2]|0);Tp(c[C>>2]|0);vf(c[x>>2]|0);Tp(c[v>>2]|0);Rf(c[w>>2]|0);Mj(u);if(Ff(1)|0){c[f>>2]=Bt(c[t>>2]|0)|0;Ye(47813,f)}c[p>>2]=c[t>>2];D=c[p>>2]|0;l=e;return D|0}function Cr(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;e=l;l=l+272|0;if((l|0)>=(m|0))$(272);f=e+80|0;g=e+72|0;h=e+56|0;i=e+48|0;j=e+16|0;k=e;n=e+256|0;o=e+252|0;p=e+248|0;q=e+244|0;r=e+240|0;s=e+200|0;t=e+192|0;u=e+188|0;v=e+184|0;w=e+180|0;x=e+176|0;y=e+172|0;z=e+168|0;A=e+112|0;B=e+104|0;C=e+100|0;D=e+96|0;E=e+92|0;F=e+88|0;G=e+84|0;c[o>>2]=a;c[p>>2]=b;c[q>>2]=d;c[t>>2]=0;c[u>>2]=0;c[v>>2]=0;c[w>>2]=0;c[x>>2]=0;c[y>>2]=0;c[z>>2]=0;d=A;b=d+56|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(b|0));Lj(s,3,Dr(c[q>>2]|0)|0);c[r>>2]=Nj(c[p>>2]|0,z,s)|0;a:do if(!(c[r>>2]|0)){if(Ff(1)|0)af(47261,c[z>>2]|0);c[r>>2]=Ij(c[o>>2]|0,12976,t,B)|0;if((c[r>>2]|0)==0?(p=c[t>>2]|0,d=c[B>>2]&4096|0?47277:47175,c[k>>2]=x,c[k+4>>2]=y,c[k+8>>2]=0,c[r>>2]=lg(p,0,d,k)|0,(c[r>>2]|0)==0):0){if(Ff(1)|0){af(47281,c[x>>2]|0);af(47297,c[y>>2]|0)}if(c[s+12>>2]&4096^c[B>>2]&4096|0){c[r>>2]=70;break}d=c[q>>2]|0;if(c[s+12>>2]&512|0){c[j>>2]=A+8;c[j+4>>2]=A+12;c[j+8>>2]=A+16;c[j+12>>2]=v;c[j+16>>2]=A+32;c[j+20>>2]=A+32;c[j+24>>2]=w;c[j+28>>2]=0;c[r>>2]=lg(d,0,47313,j)|0}else{c[i>>2]=w;c[i+4>>2]=0;c[r>>2]=lg(d,0,47213,i)|0}if(!(c[r>>2]|0)){if(c[v>>2]|0?(yn(A+20|0),c[r>>2]=zi(A+20|0,c[v>>2]|0)|0,c[r>>2]|0):0)break;Rf(c[t>>2]|0);c[t>>2]=Tf(c[q>>2]|0,47218,5)|0;if((c[t>>2]|0?(c[u>>2]=_f(c[t>>2]|0,1)|0,c[u>>2]|0):0)?(c[r>>2]=Qh(0,c[u>>2]|0,A,0)|0,c[r>>2]|0):0){c[n>>2]=c[r>>2];H=c[n>>2]|0;l=e;return H|0}if(!(c[u>>2]|0)){c[A>>2]=c[B>>2]&4096|0?2:0;c[A+4>>2]=c[B>>2]&4096|0?1:0}if(Ff(1)|0){d=vi(c[A>>2]|0)|0;p=wi(c[A+4>>2]|0)|0;b=c[B>>2]&4096|0?47329:72319;c[h>>2]=d;c[h+4>>2]=p;c[h+8>>2]=b;Ye(47336,h);if(c[A+40>>2]|0){c[g>>2]=c[A+40>>2];Ye(47362,g)}af(47383,c[A+8>>2]|0);af(47399,c[A+12>>2]|0);af(47415,c[A+16>>2]|0);sn(47431,A+20|0,0);af(47445,c[A+32>>2]|0);af(47461,c[A+36>>2]|0);af(47477,c[w>>2]|0)}if(((((c[A+8>>2]|0?c[A+12>>2]|0:0)?c[A+16>>2]|0:0)?c[A+20>>2]|0:0)?c[A+32>>2]|0:0)?(c[A+36>>2]|0)!=0&(c[w>>2]|0)!=0:0){if(c[B>>2]&4096|0){c[r>>2]=ri(c[z>>2]|0,A,c[x>>2]|0,c[y>>2]|0,c[s+16>>2]|0,c[w>>2]|0)|0;break}b=(c[B>>2]&8192|0)!=0;yn(A+44|0);if(b){c[r>>2]=zi(A+44|0,c[w>>2]|0)|0;if(c[r>>2]|0)break;c[r>>2]=zt(c[z>>2]|0,A,c[x>>2]|0,c[y>>2]|0)|0;break}if((c[A+4>>2]|0)==1){c[C>>2]=En(c[A>>2]|0,c[A+4>>2]|0,0,c[A+8>>2]|0,c[A+12>>2]|0,c[A+16>>2]|0)|0;c[r>>2]=hi(c[w>>2]|0,c[C>>2]|0,A+44|0,0,0)|0;In(c[C>>2]|0)}else c[r>>2]=zi(A+44|0,c[w>>2]|0)|0;if(c[r>>2]|0)break;do if(c[z>>2]|0){if(!(c[(c[z>>2]|0)+12>>2]&4))break;c[F>>2]=lo(c[A+32>>2]|0)|0;c[D>>2]=Gp(c[z>>2]|0,E)|0;c[r>>2]=Zo(G,5,c[D>>2]|0,(((c[E>>2]|0)+7|0)>>>0)/8|0,0)|0;if(c[r>>2]|0)break a;if((c[E>>2]|0)>>>0>(c[F>>2]|0)>>>0)so(c[G>>2]|0,c[G>>2]|0,(c[E>>2]|0)-(c[F>>2]|0)|0);c[r>>2]=xt(c[G>>2]|0,A,c[x>>2]|0,c[y>>2]|0)|0;Tp(c[G>>2]|0);break a}while(0);c[r>>2]=xt(c[z>>2]|0,A,c[x>>2]|0,c[y>>2]|0)|0;break}c[r>>2]=68}}}while(0);Tp(c[A+8>>2]|0);Tp(c[A+12>>2]|0);Tp(c[A+16>>2]|0);Tp(c[v>>2]|0);An(A+20|0);Tp(c[A+32>>2]|0);Tp(c[A+36>>2]|0);Tp(c[w>>2]|0);An(A+44|0);Tp(c[z>>2]|0);Tp(c[x>>2]|0);Tp(c[y>>2]|0);vf(c[u>>2]|0);Rf(c[t>>2]|0);Mj(s);if(Ff(1)|0){if(c[r>>2]|0)I=Bt(c[r>>2]|0)|0;else I=47493;c[f>>2]=I;Ye(47498,f)}c[n>>2]=c[r>>2];H=c[n>>2]|0;l=e;return H|0}function Dr(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;b=l;l=l+32|0;if((l|0)>=(m|0))$(32);d=b+20|0;e=b+16|0;f=b+12|0;g=b+8|0;h=b+4|0;i=b;c[e>>2]=a;c[h>>2]=0;c[f>>2]=Tf(c[e>>2]|0,47259,1)|0;if(c[f>>2]|0){c[g>>2]=$f(c[f>>2]|0,1,5)|0;Rf(c[f>>2]|0);if(c[g>>2]|0){c[h>>2]=lo(c[g>>2]|0)|0;Tp(c[g>>2]|0)}}else{c[f>>2]=Tf(c[e>>2]|0,47218,5)|0;if(!(c[f>>2]|0)){c[d>>2]=0;j=c[d>>2]|0;l=b;return j|0}c[i>>2]=_f(c[f>>2]|0,1)|0;Rf(c[f>>2]|0);if(!(c[i>>2]|0)){c[d>>2]=0;j=c[d>>2]|0;l=b;return j|0}if(Qh(0,c[i>>2]|0,0,h)|0)c[h>>2]=0;vf(c[i>>2]|0)}c[d>>2]=c[h>>2];j=c[d>>2]|0;l=b;return j|0}function Er(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e;c[g>>2]=a;c[e+4>>2]=b;c[h>>2]=d;if((c[g>>2]|0)!=18){c[f>>2]=4;i=c[f>>2]|0;l=e;return i|0}else{c[f>>2]=Gr(c[h>>2]|0)|0;i=c[f>>2]|0;l=e;return i|0}return 0}function Fr(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;e=l;l=l+208|0;if((l|0)>=(m|0))$(208);f=e+88|0;g=e+80|0;h=e+72|0;i=e+64|0;j=e+32|0;k=e;n=e+172|0;o=e+168|0;p=e+164|0;q=e+160|0;r=e+132|0;s=e+128|0;t=e+124|0;u=e+120|0;v=e+116|0;w=e+112|0;x=e+176|0;y=e+108|0;z=e+104|0;A=e+100|0;B=e+96|0;c[n>>2]=b;c[o>>2]=d;c[t>>2]=0;c[u>>2]=0;c[v>>2]=0;c[w>>2]=0;c[s>>2]=0;while(1){if((c[s>>2]|0)>=7)break;c[r+(c[s>>2]<<2)>>2]=0;c[s>>2]=(c[s>>2]|0)+1}c[q>>2]=Tf(c[o>>2]|0,47178,0)|0;if(!(c[q>>2]|0?(c[p>>2]=Fj(c[q>>2]|0,u,0)|0,(c[p>>2]|0)!=0):0))C=6;a:do if((C|0)==6){d=(c[u>>2]&4096|0)!=0;b=c[o>>2]|0;do if(c[u>>2]&512|0){D=r+4|0;E=r+8|0;F=r+12|0;G=r+16|0;H=r+20|0;I=r+24|0;if(d){c[k>>2]=r;c[k+4>>2]=D;c[k+8>>2]=E;c[k+12>>2]=F;c[k+16>>2]=G;c[k+20>>2]=H;c[k+24>>2]=I;c[k+28>>2]=0;c[p>>2]=lg(b,0,47184,k)|0;break}else{c[j>>2]=r;c[j+4>>2]=D;c[j+8>>2]=E;c[j+12>>2]=F;c[j+16>>2]=G;c[j+20>>2]=H;c[j+24>>2]=I;c[j+28>>2]=0;c[p>>2]=lg(b,0,47199,j)|0;break}}else{I=r+24|0;if(d){c[i>>2]=I;c[i+4>>2]=0;c[p>>2]=lg(b,0,47213,i)|0;break}else{c[h>>2]=I;c[h+4>>2]=0;c[p>>2]=lg(b,0,47216,h)|0;break}}while(0);if(!(c[p>>2]|0)){Rf(c[q>>2]|0);c[q>>2]=Tf(c[o>>2]|0,47218,5)|0;if((c[q>>2]|0?(c[t>>2]=_f(c[q>>2]|0,1)|0,c[t>>2]|0):0)?(c[p>>2]=Th(c[t>>2]|0,v,w,r,r+4|0,r+8|0,r+12|0,r+16|0,r+20|0)|0,c[p>>2]|0):0)break;if(!(c[t>>2]|0)){c[v>>2]=c[u>>2]&4096|0?2:0;c[w>>2]=c[u>>2]&4096|0?1:0}c[s>>2]=0;while(1){if((c[s>>2]|0)>=7)break;if(!(c[r+(c[s>>2]<<2)>>2]|0)){C=22;break}ko(c[r+(c[s>>2]<<2)>>2]|0);c[s>>2]=(c[s>>2]|0)+1}if((C|0)==22){c[p>>2]=68;break}if(c[u>>2]&4096|0){if((c[w>>2]|0)==1)c[p>>2]=ei(c[r+24>>2]|0,256)|0;else c[p>>2]=69;if(c[p>>2]|0)break}c[s>>2]=0;b:while(1){if((c[s>>2]|0)>=7)break a;do if((c[s>>2]|0)!=5){if(c[r+(c[s>>2]<<2)>>2]|0?c[(c[r+(c[s>>2]<<2)>>2]|0)+12>>2]&4|0:0){c[y>>2]=Gp(c[r+(c[s>>2]<<2)>>2]|0,z)|0;c[z>>2]=(((c[z>>2]|0)+7|0)>>>0)/8|0;b=c[z>>2]|0;c[g>>2]=a[47224+(c[s>>2]|0)>>0];c[g+4>>2]=b;Su(x,30,47231,g)|0;b=c[n>>2]|0;$i(b,x,hv(x)|0);$i(c[n>>2]|0,c[y>>2]|0,c[z>>2]|0);$i(c[n>>2]|0,47240,1);break}c[A>>2]=Vo(c[r+(c[s>>2]<<2)>>2]|0,0,B,0)|0;if(!(c[A>>2]|0))break b;b=c[B>>2]|0;c[f>>2]=a[47224+(c[s>>2]|0)>>0];c[f+4>>2]=b;Su(x,30,47231,f)|0;b=c[n>>2]|0;$i(b,x,hv(x)|0);$i(c[n>>2]|0,c[A>>2]|0,c[B>>2]|0);$i(c[n>>2]|0,47240,1);vf(c[A>>2]|0)}while(0);c[s>>2]=(c[s>>2]|0)+1}c[p>>2]=Et()|0}}while(0);vf(c[t>>2]|0);Rf(c[q>>2]|0);c[s>>2]=0;while(1){if((c[s>>2]|0)>=7)break;Tp(c[r+(c[s>>2]<<2)>>2]|0);c[s>>2]=(c[s>>2]|0)+1}l=e;return c[p>>2]|0}function Gr(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[e>>2]=a;c[f>>2]=47242;c[g>>2]=0;if(!(c[g>>2]|0)){c[d>>2]=0;h=c[d>>2]|0;l=b;return h|0}if(c[e>>2]|0)Eb[c[e>>2]&1](47252,18,c[f>>2]|0,c[g>>2]|0);c[d>>2]=50;h=c[d>>2]|0;l=b;return h|0}function Hr(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;e=l;l=l+112|0;if((l|0)>=(m|0))$(112);f=e+64|0;g=e+56|0;h=e+48|0;i=e+40|0;j=e+32|0;k=e+24|0;n=e+16|0;o=e+8|0;p=e;q=e+108|0;r=e+104|0;s=e+100|0;t=e+96|0;u=e+84|0;v=e+80|0;w=e+76|0;x=e+72|0;y=e+68|0;c[q>>2]=a;c[r>>2]=b;c[s>>2]=d;c[t>>2]=1;c[x>>2]=0;c[y>>2]=0;yn(u);c[v>>2]=Rp(0)|0;if((c[c[r>>2]>>2]|0)==1)c[w>>2]=0;else c[w>>2]=Rp(0)|0;a:do if(!(bo((c[q>>2]|0)+20|0,c[r>>2]|0)|0)){if(Ff(1)|0)Ye(48655,p)}else{if(!(vo(c[(c[q>>2]|0)+20+8>>2]|0,0)|0)){if(!(Ff(1)|0))break;Ye(48707,o);break}if((c[(c[q>>2]|0)+4>>2]|0)!=1?($n(u,c[(c[q>>2]|0)+32>>2]|0,(c[q>>2]|0)+20|0,c[r>>2]|0),vo(c[u+8>>2]|0,0)|0):0){if(!(Ff(1)|0))break;Ye(48752,n);break}if(!(vo(c[(c[q>>2]|0)+44+8>>2]|0,0)|0)){if(!(Ff(1)|0))break;Ye(48799,k);break}if(!(Ai(u,c[r>>2]|0,(c[q>>2]|0)+20|0,c[(c[q>>2]|0)+56>>2]|0)|0)){if(!(Ff(1)|0))break;Ye(48845,j);break}if(tn(c[v>>2]|0,c[w>>2]|0,u,c[r>>2]|0)|0){if(!(Ff(1)|0))break;Ye(48799,i);break}do if(!(c[s>>2]&4096)){if(!(vo(c[(c[q>>2]|0)+44+8>>2]|0,1)|0)){if(!(wo(c[v>>2]|0,c[(c[q>>2]|0)+44>>2]|0)|0)){if(c[w>>2]|0)break;if(!(wo(c[w>>2]|0,c[(c[q>>2]|0)+44+4>>2]|0)|0))break}if(!(Ff(1)|0))break a;Ye(48882,h);break a}c[x>>2]=Rp(0)|0;c[y>>2]=Rp(0)|0;if(tn(c[x>>2]|0,c[y>>2]|0,(c[q>>2]|0)+44|0,c[r>>2]|0)|0){if(!(Ff(1)|0))break a;Ye(48799,g);break a}if((wo(c[v>>2]|0,c[x>>2]|0)|0)==0?(wo(c[w>>2]|0,c[y>>2]|0)|0)==0:0)break;if(!(Ff(1)|0))break a;Ye(48882,f);break a}while(0);c[t>>2]=0}while(0);Dp(c[x>>2]|0);Dp(c[v>>2]|0);Dp(c[w>>2]|0);Dp(c[y>>2]|0);An(u);l=e;return c[t>>2]|0}function Ir(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;j=l;l=l+96|0;if((l|0)>=(m|0))$(96);k=j+16|0;n=j+8|0;o=j;p=j+80|0;q=j+76|0;r=j+72|0;s=j+68|0;t=j+64|0;u=j+60|0;v=j+56|0;w=j+44|0;x=j+40|0;y=j+36|0;z=j+32|0;A=j+28|0;B=j+24|0;C=j+20|0;c[p>>2]=b;c[q>>2]=d;c[r>>2]=e;c[s>>2]=f;c[t>>2]=g;c[u>>2]=h;c[v>>2]=i;c[A>>2]=lo(c[(c[q>>2]|0)+8>>2]|0)|0;yn(w);if(c[s>>2]&32|0)c[x>>2]=1;else c[x>>2]=2;if((c[(c[r>>2]|0)+4>>2]|0)==1){i=Sp(256)|0;c[(c[p>>2]|0)+56>>2]=i;c[B>>2]=hn(32,c[x>>2]|0)|0;i=c[B>>2]|0;a[i>>0]=a[i>>0]&127;i=c[B>>2]|0;a[i>>0]=a[i>>0]|64;i=(c[B>>2]|0)+31|0;a[i>>0]=a[i>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)+56>>2]|0,c[(c[q>>2]|0)+32>>2]|0,c[(c[p>>2]|0)+56>>2]|0);r=(c[p>>2]|0)+44|0;o=c[y>>2]|0;B=c[z>>2]|0;Bn(r,o,B,Wp(1)|0)|0;if(Ff(1)|0)Ye(49583,n)}else Jr((c[p>>2]|0)+44|0,w);while(0);c[c[u>>2]>>2]=c[y>>2];c[c[v>>2]>>2]=c[z>>2];An(w);if(c[s>>2]&16384|0){l=j;return 0}s=c[p>>2]|0;w=(c[t>>2]|0)-64|0;if((c[c[p>>2]>>2]|0)!=1){Kr(s,w);l=j;return 0}else{Lr(s,w);l=j;return 0}return 0}function Jr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;Kp(c[c[e>>2]>>2]|0,c[c[f>>2]>>2]|0)|0;Kp(c[(c[e>>2]|0)+4>>2]|0,c[(c[f>>2]|0)+4>>2]|0)|0;Kp(c[(c[e>>2]|0)+8>>2]|0,c[(c[f>>2]|0)+8>>2]|0)|0;l=d;return}function Kr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;d=l;l=l+224|0;if((l|0)>=(m|0))$(224);e=d+168|0;f=d+24|0;g=d+16|0;h=d+8|0;i=d+164|0;j=d+160|0;k=d+104|0;n=d+100|0;o=d+88|0;p=d+84|0;q=d+80|0;r=d+76|0;s=d+72|0;t=d+28|0;c[i>>2]=a;c[j>>2]=b;c[n>>2]=Rp(c[j>>2]|0)|0;c[p>>2]=Rp(c[j>>2]|0)|0;c[q>>2]=Rp(c[j>>2]|0)|0;c[r>>2]=Rp(c[j>>2]|0)|0;c[s>>2]=Rp(c[j>>2]|0)|0;if(Ff(1)|0)Ye(49676,d);yn(o);b=e;a=c[i>>2]|0;u=b+44|0;do{c[b>>2]=c[a>>2];b=b+4|0;a=a+4|0}while((b|0)<(u|0));ti(t,e);b=k;a=t;u=b+44|0;do{c[b>>2]=c[a>>2];b=b+4|0;a=a+4|0}while((b|0)<(u|0));yn(k+44|0);Jr(k+44|0,(c[i>>2]|0)+44|0);Up(c[n>>2]|0,c[j>>2]|0,0);if(wt(c[n>>2]|0,c[i>>2]|0,c[r>>2]|0,c[s>>2]|0,0,0)|0)We(49806,h);if(xt(c[n>>2]|0,k,c[r>>2]|0,c[s>>2]|0)|0)We(49836,g);if(!(Ff(1)|0)){v=k+44|0;An(v);si(k);An(o);w=c[s>>2]|0;Dp(w);x=c[r>>2]|0;Dp(x);y=c[q>>2]|0;Dp(y);z=c[p>>2]|0;Dp(z);A=c[n>>2]|0;Dp(A);l=d;return}Ye(49874,f);v=k+44|0;An(v);si(k);An(o);w=c[s>>2]|0;Dp(w);x=c[r>>2]|0;Dp(x);y=c[q>>2]|0;Dp(y);z=c[p>>2]|0;Dp(z);A=c[n>>2]|0;Dp(A);l=d;return}function Lr(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;e=l;l=l+224|0;if((l|0)>=(m|0))$(224);f=e+168|0;g=e+24|0;h=e+16|0;i=e+8|0;j=e+164|0;k=e+160|0;n=e+104|0;o=e+100|0;p=e+88|0;q=e+84|0;r=e+80|0;s=e+76|0;t=e+32|0;u=e+28|0;c[j>>2]=b;c[k>>2]=d;if(Ff(1)|0)Ye(49676,e);yn(p);d=f;b=c[j>>2]|0;v=d+44|0;do{c[d>>2]=c[b>>2];d=d+4|0;b=b+4|0}while((d|0)<(v|0));ti(t,f);d=n;b=t;v=d+44|0;do{c[d>>2]=c[b>>2];d=d+4|0;b=b+4|0}while((d|0)<(v|0));yn(n+44|0);Jr(n+44|0,(c[j>>2]|0)+44|0);if((c[(c[j>>2]|0)+4>>2]|0)==1){c[o>>2]=Rp(256)|0;c[u>>2]=fn(32,0)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[q>>2]=g;c[r>>2]=0;c[s>>2]=0;g=oj(c[j>>2]|0)|0;if((g|0)!=(c[q>>2]|0)){c[i>>2]=49935;x=c[i>>2]|0;l=h;return x|0}c[s>>2]=Si(t,c[j>>2]|0,0)|0;if(c[s>>2]|0){c[i>>2]=49976;x=c[i>>2]|0;l=h;return x|0}a:do switch(c[k>>2]|0){case 0:{$i(c[t>>2]|0,c[n>>2]|0,c[o>>2]|0);break}case 1:{Uw(v|0,97,1e3)|0;c[w>>2]=0;while(1){if((c[w>>2]|0)>=1e3)break a;$i(c[t>>2]|0,v,1e3);c[w>>2]=(c[w>>2]|0)+1}break}default:c[r>>2]=49996}while(0);if((c[r>>2]|0)==0?(c[u>>2]=lj(c[t>>2]|0,c[j>>2]|0)|0,Jv(c[u>>2]|0,c[p>>2]|0,c[q>>2]|0)|0):0)c[r>>2]=50013;_i(c[t>>2]|0);c[i>>2]=c[r>>2];x=c[i>>2]|0;l=h;return x|0}function Nr(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+28|0;h=f+24|0;i=f+20|0;j=f+16|0;k=f+12|0;n=f+8|0;o=f+4|0;p=f;c[g>>2]=b;c[h>>2]=d;c[i>>2]=e;c[j>>2]=c[h>>2];c[k>>2]=c[g>>2];c[n>>2]=0;c[o>>2]=c[(c[k>>2]|0)+148>>2];if(128<(c[o>>2]|0)>>>0)Re(50029,112,50043);if(!(c[(c[k>>2]|0)+152>>2]|0)){l=f;return}if((c[(c[k>>2]|0)+144>>2]|0)==(c[o>>2]|0)?(c[n>>2]=ub[c[(c[k>>2]|0)+152>>2]&63](c[k>>2]|0,c[k>>2]|0,1)|0,bf(c[n>>2]|0),cf(),c[n>>2]=0,c[(c[k>>2]|0)+144>>2]=0,g=(c[k>>2]|0)+128|0,h=g,e=Ww(c[h>>2]|0,c[h+4>>2]|0,1,0)|0,h=D,d=g,c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|0;c[g>>2]=(c[g>>2]|0)+(c[o>>2]|0);c[h>>2]=(c[h>>2]|0)-(c[o>>2]|0)}if(c[h>>2]|0){Qr((c[f>>2]|0)+68+(c[(c[f>>2]|0)+88>>2]|0)|0,c[g>>2]|0,c[h>>2]|0);g=(c[f>>2]|0)+88|0;c[g>>2]=(c[g>>2]|0)+(c[h>>2]|0)}if(!(c[j>>2]|0)){l=e;return}bf(c[j>>2]|0);cf();l=e;return}function Pr(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=c[d>>2];c[e>>2]=(c[e>>2]|0)+3;c[e>>2]=(c[e>>2]|0)+(0-(c[e>>2]&3));l=b;return c[e>>2]|0}function Qr(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+28|0;h=f+24|0;i=f+20|0;j=f+16|0;k=f+12|0;n=f+8|0;o=f+4|0;c[g>>2]=b;c[h>>2]=d;c[i>>2]=e;c[j>>2]=c[g>>2];c[k>>2]=c[h>>2];c[f>>2]=3;if(!((c[j>>2]|c[k>>2])&3)){c[n>>2]=c[j>>2];c[o>>2]=c[k>>2];while(1){if((c[i>>2]|0)>>>0<4)break;h=c[o>>2]|0;c[o>>2]=h+4;g=c[h>>2]|0;h=c[n>>2]|0;c[n>>2]=h+4;c[h>>2]=g;c[i>>2]=(c[i>>2]|0)-4}c[j>>2]=c[n>>2];c[k>>2]=c[o>>2]}while(1){if(!(c[i>>2]|0))break;o=c[k>>2]|0;c[k>>2]=o+1;n=a[o>>0]|0;o=c[j>>2]|0;c[j>>2]=o+1;a[o>>0]=n;c[i>>2]=(c[i>>2]|0)+-1}l=f;return}function Rr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=Pr(c[e>>2]|0)|0;c[h>>2]=Bb[c[(c[(c[e>>2]|0)+84>>2]|0)+12>>2]&7](c[g>>2]|0,(c[e>>2]|0)+68|0,c[(c[e>>2]|0)+88>>2]|0,c[f>>2]|0)|0;bf(c[h>>2]|0);cf();l=d;return}function Sr(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;g=l;l=l+80|0;if((l|0)>=(m|0))$(80);h=g+8|0;i=g+40|0;j=g+36|0;k=g+32|0;n=g+28|0;o=g+48|0;p=g+20|0;q=g+16|0;r=g+44|0;s=g;t=g+12|0;c[j>>2]=b;c[k>>2]=e;c[n>>2]=f;c[g+24>>2]=pg()|0;if((c[17757]|0)==0?(c[17757]=1,c[17758]=Tr()|0,c[17758]|0):0){c[h>>2]=c[17758];Ve(50064,h)}if((c[n>>2]|0)!=32){c[i>>2]=44;u=c[i>>2]|0;l=g;return u|0}if(c[17758]|0){c[i>>2]=50;u=c[i>>2]|0;l=g;return u|0}c[(c[j>>2]|0)+84>>2]=13e3;Qr(o,c[k>>2]|0,32);Ur(c[j>>2]|0,o);c[p>>2]=o;c[q>>2]=32;a[r>>0]=0;o=s;c[o>>2]=d[r>>0];c[o+4>>2]=0;while(1){if(!(c[p>>2]&7|0?(c[q>>2]|0)!=0:0))break;a[c[p>>2]>>0]=a[r>>0]|0;c[p>>2]=(c[p>>2]|0)+1;c[q>>2]=(c[q>>2]|0)+-1}if((c[q>>2]|0)>>>0>=8){o=s;j=gx(c[o>>2]|0,c[o+4>>2]|0,16843009,16843009)|0;o=s;c[o>>2]=j;c[o+4>>2]=D;do{c[t>>2]=c[p>>2];o=s;j=c[o+4>>2]|0;k=c[t>>2]|0;c[k>>2]=c[o>>2];c[k+4>>2]=j;c[q>>2]=(c[q>>2]|0)-8;c[p>>2]=(c[p>>2]|0)+8}while((c[q>>2]|0)>>>0>=8)}while(1){if(!(c[q>>2]|0))break;a[c[p>>2]>>0]=a[r>>0]|0;c[p>>2]=(c[p>>2]|0)+1;c[q>>2]=(c[q>>2]|0)+-1}c[i>>2]=0;u=c[i>>2]|0;l=g;return u|0}function Tr(){var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;b=l;l=l+512|0;if((l|0)>=(m|0))$(512);d=b+192|0;e=b+100|0;f=b+8|0;g=b+472|0;h=b+216|0;i=b+200|0;j=b+4|0;k=b;n=e;o=n+92|0;do{c[n>>2]=0;n=n+4|0}while((n|0)<(o|0));n=f;o=n+92|0;do{c[n>>2]=0;n=n+4|0}while((n|0)<(o|0));n=i;o=n+16|0;do{a[n>>0]=0;n=n+1|0}while((n|0)<(o|0));_r(i,50095,131,50226);if(Jv(50258,i,16)|0){c[d>>2]=50274;p=c[d>>2]|0;l=b;return p|0}n=i;o=n+16|0;do{a[n>>0]=0;n=n+1|0}while((n|0)<(o|0));Sr(e,50226,32)|0;Or(e,50095,32);Or(e,50127,64);Or(e,50191,16);Or(e,50207,8);Or(e,50215,4);Or(e,50219,2);Or(e,50221,1);Or(e,50222,1);Or(e,50223,1);Or(e,50224,1);Or(e,50225,1);Rr(e,i);if(Jv(50258,i,16)|0){c[d>>2]=50298;p=c[d>>2]|0;l=b;return p|0}n=i;o=n+16|0;do{a[n>>0]=0;n=n+1|0}while((n|0)<(o|0));_r(i,50322,16,50338);if(Jv(50370,i,16)|0){c[d>>2]=50386;p=c[d>>2]|0;l=b;return p|0}Sr(f,50410,32)|0;c[j>>2]=0;while(1){if((c[j>>2]|0)>>>0>=256)break;c[k>>2]=0;while(1){if((c[k>>2]|0)>>>0>=32)break;a[g+(c[k>>2]|0)>>0]=c[j>>2];c[k>>2]=(c[k>>2]|0)+1}c[k>>2]=0;while(1){if((c[k>>2]|0)>>>0>=(c[j>>2]|0)>>>0)break;a[h+(c[k>>2]|0)>>0]=c[j>>2];c[k>>2]=(c[k>>2]|0)+1}_r(i,h,c[j>>2]|0,g);Or(f,i,16);c[j>>2]=(c[j>>2]|0)+1}Rr(f,i);if(Jv(50442,i,16)|0){c[d>>2]=50458;p=c[d>>2]|0;l=b;return p|0}else{c[d>>2]=0;p=c[d>>2]|0;l=b;return p|0}return 0}function Ur(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+8|0;f=d+4|0;g=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=Pr(c[e>>2]|0)|0;c[(c[e>>2]|0)+88>>2]=0;xb[c[(c[(c[e>>2]|0)+84>>2]|0)+4>>2]&7](c[g>>2]|0,c[f>>2]|0);l=d;return}function Vr(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=b;c[g>>2]=d;c[h>>2]=c[f>>2];f=(Zr(c[g>>2]|0)|0)&67108863;c[c[h>>2]>>2]=f;f=(Zr((c[g>>2]|0)+3|0)|0)>>>2&67108611;c[(c[h>>2]|0)+4>>2]=f;f=(Zr((c[g>>2]|0)+6|0)|0)>>>4&67092735;c[(c[h>>2]|0)+8>>2]=f;f=(Zr((c[g>>2]|0)+9|0)|0)>>>6&66076671;c[(c[h>>2]|0)+12>>2]=f;f=(Zr((c[g>>2]|0)+12|0)|0)>>>8&1048575;c[(c[h>>2]|0)+16>>2]=f;c[(c[h>>2]|0)+20>>2]=0;c[(c[h>>2]|0)+20+4>>2]=0;c[(c[h>>2]|0)+20+8>>2]=0;c[(c[h>>2]|0)+20+12>>2]=0;c[(c[h>>2]|0)+20+16>>2]=0;f=Zr((c[g>>2]|0)+16|0)|0;c[(c[h>>2]|0)+40>>2]=f;f=Zr((c[g>>2]|0)+20|0)|0;c[(c[h>>2]|0)+40+4>>2]=f;f=Zr((c[g>>2]|0)+24|0)|0;c[(c[h>>2]|0)+40+8>>2]=f;f=Zr((c[g>>2]|0)+28|0)|0;c[(c[h>>2]|0)+40+12>>2]=f;a[(c[h>>2]|0)+56>>0]=0;l=e;return}function Wr(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0;f=l;l=l+128|0;if((l|0)>=(m|0))$(128);g=f+116|0;h=f+112|0;i=f+108|0;j=f+104|0;k=f+100|0;n=f+96|0;o=f+92|0;p=f+88|0;q=f+84|0;r=f+80|0;s=f+76|0;t=f+72|0;u=f+68|0;v=f+64|0;w=f+60|0;x=f+56|0;y=f+52|0;z=f+48|0;A=f+44|0;B=f+32|0;C=f+24|0;E=f+16|0;F=f+8|0;G=f;H=f+40|0;c[g>>2]=a;c[h>>2]=b;c[i>>2]=e;c[j>>2]=c[g>>2];c[k>>2]=d[(c[j>>2]|0)+56>>0]|0|0?0:16777216;c[n>>2]=c[c[j>>2]>>2];c[o>>2]=c[(c[j>>2]|0)+4>>2];c[p>>2]=c[(c[j>>2]|0)+8>>2];c[q>>2]=c[(c[j>>2]|0)+12>>2];c[r>>2]=c[(c[j>>2]|0)+16>>2];c[s>>2]=(c[o>>2]|0)*5;c[t>>2]=(c[p>>2]|0)*5;c[u>>2]=(c[q>>2]|0)*5;c[v>>2]=(c[r>>2]|0)*5;c[w>>2]=c[(c[j>>2]|0)+20>>2];c[x>>2]=c[(c[j>>2]|0)+20+4>>2];c[y>>2]=c[(c[j>>2]|0)+20+8>>2];c[z>>2]=c[(c[j>>2]|0)+20+12>>2];c[A>>2]=c[(c[j>>2]|0)+20+16>>2];while(1){if((c[i>>2]|0)>>>0<16)break;g=(Zr(c[h>>2]|0)|0)&67108863;c[w>>2]=(c[w>>2]|0)+g;g=(Zr((c[h>>2]|0)+3|0)|0)>>>2&67108863;c[x>>2]=(c[x>>2]|0)+g;g=(Zr((c[h>>2]|0)+6|0)|0)>>>4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>>2]|0)+20+8>>2]=0;c[(c[n>>2]|0)+20+12>>2]=0;c[(c[n>>2]|0)+20+16>>2]=0;c[c[n>>2]>>2]=0;c[(c[n>>2]|0)+4>>2]=0;c[(c[n>>2]|0)+8>>2]=0;c[(c[n>>2]|0)+12>>2]=0;c[(c[n>>2]|0)+16>>2]=0;c[(c[n>>2]|0)+40>>2]=0;c[(c[n>>2]|0)+40+4>>2]=0;c[(c[n>>2]|0)+40+8>>2]=0;c[(c[n>>2]|0)+40+12>>2]=0;l=g;return 100+(c[B>>2]|0)|0}function Yr(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=b;c[g>>2]=d;c[h>>2]=c[f>>2];a[(c[h>>2]|0)+3>>0]=(c[g>>2]|0)>>>24;a[(c[h>>2]|0)+2>>0]=(c[g>>2]|0)>>>16;a[(c[h>>2]|0)+1>>0]=(c[g>>2]|0)>>>8;a[c[h>>2]>>0]=c[g>>2];l=e;return}function Zr(a){a=a|0;var b=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=b+4|0;f=b;c[e>>2]=a;c[f>>2]=c[e>>2];l=b;return (d[(c[f>>2]|0)+3>>0]|0)<<24|(d[(c[f>>2]|0)+2>>0]|0)<<16|(d[(c[f>>2]|0)+1>>0]|0)<<8|(d[c[f>>2]>>0]|0)|0}function _r(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=l;l=l+144|0;if((l|0)>=(m|0))$(144);i=h+124|0;j=h+120|0;k=h+116|0;n=h+112|0;o=h+20|0;p=h+16|0;q=h+12|0;r=h+128|0;s=h;t=h+8|0;c[i>>2]=b;c[j>>2]=e;c[k>>2]=f;c[n>>2]=g;g=o;f=g+92|0;do{c[g>>2]=0;g=g+4|0}while((g|0)<(f|0));Sr(o,c[n>>2]|0,32)|0;Or(o,c[j>>2]|0,c[k>>2]|0);Rr(o,c[i>>2]|0);c[p>>2]=o;c[q>>2]=92;a[r>>0]=0;o=s;c[o>>2]=d[r>>0];c[o+4>>2]=0;while(1){if(!(c[p>>2]&7|0?(c[q>>2]|0)!=0:0))break;a[c[p>>2]>>0]=a[r>>0]|0;c[p>>2]=(c[p>>2]|0)+1;c[q>>2]=(c[q>>2]|0)+-1}if((c[q>>2]|0)>>>0>=8){o=s;i=gx(c[o>>2]|0,c[o+4>>2]|0,16843009,16843009)|0;o=s;c[o>>2]=i;c[o+4>>2]=D;do{c[t>>2]=c[p>>2];o=s;i=c[o+4>>2]|0;k=c[t>>2]|0;c[k>>2]=c[o>>2];c[k+4>>2]=i;c[q>>2]=(c[q>>2]|0)-8;c[p>>2]=(c[p>>2]|0)+8}while((c[q>>2]|0)>>>0>=8)}while(1){if(!(c[q>>2]|0))break;a[c[p>>2]>>0]=a[r>>0]|0;c[p>>2]=(c[p>>2]|0)+1;c[q>>2]=(c[q>>2]|0)+-1}l=h;return}function $r(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;if(c[d>>2]|0){bs();l=b;return}else{as();l=b;return}}function as(){if(c[17782]|0)return;c[17782]=1;return}function bs(){var a=0,b=0;as();cs();if(c[17759]|0){gs();return}if(c[17760]|0)a=Df(1,664)|0;else a=Cf(1,664)|0;c[17759]=a;if(c[17760]|0)b=Df(1,664)|0;else b=Cf(1,664)|0;c[17761]=b;c[17762]=ds()|0;if(!(c[17762]|0)){c[17763]=1;c[17762]=3}c[17764]=fs()|0;gs();return}function cs(){var a=0,b=0,d=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;d=a+4|0;c[d>>2]=Ht(13016)|0;if(c[d>>2]|0){c[b>>2]=Bt(c[d>>2]|0)|0;We(50663,b)}else{c[17765]=1;l=a;return}}function ds(){var a=0,b=0,d=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;d=a+4|0;if(($v(52864,4)|0)==0?($v(52876,4)|0)==0:0){c[d>>2]=4;l=a;return c[d>>2]|0}We(Je(50625)|0,b);return 0}function es(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g+24|0;i=g+20|0;j=g+12|0;k=g+8|0;n=g+4|0;c[g+28>>2]=b;c[h>>2]=d;c[i>>2]=e;c[g+16>>2]=f;if(!(c[17766]|0)){Te(Je(50519)|0,g);c[17766]=1;f=kb(0)|0;vw(S(f,_v()|0)|0)}f=zf(c[i>>2]|0)|0;c[k>>2]=f;c[n>>2]=f;c[j>>2]=c[i>>2];while(1){f=c[j>>2]|0;c[j>>2]=f+-1;if(!f)break;f=1+~~(+(ww()|0)*256.0/2147483648.0)-1&255;e=c[n>>2]|0;c[n>>2]=e+1;a[e>>0]=f}hs(c[k>>2]|0,c[i>>2]|0,c[h>>2]|0);vf(c[k>>2]|0);l=g;return 0}function fs(){return 0}function gs(){var a=0,b=0,d=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;d=a+4|0;c[17765]=0;c[d>>2]=It(13016)|0;if(c[d>>2]|0){c[b>>2]=Bt(c[d>>2]|0)|0;We(50482,b)}else{l=a;return}}function hs(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g+16|0;i=g+12|0;j=g+8|0;k=g+4|0;n=g;c[h>>2]=b;c[i>>2]=e;c[j>>2]=f;c[k>>2]=c[h>>2];c[n>>2]=0;if(!(c[17765]|0))Se(50570,50585,1074,50601);c[17775]=(c[17775]|0)+(c[i>>2]|0);c[17776]=(c[17776]|0)+1;while(1){h=c[i>>2]|0;c[i>>2]=h+-1;if(!h)break;h=c[k>>2]|0;c[k>>2]=h+1;f=d[h>>0]|0;h=c[17777]|0;c[17777]=h+1;e=(c[17759]|0)+h|0;a[e>>0]=(d[e>>0]|0)^f;c[n>>2]=(c[n>>2]|0)+1;if((c[17777]|0)>>>0<600)continue;if(!((c[j>>2]|0)>>>0<3|(c[17778]|0)!=0)?(c[17779]=(c[17779]|0)+(c[n>>2]|0),c[n>>2]=0,(c[17779]|0)>>>0>=600):0)c[17778]=1;c[17777]=0;is(c[17759]|0);c[17767]=(c[17767]|0)+1;c[17780]=((c[i>>2]|0)!=0^1)&1}l=g;return}function is(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0;e=l;l=l+224|0;if((l|0)>=(m|0))$(224);f=e+208|0;g=e+204|0;h=e+200|0;i=e+196|0;j=e+192|0;k=e+188|0;n=e;o=e+184|0;c[f>>2]=b;c[g>>2]=(c[f>>2]|0)+600;if(!(c[17765]|0))Se(50570,50585,615,50616);$k(n);c[i>>2]=(c[f>>2]|0)+600;b=c[g>>2]|0;p=(c[i>>2]|0)+-20|0;q=b+20|0;do{a[b>>0]=a[p>>0]|0;b=b+1|0;p=p+1|0}while((b|0)<(q|0));b=(c[g>>2]|0)+20|0;p=c[f>>2]|0;q=b+44|0;do{a[b>>0]=a[p>>0]|0;b=b+1|0;p=p+1|0}while((b|0)<(q|0));al(n,c[g>>2]|0);b=c[f>>2]|0;p=c[g>>2]|0;q=b+20|0;do{a[b>>0]=a[p>>0]|0;b=b+1|0;p=p+1|0}while((b|0)<(q|0));a:do if(c[17781]|0?(c[f>>2]|0)==(c[17759]|0):0){c[j>>2]=0;while(1){if((c[j>>2]|0)>=20)break a;r=(c[f>>2]|0)+(c[j>>2]|0)|0;a[r>>0]=(d[r>>0]|0)^(d[72298+(c[j>>2]|0)>>0]|0);c[j>>2]=(c[j>>2]|0)+1}}while(0);c[h>>2]=c[f>>2];c[k>>2]=1;while(1){if((c[k>>2]|0)>=30)break;b=c[g>>2]|0;p=c[h>>2]|0;q=b+20|0;do{a[b>>0]=a[p>>0]|0;b=b+1|0;p=p+1|0}while((b|0)<(q|0));c[h>>2]=(c[h>>2]|0)+20;b:do if(((c[h>>2]|0)+20+64|0)>>>0<(c[i>>2]|0)>>>0){b=(c[g>>2]|0)+20|0;p=(c[h>>2]|0)+20|0;q=b+44|0;do{a[b>>0]=a[p>>0]|0;b=b+1|0;p=p+1|0}while((b|0)<(q|0))}else{c[o>>2]=(c[h>>2]|0)+20;c[j>>2]=20;while(1){if((c[j>>2]|0)>=64)break b;if((c[o>>2]|0)>>>0>=(c[i>>2]|0)>>>0)c[o>>2]=c[f>>2];r=c[o>>2]|0;c[o>>2]=r+1;a[(c[g>>2]|0)+(c[j>>2]|0)>>0]=a[r>>0]|0;c[j>>2]=(c[j>>2]|0)+1}}while(0);al(n,c[g>>2]|0);b=c[h>>2]|0;p=c[g>>2]|0;q=b+20|0;do{a[b>>0]=a[p>>0]|0;b=b+1|0;p=p+1|0}while((b|0)<(q|0));c[k>>2]=(c[k>>2]|0)+1}if((c[f>>2]|0)!=(c[17759]|0)){bf(384);cf();l=e;return}bl(72298,c[f>>2]|0,600);c[17781]=1;bf(384);cf();l=e;return}function js(){cs();nt(0,0,0,0)|0;c[17778]=0;gs();return}function ks(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;a=l;l=l+48|0;if((l|0)>=(m|0))$(48);b=a;d=c[17767]|0;e=c[17769]|0;f=c[17770]|0;g=c[17776]|0;h=c[17775]|0;i=c[17768]|0;j=c[17772]|0;k=c[17771]|0;n=c[17774]|0;o=c[17773]|0;p=(kt()|0)!=0;c[b>>2]=600;c[b+4>>2]=d;c[b+8>>2]=e;c[b+12>>2]=f;c[b+16>>2]=g;c[b+20>>2]=h;c[b+24>>2]=i;c[b+28>>2]=j;c[b+32>>2]=k;c[b+36>>2]=n;c[b+40>>2]=o;c[b+44>>2]=p?50700:72319;Te(50716,b);l=a;return}function ls(){c[17760]=1;return}function ms(){c[17783]=1;return}function ns(a){a=a|0;var b=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);c[b>>2]=a;l=b;return}function os(a){a=a|0;var b=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);c[b>>2]=a;l=b;return 0}function ps(){bs();return (c[17763]|0?1:(c[17783]|0)!=0)&1|0}function qs(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+16|0;g=e+12|0;h=e+8|0;i=e+4|0;j=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;bs();if((c[17783]|0)!=0&(c[h>>2]|0)>>>0>1)c[h>>2]=1;c[h>>2]=c[h>>2]&3;cs();d=c[g>>2]|0;if((c[h>>2]|0)>>>0>=2){c[17773]=(c[17773]|0)+d;c[17774]=(c[17774]|0)+1}else{c[17771]=(c[17771]|0)+d;c[17772]=(c[17772]|0)+1}c[i>>2]=c[f>>2];while(1){if((c[g>>2]|0)>>>0<=0)break;c[j>>2]=(c[g>>2]|0)>>>0>600?600:c[g>>2]|0;rs(c[i>>2]|0,c[j>>2]|0,c[h>>2]|0);c[g>>2]=(c[g>>2]|0)-(c[j>>2]|0);c[i>>2]=(c[i>>2]|0)+(c[j>>2]|0)}gs();l=e;return}function rs(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;f=l;l=l+64|0;if((l|0)>=(m|0))$(64);g=f;h=f+48|0;i=f+44|0;j=f+40|0;k=f+36|0;n=f+32|0;o=f+28|0;p=f+24|0;q=f+20|0;r=f+16|0;s=f+12|0;t=f+8|0;u=f+4|0;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;if(!(c[17765]|0))Se(50570,50585,934,50840);while(1){c[p>>2]=_v()|0;if((c[3265]|0)==-1)c[3265]=c[p>>2];if((c[3265]|0)!=(c[p>>2]|0)){c[3265]=c[p>>2];c[q>>2]=c[3265];hs(q,4,0);c[17780]=0}if(!(c[17765]|0)){v=8;break}if((c[i>>2]|0)>>>0>600){v=10;break}if((c[17778]|0)==0?ss()|0:0)c[17778]=1;if(!((c[j>>2]|0)!=2|(c[17784]|0)!=0)){c[17785]=0;c[r>>2]=(c[i>>2]|0)-(c[17785]|0);if((c[r>>2]|0)>>>0>=16){if((c[r>>2]|0)>>>0>600){v=18;break}}else c[r>>2]=16;ts(4,c[r>>2]|0,2);c[17785]=(c[17785]|0)+(c[r>>2]|0);c[17784]=1}if((c[j>>2]|0)==2?(c[17785]|0)>>>0<(c[i>>2]|0)>>>0:0){if((c[17785]|0)<0)c[17785]=0;c[s>>2]=(c[i>>2]|0)-(c[17785]|0);if((c[s>>2]|0)>>>0>600){v=25;break}ts(4,c[s>>2]|0,2);c[17785]=(c[17785]|0)+(c[s>>2]|0)}while(1){if(!((c[17778]|0)!=0^1))break;us()}vs();c[t>>2]=c[3265];hs(t,4,0);if(!(c[17780]|0)){is(c[17759]|0);c[17767]=(c[17767]|0)+1}c[k>>2]=0;c[o>>2]=c[17761];c[n>>2]=c[17759];while(1){if((c[k>>2]|0)>=150)break;c[c[o>>2]>>2]=(c[c[n>>2]>>2]|0)+-1515870811;c[k>>2]=(c[k>>2]|0)+1;c[o>>2]=(c[o>>2]|0)+4;c[n>>2]=(c[n>>2]|0)+4}is(c[17759]|0);c[17767]=(c[17767]|0)+1;is(c[17761]|0);c[17768]=(c[17768]|0)+1;while(1){e=c[i>>2]|0;c[i>>2]=e+-1;if(!e)break;e=c[17786]|0;c[17786]=e+1;d=a[(c[17761]|0)+e>>0]|0;e=c[h>>2]|0;c[h>>2]=e+1;a[e>>0]=d;if((c[17786]|0)>>>0>=600)c[17786]=0;c[17785]=(c[17785]|0)+-1}if((c[17785]|0)<0)c[17785]=0;Uw(c[17761]|0,0,600)|0;d=_v()|0;if((d|0)==(c[p>>2]|0)){v=43;break}c[u>>2]=_v()|0;hs(u,4,0);c[17780]=0;c[3265]=c[u>>2]}if((v|0)==8)Se(50570,50585,953,50840);else if((v|0)==10)Xe(50850,g);else if((v|0)==18)Re(50585,979,50840);else if((v|0)==25)Re(50585,995,50840);else if((v|0)==43){l=f;return}}function ss(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;a=l;l=l+768|0;if((l|0)>=(m|0))$(768);b=a+48|0;d=a+40|0;e=a+32|0;f=a+24|0;g=a+16|0;h=a+8|0;i=a+152|0;j=a+148|0;k=a+72|0;n=a+160|0;o=a+68|0;p=a+64|0;q=a+60|0;r=a+56|0;if(!(c[17765]|0))Se(50570,50585,743,50991);if(!(c[17787]|0)){c[i>>2]=0;s=c[i>>2]|0;l=a;return s|0}c[j>>2]=gw(c[17787]|0,0,a)|0;if((c[j>>2]|0)==-1?(c[(xu()|0)>>2]|0)==2:0){c[17788]=1;c[i>>2]=0;s=c[i>>2]|0;l=a;return s|0}if((c[j>>2]|0)==-1){t=Je(51006)|0;u=c[17787]|0;v=Nu(c[(xu()|0)>>2]|0)|0;c[h>>2]=u;c[h+4>>2]=v;Te(t,h);c[i>>2]=0;s=c[i>>2]|0;l=a;return s|0}h=(ws(c[j>>2]|0,c[17787]|0,0)|0)!=0;t=c[j>>2]|0;if(h){Kv(t)|0;c[i>>2]=0;s=c[i>>2]|0;l=a;return s|0}if(cw(t,k)|0){t=Je(51027)|0;h=c[17787]|0;v=Nu(c[(xu()|0)>>2]|0)|0;c[g>>2]=h;c[g+4>>2]=v;Te(t,g);Kv(c[j>>2]|0)|0;c[i>>2]=0;s=c[i>>2]|0;l=a;return s|0}if((c[k+12>>2]&61440|0)!=32768){g=Je(51048)|0;c[f>>2]=c[17787];Te(g,f);Kv(c[j>>2]|0)|0;c[i>>2]=0;s=c[i>>2]|0;l=a;return s|0}if(!(c[k+36>>2]|0)){Te(Je(51086)|0,e);Kv(c[j>>2]|0)|0;c[17788]=1;c[i>>2]=0;s=c[i>>2]|0;l=a;return s|0}if((c[k+36>>2]|0)!=600){Te(Je(51119)|0,d);Kv(c[j>>2]|0)|0;c[i>>2]=0;s=c[i>>2]|0;l=a;return s|0}do{c[o>>2]=fw(c[j>>2]|0,n,600)|0;if((c[o>>2]|0)!=-1)break}while((c[(xu()|0)>>2]|0)==4);if((c[o>>2]|0)!=600){o=Je(51173)|0;d=c[17787]|0;k=Nu(c[(xu()|0)>>2]|0)|0;c[b>>2]=d;c[b+4>>2]=k;We(o,b)}Kv(c[j>>2]|0)|0;hs(n,600,0);c[p>>2]=_v()|0;hs(p,4,0);c[q>>2]=kb(0)|0;hs(q,4,0);c[r>>2]=Ta()|0;hs(r,4,0);ts(0,16,0);c[17788]=1;c[i>>2]=1;s=c[i>>2]|0;l=a;return s|0}function ts(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+20|0;g=e+16|0;h=e+12|0;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if(!(c[17762]|0))We(50902,e);if((Bb[c[17762]&7](3,c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0)<0)We(50953,e+8|0);else{l=e;return}}function us(){c[17769]=(c[17769]|0)+1;ts(3,120,1);return}function vs(){var a=0,b=0,d=0,e=0,f=0;a=l;l=l+160|0;if((l|0)>=(m|0))$(160);b=a+144|0;d=a+8|0;e=a+4|0;f=a;if(!(c[17765]|0))Se(50570,50585,1180,50882);c[17770]=(c[17770]|0)+1;if(c[17764]|0)xb[c[17764]&7](3,2);if(lb(b|0,0)|0)Re(50585,1198,50882);else{hs(b,4,2);hs(b+4|0,4,2);Bw(0,d)|0;hs(d,136,2);Uw(d|0,0,136)|0;c[e>>2]=kb(0)|0;hs(e,4,2);c[f>>2]=Ta()|0;hs(f,4,2);lt(3,2);l=a;return}}function ws(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;f=l;l=l+64|0;if((l|0)>=(m|0))$(64);g=f+16|0;h=f+8|0;i=f;j=f+60|0;k=f+56|0;n=f+52|0;o=f+48|0;p=f+32|0;q=f+24|0;r=f+20|0;c[k>>2]=a;c[n>>2]=d;c[o>>2]=e;c[r>>2]=0;c[p>>2]=0;c[p+4>>2]=0;c[p+8>>2]=0;c[p+12>>2]=0;b[p>>1]=c[o>>2]|0?1:0;b[p+2>>1]=0;while(1){o=c[k>>2]|0;c[i>>2]=p;if((Lv(o,13,i)|0)!=-1){s=10;break}if((c[(xu()|0)>>2]|0)!=11?(c[(xu()|0)>>2]|0)!=13:0){s=5;break}if((c[r>>2]|0)>2){o=Je(51215)|0;c[g>>2]=c[n>>2];Te(o,g)}c[q>>2]=c[r>>2];c[q+4>>2]=25e4;dw(0,0,0,0,q)|0;if((c[r>>2]|0)>=10)continue;c[r>>2]=(c[r>>2]|0)+1}if((s|0)==5){r=Je(51194)|0;q=c[n>>2]|0;n=Nu(c[(xu()|0)>>2]|0)|0;c[h>>2]=q;c[h+4>>2]=n;Te(r,h);c[j>>2]=-1;t=c[j>>2]|0;l=f;return t|0}else if((s|0)==10){c[j>>2]=0;t=c[j>>2]|0;l=f;return t|0}return 0}function xs(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;if(c[17787]|0)Re(50585,673,51244);else{c[17787]=Ef(c[d>>2]|0)|0;l=b;return}}function ys(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;a=l;l=l+64|0;if((l|0)>=(m|0))$(64);b=a+40|0;d=a+32|0;e=a+24|0;f=a+16|0;g=a+8|0;h=a+60|0;i=a+56|0;j=a+52|0;k=a+48|0;as();cs();if(!((c[17787]|0)!=0&(c[17759]|0)!=0&(c[17778]|0)!=0)){gs();l=a;return}if(!(c[17788]|0)){gs();Te(Je(51274)|0,a);l=a;return}c[k>>2]=0;c[i>>2]=c[17761];c[h>>2]=c[17759];while(1){if((c[k>>2]|0)>=150)break;c[c[i>>2]>>2]=(c[c[h>>2]>>2]|0)+-1515870811;c[k>>2]=(c[k>>2]|0)+1;c[i>>2]=(c[i>>2]|0)+4;c[h>>2]=(c[h>>2]|0)+4}is(c[17759]|0);c[17767]=(c[17767]|0)+1;is(c[17761]|0);c[17768]=(c[17768]|0)+1;h=c[17787]|0;c[g>>2]=384;c[j>>2]=gw(h,65,g)|0;do if((c[j>>2]|0)!=-1){g=(ws(c[j>>2]|0,c[17787]|0,1)|0)!=0;h=c[j>>2]|0;if(g){Kv(h)|0;break}if(pw(h,0)|0){h=Je(51333)|0;g=c[17787]|0;i=Nu(c[(xu()|0)>>2]|0)|0;c[e>>2]=g;c[e+4>>2]=i;Te(h,e);Kv(c[j>>2]|0)|0;break}do{c[k>>2]=ew(c[j>>2]|0,c[17761]|0,600)|0;if((c[k>>2]|0)!=-1)break}while((c[(xu()|0)>>2]|0)==4);if((c[k>>2]|0)!=600){h=Je(51333)|0;i=c[17787]|0;g=Nu(c[(xu()|0)>>2]|0)|0;c[d>>2]=i;c[d+4>>2]=g;Te(h,d)}if(Kv(c[j>>2]|0)|0){h=Je(51355)|0;g=c[17787]|0;i=Nu(c[(xu()|0)>>2]|0)|0;c[b>>2]=g;c[b+4>>2]=i;Te(h,b)}}else{h=Je(51310)|0;i=c[17787]|0;g=Nu(c[(xu()|0)>>2]|0)|0;c[f>>2]=i;c[f+4>>2]=g;Te(h,f)}while(0);gs();l=a;return}function zs(){as();cs();if(!(c[17759]|0)){gs();return}vs();gs();return}function As(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;Bs();if(!(c[d>>2]|0)){l=b;return}Cs();do if(c[17789]|0){if(c[(c[17790]|0)+52>>2]|0)Se(51377,51405,767,51419);if(c[(c[17791]|0)+52>>2]|0)Se(51444,51405,768,51419);if(c[(c[17792]|0)+52>>2]|0)Se(51474,51405,769,51419);else{Es(c[17790]|0);Es(c[17791]|0);Es(c[17792]|0);break}}else{c[17789]=Bf(48)|0;c[17790]=Cf(1,68)|0;Ds(c[17790]|0);c[17791]=Df(1,68)|0;Ds(c[17791]|0);c[17792]=Df(1,68)|0;Ds(c[17792]|0)}while(0);Fs();l=b;return}function Bs(){if(c[17794]|0)return;c[17794]=1;c[17793]=0;return}function Cs(){var a=0,b=0,d=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;d=a+4|0;c[d>>2]=Ht(13064)|0;if(c[d>>2]|0){c[b>>2]=Bt(c[d>>2]|0)|0;We(51589,b)}else{c[17793]=1;l=a;return}}function Ds(b){b=b|0;var d=0,e=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d;c[e>>2]=b;a[c[e>>2]>>0]=17;a[(c[e>>2]|0)+16>>0]=42;a[(c[e>>2]|0)+33>>0]=-119;a[(c[e>>2]|0)+50>>0]=-4;l=d;return}function Es(a){a=a|0;var b=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=b;f=b+4|0;c[f>>2]=a;if((((d[c[f>>2]>>0]|0|0)==17?(d[(c[f>>2]|0)+16>>0]|0|0)==42:0)?(d[(c[f>>2]|0)+33>>0]|0|0)==137:0)?(d[(c[f>>2]|0)+50>>0]|0|0)==252:0){l=b;return}c[e>>2]=c[f>>2];We(51543,e)}function Fs(){var a=0,b=0,d=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;d=a+4|0;c[17793]=0;c[d>>2]=It(13064)|0;if(c[d>>2]|0){c[b>>2]=Bt(c[d>>2]|0)|0;We(51507,b)}else{l=a;return}}function Gs(){Cs();nt(0,0,0,0)|0;Fs();return}function Hs(){return}function Is(){return 0}function Js(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;As(1);Cs();d=c[f>>2]|0;f=c[g>>2]|0;if((c[h>>2]|0)==2){Ks(d,f,c[17792]|0);Fs();l=e;return}else{Ks(d,f,c[17791]|0);Fs();l=e;return}} -function Nj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0;e=l;l=l+160|0;if((l|0)>=(m|0))$(160);f=e+144|0;g=e+140|0;h=e+136|0;i=e+132|0;j=e+128|0;k=e+124|0;n=e+120|0;o=e+116|0;p=e+112|0;q=e+108|0;r=e+104|0;s=e+100|0;t=e+96|0;u=e+92|0;v=e+88|0;w=e+84|0;x=e+80|0;y=e+76|0;z=e+72|0;A=e+68|0;B=e+64|0;C=e+60|0;D=e+56|0;E=e+52|0;F=e+48|0;G=e+44|0;H=e+40|0;I=e+36|0;J=e+32|0;K=e+28|0;L=e+24|0;M=e+20|0;N=e+16|0;O=e+12|0;P=e+8|0;Q=e+4|0;R=e;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=0;c[r>>2]=0;c[s>>2]=0;c[c[h>>2]>>2]=0;c[k>>2]=Tf(c[g>>2]|0,37953,0)|0;if(!(c[k>>2]|0)){d=$f(c[g>>2]|0,0,0)|0;c[c[h>>2]>>2]=d;c[f>>2]=c[c[h>>2]>>2]|0?0:65;S=c[f>>2]|0;l=e;return S|0}c[t>>2]=Tf(c[k>>2]|0,47178,0)|0;if(c[t>>2]|0){if(Fj(c[t>>2]|0,s,(c[i>>2]|0)+8|0)|0)c[r>>2]=1;Rf(c[t>>2]|0)}if((c[(c[i>>2]|0)+8>>2]|0)==5)c[(c[i>>2]|0)+8>>2]=0;c[n>>2]=Tf(c[k>>2]|0,37958,0)|0;if(c[n>>2]|0)T=0;else T=Tf(c[k>>2]|0,40906,0)|0;c[o>>2]=T;a:do if(((c[n>>2]|0)!=0^1)&1^((c[o>>2]|0)!=0^1)&1|0){if(c[r>>2]|0){c[j>>2]=72;break}if((c[(c[i>>2]|0)+8>>2]|0)==0?c[s>>2]&4096|0:0){if(!(c[o>>2]|0)){c[j>>2]=65;break}c[u>>2]=Tf(c[k>>2]|0,37847,0)|0;if(c[u>>2]|0){c[q>>2]=Xf(c[u>>2]|0,1,p)|0;if(c[q>>2]|0){T=Kj(c[q>>2]|0,c[p>>2]|0)|0;c[(c[i>>2]|0)+16>>2]=T;if(!(c[(c[i>>2]|0)+16>>2]|0))c[j>>2]=5}else c[j>>2]=68;Rf(c[u>>2]|0)}else c[j>>2]=65;if(c[j>>2]|0)break;c[v>>2]=Zf(c[o>>2]|0,1,w)|0;if(c[v>>2]|0){if(c[w>>2]<<3>>>0<(c[w>>2]|0)>>>0){vf(c[v>>2]|0);c[j>>2]=67}}else{c[w>>2]=0;c[v>>2]=pf(1)|0;if(!(c[v>>2]|0))c[j>>2]=Et()|0}if(c[j>>2]|0)break;T=Ep(0,c[v>>2]|0,c[w>>2]<<3)|0;c[c[h>>2]>>2]=T;break}do if(c[n>>2]|0?(c[(c[i>>2]|0)+8>>2]|0)==0:0){if((c[s>>2]&16|0)==0?(c[s>>2]&2|0)==0:0)break;if((Uf(c[n>>2]|0)|0)!=3){c[j>>2]=65;break a}T=Xf(c[n>>2]|0,1,p)|0;c[q>>2]=T;if(!((T|0)!=0&(c[p>>2]|0)!=0)){c[j>>2]=65;break a}T=Kj(c[q>>2]|0,c[p>>2]|0)|0;c[(c[i>>2]|0)+16>>2]=T;if(!(c[(c[i>>2]|0)+16>>2]|0)){c[j>>2]=5;break a}T=Zf(c[n>>2]|0,2,y)|0;c[x>>2]=T;if(!T){c[j>>2]=65;break a}T=c[x>>2]|0;if(c[y>>2]<<3>>>0<(c[y>>2]|0)>>>0){vf(T);c[j>>2]=67;break a}else{t=Ep(0,T,c[y>>2]<<3)|0;c[c[h>>2]>>2]=t;break a}}while(0);if(c[o>>2]|0?(c[(c[i>>2]|0)+8>>2]|0)==0:0){if(c[s>>2]&2|0){c[j>>2]=70;break}t=$f(c[o>>2]|0,1,5)|0;c[c[h>>2]>>2]=t;if(c[c[h>>2]>>2]|0)break;c[j>>2]=65;break}if((c[o>>2]|0?(c[(c[i>>2]|0)+8>>2]|0)==1:0)?(c[c[i>>2]>>2]|0)==0:0){c[C>>2]=0;c[D>>2]=0;t=Xf(c[o>>2]|0,1,A)|0;c[z>>2]=t;if(!((t|0)!=0&(c[A>>2]|0)!=0)){c[j>>2]=65;break}c[B>>2]=Tf(c[k>>2]|0,37863,0)|0;if(c[B>>2]|0){c[q>>2]=Xf(c[B>>2]|0,1,p)|0;do if(c[q>>2]|0){if((c[p>>2]|0)>>>0>0){c[C>>2]=pf(c[p>>2]|0)|0;if(c[C>>2]|0){_w(c[C>>2]|0,c[q>>2]|0,c[p>>2]|0)|0;c[D>>2]=c[p>>2];break}else{c[j>>2]=Et()|0;break}}}else c[j>>2]=68;while(0);Rf(c[B>>2]|0);if(c[j>>2]|0)break}c[j>>2]=cl(c[h>>2]|0,c[(c[i>>2]|0)+4>>2]|0,c[z>>2]|0,c[A>>2]|0,c[C>>2]|0,c[D>>2]|0)|0;vf(c[C>>2]|0);break}do if(c[n>>2]|0?(c[(c[i>>2]|0)+8>>2]|0)==1:0){if((c[c[i>>2]>>2]|0)!=2?(c[c[i>>2]>>2]|0)!=3:0)break;if((Uf(c[n>>2]|0)|0)!=3){c[j>>2]=65;break a}t=Xf(c[n>>2]|0,1,p)|0;c[q>>2]=t;if(!((t|0)!=0&(c[p>>2]|0)!=0)){c[j>>2]=65;break a}t=Kj(c[q>>2]|0,c[p>>2]|0)|0;c[(c[i>>2]|0)+16>>2]=t;if(!(c[(c[i>>2]|0)+16>>2]|0)){c[j>>2]=5;break a}t=Xf(c[n>>2]|0,2,F)|0;c[E>>2]=t;if((t|0)!=0&(c[F>>2]|0)!=0){c[j>>2]=gl(c[h>>2]|0,c[(c[i>>2]|0)+4>>2]|0,c[E>>2]|0,c[F>>2]|0,c[(c[i>>2]|0)+16>>2]|0)|0;break a}else{c[j>>2]=65;break a}}while(0);do if(c[o>>2]|0?(c[(c[i>>2]|0)+8>>2]|0)==2:0){if((c[c[i>>2]>>2]|0)!=2?(c[c[i>>2]>>2]|0)!=3:0)break;if((Uf(c[o>>2]|0)|0)!=2){c[j>>2]=65;break a}t=Xf(c[o>>2]|0,1,H)|0;c[G>>2]=t;if((t|0)!=0&(c[H>>2]|0)!=0){c[j>>2]=hl(c[h>>2]|0,c[(c[i>>2]|0)+4>>2]|0,c[G>>2]|0,c[H>>2]|0)|0;break a}else{c[j>>2]=65;break a}}while(0);if((c[o>>2]|0?(c[(c[i>>2]|0)+8>>2]|0)==3:0)?(c[c[i>>2]>>2]|0)==0:0){t=Xf(c[o>>2]|0,1,J)|0;c[I>>2]=t;if(!((t|0)!=0&(c[J>>2]|0)!=0)){c[j>>2]=65;break}c[L>>2]=0;c[M>>2]=0;c[K>>2]=Tf(c[k>>2]|0,37847,0)|0;if(c[K>>2]|0){c[q>>2]=Xf(c[K>>2]|0,1,p)|0;do if(c[q>>2]|0){t=Kj(c[q>>2]|0,c[p>>2]|0)|0;c[(c[i>>2]|0)+16>>2]=t;if(c[(c[i>>2]|0)+16>>2]|0)break;c[j>>2]=5}else c[j>>2]=68;while(0);Rf(c[K>>2]|0);if(c[j>>2]|0)break}c[K>>2]=Tf(c[k>>2]|0,37857,0)|0;if(c[K>>2]|0){c[q>>2]=Xf(c[K>>2]|0,1,p)|0;do if(c[q>>2]|0){if((c[p>>2]|0)>>>0<=0)break;t=pf(c[p>>2]|0)|0;c[(c[i>>2]|0)+20>>2]=t;if(c[(c[i>>2]|0)+20>>2]|0){_w(c[(c[i>>2]|0)+20>>2]|0,c[q>>2]|0,c[p>>2]|0)|0;c[(c[i>>2]|0)+24>>2]=c[p>>2];break}else{c[j>>2]=Et()|0;break}}else c[j>>2]=68;while(0);Rf(c[K>>2]|0);if(c[j>>2]|0)break}c[K>>2]=Tf(c[k>>2]|0,37863,0)|0;if(c[K>>2]|0){c[q>>2]=Xf(c[K>>2]|0,1,p)|0;do if(c[q>>2]|0){if((c[p>>2]|0)>>>0<=0)break;c[L>>2]=pf(c[p>>2]|0)|0;if(c[L>>2]|0){_w(c[L>>2]|0,c[q>>2]|0,c[p>>2]|0)|0;c[M>>2]=c[p>>2];break}else{c[j>>2]=Et()|0;break}}else c[j>>2]=68;while(0);Rf(c[K>>2]|0);if(c[j>>2]|0)break}c[j>>2]=il(c[h>>2]|0,c[(c[i>>2]|0)+4>>2]|0,c[(c[i>>2]|0)+16>>2]|0,c[I>>2]|0,c[J>>2]|0,c[(c[i>>2]|0)+20>>2]|0,c[(c[i>>2]|0)+24>>2]|0,c[L>>2]|0,c[M>>2]|0)|0;vf(c[L>>2]|0);break}if((c[n>>2]|0?(c[(c[i>>2]|0)+8>>2]|0)==4:0)?(c[c[i>>2]>>2]|0)==2:0){if((Uf(c[n>>2]|0)|0)!=3){c[j>>2]=65;break}t=Xf(c[n>>2]|0,1,p)|0;c[q>>2]=t;if(!((t|0)!=0&(c[p>>2]|0)!=0)){c[j>>2]=65;break}c[P>>2]=0;c[Q>>2]=0;t=Kj(c[q>>2]|0,c[p>>2]|0)|0;c[(c[i>>2]|0)+16>>2]=t;if(!(c[(c[i>>2]|0)+16>>2]|0)){c[j>>2]=5;break}t=Xf(c[n>>2]|0,2,O)|0;c[N>>2]=t;if(!((t|0)!=0&(c[O>>2]|0)!=0)){c[j>>2]=65;break}c[R>>2]=Tf(c[k>>2]|0,37963,0)|0;do if(c[R>>2]|0){c[q>>2]=Xf(c[R>>2]|0,1,p)|0;if(c[q>>2]|0){t=wv(c[q>>2]|0,0,10)|0;c[(c[i>>2]|0)+28>>2]=t;Rf(c[R>>2]|0);break}else{c[j>>2]=68;break a}}while(0);c[R>>2]=Tf(c[k>>2]|0,37863,0)|0;if(c[R>>2]|0){c[q>>2]=Xf(c[R>>2]|0,1,p)|0;do if(c[q>>2]|0){if((c[p>>2]|0)>>>0<=0)break;c[P>>2]=pf(c[p>>2]|0)|0;if(c[P>>2]|0){_w(c[P>>2]|0,c[q>>2]|0,c[p>>2]|0)|0;c[Q>>2]=c[p>>2];break}else{c[j>>2]=Et()|0;break}}else c[j>>2]=68;while(0);Rf(c[R>>2]|0);if(c[j>>2]|0)break}c[j>>2]=ml(c[h>>2]|0,(c[(c[i>>2]|0)+4>>2]|0)-1|0,c[(c[i>>2]|0)+16>>2]|0,c[N>>2]|0,c[O>>2]|0,c[(c[i>>2]|0)+28>>2]|0,c[P>>2]|0,c[Q>>2]|0)|0;vf(c[P>>2]|0);break}if((c[n>>2]|0?(c[(c[i>>2]|0)+8>>2]|0)==4:0)?(c[c[i>>2]>>2]|0)==3:0){if((Uf(c[n>>2]|0)|0)!=3){c[j>>2]=65;break}t=Xf(c[n>>2]|0,1,p)|0;c[q>>2]=t;if(!((t|0)!=0&(c[p>>2]|0)!=0)){c[j>>2]=65;break}t=Kj(c[q>>2]|0,c[p>>2]|0)|0;c[(c[i>>2]|0)+16>>2]=t;if(!(c[(c[i>>2]|0)+16>>2]|0)){c[j>>2]=5;break}t=$f(c[n>>2]|0,2,5)|0;c[c[h>>2]>>2]=t;if(!(c[c[h>>2]>>2]|0))c[j>>2]=65;c[(c[i>>2]|0)+32>>2]=5;c[(c[i>>2]|0)+36>>2]=c[c[h>>2]>>2];break}c[j>>2]=70}else c[j>>2]=65;while(0);Rf(c[k>>2]|0);Rf(c[n>>2]|0);Rf(c[o>>2]|0);if(c[j>>2]|0){vf(c[(c[i>>2]|0)+20>>2]|0);c[(c[i>>2]|0)+20>>2]=0}else c[(c[i>>2]|0)+12>>2]=c[s>>2];c[f>>2]=c[j>>2];S=c[f>>2]|0;l=e;return S|0}function Oj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=c[e>>2];c[h>>2]=c[(c[g>>2]|0)+36>>2];e=nl(c[h>>2]|0,c[f>>2]|0,(c[(c[g>>2]|0)+4>>2]|0)-1|0,c[(c[g>>2]|0)+16>>2]|0,c[(c[g>>2]|0)+28>>2]|0)|0;l=d;return e|0}function Pj(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;b=l;l=l+32|0;if((l|0)>=(m|0))$(32);d=b+16|0;e=b+12|0;f=b+8|0;g=b+4|0;h=b;c[e>>2]=a;c[g>>2]=0;a:while(1){a=c[4504+(c[g>>2]<<2)>>2]|0;c[f>>2]=a;if(!a){i=11;break}a=(sv(c[e>>2]|0,c[(c[f>>2]|0)+12>>2]|0)|0)!=0;j=c[f>>2]|0;if(!a){i=4;break}c[h>>2]=c[j+16>>2];while(1){if(!(c[c[h>>2]>>2]|0))break;if(!(sv(c[e>>2]|0,c[c[h>>2]>>2]|0)|0)){i=8;break a}c[h>>2]=(c[h>>2]|0)+4}c[g>>2]=(c[g>>2]|0)+1}if((i|0)==4){c[d>>2]=j;k=c[d>>2]|0;l=b;return k|0}else if((i|0)==8){c[d>>2]=c[f>>2];k=c[d>>2]|0;l=b;return k|0}else if((i|0)==11){c[d>>2]=0;k=c[d>>2]|0;l=b;return k|0}return 0}function Qj(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+8|0;e=b+4|0;f=b;c[e>>2]=a;c[f>>2]=Rj(c[e>>2]|0)|0;if(c[f>>2]|0){c[d>>2]=c[(c[f>>2]|0)+12>>2];g=c[d>>2]|0;l=b;return g|0}else{c[d>>2]=37975;g=c[d>>2]|0;l=b;return g|0}return 0}function Rj(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[e>>2]=a;c[e>>2]=Sj(c[e>>2]|0)|0;c[f>>2]=0;while(1){a=c[4504+(c[f>>2]<<2)>>2]|0;c[g>>2]=a;if(!a){h=6;break}if((c[e>>2]|0)==(c[c[g>>2]>>2]|0)){h=4;break}c[f>>2]=(c[f>>2]|0)+1}if((h|0)==4){c[d>>2]=c[g>>2];i=c[d>>2]|0;l=b;return i|0}else if((h|0)==6){c[d>>2]=0;i=c[d>>2]|0;l=b;return i|0}return 0}function Sj(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[e>>2]=a;switch(c[e>>2]|0){case 2:{c[d>>2]=1;break}case 3:{c[d>>2]=1;break}case 16:{c[d>>2]=20;break}case 301:{c[d>>2]=18;break}case 302:{c[d>>2]=18;break}default:c[d>>2]=c[e>>2]}l=b;return c[d>>2]|0}function Tj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+20|0;g=e+16|0;h=e+12|0;i=e+8|0;j=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[c[f>>2]>>2]=0;c[i>>2]=Uj(c[h>>2]|0,0,j,k)|0;do if(!(c[i>>2]|0))if(c[(c[j>>2]|0)+48>>2]|0){c[i>>2]=ub[c[(c[j>>2]|0)+48>>2]&63](c[f>>2]|0,c[g>>2]|0,c[k>>2]|0)|0;break}else{c[i>>2]=69;break}while(0);Rf(c[k>>2]|0);l=e;return c[i>>2]|0}function Uj(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0;f=l;l=l+48|0;if((l|0)>=(m|0))$(48);g=f+32|0;h=f+28|0;i=f+24|0;j=f+20|0;k=f+16|0;n=f+12|0;o=f+8|0;p=f+4|0;q=f;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;c[c[j>>2]>>2]=0;if(c[k>>2]|0)c[c[k>>2]>>2]=0;c[n>>2]=Tf(c[h>>2]|0,c[i>>2]|0?37977:37989,0)|0;if(!((c[n>>2]|0)!=0|(c[i>>2]|0)!=0))c[n>>2]=Tf(c[h>>2]|0,37977,0)|0;if(!(c[n>>2]|0)){c[g>>2]=65;r=c[g>>2]|0;l=f;return r|0}c[o>>2]=bg(c[n>>2]|0)|0;Rf(c[n>>2]|0);c[n>>2]=c[o>>2];c[p>>2]=_f(c[n>>2]|0,0)|0;if(!(c[p>>2]|0)){Rf(c[n>>2]|0);c[g>>2]=65;r=c[g>>2]|0;l=f;return r|0}c[q>>2]=Pj(c[p>>2]|0)|0;vf(c[p>>2]|0);if(!(c[q>>2]|0)){Rf(c[n>>2]|0);c[g>>2]=4;r=c[g>>2]|0;l=f;return r|0}c[c[j>>2]>>2]=c[q>>2];q=c[n>>2]|0;if(c[k>>2]|0)c[c[k>>2]>>2]=q;else Rf(q);c[g>>2]=0;r=c[g>>2]|0;l=f;return r|0}function Vj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+20|0;g=e+16|0;h=e+12|0;i=e+8|0;j=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[c[f>>2]>>2]=0;c[i>>2]=Uj(c[h>>2]|0,1,j,k)|0;do if(!(c[i>>2]|0))if(c[(c[j>>2]|0)+52>>2]|0){c[i>>2]=ub[c[(c[j>>2]|0)+52>>2]&63](c[f>>2]|0,c[g>>2]|0,c[k>>2]|0)|0;break}else{c[i>>2]=69;break}while(0);Rf(c[k>>2]|0);l=e;return c[i>>2]|0}function Wj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+20|0;g=e+16|0;h=e+12|0;i=e+8|0;j=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[c[f>>2]>>2]=0;c[i>>2]=Uj(c[h>>2]|0,1,j,k)|0;do if(!(c[i>>2]|0))if(c[(c[j>>2]|0)+56>>2]|0){c[i>>2]=ub[c[(c[j>>2]|0)+56>>2]&63](c[f>>2]|0,c[g>>2]|0,c[k>>2]|0)|0;break}else{c[i>>2]=69;break}while(0);Rf(c[k>>2]|0);l=e;return c[i>>2]|0}function Xj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+20|0;g=e+16|0;h=e+12|0;i=e+8|0;j=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[i>>2]=Uj(c[h>>2]|0,0,j,k)|0;do if(!(c[i>>2]|0))if(c[(c[j>>2]|0)+60>>2]|0){c[i>>2]=ub[c[(c[j>>2]|0)+60>>2]&63](c[f>>2]|0,c[g>>2]|0,c[k>>2]|0)|0;break}else{c[i>>2]=69;break}while(0);Rf(c[k>>2]|0);l=e;return c[i>>2]|0}function Yj(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[d>>2]=a;c[e>>2]=Uj(c[d>>2]|0,1,f,g)|0;do if(!(c[e>>2]|0))if(c[(c[f>>2]|0)+44>>2]|0){c[e>>2]=yb[c[(c[f>>2]|0)+44>>2]&15](c[g>>2]|0)|0;break}else{c[e>>2]=69;break}while(0);Rf(c[g>>2]|0);l=b;return c[e>>2]|0}function Zj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+24|0;f=d+20|0;g=d+16|0;h=d+12|0;i=d+8|0;j=d+4|0;k=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=0;c[h>>2]=0;c[i>>2]=0;c[j>>2]=0;c[c[e>>2]>>2]=0;c[h>>2]=Tf(c[f>>2]|0,38e3,0)|0;do if(c[h>>2]|0){c[i>>2]=bg(c[h>>2]|0)|0;Rf(c[h>>2]|0);c[h>>2]=c[i>>2];c[i>>2]=0;if(!(c[h>>2]|0)){c[k>>2]=68;break}c[j>>2]=_f(c[h>>2]|0,0)|0;if(!(c[j>>2]|0)){c[k>>2]=65;break}c[g>>2]=Pj(c[j>>2]|0)|0;vf(c[j>>2]|0);c[j>>2]=0;if(!(c[g>>2]|0)){c[k>>2]=4;break}if(c[(c[g>>2]|0)+40>>2]|0){c[k>>2]=Db[c[(c[g>>2]|0)+40>>2]&7](c[h>>2]|0,c[e>>2]|0)|0;break}else{c[k>>2]=69;break}}else c[k>>2]=65;while(0);Rf(c[h>>2]|0);vf(c[j>>2]|0);Rf(c[i>>2]|0);l=d;return c[k>>2]|0}function _j(){return 0}function $j(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+16|0;h=f+12|0;i=f+8|0;j=f+4|0;k=f;c[g>>2]=b;c[h>>2]=d;c[i>>2]=e;c[g>>2]=Sj(c[g>>2]|0)|0;c[k>>2]=Rj(c[g>>2]|0)|0;if((c[k>>2]|0?(a[(c[k>>2]|0)+4>>0]&1|0)==0:0)?c[(c[k>>2]|0)+68>>2]|0:0){c[j>>2]=ub[c[(c[k>>2]|0)+68>>2]&63](c[g>>2]|0,c[h>>2]|0,c[i>>2]|0)|0;n=c[j>>2]|0;o=ak(n)|0;l=f;return o|0}c[j>>2]=4;if(!(c[i>>2]|0)){n=c[j>>2]|0;o=ak(n)|0;l=f;return o|0}h=c[i>>2]|0;i=c[g>>2]|0;if(c[k>>2]|0?!(a[(c[k>>2]|0)+4>>0]&1|0):0)p=38046;else p=c[k>>2]|0?38007:38026;Eb[h&1](47252,i,38068,p);n=c[j>>2]|0;o=ak(n)|0;l=f;return o|0}function ak(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=bk(1,c[d>>2]|0)|0;l=b;return a|0}function bk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){g=0;l=d;return g|0}g=(c[e>>2]&127)<<24|c[f>>2]&65535;l=d;return g|0}function ck(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[i>>2]=c[f>>2];f=tk(c[i>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;l=e;return f|0}function dk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[i>>2]=c[f>>2];if(c[(c[i>>2]|0)+496>>2]|0)Ab[c[(c[i>>2]|0)+496>>2]&3]();f=ub[c[(c[i>>2]|0)+488>>2]&63](c[i>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;l=e;return f|0}function ek(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[i>>2]=c[f>>2];nk(c[i>>2]|0);if(c[(c[i>>2]|0)+500>>2]|0)Ab[c[(c[i>>2]|0)+500>>2]&3]();f=ub[c[(c[i>>2]|0)+492>>2]&63](c[i>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;l=e;return f|0}function fk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;switch(c[f>>2]|0){case 7:{c[i>>2]=gk(c[g>>2]|0,c[h>>2]|0)|0;break}case 8:{c[i>>2]=hk(c[g>>2]|0,c[h>>2]|0)|0;break}case 9:{c[i>>2]=ik(c[g>>2]|0,c[h>>2]|0)|0;break}default:c[i>>2]=12}l=e;return c[i>>2]|0}function gk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;i=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=47242;c[i>>2]=lk()|0;do if(!(c[i>>2]|0)){if(c[f>>2]|0){c[h>>2]=38334;c[i>>2]=mk(2)|0;if(c[i>>2]|0)break;c[h>>2]=38338;c[i>>2]=mk(5)|0;if(c[i>>2]|0)break}c[e>>2]=0;j=c[e>>2]|0;l=d;return j|0}while(0);if(c[g>>2]|0)Eb[c[g>>2]&1](38079,7,c[h>>2]|0,c[i>>2]|0);c[e>>2]=50;j=c[e>>2]|0;l=d;return j|0}function hk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d+8|0;g=d+4|0;h=d;c[d+12>>2]=a;c[f>>2]=b;c[g>>2]=47242;c[h>>2]=kk()|0;if(!(c[h>>2]|0)){c[e>>2]=0;i=c[e>>2]|0;l=d;return i|0}if(c[f>>2]|0)Eb[c[f>>2]&1](38079,8,c[g>>2]|0,c[h>>2]|0);c[e>>2]=50;i=c[e>>2]|0;l=d;return i|0}function ik(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d+8|0;g=d+4|0;h=d;c[d+12>>2]=a;c[f>>2]=b;c[g>>2]=47242;c[h>>2]=jk()|0;if(!(c[h>>2]|0)){c[e>>2]=0;i=c[e>>2]|0;l=d;return i|0}if(c[f>>2]|0)Eb[c[f>>2]&1](38079,9,c[g>>2]|0,c[h>>2]|0);c[e>>2]=50;i=c[e>>2]|0;l=d;return i|0}function jk(){var a=0,b=0,d=0,e=0;a=l;l=l+528|0;if((l|0)>=(m|0))$(528);b=a+504|0;d=a;e=a+512|0;ck(d,38086,32)|0;dk(d,e,38118)|0;do if(!(Jv(e,38134,16)|0)){ek(d,e,e)|0;if(Jv(e,38118,16)|0){c[b>>2]=38182;break}else{c[b>>2]=0;break}}else c[b>>2]=38150;while(0);l=a;return c[b>>2]|0}function kk(){var a=0,b=0,d=0,e=0;a=l;l=l+528|0;if((l|0)>=(m|0))$(528);b=a+504|0;d=a;e=a+512|0;ck(d,38214,24)|0;dk(d,e,38238)|0;do if(!(Jv(e,38254,16)|0)){ek(d,e,e)|0;if(Jv(e,38238,16)|0){c[b>>2]=38302;break}else{c[b>>2]=0;break}}else c[b>>2]=38270;while(0);l=a;return c[b>>2]|0}function lk(){var a=0,b=0,d=0,e=0;a=l;l=l+528|0;if((l|0)>=(m|0))$(528);b=a+504|0;d=a;e=a+512|0;ck(d,38455,16)|0;dk(d,e,38471)|0;do if(!(Jv(e,38487,16)|0)){ek(d,e,e)|0;if(Jv(e,38471,16)|0){c[b>>2]=38535;break}else{c[b>>2]=0;break}}else c[b>>2]=38503;while(0);l=a;return c[b>>2]|0}function mk(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;b=l;l=l+48|0;if((l|0)>=(m|0))$(48);d=b+24|0;e=b+20|0;f=b+32|0;g=b+16|0;h=b+12|0;i=b+8|0;j=b+4|0;k=b;c[e>>2]=a;c[j>>2]=0;c[k>>2]=0;c[h>>2]=0;while(1){if((c[h>>2]|0)>>>0>=2)break;if((c[4636+((c[h>>2]|0)*164|0)>>2]|0)==(c[e>>2]|0))break;c[h>>2]=(c[h>>2]|0)+1}if((c[h>>2]|0)==2){Bh(c[j>>2]|0);Bh(c[k>>2]|0);c[d>>2]=38342;n=c[d>>2]|0;l=b;return n|0}c[g>>2]=wh(j,7,c[4636+((c[h>>2]|0)*164|0)>>2]|0,0)|0;if(c[g>>2]|0){Bh(c[j>>2]|0);Bh(c[k>>2]|0);c[d>>2]=38369;n=c[d>>2]|0;l=b;return n|0}c[g>>2]=wh(k,7,c[4636+((c[h>>2]|0)*164|0)>>2]|0,0)|0;e=c[j>>2]|0;if(c[g>>2]|0){Bh(e);Bh(c[k>>2]|0);c[d>>2]=38369;n=c[d>>2]|0;l=b;return n|0}c[g>>2]=Jh(e,4636+((c[h>>2]|0)*164|0)+4|0,16)|0;if(!(c[g>>2]|0))c[g>>2]=Jh(c[k>>2]|0,4636+((c[h>>2]|0)*164|0)+4|0,16)|0;e=c[j>>2]|0;if(c[g>>2]|0){Bh(e);Bh(c[k>>2]|0);c[d>>2]=38374;n=c[d>>2]|0;l=b;return n|0}c[g>>2]=Lh(e,4636+((c[h>>2]|0)*164|0)+20|0,16)|0;if(!(c[g>>2]|0))c[g>>2]=Lh(c[k>>2]|0,4636+((c[h>>2]|0)*164|0)+20|0,16)|0;if(c[g>>2]|0){Bh(c[j>>2]|0);Bh(c[k>>2]|0);c[d>>2]=38382;n=c[d>>2]|0;l=b;return n|0}c[i>>2]=0;while(1){o=c[j>>2]|0;if((c[i>>2]|0)>>>0>=4){p=30;break}c[g>>2]=Ch(o,f,16,4636+((c[h>>2]|0)*164|0)+36+(c[i>>2]<<5)|0,16)|0;if(c[g>>2]|0){p=22;break}if(Jv(f,4636+((c[h>>2]|0)*164|0)+36+(c[i>>2]<<5)+16|0,16)|0){p=24;break}c[g>>2]=Gh(c[k>>2]|0,f,16,4636+((c[h>>2]|0)*164|0)+36+(c[i>>2]<<5)+16|0,16)|0;if(c[g>>2]|0){p=26;break}if(Jv(f,4636+((c[h>>2]|0)*164|0)+36+(c[i>>2]<<5)|0,16)|0){p=28;break}c[i>>2]=(c[i>>2]|0)+1}if((p|0)==22){Bh(c[j>>2]|0);Bh(c[k>>2]|0);c[d>>2]=38389;n=c[d>>2]|0;l=b;return n|0}else if((p|0)==24){Bh(c[j>>2]|0);Bh(c[k>>2]|0);c[d>>2]=38405;n=c[d>>2]|0;l=b;return n|0}else if((p|0)==26){Bh(c[j>>2]|0);Bh(c[k>>2]|0);c[d>>2]=38422;n=c[d>>2]|0;l=b;return n|0}else if((p|0)==28){Bh(c[j>>2]|0);Bh(c[k>>2]|0);c[d>>2]=38438;n=c[d>>2]|0;l=b;return n|0}else if((p|0)==30){Bh(o);Bh(c[k>>2]|0);c[d>>2]=0;n=c[d>>2]|0;l=b;return n|0}return 0}function nk(b){b=b|0;var d=0,e=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d;c[e>>2]=b;if(a[(c[e>>2]|0)+484>>0]&1|0){l=d;return}ok(c[e>>2]|0);b=(c[e>>2]|0)+484|0;a[b>>0]=a[b>>0]&-2|1;l=d;return}function ok(a){a=a|0;var b=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0;b=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=b+20|0;f=b+16|0;g=b+12|0;h=b+8|0;i=b+4|0;j=b;c[e>>2]=a;c[g>>2]=4965;pk();qk();c[(c[e>>2]|0)+240>>2]=c[c[e>>2]>>2];c[(c[e>>2]|0)+240+4>>2]=c[(c[e>>2]|0)+4>>2];c[(c[e>>2]|0)+240+8>>2]=c[(c[e>>2]|0)+8>>2];c[(c[e>>2]|0)+240+12>>2]=c[(c[e>>2]|0)+12>>2];c[f>>2]=1;while(1){k=(c[e>>2]|0)+(c[f>>2]<<4)|0;if((c[f>>2]|0)>=(c[(c[e>>2]|0)+480>>2]|0))break;c[h>>2]=k;c[i>>2]=(c[e>>2]|0)+240+(c[f>>2]<<4);c[j>>2]=c[c[h>>2]>>2];a=rk(c[5988+((d[(c[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]|0)+(((c[j>>2]|0)>>>0&255)<<2)>>0]|0)<<2)>>2]|0,0)|0;a=n^(rk(c[5988+((d[(c[g>>2]|0)+(((c[j>>2]|0)>>>8&255)<<2)>>0]|0)<<2)>>2]|0,8)|0);n=a^(rk(c[5988+((d[(c[g>>2]|0)+(((c[j>>2]|0)>>>16&255)<<2)>>0]|0)<<2)>>2]|0,16)|0);a=n^(rk(c[5988+((d[(c[g>>2]|0)+(((c[j>>2]|0)>>>24&255)<<2)>>0]|0)<<2)>>2]|0,24)|0);c[(c[i>>2]|0)+12>>2]=a;c[f>>2]=(c[f>>2]|0)+1}c[(c[e>>2]|0)+240+(c[f>>2]<<4)>>2]=c[k>>2];c[(c[e>>2]|0)+240+(c[f>>2]<<4)+4>>2]=c[(c[e>>2]|0)+(c[f>>2]<<4)+4>>2];c[(c[e>>2]|0)+240+(c[f>>2]<<4)+8>>2]=c[(c[e>>2]|0)+(c[f>>2]<<4)+8>>2];c[(c[e>>2]|0)+240+(c[f>>2]<<4)+12>>2]=c[(c[e>>2]|0)+(c[f>>2]<<4)+12>>2];l=b;return}function pk(){sk(4964,1024);return}function qk(){sk(5988,1280);return}function rk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;l=d;return c[e>>2]<<(c[f>>2]&31)|(c[e>>2]|0)>>>(32-(c[f>>2]|0)&31)|0}function sk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[d+8>>2]=a;c[e>>2]=b;c[f>>2]=0;while(1){if((c[f>>2]|0)>>>0>=(c[e>>2]|0)>>>0)break;c[f>>2]=(c[f>>2]|0)+256}l=d;return}function tk(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;g=l;l=l+144|0;if((l|0)>=(m|0))$(144);h=g+72|0;i=g+132|0;j=g+128|0;k=g+124|0;n=g+120|0;o=g+116|0;p=g+112|0;q=g+108|0;r=g+104|0;s=g+100|0;t=g+96|0;u=g+92|0;v=g+88|0;w=g+8|0;x=g+84|0;y=g+80|0;z=g+136|0;A=g;B=g+76|0;c[j>>2]=b;c[k>>2]=e;c[n>>2]=f;c[t>>2]=0;f=(Wg()|0)!=0;if(!(f|(c[17738]|0)!=0)?(c[17738]=1,c[17739]=uk()|0,c[17739]|0):0){c[h>>2]=c[17739];Ve(43492,h)}if(c[17739]|0){c[i>>2]=50;C=c[i>>2]|0;l=g;return C|0}do if((c[n>>2]|0)==16){c[o>>2]=10;c[u>>2]=4}else{if((c[n>>2]|0)==24){c[o>>2]=12;c[u>>2]=6;break}if((c[n>>2]|0)==32){c[o>>2]=14;c[u>>2]=8;break}c[i>>2]=44;C=c[i>>2]|0;l=g;return C|0}while(0);c[(c[j>>2]|0)+480>>2]=c[o>>2];h=(c[j>>2]|0)+484|0;a[h>>0]=a[h>>0]&-2;c[(c[j>>2]|0)+488>>2]=29;c[(c[j>>2]|0)+492>>2]=30;c[(c[j>>2]|0)+496>>2]=1;c[(c[j>>2]|0)+500>>2]=2;c[v>>2]=4965;pk();c[p>>2]=0;while(1){if((c[p>>2]|0)>>>0>=(c[n>>2]|0)>>>0)break;a[w+(c[p>>2]>>2<<2)+(c[p>>2]&3)>>0]=a[(c[k>>2]|0)+(c[p>>2]|0)>>0]|0;c[p>>2]=(c[p>>2]|0)+1}c[q>>2]=(c[u>>2]|0)-1;while(1){if((c[q>>2]|0)<0)break;c[w+32+(c[q>>2]<<2)>>2]=c[w+(c[q>>2]<<2)>>2];c[q>>2]=(c[q>>2]|0)+-1}c[r>>2]=0;c[s>>2]=0;c[q>>2]=0;while(1){if((c[q>>2]|0)>=(c[u>>2]|0))break;if((c[r>>2]|0)>=((c[o>>2]|0)+1|0))break;while(1){if(!((c[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-1<<2)>>0]|0)<<2)>>0]|0);k=w+32+(((c[u>>2]|0)/2|0)<<2)+1|0;a[k>>0]=(d[k>>0]|0)^(d[(c[v>>2]|0)+((d[w+32+(((c[u>>2]|0)/2|0)-1<<2)+1>>0]|0)<<2)>>0]|0);k=w+32+(((c[u>>2]|0)/2|0)<<2)+2|0;a[k>>0]=(d[k>>0]|0)^(d[(c[v>>2]|0)+((d[w+32+(((c[u>>2]|0)/2|0)-1<<2)+2>>0]|0)<<2)>>0]|0);k=w+32+(((c[u>>2]|0)/2|0)<<2)+3|0;a[k>>0]=(d[k>>0]|0)^(d[(c[v>>2]|0)+((d[w+32+(((c[u>>2]|0)/2|0)-1<<2)+3>>0]|0)<<2)>>0]|0);c[q>>2]=((c[u>>2]|0)/2|0)+1;while(1){if((c[q>>2]|0)>=(c[u>>2]|0))break b;k=w+32+(c[q>>2]<<2)|0;c[k>>2]=c[k>>2]^c[w+32+((c[q>>2]|0)-1<<2)>>2];c[q>>2]=(c[q>>2]|0)+1}}while(0);c[q>>2]=0;while(1){if((c[q>>2]|0)>=(c[u>>2]|0))continue a;if((c[r>>2]|0)>=((c[o>>2]|0)+1|0))continue a;while(1){if(!((c[q>>2]|0)<(c[u>>2]|0)?(c[s>>2]|0)<4:0))break;c[(c[j>>2]|0)+(c[r>>2]<<4)+(c[s>>2]<<2)>>2]=c[w+32+(c[q>>2]<<2)>>2];c[q>>2]=(c[q>>2]|0)+1;c[s>>2]=(c[s>>2]|0)+1}if((c[s>>2]|0)!=4)continue;c[r>>2]=(c[r>>2]|0)+1;c[s>>2]=0}}c[x>>2]=w;c[y>>2]=64;a[z>>0]=0;w=A;c[w>>2]=d[z>>0];c[w+4>>2]=0;while(1){if(!(c[x>>2]&7|0?(c[y>>2]|0)!=0:0))break;a[c[x>>2]>>0]=a[z>>0]|0;c[x>>2]=(c[x>>2]|0)+1;c[y>>2]=(c[y>>2]|0)+-1}if((c[y>>2]|0)>>>0>=8){w=A;s=gx(c[w>>2]|0,c[w+4>>2]|0,16843009,16843009)|0;w=A;c[w>>2]=s;c[w+4>>2]=D;do{c[B>>2]=c[x>>2];w=A;s=c[w+4>>2]|0;r=c[B>>2]|0;c[r>>2]=c[w>>2];c[r+4>>2]=s;c[y>>2]=(c[y>>2]|0)-8;c[x>>2]=(c[x>>2]|0)+8}while((c[y>>2]|0)>>>0>=8)}while(1){if(!(c[y>>2]|0))break;a[c[x>>2]>>0]=a[z>>0]|0;c[x>>2]=(c[x>>2]|0)+1;c[y>>2]=(c[y>>2]|0)+-1}c[i>>2]=0;C=c[i>>2]|0;l=g;return C|0}function uk(){var a=0,b=0,d=0,e=0,f=0,g=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a+4|0;d=a;e=lk()|0;c[d>>2]=e;do if((!(e|0)?(f=kk()|0,c[d>>2]=f,!(f|0)):0)?(f=jk()|0,c[d>>2]=f,!(f|0)):0){f=Bk()|0;c[d>>2]=f;if(f|0){c[b>>2]=c[d>>2];break}f=Ck()|0;c[d>>2]=f;if(f|0){c[b>>2]=c[d>>2];break}else{c[d>>2]=Dk()|0;c[b>>2]=c[d>>2];break}}else g=4;while(0);if((g|0)==4)c[b>>2]=c[d>>2];l=a;return c[b>>2]|0}function vk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;d=Ak(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;l=e;return d|0}function wk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;d=xk(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;l=e;return d|0}function xk(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,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=c[(c[g>>2]|0)+240+16+12>>2]^c[o+12>>2];c[o>>2]=(d[7012+((c[n>>2]|0)>>>0&255)>>0]|0)<<0;c[o+4>>2]=(d[7012+((c[n>>2]|0)>>>8&255)>>0]|0)<<8;c[o+8>>2]=(d[7012+((c[n>>2]|0)>>>16&255)>>0]|0)<<16;c[o+12>>2]=(d[7012+((c[n>>2]|0)>>>24&255)>>0]|0)<<24;c[n>>2]=c[o>>2]^c[(c[g>>2]|0)+240>>2];k=o+4|0;c[k>>2]=c[k>>2]^(d[7012+((c[n+4>>2]|0)>>>0&255)>>0]|0)<<0;k=o+8|0;c[k>>2]=c[k>>2]^(d[7012+((c[n+4>>2]|0)>>>8&255)>>0]|0)<<8;k=o+12|0;c[k>>2]=c[k>>2]^(d[7012+((c[n+4>>2]|0)>>>16&255)>>0]|0)<<16;c[n>>2]=c[n>>2]^(d[7012+((c[n+4>>2]|0)>>>24&255)>>0]|0)<<24;c[n+4>>2]=c[o+4>>2]^c[(c[g>>2]|0)+240+4>>2];k=o+8|0;c[k>>2]=c[k>>2]^(d[7012+((c[n+8>>2]|0)>>>0&255)>>0]|0)<<0;k=o+12|0;c[k>>2]=c[k>>2]^(d[7012+((c[n+8>>2]|0)>>>8&255)>>0]|0)<<8;c[n>>2]=c[n>>2]^(d[7012+((c[n+8>>2]|0)>>>16&255)>>0]|0)<<16;k=n+4|0;c[k>>2]=c[k>>2]^(d[7012+((c[n+8>>2]|0)>>>24&255)>>0]|0)<<24;c[n+8>>2]=c[o+8>>2]^c[(c[g>>2]|0)+240+8>>2];k=o+12|0;c[k>>2]=c[k>>2]^(d[7012+((c[n+12>>2]|0)>>>0&255)>>0]|0)<<0;c[n>>2]=c[n>>2]^(d[7012+((c[n+12>>2]|0)>>>8&255)>>0]|0)<<8;k=n+4|0;c[k>>2]=c[k>>2]^(d[7012+((c[n+12>>2]|0)>>>16&255)>>0]|0)<<16;k=n+8|0;c[k>>2]=c[k>>2]^(d[7012+((c[n+12>>2]|0)>>>24&255)>>0]|0)<<24;c[n+12>>2]=c[o+12>>2]^c[(c[g>>2]|0)+240+12>>2];zk(c[h>>2]|0,c[n>>2]|0);zk((c[h>>2]|0)+4|0,c[n+4>>2]|0);zk((c[h>>2]|0)+8|0,c[n+8>>2]|0);zk((c[h>>2]|0)+12|0,c[n+12>>2]|0);l=f;return 64}function yk(a){a=a|0;var b=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=b+4|0;f=b;c[e>>2]=a;c[f>>2]=c[e>>2];l=b;return (d[(c[f>>2]|0)+3>>0]|0)<<24|(d[(c[f>>2]|0)+2>>0]|0)<<16|(d[(c[f>>2]|0)+1>>0]|0)<<8|(d[c[f>>2]>>0]|0)|0}function zk(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=b;c[g>>2]=d;c[h>>2]=c[f>>2];a[(c[h>>2]|0)+3>>0]=(c[g>>2]|0)>>>24;a[(c[h>>2]|0)+2>>0]=(c[g>>2]|0)>>>16;a[(c[h>>2]|0)+1>>0]=(c[g>>2]|0)>>>8;a[c[h>>2]>>0]=c[g>>2];l=e;return}function Ak(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;f=l;l=l+64|0;if((l|0)>=(m|0))$(64);g=f+52|0;h=f+48|0;i=f+44|0;j=f+40|0;k=f+36|0;n=f+32|0;o=f+16|0;p=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=e;c[j>>2]=4965;c[k>>2]=c[(c[g>>2]|0)+480>>2];c[p>>2]=yk(c[i>>2]|0)|0;c[p+4>>2]=yk((c[i>>2]|0)+4|0)|0;c[p+8>>2]=yk((c[i>>2]|0)+8|0)|0;c[p+12>>2]=yk((c[i>>2]|0)+12|0)|0;c[o>>2]=c[p>>2]^c[c[g>>2]>>2];c[o+4>>2]=c[p+4>>2]^c[(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]^(d[(c[j>>2]|0)+(((c[o+12>>2]|0)>>>24&255)<<2)>>0]|0)<<24;c[o+12>>2]=c[(c[g>>2]|0)+(c[n>>2]<<4)+12>>2]^c[p+12>>2];zk(c[h>>2]|0,c[o>>2]|0);zk((c[h>>2]|0)+4|0,c[o+4>>2]|0);zk((c[h>>2]|0)+8|0,c[o+8>>2]|0);zk((c[h>>2]|0)+12|0,c[o+12>>2]|0);l=f;return 64}function Bk(){var a=0,b=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);c[a+8>>2]=9;c[a+4>>2]=16;c[a>>2]=504;b=wr(38075,1,2,4,9,16,504)|0;l=a;return b|0}function Ck(){var a=0,b=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);c[a+8>>2]=10;c[a+4>>2]=16;c[a>>2]=504;b=sr(38075,1,2,3,10,16,504)|0;l=a;return b|0}function Dk(){var a=0,b=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);c[a+8>>2]=10;c[a+4>>2]=16;c[a>>2]=504;b=ur(38075,1,2,2,10,16,504)|0;l=a;return b|0}function Ek(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;g=l;l=l+48|0;if((l|0)>=(m|0))$(48);h=g+36|0;i=g+32|0;j=g+28|0;k=g+24|0;n=g+20|0;o=g+16|0;p=g+12|0;q=g+8|0;r=g+4|0;s=g;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;c[n>>2]=f;c[o>>2]=c[h>>2];c[p>>2]=c[j>>2];c[q>>2]=c[k>>2];c[r>>2]=0;if(c[(c[o>>2]|0)+496>>2]|0)Ab[c[(c[o>>2]|0)+496>>2]&3]();c[s>>2]=c[(c[o>>2]|0)+488>>2];while(1){if(!(c[n>>2]|0))break;c[r>>2]=ub[c[s>>2]&63](c[o>>2]|0,c[i>>2]|0,c[i>>2]|0)|0;Fk(c[p>>2]|0,c[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2]&7|0?(c[x>>2]|0)!=0:0))break;a[c[w>>2]>>0]=a[y>>0]|0;c[w>>2]=(c[w>>2]|0)+1;c[x>>2]=(c[x>>2]|0)+-1}if((c[x>>2]|0)>>>0>=8){u=z;p=gx(c[u>>2]|0,c[u+4>>2]|0,16843009,16843009)|0;u=z;c[u>>2]=p;c[u+4>>2]=D;do{c[A>>2]=c[w>>2];u=z;p=c[u+4>>2]|0;r=c[A>>2]|0;c[r>>2]=c[u>>2];c[r+4>>2]=p;c[x>>2]=(c[x>>2]|0)-8;c[w>>2]=(c[w>>2]|0)+8}while((c[x>>2]|0)>>>0>=8)}while(1){if(!(c[x>>2]|0))break;a[c[w>>2]>>0]=a[y>>0]|0;c[w>>2]=(c[w>>2]|0)+1;c[x>>2]=(c[x>>2]|0)+-1}if(!(c[t>>2]|0)){l=i;return}bf((c[t>>2]|0)+16|0);cf();l=i;return}function Ik(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;i=l;l=l+96|0;if((l|0)>=(m|0))$(96);j=i+76|0;k=i+72|0;n=i+68|0;o=i+64|0;p=i+60|0;q=i+56|0;r=i+52|0;s=i+48|0;t=i+44|0;u=i+40|0;v=i;w=i+36|0;x=i+32|0;y=i+28|0;z=i+80|0;A=i+16|0;B=i+24|0;c[j>>2]=b;c[k>>2]=e;c[n>>2]=f;c[o>>2]=g;c[p>>2]=h;c[q>>2]=c[j>>2];c[r>>2]=c[n>>2];c[s>>2]=c[o>>2];c[t>>2]=0;if(c[(c[q>>2]|0)+496>>2]|0)Ab[c[(c[q>>2]|0)+496>>2]&3]();c[w>>2]=c[(c[q>>2]|0)+488>>2];while(1){if(!(c[p>>2]|0))break;c[t>>2]=ub[c[w>>2]&63](c[q>>2]|0,v,c[k>>2]|0)|0;Jk(c[r>>2]|0,v,c[s>>2]|0,16);c[r>>2]=(c[r>>2]|0)+16;c[s>>2]=(c[s>>2]|0)+16;c[u>>2]=16;while(1){if((c[u>>2]|0)<=0)break;o=(c[k>>2]|0)+((c[u>>2]|0)-1)|0;a[o>>0]=(a[o>>0]|0)+1<<24>>24;if(a[(c[k>>2]|0)+((c[u>>2]|0)-1)>>0]|0)break;c[u>>2]=(c[u>>2]|0)+-1}c[p>>2]=(c[p>>2]|0)+-1}c[x>>2]=v;c[y>>2]=16;a[z>>0]=0;v=A;c[v>>2]=d[z>>0];c[v+4>>2]=0;while(1){if(!(c[x>>2]&7|0?(c[y>>2]|0)!=0:0))break;a[c[x>>2]>>0]=a[z>>0]|0;c[x>>2]=(c[x>>2]|0)+1;c[y>>2]=(c[y>>2]|0)+-1}if((c[y>>2]|0)>>>0>=8){v=A;p=gx(c[v>>2]|0,c[v+4>>2]|0,16843009,16843009)|0;v=A;c[v>>2]=p;c[v+4>>2]=D;do{c[B>>2]=c[x>>2];v=A;p=c[v+4>>2]|0;u=c[B>>2]|0;c[u>>2]=c[v>>2];c[u+4>>2]=p;c[y>>2]=(c[y>>2]|0)-8;c[x>>2]=(c[x>>2]|0)+8}while((c[y>>2]|0)>>>0>=8)}while(1){if(!(c[y>>2]|0))break;a[c[x>>2]>>0]=a[z>>0]|0;c[x>>2]=(c[x>>2]|0)+1;c[y>>2]=(c[y>>2]|0)+-1}if(!(c[t>>2]|0)){l=i;return}bf((c[t>>2]|0)+16|0);cf();l=i;return}function Jk(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=l;l=l+48|0;if((l|0)>=(m|0))$(48);i=h+40|0;j=h+36|0;k=h+32|0;n=h+28|0;o=h+24|0;p=h+20|0;q=h+16|0;r=h+12|0;s=h+8|0;t=h+4|0;c[i>>2]=b;c[j>>2]=e;c[k>>2]=f;c[n>>2]=g;c[o>>2]=c[i>>2];c[p>>2]=c[j>>2];c[q>>2]=c[k>>2];c[h>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>>2]=e;c[o>>2]=f;c[p>>2]=g;c[q>>2]=c[i>>2];c[r>>2]=c[k>>2];c[s>>2]=c[n>>2];c[u>>2]=0;if(c[(c[q>>2]|0)+496>>2]|0)Ab[c[(c[q>>2]|0)+496>>2]&3]();c[v>>2]=c[(c[q>>2]|0)+488>>2];c[t>>2]=c[j>>2];while(1){if(!(c[o>>2]|0))break;Jk(c[r>>2]|0,c[s>>2]|0,c[t>>2]|0,16);c[u>>2]=ub[c[v>>2]&63](c[q>>2]|0,c[r>>2]|0,c[r>>2]|0)|0;c[t>>2]=c[r>>2];c[s>>2]=(c[s>>2]|0)+16;if(!(c[p>>2]|0))c[r>>2]=(c[r>>2]|0)+16;c[o>>2]=(c[o>>2]|0)+-1}if((c[t>>2]|0)!=(c[j>>2]|0))Nk(c[j>>2]|0,c[t>>2]|0,16);if(!(c[u>>2]|0)){l=h;return}bf((c[u>>2]|0)+16|0);cf();l=h;return}function Nk(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f+28|0;h=f+24|0;i=f+20|0;j=f+16|0;k=f+12|0;n=f+8|0;o=f+4|0;c[g>>2]=b;c[h>>2]=d;c[i>>2]=e;c[j>>2]=c[g>>2];c[k>>2]=c[h>>2];c[f>>2]=3;if(!((c[j>>2]|c[k>>2])&3)){c[n>>2]=c[j>>2];c[o>>2]=c[k>>2];while(1){if((c[i>>2]|0)>>>0<4)break;h=c[o>>2]|0;c[o>>2]=h+4;g=c[h>>2]|0;h=c[n>>2]|0;c[n>>2]=h+4;c[h>>2]=g;c[i>>2]=(c[i>>2]|0)-4}c[j>>2]=c[n>>2];c[k>>2]=c[o>>2]}while(1){if(!(c[i>>2]|0))break;o=c[k>>2]|0;c[k>>2]=o+1;n=a[o>>0]|0;o=c[j>>2]|0;c[j>>2]=o+1;a[o>>0]=n;c[i>>2]=(c[i>>2]|0)+-1}l=f;return}function Ok(a,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k(c[p>>2]|0,s,16);c[q>>2]=(c[q>>2]|0)+16;c[p>>2]=(c[p>>2]|0)+16;c[k>>2]=(c[k>>2]|0)+-1}}else{c[y>>2]=c[j+492>>2];while(1){if(!(c[k>>2]|0))break a;f=(c[h>>2]|0)+128+336|0;d=f;e=Ww(c[d>>2]|0,c[d+4>>2]|0,1,0)|0;d=D;i=f;c[i>>2]=e;c[i+4>>2]=d;i=z;c[i>>2]=e;c[i+4>>2]=d;d=z;c[A>>2]=Pk(c[d>>2]|0,c[d+4>>2]|0)|0;if((c[A>>2]|0)>>>0<16)c[B>>2]=(c[h>>2]|0)+128+32+(c[A>>2]<<4);else{d=z;c[B>>2]=Uq(c[h>>2]|0,x,c[d>>2]|0,c[d+4>>2]|0)|0}Qk((c[h>>2]|0)+64|0,c[B>>2]|0,16);Nk(x,c[q>>2]|0,16);Qk(x,(c[h>>2]|0)+64|0,16);c[r>>2]=ub[c[y>>2]&63](c[o>>2]|0,x,x)|0;Qk(x,(c[h>>2]|0)+64|0,16);Qk((c[h>>2]|0)+80|0,x,16);Nk(c[p>>2]|0,x,16);c[q>>2]=(c[q>>2]|0)+16;c[p>>2]=(c[p>>2]|0)+16;c[k>>2]=(c[k>>2]|0)+-1}}while(0);if(!(c[r>>2]|0)){l=g;return}bf((c[r>>2]|0)+16|0);cf();l=g;return}function Pk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+8|0;f=d;g=f;c[g>>2]=a;c[g+4>>2]=b;b=f;g=c[b+4>>2]|0;if((c[f>>2]|0)!=0|0!=0){c[e>>2]=Rk(c[b>>2]|0)|0;h=c[e>>2]|0;l=d;return h|0}else{c[e>>2]=32+(Rk(g)|0);h=c[e>>2]|0;l=d;return h|0}return 0}function Qk(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g+28|0;i=g+24|0;j=g+20|0;k=g+16|0;n=g+12|0;o=g+8|0;p=g+4|0;c[h>>2]=b;c[i>>2]=e;c[j>>2]=f;c[k>>2]=c[h>>2];c[n>>2]=c[i>>2];c[g>>2]=3;if(!((c[k>>2]|c[n>>2])&3)){c[o>>2]=c[k>>2];c[p>>2]=c[n>>2];while(1){if((c[j>>2]|0)>>>0<4)break;i=c[p>>2]|0;c[p>>2]=i+4;h=c[i>>2]|0;i=c[o>>2]|0;c[o>>2]=i+4;c[i>>2]=c[i>>2]^h;c[j>>2]=(c[j>>2]|0)-4}c[k>>2]=c[o>>2];c[n>>2]=c[p>>2]}while(1){if(!(c[j>>2]|0))break;p=c[n>>2]|0;c[n>>2]=p+1;o=d[p>>0]|0;p=c[k>>2]|0;c[k>>2]=p+1;a[p>>0]=(d[p>>0]|0)^o;c[j>>2]=(c[j>>2]|0)+-1}l=g;return}function Rk(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=(c[d>>2]|0)!=0;e=Xw(c[d>>2]|0)|0;l=b;return (a?e:32)|0}function Sk(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;g=l;l=l+96|0;if((l|0)>=(m|0))$(96);h=g+76|0;i=g+72|0;j=g+68|0;k=g+64|0;n=g+60|0;o=g+56|0;p=g;q=g+52|0;r=g+24|0;s=g+48|0;t=g+44|0;u=g+40|0;v=g+36|0;w=g+80|0;x=g+16|0;y=g+32|0;c[h>>2]=b;c[i>>2]=e;c[j>>2]=f;c[k>>2]=(c[h>>2]|0)+496;c[n>>2]=c[i>>2];c[o>>2]=0;if(c[(c[k>>2]|0)+496>>2]|0)Ab[c[(c[k>>2]|0)+496>>2]&3]();c[q>>2]=c[(c[k>>2]|0)+488>>2];while(1){if(!(c[j>>2]|0))break;i=(c[h>>2]|0)+128+344|0;f=i;e=Ww(c[f>>2]|0,c[f+4>>2]|0,1,0)|0;f=D;b=i;c[b>>2]=e;c[b+4>>2]=f;b=r;c[b>>2]=e;c[b+4>>2]=f;f=r;c[s>>2]=Pk(c[f>>2]|0,c[f+4>>2]|0)|0;if((c[s>>2]|0)>>>0<16)c[t>>2]=(c[h>>2]|0)+128+32+(c[s>>2]<<4);else{f=r;c[t>>2]=Uq(c[h>>2]|0,p,c[f>>2]|0,c[f+4>>2]|0)|0}Qk((c[h>>2]|0)+128+304|0,c[t>>2]|0,16);Jk(p,(c[h>>2]|0)+128+304|0,c[n>>2]|0,16);c[o>>2]=ub[c[q>>2]&63](c[k>>2]|0,p,p)|0;Qk((c[h>>2]|0)+128+320|0,p,16);c[n>>2]=(c[n>>2]|0)+16;c[j>>2]=(c[j>>2]|0)+-1}c[u>>2]=p;c[v>>2]=16;a[w>>0]=0;p=x;c[p>>2]=d[w>>0];c[p+4>>2]=0;while(1){if(!(c[u>>2]&7|0?(c[v>>2]|0)!=0:0))break;a[c[u>>2]>>0]=a[w>>0]|0;c[u>>2]=(c[u>>2]|0)+1;c[v>>2]=(c[v>>2]|0)+-1}if((c[v>>2]|0)>>>0>=8){p=x;j=gx(c[p>>2]|0,c[p+4>>2]|0,16843009,16843009)|0;p=x;c[p>>2]=j;c[p+4>>2]=D;do{c[y>>2]=c[u>>2];p=x;j=c[p+4>>2]|0;n=c[y>>2]|0;c[n>>2]=c[p>>2];c[n+4>>2]=j;c[v>>2]=(c[v>>2]|0)-8;c[u>>2]=(c[u>>2]|0)+8}while((c[v>>2]|0)>>>0>=8)}while(1){if(!(c[v>>2]|0))break;a[c[u>>2]>>0]=a[w>>0]|0;c[u>>2]=(c[u>>2]|0)+1;c[v>>2]=(c[v>>2]|0)+-1}if(!(c[o>>2]|0)){l=g;return}bf((c[o>>2]|0)+16|0);cf();l=g;return}function Tk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+8|0;f=d;c[e>>2]=a;c[d+4>>2]=b;c[f>>2]=c[e>>2];c[(c[f>>2]|0)+160>>2]=1732584193;c[(c[f>>2]|0)+164>>2]=-271733879;c[(c[f>>2]|0)+168>>2]=-1732584194;c[(c[f>>2]|0)+172>>2]=271733878;c[(c[f>>2]|0)+176>>2]=-1009589776;e=(c[f>>2]|0)+128|0;c[e>>2]=0;c[e+4>>2]=0;e=(c[f>>2]|0)+136|0;c[e>>2]=0;c[e+4>>2]=0;c[(c[f>>2]|0)+144>>2]=0;c[(c[f>>2]|0)+148>>2]=64;c[(c[f>>2]|0)+152>>2]=31;l=d;return}function Uk(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+28|0;f=d+24|0;g=d+20|0;h=d+16|0;i=d+12|0;j=d+8|0;k=d+4|0;n=d;c[e>>2]=b;c[f>>2]=c[e>>2];Nr(c[f>>2]|0,0,0);c[g>>2]=c[(c[f>>2]|0)+128>>2];c[h>>2]=c[(c[f>>2]|0)+128+4>>2];c[j>>2]=c[g>>2]<<6;c[i>>2]=c[h>>2]<<6|(c[g>>2]|0)>>>26;c[g>>2]=c[j>>2];h=(c[j>>2]|0)+(c[(c[f>>2]|0)+144>>2]|0)|0;c[j>>2]=h;if(h>>>0<(c[g>>2]|0)>>>0)c[i>>2]=(c[i>>2]|0)+1;c[g>>2]=c[j>>2];c[j>>2]=c[j>>2]<<3;c[i>>2]=c[i>>2]<<3;c[i>>2]=c[i>>2]|(c[g>>2]|0)>>>29;g=(c[(c[f>>2]|0)+144>>2]|0)<56;h=(c[f>>2]|0)+144|0;e=c[h>>2]|0;c[h>>2]=e+1;a[(c[f>>2]|0)+e>>0]=-128;a:do if(g)while(1){if((c[(c[f>>2]|0)+144>>2]|0)>=56)break a;e=(c[f>>2]|0)+144|0;h=c[e>>2]|0;c[e>>2]=h+1;a[(c[f>>2]|0)+h>>0]=0}else{while(1){o=c[f>>2]|0;if((c[(c[f>>2]|0)+144>>2]|0)>=64)break;h=o+144|0;e=c[h>>2]|0;c[h>>2]=e+1;a[(c[f>>2]|0)+e>>0]=0}Nr(o,0,0);e=c[f>>2]|0;h=e+56|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(h|0))}while(0);Wk((c[f>>2]|0)+56|0,c[j>>2]|0);Wk((c[f>>2]|0)+60|0,c[i>>2]|0);c[n>>2]=Xk(c[f>>2]|0,c[f>>2]|0,1)|0;bf(c[n>>2]|0);cf();c[k>>2]=c[f>>2];Wk(c[k>>2]|0,c[(c[f>>2]|0)+160>>2]|0);c[k>>2]=(c[k>>2]|0)+4;Wk(c[k>>2]|0,c[(c[f>>2]|0)+164>>2]|0);c[k>>2]=(c[k>>2]|0)+4;Wk(c[k>>2]|0,c[(c[f>>2]|0)+168>>2]|0);c[k>>2]=(c[k>>2]|0)+4;Wk(c[k>>2]|0,c[(c[f>>2]|0)+172>>2]|0);c[k>>2]=(c[k>>2]|0)+4;Wk(c[k>>2]|0,c[(c[f>>2]|0)+176>>2]|0);c[k>>2]=(c[k>>2]|0)+4;l=d;return}function Vk(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=c[d>>2];l=b;return c[e>>2]|0}function Wk(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=b;c[g>>2]=d;c[h>>2]=c[f>>2];a[(c[h>>2]|0)+3>>0]=(c[g>>2]|0)>>>24;a[(c[h>>2]|0)+2>>0]=(c[g>>2]|0)>>>16;a[(c[h>>2]|0)+1>>0]=(c[g>>2]|0)>>>8;a[c[h>>2]>>0]=c[g>>2];l=e;return}function Xk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16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548603684+(c[t+24>>2]|0));u=_k(c[s>>2]|0,9)|0;c[s>>2]=u+(c[q>>2]|0);c[k>>2]=_k(c[k>>2]|0,10)|0;c[p>>2]=(c[p>>2]|0)+((c[r>>2]&c[h>>2]|~c[r>>2]&c[j>>2])+1518500249+(c[t+16>>2]|0));u=_k(c[p>>2]|0,6)|0;c[p>>2]=u+(c[n>>2]|0);c[h>>2]=_k(c[h>>2]|0,10)|0;c[q>>2]=(c[q>>2]|0)+((c[s>>2]&c[k>>2]|c[i>>2]&~c[k>>2])+1548603684+(c[t+44>>2]|0));u=_k(c[q>>2]|0,13)|0;c[q>>2]=u+(c[o>>2]|0);c[i>>2]=_k(c[i>>2]|0,10)|0;c[n>>2]=(c[n>>2]|0)+((c[p>>2]&c[r>>2]|~c[p>>2]&c[h>>2])+1518500249+(c[t+52>>2]|0));u=_k(c[n>>2]|0,8)|0;c[n>>2]=u+(c[j>>2]|0);c[r>>2]=_k(c[r>>2]|0,10)|0;c[o>>2]=(c[o>>2]|0)+((c[q>>2]&c[i>>2]|c[s>>2]&~c[i>>2])+1548603684+(c[t+12>>2]|0));u=_k(c[o>>2]|0,15)|0;c[o>>2]=u+(c[k>>2]|0);c[s>>2]=_k(c[s>>2]|0,10)|0;c[j>>2]=(c[j>>2]|0)+((c[n>>2]&c[p>>2]|~c[n>>2]&c[r>>2])+1518500249+(c[t+4>>2]|0));u=_k(c[j>>2]|0,13)|0;c[j>>2]=u+(c[h>>2]|0);c[p>>2]=_k(c[p>>2]|0,10)|0;c[k>>2]=(c[k>>2]|0)+((c[o>>2]&c[s>>2]|c[q>>2]&~c[s>>2])+1548603684+(c[t+28>>2]|0));u=_k(c[k>>2]|0,7)|0;c[k>>2]=u+(c[i>>2]|0);c[q>>2]=_k(c[q>>2]|0,10)|0;c[h>>2]=(c[h>>2]|0)+((c[j>>2]&c[n>>2]|~c[j>>2]&c[p>>2])+1518500249+(c[t+40>>2]|0));u=_k(c[h>>2]|0,11)|0;c[h>>2]=u+(c[r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((c[n>>2]&c[p>>2]|~c[n>>2]&c[r>>2])+1518500249+(c[t+48>>2]|0));u=_k(c[j>>2]|0,7)|0;c[j>>2]=u+(c[h>>2]|0);c[p>>2]=_k(c[p>>2]|0,10)|0;c[k>>2]=(c[k>>2]|0)+((c[o>>2]&c[s>>2]|c[q>>2]&~c[s>>2])+1548603684+(c[t+56>>2]|0));u=_k(c[k>>2]|0,7)|0;c[k>>2]=u+(c[i>>2]|0);c[q>>2]=_k(c[q>>2]|0,10)|0;c[h>>2]=(c[h>>2]|0)+((c[j>>2]&c[n>>2]|~c[j>>2]&c[p>>2])+1518500249+(c[t>>2]|0));u=_k(c[h>>2]|0,12)|0;c[h>>2]=u+(c[r>>2]|0);c[n>>2]=_k(c[n>>2]|0,10)|0;c[i>>2]=(c[i>>2]|0)+((c[k>>2]&c[q>>2]|c[o>>2]&~c[q>>2])+1548603684+(c[t+60>>2]|0));u=_k(c[i>>2]|0,7)|0;c[i>>2]=u+(c[s>>2]|0);c[o>>2]=_k(c[o>>2]|0,10)|0;c[r>>2]=(c[r>>2]|0)+((c[h>>2]&c[j>>2]|~c[h>>2]&c[n>>2])+1518500249+(c[t+36>>2]|0));u=_k(c[r>>2]|0,15)|0;c[r>>2]=u+(c[p>>2]|0);c[j>>2]=_k(c[j>>2]|0,10)|0;c[s>>2]=(c[s>>2]|0)+((c[i>>2]&c[o>>2]|c[k>>2]&~c[o>>2])+1548603684+(c[t+32>>2]|0));u=_k(c[s>>2]|0,12)|0;c[s>>2]=u+(c[q>>2]|0);c[k>>2]=_k(c[k>>2]|0,10)|0;c[p>>2]=(c[p>>2]|0)+((c[r>>2]&c[h>>2]|~c[r>>2]&c[j>>2])+1518500249+(c[t+20>>2]|0));u=_k(c[p>>2]|0,9)|0;c[p>>2]=u+(c[n>>2]|0);c[h>>2]=_k(c[h>>2]|0,10)|0;c[q>>2]=(c[q>>2]|0)+((c[s>>2]&c[k>>2]|c[i>>2]&~c[k>>2])+1548603684+(c[t+48>>2]|0));u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c[j>>2]|0,10)|0;c[s>>2]=(c[s>>2]|0)+((c[i>>2]&c[o>>2]|c[k>>2]&~c[o>>2])+1548603684+(c[t+8>>2]|0));u=_k(c[s>>2]|0,11)|0;c[s>>2]=u+(c[q>>2]|0);c[k>>2]=_k(c[k>>2]|0,10)|0;c[p>>2]=(c[p>>2]|0)+(((c[r>>2]|~c[h>>2])^c[j>>2])+1859775393+(c[t+12>>2]|0));u=_k(c[p>>2]|0,11)|0;c[p>>2]=u+(c[n>>2]|0);c[h>>2]=_k(c[h>>2]|0,10)|0;c[q>>2]=(c[q>>2]|0)+(((c[s>>2]|~c[i>>2])^c[k>>2])+1836072691+(c[t+60>>2]|0));u=_k(c[q>>2]|0,9)|0;c[q>>2]=u+(c[o>>2]|0);c[i>>2]=_k(c[i>>2]|0,10)|0;c[n>>2]=(c[n>>2]|0)+(((c[p>>2]|~c[r>>2])^c[h>>2])+1859775393+(c[t+40>>2]|0));u=_k(c[n>>2]|0,13)|0;c[n>>2]=u+(c[j>>2]|0);c[r>>2]=_k(c[r>>2]|0,10)|0;c[o>>2]=(c[o>>2]|0)+(((c[q>>2]|~c[s>>2])^c[i>>2])+1836072691+(c[t+20>>2]|0));u=_k(c[o>>2]|0,7)|0;c[o>>2]=u+(c[k>>2]|0);c[s>>2]=_k(c[s>>2]|0,10)|0;c[j>>2]=(c[j>>2]|0)+(((c[n>>2]|~c[p>>2])^c[r>>2])+1859775393+(c[t+56>>2]|0));u=_k(c[j>>2]|0,6)|0;c[j>>2]=u+(c[h>>2]|0);c[p>>2]=_k(c[p>>2]|0,10)|0;c[k>>2]=(c[k>>2]|0)+(((c[o>>2]|~c[q>>2])^c[s>>2])+1836072691+(c[t+4>>2]|0));u=_k(c[k>>2]|0,15)|0;c[k>>2]=u+(c[i>>2]|0);c[q>>2]=_k(c[q>>2]|0,10)|0;c[h>>2]=(c[h>>2]|0)+(((c[j>>2]|~c[n>>2])^c[p>>2])+1859775393+(c[t+16>>2]|0));u=_k(c[h>>2]|0,7)|0;c[h>>2]=u+(c[r>>2]|0);c[n>>2]=_k(c[n>>2]|0,10)|0;c[i>>2]=(c[i>>2]|0)+(((c[k>>2]|~c[o>>2])^c[q>>2])+1836072691+(c[t+12>>2]|0));u=_k(c[i>>2]|0,11)|0;c[i>>2]=u+(c[s>>2]|0);c[o>>2]=_k(c[o>>2]|0,10)|0;c[r>>2]=(c[r>>2]|0)+(((c[h>>2]|~c[j>>2])^c[n>>2])+1859775393+(c[t+36>>2]|0));u=_k(c[r>>2]|0,14)|0;c[r>>2]=u+(c[p>>2]|0);c[j>>2]=_k(c[j>>2]|0,10)|0;c[s>>2]=(c[s>>2]|0)+(((c[i>>2]|~c[k>>2])^c[o>>2])+1836072691+(c[t+28>>2]|0));u=_k(c[s>>2]|0,8)|0;c[s>>2]=u+(c[q>>2]|0);c[k>>2]=_k(c[k>>2]|0,10)|0;c[p>>2]=(c[p>>2]|0)+(((c[r>>2]|~c[h>>2])^c[j>>2])+1859775393+(c[t+60>>2]|0));u=_k(c[p>>2]|0,9)|0;c[p>>2]=u+(c[n>>2]|0);c[h>>2]=_k(c[h>>2]|0,10)|0;c[q>>2]=(c[q>>2]|0)+(((c[s>>2]|~c[i>>2])^c[k>>2])+1836072691+(c[t+56>>2]|0));u=_k(c[q>>2]|0,6)|0;c[q>>2]=u+(c[o>>2]|0);c[i>>2]=_k(c[i>>2]|0,10)|0;c[n>>2]=(c[n>>2]|0)+(((c[p>>2]|~c[r>>2])^c[h>>2])+1859775393+(c[t+32>>2]|0));u=_k(c[n>>2]|0,13)|0;c[n>>2]=u+(c[j>>2]|0);c[r>>2]=_k(c[r>>2]|0,10)|0;c[o>>2]=(c[o>>2]|0)+(((c[q>>2]|~c[s>>2])^c[i>>2])+1836072691+(c[t+24>>2]|0));u=_k(c[o>>2]|0,6)|0;c[o>>2]=u+(c[k>>2]|0);c[s>>2]=_k(c[s>>2]|0,10)|0;c[j>>2]=(c[j>>2]|0)+(((c[n>>2]|~c[p>>2])^c[r>>2])+1859775393+(c[t+4>>2]|0));u=_k(c[j>>2]|0,15)|0;c[j>>2]=u+(c[h>>2]|0);c[p>>2]=_k(c[p>>2]|0,10)|0;c[k>>2]=(c[k>>2]|0)+(((c[o>>2]|~c[q>>2])^c[s>>2])+1836072691+(c[t+36>>2]|0));u=_k(c[k>>2]|0,14)|0;c[k>>2]=u+(c[i>>2]|0);c[q>>2]=_k(c[q>>2]|0,10)|0;c[h>>2]=(c[h>>2]|0)+(((c[j>>2]|~c[n>>2])^c[p>>2])+1859775393+(c[t+8>>2]|0));u=_k(c[h>>2]|0,14)|0;c[h>>2]=u+(c[r>>2]|0);c[n>>2]=_k(c[n>>2]|0,10)|0;c[i>>2]=(c[i>>2]|0)+(((c[k>>2]|~c[o>>2])^c[q>>2])+1836072691+(c[t+44>>2]|0));u=_k(c[i>>2]|0,12)|0;c[i>>2]=u+(c[s>>2]|0);c[o>>2]=_k(c[o>>2]|0,10)|0;c[r>>2]=(c[r>>2]|0)+(((c[h>>2]|~c[j>>2])^c[n>>2])+1859775393+(c[t+28>>2]|0));u=_k(c[r>>2]|0,8)|0;c[r>>2]=u+(c[p>>2]|0);c[j>>2]=_k(c[j>>2]|0,10)|0;c[s>>2]=(c[s>>2]|0)+(((c[i>>2]|~c[k>>2])^c[o>>2])+1836072691+(c[t+32>>2]|0));u=_k(c[s>>2]|0,13)|0;c[s>>2]=u+(c[q>>2]|0);c[k>>2]=_k(c[k>>2]|0,10)|0;c[p>>2]=(c[p>>2]|0)+(((c[r>>2]|~c[h>>2])^c[j>>2])+1859775393+(c[t>>2]|0));u=_k(c[p>>2]|0,13)|0;c[p>>2]=u+(c[n>>2]|0);c[h>>2]=_k(c[h>>2]|0,10)|0;c[q>>2]=(c[q>>2]|0)+(((c[s>>2]|~c[i>>2])^c[k>>2])+1836072691+(c[t+48>>2]|0));u=_k(c[q>>2]|0,5)|0;c[q>>2]=u+(c[o>>2]|0);c[i>>2]=_k(c[i>>2]|0,10)|0;c[n>>2]=(c[n>>2]|0)+(((c[p>>2]|~c[r>>2])^c[h>>2])+1859775393+(c[t+24>>2]|0));u=_k(c[n>>2]|0,6)|0;c[n>>2]=u+(c[j>>2]|0);c[r>>2]=_k(c[r>>2]|0,10)|0;c[o>>2]=(c[o>>2]|0)+(((c[q>>2]|~c[s>>2])^c[i>>2])+1836072691+(c[t+8>>2]|0));u=_k(c[o>>2]|0,14)|0;c[o>>2]=u+(c[k>>2]|0);c[s>>2]=_k(c[s>>2]|0,10)|0;c[j>>2]=(c[j>>2]|0)+(((c[n>>2]|~c[p>>2])^c[r>>2])+1859775393+(c[t+52>>2]|0));u=_k(c[j>>2]|0,5)|0;c[j>>2]=u+(c[h>>2]|0);c[p>>2]=_k(c[p>>2]|0,10)|0;c[k>>2]=(c[k>>2]|0)+(((c[o>>2]|~c[q>>2])^c[s>>2])+1836072691+(c[t+40>>2]|0));u=_k(c[k>>2]|0,13)|0;c[k>>2]=u+(c[i>>2]|0);c[q>>2]=_k(c[q>>2]|0,10)|0;c[h>>2]=(c[h>>2]|0)+(((c[j>>2]|~c[n>>2])^c[p>>2])+1859775393+(c[t+44>>2]|0));u=_k(c[h>>2]|0,12)|0;c[h>>2]=u+(c[r>>2]|0);c[n>>2]=_k(c[n>>2]|0,10)|0;c[i>>2]=(c[i>>2]|0)+(((c[k>>2]|~c[o>>2])^c[q>>2])+1836072691+(c[t>>2]|0));u=_k(c[i>>2]|0,13)|0;c[i>>2]=u+(c[s>>2]|0);c[o>>2]=_k(c[o>>2]|0,10)|0;c[r>>2]=(c[r>>2]|0)+(((c[h>>2]|~c[j>>2])^c[n>>2])+1859775393+(c[t+20>>2]|0));u=_k(c[r>>2]|0,7)|0;c[r>>2]=u+(c[p>>2]|0);c[j>>2]=_k(c[j>>2]|0,10)|0;c[s>>2]=(c[s>>2]|0)+(((c[i>>2]|~c[k>>2])^c[o>>2])+1836072691+(c[t+16>>2]|0));u=_k(c[s>>2]|0,7)|0;c[s>>2]=u+(c[q>>2]|0);c[k>>2]=_k(c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q>>2])+2053994217+(c[t+16>>2]|0));u=_k(c[i>>2]|0,8)|0;c[i>>2]=u+(c[s>>2]|0);c[o>>2]=_k(c[o>>2]|0,10)|0;c[r>>2]=(c[r>>2]|0)+((c[h>>2]&c[n>>2]|c[j>>2]&~c[n>>2])+-1894007588+(c[t+40>>2]|0));u=_k(c[r>>2]|0,15)|0;c[r>>2]=u+(c[p>>2]|0);c[j>>2]=_k(c[j>>2]|0,10)|0;c[s>>2]=(c[s>>2]|0)+((c[i>>2]&c[k>>2]|~c[i>>2]&c[o>>2])+2053994217+(c[t+4>>2]|0));u=_k(c[s>>2]|0,11)|0;c[s>>2]=u+(c[q>>2]|0);c[k>>2]=_k(c[k>>2]|0,10)|0;c[p>>2]=(c[p>>2]|0)+((c[r>>2]&c[j>>2]|c[h>>2]&~c[j>>2])+-1894007588+(c[t>>2]|0));u=_k(c[p>>2]|0,14)|0;c[p>>2]=u+(c[n>>2]|0);c[h>>2]=_k(c[h>>2]|0,10)|0;c[q>>2]=(c[q>>2]|0)+((c[s>>2]&c[i>>2]|~c[s>>2]&c[k>>2])+2053994217+(c[t+12>>2]|0));u=_k(c[q>>2]|0,14)|0;c[q>>2]=u+(c[o>>2]|0);c[i>>2]=_k(c[i>>2]|0,10)|0;c[n>>2]=(c[n>>2]|0)+((c[p>>2]&c[h>>2]|c[r>>2]&~c[h>>2])+-1894007588+(c[t+32>>2]|0));u=_k(c[n>>2]|0,15)|0;c[n>>2]=u+(c[j>>2]|0);c[r>>2]=_k(c[r>>2]|0,10)|0;c[o>>2]=(c[o>>2]|0)+((c[q>>2]&c[s>>2]|~c[q>>2]&c[i>>2])+2053994217+(c[t+44>>2]|0));u=_k(c[o>>2]|0,14)|0;c[o>>2]=u+(c[k>>2]|0);c[s>>2]=_k(c[s>>2]|0,10)|0;c[j>>2]=(c[j>>2]|0)+((c[n>>2]&c[r>>2]|c[p>>2]&~c[r>>2])+-1894007588+(c[t+48>>2]|0));u=_k(c[j>>2]|0,9)|0;c[j>>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2]|0)+(c[o>>2]|0);c[(c[g>>2]|0)+160>>2]=c[q>>2];l=d;return 124}function Zk(a){a=a|0;var b=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=b+4|0;f=b;c[e>>2]=a;c[f>>2]=c[e>>2];l=b;return (d[(c[f>>2]|0)+3>>0]|0)<<24|(d[(c[f>>2]|0)+2>>0]|0)<<16|(d[(c[f>>2]|0)+1>>0]|0)<<8|(d[c[f>>2]>>0]|0)|0}function _k(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;l=d;return c[e>>2]<<(c[f>>2]&31)|(c[e>>2]|0)>>>(32-(c[f>>2]|0)&31)|0}function $k(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;Tk(c[d>>2]|0,0);l=b;return}function al(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+8|0;f=d+4|0;g=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=c[f>>2];Xk(c[e>>2]|0,c[f>>2]|0,1)|0;c[c[g>>2]>>2]=c[(c[e>>2]|0)+160>>2];c[(c[g>>2]|0)+4>>2]=c[(c[e>>2]|0)+164>>2];c[(c[g>>2]|0)+8>>2]=c[(c[e>>2]|0)+168>>2];c[(c[g>>2]|0)+12>>2]=c[(c[e>>2]|0)+172>>2];c[(c[g>>2]|0)+16>>2]=c[(c[e>>2]|0)+176>>2];l=d;return}function bl(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+208|0;if((l|0)>=(m|0))$(208);g=f+192|0;h=f+188|0;i=f+184|0;j=f;c[g>>2]=b;c[h>>2]=d;c[i>>2]=e;$k(j);Nr(j,c[h>>2]|0,c[i>>2]|0);Uk(j);i=c[g>>2]|0;g=j;j=i+20|0;do{a[i>>0]=a[g>>0]|0;i=i+1|0;g=g+1|0}while((i|0)<(j|0));l=f;return}function cl(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;i=l;l=l+80|0;if((l|0)>=(m|0))$(80);j=i+64|0;k=i+60|0;n=i+56|0;o=i+52|0;p=i+48|0;q=i+44|0;r=i+40|0;s=i+36|0;t=i+32|0;u=i+28|0;v=i+24|0;w=i+20|0;x=i+16|0;y=i+12|0;z=i+8|0;A=i+4|0;B=i;c[k>>2]=b;c[n>>2]=d;c[o>>2]=e;c[p>>2]=f;c[q>>2]=g;c[r>>2]=h;c[s>>2]=0;c[t>>2]=0;c[u>>2]=(((c[n>>2]|0)+7|0)>>>0)/8|0;if(!(c[u>>2]|0?((c[p>>2]|0)+7|0)>>>0<=(c[u>>2]|0)>>>0:0)){c[j>>2]=66;C=c[j>>2]|0;l=i;return C|0}n=sf(c[u>>2]|0)|0;c[t>>2]=n;if(!n){c[j>>2]=Et()|0;C=c[j>>2]|0;l=i;return C|0}c[w>>2]=0;n=c[w>>2]|0;c[w>>2]=n+1;a[(c[t>>2]|0)+n>>0]=0;n=c[w>>2]|0;c[w>>2]=n+1;a[(c[t>>2]|0)+n>>0]=2;c[v>>2]=(c[u>>2]|0)-3-(c[p>>2]|0);if((c[v>>2]|0)<=0)Se(38982,38988,95,39001);do if(c[q>>2]|0){if((c[r>>2]|0)!=(c[v>>2]|0)){vf(c[t>>2]|0);c[j>>2]=45;C=c[j>>2]|0;l=i;return C|0}c[y>>2]=0;while(1){if((c[y>>2]|0)>>>0>=(c[r>>2]|0)>>>0){D=15;break}if(!(a[(c[q>>2]|0)+(c[y>>2]|0)>>0]|0))break;c[y>>2]=(c[y>>2]|0)+1}if((D|0)==15){_w((c[t>>2]|0)+(c[w>>2]|0)|0,c[q>>2]|0,c[r>>2]|0)|0;c[w>>2]=(c[w>>2]|0)+(c[r>>2]|0);break}vf(c[t>>2]|0);c[j>>2]=45;C=c[j>>2]|0;l=i;return C|0}else{c[x>>2]=hn(c[v>>2]|0,1)|0;while(1){c[A>>2]=0;c[z>>2]=0;while(1){if((c[z>>2]|0)>=(c[v>>2]|0))break;if(!(a[(c[x>>2]|0)+(c[z>>2]|0)>>0]|0))c[A>>2]=(c[A>>2]|0)+1;c[z>>2]=(c[z>>2]|0)+1}if(!(c[A>>2]|0))break;c[A>>2]=(c[A>>2]|0)+(((c[A>>2]|0)/128|0)+3);c[B>>2]=hn(c[A>>2]|0,1)|0;c[z>>2]=0;while(1){if(!((c[z>>2]|0)<(c[v>>2]|0)?(c[A>>2]|0)!=0:0))break;if(!(a[(c[x>>2]|0)+(c[z>>2]|0)>>0]|0)){n=(c[A>>2]|0)+-1|0;c[A>>2]=n;a[(c[x>>2]|0)+(c[z>>2]|0)>>0]=a[(c[B>>2]|0)+n>>0]|0}if(!(a[(c[x>>2]|0)+(c[z>>2]|0)>>0]|0))continue;c[z>>2]=(c[z>>2]|0)+1}vf(c[B>>2]|0)}_w((c[t>>2]|0)+(c[w>>2]|0)|0,c[x>>2]|0,c[v>>2]|0)|0;c[w>>2]=(c[w>>2]|0)+(c[v>>2]|0);vf(c[x>>2]|0)}while(0);x=c[w>>2]|0;c[w>>2]=x+1;a[(c[t>>2]|0)+x>>0]=0;_w((c[t>>2]|0)+(c[w>>2]|0)|0,c[o>>2]|0,c[p>>2]|0)|0;c[w>>2]=(c[w>>2]|0)+(c[p>>2]|0);if((c[w>>2]|0)!=(c[u>>2]|0))Se(39032,38988,153,39001);c[s>>2]=Zo(c[k>>2]|0,5,c[t>>2]|0,c[w>>2]|0,u)|0;if((c[s>>2]|0)==0?Ff(1)|0:0)af(39044,c[c[k>>2]>>2]|0);vf(c[t>>2]|0);c[j>>2]=c[s>>2];C=c[j>>2]|0;l=i;return C|0}function dl(b,e,f,g){b=b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c[c[j>>2]>>2]|0,c[c[k>>2]>>2]|0);c[i>>2]=0;t=c[i>>2]|0;l=h;return t|0}function el(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=fl(c[d>>2]|0)|0;l=b;return a|0}function fl(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;l=b;return c[d>>2]&65535|0}function gl(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;h=l;l=l+160|0;if((l|0)>=(m|0))$(160);i=h+48|0;j=h+44|0;k=h+40|0;n=h+36|0;o=h+32|0;p=h+28|0;q=h+24|0;r=h+52|0;s=h+20|0;t=h+16|0;u=h+12|0;v=h+8|0;w=h+4|0;x=h;c[j>>2]=b;c[k>>2]=d;c[n>>2]=e;c[o>>2]=f;c[p>>2]=g;c[q>>2]=0;c[s>>2]=0;c[t>>2]=(((c[k>>2]|0)+7|0)>>>0)/8|0;c[w>>2]=100;c[x>>2]=oj(c[p>>2]|0)|0;if(pj(c[p>>2]|0,10,r,w)|0){c[i>>2]=69;y=c[i>>2]|0;l=h;return y|0}if((c[o>>2]|0)!=(c[x>>2]|0)){c[i>>2]=70;y=c[i>>2]|0;l=h;return y|0}if(c[x>>2]|0?((c[x>>2]|0)+(c[w>>2]|0)+4|0)>>>0<=(c[t>>2]|0)>>>0:0){x=pf(c[t>>2]|0)|0;c[s>>2]=x;if(!x){c[i>>2]=Et()|0;y=c[i>>2]|0;l=h;return y|0}c[v>>2]=0;x=c[v>>2]|0;c[v>>2]=x+1;a[(c[s>>2]|0)+x>>0]=0;x=c[v>>2]|0;c[v>>2]=x+1;a[(c[s>>2]|0)+x>>0]=1;c[u>>2]=(c[t>>2]|0)-(c[o>>2]|0)-(c[w>>2]|0)-3;if((c[u>>2]|0)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|0;r=n+104|0;s=n+100|0;t=n+96|0;u=n+92|0;v=n+88|0;w=n+84|0;x=n+80|0;y=n+76|0;z=n+72|0;A=n+68|0;B=n+64|0;C=n+60|0;E=n+56|0;F=n+52|0;G=n+48|0;H=n+44|0;I=n+40|0;J=n+36|0;K=n+32|0;L=n+121|0;M=n+8|0;N=n+28|0;O=n+24|0;P=n+20|0;Q=n+120|0;R=n;S=n+16|0;c[o>>2]=b;c[p>>2]=e;c[q>>2]=f;c[r>>2]=g;c[s>>2]=h;c[t>>2]=i;c[u>>2]=j;c[v>>2]=k;c[w>>2]=0;c[y>>2]=0;c[z>>2]=(((c[p>>2]|0)+7|0)>>>0)/8|0;c[B>>2]=0;c[x>>2]=oj(c[q>>2]|0)|0;if(!(c[x>>2]|0))Se(39293,38988,800,39298);c[C>>2]=8+(c[x>>2]|0)+(c[t>>2]|0)+((c[z>>2]|0)-(c[x>>2]|0)-1);c[B>>2]=pf(c[C>>2]|0)|0;a:do if(c[B>>2]|0){c[E>>2]=(c[B>>2]|0)+8;c[F>>2]=(c[E>>2]|0)+(c[x>>2]|0);c[G>>2]=(c[F>>2]|0)+(c[t>>2]|0);if((c[s>>2]|0)!=(c[x>>2]|0)){c[w>>2]=139;break}_w(c[E>>2]|0,c[r>>2]|0,c[x>>2]|0)|0;if((c[z>>2]|0)>>>0<((c[x>>2]|0)+(c[t>>2]|0)+2|0)>>>0){c[w>>2]=66;break}c[y>>2]=pf(c[z>>2]|0)|0;if(!(c[y>>2]|0)){c[w>>2]=Et()|0;break}c[A>>2]=(c[y>>2]|0)+(c[z>>2]|0)+-1+(0-(c[x>>2]|0));do if(c[t>>2]|0){if(!(c[u>>2]|0)){jn(c[F>>2]|0,c[t>>2]|0,1);break}if((c[v>>2]|0)!=(c[t>>2]|0)){c[w>>2]=45;break a}else{_w(c[F>>2]|0,c[u>>2]|0,c[t>>2]|0)|0;break}}while(0);k=c[B>>2]|0;a[k>>0]=0;a[k+1>>0]=0;a[k+2>>0]=0;a[k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>2]>>0]=a[F>>0]|0;c[C>>2]=(c[C>>2]|0)+1;c[E>>2]=(c[E>>2]|0)+-1}if((c[E>>2]|0)>>>0>=8){t=G;r=gx(c[t>>2]|0,c[t+4>>2]|0,16843009,16843009)|0;t=G;c[t>>2]=r;c[t+4>>2]=D;do{c[H>>2]=c[C>>2];t=G;r=c[t+4>>2]|0;v=c[H>>2]|0;c[v>>2]=c[t>>2];c[v+4>>2]=r;c[E>>2]=(c[E>>2]|0)-8;c[C>>2]=(c[C>>2]|0)+8}while((c[E>>2]|0)>>>0>=8)}while(1){if(!(c[E>>2]|0))break;a[c[C>>2]>>0]=a[F>>0]|0;c[C>>2]=(c[C>>2]|0)+1;c[E>>2]=(c[E>>2]|0)+-1}vf(c[s>>2]|0)}if(!(c[w>>2]|0)){N=c[q>>2]|0;l=i;return N|0}c[I>>2]=c[w>>2];c[J>>2]=c[x>>2];a[K>>0]=0;x=L;c[x>>2]=d[K>>0];c[x+4>>2]=0;while(1){if(!(c[I>>2]&7|0?(c[J>>2]|0)!=0:0))break;a[c[I>>2]>>0]=a[K>>0]|0;c[I>>2]=(c[I>>2]|0)+1;c[J>>2]=(c[J>>2]|0)+-1}if((c[J>>2]|0)>>>0>=8){x=L;s=gx(c[x>>2]|0,c[x+4>>2]|0,16843009,16843009)|0;x=L;c[x>>2]=s;c[x+4>>2]=D;do{c[M>>2]=c[I>>2];x=L;s=c[x+4>>2]|0;E=c[M>>2]|0;c[E>>2]=c[x>>2];c[E+4>>2]=s;c[J>>2]=(c[J>>2]|0)-8;c[I>>2]=(c[I>>2]|0)+8}while((c[J>>2]|0)>>>0>=8)}while(1){if(!(c[J>>2]|0))break;a[c[I>>2]>>0]=a[K>>0]|0;c[I>>2]=(c[I>>2]|0)+1;c[J>>2]=(c[J>>2]|0)+-1}vf(c[w>>2]|0);N=c[q>>2]|0;l=i;return N|0}function ol(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q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t=0,u=0,v=0;e=l;l=l+128|0;if((l|0)>=(m|0))$(128);f=e+32|0;g=e+24|0;h=e+16|0;i=e;j=e+116|0;k=e+112|0;n=e+108|0;o=e+104|0;p=e+64|0;q=e+56|0;r=e+48|0;s=e+44|0;t=e+40|0;u=e+36|0;c[j>>2]=a;c[k>>2]=b;c[n>>2]=d;c[q>>2]=0;c[r>>2]=0;c[r+4>>2]=0;c[s>>2]=0;Lj(p,0,ul(c[n>>2]|0)|0);c[o>>2]=Nj(c[k>>2]|0,q,p)|0;do if(!(c[o>>2]|0)){if(Ff(1)|0)af(41643,c[q>>2]|0);if(c[q>>2]|0?c[(c[q>>2]|0)+12>>2]&4|0:0){c[o>>2]=79;break}k=c[n>>2]|0;c[i>>2]=r;c[i+4>>2]=r+4;c[i+8>>2]=0;c[o>>2]=lg(k,0,39361,i)|0;if(!(c[o>>2]|0)){if(Ff(1)|0){af(41660,c[r>>2]|0);af(41677,c[r+4>>2]|0)}c[s>>2]=Rp(0)|0;El(c[s>>2]|0,c[q>>2]|0,r);if(Ff(1)|0)af(41694,c[s>>2]|0);if(!(c[p+12>>2]&4)){k=c[j>>2]|0;c[g>>2]=c[s>>2];c[o>>2]=cg(k,0,41731,g)|0;break}c[u>>2]=(((lo(c[r>>2]|0)|0)+7|0)>>>0)/8|0;c[o>>2]=dp(t,0,c[s>>2]|0,c[u>>2]|0)|0;if(!(c[o>>2]|0)){k=c[j>>2]|0;d=c[t>>2]|0;c[h>>2]=c[u>>2];c[h+4>>2]=d;c[o>>2]=cg(k,0,41711,h)|0;vf(c[t>>2]|0)}}}while(0);Tp(c[s>>2]|0);Tp(c[r>>2]|0);Tp(c[r+4>>2]|0);Tp(c[q>>2]|0);Mj(p);if(!(Ff(1)|0)){v=c[o>>2]|0;l=e;return v|0}c[f>>2]=Bt(c[o>>2]|0)|0;Ye(41751,f);v=c[o>>2]|0;l=e;return v|0}function rl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;e=l;l=l+192|0;if((l|0)>=(m|0))$(192);f=e+64|0;g=e+56|0;h=e+48|0;i=e+40|0;j=e+8|0;k=e;n=e+180|0;o=e+176|0;p=e+172|0;q=e+168|0;r=e+128|0;s=e+124|0;t=e+120|0;u=e+96|0;v=e+88|0;w=e+84|0;x=e+80|0;y=e+76|0;z=e+72|0;A=e+68|0;c[n>>2]=a;c[o>>2]=b;c[p>>2]=d;c[s>>2]=0;c[t>>2]=0;c[u>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;c[u+12>>2]=0;c[u+16>>2]=0;c[u+20>>2]=0;c[v>>2]=0;c[w>>2]=0;c[x>>2]=0;c[y>>2]=0;c[z>>2]=0;c[A>>2]=0;Lj(r,1,ul(c[p>>2]|0)|0);c[q>>2]=Jj(c[o>>2]|0,7768,s,r)|0;a:do if((c[q>>2]|0)==0?(o=c[s>>2]|0,c[k>>2]=t,c[k+4>>2]=0,c[q>>2]=lg(o,0,39371,k)|0,(c[q>>2]|0)==0):0){if(Ff(1)|0)af(41471,c[t>>2]|0);if(c[t>>2]|0?c[(c[t>>2]|0)+12>>2]&4|0:0){c[q>>2]=79;break}o=c[p>>2]|0;c[j>>2]=u;c[j+4>>2]=u+4;c[j+8>>2]=u+8;c[j+12>>2]=u+12;c[j+16>>2]=u+16;c[j+20>>2]=u+20;c[j+24>>2]=0;c[q>>2]=lg(o,0,41288,j)|0;if(!(c[q>>2]|0)){if(Ff(1)|0?(af(41488,c[u>>2]|0),af(41505,c[u+4>>2]|0),(Wg()|0)==0):0){af(41522,c[u+8>>2]|0);af(41539,c[u+12>>2]|0);af(41556,c[u+16>>2]|0);af(41573,c[u+20>>2]|0)}ko(c[t>>2]|0);xo(c[t>>2]|0,c[t>>2]|0,c[u>>2]|0);c[v>>2]=Sp(c[r+4>>2]|0)|0;if(c[r+12>>2]&1|0)Fl(c[v>>2]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2]|0);Tp(c[u+20>>2]|0);Tp(c[t>>2]|0);Tp(c[w>>2]|0);Tp(c[x>>2]|0);Tp(c[y>>2]|0);Rf(c[s>>2]|0);Mj(r);if(!(Ff(1)|0)){B=c[q>>2]|0;l=e;return B|0}c[f>>2]=Bt(c[q>>2]|0)|0;Ye(41621,f);B=c[q>>2]|0;l=e;return B|0}function sl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;e=l;l=l+160|0;if((l|0)>=(m|0))$(160);f=e+48|0;g=e+40|0;h=e+32|0;i=e;j=e+148|0;k=e+144|0;n=e+140|0;o=e+136|0;p=e+96|0;q=e+88|0;r=e+64|0;s=e+60|0;t=e+56|0;u=e+52|0;c[j>>2]=a;c[k>>2]=b;c[n>>2]=d;c[q>>2]=0;c[r>>2]=0;c[r+4>>2]=0;c[r+8>>2]=0;c[r+12>>2]=0;c[r+16>>2]=0;c[r+20>>2]=0;c[s>>2]=0;Lj(p,2,ul(c[n>>2]|0)|0);c[o>>2]=Nj(c[k>>2]|0,q,p)|0;do if(!(c[o>>2]|0)){if(Ff(1)|0)af(41272,c[q>>2]|0);if(c[q>>2]|0?c[(c[q>>2]|0)+12>>2]&4|0:0){c[o>>2]=79;break}k=c[n>>2]|0;c[i>>2]=r;c[i+4>>2]=r+4;c[i+8>>2]=r+8;c[i+12>>2]=r+12;c[i+16>>2]=r+16;c[i+20>>2]=r+20;c[i+24>>2]=0;c[o>>2]=lg(k,0,41288,i)|0;if(!(c[o>>2]|0)){if(Ff(1)|0?(af(41298,c[r>>2]|0),af(41314,c[r+4>>2]|0),(Wg()|0)==0):0){af(41330,c[r+8>>2]|0);af(41346,c[r+12>>2]|0);af(41362,c[r+16>>2]|0);af(41378,c[r+20>>2]|0)}c[s>>2]=Rp(0)|0;Fl(c[s>>2]|0,c[q>>2]|0,r);if(Ff(1)|0)af(41394,c[s>>2]|0);if(!(c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0,39373,h)|0,(c[n>>2]|0)==0):0){if(Ff(1)|0)af(41187,c[q>>2]|0);j=c[k>>2]|0;c[g>>2]=s;c[g+4>>2]=s+4;c[g+8>>2]=0;c[n>>2]=lg(j,0,39361,g)|0;if(!(c[n>>2]|0)){if(Ff(1)|0){af(41203,c[s>>2]|0);af(41219,c[s+4>>2]|0)}c[t>>2]=Rp(0)|0;El(c[t>>2]|0,c[q>>2]|0,s);if(Ff(1)|0)af(41235,c[t>>2]|0);if(c[o+32>>2]|0){c[n>>2]=Db[c[o+32>>2]&7](o,c[t>>2]|0)|0;break}else{j=(wo(c[t>>2]|0,c[r>>2]|0)|0)!=0;c[n>>2]=j?8:0;break}}}}while(0);Tp(c[t>>2]|0);Tp(c[s>>2]|0);Tp(c[s+4>>2]|0);Tp(c[r>>2]|0);Tp(c[q>>2]|0);Rf(c[p>>2]|0);Mj(o);if(!(Ff(1)|0)){u=c[n>>2]|0;l=e;return u|0}if(c[n>>2]|0)v=Bt(c[n>>2]|0)|0;else v=47493;c[f>>2]=v;Ye(41251,f);u=c[n>>2]|0;l=e;return u|0}function ul(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;b=l;l=l+32|0;if((l|0)>=(m|0))$(32);d=b+16|0;e=b+12|0;f=b+8|0;g=b+4|0;h=b;c[e>>2]=a;c[f>>2]=Tf(c[e>>2]|0,39375,1)|0;if(!(c[f>>2]|0)){c[d>>2]=0;i=c[d>>2]|0;l=b;return i|0}c[g>>2]=$f(c[f>>2]|0,1,5)|0;Rf(c[f>>2]|0);if(c[g>>2]|0)j=lo(c[g>>2]|0)|0;else j=0;c[h>>2]=j;Tp(c[g>>2]|0);c[d>>2]=c[h>>2];i=c[d>>2]|0;l=b;return i|0}function vl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+4|0;h=e;c[f>>2]=a;c[e+8>>2]=b;c[g>>2]=d;if((c[f>>2]|0)==1){c[h>>2]=xl(c[g>>2]|0)|0;i=c[h>>2]|0;l=e;return i|0}else{c[h>>2]=4;i=c[h>>2]|0;l=e;return i|0}return 0}function wl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+20|0;f=d+16|0;g=d+12|0;h=d+8|0;i=d+4|0;j=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=Tf(c[g>>2]|0,39375,1)|0;if(!(c[h>>2]|0)){c[e>>2]=68;k=c[e>>2]|0;l=d;return k|0}c[i>>2]=Xf(c[h>>2]|0,1,j)|0;if(c[i>>2]|0){$i(c[f>>2]|0,c[i>>2]|0,c[j>>2]|0);Rf(c[h>>2]|0);c[e>>2]=0;k=c[e>>2]|0;l=d;return k|0}else{Rf(c[h>>2]|0);c[e>>2]=68;k=c[e>>2]|0;l=d;return k|0}return 0}function xl(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;b=l;l=l+32|0;if((l|0)>=(m|0))$(32);d=b+24|0;e=b+20|0;f=b+16|0;g=b+12|0;h=b+8|0;i=b+4|0;j=b;c[e>>2]=a;c[i>>2]=0;c[j>>2]=0;c[f>>2]=39377;c[h>>2]=eg(i,0,39385,hv(39385)|0)|0;if(!(c[h>>2]|0))c[h>>2]=eg(j,0,40415,hv(40415)|0)|0;do if(!(c[h>>2]|0)){c[f>>2]=40732;c[h>>2]=Yj(c[i>>2]|0)|0;if(c[h>>2]|0){c[g>>2]=yl(c[h>>2]|0)|0;break}c[f>>2]=40748;c[g>>2]=zl(c[j>>2]|0,c[i>>2]|0)|0;if((c[g>>2]|0)==0?(c[f>>2]=40753,c[g>>2]=Al(c[j>>2]|0,c[i>>2]|0)|0,(c[g>>2]|0)==0):0){Rf(c[j>>2]|0);Rf(c[i>>2]|0);c[d>>2]=0;k=c[d>>2]|0;l=b;return k|0}}else c[g>>2]=yl(c[h>>2]|0)|0;while(0);Rf(c[j>>2]|0);Rf(c[i>>2]|0);if(c[e>>2]|0)Eb[c[e>>2]&1](47252,1,c[f>>2]|0,c[g>>2]|0);c[d>>2]=50;k=c[d>>2]|0;l=b;return k|0}function yl(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=Bt(c[d>>2]|0)|0;l=b;return a|0}function zl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+24|0;f=d+20|0;g=d+16|0;h=d+12|0;i=d+8|0;j=d+4|0;k=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=0;c[i>>2]=0;c[j>>2]=0;c[k>>2]=0;c[h>>2]=eg(i,0,40963,hv(40963)|0)|0;if(!(c[h>>2]|0))c[h>>2]=eg(j,0,41039,hv(41039)|0)|0;do if(!(c[h>>2]|0)){c[h>>2]=Wj(k,c[i>>2]|0,c[f>>2]|0)|0;if(c[h>>2]|0){c[g>>2]=41115;break}c[h>>2]=Xj(c[k>>2]|0,c[i>>2]|0,c[e>>2]|0)|0;if(c[h>>2]|0){c[g>>2]=41130;break}c[h>>2]=Xj(c[k>>2]|0,c[j>>2]|0,c[e>>2]|0)|0;if((Cl(c[h>>2]|0)|0)!=8)c[g>>2]=41144}else c[g>>2]=40791;while(0);Rf(c[k>>2]|0);Rf(c[j>>2]|0);Rf(c[i>>2]|0);l=d;return c[g>>2]|0}function Al(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0;d=l;l=l+64|0;if((l|0)>=(m|0))$(64);e=d;f=d+48|0;g=d+44|0;h=d+40|0;i=d+36|0;j=d+28|0;k=d+24|0;n=d+20|0;o=d+16|0;p=d+12|0;q=d+8|0;r=d+4|0;c[f>>2]=a;c[g>>2]=b;c[h>>2]=0;c[d+32>>2]=1e3;c[j>>2]=0;c[k>>2]=0;c[n>>2]=0;c[o>>2]=0;c[p>>2]=0;c[q>>2]=0;c[r>>2]=0;c[j>>2]=Rp(1e3)|0;Up(c[j>>2]|0,1e3,0);c[e>>2]=c[j>>2];c[i>>2]=cg(k,0,40761,e)|0;do if(!(c[i>>2]|0)){c[i>>2]=Tj(n,c[k>>2]|0,c[f>>2]|0)|0;if(c[i>>2]|0){c[h>>2]=40814;break}c[o>>2]=Bl(c[n>>2]|0)|0;if(!(c[o>>2]|0)){c[h>>2]=40829;break}if(!(wo(c[j>>2]|0,c[o>>2]|0)|0)){c[h>>2]=40862;break}c[i>>2]=Vj(p,c[n>>2]|0,c[g>>2]|0)|0;if(c[i>>2]|0){c[h>>2]=40891;break}c[r>>2]=Tf(c[p>>2]|0,40906,0)|0;if(c[r>>2]|0)c[q>>2]=$f(c[r>>2]|0,1,5)|0;else c[q>>2]=$f(c[p>>2]|0,0,5)|0;if(!(c[q>>2]|0)){c[h>>2]=40912;break}if(wo(c[j>>2]|0,c[q>>2]|0)|0)c[h>>2]=40942}else c[h>>2]=40791;while(0);Rf(c[r>>2]|0);Tp(c[q>>2]|0);Rf(c[p>>2]|0);Tp(c[o>>2]|0);Rf(c[n>>2]|0);Rf(c[k>>2]|0);Tp(c[j>>2]|0);l=d;return c[h>>2]|0}function Bl(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;b=l;l=l+32|0;if((l|0)>=(m|0))$(32);d=b+20|0;e=b+16|0;f=b+12|0;g=b+8|0;h=b+4|0;i=b;c[e>>2]=a;c[f>>2]=Tf(c[e>>2]|0,40951,0)|0;if(!(c[f>>2]|0)){c[d>>2]=0;j=c[d>>2]|0;l=b;return j|0}c[g>>2]=Tf(c[f>>2]|0,40959,0)|0;Rf(c[f>>2]|0);if(!(c[g>>2]|0)){c[d>>2]=0;j=c[d>>2]|0;l=b;return j|0}c[h>>2]=Tf(c[g>>2]|0,39371,0)|0;Rf(c[g>>2]|0);if(c[h>>2]|0){c[i>>2]=$f(c[h>>2]|0,1,0)|0;Rf(c[h>>2]|0);c[d>>2]=c[i>>2];j=c[d>>2]|0;l=b;return j|0}else{c[d>>2]=0;j=c[d>>2]|0;l=b;return j|0}return 0}function Cl(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=Dl(c[d>>2]|0)|0;l=b;return a|0}function Dl(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;l=b;return c[d>>2]&65535|0}function El(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if((c[f>>2]|0)==(c[g>>2]|0)){c[i>>2]=vp(c[(c[g>>2]|0)+4>>2]<<1)|0;So(c[i>>2]|0,c[g>>2]|0,c[(c[h>>2]|0)+4>>2]|0,c[c[h>>2]>>2]|0);Kp(c[f>>2]|0,c[i>>2]|0)|0;Dp(c[i>>2]|0);l=e;return}else{So(c[f>>2]|0,c[g>>2]|0,c[(c[h>>2]|0)+4>>2]|0,c[c[h>>2]>>2]|0);l=e;return}}function Fl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+20|0;g=e+16|0;h=e+12|0;i=e+8|0;j=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;ko(c[g>>2]|0);if((c[(c[h>>2]|0)+12>>2]|0?c[(c[h>>2]|0)+16>>2]|0:0)?c[(c[h>>2]|0)+20>>2]|0:0){c[i>>2]=xp((c[(c[c[h>>2]>>2]|0)+4>>2]|0)+1|0)|0;c[j>>2]=xp((c[(c[c[h>>2]>>2]|0)+4>>2]|0)+1|0)|0;c[k>>2]=xp((c[(c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,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;g=l;l=l+176|0;if((l|0)>=(m|0))$(176);h=g;i=g+164|0;j=g+160|0;k=g+156|0;n=g+152|0;o=g+148|0;p=g+144|0;q=g+140|0;r=g+136|0;s=g+132|0;t=g+128|0;u=g+124|0;v=g+120|0;w=g+116|0;x=g+112|0;y=g+108|0;z=g+104|0;A=g+100|0;B=g+96|0;C=g+92|0;D=g+88|0;E=g+84|0;F=g+80|0;G=g+76|0;H=g+72|0;I=g+16|0;J=g+8|0;K=g+4|0;c[j>>2]=a;c[k>>2]=b;c[n>>2]=d;c[o>>2]=e;c[p>>2]=f;c[c[p>>2]>>2]=0;if((c[n>>2]|0)==1)c[n>>2]=65537;if((c[k>>2]|0)>>>0>=1024?(((c[k>>2]|0)>>>0)%256|0|0)==0:0){if((c[n>>2]|0)>>>0<3){c[i>>2]=55;L=c[i>>2]|0;l=g;return L|0}if(!(c[n>>2]&1)){c[i>>2]=55;L=c[i>>2]|0;l=g;return L|0}c[B>>2]=0;c[C>>2]=0;c[D>>2]=0;c[E>>2]=0;c[F>>2]=0;c[G>>2]=0;if(c[o>>2]|0){f=I;e=f+56|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(e|0));c[I>>2]=42052;c[I+8>>2]=42056;c[I+16>>2]=42060;c[I+24>>2]=42063;c[I+32>>2]=42067;c[I+40>>2]=42071;c[I+4>>2]=B;c[I+8+4>>2]=C;c[I+16+4>>2]=D;c[I+24+4>>2]=E;c[I+32+4>>2]=F;c[I+40+4>>2]=G;c[J>>2]=0;while(1){if(!(c[I+(c[J>>2]<<3)>>2]|0))break;c[K>>2]=Tf(c[o>>2]|0,c[I+(c[J>>2]<<3)>>2]|0,0)|0;if(c[K>>2]|0){f=$f(c[K>>2]|0,1,5)|0;c[c[I+(c[J>>2]<<3)+4>>2]>>2]=f;Rf(c[K>>2]|0)}c[J>>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j>>2]|0)+12>>2]=0;Tp(c[(c[j>>2]|0)+16>>2]|0);c[(c[j>>2]|0)+16>>2]=0;Tp(c[(c[j>>2]|0)+8>>2]|0);c[(c[j>>2]|0)+8>>2]=0;Tp(c[(c[j>>2]|0)+20>>2]|0);c[(c[j>>2]|0)+20>>2]=0;dh(41941,586,42108,0,42014);c[i>>2]=50;L=c[i>>2]|0;l=g;return L|0}else{c[i>>2]=0;L=c[i>>2]|0;l=g;return L|0}}c[i>>2]=55;L=c[i>>2]|0;l=g;return L|0}function Il(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;f=l;l=l+80|0;if((l|0)>=(m|0))$(80);g=f+64|0;h=f+60|0;i=f+56|0;j=f+52|0;k=f+48|0;n=f+44|0;o=f+40|0;p=f+36|0;q=f+32|0;r=f+28|0;s=f+24|0;t=f+20|0;u=f+16|0;v=f+12|0;w=f+8|0;x=f+4|0;y=f;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;if(Wg()|0){if((c[i>>2]|0)>>>0<1024){c[g>>2]=55;z=c[g>>2]|0;l=f;return z|0}if(c[k>>2]|0){c[g>>2]=55;z=c[g>>2]|0;l=f;return z|0}}c[y>>2]=c[k>>2]|0?1:2;if(c[i>>2]&1|0)c[i>>2]=(c[i>>2]|0)+1;if((c[j>>2]|0)==1)c[j>>2]=65537;c[u>>2]=vp(1)|0;if(c[j>>2]|0){c[j>>2]=c[j>>2]|1;Op(c[u>>2]|0,c[j>>2]|0)|0}else Op(c[u>>2]|0,41)|0;c[t>>2]=Rp(c[i>>2]|0)|0;c[o>>2]=0;c[n>>2]=0;do{if(c[n>>2]|0)Tp(c[n>>2]|0);if(c[o>>2]|0)Tp(c[o>>2]|0);k=((c[i>>2]|0)>>>0)/2|0;e=c[y>>2]|0;if(c[j>>2]|0){c[n>>2]=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c[f>>2]=b;c[g>>2]=-1;c[i>>2]=Rp(c[f>>2]|0)|0;c[j>>2]=Rp(c[f>>2]|0)|0;c[k>>2]=Rp(c[f>>2]|0)|0;c[n>>2]=Rp(c[f>>2]|0)|0;c[h>>2]=c[c[e>>2]>>2];c[h+4>>2]=c[(c[e>>2]|0)+4>>2];Up(c[i>>2]|0,c[f>>2]|0,0);El(c[j>>2]|0,c[i>>2]|0,h);if(((wo(c[j>>2]|0,c[i>>2]|0)|0?(Fl(c[k>>2]|0,c[j>>2]|0,c[e>>2]|0),(wo(c[k>>2]|0,c[i>>2]|0)|0)==0):0)?(Up(c[i>>2]|0,c[f>>2]|0,0),Fl(c[n>>2]|0,c[i>>2]|0,c[e>>2]|0),El(c[k>>2]|0,c[n>>2]|0,h),(wo(c[k>>2]|0,c[i>>2]|0)|0)==0):0)?(eo(c[n>>2]|0,c[n>>2]|0,1),El(c[k>>2]|0,c[n>>2]|0,h),wo(c[k>>2]|0,c[i>>2]|0)|0):0)c[g>>2]=0;Tp(c[n>>2]|0);Tp(c[k>>2]|0);Tp(c[j>>2]|0);Tp(c[i>>2]|0);l=d;return c[g>>2]|0}function Ll(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=Sp(c[d>>2]|0)|0;Up(c[e>>2]|0,c[d>>2]|0,2);oo(c[e>>2]|0,(c[d>>2]|0)-1|0);no(c[e>>2]|0,(c[d>>2]|0)-2|0);a=lo(c[e>>2]|0)|0;if((a|0)==(c[d>>2]|0)){l=b;return c[e>>2]|0}else Se(42214,41941,360,42250);return 0}function Ml(){var a=0,b=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;c[b>>2]=Sp(101)|0;Up(c[b>>2]|0,101,2);oo(c[b>>2]|0,100);if((lo(c[b>>2]|0)|0)==101){l=a;return c[b>>2]|0}else Se(42163,41941,375,42197);return 0}function Nl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+12|0;f=d+4|0;c[e>>2]=a;c[d+8>>2]=b;c[f>>2]=c[e>>2];c[d>>2]=pg()|0;c[(c[f>>2]|0)+160>>2]=1732584193;c[(c[f>>2]|0)+164>>2]=-271733879;c[(c[f>>2]|0)+168>>2]=-1732584194;c[(c[f>>2]|0)+172>>2]=271733878;c[(c[f>>2]|0)+176>>2]=-1009589776;e=(c[f>>2]|0)+128|0;c[e>>2]=0;c[e+4>>2]=0;e=(c[f>>2]|0)+136|0;c[e>>2]=0;c[e+4>>2]=0;c[(c[f>>2]|0)+144>>2]=0;c[(c[f>>2]|0)+148>>2]=64;c[(c[f>>2]|0)+152>>2]=32;l=d;return} -function Ks(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f;h=f+12|0;i=f+8|0;j=f+4|0;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;if(!(c[h>>2]|0))Se(52740,51405,685,52763);if(!(c[j>>2]|0))Se(51625,51405,686,52763);Es(c[j>>2]|0);do if(!(c[(c[j>>2]|0)+4>>2]|0)){if((c[j>>2]|0)==(c[17790]|0)){e=Ls(1)|0;c[(c[j>>2]|0)+4>>2]=e}else{e=Ls(0)|0;c[(c[j>>2]|0)+4>>2]=e}if(c[(c[j>>2]|0)+4>>2]|0){e=_v()|0;c[(c[j>>2]|0)+60>>2]=e;break}else We(51687,g)}while(0);if(!((a[(c[j>>2]|0)+8>>0]<<7&255)<<24>>24>>7<<24>>24))Ms(c[j>>2]|0);e=c[(c[j>>2]|0)+60>>2]|0;if((e|0)==(_v()|0)?(e=c[(c[j>>2]|0)+64>>2]|0,(e|0)==(_v()|0)):0)if(Ns(c[h>>2]|0,c[i>>2]|0,c[j>>2]|0)|0)We(51687,g);else{Es(c[j>>2]|0);l=f;return}dh(51405,714,52763,0,51633);We(51687,g)}function Ls(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;e=l;l=l+64|0;if((l|0)>=(m|0))$(64);f=e+16|0;g=e+8|0;h=e+48|0;i=e+44|0;j=e+40|0;k=e+36|0;n=e+32|0;o=e+28|0;p=e+24|0;q=e+52|0;r=e;s=e+20|0;c[i>>2]=b;if(!(c[17793]|0))Se(51716,51405,596,52094);c[k>>2]=wh(j,7,1,1)|0;if(c[k>>2]|0){c[g>>2]=Ss(c[k>>2]|0)|0;Ve(52112,g);c[h>>2]=0;t=c[h>>2]|0;l=e;return t|0}if(c[i>>2]|0){c[n>>2]=zf(16)|0;Ks(c[n>>2]|0,16,c[17791]|0)}else c[n>>2]=Us(16)|0;c[k>>2]=Jh(c[j>>2]|0,c[n>>2]|0,16)|0;c[o>>2]=c[n>>2];c[p>>2]=16;a[q>>0]=0;i=r;c[i>>2]=d[q>>0];c[i+4>>2]=0;while(1){if(!(c[o>>2]&7|0?(c[p>>2]|0)!=0:0))break;a[c[o>>2]>>0]=a[q>>0]|0;c[o>>2]=(c[o>>2]|0)+1;c[p>>2]=(c[p>>2]|0)+-1}if((c[p>>2]|0)>>>0>=8){i=r;g=gx(c[i>>2]|0,c[i+4>>2]|0,16843009,16843009)|0;i=r;c[i>>2]=g;c[i+4>>2]=D;do{c[s>>2]=c[o>>2];i=r;g=c[i+4>>2]|0;b=c[s>>2]|0;c[b>>2]=c[i>>2];c[b+4>>2]=g;c[p>>2]=(c[p>>2]|0)-8;c[o>>2]=(c[o>>2]|0)+8}while((c[p>>2]|0)>>>0>=8)}while(1){if(!(c[p>>2]|0))break;a[c[o>>2]>>0]=a[q>>0]|0;c[o>>2]=(c[o>>2]|0)+1;c[p>>2]=(c[p>>2]|0)+-1}vf(c[n>>2]|0);if(c[k>>2]|0){c[f>>2]=Ss(c[k>>2]|0)|0;Ve(52155,f);Bh(c[j>>2]|0);c[h>>2]=0;t=c[h>>2]|0;l=e;return t|0}else{c[h>>2]=c[j>>2];t=c[h>>2]|0;l=e;return t|0}return 0}function Ms(b){b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d;c[e>>2]=b;if(!(c[17793]|0))Se(51716,51405,658,51957);b=(c[e>>2]|0)+17|0;if((c[e>>2]|0)==(c[17790]|0)){Ks(b,16,c[17791]|0);f=(c[e>>2]|0)+8|0;a[f>>0]=a[f>>0]&-2|1;f=_v()|0;c[(c[e>>2]|0)+64>>2]=f;l=d;return}else{Ts(b,16);b=(c[e>>2]|0)+8|0;a[b>>0]=a[b>>0]&-2|1;b=_v()|0;c[(c[e>>2]|0)+64>>2]=b;l=d;return}}function Ns(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;g=l;l=l+80|0;if((l|0)>=(m|0))$(80);h=g+48|0;i=g+44|0;j=g+40|0;k=g+36|0;n=g+56|0;o=g+32|0;p=g+28|0;q=g+24|0;r=g+20|0;s=g+16|0;t=g+12|0;u=g+52|0;v=g;w=g+8|0;c[i>>2]=b;c[j>>2]=e;c[k>>2]=f;if(!(c[17793]|0))Se(51716,51405,444,51735);if(!(c[(c[k>>2]|0)+4>>2]|0))Se(51751,51405,445,51735);if(!((a[(c[k>>2]|0)+8>>0]<<7&255)<<24>>24>>7<<24>>24))Se(51770,51405,446,51735);if(!(c[17789]|0))Se(51789,51405,448,51735);c[o>>2]=c[17789];c[p>>2]=(c[17789]|0)+16;c[q>>2]=(c[17789]|0)+32;while(1){if(!(c[j>>2]|0)){x=33;break}if((c[(c[k>>2]|0)+52>>2]|0)==0?(c[(c[k>>2]|0)+12>>2]|0)>>>0>1e3:0){Ms(c[k>>2]|0);c[(c[k>>2]|0)+12>>2]=0}c[r>>2]=(c[j>>2]|0)>>>0<16?c[j>>2]|0:16;Os(n,16,c[k>>2]|0);Ps(c[q>>2]|0,n,(c[k>>2]|0)+17|0,c[(c[k>>2]|0)+4>>2]|0,c[o>>2]|0,c[p>>2]|0);f=(c[k>>2]|0)+12|0;c[f>>2]=(c[f>>2]|0)+1;if(!((((d[(c[k>>2]|0)+51>>0]|0|0?c[(c[k>>2]|0)+52>>2]|0:0)?(c[k>>2]|0)!=(c[17790]|0):0)?(c[k>>2]|0)!=(c[17791]|0):0)?(c[k>>2]|0)!=(c[17792]|0):0)){f=(c[k>>2]|0)+34|0;e=c[q>>2]|0;if(!((a[(c[k>>2]|0)+8>>0]<<6&255)<<24>>24>>7<<24>>24)){y=f;z=e;A=y+16|0;do{a[y>>0]=a[z>>0]|0;y=y+1|0;z=z+1|0}while((y|0)<(A|0));b=(c[k>>2]|0)+8|0;a[b>>0]=a[b>>0]&-3|2;continue}if(!(Jv(f,e,16)|0)){x=22;break}y=(c[k>>2]|0)+34|0;z=c[q>>2]|0;A=y+16|0;do{a[y>>0]=a[z>>0]|0;y=y+1|0;z=z+1|0}while((y|0)<(A|0))}_w(c[i>>2]|0,c[q>>2]|0,c[r>>2]|0)|0;c[s>>2]=c[q>>2];c[t>>2]=16;a[u>>0]=0;e=v;c[e>>2]=d[u>>0];c[e+4>>2]=0;while(1){if(!(c[s>>2]&7|0?(c[t>>2]|0)!=0:0))break;a[c[s>>2]>>0]=a[u>>0]|0;c[s>>2]=(c[s>>2]|0)+1;c[t>>2]=(c[t>>2]|0)+-1}if((c[t>>2]|0)>>>0>=8){e=v;f=gx(c[e>>2]|0,c[e+4>>2]|0,16843009,16843009)|0;e=v;c[e>>2]=f;c[e+4>>2]=D;do{c[w>>2]=c[s>>2];e=v;f=c[e+4>>2]|0;b=c[w>>2]|0;c[b>>2]=c[e>>2];c[b+4>>2]=f;c[t>>2]=(c[t>>2]|0)-8;c[s>>2]=(c[s>>2]|0)+8}while((c[t>>2]|0)>>>0>=8)}while(1){if(!(c[t>>2]|0))break;a[c[s>>2]>>0]=a[u>>0]|0;c[s>>2]=(c[s>>2]|0)+1;c[t>>2]=(c[t>>2]|0)+-1}c[i>>2]=(c[i>>2]|0)+(c[r>>2]|0);c[j>>2]=(c[j>>2]|0)-(c[r>>2]|0)}if((x|0)==22){dh(51405,502,51735,0,51819);c[h>>2]=-1;B=c[h>>2]|0;l=g;return B|0}else if((x|0)==33){c[h>>2]=0;B=c[h>>2]|0;l=g;return B|0}return 0}function Os(d,f,g){d=d|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0;h=l;l=l+32|0;if((l|0)>=(m|0))$(32);i=h;j=h+28|0;k=h+24|0;n=h+20|0;o=h+16|0;p=h+8|0;c[j>>2]=d;c[k>>2]=f;c[n>>2]=g;if((c[k>>2]|0)!=16)Se(51859,51405,273,51918);if(!(c[17793]|0))Se(51716,51405,274,51918);if(((c[(c[n>>2]|0)+52>>2]|0?(c[n>>2]|0)!=(c[17790]|0):0)?(c[n>>2]|0)!=(c[17791]|0):0)?(c[n>>2]|0)!=(c[17792]|0):0){k=c[j>>2]|0;g=c[(c[n>>2]|0)+52>>2]|0;f=k+16|0;do{a[k>>0]=a[g>>0]|0;k=k+1|0;g=g+1|0}while((k|0)<(f|0));a[(c[j>>2]|0)+12>>0]=(c[(c[n>>2]|0)+56>>2]|0)>>>24;a[(c[j>>2]|0)+13>>0]=(c[(c[n>>2]|0)+56>>2]|0)>>>16;a[(c[j>>2]|0)+14>>0]=(c[(c[n>>2]|0)+56>>2]|0)>>>8;a[(c[j>>2]|0)+15>>0]=c[(c[n>>2]|0)+56>>2];g=(c[n>>2]|0)+56|0;c[g>>2]=(c[g>>2]|0)+1;l=h;return}if(!(c[17795]|0)){c[17796]=_v()|0;c[17797]=qw()|0}if(lb(p|0,0)|0){c[i>>2]=Nu(c[(xu()|0)>>2]|0)|0;We(51930,i)}c[o>>2]=c[p+4>>2];c[o>>2]=c[o>>2]<<4;if((c[p>>2]|0)==(c[17795]|0)?(c[o>>2]|0)==(c[17798]|0):0){b[35902]=(b[35902]|0)+1<<16>>16;b[35902]=(e[35902]|0)&4095}else{b[35902]=0;c[17795]=c[p>>2];c[17798]=c[o>>2]}a[c[j>>2]>>0]=c[p>>2]>>24;a[(c[j>>2]|0)+1>>0]=c[p>>2]>>16;a[(c[j>>2]|0)+2>>0]=c[p>>2]>>8;a[(c[j>>2]|0)+3>>0]=c[p>>2];a[(c[j>>2]|0)+4>>0]=(c[o>>2]|0)>>>16;a[(c[j>>2]|0)+5>>0]=(c[o>>2]|0)>>>8;a[(c[j>>2]|0)+6>>0]=c[o>>2]&240|(e[35902]|0)>>8&15;a[(c[j>>2]|0)+7>>0]=e[35902]|0;a[(c[j>>2]|0)+8>>0]=(c[17796]|0)>>>24;a[(c[j>>2]|0)+9>>0]=(c[17796]|0)>>>16;a[(c[j>>2]|0)+10>>0]=(c[17796]|0)>>>8;a[(c[j>>2]|0)+11>>0]=c[17796];a[(c[j>>2]|0)+12>>0]=(c[17797]|0)>>>24;a[(c[j>>2]|0)+13>>0]=(c[17797]|0)>>>16;a[(c[j>>2]|0)+14>>0]=(c[17797]|0)>>>8;a[(c[j>>2]|0)+15>>0]=c[17797];j=(c[17797]|0)+1|0;c[17797]=j;if(j|0){l=h;return}c[17796]=(c[17796]|0)+1;l=h;return}function Ps(b,e,f,g,h,i){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;j=l;l=l+80|0;if((l|0)>=(m|0))$(80);k=j+60|0;n=j+56|0;o=j+52|0;p=j+48|0;q=j+44|0;r=j+40|0;s=j+36|0;t=j+32|0;u=j+65|0;v=j+8|0;w=j+28|0;x=j+24|0;y=j+20|0;z=j+64|0;A=j;B=j+16|0;c[k>>2]=b;c[n>>2]=e;c[o>>2]=f;c[p>>2]=g;c[q>>2]=h;c[r>>2]=i;Qs(c[p>>2]|0,c[q>>2]|0,c[n>>2]|0,16);Rs(c[r>>2]|0,c[q>>2]|0,c[o>>2]|0,16);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>>2]>>0]=a[z>>0]|0;c[x>>2]=(c[x>>2]|0)+1;c[y>>2]=(c[y>>2]|0)+-1}l=j;return}function Qs(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f;h=f+20|0;i=f+16|0;j=f+12|0;k=f+8|0;n=f+4|0;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;if((c[k>>2]|0)!=16)Se(51859,51405,386,51872);c[n>>2]=Ch(c[h>>2]|0,c[i>>2]|0,c[k>>2]|0,c[j>>2]|0,c[k>>2]|0)|0;if(c[n>>2]|0){c[g>>2]=Ss(c[n>>2]|0)|0;We(51884,g)}else{l=f;return}}function Rs(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0;h=l;l=l+16|0;if((l|0)>=(m|0))$(16);i=h+12|0;j=h+8|0;k=h+4|0;n=h;c[i>>2]=b;c[j>>2]=e;c[k>>2]=f;c[n>>2]=g;while(1){if(!(c[n>>2]|0))break;a[c[i>>2]>>0]=(d[c[j>>2]>>0]|0)^(d[c[k>>2]>>0]|0);c[n>>2]=(c[n>>2]|0)+-1;c[j>>2]=(c[j>>2]|0)+1;c[k>>2]=(c[k>>2]|0)+1;c[i>>2]=(c[i>>2]|0)+1}l=h;return}function Ss(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=Bt(c[d>>2]|0)|0;l=b;return a|0}function Ts(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;f=l;l=l+48|0;if((l|0)>=(m|0))$(48);g=f+28|0;h=f+24|0;i=f+20|0;j=f+16|0;k=f+12|0;n=f+32|0;o=f;p=f+8|0;c[g>>2]=b;c[h>>2]=e;if(!(c[17793]|0))Se(51716,51405,642,51969);if((c[h>>2]|0)!=16)Se(51859,51405,643,51969);c[i>>2]=Us(16)|0;h=c[g>>2]|0;g=c[i>>2]|0;e=h+16|0;do{a[h>>0]=a[g>>0]|0;h=h+1|0;g=g+1|0}while((h|0)<(e|0));c[j>>2]=c[i>>2];c[k>>2]=16;a[n>>0]=0;g=o;c[g>>2]=d[n>>0];c[g+4>>2]=0;while(1){if(!(c[j>>2]&7|0?(c[k>>2]|0)!=0:0))break;a[c[j>>2]>>0]=a[n>>0]|0;c[j>>2]=(c[j>>2]|0)+1;c[k>>2]=(c[k>>2]|0)+-1}if((c[k>>2]|0)>>>0>=8){g=o;h=gx(c[g>>2]|0,c[g+4>>2]|0,16843009,16843009)|0;g=o;c[g>>2]=h;c[g+4>>2]=D;do{c[p>>2]=c[j>>2];g=o;h=c[g+4>>2]|0;e=c[p>>2]|0;c[e>>2]=c[g>>2];c[e+4>>2]=h;c[k>>2]=(c[k>>2]|0)-8;c[j>>2]=(c[j>>2]|0)+8}while((c[k>>2]|0)>>>0>=8)}while(1){if(!(c[k>>2]|0))break;a[c[j>>2]>>0]=a[n>>0]|0;c[j>>2]=(c[j>>2]|0)+1;c[k>>2]=(c[k>>2]|0)+-1}vf(c[i>>2]|0);l=f;return}function Us(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;e=b+12|0;f=b+8|0;g=b+4|0;c[e>>2]=a;if(c[17799]|0)Se(51988,51405,552,52012);c[17799]=Bf(c[e>>2]|0)|0;c[17800]=c[e>>2];c[17801]=0;c[g>>2]=nt(4,0,16,2)|0;if((c[g>>2]|0)<0){h=c[17799]|0;vf(h);c[17799]=0;We(52024,d)}if((c[17801]|0)!=(c[17800]|0)){h=c[17799]|0;vf(h);c[17799]=0;We(52024,d)}else{c[f>>2]=c[17799];c[17799]=0;l=b;return c[f>>2]|0}return 0}function Vs(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;g=l;l=l+16|0;if((l|0)>=(m|0))$(16);h=g+12|0;i=g+8|0;j=g;c[h>>2]=b;c[i>>2]=e;c[g+4>>2]=f;c[j>>2]=c[h>>2];if(!(c[17793]|0))Se(51716,51405,531,52052);if(!(c[17799]|0))Se(52071,51405,532,52052);while(1){h=c[i>>2]|0;c[i>>2]=h+-1;if(!h){k=8;break}if((c[17801]|0)>>>0>=(c[17800]|0)>>>0){k=8;break}h=c[j>>2]|0;c[j>>2]=h+1;f=d[h>>0]|0;h=c[17801]|0;c[17801]=h+1;e=(c[17799]|0)+h|0;a[e>>0]=(d[e>>0]|0)^f}if((k|0)==8){l=g;return}}function Ws(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;As(1);Cs();Ks(c[e>>2]|0,c[f>>2]|0,c[17790]|0);Fs();l=d;return}function Xs(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;jn(b+8|0,8,1);c[e>>2]=Ys(c[d>>2]|0)|0;d=Zs(c[e>>2]|0)|0;l=b;return d|0}function Ys(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;e=l;l=l+48|0;if((l|0)>=(m|0))$(48);f=e+20|0;g=e+16|0;h=e+12|0;i=e+8|0;j=e+4|0;k=e;n=e+24|0;c[f>>2]=b;c[k>>2]=0;if(!(c[17789]|0))Se(51789,51405,912,52187);c[i>>2]=Cf(1,68)|0;Ds(c[i>>2]|0);Cs();c[g>>2]=0;a:while(1){if((c[g>>2]|0)>>>0>=3)break;c[j>>2]=wh((c[i>>2]|0)+4|0,7,1,1)|0;if(c[j>>2]|0){o=6;break}c[j>>2]=Jh(c[(c[i>>2]|0)+4>>2]|0,52238+((c[g>>2]|0)*96|0)|0,16)|0;if(c[j>>2]|0){o=8;break}b=_v()|0;c[(c[i>>2]|0)+60>>2]=b;b=(c[i>>2]|0)+17|0;p=52238+((c[g>>2]|0)*96|0)+32|0;q=b+16|0;do{a[b>>0]=a[p>>0]|0;b=b+1|0;p=p+1|0}while((b|0)<(q|0));p=(c[i>>2]|0)+8|0;a[p>>0]=a[p>>0]&-2|1;p=_v()|0;c[(c[i>>2]|0)+64>>2]=p;c[(c[i>>2]|0)+52>>2]=52238+((c[g>>2]|0)*96|0)+16;c[(c[i>>2]|0)+56>>2]=(d[52238+((c[g>>2]|0)*96|0)+16+12>>0]|0)<<24|(d[52238+((c[g>>2]|0)*96|0)+16+13>>0]|0)<<16|(d[52238+((c[g>>2]|0)*96|0)+16+14>>0]|0)<<8|(d[52238+((c[g>>2]|0)*96|0)+16+15>>0]|0);c[h>>2]=0;while(1){if((c[h>>2]|0)>=3)break;if(Ns(n,16,c[i>>2]|0)|0){o=12;break a}if(Jv(n,52238+((c[g>>2]|0)*96|0)+48+(c[h>>2]<<4)|0,16)|0){o=14;break a}c[h>>2]=(c[h>>2]|0)+1}p=c[(c[i>>2]|0)+60>>2]|0;if((p|0)!=(_v()|0)){o=18;break}p=c[(c[i>>2]|0)+64>>2]|0;if((p|0)!=(_v()|0)){o=18;break}Bh(c[(c[i>>2]|0)+4>>2]|0);c[(c[i>>2]|0)+4>>2]=0;p=(c[i>>2]|0)+8|0;a[p>>0]=a[p>>0]&-2;Es(c[i>>2]|0);c[g>>2]=(c[g>>2]|0)+1}if((o|0)==6)c[k>>2]=52200;else if((o|0)==8)c[k>>2]=52526;else if((o|0)==12)c[k>>2]=52552;else if((o|0)==14)c[k>>2]=52583;else if((o|0)==18)c[k>>2]=52621;Fs();Bh(c[(c[i>>2]|0)+4>>2]|0);Es(c[i>>2]|0);vf(c[i>>2]|0);if(!((c[f>>2]|0)!=0&(c[k>>2]|0)!=0)){r=c[k>>2]|0;s=(r|0)!=0;t=s?50:0;l=e;return t|0}Eb[c[f>>2]&1](52643,0,52650,c[k>>2]|0);r=c[k>>2]|0;s=(r|0)!=0;t=s?50:0;l=e;return t|0}function Zs(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=_s(1,c[d>>2]|0)|0;l=b;return a|0}function _s(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){g=0;l=d;return g|0}g=(c[e>>2]&127)<<24|c[f>>2]&65535;l=d;return g|0}function $s(b,e,f,g,h,i,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;n=l;l=l+48|0;if((l|0)>=(m|0))$(48);o=n+40|0;p=n+36|0;q=n+32|0;r=n+28|0;s=n+24|0;t=n+20|0;u=n+16|0;v=n+12|0;w=n+8|0;x=n+4|0;y=n;c[p>>2]=b;c[q>>2]=e;c[r>>2]=f;c[s>>2]=g;c[t>>2]=h;c[u>>2]=i;c[v>>2]=j;c[w>>2]=k;As(1);if((((((c[p>>2]|0)!=0&(c[r>>2]|0)!=0^1|(c[s>>2]|0)!=16)^1)&(c[t>>2]|0)!=0^1|(c[u>>2]|0)!=16)^1)&(c[v>>2]|0)!=0^1|(c[w>>2]|0)!=16){c[o>>2]=45;z=c[o>>2]|0;l=n;return z|0}c[y>>2]=wf(1,68+(c[w>>2]|0)|0)|0;if(!(c[y>>2]|0)){c[o>>2]=Et()|0;z=c[o>>2]|0;l=n;return z|0}Ds(c[y>>2]|0);c[x>>2]=wh((c[y>>2]|0)+4|0,7,1,1)|0;if((c[x>>2]|0)==0?(c[x>>2]=Jh(c[(c[y>>2]|0)+4>>2]|0,c[r>>2]|0,c[s>>2]|0)|0,(c[x>>2]|0)==0):0){s=_v()|0;c[(c[y>>2]|0)+60>>2]=s;_w((c[y>>2]|0)+17|0,c[t>>2]|0,c[u>>2]|0)|0;u=(c[y>>2]|0)+8|0;a[u>>0]=a[u>>0]&-2|1;u=_v()|0;c[(c[y>>2]|0)+64>>2]=u;_w((c[y>>2]|0)+68|0,c[v>>2]|0,c[w>>2]|0)|0;c[(c[y>>2]|0)+52>>2]=(c[y>>2]|0)+68;c[(c[y>>2]|0)+56>>2]=(d[(c[(c[y>>2]|0)+52>>2]|0)+12>>0]|0)<<24|(d[(c[(c[y>>2]|0)+52>>2]|0)+13>>0]|0)<<16|(d[(c[(c[y>>2]|0)+52>>2]|0)+14>>0]|0)<<8|(d[(c[(c[y>>2]|0)+52>>2]|0)+15>>0]|0);if(c[q>>2]&1|0)a[(c[y>>2]|0)+51>>0]=1;Es(c[y>>2]|0);c[x>>2]=0}q=c[y>>2]|0;if(c[x>>2]|0){Bh(c[q+4>>2]|0);vf(c[y>>2]|0);c[c[p>>2]>>2]=0}else c[c[p>>2]>>2]=q;c[o>>2]=c[x>>2];z=c[o>>2]|0;l=n;return z|0}function at(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+16|0;g=e+12|0;h=e+8|0;i=e+4|0;j=e;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=c[g>>2];if((c[j>>2]|0)!=0&(c[h>>2]|0)!=0^1|(c[i>>2]|0)!=16){c[f>>2]=45;k=c[f>>2]|0;l=e;return k|0}else{Cs();Ks(c[h>>2]|0,c[i>>2]|0,c[j>>2]|0);Fs();c[f>>2]=0;k=c[f>>2]|0;l=e;return k|0}return 0}function bt(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=c[d>>2];if(!(c[e>>2]|0)){l=b;return}Bh(c[(c[e>>2]|0)+4>>2]|0);vf(c[e>>2]|0);l=b;return}function ct(a){a=a|0;var b=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);c[b>>2]=a;dt();l=b;return}function dt(){if(c[17802]|0)return;c[17802]=1;c[17803]=0;return}function et(){ft();nt(0,0,0,0)|0;gt();return}function ft(){var a=0,b=0,d=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;d=a+4|0;c[d>>2]=Ht(13108)|0;if(c[d>>2]|0){c[b>>2]=Bt(c[d>>2]|0)|0;We(52697,b)}else{c[17803]=1;l=a;return}}function gt(){var a=0,b=0,d=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;d=a+4|0;c[17803]=0;c[d>>2]=It(13108)|0;if(c[d>>2]|0){c[b>>2]=Bt(c[d>>2]|0)|0;We(52654,b)}else{l=a;return}}function ht(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;ct(1);if((c[h>>2]|0)!=2)c[h>>2]=1;ft();it(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);gt();l=e;return}function it(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e;g=e+16|0;h=e+12|0;i=e+8|0;j=e+4|0;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;if(!(c[g>>2]|0))Se(52740,52747,144,52763);c[17804]=c[g>>2];c[17805]=c[h>>2];c[17806]=0;c[j>>2]=nt(5,0,c[h>>2]|0,c[i>>2]|0)|0;if((c[j>>2]|0)<0){k=c[j>>2]|0;c[f>>2]=k;We(52774,f)}if((c[17806]|0)!=(c[17805]|0)){k=c[j>>2]|0;c[f>>2]=k;We(52774,f)}else{l=e;return}}function jt(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+12|0;h=f+8|0;i=f;c[g>>2]=b;c[h>>2]=d;c[f+4>>2]=e;c[i>>2]=c[g>>2];if(!(c[17803]|0))Se(52820,52747,124,52841);if(!(c[17804]|0))Se(52849,52747,125,52841);while(1){g=c[h>>2]|0;c[h>>2]=g+-1;if(!g){j=8;break}if((c[17806]|0)>>>0>=(c[17805]|0)>>>0){j=8;break}g=c[i>>2]|0;c[i>>2]=g+1;e=a[g>>0]|0;g=c[17806]|0;c[17806]=g+1;a[(c[17804]|0)+g>>0]=e}if((j|0)==8){l=f;return}}function kt(){return c[17807]|0}function lt(a,b){a=a|0;b=b|0;var d=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);c[d+4>>2]=a;c[d>>2]=b;l=d;return}function mt(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d;c[d+8>>2]=a;c[d+4>>2]=b;c[e>>2]=0;l=d;return c[e>>2]|0}function nt(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0;h=l;l=l+1024|0;if((l|0)>=(m|0))$(1024);i=h+24|0;j=h+16|0;k=h+8|0;n=h+236|0;o=h+232|0;p=h+228|0;q=h+224|0;r=h+220|0;s=h+216|0;t=h+212|0;u=h+248|0;v=h+208|0;w=h+204|0;x=h+200|0;y=h+196|0;z=h+192|0;A=h+64|0;B=h+56|0;C=h+52|0;E=h+48|0;F=h+44|0;G=h+40|0;H=h+36|0;I=h+32|0;J=h+240|0;K=h;L=h+28|0;c[o>>2]=b;c[p>>2]=e;c[q>>2]=f;c[r>>2]=g;c[w>>2]=c[q>>2];c[x>>2]=0;c[y>>2]=0;if(!(c[o>>2]|0)){if((c[3288]|0)!=-1){Kv(c[3288]|0)|0;c[3288]=-1}if((c[3289]|0)!=-1){Kv(c[3289]|0)|0;c[3289]=-1}c[n>>2]=0;M=c[n>>2]|0;l=h;return M|0}c[v>>2]=mt(c[o>>2]|0,c[p>>2]|0)|0;if((c[v>>2]|0)>>>0>(((c[q>>2]|0)>>>0)/2|0)>>>0)c[v>>2]=((c[q>>2]|0)>>>0)/2|0;if((c[q>>2]|0)>>>0>1)c[q>>2]=(c[q>>2]|0)-(c[v>>2]|0);if((c[r>>2]|0)>=2){if((c[3288]|0)==-1){c[3288]=ot(52864,(d[72318]|0)&1)|0;a[72318]=d[72318]|0|1}c[s>>2]=c[3288]}else{if((c[3289]|0)==-1){c[3289]=ot(52876,(d[72318]|0)&2)|0;a[72318]=d[72318]|0|2}c[s>>2]=c[3289]}c[z>>2]=0;while(1){if(!(c[q>>2]|0))break;if(!(!(c[y>>2]|0)?(c[x>>2]|0)==((c[w>>2]|0)-(c[q>>2]|0)|0):0)){c[x>>2]=(c[w>>2]|0)-(c[q>>2]|0);Wm(52889,88,c[x>>2]|0,c[w>>2]|0);c[y>>2]=1}if((c[s>>2]|0)<1024){c[F>>2]=A;c[E>>2]=32;while(1){if(!(c[E>>2]|0))break;r=c[F>>2]|0;c[F>>2]=r+4;c[r>>2]=0;c[E>>2]=(c[E>>2]|0)+-1}r=A+((((c[s>>2]|0)>>>0)/32|0)<<2)|0;c[r>>2]=c[r>>2]|1<<(((c[s>>2]|0)>>>0)%32|0);c[B>>2]=c[z>>2];c[B+4>>2]=c[z>>2]|0?0:1e5;r=dw((c[s>>2]|0)+1|0,A,0,0,B)|0;c[C>>2]=r;if(!r){c[y>>2]=1;c[z>>2]=3;continue}if((c[C>>2]|0)==-1){c[k>>2]=Nu(c[(xu()|0)>>2]|0)|0;Ve(52902,k);if(c[z>>2]|0)continue;c[z>>2]=1;continue}}do{c[G>>2]=(c[q>>2]|0)>>>0<768?c[q>>2]|0:768;c[t>>2]=fw(c[s>>2]|0,u,c[G>>2]|0)|0;if((c[t>>2]|0)>=0?(c[t>>2]|0)>>>0>(c[G>>2]|0)>>>0:0){c[j>>2]=c[t>>2];Ve(52922,j);c[t>>2]=c[G>>2]}if((c[t>>2]|0)!=-1)break}while((c[(xu()|0)>>2]|0)==4);if((c[t>>2]|0)==-1){N=38;break}zb[c[o>>2]&7](u,c[t>>2]|0,c[p>>2]|0);c[q>>2]=(c[q>>2]|0)-(c[t>>2]|0)}if((N|0)==38){c[i>>2]=Nu(c[(xu()|0)>>2]|0)|0;We(52960,i)}c[H>>2]=u;c[I>>2]=768;a[J>>0]=0;u=K;c[u>>2]=d[J>>0];c[u+4>>2]=0;while(1){if(!(c[H>>2]&7|0?(c[I>>2]|0)!=0:0))break;a[c[H>>2]>>0]=a[J>>0]|0;c[H>>2]=(c[H>>2]|0)+1;c[I>>2]=(c[I>>2]|0)+-1}if((c[I>>2]|0)>>>0>=8){u=K;i=gx(c[u>>2]|0,c[u+4>>2]|0,16843009,16843009)|0;u=K;c[u>>2]=i;c[u+4>>2]=D;do{c[L>>2]=c[H>>2];u=K;i=c[u+4>>2]|0;N=c[L>>2]|0;c[N>>2]=c[u>>2];c[N+4>>2]=i;c[I>>2]=(c[I>>2]|0)-8;c[H>>2]=(c[H>>2]|0)+8}while((c[I>>2]|0)>>>0>=8)}while(1){if(!(c[I>>2]|0))break;a[c[H>>2]>>0]=a[J>>0]|0;c[H>>2]=(c[H>>2]|0)+1;c[I>>2]=(c[I>>2]|0)+-1}if(c[y>>2]|0)Wm(52889,88,c[w>>2]|0,c[w>>2]|0);c[n>>2]=0;M=c[n>>2]|0;l=h;return M|0}function ot(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0;d=l;l=l+48|0;if((l|0)>=(m|0))$(48);e=d+16|0;f=d+8|0;g=d;h=d+40|0;i=d+36|0;j=d+32|0;k=d+24|0;c[h>>2]=a;c[i>>2]=b;if(c[i>>2]|0)Wm(52993,88,1,0);while(1){c[j>>2]=gw(c[h>>2]|0,0,g)|0;if(!((c[j>>2]|0)==-1&(c[i>>2]|0)!=0))break;c[k>>2]=5;c[k+4>>2]=0;Wm(53009,88,0,c[k>>2]|0);dw(0,0,0,0,k)|0}if((c[j>>2]|0)==-1){k=c[h>>2]|0;h=Nu(c[(xu()|0)>>2]|0)|0;c[f>>2]=k;c[f+4>>2]=h;We(53025,f)}if(!(pt(c[j>>2]|0)|0)){n=c[j>>2]|0;l=d;return n|0}f=c[j>>2]|0;h=Nu(c[(xu()|0)>>2]|0)|0;c[e>>2]=f;c[e+4>>2]=h;Ve(53044,e);n=c[j>>2]|0;l=d;return n|0}function pt(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;b=l;l=l+32|0;if((l|0)>=(m|0))$(32);d=b+8|0;e=b;f=b+20|0;g=b+16|0;h=b+12|0;c[g>>2]=a;a=c[g>>2]|0;c[e>>2]=0;c[h>>2]=Lv(a,1,e)|0;e=c[h>>2]|0;if((c[h>>2]|0)<0){c[f>>2]=e;i=c[f>>2]|0;l=b;return i|0}else{c[h>>2]=e|1;e=c[g>>2]|0;c[d>>2]=c[h>>2];c[f>>2]=Lv(e,2,d)|0;i=c[f>>2]|0;l=b;return i|0}return 0}function qt(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;f=l;l=l+80|0;if((l|0)>=(m|0))$(80);g=f+72|0;h=f+68|0;i=f+64|0;j=f+60|0;k=f+56|0;n=f+52|0;o=f+48|0;p=f+44|0;q=f+40|0;r=f+36|0;s=f+32|0;t=f+28|0;u=f+24|0;v=f+20|0;w=f+16|0;x=f+12|0;y=f+8|0;z=f+4|0;A=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;c[n>>2]=0-(c[i>>2]|0);c[g>>2]=(c[g>>2]|0)+(0-(c[n>>2]|0)<<2);c[h>>2]=(c[h>>2]|0)+(0-(c[n>>2]|0)<<2);c[k>>2]=0;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p>>2];r=c[h>>2]|0;l=g;return r|0}if((c[k>>2]|0)>>>0>(c[o>>2]|0)>>>0)so(c[q>>2]|0,c[q>>2]|0,(c[k>>2]|0)-(c[o>>2]|0)|0);if((wo(c[q>>2]|0,c[n>>2]|0)|0)>=0)ho(c[q>>2]|0,c[q>>2]|0,c[n>>2]|0);c[p>>2]=tt(c[i>>2]|0,c[q>>2]|0,(((c[o>>2]|0)+7|0)>>>0)/8|0)|0;Dp(c[q>>2]|0);c[h>>2]=c[p>>2];r=c[h>>2]|0;l=g;return r|0}function vt(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+28|0;g=e+24|0;h=e+20|0;i=e+16|0;j=e+12|0;k=e+8|0;n=e+4|0;o=e;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=0;do if(c[g>>2]|0?c[(c[g>>2]|0)+12>>2]&4|0:0){c[k>>2]=Gp(c[g>>2]|0,n)|0;c[j>>2]=Zo(o,5,c[k>>2]|0,(((c[n>>2]|0)+7|0)>>>0)/8|0,0)|0;if(c[j>>2]|0){c[f>>2]=c[j>>2];p=c[f>>2]|0;l=e;return p|0}else{if((c[n>>2]|0)>>>0<=(c[i>>2]|0)>>>0)break;so(c[o>>2]|0,c[o>>2]|0,(c[n>>2]|0)-(c[i>>2]|0)|0);break}}else q=7;while(0);if((q|0)==7)c[o>>2]=c[g>>2];c[c[h>>2]>>2]=c[o>>2];c[f>>2]=c[j>>2];p=c[f>>2]|0;l=e;return p|0}function wt(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;h=l;l=l+96|0;if((l|0)>=(m|0))$(96);i=h;j=h+88|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(c[n>>2]|0)+32>>2]|0)}while((vo(c[o>>2]|0,0)|0)!=0^1);Ro(c[v>>2]|0,c[(c[n>>2]|0)+56>>2]|0,c[o>>2]|0,c[(c[n>>2]|0)+32>>2]|0);io(c[w>>2]|0,c[A>>2]|0,c[v>>2]|0,c[(c[n>>2]|0)+32>>2]|0);Lo(c[x>>2]|0,c[u>>2]|0,c[(c[n>>2]|0)+32>>2]|0)|0;Ro(c[p>>2]|0,c[x>>2]|0,c[w>>2]|0,c[(c[n>>2]|0)+32>>2]|0);if(!((vo(c[p>>2]|0,0)|0)!=0^1)){G=20;break}}if((G|0)==10)c[s>>2]=70;else if((G|0)==15){if(Ff(1)|0)Ye(53251,i);c[s>>2]=8}else if((G|0)==20?Ff(1)|0:0){af(53192,c[o>>2]|0);af(53213,c[p>>2]|0)}In(c[E>>2]|0);An(z);Dp(c[y>>2]|0);Dp(c[x>>2]|0);Dp(c[w>>2]|0);Dp(c[v>>2]|0);Dp(c[u>>2]|0);if((c[A>>2]|0)!=(c[k>>2]|0))Dp(c[A>>2]|0);c[j>>2]=c[s>>2];F=c[j>>2]|0;l=h;return F|0}function xt(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;f=l;l=l+112|0;if((l|0)>=(m|0))$(112);g=f+8|0;h=f;i=f+96|0;j=f+92|0;k=f+88|0;n=f+84|0;o=f+80|0;p=f+76|0;q=f+72|0;r=f+68|0;s=f+64|0;t=f+60|0;u=f+56|0;v=f+44|0;w=f+32|0;x=f+20|0;y=f+16|0;z=f+12|0;c[j>>2]=a;c[k>>2]=b;c[n>>2]=d;c[o>>2]=e;c[p>>2]=0;if((vo(c[n>>2]|0,0)|0)>0?(wo(c[n>>2]|0,c[(c[k>>2]|0)+32>>2]|0)|0)<0:0){if((vo(c[o>>2]|0,0)|0)>0?(wo(c[o>>2]|0,c[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0)+32>>2]|0);if(!(vo(c[u>>2]|0,0)|0))Op(c[u>>2]|0,1)|0;a:while(1){do{Dp(c[p>>2]|0);c[p>>2]=rt(c[(c[j>>2]|0)+32>>2]|0,1)|0;$n(v,c[p>>2]|0,(c[j>>2]|0)+20|0,c[A>>2]|0);if(tn(c[t>>2]|0,0,v,c[A>>2]|0)|0){C=14;break a}Mo(c[k>>2]|0,c[t>>2]|0,c[(c[j>>2]|0)+32>>2]|0)}while((vo(c[k>>2]|0,0)|0)!=0^1);Ro(c[q>>2]|0,c[(c[j>>2]|0)+56>>2]|0,c[k>>2]|0,c[(c[j>>2]|0)+32>>2]|0);Ro(c[s>>2]|0,c[p>>2]|0,c[u>>2]|0,c[(c[j>>2]|0)+32>>2]|0);io(c[n>>2]|0,c[s>>2]|0,c[q>>2]|0,c[(c[j>>2]|0)+32>>2]|0);if(!((vo(c[n>>2]|0,0)|0)!=0^1)){C=19;break}}if((C|0)==14){if(Ff(1)|0)Ye(53251,g);c[o>>2]=8}else if((C|0)==19?Ff(1)|0:0){af(53295,c[k>>2]|0);af(53315,c[n>>2]|0)}In(c[A>>2]|0);An(v);Dp(c[t>>2]|0);Dp(c[u>>2]|0);Dp(c[s>>2]|0);Dp(c[r>>2]|0);Dp(c[q>>2]|0);Dp(c[p>>2]|0);if((c[w>>2]|0)!=(c[i>>2]|0))Dp(c[w>>2]|0);c[h>>2]=c[o>>2];B=c[h>>2]|0;l=f;return B|0}function zt(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;f=l;l=l+128|0;if((l|0)>=(m|0))$(128);g=f+24|0;h=f+16|0;i=f+8|0;j=f;k=f+116|0;n=f+112|0;o=f+108|0;p=f+104|0;q=f+100|0;r=f+96|0;s=f+92|0;t=f+88|0;u=f+84|0;v=f+80|0;w=f+76|0;x=f+72|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,c[p>>2]|0)|0)!=0;e=(Ff(1)|0)!=0;if(!n){if(!e)break;Ye(53450,g);break}if(e){af(53403,c[t>>2]|0);af(53410,c[p>>2]|0);af(53417,c[q>>2]|0);Ye(53424,h)}c[r>>2]=8}else{if(Ff(1)|0)Ye(53335,j);c[r>>2]=8}while(0);In(c[C>>2]|0);An(B);An(A);An(z);Dp(c[y>>2]|0);Dp(c[x>>2]|0);Dp(c[w>>2]|0);Dp(c[v>>2]|0);Dp(c[u>>2]|0);Dp(c[t>>2]|0);Dp(c[s>>2]|0);c[k>>2]=c[r>>2];D=c[k>>2]|0;l=f;return D|0}c[k>>2]=8;D=c[k>>2]|0;l=f;return D|0}c[k>>2]=8;D=c[k>>2]|0;l=f;return D|0}function At(){return Pt()|0}function Bt(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=au(c[d>>2]|0)|0;l=b;return a|0}function Ct(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=eu(c[d>>2]|0)|0;l=b;return a|0}function Dt(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=du(c[d>>2]|0)|0;l=b;return a|0}function Et(){return fu()|0}function Ft(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;Rt(c[d>>2]|0);l=b;return}function Gt(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=Kt(c[d>>2]|0)|0;l=b;return a|0}function Ht(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=Mt(c[d>>2]|0)|0;l=b;return a|0}function It(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=Nt(c[d>>2]|0)|0;l=b;return a|0}function Jt(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=Ot(c[d>>2]|0)|0;l=b;return a|0}function Kt(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;c[e>>2]=c[d>>2];if(c[c[e>>2]>>2]|0)c[e>>2]=Lt(c[d>>2]|0)|0;else c[c[e>>2]>>2]=1;c[f>>2]=ya((c[e>>2]|0)+4|0,0)|0;if(!(c[f>>2]|0)){g=c[f>>2]|0;l=b;return g|0}c[f>>2]=Ct(c[f>>2]|0)|0;g=c[f>>2]|0;l=b;return g|0}function Lt(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=c[d>>2];if((c[c[e>>2]>>2]|0)!=1)Fa(53472,53492,114,53505);else{l=b;return c[e>>2]|0}return 0}function Mt(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;c[e>>2]=Lt(c[d>>2]|0)|0;c[f>>2]=Vw((c[e>>2]|0)+4|0)|0;if(!(c[f>>2]|0)){g=c[f>>2]|0;l=b;return g|0}c[f>>2]=Ct(c[f>>2]|0)|0;g=c[f>>2]|0;l=b;return g|0}function Nt(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;c[e>>2]=Lt(c[d>>2]|0)|0;c[f>>2]=dx((c[e>>2]|0)+4|0)|0;if(!(c[f>>2]|0)){g=c[f>>2]|0;l=b;return g|0}c[f>>2]=Ct(c[f>>2]|0)|0;g=c[f>>2]|0;l=b;return g|0}function Ot(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=l;l=l+64|0;if((l|0)>=(m|0))$(64);d=b+52|0;e=b+48|0;f=b+44|0;g=b;c[d>>2]=a;c[e>>2]=Lt(c[d>>2]|0)|0;c[f>>2]=Ya((c[e>>2]|0)+4|0)|0;if(c[f>>2]|0){c[f>>2]=Ct(c[f>>2]|0)|0;h=c[f>>2]|0;l=b;return h|0}else{e=g;a=e+44|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(a|0));c[g>>2]=1;e=c[d>>2]|0;d=g;a=e+44|0;do{c[e>>2]=c[d>>2];e=e+4|0;d=d+4|0}while((e|0)<(a|0));h=c[f>>2]|0;l=b;return h|0}return 0}function Pt(){Qt();return 0}function Qt(){St()|0;return}function Rt(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=c[d>>2]|0;c[(xu()|0)>>2]=a;l=b;return}function St(){if(c[17808]|0)return 0;c[17808]=1;nb(3)|0;return 0}function Tt(){Ut(0)|0;c[17809]=0;c[17810]=0;return}function Ut(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;if(c[d>>2]|0){Vt(c[d>>2]|0);c[e>>2]=Wt(c[d>>2]|0)|0;Xt(c[d>>2]|0);g=c[e>>2]|0;h=(g|0)!=0;i=h?-1:0;l=b;return i|0}c[e>>2]=0;Yt();c[f>>2]=c[17811];while(1){if(!(c[f>>2]|0))break;if(c[(c[f>>2]|0)+4>>2]|0){Vt(c[(c[f>>2]|0)+4>>2]|0);d=Wt(c[(c[f>>2]|0)+4>>2]|0)|0;c[e>>2]=c[e>>2]|d;Xt(c[(c[f>>2]|0)+4>>2]|0)}c[f>>2]=c[c[f>>2]>>2]}Zt();g=c[e>>2]|0;h=(g|0)!=0;i=h?-1:0;l=b;return i|0}function Vt(a){a=a|0;var b=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=b;c[e>>2]=a;if((d[(c[(c[e>>2]|0)+36>>2]|0)+1140>>0]|0)>>>5&1|0){l=b;return}Mt((c[(c[e>>2]|0)+36>>2]|0)+1040|0)|0;l=b;return}function Wt(a){a=a|0;var b=0,d=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;a=c[d>>2]|0;if((c[c[d>>2]>>2]|0)>>>16&1|0){c[e>>2]=_t(a)|0;f=c[e>>2]|0;l=b;return f|0}else{$t(a);c[e>>2]=0;f=c[e>>2]|0;l=b;return f|0}return 0}function Xt(a){a=a|0;var b=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=b;c[e>>2]=a;if((d[(c[(c[e>>2]|0)+36>>2]|0)+1140>>0]|0)>>>5&1|0){l=b;return}Nt((c[(c[e>>2]|0)+36>>2]|0)+1040|0)|0;l=b;return}function Yt(){Mt(13160)|0;return}function Zt(){Nt(13160)|0;return}function _t(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+20|0;f=d+16|0;g=d+12|0;h=d+8|0;i=d+4|0;j=d;c[e>>2]=b;c[f>>2]=c[(c[(c[e>>2]|0)+36>>2]|0)+1108>>2];if(!((c[c[e>>2]>>2]|0)>>>16&1))Fa(53563,53544,1654,53585);do if(c[(c[e>>2]|0)+16>>2]|0){if(!(c[f>>2]|0)){c[g>>2]=95;break}c[i>>2]=0;c[g>>2]=0;do{if(((c[(c[e>>2]|0)+16>>2]|0)-(c[i>>2]|0)|0)<=0)break;if(!((c[g>>2]|0)!=0^1))break;c[j>>2]=ub[c[f>>2]&63](c[(c[(c[e>>2]|0)+36>>2]|0)+1084>>2]|0,(c[(c[e>>2]|0)+4>>2]|0)+(c[i>>2]|0)|0,(c[(c[e>>2]|0)+16>>2]|0)-(c[i>>2]|0)|0)|0;if((c[j>>2]|0)==-1){c[h>>2]=0;c[g>>2]=-1}else c[h>>2]=c[j>>2];c[i>>2]=(c[i>>2]|0)+(c[h>>2]|0)}while(!(c[g>>2]|0));b=(c[e>>2]|0)+20|0;c[b>>2]=(c[b>>2]|0)+(c[i>>2]|0);if((c[(c[e>>2]|0)+16>>2]|0)==(c[i>>2]|0)){b=(c[(c[e>>2]|0)+36>>2]|0)+1100|0;c[b>>2]=(c[b>>2]|0)+(c[(c[e>>2]|0)+16>>2]|0);c[(c[e>>2]|0)+16>>2]=0;c[(c[e>>2]|0)+20>>2]=0;ub[c[f>>2]&63](c[(c[(c[e>>2]|0)+36>>2]|0)+1084>>2]|0,0,0)|0}}else c[g>>2]=0;while(0);if(!(c[g>>2]|0)){k=c[g>>2]|0;l=d;return k|0}f=(c[(c[e>>2]|0)+36>>2]|0)+1136|0;a[f>>0]=a[f>>0]&-2|1;k=c[g>>2]|0;l=d;return k|0}function $t(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;if((c[c[d>>2]>>2]|0)>>>16&1|0)Fa(53521,53544,1722,53554);else{c[(c[d>>2]|0)+12>>2]=0;c[(c[d>>2]|0)+16>>2]=0;c[(c[d>>2]|0)+32>>2]=0;l=b;return}}function au(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[e>>2]=a;c[f>>2]=bu(c[e>>2]|0)|0;do if(c[f>>2]&32768|0){c[g>>2]=Dt(c[f>>2]|0)|0;if(!(c[g>>2]|0)){c[f>>2]=16382;break}c[d>>2]=Nu(c[g>>2]|0)|0;h=c[d>>2]|0;l=b;return h|0}while(0);c[d>>2]=53594+(c[13204+((cu(c[f>>2]|0)|0)<<2)>>2]|0);h=c[d>>2]|0;l=b;return h|0}function bu(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;l=b;return c[d>>2]&65535|0}function cu(a){a=a|0;var b=0,d=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=c[d>>2]|0;if((c[d>>2]|0)>=0&(c[d>>2]|0)<=213){e=a-0|0;l=b;return e|0}f=c[d>>2]|0;if((a|0)>=222&(c[d>>2]|0)<=254){e=f-8|0;l=b;return e|0}a=c[d>>2]|0;if((f|0)>=257&(c[d>>2]|0)<=271){e=a-10|0;l=b;return e|0}f=c[d>>2]|0;if((a|0)>=273&(c[d>>2]|0)<=281){e=f-11|0;l=b;return e|0}a=c[d>>2]|0;if((f|0)>=721&(c[d>>2]|0)<=729){e=a-450|0;l=b;return e|0}f=c[d>>2]|0;if((a|0)>=750&(c[d>>2]|0)<=752){e=f-470|0;l=b;return e|0}a=c[d>>2]|0;if((f|0)>=754&(c[d>>2]|0)<=782){e=a-471|0;l=b;return e|0}f=c[d>>2]|0;if((a|0)>=784&(c[d>>2]|0)<=789){e=f-472|0;l=b;return e|0}a=c[d>>2]|0;if((f|0)>=800&(c[d>>2]|0)<=804){e=a-482|0;l=b;return e|0}f=c[d>>2]|0;if((a|0)>=815&(c[d>>2]|0)<=822){e=f-492|0;l=b;return e|0}a=c[d>>2]|0;if((f|0)>=832&(c[d>>2]|0)<=839){e=a-501|0;l=b;return e|0}f=c[d>>2]|0;if((a|0)>=844&(c[d>>2]|0)<=844){e=f-505|0;l=b;return e|0}a=c[d>>2]|0;if((f|0)>=848&(c[d>>2]|0)<=848){e=a-508|0;l=b;return e|0}f=c[d>>2]|0;if((a|0)>=881&(c[d>>2]|0)<=891){e=f-540|0;l=b;return e|0}a=c[d>>2]|0;if((f|0)>=1024&(c[d>>2]|0)<=1039){e=a-672|0;l=b;return e|0}else{e=(a|0)>=16381&(c[d>>2]|0)<=16383?(c[d>>2]|0)-16013|0:371;l=b;return e|0}return 0}function du(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[e>>2]=a;do if(c[e>>2]&32768|0){c[e>>2]=c[e>>2]&-32769;if((c[e>>2]|0)>>>0<141){c[d>>2]=c[14692+(c[e>>2]<<2)>>2];break}else{c[d>>2]=0;break}}else c[d>>2]=0;while(0);l=b;return c[d>>2]|0}function eu(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+8|0;e=b+4|0;f=b;c[e>>2]=a;if(!(c[e>>2]|0)){c[d>>2]=0;g=c[d>>2]|0;l=b;return g|0}a=c[e>>2]|0;do if(!((c[e>>2]|0)>=1&(c[e>>2]|0)<=11)){h=c[e>>2]|0;if((a|0)>=11&(c[e>>2]|0)<=35){i=h-0|0;break}j=c[e>>2]|0;if((h|0)>=35&(c[e>>2]|0)<=40){i=j+1|0;break}h=c[e>>2]|0;if((j|0)>=42&(c[e>>2]|0)<=57){i=h-0|0;break}j=c[e>>2]|0;if((h|0)>=59&(c[e>>2]|0)<=95){i=j-1|0;break}else{i=(j|0)>=95&(c[e>>2]|0)<=125?(c[e>>2]|0)-0|0:-1;break}}else i=a-1|0;while(0);c[f>>2]=i;if((c[f>>2]|0)<0){c[d>>2]=16382;g=c[d>>2]|0;l=b;return g|0}else{c[d>>2]=32768|c[15256+(c[f>>2]<<2)>>2];g=c[d>>2]|0;l=b;return g|0}return 0}function fu(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a+8|0;d=a+4|0;e=a;c[d>>2]=c[(xu()|0)>>2];if(!(c[d>>2]|0)){c[b>>2]=16381;f=c[b>>2]|0;l=a;return f|0}g=c[d>>2]|0;do if(!((c[d>>2]|0)>=1&(c[d>>2]|0)<=11)){h=c[d>>2]|0;if((g|0)>=11&(c[d>>2]|0)<=35){i=h-0|0;break}j=c[d>>2]|0;if((h|0)>=35&(c[d>>2]|0)<=40){i=j+1|0;break}h=c[d>>2]|0;if((j|0)>=42&(c[d>>2]|0)<=57){i=h-0|0;break}j=c[d>>2]|0;if((h|0)>=59&(c[d>>2]|0)<=95){i=j-1|0;break}else{i=(j|0)>=95&(c[d>>2]|0)<=125?(c[d>>2]|0)-0|0:-1;break}}else i=g-1|0;while(0);c[e>>2]=i;if((c[e>>2]|0)<0){c[b>>2]=16382;f=c[b>>2]|0;l=a;return f|0}else{c[b>>2]=32768|c[15256+(c[e>>2]<<2)>>2];f=c[b>>2]|0;l=a;return f|0}return 0}function gu(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+4|0;g=e;c[f>>2]=b;c[g>>2]=d;d=c[g>>2]|0;b=Ad(c[d>>2]|0,c[d+4>>2]|0)|0;d=D;h=c[f>>2]|0;i=h;a[i>>0]=b;a[i+1>>0]=b>>8;a[i+2>>0]=b>>16;a[i+3>>0]=b>>24;b=h+4|0;a[b>>0]=d;a[b+1>>0]=d>>8;a[b+2>>0]=d>>16;a[b+3>>0]=d>>24;d=Iv(c[(c[g>>2]|0)+8>>2]|0)|0;b=(c[f>>2]|0)+8|0;a[b>>0]=d;a[b+1>>0]=d>>8;a[b+2>>0]=d>>16;a[b+3>>0]=d>>24;d=(c[f>>2]|0)+12|0;f=(c[g>>2]|0)+12|0;g=d+12|0;do{a[d>>0]=a[f>>0]|0;d=d+1|0;f=f+1|0}while((d|0)<(g|0));l=e;return}function hu(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+4|0;h=f;c[g>>2]=b;c[h>>2]=e;e=c[h>>2]|0;b=e;i=e+4|0;e=Bd(d[b>>0]|d[b+1>>0]<<8|d[b+2>>0]<<16|d[b+3>>0]<<24,d[i>>0]|d[i+1>>0]<<8|d[i+2>>0]<<16|d[i+3>>0]<<24)|0;i=c[g>>2]|0;c[i>>2]=e;c[i+4>>2]=D;i=(c[h>>2]|0)+8|0;e=Mv(d[i>>0]|d[i+1>>0]<<8|d[i+2>>0]<<16|d[i+3>>0]<<24)|0;c[(c[g>>2]|0)+8>>2]=e;e=(c[g>>2]|0)+12|0;g=(c[h>>2]|0)+12|0;h=e+12|0;do{a[e>>0]=a[g>>0]|0;e=e+1|0;g=g+1|0}while((e|0)<(h|0));l=f;return}function iu(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=hv(c[f>>2]|0)|0;if((c[h>>2]|0)>>>0>=12){c[e>>2]=-1;i=c[e>>2]|0;l=d;return i|0}else{b=c[g>>2]|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;_w((c[g>>2]|0)+12|0,c[f>>2]|0,c[h>>2]|0)|0;c[e>>2]=1;i=c[e>>2]|0;l=d;return i|0}return 0}function ju(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+8|0;f=d+4|0;g=d;c[f>>2]=a;c[g>>2]=b;do if(0!=(ku(c[f>>2]|0)|0)?0!=(ku(c[g>>2]|0)|0):0)if(!(sv((c[f>>2]|0)+12|0,(c[g>>2]|0)+12|0)|0)){c[e>>2]=1;break}else{c[e>>2]=0;break}else h=3;while(0);if((h|0)==3)c[e>>2]=-1;l=d;return c[e>>2]|0}function ku(b){b=b|0;var d=0,e=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d;c[e>>2]=b;l=d;return 0!=(a[(c[e>>2]|0)+12>>0]|0)|0}function lu(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0;d=l;l=l+96|0;if((l|0)>=(m|0))$(96);e=d+64|0;f=d+56|0;g=d+48|0;h=d+92|0;i=d+88|0;j=d+84|0;k=d+24|0;n=d;o=d+80|0;p=d+76|0;q=d+72|0;c[i>>2]=a;c[j>>2]=b;if(1!=(ju(c[i>>2]|0,c[j>>2]|0)|0)){c[o>>2]=349;if((c[3940]|0)==-1)c[3940]=$b(1,0,61609,61618,c[o>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[3940]|0))_b();c[g>>2]=61609;c[g+4>>2]=349;cc(1,61747,g);_b()}g=c[i>>2]|0;c[k>>2]=c[g>>2];c[k+4>>2]=c[g+4>>2];c[k+8>>2]=c[g+8>>2];c[k+12>>2]=c[g+12>>2];c[k+16>>2]=c[g+16>>2];c[k+20>>2]=c[g+20>>2];g=c[j>>2]|0;c[n>>2]=c[g>>2];c[n+4>>2]=c[g+4>>2];c[n+8>>2]=c[g+8>>2];c[n+12>>2]=c[g+12>>2];c[n+16>>2]=c[g+16>>2];c[n+20>>2]=c[g+20>>2];if(-1==(mu(k)|0)){c[p>>2]=353;if((c[3941]|0)==-1)c[3941]=$b(1,0,61609,61618,c[p>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[3941]|0))_b();c[f>>2]=61609;c[f+4>>2]=353;cc(1,61747,f);_b()}if(-1==(mu(n)|0)){c[q>>2]=355;if((c[3942]|0)==-1)c[3942]=$b(1,0,61609,61618,c[q>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[3942]|0))_b();c[e>>2]=61609;c[e+4>>2]=355;cc(1,61747,e);_b()}e=k;q=n;if(!((c[e>>2]|0)==(c[q>>2]|0)?(c[e+4>>2]|0)==(c[q+4>>2]|0):0)){q=k;e=c[q+4>>2]|0;f=n;p=c[f+4>>2]|0;if(e>>>0

>>0|((e|0)==(p|0)?(c[q>>2]|0)>>>0<(c[f>>2]|0)>>>0:0)){c[h>>2]=-1;r=c[h>>2]|0;l=d;return r|0}else{c[h>>2]=1;r=c[h>>2]|0;l=d;return r|0}}if((c[k+8>>2]|0)>>>0<(c[n+8>>2]|0)>>>0){c[h>>2]=-1;r=c[h>>2]|0;l=d;return r|0}if((c[k+8>>2]|0)>>>0>(c[n+8>>2]|0)>>>0){c[h>>2]=1;r=c[h>>2]|0;l=d;return r|0}else{c[h>>2]=0;r=c[h>>2]|0;l=d;return r|0}return 0}function mu(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+8|0;e=b+4|0;f=b;c[e>>2]=a;if(1!=(ku(c[e>>2]|0)|0)){c[d>>2]=-1;g=c[d>>2]|0;l=b;return g|0}c[f>>2]=0;while(1){a=c[e>>2]|0;if((c[a>>2]|0)!=-1?1:(c[a+4>>2]|0)!=-1)h=(c[(c[e>>2]|0)+8>>2]|0)>>>0>=1e8;else h=0;a=(c[e>>2]|0)+8|0;i=c[a>>2]|0;if(!h)break;c[a>>2]=i-1e8;a=c[e>>2]|0;j=a;k=Ww(c[j>>2]|0,c[j+4>>2]|0,1,0)|0;j=a;c[j>>2]=k;c[j+4>>2]=D;c[f>>2]=1}if(i>>>0>=1e8){nu(c[e>>2]|0);c[d>>2]=-1;g=c[d>>2]|0;l=b;return g|0}else{c[d>>2]=c[f>>2];g=c[d>>2]|0;l=b;return g|0}return 0}function nu(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=c[d>>2]|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;c[a+16>>2]=0;c[a+20>>2]=0;l=b;return}function ou(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;e=l;l=l+112|0;if((l|0)>=(m|0))$(112);f=e+64|0;g=e+56|0;h=e+48|0;i=e+96|0;j=e+92|0;k=e+88|0;n=e+84|0;o=e+24|0;p=e;q=e+80|0;r=e+76|0;s=e+72|0;c[j>>2]=a;c[k>>2]=b;c[n>>2]=d;if(1!=(ju(c[k>>2]|0,c[n>>2]|0)|0)){nu(c[j>>2]|0);c[i>>2]=-1;t=c[i>>2]|0;l=e;return t|0}d=c[k>>2]|0;c[o>>2]=c[d>>2];c[o+4>>2]=c[d+4>>2];c[o+8>>2]=c[d+8>>2];c[o+12>>2]=c[d+12>>2];c[o+16>>2]=c[d+16>>2];c[o+20>>2]=c[d+20>>2];d=c[n>>2]|0;c[p>>2]=c[d>>2];c[p+4>>2]=c[d+4>>2];c[p+8>>2]=c[d+8>>2];c[p+12>>2]=c[d+12>>2];c[p+16>>2]=c[d+16>>2];c[p+20>>2]=c[d+20>>2];if(-1!=(mu(o)|0)?-1!=(mu(p)|0):0){do if((c[o+8>>2]|0)>>>0<(c[p+8>>2]|0)>>>0){d=o;if(!(0==(c[d>>2]|0)?0==(c[d+4>>2]|0):0)){d=o+8|0;c[d>>2]=(c[d>>2]|0)+1e8;d=o;n=Ww(c[d>>2]|0,c[d+4>>2]|0,-1,-1)|0;d=o;c[d>>2]=n;c[d+4>>2]=D;break}nu(c[j>>2]|0);c[i>>2]=-1;t=c[i>>2]|0;l=e;return t|0}while(0);d=o;n=c[d+4>>2]|0;k=p;b=c[k+4>>2]|0;if(n>>>0>>0|((n|0)==(b|0)?(c[d>>2]|0)>>>0<(c[k>>2]|0)>>>0:0)){nu(c[j>>2]|0);c[i>>2]=-1;t=c[i>>2]|0;l=e;return t|0}if(1!=(iu(o+12|0,c[j>>2]|0)|0)){c[q>>2]=421;if((c[3943]|0)==-1)c[3943]=$b(1,0,61609,61635,c[q>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[3943]|0))_b();c[h>>2]=61609;c[h+4>>2]=421;cc(1,61747,h);_b()}if((c[o+8>>2]|0)>>>0<(c[p+8>>2]|0)>>>0){c[r>>2]=422;if((c[3944]|0)==-1)c[3944]=$b(1,0,61609,61635,c[r>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[3944]|0))_b();c[g>>2]=61609;c[g+4>>2]=422;cc(1,61747,g);_b()}c[(c[j>>2]|0)+8>>2]=(c[o+8>>2]|0)-(c[p+8>>2]|0);g=o;r=c[g+4>>2]|0;h=p;q=c[h+4>>2]|0;if(r>>>0>q>>>0|((r|0)==(q|0)?(c[g>>2]|0)>>>0>=(c[h>>2]|0)>>>0:0)){h=o;o=p;p=Tw(c[h>>2]|0,c[h+4>>2]|0,c[o>>2]|0,c[o+4>>2]|0)|0;o=c[j>>2]|0;c[o>>2]=p;c[o+4>>2]=D;if(0==(c[(c[j>>2]|0)+8>>2]|0)?(o=c[j>>2]|0,0==(c[o>>2]|0)?0==(c[o+4>>2]|0):0):0){c[i>>2]=0;t=c[i>>2]|0;l=e;return t|0}c[i>>2]=1;t=c[i>>2]|0;l=e;return t|0}c[s>>2]=424;if((c[3945]|0)==-1)c[3945]=$b(1,0,61609,61635,c[s>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[3945]|0))_b();c[f>>2]=61609;c[f+4>>2]=424;cc(1,61747,f);_b()}nu(c[j>>2]|0);c[i>>2]=-1;t=c[i>>2]|0;l=e;return t|0}function pu(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;e=l;l=l+112|0;if((l|0)>=(m|0))$(112);f=e+72|0;g=e+96|0;h=e+92|0;i=e+88|0;j=e+84|0;k=e+48|0;n=e+24|0;o=e;p=e+80|0;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;if(1!=(ju(c[i>>2]|0,c[j>>2]|0)|0)){nu(c[h>>2]|0);c[g>>2]=-1;q=c[g>>2]|0;l=e;return q|0}d=c[i>>2]|0;c[k>>2]=c[d>>2];c[k+4>>2]=c[d+4>>2];c[k+8>>2]=c[d+8>>2];c[k+12>>2]=c[d+12>>2];c[k+16>>2]=c[d+16>>2];c[k+20>>2]=c[d+20>>2];d=c[j>>2]|0;c[n>>2]=c[d>>2];c[n+4>>2]=c[d+4>>2];c[n+8>>2]=c[d+8>>2];c[n+12>>2]=c[d+12>>2];c[n+16>>2]=c[d+16>>2];c[n+20>>2]=c[d+20>>2];if(-1!=(mu(k)|0)?-1!=(mu(n)|0):0){if(1==(iu((c[i>>2]|0)+12|0,o)|0)){i=k;d=n;j=Ww(c[i>>2]|0,c[i+4>>2]|0,c[d>>2]|0,c[d+4>>2]|0)|0;d=o;c[d>>2]=j;c[d+4>>2]=D;d=o;j=c[d+4>>2]|0;i=k;b=c[i+4>>2]|0;if(j>>>0>>0|((j|0)==(b|0)?(c[d>>2]|0)>>>0<(c[i>>2]|0)>>>0:0)){nu(c[h>>2]|0);c[g>>2]=-1;q=c[g>>2]|0;l=e;return q|0}c[o+8>>2]=(c[k+8>>2]|0)+(c[n+8>>2]|0);n=-1==(mu(o)|0);k=c[h>>2]|0;if(n){nu(k);c[g>>2]=-1;q=c[g>>2]|0;l=e;return q|0}else{c[k>>2]=c[o>>2];c[k+4>>2]=c[o+4>>2];c[k+8>>2]=c[o+8>>2];c[k+12>>2]=c[o+12>>2];c[k+16>>2]=c[o+16>>2];c[k+20>>2]=c[o+20>>2];c[g>>2]=1;q=c[g>>2]|0;l=e;return q|0}}c[p>>2]=468;if((c[3946]|0)==-1)c[3946]=$b(1,0,61609,61657,c[p>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[3946]|0))_b();c[f>>2]=61609;c[f+4>>2]=468;cc(1,61747,f);_b()}nu(c[h>>2]|0);c[g>>2]=-1;q=c[g>>2]|0;l=e;return q|0}function qu(){var a=0,b=0,d=0;a=l;l=l+32|0;if((l|0)>=(m|0))$(32);b=a+16|0;d=a+8|0;He(6,0);if(Gd(61674)|0){c[d>>2]=0;Hd(37,d)|0;c[b>>2]=0;Hd(38,b)|0;l=a;return}else{Fv(c[3977]|0,61680,a)|0;Aa()}}function ru(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e;g=e+4|0;c[e+12>>2]=a;c[e+8>>2]=b;c[g>>2]=d;d=c[3977]|0;c[f>>2]=c[g>>2];Fv(d,61708,f)|0;Aa()}function su(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;g=l;l=l+48|0;if((l|0)>=(m|0))$(48);h=g+16|0;i=g;j=g+44|0;k=g+40|0;n=g+36|0;o=g+32|0;p=g+28|0;q=g+24|0;c[j>>2]=b;c[k>>2]=e;c[n>>2]=f;c[o>>2]=Iv(c[k>>2]|0)|0;k=c[n>>2]|0;f=c[j>>2]|0;c[i>>2]=61775;c[i+4>>2]=21;c[i+8>>2]=0;c[i+12>>2]=0;if(1==(Mc(k,64,o,4,f,64,i)|0)){c[p>>2]=c[n>>2];n=c[p>>2]|0;a[n>>0]=(d[n>>0]|0)&127;n=c[p>>2]|0;a[n>>0]=d[n>>0]|0|64;n=(c[p>>2]|0)+31|0;a[n>>0]=(d[n>>0]|0)&248;l=g;return}c[q>>2]=197;if((c[3947]|0)==-1)c[3947]=$b(1,0,61738,61797,c[q>>2]|0)|0;if((ac()|0)>0){bc(-1,0);_b()}if(!(c[3947]|0))_b();c[h>>2]=61738;c[h+4>>2]=197;cc(1,61747,h);_b()}function tu(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=c[a+60>>2];a=wu(hb(6,d|0)|0)|0;l=b;return a|0}function uu(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;f=l;l=l+80|0;if((l|0)>=(m|0))$(80);g=f;c[b+36>>2]=25;if((c[b>>2]&64|0)==0?(c[g>>2]=c[b+60>>2],c[g+4>>2]=21505,c[g+8>>2]=f+12,bb(54,g|0)|0):0)a[b+75>>0]=-1;g=yu(b,d,e)|0;l=f;return g|0}function vu(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e;g=e+20|0;c[f>>2]=c[a+60>>2];c[f+4>>2]=0;c[f+8>>2]=b;c[f+12>>2]=g;c[f+16>>2]=d;if((wu(ob(140,f|0)|0)|0)<0){c[g>>2]=-1;h=-1}else h=c[g>>2]|0;l=e;return h|0}function wu(a){a=a|0;var b=0;if(a>>>0>4294963200){c[(xu()|0)>>2]=0-a;b=-1}else b=a;return b|0}function xu(){var a=0;if(!(c[17812]|0))a=71292;else a=c[(kx()|0)+64>>2]|0;return a|0}function yu(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;e=l;l=l+48|0;if((l|0)>=(m|0))$(48);f=e+16|0;g=e;h=e+32|0;i=a+28|0;j=c[i>>2]|0;c[h>>2]=j;k=a+20|0;n=(c[k>>2]|0)-j|0;c[h+4>>2]=n;c[h+8>>2]=b;c[h+12>>2]=d;b=a+60|0;j=a+44|0;o=2;p=n+d|0;n=h;while(1){if(!(c[17812]|0)){c[f>>2]=c[b>>2];c[f+4>>2]=n;c[f+8>>2]=o;q=wu(sb(146,f|0)|0)|0}else{Ca(6,a|0);c[g>>2]=c[b>>2];c[g+4>>2]=n;c[g+8>>2]=o;h=wu(sb(146,g|0)|0)|0;wa(0);q=h}if((p|0)==(q|0)){r=6;break}if((q|0)<0){r=8;break}h=p-q|0;s=c[n+4>>2]|0;if(q>>>0<=s>>>0)if((o|0)==2){c[i>>2]=(c[i>>2]|0)+q;t=q;u=2;v=n;w=s}else{t=q;u=o;v=n;w=s}else{x=c[j>>2]|0;c[i>>2]=x;c[k>>2]=x;t=q-s|0;u=o+-1|0;v=n+8|0;w=c[n+12>>2]|0}c[v>>2]=(c[v>>2]|0)+t;c[v+4>>2]=w-t;o=u;p=h;n=v}if((r|0)==6){v=c[j>>2]|0;c[a+16>>2]=v+(c[a+48>>2]|0);j=v;c[i>>2]=j;c[k>>2]=j;y=d}else if((r|0)==8){c[a+16>>2]=0;c[i>>2]=0;c[k>>2]=0;c[a>>2]=c[a>>2]|32;if((o|0)==2)y=0;else y=d-(c[n+4>>2]|0)|0}l=e;return y|0}function zu(a){a=a|0;if(!(c[a+68>>2]|0))Au(a);return}function Au(a){a=a|0;return}function Bu(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;f=l;l=l+48|0;if((l|0)>=(m|0))$(48);g=f+16|0;h=f;i=f+32|0;c[i>>2]=d;j=i+4|0;k=b+48|0;n=c[k>>2]|0;c[j>>2]=e-((n|0)!=0&1);o=b+44|0;c[i+8>>2]=c[o>>2];c[i+12>>2]=n;if(!(c[17812]|0)){c[g>>2]=c[b+60>>2];c[g+4>>2]=i;c[g+8>>2]=2;p=wu(rb(145,g|0)|0)|0}else{Ca(7,b|0);c[h>>2]=c[b+60>>2];c[h+4>>2]=i;c[h+8>>2]=2;i=wu(rb(145,h|0)|0)|0;wa(0);p=i}if((p|0)>=1){i=c[j>>2]|0;if(p>>>0>i>>>0){j=c[o>>2]|0;o=b+4|0;c[o>>2]=j;h=j;c[b+8>>2]=h+(p-i);if(!(c[k>>2]|0))q=e;else{c[o>>2]=h+1;a[d+(e+-1)>>0]=a[h>>0]|0;q=e}}else q=p}else{c[b>>2]=c[b>>2]|p&48^16;c[b+8>>2]=0;c[b+4>>2]=0;q=p}l=f;return q|0}function Cu(a){a=a|0;if(!(c[a+68>>2]|0))Au(a);return}function Du(a){a=a|0;return Eu(a)|0}function Eu(a){a=a|0;return ((a|0)==32|(a|0)==9)&1|0}function Fu(b,c){b=b|0;c=c|0;var d=0,e=0,f=0,g=0;d=a[b>>0]|0;e=a[c>>0]|0;if(d<<24>>24==0?1:d<<24>>24!=e<<24>>24){f=e;g=d}else{d=c;c=b;do{c=c+1|0;d=d+1|0;b=a[c>>0]|0;e=a[d>>0]|0}while(!(b<<24>>24==0?1:b<<24>>24!=e<<24>>24));f=e;g=b}return (g&255)-(f&255)|0}function Gu(a){a=a|0;var b=0;b=(Hu(a)|0)==0;return (b?a:a|32)|0}function Hu(a){a=a|0;return (a+-65|0)>>>0<26|0}function Iu(a){a=a|0;return Ku(a,0)|0}function Ju(a){a=a|0;return Ku(a,1)|0}function Ku(c,f){c=c|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;g=(f<<1)+-1|0;h=f+-1|0;a:do if((c+-43008|0)>>>0<22272|((c+-11776|0)>>>0<30784|((c+-1536|0)>>>0<2560|(Lu(c)|0)==0)))i=c;else{j=(f|0)!=0;if(j&(c+-4256|0)>>>0<46){if((c|0)>4293)switch(c|0){case 4295:case 4301:break;default:{i=c;break a}}i=c+7264|0;break}if((c+-11520|0)>>>0<38&(j^1)){if((c|0)>11557)switch(c|0){case 11559:case 11565:break;default:{i=c;break a}}i=c+-7264|0;break}else k=0;do{l=a[18910+(k<<2)+2>>0]|0;m=l<<24>>24;n=c-(e[18910+(k<<2)>>1]|0)|0;if((n-(m&h)|0)>>>0<(d[18910+(k<<2)+3>>0]|0)>>>0){o=13;break}k=k+1|0}while((k|0)!=61);if((o|0)==13)if(l<<24>>24==1){i=f+c-(n&1)|0;break}else{i=(S(m,g)|0)+c|0;break}j=1-f|0;p=b[18418+(j<<1)>>1]|0;b:do if(p<<16>>16){q=0;r=p;while(1){if((r&65535|0)==(c|0))break;s=q+1|0;r=b[18418+(s<<2)+(j<<1)>>1]|0;if(!(r<<16>>16))break b;else q=s}i=e[18418+(q<<2)+(f<<1)>>1]|0;break a}while(0);return ((c+-66600+(f*40|0)|0)>>>0<40?c+-40+(f*80|0)|0:c)|0}while(0);return i|0}function Lu(a){a=a|0;var b=0;if(a>>>0<131072)b=(d[61820+((d[61820+(a>>>8)>>0]|0)<<5|a>>>3&31)>>0]|0)>>>(a&7)&1;else b=a>>>0<196606&1;return b|0}function Mu(a){a=a|0;return (a+-97|0)>>>0<26|0}function Nu(b){b=b|0;var c=0,e=0,f=0,g=0,h=0,i=0;c=0;while(1){if((d[64796+c>>0]|0)==(b|0)){e=2;break}f=c+1|0;if((f|0)==87){g=64884;h=87;e=5;break}else c=f}if((e|0)==2)if(!c)i=64884;else{g=64884;h=c;e=5}if((e|0)==5)while(1){e=0;c=g;do{b=c;c=c+1|0}while((a[b>>0]|0)!=0);h=h+-1|0;if(!h){i=c;break}else{g=c;e=5}}return i|0}function Ou(a){a=a|0;var b=0;if(!a)b=0;else b=(Pu(16228,a)|0)!=0;return b&1|0}function Pu(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;if(!b)d=a+((Qu(a)|0)<<2)|0;else{e=a;while(1){f=c[e>>2]|0;if((f|0)==0|(f|0)==(b|0))break;else e=e+4|0}d=f|0?e:0}return d|0}function Qu(a){a=a|0;var b=0;b=a;while(1)if(!(c[b>>2]|0))break;else b=b+4|0;return b-a>>2|0}function Ru(a){a=a|0;return ((a+-48|0)>>>0<10|((a|32)+-97|0)>>>0<6)&1|0}function Su(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f;c[g>>2]=e;e=Tu(a,b,d,g)|0;l=f;return e|0}function Tu(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0;g=l;l=l+128|0;if((l|0)>=(m|0))$(128);h=g+112|0;i=g;j=i;k=16316;n=j+112|0;do{c[j>>2]=c[k>>2];j=j+4|0;k=k+4|0}while((j|0)<(n|0));if((d+-1|0)>>>0>2147483646)if(!d){o=h;p=1;q=4}else{c[(xu()|0)>>2]=75;r=-1}else{o=b;p=d;q=4}if((q|0)==4){q=-2-o|0;d=p>>>0>q>>>0?q:p;c[i+48>>2]=d;p=i+20|0;c[p>>2]=o;c[i+44>>2]=o;q=o+d|0;o=i+16|0;c[o>>2]=q;c[i+28>>2]=q;q=Uu(i,e,f)|0;if(!d)r=q;else{d=c[p>>2]|0;a[d+(((d|0)==(c[o>>2]|0))<<31>>31)>>0]=0;r=q}}l=g;return r|0}function Uu(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;f=l;l=l+224|0;if((l|0)>=(m|0))$(224);g=f+120|0;h=f+80|0;i=f;j=f+136|0;k=h;n=k+40|0;do{c[k>>2]=0;k=k+4|0}while((k|0)<(n|0));c[g>>2]=c[e>>2];if((Vu(0,d,g,i,h)|0)<0)o=-1;else{if((c[b+76>>2]|0)>-1)p=Wu(b)|0;else p=0;e=c[b>>2]|0;k=e&32;if((a[b+74>>0]|0)<1)c[b>>2]=e&-33;e=b+48|0;if(!(c[e>>2]|0)){n=b+44|0;q=c[n>>2]|0;c[n>>2]=j;r=b+28|0;c[r>>2]=j;s=b+20|0;c[s>>2]=j;c[e>>2]=80;t=b+16|0;c[t>>2]=j+80;j=Vu(b,d,g,i,h)|0;if(!q)u=j;else{ub[c[b+36>>2]&63](b,0,0)|0;v=(c[s>>2]|0)==0?-1:j;c[n>>2]=q;c[e>>2]=0;c[t>>2]=0;c[r>>2]=0;c[s>>2]=0;u=v}}else u=Vu(b,d,g,i,h)|0;h=c[b>>2]|0;c[b>>2]=h|k;if(p|0)Au(b);o=(h&32|0)==0?u:-1}l=f;return o|0}function Vu(e,f,g,i,k){e=e|0;f=f|0;g=g|0;i=i|0;k=k|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va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default:{}}f=T+1|0;T=f;U=a[f>>0]|0}c:do if((R|0)==9)while(1){R=0;if((a[W+1>>0]|0)!=37){X=V;Y=W;break c}f=V+1|0;Z=W+2|0;if((a[Z>>0]|0)==37){V=f;W=Z;R=9}else{X=f;Y=Z;break}}while(0);Z=X-P|0;if(w?(c[e>>2]&32|0)==0:0)Xu(P,Z,e)|0;if(Z|0){M=Z;N=Q;P=Y;continue}Z=Y+1|0;f=a[Z>>0]|0;_=(f<<24>>24)+-48|0;if(_>>>0<10){aa=(a[Y+2>>0]|0)==36;ba=aa?Y+3|0:Z;ca=aa?_:-1;da=aa?1:O;ea=a[ba>>0]|0;fa=ba}else{ca=-1;da=O;ea=f;fa=Z}Z=(ea<<24>>24)+-32|0;d:do if(Z>>>0<32){f=0;ba=Z;aa=ea;_=fa;while(1){if(!(1<>24)+-32|f;ka=_+1|0;la=a[ka>>0]|0;ba=(la<<24>>24)+-32|0;if(ba>>>0>=32){ga=ja;ha=la;ia=ka;break}else{f=ja;aa=la;_=ka}}}else{ga=0;ha=ea;ia=fa}while(0);do if(ha<<24>>24!=42){Z=(ha<<24>>24)+-48|0;if(Z>>>0<10){_=0;aa=ia;f=Z;do{_=(_*10|0)+f|0;aa=aa+1|0;ma=a[aa>>0]|0;f=(ma<<24>>24)+-48|0}while(f>>>0<10);if((_|0)<0){na=-1;break a}else{oa=_;pa=ga;qa=da;ra=aa;sa=ma}}else{oa=0;pa=ga;qa=da;ra=ia;sa=ha}}else{f=ia+1|0;Z=a[f>>0]|0;ba=(Z<<24>>24)+-48|0;if(ba>>>0<10?(a[ia+2>>0]|0)==36:0){c[k+(ba<<2)>>2]=10;ta=c[i+((a[f>>0]|0)+-48<<3)>>2]|0;ua=1;va=ia+3|0}else{if(da|0){na=-1;break a}if(!w){oa=0;pa=ga;qa=0;ra=f;sa=Z;break}Z=(c[g>>2]|0)+(4-1)&~(4-1);ba=c[Z>>2]|0;c[g>>2]=Z+4;ta=ba;ua=0;va=f}f=(ta|0)<0;oa=f?0-ta|0:ta;pa=f?ga|8192:ga;qa=ua;ra=va;sa=a[va>>0]|0}while(0);e:do if(sa<<24>>24==46){f=ra+1|0;ba=a[f>>0]|0;if(ba<<24>>24!=42){Z=(ba<<24>>24)+-48|0;if(Z>>>0<10){wa=0;xa=f;ya=Z}else{za=0;Aa=f;break}while(1){f=(wa*10|0)+ya|0;Z=xa+1|0;ya=(a[Z>>0]|0)+-48|0;if(ya>>>0>=10){za=f;Aa=Z;break e}else{wa=f;xa=Z}}}aa=ra+2|0;_=(a[aa>>0]|0)+-48|0;if(_>>>0<10?(a[ra+3>>0]|0)==36:0){c[k+(_<<2)>>2]=10;za=c[i+((a[aa>>0]|0)+-48<<3)>>2]|0;Aa=ra+4|0;break}if(qa|0){na=-1;break a}if(w){_=(c[g>>2]|0)+(4-1)&~(4-1);Z=c[_>>2]|0;c[g>>2]=_+4;za=Z;Aa=aa}else{za=0;Aa=aa}}else{za=-1;Aa=ra}while(0);aa=0;Z=Aa;while(1){_=(a[Z>>0]|0)+-65|0;if(_>>>0>57){na=-1;break a}Ba=Z+1|0;Ca=a[66688+(aa*58|0)+_>>0]|0;Da=Ca&255;if((Da+-1|0)>>>0<8){aa=Da;Z=Ba}else break}if(!(Ca<<24>>24)){na=-1;break}_=(ca|0)>-1;do if(Ca<<24>>24==19)if(_){na=-1;break a}else R=51;else{if(_){c[k+(ca<<2)>>2]=Da;f=i+(ca<<3)|0;ba=c[f+4>>2]|0;ka=s;c[ka>>2]=c[f>>2];c[ka+4>>2]=ba;R=51;break}if(!w){na=0;break a}Yu(s,Da,g)}while(0);if((R|0)==51?(R=0,!w):0){M=0;N=Q;O=qa;P=Ba;continue}_=a[Z>>0]|0;ba=(aa|0)!=0&(_&15|0)==3?_&-33:_;_=pa&-65537;ka=(pa&8192|0)==0?pa:_;f:do switch(ba|0){case 110:{switch((aa&255)<<24>>24){case 0:{c[c[s>>2]>>2]=Q;M=0;N=Q;O=qa;P=Ba;continue a;break}case 1:{c[c[s>>2]>>2]=Q;M=0;N=Q;O=qa;P=Ba;continue a;break}case 2:{f=c[s>>2]|0;c[f>>2]=Q;c[f+4>>2]=((Q|0)<0)<<31>>31;M=0;N=Q;O=qa;P=Ba;continue a;break}case 3:{b[c[s>>2]>>1]=Q;M=0;N=Q;O=qa;P=Ba;continue a;break}case 4:{a[c[s>>2]>>0]=Q;M=0;N=Q;O=qa;P=Ba;continue a;break}case 6:{c[c[s>>2]>>2]=Q;M=0;N=Q;O=qa;P=Ba;continue a;break}case 7:{f=c[s>>2]|0;c[f>>2]=Q;c[f+4>>2]=((Q|0)<0)<<31>>31;M=0;N=Q;O=qa;P=Ba;continue a;break}default:{M=0;N=Q;O=qa;P=Ba;continue a}}break}case 112:{Ea=120;Fa=za>>>0>8?za:8;Ga=ka|8;R=63;break}case 88:case 120:{Ea=ba;Fa=za;Ga=ka;R=63;break}case 111:{f=s;la=c[f>>2]|0;ja=c[f+4>>2]|0;if((la|0)==0&(ja|0)==0)Ha=x;else{f=x;Ia=la;la=ja;while(1){ja=f+-1|0;a[ja>>0]=Ia&7|48;Ia=cx(Ia|0,la|0,3)|0;la=D;if((Ia|0)==0&(la|0)==0){Ha=ja;break}else f=ja}}if(!(ka&8)){Ja=Ha;Ka=0;La=67168;Ma=za;Na=ka;R=76}else{f=y-Ha|0;Ja=Ha;Ka=0;La=67168;Ma=(za|0)>(f|0)?za:f+1|0;Na=ka;R=76}break}case 105:case 100:{f=s;la=c[f>>2]|0;Ia=c[f+4>>2]|0;if((Ia|0)<0){f=Tw(0,0,la|0,Ia|0)|0;ja=D;Oa=s;c[Oa>>2]=f;c[Oa+4>>2]=ja;Pa=1;Qa=67168;Ra=f;Sa=ja;R=75;break f}if(!(ka&2048)){ja=ka&1;Pa=ja;Qa=(ja|0)==0?67168:67170;Ra=la;Sa=Ia;R=75}else{Pa=1;Qa=67169;Ra=la;Sa=Ia;R=75}break}case 117:{Ia=s;Pa=0;Qa=67168;Ra=c[Ia>>2]|0;Sa=c[Ia+4>>2]|0;R=75;break}case 99:{a[z>>0]=c[s>>2];Ta=z;Ua=0;Va=67168;Wa=x;Xa=1;Ya=_;break}case 109:{Za=Nu(c[(xu()|0)>>2]|0)|0;R=81;break}case 115:{Ia=c[s>>2]|0;Za=Ia|0?Ia:67178;R=81;break}case 67:{c[u>>2]=c[s>>2];c[t>>2]=0;c[s>>2]=u;_a=-1;$a=u;R=85;break}case 83:{Ia=c[s>>2]|0;if(!za){$u(e,32,oa,0,ka);ab=0;R=96}else{_a=za;$a=Ia;R=85}break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{bb=+h[s>>3];c[p>>2]=0;h[j>>3]=bb;if((c[j+4>>2]|0)>=0){Ia=ka&1;if(!(ka&2048)){cb=bb;db=Ia;eb=(Ia|0)==0?67186:67191}else{cb=bb;db=1;eb=67188}}else{cb=-bb;db=1;eb=67185}h[j>>3]=cb;Ia=c[j+4>>2]&2146435072;do if(Ia>>>0<2146435072|(Ia|0)==2146435072&0<0){bb=+bv(cb,p)*2.0;la=bb!=0.0;if(la)c[p>>2]=(c[p>>2]|0)+-1;ja=ba|32;if((ja|0)==97){f=ba&32;Oa=(f|0)==0?eb:eb+9|0;fb=db|2;gb=12-za|0;do if(!(za>>>0>11|(gb|0)==0)){hb=8.0;ib=gb;do{ib=ib+-1|0;hb=hb*16.0}while((ib|0)!=0);if((a[Oa>>0]|0)==45){jb=-(hb+(-bb-hb));break}else{jb=bb+hb-hb;break}}else jb=bb;while(0);gb=c[p>>2]|0;ib=(gb|0)<0?0-gb|0:gb;kb=Zu(ib,((ib|0)<0)<<31>>31,C)|0;if((kb|0)==(C|0)){a[E>>0]=48;lb=E}else lb=kb;a[lb+-1>>0]=(gb>>31&2)+43;gb=lb+-2|0;a[gb>>0]=ba+15;kb=(za|0)<1;ib=(ka&8|0)==0;mb=q;nb=jb;while(1){ob=~~nb;pb=mb+1|0;a[mb>>0]=d[67152+ob>>0]|f;nb=(nb-+(ob|0))*16.0;do if((pb-A|0)==1){if(ib&(kb&nb==0.0)){qb=pb;break}a[pb>>0]=46;qb=mb+2|0}else qb=pb;while(0);if(!(nb!=0.0))break;else mb=qb}mb=qb;kb=gb;ib=(za|0)!=0&(G+mb|0)<(za|0)?H+za-kb|0:F-kb+mb|0;f=ib+fb|0;$u(e,32,oa,f,ka);if(!(c[e>>2]&32))Xu(Oa,fb,e)|0;$u(e,48,oa,f,ka^65536);pb=mb-A|0;if(!(c[e>>2]&32))Xu(q,pb,e)|0;mb=r-kb|0;$u(e,48,ib-(pb+mb)|0,0,0);if(!(c[e>>2]&32))Xu(gb,mb,e)|0;$u(e,32,oa,f,ka^8192);rb=(f|0)<(oa|0)?oa:f;break}f=(za|0)<0?6:za;if(la){mb=(c[p>>2]|0)+-28|0;c[p>>2]=mb;sb=bb*268435456.0;tb=mb}else{sb=bb;tb=c[p>>2]|0}mb=(tb|0)<0?o:I;pb=mb;nb=sb;do{ib=~~nb>>>0;c[pb>>2]=ib;pb=pb+4|0;nb=(nb-+(ib>>>0))*1.0e9}while(nb!=0.0);if((tb|0)>0){la=mb;gb=pb;fb=tb;while(1){Oa=(fb|0)>29?29:fb;ib=gb+-4|0;do if(ib>>>0>>0)ub=la;else{kb=ib;ob=0;do{vb=ix(c[kb>>2]|0,0,Oa|0)|0;wb=Ww(vb|0,D|0,ob|0,0)|0;vb=D;xb=jx(wb|0,vb|0,1e9,0)|0;c[kb>>2]=xb;ob=ex(wb|0,vb|0,1e9,0)|0;kb=kb+-4|0}while(kb>>>0>=la>>>0);if(!ob){ub=la;break}kb=la+-4|0;c[kb>>2]=ob;ub=kb}while(0);ib=gb;while(1){if(ib>>>0<=ub>>>0)break;kb=ib+-4|0;if(!(c[kb>>2]|0))ib=kb;else break}kb=(c[p>>2]|0)-Oa|0;c[p>>2]=kb;if((kb|0)>0){la=ub;gb=ib;fb=kb}else{yb=ub;zb=ib;Ab=kb;break}}}else{yb=mb;zb=pb;Ab=tb}if((Ab|0)<0){fb=((f+25|0)/9|0)+1|0;gb=(ja|0)==102;la=yb;kb=zb;vb=Ab;while(1){wb=0-vb|0;xb=(wb|0)>9?9:wb;do if(la>>>0>>0){wb=(1<>>xb;Cb=0;Db=la;do{Eb=c[Db>>2]|0;c[Db>>2]=(Eb>>>xb)+Cb;Cb=S(Eb&wb,Bb)|0;Db=Db+4|0}while(Db>>>0>>0);Db=(c[la>>2]|0)==0?la+4|0:la;if(!Cb){Fb=Db;Gb=kb;break}c[kb>>2]=Cb;Fb=Db;Gb=kb+4|0}else{Fb=(c[la>>2]|0)==0?la+4|0:la;Gb=kb}while(0);ib=gb?mb:Fb;Oa=(Gb-ib>>2|0)>(fb|0)?ib+(fb<<2)|0:Gb;vb=(c[p>>2]|0)+xb|0;c[p>>2]=vb;if((vb|0)>=0){Hb=Fb;Ib=Oa;break}else{la=Fb;kb=Oa}}}else{Hb=yb;Ib=zb}kb=mb;do if(Hb>>>0>>0){la=(kb-Hb>>2)*9|0;vb=c[Hb>>2]|0;if(vb>>>0<10){Jb=la;break}else{Kb=la;Lb=10}while(1){Lb=Lb*10|0;la=Kb+1|0;if(vb>>>0>>0){Jb=la;break}else Kb=la}}else Jb=0;while(0);vb=(ja|0)==103;xb=(f|0)!=0;la=f-((ja|0)!=102?Jb:0)+((xb&vb)<<31>>31)|0;if((la|0)<(((Ib-kb>>2)*9|0)+-9|0)){fb=la+9216|0;la=mb+4+(((fb|0)/9|0)+-1024<<2)|0;gb=((fb|0)%9|0)+1|0;if((gb|0)<9){fb=gb;gb=10;while(1){pb=gb*10|0;fb=fb+1|0;if((fb|0)==9){Mb=pb;break}else gb=pb}}else Mb=10;gb=c[la>>2]|0;fb=(gb>>>0)%(Mb>>>0)|0;ja=(la+4|0)==(Ib|0);do if(ja&(fb|0)==0){Nb=la;Ob=Jb;Pb=Hb}else{nb=(((gb>>>0)/(Mb>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;pb=(Mb|0)/2|0;if(fb>>>0>>0)Qb=.5;else Qb=ja&(fb|0)==(pb|0)?1.0:1.5;do if(!db){Rb=Qb;Sb=nb}else{if((a[eb>>0]|0)!=45){Rb=Qb;Sb=nb;break}Rb=-Qb;Sb=-nb}while(0);pb=gb-fb|0;c[la>>2]=pb;if(!(Sb+Rb!=Sb)){Nb=la;Ob=Jb;Pb=Hb;break}Oa=pb+Mb|0;c[la>>2]=Oa;if(Oa>>>0>999999999){Oa=la;pb=Hb;while(1){ib=Oa+-4|0;c[Oa>>2]=0;if(ib>>>0>>0){Db=pb+-4|0;c[Db>>2]=0;Tb=Db}else Tb=pb;Db=(c[ib>>2]|0)+1|0;c[ib>>2]=Db;if(Db>>>0>999999999){Oa=ib;pb=Tb}else{Ub=ib;Vb=Tb;break}}}else{Ub=la;Vb=Hb}pb=(kb-Vb>>2)*9|0;Oa=c[Vb>>2]|0;if(Oa>>>0<10){Nb=Ub;Ob=pb;Pb=Vb;break}else{Wb=pb;Xb=10}while(1){Xb=Xb*10|0;pb=Wb+1|0;if(Oa>>>0>>0){Nb=Ub;Ob=pb;Pb=Vb;break}else Wb=pb}}while(0);la=Nb+4|0;Yb=Ob;Zb=Ib>>>0>la>>>0?la:Ib;_b=Pb}else{Yb=Jb;Zb=Ib;_b=Hb}la=0-Yb|0;fb=Zb;while(1){if(fb>>>0<=_b>>>0){$b=0;break}gb=fb+-4|0;if(!(c[gb>>2]|0))fb=gb;else{$b=1;break}}do if(vb){gb=(xb&1^1)+f|0;if((gb|0)>(Yb|0)&(Yb|0)>-5){ac=ba+-1|0;bc=gb+-1-Yb|0}else{ac=ba+-2|0;bc=gb+-1|0}gb=ka&8;if(gb|0){cc=ac;dc=bc;ec=gb;break}do if($b){gb=c[fb+-4>>2]|0;if(!gb){fc=9;break}if(!((gb>>>0)%10|0)){gc=0;hc=10}else{fc=0;break}while(1){hc=hc*10|0;ja=gc+1|0;if((gb>>>0)%(hc>>>0)|0|0){fc=ja;break}else gc=ja}}else fc=9;while(0);gb=((fb-kb>>2)*9|0)+-9|0;if((ac|32|0)==102){Cb=gb-fc|0;ja=(Cb|0)<0?0:Cb;cc=ac;dc=(bc|0)<(ja|0)?bc:ja;ec=0;break}else{ja=gb+Yb-fc|0;gb=(ja|0)<0?0:ja;cc=ac;dc=(bc|0)<(gb|0)?bc:gb;ec=0;break}}else{cc=ba;dc=f;ec=ka&8}while(0);f=dc|ec;kb=(f|0)!=0&1;xb=(cc|32|0)==102;if(xb){ic=0;jc=(Yb|0)>0?Yb:0}else{vb=(Yb|0)<0?la:Yb;gb=Zu(vb,((vb|0)<0)<<31>>31,C)|0;if((r-gb|0)<2){vb=gb;while(1){ja=vb+-1|0;a[ja>>0]=48;if((r-ja|0)<2)vb=ja;else{kc=ja;break}}}else kc=gb;a[kc+-1>>0]=(Yb>>31&2)+43;vb=kc+-2|0;a[vb>>0]=cc;ic=vb;jc=r-vb|0}vb=db+1+dc+kb+jc|0;$u(e,32,oa,vb,ka);if(!(c[e>>2]&32))Xu(eb,db,e)|0;$u(e,48,oa,vb,ka^65536);do if(xb){la=_b>>>0>mb>>>0?mb:_b;ja=la;do{Cb=Zu(c[ja>>2]|0,0,J)|0;do if((ja|0)==(la|0)){if((Cb|0)!=(J|0)){lc=Cb;break}a[L>>0]=48;lc=L}else{if(Cb>>>0<=q>>>0){lc=Cb;break}Uw(q|0,48,Cb-A|0)|0;Oa=Cb;while(1){pb=Oa+-1|0;if(pb>>>0>q>>>0)Oa=pb;else{lc=pb;break}}}while(0);if(!(c[e>>2]&32))Xu(lc,K-lc|0,e)|0;ja=ja+4|0}while(ja>>>0<=mb>>>0);do if(f|0){if(c[e>>2]&32|0)break;Xu(67220,1,e)|0}while(0);if((dc|0)>0&ja>>>0>>0){la=dc;Cb=ja;while(1){Oa=Zu(c[Cb>>2]|0,0,J)|0;if(Oa>>>0>q>>>0){Uw(q|0,48,Oa-A|0)|0;pb=Oa;while(1){ib=pb+-1|0;if(ib>>>0>q>>>0)pb=ib;else{mc=ib;break}}}else mc=Oa;if(!(c[e>>2]&32))Xu(mc,(la|0)>9?9:la,e)|0;Cb=Cb+4|0;pb=la+-9|0;if(!((la|0)>9&Cb>>>0>>0)){nc=pb;break}else la=pb}}else nc=dc;$u(e,48,nc+9|0,9,0)}else{la=$b?fb:_b+4|0;if((dc|0)>-1){Cb=(ec|0)==0;ja=dc;pb=_b;while(1){ib=Zu(c[pb>>2]|0,0,J)|0;if((ib|0)==(J|0)){a[L>>0]=48;oc=L}else oc=ib;do if((pb|0)==(_b|0)){ib=oc+1|0;if(!(c[e>>2]&32))Xu(oc,1,e)|0;if(Cb&(ja|0)<1){pc=ib;break}if(c[e>>2]&32|0){pc=ib;break}Xu(67220,1,e)|0;pc=ib}else{if(oc>>>0<=q>>>0){pc=oc;break}Uw(q|0,48,oc+B|0)|0;ib=oc;while(1){Db=ib+-1|0;if(Db>>>0>q>>>0)ib=Db;else{pc=Db;break}}}while(0);Oa=K-pc|0;if(!(c[e>>2]&32))Xu(pc,(ja|0)>(Oa|0)?Oa:ja,e)|0;ib=ja-Oa|0;pb=pb+4|0;if(!(pb>>>0>>0&(ib|0)>-1)){qc=ib;break}else ja=ib}}else qc=dc;$u(e,48,qc+18|0,18,0);if(c[e>>2]&32|0)break;Xu(ic,r-ic|0,e)|0}while(0);$u(e,32,oa,vb,ka^8192);rb=(vb|0)<(oa|0)?oa:vb}else{fb=(ba&32|0)!=0;f=cb!=cb|0.0!=0.0;mb=f?0:db;xb=mb+3|0;$u(e,32,oa,xb,_);kb=c[e>>2]|0;if(!(kb&32)){Xu(eb,mb,e)|0;rc=c[e>>2]|0}else rc=kb;if(!(rc&32))Xu(f?(fb?67212:67216):fb?67204:67208,3,e)|0;$u(e,32,oa,xb,ka^8192);rb=(xb|0)<(oa|0)?oa:xb}while(0);M=rb;N=Q;O=qa;P=Ba;continue a;break}default:{Ta=P;Ua=0;Va=67168;Wa=x;Xa=za;Ya=ka}}while(0);g:do if((R|0)==63){R=0;ba=s;aa=c[ba>>2]|0;Z=c[ba+4>>2]|0;ba=Ea&32;if((aa|0)==0&(Z|0)==0){sc=x;tc=0;uc=0}else{Ia=x;xb=aa;aa=Z;do{Ia=Ia+-1|0;a[Ia>>0]=d[67152+(xb&15)>>0]|ba;xb=cx(xb|0,aa|0,4)|0;aa=D}while(!((xb|0)==0&(aa|0)==0));aa=s;sc=Ia;tc=c[aa>>2]|0;uc=c[aa+4>>2]|0}aa=(Ga&8|0)==0|(tc|0)==0&(uc|0)==0;Ja=sc;Ka=aa?0:2;La=aa?67168:67168+(Ea>>4)|0;Ma=Fa;Na=Ga;R=76}else if((R|0)==75){R=0;Ja=Zu(Ra,Sa,x)|0;Ka=Pa;La=Qa;Ma=za;Na=ka;R=76}else if((R|0)==81){R=0;aa=_u(Za,0,za)|0;xb=(aa|0)==0;Ta=Za;Ua=0;Va=67168;Wa=xb?Za+za|0:aa;Xa=xb?za:aa-Za|0;Ya=_}else if((R|0)==85){R=0;aa=$a;xb=0;ba=0;while(1){Z=c[aa>>2]|0;if(!Z){vc=xb;wc=ba;break}fb=av(v,Z)|0;if((fb|0)<0|fb>>>0>(_a-xb|0)>>>0){vc=xb;wc=fb;break}Z=fb+xb|0;if(_a>>>0>Z>>>0){aa=aa+4|0;xb=Z;ba=fb}else{vc=Z;wc=fb;break}}if((wc|0)<0){na=-1;break a}$u(e,32,oa,vc,ka);if(!vc){ab=0;R=96}else{ba=$a;xb=0;while(1){aa=c[ba>>2]|0;if(!aa){ab=vc;R=96;break g}Ia=av(v,aa)|0;xb=Ia+xb|0;if((xb|0)>(vc|0)){ab=vc;R=96;break g}if(!(c[e>>2]&32))Xu(v,Ia,e)|0;if(xb>>>0>=vc>>>0){ab=vc;R=96;break}else ba=ba+4|0}}}while(0);if((R|0)==96){R=0;$u(e,32,oa,ab,ka^8192);M=(oa|0)>(ab|0)?oa:ab;N=Q;O=qa;P=Ba;continue}if((R|0)==76){R=0;_=(Ma|0)>-1?Na&-65537:Na;ba=s;xb=(c[ba>>2]|0)!=0|(c[ba+4>>2]|0)!=0;if((Ma|0)!=0|xb){ba=(xb&1^1)+(y-Ja)|0;Ta=Ja;Ua=Ka;Va=La;Wa=x;Xa=(Ma|0)>(ba|0)?Ma:ba;Ya=_}else{Ta=x;Ua=Ka;Va=La;Wa=x;Xa=0;Ya=_}}_=Wa-Ta|0;ba=(Xa|0)<(_|0)?_:Xa;xb=ba+Ua|0;Ia=(oa|0)<(xb|0)?xb:oa;$u(e,32,Ia,xb,Ya);if(!(c[e>>2]&32))Xu(Va,Ua,e)|0;$u(e,48,Ia,xb,Ya^65536);$u(e,48,ba,_,0);if(!(c[e>>2]&32))Xu(Ta,_,e)|0;$u(e,32,Ia,xb,Ya^8192);M=Ia;N=Q;O=qa;P=Ba}h:do if((R|0)==243)if(!e)if(!O)na=0;else{Ba=1;while(1){P=c[k+(Ba<<2)>>2]|0;if(!P){xc=Ba;break}Yu(i+(Ba<<3)|0,P,g);Ba=Ba+1|0;if((Ba|0)>=10){na=1;break h}}while(1){if(c[k+(xc<<2)>>2]|0){na=-1;break h}xc=xc+1|0;if((xc|0)>=10){na=1;break}}}else na=Q;while(0);l=n;return na|0}function Wu(a){a=a|0;return 0}function Xu(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;f=e+16|0;g=c[f>>2]|0;if(!g)if(!(ev(e)|0)){h=c[f>>2]|0;i=5}else j=0;else{h=g;i=5}a:do if((i|0)==5){g=e+20|0;f=c[g>>2]|0;k=f;if((h-f|0)>>>0>>0){j=ub[c[e+36>>2]&63](e,b,d)|0;break}b:do if((a[e+75>>0]|0)>-1){f=d;while(1){if(!f){l=d;m=b;n=0;o=k;break b}p=f+-1|0;if((a[b+p>>0]|0)==10)break;else f=p}if((ub[c[e+36>>2]&63](e,b,f)|0)>>>0>>0){j=f;break a}l=d-f|0;m=b+f|0;n=f;o=c[g>>2]|0}else{l=d;m=b;n=0;o=k}while(0);_w(o|0,m|0,l|0)|0;c[g>>2]=(c[g>>2]|0)+l;j=n+l|0}while(0);return j|0}function Yu(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0.0;a:do if(b>>>0<=20)do switch(b|0){case 9:{e=(c[d>>2]|0)+(4-1)&~(4-1);f=c[e>>2]|0;c[d>>2]=e+4;c[a>>2]=f;break a;break}case 10:{f=(c[d>>2]|0)+(4-1)&~(4-1);e=c[f>>2]|0;c[d>>2]=f+4;f=a;c[f>>2]=e;c[f+4>>2]=((e|0)<0)<<31>>31;break a;break}case 11:{e=(c[d>>2]|0)+(4-1)&~(4-1);f=c[e>>2]|0;c[d>>2]=e+4;e=a;c[e>>2]=f;c[e+4>>2]=0;break a;break}case 12:{e=(c[d>>2]|0)+(8-1)&~(8-1);f=e;g=c[f>>2]|0;i=c[f+4>>2]|0;c[d>>2]=e+8;e=a;c[e>>2]=g;c[e+4>>2]=i;break a;break}case 13:{i=(c[d>>2]|0)+(4-1)&~(4-1);e=c[i>>2]|0;c[d>>2]=i+4;i=(e&65535)<<16>>16;e=a;c[e>>2]=i;c[e+4>>2]=((i|0)<0)<<31>>31;break a;break}case 14:{i=(c[d>>2]|0)+(4-1)&~(4-1);e=c[i>>2]|0;c[d>>2]=i+4;i=a;c[i>>2]=e&65535;c[i+4>>2]=0;break a;break}case 15:{i=(c[d>>2]|0)+(4-1)&~(4-1);e=c[i>>2]|0;c[d>>2]=i+4;i=(e&255)<<24>>24;e=a;c[e>>2]=i;c[e+4>>2]=((i|0)<0)<<31>>31;break a;break}case 16:{i=(c[d>>2]|0)+(4-1)&~(4-1);e=c[i>>2]|0;c[d>>2]=i+4;i=a;c[i>>2]=e&255;c[i+4>>2]=0;break a;break}case 17:{i=(c[d>>2]|0)+(8-1)&~(8-1);j=+h[i>>3];c[d>>2]=i+8;h[a>>3]=j;break a;break}case 18:{i=(c[d>>2]|0)+(8-1)&~(8-1);j=+h[i>>3];c[d>>2]=i+8;h[a>>3]=j;break a;break}default:break a}while(0);while(0);return}function Zu(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;if(c>>>0>0|(c|0)==0&b>>>0>4294967295){e=d;f=b;g=c;while(1){c=jx(f|0,g|0,10,0)|0;e=e+-1|0;a[e>>0]=c|48;c=f;f=ex(f|0,g|0,10,0)|0;if(!(g>>>0>9|(g|0)==9&c>>>0>4294967295))break;else g=D}h=f;i=e}else{h=b;i=d}if(!h)j=i;else{d=h;h=i;while(1){i=h+-1|0;a[i>>0]=(d>>>0)%10|0|48;if(d>>>0<10){j=i;break}else{d=(d>>>0)/10|0;h=i}}}return j|0}function _u(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;f=d&255;g=(e|0)!=0;a:do if(g&(b&3|0)!=0){h=d&255;i=b;j=e;while(1){if((a[i>>0]|0)==h<<24>>24){k=i;l=j;m=6;break a}n=i+1|0;o=j+-1|0;p=(o|0)!=0;if(p&(n&3|0)!=0){i=n;j=o}else{q=n;r=o;s=p;m=5;break}}}else{q=b;r=e;s=g;m=5}while(0);if((m|0)==5)if(s){k=q;l=r;m=6}else{t=q;u=0}b:do if((m|0)==6){q=d&255;if((a[k>>0]|0)==q<<24>>24){t=k;u=l}else{r=S(f,16843009)|0;c:do if(l>>>0>3){s=k;g=l;while(1){e=c[s>>2]^r;if((e&-2139062144^-2139062144)&e+-16843009|0)break;e=s+4|0;b=g+-4|0;if(b>>>0>3){s=e;g=b}else{v=e;w=b;m=11;break c}}x=s;y=g}else{v=k;w=l;m=11}while(0);if((m|0)==11)if(!w){t=v;u=0;break}else{x=v;y=w}while(1){if((a[x>>0]|0)==q<<24>>24){t=x;u=y;break b}r=x+1|0;y=y+-1|0;if(!y){t=r;u=0;break}else x=r}}}while(0);return (u|0?t:0)|0}function $u(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0;g=l;l=l+256|0;if((l|0)>=(m|0))$(256);h=g;do if((d|0)>(e|0)&(f&73728|0)==0){i=d-e|0;Uw(h|0,b|0,(i>>>0>256?256:i)|0)|0;j=c[a>>2]|0;k=(j&32|0)==0;if(i>>>0>255){n=d-e|0;o=i;p=j;j=k;while(1){if(j){Xu(h,256,a)|0;q=c[a>>2]|0}else q=p;o=o+-256|0;j=(q&32|0)==0;if(o>>>0<=255)break;else p=q}if(j)r=n&255;else break}else if(k)r=i;else break;Xu(h,r,a)|0}while(0);l=g;return}function av(a,b){a=a|0;b=b|0;var c=0;if(!a)c=0;else c=dv(a,b,0)|0;return c|0}function bv(a,b){a=+a;b=b|0;return +(+cv(a,b))}function cv(a,b){a=+a;b=b|0;var d=0,e=0,f=0,g=0.0,i=0.0,k=0,l=0.0;h[j>>3]=a;d=c[j>>2]|0;e=c[j+4>>2]|0;f=cx(d|0,e|0,52)|0;switch(f&2047){case 0:{if(a!=0.0){g=+cv(a*18446744073709551616.0,b);i=g;k=(c[b>>2]|0)+-64|0}else{i=a;k=0}c[b>>2]=k;l=i;break}case 2047:{l=a;break}default:{c[b>>2]=(f&2047)+-1022;c[j>>2]=d;c[j+4>>2]=e&-2146435073|1071644672;l=+h[j>>3]}}return +l}function dv(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;do if(b){if(d>>>0<128){a[b>>0]=d;f=1;break}if(d>>>0<2048){a[b>>0]=d>>>6|192;a[b+1>>0]=d&63|128;f=2;break}if(d>>>0<55296|(d&-8192|0)==57344){a[b>>0]=d>>>12|224;a[b+1>>0]=d>>>6&63|128;a[b+2>>0]=d&63|128;f=3;break}if((d+-65536|0)>>>0<1048576){a[b>>0]=d>>>18|240;a[b+1>>0]=d>>>12&63|128;a[b+2>>0]=d>>>6&63|128;a[b+3>>0]=d&63|128;f=4;break}else{c[(xu()|0)>>2]=84;f=-1;break}}else f=1;while(0);return f|0}function ev(b){b=b|0;var d=0,e=0,f=0;d=b+74|0;e=a[d>>0]|0;a[d>>0]=e+255|e;e=c[b>>2]|0;if(!(e&8)){c[b+8>>2]=0;c[b+4>>2]=0;d=c[b+44>>2]|0;c[b+28>>2]=d;c[b+20>>2]=d;c[b+16>>2]=d+(c[b+48>>2]|0);f=0}else{c[b>>2]=e|32;f=-1}return f|0}function fv(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=a+20|0;f=c[e>>2]|0;g=(c[a+16>>2]|0)-f|0;a=g>>>0>d>>>0?d:g;_w(f|0,b|0,a|0)|0;c[e>>2]=(c[e>>2]|0)+a;return d|0}function gv(a){a=a|0;var b=0;b=(Mu(a)|0)==0;return (b?a:a&95)|0}function hv(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;d=b;a:do if(!(d&3)){e=b;f=4}else{g=b;h=d;while(1){if(!(a[g>>0]|0)){i=h;break a}j=g+1|0;h=j;if(!(h&3)){e=j;f=4;break}else g=j}}while(0);if((f|0)==4){f=e;while(1){k=c[f>>2]|0;if(!((k&-2139062144^-2139062144)&k+-16843009))f=f+4|0;else break}if(!((k&255)<<24>>24))l=f;else{k=f;while(1){f=k+1|0;if(!(a[f>>0]|0)){l=f;break}else k=f}}i=l}return i-d|0}function iv(a){a=a|0;return ((a|0)==223|(Iu(a)|0)!=(a|0))&1|0}function jv(a){a=a|0;var b=0;if(a>>>0>=255)if((a+-57344|0)>>>0<8185|(a>>>0<8232|(a+-8234|0)>>>0<47062))b=1;else return ((a+-65532|0)>>>0>1048579|(a&65534|0)==65534)&1^1|0;else b=(a+1&127)>>>0>32&1;return b|0}function kv(a,b){a=a|0;b=b|0;var c=0;do switch(b|0){case 1:{c=lv(a)|0;break}case 2:{c=Lu(a)|0;break}case 3:{c=Du(a)|0;break}case 4:{c=mv(a)|0;break}case 5:{c=nv(a)|0;break}case 6:{c=ov(a)|0;break}case 7:{c=iv(a)|0;break}case 8:{c=jv(a)|0;break}case 9:{c=pv(a)|0;break}case 10:{c=Ou(a)|0;break}case 11:{c=qv(a)|0;break}case 12:{c=rv(a)|0;break}default:c=0}while(0);return c|0}function lv(a){a=a|0;var b=0;if(!(nv(a)|0))b=(Lu(a)|0)!=0;else b=1;return b&1|0}function mv(a){a=a|0;var b=0;if((a&-2|0)==8232|(a>>>0<32|(a+-127|0)>>>0<33))b=1;else b=(a+-65529|0)>>>0<3;return b&1|0}function nv(a){a=a|0;return (a+-48|0)>>>0<10|0}function ov(a){a=a|0;var b=0;if(!(Ou(a)|0))b=(jv(a)|0)!=0;else b=0;return b&1|0}function pv(a){a=a|0;var b=0;if(a>>>0<131072)b=(d[67222+((d[67222+(a>>>8)>>0]|0)<<5|a>>>3&31)>>0]|0)>>>(a&7)&1;else b=0;return b|0}function qv(a){a=a|0;return (Ju(a)|0)!=(a|0)|0}function rv(a){a=a|0;return ((a+-48|0)>>>0<10|((a|32)+-97|0)>>>0<6)&1|0}function sv(b,c){b=b|0;c=c|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;e=a[b>>0]|0;a:do if(!(e<<24>>24)){f=c;g=0}else{h=b;i=c;j=e&255;k=e;while(1){l=a[i>>0]|0;if(!(l<<24>>24)){f=i;g=k;break a}if(k<<24>>24!=l<<24>>24?(m=Gu(j)|0,(m|0)!=(Gu(l&255)|0)):0){f=i;g=k;break a}h=h+1|0;l=i+1|0;m=a[h>>0]|0;if(!(m<<24>>24)){f=l;g=0;break}else{i=l;j=m&255;k=m}}}while(0);e=Gu(g&255)|0;return e-(Gu(d[f>>0]|0)|0)|0}function tv(a,b){a=a|0;b=b|0;uv(a,b)|0;return a|0}function uv(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;e=d;a:do if(!((e^b)&3)){if(!(e&3)){f=d;g=b}else{h=d;i=b;while(1){j=a[h>>0]|0;a[i>>0]=j;if(!(j<<24>>24)){k=i;break a}j=h+1|0;l=i+1|0;if(!(j&3)){f=j;g=l;break}else{h=j;i=l}}}i=c[f>>2]|0;if(!((i&-2139062144^-2139062144)&i+-16843009)){h=g;l=f;j=i;while(1){i=l+4|0;m=h+4|0;c[h>>2]=j;j=c[i>>2]|0;if((j&-2139062144^-2139062144)&j+-16843009|0){n=i;o=m;break}else{h=m;l=i}}}else{n=f;o=g}p=n;q=o;r=8}else{p=d;q=b;r=8}while(0);if((r|0)==8){r=a[p>>0]|0;a[q>>0]=r;if(!(r<<24>>24))k=q;else{r=q;q=p;while(1){q=q+1|0;p=r+1|0;b=a[q>>0]|0;a[p>>0]=b;if(!(b<<24>>24)){k=p;break}else r=p}}}return k|0}function vv(a){a=a|0;return ((a|0)==32|(a+-9|0)>>>0<5)&1|0}function wv(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=xv(a,b,c,-1,0)|0;return d|0}function xv(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;g=l;l=l+112|0;if((l|0)>=(m|0))$(112);h=g;c[h>>2]=0;i=h+4|0;c[i>>2]=a;c[h+44>>2]=a;j=h+8|0;c[j>>2]=(a|0)<0?-1:a+2147483647|0;c[h+76>>2]=-1;yv(h,0);k=zv(h,d,1,e,f)|0;if(b|0)c[b>>2]=a+((c[i>>2]|0)+(c[h+108>>2]|0)-(c[j>>2]|0));l=g;return k|0}function yv(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;c[a+104>>2]=b;d=c[a+8>>2]|0;e=c[a+4>>2]|0;f=d-e|0;c[a+108>>2]=f;if((b|0)!=0&(f|0)>(b|0))c[a+100>>2]=e+b;else c[a+100>>2]=d;return}function zv(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0;a:do if(e>>>0>36){c[(xu()|0)>>2]=22;i=0;j=0}else{k=b+4|0;l=b+100|0;do{m=c[k>>2]|0;if(m>>>0<(c[l>>2]|0)>>>0){c[k>>2]=m+1;n=d[m>>0]|0}else n=Av(b)|0}while((vv(n)|0)!=0);b:do switch(n|0){case 43:case 45:{m=((n|0)==45)<<31>>31;o=c[k>>2]|0;if(o>>>0<(c[l>>2]|0)>>>0){c[k>>2]=o+1;p=m;q=d[o>>0]|0;break b}else{p=m;q=Av(b)|0;break b}break}default:{p=0;q=n}}while(0);m=(e|0)==0;do if((e|16|0)==16&(q|0)==48){o=c[k>>2]|0;if(o>>>0<(c[l>>2]|0)>>>0){c[k>>2]=o+1;r=d[o>>0]|0}else r=Av(b)|0;if((r|32|0)!=120)if(m){s=r;t=8;u=46;break}else{v=r;w=e;u=32;break}o=c[k>>2]|0;if(o>>>0<(c[l>>2]|0)>>>0){c[k>>2]=o+1;x=d[o>>0]|0}else x=Av(b)|0;if((d[70391+x>>0]|0)>15){o=(c[l>>2]|0)==0;if(!o)c[k>>2]=(c[k>>2]|0)+-1;if(!f){yv(b,0);i=0;j=0;break a}if(o){i=0;j=0;break a}c[k>>2]=(c[k>>2]|0)+-1;i=0;j=0;break a}else{s=x;t=16;u=46}}else{o=m?10:e;if((d[70391+q>>0]|0)>>>0>>0){v=q;w=o;u=32}else{if(c[l>>2]|0)c[k>>2]=(c[k>>2]|0)+-1;yv(b,0);c[(xu()|0)>>2]=22;i=0;j=0;break a}}while(0);if((u|0)==32)if((w|0)==10){m=v+-48|0;if(m>>>0<10){o=0;y=m;do{o=(o*10|0)+y|0;m=c[k>>2]|0;if(m>>>0<(c[l>>2]|0)>>>0){c[k>>2]=m+1;z=d[m>>0]|0}else z=Av(b)|0;y=z+-48|0}while(y>>>0<10&o>>>0<429496729);A=z;B=o;C=0}else{A=v;B=0;C=0}y=A+-48|0;if(y>>>0<10){m=A;E=B;F=C;G=y;while(1){y=gx(E|0,F|0,10,0)|0;H=D;I=((G|0)<0)<<31>>31;J=~I;if(H>>>0>J>>>0|(H|0)==(J|0)&y>>>0>~G>>>0){K=m;L=G;M=E;N=F;break}J=Ww(y|0,H|0,G|0,I|0)|0;I=D;H=c[k>>2]|0;if(H>>>0<(c[l>>2]|0)>>>0){c[k>>2]=H+1;O=d[H>>0]|0}else O=Av(b)|0;H=O+-48|0;if(H>>>0<10&(I>>>0<429496729|(I|0)==429496729&J>>>0<2576980378)){m=O;E=J;F=I;G=H}else{K=O;L=H;M=J;N=I;break}}if(L>>>0>9){P=p;Q=N;R=M}else{T=10;U=K;V=M;W=N;u=72}}else{P=p;Q=C;R=B}}else{s=v;t=w;u=46}c:do if((u|0)==46){if(!(t+-1&t)){G=a[70647+((t*23|0)>>>5&7)>>0]|0;F=a[70391+s>>0]|0;E=F&255;if(E>>>0>>0){m=0;o=E;do{m=o|m<>2]|0;if(E>>>0<(c[l>>2]|0)>>>0){c[k>>2]=E+1;X=d[E>>0]|0}else X=Av(b)|0;Y=a[70391+X>>0]|0;o=Y&255}while(m>>>0<134217728&o>>>0>>0);Z=X;_=Y;$=0;aa=m}else{Z=s;_=F;$=0;aa=0}o=cx(-1,-1,G|0)|0;E=D;if((_&255)>>>0>=t>>>0|($>>>0>E>>>0|($|0)==(E|0)&aa>>>0>o>>>0)){T=t;U=Z;V=aa;W=$;u=72;break}else{ba=aa;ca=$;da=_}while(1){I=ix(ba|0,ca|0,G|0)|0;J=D;H=da&255|I;I=c[k>>2]|0;if(I>>>0<(c[l>>2]|0)>>>0){c[k>>2]=I+1;ea=d[I>>0]|0}else ea=Av(b)|0;da=a[70391+ea>>0]|0;if((da&255)>>>0>=t>>>0|(J>>>0>E>>>0|(J|0)==(E|0)&H>>>0>o>>>0)){T=t;U=ea;V=H;W=J;u=72;break c}else{ba=H;ca=J}}}o=a[70391+s>>0]|0;E=o&255;if(E>>>0>>0){G=0;F=E;do{G=F+(S(G,t)|0)|0;E=c[k>>2]|0;if(E>>>0<(c[l>>2]|0)>>>0){c[k>>2]=E+1;fa=d[E>>0]|0}else fa=Av(b)|0;ga=a[70391+fa>>0]|0;F=ga&255}while(G>>>0<119304647&F>>>0>>0);ha=fa;ia=ga;ja=G;ka=0}else{ha=s;ia=o;ja=0;ka=0}if((ia&255)>>>0>>0){F=ex(-1,-1,t|0,0)|0;E=D;m=ha;J=ka;H=ja;I=ia;while(1){if(J>>>0>E>>>0|(J|0)==(E|0)&H>>>0>F>>>0){T=t;U=m;V=H;W=J;u=72;break c}y=gx(H|0,J|0,t|0,0)|0;la=D;ma=I&255;if(la>>>0>4294967295|(la|0)==-1&y>>>0>~ma>>>0){T=t;U=m;V=H;W=J;u=72;break c}na=Ww(ma|0,0,y|0,la|0)|0;la=D;y=c[k>>2]|0;if(y>>>0<(c[l>>2]|0)>>>0){c[k>>2]=y+1;oa=d[y>>0]|0}else oa=Av(b)|0;I=a[70391+oa>>0]|0;if((I&255)>>>0>=t>>>0){T=t;U=oa;V=na;W=la;u=72;break}else{m=oa;J=la;H=na}}}else{T=t;U=ha;V=ja;W=ka;u=72}}while(0);if((u|0)==72)if((d[70391+U>>0]|0)>>>0>>0){do{H=c[k>>2]|0;if(H>>>0<(c[l>>2]|0)>>>0){c[k>>2]=H+1;pa=d[H>>0]|0}else pa=Av(b)|0}while((d[70391+pa>>0]|0)>>>0>>0);c[(xu()|0)>>2]=34;P=(g&1|0)==0&0==0?p:0;Q=h;R=g}else{P=p;Q=W;R=V}if(c[l>>2]|0)c[k>>2]=(c[k>>2]|0)+-1;if(!(Q>>>0>>0|(Q|0)==(h|0)&R>>>0>>0)){if(!((g&1|0)!=0|0!=0|(P|0)!=0)){c[(xu()|0)>>2]=34;H=Ww(g|0,h|0,-1,-1)|0;i=D;j=H;break}if(Q>>>0>h>>>0|(Q|0)==(h|0)&R>>>0>g>>>0){c[(xu()|0)>>2]=34;i=h;j=g;break}}H=((P|0)<0)<<31>>31;J=Tw(R^P|0,Q^H|0,P|0,H|0)|0;i=D;j=J}while(0);D=i;return j|0}function Av(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;e=b+104|0;f=c[e>>2]|0;if((f|0)!=0?(c[b+108>>2]|0)>=(f|0):0)g=4;else{f=Bv(b)|0;if((f|0)>=0){h=c[e>>2]|0;e=c[b+8>>2]|0;if(h){i=c[b+4>>2]|0;j=h-(c[b+108>>2]|0)|0;h=e;if((e-i|0)<(j|0)){k=h;g=9}else{c[b+100>>2]=i+(j+-1);l=h}}else{k=e;g=9}if((g|0)==9){c[b+100>>2]=e;l=k}k=b+4|0;if(!l)m=c[k>>2]|0;else{e=c[k>>2]|0;k=b+108|0;c[k>>2]=l+1-e+(c[k>>2]|0);m=e}e=m+-1|0;if((d[e>>0]|0|0)==(f|0))n=f;else{a[e>>0]=f;n=f}}else g=4}if((g|0)==4){c[b+100>>2]=0;n=-1}return n|0}function Bv(a){a=a|0;var b=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=b;if((c[a+8>>2]|0)==0?(Cv(a)|0)!=0:0)f=-1;else if((ub[c[a+32>>2]&63](a,e,1)|0)==1)f=d[e>>0]|0;else f=-1;l=b;return f|0}function Cv(b){b=b|0;var d=0,e=0,f=0;d=b+74|0;e=a[d>>0]|0;a[d>>0]=e+255|e;e=b+20|0;d=b+44|0;if((c[e>>2]|0)>>>0>(c[d>>2]|0)>>>0)ub[c[b+36>>2]&63](b,0,0)|0;c[b+16>>2]=0;c[b+28>>2]=0;c[e>>2]=0;e=c[b>>2]|0;if(e&20)if(!(e&4))f=-1;else{c[b>>2]=e|32;f=-1}else{e=c[d>>2]|0;c[b+8>>2]=e;c[b+4>>2]=e;f=0}return f|0}function Dv(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e;c[f>>2]=d;d=Ev(a,b,f)|0;l=e;return d|0}function Ev(a,b,c){a=a|0;b=b|0;c=c|0;return Tu(a,2147483647,b,c)|0}function Fv(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e;c[f>>2]=d;d=Uu(a,b,f)|0;l=e;return d|0}function Gv(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;if((c[f+76>>2]|0)>-1)g=Wu(f)|0;else g=0;h=e+-1|0;if((e|0)<2){e=f+74|0;i=a[e>>0]|0;a[e>>0]=i+255|i;if(g|0)Au(f);if(!h){a[b>>0]=0;j=b}else j=0}else{a:do if(h){i=f+4|0;e=f+8|0;k=h;l=b;while(1){m=c[i>>2]|0;n=m;o=(c[e>>2]|0)-n|0;p=_u(m,10,o)|0;q=(p|0)==0;r=q?o:1-n+p|0;p=r>>>0>>0?r:k;_w(l|0,m|0,p|0)|0;m=(c[i>>2]|0)+p|0;c[i>>2]=m;s=l+p|0;r=k-p|0;if(!(q&(r|0)!=0)){t=s;u=17;break a}if(m>>>0>=(c[e>>2]|0)>>>0){q=Bv(f)|0;if((q|0)<0)break;else v=q}else{c[i>>2]=m+1;v=d[m>>0]|0}k=r+-1|0;r=s+1|0;a[s>>0]=v;if(!((k|0)!=0&(v&255|0)!=10)){t=r;u=17;break a}else l=r}if((s|0)!=(b|0)?(c[f>>2]&16|0)!=0:0){t=s;u=17}else w=0}else{t=b;u=17}while(0);if((u|0)==17)if(!b)w=0;else{a[t>>0]=0;w=b}if(!g)j=w;else{Au(f);j=w}}return j|0}function Hv(b,c,e){b=b|0;c=c|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;if(!e)f=0;else{g=a[b>>0]|0;a:do if(!(g<<24>>24)){h=c;i=0}else{j=b;k=e;l=c;m=g;while(1){k=k+-1|0;n=a[l>>0]|0;if(!(m<<24>>24==n<<24>>24&((k|0)!=0&n<<24>>24!=0))){h=l;i=m;break a}j=j+1|0;n=l+1|0;m=a[j>>0]|0;if(!(m<<24>>24)){h=n;i=0;break}else l=n}}while(0);f=(i&255)-(d[h>>0]|0)|0}return f|0}function Iv(a){a=a|0;return ax(a|0)|0}function Jv(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;a:do if(!d)e=0;else{f=b;g=d;h=c;while(1){i=a[f>>0]|0;j=a[h>>0]|0;if(i<<24>>24!=j<<24>>24)break;g=g+-1|0;if(!g){e=0;break a}else{f=f+1|0;h=h+1|0}}e=(i&255)-(j&255)|0}while(0);return e|0}function Kv(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=hb(6,d|0)|0;d=wu((a|0)==-4?-115:a)|0;l=b;return d|0}function Lv(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;e=l;l=l+192|0;if((l|0)>=(m|0))$(192);f=e+152|0;g=e+136|0;h=e+120|0;i=e+104|0;j=e+96|0;k=e+80|0;n=e+64|0;o=e+48|0;p=e+32|0;q=e+16|0;r=e;s=e+176|0;t=e+168|0;c[s>>2]=d;d=(c[s>>2]|0)+(4-1)&~(4-1);u=c[d>>2]|0;c[s>>2]=d+4;d=(b|0)==4?u|32768:u;a:do switch(b|0){case 14:{c[r>>2]=a;c[r+4>>2]=14;c[r+8>>2]=d;v=wu(xa(221,r|0)|0)|0;break}case 9:{c[q>>2]=a;c[q+4>>2]=16;c[q+8>>2]=t;u=xa(221,q|0)|0;switch(u|0){case -22:{c[p>>2]=a;c[p+4>>2]=9;c[p+8>>2]=d;w=xa(221,p|0)|0;break}case 0:{s=c[t+4>>2]|0;w=(c[t>>2]|0)==2?0-s|0:s;break}default:w=wu(u)|0}v=w;break}case 1030:{c[o>>2]=a;c[o+4>>2]=1030;c[o+8>>2]=d;u=xa(221,o|0)|0;if((u|0)!=-22){if((u|0)>-1){c[n>>2]=u;c[n+4>>2]=2;c[n+8>>2]=1;xa(221,n|0)|0}v=wu(u)|0;break a}c[k>>2]=a;c[k+4>>2]=1030;c[k+8>>2]=0;u=xa(221,k|0)|0;if((u|0)==-22){c[i>>2]=a;c[i+4>>2]=0;c[i+8>>2]=d;s=xa(221,i|0)|0;if((s|0)>-1){c[h>>2]=s;c[h+4>>2]=2;c[h+8>>2]=1;xa(221,h|0)|0}v=wu(s)|0;break a}else{if((u|0)>-1){c[j>>2]=u;hb(6,j|0)|0}v=wu(-22)|0;break a}break}default:if((b+-12|0)>>>0<5){c[g>>2]=a;c[g+4>>2]=b;c[g+8>>2]=d;v=wu(xa(221,g|0)|0)|0;break a}else{c[f>>2]=a;c[f+4>>2]=b;c[f+8>>2]=d;v=wu(xa(221,f|0)|0)|0;break a}}while(0);l=e;return v|0}function Mv(a){a=a|0;return ax(a|0)|0}function Nv(a,b,c){a=a|0;b=b|0;c=c|0;Ov(a,b,c)|0;return a|0}function Ov(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;f=d;do if(!((f^b)&3)){g=(e|0)!=0;a:do if(g&(f&3|0)!=0){h=e;i=d;j=b;while(1){k=a[i>>0]|0;a[j>>0]=k;if(!(k<<24>>24)){l=h;m=i;n=j;break a}k=h+-1|0;o=i+1|0;p=j+1|0;q=(k|0)!=0;if(q&(o&3|0)!=0){h=k;i=o;j=p}else{r=k;s=o;t=p;u=q;v=5;break}}}else{r=e;s=d;t=b;u=g;v=5}while(0);if((v|0)==5)if(u){l=r;m=s;n=t}else{w=t;x=0;break}if(!(a[m>>0]|0)){w=n;x=l}else{b:do if(l>>>0>3){g=n;j=m;i=l;while(1){h=c[j>>2]|0;if((h&-2139062144^-2139062144)&h+-16843009|0){y=j;z=g;A=i;break b}c[g>>2]=h;h=i+-4|0;q=j+4|0;p=g+4|0;if(h>>>0>3){g=p;j=q;i=h}else{y=q;z=p;A=h;break}}}else{y=m;z=n;A=l}while(0);B=y;C=z;D=A;v=11}}else{B=d;C=b;D=e;v=11}while(0);c:do if((v|0)==11)if(!D){w=C;x=0}else{e=B;b=C;d=D;while(1){A=a[e>>0]|0;a[b>>0]=A;if(!(A<<24>>24)){w=b;x=d;break c}d=d+-1|0;A=b+1|0;if(!d){w=A;x=0;break}else{e=e+1|0;b=A}}}while(0);Uw(w|0,0,x|0)|0;return w|0}function Pv(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+16|0;g=e;if(_u(70656,a[d>>0]|0,4)|0){h=Tv(d)|0|32768;c[g>>2]=b;c[g+4>>2]=h;c[g+8>>2]=438;h=wu(ib(5,g|0)|0)|0;if((h|0)>=0){g=Uv(h,d)|0;if(!g){c[f>>2]=h;hb(6,f|0)|0;i=0}else i=g}else i=0}else{c[(xu()|0)>>2]=22;i=0}l=e;return i|0}function Qv(a){a=a|0;var b=0,d=0,e=0,f=0;b=(c[a>>2]&1|0)!=0;if(!b){gb(71276);d=c[a+52>>2]|0;e=a+56|0;if(d|0)c[d+56>>2]=c[e>>2];f=c[e>>2]|0;if(f|0)c[f+52>>2]=d;if((c[17818]|0)==(a|0))c[17818]=f;cb(71276)}f=Rv(a)|0;d=yb[c[a+12>>2]&15](a)|0|f;f=c[a+92>>2]|0;if(f|0)Lw(f);if(!b)Lw(a);return d|0}function Rv(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;do if(a){if((c[a+76>>2]|0)<=-1){b=Sv(a)|0;break}d=(Wu(a)|0)==0;e=Sv(a)|0;if(d)b=e;else{Au(a);b=e}}else{if(!(c[3976]|0))f=0;else f=Rv(c[3976]|0)|0;gb(71276);e=c[17818]|0;if(!e)g=f;else{d=e;e=f;while(1){if((c[d+76>>2]|0)>-1)h=Wu(d)|0;else h=0;if((c[d+20>>2]|0)>>>0>(c[d+28>>2]|0)>>>0)i=Sv(d)|0|e;else i=e;if(h|0)Au(d);d=c[d+56>>2]|0;if(!d){g=i;break}else e=i}}cb(71276);b=g}while(0);return b|0}function Sv(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;b=a+20|0;d=a+28|0;if((c[b>>2]|0)>>>0>(c[d>>2]|0)>>>0?(ub[c[a+36>>2]&63](a,0,0)|0,(c[b>>2]|0)==0):0)e=-1;else{f=a+4|0;g=c[f>>2]|0;h=a+8|0;i=c[h>>2]|0;if(g>>>0>>0)ub[c[a+40>>2]&63](a,g-i|0,1)|0;c[a+16>>2]=0;c[d>>2]=0;c[b>>2]=0;c[h>>2]=0;c[f>>2]=0;e=0}return e|0}function Tv(b){b=b|0;var c=0,d=0,e=0,f=0;c=(Vv(b,43)|0)==0;d=a[b>>0]|0;e=c?d<<24>>24!=114&1:2;c=(Vv(b,120)|0)==0;f=c?e:e|128;e=(Vv(b,101)|0)==0;b=e?f:f|524288;f=d<<24>>24==114?b:b|64;b=d<<24>>24==119?f|512:f;return (d<<24>>24==97?b|1024:b)|0}function Uv(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;e=l;l=l+112|0;if((l|0)>=(m|0))$(112);f=e+40|0;g=e+24|0;h=e+16|0;i=e;j=e+52|0;k=a[d>>0]|0;if(_u(70656,k<<24>>24,4)|0){n=Kw(1144)|0;if(!n)o=0;else{p=n;q=p+112|0;do{c[p>>2]=0;p=p+4|0}while((p|0)<(q|0));if(!(Vv(d,43)|0))c[n>>2]=k<<24>>24==114?8:4;if(!(Vv(d,101)|0))r=k;else{c[i>>2]=b;c[i+4>>2]=2;c[i+8>>2]=1;xa(221,i|0)|0;r=a[d>>0]|0}if(r<<24>>24==97){c[h>>2]=b;c[h+4>>2]=3;r=xa(221,h|0)|0;if(!(r&1024)){c[g>>2]=b;c[g+4>>2]=4;c[g+8>>2]=r|1024;xa(221,g|0)|0}g=c[n>>2]|128;c[n>>2]=g;s=g}else s=c[n>>2]|0;c[n+60>>2]=b;c[n+44>>2]=n+120;c[n+48>>2]=1024;g=n+75|0;a[g>>0]=-1;if((s&8|0)==0?(c[f>>2]=b,c[f+4>>2]=21505,c[f+8>>2]=j,(bb(54,f|0)|0)==0):0)a[g>>0]=10;c[n+32>>2]=35;c[n+36>>2]=25;c[n+40>>2]=24;c[n+12>>2]=10;if(!(c[17813]|0))c[n+76>>2]=-1;gb(71276);g=c[17818]|0;c[n+56>>2]=g;if(g|0)c[g+52>>2]=n;c[17818]=n;cb(71276);o=n}}else{c[(xu()|0)>>2]=22;o=0}l=e;return o|0}function Vv(b,c){b=b|0;c=c|0;var d=0;d=Wv(b,c)|0;return ((a[d>>0]|0)==(c&255)<<24>>24?d:0)|0}function Wv(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;e=d&255;a:do if(!e)f=b+(hv(b)|0)|0;else{if(!(b&3))g=b;else{h=d&255;i=b;while(1){j=a[i>>0]|0;if(j<<24>>24==0?1:j<<24>>24==h<<24>>24){f=i;break a}j=i+1|0;if(!(j&3)){g=j;break}else i=j}}i=S(e,16843009)|0;h=c[g>>2]|0;b:do if(!((h&-2139062144^-2139062144)&h+-16843009)){j=g;k=h;while(1){l=k^i;if((l&-2139062144^-2139062144)&l+-16843009|0){m=j;break b}l=j+4|0;k=c[l>>2]|0;if((k&-2139062144^-2139062144)&k+-16843009|0){m=l;break}else j=l}}else m=g;while(0);i=d&255;h=m;while(1){j=a[h>>0]|0;if(j<<24>>24==0?1:j<<24>>24==i<<24>>24){f=h;break}else h=h+1|0}}while(0);return f|0}function Xv(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0;g=l;l=l+16|0;if((l|0)>=(m|0))$(16);h=g;a:do if(!e)i=0;else{do if(f|0){j=(b|0)==0?h:b;k=a[e>>0]|0;n=k&255;if(k<<24>>24>-1){c[j>>2]=n;i=k<<24>>24!=0&1;break a}k=n+-194|0;if(k>>>0<=50){n=e+1|0;o=c[16024+(k<<2)>>2]|0;if(f>>>0<4?o&-2147483648>>>((f*6|0)+-6|0)|0:0)break;k=d[n>>0]|0;n=k>>>3;if((n+-16|n+(o>>26))>>>0<=7){n=k+-128|o<<6;if((n|0)>=0){c[j>>2]=n;i=2;break a}o=(d[e+2>>0]|0)+-128|0;if(o>>>0<=63){k=o|n<<6;if((k|0)>=0){c[j>>2]=k;i=3;break a}n=(d[e+3>>0]|0)+-128|0;if(n>>>0<=63){c[j>>2]=n|k<<6;i=4;break a}}}}}while(0);c[(xu()|0)>>2]=84;i=-1}while(0);l=g;return i|0}function Yv(a,b){a=a|0;b=b|0;return (Zv(a,hv(a)|0,1,b)|0)+-1|0}function Zv(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=S(d,b)|0;if((c[e+76>>2]|0)>-1){g=(Wu(e)|0)==0;h=Xu(a,f,e)|0;if(g)i=h;else{Au(e);i=h}}else i=Xu(a,f,e)|0;if((i|0)==(f|0))j=d;else j=(i>>>0)/(b>>>0)|0;return j|0}function _v(){var a=0,b=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=Da(20,a|0)|0;l=a;return b|0}function $v(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d;c[e>>2]=a;c[e+4>>2]=b;b=wu(ab(33,e|0)|0)|0;l=d;return b|0}function aw(a){a=a|0;var b=0,d=0,e=0;if((c[a+76>>2]|0)>-1){b=(Wu(a)|0)==0;d=(c[a>>2]|0)>>>4&1;if(b)e=d;else e=d}else e=(c[a>>2]|0)>>>4&1;return e|0}function bw(b,c){b=b|0;c=c|0;var d=0,e=0,f=0;d=b;e=70660;f=d+15|0;do{a[d>>0]=a[e>>0]|0;d=d+1|0;e=e+1|0}while((d|0)<(f|0));if(!c){a[b+14>>0]=48;a[b+15>>0]=0}else{e=c;d=14;while(1){d=d+1|0;if(e>>>0<10)break;else e=(e>>>0)/10|0}a[b+d>>0]=0;e=c;c=d;while(1){c=c+-1|0;a[b+c>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}}return}function cw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;d=l;l=l+48|0;if((l|0)>=(m|0))$(48);e=d+40|0;f=d+8|0;g=d;c[g>>2]=a;c[g+4>>2]=b;h=Na(197,g|0)|0;if((h|0)==-9?(c[f>>2]=a,c[f+4>>2]=1,(xa(221,f|0)|0)>=0):0){bw(f,a);c[e>>2]=f;c[e+4>>2]=b;i=wu(Oa(195,e|0)|0)|0}else i=wu(h)|0;l=d;return i|0}function dw(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g;c[h>>2]=a;c[h+4>>2]=b;c[h+8>>2]=d;c[h+12>>2]=e;c[h+16>>2]=f;f=wu(qb(142,h|0)|0)|0;l=g;return f|0}function ew(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e;c[f>>2]=a;c[f+4>>2]=b;c[f+8>>2]=d;d=wu(jb(4,f|0)|0)|0;l=e;return d|0}function fw(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e;c[f>>2]=a;c[f+4>>2]=b;c[f+8>>2]=d;d=wu(eb(3,f|0)|0)|0;l=e;return d|0}function gw(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e;g=e+16|0;c[g>>2]=d;d=(c[g>>2]|0)+(4-1)&~(4-1);h=c[d>>2]|0;c[g>>2]=d+4;c[f>>2]=a;c[f+4>>2]=b|32768;c[f+8>>2]=h;h=wu(ib(5,f|0)|0)|0;l=e;return h|0}function hw(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f;c[g>>2]=b;c[g+4>>2]=d;c[g+8>>2]=e;c[g+12>>2]=a;e=g+16|0;c[e>>2]=0;d=g+20|0;c[d>>2]=0;switch(a|0){case 208:case 203:case 213:{c[e>>2]=1;break}default:{}}jw(8,g);g=c[d>>2]|0;if(!g)h=0;else{c[(xu()|0)>>2]=g;h=-1}l=f;return h|0}function iw(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=l;l=l+32|0;if((l|0)>=(m|0))$(32);d=b+16|0;e=b;f=a+20|0;do if(!(c[f>>2]|0)){if((c[a+16>>2]|0?(g=c[a>>2]|0,(g|0)>-1):0)?(g|0)!=(kw()|0):0){c[d>>2]=c[178];c[d+4>>2]=c[179];c[d+8>>2]=c[180];c[d+12>>2]=c[181];lw(6,e)|0;g=mw(6,d)|0;c[f>>2]=0-g;if(!((g|0)!=0?(c[17816]|0)!=0:0)){c[f>>2]=1;mw(6,e)|0}break}c[f>>2]=1}while(0);l=b;return}function jw(a,b){a=a|0;b=b|0;wb[a&15](b);return}function kw(){var a=0,b=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=Qa(199,a|0)|0;l=a;return b|0}function lw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d;g=d+24|0;c[f>>2]=0;c[f+4>>2]=a;c[f+8>>2]=0;c[f+12>>2]=b;h=wu(fb(340,f|0)|0)|0;if(!h){f=b;if((c[f>>2]|0)==-1?(c[f+4>>2]|0)==-1:0){f=b;c[f>>2]=-1;c[f+4>>2]=-1}f=b+8|0;i=f;if((c[i>>2]|0)==-1?(c[i+4>>2]|0)==-1:0){i=f;c[i>>2]=-1;c[i+4>>2]=-1;j=0}else j=0}else if((c[(xu()|0)>>2]|0)==38){c[e>>2]=a;c[e+4>>2]=g;if((wu(Ma(191,e|0)|0)|0)>=0){e=c[g>>2]|0;a=(e|0)==-1;i=b;c[i>>2]=a?-1:e;c[i+4>>2]=a?-1:0;i=c[g+4>>2]|0;g=(i|0)==-1;e=b+8|0;f=e;c[f>>2]=g?-1:i;c[f+4>>2]=g?-1:0;if(a){a=b;c[a>>2]=-1;c[a+4>>2]=-1}if(g){g=e;c[g>>2]=-1;c[g+4>>2]=-1;j=0}else j=0}else j=-1}else j=h;l=d;return j|0}function mw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d;g=d+24|0;c[f>>2]=0;c[f+4>>2]=a;c[f+8>>2]=b;c[f+12>>2]=0;h=fb(340,f|0)|0;if((h|0)==-38){f=b;i=c[f>>2]|0;j=c[f+4>>2]|0;f=j>>>0<0|(j|0)==0&i>>>0<4294967295;j=f?i:-1;c[g>>2]=j;j=b+8|0;b=c[j>>2]|0;i=c[j+4>>2]|0;j=i>>>0<0|(i|0)==0&b>>>0<4294967295;i=j?b:-1;c[g+4>>2]=i;c[e>>2]=a;c[e+4>>2]=g;k=Xa(75,e|0)|0}else k=h;l=d;return k|0}function nw(){var a=0,b=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=mb(201,a|0)|0;l=a;return b|0}function ow(a){a=a|0;return hw(213,a,0,0)|0}function pw(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d;c[e>>2]=a;c[e+4>>2]=0;c[e+8>>2]=b;c[e+12>>2]=((b|0)<0)<<31>>31;b=wu(Pa(194,e|0)|0)|0;l=d;return b|0}function qw(){var a=0,b=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=za(64,a|0)|0;l=a;return b|0}function rw(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0;h=l;l=l+32|0;if((l|0)>=(m|0))$(32);i=h;do if((g&4095|0)==0&(((g|0)<0)<<31>>31&-4096|0)==0){if(b>>>0>2147483646){c[(xu()|0)>>2]=12;j=-1;break}k=(e&16|0)!=0;if(k)tw(-1);c[i>>2]=a;c[i+4>>2]=b;c[i+8>>2]=d;c[i+12>>2]=e;c[i+16>>2]=f;c[i+20>>2]=g>>12;n=wu(La(192,i|0)|0)|0;if(k){sw();j=n}else j=n}else{c[(xu()|0)>>2]=22;j=-1}while(0);l=h;return j|0}function sw(){return}function tw(a){a=a|0;return}function uw(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d;tw(-1);c[e>>2]=a;c[e+4>>2]=b;b=wu(Wa(91,e|0)|0)|0;sw();l=d;return b|0}function vw(a){a=a|0;var b=0;b=70712;c[b>>2]=a+-1;c[b+4>>2]=0;return}function ww(){var a=0,b=0,d=0;a=70712;b=gx(c[a>>2]|0,c[a+4>>2]|0,1284865837,1481765933)|0;a=Ww(b|0,D|0,1,0)|0;b=D;d=70712;c[d>>2]=a;c[d+4>>2]=b;d=cx(a|0,b|0,33)|0;return d|0}function xw(a){a=a|0;gb(71296);yw(a);cb(71296);return}function yw(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=c[4107]|0;if(!b)c[c[4108]>>2]=a;else{c[4109]=(b|0)==31|(b|0)==7?3:1;c[17826]=0;if((b|0)>0){d=c[4108]|0;e=0;f=a;a=0;do{g=gx(f|0,a|0,1284865837,1481765933)|0;f=Ww(g|0,D|0,1,0)|0;a=D;c[d+(e<<2)>>2]=a;e=e+1|0}while((e|0)<(b|0));h=d}else h=c[4108]|0;c[h>>2]=c[h>>2]|1}return}function zw(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0;gb(71296);a=c[4107]|0;if(!a){b=c[4108]|0;d=(S(c[b>>2]|0,1103515245)|0)+12345&2147483647;c[b>>2]=d;e=d}else{d=c[17826]|0;b=c[4108]|0;f=c[4109]|0;g=b+(f<<2)|0;h=(c[g>>2]|0)+(c[b+(d<<2)>>2]|0)|0;c[g>>2]=h;g=f+1|0;c[4109]=(g|0)==(a|0)?0:g;g=d+1|0;c[17826]=(g|0)==(a|0)?0:g;e=h>>>1}cb(71296);return e|0}function Aw(b){b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;c=b;while(1){d=a[c>>0]|0;e=d<<24>>24;f=c+1|0;if(!(vv(e)|0))break;else c=f}switch(e|0){case 45:{g=1;h=5;break}case 43:{g=0;h=5;break}default:{i=0;j=c;k=d}}if((h|0)==5){i=g;j=f;k=a[f>>0]|0}f=(k<<24>>24)+-48|0;if(f>>>0<10){k=0;g=j;j=f;while(1){g=g+1|0;f=(k*10|0)-j|0;j=(a[g>>0]|0)+-48|0;if(j>>>0>=10){l=f;break}else k=f}}else l=0;return (i|0?l:0-l|0)|0}function Bw(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d;c[e>>2]=a;c[e+4>>2]=b;b=wu(_a(77,e|0)|0)|0;l=d;return b|0}function Cw(a){a=a|0;return (a+-48|0)>>>0<10|0}function Dw(a,b){a=a|0;b=b|0;var d=0;if(!a)d=Mw(1,24)|0;else{c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;d=b}return d|0}function Ew(a){a=a|0;var b=0,d=0;b=c[a>>2]|0;if(b|0){d=b;do{Lw(c[d>>2]|0);b=d;d=c[d+4>>2]|0;Lw(b)}while((d|0)!=0)}Lw(a);return}function Fw(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var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+((w|0)==0?0:4-w|0)|0;w=B+v|0;v=w&3;if((u|0)>0){x=w+((v|0)==0?0:4-v|0)|0;v=0;while(1){c[D+(v<<3)+4>>2]=x;w=x+t|0;c[C+(v<<3)+4>>2]=w;v=v+1|0;if((v|0)==(u|0)){E=0;break}else x=w+t|0}do{c[B+(E<<3)>>2]=-1;E=E+1|0}while((E|0)!=(u|0))}u=Xv(h,b,4)|0;if((u|0)<1)if((u|0)<0){F=1;G=0}else{H=1;q=201}else{H=u;q=201}a:do if((q|0)==201){u=i+8|0;E=(r|0)!=0;x=(s|0)>0;v=i+12|0;w=i+44|0;I=i+32|0;J=i+36|0;K=(s|0)==0;L=(n|0)==0;M=(s|0)<1;N=0;O=b+H|0;P=0;Q=0;R=-1;T=C;U=H;V=y;W=C;X=D;while(1){if((R|0)<0){Y=c[u>>2]|0;Z=Y+8|0;b:do if(!(c[Z>>2]|0)){_=Q;aa=R;ba=T}else{ca=(P|0)!=0;da=(N|0)==95;ea=(P|0)==0;fa=E&(N|0)==10;ga=L&(P|0)<1;ha=Y;ia=Q;ja=R;ka=T;la=Z;while(1){ma=ha;na=la;c:while(1){oa=ma+12|0;if((c[B+(c[oa>>2]<<3)>>2]|0)>=(P|0)){pa=ka;qa=ia;ra=ja;break}sa=ma+20|0;ta=c[sa>>2]|0;if(!ta){q=236;break}d:do if(fa|(ga|(ta&1|0)==0)){if(ta&2|0?(ua=c[h>>2]|0,!((ua|k|0)==0|E&(ua|0)==10)):0)break;do if(ta&16|0){if(da)break d;if(lv(N)|0)break d;ua=c[h>>2]|0;if((ua|0)==95)break;if(!(lv(ua)|0))break d}while(0);ua=c[sa>>2]|0;if(!(ua&32))va=ua;else{if(da){ua=c[h>>2]|0;if((ua|0)==95)break;else wa=ua}else{ua=(lv(N)|0)==0;xa=c[h>>2]|0;if(ua|(xa|0)==95)break;else wa=xa}if(lv(wa)|0)break;va=c[sa>>2]|0}xa=c[h>>2]|0;do if((xa|0)!=0&(ca&(va&64|0)!=0)){if(da){ya=xa;za=1}else{ua=(lv(N)|0)!=0;ya=c[h>>2]|0;za=ua}if((ya|0)==95)if(za)break d;else break;else if(za^(lv(ya)|0)!=0)break;else break d}while(0);if(!(c[sa>>2]&128)){q=236;break c}xa=c[h>>2]|0;if(ea|(xa|0)==0)break;if(da){Aa=xa;Ba=1}else{xa=(lv(N)|0)!=0;Aa=c[h>>2]|0;Ba=xa}if((Aa|0)==95)if(Ba){q=236;break c}else break;else if(Ba^(lv(Aa)|0)!=0)break;else{q=236;break c}}while(0);sa=ma+40|0;if(!(c[sa>>2]|0)){_=ia;aa=ja;ba=ka;break b}else{ma=ma+32|0;na=sa}}if((q|0)==236){q=0;c[ka>>2]=c[na>>2];if(x)Uw(c[ka+4>>2]|0,-1,t|0)|0;sa=c[ma+16>>2]|0;do if(sa|0){ta=c[sa>>2]|0;if((ta|0)<=-1)break;xa=ka+4|0;ua=sa;Ca=ta;do{if((Ca|0)<(s|0))c[(c[xa>>2]|0)+(Ca<<2)>>2]=P;ua=ua+4|0;Ca=c[ua>>2]|0}while((Ca|0)>-1)}while(0);sa=(c[ka>>2]|0)!=(c[v>>2]|0);if(M|sa){Da=sa?ia:1;Ea=sa?ja:P;Fa=ka+4|0}else{sa=ka+4|0;na=c[sa>>2]|0;Ca=0;do{c[p+(Ca<<2)>>2]=c[na+(Ca<<2)>>2];Ca=Ca+1|0}while((Ca|0)!=(s|0));Da=1;Ea=P;Fa=sa}sa=c[oa>>2]|0;c[B+(sa<<3)>>2]=P;c[B+(sa<<3)+4>>2]=Fa;pa=ka+8|0;qa=Da;ra=Ea}la=ma+40|0;if(!(c[la>>2]|0)){_=qa;aa=ra;ba=pa;break}else{ha=ma+32|0;ia=qa;ja=ra;ka=pa}}}while(0);c[ba>>2]=0;Z=c[h>>2]|0;if(!Z){Ga=aa;break}else{Ha=_;Ia=aa;Ja=Z}}else{if(K){Ga=R;break}Z=c[h>>2]|0;if((T|0)!=(W|0)&(Z|0)!=0){Ha=Q;Ia=R;Ja=Z}else{Ga=R;break}}Z=P+U|0;Y=Xv(h,O,4)|0;if((Y|0)<1)if((Y|0)<0){F=1;G=0;break a}else Ka=1;else Ka=Y;Y=O+Ka|0;if((Ha|0)!=0&(c[w>>2]|0)!=0){if(!(c[W>>2]|0))La=X;else{ka=c[J>>2]|0;ja=c[ka>>2]|0;ia=(ja|0)>-1;ha=W;la=X;while(1){da=ha+4|0;e:do if(ia){ea=0;ca=ja;do{ga=c[ka+((ea|1)<<2)>>2]|0;if((ca|0)>=(s|0)){Ma=la;break e}Na=c[da>>2]|0;if((c[Na+(ga<<2)>>2]|0)==(c[p+(ga<<2)>>2]|0)?(c[Na+(ca<<2)>>2]|0)<(c[p+(ca<<2)>>2]|0):0){Ma=la;break e}ea=ea+2|0;ca=c[ka+(ea<<2)>>2]|0}while((ca|0)>-1);Oa=da;Pa=Na;q=265}else{Oa=da;Pa=c[da>>2]|0;q=265}while(0);if((q|0)==265){q=0;c[la>>2]=c[ha>>2];da=la+4|0;ca=c[da>>2]|0;c[da>>2]=Pa;c[Oa>>2]=ca;Ma=la+8|0}ha=ha+8|0;if(!(c[ha>>2]|0)){La=Ma;break}else la=Ma}}c[La>>2]=0;Qa=W;Ra=X;Sa=0}else{Qa=X;Ra=W;Sa=Ha}la=c[Ra>>2]|0;if(!la){Ta=V;Ua=Ia;Va=Qa;Wa=Sa}else{ha=(Z|0)!=0;ka=(Ja|0)==95;ja=(Z|0)==0;ia=E&(Ja|0)==10;ca=L&(Z|0)<1;da=Ra;ea=V;ma=Ia;ga=Qa;fa=Sa;sa=la;while(1){la=sa+8|0;if(!(c[la>>2]|0)){Xa=ea;Ya=ma;Za=ga;_a=fa}else{Ca=da+4|0;na=sa;ua=ma;xa=ga;ta=fa;$a=ea;ab=la;while(1){f:do if((c[na>>2]|0)>>>0>Ja>>>0){bb=ta;cb=$a;db=xa;eb=ua}else{if((c[na+4>>2]|0)>>>0>>0){bb=ta;cb=$a;db=xa;eb=ua;break}la=na+20|0;fb=c[la>>2]|0;do if(fb|0){if(!(ia|(ca|(fb&1|0)==0))){bb=ta;cb=$a;db=xa;eb=ua;break f}if(fb&2|0?(gb=c[h>>2]|0,!((gb|k|0)==0|E&(gb|0)==10)):0){bb=ta;cb=$a;db=xa;eb=ua;break f}do if(fb&16|0){if(ka){bb=ta;cb=$a;db=xa;eb=ua;break f}if(lv(Ja)|0){bb=ta;cb=$a;db=xa;eb=ua;break f}gb=c[h>>2]|0;if((gb|0)==95)break;if(!(lv(gb)|0)){bb=ta;cb=$a;db=xa;eb=ua;break f}}while(0);gb=c[la>>2]|0;if(!(gb&32))hb=gb;else{if(ka){gb=c[h>>2]|0;if((gb|0)==95){bb=ta;cb=$a;db=xa;eb=ua;break f}else ib=gb}else{gb=(lv(Ja)|0)==0;jb=c[h>>2]|0;if(gb|(jb|0)==95){bb=ta;cb=$a;db=xa;eb=ua;break f}else ib=jb}if(lv(ib)|0){bb=ta;cb=$a;db=xa;eb=ua;break f}hb=c[la>>2]|0}jb=c[h>>2]|0;do if((jb|0)!=0&(ha&(hb&64|0)!=0)){if(ka){kb=jb;lb=1}else{gb=(lv(Ja)|0)!=0;kb=c[h>>2]|0;lb=gb}if((kb|0)==95)if(lb){bb=ta;cb=$a;db=xa;eb=ua;break f}else break;else if(lb^(lv(kb)|0)!=0)break;else{bb=ta;cb=$a;db=xa;eb=ua;break f}}while(0);do if(c[la>>2]&128|0){jb=c[h>>2]|0;if(ja|(jb|0)==0){bb=ta;cb=$a;db=xa;eb=ua;break f}if(ka){mb=jb;nb=1}else{jb=(lv(Ja)|0)!=0;mb=c[h>>2]|0;nb=jb}if((mb|0)==95)if(nb)break;else{bb=ta;cb=$a;db=xa;eb=ua;break f}else if(nb^(lv(mb)|0)!=0){bb=ta;cb=$a;db=xa;eb=ua;break f}else break}while(0);jb=c[la>>2]|0;do if(!(jb&4))ob=jb;else{if(c[a>>2]&2|0){ob=jb;break}if(!(kv(Ja,c[na+24>>2]|0)|0)){bb=ta;cb=$a;db=xa;eb=ua;break f}ob=c[la>>2]|0}while(0);do if(ob&4|0){if(!(c[a>>2]&2))break;jb=Ju(Ja)|0;gb=na+24|0;if(kv(jb,c[gb>>2]|0)|0)break;jb=Iu(Ja)|0;if(!(kv(jb,c[gb>>2]|0)|0)){bb=ta;cb=$a;db=xa;eb=ua;break f}}while(0);if(!(c[la>>2]&8))break;if(Jw(c[na+28>>2]|0,Ja,c[a>>2]&2)|0){bb=ta;cb=$a;db=xa;eb=ua;break f}}while(0);if(x){la=c[Ca>>2]|0;fb=0;do{c[$a+(fb<<2)>>2]=c[la+(fb<<2)>>2];fb=fb+1|0}while((fb|0)!=(s|0))}fb=c[na+16>>2]|0;do if(fb|0){la=c[fb>>2]|0;if((la|0)>-1){pb=fb;qb=la}else break;do{if((qb|0)<(s|0))c[$a+(qb<<2)>>2]=Z;pb=pb+4|0;qb=c[pb>>2]|0}while((qb|0)>-1)}while(0);fb=c[na+12>>2]|0;la=B+(fb<<3)|0;if((c[la>>2]|0)>=(Z|0)){gb=c[B+(fb<<3)+4>>2]|0;jb=c[gb>>2]|0;if(!(Hw(s,c[I>>2]|0,$a,jb)|0)){bb=ta;cb=$a;db=xa;eb=ua;break}c[gb>>2]=$a;if((c[ab>>2]|0)!=(c[v>>2]|0)){bb=ta;cb=jb;db=xa;eb=ua;break}if(x)rb=0;else{bb=1;cb=jb;db=xa;eb=Z;break}while(1){c[p+(rb<<2)>>2]=c[$a+(rb<<2)>>2];rb=rb+1|0;if((rb|0)==(s|0)){bb=1;cb=jb;db=xa;eb=Z;break f}}}jb=c[ab>>2]|0;c[xa>>2]=jb;gb=xa+4|0;sb=c[gb>>2]|0;c[gb>>2]=$a;c[la>>2]=Z;c[B+(fb<<3)+4>>2]=gb;do if((jb|0)==(c[v>>2]|0)){if((ua|0)==-1)if(x)tb=0;else{ub=Z;vb=1;break}else{if(!x){ub=ua;vb=ta;break}if((c[$a>>2]|0)>(c[p>>2]|0)){ub=ua;vb=ta;break}else tb=0}do{c[p+(tb<<2)>>2]=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b|0)==95)if(Qb){Kb=B;Lb=lb;Mb=hb;break j}else break;else if(Qb^(lv(Pb)|0)!=0)break;else{Kb=B;Lb=lb;Mb=hb;break j}}while(0);if(!(c[rb>>2]&128)){q=52;break}Sa=c[h>>2]|0;if(ob|(Sa|0)==0){Kb=B;Lb=lb;Mb=hb;break}if(pb){Rb=Sa;Sb=1}else{Sa=(lv(vb)|0)!=0;Rb=c[h>>2]|0;Sb=Sa}if((Rb|0)==95)if(Sb){q=52;break}else{Kb=B;Lb=lb;Mb=hb;break}else if(Sb^(lv(Rb)|0)!=0){Kb=B;Lb=lb;Mb=hb;break}else{q=52;break}}else q=52;while(0);do if((q|0)==52){q=0;if(!lb){Kb=c[kb+16>>2]|0;Lb=c[ib>>2]|0;Mb=hb;break}rb=hb+28|0;k=c[rb>>2]|0;if(!k){Sa=Fw(G,0,0,0,32)|0;if(!Sa){q=56;break i}c[Sa+24>>2]=hb;c[Sa+28>>2]=0;sb=Fw(G,0,0,0,c[d>>2]<<2)|0;c[Sa+20>>2]=sb;if(!sb){q=63;break i}c[rb>>2]=Sa;Tb=Sa}else Tb=k;c[Tb>>2]=ub;c[Tb+4>>2]=s;c[Tb+8>>2]=c[ib>>2];c[Tb+12>>2]=c[kb+12>>2];c[Tb+16>>2]=c[h>>2];if((c[d>>2]|0)>0){k=c[Tb+20>>2]|0;Sa=0;do{c[k+(Sa<<2)>>2]=c[Fb+(Sa<<2)>>2];Sa=Sa+1|0}while((Sa|0)<(c[d>>2]|0))}Sa=c[kb+16>>2]|0;if(!Sa){Kb=B;Lb=lb;Mb=Tb;break}k=c[Sa>>2]|0;if((k|0)<=-1){Kb=B;Lb=lb;Mb=Tb;break}rb=c[Tb+20>>2]|0;sb=Sa;Sa=k;do{sb=sb+4|0;c[rb+(Sa<<2)>>2]=ub;Sa=c[sb>>2]|0}while((Sa|0)>-1);Kb=B;Lb=lb;Mb=Tb}while(0);ib=kb+40|0;if(!(c[ib>>2]|0))break;else{kb=kb+32|0;B=Kb;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hv(b+hb|0,dc+-1|0,kb)|0)){B=(kb|0)==0;ib=B&1;pb=Hb+(c[gc+12>>2]<<2)|0;if(B?c[pb>>2]|0:0){kc=bc;lc=cc;mc=dc;nc=25;oc=fc;break}c[pb>>2]=ib;ib=kb+-1|0;pb=dc+ib|0;B=c[h>>2]|0;ob=cc+fc+ib|0;ib=Xv(h,pb,4)|0;if((ib|0)<1)if((ib|0)<0){kc=B;lc=ob;mc=pb;nc=2;oc=ib;break}else pc=1;else pc=ib;kc=B;lc=ob;mc=pb+pc|0;nc=0;oc=pc}else{kc=bc;lc=cc;mc=dc;nc=25;oc=fc}while(0);switch(nc&31){case 25:{Vb=ic;Wb=ec;Xb=kc;Yb=lc;Zb=gc;_b=mc;$b=oc;ac=hc;q=174;continue k;break}case 0:{qc=kc;rc=lc;sc=mc;tc=oc;break}default:{uc=hc;vc=ic;wc=ec;xc=kc;yc=lc;zc=nc;Ac=gc;Bc=mc;Cc=oc;break l}}}while(0);if((q|0)==98){q=0;kb=c[h>>2]|0;if(!kb){Vb=ic;Wb=ec;Xb=bc;Yb=cc;Zb=gc;_b=dc;$b=fc;ac=hc;q=174;continue k}hb=cc+fc|0;pb=Xv(h,dc,4)|0;if((pb|0)<1)if((pb|0)<0){uc=hc;vc=ic;wc=ec;xc=kb;yc=hb;zc=2;Ac=gc;Bc=dc;Cc=pb;break}else Dc=1;else Dc=pb;qc=kb;rc=hb;sc=dc+Dc|0;tc=Dc}if(!(c[lb>>2]|0)){Vb=ic;Wb=ec;Xb=qc;Yb=rc;Zb=gc;_b=sc;$b=tc;ac=hc;q=174;continue k}hb=(rc|0)!=0;kb=(qc|0)==95;pb=(rc|0)==0;ob=Ua&(qc|0)==10;B=Za&(rc|0)<1;ib=0;qb=gc;nb=hc;mb=ic;Sa=lb;m:while(1){n:do if((c[qb>>2]|0)>>>0>qc>>>0){Ec=mb;Fc=ib;Gc=nb}else{if((c[qb+4>>2]|0)>>>0>>0){Ec=mb;Fc=ib;Gc=nb;break}sb=qb+20|0;rb=c[sb>>2]|0;do if(rb|0){if(!(ob|(B|(rb&1|0)==0))){Ec=mb;Fc=ib;Gc=nb;break n}if(rb&2|0?(k=c[h>>2]|0,!((k|z|0)==0|Ua&(k|0)==10)):0){Ec=mb;Fc=ib;Gc=nb;break n}do if(rb&16|0){if(kb){Ec=mb;Fc=ib;Gc=nb;break n}if(lv(qc)|0){Ec=mb;Fc=ib;Gc=nb;break n}k=c[h>>2]|0;if((k|0)==95)break;if(!(lv(k)|0)){Ec=mb;Fc=ib;Gc=nb;break n}}while(0);k=c[sb>>2]|0;if(!(k&32))Hc=k;else{if(kb){k=c[h>>2]|0;if((k|0)==95){Ec=mb;Fc=ib;Gc=nb;break n}else Ic=k}else{k=(lv(qc)|0)==0;Ia=c[h>>2]|0;if(k|(Ia|0)==95){Ec=mb;Fc=ib;Gc=nb;break n}else Ic=Ia}if(lv(Ic)|0){Ec=mb;Fc=ib;Gc=nb;break n}Hc=c[sb>>2]|0}Ia=c[h>>2]|0;do if((Ia|0)!=0&(hb&(Hc&64|0)!=0)){if(kb){Jc=Ia;Kc=1}else{k=(lv(qc)|0)!=0;Jc=c[h>>2]|0;Kc=k}if((Jc|0)==95)if(Kc){Ec=mb;Fc=ib;Gc=nb;break n}else break;else if(Kc^(lv(Jc)|0)!=0)break;else{Ec=mb;Fc=ib;Gc=nb;break n}}while(0);do if(c[sb>>2]&128|0){Ia=c[h>>2]|0;if(pb|(Ia|0)==0){Ec=mb;Fc=ib;Gc=nb;break n}if(kb){Lc=Ia;Mc=1}else{Ia=(lv(qc)|0)!=0;Lc=c[h>>2]|0;Mc=Ia}if((Lc|0)==95)if(Mc)break;else{Ec=mb;Fc=ib;Gc=nb;break n}else if(Mc^(lv(Lc)|0)!=0){Ec=mb;Fc=ib;Gc=nb;break n}else break}while(0);Ia=c[sb>>2]|0;do if(!(Ia&4))Nc=Ia;else{if(c[a>>2]&2|0){Nc=Ia;break}if(!(kv(qc,c[qb+24>>2]|0)|0)){Ec=mb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c=qb;zc=0;Ac=nb;Bc=ib;Cc=$b;break}kb=c[Vb+20>>2]|0;pb=0;do{c[Fb+(pb<<2)>>2]=c[kb+(pb<<2)>>2];pb=pb+1|0}while((pb|0)!=(Sa|0));uc=ac;vc=mb;wc=Wb;xc=Xb;yc=qb;zc=0;Ac=nb;Bc=ib;Cc=$b}while(0);switch(zc|0){case 2:{Ab=0;Bb=Gb;Cb=Hb;Db=Fb;Eb=1;break h;break}case 27:{q=184;break i;break}case 0:{bc=xc;cc=yc;dc=Bc;ec=wc;fc=Cc;gc=Ac;hc=uc;ic=vc;q=82;break}case 3:{break k;break}default:{yb=0;zb=12;break g}}}Ya=Bc;Xa=Cc;cb=ub;bb=wc;db=vc;eb=c[d>>2]|0}if((q|0)==56){Ew(G);if(!Wa)Lw(Fb);if(!Ja)Lw(Gb);if(_a){yb=0;zb=12;break g}Lw(Hb);yb=0;zb=12;break g}else if((q|0)==63){Ew(G);if(!Wa)Lw(Fb);if(!Ja)Lw(Gb);if(_a){yb=0;zb=12;break g}Lw(Hb);yb=0;zb=12;break g}else if((q|0)==184){Ab=wc;Bb=Gb;Cb=Hb;Db=Fb;Eb=wc>>>31;break}}while(0);Ew(G);if(Db|0)Lw(Db);if(Bb|0)Lw(Bb);if(!Cb){yb=Ab;zb=Eb}else{Lw(Cb);yb=Ab;zb=Eb}}else{yb=0;zb=12}while(0);wb=zb;xb=yb}if(!wb)Iw(j,e,c[a>>2]|0,i,p,xb);if(!p)o=wb;else{Lw(p);o=wb}}l=g;return o|0}function Hw(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;a:do if((a|0)>0){f=0;while(1){g=c[d+(f<<2)>>2]|0;h=c[e+(f<<2)>>2]|0;if(!(c[b+(f<<2)>>2]|0)){if((g|0)<(h|0)){i=1;break a}if((g|0)>(h|0)){i=0;break a}}else{if((g|0)>(h|0)){i=1;break a}if((g|0)<(h|0)){i=0;break a}}f=f+1|0;if((f|0)>=(a|0)){i=0;break}}}else i=0;while(0);return i|0}function Iw(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;if((d&8|0)==0&(g|0)>-1){d=c[e+16>>2]|0;h=e+28|0;i=c[h>>2]|0;j=(a|0)!=0;if(j&(i|0)!=0){k=e+48|0;e=0;do{l=c[d+(e*12|0)>>2]|0;if((l|0)==(c[k>>2]|0))m=g;else m=c[f+(l<<2)>>2]|0;l=b+(e<<3)|0;c[l>>2]=m;n=c[d+(e*12|0)+4>>2]|0;if((n|0)==(c[k>>2]|0))o=g;else o=c[f+(n<<2)>>2]|0;n=b+(e<<3)+4|0;c[n>>2]=o;if((m|0)==-1|(o|0)==-1){c[n>>2]=-1;c[l>>2]=-1}e=e+1|0;l=c[h>>2]|0}while(e>>>0>>0&e>>>0>>0);p=l}else p=i;if(j&(p|0)!=0){j=0;while(1){i=b+(j<<3)+4|0;e=c[d+(j*12|0)+8>>2]|0;if(e|0?(h=c[e>>2]|0,(h|0)>-1):0){o=b+(j<<3)|0;m=0;f=h;h=c[o>>2]|0;while(1){if((h|0)>=(c[b+(f<<3)>>2]|0)?(c[i>>2]|0)<=(c[b+(f<<3)+4>>2]|0):0)q=h;else{c[i>>2]=-1;c[o>>2]=-1;q=-1}m=m+1|0;f=c[e+(m<<2)>>2]|0;if((f|0)<=-1)break;else h=q}}h=j+1|0;if(h>>>0>>0&h>>>0

>>0)j=h;else{r=h;break}}}else r=0}else r=0;if(r>>>0>>0)Uw(b+(r<<3)|0,-1,a-r<<3|0)|0;return}function Jw(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=c[a>>2]|0;a:do if(!e)f=0;else{g=(d|0)==0;h=a;i=e;while(1){if(g){if(kv(b,i)|0){f=1;break a}}else{j=Iu(b)|0;if(kv(j,c[h>>2]|0)|0){f=1;break a}j=Ju(b)|0;if(kv(j,c[h>>2]|0)|0){f=1;break a}}h=h+4|0;i=c[h>>2]|0;if(!i){f=0;break}}}while(0);return f|0} -function Ol(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+28|0;f=d+24|0;g=d+20|0;h=d+16|0;i=d+12|0;j=d+8|0;k=d+4|0;n=d;c[e>>2]=b;c[f>>2]=c[e>>2];Nr(c[f>>2]|0,0,0);c[g>>2]=c[(c[f>>2]|0)+128>>2];c[h>>2]=c[(c[f>>2]|0)+128+4>>2];c[j>>2]=c[g>>2]<<6;c[i>>2]=c[h>>2]<<6|(c[g>>2]|0)>>>26;c[g>>2]=c[j>>2];h=(c[j>>2]|0)+(c[(c[f>>2]|0)+144>>2]|0)|0;c[j>>2]=h;if(h>>>0<(c[g>>2]|0)>>>0)c[i>>2]=(c[i>>2]|0)+1;c[g>>2]=c[j>>2];c[j>>2]=c[j>>2]<<3;c[i>>2]=c[i>>2]<<3;c[i>>2]=c[i>>2]|(c[g>>2]|0)>>>29;g=(c[(c[f>>2]|0)+144>>2]|0)<56;h=(c[f>>2]|0)+144|0;e=c[h>>2]|0;c[h>>2]=e+1;a[(c[f>>2]|0)+e>>0]=-128;a:do if(g)while(1){if((c[(c[f>>2]|0)+144>>2]|0)>=56)break a;e=(c[f>>2]|0)+144|0;h=c[e>>2]|0;c[e>>2]=h+1;a[(c[f>>2]|0)+h>>0]=0}else{while(1){o=c[f>>2]|0;if((c[(c[f>>2]|0)+144>>2]|0)>=64)break;h=o+144|0;e=c[h>>2]|0;c[h>>2]=e+1;a[(c[f>>2]|0)+e>>0]=0}Nr(o,0,0);e=c[f>>2]|0;h=e+56|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(h|0))}while(0);Sl((c[f>>2]|0)+56|0,c[i>>2]|0);Sl((c[f>>2]|0)+60|0,c[j>>2]|0);c[n>>2]=Tl(c[f>>2]|0,c[f>>2]|0,1)|0;bf(c[n>>2]|0);cf();c[k>>2]=c[f>>2];Sl(c[k>>2]|0,c[(c[f>>2]|0)+160>>2]|0);c[k>>2]=(c[k>>2]|0)+4;Sl(c[k>>2]|0,c[(c[f>>2]|0)+164>>2]|0);c[k>>2]=(c[k>>2]|0)+4;Sl(c[k>>2]|0,c[(c[f>>2]|0)+168>>2]|0);c[k>>2]=(c[k>>2]|0)+4;Sl(c[k>>2]|0,c[(c[f>>2]|0)+172>>2]|0);c[k>>2]=(c[k>>2]|0)+4;Sl(c[k>>2]|0,c[(c[f>>2]|0)+176>>2]|0);c[k>>2]=(c[k>>2]|0)+4;l=d;return}function Pl(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=c[d>>2];l=b;return c[e>>2]|0}function Ql(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if((c[f>>2]|0)==2){c[i>>2]=Rl(c[g>>2]|0,c[h>>2]|0)|0;j=c[i>>2]|0;l=e;return j|0}else{c[i>>2]=5;j=c[i>>2]|0;l=e;return j|0}return 0}function Rl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;i=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=42861;c[i>>2]=Mr(2,0,42874,3,42324,20)|0;do if(!(c[i>>2]|0)){if(c[f>>2]|0){c[h>>2]=42943;c[i>>2]=Mr(2,0,42531,56,42345,20)|0;if(c[i>>2]|0)break;c[h>>2]=43133;c[i>>2]=Mr(2,1,0,0,42366,20)|0;if(c[i>>2]|0)break}c[e>>2]=0;j=c[e>>2]|0;l=d;return j|0}while(0);if(c[g>>2]|0)Eb[c[g>>2]&1](43214,2,c[h>>2]|0,c[i>>2]|0);c[e>>2]=50;j=c[e>>2]|0;l=d;return j|0}function Sl(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=b;c[g>>2]=d;c[h>>2]=c[f>>2];a[c[h>>2]>>0]=(c[g>>2]|0)>>>24;a[(c[h>>2]|0)+1>>0]=(c[g>>2]|0)>>>16;a[(c[h>>2]|0)+2>>0]=(c[g>>2]|0)>>>8;a[(c[h>>2]|0)+3>>0]=c[g>>2];l=e;return}function Tl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+16|0;g=e+12|0;h=e+8|0;i=e+4|0;j=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[i>>2]=c[f>>2];do{c[j>>2]=Ul(c[i>>2]|0,c[g>>2]|0)|0;c[g>>2]=(c[g>>2]|0)+64;f=(c[h>>2]|0)+-1|0;c[h>>2]=f}while((f|0)!=0);l=e;return c[j>>2]|0}function Ul(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;d=l;l=l+112|0;if((l|0)>=(m|0))$(112);e=d+100|0;f=d+96|0;g=d+92|0;h=d+88|0;i=d+84|0;j=d+80|0;k=d+76|0;n=d+72|0;o=d+68|0;p=d+64|0;q=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=c[e>>2];c[h>>2]=c[f>>2];c[i>>2]=c[(c[g>>2]|0)+160>>2];c[j>>2]=c[(c[g>>2]|0)+164>>2];c[k>>2]=c[(c[g>>2]|0)+168>>2];c[n>>2]=c[(c[g>>2]|0)+172>>2];c[o>>2]=c[(c[g>>2]|0)+176>>2];f=Vl(c[i>>2]|0,5)|0;e=f+(c[n>>2]^c[j>>2]&(c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m|0))$(16);e=b+4|0;f=b;c[e>>2]=a;c[f>>2]=c[e>>2];l=b;return (d[c[f>>2]>>0]|0)<<24|(d[(c[f>>2]|0)+1>>0]|0)<<16|(d[(c[f>>2]|0)+2>>0]|0)<<8|(d[(c[f>>2]|0)+3>>0]|0)|0}function Xl(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+208|0;if((l|0)>=(m|0))$(208);g=f+192|0;h=f+188|0;i=f+184|0;j=f;c[g>>2]=b;c[h>>2]=d;c[i>>2]=e;Nl(j,0);Nr(j,c[h>>2]|0,c[i>>2]|0);Ol(j);i=c[g>>2]|0;g=j;j=i+20|0;do{a[i>>0]=a[g>>0]|0;i=i+1|0;g=g+1|0}while((i|0)<(j|0));l=f;return}function Yl(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+208|0;if((l|0)>=(m|0))$(208);g=f+192|0;h=f+188|0;i=f+184|0;j=f;c[g>>2]=b;c[h>>2]=d;c[i>>2]=e;Nl(j,0);while(1){if((c[i>>2]|0)<=0)break;Nr(j,(c[(c[h>>2]|0)+12>>2]|0)+(c[(c[h>>2]|0)+4>>2]|0)|0,c[(c[h>>2]|0)+8>>2]|0);c[h>>2]=(c[h>>2]|0)+16;c[i>>2]=(c[i>>2]|0)+-1}Ol(j);i=c[g>>2]|0;g=j;j=i+20|0;do{a[i>>0]=a[g>>0]|0;i=i+1|0;g=g+1|0}while((i|0)<(j|0));l=f;return}function Zl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+12|0;f=d+4|0;c[e>>2]=a;c[d+8>>2]=b;c[f>>2]=c[e>>2];c[d>>2]=pg()|0;c[(c[f>>2]|0)+160>>2]=-1056596264;c[(c[f>>2]|0)+164>>2]=914150663;c[(c[f>>2]|0)+168>>2]=812702999;c[(c[f>>2]|0)+172>>2]=-150054599;c[(c[f>>2]|0)+176>>2]=-4191439;c[(c[f>>2]|0)+180>>2]=1750603025;c[(c[f>>2]|0)+184>>2]=1694076839;c[(c[f>>2]|0)+188>>2]=-1090891868;e=(c[f>>2]|0)+128|0;c[e>>2]=0;c[e+4>>2]=0;e=(c[f>>2]|0)+136|0;c[e>>2]=0;c[e+4>>2]=0;c[(c[f>>2]|0)+144>>2]=0;c[(c[f>>2]|0)+148>>2]=64;c[(c[f>>2]|0)+152>>2]=33;l=d;return}function _l(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+28|0;f=d+24|0;g=d+20|0;h=d+16|0;i=d+12|0;j=d+8|0;k=d+4|0;n=d;c[e>>2]=b;c[f>>2]=c[e>>2];Nr(c[f>>2]|0,0,0);c[g>>2]=c[(c[f>>2]|0)+128>>2];c[h>>2]=c[(c[f>>2]|0)+128+4>>2];c[j>>2]=c[g>>2]<<6;c[i>>2]=c[h>>2]<<6|(c[g>>2]|0)>>>26;c[g>>2]=c[j>>2];h=(c[j>>2]|0)+(c[(c[f>>2]|0)+144>>2]|0)|0;c[j>>2]=h;if(h>>>0<(c[g>>2]|0)>>>0)c[i>>2]=(c[i>>2]|0)+1;c[g>>2]=c[j>>2];c[j>>2]=c[j>>2]<<3;c[i>>2]=c[i>>2]<<3;c[i>>2]=c[i>>2]|(c[g>>2]|0)>>>29;g=(c[(c[f>>2]|0)+144>>2]|0)<56;h=(c[f>>2]|0)+144|0;e=c[h>>2]|0;c[h>>2]=e+1;a[(c[f>>2]|0)+e>>0]=-128;a:do if(g)while(1){if((c[(c[f>>2]|0)+144>>2]|0)>=56)break a;e=(c[f>>2]|0)+144|0;h=c[e>>2]|0;c[e>>2]=h+1;a[(c[f>>2]|0)+h>>0]=0}else{while(1){o=c[f>>2]|0;if((c[(c[f>>2]|0)+144>>2]|0)>=64)break;h=o+144|0;e=c[h>>2]|0;c[h>>2]=e+1;a[(c[f>>2]|0)+e>>0]=0}Nr(o,0,0);e=c[f>>2]|0;h=e+56|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(h|0))}while(0);dm((c[f>>2]|0)+56|0,c[i>>2]|0);dm((c[f>>2]|0)+60|0,c[j>>2]|0);c[n>>2]=em(c[f>>2]|0,c[f>>2]|0,1)|0;bf(c[n>>2]|0);cf();c[k>>2]=c[f>>2];dm(c[k>>2]|0,c[(c[f>>2]|0)+160>>2]|0);c[k>>2]=(c[k>>2]|0)+4;dm(c[k>>2]|0,c[(c[f>>2]|0)+164>>2]|0);c[k>>2]=(c[k>>2]|0)+4;dm(c[k>>2]|0,c[(c[f>>2]|0)+168>>2]|0);c[k>>2]=(c[k>>2]|0)+4;dm(c[k>>2]|0,c[(c[f>>2]|0)+172>>2]|0);c[k>>2]=(c[k>>2]|0)+4;dm(c[k>>2]|0,c[(c[f>>2]|0)+176>>2]|0);c[k>>2]=(c[k>>2]|0)+4;dm(c[k>>2]|0,c[(c[f>>2]|0)+180>>2]|0);c[k>>2]=(c[k>>2]|0)+4;dm(c[k>>2]|0,c[(c[f>>2]|0)+184>>2]|0);c[k>>2]=(c[k>>2]|0)+4;dm(c[k>>2]|0,c[(c[f>>2]|0)+188>>2]|0);c[k>>2]=(c[k>>2]|0)+4;l=d;return}function $l(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=c[d>>2];l=b;return c[e>>2]|0}function am(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;switch(c[f>>2]|0){case 11:{c[i>>2]=bm(c[g>>2]|0,c[h>>2]|0)|0;break}case 8:{c[i>>2]=cm(c[g>>2]|0,c[h>>2]|0)|0;break}default:c[i>>2]=5}l=e;return c[i>>2]|0}function bm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;i=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=42861;c[i>>2]=Mr(11,0,42874,3,42654,28)|0;do if(!(c[i>>2]|0)){if(c[f>>2]|0){c[h>>2]=42943;c[i>>2]=Mr(11,0,42531,56,42683,28)|0;if(c[i>>2]|0)break;c[h>>2]=43133;c[i>>2]=Mr(11,1,0,0,42712,28)|0;if(c[i>>2]|0)break}c[e>>2]=0;j=c[e>>2]|0;l=d;return j|0}while(0);if(c[g>>2]|0)Eb[c[g>>2]&1](43214,11,c[h>>2]|0,c[i>>2]|0);c[e>>2]=50;j=c[e>>2]|0;l=d;return j|0}function cm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;i=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=42861;c[i>>2]=Mr(8,0,42874,3,42498,32)|0;do if(!(c[i>>2]|0)){if(c[f>>2]|0){c[h>>2]=42943;c[i>>2]=Mr(8,0,42531,56,42588,32)|0;if(c[i>>2]|0)break;c[h>>2]=43133;c[i>>2]=Mr(8,1,0,0,42621,32)|0;if(c[i>>2]|0)break}c[e>>2]=0;j=c[e>>2]|0;l=d;return j|0}while(0);if(c[g>>2]|0)Eb[c[g>>2]&1](43214,8,c[h>>2]|0,c[i>>2]|0);c[e>>2]=50;j=c[e>>2]|0;l=d;return j|0}function dm(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=b;c[g>>2]=d;c[h>>2]=c[f>>2];a[c[h>>2]>>0]=(c[g>>2]|0)>>>24;a[(c[h>>2]|0)+1>>0]=(c[g>>2]|0)>>>16;a[(c[h>>2]|0)+2>>0]=(c[g>>2]|0)>>>8;a[(c[h>>2]|0)+3>>0]=c[g>>2];l=e;return}function em(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+16|0;g=e+12|0;h=e+8|0;i=e+4|0;j=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[i>>2]=c[f>>2];do{c[j>>2]=fm(c[i>>2]|0,c[g>>2]|0)|0;c[g>>2]=(c[g>>2]|0)+64;f=(c[h>>2]|0)+-1|0;c[h>>2]=f}while((f|0)!=0);l=e;return c[j>>2]|0}function fm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;d=l;l=l+320|0;if((l|0)>=(m|0))$(320);e=d+312|0;f=d+308|0;g=d+304|0;h=d+300|0;i=d+296|0;j=d+292|0;k=d+288|0;n=d+284|0;o=d+280|0;p=d+276|0;q=d+272|0;r=d+268|0;s=d+264|0;t=d+8|0;u=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=c[e>>2];c[h>>2]=c[(c[g>>2]|0)+160>>2];c[i>>2]=c[(c[g>>2]|0)+164>>2];c[j>>2]=c[(c[g>>2]|0)+168>>2];c[k>>2]=c[(c[g>>2]|0)+172>>2];c[n>>2]=c[(c[g>>2]|0)+176>>2];c[o>>2]=c[(c[g>>2]|0)+180>>2];c[p>>2]=c[(c[g>>2]|0)+184>>2];c[q>>2]=c[(c[g>>2]|0)+188>>2];c[u>>2]=0;while(1){if((c[u>>2]|0)>=16)break;e=gm((c[f>>2]|0)+(c[u>>2]<<2)|0)|0;c[t+(c[u>>2]<<2)>>2]=e;c[u>>2]=(c[u>>2]|0)+1}while(1){if((c[u>>2]|0)>=64)break;f=hm(c[t+((c[u>>2]|0)-2<<2)>>2]|0,17)|0;e=f^(hm(c[t+((c[u>>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16|(d[(c[f>>2]|0)+2>>0]|0)<<8|(d[(c[f>>2]|0)+3>>0]|0)|0}function hm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;l=d;return (c[e>>2]|0)>>>(c[f>>2]&31)|c[e>>2]<<(32-(c[f>>2]|0)&31)|0}function im(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=hm(c[d>>2]|0,6)|0;e=a^(hm(c[d>>2]|0,11)|0);a=e^(hm(c[d>>2]|0,25)|0);l=b;return a|0}function jm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;l=e;return c[h>>2]^c[f>>2]&(c[g>>2]^c[h>>2])|0}function km(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=hm(c[d>>2]|0,2)|0;e=a^(hm(c[d>>2]|0,13)|0);a=e^(hm(c[d>>2]|0,22)|0);l=b;return a|0}function lm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;l=e;return c[f>>2]&c[g>>2]|c[h>>2]&(c[f>>2]|c[g>>2])|0}function mm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+12|0;f=d+4|0;c[e>>2]=a;c[d+8>>2]=b;c[f>>2]=c[e>>2];c[d>>2]=pg()|0;c[(c[f>>2]|0)+160>>2]=1779033703;c[(c[f>>2]|0)+164>>2]=-1150833019;c[(c[f>>2]|0)+168>>2]=1013904242;c[(c[f>>2]|0)+172>>2]=-1521486534;c[(c[f>>2]|0)+176>>2]=1359893119;c[(c[f>>2]|0)+180>>2]=-1694144372;c[(c[f>>2]|0)+184>>2]=528734635;c[(c[f>>2]|0)+188>>2]=1541459225;e=(c[f>>2]|0)+128|0;c[e>>2]=0;c[e+4>>2]=0;e=(c[f>>2]|0)+136|0;c[e>>2]=0;c[e+4>>2]=0;c[(c[f>>2]|0)+144>>2]=0;c[(c[f>>2]|0)+148>>2]=64;c[(c[f>>2]|0)+152>>2]=33;l=d;return}function nm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d+8|0;g=d+4|0;c[e>>2]=a;c[d+12>>2]=b;c[f>>2]=c[e>>2];c[g>>2]=(c[f>>2]|0)+160;c[d>>2]=pg()|0;e=c[g>>2]|0;c[e>>2]=-205731576;c[e+4>>2]=1779033703;e=(c[g>>2]|0)+8|0;c[e>>2]=-2067093701;c[e+4>>2]=-1150833019;e=(c[g>>2]|0)+16|0;c[e>>2]=-23791573;c[e+4>>2]=1013904242;e=(c[g>>2]|0)+24|0;c[e>>2]=1595750129;c[e+4>>2]=-1521486534;e=(c[g>>2]|0)+32|0;c[e>>2]=-1377402159;c[e+4>>2]=1359893119;e=(c[g>>2]|0)+40|0;c[e>>2]=725511199;c[e+4>>2]=-1694144372;e=(c[g>>2]|0)+48|0;c[e>>2]=-79577749;c[e+4>>2]=528734635;e=(c[g>>2]|0)+56|0;c[e>>2]=327033209;c[e+4>>2]=1541459225;e=(c[f>>2]|0)+128|0;c[e>>2]=0;c[e+4>>2]=0;e=(c[f>>2]|0)+136|0;c[e>>2]=0;c[e+4>>2]=0;c[(c[f>>2]|0)+144>>2]=0;c[(c[f>>2]|0)+148>>2]=128;c[(c[f>>2]|0)+152>>2]=34;l=d;return}function om(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;d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>2]|0)+160+56|0;tm(c[n>>2]|0,c[g>>2]|0,c[g+4>>2]|0);c[n>>2]=(c[n>>2]|0)+8;l=d;return}function pm(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=c[d>>2];l=b;return c[e>>2]|0}function qm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;switch(c[f>>2]|0){case 9:{c[i>>2]=rm(c[g>>2]|0,c[h>>2]|0)|0;break}case 10:{c[i>>2]=sm(c[g>>2]|0,c[h>>2]|0)|0;break}default:c[i>>2]=5}l=e;return c[i>>2]|0}function rm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;i=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=42861;c[i>>2]=Mr(9,0,42874,3,43221,48)|0;do if(!(c[i>>2]|0)){if(c[f>>2]|0){c[h>>2]=42943;c[i>>2]=Mr(9,0,42955,112,43270,48)|0;if(c[i>>2]|0)break;c[h>>2]=43133;c[i>>2]=Mr(9,1,0,0,43319,48)|0;if(c[i>>2]|0)break}c[e>>2]=0;j=c[e>>2]|0;l=d;return j|0}while(0);if(c[g>>2]|0)Eb[c[g>>2]&1](43214,9,c[h>>2]|0,c[i>>2]|0);c[e>>2]=50;j=c[e>>2]|0;l=d;return j|0}function sm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;i=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=42861;c[i>>2]=Mr(10,0,42874,3,42878,64)|0;do if(!(c[i>>2]|0)){if(c[f>>2]|0){c[h>>2]=42943;c[i>>2]=Mr(10,0,42955,112,43068,64)|0;if(c[i>>2]|0)break;c[h>>2]=43133;c[i>>2]=Mr(10,1,0,0,43149,64)|0;if(c[i>>2]|0)break}c[e>>2]=0;j=c[e>>2]|0;l=d;return j|0}while(0);if(c[g>>2]|0)Eb[c[g>>2]&1](43214,10,c[h>>2]|0,c[i>>2]|0);c[e>>2]=50;j=c[e>>2]|0;l=d;return j|0}function tm(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+12|0;h=f;i=f+8|0;c[g>>2]=b;b=h;c[b>>2]=d;c[b+4>>2]=e;c[i>>2]=c[g>>2];g=h;e=cx(c[g>>2]|0,c[g+4>>2]|0,56)|0;a[c[i>>2]>>0]=e;e=h;g=cx(c[e>>2]|0,c[e+4>>2]|0,48)|0;a[(c[i>>2]|0)+1>>0]=g;g=h;e=cx(c[g>>2]|0,c[g+4>>2]|0,40)|0;a[(c[i>>2]|0)+2>>0]=e;a[(c[i>>2]|0)+3>>0]=c[h+4>>2];e=h;g=cx(c[e>>2]|0,c[e+4>>2]|0,24)|0;a[(c[i>>2]|0)+4>>0]=g;g=h;e=cx(c[g>>2]|0,c[g+4>>2]|0,16)|0;a[(c[i>>2]|0)+5>>0]=e;e=h;g=cx(c[e>>2]|0,c[e+4>>2]|0,8)|0;a[(c[i>>2]|0)+6>>0]=g;a[(c[i>>2]|0)+7>>0]=c[h>>2];l=f;return}function um(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+16|0;g=e+12|0;h=e+8|0;i=e+4|0;j=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[i>>2]=c[f>>2];do{c[j>>2]=(vm((c[i>>2]|0)+160|0,c[g>>2]|0)|0)+12;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)>=(m|0))$(32);e=d+16|0;f=d+8|0;g=d+4|0;c[e>>2]=a;c[d+12>>2]=b;c[f>>2]=c[e>>2];c[g>>2]=(c[f>>2]|0)+160;c[d>>2]=pg()|0;e=c[g>>2]|0;c[e>>2]=-1056596264;c[e+4>>2]=-876896931;e=(c[g>>2]|0)+8|0;c[e>>2]=914150663;c[e+4>>2]=1654270250;e=(c[g>>2]|0)+16|0;c[e>>2]=812702999;c[e+4>>2]=-1856437926;e=(c[g>>2]|0)+24|0;c[e>>2]=-150054599;c[e+4>>2]=355462360;e=(c[g>>2]|0)+32|0;c[e>>2]=-4191439;c[e+4>>2]=1731405415;e=(c[g>>2]|0)+40|0;c[e>>2]=1750603025;c[e+4>>2]=-1900787065;e=(c[g>>2]|0)+48|0;c[e>>2]=1694076839;c[e+4>>2]=-619958771;e=(c[g>>2]|0)+56|0;c[e>>2]=-1090891868;c[e+4>>2]=1203062813;e=(c[f>>2]|0)+128|0;c[e>>2]=0;c[e+4>>2]=0;e=(c[f>>2]|0)+136|0;c[e>>2]=0;c[e+4>>2]=0;c[(c[f>>2]|0)+144>>2]=0;c[(c[f>>2]|0)+148>>2]=128;c[(c[f>>2]|0)+152>>2]=34;l=d;return}function Dm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e+16|0;g=e+12|0;h=e+8|0;i=e+4|0;j=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[i>>2]=c[f>>2];c[j>>2]=Km(c[i>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;bf(47);cf();l=e;return c[j>>2]|0}function Em(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[i>>2]=c[f>>2];Jm(c[i>>2]|0,c[g>>2]|0,c[h>>2]|0);l=e;return 36}function Fm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[i>>2]=c[f>>2];Gm(c[i>>2]|0,c[g>>2]|0,c[h>>2]|0);l=e;return 36}function Gm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;e=l;l=l+48|0;if((l|0)>=(m|0))$(48);f=e+32|0;g=e+28|0;h=e+24|0;i=e+20|0;j=e+16|0;k=e+12|0;n=e+8|0;o=e+4|0;p=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=Hm(c[h>>2]|0)|0;c[k>>2]=c[k>>2]^c[(c[f>>2]|0)+4096+16>>2];c[n>>2]=Hm((c[h>>2]|0)+4|0)|0;c[n>>2]=c[n>>2]^c[(c[f>>2]|0)+4096+20>>2];c[i>>2]=Hm((c[h>>2]|0)+8|0)|0;c[i>>2]=c[i>>2]^c[(c[f>>2]|0)+4096+24>>2];c[j>>2]=Hm((c[h>>2]|0)+12|0)|0;c[j>>2]=c[j>>2]^c[(c[f>>2]|0)+4096+28>>2];c[o>>2]=c[(c[f>>2]|0)+((c[k>>2]&255)<<2)>>2]^c[(c[f>>2]|0)+1024+(((c[k>>2]|0)>>>8&255)<<2)>>2]^c[(c[f>>2]|0)+2048+(((c[k>>2]|0)>>>16&255)<<2)>>2]^c[(c[f>>2]|0)+3072+((c[k>>2]|0)>>>24<<2)>>2];c[p>>2]=c[(c[f>>2]|0)+1024+((c[n>>2]&255)<<2)>>2]^c[(c[f>>2]|0)+2048+(((c[n>>2]|0)>>>8&255)<<2)>>2]^c[(c[f>>2]|0)+3072+(((c[n>>2]|0)>>>16&255)<<2)>>2]^c[(c[f>>2]|0)+((c[n>>2]|0)>>>24<<2)>>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0)+4096+8>>2];Im((c[g>>2]|0)+8|0,c[k>>2]|0);c[n>>2]=c[n>>2]^c[(c[f>>2]|0)+4096+12>>2];Im((c[g>>2]|0)+12|0,c[n>>2]|0);l=e;return}function Hm(a){a=a|0;var b=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=b+4|0;f=b;c[e>>2]=a;c[f>>2]=c[e>>2];l=b;return (d[(c[f>>2]|0)+3>>0]|0)<<24|(d[(c[f>>2]|0)+2>>0]|0)<<16|(d[(c[f>>2]|0)+1>>0]|0)<<8|(d[c[f>>2]>>0]|0)|0}function Im(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=b;c[g>>2]=d;c[h>>2]=c[f>>2];a[(c[h>>2]|0)+3>>0]=(c[g>>2]|0)>>>24;a[(c[h>>2]|0)+2>>0]=(c[g>>2]|0)>>>16;a[(c[h>>2]|0)+1>>0]=(c[g>>2]|0)>>>8;a[c[h>>2]>>0]=c[g>>2];l=e;return}function Jm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;e=l;l=l+48|0;if((l|0)>=(m|0))$(48);f=e+32|0;g=e+28|0;h=e+24|0;i=e+20|0;j=e+16|0;k=e+12|0;n=e+8|0;o=e+4|0;p=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[i>>2]=Hm(c[h>>2]|0)|0;c[i>>2]=c[i>>2]^c[(c[f>>2]|0)+4096>>2];c[j>>2]=Hm((c[h>>2]|0)+4|0)|0;c[j>>2]=c[j>>2]^c[(c[f>>2]|0)+4096+4>>2];c[k>>2]=Hm((c[h>>2]|0)+8|0)|0;c[k>>2]=c[k>>2]^c[(c[f>>2]|0)+4096+8>>2];c[n>>2]=Hm((c[h>>2]|0)+12|0)|0;c[n>>2]=c[n>>2]^c[(c[f>>2]|0)+4096+12>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)+4|0,c[n>>2]|0);c[i>>2]=c[i>>2]^c[(c[f>>2]|0)+4096+24>>2];Im((c[g>>2]|0)+8|0,c[i>>2]|0);c[j>>2]=c[j>>2]^c[(c[f>>2]|0)+4096+28>>2];Im((c[g>>2]|0)+12|0,c[j>>2]|0);l=e;return} -function Km(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0;g=l;l=l+64|0;if((l|0)>=(m|0))$(64);h=g;i=g+36|0;j=g+32|0;k=g+28|0;n=g+24|0;o=g+20|0;p=g+16|0;q=g+12|0;r=g+8|0;s=g+4|0;t=g+56|0;u=g+55|0;v=g+54|0;w=g+53|0;x=g+52|0;y=g+51|0;z=g+50|0;A=g+49|0;B=g+48|0;C=g+47|0;D=g+46|0;E=g+45|0;F=g+44|0;G=g+43|0;H=g+42|0;I=g+41|0;J=g+40|0;c[j>>2]=b;c[k>>2]=e;c[n>>2]=f;a[t>>0]=0;a[u>>0]=0;a[v>>0]=0;a[w>>0]=0;a[x>>0]=0;a[y>>0]=0;a[z>>0]=0;a[A>>0]=0;a[B>>0]=0;a[C>>0]=0;a[D>>0]=0;a[E>>0]=0;a[F>>0]=0;a[G>>0]=0;a[H>>0]=0;a[I>>0]=0;if(((c[n>>2]|0)-16|16|0)!=16){c[i>>2]=44;K=c[i>>2]|0;l=g;return K|0}if((c[17740]|0)==0?(c[17740]=1,c[17741]=Lm()|0,c[17741]|0):0){c[h>>2]=c[17741];Ve(43492,h)}if(c[17741]|0){c[i>>2]=50;K=c[i>>2]|0;l=g;return K|0}if(a[c[k>>2]>>0]|0){a[J>>0]=a[43496+((d[c[k>>2]>>0]|0)-1)>>0]|0;a[t>>0]=d[t>>0]^d[43751+((d[J>>0]|0)+0)>>0];a[u>>0]=d[u>>0]^d[43751+((d[J>>0]|0)+45)>>0];a[v>>0]=d[v>>0]^d[43751+((d[J>>0]|0)+1)>>0];a[w>>0]=d[w>>0]^d[43751+((d[J>>0]|0)+45)>>0]}if(a[(c[k>>2]|0)+1>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+1>>0]|0)-1)>>0]|0;a[t>>0]=d[t>>0]^d[43751+((d[J>>0]|0)+45)>>0];a[u>>0]=d[u>>0]^d[43751+((d[J>>0]|0)+164)>>0];a[v>>0]=d[v>>0]^d[43751+((d[J>>0]|0)+68)>>0];a[w>>0]=d[w>>0]^d[43751+((d[J>>0]|0)+138)>>0]}if(a[(c[k>>2]|0)+2>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+2>>0]|0)-1)>>0]|0;a[t>>0]=d[t>>0]^d[43751+((d[J>>0]|0)+138)>>0];a[u>>0]=d[u>>0]^d[43751+((d[J>>0]|0)+213)>>0];a[v>>0]=d[v>>0]^d[43751+((d[J>>0]|0)+191)>>0];a[w>>0]=d[w>>0]^d[43751+((d[J>>0]|0)+209)>>0]}if(a[(c[k>>2]|0)+3>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+3>>0]|0)-1)>>0]|0;a[t>>0]=d[t>>0]^d[43751+((d[J>>0]|0)+209)>>0];a[u>>0]=d[u>>0]^d[43751+((d[J>>0]|0)+127)>>0];a[v>>0]=d[v>>0]^d[43751+((d[J>>0]|0)+61)>>0];a[w>>0]=d[w>>0]^d[43751+((d[J>>0]|0)+153)>>0]}if(a[(c[k>>2]|0)+4>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+4>>0]|0)-1)>>0]|0;a[t>>0]=d[t>>0]^d[43751+((d[J>>0]|0)+153)>>0];a[u>>0]=d[u>>0]^d[43751+((d[J>>0]|0)+70)>>0];a[v>>0]=d[v>>0]^d[43751+((d[J>>0]|0)+102)>>0];a[w>>0]=d[w>>0]^d[43751+((d[J>>0]|0)+150)>>0]}if(a[(c[k>>2]|0)+5>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+5>>0]|0)-1)>>0]|0;a[t>>0]=d[t>>0]^d[43751+((d[J>>0]|0)+150)>>0];a[u>>0]=d[u>>0]^d[43751+((d[J>>0]|0)+60)>>0];a[v>>0]=d[v>>0]^d[43751+((d[J>>0]|0)+91)>>0];a[w>>0]=d[w>>0]^d[43751+((d[J>>0]|0)+237)>>0]}if(a[(c[k>>2]|0)+6>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+6>>0]|0)-1)>>0]|0;a[t>>0]=d[t>>0]^d[43751+((d[J>>0]|0)+237)>>0];a[u>>0]=d[u>>0]^d[43751+((d[J>>0]|0)+55)>>0];a[v>>0]=d[v>>0]^d[43751+((d[J>>0]|0)+79)>>0];a[w>>0]=d[w>>0]^d[43751+((d[J>>0]|0)+224)>>0]}if(a[(c[k>>2]|0)+7>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+7>>0]|0)-1)>>0]|0;a[t>>0]=d[t>>0]^d[43751+((d[J>>0]|0)+224)>>0];a[u>>0]=d[u>>0]^d[43751+((d[J>>0]|0)+208)>>0];a[v>>0]=d[v>>0]^d[43751+((d[J>>0]|0)+140)>>0];a[w>>0]=d[w>>0]^d[43751+((d[J>>0]|0)+23)>>0]}if(a[(c[k>>2]|0)+8>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+8>>0]|0)-1)>>0]|0;a[x>>0]=d[x>>0]^d[43751+((d[J>>0]|0)+0)>>0];a[y>>0]=d[y>>0]^d[43751+((d[J>>0]|0)+45)>>0];a[z>>0]=d[z>>0]^d[43751+((d[J>>0]|0)+1)>>0];a[A>>0]=d[A>>0]^d[43751+((d[J>>0]|0)+45)>>0]}if(a[(c[k>>2]|0)+9>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+9>>0]|0)-1)>>0]|0;a[x>>0]=d[x>>0]^d[43751+((d[J>>0]|0)+45)>>0];a[y>>0]=d[y>>0]^d[43751+((d[J>>0]|0)+164)>>0];a[z>>0]=d[z>>0]^d[43751+((d[J>>0]|0)+68)>>0];a[A>>0]=d[A>>0]^d[43751+((d[J>>0]|0)+138)>>0]}if(a[(c[k>>2]|0)+10>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+10>>0]|0)-1)>>0]|0;a[x>>0]=d[x>>0]^d[43751+((d[J>>0]|0)+138)>>0];a[y>>0]=d[y>>0]^d[43751+((d[J>>0]|0)+213)>>0];a[z>>0]=d[z>>0]^d[43751+((d[J>>0]|0)+191)>>0];a[A>>0]=d[A>>0]^d[43751+((d[J>>0]|0)+209)>>0]}if(a[(c[k>>2]|0)+11>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+11>>0]|0)-1)>>0]|0;a[x>>0]=d[x>>0]^d[43751+((d[J>>0]|0)+209)>>0];a[y>>0]=d[y>>0]^d[43751+((d[J>>0]|0)+127)>>0];a[z>>0]=d[z>>0]^d[43751+((d[J>>0]|0)+61)>>0];a[A>>0]=d[A>>0]^d[43751+((d[J>>0]|0)+153)>>0]}if(a[(c[k>>2]|0)+12>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+12>>0]|0)-1)>>0]|0;a[x>>0]=d[x>>0]^d[43751+((d[J>>0]|0)+153)>>0];a[y>>0]=d[y>>0]^d[43751+((d[J>>0]|0)+70)>>0];a[z>>0]=d[z>>0]^d[43751+((d[J>>0]|0)+102)>>0];a[A>>0]=d[A>>0]^d[43751+((d[J>>0]|0)+150)>>0]}if(a[(c[k>>2]|0)+13>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+13>>0]|0)-1)>>0]|0;a[x>>0]=d[x>>0]^d[43751+((d[J>>0]|0)+150)>>0];a[y>>0]=d[y>>0]^d[43751+((d[J>>0]|0)+60)>>0];a[z>>0]=d[z>>0]^d[43751+((d[J>>0]|0)+91)>>0];a[A>>0]=d[A>>0]^d[43751+((d[J>>0]|0)+237)>>0]}if(a[(c[k>>2]|0)+14>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+14>>0]|0)-1)>>0]|0;a[x>>0]=d[x>>0]^d[43751+((d[J>>0]|0)+237)>>0];a[y>>0]=d[y>>0]^d[43751+((d[J>>0]|0)+55)>>0];a[z>>0]=d[z>>0]^d[43751+((d[J>>0]|0)+79)>>0];a[A>>0]=d[A>>0]^d[43751+((d[J>>0]|0)+224)>>0]}if(a[(c[k>>2]|0)+15>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+15>>0]|0)-1)>>0]|0;a[x>>0]=d[x>>0]^d[43751+((d[J>>0]|0)+224)>>0];a[y>>0]=d[y>>0]^d[43751+((d[J>>0]|0)+208)>>0];a[z>>0]=d[z>>0]^d[43751+((d[J>>0]|0)+140)>>0];a[A>>0]=d[A>>0]^d[43751+((d[J>>0]|0)+23)>>0]}if((c[n>>2]|0)==32){if(a[(c[k>>2]|0)+16>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+16>>0]|0)-1)>>0]|0;a[B>>0]=d[B>>0]^d[43751+((d[J>>0]|0)+0)>>0];a[C>>0]=d[C>>0]^d[43751+((d[J>>0]|0)+45)>>0];a[D>>0]=d[D>>0]^d[43751+((d[J>>0]|0)+1)>>0];a[E>>0]=d[E>>0]^d[43751+((d[J>>0]|0)+45)>>0]}if(a[(c[k>>2]|0)+17>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+17>>0]|0)-1)>>0]|0;a[B>>0]=d[B>>0]^d[43751+((d[J>>0]|0)+45)>>0];a[C>>0]=d[C>>0]^d[43751+((d[J>>0]|0)+164)>>0];a[D>>0]=d[D>>0]^d[43751+((d[J>>0]|0)+68)>>0];a[E>>0]=d[E>>0]^d[43751+((d[J>>0]|0)+138)>>0]}if(a[(c[k>>2]|0)+18>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+18>>0]|0)-1)>>0]|0;a[B>>0]=d[B>>0]^d[43751+((d[J>>0]|0)+138)>>0];a[C>>0]=d[C>>0]^d[43751+((d[J>>0]|0)+213)>>0];a[D>>0]=d[D>>0]^d[43751+((d[J>>0]|0)+191)>>0];a[E>>0]=d[E>>0]^d[43751+((d[J>>0]|0)+209)>>0]}if(a[(c[k>>2]|0)+19>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+19>>0]|0)-1)>>0]|0;a[B>>0]=d[B>>0]^d[43751+((d[J>>0]|0)+209)>>0];a[C>>0]=d[C>>0]^d[43751+((d[J>>0]|0)+127)>>0];a[D>>0]=d[D>>0]^d[43751+((d[J>>0]|0)+61)>>0];a[E>>0]=d[E>>0]^d[43751+((d[J>>0]|0)+153)>>0]}if(a[(c[k>>2]|0)+20>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+20>>0]|0)-1)>>0]|0;a[B>>0]=d[B>>0]^d[43751+((d[J>>0]|0)+153)>>0];a[C>>0]=d[C>>0]^d[43751+((d[J>>0]|0)+70)>>0];a[D>>0]=d[D>>0]^d[43751+((d[J>>0]|0)+102)>>0];a[E>>0]=d[E>>0]^d[43751+((d[J>>0]|0)+150)>>0]}if(a[(c[k>>2]|0)+21>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+21>>0]|0)-1)>>0]|0;a[B>>0]=d[B>>0]^d[43751+((d[J>>0]|0)+150)>>0];a[C>>0]=d[C>>0]^d[43751+((d[J>>0]|0)+60)>>0];a[D>>0]=d[D>>0]^d[43751+((d[J>>0]|0)+91)>>0];a[E>>0]=d[E>>0]^d[43751+((d[J>>0]|0)+237)>>0]}if(a[(c[k>>2]|0)+22>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+22>>0]|0)-1)>>0]|0;a[B>>0]=d[B>>0]^d[43751+((d[J>>0]|0)+237)>>0];a[C>>0]=d[C>>0]^d[43751+((d[J>>0]|0)+55)>>0];a[D>>0]=d[D>>0]^d[43751+((d[J>>0]|0)+79)>>0];a[E>>0]=d[E>>0]^d[43751+((d[J>>0]|0)+224)>>0]}if(a[(c[k>>2]|0)+23>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+23>>0]|0)-1)>>0]|0;a[B>>0]=d[B>>0]^d[43751+((d[J>>0]|0)+224)>>0];a[C>>0]=d[C>>0]^d[43751+((d[J>>0]|0)+208)>>0];a[D>>0]=d[D>>0]^d[43751+((d[J>>0]|0)+140)>>0];a[E>>0]=d[E>>0]^d[43751+((d[J>>0]|0)+23)>>0]}if(a[(c[k>>2]|0)+24>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+24>>0]|0)-1)>>0]|0;a[F>>0]=d[F>>0]^d[43751+((d[J>>0]|0)+0)>>0];a[G>>0]=d[G>>0]^d[43751+((d[J>>0]|0)+45)>>0];a[H>>0]=d[H>>0]^d[43751+((d[J>>0]|0)+1)>>0];a[I>>0]=d[I>>0]^d[43751+((d[J>>0]|0)+45)>>0]}if(a[(c[k>>2]|0)+25>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+25>>0]|0)-1)>>0]|0;a[F>>0]=d[F>>0]^d[43751+((d[J>>0]|0)+45)>>0];a[G>>0]=d[G>>0]^d[43751+((d[J>>0]|0)+164)>>0];a[H>>0]=d[H>>0]^d[43751+((d[J>>0]|0)+68)>>0];a[I>>0]=d[I>>0]^d[43751+((d[J>>0]|0)+138)>>0]}if(a[(c[k>>2]|0)+26>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+26>>0]|0)-1)>>0]|0;a[F>>0]=d[F>>0]^d[43751+((d[J>>0]|0)+138)>>0];a[G>>0]=d[G>>0]^d[43751+((d[J>>0]|0)+213)>>0];a[H>>0]=d[H>>0]^d[43751+((d[J>>0]|0)+191)>>0];a[I>>0]=d[I>>0]^d[43751+((d[J>>0]|0)+209)>>0]}if(a[(c[k>>2]|0)+27>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+27>>0]|0)-1)>>0]|0;a[F>>0]=d[F>>0]^d[43751+((d[J>>0]|0)+209)>>0];a[G>>0]=d[G>>0]^d[43751+((d[J>>0]|0)+127)>>0];a[H>>0]=d[H>>0]^d[43751+((d[J>>0]|0)+61)>>0];a[I>>0]=d[I>>0]^d[43751+((d[J>>0]|0)+153)>>0]}if(a[(c[k>>2]|0)+28>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+28>>0]|0)-1)>>0]|0;a[F>>0]=d[F>>0]^d[43751+((d[J>>0]|0)+153)>>0];a[G>>0]=d[G>>0]^d[43751+((d[J>>0]|0)+70)>>0];a[H>>0]=d[H>>0]^d[43751+((d[J>>0]|0)+102)>>0];a[I>>0]=d[I>>0]^d[43751+((d[J>>0]|0)+150)>>0]}if(a[(c[k>>2]|0)+29>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+29>>0]|0)-1)>>0]|0;a[F>>0]=d[F>>0]^d[43751+((d[J>>0]|0)+150)>>0];a[G>>0]=d[G>>0]^d[43751+((d[J>>0]|0)+60)>>0];a[H>>0]=d[H>>0]^d[43751+((d[J>>0]|0)+91)>>0];a[I>>0]=d[I>>0]^d[43751+((d[J>>0]|0)+237)>>0]}if(a[(c[k>>2]|0)+30>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+30>>0]|0)-1)>>0]|0;a[F>>0]=d[F>>0]^d[43751+((d[J>>0]|0)+237)>>0];a[G>>0]=d[G>>0]^d[43751+((d[J>>0]|0)+55)>>0];a[H>>0]=d[H>>0]^d[43751+((d[J>>0]|0)+79)>>0];a[I>>0]=d[I>>0]^d[43751+((d[J>>0]|0)+224)>>0]}if(a[(c[k>>2]|0)+31>>0]|0){a[J>>0]=a[43496+((d[(c[k>>2]|0)+31>>0]|0)-1)>>0]|0;a[F>>0]=d[F>>0]^d[43751+((d[J>>0]|0)+224)>>0];a[G>>0]=d[G>>0]^d[43751+((d[J>>0]|0)+208)>>0];a[H>>0]=d[H>>0]^d[43751+((d[J>>0]|0)+140)>>0];a[I>>0]=d[I>>0]^d[43751+((d[J>>0]|0)+23)>>0]}c[p>>2]=0;c[o>>2]=0;c[q>>2]=1;while(1){if((c[o>>2]|0)>=256)break;c[(c[j>>2]|0)+(c[o>>2]<<2)>>2]=c[8432+((d[45011+(d[45011+(d[44755+(d[44243+(c[q>>2]|0)>>0]^d[t>>0])>>0]^d[x>>0])>>0]^d[B>>0])>>0]^d[F>>0])<<2)>>2];c[(c[j>>2]|0)+1024+(c[o>>2]<<2)>>2]=c[9456+((d[45011+(d[44755+(d[44755+(d[44243+(c[p>>2]|0)>>0]^d[u>>0])>>0]^d[y>>0])>>0]^d[C>>0])>>0]^d[G>>0])<<2)>>2];c[(c[j>>2]|0)+2048+(c[o>>2]<<2)>>2]=c[10480+((d[44755+(d[45011+(d[45011+(d[44243+(c[p>>2]|0)>>0]^d[v>>0])>>0]^d[z>>0])>>0]^d[D>>0])>>0]^d[H>>0])<<2)>>2];c[(c[j>>2]|0)+3072+(c[o>>2]<<2)>>2]=c[11504+((d[44755+(d[44755+(d[45011+(d[44243+(c[q>>2]|0)>>0]^d[w>>0])>>0]^d[A>>0])>>0]^d[E>>0])>>0]^d[I>>0])<<2)>>2];c[o>>2]=(c[o>>2]|0)+1;c[p>>2]=(c[p>>2]|0)+2;c[q>>2]=(c[q>>2]|0)+2}c[r>>2]=c[8432+((d[45011+(d[45011+(d[44755+(117^d[(c[k>>2]|0)+24>>0])>>0]^d[(c[k>>2]|0)+16>>0])>>0]^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(169^d[(c[k>>2]|0)+25>>0])>>0]^d[(c[k>>2]|0)+17>>0])>>0]^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(169^d[(c[k>>2]|0)+26>>0])>>0]^d[(c[k>>2]|0)+18>>0])>>0]^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(117^d[(c[k>>2]|0)+27>>0])>>0]^d[(c[k>>2]|0)+19>>0])>>0]^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(d[45011+(d[44755+(243^d[(c[k>>2]|0)+28>>0])>>0]^d[(c[k>>2]|0)+20>>0])>>0]^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(103^d[(c[k>>2]|0)+29>>0])>>0]^d[(c[k>>2]|0)+21>>0])>>0]^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(103^d[(c[k>>2]|0)+30>>0])>>0]^d[(c[k>>2]|0)+22>>0])>>0]^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(243^d[(c[k>>2]|0)+31>>0])>>0]^d[(c[k>>2]|0)+23>>0])>>0]^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4096>>2]=c[r>>2];c[(c[j>>2]|0)+4096+4>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(d[45011+(d[44755+(198^d[(c[k>>2]|0)+24>>0])>>0]^d[(c[k>>2]|0)+16>>0])>>0]^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(179^d[(c[k>>2]|0)+25>>0])>>0]^d[(c[k>>2]|0)+17>>0])>>0]^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(179^d[(c[k>>2]|0)+26>>0])>>0]^d[(c[k>>2]|0)+18>>0])>>0]^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(198^d[(c[k>>2]|0)+27>>0])>>0]^d[(c[k>>2]|0)+19>>0])>>0]^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(d[45011+(d[44755+(244^d[(c[k>>2]|0)+28>>0])>>0]^d[(c[k>>2]|0)+20>>0])>>0]^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(232^d[(c[k>>2]|0)+29>>0])>>0]^d[(c[k>>2]|0)+21>>0])>>0]^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(232^d[(c[k>>2]|0)+30>>0])>>0]^d[(c[k>>2]|0)+22>>0])>>0]^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(244^d[(c[k>>2]|0)+31>>0])>>0]^d[(c[k>>2]|0)+23>>0])>>0]^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4096+8>>2]=c[r>>2];c[(c[j>>2]|0)+4096+12>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(d[45011+(d[44755+(219^d[(c[k>>2]|0)+24>>0])>>0]^d[(c[k>>2]|0)+16>>0])>>0]^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(4^d[(c[k>>2]|0)+25>>0])>>0]^d[(c[k>>2]|0)+17>>0])>>0]^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(4^d[(c[k>>2]|0)+26>>0])>>0]^d[(c[k>>2]|0)+18>>0])>>0]^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(219^d[(c[k>>2]|0)+27>>0])>>0]^d[(c[k>>2]|0)+19>>0])>>0]^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(d[45011+(d[44755+(123^d[(c[k>>2]|0)+28>>0])>>0]^d[(c[k>>2]|0)+20>>0])>>0]^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(253^d[(c[k>>2]|0)+29>>0])>>0]^d[(c[k>>2]|0)+21>>0])>>0]^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(253^d[(c[k>>2]|0)+30>>0])>>0]^d[(c[k>>2]|0)+22>>0])>>0]^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(123^d[(c[k>>2]|0)+31>>0])>>0]^d[(c[k>>2]|0)+23>>0])>>0]^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4096+16>>2]=c[r>>2];c[(c[j>>2]|0)+4096+20>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(d[45011+(d[44755+(251^d[(c[k>>2]|0)+24>>0])>>0]^d[(c[k>>2]|0)+16>>0])>>0]^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(163^d[(c[k>>2]|0)+25>>0])>>0]^d[(c[k>>2]|0)+17>>0])>>0]^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(163^d[(c[k>>2]|0)+26>>0])>>0]^d[(c[k>>2]|0)+18>>0])>>0]^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(251^d[(c[k>>2]|0)+27>>0])>>0]^d[(c[k>>2]|0)+19>>0])>>0]^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(d[45011+(d[44755+(200^d[(c[k>>2]|0)+28>>0])>>0]^d[(c[k>>2]|0)+20>>0])>>0]^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(118^d[(c[k>>2]|0)+29>>0])>>0]^d[(c[k>>2]|0)+21>>0])>>0]^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(118^d[(c[k>>2]|0)+30>>0])>>0]^d[(c[k>>2]|0)+22>>0])>>0]^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(200^d[(c[k>>2]|0)+31>>0])>>0]^d[(c[k>>2]|0)+23>>0])>>0]^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4096+24>>2]=c[r>>2];c[(c[j>>2]|0)+4096+28>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(d[45011+(d[44755+(74^d[(c[k>>2]|0)+24>>0])>>0]^d[(c[k>>2]|0)+16>>0])>>0]^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(154^d[(c[k>>2]|0)+25>>0])>>0]^d[(c[k>>2]|0)+17>>0])>>0]^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(154^d[(c[k>>2]|0)+26>>0])>>0]^d[(c[k>>2]|0)+18>>0])>>0]^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(74^d[(c[k>>2]|0)+27>>0])>>0]^d[(c[k>>2]|0)+19>>0])>>0]^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(d[45011+(d[44755+(211^d[(c[k>>2]|0)+28>>0])>>0]^d[(c[k>>2]|0)+20>>0])>>0]^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(146^d[(c[k>>2]|0)+29>>0])>>0]^d[(c[k>>2]|0)+21>>0])>>0]^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(146^d[(c[k>>2]|0)+30>>0])>>0]^d[(c[k>>2]|0)+22>>0])>>0]^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(211^d[(c[k>>2]|0)+31>>0])>>0]^d[(c[k>>2]|0)+23>>0])>>0]^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128>>2]=c[r>>2];c[(c[j>>2]|0)+4128+4>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(d[45011+(d[44755+(230^d[(c[k>>2]|0)+24>>0])>>0]^d[(c[k>>2]|0)+16>>0])>>0]^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(128^d[(c[k>>2]|0)+25>>0])>>0]^d[(c[k>>2]|0)+17>>0])>>0]^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(128^d[(c[k>>2]|0)+26>>0])>>0]^d[(c[k>>2]|0)+18>>0])>>0]^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(230^d[(c[k>>2]|0)+27>>0])>>0]^d[(c[k>>2]|0)+19>>0])>>0]^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(d[45011+(d[44755+(107^d[(c[k>>2]|0)+28>>0])>>0]^d[(c[k>>2]|0)+20>>0])>>0]^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(120^d[(c[k>>2]|0)+29>>0])>>0]^d[(c[k>>2]|0)+21>>0])>>0]^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(120^d[(c[k>>2]|0)+30>>0])>>0]^d[(c[k>>2]|0)+22>>0])>>0]^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(107^d[(c[k>>2]|0)+31>>0])>>0]^d[(c[k>>2]|0)+23>>0])>>0]^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+8>>2]=c[r>>2];c[(c[j>>2]|0)+4128+12>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(d[45011+(d[44755+(69^d[(c[k>>2]|0)+24>>0])>>0]^d[(c[k>>2]|0)+16>>0])>>0]^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(228^d[(c[k>>2]|0)+25>>0])>>0]^d[(c[k>>2]|0)+17>>0])>>0]^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(228^d[(c[k>>2]|0)+26>>0])>>0]^d[(c[k>>2]|0)+18>>0])>>0]^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(69^d[(c[k>>2]|0)+27>>0])>>0]^d[(c[k>>2]|0)+19>>0])>>0]^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(d[45011+(d[44755+(125^d[(c[k>>2]|0)+28>>0])>>0]^d[(c[k>>2]|0)+20>>0])>>0]^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(221^d[(c[k>>2]|0)+29>>0])>>0]^d[(c[k>>2]|0)+21>>0])>>0]^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(221^d[(c[k>>2]|0)+30>>0])>>0]^d[(c[k>>2]|0)+22>>0])>>0]^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(125^d[(c[k>>2]|0)+31>>0])>>0]^d[(c[k>>2]|0)+23>>0])>>0]^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+16>>2]=c[r>>2];c[(c[j>>2]|0)+4128+20>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(d[45011+(d[44755+(232^d[(c[k>>2]|0)+24>>0])>>0]^d[(c[k>>2]|0)+16>>0])>>0]^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(209^d[(c[k>>2]|0)+25>>0])>>0]^d[(c[k>>2]|0)+17>>0])>>0]^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(209^d[(c[k>>2]|0)+26>>0])>>0]^d[(c[k>>2]|0)+18>>0])>>0]^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(232^d[(c[k>>2]|0)+27>>0])>>0]^d[(c[k>>2]|0)+19>>0])>>0]^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(d[45011+(d[44755+(75^d[(c[k>>2]|0)+28>>0])>>0]^d[(c[k>>2]|0)+20>>0])>>0]^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(56^d[(c[k>>2]|0)+29>>0])>>0]^d[(c[k>>2]|0)+21>>0])>>0]^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(56^d[(c[k>>2]|0)+30>>0])>>0]^d[(c[k>>2]|0)+22>>0])>>0]^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(75^d[(c[k>>2]|0)+31>>0])>>0]^d[(c[k>>2]|0)+23>>0])>>0]^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+24>>2]=c[r>>2];c[(c[j>>2]|0)+4128+28>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(d[45011+(d[44755+(214^d[(c[k>>2]|0)+24>>0])>>0]^d[(c[k>>2]|0)+16>>0])>>0]^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(13^d[(c[k>>2]|0)+25>>0])>>0]^d[(c[k>>2]|0)+17>>0])>>0]^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(13^d[(c[k>>2]|0)+26>>0])>>0]^d[(c[k>>2]|0)+18>>0])>>0]^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(214^d[(c[k>>2]|0)+27>>0])>>0]^d[(c[k>>2]|0)+19>>0])>>0]^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(d[45011+(d[44755+(50^d[(c[k>>2]|0)+28>>0])>>0]^d[(c[k>>2]|0)+20>>0])>>0]^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(198^d[(c[k>>2]|0)+29>>0])>>0]^d[(c[k>>2]|0)+21>>0])>>0]^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(198^d[(c[k>>2]|0)+30>>0])>>0]^d[(c[k>>2]|0)+22>>0])>>0]^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(50^d[(c[k>>2]|0)+31>>0])>>0]^d[(c[k>>2]|0)+23>>0])>>0]^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+32>>2]=c[r>>2];c[(c[j>>2]|0)+4128+36>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(d[45011+(d[44755+(216^d[(c[k>>2]|0)+24>>0])>>0]^d[(c[k>>2]|0)+16>>0])>>0]^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(53^d[(c[k>>2]|0)+25>>0])>>0]^d[(c[k>>2]|0)+17>>0])>>0]^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(53^d[(c[k>>2]|0)+26>>0])>>0]^d[(c[k>>2]|0)+18>>0])>>0]^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(216^d[(c[k>>2]|0)+27>>0])>>0]^d[(c[k>>2]|0)+19>>0])>>0]^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(d[45011+(d[44755+(253^d[(c[k>>2]|0)+28>>0])>>0]^d[(c[k>>2]|0)+20>>0])>>0]^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(152^d[(c[k>>2]|0)+29>>0])>>0]^d[(c[k>>2]|0)+21>>0])>>0]^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(152^d[(c[k>>2]|0)+30>>0])>>0]^d[(c[k>>2]|0)+22>>0])>>0]^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(253^d[(c[k>>2]|0)+31>>0])>>0]^d[(c[k>>2]|0)+23>>0])>>0]^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+40>>2]=c[r>>2];c[(c[j>>2]|0)+4128+44>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(d[45011+(d[44755+(55^d[(c[k>>2]|0)+24>>0])>>0]^d[(c[k>>2]|0)+16>>0])>>0]^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(24^d[(c[k>>2]|0)+25>>0])>>0]^d[(c[k>>2]|0)+17>>0])>>0]^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(24^d[(c[k>>2]|0)+26>>0])>>0]^d[(c[k>>2]|0)+18>>0])>>0]^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(55^d[(c[k>>2]|0)+27>>0])>>0]^d[(c[k>>2]|0)+19>>0])>>0]^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(d[45011+(d[44755+(113^d[(c[k>>2]|0)+28>>0])>>0]^d[(c[k>>2]|0)+20>>0])>>0]^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(247^d[(c[k>>2]|0)+29>>0])>>0]^d[(c[k>>2]|0)+21>>0])>>0]^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(247^d[(c[k>>2]|0)+30>>0])>>0]^d[(c[k>>2]|0)+22>>0])>>0]^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(113^d[(c[k>>2]|0)+31>>0])>>0]^d[(c[k>>2]|0)+23>>0])>>0]^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+48>>2]=c[r>>2];c[(c[j>>2]|0)+4128+52>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(d[45011+(d[44755+(241^d[(c[k>>2]|0)+24>>0])>>0]^d[(c[k>>2]|0)+16>>0])>>0]^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(236^d[(c[k>>2]|0)+25>>0])>>0]^d[(c[k>>2]|0)+17>>0])>>0]^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(236^d[(c[k>>2]|0)+26>>0])>>0]^d[(c[k>>2]|0)+18>>0])>>0]^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(241^d[(c[k>>2]|0)+27>>0])>>0]^d[(c[k>>2]|0)+19>>0])>>0]^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(d[45011+(d[44755+(225^d[(c[k>>2]|0)+28>>0])>>0]^d[(c[k>>2]|0)+20>>0])>>0]^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(108^d[(c[k>>2]|0)+29>>0])>>0]^d[(c[k>>2]|0)+21>>0])>>0]^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(108^d[(c[k>>2]|0)+30>>0])>>0]^d[(c[k>>2]|0)+22>>0])>>0]^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(225^d[(c[k>>2]|0)+31>>0])>>0]^d[(c[k>>2]|0)+23>>0])>>0]^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+56>>2]=c[r>>2];c[(c[j>>2]|0)+4128+60>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(d[45011+(d[44755+(48^d[(c[k>>2]|0)+24>>0])>>0]^d[(c[k>>2]|0)+16>>0])>>0]^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(67^d[(c[k>>2]|0)+25>>0])>>0]^d[(c[k>>2]|0)+17>>0])>>0]^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(67^d[(c[k>>2]|0)+26>>0])>>0]^d[(c[k>>2]|0)+18>>0])>>0]^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(48^d[(c[k>>2]|0)+27>>0])>>0]^d[(c[k>>2]|0)+19>>0])>>0]^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(d[45011+(d[44755+(15^d[(c[k>>2]|0)+28>>0])>>0]^d[(c[k>>2]|0)+20>>0])>>0]^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(117^d[(c[k>>2]|0)+29>>0])>>0]^d[(c[k>>2]|0)+21>>0])>>0]^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(117^d[(c[k>>2]|0)+30>>0])>>0]^d[(c[k>>2]|0)+22>>0])>>0]^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(15^d[(c[k>>2]|0)+31>>0])>>0]^d[(c[k>>2]|0)+23>>0])>>0]^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+64>>2]=c[r>>2];c[(c[j>>2]|0)+4128+68>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(d[45011+(d[44755+(248^d[(c[k>>2]|0)+24>>0])>>0]^d[(c[k>>2]|0)+16>>0])>>0]^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(55^d[(c[k>>2]|0)+25>>0])>>0]^d[(c[k>>2]|0)+17>>0])>>0]^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(55^d[(c[k>>2]|0)+26>>0])>>0]^d[(c[k>>2]|0)+18>>0])>>0]^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(248^d[(c[k>>2]|0)+27>>0])>>0]^d[(c[k>>2]|0)+19>>0])>>0]^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(d[45011+(d[44755+(27^d[(c[k>>2]|0)+28>>0])>>0]^d[(c[k>>2]|0)+20>>0])>>0]^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(38^d[(c[k>>2]|0)+29>>0])>>0]^d[(c[k>>2]|0)+21>>0])>>0]^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(38^d[(c[k>>2]|0)+30>>0])>>0]^d[(c[k>>2]|0)+22>>0])>>0]^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(27^d[(c[k>>2]|0)+31>>0])>>0]^d[(c[k>>2]|0)+23>>0])>>0]^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+72>>2]=c[r>>2];c[(c[j>>2]|0)+4128+76>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(d[45011+(d[44755+(135^d[(c[k>>2]|0)+24>>0])>>0]^d[(c[k>>2]|0)+16>>0])>>0]^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(250^d[(c[k>>2]|0)+25>>0])>>0]^d[(c[k>>2]|0)+17>>0])>>0]^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(250^d[(c[k>>2]|0)+26>>0])>>0]^d[(c[k>>2]|0)+18>>0])>>0]^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(135^d[(c[k>>2]|0)+27>>0])>>0]^d[(c[k>>2]|0)+19>>0])>>0]^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(d[45011+(d[44755+(250^d[(c[k>>2]|0)+28>>0])>>0]^d[(c[k>>2]|0)+20>>0])>>0]^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(19^d[(c[k>>2]|0)+29>>0])>>0]^d[(c[k>>2]|0)+21>>0])>>0]^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(19^d[(c[k>>2]|0)+30>>0])>>0]^d[(c[k>>2]|0)+22>>0])>>0]^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(250^d[(c[k>>2]|0)+31>>0])>>0]^d[(c[k>>2]|0)+23>>0])>>0]^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+80>>2]=c[r>>2];c[(c[j>>2]|0)+4128+84>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(d[45011+(d[44755+(6^d[(c[k>>2]|0)+24>>0])>>0]^d[(c[k>>2]|0)+16>>0])>>0]^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(148^d[(c[k>>2]|0)+25>>0])>>0]^d[(c[k>>2]|0)+17>>0])>>0]^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(148^d[(c[k>>2]|0)+26>>0])>>0]^d[(c[k>>2]|0)+18>>0])>>0]^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(6^d[(c[k>>2]|0)+27>>0])>>0]^d[(c[k>>2]|0)+19>>0])>>0]^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(d[45011+(d[44755+(63^d[(c[k>>2]|0)+28>>0])>>0]^d[(c[k>>2]|0)+20>>0])>>0]^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(72^d[(c[k>>2]|0)+29>>0])>>0]^d[(c[k>>2]|0)+21>>0])>>0]^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(72^d[(c[k>>2]|0)+30>>0])>>0]^d[(c[k>>2]|0)+22>>0])>>0]^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(63^d[(c[k>>2]|0)+31>>0])>>0]^d[(c[k>>2]|0)+23>>0])>>0]^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+88>>2]=c[r>>2];c[(c[j>>2]|0)+4128+92>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(d[45011+(d[44755+(94^d[(c[k>>2]|0)+24>>0])>>0]^d[(c[k>>2]|0)+16>>0])>>0]^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(242^d[(c[k>>2]|0)+25>>0])>>0]^d[(c[k>>2]|0)+17>>0])>>0]^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(242^d[(c[k>>2]|0)+26>>0])>>0]^d[(c[k>>2]|0)+18>>0])>>0]^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(94^d[(c[k>>2]|0)+27>>0])>>0]^d[(c[k>>2]|0)+19>>0])>>0]^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(d[45011+(d[44755+(186^d[(c[k>>2]|0)+28>>0])>>0]^d[(c[k>>2]|0)+20>>0])>>0]^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(208^d[(c[k>>2]|0)+29>>0])>>0]^d[(c[k>>2]|0)+21>>0])>>0]^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(208^d[(c[k>>2]|0)+30>>0])>>0]^d[(c[k>>2]|0)+22>>0])>>0]^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(186^d[(c[k>>2]|0)+31>>0])>>0]^d[(c[k>>2]|0)+23>>0])>>0]^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+96>>2]=c[r>>2];c[(c[j>>2]|0)+4128+100>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(d[45011+(d[44755+(174^d[(c[k>>2]|0)+24>>0])>>0]^d[(c[k>>2]|0)+16>>0])>>0]^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(139^d[(c[k>>2]|0)+25>>0])>>0]^d[(c[k>>2]|0)+17>>0])>>0]^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(139^d[(c[k>>2]|0)+26>>0])>>0]^d[(c[k>>2]|0)+18>>0])>>0]^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(174^d[(c[k>>2]|0)+27>>0])>>0]^d[(c[k>>2]|0)+19>>0])>>0]^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(d[45011+(d[44755+(91^d[(c[k>>2]|0)+28>>0])>>0]^d[(c[k>>2]|0)+20>>0])>>0]^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(48^d[(c[k>>2]|0)+29>>0])>>0]^d[(c[k>>2]|0)+21>>0])>>0]^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(48^d[(c[k>>2]|0)+30>>0])>>0]^d[(c[k>>2]|0)+22>>0])>>0]^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(91^d[(c[k>>2]|0)+31>>0])>>0]^d[(c[k>>2]|0)+23>>0])>>0]^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+104>>2]=c[r>>2];c[(c[j>>2]|0)+4128+108>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(d[45011+(d[44755+(138^d[(c[k>>2]|0)+24>>0])>>0]^d[(c[k>>2]|0)+16>>0])>>0]^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(132^d[(c[k>>2]|0)+25>>0])>>0]^d[(c[k>>2]|0)+17>>0])>>0]^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(132^d[(c[k>>2]|0)+26>>0])>>0]^d[(c[k>>2]|0)+18>>0])>>0]^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(138^d[(c[k>>2]|0)+27>>0])>>0]^d[(c[k>>2]|0)+19>>0])>>0]^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(d[45011+(d[44755+(0^d[(c[k>>2]|0)+28>>0])>>0]^d[(c[k>>2]|0)+20>>0])>>0]^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(84^d[(c[k>>2]|0)+29>>0])>>0]^d[(c[k>>2]|0)+21>>0])>>0]^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(84^d[(c[k>>2]|0)+30>>0])>>0]^d[(c[k>>2]|0)+22>>0])>>0]^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(0^d[(c[k>>2]|0)+31>>0])>>0]^d[(c[k>>2]|0)+23>>0])>>0]^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+112>>2]=c[r>>2];c[(c[j>>2]|0)+4128+116>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(d[45011+(d[44755+(188^d[(c[k>>2]|0)+24>>0])>>0]^d[(c[k>>2]|0)+16>>0])>>0]^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(223^d[(c[k>>2]|0)+25>>0])>>0]^d[(c[k>>2]|0)+17>>0])>>0]^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(223^d[(c[k>>2]|0)+26>>0])>>0]^d[(c[k>>2]|0)+18>>0])>>0]^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(188^d[(c[k>>2]|0)+27>>0])>>0]^d[(c[k>>2]|0)+19>>0])>>0]^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(d[45011+(d[44755+(157^d[(c[k>>2]|0)+28>>0])>>0]^d[(c[k>>2]|0)+20>>0])>>0]^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(d[44755+(d[44755+(35^d[(c[k>>2]|0)+29>>0])>>0]^d[(c[k>>2]|0)+21>>0])>>0]^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(d[45011+(d[45011+(35^d[(c[k>>2]|0)+30>>0])>>0]^d[(c[k>>2]|0)+22>>0])>>0]^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(d[44755+(d[45011+(157^d[(c[k>>2]|0)+31>>0])>>0]^d[(c[k>>2]|0)+23>>0])>>0]^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+120>>2]=c[r>>2];c[(c[j>>2]|0)+4128+124>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23)}else{c[p>>2]=0;c[o>>2]=0;c[q>>2]=1;while(1){if((c[o>>2]|0)>=256)break;c[(c[j>>2]|0)+(c[o>>2]<<2)>>2]=c[8432+((d[45011+(d[44243+(c[p>>2]|0)>>0]^d[t>>0])>>0]^d[x>>0])<<2)>>2];c[(c[j>>2]|0)+1024+(c[o>>2]<<2)>>2]=c[9456+((d[45011+(d[44243+(c[q>>2]|0)>>0]^d[u>>0])>>0]^d[y>>0])<<2)>>2];c[(c[j>>2]|0)+2048+(c[o>>2]<<2)>>2]=c[10480+((d[44755+(d[44243+(c[p>>2]|0)>>0]^d[v>>0])>>0]^d[z>>0])<<2)>>2];c[(c[j>>2]|0)+3072+(c[o>>2]<<2)>>2]=c[11504+((d[44755+(d[44243+(c[q>>2]|0)>>0]^d[w>>0])>>0]^d[A>>0])<<2)>>2];c[o>>2]=(c[o>>2]|0)+1;c[p>>2]=(c[p>>2]|0)+2;c[q>>2]=(c[q>>2]|0)+2}c[r>>2]=c[8432+((d[45011+(169^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(117^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(169^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(117^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(103^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(243^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(103^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(243^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4096>>2]=c[r>>2];c[(c[j>>2]|0)+4096+4>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(179^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(198^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(179^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(198^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(232^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(244^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(232^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(244^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4096+8>>2]=c[r>>2];c[(c[j>>2]|0)+4096+12>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(4^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(219^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(4^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(219^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(253^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(123^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(253^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(123^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4096+16>>2]=c[r>>2];c[(c[j>>2]|0)+4096+20>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(163^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(251^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(163^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(251^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(118^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(200^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(118^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(200^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4096+24>>2]=c[r>>2];c[(c[j>>2]|0)+4096+28>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(154^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(74^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(154^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(74^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(146^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(211^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(146^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(211^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128>>2]=c[r>>2];c[(c[j>>2]|0)+4128+4>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(128^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(230^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(128^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(230^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(120^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(107^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(120^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(107^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+8>>2]=c[r>>2];c[(c[j>>2]|0)+4128+12>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(228^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(69^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(228^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(69^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(221^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(125^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(221^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(125^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+16>>2]=c[r>>2];c[(c[j>>2]|0)+4128+20>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(209^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(232^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(209^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(232^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(56^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(75^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(56^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(75^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+24>>2]=c[r>>2];c[(c[j>>2]|0)+4128+28>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(13^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(214^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(13^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(214^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(198^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(50^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(198^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(50^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+32>>2]=c[r>>2];c[(c[j>>2]|0)+4128+36>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(53^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(216^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(53^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(216^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(152^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(253^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(152^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(253^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+40>>2]=c[r>>2];c[(c[j>>2]|0)+4128+44>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(24^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(55^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(24^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(55^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(247^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(113^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(247^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(113^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+48>>2]=c[r>>2];c[(c[j>>2]|0)+4128+52>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(236^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(241^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(236^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(241^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(108^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(225^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(108^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(225^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+56>>2]=c[r>>2];c[(c[j>>2]|0)+4128+60>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(67^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(48^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(67^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(48^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(117^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(15^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(117^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(15^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+64>>2]=c[r>>2];c[(c[j>>2]|0)+4128+68>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(55^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(248^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(55^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(248^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(38^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(27^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(38^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(27^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+72>>2]=c[r>>2];c[(c[j>>2]|0)+4128+76>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(250^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(135^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(250^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(135^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(19^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(250^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(19^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(250^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+80>>2]=c[r>>2];c[(c[j>>2]|0)+4128+84>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(148^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(6^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(148^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(6^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(72^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(63^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(72^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(63^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+88>>2]=c[r>>2];c[(c[j>>2]|0)+4128+92>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(242^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(94^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(242^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(94^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(208^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(186^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(208^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(186^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+96>>2]=c[r>>2];c[(c[j>>2]|0)+4128+100>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(139^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(174^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(139^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(174^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(48^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(91^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(48^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(91^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+104>>2]=c[r>>2];c[(c[j>>2]|0)+4128+108>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(132^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(138^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(132^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(138^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(84^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(0^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(84^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(0^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+112>>2]=c[r>>2];c[(c[j>>2]|0)+4128+116>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8432+((d[45011+(223^d[(c[k>>2]|0)+8>>0])>>0]^d[c[k>>2]>>0])<<2)>>2]^c[9456+((d[45011+(188^d[(c[k>>2]|0)+9>>0])>>0]^d[(c[k>>2]|0)+1>>0])<<2)>>2]^c[10480+((d[44755+(223^d[(c[k>>2]|0)+10>>0])>>0]^d[(c[k>>2]|0)+2>>0])<<2)>>2]^c[11504+((d[44755+(188^d[(c[k>>2]|0)+11>>0])>>0]^d[(c[k>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8432+((d[45011+(35^d[(c[k>>2]|0)+12>>0])>>0]^d[(c[k>>2]|0)+4>>0])<<2)>>2]^c[9456+((d[45011+(157^d[(c[k>>2]|0)+13>>0])>>0]^d[(c[k>>2]|0)+5>>0])<<2)>>2]^c[10480+((d[44755+(35^d[(c[k>>2]|0)+14>>0])>>0]^d[(c[k>>2]|0)+6>>0])<<2)>>2]^c[11504+((d[44755+(157^d[(c[k>>2]|0)+15>>0])>>0]^d[(c[k>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[j>>2]|0)+4128+120>>2]=c[r>>2];c[(c[j>>2]|0)+4128+124>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23)}c[i>>2]=0;K=c[i>>2]|0;l=g;return K|0}function Lm(){var a=0,b=0,d=0,e=0,f=0,g=0;a=l;l=l+4288|0;if((l|0)>=(m|0))$(4288);b=a+4264|0;d=a+8|0;e=a+4272|0;f=a;Dm(d,45267,16)|0;Em(d,e,45283)|0;do if(!(Jv(e,45299,16)|0)){Fm(d,e,e)|0;if(Jv(e,45283,16)|0){c[b>>2]=45351;break}Dm(d,45387,32)|0;Em(d,e,45419)|0;if(Jv(e,45435,16)|0){c[b>>2]=45451;break}Fm(d,e,e)|0;if(Jv(e,45419,16)|0){c[b>>2]=45487;break}g=Mm()|0;c[f>>2]=g;if(g|0){c[b>>2]=c[f>>2];break}g=Nm()|0;c[f>>2]=g;if(g|0){c[b>>2]=c[f>>2];break}g=Om()|0;c[f>>2]=g;if(g|0){c[b>>2]=c[f>>2];break}else{c[b>>2]=0;break}}else c[b>>2]=45315;while(0);l=a;return c[b>>2]|0}function Mm(){var a=0,b=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);c[a+8>>2]=4;c[a+4>>2]=16;c[a>>2]=4256;b=wr(43484,13,14,8,4,16,4256)|0;l=a;return b|0}function Nm(){var a=0,b=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);c[a+8>>2]=5;c[a+4>>2]=16;c[a>>2]=4256;b=sr(43484,13,14,6,5,16,4256)|0;l=a;return b|0}function Om(){var a=0,b=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);c[a+8>>2]=5;c[a+4>>2]=16;c[a>>2]=4256;b=ur(43484,13,14,7,5,16,4256)|0;l=a;return b|0}function Pm(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;g=l;l=l+48|0;if((l|0)>=(m|0))$(48);h=g+36|0;i=g+32|0;j=g+28|0;k=g+24|0;n=g+20|0;o=g+16|0;p=g+12|0;q=g+8|0;r=g+4|0;s=g;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;c[n>>2]=f;c[o>>2]=c[h>>2];c[p>>2]=c[j>>2];c[q>>2]=c[k>>2];c[s>>2]=0;while(1){if(!(c[n>>2]|0))break;c[r>>2]=Em(c[o>>2]|0,c[i>>2]|0,c[i>>2]|0)|0;if((c[r>>2]|0)>>>0>(c[s>>2]|0)>>>0)c[s>>2]=c[r>>2];Qm(c[p>>2]|0,c[i>>2]|0,c[q>>2]|0,16);c[p>>2]=(c[p>>2]|0)+16;c[q>>2]=(c[q>>2]|0)+16;c[n>>2]=(c[n>>2]|0)+-1}bf(c[s>>2]|0);cf();l=g;return}function Qm(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+12|0;h=f+8|0;i=f+4|0;j=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;Rm(c[g>>2]|0,c[i>>2]|0,c[h>>2]|0,c[i>>2]|0,c[j>>2]|0);l=f;return}function Rm(b,e,f,g,h){b=b|0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0);cf();l=i;return}function Tm(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;i=l;l=l+96|0;if((l|0)>=(m|0))$(96);j=i+60|0;k=i+56|0;n=i+52|0;o=i+48|0;p=i+44|0;q=i+40|0;r=i+36|0;s=i+32|0;t=i+72|0;u=i+28|0;v=i+24|0;w=i+20|0;x=i+16|0;y=i+12|0;z=i+64|0;A=i;B=i+8|0;c[j>>2]=b;c[k>>2]=e;c[n>>2]=f;c[o>>2]=g;c[p>>2]=h;c[q>>2]=c[j>>2];c[r>>2]=c[n>>2];c[s>>2]=c[o>>2];c[v>>2]=0;while(1){if(!(c[p>>2]|0))break;c[u>>2]=Em(c[q>>2]|0,t,c[k>>2]|0)|0;if((c[u>>2]|0)>>>0>(c[v>>2]|0)>>>0)c[v>>2]=c[u>>2];Um(c[r>>2]|0,t,c[s>>2]|0,16);c[r>>2]=(c[r>>2]|0)+16;c[s>>2]=(c[s>>2]|0)+16;c[w>>2]=16;while(1){if((c[w>>2]|0)<=0)break;o=(c[k>>2]|0)+((c[w>>2]|0)-1)|0;a[o>>0]=(a[o>>0]|0)+1<<24>>24;if(a[(c[k>>2]|0)+((c[w>>2]|0)-1)>>0]|0)break;c[w>>2]=(c[w>>2]|0)+-1}c[p>>2]=(c[p>>2]|0)+-1}c[x>>2]=t;c[y>>2]=16;a[z>>0]=0;t=A;c[t>>2]=d[z>>0];c[t+4>>2]=0;while(1){if(!(c[x>>2]&7|0?(c[y>>2]|0)!=0:0))break;a[c[x>>2]>>0]=a[z>>0]|0;c[x>>2]=(c[x>>2]|0)+1;c[y>>2]=(c[y>>2]|0)+-1}if((c[y>>2]|0)>>>0>=8){t=A;p=gx(c[t>>2]|0,c[t+4>>2]|0,16843009,16843009)|0;t=A;c[t>>2]=p;c[t+4>>2]=D;do{c[B>>2]=c[x>>2];t=A;p=c[t+4>>2]|0;w=c[B>>2]|0;c[w>>2]=c[t>>2];c[w+4>>2]=p;c[y>>2]=(c[y>>2]|0)-8;c[x>>2]=(c[x>>2]|0)+8}while((c[y>>2]|0)>>>0>=8)}while(1){if(!(c[y>>2]|0))break;a[c[x>>2]>>0]=a[z>>0]|0;c[x>>2]=(c[x>>2]|0)+1;c[y>>2]=(c[y>>2]|0)+-1}bf(c[v>>2]|0);cf();l=i;return}function Um(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=l;l=l+48|0;if((l|0)>=(m|0))$(48);i=h+40|0;j=h+36|0;k=h+32|0;n=h+28|0;o=h+24|0;p=h+20|0;q=h+16|0;r=h+12|0;s=h+8|0;t=h+4|0;c[i>>2]=b;c[j>>2]=e;c[k>>2]=f;c[n>>2]=g;c[o>>2]=c[i>>2];c[p>>2]=c[j>>2];c[q>>2]=c[k>>2];c[h>>2]=3;if(!((c[o>>2]|c[p>>2]|c[q>>2])&3)){c[r>>2]=c[o>>2];c[s>>2]=c[p>>2];c[t>>2]=c[q>>2];while(1){if((c[n>>2]|0)>>>0<4)break;k=c[s>>2]|0;c[s>>2]=k+4;j=c[k>>2]|0;k=c[t>>2]|0;c[t>>2]=k+4;i=j^c[k>>2];k=c[r>>2]|0;c[r>>2]=k+4;c[k>>2]=i;c[n>>2]=(c[n>>2]|0)-4}c[o>>2]=c[r>>2];c[p>>2]=c[s>>2];c[q>>2]=c[t>>2]}while(1){if(!(c[n>>2]|0))break;t=c[p>>2]|0;c[p>>2]=t+1;s=d[t>>0]|0;t=c[q>>2]|0;c[q>>2]=t+1;r=(s^(d[t>>0]|0))&255;t=c[o>>2]|0;c[o>>2]=t+1;a[t>>0]=r;c[n>>2]=(c[n>>2]|0)+-1}l=h;return}function Vm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;c[17742]=c[e>>2];c[17743]=c[f>>2];l=d;return}function Wm(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+12|0;h=f+8|0;i=f+4|0;j=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;if(!(c[17742]|0)){l=f;return}vb[c[17742]&15](c[17743]|0,c[g>>2]|0,c[h>>2]|0,c[i>>2]|0,c[j>>2]|0);l=f;return}function Xm(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;do if(c[d>>2]|0){if((c[d>>2]|0)==1){c[17745]=1;break}if(!(c[17744]|0)){if((c[d>>2]|0)==2){c[17746]=1;break}if((c[d>>2]|0)==3)c[17747]=1}}else c[17744]=1;while(0);l=b;return}function Ym(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;if(Wg()|0){As(c[d>>2]|0);l=b;return}if(c[17745]|0){$r(c[d>>2]|0);l=b;return}if(c[17746]|0){As(c[d>>2]|0);l=b;return}a=c[d>>2]|0;if(c[17747]|0){ct(a);l=b;return}else{$r(a);l=b;return}}function Zm(){if(Wg()|0){Gs();return}if(c[17745]|0){js();return}if(c[17746]|0){Gs();return}if(c[17747]|0){et();return}else{js();return}}function _m(a){a=a|0;var b=0,d=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[e>>2]=a;if(!(c[e>>2]|0)?Wg()|0:0)c[d>>2]=2;else f=4;do if((f|0)==4){if(c[17745]|0){c[d>>2]=1;break}if(c[17746]|0){c[d>>2]=2;break}if(c[17747]|0){c[d>>2]=3;break}else{c[d>>2]=1;break}}while(0);l=b;return c[d>>2]|0}function $m(){if(Wg()|0){Hs();return}else{ks();return}}function an(){if(Wg()|0)return;ls();return}function bn(){if(Wg()|0)return;ms();return}function cn(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;if(Wg()|0){l=b;return}ns(c[d>>2]|0);l=b;return}function dn(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[e>>2]=a;if(Wg()|0)c[d>>2]=0;else c[d>>2]=os(c[e>>2]|0)|0;l=b;return c[d>>2]|0}function en(){var a=0,b=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;if(Wg()|0)c[b>>2]=Is()|0;else c[b>>2]=ps()|0;l=a;return c[b>>2]|0}function fn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+8|0;f=d+4|0;g=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=zf(c[e>>2]|0)|0;gn(c[g>>2]|0,c[e>>2]|0,c[f>>2]|0);l=d;return c[g>>2]|0}function gn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if(Wg()|0){Js(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);l=e;return}if(c[17745]|0){qs(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);l=e;return}if(c[17746]|0){Js(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);l=e;return}d=c[f>>2]|0;f=c[g>>2]|0;g=c[h>>2]|0;if(c[17747]|0){ht(d,f,g);l=e;return}else{qs(d,f,g);l=e;return}}function hn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+8|0;f=d+4|0;g=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=Bf(c[e>>2]|0)|0;gn(c[g>>2]|0,c[e>>2]|0,c[f>>2]|0);l=d;return c[g>>2]|0}function jn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;gn(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);l=e;return}function kn(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;if(Wg()|0){l=b;return}if(c[17745]|0){xs(c[d>>2]|0);l=b;return}if((c[17746]|0)!=0|(c[17747]|0)!=0){l=b;return}xs(c[d>>2]|0);l=b;return}function ln(){if(Wg()|0)return;if(c[17745]|0){ys();return}if((c[17746]|0)!=0|(c[17747]|0)!=0)return;ys();return}function mn(){if(Wg()|0)return;if(c[17745]|0){zs();return}if((c[17746]|0)!=0|(c[17747]|0)!=0)return;zs();return}function nn(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;e=l;l=l+48|0;if((l|0)>=(m|0))$(48);f=e+8|0;g=e;h=e+40|0;i=e+36|0;j=e+32|0;k=e+28|0;n=e+24|0;o=e+20|0;p=e+16|0;q=e+12|0;c[h>>2]=b;c[i>>2]=d;if(Wg()|0){Ws(c[h>>2]|0,c[i>>2]|0);l=e;return}Ym(1);c[o>>2]=Ht(12592)|0;if(c[o>>2]|0){c[g>>2]=Bt(c[o>>2]|0)|0;We(45534,g)}c[j>>2]=_v()|0;if(c[17748]|0){if((c[17749]|0)!=(c[j>>2]|0)){gn(72243,8,0);c[17749]=c[j>>2]}}else{c[p>>2]=kb(0)|0;c[q>>2]=c[j>>2];c[17749]=c[j>>2];c[k>>2]=72223;j=c[k>>2]|0;a[j>>0]=a[q>>0]|0;a[j+1>>0]=a[q+1>>0]|0;a[j+2>>0]=a[q+2>>0]|0;a[j+3>>0]=a[q+3>>0]|0;c[k>>2]=(c[k>>2]|0)+4;q=c[k>>2]|0;a[q>>0]=a[p>>0]|0;a[q+1>>0]=a[p+1>>0]|0;a[q+2>>0]=a[p+2>>0]|0;a[q+3>>0]=a[p+3>>0]|0;jn(72243,8,0);c[17748]=1}c[k>>2]=c[h>>2];while(1){if((c[i>>2]|0)>>>0<=0)break;Xl(72223,72223,28);c[n>>2]=(c[i>>2]|0)>>>0>20?20:c[i>>2]|0;_w(c[k>>2]|0,72223,c[n>>2]|0)|0;c[i>>2]=(c[i>>2]|0)-(c[n>>2]|0);c[k>>2]=(c[k>>2]|0)+(c[n>>2]|0)}c[o>>2]=It(12592)|0;if(c[o>>2]|0){c[f>>2]=Bt(c[o>>2]|0)|0;We(45579,f)}else{l=e;return}}function on(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+4|0;e=b;c[e>>2]=a;if(Wg()|0)c[d>>2]=Xs(c[e>>2]|0)|0;else c[d>>2]=0;l=b;return c[d>>2]|0}function pn(a,b,d,e,f,g,h,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;j=l;l=l+48|0;if((l|0)>=(m|0))$(48);k=j+32|0;n=j+28|0;o=j+24|0;p=j+20|0;q=j+16|0;r=j+12|0;s=j+8|0;t=j+4|0;u=j;c[n>>2]=a;c[o>>2]=b;c[p>>2]=d;c[q>>2]=e;c[r>>2]=f;c[s>>2]=g;c[t>>2]=h;c[u>>2]=i;if(Wg()|0){c[k>>2]=$s(c[n>>2]|0,c[o>>2]|0,c[p>>2]|0,c[q>>2]|0,c[r>>2]|0,c[s>>2]|0,c[t>>2]|0,c[u>>2]|0)|0;v=c[k>>2]|0;l=j;return v|0}else{c[k>>2]=60;v=c[k>>2]|0;l=j;return v|0}return 0}function qn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;if(Wg()|0){c[f>>2]=at(c[g>>2]|0,c[h>>2]|0,c[i>>2]|0)|0;j=c[f>>2]|0;l=e;return j|0}else{c[f>>2]=60;j=c[f>>2]|0;l=e;return j|0}return 0}function rn(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;if(!(Wg()|0)){l=b;return}bt(c[d>>2]|0);l=b;return}function sn(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;f=l;l=l+144|0;if((l|0)>=(m|0))$(144);g=f+8|0;h=f;i=f+28|0;j=f+24|0;k=f+20|0;n=f+16|0;o=f+12|0;p=f+32|0;c[i>>2]=b;c[j>>2]=d;c[k>>2]=e;e=c[i>>2]|0;if(!(c[j>>2]|0)){c[h>>2]=e;Su(p,99,45624,h)|0;af(p,0);l=f;return}c[g>>2]=e;Su(p,99,45629,g)|0;if(c[k>>2]|0){c[n>>2]=Rp(0)|0;c[o>>2]=Rp(0)|0}if(c[k>>2]|0?!(tn(c[n>>2]|0,c[o>>2]|0,c[j>>2]|0,c[k>>2]|0)|0):0){a[p+((hv(p)|0)-1)>>0]=120;af(p,c[n>>2]|0);a[p+((hv(p)|0)-1)>>0]=121;af(p,c[o>>2]|0)}else{af(p,c[c[j>>2]>>2]|0);a[p+((hv(p)|0)-1)>>0]=89;af(p,c[(c[j>>2]|0)+4>>2]|0);a[p+((hv(p)|0)-1)>>0]=90;af(p,c[(c[j>>2]|0)+8>>2]|0)}if(!(c[k>>2]|0)){l=f;return}Tp(c[n>>2]|0);Tp(c[o>>2]|0);l=f;return}function tn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;f=l;l=l+48|0;if((l|0)>=(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=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if(Lo(c[f>>2]|0,c[g>>2]|0,c[(c[h>>2]|0)+16>>2]|0)|0){l=e;return}Ve(45718,e);af(45752,c[g>>2]|0);af(45756,c[(c[h>>2]|0)+16>>2]|0);l=e;return}function vn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+12|0;h=f+8|0;i=f+4|0;j=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;Qo(c[g>>2]|0,c[h>>2]|0,c[i>>2]|0);wn(c[g>>2]|0,c[j>>2]|0);l=f;return}function wn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=c[e>>2]|0;a=c[e>>2]|0;e=c[f>>2]|0;if(c[(c[f>>2]|0)+48+12>>2]|0){Po(b,a,c[e+48+12>>2]|0);l=d;return}else{Mo(b,a,c[e+16>>2]|0);l=d;return}}function xn(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[b+4>>2]=a;c[d>>2]=zf(12)|0;yn(c[d>>2]|0);l=b;return c[d>>2]|0}function yn(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;a=Rp(0)|0;c[c[d>>2]>>2]=a;a=Rp(0)|0;c[(c[d>>2]|0)+4>>2]=a;a=Rp(0)|0;c[(c[d>>2]|0)+8>>2]=a;l=b;return}function zn(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;if(!(c[d>>2]|0)){l=b;return}An(c[d>>2]|0);vf(c[d>>2]|0);l=b;return}function An(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;Dp(c[c[d>>2]>>2]|0);c[c[d>>2]>>2]=0;Dp(c[(c[d>>2]|0)+4>>2]|0);c[(c[d>>2]|0)+4>>2]=0;Dp(c[(c[d>>2]|0)+8>>2]|0);c[(c[d>>2]|0)+8>>2]=0;l=b;return}function Bn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+12|0;h=f+8|0;i=f+4|0;j=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;if(!(c[g>>2]|0))c[g>>2]=xn(0)|0;e=c[c[g>>2]>>2]|0;if(c[h>>2]|0)Kp(e,c[h>>2]|0)|0;else Bp(e);e=c[(c[g>>2]|0)+4>>2]|0;if(c[i>>2]|0)Kp(e,c[i>>2]|0)|0;else Bp(e);e=c[(c[g>>2]|0)+8>>2]|0;if(c[j>>2]|0){Kp(e,c[j>>2]|0)|0;k=c[g>>2]|0;l=f;return k|0}else{Bp(e);k=c[g>>2]|0;l=f;return k|0}return 0}function Cn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+12|0;h=f+8|0;i=f+4|0;j=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;if(!(c[g>>2]|0))c[g>>2]=xn(0)|0;e=c[c[g>>2]>>2]|0;if(c[h>>2]|0)Mp(e,c[h>>2]|0);else Bp(e);e=c[(c[g>>2]|0)+4>>2]|0;if(c[i>>2]|0)Mp(e,c[i>>2]|0);else Bp(e);e=c[(c[g>>2]|0)+8>>2]|0;if(c[j>>2]|0){Mp(e,c[j>>2]|0);k=c[g>>2]|0;l=f;return k|0}else{Bp(e);k=c[g>>2]|0;l=f;return k|0}return 0}function Dn(b){b=b|0;var d=0,e=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d;c[e>>2]=b;b=(c[e>>2]|0)+48|0;a[b>>0]=a[b>>0]&-2;b=(c[e>>2]|0)+48|0;a[b>>0]=a[b>>0]&-3;l=d;return}function En(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;h=l;l=l+32|0;if((l|0)>=(m|0))$(32);i=h+24|0;j=h+20|0;k=h+16|0;n=h+12|0;o=h+8|0;p=h+4|0;q=h;c[i>>2]=a;c[j>>2]=b;c[k>>2]=d;c[n>>2]=e;c[o>>2]=f;c[p>>2]=g;c[q>>2]=Cf(1,108)|0;Fn(c[q>>2]|0,c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[n>>2]|0,c[o>>2]|0,c[p>>2]|0);l=h;return c[q>>2]|0}function Fn(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;i=l;l=l+32|0;if((l|0)>=(m|0))$(32);j=i+28|0;k=i+24|0;n=i+20|0;o=i+16|0;p=i+12|0;q=i+8|0;r=i+4|0;s=i;c[j>>2]=a;c[k>>2]=b;c[n>>2]=d;c[o>>2]=e;c[p>>2]=f;c[q>>2]=g;c[r>>2]=h;do if(!(c[17750]|0))if($a(45760)|0){c[17750]=1;break}else{c[17750]=-1;break}while(0);c[c[j>>2]>>2]=c[k>>2];c[(c[j>>2]|0)+4>>2]=c[n>>2];c[(c[j>>2]|0)+8>>2]=c[o>>2];if((c[n>>2]|0)==1)c[(c[j>>2]|0)+12>>2]=256;else{n=lo(c[p>>2]|0)|0;c[(c[j>>2]|0)+12>>2]=n}n=Ip(c[p>>2]|0)|0;c[(c[j>>2]|0)+16>>2]=n;n=Ip(c[q>>2]|0)|0;c[(c[j>>2]|0)+20>>2]=n;n=Ip(c[r>>2]|0)|0;c[(c[j>>2]|0)+24>>2]=n;if((c[17750]|0)>0)t=No(c[(c[j>>2]|0)+16>>2]|0,0)|0;else t=0;c[(c[j>>2]|0)+48+12>>2]=t;Dn(c[j>>2]|0);c[s>>2]=0;while(1){if((c[s>>2]|0)>>>0>=11)break;t=Lp(c[(c[j>>2]|0)+16>>2]|0)|0;c[(c[j>>2]|0)+48+16+(c[s>>2]<<2)>>2]=t;c[s>>2]=(c[s>>2]|0)+1}l=i;return}function Gn(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;i=l;l=l+48|0;if((l|0)>=(m|0))$(48);j=i+36|0;k=i+32|0;n=i+28|0;o=i+24|0;p=i+20|0;q=i+16|0;r=i+12|0;s=i+8|0;t=i+4|0;u=i;c[k>>2]=a;c[n>>2]=b;c[o>>2]=d;c[p>>2]=e;c[q>>2]=f;c[r>>2]=g;c[s>>2]=h;c[c[k>>2]>>2]=0;if(!((c[q>>2]|0)!=0&(c[r>>2]|0)!=0)){c[j>>2]=32816;v=c[j>>2]|0;l=i;return v|0}c[t>>2]=qh(1,108,5)|0;if(c[t>>2]|0){c[u>>2]=rh(c[t>>2]|0,1)|0;Fn(c[u>>2]|0,c[n>>2]|0,c[o>>2]|0,c[p>>2]|0,c[q>>2]|0,c[r>>2]|0,c[s>>2]|0);c[c[k>>2]>>2]=c[t>>2];c[j>>2]=0;v=c[j>>2]|0;l=i;return v|0}else{c[j>>2]=Et()|0;v=c[j>>2]|0;l=i;return v|0}return 0}function Hn(a){a=a|0;var b=0,d=0,e=0,f=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;c[e>>2]=c[d>>2];Oo(c[(c[e>>2]|0)+48+12>>2]|0);Dp(c[(c[e>>2]|0)+16>>2]|0);Dp(c[(c[e>>2]|0)+20>>2]|0);Dp(c[(c[e>>2]|0)+24>>2]|0);zn(c[(c[e>>2]|0)+28>>2]|0);Dp(c[(c[e>>2]|0)+32>>2]|0);Dp(c[(c[e>>2]|0)+36>>2]|0);zn(c[(c[e>>2]|0)+40>>2]|0);Dp(c[(c[e>>2]|0)+44>>2]|0);Dp(c[(c[e>>2]|0)+48+8>>2]|0);c[f>>2]=0;while(1){if((c[f>>2]|0)>>>0>=11)break;Dp(c[(c[e>>2]|0)+48+16+(c[f>>2]<<2)>>2]|0);c[f>>2]=(c[f>>2]|0)+1}l=b;return}function In(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;if(!(c[d>>2]|0)){l=b;return}Hn(c[d>>2]|0);vf(c[d>>2]|0);l=b;return}function Jn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e+4|0;i=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[i>>2]=rh(c[g>>2]|0,1)|0;g=_h(c[f>>2]|0,c[i>>2]|0,c[h>>2]|0)|0;l=e;return g|0}function Kn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+12|0;g=e+8|0;h=e;c[f>>2]=a;c[g>>2]=b;c[e+4>>2]=d;c[h>>2]=rh(c[g>>2]|0,1)|0;g=$h(c[f>>2]|0,c[h>>2]|0)|0;l=e;return g|0}function Ln(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;switch(c[c[h>>2]>>2]|0){case 0:{Mn(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);l=e;return}case 1:{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h>>2]|0);l=e;return}Op(c[c[f>>2]>>2]|0,1)|0;Op(c[(c[f>>2]|0)+4>>2]|0,1)|0;Op(c[(c[f>>2]|0)+8>>2]|0,0)|0;l=e;return}function Nn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=e;c[e+16>>2]=a;c[e+12>>2]=b;c[e+8>>2]=d;c[f>>2]=45801;c[f+4>>2]=45707;We(45775,f)}function On(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;Pn(c[(c[h>>2]|0)+48+16>>2]|0,c[c[g>>2]>>2]|0,c[(c[g>>2]|0)+4>>2]|0,c[h>>2]|0);Qn(c[(c[h>>2]|0)+48+16>>2]|0,c[(c[h>>2]|0)+48+16>>2]|0,c[h>>2]|0);Qn(c[(c[h>>2]|0)+48+16+4>>2]|0,c[c[g>>2]>>2]|0,c[h>>2]|0);Qn(c[(c[h>>2]|0)+48+16+8>>2]|0,c[(c[g>>2]|0)+4>>2]|0,c[h>>2]|0);d=c[(c[h>>2]|0)+48+16+12>>2]|0;b=c[h>>2]|0;if((c[(c[h>>2]|0)+4>>2]|0)==1){Kp(d,c[b+48+16+4>>2]|0)|0;Jp(c[(c[h>>2]|0)+48+16+12>>2]|0,c[(c[h>>2]|0)+48+16+12>>2]|0)}else vn(d,c[b+20>>2]|0,c[(c[h>>2]|0)+48+16+4>>2]|0,c[h>>2]|0);Pn(c[(c[h>>2]|0)+48+16+16>>2]|0,c[(c[h>>2]|0)+48+16+12>>2]|0,c[(c[h>>2]|0)+48+16+8>>2]|0,c[h>>2]|0);Qn(c[(c[h>>2]|0)+48+16+20>>2]|0,c[(c[g>>2]|0)+8>>2]|0,c[h>>2]|0);Rn(c[(c[h>>2]|0)+48+16+24>>2]|0,c[(c[h>>2]|0)+48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,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;uo(c[f>>2]|0,c[g>>2]|0,1);wn(c[f>>2]|0,c[h>>2]|0);l=e;return}function Sn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+12|0;h=f+8|0;i=f+4|0;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[f>>2]=e;ho(c[g>>2]|0,c[h>>2]|0,c[i>>2]|0);l=f;return}function Tn(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d+4|0;f=d;c[e>>2]=b;if(a[(c[e>>2]|0)+48>>0]&1|0){g=c[e>>2]|0;h=g+48|0;i=h+4|0;j=c[i>>2]|0;l=d;return j|0}b=(c[e>>2]|0)+48|0;a[b>>0]=a[b>>0]&-2|1;c[f>>2]=Lp(c[(c[e>>2]|0)+16>>2]|0)|0;go(c[f>>2]|0,c[(c[e>>2]|0)+16>>2]|0,3);b=((wo(c[(c[e>>2]|0)+20>>2]|0,c[f>>2]|0)|0)!=0^1)&1;c[(c[e>>2]|0)+48+4>>2]=b;Dp(c[f>>2]|0);g=c[e>>2]|0;h=g+48|0;i=h+4|0;j=c[i>>2]|0;l=d;return j|0}function Un(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f+12|0;h=f+8|0;i=f+4|0;j=f;c[g>>2]=a;c[h>>2]=b;c[i>>2]=d;c[j>>2]=e;So(c[g>>2]|0,c[h>>2]|0,c[i>>2]|0,c[(c[j>>2]|0)+16>>2]|0);l=f;return}function Vn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l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;j=71348+(i<<1<<2)|0;k=j+8|0;n=c[k>>2]|0;o=n+8|0;p=c[o>>2]|0;do if((j|0)!=(p|0)){if(p>>>0<(c[17831]|0)>>>0)Aa();q=p+12|0;if((c[q>>2]|0)==(n|0)){c[q>>2]=j;c[k>>2]=p;break}else Aa()}else c[17827]=g&~(1<>2]=p|3;k=n+p+4|0;c[k>>2]=c[k>>2]|1;r=o;l=b;return r|0}k=c[17829]|0;if(e>>>0>k>>>0){if(h|0){p=2<>>12&16;q=p>>>j;p=q>>>5&8;s=q>>>p;q=s>>>2&4;t=s>>>q;s=t>>>1&2;u=t>>>s;t=u>>>1&1;v=(p|j|q|s|t)+(u>>>t)|0;t=71348+(v<<1<<2)|0;u=t+8|0;s=c[u>>2]|0;q=s+8|0;j=c[q>>2]|0;do if((t|0)!=(j|0)){if(j>>>0<(c[17831]|0)>>>0)Aa();p=j+12|0;if((c[p>>2]|0)==(s|0)){c[p>>2]=t;c[u>>2]=j;w=g;break}else Aa()}else{p=g&~(1<>2]=e|3;u=s+e|0;c[u+4>>2]=j|1;c[u+j>>2]=j;if(k|0){t=c[17832]|0;f=k>>>3;h=71348+(f<<1<<2)|0;o=1<>2]|0;if(n>>>0<(c[17831]|0)>>>0)Aa();else{x=n;y=f}}else{c[17827]=w|o;x=h;y=h+8|0}c[y>>2]=t;c[x+12>>2]=t;c[t+8>>2]=x;c[t+12>>2]=h}c[17829]=j;c[17832]=u;r=q;l=b;return r|0}u=c[17828]|0;if(u){j=(u&0-u)+-1|0;h=j>>>12&16;t=j>>>h;j=t>>>5&8;o=t>>>j;t=o>>>2&4;f=o>>>t;o=f>>>1&2;n=f>>>o;f=n>>>1&1;i=c[71612+((j|h|t|o|f)+(n>>>f)<<2)>>2]|0;f=i;n=i;o=(c[i+4>>2]&-8)-e|0;while(1){i=c[f+16>>2]|0;if(!i){t=c[f+20>>2]|0;if(!t)break;else z=t}else z=i;i=(c[z+4>>2]&-8)-e|0;t=i>>>0>>0;f=z;n=t?z:n;o=t?i:o}f=c[17831]|0;if(n>>>0>>0)Aa();q=n+e|0;if(n>>>0>=q>>>0)Aa();s=c[n+24>>2]|0;v=c[n+12>>2]|0;do if((v|0)==(n|0)){i=n+20|0;t=c[i>>2]|0;if(!t){h=n+16|0;j=c[h>>2]|0;if(!j){A=0;break}else{B=j;C=h}}else{B=t;C=i}while(1){i=B+20|0;t=c[i>>2]|0;if(t|0){B=t;C=i;continue}i=B+16|0;t=c[i>>2]|0;if(!t)break;else{B=t;C=i}}if(C>>>0>>0)Aa();else{c[C>>2]=0;A=B;break}}else{i=c[n+8>>2]|0;if(i>>>0>>0)Aa();t=i+12|0;if((c[t>>2]|0)!=(n|0))Aa();h=v+8|0;if((c[h>>2]|0)==(n|0)){c[t>>2]=v;c[h>>2]=i;A=v;break}else Aa()}while(0);do if(s|0){v=c[n+28>>2]|0;f=71612+(v<<2)|0;if((n|0)==(c[f>>2]|0)){c[f>>2]=A;if(!A){c[17828]=u&~(1<>>0<(c[17831]|0)>>>0)Aa();v=s+16|0;if((c[v>>2]|0)==(n|0))c[v>>2]=A;else c[s+20>>2]=A;if(!A)break}v=c[17831]|0;if(A>>>0>>0)Aa();c[A+24>>2]=s;f=c[n+16>>2]|0;do if(f|0)if(f>>>0>>0)Aa();else{c[A+16>>2]=f;c[f+24>>2]=A;break}while(0);f=c[n+20>>2]|0;if(f|0)if(f>>>0<(c[17831]|0)>>>0)Aa();else{c[A+20>>2]=f;c[f+24>>2]=A;break}}while(0);if(o>>>0<16){s=o+e|0;c[n+4>>2]=s|3;u=n+s+4|0;c[u>>2]=c[u>>2]|1}else{c[n+4>>2]=e|3;c[q+4>>2]=o|1;c[q+o>>2]=o;if(k|0){u=c[17832]|0;s=k>>>3;f=71348+(s<<1<<2)|0;v=1<>2]|0;if(i>>>0<(c[17831]|0)>>>0)Aa();else{D=i;E=s}}else{c[17827]=g|v;D=f;E=f+8|0}c[E>>2]=u;c[D+12>>2]=u;c[u+8>>2]=D;c[u+12>>2]=f}c[17829]=o;c[17832]=q}r=n+8|0;l=b;return r|0}else F=e}else F=e}else if(a>>>0<=4294967231){f=a+11|0;u=f&-8;v=c[17828]|0;if(v){s=0-u|0;i=f>>>8;if(i)if(u>>>0>16777215)G=31;else{f=(i+1048320|0)>>>16&8;h=i<>>16&4;t=h<>>16&2;j=14-(i|f|h)+(t<>>15)|0;G=u>>>(j+7|0)&1|j<<1}else G=0;j=c[71612+(G<<2)>>2]|0;a:do if(!j){H=0;I=0;J=s;K=86}else{h=0;t=s;f=j;i=u<<((G|0)==31?0:25-(G>>>1)|0);p=0;while(1){L=(c[f+4>>2]&-8)-u|0;if(L>>>0>>0)if(!L){M=f;N=0;O=f;K=90;break a}else{P=f;Q=L}else{P=h;Q=t}L=c[f+20>>2]|0;f=c[f+16+(i>>>31<<2)>>2]|0;R=(L|0)==0|(L|0)==(f|0)?p:L;L=(f|0)==0;if(L){H=R;I=P;J=Q;K=86;break}else{h=P;t=Q;i=i<<(L&1^1);p=R}}}while(0);if((K|0)==86){if((H|0)==0&(I|0)==0){j=2<>>12&16;e=j>>>s;j=e>>>5&8;n=e>>>j;e=n>>>2&4;q=n>>>e;n=q>>>1&2;o=q>>>n;q=o>>>1&1;S=c[71612+((j|s|e|n|q)+(o>>>q)<<2)>>2]|0}else S=H;if(!S){T=I;U=J}else{M=I;N=J;O=S;K=90}}if((K|0)==90)while(1){K=0;q=(c[O+4>>2]&-8)-u|0;o=q>>>0>>0;n=o?q:N;q=o?O:M;o=c[O+16>>2]|0;if(o|0){M=q;N=n;O=o;K=90;continue}O=c[O+20>>2]|0;if(!O){T=q;U=n;break}else{M=q;N=n;K=90}}if((T|0)!=0?U>>>0<((c[17829]|0)-u|0)>>>0:0){n=c[17831]|0;if(T>>>0>>0)Aa();q=T+u|0;if(T>>>0>=q>>>0)Aa();o=c[T+24>>2]|0;e=c[T+12>>2]|0;do if((e|0)==(T|0)){s=T+20|0;j=c[s>>2]|0;if(!j){g=T+16|0;k=c[g>>2]|0;if(!k){V=0;break}else{W=k;X=g}}else{W=j;X=s}while(1){s=W+20|0;j=c[s>>2]|0;if(j|0){W=j;X=s;continue}s=W+16|0;j=c[s>>2]|0;if(!j)break;else{W=j;X=s}}if(X>>>0>>0)Aa();else{c[X>>2]=0;V=W;break}}else{s=c[T+8>>2]|0;if(s>>>0>>0)Aa();j=s+12|0;if((c[j>>2]|0)!=(T|0))Aa();g=e+8|0;if((c[g>>2]|0)==(T|0)){c[j>>2]=e;c[g>>2]=s;V=e;break}else Aa()}while(0);do if(o){e=c[T+28>>2]|0;n=71612+(e<<2)|0;if((T|0)==(c[n>>2]|0)){c[n>>2]=V;if(!V){n=v&~(1<>>0<(c[17831]|0)>>>0)Aa();n=o+16|0;if((c[n>>2]|0)==(T|0))c[n>>2]=V;else c[o+20>>2]=V;if(!V){Y=v;break}}n=c[17831]|0;if(V>>>0>>0)Aa();c[V+24>>2]=o;e=c[T+16>>2]|0;do if(e|0)if(e>>>0>>0)Aa();else{c[V+16>>2]=e;c[e+24>>2]=V;break}while(0);e=c[T+20>>2]|0;if(e)if(e>>>0<(c[17831]|0)>>>0)Aa();else{c[V+20>>2]=e;c[e+24>>2]=V;Y=v;break}else Y=v}else Y=v;while(0);do if(U>>>0>=16){c[T+4>>2]=u|3;c[q+4>>2]=U|1;c[q+U>>2]=U;v=U>>>3;if(U>>>0<256){o=71348+(v<<1<<2)|0;e=c[17827]|0;n=1<>2]|0;if(s>>>0<(c[17831]|0)>>>0)Aa();else{Z=s;_=v}}else{c[17827]=e|n;Z=o;_=o+8|0}c[_>>2]=q;c[Z+12>>2]=q;c[q+8>>2]=Z;c[q+12>>2]=o;break}o=U>>>8;if(o)if(U>>>0>16777215)aa=31;else{n=(o+1048320|0)>>>16&8;e=o<>>16&4;v=e<>>16&2;s=14-(o|n|e)+(v<>>15)|0;aa=U>>>(s+7|0)&1|s<<1}else aa=0;s=71612+(aa<<2)|0;c[q+28>>2]=aa;e=q+16|0;c[e+4>>2]=0;c[e>>2]=0;e=1<>2]=q;c[q+24>>2]=s;c[q+12>>2]=q;c[q+8>>2]=q;break}e=U<<((aa|0)==31?0:25-(aa>>>1)|0);v=c[s>>2]|0;while(1){if((c[v+4>>2]&-8|0)==(U|0)){K=148;break}ba=v+16+(e>>>31<<2)|0;s=c[ba>>2]|0;if(!s){K=145;break}else{e=e<<1;v=s}}if((K|0)==145)if(ba>>>0<(c[17831]|0)>>>0)Aa();else{c[ba>>2]=q;c[q+24>>2]=v;c[q+12>>2]=q;c[q+8>>2]=q;break}else if((K|0)==148){e=v+8|0;s=c[e>>2]|0;n=c[17831]|0;if(s>>>0>=n>>>0&v>>>0>=n>>>0){c[s+12>>2]=q;c[e>>2]=q;c[q+8>>2]=s;c[q+12>>2]=v;c[q+24>>2]=0;break}else Aa()}}else{s=U+u|0;c[T+4>>2]=s|3;e=T+s+4|0;c[e>>2]=c[e>>2]|1}while(0);r=T+8|0;l=b;return r|0}else F=u}else F=u}else F=-1;while(0);T=c[17829]|0;if(T>>>0>=F>>>0){U=T-F|0;ba=c[17832]|0;if(U>>>0>15){aa=ba+F|0;c[17832]=aa;c[17829]=U;c[aa+4>>2]=U|1;c[aa+U>>2]=U;c[ba+4>>2]=F|3}else{c[17829]=0;c[17832]=0;c[ba+4>>2]=T|3;U=ba+T+4|0;c[U>>2]=c[U>>2]|1}r=ba+8|0;l=b;return r|0}ba=c[17830]|0;if(ba>>>0>F>>>0){U=ba-F|0;c[17830]=U;T=c[17833]|0;aa=T+F|0;c[17833]=aa;c[aa+4>>2]=U|1;c[T+4>>2]=F|3;r=T+8|0;l=b;return r|0}if(!(c[17945]|0)){c[17947]=4096;c[17946]=4096;c[17948]=-1;c[17949]=-1;c[17950]=0;c[17938]=0;T=d&-16^1431655768;c[d>>2]=T;c[17945]=T;ca=4096}else ca=c[17947]|0;T=F+48|0;d=F+47|0;U=ca+d|0;aa=0-ca|0;ca=U&aa;if(ca>>>0<=F>>>0){r=0;l=b;return r|0}Y=c[17937]|0;if(Y|0?(Z=c[17935]|0,_=Z+ca|0,_>>>0<=Z>>>0|_>>>0>Y>>>0):0){r=0;l=b;return r|0}b:do if(!(c[17938]&4)){Y=c[17833]|0;c:do if(Y){_=71756;while(1){Z=c[_>>2]|0;if(Z>>>0<=Y>>>0?(da=_+4|0,(Z+(c[da>>2]|0)|0)>>>0>Y>>>0):0)break;Z=c[_+8>>2]|0;if(!Z){K=172;break c}else _=Z}v=U-ba&aa;if(v>>>0<2147483647){Z=hx(v|0)|0;if((Z|0)==((c[_>>2]|0)+(c[da>>2]|0)|0)){if((Z|0)!=(-1|0)){ea=v;fa=Z;K=190;break b}}else{ga=Z;ha=v;K=180}}}else K=172;while(0);do if(((K|0)==172?(Y=hx(0)|0,(Y|0)!=(-1|0)):0)?(u=Y,v=c[17946]|0,Z=v+-1|0,V=((Z&u|0)==0?0:(Z+u&0-v)-u|0)+ca|0,u=c[17935]|0,v=V+u|0,V>>>0>F>>>0&V>>>0<2147483647):0){Z=c[17937]|0;if(Z|0?v>>>0<=u>>>0|v>>>0>Z>>>0:0)break;Z=hx(V|0)|0;if((Z|0)==(Y|0)){ea=V;fa=Y;K=190;break b}else{ga=Z;ha=V;K=180}}while(0);d:do if((K|0)==180){V=0-ha|0;do if(T>>>0>ha>>>0&(ha>>>0<2147483647&(ga|0)!=(-1|0))?(Z=c[17947]|0,Y=d-ha+Z&0-Z,Y>>>0<2147483647):0)if((hx(Y|0)|0)==(-1|0)){hx(V|0)|0;break d}else{ia=Y+ha|0;break}else ia=ha;while(0);if((ga|0)!=(-1|0)){ea=ia;fa=ga;K=190;break b}}while(0);c[17938]=c[17938]|4;K=187}else K=187;while(0);if((((K|0)==187?ca>>>0<2147483647:0)?(ga=hx(ca|0)|0,ca=hx(0)|0,ga>>>0>>0&((ga|0)!=(-1|0)&(ca|0)!=(-1|0))):0)?(ia=ca-ga|0,ia>>>0>(F+40|0)>>>0):0){ea=ia;fa=ga;K=190}if((K|0)==190){ga=(c[17935]|0)+ea|0;c[17935]=ga;if(ga>>>0>(c[17936]|0)>>>0)c[17936]=ga;ga=c[17833]|0;do if(ga){ia=71756;while(1){ja=c[ia>>2]|0;ka=ia+4|0;la=c[ka>>2]|0;if((fa|0)==(ja+la|0)){K=200;break}ca=c[ia+8>>2]|0;if(!ca)break;else ia=ca}if(((K|0)==200?(c[ia+12>>2]&8|0)==0:0)?ga>>>0>>0&ga>>>0>=ja>>>0:0){c[ka>>2]=la+ea;ca=ga+8|0;ha=(ca&7|0)==0?0:0-ca&7;ca=ga+ha|0;d=ea-ha+(c[17830]|0)|0;c[17833]=ca;c[17830]=d;c[ca+4>>2]=d|1;c[ca+d+4>>2]=40;c[17834]=c[17949];break}d=c[17831]|0;if(fa>>>0>>0){c[17831]=fa;ma=fa}else ma=d;d=fa+ea|0;ca=71756;while(1){if((c[ca>>2]|0)==(d|0)){K=208;break}ha=c[ca+8>>2]|0;if(!ha){na=71756;break}else ca=ha}if((K|0)==208)if(!(c[ca+12>>2]&8)){c[ca>>2]=fa;ia=ca+4|0;c[ia>>2]=(c[ia>>2]|0)+ea;ia=fa+8|0;ha=fa+((ia&7|0)==0?0:0-ia&7)|0;ia=d+8|0;T=d+((ia&7|0)==0?0:0-ia&7)|0;ia=ha+F|0;da=T-ha-F|0;c[ha+4>>2]=F|3;do if((T|0)!=(ga|0)){if((T|0)==(c[17832]|0)){aa=(c[17829]|0)+da|0;c[17829]=aa;c[17832]=ia;c[ia+4>>2]=aa|1;c[ia+aa>>2]=aa;break}aa=c[T+4>>2]|0;if((aa&3|0)==1){ba=aa&-8;U=aa>>>3;e:do if(aa>>>0>=256){V=c[T+24>>2]|0;_=c[T+12>>2]|0;do if((_|0)==(T|0)){Y=T+16|0;Z=Y+4|0;v=c[Z>>2]|0;if(!v){u=c[Y>>2]|0;if(!u){oa=0;break}else{pa=u;qa=Y}}else{pa=v;qa=Z}while(1){Z=pa+20|0;v=c[Z>>2]|0;if(v|0){pa=v;qa=Z;continue}Z=pa+16|0;v=c[Z>>2]|0;if(!v)break;else{pa=v;qa=Z}}if(qa>>>0>>0)Aa();else{c[qa>>2]=0;oa=pa;break}}else{Z=c[T+8>>2]|0;if(Z>>>0>>0)Aa();v=Z+12|0;if((c[v>>2]|0)!=(T|0))Aa();Y=_+8|0;if((c[Y>>2]|0)==(T|0)){c[v>>2]=_;c[Y>>2]=Z;oa=_;break}else Aa()}while(0);if(!V)break;_=c[T+28>>2]|0;Z=71612+(_<<2)|0;do if((T|0)!=(c[Z>>2]|0)){if(V>>>0<(c[17831]|0)>>>0)Aa();Y=V+16|0;if((c[Y>>2]|0)==(T|0))c[Y>>2]=oa;else c[V+20>>2]=oa;if(!oa)break e}else{c[Z>>2]=oa;if(oa|0)break;c[17828]=c[17828]&~(1<<_);break e}while(0);_=c[17831]|0;if(oa>>>0<_>>>0)Aa();c[oa+24>>2]=V;Z=T+16|0;Y=c[Z>>2]|0;do if(Y|0)if(Y>>>0<_>>>0)Aa();else{c[oa+16>>2]=Y;c[Y+24>>2]=oa;break}while(0);Y=c[Z+4>>2]|0;if(!Y)break;if(Y>>>0<(c[17831]|0)>>>0)Aa();else{c[oa+20>>2]=Y;c[Y+24>>2]=oa;break}}else{Y=c[T+8>>2]|0;_=c[T+12>>2]|0;V=71348+(U<<1<<2)|0;do if((Y|0)!=(V|0)){if(Y>>>0>>0)Aa();if((c[Y+12>>2]|0)==(T|0))break;Aa()}while(0);if((_|0)==(Y|0)){c[17827]=c[17827]&~(1<>>0>>0)Aa();Z=_+8|0;if((c[Z>>2]|0)==(T|0)){ra=Z;break}Aa()}while(0);c[Y+12>>2]=_;c[ra>>2]=Y}while(0);sa=T+ba|0;ta=ba+da|0}else{sa=T;ta=da}U=sa+4|0;c[U>>2]=c[U>>2]&-2;c[ia+4>>2]=ta|1;c[ia+ta>>2]=ta;U=ta>>>3;if(ta>>>0<256){aa=71348+(U<<1<<2)|0;V=c[17827]|0;Z=1<>2]|0;if(v>>>0>=(c[17831]|0)>>>0){ua=v;va=U;break}Aa()}while(0);c[va>>2]=ia;c[ua+12>>2]=ia;c[ia+8>>2]=ua;c[ia+12>>2]=aa;break}Z=ta>>>8;do if(!Z)wa=0;else{if(ta>>>0>16777215){wa=31;break}V=(Z+1048320|0)>>>16&8;ba=Z<>>16&4;v=ba<>>16&2;u=14-(U|V|ba)+(v<>>15)|0;wa=ta>>>(u+7|0)&1|u<<1}while(0);Z=71612+(wa<<2)|0;c[ia+28>>2]=wa;aa=ia+16|0;c[aa+4>>2]=0;c[aa>>2]=0;aa=c[17828]|0;u=1<>2]=ia;c[ia+24>>2]=Z;c[ia+12>>2]=ia;c[ia+8>>2]=ia;break}u=ta<<((wa|0)==31?0:25-(wa>>>1)|0);aa=c[Z>>2]|0;while(1){if((c[aa+4>>2]&-8|0)==(ta|0)){K=278;break}xa=aa+16+(u>>>31<<2)|0;Z=c[xa>>2]|0;if(!Z){K=275;break}else{u=u<<1;aa=Z}}if((K|0)==275)if(xa>>>0<(c[17831]|0)>>>0)Aa();else{c[xa>>2]=ia;c[ia+24>>2]=aa;c[ia+12>>2]=ia;c[ia+8>>2]=ia;break}else if((K|0)==278){u=aa+8|0;Z=c[u>>2]|0;ba=c[17831]|0;if(Z>>>0>=ba>>>0&aa>>>0>=ba>>>0){c[Z+12>>2]=ia;c[u>>2]=ia;c[ia+8>>2]=Z;c[ia+12>>2]=aa;c[ia+24>>2]=0;break}else Aa()}}else{Z=(c[17830]|0)+da|0;c[17830]=Z;c[17833]=ia;c[ia+4>>2]=Z|1}while(0);r=ha+8|0;l=b;return r|0}else na=71756;while(1){ia=c[na>>2]|0;if(ia>>>0<=ga>>>0?(ya=ia+(c[na+4>>2]|0)|0,ya>>>0>ga>>>0):0)break;na=c[na+8>>2]|0}ha=ya+-47|0;ia=ha+8|0;da=ha+((ia&7|0)==0?0:0-ia&7)|0;ia=ga+16|0;ha=da>>>0>>0?ga:da;da=ha+8|0;T=fa+8|0;d=(T&7|0)==0?0:0-T&7;T=fa+d|0;ca=ea+-40-d|0;c[17833]=T;c[17830]=ca;c[T+4>>2]=ca|1;c[T+ca+4>>2]=40;c[17834]=c[17949];ca=ha+4|0;c[ca>>2]=27;c[da>>2]=c[17939];c[da+4>>2]=c[17940];c[da+8>>2]=c[17941];c[da+12>>2]=c[17942];c[17939]=fa;c[17940]=ea;c[17942]=0;c[17941]=da;da=ha+24|0;do{da=da+4|0;c[da>>2]=7}while((da+4|0)>>>0>>0);if((ha|0)!=(ga|0)){da=ha-ga|0;c[ca>>2]=c[ca>>2]&-2;c[ga+4>>2]=da|1;c[ha>>2]=da;T=da>>>3;if(da>>>0<256){d=71348+(T<<1<<2)|0;Z=c[17827]|0;u=1<>2]|0;if(ba>>>0<(c[17831]|0)>>>0)Aa();else{za=ba;Ba=T}}else{c[17827]=Z|u;za=d;Ba=d+8|0}c[Ba>>2]=ga;c[za+12>>2]=ga;c[ga+8>>2]=za;c[ga+12>>2]=d;break}d=da>>>8;if(d)if(da>>>0>16777215)Ca=31;else{u=(d+1048320|0)>>>16&8;Z=d<>>16&4;T=Z<>>16&2;ba=14-(d|u|Z)+(T<>>15)|0;Ca=da>>>(ba+7|0)&1|ba<<1}else Ca=0;ba=71612+(Ca<<2)|0;c[ga+28>>2]=Ca;c[ga+20>>2]=0;c[ia>>2]=0;Z=c[17828]|0;T=1<>2]=ga;c[ga+24>>2]=ba;c[ga+12>>2]=ga;c[ga+8>>2]=ga;break}T=da<<((Ca|0)==31?0:25-(Ca>>>1)|0);Z=c[ba>>2]|0;while(1){if((c[Z+4>>2]&-8|0)==(da|0)){K=304;break}Da=Z+16+(T>>>31<<2)|0;ba=c[Da>>2]|0;if(!ba){K=301;break}else{T=T<<1;Z=ba}}if((K|0)==301)if(Da>>>0<(c[17831]|0)>>>0)Aa();else{c[Da>>2]=ga;c[ga+24>>2]=Z;c[ga+12>>2]=ga;c[ga+8>>2]=ga;break}else if((K|0)==304){T=Z+8|0;da=c[T>>2]|0;ia=c[17831]|0;if(da>>>0>=ia>>>0&Z>>>0>=ia>>>0){c[da+12>>2]=ga;c[T>>2]=ga;c[ga+8>>2]=da;c[ga+12>>2]=Z;c[ga+24>>2]=0;break}else Aa()}}}else{da=c[17831]|0;if((da|0)==0|fa>>>0>>0)c[17831]=fa;c[17939]=fa;c[17940]=ea;c[17942]=0;c[17836]=c[17945];c[17835]=-1;da=0;do{T=71348+(da<<1<<2)|0;c[T+12>>2]=T;c[T+8>>2]=T;da=da+1|0}while((da|0)!=32);da=fa+8|0;Z=(da&7|0)==0?0:0-da&7;da=fa+Z|0;T=ea+-40-Z|0;c[17833]=da;c[17830]=T;c[da+4>>2]=T|1;c[da+T+4>>2]=40;c[17834]=c[17949]}while(0);ea=c[17830]|0;if(ea>>>0>F>>>0){fa=ea-F|0;c[17830]=fa;ea=c[17833]|0;ga=ea+F|0;c[17833]=ga;c[ga+4>>2]=fa|1;c[ea+4>>2]=F|3;r=ea+8|0;l=b;return r|0}}c[(xu()|0)>>2]=12;r=0;l=b;return r|0}function Lw(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;if(!a)return;b=a+-8|0;d=c[17831]|0;if(b>>>0>>0)Aa();e=c[a+-4>>2]|0;a=e&3;if((a|0)==1)Aa();f=e&-8;g=b+f|0;do if(!(e&1)){h=c[b>>2]|0;if(!a)return;i=b+(0-h)|0;j=h+f|0;if(i>>>0>>0)Aa();if((i|0)==(c[17832]|0)){k=g+4|0;l=c[k>>2]|0;if((l&3|0)!=3){m=i;n=j;break}c[17829]=j;c[k>>2]=l&-2;c[i+4>>2]=j|1;c[i+j>>2]=j;return}l=h>>>3;if(h>>>0<256){h=c[i+8>>2]|0;k=c[i+12>>2]|0;o=71348+(l<<1<<2)|0;if((h|0)!=(o|0)){if(h>>>0>>0)Aa();if((c[h+12>>2]|0)!=(i|0))Aa()}if((k|0)==(h|0)){c[17827]=c[17827]&~(1<>>0>>0)Aa();o=k+8|0;if((c[o>>2]|0)==(i|0))p=o;else Aa()}else p=k+8|0;c[h+12>>2]=k;c[p>>2]=h;m=i;n=j;break}h=c[i+24>>2]|0;k=c[i+12>>2]|0;do if((k|0)==(i|0)){o=i+16|0;l=o+4|0;q=c[l>>2]|0;if(!q){r=c[o>>2]|0;if(!r){s=0;break}else{t=r;u=o}}else{t=q;u=l}while(1){l=t+20|0;q=c[l>>2]|0;if(q|0){t=q;u=l;continue}l=t+16|0;q=c[l>>2]|0;if(!q)break;else{t=q;u=l}}if(u>>>0>>0)Aa();else{c[u>>2]=0;s=t;break}}else{l=c[i+8>>2]|0;if(l>>>0>>0)Aa();q=l+12|0;if((c[q>>2]|0)!=(i|0))Aa();o=k+8|0;if((c[o>>2]|0)==(i|0)){c[q>>2]=k;c[o>>2]=l;s=k;break}else Aa()}while(0);if(h){k=c[i+28>>2]|0;l=71612+(k<<2)|0;if((i|0)==(c[l>>2]|0)){c[l>>2]=s;if(!s){c[17828]=c[17828]&~(1<>>0<(c[17831]|0)>>>0)Aa();k=h+16|0;if((c[k>>2]|0)==(i|0))c[k>>2]=s;else c[h+20>>2]=s;if(!s){m=i;n=j;break}}k=c[17831]|0;if(s>>>0>>0)Aa();c[s+24>>2]=h;l=i+16|0;o=c[l>>2]|0;do if(o|0)if(o>>>0>>0)Aa();else{c[s+16>>2]=o;c[o+24>>2]=s;break}while(0);o=c[l+4>>2]|0;if(o)if(o>>>0<(c[17831]|0)>>>0)Aa();else{c[s+20>>2]=o;c[o+24>>2]=s;m=i;n=j;break}else{m=i;n=j}}else{m=i;n=j}}else{m=b;n=f}while(0);if(m>>>0>=g>>>0)Aa();f=g+4|0;b=c[f>>2]|0;if(!(b&1))Aa();if(!(b&2)){if((g|0)==(c[17833]|0)){s=(c[17830]|0)+n|0;c[17830]=s;c[17833]=m;c[m+4>>2]=s|1;if((m|0)!=(c[17832]|0))return;c[17832]=0;c[17829]=0;return}if((g|0)==(c[17832]|0)){s=(c[17829]|0)+n|0;c[17829]=s;c[17832]=m;c[m+4>>2]=s|1;c[m+s>>2]=s;return}s=(b&-8)+n|0;d=b>>>3;do if(b>>>0>=256){t=c[g+24>>2]|0;u=c[g+12>>2]|0;do if((u|0)==(g|0)){p=g+16|0;a=p+4|0;e=c[a>>2]|0;if(!e){o=c[p>>2]|0;if(!o){v=0;break}else{w=o;x=p}}else{w=e;x=a}while(1){a=w+20|0;e=c[a>>2]|0;if(e|0){w=e;x=a;continue}a=w+16|0;e=c[a>>2]|0;if(!e)break;else{w=e;x=a}}if(x>>>0<(c[17831]|0)>>>0)Aa();else{c[x>>2]=0;v=w;break}}else{a=c[g+8>>2]|0;if(a>>>0<(c[17831]|0)>>>0)Aa();e=a+12|0;if((c[e>>2]|0)!=(g|0))Aa();p=u+8|0;if((c[p>>2]|0)==(g|0)){c[e>>2]=u;c[p>>2]=a;v=u;break}else Aa()}while(0);if(t|0){u=c[g+28>>2]|0;j=71612+(u<<2)|0;if((g|0)==(c[j>>2]|0)){c[j>>2]=v;if(!v){c[17828]=c[17828]&~(1<>>0<(c[17831]|0)>>>0)Aa();u=t+16|0;if((c[u>>2]|0)==(g|0))c[u>>2]=v;else c[t+20>>2]=v;if(!v)break}u=c[17831]|0;if(v>>>0>>0)Aa();c[v+24>>2]=t;j=g+16|0;i=c[j>>2]|0;do if(i|0)if(i>>>0>>0)Aa();else{c[v+16>>2]=i;c[i+24>>2]=v;break}while(0);i=c[j+4>>2]|0;if(i|0)if(i>>>0<(c[17831]|0)>>>0)Aa();else{c[v+20>>2]=i;c[i+24>>2]=v;break}}}else{i=c[g+8>>2]|0;u=c[g+12>>2]|0;t=71348+(d<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0<(c[17831]|0)>>>0)Aa();if((c[i+12>>2]|0)!=(g|0))Aa()}if((u|0)==(i|0)){c[17827]=c[17827]&~(1<>>0<(c[17831]|0)>>>0)Aa();t=u+8|0;if((c[t>>2]|0)==(g|0))y=t;else Aa()}else y=u+8|0;c[i+12>>2]=u;c[y>>2]=i}while(0);c[m+4>>2]=s|1;c[m+s>>2]=s;if((m|0)==(c[17832]|0)){c[17829]=s;return}else z=s}else{c[f>>2]=b&-2;c[m+4>>2]=n|1;c[m+n>>2]=n;z=n}n=z>>>3;if(z>>>0<256){b=71348+(n<<1<<2)|0;f=c[17827]|0;s=1<>2]|0;if(y>>>0<(c[17831]|0)>>>0)Aa();else{A=y;B=n}}else{c[17827]=f|s;A=b;B=b+8|0}c[B>>2]=m;c[A+12>>2]=m;c[m+8>>2]=A;c[m+12>>2]=b;return}b=z>>>8;if(b)if(z>>>0>16777215)C=31;else{A=(b+1048320|0)>>>16&8;B=b<>>16&4;s=B<>>16&2;f=14-(b|A|B)+(s<>>15)|0;C=z>>>(f+7|0)&1|f<<1}else C=0;f=71612+(C<<2)|0;c[m+28>>2]=C;c[m+20>>2]=0;c[m+16>>2]=0;B=c[17828]|0;s=1<>>1)|0);b=c[f>>2]|0;while(1){if((c[b+4>>2]&-8|0)==(z|0)){D=130;break}E=b+16+(A>>>31<<2)|0;n=c[E>>2]|0;if(!n){D=127;break}else{A=A<<1;b=n}}if((D|0)==127)if(E>>>0<(c[17831]|0)>>>0)Aa();else{c[E>>2]=m;c[m+24>>2]=b;c[m+12>>2]=m;c[m+8>>2]=m;break}else if((D|0)==130){A=b+8|0;j=c[A>>2]|0;n=c[17831]|0;if(j>>>0>=n>>>0&b>>>0>=n>>>0){c[j+12>>2]=m;c[A>>2]=m;c[m+8>>2]=j;c[m+12>>2]=b;c[m+24>>2]=0;break}else Aa()}}else{c[17828]=B|s;c[f>>2]=m;c[m+24>>2]=f;c[m+12>>2]=m;c[m+8>>2]=m}while(0);m=(c[17835]|0)+-1|0;c[17835]=m;if(!m)F=71764;else return;while(1){m=c[F>>2]|0;if(!m)break;else F=m+8|0}c[17835]=-1;return}function Mw(a,b){a=a|0;b=b|0;var d=0,e=0;if(a){d=S(b,a)|0;if((b|a)>>>0>65535)e=((d>>>0)/(a>>>0)|0|0)==(b|0)?d:-1;else e=d}else e=0;d=Kw(e)|0;if(!d)return d|0;if(!(c[d+-4>>2]&3))return d|0;Uw(d|0,0,e|0)|0;return d|0}function Nw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;if(!a){d=Kw(b)|0;return d|0}if(b>>>0>4294967231){c[(xu()|0)>>2]=12;d=0;return d|0}e=Ow(a+-8|0,b>>>0<11?16:b+11&-8)|0;if(e|0){d=e+8|0;return d|0}e=Kw(b)|0;if(!e){d=0;return d|0}f=c[a+-4>>2]|0;g=(f&-8)-((f&3|0)==0?8:4)|0;_w(e|0,a|0,(g>>>0>>0?g:b)|0)|0;Lw(a);d=e;return d|0}function Ow(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;d=a+4|0;e=c[d>>2]|0;f=e&-8;g=a+f|0;h=c[17831]|0;i=e&3;if(!((i|0)!=1&a>>>0>=h>>>0&a>>>0>>0))Aa();j=c[g+4>>2]|0;if(!(j&1))Aa();if(!i){if(b>>>0<256){k=0;return k|0}if(f>>>0>=(b+4|0)>>>0?(f-b|0)>>>0<=c[17947]<<1>>>0:0){k=a;return k|0}k=0;return k|0}if(f>>>0>=b>>>0){i=f-b|0;if(i>>>0<=15){k=a;return k|0}l=a+b|0;c[d>>2]=e&1|b|2;c[l+4>>2]=i|3;m=l+i+4|0;c[m>>2]=c[m>>2]|1;Pw(l,i);k=a;return k|0}if((g|0)==(c[17833]|0)){i=(c[17830]|0)+f|0;if(i>>>0<=b>>>0){k=0;return k|0}l=i-b|0;i=a+b|0;c[d>>2]=e&1|b|2;c[i+4>>2]=l|1;c[17833]=i;c[17830]=l;k=a;return k|0}if((g|0)==(c[17832]|0)){l=(c[17829]|0)+f|0;if(l>>>0>>0){k=0;return k|0}i=l-b|0;if(i>>>0>15){m=a+b|0;n=m+i|0;c[d>>2]=e&1|b|2;c[m+4>>2]=i|1;c[n>>2]=i;o=n+4|0;c[o>>2]=c[o>>2]&-2;p=m;q=i}else{c[d>>2]=e&1|l|2;i=a+l+4|0;c[i>>2]=c[i>>2]|1;p=0;q=0}c[17829]=q;c[17832]=p;k=a;return k|0}if(j&2|0){k=0;return k|0}p=(j&-8)+f|0;if(p>>>0>>0){k=0;return k|0}f=p-b|0;q=j>>>3;do if(j>>>0>=256){i=c[g+24>>2]|0;l=c[g+12>>2]|0;do if((l|0)==(g|0)){m=g+16|0;o=m+4|0;n=c[o>>2]|0;if(!n){r=c[m>>2]|0;if(!r){s=0;break}else{t=r;u=m}}else{t=n;u=o}while(1){o=t+20|0;n=c[o>>2]|0;if(n|0){t=n;u=o;continue}o=t+16|0;n=c[o>>2]|0;if(!n)break;else{t=n;u=o}}if(u>>>0>>0)Aa();else{c[u>>2]=0;s=t;break}}else{o=c[g+8>>2]|0;if(o>>>0>>0)Aa();n=o+12|0;if((c[n>>2]|0)!=(g|0))Aa();m=l+8|0;if((c[m>>2]|0)==(g|0)){c[n>>2]=l;c[m>>2]=o;s=l;break}else Aa()}while(0);if(i|0){l=c[g+28>>2]|0;o=71612+(l<<2)|0;if((g|0)==(c[o>>2]|0)){c[o>>2]=s;if(!s){c[17828]=c[17828]&~(1<>>0<(c[17831]|0)>>>0)Aa();l=i+16|0;if((c[l>>2]|0)==(g|0))c[l>>2]=s;else c[i+20>>2]=s;if(!s)break}l=c[17831]|0;if(s>>>0>>0)Aa();c[s+24>>2]=i;o=g+16|0;m=c[o>>2]|0;do if(m|0)if(m>>>0>>0)Aa();else{c[s+16>>2]=m;c[m+24>>2]=s;break}while(0);m=c[o+4>>2]|0;if(m|0)if(m>>>0<(c[17831]|0)>>>0)Aa();else{c[s+20>>2]=m;c[m+24>>2]=s;break}}}else{m=c[g+8>>2]|0;l=c[g+12>>2]|0;i=71348+(q<<1<<2)|0;if((m|0)!=(i|0)){if(m>>>0>>0)Aa();if((c[m+12>>2]|0)!=(g|0))Aa()}if((l|0)==(m|0)){c[17827]=c[17827]&~(1<>>0>>0)Aa();i=l+8|0;if((c[i>>2]|0)==(g|0))v=i;else Aa()}else v=l+8|0;c[m+12>>2]=l;c[v>>2]=m}while(0);if(f>>>0<16){c[d>>2]=p|e&1|2;v=a+p+4|0;c[v>>2]=c[v>>2]|1;k=a;return k|0}else{v=a+b|0;c[d>>2]=e&1|b|2;c[v+4>>2]=f|3;b=v+f+4|0;c[b>>2]=c[b>>2]|1;Pw(v,f);k=a;return k|0}return 0}function Pw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;d=a+b|0;e=c[a+4>>2]|0;do if(!(e&1)){f=c[a>>2]|0;if(!(e&3))return;g=a+(0-f)|0;h=f+b|0;i=c[17831]|0;if(g>>>0>>0)Aa();if((g|0)==(c[17832]|0)){j=d+4|0;k=c[j>>2]|0;if((k&3|0)!=3){l=g;m=h;break}c[17829]=h;c[j>>2]=k&-2;c[g+4>>2]=h|1;c[g+h>>2]=h;return}k=f>>>3;if(f>>>0<256){f=c[g+8>>2]|0;j=c[g+12>>2]|0;n=71348+(k<<1<<2)|0;if((f|0)!=(n|0)){if(f>>>0>>0)Aa();if((c[f+12>>2]|0)!=(g|0))Aa()}if((j|0)==(f|0)){c[17827]=c[17827]&~(1<>>0>>0)Aa();n=j+8|0;if((c[n>>2]|0)==(g|0))o=n;else Aa()}else o=j+8|0;c[f+12>>2]=j;c[o>>2]=f;l=g;m=h;break}f=c[g+24>>2]|0;j=c[g+12>>2]|0;do if((j|0)==(g|0)){n=g+16|0;k=n+4|0;p=c[k>>2]|0;if(!p){q=c[n>>2]|0;if(!q){r=0;break}else{s=q;t=n}}else{s=p;t=k}while(1){k=s+20|0;p=c[k>>2]|0;if(p|0){s=p;t=k;continue}k=s+16|0;p=c[k>>2]|0;if(!p)break;else{s=p;t=k}}if(t>>>0>>0)Aa();else{c[t>>2]=0;r=s;break}}else{k=c[g+8>>2]|0;if(k>>>0>>0)Aa();p=k+12|0;if((c[p>>2]|0)!=(g|0))Aa();n=j+8|0;if((c[n>>2]|0)==(g|0)){c[p>>2]=j;c[n>>2]=k;r=j;break}else Aa()}while(0);if(f){j=c[g+28>>2]|0;i=71612+(j<<2)|0;if((g|0)==(c[i>>2]|0)){c[i>>2]=r;if(!r){c[17828]=c[17828]&~(1<>>0<(c[17831]|0)>>>0)Aa();j=f+16|0;if((c[j>>2]|0)==(g|0))c[j>>2]=r;else c[f+20>>2]=r;if(!r){l=g;m=h;break}}j=c[17831]|0;if(r>>>0>>0)Aa();c[r+24>>2]=f;i=g+16|0;k=c[i>>2]|0;do if(k|0)if(k>>>0>>0)Aa();else{c[r+16>>2]=k;c[k+24>>2]=r;break}while(0);k=c[i+4>>2]|0;if(k)if(k>>>0<(c[17831]|0)>>>0)Aa();else{c[r+20>>2]=k;c[k+24>>2]=r;l=g;m=h;break}else{l=g;m=h}}else{l=g;m=h}}else{l=a;m=b}while(0);b=c[17831]|0;if(d>>>0>>0)Aa();a=d+4|0;r=c[a>>2]|0;if(!(r&2)){if((d|0)==(c[17833]|0)){s=(c[17830]|0)+m|0;c[17830]=s;c[17833]=l;c[l+4>>2]=s|1;if((l|0)!=(c[17832]|0))return;c[17832]=0;c[17829]=0;return}if((d|0)==(c[17832]|0)){s=(c[17829]|0)+m|0;c[17829]=s;c[17832]=l;c[l+4>>2]=s|1;c[l+s>>2]=s;return}s=(r&-8)+m|0;t=r>>>3;do if(r>>>0>=256){o=c[d+24>>2]|0;e=c[d+12>>2]|0;do if((e|0)==(d|0)){k=d+16|0;j=k+4|0;f=c[j>>2]|0;if(!f){n=c[k>>2]|0;if(!n){u=0;break}else{v=n;w=k}}else{v=f;w=j}while(1){j=v+20|0;f=c[j>>2]|0;if(f|0){v=f;w=j;continue}j=v+16|0;f=c[j>>2]|0;if(!f)break;else{v=f;w=j}}if(w>>>0>>0)Aa();else{c[w>>2]=0;u=v;break}}else{j=c[d+8>>2]|0;if(j>>>0>>0)Aa();f=j+12|0;if((c[f>>2]|0)!=(d|0))Aa();k=e+8|0;if((c[k>>2]|0)==(d|0)){c[f>>2]=e;c[k>>2]=j;u=e;break}else Aa()}while(0);if(o|0){e=c[d+28>>2]|0;h=71612+(e<<2)|0;if((d|0)==(c[h>>2]|0)){c[h>>2]=u;if(!u){c[17828]=c[17828]&~(1<>>0<(c[17831]|0)>>>0)Aa();e=o+16|0;if((c[e>>2]|0)==(d|0))c[e>>2]=u;else c[o+20>>2]=u;if(!u)break}e=c[17831]|0;if(u>>>0>>0)Aa();c[u+24>>2]=o;h=d+16|0;g=c[h>>2]|0;do if(g|0)if(g>>>0>>0)Aa();else{c[u+16>>2]=g;c[g+24>>2]=u;break}while(0);g=c[h+4>>2]|0;if(g|0)if(g>>>0<(c[17831]|0)>>>0)Aa();else{c[u+20>>2]=g;c[g+24>>2]=u;break}}}else{g=c[d+8>>2]|0;e=c[d+12>>2]|0;o=71348+(t<<1<<2)|0;if((g|0)!=(o|0)){if(g>>>0>>0)Aa();if((c[g+12>>2]|0)!=(d|0))Aa()}if((e|0)==(g|0)){c[17827]=c[17827]&~(1<>>0>>0)Aa();o=e+8|0;if((c[o>>2]|0)==(d|0))x=o;else Aa()}else x=e+8|0;c[g+12>>2]=e;c[x>>2]=g}while(0);c[l+4>>2]=s|1;c[l+s>>2]=s;if((l|0)==(c[17832]|0)){c[17829]=s;return}else y=s}else{c[a>>2]=r&-2;c[l+4>>2]=m|1;c[l+m>>2]=m;y=m}m=y>>>3;if(y>>>0<256){r=71348+(m<<1<<2)|0;a=c[17827]|0;s=1<>2]|0;if(x>>>0<(c[17831]|0)>>>0)Aa();else{z=x;A=m}}else{c[17827]=a|s;z=r;A=r+8|0}c[A>>2]=l;c[z+12>>2]=l;c[l+8>>2]=z;c[l+12>>2]=r;return}r=y>>>8;if(r)if(y>>>0>16777215)B=31;else{z=(r+1048320|0)>>>16&8;A=r<>>16&4;s=A<>>16&2;a=14-(r|z|A)+(s<>>15)|0;B=y>>>(a+7|0)&1|a<<1}else B=0;a=71612+(B<<2)|0;c[l+28>>2]=B;c[l+20>>2]=0;c[l+16>>2]=0;A=c[17828]|0;s=1<>2]=l;c[l+24>>2]=a;c[l+12>>2]=l;c[l+8>>2]=l;return}s=y<<((B|0)==31?0:25-(B>>>1)|0);B=c[a>>2]|0;while(1){if((c[B+4>>2]&-8|0)==(y|0)){C=127;break}D=B+16+(s>>>31<<2)|0;a=c[D>>2]|0;if(!a){C=124;break}else{s=s<<1;B=a}}if((C|0)==124){if(D>>>0<(c[17831]|0)>>>0)Aa();c[D>>2]=l;c[l+24>>2]=B;c[l+12>>2]=l;c[l+8>>2]=l;return}else if((C|0)==127){C=B+8|0;D=c[C>>2]|0;s=c[17831]|0;if(!(D>>>0>=s>>>0&B>>>0>=s>>>0))Aa();c[D+12>>2]=l;c[C>>2]=l;c[l+8>>2]=D;c[l+12>>2]=B;c[l+24>>2]=0;return}}function Qw(a,b){a=a|0;b=b|0;var c=0;if(a>>>0<9){c=Kw(b)|0;return c|0}else{c=Rw(a,b)|0;return c|0}return 0}function Rw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;d=a>>>0<16?16:a;if(!(d+-1&d))e=d;else{a=16;while(1)if(a>>>0>>0)a=a<<1;else{e=a;break}}if((-64-e|0)>>>0<=b>>>0){c[(xu()|0)>>2]=12;f=0;return f|0}a=b>>>0<11?16:b+11&-8;b=Kw(a+12+e|0)|0;if(!b){f=0;return f|0}d=b+-8|0;do if(b&e+-1){g=(b+e+-1&0-e)+-8|0;h=d;i=(g-h|0)>>>0>15?g:g+e|0;g=i-h|0;h=b+-4|0;j=c[h>>2]|0;k=(j&-8)-g|0;if(!(j&3)){c[i>>2]=(c[d>>2]|0)+g;c[i+4>>2]=k;l=i;break}else{j=i+4|0;c[j>>2]=k|c[j>>2]&1|2;m=i+k+4|0;c[m>>2]=c[m>>2]|1;c[h>>2]=g|c[h>>2]&1|2;c[j>>2]=c[j>>2]|1;Pw(d,g);l=i;break}}else l=d;while(0);d=l+4|0;b=c[d>>2]|0;if(b&3|0?(e=b&-8,e>>>0>(a+16|0)>>>0):0){i=e-a|0;e=l+a|0;c[d>>2]=a|b&1|2;c[e+4>>2]=i|3;b=e+i+4|0;c[b>>2]=c[b>>2]|1;Pw(e,i)}f=l+8|0;return f|0}function Sw(){}function Tw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=b-d>>>0;e=b-d-(c>>>0>a>>>0|0)>>>0;return (D=e,a-c>>>0|0)|0}function Uw(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=b+e|0;if((e|0)>=20){d=d&255;g=b&3;h=d|d<<8|d<<16|d<<24;i=f&~3;if(g){g=b+4-g|0;while((b|0)<(g|0)){a[b>>0]=d;b=b+1|0}}while((b|0)<(i|0)){c[b>>2]=h;b=b+4|0}}while((b|0)<(f|0)){a[b>>0]=d;b=b+1|0}return b-e|0}function Vw(a){a=a|0;return 0}function Ww(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=a+c>>>0;return (D=b+d+(e>>>0>>0|0)>>>0,e|0)|0}function Xw(b){b=b|0;var c=0;c=a[n+(b&255)>>0]|0;if((c|0)<8)return c|0;c=a[n+(b>>8&255)>>0]|0;if((c|0)<8)return c+8|0;c=a[n+(b>>16&255)>>0]|0;if((c|0)<8)return c+16|0;return (a[n+(b>>>24)>>0]|0)+24|0}function Yw(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0;g=a;h=b;i=h;j=d;k=e;l=k;if(!i){m=(f|0)!=0;if(!l){if(m){c[f>>2]=(g>>>0)%(j>>>0);c[f+4>>2]=0}n=0;o=(g>>>0)/(j>>>0)>>>0;return (D=n,o)|0}else{if(!m){n=0;o=0;return (D=n,o)|0}c[f>>2]=a|0;c[f+4>>2]=b&0;n=0;o=0;return (D=n,o)|0}}m=(l|0)==0;do if(j){if(!m){p=(V(l|0)|0)-(V(i|0)|0)|0;if(p>>>0<=31){q=p+1|0;r=31-p|0;s=p-31>>31;t=q;u=g>>>(q>>>0)&s|i<>>(q>>>0)&s;w=0;x=g<>2]=a|0;c[f+4>>2]=h|b&0;n=0;o=0;return (D=n,o)|0}r=j-1|0;if(r&j|0){s=(V(j|0)|0)+33-(V(i|0)|0)|0;q=64-s|0;p=32-s|0;y=p>>31;z=s-32|0;A=z>>31;t=s;u=p-1>>31&i>>>(z>>>0)|(i<>>(s>>>0))&A;v=A&i>>>(s>>>0);w=g<>>(z>>>0))&y|g<>31;break}if(f|0){c[f>>2]=r&g;c[f+4>>2]=0}if((j|0)==1){n=h|b&0;o=a|0|0;return (D=n,o)|0}else{r=Xw(j|0)|0;n=i>>>(r>>>0)|0;o=i<<32-r|g>>>(r>>>0)|0;return (D=n,o)|0}}else{if(m){if(f|0){c[f>>2]=(i>>>0)%(j>>>0);c[f+4>>2]=0}n=0;o=(i>>>0)/(j>>>0)>>>0;return (D=n,o)|0}if(!g){if(f|0){c[f>>2]=0;c[f+4>>2]=(i>>>0)%(l>>>0)}n=0;o=(i>>>0)/(l>>>0)>>>0;return (D=n,o)|0}r=l-1|0;if(!(r&l)){if(f|0){c[f>>2]=a|0;c[f+4>>2]=r&i|b&0}n=0;o=i>>>((Xw(l|0)|0)>>>0);return (D=n,o)|0}r=(V(l|0)|0)-(V(i|0)|0)|0;if(r>>>0<=30){s=r+1|0;p=31-r|0;t=s;u=i<>>(s>>>0);v=i>>>(s>>>0);w=0;x=g<>2]=a|0;c[f+4>>2]=h|b&0;n=0;o=0;return (D=n,o)|0}while(0);if(!t){B=x;C=w;E=v;F=u;G=0;H=0}else{b=d|0|0;d=k|e&0;e=Ww(b|0,d|0,-1,-1)|0;k=D;h=x;x=w;w=v;v=u;u=t;t=0;do{a=h;h=x>>>31|h<<1;x=t|x<<1;g=v<<1|a>>>31|0;a=v>>>31|w<<1|0;Tw(e|0,k|0,g|0,a|0)|0;i=D;l=i>>31|((i|0)<0?-1:0)<<1;t=l&1;v=Tw(g|0,a|0,l&b|0,(((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1)&d|0)|0;w=D;u=u-1|0}while((u|0)!=0);B=h;C=x;E=w;F=v;G=0;H=t}t=C;C=0;if(f|0){c[f>>2]=F;c[f+4>>2]=E}n=(t|0)>>>31|(B|C)<<1|(C<<1|t>>>31)&0|G;o=(t<<1|0>>>31)&-2|H;return (D=n,o)|0}function Zw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=b>>31|((b|0)<0?-1:0)<<1;f=((b|0)<0?-1:0)>>31|((b|0)<0?-1:0)<<1;g=d>>31|((d|0)<0?-1:0)<<1;h=((d|0)<0?-1:0)>>31|((d|0)<0?-1:0)<<1;i=Tw(e^a|0,f^b|0,e|0,f|0)|0;b=D;a=g^e;e=h^f;return Tw((Yw(i,b,Tw(g^c|0,h^d|0,g|0,h|0)|0,D,0)|0)^a|0,D^e|0,a|0,e|0)|0}function _w(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;if((e|0)>=4096)return Va(b|0,d|0,e|0)|0;f=b|0;if((b&3)==(d&3)){while(b&3){if(!e)return f|0;a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0;e=e-1|0}while((e|0)>=4){c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;e=e-4|0}}while((e|0)>0){a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0;e=e-1|0}return f|0}function $w(b,c,d){b=b|0;c=c|0;d=d|0;var e=0;if((c|0)<(b|0)&(b|0)<(c+d|0)){e=b;c=c+d|0;b=b+d|0;while((d|0)>0){b=b-1|0;c=c-1|0;d=d-1|0;a[b>>0]=a[c>>0]|0}b=e}else _w(b,c,d)|0;return b|0}function ax(a){a=a|0;return (a&255)<<24|(a>>8&255)<<16|(a>>16&255)<<8|a>>>24|0}function bx(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){D=b>>c;return a>>>c|(b&(1<>c-32|0}function cx(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){D=b>>>c;return a>>>c|(b&(1<>>c-32|0}function dx(a){a=a|0;return 0}function ex(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Yw(a,b,c,d,0)|0}function fx(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;c=a&65535;d=b&65535;e=S(d,c)|0;f=a>>>16;a=(e>>>16)+(S(d,f)|0)|0;d=b>>>16;b=S(d,c)|0;return (D=(a>>>16)+(S(d,f)|0)+(((a&65535)+b|0)>>>16)|0,a+b<<16|e&65535|0)|0}function gx(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=a;a=c;c=fx(e,a)|0;f=D;return (D=(S(b,a)|0)+(S(d,e)|0)+f|f&0,c|0|0)|0}function hx(a){a=a|0;var b=0,d=0;a=a+15&-16|0;b=c[i>>2]|0;d=b+a|0;if((a|0)>0&(d|0)<(b|0)|(d|0)<0){_()|0;Ka(12);return -1}c[i>>2]=d;if((d|0)>(Z()|0)?(Y()|0)==0:0){Ka(12);c[i>>2]=b;return -1}return b|0}function ix(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){D=b<>>32-c;return a<>2]|0,c[g>>2]|0)|0}function kx(){return 0}function lx(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0;f=l;l=l+16|0;g=f|0;h=b>>31|((b|0)<0?-1:0)<<1;i=((b|0)<0?-1:0)>>31|((b|0)<0?-1:0)<<1;j=e>>31|((e|0)<0?-1:0)<<1;k=((e|0)<0?-1:0)>>31|((e|0)<0?-1:0)<<1;m=Tw(h^a|0,i^b|0,h|0,i|0)|0;b=D;Yw(m,b,Tw(j^d|0,k^e|0,j|0,k|0)|0,D,g)|0;k=Tw(c[g>>2]^h|0,c[g+4>>2]^i|0,h|0,i|0)|0;i=D;l=f;return (D=i,k)|0}function mx(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return ub[a&63](b|0,c|0,d|0)|0}function nx(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;vb[a&15](b|0,c|0,d|0,e|0,f|0)}function ox(a,b){a=a|0;b=b|0;wb[a&15](b|0)}function px(a,b,c){a=a|0;b=b|0;c=c|0;xb[a&7](b|0,c|0)}function qx(a,b){a=a|0;b=b|0;return yb[a&15](b|0)|0}function rx(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;zb[a&7](b|0,c|0,d|0)}function sx(a){a=a|0;Ab[a&3]()}function tx(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return Bb[a&7](b|0,c|0,d|0,e|0)|0}function ux(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;Cb[a&1](b|0,c|0,d|0,e|0,f|0,g|0)}function vx(a,b,c){a=a|0;b=b|0;c=c|0;return Db[a&7](b|0,c|0)|0}function wx(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;Eb[a&1](b|0,c|0,d|0,e|0)}function xx(a,b,c){a=a|0;b=b|0;c=c|0;aa(0);return 0}function yx(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;ba(1)}function zx(a){a=a|0;ca(2)}function Ax(a,b){a=a|0;b=b|0;da(3)}function Bx(a){a=a|0;ea(4);return 0}function Cx(a,b,c){a=a|0;b=b|0;c=c|0;fa(5)}function Dx(){ga(6)}function Ex(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;ha(7);return 0}function Fx(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;ia(8)}function Gx(a,b){a=a|0;b=b|0;ja(9);return 0}function Hx(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;ka(10)} +function Ab(a){a=a|0;var b=0;b=l;l=l+a|0;l=l+15&-16;if((l|0)>=(m|0))$(a|0);return b|0}function Bb(){return l|0}function Cb(a){a=a|0;l=a}function Db(a,b){a=a|0;b=b|0;l=a;m=b}function Eb(a,b){a=a|0;b=b|0;if(!o){o=a;p=b}}function Fb(a){a=a|0;D=a}function Gb(){return D|0}function Hb(a){a=a|0;var b=0;b=Pb(32,19010,38)|0;jc(a,b);return b|0}function Ib(a){a=a|0;var b=0;b=Pb(32,19010,56)|0;hc(a,b);return b|0}function Jb(a){a=a|0;var b=0;b=Pb(32,19010,73)|0;lc(a,b);return b|0}function Kb(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0;f=d+8|0;e=Pb(f,19010,87)|0;cr(e+8|0,c|0,d|0)|0;c=Xp(b)|0;d=e+4|0;a[d>>0]=c;a[d+1>>0]=c>>8;a[d+2>>0]=c>>16;a[d+3>>0]=c>>24;d=Xp(f)|0;a[e>>0]=d;a[e+1>>0]=d>>8;a[e+2>>0]=d>>16;a[e+3>>0]=d>>24;return e|0}function Lb(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=g;if((no(e,f)|0)!=1){f=0;l=g;return f|0}e=f;c[e>>2]=a;c[e+4>>2]=b;c[f+8>>2]=d;e=Pb(24,19010,117)|0;c[e>>2]=c[f>>2];c[e+4>>2]=c[f+4>>2];c[e+8>>2]=c[f+8>>2];c[e+12>>2]=c[f+12>>2];c[e+16>>2]=c[f+16>>2];c[e+20>>2]=c[f+20>>2];f=e;l=g;return f|0}function Mb(a){a=a|0;D=c[a+4>>2]|0;return c[a>>2]|0}function Nb(a){a=a|0;return c[a+8>>2]|0}function Ob(a){a=a|0;return a+12|0}function Pb(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;q=l;l=l+64|0;if((l|0)>=(m|0))$(64);p=q+24|0;o=q+8|0;n=q;e=q+56|0;f=q+52|0;g=q+48|0;h=q+44|0;i=q+40|0;j=q+36|0;k=q+32|0;c[e>>2]=a;c[f>>2]=b;c[g>>2]=d;if((c[e>>2]|0)>>>0>41943040){c[i>>2]=74;if((c[178]|0)==-1)c[178]=Wb(1,0,19017,19037,c[i>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[178]|0))Vb();i=c[g>>2]|0;c[n>>2]=c[f>>2];c[n+4>>2]=i;Zb(1,61295,n);Vb()}c[h>>2]=Qb(c[e>>2]|0,c[f>>2]|0,c[g>>2]|0)|0;if(c[h>>2]|0){l=q;return c[h>>2]|0}c[j>>2]=81;if((c[179]|0)==-1)c[179]=Wb(1,20980,19017,19037,c[j>>2]|0)|0;if((Xb()|0)<=0){if(c[179]|0){q=dp(c[(zo()|0)>>2]|0)|0;c[o>>2]=19053;c[o+4>>2]=19017;c[o+8>>2]=81;c[o+12>>2]=q;cc(1,20980,20531,o)}}else Yb(-1,0);c[k>>2]=82;if((c[180]|0)==-1)c[180]=Wb(1,0,19017,19037,c[k>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[180]|0))Vb();c[p>>2]=19017;c[p+4>>2]=82;Zb(1,61295,p);Vb();return 0}function Qb(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=h+16|0;f=h+12|0;g=h;c[f>>2]=a;c[h+8>>2]=b;c[h+4>>2]=d;c[g>>2]=Oq(c[f>>2]|0)|0;if(!(c[g>>2]|0)){c[e>>2]=0;g=c[e>>2]|0;l=h;return g|0}else{Yq(c[g>>2]|0,0,c[f>>2]|0)|0;c[e>>2]=c[g>>2];g=c[e>>2]|0;l=h;return g|0}return 0}function Rb(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;j=l;l=l+32|0;if((l|0)>=(m|0))$(32);i=j;e=j+20|0;f=j+16|0;g=j+12|0;h=j+8|0;c[e>>2]=a;c[f>>2]=b;c[g>>2]=d;if(c[e>>2]|0){Pq(c[e>>2]|0);l=j;return}c[h>>2]=311;if((c[181]|0)==-1)c[181]=Wb(1,0,19017,19060,c[h>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[181]|0))Vb();j=c[g>>2]|0;c[i>>2]=c[f>>2];c[i+4>>2]=j;Zb(1,61295,i);Vb()}function Sb(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;i=l;l=l+48|0;if((l|0)>=(m|0))$(48);h=i;o=i+44|0;j=i+40|0;n=i+36|0;f=i+32|0;k=i+16|0;g=i+8|0;c[o>>2]=a;c[j>>2]=b;c[n>>2]=d;c[k>>2]=e;c[f>>2]=mp(c[o>>2]|0,c[j>>2]|0,c[n>>2]|0,k)|0;if((c[f>>2]|0)>>>0<(c[j>>2]|0)>>>0){l=i;return c[f>>2]|0}c[g>>2]=506;if((c[182]|0)==-1)c[182]=Wb(1,0,19017,19074,c[g>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[182]|0))Vb();c[h>>2]=19017;c[h+4>>2]=506;Zb(1,61295,h);Vb();return 0}function Tb(){c[17562]=c[3935];return}function Ub(){return}function Vb(){za()}function Wb(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+48|0;if((l|0)>=(m|0))$(48);r=s+32|0;k=s+28|0;n=s+24|0;o=s+20|0;p=s+16|0;g=s+12|0;h=s+8|0;i=s+4|0;j=s;c[k>>2]=a;c[n>>2]=b;c[o>>2]=d;c[p>>2]=e;c[g>>2]=f;if(!(c[n>>2]|0))c[n>>2]=c[17563];if((c[17564]|0)>=0&0==(c[17565]|0)){c[r>>2]=(c[k>>2]|0)<=(c[17564]|0)&1;r=c[r>>2]|0;l=s;return r|0}c[j>>2]=(c[17564]|0)>=0&1;c[i>>2]=0;while(1){if((c[i>>2]|0)>=(c[17566]|0))break;c[h>>2]=(c[17567]|0)+((c[i>>2]|0)*112|0);if(!(c[j>>2]|0?!(c[(c[h>>2]|0)+108>>2]|0):0))q=9;if((((((q|0)==9?(q=0,(c[g>>2]|0)>=(c[(c[h>>2]|0)+96>>2]|0)):0)?(c[g>>2]|0)<=(c[(c[h>>2]|0)+100>>2]|0):0)?0==(Kq(c[h>>2]|0,c[n>>2]|0,0,0,0)|0):0)?0==(Kq((c[h>>2]|0)+32|0,c[o>>2]|0,0,0,0)|0):0)?0==(Kq((c[h>>2]|0)+64|0,c[p>>2]|0,0,0,0)|0):0){q=14;break}c[i>>2]=(c[i>>2]|0)+1}if((q|0)==14){c[r>>2]=(c[k>>2]|0)<=(c[(c[h>>2]|0)+104>>2]|0)&1;r=c[r>>2]|0;l=s;return r|0}a=c[k>>2]|0;if((c[17564]|0)>=0){c[r>>2]=(a|0)<=(c[17564]|0)&1;r=c[r>>2]|0;l=s;return r|0}else{c[r>>2]=(a|0)<=4&1;r=c[r>>2]|0;l=s;return r|0}return 0}function Xb(){return c[17572]|0}function Yb(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=i;d=i+20|0;e=i+16|0;f=i+12|0;g=i+8|0;c[d>>2]=a;c[e>>2]=b;if(c[d>>2]|0){c[17572]=(c[17572]|0)+(c[d>>2]|0);l=i;return}c[f>>2]=0==(c[17572]|0)&1;c[17572]=0;if((c[e>>2]|0)==0|(c[f>>2]|0)!=0){l=i;return}c[g>>2]=906;if((c[184]|0)==-1)c[184]=Wb(1,0,19090,19268,c[g>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);l=i;return}if(!(c[184]|0)){l=i;return}c[h>>2]=19090;c[h+4>>2]=906;Zb(1,61295,h);l=i;return}function Zb(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=e+20|0;g=e+16|0;f=e;c[h>>2]=a;c[g>>2]=b;c[f>>2]=d;_b(c[h>>2]|0,c[17568]|0,c[g>>2]|0,f);l=e;return}function _b(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;A=l;l=l+240|0;if((l|0)>=(m|0))$(240);y=A+40|0;z=A+32|0;h=A+24|0;s=A+108|0;t=A+104|0;u=A+100|0;v=A+96|0;w=A+176|0;x=A+112|0;j=A+92|0;k=A+88|0;B=A+72|0;g=A+68|0;n=A+64|0;i=A+16|0;o=A+56|0;p=A+8|0;q=A+48|0;r=A;c[s>>2]=b;c[t>>2]=d;c[u>>2]=e;c[v>>2]=f;c[B>>2]=c[c[v>>2]>>2];c[k>>2]=(mp(0,0,c[u>>2]|0,B)|0)+1;if(!(c[k>>2]|0)){c[g>>2]=952;if((c[183]|0)==-1)c[183]=Wb(1,0,19090,19113,c[g>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[183]|0))Vb();c[h>>2]=19090;c[h+4>>2]=952;Zb(1,61295,h);Vb()}b=w;d=b+64|0;do{a[b>>0]=0;b=b+1|0}while((b|0)<(d|0));b=c[k>>2]|0;c[n>>2]=Va()|0;g=l;l=l+((1*b|0)+15&-16)|0;if((l|0)>=(m|0))$((1*b|0)+15&-16|0);gb(o|0,0)|0;h=qd()|0;B=i;c[B>>2]=h;c[B+4>>2]=D;B=i;h=c[B+4>>2]|0;B=(h|0)>0|(h|0)==0&(c[B>>2]|0)>>>0>0;h=i;h=br(c[h>>2]|0,c[h+4>>2]|0,1e3,0)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B=p;c[B>>2]=z;c[B+4>>2]=D;B=p;z=c[B+4>>2]|0;if(z>>>0>10|(z|0)==10&(c[B>>2]|0)>>>0>250327040|(c[17569]|0)>>>0>1e3)$b(w);c[q>>2]=1;B=c[n>>2]|0;Ca(B|0);l=A;return}$b(w);Vp(71362,g,256)|0;c[17569]=0;c[17570]=c[s>>2];z=sd()|0;B=r;c[B>>2]=z;c[B+4>>2]=D;c[17556]=c[r>>2];c[17557]=c[r+4>>2];Vp(71618,c[t>>2]|0,32)|0;ac(c[s>>2]|0,c[t>>2]|0,w,g);c[q>>2]=0;B=c[n>>2]|0;Ca(B|0);l=A;return}function $b(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;o=l;l=l+640|0;if((l|0)>=(m|0))$(640);d=o+32|0;n=o+16|0;e=o+52|0;f=o+56|0;g=o+48|0;h=o+44|0;i=o+40|0;j=o+8|0;k=o;c[e>>2]=b;b=70224;if((0==(c[b>>2]|0)?0==(c[b+4>>2]|0):0)|0==(c[17569]|0)){l=o;return}c[g>>2]=0;c[h>>2]=No(71362,0,256)|0;if(c[h>>2]|0){if((c[h>>2]|0)!=71362)c[h>>2]=(c[h>>2]|0)+-1}else c[h>>2]=71617;if((a[c[h>>2]>>0]|0)==10){c[g>>2]=1;a[c[h>>2]>>0]=0};c[d>>2]=c[17556];c[d+4>>2]=c[17557];p=ud(d)|0;b=j;c[b>>2]=p;c[b+4>>2]=D;c[d>>2]=c[j>>2];c[d+4>>2]=c[j+4>>2];c[i>>2]=ld(d,1)|0;b=c[17569]|0;j=c[i>>2]|0;c[n>>2]=256;c[n+4>>2]=71362;c[n+8>>2]=b;c[n+12>>2]=j;lp(f,576,19219,n)|0;if((c[g>>2]|0)==1)a[c[h>>2]>>0]=10;ac(c[17570]|0,71618,c[e>>2]|0,f);n=sd()|0;p=k;c[p>>2]=n;c[p+4>>2]=D;c[17556]=c[k>>2];c[17557]=c[k+4>>2];c[17569]=0;l=o;return}function ac(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;o=l;l=l+48|0;if((l|0)>=(m|0))$(48);n=o+8|0;k=o;f=o+40|0;g=o+36|0;h=o+32|0;i=o+28|0;j=o+24|0;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[i>>2]=e;if(0!=(c[17562]|0)&0==(c[17571]|0)){a=c[17562]|0;if((c[f>>2]|0)==4){c[k>>2]=c[i>>2];Rp(a,19156,k)|0}else{b=c[h>>2]|0;d=c[g>>2]|0;e=bc(c[f>>2]|0)|0;k=c[i>>2]|0;c[n>>2]=b;c[n+4>>2]=d;c[n+8>>2]=e;c[n+12>>2]=k;Rp(a,19161,n)|0}$p(c[17562]|0)|0}c[j>>2]=c[17571];while(1){if(!(c[j>>2]|0))break;qb[c[(c[j>>2]|0)+4>>2]&15](c[(c[j>>2]|0)+8>>2]|0,c[f>>2]|0,c[g>>2]|0,c[h>>2]|0,c[i>>2]|0);c[j>>2]=c[c[j>>2]>>2]}l=o;return}function bc(a){a=a|0;var b=0,d=0,e=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=e+4|0;d=e;c[d>>2]=a;do if((c[d>>2]&1|0)<=0){if((c[d>>2]&2|0)>0){c[b>>2]=19179;break}if((c[d>>2]&4|0)>0){c[b>>2]=19187;break}if((c[d>>2]&8|0)>0){c[b>>2]=19195;break}if((c[d>>2]&16|0)>0){c[b>>2]=19200;break}if(!(c[d>>2]&-65)){c[b>>2]=19206;break}else{c[b>>2]=19211;break}}else c[b>>2]=19173;while(0);l=e;return c[b>>2]|0}function cc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0;n=l;l=l+176|0;if((l|0)>=(m|0))$(176);k=n;f=n+32|0;g=n+28|0;h=n+24|0;i=n+8|0;j=n+40|0;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if(!(c[g>>2]|0))c[g>>2]=c[17563];c[i>>2]=e;g=c[g>>2]|0;e=qq()|0;c[k>>2]=g;c[k+4>>2]=e;Sb(j,128,19107,k)|0;_b(c[f>>2]|0,j,c[h>>2]|0,i);l=n;return}function dc(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+64|0;if((l|0)>=(m|0))$(64);u=v+8|0;t=v;o=v+56|0;p=v+52|0;q=v+48|0;r=v+44|0;s=v+40|0;g=v+36|0;h=v+32|0;i=v+28|0;j=v+24|0;k=v+20|0;n=v+16|0;c[p>>2]=a;c[q>>2]=b;c[r>>2]=d;c[s>>2]=e;c[g>>2]=f;b=c[q>>2]|0;c[i>>2]=Va()|0;a=b;d=l;l=l+((1*a|0)+15&-16)|0;if((l|0)>=(m|0))$((1*a|0)+15&-16|0);if(1!=(ec(h,c[r>>2]|0,c[s>>2]|0)|0)){c[o>>2]=-1;c[j>>2]=1;u=c[i>>2]|0;Ca(u|0);u=c[o>>2]|0;l=v;return u|0}if(ee(c[h>>2]|0,d,c[q>>2]|0,c[p>>2]|0,c[q>>2]|0)|0){c[k>>2]=136;if((c[185]|0)==-1)c[185]=Wb(1,0,19284,19303,c[k>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[185]|0))Vb();c[t>>2]=19284;c[t+4>>2]=136;Zb(1,61295,t);Vb()}be(c[h>>2]|0);if(1!=(fc(h,c[r>>2]|0,c[s>>2]|0)|0)){c[o>>2]=-1;c[j>>2]=1;u=c[i>>2]|0;Ca(u|0);u=c[o>>2]|0;l=v;return u|0}if(!(ee(c[h>>2]|0,c[g>>2]|0,c[q>>2]|0,d,c[q>>2]|0)|0)){be(c[h>>2]|0);Yq(d|0,0,b|0)|0;c[o>>2]=c[q>>2];c[j>>2]=1;u=c[i>>2]|0;Ca(u|0);u=c[o>>2]|0;l=v;return u|0}c[n>>2]=140;if((c[186]|0)==-1)c[186]=Wb(1,0,19284,19303,c[n>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[186]|0))Vb();c[u>>2]=19284;c[u+4>>2]=140;Zb(1,61295,u);Vb();return 0}function ec(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;q=l;l=l+64|0;if((l|0)>=(m|0))$(64);p=q+16|0;o=q+8|0;n=q;e=q+48|0;f=q+44|0;g=q+40|0;h=q+36|0;i=q+32|0;j=q+28|0;k=q+24|0;c[e>>2]=a;c[f>>2]=b;c[g>>2]=d;if(ae(c[e>>2]|0,9,2,0)|0){c[i>>2]=68;if((c[190]|0)==-1)c[190]=Wb(1,0,19284,19356,c[i>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[190]|0))Vb();c[n>>2]=19284;c[n+4>>2]=68;Zb(1,61295,n);Vb()}c[h>>2]=ce(c[c[e>>2]>>2]|0,c[f>>2]|0,32)|0;if(0!=(c[h>>2]|0)?((c[h>>2]&255)<<24>>24|0)!=43:0){c[j>>2]=72;if((c[191]|0)==-1)c[191]=Wb(1,0,19284,19356,c[j>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[191]|0))Vb();c[o>>2]=19284;c[o+4>>2]=72;Zb(1,61295,o);Vb()}c[h>>2]=de(c[c[e>>2]>>2]|0,c[g>>2]|0,16)|0;if(!(c[h>>2]|0)){l=q;return 1}if(((c[h>>2]&255)<<24>>24|0)==43){l=q;return 1}c[k>>2]=76;if((c[192]|0)==-1)c[192]=Wb(1,0,19284,19356,c[k>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[192]|0))Vb();c[p>>2]=19284;c[p+4>>2]=76;Zb(1,61295,p);Vb();return 0}function fc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;q=l;l=l+64|0;if((l|0)>=(m|0))$(64);p=q+16|0;o=q+8|0;n=q;e=q+48|0;f=q+44|0;g=q+40|0;h=q+36|0;i=q+32|0;j=q+28|0;k=q+24|0;c[e>>2]=a;c[f>>2]=b;c[g>>2]=d;if(ae(c[e>>2]|0,10,2,0)|0){c[i>>2]=98;if((c[187]|0)==-1)c[187]=Wb(1,0,19284,19335,c[i>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[187]|0))Vb();c[n>>2]=19284;c[n+4>>2]=98;Zb(1,61295,n);Vb()}c[h>>2]=ce(c[c[e>>2]>>2]|0,(c[f>>2]|0)+32|0,32)|0;if(0!=(c[h>>2]|0)?((c[h>>2]&255)<<24>>24|0)!=43:0){c[j>>2]=102;if((c[188]|0)==-1)c[188]=Wb(1,0,19284,19335,c[j>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[188]|0))Vb();c[o>>2]=19284;c[o+4>>2]=102;Zb(1,61295,o);Vb()}c[h>>2]=de(c[c[e>>2]>>2]|0,(c[g>>2]|0)+16|0,16)|0;if(!(c[h>>2]|0)){l=q;return 1}if(((c[h>>2]&255)<<24>>24|0)==43){l=q;return 1}c[k>>2]=106;if((c[189]|0)==-1)c[189]=Wb(1,0,19284,19335,c[k>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[189]|0))Vb();c[p>>2]=19284;c[p+4>>2]=106;Zb(1,61295,p);Vb();return 0}function gc(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+64|0;if((l|0)>=(m|0))$(64);u=v+8|0;t=v;o=v+56|0;p=v+52|0;q=v+48|0;r=v+44|0;s=v+40|0;g=v+36|0;h=v+32|0;i=v+28|0;j=v+24|0;k=v+20|0;n=v+16|0;c[p>>2]=a;c[q>>2]=b;c[r>>2]=d;c[s>>2]=e;c[g>>2]=f;b=c[q>>2]|0;c[i>>2]=Va()|0;a=b;d=l;l=l+((1*a|0)+15&-16)|0;if((l|0)>=(m|0))$((1*a|0)+15&-16|0);if(1!=(fc(h,c[r>>2]|0,c[s>>2]|0)|0)){c[o>>2]=-1;c[j>>2]=1;u=c[i>>2]|0;Ca(u|0);u=c[o>>2]|0;l=v;return u|0}if(fe(c[h>>2]|0,d,c[q>>2]|0,c[p>>2]|0,c[q>>2]|0)|0){c[k>>2]=172;if((c[193]|0)==-1)c[193]=Wb(1,0,19284,19373,c[k>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[193]|0))Vb();c[t>>2]=19284;c[t+4>>2]=172;Zb(1,61295,t);Vb()}be(c[h>>2]|0);if(1!=(ec(h,c[r>>2]|0,c[s>>2]|0)|0)){c[o>>2]=-1;c[j>>2]=1;u=c[i>>2]|0;Ca(u|0);u=c[o>>2]|0;l=v;return u|0}if(!(fe(c[h>>2]|0,c[g>>2]|0,c[q>>2]|0,d,c[q>>2]|0)|0)){be(c[h>>2]|0);Yq(d|0,0,b|0)|0;c[o>>2]=c[q>>2];c[j>>2]=1;u=c[i>>2]|0;Ca(u|0);u=c[o>>2]|0;l=v;return u|0}c[n>>2]=176;if((c[194]|0)==-1)c[194]=Wb(1,0,19284,19373,c[n>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[194]|0))Vb();c[u>>2]=19284;c[u+4>>2]=176;Zb(1,61295,u);Vb();return 0}function hc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;p=l;l=l+64|0;if((l|0)>=(m|0))$(64);o=p+16|0;n=p+8|0;k=p;q=p+52|0;d=p+48|0;e=p+44|0;f=p+40|0;g=p+36|0;h=p+32|0;i=p+28|0;j=p+24|0;c[q>>2]=a;c[d>>2]=b;c[e>>2]=ic(c[q>>2]|0)|0;if(!(c[e>>2]|0)){c[h>>2]=231;if((c[195]|0)==-1)c[195]=Wb(1,0,19405,19418,c[h>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[195]|0))Vb();c[k>>2]=19405;c[k+4>>2]=231;Zb(1,61295,k);Vb()}if(Sd(f,c[e>>2]|0,0)|0){c[i>>2]=232;if((c[196]|0)==-1)c[196]=Wb(1,0,19405,19418,c[i>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[196]|0))Vb();c[n>>2]=19405;c[n+4>>2]=232;Zb(1,61295,n);Vb()}Cd(c[e>>2]|0);c[g>>2]=Td(19453,c[f>>2]|0,0)|0;if(c[g>>2]|0){Jc(c[d>>2]|0,32,c[g>>2]|0);Id(c[g>>2]|0);ve(c[f>>2]|0);l=p;return}c[j>>2]=235;if((c[197]|0)==-1)c[197]=Wb(1,0,19405,19418,c[j>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[197]|0))Vb();c[o>>2]=19405;c[o+4>>2]=235;Zb(1,61295,o);Vb()}function ic(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;i=l;l=l+64|0;if((l|0)>=(m|0))$(64);h=i+24|0;g=i+8|0;j=i;k=i+48|0;b=i+44|0;d=i+40|0;e=i+36|0;f=i+32|0;c[k>>2]=a;a=c[k>>2]|0;c[j>>2]=32;c[j+4>>2]=a;c[d>>2]=Bd(b,0,19461,j)|0;if(!(c[d>>2]|0)){l=i;return c[b>>2]|0}c[e>>2]=136;if((c[198]|0)==-1)c[198]=Wb(1,20980,19405,19503,c[e>>2]|0)|0;if((Xb()|0)<=0){if(c[198]|0){k=xd(c[d>>2]|0)|0;c[g>>2]=19528;c[g+4>>2]=19405;c[g+8>>2]=136;c[g+12>>2]=k;cc(1,20980,20531,g)}}else Yb(-1,0);c[f>>2]=137;if((c[199]|0)==-1)c[199]=Wb(1,0,19405,19503,c[f>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[199]|0))Vb();c[h>>2]=19405;c[h+4>>2]=137;Zb(1,61295,h);Vb();return 0}function jc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;p=l;l=l+64|0;if((l|0)>=(m|0))$(64);o=p+16|0;n=p+8|0;k=p;q=p+52|0;d=p+48|0;e=p+44|0;f=p+40|0;g=p+36|0;h=p+32|0;i=p+28|0;j=p+24|0;c[q>>2]=a;c[d>>2]=b;c[e>>2]=kc(c[q>>2]|0)|0;if(!(c[e>>2]|0)){c[h>>2]=257;if((c[200]|0)==-1)c[200]=Wb(1,0,19405,19544,c[h>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[200]|0))Vb();c[k>>2]=19405;c[k+4>>2]=257;Zb(1,61295,k);Vb()}if(Sd(f,c[e>>2]|0,0)|0){c[i>>2]=258;if((c[201]|0)==-1)c[201]=Wb(1,0,19405,19544,c[i>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[201]|0))Vb();c[n>>2]=19405;c[n+4>>2]=258;Zb(1,61295,n);Vb()}Cd(c[e>>2]|0);c[g>>2]=Td(19453,c[f>>2]|0,0)|0;if(c[g>>2]|0){Jc(c[d>>2]|0,32,c[g>>2]|0);Id(c[g>>2]|0);ve(c[f>>2]|0);l=p;return}c[j>>2]=261;if((c[202]|0)==-1)c[202]=Wb(1,0,19405,19544,c[j>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[202]|0))Vb();c[o>>2]=19405;c[o+4>>2]=261;Zb(1,61295,o);Vb()}function kc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;i=l;l=l+64|0;if((l|0)>=(m|0))$(64);h=i+24|0;g=i+8|0;j=i;k=i+48|0;b=i+44|0;d=i+40|0;e=i+36|0;f=i+32|0;c[k>>2]=a;a=c[k>>2]|0;c[j>>2]=32;c[j+4>>2]=a;c[d>>2]=Bd(b,0,19579,j)|0;if(!(c[d>>2]|0)){l=i;return c[b>>2]|0}c[e>>2]=169;if((c[203]|0)==-1)c[203]=Wb(1,20980,19405,19634,c[e>>2]|0)|0;if((Xb()|0)<=0){if(c[203]|0){k=xd(c[d>>2]|0)|0;c[g>>2]=19528;c[g+4>>2]=19405;c[g+8>>2]=169;c[g+12>>2]=k;cc(1,20980,20531,g)}}else Yb(-1,0);c[f>>2]=170;if((c[204]|0)==-1)c[204]=Wb(1,0,19405,19634,c[f>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[204]|0))Vb();c[h>>2]=19405;c[h+4>>2]=170;Zb(1,61295,h);Vb();return 0}function lc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;p=l;l=l+64|0;if((l|0)>=(m|0))$(64);o=p+16|0;n=p+8|0;k=p;q=p+52|0;d=p+48|0;e=p+44|0;f=p+40|0;g=p+36|0;h=p+32|0;i=p+28|0;j=p+24|0;c[q>>2]=a;c[d>>2]=b;c[e>>2]=mc(c[q>>2]|0)|0;if(!(c[e>>2]|0)){c[h>>2]=283;if((c[205]|0)==-1)c[205]=Wb(1,0,19405,19659,c[h>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[205]|0))Vb();c[k>>2]=19405;c[k+4>>2]=283;Zb(1,61295,k);Vb()}if(Sd(f,c[e>>2]|0,0)|0){c[i>>2]=284;if((c[206]|0)==-1)c[206]=Wb(1,0,19405,19659,c[i>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[206]|0))Vb();c[n>>2]=19405;c[n+4>>2]=284;Zb(1,61295,n);Vb()}Cd(c[e>>2]|0);c[g>>2]=Td(19453,c[f>>2]|0,0)|0;if(c[g>>2]|0){Jc(c[d>>2]|0,32,c[g>>2]|0);Id(c[g>>2]|0);ve(c[f>>2]|0);l=p;return}c[j>>2]=287;if((c[207]|0)==-1)c[207]=Wb(1,0,19405,19659,c[j>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[207]|0))Vb();c[o>>2]=19405;c[o+4>>2]=287;Zb(1,61295,o);Vb()}function mc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;i=l;l=l+64|0;if((l|0)>=(m|0))$(64);h=i+24|0;g=i+8|0;j=i;k=i+48|0;b=i+44|0;d=i+40|0;e=i+36|0;f=i+32|0;c[k>>2]=a;a=c[k>>2]|0;c[j>>2]=32;c[j+4>>2]=a;c[d>>2]=Bd(b,0,19461,j)|0;if(!(c[d>>2]|0)){l=i;return c[b>>2]|0}c[e>>2]=202;if((c[208]|0)==-1)c[208]=Wb(1,20980,19405,19694,c[e>>2]|0)|0;if((Xb()|0)<=0){if(c[208]|0){k=xd(c[d>>2]|0)|0;c[g>>2]=19528;c[g+4>>2]=19405;c[g+8>>2]=202;c[g+12>>2]=k;cc(1,20980,20531,g)}}else Yb(-1,0);c[f>>2]=203;if((c[209]|0)==-1)c[209]=Wb(1,0,19405,19694,c[f>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[209]|0))Vb();c[h>>2]=19405;c[h+4>>2]=203;Zb(1,61295,h);Vb();return 0}function nc(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;p=l;l=l+96|0;if((l|0)>=(m|0))$(96);n=p+40|0;o=p+24|0;k=p+8|0;a=p+88|0;b=p+84|0;d=p+80|0;e=p+76|0;f=p+72|0;g=p+68|0;h=p+64|0;i=p+60|0;j=p+56|0;q=Bd(e,0,19719,p)|0;c[g>>2]=q;if(q){c[h>>2]=505;if((c[210]|0)==-1)c[210]=Wb(1,20980,19405,19774,c[h>>2]|0)|0;if((Xb()|0)<=0){if(c[210]|0){q=xd(c[g>>2]|0)|0;c[k>>2]=19528;c[k+4>>2]=19405;c[k+8>>2]=505;c[k+12>>2]=q;cc(1,20980,20531,k)}}else Yb(-1,0);c[a>>2]=0;q=c[a>>2]|0;l=p;return q|0}q=je(d,c[e>>2]|0)|0;c[g>>2]=q;if(q){c[i>>2]=510;if((c[211]|0)==-1)c[211]=Wb(1,20980,19405,19774,c[i>>2]|0)|0;if((Xb()|0)<=0){if(c[211]|0){q=xd(c[g>>2]|0)|0;c[o>>2]=19805;c[o+4>>2]=19405;c[o+8>>2]=510;c[o+12>>2]=q;cc(1,20980,20531,o)}}else Yb(-1,0);Cd(c[e>>2]|0);c[a>>2]=0;q=c[a>>2]|0;l=p;return q|0}Cd(c[e>>2]|0);q=oc(f,c[d>>2]|0,37667,35384)|0;c[g>>2]=q;if(!q){Cd(c[d>>2]|0);c[b>>2]=Pb(32,19405,530)|0;Jc(c[b>>2]|0,32,c[f>>2]|0);Id(c[f>>2]|0);c[a>>2]=c[b>>2];q=c[a>>2]|0;l=p;return q|0}c[j>>2]=525;if((c[212]|0)==-1)c[212]=Wb(1,20980,19405,19774,c[j>>2]|0)|0;if((Xb()|0)<=0){if(c[212]|0){q=xd(c[g>>2]|0)|0;c[n>>2]=19820;c[n+4>>2]=19405;c[n+8>>2]=525;c[n+12>>2]=q;cc(1,20980,20531,n)}}else Yb(-1,0);Cd(c[d>>2]|0);c[a>>2]=0;q=c[a>>2]|0;l=p;return q|0}function oc(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;q=l;l=l+48|0;if((l|0)>=(m|0))$(48);n=q+36|0;o=q+32|0;s=q+28|0;r=q+24|0;g=q+20|0;p=q+16|0;h=q+12|0;i=q+8|0;j=q+4|0;k=q;c[o>>2]=b;c[s>>2]=d;c[r>>2]=e;c[g>>2]=f;c[p>>2]=Ed(c[s>>2]|0,c[r>>2]|0,0)|0;if(!(c[p>>2]|0)){c[n>>2]=1;s=c[n>>2]|0;l=q;return s|0}c[h>>2]=Fd(c[p>>2]|0)|0;Cd(c[p>>2]|0);c[p>>2]=c[h>>2];if(!(c[p>>2]|0)){c[n>>2]=2;s=c[n>>2]|0;l=q;return s|0}c[k>>2]=0;c[i>>2]=c[g>>2];while(1){d=c[p>>2]|0;if(!(a[c[i>>2]>>0]|0)){b=18;break}c[h>>2]=Ed(d,c[i>>2]|0,1)|0;if(!(c[h>>2]|0)){b=8;break}s=Gd(c[h>>2]|0,1,5)|0;c[(c[o>>2]|0)+(c[k>>2]<<2)>>2]=s;Cd(c[h>>2]|0);if(!(c[(c[o>>2]|0)+(c[k>>2]<<2)>>2]|0)){b=13;break}c[i>>2]=(c[i>>2]|0)+1;c[k>>2]=(c[k>>2]|0)+1}if((b|0)==8){c[j>>2]=0;while(1){if((c[j>>2]|0)>>>0>=(c[k>>2]|0)>>>0)break;ye(c[(c[o>>2]|0)+(c[j>>2]<<2)>>2]|0);c[(c[o>>2]|0)+(c[j>>2]<<2)>>2]=0;c[j>>2]=(c[j>>2]|0)+1}Cd(c[p>>2]|0);c[n>>2]=3;s=c[n>>2]|0;l=q;return s|0}else if((b|0)==13){c[j>>2]=0;while(1){if((c[j>>2]|0)>>>0>=(c[k>>2]|0)>>>0)break;ye(c[(c[o>>2]|0)+(c[j>>2]<<2)>>2]|0);c[(c[o>>2]|0)+(c[j>>2]<<2)>>2]=0;c[j>>2]=(c[j>>2]|0)+1}Cd(c[p>>2]|0);c[n>>2]=4;s=c[n>>2]|0;l=q;return s|0}else if((b|0)==18){Cd(d);c[n>>2]=0;s=c[n>>2]|0;l=q;return s|0}return 0}function pc(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;p=l;l=l+96|0;if((l|0)>=(m|0))$(96);n=p+40|0;o=p+24|0;k=p+8|0;a=p+88|0;b=p+84|0;d=p+80|0;e=p+76|0;f=p+72|0;g=p+68|0;h=p+64|0;i=p+60|0;j=p+56|0;q=Bd(e,0,19834,p)|0;c[g>>2]=q;if(q){c[h>>2]=555;if((c[213]|0)==-1)c[213]=Wb(1,20980,19405,19872,c[h>>2]|0)|0;if((Xb()|0)<=0){if(c[213]|0){q=xd(c[g>>2]|0)|0;c[k>>2]=19528;c[k+4>>2]=19405;c[k+8>>2]=555;c[k+12>>2]=q;cc(1,20980,20531,k)}}else Yb(-1,0);c[a>>2]=0;q=c[a>>2]|0;l=p;return q|0}q=je(d,c[e>>2]|0)|0;c[g>>2]=q;if(q){c[i>>2]=560;if((c[214]|0)==-1)c[214]=Wb(1,20980,19405,19872,c[i>>2]|0)|0;if((Xb()|0)<=0){if(c[214]|0){q=xd(c[g>>2]|0)|0;c[o>>2]=19805;c[o+4>>2]=19405;c[o+8>>2]=560;c[o+12>>2]=q;cc(1,20980,20531,o)}}else Yb(-1,0);Cd(c[e>>2]|0);c[a>>2]=0;q=c[a>>2]|0;l=p;return q|0}Cd(c[e>>2]|0);q=oc(f,c[d>>2]|0,37667,35384)|0;c[g>>2]=q;if(!q){Cd(c[d>>2]|0);c[b>>2]=Pb(32,19405,580)|0;Jc(c[b>>2]|0,32,c[f>>2]|0);Id(c[f>>2]|0);c[a>>2]=c[b>>2];q=c[a>>2]|0;l=p;return q|0}c[j>>2]=575;if((c[215]|0)==-1)c[215]=Wb(1,20980,19405,19872,c[j>>2]|0)|0;if((Xb()|0)<=0){if(c[215]|0){q=xd(c[g>>2]|0)|0;c[n>>2]=19820;c[n+4>>2]=19405;c[n+8>>2]=575;c[n+12>>2]=q;cc(1,20980,20531,n)}}else Yb(-1,0);Cd(c[d>>2]|0);c[a>>2]=0;q=c[a>>2]|0;l=p;return q|0}function qc(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;p=l;l=l+96|0;if((l|0)>=(m|0))$(96);n=p+40|0;o=p+24|0;k=p+8|0;a=p+88|0;b=p+84|0;d=p+80|0;e=p+76|0;f=p+72|0;g=p+68|0;h=p+64|0;i=p+60|0;j=p+56|0;q=Bd(e,0,19903,p)|0;c[g>>2]=q;if(q){c[h>>2]=604;if((c[216]|0)==-1)c[216]=Wb(1,20980,19405,19947,c[h>>2]|0)|0;if((Xb()|0)<=0){if(c[216]|0){q=xd(c[g>>2]|0)|0;c[k>>2]=19528;c[k+4>>2]=19405;c[k+8>>2]=604;c[k+12>>2]=q;cc(1,20980,20531,k)}}else Yb(-1,0);c[a>>2]=0;q=c[a>>2]|0;l=p;return q|0}q=je(d,c[e>>2]|0)|0;c[g>>2]=q;if(q){c[i>>2]=609;if((c[217]|0)==-1)c[217]=Wb(1,20980,19405,19947,c[i>>2]|0)|0;if((Xb()|0)<=0){if(c[217]|0){q=xd(c[g>>2]|0)|0;c[o>>2]=19805;c[o+4>>2]=19405;c[o+8>>2]=609;c[o+12>>2]=q;cc(1,20980,20531,o)}}else Yb(-1,0);Cd(c[e>>2]|0);c[a>>2]=0;q=c[a>>2]|0;l=p;return q|0}Cd(c[e>>2]|0);q=oc(f,c[d>>2]|0,37667,35384)|0;c[g>>2]=q;if(!q){Cd(c[d>>2]|0);c[b>>2]=Pb(32,19405,629)|0;Jc(c[b>>2]|0,32,c[f>>2]|0);Id(c[f>>2]|0);c[a>>2]=c[b>>2];q=c[a>>2]|0;l=p;return q|0}c[j>>2]=624;if((c[218]|0)==-1)c[218]=Wb(1,20980,19405,19947,c[j>>2]|0)|0;if((Xb()|0)<=0){if(c[218]|0){q=xd(c[g>>2]|0)|0;c[n>>2]=19820;c[n+4>>2]=19405;c[n+8>>2]=624;c[n+12>>2]=q;cc(1,20980,20531,n)}}else Yb(-1,0);Cd(c[d>>2]|0);c[a>>2]=0;q=c[a>>2]|0;l=p;return q|0}function rc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;r=l;l=l+80|0;if((l|0)>=(m|0))$(80);q=r+16|0;p=r;i=r+68|0;t=r+64|0;s=r+60|0;j=r+56|0;k=r+52|0;n=r+48|0;o=r+44|0;e=r+40|0;f=r+32|0;g=r+28|0;h=r+24|0;c[t>>2]=a;c[s>>2]=b;c[j>>2]=d;c[k>>2]=kc(c[t>>2]|0)|0;c[o>>2]=sc(c[s>>2]|0)|0;d=ge(n,c[o>>2]|0,c[k>>2]|0)|0;c[e>>2]=d;if(d){c[g>>2]=807;if((c[219]|0)==-1)c[219]=Wb(2,20980,19405,19978,c[g>>2]|0)|0;if((Xb()|0)<=0){if(c[219]|0){t=xd(c[e>>2]|0)|0;c[p>>2]=19405;c[p+4>>2]=807;c[p+8>>2]=t;cc(2,20980,20003,p)}}else Yb(-1,0);Cd(c[o>>2]|0);Cd(c[k>>2]|0);c[i>>2]=-1;t=c[i>>2]|0;l=r;return t|0}Cd(c[k>>2]|0);Cd(c[o>>2]|0);t=oc(f,c[n>>2]|0,37529,46882)|0;c[e>>2]=t;if(!t){Cd(c[n>>2]|0);Jc(c[j>>2]|0,32,c[f>>2]|0);Jc((c[j>>2]|0)+32|0,32,c[f+4>>2]|0);Id(c[f>>2]|0);Id(c[f+4>>2]|0);c[i>>2]=1;t=c[i>>2]|0;l=r;return t|0}c[h>>2]=819;if((c[220]|0)==-1)c[220]=Wb(1,0,19405,19978,c[h>>2]|0)|0;if((Xb()|0)<=0){if(c[220]|0){c[q>>2]=19405;c[q+4>>2]=819;Zb(1,61295,q)}}else Yb(-1,0);Cd(c[n>>2]|0);c[i>>2]=-1;t=c[i>>2]|0;l=r;return t|0}function sc(a){a=a|0;var b=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;i=l;l=l+128|0;if((l|0)>=(m|0))$(128);h=i+16|0;j=i;b=i+116|0;o=i+112|0;k=i+48|0;e=i+40|0;f=i+36|0;g=i+32|0;c[o>>2]=a;n=c[o>>2]|0;a=c[o>>2]|0;wc(n,Yp(d[a>>0]|d[a+1>>0]<<8|d[a+2>>0]<<16|d[a+3>>0]<<24)|0,k);c[j>>2]=37609;c[j+4>>2]=64;c[j+8>>2]=k;a=Bd(e,0,20038,j)|0;c[f>>2]=a;if(!a){c[b>>2]=c[e>>2];o=c[b>>2]|0;l=i;return o|0}c[g>>2]=698;if((c[221]|0)==-1)c[221]=Wb(1,20980,19405,20082,c[g>>2]|0)|0;if((Xb()|0)<=0){if(c[221]|0){o=xd(c[f>>2]|0)|0;c[h>>2]=19528;c[h+4>>2]=19405;c[h+8>>2]=698;c[h+12>>2]=o;cc(1,20980,20531,h)}}else Yb(-1,0);c[b>>2]=0;o=c[b>>2]|0;l=i;return o|0}function tc(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;w=l;l=l+96|0;if((l|0)>=(m|0))$(96);u=w+40|0;t=w+32|0;v=w+16|0;s=w;n=w+92|0;x=w+88|0;o=w+84|0;p=w+80|0;q=w+76|0;r=w+72|0;g=w+68|0;h=w+64|0;i=w+60|0;j=w+56|0;k=w+52|0;c[x>>2]=a;c[o>>2]=b;c[p>>2]=e;c[q>>2]=f;e=c[x>>2]|0;f=(c[o>>2]|0)+4|0;if((e|0)!=(Yp(d[f>>0]|d[f+1>>0]<<8|d[f+2>>0]<<16|d[f+3>>0]<<24)|0)){c[n>>2]=-1;x=c[n>>2]|0;l=w;return x|0}f=c[p>>2]|0;x=(c[p>>2]|0)+32|0;c[s>>2]=32;c[s+4>>2]=f;c[s+8>>2]=32;c[s+12>>2]=x;x=Bd(g,0,20141,s)|0;c[i>>2]=x;if(x){c[j>>2]=918;if((c[222]|0)==-1)c[222]=Wb(1,20980,19405,20170,c[j>>2]|0)|0;if((Xb()|0)<=0){if(c[222]|0){x=xd(c[i>>2]|0)|0;c[v>>2]=19528;c[v+4>>2]=19405;c[v+8>>2]=918;c[v+12>>2]=x;cc(1,20980,20531,v)}}else Yb(-1,0);c[n>>2]=-1;x=c[n>>2]|0;l=w;return x|0}c[r>>2]=sc(c[o>>2]|0)|0;x=c[q>>2]|0;c[t>>2]=32;c[t+4>>2]=x;x=Bd(h,0,20197,t)|0;c[i>>2]=x;if(x){Cd(c[r>>2]|0);Cd(c[g>>2]|0);c[n>>2]=-1;x=c[n>>2]|0;l=w;return x|0}c[i>>2]=he(c[g>>2]|0,c[r>>2]|0,c[h>>2]|0)|0;Cd(c[h>>2]|0);Cd(c[r>>2]|0);Cd(c[g>>2]|0);if(!(c[i>>2]|0)){c[n>>2]=1;x=c[n>>2]|0;l=w;return x|0}c[k>>2]=938;if((c[223]|0)==-1)c[223]=Wb(8,20980,19405,20170,c[k>>2]|0)|0;if((Xb()|0)<=0){if(c[223]|0){x=xd(c[i>>2]|0)|0;c[u>>2]=19405;c[u+4>>2]=938;c[u+8>>2]=x;cc(8,20980,20249,u)}}else Yb(-1,0);c[n>>2]=-1;x=c[n>>2]|0;l=w;return x|0}function uc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;z=l;l=l+144|0;if((l|0)>=(m|0))$(144);w=z+40|0;v=z+32|0;y=z+16|0;x=z+8|0;A=z;p=z+104|0;q=z+100|0;B=z+96|0;r=z+92|0;s=z+88|0;t=z+84|0;u=z+80|0;e=z+76|0;f=z+72|0;g=z+68|0;h=z+112|0;i=z+64|0;j=z+60|0;k=z+56|0;n=z+52|0;o=z+48|0;c[q>>2]=a;c[B>>2]=b;c[r>>2]=d;d=c[B>>2]|0;c[A>>2]=32;c[A+4>>2]=d;if(Bd(f,0,20102,A)|0){c[p>>2]=-1;B=c[p>>2]|0;l=z;return B|0}if(Sd(e,c[f>>2]|0,0)|0){c[j>>2]=972;if((c[224]|0)==-1)c[224]=Wb(1,0,19405,20299,c[j>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[224]|0))Vb();c[x>>2]=19405;c[x+4>>2]=972;Zb(1,61295,x);Vb()}Cd(c[f>>2]|0);c[t>>2]=Ud(46923,c[e>>2]|0,0)|0;Lc(u,c[q>>2]|0,32);c[s>>2]=Qd(0)|0;Wd(c[s>>2]|0,c[u>>2]|0,c[t>>2]|0,c[e>>2]|0);Rd(c[t>>2]|0);Id(c[u>>2]|0);c[g>>2]=Hd(256)|0;if(Vd(c[g>>2]|0,0,c[s>>2]|0,c[e>>2]|0)|0){c[k>>2]=989;if((c[225]|0)==-1)c[225]=Wb(1,20980,19405,20299,c[k>>2]|0)|0;if((Xb()|0)<=0){if(c[225]|0){B=xd(0)|0;c[y>>2]=20322;c[y+4>>2]=19405;c[y+8>>2]=989;c[y+12>>2]=B;cc(1,20980,20531,y)}}else Yb(-1,0);Rd(c[s>>2]|0);ve(c[e>>2]|0);c[p>>2]=-1;B=c[p>>2]|0;l=z;return B|0}Rd(c[s>>2]|0);ve(c[e>>2]|0);c[i>>2]=32;if($d(c[g>>2]|0,2)|0){c[n>>2]=998;if((c[226]|0)==-1)c[226]=Wb(1,0,19405,20299,c[n>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[226]|0))Vb();c[v>>2]=19405;c[v+4>>2]=998;Zb(1,61295,v);Vb()}if(!(Ld(1,h,c[i>>2]|0,i,c[g>>2]|0)|0)){wc(h,c[i>>2]|0,c[r>>2]|0);Id(c[g>>2]|0);c[p>>2]=1;B=c[p>>2]|0;l=z;return B|0}c[o>>2]=1005;if((c[227]|0)==-1)c[227]=Wb(1,0,19405,20299,c[o>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[227]|0))Vb();c[w>>2]=19405;c[w+4>>2]=1005;Zb(1,61295,w);Vb();return 0}function vc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;z=l;l=l+144|0;if((l|0)>=(m|0))$(144);w=z+40|0;v=z+32|0;y=z+16|0;x=z+8|0;A=z;p=z+104|0;q=z+100|0;B=z+96|0;r=z+92|0;s=z+88|0;t=z+84|0;u=z+80|0;e=z+76|0;f=z+72|0;g=z+68|0;h=z+112|0;i=z+64|0;j=z+60|0;k=z+56|0;n=z+52|0;o=z+48|0;c[q>>2]=a;c[B>>2]=b;c[r>>2]=d;d=c[B>>2]|0;c[A>>2]=32;c[A+4>>2]=d;if(Bd(f,0,20102,A)|0){c[p>>2]=-1;B=c[p>>2]|0;l=z;return B|0}if(Sd(e,c[f>>2]|0,0)|0){c[j>>2]=1403;if((c[228]|0)==-1)c[228]=Wb(1,0,19405,20340,c[j>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[228]|0))Vb();c[x>>2]=19405;c[x+4>>2]=1403;Zb(1,61295,x);Vb()}Cd(c[f>>2]|0);c[t>>2]=Ud(46923,c[e>>2]|0,0)|0;Lc(u,c[q>>2]|0,32);c[s>>2]=Qd(0)|0;Wd(c[s>>2]|0,c[u>>2]|0,c[t>>2]|0,c[e>>2]|0);Rd(c[t>>2]|0);Id(c[u>>2]|0);c[g>>2]=Hd(256)|0;if(Vd(c[g>>2]|0,0,c[s>>2]|0,c[e>>2]|0)|0){c[k>>2]=1420;if((c[229]|0)==-1)c[229]=Wb(1,20980,19405,20340,c[k>>2]|0)|0;if((Xb()|0)<=0){if(c[229]|0){B=xd(0)|0;c[y>>2]=20322;c[y+4>>2]=19405;c[y+8>>2]=1420;c[y+12>>2]=B;cc(1,20980,20531,y)}}else Yb(-1,0);Rd(c[s>>2]|0);ve(c[e>>2]|0);c[p>>2]=-1;B=c[p>>2]|0;l=z;return B|0}Rd(c[s>>2]|0);ve(c[e>>2]|0);c[i>>2]=32;if($d(c[g>>2]|0,2)|0){c[n>>2]=1429;if((c[230]|0)==-1)c[230]=Wb(1,0,19405,20340,c[n>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[230]|0))Vb();c[v>>2]=19405;c[v+4>>2]=1429;Zb(1,61295,v);Vb()}if(!(Ld(1,h,c[i>>2]|0,i,c[g>>2]|0)|0)){wc(h,c[i>>2]|0,c[r>>2]|0);Id(c[g>>2]|0);c[p>>2]=1;B=c[p>>2]|0;l=z;return B|0}c[o>>2]=1436;if((c[231]|0)==-1)c[231]=Wb(1,0,19405,20340,c[o>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[231]|0))Vb();c[w>>2]=19405;c[w+4>>2]=1436;Zb(1,61295,w);Vb();return 0}function wc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=e+8|0;f=e+4|0;h=e;c[g>>2]=a;c[f>>2]=b;c[h>>2]=d;pe(10,c[h>>2]|0,c[g>>2]|0,c[f>>2]|0);l=e;return}function xc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=g+8|0;e=g+4|0;f=g;c[d>>2]=a;c[e>>2]=b;c[f>>2]=15;while(1){if((c[f>>2]|0)<0)break;b=Nc(c[d>>2]|0,-1)|0;c[(c[e>>2]|0)+(c[f>>2]<<2)>>2]=b;c[f>>2]=(c[f>>2]|0)+-1}l=g;return}function yc(){var a=0,b=0,d=0,e=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=e;a=e+12|0;b=e+8|0;c[a>>2]=Pb(4,20365,425)|0;if(!(ke(c[a>>2]|0,10,0)|0)){l=e;return c[a>>2]|0}c[b>>2]=429;if((c[232]|0)==-1)c[232]=Wb(1,0,20365,20379,c[b>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[232]|0))Vb();c[d>>2]=20365;c[d+4>>2]=429;Zb(1,61295,d);Vb();return 0}function zc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);h=e+8|0;g=e+4|0;f=e;c[h>>2]=a;c[g>>2]=b;c[f>>2]=d;ne(c[c[h>>2]>>2]|0,c[g>>2]|0,c[f>>2]|0);l=e;return}function Ac(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;j=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=j;i=j+20|0;e=j+16|0;h=j+12|0;f=j+8|0;c[i>>2]=b;c[e>>2]=d;c[h>>2]=oe(c[c[i>>2]>>2]|0,0)|0;if(c[h>>2]|0){if(!(c[e>>2]|0)){i=c[i>>2]|0;Bc(i);l=j;return}e=c[e>>2]|0;b=c[h>>2]|0;d=e+64|0;do{a[e>>0]=a[b>>0]|0;e=e+1|0;b=b+1|0}while((e|0)<(d|0));i=c[i>>2]|0;Bc(i);l=j;return}c[f>>2]=462;if((c[233]|0)==-1)c[233]=Wb(1,0,20365,20412,c[f>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[233]|0))Vb();c[g>>2]=20365;c[g+4>>2]=462;Zb(1,61295,g);Vb()}function Bc(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;le(c[c[d>>2]>>2]|0);Rb(c[d>>2]|0,20365,480);l=b;return}function Cc(b,d,e,f,g,h,i,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0;U=l;l=l+144|0;if((l|0)>=(m|0))$(144);S=U+136|0;G=U+132|0;n=U+128|0;o=U+124|0;p=U+120|0;q=U+116|0;r=U+112|0;s=U+108|0;t=U+104|0;w=U+100|0;H=U+96|0;I=U+92|0;J=U+88|0;x=U+84|0;K=U+80|0;L=U+76|0;M=U+72|0;F=U+68|0;N=U+64|0;O=U+60|0;y=U+56|0;z=U+40|0;P=U+36|0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0,c[M>>2]|0)|0;c[x>>2]=(c[x>>2]|0)+1}Yq(e+(c[M>>2]|0)+(c[y>>2]|0)|0,c[x>>2]&255|0,1)|0;me(c[I>>2]|0);d=c[I>>2]|0;b=c[F>>2]|0;if((c[K>>2]|0)>>>0>0)c[J>>2]=Ec(d,f,b,e,c[Q>>2]|0)|0;else c[J>>2]=Ec(d,f,b,e+(c[M>>2]|0)|0,(c[Q>>2]|0)-(c[M>>2]|0)|0)|0;if(!(c[J>>2]|0)){c[P>>2]=4;break}if(c[L>>2]|0)cr(c[G>>2]|0,c[J>>2]|0,c[L>>2]|0)|0}c[O>>2]=1;c[P>>2]=22}while(0);Ca(c[R>>2]|0);switch(c[P>>2]|0){case 4:{T=45;break a}case 22:break a;default:{}}T=c[N>>2]|0;Ca(T|0);T=c[S>>2]|0;l=U;return T|0}while(0);if((T|0)==45)c[O>>2]=-1;le(c[H>>2]|0);le(c[I>>2]|0);c[S>>2]=c[O>>2];c[P>>2]=1;T=c[N>>2]|0;Ca(T|0);T=c[S>>2]|0;l=U;return T|0}function Dc(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0;n=l;l=l+32|0;if((l|0)>=(m|0))$(32);j=n+28|0;k=n+24|0;r=n+20|0;q=n+16|0;p=n+12|0;o=n+8|0;h=n+4|0;i=n;c[k>>2]=a;c[r>>2]=b;c[q>>2]=d;c[p>>2]=e;c[o>>2]=f;c[h>>2]=g;c[i>>2]=Ec(c[k>>2]|0,c[r>>2]|0,c[q>>2]|0,c[p>>2]|0,c[o>>2]|0)|0;if(!(c[i>>2]|0)){c[j>>2]=-1;r=c[j>>2]|0;l=n;return r|0}if(re(qe(c[k>>2]|0)|0)|0){q=c[h>>2]|0;r=c[i>>2]|0;cr(q|0,r|0,re(qe(c[k>>2]|0)|0)|0)|0}c[j>>2]=1;r=c[j>>2]|0;l=n;return r|0}function Ec(a,b,d,e,f){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12>>2]=4;c[x+16>>2]=0;c[x+20>>2]=0;c[o>>2]=Hc(d,b,e,f,g,h,x)|0;if(1!=(c[o>>2]|0)){a=3;break}c[o>>2]=Kd(c[u>>2]|0,5,d,b,q)|0;if(c[o>>2]|0){a=11;break}Zd(c[c[u>>2]>>2]|0,c[p>>2]|0);if(Yd(c[c[u>>2]>>2]|0,c[p>>2]|0)|0){a=19;break}c[r>>2]=(c[r>>2]|0)+1;if(0>(Jd(c[c[u>>2]>>2]|0,c[v>>2]|0)|0))c[t>>2]=3;else{Id(c[c[u>>2]>>2]|0);c[t>>2]=0}Ca(c[s>>2]|0);if((c[t>>2]|0)>>>0>=1){a=30;break}}if((a|0)==3){c[y>>2]=155;if((c[234]|0)==-1)c[234]=Wb(1,0,20446,20459,c[y>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[234]|0))Vb();c[D>>2]=20446;c[D+4>>2]=155;Zb(1,61295,D);Vb()}else if((a|0)==11){c[z>>2]=162;if((c[235]|0)==-1)c[235]=Wb(1,0,20446,20459,c[z>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[235]|0))Vb();c[B>>2]=20446;c[B+4>>2]=162;Zb(1,61295,B);Vb()}else if((a|0)==19){c[A>>2]=165;if((c[236]|0)==-1)c[236]=Wb(1,0,20446,20459,c[A>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[236]|0))Vb();c[C>>2]=20446;c[C+4>>2]=165;Zb(1,61295,C);Vb()}else if((a|0)==30){l=E;return}}function Jc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=l;l=l+80|0;if((l|0)>=(m|0))$(80);s=t+24|0;r=t+8|0;q=t;h=t+68|0;i=t+64|0;j=t+60|0;k=t+56|0;n=t+52|0;o=t+48|0;p=t+44|0;e=t+40|0;f=t+36|0;g=t+32|0;c[h>>2]=a;c[i>>2]=b;c[j>>2]=d;if($d(c[j>>2]|0,2)|0){c[p>>2]=_d(c[j>>2]|0,o)|0;if(c[p>>2]|0){c[k>>2]=(((c[o>>2]|0)+7|0)>>>0)/8|0;if((c[k>>2]|0)>>>0>(c[i>>2]|0)>>>0)c[k>>2]=c[i>>2];if(c[k>>2]|0)cr(c[h>>2]|0,c[p>>2]|0,c[k>>2]|0)|0;if((c[k>>2]|0)>>>0>=(c[i>>2]|0)>>>0){l=t;return}Yq((c[h>>2]|0)+(c[k>>2]|0)|0,0,(c[i>>2]|0)-(c[k>>2]|0)|0)|0;l=t;return}c[e>>2]=89;if((c[237]|0)==-1)c[237]=Wb(1,0,20485,20498,c[e>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[237]|0))Vb();c[q>>2]=20485;c[q+4>>2]=89;Zb(1,61295,q);Vb()}else{c[k>>2]=c[i>>2];q=Ld(5,c[h>>2]|0,c[k>>2]|0,k,c[j>>2]|0)|0;c[n>>2]=q;if(!q){Kc(c[h>>2]|0,c[k>>2]|0,c[i>>2]|0);l=t;return}c[f>>2]=110;if((c[238]|0)==-1)c[238]=Wb(1,20980,20485,20498,c[f>>2]|0)|0;if((Xb()|0)<=0){if(c[238]|0){t=xd(c[n>>2]|0)|0;c[r>>2]=20568;c[r+4>>2]=20485;c[r+8>>2]=110;c[r+12>>2]=t;cc(1,20980,20531,r)}}else Yb(-1,0);c[g>>2]=111;if((c[239]|0)==-1)c[239]=Wb(1,0,20485,20498,c[g>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[239]|0))Vb();c[s>>2]=20485;c[s+4>>2]=111;Zb(1,61295,s);Vb()}}function Kc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=i+12|0;f=i+8|0;g=i+4|0;h=i;c[e>>2]=a;c[f>>2]=b;c[g>>2]=d;c[h>>2]=c[e>>2];if((c[f>>2]|0)>>>0>=(c[g>>2]|0)>>>0){l=i;return}dr((c[h>>2]|0)+((c[g>>2]|0)-(c[f>>2]|0))|0,c[e>>2]|0,c[f>>2]|0)|0;Yq(c[e>>2]|0,0,(c[g>>2]|0)-(c[f>>2]|0)|0)|0;l=i;return}function Lc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;j=l;l=l+48|0;if((l|0)>=(m|0))$(48);i=j+16|0;h=j;o=j+44|0;n=j+40|0;k=j+36|0;e=j+32|0;f=j+28|0;g=j+24|0;c[o>>2]=a;c[n>>2]=b;c[k>>2]=d;d=Kd(c[o>>2]|0,5,c[n>>2]|0,c[k>>2]|0,k)|0;c[e>>2]=d;if(!d){l=j;return}c[f>>2]=140;if((c[240]|0)==-1)c[240]=Wb(1,20980,20485,20583,c[f>>2]|0)|0;if((Xb()|0)<=0){if(c[240]|0){o=xd(c[e>>2]|0)|0;c[h>>2]=20615;c[h+4>>2]=20485;c[h+8>>2]=140;c[h+12>>2]=o;cc(1,20980,20531,h)}}else Yb(-1,0);c[g>>2]=141;if((c[241]|0)==-1)c[241]=Wb(1,0,20485,20583,c[g>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[241]|0))Vb();c[i>>2]=20485;c[i+4>>2]=141;Zb(1,61295,i);Vb()}function Mc(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0;n=l;l=l+80|0;if((l|0)>=(m|0))$(80);i=n+56|0;h=n+48|0;g=n+40|0;f=n+32|0;k=n+24|0;j=n+16|0;e=n+8|0;d=n;a=n+64|0;b=n+60|0;if(yd(20629)|0){c[j>>2]=0;j=zd(37,j)|0;c[a>>2]=j;if(j|0){j=c[3935]|0;e=xd(c[a>>2]|0)|0;c[k>>2]=20782;c[k+4>>2]=e;Rp(j,20743,k)|0}c[f>>2]=0;k=zd(44,f)|0;c[a>>2]=k;if(!k){c[h>>2]=0;zd(38,h)|0;c[i>>2]=0;zd(48,i)|0;j=fb(0)|0;k=Nc(2,-1)|0;k=j^k;Oc(k);l=n;return}j=c[3935]|0;k=xd(c[a>>2]|0)|0;c[g>>2]=20797;c[g+4>>2]=k;Rp(j,20743,g)|0;c[h>>2]=0;zd(38,h)|0;c[i>>2]=0;zd(48,i)|0;j=fb(0)|0;k=Nc(2,-1)|0;k=j^k;Oc(k);l=n;return}n=c[3935]|0;c[d>>2]=20629;Rp(n,20635,d)|0;c[b>>2]=286;if((c[242]|0)==-1)c[242]=Wb(1,0,20701,20717,c[b>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[242]|0))Vb();c[e>>2]=20701;c[e+4>>2]=286;Zb(1,61295,e);Vb()}function Nc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0.0;p=l;l=l+64|0;if((l|0)>=(m|0))$(64);o=p+16|0;n=p+8|0;k=p;d=p+48|0;e=p+44|0;f=p+40|0;g=p+36|0;h=p+32|0;i=p+28|0;j=p+24|0;c[e>>2]=a;c[f>>2]=b;if((c[f>>2]|0)>>>0<=0){c[i>>2]=157;if((c[243]|0)==-1)c[243]=Wb(1,0,20701,20817,c[i>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[243]|0))Vb();c[k>>2]=20701;c[k+4>>2]=157;Zb(1,61295,k);Vb()}switch(c[e>>2]|0){case 1:{o=c[17573]|0;c[17573]=o+1;if(!((o>>>0)%256|0)){c[n>>2]=0;zd(48,n)|0}c[h>>2]=-1-(4294967295%((c[f>>2]|0)>>>0)|0);do te(g,4,1);while((c[g>>2]|0)>>>0>=(c[h>>2]|0)>>>0);c[d>>2]=((c[g>>2]|0)>>>0)%((c[f>>2]|0)>>>0)|0;o=c[d>>2]|0;l=p;return o|0}case 2:{c[h>>2]=-1-(4294967295%((c[f>>2]|0)>>>0)|0);do ue(g,4);while((c[g>>2]|0)>>>0>=(c[h>>2]|0)>>>0);c[d>>2]=((c[g>>2]|0)>>>0)%((c[f>>2]|0)>>>0)|0;o=c[d>>2]|0;l=p;return o|0}case 0:{q=+((c[f>>2]|0)>>>0);c[g>>2]=~~(q*+Pc())>>>0;if((c[g>>2]|0)>>>0>=(c[f>>2]|0)>>>0)c[g>>2]=(c[f>>2]|0)-1;c[d>>2]=c[g>>2];o=c[d>>2]|0;l=p;return o|0}default:{c[j>>2]=189;if((c[244]|0)==-1)c[244]=Wb(1,0,20701,20817,c[j>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[244]|0))Vb();c[o>>2]=20701;c[o+4>>2]=189;Zb(1,61295,o);Vb()}}return 0}function Oc(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;Cq(c[d>>2]|0);l=b;return}function Pc(){return +(+(Eq()|0)/2147483647.0)}function Qc(){we(0,0);return}function Rc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0;k=l;l=l+48|0;if((l|0)>=(m|0))$(48);j=k+16|0;i=k+8|0;h=k;n=k+36|0;e=k+32|0;f=k+28|0;g=k+24|0;c[n>>2]=a;c[e>>2]=b;c[f>>2]=d;switch(c[n>>2]|0){case 1:{n=c[17574]|0;c[17574]=n+1;if(!((n>>>0)%256|0)){c[h>>2]=0;zd(48,h)|0}te(c[e>>2]|0,c[f>>2]|0,1);l=k;return}case 2:{ue(c[e>>2]|0,c[f>>2]|0);l=k;return}case 0:{n=c[17574]|0;c[17574]=n+1;if(!((n>>>0)%256|0)){c[i>>2]=0;zd(48,i)|0}te(c[e>>2]|0,c[f>>2]|0,0);l=k;return}default:{c[g>>2]=135;if((c[245]|0)==-1)c[245]=Wb(1,0,20701,20842,c[g>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[245]|0))Vb();c[j>>2]=20701;c[j+4>>2]=135;Zb(1,61295,j);Vb()}}}function Sc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0;j=l;l=l+48|0;if((l|0)>=(m|0))$(48);i=j+16|0;h=j+8|0;k=j;n=j+44|0;b=j+40|0;d=j+36|0;e=j+32|0;f=j+28|0;g=j+24|0;c[n>>2]=a;c[k>>2]=c[n>>2];if(Bd(e,0,20869,k)|0){c[f>>2]=155;if((c[246]|0)==-1)c[246]=Wb(1,0,20893,20906,c[f>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[246]|0))Vb();c[h>>2]=20893;c[h+4>>2]=155;Zb(1,61295,h);Vb()}if(!(je(d,c[e>>2]|0)|0)){Cd(c[e>>2]|0);c[b>>2]=Pb(4,20893,164)|0;c[c[b>>2]>>2]=c[d>>2];l=j;return c[b>>2]|0}c[g>>2]=158;if((c[247]|0)==-1)c[247]=Wb(1,0,20893,20906,c[g>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[247]|0))Vb();c[i>>2]=20893;c[i+4>>2]=158;Zb(1,61295,i);Vb();return 0}function Tc(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;Cd(c[c[d>>2]>>2]|0);Rb(c[d>>2]|0,20893,179);l=b;return}function Uc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;i=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=i;j=i+24|0;d=i+20|0;e=i+16|0;f=i+12|0;g=i+8|0;c[j>>2]=a;c[d>>2]=b;c[e>>2]=Dd(c[c[j>>2]>>2]|0,0,0,0)|0;c[f>>2]=Pb(c[e>>2]|0,20893,202)|0;b=(c[e>>2]|0)-1|0;if((b|0)==(Dd(c[c[j>>2]>>2]|0,0,c[f>>2]|0,c[e>>2]|0)|0)){c[c[d>>2]>>2]=c[f>>2];l=i;return c[e>>2]|0}c[g>>2]=207;if((c[248]|0)==-1)c[248]=Wb(1,0,20893,20943,c[g>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[248]|0))Vb();c[h>>2]=20893;c[h+4>>2]=207;Zb(1,61295,h);Vb();return 0}function Vc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0;j=l;l=l+48|0;if((l|0)>=(m|0))$(48);i=j+8|0;h=j;d=j+32|0;n=j+28|0;k=j+24|0;e=j+20|0;f=j+16|0;g=j+12|0;c[n>>2]=a;c[k>>2]=b;c[e>>2]=Pb(4,20893,226)|0;if(Ad(c[e>>2]|0,c[n>>2]|0,c[k>>2]|0,0)|0){c[f>>2]=234;if((c[249]|0)==-1)c[249]=Wb(2,20980,20893,20985,c[f>>2]|0)|0;if((Xb()|0)<=0){if(c[249]|0)cc(2,20980,21022,h)}else Yb(-1,0);Rb(c[e>>2]|0,20893,235);c[d>>2]=0;n=c[d>>2]|0;l=j;return n|0}if(!(ie(c[c[e>>2]>>2]|0)|0)){c[d>>2]=c[e>>2];n=c[d>>2]|0;l=j;return n|0}c[g>>2]=241;if((c[250]|0)==-1)c[250]=Wb(2,20980,20893,20985,c[g>>2]|0)|0;if((Xb()|0)<=0){if(c[250]|0)cc(2,20980,21022,i)}else Yb(-1,0);Tc(c[e>>2]|0);c[d>>2]=0;n=c[d>>2]|0;l=j;return n|0}function Wc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0;n=l;l=l+64|0;if((l|0)>=(m|0))$(64);k=n+8|0;j=n;b=n+48|0;d=n+44|0;e=n+40|0;f=n+32|0;g=n+24|0;h=n+20|0;i=n+16|0;c[d>>2]=a;c[g>>2]=Xc(f,c[c[d>>2]>>2]|0,37679,39061)|0;if(c[g>>2]|0)c[g>>2]=Xc(f,c[c[d>>2]>>2]|0,37667,39061)|0;if(c[g>>2]|0)c[g>>2]=Xc(f,c[c[d>>2]>>2]|0,40693,39061)|0;if(!(c[g>>2]|0)){j=c[f+4>>2]|0;c[k>>2]=c[f>>2];c[k+4>>2]=j;c[g>>2]=Bd(h,0,21145,k)|0;Id(c[f>>2]|0);Id(c[f+4>>2]|0);c[e>>2]=Pb(4,20893,280)|0;c[c[e>>2]>>2]=c[h>>2];c[b>>2]=c[e>>2];k=c[b>>2]|0;l=n;return k|0}c[i>>2]=270;if((c[251]|0)==-1)c[251]=Wb(2,0,20893,21056,c[i>>2]|0)|0;if((Xb()|0)<=0){if(c[251]|0){c[j>>2]=20893;c[j+4>>2]=270;Zb(66,21097,j)}}else Yb(-1,0);c[b>>2]=0;k=c[b>>2]|0;l=n;return k|0}function Xc(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;q=l;l=l+48|0;if((l|0)>=(m|0))$(48);n=q+36|0;o=q+32|0;s=q+28|0;r=q+24|0;g=q+20|0;p=q+16|0;h=q+12|0;i=q+8|0;j=q+4|0;k=q;c[o>>2]=b;c[s>>2]=d;c[r>>2]=e;c[g>>2]=f;f=Ed(c[s>>2]|0,c[r>>2]|0,0)|0;c[p>>2]=f;if(!f){c[n>>2]=1;s=c[n>>2]|0;l=q;return s|0}c[h>>2]=Fd(c[p>>2]|0)|0;Cd(c[p>>2]|0);c[p>>2]=c[h>>2];if(!(c[p>>2]|0)){c[n>>2]=2;s=c[n>>2]|0;l=q;return s|0}c[k>>2]=0;c[i>>2]=c[g>>2];while(1){d=c[p>>2]|0;if(!(a[c[i>>2]>>0]|0)){b=18;break}s=Ed(d,c[i>>2]|0,1)|0;c[h>>2]=s;if(!s){b=8;break}s=Gd(c[h>>2]|0,1,5)|0;c[(c[o>>2]|0)+(c[k>>2]<<2)>>2]=s;Cd(c[h>>2]|0);if(!(c[(c[o>>2]|0)+(c[k>>2]<<2)>>2]|0)){b=13;break}c[i>>2]=(c[i>>2]|0)+1;c[k>>2]=(c[k>>2]|0)+1}if((b|0)==8){c[j>>2]=0;while(1){if((c[j>>2]|0)>>>0>=(c[k>>2]|0)>>>0)break;ye(c[(c[o>>2]|0)+(c[j>>2]<<2)>>2]|0);c[(c[o>>2]|0)+(c[j>>2]<<2)>>2]=0;c[j>>2]=(c[j>>2]|0)+1}Cd(c[p>>2]|0);c[n>>2]=3;s=c[n>>2]|0;l=q;return s|0}else if((b|0)==13){c[j>>2]=0;while(1){if((c[j>>2]|0)>>>0>=(c[k>>2]|0)>>>0)break;ye(c[(c[o>>2]|0)+(c[j>>2]<<2)>>2]|0);c[(c[o>>2]|0)+(c[j>>2]<<2)>>2]=0;c[j>>2]=(c[j>>2]|0)+1}Cd(c[p>>2]|0);c[n>>2]=4;s=c[n>>2]|0;l=q;return s|0}else if((b|0)==18){Cd(d);c[n>>2]=0;s=c[n>>2]|0;l=q;return s|0}return 0}function Yc(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;Cd(c[c[d>>2]>>2]|0);Rb(c[d>>2]|0,20893,295);l=b;return}function Zc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;i=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=i;j=i+24|0;d=i+20|0;e=i+16|0;f=i+12|0;g=i+8|0;c[j>>2]=a;c[d>>2]=b;c[e>>2]=Dd(c[c[j>>2]>>2]|0,3,0,0)|0;c[f>>2]=Pb(c[e>>2]|0,20893,318)|0;b=(c[e>>2]|0)-1|0;if((b|0)==(Dd(c[c[j>>2]>>2]|0,3,c[f>>2]|0,c[e>>2]|0)|0)){c[c[d>>2]>>2]=c[f>>2];l=i;return c[e>>2]|0}c[g>>2]=323;if((c[252]|0)==-1)c[252]=Wb(1,0,20893,21175,c[g>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[252]|0))Vb();c[h>>2]=20893;c[h+4>>2]=323;Zb(1,61295,h);Vb();return 0}function _c(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;n=l;l=l+48|0;if((l|0)>=(m|0))$(48);k=n+8|0;j=n;d=n+44|0;p=n+40|0;o=n+36|0;e=n+32|0;f=n+28|0;g=n+24|0;h=n+20|0;i=n+16|0;c[p>>2]=a;c[o>>2]=b;c[e>>2]=Pb(4,20893,367)|0;if(Ad(c[e>>2]|0,c[p>>2]|0,c[o>>2]|0,0)|0){c[h>>2]=374;if((c[253]|0)==-1)c[253]=Wb(2,0,20893,21211,c[h>>2]|0)|0;if((Xb()|0)<=0){if(c[253]|0){c[j>>2]=20893;c[j+4>>2]=374;Zb(66,21097,j)}}else Yb(-1,0);Rb(c[e>>2]|0,20893,375);c[d>>2]=0;p=c[d>>2]|0;l=n;return p|0}c[g>>2]=Xc(f,c[c[e>>2]>>2]|0,37679,39075)|0;if(c[g>>2]|0)c[g>>2]=Xc(f,c[c[e>>2]>>2]|0,40693,39075)|0;if(!(c[g>>2]|0)){Id(c[f>>2]|0);c[d>>2]=c[e>>2];p=c[d>>2]|0;l=n;return p|0}c[i>>2]=385;if((c[254]|0)==-1)c[254]=Wb(1,0,20893,21211,c[i>>2]|0)|0;if((Xb()|0)<=0){if(c[254]|0){c[k>>2]=20893;c[k+4>>2]=385;Zb(1,61295,k)}}else Yb(-1,0);Cd(c[c[e>>2]>>2]|0);Rb(c[e>>2]|0,20893,387);c[d>>2]=0;p=c[d>>2]|0;l=n;return p|0}function $c(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;i=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=i;j=i+24|0;d=i+20|0;e=i+16|0;f=i+12|0;g=i+8|0;c[j>>2]=a;c[d>>2]=b;c[e>>2]=Dd(c[c[j>>2]>>2]|0,3,0,0)|0;c[f>>2]=Pb(c[e>>2]|0,20893,958)|0;b=(c[e>>2]|0)-1|0;if((b|0)==(Dd(c[c[j>>2]>>2]|0,3,c[f>>2]|0,c[e>>2]|0)|0)){c[c[d>>2]>>2]=c[f>>2];l=i;return c[e>>2]|0}c[g>>2]=963;if((c[255]|0)==-1)c[255]=Wb(1,0,20893,21247,c[g>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[255]|0))Vb();c[h>>2]=20893;c[h+4>>2]=963;Zb(1,61295,h);Vb();return 0}function ad(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;y=l;l=l+80|0;if((l|0)>=(m|0))$(80);x=y+8|0;w=y;r=y+76|0;s=y+72|0;t=y+68|0;u=y+64|0;v=y+60|0;g=y+56|0;h=y+52|0;i=y+48|0;j=y+40|0;k=y+32|0;n=y+28|0;o=y+24|0;p=y+20|0;q=y+16|0;c[s>>2]=a;c[t>>2]=b;c[u>>2]=d;c[v>>2]=e;c[g>>2]=f;if(!((c[v>>2]|0)!=0&(c[g>>2]|0)!=0)){c[p>>2]=738;if((c[256]|0)==-1)c[256]=Wb(1,0,20893,21282,c[p>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[256]|0))Vb();c[w>>2]=20893;c[w+4>>2]=738;Zb(1,61295,w);Vb()}c[o>>2]=Xc(j,c[c[u>>2]>>2]|0,37679,39061)|0;if(c[o>>2]|0)c[o>>2]=Xc(j,c[c[u>>2]>>2]|0,40693,39061)|0;if(!(c[o>>2]|0)){c[i>>2]=bd(c[u>>2]|0,c[s>>2]|0)|0;do if(c[i>>2]|0){c[h>>2]=cd(c[u>>2]|0,c[t>>2]|0)|0;if(!(c[h>>2]|0)){Id(c[i>>2]|0);break}c[k>>2]=Hd(0)|0;Nd(c[k>>2]|0,c[c[h>>2]>>2]|0,c[j+4>>2]|0,c[j>>2]|0);c[n>>2]=Hd(0)|0;Md(c[n>>2]|0,c[i>>2]|0,c[k>>2]|0,c[j>>2]|0);Id(c[i>>2]|0);Id(c[j>>2]|0);Id(c[j+4>>2]|0);Id(c[k>>2]|0);dd(c[h>>2]|0);x=ed(c[n>>2]|0,c[v>>2]|0)|0;c[c[g>>2]>>2]=x;Id(c[n>>2]|0);c[r>>2]=1;x=c[r>>2]|0;l=y;return x|0}while(0);Id(c[j>>2]|0);Id(c[j+4>>2]|0);c[c[v>>2]>>2]=0;c[c[g>>2]>>2]=0;c[r>>2]=0;x=c[r>>2]|0;l=y;return x|0}c[q>>2]=744;if((c[257]|0)==-1)c[257]=Wb(1,0,20893,21282,c[q>>2]|0)|0;if((Xb()|0)<=0){if(c[257]|0){c[x>>2]=20893;c[x+4>>2]=744;Zb(1,61295,x)}}else Yb(-1,0);c[c[v>>2]>>2]=0;c[c[g>>2]>>2]=0;c[r>>2]=0;x=c[r>>2]|0;l=y;return x|0}function bd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0;r=l;l=l+64|0;if((l|0)>=(m|0))$(64);o=r+8|0;n=r;p=r+52|0;f=r+48|0;g=r+44|0;h=r+40|0;i=r+36|0;j=r+32|0;k=r+28|0;q=r+24|0;d=r+20|0;e=r+16|0;c[f>>2]=a;c[g>>2]=b;if(Xc(i,c[c[f>>2]>>2]|0,40693,39075)|0){c[d>>2]=689;if((c[262]|0)==-1)c[262]=Wb(1,0,20893,21400,c[d>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[262]|0))Vb();c[n>>2]=20893;c[n+4>>2]=689;Zb(1,61295,n);Vb()}if(!($d(c[i>>2]|0,2)|0)){c[k>>2]=Zc(c[f>>2]|0,j)|0;Ic(h,c[i>>2]|0,c[j>>2]|0,c[k>>2]|0,c[g>>2]|0,64,21421);Rb(c[j>>2]|0,20893,704);c[q>>2]=fd(c[h>>2]|0,c[i>>2]|0)|0;Id(c[i>>2]|0);a=c[h>>2]|0;if(c[q>>2]|0){c[p>>2]=a;q=c[p>>2]|0;l=r;return q|0}else{Id(a);c[p>>2]=0;q=c[p>>2]|0;l=r;return q|0}}c[e>>2]=691;if((c[263]|0)==-1)c[263]=Wb(1,0,20893,21400,c[e>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[263]|0))Vb();c[o>>2]=20893;c[o+4>>2]=691;Zb(1,61295,o);Vb();return 0}function cd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;q=l;l=l+64|0;if((l|0)>=(m|0))$(64);p=q+16|0;o=q+8|0;n=q;d=q+52|0;e=q+48|0;f=q+44|0;g=q+40|0;h=q+36|0;i=q+32|0;j=q+28|0;k=q+24|0;c[d>>2]=a;c[e>>2]=b;c[f>>2]=21332;c[g>>2]=Pb(4,20893,434)|0;if(!(c[g>>2]|0)){c[i>>2]=435;if((c[259]|0)==-1)c[259]=Wb(1,0,20893,21363,c[i>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[259]|0))Vb();c[n>>2]=20893;c[n+4>>2]=435;Zb(1,61295,n);Vb()}if(Xc(h,c[c[d>>2]>>2]|0,40693,39075)|0){c[j>>2]=438;if((c[260]|0)==-1)c[260]=Wb(1,0,20893,21363,c[j>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[260]|0))Vb();c[o>>2]=20893;c[o+4>>2]=438;Zb(1,61295,o);Vb()}if(!($d(c[h>>2]|0,2)|0)){k=c[g>>2]|0;n=c[h>>2]|0;o=c[f>>2]|0;p=Fo(c[f>>2]|0)|0;Ic(k,n,o,p,c[e>>2]|0,32,21387);if(fd(c[c[g>>2]>>2]|0,c[h>>2]|0)|0){p=c[h>>2]|0;Id(p);p=c[g>>2]|0;l=q;return p|0}Rb(c[g>>2]|0,20893,448);c[g>>2]=0;p=c[h>>2]|0;Id(p);p=c[g>>2]|0;l=q;return p|0}c[k>>2]=440;if((c[261]|0)==-1)c[261]=Wb(1,0,20893,21363,c[k>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[261]|0))Vb();c[p>>2]=20893;c[p+4>>2]=440;Zb(1,61295,p);Vb();return 0}function dd(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;Id(c[c[d>>2]>>2]|0);Rb(c[d>>2]|0,20893,631);l=b;return}function ed(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;i=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=i;j=i+28|0;d=i+24|0;e=i+20|0;f=i+16|0;g=i+8|0;c[j>>2]=a;c[d>>2]=b;Ld(5,0,0,e,c[j>>2]|0)|0;c[f>>2]=Pb(c[e>>2]|0,20893,655)|0;if(!(Ld(5,c[f>>2]|0,c[e>>2]|0,i+12|0,c[j>>2]|0)|0)){c[c[d>>2]>>2]=c[f>>2];l=i;return c[e>>2]|0}c[g>>2]=661;if((c[258]|0)==-1)c[258]=Wb(1,0,20893,21306,c[g>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[258]|0))Vb();c[h>>2]=20893;c[h+4>>2]=661;Zb(1,61295,h);Vb();return 0}function fd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);h=d+12|0;g=d+8|0;f=d+4|0;e=d;c[h>>2]=a;c[g>>2]=b;c[f>>2]=Hd(0)|0;c[e>>2]=Od(c[f>>2]|0,c[h>>2]|0,c[g>>2]|0)|0;Id(c[f>>2]|0);l=d;return c[e>>2]|0}function gd(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=f+8|0;g=f;h=f+24|0;b=f+20|0;d=f+16|0;c[h>>2]=a;c[b>>2]=0;c[g>>2]=c[h>>2];if(!(Bd(b,0,21436,g)|0)){l=f;return c[b>>2]|0}c[d>>2]=806;if((c[264]|0)==-1)c[264]=Wb(1,0,20893,21466,c[d>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[264]|0))Vb();c[e>>2]=20893;c[e+4>>2]=806;Zb(1,61295,e);Vb();return 0}function hd(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=a;Cd(c[c[d>>2]>>2]|0);Rb(c[d>>2]|0,20893,936);l=b;return}function id(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;n=l;l=l+48|0;if((l|0)>=(m|0))$(48);k=n+8|0;j=n;d=n+44|0;p=n+40|0;o=n+36|0;e=n+32|0;f=n+28|0;g=n+24|0;h=n+20|0;i=n+16|0;c[p>>2]=a;c[o>>2]=b;c[e>>2]=Pb(4,20893,985)|0;if(Ad(c[e>>2]|0,c[p>>2]|0,c[o>>2]|0,0)|0){c[h>>2]=992;if((c[265]|0)==-1)c[265]=Wb(2,0,20893,21478,c[h>>2]|0)|0;if((Xb()|0)<=0){if(c[265]|0){c[j>>2]=20893;c[j+4>>2]=992;Zb(66,21097,j)}}else Yb(-1,0);Rb(c[e>>2]|0,20893,993);c[d>>2]=0;p=c[d>>2]|0;l=n;return p|0}c[f>>2]=Xc(g,c[c[e>>2]>>2]|0,37529,39073)|0;if(c[f>>2]|0)c[f>>2]=Xc(g,c[c[e>>2]>>2]|0,40693,39073)|0;if(!(c[f>>2]|0)){Id(c[g>>2]|0);c[d>>2]=c[e>>2];p=c[d>>2]|0;l=n;return p|0}c[i>>2]=1003;if((c[266]|0)==-1)c[266]=Wb(2,0,20893,21478,c[i>>2]|0)|0;if((Xb()|0)<=0){if(c[266]|0){c[k>>2]=20893;c[k+4>>2]=1003;Zb(66,21097,k)}}else Yb(-1,0);Cd(c[c[e>>2]>>2]|0);Rb(c[e>>2]|0,20893,1005);c[d>>2]=0;p=c[d>>2]|0;l=n;return p|0}function jd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;C=l;l=l+112|0;if((l|0)>=(m|0))$(112);z=C+40|0;y=C+32|0;x=C+24|0;B=C+16|0;A=C+8|0;w=C;p=C+108|0;q=C+104|0;r=C+100|0;s=C+96|0;t=C+92|0;u=C+88|0;v=C+84|0;e=C+80|0;f=C+76|0;g=C+72|0;h=C+68|0;i=C+64|0;j=C+60|0;k=C+56|0;n=C+52|0;o=C+48|0;c[q>>2]=a;c[r>>2]=b;c[s>>2]=d;c[g>>2]=Xc(u,c[c[s>>2]>>2]|0,37679,39075)|0;if(c[g>>2]|0)c[g>>2]=Xc(u,c[c[s>>2]>>2]|0,40693,39075)|0;if(c[g>>2]|0){c[i>>2]=1066;if((c[267]|0)==-1)c[267]=Wb(2,0,20893,21513,c[i>>2]|0)|0;if((Xb()|0)<=0){if(c[267]|0){c[w>>2]=20893;c[w+4>>2]=1066;Zb(66,21097,w)}}else Yb(-1,0);c[p>>2]=0;B=c[p>>2]|0;l=C;return B|0}c[g>>2]=Xc(v,c[c[q>>2]>>2]|0,37529,39073)|0;if(c[g>>2]|0)c[g>>2]=Xc(v,c[c[q>>2]>>2]|0,40693,39073)|0;if(c[g>>2]|0){Id(c[u>>2]|0);c[j>>2]=1075;if((c[268]|0)==-1)c[268]=Wb(2,0,20893,21513,c[j>>2]|0)|0;if((Xb()|0)<=0){if(c[268]|0){c[A>>2]=20893;c[A+4>>2]=1075;Zb(66,21097,A)}}else Yb(-1,0);c[p>>2]=0;B=c[p>>2]|0;l=C;return B|0}c[t>>2]=cd(c[s>>2]|0,c[r>>2]|0)|0;if(!(c[t>>2]|0)){c[k>>2]=1086;if((c[269]|0)==-1)c[269]=Wb(2,0,20893,21513,c[k>>2]|0)|0;if((Xb()|0)<=0){if(c[269]|0){c[B>>2]=20893;c[B+4>>2]=1086;Zb(66,21097,B)}}else Yb(-1,0);Id(c[u>>2]|0);Id(c[v>>2]|0);c[p>>2]=0;B=c[p>>2]|0;l=C;return B|0}c[e>>2]=Hd(0)|0;if(1!=(Pd(c[e>>2]|0,c[c[t>>2]>>2]|0,c[u>>2]|0)|0)){c[n>>2]=1100;if((c[270]|0)==-1)c[270]=Wb(2,0,20893,21513,c[n>>2]|0)|0;if((Xb()|0)<=0){if(c[270]|0){c[x>>2]=20893;c[x+4>>2]=1100;Zb(66,21097,x)}}else Yb(-1,0);Id(c[e>>2]|0);dd(c[t>>2]|0);Id(c[u>>2]|0);Id(c[v>>2]|0);c[p>>2]=0;B=c[p>>2]|0;l=C;return B|0}c[f>>2]=Hd(0)|0;Md(c[f>>2]|0,c[v>>2]|0,c[e>>2]|0,c[u>>2]|0);Id(c[u>>2]|0);Id(c[e>>2]|0);Id(c[v>>2]|0);dd(c[t>>2]|0);c[h>>2]=Pb(4,20893,1115)|0;B=c[h>>2]|0;c[y>>2]=c[f>>2];if(!(Bd(B,0,21539,y)|0)){Id(c[f>>2]|0);c[p>>2]=c[h>>2];B=c[p>>2]|0;l=C;return B|0}c[o>>2]=1120;if((c[271]|0)==-1)c[271]=Wb(1,0,20893,21513,c[o>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[271]|0))Vb();c[z>>2]=20893;c[z+4>>2]=1120;Zb(1,61295,z);Vb();return 0}function kd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0;q=l;l=l+64|0;if((l|0)>=(m|0))$(64);p=q+8|0;o=q;g=q+52|0;r=q+48|0;h=q+44|0;i=q+40|0;j=q+36|0;k=q+32|0;n=q+28|0;e=q+24|0;f=q+20|0;c[r>>2]=a;c[h>>2]=b;c[i>>2]=d;c[k>>2]=bd(c[i>>2]|0,c[r>>2]|0)|0;if(!(c[k>>2]|0)){c[e>>2]=1146;if((c[272]|0)==-1)c[272]=Wb(2,0,20893,21562,c[e>>2]|0)|0;if((Xb()|0)<=0){if(c[272]|0){c[o>>2]=20893;c[o+4>>2]=1146;Zb(66,21097,o)}}else Yb(-1,0);c[g>>2]=0;r=c[g>>2]|0;l=q;return r|0}c[j>>2]=gd(c[k>>2]|0)|0;Id(c[k>>2]|0);c[n>>2]=he(c[c[h>>2]>>2]|0,c[j>>2]|0,c[c[i>>2]>>2]|0)|0;Cd(c[j>>2]|0);if(!(c[n>>2]|0)){c[g>>2]=1;r=c[g>>2]|0;l=q;return r|0}c[f>>2]=1169;if((c[273]|0)==-1)c[273]=Wb(2,20980,20893,21562,c[f>>2]|0)|0;if((Xb()|0)<=0){if(c[273]|0){r=xd(c[n>>2]|0)|0;c[p>>2]=20893;c[p+4>>2]=1168;c[p+8>>2]=r;cc(2,20980,21587,p)}}else Yb(-1,0);c[g>>2]=-1;r=c[g>>2]|0;l=q;return r|0}function ld(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;j=l;l=l+48|0;if((l|0)>=(m|0))$(48);h=j+16|0;d=j+40|0;e=j+36|0;f=j+32|0;g=j+8|0;k=j;c[e>>2]=b;c[f>>2]=21675;o=a;b=c[o+4>>2]|0;n=g;c[n>>2]=c[o>>2];c[n+4>>2]=b;n=rd()|0;b=k;c[b>>2]=n;c[b+4>>2]=D;b=a;if((c[k>>2]|0)==(c[b>>2]|0)?(c[k+4>>2]|0)==(c[b+4>>2]|0):0){c[d>>2]=21653;o=c[d>>2]|0;l=j;return o|0}o=a;if(0==(c[o>>2]|0)?0==(c[o+4>>2]|0):0){c[d>>2]=21679;o=c[d>>2]|0;l=j;return o|0}o=g;n=c[o+4>>2]|0;if(!(!(1==(c[e>>2]|0)&(n>>>0>0|(n|0)==0&(c[o>>2]|0)>>>0>5e3))?(o=g,o=nr(c[o>>2]|0,c[o+4>>2]|0,1e3,0)|0,!(0==(o|0)&0==(D|0))):0))i=7;do if((i|0)==7){n=g;n=ir(c[n>>2]|0,c[n+4>>2]|0,1e3,0)|0;o=g;c[o>>2]=n;c[o+4>>2]=D;c[f>>2]=21661;o=g;n=c[o+4>>2]|0;if(!(1==(c[e>>2]|0)&(n>>>0>0|(n|0)==0&(c[o>>2]|0)>>>0>5e3))?(o=g,o=nr(c[o>>2]|0,c[o+4>>2]|0,1e3,0)|0,!(0==(o|0)&0==(D|0))):0)break;n=g;n=ir(c[n>>2]|0,c[n+4>>2]|0,1e3,0)|0;o=g;c[o>>2]=n;c[o+4>>2]=D;c[f>>2]=39073;o=g;n=c[o+4>>2]|0;if(!(1==(c[e>>2]|0)&(n>>>0>0|(n|0)==0&(c[o>>2]|0)>>>0>300))?(o=g,o=nr(c[o>>2]|0,c[o+4>>2]|0,60,0)|0,!(0==(o|0)&0==(D|0))):0)break;n=g;n=ir(c[n>>2]|0,c[n+4>>2]|0,60,0)|0;o=g;c[o>>2]=n;c[o+4>>2]=D;c[f>>2]=21664;o=g;n=c[o+4>>2]|0;if(!(1==(c[e>>2]|0)&(n>>>0>0|(n|0)==0&(c[o>>2]|0)>>>0>300))?(o=g,o=nr(c[o>>2]|0,c[o+4>>2]|0,60,0)|0,!(0==(o|0)&0==(D|0))):0)break;n=g;n=ir(c[n>>2]|0,c[n+4>>2]|0,60,0)|0;o=g;c[o>>2]=n;c[o+4>>2]=D;c[f>>2]=35382;o=g;n=c[o+4>>2]|0;if(!(1==(c[e>>2]|0)&(n>>>0>0|(n|0)==0&(c[o>>2]|0)>>>0>120))?(o=g,o=nr(c[o>>2]|0,c[o+4>>2]|0,24,0)|0,!(0==(o|0)&0==(D|0))):0)break;n=g;n=ir(c[n>>2]|0,c[n+4>>2]|0,24,0)|0;o=g;c[o>>2]=n;c[o+4>>2]=D;o=g;if(1==(c[o>>2]|0)?0==(c[o+4>>2]|0):0){c[f>>2]=21666;break}else{c[f>>2]=21670;break}}while(0);i=g;k=c[i+4>>2]|0;o=c[f>>2]|0;n=h;c[n>>2]=c[i>>2];c[n+4>>2]=k;c[h+8>>2]=o;Sb(71651,128,21645,h)|0;c[d>>2]=71651;o=c[d>>2]|0;l=j;return o|0}function md(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;A=l;l=l+96|0;if((l|0)>=(m|0))$(96);x=A+24|0;z=A+16|0;y=A+8|0;o=A;t=A+84|0;B=A+80|0;n=A+76|0;u=A+72|0;v=A+68|0;w=A+64|0;h=A+60|0;i=A+56|0;p=A+52|0;j=A+48|0;k=A+44|0;q=A+40|0;r=A+36|0;s=A+32|0;c[B>>2]=b;c[n>>2]=e;c[u>>2]=f;c[v>>2]=g;c[j>>2]=c[B>>2];if((c[v>>2]|0)>>>0<((((c[n>>2]<<3)+4|0)>>>0)/5|0)>>>0){c[k>>2]=883;if((c[274]|0)==-1)c[274]=Wb(1,0,21635,21684,c[k>>2]|0)|0;if((Xb()|0)<=0){if(c[274]|0){c[o>>2]=21635;c[o+4>>2]=883;Zb(1,61295,o)}}else Yb(-1,0);c[t>>2]=0;B=c[t>>2]|0;l=A;return B|0}c[p>>2]=0;c[w>>2]=0;c[h>>2]=0;c[i>>2]=0;while(1){if(!((c[h>>2]|0)>>>0<(c[n>>2]|0)>>>0?1:(c[p>>2]|0)>>>0>0)){b=32;break}if((c[p>>2]|0)>>>0<5?(c[h>>2]|0)>>>0<(c[n>>2]|0)>>>0:0){o=c[i>>2]<<8;B=c[h>>2]|0;c[h>>2]=B+1;c[i>>2]=o|(d[(c[j>>2]|0)+B>>0]|0);c[p>>2]=(c[p>>2]|0)+8}if((c[p>>2]|0)>>>0<5){c[i>>2]=c[i>>2]<<5-(c[p>>2]|0);if((c[p>>2]|0)!=((c[n>>2]<<3>>>0)%5|0|0)){b=15;break}c[p>>2]=5}if((c[w>>2]|0)>>>0>=(c[v>>2]|0)>>>0){b=24;break}o=a[(c[277]|0)+((c[i>>2]|0)>>>((c[p>>2]|0)-5|0)&31)>>0]|0;B=c[w>>2]|0;c[w>>2]=B+1;a[(c[u>>2]|0)+B>>0]=o;c[p>>2]=(c[p>>2]|0)-5}if((b|0)==15){c[q>>2]=900;if((c[275]|0)==-1)c[275]=Wb(1,0,21635,21684,c[q>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[275]|0))Vb();c[y>>2]=21635;c[y+4>>2]=900;Zb(1,61295,y);Vb()}else if((b|0)==24){c[r>>2]=905;if((c[276]|0)==-1)c[276]=Wb(1,0,21635,21684,c[r>>2]|0)|0;if((Xb()|0)<=0){if(c[276]|0){c[z>>2]=21635;c[z+4>>2]=905;Zb(1,61295,z)}}else Yb(-1,0);c[t>>2]=0;B=c[t>>2]|0;l=A;return B|0}else if((b|0)==32){if(!(c[p>>2]|0)){if((c[w>>2]|0)>>>0<(c[v>>2]|0)>>>0)a[(c[u>>2]|0)+(c[w>>2]|0)>>0]=0;c[t>>2]=(c[u>>2]|0)+(c[w>>2]|0);B=c[t>>2]|0;l=A;return B|0}c[s>>2]=911;if((c[278]|0)==-1)c[278]=Wb(1,0,21635,21684,c[s>>2]|0)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[278]|0))Vb();c[x>>2]=21635;c[x+4>>2]=911;Zb(1,61295,x);Vb()}return 0}function nd(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=k+20|0;f=k+16|0;g=k+12|0;h=k+8|0;i=k+4|0;j=k;c[f>>2]=b;c[g>>2]=d;c[i>>2]=c[g>>2]<<3;if((((c[i>>2]|0)>>>0)%5|0)>>>0>0)c[i>>2]=(c[i>>2]|0)+(5-(((c[i>>2]|0)>>>0)%5|0));c[i>>2]=((c[i>>2]|0)>>>0)/5|0;c[h>>2]=Pb((c[i>>2]|0)+1|0,21635,939)|0;c[j>>2]=md(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0,c[i>>2]|0)|0;if(!(c[j>>2]|0)){Rb(c[h>>2]|0,21635,943);c[e>>2]=0;j=c[e>>2]|0;l=k;return j|0}else{a[c[j>>2]>>0]=0;c[e>>2]=c[h>>2];j=c[e>>2]|0;l=k;return j|0}return 0}function od(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;x=l;l=l+64|0;if((l|0)>=(m|0))$(64);w=x;v=x+60|0;r=x+56|0;i=x+52|0;j=x+48|0;k=x+44|0;s=x+40|0;n=x+36|0;o=x+32|0;t=x+28|0;p=x+24|0;g=x+20|0;q=x+16|0;h=x+12|0;u=x+8|0;c[r>>2]=b;c[i>>2]=d;c[j>>2]=e;c[k>>2]=f;c[h>>2]=c[k>>2]<<3;if(!(c[i>>2]|0))if(!(c[k>>2]|0)){c[v>>2]=1;w=c[v>>2]|0;l=x;return w|0}else{c[v>>2]=-1;w=c[v>>2]|0;l=x;return w|0}c[q>>2]=c[j>>2];c[n>>2]=c[k>>2];c[s>>2]=c[i>>2];if((((c[h>>2]|0)>>>0)%5|0)>>>0>0){c[t>>2]=((c[h>>2]|0)>>>0)%5|0;c[g>>2]=5-(c[t>>2]|0);k=(c[s>>2]|0)+-1|0;c[s>>2]=k;k=pd(a[(c[r>>2]|0)+k>>0]|0)|0;c[p>>2]=k;c[o>>2]=k>>c[g>>2]}else{c[t>>2]=5;c[g>>2]=0;k=(c[s>>2]|0)+-1|0;c[s>>2]=k;k=pd(a[(c[r>>2]|0)+k>>0]|0)|0;c[p>>2]=k;c[o>>2]=k}if(((((c[h>>2]|0)+(c[g>>2]|0)|0)>>>0)/5|0|0)!=(c[i>>2]|0)){c[v>>2]=-1;w=c[v>>2]|0;l=x;return w|0}if(-1==(c[p>>2]|0)){c[v>>2]=-1;w=c[v>>2]|0;l=x;return w|0}while(1){d=c[s>>2]|0;if((c[n>>2]|0)>>>0<=0){b=25;break}if(!d){b=14;break}k=(c[s>>2]|0)+-1|0;c[s>>2]=k;k=pd(a[(c[r>>2]|0)+k>>0]|0)|0;c[p>>2]=k;c[o>>2]=k<>2]|c[o>>2];if(-1==(c[p>>2]|0)){b=22;break}c[t>>2]=(c[t>>2]|0)+5;if((c[t>>2]|0)>>>0<8)continue;j=c[o>>2]&255;k=(c[n>>2]|0)+-1|0;c[n>>2]=k;a[(c[q>>2]|0)+k>>0]=j;c[o>>2]=(c[o>>2]|0)>>>8;c[t>>2]=(c[t>>2]|0)-8}if((b|0)==14){c[u>>2]=1003;if((c[279]|0)==-1)c[279]=Wb(1,0,21635,21747,c[u>>2]|0)|0;if((Xb()|0)<=0){if(c[279]|0){c[w>>2]=21635;c[w+4>>2]=1003;Zb(1,61295,w)}}else Yb(-1,0);c[v>>2]=-1;w=c[v>>2]|0;l=x;return w|0}else if((b|0)==22){c[v>>2]=-1;w=c[v>>2]|0;l=x;return w|0}else if((b|0)==25)if(0!=(d|0)|0!=(c[t>>2]|0)){c[v>>2]=-1;w=c[v>>2]|0;l=x;return w|0}else{c[v>>2]=1;w=c[v>>2]|0;l=x;return w|0}return 0}function pd(b){b=b|0;var e=0,f=0,g=0,h=0;h=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=h+4|0;f=h+8|0;g=h;a[f>>0]=b;switch(d[f>>0]|0|0){case 111:case 79:{a[f>>0]=48;break}case 76:case 108:case 73:case 105:{a[f>>0]=49;break}case 85:case 117:{a[f>>0]=86;break}default:{}}if((d[f>>0]|0|0)>=48?(d[f>>0]|0|0)<=57:0){c[e>>2]=(d[f>>0]|0)-48;g=c[e>>2]|0;l=h;return g|0}if((d[f>>0]|0|0)>=97?(d[f>>0]|0|0)<=122:0)a[f>>0]=Bp(d[f>>0]|0)|0;c[g>>2]=0;if((d[f>>0]|0|0)>=65?(d[f>>0]|0|0)<=90:0){if(73<(d[f>>0]|0|0))c[g>>2]=(c[g>>2]|0)+1;if(76<(d[f>>0]|0|0))c[g>>2]=(c[g>>2]|0)+1;if(79<(d[f>>0]|0|0))c[g>>2]=(c[g>>2]|0)+1;if(85<(d[f>>0]|0|0))c[g>>2]=(c[g>>2]|0)+1;c[e>>2]=(d[f>>0]|0)-65+10-(c[g>>2]|0);g=c[e>>2]|0;l=h;return g|0}c[e>>2]=-1;g=c[e>>2]|0;l=h;return g|0}function qd(){var a=0;a=70232;D=c[a+4>>2]|0;return c[a>>2]|0}function rd(){var a=0,b=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;c[b>>2]=c[16];c[b+4>>2]=c[17];D=c[b+4>>2]|0;l=a;return c[b>>2]|0}function sd(){var a=0,b=0,d=0,e=0,f=0;a=l;l=l+32|0;if((l|0)>=(m|0))$(32);b=a+8|0;d=a;e=a+16|0;gb(e|0,0)|0;f=c[e>>2]|0;f=kr(f|0,((f|0)<0)<<31>>31|0,1e3,0)|0;f=kr(f|0,D|0,1e3,0)|0;e=c[e+4>>2]|0;e=_q(f|0,D|0,e|0,((e|0)<0)<<31>>31|0)|0;f=70232;f=_q(e|0,D|0,c[f>>2]|0,c[f+4>>2]|0)|0;e=d;c[e>>2]=f;c[e+4>>2]=D;c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];D=c[b+4>>2]|0;l=a;return c[b>>2]|0}function td(){var a=0,b=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;c[b>>2]=c[17560];c[b+4>>2]=c[17561];D=c[b+4>>2]|0;l=a;return c[b>>2]|0}function ud(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);b=f+24|0;d=f+16|0;e=f+8|0;h=f;g=sd()|0;j=h;c[j>>2]=g;c[j+4>>2]=D;c[d>>2]=c[h>>2];c[d+4>>2]=c[h+4>>2];h=a;j=c[h+4>>2]|0;g=d;i=c[g+4>>2]|0;if(j>>>0>i>>>0|((j|0)==(i|0)?(c[h>>2]|0)>>>0>(c[g>>2]|0)>>>0:0)){j=td()|0;i=b;c[i>>2]=j;c[i+4>>2]=D;i=b;j=i;j=c[j>>2]|0;i=i+4|0;i=c[i>>2]|0;D=i;l=f;return j|0}else{i=d;j=a;j=Xq(c[i>>2]|0,c[i+4>>2]|0,c[j>>2]|0,c[j+4>>2]|0)|0;i=e;c[i>>2]=j;c[i+4>>2]=D;c[b>>2]=c[e>>2];c[b+4>>2]=c[e+4>>2];i=b;j=i;j=c[j>>2]|0;i=i+4|0;i=c[i>>2]|0;D=i;l=f;return j|0}return 0}function vd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d;f=e;c[f>>2]=a;c[f+4>>2]=b;b=Xp(c[e>>2]|0)|0;b=_q(0,b|0,Xp(c[e+4>>2]|0)|0,0)|0;l=d;return b|0}function wd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d;f=e;c[f>>2]=a;c[f+4>>2]=b;b=Yp(c[e>>2]|0)|0;b=_q(0,b|0,Yp(c[e+4>>2]|0)|0,0)|0;l=d;return b|0}function xd(a){a=a|0;return Pn(a)|0}function yd(a){a=a|0;return Ye(a)|0}function zd(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d;c[e>>2]=b;b=Ze(a,e)|0;l=d;return ((b|0)==0?0:b&65535|16777216)|0}function Ad(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;d=tf(a,b,c,d)|0;return ((d|0)==0?0:d&65535|16777216)|0}function Bd(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f;c[g>>2]=e;e=Ef(a,b,d,g)|0;l=f;return ((e|0)==0?0:e&65535|16777216)|0}function Cd(a){a=a|0;sf(a);return}function Dd(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Gf(a,b,c,d)|0}function Ed(a,b,c){a=a|0;b=b|0;c=c|0;return uf(a,b,c)|0}function Fd(a){a=a|0;return Cf(a)|0}function Gd(a,b,c){a=a|0;b=b|0;c=c|0;return Af(a,b,c)|0}function Hd(a){a=a|0;return Hl(a)|0}function Id(a){a=a|0;Jl(a);return}function Jd(a,b){a=a|0;b=b|0;return wk(a,b)|0}function Kd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;e=Sk(a,b,c,d,e)|0;return ((e|0)==0?0:e&65535|16777216)|0}function Ld(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;e=Tk(a,b,c,d,e)|0;return ((e|0)==0?0:e&65535|16777216)|0}function Md(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;Lk(a,b,c,d);return}function Nd(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;Mk(a,b,c,d);return}function Od(a,b,c){a=a|0;b=b|0;c=c|0;return Ek(a,b,c)|0}function Pd(a,b,c){a=a|0;b=b|0;c=c|0;return Fk(a,b,c)|0}function Qd(a){a=a|0;return Oj(a)|0}function Rd(a){a=a|0;Qj(a);return}function Sd(a,b,c){a=a|0;b=b|0;c=c|0;c=Hg(a,b,c)|0;return ((c|0)==0?0:c&65535|16777216)|0}function Td(a,b,c){a=a|0;b=b|0;c=c|0;return Zj(a,b,c)|0}function Ud(a,b,c){a=a|0;b=b|0;c=c|0;return _j(a,b,c)|0}function Vd(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Nj(a,b,c,sg(d,1)|0)|0}function Wd(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;ck(a,b,c,sg(d,1)|0);return}function Xd(a){a=a|0;return lk(a)|0}function Yd(a,b){a=a|0;b=b|0;return mk(a,b)|0}function Zd(a,b){a=a|0;b=b|0;pk(a,b);return}function _d(a,b){a=a|0;b=b|0;return wl(a,b)|0}function $d(a,b){a=a|0;b=b|0;return Ll(a,b)|0}function ae(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;if(!(We()|0)){c[a>>2]=0;e=16777392;return e|0}else{e=vg(a,b,d,e)|0;e=(e|0)==0?0:e&65535|16777216;return e|0}return 0}function be(a){a=a|0;xg(a);return}function ce(a,b,c){a=a|0;b=b|0;c=c|0;if(!(We()|0)){c=16777392;return c|0}c=Ag(a,b,c)|0;c=(c|0)==0?0:c&65535|536870912;return c|0}function de(a,b,c){a=a|0;b=b|0;c=c|0;if(!(We()|0)){c=16777392;return c|0}c=Bg(a,b,c)|0;c=(c|0)==0?0:c&65535|536870912;return c|0}function ee(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;if(We()|0){e=yg(a,b,c,d,e)|0;e=(e|0)==0?0:e&65535|16777216;return e|0}if(!b){e=16777392;return e|0}Yq(b|0,66,c|0)|0;e=16777392;return e|0}function fe(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;if(!(We()|0)){e=16777392;return e|0}e=zg(a,b,c,d,e)|0;e=(e|0)==0?0:e&65535|16777216;return e|0}function ge(a,b,d){a=a|0;b=b|0;d=d|0;if(!(We()|0)){c[a>>2]=0;d=16777392;return d|0}else{d=Sh(a,b,d)|0;d=(d|0)==0?0:d&65535|16777216;return d|0}return 0}function he(a,b,c){a=a|0;b=b|0;c=c|0;if(!(We()|0)){c=16777392;return c|0}c=Th(a,b,c)|0;c=(c|0)==0?0:c&65535|16777216;return c|0}function ie(a){a=a|0;if(!(We()|0)){a=16777392;return a|0}a=Uh(a)|0;a=(a|0)==0?0:a&65535|16777216;return a|0}function je(a,b){a=a|0;b=b|0;if(!(We()|0)){c[a>>2]=0;b=16777392;return b|0}else{b=Vh(a,b)|0;b=(b|0)==0?0:b&65535|16777216;return b|0}return 0}function ke(a,b,d){a=a|0;b=b|0;d=d|0;if(!(We()|0)){c[a>>2]=0;d=16777392;return d|0}else{d=eh(a,b,d)|0;d=(d|0)==0?0:d&65535|16777216;return d|0}return 0}function le(a){a=a|0;kh(a);return}function me(a){a=a|0;ih(a);return}function ne(a,b,c){a=a|0;b=b|0;c=c|0;if(!(We()|0))return;lh(a,b,c);return}function oe(a,b){a=a|0;b=b|0;return ph(a,b)|0}function pe(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;if(!(We()|0))kg(21777,1175,21790,0,21810);oh(a,b,c,d);return}function qe(a){a=a|0;if(!(We()|0)){kg(21777,1198,21842,0,21859);a=0;return a|0}else{a=rh(a)|0;return a|0}return 0}function re(a){a=a|0;return sh(a)|0}function se(a,b,c){a=a|0;b=b|0;c=c|0;if(!(We()|0)){c=16777392;return c|0}c=nh(a,b,c)|0;c=(c|0)==0?0:c&65535|16777216;return c|0}function te(a,b,c){a=a|0;b=b|0;c=c|0;if(!(We()|0)){kg(21777,1287,21889,1,21810);fg()}else{Dj(a,b,c);return}}function ue(a,b){a=a|0;b=b|0;if(!(We()|0)){kg(21777,1340,21904,1,21810);fg()}else{Hj(a,b);return}}function ve(a){a=a|0;tg(a);return}function we(a,b){a=a|0;b=b|0;of(a,b);return}function xe(a,b){a=a|0;b=b|0;Ae(a,b);return}function ye(a){a=a|0;cf(a);return}function ze(a){a=a|0;var b=0;b=c[17575]|0;if(!b){b=a;return b|0}b=tb[b&15](a)|0;return b|0}function Ae(a,b){a=a|0;b=b|0;c[17576]=b;c[17577]=a;return}function Be(a,b){a=a|0;b=b|0;if(!b)b=Pn(a)|0;if(c[17577]|0?(gg()|0)==0:0)ub[c[17577]&7](c[17576]|0,a,b);kg(21922,86,21929,1,b);Ce(21947);Ce(b);Ce(22378);bg();za()}function Ce(a){a=a|0;oq(2,a,Fo(a)|0)|0;return}function De(a){a=a|0;c[17580]=a;return}function Ee(a){a=a|0;return (c[17580]|0)>=(a|0)|0}function Fe(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=g;e=c[17578]|0;if(!e){switch(a|0){case 30:case 20:case 10:case 0:break;case 40:{iq(21962,7,1,c[3935]|0)|0;break}case 50:{iq(21970,13,1,c[3935]|0)|0;break}case 100:{iq(21984,5,1,c[3935]|0)|0;break}default:{e=c[3935]|0;c[f>>2]=a;Rp(e,21990,f)|0}}np(c[3935]|0,b,d)|0}else zb[e&1](c[17579]|0,a,b,d);switch(a|0){case 40:case 50:{kg(21922,140,22015,1,22026);bg();za();break}default:{l=g;return}}}function Ge(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e;c[f>>2]=d;Fe(a,b,f);l=e;return}function He(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);c[e>>2]=a;c[e+4>>2]=b;c[e+8>>2]=d;Ge(50,22056,e);za()}function Ie(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);c[f>>2]=a;c[f+4>>2]=b;c[f+8>>2]=d;c[f+12>>2]=e;Ge(50,22086,f);za()}function Je(a,b){a=a|0;b=b|0;var d=0,e=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=e;c[d>>2]=b;b=c[17578]|0;if(!b){np(c[3935]|0,a,d)|0;l=e;return}else{zb[b&1](c[17579]|0,10,a,d);l=e;return}}function Ke(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=f;c[e>>2]=d;a=c[17578]|0;if(!a){np(c[3935]|0,b,e)|0;l=f;return 0}else{zb[a&1](c[17579]|0,10,b,e);l=f;return 0}return 0}function Le(a,b){a=a|0;b=b|0;var d=0,e=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=e;c[d>>2]=b;b=c[17578]|0;if(!b){np(c[3935]|0,a,d)|0;l=e;return}else{zb[b&1](c[17579]|0,30,a,d);l=e;return}}function Me(a,b){a=a|0;b=b|0;var d=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);c[d>>2]=b;Fe(40,a,d);za()}function Ne(a,b){a=a|0;b=b|0;var d=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);c[d>>2]=b;Fe(50,a,d);za()}function Oe(a,b){a=a|0;b=b|0;var d=0,e=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=e;c[d>>2]=b;b=c[17578]|0;if(!b){b=c[3935]|0;iq(21984,5,1,b)|0;np(b,a,d)|0;l=e;return}else{zb[b&1](c[17579]|0,100,a,d);l=e;return}}function Pe(a,b){a=a|0;b=b|0;var d=0,e=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=e;if(!a){l=e;return}c[d>>2]=b;b=c[17578]|0;if(!b)np(c[3935]|0,a,d)|0;else zb[b&1](c[17579]|0,0,a,d);l=e;return}function Qe(a,b,c){a=a|0;b=b|0;c=c|0;Re(a,22120,b,c);return}function Re(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+80|0;if((l|0)>=(m|0))$(80);r=s+64|0;p=s+48|0;o=s+40|0;n=s+32|0;k=s+24|0;j=s+16|0;i=s+8|0;h=s;q=(b|0)!=0;if(q?(a[b>>0]|0)!=0:0){c[h>>2]=b;c[h+4>>2]=e;Oe(22122,h);if((f|0)!=0&((g|0)!=0&(a[e+1>>0]|0)==91)){Pe(22378,i);c[j>>2]=Fo(b)|0;c[j+4>>2]=71847;Oe(22128,j);i=1;e=22120}else i=1}else i=0;a:do if(g|0){h=g+-1|0;if(!i)while(1){c[k>>2]=d[f>>0];Pe(22134,k);if(!h)break a;else{f=f+1|0;h=h+-1|0}}else i=0;while(1){c[n>>2]=d[f>>0];Pe(22134,n);i=i+1|0;if((h|0)!=0&(i|0)==32){Pe(22139,o);k=Fo(b)|0;i=Fo(e)|0;c[p>>2]=k;c[p+4>>2]=71847;c[p+8>>2]=i;c[p+12>>2]=71847;Oe(22143,p);i=0}if(!h)break;else{f=f+1|0;h=h+-1|0}}}while(0);if(!q){l=s;return}Pe(22378,r);l=s;return}function Se(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;p=l;l=l+80|0;if((l|0)>=(m|0))$(80);n=p+32|0;o=p+24|0;g=p+16|0;j=p+8|0;i=p;h=p+44|0;k=p+40|0;e=p+36|0;f=p+48|0;if(!d){d=b|0?b:22120;if(a[d>>0]|0){c[i>>2]=d;c[i+4>>2]=22151;Oe(22122,i)}Pe(22378,j);l=p;return}if(c[d+12>>2]&4|0){o=wl(d,e)|0;c[g>>2]=c[e>>2];lp(f,30,22159,g)|0;Re(b|0?b:22120,f,o,((c[e>>2]|0)+7|0)>>>3);l=p;return}f=Ok(d,0,h,k)|0;if(!f){d=b|0?b:22120;if(a[d>>0]|0){c[o>>2]=d;c[o+4>>2]=22169;Oe(22122,o)}Pe(22378,n);l=p;return}e=c[h>>2]|0;d=c[k>>2]|0?22184:22186;if(!e)Re(b,d,71847,1);else Re(b,d,f,e);cf(f);l=p;return}function Te(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;i=l;d=b+63+((b|0)==0&1)&-64;e=d;b=l;l=l+((1*e|0)+15&-16)|0;if((l|0)>=(m|0))$((1*e|0)+15&-16|0);if((d|0)!=0&(b&7|0)!=0)do{a[b>>0]=0;b=b+1|0;d=d+-1|0}while((d|0)!=0&(b&7|0)!=0);if(d>>>0>=8){g=d+-8|0;h=g&-8;f=h+8|0;e=b;while(1){j=e;c[j>>2]=0;c[j+4>>2]=0;d=d+-8|0;if(d>>>0<=7)break;else e=e+8|0}b=b+f|0;d=g-h|0}if(!d){l=i;return}while(1){a[b>>0]=0;d=d+-1|0;if(!d)break;else b=b+1|0}l=i;return}function Ue(){return}function Ve(){Tn(33);Be(Qn(c[(zo()|0)>>2]|0)|0,22188)}function We(){if(!(c[17581]|0))Xe();return mg()|0}function Xe(){if(c[17581]|0)return;c[17581]=1;qj(0);dg(c[17582]|0);Mf();if((((((Cg()|0)==0?(vh()|0)==0:0)?(Wh()|0)==0:0)?(wh()|0)==0:0)?(Wf()|0)==0:0)?(jl()|0)==0:0)return;He(22203,123,22212)}function Ye(b){b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;if(!b){Xe();h=22224;return h|0}if((a[b>>0]|0)==1?(a[b+1>>0]|0)==1:0){h=Nl()|0;return h|0}Xe();c=a[b>>0]|0;if(c<<24>>24==48?((a[b+1>>0]|0)+-48|0)>>>0<10:0){h=0;return h|0}d=(c<<24>>24)+-48|0;if(d>>>0<10){e=0;do{e=(e*10|0)+d|0;b=b+1|0;c=a[b>>0]|0;d=(c<<24>>24)+-48|0}while(d>>>0<10);if((e|0)<0){h=0;return h|0}}else e=0;if(c<<24>>24!=46){h=0;return h|0}d=b+1|0;g=a[d>>0]|0;if(g<<24>>24==48?((a[b+2>>0]|0)+-48|0)>>>0<10:0){h=0;return h|0}c=(g<<24>>24)+-48|0;if(c>>>0<10){f=d;d=0;do{d=(d*10|0)+c|0;f=f+1|0;b=a[f>>0]|0;c=(b<<24>>24)+-48|0}while(c>>>0<10);if((d|0)<0){h=0;return h|0}else h=d}else{h=0;f=d;b=g}if(b<<24>>24!=46){h=0;return h|0}d=f+1|0;b=a[d>>0]|0;if(b<<24>>24==48?((a[f+2>>0]|0)+-48|0)>>>0<10:0){h=0;return h|0}c=(b<<24>>24)+-48|0;if(c>>>0<10){b=0;do{b=(b*10|0)+c|0;d=d+1|0;c=(a[d>>0]|0)+-48|0}while(c>>>0<10);if((b|0)<0){h=0;return h|0}}else b=0;if((e|0)<1){h=22224;return h|0}if((e|0)==1){if((h|0)<7){h=22224;return h|0}if((h|0)==7&(b|0)==0){h=22224;return h|0}}h=0;return h|0}function Ze(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+112|0;if((l|0)>=(m|0))$(112);r=s+88|0;p=s+80|0;o=s+72|0;n=s+64|0;h=s+48|0;g=s+24|0;f=s+16|0;e=s+8|0;d=s;j=s+96|0;do switch(a|0){case 31:{Nf();b=0;l=s;return b|0}case 44:{qj(0);wj();b=0;l=s;return b|0}case 51:{b=(zj()|0)!=0&1;l=s;return b|0}case 13:{uj();b=0;l=s;return b|0}case 14:{cg();b=0;l=s;return b|0}case 30:{Xe();Uf(0);b=0;l=s;return b|0}case 37:{Xe();c[17583]=1;b=0;l=s;return b|0}case 24:{Xe();q=(c[b>>2]|0)+(4-1)&~(4-1);r=c[q>>2]|0;c[b>>2]=q+4;Uf(r);b=(Tf()|0)>>>2&1;l=s;return b|0}case 25:{Xe();bg();b=0;l=s;return b|0}case 27:{qj(0);Sf(Tf()|0|1);b=0;l=s;return b|0}case 28:{qj(0);Sf(Tf()|0|2);b=0;l=s;return b|0}case 29:{qj(0);Sf((Tf()|0)&-3);b=0;l=s;return b|0}case 22:{Xe();vj();b=0;l=s;return b|0}case 45:{qj(0);q=(c[b>>2]|0)+(4-1)&~(4-1);r=c[q>>2]|0;c[b>>2]=q+4;Ej(r);b=0;l=s;return b|0}case 46:{qj(0);if(!(c[17581]|0))Xe();if(!(mg()|0)){b=0;l=s;return b|0}Fj();b=0;l=s;return b|0}case 19:{qj(0);q=(c[b>>2]|0)+(4-1)&~(4-1);r=c[q>>2]|0;c[b>>2]=q+4;De(r);b=0;l=s;return b|0}case 20:{q=(c[b>>2]|0)+(4-1)&~(4-1);r=c[q>>2]|0;c[b>>2]=q+4;c[17584]=c[17584]|r;b=0;l=s;return b|0}case 21:{q=(c[b>>2]|0)+(4-1)&~(4-1);r=c[q>>2]|0;c[b>>2]=q+4;c[17584]=c[17584]&~r;b=0;l=s;return b|0}case 36:{Xe();b=0;l=s;return b|0}case 40:{b=c[17581]|0;l=s;return b|0}case 39:{b=c[17585]|0;l=s;return b|0}case 38:{if(c[17585]|0){b=0;l=s;return b|0}Xe();rj(0);c[17585]=1;if(!(c[17581]|0))Xe();mg()|0;b=0;l=s;return b|0}case 47:{qj(0);Xe();b=0;l=s;return b|0}case 48:{qj(0);rj(1);if(!(c[17581]|0))Xe();if(!(mg()|0)){b=0;l=s;return b|0}Gj();b=0;l=s;return b|0}case 52:{b=16777276;l=s;return b|0}case 49:{qj(0);q=(c[b>>2]|0)+(4-1)&~(4-1);r=c[q>>2]|0;c[b>>2]=q+4;xj(r);b=0;l=s;return b|0}case 50:{qj(0);rj(1);q=(c[b>>2]|0)+(4-1)&~(4-1);r=c[q>>2]|0;c[b>>2]=q+4;yj((r|0)!=0&1)|0;b=0;l=s;return b|0}case 70:{sj();b=0;l=s;return b|0}case 53:{i=(c[b>>2]|0)+(4-1)&~(4-1);k=c[i>>2]|0;c[b>>2]=i+4;qj(0);i=k|0?28:27;c[d>>2]=22224;pb[i&63](k,22238,d)|0;c[e>>2]=22264;pb[i&63](k,22251,e)|0;c[f>>2]=22289;pb[i&63](k,22276,f)|0;c[g>>2]=22310;pb[i&63](k,22297,g)|0;pb[i&63](k,22324,s+32|0)|0;pb[i&63](k,22340,s+40|0)|0;c[h>>2]=il()|0;pb[i&63](k,22352,h)|0;e=Kf()|0;pb[i&63](k,22365,s+56|0)|0;a=Lf(0,j)|0;if(a|0){d=0;do{if(c[j>>2]&e|0){c[n>>2]=a;pb[i&63](k,22374,n)|0}d=d+1|0;a=Lf(d,j)|0}while((a|0)!=0)}pb[i&63](k,22378,o)|0;b=(gg()|0)!=0;a=(hg()|0)!=0;c[p>>2]=b?121:110;c[p+4>>2]=a?121:110;pb[i&63](k,22380,p)|0;a=tj(0)|0;switch(a|0){case 1:{q=22423;break}case 2:{q=22418;break}case 3:{q=22411;break}default:He(22203,321,22398)}c[r>>2]=q;c[r+4>>2]=a;pb[i&63](k,22432,r)|0;b=0;l=s;return b|0}case 54:{qj(0);b=(pg()|0)!=0&1;l=s;return b|0}case 55:{if(!(gg()|0)){b=0;l=s;return b|0}b=lg()|0;b=(c[17583]|b|0)==0&1;l=s;return b|0}case 56:{qj(0);if(!(c[17581]|0)){c[17582]=1;b=0;l=s;return b|0}if(!(qg()|0)){b=mg()|0;b=(b|0)!=0;b=b&1;l=s;return b|0}ng(1)|0;b=mg()|0;b=(b|0)!=0;b=b&1;l=s;return b|0}case 57:{Xe();b=ng(1)|0;l=s;return b|0}case 58:{r=(c[b>>2]|0)+(4-1)&~(4-1);a=c[r>>2]|0;c[b>>2]=r+4;r=(c[b>>2]|0)+(4-1)&~(4-1);d=c[r>>2]|0;c[b>>2]=r+4;r=(c[b>>2]|0)+(4-1)&~(4-1);e=c[r>>2]|0;c[b>>2]=r+4;r=(c[b>>2]|0)+(4-1)&~(4-1);f=c[r>>2]|0;c[b>>2]=r+4;r=(c[b>>2]|0)+(4-1)&~(4-1);g=c[r>>2]|0;c[b>>2]=r+4;r=(c[b>>2]|0)+(4-1)&~(4-1);h=c[r>>2]|0;c[b>>2]=r+4;r=(c[b>>2]|0)+(4-1)&~(4-1);i=c[r>>2]|0;c[b>>2]=r+4;r=(c[b>>2]|0)+(4-1)&~(4-1);j=c[r>>2]|0;c[b>>2]=r+4;if(!(c[17581]|0))Xe();if(!(mg()|0)){b=176;l=s;return b|0}b=Jj(a,d,e,f,g,h,i,j)|0;l=s;return b|0}case 59:{r=(c[b>>2]|0)+(4-1)&~(4-1);a=c[r>>2]|0;c[b>>2]=r+4;r=(c[b>>2]|0)+(4-1)&~(4-1);d=c[r>>2]|0;c[b>>2]=r+4;r=(c[b>>2]|0)+(4-1)&~(4-1);e=c[r>>2]|0;c[b>>2]=r+4;if(!(c[17581]|0))Xe();if(!(mg()|0)){b=176;l=s;return b|0}b=Kj(a,d,e)|0;l=s;return b|0}case 60:{q=(c[b>>2]|0)+(4-1)&~(4-1);r=c[q>>2]|0;c[b>>2]=q+4;Lj(r);b=0;l=s;return b|0}case 61:{q=(c[b>>2]|0)+(4-1)&~(4-1);r=c[q>>2]|0;c[b>>2]=q+4;switch(r|0){case 30111:{b=Un(1120)|0;l=s;return b|0}case 30112:{b=Vn(1120)|0;l=s;return b|0}case 30113:{b=Wn(1120)|0;l=s;return b|0}case 30114:{b=Xn(1120)|0;l=s;return b|0}default:{b=61;l=s;return b|0}}}case 63:{q=(c[b>>2]|0)+(4-1)&~(4-1);r=c[q>>2]|0;c[b>>2]=q+4;b=Jf(r)|0;l=s;return b|0}case 64:{if(c[17581]|0){b=1;l=s;return b|0}qj(0);ig();b=0;l=s;return b|0}case 65:{r=(c[b>>2]|0)+(4-1)&~(4-1);a=c[r>>2]|0;c[b>>2]=r+4;if((a|0)<=0){b=0;l=s;return b|0}qj(a);b=0;l=s;return b|0}case 66:{r=(c[b>>2]|0)+(4-1)&~(4-1);a=c[r>>2]|0;c[b>>2]=r+4;if(!a){b=0;l=s;return b|0}c[a>>2]=tj(c[17581]^1)|0;b=0;l=s;return b|0}case 67:{qj(0);Sf(Tf()|0|8);b=0;l=s;return b|0}case 68:{qj(0);Sf(Tf()|0|16);b=0;l=s;return b|0}case 72:case 71:{b=69;l=s;return b|0}case 62:case 23:{b=0;l=s;return b|0}default:{qj(0);b=61;l=s;return b|0}}while(0);return 0}function _e(a){a=a|0;var b=0;b=c[17586]|0;if(!b)a=Of(a)|0;else a=tb[b&15](a)|0;if(a|0){b=a;return b|0}b=zo()|0;a=c[b>>2]|0;if(!a){Tn(12);a=c[b>>2]|0}Qn(a)|0;b=0;return b|0}function $e(a){a=a|0;var b=0,d=0;do if(c[17583]|0){if(hg()|0){c[17583]=0;d=5;break}if(c[17583]|0){b=c[17586]|0;if(!b){b=Of(a)|0;break}else{b=tb[b&15](a)|0;break}}else d=5}else d=5;while(0);do if((d|0)==5){b=c[17587]|0;if(!b){b=Pf(a)|0;break}else{b=tb[b&15](a)|0;break}}while(0);if(b|0){d=b;return d|0}a=zo()|0;b=c[a>>2]|0;if(!b){Tn(12);b=c[a>>2]|0}Qn(b)|0;d=0;return d|0}function af(a){a=a|0;var b=0;do if(c[17583]|0){if(hg()|0){c[17583]=0;break}if(c[17583]|0){b=0;return b|0}}while(0);b=c[17588]|0;if(!b){b=ag(a)|0;return b|0}else{b=tb[b&15](a)|0;return b|0}return 0}function bf(a,b){a=a|0;b=b|0;var d=0;if(!a){d=c[17586]|0;if(!d)d=Of(b)|0;else d=tb[d&15](b)|0;if(d|0){a=d;return a|0}b=zo()|0;d=c[b>>2]|0;if(!d){Tn(12);d=c[b>>2]|0}Qn(d)|0;a=0;return a|0}if(!b){d=c[(zo()|0)>>2]|0;b=c[17590]|0;if(!b)Rf(a);else rb[b&7](a);if(!d){a=0;return a|0}Tn(d);a=0;return a|0}d=c[17589]|0;if(!d)d=Qf(a,b)|0;else d=yb[d&7](a,b)|0;if(d|0){a=d;return a|0}if(c[(zo()|0)>>2]|0){a=0;return a|0}Tn(12);a=0;return a|0}function cf(a){a=a|0;var b=0,d=0;if(!a)return;b=c[(zo()|0)>>2]|0;d=c[17590]|0;if(!d)Rf(a);else rb[d&7](a);if(!b)return;Tn(b);return}function df(a,b){a=a|0;b=b|0;var d=0;d=S(b,a)|0;if(b|0?((d>>>0)/(b>>>0)|0|0)!=(a|0):0){Tn(12);d=0;return d|0}a=c[17586]|0;if(!a)a=Of(d)|0;else a=tb[a&15](d)|0;if(a|0){Yq(a|0,0,d|0)|0;d=a;return d|0}b=zo()|0;a=c[b>>2]|0;if(!a){Tn(12);a=c[b>>2]|0}Qn(a)|0;d=0;return d|0}function ef(a,b){a=a|0;b=b|0;var c=0;c=S(b,a)|0;if(b|0?((c>>>0)/(b>>>0)|0|0)!=(a|0):0){Tn(12);c=0;return c|0}a=$e(c)|0;if(!a){c=0;return c|0}Yq(a|0,0,c|0)|0;c=a;return c|0}function ff(a){a=a|0;var b=0,d=0,e=0,f=0;e=Fo(a)|0;do if(c[17583]|0){if(hg()|0){c[17583]=0;f=6;break}if(c[17583]|0){d=e+1|0;f=10}else f=6}else f=6;while(0);if((f|0)==6){b=c[17588]|0;if(!b)d=ag(a)|0;else d=tb[b&15](a)|0;b=e+1|0;if(d){b=$e(b)|0;if(!b){a=0;return a|0}}else{d=b;f=10}}if((f|0)==10){b=c[17586]|0;if(!b)b=Of(d)|0;else b=tb[b&15](d)|0;if(!b){d=zo()|0;b=c[d>>2]|0;if(!b){Tn(12);b=c[d>>2]|0}Qn(b)|0;a=0;return a|0}}Mp(b,a)|0;a=b;return a|0}function gf(a){a=a|0;var b=0,d=0,e=0;while(1){b=c[17586]|0;if(!b)b=Of(a)|0;else b=tb[b&15](a)|0;if(b|0){a=11;break}d=zo()|0;b=c[d>>2]|0;if(!b){Tn(12);b=c[d>>2]|0}Qn(b)|0;e=(gg()|0)==0;b=c[17591]|0;if(!(e&(b|0)!=0)){a=10;break}if(!(pb[b&63](c[17592]|0,a,0)|0)){a=10;break}}if((a|0)==10)Be(Qn(c[d>>2]|0)|0,0);else if((a|0)==11)return b|0;return 0}function hf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;while(1){d=bf(a,b)|0;if(d|0){g=13;break}f=(gg()|0)==0;e=c[17591]|0;if(!(f&(e|0)!=0)){g=12;break}f=c[17592]|0;do if(c[17583]|0)if(!(hg()|0))if(!(c[17583]|0)){g=8;break}else{d=0;break}else{c[17583]=0;g=8;break}else g=8;while(0);do if((g|0)==8){g=0;d=c[17588]|0;if(!d){d=ag(a)|0;break}else{d=tb[d&15](a)|0;break}}while(0);if(!(pb[e&63](f,b,d|0?3:2)|0)){g=12;break}}if((g|0)==12)Be(Qn(c[(zo()|0)>>2]|0)|0,0);else if((g|0)==13)return d|0;return 0}function jf(a){a=a|0;var b=0,d=0;while(1){d=$e(a)|0;if(d|0){b=6;break}d=(gg()|0)==0;b=c[17591]|0;if(!(d&(b|0)!=0)){b=5;break}if(!(pb[b&63](c[17592]|0,a,1)|0)){b=5;break}}if((b|0)==5){d=Qn(c[(zo()|0)>>2]|0)|0;Be(d,ze(22449)|0)}else if((b|0)==6)return d|0;return 0}function kf(a,b){a=a|0;b=b|0;var d=0;d=S(b,a)|0;if(b|0?((d>>>0)/(b>>>0)|0|0)!=(a|0):0){Tn(12);Be(Qn(c[(zo()|0)>>2]|0)|0,0)}b=gf(d)|0;Yq(b|0,0,d|0)|0;return b|0}function lf(a,b){a=a|0;b=b|0;var d=0;d=S(b,a)|0;if(b|0?((d>>>0)/(b>>>0)|0|0)!=(a|0):0){Tn(12);Be(Qn(c[(zo()|0)>>2]|0)|0,0)}b=jf(d)|0;Yq(b|0,0,d|0)|0;return b|0}function mf(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;do{b=ff(a)|0;if(b|0){f=15;break}e=Fo(a)|0;do if(c[17583]|0)if(!(hg()|0))if(!(c[17583]|0)){f=7;break}else{b=0;break}else{c[17583]=0;f=7;break}else f=7;while(0);do if((f|0)==7){f=0;b=c[17588]|0;if(!b){b=ag(a)|0;break}else{b=tb[b&15](a)|0;break}}while(0);d=(b|0)!=0;g=(gg()|0)==0;b=c[17591]|0;if(!(g&(b|0)!=0))break}while((pb[b&63](c[17592]|0,e,d&1)|0)!=0);if((f|0)==15)return b|0;b=Qn(c[(zo()|0)>>2]|0)|0;if(!d){g=0;Be(b,g)}g=ze(22449)|0;Be(b,g);return 0}function nf(a){a=a|0;var b=0;b=(gg()|0)==0;return (b?c[17584]&a:0)|0}function of(a,b){a=a|0;b=b|0;xh(a,b);oj(a,b);return}function pf(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;p=l;l=l+16|0;if((l|0)>=(m|0))$(16);o=(e|0)==0?p+4|0:e;n=(f|0)==0?p:f;c[n>>2]=0;c[o>>2]=0;a:do if(!b)e=0;else{if((a[b>>0]|0)!=40){c[n>>2]=204;e=0;break}k=d+-1|0;e=0;d=0;j=0;i=0;f=b;b=40;b:while(1){g=b&255;c:do if(j)if(b<<24>>24==58){b=d+j|0;if(k>>>0>>0){f=9;break b}d=b;h=0;b=i;f=f+j|0;break}else{if((b+-48&255)>=10){f=13;break b}h=(j*10|0)+-48+g|0;b=i;break}else switch(b<<24>>24){case 40:{if(i|0){f=16;break b}e=e+1|0;h=0;b=0;break c}case 41:{if(!e){f=19;break b}if(i|0){f=21;break b}e=e+-1|0;if(!e){f=23;break b}else{h=0;b=0;break c}}case 91:if(!i){h=0;b=f;break c}else{f=25;break b}case 93:if(!i){f=27;break b}else{h=0;b=0;break c}default:{if((b+-48&255)>=10){f=32;break b}if(b<<24>>24==48){f=30;break b}h=g+-48|0;b=i;break c}}while(0);g=f+1|0;d=d+1|0;if(k>>>0>>0){f=5;break}j=h;i=b;f=g;b=a[g>>0]|0}switch(f|0){case 5:{c[o>>2]=d;c[n>>2]=202;e=0;break a}case 9:{c[o>>2]=d;c[n>>2]=202;e=0;break a}case 13:{c[o>>2]=d;c[n>>2]=201;e=0;break a}case 16:{c[o>>2]=d;c[n>>2]=209;e=0;break a}case 19:{c[o>>2]=d;c[n>>2]=203;e=0;break a}case 21:{c[o>>2]=d;c[n>>2]=209;e=0;break a}case 23:{e=d+1|0;break a}case 25:{c[o>>2]=d;c[n>>2]=208;e=0;break a}case 27:{c[o>>2]=d;c[n>>2]=209;e=0;break a}case 30:{c[o>>2]=d;c[n>>2]=207;e=0;break a}case 32:switch(b<<24>>24){case 92:case 38:{c[o>>2]=d;c[n>>2]=210;e=0;break a}default:{c[o>>2]=d;c[n>>2]=205;e=0;break a}}}}while(0);l=p;return e|0}function qf(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0;i=l;l=l+16|0;if((l|0)>=(m|0))$(16);j=i;c[j>>2]=h;h=rf(a,b,d,e,f,g,j)|0;l=i;return h|0}function rf(b,e,f,g,h,i,j){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0;T=l;l=l+64|0;if((l|0)>=(m|0))$(64);P=T+8|0;O=T;M=T+16|0;N=T+12|0;if(!b){S=45;l=T;return S|0}c[b>>2]=0;if(!f){S=45;l=T;return S|0}R=(e|0)==0?T+52|0:e;k=g+2|0;p=(g|0)==0;if(!p?(af(f)|0)!=0:0)e=$e(k)|0;else e=_e(k)|0;s=e;a:do if(!e){n=Qn(c[(zo()|0)>>2]|0)|0;c[R>>2]=0;o=s;S=283}else{b:do if(p){q=f;g=0;o=s;e=s;S=274}else{K=(h|0)!=0;L=(i|0)==0;q=f;J=g;A=0;y=0;x=0;r=0;B=0;C=0;D=0;E=0;F=0;G=0;g=0;p=s;e=s;c:while(1){w=(r|0)!=0;if(!(w|(x|0)==0))if(!(No(22485,a[q>>0]|0,71)|0)){u=q;v=u-x|0;h=p;t=e-p|0;do if((t+3+v|0)>>>0>=k>>>0){s=k+6+(v<<1)|0;if(s>>>0<=k>>>0){e=67;S=18;break c}h=bf(h,s)|0;if(!h){h=Qn(c[(zo()|0)>>2]|0)|0;if(!h)break;else{e=h;S=18;break c}}else{p=h;k=s;e=h+t|0;break}}while(0);H=e;I=H+1|0;a[H>>0]=1;S=v&65535;a[I>>0]=S;a[I+1>>0]=S>>8;H=H+3|0;cr(H|0,x|0,v|0)|0;I=0;H=H+v|0;S=20}else{z=y;h=q;w=J;r=0;t=G}else{I=x;H=e;S=20}d:do if((S|0)==20){S=0;if(y|0){e=a[q>>0]|0;if(F|0)switch(e<<24>>24|0){case 92:case 39:case 34:case 114:case 102:case 110:case 118:case 116:case 98:{F=0;z=y;x=I;h=q;w=J;t=G;e=H;break d}case 55:case 54:case 53:case 52:case 51:case 50:case 49:case 48:{if(J>>>0<=2){S=26;break c}if((a[q+1>>0]&-8)<<24>>24!=48){S=26;break c}e=q+2|0;if((a[e>>0]&-8)<<24>>24!=48){S=26;break c}F=0;z=y;x=I;h=e;w=J+-2|0;t=G;e=H;break d}case 120:{if(J>>>0<=2){S=33;break c}e=a[q+1>>0]|0;if((e+-48&255)>=10)switch(e<<24>>24){case 65:case 66:case 67:case 68:case 69:case 70:case 97:case 98:case 99:case 100:case 101:case 102:break;default:{S=33;break c}}h=q+2|0;e=a[h>>0]|0;if((e+-48&255)>=10)switch(e<<24>>24){case 65:case 66:case 67:case 68:case 69:case 70:case 97:case 98:case 99:case 100:case 101:case 102:break;default:{S=33;break c}}F=0;z=y;x=I;w=J+-2|0;t=G;e=H;break d}case 13:{h=q+1|0;w=(a[h>>0]|0)==10;F=0;z=y;x=I;h=w?h:q;w=(w<<31>>31)+J|0;t=G;e=H;break d}case 10:{h=q+1|0;w=(a[h>>0]|0)==13;F=0;z=y;x=I;h=w?h:q;w=(w<<31>>31)+J|0;t=G;e=H;break d}default:{S=37;break c}}if(e<<24>>24==92){F=1;z=y;x=I;h=q;w=J;t=G;e=H;break}if(e<<24>>24!=34){F=0;z=y;x=I;h=q;w=J;t=G;e=H;break}s=y+1|0;t=q;v=t-s|0;e=p;u=H-p|0;do if((v+3+u|0)>>>0>=k>>>0){h=(v<<1)+6+k|0;if(h>>>0<=k>>>0){e=67;S=81;break c}e=bf(e,h)|0;if(!e){e=Qn(c[(zo()|0)>>2]|0)|0;if(!e){e=H;break}else{S=81;break c}}else{p=e;k=h;e=e+u|0;break}}else e=H;while(0);x=e+1|0;a[e>>0]=1;a[x>>0]=0;a[x+1>>0]=0;e=e+3|0;y=e;e:do if(v){w=v;h=0;while(1){t=a[s>>0]|0;u=t&255;f:do if(!h){if(t<<24>>24==92){h=1;u=w;break}a[e>>0]=t;h=0;u=w;e=e+1|0}else do switch(t<<24>>24){case 98:{a[e>>0]=8;h=0;u=w;e=e+1|0;break f}case 116:{a[e>>0]=9;h=0;u=w;e=e+1|0;break f}case 118:{a[e>>0]=11;h=0;u=w;e=e+1|0;break f}case 110:{a[e>>0]=10;h=0;u=w;e=e+1|0;break f}case 102:{a[e>>0]=12;h=0;u=w;e=e+1|0;break f}case 114:{a[e>>0]=13;h=0;u=w;e=e+1|0;break f}case 34:{a[e>>0]=34;h=0;u=w;e=e+1|0;break f}case 39:{a[e>>0]=39;h=0;u=w;e=e+1|0;break f}case 92:{a[e>>0]=92;h=0;u=w;e=e+1|0;break f}case 13:{t=s+1|0;if(w>>>0<=1)break e;H=(a[t>>0]|0)==10;h=0;u=(H<<31>>31)+w|0;s=H?t:s;break f}case 10:{t=s+1|0;if(w>>>0<=1)break e;H=(a[t>>0]|0)==13;h=0;u=(H<<31>>31)+w|0;s=H?t:s;break f}case 120:{if(w>>>0<=2){h=0;u=w;break f}t=a[s+1>>0]|0;if((t+-48&255)>=10)switch(t<<24>>24){case 65:case 66:case 67:case 68:case 69:case 70:case 97:case 98:case 99:case 100:case 101:case 102:break;default:{h=0;u=w;break f}}v=s+2|0;u=a[v>>0]|0;if((u+-48&255)>=10)switch(u<<24>>24){case 65:case 66:case 67:case 68:case 69:case 70:case 97:case 98:case 99:case 100:case 101:case 102:break;default:{h=0;u=w;break f}}h=t&255;if((t&255)<58)s=h+-48|0;else s=h+10+((t&255)<71?-65:-97)|0;h=u&255;if((u&255)<58)h=h+-48|0;else h=h+10+((u&255)<71?-65:-97)|0;a[e>>0]=h+(s<<4);h=0;u=w+-2|0;e=e+1|0;s=v;break f}default:{if(!(w>>>0>2&(t&-8)<<24>>24==48)){h=0;u=w;break f}h=a[s+1>>0]|0;if((h&-8)<<24>>24!=48){h=0;u=w;break f}v=s+2|0;t=a[v>>0]|0;if((t&-8)<<24>>24!=48){h=0;u=w;break f}a[e>>0]=(u<<6)+80+((h&255)<<3)+(t&255);h=0;u=w+-2|0;e=e+1|0;s=v;break f}}while(0);while(0);w=u+-1|0;if(!w)break;else s=s+1|0}}while(0);F=e-y&65535;a[x>>0]=F;a[x+1>>0]=F>>8;F=0;z=0;x=I;h=q;w=J;t=G;break}if(w){e=a[q>>0]|0;h=e<<24>>24;if(kp(h)|0){E=E+1|0;z=0;x=I;h=q;w=J;t=G;e=H;break}if(e<<24>>24!=35)switch(h|0){case 10:case 13:case 12:case 11:case 9:case 32:{z=0;x=I;h=q;w=J;t=G;e=H;break d}default:{S=112;break c}}if(E&1|0){S=87;break c}t=(E|0)/2|0;e=p;s=H-p|0;do if((t+3+s|0)>>>0>=k>>>0){h=(t<<1)+6+k|0;if(h>>>0<=k>>>0){e=67;S=93;break c}e=bf(e,h)|0;if(!e){e=Qn(c[(zo()|0)>>2]|0)|0;if(!e){e=H;break}else{S=93;break c}}else{p=e;k=h;e=e+s|0;break}}else e=H;while(0);h=e+1|0;a[e>>0]=1;H=t&65535;a[h>>0]=H;a[h+1>>0]=H>>8;e=e+3|0;h=r+1|0;if(h>>>0>=q>>>0){z=0;x=I;h=q;w=J;r=0;t=G;break}while(1){s=r;r=h;g:while(1){h=a[r>>0]|0;switch(h<<24>>24|0){case 10:case 13:case 12:case 11:case 9:case 32:break;default:break g}h=r+1|0;if(h>>>0>>0){s=r;r=h}else{z=0;x=I;h=q;w=J;r=0;t=G;break d}}r=h&255;h=r+-48|0;do if(h>>>0>=10)if((r+-65|0)>>>0<6){h=r+-55|0;break}else{h=(r+-97|0)>>>0<6?r+-87|0:0;break}while(0);r=s+2|0;h:do if(r>>>0>>0){i:while(1){s=a[r>>0]|0;switch(s<<24>>24|0){case 10:case 13:case 12:case 11:case 9:case 32:break;default:break i}r=r+1|0;if(r>>>0>=q>>>0)break h}t=h<<4;s=s&255;h=s+-48|0;do if(h>>>0>=10)if((s+-65|0)>>>0<6){h=s+-55|0;break}else{h=(s+-97|0)>>>0<6?s+-87|0:0;break}while(0);h=h+t|0}while(0);H=e;e=H+1|0;a[H>>0]=h;h=r+1|0;if(h>>>0>=q>>>0){z=0;x=I;h=q;w=J;r=0;t=G;break d}}}if(B|0){B=(a[q>>0]|0)==124?0:B;z=0;x=I;h=q;w=J;r=0;t=G;e=H;break}if(A|0){e=a[q>>0]|0;if((e+-48&255)<10){B=0;z=0;x=I;h=q;w=J;r=0;t=G;e=H;break}switch(e<<24>>24){case 34:{A=0;B=0;F=0;z=q;x=I;h=q;w=J;r=0;t=G;e=H;break d}case 58:{s=Fq(A)|0;if(s>>>0>(J+-1|0)>>>0){S=119;break c}e=p;r=H-p|0;do if((r+3+s|0)>>>0>=k>>>0){h=k+6+(s<<1)|0;if(h>>>0<=k>>>0){e=67;S=125;break c}e=bf(e,h)|0;if(!e){e=Qn(c[(zo()|0)>>2]|0)|0;if(!e){e=H;break}else{S=125;break c}}else{p=e;k=h;e=e+r|0;break}}else e=H;while(0);A=e+1|0;a[e>>0]=1;B=s&65535;a[A>>0]=B;a[A+1>>0]=B>>8;e=e+3|0;cr(e|0,q+1|0,s|0)|0;A=0;B=0;z=0;x=I;h=q+s|0;w=J-s|0;r=0;t=G;e=e+s|0;break d}case 35:{A=0;B=0;E=0;z=0;x=I;h=q;w=J;r=q;t=G;e=H;break d}case 124:{A=0;B=q;z=0;x=I;h=q;w=J;r=0;t=G;e=H;break d}default:{S=129;break c}}}h=a[q>>0]|0;if(!D)switch(h<<24>>24){case 34:{A=0;B=0;D=0;F=0;z=q;x=I;h=q;w=J;r=0;t=G;e=H;break d}case 40:{if(C|0){S=239;break c}e=p;r=H-p|0;do if((r+3|0)>>>0>=k>>>0){h=k+6|0;if(k>>>0>=4294967290){e=67;S=245;break c}e=bf(e,h)|0;if(!e){e=Qn(c[(zo()|0)>>2]|0)|0;if(!e){e=H;break}else{S=245;break c}}else{p=e;k=h;e=e+r|0;break}}else e=H;while(0);a[e>>0]=3;A=0;B=0;C=0;D=0;g=g+1|0;z=0;x=I;h=q;w=J;r=0;t=G;e=e+1|0;break d}case 41:{if(C|0){S=248;break c}e=p;r=H-p|0;do if((r+3|0)>>>0>=k>>>0){h=k+6|0;if(k>>>0>=4294967290){e=67;S=254;break c}e=bf(e,h)|0;if(!e){e=Qn(c[(zo()|0)>>2]|0)|0;if(!e){e=H;break}else{S=254;break c}}else{p=e;k=h;e=e+r|0;break}}else e=H;while(0);a[e>>0]=4;A=0;B=0;C=0;D=0;g=g+-1|0;z=0;x=I;h=q;w=J;r=0;t=G;e=e+1|0;break d}case 35:{A=0;B=0;D=0;E=0;z=0;x=I;h=q;w=J;r=q;t=G;e=H;break d}case 124:{A=0;B=q;D=0;z=0;x=I;h=q;w=J;r=0;t=G;e=H;break d}case 91:if(!C){A=0;B=0;C=q;D=0;z=0;x=I;h=q;w=J;r=0;t=G;e=H;break d}else{S=259;break c}case 93:if(!C){S=261;break c}else{A=0;B=0;C=0;D=0;z=0;x=I;h=q;w=J;r=0;t=G;e=H;break d}default:{if((h+-48&255)<10)if(h<<24>>24==48){S=264;break c}else{A=q;B=0;D=0;z=0;x=I;h=q;w=J;r=0;t=G;e=H;break d}e=h<<24>>24;if(No(22485,e,71)|0){A=0;B=0;D=0;z=0;x=q;h=q;w=J;r=0;t=G;e=H;break d}switch(e|0){case 10:case 13:case 12:case 11:case 9:case 32:{A=0;B=0;D=0;z=0;x=I;h=q;w=J;r=0;t=G;e=H;break d}default:{}}if(h<<24>>24==123){S=268;break c}if(No(22584,e,3)|0){S=270;break c}if(K&h<<24>>24==37){A=0;B=0;D=q;z=0;x=I;h=q;w=J;r=0;t=G;e=H;break d}else{S=272;break c}}}switch(h<<24>>24){case 77:case 109:{c[M>>2]=0;s=(a[q>>0]|0)==109?1:5;if(L){t=(c[j>>2]|0)+(4-1)&~(4-1);u=c[t>>2]|0;c[j>>2]=t+4;t=G}else{u=c[c[i+(G<<2)>>2]>>2]|0;t=G+1|0}if(!(Ll(u,2)|0)){if(Tk(s,0,0,M,u)|0){S=152;break c}e=c[M>>2]|0;h=p;r=H-p|0;do if((r+3+e|0)>>>0>=k>>>0){e=k+6+(e<<1)|0;if(e>>>0<=k>>>0){e=67;S=158;break c}h=bf(h,e)|0;if(!h){e=Qn(c[(zo()|0)>>2]|0)|0;if(!e){e=H;break}else{S=158;break c}}else{p=h;k=e;e=h+r|0;break}}else e=H;while(0);h=p;do if(!(af(h)|0)){if(!(Ll(u,1)|0))break;r=$e(k)|0;if(!r){S=163;break c}e=e-p|0;cr(r|0,h|0,e|0)|0;cf(p);p=r;e=r+e|0}while(0);H=e+1|0;a[e>>0]=1;G=c[M>>2]&65535;a[H>>0]=G;a[H+1>>0]=G>>8;e=e+3|0;if(Tk(s,e,c[M>>2]|0,M,u)|0){S=165;break c}e=e+(c[M>>2]|0)|0}else{s=wl(u,N)|0;e=((c[N>>2]|0)+7|0)>>>3;c[M>>2]=e;if((s|0)!=0&(e|0)!=0){h=p;r=H-p|0;do if((r+3+e|0)>>>0>=k>>>0){e=k+6+(e<<1)|0;if(e>>>0<=k>>>0){e=67;S=142;break c}h=bf(h,e)|0;if(!h){e=Qn(c[(zo()|0)>>2]|0)|0;if(!e){e=H;break}else{S=142;break c}}else{p=h;k=e;e=h+r|0;break}}else e=H;while(0);h=p;do if(!(af(h)|0)){if(!(Ll(u,1)|0))break;r=$e(k)|0;if(!r){S=147;break c}e=e-p|0;cr(r|0,h|0,e|0)|0;cf(p);p=r;e=r+e|0}while(0);H=e+1|0;a[e>>0]=1;G=c[M>>2]&65535;a[H>>0]=G;a[H+1>>0]=G>>8;e=e+3|0;cr(e|0,s|0,c[M>>2]|0)|0;e=e+(c[M>>2]|0)|0}else e=H}A=0;B=0;D=0;z=0;x=I;h=q;w=J;r=0;break d}case 115:{if(L){t=(c[j>>2]|0)+(4-1)&~(4-1);s=c[t>>2]|0;c[j>>2]=t+4;t=G}else{s=c[c[i+(G<<2)>>2]>>2]|0;t=G+1|0}u=Fo(s)|0;e=p;r=H-p|0;do if((r+3+u|0)>>>0>=k>>>0){h=k+6+(u<<1)|0;if(h>>>0<=k>>>0){e=67;S=178;break c}e=bf(e,h)|0;if(!e){e=Qn(c[(zo()|0)>>2]|0)|0;if(!e){e=H;break}else{S=178;break c}}else{p=e;k=h;e=e+r|0;break}}else e=H;while(0);A=e+1|0;a[e>>0]=1;B=u&65535;a[A>>0]=B;a[A+1>>0]=B>>8;e=e+3|0;cr(e|0,s|0,u|0)|0;A=0;B=0;D=0;z=0;x=I;h=q;w=J;r=0;e=e+u|0;break d}case 98:{if(L){u=(c[j>>2]|0)+(4-1)&~(4-1);v=c[u>>2]|0;c[j>>2]=u+4;u=(c[j>>2]|0)+(4-1)&~(4-1);t=c[u>>2]|0;c[j>>2]=u+4;u=G}else{t=c[c[i+(G+1<<2)>>2]>>2]|0;v=c[c[i+(G<<2)>>2]>>2]|0;u=G+2|0}e=p;r=H-p|0;do if((r+3+v|0)>>>0>=k>>>0){h=k+6+(v<<1)|0;if(h>>>0<=k>>>0){n=67;S=187;break c}s=bf(e,h)|0;if(!s){h=Qn(c[(zo()|0)>>2]|0)|0;if(!h){e=H;break}else{n=h;S=187;break c}}else{p=s;k=h;e=s+r|0;break}}else e=H;while(0);do if(v){h=p;if(af(h)|0)break;if(!(af(t)|0))break;r=$e(k)|0;if(!r){S=193;break c}e=e-p|0;cr(r|0,h|0,e|0)|0;cf(p);p=r;e=r+e|0}while(0);A=e+1|0;a[e>>0]=1;B=v&65535;a[A>>0]=B;a[A+1>>0]=B>>8;e=e+3|0;cr(e|0,t|0,v|0)|0;A=0;B=0;D=0;z=0;x=I;h=q;w=J;r=0;t=u;e=e+v|0;break d}case 100:{if(L){t=(c[j>>2]|0)+(4-1)&~(4-1);e=c[t>>2]|0;c[j>>2]=t+4;t=G}else{e=c[c[i+(G<<2)>>2]>>2]|0;t=G+1|0}c[O>>2]=e;Pp(M,22578,O)|0;s=Fo(M)|0;e=p;r=H-p|0;do if((r+3+s|0)>>>0>=k>>>0){h=k+6+(s<<1)|0;if(h>>>0<=k>>>0){e=67;S=204;break c}e=bf(e,h)|0;if(!e){e=Qn(c[(zo()|0)>>2]|0)|0;if(!e){e=H;break}else{S=204;break c}}else{p=e;k=h;e=e+r|0;break}}else e=H;while(0);A=e+1|0;a[e>>0]=1;B=s&65535;a[A>>0]=B;a[A+1>>0]=B>>8;e=e+3|0;cr(e|0,M|0,s|0)|0;A=0;B=0;D=0;z=0;x=I;h=q;w=J;r=0;e=e+s|0;break d}case 117:{if(L){t=(c[j>>2]|0)+(4-1)&~(4-1);e=c[t>>2]|0;c[j>>2]=t+4;t=G}else{e=c[c[i+(G<<2)>>2]>>2]|0;t=G+1|0}c[P>>2]=e;Pp(M,22581,P)|0;s=Fo(M)|0;e=p;r=H-p|0;do if((r+3+s|0)>>>0>=k>>>0){h=k+6+(s<<1)|0;if(h>>>0<=k>>>0){e=67;S=214;break c}e=bf(e,h)|0;if(!e){e=Qn(c[(zo()|0)>>2]|0)|0;if(!e){e=H;break}else{S=214;break c}}else{p=e;k=h;e=e+r|0;break}}else e=H;while(0);A=e+1|0;a[e>>0]=1;B=s&65535;a[A>>0]=B;a[A+1>>0]=B>>8;e=e+3|0;cr(e|0,M|0,s|0)|0;A=0;B=0;D=0;z=0;x=I;h=q;w=J;r=0;e=e+s|0;break d}case 83:{if(L){y=(c[j>>2]|0)+(4-1)&~(4-1);w=c[y>>2]|0;c[j>>2]=y+4;y=G}else{w=c[c[i+(G<<2)>>2]>>2]|0;y=G+1|0}if(!w){A=0;B=0;D=0;z=0;x=I;h=q;w=J;r=0;t=y;e=H;break d}e=a[w>>0]|0;if(!(e<<24>>24)){A=0;B=0;D=0;z=0;x=I;h=q;w=J;r=0;t=y;e=H;break d}v=w;u=0;r=w;h=0;while(1){s=r;r=e;j:while(1){t=s+1|0;switch(r<<24>>24){case 3:{S=225;break j}case 4:{S=227;break j}case 1:{e=t+(((d[t>>0]|d[t+1>>0]<<8)&65535)+2)|0;break}default:e=t}r=a[e>>0]|0;if(!(r<<24>>24)){A=0;B=0;D=0;z=0;x=I;h=q;w=J;r=0;t=y;e=H;break d}else s=e}if((S|0)==225){S=0;e=u+1|0;h=(u|0)==0?s-v|0:h}else if((S|0)==227){S=0;e=u+-1|0;if(!e)break}s=a[t>>0]|0;if(!(s<<24>>24)){A=0;B=0;D=0;z=0;x=I;h=q;w=J;r=0;t=y;e=H;break d}else{u=e;r=t;e=s}}u=t-v|0;if(!u){A=0;B=0;D=0;z=0;x=I;h=q;w=J;r=0;t=y;e=H;break d}e=p;s=H-p|0;do if((s+3+u|0)>>>0>=k>>>0){r=k+6+(u<<1)|0;if(r>>>0<=k>>>0){e=67;S=235;break c}e=bf(e,r)|0;if(!e){e=Qn(c[(zo()|0)>>2]|0)|0;if(!e){e=H;break}else{S=235;break c}}else{p=e;k=r;e=e+s|0;break}}else e=H;while(0);cr(e|0,w+h|0,u|0)|0;A=0;B=0;D=0;z=0;x=I;h=q;w=J;r=0;t=y;e=e+u|0;break d}default:{S=236;break c}}}while(0);q=h+1|0;J=w+-1|0;if(!J){o=p;S=274;break b}else{y=z;G=t}}switch(S|0){case 18:{c[R>>2]=u-f;o=p;break b}case 26:{c[R>>2]=q-f;e=206;o=p;break b}case 33:{c[R>>2]=q-f;e=206;o=p;break b}case 37:{c[R>>2]=q-f;e=206;o=p;break b}case 81:{c[R>>2]=t-f;o=p;break b}case 87:{c[R>>2]=q-f;e=212;o=p;break b}case 93:{c[R>>2]=q-f;o=p;break b}case 112:{c[R>>2]=q-f;e=211;o=p;break b}case 119:{c[R>>2]=q-f;e=202;o=p;break b}case 125:{c[R>>2]=q-f;o=p;break b}case 129:{c[R>>2]=q-f;e=201;o=p;break b}case 142:{c[R>>2]=q-f;o=p;S=150;break}case 147:{e=Qn(c[(zo()|0)>>2]|0)|0;o=p;S=150;break}case 152:{He(22556,1433,22563);break}case 158:{c[R>>2]=q-f;n=e;o=p;Q=k;break}case 163:{n=Qn(c[(zo()|0)>>2]|0)|0;o=p;Q=k;break}case 165:{He(22556,1460,22563);break}case 178:{c[R>>2]=q-f;o=p;break b}case 187:{c[R>>2]=q-f;g=p;break a}case 193:{n=Qn(c[(zo()|0)>>2]|0)|0;o=p;S=283;break a}case 204:{c[R>>2]=q-f;o=p;break b}case 214:{c[R>>2]=q-f;o=p;break b}case 235:{c[R>>2]=q-f;o=p;break b}case 236:{c[R>>2]=q-f;e=201;o=p;break b}case 239:{c[R>>2]=q-f;e=209;o=p;break b}case 245:{c[R>>2]=q-f;o=p;break b}case 248:{c[R>>2]=q-f;e=209;o=p;break b}case 254:{c[R>>2]=q-f;o=p;break b}case 259:{c[R>>2]=q-f;e=208;o=p;break b}case 261:{c[R>>2]=q-f;e=209;o=p;break b}case 264:{c[R>>2]=q-f;e=207;o=p;break b}case 268:{c[R>>2]=q-f;e=210;o=p;break b}case 270:{c[R>>2]=q-f;e=210;o=p;break b}case 272:{c[R>>2]=q-f;e=205;o=p;break b}}if((S|0)==150){n=e;Q=k}k=Q;S=283;break a}while(0);k:do if((S|0)==274){n=o;h=e-o|0;l:do if((h+3|0)>>>0>=k>>>0){p=k+6|0;do if(k>>>0<4294967290){n=bf(n,p)|0;if(!n){n=Qn(c[(zo()|0)>>2]|0)|0;if(!n)break l;else{e=n;break}}else{o=n;k=p;e=n+h|0;break l}}else e=67;while(0);c[R>>2]=q-f;break k}while(0);a[e>>0]=0;if(!g){k=o;e=o;S=295;break a}else e=203}while(0);n=e;g=o;e=o}while(0);if((S|0)==283){e=o;if(!n){k=o;S=295}else g=o}if((S|0)==295){m:do if(k){switch(a[e>>0]|0){case 0:{sf(e);e=0;break m}case 3:break;default:break m}if((a[e+1>>0]|0)==4){sf(e);e=0}}else e=0;while(0);c[b>>2]=e;S=0;l=T;return S|0}if(!e){S=n;l=T;return S|0}if(af(e)|0){if((k|0)!=0&(e&7|0)!=0)do{a[e>>0]=0;e=e+1|0;k=k+-1|0}while((k|0)!=0&(e&7|0)!=0);if(k>>>0>=8){p=k+-8|0;h=p&-8;q=h+8|0;o=e;while(1){S=o;c[S>>2]=0;c[S+4>>2]=0;k=k+-8|0;if(k>>>0<=7)break;else o=o+8|0}k=p-h|0;e=e+q|0}if(k|0)while(1){a[e>>0]=0;k=k+-1|0;if(!k)break;else e=e+1|0}}cf(g);S=n;l=T;return S|0}function sf(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;if(!b)return;if(af(b)|0){f=a[b>>0]|0;if(!(f<<24>>24))e=b;else{e=b;do{g=e+1|0;if(f<<24>>24==1)e=e+3+((d[g>>0]|d[g+1>>0]<<8)&65535)|0;else e=g;f=a[e>>0]|0}while(f<<24>>24!=0)}j=b;e=e-j|0;if((e|0)!=0&(j&7|0)!=0){f=b;do{a[f>>0]=0;f=f+1|0;e=e+-1|0}while((e|0)!=0&(f&7|0)!=0)}else f=b;if(e>>>0>=8){i=e+-8|0;j=i&-8;h=j+8|0;g=f;while(1){k=g;c[k>>2]=0;c[k+4>>2]=0;e=e+-8|0;if(e>>>0<=7)break;else g=g+8|0}f=f+h|0;e=i-j|0}if(e|0)while(1){a[f>>0]=0;e=e+-1|0;if(!e)break;else f=f+1|0}}cf(b);return}function tf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=i;g=i+8|0;h=i+4|0;do if((a|0)!=0?(c[a>>2]=0,(b|0)!=0&e>>>0<2):0){if(!(e|d)){d=pf(b,0,0,g)|0;if(!d){d=c[g>>2]|0;break}}else if((d|0)==0&(e|0)!=0)d=Fo(b)|0;d=qf(h,0,b,d,0,0,f)|0;c[g>>2]=d;if(!d){c[a>>2]=c[h>>2];d=0}}else d=45;while(0);l=i;return d|0}function uf(b,c,e){b=b|0;c=c|0;e=e|0;var f=0,g=0,h=0;if(!b){h=0;return h|0}if(!e)e=Fo(c)|0;g=b;a:while(1){f=a[g>>0]|0;switch(f<<24>>24){case 0:{e=0;h=26;break a}case 3:break;default:{b=g+1|0;if(f<<24>>24!=1){g=b;continue a}g=g+3+((d[b>>0]|d[b+1>>0]<<8)&65535)|0;continue a}}b=g+1|0;if((a[b>>0]|0)!=1){g=b;continue}b=g+2|0;f=g+4|0;b=(d[b>>0]|d[b+1>>0]<<8)&65535;if((b|0)==(e|0)?(Tp(f,c,e)|0)==0:0)break;g=f+b|0}if((h|0)==26)return e|0;b=1;f=f+e|0;b:do{e=f;c:while(1){switch(a[e>>0]|0){case 0:{h=15;break b}case 3:{h=13;break c}case 4:{h=14;break c}case 1:{e=e+1|0;e=e+(((d[e>>0]|d[e+1>>0]<<8)&65535)+2)+-1|0;break}default:{}}e=e+1|0}if((h|0)==13){h=0;b=b+1|0}else if((h|0)==14){h=0;b=b+-1|0}f=e+1|0}while((b|0)!=0);if((h|0)==15)He(22556,481,22587);e=f-g&65535;b=_e(e+1|0)|0;if(!b){h=0;return h|0}cr(b|0,g|0,e|0)|0;a[b+e>>0]=0;switch(a[b>>0]|0){case 0:{sf(b);h=0;return h|0}case 3:{if((a[b+1>>0]|0)!=4){h=b;return h|0}sf(b);h=0;return h|0}default:{h=b;return h|0}}return 0}function vf(b){b=b|0;var c=0,e=0,f=0,g=0;if(!b){g=0;return g|0}e=0;c=0;a:while(1){f=e;b:while(1){c:while(1){e=a[b>>0]|0;if(!(e<<24>>24))break a;b=b+1|0;switch(e<<24>>24){case 1:{g=7;break b}case 3:{g=8;break b}case 4:break c;default:{}}}f=f+-1|0}if((g|0)==7){e=f;b=b+(((d[b>>0]|d[b+1>>0]<<8)&65535)+2)|0;f=(f|0)==1&1}else if((g|0)==8){e=f+1|0;f=(f|0)==1&1}c=f+c|0}return c|0}function wf(b,c){b=b|0;c=c|0;var e=0,f=0,g=0;if(!b){g=0;return g|0}if((a[b>>0]|0)!=3){g=0;return g|0}a:do if((c|0)>0){e=0;b:while(1){c:while(1){d:while(1){f=b+1|0;switch(a[f>>0]|0){case 0:{b=0;break b}case 1:{g=9;break c}case 4:{g=11;break c}case 3:break d;default:b=f}}e=e+1|0;b=f}if((g|0)==9){b=b+2|0;b=b+(((d[b>>0]|d[b+1>>0]<<8)&65535)+2)+-1|0}else if((g|0)==11){e=e+-1|0;b=f}c=(((e|0)==0)<<31>>31)+c|0;if((c|0)<=0)break a}return b|0}while(0);f=b+1|0;e:do switch(a[f>>0]|0){case 1:{b=b+2|0;b=(d[b>>0]|d[b+1>>0]<<8)&65535;e=_e(b+6|0)|0;if(!e){g=0;return g|0}else{g=e+1|0;a[e>>0]=3;c=b+3|0;cr(g|0,f|0,c|0)|0;c=g+c|0;a[c>>0]=4;a[c+1>>0]=0;c=e;b=e;break e}}case 3:{c=1;b=f;f:while(1){g:while(1){e=b+1|0;switch(a[e>>0]|0){case 0:{g=18;break f}case 3:{g=16;break g}case 4:{g=17;break g}case 1:break;default:{b=e;continue g}}g=b+2|0;b=g+(((d[g>>0]|d[g+1>>0]<<8)&65535)+2)+-1|0}if((g|0)==16){g=0;c=c+1|0}else if((g|0)==17){g=0;c=c+-1|0}if(!c)break;else b=e}if((g|0)==18)He(22556,673,22609);b=b+2-f&65535;e=_e(b+1|0)|0;if(!e){g=0;return g|0}cr(e|0,f|0,b|0)|0;a[e+b>>0]=0;switch(a[e>>0]|0){case 3:{c=e;b=e;break e}case 0:break;default:{g=e;return g|0}}sf(e);g=0;return g|0}default:{g=0;return g|0}}while(0);if((a[c+1>>0]|0)!=4){g=b;return g|0}sf(b);g=0;return g|0}function xf(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;c[f>>2]=0;if(!b){f=0;return f|0}g=a[b>>0]|0;if(g<<24>>24==3){b=b+1|0;h=a[b>>0]|0;g=h<<24>>24==1;a:do if((e|0)>0){i=0;b:while(1){c:do if(g){g=i;j=6}else{g=i;d:while(1){switch(h<<24>>24){case 0:{b=0;break b}case 4:break d;case 3:{g=g+1|0;break}default:{}}b=b+1|0;h=a[b>>0]|0;if(h<<24>>24==1){j=6;break c}}i=g+-1|0}while(0);if((j|0)==6){j=0;b=b+1|0;i=g;b=b+(((d[b>>0]|d[b+1>>0]<<8)&65535)+2)+-1|0}e=(((i|0)==0)<<31>>31)+e|0;b=b+1|0;h=a[b>>0]|0;g=h<<24>>24==1;if((e|0)<=0)break a}return b|0}while(0);if(!g){f=0;return f|0}}else if(!((e|0)==0&g<<24>>24==1)){f=0;return f|0}j=b+1|0;c[f>>2]=(d[j>>0]|d[j+1>>0]<<8)&65535;f=b+3|0;return f|0}function yf(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;c[f>>2]=0;if(!b){f=0;return f|0}g=a[b>>0]|0;if(g<<24>>24==3){g=b+1|0;h=a[g>>0]|0;b=h<<24>>24==1;a:do if((e|0)>0){i=0;b:while(1){c:do if(b){b=i;j=6}else{b=i;d:while(1){switch(h<<24>>24){case 0:{b=0;break b}case 4:break d;case 3:{b=b+1|0;break}default:{}}g=g+1|0;h=a[g>>0]|0;if(h<<24>>24==1){j=6;break c}}i=b+-1|0}while(0);if((j|0)==6){j=0;g=g+1|0;i=b;g=g+(((d[g>>0]|d[g+1>>0]<<8)&65535)+2)+-1|0}e=(((i|0)==0)<<31>>31)+e|0;g=g+1|0;h=a[g>>0]|0;b=h<<24>>24==1;if((e|0)<=0)break a}return b|0}while(0);if(b)b=g;else{f=0;return f|0}}else if(!((e|0)==0&g<<24>>24==1)){f=0;return f|0}j=b+1|0;j=d[j>>0]|d[j+1>>0]<<8;g=j&65535;if(!(j<<16>>16)){f=0;return f|0}h=_e(g)|0;if(!h){f=0;return f|0}cr(h|0,b+3|0,g|0)|0;c[f>>2]=g;f=h;return f|0}function zf(b,c){b=b|0;c=c|0;var e=0,f=0,g=0,h=0;if(!b){h=0;return h|0}e=a[b>>0]|0;if(e<<24>>24==3){e=b+1|0;f=a[e>>0]|0;b=f<<24>>24==1;a:do if((c|0)>0){g=0;b:while(1){c:do if(b){b=g;h=6}else{b=g;d:while(1){switch(f<<24>>24){case 0:{b=0;break b}case 4:break d;case 3:{b=b+1|0;break}default:{}}e=e+1|0;f=a[e>>0]|0;if(f<<24>>24==1){h=6;break c}}g=b+-1|0}while(0);if((h|0)==6){h=0;e=e+1|0;g=b;e=e+(((d[e>>0]|d[e+1>>0]<<8)&65535)+2)+-1|0}c=(((g|0)==0)<<31>>31)+c|0;e=e+1|0;f=a[e>>0]|0;b=f<<24>>24==1;if((c|0)<=0)break a}return b|0}while(0);if(b)b=e;else{h=0;return h|0}}else if(!((c|0)==0&e<<24>>24==1)){h=0;return h|0}h=b+1|0;h=d[h>>0]|d[h+1>>0]<<8;e=h&65535;if(!(h<<16>>16)){h=0;return h|0}f=_e(e+1|0)|0;if(!f){h=0;return h|0}cr(f|0,b+3|0,e|0)|0;a[f+e>>0]=0;h=f;return h|0}function Af(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0;n=l;l=l+16|0;if((l|0)>=(m|0))$(16);k=n;switch(f|0){case 8:{if(!b){k=0;l=n;return k|0}f=a[b>>0]|0;if(f<<24>>24==3){g=b+1|0;h=a[g>>0]|0;f=h<<24>>24==1;a:do if((e|0)>0){i=e;e=0;b:while(1){c:do if(f){f=e;j=7}else{f=e;d:while(1){switch(h<<24>>24){case 0:{b=0;break b}case 4:break d;case 3:{f=f+1|0;break}default:{}}g=g+1|0;h=a[g>>0]|0;if(h<<24>>24==1){j=7;break c}}e=f+-1|0}while(0);if((j|0)==7){j=0;g=g+1|0;e=f;g=g+(((d[g>>0]|d[g+1>>0]<<8)&65535)+2)+-1|0}i=(((e|0)==0)<<31>>31)+i|0;g=g+1|0;h=a[g>>0]|0;f=h<<24>>24==1;if((i|0)<=0)break a}l=n;return b|0}while(0);if(f)f=g;else{k=0;l=n;return k|0}}else if((e|0)==0&f<<24>>24==1)f=b;else{k=0;l=n;return k|0}j=f+1|0;j=d[j>>0]|d[j+1>>0]<<8;g=j&65535;if(!(j<<16>>16)){k=0;l=n;return k|0}h=_e(g)|0;if(!h){k=0;l=n;return k|0}cr(h|0,f+3|0,g|0)|0;if(!(af(b)|0))b=Hl(0)|0;else b=Il(0)|0;c[k>>2]=b;if(!b){cf(h);k=0;l=n;return k|0}else{ul(b,h,g<<3)|0;k=b;l=n;return k|0}}case 0:{i=1;break}default:i=f}if(!b){k=0;l=n;return k|0}f=a[b>>0]|0;if(f<<24>>24==3){b=b+1|0;g=a[b>>0]|0;f=g<<24>>24==1;e:do if((e|0)>0){h=0;f:while(1){g:do if(f){f=h;j=28}else{f=h;h:while(1){switch(g<<24>>24){case 0:{b=0;break f}case 4:break h;case 3:{f=f+1|0;break}default:{}}b=b+1|0;g=a[b>>0]|0;if(g<<24>>24==1){j=28;break g}}h=f+-1|0}while(0);if((j|0)==28){j=0;b=b+1|0;h=f;b=b+(((d[b>>0]|d[b+1>>0]<<8)&65535)+2)+-1|0}e=(((h|0)==0)<<31>>31)+e|0;b=b+1|0;g=a[b>>0]|0;f=g<<24>>24==1;if((e|0)<=0)break e}l=n;return b|0}while(0);if(!f){k=0;l=n;return k|0}}else if(!((e|0)==0&f<<24>>24==1)){k=0;l=n;return k|0}j=b+1|0;j=(Sk(k,i,b+3|0,(d[j>>0]|d[j+1>>0]<<8)&65535,0)|0)==0;k=j?c[k>>2]|0:0;l=n;return k|0}function Bf(b){b=b|0;var c=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;if(!b){l=0;return l|0}if((a[b>>0]|0)==3){c=1;i=0;f=-1}else{l=0;return l|0}a:while(1){b:while(1){c:while(1){e=b+1|0;switch(a[e>>0]|0){case 0:{k=0;l=19;break a}case 3:{l=8;break b}case 4:{l=10;break b}case 1:break c;default:b=e}}b=b+2|0;b=b+(((d[b>>0]|d[b+1>>0]<<8)&65535)+2)+-1|0;c=f+c|0;if((c|0)<=0){j=b;break a}}if((l|0)==8){l=0;g=c;h=i+1|0}else if((l|0)==10){l=0;h=i+-1|0;g=(((h|0)==0)<<31>>31)+c|0}if((g|0)>0){c=g;i=h;b=e;f=((h|0)==0)<<31>>31}else{j=e;break}}if((l|0)==19)return k|0;e=j+1|0;b=0;c=e;d:do{switch(a[c>>0]|0){case 0:{k=0;l=19;break d}case 1:{c=c+1|0;c=c+(((d[c>>0]|d[c+1>>0]<<8)&65535)+2)+-1|0;break}case 3:{b=b+1|0;break}case 4:{b=b+-1|0;break}default:{}}c=c+1|0}while((b|0)!=0);if((l|0)==19)return k|0;b=c-e&65535;c=_e(b+3|0)|0;if(!c){l=0;return l|0}l=c+1|0;a[c>>0]=3;cr(l|0,e|0,b|0)|0;k=l+b|0;a[k>>0]=4;a[k+1>>0]=0;if((a[l>>0]|0)!=4){l=c;return l|0}sf(c);l=0;return l|0}function Cf(a){a=a|0;var b=0;b=Bf(a)|0;a=wf(b,0)|0;sf(b);return a|0}function Df(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f;c[g>>2]=e;e=rf(a,b,d,Fo(d)|0,1,0,g)|0;l=f;return e|0}function Ef(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return rf(a,b,c,Fo(c)|0,1,0,d)|0}function Ff(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=qf(a,b,c,d,0,0,e)|0;l=e;return d|0}function Gf(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;C=l;l=l+48|0;if((l|0)>=(m|0))$(48);A=C+16|0;z=C+8|0;y=C;v=C+20|0;w=(e|0)==3;x=(f|0)!=0;B=(f|0)==0;u=(e|0)!=1;t=(e|0)==1;s=u^1;r=0;e=0;h=b|0?b:22624;a:while(1){b:while(1){switch(a[h>>0]|0){case 0:{b=79;break a}case 3:{b=4;break b}case 4:{b=13;break b}case 1:break;default:{b=78;break a}}b=h+1|0;b=d[b>>0]|d[b+1>>0]<<8;p=h+3|0;q=b&65535;if(w){o=b<<16>>16==0;c:do if(o){k=2;b=1}else{b=a[p>>0]|0;d:do if(b<<24>>24>=1){n=p;j=q;i=1;h=b;while(1){if((h&255)<32|(h+-127&255)<34?(No(22627,h&255,10)|0)==0:0)break d;if(i){if(!((h+-48&255)<10|((h&-33)+-65&255)<26)){k=(No(22637,h&255,9)|0)==0;i=k?0:i}}else i=0;k=n+1|0;h=j+-1|0;if(!h)break;n=k;j=h;h=a[k>>0]|0}if((b+-48&255)>9&(i|0)!=0){k=q;b=2;break c}else{j=2;h=q;k=p}while(1){e:do switch(b<<24>>24){case 92:case 39:case 34:case 13:case 12:case 10:case 11:case 9:case 8:{b=j+2|0;break}default:if((b&255)<32|(b+-127&255)<34){b=j+4|0;break e}else{b=j+1|0;break e}}while(0);h=h+-1|0;i=k+1|0;if(!h){k=b;b=1;break c}j=b;k=i;b=a[i>>0]|0}}while(0);k=(q<<1)+2|0;b=0}while(0);e=k+e|0;if(x){if(e>>>0>=g>>>0){e=0;b=87;break a}switch(b&3){case 1:{if(f|0){b=f+1|0;a[f>>0]=34;f:do if(!o){i=q;j=p;while(1){h=a[j>>0]|0;g:do switch(h<<24>>24){case 8:{a[b>>0]=92;a[b+1>>0]=98;b=b+2|0;break}case 9:{a[b>>0]=92;a[b+1>>0]=116;b=b+2|0;break}case 11:{a[b>>0]=92;a[b+1>>0]=118;b=b+2|0;break}case 10:{a[b>>0]=92;a[b+1>>0]=110;b=b+2|0;break}case 12:{a[b>>0]=92;a[b+1>>0]=102;b=b+2|0;break}case 13:{a[b>>0]=92;a[b+1>>0]=114;b=b+2|0;break}case 34:{a[b>>0]=92;a[b+1>>0]=34;b=b+2|0;break}case 39:{a[b>>0]=92;a[b+1>>0]=39;b=b+2|0;break}case 92:{a[b>>0]=92;a[b+1>>0]=92;b=b+2|0;break}default:if((h&255)<32|(h+-127&255)<34){c[y>>2]=h&255;Pp(b,22478,y)|0;b=b+4|0;break g}else{a[b>>0]=h;b=b+1|0;break g}}while(0);i=i+-1|0;if(!i)break f;else j=j+1|0}}while(0);a[b>>0]=34}break}case 2:{if(f|0)cr(f|0,p|0,q|0)|0;break}default:if(f|0){b=f+1|0;a[f>>0]=35;if(!o){i=q<<1;h=0;while(1){c[z>>2]=d[p+h>>0];Pp(b,22646,z)|0;h=h+1|0;if((h|0)==(q|0))break;else b=b+2|0}b=f+(i|1)|0}a[b>>0]=35}}f=f+k|0}if((a[p+q>>0]|0)!=4){e=e+1|0;if(x){if(e>>>0>=g>>>0){e=0;b=87;break a}a[f>>0]=32;f=f+1|0}}}else{c[A>>2]=q;Pp(v,22651,A)|0;e=q+e+(Fo(v)|0)|0;if(!B){if(e>>>0>=g>>>0){e=0;b=87;break a}f=Np(f,v)|0;cr(f|0,p|0,q|0)|0;f=f+q|0}}h=p+q|0}if((b|0)==4){h=h+1|0;if(u)e=r+e+((r|0)!=0&1)|0;e=e+1|0;if(!B){if(e>>>0>=g>>>0){e=0;b=87;break}if(!((r|0)==0|s)){b=f+1|0;a[f>>0]=10;if((r|0)>0){Yq(b|0,32,r|0)|0;f=b+r|0}else f=b}a[f>>0]=40;f=f+1|0}r=r+1|0;continue}else if((b|0)==13){h=h+1|0;b=e+1|0;if(x){if(b>>>0>=g>>>0){e=0;b=87;break}a[f>>0]=41;f=f+1|0}i=r+-1|0;if(t){r=i;e=b;continue}switch(a[h>>0]|0){case 0:case 3:{r=i;e=b;continue a}default:{}}e=e+2+i|0;if(!x){r=i;continue}if(e>>>0>=g>>>0){e=0;b=87;break}a[f>>0]=10;b=f+1|0;if((r|0)<=1){r=i;f=b;continue}Yq(b|0,32,i|0)|0;f=f+r|0;r=i;continue}}if((b|0)==78)He(22556,2008,22655);else if((b|0)==79){do if(t){if(B)b=86}else{e=e+1|0;if(!B)if(e>>>0>>0){a[f>>0]=10;f=f+1|0;break}else{g=0;l=C;return g|0}else b=86}while(0);if((b|0)==86){g=e+1|0;l=C;return g|0}if(e>>>0>=g>>>0){g=0;l=C;return g|0}a[f>>0]=0;g=e;l=C;return g|0}else if((b|0)==87){l=C;return e|0}return 0}function Hf(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;y=l;l=l+112|0;if((l|0)>=(m|0))$(112);u=y+80|0;w=y;x=y+84|0;h=x;i=h+20|0;do{a[h>>0]=0;h=h+1|0}while((h|0)<(i|0));j=a[f>>0]|0;do if(j<<24>>24){h=f;i=0;a:while(1){b:do switch(j<<24>>24){case 63:case 47:case 45:case 43:case 38:break;default:{switch(j<<24>>24|0){case 10:case 13:case 12:case 11:case 9:case 32:break b;default:{}}if(j<<24>>24==39){v=h+1|0;h=Ko(v,39)|0;if((h|0)==0|(h|0)==(v|0)){h=29;v=94;break a}}t=(c[g>>2]|0)+(4-1)&~(4-1);v=c[t>>2]|0;c[g>>2]=t+4;c[w+(i<<2)>>2]=v;if(!v){h=128;v=94;break a}i=i+1|0}}while(0);h=h+1|0;j=a[h>>0]|0;if(!(i>>>0<20&j<<24>>24!=0)){v=9;break}}if((v|0)==9){if(!(j<<24>>24))break;else h=183;l=y;return h|0}else if((v|0)==94){l=y;return h|0}}else i=0;while(0);s=(c[g>>2]|0)+(4-1)&~(4-1);t=c[s>>2]|0;c[g>>2]=s+4;if(t|0){x=45;l=y;return x|0}c:do if(!e){g=0;v=12}else{j=e;g=0;while(1){if(!(a[j>>0]|0)){v=12;break c}h=Ko(j,33)|0;if((h|0)==(j|0)){j=0;h=27;break c}h=(h|0)==0?0:h-j|0;e=uf(b,j,h)|0;if(!e){j=0;h=27;break c}sf(g);j=(h|0)==0?0:j+(h+1)|0;if(!j){b=e;g=e;v=12;break}else{b=e;g=e}}}while(0);d:do if((v|0)==12){t=43;i=0;e:while(1){h=a[f>>0]|0;f:do switch(h<<24>>24){case 0:break e;case 47:case 45:case 43:case 38:{j=h<<24>>24;h=f;break}default:{switch(h<<24>>24|0){case 10:case 13:case 12:case 11:case 9:case 32:{j=t;h=f;break f}default:{}}switch(h<<24>>24){case 63:{j=t;h=f;break f}case 39:{h=f+1|0;f=Ko(h,39)|0;if((f|0)==0|(f|0)==(h|0)){j=0;h=29;break d}j=uf(b,h,f-h|0)|0;break}default:j=uf(b,f,1)|0}do if(j){g:do switch(t|0){case 38:{h=c[w+(i<<2)>>2]|0;r=h+12|0;s=c[r>>2]|0;if(!s){c[h>>2]=0;if((a[j>>0]|0)!=3){v=58;break e}k=j+1|0;n=a[k>>0]|0;q=1;e=0;o=n<<24>>24==1;do{h:do if(o)v=49;else{i:while(1){switch(n<<24>>24){case 0:{v=58;break e}case 4:break i;case 3:{e=e+1|0;break}default:{}}k=k+1|0;n=a[k>>0]|0;if(n<<24>>24==1){v=49;break h}}e=e+-1|0;p=k}while(0);if((v|0)==49){v=0;p=k+1|0;p=p+(((d[p>>0]|d[p+1>>0]<<8)&65535)+2)+-1|0}q=(((e|0)==0)<<31>>31)+q|0;k=p+1|0;n=a[k>>0]|0;o=n<<24>>24==1}while((q|0)>0);if(!o){v=58;break e}s=p+2|0;s=d[s>>0]|d[s+1>>0]<<8;e=s&65535;if(!(s<<16>>16)){v=58;break e}k=_e(e)|0;if(!k){v=58;break e}cr(k|0,p+4|0,e|0)|0;c[h>>2]=e;c[r>>2]=k;c[h+8>>2]=e;c[h+4>>2]=0;a[x+i>>0]=2;break g}else{if((a[j>>0]|0)!=3){h=65;break d}k=j+1|0;n=a[k>>0]|0;q=1;e=0;o=n<<24>>24==1;do{j:do if(o)v=36;else{k:while(1){switch(n<<24>>24){case 0:{h=65;break d}case 4:break k;case 3:{e=e+1|0;break}default:{}}k=k+1|0;n=a[k>>0]|0;if(n<<24>>24==1){v=36;break j}}e=e+-1|0;p=k}while(0);if((v|0)==36){v=0;p=k+1|0;p=p+(((d[p>>0]|d[p+1>>0]<<8)&65535)+2)+-1|0}q=(((e|0)==0)<<31>>31)+q|0;k=p+1|0;n=a[k>>0]|0;o=n<<24>>24==1}while((q|0)>0);if(!o){h=65;break d}r=p+2|0;r=d[r>>0]|d[r+1>>0]<<8;e=r&65535;if(!(r<<16>>16)){h=65;break d}k=c[h+4>>2]|0;if((k+e|0)>>>0>(c[h>>2]|0)>>>0){h=200;break d}cr(s+k|0,p+4|0,e|0)|0;c[h+8>>2]=e;a[x+i>>0]=1;break g}}case 47:{s=Af(j,1,8)|0;h=c[w+(i<<2)>>2]|0;c[h>>2]=s;break}case 45:{l:do if((a[j>>0]|0)==3){e=j+1|0;o=a[e>>0]|0;p=1;h=0;n=o<<24>>24==1;do{m:do if(n)v=64;else{k=o;n:while(1){switch(k<<24>>24){case 0:{h=0;break l}case 4:break n;case 3:{h=h+1|0;break}default:{}}e=e+1|0;k=a[e>>0]|0;if(k<<24>>24==1){v=64;break m}}h=h+-1|0;k=e}while(0);if((v|0)==64){v=0;k=e+1|0;k=k+(((d[k>>0]|d[k+1>>0]<<8)&65535)+2)+-1|0}p=(((h|0)==0)<<31>>31)+p|0;e=k+1|0;o=a[e>>0]|0;n=o<<24>>24==1}while((p|0)>0);if(n){h=k+2|0;h=(Sk(u,1,k+4|0,(d[h>>0]|d[h+1>>0]<<8)&65535,0)|0)==0;h=h?c[u>>2]|0:0}else h=0}else h=0;while(0);s=c[w+(i<<2)>>2]|0;c[s>>2]=h;h=s;break}default:{o:do if((a[j>>0]|0)==3){e=j+1|0;o=a[e>>0]|0;p=1;h=0;n=o<<24>>24==1;do{p:do if(n)v=76;else{k=o;q:while(1){switch(k<<24>>24){case 0:{h=0;break o}case 4:break q;case 3:{h=h+1|0;break}default:{}}e=e+1|0;k=a[e>>0]|0;if(k<<24>>24==1){v=76;break p}}h=h+-1|0;k=e}while(0);if((v|0)==76){v=0;k=e+1|0;k=k+(((d[k>>0]|d[k+1>>0]<<8)&65535)+2)+-1|0}p=(((h|0)==0)<<31>>31)+p|0;e=k+1|0;o=a[e>>0]|0;n=o<<24>>24==1}while((p|0)>0);if(n){h=k+2|0;h=(Sk(u,5,k+4|0,(d[h>>0]|d[h+1>>0]<<8)&65535,0)|0)==0;h=h?c[u>>2]|0:0}else h=0}else h=0;while(0);s=c[w+(i<<2)>>2]|0;c[s>>2]=h;h=s}}while(0);sf(j);if(!(c[h>>2]|0)){j=0;h=65;break d}}else{if((a[f+1>>0]|0)!=63){j=0;h=68;break d}h=w+(i<<2)|0;if((t|0)!=38){c[c[h>>2]>>2]=0;break}h=c[h>>2]|0;if(!(c[h+12>>2]|0)){c[h>>2]=0;c[h+4>>2]=0}c[h+8>>2]=0}while(0);j=t;i=i+1|0;h=f}}while(0);t=j;f=h+1|0}if((v|0)==58){c[r>>2]=0;h=65;break}sf(g);x=0;l=y;return x|0}while(0);sf(g);sf(j);if(!i){x=h;l=y;return x|0}do{i=i+-1|0;j=w+(i<<2)|0;if(!(a[x+i>>0]|0)){v=c[j>>2]|0;Jl(c[v>>2]|0);c[v>>2]=0}else{v=c[j>>2]|0;cf(c[v+12>>2]|0);c[v>>2]=0;c[v+4>>2]=0;c[v+8>>2]=0;c[v+12>>2]=0}}while((i|0)!=0);l=y;return h|0}function If(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f;c[g>>2]=e;e=Hf(a,b,d,g)|0;l=f;return ((e|0)==0?0:e&65535|16777216)|0}function Jf(a){a=a|0;if(Go(22673,a)|0)if(Go(22685,a)|0)if(Go(22697,a)|0)if(Go(22709,a)|0)if(Go(22722,a)|0)if(Go(22732,a)|0)if(Go(22743,a)|0)if(Go(22755,a)|0)if(Go(22768,a)|0)if(Go(22780,a)|0)if(Go(22793,a)|0)if(Go(22803,a)|0)if(!(Go(22814,a)|0))a=12;else{a=88;return a|0}else a=11;else a=10;else a=9;else a=8;else a=7;else a=6;else a=5;else a=4;else a=3;else a=2;else a=1;else a=0;c[17593]=c[17593]|c[1164+(a<<3)>>2];a=0;return a|0}function Kf(){return 0}function Lf(a,b){a=a|0;b=b|0;if((a|0)<0|a>>>0>12){b=0;return b|0}if(b|0)c[b>>2]=c[1164+(a<<3)>>2];b=c[1164+(a<<3)+4>>2]|0;return b|0}function Mf(){var b=0,d=0,e=0,f=0,g=0,h=0;h=l;l=l+256|0;if((l|0)>=(m|0))$(256);f=h;if(gg()|0){l=h;return}g=aq(22823,23390)|0;if(g|0){if(Sp(f,256,g)|0)do{b=a[f>>0]|0;e=b<<24>>24;a:do if(!(e&128)){d=f;do{if(!(Lo(e)|0))break a;d=d+1|0;b=a[d>>0]|0;e=b<<24>>24}while(!(e&128|0))}else d=f;while(0);e=Ko(d,10)|0;if(e){a[e>>0]=0;b=a[d>>0]|0}b:do if(b<<24>>24){e=(Fo(d)|0)+-1|0;if((e|0)>0){b=d+e|0;do{e=a[b>>0]|0;if((e&128|0)==0?Lo(e)|0:0)a[b>>0]=0;b=b+-1|0}while(b>>>0>d>>>0);b=a[d>>0]|0}switch(b<<24>>24){case 35:case 0:break b;default:{}}do if(Go(22673,d)|0)if(Go(22685,d)|0)if(Go(22697,d)|0)if(Go(22709,d)|0)if(Go(22722,d)|0)if(Go(22732,d)|0)if(Go(22743,d)|0)if(Go(22755,d)|0){if(!(Go(22768,d)|0)){b=8;break}if(!(Go(22780,d)|0)){b=9;break}if(!(Go(22793,d)|0)){b=10;break}if(!(Go(22803,d)|0)){b=11;break}if(!(Go(22814,d)|0))b=12;else break b}else b=7;else b=6;else b=5;else b=4;else b=3;else b=2;else b=1;else b=0;while(0);c[17593]=c[17593]|c[1164+(b<<3)>>2]}while(0)}while((Sp(f,256,g)|0)!=0);kq(g)|0;bq(g)|0}l=h;return}function Nf(){c[17594]=1;return}function Of(b){b=b|0;var d=0;if(!b){Tn(22);d=0;return d|0}if(!(c[17594]|0)){d=Oq(b)|0;return d|0}d=Oq(b+5|0)|0;if(!d){d=0;return d|0}a[d>>0]=b;a[d+1>>0]=b>>>8;a[d+2>>0]=b>>>16;a[d+3>>0]=85;a[d+(b+4)>>0]=-86;d=d+4|0;return d|0} +function rm(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;t=c[b+12>>2]|0;s=c[t+36>>2]|0;t=c[t+20>>2]|0;if(e>>>0>>0){u=200;return u|0}u=b+112|0;e=c[u>>2]|0;if(e>>>0>=g>>>0){h=b+64+t+(0-e)|0;if(!((f|d|h)&3))if(g>>>0>3){l=g+-4|0;m=l&-4;o=m+4|0;n=f+o|0;i=h;j=d;k=g;while(1){c[j>>2]=c[f>>2]^c[i>>2];k=k+-4|0;if(k>>>0<=3)break;else{f=f+4|0;i=i+4|0;j=j+4|0}}i=l-m|0;f=n;h=h+o|0;d=d+o|0}else i=g;else i=g;if(i){e=i;while(1){a[d>>0]=a[f>>0]^a[h>>0];e=e+-1|0;if(!e)break;else{f=f+1|0;h=h+1|0;d=d+1|0}}e=c[u>>2]|0}c[u>>2]=e-g;u=0;return u|0}if(e){g=g-e|0;i=b+64+t+(0-e)|0;if(e>>>0>3&((f|d|i)&3|0)==0){n=e+-4|0;o=n&-4;p=o+4|0;j=f+p|0;h=f;k=i;l=d;m=e;while(1){c[l>>2]=c[h>>2]^c[k>>2];m=m+-4|0;if(m>>>0<=3)break;else{h=h+4|0;k=k+4|0;l=l+4|0}}k=n-o|0;if(k){i=i+p|0;h=d+p|0;e=k;q=18}}else{j=f;h=d;q=18}if((q|0)==18){while(1){a[h>>0]=a[j>>0]^a[i>>0];e=e+-1|0;if(!e)break;else{j=j+1|0;i=i+1|0;h=h+1|0;q=18}}e=c[u>>2]|0}c[u>>2]=0;d=d+e|0;f=f+e|0}a:do if(g>>>0>>0)e=0;else{q=b+496|0;r=b+64|0;m=r;l=t+-4|0;o=l&-4;n=o+4|0;p=r+n|0;o=l-o|0;if(t>>>0>3)e=0;else{l=(t|0)==0;e=0;while(1){p=pb[s&63](q,r,r)|0;e=p>>>0>e>>>0?p:e;if(!l){h=f;i=r;j=d;k=t;while(1){a[j>>0]=a[h>>0]^a[i>>0];k=k+-1|0;if(!k)break;else{h=h+1|0;i=i+1|0;j=j+1|0}}}d=d+t|0;f=f+t|0;g=g-t|0;if(g>>>0>>0)break a}}do{l=pb[s&63](q,r,r)|0;e=l>>>0>e>>>0?l:e;if(!((f|m|d)&3)){h=f+n|0;i=f;j=r;k=d;l=t;while(1){c[k>>2]=c[i>>2]^c[j>>2];l=l+-4|0;if(l>>>0<=3)break;else{i=i+4|0;j=j+4|0;k=k+4|0}}j=p;k=d+n|0;i=o}else{h=f;j=r;k=d;i=t}if(i|0)while(1){a[k>>0]=a[h>>0]^a[j>>0];i=i+-1|0;if(!i)break;else{h=h+1|0;j=j+1|0;k=k+1|0}}d=d+t|0;f=f+t|0;g=g-t|0}while(g>>>0>=t>>>0)}while(0);do if(g){h=b+64|0;s=pb[s&63](b+496|0,h,h)|0;e=s>>>0>e>>>0?s:e;c[u>>2]=t-g;if(((f|h|d)&3|0)==0&g>>>0>3){k=g+-4|0;l=k&-4;n=l+4|0;m=f+n|0;i=h;j=d;while(1){c[j>>2]=c[f>>2]^c[i>>2];g=g+-4|0;if(g>>>0<=3)break;else{f=f+4|0;i=i+4|0;j=j+4|0}}g=k-l|0;if(!g)break;else{f=m;h=h+n|0;d=d+n|0}}while(1){a[d>>0]=a[f>>0]^a[h>>0];g=g+-1|0;if(!g)break;else{f=f+1|0;h=h+1|0;d=d+1|0}}}while(0);if(!e){u=0;return u|0}Te(e+16|0);u=0;return u|0}function sm(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;p=l;l=l+64|0;if((l|0)>=(m|0))$(64);g=p;if((d|0)==0&(e|0)!=12){o=45;l=p;return o|0}f=b+128|0;i=b+148|0;j=i;k=j+92|0;do{c[j>>2]=0;j=j+4|0}while((j|0)<(k|0));c[f>>2]=0;c[f+4>>2]=0;c[b+136>>2]=0;c[b+140>>2]=0;o=b+144|0;a[o>>0]=a[o>>0]&-4;o=b+56|0;a[o>>0]=a[o>>0]&-7;h=b+12|0;f=b+496|0;ub[c[(c[h>>2]|0)+60>>2]&7](f,d,e);j=g;k=j+64|0;do{a[j>>0]=0;j=j+1|0}while((j|0)<(k|0));zb[c[(c[h>>2]|0)+44>>2]&1](f,g,g,64);i=Lm(i,g,32)|0;if(g&7){f=64;do{a[g>>0]=0;g=g+1|0;f=f+-1|0}while((f|0)!=0&(g&7|0)!=0);if(f>>>0>=8)n=5}else{f=64;n=5}if((n|0)==5){h=f+-8|0;d=h&-8;e=d+8|0;b=g;while(1){n=b;c[n>>2]=0;c[n+4>>2]=0;f=f+-8|0;if(f>>>0<=7)break;else b=b+8|0}f=h-d|0;g=g+e|0}if(f|0)while(1){a[g>>0]=0;f=f+-1|0;if(!f)break;else g=g+1|0}if(i|0){o=i;l=p;return o|0}a[o>>0]=a[o>>0]|2;o=0;l=p;return o|0}function tm(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;k=l;l=l+16|0;if((l|0)>=(m|0))$(16);i=k;if(e>>>0>>0){g=200;l=k;return g|0}h=a[b+56>>0]|0;if(h&4){g=156;l=k;return g|0}j=b+144|0;e=a[j>>0]|0;if(e&2){g=139;l=k;return g|0}do if(!(h&2)){e=i;c[e>>2]=0;c[e+4>>2]=0;e=sm(b,i,8)|0;if(!e){e=a[j>>0]|0;break}else{g=e;l=k;return g|0}}while(0);if(!(e&1)){h=c[b+128>>2]&15;if(h){Km(b+148|0,71811,16-h|0);e=a[j>>0]|0}e=e|1;a[j>>0]=e;h=b+136|0;c[h>>2]=0;c[b+140>>2]=0;i=0}else{i=b+136|0;h=i;i=c[i>>2]|0}i=i+g|0;c[h>>2]=i;if(i>>>0>>0?(h=b+140|0,i=(c[h>>2]|0)+1|0,c[h>>2]=i,(i|0)==0):0){a[j>>0]=e|2;g=139;l=k;return g|0}zb[c[(c[b+12>>2]|0)+44>>2]&1](b+496|0,d,f,g);Km(b+148|0,d,g);g=0;l=k;return g|0}function um(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;k=l;l=l+16|0;if((l|0)>=(m|0))$(16);i=k;if(e>>>0>>0){g=200;l=k;return g|0}h=a[b+56>>0]|0;if(h&4){g=156;l=k;return g|0}j=b+144|0;e=a[j>>0]|0;if(e&2){g=139;l=k;return g|0}do if(!(h&2)){e=i;c[e>>2]=0;c[e+4>>2]=0;e=sm(b,i,8)|0;if(!e){e=a[j>>0]|0;break}else{g=e;l=k;return g|0}}while(0);if(!(e&1)){h=c[b+128>>2]&15;if(h){Km(b+148|0,71811,16-h|0);e=a[j>>0]|0}e=e|1;a[j>>0]=e;h=b+136|0;c[h>>2]=0;c[b+140>>2]=0;i=0}else{i=b+136|0;h=i;i=c[i>>2]|0}i=i+g|0;c[h>>2]=i;if(i>>>0>>0?(h=b+140|0,i=(c[h>>2]|0)+1|0,c[h>>2]=i,(i|0)==0):0){a[j>>0]=e|2;g=139;l=k;return g|0}Km(b+148|0,f,g);zb[c[(c[b+12>>2]|0)+48>>2]&1](b+496|0,d,f,g);g=0;l=k;return g|0}function vm(b){b=b|0;var d=0;d=b+128|0;c[d>>2]=0;c[d+4>>2]=0;c[b+136>>2]=0;c[b+140>>2]=0;d=b+144|0;a[d>>0]=a[d>>0]&-4;b=b+56|0;a[b>>0]=a[b>>0]&-7;return}function wm(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;b=i+15&-16;w=S(h,g)|0;x=df(1,(h<<1)+16+(w*3|0)+b|0)|0;if(!x){h=46734;return h|0}y=x+(0-x&15)|0;r=y+b|0;s=r+h|0;t=s+h|0;u=t+w|0;v=u+w|0;if(pb[d&63](y,16,16)|0){cf(x);h=46720;return h|0}Yq(r|0,78,h|0)|0;Yq(s|0,78,h|0)|0;if((h|0)>0){b=0;do{a[t+b>>0]=b;b=b+1|0}while((b|0)!=(h|0))}q=r;if(!((t|q|v)&3))if(h>>>0>3){l=h+-4|0;m=l&-4;n=m+4|0;i=t+n|0;b=t;d=r;j=v;k=h;while(1){c[j>>2]=c[b>>2]^c[d>>2];k=k+-4|0;if(k>>>0<=3)break;else{b=b+4|0;d=d+4|0;j=j+4|0}}b=l-m|0;j=r+n|0;d=v+n|0}else{b=h;i=t;j=r;d=v}else{i=t;j=r;d=v;b=h}if(b|0)while(1){a[d>>0]=a[i>>0]^a[j>>0];b=b+-1|0;if(!b)break;else{i=i+1|0;j=j+1|0;d=d+1|0}}pb[e&63](y,v,v)|0;cr(r|0,v|0,h|0)|0;qb[f&15](y,s,u,v,1);if(Tp(u,t,h)|0){cf(x);h=46671;return h|0}if(Tp(s,r,h)|0){cf(x);h=46671;return h|0}Yq(r|0,95,h|0)|0;Yq(s|0,95,h|0)|0;i=(w|0)>0;a:do if(i){b=0;do{a[t+b>>0]=b;b=b+1|0}while((b|0)!=(w|0));if(i){o=h+-4|0;n=o&-4;m=n+4|0;p=r+m|0;n=o-n|0;if(h>>>0>3)l=0;else{m=(h|0)==0;k=0;while(1){l=v+k|0;if(!m){b=t+k|0;i=r;d=l;j=h;while(1){a[d>>0]=a[b>>0]^a[i>>0];j=j+-1|0;if(!j)break;else{b=b+1|0;i=i+1|0;d=d+1|0}}}pb[e&63](y,l,l)|0;cr(r|0,l|0,h|0)|0;k=k+h|0;if((k|0)>=(w|0))break a}}do{o=v+l|0;b=t+l|0;if(!((o|q|b)&3)){k=b+m|0;i=r;d=o;j=h;while(1){c[d>>2]=c[b>>2]^c[i>>2];j=j+-4|0;if(j>>>0<=3)break;else{b=b+4|0;i=i+4|0;d=d+4|0}}b=k;d=p;j=o+m|0;i=n}else{d=r;j=o;i=h}if(i|0)while(1){a[j>>0]=a[b>>0]^a[d>>0];i=i+-1|0;if(!i)break;else{b=b+1|0;d=d+1|0;j=j+1|0}}pb[e&63](y,o,o)|0;cr(r|0,o|0,h|0)|0;l=l+h|0}while((l|0)<(w|0))}}while(0);qb[f&15](y,s,u,v,g);if(!(Tp(u,t,w)|0)){h=(Tp(s,r,h)|0)==0;cf(x);h=h?0:46671;return h|0}else{cf(x);h=46671;return h|0}return 0}function xm(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;b=i+15&-16;w=S(h,g)|0;x=df(1,(h<<1)+16+(w*3|0)+b|0)|0;if(!x){h=46734;return h|0}y=x+(0-x&15)|0;r=y+b|0;s=r+h|0;t=s+h|0;u=t+w|0;v=u+w|0;if(pb[d&63](y,32,16)|0){cf(x);h=46720;return h|0}Yq(r|0,-45,h|0)|0;Yq(s|0,-45,h|0)|0;if((h|0)>0){b=0;do{a[t+b>>0]=b;b=b+1|0}while((b|0)!=(h|0))}pb[e&63](y,v,r)|0;q=r;if(!((t|q|v)&3))if(h>>>0>3){l=h+-4|0;m=l&-4;n=m+4|0;j=v+n|0;b=t;i=v;d=r;k=h;while(1){p=c[i>>2]^c[b>>2];c[i>>2]=p;c[d>>2]=p;k=k+-4|0;if(k>>>0<=3)break;else{b=b+4|0;i=i+4|0;d=d+4|0}}b=l-m|0;d=t+n|0;i=r+n|0}else{b=h;d=t;j=v;i=r}else{d=t;j=v;i=r;b=h}if(b|0)while(1){p=a[j>>0]^a[d>>0];a[j>>0]=p;a[i>>0]=p;b=b+-1|0;if(!b)break;else{d=d+1|0;j=j+1|0;i=i+1|0}}qb[f&15](y,s,u,v,1);if(Tp(u,t,h)|0){cf(x);h=46760;return h|0}if(Tp(s,r,h)|0){cf(x);h=46760;return h|0}Yq(r|0,-26,h|0)|0;Yq(s|0,-26,h|0)|0;i=(w|0)>0;a:do if(i){b=0;do{a[t+b>>0]=b;b=b+1|0}while((b|0)!=(w|0));if(i){m=h+-4|0;o=m&-4;n=o+4|0;p=r+n|0;o=m-o|0;if(h>>>0>3)m=0;else{l=(h|0)==0;k=0;while(1){b=v+k|0;pb[e&63](y,b,r)|0;if(!l){j=t+k|0;i=r;d=h;while(1){q=a[b>>0]^a[j>>0];a[b>>0]=q;a[i>>0]=q;d=d+-1|0;if(!d)break;else{j=j+1|0;b=b+1|0;i=i+1|0}}}k=k+h|0;if((k|0)>=(w|0))break a}}do{d=v+m|0;pb[e&63](y,d,r)|0;b=t+m|0;if(!((d|q|b)&3)){l=b+n|0;i=d;j=r;k=h;while(1){z=c[i>>2]^c[b>>2];c[i>>2]=z;c[j>>2]=z;k=k+-4|0;if(k>>>0<=3)break;else{b=b+4|0;i=i+4|0;j=j+4|0}}b=l;d=d+n|0;j=p;i=o}else{j=r;i=h}if(i|0)while(1){z=a[d>>0]^a[b>>0];a[d>>0]=z;a[j>>0]=z;i=i+-1|0;if(!i)break;else{b=b+1|0;d=d+1|0;j=j+1|0}}m=m+h|0}while((m|0)<(w|0))}}while(0);qb[f&15](y,s,u,v,g);if(!(Tp(u,t,w)|0)){z=(Tp(s,r,h)|0)==0;cf(x);z=z?0:46760;return z|0}else{cf(x);z=46760;return z|0}return 0}function ym(b,c,e,f,g,h,i){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;b=i+15&-16;w=S(h,g)|0;y=df(1,(h<<1)+16+(w<<2)+b|0)|0;if(!y){h=46734;return h|0}x=y+(0-y&15)|0;r=x+b|0;s=r+h|0;t=s+h|0;u=t+w|0;v=u+w|0;j=v+w|0;if(pb[c&63](x,48,16)|0){cf(y);h=46720;return h|0}Yq(r|0,-1,h|0)|0;q=(h|0)>0;if(q){b=0;do{a[t+b>>0]=b;b=b+1|0}while((b|0)!=(h|0));pb[e&63](x,v,r)|0;if(q){b=0;do{p=v+b|0;a[p>>0]=a[p>>0]^a[t+b>>0];b=b+1|0}while((b|0)!=(h|0));b=h}else b=h}else{pb[e&63](x,v,r)|0;b=h}do{if((b|0)<=0)break;b=b+-1|0;o=r+b|0;p=(a[o>>0]|0)+1<<24>>24;a[o>>0]=p}while(!(p<<24>>24));Yq(s|0,-1,h|0)|0;qb[f&15](x,s,u,v,1);if(Tp(u,t,h)|0){cf(y);h=46809;return h|0}if(Tp(s,r,h)|0){cf(y);h=46809;return h|0}p=h+-4|0;Yq(r|0,87,p|0)|0;o=h+-1|0;n=r+o|0;a[n>>0]=1;l=h+-2|0;a[r+l>>0]=0;m=h+-3|0;a[r+m>>0]=0;a[r+p>>0]=0;Yq(s|0,87,p|0)|0;o=s+o|0;a[o>>0]=1;a[s+l>>0]=0;a[s+m>>0]=0;a[s+p>>0]=0;p=(w|0)>0;a:do if(p){b=0;do{m=b&255;a[t+b>>0]=m;a[u+b>>0]=m;b=b+1|0}while((b|0)!=(w|0));if(p){if(q)i=0;else{i=0;while(1){pb[e&63](x,v+i|0,r)|0;b=h;do{if((b|0)<=0)break;b=b+-1|0;l=r+b|0;m=(a[l>>0]|0)+1<<24>>24;a[l>>0]=m}while(!(m<<24>>24));i=i+h|0;if((i|0)>=(w|0))break a}}do{pb[e&63](x,v+i|0,r)|0;b=0;do{l=b+i|0;m=v+l|0;a[m>>0]=a[m>>0]^a[t+l>>0];b=b+1|0}while((b|0)!=(h|0));b=h;do{if((b|0)<=0)break;b=b+-1|0;l=r+b|0;m=(a[l>>0]|0)+1<<24>>24;a[l>>0]=m}while(!(m<<24>>24));i=i+h|0}while((i|0)<(w|0))}}while(0);qb[f&15](x,s,j,u,g);if(Tp(j,v,w)|0){cf(y);h=46809;return h|0}if(Tp(s,r,h)|0){cf(y);h=46809;return h|0}b:do if((g|0)>0){j=r+1|0;k=r+2|0;l=s+1|0;m=s+2|0;c=0;while(1){Yq(r|0,-1,h|0)|0;a[n>>0]=(d[n>>0]|0)-c;a[j>>0]=0;a[r>>0]=0;a[k>>0]=7;c:do if(p){b=0;do{a[t+b>>0]=b;b=b+1|0}while((b|0)!=(w|0));if(p){if(q)i=0;else{i=0;while(1){pb[e&63](x,v+i|0,r)|0;b=h;do{if((b|0)<=0)break;b=b+-1|0;A=r+b|0;z=(a[A>>0]|0)+1<<24>>24;a[A>>0]=z}while(!(z<<24>>24));i=i+h|0;if((i|0)>=(w|0))break c}}do{pb[e&63](x,v+i|0,r)|0;b=0;do{z=b+i|0;A=v+z|0;a[A>>0]=a[A>>0]^a[t+z>>0];b=b+1|0}while((b|0)!=(h|0));b=h;do{if((b|0)<=0)break;b=b+-1|0;z=r+b|0;A=(a[z>>0]|0)+1<<24>>24;a[z>>0]=A}while(!(A<<24>>24));i=i+h|0}while((i|0)<(w|0))}}while(0);Yq(s|0,-1,h|0)|0;a[o>>0]=(d[o>>0]|0)-c;a[l>>0]=0;a[s>>0]=0;a[m>>0]=7;qb[f&15](x,s,u,v,g);if(Tp(u,t,w)|0){b=49;break}c=c+1|0;if(Tp(s,r,h)|0){b=51;break}if((c|0)>=(g|0))break b}if((b|0)==49){cf(y);A=46809;return A|0}else if((b|0)==51){cf(y);A=46809;return A|0}}while(0);cf(y);A=0;return A|0}function zm(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,aa=0,ba=0;ba=l;l=l+544|0;if((l|0)>=(m|0))$(544);L=ba+496|0;X=ba+248|0;V=ba+216|0;U=ba+136|0;R=ba+128|0;Q=ba+120|0;N=ba+112|0;J=ba+104|0;E=ba+96|0;D=ba+88|0;C=ba+80|0;z=ba+72|0;H=ba+64|0;G=ba+56|0;F=ba+48|0;A=ba+40|0;w=ba+32|0;x=ba+24|0;v=ba+16|0;j=ba+8|0;i=ba;M=ba+440|0;I=ba+428|0;B=ba+384|0;y=ba+372|0;o=ba+368|0;Z=ba+324|0;_=ba+264|0;aa=ba+260|0;Y=ba+256|0;W=ba+252|0;c[aa>>2]=0;c[Y>>2]=0;c[W>>2]=0;r=Z;s=r+44|0;do{c[r>>2]=0;r=r+4|0}while((r|0)<(s|0));r=_;s=r+60|0;do{c[r>>2]=0;r=r+4|0}while((r|0)<(s|0));f=Fh(b,o)|0;if(f|0){aa=f;l=ba;return aa|0}f=uf(b,46925,0)|0;if(f){g=zf(f,1)|0;sf(f);if(!g){aa=65;l=ba;return aa|0}}else g=0;f=uf(b,46885,0)|0;if((f|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G);if(nf(1)|0)Oe(49012,H);Rj(b);Ug(M);Rj(I);tl(p);tl(o);tl(n);tl(j);tl(i);break}if(nf(1)|0)Oe(48930,z);Pj(I);r=L;b=_;s=r+44|0;do{c[r>>2]=c[b>>2];r=r+4|0;b=b+4|0}while((r|0)<(s|0));Vg(B,L);r=M;b=B;s=r+44|0;do{c[r>>2]=c[b>>2];r=r+4|0;b=b+4|0}while((r|0)<(s|0));o=M+44|0;Pj(o);Al(c[o>>2]|0,c[_+44>>2]|0)|0;Al(c[M+48>>2]|0,c[_+48>>2]|0)|0;Al(c[M+52>>2]|0,c[_+52>>2]|0)|0;if((c[t>>2]|0)==1){b=Hl(256)|0;H=Aj(32,0)|0;a[H>>0]=(d[H>>0]|0)&63|64;G=H+31|0;a[G>>0]=(d[G>>0]|0)&248;Rk(b,H,32,0);cf(H)}else{b=Hl(q)|0;Kl(b,q,0)}i=Uj(c[M>>2]|0,c[M+4>>2]|0,0,c[M+8>>2]|0,c[M+12>>2]|0,c[M+16>>2]|0)|0;j=Hl(0)|0;n=Hl(0)|0;ck(I,b,o,i);if((c[t>>2]|0)!=1)ck(I,c[i+36>>2]|0,I,i);if(Nj(j,0,I,i)|0)Me(49047,C);ck(I,b,M+20|0,i);ck(I,c[u>>2]|0,I,i);if((c[t>>2]|0)!=1)ck(I,c[i+36>>2]|0,I,i);if(Nj(n,0,I,i)|0)Me(49095,D);if(!(wk(j,n)|0)){tl(j);tl(n);Yj(i);Rj(o);Ug(M);Rj(I);tl(b);break}else Me(49144,E)}while(0)}else{h=Rg(_,Z,k,q)|0;if(h|0){o=0;n=0;j=0;i=0;b=0;g=0;f=0;break}g=0;f=0;h=_+20|0}s=Hl(0)|0;r=Hl(0)|0;if(Nj(s,r,h,k)|0){c[J>>2]=49163;Me(48787,J)}q=_+8|0;n=Yg(s,r,c[q>>2]|0)|0;do if((c[_+4>>2]|0)==1?(K=c[W>>2]|0,(K&2048|0)==0):0){h=Mg(_+44|0,k,s,r,K>>>10&1,L,M)|0;if(!h){b=Hl(0)|0;ul(b,c[L>>2]|0,c[M>>2]<<3)|0;break}aa=h;l=ba;return aa|0}else S=71;while(0);if((S|0)==71){if(!f){f=Hl(0)|0;g=Hl(0)|0;if(!(Nj(f,g,_+44|0,k)|0)){O=g;P=f}else{c[N>>2]=48835;Me(48787,N)}}else{O=g;P=f}b=Yg(P,O,c[q>>2]|0)|0;g=O;f=P}p=_+56|0;o=c[p>>2]|0;c[p>>2]=0;p=Z+40|0;h=c[p>>2]|0;if(h|0?(c[Q>>2]=h,T=Df(aa,0,49165,Q)|0,T|0):0){j=r;i=s;h=T;break}h=c[W>>2]|0;i=h&4608;if(i){h=Df(Y,0,(i|0)!=4608?(h&512|0?49176:49190):49204,R)|0;if(h|0){j=r;i=s;break}h=c[W>>2]|0}i=c[aa>>2]|0;j=c[Y>>2]|0;if((h&512|0)==0|(c[p>>2]|0)==0){c[V>>2]=i;c[V+4>>2]=j;c[V+8>>2]=b;c[V+12>>2]=i;c[V+16>>2]=j;c[V+20>>2]=b;c[V+24>>2]=o;h=Df(e,0,49360,V)|0}else{R=c[q>>2]|0;S=c[_+12>>2]|0;T=c[_+16>>2]|0;V=c[_+32>>2]|0;h=c[_+36>>2]|0;c[U>>2]=i;c[U+4>>2]=j;c[U+8>>2]=R;c[U+12>>2]=S;c[U+16>>2]=T;c[U+20>>2]=n;c[U+24>>2]=V;c[U+28>>2]=h;c[U+32>>2]=b;c[U+36>>2]=i;c[U+40>>2]=j;c[U+44>>2]=R;c[U+48>>2]=S;c[U+52>>2]=T;c[U+56>>2]=n;c[U+60>>2]=V;c[U+64>>2]=h;c[U+68>>2]=b;c[U+72>>2]=o;h=Df(e,0,49224,U)|0}if(!h)if((nf(1)|0)!=0?(Se(49436,c[q>>2]|0),Se(49452,c[_+12>>2]|0),Se(49468,c[_+16>>2]|0),Se(49484,n),Se(49500,c[_+32>>2]|0),Se(49516,c[_+36>>2]|0),Se(49532,b),Se(49548,o),(c[W>>2]&4096|0)!=0):0){Oe(49564,X);j=r;i=s;h=0}else{j=r;i=s;h=0}else{j=r;i=s}}else{o=0;n=0;k=0;j=0;i=0;b=0;g=0;f=0}}while(0);tl(o);tl(b);tl(n);Ug(_);Rj(_+44|0);tl(c[_+56>>2]|0);Ug(Z);tl(i);tl(j);tl(f);tl(g);Yj(k);sf(c[Y>>2]|0);sf(c[aa>>2]|0);aa=h;l=ba;return aa|0}function Am(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;I=l;l=l+240|0;if((l|0)>=(m|0))$(240);H=I+144|0;C=I+136|0;B=I+128|0;A=I+120|0;z=I+112|0;y=I+104|0;x=I+96|0;v=I+88|0;u=I+80|0;t=I+72|0;j=I+64|0;i=I+56|0;g=I+40|0;f=I;D=I+220|0;q=I+216|0;E=I+212|0;F=I+208|0;G=I+148|0;c[q>>2]=0;c[E>>2]=0;c[F>>2]=0;b=G;d=b+60|0;do{c[b>>2]=0;b=b+4|0}while((b|0)<(d|0));e=uf(a,46885,0)|0;if(e){b=Eh(e,q,0)|0;if(!b)if(!(c[q>>2]&512))k=5;else{c[f>>2]=G+8;c[f+4>>2]=G+12;c[f+8>>2]=G+16;c[f+12>>2]=E;c[f+16>>2]=G+32;c[f+20>>2]=G+36;c[f+24>>2]=F;c[f+28>>2]=G+56;c[f+32>>2]=0;b=If(a,0,47225,f)|0;k=6}else{f=0;d=0}}else k=5;if((k|0)==5){c[g>>2]=F;c[g+4>>2]=G+56;c[g+8>>2]=0;b=If(a,0,47244,g)|0;k=6}do if((k|0)==6)if(!b){sf(e);r=uf(a,46925,5)|0;if((r|0)!=0?(h=zf(r,1)|0,(h|0)!=0):0){b=Fg(h,G,G+4|0,G+8|0,G+12|0,G+16|0,E,G+32|0,G+36|0)|0;if(!b)k=h;else{H=b;l=I;return H|0}}else k=0;if(c[E>>2]|0?(n=G+20|0,Pj(n),n=_g(n,c[E>>2]|0)|0,n|0):0){f=0;e=r;d=k;b=n;break}if(!k){n=c[q>>2]|0;c[G>>2]=n>>>11&2;c[G+4>>2]=n>>>12&1}if(nf(1)|0){n=Wg(c[G>>2]|0)|0;b=Xg(c[G+4>>2]|0)|0;c[i>>2]=n;c[i+4>>2]=b;Oe(48153,i);b=c[G+40>>2]|0;if(b|0){c[j>>2]=b;Oe(48177,j)}b=G+8|0;Se(48198,c[b>>2]|0);Se(48214,c[G+12>>2]|0);Se(48230,c[G+16>>2]|0);Mj(48246,G+20|0,0);Se(48260,c[G+32>>2]|0);Se(48276,c[G+36>>2]|0);Se(48292,c[F>>2]|0);if(!(gg()|0))Se(48308,c[G+56>>2]|0)}else b=G+8|0;b=c[b>>2]|0;if(((((((b|0)!=0?(o=c[G+12>>2]|0,(o|0)!=0):0)?(p=c[G+16>>2]|0,(p|0)!=0):0)?(c[G+20>>2]|0)!=0:0)?(s=G+32|0,(c[s>>2]|0)!=0):0)?(c[G+36>>2]|0)!=0:0)?(w=G+56|0,(c[w>>2]|0)!=0):0){h=G+4|0;f=Uj(c[G>>2]|0,c[h>>2]|0,0,b,o,p)|0;if(c[F>>2]|0){i=G+44|0;Pj(i);b=c[F>>2]|0;if((c[f+4>>2]|0)==1)b=Pg(b,f,i,0,0)|0;else b=_g(i,b)|0;if(!b){d=c[q>>2]|0;Pj(D);a=Hl(0)|0;if((c[f>>2]|0)==1)g=0;else g=Hl(0)|0;e=G+20|0;a:do if(!(dk(e,f)|0)){if(!(nf(1)|0)){b=7;e=0;d=0;break}Oe(48324,t);b=7;e=0;d=0}else{if(!(vk(c[G+28>>2]|0,0)|0)){if(!(nf(1)|0)){b=7;e=0;d=0;break}Oe(48376,u);b=7;e=0;d=0;break}do if((c[h>>2]|0)!=1){ck(D,c[s>>2]|0,e,f);if(!(vk(c[D+8>>2]|0,0)|0))break;if(!(nf(1)|0)){b=7;e=0;d=0;break a}Oe(48421,v);b=7;e=0;d=0;break a}while(0);b=G+52|0;if(!(vk(c[b>>2]|0,0)|0)){if(!(nf(1)|0)){b=7;e=0;d=0;break}Oe(48468,x);b=7;e=0;d=0;break}if(!($g(D,f,e,c[w>>2]|0)|0)){if(!(nf(1)|0)){b=7;e=0;d=0;break}Oe(48514,y);b=7;e=0;d=0;break}if(Nj(a,g,D,f)|0){if(!(nf(1)|0)){b=7;e=0;d=0;break}Oe(48468,z);b=7;e=0;d=0;break}if(d&4096|0){b=0;e=0;d=0;break}if(!(vk(c[b>>2]|0,1)|0)){if(!(wk(a,c[i>>2]|0)|0)){if(g|0){b=0;e=0;d=0;break}if(!(wk(0,c[G+48>>2]|0)|0)){b=0;e=0;d=0;break}}if(!(nf(1)|0)){b=7;e=0;d=0;break}Oe(48551,A);b=7;e=0;d=0;break}d=Hl(0)|0;e=Hl(0)|0;if(Nj(d,e,i,f)|0){if(!(nf(1)|0)){b=7;break}Oe(48468,B);b=7;break}if((wk(a,d)|0)==0?(wk(g,e)|0)==0:0){b=0;break}if(!(nf(1)|0)){b=7;break}Oe(48551,C);b=7}while(0);tl(d);tl(a);tl(g);tl(e);Rj(D);e=r;d=k}else{e=r;d=k}}else{e=r;d=k;b=68}}else{f=0;e=r;d=k;b=68}}else{f=0;d=0}while(0);Yj(f);Jl(c[G+8>>2]|0);Jl(c[G+12>>2]|0);Jl(c[G+16>>2]|0);Jl(c[E>>2]|0);Rj(G+20|0);Jl(c[G+32>>2]|0);Jl(c[G+36>>2]|0);Jl(c[F>>2]|0);Rj(G+44|0);Jl(c[G+56>>2]|0);cf(d);sf(e);if(!(nf(1)|0)){H=b;l=I;return H|0}c[H>>2]=Pn(b)|0;Oe(48611,H);H=b;l=I;return H|0}function Bm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;F=l;l=l+192|0;if((l|0)>=(m|0))$(192);E=F+72|0;D=F+64|0;C=F+56|0;p=F+48|0;n=F+40|0;k=F+32|0;B=F;v=F+152|0;w=F+144|0;x=F+140|0;y=F+136|0;A=F+80|0;c[w>>2]=0;c[x>>2]=0;c[y>>2]=0;e=A;f=e+56|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(f|0));Jh(v,0,Fm(d)|0);b=Lh(b,y,v)|0;do if(!b){if(nf(1)|0)Se(47813,c[y>>2]|0);o=c[y>>2]|0;if(o|0?c[o+12>>2]&4|0:0){q=79;r=0;s=0;t=0;u=0;break}o=A+8|0;i=A+12|0;j=A+16|0;e=A+32|0;f=A+36|0;c[B>>2]=o;c[B+4>>2]=i;c[B+8>>2]=j;c[B+12>>2]=w;c[B+16>>2]=e;c[B+20>>2]=f;c[B+24>>2]=x;c[B+28>>2]=0;b=If(d,0,47830,B)|0;if(!b){if(c[w>>2]|0?(g=A+20|0,Pj(g),g=_g(g,c[w>>2]|0)|0,g|0):0){q=g;r=0;s=0;t=0;u=0;break}sf(0);b=uf(d,46925,5)|0;if((b|0)!=0?(h=zf(b,1)|0,(h|0)!=0):0){b=Eg(0,h,A,0)|0;if(b){E=b;l=F;return E|0}}else{c[A>>2]=0;c[A+4>>2]=0;h=0}if(nf(1)|0){g=Wg(c[A>>2]|0)|0;b=Xg(c[A+4>>2]|0)|0;c[k>>2]=g;c[k+4>>2]=b;Oe(47846,k);b=c[A+40>>2]|0;if(b|0){c[n>>2]=b;Oe(47871,n)}Se(47893,c[o>>2]|0);Se(47910,c[i>>2]|0);Se(47927,c[j>>2]|0);Mj(47944,A+20|0,0);Se(47959,c[e>>2]|0);Se(47976,c[f>>2]|0);Se(47993,c[x>>2]|0)}if((!((c[o>>2]|0)==0|(c[i>>2]|0)==0|(c[j>>2]|0)==0)?(z=A+20|0,!((c[z>>2]|0)==0|(c[e>>2]|0)==0)):0)?(c[f>>2]|0)!=0&(c[x>>2]|0)!=0:0){g=A+44|0;Pj(g);b=_g(g,c[x>>2]|0)|0;if(!b){e=Uj(c[A>>2]|0,c[A+4>>2]|0,0,c[o>>2]|0,c[i>>2]|0,c[j>>2]|0)|0;f=Hl(0)|0;d=Hl(0)|0;Pj(B);ck(B,c[y>>2]|0,g,e);if(Nj(f,d,B,e)|0)Me(48010,p);b=Yg(f,d,c[o>>2]|0)|0;ck(B,c[y>>2]|0,z,e);if(!(Nj(f,d,B,e)|0)){s=Yg(f,d,c[o>>2]|0)|0;tl(f);tl(d);Rj(B);c[D>>2]=b;c[D+4>>2]=s;q=Df(a,0,48105,D)|0;r=e;t=b;u=h;break}else Me(48058,C)}else{q=b;r=0;s=0;t=0;u=h}}else{q=68;r=0;s=0;t=0;u=h}}else{q=b;r=0;s=0;t=0;u=0}}else{q=b;r=0;s=0;t=0;u=0}while(0);Jl(c[A+8>>2]|0);Jl(c[A+12>>2]|0);Jl(c[A+16>>2]|0);Jl(c[w>>2]|0);Rj(A+20|0);Jl(c[A+32>>2]|0);Jl(c[A+36>>2]|0);Jl(c[x>>2]|0);Rj(A+44|0);Jl(c[y>>2]|0);Jl(t);Jl(s);cf(u);Yj(r);Kh(v);if(!(nf(1)|0)){E=q;l=F;return E|0}c[E>>2]=Pn(q)|0;Oe(48131,E);E=q;l=F;return E|0}function Cm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;B=l;l=l+224|0;if((l|0)>=(m|0))$(224);A=B+72|0;s=B+64|0;r=B+56|0;q=B+48|0;p=B+40|0;j=B+8|0;h=B;t=B+176|0;u=B+168|0;v=B+164|0;w=B+104|0;x=B+100|0;y=B+88|0;z=B+76|0;c[u>>2]=0;c[v>>2]=0;c[x>>2]=0;f=w;g=f+60|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(g|0));Pj(y);Pj(z);Jh(t,1,Fm(d)|0);b=Ih(b,12556,u,t)|0;do if(!b){b=c[u>>2]|0;c[h>>2]=v;c[h+4>>2]=0;b=If(b,0,47524,h)|0;if(!b){if(nf(1)|0)Se(47526,c[v>>2]|0);n=c[v>>2]|0;if(n|0?c[n+12>>2]&4|0:0){f=0;g=0;b=79;e=0;break}n=w+8|0;h=w+12|0;i=w+16|0;f=w+32|0;g=w+36|0;k=w+56|0;c[j>>2]=n;c[j+4>>2]=h;c[j+8>>2]=i;c[j+12>>2]=x;c[j+16>>2]=f;c[j+20>>2]=g;c[j+24>>2]=k;c[j+28>>2]=0;b=If(d,0,47543,j)|0;if(!b){if(c[x>>2]|0?(o=w+20|0,Pj(o),o=_g(o,c[x>>2]|0)|0,o|0):0){f=0;g=0;b=o;e=0;break}sf(c[u>>2]|0);b=uf(d,46925,5)|0;c[u>>2]=b;if((b|0)!=0?(e=zf(b,1)|0,(e|0)!=0):0){b=Eg(0,e,w,0)|0;if(b){A=b;l=B;return A|0}}else{c[w>>2]=0;c[w+4>>2]=0;e=0}if(nf(1)|0){o=Wg(c[w>>2]|0)|0;b=Xg(c[w+4>>2]|0)|0;c[p>>2]=o;c[p+4>>2]=b;Oe(47559,p);b=c[w+40>>2]|0;if(b|0){c[q>>2]=b;Oe(47584,q)}Se(47606,c[n>>2]|0);Se(47623,c[h>>2]|0);Se(47640,c[i>>2]|0);Mj(47657,w+20|0,0);Se(47672,c[f>>2]|0);Se(47689,c[g>>2]|0);if(!(gg()|0))Se(47706,c[k>>2]|0)}if(!((c[n>>2]|0)==0|(c[h>>2]|0)==0|(c[i>>2]|0)==0)?!((c[w+20>>2]|0)==0|(c[f>>2]|0)==0|(c[g>>2]|0)==0|(c[k>>2]|0)==0):0){b=_g(y,c[v>>2]|0)|0;if(b|0){Rj(y);A=b;l=B;return A|0}i=Uj(c[w>>2]|0,c[w+4>>2]|0,0,c[n>>2]|0,c[h>>2]|0,c[i>>2]|0)|0;ck(z,c[k>>2]|0,y,i);g=Hl(0)|0;h=Hl(0)|0;if(Nj(g,h,z,i)|0)Me(47723,r);f=Yg(g,h,c[n>>2]|0)|0;if(!f)b=Sn()|0;else b=0;tl(g);tl(h);if(nf(1)|0)Se(47763,f);if(!b){c[s>>2]=f;g=i;b=Df(a,0,47780,s)|0}else g=i}else{f=0;g=0;b=68}}else{f=0;g=0;e=0}}else{f=0;g=0;e=0}}else{f=0;g=0;e=0}while(0);Rj(z);Rj(y);Jl(f);Jl(c[w+8>>2]|0);Jl(c[w+12>>2]|0);Jl(c[w+16>>2]|0);Jl(c[x>>2]|0);Rj(w+20|0);Jl(c[w+32>>2]|0);Jl(c[w+36>>2]|0);Jl(c[w+56>>2]|0);Jl(c[v>>2]|0);cf(e);sf(c[u>>2]|0);Yj(g);Kh(t);if(!(nf(1)|0)){A=b;l=B;return A|0}c[A>>2]=Pn(b)|0;Oe(47791,A);A=b;l=B;return A|0}function Dm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;x=l;l=l+224|0;if((l|0)>=(m|0))$(224);w=x+104|0;q=x+96|0;p=x+88|0;o=x+80|0;n=x+72|0;j=x+56|0;h=x+40|0;g=x;r=x+184|0;s=x+176|0;t=x+172|0;u=x+168|0;v=x+108|0;c[s>>2]=0;c[t>>2]=0;c[u>>2]=0;e=v;f=e+60|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(f|0));Jh(r,2,0);b=Lh(b,s,r)|0;do if(!b){if(nf(1)|0)Se(47209,c[s>>2]|0);e=r+12|0;if(!(c[e>>2]&512)){c[h>>2]=u;c[h+4>>2]=v+56;c[h+8>>2]=0;b=If(d,0,47244,h)|0}else{c[g>>2]=v+8;c[g+4>>2]=v+12;c[g+8>>2]=v+16;c[g+12>>2]=t;c[g+16>>2]=v+32;c[g+20>>2]=v+36;c[g+24>>2]=u;c[g+28>>2]=v+56;c[g+32>>2]=0;b=If(d,0,47225,g)|0}if(!b){if(c[t>>2]|0?(k=v+20|0,Pj(k),k=_g(k,c[t>>2]|0)|0,k|0):0){f=0;g=0;h=0;e=0;b=k;break}sf(0);h=uf(d,46925,5)|0;if((h|0)!=0?(i=zf(h,1)|0,(i|0)!=0):0){b=Eg(0,i,v,0)|0;if(b){w=b;l=x;return w|0}}else{i=c[e>>2]|0;c[v>>2]=i>>>11&2;c[v+4>>2]=i>>>12&1;i=0}if(nf(1)|0){d=Wg(c[v>>2]|0)|0;k=Xg(c[v+4>>2]|0)|0;b=c[e>>2]&4096|0?47019:71847;c[j>>2]=d;c[j+4>>2]=k;c[j+8>>2]=b;Oe(47250,j);b=c[v+40>>2]|0;if(b|0){c[n>>2]=b;Oe(47276,n)}b=v+8|0;Se(47297,c[b>>2]|0);Se(47313,c[v+12>>2]|0);Se(47329,c[v+16>>2]|0);Mj(47345,v+20|0,0);Se(47359,c[v+32>>2]|0);Se(47375,c[v+36>>2]|0);Se(47391,c[u>>2]|0);if(!(gg()|0))Se(47407,c[v+56>>2]|0)}else b=v+8|0;if(((((((c[b>>2]|0)!=0?(c[v+12>>2]|0)!=0:0)?(c[v+16>>2]|0)!=0:0)?(c[v+20>>2]|0)!=0:0)?(c[v+32>>2]|0)!=0:0)?(c[v+36>>2]|0)!=0:0)?(c[v+56>>2]|0)!=0:0){g=Hl(0)|0;f=Hl(0)|0;e=c[e>>2]|0;if(e&4096|0){b=Sg(c[s>>2]|0,v,g,f,c[r+16>>2]|0,c[u>>2]|0)|0;if(b|0){e=i;break}c[o>>2]=g;c[o+4>>2]=f;e=i;b=Df(a,0,47423,o)|0;break}b=c[s>>2]|0;if(!(e&8192)){b=Kn(b,v,g,f,e,c[r+16>>2]|0)|0;if(b|0){e=i;break}c[q>>2]=g;c[q+4>>2]=f;e=i;b=Df(a,0,47476,q)|0;break}else{b=Mn(b,v,g,f)|0;if(b|0){e=i;break}c[p>>2]=g;c[p+4>>2]=f;e=i;b=Df(a,0,47450,p)|0;break}}else{f=0;g=0;e=i;b=68}}else{f=0;g=0;h=0;e=0}}else{f=0;g=0;h=0;e=0}while(0);Jl(c[v+8>>2]|0);Jl(c[v+12>>2]|0);Jl(c[v+16>>2]|0);Jl(c[t>>2]|0);Rj(v+20|0);Jl(c[v+32>>2]|0);Jl(c[v+36>>2]|0);Jl(c[u>>2]|0);Rj(v+44|0);Jl(c[v+56>>2]|0);Jl(g);Jl(f);cf(e);Jl(c[s>>2]|0);sf(h);Kh(r);if(!(nf(1)|0)){w=b;l=x;return w|0}c[w>>2]=Pn(b)|0;Oe(47503,w);w=b;l=x;return w|0}function Em(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;E=l;l=l+224|0;if((l|0)>=(m|0))$(224);D=E+80|0;n=E+72|0;k=E+56|0;g=E+48|0;h=E+16|0;t=E;w=E+176|0;x=E+172|0;y=E+168|0;z=E+164|0;A=E+160|0;B=E+156|0;C=E+152|0;v=E+96|0;o=E+88|0;u=E+84|0;c[x>>2]=0;c[y>>2]=0;c[z>>2]=0;c[A>>2]=0;c[B>>2]=0;c[C>>2]=0;e=v;f=e+56|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(f|0));Jh(w,3,Fm(d)|0);e=Lh(b,C,w)|0;a:do if(!e){if(nf(1)|0)Se(46951,c[C>>2]|0);e=Hh(a,12556,x,o)|0;if(!e){a=c[x>>2]|0;e=c[o>>2]&4096|0?46967:46882;c[t>>2]=A;c[t+4>>2]=B;c[t+8>>2]=0;e=If(a,0,e,t)|0;if(!e){if(nf(1)|0){Se(46971,c[A>>2]|0);Se(46987,c[B>>2]|0)}b=c[w+12>>2]|0;if(!((c[o>>2]^b)&4096)){if(!(b&512)){c[g>>2]=z;c[g+4>>2]=0;e=If(d,0,46920,g)|0}else{e=v+32|0;c[h>>2]=v+8;c[h+4>>2]=v+12;c[h+8>>2]=v+16;c[h+12>>2]=y;c[h+16>>2]=e;c[h+20>>2]=e;c[h+24>>2]=z;c[h+28>>2]=0;e=If(d,0,47003,h)|0}if(!e){if(c[y>>2]|0?(i=v+20|0,Pj(i),i=_g(i,c[y>>2]|0)|0,i|0):0){f=0;e=i;break}sf(c[x>>2]|0);b=uf(d,46925,5)|0;c[x>>2]=b;if((b|0)!=0?(j=zf(b,1)|0,(j|0)!=0):0){b=Eg(0,j,v,0)|0;if(!b)a=j;else{D=b;l=E;return D|0}}else{a=c[o>>2]|0;c[v>>2]=a>>>11&2;c[v+4>>2]=a>>>12&1;a=0}if(!(nf(1)|0))f=v+8|0;else{i=Wg(c[v>>2]|0)|0;j=Xg(c[v+4>>2]|0)|0;b=c[o>>2]&4096|0?47019:71847;c[k>>2]=i;c[k+4>>2]=j;c[k+8>>2]=b;Oe(47026,k);b=c[v+40>>2]|0;if(b|0){c[n>>2]=b;Oe(47052,n)}f=v+8|0;Se(47073,c[f>>2]|0);Se(47089,c[v+12>>2]|0);Se(47105,c[v+16>>2]|0);Mj(47121,v+20|0,0);Se(47135,c[v+32>>2]|0);Se(47151,c[v+36>>2]|0);Se(47167,c[z>>2]|0)}if((((((c[f>>2]|0)!=0?(q=v+12|0,(c[q>>2]|0)!=0):0)?(r=v+16|0,(c[r>>2]|0)!=0):0)?(c[v+20>>2]|0)!=0:0)?(s=v+32|0,(c[s>>2]|0)!=0):0)?(p=c[z>>2]|0,(c[v+36>>2]|0)!=0&(p|0)!=0):0){e=c[o>>2]|0;if(e&4096|0){f=a;e=Tg(c[C>>2]|0,v,c[A>>2]|0,c[B>>2]|0,c[w+16>>2]|0,p)|0;break}b=v+44|0;Pj(b);if(e&8192|0){e=_g(b,c[z>>2]|0)|0;if(e|0){f=a;break}f=a;e=Nn(c[C>>2]|0,v,c[A>>2]|0,c[B>>2]|0)|0;break}if((c[v+4>>2]|0)==1){r=Uj(c[v>>2]|0,1,0,c[f>>2]|0,c[q>>2]|0,c[r>>2]|0)|0;e=Pg(c[z>>2]|0,r,b,0,0)|0;Yj(r)}else e=_g(b,c[z>>2]|0)|0;if(e|0){f=a;break}b=c[C>>2]|0;do if(b|0){if(!(c[b+12>>2]&4))break;e=lk(c[s>>2]|0)|0;b=wl(c[C>>2]|0,t)|0;b=Sk(u,5,b,((c[t>>2]|0)+7|0)>>>3,0)|0;if(!b){b=c[t>>2]|0;if(b>>>0>e>>>0){t=c[u>>2]|0;sk(t,t,b-e|0)}b=Ln(c[u>>2]|0,v,c[A>>2]|0,c[B>>2]|0)|0;Jl(c[u>>2]|0)}f=a;e=b;break a}while(0);f=a;e=Ln(b,v,c[A>>2]|0,c[B>>2]|0)|0}else{f=a;e=68}}else f=0}else{f=0;e=70}}else f=0}else f=0}else f=0;while(0);Jl(c[v+8>>2]|0);Jl(c[v+12>>2]|0);Jl(c[v+16>>2]|0);Jl(c[y>>2]|0);Rj(v+20|0);Jl(c[v+32>>2]|0);Jl(c[v+36>>2]|0);Jl(c[z>>2]|0);Rj(v+44|0);Jl(c[C>>2]|0);Jl(c[A>>2]|0);Jl(c[B>>2]|0);cf(f);sf(c[x>>2]|0);Kh(w);if(!(nf(1)|0)){D=e;l=E;return D|0}if(!e)b=47183;else b=Pn(e)|0;c[D>>2]=b;Oe(47188,D);D=e;l=E;return D|0}function Fm(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=f;c[e>>2]=0;b=uf(a,46949,1)|0;if(!b){a=uf(a,46925,5)|0;if((a|0)!=0?(d=zf(a,1)|0,sf(a),(d|0)!=0):0){if(Eg(0,d,0,e)|0)c[e>>2]=0;cf(d);a=c[e>>2]|0}else a=0}else{a=Af(b,1,5)|0;sf(b);if(!a)a=0;else{d=lk(a)|0;c[e>>2]=d;Jl(a);a=d}}l=f;return a|0}function Gm(a,b,c){a=a|0;b=b|0;c=c|0;return ((a|0)==18?0:4)|0}function Hm(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;G=l;l=l+176|0;if((l|0)>=(m|0))$(176);E=G+88|0;D=G+80|0;i=G+72|0;h=G+64|0;q=G+32|0;p=G;F=G+112|0;w=G+108|0;r=G+104|0;y=G+100|0;B=G+140|0;C=G+96|0;c[w>>2]=0;c[r>>2]=0;c[y>>2]=0;c[F>>2]=0;c[F+4>>2]=0;c[F+8>>2]=0;c[F+12>>2]=0;c[F+16>>2]=0;c[F+20>>2]=0;c[F+24>>2]=0;g=uf(d,46885,0)|0;do if(g){e=Eh(g,w,0)|0;if(!e){n=c[w>>2]|0;o=(n&4096|0)!=0;if(!(n&512)){e=F+24|0;if(!o){j=10;break}c[h>>2]=e;c[h+4>>2]=0;e=If(d,0,46920,h)|0;j=11;break}e=F+4|0;h=F+8|0;i=F+12|0;j=F+16|0;k=F+20|0;n=F+24|0;if(o){c[p>>2]=F;c[p+4>>2]=e;c[p+8>>2]=h;c[p+12>>2]=i;c[p+16>>2]=j;c[p+20>>2]=k;c[p+24>>2]=n;c[p+28>>2]=0;e=If(d,0,46891,p)|0;j=11;break}else{c[q>>2]=F;c[q+4>>2]=e;c[q+8>>2]=h;c[q+12>>2]=i;c[q+16>>2]=j;c[q+20>>2]=k;c[q+24>>2]=n;c[q+28>>2]=0;e=If(d,0,46906,q)|0;j=11;break}}else f=0}else{e=F+24|0;j=10}while(0);if((j|0)==10){c[i>>2]=e;c[i+4>>2]=0;e=If(d,0,46923,i)|0;j=11}a:do if((j|0)==11)if(!e){sf(g);g=uf(d,46925,5)|0;if((g|0)!=0?(f=zf(g,1)|0,(f|0)!=0):0){e=Fg(f,r,y,F,F+4|0,F+8|0,F+12|0,F+16|0,F+20|0)|0;if(!e)e=F;else break}else{f=c[w>>2]|0;c[r>>2]=f>>>11&2;c[y>>2]=f>>>12&1;f=0;e=F}e=c[e>>2]|0;if(((((((e|0)!=0?(kk(e),x=c[F+4>>2]|0,(x|0)!=0):0)?(kk(x),A=c[F+8>>2]|0,(A|0)!=0):0)?(kk(A),s=c[F+12>>2]|0,(s|0)!=0):0)?(kk(s),t=c[F+16>>2]|0,(t|0)!=0):0)?(kk(t),u=c[F+20>>2]|0,(u|0)!=0):0)?(kk(u),z=F+24|0,v=c[z>>2]|0,(v|0)!=0):0){kk(v);if(c[w>>2]&4096|0){if((c[y>>2]|0)!=1){e=69;break}e=Ng(c[z>>2]|0,256)|0;if(e|0)break}h=0;while(1){if((h|0)==5){h=6;continue}e=c[F+(h<<2)>>2]|0;if((e|0)!=0?(c[e+12>>2]&4|0)!=0:0){A=wl(e,C)|0;z=((c[C>>2]|0)+7|0)>>>3;c[C>>2]=z;c[D>>2]=a[46931+h>>0];c[D+4>>2]=z;lp(B,30,46938,D)|0;lh(b,B,Fo(B)|0);lh(b,A,c[C>>2]|0);lh(b,46947,1)}else{e=Ok(e,0,C,0)|0;if(!e)break;A=c[C>>2]|0;c[E>>2]=a[46931+h>>0];c[E+4>>2]=A;lp(B,30,46938,E)|0;lh(b,B,Fo(B)|0);lh(b,e,c[C>>2]|0);lh(b,46947,1);cf(e)}h=h+1|0;if((h|0)>=7){e=0;break a}}e=Sn()|0}else e=68}else f=0;while(0);cf(f);sf(g);Jl(c[F>>2]|0);Jl(c[F+4>>2]|0);Jl(c[F+8>>2]|0);Jl(c[F+12>>2]|0);Jl(c[F+16>>2]|0);Jl(c[F+20>>2]|0);Jl(c[F+24>>2]|0);l=G;return e|0}function Im(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;k=l;l=l+1008|0;if((l|0)>=(m|0))$(1008);j=k;h=k+8|0;if((sh(a)|0)!=(g|0)){j=49658;l=k;return j|0}if(eh(j,a,0)|0){j=49699;l=k;return j|0}switch(b|0){case 0:{lh(c[j>>2]|0,d,e);i=8;break}case 1:{Yq(h|0,97,1e3)|0;b=0;do{lh(c[j>>2]|0,h,1e3);b=b+1|0}while((b|0)!=1e3);i=8;break}default:b=49641}if((i|0)==8){b=(Tp(ph(c[j>>2]|0,a)|0,f,g)|0)==0;b=b?0:49625}kh(c[j>>2]|0);j=b;l=k;return j|0}function Jm(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;h=b+148|0;j=c[h>>2]|0;if(j>>>0>128)He(49719,112,49733);i=b+152|0;g=c[i>>2]|0;if(!g)return;k=b+144|0;f=c[k>>2]|0;if((f|0)==(j|0)){Te(pb[g&63](b,b,1)|0);c[k>>2]=0;l=b+128|0;f=l;f=_q(c[f>>2]|0,c[f+4>>2]|0,1,0)|0;g=D;c[l>>2]=f;c[l+4>>2]=g;if((f|0)==0&(g|0)==0){f=b+136|0;l=f;l=_q(c[l>>2]|0,c[l+4>>2]|0,1,0)|0;c[f>>2]=l;c[f+4>>2]=D;f=0}else f=0}if(!d)return;a:do if(f){b:do if(e|0){if(f>>>0>>0)do{l=a[d>>0]|0;c[k>>2]=f+1;a[b+f>>0]=l;e=e+-1|0;if(!e)break b;d=d+1|0;f=c[k>>2]|0}while(f>>>0>>0);g=c[h>>2]|0;if(g>>>0>128)He(49719,112,49733);h=c[i>>2]|0;if(!((f|0)==(g|0)&(h|0)!=0))break a;Te(pb[h&63](b,b,1)|0);c[k>>2]=0;g=b+128|0;h=g;h=_q(c[h>>2]|0,c[h+4>>2]|0,1,0)|0;l=D;c[g>>2]=h;c[g+4>>2]=l;if(!((h|0)==0&(l|0)==0))break a;l=b+136|0;h=l;h=_q(c[h>>2]|0,c[h+4>>2]|0,1,0)|0;c[l>>2]=h;c[l+4>>2]=D;break a}while(0);e=c[h>>2]|0;if(e>>>0>128)He(49719,112,49733);d=c[i>>2]|0;if(!d)return;if((c[k>>2]|0)!=(e|0))return;Te(pb[d&63](b,b,1)|0);c[k>>2]=0;j=b+128|0;k=j;k=_q(c[k>>2]|0,c[k+4>>2]|0,1,0)|0;l=D;c[j>>2]=k;c[j+4>>2]=l;if(!((k|0)==0&(l|0)==0))return;l=b+136|0;k=l;k=_q(c[k>>2]|0,c[k+4>>2]|0,1,0)|0;c[l>>2]=k;c[l+4>>2]=D;return}while(0);if(e>>>0>>0)f=0;else{l=(e>>>0)/(j>>>0)|0;f=pb[c[i>>2]&63](b,d,l)|0;c[k>>2]=0;i=b+128|0;g=i;g=_q(c[g>>2]|0,c[g+4>>2]|0,l|0,0)|0;h=D;m=b+136|0;n=m;n=_q((h>>>0<0|(h|0)==0&g>>>0>>0)&1|0,0,c[n>>2]|0,c[n+4>>2]|0)|0;c[m>>2]=n;c[m+4>>2]=D;c[i>>2]=g;c[i+4>>2]=h;l=S(l,j)|0;e=e-l|0;d=d+l|0}Te(f);if(!e)return;while(1){f=c[k>>2]|0;if(f>>>0>=j>>>0){d=29;break}n=a[d>>0]|0;c[k>>2]=f+1;a[b+f>>0]=n;e=e+-1|0;if(!e){d=29;break}else d=d+1|0}if((d|0)==29)return}function Km(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;q=b+3|0;q=q+(0-(q&3))|0;r=b+84|0;p=c[c[r>>2]>>2]|0;s=b+88|0;f=c[s>>2]|0;do if(f){o=p-f|0;o=o>>>0>e>>>0?e:o;g=b+68+f|0;if(!((g|d)&3))if(o>>>0>3){l=o+-4|0;m=l&-4;n=m+4|0;h=d+n|0;i=d;j=g;k=o;while(1){c[j>>2]=c[i>>2];k=k+-4|0;if(k>>>0<=3)break;else{i=i+4|0;j=j+4|0}}i=l-m|0;g=g+n|0}else{i=o;h=d}else{h=d;i=o}if(i){f=i;while(1){a[g>>0]=a[h>>0]|0;f=f+-1|0;if(!f)break;else{h=h+1|0;g=g+1|0}}f=c[s>>2]|0}n=f+o|0;c[s>>2]=n;if(n>>>0

>>0)return;else{g=pb[c[(c[r>>2]|0)+8>>2]&63](q,b+68|0,p)|0;c[s>>2]=0;d=d+o|0;f=e-o|0;break}}else{f=e;g=0}while(0);i=f&0-p;if(f>>>0

>>0){h=d;o=f;n=g}else{h=d+i|0;o=f-i|0;n=pb[c[(c[r>>2]|0)+8>>2]&63](q,d,i)|0}if(o|0){f=c[s>>2]|0;g=b+68+f|0;if(o>>>0>3&((g|h)&3|0)==0){j=o+-4|0;k=j&-4;m=k+4|0;l=h+m|0;i=g;d=o;while(1){c[i>>2]=c[h>>2];d=d+-4|0;if(d>>>0<=3)break;else{h=h+4|0;i=i+4|0}}i=j-k|0;if(i){h=l;g=g+m|0;f=i;t=20}}else{f=o;t=20}if((t|0)==20){while(1){a[g>>0]=a[h>>0]|0;f=f+-1|0;if(!f)break;else{h=h+1|0;g=g+1|0;t=20}}f=c[s>>2]|0}c[s>>2]=f+o}if(!n)return;Te(n);return}function Lm(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0;J=l;l=l+624|0;if((l|0)>=(m|0))$(624);H=J+96|0;C=J;o=J+228|0;D=J+136|0;E=J+592|0;F=J+336|0;G=J+320|0;g=J+104|0;if(!(c[17642]|0)){c[17642]=1;f=o;B=f+92|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(B|0));f=D;B=f+92|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(B|0));f=G;B=f+16|0;do{a[f>>0]=0;f=f+1|0}while((f|0)<(B|0));f=C;B=f+92|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(B|0));Lm(C,49754,32)|0;Km(C,49786,131);B=C+3|0;Te(wb[c[(c[C+84>>2]|0)+12>>2]&3](B+(0-(B&3))|0,C+68|0,c[C+88>>2]|0,G)|0);if(C&4){f=C;h=92;do{a[f>>0]=0;f=f+1|0;h=h+-1|0}while((h|0)!=0&(f&7|0)!=0);if(h>>>0>=8)I=5}else{f=C;h=92;I=5}if((I|0)==5){k=h+-8|0;n=k&-8;j=n+8|0;i=f;while(1){B=i;c[B>>2]=0;c[B+4>>2]=0;h=h+-8|0;if(h>>>0<=7)break;else i=i+8|0}f=f+j|0;h=k-n|0}if(h|0)while(1){a[f>>0]=0;h=h+-1|0;if(!h)break;else f=f+1|0}if(!(Tp(49917,G,16)|0)){f=G;B=f+16|0;do{a[f>>0]=0;f=f+1|0}while((f|0)<(B|0));Lm(o,49754,32)|0;Km(o,49786,32);Km(o,49818,64);Km(o,49882,16);Km(o,49898,8);Km(o,49906,4);Km(o,49910,2);Km(o,49912,1);Km(o,49913,1);Km(o,49914,1);Km(o,49915,1);Km(o,49916,1);B=o+3|0;Te(wb[c[(c[o+84>>2]|0)+12>>2]&3](B+(0-(B&3))|0,o+68|0,c[o+88>>2]|0,G)|0);if(!(Tp(49917,G,16)|0)){f=G;B=f+16|0;do{a[f>>0]=0;f=f+1|0}while((f|0)<(B|0));f=C;B=f+92|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(B|0));Lm(C,49933,32)|0;Km(C,49965,16);B=C+3|0;Te(wb[c[(c[C+84>>2]|0)+12>>2]&3](B+(0-(B&3))|0,C+68|0,c[C+88>>2]|0,G)|0);if(C&4){f=C;h=92;do{a[f>>0]=0;f=f+1|0;h=h+-1|0}while((h|0)!=0&(f&7|0)!=0);if(h>>>0>=8)I=15}else{f=C;h=92;I=15}if((I|0)==15){k=h+-8|0;n=k&-8;j=n+8|0;i=f;while(1){B=i;c[B>>2]=0;c[B+4>>2]=0;h=h+-8|0;if(h>>>0<=7)break;else i=i+8|0}f=f+j|0;h=k-n|0}if(h|0)while(1){a[f>>0]=0;h=h+-1|0;if(!h)break;else f=f+1|0}if(!(Tp(49981,G,16)|0)){Lm(D,49997,32)|0;h=C+3|0;h=h+(0-(h&3))|0;i=C+84|0;j=C+68|0;k=C+88|0;n=C+8|0;o=C+16|0;p=C+24|0;q=C+32|0;r=C+40|0;s=C+48|0;t=C+56|0;u=C+64|0;v=C+72|0;w=C+80|0;x=k+1|0;y=k+2|0;z=k+3|0;A=0;do{f=A&255;Yq(E|0,f|0,32)|0;if(A|0)Yq(F|0,f|0,A|0)|0;f=C;B=f+92|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(B|0));Lm(C,E,32)|0;Km(C,F,A);Te(wb[c[(c[i>>2]|0)+12>>2]&3](h,j,c[k>>2]|0,G)|0);B=C;c[B>>2]=0;c[B+4>>2]=0;B=n;c[B>>2]=0;c[B+4>>2]=0;B=o;c[B>>2]=0;c[B+4>>2]=0;B=p;c[B>>2]=0;c[B+4>>2]=0;B=q;c[B>>2]=0;c[B+4>>2]=0;B=r;c[B>>2]=0;c[B+4>>2]=0;B=s;c[B>>2]=0;c[B+4>>2]=0;B=t;c[B>>2]=0;c[B+4>>2]=0;B=u;c[B>>2]=0;c[B+4>>2]=0;B=v;c[B>>2]=0;c[B+4>>2]=0;B=w;c[B>>2]=0;c[B+4>>2]=0;a[k>>0]=0;a[x>>0]=0;a[y>>0]=0;a[z>>0]=0;Km(D,G,16);A=A+1|0}while((A|0)!=256);f=D+3|0;Te(wb[c[(c[D+84>>2]|0)+12>>2]&3](f+(0-(f&3))|0,D+68|0,c[D+88>>2]|0,G)|0);f=(Tp(50029,G,16)|0)==0;f=f?0:50045}else f=50117}else f=50093}else f=50069;c[17643]=f;if(f|0){c[H>>2]=f;Le(50141,H)}}if((e|0)!=32){I=44;l=J;return I|0}if(c[17643]|0){I=50;l=J;return I|0}f=b+84|0;c[f>>2]=12580;if(!(d&3)){c[g>>2]=c[d>>2];c[g+4>>2]=c[d+4>>2];c[g+8>>2]=c[d+8>>2];c[g+12>>2]=c[d+12>>2];c[g+16>>2]=c[d+16>>2];c[g+20>>2]=c[d+20>>2];c[g+24>>2]=c[d+24>>2];c[g+28>>2]=c[d+28>>2];f=12580}else{a[g>>0]=a[d>>0]|0;a[g+1>>0]=a[d+1>>0]|0;a[g+2>>0]=a[d+2>>0]|0;a[g+3>>0]=a[d+3>>0]|0;a[g+4>>0]=a[d+4>>0]|0;a[g+5>>0]=a[d+5>>0]|0;a[g+6>>0]=a[d+6>>0]|0;a[g+7>>0]=a[d+7>>0]|0;a[g+8>>0]=a[d+8>>0]|0;a[g+9>>0]=a[d+9>>0]|0;a[g+10>>0]=a[d+10>>0]|0;a[g+11>>0]=a[d+11>>0]|0;a[g+12>>0]=a[d+12>>0]|0;a[g+13>>0]=a[d+13>>0]|0;a[g+14>>0]=a[d+14>>0]|0;a[g+15>>0]=a[d+15>>0]|0;a[g+16>>0]=a[d+16>>0]|0;a[g+17>>0]=a[d+17>>0]|0;a[g+18>>0]=a[d+18>>0]|0;a[g+19>>0]=a[d+19>>0]|0;a[g+20>>0]=a[d+20>>0]|0;a[g+21>>0]=a[d+21>>0]|0;a[g+22>>0]=a[d+22>>0]|0;a[g+23>>0]=a[d+23>>0]|0;a[g+24>>0]=a[d+24>>0]|0;a[g+25>>0]=a[d+25>>0]|0;a[g+26>>0]=a[d+26>>0]|0;a[g+27>>0]=a[d+27>>0]|0;a[g+28>>0]=a[d+28>>0]|0;a[g+29>>0]=a[d+29>>0]|0;a[g+30>>0]=a[d+30>>0]|0;a[g+31>>0]=a[d+31>>0]|0;f=c[f>>2]|0}d=b+3|0;c[b+88>>2]=0;sb[c[f+4>>2]&7](d+(0-(d&3))|0,g);if(g&4){f=32;do{a[g>>0]=0;g=g+1|0;f=f+-1|0}while((f|0)!=0&(g&7|0)!=0);if(f>>>0>=8)I=36}else{f=32;I=36}if((I|0)==36){i=f+-8|0;j=i&-8;k=j+8|0;h=g;while(1){I=h;c[I>>2]=0;c[I+4>>2]=0;f=f+-8|0;if(f>>>0<=7)break;else h=h+8|0}f=i-j|0;g=g+k|0}if(!f){I=0;l=J;return I|0}while(1){a[g>>0]=0;f=f+-1|0;if(!f){f=0;break}else g=g+1|0}l=J;return f|0}function Mm(b,e){b=b|0;e=e|0;var f=0,g=0;f=e+3|0;c[b>>2]=(d[e+2>>0]|0)<<16|(d[f>>0]|0)<<24&50331648|(d[e+1>>0]|0)<<8|(d[e>>0]|0);g=e+6|0;c[b+4>>2]=((d[e+5>>0]|0)<<16|(d[g>>0]|0)<<24|(d[e+4>>0]|0)<<8|(d[f>>0]|0))>>>2&67108611;f=e+9|0;c[b+8>>2]=((d[e+8>>0]|0)<<16|(d[f>>0]|0)<<24|(d[e+7>>0]|0)<<8|(d[g>>0]|0))>>>4&67092735;c[b+12>>2]=((d[e+11>>0]|0)<<16|(d[e+12>>0]|0)<<24|(d[e+10>>0]|0)<<8|(d[f>>0]|0))>>>6&66076671;c[b+16>>2]=(d[e+14>>0]|0)<<8|(d[e+15>>0]|0)<<16&983040|(d[e+13>>0]|0);f=b+20|0;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[f+16>>2]=0;c[b+40>>2]=(d[e+18>>0]|0)<<16|(d[e+19>>0]|0)<<24|(d[e+17>>0]|0)<<8|(d[e+16>>0]|0);c[b+44>>2]=(d[e+22>>0]|0)<<16|(d[e+23>>0]|0)<<24|(d[e+21>>0]|0)<<8|(d[e+20>>0]|0);c[b+48>>2]=(d[e+26>>0]|0)<<16|(d[e+27>>0]|0)<<24|(d[e+25>>0]|0)<<8|(d[e+24>>0]|0);c[b+52>>2]=(d[e+30>>0]|0)<<16|(d[e+31>>0]|0)<<24|(d[e+29>>0]|0)<<8|(d[e+28>>0]|0);a[b+56>>0]=0;return}function Nm(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0,I=0;t=a[b+56>>0]|0?0:16777216;u=c[b+4>>2]|0;m=c[b+8>>2]|0;n=c[b+12>>2]|0;o=c[b+16>>2]|0;v=b+20|0;k=c[v>>2]|0;w=b+24|0;j=c[w>>2]|0;x=b+28|0;i=c[x>>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0;h=h+1|0}while((h|0)<(j|0));cr(g|0,d|0,e|0)|0;a[g+e>>0]=1;a[b+56>>0]=1;Nm(b,g,16)|0;d=224}j=c[b+24>>2]|0;t=(c[b+28>>2]|0)+(j>>>26)|0;h=t&67108863;r=(t>>>26)+(c[b+32>>2]|0)|0;q=r&67108863;k=(r>>>26)+(c[b+36>>2]|0)|0;g=((k>>>26)*5|0)+(c[b+20>>2]|0)|0;e=g&67108863;j=(g>>>26)+(j&67108863)|0;v=((e+5|0)>>>26)+j|0;u=v>>>26;s=(u+h|0)>>>26;o=(k|-67108864)+((s+q|0)>>>26)|0;p=(o>>>31)+-1|0;n=o>>31;j=v&67108863&p|n&j;h=u+t&67108863&p|n&h;q=s+r&67108863&p|n&q;e=_q(g+5&67108863&p|n&e|j<<26|0,0,c[b+40>>2]|0,0)|0;g=D;j=_q(j>>>6|h<<20|0,0,c[b+44>>2]|0,0)|0;g=_q(j|0,D|0,g|0,0)|0;j=D;h=_q(h>>>12|q<<14|0,0,c[b+48>>2]|0,0)|0;j=_q(h|0,D|0,j|0,0)|0;h=D;k=_q(q>>>18|(p&o|n&k)<<8|0,0,c[b+52>>2]|0,0)|0;h=_q(k|0,D|0,h|0,0)|0;a[f+3>>0]=e>>>24;a[f+2>>0]=e>>>16;a[f+1>>0]=e>>>8;a[f>>0]=e;a[f+7>>0]=g>>>24;a[f+6>>0]=g>>>16;a[f+5>>0]=g>>>8;a[f+4>>0]=g;a[f+11>>0]=j>>>24;a[f+10>>0]=j>>>16;a[f+9>>0]=j>>>8;a[f+8>>0]=j;a[f+15>>0]=h>>>24;a[f+14>>0]=h>>>16;a[f+13>>0]=h>>>8;a[f+12>>0]=h;h=b;j=h+56|0;do{c[h>>2]=0;h=h+4|0}while((h|0)<(j|0));l=i;return d|0}function Pm(a){a=a|0;if(a|0){Qm();return}if(c[17644]|0)return;c[17644]=1;return}function Qm(){var a=0,b=0,d=0,e=0,f=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=f+16|0;d=f+8|0;b=f;if(!(c[17644]|0))c[17644]=1;a=Vn(12596)|0;if(a|0){c[b>>2]=Pn(a)|0;Me(50172,b)}c[17645]=1;do if(!(c[17646]|0)){if(!(c[17647]|0))a=kf(1,664)|0;else a=lf(1,664)|0;c[17646]=a;if(!(c[17647]|0))a=kf(1,664)|0;else a=lf(1,664)|0;c[17648]=a;if(vq(52444,4)|0){b=ze(50209)|0;Me(b,d)}if(!(vq(52456,4)|0)){c[17649]=3;break}else{b=ze(50209)|0;Me(b,d)}}while(0);c[17645]=0;a=Wn(12596)|0;if(!a){l=f;return}else{c[e>>2]=Pn(a)|0;Me(50247,e)}}function Rm(){var a=0,b=0,d=0,e=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=e+8|0;b=e;a=Vn(12596)|0;if(a|0){c[b>>2]=Pn(a)|0;Me(50172,b)}c[17645]=1;Dn(0,0,0,0)|0;c[17650]=0;c[17645]=0;a=Wn(12596)|0;if(!a){l=e;return}else{c[d>>2]=Pn(a)|0;Me(50247,d)}}function Sm(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;a=l;l=l+48|0;if((l|0)>=(m|0))$(48);b=a;p=c[17651]|0;o=c[17652]|0;n=c[17653]|0;k=c[17654]|0;j=c[17655]|0;i=c[17656]|0;h=c[17657]|0;g=c[17658]|0;f=c[17659]|0;e=c[17660]|0;d=(An()|0)!=0;c[b>>2]=600;c[b+4>>2]=p;c[b+8>>2]=o;c[b+12>>2]=n;c[b+16>>2]=k;c[b+20>>2]=j;c[b+24>>2]=i;c[b+28>>2]=h;c[b+32>>2]=g;c[b+36>>2]=f;c[b+40>>2]=e;c[b+44>>2]=d?50284:71847;Je(50300,b);l=a;return}function Tm(){c[17647]=1;return}function Um(){c[17661]=1;return}function Vm(a){a=a|0;return}function Wm(a){a=a|0;return 0}function Xm(){Qm();return c[17661]|0}function Ym(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;o=l;l=l+192|0;if((l|0)>=(m|0))$(192);j=o;k=b+600|0;if(!(c[17645]|0))Ie(50424,50439,615,50455);si(j);f=k;d=b+580|0;e=f+20|0;do{a[f>>0]=a[d>>0]|0;f=f+1|0;d=d+1|0}while((f|0)<(e|0));n=b+620|0;f=n;d=b;e=f+44|0;do{a[f>>0]=a[d>>0]|0;f=f+1|0;d=d+1|0}while((f|0)<(e|0));ti(j,k);f=b;d=k;e=f+20|0;do{a[f>>0]=a[d>>0]|0;f=f+1|0;d=d+1|0}while((f|0)<(e|0));if((c[17664]|0)!=0&(c[17646]|0)==(b|0)){a[b>>0]=a[b>>0]^a[71826];g=b+1|0;a[g>>0]=a[g>>0]^a[71827];g=b+2|0;a[g>>0]=a[g>>0]^a[71828];g=b+3|0;a[g>>0]=a[g>>0]^a[71829];g=b+4|0;a[g>>0]=a[g>>0]^a[71830];g=b+5|0;a[g>>0]=a[g>>0]^a[71831];g=b+6|0;a[g>>0]=a[g>>0]^a[71832];g=b+7|0;a[g>>0]=a[g>>0]^a[71833];g=b+8|0;a[g>>0]=a[g>>0]^a[71834];g=b+9|0;a[g>>0]=a[g>>0]^a[71835];g=b+10|0;a[g>>0]=a[g>>0]^a[71836];g=b+11|0;a[g>>0]=a[g>>0]^a[71837];g=b+12|0;a[g>>0]=a[g>>0]^a[71838];g=b+13|0;a[g>>0]=a[g>>0]^a[71839];g=b+14|0;a[g>>0]=a[g>>0]^a[71840];g=b+15|0;a[g>>0]=a[g>>0]^a[71841];g=b+16|0;a[g>>0]=a[g>>0]^a[71842];g=b+17|0;a[g>>0]=a[g>>0]^a[71843];g=b+18|0;a[g>>0]=a[g>>0]^a[71844];g=b+19|0;a[g>>0]=a[g>>0]^a[71845];g=1;h=0}else{g=1;h=0}do{f=k;d=b+h|0;e=f+20|0;do{a[f>>0]=a[d>>0]|0;f=f+1|0;d=d+1|0}while((f|0)<(e|0));f=h;h=h+20|0;i=b+h|0;d=f+40|0;if((f+104|0)<600){f=n;d=b+d|0;e=f+44|0;do{a[f>>0]=a[d>>0]|0;f=f+1|0;d=d+1|0}while((f|0)<(e|0))}else{e=20;while(1){d=(d|0)>599?0:d;a[k+e>>0]=a[b+d>>0]|0;e=e+1|0;if((e|0)==64)break;else d=d+1|0}}ti(j,k);f=i;d=k;e=f+20|0;do{a[f>>0]=a[d>>0]|0;f=f+1|0;d=d+1|0}while((f|0)<(e|0));g=g+1|0}while((g|0)!=30);if((c[17646]|0)!=(b|0)){Te(384);l=o;return}ui(71826,b,600);c[17664]=1;Te(384);l=o;return}function Zm(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;N=l;l=l+832|0;if((l|0)>=(m|0))$(832);M=N+136|0;K=N+128|0;J=N+120|0;I=N+112|0;H=N+104|0;G=N+96|0;F=N+88|0;E=N+80|0;D=N+72|0;L=N+64|0;y=N+56|0;x=N+48|0;w=N+40|0;B=N+32|0;A=N+24|0;z=N+16|0;C=N+8|0;f=N;t=N+144|0;u=N+224|0;v=N+140|0;Qm();g=e>>>0>1&(c[17661]|0)!=0?1:e&3;e=Vn(12596)|0;if(e|0){c[f>>2]=Pn(e)|0;Me(50172,f)}c[17645]=1;if(g>>>0>1){c[17660]=(c[17660]|0)+d;c[17659]=(c[17659]|0)+1}else{c[17658]=(c[17658]|0)+d;c[17657]=(c[17657]|0)+1}a:do if(d|0){p=t+12|0;q=t+36|0;r=(g|0)!=2;o=(g|0)==2;n=d;k=d>>>0>600?600:d;b:while(1){j=b;i=k;while(1){c[v>>2]=qq()|0;if((c[3160]|0)==-1)c[3160]=c[v>>2];if((c[3160]|0)!=(c[v>>2]|0)){c[3160]=c[v>>2];d=c[3160]|0;if(!(c[17645]|0)){f=14;break b}c[17655]=(c[17655]|0)+4;c[17654]=(c[17654]|0)+1;h=c[17662]|0;f=h+1|0;c[17662]=f;e=c[17646]|0;h=e+h|0;a[h>>0]=a[h>>0]^d&255;if(f>>>0>599){c[17662]=0;Ym(e);c[17651]=(c[17651]|0)+1;c[17663]=0;f=c[17662]|0;e=c[17646]|0}g=f+1|0;c[17662]=g;h=e+f|0;a[h>>0]=a[h>>0]^d>>>8&255;if(g>>>0>599){c[17662]=0;Ym(e);c[17651]=(c[17651]|0)+1;c[17663]=0;f=c[17662]|0;e=c[17646]|0}else f=g;h=f+1|0;c[17662]=h;g=e+f|0;a[g>>0]=a[g>>0]^d>>>16&255;if(h>>>0>599){c[17662]=0;Ym(e);c[17651]=(c[17651]|0)+1;c[17663]=0}g=c[17662]|0;h=g+1|0;c[17662]=h;e=c[17646]|0;g=e+g|0;a[g>>0]=a[g>>0]^d>>>24&255;if(h>>>0>599){c[17662]=0;Ym(e);c[17651]=(c[17651]|0)+1;c[17663]=1}c[17663]=0}if(!(c[17645]|0)){f=19;break b}if(i>>>0>600){f=21;break b}c:do if(!(c[17650]|0)){e=c[17665]|0;d:do if(e|0){f=Bq(e,0,z)|0;if((f|0)==-1){e=zo()|0;if((c[e>>2]|0)==2){c[17666]=1;break}else{h=ze(50521)|0;g=c[17665]|0;d=dp(c[e>>2]|0)|0;c[A>>2]=g;c[A+4>>2]=d;Je(h,A);break}}if(_m(f,c[17665]|0,0)|0){Up(f)|0;break}if(mq(f,t)|0){h=ze(50542)|0;g=c[17665]|0;d=dp(c[(zo()|0)>>2]|0)|0;c[B>>2]=g;c[B+4>>2]=d;Je(h,B);Up(f)|0;break}if((c[p>>2]&61440|0)!=32768){h=ze(50563)|0;c[w>>2]=c[17665];Je(h,w);Up(f)|0;break}switch(c[q>>2]|0){case 0:{Je(ze(50601)|0,x);Up(f)|0;c[17666]=1;break d}case 600:{e:while(1){switch(pq(f,u,600)|0){case 600:break e;case -1:break;default:{f=38;break b}}e=zo()|0;if((c[e>>2]|0)!=4){f=40;break b}}Up(f)|0;if(!(c[17645]|0)){f=42;break b}c[17655]=(c[17655]|0)+600;c[17654]=(c[17654]|0)+1;e=u;g=599;while(1){O=a[e>>0]|0;d=c[17662]|0;h=d+1|0;c[17662]=h;f=c[17646]|0;d=f+d|0;a[d>>0]=a[d>>0]^O;if(h>>>0>599){c[17662]=0;Ym(f);c[17651]=(c[17651]|0)+1;c[17663]=(g|0)==0&1}if(!g)break;else{e=e+1|0;g=g+-1|0}}d=qq()|0;if(!(c[17645]|0)){f=48;break b}c[17655]=(c[17655]|0)+4;c[17654]=(c[17654]|0)+1;O=c[17662]|0;e=O+1|0;c[17662]=e;f=c[17646]|0;O=f+O|0;a[O>>0]=a[O>>0]^d&255;if(e>>>0>599){c[17662]=0;Ym(f);c[17651]=(c[17651]|0)+1;c[17663]=0;e=c[17662]|0;f=c[17646]|0}g=e+1|0;c[17662]=g;O=f+e|0;a[O>>0]=a[O>>0]^d>>>8&255;if(g>>>0>599){c[17662]=0;Ym(f);c[17651]=(c[17651]|0)+1;c[17663]=0;g=c[17662]|0;e=c[17646]|0}else e=f;O=g+1|0;c[17662]=O;h=e+g|0;a[h>>0]=a[h>>0]^d>>>16&255;if(O>>>0>599){c[17662]=0;Ym(e);c[17651]=(c[17651]|0)+1;c[17663]=0}h=c[17662]|0;O=h+1|0;c[17662]=O;e=c[17646]|0;h=e+h|0;a[h>>0]=a[h>>0]^d>>>24&255;if(O>>>0>599){c[17662]=0;Ym(e);c[17651]=(c[17651]|0)+1;c[17663]=1}d=fb(0)|0;if(!(c[17645]|0)){f=52;break b}c[17655]=(c[17655]|0)+4;c[17654]=(c[17654]|0)+1;O=c[17662]|0;e=O+1|0;c[17662]=e;f=c[17646]|0;O=f+O|0;a[O>>0]=a[O>>0]^d&255;if(e>>>0>599){c[17662]=0;Ym(f);c[17651]=(c[17651]|0)+1;c[17663]=0;e=c[17662]|0;f=c[17646]|0}g=e+1|0;c[17662]=g;O=f+e|0;a[O>>0]=a[O>>0]^d>>>8&255;if(g>>>0>599){c[17662]=0;Ym(f);c[17651]=(c[17651]|0)+1;c[17663]=0;g=c[17662]|0;e=c[17646]|0}else e=f;O=g+1|0;c[17662]=O;h=e+g|0;a[h>>0]=a[h>>0]^d>>>16&255;if(O>>>0>599){c[17662]=0;Ym(e);c[17651]=(c[17651]|0)+1;c[17663]=0}h=c[17662]|0;O=h+1|0;c[17662]=O;e=c[17646]|0;h=e+h|0;a[h>>0]=a[h>>0]^d>>>24&255;if(O>>>0>599){c[17662]=0;Ym(e);c[17651]=(c[17651]|0)+1;c[17663]=1}d=Qa()|0;if(!(c[17645]|0)){f=56;break b}c[17655]=(c[17655]|0)+4;c[17654]=(c[17654]|0)+1;O=c[17662]|0;e=O+1|0;c[17662]=e;f=c[17646]|0;O=f+O|0;a[O>>0]=a[O>>0]^d&255;if(e>>>0>599){c[17662]=0;Ym(f);c[17651]=(c[17651]|0)+1;c[17663]=0;e=c[17662]|0;f=c[17646]|0}g=e+1|0;c[17662]=g;O=f+e|0;a[O>>0]=a[O>>0]^d>>>8&255;if(g>>>0>599){c[17662]=0;Ym(f);c[17651]=(c[17651]|0)+1;c[17663]=0;g=c[17662]|0;e=c[17646]|0}else e=f;O=g+1|0;c[17662]=O;h=e+g|0;a[h>>0]=a[h>>0]^d>>>16&255;if(O>>>0>599){c[17662]=0;Ym(e);c[17651]=(c[17651]|0)+1;c[17663]=0}h=c[17662]|0;O=h+1|0;c[17662]=O;e=c[17646]|0;h=e+h|0;a[h>>0]=a[h>>0]^d>>>24&255;if(O>>>0>599){c[17662]=0;Ym(e);c[17651]=(c[17651]|0)+1;c[17663]=1}if(!(c[17649]|0)){f=60;break b}if((Dn(3,0,16,0)|0)<0){f=62;break b}c[17666]=1;c[17650]=1;break c}default:{Je(ze(50634)|0,y);Up(f)|0;break d}}}while(0)}while(0);if(!(r|(c[17667]|0)!=0)){c[17668]=0;e=i>>>0<16?16:i;if(!(c[17649]|0)){f=85;break b}if((Dn(3,4,e,2)|0)<0){f=87;break b}c[17668]=(c[17668]|0)+e;c[17667]=1}if(o?(s=c[17668]|0,s>>>0>>0):0){if((s|0)<0){c[17668]=0;e=0}else e=s;e=i-e|0;if(e>>>0>600){f=94;break b}if(!(c[17649]|0)){f=96;break b}if((Dn(3,4,e,2)|0)<0){f=98;break b}c[17668]=(c[17668]|0)+e}while(1){if(c[17650]|0)break;c[17652]=(c[17652]|0)+1;if(!(c[17649]|0)){f=102;break b}if((Dn(3,3,120,1)|0)<0){f=104;break b}}an();d=c[3160]|0;if(!(c[17645]|0)){f=106;break b}c[17655]=(c[17655]|0)+4;c[17654]=(c[17654]|0)+1;O=c[17662]|0;e=O+1|0;c[17662]=e;f=c[17646]|0;O=f+O|0;a[O>>0]=a[O>>0]^d&255;if(e>>>0>599){c[17662]=0;Ym(f);c[17651]=(c[17651]|0)+1;c[17663]=0;e=c[17662]|0;f=c[17646]|0}g=e+1|0;c[17662]=g;O=f+e|0;a[O>>0]=a[O>>0]^d>>>8&255;if(g>>>0>599){c[17662]=0;Ym(f);c[17651]=(c[17651]|0)+1;c[17663]=0;g=c[17662]|0;e=c[17646]|0}else e=f;O=g+1|0;c[17662]=O;h=e+g|0;a[h>>0]=a[h>>0]^d>>>16&255;if(O>>>0>599){c[17662]=0;Ym(e);c[17651]=(c[17651]|0)+1;c[17663]=0}h=c[17662]|0;O=h+1|0;c[17662]=O;e=c[17646]|0;h=e+h|0;a[h>>0]=a[h>>0]^d>>>24&255;if(O>>>0<=599){if(!(c[17663]|0)){Ym(e);c[17651]=(c[17651]|0)+1}}else{c[17662]=0;Ym(e);c[17651]=(c[17651]|0)+1;c[17663]=1}d=c[17646]|0;e=c[17648]|0;f=d;g=0;while(1){c[e>>2]=(c[f>>2]|0)+-1515870811;g=g+1|0;if((g|0)==150)break;else{e=e+4|0;f=f+4|0}}Ym(d);c[17651]=(c[17651]|0)+1;Ym(c[17648]|0);c[17656]=(c[17656]|0)+1;e=i+-1|0;if(!i){h=j;i=e;e=c[17668]|0}else{g=c[17648]|0;h=c[17668]|0;f=j;d=c[17669]|0;while(1){O=d+1|0;a[f>>0]=a[g+d>>0]|0;d=O>>>0>599?0:O;if(!e)break;else{f=f+1|0;e=e+-1|0}}e=h-i|0;c[17669]=d;c[17668]=e;h=j+i|0;i=-1}if((e|0)<0)c[17668]=0;Yq(c[17648]|0,0,600)|0;O=qq()|0;if((O|0)==(c[v>>2]|0))break;d=qq()|0;if(!(c[17645]|0)){f=122;break b}c[17655]=(c[17655]|0)+4;c[17654]=(c[17654]|0)+1;O=c[17662]|0;e=O+1|0;c[17662]=e;f=c[17646]|0;O=f+O|0;a[O>>0]=a[O>>0]^d&255;if(e>>>0>599){c[17662]=0;Ym(f);c[17651]=(c[17651]|0)+1;c[17663]=0;e=c[17662]|0;f=c[17646]|0}g=e+1|0;c[17662]=g;O=f+e|0;a[O>>0]=a[O>>0]^d>>>8&255;if(g>>>0>599){c[17662]=0;Ym(f);c[17651]=(c[17651]|0)+1;c[17663]=0;g=c[17662]|0;e=c[17646]|0}else e=f;O=g+1|0;c[17662]=O;j=e+g|0;a[j>>0]=a[j>>0]^d>>>16&255;if(O>>>0>599){c[17662]=0;Ym(e);c[17651]=(c[17651]|0)+1;c[17663]=0}j=c[17662]|0;O=j+1|0;c[17662]=O;e=c[17646]|0;j=e+j|0;a[j>>0]=a[j>>0]^d>>>24&255;if(O>>>0>599){c[17662]=0;Ym(e);c[17651]=(c[17651]|0)+1;c[17663]=1}c[17663]=0;c[3160]=d;j=h}e=n-k|0;if(!e)break a;if(!(c[17645]|0)){f=9;break}else{b=b+k|0;n=e;k=e>>>0>600?600:e}}switch(f|0){case 9:{Ie(50424,50439,934,50464);break}case 14:{Ie(50424,50439,1074,50474);break}case 19:{Ie(50424,50439,953,50464);break}case 21:{Ne(50489,C);break}case 38:{J=zo()|0;O=ze(50688)|0;K=c[17665]|0;J=c[J>>2]|0;J=dp(J)|0;c[L>>2]=K;K=L+4|0;c[K>>2]=J;Me(O,L);break}case 40:{O=ze(50688)|0;K=c[17665]|0;J=c[e>>2]|0;J=dp(J)|0;c[L>>2]=K;K=L+4|0;c[K>>2]=J;Me(O,L);break}case 42:{Ie(50424,50439,1074,50474);break}case 48:{Ie(50424,50439,1074,50474);break}case 52:{Ie(50424,50439,1074,50474);break}case 56:{Ie(50424,50439,1074,50474);break}case 60:{Me(50709,D);break}case 62:{Me(50760,E);break}case 85:{Me(50709,F);break}case 87:{Me(50760,G);break}case 94:{He(50439,995,50464);break}case 96:{Me(50709,H);break}case 98:{Me(50760,I);break}case 102:{Me(50709,J);break}case 104:{Me(50760,K);break}case 106:{Ie(50424,50439,1074,50474);break}case 122:{Ie(50424,50439,1074,50474);break}}}while(0);c[17645]=0;e=Wn(12596)|0;if(!e){l=N;return}else{c[M>>2]=Pn(e)|0;Me(50247,M)}}function _m(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;p=l;l=l+64|0;if((l|0)>=(m|0))$(64);n=p+24|0;k=p+16|0;j=p+8|0;g=p;h=p+40|0;i=p+32|0;c[h>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;c[h+12>>2]=0;b[h>>1]=(e|0)!=0&1;b[h+2>>1]=0;c[g>>2]=h;if((jq(a,13,g)|0)!=-1){o=0;l=p;return o|0}f=zo()|0;g=i+4|0;e=0;a:while(1){switch(c[f>>2]|0){case 13:case 11:break;default:break a}if((e|0)>2){q=ze(50839)|0;c[k>>2]=d;Je(q,k)}c[i>>2]=e;c[g>>2]=25e4;nq(0,0,0,0,i)|0;c[n>>2]=h;if((jq(a,13,n)|0)==-1)e=((e|0)<10&1)+e|0;else{e=0;o=8;break}}if((o|0)==8){l=p;return e|0}q=ze(50818)|0;o=dp(c[f>>2]|0)|0;c[j>>2]=d;c[j+4>>2]=o;Je(q,j);q=-1;l=p;return q|0}function $m(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;if(!(c[17645]|0))Ie(50424,50439,1074,50474);c[17655]=(c[17655]|0)+d;c[17654]=(c[17654]|0)+1;f=d+-1|0;if(!d)return;if(e>>>0<3){while(1){h=a[b>>0]|0;g=c[17662]|0;e=g+1|0;c[17662]=e;d=c[17646]|0;g=d+g|0;a[g>>0]=a[g>>0]^h;if(e>>>0>599){c[17662]=0;Ym(d);c[17651]=(c[17651]|0)+1;c[17663]=(f|0)==0&1}if(!f)break;else{b=b+1|0;f=f+-1|0}}return}else d=0;while(1){i=a[b>>0]|0;b=b+1|0;g=c[17662]|0;h=g+1|0;c[17662]=h;e=c[17646]|0;g=e+g|0;a[g>>0]=a[g>>0]^i;d=d+1|0;if(h>>>0>599){if(!(c[17650]|0)){i=(c[17670]|0)+d|0;c[17670]=i;if(i>>>0>599){c[17650]=1;d=0}else d=0}c[17662]=0;Ym(e);c[17651]=(c[17651]|0)+1;c[17663]=(f|0)==0&1}if(!f)break;else f=f+-1|0}return}function an(){var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;h=l;l=l+144|0;if((l|0)>=(m|0))$(144);g=h;if(!(c[17645]|0))Ie(50424,50439,1180,50798);c[17653]=(c[17653]|0)+1;if(gb(g|0,0)|0)He(50439,1198,50798);if(!(c[17645]|0))Ie(50424,50439,1074,50474);c[17655]=(c[17655]|0)+4;c[17654]=(c[17654]|0)+1;e=a[g>>0]|0;f=c[17662]|0;b=f+1|0;c[17662]=b;d=c[17646]|0;f=d+f|0;a[f>>0]=a[f>>0]^e;if(b>>>0>599){c[17662]=0;Ym(d);c[17651]=(c[17651]|0)+1;c[17663]=0;b=c[17662]|0;d=c[17646]|0}i=a[g+1>>0]|0;e=b+1|0;c[17662]=e;f=d+b|0;a[f>>0]=a[f>>0]^i;if(e>>>0>599){c[17662]=0;Ym(d);c[17651]=(c[17651]|0)+1;c[17663]=0;e=c[17662]|0;b=c[17646]|0}else b=d;d=a[g+2>>0]|0;i=e+1|0;c[17662]=i;f=b+e|0;a[f>>0]=a[f>>0]^d;if(i>>>0>599){c[17662]=0;Ym(b);c[17651]=(c[17651]|0)+1;c[17663]=0}e=a[g+3>>0]|0;f=c[17662]|0;i=f+1|0;c[17662]=i;b=c[17646]|0;f=b+f|0;a[f>>0]=a[f>>0]^e;if(i>>>0>599){c[17662]=0;Ym(b);c[17651]=(c[17651]|0)+1;c[17663]=1}if(!(c[17645]|0))Ie(50424,50439,1074,50474);f=g+4|0;c[17655]=(c[17655]|0)+4;c[17654]=(c[17654]|0)+1;e=a[f>>0]|0;i=c[17662]|0;d=i+1|0;c[17662]=d;b=c[17646]|0;i=b+i|0;a[i>>0]=a[i>>0]^e;if(d>>>0>599){c[17662]=0;Ym(b);c[17651]=(c[17651]|0)+1;c[17663]=0;d=c[17662]|0;b=c[17646]|0}j=a[f+1>>0]|0;e=d+1|0;c[17662]=e;i=b+d|0;a[i>>0]=a[i>>0]^j;if(e>>>0>599){c[17662]=0;Ym(b);c[17651]=(c[17651]|0)+1;c[17663]=0;d=c[17662]|0;b=c[17646]|0}else d=e;e=a[f+2>>0]|0;j=d+1|0;c[17662]=j;i=b+d|0;a[i>>0]=a[i>>0]^e;if(j>>>0>599){c[17662]=0;Ym(b);c[17651]=(c[17651]|0)+1;c[17663]=0}f=a[f+3>>0]|0;i=c[17662]|0;j=i+1|0;c[17662]=j;b=c[17646]|0;i=b+i|0;a[i>>0]=a[i>>0]^f;if(j>>>0>599){c[17662]=0;Ym(b);c[17651]=(c[17651]|0)+1;c[17663]=1}Gq(0,g)|0;if(!(c[17645]|0))Ie(50424,50439,1074,50474);c[17655]=(c[17655]|0)+136;c[17654]=(c[17654]|0)+1;b=g;e=135;while(1){f=a[b>>0]|0;i=c[17662]|0;j=i+1|0;c[17662]=j;d=c[17646]|0;i=d+i|0;a[i>>0]=a[i>>0]^f;if(j>>>0>599){c[17662]=0;Ym(d);c[17651]=(c[17651]|0)+1;c[17663]=(e|0)==0&1}if(!e)break;else{b=b+1|0;e=e+-1|0}}f=fb(0)|0;c[g>>2]=f;if(!(c[17645]|0))Ie(50424,50439,1074,50474);c[17655]=(c[17655]|0)+4;c[17654]=(c[17654]|0)+1;j=c[17662]|0;d=j+1|0;c[17662]=d;b=c[17646]|0;j=b+j|0;a[j>>0]=a[j>>0]^f&255;if(d>>>0>599){c[17662]=0;Ym(b);c[17651]=(c[17651]|0)+1;c[17663]=0;d=c[17662]|0;b=c[17646]|0}e=d+1|0;c[17662]=e;j=b+d|0;a[j>>0]=a[j>>0]^f>>>8&255;if(e>>>0>599){c[17662]=0;Ym(b);c[17651]=(c[17651]|0)+1;c[17663]=0;d=c[17662]|0;b=c[17646]|0}else d=e;j=d+1|0;c[17662]=j;i=b+d|0;a[i>>0]=a[i>>0]^f>>>16&255;if(j>>>0>599){c[17662]=0;Ym(b);c[17651]=(c[17651]|0)+1;c[17663]=0}f=a[g+3>>0]|0;i=c[17662]|0;j=i+1|0;c[17662]=j;b=c[17646]|0;i=b+i|0;a[i>>0]=a[i>>0]^f;if(j>>>0>599){c[17662]=0;Ym(b);c[17651]=(c[17651]|0)+1;c[17663]=1}f=Qa()|0;c[g>>2]=f;if(!(c[17645]|0))Ie(50424,50439,1074,50474);c[17655]=(c[17655]|0)+4;c[17654]=(c[17654]|0)+1;j=c[17662]|0;b=j+1|0;c[17662]=b;d=c[17646]|0;j=d+j|0;a[j>>0]=a[j>>0]^f&255;if(b>>>0>599){c[17662]=0;Ym(d);c[17651]=(c[17651]|0)+1;c[17663]=0;b=c[17662]|0;d=c[17646]|0}e=b+1|0;c[17662]=e;j=d+b|0;a[j>>0]=a[j>>0]^f>>>8&255;if(e>>>0>599){c[17662]=0;Ym(d);c[17651]=(c[17651]|0)+1;c[17663]=0;e=c[17662]|0;b=c[17646]|0}else b=d;j=e+1|0;c[17662]=j;i=b+e|0;a[i>>0]=a[i>>0]^f>>>16&255;if(j>>>0>599){c[17662]=0;Ym(b);c[17651]=(c[17651]|0)+1;c[17663]=0}g=a[g+3>>0]|0;i=c[17662]|0;j=i+1|0;c[17662]=j;b=c[17646]|0;i=b+i|0;a[i>>0]=a[i>>0]^g;if(j>>>0<=599){l=h;return}c[17662]=0;Ym(b);c[17651]=(c[17651]|0)+1;c[17663]=1;l=h;return}function bn(a){a=a|0;if(!(c[17665]|0)){c[17665]=mf(a)|0;return}else He(50439,673,50868)}function cn(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;q=l;l=l+80|0;if((l|0)>=(m|0))$(80);p=q+72|0;n=q+64|0;k=q+56|0;j=q+48|0;i=q+40|0;h=q+32|0;g=q+24|0;f=q+16|0;d=q+8|0;b=q;if(!(c[17644]|0))c[17644]=1;a=Vn(12596)|0;if(a|0){c[b>>2]=Pn(a)|0;Me(50172,b)}c[17645]=1;e=c[17646]|0;if(!((c[17665]|0)!=0&(e|0)!=0&(c[17650]|0)!=0)){c[17645]=0;a=Wn(12596)|0;if(!a){l=q;return}else{c[d>>2]=Pn(a)|0;Me(50247,d)}}if(!(c[17666]|0)){c[17645]=0;a=Wn(12596)|0;if(a|0){c[f>>2]=Pn(a)|0;Me(50247,f)}Je(ze(50898)|0,g);l=q;return}a=e;b=c[17648]|0;d=0;while(1){c[b>>2]=(c[a>>2]|0)+-1515870811;d=d+1|0;if((d|0)==150)break;else{a=a+4|0;b=b+4|0}}Ym(e);c[17651]=(c[17651]|0)+1;Ym(c[17648]|0);c[17656]=(c[17656]|0)+1;b=c[17665]|0;c[h>>2]=384;b=Bq(b,65,h)|0;do if((b|0)!=-1){if(_m(b,c[17665]|0,1)|0){Up(b)|0;break}if(yq(b,0)|0){o=ze(50957)|0;k=c[17665]|0;n=dp(c[(zo()|0)>>2]|0)|0;c[j>>2]=k;c[j+4>>2]=n;Je(o,j);Up(b)|0;break}a:while(1){switch(oq(b,c[17648]|0,600)|0){case 600:break a;case -1:break;default:{o=21;break a}}a=zo()|0;if((c[a>>2]|0)!=4){o=23;break}}if((o|0)==21){a=zo()|0;o=23}if((o|0)==23){o=ze(50957)|0;i=c[17665]|0;j=dp(c[a>>2]|0)|0;c[k>>2]=i;c[k+4>>2]=j;Je(o,k)}if(Up(b)|0){o=ze(50979)|0;j=c[17665]|0;k=dp(c[(zo()|0)>>2]|0)|0;c[n>>2]=j;c[n+4>>2]=k;Je(o,n)}}else{o=ze(50934)|0;k=c[17665]|0;n=dp(c[(zo()|0)>>2]|0)|0;c[i>>2]=k;c[i+4>>2]=n;Je(o,i)}while(0);c[17645]=0;a=Wn(12596)|0;if(!a){l=q;return}else{c[p>>2]=Pn(a)|0;Me(50247,p)}}function dn(){var a=0,b=0,d=0,e=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=e+8|0;b=e;if(!(c[17644]|0))c[17644]=1;a=Vn(12596)|0;if(a|0){c[b>>2]=Pn(a)|0;Me(50172,b)}c[17645]=1;if(c[17646]|0)an();c[17645]=0;a=Wn(12596)|0;if(!a){l=e;return}else{c[d>>2]=Pn(a)|0;Me(50247,d)}}function en(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;j=l;l=l+48|0;if((l|0)>=(m|0))$(48);i=j+32|0;h=j+24|0;g=j+16|0;f=j+8|0;d=j;if(!(c[17671]|0)){c[17671]=1;c[17672]=0}if(!b){l=j;return}b=Vn(12644)|0;if(b|0){c[d>>2]=Pn(b)|0;Me(51001,d)}c[17672]=1;if(c[17673]|0){b=c[17674]|0;if(c[b+52>>2]|0)Ie(51037,51065,767,51079);d=c[17675]|0;if(c[d+52>>2]|0)Ie(51104,51065,768,51079);e=c[17676]|0;if(c[e+52>>2]|0)Ie(51134,51065,769,51079);if((a[b>>0]|0)!=17){c[f>>2]=b;Me(51167,f)}if((a[b+16>>0]|0)!=42){c[f>>2]=b;Me(51167,f)}if((a[b+33>>0]|0)!=-119){c[f>>2]=b;Me(51167,f)}if((a[b+50>>0]|0)!=-4){c[f>>2]=b;Me(51167,f)}if((a[d>>0]|0)!=17){c[g>>2]=d;Me(51167,g)}if((a[d+16>>0]|0)!=42){c[g>>2]=d;Me(51167,g)}if((a[d+33>>0]|0)!=-119){c[g>>2]=d;Me(51167,g)}if((a[d+50>>0]|0)!=-4){c[g>>2]=d;Me(51167,g)}if((a[e>>0]|0)!=17){c[h>>2]=e;Me(51167,h)}if((a[e+16>>0]|0)!=42){c[h>>2]=e;Me(51167,h)}if((a[e+33>>0]|0)!=-119){c[h>>2]=e;Me(51167,h)}if((a[e+50>>0]|0)!=-4){c[h>>2]=e;Me(51167,h)}}else{c[17673]=jf(48)|0;h=kf(1,68)|0;c[17674]=h;a[h>>0]=17;a[h+16>>0]=42;a[h+33>>0]=-119;a[h+50>>0]=-4;h=lf(1,68)|0;c[17675]=h;a[h>>0]=17;a[h+16>>0]=42;a[h+33>>0]=-119;a[h+50>>0]=-4;h=lf(1,68)|0;c[17676]=h;a[h>>0]=17;a[h+16>>0]=42;a[h+33>>0]=-119;a[h+50>>0]=-4}c[17672]=0;b=Wn(12644)|0;if(!b){l=j;return}else{c[i>>2]=Pn(b)|0;Me(51213,i)}}function fn(){var a=0,b=0,d=0,e=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=e+8|0;b=e;a=Vn(12644)|0;if(a|0){c[b>>2]=Pn(a)|0;Me(51001,b)}c[17672]=1;Dn(0,0,0,0)|0;c[17672]=0;a=Wn(12644)|0;if(!a){l=e;return}else{c[d>>2]=Pn(a)|0;Me(51213,d)}}function gn(){return}function hn(){return 0}function jn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=h+8|0;f=h;en(1);e=Vn(12644)|0;if(e|0){c[f>>2]=Pn(e)|0;Me(51001,f)}c[17672]=1;if((d|0)==2)kn(a,b,c[17676]|0);else kn(a,b,c[17675]|0);c[17672]=0;a=Wn(12644)|0;if(!a){l=h;return}else{c[g>>2]=Pn(a)|0;Me(51213,g)}}function kn(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;o=l;l=l+32|0;if((l|0)>=(m|0))$(32);n=o+16|0;k=o+8|0;f=o;if(!b)Ie(52320,51065,685,52343);if(!e)Ie(51249,51065,686,52343);if((a[e>>0]|0)!=17){c[f>>2]=e;Me(51167,f)}j=e+16|0;if((a[j>>0]|0)!=42){c[f>>2]=e;Me(51167,f)}h=e+33|0;if((a[h>>0]|0)!=-119){c[f>>2]=e;Me(51167,f)}i=e+50|0;if((a[i>>0]|0)!=-4){c[f>>2]=e;Me(51167,f)}f=e+4|0;do if(!(c[f>>2]|0)){if((c[17674]|0)==(e|0))g=ln(1)|0;else g=ln(0)|0;c[f>>2]=g;if(!g)Me(51311,n);else{c[e+60>>2]=qq()|0;break}}while(0);if(!(a[e+8>>0]&1))mn(e);g=c[e+60>>2]|0;if((g|0)==(qq()|0)?(g=c[e+64>>2]|0,(g|0)==(qq()|0)):0){if(nn(b,d,e)|0)Me(51311,n);if((a[e>>0]|0)!=17){c[k>>2]=e;Me(51167,k)}if((a[j>>0]|0)!=42){c[k>>2]=e;Me(51167,k)}if((a[h>>0]|0)!=-119){c[k>>2]=e;Me(51167,k)}if((a[i>>0]|0)==-4){l=o;return}else{c[k>>2]=e;Me(51167,k)}}kg(51065,714,52343,0,51257);Me(51311,n)}function ln(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;o=l;l=l+16|0;if((l|0)>=(m|0))$(16);n=o+8|0;e=o;k=o+12|0;if(!(c[17672]|0))Ie(51340,51065,596,51674);d=vg(k,7,1,1)|0;if(d|0){c[e>>2]=Pn(d)|0;Le(51692,e);n=0;l=o;return n|0}if(!b)i=pn()|0;else{i=gf(16)|0;kn(i,16,c[17675]|0)}j=Ag(c[k>>2]|0,i,16)|0;if(i&7){b=16;d=i;do{a[d>>0]=0;d=d+1|0;b=b+-1|0}while((b|0)!=0&(d&7|0)!=0);if(b>>>0>=8)f=11}else{b=16;d=i;f=11}if((f|0)==11){f=b+-8|0;g=f&-8;h=g+8|0;e=d;while(1){p=e;c[p>>2]=0;c[p+4>>2]=0;b=b+-8|0;if(b>>>0<=7)break;else e=e+8|0}b=f-g|0;d=d+h|0}if(b|0)while(1){a[d>>0]=0;b=b+-1|0;if(!b)break;else d=d+1|0}cf(i);if(!j){p=c[k>>2]|0;l=o;return p|0}else{c[n>>2]=Pn(j)|0;Le(51735,n);xg(c[k>>2]|0);p=0;l=o;return p|0}return 0}function mn(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;if(!(c[17672]|0))Ie(51340,51065,658,51556);d=b+17|0;if((c[17674]|0)==(b|0)){kn(d,16,c[17675]|0);i=b+8|0;a[i>>0]=a[i>>0]|1;c[b+64>>2]=qq()|0;return}i=pn()|0;e=i;f=d+16|0;do{a[d>>0]=a[e>>0]|0;d=d+1|0;e=e+1|0}while((d|0)<(f|0));if(i&7){e=16;d=i;do{a[d>>0]=0;d=d+1|0;e=e+-1|0}while((e|0)!=0&(d&7|0)!=0);if(e>>>0>=8)g=8}else{d=i;e=16;g=8}if((g|0)==8){g=e+-8|0;h=g&-8;f=d;while(1){j=f;c[j>>2]=0;c[j+4>>2]=0;e=e+-8|0;if(e>>>0<=7)break;else f=f+8|0}d=d+(h+8)|0;e=g-h|0}if(e|0)while(1){a[d>>0]=0;e=e+-1|0;if(!e)break;else d=d+1|0}cf(i);j=b+8|0;a[j>>0]=a[j>>0]|1;c[b+64>>2]=qq()|0;return}function nn(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,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Na=u+35|0;Oa=u+36|0;Pa=u+37|0;Qa=u+38|0;Ra=u+39|0;Sa=u+40|0;Ta=u+41|0;Ua=u+42|0;Va=u+43|0;Wa=u+44|0;Xa=u+45|0;Ya=u+46|0;Za=u+47|0;_a=(u&7|0)==0;p=(v&7|0)==0;q=f+51|0;r=f+34|0;s=f+56|0;t=(w&7|0)==0;a:while(1){while(1){if((c[x>>2]|0)==0?(c[y>>2]|0)>>>0>1e3:0){mn(f);c[y>>2]=0}if(!(c[17672]|0)){db=16;break a}g=c[x>>2]|0;if((g|0)==0|(c[17674]|0)==(f|0)|(c[17675]|0)==(f|0)|(c[17676]|0)==(f|0)){if(!(c[17677]|0)){c[17678]=qq()|0;c[17679]=zq()|0}if(gb(J|0,0)|0){db=22;break a}g=c[z>>2]|0;h=g<<4;i=c[J>>2]|0;if((i|0)==(c[17677]|0)&(h|0)==(c[17680]|0)){j=(b[35680]|0)+1&4095;b[35680]=j}else{b[35680]=0;c[17677]=i;c[17680]=h;j=0}a[U>>0]=i>>>24;a[A>>0]=i>>>16;a[B>>0]=i>>>8;a[C>>0]=i;a[D>>0]=g>>>12;a[E>>0]=g>>>4;a[F>>0]=(j&65535)>>>8&15|h;a[G>>0]=j;g=c[17678]|0;a[H>>0]=g>>>24;a[I>>0]=g>>>16;a[K>>0]=g>>>8;a[L>>0]=g;n=c[17679]|0;a[M>>0]=n>>>24;a[N>>0]=n>>>16;a[O>>0]=n>>>8;a[P>>0]=n;n=n+1|0;c[17679]=n;if(!n)c[17678]=g+1}else{j=U;i=j+15|0;do{a[j>>0]=a[g>>0]|0;j=j+1|0;g=g+1|0}while((j|0)<(i|0));n=c[s>>2]|0;a[M>>0]=n>>>24;a[N>>0]=n>>>16;a[O>>0]=n>>>8;a[P>>0]=n;c[s>>2]=n+1}h=c[ya>>2]|0;g=yg(h,u,16,U,16)|0;if(g|0){db=30;break a}a[v>>0]=a[Q>>0]^a[u>>0];a[T>>0]=a[S>>0]^a[R>>0];a[X>>0]=a[W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}g=g+(k+8)|0;h=j-k|0}if(h|0)while(1){a[g>>0]=0;h=h+-1|0;if(!h)break;else g=g+1|0}if(!p){g=16;h=v;do{a[h>>0]=0;h=h+1|0;g=g+-1|0}while((g|0)!=0&(h&7|0)!=0);if(g>>>0>=8)db=46}else{g=16;h=v;db=46}if((db|0)==46){db=0;j=g+-8|0;k=j&-8;i=h;while(1){n=i;c[n>>2]=0;c[n+4>>2]=0;g=g+-8|0;if(g>>>0<=7)break;else i=i+8|0}g=j-k|0;h=h+(k+8)|0}if(g|0)while(1){a[h>>0]=0;g=g+-1|0;if(!g)break;else h=h+1|0}c[y>>2]=(c[y>>2]|0)+1;if(a[q>>0]|0?!((c[x>>2]|0)==0|(c[17674]|0)==(f|0)|(c[17675]|0)==(f|0)|(c[17676]|0)==(f|0)):0){db=58;break}h=a[o>>0]|0;if(h&2){db=55;break}j=r;g=w;i=j+16|0;do{a[j>>0]=a[g>>0]|0;j=j+1|0;g=g+1|0}while((j|0)<(i|0));a[o>>0]=h|2}if((db|0)==55){db=0;if(!(Tp(r,w,16)|0)){db=56;break}h=e>>>0<16?e:16;j=r;g=w;i=j+16|0;do{a[j>>0]=a[g>>0]|0;j=j+1|0;g=g+1|0}while((j|0)<(i|0));n=h}else if((db|0)==58){db=0;n=e>>>0<16?e:16}cr(d|0,w|0,n|0)|0;if(!t){g=16;h=w;do{a[h>>0]=0;h=h+1|0;g=g+-1|0}while((g|0)!=0&(h&7|0)!=0);if(g>>>0>=8)db=62}else{g=16;h=w;db=62}if((db|0)==62){db=0;i=g+-8|0;j=i&-8;k=h+8|0;while(1){fb=h;c[fb>>2]=0;c[fb+4>>2]=0;g=g+-8|0;if(g>>>0<=7)break;else h=h+8|0}g=i-j|0;h=k+j|0}if(g|0)while(1){a[h>>0]=0;g=g+-1|0;if(!g)break;else h=h+1|0}e=e-n|0;if(!e){d=0;db=68;break}else d=d+n|0}if((db|0)==16)Ie(51340,51065,274,51443);else if((db|0)==22){c[$a>>2]=dp(c[(zo()|0)>>2]|0)|0;Me(51455,$a)}else if((db|0)==30){c[ab>>2]=on(g)|0;Me(51482,ab)}else if((db|0)==32){c[bb>>2]=on(g)|0;Me(51482,bb)}else if((db|0)==35){c[cb>>2]=on(g)|0;Me(51482,cb)}else if((db|0)==56){kg(51065,502,51359,0,51516);fb=-1;l=eb;return fb|0}else if((db|0)==68){l=eb;return d|0}return 0}function on(a){a=a|0;return Pn(a)|0}function pn(){var a=0,b=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);a=b;if(c[17681]|0)Ie(51568,51065,552,51592);c[17681]=jf(16)|0;c[17682]=16;c[17683]=0;if((Dn(4,0,16,2)|0)>=0?(c[17683]|0)==(c[17682]|0):0){a=c[17681]|0;c[17681]=0;l=b;return a|0}cf(c[17681]|0);c[17681]=0;Me(51604,a);return 0}function qn(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;if(!(c[17672]|0))Ie(51340,51065,531,51632);f=c[17681]|0;if(!f)Ie(51651,51065,532,51632);if(!d)return;g=c[17682]|0;e=d;d=c[17683]|0;while(1){e=e+-1|0;if(d>>>0>=g>>>0){e=9;break}i=a[b>>0]|0;h=d;d=d+1|0;c[17683]=d;h=f+h|0;a[h>>0]=a[h>>0]^i;if(!e){e=9;break}else b=b+1|0}if((e|0)==9)return}function rn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=g+8|0;e=g;en(1);d=Vn(12644)|0;if(d|0){c[e>>2]=Pn(d)|0;Me(51001,e)}c[17672]=1;kn(a,b,c[17674]|0);c[17672]=0;a=Wn(12644)|0;if(!a){l=g;return}else{c[f>>2]=Pn(a)|0;Me(51213,f)}}function sn(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;z=l;l=l+48|0;if((l|0)>=(m|0))$(48);y=z+24|0;x=z+16|0;s=z+8|0;f=z;q=z+32|0;Dj(q,8,1);if(!(c[17673]|0))Ie(51413,51065,912,51767);t=kf(1,68)|0;a[t>>0]=17;u=t+16|0;a[u>>0]=42;v=t+33|0;a[v>>0]=-119;w=t+50|0;a[w>>0]=-4;e=Vn(12644)|0;if(e|0){c[f>>2]=Pn(e)|0;Me(51001,f)}c[17672]=1;r=t+4|0;f=t+60|0;g=t+17|0;h=t+8|0;i=t+64|0;j=t+52|0;k=t+56|0;e=0;while(1){if(vg(r,7,1,1)|0){f=52137;e=18;break}if(Ag(c[r>>2]|0,51780+(e*96|0)|0,16)|0){f=52175;e=18;break}c[f>>2]=qq()|0;n=g;o=51780+(e*96|0)+32|0;p=n+16|0;do{a[n>>0]=a[o>>0]|0;n=n+1|0;o=o+1|0}while((n|0)<(p|0));a[h>>0]=a[h>>0]|1;c[i>>2]=qq()|0;c[j>>2]=51780+(e*96|0)+16;c[k>>2]=d[51780+(e*96|0)+29>>0]<<16|d[51780+(e*96|0)+28>>0]<<24|d[51780+(e*96|0)+30>>0]<<8|d[51780+(e*96|0)+31>>0];if(nn(q,16,t)|0){f=52068;e=18;break}if(Tp(q,51780+(e*96|0)+48|0,16)|0){f=52099;e=18;break}if(nn(q,16,t)|0){f=52068;e=18;break}if(Tp(q,51780+(e*96|0)+64|0,16)|0){f=52099;e=18;break}if(nn(q,16,t)|0){f=52068;e=18;break}if(Tp(q,51780+(e*96|0)+80|0,16)|0){f=52099;e=18;break}p=c[f>>2]|0;if((p|0)!=(qq()|0)){f=52201;e=18;break}p=c[i>>2]|0;if((p|0)!=(qq()|0)){f=52201;e=18;break}xg(c[r>>2]|0);c[r>>2]=0;a[h>>0]=a[h>>0]&-2;if((a[t>>0]|0)!=17){e=17;break}if((a[u>>0]|0)!=42){e=17;break}if((a[v>>0]|0)!=-119){e=17;break}e=e+1|0;if((a[w>>0]|0)!=-4){e=17;break}if(e>>>0>=3){f=0;e=18;break}}if((e|0)==17){c[s>>2]=t;Me(51167,s)}else if((e|0)==18){c[17672]=0;e=Wn(12644)|0;if(e|0){c[x>>2]=Pn(e)|0;Me(51213,x)}xg(c[r>>2]|0);if((a[t>>0]|0)!=17){c[y>>2]=t;Me(51167,y)}if((a[u>>0]|0)!=42){c[y>>2]=t;Me(51167,y)}if((a[v>>0]|0)!=-119){c[y>>2]=t;Me(51167,y)}if((a[w>>0]|0)!=-4){c[y>>2]=t;Me(51167,y)}cf(t);e=(f|0)!=0;if(!((b|0)!=0&e)){b=e?16777266:0;l=z;return b|0}zb[b&1](52223,0,52230,f);b=e?16777266:0;l=z;return b|0}return 0}function tn(b,e,f,g,h,i,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+16|0;if((l|0)>=(m|0))$(16);t=v;en(1);if((b|0)==0|(f|0)==0|(g|0)!=16|(h|0)==0|(i|0)!=16|(j|0)==0|(k|0)!=16){u=45;l=v;return u|0}r=df(1,84)|0;if(!r){u=Sn()|0;l=v;return u|0}a[r>>0]=17;o=r+16|0;a[o>>0]=42;p=r+33|0;a[p>>0]=-119;q=r+50|0;a[q>>0]=-4;i=r+4|0;g=vg(i,7,1,1)|0;if(!g){g=Ag(c[i>>2]|0,f,16)|0;if(!g){c[r+60>>2]=qq()|0;f=r+17|0;i=h;k=f+16|0;do{a[f>>0]=a[i>>0]|0;f=f+1|0;i=i+1|0}while((f|0)<(k|0));g=r+8|0;a[g>>0]=a[g>>0]|1;c[r+64>>2]=qq()|0;g=r+68|0;f=g;i=j;k=f+16|0;do{a[f>>0]=a[i>>0]|0;f=f+1|0;i=i+1|0}while((f|0)<(k|0));c[r+52>>2]=g;c[r+56>>2]=d[r+81>>0]<<16|d[r+80>>0]<<24|d[r+82>>0]<<8|d[r+83>>0];if(e&1|0)a[r+51>>0]=1;if((a[r>>0]|0)!=17){c[t>>2]=r;Me(51167,t)}if((a[o>>0]|0)!=42){c[t>>2]=r;Me(51167,t)}if((a[p>>0]|0)!=-119){c[t>>2]=r;Me(51167,t)}if((a[q>>0]|0)==-4){n=0;s=r}else{c[t>>2]=r;Me(51167,t)}}else{n=g;u=13}}else{n=g;u=13}if((u|0)==13){xg(c[i>>2]|0);cf(r);s=0}c[b>>2]=s;u=n;l=v;return u|0}function un(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=g+8|0;e=g;if((a|0)==0|(b|0)==0|(d|0)!=16){f=45;l=g;return f|0}d=Vn(12644)|0;if(d|0){c[e>>2]=Pn(d)|0;Me(51001,e)}c[17672]=1;kn(b,16,a);c[17672]=0;d=Wn(12644)|0;if(!d){f=0;l=g;return f|0}else{c[f>>2]=Pn(d)|0;Me(51213,f)}return 0}function vn(a){a=a|0;if(!a)return;xg(c[a+4>>2]|0);cf(a);return}function wn(a){a=a|0;if(c[17684]|0)return;c[17684]=1;c[17685]=0;return}function xn(){var a=0,b=0,d=0,e=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=e+8|0;b=e;a=Vn(12688)|0;if(a|0){c[b>>2]=Pn(a)|0;Me(52234,b)}c[17685]=1;Dn(0,0,0,0)|0;c[17685]=0;a=Wn(12688)|0;if(!a){l=e;return}else{c[d>>2]=Pn(a)|0;Me(52277,d)}}function yn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=i+16|0;g=i+8|0;f=i;if(!(c[17684]|0)){c[17684]=1;c[17685]=0}e=Vn(12688)|0;if(e|0){c[f>>2]=Pn(e)|0;Me(52234,f)}c[17685]=1;if(!a)Ie(52320,52327,144,52343);c[17686]=a;c[17687]=b;c[17688]=0;a=Dn(5,0,b,(d|0)==2?2:1)|0;if((a|0)<0){c[g>>2]=a;Me(52354,g)}if((c[17688]|0)!=(c[17687]|0)){c[g>>2]=a;Me(52354,g)}c[17685]=0;a=Wn(12688)|0;if(!a){l=i;return}else{c[h>>2]=Pn(a)|0;Me(52277,h)}}function zn(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;if(!(c[17685]|0))Ie(52400,52327,124,52421);f=c[17686]|0;if(!f)Ie(52429,52327,125,52421);if(!d)return;g=c[17687]|0;e=d;d=c[17688]|0;while(1){e=e+-1|0;if(d>>>0>=g>>>0){e=9;break}i=a[b>>0]|0;h=d;d=d+1|0;c[17688]=d;a[f+h>>0]=i;if(!e){e=9;break}else b=b+1|0}if((e|0)==9)return}function An(){return c[17689]|0}function Bn(a,b){a=a|0;b=b|0;return}function Cn(a,b){a=a|0;b=b|0;return 0}function Dn(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;F=l;l=l+944|0;if((l|0)>=(m|0))$(944);C=F+24|0;r=F+16|0;B=F+8|0;A=F;h=F+168|0;y=F+40|0;z=F+32|0;if(!b){g=c[3183]|0;if((g|0)!=-1){Up(g)|0;c[3183]=-1}g=c[3184]|0;if((g|0)==-1){l=F;return 0}Up(g)|0;c[3184]=-1;l=F;return 0}k=Cn(b,e)|0;x=f>>>1;k=f-(f>>>0>1?(k>>>0>x>>>0?x:k):0)|0;if((g|0)>1){g=c[3183]|0;if((g|0)==-1){g=En(52444,(d[71846]|0)&1)|0;c[3183]=g;a[71846]=d[71846]|0|1}}else{g=c[3184]|0;if((g|0)==-1){g=En(52456,(d[71846]|0)&2)|0;c[3184]=g;a[71846]=d[71846]|0|2}}a:do if(!k)E=0;else{u=1<<(g&31);v=y+(g>>>5<<2)|0;w=z+4|0;x=g+1|0;if((g|0)<1024){i=0;j=0;s=0;t=k}else{n=0;o=0;q=k;b:while(1){k=f-q|0;if((n|0)==0&(o|0)==(k|0))n=0;else{pj(52469,88,k,f);n=1;o=k}p=q>>>0<768?q:768;while(1){k=pq(g,h,p)|0;if((k|0)>-1&k>>>0>p>>>0){c[r>>2]=k;Le(52502,r);k=p}if((k|0)!=-1)break;k=c[(zo()|0)>>2]|0;if((k|0)!=4)break b}ub[b&7](h,k,e);q=q-k|0;if(!q){E=n;break a}}r=dp(k)|0;c[C>>2]=r;Me(52540,C)}c:while(1){k=f-t|0;if((j|0)==0&(s|0)==(k|0)){j=0;o=s}else{pj(52469,88,k,f);j=1;o=k}k=y;n=k+128|0;do{c[k>>2]=0;k=k+4|0}while((k|0)<(n|0));c[v>>2]=c[v>>2]|u;c[z>>2]=i;k=(i|0)!=0;c[w>>2]=k?0:1e5;switch(nq(x,y,0,0,z)|0){case 0:{n=t;i=3;j=1;break}case -1:{c[A>>2]=dp(c[(zo()|0)>>2]|0)|0;Le(52482,A);n=t;i=k?i:1;break}default:{n=t>>>0<768?t:768;while(1){k=pq(g,h,n)|0;if((k|0)>-1&k>>>0>n>>>0){c[B>>2]=k;Le(52502,B);k=n}if((k|0)!=-1)break;k=c[(zo()|0)>>2]|0;if((k|0)!=4)break c}ub[b&7](h,k,e);n=t-k|0}}if(!n){E=j;break a}else{s=o;t=n}}B=dp(k)|0;c[C>>2]=B;Me(52540,C)}while(0);if(h&7){g=768;do{a[h>>0]=0;h=h+1|0;g=g+-1|0}while((g|0)!=0&(h&7|0)!=0);if(g>>>0>=8)D=36}else{g=768;D=36}if((D|0)==36){j=g+-8|0;k=j&-8;n=k+8|0;i=h;while(1){D=i;c[D>>2]=0;c[D+4>>2]=0;g=g+-8|0;if(g>>>0<=7)break;else i=i+8|0}g=j-k|0;h=h+n|0}if(g|0)while(1){a[h>>0]=0;g=g+-1|0;if(!g)break;else h=h+1|0}if(!E){l=F;return 0}pj(52469,88,f,f);l=F;return 0}function En(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;o=l;l=l+64|0;if((l|0)>=(m|0))$(64);n=o+48|0;k=o+40|0;j=o+32|0;g=o+24|0;i=o+16|0;h=o+8|0;e=o;f=(b|0)!=0;do if(f){pj(52573,88,1,0);b=Bq(a,0,h)|0;e=(b|0)==-1;if(f&e){b=h+4|0;do{c[h>>2]=5;c[b>>2]=0;pj(52589,88,0,5);nq(0,0,0,0,h)|0;d=Bq(a,0,i)|0}while((d|0)==-1)}else{if(!e){d=b;break}i=zo()|0;i=c[i>>2]|0;i=dp(i)|0;c[g>>2]=a;a=g+4|0;c[a>>2]=i;Me(52605,g)}}else{b=Bq(a,0,e)|0;if((b|0)==-1){i=zo()|0;i=c[i>>2]|0;i=dp(i)|0;c[g>>2]=a;a=g+4|0;c[a>>2]=i;Me(52605,g)}else d=b}while(0);c[j>>2]=0;b=jq(d,1,j)|0;if((b|0)>=0?(c[k>>2]=b|1,(jq(d,2,k)|0)==0):0){l=o;return d|0}k=dp(c[(zo()|0)>>2]|0)|0;c[n>>2]=d;c[n+4>>2]=k;Le(52624,n);l=o;return d|0}function Fn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;h=a+(d<<2)|0;f=b+(d<<2)|0;g=e&65535;e=e>>>16;b=0;a=0-d|0;do{m=c[f+(a<<2)>>2]|0;l=m&65535;m=m>>>16;k=S(l,g)|0;n=S(m,g)|0;m=S(m,e)|0;l=n+(S(l,e)|0)+(k>>>16)|0;k=(l<<16|k&65535)+b|0;d=h+(a<<2)|0;j=c[d>>2]|0;i=k+j|0;b=(l>>>0>>0?m+65536|0:m)+(l>>>16)+(k>>>0>>0&1)+(i>>>0>>0&1)|0;c[d>>2]=i;a=a+1|0}while((a|0)!=0);return b|0}function Gn(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;q=l;l=l+48|0;if((l|0)>=(m|0))$(48);k=q+32|0;j=q+24|0;i=q+16|0;h=q+8|0;f=q;p=nl(c[b+4>>2]|0)|0;g=lk(b)|0;o=(g+7|0)>>>3;if(nf(1)|0){c[f>>2]=g;c[f+4>>2]=e;Oe(52663,f)}n=g+-1|0;if(g>>>0<32){f=0;while(1){cf(f);f=Cj(o,e)|0;Rk(p,f,o,0);k=(mk(p,n)|0)==0;ok(p,n);if(k)qk(p,n);if((wk(p,b)|0)>=0){if(!(nf(1)|0))continue;Oe(52710,h);continue}if((vk(p,0)|0)>0)break;if(!(nf(1)|0))continue;Oe(52732,i)}cf(f);l=q;return p|0}else f=0;while(1){if(!f){cf(0);f=Cj(o,e)|0}else{i=Cj(4,e)|0;h=d[i>>0]|d[i+1>>0]<<8|d[i+2>>0]<<16|d[i+3>>0]<<24;a[f>>0]=h;a[f+1>>0]=h>>8;a[f+2>>0]=h>>16;a[f+3>>0]=h>>24;cf(i)}Rk(p,f,o,0);i=(mk(p,n)|0)==0;ok(p,n);if(i)qk(p,n);if((wk(p,b)|0)>=0){if(!(nf(1)|0))continue;Oe(52710,j);continue}if((vk(p,0)|0)>0)break;if(!(nf(1)|0))continue;Oe(52732,k)}cf(f);l=q;return p|0}function Hn(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+32|0;if((l|0)>=(m|0))$(32);j=v+16|0;t=v+12|0;u=v+8|0;q=v+4|0;r=v;c[t>>2]=0;c[u>>2]=0;c[q>>2]=0;c[r>>2]=0;o=lk(b)|0;if(!((f|0)!=0&((e|0)!=0&(o|0)!=0))){a=32816;l=v;return a|0}if((sh(g)|0)!=(f|0)){a=5;l=v;return a|0}s=_e(f)|0;a:do if(s){Yq(s|0,1,f|0)|0;p=df(1,f)|0;if(!p){g=0;d=0;i=Sn()|0;break}k=(o+7|0)>>>3;i=In(t,d,k)|0;if(!i){n=f<<3;i=Sk(j,5,e,f&536870911,0)|0;if(i|0){g=0;d=p;break}if(n>>>0>o>>>0){e=c[j>>2]|0;sk(e,e,n-o|0)}if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r(s|0,ph(c[q>>2]|0,0)|0,f|0)|0}if(!e){d=p;i=0;break a}i=nh(c[q>>2]|0,p,f)|0;if(i|0){d=p;break a}lh(c[q>>2]|0,s,f);lh(c[q>>2]|0,71847,1);cr(p|0,ph(c[q>>2]|0,0)|0,f|0)|0;i=nh(c[q>>2]|0,p,f)|0;if(i|0){d=p;break a}lh(c[q>>2]|0,s,f);cr(s|0,ph(c[q>>2]|0,0)|0,f|0)|0;e=e+-1|0}}else{g=0;d=p}}else{g=0;d=p}}else{g=0;d=p}}else{g=0;d=p}}else{g=0;d=p}}else{g=0;d=p}}else{g=0;d=p}}else{g=0;d=0;i=Sn()|0}while(0);cf(g);kh(c[q>>2]|0);cf(c[u>>2]|0);cf(c[t>>2]|0);cf(d);cf(s);d=c[r>>2]|0;if(!i){c[a>>2]=d;a=0;l=v;return a|0}else{tl(d);a=i;l=v;return a|0}return 0}function In(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=h;e=Tk(5,0,0,g,b)|0;if(e|0){a=e;l=h;return a|0}e=c[g>>2]|0;if(e>>>0>d>>>0){a=67;l=h;return a|0}f=e>>>0>>0?d-e|0:0;e=f+e|0;if((b|0)!=0?(c[b+12>>2]&1|0)!=0:0)d=$e(e)|0;else d=_e(e)|0;if(!d){a=Sn()|0;l=h;return a|0}if(f|0)Yq(d|0,0,f|0)|0;e=c[g>>2]|0;c[g>>2]=e+f;e=Tk(5,d+f|0,e,0,b)|0;if(!e){c[a>>2]=d;a=0;l=h;return a|0}else{cf(d);a=e;l=h;return a|0}return 0}function Jn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=g+4|0;f=g;if((a|0)!=0?(c[a+12>>2]&4|0)!=0:0){a=wl(a,e)|0;a=Sk(f,5,a,((c[e>>2]|0)+7|0)>>>3,0)|0;if(a|0){f=a;l=g;return f|0}a=c[e>>2]|0;if(a>>>0>d>>>0){e=c[f>>2]|0;sk(e,e,a-d|0)}}else c[f>>2]=a;c[b>>2]=c[f>>2];f=0;l=g;return f|0}function Kn(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;A=l;l=l+32|0;if((l|0)>=(m|0))$(32);v=A;w=A+24|0;x=A+12|0;y=A+8|0;u=A+4|0;if(nf(1)|0)Se(52754,a);o=b+32|0;h=Jn(a,y,lk(c[o>>2]|0)|0)|0;if(h|0){a=h;l=A;return a|0}c[w>>2]=0;p=ll(0)|0;q=ll(0)|0;r=ll(0)|0;s=ll(0)|0;Pj(x);t=Uj(c[b>>2]|0,c[b+4>>2]|0,0,c[b+8>>2]|0,c[b+12>>2]|0,c[b+16>>2]|0)|0;n=(f&2|0)!=0&(g|0)!=0;i=(a|0)==0;j=a+12|0;k=b+56|0;b=b+20|0;h=0;a:while(1){if(n)do{tl(c[w>>2]|0);c[w>>2]=0;if(i){f=70;break a}if(!(c[j>>2]&4)){f=70;break a}f=wl(a,u)|0;f=Hn(w,c[o>>2]|0,c[k>>2]|0,f,((c[u>>2]|0)+7|0)>>>3,g,h)|0;if(f|0)break a;h=h+1|0;ck(x,c[w>>2]|0,b,t);if(Nj(s,0,x,t)|0){z=12;break a}Gk(d,s,c[o>>2]|0)}while((vk(d,0)|0)==0);else do{tl(c[w>>2]|0);c[w>>2]=0;f=Gn(c[o>>2]|0,1)|0;c[w>>2]=f;ck(x,f,b,t);if(Nj(s,0,x,t)|0){z=12;break a}Gk(d,s,c[o>>2]|0)}while(!(vk(d,0)|0));Lk(p,c[k>>2]|0,d,c[o>>2]|0);ik(q,c[y>>2]|0,p,c[o>>2]|0);Fk(r,c[w>>2]|0,c[o>>2]|0)|0;Lk(e,r,q,c[o>>2]|0);if(vk(e,0)|0){z=16;break}}if((z|0)==12)if(!(nf(1)|0))f=8;else{Oe(52831,v);f=8}else if((z|0)==16)if(!(nf(1)|0))f=0;else{Se(52772,d);Se(52793,e);f=0}Yj(t);Rj(x);tl(s);tl(r);tl(q);tl(p);tl(c[w>>2]|0);h=c[y>>2]|0;if((h|0)==(a|0)){a=f;l=A;return a|0}tl(h);a=f;l=A;return a|0}function Ln(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=l;l=l+64|0;if((l|0)>=(m|0))$(64);o=t+8|0;n=t;p=t+48|0;q=t+36|0;r=t+24|0;s=t+12|0;if((vk(d,0)|0)<=0){a=8;l=t;return a|0}g=b+32|0;if((wk(d,c[g>>2]|0)|0)>=0){a=8;l=t;return a|0}if((vk(e,0)|0)<=0){a=8;l=t;return a|0}if((wk(e,c[g>>2]|0)|0)>=0){a=8;l=t;return a|0}f=Jn(a,p,lk(c[g>>2]|0)|0)|0;if(f|0){a=f;l=t;return a|0}f=ll(0)|0;h=ll(0)|0;i=ll(0)|0;j=ll(0)|0;Pj(q);Pj(r);Pj(s);k=Uj(c[b>>2]|0,c[b+4>>2]|0,0,c[b+8>>2]|0,c[b+12>>2]|0,c[b+16>>2]|0)|0;Fk(f,e,c[g>>2]|0)|0;Lk(h,c[p>>2]|0,f,c[g>>2]|0);ck(r,h,b+20|0,k);Lk(i,d,f,c[g>>2]|0);ck(s,i,b+44|0,k);ak(q,r,s,k);do if(!(vk(c[q+8>>2]|0,0)|0))if(!(nf(1)|0))b=8;else{Oe(52915,n);b=8}else{if(Nj(j,0,q,k)|0){if(!(nf(1)|0)){b=8;break}Oe(52937,o);b=8;break}Gk(j,j,c[g>>2]|0);if(wk(j,d)|0)if(!(nf(1)|0))b=8;else{Se(52983,j);Se(52990,d);Se(52997,e);b=8}else b=0}while(0);Yj(k);Rj(s);Rj(r);Rj(q);tl(j);tl(i);tl(h);tl(f);f=c[p>>2]|0;if((f|0)==(a|0)){a=b;l=t;return a|0}tl(f);a=b;l=t;return a|0}function Mn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+32|0;if((l|0)>=(m|0))$(32);s=v;t=v+12|0;u=v+8|0;g=v+4|0;if(nf(1)|0)Se(52814,a);r=b+32|0;h=lk(c[r>>2]|0)|0;if((a|0)!=0?(c[a+12>>2]&4|0)!=0:0){f=wl(a,g)|0;f=Sk(u,5,f,((c[g>>2]|0)+7|0)>>>3,0)|0;if(f|0){a=f;l=v;return a|0}f=c[g>>2]|0;if(f>>>0>h>>>0){q=c[u>>2]|0;sk(q,q,f-h|0)}}else c[u>>2]=a;j=ll(0)|0;k=ll(0)|0;n=ll(0)|0;o=ll(0)|0;p=ll(0)|0;Pj(t);q=Uj(c[b>>2]|0,c[b+4>>2]|0,0,c[b+8>>2]|0,c[b+12>>2]|0,c[b+16>>2]|0)|0;Gk(o,a,c[r>>2]|0);if(!(vk(o,0)|0))El(o,1)|0;i=b+20|0;g=b+56|0;f=0;a:while(1){h=f;do{tl(h);h=Gn(c[r>>2]|0,1)|0;ck(t,h,i,q);if(Nj(p,0,t,q)|0){f=14;break a}Gk(d,p,c[r>>2]|0)}while(!(vk(d,0)|0));Lk(j,c[g>>2]|0,d,c[r>>2]|0);Lk(n,h,o,c[r>>2]|0);ik(e,n,j,c[r>>2]|0);if(!(vk(e,0)|0))f=h;else{f=18;break}}if((f|0)==14)if(!(nf(1)|0))g=8;else{Oe(52831,s);g=8}else if((f|0)==18)if(!(nf(1)|0))g=0;else{Se(52875,d);Se(52895,e);g=0}Yj(q);Rj(t);tl(p);tl(o);tl(n);tl(k);tl(j);tl(h);f=c[u>>2]|0;if((f|0)==(a|0)){a=g;l=v;return a|0}tl(f);a=g;l=v;return a|0}function Nn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;x=l;l=l+64|0;if((l|0)>=(m|0))$(64);j=x+24|0;i=x+16|0;h=x+8|0;g=x;u=x+52|0;v=x+40|0;w=x+28|0;if((vk(d,0)|0)<=0){w=8;l=x;return w|0}f=b+32|0;if((wk(d,c[f>>2]|0)|0)>=0){w=8;l=x;return w|0}if((vk(e,0)|0)<=0){w=8;l=x;return w|0}if((wk(e,c[f>>2]|0)|0)>=0){w=8;l=x;return w|0}k=ll(0)|0;n=ll(0)|0;o=ll(0)|0;p=ll(0)|0;q=ll(0)|0;r=ll(0)|0;s=ll(0)|0;Pj(u);Pj(v);Pj(w);t=Uj(c[b>>2]|0,c[b+4>>2]|0,0,c[b+8>>2]|0,c[b+12>>2]|0,c[b+16>>2]|0)|0;Gk(n,a,c[f>>2]|0);if(!(vk(n,0)|0))El(n,1)|0;Fk(q,n,c[f>>2]|0)|0;Lk(o,e,q,c[f>>2]|0);Lk(r,d,q,c[f>>2]|0);jk(p,s,r,c[f>>2]|0);ck(v,o,b+20|0,t);ck(w,p,b+44|0,t);ak(u,v,w,t);do if(!(vk(c[u+8>>2]|0,0)|0))if(!(nf(1)|0))a=8;else{Oe(52915,g);a=8}else{if(Nj(k,0,u,t)|0){if(!(nf(1)|0)){a=8;break}Oe(52937,h);a=8;break}Gk(k,k,c[f>>2]|0);h=(wk(k,d)|0)==0;a=(nf(1)|0)!=0;if(h){if(!a){a=0;break}Oe(53030,j);a=0;break}else{if(!a){a=8;break}Se(52983,k);Se(52990,d);Se(52997,e);Oe(53004,i);a=8;break}}while(0);Yj(t);Rj(w);Rj(v);Rj(u);tl(s);tl(r);tl(q);tl(p);tl(o);tl(k);tl(n);w=a;l=x;return w|0}function On(){return ao()|0}function Pn(a){a=a|0;return ho(a)|0}function Qn(a){a=a|0;return jo(a)|0}function Rn(a){a=a|0;return io(a)|0}function Sn(){return ko()|0}function Tn(a){a=a|0;bo(a);return}function Un(a){a=a|0;return Yn(a)|0}function Vn(a){a=a|0;return Zn(a)|0}function Wn(a){a=a|0;return _n(a)|0}function Xn(a){a=a|0;return $n(a)|0}function Yn(a){a=a|0;switch(c[a>>2]|0){case 0:{c[a>>2]=1;break}case 1:break;default:Da(53052,53072,114,53085)}a=xa(a+4|0,0)|0;if(!a){a=0;return a|0}a=Qn(a)|0;return a|0}function Zn(a){a=a|0;if((c[a>>2]|0)!=1)Da(53052,53072,114,53085);a=Zq(a+4|0)|0;if(!a){a=0;return a|0}a=Qn(a)|0;return a|0}function _n(a){a=a|0;if((c[a>>2]|0)!=1)Da(53052,53072,114,53085);a=hr(a+4|0)|0;if(!a){a=0;return a|0}a=Qn(a)|0;return a|0}function $n(a){a=a|0;var b=0,d=0;if((c[a>>2]|0)!=1)Da(53052,53072,114,53085);b=a+4|0;d=Ua(b|0)|0;if(!d){c[a>>2]=1;a=b+40|0;do{c[b>>2]=0;b=b+4|0}while((b|0)<(a|0));d=0;return d|0}else{d=Qn(d)|0;return d|0}return 0}function ao(){co()|0;return 0}function bo(a){a=a|0;c[(zo()|0)>>2]=a;return}function co(){if(c[17690]|0)return 0;c[17690]=1;ib(3)|0;return 0}function eo(){fo(0)|0;c[17691]=0;c[17692]=0;return}function fo(b){b=b|0;var d=0,e=0,f=0,g=0;if(b|0){e=b+36|0;d=c[e>>2]|0;if(!(a[d+1140>>0]&32))Zn(d+1040|0)|0;if(!(c[b>>2]&65536)){c[b+12>>2]=0;c[b+16>>2]=0;c[b+32>>2]=0;b=0}else b=go(b)|0;d=c[e>>2]|0;if(a[d+1140>>0]&32){g=b;g=(g|0)!=0;g=g<<31>>31;return g|0}_n(d+1040|0)|0;g=b;g=(g|0)!=0;g=g<<31>>31;return g|0}Zn(12740)|0;b=c[17693]|0;if(!b)d=0;else{d=0;do{g=b+4|0;f=c[g>>2]|0;if(f){e=c[f+36>>2]|0;if(!(a[e+1140>>0]&32)){Zn(e+1040|0)|0;f=c[g>>2]|0}if(!(c[f>>2]&65536)){c[f+12>>2]=0;c[f+16>>2]=0;c[f+32>>2]=0;e=0}else{e=go(f)|0;f=c[g>>2]|0}d=e|d;e=c[f+36>>2]|0;if(!(a[e+1140>>0]&32))_n(e+1040|0)|0}b=c[b>>2]|0}while((b|0)!=0)}_n(12740)|0;g=d;g=(g|0)!=0;g=g<<31>>31;return g|0}function go(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;j=b+36|0;d=c[j>>2]|0;h=c[d+1108>>2]|0;if(!(c[b>>2]&65536))Da(53101,53123,1654,53133);i=b+16|0;e=c[i>>2]|0;if(!e){j=0;return j|0}do if(h){g=b+4|0;a:do if((e|0)>0){d=0;f=e;while(1){e=pb[h&63](c[(c[j>>2]|0)+1084>>2]|0,(c[g>>2]|0)+d|0,f)|0;f=(e|0)==-1;d=(f?0:e)+d|0;e=c[i>>2]|0;if(f){f=d;g=-1;break a}f=e-d|0;if((f|0)<=0){f=d;g=0;break}}}else{f=0;g=0}while(0);d=b+20|0;c[d>>2]=(c[d>>2]|0)+f;if((e|0)==(f|0)){b=c[j>>2]|0;f=b+1100|0;c[f>>2]=(c[f>>2]|0)+e;c[i>>2]=0;c[d>>2]=0;pb[h&63](c[b+1084>>2]|0,0,0)|0}if(!g){j=0;return j|0}else{e=-1;d=c[j>>2]|0;break}}else e=95;while(0);j=d+1136|0;a[j>>0]=a[j>>0]|1;j=e;return j|0}function ho(a){a=a|0;var b=0,d=0;b=a&65535;a:do if(!(a&32768)){if(b>>>0>=214){if((b+-222|0)>>>0<33){b=b+-8|0;break}if((b+-257|0)>>>0<15){b=b+-10|0;break}if((b+-273|0)>>>0<9){b=b+-11|0;break}if((b+-721|0)>>>0<9){b=b+-450|0;break}if((b+-750|0)>>>0<3){b=b+-470|0;break}if((b+-754|0)>>>0<29){b=b+-471|0;break}if((b+-784|0)>>>0<6){b=b+-472|0;break}if((b+-800|0)>>>0<5){b=b+-482|0;break}if((b+-815|0)>>>0<8){b=b+-492|0;break}if((a&65528|0)==832){b=b+-501|0;break}switch((a&65535)<<16>>16){case 844:{b=339;break a}case 848:{b=340;break a}default:{}}if((b+-881|0)>>>0<11){b=b+-540|0;break}if((a&65520|0)==1024)b=b+-672|0;else d=31}}else{b=Rn(b)|0;if(!b){b=16382;d=31}else{d=dp(b)|0;return d|0}}while(0);if((d|0)==31)b=(b+-16381|0)>>>0<3?b+-16013|0:371;d=53142+(c[12784+(b<<2)>>2]|0)|0;return d|0}function io(a){a=a|0;var b=0;if((a&32768|0)!=0?(b=a&-32769,b>>>0<141):0)a=c[14272+(b<<2)>>2]|0;else a=0;return a|0}function jo(a){a=a|0;var b=0;if(!a){a=0;return a|0}b=a+-1|0;do if(b>>>0>=11)if((a+-11|0)>>>0>=25){if((a+-35|0)>>>0<6){b=a+1|0;break}if((a+-42|0)>>>0>=16)if((a+-59|0)>>>0<37){if((b|0)<0)b=16382;else break;return b|0}else{if((a+-95|0)>>>0<31){b=a;break}else b=16382;return b|0}else b=a}else b=a;while(0);a=c[14836+(b<<2)>>2]|32768;return a|0}function ko(){var a=0,b=0;b=c[(zo()|0)>>2]|0;if(!b){b=16381;return b|0}a=b+-1|0;do if(a>>>0>=11)if((b+-11|0)>>>0>=25){if((b+-35|0)>>>0<6){a=b+1|0;break}if((b+-42|0)>>>0>=16)if((b+-59|0)>>>0<37){if((a|0)<0)a=16382;else break;return a|0}else{if((b+-95|0)>>>0<31){a=b;break}else a=16382;return a|0}else a=b}else a=b;while(0);b=c[14836+(a<<2)>>2]|32768;return b|0}function lo(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=d;h=vd(c[h>>2]|0,c[h+4>>2]|0)|0;e=D;f=b;g=f;a[g>>0]=h;a[g+1>>0]=h>>8;a[g+2>>0]=h>>16;a[g+3>>0]=h>>24;f=f+4|0;a[f>>0]=e;a[f+1>>0]=e>>8;a[f+2>>0]=e>>16;a[f+3>>0]=e>>24;f=Xp(c[d+8>>2]|0)|0;e=b+8|0;a[e>>0]=f;a[e+1>>0]=f>>8;a[e+2>>0]=f>>16;a[e+3>>0]=f>>24;e=b+12|0;b=d+12|0;d=e+12|0;do{a[e>>0]=a[b>>0]|0;e=e+1|0;b=b+1|0}while((e|0)<(d|0));return}function mo(b,e){b=b|0;e=e|0;var f=0,g=0;g=e;f=g;g=g+4|0;g=wd(d[f>>0]|d[f+1>>0]<<8|d[f+2>>0]<<16|d[f+3>>0]<<24,d[g>>0]|d[g+1>>0]<<8|d[g+2>>0]<<16|d[g+3>>0]<<24)|0;f=b;c[f>>2]=g;c[f+4>>2]=D;f=e+8|0;c[b+8>>2]=Yp(d[f>>0]|d[f+1>>0]<<8|d[f+2>>0]<<16|d[f+3>>0]<<24)|0;f=b+12|0;b=e+12|0;e=f+12|0;do{a[f>>0]=a[b>>0]|0;f=f+1|0;b=b+1|0}while((f|0)<(e|0));return}function no(a,b){a=a|0;b=b|0;var d=0;d=Fo(a)|0;if(d>>>0>11){d=-1;return d|0};c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;cr(b+12|0,a|0,d|0)|0;d=1;return d|0}function oo(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+32|0;if((l|0)>=(m|0))$(32);t=v+16|0;k=v+8|0;g=v;f=b+12|0;if((a[f>>0]|0?(e=d+12|0,a[e>>0]|0):0)?(Op(f,e)|0)==0:0){i=b;h=c[i>>2]|0;i=c[i+4>>2]|0;g=c[b+8>>2]|0;f=d;j=c[f>>2]|0;f=c[f+4>>2]|0;e=c[d+8>>2]|0;a:do if((h|0)==-1&(i|0)==-1)u=14;else{b=i;while(1){if(g>>>0<=99999999){o=g;p=h;r=b;break a}g=g+-1e8|0;h=_q(h|0,b|0,1,0)|0;b=D;if((h|0)==-1&(b|0)==-1){u=14;break}}}while(0);if((u|0)==14)if(g>>>0>99999999){if((c[3836]|0)==-1)c[3836]=Wb(1,0,61157,61166,353)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[3836]|0))Vb();c[k>>2]=61157;c[k+4>>2]=353;Zb(1,61295,k);Vb()}else{o=g;p=-1;r=-1}b:do if((j|0)==-1&(f|0)==-1)u=25;else{g=j;while(1){if(e>>>0<=99999999){n=e;q=g;s=f;break b}e=e+-1e8|0;g=_q(g|0,f|0,1,0)|0;f=D;if((g|0)==-1&(f|0)==-1){u=25;break}}}while(0);if((u|0)==25)if(e>>>0>99999999){if((c[3837]|0)==-1)c[3837]=Wb(1,0,61157,61166,355)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[3837]|0))Vb();c[t>>2]=61157;c[t+4>>2]=355;Zb(1,61295,t);Vb()}else{n=e;q=-1;s=-1}if(!((p|0)==(q|0)&(r|0)==(s|0))){u=r>>>0>>0|(r|0)==(s|0)&p>>>0>>0?-1:1;l=v;return u|0}if(o>>>0>>0){u=-1;l=v;return u|0}u=o>>>0>n>>>0&1;l=v;return u|0}if((c[3835]|0)==-1)c[3835]=Wb(1,0,61157,61166,349)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[3835]|0))Vb();c[g>>2]=61157;c[g+4>>2]=349;Zb(1,61295,g);Vb();return 0}function po(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;if(!(a[b+12>>0]|0)){b=-1;return b|0}h=b+8|0;e=b;g=c[e>>2]|0;e=c[e+4>>2]|0;f=c[h>>2]|0;a:do if((g|0)==-1&(e|0)==-1){e=0;d=f}else{d=0;while(1){if(f>>>0<=99999999)break;f=f+-1e8|0;c[h>>2]=f;g=_q(g|0,e|0,1,0)|0;e=D;d=b;c[d>>2]=g;c[d+4>>2]=e;if((g|0)==-1&(e|0)==-1){e=1;d=f;break a}else d=1}return d|0}while(0);if(d>>>0<=99999999){b=e;return b|0};c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;b=-1;return b|0}function qo(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+48|0;if((l|0)>=(m|0))$(48);r=s+32|0;q=s+24|0;o=s;g=d+12|0;if((a[g>>0]|0?(f=e+12|0,a[f>>0]|0):0)?(Op(g,f)|0)==0:0){c[o>>2]=c[d>>2];c[o+4>>2]=c[d+4>>2];c[o+8>>2]=c[d+8>>2];c[o+12>>2]=c[d+12>>2];c[o+16>>2]=c[d+16>>2];c[o+20>>2]=c[d+20>>2];d=e;i=c[d>>2]|0;d=c[d+4>>2]|0;f=c[e+8>>2]|0;n=o+12|0;do if(a[n>>0]|0){k=o+8|0;h=o;e=c[h>>2]|0;h=c[h+4>>2]|0;g=c[k>>2]|0;a:do if((e|0)==-1&(h|0)==-1)p=9;else while(1){if(g>>>0<=99999999)break a;g=g+-1e8|0;c[k>>2]=g;e=_q(e|0,h|0,1,0)|0;h=D;j=o;c[j>>2]=e;c[j+4>>2]=h;if((e|0)==-1&(h|0)==-1){p=9;break}}while(0);if((p|0)==9)if(g>>>0>99999999){c[o>>2]=0;c[o+4>>2]=0;c[o+8>>2]=0;c[o+12>>2]=0;c[o+16>>2]=0;c[o+20>>2]=0;break}else{e=-1;h=-1}b:do if((i|0)==-1&(d|0)==-1)p=14;else while(1){if(f>>>0<=99999999){j=d;break b}f=f+-1e8|0;i=_q(i|0,d|0,1,0)|0;d=D;if((i|0)==-1&(d|0)==-1){p=14;break}}while(0);if((p|0)==14)if(f>>>0>99999999)break;else{j=-1;i=-1}do if(g>>>0>>0){if(!((e|0)==0&(h|0)==0)){g=g+1e8|0;c[k>>2]=g;e=_q(e|0,h|0,-1,-1)|0;h=D;p=o;c[p>>2]=e;c[p+4>>2]=h;break};c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;r=-1;l=s;return r|0}while(0);if(h>>>0>>0|(h|0)==(j|0)&e>>>0>>0){c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;r=-1;l=s;return r|0}d=Fo(n)|0;if(d>>>0>11){if((c[3838]|0)==-1)c[3838]=Wb(1,0,61157,61183,421)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[3838]|0))Vb();c[q>>2]=61157;c[q+4>>2]=421;Zb(1,61295,q);Vb()};c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;cr(b+12|0,n|0,d|0)|0;if(g>>>0>=f>>>0){r=g-f|0;c[b+8>>2]=r;p=Xq(e|0,h|0,i|0,j|0)|0;q=D;c[b>>2]=p;c[b+4>>2]=q;r=(p|0)==0&(q|0)==0&(r|0)==0&1^1;l=s;return r|0}if((c[3839]|0)==-1)c[3839]=Wb(1,0,61157,61183,422)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[3839]|0))Vb();c[r>>2]=61157;c[r+4>>2]=422;Zb(1,61295,r);Vb()}while(0);c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;r=-1;l=s;return r|0};c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;r=-1;l=s;return r|0}function ro(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0;r=l;l=l+32|0;if((l|0)>=(m|0))$(32);o=r;q=r+8|0;n=d+12|0;if((a[n>>0]|0?(f=e+12|0,a[f>>0]|0):0)?(Op(n,f)|0)==0:0){g=d;i=c[g>>2]|0;g=c[g+4>>2]|0;d=c[d+8>>2]|0;j=e;h=c[j>>2]|0;j=c[j+4>>2]|0;f=c[e+8>>2]|0;a:do if((i|0)==-1&(g|0)==-1)p=8;else{e=i;while(1){if(d>>>0<=99999999){k=d;i=e;p=9;break a}d=d+-1e8|0;e=_q(e|0,g|0,1,0)|0;g=D;if((e|0)==-1&(g|0)==-1){p=8;break}}}while(0);if((p|0)==8?d>>>0<=99999999:0){k=d;i=-1;g=-1;p=9}do if((p|0)==9){b:do if((h|0)==-1&(j|0)==-1)p=12;else{e=j;while(1){if(f>>>0<=99999999)break b;f=f+-1e8|0;h=_q(h|0,e|0,1,0)|0;e=D;if((h|0)==-1&(e|0)==-1){p=12;break}}}while(0);if((p|0)==12)if(f>>>0>99999999)break;else{h=-1;e=-1}d=Fo(n)|0;if(d>>>0>11){if((c[3840]|0)==-1)c[3840]=Wb(1,0,61157,61205,468)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[3840]|0))Vb();c[o>>2]=61157;c[o+4>>2]=468;Zb(1,61295,o);Vb()}Yq(q+d|0,0,12-d|0)|0;cr(q|0,n|0,d|0)|0;e=_q(h|0,e|0,i|0,g|0)|0;d=D;if(d>>>0>>0|(d|0)==(g|0)&e>>>0>>0){c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;b=-1;l=r;return b|0}f=f+k|0;do if(a[q>>0]|0){c:do if((e|0)==-1&(d|0)==-1)p=28;else while(1){if(f>>>0<=99999999)break c;f=f+-1e8|0;e=_q(e|0,d|0,1,0)|0;d=D;if((e|0)==-1&(d|0)==-1){p=28;break}}while(0);if((p|0)==28)if(f>>>0>99999999){c[q>>2]=0;c[q+4>>2]=0;c[q+8>>2]=0;break}else{e=-1;d=-1}p=b;c[p>>2]=e;c[p+4>>2]=d;c[b+8>>2]=f;b=b+12|0;c[b>>2]=c[q>>2];c[b+4>>2]=c[q+4>>2];c[b+8>>2]=c[q+8>>2];b=1;l=r;return b|0}while(0);c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;b=-1;l=r;return b|0}while(0);c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;b=-1;l=r;return b|0};c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;b=-1;l=r;return b|0}function so(){var a=0,b=0,d=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=d+8|0;a=d;xe(6,0);if(!(yd(61222)|0)){iq(61228,27,1,c[3935]|0)|0;za()}else{c[a>>2]=0;zd(37,a)|0;c[b>>2]=0;zd(38,b)|0;l=d;return}}function to(a,b,d){a=a|0;b=b|0;d=d|0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=a;a=c[3935]|0;c[b>>2]=d;Rp(a,61256,b)|0;za()}function uo(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;h=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=h+16|0;i=h;j=h+24|0;c[j>>2]=Xp(e)|0;c[i>>2]=61323;c[i+4>>2]=21;c[i+8>>2]=0;c[i+12>>2]=0;if((Hc(f,64,j,4,b,64,i)|0)==1){a[f>>0]=(d[f>>0]|0)&63|64;j=f+31|0;a[j>>0]=(d[j>>0]|0)&248;l=h;return}if((c[3841]|0)==-1)c[3841]=Wb(1,0,61286,61345,197)|0;if((Xb()|0)>0){Yb(-1,0);Vb()}if(!(c[3841]|0))Vb();c[g>>2]=61286;c[g+4>>2]=197;Zb(1,61295,g);Vb()}function vo(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=Co(c[a+60>>2]|0)|0;a=yo(cb(6,d|0)|0)|0;l=b;return a|0}function wo(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=g;c[b+36>>2]=25;if((c[b>>2]&64|0)==0?(c[f>>2]=c[b+60>>2],c[f+4>>2]=21523,c[f+8>>2]=g+16,Za(54,f|0)|0):0)a[b+75>>0]=-1;f=Bo(b,d,e)|0;l=g;return f|0}function xo(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f;e=f+20|0;c[g>>2]=c[a+60>>2];c[g+4>>2]=0;c[g+8>>2]=b;c[g+12>>2]=e;c[g+16>>2]=d;if((yo(jb(140,g|0)|0)|0)<0){c[e>>2]=-1;a=-1}else a=c[e>>2]|0;l=f;return a|0}function yo(a){a=a|0;if(a>>>0>4294963200){c[(zo()|0)>>2]=0-a;a=-1}return a|0}function zo(){return (Ao()|0)+64|0}function Ao(){return 15492}function Bo(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;o=l;l=l+48|0;if((l|0)>=(m|0))$(48);k=o+16|0;g=o;f=o+32|0;i=a+28|0;e=c[i>>2]|0;c[f>>2]=e;j=a+20|0;e=(c[j>>2]|0)-e|0;c[f+4>>2]=e;c[f+8>>2]=b;c[f+12>>2]=d;e=e+d|0;h=a+60|0;c[g>>2]=c[h>>2];c[g+4>>2]=f;c[g+8>>2]=2;g=yo(nb(146,g|0)|0)|0;a:do if((e|0)!=(g|0)){b=2;while(1){if((g|0)<0)break;e=e-g|0;q=c[f+4>>2]|0;p=g>>>0>q>>>0;f=p?f+8|0:f;b=(p<<31>>31)+b|0;q=g-(p?q:0)|0;c[f>>2]=(c[f>>2]|0)+q;p=f+4|0;c[p>>2]=(c[p>>2]|0)-q;c[k>>2]=c[h>>2];c[k+4>>2]=f;c[k+8>>2]=b;g=yo(nb(146,k|0)|0)|0;if((e|0)==(g|0)){n=3;break a}}c[a+16>>2]=0;c[i>>2]=0;c[j>>2]=0;c[a>>2]=c[a>>2]|32;if((b|0)==2)d=0;else d=d-(c[f+4>>2]|0)|0}else n=3;while(0);if((n|0)==3){q=c[a+44>>2]|0;c[a+16>>2]=q+(c[a+48>>2]|0);c[i>>2]=q;c[j>>2]=q}l=o;return d|0}function Co(a){a=a|0;return a|0}function Do(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0;k=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=k;i=k+16|0;c[i>>2]=d;g=i+4|0;j=b+48|0;n=c[j>>2]|0;c[g>>2]=e-((n|0)!=0&1);h=b+44|0;c[i+8>>2]=c[h>>2];c[i+12>>2]=n;c[f>>2]=c[b+60>>2];c[f+4>>2]=i;c[f+8>>2]=2;f=yo(mb(145,f|0)|0)|0;if((f|0)>=1){i=c[g>>2]|0;if(f>>>0>i>>>0){g=c[h>>2]|0;h=b+4|0;c[h>>2]=g;c[b+8>>2]=g+(f-i);if(!(c[j>>2]|0))f=e;else{c[h>>2]=g+1;a[d+(e+-1)>>0]=a[g>>0]|0;f=e}}}else c[b>>2]=c[b>>2]|f&48^16;l=k;return f|0}function Eo(){return 70776}function Fo(b){b=b|0;var d=0,e=0,f=0;f=b;a:do if(!(f&3))e=4;else{d=f;while(1){if(!(a[b>>0]|0)){b=d;break a}b=b+1|0;d=b;if(!(d&3)){e=4;break}}}while(0);if((e|0)==4){while(1){d=c[b>>2]|0;if(!((d&-2139062144^-2139062144)&d+-16843009))b=b+4|0;else break}if((d&255)<<24>>24)do b=b+1|0;while((a[b>>0]|0)!=0)}return b-f|0}function Go(b,c){b=b|0;c=c|0;var d=0,e=0;d=a[b>>0]|0;e=a[c>>0]|0;if(d<<24>>24==0?1:d<<24>>24!=e<<24>>24)b=e;else{do{b=b+1|0;c=c+1|0;d=a[b>>0]|0;e=a[c>>0]|0}while(!(d<<24>>24==0?1:d<<24>>24!=e<<24>>24));b=e}return (d&255)-(b&255)|0}function Ho(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d;Vo();c[e>>2]=a;c[e+4>>2]=b;b=yo(Ta(91,e|0)|0)|0;l=d;return b|0}function Io(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;n=c[b+8>>2]|0;o=(c[b>>2]|0)==-1794895138;h=er(n|0)|0;h=o?n:h;n=c[b+12>>2]|0;f=er(n|0)|0;f=o?n:f;n=c[b+16>>2]|0;g=er(n|0)|0;g=o?n:g;a:do if((h>>>0>>2>>>0?(n=d-(h<<2)|0,f>>>0>>0&g>>>0>>0):0)?((g|f)&3|0)==0:0){n=f>>>2;m=g>>>2;l=0;while(1){i=h>>>1;j=l+i|0;k=j<<1;p=k+n|0;f=c[b+(p<<2)>>2]|0;g=er(f|0)|0;g=o?f:g;p=c[b+(p+1<<2)>>2]|0;f=er(p|0)|0;f=o?p:f;if(!(f>>>0>>0&g>>>0<(d-f|0)>>>0)){f=0;break a}if(a[b+(f+g)>>0]|0){f=0;break a}f=Go(e,b+f|0)|0;if(!f)break;if((h|0)==1){f=0;break a}p=(f|0)<0;l=p?l:j;h=p?i:h-i|0}p=k+m|0;f=c[b+(p<<2)>>2]|0;g=er(f|0)|0;g=o?f:g;p=c[b+(p+1<<2)>>2]|0;f=er(p|0)|0;f=o?p:f;if(f>>>0>>0&g>>>0<(d-f|0)>>>0)f=(a[b+(f+g)>>0]|0)==0?b+f|0:0;else f=0}else f=0;while(0);return f|0}function Jo(b,c,e){b=b|0;c=c|0;e=e|0;var f=0,g=0;if(!e)f=0;else{f=a[b>>0]|0;a:do if(!(f<<24>>24))f=0;else while(1){e=e+-1|0;g=a[c>>0]|0;if(!(f<<24>>24==g<<24>>24&((e|0)!=0&g<<24>>24!=0)))break a;b=b+1|0;c=c+1|0;f=a[b>>0]|0;if(!(f<<24>>24)){f=0;break}}while(0);f=(f&255)-(d[c>>0]|0)|0}return f|0}function Ko(b,c){b=b|0;c=c|0;b=Uo(b,c)|0;return ((a[b>>0]|0)==(c&255)<<24>>24?b:0)|0}function Lo(a){a=a|0;return ((a|0)==32|(a+-9|0)>>>0<5)&1|0}function Mo(a,b,c){a=a|0;b=b|0;c=c|0;c=Oo(a,b,c,-1,0)|0;return c|0}function No(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;h=d&255;f=(e|0)!=0;a:do if(f&(b&3|0)!=0){g=d&255;while(1){if((a[b>>0]|0)==g<<24>>24){i=6;break a}b=b+1|0;e=e+-1|0;f=(e|0)!=0;if(!(f&(b&3|0)!=0)){i=5;break}}}else i=5;while(0);if((i|0)==5)if(f)i=6;else e=0;b:do if((i|0)==6){g=d&255;if((a[b>>0]|0)!=g<<24>>24){f=S(h,16843009)|0;c:do if(e>>>0>3)while(1){h=c[b>>2]^f;if((h&-2139062144^-2139062144)&h+-16843009|0)break;b=b+4|0;e=e+-4|0;if(e>>>0<=3){i=11;break c}}else i=11;while(0);if((i|0)==11)if(!e){e=0;break}while(1){if((a[b>>0]|0)==g<<24>>24)break b;b=b+1|0;e=e+-1|0;if(!e){e=0;break}}}}while(0);return (e|0?b:0)|0}function Oo(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;j=l;l=l+128|0;if((l|0)>=(m|0))$(128);h=j;c[h>>2]=0;i=h+4|0;c[i>>2]=a;c[h+44>>2]=a;g=h+8|0;c[g>>2]=(a|0)<0?-1:a+2147483647|0;c[h+76>>2]=-1;Po(h,0);d=Qo(h,d,1,e,f)|0;if(b|0)c[b>>2]=a+((c[i>>2]|0)+(c[h+108>>2]|0)-(c[g>>2]|0));l=j;return d|0}function Po(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;c[a+104>>2]=b;d=c[a+8>>2]|0;e=c[a+4>>2]|0;f=d-e|0;c[a+108>>2]=f;if((b|0)!=0&(f|0)>(b|0))c[a+100>>2]=e+b;else c[a+100>>2]=d;return}function Qo(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;a:do if(e>>>0>36){c[(zo()|0)>>2]=22;h=0;g=0}else{r=b+4|0;q=b+100|0;do{i=c[r>>2]|0;if(i>>>0<(c[q>>2]|0)>>>0){c[r>>2]=i+1;i=d[i>>0]|0}else i=Ro(b)|0}while((Lo(i)|0)!=0);b:do switch(i|0){case 43:case 45:{i=((i|0)==45)<<31>>31;j=c[r>>2]|0;if(j>>>0<(c[q>>2]|0)>>>0){c[r>>2]=j+1;p=i;i=d[j>>0]|0;break b}else{p=i;i=Ro(b)|0;break b}}default:p=0}while(0);j=(e|0)==0;do if((e|16|0)==16&(i|0)==48){i=c[r>>2]|0;if(i>>>0<(c[q>>2]|0)>>>0){c[r>>2]=i+1;i=d[i>>0]|0}else i=Ro(b)|0;if((i|32|0)!=120)if(j){e=8;n=46;break}else{n=32;break}i=c[r>>2]|0;if(i>>>0<(c[q>>2]|0)>>>0){c[r>>2]=i+1;i=d[i>>0]|0}else i=Ro(b)|0;if((d[61369+i>>0]|0)>15){g=(c[q>>2]|0)==0;if(!g)c[r>>2]=(c[r>>2]|0)+-1;if(!f){Po(b,0);h=0;g=0;break a}if(g){h=0;g=0;break a}c[r>>2]=(c[r>>2]|0)+-1;h=0;g=0;break a}else{e=16;n=46}}else{e=j?10:e;if((d[61369+i>>0]|0)>>>0>>0)n=32;else{if(c[q>>2]|0)c[r>>2]=(c[r>>2]|0)+-1;Po(b,0);c[(zo()|0)>>2]=22;h=0;g=0;break a}}while(0);if((n|0)==32)if((e|0)==10){e=i+-48|0;if(e>>>0<10){i=0;j=e;do{i=(i*10|0)+j|0;e=c[r>>2]|0;if(e>>>0<(c[q>>2]|0)>>>0){c[r>>2]=e+1;e=d[e>>0]|0}else e=Ro(b)|0;j=e+-48|0}while(j>>>0<10&i>>>0<429496729);f=0}else{e=i;i=0;f=0}j=e+-48|0;if(j>>>0<10){m=j;while(1){j=kr(i|0,f|0,10,0)|0;k=D;l=((m|0)<0)<<31>>31;o=~l;if(k>>>0>o>>>0|(k|0)==(o|0)&j>>>0>~m>>>0){j=e;e=m;break}i=_q(j|0,k|0,m|0,l|0)|0;f=D;e=c[r>>2]|0;if(e>>>0<(c[q>>2]|0)>>>0){c[r>>2]=e+1;e=d[e>>0]|0}else e=Ro(b)|0;k=e+-48|0;if(k>>>0<10&(f>>>0<429496729|(f|0)==429496729&i>>>0<2576980378))m=k;else{j=e;e=k;break}}if(e>>>0>9){j=p;e=f}else{e=10;n=72}}else{j=p;e=f}}else n=46;c:do if((n|0)==46){if(!(e+-1&e)){n=a[61625+((e*23|0)>>>5&7)>>0]|0;f=a[61369+i>>0]|0;j=f&255;if(j>>>0>>0){i=0;k=j;do{i=k|i<>2]|0;if(j>>>0<(c[q>>2]|0)>>>0){c[r>>2]=j+1;j=d[j>>0]|0}else j=Ro(b)|0;f=a[61369+j>>0]|0;k=f&255}while(i>>>0<134217728&k>>>0>>0);k=0}else{j=i;k=0;i=0}l=gr(-1,-1,n|0)|0;m=D;if((f&255)>>>0>=e>>>0|(k>>>0>m>>>0|(k|0)==(m|0)&i>>>0>l>>>0)){f=k;n=72;break}else j=k;while(1){i=mr(i|0,j|0,n|0)|0;k=D;i=f&255|i;j=c[r>>2]|0;if(j>>>0<(c[q>>2]|0)>>>0){c[r>>2]=j+1;j=d[j>>0]|0}else j=Ro(b)|0;f=a[61369+j>>0]|0;if((f&255)>>>0>=e>>>0|(k>>>0>m>>>0|(k|0)==(m|0)&i>>>0>l>>>0)){f=k;n=72;break c}else j=k}}f=a[61369+i>>0]|0;j=f&255;if(j>>>0>>0){i=0;k=j;do{i=k+(S(i,e)|0)|0;j=c[r>>2]|0;if(j>>>0<(c[q>>2]|0)>>>0){c[r>>2]=j+1;j=d[j>>0]|0}else j=Ro(b)|0;f=a[61369+j>>0]|0;k=f&255}while(i>>>0<119304647&k>>>0>>0);k=0}else{j=i;i=0;k=0}if((f&255)>>>0>>0){n=ir(-1,-1,e|0,0)|0;o=D;m=k;while(1){if(m>>>0>o>>>0|(m|0)==(o|0)&i>>>0>n>>>0){f=m;n=72;break c}k=kr(i|0,m|0,e|0,0)|0;l=D;f=f&255;if(l>>>0>4294967295|(l|0)==-1&k>>>0>~f>>>0){f=m;n=72;break c}i=_q(f|0,0,k|0,l|0)|0;k=D;j=c[r>>2]|0;if(j>>>0<(c[q>>2]|0)>>>0){c[r>>2]=j+1;j=d[j>>0]|0}else j=Ro(b)|0;f=a[61369+j>>0]|0;if((f&255)>>>0>=e>>>0){f=k;n=72;break}else m=k}}else{f=k;n=72}}while(0);if((n|0)==72)if((d[61369+j>>0]|0)>>>0>>0){do{i=c[r>>2]|0;if(i>>>0<(c[q>>2]|0)>>>0){c[r>>2]=i+1;i=d[i>>0]|0}else i=Ro(b)|0}while((d[61369+i>>0]|0)>>>0>>0);c[(zo()|0)>>2]=34;j=(g&1|0)==0&0==0?p:0;e=h;i=g}else{j=p;e=f}if(c[q>>2]|0)c[r>>2]=(c[r>>2]|0)+-1;if(!(e>>>0>>0|(e|0)==(h|0)&i>>>0>>0)){if(!((g&1|0)!=0|0!=0|(j|0)!=0)){c[(zo()|0)>>2]=34;g=_q(g|0,h|0,-1,-1)|0;h=D;break}if(e>>>0>h>>>0|(e|0)==(h|0)&i>>>0>g>>>0){c[(zo()|0)>>2]=34;break}}g=((j|0)<0)<<31>>31;g=Xq(i^j|0,e^g|0,j|0,g|0)|0;h=D}while(0);D=h;return g|0}function Ro(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0;f=b+104|0;i=c[f>>2]|0;if((i|0)!=0?(c[b+108>>2]|0)>=(i|0):0)j=4;else{e=So(b)|0;if((e|0)>=0){f=c[f>>2]|0;i=c[b+8>>2]|0;if(f){h=c[b+4>>2]|0;f=f-(c[b+108>>2]|0)|0;g=i;if((i-h|0)<(f|0))j=9;else c[b+100>>2]=h+(f+-1)}else{g=i;j=9}if((j|0)==9)c[b+100>>2]=i;f=b+4|0;if(!g)f=c[f>>2]|0;else{f=c[f>>2]|0;b=b+108|0;c[b>>2]=g+1-f+(c[b>>2]|0)}f=f+-1|0;if((d[f>>0]|0|0)!=(e|0))a[f>>0]=e}else j=4}if((j|0)==4){c[b+100>>2]=0;e=-1}return e|0}function So(a){a=a|0;var b=0,e=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=e;if((To(a)|0)==0?(pb[c[a+32>>2]&63](a,b,1)|0)==1:0)a=d[b>>0]|0;else a=-1;l=e;return a|0}function To(b){b=b|0;var d=0,e=0;d=b+74|0;e=a[d>>0]|0;a[d>>0]=e+255|e;d=b+20|0;e=b+28|0;if((c[d>>2]|0)>>>0>(c[e>>2]|0)>>>0)pb[c[b+36>>2]&63](b,0,0)|0;c[b+16>>2]=0;c[e>>2]=0;c[d>>2]=0;d=c[b>>2]|0;if(!(d&4)){e=(c[b+44>>2]|0)+(c[b+48>>2]|0)|0;c[b+8>>2]=e;c[b+4>>2]=e;d=d<<27>>31}else{c[b>>2]=d|32;d=-1}return d|0}function Uo(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;f=d&255;a:do if(!f)b=b+(Fo(b)|0)|0;else{if(b&3){e=d&255;do{g=a[b>>0]|0;if(g<<24>>24==0?1:g<<24>>24==e<<24>>24)break a;b=b+1|0}while((b&3|0)!=0)}f=S(f,16843009)|0;e=c[b>>2]|0;b:do if(!((e&-2139062144^-2139062144)&e+-16843009))do{g=e^f;if((g&-2139062144^-2139062144)&g+-16843009|0)break b;b=b+4|0;e=c[b>>2]|0}while(!((e&-2139062144^-2139062144)&e+-16843009|0));while(0);e=d&255;while(1){g=a[b>>0]|0;if(g<<24>>24==0?1:g<<24>>24==e<<24>>24)break;else b=b+1|0}}while(0);return b|0}function Vo(){return}function Wo(a){a=a|0;return Xo(a)|0}function Xo(a){a=a|0;return ((a|0)==32|(a|0)==9)&1|0}function Yo(a){a=a|0;var b=0;b=(Zo(a)|0)==0;return (b?a:a|32)|0}function Zo(a){a=a|0;return (a+-65|0)>>>0<26|0}function _o(a){a=a|0;return ap(a,0)|0}function $o(a){a=a|0;return ap(a,1)|0}function ap(c,f){c=c|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0;k=(f<<1)+-1|0;l=f+-1|0;a:do if(!((c+-43008|0)>>>0<22272|((c+-11776|0)>>>0<30784|((c+-1536|0)>>>0<2560|(bp(c)|0)==0)))){g=(f|0)!=0;if(g&(c+-4256|0)>>>0<46){if((c|0)>4293)switch(c|0){case 4295:case 4301:break;default:break a}c=c+7264|0;break}if((c+-11520|0)>>>0<38&(g^1)){if((c|0)>11557)switch(c|0){case 11559:case 11565:break;default:break a}c=c+-7264|0;break}else g=0;do{i=a[18762+(g<<2)+2>>0]|0;j=i<<24>>24;h=c-(e[18762+(g<<2)>>1]|0)|0;if((h-(j&l)|0)>>>0<(d[18762+(g<<2)+3>>0]|0)>>>0){m=13;break}g=g+1|0}while((g|0)!=61);if((m|0)==13)if(i<<24>>24==1){c=f+c-(h&1)|0;break}else{c=(S(j,k)|0)+c|0;break}i=1-f|0;g=b[18274+(i<<1)>>1]|0;b:do if(g<<16>>16){h=0;while(1){if((g&65535|0)==(c|0))break;h=h+1|0;g=b[18274+(h<<2)+(i<<1)>>1]|0;if(!(g<<16>>16))break b}c=e[18274+(h<<2)+(f<<1)>>1]|0;break a}while(0);return ((c+-66600+(f*40|0)|0)>>>0<40?c+-40+(f*80|0)|0:c)|0}while(0);return c|0}function bp(a){a=a|0;if(a>>>0<131072)a=(d[61634+((d[61634+(a>>>8)>>0]|0)<<5|a>>>3&31)>>0]|0)>>>(a&7)&1;else a=a>>>0<196606&1;return a|0}function cp(a){a=a|0;return (a+-97|0)>>>0<26|0}function dp(a){a=a|0;return ep(a,c[(Ao()|0)+188>>2]|0)|0}function ep(b,e){b=b|0;e=e|0;var f=0,g=0;g=0;while(1){if((d[64610+g>>0]|0)==(b|0)){b=2;break}f=g+1|0;if((f|0)==87){f=64698;g=87;b=5;break}else g=f}if((b|0)==2)if(!g)f=64698;else{f=64698;b=5}if((b|0)==5)while(1){do{b=f;f=f+1|0}while((a[b>>0]|0)!=0);g=g+-1|0;if(!g)break;else b=5}return fp(f,c[e+20>>2]|0)|0}function fp(a,b){a=a|0;b=b|0;return gp(a,b)|0}function gp(a,b){a=a|0;b=b|0;if(!b)b=0;else b=Io(c[b>>2]|0,c[b+4>>2]|0,a)|0;return (b|0?b:a)|0}function hp(a){a=a|0;if(!a)a=0;else a=(ip(16072,a)|0)!=0;return a&1|0}function ip(a,b){a=a|0;b=b|0;var d=0;if(!b)a=a+((jp(a)|0)<<2)|0;else{while(1){d=c[a>>2]|0;if((d|0)==0|(d|0)==(b|0))break;else a=a+4|0}a=d|0?a:0}return a|0}function jp(a){a=a|0;var b=0;b=a;while(1)if(!(c[b>>2]|0))break;else b=b+4|0;return b-a>>2|0}function kp(a){a=a|0;return ((a+-48|0)>>>0<10|((a|32)+-97|0)>>>0<6)&1|0}function lp(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=f;c[g>>2]=e;e=mp(a,b,d,g)|0;l=f;return e|0}function mp(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0;o=l;l=l+128|0;if((l|0)>=(m|0))$(128);g=o+124|0;n=o;h=n;i=16160;j=h+124|0;do{c[h>>2]=c[i>>2];h=h+4|0;i=i+4|0}while((h|0)<(j|0));if((d+-1|0)>>>0>2147483646)if(!d){b=g;d=1;k=4}else{c[(zo()|0)>>2]=75;d=-1}else k=4;if((k|0)==4){k=-2-b|0;k=d>>>0>k>>>0?k:d;c[n+48>>2]=k;g=n+20|0;c[g>>2]=b;c[n+44>>2]=b;d=b+k|0;b=n+16|0;c[b>>2]=d;c[n+28>>2]=d;d=np(n,e,f)|0;if(k){n=c[g>>2]|0;a[n+(((n|0)==(c[b>>2]|0))<<31>>31)>>0]=0}}l=o;return d|0}function np(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=l;l=l+224|0;if((l|0)>=(m|0))$(224);o=t+120|0;q=t+80|0;r=t;s=t+136|0;f=q;g=f+40|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(g|0));c[o>>2]=c[e>>2];if((op(0,d,o,r,q)|0)<0)e=-1;else{if((c[b+76>>2]|0)>-1)p=pp(b)|0;else p=0;e=c[b>>2]|0;n=e&32;if((a[b+74>>0]|0)<1)c[b>>2]=e&-33;f=b+48|0;if(!(c[f>>2]|0)){g=b+44|0;h=c[g>>2]|0;c[g>>2]=s;i=b+28|0;c[i>>2]=s;j=b+20|0;c[j>>2]=s;c[f>>2]=80;k=b+16|0;c[k>>2]=s+80;e=op(b,d,o,r,q)|0;if(h){pb[c[b+36>>2]&63](b,0,0)|0;e=(c[j>>2]|0)==0?-1:e;c[g>>2]=h;c[f>>2]=0;c[k>>2]=0;c[i>>2]=0;c[j>>2]=0}}else e=op(b,d,o,r,q)|0;f=c[b>>2]|0;c[b>>2]=f|n;if(p|0)qp(b);e=(f&32|0)==0?e:-1}l=t;return e|0} +function Pf(b){b=b|0;var d=0;if(!b){Tn(22);d=0;return d|0}if(!(c[17594]|0)){d=Xf(b)|0;return d|0}d=Xf(b+5|0)|0;if(!d){d=0;return d|0}a[d>>0]=b;a[d+1>>0]=b>>>8;a[d+2>>0]=b>>>16;a[d+3>>0]=-52;a[d+(b+4)>>0]=-86;d=d+4|0;return d|0}function Qf(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;j=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=j+8|0;f=j;if(!(c[17594]|0))if(!(ag(b)|0)){e=Rq(b,e)|0;l=j;return e|0}else{e=$f(b,e)|0;l=j;return e|0}if(!b){if(!e){Tn(22);e=0;l=j;return e|0}f=Oq(e+5|0)|0;if(!f){e=0;l=j;return e|0}a[f>>0]=e;a[f+1>>0]=e>>>8;a[f+2>>0]=e>>>16;a[f+3>>0]=85;a[f+(e+4)>>0]=-86;e=f+4|0;l=j;return e|0}h=a[b+-1>>0]|0;switch(h<<24>>24){case -52:case 85:break;default:{c[f>>2]=b;c[f+4>>2]=h&255;Me(22844,f)}}i=d[b+-3>>0]<<8|d[b+-4>>0]|d[b+-2>>0]<<16;if((a[b+i>>0]|0)!=-86){c[g>>2]=b;c[g+4>>2]=h&255;Me(22885,g)}if(i>>>0>=e>>>0){e=b;l=j;return e|0}f=(e|0)==0;do if(h<<24>>24==-52){if(f){Tn(22);e=0;l=j;return e|0}f=Xf(e+5|0)|0;if(!f){e=0;l=j;return e|0}else{a[f>>0]=e;a[f+1>>0]=e>>>8;a[f+2>>0]=e>>>16;a[f+3>>0]=-52;a[f+(e+4)>>0]=-86;break}}else{if(f){Tn(22);e=0;l=j;return e|0}f=Oq(e+5|0)|0;if(!f){e=0;l=j;return e|0}else{a[f>>0]=e;a[f+1>>0]=e>>>8;a[f+2>>0]=e>>>16;a[f+3>>0]=85;a[f+(e+4)>>0]=-86;break}}while(0);h=f+4|0;cr(h|0,b|0,i|0)|0;Yq(h+i|0,0,e-i|0)|0;Rf(b);e=h;l=j;return e|0}function Rf(b){b=b|0;var e=0,f=0,g=0,h=0;h=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=h+8|0;e=h;if(!b){l=h;return}if(!(c[17594]|0))if(!(ag(b)|0)){Pq(b);l=h;return}else{Zf(b);l=h;return}f=a[b+-1>>0]|0;switch(f<<24>>24){case -52:case 85:break;default:{c[e>>2]=b;c[e+4>>2]=f&255;Me(22844,e)}}e=b+-4|0;if((a[b+(d[b+-3>>0]<<8|d[e>>0]|d[b+-2>>0]<<16)>>0]|0)!=-86){c[g>>2]=b;c[g+4>>2]=f&255;Me(22885,g)}if(!(ag(b)|0)){Pq(e);l=h;return}else{Zf(e);l=h;return}}function Sf(a){a=a|0;Vn(1268)|0;c[17595]=a&1;c[17596]=a&2;c[17597]=a&8;c[17598]=a&16;Wn(1268)|0;return}function Tf(){var a=0;Vn(1268)|0;a=(c[17596]|0?2:0)|(c[17595]|0)!=0|(c[17597]|0?8:0)|(c[17598]|0?16:0);Wn(1268)|0;return a|0}function Uf(a){a=a|0;Vn(1268)|0;Vf(a);Wn(1268)|0;return}function Vf(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0;n=l;l=l+48|0;if((l|0)>=(m|0))$(48);f=n+40|0;k=n+32|0;j=n+24|0;g=n+16|0;e=n+8|0;d=n;if(!a){c[17599]=1;b=uq()|0;if((b|0)==(wq()|0)){l=n;return}if(xq(b)|0)Me(22925,d);b=uq()|0;if((b|0)!=(wq()|0))Me(22925,d);if(!(xq(0)|0))Me(22925,d);else{l=n;return}}if(c[17600]|0){Le(23124,f);l=n;return}c[17601]=a>>>0<16384?16384:a;if(c[17599]|0)Ne(22948,e);f=Oa(30)|0;f=(f|0)>0?f:4096;f=(c[17601]|0)+-1+f&0-f;c[17601]=f;f=Aq(0,f,3,34,-1,0)|0;c[17602]=f;if((f|0)==(-1|0)){e=c[17601]|0;f=dp(c[(zo()|0)>>2]|0)|0;c[g>>2]=e;c[g+4>>2]=f;Je(22974,g)}else{c[17603]=1;c[17600]=1}do if(!(c[17600]|0)){a=c[17601]|0;b=Oq(a)|0;c[17602]=b;if(!b){c[j>>2]=a;Me(23022,j)}else{c[17600]=1;h=a;i=b;break}}else{h=c[17601]|0;i=c[17602]|0}while(0);c[i>>2]=h;c[i+4>>2]=0;if(c[17597]|0){l=n;return}Je(23062,k);l=n;return}function Wf(){return 0}function Xf(a){a=a|0;Vn(1268)|0;a=Yf(a)|0;Wn(1268)|0;return a|0}function Yf(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0;n=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=n;if((c[17600]|0)==0?(Vf(32768),(c[17600]|0)==0):0){Je(ze(23170)|0,b);Tn(12);k=0;l=n;return k|0}j=a+31&-32;i=c[17602]|0;k=i;h=(c[17601]|0)+k|0;b=i;a=k;do{if(a>>>0>=h>>>0)break;d=b+4|0;e=c[d>>2]|0;f=c[b>>2]|0;if(!((e&1|0)!=0|f>>>0>>0)){g=7;break}b=b+8+f|0;b=b>>>0>>0?0:b>>>0>>0?b:0;a=b}while(b>>>0>=i>>>0);if((g|0)==7){c[d>>2]=e|1;d=f-j|0;if(d>>>0>8){g=b+8+j|0;c[g>>2]=d+-8;c[g+4>>2]=0;c[b>>2]=j;if((i|0)==(g|0))e=0;else{e=i;while(1){d=e+8+(c[e>>2]|0)|0;d=d>>>0>>0?0:d>>>0>>0?d:0;if((d|0)==(g|0))break;else e=d}}d=c[g>>2]|0;f=g+8+d|0;f=f>>>0>>0?0:f>>>0>>0?f:0;if((e|0)!=0?(c[e+4>>2]&1|0)==0:0){d=d+8+(c[e>>2]|0)|0;c[e>>2]=d}else e=g;if((f|0)!=0?(c[f+4>>2]&1|0)==0:0)c[e>>2]=d+8+(c[f>>2]|0)}}if(a>>>0>=k>>>0?a>>>0<((c[17601]|0)+k|0)>>>0:0)if(!b)a=0;else{if(j|0){c[17604]=(c[17604]|0)+j;c[17605]=(c[17605]|0)+1}a=b+8|0}else{Tn(12);a=0}k=a;l=n;return k|0}function Zf(a){a=a|0;Vn(1268)|0;_f(a);Wn(1268)|0;return}function _f(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;if(!b)return;l=b+-8|0;k=c[l>>2]|0;j=(k|0)!=0&(b&7|0)!=0;if(j){e=b;d=k;do{a[e>>0]=-1;e=e+1|0;d=d+-1|0}while((d|0)!=0&(e&7|0)!=0)}else{e=b;d=k}if(d>>>0>=8){h=d+-8|0;i=h&-8;g=i+8|0;f=e;while(1){m=f;c[m>>2]=-1;c[m+4>>2]=-1;d=d+-8|0;if(d>>>0<=7)break;else f=f+8|0}e=e+g|0;d=h-i|0}if(d|0)while(1){a[e>>0]=-1;d=d+-1|0;if(!d)break;else e=e+1|0}if(j){e=b;d=k;do{a[e>>0]=-86;e=e+1|0;d=d+-1|0}while((d|0)!=0&(e&7|0)!=0)}else{e=b;d=k}if(d>>>0>=8){h=d+-8|0;i=h&-8;g=i+8|0;f=e;while(1){m=f;c[m>>2]=-1431655766;c[m+4>>2]=-1431655766;d=d+-8|0;if(d>>>0<=7)break;else f=f+8|0}e=e+g|0;d=h-i|0}if(d|0)while(1){a[e>>0]=-86;d=d+-1|0;if(!d)break;else e=e+1|0}if(j){e=k;d=b;do{a[d>>0]=85;d=d+1|0;e=e+-1|0}while((e|0)!=0&(d&7|0)!=0)}else{e=k;d=b}if(e>>>0>=8){g=e+-8|0;h=g&-8;i=h+8|0;f=d;while(1){m=f;c[m>>2]=1431655765;c[m+4>>2]=1431655765;e=e+-8|0;if(e>>>0<=7)break;else f=f+8|0}e=g-h|0;d=d+i|0}if(e|0)while(1){a[d>>0]=85;e=e+-1|0;if(!e)break;else d=d+1|0}if(j){e=k;d=b;do{a[d>>0]=0;d=d+1|0;e=e+-1|0}while((e|0)!=0&(d&7|0)!=0)}else{e=k;d=b}if(e>>>0>=8){g=e+-8|0;h=g&-8;i=h+8|0;f=d;while(1){m=f;c[m>>2]=0;c[m+4>>2]=0;e=e+-8|0;if(e>>>0<=7)break;else f=f+8|0}e=g-h|0;d=d+i|0}if(e|0)while(1){a[d>>0]=0;e=e+-1|0;if(!e)break;else d=d+1|0}if(k|0){c[17604]=(c[17604]|0)-k;c[17605]=(c[17605]|0)+-1}g=b+-4|0;c[g>>2]=c[g>>2]&-2;g=c[17602]|0;h=g;if((g|0)==(l|0))e=0;else{d=(c[17601]|0)+h|0;e=g;while(1){f=e+8+(c[e>>2]|0)|0;f=f>>>0>>0?0:f>>>0>>0?f:0;if((f|0)==(l|0))break;else e=f}}d=c[l>>2]|0;f=b+d|0;if(f>>>0>>0)f=0;else f=f>>>0<((c[17601]|0)+h|0)>>>0?f:0;if((e|0)!=0?(c[e+4>>2]&1|0)==0:0){d=d+8+(c[e>>2]|0)|0;c[e>>2]=d}else e=l;if(!f)return;if(c[f+4>>2]&1|0)return;c[e>>2]=d+8+(c[f>>2]|0);return}function $f(a,b){a=a|0;b=b|0;var d=0,e=0;Vn(1268)|0;d=c[a+-8>>2]|0;if(d>>>0<=b>>>0){e=Yf(b)|0;if(!e)a=0;else{cr(e|0,a|0,d|0)|0;Yq(e+d|0,0,b-d|0)|0;_f(a);a=e}}Wn(1268)|0;return a|0}function ag(a){a=a|0;var b=0,d=0;if((c[17600]|0)!=0?(b=a,d=c[17602]|0,b>>>0>=d>>>0):0)a=b>>>0<((c[17601]|0)+d|0)>>>0;else a=0;return a&1|0}function bg(){var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;if(!(c[17600]|0))return;b=c[17602]|0;d=c[17601]|0;if((d|0)!=0&(b&7|0)!=0){f=d;e=b;do{a[e>>0]=-1;e=e+1|0;f=f+-1|0}while((f|0)!=0&(e&7|0)!=0)}else{e=b;f=d}if(f>>>0>=8){i=f+-8|0;j=i&-8;h=j+8|0;g=e;while(1){k=g;c[k>>2]=-1;c[k+4>>2]=-1;f=f+-8|0;if(f>>>0<=7)break;else g=g+8|0}e=e+h|0;f=i-j|0}if(f){d=f;b=e;while(1){a[b>>0]=-1;d=d+-1|0;if(!d)break;else b=b+1|0}b=c[17602]|0;d=c[17601]|0}if((d|0)!=0&(b&7|0)!=0){e=b;f=d;do{a[e>>0]=-86;e=e+1|0;f=f+-1|0}while((f|0)!=0&(e&7|0)!=0)}else{e=b;f=d}if(f>>>0>=8){i=f+-8|0;j=i&-8;h=j+8|0;g=e;while(1){k=g;c[k>>2]=-1431655766;c[k+4>>2]=-1431655766;f=f+-8|0;if(f>>>0<=7)break;else g=g+8|0}e=e+h|0;f=i-j|0}if(f){d=e;b=f;while(1){a[d>>0]=-86;b=b+-1|0;if(!b)break;else d=d+1|0}b=c[17602]|0;d=c[17601]|0}if((d|0)!=0&(b&7|0)!=0)do{a[b>>0]=85;b=b+1|0;d=d+-1|0}while((d|0)!=0&(b&7|0)!=0);if(d>>>0>=8){f=d+-8|0;g=f&-8;h=g+8|0;e=b;while(1){k=e;c[k>>2]=1431655765;c[k+4>>2]=1431655765;d=d+-8|0;if(d>>>0<=7)break;else e=e+8|0}d=f-g|0;b=b+h|0}if(d|0)while(1){a[b>>0]=85;d=d+-1|0;if(!d)break;else b=b+1|0}b=c[17602]|0;d=c[17601]|0;if((d|0)!=0&(b&7|0)!=0)do{a[b>>0]=0;b=b+1|0;d=d+-1|0}while((d|0)!=0&(b&7|0)!=0);if(d>>>0>=8){f=d+-8|0;g=f&-8;h=g+8|0;e=b;while(1){k=e;c[k>>2]=0;c[k+4>>2]=0;d=d+-8|0;if(d>>>0<=7)break;else e=e+8|0}d=f-g|0;b=b+h|0}if(d|0)while(1){a[b>>0]=0;d=d+-1|0;if(!d)break;else b=b+1|0}if(c[17603]|0)Ho(c[17602]|0,c[17601]|0)|0;c[17602]=0;c[17600]=0;c[17601]=0;return}function cg(){var a=0,b=0,d=0,e=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);a=b;Vn(1268)|0;if(!(c[17600]|0)){Wn(1268)|0;l=b;return}e=c[17601]|0;d=c[17605]|0;c[a>>2]=c[17604];c[a+4>>2]=e;c[a+8>>2]=d;Je(23231,a);Wn(1268)|0;l=b;return}function dg(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+272|0;if((l|0)>=(m|0))$(272);d=f+8|0;b=f;e=f+16|0;if(c[17606]|0)if((c[17607]|0)==1)Ie(23272,23278,114,23285);else{eg(5);fg()}c[17606]=1;a:do if(a){if(c[17607]|0)Ie(23312,23278,121,23285)}else{if(!(vq(23335,0)|0)){if(!(c[17607]|0))break;Ie(23312,23278,132,23285)}a=aq(23360,23390)|0;b:do if(!a){a=c[(zo()|0)>>2]|0;switch(a|0){case 2:case 13:break b;default:{}}if(!(vq(23392,0)|0)){e=dp(a)|0;c[b>>2]=23360;c[b+4>>2]=e;Je(23406,b);za()}}else{if(Sp(e,256,a)|0?Fq(e)|0:0){bq(a)|0;if(!(c[17607]|0))break a;else Ie(23312,23278,151,23285)}bq(a)|0}while(0);c[17607]=1;l=f;return}while(0);a=Un(1312)|0;if(a|0){c[d>>2]=Pn(a)|0;Je(23450,d);za()}a=aq(23335,23390)|0;if(a|0){if(Sp(e,256,a)|0?Fq(e)|0:0)c[17608]=1;bq(a)|0}eg(1);l=f;return}function eg(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+48|0;if((l|0)>=(m|0))$(48);h=i+24|0;f=i+16|0;e=i+8|0;d=i;b=Vn(1312)|0;if(b|0){c[d>>2]=Pn(b)|0;Je(23505,d);za()}d=c[17609]|0;switch(d|0){case 0:{b=a+-1|0;if(b>>>0<5?(25>>>(b&31)&1)!=0:0)b=14;else b=17;break}case 1:{b=a+-2|0;if(b>>>0<4?(13>>>(b&15)&1)!=0:0)b=14;else b=17;break}case 2:{if((a+-3|0)>>>0<3)b=14;else b=17;break}case 3:{b=a+-2|0;if(b>>>0<5?(29>>>(b&31)&1)!=0:0)b=14;else b=17;break}case 4:{b=a+-2|0;if(b>>>0<5?(29>>>(b&31)&1)!=0:0)b=14;else b=17;break}case 5:{if((a|0)==6)b=14;else b=17;break}default:b=17}if((b|0)==14){c[17609]=a;b=Wn(1312)|0;if(b|0){c[e>>2]=Pn(b)|0;Je(23560,e);za()}if(!(Ee(2)|0)){l=i;return}else g=1}else if((b|0)==17){b=Wn(1312)|0;if(!b)g=0;else{c[f>>2]=Pn(b)|0;Je(23560,f);za()}}switch(d|0){case 0:{d=23669;break}case 1:{d=23664;break}case 2:{d=23654;break}case 3:{d=23642;break}case 4:{d=23636;break}case 5:{d=23624;break}case 6:{d=23615;break}default:d=37665}switch(a|0){case 0:{b=23669;break}case 1:{b=23664;break}case 2:{b=23654;break}case 3:{b=23642;break}case 4:{b=23636;break}case 5:{b=23624;break}case 6:{b=23615;break}default:b=37665}c[h>>2]=d;c[h+4>>2]=b;c[h+8>>2]=g?23678:23686;Je(23693,h);if(g){l=i;return}else fg()}function fg(){$p(0)|0;za()}function gg(){return c[17607]^1|0}function hg(){return ((c[17607]|0)==1?0:c[17608]|0)|0}function ig(){c[17608]=1;return}function jg(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;g=l;l=l+48|0;if((l|0)>=(m|0))$(48);e=g+40|0;f=g+32|0;d=g+24|0;b=g;if((c[17607]|0)==1)Ie(23733,23278,295,23752);if(c[17608]|0){eg(4);c[b>>2]=71847;c[b+4>>2]=23278;c[b+8>>2]=300;c[b+12>>2]=23852;c[b+16>>2]=23752;c[b+20>>2]=a|0?a:23779;Je(23804,b);l=g;return}a=Vn(1312)|0;if(a|0){c[d>>2]=Pn(a)|0;Je(23505,d);za()}if(!(c[17610]|0)){c[17610]=1;a=Wn(1312)|0;if(!a){l=g;return}else{c[f>>2]=Pn(a)|0;Je(23560,f);za()}}else{a=Wn(1312)|0;if(!a){l=g;return}else{c[e>>2]=Pn(a)|0;Je(23560,e);za()}}}function kg(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;h=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=h;if((c[17607]|0)==1){l=h;return}i=(e|0)!=0;eg(i?5:4);e=(d|0)!=0;c[g>>2]=i?23864:71847;c[g+4>>2]=a;c[g+8>>2]=b;c[g+12>>2]=e?23852:71847;c[g+16>>2]=e?d:71847;c[g+20>>2]=f|0?f:23779;Je(23804,g);l=h;return}function lg(){var a=0,b=0,d=0,e=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=e+8|0;b=e;if((c[17607]|0)==1){d=0;l=e;return d|0}a=Vn(1312)|0;if(a|0){c[b>>2]=Pn(a)|0;Je(23505,b);za()}a=c[17610]|0;b=Wn(1312)|0;if(!b){d=a;l=e;return d|0}else{c[d>>2]=Pn(b)|0;Je(23560,d);za()}return 0}function mg(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0;h=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=h+24|0;e=h+16|0;d=h+8|0;b=h;if((c[17607]|0)==1){g=1;l=h;return g|0}a=Vn(1312)|0;if(a|0){c[b>>2]=Pn(a)|0;Je(23505,b);za()}a=c[17609]|0;do if((a|0)==1){a=Wn(1312)|0;if(a|0){c[d>>2]=Pn(a)|0;Je(23560,d);za()}ng(0)|0;a=Vn(1312)|0;if(!a){f=c[17609]|0;break}else{c[e>>2]=Pn(a)|0;Je(23505,e);za()}}else f=a;while(0);a=Wn(1312)|0;if(!a){g=(f|0)==3&1;l=h;return g|0}else{c[g>>2]=Pn(a)|0;Je(23560,g);za()}return 0}function ng(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;if((c[17607]|0)!=1)eg(2);b=Dg(2,a,1)|0;g=(b|0)!=0;if(g)b=Pn(b)|0;else b=0;og(37899,2,0,b);f=Dg(7,a,1)|0;if(!f)b=0;else b=Pn(f)|0;og(37899,7,0,b);e=Dg(8,a,1)|0;if(!e)b=0;else b=Pn(e)|0;og(37899,8,0,b);b=Dg(9,a,1)|0;if(!b)d=0;else d=Pn(b)|0;og(37899,9,0,d);do if(!(f|g&1|e|b)){b=uh(2,a,1)|0;h=(b|0)!=0;if(h)b=Pn(b)|0;else b=0;og(42873,2,0,b);g=uh(11,a,1)|0;if(!g)b=0;else b=Pn(g)|0;og(42873,11,0,b);f=uh(8,a,1)|0;if(!f)b=0;else b=Pn(f)|0;og(42873,8,0,b);e=uh(9,a,1)|0;if(!e)b=0;else b=Pn(e)|0;og(42873,9,0,b);b=uh(10,a,1)|0;if(!b)d=0;else d=Pn(b)|0;og(42873,10,0,d);if(!(g|h&1|f|e|b)){b=ah(2,a,1)|0;h=(b|0)!=0;if(h)b=Pn(b)|0;else b=0;og(36051,2,0,b);g=ah(11,a,1)|0;if(!g)b=0;else b=Pn(g)|0;og(36051,11,0,b);f=ah(8,a,1)|0;if(!f)b=0;else b=Pn(f)|0;og(36051,8,0,b);e=ah(9,a,1)|0;if(!e)b=0;else b=Pn(e)|0;og(36051,9,0,b);b=ah(10,a,1)|0;if(!b)d=0;else d=Pn(b)|0;og(36051,10,0,d);if(!(g|h&1|f|e|b)){b=Ij(1)|0;if(b|0){og(52223,0,0,Pn(b)|0);d=50;b=4;break}og(52223,0,0,0);b=Xh(1,a,1)|0;e=(b|0)!=0;if(e)b=Pn(b)|0;else b=0;og(40871,1,0,b);b=Xh(17,a,1)|0;if(!b){og(40871,17,0,0);d=e?50:0;b=e?4:3;break}else{og(40871,17,0,Pn(b)|0);d=50;b=4;break}}else{d=50;b=4}}else{d=50;b=4}}else{d=50;b=4}while(0);if((c[17607]|0)==1)return d|0;eg(b);return d|0}function og(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+32|0;if((l|0)>=(m|0))$(32);j=k;h=(e|0)!=0;if(!h?(Ee(2)|0)==0:0){l=k;return}f=Go(a,36051)|0;i=f|0?a:42873;f=(f|0)==0;g=f?23871:71847;do if(Go(a,37899)|0){if(!(Go(a,42873)|0)){a=dh(b)|0;break}if(f){a=dh(b)|0;break}if(!(Go(a,40871)|0))a=Oh(b)|0;else a=71847}else a=ug(b)|0;while(0);f=(d|0)!=0;c[j>>2]=i;c[j+4>>2]=g;c[j+8>>2]=a;c[j+12>>2]=b;c[j+16>>2]=h?e:23877;c[j+20>>2]=f?23882:71847;c[j+24>>2]=f?d:71847;c[j+28>>2]=f?46947:71847;Je(23885,j);l=k;return}function pg(){var a=0,b=0,d=0,e=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=e+8|0;b=e;if((c[17607]|0)==1){d=1;l=e;return d|0}a=Vn(1312)|0;if(a|0){c[b>>2]=Pn(a)|0;Je(23505,b);za()}a=(c[17609]|0)==3&1;b=Wn(1312)|0;if(!b){d=a;l=e;return d|0}else{c[d>>2]=Pn(b)|0;Je(23560,d);za()}return 0}function qg(){var a=0,b=0,d=0,e=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=e+8|0;b=e;if((c[17607]|0)==1){d=1;l=e;return d|0}a=Vn(1312)|0;if(a|0){c[b>>2]=Pn(a)|0;Je(23505,b);za()}a=((c[17609]|0)+-3|0)>>>0<2&1;b=Wn(1312)|0;if(!b){d=a;l=e;return d|0}else{c[d>>2]=Pn(b)|0;Je(23560,d);za()}return 0}function rg(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;g=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=g;if((b|0)!=1){c[f>>2]=b;Ne(23929,f)}b=df(1,(d>>>0<8?8:d)+8|0)|0;if(!b){e=0;l=g;return e|0};a[b>>0]=a[23975]|0;a[b+1>>0]=a[23976]|0;a[b+2>>0]=a[23977]|0;a[b+3>>0]=1;c[b+4>>2]=e;e=b;l=g;return e|0}function sg(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=g+8|0;e=g;if(!b){c[e>>2]=b;Me(23979,e)}if(Tp(b,23975,3)|0){c[e>>2]=b;Me(23979,e)}e=a[b+3>>0]|0;if((e|0)==(d|0)){l=g;return b+8|0}else{c[f>>2]=d;c[f+4>>2]=b;c[f+8>>2]=e;Me(24027,f)}return 0}function tg(b){b=b|0;var d=0,e=0,f=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=f+8|0;d=f;if(!b){l=f;return}if(Tp(b,23975,3)|0){c[d>>2]=b;Me(24084,d)}d=a[b+3>>0]|0;if(d<<24>>24!=1){c[e>>2]=d<<24>>24;Me(24126,e)}d=c[b+4>>2]|0;if(d|0)rb[d&7](b+8|0);cf(b);l=f;return}function ug(a){a=a|0;if((c[1088]|0)!=(a|0))if((c[1806]|0)!=(a|0))if((c[1835]|0)!=(a|0))if((c[1987]|0)!=(a|0))if((c[3027]|0)==(a|0))a=12108;else{a=37665;return a|0}else a=7948;else a=7340;else a=7224;else a=4352;a=c[a+8>>2]|0;return a|0}function vg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;g=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=g;c[f>>2]=0;if((d|0)>65535){d=71;b=0}else{d=wg(f,b,d,e)|0;b=c[f>>2]|0}c[a>>2]=d|0?0:b;l=g;return d|0}function wg(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0;j=f&1;Gj();if((c[1088]|0)!=(d|0))if((c[1806]|0)!=(d|0))if((c[1835]|0)!=(d|0))if((c[1987]|0)!=(d|0))if((c[3027]|0)==(d|0)){g=12108;i=6}else{h=12;k=0}else{g=7948;i=6}else{g=7340;i=6}else{g=7224;i=6}else{g=4352;i=6}if((i|0)==6){h=(a[g+4>>0]&1)==0?0:12;k=g}g=f>>>0>15&(h|0)==0?12:h;a:do if(!g){b:do if((e|0)>=6){if((e|0)<9){switch(e|0){case 7:case 6:{i=11;break b}case 8:break;default:{h=0;g=71;break a}}if(!(c[k+36>>2]|0)){h=0;g=71;break a}if((c[k+40>>2]|0)==0?1:(c[k+20>>2]|0)!=16){h=0;g=71;break a}else break}if((e|0)<11){switch(e|0){case 9:{i=11;break b}case 10:break;default:{h=0;g=71;break a}}if(!(c[k+44>>2]|0)){h=0;g=71;break a}if(!(c[k+48>>2]|0)){h=0;g=71;break a}if(!(c[k+60>>2]|0)){h=0;g=71;break a}if((c[k>>2]|0)==316)break;else{h=0;g=71;break a}}if((e|0)>=65537)switch(e|0){case 65537:{i=11;break b}default:{h=0;g=71;break a}}switch(e|0){case 11:break;default:{h=0;g=71;break a}}if(!(c[k+36>>2]|0)){h=0;g=71;break a}if(!(c[k+40>>2]|0)){h=0;g=71;break a}if((c[k+20>>2]|0)!=16){h=0;g=71;break a}}else switch(e|0){case 5:case 2:case 3:case 1:{i=11;break b}case 4:{if(!(c[k+44>>2]|0)){h=0;g=71;break a}if(!(c[k+48>>2]|0)){h=0;g=71;break a}else break b}case 0:{if(gg()|0){h=0;g=71;break a}if(!(nf(0)|0)){h=0;g=71;break a}else break b}default:{h=0;g=71;break a}}while(0);if((i|0)==11){if(!(c[k+36>>2]|0)){h=0;g=71;break}if(!(c[k+40>>2]|0)){h=0;g=71;break}}i=(c[k+28>>2]<<1)+511|0;g=(j|0)!=0;if(g)h=ef(1,i)|0;else h=df(1,i)|0;if(!h){g=Sn()|0;break}j=h&15;l=(j|0)==0;j=16-j|0;h=l?h:h+j|0;j=l?0:j;c[h>>2]=g?1183944770:604576100;c[h+4>>2]=i-j;c[h+8>>2]=j;c[h+12>>2]=k;c[h+16>>2]=d;c[h+48>>2]=e;c[h+52>>2]=f;switch(d|0){case 9:case 8:case 7:{c[h+20>>2]=1;c[h+24>>2]=2;c[h+28>>2]=1;c[h+32>>2]=3;c[h+36>>2]=4;c[h+40>>2]=5;c[h+44>>2]=2;break}case 303:case 10:{c[h+32>>2]=6;c[h+24>>2]=7;c[h+36>>2]=8;break}default:{}}if((e|0)==11){a[h+480>>0]=16;g=0}else g=0}else h=0;while(0);c[b>>2]=g|0?0:h;return ((g|0)==0?0:g&65535|536870912)|0}function xg(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;if(!b)return;d=c[b>>2]|0;a:do if((d|0)<1183944770){switch(d|0){case 604576100:break a;default:{}}Be(63,24175)}else{switch(d|0){case 1183944770:break a;default:{}}Be(63,24175)}while(0);c[b>>2]=0;j=c[b+8>>2]|0;d=c[b+4>>2]|0;if((d|0)!=0&(b&7|0)!=0){e=b;do{a[e>>0]=0;e=e+1|0;d=d+-1|0}while((d|0)!=0&(e&7|0)!=0)}else e=b;if(d>>>0>=8){h=d+-8|0;i=h&-8;g=i+8|0;f=e;while(1){k=f;c[k>>2]=0;c[k+4>>2]=0;d=d+-8|0;if(d>>>0<=7)break;else f=f+8|0}e=e+g|0;d=h-i|0}if(d|0)while(1){a[e>>0]=0;d=d+-1|0;if(!d)break;else e=e+1|0}cf(b+(0-j)|0);return}function yg(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0;n=l;l=l+16|0;if((l|0)>=(m|0))$(16);h=n;k=(e|0)==0;i=k?d:f;f=k?b:e;e=c[a+48>>2]|0;a:do if((e|0)<6)switch(e|0){case 1:{k=c[a+12>>2]|0;j=c[k+36>>2]|0;k=c[k+20>>2]|0;if(i>>>0>d>>>0){g=200;break a}if((i>>>0)%(k>>>0)|0|0){g=139;break a}d=(i>>>0)/(k>>>0)|0;if(k>>>0>i>>>0){b=0;l=n;return b|0}i=a+496|0;h=0;e=b;g=0;while(1){b=pb[j&63](i,e,f)|0;h=b>>>0>h>>>0?b:h;g=g+1|0;if(g>>>0>=d>>>0)break;else{e=e+k|0;f=f+k|0}}if(!h){b=0;l=n;return b|0}Te(h+16|0);b=0;l=n;return b|0}case 3:{g=Wl(a,b,d,f,i)|0;break a}case 2:{g=am(a,b,d,f,i)|0;break a}case 5:{g=rm(a,b,d,f,i)|0;break a}case 4:{zb[c[(c[a+12>>2]|0)+44>>2]&1](a+496|0,b,f,i);b=0;l=n;return b|0}case 0:{if((gg()|0)==0?nf(0)|0:0){if((f|0)==(b|0)){b=0;l=n;return b|0}dr(b|0,f|0,i|0)|0;b=0;l=n;return b|0}kg(24224,875,24233,0,24248);g=71;break a}default:{c[h>>2]=e;Me(24270,h)}}else{if((e|0)<9)switch(e|0){case 6:{g=dm(a,b,d,f,i)|0;break a}case 7:{g=Ul(a,b,d,f,i)|0;break a}case 8:{g=_l(a,b,d,f,i)|0;break a}default:{c[h>>2]=e;Me(24270,h)}}if((e|0)<11)switch(e|0){case 9:{g=em(a,b,d,f,i)|0;break a}case 10:{g=tm(a,b,d,f,i)|0;break a}default:{c[h>>2]=e;Me(24270,h)}}if((e|0)>=65537){switch(e|0){case 65537:{g=71;break a}default:{}}c[h>>2]=e;Me(24270,h)}switch(e|0){case 11:{g=nm(a,b,d,f,i)|0;break a}default:{c[h>>2]=e;Me(24270,h)}}}while(0);if(!((b|0)!=0&(g|0)!=0)){b=g;l=n;return b|0}Yq(b|0,66,d|0)|0;b=g;l=n;return b|0}function zg(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0;n=l;l=l+16|0;if((l|0)>=(m|0))$(16);h=n;i=(e|0)==0;e=i?b:e;i=i?d:f;f=c[a+48>>2]|0;a:do if((f|0)<6)switch(f|0){case 1:{k=c[a+12>>2]|0;j=c[k+40>>2]|0;k=c[k+20>>2]|0;if(i>>>0>d>>>0){g=200;break a}if((i>>>0)%(k>>>0)|0|0){g=139;break a}d=(i>>>0)/(k>>>0)|0;if(k>>>0>i>>>0){g=0;break a}i=a+496|0;h=0;f=b;g=0;while(1){b=pb[j&63](i,f,e)|0;h=b>>>0>h>>>0?b:h;g=g+1|0;if(g>>>0>=d>>>0)break;else{f=f+k|0;e=e+k|0}}if(!h){g=0;break a}Te(h+16|0);g=0;break a}case 3:{g=Xl(a,b,d,e,i)|0;break a}case 2:{g=bm(a,b,d,e,i)|0;break a}case 5:{g=rm(a,b,d,e,i)|0;break a}case 4:{zb[c[(c[a+12>>2]|0)+48>>2]&1](a+496|0,b,e,i);g=0;break a}case 0:{if((gg()|0)==0?nf(0)|0:0){if((e|0)==(b|0)){g=0;break a}dr(b|0,e|0,i|0)|0;g=0;break a}kg(24224,992,24303,0,24248);g=71;break a}default:{c[h>>2]=f;Me(24318,h)}}else{if((f|0)<9)switch(f|0){case 6:{g=dm(a,b,d,e,i)|0;break a}case 7:{g=Vl(a,b,d,e,i)|0;break a}case 8:{g=$l(a,b,d,e,i)|0;break a}default:{c[h>>2]=f;Me(24318,h)}}if((f|0)<11)switch(f|0){case 9:{g=hm(a,b,d,e,i)|0;break a}case 10:{g=um(a,b,d,e,i)|0;break a}default:{c[h>>2]=f;Me(24318,h)}}if((f|0)>=65537){switch(f|0){case 65537:{g=71;break a}default:{}}c[h>>2]=f;Me(24318,h)}switch(f|0){case 11:{g=qm(a,b,d,e,i)|0;break a}default:{c[h>>2]=f;Me(24318,h)}}}while(0);l=n;return g|0}function Ag(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;f=b+12|0;g=b+496|0;e=pb[c[(c[f>>2]|0)+32>>2]&63](g,d,e)|0;if(e|0){b=b+56|0;a[b>>0]=a[b>>0]&-2;return e|0}d=c[(c[f>>2]|0)+28>>2]|0;cr(g+d|0,g|0,d|0)|0;d=b+56|0;a[d>>0]=a[d>>0]|1;d=c[b+48>>2]|0;if((d|0)<10){switch(d|0){case 9:break;default:return e|0}im(b);return e|0}if((d|0)<65537){switch(d|0){case 10:break;default:return e|0}vm(b);return e|0}else{switch(d|0){case 65537:break;default:return e|0}cm(b)|0;return e|0}return 0}function Bg(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;if((l|0)>=(m|0))$(16);j=k;switch(c[b+48>>2]|0){case 8:{e=Yl(b,d,e)|0;l=k;return e|0}case 9:{e=fm(b,d,e)|0;l=k;return e|0}case 10:{e=sm(b,d,e)|0;l=k;return e|0}case 11:{e=mm(b,d,e)|0;l=k;return e|0}default:{i=b+12|0;g=c[i>>2]|0;f=c[g+60>>2]|0;if(f|0){ub[f&7](b+496|0,d,e);e=0;l=k;return e|0}h=b+64|0;f=g+20|0;Yq(h|0,0,c[f>>2]|0)|0;if(!d){e=b+56|0;a[e>>0]=a[e>>0]&-3}else{f=c[f>>2]|0;if((f|0)==(e|0))f=e;else{c[j>>2]=e;c[j+4>>2]=f;Je(24351,j);kg(24224,682,24394,0,24407);f=c[(c[i>>2]|0)+20>>2]|0}cr(h|0,d|0,(f>>>0>>0?f:e)|0)|0;e=b+56|0;a[e>>0]=a[e>>0]|2}c[b+112>>2]=0;e=0;l=k;return e|0}}return 0}function Cg(){return 0}function Dg(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;if((c[1088]|0)!=(b|0))if((c[1806]|0)!=(b|0))if((c[1835]|0)!=(b|0))if((c[1987]|0)!=(b|0))if((c[3027]|0)==(b|0)){f=12108;h=6}else{f=0;d=0;h=9}else{f=7948;h=6}else{f=7340;h=6}else{f=7224;h=6}else{f=4352;h=6}if((h|0)==6)if((a[f+4>>0]&1)==0?(g=c[f+52>>2]|0,(g|0)!=0):0)f=pb[g&63](b,d,e)|0;else{d=1;h=9}if((h|0)==9)if(!e)f=12;else{if(d?(a[f+4>>0]&1)==0:0)f=37736;else f=d?37697:37716;zb[e&1](37899,b,37758,f);f=12}return ((f|0)==0?0:f&65535|16777216)|0}function Eg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+64|0;if((l|0)>=(m|0))$(64);r=s+48|0;p=s+40|0;o=s+32|0;n=s+24|0;k=s+16|0;j=s+8|0;i=s;q=s+52|0;a:do if(!b)if((a|0)!=192){switch(a|0){case 224:case 256:{g=(a|0)==224?2:3;break a}default:{}}if((a|0)!=384)if((a|0)!=521)if((a|0)!=160)if((a|0)!=320)if((a|0)!=512)if((a|0)==511)g=17;else{d=188;l=s;return d|0}else g=12;else g=10;else g=6;else g=5;else g=4}else g=1;else{a=0;while(1){if(!(Go(b,c[1356+(a*48|0)>>2]|0)|0))break;a=a+1|0;if((a|0)==21){a=0;g=2412;h=5;break}}b:do if((h|0)==5){while(1){h=0;f=a+1|0;if(!(Go(b,c[2412+(a<<3)+4>>2]|0)|0))break;if((f|0)==36){a=188;h=47;break}else{a=f;g=2412+(f<<3)|0;h=5}}if((h|0)==47){l=s;return a|0}f=c[g>>2]|0;a=0;while(1){if(!(Go(f,c[1356+(a*48|0)>>2]|0)|0))break b;a=a+1|0;if((a|0)==21){a=188;break}}l=s;return a|0}while(0);if((a|0)<0){d=188;l=s;return d|0}else g=a}while(0);b=c[1356+(g*48|0)>>2]|0;if(!((g+-1|0)>>>0<5|(gg()|0)==0)){d=60;l=s;return d|0}if(e|0)c[e>>2]=c[1356+(g*48|0)+4>>2];if(!d){d=0;l=s;return d|0}c[d>>2]=c[1356+(g*48|0)+12>>2];c[d+4>>2]=c[1356+(g*48|0)+16>>2];a=d+8|0;do if(!(c[a>>2]|0)){f=Sk(q,4,c[1356+(g*48|0)+20>>2]|0,0,0)|0;if(!f){c[a>>2]=c[q>>2];break}else{c[i>>2]=Pn(f)|0;Me(35626,i)}}while(0);a=d+12|0;do if(!(c[a>>2]|0)){f=Sk(q,4,c[1356+(g*48|0)+24>>2]|0,0,0)|0;if(!f){c[a>>2]=c[q>>2];break}else{c[j>>2]=Pn(f)|0;Me(35626,j)}}while(0);a=d+16|0;do if(!(c[a>>2]|0)){f=Sk(q,4,c[1356+(g*48|0)+28>>2]|0,0,0)|0;if(!f){c[a>>2]=c[q>>2];break}else{c[k>>2]=Pn(f)|0;Me(35626,k)}}while(0);a=d+32|0;do if(!(c[a>>2]|0)){f=Sk(q,4,c[1356+(g*48|0)+32>>2]|0,0,0)|0;if(!f){c[a>>2]=c[q>>2];break}else{c[n>>2]=Pn(f)|0;Me(35626,n)}}while(0);a=d+36|0;do if(!(c[a>>2]|0)){f=Sk(q,4,c[1356+(g*48|0)+44>>2]|0,0,0)|0;if(!f){c[a>>2]=c[q>>2];break}else{c[o>>2]=Pn(f)|0;Me(35626,o)}}while(0);a=d+20|0;do if(!(c[a>>2]|0)){f=Sk(q,4,c[1356+(g*48|0)+36>>2]|0,0,0)|0;if(!f){c[a>>2]=c[q>>2];break}else{c[p>>2]=Pn(f)|0;Me(35626,p)}}while(0);f=d+24|0;do if(!(c[f>>2]|0)){a=Sk(q,4,c[1356+(g*48|0)+40>>2]|0,0,0)|0;if(!a){c[f>>2]=c[q>>2];break}else{c[r>>2]=Pn(a)|0;Me(35626,r)}}while(0);a=d+28|0;if(!(c[a>>2]|0))c[a>>2]=kl(1)|0;a=d+40|0;if(c[a>>2]|0){d=0;l=s;return d|0}c[a>>2]=b;d=0;l=s;return d|0}function Fg(b,d,e,f,g,h,i,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;y=l;l=l+48|0;if((l|0)>=(m|0))$(48);x=y+40|0;v=y+32|0;u=y+24|0;t=y+16|0;s=y+8|0;r=y;w=y+44|0;n=0;while(1){if(!(Go(b,c[1356+(n*48|0)>>2]|0)|0)){b=n;break}n=n+1|0;if((n|0)==21){n=0;p=2412;q=5;break}}a:do if((q|0)==5){while(1){q=0;o=n+1|0;if(!(Go(b,c[2412+(n<<3)+4>>2]|0)|0))break;if((o|0)==36){n=188;q=40;break}else{n=o;p=2412+(o<<3)|0;q=5}}if((q|0)==40){l=y;return n|0}o=c[p>>2]|0;n=0;while(1){if(!(Go(o,c[1356+(n*48|0)>>2]|0)|0)){b=n;break a}n=n+1|0;if((n|0)==21){n=188;break}}l=y;return n|0}while(0);if((b|0)<0){x=188;l=y;return x|0}do if(i|0){n=(c[1356+(b*48|0)+36>>2]|0)+2|0;p=Fo(n)|0;o=(c[1356+(b*48|0)+40>>2]|0)+2|0;p=_e(p+5+(Fo(o)|0)|0)|0;if(!p){x=Sn()|0;l=y;return x|0}a[p>>0]=a[35365]|0;a[p+1>>0]=a[35366]|0;a[p+2>>0]=a[35367]|0;a[p+3>>0]=a[35368]|0;a[p+4>>0]=a[35369]|0;Mp(Np(p+4|0,n)|0,o)|0;Jl(c[i>>2]|0);n=Sk(w,4,p,0,0)|0;if(!n){c[i>>2]=c[w>>2];cf(p);break}else{c[r>>2]=Pn(n)|0;Me(35626,r)}}while(0);if(d|0)c[d>>2]=c[1356+(b*48|0)+12>>2];if(e|0)c[e>>2]=c[1356+(b*48|0)+16>>2];do if(f|0){Jl(c[f>>2]|0);n=Sk(w,4,c[1356+(b*48|0)+20>>2]|0,0,0)|0;if(!n){c[f>>2]=c[w>>2];break}else{c[s>>2]=Pn(n)|0;Me(35626,s)}}while(0);do if(g|0){Jl(c[g>>2]|0);n=Sk(w,4,c[1356+(b*48|0)+24>>2]|0,0,0)|0;if(!n){c[g>>2]=c[w>>2];break}else{c[t>>2]=Pn(n)|0;Me(35626,t)}}while(0);do if(h|0){Jl(c[h>>2]|0);n=Sk(w,4,c[1356+(b*48|0)+28>>2]|0,0,0)|0;if(!n){c[h>>2]=c[w>>2];break}else{c[u>>2]=Pn(n)|0;Me(35626,u)}}while(0);do if(j|0){Jl(c[j>>2]|0);n=Sk(w,4,c[1356+(b*48|0)+32>>2]|0,0,0)|0;if(!n){c[j>>2]=c[w>>2];break}else{c[v>>2]=Pn(n)|0;Me(35626,v)}}while(0);if(!k){x=0;l=y;return x|0}Jl(c[k>>2]|0);n=Sk(w,4,c[1356+(b*48|0)+44>>2]|0,0,0)|0;if(n|0){c[x>>2]=Pn(n)|0;Me(35626,x)}c[k>>2]=c[w>>2];x=0;l=y;return x|0}function Gg(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;C=l;l=l+144|0;if((l|0)>=(m|0))$(144);w=C+80|0;v=C+72|0;u=C+64|0;t=C+56|0;s=C+48|0;r=C+40|0;x=C+32|0;q=C;z=C+88|0;A=C+84|0;c[A>>2]=0;f=z;g=f+44|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(g|0));B=(d|0)!=0;if(B)c[d>>2]=0;if(!a){if(!((b|0)>-1&b>>>0<22)){d=0;l=C;return d|0}e=c[1356+(b*48|0)>>2]|0;if(!B){d=e;l=C;return d|0}c[d>>2]=c[1356+(b*48|0)+4>>2];d=e;l=C;return d|0}j=z+8|0;k=z+12|0;n=z+16|0;o=z+32|0;p=z+36|0;c[q>>2]=j;c[q+4>>2]=k;c[q+8>>2]=n;c[q+12>>2]=A;c[q+16>>2]=o;c[q+20>>2]=p;c[q+24>>2]=0;a:do switch(((If(a,0,35370,q)|0)&65535)<<16>>16){case 68:{e=uf(a,46925,5)|0;if((e|0)!=0?(h=zf(e,1)|0,sf(e),(h|0)!=0):0){e=0;while(1){f=c[1356+(e*48|0)>>2]|0;if(!(Go(h,f)|0)){b=e;break}e=e+1|0;if((e|0)==21){e=0;g=2412;i=13;break}}b:do if((i|0)==13){while(1){i=0;f=e+1|0;if(!(Go(h,c[2412+(e<<3)+4>>2]|0)|0)){i=14;break}if((f|0)==36)break;else{e=f;g=2412+(f<<3)|0;i=13}}if((i|0)==14){f=c[g>>2]|0;e=0;do{g=c[1356+(e*48|0)>>2]|0;if(!(Go(f,g)|0)){b=e;f=g;break b}e=e+1|0}while((e|0)!=21)}cf(h);d=0;l=C;return d|0}while(0);cf(h);e=(b|0)<0;if(e|B^1){d=e?0:f;l=C;return d|0}c[d>>2]=c[1356+(b*48|0)+4>>2];d=f;l=C;return d|0}else{y=0;e=0}break}case 0:{if(c[A>>2]|0?(i=z+20|0,Pj(i),_g(i,c[A>>2]|0)|0):0){y=0;e=0;break a}b=z+20|0;a=z+24|0;h=0;f=0;g=1356;while(1){tl(f);f=Sk(q,4,c[1356+(h*48|0)+20>>2]|0,0,0)|0;if(f|0){i=24;break}f=c[q>>2]|0;if(!(wk(f,c[j>>2]|0)|0)){tl(f);f=Sk(q,4,c[1356+(h*48|0)+24>>2]|0,0,0)|0;if(f|0){i=27;break}f=c[q>>2]|0;if(!(wk(f,c[k>>2]|0)|0)){tl(f);f=Sk(q,4,c[1356+(h*48|0)+28>>2]|0,0,0)|0;if(f|0){i=30;break}f=c[q>>2]|0;if(!(wk(f,c[n>>2]|0)|0)){tl(f);f=Sk(q,4,c[1356+(h*48|0)+32>>2]|0,0,0)|0;if(f|0){i=33;break}f=c[q>>2]|0;if(!(wk(f,c[o>>2]|0)|0)){tl(f);f=Sk(q,4,c[1356+(h*48|0)+44>>2]|0,0,0)|0;if(f|0){i=36;break}f=c[q>>2]|0;if(!(wk(f,c[p>>2]|0)|0)){tl(f);f=Sk(q,4,c[1356+(h*48|0)+36>>2]|0,0,0)|0;if(f|0){i=39;break}f=c[q>>2]|0;if(!(wk(f,c[b>>2]|0)|0)){tl(f);f=Sk(q,4,c[1356+(h*48|0)+40>>2]|0,0,0)|0;if(f|0){i=42;break}f=c[q>>2]|0;if(!(wk(f,c[a>>2]|0)|0)){i=44;break}}}}}}}g=h+1|0;if((g|0)==21){y=f;e=0;break a}else{h=g;g=1356+(g*48|0)|0}}if((i|0)==24){c[x>>2]=Pn(f)|0;Me(35626,x)}else if((i|0)==27){c[r>>2]=Pn(f)|0;Me(35626,r)}else if((i|0)==30){c[s>>2]=Pn(f)|0;Me(35626,s)}else if((i|0)==33){c[t>>2]=Pn(f)|0;Me(35626,t)}else if((i|0)==36){c[u>>2]=Pn(f)|0;Me(35626,u)}else if((i|0)==39){c[v>>2]=Pn(f)|0;Me(35626,v)}else if((i|0)==42){c[w>>2]=Pn(f)|0;Me(35626,w)}else if((i|0)==44){e=c[g>>2]|0;if(!B){y=f;break a}c[d>>2]=c[1356+(h*48|0)+4>>2];y=f;break a}break}default:{y=0;e=0}}while(0);Jl(y);Jl(c[j>>2]|0);Jl(c[k>>2]|0);Jl(c[n>>2]|0);Jl(c[A>>2]|0);Rj(z+20|0);Jl(c[o>>2]|0);Jl(c[p>>2]|0);d=e;l=C;return d|0}function Hg(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;u=l;l=l+16|0;if((l|0)>=(m|0))$(16);r=u+12|0;s=u+8|0;t=u+4|0;p=u;c[r>>2]=0;c[s>>2]=0;c[t>>2]=0;c[p>>2]=0;c[a>>2]=0;q=(b|0)!=0;do if(q){f=uf(b,46885,0)|0;if(f|0?(e=Eh(f,p,0)|0,sf(f),e|0):0){j=0;i=0;h=0;g=0;f=0;break}k=uf(b,46925,5)|0;if(k|0?(c[p>>2]&512|0)==0:0){j=0;i=0;h=0;g=0;f=0;o=19;break}e=uf(b,46949,0)|0;if(e){n=Af(e,1,5)|0;f=n;sf(e);if(!n){e=65;j=0;i=0;h=0;g=0;break}}else f=0;e=uf(b,39071,0)|0;if(e){n=Af(e,1,5)|0;g=n;sf(e);if(!n){e=65;j=0;i=0;h=0;break}}else g=0;e=uf(b,35378,0)|0;if(e){n=Af(e,1,5)|0;h=n;sf(e);if(!n){e=65;j=0;i=0;break}}else h=0;e=Ig(s,b,35380,0)|0;if(!e){e=uf(b,39075,0)|0;if(e){n=Af(e,1,5)|0;i=n;sf(e);if(!n){e=65;j=0;break}}else i=0;e=uf(b,35382,0)|0;if(e){n=Af(e,1,5)|0;j=n;sf(e);if(!n)e=65;else o=17}else{j=0;o=17}}else{j=0;i=0}}else{k=0;j=0;i=0;h=0;g=0;f=0;o=17}while(0);if((o|0)==17){e=(k|0)!=0;if((d|0)!=0|e)if(e)o=19;else{k=0;o=20}else{k=0;d=0;n=f;o=37}}if((o|0)==19){e=zf(k,1)|0;sf(k);if(!e)e=65;else{k=e;o=20}}do if((o|0)==20){n=df(1,44)|0;if(!n){e=Sn()|0;cf(k);break}e=Eg(0,k|0?k:d,n,0)|0;cf(k);if(e|0){cf(n);break}d=c[n>>2]|0;k=c[n+4>>2]|0;if(!f){o=n+8|0;f=c[o>>2]|0;c[o>>2]=0}if(!g){o=n+12|0;g=c[o>>2]|0;c[o>>2]=0}if(!h){o=n+16|0;h=c[o>>2]|0;c[o>>2]=0}if(!(c[s>>2]|0)){v=n+20|0;e=n+24|0;o=n+28|0;c[s>>2]=Tj(0,c[v>>2]|0,c[e>>2]|0,c[o>>2]|0)|0;c[v>>2]=0;c[e>>2]=0;c[o>>2]=0}if(!i){v=n+32|0;i=c[v>>2]|0;c[v>>2]=0}if(!j){v=n+36|0;e=c[v>>2]|0;c[v>>2]=0}else e=j;Ug(n);cf(n);j=e;n=f;o=37}while(0);do if((o|0)==37){e=Wj(r,d,k,c[p>>2]|0,n,g,h)|0;if(!e){k=sg(c[r>>2]|0,1)|0;if(h|0){v=k+24|0;tl(c[v>>2]|0);c[v>>2]=h}e=c[s>>2]|0;if(e|0){c[k+28>>2]=e;c[s>>2]=0}if(i|0)c[k+32>>2]=i;if(j|0)c[k+36>>2]=j;if(q){e=Ig(t,b,46923,k)|0;if(e|0){j=0;i=0;h=0;f=n;break}f=uf(b,35384,0)|0;if(f){e=Af(f,1,5)|0;sf(f);if(!e){e=65;j=0;i=0;h=0;f=n;break}}else e=0}else e=0;f=c[t>>2]|0;if(f|0){c[k+40>>2]=f;c[t>>2]=0}if(e|0)c[k+44>>2]=e;c[a>>2]=c[r>>2];c[r>>2]=0;e=0;j=0;i=0;h=0;f=n}else f=n}while(0);tg(c[r>>2]|0);tl(f);tl(g);tl(h);Qj(c[s>>2]|0);tl(i);tl(j);Qj(c[t>>2]|0);tl(0);l=u;return e|0}function Ig(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;g=uf(d,e,0)|0;if(g){h=Af(g,1,8)|0;sf(g);if(!h){b=65;return b|0}g=Oj(0)|0;if((f|0)!=0?(c[f+4>>2]|0)==1:0)f=Pg(h,f,g,0,0)|0;else f=_g(g,h)|0;tl(h);if(f){Qj(g);b=f;return b|0}}else{j=_e((Fo(e)|0)+3|0)|0;if(!j){b=Sn()|0;return b|0}g=Np(j,e)|0;a[g>>0]=a[35386]|0;a[g+1>>0]=a[35387]|0;a[g+2>>0]=a[35388]|0;g=uf(d,j,0)|0;if(g){f=Af(g,1,5)|0;sf(g);if(!f){cf(j);b=65;return b|0}}else f=0;g=Np(j,e)|0;a[g>>0]=a[35389]|0;a[g+1>>0]=a[35390]|0;a[g+2>>0]=a[35391]|0;g=uf(d,j,0)|0;if(g){h=Af(g,1,5)|0;sf(g);if(!h){tl(f);cf(j);b=65;return b|0}else i=h}else i=0;h=Np(j,e)|0;a[h>>0]=a[35392]|0;a[h+1>>0]=a[35393]|0;a[h+2>>0]=a[35394]|0;h=uf(d,j,0)|0;if(h){g=Af(h,1,5)|0;sf(h);if(!g){tl(i);tl(f);cf(j);b=65;return b|0}}else g=El(0,1)|0;if((f|0)!=0&(i|0)!=0)g=Tj(0,f,i,g)|0;else{tl(f);tl(i);tl(g);g=0}cf(j)}if(!g){b=0;return b|0}c[b>>2]=g;b=0;return b|0}function Jg(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;o=l;l=l+112|0;if((l|0)>=(m|0))$(112);j=o+8|0;h=o;b=o+108|0;i=o+64|0;k=o+36|0;n=o+32|0;d=i;e=d+44|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(e|0));if(Eg(0,a,i,b)|0){n=0;l=o;return n|0}f=Hl(0)|0;g=Hl(0)|0;d=i+8|0;e=i+12|0;a=Uj(0,0,0,c[d>>2]|0,c[e>>2]|0,0)|0;b=i+20|0;if(Nj(f,g,b,a)|0)Me(35395,h);Yj(a);Rj(b);b=c[d>>2]|0;c[k>>2]=b;p=c[e>>2]|0;c[k+4>>2]=p;d=c[i+16>>2]|0;c[k+8>>2]=d;a=b;e=Yg(f,g,a)|0;c[k+12>>2]=e;h=c[i+32>>2]|0;c[k+16>>2]=h;i=c[i+36>>2]|0;c[k+20>>2]=i;c[k+24>>2]=0;tl(f);tl(g);c[j>>2]=a;c[j+4>>2]=p;c[j+8>>2]=d;c[j+12>>2]=e;c[j+16>>2]=h;c[j+20>>2]=i;if(Df(n,0,35444,j)|0)c[n>>2]=0;if(b|0){b=0;do{Jl(a);b=b+1|0;a=c[k+(b<<2)>>2]|0}while((a|0)!=0)}p=c[n>>2]|0;l=o;return p|0}function Kg(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;z=l;l=l+16|0;if((l|0)>=(m|0))$(16);x=z+4|0;y=z;q=a[b>>0]|0;a:do if(q<<24>>24){if((Go(b,46949)|0)==0?(f=c[d+16>>2]|0,f|0):0){if(!(e|0?1:(c[f+12>>2]&32|0)==0))break;f=yl(f)|0;break}if((Go(b,39071)|0)==0?(n=c[d+20>>2]|0,n|0):0){if(!(e|0?1:(c[n+12>>2]&32|0)==0)){f=n;break}f=yl(n)|0;break}if((Go(b,35378)|0)==0?(o=c[d+24>>2]|0,o|0):0){if(!(e|0?1:(c[o+12>>2]&32|0)==0)){f=o;break}f=yl(o)|0;break}if((Go(b,39075)|0)==0?(p=c[d+32>>2]|0,p|0):0){if(!(e|0?1:(c[p+12>>2]&32|0)==0)){f=p;break}f=yl(p)|0;break}if((Go(b,35382)|0)==0?(r=c[d+36>>2]|0,r|0):0){if(!(e|0?1:(c[r+12>>2]&32|0)==0)){f=r;break}f=yl(r)|0;break}if((Go(b,35384)|0)==0?(s=c[d+44>>2]|0,s|0):0){if(!(e|0?1:(c[s+12>>2]&32|0)==0)){f=s;break}f=yl(s)|0;break}if(((Go(b,35492)|0)==0?(t=c[d+28>>2]|0,t|0):0)?(u=c[t>>2]|0,u|0):0){if(!(e|0?1:(c[u+12>>2]&32|0)==0)){f=u;break}f=yl(u)|0;break}if(((Go(b,35496)|0)==0?(v=c[d+28>>2]|0,v|0):0)?(w=c[v+4>>2]|0,w|0):0){if(!(e|0?1:(c[w+12>>2]&32|0)==0)){f=w;break}f=yl(w)|0;break}if(((Go(b,35500)|0)==0?(g=c[d+40>>2]|0,g|0):0)?(h=c[g>>2]|0,h|0):0){if(!(e|0?1:(c[h+12>>2]&32|0)==0)){f=h;break}f=yl(h)|0;break}if(((Go(b,35504)|0)==0?(i=c[d+40>>2]|0,i|0):0)?(j=c[i+4>>2]|0,j|0):0){y=c[(c[d+28>>2]|0)+4>>2]|0;if(y|0?!(e|0?1:(c[y+12>>2]&32|0)==0):0){f=j;break}f=yl(j)|0;break}if((Go(b,35380)|0)==0?(k=c[d+28>>2]|0,k|0):0){f=Zg(k,d)|0;break}if(q<<24>>24==113){h=b+1|0;g=a[h>>0]|0;switch(g<<24>>24){case 64:case 0:break;default:{f=0;break a}}i=d+40|0;f=c[i>>2]|0;if(!f){f=$g(0,d,0,0)|0;c[i>>2]=f;if(!f){f=0;break}g=a[h>>0]|0}if(g<<24>>24!=64){f=Zg(f,d)|0;break}if((Go(b+2|0,49614)|0)==0?(c[d>>2]|0)==2:0)if(!(Mg(f,d,0,0,0,x,y)|0)){f=ul(0,c[x>>2]|0,c[y>>2]<<3)|0;break}else{f=0;break}else f=0}else f=0}else f=0;while(0);l=z;return f|0}function Lg(a,b){a=a|0;b=b|0;var d=0;if((Go(a,35380)|0)==0?(d=c[b+28>>2]|0,d|0):0){b=Oj(0)|0;Al(c[b>>2]|0,c[d>>2]|0)|0;Al(c[b+4>>2]|0,c[d+4>>2]|0)|0;Al(c[b+8>>2]|0,c[d+8>>2]|0)|0;return b|0}if(Go(a,46923)|0){b=0;return b|0}d=b+40|0;a=c[d>>2]|0;if(!a){a=$g(0,b,0,0)|0;c[d>>2]=a;if(!a){b=0;return b|0}}b=Oj(0)|0;Al(c[b>>2]|0,c[a>>2]|0)|0;Al(c[b+4>>2]|0,c[a+4>>2]|0)|0;Al(c[b+8>>2]|0,c[a+8>>2]|0)|0;return b|0}function Mg(b,e,f,g,h,i,j){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+16|0;if((l|0)>=(m|0))$(16);k=s;o=s+4|0;r=(f|0)!=0;if(r)q=f;else q=Hl(0)|0;p=(g|0)!=0;if(p)n=g;else n=Hl(0)|0;if(!(Nj(q,n,b,e)|0)){b=(h|0)!=0;h=b&1;f=Qk(n,(c[e+12>>2]|0)>>>3,b<<31>>31,o,0)|0;if(!f)f=Sn()|0;else{e=(mk(q,0)|0)!=0;g=c[o>>2]|0;if(e&(g|0)!=0){e=f+(g+((b^1)<<31>>31))|0;a[e>>0]=d[e>>0]|0|128}if(b)a[f>>0]=64;c[i>>2]=f;c[j>>2]=(c[o>>2]|0)+h;f=0}}else{Le(35508,k);f=63}if(!r)tl(q);if(p){l=s;return f|0}tl(n);l=s;return f|0}function Ng(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;o=l;l=l+16|0;if((l|0)>=(m|0))$(16);j=o+12|0;i=o+8|0;k=o+4|0;n=o;if(!b){n=65;l=o;return n|0}if(!(c[b+12>>2]&4)){n=65;l=o;return n|0}f=wl(b,i)|0;if(!f){n=65;l=o;return n|0}h=(c[i>>2]|0)+7|0;g=h>>>3;c[i>>2]=g;if(h>>>0<16|(g&1|0)==0){n=0;l=o;return n|0}switch(a[f>>0]|0){case 4:{h=f+1|0;f=Sk(k,1,h,(g+-1|0)>>>1,0)|0;if(f|0){n=f;l=o;return n|0}f=((c[i>>2]|0)+-1|0)>>>1;f=Sk(n,1,h+f|0,f,0)|0;g=c[k>>2]|0;if(f|0){tl(g);n=f;l=o;return n|0}h=Qk(c[n>>2]|0,e>>>3,0,j,0)|0;if(!h){g=Sn()|0;f=0}else{e=(mk(g,0)|0)!=0;f=c[j>>2]|0;if(e&(f|0)!=0){f=h+(f+-1)|0;a[f>>0]=d[f>>0]|128;f=c[j>>2]|0}g=0;f=f<<3}tl(c[k>>2]|0);tl(c[n>>2]|0);if(g|0){n=g;l=o;return n|0}ul(b,h,f)|0;n=0;l=o;return n|0}case 64:{if(vl(b,f+1|0,(g<<3)+-8|0)|0){n=0;l=o;return n|0}n=Sn()|0;l=o;return n|0}default:{n=0;l=o;return n|0}}return 0}function Og(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;q=l;l=l+16|0;if((l|0)>=(m|0))$(16);p=q+8|0;g=q;n=q+12|0;if((c[e+4>>2]|0)!=1){d=69;l=q;return d|0}do if(!(c[17611]|0)){f=Sk(n,4,35561,0,0)|0;if(!f){c[17611]=c[n>>2];break}else{c[g>>2]=Pn(f)|0;Me(35626,g)}}while(0);if(!(c[17612]|0))c[17612]=El(0,7)|0;g=Hl(0)|0;h=Hl(0)|0;i=Hl(0)|0;j=Hl(0)|0;k=e+16|0;Lk(g,b,b,c[k>>2]|0);Lk(h,c[e+24>>2]|0,g,c[k>>2]|0);gk(g,g,1);ek(h,h,1);e=Ml(3)|0;Mk(i,h,e,c[k>>2]|0);Mk(j,h,c[17612]|0,c[k>>2]|0);Lk(j,j,g,c[k>>2]|0);Mk(j,j,c[17611]|0,c[k>>2]|0);Lk(j,j,g,c[k>>2]|0);Lk(a,j,i,c[k>>2]|0);Lk(j,a,a,c[k>>2]|0);Lk(j,j,h,c[k>>2]|0);zl(j,j);if(!(wk(j,g)|0)){f=c[17613]|0;do if(!f){f=Sk(n,4,35661,0,0)|0;if(!f){o=c[n>>2]|0;c[17613]=o;break}else{c[p>>2]=Pn(f)|0;Me(35626,p)}}else o=f;while(0);Lk(a,a,o,c[k>>2]|0);Lk(j,a,a,c[k>>2]|0);Lk(j,j,h,c[k>>2]|0);zl(j,j);f=(wk(j,g)|0)==0;f=f?65:0}else f=0;if((mk(a,0)|0)!=((d|0)!=0|0))hk(a,c[k>>2]|0,a);tl(j);tl(i);tl(h);tl(g);d=f;l=q;return d|0}function Pg(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;r=l;l=l+16|0;if((l|0)>=(m|0))$(16);k=r+12|0;q=r+8|0;n=r+4|0;o=r;if((b|0)!=0?(c[b+12>>2]&4|0)!=0:0){j=wl(b,q)|0;if(!j){f=65;l=r;return f|0}i=(c[q>>2]|0)+7|0;b=i>>>3;c[q>>2]=b;a:do if(!(i>>>0<16|(b&1|0)==0)){switch(a[j>>0]|0){case 4:break;case 64:{b=b+-1|0;c[q>>2]=b;j=j+1|0;break a}default:break a}i=j+1|0;b=Sk(n,1,i,(b+-1|0)>>>1,0)|0;b:do if(!b){b=((c[q>>2]|0)+-1|0)>>>1;b=Sk(o,1,i+b|0,b,0)|0;if(b|0){tl(c[n>>2]|0);break}do if(g|0){b=c[n>>2]|0;i=Qk(c[o>>2]|0,(c[e+12>>2]|0)>>>3,0,k,0)|0;if(!i){b=Sn()|0;if(!b)break;tl(c[n>>2]|0);tl(c[o>>2]|0);break b}e=(mk(b,0)|0)!=0;b=c[k>>2]|0;if(e&(b|0)!=0){b=i+(b+-1)|0;a[b>>0]=d[b>>0]|128;b=c[k>>2]|0}c[g>>2]=i;c[h>>2]=b}while(0);Cl(c[f>>2]|0,c[n>>2]|0);Cl(c[f+4>>2]|0,c[o>>2]|0);El(c[f+8>>2]|0,1)|0;b=0}while(0);f=b;l=r;return f|0}while(0);b=_e(b|0?b:1)|0;if(!b){f=Sn()|0;l=r;return f|0}i=c[q>>2]|0;cr(b|0,j|0,i|0)|0;k=i>>>1;if(k){n=i+-1|0;j=0;do{t=b+j|0;s=a[t>>0]|0;o=b+(n-j)|0;a[t>>0]=a[o>>0]|0;a[o>>0]=s;j=j+1|0}while((j|0)!=(k|0))}}else p=24;do if((p|0)==24){b=Ok(b,(c[e+12>>2]|0)>>>3,q,0)|0;if(b|0){i=c[q>>2]|0;break}t=Sn()|0;l=r;return t|0}while(0);if(!i){n=0;i=0}else{n=d[b>>0]|0;a[b>>0]=n&127;n=n>>>7;i=c[q>>2]|0}o=f+4|0;Rk(c[o>>2]|0,b,i,0);if(g){i=c[q>>2]|0;if((n|0)!=0&(i|0)!=0){a[b>>0]=d[b>>0]|128;i=c[q>>2]|0}k=i>>>1;if(k|0){j=i+-1|0;i=0;do{p=b+i|0;s=a[p>>0]|0;t=b+(j-i)|0;a[p>>0]=a[t>>0]|0;a[t>>0]=s;i=i+1|0}while((i|0)!=(k|0))}c[g>>2]=b;if(h|0)c[h>>2]=c[q>>2]}else cf(b);t=Og(c[f>>2]|0,c[o>>2]|0,n,e)|0;El(c[f+8>>2]|0,1)|0;l=r;return t|0}function Qg(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;i=l;l=l+48|0;if((l|0)>=(m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|0)|0;r=0;s=0;Rj(j);Jl(k);Jl(n);Jl(o);cf(r);l=p;return s|0}function Sg(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;G=l;l=l+112|0;if((l|0)>=(m|0))$(112);v=G+96|0;n=G+92|0;k=G+88|0;t=G+40|0;C=G+36|0;u=G+32|0;D=G+28|0;s=G+24|0;E=G+12|0;F=G;c[C>>2]=0;c[D>>2]=0;i=t;j=i+48|0;do{c[i>>2]=0;i=i+4|0}while((i|0)<(j|0));if(!b){F=79;l=G;return F|0}if(!(c[b+12>>2]&4)){F=79;l=G;return F|0}Pj(E);Pj(F);x=Il(0)|0;y=Hl(0)|0;z=Hl(0)|0;A=Hl(0)|0;B=Uj(c[d>>2]|0,c[d+4>>2]|0,0,c[d+8>>2]|0,c[d+12>>2]|0,c[d+16>>2]|0)|0;if(((c[B+12>>2]|0)+7&-8|0)!=256){F=63;l=G;return F|0}j=Qg(k,c[d+56>>2]|0,B)|0;w=c[k>>2]|0;do if(!j){Rk(x,w,32,0);i=w;if(!h){ck(F,x,d+20|0,B);j=Mg(F,B,y,z,0,D,s)|0;if(j|0){i=0;break}if(nf(1)|0)Qe(35747,c[D>>2]|0,c[s>>2]|0)}else{j=Pg(h,B,F,D,s)|0;if(j|0){i=0;break}if(nf(1)|0)Qe(35740,c[D>>2]|0,c[s>>2]|0);if(!(dk(F,B)|0)){j=195;i=0;break}}q=wl(b,n)|0;o=((c[n>>2]|0)+7|0)>>>3;if(nf(1)|0)Qe(35754,q,o);p=t+12|0;c[p>>2]=i;k=t+4|0;c[k>>2]=32;h=t+8|0;c[h>>2]=32;b=t+28|0;c[b>>2]=q;n=t+24|0;c[n>>2]=o;j=qh(g,0,w,t,2)|0;if(!j){i=0;do{H=w+i|0;j=a[H>>0]|0;r=w+(63-i)|0;a[H>>0]=a[r>>0]|0;a[r>>0]=j;i=i+1|0}while((i|0)!=32);if(nf(1)|0)Qe(52990,w,64);Rk(A,w,64,0);ck(E,A,d+20|0,B);if(nf(1)|0)Mj(35761,E,B);j=Mg(E,B,y,z,0,C,u)|0;if(j|0){i=c[C>>2]|0;break}if(!(nf(1)|0)){j=c[C>>2]|0;i=j;r=c[u>>2]|0}else{j=c[C>>2]|0;r=c[u>>2]|0;Qe(35766,j,r);i=j}c[p>>2]=j;c[k>>2]=0;c[h>>2]=r;c[b>>2]=c[D>>2];c[t+20>>2]=0;c[n>>2]=c[s>>2];c[t+44>>2]=q;c[t+36>>2]=0;c[t+40>>2]=o;j=qh(g,0,w,t,3)|0;if(!j){ul(e,i,r<<3)|0;c[C>>2]=0;i=0;do{t=w+i|0;e=a[t>>0]|0;H=w+(63-i)|0;a[t>>0]=a[H>>0]|0;a[H>>0]=e;i=i+1|0}while((i|0)!=32);if(nf(1)|0)Qe(35773,w,64);Rk(f,w,64,0);j=d+32|0;Lk(f,f,x,c[j>>2]|0);ik(f,f,A,c[j>>2]|0);j=Ok(f,32,v,0)|0;if(!j){j=Sn()|0;if(!j){j=0;i=r}else{i=0;break}}else{c[C>>2]=j;i=c[v>>2]|0;c[u>>2]=i}if(nf(1)|0)Qe(35780,j,i);ul(f,j,i<<3)|0;c[C>>2]=0;j=0;i=0}}else i=0}else i=0;while(0);Jl(x);Jl(y);Jl(z);Jl(A);cf(w);Yj(B);Rj(E);Rj(F);cf(c[D>>2]|0);cf(i);H=j;l=G;return H|0}function Tg(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;y=l;l=l+176|0;if((l|0)>=(m|0))$(176);n=y+100|0;w=y+88|0;x=y+84|0;j=y+80|0;t=y+76|0;p=y+72|0;k=y+104|0;i=y+24|0;u=y+12|0;v=y;c[x>>2]=0;c[t>>2]=0;if(!b){x=79;l=y;return x|0}if(!(e|0?(c[b+12>>2]&4|0)!=0:0)){x=79;l=y;return x|0}if(!(f|0?(c[e+12>>2]&4|0)!=0:0)){x=79;l=y;return x|0}if(!(c[f+12>>2]&4)){x=79;l=y;return x|0}if((g|0)!=10){x=5;l=y;return x|0}Pj(w);Pj(u);Pj(v);q=Hl(0)|0;r=Hl(0)|0;s=Uj(c[d>>2]|0,c[d+4>>2]|0,0,c[d+8>>2]|0,c[d+12>>2]|0,c[d+16>>2]|0)|0;if((c[s+12>>2]&-8|0)!=256){x=63;l=y;return x|0}g=Pg(h,s,w,x,j)|0;do if(!g)if(dk(w,s)|0){if(nf(1)|0)Qe(35747,c[x>>2]|0,c[j>>2]|0);if((c[j>>2]|0)==32){h=wl(b,n)|0;b=((c[n>>2]|0)+7|0)>>>3;if(nf(1)|0)Qe(35754,h,b);o=wl(e,n)|0;g=((c[n>>2]|0)+7|0)>>>3;if(nf(1)|0)Qe(52990,o,g);if((g|0)==32){c[i+12>>2]=o;c[i+4>>2]=0;c[i+8>>2]=32;c[i+28>>2]=c[x>>2];c[i+20>>2]=0;c[i+24>>2]=c[j>>2];c[i+44>>2]=h;c[i+36>>2]=0;c[i+40>>2]=b;g=qh(10,0,k,i,3)|0;if(!g){g=0;do{e=k+g|0;i=a[e>>0]|0;j=k+(63-g)|0;a[e>>0]=a[j>>0]|0;a[j>>0]=i;g=g+1|0}while((g|0)!=32);if(nf(1)|0)Qe(35773,k,64);Rk(q,k,64,0);i=xl(f,n)|0;b=(c[n>>2]|0)+7|0;h=b>>>3;b=b>>>4;if(b|0){e=h+-1|0;g=0;do{k=i+g|0;f=a[k>>0]|0;n=i+(e-g)|0;a[k>>0]=a[n>>0]|0;a[n>>0]=f;g=g+1|0}while((g|0)!=(b|0))}if(nf(1)|0)Qe(52997,i,h);Rk(r,i,h,0);cf(i);if((h|0)==32){ck(u,r,d+20|0,s);ck(v,q,w,s);g=c[v>>2]|0;zl(g,g);ak(u,u,v,s);g=Mg(u,s,r,q,0,t,p)|0;if(!g){if((c[p>>2]|0)!=32){g=8;break}g=(Tp(c[t>>2]|0,o,32)|0)==0;g=g?0:8}}else g=139}}else g=139}else g=139}else g=195;while(0);cf(c[x>>2]|0);cf(c[t>>2]|0);Yj(s);Jl(r);Jl(q);Rj(u);Rj(v);Rj(w);x=g;l=y;return x|0}function Ug(a){a=a|0;var b=0;b=a+8|0;tl(c[b>>2]|0);c[b>>2]=0;b=a+12|0;tl(c[b>>2]|0);c[b>>2]=0;b=a+16|0;tl(c[b>>2]|0);c[b>>2]=0;Rj(a+20|0);b=a+32|0;tl(c[b>>2]|0);c[b>>2]=0;a=a+36|0;tl(c[a>>2]|0);c[a>>2]=0;return}function Vg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;e=l;l=l+48|0;if((l|0)>=(m|0))$(48);d=e;c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+40>>2]=c[b+40>>2];c[d+8>>2]=yl(c[b+8>>2]|0)|0;c[d+12>>2]=yl(c[b+12>>2]|0)|0;c[d+16>>2]=yl(c[b+16>>2]|0)|0;f=d+20|0;Pj(f);Al(c[f>>2]|0,c[b+20>>2]|0)|0;Al(c[d+24>>2]|0,c[b+24>>2]|0)|0;Al(c[d+28>>2]|0,c[b+28>>2]|0)|0;c[d+32>>2]=yl(c[b+32>>2]|0)|0;c[d+36>>2]=yl(c[b+36>>2]|0)|0;b=d;d=a+44|0;do{c[a>>2]=c[b>>2];a=a+4|0;b=b+4|0}while((a|0)<(d|0));l=e;return}function Wg(a){a=a|0;switch(a|0){case 0:{a=35795;break}case 1:{a=45456;break}case 2:{a=35787;break}default:a=37665}return a|0}function Xg(a){a=a|0;return ((a|0)==0?35815:(a|0)==1?35807:37665)|0}function Yg(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;q=l;l=l+32|0;if((l|0)>=(m|0))$(32);p=q+16|0;k=q+8|0;g=q;h=q+24|0;o=q+20|0;i=((lk(e)|0)+7|0)>>>3;j=i<<1|1;n=gf(j)|0;a[n>>0]=4;f=n+1|0;e=Tk(5,f,i,h,b)|0;if(e|0){c[g>>2]=Pn(e)|0;Me(35824,g)}e=c[h>>2]|0;if(i>>>0>e>>>0){g=i-e|0;dr(f+g|0,f|0,e|0)|0;Yq(f|0,0,g|0)|0}b=f+i|0;e=Tk(5,b,i,h,d)|0;if(e|0){c[k>>2]=Pn(e)|0;Me(35824,k)}e=c[h>>2]|0;if(i>>>0>e>>>0){k=i-e|0;dr(b+k|0,b|0,e|0)|0;Yq(b|0,0,k|0)|0}e=Sk(o,5,n,j,0)|0;if(!e){cf(n);l=q;return c[o>>2]|0}else{c[p>>2]=Pn(e)|0;Me(35846,p)}return 0}function Zg(a,b){a=a|0;b=b|0;var d=0,e=0;d=Hl(0)|0;e=Hl(0)|0;if(!(Nj(d,e,a,b)|0))a=Yg(d,e,c[b+16>>2]|0)|0;else a=0;tl(d);tl(e);return a|0}function _g(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;if((l|0)>=(m|0))$(16);h=k+12|0;i=k+8|0;j=k+4|0;e=k;do if((d|0)!=0?(c[d+12>>2]&4|0)!=0:0){d=wl(d,e)|0;if(d|0){e=((c[e>>2]|0)+7|0)>>>3;c[h>>2]=e;g=0;break}j=65;l=k;return j|0}else f=6;while(0);do if((f|0)==6){g=((lk(d)|0)+7|0)>>>3;c[h>>2]=g;e=gf(g)|0;d=Tk(5,e,g,h,d)|0;if(!d){d=e;g=e;e=c[h>>2]|0;break}cf(e);j=d;l=k;return j|0}while(0);if(!e){cf(g);j=65;l=k;return j|0}if((a[d>>0]|0)!=4){cf(g);j=69;l=k;return j|0}e=e+-1|0;if(e&1|0){cf(g);j=65;l=k;return j|0}e=e>>>1;c[h>>2]=e;d=d+1|0;e=Sk(i,5,d,e,0)|0;if(e|0){cf(g);j=e;l=k;return j|0}h=c[h>>2]|0;d=Sk(j,5,d+h|0,h,0)|0;cf(g);if(!d){Al(c[b>>2]|0,c[i>>2]|0)|0;Al(c[b+4>>2]|0,c[j>>2]|0)|0;El(c[b+8>>2]|0,1)|0;tl(c[i>>2]|0);tl(c[j>>2]|0);j=0;l=k;return j|0}else{tl(c[i>>2]|0);j=d;l=k;return j|0}return 0}function $g(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;h=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=h;if(!d)d=c[b+28>>2]|0;if(!e)e=c[b+44>>2]|0;if(!((d|0)!=0&(e|0)!=0)){b=0;l=h;return b|0}if(!(c[b+16>>2]|0)){b=0;l=h;return b|0}if(!(c[b+20>>2]|0)){b=0;l=h;return b|0}if((c[b>>2]|0)==2?(c[b+24>>2]|0)==0:0){b=0;l=h;return b|0}if((c[b+4>>2]|0)==1?c[b+8>>2]&4096|0:0){if(Qg(f,e,b)|0){b=0;l=h;return b|0}e=Il(0)|0;Rk(e,c[f>>2]|0,32,0);cf(c[f>>2]|0);if(!a){a=Oj(0)|0;if(!a)a=0;else g=15}else g=15;if((g|0)==15)ck(a,e,d,b);tl(e);b=a;l=h;return b|0}if(!a){a=Oj(0)|0;if(!a){b=0;l=h;return b|0}}ck(a,e,d,b);b=a;l=h;return b|0}function ah(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;n=l;l=l+128|0;if((l|0)>=(m|0))$(128);j=n;a:do if(th(b,8,0,0)|0)if(!e)b=5;else{zb[e&1](36051,b,37758,36151);b=5}else switch(b|0){case 2:{b=0;do{a[j+b>>0]=b;b=b+1|0}while((b|0)!=64);b=bh(2,35867,9,j,64,35877,20)|0;if(!b)if(d){a[j>>0]=48;a[j+1>>0]=49;a[j+2>>0]=50;a[j+3>>0]=51;a[j+4>>0]=52;a[j+5>>0]=53;a[j+6>>0]=54;a[j+7>>0]=55;a[j+8>>0]=56;a[j+9>>0]=57;a[j+10>>0]=58;a[j+11>>0]=59;a[j+12>>0]=60;a[j+13>>0]=61;a[j+14>>0]=62;a[j+15>>0]=63;a[j+16>>0]=64;a[j+17>>0]=65;a[j+18>>0]=66;a[j+19>>0]=67;b=bh(2,35898,9,j,20,35908,20)|0;if(!b){b=80;d=0;while(1){a[j+d>>0]=b;d=d+1|0;if((d|0)==100)break;else b=b+1|0}b=bh(2,35929,9,j,100,35939,20)|0;if(!b){b=112;d=0;while(1){a[j+d>>0]=b;d=d+1|0;if((d|0)==49)break;else b=b+1|0}b=bh(2,35960,9,j,49,35970,20)|0;if(!b)b=0;else{d=36036;k=12}}else{d=36021;k=12}}else{d=36006;k=12}}else b=0;else{d=35991;k=12}if((k|0)==12)if(!e)b=50;else{zb[e&1](36051,2,d,b);b=50}break a}case 11:{b=c[677]|0;if(!b){b=0;break a}b:do if(!d){j=c[678]|0;k=Fo(j)|0;d=c[679]|0;d=bh(11,j,k,d,Fo(d)|0,2720,28)|0;if(!d){b=0;break a}}else{f=0;while(1){j=c[2708+(f*40|0)+4>>2]|0;k=Fo(j)|0;d=c[2708+(f*40|0)+8>>2]|0;d=bh(11,j,k,d,Fo(d)|0,2708+(f*40|0)+12|0,28)|0;if(d|0)break b;f=f+1|0;b=c[2708+(f*40|0)>>2]|0;if(!b){b=0;break a}}}while(0);if(!e){b=50;break a}zb[e&1](36051,11,b,d);b=50;break a}case 8:{b=c[747]|0;if(!b){b=0;break a}c:do if(!d){h=c[748]|0;i=Fo(h)|0;d=c[749]|0;d=bh(8,h,i,d,Fo(d)|0,3e3,32)|0;if(!d){f=c[749]|0;f=Ol(f,Fo(f)|0)|0;if(f){d=c[748]|0;Pl(f,d,Fo(d)|0);d=Tl(f,j)|0;if(d)if((c[j>>2]|0)==32?(Tp(d,3e3,32)|0)==0:0){Rl(f);b=0;break a}else{d=f;k=36}else{d=f;k=33}}else d=36056}}else{i=0;while(1){g=2988+(i*44|0)+4|0;p=c[g>>2]|0;o=Fo(p)|0;f=2988+(i*44|0)+8|0;d=c[f>>2]|0;h=2988+(i*44|0)+12|0;d=bh(8,p,o,d,Fo(d)|0,h,32)|0;if(d|0)break c;d=c[f>>2]|0;d=Ol(d,Fo(d)|0)|0;if(!d){d=36056;break c}f=c[g>>2]|0;Pl(d,f,Fo(f)|0);f=Tl(d,j)|0;if(!f){k=33;break c}if((c[j>>2]|0)!=32){k=36;break c}if(Tp(f,h,32)|0){k=36;break c}Rl(d);i=i+1|0;b=c[2988+(i*44|0)>>2]|0;if(!b){b=0;break a}}}while(0);if((k|0)==33){Rl(d);d=36081}else if((k|0)==36){Rl(d);d=36111}if(!e){b=50;break a}zb[e&1](36051,8,b,d);b=50;break a}case 9:{b=c[824]|0;if(!b){b=0;break a}d:do if(!d){o=c[825]|0;p=Fo(o)|0;d=c[826]|0;d=bh(9,o,p,d,Fo(d)|0,3308,48)|0;if(!d){b=0;break a}}else{f=0;while(1){o=c[3296+(f*60|0)+4>>2]|0;p=Fo(o)|0;d=c[3296+(f*60|0)+8>>2]|0;d=bh(9,o,p,d,Fo(d)|0,3296+(f*60|0)+12|0,48)|0;if(d|0)break d;f=f+1|0;b=c[3296+(f*60|0)>>2]|0;if(!b){b=0;break a}}}while(0);if(!e){b=50;break a}zb[e&1](36051,9,b,d);b=50;break a}case 10:{b=c[929]|0;if(!b){b=0;break a}e:do if(!d){o=c[930]|0;p=Fo(o)|0;d=c[931]|0;d=bh(10,o,p,d,Fo(d)|0,3728,64)|0;if(!d){b=0;break a}}else{f=0;while(1){o=c[3716+(f*76|0)+4>>2]|0;p=Fo(o)|0;d=c[3716+(f*76|0)+8>>2]|0;d=bh(10,o,p,d,Fo(d)|0,3716+(f*76|0)+12|0,64)|0;if(d|0)break e;f=f+1|0;b=c[3716+(f*76|0)>>2]|0;if(!b){b=0;break a}}}while(0);if(!e){b=50;break a}zb[e&1](36051,10,b,d);b=50;break a}default:{b=5;break a}}while(0);l=n;return ((b|0)==0?0:b&65535|16777216)|0}function bh(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0;j=l;l=l+16|0;if((l|0)>=(m|0))$(16);i=j;do if((sh(a)|0)==(h|0))if(!(eh(i,a,2)|0)){f=(nh(c[i>>2]|0,e,f)|0)==0;e=c[i>>2]|0;if(!f){kh(e);e=36834;break}lh(e,b,d);e=ph(c[i>>2]|0,a)|0;if(!e){kh(c[i>>2]|0);e=36856;break}else{e=(Tp(e,g,h)|0)==0;kh(c[i>>2]|0);e=e?0:36819;break}}else e=49699;else e=36876;while(0);l=j;return e|0}function ch(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;if(!a){o=0;return o|0}if((Jo(a,36895,4)|0)!=0?(Jo(a,36900,4)|0)!=0:0)n=a;else n=a+4|0;f=c[1910]|0;a:do if((f|0)!=0?(g=c[f>>2]|0,(g|0)!=0):0){d=0;e=g;while(1){d=d+1|0;if(!(Op(n,e)|0)){m=7620;b=g;o=f;g=29;break a}e=c[f+(d<<2)>>2]|0;if(!e){g=9;break}}}else g=9;while(0);b:do if((g|0)==9){e=c[1944]|0;if(e|0?(h=c[e>>2]|0,h|0):0){d=0;f=h;do{d=d+1|0;if(!(Op(n,f)|0)){m=7756;b=h;o=e;g=29;break b}f=c[e+(d<<2)>>2]|0}while((f|0)!=0)}e=c[1929]|0;if(e|0?(i=c[e>>2]|0,i|0):0){d=0;f=i;do{d=d+1|0;if(!(Op(n,f)|0)){m=7696;b=i;o=e;g=29;break b}f=c[e+(d<<2)>>2]|0}while((f|0)!=0)}e=c[1960]|0;if(e|0?(j=c[e>>2]|0,j|0):0){d=0;f=j;do{d=d+1|0;if(!(Op(n,f)|0)){m=7820;b=j;o=e;g=29;break b}f=c[e+(d<<2)>>2]|0}while((f|0)!=0)}e=c[1976]|0;if(e|0?(k=c[e>>2]|0,k|0):0){d=0;f=k;do{d=d+1|0;if(!(Op(n,f)|0)){m=7884;b=k;o=e;g=29;break b}f=c[e+(d<<2)>>2]|0}while((f|0)!=0)}e=c[1869]|0;if(e|0?(l=c[e>>2]|0,l|0):0){d=0;f=l;do{d=d+1|0;if(!(Op(n,f)|0)){m=7456;b=l;o=e;g=29;break b}f=c[e+(d<<2)>>2]|0}while((f|0)!=0)}}while(0);c:do if((g|0)==29?b|0:0){d=0;while(1){d=d+1|0;if(!(Op(n,b)|0))break;b=c[o+(d<<2)>>2]|0;if(!b)break c}o=c[m>>2]|0;return o|0}while(0);if(Op(a,c[1907]|0)|0)if(Op(a,c[1941]|0)|0)if(Op(a,c[1926]|0)|0)if(Op(a,c[1957]|0)|0)if(Op(a,c[1973]|0)|0)if(!(Op(a,c[1866]|0)|0))b=7456;else{o=0;return o|0}else b=7884;else b=7820;else b=7696;else b=7756;else b=7620;o=c[b>>2]|0;return o|0}function dh(a){a=a|0;if((c[1905]|0)!=(a|0))if((c[1939]|0)!=(a|0))if((c[1924]|0)!=(a|0))if((c[1955]|0)!=(a|0))if((c[1971]|0)!=(a|0))if((c[1864]|0)==(a|0))a=7456;else{a=37665;return a|0}else a=7884;else a=7820;else a=7696;else a=7756;else a=7620;a=c[a+8>>2]|0;return a|0}function eh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=f;if(!(d&-260)){d=fh(e,b,d)|0;b=c[e>>2]|0}else{d=45;b=0}c[a>>2]=d|0?0:b;l=f;return d|0}function fh(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;g=e&1;j=(g|0)!=0;k=(e&2|0)==0;g=(g<<9^512)+535&1552;h=g+28|0;if(j)l=$e(h)|0;else l=_e(h)|0;if((l|0)==0?(f=Qn(c[(zo()|0)>>2]|0)|0,f|0):0){n=f;return n|0}i=l+g|0;c[l>>2]=i;c[l+8>>2]=g+-15;c[l+4>>2]=0;g=i+4+4|0;c[g>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;c[g+12>>2]=0;c[g+16>>2]=0;c[i>>2]=j?378630161:285677921;c[i+4>>2]=h;a[i+12>>0]=e>>>6&4|e&1;if(!k){switch(d|0){case 10:case 9:{c[i+24>>2]=128;f=256;break}case 311:case 308:{c[i+24>>2]=32;f=64;break}default:{c[i+24>>2]=64;f=128}}k=$e(f)|0;c[i+20>>2]=k;if((k|0)==0?(m=Qn(c[(zo()|0)>>2]|0)|0,gh(l),m|0):0){n=m;return n|0}}Gj();if(d|0?(n=hh(c[l>>2]|0,d)|0,n|0):0){gh(l);return n|0}c[b>>2]=l;n=0;return n|0}function gh(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0;k=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=k+16|0;i=k+8|0;j=k;if(!b){l=k;return}d=c[b>>2]|0;e=c[d+8>>2]|0;if(e){g=b+4|0;d=c[g>>2]|0;if(!d)d=e;else{f=b+12|0;if((iq(f,d,1,e)|0)!=1)He(36953,630,36958);d=c[b>>2]|0;e=c[d+16>>2]|0;if(e){do{d=c[g>>2]|0;if(!d)d=e+16|0;else{n=e+16|0;ub[c[(c[e>>2]|0)+32>>2]&7](n,f,d);d=n}ub[c[(c[e>>2]|0)+32>>2]&7](d,0,0);e=c[e+4>>2]|0}while((e|0)!=0);d=c[b>>2]|0}c[g>>2]=0;d=c[d+8>>2]|0}bq(d)|0;d=c[b>>2]|0;c[d+8>>2]=0;c[h>>2]=b;n=i;c[n>>2]=42;c[n+4>>2]=0;i=kr(c[h>>2]|0,0,c[i>>2]|0,c[i+4>>2]|0)|0;n=j;c[n>>2]=i;c[n+4>>2]=D}e=c[d+16>>2]|0;if(e){do{j=e;e=c[e+4>>2]|0;d=c[j+8>>2]|0;if((d|0)!=0&(j&7|0)!=0){f=j;do{a[f>>0]=0;f=f+1|0;d=d+-1|0}while((d|0)!=0&(f&7|0)!=0)}else f=j;if(d>>>0>=8){h=d+-8|0;i=h&-8;g=f+8|0;while(1){n=f;c[n>>2]=0;c[n+4>>2]=0;d=d+-8|0;if(d>>>0<=7)break;else f=f+8|0}f=g+i|0;d=h-i|0}if(d|0)while(1){a[f>>0]=0;d=d+-1|0;if(!d)break;else f=f+1|0}cf(j)}while((e|0)!=0);d=c[b>>2]|0}f=c[d+20>>2]|0;if(f){n=c[d+24>>2]|0;e=n<<1;if((n|0)!=0&(f&7|0)!=0){d=f;do{a[d>>0]=0;d=d+1|0;e=e+-1|0}while((e|0)!=0&(d&7|0)!=0)}else d=f;if(e>>>0>=8){g=e+-8|0;h=g&-8;i=h+8|0;f=d;while(1){n=f;c[n>>2]=0;c[n+4>>2]=0;e=e+-8|0;if(e>>>0<=7)break;else f=f+8|0}e=g-h|0;d=d+i|0}if(e|0)while(1){a[d>>0]=0;e=e+-1|0;if(!e)break;else d=d+1|0}cf(c[(c[b>>2]|0)+20>>2]|0);d=c[b>>2]|0}d=c[d+4>>2]|0;if((d|0)!=0&(b&7|0)!=0){e=b;do{a[e>>0]=0;e=e+1|0;d=d+-1|0}while((d|0)!=0&(e&7|0)!=0)}else e=b;if(d>>>0>=8){g=d+-8|0;h=g&-8;i=h+8|0;f=e;while(1){n=f;c[n>>2]=0;c[n+4>>2]=0;d=d+-8|0;if(d>>>0<=7)break;else f=f+8|0}d=g-h|0;e=e+i|0}if(d|0)while(1){a[e>>0]=0;d=d+-1|0;if(!d)break;else e=e+1|0}cf(b);l=k;return}function hh(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=i;h=b+16|0;e=c[h>>2]|0;a:do if(e|0){while(1){if((c[c[e>>2]>>2]|0)==(d|0)){e=0;break}e=c[e+4>>2]|0;if(!e)break a}l=i;return e|0}while(0);if((c[1905]|0)!=(d|0))if((c[1939]|0)!=(d|0))if((c[1924]|0)!=(d|0))if((c[1955]|0)!=(d|0))if((c[1971]|0)!=(d|0))if((c[1864]|0)==(d|0))g=7456;else{c[f>>2]=d;Oe(36905,f);h=5;l=i;return h|0}else g=7884;else g=7820;else g=7696;else g=7756;else g=7620;if(((d|0)==1?gg()|0:0)?(jg(36944),hg()|0):0){h=5;l=i;return h|0}d=(c[g+44>>2]|0)+16|0;f=b+12|0;if(!(a[f>>0]&1))e=_e(d)|0;else e=$e(d)|0;if(!e){h=Qn(c[(zo()|0)>>2]|0)|0;l=i;return h|0}else{c[e>>2]=g;c[e+4>>2]=c[h>>2];c[e+8>>2]=d;c[h>>2]=e;sb[c[g+28>>2]&7](e+16|0,(a[f>>0]&4)<<6);h=0;l=i;return h|0}return 0}function ih(b){b=b|0;var d=0,e=0,f=0;e=(c[b>>2]|0)+12|0;a[e>>0]=a[e>>0]&-3;c[b+4>>2]=0;e=c[b>>2]|0;d=c[e+16>>2]|0;if(!d)d=e;else{do{e=d+16|0;f=c[d>>2]|0;Yq(e|0,0,c[f+44>>2]|0)|0;sb[c[f+28>>2]&7](e,(a[(c[b>>2]|0)+12>>0]&4)<<6);d=c[d+4>>2]|0}while((d|0)!=0);d=c[b>>2]|0}e=c[d+20>>2]|0;if(!e)return;jh(b,e,c[d+24>>2]|0);return}function jh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=c[(c[a>>2]|0)+8>>2]|0;g=a+4|0;if(e|0){f=c[g>>2]|0;if(f|0?(iq(a+12|0,f,1,e)|0)!=1:0)He(36953,630,36958);if(d|0?(iq(b,d,1,c[(c[a>>2]|0)+8>>2]|0)|0)!=1:0)He(36953,632,36958)}e=c[(c[a>>2]|0)+16>>2]|0;if(!e){c[g>>2]=0;return}a=a+12|0;do{f=c[g>>2]|0;if(!f)f=e+16|0;else{h=e+16|0;ub[c[(c[e>>2]|0)+32>>2]&7](h,a,f);f=h}ub[c[(c[e>>2]|0)+32>>2]&7](f,b,d);e=c[e+4>>2]|0}while((e|0)!=0);c[g>>2]=0;return}function kh(a){a=a|0;gh(a);return}function lh(a,b,c){a=a|0;b=b|0;c=c|0;jh(a,b,c);return}function mh(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+32|0;if((l|0)>=(m|0))$(32);r=v+16|0;n=v+8|0;k=v;o=v+20|0;g=c[b>>2]|0;if(a[g+12>>0]&2){l=v;return}j=b+4|0;i=c[j>>2]|0;if(i){h=c[g+8>>2]|0;do if(h)if((iq(b+12|0,i,1,h)|0)==1){f=c[b>>2]|0;break}else He(36953,630,36958);else f=g;while(0);g=c[f+16>>2]|0;if(g){h=b+12|0;do{f=c[j>>2]|0;if(!f)f=g+16|0;else{i=g+16|0;ub[c[(c[g>>2]|0)+32>>2]&7](i,h,f);f=i}ub[c[(c[g>>2]|0)+32>>2]&7](f,0,0);g=c[g+4>>2]|0}while((g|0)!=0);f=c[b>>2]|0}c[j>>2]=0;g=f}f=c[g+16>>2]|0;if(!f)f=g;else{do{rb[c[(c[f>>2]|0)+36>>2]&7](f+16|0);f=c[f+4>>2]|0}while((f|0)!=0);f=c[b>>2]|0}f=f+12|0;a[f>>0]=a[f>>0]|2;f=c[b>>2]|0;if(!(c[f+20>>2]|0)){l=v;return}f=c[f+16>>2]|0;if(!f)He(36953,816,37090);if(!(c[f+4>>2]|0))g=f;else{kg(36953,980,36967,0,36979);Le(37e3,k);g=c[(c[b>>2]|0)+16>>2]|0}h=c[c[f>>2]>>2]|0;f=(g|0)==0;do if(h){if(f)He(36953,816,37090);else e=g;while(1){f=c[e>>2]|0;if((c[f>>2]|0)==(h|0)){p=29;break}e=c[e+4>>2]|0;if(!e){p=31;break}}if((p|0)==29){s=tb[c[f+40>>2]&15](e+16|0)|0;q=0;u=h;break}else if((p|0)==31)He(36953,816,37090)}else{if(f)He(36953,816,37090);if(c[g+4>>2]|0)Oe(37051,n);s=tb[c[(c[g>>2]|0)+40>>2]&15](g+16|0)|0;q=1;u=0}while(0);if((c[1905]|0)!=(u|0))if((c[1939]|0)!=(u|0))if((c[1924]|0)!=(u|0))if((c[1955]|0)!=(u|0))if((c[1971]|0)!=(u|0))if((c[1864]|0)==(u|0)){e=7456;p=38}else h=0;else{e=7884;p=38}else{e=7820;p=38}else{e=7696;p=38}else{e=7756;p=38}else{e=7620;p=38}if((p|0)==38)h=c[e+24>>2]|0;e=a[(c[b>>2]|0)+12>>0]|0;e=fh(o,u,(e&4)<<6|e&1)|0;if(e|0)Be(e,0);g=c[o>>2]|0;f=c[b>>2]|0;e=c[f+24>>2]|0;jh(g,(c[f+20>>2]|0)+e|0,e);jh(g,s,h);mh(g);e=c[(c[g>>2]|0)+16>>2]|0;f=(e|0)==0;do if(!q){if(f)He(36953,816,37090);else d=e;while(1){e=c[d>>2]|0;if((c[e>>2]|0)==(u|0)){p=48;break}d=c[d+4>>2]|0;if(!d){p=50;break}}if((p|0)==48){t=tb[c[e+40>>2]&15](d+16|0)|0;break}else if((p|0)==50)He(36953,816,37090)}else{if(f)He(36953,816,37090);if(c[e+4>>2]|0)Oe(37051,r);t=tb[c[(c[e>>2]|0)+40>>2]&15](e+16|0)|0}while(0);cr(s|0,t|0,h|0)|0;gh(g);l=v;return}function nh(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0;o=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=c[b>>2]|0;if(!(c[g+20>>2]|0)){b=70;l=o;return b|0}g=c[g+16>>2]|0;if(!g){b=5;l=o;return b|0}if(c[g+4>>2]|0){kg(36953,980,36967,0,36979);Le(37e3,o)}h=c[c[g>>2]>>2]|0;if(!h){b=5;l=o;return b|0}i=c[b>>2]|0;g=c[i+24>>2]|0;do if(g>>>0>>0){if((c[1905]|0)!=(h|0))if((c[1939]|0)!=(h|0))if((c[1924]|0)!=(h|0))if((c[1955]|0)!=(h|0))if((c[1971]|0)!=(h|0))if((c[1864]|0)==(h|0)){g=7456;n=13}else g=0;else{g=7884;n=13}else{g=7820;n=13}else{g=7696;n=13}else{g=7756;n=13}else{g=7620;n=13}if((n|0)==13)g=c[g+24>>2]|0;j=$e(g)|0;if(!j){g=Qn(c[(zo()|0)>>2]|0)|0;if(!g)break;l=o;return g|0}oh(h,j,e,f);if((c[1905]|0)!=(h|0))if((c[1939]|0)!=(h|0))if((c[1924]|0)!=(h|0))if((c[1955]|0)!=(h|0))if((c[1971]|0)!=(h|0))if((c[1864]|0)==(h|0))g=7456;else{g=c[b>>2]|0;e=j;k=j;j=0;i=g;g=c[g+24>>2]|0;n=24;break}else g=7884;else g=7820;else g=7696;else g=7756;else g=7620;h=c[g+24>>2]|0;i=c[b>>2]|0;g=c[i+24>>2]|0;if(h>>>0>g>>>0)Ie(37098,36953,716,37131);else{e=j;k=j;j=h;n=24}}else{k=0;j=f;n=24}while(0);if((n|0)==24){Yq(c[i+20>>2]|0,0,g<<1|0)|0;i=c[b>>2]|0;h=c[i+20>>2]|0;i=h+(c[i+24>>2]|0)|0;cr(h|0,e|0,j|0)|0;cr(i|0,e|0,j|0)|0;if((c[(c[b>>2]|0)+24>>2]|0)>0){g=0;do{n=h+g|0;a[n>>0]=(d[n>>0]|0)^54;n=i+g|0;a[n>>0]=(d[n>>0]|0)^92;g=g+1|0}while((g|0)<(c[(c[b>>2]|0)+24>>2]|0))}cf(k)}h=(c[b>>2]|0)+12|0;a[h>>0]=a[h>>0]&-3;c[b+4>>2]=0;h=c[b>>2]|0;g=c[h+16>>2]|0;if(!g)g=h;else{do{n=g+16|0;k=c[g>>2]|0;Yq(n|0,0,c[k+44>>2]|0)|0;sb[c[k+28>>2]&7](n,(a[(c[b>>2]|0)+12>>0]&4)<<6);g=c[g+4>>2]|0}while((g|0)!=0);g=c[b>>2]|0}h=c[g+20>>2]|0;if(!h){b=0;l=o;return b|0}jh(b,h,c[g+24>>2]|0);b=0;l=o;return b|0}function oh(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;o=l;l=l+16|0;if((l|0)>=(m|0))$(16);j=o+8|0;i=o;h=o+12|0;a:do switch(a|0){case 2:{Vi(b,d,e);l=o;return}case 3:{if(gg()|0)break a;ui(b,d,e);l=o;return}default:if(((a|0)==1?(gg()|0)!=0:0)?(jg(36944),(hg()|0)!=0):0)fg()}while(0);g=fh(h,a,0)|0;if(g|0){g=Pn(g&65535|536870912)|0;c[i>>2]=a;c[i+4>>2]=g;Ne(37147,i)}i=c[h>>2]|0;jh(i,d,e);mh(i);g=c[(c[i>>2]|0)+16>>2]|0;h=(g|0)==0;do if(a){if(h)He(36953,816,37090);else f=g;while(1){g=c[f>>2]|0;if((c[g>>2]|0)==(a|0)){k=19;break}f=c[f+4>>2]|0;if(!f){k=21;break}}if((k|0)==19){n=tb[c[g+40>>2]&15](f+16|0)|0;break}else if((k|0)==21)He(36953,816,37090)}else{if(h)He(36953,816,37090);if(c[g+4>>2]|0)Oe(37051,j);n=tb[c[(c[g>>2]|0)+40>>2]&15](g+16|0)|0}while(0);if((c[1905]|0)!=(a|0))if((c[1939]|0)!=(a|0))if((c[1924]|0)!=(a|0))if((c[1955]|0)!=(a|0))if((c[1971]|0)!=(a|0))if((c[1864]|0)==(a|0)){f=7456;k=28}else f=0;else{f=7884;k=28}else{f=7820;k=28}else{f=7696;k=28}else{f=7756;k=28}else{f=7620;k=28}if((k|0)==28)f=c[f+24>>2]|0;cr(b|0,n|0,f|0)|0;gh(i);l=o;return}function ph(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=h;mh(a);a=c[(c[a>>2]|0)+16>>2]|0;d=(a|0)==0;if(!b){if(d)He(36953,816,37090);if(c[a+4>>2]|0)Oe(37051,e);g=tb[c[(c[a>>2]|0)+40>>2]&15](a+16|0)|0;l=h;return g|0}if(d)He(36953,816,37090);else f=a;while(1){a=c[f>>2]|0;if((c[a>>2]|0)==(b|0))break;d=c[f+4>>2]|0;if(!d){g=10;break}else f=d}if((g|0)==10)He(36953,816,37090);g=tb[c[a+40>>2]&15](f+16|0)|0;l=h;return g|0}function qh(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0;o=l;l=l+16|0;if((l|0)>=(m|0))$(16);i=o;g=o+4|0;if(!((b&-3|0)==0&((e|0)!=0&(f|0)>-1))){d=45;l=o;return d|0}b=b&2;h=(b|0)!=0;if(h&(f|0)<1){d=45;l=o;return d|0}if(!((a|0)!=2|h)){Wi(d,e,f);d=0;l=o;return d|0}if(((a|0)==1?gg()|0:0)?(jg(36944),hg()|0):0)fg();b=fh(g,a,b)|0;a:do if(!b){g=c[g>>2]|0;do if(h){b=nh(g,(c[e+12>>2]|0)+(c[e+4>>2]|0)|0,c[e+8>>2]|0)|0;if(!b){f=f+-1|0;b=e+16|0;break}else{gh(g);break a}}else b=e;while(0);if(f|0)while(1){jh(g,(c[b+12>>2]|0)+(c[b+4>>2]|0)|0,c[b+8>>2]|0);f=f+-1|0;if(!f)break;else b=b+16|0}mh(g);b=c[(c[g>>2]|0)+16>>2]|0;f=(b|0)==0;do if(a){if(f)He(36953,816,37090);else j=b;while(1){b=c[j>>2]|0;if((c[b>>2]|0)==(a|0)){k=23;break}b=c[j+4>>2]|0;if(!b){k=25;break}else j=b}if((k|0)==23){n=tb[c[b+40>>2]&15](j+16|0)|0;break}else if((k|0)==25)He(36953,816,37090)}else{if(f)He(36953,816,37090);if(c[b+4>>2]|0)Oe(37051,i);n=tb[c[(c[b>>2]|0)+40>>2]&15](b+16|0)|0}while(0);if((c[1905]|0)!=(a|0))if((c[1939]|0)!=(a|0))if((c[1924]|0)!=(a|0))if((c[1955]|0)!=(a|0))if((c[1971]|0)!=(a|0))if((c[1864]|0)==(a|0)){b=7456;k=32}else b=0;else{b=7884;k=32}else{b=7820;k=32}else{b=7696;k=32}else{b=7756;k=32}else{b=7620;k=32}if((k|0)==32)b=c[b+24>>2]|0;cr(d|0,n|0,b|0)|0;gh(g);d=0;l=o;return d|0}while(0);d=b;l=o;return d|0}function rh(a){a=a|0;var b=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);a=c[(c[a>>2]|0)+16>>2]|0;if(!a){a=0;l=b;return a|0}if(c[a+4>>2]|0){kg(36953,980,36967,0,36979);Le(37e3,b)}a=c[c[a>>2]>>2]|0;l=b;return a|0}function sh(a){a=a|0;if((c[1905]|0)!=(a|0))if((c[1939]|0)!=(a|0))if((c[1924]|0)!=(a|0))if((c[1955]|0)!=(a|0))if((c[1971]|0)!=(a|0))if((c[1864]|0)==(a|0))a=7456;else{a=0;return a|0}else a=7884;else a=7820;else a=7696;else a=7756;else a=7620;a=c[a+24>>2]|0;return a|0}function th(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;if((l|0)>=(m|0))$(16);h=k;switch(d|0){case 8:{if((e|0)!=0|(f|0)!=0){f=45;l=k;return f|0}if((c[1905]|0)!=(b|0))if((c[1939]|0)!=(b|0))if((c[1924]|0)!=(b|0))if((c[1955]|0)!=(b|0))if((c[1971]|0)!=(b|0)){if((c[1864]|0)==(b|0)){g=7456;j=9}}else{g=7884;j=9}else{g=7820;j=9}else{g=7696;j=9}else{g=7756;j=9}else{g=7620;j=9}if((j|0)==9?(a[g+4>>0]&1)==0:0){f=0;l=k;return f|0}f=5;l=k;return f|0}case 10:{d=(c[1905]|0)==(b|0);if(!d)if((c[1939]|0)!=(b|0))if((c[1924]|0)!=(b|0))if((c[1955]|0)!=(b|0))if((c[1971]|0)!=(b|0))if((c[1864]|0)==(b|0))g=7456;else{f=5;l=k;return f|0}else g=7884;else g=7820;else g=7696;else g=7756;else g=7620;if(a[g+4>>0]&1){f=5;l=k;return f|0}if(!d)if((c[1939]|0)!=(b|0))if((c[1924]|0)!=(b|0))if((c[1955]|0)!=(b|0))if((c[1971]|0)!=(b|0))if((c[1864]|0)==(b|0))i=7456;else{c[h>>2]=b;Ne(37183,h)}else i=7884;else i=7820;else i=7696;else i=7756;else i=7620;h=c[i+16>>2]|0;g=c[i+12>>2]|0;d=(e|0)!=0;if(d){if((c[f>>2]|0)>>>0>=h>>>0){cr(e|0,g|0,h|0)|0;c[f>>2]=h;f=0;l=k;return f|0}}else if(f|0){c[f>>2]=h;f=0;l=k;return f|0}f=d?66:45;l=k;return f|0}case 57:{if(!f)h=0;else h=c[f>>2]|0;if((c[1905]|0)!=(b|0))if((c[1939]|0)!=(b|0))if((c[1924]|0)!=(b|0))if((c[1955]|0)!=(b|0))if((c[1971]|0)!=(b|0))if((c[1864]|0)==(b|0)){d=7456;j=39}else g=69;else{d=7884;j=39}else{d=7820;j=39}else{d=7696;j=39}else{d=7756;j=39}else{d=7620;j=39}do if((j|0)==39){g=c[d+48>>2]|0;if(a[d+4>>0]&1){g=g|0?5:69;break}if(!g)g=69;else g=pb[g&63](b,h,0)|0}while(0);f=g&65535;l=k;return f|0}default:{f=61;l=k;return f|0}}return 0}function uh(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;if((c[1905]|0)!=(b|0))if((c[1939]|0)!=(b|0))if((c[1924]|0)!=(b|0))if((c[1955]|0)!=(b|0))if((c[1971]|0)!=(b|0))if((c[1864]|0)==(b|0)){f=7456;i=7}else{d=0;g=0;f=69;i=11}else{f=7884;i=7}else{f=7820;i=7}else{f=7696;i=7}else{f=7756;i=7}else{f=7620;i=7}do if((i|0)==7){h=c[f+48>>2]|0;if(a[f+4>>0]&1){d=f;g=1;f=h|0?5:69;i=11;break}if(!h){d=f;g=1;f=69;i=11}else f=pb[h&63](b,d,e)|0}while(0);if((i|0)==11)if(e){if(g?(a[d+4>>0]&1)==0:0)d=37736;else d=g?37697:37716;zb[e&1](42873,b,37758,d)}return ((f|0)==0?0:f&65535|16777216)|0}function vh(){return 0}function wh(){return 0}function xh(a,b){a=a|0;b=b|0;c[17614]=a;c[17615]=b;return}function yh(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=zh(a,1,b,d,e)|0;b=c[17614]|0;if(!b)return a|0;qb[b&15](c[17615]|0,37212,10,0,0);return a|0}function zh(a,b,d,f,g){a=a|0;b=b|0;d=d|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;E=l;l=l+16|0;if((l|0)>=(m|0))$(16);C=E+8|0;h=E;B=E+12|0;if(a>>>0<16){c[h>>2]=16;Me(37221,h)}y=gf(2672)|0;z=kl(2)|0;A=kl(3)|0;r=(b|0)!=0;if(r)s=Il(a)|0;else s=Hl(a)|0;t=Bl(s)|0;u=Bl(s)|0;v=Bl(s)|0;c[B>>2]=0;w=a+-1|0;x=a+-2|0;p=w-b|0;q=(f|0)==0;a:while(1){Kl(s,a,d);ok(s,w);if(r)nk(s,x);nk(s,0);h=0;do{c[y+(h<<2)>>2]=Ak(0,s,e[16424+(h<<1)>>1]|0)|0;h=h+1|0}while((h|0)!=668);b:do if(q){h=0;o=0;while(1){n=0;j=3;while(1){k=y+(n<<2)|0;i=c[k>>2]|0;b=i+o|0;if(b>>>0>=j>>>0){do{i=i-j|0;b=i+o|0}while(b>>>0>=j>>>0);c[k>>2]=i}i=n+1|0;if(!b)break;if((i|0)==668){D=15;break}else{n=i;j=e[16424+(i<<1)>>1]|0}}if((D|0)==15){D=0;ek(v,s,o);c[B>>2]=(c[B>>2]|0)+1;gk(u,v,1);Mk(t,z,u,v);if((vk(t,1)|0)==0?Ah(v,5,B)|0:0)break;h=h+1|0;if((h|0)==10){h=c[17614]|0;if(!h)h=0;else{qb[h&15](c[17615]|0,37212,46,0,0);h=0}}}o=o+2|0;if(o>>>0>=2e4)break b}if(!(mk(v,p)|0))D=34;else{D=46;break a}}else{h=0;o=0;do{n=0;k=3;while(1){j=y+(n<<2)|0;i=c[j>>2]|0;b=i+o|0;if(b>>>0>=k>>>0){do{i=i-k|0;b=i+o|0}while(b>>>0>=k>>>0);c[j>>2]=i}i=n+1|0;if(!b)break;if((i|0)==668){D=31;break}else{n=i;k=e[16424+(i<<1)>>1]|0}}if((D|0)==31){D=0;ek(v,s,o);c[B>>2]=(c[B>>2]|0)+1;gk(u,v,1);Mk(t,z,u,v);if((vk(t,1)|0)==0?Ah(v,5,B)|0:0){if(!(mk(v,p)|0)){D=34;break b}if(!(yb[f&7](g,v)|0)){D=46;break a}b=c[17614]|0;if(b|0)qb[b&15](c[17615]|0,37212,47,0,0)}h=h+1|0;if((h|0)==10){h=c[17614]|0;if(!h)h=0;else{qb[h&15](c[17615]|0,37212,46,0,0);h=0}}}o=o+2|0}while(o>>>0<2e4)}while(0);if((D|0)==34){D=0;h=c[17614]|0;if(h|0)qb[h&15](c[17615]|0,37212,10,0,0);Oe(37268,C)}h=c[17614]|0;if(!h)continue;qb[h&15](c[17615]|0,37212,58,0,0)}if((D|0)==46){tl(z);tl(A);tl(t);tl(u);tl(s);cf(y);l=E;return v|0}return 0}function Ah(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;l=a+4|0;o=ll(c[l>>2]|0)|0;p=ll(c[l>>2]|0)|0;q=ll(c[l>>2]|0)|0;l=ll(c[l>>2]|0)|0;m=kl(2)|0;n=lk(a)|0;f=(b|0)<5?5:b;gk(l,a,1);g=yl(l)|0;h=Nk(g)|0;Ck(g,g,h);a:do if(f){i=n+-2|0;if(h>>>0<=1){b=0;while(1){c[d>>2]=(c[d>>2]|0)+1;if(b){Kl(o,n,0);e=(mk(o,i)|0)==0;ok(o,i);if(e)qk(o,i);if((wk(o,l)|0)>=0){b=24;break}if((vk(o,1)|0)<=0){b=24;break}}else El(o,2)|0;Mk(p,o,g,a);if((vk(p,1)|0?wk(p,l)|0:0)?wk(p,l)|0:0){j=0;break a}e=c[17614]|0;if(e|0)qb[e&15](c[17615]|0,37212,43,0,0);b=b+1|0;if(b>>>0>=f>>>0){j=1;break a}}if((b|0)==24)Ie(37298,37370,951,37381)}else k=0;while(1){c[d>>2]=(c[d>>2]|0)+1;if(k){Kl(o,n,0);e=(mk(o,i)|0)==0;ok(o,i);if(e)qk(o,i);if((wk(o,l)|0)>=0){b=24;break}if((vk(o,1)|0)<=0){b=24;break}}else El(o,2)|0;Mk(p,o,g,a);if(vk(p,1)|0?wk(p,l)|0:0){b=1;do{if(!(wk(p,l)|0))break;Mk(p,p,m,a);b=b+1|0;if(!(vk(p,1)|0)){j=0;break a}}while(b>>>0>>0);if(wk(p,l)|0){j=0;break a}}b=c[17614]|0;if(b|0)qb[b&15](c[17615]|0,37212,43,0,0);k=k+1|0;if(k>>>0>=f>>>0){j=1;break a}}if((b|0)==24)Ie(37298,37370,951,37381)}else j=1;while(0);tl(o);tl(p);tl(q);tl(l);tl(g);tl(m);return j|0}function Bh(a,b,d,f,g){a=a|0;b=b|0;d=d|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0;o=l;l=l+16|0;if((l|0)>=(m|0))$(16);k=o;c[k>>2]=0;h=0;i=3;while(1){j=h+1|0;if(Dk(a,i)|0){n=4;break}if((j|0)==668)break;else{h=j;i=e[16424+(j<<1)>>1]|0}}if((n|0)==4){n=(vk(a,i)|0)==0&1;l=o;return n|0}i=Bl(a)|0;j=Bl(a)|0;gk(j,a,1);Mk(i,b,j,a);tl(j);j=(vk(i,1)|0)==0;tl(i);if(!j){h=c[17614]|0;if(!h){n=0;l=o;return n|0}qb[h&15](c[17615]|0,37212,46,0,0);n=0;l=o;return n|0}h=(f|0)!=0;if(!(h?!(pb[f&63](g,2,a)|0):0))n=10;if((n|0)==10?Ah(a,d,k)|0:0){if(!h){n=1;l=o;return n|0}if(pb[f&63](g,1,a)|0){n=1;l=o;return n|0}}h=c[17614]|0;if(!h){n=0;l=o;return n|0}qb[h&15](c[17615]|0,37212,46,0,0);n=0;l=o;return n|0}function Ch(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;if((e|0)==0|(a|0)!=0&(b|0)!=0&(d|0)!=0^1){g=0;return g|0}if(!(mk(e,0)|0)){g=0;return g|0}k=Dh(b)|0;i=Dh(d)|0;h=Bl(a)|0;Kk(h,k,i);b=Bl(k)|0;Fk(b,i,k)|0;Kk(b,b,i);j=Bl(i)|0;Fk(j,k,i)|0;Kk(j,j,k);hk(b,b,j);if(c[b+8>>2]|0)fk(b,b,h);jk(j,b,a,h);fk(j,j,a);tl(b);if((wk(j,a)|0)<0)fk(j,j,h);b=kl(2)|0;d=Bl(j)|0;gk(h,h,1);gk(j,j,1);while(1){a=Ek(d,e,j)|0;ek(j,j,1);if(!a){a=c[17614]|0;if(a|0)qb[a&15](c[17615]|0,37212,47,0,0)}else if(Bh(j,b,64,0,0)|0)break;fk(j,j,h)}tl(d);tl(b);tl(h);b=c[17614]|0;if(b|0)qb[b&15](c[17615]|0,37212,10,0,0);if(!f)tl(k);else c[f>>2]=k;if(!g){tl(i);g=j;return g|0}else{c[g>>2]=i;g=j;return g|0}return 0}function Dh(a){a=a|0;var b=0;b=kl(2)|0;a=yl(a)|0;nk(a,0);if(Bh(a,b,64,0,0)|0){tl(b);return a|0}do ek(a,a,2);while(!(Bh(a,b,64,0,0)|0));tl(b);return a|0}function Eh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;o=l;l=l+16|0;if((l|0)>=(m|0))$(16);n=o;if((a|0)!=0?(e=vf(a)|0,(e|0)>1):0){k=0;g=0;f=5;j=e;e=0;while(1){j=j+-1|0;i=xf(a,j,n)|0;a:do if(!i)h=k;else do switch(c[n>>2]|0){case 3:{h=(f|0)==5;if(h&(Tp(i,37390,3)|0)==0){h=k;g=g|4;f=4;break a}if(h&(Tp(i,37394,3)|0)==0){h=k;g=g|16;f=0;break a}else{h=k;e=(k|0)==0?72:e;break a}}case 4:{if(!(Tp(i,37398,4)|0)){h=k;g=g|1024;break a}if((f|0)==5&(Tp(i,37403,4)|0)==0){h=k;g=g|4;f=3;break a}if(!(Tp(i,49620,4)|0)){h=k;g=g|8192;f=0;break a}else{h=k;e=(k|0)==0?72:e;break a}}case 5:{if(!(Tp(i,49614,5)|0)){h=k;g=g|4096;f=0;break a}if((f|0)==5&(Tp(i,37408,5)|0)==0){h=k;g=g|4;f=1;break a}if(!(Tp(i,37414,5)|0)){h=k;g=g|512;break a}else{h=k;e=(k|0)==0?72:e;break a}}case 6:if(!(Tp(i,37420,6)|0)){h=k;g=g|2048;break a}else{h=k;e=(k|0)==0?72:e;break a}case 7:if(!(Tp(i,37427,7)|0)){h=k;g=g|2;break a}else{i=(k|0)!=0|(Tp(i,37435,7)|0)==0;h=k;e=i?e:72;break a}case 8:if(!(Tp(i,41515,8)|0)){h=k;g=g|64;break a}else{h=k;e=(k|0)==0?72:e;break a}case 9:if((f|0)==5&(Tp(i,37443,9)|0)==0){h=k;g=g|4;f=2;break a}else{h=k;e=(k|0)==0?72:e;break a}case 10:{if(!(Tp(i,37453,10)|0)){h=1;break a}if(!(Tp(i,37464,10)|0)){h=k;g=g|16384;break a}else{h=k;e=(k|0)==0?72:e;break a}}case 11:{if(!(Tp(i,37475,11)|0)){h=k;g=g|1;break a}if(!(Tp(i,37487,11)|0)){h=k;g=g|128;break a}else{h=k;e=(k|0)==0?72:e;break a}}case 13:{if(!(Tp(i,37499,13)|0)){h=k;g=g|256;break a}if(!(Tp(i,48632,13)|0)){h=k;g=g|32;break a}else{h=k;e=(k|0)==0?72:e;break a}}default:{h=k;e=(k|0)==0?72:e;break a}}while(0);while(0);if((j|0)<=1)break;else k=h}}else{g=0;f=5;e=0}if(b|0)c[b>>2]=g;if(!d){l=o;return e|0}c[d>>2]=f;l=o;return e|0}function Fh(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=l;l=l+64|0;if((l|0)>=(m|0))$(64);h=i+4|0;e=i;c[d>>2]=0;f=uf(b,37513,0)|0;if(!f){h=0;l=i;return h|0}g=xf(f,1,e)|0;b=c[e>>2]|0;if((g|0)==0|b>>>0>48){sf(f);h=65;l=i;return h|0}else{cr(h|0,g|0,b|0)|0;a[h+b>>0]=0;c[d>>2]=Mo(h,0,0)|0;sf(f);h=0;l=i;return h|0}return 0}function Gh(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=l;l=l+64|0;if((l|0)>=(m|0))$(64);h=i+4|0;e=i;c[d>>2]=0;f=uf(b,37519,0)|0;if(!f){c[d>>2]=65537;h=0;l=i;return h|0}g=xf(f,1,e)|0;b=c[e>>2]|0;if((g|0)==0|b>>>0>48){sf(f);h=65;l=i;return h|0}else{cr(h|0,g|0,b|0)|0;a[h+b>>0]=0;c[d>>2]=Mo(h,0,0)|0;sf(f);h=0;l=i;return h|0}return 0}function Hh(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;c[d>>2]=0;i=(e|0)!=0;if(i)c[e>>2]=0;j=uf(a,37529,0)|0;a:do if(j){a=wf(j,1)|0;if(a){f=zf(a,0)|0;if(f){if(!(Go(f,46885)|0)){sf(a);a=wf(j,2)|0;if(!a){g=65;a=0;break}cf(f);f=zf(a,0)|0;if(!f){g=65;f=0;break}}g=c[b>>2]|0;if(!g)g=70;else{h=0;while(1){h=h+1|0;if(!(Op(f,g)|0))break;g=c[b+(h<<2)>>2]|0;if(!g){g=70;break a}}if(i){if(!(Go(f,49614)|0))c[e>>2]=4096;if(!(Go(f,49620)|0))c[e>>2]=8192}c[d>>2]=a;g=0;a=0}}else{g=65;f=0}}else{g=68;f=0;a=0}}else{g=65;f=0;a=0}while(0);cf(f);sf(a);sf(j);return g|0}function Ih(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;q=l;l=l+16|0;if((l|0)>=(m|0))$(16);n=q+4|0;o=q;c[o>>2]=0;c[e>>2]=0;p=uf(b,40685,0)|0;a:do if(p){g=wf(p,1)|0;if(g){k=zf(g,0)|0;if(k){if(!(Go(k,46885)|0)){h=f+8|0;b=Eh(g,o,h)|0;if(b|0){h=k;break}b:do switch(c[h>>2]|0){case 4:{h=k;b=70;break a}case 3:{sf(g);g=uf(p,37537,0)|0;if(g|0){i=xf(g,1,n)|0;if(!i){h=k;b=68;break a}j=c[n>>2]|0;b=0;while(1){h=c[4248+(b<<3)>>2]|0;if((Fo(h)|0)==(j|0)?(Tp(h,i,j)|0)==0:0){h=13;break}b=b+1|0;if((b|0)==12){h=14;break}}do if((h|0)==13)b=c[4248+(b<<3)+4>>2]|0;else if((h|0)==14){b=_e(j+1|0)|0;if(!b){c[f+16>>2]=0;h=k;b=5;break a}else{cr(b|0,i|0,j|0)|0;a[b+j>>0]=0;j=ch(b)|0;cf(b);b=j;break}}while(0);c[f+16>>2]=b;if(!b){h=k;b=5;break a}}sf(g);g=uf(p,37547,0)|0;if(g){h=xf(g,1,n)|0;if(!h){h=k;b=68;break a}b=c[n>>2]|0;if(b){b=_e(b)|0;c[f+20>>2]=b;if(!b){b=Sn()|0;if(!b)break b;else{h=k;break a}}else{j=c[n>>2]|0;cr(b|0,h|0,j|0)|0;c[f+24>>2]=j;break b}}}else g=0;break}default:{}}while(0);sf(g);g=wf(p,2)|0;if(!g){h=k;g=0;b=68;break}else h=2;c:while(1){b=xf(g,0,n)|0;switch(c[n>>2]|0){case 9:{if(Tp(b,37537,9)|0)break c;break}case 5:{if(Tp(b,37547,5)|0)break c;break}case 15:{if(Tp(b,37553,15)|0)break c;break}default:break c}h=h+1|0;sf(g);g=wf(p,h)|0;if(!g){h=k;g=0;b=68;break a}}cf(k);b=zf(g,0)|0;if(!b){h=0;b=65;break}}else{c[o>>2]=8;b=k}h=c[d>>2]|0;if(!h){h=b;b=70}else{i=0;while(1){i=i+1|0;if(!(Op(b,h)|0))break;h=c[d+(i<<2)>>2]|0;if(!h){h=b;b=70;break a}}c[e>>2]=g;h=f+12|0;c[h>>2]=c[h>>2]|c[o>>2];h=b;g=0;b=0}}else{h=0;b=65}}else{h=0;g=0;b=68}}else{h=0;g=0;b=65}while(0);cf(h);sf(g);sf(p);l=q;return b|0}function Jh(a,b,d){a=a|0;b=b|0;d=d|0;c[a>>2]=b;c[a+4>>2]=d;c[a+8>>2]=5;c[a+12>>2]=0;c[a+16>>2]=2;c[a+20>>2]=0;c[a+24>>2]=0;c[a+28>>2]=20;c[a+32>>2]=0;c[a+36>>2]=0;return}function Kh(a){a=a|0;cf(c[a+20>>2]|0);return}function Lh(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;w=l;l=l+16|0;if((l|0)>=(m|0))$(16);r=w+8|0;u=w+4|0;s=w;c[u>>2]=0;c[d>>2]=0;v=uf(b,37643,0)|0;if(!v){v=Af(b,0,0)|0;c[d>>2]=v;v=v|0?0:65;l=w;return v|0}b=uf(v,46885,0)|0;g=e+8|0;if(!b)b=0;else{t=(Eh(b,u,g)|0)!=0&1;sf(b);b=t}if((c[g>>2]|0)==5)c[g>>2]=0;t=uf(v,37648,0)|0;i=(t|0)!=0;if(!i){f=uf(v,40697,0)|0;if(!f){b=65;f=0}else{h=1;q=9}}else{f=0;h=0;q=9}a:do if((q|0)==9)if(!b){g=c[g>>2]|0;b=(g|0)==0;if(b){if(c[u>>2]&4096|0){b:do if(h?(p=uf(v,37537,0)|0,(p|0)!=0):0){i=xf(p,1,r)|0;c:do if(i){h=c[r>>2]|0;b=0;while(1){g=c[4248+(b<<3)>>2]|0;if((Fo(g)|0)==(h|0)?(Tp(g,i,h)|0)==0:0){q=19;break}b=b+1|0;if((b|0)==12){q=20;break}}do if((q|0)==19)b=c[4248+(b<<3)+4>>2]|0;else if((q|0)==20){b=_e(h+1|0)|0;if(!b){c[e+16>>2]=0;b=5;break c}else{cr(b|0,i|0,h|0)|0;a[b+h>>0]=0;r=ch(b)|0;cf(b);b=r;break}}while(0);c[e+16>>2]=b;if(!b)b=5;else{sf(p);b=yf(f,1,s)|0;if(!b){c[s>>2]=0;b=_e(1)|0;if(!b){b=Sn()|0;if(!b)b=0;else break b}}else{r=c[s>>2]|0;if(r<<3>>>0>>0){cf(b);b=67;break b}}c[d>>2]=ul(0,b,c[s>>2]<<3)|0;b=0;break b}}else b=68;while(0);sf(p)}else b=65;while(0);break}if(i&b?c[u>>2]&18|0:0){if((vf(t)|0)!=3){b=65;break}i=xf(t,1,r)|0;h=c[r>>2]|0;if(!((i|0)!=0&(h|0)!=0)){b=65;break}b=0;while(1){g=c[4248+(b<<3)>>2]|0;if((Fo(g)|0)==(h|0)?(Tp(g,i,h)|0)==0:0){q=40;break}b=b+1|0;if((b|0)==12){q=41;break}}do if((q|0)==40){b=c[4248+(b<<3)+4>>2]|0;q=44}else if((q|0)==41){b=_e(h+1|0)|0;if(!b){c[e+16>>2]=0;b=5;break}else{cr(b|0,i|0,h|0)|0;a[b+h>>0]=0;q=ch(b)|0;cf(b);b=q;q=44;break}}while(0);do if((q|0)==44){c[e+16>>2]=b;if(b){g=yf(t,2,s)|0;if(g){s=c[s>>2]|0;b=s<<3;if(b>>>0>>0){cf(g);b=67;break}else{c[d>>2]=ul(0,g,b)|0;b=0;break}}else b=65}else b=5}while(0);break}if(h&b){if(c[u>>2]&2|0){b=70;break}b=Af(f,1,5)|0;c[d>>2]=b;b=(b|0)==0?65:0;break}else b=0}else{b=(g|0)==1;if(h&b?(c[e>>2]|0)==0:0){i=xf(f,1,s)|0;d:do if((i|0)!=0&(c[s>>2]|0)!=0){h=uf(v,37553,0)|0;e:do if(!h){g=0;b=0}else{g=xf(h,1,r)|0;if(!g){sf(h);b=68;break d}b=c[r>>2]|0;do if(b){b=_e(b)|0;if(!b){b=Sn()|0;sf(h);if(!b){g=0;b=0;break e}else break d}else{r=c[r>>2]|0;cr(b|0,g|0,r|0)|0;g=r;break}}else{g=0;b=0}while(0);sf(h)}while(0);d=vi(d,c[e+4>>2]|0,i,c[s>>2]|0,b,g)|0;cf(b);b=d}else b=65;while(0);break}}if(i&b?(c[e>>2]&-2|0)==2:0){if((vf(t)|0)!=3){b=65;break}i=xf(t,1,r)|0;h=c[r>>2]|0;if(!((i|0)!=0&(h|0)!=0)){b=65;break}b=0;while(1){g=c[4248+(b<<3)>>2]|0;if((Fo(g)|0)==(h|0)?(Tp(g,i,h)|0)==0:0){q=74;break}b=b+1|0;if((b|0)==12){q=75;break}}do if((q|0)==74){b=c[4248+(b<<3)+4>>2]|0;q=78}else if((q|0)==75){b=_e(h+1|0)|0;if(!b){c[e+16>>2]=0;b=5;break}else{cr(b|0,i|0,h|0)|0;a[b+h>>0]=0;q=ch(b)|0;cf(b);b=q;q=78;break}}while(0);if((q|0)==78){h=e+16|0;c[h>>2]=b;if(b){g=xf(t,2,s)|0;b=c[s>>2]|0;if((g|0)!=0&(b|0)!=0)b=xi(d,c[e+4>>2]|0,g,b,c[h>>2]|0)|0;else b=65}else b=5}break}if(h&(g|0)==2?(c[e>>2]&-2|0)==2:0){if((vf(f)|0)==2?(j=xf(f,1,s)|0,k=c[s>>2]|0,(j|0)!=0&(k|0)!=0):0)b=yi(d,c[e+4>>2]|0,j,k)|0;else b=65;break}if(h&(g|0)==3?(c[e>>2]|0)==0:0){k=xf(f,1,s)|0;f:do if((k|0)!=0&(c[s>>2]|0)!=0){j=uf(v,37537,0)|0;g:do if(j|0){h=xf(j,1,r)|0;h:do if(h){i=c[r>>2]|0;b=0;while(1){g=c[4248+(b<<3)>>2]|0;if((Fo(g)|0)==(i|0)?(Tp(g,h,i)|0)==0:0){q=97;break}b=b+1|0;if((b|0)==12){q=98;break}}do if((q|0)==97)b=c[4248+(b<<3)+4>>2]|0;else if((q|0)==98){b=_e(i+1|0)|0;if(!b){c[e+16>>2]=0;b=5;break h}else{cr(b|0,h|0,i|0)|0;a[b+i>>0]=0;q=ch(b)|0;cf(b);b=q;break}}while(0);c[e+16>>2]=b;if(!b)b=5;else{sf(j);break g}}else b=68;while(0);sf(j);break f}while(0);h=uf(v,37547,0)|0;i:do if(h|0){g=xf(h,1,r)|0;if(!g){sf(h);b=68;break f}b=c[r>>2]|0;do if(b|0){b=_e(b)|0;c[e+20>>2]=b;if(!b){b=Sn()|0;sf(h);if(!b)break i;else break f}else{q=c[r>>2]|0;cr(b|0,g|0,q|0)|0;c[e+24>>2]=q;break}}while(0);sf(h)}while(0);h=uf(v,37553,0)|0;j:do if(!h){g=0;b=0}else{g=xf(h,1,r)|0;if(!g){sf(h);b=68;break f}b=c[r>>2]|0;do if(b){b=_e(b)|0;if(!b){b=Sn()|0;sf(h);if(!b){g=0;b=0;break j}else break f}else{r=c[r>>2]|0;cr(b|0,g|0,r|0)|0;g=r;break}}else{g=0;b=0}while(0);sf(h)}while(0);d=zi(d,c[e+4>>2]|0,c[e+16>>2]|0,k,c[s>>2]|0,c[e+20>>2]|0,c[e+24>>2]|0,b,g)|0;cf(b);b=d}else b=65;while(0);break}if(i&(g|0)==4){if((c[e>>2]|0)!=2){if((c[e>>2]|0)!=3){b=70;break}if((vf(t)|0)!=3){b=65;break}i=xf(t,1,r)|0;h=c[r>>2]|0;if((i|0)!=0&(h|0)!=0)b=0;else{b=65;break}while(1){g=c[4248+(b<<3)>>2]|0;if((Fo(g)|0)==(h|0)?(Tp(g,i,h)|0)==0:0){q=155;break}b=b+1|0;if((b|0)==12){q=156;break}}do if((q|0)==155)b=c[4248+(b<<3)+4>>2]|0;else if((q|0)==156){b=_e(h+1|0)|0;if(!b){c[e+16>>2]=0;b=5;break a}else{cr(b|0,i|0,h|0)|0;a[b+h>>0]=0;s=ch(b)|0;cf(b);b=s;break}}while(0);c[e+16>>2]=b;if(!b){b=5;break}b=Af(t,2,5)|0;c[d>>2]=b;c[e+32>>2]=5;c[e+36>>2]=c[d>>2];b=(b|0)==0?65:0;break}if((vf(t)|0)==3?(n=xf(t,1,r)|0,o=c[r>>2]|0,(n|0)!=0&(o|0)!=0):0){b=0;while(1){g=c[4248+(b<<3)>>2]|0;if((Fo(g)|0)==(o|0)?(Tp(g,n,o)|0)==0:0){q=130;break}b=b+1|0;if((b|0)==12){q=131;break}}do if((q|0)==130){b=c[4248+(b<<3)+4>>2]|0;q=134}else if((q|0)==131){b=_e(o+1|0)|0;if(!b){c[e+16>>2]=0;b=5;break}else{cr(b|0,n|0,o|0)|0;a[b+o>>0]=0;q=ch(b)|0;cf(b);b=q;q=134;break}}while(0);k:do if((q|0)==134){j=e+16|0;c[j>>2]=b;if(b){i=xf(t,2,s)|0;if((i|0)!=0&(c[s>>2]|0)!=0){b=uf(v,37653,0)|0;if(b|0){g=xf(b,1,r)|0;if(!g){b=68;break}c[e+28>>2]=Mo(g,0,10)|0;sf(b)}h=uf(v,37553,0)|0;l:do if(!h){g=0;b=0}else{g=xf(h,1,r)|0;if(!g){sf(h);b=68;break k}b=c[r>>2]|0;do if(b){b=_e(b)|0;if(!b){b=Sn()|0;sf(h);if(!b){g=0;b=0;break l}else break k}else{r=c[r>>2]|0;cr(b|0,g|0,r|0)|0;g=r;break}}else{g=0;b=0}while(0);sf(h)}while(0);d=Ci(d,(c[e+4>>2]|0)+-1|0,c[j>>2]|0,i,c[s>>2]|0,c[e+28>>2]|0,b,g)|0;cf(b);b=d}else b=65}else b=5}while(0)}else b=65}else b=70}else b=72;while(0);sf(v);sf(t);sf(f);if(!b){c[e+12>>2]=c[u>>2];v=0;l=w;return v|0}else{v=e+20|0;cf(c[v>>2]|0);c[v>>2]=0;v=b;l=w;return v|0}return 0}function Mh(a,b){a=a|0;b=b|0;return Di(c[a+36>>2]|0,b,(c[a+4>>2]|0)+-1|0,c[a+16>>2]|0,c[a+28>>2]|0)|0}function Nh(a){a=a|0;var b=0,d=0;if(!(Op(a,c[3121]|0)|0)){a=12472;return a|0}d=c[3122]|0;b=c[d>>2]|0;a:do if(b|0){while(1){d=d+4|0;if(!(Op(a,b)|0)){b=12472;break}b=c[d>>2]|0;if(!b)break a}return b|0}while(0);if(!(Op(a,c[1883]|0)|0)){a=7520;return a|0}b=c[1884]|0;d=c[b>>2]|0;if(!d){a=0;return a|0}while(1){b=b+4|0;if(!(Op(a,d)|0)){b=7520;d=6;break}d=c[b>>2]|0;if(!d){b=0;d=6;break}}if((d|0)==6)return b|0;return 0}function Oh(a){a=a|0;switch(a|0){case 3:case 2:{a=1;break}case 16:{a=20;break}case 301:{a=18;break}case 302:{a=18;break}default:{}}if((a|0)!=(c[3118]|0))if((a|0)==(c[1880]|0))a=7520;else{a=37665;return a|0}else a=12472;a=c[a+12>>2]|0;return a|0}function Ph(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=g+4|0;f=g;c[a>>2]=0;d=Qh(d,0,e,f)|0;if(!d){d=c[(c[e>>2]|0)+48>>2]|0;if(!d)d=69;else d=pb[d&63](a,b,c[f>>2]|0)|0}sf(c[f>>2]|0);l=g;return d|0}function Qh(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;c[d>>2]=0;g=(e|0)!=0;if(g)c[e>>2]=0;f=(b|0)!=0;b=uf(a,f?37667:37679,0)|0;if(!(f|(b|0)!=0))b=uf(a,37667,0)|0;if(!b){g=65;return g|0}f=Cf(b)|0;sf(b);b=zf(f,0)|0;if(!b){sf(f);g=65;return g|0}a=Nh(b)|0;cf(b);if(!a){sf(f);g=4;return g|0}c[d>>2]=a;if(g){c[e>>2]=f;g=0;return g|0}else{sf(f);g=0;return g|0}return 0}function Rh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=g+4|0;f=g;c[a>>2]=0;d=Qh(d,1,e,f)|0;if(!d){d=c[(c[e>>2]|0)+52>>2]|0;if(!d)d=69;else d=pb[d&63](a,b,c[f>>2]|0)|0}sf(c[f>>2]|0);l=g;return d|0}function Sh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=g+4|0;f=g;c[a>>2]=0;d=Qh(d,1,e,f)|0;if(!d){d=c[(c[e>>2]|0)+56>>2]|0;if(!d)d=69;else d=pb[d&63](a,b,c[f>>2]|0)|0}sf(c[f>>2]|0);l=g;return d|0}function Th(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=g+4|0;f=g;d=Qh(d,0,e,f)|0;if(!d){d=c[(c[e>>2]|0)+60>>2]|0;if(!d)d=69;else d=pb[d&63](a,b,c[f>>2]|0)|0}sf(c[f>>2]|0);l=g;return d|0}function Uh(a){a=a|0;var b=0,d=0,e=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=e+4|0;d=e;a=Qh(a,1,b,d)|0;if(!a){a=c[(c[b>>2]|0)+44>>2]|0;if(!a)a=69;else a=tb[a&15](c[d>>2]|0)|0}sf(c[d>>2]|0);l=e;return a|0}function Vh(a,b){a=a|0;b=b|0;var d=0,e=0;c[a>>2]=0;d=uf(b,37690,0)|0;if(d){b=Cf(d)|0;sf(d);if(b){d=zf(b,0)|0;if(d){e=Nh(d)|0;cf(d);if(e){d=c[e+40>>2]|0;if(!d)d=69;else d=yb[d&7](b,a)|0}else d=4}else d=65}else{d=68;b=0}}else{d=65;b=0}sf(b);cf(0);sf(0);return d|0}function Wh(){return 0}function Xh(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;switch(b|0){case 3:case 2:{g=1;break}case 16:{g=20;break}case 301:{g=18;break}case 302:{g=18;break}default:g=b}if((g|0)!=(c[3118]|0))if((g|0)==(c[1880]|0)){b=7520;h=8}else{b=0;d=0;h=11}else{b=12472;h=8}if((h|0)==8)if((a[b+4>>0]&1)==0?(f=c[b+68>>2]|0,(f|0)!=0):0)b=pb[f&63](g,d,e)|0;else{d=1;h=11}if((h|0)==11)if(!e)b=4;else{if(d?(a[b+4>>0]&1)==0:0)b=37736;else b=d?37697:37716;zb[e&1](40871,g,37758,b);b=4}return ((b|0)==0?0:b&65535|16777216)|0}function Yh(a,b,c){a=a|0;b=b|0;c=c|0;return ai(a,b,c)|0}function Zh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=c[a+496>>2]|0;if(e|0)vb[e&3]();return pb[c[a+488>>2]&63](a,b,d)|0}function _h(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;bi(a);e=c[a+500>>2]|0;if(e|0)vb[e&3]();return pb[c[a+492>>2]&63](a,b,d)|0}function $h(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=l;l=l+528|0;if((l|0)>=(m|0))$(528);e=h;f=h+504|0;switch(a|0){case 7:{ai(e,37769,16)|0;a=c[e+496>>2]|0;if(a|0)vb[a&3]();pb[c[e+488>>2]&63](e,f,37785)|0;if(!(Tp(f,37801,16)|0)){bi(e);a=c[e+500>>2]|0;if(a|0)vb[a&3]();pb[c[e+492>>2]&63](e,f,f)|0;if(!(Tp(f,37785,16)|0)){if(!b){d=0;l=h;return d|0}a=ci(2)|0;if(!a){a=ci(5)|0;if(!a){d=0;l=h;return d|0}else b=37885}else b=37881}else{a=37817;g=8}}else{a=37849;g=8}if((g|0)==8)b=37889;if(!d){d=50;l=h;return d|0}zb[d&1](37899,7,b,a);d=50;l=h;return d|0}case 8:{ai(e,37906,24)|0;a=c[e+496>>2]|0;if(a|0)vb[a&3]();pb[c[e+488>>2]&63](e,f,37930)|0;if(!(Tp(f,37946,16)|0)){bi(e);a=c[e+500>>2]|0;if(a|0)vb[a&3]();pb[c[e+492>>2]&63](e,f,f)|0;if(!(Tp(f,37930,16)|0)){d=0;l=h;return d|0}else a=37962}else a=37994;if(!d){d=50;l=h;return d|0}zb[d&1](37899,8,37889,a);d=50;l=h;return d|0}case 9:{ai(e,38026,32)|0;a=c[e+496>>2]|0;if(a|0)vb[a&3]();pb[c[e+488>>2]&63](e,f,38058)|0;if(!(Tp(f,38074,16)|0)){bi(e);a=c[e+500>>2]|0;if(a|0)vb[a&3]();pb[c[e+492>>2]&63](e,f,f)|0;if(!(Tp(f,38058,16)|0)){d=0;l=h;return d|0}else a=38090}else a=38122;if(!d){d=50;l=h;return d|0}zb[d&1](37899,9,37889,a);d=50;l=h;return d|0}default:{d=12;l=h;return d|0}}return 0}function ai(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0;K=l;l=l+528|0;if((l|0)>=(m|0))$(528);j=K+504|0;J=K;h=K+512|0;I=gg()|0;a:do if(!(c[17616]|I)){c[17616]=1;ai(J,37769,16)|0;g=c[J+496>>2]|0;if(g|0)vb[g&3]();pb[c[J+488>>2]&63](J,h,37785)|0;do if(!(Tp(h,37801,16)|0)){bi(J);g=c[J+500>>2]|0;if(g|0)vb[g&3]();pb[c[J+492>>2]&63](J,h,h)|0;if(!(Tp(h,37785,16)|0)){ai(J,37906,24)|0;g=c[J+496>>2]|0;if(g|0)vb[g&3]();pb[c[J+488>>2]&63](J,h,37930)|0;if(!(Tp(h,37946,16)|0)){bi(J);g=c[J+500>>2]|0;if(g|0)vb[g&3]();pb[c[J+492>>2]&63](J,h,h)|0;if(!(Tp(h,37930,16)|0)){ai(J,38026,32)|0;g=c[J+496>>2]|0;if(g|0)vb[g&3]();pb[c[J+488>>2]&63](J,h,38058)|0;if(!(Tp(h,38074,16)|0)){bi(J);g=c[J+500>>2]|0;if(g|0)vb[g&3]();pb[c[J+492>>2]&63](J,h,h)|0;if(!(Tp(h,38058,16)|0)){g=ym(37765,1,2,4,9,16,504)|0;if(g|0){i=25;break}g=wm(37765,1,2,3,10,16,504)|0;if(g|0){i=25;break}g=xm(37765,1,2,2,10,16,504)|0;c[17617]=g;if(!g)break a;else break}else g=38090}else g=38122;i=25;break}else g=37962}else g=37994;i=25}else{g=37817;i=8}}else{g=37849;i=8}while(0);if((i|0)==8)i=25;if((i|0)==25)c[17617]=g;c[j>>2]=g;Le(43455,j);i=28}else i=28;while(0);if((i|0)==28?c[17617]|0:0){J=50;l=K;return J|0}switch(f|0){case 16:{h=10;I=4;break}case 24:{h=12;I=6;break}case 32:{h=14;I=8;break}default:{J=44;l=K;return J|0}}c[b+480>>2]=h;g=b+484|0;a[g>>0]=a[g>>0]&-2;c[b+488>>2]=29;c[b+492>>2]=30;c[b+496>>2]=1;c[b+500>>2]=2;g=0;do{a[(g&3)+(J+(g>>2<<2))>>0]=a[e+g>>0]|0;g=g+1|0}while((g|0)!=(f|0));j=I+-1|0;H=J+32|0;g=j;while(1){c[H+(g<<2)>>2]=c[J+(g<<2)>>2];if((g|0)>0)g=g+-1|0;else break}G=h|1;h=0;e=0;g=0;do{if((g|0)<(I|0)&(h|0)<4){E=g-I|0;F=h+-4|0;cr(b+((e<<4)+(h<<2))|0,H+(g<<2)|0,S(E>>>0>F>>>0?E:F,-4)|0)|0;do{g=g+1|0;h=h+1|0}while((g|0)<(I|0)&(h|0)<4)}i=(h|0)==4;e=(i&1)+e|0;h=i?0:h;i=(e|0)<(G|0)}while((g|0)<(I|0)&i);if(i){B=H+(j<<2)+1|0;C=H+(j<<2)+2|0;D=H+1|0;E=H+(j<<2)+3|0;F=H+2|0;o=H+(j<<2)|0;p=H+3|0;q=(I|0)==8;r=I>>>1;y=r+-1|0;s=H+(y<<2)|0;t=H+(r<<2)|0;u=H+(y<<2)+1|0;v=H+(r<<2)+1|0;w=H+(y<<2)+2|0;x=H+(r<<2)+2|0;y=H+(y<<2)+3|0;z=H+(r<<2)+3|0;k=r+1|0;A=k>>>0<8;n=H+(r<<2)|0;f=0;i=e;do{j=c[H>>2]|0;e=j&255^a[4801+((d[B>>0]|0)<<2)>>0];a[H>>0]=e;a[D>>0]=(j&65535)>>>8&255^a[4801+((d[C>>0]|0)<<2)>>0];a[F>>0]=j>>>16&255^a[4801+((d[E>>0]|0)<<2)>>0];a[p>>0]=j>>>24&255^a[4801+((d[o>>0]|0)<<2)>>0];a[H>>0]=e&255^c[7104+(f<<2)>>2];f=f+1|0;if(q){g=1;j=c[H>>2]|0;do{e=H+(g<<2)|0;j=c[e>>2]^j;c[e>>2]=j;g=g+1|0}while((g|0)<(r|0));a[t>>0]=a[t>>0]^a[4801+((d[s>>0]|0)<<2)>>0];a[v>>0]=a[v>>0]^a[4801+((d[u>>0]|0)<<2)>>0];a[x>>0]=a[x>>0]^a[4801+((d[w>>0]|0)<<2)>>0];a[z>>0]=a[z>>0]^a[4801+((d[y>>0]|0)<<2)>>0];if(A){g=k;j=c[n>>2]|0;do{e=H+(g<<2)|0;j=c[e>>2]^j;c[e>>2]=j;g=g+1|0}while((g|0)<8)}}else{g=1;j=c[H>>2]|0;do{e=H+(g<<2)|0;j=c[e>>2]^j;c[e>>2]=j;g=g+1|0}while((g|0)<(I|0))}if((i|0)<(G|0)){g=0;do{if((g|0)<(I|0)&(h|0)<4){j=g-I|0;e=h+-4|0;cr(b+((i<<4)+(h<<2))|0,H+(g<<2)|0,S(j>>>0>e>>>0?j:e,-4)|0)|0;do{g=g+1|0;h=h+1|0}while((g|0)<(I|0)&(h|0)<4)}e=(h|0)==4;i=(e&1)+i|0;h=e?0:h}while((g|0)<(I|0)&(i|0)<(G|0))}}while((i|0)<(G|0))}b=J;c[b>>2]=0;c[b+4>>2]=0;b=J+8|0;c[b>>2]=0;c[b+4>>2]=0;b=J+16|0;c[b>>2]=0;c[b+4>>2]=0;b=J+24|0;c[b>>2]=0;c[b+4>>2]=0;b=J+32|0;c[b>>2]=0;c[b+4>>2]=0;b=J+40|0;c[b>>2]=0;c[b+4>>2]=0;b=J+48|0;c[b>>2]=0;c[b+4>>2]=0;J=J+56|0;c[J>>2]=0;c[J+4>>2]=0;J=0;l=K;return J|0}function bi(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;h=b+484|0;if(a[h>>0]&1)return;i=b+240|0;c[i>>2]=c[b>>2];c[i+4>>2]=c[b+4>>2];c[b+248>>2]=c[b+8>>2];c[b+252>>2]=c[b+12>>2];g=b+480|0;e=b+16|0;if((c[g>>2]|0)>1){f=1;do{e=c[e>>2]|0;j=c[5824+((d[4801+(e>>>6&1020)>>0]|0)<<2)>>2]|0;k=c[5824+((d[4801+(e>>>14&1020)>>0]|0)<<2)>>2]|0;l=c[5824+((d[4801+(e>>>24<<2)>>0]|0)<<2)>>2]|0;c[i+(f<<4)>>2]=(j<<8|j>>>24)^c[5824+((d[4801+(e<<2&1020)>>0]|0)<<2)>>2]^(k<<16|k>>>16)^(l<<24|l>>>8);l=c[b+(f<<4)+4>>2]|0;k=c[5824+((d[4801+(l>>>6&1020)>>0]|0)<<2)>>2]|0;e=c[5824+((d[4801+(l>>>14&1020)>>0]|0)<<2)>>2]|0;j=c[5824+((d[4801+(l>>>24<<2)>>0]|0)<<2)>>2]|0;c[i+(f<<4)+4>>2]=(k<<8|k>>>24)^c[5824+((d[4801+(l<<2&1020)>>0]|0)<<2)>>2]^(e<<16|e>>>16)^(j<<24|j>>>8);j=c[b+(f<<4)+8>>2]|0;e=c[5824+((d[4801+(j>>>6&1020)>>0]|0)<<2)>>2]|0;l=c[5824+((d[4801+(j>>>14&1020)>>0]|0)<<2)>>2]|0;k=c[5824+((d[4801+(j>>>24<<2)>>0]|0)<<2)>>2]|0;c[i+(f<<4)+8>>2]=(e<<8|e>>>24)^c[5824+((d[4801+(j<<2&1020)>>0]|0)<<2)>>2]^(l<<16|l>>>16)^(k<<24|k>>>8);k=c[b+(f<<4)+12>>2]|0;l=c[5824+((d[4801+(k>>>6&1020)>>0]|0)<<2)>>2]|0;j=c[5824+((d[4801+(k>>>14&1020)>>0]|0)<<2)>>2]|0;e=c[5824+((d[4801+(k>>>24<<2)>>0]|0)<<2)>>2]|0;c[i+(f<<4)+12>>2]=(l<<8|l>>>24)^c[5824+((d[4801+(k<<2&1020)>>0]|0)<<2)>>2]^(j<<16|j>>>16)^(e<<24|e>>>8);f=f+1|0;e=b+(f<<4)|0}while((f|0)<(c[g>>2]|0))}else f=1;c[i+(f<<4)>>2]=c[e>>2];c[i+(f<<4)+4>>2]=c[b+(f<<4)+4>>2];c[i+(f<<4)+8>>2]=c[b+(f<<4)+8>>2];c[i+(f<<4)+12>>2]=c[b+(f<<4)+12>>2];a[h>>0]=a[h>>0]|1;return}function ci(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;h=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=h+8|0;f=h+4|0;g=h;c[f>>2]=0;c[g>>2]=0;if((a|0)!=2)if((a|0)==5)d=1;else{xg(0);xg(0);g=38154;l=h;return g|0}else d=0;a=c[4472+(d*164|0)>>2]|0;if(vg(f,7,a,0)|0){xg(c[f>>2]|0);xg(c[g>>2]|0);g=38181;l=h;return g|0}b=(vg(g,7,a,0)|0)==0;a=c[f>>2]|0;if(!b){xg(a);xg(c[g>>2]|0);g=38181;l=h;return g|0}b=4472+(d*164|0)+4|0;if(!(Ag(a,b,16)|0)){b=(Ag(c[g>>2]|0,b,16)|0)==0;a=c[f>>2]|0;if(b){b=4472+(d*164|0)+20|0;if((Bg(a,b,16)|0)==0?(Bg(c[g>>2]|0,b,16)|0)==0:0){a=4472+(d*164|0)+36|0;a:do if(!(yg(c[f>>2]|0,e,16,a,16)|0)){b=4472+(d*164|0)+52|0;b:do if(!(Tp(e,b,16)|0)){c:do if(!(zg(c[g>>2]|0,e,16,b,16)|0)){do if(!(Tp(e,a,16)|0)){a=4472+(d*164|0)+68|0;if(yg(c[f>>2]|0,e,16,a,16)|0)break a;b=4472+(d*164|0)+84|0;if(Tp(e,b,16)|0)break b;if(zg(c[g>>2]|0,e,16,b,16)|0)break c;if(Tp(e,a,16)|0)break;a=4472+(d*164|0)+100|0;if(yg(c[f>>2]|0,e,16,a,16)|0)break a;b=4472+(d*164|0)+116|0;if(Tp(e,b,16)|0)break b;if(zg(c[g>>2]|0,e,16,b,16)|0)break c;if(Tp(e,a,16)|0)break;b=4472+(d*164|0)+132|0;if(yg(c[f>>2]|0,e,16,b,16)|0)break a;a=4472+(d*164|0)+148|0;if(Tp(e,a,16)|0)break b;if(zg(c[g>>2]|0,e,16,a,16)|0)break c;if(Tp(e,b,16)|0)break;xg(c[f>>2]|0);xg(c[g>>2]|0);g=0;l=h;return g|0}while(0);xg(c[f>>2]|0);xg(c[g>>2]|0);g=38250;l=h;return g|0}while(0);xg(c[f>>2]|0);xg(c[g>>2]|0);g=38234;l=h;return g|0}while(0);xg(c[f>>2]|0);xg(c[g>>2]|0);g=38217;l=h;return g|0}while(0);xg(c[f>>2]|0);xg(c[g>>2]|0);g=38201;l=h;return g|0}xg(c[f>>2]|0);xg(c[g>>2]|0);g=38194;l=h;return g|0}}else a=c[f>>2]|0;xg(a);xg(c[g>>2]|0);g=38186;l=h;return g|0}function di(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;F=l;l=l+16|0;if((l|0)>=(m|0))$(16);E=F;h=c[b+496>>2]|0;if(h|0)vb[h&3]();j=c[b+488>>2]|0;if(!g){d=E;c[d>>2]=0;c[d+4>>2]=0;E=E+8|0;c[E>>2]=0;c[E+4>>2]=0;l=F;return}k=E+4|0;n=E+8|0;o=E+12|0;p=E+1|0;q=E+2|0;r=E+3|0;s=E+4|0;t=s+1|0;u=s+2|0;v=s+3|0;w=E+8|0;x=w+1|0;y=w+2|0;z=w+3|0;A=E+12|0;B=A+1|0;C=A+2|0;D=A+3|0;do{i=pb[j&63](b,E,d)|0;if(!((e|f)&3)){c[e>>2]=c[f>>2]^c[E>>2];c[e+4>>2]=c[f+4>>2]^c[k>>2];c[e+8>>2]=c[f+8>>2]^c[n>>2];c[e+12>>2]=c[f+12>>2]^c[o>>2]}else{a[e>>0]=a[f>>0]^a[E>>0];a[e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[f+13>>0]|0)<<8|(d[f+12>>0]|0));k=c[4800+((p>>>8&255)<<2)>>2]|0;s=c[4800+((p>>>16&255)<<2)>>2]|0;r=c[4800+(p>>>24<<2)>>2]|0;o=c[4800+((q>>>8&255)<<2)>>2]|0;m=c[4800+((q>>>16&255)<<2)>>2]|0;t=c[4800+(q>>>24<<2)>>2]|0;i=c[4800+((g>>>8&255)<<2)>>2]|0;n=c[4800+((g>>>16&255)<<2)>>2]|0;h=c[4800+(g>>>24<<2)>>2]|0;f=c[4800+((j>>>8&255)<<2)>>2]|0;f=(t<<24|t>>>8)^(s<<16|s>>>16)^c[4800+((g&255)<<2)>>2]^c[b+24>>2]^(f<<8|f>>>24);g=c[4800+((j>>>16&255)<<2)>>2]|0;g=(r<<24|r>>>8)^c[4800+((q&255)<<2)>>2]^c[b+20>>2]^(i<<8|i>>>24)^(g<<16|g>>>16);i=c[4800+(j>>>24<<2)>>2]|0;i=c[b+16>>2]^c[4800+((p&255)<<2)>>2]^(o<<8|o>>>24)^(n<<16|n>>>16)^(i<<24|i>>>8);j=(m<<16|m>>>16)^(k<<8|k>>>24)^(h<<24|h>>>8)^c[4800+((j&255)<<2)>>2]^c[b+28>>2];h=i&255;if((l|0)>2){k=2;do{t=c[4800+((i>>>8&255)<<2)>>2]|0;w=c[4800+((i>>>16&255)<<2)>>2]|0;m=c[4800+(i>>>24<<2)>>2]|0;x=c[4800+((g>>>8&255)<<2)>>2]|0;q=c[4800+((g>>>16&255)<<2)>>2]|0;p=c[4800+(g>>>24<<2)>>2]|0;u=c[4800+((f>>>8&255)<<2)>>2]|0;z=c[4800+((f>>>16&255)<<2)>>2]|0;s=c[4800+(f>>>24<<2)>>2]|0;y=c[4800+((j>>>8&255)<<2)>>2]|0;y=(p<<24|p>>>8)^(w<<16|w>>>16)^c[4800+((f&255)<<2)>>2]^c[b+(k<<4)+8>>2]^(y<<8|y>>>24);w=c[4800+((j>>>16&255)<<2)>>2]|0;w=(m<<24|m>>>8)^c[4800+((g&255)<<2)>>2]^c[b+(k<<4)+4>>2]^(u<<8|u>>>24)^(w<<16|w>>>16);u=c[4800+(j>>>24<<2)>>2]|0;u=c[b+(k<<4)>>2]^c[4800+(h<<2)>>2]^(x<<8|x>>>24)^(z<<16|z>>>16)^(u<<24|u>>>8);s=(q<<16|q>>>16)^(t<<8|t>>>24)^(s<<24|s>>>8)^c[4800+((j&255)<<2)>>2]^c[b+(k<<4)+12>>2];t=k|1;q=c[4800+((u>>>8&255)<<2)>>2]|0;z=c[4800+((u>>>16&255)<<2)>>2]|0;x=c[4800+(u>>>24<<2)>>2]|0;m=c[4800+((w>>>8&255)<<2)>>2]|0;p=c[4800+((w>>>16&255)<<2)>>2]|0;A=c[4800+(w>>>24<<2)>>2]|0;v=c[4800+((y>>>8&255)<<2)>>2]|0;n=c[4800+((y>>>16&255)<<2)>>2]|0;r=c[4800+(y>>>24<<2)>>2]|0;o=c[4800+((s>>>8&255)<<2)>>2]|0;f=(A<<24|A>>>8)^(z<<16|z>>>16)^c[4800+((y&255)<<2)>>2]^c[b+(t<<4)+8>>2]^(o<<8|o>>>24);o=c[4800+((s>>>16&255)<<2)>>2]|0;g=(x<<24|x>>>8)^c[4800+((w&255)<<2)>>2]^c[b+(t<<4)+4>>2]^(v<<8|v>>>24)^(o<<16|o>>>16);o=c[4800+(s>>>24<<2)>>2]|0;i=c[b+(t<<4)>>2]^c[4800+((u&255)<<2)>>2]^(m<<8|m>>>24)^(n<<16|n>>>16)^(o<<24|o>>>8);j=(p<<16|p>>>16)^(q<<8|q>>>24)^(r<<24|r>>>8)^c[4800+((s&255)<<2)>>2]^c[b+(t<<4)+12>>2];k=k+2|0;h=i&255}while((k|0)<(l|0));k=l+1&-2}else k=2;r=c[b+(k<<4)>>2]|0;u=r^(d[4801+(h<<2)>>0]|0);t=(d[4801+(g>>>6&1020)>>0]|0)<<8^r;v=c[b+(k<<4)+4>>2]|0;x=v^(d[4801+(g<<2&1020)>>0]|0|(d[4801+(i>>>24<<2)>>0]|0)<<24);w=(d[4801+(f>>>6&1020)>>0]|0)<<8^v;s=(d[4801+(f>>>14&1020)>>0]|0)<<16^r;z=c[b+(k<<4)+8>>2]^((d[4801+(g>>>24<<2)>>0]|0)<<24|(d[4801+(i>>>14&1020)>>0]|0)<<16|(d[4801+(f<<2&1020)>>0]|0));y=(d[4801+(j>>>6&1020)>>0]|0)<<8^z;v=(d[4801+(j>>>14&1020)>>0]|0)<<16^v;A=c[b+(k<<4)+12>>2]^((d[4801+(g>>>14&1020)>>0]|0)<<16|(d[4801+(i>>>6&1020)>>0]|0)<<8|(d[4801+(f>>>24<<2)>>0]|0)<<24|(d[4801+(j<<2&1020)>>0]|0));a[e+3>>0]=((d[4801+(j>>>24<<2)>>0]|0)<<24^r)>>>24;a[e+2>>0]=s>>>16;a[e+1>>0]=t>>>8;a[e>>0]=u;a[e+7>>0]=x>>>24;a[e+6>>0]=v>>>16;a[e+5>>0]=w>>>8;a[e+4>>0]=x;a[e+11>>0]=z>>>24;a[e+10>>0]=z>>>16;a[e+9>>0]=y>>>8;a[e+8>>0]=z;a[e+15>>0]=A>>>24;a[e+14>>0]=A>>>16;a[e+13>>0]=A>>>8;a[e+12>>0]=A;return 64}function hi(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;i=c[b+480>>2]|0;p=b+240|0;m=i;h=c[p+(i<<4)>>2]^((d[f+2>>0]|0)<<16|(d[f+3>>0]|0)<<24|(d[f+1>>0]|0)<<8|(d[f>>0]|0));n=c[p+(i<<4)+12>>2]^((d[f+14>>0]|0)<<16|(d[f+15>>0]|0)<<24|(d[f+13>>0]|0)<<8|(d[f+12>>0]|0));o=c[p+(i<<4)+4>>2]^((d[f+6>>0]|0)<<16|(d[f+7>>0]|0)<<24|(d[f+5>>0]|0)<<8|(d[f+4>>0]|0));i=c[p+(i<<4)+8>>2]^((d[f+10>>0]|0)<<16|(d[f+11>>0]|0)<<24|(d[f+9>>0]|0)<<8|(d[f+8>>0]|0));while(1){g=m+-1|0;k=c[5824+((h&255)<<2)>>2]|0;l=c[5824+((h>>>8&255)<<2)>>2]|0;l=l<<8|l>>>24;j=c[5824+((h>>>16&255)<<2)>>2]|0;j=j<<16|j>>>16;f=c[5824+(h>>>24<<2)>>2]|0;f=f<<24|f>>>8;if((g|0)<=1)break;w=c[5824+((o>>>8&255)<<2)>>2]|0;s=c[5824+((o>>>16&255)<<2)>>2]|0;z=c[5824+(o>>>24<<2)>>2]|0;u=c[5824+((i>>>8&255)<<2)>>2]|0;t=c[5824+((i>>>16&255)<<2)>>2]|0;x=c[5824+(i>>>24<<2)>>2]|0;A=c[5824+((n>>>8&255)<<2)>>2]|0;A=c[p+(g<<4)>>2]^k^(z<<24|z>>>8)^(t<<16|t>>>16)^(A<<8|A>>>24);t=c[5824+((n>>>16&255)<<2)>>2]|0;t=c[5824+((o&255)<<2)>>2]^l^c[p+(g<<4)+4>>2]^(x<<24|x>>>8)^(t<<16|t>>>16);k=c[5824+(n>>>24<<2)>>2]|0;j=(w<<8|w>>>24)^j^c[5824+((i&255)<<2)>>2]^c[p+(g<<4)+8>>2]^(k<<24|k>>>8);u=(s<<16|s>>>16)^f^(u<<8|u>>>24)^c[5824+((n&255)<<2)>>2]^c[p+(g<<4)+12>>2];k=m+-2|0;s=c[5824+((A>>>8&255)<<2)>>2]|0;g=c[5824+((A>>>16&255)<<2)>>2]|0;w=c[5824+(A>>>24<<2)>>2]|0;f=c[5824+((t>>>8&255)<<2)>>2]|0;x=c[5824+((t>>>16&255)<<2)>>2]|0;z=c[5824+(t>>>24<<2)>>2]|0;v=c[5824+((j>>>8&255)<<2)>>2]|0;y=c[5824+((j>>>16&255)<<2)>>2]|0;r=c[5824+(j>>>24<<2)>>2]|0;h=c[5824+((u>>>8&255)<<2)>>2]|0;q=c[5824+((u>>>16&255)<<2)>>2]|0;l=c[5824+(u>>>24<<2)>>2]|0;m=k;h=c[p+(k<<4)>>2]^c[5824+((A&255)<<2)>>2]^(z<<24|z>>>8)^(y<<16|y>>>16)^(h<<8|h>>>24);n=(x<<16|x>>>16)^(w<<24|w>>>8)^(v<<8|v>>>24)^c[5824+((u&255)<<2)>>2]^c[p+(k<<4)+12>>2];o=c[5824+((t&255)<<2)>>2]^(s<<8|s>>>24)^c[p+(k<<4)+4>>2]^(r<<24|r>>>8)^(q<<16|q>>>16);i=(f<<8|f>>>24)^(g<<16|g>>>16)^c[5824+((j&255)<<2)>>2]^c[p+(k<<4)+8>>2]^(l<<24|l>>>8)}u=c[5824+((o>>>8&255)<<2)>>2]|0;r=c[5824+((o>>>16&255)<<2)>>2]|0;x=c[5824+(o>>>24<<2)>>2]|0;A=c[5824+((i>>>8&255)<<2)>>2]|0;q=c[5824+((i>>>16&255)<<2)>>2]|0;w=c[5824+(i>>>24<<2)>>2]|0;m=c[5824+((n>>>8&255)<<2)>>2]|0;m=c[b+256>>2]^k^(x<<24|x>>>8)^(q<<16|q>>>16)^(m<<8|m>>>24);q=c[5824+((n>>>16&255)<<2)>>2]|0;q=c[5824+((o&255)<<2)>>2]^l^c[b+260>>2]^(w<<24|w>>>8)^(q<<16|q>>>16);o=c[5824+(n>>>24<<2)>>2]|0;o=(u<<8|u>>>24)^j^c[5824+((i&255)<<2)>>2]^c[b+264>>2]^(o<<24|o>>>8);A=(r<<16|r>>>16)^f^(A<<8|A>>>24)^c[5824+((n&255)<<2)>>2]^c[b+268>>2];r=c[p>>2]|0;u=r^(d[6848+(m&255)>>0]|0);w=c[p+4>>2]|0;x=w^(d[6848+(q&255)>>0]|0|(d[6848+(m>>>8&255)>>0]|0)<<8);s=(d[6848+(o>>>16&255)>>0]|0)<<16^r;v=(d[6848+(o>>>24)>>0]|0)<<24^w;z=c[b+248>>2]^((d[6848+(q>>>8&255)>>0]|0)<<8|(d[6848+(m>>>16&255)>>0]|0)<<16|(d[6848+(o&255)>>0]|0));t=(d[6848+(A>>>8&255)>>0]|0)<<8^r;w=(d[6848+(A>>>16&255)>>0]|0)<<16^w;y=(d[6848+(A>>>24)>>0]|0)<<24^z;A=c[b+252>>2]^((d[6848+(q>>>16&255)>>0]|0)<<16|(d[6848+(m>>>24)>>0]|0)<<24|(d[6848+(o>>>8&255)>>0]|0)<<8|(d[6848+(A&255)>>0]|0));a[e+3>>0]=((d[6848+(q>>>24)>>0]|0)<<24^r)>>>24;a[e+2>>0]=s>>>16;a[e+1>>0]=t>>>8;a[e>>0]=u;a[e+7>>0]=v>>>24;a[e+6>>0]=w>>>16;a[e+5>>0]=x>>>8;a[e+4>>0]=x;a[e+11>>0]=y>>>24;a[e+10>>0]=z>>>16;a[e+9>>0]=z>>>8;a[e+8>>0]=z;a[e+15>>0]=A>>>24;a[e+14>>0]=A>>>16;a[e+13>>0]=A>>>8;a[e+12>>0]=A;return 64}function ii(){return}function ji(){return}function ki(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;h=c[b+496>>2]|0;if(h|0)vb[h&3]();B=c[b+488>>2]|0;if(!g)return;i=d;j=d+4|0;k=d+8|0;l=d+12|0;m=d+1|0;n=d+2|0;o=d+3|0;p=d+4|0;q=d+5|0;r=d+6|0;s=d+7|0;t=d+8|0;u=d+9|0;v=d+10|0;w=d+11|0;x=d+12|0;y=d+13|0;z=d+14|0;A=d+15|0;h=g;while(1){g=pb[B&63](b,d,d)|0;if(!((e|i|f)&3)){C=c[d>>2]^c[f>>2];c[d>>2]=C;c[e>>2]=C;C=c[j>>2]^c[f+4>>2];c[j>>2]=C;c[e+4>>2]=C;C=c[k>>2]^c[f+8>>2];c[k>>2]=C;c[e+8>>2]=C;C=c[l>>2]^c[f+12>>2];c[l>>2]=C;c[e+12>>2]=C}else{C=a[d>>0]^a[f>>0];a[d>>0]=C;a[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]=a[i+8>>0]^a[f+8>>0];a[v>>0]=a[i+9>>0]^a[f+9>>0];a[w>>0]=a[i+10>>0]^a[f+10>>0];a[x>>0]=a[i+11>>0]^a[f+11>>0];a[y>>0]=a[i+12>>0]^a[f+12>>0];a[z>>0]=a[i+13>>0]^a[f+13>>0];a[A>>0]=a[i+14>>0]^a[f+14>>0];a[B>>0]=a[i+15>>0]^a[f+15>>0]}i=pb[C&63](b,e,e)|0;h=h+-1|0;if(!h)break;else{i=e;f=f+16|0}}}do if((e|0)!=(d|0))if(!((e|d)&3)){c[d>>2]=c[e>>2];c[d+4>>2]=c[e+4>>2];c[d+8>>2]=c[e+8>>2];c[d+12>>2]=c[e+12>>2];break}else{a[d>>0]=a[e>>0]|0;a[d+1>>0]=a[e+1>>0]|0;a[d+2>>0]=a[e+2>>0]|0;a[d+3>>0]=a[e+3>>0]|0;a[d+4>>0]=a[e+4>>0]|0;a[d+5>>0]=a[e+5>>0]|0;a[d+6>>0]=a[e+6>>0]|0;a[d+7>>0]=a[e+7>>0]|0;a[d+8>>0]=a[e+8>>0]|0;a[d+9>>0]=a[e+9>>0]|0;a[d+10>>0]=a[e+10>>0]|0;a[d+11>>0]=a[e+11>>0]|0;a[d+12>>0]=a[e+12>>0]|0;a[d+13>>0]=a[e+13>>0]|0;a[d+14>>0]=a[e+14>>0]|0;a[d+15>>0]=a[e+15>>0]|0;break}while(0);if(!i)return;Te(i+16|0);return} +function Mk(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0;fa=l;l=l+208|0;if((l|0)>=(m|0))$(208);U=fa+136|0;T=fa+72|0;R=fa+40|0;H=fa+20|0;I=fa;v=c[e+4>>2]|0;V=c[f+4>>2]|0;r=V<<1;W=c[f+8>>2]|0;g=v<<5;if((g|0)<=512)if((g|0)<=256)if((g|0)>128)D=3;else D=(g|0)>64?2:1;else D=4;else D=5;u=c[e+12>>2]&1;S=(u|0)!=0;s=c[f+12>>2]&1;q=(s|0)!=0;if(!b)k=0;else k=(c[b+12>>2]&1|0)!=0;n=k&1;Z=a+16|0;g=c[Z>>2]|0;o=c[e+16>>2]|0;if(!V)Ve();if(!v){if((V|0)==1){ea=(c[c[f+16>>2]>>2]|0)!=1;c[a+4>>2]=ea&1;if(ea)G=13}else{c[a+4>>2]=1;G=13}if((G|0)==13){if((c[a>>2]|0)<1){ql(a,1);g=c[Z>>2]|0}c[g>>2]=1}c[a+8>>2]=0;l=fa;return}X=q?V:0;Y=ml(V,s)|0;f=c[f+16>>2]|0;Q=c[f+(V+-1<<2)>>2]|0;P=Q>>>0<65536?(Q>>>0<256?0:8):Q>>>0<16777216?16:24;P=32-(d[45555+(Q>>>P)>>0]|0)-P|0;Q=(P|0)!=0;if(!Q){if((V|0)>0){e=0;do{c[Y+(e<<2)>>2]=c[f+(e<<2)>>2];e=e+1|0}while((e|0)!=(V|0))}}else _k(Y,f,V,P)|0;i=c[b+4>>2]|0;p=c[b+8>>2]|0;a:do if((i|0)>(V|0)){j=i+1|0;h=k?j:0;j=ml(j,n)|0;if((i|0)>0){f=c[b+16>>2]|0;e=0;do{c[j+(e<<2)>>2]=c[f+(e<<2)>>2];e=e+1|0}while((e|0)!=(i|0))}Yk(j+(V<<2)|0,0,j,i,Y,V)|0;i=V;while(1){if((i|0)<=0){f=j;b=j;e=i;G=29;break a}e=i+-1|0;if(!(c[j+(e<<2)>>2]|0))i=e;else{f=j;b=j;G=31;break}}}else{f=c[b+16>>2]|0;b=0;h=0;e=i;G=29}while(0);if((G|0)==29)if(!e){c[a+4>>2]=0;c[a+8>>2]=0;_=0;aa=0;ba=0;ca=0;da=b;ea=h}else{i=e;G=31}do if((G|0)==31){if((g|0)==(f|0)){if(b|0)Ie(45811,45822,515,45832);b=k?i:0;f=ml(i,n)|0;if((i|0)>0){e=0;do{c[f+(e<<2)>>2]=c[g+(e<<2)>>2];e=e+1|0}while((e|0)!=(i|0));t=f;O=f;N=b}else{t=f;O=f;N=b}}else{t=f;O=b;N=h}if((g|0)==(o|0)){b=S?v:0;f=ml(v,u)|0;if((v|0)>0){e=0;do{c[f+(e<<2)>>2]=c[g+(e<<2)>>2];e=e+1|0}while((e|0)!=(v|0));z=f;M=f;L=b}else{z=f;M=f;L=b}}else{z=o;M=0;L=0}if((c[a>>2]|0)<(r|0)){ql(a,r);g=c[Z>>2]|0}J=r+2|0;K=q?J:0;J=ml(J,s)|0;c[R>>2]=0;c[R+4>>2]=0;c[R+8>>2]=0;c[R+12>>2]=0;c[R+16>>2]=0;c[R+20>>2]=0;c[R+24>>2]=0;F=(p|0)!=0&(c[z>>2]&1|0)!=0;if(D>>>0>1){if((i|0)<16)el(J,t,i,t,i)|0;else dl(J,t,i,t,i,R);e=i<<1;if((e|0)>(V|0)){Yk(J+(V<<2)|0,0,J,e,Y,V)|0;e=V}}else e=0;b=ml(i,u)|0;c[U>>2]=b;c[T>>2]=i;p=(i|0)>0;if(p){f=0;do{c[b+(f<<2)>>2]=c[t+(f<<2)>>2];f=f+1|0}while((f|0)!=(i|0))}q=D+-1|0;E=1<1){n=(e|0)<16;o=g+(V<<2)|0;k=1;h=i;f=i;do{if((e|0)<(f|0)){if(n)el(g,b,f,J,e)|0;else dl(g,b,f,J,e,R);f=f+e|0;if((f|0)>(V|0)){Yk(o,0,g,f,Y,V)|0;f=V}}else{if((f|0)<16)el(g,J,e,b,f)|0;else dl(g,J,e,b,f,R);f=f+e|0;if((f|0)>(V|0)){Yk(o,0,g,f,Y,V)|0;f=V}}b=ml(f,u)|0;c[U+(k<<2)>>2]=b;c[T+(k<<2)>>2]=f;h=(h|0)<(f|0)?f:h;if((f|0)>0){j=0;do{c[b+(j<<2)>>2]=c[g+(j<<2)>>2];j=j+1|0}while((j|0)!=(f|0))}k=k+1|0}while((k|0)!=(E|0));C=h}else C=i;B=ml(C,u)|0;if((C|0)>0)Yq(B|0,0,C<<2|0)|0;j=v+-1|0;if((D|0)!=1)if((V|0)>0){Yq(g|0,0,V<<2|0)|0;e=V}else e=V;else e=i;if(p){f=0;do{c[g+(f<<2)>>2]=c[t+(f<<2)>>2];f=f+1|0}while((f|0)!=(i|0))}b=c[z+(j<<2)>>2]|0;i=b>>>0<65536?(b>>>0<256?0:8):b>>>0<16777216?16:24;i=32-(d[45555+(b>>>i)>>0]|0)-i|0;y=32-D|0;A=(q|0)==31;q=H+4|0;r=I+4|0;s=I+8|0;t=H+8|0;u=I+12|0;v=H+12|0;w=H+16|0;x=I+16|0;b=b<>2]|0;if(!b){i=32;b=j}else{i=32;break}}}p=b>>>0<65536?(b>>>0<256?0:8):b>>>0<16777216?16:24;p=32-p-(d[45555+(b>>>p)>>0]|0)|0;b=b<>2]|0;i=n+y|0;k=j>>>i|b>>>y;b=j<>>y;b=b<>>0<65536?(n>>>0<256?0:8):n>>>0<16777216?16:24;f=(d[45555+(n>>>f)>>0]|0)+-1+f|0;n=k>>>f>>>1;j=p+D-f|0;if(!j)k=h;else while(1){if((e|0)<16)el(h,g,e,g,e)|0;else dl(h,g,e,g,e,R);e=e<<1;if((e|0)>(V|0)){Yk(h+(V<<2)|0,0,h,e,Y,V)|0;e=V}j=j+-1|0;if(!j){k=g;g=h;break}else{p=g;g=h;h=p}}do if(A){h=0;G=90}else{j=0;h=0;do{p=c[T+(j<<2)>>2]|0;c[q>>2]=p;c[H>>2]=p;c[r>>2]=p;c[I>>2]=p;c[s>>2]=0;c[t>>2]=0;c[u>>2]=0;c[v>>2]=0;c[w>>2]=B;c[x>>2]=c[U+(j<<2)>>2];ga=(j|0)==(n|0);Dl(H,I,ga&1)|0;h=(ga?p:0)|h;j=j+1|0}while((j|0)<(E|0));if((h|0)<16){G=90;break}dl(k,g,e,B,h,R)}while(0);if((G|0)==90){G=0;el(k,g,e,B,h)|0}e=h+e|0;if((e|0)<=(V|0)){h=g;g=k;j=o;continue}Yk(k+(V<<2)|0,0,k,e,Y,V)|0;h=g;g=k;j=o;e=V}if((G|0)==94){b=b>>>(32-n|0);if(!n){u=b;b=0;f=p}else{u=b&0-b;ga=u>>>0<65536?(u>>>0<256?0:8):u>>>0<16777216?16:24;ga=ga+-1+(d[45555+(u>>>ga)>>0]|0)|0;u=b>>>ga;b=ga;f=i+f-ga|0}}if(!f)t=h;else while(1){f=f+-1|0;if((e|0)<16)el(h,g,e,g,e)|0;else dl(h,g,e,g,e,R);e=e<<1;if((e|0)>(V|0)){Yk(h+(V<<2)|0,0,h,e,Y,V)|0;e=V}if(!f){t=g;g=h;break}else{ga=g;g=h;h=ga}}do if(u){do if(A){f=0;G=108}else{j=H+4|0;k=I+4|0;n=I+8|0;o=H+8|0;p=I+12|0;q=H+12|0;r=H+16|0;s=I+16|0;i=u>>>1;h=0;f=0;do{ga=c[T+(h<<2)>>2]|0;c[j>>2]=ga;c[H>>2]=ga;c[k>>2]=ga;c[I>>2]=ga;c[n>>2]=0;c[o>>2]=0;c[p>>2]=0;c[q>>2]=0;c[r>>2]=B;c[s>>2]=c[U+(h<<2)>>2];D=(h|0)==(i|0);Dl(H,I,D&1)|0;f=(D?ga:0)|f;h=h+1|0}while((h|0)<(E|0));if((f|0)<16){G=108;break}dl(t,g,e,B,f,R)}while(0);if((G|0)==108)el(t,g,e,B,f)|0;e=f+e|0;if((e|0)>(V|0)){Yk(t+(V<<2)|0,0,t,e,Y,V)|0;e=V}if(!b){g=t;break}else f=t;while(1){if((e|0)<16)el(g,f,e,f,e)|0;else dl(g,f,e,f,e,R);e=e<<1;if((e|0)>(V|0)){Yk(g+(V<<2)|0,0,g,e,Y,V)|0;e=V}b=b+-1|0;if(!b)break;else{ga=f;f=g;g=ga}}}while(0);b=c[Z>>2]|0;do if(Q){f=_k(b,g,e,P)|0;g=c[Z>>2]|0;if(!f)break;c[g+(e<<2)>>2]=f;e=e+1|0}else{if((b|0)==(g|0))break;if((e|0)>0)f=0;else{g=b;break}do{c[b+(f<<2)>>2]=c[g+(f<<2)>>2];f=f+1|0}while((f|0)!=(e|0));g=b}while(0);if((e|0)>=(V|0)){Yk(g+(V<<2)|0,0,g,e,Y,V)|0;e=V}if(Q)gl(g,g,e,P)|0;while(1){if((e|0)<=0)break;f=e+-1|0;if(!(c[g+(f<<2)>>2]|0))e=f;else break}fl(R);if(!A)if(S){f=0;do{ol(c[U+(f<<2)>>2]|0,c[T+(f<<2)>>2]|0);f=f+1|0}while((f|0)<(E|0))}else{f=0;do{ol(c[U+(f<<2)>>2]|0,0);f=f+1|0}while((f|0)<(E|0))}ol(B,S?C:0);c:do if(F&(e|0)!=0){if(Q)gl(Y,Y,V,P)|0;f=hl(g,Y,g,e)|0;b=V-e|0;d:do if(!b)e=V;else{T=g+(e<<2)|0;ga=Y+(e<<2)|0;e=ga+4|0;ga=c[ga>>2]|0;U=ga-f|0;f=T+4|0;c[T>>2]=U;if(U>>>0>ga>>>0)while(1){b=b+-1|0;if(!b){e=V;break d}i=e+4|0;ga=c[e>>2]|0;h=f+4|0;c[f>>2]=ga+-1;if(!ga){e=i;f=h}else{f=h;break}}else i=e;if((f|0)==(i|0)){e=V;break}h=b+-1|0;if((b|0)>1)e=0;else{e=V;break}do{c[f+(e<<2)>>2]=c[i+(e<<2)>>2];e=e+1|0}while((e|0)!=(h|0));e=V}while(0);while(1){if((e|0)<=0){f=W;break c}f=e+-1|0;if(!(c[g+(f<<2)>>2]|0))e=f;else{f=W;break}}}else f=0;while(0);if((c[Z>>2]|0)==(g|0)){c[a+4>>2]=e;c[a+8>>2]=f;_=J;aa=K;ba=M;ca=L;da=O;ea=N;break}else Ie(45847,45822,786,45832)}while(0);if(Y|0)ol(Y,X);if(da|0)ol(da,ea);if(ba|0)ol(ba,ca);if(!_){l=fa;return}ol(_,aa);l=fa;return}function Nk(a){a=a|0;var b=0,e=0,f=0,g=0,h=0;g=c[a+4>>2]|0;if(!g){h=0;return h|0}f=c[a+16>>2]|0;a=0;e=0;while(1){b=c[f+(e<<2)>>2]|0;if(b|0)break;a=a+32|0;e=e+1|0;if(e>>>0>=g>>>0){h=6;break}}if((h|0)==6)return a|0;g=b&0-b;h=g>>>0<65536?(g>>>0<256?0:8):g>>>0<16777216?16:24;h=a+-1+h+(d[45555+(g>>>h)>>0]|0)|0;return h|0}function Ok(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Pk(a,b,0,c,d,0)|0}function Pk(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0;if(g|0)c[g>>2]=c[b+8>>2];k=b+4|0;i=c[k>>2]|0;g=i<<2;c[f>>2]=g;g=(i|0)==0?1:g;i=(e|0)<0;j=0-e|0;g=(g>>>0>>0?d:g)+(i?j:e)|0;if((h|0)==0?(c[b+12>>2]&1|0)==0:0)l=_e(g)|0;else l=$e(g)|0;if(!l){f=0;return f|0}h=i?l+j|0:l;g=c[k>>2]|0;if((g|0)>0){i=b+16|0;e=h;while(1){b=g;g=g+-1|0;k=c[(c[i>>2]|0)+(g<<2)>>2]|0;a[e>>0]=k>>>24;a[e+1>>0]=k>>>16;a[e+2>>0]=k>>>8;a[e+3>>0]=k;if((b|0)<=1)break;else e=e+4|0}}g=c[f>>2]|0;if(d|0){i=g>>>1;if(i|0){j=g+-1|0;e=0;do{m=h+e|0;k=a[m>>0]|0;b=h+(j-e)|0;a[m>>0]=a[b>>0]|0;a[b>>0]=k;e=e+1|0}while((e|0)!=(i|0))}if(g>>>0>>0){Yq(h+g|0,0,d-g|0)|0;g=d}c[f>>2]=g;m=l;return m|0}if(!g){m=l;return m|0}else e=h;while(1){if(a[e>>0]|0)break;e=e+1|0;g=g+-1|0;c[f>>2]=g;if(!g){g=0;break}}if((e|0)==(h|0)){m=l;return m|0}dr(h|0,e|0,g|0)|0;m=l;return m|0}function Qk(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return Pk(a,b,c,d,e,0)|0}function Rk(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;if(a|0?c[a+12>>2]&16|0:0){sl();return}n=(e+3|0)>>>2;if((c[a>>2]|0)<(n|0))ql(a,n);c[a+8>>2]=f;m=e+-1|0;g=b+m|0;if((m|0)>3){l=e+-5|0;f=l>>>2;m=f<<2;f=f+1|0;l=l-m|0;k=c[a+16>>2]|0;h=0;j=e;while(1){i=j+-4|0;c[k+(h<<2)>>2]=(d[b+(j+-2)>>0]|0)<<8|(d[g>>0]|0)|(d[b+(j+-3)>>0]|0)<<16|(d[b+i>>0]|0)<<24;h=h+1|0;if((h|0)==(f|0))break;else{g=b+(j+-5)|0;j=i}}h=b+l|0;e=e+-4-m|0}else{f=0;h=g}if((e|0)>0){g=h+-1|0;e=d[h>>0]|0;if(g>>>0>=b>>>0){e=(d[g>>0]|0)<<8|e;g=h+-2|0}if(g>>>0>=b>>>0){e=(d[g>>0]|0)<<16|e;g=g+-1|0}if(g>>>0>=b>>>0)e=(d[g>>0]|0)<<24|e;c[(c[a+16>>2]|0)+(f<<2)>>2]=e;f=f+1|0}c[a+4>>2]=f;if((f|0)==(n|0))return;else Ie(45860,45872,377,45883)}function Sk(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;if(!f)m=0;else m=(af(f)|0)!=0;j=(e|0)==3;o=j?0:g;switch(e|0){case 1:{e=(o+3|0)>>>2;if(m)k=nl(e)|0;else k=ll(e)|0;if(o|0?(Rk(k,f,o,0),f=a[f>>0]|0,l=k+8|0,c[l>>2]=(f&255)>>>7&255,f<<24>>24<0):0){g=lk(k)|0;if(!(c[k+12>>2]&16)){kk(k);i=c[k+16>>2]|0;j=c[k+4>>2]|0;if(j|0){e=0;do{f=i+(e<<2)|0;c[f>>2]=~c[f>>2];e=e+1|0}while((e|0)!=(j|0))}c[l>>2]=0;pk(k,g+-1|0)}else sl();ek(k,k,1);c[l>>2]=1}if(!b)tl(k);else{kk(k);c[b>>2]=k}if(!h){b=0;return b|0}c[h>>2]=o;b=0;return b|0}case 5:{e=(o+3|0)>>>2;if(m)e=nl(e)|0;else e=ll(e)|0;if(o|0)Rk(e,f,o,0);if(!b)tl(e);else{kk(e);c[b>>2]=e}if(!h){b=0;return b|0}c[h>>2]=o;b=0;return b|0}case 2:{a:do if(o>>>0>=2?(i=d[f>>0]<<8|d[f+1>>0],i>>>0<=16384):0){i=(i+7|0)>>>3;k=(i+3|0)>>>2;if(m)e=nl(k)|0;else e=ll(k)|0;c[e+4>>2]=k;c[e+8>>2]=0;if(!k)g=2;else{m=e+16|0;g=2;j=f+2|0;i=0-i&3;b:while(1){l=0;do{g=g+1|0;if(g>>>0>o>>>0)break b;f=j;j=j+1|0;l=d[f>>0]|l<<8;i=i+1|0}while((i|0)<4);f=k;k=k+-1|0;c[(c[m>>2]|0)+(k<<2)>>2]=l;if((f|0)<=1)break a;else i=0}tl(e);e=0}}else{e=0;g=0}while(0);if(h|0)c[h>>2]=g;g=(e|0)!=0;if(!((b|0)!=0&g))if(g){tl(e);e=0}else e=0;else{kk(e);c[b>>2]=e}b=e|0?0:65;return b|0}default:{if(j){if((o+-1|0)>>>0<3){b=66;return b|0}i=d[f+1>>0]<<16|d[f>>0]<<24|d[f+2>>0]<<8|d[f+3>>0];g=f+4|0;f=o+-4|0;if(o|0?(f|0)!=0&i>>>0>f>>>0:0){b=67;return b|0}l=i+4|0;e=(i+3|0)>>>2;if(m)k=nl(e)|0;else k=ll(e)|0;if(i|0?(Rk(k,g,i,0),f=a[g>>0]|0,n=k+8|0,c[n>>2]=(f&255)>>>7&255,f<<24>>24<0):0){g=lk(k)|0;if(!(c[k+12>>2]&16)){kk(k);i=c[k+16>>2]|0;j=c[k+4>>2]|0;if(j|0){e=0;do{f=i+(e<<2)|0;c[f>>2]=~c[f>>2];e=e+1|0}while((e|0)!=(j|0))}c[n>>2]=0;pk(k,g+-1|0)}else sl();ek(k,k,1);c[n>>2]=1}if(h|0)c[h>>2]=l;if(!b){tl(k);b=0;return b|0}else{kk(k);c[b>>2]=k;b=0;return b|0}}if(!((e|0)==4&(g|0)==0)){b=45;return b|0}if(m)p=nl(0)|0;else p=ll(0)|0;g=(a[f>>0]|0)==45;e=g?f+1|0:f;if((a[e>>0]|0)==48)e=(a[e+1>>0]|0)==120?e+2|0:e;k=Fo(e)|0;j=((k<<2)+7|0)>>>3;i=(j+3|0)>>>2;if((c[p>>2]|0)>>>0>>0)ql(p,i);c[p+4>>2]=i;c[p+8>>2]=g&1;c:do if(i|0){o=p+16|0;j=0-j&3;g=k&1;d:while(1){n=0;while(1){if(!g){g=a[e>>0]|0;if(!(g<<24>>24)){e=82;break d}else{k=g<<24>>24;g=e+1|0}}else{k=48;g=e}e=g+1|0;l=a[g>>0]|0;m=l<<24>>24;if(!(l<<24>>24)){e=84;break d}g=k+-48|0;do if(g>>>0>=10){if((k+-97|0)>>>0<6){g=k+-87|0;break}if((k+-65|0)>>>0>=6){e=90;break d}g=k+-55|0}while(0);k=g<<4;do if((l+-48&255)<10)g=m+-48|0;else{if((l+-97&255)<6){g=m+-87|0;break}if((l+-65&255)>=6){e=97;break d}g=m+-55|0}while(0);n=k|n<<8|g;j=j+1|0;if((j|0)>=4)break;else g=0}m=i;i=i+-1|0;c[(c[o>>2]|0)+(i<<2)>>2]=n;if((m|0)<=1)break c;else{j=0;g=0}}if((e|0)==82)rl(p);else if((e|0)==84)rl(p);else if((e|0)==90)rl(p);else if((e|0)==97)rl(p);tl(p);b=65;return b|0}while(0);if(!b)tl(p);else{kk(p);c[b>>2]=p}if(!h){b=0;return b|0}c[h>>2]=Fo(f)|0;b=0;return b|0}}return 0}function Tk(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;q=l;l=l+16|0;if((l|0)>=(m|0))$(16);i=lk(h)|0;p=(g|0)==0?q:g;if((c[h+8>>2]|0)!=0?(vk(h,0)|0)!=0:0)o=1;else o=0;c[p>>2]=0;switch(b|0){case 1:{i=h+4|0;j=c[i>>2]|0;b=j<<2;j=(j|0)==0;g=j?1:b;if(!(c[h+12>>2]&1))k=_e(g)|0;else k=$e(g)|0;if(!k){p=Sn()|0;l=q;return p|0}g=c[i>>2]|0;if((g|0)>0){h=h+16|0;i=k;while(1){r=g;g=g+-1|0;s=c[(c[h>>2]|0)+(g<<2)>>2]|0;a[i>>0]=s>>>24;a[i+1>>0]=s>>>16;a[i+2>>0]=s>>>8;a[i+3>>0]=s;if((r|0)<=1)break;else i=i+4|0}}if(!j){g=k;while(1){if(a[g>>0]|0)break;g=g+1|0;b=b+-1|0;if(!b){b=0;break}}if((g|0)==(k|0))i=b;else{dr(k|0,g|0,b|0)|0;i=b}}else i=0;do if(!o)if(!i)if(!e){g=0;break}else{b=0;g=0;n=26;break}else{g=(d[k>>0]|0)>>>7&255;b=g;n=23;break}else{Uk(k,i);g=a[k>>0]|0;b=g<<24>>24<0?0:2;g=(g&255)>>>7&255^1;n=23}while(0);do if((n|0)==23){g=g+i|0;i=(e|0)!=0;if(!(i&g>>>0>f>>>0))if(i){n=26;break}else break;cf(k);s=66;l=q;return s|0}while(0);if((n|0)==26){switch(b&3){case 1:{a[e>>0]=0;e=e+1|0;break}case 0:break;default:{a[e>>0]=-1;e=e+1|0}}cr(e|0,k|0,g-((b|0)!=0&1)|0)|0}cf(k);c[p>>2]=g;s=0;l=q;return s|0}case 5:{g=(i+7|0)>>>3;b=(e|0)!=0;if(b&g>>>0>f>>>0){s=66;l=q;return s|0}if(b){i=h+4|0;j=c[i>>2]|0;g=j<<2;j=(j|0)==0;b=j?1:g;if(!(c[h+12>>2]&1))k=_e(b)|0;else k=$e(b)|0;if(!k){s=Sn()|0;l=q;return s|0}b=c[i>>2]|0;if((b|0)>0){h=h+16|0;i=k;while(1){s=b;b=b+-1|0;r=c[(c[h>>2]|0)+(b<<2)>>2]|0;a[i>>0]=r>>>24;a[i+1>>0]=r>>>16;a[i+2>>0]=r>>>8;a[i+3>>0]=r;if((s|0)<=1)break;else i=i+4|0}}if(!j){b=k;while(1){if(a[b>>0]|0)break;b=b+1|0;g=g+-1|0;if(!g){g=0;break}}if((b|0)!=(k|0))dr(k|0,b|0,g|0)|0}else g=0;cr(e|0,k|0,g|0)|0;cf(k)}c[p>>2]=g;s=0;l=q;return s|0}case 2:{g=(i+7|0)>>>3;if(o|0){s=45;l=q;return s|0}b=(e|0)!=0;if(b&(g+2|0)>>>0>f>>>0){s=66;l=q;return s|0}if(b){a[e>>0]=i>>>8;a[e+1>>0]=i;i=h+4|0;j=c[i>>2]|0;g=j<<2;j=(j|0)==0;b=j?1:g;if(!(c[h+12>>2]&1))k=_e(b)|0;else k=$e(b)|0;if(!k){s=Sn()|0;l=q;return s|0}b=c[i>>2]|0;if((b|0)>0){h=h+16|0;i=k;while(1){s=b;b=b+-1|0;r=c[(c[h>>2]|0)+(b<<2)>>2]|0;a[i>>0]=r>>>24;a[i+1>>0]=r>>>16;a[i+2>>0]=r>>>8;a[i+3>>0]=r;if((s|0)<=1)break;else i=i+4|0}}if(!j){b=k;while(1){if(a[b>>0]|0)break;b=b+1|0;g=g+-1|0;if(!g){g=0;break}}if((b|0)!=(k|0))dr(k|0,b|0,g|0)|0}else g=0;cr(e+2|0,k|0,g|0)|0;cf(k)}c[p>>2]=g+2;s=0;l=q;return s|0}case 3:{i=h+4|0;j=c[i>>2]|0;b=j<<2;j=(j|0)==0;g=j?1:b;if(!(c[h+12>>2]&1))k=_e(g)|0;else k=$e(g)|0;if(!k){s=Sn()|0;l=q;return s|0}g=c[i>>2]|0;if((g|0)>0){h=h+16|0;i=k;while(1){s=g;g=g+-1|0;r=c[(c[h>>2]|0)+(g<<2)>>2]|0;a[i>>0]=r>>>24;a[i+1>>0]=r>>>16;a[i+2>>0]=r>>>8;a[i+3>>0]=r;if((s|0)<=1)break;else i=i+4|0}}if(!j){g=k;while(1){if(a[g>>0]|0)break;g=g+1|0;b=b+-1|0;if(!b){b=0;break}}if((g|0)==(k|0))g=b;else{dr(k|0,g|0,b|0)|0;g=b}}else g=0;if(!o)if(!g){h=0;b=0}else{b=(d[k>>0]|0)>>>7&255;h=b;b=b+g|0}else{Uk(k,g);b=a[k>>0]|0;h=b<<24>>24<0?0:2;b=((b&255)>>>7&255^1)+g|0}i=b+4|0;if(e|0){if(i>>>0>f>>>0){cf(k);s=66;l=q;return s|0}a[e>>0]=b>>>24;a[e+1>>0]=b>>>16;a[e+2>>0]=b>>>8;g=e+4|0;a[e+3>>0]=b;switch(h&3){case 1:{a[g>>0]=0;g=e+5|0;break}case 0:break;default:{a[g>>0]=-1;g=e+5|0}}cr(g|0,k|0,b-((h|0)!=0&1)|0)|0}cf(k);c[p>>2]=i;s=0;l=q;return s|0}case 4:{i=h+4|0;j=c[i>>2]|0;b=j<<2;j=(j|0)==0;g=j?1:b;if(!(c[h+12>>2]&1))k=_e(g)|0;else k=$e(g)|0;if(!k){s=Sn()|0;l=q;return s|0}g=c[i>>2]|0;if((g|0)>0){h=h+16|0;i=k;while(1){s=g;g=g+-1|0;r=c[(c[h>>2]|0)+(g<<2)>>2]|0;a[i>>0]=r>>>24;a[i+1>>0]=r>>>16;a[i+2>>0]=r>>>8;a[i+3>>0]=r;if((s|0)<=1)break;else i=i+4|0}}if(!j){g=k;while(1){if(a[g>>0]|0)break;g=g+1|0;b=b+-1|0;if(!b){b=0;break}}if((g|0)!=(k|0))dr(k|0,g|0,b|0)|0;if(b)if((a[k>>0]|0)<0){g=0;n=106}else{i=0;j=b;b=0}else{b=0;g=1;n=106}}else{b=0;g=1;n=106}if((n|0)==106){i=2;j=b;b=g}h=j<<1;g=(i+h|o)+1|0;if(e){if(g>>>0>f>>>0){cf(k);s=66;l=q;return s|0}if(!o)g=e;else{a[e>>0]=45;g=e+1|0}if(i){a[g>>0]=48;a[g+1>>0]=48;g=g+2|0}if(!b){b=0;i=g;while(1){f=a[k+b>>0]|0;s=f&255;r=s>>>4;a[i>>0]=(f&255)<160?r|48:r+55|0;s=s&15;a[i+1>>0]=s>>>0<10?s|48:s+55|0;b=b+1|0;if((b|0)==(j|0))break;else i=i+2|0}g=g+h|0}a[g>>0]=0;g=g+1-e|0}c[p>>2]=g;cf(k);s=0;l=q;return s|0}default:{s=45;l=q;return s|0}}return 0}function Uk(b,c){b=b|0;c=c|0;var e=0,f=0,g=0,h=0;while(1){e=c+-1|0;if((e|0)<=-1){h=21;break}g=b+e|0;f=a[g>>0]|0;if(!(f<<24>>24))c=e;else break}if((h|0)==21)return;e=f&255;do if(!(e&1)){if(e&2|0){a[g>>0]=e&252^254;break}if(e&4|0){a[g>>0]=e&248^252;break}if(e&8|0){a[g>>0]=e&240^248;break}if(e&16|0){a[g>>0]=e&224^240;break}if(e&32|0){a[g>>0]=e&192^224;break}if(!(e&64)){a[g>>0]=-128;break}else{a[g>>0]=e&128^192;break}}else a[g>>0]=(e|1)^254;while(0);c=c+-2|0;if((c|0)<=-1)return;while(1){h=b+c|0;a[h>>0]=(d[h>>0]|0)^255;if((c|0)>0)c=c+-1|0;else break}return}function Vk(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=(a|0)!=0;g=(b|0)!=0;if(!(i^g)){i=45;return i|0}if(i)c[a>>2]=0;f=lk(d)|0;if(c[d+8>>2]|0)vk(d,0)|0;h=(f+7|0)>>>3;if(h>>>0>e>>>0){i=67;return i|0}e=h>>>0>>0?e-h|0:0;f=e+h|0;if(!g){if(!(c[d+12>>2]&1))f=_e(f)|0;else f=$e(f)|0;if(!f){i=Sn()|0;return i|0}else b=f}if(e|0)Yq(b|0,0,e|0)|0;f=Tk(5,b+e|0,h,0,d)|0;if(f|0){cf(b);i=f;return i|0}if(!i){i=0;return i|0}c[a>>2]=b;i=0;return i|0}function Wk(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;g=b+(e<<2)|0;f=d+(e<<2)|0;a=a+(e<<2)|0;b=0-e|0;d=0;do{i=c[g+(b<<2)>>2]|0;h=(c[f+(b<<2)>>2]|0)+d|0;e=h+i|0;d=(e>>>0>>0&1)+(h>>>0>>0&1)|0;c[a+(b<<2)>>2]=e;b=b+1|0}while((b|0)!=0);return d|0}function Xk(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;if(!b){a=0;return a|0}k=e>>>0<65536?(e>>>0<256?0:8):e>>>0<16777216?16:24;k=(d[45555+(e>>>k)>>0]|0)+k|0;n=32-k|0;if(!n){g=b+-1|0;f=c[a+(g<<2)>>2]|0;n=f>>>0>>0;f=n?f:0;g=n?b+-2|0:g;if((g|0)<=-1){a=f;return a|0}j=e>>>16;k=e&65535;while(1){i=c[a+(g<<2)>>2]|0;h=S((f>>>0)/(j>>>0)|0,k)|0;f=((f>>>0)%(j>>>0)|0)<<16|i>>>16;b=f+e|0;if(f>>>0>>0)f=(b>>>0>=e>>>0&b>>>0>>0?e:0)+b|0;f=f-h|0;h=S((f>>>0)/(j>>>0)|0,k)|0;f=((f>>>0)%(j>>>0)|0)<<16|i&65535;b=f+e|0;if(f>>>0>>0)f=(b>>>0>=e>>>0&b>>>0>>0?e:0)+b|0;f=f-h|0;if((g|0)>0)g=g+-1|0;else break}return f|0}m=e<>2]|0;f=g>>>k;b=b+-2|0;l=m>>>16;e=m&65535;if((b|0)>-1)while(1){j=c[a+(b<<2)>>2]|0;h=S((f>>>0)/(l>>>0)|0,e)|0;i=j>>>k|g<>>16|((f>>>0)%(l>>>0)|0)<<16;g=f+m|0;if(f>>>0>>0)f=(g>>>0>=m>>>0&g>>>0>>0?m:0)+g|0;f=f-h|0;h=S((f>>>0)/(l>>>0)|0,e)|0;f=((f>>>0)%(l>>>0)|0)<<16|i&65535;g=f+m|0;if(f>>>0>>0)f=(g>>>0>=m>>>0&g>>>0>>0?m:0)+g|0;f=f-h|0;if((b|0)>0){b=b+-1|0;g=j}else{g=j;break}}b=S((f>>>0)/(l>>>0)|0,e)|0;h=g<>>0)%(l>>>0)|0)<<16|h>>>16;g=f+m|0;if(f>>>0>>0)f=(g>>>0>=m>>>0&g>>>0>>0?m:0)+g|0;f=f-b|0;b=S((f>>>0)/(l>>>0)|0,e)|0;f=((f>>>0)%(l>>>0)|0)<<16|h&65535;g=f+m|0;if(f>>>0>>0)f=(g>>>0>=m>>>0&g>>>0>>0?m:0)+g|0;a=(f-b|0)>>>n;return a|0}function Yk(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;switch(g|0){case 0:{Ve();break}case 1:{p=c[f>>2]|0;h=c[d+(e+-1<<2)>>2]|0;q=h>>>0

>>0;h=h-(q?0:p)|0;q=q&1^1;o=a+(b<<2)|0;i=e+-2|0;if((i|0)>-1){e=p>>>16;n=p&65535;while(1){j=(h>>>0)/(e>>>0)|0;k=S(j,n)|0;m=c[d+(i<<2)>>2]|0;h=m>>>16|((h>>>0)%(e>>>0)|0)<<16;if(h>>>0>>0){h=h+p|0;a=h>>>0>=p>>>0&h>>>0>>0;j=(a?-2:-1)+j|0;h=(a?p:0)+h|0}h=h-k|0;k=(h>>>0)/(e>>>0)|0;l=S(k,n)|0;h=m&65535|((h>>>0)%(e>>>0)|0)<<16;if(h>>>0>>0){h=h+p|0;a=h>>>0>=p>>>0&h>>>0>>0;k=(a?-2:-1)+k|0;h=(a?p:0)+h|0}h=h-l|0;c[o+(i<<2)>>2]=k|j<<16;if((i|0)>0)i=i+-1|0;else break}}e=o+(0-b<<2)|0;if((b|0)>0){n=p>>>16;o=p&65535;m=b;do{l=m;m=m+-1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16;o=S(g,d)|0;g=S(g,r)|0;l=S(f,r)|0;f=(o>>>16)+g+(S(f,d)|0)|0;h=i-e|0;l=(f>>>0>>0?l+65536|0:l)+(f>>>16)|0;i=f<<16|o&65535;o=34}if((o|0)==34){o=0;n=c[j>>2]|0;while(1){if(l>>>0<=h>>>0?!(i>>>0>n>>>0&(l|0)==(h|0)):0)break;m=m+-1|0;e=i-u|0;l=l-(e>>>0>i>>>0&1)|0;h=h+w|0;if(h>>>0>>0){i=e;break}else i=e}c[a+(k<<2)>>2]=m;f=n-i|0;i=h-l+((f>>>0>n>>>0)<<31>>31)|0;h=f}if((k|0)>0)k=k+-1|0;else break}}c[j+4>>2]=i;c[j>>2]=h;b=t;return b|0}default:{m=d+(e-g<<2)|0;u=g+-1|0;v=c[f+(u<<2)>>2]|0;w=g+-2|0;x=c[f+(w<<2)>>2]|0;i=m+(u<<2)|0;j=c[i>>2]|0;a:do if(j>>>0>>0)h=0;else{b:do if(j>>>0<=v>>>0){h=u;do{if((h|0)<=0)break b;h=h+-1|0;k=c[m+(h<<2)>>2]|0;l=c[f+(h<<2)>>2]|0}while((k|0)==(l|0));if(k>>>0<=l>>>0){h=0;break a}}while(0);hl(m,m,f,g)|0;j=c[i>>2]|0;h=1}while(0);i=e+b-g|0;if((i|0)<=0){b=h;return b|0}q=v>>>16;d=v&65535;r=x&65535;s=x>>>16;t=(w|0)>-1;while(1){p=i;i=i+-1|0;if((p|0)>(b|0)){o=m+-4|0;n=c[o+(g<<2)>>2]|0}else{if(t){l=m+4|0;k=w;while(1){c[l+(k<<2)>>2]=c[m+(k<<2)>>2];if((k|0)>0)k=k+-1|0;else break}}c[m>>2]=0;n=j;o=m}c:do if((j|0)==(v|0))j=-1;else{k=(j>>>0)/(q>>>0)|0;l=S(k,d)|0;e=c[o+(u<<2)>>2]|0;j=e>>>16|((j>>>0)%(q>>>0)|0)<<16;if(j>>>0>>0){j=j+v|0;m=j>>>0>=v>>>0&j>>>0>>0;j=(m?v:0)+j|0;m=(m?-2:-1)+k|0}else m=k;k=j-l|0;j=(k>>>0)/(q>>>0)|0;l=S(j,d)|0;k=e&65535|((k>>>0)%(q>>>0)|0)<<16;if(k>>>0>>0){k=k+v|0;e=k>>>0>=v>>>0&k>>>0>>0;k=(e?v:0)+k|0;j=(e?-2:-1)+j|0}z=j|m<<16;A=j&65535;y=z>>>16;m=S(A,r)|0;A=S(A,s)|0;j=S(y,s)|0;y=(m>>>16)+A+(S(y,r)|0)|0;e=o+(w<<2)|0;k=k-l|0;l=(y>>>0>>0?j+65536|0:j)+(y>>>16)|0;j=z;m=y<<16|m&65535;while(1){if(l>>>0<=k>>>0){if((l|0)!=(k|0))break c;if(m>>>0<=(c[e>>2]|0)>>>0)break c}j=j+-1|0;k=k+v|0;if(k>>>0>>0)break c;l=l-(m>>>0>>0&1)|0;m=m-x|0}}while(0);if((n|0)!=(al(o,f,g,j)|0)){Wk(o,o,f,g)|0;j=j+-1|0}c[a+(i<<2)>>2]=j;if((p|0)<=1)break;else{m=o;j=c[o+(u<<2)>>2]|0}}return h|0}}return 0}function Zk(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;if(!e){a=0;return a|0}n=f>>>0<65536?(f>>>0<256?0:8):f>>>0<16777216?16:24;n=(d[45555+(f>>>n)>>0]|0)+n|0;q=32-n|0;if(!q){h=e+-1|0;g=c[b+(h<<2)>>2]|0;if(g>>>0>>0){c[a+(h<<2)>>2]=0;h=e+-2|0}else g=0;if((h|0)<=-1){a=g;return a|0}l=f>>>16;m=f&65535;while(1){j=c[b+(h<<2)>>2]|0;e=(g>>>0)/(l>>>0)|0;i=S(e,m)|0;g=((g>>>0)%(l>>>0)|0)<<16|j>>>16;if(g>>>0>>0){g=g+f|0;k=g>>>0>=f>>>0&g>>>0>>0;g=(k?f:0)+g|0;k=(k?-2:-1)+e|0}else k=e;g=g-i|0;e=(g>>>0)/(l>>>0)|0;i=S(e,m)|0;g=((g>>>0)%(l>>>0)|0)<<16|j&65535;if(g>>>0>>0){g=g+f|0;q=g>>>0>=f>>>0&g>>>0>>0;g=(q?f:0)+g|0;e=(q?-2:-1)+e|0}g=g-i|0;c[a+(h<<2)>>2]=e|k<<16;if((h|0)>0)h=h+-1|0;else break}return g|0}p=f<>2]|0;g=i>>>n;h=e+-2|0;o=p>>>16;f=p&65535;if((h|0)>-1)while(1){m=c[b+(h<<2)>>2]|0;e=(g>>>0)/(o>>>0)|0;j=S(e,f)|0;k=m>>>n|i<>>16|((g>>>0)%(o>>>0)|0)<<16;if(g>>>0>>0){g=g+p|0;l=g>>>0>=p>>>0&g>>>0>>0;g=(l?p:0)+g|0;l=(l?-2:-1)+e|0}else l=e;g=g-j|0;e=(g>>>0)/(o>>>0)|0;i=S(e,f)|0;g=((g>>>0)%(o>>>0)|0)<<16|k&65535;if(g>>>0>>0){g=g+p|0;k=g>>>0>=p>>>0&g>>>0>>0;g=(k?p:0)+g|0;e=(k?-2:-1)+e|0}g=g-i|0;c[a+(h+1<<2)>>2]=e|l<<16;if((h|0)>0){h=h+-1|0;i=m}else{h=m;break}}else h=i;e=(g>>>0)/(o>>>0)|0;i=S(e,f)|0;h=h<>>0)%(o>>>0)|0)<<16|h>>>16;if(g>>>0>>0){g=g+p|0;j=g>>>0>=p>>>0&g>>>0>>0;g=(j?p:0)+g|0;j=(j?-2:-1)+e|0}else j=e;b=g-i|0;g=(b>>>0)/(o>>>0)|0;e=S(g,f)|0;h=((b>>>0)%(o>>>0)|0)<<16|h&65535;if(h>>>0>>0){h=h+p|0;b=h>>>0>=p>>>0&h>>>0>>0;h=(b?p:0)+h|0;g=(b?-2:-1)+g|0}c[a>>2]=g|j<<16;a=(h-e|0)>>>q;return a|0}function _k(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;h=a+4|0;g=32-e|0;f=c[b+(d+-1<<2)>>2]|0;i=f>>>g;a=d+-2|0;if((d|0)>1){d=f;while(1){f=c[b+(a<<2)>>2]|0;c[h+(a<<2)>>2]=f>>>g|d<0){d=f;a=a+-1|0}else{a=-1;break}}}c[h+(a<<2)>>2]=f<>>16;a=0;b=0-d|0;do{j=c[h+(b<<2)>>2]|0;i=j&65535;j=j>>>16;d=S(i,g)|0;k=S(j,g)|0;j=S(j,e)|0;i=k+(S(i,e)|0)+(d>>>16)|0;d=(i<<16|d&65535)+a|0;a=(i>>>0>>0?j+65536|0:j)+(i>>>16)+(d>>>0>>0&1)|0;c[f+(b<<2)>>2]=d;b=b+1|0}while((b|0)!=0);return a|0}function al(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;h=a+(d<<2)|0;f=b+(d<<2)|0;g=e&65535;e=e>>>16;b=0;a=0-d|0;do{m=c[f+(a<<2)>>2]|0;l=m&65535;m=m>>>16;k=S(l,g)|0;n=S(m,g)|0;m=S(m,e)|0;l=n+(S(l,e)|0)+(k>>>16)|0;k=(l<<16|k&65535)+b|0;d=h+(a<<2)|0;j=c[d>>2]|0;i=j-k|0;b=(l>>>0>>0?m+65536|0:m)+(l>>>16)+(k>>>0>>0&1)+(i>>>0>j>>>0&1)|0;c[d>>2]=i;a=a+1|0}while((a|0)!=0);return b|0}function bl(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;f=c[d>>2]|0;a:do if(f>>>0<2){g=(e|0)>0;if((f|0)==1){if(g){f=0;while(1){c[a+(f<<2)>>2]=c[b+(f<<2)>>2];f=f+1|0;if((f|0)==(e|0)){f=0;break a}}}}else if(g){Yq(a|0,0,e<<2|0)|0;f=0;break}c[a+(e<<2)>>2]=0;return}else f=$k(a,b,e,f)|0;while(0);c[a+(e<<2)>>2]=f;if((e|0)>1){h=1;g=a}else return;do{g=g+4|0;f=c[d+(h<<2)>>2]|0;if(f>>>0<2)if((f|0)==1)f=Wk(g,g,b,e)|0;else f=0;else f=Fn(g,b,e,f)|0;c[g+(e<<2)>>2]=f;h=h+1|0}while((h|0)!=(e|0));return}function cl(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;if(e&1|0){g=e+-1|0;if((e|0)<17)bl(a,b,d,g);else cl(a,b,d,g,f);f=a+(g<<2)|0;c[a+(g<<1<<2)>>2]=Fn(f,b,g,c[d+(g<<2)>>2]|0)|0;c[a+(g+e<<2)>>2]=Fn(f,d,e,c[b+(g<<2)>>2]|0)|0;return}o=e>>1;n=(o|0)<16;g=a+(e<<2)|0;j=b+(o<<2)|0;m=d+(o<<2)|0;if(n){bl(g,j,m,o);i=o}else{cl(g,j,m,o,f);i=o}while(1){if((i|0)<=0){i=12;break}i=i+-1|0;k=c[j+(i<<2)>>2]|0;l=c[b+(i<<2)>>2]|0;if((k|0)!=(l|0)){i=11;break}}if((i|0)==11)if(k>>>0>l>>>0)i=12;else{hl(a,b,j,o)|0;j=1}if((i|0)==12){hl(a,j,b,o)|0;j=0}i=o;while(1){if((i|0)<=0){i=18;break}i=i+-1|0;k=c[m+(i<<2)>>2]|0;l=c[d+(i<<2)>>2]|0;if((k|0)!=(l|0)){i=17;break}}if((i|0)==17)if(k>>>0>l>>>0)i=18;else{l=a+(o<<2)|0;hl(l,d,m,o)|0;k=j}if((i|0)==18){l=a+(o<<2)|0;hl(l,m,d,o)|0;k=j^1}if(n){bl(f,a,l,o);if((o|0)>0)i=23;else j=0}else{cl(f,a,l,o,f+(e<<2)|0);i=23}if((i|0)==23){j=a+(o<<2)|0;i=0;do{c[j+(i<<2)>>2]=c[g+(i<<2)>>2];i=i+1|0}while((i|0)!=(o|0));j=1}i=Wk(g,g,g+(o<<2)|0,o)|0;if(!k)i=(Wk(l,l,f,e)|0)+i|0;else i=i-(hl(l,l,f,e)|0)|0;if(n)bl(f,b,d,o);else cl(f,b,d,o,f+(e<<2)|0);i=(Wk(l,l,f,e)|0)+i|0;a:do if(i|0?(h=a+(o<<2)+(e<<2)|0,d=c[h>>2]|0,b=d+i|0,c[h>>2]=b,b>>>0>>0):0){i=o;do{h=h+4|0;i=i+-1|0;if(!i)break a;d=(c[h>>2]|0)+1|0;c[h>>2]=d}while(!(d|0))}while(0);if(j){h=0;do{c[a+(h<<2)>>2]=c[f+(h<<2)>>2];h=h+1|0}while((h|0)!=(o|0))}if(!(Wk(l,l,f+(o<<2)|0,o)|0))return;f=c[g>>2]|0;c[g>>2]=f+1;if((f|0)!=-1)return;while(1){g=g+4|0;e=e+-1|0;if(!e){i=41;break}f=(c[g>>2]|0)+1|0;c[g>>2]=f;if(f|0){i=41;break}}if((i|0)==41)return}function dl(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;x=g+4|0;h=c[x>>2]|0;if(h){if((c[g+12>>2]|0)<(f|0)){ol(h,c[g+8>>2]|0);w=4}}else w=4;if((w|0)==4){h=f<<1;c[g+8>>2]=h;if(!(af(b)|0))i=(af(e)|0)!=0;else i=1;h=ml(h,i&1)|0;c[x>>2]=h;c[g+12>>2]=f}k=(f|0)<16;if(k)bl(a,b,e,f);else cl(a,b,e,f,h);j=a+(f<<2)|0;i=b+(f<<2)|0;a=d-f|0;if((a|0)>=(f|0)){v=g+16|0;h=c[v>>2]|0;if(h){if((c[g+24>>2]|0)<(f|0)){ol(h,c[g+20>>2]|0);w=14}}else w=14;if((w|0)==14){h=f<<1;c[g+20>>2]=h;if(!(af(i)|0))b=(af(e)|0)!=0;else b=1;h=ml(h,b&1)|0;c[v>>2]=h;c[g+24>>2]=f}if(k){m=h;do{bl(m,i,e,f);r=Wk(j,j,c[v>>2]|0,f)|0;j=j+(f<<2)|0;m=c[v>>2]|0;u=m+(f<<2)|0;h=u+4|0;u=c[u>>2]|0;r=u+r|0;b=j+4|0;c[j>>2]=r;a:do if(r>>>0>>0){d=f;while(1){d=d+-1|0;if(!d)break a;k=h+4|0;u=(c[h>>2]|0)+1|0;l=b+4|0;c[b>>2]=u;if(!u){h=k;b=l}else{o=d;q=k;s=l;w=21;break}}}else{o=f;q=h;s=b;w=21}while(0);if(((w|0)==21?(w=0,(s|0)!=(q|0)):0)?(t=o+-1|0,(o|0)>1):0){h=0;do{c[s+(h<<2)>>2]=c[q+(h<<2)>>2];h=h+1|0}while((h|0)!=(t|0))}i=i+(f<<2)|0;a=a-f|0}while((a|0)>=(f|0))}else{m=h;do{cl(m,i,e,f,c[x>>2]|0);s=Wk(j,j,c[v>>2]|0,f)|0;j=j+(f<<2)|0;m=c[v>>2]|0;t=m+(f<<2)|0;h=t+4|0;t=c[t>>2]|0;s=t+s|0;b=j+4|0;c[j>>2]=s;b:do if(s>>>0>>0){d=f;while(1){d=d+-1|0;if(!d)break b;k=h+4|0;t=(c[h>>2]|0)+1|0;l=b+4|0;c[b>>2]=t;if(!t){h=k;b=l}else{n=d;p=k;r=l;w=28;break}}}else{n=f;p=h;r=b;w=28}while(0);if(((w|0)==28?(w=0,(r|0)!=(p|0)):0)?(u=n+-1|0,(n|0)>1):0){h=0;do{c[r+(h<<2)>>2]=c[p+(h<<2)>>2];h=h+1|0}while((h|0)!=(u|0))}i=i+(f<<2)|0;a=a-f|0}while((a|0)>=(f|0))}}if(!a)return;if((a|0)<16)el(c[x>>2]|0,e,f,i,a)|0;else{h=c[g>>2]|0;if(!h){h=kf(1,28)|0;c[g>>2]=h}dl(c[x>>2]|0,e,f,i,a,h)}i=Wk(j,j,c[x>>2]|0,f)|0;e=j+(f<<2)|0;x=(c[x>>2]|0)+(f<<2)|0;h=x+4|0;x=c[x>>2]|0;f=x+i|0;i=e+4|0;c[e>>2]=f;c:do if(f>>>0>>0){while(1){a=a+-1|0;if(!a)break;b=h+4|0;x=(c[h>>2]|0)+1|0;j=i+4|0;c[i>>2]=x;if(!x){h=b;i=j}else{i=j;break c}}return}else b=h;while(0);if((i|0)==(b|0))return;j=a+-1|0;if((a|0)>1)h=0;else return;do{c[i+(h<<2)>>2]=c[b+(h<<2)>>2];h=h+1|0}while((h|0)!=(j|0));return}function el(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;j=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=j;i=a+(d<<2)|0;if((f|0)>=16){c[g>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;c[g+12>>2]=0;c[g+16>>2]=0;c[g+20>>2]=0;c[g+24>>2]=0;dl(a,b,d,e,f,g);fl(g);f=c[i+(f<<2)+-4>>2]|0;l=j;return f|0}if(!f){f=0;l=j;return f|0}h=c[e>>2]|0;do if(h>>>0<2){g=(d|0)>0;if((h|0)==1){if(g)g=0;else{g=0;break}do{c[a+(g<<2)>>2]=c[b+(g<<2)>>2];g=g+1|0}while((g|0)!=(d|0));g=0}else{if(!g){g=0;break}Yq(a|0,0,d<<2|0)|0;g=0;break}}else g=$k(a,b,d,h)|0;while(0);c[i>>2]=g;if((f|0)>1)h=1;else{f=g;l=j;return f|0}do{a=a+4|0;g=c[e+(h<<2)>>2]|0;if(g>>>0<2)if((g|0)==1)g=Wk(a,a,b,d)|0;else g=0;else g=Fn(a,b,d,g)|0;c[a+(d<<2)>>2]=g;h=h+1|0}while((h|0)!=(f|0));l=j;return g|0}function fl(a){a=a|0;var b=0,d=0;b=c[a+16>>2]|0;if(b|0)ol(b,c[a+20>>2]|0);b=c[a+4>>2]|0;if(b|0)ol(b,c[a+8>>2]|0);b=c[a>>2]|0;if(!b)return;do{d=b;b=c[b>>2]|0;a=c[d+16>>2]|0;if(a|0)ol(a,c[d+20>>2]|0);a=c[d+4>>2]|0;if(a|0)ol(a,c[d+8>>2]|0);cf(d)}while((b|0)!=0);return}function gl(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;i=a+-4|0;h=32-e|0;a=c[b>>2]|0;j=a<1){f=a;g=1;while(1){a=c[b+(g<<2)>>2]|0;c[i+(g<<2)>>2]=a<>>e;g=g+1|0;if((g|0)==(d|0))break;else f=a}}else d=1;c[i+(d<<2)>>2]=a>>>e;return j|0}function hl(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;g=b+(e<<2)|0;f=d+(e<<2)|0;a=a+(e<<2)|0;b=0-e|0;d=0;do{i=c[g+(b<<2)>>2]|0;h=(c[f+(b<<2)>>2]|0)+d|0;e=i-h|0;d=(e>>>0>i>>>0&1)+(h>>>0>>0&1)|0;c[a+(b<<2)>>2]=e;b=b+1|0}while((b|0)!=0);return d|0}function il(){return 45905}function jl(){var a=0,b=0;a=gf(20)|0;b=gf(4)|0;c[a+16>>2]=b;c[a>>2]=1;c[b>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[17636]=a;c[a+12>>2]=48;a=gf(20)|0;b=gf(4)|0;c[a+16>>2]=b;c[a>>2]=1;c[b>>2]=1;c[a+4>>2]=1;c[a+8>>2]=0;c[17637]=a;c[a+12>>2]=48;a=gf(20)|0;b=gf(4)|0;c[a+16>>2]=b;c[a>>2]=1;c[b>>2]=2;c[a+4>>2]=1;c[a+8>>2]=0;c[17638]=a;c[a+12>>2]=48;a=gf(20)|0;b=gf(4)|0;c[a+16>>2]=b;c[a>>2]=1;c[b>>2]=3;c[a+4>>2]=1;c[a+8>>2]=0;c[17639]=a;c[a+12>>2]=48;a=gf(20)|0;b=gf(4)|0;c[a+16>>2]=b;c[a>>2]=1;c[b>>2]=4;c[a+4>>2]=1;c[a+8>>2]=0;c[17640]=a;c[a+12>>2]=48;a=gf(20)|0;b=gf(4)|0;c[a+16>>2]=b;c[a>>2]=1;c[b>>2]=8;c[a+4>>2]=1;c[a+8>>2]=0;c[17641]=a;c[a+12>>2]=48;return 0}function kl(a){a=a|0;var b=0,d=0;b=gf(20)|0;d=gf(4)|0;c[b+16>>2]=d;c[b>>2]=1;c[b+12>>2]=0;c[d>>2]=a;c[b+4>>2]=(a|0)!=0&1;c[b+8>>2]=0;return b|0}function ll(a){a=a|0;var b=0,d=0;b=gf(20)|0;if(!a)d=0;else d=gf(a<<2)|0;c[b+16>>2]=d;c[b>>2]=a;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;return b|0}function ml(a,b){a=a|0;b=b|0;var d=0;d=(a|0)!=0;a=d?a<<2:4;if(!b)a=gf(a)|0;else a=jf(a)|0;if(d)return a|0;c[a>>2]=0;return a|0}function nl(a){a=a|0;var b=0,d=0;b=gf(20)|0;if(!a)d=0;else d=jf(a<<2)|0;c[b+16>>2]=d;c[b>>2]=a;c[b+12>>2]=1;c[b+4>>2]=0;c[b+8>>2]=0;return b|0}function ol(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;if(!b)return;e=d<<2;if(e|0){if(!(b&7))d=b;else{d=b;do{a[d>>0]=0;d=d+1|0;e=e+-1|0}while((e|0)!=0&(d&7|0)!=0)}if(e>>>0>=8){h=e+-8|0;i=h&-8;g=i+8|0;f=d;while(1){j=f;c[j>>2]=0;c[j+4>>2]=0;e=e+-8|0;if(e>>>0<=7)break;else f=f+8|0}d=d+g|0;e=h-i|0}if(e|0)while(1){a[d>>0]=0;e=e+-1|0;if(!e)break;else d=d+1|0}}cf(b);return}function pl(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;k=b+16|0;l=c[k>>2]|0;if(!l){c[k>>2]=d;c[b>>2]=e;return}g=c[b>>2]<<2;if(g|0){if(!(l&7))f=l;else{f=l;do{a[f>>0]=0;f=f+1|0;g=g+-1|0}while((g|0)!=0&(f&7|0)!=0)}if(g>>>0>=8){i=g+-8|0;j=i&-8;h=f;while(1){m=h;c[m>>2]=0;c[m+4>>2]=0;g=g+-8|0;if(g>>>0<=7)break;else h=h+8|0}f=f+(j+8)|0;g=i-j|0}if(g|0)while(1){a[f>>0]=0;g=g+-1|0;if(!g)break;else f=f+1|0}}cf(l);c[k>>2]=d;c[b>>2]=e;return}function ql(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=c[a>>2]|0;if(e>>>0>=b>>>0){d=c[a+4>>2]|0;if(d>>>0>=e>>>0)return;e=c[a+16>>2]|0;do{c[e+(d<<2)>>2]=0;d=d+1|0}while(d>>>0<(c[a>>2]|0)>>>0);return}e=a+16|0;d=c[e>>2]|0;do if(!d)if(!(c[a+12>>2]&1)){c[e>>2]=kf(b,4)|0;break}else{c[e>>2]=lf(b,4)|0;break}else{g=b<<2;f=hf(d,g)|0;c[e>>2]=f;d=c[a>>2]|0;if(d>>>0>>0)Yq(f+(d<<2)|0,0,g-(d<<2)|0)|0}while(0);c[a>>2]=b;return}function rl(a){a=a|0;var b=0,d=0,e=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=e;b=a+12|0;if(a|0?c[b>>2]&16|0:0){Je(46049,d);l=e;return}c[a+4>>2]=0;c[b>>2]=0;l=e;return}function sl(){var a=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);Je(46049,a);l=a;return}function tl(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;n=l;l=l+16|0;if((l|0)>=(m|0))$(16);k=n;if(!b){l=n;return}i=b+12|0;d=c[i>>2]|0;if(d&32|0){l=n;return}j=c[b+16>>2]|0;if(!(d&4)){if(j|0){e=c[b>>2]<<2;if(e|0){if(!(j&7))d=j;else{d=j;do{a[d>>0]=0;d=d+1|0;e=e+-1|0}while((e|0)!=0&(d&7|0)!=0)}if(e>>>0>=8){g=e+-8|0;h=g&-8;f=d;while(1){o=f;c[o>>2]=0;c[o+4>>2]=0;e=e+-8|0;if(e>>>0<=7)break;else f=f+8|0}d=d+(h+8)|0;e=g-h|0}if(e|0)while(1){a[d>>0]=0;e=e+-1|0;if(!e)break;else d=d+1|0}}cf(j)}}else cf(j);if(c[i>>2]&-3864|0)Ne(46093,k);cf(b);l=n;return}function ul(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;p=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=p;if(!b){b=gf(20)|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;if(!b){o=0;f=c[3]|0}else h=4}else h=4;if((h|0)==4){f=c[b+12>>2]|0;if(!(f&16))o=b;else{Je(46049,g);d=b;l=p;return d|0}}n=o+12|0;j=o+16|0;k=c[j>>2]|0;if(!(f&4)){if(k|0){f=c[o>>2]<<2;if(f|0){if(!(k&7))b=k;else{b=k;do{a[b>>0]=0;b=b+1|0;f=f+-1|0}while((f|0)!=0&(b&7|0)!=0)}if(f>>>0>=8){h=f+-8|0;i=h&-8;g=b;while(1){q=g;c[q>>2]=0;c[q+4>>2]=0;f=f+-8|0;if(f>>>0<=7)break;else g=g+8|0}b=b+(i+8)|0;f=h-i|0}if(f|0)while(1){a[b>>0]=0;f=f+-1|0;if(!f)break;else b=b+1|0}}cf(k)}}else cf(k);c[j>>2]=d;c[o>>2]=0;c[o+4>>2]=0;c[o+8>>2]=e;b=c[n>>2]&3840;c[n>>2]=b|4;if(!(af(d)|0)){q=o;l=p;return q|0}c[n>>2]=b|5;q=o;l=p;return q|0}function vl(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;d=(c+7|0)>>>3;if(!(af(b)|0))e=_e(d)|0;else e=$e(d)|0;if(!e){e=0;return e|0}cr(e|0,b|0,d|0)|0;e=ul(a,e,c)|0;return e|0}function wl(a,b){a=a|0;b=b|0;var d=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);if(!(c[a+12>>2]&4))Ne(46125,d);if(b|0)c[b>>2]=c[a+8>>2];l=d;return c[a+16>>2]|0}function xl(a,b){a=a|0;b=b|0;var d=0,e=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);if(!(c[a+12>>2]&4))Ne(46125,e);if(b){d=c[a+8>>2]|0;c[b>>2]=d;b=c[a+16>>2]|0;if(!b){d=0;l=e;return d|0}}else{d=0;b=c[a+16>>2]|0}a=(d+7|0)>>>3;if(!(af(b)|0))d=_e(a)|0;else d=$e(a)|0;if(!d){d=0;l=e;return d|0}cr(d|0,b|0,a|0)|0;l=e;return d|0}function yl(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;if(!a){a=0;return a|0}k=a+12|0;e=c[k>>2]|0;if(e&4|0){f=a+16|0;k=(af(c[f>>2]|0)|0)==0;d=a+8|0;b=((c[d>>2]|0)+7|0)/8|0;if(k)e=gf(b)|0;else e=jf(b)|0;b=c[f>>2]|0;if(!b)b=c[d>>2]|0;else{a=c[d>>2]|0;cr(e|0,b|0,(a+7|0)/8|0|0)|0;b=a}a=ul(0,e,b)|0;k=a+12|0;c[k>>2]=c[k>>2]&-49;return a|0}j=a+4|0;g=c[j>>2]|0;b=gf(20)|0;f=(g|0)==0;d=g<<2;if(!(e&1)){if(f)d=0;else d=gf(d)|0;c[b+16>>2]=d;c[b>>2]=g;e=b+4|0;c[e>>2]=0;g=b+8|0;c[g>>2]=0;h=b+12|0;c[h>>2]=0;i=d}else{if(f)d=0;else d=jf(d)|0;c[b+16>>2]=d;c[b>>2]=g;h=b+12|0;c[h>>2]=1;e=b+4|0;c[e>>2]=0;g=b+8|0;c[g>>2]=0;i=d}f=c[j>>2]|0;c[e>>2]=f;c[g>>2]=c[a+8>>2];c[h>>2]=c[k>>2]&-49;if((f|0)<=0){a=b;return a|0}e=c[a+16>>2]|0;d=0;do{c[i+(d<<2)>>2]=c[e+(d<<2)>>2];d=d+1|0}while((d|0)<(f|0));return b|0}function zl(a,b){a=a|0;b=b|0;var d=0,e=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=e;if((a|0)==(b|0)){if(a|0?c[a+12>>2]&16|0:0){Je(46049,d);l=e;return}}else Al(a,b)|0;c[a+8>>2]=(c[b+8>>2]|0)==0&1;l=e;return}function Al(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=k;i=c[b+4>>2]|0;j=c[b+8>>2]|0;if(!a){a=gf(20)|0;if(!i)d=0;else d=gf(i<<2)|0;c[a+16>>2]=d;c[a>>2]=i;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0}h=a+12|0;f=c[h>>2]|0;if(f&16|0){Je(46049,e);l=k;return a|0}e=c[a>>2]|0;a:do if((e|0)<(i|0)){if(e>>>0>=i>>>0){d=c[a+4>>2]|0;if(d>>>0>=e>>>0)break;e=c[a+16>>2]|0;while(1){c[e+(d<<2)>>2]=0;d=d+1|0;if(d>>>0>=(c[a>>2]|0)>>>0)break a}}g=a+16|0;d=c[g>>2]|0;do if(!d)if(!(f&1)){c[g>>2]=kf(i,4)|0;break}else{c[g>>2]=lf(i,4)|0;break}else{f=i<<2;e=hf(d,f)|0;c[g>>2]=e;d=c[a>>2]|0;if(d>>>0>>0)Yq(e+(d<<2)|0,0,f-(d<<2)|0)|0}while(0);c[a>>2]=i}while(0);e=c[a+16>>2]|0;f=c[b+16>>2]|0;if((i|0)>0){d=0;do{c[e+(d<<2)>>2]=c[f+(d<<2)>>2];d=d+1|0}while((d|0)!=(i|0))}c[a+4>>2]=i;c[h>>2]=c[b+12>>2]&-49;c[a+8>>2]=j;l=k;return a|0}function Bl(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;if(!a){g=0;return g|0}g=a+12|0;d=c[g>>2]|0;if(d&4|0){d=a+8|0;e=((c[d>>2]|0)+7|0)/8|0;a=a+16|0;if(!(af(c[a>>2]|0)|0))b=_e(e)|0;else b=$e(e)|0;cr(b|0,c[a>>2]|0,e|0)|0;g=ul(0,b,c[d>>2]|0)|0;return g|0}e=c[a+4>>2]|0;f=gf(20)|0;b=(e|0)==0;a=e<<2;if(!(d&1)){if(b)a=0;else a=gf(a)|0;c[f+16>>2]=a;c[f>>2]=e;a=f+4|0;c[a>>2]=0;b=f+8|0;c[b>>2]=0;d=f+12|0;c[d>>2]=0}else{if(b)a=0;else a=jf(a)|0;c[f+16>>2]=a;c[f>>2]=e;d=f+12|0;c[d>>2]=1;a=f+4|0;c[a>>2]=0;b=f+8|0;c[b>>2]=0}c[a>>2]=0;c[b>>2]=0;c[d>>2]=c[g>>2];g=f;return g|0}function Cl(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0;q=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=q;if(b|0){p=b+12|0;if(c[p>>2]&16|0){Je(46049,e);l=q;return}k=d+16|0;n=c[k>>2]|0;o=c[d>>2]|0;i=b+16|0;j=c[i>>2]|0;if(j|0){f=c[b>>2]<<2;if(f|0){if(!(j&7))e=j;else{e=j;do{a[e>>0]=0;e=e+1|0;f=f+-1|0}while((f|0)!=0&(e&7|0)!=0)}if(f>>>0>=8){h=f+-8|0;g=e;while(1){r=g;c[r>>2]=0;c[r+4>>2]=0;f=f+-8|0;if(f>>>0<=7)break;else g=g+8|0}f=h&-8;e=e+(f+8)|0;f=h-f|0}if(f|0)while(1){a[e>>0]=0;f=f+-1|0;if(!f)break;else e=e+1|0}}cf(j)}c[i>>2]=n;c[b>>2]=o;r=d+4|0;c[b+4>>2]=c[r>>2];c[b+8>>2]=c[d+8>>2];c[p>>2]=c[d+12>>2];c[d>>2]=0;c[r>>2]=0;c[k>>2]=0}tl(d);l=q;return}function Dl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=c[b>>2]|0;e=(d|0)!=0;if((c[a>>2]|0)!=(g|0))Ne(46155,i);if((g|0)>0?(h=c[a+16>>2]|0,f=c[b+16>>2]|0,e):0){d=0;do{c[h+(d<<2)>>2]=c[f+(d<<2)>>2];d=d+1|0}while((d|0)!=(g|0))}h=a+4|0;g=c[h>>2]|0;c[h>>2]=(e?c[b+4>>2]^g:0)^g;h=a+8|0;g=c[h>>2]|0;c[h>>2]=(e?c[b+8>>2]^g:0)^g;l=i;return a|0}function El(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=f;if(!a){a=gf(20)|0;c[a+16>>2]=gf(4)|0;c[a>>2]=1;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;if(!a)a=0;else e=3}else e=3;if((e|0)==3)if(c[a+12>>2]&16){Je(46049,d);b=a;l=f;return b|0}e=c[a>>2]|0;a:do if((e|0)<1){if(e|0){d=c[a+4>>2]|0;if(d>>>0>=e>>>0)break;e=c[a+16>>2]|0;while(1){c[e+(d<<2)>>2]=0;d=d+1|0;if(d>>>0>=(c[a>>2]|0)>>>0)break a}}e=a+16|0;d=c[e>>2]|0;do if(!d)if(!(c[a+12>>2]&1)){c[e>>2]=kf(1,4)|0;break}else{c[e>>2]=lf(1,4)|0;break}else{d=hf(d,4)|0;c[e>>2]=d;if(!(c[a>>2]|0))c[d>>2]=0}while(0);c[a>>2]=1}while(0);c[c[a+16>>2]>>2]=b;c[a+4>>2]=(b|0)!=0&1;c[a+8>>2]=0;c[a+12>>2]=0;b=a;l=f;return b|0}function Fl(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+32|0;if((l|0)>=(m|0))$(32);e=d;c[e>>2]=c[a>>2];c[e+4>>2]=c[a+4>>2];c[e+8>>2]=c[a+8>>2];c[e+12>>2]=c[a+12>>2];c[e+16>>2]=c[a+16>>2];c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];c[a+16>>2]=c[b+16>>2];c[b>>2]=c[e>>2];c[b+4>>2]=c[e+4>>2];c[b+8>>2]=c[e+8>>2];c[b+12>>2]=c[e+12>>2];c[b+16>>2]=c[e+16>>2];l=d;return}function Gl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;i=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=c[a>>2]|0;e=(d|0)!=0;if((g|0)!=(c[b>>2]|0))Ne(46186,i);if((g|0)>0?(h=c[a+16>>2]|0,f=c[b+16>>2]|0,e):0){d=0;do{n=h+(d<<2)|0;j=f+(d<<2)|0;o=c[j>>2]|0;k=o^c[n>>2];c[n>>2]=o;c[j>>2]=c[j>>2]^k;d=d+1|0}while((d|0)!=(g|0))}o=a+4|0;n=c[o>>2]|0;k=b+4|0;j=e?c[k>>2]^n:0;c[o>>2]=j^n;c[k>>2]=c[k>>2]^j;k=a+8|0;j=c[k>>2]|0;o=b+8|0;n=e?c[o>>2]^j:0;c[k>>2]=n^j;c[o>>2]=c[o>>2]^n;l=i;return}function Hl(a){a=a|0;var b=0,d=0;a=(a+31|0)>>>5;b=gf(20)|0;if(!a)d=0;else d=gf(a<<2)|0;c[b+16>>2]=d;c[b>>2]=a;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;return b|0}function Il(a){a=a|0;var b=0,d=0;a=(a+31|0)>>>5;b=gf(20)|0;if(!a)d=0;else d=jf(a<<2)|0;c[b+16>>2]=d;c[b>>2]=a;c[b+12>>2]=1;c[b+4>>2]=0;c[b+8>>2]=0;return b|0}function Jl(a){a=a|0;tl(a);return}function Kl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=g;f=(b+7|0)>>>3;b=(a|0)!=0;if(b?c[a+12>>2]&16|0:0){Je(46049,e);l=g;return}do if(!d){if(b?(c[a+12>>2]&1|0)!=0:0)b=jf(f)|0;else b=gf(f)|0;Hj(b,f)}else{if(b?c[a+12>>2]&1|0:0){b=Cj(f,d)|0;break}b=Aj(f,d)|0}while(0);Rk(a,b,f,0);cf(b);l=g;return}function Ll(a,b){a=a|0;b=b|0;var d=0,e=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);switch(b|0){case 1:{d=c[a+12>>2]&1;break}case 2:{d=(c[a+12>>2]|0)>>>2&1;break}case 4:{d=(c[a+12>>2]|0)>>>4&1;break}case 8:{d=(c[a+12>>2]|0)>>>5&1;break}case 2048:case 1024:case 512:case 256:{d=(c[a+12>>2]&b|0)!=0&1;break}default:Ne(46218,e)}l=e;return d|0}function Ml(a){a=a|0;var b=0,d=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=d;if((a|0)<0|a>>>0>6){c[b>>2]=a;Ne(46238,b)}a=c[70544+(a<<2)>>2]|0;if(!a)Ne(46269,d+8|0);else{l=d;return a|0}return 0}function Nl(){return 46300}function Ol(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0;o=l;l=l+64|0;if((l|0)>=(m|0))$(64);k=o;n=Oq(172)|0;if(!n){n=0;l=o;return n|0}c[n>>2]=1779033703;c[n+4>>2]=-1150833019;c[n+8>>2]=1013904242;c[n+12>>2]=-1521486534;c[n+16>>2]=1359893119;c[n+20>>2]=-1694144372;c[n+24>>2]=528734635;c[n+28>>2]=1541459225;c[n+32>>2]=0;c[n+36>>2]=0;i=n+40|0;a[i>>0]=0;if(!b){l=o;return n|0}g=k;h=g+64|0;do{a[g>>0]=0;g=g+1|0}while((g|0)<(h|0));j=n+105|0;g=j;h=g+64|0;do{a[g>>0]=0;g=g+1|0}while((g|0)<(h|0));do if(e>>>0<65){cr(k|0,b|0,e|0)|0;cr(j|0,b|0,e|0)|0;b=0}else{f=Oq(172)|0;if(f|0){c[f>>2]=1779033703;c[f+4>>2]=-1150833019;c[f+8>>2]=1013904242;c[f+12>>2]=-1521486534;c[f+16>>2]=1359893119;c[f+20>>2]=-1694144372;c[f+24>>2]=528734635;c[f+28>>2]=1541459225;c[f+32>>2]=0;c[f+36>>2]=0;a[f+40>>0]=0;Pl(f,b,e);Ql(f);b=f+41|0;g=k;e=b;h=g+32|0;do{a[g>>0]=a[e>>0]|0;g=g+1|0;e=e+1|0}while((g|0)<(h|0));g=j;e=b;h=g+32|0;do{a[g>>0]=a[e>>0]|0;g=g+1|0;e=e+1|0}while((g|0)<(h|0));Rl(f);b=0;break}Pq(n);n=0;l=o;return n|0}while(0);do{h=k+b|0;a[h>>0]=(d[h>>0]|0)^54;h=j+b|0;a[h>>0]=(d[h>>0]|0)^92;b=b+1|0}while((b|0)!=64);a[i>>0]=a[i>>0]|2;Pl(n,k,64);a[k>>0]=0;a[k+1>>0]=0;a[k+2>>0]=0;a[k+3>>0]=0;a[k+4>>0]=0;a[k+5>>0]=0;a[k+6>>0]=0;a[k+7>>0]=0;a[k+8>>0]=0;a[k+9>>0]=0;a[k+10>>0]=0;a[k+11>>0]=0;a[k+12>>0]=0;a[k+13>>0]=0;a[k+14>>0]=0;a[k+15>>0]=0;a[k+16>>0]=0;a[k+17>>0]=0;a[k+18>>0]=0;a[k+19>>0]=0;a[k+20>>0]=0;a[k+21>>0]=0;a[k+22>>0]=0;a[k+23>>0]=0;a[k+24>>0]=0;a[k+25>>0]=0;a[k+26>>0]=0;a[k+27>>0]=0;a[k+28>>0]=0;a[k+29>>0]=0;a[k+30>>0]=0;a[k+31>>0]=0;a[k+32>>0]=0;a[k+33>>0]=0;a[k+34>>0]=0;a[k+35>>0]=0;a[k+36>>0]=0;a[k+37>>0]=0;a[k+38>>0]=0;a[k+39>>0]=0;a[k+40>>0]=0;a[k+41>>0]=0;a[k+42>>0]=0;a[k+43>>0]=0;a[k+44>>0]=0;a[k+45>>0]=0;a[k+46>>0]=0;a[k+47>>0]=0;a[k+48>>0]=0;a[k+49>>0]=0;a[k+50>>0]=0;a[k+51>>0]=0;a[k+52>>0]=0;a[k+53>>0]=0;a[k+54>>0]=0;a[k+55>>0]=0;a[k+56>>0]=0;a[k+57>>0]=0;a[k+58>>0]=0;a[k+59>>0]=0;a[k+60>>0]=0;a[k+61>>0]=0;a[k+62>>0]=0;a[k+63>>0]=0;l=o;return n|0}function Pl(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;g=b+40|0;if(a[g>>0]&1)return;k=b+36|0;f=c[k>>2]|0;if((f|0)==64){Sl(b,b+41|0);c[k>>2]=0;f=b+32|0;c[f>>2]=(c[f>>2]|0)+1;f=0}if(!d)return;a:do if(!f)f=0;else{b:do if(e|0){if((f|0)<64)do{j=a[d>>0]|0;c[k>>2]=f+1;a[b+41+f>>0]=j;e=e+-1|0;if(!e)break b;d=d+1|0;f=c[k>>2]|0}while((f|0)<64);if(!((f|0)==64&(a[g>>0]&1)==0))break a;Sl(b,b+41|0);c[k>>2]=0;f=b+32|0;c[f>>2]=(c[f>>2]|0)+1;f=0;break a}while(0);if(a[g>>0]&1)return;if((c[k>>2]|0)!=64)return;Sl(b,b+41|0);c[k>>2]=0;k=b+32|0;c[k>>2]=(c[k>>2]|0)+1;return}while(0);if(e>>>0>63){g=b+32|0;i=e+-64|0;j=i&-64;h=j+64|0;f=d;while(1){Sl(b,f);c[k>>2]=0;c[g>>2]=(c[g>>2]|0)+1;e=e+-64|0;if(e>>>0<=63)break;else f=f+64|0}d=d+h|0;e=i-j|0;f=0}if(!((e|0)!=0&(f|0)<64))return;while(1){j=a[d>>0]|0;c[k>>2]=f+1;a[b+41+f>>0]=j;e=e+-1|0;if(!e){f=22;break}f=c[k>>2]|0;if((f|0)>=64){f=22;break}else d=d+1|0}if((f|0)==22)return}function Ql(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;m=b+40|0;if(a[m>>0]&1)return;k=b+36|0;d=c[k>>2]|0;if((d|0)==64){Sl(b,b+41|0);c[k>>2]=0;f=b+32|0;e=(c[f>>2]|0)+1|0;c[f>>2]=e;d=0}else{e=b+32|0;f=e;e=c[e>>2]|0}g=e<<6;l=g+d|0;g=(l>>>0>>0&1)+(e>>>26)|0;h=l<<3;i=g<<3|l>>>29;c[k>>2]=d+1;j=b+41|0;a[b+41+d>>0]=-128;e=c[k>>2]|0;if((d|0)<56){if((e|0)<56){d=e;do{c[k>>2]=d+1;a[b+41+d>>0]=0;d=c[k>>2]|0}while((d|0)<56)}}else{if((e|0)<64){d=e;do{c[k>>2]=d+1;a[b+41+d>>0]=0;d=c[k>>2]|0}while((d|0)<64)}else d=e;if((d|0)==64&(a[m>>0]&1)==0){Sl(b,b+41|0);c[k>>2]=0;c[f>>2]=(c[f>>2]|0)+1}d=j;e=d+56|0;do{a[d>>0]=0;d=d+1|0}while((d|0)<(e|0))}a[b+97>>0]=0;a[b+98>>0]=0;a[b+99>>0]=g>>>5;a[b+100>>0]=i;a[b+101>>0]=l>>>21;a[b+102>>0]=l>>>13;a[b+103>>0]=l>>>5;a[b+104>>0]=h;Sl(b,j);l=c[b>>2]|0;a[j>>0]=l>>>24;a[b+42>>0]=l>>>16;a[b+43>>0]=l>>>8;a[b+44>>0]=l;l=c[b+4>>2]|0;a[b+45>>0]=l>>>24;a[b+46>>0]=l>>>16;a[b+47>>0]=l>>>8;a[b+48>>0]=l;l=c[b+8>>2]|0;a[b+49>>0]=l>>>24;a[b+50>>0]=l>>>16;a[b+51>>0]=l>>>8;a[b+52>>0]=l;l=c[b+12>>2]|0;a[b+53>>0]=l>>>24;a[b+54>>0]=l>>>16;a[b+55>>0]=l>>>8;a[b+56>>0]=l;l=c[b+16>>2]|0;a[b+57>>0]=l>>>24;a[b+58>>0]=l>>>16;a[b+59>>0]=l>>>8;a[b+60>>0]=l;l=c[b+20>>2]|0;a[b+61>>0]=l>>>24;a[b+62>>0]=l>>>16;a[b+63>>0]=l>>>8;a[b+64>>0]=l;l=c[b+24>>2]|0;a[b+65>>0]=l>>>24;a[b+66>>0]=l>>>16;a[b+67>>0]=l>>>8;a[b+68>>0]=l;l=c[b+28>>2]|0;a[b+69>>0]=l>>>24;a[b+70>>0]=l>>>16;a[b+71>>0]=l>>>8;a[b+72>>0]=l;a[m>>0]=a[m>>0]|1;return}function Rl(b){b=b|0;if(!b)return;if(a[b+40>>0]&2){a[b+105>>0]=0;a[b+106>>0]=0;a[b+107>>0]=0;a[b+108>>0]=0;a[b+109>>0]=0;a[b+110>>0]=0;a[b+111>>0]=0;a[b+112>>0]=0;a[b+113>>0]=0;a[b+114>>0]=0;a[b+115>>0]=0;a[b+116>>0]=0;a[b+117>>0]=0;a[b+118>>0]=0;a[b+119>>0]=0;a[b+120>>0]=0;a[b+121>>0]=0;a[b+122>>0]=0;a[b+123>>0]=0;a[b+124>>0]=0;a[b+125>>0]=0;a[b+126>>0]=0;a[b+127>>0]=0;a[b+128>>0]=0;a[b+129>>0]=0;a[b+130>>0]=0;a[b+131>>0]=0;a[b+132>>0]=0;a[b+133>>0]=0;a[b+134>>0]=0;a[b+135>>0]=0;a[b+136>>0]=0;a[b+137>>0]=0;a[b+138>>0]=0;a[b+139>>0]=0;a[b+140>>0]=0;a[b+141>>0]=0;a[b+142>>0]=0;a[b+143>>0]=0;a[b+144>>0]=0;a[b+145>>0]=0;a[b+146>>0]=0;a[b+147>>0]=0;a[b+148>>0]=0;a[b+149>>0]=0;a[b+150>>0]=0;a[b+151>>0]=0;a[b+152>>0]=0;a[b+153>>0]=0;a[b+154>>0]=0;a[b+155>>0]=0;a[b+156>>0]=0;a[b+157>>0]=0;a[b+158>>0]=0;a[b+159>>0]=0;a[b+160>>0]=0;a[b+161>>0]=0;a[b+162>>0]=0;a[b+163>>0]=0;a[b+164>>0]=0;a[b+165>>0]=0;a[b+166>>0]=0;a[b+167>>0]=0;a[b+168>>0]=0}Pq(b);return}function Sl(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;y=l;l=l+320|0;if((l|0)>=(m|0))$(320);e=y+256|0;u=y;j=c[b>>2]|0;v=b+4|0;f=c[v>>2]|0;w=b+8|0;h=c[w>>2]|0;x=b+12|0;p=c[x>>2]|0;q=b+16|0;i=c[q>>2]|0;r=b+20|0;k=c[r>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]=(c[b>>2]|0)+e;c[v>>2]=(c[v>>2]|0)+j;c[w>>2]=(c[w>>2]|0)+f;c[x>>2]=(c[x>>2]|0)+h;c[q>>2]=(c[q>>2]|0)+d;c[r>>2]=(c[r>>2]|0)+i;c[s>>2]=(c[s>>2]|0)+k;c[t>>2]=(c[t>>2]|0)+n;l=y;return}function Tl(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;Ql(b);do if(a[b+40>>0]&2){e=Oq(172)|0;if(e|0){c[e>>2]=1779033703;c[e+4>>2]=-1150833019;c[e+8>>2]=1013904242;c[e+12>>2]=-1521486534;c[e+16>>2]=1359893119;c[e+20>>2]=-1694144372;c[e+24>>2]=528734635;c[e+28>>2]=1541459225;c[e+32>>2]=0;c[e+36>>2]=0;a[e+40>>0]=0;Pl(e,b+105|0,64);f=b+41|0;Pl(e,f,32);Ql(e);g=e+41|0;h=f+32|0;do{a[f>>0]=a[g>>0]|0;f=f+1|0;g=g+1|0}while((f|0)<(h|0));Rl(e);break}Pq(b);h=0;return h|0}while(0);if(d|0)c[d>>2]=32;h=b+41|0;return h|0}function Ul(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0;pa=l;l=l+16|0;if((l|0)>=(m|0))$(16);na=pa;oa=b+12|0;if((c[(c[oa>>2]|0)+20>>2]|0)!=16){oa=139;l=pa;return oa|0}if((h+8|0)>>>0>f>>>0){oa=200;l=pa;return oa|0}if(h&7|0){oa=45;l=pa;return oa|0}la=h>>>3;if(h>>>0<16){oa=45;l=pa;return oa|0}ma=b+80|0;if(!(a[b+56>>0]&2)){ka=e;ja=ka;a[ja>>0]=-1499027802;a[ja+1>>0]=-1499027802>>8;a[ja+2>>0]=-1499027802>>16;a[ja+3>>0]=-1499027802>>24;ka=ka+4|0;a[ka>>0]=-1499027802;a[ka+1>>0]=-1499027802>>8;a[ka+2>>0]=-1499027802>>16;a[ka+3>>0]=-1499027802>>24;ka=e}else{ja=b+64|0;ha=ja;ha=d[ha>>0]|d[ha+1>>0]<<8|d[ha+2>>0]<<16|d[ha+3>>0]<<24;ja=ja+4|0;ja=d[ja>>0]|d[ja+1>>0]<<8|d[ja+2>>0]<<16|d[ja+3>>0]<<24;ka=e;ia=ka;a[ia>>0]=ha;a[ia+1>>0]=ha>>8;a[ia+2>>0]=ha>>16;a[ia+3>>0]=ha>>24;ka=ka+4|0;a[ka>>0]=ja;a[ka+1>>0]=ja>>8;a[ka+2>>0]=ja>>16;a[ka+3>>0]=ja>>24;ka=e}dr(e+8|0,g|0,h|0)|0;ia=na;c[ia>>2]=0;c[ia+4>>2]=0;ia=(la|0)==0;ja=b+88|0;z=b+496|0;A=((ma|e)&3|0)==0;B=ma+4|0;C=na+4|0;D=e+4|0;E=ma+1|0;F=na+7|0;G=na+6|0;H=na+5|0;I=na+4|0;J=na+3|0;K=na+2|0;L=na+1|0;M=e+1|0;N=ma+2|0;O=e+2|0;P=ma+3|0;Q=e+3|0;R=ma+4|0;S=e+4|0;T=ma+5|0;U=na+5|0;V=e+5|0;W=ma+6|0;X=na+6|0;Y=e+6|0;Z=ma+7|0;_=na+7|0;aa=e+7|0;ba=na+7|0;ca=na+6|0;da=na+5|0;ea=na+4|0;fa=na+3|0;ga=na+2|0;ha=na+1|0;o=0;y=0;j=0;s=0;r=0;q=0;n=0;k=0;v=0;f=0;g=0;h=0;t=0;i=0;b=0;p=0;while(1){if(!ia)if(A){t=1;k=s;do{w=ka;x=w;x=d[x>>0]|d[x+1>>0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<<24>>24;a[J>>0]=h;if(!(h<<24>>24)){g=g+1<<24>>24;a[K>>0]=g;if(!(g<<24>>24)){f=f+1<<24>>24;a[L>>0]=f;if(!(f<<24>>24)){j=v+1<<24>>24;a[na>>0]=j;k=j;f=0;g=0;h=0;n=0;s=0;r=0;q=0;i=0;b=0}else{g=0;h=0;n=0;s=0;r=0;q=0;i=0;b=0}}else{h=0;n=0;s=0;r=0;q=0;i=0;b=0}}else{n=0;s=0;r=0;q=0;i=0;b=0}}else{n=b;s=b;r=0;q=0;i=0;b=0}}else{r=b;q=0;i=b;b=0}}else q=b}a[e>>0]=k^a[ma>>0];a[M>>0]=f^a[E>>0];a[O>>0]=g^a[N>>0];a[Q>>0]=h^a[P>>0];a[S>>0]=n^a[R>>0];a[V>>0]=a[U>>0]^a[T>>0];a[Y>>0]=a[X>>0]^a[W>>0];a[aa>>0]=a[_>>0]^a[Z>>0];ra=ja;x=ra;x=d[x>>0]|d[x+1>>0]<<8|d[x+2>>0]<<16|d[x+3>>0]<<24;ra=ra+4|0;ra=d[ra>>0]|d[ra+1>>0]<<8|d[ra+2>>0]<<16|d[ra+3>>0]<<24;sa=u;qa=sa;a[qa>>0]=x;a[qa+1>>0]=x>>8;a[qa+2>>0]=x>>16;a[qa+3>>0]=x>>24;sa=sa+4|0;a[sa>>0]=ra;a[sa+1>>0]=ra>>8;a[sa+2>>0]=ra>>16;a[sa+3>>0]=ra>>24;w=w+1|0;if(w>>>0>la>>>0){x=j;u=n;w=k;v=k;t=n;break}else{t=n;v=k}}}else{x=j;u=n;w=k}y=y+1|0;if((y|0)==6)break;else{j=x;n=u;k=w}}if(!o){sa=0;l=pa;return sa|0}Te(o+16|0);sa=0;l=pa;return sa|0}function Vl(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,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>>24;a[fa>>0]=q;if(!(k<<24>>24)){r=n+-1<<24>>24;a[ga>>0]=r;if(!(n<<24>>24)){x=s+-1<<24>>24;a[ja>>0]=x;s=x;h=g;i=f;o=t;t=g;j=p;k=q;n=r;g=x}else{h=g;i=f;o=t;t=g;j=p;k=q;n=r;g=x}}else{h=g;i=f;o=t;t=g;j=p;k=q;g=x}}else{h=g;i=f;o=t;t=g;j=p;g=x}}else{h=g;i=f;o=t;t=g;g=x}}else{i=f;o=t;t=p;g=x}}else{o=t;t=p;g=x}}else{t=p;g=x}q=ia;p=q;p=d[p>>0]|d[p+1>>0]<<8|d[p+2>>0]<<16|d[p+3>>0]<<24;q=q+4|0;q=d[q>>0]|d[q+1>>0]<<8|d[q+2>>0]<<16|d[q+3>>0]<<24;r=ha;x=r;a[x>>0]=p;a[x+1>>0]=p>>8;a[x+2>>0]=p>>16;a[x+3>>0]=p>>24;r=r+4|0;a[r>>0]=q;a[r+1>>0]=q>>8;a[r+2>>0]=q>>16;a[r+3>>0]=q>>24;r=J;q=r;q=d[q>>0]|d[q+1>>0]<<8|d[q+2>>0]<<16|d[q+3>>0]<<24;r=r+4|0;r=d[r>>0]|d[r+1>>0]<<8|d[r+2>>0]<<16|d[r+3>>0]<<24;x=v;v=x;a[v>>0]=q;a[v+1>>0]=q>>8;a[v+2>>0]=q>>16;a[v+3>>0]=q>>24;x=x+4|0;a[x>>0]=r;a[x+1>>0]=r>>8;a[x+2>>0]=r>>16;a[x+3>>0]=r>>24;y=y+-1|0;if(!y){r=u;u=h;q=w;p=t;break}else{f=u;x=g;p=t;g=w}}}else{r=f;u=h}if((z|0)>0){f=r;z=z+-1|0;h=u}else break}if(!(a[b+56>>0]&2))if(((((((a[ha>>0]|0)==-90?(a[b+97>>0]|0)==-90:0)?(a[b+98>>0]|0)==-90:0)?(a[b+99>>0]|0)==-90:0)?(a[H>>0]|0)==-90:0)?(a[b+101>>0]|0)==-90:0)?(a[b+102>>0]|0)==-90:0)f=(a[b+103>>0]|0)!=-90&1;else f=1;else f=Tp(ha,b+64|0,8)|0;if(r|0)Te(r+16|0);ka=f|0?10:0;l=la;return ka|0}function Wl(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;w=c[b+12>>2]|0;h=c[w+20>>2]|0;w=c[w+36>>2]|0;j=(g>>>0)/(h>>>0)|0;t=b+52|0;i=c[t>>2]|0;k=i&8;if((k|0?h:g)>>>0>e>>>0){w=200;return w|0}u=(g>>>0)%(h>>>0)|0;v=(u|0)==0;if(!v){e=i&4;if(h>>>0>=g>>>0|(e|0)==0){w=139;return w|0}}else e=i&4;s=h>>>0>>0;r=((v&(s&(e|0)!=0))<<31>>31)+j|0;e=c[b+28>>2]|0;if(!e){g=b+64|0;if(r){q=h+-4|0;p=q&-4;o=p+4|0;p=q-p|0;q=b+496|0;if(h>>>0>3){e=0;i=g;n=0;while(1){if(!((f|i|d)&3)){m=i+o|0;j=f;k=d;l=h;while(1){c[k>>2]=c[i>>2]^c[j>>2];l=l+-4|0;if(l>>>0<=3)break;else{i=i+4|0;j=j+4|0;k=k+4|0}}i=m;k=f+o|0;l=d+o|0;j=p}else{k=f;l=d;j=h}if(j|0)while(1){a[l>>0]=a[i>>0]^a[k>>0];j=j+-1|0;if(!j)break;else{i=i+1|0;k=k+1|0;l=l+1|0}}i=pb[w&63](q,d,d)|0;e=i>>>0>e>>>0?i:e;f=f+h|0;i=c[t>>2]|0;j=(i&8|0)==0?d+h|0:d;n=n+1|0;if(n>>>0>=r>>>0){p=j;o=f;break}else{i=d;d=j}}}else{n=(h|0)==0;e=0;i=g;m=0;while(1){if(!n){j=f;k=d;l=h;while(1){a[k>>0]=a[i>>0]^a[j>>0];l=l+-1|0;if(!l)break;else{i=i+1|0;j=j+1|0;k=k+1|0}}}k=pb[w&63](q,d,d)|0;e=k>>>0>e>>>0?k:e;k=f+h|0;i=c[t>>2]|0;j=(i&8|0)==0?d+h|0:d;m=m+1|0;if(m>>>0>=r>>>0){p=j;o=k;break}else{i=d;d=j;f=k}}}if((d|0)!=(g|0)){if(!((d|g)&3))if(h>>>0>3){l=h+-4|0;f=l&-4;n=f+4|0;m=d+n|0;j=g;k=h;while(1){c[j>>2]=c[d>>2];k=k+-4|0;if(k>>>0<=3)break;else{d=d+4|0;j=j+4|0}}j=l-f|0;d=m;g=g+n|0}else j=h;else j=h;if(j){i=j;while(1){a[g>>0]=a[d>>0]|0;i=i+-1|0;if(!i)break;else{d=d+1|0;g=g+1|0}}f=o;g=p;i=c[t>>2]|0}else{f=o;g=p}}else{f=o;g=p}}else{e=0;g=d}}else{xb[e&1](b+496|0,b+64|0,d,f,r,k);g=S(r,h)|0;i=c[t>>2]|0;e=0;f=f+g|0;g=(i&8|0)==0?d+g|0:d}if(s&(i&4|0)!=0){j=v?h:u;g=g+(0-h)|0;i=b+64|0;if(!j){j=0;d=i}else{l=j+64|0;d=0;k=i;while(1){u=a[f+d>>0]|0;v=g+d|0;a[g+(d+h)>>0]=a[v>>0]|0;a[v>>0]=a[k>>0]^u;d=d+1|0;if((d|0)==(j|0))break;else k=k+1|0}d=b+l|0}if(j>>>0>>0)while(1){a[g+j>>0]=a[d>>0]|0;j=j+1|0;if((j|0)==(h|0))break;else d=d+1|0}w=pb[w&63](b+496|0,g,g)|0;e=w>>>0>e>>>0?w:e;if(!((g|i)&3))if(h>>>0>3){j=h+-4|0;k=j&-4;f=k+4|0;l=g+f|0;d=i;while(1){c[d>>2]=c[g>>2];h=h+-4|0;if(h>>>0<=3)break;else{g=g+4|0;d=d+4|0}}h=j-k|0;g=l;i=i+f|0}if(h)while(1){a[i>>0]=a[g>>0]|0;h=h+-1|0;if(!h)break;else{g=g+1|0;i=i+1|0}}}if(!e){w=0;return w|0}Te(e+16|0);w=0;return w|0}function Xl(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;F=c[b+12>>2]|0;j=c[F+20>>2]|0;F=c[F+40>>2]|0;i=(g>>>0)/(j>>>0)|0;if(e>>>0>>0){b=200;return b|0}D=(g>>>0)%(j>>>0)|0;E=(D|0)==0;if(!E){if(j>>>0>=g>>>0){b=139;return b|0}e=b+52|0;h=c[e>>2]|0;if(!(h&4)){b=139;return b|0}else C=e}else{h=b+52|0;C=h;h=c[h>>2]|0}B=j>>>0>>0;if(B&(h&4|0)!=0){i=(E?-2:-1)+i|0;h=b+96|0;g=b+64|0;if(!((g|h)&3))if(j>>>0>3){k=j+-4|0;l=k&-4;n=l+4|0;m=g+n|0;e=j;while(1){c[h>>2]=c[g>>2];e=e+-4|0;if(e>>>0<=3)break;else{g=g+4|0;h=h+4|0}}e=k-l|0;g=m;h=b+96+n|0}else e=j;else e=j;if(e)while(1){a[h>>0]=a[g>>0]|0;e=e+-1|0;if(!e)break;else{g=g+1|0;h=h+1|0}}}e=c[b+32>>2]|0;do if(!e)if(!i){e=0;q=f}else{w=b+496|0;x=b+96|0;y=b+64|0;r=y|x;z=j+-4|0;t=z&-4;s=t+4|0;u=b+96+s|0;v=y+s|0;t=z-t|0;z=S(i,j)|0;A=f+z|0;if(j>>>0>3){e=0;p=d;q=0;o=f}else{q=(j|0)==0;e=0;o=d;p=0;h=f;while(1){f=pb[F&63](w,x,h)|0;e=f>>>0>e>>>0?f:e;if(!q){g=o;k=y;l=h;m=x;n=j;while(1){f=a[l>>0]|0;a[g>>0]=a[m>>0]^a[k>>0];a[k>>0]=f;n=n+-1|0;if(!n)break;else{g=g+1|0;k=k+1|0;l=l+1|0;m=m+1|0}}}p=p+1|0;if((p|0)==(i|0))break;else{o=o+j|0;h=h+j|0}}d=d+z|0;q=A;break}while(1){f=pb[F&63](w,x,o)|0;e=f>>>0>e>>>0?f:e;if(!((r|o|p)&3)){n=o+s|0;h=x;g=o;k=y;l=p;m=j;while(1){f=c[g>>2]|0;c[l>>2]=c[h>>2]^c[k>>2];c[k>>2]=f;m=m+-4|0;if(m>>>0<=3)break;else{h=h+4|0;g=g+4|0;k=k+4|0;l=l+4|0}}g=p+s|0;l=v;m=n;k=u;h=t}else{g=p;l=y;m=o;k=x;h=j}if(h|0)while(1){f=a[m>>0]|0;a[g>>0]=a[k>>0]^a[l>>0];a[l>>0]=f;h=h+-1|0;if(!h)break;else{g=g+1|0;l=l+1|0;m=m+1|0;k=k+1|0}}q=q+1|0;if((q|0)==(i|0))break;else{p=p+j|0;o=o+j|0}}d=d+z|0;q=A}else{qb[e&15](b+496|0,b+64|0,d,f,i);q=S(i,j)|0;e=0;d=d+q|0;q=f+q|0}while(0);if(B&(c[C>>2]&4|0)!=0){t=E?j:D;h=b+96|0;u=b+64|0;v=h;p=u;if(!((p|v)&3))if(j>>>0>3){m=j+-4|0;n=m&-4;o=n+4|0;i=u+o|0;g=u;k=h;l=j;while(1){c[k>>2]=c[g>>2];l=l+-4|0;if(l>>>0<=3)break;else{g=g+4|0;k=k+4|0}}g=m-n|0;k=b+96+o|0}else{g=j;i=u;k=h}else{i=u;k=h;g=j}if(g|0)while(1){a[k>>0]=a[i>>0]|0;g=g+-1|0;if(!g)break;else{i=i+1|0;k=k+1|0}}i=q+j|0;if(!((i|p)&3))if(t>>>0>3){l=t+-4|0;m=l&-4;o=m+4|0;n=i+o|0;g=u;k=t;while(1){c[g>>2]=c[i>>2];k=k+-4|0;if(k>>>0<=3)break;else{i=i+4|0;g=g+4|0}}g=l-m|0;i=n;k=u+o|0}else{g=t;k=u}else{k=u;g=t}if(g|0)while(1){a[k>>0]=a[i>>0]|0;g=g+-1|0;if(!g)break;else{i=i+1|0;k=k+1|0}}s=b+496|0;q=pb[F&63](s,d,q)|0;q=q>>>0>e>>>0?q:e;r=d;if(!((r|p)&3))if(t>>>0>3){l=t+-4|0;m=l&-4;n=m+4|0;g=d+n|0;e=u;i=d;k=t;while(1){c[i>>2]=c[e>>2]^c[i>>2];k=k+-4|0;if(k>>>0<=3)break;else{e=e+4|0;i=i+4|0}}l=l-m|0;e=u+n|0}else{l=t;e=u;g=d}else{e=u;g=d;l=t}if(l|0){k=g;i=g;g=l;while(1){a[i>>0]=a[e>>0]^a[k>>0];g=g+-1|0;if(!g)break;else{e=e+1|0;k=k+1|0;i=i+1|0}}}g=d+j|0;if(!((g|r)&3))if(t>>>0>3){m=t+-4|0;n=m&-4;o=n+4|0;i=d+o|0;e=d;k=g;l=t;while(1){c[k>>2]=c[e>>2];l=l+-4|0;if(l>>>0<=3)break;else{e=e+4|0;k=k+4|0}}e=m-n|0;g=g+o|0}else{e=t;i=d}else{i=d;e=t}if(e|0)while(1){a[g>>0]=a[i>>0]|0;e=e+-1|0;if(!e)break;else{i=i+1|0;g=g+1|0}}if(t>>>0>>0){e=t;do{a[u+e>>0]=a[d+e>>0]|0;e=e+1|0}while((e|0)!=(j|0))}e=pb[F&63](s,d,u)|0;e=e>>>0>q>>>0?e:q;if(!((r|v)&3))if(j>>>0>3){g=j+-4|0;i=g&-4;k=i+4|0;l=d+k|0;while(1){c[d>>2]=c[h>>2]^c[d>>2];j=j+-4|0;if(j>>>0<=3)break;else{h=h+4|0;d=d+4|0}}j=g-i|0;h=b+96+k|0;d=l}if(j){i=d;g=d;d=j;while(1){a[g>>0]=a[h>>0]^a[i>>0];d=d+-1|0;if(!d)break;else{h=h+1|0;i=i+1|0;g=g+1|0}}}}if(!e){b=0;return b|0}Te(e+16|0);b=0;return b|0}function Yl(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;h=15-e|0;if(!d){k=45;return k|0}if((h+-2|0)>>>0>6){k=139;return k|0}Yq(b+128|0,0,368)|0;c[b+56>>2]=0;i=b+64|0;f=b+80|0;g=h+255&255;j=i;k=j+52|0;do{c[j>>2]=0;j=j+4|0}while((j|0)<(k|0));a[f>>0]=g;cr(f+1|0,d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ma=b+73|0;na=b+74|0;oa=b+75|0;pa=b+76|0;qa=b+77|0;ra=b+78|0;k=b+79|0;f=d;b=e;e=0;while(1){if((g|0)!=0|(b+g|0)>>>0<16){if(g>>>0<16&(b|0)!=0)while(1){d=f+1|0;h=g+1|0;a[o+g>>0]=a[f>>0]|0;g=b+-1|0;if(h>>>0<16&(g|0)!=0){b=g;g=h;f=d}else{f=d;b=g;g=h;break}}}else g=0;if(!b){if(n)break;if(g>>>0<16){Yq(o+g|0,0,16-g|0)|0;ua=12}else ua=12}else if(g)ua=12;if((ua|0)==12){ua=0;if(r){c[p>>2]=c[o>>2]^c[p>>2];c[s>>2]=c[t>>2]^c[s>>2];c[u>>2]=c[v>>2]^c[u>>2];c[w>>2]=c[x>>2]^c[w>>2]}else{a[p>>0]=a[o>>0]^a[p>>0];a[B>>0]=a[C>>0]^a[B>>0];a[D>>0]=a[E>>0]^a[D>>0];a[F>>0]=a[G>>0]^a[F>>0];a[H>>0]=a[I>>0]^a[H>>0];a[J>>0]=a[K>>0]^a[J>>0];a[L>>0]=a[M>>0]^a[L>>0];a[N>>0]=a[O>>0]^a[N>>0];a[P>>0]=a[Q>>0]^a[P>>0];a[R>>0]=a[S>>0]^a[R>>0];a[T>>0]=a[U>>0]^a[T>>0];a[V>>0]=a[W>>0]^a[V>>0];a[X>>0]=a[Y>>0]^a[X>>0];a[Z>>0]=a[_>>0]^a[Z>>0];a[aa>>0]=a[ba>>0]^a[aa>>0];a[ca>>0]=a[da>>0]^a[ca>>0]}j=pb[ta&63](y,p,p)|0;e=e>>>0>j>>>0?e:j}g=c[z>>2]|0;if(!g)if(b>>>0>15){d=b+-16|0;h=d&-16;g=f+16|0;while(1){if(!((f|q)&3)){c[p>>2]=c[f>>2]^c[p>>2];c[s>>2]=c[f+4>>2]^c[s>>2];c[u>>2]=c[f+8>>2]^c[u>>2];c[w>>2]=c[f+12>>2]^c[w>>2]}else{a[p>>0]=a[f>>0]^a[p>>0];a[ea>>0]=a[f+1>>0]^a[ea>>0];a[fa>>0]=a[f+2>>0]^a[fa>>0];a[ga>>0]=a[f+3>>0]^a[ga>>0];a[ha>>0]=a[f+4>>0]^a[ha>>0];a[ia>>0]=a[f+5>>0]^a[ia>>0];a[ja>>0]=a[f+6>>0]^a[ja>>0];a[ka>>0]=a[f+7>>0]^a[ka>>0];a[la>>0]=a[f+8>>0]^a[la>>0];a[ma>>0]=a[f+9>>0]^a[ma>>0];a[na>>0]=a[f+10>>0]^a[na>>0];a[oa>>0]=a[f+11>>0]^a[oa>>0];a[pa>>0]=a[f+12>>0]^a[pa>>0];a[qa>>0]=a[f+13>>0]^a[qa>>0];a[ra>>0]=a[f+14>>0]^a[ra>>0];a[k>>0]=a[f+15>>0]^a[k>>0]}j=pb[ta&63](y,p,p)|0;e=e>>>0>j>>>0?e:j;b=b+-16|0;if(b>>>0<=15)break;else f=f+16|0}f=g+h|0;g=d-h|0}else g=b;else{j=b>>>4;xb[g&1](y,p,sa,f,j,1);g=j<<4;j=f+g|0;g=b-g|0;if(!A){f=16;b=sa;do{a[b>>0]=0;b=b+1|0;f=f+-1|0}while((f|0)!=0&(b&7|0)!=0);if(f>>>0>=8)ua=22}else{f=16;b=sa;ua=22}if((ua|0)==22){ua=0;d=f+-8|0;h=d&-8;i=b+8|0;while(1){xa=b;c[xa>>2]=0;c[xa+4>>2]=0;f=f+-8|0;if(f>>>0<=7)break;else b=b+8|0}f=d-h|0;b=i+h|0}if(!f)f=j;else while(1){a[b>>0]=0;f=f+-1|0;if(!f){f=j;break}else b=b+1|0}}if(!g){g=0;break}else{b=g;g=0}}c[va>>2]=g;xa=(e|0)==0?0:e+16|0;l=wa;return xa|0}function _l(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;if(e>>>0>>0){g=200;return g|0}h=a[b+184>>0]|0;if(!(h&1)){g=156;return g|0}if((h&2)==0|(a[b+56>>0]&4)!=0){g=156;return g|0}j=b+136|0;if(!((c[j>>2]|0)==0&(c[j+4>>2]|0)==0)){g=156;return g|0}h=b+128|0;j=h;i=c[j>>2]|0;j=c[j+4>>2]|0;if(j>>>0<0|(j|0)==0&i>>>0>>0){g=139;return g|0}j=Xq(i|0,j|0,g|0,0)|0;c[h>>2]=j;c[h+4>>2]=D;h=Zl(b,f,g,0)|0;if(h|0)Te(h+20|0);g=dm(b,d,e,f,g)|0;return g|0}function $l(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;if(e>>>0>>0){g=200;return g|0}h=a[b+184>>0]|0;if(!(h&1)){g=156;return g|0}if((h&2)==0|(a[b+56>>0]&4)!=0){g=156;return g|0}i=b+136|0;if(!((c[i>>2]|0)==0&(c[i+4>>2]|0)==0)){g=156;return g|0}i=b+128|0;h=i;j=c[h+4>>2]|0;if(0>j>>>0|(0==(j|0)?g>>>0>(c[h>>2]|0)>>>0:0)){j=139;return j|0}h=dm(b,d,e,f,g)|0;if(h|0){j=h;return j|0}j=i;j=Xq(c[j>>2]|0,c[j+4>>2]|0,g|0,0)|0;h=i;c[h>>2]=j;c[h+4>>2]=D;h=Zl(b,d,g,0)|0;if(!h){j=0;return j|0}Te(h+20|0);j=0;return j|0}function am(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;u=c[b+12>>2]|0;t=c[u+36>>2]|0;u=c[u+20>>2]|0;s=u<<1;if(e>>>0>>0){v=200;return v|0}v=b+112|0;e=c[v>>2]|0;if(e>>>0>=g>>>0){h=b+64+u+(0-e)|0;if(!((f|d|h)&3))if(g>>>0>3){l=g+-4|0;m=l&-4;o=m+4|0;n=h+o|0;k=f;i=d;j=g;while(1){u=c[h>>2]^c[k>>2];c[h>>2]=u;c[i>>2]=u;j=j+-4|0;if(j>>>0<=3)break;else{k=k+4|0;h=h+4|0;i=i+4|0}}i=l-m|0;f=f+o|0;h=n;d=d+o|0}else i=g;else i=g;if(i){e=i;while(1){u=a[h>>0]^a[f>>0];a[h>>0]=u;a[d>>0]=u;e=e+-1|0;if(!e)break;else{f=f+1|0;h=h+1|0;d=d+1|0}}e=c[v>>2]|0}c[v>>2]=e-g;v=0;return v|0}if(e){g=g-e|0;i=b+64+u+(0-e)|0;if(e>>>0>3&((f|d|i)&3|0)==0){l=e+-4|0;m=l&-4;o=m+4|0;n=i+o|0;k=f;h=d;j=e;while(1){r=c[i>>2]^c[k>>2];c[i>>2]=r;c[h>>2]=r;j=j+-4|0;if(j>>>0<=3)break;else{k=k+4|0;i=i+4|0;h=h+4|0}}j=l-m|0;if(j){k=f+o|0;i=n;h=d+o|0;e=j;p=18}}else{k=f;h=d;p=18}if((p|0)==18){while(1){r=a[i>>0]^a[k>>0];a[i>>0]=r;a[h>>0]=r;e=e+-1|0;if(!e)break;else{k=k+1|0;i=i+1|0;h=h+1|0;p=18}}e=c[v>>2]|0}c[v>>2]=0;d=d+e|0;f=f+e|0}a:do if(g>>>0>>0)e=0;else{e=c[b+20>>2]|0;if(e|0){s=(g>>>0)/(u>>>0)|0;qb[e&15](b+496|0,b+64|0,d,f,s);s=S(s,u)|0;e=0;d=d+s|0;f=f+s|0;g=g-s|0;break}q=b+496|0;r=b+64|0;n=r;l=u+-4|0;m=l&-4;o=m+4|0;p=r+o|0;m=l-m|0;if(u>>>0>3)e=0;else{l=(u|0)==0;e=0;while(1){p=pb[t&63](q,r,r)|0;e=p>>>0>e>>>0?p:e;if(!l){h=f;i=r;j=d;k=u;while(1){p=a[i>>0]^a[h>>0];a[i>>0]=p;a[j>>0]=p;k=k+-1|0;if(!k)break;else{h=h+1|0;i=i+1|0;j=j+1|0}}}d=d+u|0;f=f+u|0;g=g-u|0;if(g>>>0>>0)break a}}do{l=pb[t&63](q,r,r)|0;e=l>>>0>e>>>0?l:e;if(!((f|n|d)&3)){h=f+o|0;i=f;j=r;k=d;l=u;while(1){w=c[j>>2]^c[i>>2];c[j>>2]=w;c[k>>2]=w;l=l+-4|0;if(l>>>0<=3)break;else{i=i+4|0;j=j+4|0;k=k+4|0}}j=p;k=d+o|0;i=m}else{h=f;j=r;k=d;i=u}if(i|0)while(1){w=a[j>>0]^a[h>>0];a[j>>0]=w;a[k>>0]=w;i=i+-1|0;if(!i)break;else{h=h+1|0;j=j+1|0;k=k+1|0}}d=d+u|0;f=f+u|0;g=g-u|0}while(g>>>0>=s>>>0)}while(0);if(g>>>0>=u>>>0){i=b+96|0;j=b+64|0;p=j;if(!((p|i)&3))if(u>>>0>3){m=u+-4|0;n=m&-4;o=n+4|0;k=j+o|0;l=j;h=u;while(1){c[i>>2]=c[l>>2];h=h+-4|0;if(h>>>0<=3)break;else{l=l+4|0;i=i+4|0}}h=m-n|0;i=b+96+o|0}else{h=u;k=j}else{k=j;h=u}if(h|0)while(1){a[i>>0]=a[k>>0]|0;h=h+-1|0;if(!h)break;else{k=k+1|0;i=i+1|0}}w=pb[t&63](b+496|0,j,j)|0;e=w>>>0>e>>>0?w:e;if(!((f|p|d)&3))if(u>>>0>3){l=u+-4|0;m=l&-4;o=m+4|0;n=j+o|0;k=f;h=d;i=u;while(1){w=c[j>>2]^c[k>>2];c[j>>2]=w;c[h>>2]=w;i=i+-4|0;if(i>>>0<=3)break;else{k=k+4|0;j=j+4|0;h=h+4|0}}h=l-m|0;k=f+o|0;j=n;i=d+o|0}else{h=u;k=f;i=d}else{k=f;i=d;h=u}if(h|0)while(1){w=a[j>>0]^a[k>>0];a[j>>0]=w;a[i>>0]=w;h=h+-1|0;if(!h)break;else{k=k+1|0;j=j+1|0;i=i+1|0}}d=d+u|0;f=f+u|0;g=g-u|0}if(g){j=b+96|0;h=b+64|0;p=h;if(!((p|j)&3))if(u>>>0>3){m=u+-4|0;n=m&-4;o=n+4|0;k=h+o|0;l=h;i=u;while(1){c[j>>2]=c[l>>2];i=i+-4|0;if(i>>>0<=3)break;else{l=l+4|0;j=j+4|0}}i=m-n|0;j=b+96+o|0}else{i=u;k=h}else{k=h;i=u}if(i|0)while(1){a[j>>0]=a[k>>0]|0;i=i+-1|0;if(!i)break;else{k=k+1|0;j=j+1|0}}w=pb[t&63](b+496|0,h,h)|0;e=w>>>0>e>>>0?w:e;c[v>>2]=u-g;if(!((f|p|d)&3))if(g>>>0>3){k=g+-4|0;l=k&-4;n=l+4|0;m=h+n|0;j=f;i=d;while(1){w=c[h>>2]^c[j>>2];c[h>>2]=w;c[i>>2]=w;g=g+-4|0;if(g>>>0<=3)break;else{j=j+4|0;h=h+4|0;i=i+4|0}}g=k-l|0;f=f+n|0;h=m;d=d+n|0}if(g)while(1){w=a[h>>0]^a[f>>0];a[h>>0]=w;a[d>>0]=w;g=g+-1|0;if(!g)break;else{f=f+1|0;h=h+1|0;d=d+1|0}}}if(!e){w=0;return w|0}Te(e+16|0);w=0;return w|0}function bm(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;t=c[b+12>>2]|0;s=c[t+36>>2]|0;t=c[t+20>>2]|0;r=t<<1;if(e>>>0>>0){u=200;return u|0}u=b+112|0;e=c[u>>2]|0;if(e>>>0>=g>>>0){h=b+64+t+(0-e)|0;if(!((f|d|h)&3))if(g>>>0>3){m=g+-4|0;n=m&-4;o=n+4|0;i=f;j=h;k=d;l=g;while(1){t=c[i>>2]|0;c[k>>2]=c[j>>2]^t;c[j>>2]=t;l=l+-4|0;if(l>>>0<=3)break;else{i=i+4|0;j=j+4|0;k=k+4|0}}i=m-n|0;f=f+o|0;h=h+o|0;d=d+o|0}else i=g;else i=g;if(i){e=i;while(1){t=a[f>>0]|0;a[d>>0]=t^a[h>>0];a[h>>0]=t;e=e+-1|0;if(!e)break;else{d=d+1|0;h=h+1|0;f=f+1|0}}e=c[u>>2]|0}c[u>>2]=e-g;u=0;return u|0}if(e){g=g-e|0;i=b+64+t+(0-e)|0;if(e>>>0>3&((f|d|i)&3|0)==0){m=e+-4|0;n=m&-4;o=n+4|0;h=f;j=i;k=d;l=e;while(1){q=c[h>>2]|0;c[k>>2]=c[j>>2]^q;c[j>>2]=q;l=l+-4|0;if(l>>>0<=3)break;else{h=h+4|0;j=j+4|0;k=k+4|0}}h=f+o|0;k=m-n|0;if(k){l=d+o|0;i=i+o|0;j=h;e=k;p=18}}else{l=d;j=f;h=f;p=18}if((p|0)==18){while(1){q=a[j>>0]|0;a[l>>0]=a[h>>0]^a[i>>0];a[i>>0]=q;e=e+-1|0;if(!e)break;else{l=l+1|0;i=i+1|0;j=j+1|0;h=h+1|0;p=18}}e=c[u>>2]|0}c[u>>2]=0;d=d+e|0;f=f+e|0}a:do if(g>>>0>>0)e=0;else{e=c[b+24>>2]|0;if(e|0){r=(g>>>0)/(t>>>0)|0;qb[e&15](b+496|0,b+64|0,d,f,r);r=S(r,t)|0;e=0;d=d+r|0;f=f+r|0;g=g-r|0;break}p=b+496|0;q=b+64|0;n=q;k=t+-4|0;m=k&-4;l=m+4|0;o=q+l|0;m=k-m|0;if(t>>>0>3)e=0;else{l=(t|0)==0;e=0;while(1){o=pb[s&63](p,q,q)|0;e=o>>>0>e>>>0?o:e;if(!l){h=d;i=q;j=f;k=t;while(1){o=a[j>>0]|0;a[h>>0]=o^a[i>>0];a[i>>0]=o;k=k+-1|0;if(!k)break;else{h=h+1|0;i=i+1|0;j=j+1|0}}}d=d+t|0;f=f+t|0;g=g-t|0;if(g>>>0>>0)break a}}do{k=pb[s&63](p,q,q)|0;e=k>>>0>e>>>0?k:e;if(!((f|n|d)&3)){h=f;i=q;j=d;k=t;while(1){v=c[h>>2]|0;c[j>>2]=c[i>>2]^v;c[i>>2]=v;k=k+-4|0;if(k>>>0<=3)break;else{h=h+4|0;i=i+4|0;j=j+4|0}}h=d+l|0;j=o;k=f+l|0;i=m}else{h=d;j=q;k=f;i=t}if(i|0)while(1){v=a[k>>0]|0;a[h>>0]=v^a[j>>0];a[j>>0]=v;i=i+-1|0;if(!i)break;else{h=h+1|0;j=j+1|0;k=k+1|0}}d=d+t|0;f=f+t|0;g=g-t|0}while(g>>>0>=r>>>0)}while(0);if(g>>>0>=t>>>0){i=b+96|0;k=b+64|0;p=k;if(!((p|i)&3))if(t>>>0>3){m=t+-4|0;n=m&-4;o=n+4|0;j=k+o|0;l=k;h=t;while(1){c[i>>2]=c[l>>2];h=h+-4|0;if(h>>>0<=3)break;else{l=l+4|0;i=i+4|0}}h=m-n|0;i=b+96+o|0}else{h=t;j=k}else{j=k;h=t}if(h|0)while(1){a[i>>0]=a[j>>0]|0;h=h+-1|0;if(!h)break;else{j=j+1|0;i=i+1|0}}v=pb[s&63](b+496|0,k,k)|0;e=v>>>0>e>>>0?v:e;if(!((f|p|d)&3))if(t>>>0>3){m=t+-4|0;n=m&-4;o=n+4|0;h=f;i=k;j=d;l=t;while(1){v=c[h>>2]|0;c[j>>2]=c[i>>2]^v;c[i>>2]=v;l=l+-4|0;if(l>>>0<=3)break;else{h=h+4|0;i=i+4|0;j=j+4|0}}i=m-n|0;j=f+o|0;k=k+o|0;h=d+o|0}else{i=t;j=f;h=d}else{h=d;j=f;i=t}if(i|0)while(1){v=a[j>>0]|0;a[h>>0]=v^a[k>>0];a[k>>0]=v;i=i+-1|0;if(!i)break;else{h=h+1|0;k=k+1|0;j=j+1|0}}d=d+t|0;f=f+t|0;g=g-t|0}if(g){j=b+96|0;h=b+64|0;p=h;if(!((p|j)&3))if(t>>>0>3){m=t+-4|0;n=m&-4;o=n+4|0;k=h+o|0;l=h;i=t;while(1){c[j>>2]=c[l>>2];i=i+-4|0;if(i>>>0<=3)break;else{l=l+4|0;j=j+4|0}}i=m-n|0;j=b+96+o|0}else{i=t;k=h}else{k=h;i=t}if(i|0)while(1){a[j>>0]=a[k>>0]|0;i=i+-1|0;if(!i)break;else{k=k+1|0;j=j+1|0}}v=pb[s&63](b+496|0,h,h)|0;e=v>>>0>e>>>0?v:e;c[u>>2]=t-g;if(!((f|p|d)&3))if(g>>>0>3){l=g+-4|0;m=l&-4;n=m+4|0;i=f;j=h;k=d;while(1){v=c[i>>2]|0;c[k>>2]=c[j>>2]^v;c[j>>2]=v;g=g+-4|0;if(g>>>0<=3)break;else{i=i+4|0;j=j+4|0;k=k+4|0}}g=l-m|0;f=f+n|0;h=h+n|0;d=d+n|0}if(g)while(1){v=a[f>>0]|0;a[d>>0]=v^a[h>>0];a[h>>0]=v;g=g+-1|0;if(!g)break;else{d=d+1|0;h=h+1|0;f=f+1|0}}}if(!e){v=0;return v|0}Te(e+16|0);v=0;return v|0}function cm(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;q=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=q;e=c[b+12>>2]|0;j=c[e+20>>2]|0;if(j>>>0>16)He(46529,113,46543);Yq(f|0,0,j|0)|0;p=pb[c[e+36>>2]&63](b+496|0,f,f)|0;g=j+-1|0;k=(j|0)==16?135:27;n=f+g|0;h=b+128|0;if((g|0)>-1){e=g;b=0;while(1){r=f+e|0;s=a[r>>0]|0;i=b;b=(s&255)>>>7;i=((s&255)<<1|i&255)&255;a[r>>0]=i;a[h+1+e>>0]=i;if((e|0)<=0)break;else e=e+-1|0}e=(d[n>>0]|0)^(b<<24>>24?k:0);b=e&255;a[h+1+g>>0]=b;b=(b&255)>>>7;e=e<<1&255;a[n>>0]=e;i=h+17+g|0;a[i>>0]=e;if((g|0)>0){e=j+-2|0;while(1){r=f+e|0;j=a[r>>0]|0;s=b;b=(j&255)>>>7;s=((j&255)<<1|s&255)&255;a[r>>0]=s;a[h+17+e>>0]=s;if((e|0)<=0)break;else e=e+-1|0}e=a[n>>0]|0}s=(e&255^(b<<24>>24?k:0))&255;a[n>>0]=s;a[i>>0]=s}else{s=a[n>>0]|0;a[h+1+g>>0]=s;a[h+17+g>>0]=s}if(f&4){e=16;do{a[f>>0]=0;f=f+1|0;e=e+-1|0}while((e|0)!=0&(f&7|0)!=0);if(e>>>0>=8)o=11}else{e=16;o=11}if((o|0)==11){g=e+-8|0;h=g&-8;b=f;while(1){s=b;c[s>>2]=0;c[s+4>>2]=0;e=e+-8|0;if(e>>>0<=7)break;else b=b+8|0}e=g-h|0;f=f+(h+8)|0}if(e|0)while(1){a[f>>0]=0;e=e+-1|0;if(!e)break;else f=f+1|0}if(!p){l=q;return 0}Te(p+16|0);l=q;return 0}function dm(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;A=l;l=l+16|0;if((l|0)>=(m|0))$(16);h=A;w=c[b+12>>2]|0;y=c[w+36>>2]|0;w=c[w+20>>2]|0;if(e>>>0>>0){z=200;l=A;return z|0}x=b+112|0;e=c[x>>2]|0;if(e){if(w>>>0<=e>>>0)Ie(46565,46587,53,46600);s=e>>>0>g>>>0?g:e;j=w-e+(b+96)|0;if(!((f|d|j)&3))if(s>>>0>3){o=s+-4|0;p=o&-4;r=p+4|0;q=j+r|0;i=f;k=d;n=s;while(1){c[k>>2]=c[j>>2]^c[i>>2];n=n+-4|0;if(n>>>0<=3)break;else{j=j+4|0;i=i+4|0;k=k+4|0}}n=o-p|0;j=q;k=f+r|0;i=d+r|0}else{n=s;k=f;i=d}else{k=f;i=d;n=s}if(n){e=n;while(1){a[i>>0]=a[j>>0]^a[k>>0];e=e+-1|0;if(!e)break;else{j=j+1|0;k=k+1|0;i=i+1|0}}e=c[x>>2]|0}c[x>>2]=e-s;d=d+s|0;f=f+s|0;g=g-s|0}e=(g>>>0)/(w>>>0)|0;if(w>>>0<=g>>>0?(t=c[b+36>>2]|0,u=S(e,w)|0,(t|0)!=0):0){qb[t&15](b+496|0,b+80|0,d,f,e);d=d+u|0;f=f+u|0;g=g-u|0}if(!g){z=0;l=A;return z|0}s=b+496|0;t=b+80|0;u=h;v=0;while(1){e=pb[y&63](s,h,t)|0;v=e>>>0>v>>>0?e:v;e=w;do{if((e|0)<=0)break;e=e+-1|0;q=t+e|0;r=(a[q>>0]|0)+1<<24>>24;a[q>>0]=r}while(!(r<<24>>24));r=w>>>0>>0?w:g;if(!((f|u|d)&3))if(r>>>0>3){o=r+-4|0;p=o&-4;q=p+4|0;i=h+q|0;e=h;j=f;k=d;n=r;while(1){c[k>>2]=c[e>>2]^c[j>>2];n=n+-4|0;if(n>>>0<=3)break;else{e=e+4|0;j=j+4|0;k=k+4|0}}e=o-p|0;k=f+q|0;j=d+q|0}else{e=r;i=h;k=f;j=d}else{i=h;k=f;j=d;e=r}if(e|0)while(1){a[j>>0]=a[i>>0]^a[k>>0];e=e+-1|0;if(!e)break;else{i=i+1|0;k=k+1|0;j=j+1|0}}g=g-r|0;if(!g)break;else{d=d+r|0;f=f+r|0}}e=w-r|0;c[x>>2]=e;do if(e|0){g=b+96+r|0;d=h+r|0;if(e>>>0>3&((d|g)&3|0)==0){i=e+-4|0;j=i&-4;n=j+4|0;k=d+n|0;f=g;while(1){c[f>>2]=c[d>>2];e=e+-4|0;if(e>>>0<=3)break;else{d=d+4|0;f=f+4|0}}e=i-j|0;if(!e)break;else{d=k;g=g+n|0}}while(1){a[g>>0]=a[d>>0]|0;e=e+-1|0;if(!e)break;else{d=d+1|0;g=g+1|0}}}while(0);if(u&7){e=16;do{a[h>>0]=0;h=h+1|0;e=e+-1|0}while((e|0)!=0&(h&7|0)!=0);if(e>>>0>=8)z=41}else{e=16;z=41}if((z|0)==41){d=e+-8|0;f=d&-8;i=f+8|0;g=h;while(1){z=g;c[z>>2]=0;c[z+4>>2]=0;e=e+-8|0;if(e>>>0<=7)break;else g=g+8|0}e=d-f|0;h=h+i|0}if(e|0)while(1){a[h>>0]=0;e=e+-1|0;if(!e)break;else h=h+1|0}if(!v){z=0;l=A;return z|0}Te(v+16|0);z=0;l=A;return z|0}function em(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0;if((c[(c[b+12>>2]|0)+20>>2]|0)!=16){g=12;return g|0}if(e>>>0>>0){g=200;return g|0}m=b+128|0;l=b+196|0;h=a[l>>0]|0;if(h&4){g=139;return g|0}i=a[b+56>>0]|0;if((i&4|h&1)<<24>>24){g=156;return g|0}if(!(i&2)){fm(b,71779,16)|0;h=a[l>>0]|0}if(h&8){g=156;return g|0}if(!(h&2)){gm(b,m,0,0,1);h=a[l>>0]|2;a[l>>0]=h}j=b+172|0;k=(c[j>>2]|0)+g|0;c[j>>2]=k;j=b+176|0;i=c[j>>2]|0;if(k>>>0>>0){i=i+1|0;c[j>>2]=i}if(i>>>0<=15?(i|0)!=15|k>>>0<4294967265:0){h=dm(b,d,e,f,g)|0;if(h|0){g=h;return g|0}gm(b,m,d,g,0);g=0;return g|0}a[l>>0]=h|4;g=139;return g|0}function fm(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;n=l;l=l+32|0;if((l|0)>=(m|0))$(32);i=n;g=n+8|0;k=b+56|0;a[k>>0]=a[k>>0]&-7;h=b+196|0;a[h>>0]=a[h>>0]&-9;o=(gg()|0)==0;f=a[h>>0]|0;if(!o){f=f|8;a[h>>0]=f}p=b+128|0;o=b+164|0;c[p>>2]=0;c[p+4>>2]=0;c[p+8>>2]=0;c[p+12>>2]=0;c[o>>2]=0;c[o+4>>2]=0;c[o+8>>2]=0;c[o+12>>2]=0;a[h>>0]=f&-8;switch(e|0){case 12:{f=b+80|0;e=f;g=d;h=e+12|0;do{a[e>>0]=a[g>>0]|0;e=e+1|0;g=g+1|0}while((e|0)<(h|0));a[b+94>>0]=0;a[b+93>>0]=0;g=b+92|0;a[g>>0]=0;a[b+95>>0]=1;break}case 0:{p=139;l=n;return p|0}default:{f=i;c[f>>2]=0;c[f+4>>2]=0;f=b+80|0;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[i>>2]=e;gm(b,f,d,e,1);c[g+12>>2]=er(e<<3|0)|0;c[g+8>>2]=er(e>>>29|0)|0;c[g+4>>2]=0;c[g>>2]=0;gm(b,f,g,16,1);p=i;c[p>>2]=0;c[p+4>>2]=0;if(g&4){h=16;do{a[g>>0]=0;g=g+1|0;h=h+-1|0}while((h|0)!=0&(g&7|0)!=0);if(h>>>0>=8)j=7}else{h=16;j=7}if((j|0)==7){i=h+-8|0;d=i&-8;e=g;while(1){p=e;c[p>>2]=0;c[p+4>>2]=0;h=h+-8|0;if(h>>>0<=7)break;else e=e+8|0}h=i-d|0;g=g+(d+8)|0}if(h|0)while(1){a[g>>0]=0;h=h+-1|0;if(!h)break;else g=g+1|0}g=b+92|0}}pb[c[(c[b+12>>2]|0)+36>>2]&63](b+496|0,b+180|0,f)|0;c[g>>2]=er((er(c[g>>2]|0)|0)+1|0)|0;c[b+112>>2]=0;a[k>>0]=a[k>>0]&-7|2;p=0;l=n;return p|0}function gm(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;v=b+160|0;h=c[v>>2]|0;w=c[b+224>>2]|0;if(!f)if((g|0)!=0&(h|0)!=0)f=0;else return;s=b+144|0;a:do if(!g){g=0;p=h;b:while(1){if((p|0)!=0|(f+p|0)>>>0<16){q=16-p|0;q=q>>>0>>0?q:f;i=b+144+p|0;if(!((e|i)&3))if(q>>>0>3){m=q+-4|0;n=m&-4;o=n+4|0;j=e+o|0;h=e;k=i;l=q;while(1){c[k>>2]=c[h>>2];l=l+-4|0;if(l>>>0<=3)break;else{h=h+4|0;k=k+4|0}}h=m-n|0;i=i+o|0}else{h=q;j=e}else{j=e;h=q}if(h|0)while(1){a[i>>0]=a[j>>0]|0;h=h+-1|0;if(!h)break;else{j=j+1|0;i=i+1|0}}j=e+q|0;i=f-q|0;f=q+p|0}else{j=e;i=f;f=0}if(!i){t=g;u=f;break a}switch(f|0){case 0:break;case 16:{g=wb[w&3](b,d,s,1)|0;break}default:break b}e=i>>>4;h=e<<4;if(!e){e=j;f=i;p=0;continue}f=i-h|0;g=wb[w&3](b,d,j,e)|0;if(!f){t=g;u=0;break a}else{e=j+h|0;p=0}}Ie(46625,46645,499,46658)}else{q=0;o=h;c:while(1){if((o|0)!=0|(f+o|0)>>>0<16){p=16-o|0;p=p>>>0>>0?p:f;h=b+144+o|0;if(!((e|h)&3))if(p>>>0>3){l=p+-4|0;m=l&-4;n=m+4|0;i=e+n|0;g=e;j=h;k=p;while(1){c[j>>2]=c[g>>2];k=k+-4|0;if(k>>>0<=3)break;else{g=g+4|0;j=j+4|0}}g=l-m|0;h=h+n|0}else{g=p;i=e}else{i=e;g=p}if(g|0)while(1){a[h>>0]=a[i>>0]|0;g=g+-1|0;if(!g)break;else{i=i+1|0;h=h+1|0}}i=e+p|0;f=f-p|0;g=p+o|0}else{i=e;g=0}if((f|0)==0&g>>>0<16){Yq(b+144+g|0,0,16-g|0)|0;r=33}else switch(g|0){case 0:{g=q;break}case 16:{r=33;break}default:break c}if((r|0)==33){r=0;g=wb[w&3](b,d,s,1)|0}e=f>>>4;h=e<<4;if(!e)e=i;else{g=wb[w&3](b,d,i,e)|0;e=i+h|0;f=f-h|0}if(!f){t=g;u=0;break a}else{q=g;o=0}}Ie(46625,46645,499,46658)}while(0);c[v>>2]=u;if(!t)return;Te(t);return}function hm(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0;if((c[(c[b+12>>2]|0)+20>>2]|0)!=16){g=12;return g|0}if(e>>>0>>0){g=200;return g|0}l=b+128|0;m=b+196|0;h=a[m>>0]|0;if(h&4){g=139;return g|0}i=a[b+56>>0]|0;if((i&4|h&1)<<24>>24){g=156;return g|0}if(!(i&2)){fm(b,71795,16)|0;h=a[m>>0]|0}if(!(h&2)){gm(b,l,0,0,1);h=a[m>>0]|2;a[m>>0]=h}j=b+172|0;k=(c[j>>2]|0)+g|0;c[j>>2]=k;j=b+176|0;i=c[j>>2]|0;if(k>>>0>>0){i=i+1|0;c[j>>2]=i}if(i>>>0<=15?(i|0)!=15|k>>>0<4294967265:0){gm(b,l,f,g,0);g=dm(b,d,e,f,g)|0;return g|0}a[m>>0]=h|4;g=139;return g|0}function im(a){a=a|0;var b=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;r=a+208|0;c[r>>2]=0;c[r+4>>2]=0;c[r+8>>2]=0;c[r+12>>2]=0;pb[c[(c[a+12>>2]|0)+36>>2]&63](a+496|0,r,r)|0;c[a+224>>2]=2;l=a+228|0;c[l>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;c[l+12>>2]=0;l=d[r+3>>0]|0;s=(d[r+1>>0]|0)<<16|(d[r>>0]|0)<<24|(d[r+2>>0]|0)<<8|l;e=a+356|0;c[e>>2]=s;j=d[r+7>>0]|0;r=(d[r+5>>0]|0)<<16|(d[r+4>>0]|0)<<24|(d[r+6>>0]|0)<<8|j;f=a+360|0;c[f>>2]=r;p=d[a+219>>0]|0;q=(d[a+217>>0]|0)<<16|(d[a+216>>0]|0)<<24|(d[a+218>>0]|0)<<8|p;g=a+364|0;c[g>>2]=q;n=d[a+223>>0]|0;t=(d[a+221>>0]|0)<<16|(d[a+220>>0]|0)<<24|(d[a+222>>0]|0)<<8|n;h=a+368|0;c[h>>2]=t;i=a+304|0;t=t>>>1;p=t|p<<31;c[i>>2]=p;q=q>>>1;j=q|j<<31;c[a+300>>2]=j;r=r>>>1;l=r|l<<31;c[a+296>>2]=l;s=s>>>1;n=(n&1|0?-520093696:0)^s;c[a+292>>2]=n;x=p>>>1;q=x|q<<31;c[a+272>>2]=q;u=j>>>1;r=u|r<<31;c[a+268>>2]=r;v=l>>>1;s=v|s<<31;c[a+264>>2]=s;w=n>>>1;t=(t&1|0?-520093696:0)^w;c[a+260>>2]=t;u=q>>>1|u<<31;c[a+256>>2]=u;v=r>>>1|v<<31;c[a+252>>2]=v;w=w<<31|s>>>1;c[a+248>>2]=w;x=(x&1|0?-520093696:0)^t>>>1;c[a+244>>2]=x;o=x^t;c[a+276>>2]=o;m=w^s;c[a+280>>2]=m;k=v^r;c[a+284>>2]=k;b=u^q;c[a+288>>2]=b;c[a+308>>2]=x^n;c[a+312>>2]=w^l;c[a+316>>2]=v^j;c[a+320>>2]=u^p;c[a+324>>2]=t^n;c[a+328>>2]=s^l;c[a+332>>2]=r^j;c[a+336>>2]=q^p;c[a+340>>2]=o^n;c[a+344>>2]=m^l;c[a+348>>2]=k^j;c[a+352>>2]=c[i>>2]^b;b=1;do{w=b<<2;x=w+32|0;c[a+228+(x<<2)>>2]=c[a+228+(w<<2)>>2]^c[e>>2];c[a+228+((x|1)<<2)>>2]=c[a+228+((w|1)<<2)>>2]^c[f>>2];c[a+228+((x|2)<<2)>>2]=c[a+228+((w|2)<<2)>>2]^c[g>>2];c[a+228+((x|3)<<2)>>2]=c[a+228+((w|3)<<2)>>2]^c[h>>2];b=b+1|0}while((b|0)!=8);return}function jm(b,f,g,h){b=b|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,aa=0,ba=0;Z=l;l=l+16|0;if((l|0)>=(m|0))$(16);U=Z;if(!h){Y=0;X=(Y|0)!=0;X=X?20:0;Y=X+Y|0;l=Z;return Y|0}V=f;W=f+4|0;X=U+4|0;Y=f+8|0;t=U+8|0;u=f+12|0;v=U+12|0;w=f+1|0;x=f+2|0;y=f+3|0;z=f+5|0;A=f+6|0;B=f+7|0;C=f+9|0;D=f+10|0;E=f+11|0;F=f+13|0;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762+((_<<4&240)<<1)>>1]|0)<<16^j;n=c[ba+4>>2]|0;r=c[aa+4>>2]^(i>>>8|o<<24)^(n>>>4|r<<28);o=c[ba+8>>2]|0;n=c[aa+8>>2]^(p>>>8|i<<24)^(o>>>4|n<<28);i=c[aa+12>>2]^(k>>>8|p<<24)^(o<<28|_>>>4);if(!s)break;j=s+-1|0;s=j;j=d[U+j>>0]|0;o=q;p=n;k=i;i=r}a[f>>0]=q>>>24;a[w>>0]=q>>>16;a[x>>0]=j>>>8;a[y>>0]=j;a[W>>0]=r>>>24;a[z>>0]=r>>>16;a[A>>0]=r>>>8;a[B>>0]=r;a[Y>>0]=n>>>24;a[C>>0]=n>>>16;a[D>>0]=n>>>8;a[E>>0]=n;a[u>>0]=i>>>24;a[F>>0]=i>>>16;a[G>>0]=i>>>8;a[H>>0]=i;h=h+-1|0;if(!h){g=76;break}else g=g+16|0}ba=(g|0)!=0;ba=ba?20:0;ba=ba+g|0;l=Z;return ba|0}function km(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0;if((e|0)==0&0==0)g=($q(f|0)|0)+32|0;else g=$q(e|0)|0;e=b+160|0;if((g|0)<16){b=e+(g<<4)|0;return b|0}f=e+240|0;do if((f|0)!=(d|0))if(!((f|d)&3)){c[d>>2]=c[f>>2];c[d+4>>2]=c[e+244>>2];c[d+8>>2]=c[e+248>>2];c[d+12>>2]=c[e+252>>2];break}else{a[d>>0]=a[f>>0]|0;a[d+1>>0]=a[f+1>>0]|0;a[d+2>>0]=a[f+2>>0]|0;a[d+3>>0]=a[f+3>>0]|0;a[d+4>>0]=a[e+244>>0]|0;a[d+5>>0]=a[f+5>>0]|0;a[d+6>>0]=a[f+6>>0]|0;a[d+7>>0]=a[f+7>>0]|0;a[d+8>>0]=a[e+248>>0]|0;a[d+9>>0]=a[f+9>>0]|0;a[d+10>>0]=a[f+10>>0]|0;a[d+11>>0]=a[f+11>>0]|0;a[d+12>>0]=a[e+252>>0]|0;a[d+13>>0]=a[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,47)|0;a[R>>0]=b;b=gr(Q|0,P|0,39)|0;a[O>>0]=b;b=gr(N|0,M|0,31)|0;a[L>>0]=b;b=gr(K|0,J|0,23)|0;a[I>>0]=b;b=gr(H|0,E|0,15)|0;a[G>>0]=b;b=gr(F|0,E|0,7)|0;a[C>>0]=b;a[z>>0]=B|A;b=gr(y|0,x|0,55)|0;a[w>>0]=b;b=gr(t|0,v|0,47)|0;a[u>>0]=b;b=gr(t|0,s|0,39)|0;a[r>>0]=b;b=gr(q|0,p|0,31)|0;a[o>>0]=b;b=gr(n|0,m|0,23)|0;a[l>>0]=b;b=gr(k|0,h|0,15)|0;a[j>>0]=b;b=gr(i|0,h|0,7)|0;a[g>>0]=b;a[c>>0]=f^e&135;return}function mm(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;z=l;l=l+48|0;if((l|0)>=(m|0))$(48);g=z+24|0;h=z;w=b+56|0;if(!(a[w>>0]&1)){y=156;l=z;return y|0}x=b+128|0;s=b+480|0;switch(a[s>>0]|0){case 16:case 12:case 8:break;default:{y=59;l=z;return y|0}}u=b+12|0;i=c[u>>2]|0;if((c[i+20>>2]|0)!=16){y=12;l=z;return y|0}if(!e){y=45;l=z;return y|0}if((f&-8|0)!=8){y=139;l=z;return y|0};c[g>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;c[g+12>>2]=0;v=b+496|0;t=pb[c[i+36>>2]&63](v,x,g)|0;i=b+144|0;j=i;if(!((x|j)&3)){c[i>>2]=c[x>>2];c[b+148>>2]=c[x+4>>2];c[b+152>>2]=c[b+136>>2];c[b+156>>2]=c[b+140>>2]}else{a[i>>0]=a[x>>0]|0;a[b+145>>0]=a[x+1>>0]|0;a[b+146>>0]=a[x+2>>0]|0;a[b+147>>0]=a[x+3>>0]|0;a[b+148>>0]=a[x+4>>0]|0;a[b+149>>0]=a[x+5>>0]|0;a[b+150>>0]=a[x+6>>0]|0;a[b+151>>0]=a[x+7>>0]|0;a[b+152>>0]=a[b+136>>0]|0;a[b+153>>0]=a[b+137>>0]|0;a[b+154>>0]=a[b+138>>0]|0;a[b+155>>0]=a[b+139>>0]|0;a[b+156>>0]=a[b+140>>0]|0;a[b+157>>0]=a[b+141>>0]|0;a[b+158>>0]=a[b+142>>0]|0;a[b+159>>0]=a[b+143>>0]|0}lm(i);o=b+160|0;if(!((j|o)&3)){c[o>>2]=c[i>>2];c[o+4>>2]=c[b+148>>2];c[o+8>>2]=c[b+152>>2];c[o+12>>2]=c[b+156>>2]}else{a[o>>0]=a[i>>0]|0;a[o+1>>0]=a[b+145>>0]|0;a[o+2>>0]=a[b+146>>0]|0;a[o+3>>0]=a[b+147>>0]|0;a[o+4>>0]=a[b+148>>0]|0;a[o+5>>0]=a[b+149>>0]|0;a[o+6>>0]=a[b+150>>0]|0;a[o+7>>0]=a[b+151>>0]|0;a[o+8>>0]=a[b+152>>0]|0;a[o+9>>0]=a[b+153>>0]|0;a[o+10>>0]=a[b+154>>0]|0;a[o+11>>0]=a[b+155>>0]|0;a[o+12>>0]=a[b+156>>0]|0;a[o+13>>0]=a[b+157>>0]|0;a[o+14>>0]=a[b+158>>0]|0;a[o+15>>0]=a[b+159>>0]|0}lm(o);i=1;do{j=o+(i<<4)|0;k=i+-1|0;n=o+(k<<4)|0;if(!((n|j)&3)){c[j>>2]=c[n>>2];c[o+(i<<4)+4>>2]=c[o+(k<<4)+4>>2];c[o+(i<<4)+8>>2]=c[o+(k<<4)+8>>2];c[o+(i<<4)+12>>2]=c[o+(k<<4)+12>>2]}else{a[j>>0]=a[n>>0]|0;a[o+(i<<4)+1>>0]=a[o+(k<<4)+1>>0]|0;a[o+(i<<4)+2>>0]=a[o+(k<<4)+2>>0]|0;a[o+(i<<4)+3>>0]=a[o+(k<<4)+3>>0]|0;a[o+(i<<4)+4>>0]=a[o+(k<<4)+4>>0]|0;a[o+(i<<4)+5>>0]=a[o+(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(d[e+16>>0]|0)>>>u|(v&255)<>0]&-15|2;e=b+80|0;k=e+36|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(k|0));c[i>>2]=0;c[i+4>>2]=0;c[i+8>>2]=0;c[i+12>>2]=0;c[i+16>>2]=0;c[i+20>>2]=0;c[i+24>>2]=0;c[i+28>>2]=0;a[w>>0]=j;w=b+464|0;x=x+353|0;c[w>>2]=0;c[w+4>>2]=0;c[w+8>>2]=0;c[w+12>>2]=0;a[x>>0]=a[x>>0]&-4;if(n&4){i=16;do{a[g>>0]=0;g=g+1|0;i=i+-1|0}while((i|0)!=0&(g&7|0)!=0);if(i>>>0>=8)y=34}else{i=16;y=34}if((y|0)==34){e=i+-8|0;k=e&-8;n=k+8|0;j=g;while(1){x=j;c[x>>2]=0;c[x+4>>2]=0;i=i+-8|0;if(i>>>0<=7)break;else j=j+8|0}i=e-k|0;g=g+n|0}if(i|0)while(1){a[g>>0]=0;i=i+-1|0;if(!i)break;else g=g+1|0}if(o&4){g=24;do{a[h>>0]=0;h=h+1|0;g=g+-1|0}while((g|0)!=0&(h&7|0)!=0);if(g>>>0>=8)y=42}else{g=24;y=42}if((y|0)==42){j=g+-8|0;e=j&-8;k=e+8|0;i=h;while(1){y=i;c[y>>2]=0;c[y+4>>2]=0;g=g+-8|0;if(g>>>0<=7)break;else i=i+8|0}g=j-e|0;h=h+k|0}if(g|0)while(1){a[h>>0]=0;g=g+-1|0;if(!g)break;else h=h+1|0}if(!p){y=0;l=z;return y|0}Te(p+16|0);y=0;l=z;return y|0}function nm(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return om(a,1,b,c,d,e)|0}function om(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0;Da=l;l=l+32|0;if((l|0)>=(m|0))$(32);za=Da+16|0;j=Da;va=h>>>4;Aa=b+56|0;i=a[Aa>>0]|0;if(!(i&2)){Ca=156;l=Da;return Ca|0}xa=b+128|0;Ba=xa+353|0;if(a[Ba>>0]&1){Ca=156;l=Da;return Ca|0}Ca=b+12|0;k=c[Ca>>2]|0;if((c[k+20>>2]|0)!=16){Ca=12;l=Da;return Ca|0}if(f>>>0>>0){Ca=200;l=Da;return Ca|0}if(!((h&15|0)==0|(i&8)!=0)){Ca=139;l=Da;return Ca|0}do if(va){i=c[b+40>>2]|0;wa=va<<4;if(i|0){qb[i&15](b,e,g,va,d);i=0;h=h-wa|0;g=g+wa|0;e=e+wa|0;break}ua=(d|0)!=0;p=c[(ua?k+36|0:k+40|0)>>2]|0;if(ua)pm(b+80|0,g,va);if(h>>>0>15){q=b+464|0;r=b+64|0;s=r;t=r+4|0;u=b+72|0;v=b+76|0;w=b+496|0;x=h+-16|0;sa=x&-16;ta=sa+16|0;sa=x-sa|0;x=b+72|0;y=r+4|0;z=b+76|0;A=r+1|0;B=r+2|0;C=r+3|0;E=r+4|0;F=r+5|0;G=r+6|0;H=r+7|0;I=b+72|0;J=b+73|0;K=b+74|0;L=b+75|0;M=b+76|0;N=b+77|0;O=b+78|0;P=b+79|0;Q=r+1|0;R=r+2|0;S=r+3|0;T=r+4|0;U=r+5|0;V=r+6|0;W=r+7|0;X=b+72|0;Y=b+73|0;Z=b+74|0;_=b+75|0;aa=b+76|0;ba=b+77|0;ca=b+78|0;da=b+79|0;ea=r+1|0;fa=r+2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|0;c[za>>2]=p;r=c[j+4>>2]|0;c[za+4>>2]=r;c[za+8>>2]=c[j+8>>2];c[za+12>>2]=c[j+12>>2];do if(!(g&3)){if(h>>>0<=3){k=za;f=h;ya=55;break}n=h+-4|0;o=n&-4;s=o+4|0;q=g+s|0;f=za;k=h;while(1){c[f>>2]=c[g>>2];k=k+-4|0;if(k>>>0<=3)break;else{g=g+4|0;f=f+4|0}}f=n-o|0;if(!f){g=p;f=r}else{g=q;k=za+s|0;ya=55}}else{k=za;f=h;ya=55}while(0);if((ya|0)==55){while(1){a[k>>0]=a[g>>0]|0;f=f+-1|0;if(!f)break;else{g=g+1|0;k=k+1|0;ya=55}}g=c[j>>2]|0;f=c[j+4>>2]|0}r=za+4|0;c[za>>2]=c[za>>2]^g;q=za+8|0;c[r>>2]=c[r>>2]^f;p=za+12|0;c[q>>2]=c[q>>2]^c[j+8>>2];c[p>>2]=c[p>>2]^c[j+12>>2];a[za+h>>0]=-128;if(!(e&3))if(h>>>0>3){k=h+-4|0;n=k&-4;o=n+4|0;g=za+o|0;j=za;f=e;while(1){c[f>>2]=c[j>>2];h=h+-4|0;if(h>>>0<=3)break;else{j=j+4|0;f=f+4|0}}h=k-n|0;e=e+o|0}else g=za;else g=za;if(h|0)while(1){a[e>>0]=a[g>>0]|0;h=h+-1|0;if(!h)break;else{g=g+1|0;e=e+1|0}}h=b+80|0;if(!(h&3)){Fa=h+4|0;c[h>>2]=c[h>>2]^c[za>>2];Ea=b+88|0;c[Fa>>2]=c[Fa>>2]^c[r>>2];Fa=b+92|0;c[Ea>>2]=c[Ea>>2]^c[q>>2];c[Fa>>2]=c[Fa>>2]^c[p>>2];break}else{Fa=h+1|0;a[h>>0]=a[h>>0]^a[za>>0];Ea=h+2|0;a[Fa>>0]=a[Fa>>0]^a[za+1>>0];Fa=h+3|0;a[Ea>>0]=a[Ea>>0]^a[za+2>>0];Ea=h+4|0;a[Fa>>0]=a[Fa>>0]^a[za+3>>0];Fa=h+5|0;a[Ea>>0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>2]=64;c[a+152>>2]=31;return}function pi(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;Jm(b,0,0);h=b+128|0;f=c[h>>2]|0;i=f<<6;h=gr(f|0,c[h+4>>2]|0,26)|0;e=b+144|0;j=c[e>>2]|0;g=i+j|0;f=(g>>>0>>0&1)+(h&536870848|f>>>26)|0;h=g<<3;i=f<<3|g>>>29;c[e>>2]=j+1;a[b+j>>0]=-128;d=c[e>>2]|0;if((j|0)<56){if((d|0)<56)do{c[e>>2]=d+1;a[b+d>>0]=0;d=c[e>>2]|0}while((d|0)<56)}else{if((d|0)<64)do{c[e>>2]=d+1;a[b+d>>0]=0;d=c[e>>2]|0}while((d|0)<64);Jm(b,0,0);d=b;e=d+56|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(e|0))}a[b+59>>0]=g>>>21;a[b+58>>0]=g>>>13;a[b+57>>0]=g>>>5;a[b+56>>0]=h;a[b+63>>0]=f>>>21;a[b+62>>0]=f>>>13;a[b+61>>0]=f>>>5;a[b+60>>0]=i;ri(b,b,1)|0;Te(124);j=c[b+160>>2]|0;a[b+3>>0]=j>>>24;a[b+2>>0]=j>>>16;a[b+1>>0]=j>>>8;a[b>>0]=j;j=c[b+164>>2]|0;a[b+7>>0]=j>>>24;a[b+6>>0]=j>>>16;a[b+5>>0]=j>>>8;a[b+4>>0]=j;j=c[b+168>>2]|0;a[b+11>>0]=j>>>24;a[b+10>>0]=j>>>16;a[b+9>>0]=j>>>8;a[b+8>>0]=j;j=c[b+172>>2]|0;a[b+15>>0]=j>>>24;a[b+14>>0]=j>>>16;a[b+13>>0]=j>>>8;a[b+12>>0]=j;j=c[b+176>>2]|0;a[b+19>>0]=j>>>24;a[b+18>>0]=j>>>16;a[b+17>>0]=j>>>8;a[b+16>>0]=j;return}function qi(a){a=a|0;return a|0}function ri(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,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z>>>22;S=c[k>>2]|0;F=S+aa+(da^K^D)|0;F=(F<<5|F>>>27)+H|0;da=da<<10|da>>>22;G=c[n>>2]|0;aa=aa+1352829926+G+(X^(ca|~Z))|0;aa=(aa<<13|aa>>>19)+V|0;ca=ca<<10|ca>>>22;H=H+O+(D^da^F)|0;H=(H<<8|H>>>24)+K|0;D=D<<10|D>>>22;V=Q+1352829926+V+(aa^(X|~ca))|0;V=(V<<15|V>>>17)+Z|0;X=X<<10|X>>>22;T=c[o>>2]|0;K=K+T+(F^D^H)|0;K=(K<<7|K>>>25)+da|0;F=F<<10|F>>>22;I=c[p>>2]|0;Z=I+1352829926+Z+(V^(aa|~X))|0;Z=(Z<<15|Z>>>17)+ca|0;aa=aa<<10|aa>>>22;da=da+U+(H^F^K)|0;da=(da<<9|da>>>23)+D|0;H=H<<10|H>>>22;ca=S+1352829926+ca+(Z^(V|~aa))|0;ca=(ca<<5|ca>>>27)+X|0;V=V<<10|V>>>22;W=c[q>>2]|0;D=D+W+(K^H^da)|0;D=(D<<11|D>>>21)+F|0;K=K<<10|K>>>22;P=c[r>>2]|0;X=P+1352829926+X+(ca^(Z|~V))|0;X=(X<<7|X>>>25)+aa|0;Z=Z<<10|Z>>>22;F=F+G+(da^K^D)|0;F=(F<<13|F>>>19)+H|0;da=da<<10|da>>>22;aa=T+1352829926+aa+(X^(ca|~Z))|0;aa=(aa<<7|aa>>>25)+V|0;ca=ca<<10|ca>>>22;_=c[s>>2]|0;H=H+_+(D^da^F)|0;H=(H<<14|H>>>18)+K|0;D=D<<10|D>>>22;R=c[t>>2]|0;V=R+1352829926+V+(aa^(X|~ca))|0;V=(V<<8|V>>>24)+Z|0;X=X<<10|X>>>22;K=K+I+(F^D^H)|0;K=(K<<15|K>>>17)+da|0;F=F<<10|F>>>22;Z=W+1352829926+Z+(V^(aa|~X))|0;Z=(Z<<11|Z>>>21)+ca|0;aa=aa<<10|aa>>>22;ba=c[u>>2]|0;da=da+ba+(H^F^K)|0;da=(da<<6|da>>>26)+D|0;H=H<<10|H>>>22;ca=Y+1352829926+ca+(Z^(V|~aa))|0;ca=(ca<<14|ca>>>18)+X|0;V=V<<10|V>>>22;D=D+P+(K^H^da)|0;D=(D<<7|D>>>25)+F|0;K=K<<10|K>>>22;X=_+1352829926+X+(ca^(Z|~V))|0;X=(X<<14|X>>>18)+aa|0;Z=Z<<10|Z>>>22;F=F+J+(da^K^D)|0;F=(F<<9|F>>>23)+H|0;da=da<<10|da>>>22;aa=E+1352829926+aa+(X^(ca|~Z))|0;aa=(aa<<12|aa>>>20)+V|0;ca=ca<<10|ca>>>22;H=H+R+(D^da^F)|0;H=(H<<8|H>>>24)+K|0;D=D<<10|D>>>22;V=ba+1352829926+V+(aa^(X|~ca))|0;V=(V<<6|V>>>26)+Z|0;X=X<<10|X>>>22;K=U+1518500249+K+(H&F|D&~H)|0;K=(K<<7|K>>>25)+da|0;F=F<<10|F>>>22;Z=T+1548603684+Z+(V&X|aa&~X)|0;Z=(Z<<9|Z>>>23)+ca|0;aa=aa<<10|aa>>>22;da=S+1518500249+da+(K&H|F&~K)|0;da=(da<<6|da>>>26)+D|0;H=H<<10|H>>>22;ca=I+1548603684+ca+(Z&aa|V&~aa)|0;ca=(ca<<13|ca>>>19)+X|0;V=V<<10|V>>>22;D=P+1518500249+D+(da&K|H&~da)|0;D=(D<<8|D>>>24)+F|0;K=K<<10|K>>>22;X=E+1548603684+X+(ca&V|Z&~V)|0;X=(X<<15|X>>>17)+aa|0;Z=Z<<10|Z>>>22;F=Y+1518500249+F+(D&da|K&~D)|0;F=(F<<13|F>>>19)+H|0;da=da<<10|da>>>22;aa=U+1548603684+aa+(X&Z|ca&~Z)|0;aa=(aa<<7|aa>>>25)+V|0;ca=ca<<10|ca>>>22;H=_+1518500249+H+(F&D|da&~F)|0;H=(H<<11|H>>>21)+K|0;D=D<<10|D>>>22;V=N+1548603684+V+(aa&ca|X&~ca)|0;V=(V<<12|V>>>20)+Z|0;X=X<<10|X>>>22;K=T+1518500249+K+(H&F|D&~H)|0;K=(K<<9|K>>>23)+da|0;F=F<<10|F>>>22;Z=P+1548603684+Z+(V&X|aa&~X)|0;Z=(Z<<8|Z>>>24)+ca|0;aa=aa<<10|aa>>>22;da=R+1518500249+da+(K&H|F&~K)|0;da=(da<<7|da>>>25)+D|0;H=H<<10|H>>>22;ca=O+1548603684+ca+(Z&aa|V&~aa)|0;ca=(ca<<9|ca>>>23)+X|0;V=V<<10|V>>>22;D=E+1518500249+D+(da&K|H&~da)|0;D=(D<<15|D>>>17)+F|0;K=K<<10|K>>>22;X=_+1548603684+X+(ca&V|Z&~V)|0;X=(X<<11|X>>>21)+aa|0;Z=Z<<10|Z>>>22;F=ba+1518500249+F+(D&da|K&~D)|0;F=(F<<7|F>>>25)+H|0;da=da<<10|da>>>22;aa=J+1548603684+aa+(X&Z|ca&~Z)|0;aa=(aa<<7|aa>>>25)+V|0;ca=ca<<10|ca>>>22;H=N+1518500249+H+(F&D|da&~F)|0;H=(H<<12|H>>>20)+K|0;D=D<<10|D>>>22;V=R+1548603684+V+(aa&ca|X&~ca)|0;V=(V<<7|V>>>25)+Z|0;X=X<<10|X>>>22;K=G+1518500249+K+(H&F|D&~H)|0;K=(K<<15|K>>>17)+da|0;F=F<<10|F>>>22;Z=W+1548603684+Z+(V&X|aa&~X)|0;Z=(Z<<12|Z>>>20)+ca|0;aa=aa<<10|aa>>>22;da=O+1518500249+da+(K&H|F&~K)|0;da=(da<<9|da>>>23)+D|0;H=H<<10|H>>>22;ca=ba+1548603684+ca+(Z&aa|V&~aa)|0;ca=(ca<<7|ca>>>25)+X|0;V=V<<10|V>>>22;D=Q+1518500249+D+(da&K|H&~da)|0;D=(D<<11|D>>>21)+F|0;K=K<<10|K>>>22;X=S+1548603684+X+(ca&V|Z&~V)|0;X=(X<<6|X>>>26)+aa|0;Z=Z<<10|Z>>>22;F=J+1518500249+F+(D&da|K&~D)|0;F=(F<<7|F>>>25)+H|0;da=da<<10|da>>>22;aa=G+1548603684+aa+(X&Z|ca&~Z)|0;aa=(aa<<15|aa>>>17)+V|0;ca=ca<<10|ca>>>22;H=I+1518500249+H+(F&D|da&~F)|0;H=(H<<13|H>>>19)+K|0;D=D<<10|D>>>22;V=Y+1548603684+V+(aa&ca|X&~ca)|0;V=(V<<13|V>>>19)+Z|0;X=X<<10|X>>>22;L=~H;K=W+1518500249+K+(H&F|D&L)|0;K=(K<<12|K>>>20)+da|0;F=F<<10|F>>>22;Z=Q+1548603684+Z+(V&X|aa&~X)|0;Z=(Z<<11|Z>>>21)+ca|0;aa=aa<<10|aa>>>22;L=E+1859775393+da+((K|L)^F)|0;L=(L<<11|L>>>21)+D|0;H=H<<10|H>>>22;ca=R+1836072691+ca+((Z|~V)^aa)|0;ca=(ca<<9|ca>>>23)+X|0;V=V<<10|V>>>22;D=_+1859775393+D+((L|~K)^H)|0;D=(D<<13|D>>>19)+F|0;K=K<<10|K>>>22;X=O+1836072691+X+((ca|~Z)^V)|0;X=(X<<7|X>>>25)+aa|0;Z=Z<<10|Z>>>22;F=J+1859775393+F+((D|~L)^K)|0;F=(F<<6|F>>>26)+H|0;L=L<<10|L>>>22;aa=Y+1836072691+aa+((X|~ca)^Z)|0;aa=(aa<<15|aa>>>17)+V|0;ca=ca<<10|ca>>>22;H=S+1859775393+H+((F|~D)^L)|0;H=(H<<7|H>>>25)+K|0;D=D<<10|D>>>22;V=E+1836072691+V+((aa|~X)^ca)|0;V=(V<<11|V>>>21)+Z|0;X=X<<10|X>>>22;K=G+1859775393+K+((H|~F)^D)|0;K=(K<<14|K>>>18)+L|0;F=F<<10|F>>>22;Z=U+1836072691+Z+((V|~aa)^X)|0;Z=(Z<<8|Z>>>24)+ca|0;aa=aa<<10|aa>>>22;L=R+1859775393+L+((K|~H)^F)|0;L=(L<<9|L>>>23)+D|0;H=H<<10|H>>>22;ca=J+1836072691+ca+((Z|~V)^aa)|0;ca=(ca<<6|ca>>>26)+X|0;V=V<<10|V>>>22;D=W+1859775393+D+((L|~K)^H)|0;D=(D<<13|D>>>19)+F|0;K=K<<10|K>>>22;X=T+1836072691+X+((ca|~Z)^V)|0;X=(X<<6|X>>>26)+aa|0;Z=Z<<10|Z>>>22;F=Y+1859775393+F+((D|~L)^K)|0;F=(F<<15|F>>>17)+H|0;L=L<<10|L>>>22;aa=G+1836072691+aa+((X|~ca)^Z)|0;aa=(aa<<14|aa>>>18)+V|0;ca=ca<<10|ca>>>22;H=Q+1859775393+H+((F|~D)^L)|0;H=(H<<14|H>>>18)+K|0;D=D<<10|D>>>22;V=I+1836072691+V+((aa|~X)^ca)|0;V=(V<<12|V>>>20)+Z|0;X=X<<10|X>>>22;K=U+1859775393+K+((H|~F)^D)|0;K=(K<<8|K>>>24)+L|0;F=F<<10|F>>>22;Z=W+1836072691+Z+((V|~aa)^X)|0;Z=(Z<<13|Z>>>19)+ca|0;aa=aa<<10|aa>>>22;L=N+1859775393+L+((K|~H)^F)|0;L=(L<<13|L>>>19)+D|0;H=H<<10|H>>>22;ca=ba+1836072691+ca+((Z|~V)^aa)|0;ca=(ca<<5|ca>>>27)+X|0;V=V<<10|V>>>22;D=T+1859775393+D+((L|~K)^H)|0;D=(D<<6|D>>>26)+F|0;K=K<<10|K>>>22;X=Q+1836072691+X+((ca|~Z)^V)|0;X=(X<<14|X>>>18)+aa|0;Z=Z<<10|Z>>>22;F=P+1859775393+F+((D|~L)^K)|0;F=(F<<5|F>>>27)+H|0;L=L<<10|L>>>22;aa=_+1836072691+aa+((X|~ca)^Z)|0;aa=(aa<<13|aa>>>19)+V|0;ca=ca<<10|ca>>>22;H=I+1859775393+H+((F|~D)^L)|0;H=(H<<12|H>>>20)+K|0;D=D<<10|D>>>22;V=N+1836072691+V+((aa|~X)^ca)|0;V=(V<<13|V>>>19)+Z|0;X=X<<10|X>>>22;K=O+1859775393+K+((H|~F)^D)|0;K=(K<<7|K>>>25)+L|0;F=F<<10|F>>>22;Z=S+1836072691+Z+((V|~aa)^X)|0;Z=(Z<<7|Z>>>25)+ca|0;aa=aa<<10|aa>>>22;L=ba+1859775393+L+((K|~H)^F)|0;L=(L<<5|L>>>27)+D|0;H=H<<10|H>>>22;ca=P+1836072691+ca+((Z|~V)^aa)|0;ca=(ca<<5|ca>>>27)+X|0;V=V<<10|V>>>22;D=Y+-1894007588+D+(L&H|K&~H)|0;D=(D<<11|D>>>21)+F|0;K=K<<10|K>>>22;X=W+2053994217+X+(ca&Z|V&~ca)|0;X=(X<<15|X>>>17)+aa|0;Z=Z<<10|Z>>>22;F=G+-1894007588+F+(D&K|L&~K)|0;F=(F<<12|F>>>20)+H|0;L=L<<10|L>>>22;aa=T+2053994217+aa+(X&ca|Z&~X)|0;aa=(aa<<5|aa>>>27)+V|0;ca=ca<<10|ca>>>22;H=I+-1894007588+H+(F&L|D&~L)|0;H=(H<<14|H>>>18)+K|0;D=D<<10|D>>>22;V=S+2053994217+V+(aa&X|ca&~aa)|0;V=(V<<8|V>>>24)+Z|0;X=X<<10|X>>>22;K=_+-1894007588+K+(H&D|F&~D)|0;K=(K<<15|K>>>17)+L|0;F=F<<10|F>>>22;Z=Y+2053994217+Z+(V&aa|X&~V)|0;Z=(Z<<11|Z>>>21)+ca|0;aa=aa<<10|aa>>>22;L=N+-1894007588+L+(K&F|H&~F)|0;L=(L<<14|L>>>18)+D|0;H=H<<10|H>>>22;ca=E+2053994217+ca+(Z&V|aa&~Z)|0;ca=(ca<<14|ca>>>18)+X|0;V=V<<10|V>>>22;D=W+-1894007588+D+(L&H|K&~H)|0;D=(D<<15|D>>>17)+F|0;K=K<<10|K>>>22;X=I+2053994217+X+(ca&Z|V&~ca)|0;X=(X<<14|X>>>18)+aa|0;Z=Z<<10|Z>>>22;F=ba+-1894007588+F+(D&K|L&~K)|0;F=(F<<9|F>>>23)+H|0;L=L<<10|L>>>22;aa=R+2053994217+aa+(X&ca|Z&~X)|0;aa=(aa<<6|aa>>>26)+V|0;ca=ca<<10|ca>>>22;H=S+-1894007588+H+(F&L|D&~L)|0;H=(H<<8|H>>>24)+K|0;D=D<<10|D>>>22;V=N+2053994217+V+(aa&X|ca&~aa)|0;V=(V<<14|V>>>18)+Z|0;X=X<<10|X>>>22;K=P+-1894007588+K+(H&D|F&~D)|0;K=(K<<9|K>>>23)+L|0;F=F<<10|F>>>22;Z=O+2053994217+Z+(V&aa|X&~V)|0;Z=(Z<<6|Z>>>26)+ca|0;aa=aa<<10|aa>>>22;L=E+-1894007588+L+(K&F|H&~F)|0;L=(L<<14|L>>>18)+D|0;H=H<<10|H>>>22;ca=ba+2053994217+ca+(Z&V|aa&~Z)|0;ca=(ca<<9|ca>>>23)+X|0;V=V<<10|V>>>22;D=U+-1894007588+D+(L&H|K&~H)|0;D=(D<<5|D>>>27)+F|0;K=K<<10|K>>>22;X=Q+2053994217+X+(ca&Z|V&~ca)|0;X=(X<<12|X>>>20)+aa|0;Z=Z<<10|Z>>>22;F=R+-1894007588+F+(D&K|L&~K)|0;F=(F<<6|F>>>26)+H|0;L=L<<10|L>>>22;aa=P+2053994217+aa+(X&ca|Z&~X)|0;aa=(aa<<9|aa>>>23)+V|0;ca=ca<<10|ca>>>22;H=J+-1894007588+H+(F&L|D&~L)|0;H=(H<<8|H>>>24)+K|0;D=D<<10|D>>>22;V=G+2053994217+V+(aa&X|ca&~aa)|0;V=(V<<12|V>>>20)+Z|0;X=X<<10|X>>>22;K=O+-1894007588+K+(H&D|F&~D)|0;K=(K<<6|K>>>26)+L|0;F=F<<10|F>>>22;Z=U+2053994217+Z+(V&aa|X&~V)|0;Z=(Z<<5|Z>>>27)+ca|0;aa=aa<<10|aa>>>22;L=T+-1894007588+L+(K&F|H&~F)|0;L=(L<<5|L>>>27)+D|0;H=H<<10|H>>>22;ca=_+2053994217+ca+(Z&V|aa&~Z)|0;ca=(ca<<15|ca>>>17)+X|0;V=V<<10|V>>>22;D=Q+-1894007588+D+(L&H|K&~H)|0;D=(D<<12|D>>>20)+F|0;K=K<<10|K>>>22;X=J+2053994217+X+(ca&Z|V&~ca)|0;X=(X<<8|X>>>24)+aa|0;Z=Z<<10|Z>>>22;F=S+-1454113458+F+(D^(L|~K))|0;F=(F<<9|F>>>23)+H|0;L=L<<10|L>>>22;aa=aa+ba+(ca^Z^X)|0;aa=(aa<<8|aa>>>24)+V|0;ca=ca<<10|ca>>>22;H=N+-1454113458+H+(F^(D|~L))|0;H=(H<<15|H>>>17)+K|0;D=D<<10|D>>>22;V=V+R+(X^ca^aa)|0;V=(V<<5|V>>>27)+Z|0;X=X<<10|X>>>22;K=O+-1454113458+K+(H^(F|~D))|0;K=(K<<5|K>>>27)+L|0;F=F<<10|F>>>22;Z=Z+_+(aa^X^V)|0;Z=(Z<<12|Z>>>20)+ca|0;aa=aa<<10|aa>>>22;L=G+-1454113458+L+(K^(H|~F))|0;L=(L<<11|L>>>21)+D|0;H=H<<10|H>>>22;S=ca+S+(V^aa^Z)|0;S=(S<<9|S>>>23)+X|0;V=V<<10|V>>>22;D=U+-1454113458+D+(L^(K|~H))|0;D=(D<<6|D>>>26)+F|0;K=K<<10|K>>>22;X=X+Y+(Z^V^S)|0;X=(X<<12|X>>>20)+aa|0;Z=Z<<10|Z>>>22;F=ba+-1454113458+F+(D^(L|~K))|0;F=(F<<8|F>>>24)+H|0;L=L<<10|L>>>22;O=aa+O+(S^Z^X)|0;O=(O<<5|O>>>27)+V|0;S=S<<10|S>>>22;H=Q+-1454113458+H+(F^(D|~L))|0;H=(H<<13|H>>>19)+K|0;D=D<<10|D>>>22;V=V+W+(X^S^O)|0;V=(V<<14|V>>>18)+Z|0;X=X<<10|X>>>22;K=_+-1454113458+K+(H^(F|~D))|0;K=(K<<12|K>>>20)+L|0;F=F<<10|F>>>22;U=Z+U+(O^X^V)|0;U=(U<<6|U>>>26)+S|0;O=O<<10|O>>>22;L=J+-1454113458+L+(K^(H|~F))|0;L=(L<<5|L>>>27)+D|0;H=H<<10|H>>>22;S=S+T+(V^O^U)|0;S=(S<<8|S>>>24)+X|0;V=V<<10|V>>>22;D=Y+-1454113458+D+(L^(K|~H))|0;D=(D<<12|D>>>20)+F|0;K=K<<10|K>>>22;Q=X+Q+(U^V^S)|0;Q=(Q<<13|Q>>>19)+O|0;U=U<<10|U>>>22;F=E+-1454113458+F+(D^(L|~K))|0;F=(F<<13|F>>>19)+H|0;L=L<<10|L>>>22;O=O+P+(S^U^Q)|0;O=(O<<6|O>>>26)+V|0;S=S<<10|S>>>22;H=W+-1454113458+H+(F^(D|~L))|0;H=(H<<14|H>>>18)+K|0;D=D<<10|D>>>22;J=V+J+(Q^S^O)|0;J=(J<<5|J>>>27)+U|0;Q=Q<<10|Q>>>22;K=I+-1454113458+K+(H^(F|~D))|0;K=(K<<11|K>>>21)+L|0;F=F<<10|F>>>22;N=U+N+(O^Q^J)|0;N=(N<<15|N>>>17)+S|0;O=O<<10|O>>>22;L=T+-1454113458+L+(K^(H|~F))|0;L=(L<<8|L>>>24)+D|0;H=H<<10|H>>>22;E=S+E+(J^O^N)|0;E=(E<<13|E>>>19)+Q|0;J=J<<10|J>>>22;D=R+-1454113458+D+(L^(K|~H))|0;D=(D<<5|D>>>27)+F|0;K=K<<10|K>>>22;G=Q+G+(N^J^E)|0;G=(G<<11|G>>>21)+O|0;N=N<<10|N>>>22;F=P+-1454113458+F+(D^(L|~K))|0;I=O+I+(E^N^G)|0;c[z>>2]=N+M+(L<<10|L>>>22);c[A>>2]=J+(c[B>>2]|0)+K;c[B>>2]=H+(c[v>>2]|0)+J+(I<<11|I>>>21);c[v>>2]=H+(c[y>>2]|0)+G+(F<<6|F>>>26);c[y>>2]=(E<<10|E>>>22)+a+D;e=e+-1|0;if(!e)break;else b=b+64|0}l=C;return 124}function si(a){a=a|0;var b=0;c[a+160>>2]=1732584193;c[a+164>>2]=-271733879;c[a+168>>2]=-1732584194;c[a+172>>2]=271733878;c[a+176>>2]=-1009589776;b=a+128|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[a+148>>2]=64;c[a+152>>2]=31;return}function ti(a,b){a=a|0;b=b|0;ri(a,b,1)|0;c[b>>2]=c[a+160>>2];c[b+4>>2]=c[a+164>>2];c[b+8>>2]=c[a+168>>2];c[b+12>>2]=c[a+172>>2];c[b+16>>2]=c[a+176>>2];return}function ui(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;f=l;l=l+192|0;if((l|0)>=(m|0))$(192);g=f;c[g+160>>2]=1732584193;c[g+164>>2]=-271733879;c[g+168>>2]=-1732584194;c[g+172>>2]=271733878;c[g+176>>2]=-1009589776;h=g+128|0;c[h>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;c[h+12>>2]=0;c[h+16>>2]=0;c[g+148>>2]=64;c[g+152>>2]=31;Jm(g,d,e);pi(g);d=g;e=b+20|0;do{a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0}while((b|0)<(e|0));l=f;return}function vi(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+16|0;if((l|0)>=(m|0))$(16);r=s;p=(d+7|0)>>>3;c[r>>2]=p;if(!((p|0)!=0&(f+7|0)>>>0<=p>>>0)){b=66;l=s;return b|0}q=$e(p)|0;if(!q){b=Sn()|0;l=s;return b|0}a[q>>0]=0;a[q+1>>0]=2;d=-3-f+p|0;if((d|0)<=0)Ie(38682,38688,95,38701);if(!g){o=Cj(d,1)|0;while(1){g=0;h=0;do{g=((a[o+h>>0]|0)==0&1)+g|0;h=h+1|0}while((h|0)!=(d|0));if(!g)break;g=g+3+((g|0)/128|0)|0;n=Cj(g,1)|0;if(g|0){k=0;do{i=o+k|0;h=a[i>>0]|0;j=g+-1|0;if(!(h<<24>>24)){h=a[n+j>>0]|0;a[i>>0]=h;g=j}k=(h<<24>>24!=0&1)+k|0}while((k|0)<(d|0)&(g|0)!=0)}cf(n)}cr(q+2|0,o|0,d|0)|0;cf(o)}else{if((d|0)!=(h|0)){cf(q);b=45;l=s;return b|0}a:do if(h|0){d=0;while(1){if(!(a[g+d>>0]|0))break;d=d+1|0;if(d>>>0>=h>>>0)break a}cf(q);b=45;l=s;return b|0}while(0);cr(q+2|0,g|0,h|0)|0;d=h}o=d+3|0;a[q+(d+2)>>0]=0;cr(q+o|0,e|0,f|0)|0;if((o+f|0)!=(p|0))Ie(38732,38688,153,38701);d=Sk(b,5,q,p,r)|0;if((d|0)==0?nf(1)|0:0)Se(38744,c[b>>2]|0);cf(q);b=d;l=s;return b|0}function wi(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;i=l;l=l+16|0;if((l|0)>=(m|0))$(16);h=i;e=(e+7|0)>>>3;c[b>>2]=0;g=$e(e)|0;if(!g){h=Sn()|0;l=i;return h|0}e=Tk(5,g,e,h,f)|0;if(e|0){cf(g);h=e&65535;l=i;return h|0}f=c[h>>2]|0;if(f>>>0<4){cf(g);h=155;l=i;return h|0}j=(a[g>>0]|0)==0;e=j?2:1;c[h>>2]=e;if((a[g+(j&1)>>0]|0)!=2){cf(g);j=155;l=i;return j|0}a:do if(e>>>0>>0)do{if(!(a[g+e>>0]|0))break a;e=e+1|0;c[h>>2]=e}while(e>>>0>>0);while(0);e=e+1|0;if(f>>>0<=e>>>0){cf(g);j=155;l=i;return j|0}c[h>>2]=e;j=f-e|0;dr(g|0,g+e|0,j|0)|0;c[b>>2]=g;c[d>>2]=j;if(!(nf(1)|0)){j=0;l=i;return j|0}Qe(38777,c[b>>2]|0,c[d>>2]|0);j=0;l=i;return j|0}function xi(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0;p=l;l=l+112|0;if((l|0)>=(m|0))$(112);n=p+8|0;o=p+4|0;h=p;k=(d+7|0)>>>3;c[o>>2]=k;c[h>>2]=100;d=sh(g)|0;if(th(g,10,n,h)|0){b=69;l=p;return b|0}if((d|0)!=(f|0)){b=70;l=p;return b|0}if(!f){b=66;l=p;return b|0}if((f+4+(c[h>>2]|0)|0)>>>0>k>>>0){b=66;l=p;return b|0}j=_e(k)|0;if(!j){b=Sn()|0;l=p;return b|0}a[j>>0]=0;a[j+1>>0]=1;i=k-f|0;d=c[h>>2]|0;g=i-d|0;h=g+-3|0;if((h|0)<=1)Ie(38831,38688,303,38837);Yq(j+2|0,-1,h|0)|0;a[j+(g+-1)>>0]=0;cr(j+g|0,n|0,d|0)|0;cr(j+i|0,e|0,f|0)|0;d=Sk(b,5,j,k,o)|0;if((d|0)==0?nf(1)|0:0)Se(38868,c[b>>2]|0);cf(j);b=d;l=p;return b|0}function yi(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;if((l|0)>=(m|0))$(16);i=k;h=(d+7|0)>>>3;c[i>>2]=h;if((f|0)==0|(f+4|0)>>>0>h>>>0){j=66;l=k;return j|0}j=_e(h)|0;if(!j){j=Sn()|0;l=k;return j|0}a[j>>0]=0;a[j+1>>0]=1;d=h-f|0;g=d+-3|0;if((g|0)<=1)Ie(38831,38688,368,38901);Yq(j+2|0,-1,g|0)|0;a[j+(d+-1)>>0]=0;cr(j+d|0,e|0,f|0)|0;d=Sk(b,5,j,h,i)|0;if(!d)if(!(nf(1)|0))d=0;else{Se(38868,c[b>>2]|0);d=0}else d=d&65535;cf(j);j=d;l=k;return j|0}function zi(b,d,e,f,g,h,i,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0;o=(d+7|0)>>>3;c[b>>2]=0;d=(h|0)!=0&(i|0)!=0;m=sh(e)|0;if(!(o|0?(o+-2-(m<<1)|0)>>>0>=g>>>0:0)){b=66;return b|0}p=ef(1,o)|0;if(!p){b=Sn()|0;return b|0}l=p+1|0;n=l+m|0;oh(e,n,d?h:71847,d?i:0);i=p+(o+-1-g)|0;a[i>>0]=1;cr(i+1|0,f|0,g|0)|0;do if(!j)Dj(l,m,1);else{if((m|0)==(k|0)){cr(l|0,j|0,k|0)|0;break}cf(p);b=45;return b|0}while(0);h=o-m+-1|0;g=$e(h)|0;if(!g){b=Sn()|0;cf(p);return b|0}d=Ai(g,h,l,m,e)|0;if(d|0){cf(g);cf(p);b=d;return b|0}i=m+1|0;if(i>>>0>>0){d=i;f=g;while(1){l=p+d|0;a[l>>0]=a[l>>0]^a[f>>0];d=d+1|0;if((d|0)==(o|0))break;else f=f+1|0}}cf(g);g=$e(m)|0;if(!g){b=Sn()|0;cf(p);return b|0}d=Ai(g,m,n,h,e)|0;if(d|0){cf(g);cf(p);b=d;return b|0}if(i>>>0>1){d=1;f=g;while(1){e=p+d|0;a[e>>0]=a[e>>0]^a[f>>0];d=d+1|0;if((d|0)==(i|0))break;else f=f+1|0}}cf(g);d=Sk(b,5,p,o,0)|0;if((d|0)==0?nf(1)|0:0)Se(38936,c[b>>2]|0);cf(p);b=d;return b|0}function Ai(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;q=l;l=l+16|0;if((l|0)>=(m|0))$(16);o=q;p=q+4|0;h=eh(o,g,0)|0;if(h|0){p=h;l=q;return p|0}n=sh(g)|0;if(d|0){i=p+1|0;j=p+2|0;k=p+3|0;g=0;h=0;while(1){if(h|0)ih(c[o>>2]|0);a[p>>0]=h>>>24;a[i>>0]=h>>>16;a[j>>0]=h>>>8;a[k>>0]=h;lh(c[o>>2]|0,e,f);lh(c[o>>2]|0,p,4);s=ph(c[o>>2]|0,0)|0;r=d-g|0;r=r>>>0>>0?r:n;cr(b+g|0,s|0,r|0)|0;g=r+g|0;if(g>>>0>=d>>>0)break;else h=h+1|0}}kh(c[o>>2]|0);s=0;l=q;return s|0}function Bi(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;r=l;l=l+16|0;if((l|0)>=(m|0))$(16);q=r;c[q>>2]=0;j=(e+7|0)>>>3;c[b>>2]=0;k=(h|0)!=0&(i|0)!=0;e=sh(f)|0;p=_e(e)|0;if(!p){q=Sn()|0;l=r;return q|0}oh(f,p,k?h:71847,k?i:0);if(Vk(q,0,g,j)|0){cf(p);q=155;l=r;return q|0}if(j>>>0<((e<<1)+2|0)>>>0){cf(c[q>>2]|0);cf(p);q=155;l=r;return q|0}j=j+-1|0;n=$e(j)|0;if(!n){d=Sn()|0;cf(c[q>>2]|0);cf(p);q=d;l=r;return q|0}o=n+e|0;k=(c[q>>2]|0)+1|0;g=k+e|0;i=j-e|0;h=(Ai(n,e,g,i,f)|0)!=0&1;if(e|0){j=0;do{s=n+j|0;a[s>>0]=a[s>>0]^a[k+j>>0];j=j+1|0}while((j|0)!=(e|0))}k=Ai(o,i,n,e,f)|0;if(i|0){j=0;do{s=o+j|0;a[s>>0]=a[s>>0]^a[g+j>>0];j=j+1|0}while((j|0)!=(i|0))}j=Tp(p,o,e)|0;a:do if(e>>>0>>0)do{if((a[o+e>>0]|0)==1)break a;e=e+1|0}while(e>>>0>>0);while(0);s=(a[c[q>>2]>>0]|0)==0;cf(p);cf(c[q>>2]|0);if(!((k|h|j|0)==0&(e|0)!=(i|0)&s)){cf(n);s=155;l=r;return s|0}q=e+1|0;s=i-q|0;dr(n|0,o+q|0,s|0)|0;c[b>>2]=n;c[d>>2]=s;if(!(nf(1)|0)){s=0;l=r;return s|0}Qe(38954,c[b>>2]|0,c[d>>2]|0);s=0;l=r;return s|0}function Ci(b,e,f,g,h,i,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;n=(e+7|0)>>>3;l=sh(f)|0;if(!l)Ie(38993,38688,800,38998);q=i+8+l|0;t=n-l+-1|0;m=q+t|0;v=_e(m)|0;if(!v){v=Sn()|0;return v|0}p=v+8|0;r=p+l|0;o=r+i|0;do if((l|0)==(h|0)){cr(p|0,g|0,h|0)|0;if(n>>>0<(i+2+h|0)>>>0)o=66;else{u=_e(n)|0;if(!u){o=Sn()|0;break}p=u+n+-1+(0-h)|0;do if(i){if(!j){Dj(r,i,1);s=14;break}if((k|0)==(i|0)){cr(r|0,j|0,i|0)|0;s=14;break}else{o=45;l=u;break}}else s=14;while(0);if((s|0)==14){s=v;l=s;a[l>>0]=0;a[l+1>>0]=0;a[l+2>>0]=0;a[l+3>>0]=0;s=s+4|0;a[s>>0]=0;a[s+1>>0]=0;a[s+2>>0]=0;a[s+3>>0]=0;oh(f,p,v,q);s=p+(0-i)+-1|0;l=u;Yq(u|0,0,s-l|0)|0;a[s>>0]=1;cr(s+1|0,r|0,i|0)|0;Ai(o,t,p,h,f)|0;if(t|0){p=0;while(1){s=u+p|0;a[s>>0]=a[s>>0]^a[o>>0];p=p+1|0;if((p|0)==(t|0))break;else o=o+1|0}}a[u>>0]=(d[u>>0]|0)&255>>>((n<<3)-e|0);a[u+(n+-1)>>0]=-68;o=Sk(b,5,u,n,0)|0;if(!o)if(!(nf(1)|0))o=0;else{Se(39019,c[b>>2]|0);o=0}}if((n|0)!=0&(l&7|0)!=0){l=u;do{a[l>>0]=0;l=l+1|0;n=n+-1|0}while((n|0)!=0&(l&7|0)!=0)}else l=u;if(n>>>0>=8){g=n+-8|0;q=g&-8;j=q+8|0;p=l;while(1){b=p;c[b>>2]=0;c[b+4>>2]=0;n=n+-8|0;if(n>>>0<=7)break;else p=p+8|0}n=g-q|0;l=l+j|0}if(n|0)while(1){a[l>>0]=0;n=n+-1|0;if(!n)break;else l=l+1|0}cf(u)}}else o=139;while(0);if((m|0)!=0&(v&7|0)!=0){l=v;do{a[l>>0]=0;l=l+1|0;m=m+-1|0}while((m|0)!=0&(l&7|0)!=0)}else l=v;if(m>>>0>=8){p=m+-8|0;g=p&-8;q=g+8|0;n=l;while(1){u=n;c[u>>2]=0;c[u+4>>2]=0;m=m+-8|0;if(m>>>0<=7)break;else n=n+8|0}m=p-g|0;l=l+q|0}if(m|0)while(1){a[l>>0]=0;m=m+-1|0;if(!m)break;else l=l+1|0}cf(v);v=o;return v|0}function Di(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;x=l;l=l+16|0;if((l|0)>=(m|0))$(16);v=x;c[v>>2]=0;j=(f+7|0)>>>3;s=sh(g)|0;if(!s)Ie(38993,38688,926,39036);q=h+8+s|0;n=j-s|0;o=n+-1|0;i=(q>>>0>>0?o:q)+s|0;w=_e(i)|0;u=(w|0)!=0;if(u){k=0-s|0;r=w+i+k|0;b=Vk(0,r,b,s)|0;if(!b){b=Vk(v,0,e,j)|0;if(!b)if(j>>>0>=(h+2+s|0)>>>0){b=c[v>>2]|0;if((a[b+(j+-1)>>0]|0)==-68){p=b+j+-1+k|0;k=255>>>((j<<3)-f|0);if(!(d[b>>0]&~k)){Ai(w,o,p,s,g)|0;if(o|0){b=w;e=0;while(1){f=(c[v>>2]|0)+e|0;a[f>>0]=a[f>>0]^a[b>>0];e=e+1|0;if((e|0)==(o|0))break;else b=b+1|0}}f=c[v>>2]|0;a[f>>0]=d[f>>0]&k;k=n-h|0;f=k+-2|0;a:do if(!f)b=0;else{e=c[v>>2]|0;b=0;do{if(a[e+b>>0]|0)break a;b=b+1|0}while(b>>>0>>0)}while(0);if((b|0)==(f|0)){b=c[v>>2]|0;if((a[b+f>>0]|0)==1){t=w;o=t;a[o>>0]=0;a[o+1>>0]=0;a[o+2>>0]=0;a[o+3>>0]=0;t=t+4|0;a[t>>0]=0;a[t+1>>0]=0;a[t+2>>0]=0;a[t+3>>0]=0;t=w+8|0;cr(t|0,r|0,s|0)|0;cr(t+s|0,b+(k+-1)|0,h|0)|0;oh(g,w,w,q);b=(Tp(p,w,s)|0)!=0;b=b?8:0;t=19}else o=8}else{b=8;t=19}}else{b=8;t=19}}else o=8}else{b=66;t=19}else t=19}else t=19}else{b=Sn()|0;t=19}if((t|0)==19){o=b;b=c[v>>2]|0}if(b|0){if((j|0)!=0&(b&7|0)!=0)do{a[b>>0]=0;b=b+1|0;j=j+-1|0}while((j|0)!=0&(b&7|0)!=0);if(j>>>0>=8){k=j+-8|0;f=k&-8;n=f+8|0;e=b;while(1){t=e;c[t>>2]=0;c[t+4>>2]=0;j=j+-8|0;if(j>>>0<=7)break;else e=e+8|0}j=k-f|0;b=b+n|0}if(j|0)while(1){a[b>>0]=0;j=j+-1|0;if(!j)break;else b=b+1|0}cf(c[v>>2]|0)}if(!u){l=x;return o|0}if((i|0)!=0&(w&7|0)!=0){b=w;do{a[b>>0]=0;b=b+1|0;i=i+-1|0}while((i|0)!=0&(b&7|0)!=0)}else b=w;if(i>>>0>=8){e=i+-8|0;k=e&-8;f=k+8|0;j=b;while(1){v=j;c[v>>2]=0;c[v+4>>2]=0;i=i+-8|0;if(i>>>0<=7)break;else j=j+8|0}i=e-k|0;b=b+f|0}if(i|0)while(1){a[b>>0]=0;i=i+-1|0;if(!i)break;else b=b+1|0}cf(w);l=x;return o|0}function Ei(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;F=l;l=l+176|0;if((l|0)>=(m|0))$(176);C=F+8|0;A=F;s=F+164|0;t=F+160|0;u=F+156|0;v=F+152|0;w=F+148|0;x=F+144|0;n=F+88|0;i=F+84|0;k=F+80|0;D=F+56|0;j=F+48|0;E=F+44|0;c[j>>2]=0;c[E>>2]=0;c[D>>2]=0;c[D+4>>2]=0;c[D+8>>2]=0;c[D+12>>2]=0;c[D+16>>2]=0;c[D+20>>2]=0;e=Fh(a,i)|0;if(e|0){E=e;l=F;return E|0}e=Gh(a,k)|0;if(e|0){E=e;l=F;return E|0}e=uf(a,46885,0)|0;if(e|0?(f=Eh(e,j,0)|0,sf(e),f|0):0){E=f;l=F;return E|0}if((a|0)!=0?(g=uf(a,41502,0)|0,(g|0)!=0):0){z=g;B=11}else B=7;do if((B|0)==7){e=uf(a,41515,0)|0;if(e|0){c[j>>2]=c[j>>2]|64;sf(e)}if((c[j>>2]&64|0)==0?(gg()|0)==0:0){if((c[j>>2]&32|0)==0?(h=uf(a,48632,0)|0,h|0):0){c[j>>2]=c[j>>2]|32;sf(h)}e=c[i>>2]|0;f=c[k>>2]|0;d=(c[j>>2]|0)>>>5&1;if(gg()|0?!(e>>>0>1023&(d|0)==0):0){d=55;break}a=2-d|0;q=(e&1)+e|0;d=(f|0)==1?65537:f;p=ll(1)|0;if(!d){El(p,41)|0;g=Hl(q)|0;f=q>>>1;e=0;d=0;do{if(e|0)Jl(e);if(d|0)Jl(d);e=yh(f,a,0,0)|0;d=yh(f,a,0,0)|0;if((wk(e,d)|0)>0)Fl(e,d);Kk(g,e,d)}while((lk(g)|0)!=(q|0));f=0}else{El(p,d|1)|0;g=Hl(q)|0;f=q>>>1;e=0;d=0;do{if(e|0)Jl(e);if(d|0)Jl(d);e=yh(f,a,6,p)|0;d=yh(f,a,6,p)|0;if((wk(e,d)|0)>0)Fl(e,d);Kk(g,e,d)}while((lk(g)|0)!=(q|0));f=1}h=e+4|0;a=nl(c[h>>2]|0)|0;h=nl(c[h>>2]|0)|0;i=Il(q)|0;j=Il(q)|0;k=Il(q)|0;gk(a,e,1);gk(h,d,1);Kk(i,a,h);Ek(j,a,h)|0;Bk(k,i,j);if(!(Ek(a,p,i)|0))if(f)He(41560,287,41812);else do ek(p,p,2);while(!(Ek(a,p,i)|0));n=Il(q)|0;Fk(n,p,k)|0;o=Il(q)|0;Fk(o,e,d)|0;if(nf(1)|0){Se(41825,e);Se(41831,d);Se(41837,i);Se(41843,j);Se(41849,k);Se(41855,g);Se(41861,p);Se(41867,n);Se(41873,o)}Jl(a);Jl(h);Jl(i);Jl(k);Jl(j);c[D>>2]=g;h=D+4|0;c[h>>2]=p;g=D+12|0;c[g>>2]=e;f=D+16|0;c[f>>2]=d;a=D+8|0;c[a>>2]=n;d=D+20|0;c[d>>2]=o;if(!(Oi(D,q+-64|0)|0)){e=D;B=86}else{Jl(c[D>>2]|0);c[D>>2]=0;Jl(c[h>>2]|0);c[h>>2]=0;Jl(c[g>>2]|0);c[g>>2]=0;Jl(c[f>>2]|0);c[f>>2]=0;Jl(c[a>>2]|0);c[a>>2]=0;Jl(c[d>>2]|0);c[d>>2]=0;kg(41560,334,41812,0,41745);d=50}}else{z=0;B=11}}while(0);if((B|0)==11){y=c[i>>2]|0;k=c[k>>2]|0;k=(k|0)==1?65537:k;if(!(y>>>0<1024|(y&255|0)!=0|k>>>0<3|(k&1|0)==0)){c[s>>2]=0;c[t>>2]=0;c[u>>2]=0;c[v>>2]=0;c[w>>2]=0;c[x>>2]=0;a:do if(!z){e=y>>>1;f=Il(e)|0;Kl(f,e,2);g=e+-1|0;ok(f,g);a=e+-2|0;nk(f,a);if((lk(f)|0)!=(e|0))Ie(41524,41560,360,41566);c[u>>2]=f;h=Il(e)|0;i=e+-100|0;j=0;do{Jl(j);j=Il(e)|0;Kl(j,e,2);ok(j,g);nk(j,a);if((lk(j)|0)!=(e|0)){B=17;break}c[x>>2]=j;hk(h,f,j)}while((lk(h)|0)>>>0<=i>>>0);if((B|0)==17)Ie(41524,41560,360,41566);Jl(h);e=Il(101)|0;Kl(e,101,2);ok(e,100);if((lk(e)|0)!=101)Ie(41583,41560,375,41617);c[s>>2]=e;e=Il(101)|0;Kl(e,101,2);ok(e,100);if((lk(e)|0)!=101)Ie(41583,41560,375,41617);c[t>>2]=e;e=Il(101)|0;Kl(e,101,2);ok(e,100);if((lk(e)|0)!=101)Ie(41583,41560,375,41617);c[v>>2]=e;e=Il(101)|0;Kl(e,101,2);ok(e,100);if((lk(e)|0)==101){c[w>>2]=e;B=39;break}else Ie(41583,41560,375,41617)}else{d=n+4|0;e=d+12|0;f=e+40|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(f|0));c[n>>2]=41634;c[n+8>>2]=41638;c[n+16>>2]=41642;c[n+24>>2]=41645;c[n+32>>2]=41649;c[n+40>>2]=41653;c[d>>2]=s;c[n+12>>2]=t;c[n+20>>2]=u;c[n+28>>2]=v;c[n+36>>2]=w;c[n+44>>2]=x;e=0;d=41634;do{d=uf(z,d,0)|0;if(d|0){r=Af(d,1,5)|0;c[c[n+(e<<3)+4>>2]>>2]=r;sf(d)}e=e+1|0;d=c[n+(e<<3)>>2]|0}while((d|0)!=0);d=c[s>>2]|0;b:do if(d|0){e=1;do{if(!(c[c[n+(e<<3)+4>>2]>>2]|0))break b;e=e+1|0}while((c[n+(e<<3)>>2]|0)!=0);B=39;break a}while(0);Jl(d);d=1;do{Jl(c[c[n+(d<<3)+4>>2]>>2]|0);d=d+1|0}while((c[n+(d<<3)>>2]|0)!=0);q=0;r=0;p=0;o=0;d=128}while(0);if((B|0)==39){f=kl(k)|0;d=Ch(c[u>>2]|0,c[s>>2]|0,c[t>>2]|0,f,0,0)|0;e=Ch(c[x>>2]|0,c[v>>2]|0,c[w>>2]|0,f,0,0)|0;Jl(c[u>>2]|0);c[u>>2]=0;Jl(c[s>>2]|0);c[s>>2]=0;Jl(c[t>>2]|0);c[t>>2]=0;Jl(c[x>>2]|0);c[x>>2]=0;Jl(c[v>>2]|0);c[v>>2]=0;Jl(c[w>>2]|0);c[w>>2]=0;if((d|0)!=0&(e|0)!=0){q=d;r=e;p=f;o=1;d=128}else{Jl(d);Jl(e);Jl(f);q=d;r=e;p=f;o=0;d=21}}if(o){if((wk(q,r)|0)>0){Fl(q,r);e=1}else e=0;d=Hl(y)|0;Kk(d,q,r);f=y>>>1;j=Il(f)|0;f=Il(f)|0;g=Il(y)|0;gk(j,q,1);gk(f,r,1);Kk(g,j,f);i=Il(y)|0;if(!(Ek(i,p,g)|0))Ie(41656,41560,541,41690);Ek(i,j,f)|0;Jl(f);Bk(j,g,i);Jl(g);Fk(i,p,j)|0;Fk(j,q,r)|0;if(nf(1)|0){if(e|0)Oe(41704,A);Se(45379,q);Se(41725,r);Se(41729,d);Se(41733,p);Se(41737,i);Se(41741,j)}c[D>>2]=d;h=D+4|0;c[h>>2]=p;a=D+12|0;c[a>>2]=q;g=D+16|0;c[g>>2]=r;f=D+8|0;c[f>>2]=i;d=D+20|0;c[d>>2]=j;if(!(Oi(D,y+-64|0)|0))d=0;else{Jl(c[D>>2]|0);c[D>>2]=0;Jl(c[h>>2]|0);c[h>>2]=0;Jl(c[a>>2]|0);c[a>>2]=0;Jl(c[g>>2]|0);c[g>>2]=0;Jl(c[f>>2]|0);c[f>>2]=0;Jl(c[d>>2]|0);c[d>>2]=0;kg(41560,586,41690,0,41745);d=50}}else e=0}else{e=0;d=55}sf(z);if((e|0)!=0&(d|0)==0)d=tf(E,41783,0,1)|0;if(!d){h=D+4|0;a=D+8|0;g=D+12|0;f=D+16|0;d=D+20|0;e=D;B=86}}if((B|0)==86){w=c[e>>2]|0;x=c[h>>2]|0;y=c[a>>2]|0;z=c[g>>2]|0;A=c[f>>2]|0;B=c[d>>2]|0;d=c[E>>2]|0;c[C>>2]=w;c[C+4>>2]=x;c[C+8>>2]=w;c[C+12>>2]=x;c[C+16>>2]=y;c[C+20>>2]=z;c[C+24>>2]=A;c[C+28>>2]=B;c[C+32>>2]=d;d=Df(b,0,41879,C)|0}tl(c[D>>2]|0);tl(c[D+4>>2]|0);tl(c[D+12>>2]|0);tl(c[D+16>>2]|0);tl(c[D+8>>2]|0);tl(c[D+20>>2]|0);sf(c[E>>2]|0);E=d;l=F;return E|0}function Fi(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;j=l;l=l+64|0;if((l|0)>=(m|0))$(64);i=j+32|0;k=j;b=j+40|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;d=b+4|0;e=b+8|0;f=b+12|0;g=b+16|0;h=b+20|0;c[k>>2]=b;c[k+4>>2]=d;c[k+8>>2]=e;c[k+12>>2]=f;c[k+16>>2]=g;c[k+20>>2]=h;c[k+24>>2]=0;a=If(a,0,39064,k)|0;if(!a){k=ll(c[(c[f>>2]|0)+4>>2]<<1)|0;Kk(k,c[f>>2]|0,c[g>>2]|0);a=wk(k,c[b>>2]|0)|0;tl(k);a=(a|0)==0?0:7}Jl(c[b>>2]|0);Jl(c[d>>2]|0);Jl(c[e>>2]|0);Jl(c[f>>2]|0);Jl(c[g>>2]|0);Jl(c[h>>2]|0);if(!(nf(1)|0)){l=j;return a|0}c[i>>2]=Pn(a)|0;Oe(41480,i);l=j;return a|0}function Gi(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;p=l;l=l+96|0;if((l|0)>=(m|0))$(96);o=p+40|0;g=p+32|0;i=p+24|0;h=p+8|0;j=p+48|0;k=p+44|0;n=p;c[k>>2]=0;e=n;c[e>>2]=0;c[e+4>>2]=0;e=uf(d,39075,1)|0;if(!e)e=0;else{f=Af(e,1,5)|0;sf(e);if(!f)e=0;else e=lk(f)|0;Jl(f)}Jh(j,0,e);e=Lh(b,k,j)|0;do if(!e){if(nf(1)|0)Se(41350,c[k>>2]|0);b=c[k>>2]|0;if(b|0?c[b+12>>2]&4|0:0){f=0;e=79;break}f=n+4|0;c[h>>2]=n;c[h+4>>2]=f;c[h+8>>2]=0;e=If(d,0,39061,h)|0;if(!e){if(nf(1)|0){Se(41367,c[n>>2]|0);Se(41384,c[f>>2]|0)}b=Hl(0)|0;e=c[k>>2]|0;if((b|0)==(e|0)){d=ll(c[b+4>>2]<<1)|0;Mk(d,b,c[f>>2]|0,c[n>>2]|0);Al(b,d)|0;tl(d)}else Mk(b,e,c[f>>2]|0,c[n>>2]|0);if(nf(1)|0)Se(41401,b);if(!(c[j+12>>2]&4)){c[g>>2]=b;f=b;e=Df(a,0,41438,g)|0;break}f=((lk(c[n>>2]|0)|0)+7|0)>>>3;e=Vk(h,0,b,f)|0;if(!e){e=c[h>>2]|0;c[i>>2]=f;c[i+4>>2]=e;e=Df(a,0,41418,i)|0;cf(c[h>>2]|0)}f=b}else f=0}else f=0;while(0);Jl(f);Jl(c[n>>2]|0);Jl(c[n+4>>2]|0);Jl(c[k>>2]|0);Kh(j);if(!(nf(1)|0)){l=p;return e|0}c[o>>2]=Pn(e)|0;Oe(41458,o);l=p;return e|0}function Hi(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;w=l;l=l+160|0;if((l|0)>=(m|0))$(160);v=w+64|0;k=w+56|0;p=w+48|0;o=w+40|0;j=w+8|0;g=w;q=w+112|0;r=w+108|0;s=w+104|0;t=w+80|0;u=w+72|0;n=w+68|0;c[r>>2]=0;c[s>>2]=0;c[t>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;c[t+12>>2]=0;c[t+16>>2]=0;c[t+20>>2]=0;c[u>>2]=0;c[n>>2]=0;e=uf(d,39075,1)|0;if(!e)e=0;else{f=Af(e,1,5)|0;sf(e);if(!f)e=0;else e=lk(f)|0;Jl(f)}Jh(q,1,e);e=Ih(b,7604,r,q)|0;a:do if(!e){e=c[r>>2]|0;c[g>>2]=s;c[g+4>>2]=0;e=If(e,0,39071,g)|0;if(!e){if(nf(1)|0)Se(41178,c[s>>2]|0);i=c[s>>2]|0;if(i|0?c[i+12>>2]&4|0:0){f=0;e=79;break}i=t+4|0;f=t+8|0;b=t+12|0;g=t+16|0;h=t+20|0;c[j>>2]=t;c[j+4>>2]=i;c[j+8>>2]=f;c[j+12>>2]=b;c[j+16>>2]=g;c[j+20>>2]=h;c[j+24>>2]=0;e=If(d,0,40995,j)|0;if(!e){if(nf(1)|0?(Se(41195,c[t>>2]|0),Se(41212,c[i>>2]|0),(gg()|0)==0):0){Se(41229,c[f>>2]|0);Se(41246,c[b>>2]|0);Se(41263,c[g>>2]|0);Se(41280,c[h>>2]|0)}kk(c[s>>2]|0);e=c[s>>2]|0;xk(e,e,c[t>>2]|0);e=q+4|0;f=Il(c[e>>2]|0)|0;b=q+12|0;if(!(c[b>>2]&1)){g=Il(c[e>>2]|0)|0;h=Il(c[e>>2]|0)|0;d=Il(c[e>>2]|0)|0;do{Kl(g,c[e>>2]|0,0);Gk(g,g,c[t>>2]|0)}while(!(Fk(h,g,c[t>>2]|0)|0));Mk(d,g,c[i>>2]|0,c[t>>2]|0);Lk(d,d,c[s>>2]|0,c[t>>2]|0);Ni(f,d,t);Jl(d);Lk(f,f,h,c[t>>2]|0);Jl(g);Jl(h)}else Ni(f,c[s>>2]|0,t);if(nf(1)|0)Se(41297,f);switch(c[q+8>>2]|0){case 1:{e=wi(u,n,c[e>>2]|0,f)|0;tl(f);if(e|0){f=0;break a}f=c[u>>2]|0;c[o>>2]=c[n>>2];c[o+4>>2]=f;f=0;e=Df(a,0,41314,o)|0;break a}case 3:{e=Bi(u,n,c[e>>2]|0,c[q+16>>2]|0,f,c[q+20>>2]|0,c[q+24>>2]|0)|0;tl(f);if(e|0){f=0;break a}f=c[u>>2]|0;c[p>>2]=c[n>>2];c[p+4>>2]=f;f=0;e=Df(a,0,41314,p)|0;break a}default:{e=c[b>>2]&8|0?41325:47780;c[k>>2]=f;e=Df(a,0,e,k)|0;break a}}}else f=0}else f=0}else f=0;while(0);cf(c[u>>2]|0);Jl(f);Jl(c[t>>2]|0);Jl(c[t+4>>2]|0);Jl(c[t+8>>2]|0);Jl(c[t+12>>2]|0);Jl(c[t+16>>2]|0);Jl(c[t+20>>2]|0);Jl(c[s>>2]|0);Jl(0);Jl(0);Jl(0);sf(c[r>>2]|0);Kh(q);if(!(nf(1)|0)){l=w;return e|0}c[v>>2]=Pn(e)|0;Oe(41328,v);l=w;return e|0}function Ii(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+128|0;if((l|0)>=(m|0))$(128);r=s+48|0;j=s+40|0;n=s+32|0;k=s;o=s+88|0;p=s+80|0;q=s+56|0;c[p>>2]=0;c[q>>2]=0;c[q+4>>2]=0;c[q+8>>2]=0;c[q+12>>2]=0;c[q+16>>2]=0;c[q+20>>2]=0;e=uf(d,39075,1)|0;if(!e)e=0;else{f=Af(e,1,5)|0;sf(e);if(!f)e=0;else e=lk(f)|0;Jl(f)}Jh(o,2,e);e=Lh(b,p,o)|0;do if(!e){if(nf(1)|0)Se(40979,c[p>>2]|0);i=c[p>>2]|0;if(i|0?c[i+12>>2]&4|0:0){f=0;e=79;break}f=q+4|0;b=q+8|0;g=q+12|0;h=q+16|0;i=q+20|0;c[k>>2]=q;c[k+4>>2]=f;c[k+8>>2]=b;c[k+12>>2]=g;c[k+16>>2]=h;c[k+20>>2]=i;c[k+24>>2]=0;e=If(d,0,40995,k)|0;if(!e){if(nf(1)|0?(Se(41005,c[q>>2]|0),Se(41021,c[f>>2]|0),(gg()|0)==0):0){Se(41037,c[b>>2]|0);Se(41053,c[g>>2]|0);Se(41069,c[h>>2]|0);Se(41085,c[i>>2]|0)}b=Hl(0)|0;Ni(b,c[p>>2]|0,q);if(nf(1)|0)Se(41101,b);if(!(c[o+12>>2]&4)){c[j>>2]=b;f=b;e=Df(a,0,41137,j)|0;break}f=((lk(c[q>>2]|0)|0)+7|0)>>>3;e=Vk(k,0,b,f)|0;if(!e){e=c[k>>2]|0;c[n>>2]=f;c[n+4>>2]=e;e=Df(a,0,41117,n)|0;cf(c[k>>2]|0)}f=b}else f=0}else f=0;while(0);Jl(f);Jl(c[q>>2]|0);Jl(c[q+4>>2]|0);Jl(c[q+8>>2]|0);Jl(c[q+12>>2]|0);Jl(c[q+16>>2]|0);Jl(c[q+20>>2]|0);Jl(c[p>>2]|0);Kh(o);if(!(nf(1)|0)){l=s;return e|0}c[r>>2]=Pn(e)|0;Oe(41157,r);l=s;return e|0}function Ji(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0;q=l;l=l+96|0;if((l|0)>=(m|0))$(96);p=q+32|0;h=q+16|0;g=q+8|0;i=q+48|0;j=q+44|0;k=q+40|0;n=q+36|0;o=q;c[j>>2]=0;c[k>>2]=0;c[n>>2]=0;e=o;c[e>>2]=0;c[e+4>>2]=0;e=uf(d,39075,1)|0;if(!e)e=0;else{f=Af(e,1,5)|0;sf(e);if(!f)e=0;else e=lk(f)|0;Jl(f)}Jh(i,3,e);f=Lh(b,n,i)|0;do if(!f){if(nf(1)|0)Se(40878,c[n>>2]|0);b=c[n>>2]|0;if(b|0?c[b+12>>2]&4|0:0){b=0;f=79;break}f=Hh(a,7604,j,0)|0;if(!f){f=c[j>>2]|0;c[g>>2]=k;c[g+4>>2]=0;f=If(f,0,39073,g)|0;if(!f){if(nf(1)|0)Se(40894,c[k>>2]|0);b=o+4|0;c[h>>2]=o;c[h+4>>2]=b;c[h+8>>2]=0;f=If(d,0,39061,h)|0;if(!f){if(nf(1)|0){Se(40910,c[o>>2]|0);Se(40926,c[b>>2]|0)}f=Hl(0)|0;e=c[k>>2]|0;if((f|0)==(e|0)){h=ll(c[f+4>>2]<<1)|0;Mk(h,f,c[b>>2]|0,c[o>>2]|0);Al(f,h)|0;tl(h)}else Mk(f,e,c[b>>2]|0,c[o>>2]|0);if(nf(1)|0)Se(40942,f);e=c[i+32>>2]|0;if(!e){h=(wk(f,c[n>>2]|0)|0)!=0;b=f;f=h?8:0;break}else{b=f;f=yb[e&7](i,f)|0;break}}else b=0}else b=0}else b=0}else b=0;while(0);Jl(b);Jl(c[o>>2]|0);Jl(c[o+4>>2]|0);Jl(c[n>>2]|0);Jl(c[k>>2]|0);sf(c[j>>2]|0);Kh(i);if(!(nf(1)|0)){l=q;return f|0}if(!f)e=47183;else e=Pn(f)|0;c[p>>2]=e;Oe(40958,p);l=q;return f|0}function Ki(a){a=a|0;var b=0;a=uf(a,39075,1)|0;if(!a){b=0;return b|0}b=Af(a,1,5)|0;sf(a);if(!b)a=0;else a=lk(b)|0;Jl(b);b=a;return b|0}function Li(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0;q=l;l=l+32|0;if((l|0)>=(m|0))$(32);f=q;j=q+20|0;k=q+16|0;n=q+12|0;o=q+8|0;p=q+4|0;if((a|0)!=1){r=4;l=q;return r|0}c[o>>2]=0;c[p>>2]=0;b=Ff(o,0,39077,1029)|0;do if(!b){b=Ff(p,0,40107,316)|0;if(!b){b=Uh(c[o>>2]|0)|0;if(b|0){b=Pn(b)|0;a=40842;r=28;break}b=c[p>>2]|0;a=c[o>>2]|0;c[j>>2]=0;c[k>>2]=0;c[n>>2]=0;if((Ff(j,0,40424,75)|0)==0?(Ff(k,0,40500,75)|0)==0:0)if(!(Sh(n,c[j>>2]|0,a)|0))if(!(Th(c[n>>2]|0,c[j>>2]|0,b)|0)){b=((Th(c[n>>2]|0,c[k>>2]|0,b)|0)&65535|0)==8;b=b?0:40576}else b=40641;else b=40626;else b=40603;sf(c[n>>2]|0);sf(c[k>>2]|0);sf(c[j>>2]|0);if(!b){b=c[p>>2]|0;a=c[o>>2]|0;c[j>>2]=0;c[k>>2]=0;c[n>>2]=0;g=Hl(1e3)|0;Kl(g,1e3,0);c[f>>2]=g;if(!(Df(j,0,40655,f)|0))if(!(Ph(k,c[j>>2]|0,b)|0)){b=uf(c[k>>2]|0,40685,0)|0;if((((b|0)!=0?(h=uf(b,40693,0)|0,sf(b),(h|0)!=0):0)?(i=uf(h,39071,0)|0,sf(h),(i|0)!=0):0)?(e=Af(i,1,0)|0,sf(i),(e|0)!=0):0)if(wk(g,e)|0)if(!(Rh(n,c[k>>2]|0,a)|0)){b=uf(c[n>>2]|0,40697,0)|0;if(!b)a=Af(c[n>>2]|0,0,5)|0;else a=Af(b,1,5)|0;if(!a){f=b;b=40804;a=0}else{i=(wk(g,a)|0)==0;f=b;b=i?0:40703}}else{f=0;b=40789;a=0}else{f=0;b=40760;a=0}else{f=0;e=0;b=40727;a=0}}else{f=0;e=0;b=40712;a=0}else{f=0;e=0;b=40603;a=0}sf(f);Jl(a);sf(c[n>>2]|0);Jl(e);sf(c[k>>2]|0);sf(c[j>>2]|0);Jl(g);if(!b){sf(c[p>>2]|0);sf(c[o>>2]|0);b=0}else{a=40863;r=28}}else{a=40858;r=28}}else r=4}else r=4;while(0);if((r|0)==4){b=Pn(b)|0;a=40834;r=28}if((r|0)==28){sf(c[p>>2]|0);sf(c[o>>2]|0);if(!d)b=50;else{zb[d&1](40871,1,a,b);b=50}}r=b;l=q;return r|0}function Mi(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=f;b=uf(b,39075,1)|0;do if(b){d=xf(b,1,e)|0;if(!d){sf(b);b=68;break}else{lh(a,d,c[e>>2]|0);sf(b);b=0;break}}else b=68;while(0);l=f;return b|0}function Ni(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;kk(b);h=d+12|0;if((c[h>>2]|0?(i=d+16|0,c[i>>2]|0):0)?(j=d+20|0,c[j>>2]|0):0){e=nl((c[(c[d>>2]|0)+4>>2]|0)+1|0)|0;f=nl((c[(c[d>>2]|0)+4>>2]|0)+1|0)|0;g=nl((c[(c[d>>2]|0)+4>>2]|0)+1|0)|0;gk(g,c[h>>2]|0,1);d=d+8|0;xk(g,c[d>>2]|0,g);Mk(e,b,g,c[h>>2]|0);gk(g,c[i>>2]|0,1);xk(g,c[d>>2]|0,g);Mk(f,b,g,c[i>>2]|0);hk(g,f,e);if(c[g+8>>2]|0)fk(g,g,c[i>>2]|0);Lk(g,c[j>>2]|0,g,c[i>>2]|0);Kk(g,g,c[h>>2]|0);fk(a,e,g);tl(g);tl(e);tl(f);return}Mk(a,b,c[d+8>>2]|0,c[d>>2]|0);return}function Oi(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;f=Hl(b)|0;g=Hl(b)|0;h=Hl(b)|0;i=Hl(b)|0;d=c[a>>2]|0;e=c[a+4>>2]|0;Kl(f,b,0);if((g|0)==(f|0)){j=ll(c[f+4>>2]<<1)|0;Mk(j,f,e,d);Al(f,j)|0;tl(j)}else Mk(g,f,e,d);if((wk(g,f)|0)!=0?(Ni(h,g,a),(wk(h,f)|0)==0):0){Kl(f,b,0);Ni(i,f,a);a=(h|0)==(i|0);if(a){j=ll(c[h+4>>2]<<1)|0;Mk(j,h,e,d);Al(h,j)|0;tl(j)}else Mk(h,i,e,d);if(!(wk(h,f)|0)){ek(i,i,1);if(a){j=ll(c[h+4>>2]<<1)|0;Mk(j,h,e,d);Al(h,j)|0;tl(j)}else Mk(h,i,e,d);a=((wk(h,f)|0)==0)<<31>>31}else a=-1}else a=-1;Jl(i);Jl(h);Jl(g);Jl(f);return a|0}function Pi(a,b){a=a|0;b=b|0;var c=0;gk(b,b,1);c=Bl(b)|0;a=(Ek(c,a,b)|0)==0&1;Jl(c);ek(b,b,1);return a|0}function Qi(a,b){a=a|0;b=b|0;c[a+160>>2]=1732584193;c[a+164>>2]=-271733879;c[a+168>>2]=-1732584194;c[a+172>>2]=271733878;c[a+176>>2]=-1009589776;b=a+128|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[a+148>>2]=64;c[a+152>>2]=32;return}function Ri(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;Jm(b,0,0);h=b+128|0;f=c[h>>2]|0;i=f<<6;h=gr(f|0,c[h+4>>2]|0,26)|0;e=b+144|0;j=c[e>>2]|0;g=i+j|0;f=(g>>>0>>0&1)+(h&536870848|f>>>26)|0;h=g<<3;i=f<<3|g>>>29;c[e>>2]=j+1;a[b+j>>0]=-128;d=c[e>>2]|0;if((j|0)<56){if((d|0)<56)do{c[e>>2]=d+1;a[b+d>>0]=0;d=c[e>>2]|0}while((d|0)<56)}else{if((d|0)<64)do{c[e>>2]=d+1;a[b+d>>0]=0;d=c[e>>2]|0}while((d|0)<64);Jm(b,0,0);d=b;e=d+56|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(e|0))}a[b+56>>0]=f>>>21;a[b+57>>0]=f>>>13;a[b+58>>0]=f>>>5;a[b+59>>0]=i;a[b+60>>0]=g>>>21;a[b+61>>0]=g>>>13;a[b+62>>0]=g>>>5;a[b+63>>0]=h;Ui(b,b,1)|0;Te(104);j=c[b+160>>2]|0;a[b>>0]=j>>>24;a[b+1>>0]=j>>>16;a[b+2>>0]=j>>>8;a[b+3>>0]=j;j=c[b+164>>2]|0;a[b+4>>0]=j>>>24;a[b+5>>0]=j>>>16;a[b+6>>0]=j>>>8;a[b+7>>0]=j;j=c[b+168>>2]|0;a[b+8>>0]=j>>>24;a[b+9>>0]=j>>>16;a[b+10>>0]=j>>>8;a[b+11>>0]=j;j=c[b+172>>2]|0;a[b+12>>0]=j>>>24;a[b+13>>0]=j>>>16;a[b+14>>0]=j>>>8;a[b+15>>0]=j;j=c[b+176>>2]|0;a[b+16>>0]=j>>>24;a[b+17>>0]=j>>>16;a[b+18>>0]=j>>>8;a[b+19>>0]=j;return}function Si(a){a=a|0;return a|0}function Ti(a,b,c){a=a|0;b=b|0;c=c|0;if((a|0)!=2){c=5;return c|0}a=Im(2,0,42568,3,42031,20)|0;if(!a){if(!b){c=0;return c|0}a=Im(2,0,42234,56,42052,20)|0;if(!a){a=Im(2,1,0,0,42073,20)|0;if(!a){c=0;return c|0}else b=42857}else b=42845}else b=42832;if(!c){c=50;return c|0}zb[c&1](42873,2,b,a);c=50;return c|0}function Ui(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;k=a+160|0;l=a+164|0;m=a+168|0;n=a+172|0;j=a+176|0;a=c[m>>2]|0;f=c[n>>2]|0;g=c[l>>2]|0;h=c[j>>2]|0;i=c[k>>2]|0;while(1){z=(d[b+1>>0]|0)<<16|(d[b>>0]|0)<<24|(d[b+2>>0]|0)<<8|(d[b+3>>0]|0);o=(i<<5|i>>>27)+1518500249+h+((f^a)&g^f)+z|0;r=g<<30|g>>>2;v=(d[b+5>>0]|0)<<16|(d[b+4>>0]|0)<<24|(d[b+6>>0]|0)<<8|(d[b+7>>0]|0);p=f+1518500249+((r^a)&i^a)+(o<<5|o>>>27)+v|0;s=i<<30|i>>>2;B=(d[b+9>>0]|0)<<16|(d[b+8>>0]|0)<<24|(d[b+10>>0]|0)<<8|(d[b+11>>0]|0);q=a+1518500249+(o&(r^s)^r)+(p<<5|p>>>27)+B|0;o=o<<30|o>>>2;G=(d[b+13>>0]|0)<<16|(d[b+12>>0]|0)<<24|(d[b+14>>0]|0)<<8|(d[b+15>>0]|0);r=r+1518500249+(p&(o^s)^s)+G+(q<<5|q>>>27)|0;p=p<<30|p>>>2;E=(d[b+17>>0]|0)<<16|(d[b+16>>0]|0)<<24|(d[b+18>>0]|0)<<8|(d[b+19>>0]|0);s=s+1518500249+(q&(p^o)^o)+E+(r<<5|r>>>27)|0;q=q<<30|q>>>2;C=(d[b+21>>0]|0)<<16|(d[b+20>>0]|0)<<24|(d[b+22>>0]|0)<<8|(d[b+23>>0]|0);o=o+1518500249+(r&(q^p)^p)+C+(s<<5|s>>>27)|0;r=r<<30|r>>>2;y=(d[b+25>>0]|0)<<16|(d[b+24>>0]|0)<<24|(d[b+26>>0]|0)<<8|(d[b+27>>0]|0);p=p+1518500249+(s&(r^q)^q)+y+(o<<5|o>>>27)|0;s=s<<30|s>>>2;u=(d[b+29>>0]|0)<<16|(d[b+28>>0]|0)<<24|(d[b+30>>0]|0)<<8|(d[b+31>>0]|0);q=q+1518500249+(o&(s^r)^r)+u+(p<<5|p>>>27)|0;o=o<<30|o>>>2;x=(d[b+33>>0]|0)<<16|(d[b+32>>0]|0)<<24|(d[b+34>>0]|0)<<8|(d[b+35>>0]|0);r=r+1518500249+(p&(o^s)^s)+x+(q<<5|q>>>27)|0;p=p<<30|p>>>2;t=(d[b+37>>0]|0)<<16|(d[b+36>>0]|0)<<24|(d[b+38>>0]|0)<<8|(d[b+39>>0]|0);s=s+1518500249+(q&(p^o)^o)+t+(r<<5|r>>>27)|0;q=q<<30|q>>>2;I=(d[b+41>>0]|0)<<16|(d[b+40>>0]|0)<<24|(d[b+42>>0]|0)<<8|(d[b+43>>0]|0);o=o+1518500249+(r&(q^p)^p)+I+(s<<5|s>>>27)|0;r=r<<30|r>>>2;H=(d[b+45>>0]|0)<<16|(d[b+44>>0]|0)<<24|(d[b+46>>0]|0)<<8|(d[b+47>>0]|0);p=p+1518500249+(s&(r^q)^q)+H+(o<<5|o>>>27)|0;s=s<<30|s>>>2;F=(d[b+49>>0]|0)<<16|(d[b+48>>0]|0)<<24|(d[b+50>>0]|0)<<8|(d[b+51>>0]|0);q=q+1518500249+(o&(s^r)^r)+F+(p<<5|p>>>27)|0;o=o<<30|o>>>2;D=(d[b+53>>0]|0)<<16|(d[b+52>>0]|0)<<24|(d[b+54>>0]|0)<<8|(d[b+55>>0]|0);r=r+1518500249+(p&(o^s)^s)+D+(q<<5|q>>>27)|0;p=p<<30|p>>>2;A=(d[b+57>>0]|0)<<16|(d[b+56>>0]|0)<<24|(d[b+58>>0]|0)<<8|(d[b+59>>0]|0);s=s+1518500249+(q&(p^o)^o)+A+(r<<5|r>>>27)|0;q=q<<30|q>>>2;w=(d[b+61>>0]|0)<<16|(d[b+60>>0]|0)<<24|(d[b+62>>0]|0)<<8|(d[b+63>>0]|0);o=o+1518500249+(r&(q^p)^p)+w+(s<<5|s>>>27)|0;r=r<<30|r>>>2;z=B^z^x^D;z=z<<1|z>>>31;p=p+1518500249+z+(s&(r^q)^q)+(o<<5|o>>>27)|0;s=s<<30|s>>>2;v=G^v^t^A;v=v<<1|v>>>31;q=q+1518500249+v+(o&(s^r)^r)+(p<<5|p>>>27)|0;o=o<<30|o>>>2;B=E^B^I^w;B=B<<1|B>>>31;r=r+1518500249+B+(p&(o^s)^s)+(q<<5|q>>>27)|0;p=p<<30|p>>>2;G=C^G^H^z;G=G<<1|G>>>31;s=G+1518500249+s+(q&(p^o)^o)+(r<<5|r>>>27)|0;q=q<<30|q>>>2;E=y^E^F^v;E=E<<1|E>>>31;o=E+1859775393+o+(q^p^r)+(s<<5|s>>>27)|0;r=r<<30|r>>>2;C=u^C^D^B;C=C<<1|C>>>31;p=C+1859775393+p+(r^q^s)+(o<<5|o>>>27)|0;s=s<<30|s>>>2;y=x^y^A^G;y=y<<1|y>>>31;q=y+1859775393+q+(s^r^o)+(p<<5|p>>>27)|0;o=o<<30|o>>>2;u=t^u^w^E;u=u<<1|u>>>31;r=u+1859775393+r+(o^s^p)+(q<<5|q>>>27)|0;p=p<<30|p>>>2;x=I^x^z^C;x=x<<1|x>>>31;s=x+1859775393+s+(p^o^q)+(r<<5|r>>>27)|0;q=q<<30|q>>>2;t=H^t^v^y;t=t<<1|t>>>31;o=t+1859775393+o+(q^p^r)+(s<<5|s>>>27)|0;r=r<<30|r>>>2;I=F^I^B^u;I=I<<1|I>>>31;p=I+1859775393+p+(r^q^s)+(o<<5|o>>>27)|0;s=s<<30|s>>>2;H=D^H^G^x;H=H<<1|H>>>31;q=H+1859775393+q+(s^r^o)+(p<<5|p>>>27)|0;o=o<<30|o>>>2;F=A^F^E^t;F=F<<1|F>>>31;r=F+1859775393+r+(o^s^p)+(q<<5|q>>>27)|0;p=p<<30|p>>>2;D=w^D^C^I;D=D<<1|D>>>31;s=D+1859775393+s+(p^o^q)+(r<<5|r>>>27)|0;q=q<<30|q>>>2;A=A^z^y^H;A=A<<1|A>>>31;o=A+1859775393+o+(q^p^r)+(s<<5|s>>>27)|0;r=r<<30|r>>>2;w=w^v^u^F;w=w<<1|w>>>31;p=w+1859775393+p+(r^q^s)+(o<<5|o>>>27)|0;s=s<<30|s>>>2;z=B^z^x^D;z=z<<1|z>>>31;q=z+1859775393+q+(s^r^o)+(p<<5|p>>>27)|0;o=o<<30|o>>>2;v=v^G^t^A;v=v<<1|v>>>31;r=v+1859775393+r+(o^s^p)+(q<<5|q>>>27)|0;p=p<<30|p>>>2;B=B^E^I^w;B=B<<1|B>>>31;s=B+1859775393+s+(p^o^q)+(r<<5|r>>>27)|0;q=q<<30|q>>>2;G=C^G^H^z;G=G<<1|G>>>31;o=G+1859775393+o+(q^p^r)+(s<<5|s>>>27)|0;r=r<<30|r>>>2;E=E^y^F^v;E=E<<1|E>>>31;p=E+1859775393+p+(r^q^s)+(o<<5|o>>>27)|0;s=s<<30|s>>>2;C=C^u^D^B;C=C<<1|C>>>31;q=C+1859775393+q+(s^r^o)+(p<<5|p>>>27)|0;o=o<<30|o>>>2;y=x^y^A^G;y=y<<1|y>>>31;r=y+1859775393+r+(o^s^p)+(q<<5|q>>>27)|0;p=p<<30|p>>>2;u=u^t^w^E;u=u<<1|u>>>31;s=u+1859775393+s+(p^o^q)+(r<<5|r>>>27)|0;q=q<<30|q>>>2;x=x^I^z^C;x=x<<1|x>>>31;o=x+-1894007588+o+((r|q)&p|r&q)+(s<<5|s>>>27)|0;r=r<<30|r>>>2;t=H^t^v^y;t=t<<1|t>>>31;p=t+-1894007588+p+((s|r)&q|s&r)+(o<<5|o>>>27)|0;s=s<<30|s>>>2;I=I^F^B^u;I=I<<1|I>>>31;q=I+-1894007588+q+((o|s)&r|o&s)+(p<<5|p>>>27)|0;o=o<<30|o>>>2;H=H^D^G^x;H=H<<1|H>>>31;r=H+-1894007588+r+((p|o)&s|p&o)+(q<<5|q>>>27)|0;p=p<<30|p>>>2;F=A^F^E^t;F=F<<1|F>>>31;s=F+-1894007588+s+((q|p)&o|q&p)+(r<<5|r>>>27)|0;q=q<<30|q>>>2;D=D^w^C^I;D=D<<1|D>>>31;o=D+-1894007588+o+((r|q)&p|r&q)+(s<<5|s>>>27)|0;r=r<<30|r>>>2;A=A^z^y^H;A=A<<1|A>>>31;p=A+-1894007588+p+((s|r)&q|s&r)+(o<<5|o>>>27)|0;s=s<<30|s>>>2;w=v^w^u^F;w=w<<1|w>>>31;q=w+-1894007588+q+((o|s)&r|o&s)+(p<<5|p>>>27)|0;o=o<<30|o>>>2;z=z^B^x^D;z=z<<1|z>>>31;r=z+-1894007588+r+((p|o)&s|p&o)+(q<<5|q>>>27)|0;p=p<<30|p>>>2;v=v^G^t^A;v=v<<1|v>>>31;s=v+-1894007588+s+((q|p)&o|q&p)+(r<<5|r>>>27)|0;q=q<<30|q>>>2;B=E^B^I^w;B=B<<1|B>>>31;o=B+-1894007588+o+((r|q)&p|r&q)+(s<<5|s>>>27)|0;r=r<<30|r>>>2;G=G^C^H^z;G=G<<1|G>>>31;p=G+-1894007588+p+((s|r)&q|s&r)+(o<<5|o>>>27)|0;s=s<<30|s>>>2;E=E^y^F^v;E=E<<1|E>>>31;q=E+-1894007588+q+((o|s)&r|o&s)+(p<<5|p>>>27)|0;o=o<<30|o>>>2;C=u^C^D^B;C=C<<1|C>>>31;r=C+-1894007588+r+((p|o)&s|p&o)+(q<<5|q>>>27)|0;p=p<<30|p>>>2;y=y^x^A^G;y=y<<1|y>>>31;s=y+-1894007588+s+((q|p)&o|q&p)+(r<<5|r>>>27)|0;q=q<<30|q>>>2;u=u^t^w^E;u=u<<1|u>>>31;o=u+-1894007588+o+((r|q)&p|r&q)+(s<<5|s>>>27)|0;r=r<<30|r>>>2;x=I^x^z^C;x=x<<1|x>>>31;p=x+-1894007588+p+((s|r)&q|s&r)+(o<<5|o>>>27)|0;s=s<<30|s>>>2;t=t^H^v^y;t=t<<1|t>>>31;q=t+-1894007588+q+((o|s)&r|o&s)+(p<<5|p>>>27)|0;o=o<<30|o>>>2;I=I^F^B^u;I=I<<1|I>>>31;r=I+-1894007588+r+((p|o)&s|p&o)+(q<<5|q>>>27)|0;p=p<<30|p>>>2;H=D^H^G^x;H=H<<1|H>>>31;s=H+-1894007588+s+((q|p)&o|q&p)+(r<<5|r>>>27)|0;q=q<<30|q>>>2;F=F^A^E^t;F=F<<1|F>>>31;o=F+-899497514+o+(q^p^r)+(s<<5|s>>>27)|0;r=r<<30|r>>>2;D=D^w^C^I;D=D<<1|D>>>31;p=D+-899497514+p+(r^q^s)+(o<<5|o>>>27)|0;s=s<<30|s>>>2;A=z^A^y^H;A=A<<1|A>>>31;q=A+-899497514+q+(s^r^o)+(p<<5|p>>>27)|0;o=o<<30|o>>>2;w=w^v^u^F;w=w<<1|w>>>31;r=w+-899497514+r+(o^s^p)+(q<<5|q>>>27)|0;p=p<<30|p>>>2;z=z^B^x^D;z=z<<1|z>>>31;s=z+-899497514+s+(p^o^q)+(r<<5|r>>>27)|0;q=q<<30|q>>>2;v=G^v^t^A;v=v<<1|v>>>31;o=v+-899497514+o+(q^p^r)+(s<<5|s>>>27)|0;r=r<<30|r>>>2;B=B^E^I^w;B=B<<1|B>>>31;p=B+-899497514+p+(r^q^s)+(o<<5|o>>>27)|0;s=s<<30|s>>>2;G=G^C^H^z;G=G<<1|G>>>31;q=G+-899497514+q+(s^r^o)+(p<<5|p>>>27)|0;o=o<<30|o>>>2;E=y^E^F^v;E=E<<1|E>>>31;r=E+-899497514+r+(o^s^p)+(q<<5|q>>>27)|0;p=p<<30|p>>>2;C=C^u^D^B;C=C<<1|C>>>31;s=C+-899497514+s+(p^o^q)+(r<<5|r>>>27)|0;q=q<<30|q>>>2;y=y^x^A^G;y=y<<1|y>>>31;o=y+-899497514+o+(q^p^r)+(s<<5|s>>>27)|0;r=r<<30|r>>>2;u=t^u^w^E;u=u<<1|u>>>31;p=u+-899497514+p+(r^q^s)+(o<<5|o>>>27)|0;s=s<<30|s>>>2;x=x^I^z^C;x=x<<1|x>>>31;q=x+-899497514+q+(s^r^o)+(p<<5|p>>>27)|0;o=o<<30|o>>>2;t=t^H^v^y;t=t<<1|t>>>31;r=t+-899497514+r+(o^s^p)+(q<<5|q>>>27)|0;p=p<<30|p>>>2;B=F^I^B^u;B=B<<1|B>>>31;s=B+-899497514+s+(p^o^q)+(r<<5|r>>>27)|0;q=q<<30|q>>>2;x=H^D^G^x;x=x<<1|x>>>31;o=x+-899497514+o+(q^p^r)+(s<<5|s>>>27)|0;r=r<<30|r>>>2;t=F^A^E^t;t=t<<1|t>>>31;p=t+-899497514+p+(r^q^s)+(o<<5|o>>>27)|0;s=s<<30|s>>>2;B=w^D^C^B;q=(B<<1|B>>>31)+-899497514+q+(s^r^o)+(p<<5|p>>>27)|0;o=o<<30|o>>>2;x=A^z^y^x;r=(x<<1|x>>>31)+-899497514+r+(o^s^p)+(q<<5|q>>>27)|0;p=p<<30|p>>>2;t=w^v^u^t;i=i+-899497514+(t<<1|t>>>31)+s+(p^o^q)+(r<<5|r>>>27)|0;c[k>>2]=i;g=r+(c[l>>2]|0)|0;c[l>>2]=g;a=(q<<30|q>>>2)+(c[m>>2]|0)|0;c[m>>2]=a;f=p+(c[n>>2]|0)|0;c[n>>2]=f;h=o+(c[j>>2]|0)|0;c[j>>2]=h;e=e+-1|0;if(!e)break;else b=b+64|0}return 104}function Vi(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;f=l;l=l+192|0;if((l|0)>=(m|0))$(192);g=f;c[g+160>>2]=1732584193;c[g+164>>2]=-271733879;c[g+168>>2]=-1732584194;c[g+172>>2]=271733878;c[g+176>>2]=-1009589776;h=g+128|0;c[h>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;c[h+12>>2]=0;c[h+16>>2]=0;c[g+148>>2]=64;c[g+152>>2]=32;Jm(g,d,e);Ri(g);d=g;e=b+20|0;do{a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0}while((b|0)<(e|0));l=f;return}function Wi(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;g=l;l=l+192|0;if((l|0)>=(m|0))$(192);f=g;c[f+160>>2]=1732584193;c[f+164>>2]=-271733879;c[f+168>>2]=-1732584194;c[f+172>>2]=271733878;c[f+176>>2]=-1009589776;h=f+128|0;c[h>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;c[h+12>>2]=0;c[h+16>>2]=0;c[f+148>>2]=64;c[f+152>>2]=32;if((e|0)<=0){Ri(f);d=b;e=d+20|0;do{a[d>>0]=a[f>>0]|0;d=d+1|0;f=f+1|0}while((d|0)<(e|0));l=g;return}while(1){Jm(f,(c[d+12>>2]|0)+(c[d+4>>2]|0)|0,c[d+8>>2]|0);if((e|0)>1){d=d+16|0;e=e+-1|0}else break}Ri(f);d=b;e=d+20|0;do{a[d>>0]=a[f>>0]|0;d=d+1|0;f=f+1|0}while((d|0)<(e|0));l=g;return}function Xi(a,b){a=a|0;b=b|0;c[a+160>>2]=-1056596264;c[a+164>>2]=914150663;c[a+168>>2]=812702999;c[a+172>>2]=-150054599;c[a+176>>2]=-4191439;c[a+180>>2]=1750603025;c[a+184>>2]=1694076839;c[a+188>>2]=-1090891868;b=a+128|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[a+148>>2]=64;c[a+152>>2]=33;return}function Yi(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;Jm(b,0,0);h=b+128|0;f=c[h>>2]|0;i=f<<6;h=gr(f|0,c[h+4>>2]|0,26)|0;e=b+144|0;j=c[e>>2]|0;g=i+j|0;f=(g>>>0>>0&1)+(h&536870848|f>>>26)|0;h=g<<3;i=f<<3|g>>>29;c[e>>2]=j+1;a[b+j>>0]=-128;d=c[e>>2]|0;if((j|0)<56){if((d|0)<56)do{c[e>>2]=d+1;a[b+d>>0]=0;d=c[e>>2]|0}while((d|0)<56)}else{if((d|0)<64)do{c[e>>2]=d+1;a[b+d>>0]=0;d=c[e>>2]|0}while((d|0)<64);Jm(b,0,0);d=b;e=d+56|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(e|0))}a[b+56>>0]=f>>>21;a[b+57>>0]=f>>>13;a[b+58>>0]=f>>>5;a[b+59>>0]=i;a[b+60>>0]=g>>>21;a[b+61>>0]=g>>>13;a[b+62>>0]=g>>>5;a[b+63>>0]=h;$i(b,b,1)|0;Te(328);j=c[b+160>>2]|0;a[b>>0]=j>>>24;a[b+1>>0]=j>>>16;a[b+2>>0]=j>>>8;a[b+3>>0]=j;j=c[b+164>>2]|0;a[b+4>>0]=j>>>24;a[b+5>>0]=j>>>16;a[b+6>>0]=j>>>8;a[b+7>>0]=j;j=c[b+168>>2]|0;a[b+8>>0]=j>>>24;a[b+9>>0]=j>>>16;a[b+10>>0]=j>>>8;a[b+11>>0]=j;j=c[b+172>>2]|0;a[b+12>>0]=j>>>24;a[b+13>>0]=j>>>16;a[b+14>>0]=j>>>8;a[b+15>>0]=j;j=c[b+176>>2]|0;a[b+16>>0]=j>>>24;a[b+17>>0]=j>>>16;a[b+18>>0]=j>>>8;a[b+19>>0]=j;j=c[b+180>>2]|0;a[b+20>>0]=j>>>24;a[b+21>>0]=j>>>16;a[b+22>>0]=j>>>8;a[b+23>>0]=j;j=c[b+184>>2]|0;a[b+24>>0]=j>>>24;a[b+25>>0]=j>>>16;a[b+26>>0]=j>>>8;a[b+27>>0]=j;j=c[b+188>>2]|0;a[b+28>>0]=j>>>24;a[b+29>>0]=j>>>16;a[b+30>>0]=j>>>8;a[b+31>>0]=j;return}function Zi(a){a=a|0;return a|0}function _i(a,b,c){a=a|0;b=b|0;c=c|0;switch(a|0){case 11:{a=Im(11,0,42568,3,42205,28)|0;if(!a){if(!b){c=0;return c|0}a=Im(11,0,42234,56,42291,28)|0;if(!a){a=Im(11,1,0,0,42320,28)|0;if(!a){c=0;return c|0}else b=42857}else b=42845}else b=42832;if(!c){c=50;return c|0}zb[c&1](42873,11,b,a);c=50;return c|0}case 8:{a=Im(8,0,42568,3,42349,32)|0;if(!a){if(!b){c=0;return c|0}a=Im(8,0,42234,56,42382,32)|0;if(!a){a=Im(8,1,0,0,42415,32)|0;if(!a){c=0;return c|0}else b=42857}else b=42845}else b=42832;if(!c){c=50;return c|0}zb[c&1](42873,8,b,a);c=50;return c|0}default:{c=5;return c|0}}return 0}function $i(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;z=l;l=l+256|0;if((l|0)>=(m|0))$(256);s=z;t=a+160|0;u=a+164|0;v=a+168|0;w=a+172|0;x=a+176|0;y=a+180|0;r=a+184|0;q=a+188|0;i=c[q>>2]|0;k=c[r>>2]|0;j=c[y>>2]|0;h=c[x>>2]|0;g=c[w>>2]|0;p=c[v>>2]|0;o=c[u>>2]|0;n=c[t>>2]|0;while(1){a=0;do{f=b+(a<<2)|0;c[s+(a<<2)>>2]=(d[f+1>>0]|0)<<16|(d[f>>0]|0)<<24|(d[f+2>>0]|0)<<8|(d[f+3>>0]|0);a=a+1|0}while((a|0)!=16);a=16;f=c[s>>2]|0;do{A=c[s+(a+-2<<2)>>2]|0;B=f;f=c[s+(a+-15<<2)>>2]|0;c[s+(a<<2)>>2]=(c[s+(a+-7<<2)>>2]|0)+B+((A>>>19|A<<13)^A>>>10^(A>>>17|A<<15))+((f>>>18|f<<14)^f>>>3^(f>>>7|f<<25));a=a+1|0}while((a|0)!=64);f=p;a=0;do{G=((j^k)&h^k)+i+(c[12216+(a<<2)>>2]|0)+((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(c[s+(a<<2)>>2]|0)|0;H=G+g|0;G=(f&(o|n)|o&n)+((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+G|0;E=a|1;E=(c[12216+(E<<2)>>2]|0)+k+(c[s+(E<<2)>>2]|0)+(H&(h^j)^j)+((H>>>6|H<<26)^(H>>>11|H<<21)^(H>>>25|H<<7))|0;D=E+f|0;E=((G>>>2|G<<30)^(G>>>13|G<<19)^(G>>>22|G<<10))+((G|n)&o|G&n)+E|0;C=a|2;C=(c[12216+(C<<2)>>2]|0)+j+(c[s+(C<<2)>>2]|0)+(D&(H^h)^h)+((D>>>6|D<<26)^(D>>>11|D<<21)^(D>>>25|D<<7))|0;p=C+o|0;C=((E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10))+((E|G)&n|E&G)+C|0;A=a|3;A=(c[12216+(A<<2)>>2]|0)+h+(c[s+(A<<2)>>2]|0)+(p&(D^H)^H)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))|0;B=A+n|0;A=((C>>>2|C<<30)^(C>>>13|C<<19)^(C>>>22|C<<10))+((C|E)&G|C&E)+A|0;F=a|4;F=(c[12216+(F<<2)>>2]|0)+H+(c[s+(F<<2)>>2]|0)+(B&(p^D)^D)+((B>>>6|B<<26)^(B>>>11|B<<21)^(B>>>25|B<<7))|0;i=F+G|0;g=((A>>>2|A<<30)^(A>>>13|A<<19)^(A>>>22|A<<10))+((A|C)&E|A&C)+F|0;F=a|5;D=(c[s+(F<<2)>>2]|0)+(c[12216+(F<<2)>>2]|0)+D+(i&(B^p)^p)+((i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7))|0;k=D+E|0;f=((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((g|A)&C|g&A)+D|0;D=a|6;p=(c[s+(D<<2)>>2]|0)+(c[12216+(D<<2)>>2]|0)+p+(k&(i^B)^B)+((k>>>6|k<<26)^(k>>>11|k<<21)^(k>>>25|k<<7))|0;j=p+C|0;o=((f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10))+((f|g)&A|f&g)+p|0;p=a|7;B=(c[s+(p<<2)>>2]|0)+(c[12216+(p<<2)>>2]|0)+B+(j&(k^i)^i)+((j>>>6|j<<26)^(j>>>11|j<<21)^(j>>>25|j<<7))|0;h=B+A|0;n=((o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+((o|f)&g|o&f)+B|0;a=a+8|0}while((a|0)<64);n=(c[t>>2]|0)+n|0;c[t>>2]=n;o=(c[u>>2]|0)+o|0;c[u>>2]=o;p=(c[v>>2]|0)+f|0;c[v>>2]=p;g=(c[w>>2]|0)+g|0;c[w>>2]=g;h=(c[x>>2]|0)+h|0;c[x>>2]=h;j=(c[y>>2]|0)+j|0;c[y>>2]=j;k=(c[r>>2]|0)+k|0;c[r>>2]=k;i=(c[q>>2]|0)+i|0;c[q>>2]=i;e=e+-1|0;if(!e)break;else b=b+64|0}l=z;return 328}function aj(a,b){a=a|0;b=b|0;c[a+160>>2]=1779033703;c[a+164>>2]=-1150833019;c[a+168>>2]=1013904242;c[a+172>>2]=-1521486534;c[a+176>>2]=1359893119;c[a+180>>2]=-1694144372;c[a+184>>2]=528734635;c[a+188>>2]=1541459225;b=a+128|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[a+148>>2]=64;c[a+152>>2]=33;return}function bj(a,b){a=a|0;b=b|0;b=a+160|0;c[b>>2]=-205731576;c[b+4>>2]=1779033703;b=a+168|0;c[b>>2]=-2067093701;c[b+4>>2]=-1150833019;b=a+176|0;c[b>>2]=-23791573;c[b+4>>2]=1013904242;b=a+184|0;c[b>>2]=1595750129;c[b+4>>2]=-1521486534;b=a+192|0;c[b>>2]=-1377402159;c[b+4>>2]=1359893119;b=a+200|0;c[b>>2]=725511199;c[b+4>>2]=-1694144372;b=a+208|0;c[b>>2]=-79577749;c[b+4>>2]=528734635;b=a+216|0;c[b>>2]=327033209;c[b+4>>2]=1541459225;b=a+128|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[a+148>>2]=128;c[a+152>>2]=34;return}function cj(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;Jm(b,0,0);i=b+128|0;e=c[i>>2]|0;i=c[i+4>>2]|0;j=b+136|0;h=c[j>>2]|0;j=c[j+4>>2]|0;m=mr(e|0,i|0,7)|0;d=D;j=mr(h|0,j|0,7)|0;h=D;i=gr(e|0,i|0,57)|0;h=h|D;e=b+144|0;l=c[e>>2]|0;f=_q(l|0,((l|0)<0)<<31>>31|0,m|0,d|0)|0;g=D;h=_q((g>>>0>>0|(g|0)==(d|0)&f>>>0>>0)&1|0,0,j|i|0,h|0)|0;i=D;j=mr(f|0,g|0,3)|0;m=mr(h|0,i|0,3)|0;d=D;k=gr(f|0,g|0,61)|0;k=m|k;c[e>>2]=l+1;a[b+l>>0]=-128;d=c[e>>2]|0;if((l|0)<112){if((d|0)<112)do{c[e>>2]=d+1;a[b+d>>0]=0;d=c[e>>2]|0}while((d|0)<112)}else{if((d|0)<128)do{c[e>>2]=d+1;a[b+d>>0]=0;d=c[e>>2]|0}while((d|0)<128);Jm(b,0,0);d=b;e=d+112|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(e|0))}m=gr(h|0,i|0,53)|0;a[b+112>>0]=m;m=gr(h|0,i|0,45)|0;a[b+113>>0]=m;m=gr(h|0,i|0,37)|0;a[b+114>>0]=m;m=gr(h|0,i|0,29)|0;a[b+115>>0]=m;m=gr(h|0,i|0,21)|0;a[b+116>>0]=m;m=gr(h|0,i|0,13)|0;a[b+117>>0]=m;m=gr(h|0,i|0,5)|0;a[b+118>>0]=m;a[b+119>>0]=k;m=gr(f|0,g|0,53)|0;a[b+120>>0]=m;m=gr(f|0,g|0,45)|0;a[b+121>>0]=m;m=gr(f|0,g|0,37)|0;a[b+122>>0]=m;m=gr(f|0,g|0,29)|0;a[b+123>>0]=m;m=gr(f|0,g|0,21)|0;a[b+124>>0]=m;m=gr(f|0,g|0,13)|0;a[b+125>>0]=m;m=gr(f|0,g|0,5)|0;a[b+126>>0]=m;a[b+127>>0]=j;fj(b,b,1)|0;Te(220);m=b+160|0;l=c[m>>2]|0;m=c[m+4>>2]|0;k=gr(l|0,m|0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]=k;a[b+35>>0]=m;k=gr(l|0,m|0,24)|0;a[b+36>>0]=k;k=gr(l|0,m|0,16)|0;a[b+37>>0]=k;m=gr(l|0,m|0,8)|0;a[b+38>>0]=m;a[b+39>>0]=l;l=b+200|0;m=c[l>>2]|0;l=c[l+4>>2]|0;k=gr(m|0,l|0,56)|0;a[b+40>>0]=k;k=gr(m|0,l|0,48)|0;a[b+41>>0]=k;k=gr(m|0,l|0,40)|0;a[b+42>>0]=k;a[b+43>>0]=l;k=gr(m|0,l|0,24)|0;a[b+44>>0]=k;k=gr(m|0,l|0,16)|0;a[b+45>>0]=k;l=gr(m|0,l|0,8)|0;a[b+46>>0]=l;a[b+47>>0]=m;m=b+208|0;l=c[m>>2]|0;m=c[m+4>>2]|0;k=gr(l|0,m|0,56)|0;a[b+48>>0]=k;k=gr(l|0,m|0,48)|0;a[b+49>>0]=k;k=gr(l|0,m|0,40)|0;a[b+50>>0]=k;a[b+51>>0]=m;k=gr(l|0,m|0,24)|0;a[b+52>>0]=k;k=gr(l|0,m|0,16)|0;a[b+53>>0]=k;m=gr(l|0,m|0,8)|0;a[b+54>>0]=m;a[b+55>>0]=l;l=b+216|0;m=c[l>>2]|0;l=c[l+4>>2]|0;k=gr(m|0,l|0,56)|0;a[b+56>>0]=k;k=gr(m|0,l|0,48)|0;a[b+57>>0]=k;k=gr(m|0,l|0,40)|0;a[b+58>>0]=k;a[b+59>>0]=l;k=gr(m|0,l|0,24)|0;a[b+60>>0]=k;k=gr(m|0,l|0,16)|0;a[b+61>>0]=k;l=gr(m|0,l|0,8)|0;a[b+62>>0]=l;a[b+63>>0]=m;return}function dj(a){a=a|0;return a|0}function ej(a,b,c){a=a|0;b=b|0;c=c|0;switch(a|0){case 9:{a=Im(9,0,42568,3,42572,48)|0;if(!a){if(!b){c=0;return c|0}a=Im(9,0,42621,112,42734,48)|0;if(!a){a=Im(9,1,0,0,42783,48)|0;if(!a){c=0;return c|0}else b=42857}else b=42845}else b=42832;if(!c){c=50;return c|0}zb[c&1](42873,9,b,a);c=50;return c|0}case 10:{a=Im(10,0,42568,3,42880,64)|0;if(!a){if(!b){c=0;return c|0}a=Im(10,0,42621,112,42945,64)|0;if(!a){a=Im(10,1,0,0,43010,64)|0;if(!a){c=0;return c|0}else b=42857}else b=42845}else b=42832;if(!c){c=50;return c|0}zb[c&1](42873,10,b,a);c=50;return c|0}default:{c=5;return c|0}}return 0}function fj(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0,Qa=0,Ra=0,Sa=0,Ta=0,Ua=0,Va=0,Wa=0,Xa=0,Ya=0,Za=0,_a=0,$a=0,ab=0,bb=0,cb=0;Ba=l;l=l+128|0;if((l|0)>=(m|0))$(128);ua=Ba;va=a+160|0;wa=a+168|0;xa=a+176|0;ya=a+184|0;za=a+192|0;Aa=a+200|0;ta=a+208|0;da=a+216|0;ea=ua+112|0;fa=ua+72|0;ga=ua+8|0;ha=ua+120|0;ia=ua+80|0;ja=ua+16|0;ka=ua+88|0;la=ua+24|0;ma=ua+96|0;na=ua+32|0;oa=ua+104|0;pa=ua+40|0;qa=ua+48|0;ra=ua+56|0;sa=ua+64|0;q=va;t=wa;u=xa;w=ya;g=za;i=Aa;k=ta;o=da;n=c[o>>2]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b>>2]=j;c[cb+4>>2]=k;cb=da;n=_q(c[cb>>2]|0,c[cb+4>>2]|0,o|0,n|0)|0;o=D;cb=da;c[cb>>2]=n;c[cb+4>>2]=o;e=e+-1|0;if(!e)break;else b=b+128|0}l=Ba;return 220}function gj(a,b){a=a|0;b=b|0;b=a+160|0;c[b>>2]=-1056596264;c[b+4>>2]=-876896931;b=a+168|0;c[b>>2]=914150663;c[b+4>>2]=1654270250;b=a+176|0;c[b>>2]=812702999;c[b+4>>2]=-1856437926;b=a+184|0;c[b>>2]=-150054599;c[b+4>>2]=355462360;b=a+192|0;c[b>>2]=-4191439;c[b+4>>2]=1731405415;b=a+200|0;c[b>>2]=1750603025;c[b+4>>2]=-1900787065;b=a+208|0;c[b>>2]=1694076839;c[b+4>>2]=-619958771;b=a+216|0;c[b>>2]=-1090891868;c[b+4>>2]=1203062813;b=a+128|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[a+148>>2]=128;c[a+152>>2]=34;return}function hj(a,b,c){a=a|0;b=b|0;c=c|0;c=kj(a,b,c)|0;Te(47);return c|0} +function ij(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0;i=((d[f+2>>0]|0)<<16|(d[f+3>>0]|0)<<24|(d[f+1>>0]|0)<<8|(d[f>>0]|0))^c[b+4096>>2];g=((d[f+6>>0]|0)<<16|(d[f+7>>0]|0)<<24|(d[f+5>>0]|0)<<8|(d[f+4>>0]|0))^c[b+4100>>2];h=((d[f+14>>0]|0)<<16|(d[f+15>>0]|0)<<24|(d[f+13>>0]|0)<<8|(d[f+12>>0]|0))^c[b+4108>>2];k=c[b+2048+((g>>>8&255)<<2)>>2]^c[b+1024+((g&255)<<2)>>2]^c[b+3072+((g>>>16&255)<<2)>>2]^c[b+(g>>>24<<2)>>2];j=k+(c[b+1024+((i>>>8&255)<<2)>>2]^c[b+((i&255)<<2)>>2]^c[b+2048+((i>>>16&255)<<2)>>2]^c[b+3072+(i>>>24<<2)>>2])|0;f=((d[f+10>>0]|0)<<16|(d[f+11>>0]|0)<<24|(d[f+9>>0]|0)<<8|(d[f+8>>0]|0))^c[b+4104>>2]^j+(c[b+4128>>2]|0);l=f>>>1;m=l|f<<31;h=k+(c[b+4132>>2]|0)+j^(h<<1|h>>>31);j=c[b+2048+((h>>>8&255)<<2)>>2]^c[b+1024+((h&255)<<2)>>2]^c[b+3072+((h>>>16&255)<<2)>>2]^c[b+(h>>>24<<2)>>2];f=j+(c[b+1024+((f>>>9&255)<<2)>>2]^c[b+((l&255)<<2)>>2]^c[b+2048+((f>>>17&255)<<2)>>2]^c[b+3072+(m>>>24<<2)>>2])|0;i=f+(c[b+4136>>2]|0)^i;l=i>>>1;k=l|i<<31;f=j+(c[b+4140>>2]|0)+f^(g<<1|g>>>31);g=c[b+2048+((f>>>8&255)<<2)>>2]^c[b+1024+((f&255)<<2)>>2]^c[b+3072+((f>>>16&255)<<2)>>2]^c[b+(f>>>24<<2)>>2];i=g+(c[b+1024+((i>>>9&255)<<2)>>2]^c[b+((l&255)<<2)>>2]^c[b+2048+((i>>>17&255)<<2)>>2]^c[b+3072+(k>>>24<<2)>>2])|0;m=i+(c[b+4144>>2]|0)^m;l=m>>>1;j=l|m<<31;h=g+(c[b+4148>>2]|0)+i^(h<<1|h>>>31);i=c[b+2048+((h>>>8&255)<<2)>>2]^c[b+1024+((h&255)<<2)>>2]^c[b+3072+((h>>>16&255)<<2)>>2]^c[b+(h>>>24<<2)>>2];m=i+(c[b+1024+((m>>>9&255)<<2)>>2]^c[b+((l&255)<<2)>>2]^c[b+2048+((m>>>17&255)<<2)>>2]^c[b+3072+(j>>>24<<2)>>2])|0;k=m+(c[b+4152>>2]|0)^k;l=k>>>1;g=l|k<<31;f=i+(c[b+4156>>2]|0)+m^(f<<1|f>>>31);m=c[b+2048+((f>>>8&255)<<2)>>2]^c[b+1024+((f&255)<<2)>>2]^c[b+3072+((f>>>16&255)<<2)>>2]^c[b+(f>>>24<<2)>>2];k=m+(c[b+1024+((k>>>9&255)<<2)>>2]^c[b+((l&255)<<2)>>2]^c[b+2048+((k>>>17&255)<<2)>>2]^c[b+3072+(g>>>24<<2)>>2])|0;j=k+(c[b+4160>>2]|0)^j;l=j>>>1;i=l|j<<31;h=m+(c[b+4164>>2]|0)+k^(h<<1|h>>>31);k=c[b+2048+((h>>>8&255)<<2)>>2]^c[b+1024+((h&255)<<2)>>2]^c[b+3072+((h>>>16&255)<<2)>>2]^c[b+(h>>>24<<2)>>2];j=k+(c[b+1024+((j>>>9&255)<<2)>>2]^c[b+((l&255)<<2)>>2]^c[b+2048+((j>>>17&255)<<2)>>2]^c[b+3072+(i>>>24<<2)>>2])|0;g=j+(c[b+4168>>2]|0)^g;l=g>>>1;m=l|g<<31;f=k+(c[b+4172>>2]|0)+j^(f<<1|f>>>31);j=c[b+2048+((f>>>8&255)<<2)>>2]^c[b+1024+((f&255)<<2)>>2]^c[b+3072+((f>>>16&255)<<2)>>2]^c[b+(f>>>24<<2)>>2];g=j+(c[b+1024+((g>>>9&255)<<2)>>2]^c[b+((l&255)<<2)>>2]^c[b+2048+((g>>>17&255)<<2)>>2]^c[b+3072+(m>>>24<<2)>>2])|0;i=g+(c[b+4176>>2]|0)^i;l=i>>>1;k=l|i<<31;h=j+(c[b+4180>>2]|0)+g^(h<<1|h>>>31);g=c[b+2048+((h>>>8&255)<<2)>>2]^c[b+1024+((h&255)<<2)>>2]^c[b+3072+((h>>>16&255)<<2)>>2]^c[b+(h>>>24<<2)>>2];i=g+(c[b+1024+((i>>>9&255)<<2)>>2]^c[b+((l&255)<<2)>>2]^c[b+2048+((i>>>17&255)<<2)>>2]^c[b+3072+(k>>>24<<2)>>2])|0;m=i+(c[b+4184>>2]|0)^m;l=m>>>1;j=l|m<<31;f=g+(c[b+4188>>2]|0)+i^(f<<1|f>>>31);i=c[b+2048+((f>>>8&255)<<2)>>2]^c[b+1024+((f&255)<<2)>>2]^c[b+3072+((f>>>16&255)<<2)>>2]^c[b+(f>>>24<<2)>>2];m=i+(c[b+1024+((m>>>9&255)<<2)>>2]^c[b+((l&255)<<2)>>2]^c[b+2048+((m>>>17&255)<<2)>>2]^c[b+3072+(j>>>24<<2)>>2])|0;k=m+(c[b+4192>>2]|0)^k;l=k>>>1;g=l|k<<31;h=i+(c[b+4196>>2]|0)+m^(h<<1|h>>>31);m=c[b+2048+((h>>>8&255)<<2)>>2]^c[b+1024+((h&255)<<2)>>2]^c[b+3072+((h>>>16&255)<<2)>>2]^c[b+(h>>>24<<2)>>2];k=m+(c[b+1024+((k>>>9&255)<<2)>>2]^c[b+((l&255)<<2)>>2]^c[b+2048+((k>>>17&255)<<2)>>2]^c[b+3072+(g>>>24<<2)>>2])|0;j=k+(c[b+4200>>2]|0)^j;l=j>>>1;i=l|j<<31;f=m+(c[b+4204>>2]|0)+k^(f<<1|f>>>31);k=c[b+2048+((f>>>8&255)<<2)>>2]^c[b+1024+((f&255)<<2)>>2]^c[b+3072+((f>>>16&255)<<2)>>2]^c[b+(f>>>24<<2)>>2];j=k+(c[b+1024+((j>>>9&255)<<2)>>2]^c[b+((l&255)<<2)>>2]^c[b+2048+((j>>>17&255)<<2)>>2]^c[b+3072+(i>>>24<<2)>>2])|0;g=j+(c[b+4208>>2]|0)^g;l=g>>>1;m=l|g<<31;h=k+(c[b+4212>>2]|0)+j^(h<<1|h>>>31);j=c[b+2048+((h>>>8&255)<<2)>>2]^c[b+1024+((h&255)<<2)>>2]^c[b+3072+((h>>>16&255)<<2)>>2]^c[b+(h>>>24<<2)>>2];g=j+(c[b+1024+((g>>>9&255)<<2)>>2]^c[b+((l&255)<<2)>>2]^c[b+2048+((g>>>17&255)<<2)>>2]^c[b+3072+(m>>>24<<2)>>2])|0;i=g+(c[b+4216>>2]|0)^i;l=i>>>1;k=l|i<<31;f=j+(c[b+4220>>2]|0)+g^(f<<1|f>>>31);g=c[b+2048+((f>>>8&255)<<2)>>2]^c[b+1024+((f&255)<<2)>>2]^c[b+3072+((f>>>16&255)<<2)>>2]^c[b+(f>>>24<<2)>>2];i=g+(c[b+1024+((i>>>9&255)<<2)>>2]^c[b+((l&255)<<2)>>2]^c[b+2048+((i>>>17&255)<<2)>>2]^c[b+3072+(k>>>24<<2)>>2])|0;m=i+(c[b+4224>>2]|0)^m;l=m>>>1;j=l|m<<31;h=g+(c[b+4228>>2]|0)+i^(h<<1|h>>>31);i=c[b+2048+((h>>>8&255)<<2)>>2]^c[b+1024+((h&255)<<2)>>2]^c[b+3072+((h>>>16&255)<<2)>>2]^c[b+(h>>>24<<2)>>2];m=i+(c[b+1024+((m>>>9&255)<<2)>>2]^c[b+((l&255)<<2)>>2]^c[b+2048+((m>>>17&255)<<2)>>2]^c[b+3072+(j>>>24<<2)>>2])|0;k=m+(c[b+4232>>2]|0)^k;l=k>>>1;g=l|k<<31;f=i+(c[b+4236>>2]|0)+m^(f<<1|f>>>31);m=c[b+2048+((f>>>8&255)<<2)>>2]^c[b+1024+((f&255)<<2)>>2]^c[b+3072+((f>>>16&255)<<2)>>2]^c[b+(f>>>24<<2)>>2];k=m+(c[b+1024+((k>>>9&255)<<2)>>2]^c[b+((l&255)<<2)>>2]^c[b+2048+((k>>>17&255)<<2)>>2]^c[b+3072+(g>>>24<<2)>>2])|0;j=k+(c[b+4240>>2]|0)^j;l=j>>>1;i=l|j<<31;h=m+(c[b+4244>>2]|0)+k^(h<<1|h>>>31);k=c[b+2048+((h>>>8&255)<<2)>>2]^c[b+1024+((h&255)<<2)>>2]^c[b+3072+((h>>>16&255)<<2)>>2]^c[b+(h>>>24<<2)>>2];j=k+(c[b+1024+((j>>>9&255)<<2)>>2]^c[b+((l&255)<<2)>>2]^c[b+2048+((j>>>17&255)<<2)>>2]^c[b+3072+(i>>>24<<2)>>2])|0;g=j+(c[b+4248>>2]|0)^g;f=k+(c[b+4252>>2]|0)+j^(f<<1|f>>>31);i=c[b+4112>>2]^i;a[e+3>>0]=i>>>24;a[e+2>>0]=i>>>16;a[e+1>>0]=i>>>8;a[e>>0]=i;h=c[b+4116>>2]^h;a[e+7>>0]=h>>>24;a[e+6>>0]=h>>>16;a[e+5>>0]=h>>>8;a[e+4>>0]=h;g=c[b+4120>>2]^(g>>>1|g<<31);a[e+11>>0]=g>>>24;a[e+10>>0]=g>>>16;a[e+9>>0]=g>>>8;a[e+8>>0]=g;f=f^c[b+4124>>2];a[e+15>>0]=f>>>24;a[e+14>>0]=f>>>16;a[e+13>>0]=f>>>8;a[e+12>>0]=f;return 36}function jj(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0;g=((d[f+2>>0]|0)<<16|(d[f+3>>0]|0)<<24|(d[f+1>>0]|0)<<8|(d[f>>0]|0))^c[b+4112>>2];h=((d[f+6>>0]|0)<<16|(d[f+7>>0]|0)<<24|(d[f+5>>0]|0)<<8|(d[f+4>>0]|0))^c[b+4116>>2];i=((d[f+10>>0]|0)<<16|(d[f+11>>0]|0)<<24|(d[f+9>>0]|0)<<8|(d[f+8>>0]|0))^c[b+4120>>2];k=c[b+2048+((h>>>8&255)<<2)>>2]^c[b+1024+((h&255)<<2)>>2]^c[b+3072+((h>>>16&255)<<2)>>2]^c[b+(h>>>24<<2)>>2];j=k+(c[b+1024+((g>>>8&255)<<2)>>2]^c[b+((g&255)<<2)>>2]^c[b+2048+((g>>>16&255)<<2)>>2]^c[b+3072+(g>>>24<<2)>>2])|0;f=((d[f+14>>0]|0)<<16|(d[f+15>>0]|0)<<24|(d[f+13>>0]|0)<<8|(d[f+12>>0]|0))^c[b+4124>>2]^(c[b+4252>>2]|0)+k+j;k=f>>>1;l=k|f<<31;i=j+(c[b+4248>>2]|0)^(i<<1|i>>>31);f=c[b+2048+((f>>>9&255)<<2)>>2]^c[b+1024+((k&255)<<2)>>2]^c[b+3072+((f>>>17&255)<<2)>>2]^c[b+(l>>>24<<2)>>2];k=f+(c[b+1024+((i>>>8&255)<<2)>>2]^c[b+((i&255)<<2)>>2]^c[b+2048+((i>>>16&255)<<2)>>2]^c[b+3072+(i>>>24<<2)>>2])|0;h=(c[b+4244>>2]|0)+f+k^h;f=h>>>1;j=f|h<<31;g=k+(c[b+4240>>2]|0)^(g<<1|g>>>31);h=c[b+2048+((h>>>9&255)<<2)>>2]^c[b+1024+((f&255)<<2)>>2]^c[b+3072+((h>>>17&255)<<2)>>2]^c[b+(j>>>24<<2)>>2];f=h+(c[b+1024+((g>>>8&255)<<2)>>2]^c[b+((g&255)<<2)>>2]^c[b+2048+((g>>>16&255)<<2)>>2]^c[b+3072+(g>>>24<<2)>>2])|0;l=(c[b+4236>>2]|0)+h+f^l;h=l>>>1;k=h|l<<31;i=f+(c[b+4232>>2]|0)^(i<<1|i>>>31);l=c[b+2048+((l>>>9&255)<<2)>>2]^c[b+1024+((h&255)<<2)>>2]^c[b+3072+((l>>>17&255)<<2)>>2]^c[b+(k>>>24<<2)>>2];h=l+(c[b+1024+((i>>>8&255)<<2)>>2]^c[b+((i&255)<<2)>>2]^c[b+2048+((i>>>16&255)<<2)>>2]^c[b+3072+(i>>>24<<2)>>2])|0;j=(c[b+4228>>2]|0)+l+h^j;l=j>>>1;f=l|j<<31;g=h+(c[b+4224>>2]|0)^(g<<1|g>>>31);j=c[b+2048+((j>>>9&255)<<2)>>2]^c[b+1024+((l&255)<<2)>>2]^c[b+3072+((j>>>17&255)<<2)>>2]^c[b+(f>>>24<<2)>>2];l=j+(c[b+1024+((g>>>8&255)<<2)>>2]^c[b+((g&255)<<2)>>2]^c[b+2048+((g>>>16&255)<<2)>>2]^c[b+3072+(g>>>24<<2)>>2])|0;k=(c[b+4220>>2]|0)+j+l^k;j=k>>>1;h=j|k<<31;i=l+(c[b+4216>>2]|0)^(i<<1|i>>>31);k=c[b+2048+((k>>>9&255)<<2)>>2]^c[b+1024+((j&255)<<2)>>2]^c[b+3072+((k>>>17&255)<<2)>>2]^c[b+(h>>>24<<2)>>2];j=k+(c[b+1024+((i>>>8&255)<<2)>>2]^c[b+((i&255)<<2)>>2]^c[b+2048+((i>>>16&255)<<2)>>2]^c[b+3072+(i>>>24<<2)>>2])|0;f=(c[b+4212>>2]|0)+k+j^f;k=f>>>1;l=k|f<<31;g=j+(c[b+4208>>2]|0)^(g<<1|g>>>31);f=c[b+2048+((f>>>9&255)<<2)>>2]^c[b+1024+((k&255)<<2)>>2]^c[b+3072+((f>>>17&255)<<2)>>2]^c[b+(l>>>24<<2)>>2];k=f+(c[b+1024+((g>>>8&255)<<2)>>2]^c[b+((g&255)<<2)>>2]^c[b+2048+((g>>>16&255)<<2)>>2]^c[b+3072+(g>>>24<<2)>>2])|0;h=(c[b+4204>>2]|0)+f+k^h;f=h>>>1;j=f|h<<31;i=k+(c[b+4200>>2]|0)^(i<<1|i>>>31);h=c[b+2048+((h>>>9&255)<<2)>>2]^c[b+1024+((f&255)<<2)>>2]^c[b+3072+((h>>>17&255)<<2)>>2]^c[b+(j>>>24<<2)>>2];f=h+(c[b+1024+((i>>>8&255)<<2)>>2]^c[b+((i&255)<<2)>>2]^c[b+2048+((i>>>16&255)<<2)>>2]^c[b+3072+(i>>>24<<2)>>2])|0;l=(c[b+4196>>2]|0)+h+f^l;h=l>>>1;k=h|l<<31;g=f+(c[b+4192>>2]|0)^(g<<1|g>>>31);l=c[b+2048+((l>>>9&255)<<2)>>2]^c[b+1024+((h&255)<<2)>>2]^c[b+3072+((l>>>17&255)<<2)>>2]^c[b+(k>>>24<<2)>>2];h=l+(c[b+1024+((g>>>8&255)<<2)>>2]^c[b+((g&255)<<2)>>2]^c[b+2048+((g>>>16&255)<<2)>>2]^c[b+3072+(g>>>24<<2)>>2])|0;j=(c[b+4188>>2]|0)+l+h^j;l=j>>>1;f=l|j<<31;i=h+(c[b+4184>>2]|0)^(i<<1|i>>>31);j=c[b+2048+((j>>>9&255)<<2)>>2]^c[b+1024+((l&255)<<2)>>2]^c[b+3072+((j>>>17&255)<<2)>>2]^c[b+(f>>>24<<2)>>2];l=j+(c[b+1024+((i>>>8&255)<<2)>>2]^c[b+((i&255)<<2)>>2]^c[b+2048+((i>>>16&255)<<2)>>2]^c[b+3072+(i>>>24<<2)>>2])|0;k=(c[b+4180>>2]|0)+j+l^k;j=k>>>1;h=j|k<<31;g=l+(c[b+4176>>2]|0)^(g<<1|g>>>31);k=c[b+2048+((k>>>9&255)<<2)>>2]^c[b+1024+((j&255)<<2)>>2]^c[b+3072+((k>>>17&255)<<2)>>2]^c[b+(h>>>24<<2)>>2];j=k+(c[b+1024+((g>>>8&255)<<2)>>2]^c[b+((g&255)<<2)>>2]^c[b+2048+((g>>>16&255)<<2)>>2]^c[b+3072+(g>>>24<<2)>>2])|0;f=(c[b+4172>>2]|0)+k+j^f;k=f>>>1;l=k|f<<31;i=j+(c[b+4168>>2]|0)^(i<<1|i>>>31);f=c[b+2048+((f>>>9&255)<<2)>>2]^c[b+1024+((k&255)<<2)>>2]^c[b+3072+((f>>>17&255)<<2)>>2]^c[b+(l>>>24<<2)>>2];k=f+(c[b+1024+((i>>>8&255)<<2)>>2]^c[b+((i&255)<<2)>>2]^c[b+2048+((i>>>16&255)<<2)>>2]^c[b+3072+(i>>>24<<2)>>2])|0;h=(c[b+4164>>2]|0)+f+k^h;f=h>>>1;j=f|h<<31;g=k+(c[b+4160>>2]|0)^(g<<1|g>>>31);h=c[b+2048+((h>>>9&255)<<2)>>2]^c[b+1024+((f&255)<<2)>>2]^c[b+3072+((h>>>17&255)<<2)>>2]^c[b+(j>>>24<<2)>>2];f=h+(c[b+1024+((g>>>8&255)<<2)>>2]^c[b+((g&255)<<2)>>2]^c[b+2048+((g>>>16&255)<<2)>>2]^c[b+3072+(g>>>24<<2)>>2])|0;l=(c[b+4156>>2]|0)+h+f^l;h=l>>>1;k=h|l<<31;i=f+(c[b+4152>>2]|0)^(i<<1|i>>>31);l=c[b+2048+((l>>>9&255)<<2)>>2]^c[b+1024+((h&255)<<2)>>2]^c[b+3072+((l>>>17&255)<<2)>>2]^c[b+(k>>>24<<2)>>2];h=l+(c[b+1024+((i>>>8&255)<<2)>>2]^c[b+((i&255)<<2)>>2]^c[b+2048+((i>>>16&255)<<2)>>2]^c[b+3072+(i>>>24<<2)>>2])|0;j=(c[b+4148>>2]|0)+l+h^j;l=j>>>1;f=l|j<<31;g=h+(c[b+4144>>2]|0)^(g<<1|g>>>31);j=c[b+2048+((j>>>9&255)<<2)>>2]^c[b+1024+((l&255)<<2)>>2]^c[b+3072+((j>>>17&255)<<2)>>2]^c[b+(f>>>24<<2)>>2];l=j+(c[b+1024+((g>>>8&255)<<2)>>2]^c[b+((g&255)<<2)>>2]^c[b+2048+((g>>>16&255)<<2)>>2]^c[b+3072+(g>>>24<<2)>>2])|0;k=(c[b+4140>>2]|0)+j+l^k;j=k>>>1;h=j|k<<31;i=l+(c[b+4136>>2]|0)^(i<<1|i>>>31);k=c[b+2048+((k>>>9&255)<<2)>>2]^c[b+1024+((j&255)<<2)>>2]^c[b+3072+((k>>>17&255)<<2)>>2]^c[b+(h>>>24<<2)>>2];j=k+(c[b+1024+((i>>>8&255)<<2)>>2]^c[b+((i&255)<<2)>>2]^c[b+2048+((i>>>16&255)<<2)>>2]^c[b+3072+(i>>>24<<2)>>2])|0;f=(c[b+4132>>2]|0)+k+j^f;g=j+(c[b+4128>>2]|0)^(g<<1|g>>>31);i=c[b+4096>>2]^i;a[e+3>>0]=i>>>24;a[e+2>>0]=i>>>16;a[e+1>>0]=i>>>8;a[e>>0]=i;h=c[b+4100>>2]^h;a[e+7>>0]=h>>>24;a[e+6>>0]=h>>>16;a[e+5>>0]=h>>>8;a[e+4>>0]=h;g=g^c[b+4104>>2];a[e+11>>0]=g>>>24;a[e+10>>0]=g>>>16;a[e+9>>0]=g>>>8;a[e+8>>0]=g;f=c[b+4108>>2]^(f>>>1|f<<31);a[e+15>>0]=f>>>24;a[e+14>>0]=f>>>16;a[e+13>>0]=f>>>8;a[e+12>>0]=f;return 36}function kj(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0;ea=l;l=l+4288|0;if((l|0)>=(m|0))$(4288);i=ea;g=ea+8|0;h=ea+4264|0;if((f+-16|16|0)!=16){e=44;l=ea;return e|0}do if(!(c[17618]|0)){c[17618]=1;kj(g,43199,16)|0;Te(47);ij(g,h,43215)|0;if(!(Tp(h,43231,16)|0)){jj(g,h,h)|0;if(!(Tp(h,43215,16)|0)){kj(g,43247,32)|0;Te(47);ij(g,h,43279)|0;if(!(Tp(h,43295,16)|0)){jj(g,h,h)|0;if(!(Tp(h,43279,16)|0)){g=ym(43191,13,14,8,4,16,4256)|0;if(!g){g=wm(43191,13,14,6,5,16,4256)|0;if(!g){g=xm(43191,13,14,7,5,16,4256)|0;c[17619]=g;if(!g)break}else j=9}else j=9}else{g=43311;j=9}}else{g=43347;j=9}}else{g=43383;j=9}}else{g=43419;j=9}if((j|0)==9)c[17619]=g;c[i>>2]=g;Le(43455,i);j=12}else j=12;while(0);if((j|0)==12?c[17619]|0:0){e=50;l=ea;return e|0}g=a[e>>0]|0;if(!(g<<24>>24)){h=0;i=0;j=0}else{j=d[43459+((g&255)+-1)>>0]|0;h=a[43714+(j+1)>>0]|0;i=a[43714+(j+45)>>0]|0;j=a[43714+j>>0]|0}da=e+1|0;g=a[da>>0]|0;if(!(g<<24>>24))k=i;else{ca=d[43459+((g&255)+-1)>>0]|0;k=a[43714+(ca+138)>>0]^i;h=a[43714+(ca+68)>>0]^h;i=a[43714+(ca+164)>>0]^i;j=a[43714+(ca+45)>>0]^j}ca=e+2|0;g=a[ca>>0]|0;if(g<<24>>24){ba=d[43459+((g&255)+-1)>>0]|0;k=a[43714+(ba+209)>>0]^k;h=a[43714+(ba+191)>>0]^h;i=a[43714+(ba+213)>>0]^i;j=a[43714+(ba+138)>>0]^j}ba=e+3|0;g=a[ba>>0]|0;if(g<<24>>24){aa=d[43459+((g&255)+-1)>>0]|0;k=a[43714+(aa+153)>>0]^k;h=a[43714+(aa+61)>>0]^h;i=a[43714+(aa+127)>>0]^i;j=a[43714+(aa+209)>>0]^j}aa=e+4|0;g=a[aa>>0]|0;if(g<<24>>24){_=d[43459+((g&255)+-1)>>0]|0;k=a[43714+(_+150)>>0]^k;h=a[43714+(_+102)>>0]^h;i=a[43714+(_+70)>>0]^i;j=a[43714+(_+153)>>0]^j}_=e+5|0;g=a[_>>0]|0;if(g<<24>>24){Z=d[43459+((g&255)+-1)>>0]|0;k=a[43714+(Z+237)>>0]^k;h=a[43714+(Z+91)>>0]^h;i=a[43714+(Z+60)>>0]^i;j=a[43714+(Z+150)>>0]^j}Z=e+6|0;g=a[Z>>0]|0;if(g<<24>>24){Y=d[43459+((g&255)+-1)>>0]|0;k=a[43714+(Y+224)>>0]^k;h=a[43714+(Y+79)>>0]^h;i=a[43714+(Y+55)>>0]^i;j=a[43714+(Y+237)>>0]^j}Y=e+7|0;g=a[Y>>0]|0;if(g<<24>>24){X=d[43459+((g&255)+-1)>>0]|0;k=a[43714+(X+23)>>0]^k;h=a[43714+(X+140)>>0]^h;i=a[43714+(X+208)>>0]^i;j=a[43714+(X+224)>>0]^j}X=e+8|0;g=a[X>>0]|0;if(!(g<<24>>24)){n=0;o=0;p=0}else{p=d[43459+((g&255)+-1)>>0]|0;n=a[43714+(p+1)>>0]|0;o=a[43714+(p+45)>>0]|0;p=a[43714+p>>0]|0}W=e+9|0;g=a[W>>0]|0;if(!(g<<24>>24))q=o;else{V=d[43459+((g&255)+-1)>>0]|0;q=a[43714+(V+138)>>0]^o;n=a[43714+(V+68)>>0]^n;o=a[43714+(V+164)>>0]^o;p=a[43714+(V+45)>>0]^p}V=e+10|0;g=a[V>>0]|0;if(g<<24>>24){U=d[43459+((g&255)+-1)>>0]|0;q=a[43714+(U+209)>>0]^q;n=a[43714+(U+191)>>0]^n;o=a[43714+(U+213)>>0]^o;p=a[43714+(U+138)>>0]^p}U=e+11|0;g=a[U>>0]|0;if(g<<24>>24){T=d[43459+((g&255)+-1)>>0]|0;q=a[43714+(T+153)>>0]^q;n=a[43714+(T+61)>>0]^n;o=a[43714+(T+127)>>0]^o;p=a[43714+(T+209)>>0]^p}T=e+12|0;g=a[T>>0]|0;if(g<<24>>24){S=d[43459+((g&255)+-1)>>0]|0;q=a[43714+(S+150)>>0]^q;n=a[43714+(S+102)>>0]^n;o=a[43714+(S+70)>>0]^o;p=a[43714+(S+153)>>0]^p}S=e+13|0;g=a[S>>0]|0;if(g<<24>>24){R=d[43459+((g&255)+-1)>>0]|0;q=a[43714+(R+237)>>0]^q;n=a[43714+(R+91)>>0]^n;o=a[43714+(R+60)>>0]^o;p=a[43714+(R+150)>>0]^p}R=e+14|0;g=a[R>>0]|0;if(g<<24>>24){Q=d[43459+((g&255)+-1)>>0]|0;q=a[43714+(Q+224)>>0]^q;n=a[43714+(Q+79)>>0]^n;o=a[43714+(Q+55)>>0]^o;p=a[43714+(Q+237)>>0]^p}Q=e+15|0;g=a[Q>>0]|0;if(g<<24>>24){P=d[43459+((g&255)+-1)>>0]|0;q=a[43714+(P+23)>>0]^q;n=a[43714+(P+140)>>0]^n;o=a[43714+(P+208)>>0]^o;p=a[43714+(P+224)>>0]^p}if((f|0)!=32){g=1;f=0;r=0;while(1){O=a[44206+f>>0]|0;c[b+(r<<2)>>2]=c[8012+(((a[44974+((O^j)&255)>>0]^p)&255)<<2)>>2];P=a[44206+g>>0]|0;c[b+1024+(r<<2)>>2]=c[9036+(((a[44974+((P^i)&255)>>0]^o)&255)<<2)>>2];c[b+2048+(r<<2)>>2]=c[10060+(((a[44718+((O^h)&255)>>0]^n)&255)<<2)>>2];c[b+3072+(r<<2)>>2]=c[11084+(((a[44718+((P^k)&255)>>0]^q)&255)<<2)>>2];r=r+1|0;if((r|0)==256)break;else{g=g+2|0;f=f+2|0}}P=c[9036+(((a[_>>0]^a[44974+((d[S>>0]|0)^243)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((d[T>>0]|0)^103)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((d[R>>0]|0)^103)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((d[Q>>0]|0)^243)>>0])&255)<<2)>>2];P=P<<8|P>>>24;O=P+(c[9036+(((a[da>>0]^a[44974+((d[W>>0]|0)^117)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((d[X>>0]|0)^169)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((d[V>>0]|0)^169)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((d[U>>0]|0)^117)>>0])&255)<<2)>>2])|0;P=O+P|0;c[b+4096>>2]=O;c[b+4100>>2]=P<<9|P>>>23;P=c[9036+(((a[_>>0]^a[44974+((d[S>>0]|0)^244)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((d[T>>0]|0)^232)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((d[R>>0]|0)^232)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((d[Q>>0]|0)^244)>>0])&255)<<2)>>2];P=P<<8|P>>>24;O=P+(c[9036+(((a[da>>0]^a[44974+((d[W>>0]|0)^198)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((d[X>>0]|0)^179)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((d[V>>0]|0)^179)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((d[U>>0]|0)^198)>>0])&255)<<2)>>2])|0;P=O+P|0;c[b+4104>>2]=O;c[b+4108>>2]=P<<9|P>>>23;P=c[9036+(((a[_>>0]^a[44974+((d[S>>0]|0)^123)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((d[T>>0]|0)^253)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((d[R>>0]|0)^253)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((d[Q>>0]|0)^123)>>0])&255)<<2)>>2];P=P<<8|P>>>24;O=P+(c[9036+(((a[da>>0]^a[44974+((d[W>>0]|0)^219)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((d[X>>0]|0)^4)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((d[V>>0]|0)^4)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((d[U>>0]|0)^219)>>0])&255)<<2)>>2])|0;P=O+P|0;c[b+4112>>2]=O;c[b+4116>>2]=P<<9|P>>>23;P=c[9036+(((a[_>>0]^a[44974+((d[S>>0]|0)^200)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((d[T>>0]|0)^118)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((d[R>>0]|0)^118)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((d[Q>>0]|0)^200)>>0])&255)<<2)>>2];P=P<<8|P>>>24;O=P+(c[9036+(((a[da>>0]^a[44974+((d[W>>0]|0)^251)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((d[X>>0]|0)^163)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((d[V>>0]|0)^163)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((d[U>>0]|0)^251)>>0])&255)<<2)>>2])|0;P=O+P|0;c[b+4120>>2]=O;c[b+4124>>2]=P<<9|P>>>23;P=c[9036+(((a[_>>0]^a[44974+((d[S>>0]|0)^211)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((d[T>>0]|0)^146)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((d[R>>0]|0)^146)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((d[Q>>0]|0)^211)>>0])&255)<<2)>>2];P=P<<8|P>>>24;O=P+(c[9036+(((a[da>>0]^a[44974+((d[W>>0]|0)^74)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((d[X>>0]|0)^154)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((d[V>>0]|0)^154)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((d[U>>0]|0)^74)>>0])&255)<<2)>>2])|0;P=O+P|0;c[b+4128>>2]=O;c[b+4132>>2]=P<<9|P>>>23;P=c[9036+(((a[_>>0]^a[44974+((d[S>>0]|0)^107)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((d[T>>0]|0)^120)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((d[R>>0]|0)^120)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((d[Q>>0]|0)^107)>>0])&255)<<2)>>2];P=P<<8|P>>>24;O=P+(c[9036+(((a[da>>0]^a[44974+((d[W>>0]|0)^230)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((d[X>>0]|0)^128)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((d[V>>0]|0)^128)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((d[U>>0]|0)^230)>>0])&255)<<2)>>2])|0;P=O+P|0;c[b+4136>>2]=O;c[b+4140>>2]=P<<9|P>>>23;P=c[9036+(((a[_>>0]^a[44974+((d[S>>0]|0)^125)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((d[T>>0]|0)^221)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((d[R>>0]|0)^221)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((d[Q>>0]|0)^125)>>0])&255)<<2)>>2];P=P<<8|P>>>24;O=P+(c[9036+(((a[da>>0]^a[44974+((d[W>>0]|0)^69)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((d[X>>0]|0)^228)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((d[V>>0]|0)^228)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((d[U>>0]|0)^69)>>0])&255)<<2)>>2])|0;P=O+P|0;c[b+4144>>2]=O;c[b+4148>>2]=P<<9|P>>>23;P=c[9036+(((a[_>>0]^a[44974+((d[S>>0]|0)^75)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((d[T>>0]|0)^56)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((d[R>>0]|0)^56)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((d[Q>>0]|0)^75)>>0])&255)<<2)>>2];P=P<<8|P>>>24;O=P+(c[9036+(((a[da>>0]^a[44974+((d[W>>0]|0)^232)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((d[X>>0]|0)^209)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((d[V>>0]|0)^209)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((d[U>>0]|0)^232)>>0])&255)<<2)>>2])|0;P=O+P|0;c[b+4152>>2]=O;c[b+4156>>2]=P<<9|P>>>23;P=c[9036+(((a[_>>0]^a[44974+((d[S>>0]|0)^50)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((d[T>>0]|0)^198)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((d[R>>0]|0)^198)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((d[Q>>0]|0)^50)>>0])&255)<<2)>>2];P=P<<8|P>>>24;O=P+(c[9036+(((a[da>>0]^a[44974+((d[W>>0]|0)^214)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((d[X>>0]|0)^13)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((d[V>>0]|0)^13)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((d[U>>0]|0)^214)>>0])&255)<<2)>>2])|0;P=O+P|0;c[b+4160>>2]=O;c[b+4164>>2]=P<<9|P>>>23;P=c[9036+(((a[_>>0]^a[44974+((d[S>>0]|0)^253)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((d[T>>0]|0)^152)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((d[R>>0]|0)^152)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((d[Q>>0]|0)^253)>>0])&255)<<2)>>2];P=P<<8|P>>>24;O=P+(c[9036+(((a[da>>0]^a[44974+((d[W>>0]|0)^216)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((d[X>>0]|0)^53)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((d[V>>0]|0)^53)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((d[U>>0]|0)^216)>>0])&255)<<2)>>2])|0;P=O+P|0;c[b+4168>>2]=O;c[b+4172>>2]=P<<9|P>>>23;P=c[9036+(((a[_>>0]^a[44974+((d[S>>0]|0)^113)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((d[T>>0]|0)^247)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((d[R>>0]|0)^247)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((d[Q>>0]|0)^113)>>0])&255)<<2)>>2];P=P<<8|P>>>24;O=P+(c[9036+(((a[da>>0]^a[44974+((d[W>>0]|0)^55)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((d[X>>0]|0)^24)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((d[V>>0]|0)^24)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((d[U>>0]|0)^55)>>0])&255)<<2)>>2])|0;P=O+P|0;c[b+4176>>2]=O;c[b+4180>>2]=P<<9|P>>>23;P=c[9036+(((a[_>>0]^a[44974+((d[S>>0]|0)^225)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((d[T>>0]|0)^108)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((d[R>>0]|0)^108)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((d[Q>>0]|0)^225)>>0])&255)<<2)>>2];P=P<<8|P>>>24;O=P+(c[9036+(((a[da>>0]^a[44974+((d[W>>0]|0)^241)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((d[X>>0]|0)^236)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((d[V>>0]|0)^236)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((d[U>>0]|0)^241)>>0])&255)<<2)>>2])|0;P=O+P|0;c[b+4184>>2]=O;c[b+4188>>2]=P<<9|P>>>23;P=c[9036+(((a[_>>0]^a[44974+((d[S>>0]|0)^15)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((d[T>>0]|0)^117)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((d[R>>0]|0)^117)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((d[Q>>0]|0)^15)>>0])&255)<<2)>>2];P=P<<8|P>>>24;O=P+(c[9036+(((a[da>>0]^a[44974+((d[W>>0]|0)^48)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((d[X>>0]|0)^67)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((d[V>>0]|0)^67)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((d[U>>0]|0)^48)>>0])&255)<<2)>>2])|0;P=O+P|0;c[b+4192>>2]=O;c[b+4196>>2]=P<<9|P>>>23;P=c[9036+(((a[_>>0]^a[44974+((d[S>>0]|0)^27)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((d[T>>0]|0)^38)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((d[R>>0]|0)^38)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((d[Q>>0]|0)^27)>>0])&255)<<2)>>2];P=P<<8|P>>>24;O=P+(c[9036+(((a[da>>0]^a[44974+((d[W>>0]|0)^248)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((d[X>>0]|0)^55)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((d[V>>0]|0)^55)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((d[U>>0]|0)^248)>>0])&255)<<2)>>2])|0;P=O+P|0;c[b+4200>>2]=O;c[b+4204>>2]=P<<9|P>>>23;P=c[9036+(((a[_>>0]^a[44974+((d[S>>0]|0)^250)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((d[T>>0]|0)^19)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((d[R>>0]|0)^19)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((d[Q>>0]|0)^250)>>0])&255)<<2)>>2];P=P<<8|P>>>24;O=P+(c[9036+(((a[da>>0]^a[44974+((d[W>>0]|0)^135)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((d[X>>0]|0)^250)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((d[V>>0]|0)^250)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((d[U>>0]|0)^135)>>0])&255)<<2)>>2])|0;P=O+P|0;c[b+4208>>2]=O;c[b+4212>>2]=P<<9|P>>>23;P=c[9036+(((a[_>>0]^a[44974+((d[S>>0]|0)^63)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((d[T>>0]|0)^72)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((d[R>>0]|0)^72)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((d[Q>>0]|0)^63)>>0])&255)<<2)>>2];P=P<<8|P>>>24;O=P+(c[9036+(((a[da>>0]^a[44974+((d[W>>0]|0)^6)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((d[X>>0]|0)^148)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((d[V>>0]|0)^148)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((d[U>>0]|0)^6)>>0])&255)<<2)>>2])|0;P=O+P|0;c[b+4216>>2]=O;c[b+4220>>2]=P<<9|P>>>23;P=c[9036+(((a[_>>0]^a[44974+((d[S>>0]|0)^186)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((d[T>>0]|0)^208)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((d[R>>0]|0)^208)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((d[Q>>0]|0)^186)>>0])&255)<<2)>>2];P=P<<8|P>>>24;O=P+(c[9036+(((a[da>>0]^a[44974+((d[W>>0]|0)^94)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((d[X>>0]|0)^242)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((d[V>>0]|0)^242)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((d[U>>0]|0)^94)>>0])&255)<<2)>>2])|0;P=O+P|0;c[b+4224>>2]=O;c[b+4228>>2]=P<<9|P>>>23;P=c[9036+(((a[_>>0]^a[44974+((d[S>>0]|0)^91)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((d[T>>0]|0)^48)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((d[R>>0]|0)^48)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((d[Q>>0]|0)^91)>>0])&255)<<2)>>2];P=P<<8|P>>>24;O=P+(c[9036+(((a[da>>0]^a[44974+((d[W>>0]|0)^174)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((d[X>>0]|0)^139)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((d[V>>0]|0)^139)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((d[U>>0]|0)^174)>>0])&255)<<2)>>2])|0;P=O+P|0;c[b+4232>>2]=O;c[b+4236>>2]=P<<9|P>>>23;P=c[9036+(((a[_>>0]^a[44974+(d[S>>0]|0)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((d[T>>0]|0)^84)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((d[R>>0]|0)^84)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+(d[Q>>0]|0)>>0])&255)<<2)>>2];P=P<<8|P>>>24;O=P+(c[9036+(((a[da>>0]^a[44974+((d[W>>0]|0)^138)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((d[X>>0]|0)^132)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((d[V>>0]|0)^132)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((d[U>>0]|0)^138)>>0])&255)<<2)>>2])|0;P=O+P|0;c[b+4240>>2]=O;c[b+4244>>2]=P<<9|P>>>23;aa=c[9036+(((a[_>>0]^a[44974+((d[S>>0]|0)^157)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((d[T>>0]|0)^35)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((d[R>>0]|0)^35)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((d[Q>>0]|0)^157)>>0])&255)<<2)>>2];aa=aa<<8|aa>>>24;da=aa+(c[9036+(((a[da>>0]^a[44974+((d[W>>0]|0)^188)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((d[X>>0]|0)^223)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((d[V>>0]|0)^223)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((d[U>>0]|0)^188)>>0])&255)<<2)>>2])|0;e=da+aa|0;c[b+4248>>2]=da;c[b+4252>>2]=e<<9|e>>>23;e=0;l=ea;return e|0}P=e+16|0;g=a[P>>0]|0;if(!(g<<24>>24)){f=0;r=0;s=0}else{s=d[43459+((g&255)+-1)>>0]|0;f=a[43714+(s+1)>>0]|0;r=a[43714+(s+45)>>0]|0;s=a[43714+s>>0]|0}O=e+17|0;g=a[O>>0]|0;if(!(g<<24>>24))t=r;else{N=d[43459+((g&255)+-1)>>0]|0;t=a[43714+(N+138)>>0]^r;f=a[43714+(N+68)>>0]^f;r=a[43714+(N+164)>>0]^r;s=a[43714+(N+45)>>0]^s}N=e+18|0;g=a[N>>0]|0;if(g<<24>>24){M=d[43459+((g&255)+-1)>>0]|0;t=a[43714+(M+209)>>0]^t;f=a[43714+(M+191)>>0]^f;r=a[43714+(M+213)>>0]^r;s=a[43714+(M+138)>>0]^s}M=e+19|0;g=a[M>>0]|0;if(g<<24>>24){L=d[43459+((g&255)+-1)>>0]|0;t=a[43714+(L+153)>>0]^t;f=a[43714+(L+61)>>0]^f;r=a[43714+(L+127)>>0]^r;s=a[43714+(L+209)>>0]^s}L=e+20|0;g=a[L>>0]|0;if(g<<24>>24){K=d[43459+((g&255)+-1)>>0]|0;t=a[43714+(K+150)>>0]^t;f=a[43714+(K+102)>>0]^f;r=a[43714+(K+70)>>0]^r;s=a[43714+(K+153)>>0]^s}K=e+21|0;g=a[K>>0]|0;if(g<<24>>24){J=d[43459+((g&255)+-1)>>0]|0;t=a[43714+(J+237)>>0]^t;f=a[43714+(J+91)>>0]^f;r=a[43714+(J+60)>>0]^r;s=a[43714+(J+150)>>0]^s}J=e+22|0;g=a[J>>0]|0;if(g<<24>>24){I=d[43459+((g&255)+-1)>>0]|0;t=a[43714+(I+224)>>0]^t;f=a[43714+(I+79)>>0]^f;r=a[43714+(I+55)>>0]^r;s=a[43714+(I+237)>>0]^s}I=e+23|0;g=a[I>>0]|0;if(g<<24>>24){H=d[43459+((g&255)+-1)>>0]|0;t=a[43714+(H+23)>>0]^t;f=a[43714+(H+140)>>0]^f;r=a[43714+(H+208)>>0]^r;s=a[43714+(H+224)>>0]^s}H=e+24|0;g=a[H>>0]|0;if(!(g<<24>>24)){u=0;v=0;w=0}else{w=d[43459+((g&255)+-1)>>0]|0;u=a[43714+(w+1)>>0]|0;v=a[43714+(w+45)>>0]|0;w=a[43714+w>>0]|0}G=e+25|0;g=a[G>>0]|0;if(!(g<<24>>24))x=v;else{F=d[43459+((g&255)+-1)>>0]|0;x=a[43714+(F+138)>>0]^v;u=a[43714+(F+68)>>0]^u;v=a[43714+(F+164)>>0]^v;w=a[43714+(F+45)>>0]^w}F=e+26|0;g=a[F>>0]|0;if(g<<24>>24){E=d[43459+((g&255)+-1)>>0]|0;x=a[43714+(E+209)>>0]^x;u=a[43714+(E+191)>>0]^u;v=a[43714+(E+213)>>0]^v;w=a[43714+(E+138)>>0]^w}E=e+27|0;g=a[E>>0]|0;if(g<<24>>24){D=d[43459+((g&255)+-1)>>0]|0;x=a[43714+(D+153)>>0]^x;u=a[43714+(D+61)>>0]^u;v=a[43714+(D+127)>>0]^v;w=a[43714+(D+209)>>0]^w}D=e+28|0;g=a[D>>0]|0;if(g<<24>>24){C=d[43459+((g&255)+-1)>>0]|0;x=a[43714+(C+150)>>0]^x;u=a[43714+(C+102)>>0]^u;v=a[43714+(C+70)>>0]^v;w=a[43714+(C+153)>>0]^w}C=e+29|0;g=a[C>>0]|0;if(g<<24>>24){B=d[43459+((g&255)+-1)>>0]|0;x=a[43714+(B+237)>>0]^x;u=a[43714+(B+91)>>0]^u;v=a[43714+(B+60)>>0]^v;w=a[43714+(B+150)>>0]^w}B=e+30|0;g=a[B>>0]|0;if(g<<24>>24){A=d[43459+((g&255)+-1)>>0]|0;x=a[43714+(A+224)>>0]^x;u=a[43714+(A+79)>>0]^u;v=a[43714+(A+55)>>0]^v;w=a[43714+(A+237)>>0]^w}A=e+31|0;g=a[A>>0]|0;if(g<<24>>24){z=d[43459+((g&255)+-1)>>0]|0;x=a[43714+(z+23)>>0]^x;u=a[43714+(z+140)>>0]^u;v=a[43714+(z+208)>>0]^v;w=a[43714+(z+224)>>0]^w}g=1;y=0;z=0;while(1){fa=a[44206+g>>0]|0;c[b+(z<<2)>>2]=c[8012+(((a[44974+((a[44974+((a[44718+((fa^j)&255)>>0]^p)&255)>>0]^s)&255)>>0]^w)&255)<<2)>>2];ga=a[44206+y>>0]|0;c[b+1024+(z<<2)>>2]=c[9036+(((a[44974+((a[44718+((a[44718+((ga^i)&255)>>0]^o)&255)>>0]^r)&255)>>0]^v)&255)<<2)>>2];c[b+2048+(z<<2)>>2]=c[10060+(((a[44718+((a[44974+((a[44974+((ga^h)&255)>>0]^n)&255)>>0]^f)&255)>>0]^u)&255)<<2)>>2];c[b+3072+(z<<2)>>2]=c[11084+(((a[44718+((a[44718+((a[44974+((fa^k)&255)>>0]^q)&255)>>0]^t)&255)>>0]^x)&255)<<2)>>2];z=z+1|0;if((z|0)==256)break;else{g=g+2|0;y=y+2|0}}ga=c[9036+(((a[_>>0]^a[44974+((a[S>>0]^a[44718+((a[K>>0]^a[44718+((d[C>>0]|0)^103)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((a[T>>0]^a[44974+((a[L>>0]^a[44718+((d[D>>0]|0)^243)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((a[R>>0]^a[44974+((a[J>>0]^a[44974+((d[B>>0]|0)^103)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((a[Q>>0]^a[44718+((a[I>>0]^a[44974+((d[A>>0]|0)^243)>>0])&255)>>0])&255)>>0])&255)<<2)>>2];ga=ga<<8|ga>>>24;fa=ga+(c[9036+(((a[da>>0]^a[44974+((a[W>>0]^a[44718+((a[O>>0]^a[44718+((d[G>>0]|0)^169)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((a[X>>0]^a[44974+((a[P>>0]^a[44718+((d[H>>0]|0)^117)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((a[V>>0]^a[44974+((a[N>>0]^a[44974+((d[F>>0]|0)^169)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((a[U>>0]^a[44718+((a[M>>0]^a[44974+((d[E>>0]|0)^117)>>0])&255)>>0])&255)>>0])&255)<<2)>>2])|0;ga=fa+ga|0;c[b+4096>>2]=fa;c[b+4100>>2]=ga<<9|ga>>>23;ga=c[9036+(((a[_>>0]^a[44974+((a[S>>0]^a[44718+((a[K>>0]^a[44718+((d[C>>0]|0)^232)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((a[T>>0]^a[44974+((a[L>>0]^a[44718+((d[D>>0]|0)^244)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((a[R>>0]^a[44974+((a[J>>0]^a[44974+((d[B>>0]|0)^232)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((a[Q>>0]^a[44718+((a[I>>0]^a[44974+((d[A>>0]|0)^244)>>0])&255)>>0])&255)>>0])&255)<<2)>>2];ga=ga<<8|ga>>>24;fa=ga+(c[9036+(((a[da>>0]^a[44974+((a[W>>0]^a[44718+((a[O>>0]^a[44718+((d[G>>0]|0)^179)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((a[X>>0]^a[44974+((a[P>>0]^a[44718+((d[H>>0]|0)^198)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((a[V>>0]^a[44974+((a[N>>0]^a[44974+((d[F>>0]|0)^179)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((a[U>>0]^a[44718+((a[M>>0]^a[44974+((d[E>>0]|0)^198)>>0])&255)>>0])&255)>>0])&255)<<2)>>2])|0;ga=fa+ga|0;c[b+4104>>2]=fa;c[b+4108>>2]=ga<<9|ga>>>23;ga=c[9036+(((a[_>>0]^a[44974+((a[S>>0]^a[44718+((a[K>>0]^a[44718+((d[C>>0]|0)^253)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((a[T>>0]^a[44974+((a[L>>0]^a[44718+((d[D>>0]|0)^123)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((a[R>>0]^a[44974+((a[J>>0]^a[44974+((d[B>>0]|0)^253)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((a[Q>>0]^a[44718+((a[I>>0]^a[44974+((d[A>>0]|0)^123)>>0])&255)>>0])&255)>>0])&255)<<2)>>2];ga=ga<<8|ga>>>24;fa=ga+(c[9036+(((a[da>>0]^a[44974+((a[W>>0]^a[44718+((a[O>>0]^a[44718+((d[G>>0]|0)^4)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((a[X>>0]^a[44974+((a[P>>0]^a[44718+((d[H>>0]|0)^219)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((a[V>>0]^a[44974+((a[N>>0]^a[44974+((d[F>>0]|0)^4)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((a[U>>0]^a[44718+((a[M>>0]^a[44974+((d[E>>0]|0)^219)>>0])&255)>>0])&255)>>0])&255)<<2)>>2])|0;ga=fa+ga|0;c[b+4112>>2]=fa;c[b+4116>>2]=ga<<9|ga>>>23;ga=c[9036+(((a[_>>0]^a[44974+((a[S>>0]^a[44718+((a[K>>0]^a[44718+((d[C>>0]|0)^118)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((a[T>>0]^a[44974+((a[L>>0]^a[44718+((d[D>>0]|0)^200)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((a[R>>0]^a[44974+((a[J>>0]^a[44974+((d[B>>0]|0)^118)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((a[Q>>0]^a[44718+((a[I>>0]^a[44974+((d[A>>0]|0)^200)>>0])&255)>>0])&255)>>0])&255)<<2)>>2];ga=ga<<8|ga>>>24;fa=ga+(c[9036+(((a[da>>0]^a[44974+((a[W>>0]^a[44718+((a[O>>0]^a[44718+((d[G>>0]|0)^163)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((a[X>>0]^a[44974+((a[P>>0]^a[44718+((d[H>>0]|0)^251)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((a[V>>0]^a[44974+((a[N>>0]^a[44974+((d[F>>0]|0)^163)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((a[U>>0]^a[44718+((a[M>>0]^a[44974+((d[E>>0]|0)^251)>>0])&255)>>0])&255)>>0])&255)<<2)>>2])|0;ga=fa+ga|0;c[b+4120>>2]=fa;c[b+4124>>2]=ga<<9|ga>>>23;ga=c[9036+(((a[_>>0]^a[44974+((a[S>>0]^a[44718+((a[K>>0]^a[44718+((d[C>>0]|0)^146)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((a[T>>0]^a[44974+((a[L>>0]^a[44718+((d[D>>0]|0)^211)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((a[R>>0]^a[44974+((a[J>>0]^a[44974+((d[B>>0]|0)^146)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((a[Q>>0]^a[44718+((a[I>>0]^a[44974+((d[A>>0]|0)^211)>>0])&255)>>0])&255)>>0])&255)<<2)>>2];ga=ga<<8|ga>>>24;fa=ga+(c[9036+(((a[da>>0]^a[44974+((a[W>>0]^a[44718+((a[O>>0]^a[44718+((d[G>>0]|0)^154)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((a[X>>0]^a[44974+((a[P>>0]^a[44718+((d[H>>0]|0)^74)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((a[V>>0]^a[44974+((a[N>>0]^a[44974+((d[F>>0]|0)^154)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((a[U>>0]^a[44718+((a[M>>0]^a[44974+((d[E>>0]|0)^74)>>0])&255)>>0])&255)>>0])&255)<<2)>>2])|0;ga=fa+ga|0;c[b+4128>>2]=fa;c[b+4132>>2]=ga<<9|ga>>>23;ga=c[9036+(((a[_>>0]^a[44974+((a[S>>0]^a[44718+((a[K>>0]^a[44718+((d[C>>0]|0)^120)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((a[T>>0]^a[44974+((a[L>>0]^a[44718+((d[D>>0]|0)^107)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((a[R>>0]^a[44974+((a[J>>0]^a[44974+((d[B>>0]|0)^120)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((a[Q>>0]^a[44718+((a[I>>0]^a[44974+((d[A>>0]|0)^107)>>0])&255)>>0])&255)>>0])&255)<<2)>>2];ga=ga<<8|ga>>>24;fa=ga+(c[9036+(((a[da>>0]^a[44974+((a[W>>0]^a[44718+((a[O>>0]^a[44718+((d[G>>0]|0)^128)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((a[X>>0]^a[44974+((a[P>>0]^a[44718+((d[H>>0]|0)^230)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((a[V>>0]^a[44974+((a[N>>0]^a[44974+((d[F>>0]|0)^128)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((a[U>>0]^a[44718+((a[M>>0]^a[44974+((d[E>>0]|0)^230)>>0])&255)>>0])&255)>>0])&255)<<2)>>2])|0;ga=fa+ga|0;c[b+4136>>2]=fa;c[b+4140>>2]=ga<<9|ga>>>23;ga=c[9036+(((a[_>>0]^a[44974+((a[S>>0]^a[44718+((a[K>>0]^a[44718+((d[C>>0]|0)^221)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((a[T>>0]^a[44974+((a[L>>0]^a[44718+((d[D>>0]|0)^125)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((a[R>>0]^a[44974+((a[J>>0]^a[44974+((d[B>>0]|0)^221)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((a[Q>>0]^a[44718+((a[I>>0]^a[44974+((d[A>>0]|0)^125)>>0])&255)>>0])&255)>>0])&255)<<2)>>2];ga=ga<<8|ga>>>24;fa=ga+(c[9036+(((a[da>>0]^a[44974+((a[W>>0]^a[44718+((a[O>>0]^a[44718+((d[G>>0]|0)^228)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((a[X>>0]^a[44974+((a[P>>0]^a[44718+((d[H>>0]|0)^69)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((a[V>>0]^a[44974+((a[N>>0]^a[44974+((d[F>>0]|0)^228)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((a[U>>0]^a[44718+((a[M>>0]^a[44974+((d[E>>0]|0)^69)>>0])&255)>>0])&255)>>0])&255)<<2)>>2])|0;ga=fa+ga|0;c[b+4144>>2]=fa;c[b+4148>>2]=ga<<9|ga>>>23;ga=c[9036+(((a[_>>0]^a[44974+((a[S>>0]^a[44718+((a[K>>0]^a[44718+((d[C>>0]|0)^56)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((a[T>>0]^a[44974+((a[L>>0]^a[44718+((d[D>>0]|0)^75)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((a[R>>0]^a[44974+((a[J>>0]^a[44974+((d[B>>0]|0)^56)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((a[Q>>0]^a[44718+((a[I>>0]^a[44974+((d[A>>0]|0)^75)>>0])&255)>>0])&255)>>0])&255)<<2)>>2];ga=ga<<8|ga>>>24;fa=ga+(c[9036+(((a[da>>0]^a[44974+((a[W>>0]^a[44718+((a[O>>0]^a[44718+((d[G>>0]|0)^209)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((a[X>>0]^a[44974+((a[P>>0]^a[44718+((d[H>>0]|0)^232)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((a[V>>0]^a[44974+((a[N>>0]^a[44974+((d[F>>0]|0)^209)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((a[U>>0]^a[44718+((a[M>>0]^a[44974+((d[E>>0]|0)^232)>>0])&255)>>0])&255)>>0])&255)<<2)>>2])|0;ga=fa+ga|0;c[b+4152>>2]=fa;c[b+4156>>2]=ga<<9|ga>>>23;ga=c[9036+(((a[_>>0]^a[44974+((a[S>>0]^a[44718+((a[K>>0]^a[44718+((d[C>>0]|0)^198)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((a[T>>0]^a[44974+((a[L>>0]^a[44718+((d[D>>0]|0)^50)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((a[R>>0]^a[44974+((a[J>>0]^a[44974+((d[B>>0]|0)^198)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((a[Q>>0]^a[44718+((a[I>>0]^a[44974+((d[A>>0]|0)^50)>>0])&255)>>0])&255)>>0])&255)<<2)>>2];ga=ga<<8|ga>>>24;fa=ga+(c[9036+(((a[da>>0]^a[44974+((a[W>>0]^a[44718+((a[O>>0]^a[44718+((d[G>>0]|0)^13)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((a[X>>0]^a[44974+((a[P>>0]^a[44718+((d[H>>0]|0)^214)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((a[V>>0]^a[44974+((a[N>>0]^a[44974+((d[F>>0]|0)^13)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((a[U>>0]^a[44718+((a[M>>0]^a[44974+((d[E>>0]|0)^214)>>0])&255)>>0])&255)>>0])&255)<<2)>>2])|0;ga=fa+ga|0;c[b+4160>>2]=fa;c[b+4164>>2]=ga<<9|ga>>>23;ga=c[9036+(((a[_>>0]^a[44974+((a[S>>0]^a[44718+((a[K>>0]^a[44718+((d[C>>0]|0)^152)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((a[T>>0]^a[44974+((a[L>>0]^a[44718+((d[D>>0]|0)^253)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((a[R>>0]^a[44974+((a[J>>0]^a[44974+((d[B>>0]|0)^152)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((a[Q>>0]^a[44718+((a[I>>0]^a[44974+((d[A>>0]|0)^253)>>0])&255)>>0])&255)>>0])&255)<<2)>>2];ga=ga<<8|ga>>>24;fa=ga+(c[9036+(((a[da>>0]^a[44974+((a[W>>0]^a[44718+((a[O>>0]^a[44718+((d[G>>0]|0)^53)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((a[X>>0]^a[44974+((a[P>>0]^a[44718+((d[H>>0]|0)^216)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((a[V>>0]^a[44974+((a[N>>0]^a[44974+((d[F>>0]|0)^53)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((a[U>>0]^a[44718+((a[M>>0]^a[44974+((d[E>>0]|0)^216)>>0])&255)>>0])&255)>>0])&255)<<2)>>2])|0;ga=fa+ga|0;c[b+4168>>2]=fa;c[b+4172>>2]=ga<<9|ga>>>23;ga=c[9036+(((a[_>>0]^a[44974+((a[S>>0]^a[44718+((a[K>>0]^a[44718+((d[C>>0]|0)^247)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((a[T>>0]^a[44974+((a[L>>0]^a[44718+((d[D>>0]|0)^113)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((a[R>>0]^a[44974+((a[J>>0]^a[44974+((d[B>>0]|0)^247)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((a[Q>>0]^a[44718+((a[I>>0]^a[44974+((d[A>>0]|0)^113)>>0])&255)>>0])&255)>>0])&255)<<2)>>2];ga=ga<<8|ga>>>24;fa=ga+(c[9036+(((a[da>>0]^a[44974+((a[W>>0]^a[44718+((a[O>>0]^a[44718+((d[G>>0]|0)^24)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((a[X>>0]^a[44974+((a[P>>0]^a[44718+((d[H>>0]|0)^55)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((a[V>>0]^a[44974+((a[N>>0]^a[44974+((d[F>>0]|0)^24)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((a[U>>0]^a[44718+((a[M>>0]^a[44974+((d[E>>0]|0)^55)>>0])&255)>>0])&255)>>0])&255)<<2)>>2])|0;ga=fa+ga|0;c[b+4176>>2]=fa;c[b+4180>>2]=ga<<9|ga>>>23;ga=c[9036+(((a[_>>0]^a[44974+((a[S>>0]^a[44718+((a[K>>0]^a[44718+((d[C>>0]|0)^108)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((a[T>>0]^a[44974+((a[L>>0]^a[44718+((d[D>>0]|0)^225)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((a[R>>0]^a[44974+((a[J>>0]^a[44974+((d[B>>0]|0)^108)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((a[Q>>0]^a[44718+((a[I>>0]^a[44974+((d[A>>0]|0)^225)>>0])&255)>>0])&255)>>0])&255)<<2)>>2];ga=ga<<8|ga>>>24;fa=ga+(c[9036+(((a[da>>0]^a[44974+((a[W>>0]^a[44718+((a[O>>0]^a[44718+((d[G>>0]|0)^236)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((a[X>>0]^a[44974+((a[P>>0]^a[44718+((d[H>>0]|0)^241)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((a[V>>0]^a[44974+((a[N>>0]^a[44974+((d[F>>0]|0)^236)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((a[U>>0]^a[44718+((a[M>>0]^a[44974+((d[E>>0]|0)^241)>>0])&255)>>0])&255)>>0])&255)<<2)>>2])|0;ga=fa+ga|0;c[b+4184>>2]=fa;c[b+4188>>2]=ga<<9|ga>>>23;ga=c[9036+(((a[_>>0]^a[44974+((a[S>>0]^a[44718+((a[K>>0]^a[44718+((d[C>>0]|0)^117)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((a[T>>0]^a[44974+((a[L>>0]^a[44718+((d[D>>0]|0)^15)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((a[R>>0]^a[44974+((a[J>>0]^a[44974+((d[B>>0]|0)^117)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((a[Q>>0]^a[44718+((a[I>>0]^a[44974+((d[A>>0]|0)^15)>>0])&255)>>0])&255)>>0])&255)<<2)>>2];ga=ga<<8|ga>>>24;fa=ga+(c[9036+(((a[da>>0]^a[44974+((a[W>>0]^a[44718+((a[O>>0]^a[44718+((d[G>>0]|0)^67)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((a[X>>0]^a[44974+((a[P>>0]^a[44718+((d[H>>0]|0)^48)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((a[V>>0]^a[44974+((a[N>>0]^a[44974+((d[F>>0]|0)^67)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((a[U>>0]^a[44718+((a[M>>0]^a[44974+((d[E>>0]|0)^48)>>0])&255)>>0])&255)>>0])&255)<<2)>>2])|0;ga=fa+ga|0;c[b+4192>>2]=fa;c[b+4196>>2]=ga<<9|ga>>>23;ga=c[9036+(((a[_>>0]^a[44974+((a[S>>0]^a[44718+((a[K>>0]^a[44718+((d[C>>0]|0)^38)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((a[T>>0]^a[44974+((a[L>>0]^a[44718+((d[D>>0]|0)^27)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((a[R>>0]^a[44974+((a[J>>0]^a[44974+((d[B>>0]|0)^38)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((a[Q>>0]^a[44718+((a[I>>0]^a[44974+((d[A>>0]|0)^27)>>0])&255)>>0])&255)>>0])&255)<<2)>>2];ga=ga<<8|ga>>>24;fa=ga+(c[9036+(((a[da>>0]^a[44974+((a[W>>0]^a[44718+((a[O>>0]^a[44718+((d[G>>0]|0)^55)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((a[X>>0]^a[44974+((a[P>>0]^a[44718+((d[H>>0]|0)^248)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((a[V>>0]^a[44974+((a[N>>0]^a[44974+((d[F>>0]|0)^55)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((a[U>>0]^a[44718+((a[M>>0]^a[44974+((d[E>>0]|0)^248)>>0])&255)>>0])&255)>>0])&255)<<2)>>2])|0;ga=fa+ga|0;c[b+4200>>2]=fa;c[b+4204>>2]=ga<<9|ga>>>23;ga=c[9036+(((a[_>>0]^a[44974+((a[S>>0]^a[44718+((a[K>>0]^a[44718+((d[C>>0]|0)^19)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((a[T>>0]^a[44974+((a[L>>0]^a[44718+((d[D>>0]|0)^250)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((a[R>>0]^a[44974+((a[J>>0]^a[44974+((d[B>>0]|0)^19)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((a[Q>>0]^a[44718+((a[I>>0]^a[44974+((d[A>>0]|0)^250)>>0])&255)>>0])&255)>>0])&255)<<2)>>2];ga=ga<<8|ga>>>24;fa=ga+(c[9036+(((a[da>>0]^a[44974+((a[W>>0]^a[44718+((a[O>>0]^a[44718+((d[G>>0]|0)^250)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((a[X>>0]^a[44974+((a[P>>0]^a[44718+((d[H>>0]|0)^135)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((a[V>>0]^a[44974+((a[N>>0]^a[44974+((d[F>>0]|0)^250)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((a[U>>0]^a[44718+((a[M>>0]^a[44974+((d[E>>0]|0)^135)>>0])&255)>>0])&255)>>0])&255)<<2)>>2])|0;ga=fa+ga|0;c[b+4208>>2]=fa;c[b+4212>>2]=ga<<9|ga>>>23;ga=c[9036+(((a[_>>0]^a[44974+((a[S>>0]^a[44718+((a[K>>0]^a[44718+((d[C>>0]|0)^72)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((a[T>>0]^a[44974+((a[L>>0]^a[44718+((d[D>>0]|0)^63)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((a[R>>0]^a[44974+((a[J>>0]^a[44974+((d[B>>0]|0)^72)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((a[Q>>0]^a[44718+((a[I>>0]^a[44974+((d[A>>0]|0)^63)>>0])&255)>>0])&255)>>0])&255)<<2)>>2];ga=ga<<8|ga>>>24;fa=ga+(c[9036+(((a[da>>0]^a[44974+((a[W>>0]^a[44718+((a[O>>0]^a[44718+((d[G>>0]|0)^148)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((a[X>>0]^a[44974+((a[P>>0]^a[44718+((d[H>>0]|0)^6)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((a[V>>0]^a[44974+((a[N>>0]^a[44974+((d[F>>0]|0)^148)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((a[U>>0]^a[44718+((a[M>>0]^a[44974+((d[E>>0]|0)^6)>>0])&255)>>0])&255)>>0])&255)<<2)>>2])|0;ga=fa+ga|0;c[b+4216>>2]=fa;c[b+4220>>2]=ga<<9|ga>>>23;ga=c[9036+(((a[_>>0]^a[44974+((a[S>>0]^a[44718+((a[K>>0]^a[44718+((d[C>>0]|0)^208)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((a[T>>0]^a[44974+((a[L>>0]^a[44718+((d[D>>0]|0)^186)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((a[R>>0]^a[44974+((a[J>>0]^a[44974+((d[B>>0]|0)^208)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((a[Q>>0]^a[44718+((a[I>>0]^a[44974+((d[A>>0]|0)^186)>>0])&255)>>0])&255)>>0])&255)<<2)>>2];ga=ga<<8|ga>>>24;fa=ga+(c[9036+(((a[da>>0]^a[44974+((a[W>>0]^a[44718+((a[O>>0]^a[44718+((d[G>>0]|0)^242)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((a[X>>0]^a[44974+((a[P>>0]^a[44718+((d[H>>0]|0)^94)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((a[V>>0]^a[44974+((a[N>>0]^a[44974+((d[F>>0]|0)^242)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((a[U>>0]^a[44718+((a[M>>0]^a[44974+((d[E>>0]|0)^94)>>0])&255)>>0])&255)>>0])&255)<<2)>>2])|0;ga=fa+ga|0;c[b+4224>>2]=fa;c[b+4228>>2]=ga<<9|ga>>>23;ga=c[9036+(((a[_>>0]^a[44974+((a[S>>0]^a[44718+((a[K>>0]^a[44718+((d[C>>0]|0)^48)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((a[T>>0]^a[44974+((a[L>>0]^a[44718+((d[D>>0]|0)^91)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((a[R>>0]^a[44974+((a[J>>0]^a[44974+((d[B>>0]|0)^48)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((a[Q>>0]^a[44718+((a[I>>0]^a[44974+((d[A>>0]|0)^91)>>0])&255)>>0])&255)>>0])&255)<<2)>>2];ga=ga<<8|ga>>>24;fa=ga+(c[9036+(((a[da>>0]^a[44974+((a[W>>0]^a[44718+((a[O>>0]^a[44718+((d[G>>0]|0)^139)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((a[X>>0]^a[44974+((a[P>>0]^a[44718+((d[H>>0]|0)^174)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((a[V>>0]^a[44974+((a[N>>0]^a[44974+((d[F>>0]|0)^139)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((a[U>>0]^a[44718+((a[M>>0]^a[44974+((d[E>>0]|0)^174)>>0])&255)>>0])&255)>>0])&255)<<2)>>2])|0;ga=fa+ga|0;c[b+4232>>2]=fa;c[b+4236>>2]=ga<<9|ga>>>23;ga=c[9036+(((a[_>>0]^a[44974+((a[S>>0]^a[44718+((a[K>>0]^a[44718+((d[C>>0]|0)^84)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((a[T>>0]^a[44974+((a[L>>0]^a[44718+(d[D>>0]|0)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((a[R>>0]^a[44974+((a[J>>0]^a[44974+((d[B>>0]|0)^84)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((a[Q>>0]^a[44718+((a[I>>0]^a[44974+(d[A>>0]|0)>>0])&255)>>0])&255)>>0])&255)<<2)>>2];ga=ga<<8|ga>>>24;fa=ga+(c[9036+(((a[da>>0]^a[44974+((a[W>>0]^a[44718+((a[O>>0]^a[44718+((d[G>>0]|0)^132)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((a[X>>0]^a[44974+((a[P>>0]^a[44718+((d[H>>0]|0)^138)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((a[V>>0]^a[44974+((a[N>>0]^a[44974+((d[F>>0]|0)^132)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((a[U>>0]^a[44718+((a[M>>0]^a[44974+((d[E>>0]|0)^138)>>0])&255)>>0])&255)>>0])&255)<<2)>>2])|0;ga=fa+ga|0;c[b+4240>>2]=fa;c[b+4244>>2]=ga<<9|ga>>>23;ga=c[9036+(((a[_>>0]^a[44974+((a[S>>0]^a[44718+((a[K>>0]^a[44718+((d[C>>0]|0)^35)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[aa>>0]^a[44974+((a[T>>0]^a[44974+((a[L>>0]^a[44718+((d[D>>0]|0)^157)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[Z>>0]^a[44718+((a[R>>0]^a[44974+((a[J>>0]^a[44974+((d[B>>0]|0)^35)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[Y>>0]^a[44718+((a[Q>>0]^a[44718+((a[I>>0]^a[44974+((d[A>>0]|0)^157)>>0])&255)>>0])&255)>>0])&255)<<2)>>2];ga=ga<<8|ga>>>24;fa=ga+(c[9036+(((a[da>>0]^a[44974+((a[W>>0]^a[44718+((a[O>>0]^a[44718+((d[G>>0]|0)^223)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[8012+(((a[e>>0]^a[44974+((a[X>>0]^a[44974+((a[P>>0]^a[44718+((d[H>>0]|0)^188)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[10060+(((a[ca>>0]^a[44718+((a[V>>0]^a[44974+((a[N>>0]^a[44974+((d[F>>0]|0)^223)>>0])&255)>>0])&255)>>0])&255)<<2)>>2]^c[11084+(((a[ba>>0]^a[44718+((a[U>>0]^a[44718+((a[M>>0]^a[44974+((d[E>>0]|0)^188)>>0])&255)>>0])&255)>>0])&255)<<2)>>2])|0;ga=fa+ga|0;c[b+4248>>2]=fa;c[b+4252>>2]=ga<<9|ga>>>23;ga=0;l=ea;return ga|0}function lj(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;F=l;l=l+16|0;if((l|0)>=(m|0))$(16);h=F;if(!g)j=0;else{B=h+4|0;C=h+8|0;D=h+12|0;k=h+1|0;n=h+2|0;o=h+3|0;p=h+4|0;q=h+5|0;r=h+6|0;s=h+7|0;t=h+8|0;u=h+9|0;v=h+10|0;w=h+11|0;x=h+12|0;y=h+13|0;z=h+14|0;A=h+15|0;j=0;i=f;do{ij(b,h,d)|0;j=j>>>0<36?36:j;if(!((e|i)&3)){c[e>>2]=c[i>>2]^c[h>>2];c[e+4>>2]=c[i+4>>2]^c[B>>2];c[e+8>>2]=c[i+8>>2]^c[C>>2];c[e+12>>2]=c[i+12>>2]^c[D>>2]}else{a[e>>0]=a[i>>0]^a[h>>0];a[e+1>>0]=a[i+1>>0]^a[k>>0];a[e+2>>0]=a[i+2>>0]^a[n>>0];a[e+3>>0]=a[i+3>>0]^a[o>>0];a[e+4>>0]=a[i+4>>0]^a[p>>0];a[e+5>>0]=a[i+5>>0]^a[q>>0];a[e+6>>0]=a[i+6>>0]^a[r>>0];a[e+7>>0]=a[i+7>>0]^a[s>>0];a[e+8>>0]=a[i+8>>0]^a[t>>0];a[e+9>>0]=a[i+9>>0]^a[u>>0];a[e+10>>0]=a[i+10>>0]^a[v>>0];a[e+11>>0]=a[i+11>>0]^a[w>>0];a[e+12>>0]=a[i+12>>0]^a[x>>0];a[e+13>>0]=a[i+13>>0]^a[y>>0];a[e+14>>0]=a[i+14>>0]^a[z>>0];a[e+15>>0]=a[i+15>>0]^a[A>>0]}e=e+16|0;i=i+16|0;f=16;do{if((f|0)<=0)break;f=f+-1|0;H=d+f|0;G=(a[H>>0]|0)+1<<24>>24;a[H>>0]=G}while(!(G<<24>>24));g=g+-1|0}while((g|0)!=0)}if(h&4){e=16;do{a[h>>0]=0;h=h+1|0;e=e+-1|0}while((e|0)!=0&(h&7|0)!=0);if(e>>>0>=8)E=13}else{e=16;E=13}if((E|0)==13){g=e+-8|0;i=g&-8;b=i+8|0;f=h;while(1){H=f;c[H>>2]=0;c[H+4>>2]=0;e=e+-8|0;if(e>>>0<=7)break;else f=f+8|0}e=g-i|0;h=h+b|0}if(!e){Te(j);l=F;return}while(1){a[h>>0]=0;e=e+-1|0;if(!e)break;else h=h+1|0}Te(j);l=F;return}function mj(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,n=0,o=0,p=0,q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oj(a,b){a=a|0;b=b|0;c[17620]=a;c[17621]=b;return}function pj(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=c[17620]|0;if(!f)return;qb[f&15](c[17621]|0,a,b,d,e);return}function qj(a){a=a|0;a:do switch(a|0){case 0:{c[17622]=1;break}case 1:{c[17623]=1;break}default:if(!(c[17622]|0))switch(a|0){case 2:{c[17624]=1;break a}case 3:{c[17625]=1;break a}default:break a}}while(0);return}function rj(a){a=a|0;if(gg()|0){en(a);return}if(c[17623]|0){Pm(a);return}if(c[17624]|0){en(a);return}if(!(c[17625]|0)){Pm(a);return}else{wn(a);return}}function sj(){if(gg()|0){fn();return}if(c[17623]|0){Rm();return}if(c[17624]|0){fn();return}if(!(c[17625]|0)){Rm();return}else{xn();return}}function tj(a){a=a|0;if((a|0)==0?(gg()|0)!=0:0)a=2;else if(!(c[17623]|0))if(!(c[17624]|0))a=(c[17625]|0)==0?1:3;else a=2;else a=1;return a|0}function uj(){if(!(gg()|0)){Sm();return}else return}function vj(){if(gg()|0)return;Tm();return}function wj(){if(gg()|0)return;Um();return}function xj(a){a=a|0;if(gg()|0)return;return}function yj(a){a=a|0;if(gg()|0){a=0;return a|0}a=Wm(a)|0;return a|0}function zj(){var a=0;if(!(gg()|0)){a=Xm()|0;return a|0}else{a=hn()|0;return a|0}return 0}function Aj(a,b){a=a|0;b=b|0;var c=0;c=gf(a)|0;Bj(c,a,b);return c|0}function Bj(a,b,d){a=a|0;b=b|0;d=d|0;if(gg()|0){jn(a,b,d);return}if(c[17623]|0){Zm(a,b,d);return}if(c[17624]|0){jn(a,b,d);return}if(!(c[17625]|0)){Zm(a,b,d);return}else{yn(a,b,d);return}}function Cj(a,b){a=a|0;b=b|0;var c=0;c=jf(a)|0;Bj(c,a,b);return c|0}function Dj(a,b,c){a=a|0;b=b|0;c=c|0;Bj(a,b,c);return}function Ej(a){a=a|0;if(gg()|0)return;if(c[17623]|0){bn(a);return}if(c[17625]|c[17624]|0)return;bn(a);return}function Fj(){if(gg()|0)return;if(c[17623]|0){cn();return}if(c[17625]|c[17624]|0)return;cn();return}function Gj(){if(gg()|0)return;if(c[17623]|0){dn();return}if(c[17625]|c[17624]|0)return;dn();return}function Hj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=h+8|0;f=h;e=h+12|0;if(gg()|0){rn(a,b);l=h;return}do if(!(gg()|0)){if(c[17623]|0){Pm(1);break}if(c[17624]|0){en(1);break}if(!(c[17625]|0)){Pm(1);break}else{wn(1);break}}else en(1);while(0);d=Vn(12172)|0;if(d|0){c[f>>2]=Pn(d)|0;Me(45241,f)}c[e>>2]=qq()|0;if(c[17626]|0){if((c[17627]|0)!=(c[e>>2]|0)){Bj(70532,8,0);c[17627]=c[e>>2]}}else{f=fb(0)|0;d=c[e>>2]|0;c[17627]=c[e>>2];c[17628]=d;c[17629]=f;Bj(70532,8,0);c[17626]=1}if(b|0)while(1){Vi(70512,70512,28);d=b>>>0>20?20:b;cr(a|0,70512,d|0)|0;b=b-d|0;if(!b)break;else a=a+d|0}b=Wn(12172)|0;if(!b){l=h;return}else{c[g>>2]=Pn(b)|0;Me(45286,g)}}function Ij(a){a=a|0;if(!(gg()|0)){a=0;return a|0}a=sn(a)|0;return a|0}function Jj(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;if(!(gg()|0)){h=60;return h|0}h=tn(a,b,c,d,e,f,g,h)|0;return h|0}function Kj(a,b,c){a=a|0;b=b|0;c=c|0;if(!(gg()|0)){c=60;return c|0}c=un(a,b,c)|0;return c|0}function Lj(a){a=a|0;if(!(gg()|0))return;vn(a);return}function Mj(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;j=l;l=l+112|0;if((l|0)>=(m|0))$(112);g=j+8|0;f=j;h=j+12|0;if(!d){c[f>>2]=b;lp(h,99,45331,f)|0;Se(h,0);l=j;return}c[g>>2]=b;lp(h,99,45336,g)|0;g=(e|0)!=0;if(g){f=Hl(0)|0;b=Hl(0)|0;if(!(Nj(f,b,d,e)|0)){a[h+((Fo(h)|0)+-1)>>0]=120;Se(h,f);a[h+((Fo(h)|0)+-1)>>0]=121;Se(h,b)}else i=6}else{f=0;b=0;i=6}if((i|0)==6){Se(h,c[d>>2]|0);a[h+((Fo(h)|0)+-1)>>0]=89;Se(h,c[d+4>>2]|0);a[h+((Fo(h)|0)+-1)>>0]=90;Se(h,c[d+8>>2]|0);if(!g){l=j;return}}Jl(f);Jl(b);l=j;return}function Nj(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0;n=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=n+16|0;f=n+8|0;g=d+8|0;if(!(vk(c[g>>2]|0,0)|0)){b=-1;l=n;return b|0}switch(c[e>>2]|0){case 0:{k=Hl(0)|0;j=Hl(0)|0;f=c[g>>2]|0;i=e+16|0;if(!(Fk(k,f,c[i>>2]|0)|0)){Le(45341,n);Se(45375,f);Se(45379,c[i>>2]|0)}Kk(j,k,k);h=e+60|0;f=c[h>>2]|0;if(!f)Gk(j,j,c[i>>2]|0);else Jk(j,j,f);do if(a|0){Kk(a,c[d>>2]|0,j);f=c[h>>2]|0;if(!f){Gk(a,a,c[i>>2]|0);break}else{Jk(a,a,f);break}}while(0);if(b|0){g=Hl(0)|0;Kk(g,j,k);f=c[h>>2]|0;if(!f)Gk(g,g,c[i>>2]|0);else Jk(g,g,f);Kk(b,c[d+4>>2]|0,g);f=c[h>>2]|0;if(!f)Gk(b,b,c[i>>2]|0);else Jk(b,b,f);tl(g)}tl(j);tl(k);b=0;l=n;return b|0}case 1:{if(a|0)Al(a,c[d>>2]|0)|0;if(!b){b=0;l=n;return b|0}else{c[f>>2]=45432;c[f+4>>2]=45456;Me(45383,f)}break}case 2:{i=Hl(0)|0;f=c[g>>2]|0;g=e+16|0;if(!(Fk(i,f,c[g>>2]|0)|0)){Le(45341,h);Se(45375,f);Se(45379,c[g>>2]|0)}do if(a|0){Kk(a,c[d>>2]|0,i);f=c[e+60>>2]|0;if(!f){Gk(a,a,c[g>>2]|0);break}else{Jk(a,a,f);break}}while(0);do if(b|0){Kk(b,c[d+4>>2]|0,i);f=c[e+60>>2]|0;if(!f){Gk(b,b,c[g>>2]|0);break}else{Jk(b,b,f);break}}while(0);Jl(i);b=0;l=n;return b|0}default:{b=-1;l=n;return b|0}}return 0}function Oj(a){a=a|0;a=gf(12)|0;c[a>>2]=Hl(0)|0;c[a+4>>2]=Hl(0)|0;c[a+8>>2]=Hl(0)|0;return a|0}function Pj(a){a=a|0;c[a>>2]=Hl(0)|0;c[a+4>>2]=Hl(0)|0;c[a+8>>2]=Hl(0)|0;return}function Qj(a){a=a|0;var b=0;if(!a)return;tl(c[a>>2]|0);c[a>>2]=0;b=a+4|0;tl(c[b>>2]|0);c[b>>2]=0;b=a+8|0;tl(c[b>>2]|0);c[b>>2]=0;cf(a);return}function Rj(a){a=a|0;var b=0;tl(c[a>>2]|0);c[a>>2]=0;b=a+4|0;tl(c[b>>2]|0);c[b>>2]=0;a=a+8|0;tl(c[a>>2]|0);c[a>>2]=0;return}function Sj(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;if(!a){f=gf(12)|0;c[f>>2]=Hl(0)|0;c[f+4>>2]=Hl(0)|0;c[f+8>>2]=Hl(0)|0}else f=a;a=c[f>>2]|0;if(!b)rl(a);else Al(a,b)|0;a=c[f+4>>2]|0;if(!d)rl(a);else Al(a,d)|0;a=c[f+8>>2]|0;if(!e){rl(a);return f|0}else{Al(a,e)|0;return f|0}return 0}function Tj(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;if(!a){f=gf(12)|0;c[f>>2]=Hl(0)|0;c[f+4>>2]=Hl(0)|0;c[f+8>>2]=Hl(0)|0}else f=a;a=c[f>>2]|0;if(!b)rl(a);else Cl(a,b);a=c[f+4>>2]|0;if(!d)rl(a);else Cl(a,d);a=c[f+8>>2]|0;if(!e){rl(a);return f|0}else{Cl(a,e);return f|0}return 0}function Uj(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0;g=kf(1,108)|0;Vj(g,a,b,c,d,e,f);return g|0}function Vj(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;do if(!(c[17635]|0))if(!(Xa(45467)|0)){c[17635]=-1;break}else{c[17635]=1;break}while(0);c[b>>2]=d;c[b+4>>2]=e;c[b+8>>2]=f;if((e|0)==1)d=256;else d=lk(g)|0;c[b+12>>2]=d;e=b+16|0;c[e>>2]=yl(g)|0;c[b+20>>2]=yl(h)|0;c[b+24>>2]=yl(i)|0;if((c[17635]|0)>0)d=Hk(c[e>>2]|0,0)|0;else d=0;c[b+60>>2]=d;i=b+48|0;a[i>>0]=a[i>>0]&-4;c[b+64>>2]=Bl(c[e>>2]|0)|0;c[b+68>>2]=Bl(c[e>>2]|0)|0;c[b+72>>2]=Bl(c[e>>2]|0)|0;c[b+76>>2]=Bl(c[e>>2]|0)|0;c[b+80>>2]=Bl(c[e>>2]|0)|0;c[b+84>>2]=Bl(c[e>>2]|0)|0;c[b+88>>2]=Bl(c[e>>2]|0)|0;c[b+92>>2]=Bl(c[e>>2]|0)|0;c[b+96>>2]=Bl(c[e>>2]|0)|0;c[b+100>>2]=Bl(c[e>>2]|0)|0;c[b+104>>2]=Bl(c[e>>2]|0)|0;return}function Wj(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0;c[a>>2]=0;if(!((f|0)!=0&(g|0)!=0)){i=32816;return i|0}i=rg(1,108,5)|0;if(!i){i=Sn()|0;return i|0}else{Vj(sg(i,1)|0,b,d,e,f,g,h);c[a>>2]=i;i=0;return i|0}return 0}function Xj(a){a=a|0;var b=0,d=0;Ik(c[a+60>>2]|0);tl(c[a+16>>2]|0);tl(c[a+20>>2]|0);tl(c[a+24>>2]|0);b=c[a+28>>2]|0;if(b|0){tl(c[b>>2]|0);c[b>>2]=0;d=b+4|0;tl(c[d>>2]|0);c[d>>2]=0;d=b+8|0;tl(c[d>>2]|0);c[d>>2]=0;cf(b)}tl(c[a+32>>2]|0);tl(c[a+36>>2]|0);b=c[a+40>>2]|0;if(b|0){tl(c[b>>2]|0);c[b>>2]=0;d=b+4|0;tl(c[d>>2]|0);c[d>>2]=0;d=b+8|0;tl(c[d>>2]|0);c[d>>2]=0;cf(b)}tl(c[a+44>>2]|0);tl(c[a+56>>2]|0);tl(c[a+64>>2]|0);tl(c[a+68>>2]|0);tl(c[a+72>>2]|0);tl(c[a+76>>2]|0);tl(c[a+80>>2]|0);tl(c[a+84>>2]|0);tl(c[a+88>>2]|0);tl(c[a+92>>2]|0);tl(c[a+96>>2]|0);tl(c[a+100>>2]|0);tl(c[a+104>>2]|0);return}function Yj(a){a=a|0;if(!a)return;Xj(a);cf(a);return}function Zj(a,b,c){a=a|0;b=b|0;c=c|0;return Kg(a,sg(b,1)|0,c)|0}function _j(a,b,c){a=a|0;b=b|0;c=c|0;return Lg(a,sg(b,1)|0)|0}function $j(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0;r=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=r;switch(c[e>>2]|0){case 0:{n=d+4|0;if(vk(c[n>>2]|0,0)|0?(k=d+8|0,vk(c[k>>2]|0,0)|0):0){f=e+48|0;g=a[f>>0]|0;if(!(g&1)){a[f>>0]=g|1;f=e+16|0;q=Bl(c[f>>2]|0)|0;gk(q,c[f>>2]|0,3);f=e+52|0;c[f>>2]=(wk(c[e+20>>2]|0,q)|0)==0&1;tl(q)}else f=e+52|0;o=e+64|0;do if(!(c[f>>2]|0)){i=e+76|0;f=c[i>>2]|0;j=c[d>>2]|0;Kk(f,j,j);j=e+60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2]|0);else Jk(f,f,g);o=e+72|0;g=c[o>>2]|0;f=c[h>>2]|0;Kk(g,f,f);f=c[q>>2]|0;if(!f)Gk(g,g,c[e+16>>2]|0);else Jk(g,g,f);j=e+76|0;f=c[j>>2]|0;do if((c[e+4>>2]|0)!=1){Kk(f,c[e+20>>2]|0,c[n>>2]|0);g=c[q>>2]|0;if(!g){Gk(f,f,c[e+16>>2]|0);break}else{Jk(f,f,g);break}}else{Al(f,c[n>>2]|0)|0;k=c[j>>2]|0;zl(k,k)}while(0);k=e+80|0;f=c[k>>2]|0;fk(f,c[j>>2]|0,c[o>>2]|0);g=c[q>>2]|0;if(!g)Gk(f,f,c[e+16>>2]|0);else Jk(f,f,g);h=e+84|0;g=c[h>>2]|0;f=c[d+8>>2]|0;Kk(g,f,f);f=c[q>>2]|0;if(!f)Gk(g,g,c[e+16>>2]|0);else Jk(g,g,f);i=e+88|0;g=c[i>>2]|0;uk(g,c[h>>2]|0,1);f=c[q>>2]|0;if(!f)Gk(g,g,c[e+16>>2]|0);else Jk(g,g,f);f=c[i>>2]|0;hk(f,c[k>>2]|0,f);hk(c[b>>2]|0,c[p>>2]|0,c[n>>2]|0);f=c[b>>2]|0;hk(f,f,c[o>>2]|0);f=c[b>>2]|0;Kk(f,f,c[i>>2]|0);g=c[q>>2]|0;if(!g)Gk(f,f,c[e+16>>2]|0);else Jk(f,f,g);f=b+4|0;hk(c[f>>2]|0,c[j>>2]|0,c[o>>2]|0);f=c[f>>2]|0;Kk(f,f,c[k>>2]|0);g=c[q>>2]|0;if(!g)Gk(f,f,c[e+16>>2]|0);else Jk(f,f,g);g=c[b+8>>2]|0;Kk(g,c[k>>2]|0,c[i>>2]|0);f=c[q>>2]|0;if(!f){Gk(g,g,c[e+16>>2]|0);l=r;return}else{Jk(g,g,f);l=r;return}}default:{l=r;return}}}function ak(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=v+8|0;u=v;switch(c[f>>2]|0){case 0:{if(((wk(c[d>>2]|0,c[e>>2]|0)|0)==0?(wk(c[d+4>>2]|0,c[e+4>>2]|0)|0)==0:0)?(wk(c[d+8>>2]|0,c[e+8>>2]|0)|0)==0:0){$j(b,d,f);l=v;return}p=d+8|0;if(!(vk(c[p>>2]|0,0)|0)){Al(c[b>>2]|0,c[e>>2]|0)|0;Al(c[b+4>>2]|0,c[e+4>>2]|0)|0;Al(c[b+8>>2]|0,c[e+8>>2]|0)|0;l=v;return}q=e+8|0;if(!(vk(c[q>>2]|0,0)|0)){Al(c[b>>2]|0,c[d>>2]|0)|0;Al(c[b+4>>2]|0,c[d+4>>2]|0)|0;Al(c[b+8>>2]|0,c[p>>2]|0)|0;l=v;return}j=(vk(c[p>>2]|0,1)|0)==0;t=(vk(c[q>>2]|0,1)|0)==0;n=f+64|0;g=c[n>>2]|0;do if(!t){i=c[q>>2]|0;Kk(g,i,i);i=f+60|0;h=c[i>>2]|0;if(!h)Gk(g,g,c[f+16>>2]|0);else Jk(g,g,h);h=c[n>>2]|0;Kk(h,h,c[d>>2]|0);g=c[i>>2]|0;if(!g){Gk(h,h,c[f+16>>2]|0);break}else{Jk(h,h,g);break}}else Al(g,c[d>>2]|0)|0;while(0);k=f+68|0;h=c[k>>2]|0;do if(!j){i=c[p>>2]|0;Kk(h,i,i);i=f+60|0;g=c[i>>2]|0;if(!g)Gk(h,h,c[f+16>>2]|0);else Jk(h,h,g);g=c[k>>2]|0;Kk(g,g,c[e>>2]|0);h=c[i>>2]|0;if(!h){Gk(g,g,c[f+16>>2]|0);s=i;break}else{Jk(g,g,h);s=i;break}}else{Al(h,c[e>>2]|0)|0;s=f+60|0}while(0);r=f+72|0;hk(c[r>>2]|0,c[n>>2]|0,c[k>>2]|0);j=f+76|0;h=c[j>>2]|0;g=c[q>>2]|0;t=f+16|0;Mk(h,g,Ml(3)|0,c[t>>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>>2]|0;uk(g,c[b>>2]|0,1);h=c[s>>2]|0;if(!h)Gk(g,g,c[t>>2]|0);else Jk(g,g,h);i=f+96|0;hk(c[i>>2]|0,c[j>>2]|0,c[k>>2]|0);h=c[i>>2]|0;Kk(h,h,c[o>>2]|0);g=c[s>>2]|0;if(!g)Gk(h,h,c[t>>2]|0);else Jk(h,h,g);g=c[k>>2]|0;h=c[r>>2]|0;Mk(g,h,Ml(3)|0,c[t>>2]|0);h=c[k>>2]|0;Kk(h,h,c[d>>2]|0);g=c[s>>2]|0;if(!g)Gk(h,h,c[t>>2]|0);else Jk(h,h,g);j=b+4|0;hk(c[j>>2]|0,c[i>>2]|0,c[k>>2]|0);j=c[j>>2]|0;g=f+48|0;h=a[g>>0]|0;do if(!(h&2)){a[g>>0]=h|2;g=f+56|0;h=c[g>>2]|0;if(!h){h=ll(0)|0;c[g>>2]=h}i=Ml(2)|0;if(Fk(h,i,c[t>>2]|0)|0)break;Le(45341,u);Se(45375,i);Se(45379,c[t>>2]|0)}else g=f+56|0;while(0);Kk(j,j,c[g>>2]|0);g=c[s>>2]|0;if(!g){Gk(j,j,c[t>>2]|0);l=v;return}else{Jk(j,j,g);l=v;return}}case 1:{c[g>>2]=45531;c[g+4>>2]=45456;Me(45482,g);break}case 2:{bk(b,d,e,f);l=v;return}default:{l=v;return}}}function bk(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;p=e+64|0;g=c[p>>2]|0;Kk(g,c[b+8>>2]|0,c[d+8>>2]|0);q=e+60|0;f=c[q>>2]|0;if(!f)Gk(g,g,c[e+16>>2]|0);else Jk(g,g,f);j=e+68|0;f=c[j>>2]|0;g=c[p>>2]|0;Kk(f,g,g);g=c[q>>2]|0;if(!g)Gk(f,f,c[e+16>>2]|0);else Jk(f,f,g);o=e+72|0;f=c[o>>2]|0;Kk(f,c[b>>2]|0,c[d>>2]|0);g=c[q>>2]|0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c[d>>2]|0);Kk(i,c[b+20>>2]|0,g);a=c[e>>2]|0;if(!a)Gk(i,i,c[d>>2]|0);else Jk(i,i,a);fk(i,i,c[b+24>>2]|0);a=c[e>>2]|0;if(!a)Gk(i,i,c[d>>2]|0);else Jk(i,i,a);fk(i,i,f);a=c[e>>2]|0;if(!a)Gk(i,i,c[d>>2]|0);else Jk(i,i,a);a=(wk(h,i)|0)==0&1;Jl(f);break}case 1:{if(Nj(g,0,a,b)|0){i=0;return i|0}Kk(i,c[b+20>>2]|0,Ml(4)|0);d=b+60|0;a=c[d>>2]|0;if(!a)Gk(i,i,c[b+16>>2]|0);else Jk(i,i,a);fk(i,i,Ml(2)|0);a=c[d>>2]|0;if(!a)Gk(i,i,c[b+16>>2]|0);else Jk(i,i,a);Kk(i,i,g);a=c[d>>2]|0;if(!a)Gk(i,i,c[b+16>>2]|0);else Jk(i,i,a);Kk(h,g,g);a=c[d>>2]|0;if(!a)Gk(h,h,c[b+16>>2]|0);else Jk(h,h,a);fk(i,i,h);a=c[d>>2]|0;if(!a)Gk(i,i,c[b+16>>2]|0);else Jk(i,i,a);fk(i,i,Ml(1)|0);a=c[d>>2]|0;if(!a)Gk(i,i,c[b+16>>2]|0);else Jk(i,i,a);Kk(i,i,g);a=c[d>>2]|0;if(!a)Gk(i,i,c[b+16>>2]|0);else Jk(i,i,a);Kk(i,i,c[b+24>>2]|0);a=c[d>>2]|0;if(!a){a=b+16|0;Gk(i,i,c[a>>2]|0)}else{Jk(i,i,a);a=b+16|0}hk(h,c[a>>2]|0,Ml(1)|0);sk(h,h,1);Mk(i,i,h,c[a>>2]|0);a=vk(i,1)|0;break}case 2:{if(Nj(g,h,a,b)|0){i=0;return i|0}Kk(g,g,g);d=b+60|0;a=c[d>>2]|0;if(!a)Gk(g,g,c[b+16>>2]|0);else Jk(g,g,a);Kk(h,h,h);a=c[d>>2]|0;if(!a)Gk(h,h,c[b+16>>2]|0);else Jk(h,h,a);do if((c[b+4>>2]|0)!=1){Kk(i,c[b+20>>2]|0,g);a=c[d>>2]|0;if(!a){Gk(i,i,c[b+16>>2]|0);break}else{Jk(i,i,a);break}}else{Al(i,g)|0;zl(i,i)}while(0);fk(i,i,h);a=c[d>>2]|0;if(!a)Gk(i,i,c[b+16>>2]|0);else Jk(i,i,a);hk(i,i,Ml(1)|0);Kk(g,g,h);a=c[d>>2]|0;if(!a)Gk(g,g,c[b+16>>2]|0);else Jk(g,g,a);Kk(g,g,c[b+24>>2]|0);a=c[d>>2]|0;if(!a)Gk(g,g,c[b+16>>2]|0);else Jk(g,g,a);hk(i,i,g);a=(vk(i,0)|0)==0&1;break}default:a=0}Jl(i);Jl(g);Jl(h);i=a;return i|0}function ek(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=c[b+4>>2]|0;e=c[b+8>>2]|0;if((c[a>>2]|0)<=(o|0))ql(a,o+1|0);g=c[b+16>>2]|0;n=c[a+16>>2]|0;if(!o){c[n>>2]=d;m=(d|0)!=0&1;n=0;o=a+4|0;c[o>>2]=m;o=a+8|0;c[o>>2]=n;return}if(!e){f=g+4|0;k=c[g>>2]|0;j=k+d|0;e=n+4|0;c[n>>2]=j;a:do if(j>>>0>>0){b=o;while(1){b=b+-1|0;if(!b){b=1;break a}g=f+4|0;k=(c[f>>2]|0)+1|0;d=e+4|0;c[e>>2]=k;if(!k){f=g;e=d}else{f=g;e=d;m=9;break}}}else{b=o;m=9}while(0);if((m|0)==9)if((e|0)!=(f|0)?(l=b+-1|0,(b|0)>1):0){b=0;do{c[e+(b<<2)>>2]=c[f+(b<<2)>>2];b=b+1|0}while((b|0)!=(l|0));b=0}else b=0;c[n+(o<<2)>>2]=b;m=b+o|0;n=0;o=a+4|0;c[o>>2]=m;o=a+8|0;c[o>>2]=n;return}b=c[g>>2]|0;if((o|0)==1&b>>>0>>0){c[n>>2]=d-b;m=1;n=0;o=a+4|0;c[o>>2]=m;o=a+8|0;c[o>>2]=n;return}e=g+4|0;l=b-d|0;f=n+4|0;c[n>>2]=l;b:do if(l>>>0>b>>>0){b=o;while(1){b=b+-1|0;if(!b)break b;g=e+4|0;l=c[e>>2]|0;d=f+4|0;c[f>>2]=l+-1;if(!l){e=g;f=d}else{h=b;i=g;j=d;m=18;break}}}else{h=o;i=e;j=f;m=18}while(0);if(((m|0)==18?(j|0)!=(i|0):0)?(k=h+-1|0,(h|0)>1):0){b=0;do{c[j+(b<<2)>>2]=c[i+(b<<2)>>2];b=b+1|0}while((b|0)!=(k|0))}m=o-((c[n+(o+-1<<2)>>2]|0)==0&1)|0;n=1;o=a+4|0;c[o>>2]=m;o=a+8|0;c[o>>2]=n;return}function fk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;e=c[b+4>>2]|0;h=c[d+4>>2]|0;if((e|0)<(h|0)){g=c[d+8>>2]|0;f=c[b+8>>2]|0;if((c[a>>2]|0)>(h|0)){p=g;i=e;e=h;g=b;b=d}else{ql(a,h+1|0);p=g;i=e;e=h;g=b;b=d}}else{g=c[b+8>>2]|0;f=c[d+8>>2]|0;if((c[a>>2]|0)>(e|0)){p=g;i=h;g=d}else{ql(a,e+1|0);p=g;i=h;g=d}}d=c[b+16>>2]|0;g=c[g+16>>2]|0;o=c[a+16>>2]|0;if(!i){if((e|0)>0)b=0;else{n=e;o=a+4|0;c[o>>2]=n;a=a+8|0;c[a>>2]=p;return}do{c[o+(b<<2)>>2]=c[d+(b<<2)>>2];b=b+1|0}while((b|0)!=(e|0));b=p;p=a+4|0;c[p>>2]=e;a=a+8|0;c[a>>2]=b;return}if((p|0)==(f|0)){b=Wk(o,d,g,i)|0;h=e-i|0;a:do if(h){k=o+(i<<2)|0;m=d+(i<<2)|0;g=m+4|0;m=c[m>>2]|0;l=m+b|0;f=k+4|0;c[k>>2]=l;if(l>>>0>>0){b=h;while(1){b=b+-1|0;if(!b){b=1;break a}h=g+4|0;m=(c[g>>2]|0)+1|0;d=f+4|0;c[f>>2]=m;if(!m){g=h;f=d}else{g=h;f=d;break}}}else b=h;if((f|0)!=(g|0)?(n=b+-1|0,(b|0)>1):0){b=0;do{c[f+(b<<2)>>2]=c[g+(b<<2)>>2];b=b+1|0}while((b|0)!=(n|0));b=0}else b=0}while(0);c[o+(e<<2)>>2]=b;p=(p|0)!=0&1;n=b+e|0;o=a+4|0;c[o>>2]=n;a=a+8|0;c[a>>2]=p;return}if((e|0)!=(i|0)){b=hl(o,d,g,i)|0;h=e-i|0;b:do if(h){k=o+(i<<2)|0;n=d+(i<<2)|0;g=n+4|0;n=c[n>>2]|0;l=n-b|0;f=k+4|0;c[k>>2]=l;if(l>>>0>n>>>0){b=h;while(1){b=b+-1|0;if(!b)break b;h=g+4|0;n=c[g>>2]|0;d=f+4|0;c[f>>2]=n+-1;if(!n){g=h;f=d}else{g=h;f=d;break}}}else b=h;if((f|0)!=(g|0)?(m=b+-1|0,(b|0)>1):0){b=0;do{c[f+(b<<2)>>2]=c[g+(b<<2)>>2];b=b+1|0}while((b|0)!=(m|0))}}while(0);while(1){if((e|0)<=0){b=p;l=39;break}b=e+-1|0;if(!(c[o+(b<<2)>>2]|0))e=b;else{b=p;l=39;break}}if((l|0)==39){p=a+4|0;c[p>>2]=e;a=a+8|0;c[a>>2]=b;return}}else b=e;while(1){if((b|0)<=0)break;b=b+-1|0;j=c[d+(b<<2)>>2]|0;k=c[g+(b<<2)>>2]|0;if((j|0)!=(k|0)){l=22;break}}if((l|0)==22?j>>>0<=k>>>0:0){hl(o,g,d,e)|0;while(1){if((e|0)<=0)break;b=e+-1|0;if(!(c[o+(b<<2)>>2]|0))e=b;else break}p=(p|0)==0&1;n=e;o=a+4|0;c[o>>2]=n;a=a+8|0;c[a>>2]=p;return}hl(o,d,g,e)|0;while(1){if((e|0)<=0)break;b=e+-1|0;if(!(c[o+(b<<2)>>2]|0))e=b;else break}p=(p|0)!=0&1;n=e;o=a+4|0;c[o>>2]=n;a=a+8|0;c[a>>2]=p;return}function gk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=c[b+4>>2]|0;e=c[b+8>>2]|0;if((c[a>>2]|0)<=(o|0))ql(a,o+1|0);g=c[b+16>>2]|0;n=c[a+16>>2]|0;if(!o){c[n>>2]=d;m=(d|0)!=0&1;n=1;o=a+4|0;c[o>>2]=m;o=a+8|0;c[o>>2]=n;return}if(e|0){f=g+4|0;k=c[g>>2]|0;j=k+d|0;e=n+4|0;c[n>>2]=j;a:do if(j>>>0>>0){b=o;while(1){b=b+-1|0;if(!b){b=1;break a}g=f+4|0;k=(c[f>>2]|0)+1|0;d=e+4|0;c[e>>2]=k;if(!k){f=g;e=d}else{f=g;e=d;m=9;break}}}else{b=o;m=9}while(0);if((m|0)==9)if((e|0)!=(f|0)?(l=b+-1|0,(b|0)>1):0){b=0;do{c[e+(b<<2)>>2]=c[f+(b<<2)>>2];b=b+1|0}while((b|0)!=(l|0));b=0}else b=0;c[n+(o<<2)>>2]=b;m=b+o|0;n=0;o=a+4|0;c[o>>2]=m;o=a+8|0;c[o>>2]=n;return}b=c[g>>2]|0;if((o|0)==1&b>>>0>>0){c[n>>2]=d-b;m=1;n=1;o=a+4|0;c[o>>2]=m;o=a+8|0;c[o>>2]=n;return}e=g+4|0;l=b-d|0;f=n+4|0;c[n>>2]=l;b:do if(l>>>0>b>>>0){b=o;while(1){b=b+-1|0;if(!b)break b;g=e+4|0;l=c[e>>2]|0;d=f+4|0;c[f>>2]=l+-1;if(!l){e=g;f=d}else{h=b;i=g;j=d;m=18;break}}}else{h=o;i=e;j=f;m=18}while(0);if(((m|0)==18?(j|0)!=(i|0):0)?(k=h+-1|0,(h|0)>1):0){b=0;do{c[j+(b<<2)>>2]=c[i+(b<<2)>>2];b=b+1|0}while((b|0)!=(k|0))}m=o-((c[n+(o+-1<<2)>>2]|0)==0&1)|0;n=0;o=a+4|0;c[o>>2]=m;o=a+8|0;c[o>>2]=n;return}function hk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;d=yl(d)|0;e=d+8|0;c[e>>2]=(c[e>>2]|0)==0&1;fk(a,b,d);tl(d);return}function ik(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;fk(a,b,c);Gk(a,a,d);return}function jk(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;d=yl(d)|0;f=d+8|0;c[f>>2]=(c[f>>2]|0)==0&1;fk(a,b,d);tl(d);Gk(a,a,e);return}function kk(a){a=a|0;var b=0,d=0,e=0;if(a|0?c[a+12>>2]&4|0:0)return;e=a+4|0;d=c[e>>2]|0;if(!d)return;b=c[a+16>>2]|0;a=d;while(1){a=a+-1|0;if(c[b+(a<<2)>>2]|0){a=7;break}c[e>>2]=a;if(!a){a=7;break}}if((a|0)==7)return}function lk(a){a=a|0;var b=0,e=0,f=0,g=0,h=0;if(a|0?c[a+12>>2]&4|0:0){h=c[a+8>>2]|0;return h|0}h=a+4|0;b=c[h>>2]|0;if(!b){h=0;return h|0}f=c[a+16>>2]|0;while(1){e=b+-1|0;if(c[f+(e<<2)>>2]|0)break;c[h>>2]=e;if(!e){b=0;g=11;break}else b=e}if((g|0)==11)return b|0;b=c[(c[a+16>>2]|0)+(b+-1<<2)>>2]|0;if(!b)b=32;else{g=b>>>0<65536?(b>>>0<256?0:8):b>>>0<16777216?16:24;b=32-g-(d[45555+(b>>>g)>>0]|0)|0}h=(c[h>>2]<<5)-b|0;return h|0}function mk(a,b){a=a|0;b=b|0;var d=0;d=b>>>5;if(d>>>0>=(c[a+4>>2]|0)>>>0){d=0;return d|0}d=(c[(c[a+16>>2]|0)+(d<<2)>>2]&1<<(b&31)|0)!=0&1;return d|0}function nk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;if(a|0?c[a+12>>2]&16|0:0){sl();return}g=b>>>5;e=b&31;f=a+4|0;b=c[f>>2]|0;if(g>>>0>=b>>>0){if(b>>>0<(c[a>>2]|0)>>>0){d=c[a+16>>2]|0;do{c[d+(b<<2)>>2]=0;b=b+1|0}while(b>>>0<(c[a>>2]|0)>>>0)}d=g+1|0;ql(a,d);c[f>>2]=d}g=(c[a+16>>2]|0)+(g<<2)|0;c[g>>2]=c[g>>2]|1<>2]&16|0:0){sl();return}g=b>>>5;e=b&31;f=a+4|0;b=c[f>>2]|0;if(g>>>0>=b>>>0){if(b>>>0<(c[a>>2]|0)>>>0){d=c[a+16>>2]|0;do{c[d+(b<<2)>>2]=0;b=b+1|0}while(b>>>0<(c[a>>2]|0)>>>0)}d=g+1|0;ql(a,d);c[f>>2]=d}a=(c[a+16>>2]|0)+(g<<2)|0;d=c[a>>2]|1<>2]=d;b=e+1|0;if(b>>>0<32){do{d=d&~(1<>2]=d}c[f>>2]=g+1;return}function pk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;if(a|0?c[a+12>>2]&16|0:0){sl();return}e=b>>>5;f=a+4|0;if(e>>>0>=(c[f>>2]|0)>>>0)return;d=(c[a+16>>2]|0)+(e<<2)|0;a=b&31;b=c[d>>2]|0;do{b=b&~(1<>2]=b;c[f>>2]=e+1;return}function qk(a,b){a=a|0;b=b|0;var d=0;if(a|0?c[a+12>>2]&16|0:0){sl();return}d=b>>>5;if(d>>>0>=(c[a+4>>2]|0)>>>0)return;d=(c[a+16>>2]|0)+(d<<2)|0;c[d>>2]=c[d>>2]&~(1<<(b&31));return}function rk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;e=c[a+16>>2]|0;f=a+4|0;d=c[f>>2]|0;if(a|0?c[a+12>>2]&16|0:0){sl();return}if(d>>>0<=b>>>0){c[f>>2]=0;return}a=d-b|0;if(!a)a=0;else{d=0;do{c[e+(d<<2)>>2]=c[e+(d+b<<2)>>2];d=d+1|0}while((d|0)!=(a|0))}c[e+(a<<2)>>2]=0;c[f>>2]=(c[f>>2]|0)-b;return}function sk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;h=d>>>5;i=d&31;if(a|0?c[a+12>>2]&16|0:0){sl();return}a:do if((a|0)==(b|0)){f=a+4|0;d=c[f>>2]|0;if(h>>>0>=d>>>0){c[f>>2]=0;return}if(h){e=c[a+16>>2]|0;d=0;do{c[e+(d<<2)>>2]=c[e+(d+h<<2)>>2];d=d+1|0}while(d>>>0<((c[f>>2]|0)-h|0)>>>0);c[e+(d<<2)>>2]=0;d=(c[f>>2]|0)-h|0;c[f>>2]=d}if((i|0)!=0&(d|0)!=0){h=c[a+16>>2]|0;gl(h,h,d,i)|0}}else{g=b+4|0;e=c[g>>2]|0;c[a+8>>2]=c[b+8>>2];d=(c[a>>2]|0)<(e|0);if(!h){if(d)ql(a,e);f=a+4|0;c[f>>2]=e;if(!e)break;if(i|0){gl(c[a+16>>2]|0,c[b+16>>2]|0,e,i)|0;break}e=c[b+16>>2]|0;b=c[a+16>>2]|0;d=0;while(1){c[b+(d<<2)>>2]=c[e+(d<<2)>>2];d=d+1|0;if(d>>>0>=(c[f>>2]|0)>>>0)break a}}if(d)ql(a,e);f=a+4|0;c[f>>2]=e;if(!(c[g>>2]|0))d=0;else{e=c[b+16>>2]|0;b=c[a+16>>2]|0;d=0;do{c[b+(d<<2)>>2]=c[e+(d<<2)>>2];d=d+1|0}while(d>>>0<(c[g>>2]|0)>>>0)}c[f>>2]=d;if(h>>>0>=d>>>0){c[f>>2]=0;return}e=c[a+16>>2]|0;d=0;do{c[e+(d<<2)>>2]=c[e+(d+h<<2)>>2];d=d+1|0}while(d>>>0<((c[f>>2]|0)-h|0)>>>0);c[e+(d<<2)>>2]=0;d=(c[f>>2]|0)-h|0;c[f>>2]=d;if((i|0)!=0&(d|0)!=0)gl(e,e,d,i)|0}while(0);d=c[f>>2]|0;if((d|0)<=0)return;b=c[a+16>>2]|0;while(1){e=d;d=d+-1|0;if(c[b+(d<<2)>>2]|0){d=36;break}c[f>>2]=d;if((e|0)<=1){d=36;break}}if((d|0)==36)return}function tk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=a+4|0;d=c[f>>2]|0;if(!((b|0)!=0&(d|0)!=0))return;e=d+b|0;if((c[a>>2]|0)>>>0>>0)ql(a,e);a=c[a+16>>2]|0;if((d|0)>0)do{e=d;d=d+-1|0;c[a+(d+b<<2)>>2]=c[a+(d<<2)>>2]}while((e|0)>1);Yq(a|0,0,b<<2|0)|0;c[f>>2]=(c[f>>2]|0)+b;return}function uk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=d>>>5;j=d&31;if(a|0?c[a+12>>2]&16|0:0){sl();return}e=(a|0)!=(b|0);i=(d|0)!=0;if(!(e|i))return;if(e){g=c[b+4>>2]|0;h=c[b+8>>2]|0;d=k+1+g|0;if((c[a>>2]|0)>>>0>>0)ql(a,d);e=c[a+16>>2]|0;f=c[b+16>>2]|0;if(g|0){d=0;do{c[e+(d<<2)>>2]=c[f+(d<<2)>>2];d=d+1|0}while((d|0)!=(g|0))}c[a+4>>2]=g;c[a+12>>2]=c[b+12>>2];c[a+8>>2]=h}do if(!((k|0)==0|(j|0)!=0)){g=a+4|0;d=c[g>>2]|0;if(d){e=d+k|0;if((c[a>>2]|0)>>>0>>0)ql(a,e);e=c[a+16>>2]|0;if((d|0)>0)do{j=d;d=d+-1|0;c[e+(d+k<<2)>>2]=c[e+(d<<2)>>2]}while((j|0)>1);Yq(e|0,0,k<<2|0)|0;c[g>>2]=(c[g>>2]|0)+k}}else{if(!i){g=a+4|0;break}f=k+1|0;g=a+4|0;d=c[g>>2]|0;if(d|0){e=d+f|0;if((c[a>>2]|0)>>>0>>0)ql(a,e);e=c[a+16>>2]|0;if((d|0)>0)do{b=d;d=d+-1|0;c[e+(b+k<<2)>>2]=c[e+(d<<2)>>2]}while((b|0)>1);Yq(e|0,0,f<<2|0)|0;c[g>>2]=(c[g>>2]|0)+f}sk(a,a,32-j|0)}while(0);d=c[g>>2]|0;if((d|0)<=0)return;f=c[a+16>>2]|0;while(1){e=d;d=d+-1|0;if(c[f+(d<<2)>>2]|0){d=31;break}c[g>>2]=d;if((e|0)<=1){d=31;break}}if((d|0)==31)return}function vk(a,b){a=a|0;b=b|0;var d=0;kk(a);d=c[a+4>>2]|0;if(!d){b=((b|0)!=0)<<31>>31;return b|0}if(c[a+8>>2]|0){b=-1;return b|0}if((d|0)!=1){b=1;return b|0}a=c[c[a+16>>2]>>2]|0;if(a>>>0>b>>>0){b=1;return b|0}b=(a>>>0>>0)<<31>>31;return b|0}function wk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;e=(a|0)!=0;if(e?(d=c[a+12>>2]|0,(d&4|0)!=0):0)j=7;else j=3;do if((j|0)==3){if(b|0?(f=c[b+12>>2]|0,f&4|0):0){if(!e){g=f;j=12;break}d=c[a+12>>2]|0;j=7;break}kk(a);kk(b);d=c[a+4>>2]|0;g=c[b+4>>2]|0;i=c[a+8>>2]|0;h=(i|0)==0;e=c[b+8>>2]|0;f=(e|0)==0;if(h)if(f)e=0;else{j=1;return j|0}else if(f){j=-1;return j|0}do if((d|0)!=(g|0)){e=(e|0)==0;if(h){if(!e)break;j=d-g|0;return j|0}else{if(e)break;j=g+d|0;return j|0}}while(0);if(!d){j=0;return j|0}h=c[a+16>>2]|0;g=c[b+16>>2]|0;do{if((d|0)<=0){d=0;j=31;break}d=d+-1|0;e=c[h+(d<<2)>>2]|0;f=c[g+(d<<2)>>2]|0}while((e|0)==(f|0));if((j|0)==31)return d|0;j=e>>>0<=f>>>0^(i|0)!=0?-1:1;return j|0}while(0);do if((j|0)==7){d=(d&4|0)==0;if(d){if(!((b|0)!=0&d))break;g=c[b+12>>2]|0;j=12;break}if(!b){j=-1;return j|0}if(!(c[b+12>>2]&4)){j=-1;return j|0}}while(0);if((j|0)==12?g&4|0:0){j=1;return j|0}d=c[a+8>>2]|0;e=c[b+8>>2]|0;if(!(d|e)){j=0;return j|0}if((d|0)<(e|0)){j=-1;return j|0}if((d|0)>(e|0)){j=1;return j|0}j=Tp(c[a+16>>2]|0,c[b+16>>2]|0,(d+7|0)/8|0)|0;return j|0}function xk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=c[d+8>>2]|0;if((a|0)==(d|0)){d=yl(d)|0;e=d}else e=0;yk(0,a,b,d);if((f|0)!=0^(c[b+8>>2]|0)!=0?c[a+4>>2]|0:0)fk(a,a,d);if(!e)return;tl(e);return}function yk(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;y=l;l=l+48|0;if((l|0)>=(m|0))$(48);w=y+20|0;x=y;i=e+4|0;s=c[i>>2]|0;h=c[f+4>>2]|0;g=e+8|0;v=c[g>>2]|0;t=c[f+8>>2]^v;n=s+1|0;ql(b,n);j=n-h|0;if((j|0)<1){if((e|0)!=(b|0)?(c[b+4>>2]=c[i>>2],c[b+8>>2]=c[g>>2],(s|0)>0):0){i=c[e+16>>2]|0;h=c[b+16>>2]|0;g=0;do{c[h+(g<<2)>>2]=c[i+(g<<2)>>2];g=g+1|0}while((g|0)!=(s|0))}if(!a){l=y;return}c[a+4>>2]=0;c[a+8>>2]=0;l=y;return}r=(a|0)!=0;if(r)ql(a,j);e=c[e+16>>2]|0;k=c[f+16>>2]|0;u=c[b+16>>2]|0;if((h|0)==1){if(r){x=c[a+16>>2]|0;g=Zk(x,e,s,c[k>>2]|0)|0;c[a+4>>2]=j-((c[x+(j+-1<<2)>>2]|0)==0&1);c[a+8>>2]=t}else g=Xk(e,s,c[k>>2]|0)|0;c[u>>2]=g;c[b+4>>2]=(g|0)!=0&1;c[b+8>>2]=v;l=y;return}if(r){g=c[a+16>>2]|0;if((g|0)==(e|0)){c[x>>2]=s;i=ml(s,c[a+12>>2]&1)|0;c[w>>2]=i;if((s|0)>0){g=0;do{c[i+(g<<2)>>2]=c[e+(g<<2)>>2];g=g+1|0}while((g|0)!=(s|0));o=e;g=1}else{o=e;g=1}}else{i=e;o=g;g=0}}else{i=e;o=u+(h<<2)|0;g=0}q=c[k+(h+-1<<2)>>2]|0;p=q>>>0<65536?(q>>>0<256?0:8):q>>>0<16777216?16:24;p=32-(d[45555+(q>>>p)>>0]|0)-p|0;q=(p|0)!=0;if(q){c[x+(g<<2)>>2]=h;if(!f)e=0;else e=(c[f+12>>2]&1|0)!=0;j=ml(h,e&1)|0;e=g+1|0;c[w+(g<<2)>>2]=j;_k(j,k,h,p)|0;g=_k(u,i,s,p)|0;if(!g){i=s;g=e}else{c[u+(s<<2)>>2]=g;i=n;g=e}}else{if((k|0)==(u|0)|r&(k|0)==(o|0)){c[x+(g<<2)>>2]=h;if(!f)e=0;else e=(c[f+12>>2]&1|0)!=0;j=ml(h,e&1)|0;e=g+1|0;c[w+(g<<2)>>2]=j;if((h|0)>0){g=0;do{c[j+(g<<2)>>2]=c[k+(g<<2)>>2];g=g+1|0}while((g|0)!=(h|0));g=e}else g=e}else j=k;if((u|0)!=(i|0)&(s|0)>0){e=0;do{c[u+(e<<2)>>2]=c[i+(e<<2)>>2];e=e+1|0}while((e|0)!=(s|0));i=s}else i=s}e=Yk(o,0,u,i,j,h)|0;if(r){i=i-h|0;if(e){c[o+(i<<2)>>2]=e;i=i+1|0}c[a+4>>2]=i;c[a+8>>2]=t}while(1){if((h|0)<=0)break;i=h+-1|0;if(!(c[u+(i<<2)>>2]|0))h=i;else break}if(q&(h|0)!=0){gl(u,u,h,p)|0;h=h-((c[u+(h+-1<<2)>>2]|0)==0&1)|0}c[b+4>>2]=h;c[b+8>>2]=v;if(!g){l=y;return}do{g=g+-1|0;ol(c[w+(g<<2)>>2]|0,c[x+(g<<2)>>2]|0)}while((g|0)!=0);l=y;return}function zk(a,b,c){a=a|0;b=b|0;c=c|0;yk(0,a,b,c);return}function Ak(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=Xk(c[b+16>>2]|0,c[b+4>>2]|0,d)|0;if(!e)b=0;else b=(c[b+8>>2]|0)==0?e:d-e|0;if(!a)return b|0;c[c[a+16>>2]>>2]=b;c[a+4>>2]=(b|0)!=0&1;return b|0}function Bk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;f=ll(c[a+4>>2]|0)|0;g=c[d+8>>2]|0;if((a|0)==(d|0)|(f|0)==(d|0)){d=yl(d)|0;e=d}else e=0;yk(a,f,b,d);if((g|0)!=(c[b+8>>2]|0)?c[f+4>>2]|0:0){gk(a,a,1);fk(f,f,d)}if(!e){tl(f);return}tl(e);tl(f);return}function Ck(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=c[b+4>>2]|0;g=d>>>5;e=h-g|0;if((h|0)<=(g|0)){c[a+4>>2]=0;return}if((c[a>>2]|0)<(e|0))ql(a,e);h=c[a+16>>2]|0;f=c[b+16>>2]|0;b=d&31;if(!b){if((e|0)>0){f=f+(g<<2)|0;b=0;do{c[h+(b<<2)>>2]=c[f+(b<<2)>>2];b=b+1|0}while((b|0)!=(e|0))}}else{gl(h,f+(g<<2)|0,e,b)|0;e=e-((c[h+(e+-1<<2)>>2]|0)==0&1)|0}c[a+4>>2]=e;return}function Dk(a,b){a=a|0;b=b|0;return (Xk(c[a+16>>2]|0,c[a+4>>2]|0,b)|0)==0|0}function Ek(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=yl(b)|0;b=yl(d)|0;c[e+8>>2]=0;c[b+8>>2]=0;if(vk(b,0)|0)do{xk(a,e,b);Al(e,b)|0;Al(b,a)|0}while((vk(b,0)|0)!=0);Al(a,e)|0;tl(e);tl(b);return (vk(a,1)|0)==0|0}function Fk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;if(!(vk(b,0)|0)){a=0;return a|0}if(!(vk(d,1)|0)){a=0;return a|0}q=yl(b)|0;p=yl(d)|0;a:do if(!(mk(q,0)|0))do{if(mk(p,0)|0)break a;sk(q,q,1);sk(p,p,1)}while(!(mk(q,0)|0));while(0);l=mk(p,0)|0;k=kl(1)|0;l=(l|0)!=0;if(l)i=0;else i=kl(0)|0;m=yl(q)|0;n=yl(p)|0;if(l)j=0;else{j=ll(c[q+4>>2]|0)|0;hk(j,k,q)}o=yl(p)|0;if(!(mk(q,0)|0)){b=kl(1)|0;if(l)d=0;else d=kl(0)|0;f=yl(q)|0;g=17}else{b=kl(0)|0;if(l)d=0;else{d=kl(1)|0;c[d+8>>2]=1}h=yl(p)|0;f=h+8|0;c[f>>2]=(c[f>>2]|0)==0&1}while(1){if((g|0)==17){g=0;e=(mk(b,0)|0)!=0;if(l){if(e)fk(b,b,p);sk(b,b,1);sk(f,f,1);h=f;continue}if(!(!e?!(mk(d,0)|0):0)){fk(b,b,p);hk(d,d,q)}sk(b,b,1);sk(d,d,1);sk(f,f,1);h=f}if(!(mk(h,0)|0)){f=h;g=17;continue}e=h+8|0;if(!(c[e>>2]|0)){Al(k,b)|0;if(!l)Al(i,d)|0;Al(m,h)|0}else{hk(n,p,b);f=q+8|0;g=c[f>>2]|0;c[f>>2]=(g|0)==0&1;if(!l)hk(j,q,d);c[f>>2]=g;g=c[e>>2]|0;c[e>>2]=(g|0)==0&1;Al(o,h)|0;c[e>>2]=g}hk(b,k,n);if(!l)hk(d,i,j);hk(h,m,o);if(c[b+8>>2]|0?(fk(b,b,p),!l):0)hk(d,d,q);if(!(vk(h,0)|0))break;else{f=h;g=17}}Al(a,k)|0;tl(k);tl(n);tl(b);if(!l){tl(i);tl(j);tl(d)}tl(m);tl(o);tl(h);tl(q);tl(p);a=1;return a|0}function Gk(a,b,c){a=a|0;b=b|0;c=c|0;xk(a,b,c);return}function Hk(a,b){a=a|0;b=b|0;var d=0,e=0;kk(a);d=kf(1,28)|0;if(!b)c[d>>2]=a;else{c[d>>2]=yl(a)|0;c[d+4>>2]=1}b=c[a+4>>2]|0;c[d+8>>2]=b;e=ll(b+1|0)|0;El(e,1)|0;b=b<<1;tk(e,b);Bk(e,e,a);c[d+12>>2]=e;b=b|1;c[d+16>>2]=ll(b)|0;c[d+20>>2]=ll(b)|0;return d|0}function Ik(a){a=a|0;var b=0;if(!a)return;tl(c[a+12>>2]|0);tl(c[a+16>>2]|0);tl(c[a+20>>2]|0);b=c[a+24>>2]|0;if(b|0)tl(b);if(c[a+4>>2]|0)tl(c[a>>2]|0);cf(a);return}function Jk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;l=c[d>>2]|0;i=c[d+8>>2]|0;e=c[d+12>>2]|0;g=c[d+16>>2]|0;f=c[d+20>>2]|0;kk(b);if((c[b+4>>2]|0)>(i<<1|0)){xk(a,b,l);return}j=b+8|0;k=c[j>>2]|0;c[j>>2]=0;Al(f,b)|0;rk(f,i+-1|0);Kk(f,f,e);h=i+1|0;rk(f,h);Al(g,b)|0;e=g+4|0;if((c[e>>2]|0)>(h|0))c[e>>2]=h;Kk(f,f,l);e=f+4|0;if((c[e>>2]|0)>(h|0))c[e>>2]=h;hk(a,g,f);if(c[a+8>>2]|0){b=d+24|0;e=c[b>>2]|0;if(!e){e=ll(i+2|0)|0;c[b>>2]=e;El(e,1)|0;tk(c[b>>2]|0,h);e=c[b>>2]|0}fk(a,a,e)}if((wk(a,l)|0)>-1)do hk(a,a,l);while((wk(a,l)|0)>-1);c[j>>2]=k;return}function Kk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;k=c[b+4>>2]|0;l=c[d+4>>2]|0;h=(k|0)<(l|0);p=h?b:d;i=h?d:b;m=h?l:k;g=c[i+12>>2]&1;l=h?k:l;k=c[i+16>>2]|0;h=c[p+12>>2]&1;f=c[p+16>>2]|0;p=c[i+8>>2]^c[p+8>>2];i=a+16|0;e=c[i>>2]|0;n=m+l|0;if((a|0)!=0?(c[a+12>>2]&1|0)!=0:0)o=7;else o=3;do if((o|0)==3){if(!(c[b+12>>2]&1)){if(!d){o=7;break}if(!(c[d+12>>2]&1)){o=7;break}}h=0;j=0;g=2;e=ml(n,1)|0;b=k}while(0);a:do if((o|0)==7){b=(e|0)==(k|0);if((c[a>>2]|0)<(n|0))if(b|(e|0)==(f|0)){h=0;j=0;g=1;e=ml(n,c[a+12>>2]&1)|0;b=k;break}else{ql(a,n);h=0;j=0;g=0;e=c[i>>2]|0;b=k;break}if(b){b=ml(m,g)|0;f=(k|0)==(f|0)?b:f;if((m|0)>0)e=0;else{h=m;j=b;g=0;e=k;break}while(1){c[b+(e<<2)>>2]=c[k+(e<<2)>>2];e=e+1|0;if((e|0)>=(m|0)){h=m;j=b;g=0;e=k;break a}}}if((e|0)==(f|0)){d=ml(l,h)|0;if((l|0)>0){e=0;do{c[d+(e<<2)>>2]=c[f+(e<<2)>>2];e=e+1|0}while((e|0)!=(l|0));h=l;j=d;g=0;e=f;b=k;f=d}else{h=l;j=d;g=0;e=f;b=k;f=d}}else{h=0;j=0;g=0;b=k}}while(0);if(!l)d=0;else d=n-((el(e,b,m,f,l)|0)==0&1)|0;switch(g&3){case 0:break;case 2:{b=ml(d,0)|0;if((d|0)>0){f=0;do{c[b+(f<<2)>>2]=c[e+(f<<2)>>2];f=f+1|0}while((f|0)!=(d|0))}ol(e,0);e=b;o=23;break}default:o=23}if((o|0)==23)pl(a,e,d);c[a+4>>2]=d;c[a+8>>2]=p;if(!j)return;ol(j,h);return}function Lk(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;Kk(a,b,c);zk(a,a,d);return} +function op(e,f,g,i,k){e=e|0;f=f|0;g=g|0;i=i|0;k=k|0;var n=0,o=0,p=0,q=0,r=0.0,s=0,t=0,u=0,v=0,w=0.0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0;la=l;l=l+624|0;if((l|0)>=(m|0))$(624);ha=la+24|0;ia=la+16|0;ja=la+588|0;Z=la+576|0;ka=la;U=la+536|0;O=la+8|0;P=la+528|0;Q=(e|0)!=0;R=U+40|0;T=R;U=U+39|0;V=O+4|0;W=ja;X=0-W|0;Y=Z+12|0;Z=Z+11|0;_=Y;aa=_-W|0;ba=-2-W|0;ca=_+2|0;da=ha+288|0;ea=ja+9|0;fa=ea;ga=ja+8|0;o=0;n=0;t=0;a:while(1){do if((n|0)>-1)if((o|0)>(2147483647-n|0)){c[(zo()|0)>>2]=75;n=-1;break}else{n=o+n|0;break}while(0);o=a[f>>0]|0;if(!(o<<24>>24)){N=243;break}else p=f;b:while(1){switch(o<<24>>24){case 37:{o=p;N=9;break b}case 0:{o=p;break b}default:{}}o=p+1|0;p=o;o=a[o>>0]|0}c:do if((N|0)==9)while(1){N=0;if((a[p+1>>0]|0)!=37)break c;o=o+1|0;p=p+2|0;if((a[p>>0]|0)==37)N=9;else break}while(0);o=o-f|0;if(Q?(c[e>>2]&32|0)==0:0)rp(f,o,e)|0;if(o|0){f=p;continue}s=p+1|0;q=a[s>>0]|0;o=(q<<24>>24)+-48|0;if(o>>>0<10){v=(a[p+2>>0]|0)==36;s=v?p+3|0:s;x=v?o:-1;v=v?1:t;o=a[s>>0]|0}else{x=-1;v=t;o=q}p=(o<<24>>24)+-32|0;d:do if(p>>>0<32){q=0;do{if(!(1<>24)+-32|q;s=s+1|0;o=a[s>>0]|0;p=(o<<24>>24)+-32|0}while(p>>>0<32)}else q=0;while(0);do if(o<<24>>24!=42){p=(o<<24>>24)+-48|0;if(p>>>0<10){t=0;do{t=(t*10|0)+p|0;s=s+1|0;o=a[s>>0]|0;p=(o<<24>>24)+-48|0}while(p>>>0<10);if((t|0)<0){n=-1;break a}else M=v}else{t=0;M=v}}else{u=s+1|0;o=a[u>>0]|0;p=(o<<24>>24)+-48|0;if(p>>>0<10?(a[s+2>>0]|0)==36:0){c[k+(p<<2)>>2]=10;o=c[i+((a[u>>0]|0)+-48<<3)>>2]|0;p=1;u=s+3|0}else{if(v|0){n=-1;break a}if(!Q){t=0;M=0;s=u;break}p=(c[g>>2]|0)+(4-1)&~(4-1);o=c[p>>2]|0;c[g>>2]=p+4;p=0}M=(o|0)<0;t=M?0-o|0:o;q=M?q|8192:q;M=p;s=u;o=a[u>>0]|0}while(0);e:do if(o<<24>>24==46){o=s+1|0;p=a[o>>0]|0;if(p<<24>>24!=42){s=(p<<24>>24)+-48|0;if(s>>>0<10)p=0;else{y=0;break}while(1){p=(p*10|0)+s|0;o=o+1|0;s=(a[o>>0]|0)+-48|0;if(s>>>0>=10){y=p;break e}}}o=s+2|0;p=(a[o>>0]|0)+-48|0;if(p>>>0<10?(a[s+3>>0]|0)==36:0){c[k+(p<<2)>>2]=10;y=c[i+((a[o>>0]|0)+-48<<3)>>2]|0;o=s+4|0;break}if(M|0){n=-1;break a}if(Q){L=(c[g>>2]|0)+(4-1)&~(4-1);y=c[L>>2]|0;c[g>>2]=L+4}else y=0}else{y=-1;o=s}while(0);v=0;while(1){p=(a[o>>0]|0)+-65|0;if(p>>>0>57){n=-1;break a}L=o+1|0;p=a[66502+(v*58|0)+p>>0]|0;s=p&255;if((s+-1|0)>>>0<8){v=s;o=L}else break}if(!(p<<24>>24)){n=-1;break}u=(x|0)>-1;do if(p<<24>>24==19)if(u){n=-1;break a}else N=51;else{if(u){c[k+(x<<2)>>2]=s;J=i+(x<<3)|0;K=c[J+4>>2]|0;N=ka;c[N>>2]=c[J>>2];c[N+4>>2]=K;N=51;break}if(!Q){n=0;break a}sp(ka,s,g)}while(0);if((N|0)==51?(N=0,!Q):0){o=0;t=M;f=L;continue}G=a[o>>0]|0;G=(v|0)!=0&(G&15|0)==3?G&-33:G;u=q&-65537;K=(q&8192|0)==0?q:u;f:do switch(G|0){case 110:switch((v&255)<<24>>24){case 0:{c[c[ka>>2]>>2]=n;o=0;t=M;f=L;continue a}case 1:{c[c[ka>>2]>>2]=n;o=0;t=M;f=L;continue a}case 2:{o=c[ka>>2]|0;c[o>>2]=n;c[o+4>>2]=((n|0)<0)<<31>>31;o=0;t=M;f=L;continue a}case 3:{b[c[ka>>2]>>1]=n;o=0;t=M;f=L;continue a}case 4:{a[c[ka>>2]>>0]=n;o=0;t=M;f=L;continue a}case 6:{c[c[ka>>2]>>2]=n;o=0;t=M;f=L;continue a}case 7:{o=c[ka>>2]|0;c[o>>2]=n;c[o+4>>2]=((n|0)<0)<<31>>31;o=0;t=M;f=L;continue a}default:{o=0;t=M;f=L;continue a}}case 112:{u=120;v=y>>>0>8?y:8;o=K|8;N=63;break}case 88:case 120:{u=G;v=y;o=K;N=63;break}case 111:{p=ka;o=c[p>>2]|0;p=c[p+4>>2]|0;if((o|0)==0&(p|0)==0)f=R;else{f=R;do{f=f+-1|0;a[f>>0]=o&7|48;o=gr(o|0,p|0,3)|0;p=D}while(!((o|0)==0&(p|0)==0))}if(!(K&8)){p=0;q=66982;s=y;o=K;N=76}else{s=T-f|0;p=0;q=66982;s=(y|0)>(s|0)?y:s+1|0;o=K;N=76}break}case 105:case 100:{f=ka;o=c[f>>2]|0;f=c[f+4>>2]|0;if((f|0)<0){o=Xq(0,0,o|0,f|0)|0;f=D;p=ka;c[p>>2]=o;c[p+4>>2]=f;p=1;q=66982;N=75;break f}if(!(K&2048)){q=K&1;p=q;q=(q|0)==0?66982:66984;N=75}else{p=1;q=66983;N=75}break}case 117:{f=ka;p=0;q=66982;o=c[f>>2]|0;f=c[f+4>>2]|0;N=75;break}case 99:{a[U>>0]=c[ka>>2];f=U;x=0;v=66982;p=R;o=1;break}case 109:{o=dp(c[(zo()|0)>>2]|0)|0;N=81;break}case 115:{o=c[ka>>2]|0;o=o|0?o:66992;N=81;break}case 67:{c[O>>2]=c[ka>>2];c[V>>2]=0;c[ka>>2]=O;u=-1;p=O;N=85;break}case 83:{o=c[ka>>2]|0;if(!y){up(e,32,t,0,K);o=0;N=96}else{u=y;p=o;N=85}break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{r=+h[ka>>3];c[ia>>2]=0;h[j>>3]=r;if((c[j+4>>2]|0)>=0){o=K&1;if(!(K&2048)){J=o;I=(o|0)==0?67e3:67005}else{J=1;I=67002}}else{r=-r;J=1;I=66999}h[j>>3]=r;H=c[j+4>>2]&2146435072;do if(H>>>0<2146435072|(H|0)==2146435072&0<0){w=+wp(r,ia)*2.0;f=w!=0.0;if(f)c[ia>>2]=(c[ia>>2]|0)+-1;A=G|32;if((A|0)==97){s=G&32;x=(s|0)==0?I:I+9|0;v=J|2;o=12-y|0;do if(!(y>>>0>11|(o|0)==0)){r=8.0;do{o=o+-1|0;r=r*16.0}while((o|0)!=0);if((a[x>>0]|0)==45){r=-(r+(-w-r));break}else{r=w+r-r;break}}else r=w;while(0);f=c[ia>>2]|0;o=(f|0)<0?0-f|0:f;o=tp(o,((o|0)<0)<<31>>31,Y)|0;if((o|0)==(Y|0)){a[Z>>0]=48;o=Z}a[o+-1>>0]=(f>>31&2)+43;u=o+-2|0;a[u>>0]=G+15;q=(y|0)<1;p=(K&8|0)==0;o=ja;do{J=~~r;f=o+1|0;a[o>>0]=d[66966+J>>0]|s;r=(r-+(J|0))*16.0;do if((f-W|0)==1){if(p&(q&r==0.0)){o=f;break}a[f>>0]=46;o=o+2|0}else o=f;while(0)}while(r!=0.0);q=u;p=(y|0)!=0&(ba+o|0)<(y|0)?ca+y-q|0:aa-q+o|0;s=p+v|0;up(e,32,t,s,K);if(!(c[e>>2]&32))rp(x,v,e)|0;up(e,48,t,s,K^65536);f=o-W|0;if(!(c[e>>2]&32))rp(ja,f,e)|0;o=_-q|0;up(e,48,p-(f+o)|0,0,0);if(!(c[e>>2]&32))rp(u,o,e)|0;up(e,32,t,s,K^8192);o=(s|0)<(t|0)?t:s;break}o=(y|0)<0?6:y;if(f){f=(c[ia>>2]|0)+-28|0;c[ia>>2]=f;r=w*268435456.0}else{r=w;f=c[ia>>2]|0}H=(f|0)<0?ha:da;p=H;do{F=~~r>>>0;c[p>>2]=F;p=p+4|0;r=(r-+(F>>>0))*1.0e9}while(r!=0.0);if((f|0)>0){q=H;u=p;while(1){s=(f|0)>29?29:f;f=u+-4|0;do if(f>>>0>=q>>>0){p=0;do{E=mr(c[f>>2]|0,0,s|0)|0;E=_q(E|0,D|0,p|0,0)|0;F=D;C=nr(E|0,F|0,1e9,0)|0;c[f>>2]=C;p=ir(E|0,F|0,1e9,0)|0;f=f+-4|0}while(f>>>0>=q>>>0);if(!p)break;q=q+-4|0;c[q>>2]=p}while(0);p=u;while(1){if(p>>>0<=q>>>0)break;f=p+-4|0;if(!(c[f>>2]|0))p=f;else break}f=(c[ia>>2]|0)-s|0;c[ia>>2]=f;if((f|0)>0)u=p;else break}}else q=H;if((f|0)<0){y=((o+25|0)/9|0)+1|0;z=(A|0)==102;do{x=0-f|0;x=(x|0)>9?9:x;do if(q>>>0

>>0){s=(1<>>x;v=0;f=q;do{F=c[f>>2]|0;c[f>>2]=(F>>>x)+v;v=S(F&s,u)|0;f=f+4|0}while(f>>>0

>>0);f=(c[q>>2]|0)==0?q+4|0:q;if(!v){q=f;f=p;break}c[p>>2]=v;q=f;f=p+4|0}else{q=(c[q>>2]|0)==0?q+4|0:q;f=p}while(0);p=z?H:q;p=(f-p>>2|0)>(y|0)?p+(y<<2)|0:f;f=(c[ia>>2]|0)+x|0;c[ia>>2]=f}while((f|0)<0)}F=H;do if(q>>>0

>>0){f=(F-q>>2)*9|0;u=c[q>>2]|0;if(u>>>0<10)break;else s=10;do{s=s*10|0;f=f+1|0}while(u>>>0>=s>>>0)}else f=0;while(0);B=(A|0)==103;C=(o|0)!=0;s=o-((A|0)!=102?f:0)+((C&B)<<31>>31)|0;if((s|0)<(((p-F>>2)*9|0)+-9|0)){s=s+9216|0;v=H+4+(((s|0)/9|0)+-1024<<2)|0;s=((s|0)%9|0)+1|0;if((s|0)<9){u=10;do{u=u*10|0;s=s+1|0}while((s|0)!=9)}else u=10;y=c[v>>2]|0;z=(y>>>0)%(u>>>0)|0;s=(v+4|0)==(p|0);do if(s&(z|0)==0)s=v;else{w=(((y>>>0)/(u>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;x=(u|0)/2|0;if(z>>>0>>0)r=.5;else r=s&(z|0)==(x|0)?1.0:1.5;do if(J){if((a[I>>0]|0)!=45)break;r=-r;w=-w}while(0);s=y-z|0;c[v>>2]=s;if(!(w+r!=w)){s=v;break}E=s+u|0;c[v>>2]=E;if(E>>>0>999999999){s=v;while(1){f=s+-4|0;c[s>>2]=0;if(f>>>0>>0){q=q+-4|0;c[q>>2]=0}E=(c[f>>2]|0)+1|0;c[f>>2]=E;if(E>>>0>999999999)s=f;else{v=f;break}}}f=(F-q>>2)*9|0;u=c[q>>2]|0;if(u>>>0<10){s=v;break}else s=10;do{s=s*10|0;f=f+1|0}while(u>>>0>=s>>>0);s=v}while(0);E=s+4|0;p=p>>>0>E>>>0?E:p}z=0-f|0;E=p;while(1){if(E>>>0<=q>>>0){A=0;break}p=E+-4|0;if(!(c[p>>2]|0))E=p;else{A=1;break}}do if(B){o=(C&1^1)+o|0;if((o|0)>(f|0)&(f|0)>-5){v=G+-1|0;o=o+-1-f|0}else{v=G+-2|0;o=o+-1|0}p=K&8;if(p|0){x=p;break}do if(A){u=c[E+-4>>2]|0;if(!u){s=9;break}if(!((u>>>0)%10|0)){s=0;p=10}else{s=0;break}do{p=p*10|0;s=s+1|0}while(!((u>>>0)%(p>>>0)|0|0))}else s=9;while(0);p=((E-F>>2)*9|0)+-9|0;if((v|32|0)==102){x=p-s|0;x=(x|0)<0?0:x;o=(o|0)<(x|0)?o:x;x=0;break}else{x=p+f-s|0;x=(x|0)<0?0:x;o=(o|0)<(x|0)?o:x;x=0;break}}else{v=G;x=K&8}while(0);y=o|x;s=(y|0)!=0&1;u=(v|32|0)==102;if(u){z=0;f=(f|0)>0?f:0}else{p=(f|0)<0?z:f;p=tp(p,((p|0)<0)<<31>>31,Y)|0;if((_-p|0)<2)do{p=p+-1|0;a[p>>0]=48}while((_-p|0)<2);a[p+-1>>0]=(f>>31&2)+43;f=p+-2|0;a[f>>0]=v;z=f;f=_-f|0}B=J+1+o+s+f|0;up(e,32,t,B,K);if(!(c[e>>2]&32))rp(I,J,e)|0;up(e,48,t,B,K^65536);do if(u){q=q>>>0>H>>>0?H:q;p=q;do{f=tp(c[p>>2]|0,0,ea)|0;do if((p|0)==(q|0)){if((f|0)!=(ea|0))break;a[ga>>0]=48;f=ga}else{if(f>>>0<=ja>>>0)break;Yq(ja|0,48,f-W|0)|0;do f=f+-1|0;while(f>>>0>ja>>>0)}while(0);if(!(c[e>>2]&32))rp(f,fa-f|0,e)|0;p=p+4|0}while(p>>>0<=H>>>0);do if(y|0){if(c[e>>2]&32|0)break;rp(67034,1,e)|0}while(0);if((o|0)>0&p>>>0>>0)while(1){f=tp(c[p>>2]|0,0,ea)|0;if(f>>>0>ja>>>0){Yq(ja|0,48,f-W|0)|0;do f=f+-1|0;while(f>>>0>ja>>>0)}if(!(c[e>>2]&32))rp(f,(o|0)>9?9:o,e)|0;p=p+4|0;f=o+-9|0;if(!((o|0)>9&p>>>0>>0)){o=f;break}else o=f}up(e,48,o+9|0,9,0)}else{v=A?E:q+4|0;if((o|0)>-1){u=(x|0)==0;s=q;do{f=tp(c[s>>2]|0,0,ea)|0;if((f|0)==(ea|0)){a[ga>>0]=48;f=ga}do if((s|0)==(q|0)){p=f+1|0;if(!(c[e>>2]&32))rp(f,1,e)|0;if(u&(o|0)<1){f=p;break}if(c[e>>2]&32|0){f=p;break}rp(67034,1,e)|0;f=p}else{if(f>>>0<=ja>>>0)break;Yq(ja|0,48,f+X|0)|0;do f=f+-1|0;while(f>>>0>ja>>>0)}while(0);p=fa-f|0;if(!(c[e>>2]&32))rp(f,(o|0)>(p|0)?p:o,e)|0;o=o-p|0;s=s+4|0}while(s>>>0>>0&(o|0)>-1)}up(e,48,o+18|0,18,0);if(c[e>>2]&32|0)break;rp(z,_-z|0,e)|0}while(0);up(e,32,t,B,K^8192);o=(B|0)<(t|0)?t:B}else{f=(G&32|0)!=0;p=J+3|0;up(e,32,t,p,u);o=c[e>>2]|0;if(!(o&32)){rp(I,J,e)|0;o=c[e>>2]|0}if(!(o&32))rp(r!=r|0.0!=0.0?(f?67026:67030):f?67018:67022,3,e)|0;up(e,32,t,p,K^8192);o=(p|0)<(t|0)?t:p}while(0);t=M;f=L;continue a}default:{x=0;v=66982;p=R;o=y;u=K}}while(0);g:do if((N|0)==63){q=ka;p=c[q>>2]|0;q=c[q+4>>2]|0;s=u&32;if((p|0)==0&(q|0)==0){f=R;p=0;q=0}else{f=R;do{f=f+-1|0;a[f>>0]=d[66966+(p&15)>>0]|s;p=gr(p|0,q|0,4)|0;q=D}while(!((p|0)==0&(q|0)==0));q=ka;p=c[q>>2]|0;q=c[q+4>>2]|0}q=(o&8|0)==0|(p|0)==0&(q|0)==0;p=q?0:2;q=q?66982:66982+(u>>4)|0;s=v;N=76}else if((N|0)==75){f=tp(o,f,R)|0;s=y;o=K;N=76}else if((N|0)==81){N=0;K=No(o,0,y)|0;J=(K|0)==0;f=o;x=0;v=66982;p=J?o+y|0:K;o=J?y:K-o|0}else if((N|0)==85){N=0;s=p;o=0;f=0;while(1){q=c[s>>2]|0;if(!q)break;f=vp(P,q)|0;if((f|0)<0|f>>>0>(u-o|0)>>>0)break;o=f+o|0;if(u>>>0>o>>>0)s=s+4|0;else break}if((f|0)<0){n=-1;break a}up(e,32,t,o,K);if(!o){o=0;N=96}else{q=0;while(1){f=c[p>>2]|0;if(!f){N=96;break g}f=vp(P,f)|0;q=f+q|0;if((q|0)>(o|0)){N=96;break g}if(!(c[e>>2]&32))rp(P,f,e)|0;if(q>>>0>=o>>>0){N=96;break}else p=p+4|0}}}while(0);if((N|0)==96){N=0;up(e,32,t,o,K^8192);o=(t|0)>(o|0)?t:o;t=M;f=L;continue}if((N|0)==76){N=0;u=(s|0)>-1?o&-65537:o;o=ka;o=(c[o>>2]|0)!=0|(c[o+4>>2]|0)!=0;if((s|0)!=0|o){o=(o&1^1)+(T-f)|0;x=p;v=q;p=R;o=(s|0)>(o|0)?s:o}else{f=R;x=p;v=q;p=R;o=0}}s=p-f|0;p=(o|0)<(s|0)?s:o;q=p+x|0;o=(t|0)<(q|0)?q:t;up(e,32,o,q,u);if(!(c[e>>2]&32))rp(v,x,e)|0;up(e,48,o,q,u^65536);up(e,48,p,s,0);if(!(c[e>>2]&32))rp(f,s,e)|0;up(e,32,o,q,u^8192);t=M;f=L}h:do if((N|0)==243)if(!e)if(!t)n=0;else{n=1;while(1){o=c[k+(n<<2)>>2]|0;if(!o)break;sp(i+(n<<3)|0,o,g);n=n+1|0;if((n|0)>=10){n=1;break h}}while(1){if(c[k+(n<<2)>>2]|0){n=-1;break h}n=n+1|0;if((n|0)>=10){n=1;break}}}while(0);l=la;return n|0}function pp(a){a=a|0;return 0}function qp(a){a=a|0;return}function rp(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=e+16|0;g=c[f>>2]|0;if(!g)if(!(zp(e)|0)){g=c[f>>2]|0;h=5}else f=0;else h=5;a:do if((h|0)==5){j=e+20|0;i=c[j>>2]|0;f=i;if((g-i|0)>>>0>>0){f=pb[c[e+36>>2]&63](e,b,d)|0;break}b:do if((a[e+75>>0]|0)>-1){i=d;while(1){if(!i){h=0;g=b;break b}g=i+-1|0;if((a[b+g>>0]|0)==10)break;else i=g}f=pb[c[e+36>>2]&63](e,b,i)|0;if(f>>>0>>0)break a;h=i;g=b+i|0;d=d-i|0;f=c[j>>2]|0}else{h=0;g=b}while(0);cr(f|0,g|0,d|0)|0;c[j>>2]=(c[j>>2]|0)+d;f=h+d|0}while(0);return f|0}function sp(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0;a:do if(b>>>0<=20)do switch(b|0){case 9:{e=(c[d>>2]|0)+(4-1)&~(4-1);b=c[e>>2]|0;c[d>>2]=e+4;c[a>>2]=b;break a}case 10:{e=(c[d>>2]|0)+(4-1)&~(4-1);b=c[e>>2]|0;c[d>>2]=e+4;e=a;c[e>>2]=b;c[e+4>>2]=((b|0)<0)<<31>>31;break a}case 11:{e=(c[d>>2]|0)+(4-1)&~(4-1);b=c[e>>2]|0;c[d>>2]=e+4;e=a;c[e>>2]=b;c[e+4>>2]=0;break a}case 12:{e=(c[d>>2]|0)+(8-1)&~(8-1);b=e;f=c[b>>2]|0;b=c[b+4>>2]|0;c[d>>2]=e+8;e=a;c[e>>2]=f;c[e+4>>2]=b;break a}case 13:{f=(c[d>>2]|0)+(4-1)&~(4-1);e=c[f>>2]|0;c[d>>2]=f+4;e=(e&65535)<<16>>16;f=a;c[f>>2]=e;c[f+4>>2]=((e|0)<0)<<31>>31;break a}case 14:{f=(c[d>>2]|0)+(4-1)&~(4-1);e=c[f>>2]|0;c[d>>2]=f+4;f=a;c[f>>2]=e&65535;c[f+4>>2]=0;break a}case 15:{f=(c[d>>2]|0)+(4-1)&~(4-1);e=c[f>>2]|0;c[d>>2]=f+4;e=(e&255)<<24>>24;f=a;c[f>>2]=e;c[f+4>>2]=((e|0)<0)<<31>>31;break a}case 16:{f=(c[d>>2]|0)+(4-1)&~(4-1);e=c[f>>2]|0;c[d>>2]=f+4;f=a;c[f>>2]=e&255;c[f+4>>2]=0;break a}case 17:{f=(c[d>>2]|0)+(8-1)&~(8-1);g=+h[f>>3];c[d>>2]=f+8;h[a>>3]=g;break a}case 18:{f=(c[d>>2]|0)+(8-1)&~(8-1);g=+h[f>>3];c[d>>2]=f+8;h[a>>3]=g;break a}default:break a}while(0);while(0);return}function tp(b,c,d){b=b|0;c=c|0;d=d|0;var e=0;if(c>>>0>0|(c|0)==0&b>>>0>4294967295){while(1){e=nr(b|0,c|0,10,0)|0;d=d+-1|0;a[d>>0]=e|48;e=b;b=ir(b|0,c|0,10,0)|0;if(!(c>>>0>9|(c|0)==9&e>>>0>4294967295))break;else c=D}c=b}else c=b;if(c)while(1){d=d+-1|0;a[d>>0]=(c>>>0)%10|0|48;if(c>>>0<10)break;else c=(c>>>0)/10|0}return d|0}function up(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;i=l;l=l+256|0;if((l|0)>=(m|0))$(256);h=i;do if((d|0)>(e|0)&(f&73728|0)==0){f=d-e|0;Yq(h|0,b|0,(f>>>0>256?256:f)|0)|0;b=c[a>>2]|0;g=(b&32|0)==0;if(f>>>0>255){d=d-e|0;do{if(g){rp(h,256,a)|0;b=c[a>>2]|0}f=f+-256|0;g=(b&32|0)==0}while(f>>>0>255);if(g)f=d&255;else break}else if(!g)break;rp(h,f,a)|0}while(0);l=i;return}function vp(a,b){a=a|0;b=b|0;if(!a)a=0;else a=yp(a,b,0)|0;return a|0}function wp(a,b){a=+a;b=b|0;return +(+xp(a,b))}function xp(a,b){a=+a;b=b|0;var d=0,e=0,f=0;h[j>>3]=a;d=c[j>>2]|0;e=c[j+4>>2]|0;f=gr(d|0,e|0,52)|0;switch(f&2047){case 0:{if(a!=0.0){a=+xp(a*18446744073709551616.0,b);d=(c[b>>2]|0)+-64|0}else d=0;c[b>>2]=d;break}case 2047:break;default:{c[b>>2]=(f&2047)+-1022;c[j>>2]=d;c[j+4>>2]=e&-2146435073|1071644672;a=+h[j>>3]}}return +a}function yp(b,d,e){b=b|0;d=d|0;e=e|0;do if(b){if(d>>>0<128){a[b>>0]=d;b=1;break}if(!(c[c[(Ao()|0)+188>>2]>>2]|0))if((d&-128|0)==57216){a[b>>0]=d;b=1;break}else{c[(zo()|0)>>2]=84;b=-1;break}if(d>>>0<2048){a[b>>0]=d>>>6|192;a[b+1>>0]=d&63|128;b=2;break}if(d>>>0<55296|(d&-8192|0)==57344){a[b>>0]=d>>>12|224;a[b+1>>0]=d>>>6&63|128;a[b+2>>0]=d&63|128;b=3;break}if((d+-65536|0)>>>0<1048576){a[b>>0]=d>>>18|240;a[b+1>>0]=d>>>12&63|128;a[b+2>>0]=d>>>6&63|128;a[b+3>>0]=d&63|128;b=4;break}else{c[(zo()|0)>>2]=84;b=-1;break}}else b=1;while(0);return b|0}function zp(b){b=b|0;var d=0,e=0;d=b+74|0;e=a[d>>0]|0;a[d>>0]=e+255|e;d=c[b>>2]|0;if(!(d&8)){c[b+8>>2]=0;c[b+4>>2]=0;e=c[b+44>>2]|0;c[b+28>>2]=e;c[b+20>>2]=e;c[b+16>>2]=e+(c[b+48>>2]|0);b=0}else{c[b>>2]=d|32;b=-1}return b|0}function Ap(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=a+20|0;f=c[e>>2]|0;a=(c[a+16>>2]|0)-f|0;a=a>>>0>d>>>0?d:a;cr(f|0,b|0,a|0)|0;c[e>>2]=(c[e>>2]|0)+a;return d|0}function Bp(a){a=a|0;var b=0;b=(cp(a)|0)==0;return (b?a:a&95)|0}function Cp(a){a=a|0;return (_o(a)|0)!=(a|0)|0}function Dp(a){a=a|0;if(a>>>0>=255)if((a+-57344|0)>>>0<8185|(a>>>0<8232|(a+-8234|0)>>>0<47062))a=1;else return ((a+-65532|0)>>>0>1048579|(a&65534|0)==65534)&1^1|0;else a=(a+1&127)>>>0>32&1;return a|0}function Ep(a,b){a=a|0;b=b|0;do switch(b|0){case 1:{a=Fp(a)|0;break}case 2:{a=bp(a)|0;break}case 3:{a=Wo(a)|0;break}case 4:{a=Gp(a)|0;break}case 5:{a=Hp(a)|0;break}case 6:{a=Ip(a)|0;break}case 7:{a=Cp(a)|0;break}case 8:{a=Dp(a)|0;break}case 9:{a=Jp(a)|0;break}case 10:{a=hp(a)|0;break}case 11:{a=Kp(a)|0;break}case 12:{a=Lp(a)|0;break}default:a=0}while(0);return a|0}function Fp(a){a=a|0;if(!(Hp(a)|0))a=(bp(a)|0)!=0;else a=1;return a&1|0}function Gp(a){a=a|0;if((a&-2|0)==8232|(a>>>0<32|(a+-127|0)>>>0<33))a=1;else a=(a+-65529|0)>>>0<3;return a&1|0}function Hp(a){a=a|0;return (a+-48|0)>>>0<10|0}function Ip(a){a=a|0;if(!(hp(a)|0))a=(Dp(a)|0)!=0;else a=0;return a&1|0}function Jp(a){a=a|0;if(a>>>0<131072)a=(d[67036+((d[67036+(a>>>8)>>0]|0)<<5|a>>>3&31)>>0]|0)>>>(a&7)&1;else a=0;return a|0}function Kp(a){a=a|0;return ($o(a)|0)!=(a|0)|0}function Lp(a){a=a|0;return ((a+-48|0)>>>0<10|((a|32)+-97|0)>>>0<6)&1|0}function Mp(a,b){a=a|0;b=b|0;Np(a,b)|0;return a|0}function Np(b,d){b=b|0;d=d|0;var e=0,f=0;e=d;a:do if(!((e^b)&3)){if(e&3)do{e=a[d>>0]|0;a[b>>0]=e;if(!(e<<24>>24))break a;d=d+1|0;b=b+1|0}while((d&3|0)!=0);e=c[d>>2]|0;if(!((e&-2139062144^-2139062144)&e+-16843009)){f=b;while(1){d=d+4|0;b=f+4|0;c[f>>2]=e;e=c[d>>2]|0;if((e&-2139062144^-2139062144)&e+-16843009|0)break;else f=b}}f=8}else f=8;while(0);if((f|0)==8){f=a[d>>0]|0;a[b>>0]=f;if(f<<24>>24)do{d=d+1|0;b=b+1|0;f=a[d>>0]|0;a[b>>0]=f}while(f<<24>>24!=0)}return b|0}function Op(b,c){b=b|0;c=c|0;var e=0,f=0,g=0;e=a[b>>0]|0;a:do if(!(e<<24>>24))e=0;else{g=e&255;while(1){f=a[c>>0]|0;if(!(f<<24>>24))break a;if(e<<24>>24!=f<<24>>24?(g=Yo(g)|0,(g|0)!=(Yo(f&255)|0)):0)break a;b=b+1|0;c=c+1|0;e=a[b>>0]|0;if(!(e<<24>>24)){e=0;break}else g=e&255}}while(0);g=Yo(e&255)|0;return g-(Yo(d[c>>0]|0)|0)|0}function Pp(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e;c[f>>2]=d;d=Qp(a,b,f)|0;l=e;return d|0}function Qp(a,b,c){a=a|0;b=b|0;c=c|0;return mp(a,2147483647,b,c)|0}function Rp(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e;c[f>>2]=d;d=np(a,b,f)|0;l=e;return d|0}function Sp(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;if((c[f+76>>2]|0)>-1)m=pp(f)|0;else m=0;g=e+-1|0;if((e|0)<2){n=f+74|0;l=a[n>>0]|0;a[n>>0]=l+255|l;if(m|0)qp(f);if(!g)a[b>>0]=0;else b=0}else{a:do if(g){k=f+4|0;l=f+8|0;e=b;while(1){h=c[k>>2]|0;o=h;p=(c[l>>2]|0)-o|0;i=No(h,10,p)|0;j=(i|0)==0;i=j?p:1-o+i|0;i=i>>>0>>0?i:g;cr(e|0,h|0,i|0)|0;h=(c[k>>2]|0)+i|0;c[k>>2]=h;e=e+i|0;i=g-i|0;if(!(j&(i|0)!=0)){n=17;break a}if(h>>>0>=(c[l>>2]|0)>>>0){g=So(f)|0;if((g|0)<0)break;else j=g}else{c[k>>2]=h+1;j=d[h>>0]|0}g=i+-1|0;h=e+1|0;a[e>>0]=j;if(!((g|0)!=0&(j&255|0)!=10)){e=h;n=17;break a}else e=h}if((e|0)!=(b|0)?(c[f>>2]&16|0)!=0:0)n=17;else b=0}else{e=b;n=17}while(0);if((n|0)==17)if(!b)b=0;else a[e>>0]=0;if(m)qp(f)}return b|0}function Tp(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0;a:do if(!d)b=0;else{while(1){e=a[b>>0]|0;f=a[c>>0]|0;if(e<<24>>24!=f<<24>>24)break;d=d+-1|0;if(!d){b=0;break a}else{b=b+1|0;c=c+1|0}}b=(e&255)-(f&255)|0}while(0);return b|0}function Up(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;if((l|0)>=(m|0))$(16);d=b;c[d>>2]=Co(a)|0;a=cb(6,d|0)|0;a=yo((a|0)==-4?0:a)|0;l=b;return a|0}function Vp(a,b,c){a=a|0;b=b|0;c=c|0;Wp(a,b,c)|0;return a|0}function Wp(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;g=d;do if(!((g^b)&3)){f=(e|0)!=0;a:do if(f&(g&3|0)!=0)while(1){g=a[d>>0]|0;a[b>>0]=g;if(!(g<<24>>24))break a;e=e+-1|0;d=d+1|0;b=b+1|0;f=(e|0)!=0;if(!(f&(d&3|0)!=0)){h=5;break}}else h=5;while(0);if((h|0)==5)if(!f){e=0;break}if(a[d>>0]|0){b:do if(e>>>0>3){f=d;while(1){d=c[f>>2]|0;if((d&-2139062144^-2139062144)&d+-16843009|0){d=f;break b}c[b>>2]=d;e=e+-4|0;d=f+4|0;b=b+4|0;if(e>>>0>3)f=d;else break}}while(0);h=11}}else h=11;while(0);c:do if((h|0)==11)if(!e)e=0;else while(1){h=a[d>>0]|0;a[b>>0]=h;if(!(h<<24>>24))break c;e=e+-1|0;b=b+1|0;if(!e){e=0;break}else d=d+1|0}while(0);Yq(b|0,0,e|0)|0;return b|0}function Xp(a){a=a|0;return er(a|0)|0}function Yp(a){a=a|0;return er(a|0)|0}function Zp(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;j=l;l=l+16|0;if((l|0)>=(m|0))$(16);g=j;a:do if(!e)b=0;else{do if(f|0){i=(b|0)==0?g:b;b=a[e>>0]|0;if(b<<24>>24>-1){c[i>>2]=b&255;b=b<<24>>24!=0&1;break a}h=(c[c[(Ao()|0)+188>>2]>>2]|0)==0;b=a[e>>0]|0;if(h){c[i>>2]=b<<24>>24&57343;b=1;break a}b=(b&255)+-194|0;if(b>>>0<=50){g=e+1|0;h=c[15868+(b<<2)>>2]|0;if(f>>>0<4?h&-2147483648>>>((f*6|0)+-6|0)|0:0)break;b=d[g>>0]|0;f=b>>>3;if((f+-16|f+(h>>26))>>>0<=7){b=b+-128|h<<6;if((b|0)>=0){c[i>>2]=b;b=2;break a}g=(d[e+2>>0]|0)+-128|0;if(g>>>0<=63){g=g|b<<6;if((g|0)>=0){c[i>>2]=g;b=3;break a}b=(d[e+3>>0]|0)+-128|0;if(b>>>0<=63){c[i>>2]=b|g<<6;b=4;break a}}}}}while(0);c[(zo()|0)>>2]=84;b=-1}while(0);l=j;return b|0}function _p(b){b=b|0;var c=0,d=0,e=0;d=(Ko(b,43)|0)==0;c=a[b>>0]|0;d=d?c<<24>>24!=114&1:2;e=(Ko(b,120)|0)==0;d=e?d:d|128;b=(Ko(b,101)|0)==0;b=b?d:d|524288;b=c<<24>>24==114?b:b|64;b=c<<24>>24==119?b|512:b;return (c<<24>>24==97?b|1024:b)|0}function $p(a){a=a|0;var b=0,d=0;do if(a){if((c[a+76>>2]|0)<=-1){b=hq(a)|0;break}d=(pp(a)|0)==0;b=hq(a)|0;if(!d)qp(a)}else{if(!(c[3934]|0))b=0;else b=$p(c[3934]|0)|0;a=c[(dq()|0)>>2]|0;if(a)do{if((c[a+76>>2]|0)>-1)d=pp(a)|0;else d=0;if((c[a+20>>2]|0)>>>0>(c[a+28>>2]|0)>>>0)b=hq(a)|0|b;if(d|0)qp(a);a=c[a+56>>2]|0}while((a|0)!=0);eq()}while(0);return b|0}function aq(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=l;l=l+48|0;if((l|0)>=(m|0))$(48);h=i+32|0;g=i+16|0;e=i;if(No(70204,a[d>>0]|0,4)|0){f=_p(d)|0;c[e>>2]=b;c[e+4>>2]=f|32768;c[e+8>>2]=438;e=yo(db(5,e|0)|0)|0;if((e|0)>=0){if(f&524288|0){c[g>>2]=e;c[g+4>>2]=2;c[g+8>>2]=1;wa(221,g|0)|0}b=fq(e,d)|0;if(!b){c[h>>2]=e;cb(6,h|0)|0;b=0}}else b=0}else{c[(zo()|0)>>2]=22;b=0}l=i;return b|0}function bq(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;if((c[a+76>>2]|0)>-1)f=pp(a)|0;else f=0;cq(a);g=(c[a>>2]&1|0)!=0;if(!g){e=dq()|0;d=c[a+52>>2]|0;b=a+56|0;if(d|0)c[d+56>>2]=c[b>>2];b=c[b>>2]|0;if(b|0)c[b+52>>2]=d;if((c[e>>2]|0)==(a|0))c[e>>2]=b;eq()}b=$p(a)|0;b=tb[c[a+12>>2]&15](a)|0|b;d=c[a+92>>2]|0;if(d|0)Pq(d);if(g){if(f|0)qp(a)}else Pq(a);return b|0}function cq(a){a=a|0;var b=0,d=0;do if(c[a+68>>2]|0){b=c[a+116>>2]|0;d=b;a=a+112|0;if(b|0)c[b+112>>2]=c[a>>2];a=c[a>>2]|0;if(!a){c[(Ao()|0)+232>>2]=d;break}else{c[a+116>>2]=d;break}}while(0);return}function dq(){bb(70840);return 70848}function eq(){_a(70840);return}function fq(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0;p=l;l=l+64|0;if((l|0)>=(m|0))$(64);o=p+40|0;j=p+24|0;i=p+16|0;f=p;k=p+56|0;e=a[d>>0]|0;if(No(70204,e<<24>>24,4)|0){n=Oq(1156)|0;if(!n)e=0;else{g=n;h=g+124|0;do{c[g>>2]=0;g=g+4|0}while((g|0)<(h|0));if(!(Ko(d,43)|0))c[n>>2]=e<<24>>24==114?8:4;if(Ko(d,101)|0){c[f>>2]=b;c[f+4>>2]=2;c[f+8>>2]=1;wa(221,f|0)|0;e=a[d>>0]|0}if(e<<24>>24==97){c[i>>2]=b;c[i+4>>2]=3;e=wa(221,i|0)|0;if(!(e&1024)){c[j>>2]=b;c[j+4>>2]=4;c[j+8>>2]=e|1024;wa(221,j|0)|0}d=c[n>>2]|128;c[n>>2]=d}else d=c[n>>2]|0;c[n+60>>2]=b;c[n+44>>2]=n+132;c[n+48>>2]=1024;e=n+75|0;a[e>>0]=-1;if((d&8|0)==0?(c[o>>2]=b,c[o+4>>2]=21523,c[o+8>>2]=k,(Za(54,o|0)|0)==0):0)a[e>>0]=10;c[n+32>>2]=35;c[n+36>>2]=25;c[n+40>>2]=24;c[n+12>>2]=10;if(!(c[17695]|0))c[n+76>>2]=-1;e=gq(n)|0}}else{c[(zo()|0)>>2]=22;e=0}l=p;return e|0}function gq(a){a=a|0;var b=0,d=0;b=dq()|0;c[a+56>>2]=c[b>>2];d=c[b>>2]|0;if(d|0)c[d+52>>2]=a;c[b>>2]=a;eq();return a|0}function hq(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=a+20|0;h=a+28|0;if((c[b>>2]|0)>>>0>(c[h>>2]|0)>>>0?(pb[c[a+36>>2]&63](a,0,0)|0,(c[b>>2]|0)==0):0)a=-1;else{d=a+4|0;e=c[d>>2]|0;f=a+8|0;g=c[f>>2]|0;if(e>>>0>>0)pb[c[a+40>>2]&63](a,e-g|0,1)|0;c[a+16>>2]=0;c[h>>2]=0;c[b>>2]=0;c[f>>2]=0;c[d>>2]=0;a=0}return a|0}function iq(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=S(d,b)|0;d=(b|0)==0?0:d;if((c[e+76>>2]|0)>-1){g=(pp(e)|0)==0;a=rp(a,f,e)|0;if(!g)qp(e)}else a=rp(a,f,e)|0;if((a|0)!=(f|0))d=(a>>>0)/(b>>>0)|0;return d|0}function jq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;t=l;l=l+192|0;if((l|0)>=(m|0))$(192);i=t+152|0;h=t+136|0;s=t+120|0;r=t+104|0;q=t+96|0;n=t+80|0;k=t+64|0;f=t+48|0;o=t+32|0;g=t+16|0;e=t;u=t+176|0;j=t+168|0;c[u>>2]=d;d=(c[u>>2]|0)+(4-1)&~(4-1);p=c[d>>2]|0;c[u>>2]=d+4;p=(b|0)==4?p|32768:p;a:do switch(b|0){case 14:{c[e>>2]=a;c[e+4>>2]=14;c[e+8>>2]=p;d=yo(wa(221,e|0)|0)|0;break}case 9:{c[g>>2]=a;c[g+4>>2]=16;c[g+8>>2]=j;d=wa(221,g|0)|0;switch(d|0){case -22:{c[o>>2]=a;c[o+4>>2]=9;c[o+8>>2]=p;d=wa(221,o|0)|0;break}case 0:{d=c[j+4>>2]|0;d=(c[j>>2]|0)==2?0-d|0:d;break}default:d=yo(d)|0}break}case 1030:{c[f>>2]=a;c[f+4>>2]=1030;c[f+8>>2]=p;d=wa(221,f|0)|0;if((d|0)!=-22){if((d|0)>-1){c[k>>2]=d;c[k+4>>2]=2;c[k+8>>2]=1;wa(221,k|0)|0}d=yo(d)|0;break a}c[n>>2]=a;c[n+4>>2]=1030;c[n+8>>2]=0;d=wa(221,n|0)|0;if((d|0)==-22){c[r>>2]=a;c[r+4>>2]=0;c[r+8>>2]=p;d=wa(221,r|0)|0;if((d|0)>-1){c[s>>2]=d;c[s+4>>2]=2;c[s+8>>2]=1;wa(221,s|0)|0}d=yo(d)|0;break a}else{if((d|0)>-1){c[q>>2]=d;cb(6,q|0)|0}d=yo(-22)|0;break a}}case 15:case 16:case 12:case 13:{c[h>>2]=a;c[h+4>>2]=b;c[h+8>>2]=p;d=yo(wa(221,h|0)|0)|0;break}default:{c[i>>2]=a;c[i+4>>2]=b;c[i+8>>2]=p;d=yo(wa(221,i|0)|0)|0}}while(0);l=t;return d|0}function kq(a){a=a|0;var b=0;if((c[a+76>>2]|0)>-1){b=(pp(a)|0)==0;a=(c[a>>2]|0)>>>4&1}else a=(c[a>>2]|0)>>>4&1;return a|0}function lq(b,c){b=b|0;c=c|0;var d=0,e=0,f=0;d=b;e=70208;f=d+15|0;do{a[d>>0]=a[e>>0]|0;d=d+1|0;e=e+1|0}while((d|0)<(f|0));if(!c){a[b+14>>0]=48;a[b+15>>0]=0}else{e=c;d=14;while(1){d=d+1|0;if(e>>>0<10)break;else e=(e>>>0)/10|0}a[b+d>>0]=0;while(1){d=d+-1|0;a[b+d>>0]=(c>>>0)%10|0|48;if(c>>>0<10)break;else c=(c>>>0)/10|0}}return}function mq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=l;l=l+48|0;if((l|0)>=(m|0))$(48);f=g+40|0;e=g+8|0;d=g;c[d>>2]=a;c[d+4>>2]=b;d=Ka(197,d|0)|0;if((d|0)==-9?(c[e>>2]=a,c[e+4>>2]=1,(wa(221,e|0)|0)>=0):0){lq(e,a);c[f>>2]=e;c[f+4>>2]=b;b=yo(La(195,f|0)|0)|0}else b=yo(d)|0;l=g;return b|0}function nq(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=l;l=l+32|0;if((l|0)>=(m|0))$(32);h=g;c[h>>2]=a;c[h+4>>2]=b;c[h+8>>2]=d;c[h+12>>2]=e;c[h+16>>2]=f;f=yo(lb(142,h|0)|0)|0;l=g;return f|0}function oq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e;c[f>>2]=a;c[f+4>>2]=b;c[f+8>>2]=d;d=yo(eb(4,f|0)|0)|0;l=e;return d|0}function pq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;if((l|0)>=(m|0))$(16);f=e;c[f>>2]=a;c[f+4>>2]=b;c[f+8>>2]=d;d=yo(ab(3,f|0)|0)|0;l=e;return d|0}function qq(){var a=0,b=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=Ba(20,a|0)|0;l=a;return b|0}function rq(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=l;l=l+32|0;if((l|0)>=(m|0))$(32);g=f;c[g>>2]=b;c[g+4>>2]=d;c[g+8>>2]=e;c[g+12>>2]=a;a=g+16|0;c[a>>2]=-1;tq(6,g);a=c[a>>2]|0;if(a)if((a|0)>0){c[(zo()|0)>>2]=a;a=-1}else a=-1;else a=0;l=f;return a|0}function sq(a){a=a|0;a=a+16|0;if((c[a>>2]|0)<=0)c[a>>2]=1;return}function tq(a,b){a=a|0;b=b|0;rb[a&7](b);return}function uq(){var a=0,b=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=Na(199,a|0)|0;l=a;return b|0}function vq(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d;c[e>>2]=a;c[e+4>>2]=b;b=yo(Ya(33,e|0)|0)|0;l=d;return b|0}function wq(){var a=0,b=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=hb(201,a|0)|0;l=a;return b|0}function xq(a){a=a|0;return rq(213,a,0,0)|0}function yq(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d;c[e>>2]=a;c[e+4>>2]=0;c[e+8>>2]=b;c[e+12>>2]=((b|0)<0)<<31>>31;b=yo(Ma(194,e|0)|0)|0;l=d;return b|0}function zq(){var a=0,b=0;a=l;l=l+16|0;if((l|0)>=(m|0))$(16);b=ya(64,a|0)|0;l=a;return b|0}function Aq(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;j=l;l=l+32|0;if((l|0)>=(m|0))$(32);i=j;h=((g|0)<0)<<31>>31;do if((g&4095|0)==0&(h&-4096|0)==0){if(b>>>0>2147483646){c[(zo()|0)>>2]=12;a=-1;break}if(e&16|0)Vo();h=gr(g|0,h|0,12)|0;c[i>>2]=a;c[i+4>>2]=b;c[i+8>>2]=d;c[i+12>>2]=e;c[i+16>>2]=f;c[i+20>>2]=h;a=yo(Ja(192,i|0)|0)|0}else{c[(zo()|0)>>2]=22;a=-1}while(0);l=j;return a|0}function Bq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;h=l;l=l+48|0;if((l|0)>=(m|0))$(48);g=h+16|0;f=h;e=h+32|0;if(!(b&4194368))e=0;else{c[e>>2]=d;i=(c[e>>2]|0)+(4-1)&~(4-1);d=c[i>>2]|0;c[e>>2]=i+4;e=d}c[f>>2]=a;c[f+4>>2]=b|32768;c[f+8>>2]=e;e=db(5,f|0)|0;if(!((b&524288|0)==0|(e|0)<0)){c[g>>2]=e;c[g+4>>2]=2;c[g+8>>2]=1;wa(221,g|0)|0}i=yo(e)|0;l=h;return i|0}function Cq(a){a=a|0;bb(70852);Dq(a);_a(70852);return}function Dq(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;f=c[4071]|0;if(!f)c[c[4072]>>2]=a;else{c[4073]=(f|0)==31|(f|0)==7?3:1;c[17715]=0;if((f|0)>0){b=c[4072]|0;e=0;d=0;do{g=kr(a|0,d|0,1284865837,1481765933)|0;a=_q(g|0,D|0,1,0)|0;d=D;c[b+(e<<2)>>2]=d;e=e+1|0}while((e|0)<(f|0))}else b=c[4072]|0;c[b>>2]=c[b>>2]|1}return}function Eq(){var a=0,b=0,d=0,e=0,f=0;bb(70852);a=c[4071]|0;if(!a){b=c[4072]|0;a=(S(c[b>>2]|0,1103515245)|0)+12345&2147483647;c[b>>2]=a}else{d=c[17715]|0;b=c[4072]|0;e=c[4073]|0;f=b+(e<<2)|0;b=(c[f>>2]|0)+(c[b+(d<<2)>>2]|0)|0;c[f>>2]=b;e=e+1|0;c[4073]=(e|0)==(a|0)?0:e;d=d+1|0;c[17715]=(d|0)==(a|0)?0:d;a=b>>>1}_a(70852);return a|0}function Fq(b){b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;while(1){e=a[b>>0]|0;c=e<<24>>24;f=b+1|0;if(!(Lo(c)|0))break;else b=f}switch(c|0){case 45:{b=1;g=5;break}case 43:{b=0;g=5;break}default:{h=0;d=b;b=e}}if((g|0)==5){h=b;d=f;b=a[f>>0]|0}c=(b<<24>>24)+-48|0;if(c>>>0<10){b=0;do{d=d+1|0;b=(b*10|0)-c|0;c=(a[d>>0]|0)+-48|0}while(c>>>0<10)}else b=0;return (h|0?b:0-b|0)|0}function Gq(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;if((l|0)>=(m|0))$(16);e=d;c[e>>2]=a;c[e+4>>2]=b;b=yo(Wa(77,e|0)|0)|0;l=d;return b|0}function Hq(a,b){a=a|0;b=b|0;if(!a)b=Qq(1,24)|0;else{c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0}return b|0}function Iq(a){a=a|0;var b=0,d=0;b=c[a>>2]|0;if(b|0)do{Pq(c[b>>2]|0);d=b;b=c[b+4>>2]|0;Pq(d)}while((b|0)!=0);Pq(a);return}function Jq(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;h=a+16|0;a:do if(!(c[h>>2]|0)){k=a+12|0;g=c[k>>2]|0;do if(g>>>0>>0){if(b|0)if(!d){c[h>>2]=1;b=0;break a}else{i=a+8|0;c[i>>2]=d;c[k>>2]=1024;h=d;b=d;g=1024;break}g=f<<3;g=g>>>0>1024?g:1024;i=Oq(8)|0;if(!i){c[h>>2]=1;b=0;break a}b=Oq(g)|0;c[i>>2]=b;j=b;if(!b){Pq(i);c[h>>2]=1;b=0;break a}c[i+4>>2]=0;d=a+4|0;h=c[d>>2]|0;if(h|0)c[h+4>>2]=i;if(!(c[a>>2]|0))c[a>>2]=i;c[d>>2]=i;i=a+8|0;c[i>>2]=j;c[k>>2]=g;h=j}else{i=a+8|0;b=c[i>>2]|0;h=b}while(0);d=h+f&3;d=((d|0)==0?0:4-d|0)+f|0;c[i>>2]=b+d;c[k>>2]=g-d;if(e)Yq(b|0,0,d|0)|0}else b=0;while(0);return b|0}function Kq(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0;Z=l;l=l+16|0;if((l|0)>=(m|0))$(16);U=Z;X=c[a+4>>2]|0;Y=X+56|0;W=(c[Y>>2]&8|0)==0?d:0;R=X+40|0;a=c[R>>2]|0;if((a|0)>0&(W|0)!=0){a=Oq(a<<2)|0;if(!a)a=12;else{V=a;T=3}}else{V=0;T=3}if((T|0)==3){if(!(c[X+60>>2]|0)){c[U>>2]=0;i=f&1;Q=f&2;h=c[Y>>2]&4;if(!V)O=0;else O=c[R>>2]|0;P=O<<2;g=c[X+52>>2]|0;f=g<<3;d=f+8|0;a=P+12+f+(d+(S(P,g)|0)<<1)|0;R=Oq(a)|0;if(!R){a=12;d=0}else{Yq(R|0,0,a|0)|0;a=R+P|0;j=a&3;j=a+((j|0)==0?0:4-j|0)|0;a=j+d|0;k=a&3;k=a+((k|0)==0?0:4-k|0)|0;a=k+d|0;N=a&3;N=a+((N|0)==0?0:4-N|0)|0;a=N+f|0;d=a&3;if((g|0)>0){a=a+((d|0)==0?0:4-d|0)|0;d=0;while(1){c[k+(d<<3)+4>>2]=a;a=a+P|0;c[j+(d<<3)+4>>2]=a;d=d+1|0;if((d|0)==(g|0)){a=0;break}else a=a+P|0}do{c[N+(a<<3)>>2]=-1;a=a+1|0}while((a|0)!=(g|0))}a=Zp(U,b,4)|0;if((a|0)<1)if((a|0)<0){a=1;d=0}else{a=1;T=201}else T=201;a:do if((T|0)==201){M=X+8|0;F=(h|0)!=0;G=(O|0)>0;H=X+12|0;I=X+44|0;J=X+32|0;K=X+36|0;L=(O|0)==0;E=(i|0)==0;D=(O|0)<1;g=0;w=b+a|0;v=0;h=0;d=-1;f=j;B=R;z=j;x=k;while(1){if((d|0)<0){i=c[M>>2]|0;j=i+8|0;b:do if(c[j>>2]|0){q=(v|0)!=0;r=(g|0)==95;s=(v|0)==0;u=F&(g|0)==10;t=E&(v|0)<1;while(1){c:while(1){p=i+12|0;if((c[N+(c[p>>2]<<3)>>2]|0)>=(v|0))break;o=i+20|0;k=c[o>>2]|0;if(!k){T=236;break}d:do if(u|(t|(k&1|0)==0)){if(k&2|0?(b=c[U>>2]|0,!((b|Q|0)==0|F&(b|0)==10)):0)break;do if(k&16|0){if(r)break d;if(Fp(g)|0)break d;k=c[U>>2]|0;if((k|0)==95)break;if(!(Fp(k)|0))break d}while(0);k=c[o>>2]|0;if(k&32){if(r){k=c[U>>2]|0;if((k|0)==95)break}else{b=(Fp(g)|0)==0;k=c[U>>2]|0;if(b|(k|0)==95)break}if(Fp(k)|0)break;k=c[o>>2]|0}n=c[U>>2]|0;do if((n|0)!=0&(q&(k&64|0)!=0)){if(r)k=1;else{k=(Fp(g)|0)!=0;n=c[U>>2]|0}if((n|0)==95)if(k)break d;else break;else if(k^(Fp(n)|0)!=0)break;else break d}while(0);if(!(c[o>>2]&128)){T=236;break c}k=c[U>>2]|0;if(s|(k|0)==0)break;if(r)n=1;else{n=(Fp(g)|0)!=0;k=c[U>>2]|0}if((k|0)==95)if(n){T=236;break c}else break;else if(n^(Fp(k)|0)!=0)break;else{T=236;break c}}while(0);j=i+40|0;if(!(c[j>>2]|0))break b;else i=i+32|0}if((T|0)==236){T=0;c[f>>2]=c[j>>2];if(G)Yq(c[f+4>>2]|0,-1,P|0)|0;j=c[i+16>>2]|0;do if(j|0){k=c[j>>2]|0;if((k|0)<=-1)break;n=f+4|0;do{if((k|0)<(O|0))c[(c[n>>2]|0)+(k<<2)>>2]=v;j=j+4|0;k=c[j>>2]|0}while((k|0)>-1)}while(0);j=(c[f>>2]|0)!=(c[H>>2]|0);if(D|j){h=j?h:1;d=j?d:v;j=f+4|0}else{j=f+4|0;h=c[j>>2]|0;d=0;do{c[V+(d<<2)>>2]=c[h+(d<<2)>>2];d=d+1|0}while((d|0)!=(O|0));h=1;d=v}b=c[p>>2]|0;c[N+(b<<3)>>2]=v;c[N+(b<<3)+4>>2]=j;f=f+8|0}j=i+40|0;if(!(c[j>>2]|0))break;else i=i+32|0}}while(0);c[f>>2]=0;f=c[U>>2]|0;if(!f)break;else g=f}else{if(L)break;g=c[U>>2]|0;if(!((f|0)!=(z|0)&(g|0)!=0))break}C=v+a|0;a=Zp(U,w,4)|0;if((a|0)<1)if((a|0)<0){a=1;d=0;break a}else a=1;A=w+a|0;if((h|0)!=0&(c[I>>2]|0)!=0){if(!(c[z>>2]|0))f=x;else{p=c[K>>2]|0;q=c[p>>2]|0;r=(q|0)>-1;o=z;f=x;do{n=o+4|0;e:do if(r){i=0;k=q;do{j=c[p+((i|1)<<2)>>2]|0;if((k|0)>=(O|0))break e;h=c[n>>2]|0;if((c[h+(j<<2)>>2]|0)==(c[V+(j<<2)>>2]|0)?(c[h+(k<<2)>>2]|0)<(c[V+(k<<2)>>2]|0):0)break e;i=i+2|0;k=c[p+(i<<2)>>2]|0}while((k|0)>-1);i=n;T=265}else{i=n;h=c[n>>2]|0;T=265}while(0);if((T|0)==265){T=0;c[f>>2]=c[o>>2];y=f+4|0;b=c[y>>2]|0;c[y>>2]=h;c[i>>2]=b;f=f+8|0}o=o+8|0}while((c[o>>2]|0)!=0)}c[f>>2]=0;y=z;h=0}else{y=x;x=z}i=c[x>>2]|0;if(!i){i=B;f=y}else{s=(C|0)!=0;t=(g|0)==95;u=(C|0)==0;w=F&(g|0)==10;v=E&(C|0)<1;r=x;j=B;f=y;while(1){k=i+8|0;if(c[k>>2]|0){q=r+4|0;p=j;o=k;while(1){f:do if((c[i>>2]|0)>>>0>g>>>0)j=p;else{if((c[i+4>>2]|0)>>>0>>0){j=p;break}n=i+20|0;j=c[n>>2]|0;do if(j|0){if(!(w|(v|(j&1|0)==0))){j=p;break f}if(j&2|0?(b=c[U>>2]|0,!((b|Q|0)==0|F&(b|0)==10)):0){j=p;break f}do if(j&16|0){if(t){j=p;break f}if(Fp(g)|0){j=p;break f}j=c[U>>2]|0;if((j|0)==95)break;if(!(Fp(j)|0)){j=p;break f}}while(0);j=c[n>>2]|0;if(j&32){if(t){j=c[U>>2]|0;if((j|0)==95){j=p;break f}}else{b=(Fp(g)|0)==0;j=c[U>>2]|0;if(b|(j|0)==95){j=p;break f}}if(Fp(j)|0){j=p;break f}j=c[n>>2]|0}k=c[U>>2]|0;do if((k|0)!=0&(s&(j&64|0)!=0)){if(t)j=1;else{j=(Fp(g)|0)!=0;k=c[U>>2]|0}if((k|0)==95)if(j){j=p;break f}else break;else if(j^(Fp(k)|0)!=0)break;else{j=p;break f}}while(0);do if(c[n>>2]&128|0){j=c[U>>2]|0;if(u|(j|0)==0){j=p;break f}if(t)k=1;else{k=(Fp(g)|0)!=0;j=c[U>>2]|0}if((j|0)==95)if(k)break;else{j=p;break f}else if(k^(Fp(j)|0)!=0){j=p;break f}else break}while(0);j=c[n>>2]|0;do if(j&4){if(c[Y>>2]&2|0)break;if(!(Ep(g,c[i+24>>2]|0)|0)){j=p;break f}j=c[n>>2]|0}while(0);do if(j&4|0){if(!(c[Y>>2]&2))break;b=$o(g)|0;j=i+24|0;if(Ep(b,c[j>>2]|0)|0)break;b=_o(g)|0;if(!(Ep(b,c[j>>2]|0)|0)){j=p;break f}}while(0);if(!(c[n>>2]&8))break;if(Nq(c[i+28>>2]|0,g,c[Y>>2]&2)|0){j=p;break f}}while(0);if(G){k=c[q>>2]|0;j=0;do{c[p+(j<<2)>>2]=c[k+(j<<2)>>2];j=j+1|0}while((j|0)!=(O|0))}j=c[i+16>>2]|0;do if(j|0){k=c[j>>2]|0;if((k|0)<=-1)break;do{if((k|0)<(O|0))c[p+(k<<2)>>2]=C;j=j+4|0;k=c[j>>2]|0}while((k|0)>-1)}while(0);j=c[i+12>>2]|0;k=N+(j<<3)|0;if((c[k>>2]|0)>=(C|0)){j=c[N+(j<<3)+4>>2]|0;k=c[j>>2]|0;if(!(Lq(O,c[J>>2]|0,p,k)|0)){j=p;break}c[j>>2]=p;if((c[o>>2]|0)!=(c[H>>2]|0)){j=k;break}if(G)d=0;else{h=1;j=k;d=C;break}while(1){c[V+(d<<2)>>2]=c[p+(d<<2)>>2];d=d+1|0;if((d|0)==(O|0)){h=1;j=k;d=C;break f}}}b=c[o>>2]|0;c[f>>2]=b;B=f+4|0;n=c[B>>2]|0;c[B>>2]=p;c[k>>2]=C;c[N+(j<<3)+4>>2]=B;do if((b|0)==(c[H>>2]|0)){if((d|0)==-1)if(G)d=0;else{d=C;h=1;break}else{if(!G)break;if((c[p>>2]|0)>(c[V>>2]|0))break;else d=0}do{c[V+(d<<2)>>2]=c[p+(d<<2)>>2];d=d+1|0}while((d|0)<(O|0));d=C;h=1}while(0);j=n;f=f+8|0}while(0);o=i+40|0;if(!(c[o>>2]|0))break;else{i=i+32|0;p=j}}}r=r+8|0;i=c[r>>2]|0;if(!i){i=j;break}}}c[f>>2]=0;w=A;v=C;B=i;z=y}a=d>>>31}while(0);Pq(R)}}else{c[U>>2]=0;i=f&1;P=f&2;d=c[Y>>2]&4;Q=Hq(0,0)|0;g:do if(Q){j=Jq(Q,0,0,0,32)|0;if(!j){Iq(Q);d=0;a=12;break}c[j+24>>2]=0;c[j+28>>2]=0;k=c[R>>2]|0;if(k){f=Oq(k<<2)|0;if(!f){d=0;h=0;g=0;a=12}else T=9}else{f=0;T=9}h:do if((T|0)==9){a=c[X+28>>2]|0;if(a){h=Oq(a<<3)|0;if(!h){d=0;g=0;a=12;break}}else h=0;O=X+52|0;a=c[O>>2]|0;if(a){g=Oq(a<<2)|0;if(!g){d=0;a=12;break}}else g=0;J=X+8|0;K=X+12|0;L=(V|0)==0;M=(V|0)!=0;N=X+32|0;F=(d|0)!=0;G=(f|0)==0;H=(h|0)==0;I=(g|0)==0;E=(i|0)==0;o=b;n=1;i=-1;s=-1;a=k;i:while(1){if((a|0)>0){d=0;do{c[f+(d<<2)>>2]=-1;if(!L){c[V+(d<<2)>>2]=-1;a=c[R>>2]|0}d=d+1|0}while((d|0)<(a|0))}a=c[O>>2]|0;if((a|0)>0)Yq(g|0,0,a<<2|0)|0;k=c[U>>2]|0;D=n+i|0;a=Zp(U,o,4)|0;if((a|0)<1)if((a|0)<0){d=0;a=1;break h}else a=1;B=o+a|0;C=c[U>>2]|0;d=c[J>>2]|0;i=d+8|0;if(c[i>>2]|0){t=(D|0)!=0;u=(k|0)==95;v=(D|0)==0;x=F&(k|0)==10;w=E&(D|0)<1;r=d;d=0;q=0;p=i;while(1){o=r+20|0;i=c[o>>2]|0;j:do if(i){if(!(x|(w|(i&1|0)==0))){n=q;break}if(i&2|0?(A=c[U>>2]|0,!((A|P|0)==0|F&(A|0)==10)):0){n=q;break}do if(i&16|0){if(u){n=q;break j}if(Fp(k)|0){n=q;break j}i=c[U>>2]|0;if((i|0)==95)break;if(!(Fp(i)|0)){n=q;break j}}while(0);i=c[o>>2]|0;if(i&32){if(u){i=c[U>>2]|0;if((i|0)==95){n=q;break}}else{A=(Fp(k)|0)==0;i=c[U>>2]|0;if(A|(i|0)==95){n=q;break}}if(Fp(i)|0){n=q;break}i=c[o>>2]|0}n=c[U>>2]|0;do if((n|0)!=0&(t&(i&64|0)!=0)){if(u)i=1;else{i=(Fp(k)|0)!=0;n=c[U>>2]|0}if((n|0)==95)if(i){n=q;break j}else break;else if(i^(Fp(n)|0)!=0)break;else{n=q;break j}}while(0);if(!(c[o>>2]&128)){T=52;break}i=c[U>>2]|0;if(v|(i|0)==0){n=q;break}if(u)n=1;else{n=(Fp(k)|0)!=0;i=c[U>>2]|0}if((i|0)==95)if(n){T=52;break}else{n=q;break}else if(n^(Fp(i)|0)!=0){n=q;break}else{T=52;break}}else T=52;while(0);do if((T|0)==52){T=0;if(!q){d=c[r+16>>2]|0;n=c[p>>2]|0;break}n=j+28|0;i=c[n>>2]|0;if(!i){i=Jq(Q,0,0,0,32)|0;if(!i){T=56;break i}c[i+24>>2]=j;c[i+28>>2]=0;A=Jq(Q,0,0,0,c[R>>2]<<2)|0;c[i+20>>2]=A;if(!A){T=63;break i}c[n>>2]=i;j=i}else j=i;c[j>>2]=D;c[j+4>>2]=B;c[j+8>>2]=c[p>>2];c[j+12>>2]=c[r+12>>2];c[j+16>>2]=c[U>>2];if((c[R>>2]|0)>0){n=c[j+20>>2]|0;i=0;do{c[n+(i<<2)>>2]=c[f+(i<<2)>>2];i=i+1|0}while((i|0)<(c[R>>2]|0))}i=c[r+16>>2]|0;if(!i){n=q;break}n=c[i>>2]|0;if((n|0)<=-1){n=q;break}o=c[j+20>>2]|0;do{i=i+4|0;c[o+(n<<2)>>2]=D;n=c[i>>2]|0}while((n|0)>-1);n=q}while(0);p=r+40|0;if(!(c[p>>2]|0))break;else{r=r+32|0;q=n}}if(d){i=c[d>>2]|0;if((i|0)>-1)do{c[f+(i<<2)>>2]=D;d=d+4|0;i=c[d>>2]|0}while((i|0)>-1)}else d=0;if(!n){i=D;q=0;n=B;T=174}else{o=k;p=D;t=B;A=s;z=n;T=82}}else{i=D;q=0;n=B;d=0;T=174}k:while(1){l:do if((T|0)==82){T=0;if((z|0)==(c[K>>2]|0)){if((A|0)>=(p|0)){if(!(M&(A|0)==(p|0))){s=A;k=o;i=p;q=z;n=t;T=174;continue k}if(!(Lq(c[R>>2]|0,c[N>>2]|0,f,V)|0)){s=A;k=o;i=A;q=z;n=t;T=174;continue k}}if(L){s=p;k=o;i=p;q=z;n=t;T=174;continue k}if((c[R>>2]|0)>0)i=0;else{s=p;k=o;i=p;q=z;n=t;T=174;continue k}while(1){c[V+(i<<2)>>2]=c[f+(i<<2)>>2];i=i+1|0;if((i|0)>=(c[R>>2]|0)){s=p;k=o;i=p;q=z;n=t;T=174;continue k}}}r=z+8|0;do if(!(c[r>>2]|0))T=98;else{if(!(c[z+20>>2]&256)){T=98;break}k=c[z+24>>2]|0;Mq(k+1|0,h,c[Y>>2]&-9,X,f,p);y=c[h+(k<<3)>>2]|0;k=(c[h+(k<<3)+4>>2]|0)-y|0;do if(!(Jo(b+y|0,t+-1|0,k)|0)){y=(k|0)==0;i=y&1;n=g+(c[z+12>>2]<<2)|0;if(y?c[n>>2]|0:0){k=o;i=p;n=t;o=25;break}c[n>>2]=i;i=k+-1|0;n=t+i|0;k=c[U>>2]|0;i=p+a+i|0;a=Zp(U,n,4)|0;if((a|0)<1)if((a|0)<0){o=2;break}else a=1;n=n+a|0;o=0}else{k=o;i=p;n=t;o=25}while(0);switch(o&31){case 25:{s=A;q=z;T=174;continue k}case 0:{y=i;break}default:{s=A;q=z;break l}}}while(0);if((T|0)==98){T=0;k=c[U>>2]|0;if(!k){s=A;k=o;i=p;q=z;n=t;T=174;continue k}i=p+a|0;a=Zp(U,t,4)|0;if((a|0)<1)if((a|0)<0){s=A;o=2;q=z;n=t;break}else a=1;y=i;n=t+a|0}if(!(c[r>>2]|0)){s=A;i=y;q=z;T=174;continue k}t=(y|0)!=0;u=(k|0)==95;v=(y|0)==0;x=F&(k|0)==10;w=E&(y|0)<1;q=0;s=z;m:while(1){n:do if((c[s>>2]|0)>>>0<=k>>>0){if((c[s+4>>2]|0)>>>0>>0)break;p=s+20|0;i=c[p>>2]|0;do if(i|0){if(!(x|(w|(i&1|0)==0)))break n;if(i&2|0?(T=c[U>>2]|0,!((T|P|0)==0|F&(T|0)==10)):0)break n;do if(i&16|0){if(u)break n;if(Fp(k)|0)break n;i=c[U>>2]|0;if((i|0)==95)break;if(!(Fp(i)|0))break n}while(0);i=c[p>>2]|0;if(i&32){if(u){i=c[U>>2]|0;if((i|0)==95)break n}else{T=(Fp(k)|0)==0;i=c[U>>2]|0;if(T|(i|0)==95)break n}if(Fp(i)|0)break n;i=c[p>>2]|0}o=c[U>>2]|0;do if((o|0)!=0&(t&(i&64|0)!=0)){if(u)i=1;else{i=(Fp(k)|0)!=0;o=c[U>>2]|0}if((o|0)==95)if(i)break n;else break;else if(i^(Fp(o)|0)!=0)break;else break n}while(0);do if(c[p>>2]&128|0){i=c[U>>2]|0;if(v|(i|0)==0)break n;if(u)o=1;else{o=(Fp(k)|0)!=0;i=c[U>>2]|0}if((i|0)==95)if(o)break;else break n;else if(o^(Fp(i)|0)!=0)break n;else break}while(0);i=c[p>>2]|0;do if(i&4){if(c[Y>>2]&2|0)break;if(!(Ep(k,c[s+24>>2]|0)|0))break n;i=c[p>>2]|0}while(0);do if(i&4|0){if(!(c[Y>>2]&2))break;T=$o(k)|0;i=s+24|0;if(Ep(T,c[i>>2]|0)|0)break;T=_o(k)|0;if(!(Ep(T,c[i>>2]|0)|0))break n}while(0);if(!(c[p>>2]&8))break;if(Nq(c[s+28>>2]|0,k,c[Y>>2]&2)|0)break n}while(0);if(!q){q=c[r>>2]|0;d=c[s+16>>2]|0;break}o=j+28|0;i=c[o>>2]|0;if(!i){i=Jq(Q,0,0,0,32)|0;if(!i){T=148;break m}c[i+24>>2]=j;c[i+28>>2]=0;T=Jq(Q,0,0,0,c[R>>2]<<2)|0;c[i+20>>2]=T;if(!T){T=155;break m}c[o>>2]=i;j=i}else j=i;c[j>>2]=y;c[j+4>>2]=n;c[j+8>>2]=c[r>>2];c[j+12>>2]=c[s+12>>2];c[j+16>>2]=c[U>>2];if((c[R>>2]|0)>0){o=c[j+20>>2]|0;i=0;do{c[o+(i<<2)>>2]=c[f+(i<<2)>>2];i=i+1|0}while((i|0)<(c[R>>2]|0))}i=c[s+16>>2]|0;if(!i)break;o=c[i>>2]|0;if((o|0)<=-1)break;p=c[j+20>>2]|0;do{c[p+(o<<2)>>2]=y;i=i+4|0;o=c[i>>2]|0}while((o|0)>-1)}while(0);r=s+40|0;if(!(c[r>>2]|0)){T=170;break}else s=s+32|0}if((T|0)==148){T=0;Iq(Q);if(!G)Pq(f);if(!H)Pq(h);if(I){s=A;i=y;o=1;q=z;break}Pq(g);s=A;i=y;o=1;q=z;break}else if((T|0)==155){T=0;Iq(Q);if(!G)Pq(f);if(!H)Pq(h);if(I){s=A;i=y;o=1;q=z;break}Pq(g);s=A;i=y;o=1;q=z;break}else if((T|0)==170){T=0;if(!q){s=A;i=y;q=z;T=174;continue k}if(!d){d=0;s=A;i=y;o=0;break}i=c[d>>2]|0;if((i|0)<=-1){s=A;i=y;o=0;break}do{d=d+4|0;c[f+(i<<2)>>2]=y;i=c[d>>2]|0}while((i|0)>-1);s=A;i=y;o=0}}else if((T|0)==174){T=0;o=c[j+24>>2]|0;if(!o){if((s|0)>-1|(c[U>>2]|0)==0){o=27;break}c[U>>2]=C;o=3;n=B;break}q=c[j+8>>2]|0;if(c[q+20>>2]&256|0)c[g+(c[j+12>>2]<<2)>>2]=0;p=c[j>>2]|0;r=c[j+4>>2]|0;c[U>>2]=c[j+16>>2];n=c[R>>2]|0;if((n|0)<=0){j=o;i=p;o=0;n=r;break}j=c[j+20>>2]|0;i=0;do{c[f+(i<<2)>>2]=c[j+(i<<2)>>2];i=i+1|0}while((i|0)!=(n|0));j=o;i=p;o=0;n=r}while(0);switch(o|0){case 2:{d=0;a=1;break h}case 27:{T=184;break i}case 0:{o=k;p=i;t=n;A=s;z=q;T=82;break}case 3:break k;default:{d=0;a=12;break g}}}o=n;n=a;i=D;a=c[R>>2]|0}if((T|0)==56){Iq(Q);if(!G)Pq(f);if(!H)Pq(h);if(I){d=0;a=12;break g}Pq(g);d=0;a=12;break g}else if((T|0)==63){Iq(Q);if(!G)Pq(f);if(!H)Pq(h);if(I){d=0;a=12;break g}Pq(g);d=0;a=12;break g}else if((T|0)==184){d=s;a=s>>>31;break}}while(0);Iq(Q);if(f|0)Pq(f);if(h|0)Pq(h);if(g)Pq(g)}else{d=0;a=12}while(0)}if(!a)Mq(W,e,c[Y>>2]|0,X,V,d);if(V)Pq(V)}l=Z;return a|0}function Lq(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;a:do if((a|0)>0){f=0;while(1){h=c[d+(f<<2)>>2]|0;g=c[e+(f<<2)>>2]|0;if(!(c[b+(f<<2)>>2]|0)){if((h|0)<(g|0)){f=1;break a}if((h|0)>(g|0)){f=0;break a}}else{if((h|0)>(g|0)){f=1;break a}if((h|0)<(g|0)){f=0;break a}}f=f+1|0;if((f|0)>=(a|0)){f=0;break}}}else f=0;while(0);return f|0}function Mq(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;if((d&8|0)==0&(g|0)>-1){n=c[e+16>>2]|0;l=e+28|0;d=c[l>>2]|0;m=(a|0)!=0;if(m&(d|0)!=0){k=e+48|0;j=0;do{d=c[n+(j*12|0)>>2]|0;if((d|0)==(c[k>>2]|0))i=g;else i=c[f+(d<<2)>>2]|0;h=b+(j<<3)|0;c[h>>2]=i;d=c[n+(j*12|0)+4>>2]|0;if((d|0)==(c[k>>2]|0))e=g;else e=c[f+(d<<2)>>2]|0;d=b+(j<<3)+4|0;c[d>>2]=e;if((i|0)==-1|(e|0)==-1){c[d>>2]=-1;c[h>>2]=-1}j=j+1|0;d=c[l>>2]|0}while(j>>>0>>0&j>>>0>>0);f=d}else f=d;if(m&(f|0)!=0){d=0;do{i=b+(d<<3)+4|0;j=c[n+(d*12|0)+8>>2]|0;if(j|0?(o=c[j>>2]|0,(o|0)>-1):0){k=b+(d<<3)|0;h=0;l=o;e=c[k>>2]|0;do{if(!((e|0)>=(c[b+(l<<3)>>2]|0)?(c[i>>2]|0)<=(c[b+(l<<3)+4>>2]|0):0)){c[i>>2]=-1;c[k>>2]=-1;e=-1}h=h+1|0;l=c[j+(h<<2)>>2]|0}while((l|0)>-1)}d=d+1|0}while(d>>>0>>0&d>>>0>>0)}else d=0}else d=0;if(d>>>0>>0)Yq(b+(d<<3)|0,-1,a-d<<3|0)|0;return}function Nq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=c[a>>2]|0;a:do if(!e)d=0;else{f=(d|0)==0;d=e;while(1){if(f){if(Ep(b,d)|0){d=1;break a}}else{e=_o(b)|0;if(Ep(e,c[a>>2]|0)|0){d=1;break a}e=$o(b)|0;if(Ep(e,c[a>>2]|0)|0){d=1;break a}}a=a+4|0;d=c[a>>2]|0;if(!d){d=0;break}}}while(0);return d|0}function Oq(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0;M=l;l=l+16|0;if((l|0)>=(m|0))$(16);q=M;do if(a>>>0<245){p=a>>>0<11?16:a+11&-8;a=p>>>3;u=c[17716]|0;d=u>>>a;if(d&3|0){a=(d&1^1)+a|0;d=70904+(a<<1<<2)|0;e=d+8|0;f=c[e>>2]|0;g=f+8|0;h=c[g>>2]|0;do if((d|0)!=(h|0)){if(h>>>0<(c[17720]|0)>>>0)za();b=h+12|0;if((c[b>>2]|0)==(f|0)){c[b>>2]=d;c[e>>2]=h;break}else za()}else c[17716]=u&~(1<>2]=L|3;L=f+L+4|0;c[L>>2]=c[L>>2]|1;L=g;l=M;return L|0}t=c[17718]|0;if(p>>>0>t>>>0){if(d|0){i=2<>>12&16;a=a>>>i;e=a>>>5&8;a=a>>>e;g=a>>>2&4;a=a>>>g;d=a>>>1&2;a=a>>>d;b=a>>>1&1;b=(e|i|g|d|b)+(a>>>b)|0;a=70904+(b<<1<<2)|0;d=a+8|0;g=c[d>>2]|0;i=g+8|0;e=c[i>>2]|0;do if((a|0)!=(e|0)){if(e>>>0<(c[17720]|0)>>>0)za();f=e+12|0;if((c[f>>2]|0)==(g|0)){c[f>>2]=a;c[d>>2]=e;j=u;break}else za()}else{j=u&~(1<>2]=p|3;e=g+p|0;c[e+4>>2]=h|1;c[e+h>>2]=h;if(t|0){f=c[17721]|0;b=t>>>3;d=70904+(b<<1<<2)|0;b=1<>2]|0;if(a>>>0<(c[17720]|0)>>>0)za();else{k=a;n=b}}else{c[17716]=j|b;k=d;n=d+8|0}c[n>>2]=f;c[k+12>>2]=f;c[f+8>>2]=k;c[f+12>>2]=d}c[17718]=h;c[17721]=e;L=i;l=M;return L|0}k=c[17717]|0;if(k){a=(k&0-k)+-1|0;K=a>>>12&16;a=a>>>K;J=a>>>5&8;a=a>>>J;L=a>>>2&4;a=a>>>L;i=a>>>1&2;a=a>>>i;j=a>>>1&1;j=c[71168+((J|K|L|i|j)+(a>>>j)<<2)>>2]|0;a=j;i=j;j=(c[j+4>>2]&-8)-p|0;while(1){b=c[a+16>>2]|0;if(!b){b=c[a+20>>2]|0;if(!b)break}L=(c[b+4>>2]&-8)-p|0;K=L>>>0>>0;a=b;i=K?b:i;j=K?L:j}f=c[17720]|0;if(i>>>0>>0)za();h=i+p|0;if(i>>>0>=h>>>0)za();g=c[i+24>>2]|0;d=c[i+12>>2]|0;do if((d|0)==(i|0)){a=i+20|0;b=c[a>>2]|0;if(!b){a=i+16|0;b=c[a>>2]|0;if(!b){o=0;break}}while(1){d=b+20|0;e=c[d>>2]|0;if(e|0){b=e;a=d;continue}d=b+16|0;e=c[d>>2]|0;if(!e)break;else{b=e;a=d}}if(a>>>0>>0)za();else{c[a>>2]=0;o=b;break}}else{e=c[i+8>>2]|0;if(e>>>0>>0)za();b=e+12|0;if((c[b>>2]|0)!=(i|0))za();a=d+8|0;if((c[a>>2]|0)==(i|0)){c[b>>2]=d;c[a>>2]=e;o=d;break}else za()}while(0);do if(g|0){b=c[i+28>>2]|0;a=71168+(b<<2)|0;if((i|0)==(c[a>>2]|0)){c[a>>2]=o;if(!o){c[17717]=k&~(1<>>0<(c[17720]|0)>>>0)za();b=g+16|0;if((c[b>>2]|0)==(i|0))c[b>>2]=o;else c[g+20>>2]=o;if(!o)break}a=c[17720]|0;if(o>>>0>>0)za();c[o+24>>2]=g;b=c[i+16>>2]|0;do if(b|0)if(b>>>0>>0)za();else{c[o+16>>2]=b;c[b+24>>2]=o;break}while(0);b=c[i+20>>2]|0;if(b|0)if(b>>>0<(c[17720]|0)>>>0)za();else{c[o+20>>2]=b;c[b+24>>2]=o;break}}while(0);if(j>>>0<16){L=j+p|0;c[i+4>>2]=L|3;L=i+L+4|0;c[L>>2]=c[L>>2]|1}else{c[i+4>>2]=p|3;c[h+4>>2]=j|1;c[h+j>>2]=j;if(t|0){e=c[17721]|0;b=t>>>3;d=70904+(b<<1<<2)|0;b=1<>2]|0;if(a>>>0<(c[17720]|0)>>>0)za();else{r=a;s=b}}else{c[17716]=u|b;r=d;s=d+8|0}c[s>>2]=e;c[r+12>>2]=e;c[e+8>>2]=r;c[e+12>>2]=d}c[17718]=j;c[17721]=h}L=i+8|0;l=M;return L|0}}}else if(a>>>0<=4294967231){a=a+11|0;p=a&-8;k=c[17717]|0;if(k){e=0-p|0;a=a>>>8;if(a)if(p>>>0>16777215)j=31;else{s=(a+1048320|0)>>>16&8;E=a<>>16&4;E=E<>>16&2;j=14-(r|s|j)+(E<>>15)|0;j=p>>>(j+7|0)&1|j<<1}else j=0;a=c[71168+(j<<2)>>2]|0;a:do if(!a){d=0;f=0;E=86}else{f=0;i=a;h=p<<((j|0)==31?0:25-(j>>>1)|0);d=0;while(1){a=(c[i+4>>2]&-8)-p|0;if(a>>>0>>0)if(!a){a=i;e=0;d=i;E=90;break a}else{f=i;e=a}a=c[i+20>>2]|0;i=c[i+16+(h>>>31<<2)>>2]|0;d=(a|0)==0|(a|0)==(i|0)?d:a;a=(i|0)==0;if(a){E=86;break}else h=h<<(a&1^1)}}while(0);if((E|0)==86){if((d|0)==0&(f|0)==0){a=2<>>12&16;s=s>>>n;j=s>>>5&8;s=s>>>j;o=s>>>2&4;s=s>>>o;r=s>>>1&2;s=s>>>r;d=s>>>1&1;d=c[71168+((j|n|o|r|d)+(s>>>d)<<2)>>2]|0}if(!d){j=f;i=e}else{a=f;E=90}}if((E|0)==90)while(1){E=0;s=(c[d+4>>2]&-8)-p|0;f=s>>>0>>0;e=f?s:e;a=f?d:a;f=c[d+16>>2]|0;if(f|0){d=f;E=90;continue}d=c[d+20>>2]|0;if(!d){j=a;i=e;break}else E=90}if((j|0)!=0?i>>>0<((c[17718]|0)-p|0)>>>0:0){f=c[17720]|0;if(j>>>0>>0)za();h=j+p|0;if(j>>>0>=h>>>0)za();g=c[j+24>>2]|0;d=c[j+12>>2]|0;do if((d|0)==(j|0)){a=j+20|0;b=c[a>>2]|0;if(!b){a=j+16|0;b=c[a>>2]|0;if(!b){t=0;break}}while(1){d=b+20|0;e=c[d>>2]|0;if(e|0){b=e;a=d;continue}d=b+16|0;e=c[d>>2]|0;if(!e)break;else{b=e;a=d}}if(a>>>0>>0)za();else{c[a>>2]=0;t=b;break}}else{e=c[j+8>>2]|0;if(e>>>0>>0)za();b=e+12|0;if((c[b>>2]|0)!=(j|0))za();a=d+8|0;if((c[a>>2]|0)==(j|0)){c[b>>2]=d;c[a>>2]=e;t=d;break}else za()}while(0);do if(g){b=c[j+28>>2]|0;a=71168+(b<<2)|0;if((j|0)==(c[a>>2]|0)){c[a>>2]=t;if(!t){u=k&~(1<>>0<(c[17720]|0)>>>0)za();b=g+16|0;if((c[b>>2]|0)==(j|0))c[b>>2]=t;else c[g+20>>2]=t;if(!t){u=k;break}}a=c[17720]|0;if(t>>>0>>0)za();c[t+24>>2]=g;b=c[j+16>>2]|0;do if(b|0)if(b>>>0>>0)za();else{c[t+16>>2]=b;c[b+24>>2]=t;break}while(0);b=c[j+20>>2]|0;if(b)if(b>>>0<(c[17720]|0)>>>0)za();else{c[t+20>>2]=b;c[b+24>>2]=t;u=k;break}else u=k}else u=k;while(0);do if(i>>>0>=16){c[j+4>>2]=p|3;c[h+4>>2]=i|1;c[h+i>>2]=i;b=i>>>3;if(i>>>0<256){d=70904+(b<<1<<2)|0;a=c[17716]|0;b=1<>2]|0;if(a>>>0<(c[17720]|0)>>>0)za();else{C=a;D=b}}else{c[17716]=a|b;C=d;D=d+8|0}c[D>>2]=h;c[C+12>>2]=h;c[h+8>>2]=C;c[h+12>>2]=d;break}b=i>>>8;if(b)if(i>>>0>16777215)b=31;else{K=(b+1048320|0)>>>16&8;L=b<>>16&4;L=L<>>16&2;b=14-(J|K|b)+(L<>>15)|0;b=i>>>(b+7|0)&1|b<<1}else b=0;d=71168+(b<<2)|0;c[h+28>>2]=b;a=h+16|0;c[a+4>>2]=0;c[a>>2]=0;a=1<>2]=h;c[h+24>>2]=d;c[h+12>>2]=h;c[h+8>>2]=h;break}a=i<<((b|0)==31?0:25-(b>>>1)|0);e=c[d>>2]|0;while(1){if((c[e+4>>2]&-8|0)==(i|0)){E=148;break}d=e+16+(a>>>31<<2)|0;b=c[d>>2]|0;if(!b){E=145;break}else{a=a<<1;e=b}}if((E|0)==145)if(d>>>0<(c[17720]|0)>>>0)za();else{c[d>>2]=h;c[h+24>>2]=e;c[h+12>>2]=h;c[h+8>>2]=h;break}else if((E|0)==148){b=e+8|0;a=c[b>>2]|0;L=c[17720]|0;if(a>>>0>=L>>>0&e>>>0>=L>>>0){c[a+12>>2]=h;c[b>>2]=h;c[h+8>>2]=a;c[h+12>>2]=e;c[h+24>>2]=0;break}else za()}}else{L=i+p|0;c[j+4>>2]=L|3;L=j+L+4|0;c[L>>2]=c[L>>2]|1}while(0);L=j+8|0;l=M;return L|0}}}else p=-1;while(0);d=c[17718]|0;if(d>>>0>=p>>>0){b=d-p|0;a=c[17721]|0;if(b>>>0>15){L=a+p|0;c[17721]=L;c[17718]=b;c[L+4>>2]=b|1;c[L+b>>2]=b;c[a+4>>2]=p|3}else{c[17718]=0;c[17721]=0;c[a+4>>2]=d|3;L=a+d+4|0;c[L>>2]=c[L>>2]|1}L=a+8|0;l=M;return L|0}i=c[17719]|0;if(i>>>0>p>>>0){J=i-p|0;c[17719]=J;L=c[17722]|0;K=L+p|0;c[17722]=K;c[K+4>>2]=J|1;c[L+4>>2]=p|3;L=L+8|0;l=M;return L|0}if(!(c[17834]|0)){c[17836]=4096;c[17835]=4096;c[17837]=-1;c[17838]=-1;c[17839]=0;c[17827]=0;a=q&-16^1431655768;c[q>>2]=a;c[17834]=a;a=4096}else a=c[17836]|0;j=p+48|0;k=p+47|0;h=a+k|0;f=0-a|0;n=h&f;if(n>>>0<=p>>>0){L=0;l=M;return L|0}a=c[17826]|0;if(a|0?(C=c[17824]|0,D=C+n|0,D>>>0<=C>>>0|D>>>0>a>>>0):0){L=0;l=M;return L|0}b:do if(!(c[17827]&4)){d=c[17722]|0;c:do if(d){e=71312;while(1){a=c[e>>2]|0;if(a>>>0<=d>>>0?(v=e+4|0,(a+(c[v>>2]|0)|0)>>>0>d>>>0):0)break;a=c[e+8>>2]|0;if(!a){E=172;break c}else e=a}d=h-i&f;if(d>>>0<2147483647){a=lr(d|0)|0;if((a|0)==((c[e>>2]|0)+(c[v>>2]|0)|0)){if((a|0)!=(-1|0)){h=d;g=a;E=190;break b}}else{b=d;E=180}}}else E=172;while(0);do if(((E|0)==172?(g=lr(0)|0,(g|0)!=(-1|0)):0)?(b=g,w=c[17835]|0,x=w+-1|0,b=((x&b|0)==0?0:(x+b&0-w)-b|0)+n|0,w=c[17824]|0,x=b+w|0,b>>>0>p>>>0&b>>>0<2147483647):0){D=c[17826]|0;if(D|0?x>>>0<=w>>>0|x>>>0>D>>>0:0)break;a=lr(b|0)|0;if((a|0)==(g|0)){h=b;E=190;break b}else E=180}while(0);d:do if((E|0)==180){d=0-b|0;do if(j>>>0>b>>>0&(b>>>0<2147483647&(a|0)!=(-1|0))?(y=c[17836]|0,y=k-b+y&0-y,y>>>0<2147483647):0)if((lr(y|0)|0)==(-1|0)){lr(d|0)|0;break d}else{b=y+b|0;break}while(0);if((a|0)!=(-1|0)){h=b;g=a;E=190;break b}}while(0);c[17827]=c[17827]|4;E=187}else E=187;while(0);if((((E|0)==187?n>>>0<2147483647:0)?(B=lr(n|0)|0,z=lr(0)|0,B>>>0>>0&((B|0)!=(-1|0)&(z|0)!=(-1|0))):0)?(A=z-B|0,A>>>0>(p+40|0)>>>0):0){h=A;g=B;E=190}if((E|0)==190){b=(c[17824]|0)+h|0;c[17824]=b;if(b>>>0>(c[17825]|0)>>>0)c[17825]=b;k=c[17722]|0;do if(k){b=71312;while(1){a=c[b>>2]|0;d=b+4|0;e=c[d>>2]|0;if((g|0)==(a+e|0)){E=200;break}f=c[b+8>>2]|0;if(!f)break;else b=f}if(((E|0)==200?(c[b+12>>2]&8|0)==0:0)?k>>>0>>0&k>>>0>=a>>>0:0){c[d>>2]=e+h;L=k+8|0;L=(L&7|0)==0?0:0-L&7;K=k+L|0;L=h-L+(c[17719]|0)|0;c[17722]=K;c[17719]=L;c[K+4>>2]=L|1;c[K+L+4>>2]=40;c[17723]=c[17838];break}b=c[17720]|0;if(g>>>0>>0){c[17720]=g;i=g}else i=b;a=g+h|0;b=71312;while(1){if((c[b>>2]|0)==(a|0)){E=208;break}b=c[b+8>>2]|0;if(!b){a=71312;break}}if((E|0)==208)if(!(c[b+12>>2]&8)){c[b>>2]=g;o=b+4|0;c[o>>2]=(c[o>>2]|0)+h;o=g+8|0;o=g+((o&7|0)==0?0:0-o&7)|0;b=a+8|0;b=a+((b&7|0)==0?0:0-b&7)|0;n=o+p|0;j=b-o-p|0;c[o+4>>2]=p|3;do if((b|0)!=(k|0)){if((b|0)==(c[17721]|0)){L=(c[17718]|0)+j|0;c[17718]=L;c[17721]=n;c[n+4>>2]=L|1;c[n+L>>2]=L;break}a=c[b+4>>2]|0;if((a&3|0)==1){h=a&-8;f=a>>>3;e:do if(a>>>0>=256){g=c[b+24>>2]|0;e=c[b+12>>2]|0;do if((e|0)==(b|0)){e=b+16|0;d=e+4|0;a=c[d>>2]|0;if(!a){a=c[e>>2]|0;if(!a){J=0;break}else d=e}while(1){e=a+20|0;f=c[e>>2]|0;if(f|0){a=f;d=e;continue}e=a+16|0;f=c[e>>2]|0;if(!f)break;else{a=f;d=e}}if(d>>>0>>0)za();else{c[d>>2]=0;J=a;break}}else{f=c[b+8>>2]|0;if(f>>>0>>0)za();a=f+12|0;if((c[a>>2]|0)!=(b|0))za();d=e+8|0;if((c[d>>2]|0)==(b|0)){c[a>>2]=e;c[d>>2]=f;J=e;break}else za()}while(0);if(!g)break;a=c[b+28>>2]|0;d=71168+(a<<2)|0;do if((b|0)!=(c[d>>2]|0)){if(g>>>0<(c[17720]|0)>>>0)za();a=g+16|0;if((c[a>>2]|0)==(b|0))c[a>>2]=J;else c[g+20>>2]=J;if(!J)break e}else{c[d>>2]=J;if(J|0)break;c[17717]=c[17717]&~(1<>>0>>0)za();c[J+24>>2]=g;a=b+16|0;d=c[a>>2]|0;do if(d|0)if(d>>>0>>0)za();else{c[J+16>>2]=d;c[d+24>>2]=J;break}while(0);a=c[a+4>>2]|0;if(!a)break;if(a>>>0<(c[17720]|0)>>>0)za();else{c[J+20>>2]=a;c[a+24>>2]=J;break}}else{d=c[b+8>>2]|0;e=c[b+12>>2]|0;a=70904+(f<<1<<2)|0;do if((d|0)!=(a|0)){if(d>>>0>>0)za();if((c[d+12>>2]|0)==(b|0))break;za()}while(0);if((e|0)==(d|0)){c[17716]=c[17716]&~(1<>>0>>0)za();a=e+8|0;if((c[a>>2]|0)==(b|0)){G=a;break}za()}while(0);c[d+12>>2]=e;c[G>>2]=d}while(0);b=b+h|0;f=h+j|0}else f=j;b=b+4|0;c[b>>2]=c[b>>2]&-2;c[n+4>>2]=f|1;c[n+f>>2]=f;b=f>>>3;if(f>>>0<256){d=70904+(b<<1<<2)|0;a=c[17716]|0;b=1<>2]|0;if(a>>>0>=(c[17720]|0)>>>0){K=a;L=b;break}za()}while(0);c[L>>2]=n;c[K+12>>2]=n;c[n+8>>2]=K;c[n+12>>2]=d;break}b=f>>>8;do if(!b)b=0;else{if(f>>>0>16777215){b=31;break}K=(b+1048320|0)>>>16&8;L=b<>>16&4;L=L<>>16&2;b=14-(J|K|b)+(L<>>15)|0;b=f>>>(b+7|0)&1|b<<1}while(0);e=71168+(b<<2)|0;c[n+28>>2]=b;a=n+16|0;c[a+4>>2]=0;c[a>>2]=0;a=c[17717]|0;d=1<>2]=n;c[n+24>>2]=e;c[n+12>>2]=n;c[n+8>>2]=n;break}a=f<<((b|0)==31?0:25-(b>>>1)|0);e=c[e>>2]|0;while(1){if((c[e+4>>2]&-8|0)==(f|0)){E=278;break}d=e+16+(a>>>31<<2)|0;b=c[d>>2]|0;if(!b){E=275;break}else{a=a<<1;e=b}}if((E|0)==275)if(d>>>0<(c[17720]|0)>>>0)za();else{c[d>>2]=n;c[n+24>>2]=e;c[n+12>>2]=n;c[n+8>>2]=n;break}else if((E|0)==278){b=e+8|0;a=c[b>>2]|0;L=c[17720]|0;if(a>>>0>=L>>>0&e>>>0>=L>>>0){c[a+12>>2]=n;c[b>>2]=n;c[n+8>>2]=a;c[n+12>>2]=e;c[n+24>>2]=0;break}else za()}}else{L=(c[17719]|0)+j|0;c[17719]=L;c[17722]=n;c[n+4>>2]=L|1}while(0);L=o+8|0;l=M;return L|0}else a=71312;while(1){b=c[a>>2]|0;if(b>>>0<=k>>>0?(F=b+(c[a+4>>2]|0)|0,F>>>0>k>>>0):0)break;a=c[a+8>>2]|0}f=F+-47|0;a=f+8|0;a=f+((a&7|0)==0?0:0-a&7)|0;f=k+16|0;a=a>>>0>>0?k:a;b=a+8|0;d=g+8|0;d=(d&7|0)==0?0:0-d&7;L=g+d|0;d=h+-40-d|0;c[17722]=L;c[17719]=d;c[L+4>>2]=d|1;c[L+d+4>>2]=40;c[17723]=c[17838];d=a+4|0;c[d>>2]=27;c[b>>2]=c[17828];c[b+4>>2]=c[17829];c[b+8>>2]=c[17830];c[b+12>>2]=c[17831];c[17828]=g;c[17829]=h;c[17831]=0;c[17830]=b;b=a+24|0;do{b=b+4|0;c[b>>2]=7}while((b+4|0)>>>0>>0);if((a|0)!=(k|0)){g=a-k|0;c[d>>2]=c[d>>2]&-2;c[k+4>>2]=g|1;c[a>>2]=g;b=g>>>3;if(g>>>0<256){d=70904+(b<<1<<2)|0;a=c[17716]|0;b=1<>2]|0;if(a>>>0<(c[17720]|0)>>>0)za();else{H=a;I=b}}else{c[17716]=a|b;H=d;I=d+8|0}c[I>>2]=k;c[H+12>>2]=k;c[k+8>>2]=H;c[k+12>>2]=d;break}b=g>>>8;if(b)if(g>>>0>16777215)d=31;else{K=(b+1048320|0)>>>16&8;L=b<>>16&4;L=L<>>16&2;d=14-(J|K|d)+(L<>>15)|0;d=g>>>(d+7|0)&1|d<<1}else d=0;e=71168+(d<<2)|0;c[k+28>>2]=d;c[k+20>>2]=0;c[f>>2]=0;b=c[17717]|0;a=1<>2]=k;c[k+24>>2]=e;c[k+12>>2]=k;c[k+8>>2]=k;break}a=g<<((d|0)==31?0:25-(d>>>1)|0);e=c[e>>2]|0;while(1){if((c[e+4>>2]&-8|0)==(g|0)){E=304;break}d=e+16+(a>>>31<<2)|0;b=c[d>>2]|0;if(!b){E=301;break}else{a=a<<1;e=b}}if((E|0)==301)if(d>>>0<(c[17720]|0)>>>0)za();else{c[d>>2]=k;c[k+24>>2]=e;c[k+12>>2]=k;c[k+8>>2]=k;break}else if((E|0)==304){b=e+8|0;a=c[b>>2]|0;L=c[17720]|0;if(a>>>0>=L>>>0&e>>>0>=L>>>0){c[a+12>>2]=k;c[b>>2]=k;c[k+8>>2]=a;c[k+12>>2]=e;c[k+24>>2]=0;break}else za()}}}else{L=c[17720]|0;if((L|0)==0|g>>>0>>0)c[17720]=g;c[17828]=g;c[17829]=h;c[17831]=0;c[17725]=c[17834];c[17724]=-1;b=0;do{L=70904+(b<<1<<2)|0;c[L+12>>2]=L;c[L+8>>2]=L;b=b+1|0}while((b|0)!=32);L=g+8|0;L=(L&7|0)==0?0:0-L&7;K=g+L|0;L=h+-40-L|0;c[17722]=K;c[17719]=L;c[K+4>>2]=L|1;c[K+L+4>>2]=40;c[17723]=c[17838]}while(0);b=c[17719]|0;if(b>>>0>p>>>0){J=b-p|0;c[17719]=J;L=c[17722]|0;K=L+p|0;c[17722]=K;c[K+4>>2]=J|1;c[L+4>>2]=p|3;L=L+8|0;l=M;return L|0}}c[(zo()|0)>>2]=12;L=0;l=M;return L|0}function Pq(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;if(!a)return;d=a+-8|0;h=c[17720]|0;if(d>>>0>>0)za();a=c[a+-4>>2]|0;b=a&3;if((b|0)==1)za();e=a&-8;n=d+e|0;do if(!(a&1)){a=c[d>>2]|0;if(!b)return;k=d+(0-a)|0;j=a+e|0;if(k>>>0>>0)za();if((k|0)==(c[17721]|0)){a=n+4|0;b=c[a>>2]|0;if((b&3|0)!=3){q=k;f=j;break}c[17718]=j;c[a>>2]=b&-2;c[k+4>>2]=j|1;c[k+j>>2]=j;return}e=a>>>3;if(a>>>0<256){b=c[k+8>>2]|0;d=c[k+12>>2]|0;a=70904+(e<<1<<2)|0;if((b|0)!=(a|0)){if(b>>>0>>0)za();if((c[b+12>>2]|0)!=(k|0))za()}if((d|0)==(b|0)){c[17716]=c[17716]&~(1<>>0>>0)za();a=d+8|0;if((c[a>>2]|0)==(k|0))g=a;else za()}else g=d+8|0;c[b+12>>2]=d;c[g>>2]=b;q=k;f=j;break}g=c[k+24>>2]|0;d=c[k+12>>2]|0;do if((d|0)==(k|0)){d=k+16|0;b=d+4|0;a=c[b>>2]|0;if(!a){a=c[d>>2]|0;if(!a){i=0;break}else b=d}while(1){d=a+20|0;e=c[d>>2]|0;if(e|0){a=e;b=d;continue}d=a+16|0;e=c[d>>2]|0;if(!e)break;else{a=e;b=d}}if(b>>>0>>0)za();else{c[b>>2]=0;i=a;break}}else{e=c[k+8>>2]|0;if(e>>>0>>0)za();a=e+12|0;if((c[a>>2]|0)!=(k|0))za();b=d+8|0;if((c[b>>2]|0)==(k|0)){c[a>>2]=d;c[b>>2]=e;i=d;break}else za()}while(0);if(g){a=c[k+28>>2]|0;b=71168+(a<<2)|0;if((k|0)==(c[b>>2]|0)){c[b>>2]=i;if(!i){c[17717]=c[17717]&~(1<>>0<(c[17720]|0)>>>0)za();a=g+16|0;if((c[a>>2]|0)==(k|0))c[a>>2]=i;else c[g+20>>2]=i;if(!i){q=k;f=j;break}}d=c[17720]|0;if(i>>>0>>0)za();c[i+24>>2]=g;a=k+16|0;b=c[a>>2]|0;do if(b|0)if(b>>>0>>0)za();else{c[i+16>>2]=b;c[b+24>>2]=i;break}while(0);a=c[a+4>>2]|0;if(a)if(a>>>0<(c[17720]|0)>>>0)za();else{c[i+20>>2]=a;c[a+24>>2]=i;q=k;f=j;break}else{q=k;f=j}}else{q=k;f=j}}else{q=d;f=e}while(0);if(q>>>0>=n>>>0)za();a=n+4|0;b=c[a>>2]|0;if(!(b&1))za();if(!(b&2)){if((n|0)==(c[17722]|0)){p=(c[17719]|0)+f|0;c[17719]=p;c[17722]=q;c[q+4>>2]=p|1;if((q|0)!=(c[17721]|0))return;c[17721]=0;c[17718]=0;return}if((n|0)==(c[17721]|0)){p=(c[17718]|0)+f|0;c[17718]=p;c[17721]=q;c[q+4>>2]=p|1;c[q+p>>2]=p;return}f=(b&-8)+f|0;e=b>>>3;do if(b>>>0>=256){g=c[n+24>>2]|0;a=c[n+12>>2]|0;do if((a|0)==(n|0)){d=n+16|0;b=d+4|0;a=c[b>>2]|0;if(!a){a=c[d>>2]|0;if(!a){m=0;break}else b=d}while(1){d=a+20|0;e=c[d>>2]|0;if(e|0){a=e;b=d;continue}d=a+16|0;e=c[d>>2]|0;if(!e)break;else{a=e;b=d}}if(b>>>0<(c[17720]|0)>>>0)za();else{c[b>>2]=0;m=a;break}}else{b=c[n+8>>2]|0;if(b>>>0<(c[17720]|0)>>>0)za();d=b+12|0;if((c[d>>2]|0)!=(n|0))za();e=a+8|0;if((c[e>>2]|0)==(n|0)){c[d>>2]=a;c[e>>2]=b;m=a;break}else za()}while(0);if(g|0){a=c[n+28>>2]|0;b=71168+(a<<2)|0;if((n|0)==(c[b>>2]|0)){c[b>>2]=m;if(!m){c[17717]=c[17717]&~(1<>>0<(c[17720]|0)>>>0)za();a=g+16|0;if((c[a>>2]|0)==(n|0))c[a>>2]=m;else c[g+20>>2]=m;if(!m)break}d=c[17720]|0;if(m>>>0>>0)za();c[m+24>>2]=g;a=n+16|0;b=c[a>>2]|0;do if(b|0)if(b>>>0>>0)za();else{c[m+16>>2]=b;c[b+24>>2]=m;break}while(0);a=c[a+4>>2]|0;if(a|0)if(a>>>0<(c[17720]|0)>>>0)za();else{c[m+20>>2]=a;c[a+24>>2]=m;break}}}else{b=c[n+8>>2]|0;d=c[n+12>>2]|0;a=70904+(e<<1<<2)|0;if((b|0)!=(a|0)){if(b>>>0<(c[17720]|0)>>>0)za();if((c[b+12>>2]|0)!=(n|0))za()}if((d|0)==(b|0)){c[17716]=c[17716]&~(1<>>0<(c[17720]|0)>>>0)za();a=d+8|0;if((c[a>>2]|0)==(n|0))l=a;else za()}else l=d+8|0;c[b+12>>2]=d;c[l>>2]=b}while(0);c[q+4>>2]=f|1;c[q+f>>2]=f;if((q|0)==(c[17721]|0)){c[17718]=f;return}}else{c[a>>2]=b&-2;c[q+4>>2]=f|1;c[q+f>>2]=f}a=f>>>3;if(f>>>0<256){d=70904+(a<<1<<2)|0;b=c[17716]|0;a=1<>2]|0;if(b>>>0<(c[17720]|0)>>>0)za();else{o=b;p=a}}else{c[17716]=b|a;o=d;p=d+8|0}c[p>>2]=q;c[o+12>>2]=q;c[q+8>>2]=o;c[q+12>>2]=d;return}a=f>>>8;if(a)if(f>>>0>16777215)a=31;else{o=(a+1048320|0)>>>16&8;p=a<>>16&4;p=p<>>16&2;a=14-(n|o|a)+(p<>>15)|0;a=f>>>(a+7|0)&1|a<<1}else a=0;e=71168+(a<<2)|0;c[q+28>>2]=a;c[q+20>>2]=0;c[q+16>>2]=0;b=c[17717]|0;d=1<>>1)|0);e=c[e>>2]|0;while(1){if((c[e+4>>2]&-8|0)==(f|0)){a=130;break}d=e+16+(b>>>31<<2)|0;a=c[d>>2]|0;if(!a){a=127;break}else{b=b<<1;e=a}}if((a|0)==127)if(d>>>0<(c[17720]|0)>>>0)za();else{c[d>>2]=q;c[q+24>>2]=e;c[q+12>>2]=q;c[q+8>>2]=q;break}else if((a|0)==130){a=e+8|0;b=c[a>>2]|0;p=c[17720]|0;if(b>>>0>=p>>>0&e>>>0>=p>>>0){c[b+12>>2]=q;c[a>>2]=q;c[q+8>>2]=b;c[q+12>>2]=e;c[q+24>>2]=0;break}else za()}}else{c[17717]=b|d;c[e>>2]=q;c[q+24>>2]=e;c[q+12>>2]=q;c[q+8>>2]=q}while(0);q=(c[17724]|0)+-1|0;c[17724]=q;if(!q)a=71320;else return;while(1){a=c[a>>2]|0;if(!a)break;else a=a+8|0}c[17724]=-1;return}function Qq(a,b){a=a|0;b=b|0;var d=0;if(a){d=S(b,a)|0;if((b|a)>>>0>65535)d=((d>>>0)/(a>>>0)|0|0)==(b|0)?d:-1}else d=0;a=Oq(d)|0;if(!a)return a|0;if(!(c[a+-4>>2]&3))return a|0;Yq(a|0,0,d|0)|0;return a|0}function Rq(a,b){a=a|0;b=b|0;var d=0,e=0;if(!a){b=Oq(b)|0;return b|0}if(b>>>0>4294967231){c[(zo()|0)>>2]=12;b=0;return b|0}d=Sq(a+-8|0,b>>>0<11?16:b+11&-8)|0;if(d|0){b=d+8|0;return b|0}d=Oq(b)|0;if(!d){b=0;return b|0}e=c[a+-4>>2]|0;e=(e&-8)-((e&3|0)==0?8:4)|0;cr(d|0,a|0,(e>>>0>>0?e:b)|0)|0;Pq(a);b=d;return b|0}function Sq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;n=a+4|0;o=c[n>>2]|0;d=o&-8;k=a+d|0;i=c[17720]|0;e=o&3;if(!((e|0)!=1&a>>>0>=i>>>0&a>>>0>>0))za();f=c[k+4>>2]|0;if(!(f&1))za();if(!e){if(b>>>0<256){a=0;return a|0}if(d>>>0>=(b+4|0)>>>0?(d-b|0)>>>0<=c[17836]<<1>>>0:0)return a|0;a=0;return a|0}if(d>>>0>=b>>>0){d=d-b|0;if(d>>>0<=15)return a|0;m=a+b|0;c[n>>2]=o&1|b|2;c[m+4>>2]=d|3;o=m+d+4|0;c[o>>2]=c[o>>2]|1;Tq(m,d);return a|0}if((k|0)==(c[17722]|0)){d=(c[17719]|0)+d|0;if(d>>>0<=b>>>0){a=0;return a|0}m=d-b|0;l=a+b|0;c[n>>2]=o&1|b|2;c[l+4>>2]=m|1;c[17722]=l;c[17719]=m;return a|0}if((k|0)==(c[17721]|0)){e=(c[17718]|0)+d|0;if(e>>>0>>0){a=0;return a|0}d=e-b|0;if(d>>>0>15){e=a+b|0;m=e+d|0;c[n>>2]=o&1|b|2;c[e+4>>2]=d|1;c[m>>2]=d;o=m+4|0;c[o>>2]=c[o>>2]&-2}else{c[n>>2]=o&1|e|2;e=a+e+4|0;c[e>>2]=c[e>>2]|1;e=0;d=0}c[17718]=d;c[17721]=e;return a|0}if(f&2|0){a=0;return a|0}l=(f&-8)+d|0;if(l>>>0>>0){a=0;return a|0}m=l-b|0;g=f>>>3;do if(f>>>0>=256){h=c[k+24>>2]|0;f=c[k+12>>2]|0;do if((f|0)==(k|0)){f=k+16|0;e=f+4|0;d=c[e>>2]|0;if(!d){d=c[f>>2]|0;if(!d){j=0;break}else e=f}while(1){f=d+20|0;g=c[f>>2]|0;if(g|0){d=g;e=f;continue}f=d+16|0;g=c[f>>2]|0;if(!g)break;else{d=g;e=f}}if(e>>>0>>0)za();else{c[e>>2]=0;j=d;break}}else{g=c[k+8>>2]|0;if(g>>>0>>0)za();d=g+12|0;if((c[d>>2]|0)!=(k|0))za();e=f+8|0;if((c[e>>2]|0)==(k|0)){c[d>>2]=f;c[e>>2]=g;j=f;break}else za()}while(0);if(h|0){d=c[k+28>>2]|0;e=71168+(d<<2)|0;if((k|0)==(c[e>>2]|0)){c[e>>2]=j;if(!j){c[17717]=c[17717]&~(1<>>0<(c[17720]|0)>>>0)za();d=h+16|0;if((c[d>>2]|0)==(k|0))c[d>>2]=j;else c[h+20>>2]=j;if(!j)break}f=c[17720]|0;if(j>>>0>>0)za();c[j+24>>2]=h;d=k+16|0;e=c[d>>2]|0;do if(e|0)if(e>>>0>>0)za();else{c[j+16>>2]=e;c[e+24>>2]=j;break}while(0);d=c[d+4>>2]|0;if(d|0)if(d>>>0<(c[17720]|0)>>>0)za();else{c[j+20>>2]=d;c[d+24>>2]=j;break}}}else{e=c[k+8>>2]|0;f=c[k+12>>2]|0;d=70904+(g<<1<<2)|0;if((e|0)!=(d|0)){if(e>>>0>>0)za();if((c[e+12>>2]|0)!=(k|0))za()}if((f|0)==(e|0)){c[17716]=c[17716]&~(1<>>0>>0)za();d=f+8|0;if((c[d>>2]|0)==(k|0))h=d;else za()}else h=f+8|0;c[e+12>>2]=f;c[h>>2]=e}while(0);if(m>>>0<16){c[n>>2]=l|o&1|2;o=a+l+4|0;c[o>>2]=c[o>>2]|1;return a|0}else{l=a+b|0;c[n>>2]=o&1|b|2;c[l+4>>2]=m|3;o=l+m+4|0;c[o>>2]=c[o>>2]|1;Tq(l,m);return a|0}return 0}function Tq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;o=a+b|0;d=c[a+4>>2]|0;do if(!(d&1)){g=c[a>>2]|0;if(!(d&3))return;l=a+(0-g)|0;k=g+b|0;i=c[17720]|0;if(l>>>0>>0)za();if((l|0)==(c[17721]|0)){a=o+4|0;d=c[a>>2]|0;if((d&3|0)!=3){r=l;f=k;break}c[17718]=k;c[a>>2]=d&-2;c[l+4>>2]=k|1;c[l+k>>2]=k;return}e=g>>>3;if(g>>>0<256){d=c[l+8>>2]|0;b=c[l+12>>2]|0;a=70904+(e<<1<<2)|0;if((d|0)!=(a|0)){if(d>>>0>>0)za();if((c[d+12>>2]|0)!=(l|0))za()}if((b|0)==(d|0)){c[17716]=c[17716]&~(1<>>0>>0)za();a=b+8|0;if((c[a>>2]|0)==(l|0))h=a;else za()}else h=b+8|0;c[d+12>>2]=b;c[h>>2]=d;r=l;f=k;break}g=c[l+24>>2]|0;b=c[l+12>>2]|0;do if((b|0)==(l|0)){b=l+16|0;d=b+4|0;a=c[d>>2]|0;if(!a){a=c[b>>2]|0;if(!a){j=0;break}else d=b}while(1){b=a+20|0;e=c[b>>2]|0;if(e|0){a=e;d=b;continue}b=a+16|0;e=c[b>>2]|0;if(!e)break;else{a=e;d=b}}if(d>>>0>>0)za();else{c[d>>2]=0;j=a;break}}else{e=c[l+8>>2]|0;if(e>>>0>>0)za();a=e+12|0;if((c[a>>2]|0)!=(l|0))za();d=b+8|0;if((c[d>>2]|0)==(l|0)){c[a>>2]=b;c[d>>2]=e;j=b;break}else za()}while(0);if(g){a=c[l+28>>2]|0;d=71168+(a<<2)|0;if((l|0)==(c[d>>2]|0)){c[d>>2]=j;if(!j){c[17717]=c[17717]&~(1<>>0<(c[17720]|0)>>>0)za();a=g+16|0;if((c[a>>2]|0)==(l|0))c[a>>2]=j;else c[g+20>>2]=j;if(!j){r=l;f=k;break}}b=c[17720]|0;if(j>>>0>>0)za();c[j+24>>2]=g;a=l+16|0;d=c[a>>2]|0;do if(d|0)if(d>>>0>>0)za();else{c[j+16>>2]=d;c[d+24>>2]=j;break}while(0);a=c[a+4>>2]|0;if(a)if(a>>>0<(c[17720]|0)>>>0)za();else{c[j+20>>2]=a;c[a+24>>2]=j;r=l;f=k;break}else{r=l;f=k}}else{r=l;f=k}}else{r=a;f=b}while(0);h=c[17720]|0;if(o>>>0>>0)za();a=o+4|0;d=c[a>>2]|0;if(!(d&2)){if((o|0)==(c[17722]|0)){q=(c[17719]|0)+f|0;c[17719]=q;c[17722]=r;c[r+4>>2]=q|1;if((r|0)!=(c[17721]|0))return;c[17721]=0;c[17718]=0;return}if((o|0)==(c[17721]|0)){q=(c[17718]|0)+f|0;c[17718]=q;c[17721]=r;c[r+4>>2]=q|1;c[r+q>>2]=q;return}f=(d&-8)+f|0;e=d>>>3;do if(d>>>0>=256){g=c[o+24>>2]|0;b=c[o+12>>2]|0;do if((b|0)==(o|0)){b=o+16|0;d=b+4|0;a=c[d>>2]|0;if(!a){a=c[b>>2]|0;if(!a){n=0;break}else d=b}while(1){b=a+20|0;e=c[b>>2]|0;if(e|0){a=e;d=b;continue}b=a+16|0;e=c[b>>2]|0;if(!e)break;else{a=e;d=b}}if(d>>>0>>0)za();else{c[d>>2]=0;n=a;break}}else{e=c[o+8>>2]|0;if(e>>>0>>0)za();a=e+12|0;if((c[a>>2]|0)!=(o|0))za();d=b+8|0;if((c[d>>2]|0)==(o|0)){c[a>>2]=b;c[d>>2]=e;n=b;break}else za()}while(0);if(g|0){a=c[o+28>>2]|0;d=71168+(a<<2)|0;if((o|0)==(c[d>>2]|0)){c[d>>2]=n;if(!n){c[17717]=c[17717]&~(1<>>0<(c[17720]|0)>>>0)za();a=g+16|0;if((c[a>>2]|0)==(o|0))c[a>>2]=n;else c[g+20>>2]=n;if(!n)break}b=c[17720]|0;if(n>>>0>>0)za();c[n+24>>2]=g;a=o+16|0;d=c[a>>2]|0;do if(d|0)if(d>>>0>>0)za();else{c[n+16>>2]=d;c[d+24>>2]=n;break}while(0);a=c[a+4>>2]|0;if(a|0)if(a>>>0<(c[17720]|0)>>>0)za();else{c[n+20>>2]=a;c[a+24>>2]=n;break}}}else{d=c[o+8>>2]|0;b=c[o+12>>2]|0;a=70904+(e<<1<<2)|0;if((d|0)!=(a|0)){if(d>>>0>>0)za();if((c[d+12>>2]|0)!=(o|0))za()}if((b|0)==(d|0)){c[17716]=c[17716]&~(1<>>0>>0)za();a=b+8|0;if((c[a>>2]|0)==(o|0))m=a;else za()}else m=b+8|0;c[d+12>>2]=b;c[m>>2]=d}while(0);c[r+4>>2]=f|1;c[r+f>>2]=f;if((r|0)==(c[17721]|0)){c[17718]=f;return}}else{c[a>>2]=d&-2;c[r+4>>2]=f|1;c[r+f>>2]=f}a=f>>>3;if(f>>>0<256){b=70904+(a<<1<<2)|0;d=c[17716]|0;a=1<>2]|0;if(d>>>0<(c[17720]|0)>>>0)za();else{p=d;q=a}}else{c[17716]=d|a;p=b;q=b+8|0}c[q>>2]=r;c[p+12>>2]=r;c[r+8>>2]=p;c[r+12>>2]=b;return}a=f>>>8;if(a)if(f>>>0>16777215)a=31;else{p=(a+1048320|0)>>>16&8;q=a<>>16&4;q=q<>>16&2;a=14-(o|p|a)+(q<>>15)|0;a=f>>>(a+7|0)&1|a<<1}else a=0;e=71168+(a<<2)|0;c[r+28>>2]=a;c[r+20>>2]=0;c[r+16>>2]=0;d=c[17717]|0;b=1<>2]=r;c[r+24>>2]=e;c[r+12>>2]=r;c[r+8>>2]=r;return}d=f<<((a|0)==31?0:25-(a>>>1)|0);e=c[e>>2]|0;while(1){if((c[e+4>>2]&-8|0)==(f|0)){a=127;break}b=e+16+(d>>>31<<2)|0;a=c[b>>2]|0;if(!a){a=124;break}else{d=d<<1;e=a}}if((a|0)==124){if(b>>>0<(c[17720]|0)>>>0)za();c[b>>2]=r;c[r+24>>2]=e;c[r+12>>2]=r;c[r+8>>2]=r;return}else if((a|0)==127){a=e+8|0;d=c[a>>2]|0;q=c[17720]|0;if(!(d>>>0>=q>>>0&e>>>0>=q>>>0))za();c[d+12>>2]=r;c[a>>2]=r;c[r+8>>2]=d;c[r+12>>2]=e;c[r+24>>2]=0;return}}function Uq(a,b){a=a|0;b=b|0;if(a>>>0<9){b=Oq(b)|0;return b|0}else{b=Vq(a,b)|0;return b|0}return 0}function Vq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;a=a>>>0<16?16:a;if(a+-1&a){d=16;while(1)if(d>>>0>>0)d=d<<1;else{a=d;break}}if((-64-a|0)>>>0<=b>>>0){c[(zo()|0)>>2]=12;h=0;return h|0}g=b>>>0<11?16:b+11&-8;d=Oq(g+12+a|0)|0;if(!d){h=0;return h|0}f=d+-8|0;do if(d&a+-1){i=(d+a+-1&0-a)+-8|0;e=f;a=(i-e|0)>>>0>15?i:i+a|0;e=a-e|0;d=d+-4|0;i=c[d>>2]|0;b=(i&-8)-e|0;if(!(i&3)){c[a>>2]=(c[f>>2]|0)+e;c[a+4>>2]=b;break}else{i=a+4|0;c[i>>2]=b|c[i>>2]&1|2;b=a+b+4|0;c[b>>2]=c[b>>2]|1;c[d>>2]=e|c[d>>2]&1|2;c[i>>2]=c[i>>2]|1;Tq(f,e);break}}else a=f;while(0);d=a+4|0;b=c[d>>2]|0;if(b&3|0?(h=b&-8,h>>>0>(g+16|0)>>>0):0){i=h-g|0;h=a+g|0;c[d>>2]=g|b&1|2;c[h+4>>2]=i|3;g=h+i+4|0;c[g>>2]=c[g>>2]|1;Tq(h,i)}i=a+8|0;return i|0}function Wq(){}function Xq(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;d=b-d-(c>>>0>a>>>0|0)>>>0;return (D=d,a-c>>>0|0)|0}function Yq(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;h=b+e|0;d=d&255;if((e|0)>=67){while(b&3){a[b>>0]=d;b=b+1|0}f=h&-4|0;g=f-64|0;i=d|d<<8|d<<16|d<<24;while((b|0)<=(g|0)){c[b>>2]=i;c[b+4>>2]=i;c[b+8>>2]=i;c[b+12>>2]=i;c[b+16>>2]=i;c[b+20>>2]=i;c[b+24>>2]=i;c[b+28>>2]=i;c[b+32>>2]=i;c[b+36>>2]=i;c[b+40>>2]=i;c[b+44>>2]=i;c[b+48>>2]=i;c[b+52>>2]=i;c[b+56>>2]=i;c[b+60>>2]=i;b=b+64|0}while((b|0)<(f|0)){c[b>>2]=i;b=b+4|0}}while((b|0)<(h|0)){a[b>>0]=d;b=b+1|0}return h-e|0}function Zq(a){a=a|0;return 0}function _q(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;c=a+c>>>0;return (D=b+d+(c>>>0>>0|0)>>>0,c|0)|0}function $q(b){b=b|0;var c=0;c=a[n+(b&255)>>0]|0;if((c|0)<8)return c|0;c=a[n+(b>>8&255)>>0]|0;if((c|0)<8)return c+8|0;c=a[n+(b>>16&255)>>0]|0;if((c|0)<8)return c+16|0;return (a[n+(b>>>24)>>0]|0)+24|0}function ar(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;l=a;j=b;k=j;h=d;n=e;i=n;if(!k){g=(f|0)!=0;if(!i){if(g){c[f>>2]=(l>>>0)%(h>>>0);c[f+4>>2]=0}n=0;f=(l>>>0)/(h>>>0)>>>0;return (D=n,f)|0}else{if(!g){n=0;f=0;return (D=n,f)|0}c[f>>2]=a|0;c[f+4>>2]=b&0;n=0;f=0;return (D=n,f)|0}}g=(i|0)==0;do if(h){if(!g){g=(V(i|0)|0)-(V(k|0)|0)|0;if(g>>>0<=31){m=g+1|0;i=31-g|0;b=g-31>>31;h=m;a=l>>>(m>>>0)&b|k<>>(m>>>0)&b;g=0;i=l<>2]=a|0;c[f+4>>2]=j|b&0;n=0;f=0;return (D=n,f)|0}g=h-1|0;if(g&h|0){i=(V(h|0)|0)+33-(V(k|0)|0)|0;p=64-i|0;m=32-i|0;j=m>>31;o=i-32|0;b=o>>31;h=i;a=m-1>>31&k>>>(o>>>0)|(k<>>(i>>>0))&b;b=b&k>>>(i>>>0);g=l<>>(o>>>0))&j|l<>31;break}if(f|0){c[f>>2]=g&l;c[f+4>>2]=0}if((h|0)==1){o=j|b&0;p=a|0|0;return (D=o,p)|0}else{p=$q(h|0)|0;o=k>>>(p>>>0)|0;p=k<<32-p|l>>>(p>>>0)|0;return (D=o,p)|0}}else{if(g){if(f|0){c[f>>2]=(k>>>0)%(h>>>0);c[f+4>>2]=0}o=0;p=(k>>>0)/(h>>>0)>>>0;return (D=o,p)|0}if(!l){if(f|0){c[f>>2]=0;c[f+4>>2]=(k>>>0)%(i>>>0)}o=0;p=(k>>>0)/(i>>>0)>>>0;return (D=o,p)|0}g=i-1|0;if(!(g&i)){if(f|0){c[f>>2]=a|0;c[f+4>>2]=g&k|b&0}o=0;p=k>>>(($q(i|0)|0)>>>0);return (D=o,p)|0}g=(V(i|0)|0)-(V(k|0)|0)|0;if(g>>>0<=30){b=g+1|0;i=31-g|0;h=b;a=k<>>(b>>>0);b=k>>>(b>>>0);g=0;i=l<>2]=a|0;c[f+4>>2]=j|b&0;o=0;p=0;return (D=o,p)|0}while(0);if(!h){k=i;j=0;i=0}else{m=d|0|0;l=n|e&0;k=_q(m|0,l|0,-1,-1)|0;d=D;j=i;i=0;do{e=j;j=g>>>31|j<<1;g=i|g<<1;e=a<<1|e>>>31|0;n=a>>>31|b<<1|0;Xq(k|0,d|0,e|0,n|0)|0;p=D;o=p>>31|((p|0)<0?-1:0)<<1;i=o&1;a=Xq(e|0,n|0,o&m|0,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&l|0)|0;b=D;h=h-1|0}while((h|0)!=0);k=j;j=0}h=0;if(f|0){c[f>>2]=a;c[f+4>>2]=b}o=(g|0)>>>31|(k|h)<<1|(h<<1|g>>>31)&0|j;p=(g<<1|0>>>31)&-2|i;return (D=o,p)|0}function br(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;j=b>>31|((b|0)<0?-1:0)<<1;i=((b|0)<0?-1:0)>>31|((b|0)<0?-1:0)<<1;f=d>>31|((d|0)<0?-1:0)<<1;e=((d|0)<0?-1:0)>>31|((d|0)<0?-1:0)<<1;h=Xq(j^a|0,i^b|0,j|0,i|0)|0;g=D;a=f^j;b=e^i;return Xq((ar(h,g,Xq(f^c|0,e^d|0,f|0,e|0)|0,D,0)|0)^a|0,D^b|0,a|0,b|0)|0}function cr(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;if((e|0)>=8192)return Sa(b|0,d|0,e|0)|0;h=b|0;g=b+e|0;if((b&3)==(d&3)){while(b&3){if(!e)return h|0;a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0;e=e-1|0}e=g&-4|0;f=e-64|0;while((b|0)<=(f|0)){c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];c[b+16>>2]=c[d+16>>2];c[b+20>>2]=c[d+20>>2];c[b+24>>2]=c[d+24>>2];c[b+28>>2]=c[d+28>>2];c[b+32>>2]=c[d+32>>2];c[b+36>>2]=c[d+36>>2];c[b+40>>2]=c[d+40>>2];c[b+44>>2]=c[d+44>>2];c[b+48>>2]=c[d+48>>2];c[b+52>>2]=c[d+52>>2];c[b+56>>2]=c[d+56>>2];c[b+60>>2]=c[d+60>>2];b=b+64|0;d=d+64|0}while((b|0)<(e|0)){c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0}}else{e=g-4|0;while((b|0)<(e|0)){a[b>>0]=a[d>>0]|0;a[b+1>>0]=a[d+1>>0]|0;a[b+2>>0]=a[d+2>>0]|0;a[b+3>>0]=a[d+3>>0]|0;b=b+4|0;d=d+4|0}}while((b|0)<(g|0)){a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0}return h|0}function dr(b,c,d){b=b|0;c=c|0;d=d|0;var e=0;if((c|0)<(b|0)&(b|0)<(c+d|0)){e=b;c=c+d|0;b=b+d|0;while((d|0)>0){b=b-1|0;c=c-1|0;d=d-1|0;a[b>>0]=a[c>>0]|0}b=e}else cr(b,c,d)|0;return b|0}function er(a){a=a|0;return (a&255)<<24|(a>>8&255)<<16|(a>>16&255)<<8|a>>>24|0}function fr(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){D=b>>c;return a>>>c|(b&(1<>c-32|0}function gr(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){D=b>>>c;return a>>>c|(b&(1<>>c-32|0}function hr(a){a=a|0;return 0}function ir(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return ar(a,b,c,d,0)|0}function jr(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;f=a&65535;e=b&65535;c=S(e,f)|0;d=a>>>16;a=(c>>>16)+(S(e,d)|0)|0;e=b>>>16;b=S(e,f)|0;return (D=(a>>>16)+(S(e,d)|0)+(((a&65535)+b|0)>>>16)|0,a+b<<16|c&65535|0)|0}function kr(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=a;f=c;c=jr(e,f)|0;a=D;return (D=(S(b,f)|0)+(S(d,e)|0)+a|a&0,c|0|0)|0}function lr(a){a=a|0;var b=0,d=0;d=a+15&-16|0;b=c[i>>2]|0;a=b+d|0;if((d|0)>0&(a|0)<(b|0)|(a|0)<0){_()|0;Ia(12);return -1}c[i>>2]=a;if((a|0)>(Z()|0)?(Y()|0)==0:0){Ia(12);c[i>>2]=b;return -1}return b|0}function mr(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){D=b<>>32-c;return a<>2]|0,c[f>>2]|0)|0}function or(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;f=l;l=l+16|0;i=f|0;h=b>>31|((b|0)<0?-1:0)<<1;g=((b|0)<0?-1:0)>>31|((b|0)<0?-1:0)<<1;k=e>>31|((e|0)<0?-1:0)<<1;j=((e|0)<0?-1:0)>>31|((e|0)<0?-1:0)<<1;a=Xq(h^a|0,g^b|0,h|0,g|0)|0;b=D;ar(a,b,Xq(k^d|0,j^e|0,k|0,j|0)|0,D,i)|0;e=Xq(c[i>>2]^h|0,c[i+4>>2]^g|0,h|0,g|0)|0;d=D;l=f;return (D=d,e)|0}function pr(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return pb[a&63](b|0,c|0,d|0)|0}function qr(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;qb[a&15](b|0,c|0,d|0,e|0,f|0)}function rr(a,b){a=a|0;b=b|0;rb[a&7](b|0)}function sr(a,b,c){a=a|0;b=b|0;c=c|0;sb[a&7](b|0,c|0)}function tr(a,b){a=a|0;b=b|0;return tb[a&15](b|0)|0}function ur(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;ub[a&7](b|0,c|0,d|0)}function vr(a){a=a|0;vb[a&3]()}function wr(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return wb[a&3](b|0,c|0,d|0,e|0)|0}function xr(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;xb[a&1](b|0,c|0,d|0,e|0,f|0,g|0)}function yr(a,b,c){a=a|0;b=b|0;c=c|0;return yb[a&7](b|0,c|0)|0}function zr(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;zb[a&1](b|0,c|0,d|0,e|0)}function Ar(a,b,c){a=a|0;b=b|0;c=c|0;aa(0);return 0}function Br(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;ba(1)}function Cr(a){a=a|0;ca(2)}function Dr(a,b){a=a|0;b=b|0;da(3)}function Er(a){a=a|0;ea(4);return 0}function Fr(a,b,c){a=a|0;b=b|0;c=c|0;fa(5)}function Gr(){ga(6)}function Hr(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;ha(7);return 0}function Ir(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;ia(8)}function Jr(a,b){a=a|0;b=b|0;ja(9);return 0}function Kr(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;ka(10)} // EMSCRIPTEN_END_FUNCS -var ub=[xx,ck,dk,ek,fk,ql,rl,sl,tl,vl,Ql,am,qm,Dm,Em,Fm,zr,Ar,Br,Cr,Er,Uh,Wr,uu,vu,yu,fv,Ue,Fv,vk,wk,Xk,Tl,em,um,Bu,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx];var vb=[yx,Kk,Ek,Hk,Ik,Ok,Sm,Pm,Tm,yx,yx,yx,yx,yx,yx,yx];var wb=[zx,Uk,Ol,_l,om,Hn,zu,Cu,iw,zx,zx,zx,zx,zx,zx,zx];var xb=[Ax,Tk,Nl,Zl,mm,nm,Cm,Vr];var yb=[Bx,Vk,pl,ul,Pl,$l,pm,yr,Dr,Zh,tu,Bx,Bx,Bx,Bx,Bx];var zb=[Cx,Nr,Sk,hs,Vs,jt,ru,Cx];var Ab=[Dx,pk,qk,Tt];var Bb=[Ex,Xr,Nq,es,nt,Ex,Ex,Ex];var Cb=[Fx,Mk];var Db=[Gx,ol,wl,xr,Fr,Oj,Jl,Gx];var Eb=[Hx,nh];return{_GNUNET_CRYPTO_rsa_signature_encode:ed,_GNUNET_CRYPTO_rsa_private_key_free:Yc,_GNUNET_CRYPTO_rsa_verify:pd,_bitshift64Shl:ix,_GNUNET_CRYPTO_hash_context_start:Dc,_bitshift64Lshr:cx,_TALER_setup_fresh_coin:su,_GNUNET_STRINGS_string_to_data:td,_GNUNET_CRYPTO_rsa_private_key_get_public:$c,_memset:Uw,_GNUNET_CRYPTO_eddsa_verify:yc,_TALER_amount_normalize:mu,_GNUNET_CRYPTO_hash_context_finish:Fc,_GNUNET_CRYPTO_symmetric_encrypt:ic,_TALER_WR_get_fraction:Sb,_GNUNET_CRYPTO_hash_context_read:Ec,_TALER_amount_cmp:lu,_GNUNET_CRYPTO_rsa_blind:fd,_TALER_WR_get_currency:Tb,_GNUNET_CRYPTO_random_block:Wc,_fflush:Rv,_GNUNET_CRYPTO_hash_create_random:Cc,_GNUNET_CRYPTO_rsa_unblind:od,_bitshift64Ashr:bx,_TALER_WRALL_get_amount:Qb,_sbrk:hx,_GNUNET_CRYPTO_eddsa_key_create:vc,_TALER_WRALL_eddsa_public_key_from_private:Mb,_llvm_bswap_i32:ax,___muldi3:gx,_GNUNET_CRYPTO_ecc_ecdh:zc,_memalign:Qw,_GNUNET_CRYPTO_rsa_private_key_decode:_c,_GNUNET_CRYPTO_symmetric_decrypt:lc,_GNUNET_CRYPTO_rsa_signature_free:md,___divdi3:Zw,_TALER_amount_ntoh:hu,_pthread_self:kx,_GNUNET_CRYPTO_ecdhe_key_create:sc,_TALER_amount_subtract:ou,___udivmoddi4:Yw,_GNUNET_CRYPTO_rsa_private_key_create:Xc,_i64Add:Ww,_GNUNET_CRYPTO_ecdhe_key_get_public:qc,_TALER_WRALL_purpose_create:Pb,_GNUNET_CRYPTO_ecdh_eddsa:Ac,_pthread_mutex_unlock:dx,_GNUNET_CRYPTO_rsa_public_key_free:bd,_GNUNET_CRYPTO_kdf:Mc,_GNUNET_CRYPTO_eddsa_sign:wc,_TALER_amount_hton:gu,_i64Subtract:Tw,_pthread_mutex_lock:Vw,_GNUNET_CRYPTO_rsa_private_key_encode:Zc,_GNUNET_CRYPTO_eddsa_key_get_public:oc,___udivdi3:ex,_TALER_amount_add:pu,___errno_location:xu,___muldsi3:fx,_TALER_WR_get_value:Rb,_TALER_WRALL_ecdhe_public_key_from_private:Ob,_free:Lw,_GNUNET_STRINGS_data_to_string_alloc:sd,_GNUNET_CRYPTO_hash_context_abort:Gc,_memmove:$w,_llvm_cttz_i32:Xw,_malloc:Kw,_memcpy:_w,_TALER_amount_get_zero:iu,_GNUNET_CRYPTO_hkdf:Kc,_GNUNET_CRYPTO_rsa_public_key_decode:dd,_GNUNET_CRYPTO_ecdsa_key_create:uc,_TALER_WRALL_ecdsa_public_key_from_private:Nb,_GNUNET_CRYPTO_rsa_public_key_encode:cd,___remdi3:lx,_GNUNET_CRYPTO_hash:Bc,_GNUNET_CRYPTO_rsa_signature_decode:nd,___uremdi3:jx,_GNUNET_util_cl_init:Yb,_GNUNET_CRYPTO_random_init:Rc,_gpg_err_init:At,_TALER_gcrypt_init:qu,runPostSets:Sw,stackAlloc:Fb,stackSave:Gb,stackRestore:Hb,establishStackSpace:Ib,setThrew:Jb,setTempRet0:Kb,getTempRet0:Lb,dynCall_iiii:mx,dynCall_viiiii:nx,dynCall_vi:ox,dynCall_vii:px,dynCall_ii:qx,dynCall_viii:rx,dynCall_v:sx,dynCall_iiiii:tx,dynCall_viiiiii:ux,dynCall_iii:vx,dynCall_viiii:wx}}) +var pb=[Ar,Yh,Zh,_h,$h,Gi,Hi,Ii,Ji,Li,Ti,_i,ej,hj,ij,jj,Bm,Cm,Dm,Em,Gm,Gg,Nm,wo,xo,Bo,Ap,Ke,Rp,gi,hi,ri,Ui,$i,fj,Do,Ar,Ar,Ar,Ar,Ar,Ar,Ar,Ar,Ar,Ar,Ar,Ar,Ar,Ar,Ar,Ar,Ar,Ar,Ar,Ar,Ar,Ar,Ar,Ar,Ar,Ar,Ar,Ar];var qb=[Br,ki,fi,ei,di,mi,mj,nj,lj,Br,Br,Br,Br,Br,Br,Br];var rb=[Cr,pi,Ri,Yi,cj,Xj,sq,Cr];var sb=[Dr,oi,Qi,Xi,aj,bj,gj,Mm];var tb=[Er,qi,Fi,Ki,Si,Zi,dj,Am,Fm,Jg,vo,Er,Er,Er,Er,Er];var ub=[Fr,Jm,ni,$m,qn,zn,to,Fr];var vb=[Gr,ii,ji,eo];var wb=[Hr,Om,jm,Dn];var xb=[Ir,li];var yb=[Jr,Ei,Mi,zm,Hm,Mh,Pi,Jr];var zb=[Kr,og];return{_GNUNET_CRYPTO_rsa_signature_encode:$c,_GNUNET_CRYPTO_rsa_private_key_free:Tc,_GNUNET_CRYPTO_rsa_verify:kd,_bitshift64Shl:mr,_GNUNET_CRYPTO_hash_context_start:yc,_bitshift64Lshr:gr,_TALER_setup_fresh_coin:uo,_GNUNET_STRINGS_string_to_data:od,_GNUNET_CRYPTO_rsa_private_key_get_public:Wc,_memset:Yq,_GNUNET_CRYPTO_eddsa_verify:tc,_TALER_amount_normalize:po,_GNUNET_CRYPTO_hash_context_finish:Ac,_GNUNET_CRYPTO_symmetric_encrypt:dc,_TALER_WR_get_fraction:Nb,_GNUNET_CRYPTO_hash_context_read:zc,_TALER_amount_cmp:oo,_GNUNET_CRYPTO_rsa_blind:ad,_TALER_WR_get_currency:Ob,_GNUNET_CRYPTO_random_block:Rc,_fflush:$p,_GNUNET_CRYPTO_hash_create_random:xc,_GNUNET_CRYPTO_rsa_unblind:jd,_bitshift64Ashr:fr,_TALER_WRALL_get_amount:Lb,_sbrk:lr,_GNUNET_CRYPTO_eddsa_key_create:qc,_TALER_WRALL_eddsa_public_key_from_private:Hb,_llvm_bswap_i32:er,___muldi3:kr,_GNUNET_CRYPTO_ecc_ecdh:uc,_memalign:Uq,_GNUNET_CRYPTO_rsa_private_key_decode:Vc,_GNUNET_CRYPTO_symmetric_decrypt:gc,_GNUNET_CRYPTO_rsa_signature_free:hd,___divdi3:br,_TALER_amount_ntoh:mo,_llvm_cttz_i32:$q,_GNUNET_CRYPTO_ecdhe_key_create:nc,_TALER_amount_subtract:qo,___udivmoddi4:ar,_GNUNET_CRYPTO_rsa_private_key_create:Sc,_i64Add:_q,_GNUNET_CRYPTO_ecdhe_key_get_public:lc,_TALER_WRALL_purpose_create:Kb,_GNUNET_CRYPTO_ecdh_eddsa:vc,_pthread_mutex_unlock:hr,_GNUNET_CRYPTO_rsa_public_key_free:Yc,_GNUNET_CRYPTO_kdf:Hc,_emscripten_get_global_libc:Eo,_GNUNET_CRYPTO_eddsa_sign:rc,_TALER_amount_hton:lo,_i64Subtract:Xq,_pthread_mutex_lock:Zq,_GNUNET_CRYPTO_rsa_private_key_encode:Uc,_GNUNET_CRYPTO_eddsa_key_get_public:jc,___udivdi3:ir,_TALER_amount_add:ro,___errno_location:zo,___muldsi3:jr,_TALER_WR_get_value:Mb,_TALER_WRALL_ecdhe_public_key_from_private:Jb,_free:Pq,_GNUNET_STRINGS_data_to_string_alloc:nd,_GNUNET_CRYPTO_hash_context_abort:Bc,_memmove:dr,_malloc:Oq,_memcpy:cr,_TALER_amount_get_zero:no,_GNUNET_CRYPTO_hkdf:Fc,_GNUNET_CRYPTO_rsa_public_key_decode:_c,_GNUNET_CRYPTO_ecdsa_key_create:pc,_TALER_WRALL_ecdsa_public_key_from_private:Ib,_GNUNET_CRYPTO_rsa_public_key_encode:Zc,___remdi3:or,_GNUNET_CRYPTO_hash:wc,_GNUNET_CRYPTO_rsa_signature_decode:id,___uremdi3:nr,_GNUNET_util_cl_init:Tb,_GNUNET_CRYPTO_random_init:Mc,_gpg_err_init:On,_TALER_gcrypt_init:so,runPostSets:Wq,stackAlloc:Ab,stackSave:Bb,stackRestore:Cb,establishStackSpace:Db,setTempRet0:Fb,getTempRet0:Gb,setThrew:Eb,stackAlloc:Ab,stackSave:Bb,stackRestore:Cb,establishStackSpace:Db,setThrew:Eb,setTempRet0:Fb,getTempRet0:Gb,dynCall_iiii:pr,dynCall_viiiii:qr,dynCall_vi:rr,dynCall_vii:sr,dynCall_ii:tr,dynCall_viii:ur,dynCall_v:vr,dynCall_iiiii:wr,dynCall_viiiiii:xr,dynCall_iii:yr,dynCall_viiii:zr}}) // EMSCRIPTEN_END_ASM -(Module.asmGlobalArg,Module.asmLibraryArg,buffer);var real__GNUNET_CRYPTO_rsa_signature_encode=asm["_GNUNET_CRYPTO_rsa_signature_encode"];asm["_GNUNET_CRYPTO_rsa_signature_encode"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_signature_encode.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_verify=asm["_GNUNET_CRYPTO_rsa_verify"];asm["_GNUNET_CRYPTO_rsa_verify"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_verify.apply(null,arguments)});var real__GNUNET_CRYPTO_hash_context_start=asm["_GNUNET_CRYPTO_hash_context_start"];asm["_GNUNET_CRYPTO_hash_context_start"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_hash_context_start.apply(null,arguments)});var real____uremdi3=asm["___uremdi3"];asm["___uremdi3"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____uremdi3.apply(null,arguments)});var real__TALER_setup_fresh_coin=asm["_TALER_setup_fresh_coin"];asm["_TALER_setup_fresh_coin"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_setup_fresh_coin.apply(null,arguments)});var real__GNUNET_STRINGS_string_to_data=asm["_GNUNET_STRINGS_string_to_data"];asm["_GNUNET_STRINGS_string_to_data"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_STRINGS_string_to_data.apply(null,arguments)});var real__i64Subtract=asm["_i64Subtract"];asm["_i64Subtract"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__i64Subtract.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_private_key_get_public=asm["_GNUNET_CRYPTO_rsa_private_key_get_public"];asm["_GNUNET_CRYPTO_rsa_private_key_get_public"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_private_key_get_public.apply(null,arguments)});var real__TALER_WRALL_get_amount=asm["_TALER_WRALL_get_amount"];asm["_TALER_WRALL_get_amount"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_WRALL_get_amount.apply(null,arguments)});var real__GNUNET_CRYPTO_eddsa_verify=asm["_GNUNET_CRYPTO_eddsa_verify"];asm["_GNUNET_CRYPTO_eddsa_verify"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_eddsa_verify.apply(null,arguments)});var real__GNUNET_util_cl_init=asm["_GNUNET_util_cl_init"];asm["_GNUNET_util_cl_init"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_util_cl_init.apply(null,arguments)});var real__TALER_amount_normalize=asm["_TALER_amount_normalize"];asm["_TALER_amount_normalize"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_amount_normalize.apply(null,arguments)});var real__GNUNET_CRYPTO_hash_context_finish=asm["_GNUNET_CRYPTO_hash_context_finish"];asm["_GNUNET_CRYPTO_hash_context_finish"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_hash_context_finish.apply(null,arguments)});var real__bitshift64Lshr=asm["_bitshift64Lshr"];asm["_bitshift64Lshr"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__bitshift64Lshr.apply(null,arguments)});var real__TALER_WR_get_fraction=asm["_TALER_WR_get_fraction"];asm["_TALER_WR_get_fraction"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_WR_get_fraction.apply(null,arguments)});var real__GNUNET_CRYPTO_hash_context_read=asm["_GNUNET_CRYPTO_hash_context_read"];asm["_GNUNET_CRYPTO_hash_context_read"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_hash_context_read.apply(null,arguments)});var real__TALER_amount_cmp=asm["_TALER_amount_cmp"];asm["_TALER_amount_cmp"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_amount_cmp.apply(null,arguments)});var real__bitshift64Shl=asm["_bitshift64Shl"];asm["_bitshift64Shl"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__bitshift64Shl.apply(null,arguments)});var real__TALER_WR_get_currency=asm["_TALER_WR_get_currency"];asm["_TALER_WR_get_currency"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_WR_get_currency.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_private_key_free=asm["_GNUNET_CRYPTO_rsa_private_key_free"];asm["_GNUNET_CRYPTO_rsa_private_key_free"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_private_key_free.apply(null,arguments)});var real__fflush=asm["_fflush"];asm["_fflush"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__fflush.apply(null,arguments)});var real__GNUNET_CRYPTO_hash_create_random=asm["_GNUNET_CRYPTO_hash_create_random"];asm["_GNUNET_CRYPTO_hash_create_random"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_hash_create_random.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_unblind=asm["_GNUNET_CRYPTO_rsa_unblind"];asm["_GNUNET_CRYPTO_rsa_unblind"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_unblind.apply(null,arguments)});var real__bitshift64Ashr=asm["_bitshift64Ashr"];asm["_bitshift64Ashr"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__bitshift64Ashr.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_private_key_create=asm["_GNUNET_CRYPTO_rsa_private_key_create"];asm["_GNUNET_CRYPTO_rsa_private_key_create"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_private_key_create.apply(null,arguments)});var real__sbrk=asm["_sbrk"];asm["_sbrk"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__sbrk.apply(null,arguments)});var real__GNUNET_CRYPTO_eddsa_key_create=asm["_GNUNET_CRYPTO_eddsa_key_create"];asm["_GNUNET_CRYPTO_eddsa_key_create"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_eddsa_key_create.apply(null,arguments)});var real__TALER_WRALL_eddsa_public_key_from_private=asm["_TALER_WRALL_eddsa_public_key_from_private"];asm["_TALER_WRALL_eddsa_public_key_from_private"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_WRALL_eddsa_public_key_from_private.apply(null,arguments)});var real____errno_location=asm["___errno_location"];asm["___errno_location"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____errno_location.apply(null,arguments)});var real____muldi3=asm["___muldi3"];asm["___muldi3"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____muldi3.apply(null,arguments)});var real__GNUNET_CRYPTO_ecc_ecdh=asm["_GNUNET_CRYPTO_ecc_ecdh"];asm["_GNUNET_CRYPTO_ecc_ecdh"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_ecc_ecdh.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_public_key_decode=asm["_GNUNET_CRYPTO_rsa_public_key_decode"];asm["_GNUNET_CRYPTO_rsa_public_key_decode"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_public_key_decode.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_private_key_decode=asm["_GNUNET_CRYPTO_rsa_private_key_decode"];asm["_GNUNET_CRYPTO_rsa_private_key_decode"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_private_key_decode.apply(null,arguments)});var real__GNUNET_CRYPTO_symmetric_encrypt=asm["_GNUNET_CRYPTO_symmetric_encrypt"];asm["_GNUNET_CRYPTO_symmetric_encrypt"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_symmetric_encrypt.apply(null,arguments)});var real__GNUNET_CRYPTO_ecdhe_key_get_public=asm["_GNUNET_CRYPTO_ecdhe_key_get_public"];asm["_GNUNET_CRYPTO_ecdhe_key_get_public"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_ecdhe_key_get_public.apply(null,arguments)});var real____divdi3=asm["___divdi3"];asm["___divdi3"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____divdi3.apply(null,arguments)});var real__TALER_amount_ntoh=asm["_TALER_amount_ntoh"];asm["_TALER_amount_ntoh"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_amount_ntoh.apply(null,arguments)});var real__llvm_cttz_i32=asm["_llvm_cttz_i32"];asm["_llvm_cttz_i32"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__llvm_cttz_i32.apply(null,arguments)});var real__GNUNET_CRYPTO_ecdhe_key_create=asm["_GNUNET_CRYPTO_ecdhe_key_create"];asm["_GNUNET_CRYPTO_ecdhe_key_create"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_ecdhe_key_create.apply(null,arguments)});var real__TALER_amount_subtract=asm["_TALER_amount_subtract"];asm["_TALER_amount_subtract"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_amount_subtract.apply(null,arguments)});var real____udivmoddi4=asm["___udivmoddi4"];asm["___udivmoddi4"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____udivmoddi4.apply(null,arguments)});var real__GNUNET_CRYPTO_random_block=asm["_GNUNET_CRYPTO_random_block"];asm["_GNUNET_CRYPTO_random_block"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_random_block.apply(null,arguments)});var real__i64Add=asm["_i64Add"];asm["_i64Add"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__i64Add.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_signature_free=asm["_GNUNET_CRYPTO_rsa_signature_free"];asm["_GNUNET_CRYPTO_rsa_signature_free"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_signature_free.apply(null,arguments)});var real__pthread_self=asm["_pthread_self"];asm["_pthread_self"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__pthread_self.apply(null,arguments)});var real__GNUNET_CRYPTO_ecdh_eddsa=asm["_GNUNET_CRYPTO_ecdh_eddsa"];asm["_GNUNET_CRYPTO_ecdh_eddsa"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_ecdh_eddsa.apply(null,arguments)});var real__pthread_mutex_unlock=asm["_pthread_mutex_unlock"];asm["_pthread_mutex_unlock"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__pthread_mutex_unlock.apply(null,arguments)});var real__TALER_WRALL_purpose_create=asm["_TALER_WRALL_purpose_create"];asm["_TALER_WRALL_purpose_create"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_WRALL_purpose_create.apply(null,arguments)});var real__gpg_err_init=asm["_gpg_err_init"];asm["_gpg_err_init"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__gpg_err_init.apply(null,arguments)});var real__GNUNET_CRYPTO_kdf=asm["_GNUNET_CRYPTO_kdf"];asm["_GNUNET_CRYPTO_kdf"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_kdf.apply(null,arguments)});var real__GNUNET_CRYPTO_eddsa_sign=asm["_GNUNET_CRYPTO_eddsa_sign"];asm["_GNUNET_CRYPTO_eddsa_sign"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_eddsa_sign.apply(null,arguments)});var real__TALER_amount_hton=asm["_TALER_amount_hton"];asm["_TALER_amount_hton"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_amount_hton.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_public_key_free=asm["_GNUNET_CRYPTO_rsa_public_key_free"];asm["_GNUNET_CRYPTO_rsa_public_key_free"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_public_key_free.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_private_key_encode=asm["_GNUNET_CRYPTO_rsa_private_key_encode"];asm["_GNUNET_CRYPTO_rsa_private_key_encode"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_private_key_encode.apply(null,arguments)});var real__GNUNET_CRYPTO_eddsa_key_get_public=asm["_GNUNET_CRYPTO_eddsa_key_get_public"];asm["_GNUNET_CRYPTO_eddsa_key_get_public"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_eddsa_key_get_public.apply(null,arguments)});var real____udivdi3=asm["___udivdi3"];asm["___udivdi3"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____udivdi3.apply(null,arguments)});var real__llvm_bswap_i32=asm["_llvm_bswap_i32"];asm["_llvm_bswap_i32"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__llvm_bswap_i32.apply(null,arguments)});var real____muldsi3=asm["___muldsi3"];asm["___muldsi3"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____muldsi3.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_blind=asm["_GNUNET_CRYPTO_rsa_blind"];asm["_GNUNET_CRYPTO_rsa_blind"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_blind.apply(null,arguments)});var real__TALER_amount_add=asm["_TALER_amount_add"];asm["_TALER_amount_add"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_amount_add.apply(null,arguments)});var real__free=asm["_free"];asm["_free"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__free.apply(null,arguments)});var real__TALER_gcrypt_init=asm["_TALER_gcrypt_init"];asm["_TALER_gcrypt_init"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_gcrypt_init.apply(null,arguments)});var real__GNUNET_STRINGS_data_to_string_alloc=asm["_GNUNET_STRINGS_data_to_string_alloc"];asm["_GNUNET_STRINGS_data_to_string_alloc"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_STRINGS_data_to_string_alloc.apply(null,arguments)});var real__GNUNET_CRYPTO_hash_context_abort=asm["_GNUNET_CRYPTO_hash_context_abort"];asm["_GNUNET_CRYPTO_hash_context_abort"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_hash_context_abort.apply(null,arguments)});var real__GNUNET_CRYPTO_symmetric_decrypt=asm["_GNUNET_CRYPTO_symmetric_decrypt"];asm["_GNUNET_CRYPTO_symmetric_decrypt"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_symmetric_decrypt.apply(null,arguments)});var real__GNUNET_CRYPTO_random_init=asm["_GNUNET_CRYPTO_random_init"];asm["_GNUNET_CRYPTO_random_init"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_random_init.apply(null,arguments)});var real__TALER_amount_get_zero=asm["_TALER_amount_get_zero"];asm["_TALER_amount_get_zero"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_amount_get_zero.apply(null,arguments)});var real__malloc=asm["_malloc"];asm["_malloc"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__malloc.apply(null,arguments)});var real__pthread_mutex_lock=asm["_pthread_mutex_lock"];asm["_pthread_mutex_lock"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__pthread_mutex_lock.apply(null,arguments)});var real__GNUNET_CRYPTO_hkdf=asm["_GNUNET_CRYPTO_hkdf"];asm["_GNUNET_CRYPTO_hkdf"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_hkdf.apply(null,arguments)});var real__memalign=asm["_memalign"];asm["_memalign"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__memalign.apply(null,arguments)});var real__GNUNET_CRYPTO_ecdsa_key_create=asm["_GNUNET_CRYPTO_ecdsa_key_create"];asm["_GNUNET_CRYPTO_ecdsa_key_create"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_ecdsa_key_create.apply(null,arguments)});var real__TALER_WRALL_ecdsa_public_key_from_private=asm["_TALER_WRALL_ecdsa_public_key_from_private"];asm["_TALER_WRALL_ecdsa_public_key_from_private"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_WRALL_ecdsa_public_key_from_private.apply(null,arguments)});var real__memmove=asm["_memmove"];asm["_memmove"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__memmove.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_public_key_encode=asm["_GNUNET_CRYPTO_rsa_public_key_encode"];asm["_GNUNET_CRYPTO_rsa_public_key_encode"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_public_key_encode.apply(null,arguments)});var real____remdi3=asm["___remdi3"];asm["___remdi3"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____remdi3.apply(null,arguments)});var real__GNUNET_CRYPTO_hash=asm["_GNUNET_CRYPTO_hash"];asm["_GNUNET_CRYPTO_hash"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_hash.apply(null,arguments)});var real__TALER_WR_get_value=asm["_TALER_WR_get_value"];asm["_TALER_WR_get_value"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_WR_get_value.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_signature_decode=asm["_GNUNET_CRYPTO_rsa_signature_decode"];asm["_GNUNET_CRYPTO_rsa_signature_decode"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_signature_decode.apply(null,arguments)});var real__TALER_WRALL_ecdhe_public_key_from_private=asm["_TALER_WRALL_ecdhe_public_key_from_private"];asm["_TALER_WRALL_ecdhe_public_key_from_private"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_WRALL_ecdhe_public_key_from_private.apply(null,arguments)});var _GNUNET_CRYPTO_rsa_signature_encode=Module["_GNUNET_CRYPTO_rsa_signature_encode"]=asm["_GNUNET_CRYPTO_rsa_signature_encode"];var _GNUNET_CRYPTO_rsa_verify=Module["_GNUNET_CRYPTO_rsa_verify"]=asm["_GNUNET_CRYPTO_rsa_verify"];var _GNUNET_CRYPTO_hash_context_start=Module["_GNUNET_CRYPTO_hash_context_start"]=asm["_GNUNET_CRYPTO_hash_context_start"];var ___uremdi3=Module["___uremdi3"]=asm["___uremdi3"];var _TALER_setup_fresh_coin=Module["_TALER_setup_fresh_coin"]=asm["_TALER_setup_fresh_coin"];var _GNUNET_STRINGS_string_to_data=Module["_GNUNET_STRINGS_string_to_data"]=asm["_GNUNET_STRINGS_string_to_data"];var _i64Subtract=Module["_i64Subtract"]=asm["_i64Subtract"];var _GNUNET_CRYPTO_rsa_private_key_get_public=Module["_GNUNET_CRYPTO_rsa_private_key_get_public"]=asm["_GNUNET_CRYPTO_rsa_private_key_get_public"];var _TALER_WRALL_get_amount=Module["_TALER_WRALL_get_amount"]=asm["_TALER_WRALL_get_amount"];var _GNUNET_CRYPTO_eddsa_verify=Module["_GNUNET_CRYPTO_eddsa_verify"]=asm["_GNUNET_CRYPTO_eddsa_verify"];var _GNUNET_util_cl_init=Module["_GNUNET_util_cl_init"]=asm["_GNUNET_util_cl_init"];var _TALER_amount_normalize=Module["_TALER_amount_normalize"]=asm["_TALER_amount_normalize"];var _GNUNET_CRYPTO_hash_context_finish=Module["_GNUNET_CRYPTO_hash_context_finish"]=asm["_GNUNET_CRYPTO_hash_context_finish"];var _bitshift64Lshr=Module["_bitshift64Lshr"]=asm["_bitshift64Lshr"];var _TALER_WR_get_fraction=Module["_TALER_WR_get_fraction"]=asm["_TALER_WR_get_fraction"];var _GNUNET_CRYPTO_hash_context_read=Module["_GNUNET_CRYPTO_hash_context_read"]=asm["_GNUNET_CRYPTO_hash_context_read"];var _TALER_amount_cmp=Module["_TALER_amount_cmp"]=asm["_TALER_amount_cmp"];var _bitshift64Shl=Module["_bitshift64Shl"]=asm["_bitshift64Shl"];var _TALER_WR_get_currency=Module["_TALER_WR_get_currency"]=asm["_TALER_WR_get_currency"];var _GNUNET_CRYPTO_rsa_private_key_free=Module["_GNUNET_CRYPTO_rsa_private_key_free"]=asm["_GNUNET_CRYPTO_rsa_private_key_free"];var _fflush=Module["_fflush"]=asm["_fflush"];var _GNUNET_CRYPTO_hash_create_random=Module["_GNUNET_CRYPTO_hash_create_random"]=asm["_GNUNET_CRYPTO_hash_create_random"];var _GNUNET_CRYPTO_rsa_unblind=Module["_GNUNET_CRYPTO_rsa_unblind"]=asm["_GNUNET_CRYPTO_rsa_unblind"];var _bitshift64Ashr=Module["_bitshift64Ashr"]=asm["_bitshift64Ashr"];var _memset=Module["_memset"]=asm["_memset"];var _GNUNET_CRYPTO_rsa_private_key_create=Module["_GNUNET_CRYPTO_rsa_private_key_create"]=asm["_GNUNET_CRYPTO_rsa_private_key_create"];var _sbrk=Module["_sbrk"]=asm["_sbrk"];var _GNUNET_CRYPTO_eddsa_key_create=Module["_GNUNET_CRYPTO_eddsa_key_create"]=asm["_GNUNET_CRYPTO_eddsa_key_create"];var _TALER_WRALL_eddsa_public_key_from_private=Module["_TALER_WRALL_eddsa_public_key_from_private"]=asm["_TALER_WRALL_eddsa_public_key_from_private"];var ___errno_location=Module["___errno_location"]=asm["___errno_location"];var ___muldi3=Module["___muldi3"]=asm["___muldi3"];var _GNUNET_CRYPTO_ecc_ecdh=Module["_GNUNET_CRYPTO_ecc_ecdh"]=asm["_GNUNET_CRYPTO_ecc_ecdh"];var _GNUNET_CRYPTO_rsa_public_key_decode=Module["_GNUNET_CRYPTO_rsa_public_key_decode"]=asm["_GNUNET_CRYPTO_rsa_public_key_decode"];var _GNUNET_CRYPTO_rsa_private_key_decode=Module["_GNUNET_CRYPTO_rsa_private_key_decode"]=asm["_GNUNET_CRYPTO_rsa_private_key_decode"];var _GNUNET_CRYPTO_symmetric_encrypt=Module["_GNUNET_CRYPTO_symmetric_encrypt"]=asm["_GNUNET_CRYPTO_symmetric_encrypt"];var _GNUNET_CRYPTO_ecdhe_key_get_public=Module["_GNUNET_CRYPTO_ecdhe_key_get_public"]=asm["_GNUNET_CRYPTO_ecdhe_key_get_public"];var ___divdi3=Module["___divdi3"]=asm["___divdi3"];var _TALER_amount_ntoh=Module["_TALER_amount_ntoh"]=asm["_TALER_amount_ntoh"];var _llvm_cttz_i32=Module["_llvm_cttz_i32"]=asm["_llvm_cttz_i32"];var _GNUNET_CRYPTO_ecdhe_key_create=Module["_GNUNET_CRYPTO_ecdhe_key_create"]=asm["_GNUNET_CRYPTO_ecdhe_key_create"];var _TALER_amount_subtract=Module["_TALER_amount_subtract"]=asm["_TALER_amount_subtract"];var ___udivmoddi4=Module["___udivmoddi4"]=asm["___udivmoddi4"];var _GNUNET_CRYPTO_random_block=Module["_GNUNET_CRYPTO_random_block"]=asm["_GNUNET_CRYPTO_random_block"];var _i64Add=Module["_i64Add"]=asm["_i64Add"];var _GNUNET_CRYPTO_rsa_signature_free=Module["_GNUNET_CRYPTO_rsa_signature_free"]=asm["_GNUNET_CRYPTO_rsa_signature_free"];var _pthread_self=Module["_pthread_self"]=asm["_pthread_self"];var _GNUNET_CRYPTO_ecdh_eddsa=Module["_GNUNET_CRYPTO_ecdh_eddsa"]=asm["_GNUNET_CRYPTO_ecdh_eddsa"];var _pthread_mutex_unlock=Module["_pthread_mutex_unlock"]=asm["_pthread_mutex_unlock"];var _TALER_WRALL_purpose_create=Module["_TALER_WRALL_purpose_create"]=asm["_TALER_WRALL_purpose_create"];var _gpg_err_init=Module["_gpg_err_init"]=asm["_gpg_err_init"];var _GNUNET_CRYPTO_kdf=Module["_GNUNET_CRYPTO_kdf"]=asm["_GNUNET_CRYPTO_kdf"];var _GNUNET_CRYPTO_eddsa_sign=Module["_GNUNET_CRYPTO_eddsa_sign"]=asm["_GNUNET_CRYPTO_eddsa_sign"];var _TALER_amount_hton=Module["_TALER_amount_hton"]=asm["_TALER_amount_hton"];var _GNUNET_CRYPTO_rsa_public_key_free=Module["_GNUNET_CRYPTO_rsa_public_key_free"]=asm["_GNUNET_CRYPTO_rsa_public_key_free"];var _GNUNET_CRYPTO_rsa_private_key_encode=Module["_GNUNET_CRYPTO_rsa_private_key_encode"]=asm["_GNUNET_CRYPTO_rsa_private_key_encode"];var _GNUNET_CRYPTO_eddsa_key_get_public=Module["_GNUNET_CRYPTO_eddsa_key_get_public"]=asm["_GNUNET_CRYPTO_eddsa_key_get_public"];var ___udivdi3=Module["___udivdi3"]=asm["___udivdi3"];var _llvm_bswap_i32=Module["_llvm_bswap_i32"]=asm["_llvm_bswap_i32"];var runPostSets=Module["runPostSets"]=asm["runPostSets"];var ___muldsi3=Module["___muldsi3"]=asm["___muldsi3"];var _GNUNET_CRYPTO_rsa_blind=Module["_GNUNET_CRYPTO_rsa_blind"]=asm["_GNUNET_CRYPTO_rsa_blind"];var _TALER_amount_add=Module["_TALER_amount_add"]=asm["_TALER_amount_add"];var _free=Module["_free"]=asm["_free"];var _TALER_gcrypt_init=Module["_TALER_gcrypt_init"]=asm["_TALER_gcrypt_init"];var _GNUNET_STRINGS_data_to_string_alloc=Module["_GNUNET_STRINGS_data_to_string_alloc"]=asm["_GNUNET_STRINGS_data_to_string_alloc"];var _GNUNET_CRYPTO_hash_context_abort=Module["_GNUNET_CRYPTO_hash_context_abort"]=asm["_GNUNET_CRYPTO_hash_context_abort"];var _GNUNET_CRYPTO_symmetric_decrypt=Module["_GNUNET_CRYPTO_symmetric_decrypt"]=asm["_GNUNET_CRYPTO_symmetric_decrypt"];var _GNUNET_CRYPTO_random_init=Module["_GNUNET_CRYPTO_random_init"]=asm["_GNUNET_CRYPTO_random_init"];var _TALER_amount_get_zero=Module["_TALER_amount_get_zero"]=asm["_TALER_amount_get_zero"];var _malloc=Module["_malloc"]=asm["_malloc"];var _memcpy=Module["_memcpy"]=asm["_memcpy"];var _pthread_mutex_lock=Module["_pthread_mutex_lock"]=asm["_pthread_mutex_lock"];var _GNUNET_CRYPTO_hkdf=Module["_GNUNET_CRYPTO_hkdf"]=asm["_GNUNET_CRYPTO_hkdf"];var _memalign=Module["_memalign"]=asm["_memalign"];var _GNUNET_CRYPTO_ecdsa_key_create=Module["_GNUNET_CRYPTO_ecdsa_key_create"]=asm["_GNUNET_CRYPTO_ecdsa_key_create"];var _TALER_WRALL_ecdsa_public_key_from_private=Module["_TALER_WRALL_ecdsa_public_key_from_private"]=asm["_TALER_WRALL_ecdsa_public_key_from_private"];var _memmove=Module["_memmove"]=asm["_memmove"];var _GNUNET_CRYPTO_rsa_public_key_encode=Module["_GNUNET_CRYPTO_rsa_public_key_encode"]=asm["_GNUNET_CRYPTO_rsa_public_key_encode"];var ___remdi3=Module["___remdi3"]=asm["___remdi3"];var _GNUNET_CRYPTO_hash=Module["_GNUNET_CRYPTO_hash"]=asm["_GNUNET_CRYPTO_hash"];var _TALER_WR_get_value=Module["_TALER_WR_get_value"]=asm["_TALER_WR_get_value"];var _GNUNET_CRYPTO_rsa_signature_decode=Module["_GNUNET_CRYPTO_rsa_signature_decode"]=asm["_GNUNET_CRYPTO_rsa_signature_decode"];var _TALER_WRALL_ecdhe_public_key_from_private=Module["_TALER_WRALL_ecdhe_public_key_from_private"]=asm["_TALER_WRALL_ecdhe_public_key_from_private"];var dynCall_iiii=Module["dynCall_iiii"]=asm["dynCall_iiii"];var dynCall_viiiii=Module["dynCall_viiiii"]=asm["dynCall_viiiii"];var dynCall_vi=Module["dynCall_vi"]=asm["dynCall_vi"];var dynCall_vii=Module["dynCall_vii"]=asm["dynCall_vii"];var dynCall_ii=Module["dynCall_ii"]=asm["dynCall_ii"];var dynCall_viii=Module["dynCall_viii"]=asm["dynCall_viii"];var dynCall_v=Module["dynCall_v"]=asm["dynCall_v"];var dynCall_iiiii=Module["dynCall_iiiii"]=asm["dynCall_iiiii"];var dynCall_viiiiii=Module["dynCall_viiiiii"]=asm["dynCall_viiiiii"];var dynCall_iii=Module["dynCall_iii"]=asm["dynCall_iii"];var dynCall_viiii=Module["dynCall_viiii"]=asm["dynCall_viiii"];Runtime.stackAlloc=asm["stackAlloc"];Runtime.stackSave=asm["stackSave"];Runtime.stackRestore=asm["stackRestore"];Runtime.establishStackSpace=asm["establishStackSpace"];Runtime.setTempRet0=asm["setTempRet0"];Runtime.getTempRet0=asm["getTempRet0"];function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}ExitStatus.prototype=new Error;ExitStatus.prototype.constructor=ExitStatus;var initialStackTop;var preloadStartTime=null;var calledMain=false;dependenciesFulfilled=function runCaller(){if(!Module["calledRun"])run();if(!Module["calledRun"])dependenciesFulfilled=runCaller};Module["callMain"]=Module.callMain=function callMain(args){assert(runDependencies==0,"cannot call main when async dependencies remain! (listen on __ATMAIN__)");assert(__ATPRERUN__.length==0,"cannot call main when preRun functions remain to be called");args=args||[];ensureInitRuntime();var argc=args.length+1;function pad(){for(var i=0;i<4-1;i++){argv.push(0)}}var argv=[allocate(intArrayFromString(Module["thisProgram"]),"i8",ALLOC_NORMAL)];pad();for(var i=0;i0){Module.printErr("run() called, but dependencies remain, so not running");return}writeStackCookie();preRun();if(runDependencies>0)return;if(Module["calledRun"])return;function doRun(){if(Module["calledRun"])return;Module["calledRun"]=true;if(ABORT)return;ensureInitRuntime();preMain();if(ENVIRONMENT_IS_WEB&&preloadStartTime!==null){Module.printErr("pre-main prep time: "+(Date.now()-preloadStartTime)+" ms")}if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(Module["_main"]&&shouldRunNow)Module["callMain"](args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout((function(){setTimeout((function(){Module["setStatus"]("")}),1);doRun()}),1)}else{doRun()}checkStackCookie()}Module["run"]=Module.run=run;function exit(status,implicit){if(implicit&&Module["noExitRuntime"]){Module.printErr("exit("+status+") implicitly called by end of main(), but noExitRuntime, so not exiting the runtime (you can use emscripten_force_exit, if you want to force a true shutdown)");return}if(Module["noExitRuntime"]){Module.printErr("exit("+status+") called, but noExitRuntime, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)")}else{ABORT=true;EXITSTATUS=status;STACKTOP=initialStackTop;exitRuntime();if(Module["onExit"])Module["onExit"](status)}if(ENVIRONMENT_IS_NODE){process["exit"](status)}else if(ENVIRONMENT_IS_SHELL&&typeof quit==="function"){quit(status)}throw new ExitStatus(status)}Module["exit"]=Module.exit=exit;var abortDecorators=[];function abort(what){if(what!==undefined){Module.print(what);Module.printErr(what);what=JSON.stringify(what)}else{what=""}ABORT=true;EXITSTATUS=1;var extra="";var output="abort("+what+") at "+stackTrace()+extra;if(abortDecorators){abortDecorators.forEach((function(decorator){output=decorator(output,what)}))}throw output}Module["abort"]=Module.abort=abort;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"]){shouldRunNow=false}run() +(Module.asmGlobalArg,Module.asmLibraryArg,buffer);var real__bitshift64Lshr=asm["_bitshift64Lshr"];asm["_bitshift64Lshr"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__bitshift64Lshr.apply(null,arguments)});var real__bitshift64Ashr=asm["_bitshift64Ashr"];asm["_bitshift64Ashr"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__bitshift64Ashr.apply(null,arguments)});var real__sbrk=asm["_sbrk"];asm["_sbrk"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__sbrk.apply(null,arguments)});var real__GNUNET_CRYPTO_eddsa_key_create=asm["_GNUNET_CRYPTO_eddsa_key_create"];asm["_GNUNET_CRYPTO_eddsa_key_create"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_eddsa_key_create.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_private_key_decode=asm["_GNUNET_CRYPTO_rsa_private_key_decode"];asm["_GNUNET_CRYPTO_rsa_private_key_decode"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_private_key_decode.apply(null,arguments)});var real____udivmoddi4=asm["___udivmoddi4"];asm["___udivmoddi4"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____udivmoddi4.apply(null,arguments)});var real__GNUNET_CRYPTO_ecdh_eddsa=asm["_GNUNET_CRYPTO_ecdh_eddsa"];asm["_GNUNET_CRYPTO_ecdh_eddsa"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_ecdh_eddsa.apply(null,arguments)});var real__emscripten_get_global_libc=asm["_emscripten_get_global_libc"];asm["_emscripten_get_global_libc"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__emscripten_get_global_libc.apply(null,arguments)});var real__TALER_amount_hton=asm["_TALER_amount_hton"];asm["_TALER_amount_hton"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_amount_hton.apply(null,arguments)});var real_stackSave=asm["stackSave"];asm["stackSave"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real_stackSave.apply(null,arguments)});var real__gpg_err_init=asm["_gpg_err_init"];asm["_gpg_err_init"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__gpg_err_init.apply(null,arguments)});var real__free=asm["_free"];asm["_free"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__free.apply(null,arguments)});var real__memalign=asm["_memalign"];asm["_memalign"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__memalign.apply(null,arguments)});var real__GNUNET_CRYPTO_ecdsa_key_create=asm["_GNUNET_CRYPTO_ecdsa_key_create"];asm["_GNUNET_CRYPTO_ecdsa_key_create"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_ecdsa_key_create.apply(null,arguments)});var real__GNUNET_CRYPTO_hash_context_start=asm["_GNUNET_CRYPTO_hash_context_start"];asm["_GNUNET_CRYPTO_hash_context_start"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_hash_context_start.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_private_key_get_public=asm["_GNUNET_CRYPTO_rsa_private_key_get_public"];asm["_GNUNET_CRYPTO_rsa_private_key_get_public"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_private_key_get_public.apply(null,arguments)});var real__GNUNET_CRYPTO_eddsa_verify=asm["_GNUNET_CRYPTO_eddsa_verify"];asm["_GNUNET_CRYPTO_eddsa_verify"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_eddsa_verify.apply(null,arguments)});var real_setThrew=asm["setThrew"];asm["setThrew"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real_setThrew.apply(null,arguments)});var real__GNUNET_CRYPTO_symmetric_encrypt=asm["_GNUNET_CRYPTO_symmetric_encrypt"];asm["_GNUNET_CRYPTO_symmetric_encrypt"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_symmetric_encrypt.apply(null,arguments)});var real__TALER_WR_get_fraction=asm["_TALER_WR_get_fraction"];asm["_TALER_WR_get_fraction"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_WR_get_fraction.apply(null,arguments)});var real__TALER_amount_cmp=asm["_TALER_amount_cmp"];asm["_TALER_amount_cmp"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_amount_cmp.apply(null,arguments)});var real__llvm_cttz_i32=asm["_llvm_cttz_i32"];asm["_llvm_cttz_i32"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__llvm_cttz_i32.apply(null,arguments)});var real_stackAlloc=asm["stackAlloc"];asm["stackAlloc"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real_stackAlloc.apply(null,arguments)});var real__GNUNET_CRYPTO_kdf=asm["_GNUNET_CRYPTO_kdf"];asm["_GNUNET_CRYPTO_kdf"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_kdf.apply(null,arguments)});var real____divdi3=asm["___divdi3"];asm["___divdi3"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____divdi3.apply(null,arguments)});var real__TALER_amount_ntoh=asm["_TALER_amount_ntoh"];asm["_TALER_amount_ntoh"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_amount_ntoh.apply(null,arguments)});var real_getTempRet0=asm["getTempRet0"];asm["getTempRet0"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real_getTempRet0.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_public_key_free=asm["_GNUNET_CRYPTO_rsa_public_key_free"];asm["_GNUNET_CRYPTO_rsa_public_key_free"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_public_key_free.apply(null,arguments)});var real__GNUNET_CRYPTO_hkdf=asm["_GNUNET_CRYPTO_hkdf"];asm["_GNUNET_CRYPTO_hkdf"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_hkdf.apply(null,arguments)});var real__GNUNET_CRYPTO_eddsa_key_get_public=asm["_GNUNET_CRYPTO_eddsa_key_get_public"];asm["_GNUNET_CRYPTO_eddsa_key_get_public"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_eddsa_key_get_public.apply(null,arguments)});var real__llvm_bswap_i32=asm["_llvm_bswap_i32"];asm["_llvm_bswap_i32"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__llvm_bswap_i32.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_private_key_create=asm["_GNUNET_CRYPTO_rsa_private_key_create"];asm["_GNUNET_CRYPTO_rsa_private_key_create"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_private_key_create.apply(null,arguments)});var real__TALER_gcrypt_init=asm["_TALER_gcrypt_init"];asm["_TALER_gcrypt_init"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_gcrypt_init.apply(null,arguments)});var real_establishStackSpace=asm["establishStackSpace"];asm["establishStackSpace"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real_establishStackSpace.apply(null,arguments)});var real__pthread_mutex_lock=asm["_pthread_mutex_lock"];asm["_pthread_mutex_lock"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__pthread_mutex_lock.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_public_key_decode=asm["_GNUNET_CRYPTO_rsa_public_key_decode"];asm["_GNUNET_CRYPTO_rsa_public_key_decode"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_public_key_decode.apply(null,arguments)});var real__TALER_WRALL_ecdsa_public_key_from_private=asm["_TALER_WRALL_ecdsa_public_key_from_private"];asm["_TALER_WRALL_ecdsa_public_key_from_private"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_WRALL_ecdsa_public_key_from_private.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_signature_encode=asm["_GNUNET_CRYPTO_rsa_signature_encode"];asm["_GNUNET_CRYPTO_rsa_signature_encode"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_signature_encode.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_verify=asm["_GNUNET_CRYPTO_rsa_verify"];asm["_GNUNET_CRYPTO_rsa_verify"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_verify.apply(null,arguments)});var real__GNUNET_STRINGS_string_to_data=asm["_GNUNET_STRINGS_string_to_data"];asm["_GNUNET_STRINGS_string_to_data"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_STRINGS_string_to_data.apply(null,arguments)});var real__GNUNET_CRYPTO_hash_context_finish=asm["_GNUNET_CRYPTO_hash_context_finish"];asm["_GNUNET_CRYPTO_hash_context_finish"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_hash_context_finish.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_unblind=asm["_GNUNET_CRYPTO_rsa_unblind"];asm["_GNUNET_CRYPTO_rsa_unblind"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_unblind.apply(null,arguments)});var real__TALER_WR_get_currency=asm["_TALER_WR_get_currency"];asm["_TALER_WR_get_currency"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_WR_get_currency.apply(null,arguments)});var real__GNUNET_CRYPTO_random_block=asm["_GNUNET_CRYPTO_random_block"];asm["_GNUNET_CRYPTO_random_block"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_random_block.apply(null,arguments)});var real__TALER_WRALL_get_amount=asm["_TALER_WRALL_get_amount"];asm["_TALER_WRALL_get_amount"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_WRALL_get_amount.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_private_key_encode=asm["_GNUNET_CRYPTO_rsa_private_key_encode"];asm["_GNUNET_CRYPTO_rsa_private_key_encode"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_private_key_encode.apply(null,arguments)});var real__GNUNET_CRYPTO_symmetric_decrypt=asm["_GNUNET_CRYPTO_symmetric_decrypt"];asm["_GNUNET_CRYPTO_symmetric_decrypt"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_symmetric_decrypt.apply(null,arguments)});var real__i64Subtract=asm["_i64Subtract"];asm["_i64Subtract"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__i64Subtract.apply(null,arguments)});var real_setTempRet0=asm["setTempRet0"];asm["setTempRet0"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real_setTempRet0.apply(null,arguments)});var real__TALER_WR_get_value=asm["_TALER_WR_get_value"];asm["_TALER_WR_get_value"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_WR_get_value.apply(null,arguments)});var real__GNUNET_CRYPTO_ecdhe_key_get_public=asm["_GNUNET_CRYPTO_ecdhe_key_get_public"];asm["_GNUNET_CRYPTO_ecdhe_key_get_public"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_ecdhe_key_get_public.apply(null,arguments)});var real__GNUNET_util_cl_init=asm["_GNUNET_util_cl_init"];asm["_GNUNET_util_cl_init"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_util_cl_init.apply(null,arguments)});var real____remdi3=asm["___remdi3"];asm["___remdi3"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____remdi3.apply(null,arguments)});var real____muldsi3=asm["___muldsi3"];asm["___muldsi3"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____muldsi3.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_blind=asm["_GNUNET_CRYPTO_rsa_blind"];asm["_GNUNET_CRYPTO_rsa_blind"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_blind.apply(null,arguments)});var real__GNUNET_STRINGS_data_to_string_alloc=asm["_GNUNET_STRINGS_data_to_string_alloc"];asm["_GNUNET_STRINGS_data_to_string_alloc"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_STRINGS_data_to_string_alloc.apply(null,arguments)});var real__malloc=asm["_malloc"];asm["_malloc"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__malloc.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_signature_decode=asm["_GNUNET_CRYPTO_rsa_signature_decode"];asm["_GNUNET_CRYPTO_rsa_signature_decode"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_signature_decode.apply(null,arguments)});var real__TALER_setup_fresh_coin=asm["_TALER_setup_fresh_coin"];asm["_TALER_setup_fresh_coin"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_setup_fresh_coin.apply(null,arguments)});var real__GNUNET_CRYPTO_ecdhe_key_create=asm["_GNUNET_CRYPTO_ecdhe_key_create"];asm["_GNUNET_CRYPTO_ecdhe_key_create"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_ecdhe_key_create.apply(null,arguments)});var real____udivdi3=asm["___udivdi3"];asm["___udivdi3"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____udivdi3.apply(null,arguments)});var real__TALER_amount_normalize=asm["_TALER_amount_normalize"];asm["_TALER_amount_normalize"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_amount_normalize.apply(null,arguments)});var real__GNUNET_CRYPTO_hash_context_read=asm["_GNUNET_CRYPTO_hash_context_read"];asm["_GNUNET_CRYPTO_hash_context_read"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_hash_context_read.apply(null,arguments)});var real__bitshift64Shl=asm["_bitshift64Shl"];asm["_bitshift64Shl"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__bitshift64Shl.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_private_key_free=asm["_GNUNET_CRYPTO_rsa_private_key_free"];asm["_GNUNET_CRYPTO_rsa_private_key_free"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_private_key_free.apply(null,arguments)});var real__fflush=asm["_fflush"];asm["_fflush"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__fflush.apply(null,arguments)});var real__GNUNET_CRYPTO_hash_create_random=asm["_GNUNET_CRYPTO_hash_create_random"];asm["_GNUNET_CRYPTO_hash_create_random"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_hash_create_random.apply(null,arguments)});var real__TALER_WRALL_eddsa_public_key_from_private=asm["_TALER_WRALL_eddsa_public_key_from_private"];asm["_TALER_WRALL_eddsa_public_key_from_private"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_WRALL_eddsa_public_key_from_private.apply(null,arguments)});var real____muldi3=asm["___muldi3"];asm["___muldi3"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____muldi3.apply(null,arguments)});var real__GNUNET_CRYPTO_ecc_ecdh=asm["_GNUNET_CRYPTO_ecc_ecdh"];asm["_GNUNET_CRYPTO_ecc_ecdh"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_ecc_ecdh.apply(null,arguments)});var real__TALER_amount_add=asm["_TALER_amount_add"];asm["_TALER_amount_add"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_amount_add.apply(null,arguments)});var real____uremdi3=asm["___uremdi3"];asm["___uremdi3"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____uremdi3.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_signature_free=asm["_GNUNET_CRYPTO_rsa_signature_free"];asm["_GNUNET_CRYPTO_rsa_signature_free"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_signature_free.apply(null,arguments)});var real__TALER_amount_subtract=asm["_TALER_amount_subtract"];asm["_TALER_amount_subtract"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_amount_subtract.apply(null,arguments)});var real__i64Add=asm["_i64Add"];asm["_i64Add"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__i64Add.apply(null,arguments)});var real__TALER_WRALL_purpose_create=asm["_TALER_WRALL_purpose_create"];asm["_TALER_WRALL_purpose_create"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_WRALL_purpose_create.apply(null,arguments)});var real__pthread_mutex_unlock=asm["_pthread_mutex_unlock"];asm["_pthread_mutex_unlock"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__pthread_mutex_unlock.apply(null,arguments)});var real_stackRestore=asm["stackRestore"];asm["stackRestore"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real_stackRestore.apply(null,arguments)});var real__GNUNET_CRYPTO_eddsa_sign=asm["_GNUNET_CRYPTO_eddsa_sign"];asm["_GNUNET_CRYPTO_eddsa_sign"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_eddsa_sign.apply(null,arguments)});var real____errno_location=asm["___errno_location"];asm["___errno_location"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____errno_location.apply(null,arguments)});var real__TALER_WRALL_ecdhe_public_key_from_private=asm["_TALER_WRALL_ecdhe_public_key_from_private"];asm["_TALER_WRALL_ecdhe_public_key_from_private"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_WRALL_ecdhe_public_key_from_private.apply(null,arguments)});var real__GNUNET_CRYPTO_hash_context_abort=asm["_GNUNET_CRYPTO_hash_context_abort"];asm["_GNUNET_CRYPTO_hash_context_abort"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_hash_context_abort.apply(null,arguments)});var real__memmove=asm["_memmove"];asm["_memmove"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__memmove.apply(null,arguments)});var real__GNUNET_CRYPTO_random_init=asm["_GNUNET_CRYPTO_random_init"];asm["_GNUNET_CRYPTO_random_init"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_random_init.apply(null,arguments)});var real__TALER_amount_get_zero=asm["_TALER_amount_get_zero"];asm["_TALER_amount_get_zero"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_amount_get_zero.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_public_key_encode=asm["_GNUNET_CRYPTO_rsa_public_key_encode"];asm["_GNUNET_CRYPTO_rsa_public_key_encode"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_public_key_encode.apply(null,arguments)});var real__GNUNET_CRYPTO_hash=asm["_GNUNET_CRYPTO_hash"];asm["_GNUNET_CRYPTO_hash"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_hash.apply(null,arguments)});var _bitshift64Lshr=Module["_bitshift64Lshr"]=asm["_bitshift64Lshr"];var _bitshift64Ashr=Module["_bitshift64Ashr"]=asm["_bitshift64Ashr"];var _sbrk=Module["_sbrk"]=asm["_sbrk"];var _GNUNET_CRYPTO_eddsa_key_create=Module["_GNUNET_CRYPTO_eddsa_key_create"]=asm["_GNUNET_CRYPTO_eddsa_key_create"];var _memcpy=Module["_memcpy"]=asm["_memcpy"];var _GNUNET_CRYPTO_rsa_private_key_decode=Module["_GNUNET_CRYPTO_rsa_private_key_decode"]=asm["_GNUNET_CRYPTO_rsa_private_key_decode"];var ___udivmoddi4=Module["___udivmoddi4"]=asm["___udivmoddi4"];var _GNUNET_CRYPTO_ecdh_eddsa=Module["_GNUNET_CRYPTO_ecdh_eddsa"]=asm["_GNUNET_CRYPTO_ecdh_eddsa"];var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=asm["_emscripten_get_global_libc"];var _TALER_amount_hton=Module["_TALER_amount_hton"]=asm["_TALER_amount_hton"];var stackSave=Module["stackSave"]=asm["stackSave"];var _gpg_err_init=Module["_gpg_err_init"]=asm["_gpg_err_init"];var _free=Module["_free"]=asm["_free"];var runPostSets=Module["runPostSets"]=asm["runPostSets"];var _memalign=Module["_memalign"]=asm["_memalign"];var _GNUNET_CRYPTO_ecdsa_key_create=Module["_GNUNET_CRYPTO_ecdsa_key_create"]=asm["_GNUNET_CRYPTO_ecdsa_key_create"];var _GNUNET_CRYPTO_hash_context_start=Module["_GNUNET_CRYPTO_hash_context_start"]=asm["_GNUNET_CRYPTO_hash_context_start"];var _GNUNET_CRYPTO_rsa_private_key_get_public=Module["_GNUNET_CRYPTO_rsa_private_key_get_public"]=asm["_GNUNET_CRYPTO_rsa_private_key_get_public"];var _GNUNET_CRYPTO_eddsa_verify=Module["_GNUNET_CRYPTO_eddsa_verify"]=asm["_GNUNET_CRYPTO_eddsa_verify"];var setThrew=Module["setThrew"]=asm["setThrew"];var _GNUNET_CRYPTO_symmetric_encrypt=Module["_GNUNET_CRYPTO_symmetric_encrypt"]=asm["_GNUNET_CRYPTO_symmetric_encrypt"];var _TALER_WR_get_fraction=Module["_TALER_WR_get_fraction"]=asm["_TALER_WR_get_fraction"];var _TALER_amount_cmp=Module["_TALER_amount_cmp"]=asm["_TALER_amount_cmp"];var _llvm_cttz_i32=Module["_llvm_cttz_i32"]=asm["_llvm_cttz_i32"];var stackAlloc=Module["stackAlloc"]=asm["stackAlloc"];var _GNUNET_CRYPTO_kdf=Module["_GNUNET_CRYPTO_kdf"]=asm["_GNUNET_CRYPTO_kdf"];var ___divdi3=Module["___divdi3"]=asm["___divdi3"];var _TALER_amount_ntoh=Module["_TALER_amount_ntoh"]=asm["_TALER_amount_ntoh"];var getTempRet0=Module["getTempRet0"]=asm["getTempRet0"];var _GNUNET_CRYPTO_rsa_public_key_free=Module["_GNUNET_CRYPTO_rsa_public_key_free"]=asm["_GNUNET_CRYPTO_rsa_public_key_free"];var _GNUNET_CRYPTO_hkdf=Module["_GNUNET_CRYPTO_hkdf"]=asm["_GNUNET_CRYPTO_hkdf"];var _GNUNET_CRYPTO_eddsa_key_get_public=Module["_GNUNET_CRYPTO_eddsa_key_get_public"]=asm["_GNUNET_CRYPTO_eddsa_key_get_public"];var _llvm_bswap_i32=Module["_llvm_bswap_i32"]=asm["_llvm_bswap_i32"];var _GNUNET_CRYPTO_rsa_private_key_create=Module["_GNUNET_CRYPTO_rsa_private_key_create"]=asm["_GNUNET_CRYPTO_rsa_private_key_create"];var _TALER_gcrypt_init=Module["_TALER_gcrypt_init"]=asm["_TALER_gcrypt_init"];var establishStackSpace=Module["establishStackSpace"]=asm["establishStackSpace"];var _pthread_mutex_lock=Module["_pthread_mutex_lock"]=asm["_pthread_mutex_lock"];var _GNUNET_CRYPTO_rsa_public_key_decode=Module["_GNUNET_CRYPTO_rsa_public_key_decode"]=asm["_GNUNET_CRYPTO_rsa_public_key_decode"];var _TALER_WRALL_ecdsa_public_key_from_private=Module["_TALER_WRALL_ecdsa_public_key_from_private"]=asm["_TALER_WRALL_ecdsa_public_key_from_private"];var _GNUNET_CRYPTO_rsa_signature_encode=Module["_GNUNET_CRYPTO_rsa_signature_encode"]=asm["_GNUNET_CRYPTO_rsa_signature_encode"];var _GNUNET_CRYPTO_rsa_verify=Module["_GNUNET_CRYPTO_rsa_verify"]=asm["_GNUNET_CRYPTO_rsa_verify"];var _GNUNET_STRINGS_string_to_data=Module["_GNUNET_STRINGS_string_to_data"]=asm["_GNUNET_STRINGS_string_to_data"];var _memset=Module["_memset"]=asm["_memset"];var _GNUNET_CRYPTO_hash_context_finish=Module["_GNUNET_CRYPTO_hash_context_finish"]=asm["_GNUNET_CRYPTO_hash_context_finish"];var _GNUNET_CRYPTO_rsa_unblind=Module["_GNUNET_CRYPTO_rsa_unblind"]=asm["_GNUNET_CRYPTO_rsa_unblind"];var _TALER_WR_get_currency=Module["_TALER_WR_get_currency"]=asm["_TALER_WR_get_currency"];var _GNUNET_CRYPTO_random_block=Module["_GNUNET_CRYPTO_random_block"]=asm["_GNUNET_CRYPTO_random_block"];var _TALER_WRALL_get_amount=Module["_TALER_WRALL_get_amount"]=asm["_TALER_WRALL_get_amount"];var _GNUNET_CRYPTO_rsa_private_key_encode=Module["_GNUNET_CRYPTO_rsa_private_key_encode"]=asm["_GNUNET_CRYPTO_rsa_private_key_encode"];var _GNUNET_CRYPTO_symmetric_decrypt=Module["_GNUNET_CRYPTO_symmetric_decrypt"]=asm["_GNUNET_CRYPTO_symmetric_decrypt"];var _i64Subtract=Module["_i64Subtract"]=asm["_i64Subtract"];var setTempRet0=Module["setTempRet0"]=asm["setTempRet0"];var _TALER_WR_get_value=Module["_TALER_WR_get_value"]=asm["_TALER_WR_get_value"];var _GNUNET_CRYPTO_ecdhe_key_get_public=Module["_GNUNET_CRYPTO_ecdhe_key_get_public"]=asm["_GNUNET_CRYPTO_ecdhe_key_get_public"];var _GNUNET_util_cl_init=Module["_GNUNET_util_cl_init"]=asm["_GNUNET_util_cl_init"];var ___remdi3=Module["___remdi3"]=asm["___remdi3"];var ___muldsi3=Module["___muldsi3"]=asm["___muldsi3"];var _GNUNET_CRYPTO_rsa_blind=Module["_GNUNET_CRYPTO_rsa_blind"]=asm["_GNUNET_CRYPTO_rsa_blind"];var _GNUNET_STRINGS_data_to_string_alloc=Module["_GNUNET_STRINGS_data_to_string_alloc"]=asm["_GNUNET_STRINGS_data_to_string_alloc"];var _malloc=Module["_malloc"]=asm["_malloc"];var _GNUNET_CRYPTO_rsa_signature_decode=Module["_GNUNET_CRYPTO_rsa_signature_decode"]=asm["_GNUNET_CRYPTO_rsa_signature_decode"];var _TALER_setup_fresh_coin=Module["_TALER_setup_fresh_coin"]=asm["_TALER_setup_fresh_coin"];var _GNUNET_CRYPTO_ecdhe_key_create=Module["_GNUNET_CRYPTO_ecdhe_key_create"]=asm["_GNUNET_CRYPTO_ecdhe_key_create"];var ___udivdi3=Module["___udivdi3"]=asm["___udivdi3"];var _TALER_amount_normalize=Module["_TALER_amount_normalize"]=asm["_TALER_amount_normalize"];var _GNUNET_CRYPTO_hash_context_read=Module["_GNUNET_CRYPTO_hash_context_read"]=asm["_GNUNET_CRYPTO_hash_context_read"];var _bitshift64Shl=Module["_bitshift64Shl"]=asm["_bitshift64Shl"];var _GNUNET_CRYPTO_rsa_private_key_free=Module["_GNUNET_CRYPTO_rsa_private_key_free"]=asm["_GNUNET_CRYPTO_rsa_private_key_free"];var _fflush=Module["_fflush"]=asm["_fflush"];var _GNUNET_CRYPTO_hash_create_random=Module["_GNUNET_CRYPTO_hash_create_random"]=asm["_GNUNET_CRYPTO_hash_create_random"];var _TALER_WRALL_eddsa_public_key_from_private=Module["_TALER_WRALL_eddsa_public_key_from_private"]=asm["_TALER_WRALL_eddsa_public_key_from_private"];var ___muldi3=Module["___muldi3"]=asm["___muldi3"];var _GNUNET_CRYPTO_ecc_ecdh=Module["_GNUNET_CRYPTO_ecc_ecdh"]=asm["_GNUNET_CRYPTO_ecc_ecdh"];var _TALER_amount_add=Module["_TALER_amount_add"]=asm["_TALER_amount_add"];var ___uremdi3=Module["___uremdi3"]=asm["___uremdi3"];var _GNUNET_CRYPTO_rsa_signature_free=Module["_GNUNET_CRYPTO_rsa_signature_free"]=asm["_GNUNET_CRYPTO_rsa_signature_free"];var _TALER_amount_subtract=Module["_TALER_amount_subtract"]=asm["_TALER_amount_subtract"];var _i64Add=Module["_i64Add"]=asm["_i64Add"];var _TALER_WRALL_purpose_create=Module["_TALER_WRALL_purpose_create"]=asm["_TALER_WRALL_purpose_create"];var _pthread_mutex_unlock=Module["_pthread_mutex_unlock"]=asm["_pthread_mutex_unlock"];var stackRestore=Module["stackRestore"]=asm["stackRestore"];var _GNUNET_CRYPTO_eddsa_sign=Module["_GNUNET_CRYPTO_eddsa_sign"]=asm["_GNUNET_CRYPTO_eddsa_sign"];var ___errno_location=Module["___errno_location"]=asm["___errno_location"];var _TALER_WRALL_ecdhe_public_key_from_private=Module["_TALER_WRALL_ecdhe_public_key_from_private"]=asm["_TALER_WRALL_ecdhe_public_key_from_private"];var _GNUNET_CRYPTO_hash_context_abort=Module["_GNUNET_CRYPTO_hash_context_abort"]=asm["_GNUNET_CRYPTO_hash_context_abort"];var _memmove=Module["_memmove"]=asm["_memmove"];var _GNUNET_CRYPTO_random_init=Module["_GNUNET_CRYPTO_random_init"]=asm["_GNUNET_CRYPTO_random_init"];var _TALER_amount_get_zero=Module["_TALER_amount_get_zero"]=asm["_TALER_amount_get_zero"];var _GNUNET_CRYPTO_rsa_public_key_encode=Module["_GNUNET_CRYPTO_rsa_public_key_encode"]=asm["_GNUNET_CRYPTO_rsa_public_key_encode"];var _GNUNET_CRYPTO_hash=Module["_GNUNET_CRYPTO_hash"]=asm["_GNUNET_CRYPTO_hash"];var dynCall_iiii=Module["dynCall_iiii"]=asm["dynCall_iiii"];var dynCall_viiiii=Module["dynCall_viiiii"]=asm["dynCall_viiiii"];var dynCall_vi=Module["dynCall_vi"]=asm["dynCall_vi"];var dynCall_vii=Module["dynCall_vii"]=asm["dynCall_vii"];var dynCall_ii=Module["dynCall_ii"]=asm["dynCall_ii"];var dynCall_viii=Module["dynCall_viii"]=asm["dynCall_viii"];var dynCall_v=Module["dynCall_v"]=asm["dynCall_v"];var dynCall_iiiii=Module["dynCall_iiiii"]=asm["dynCall_iiiii"];var dynCall_viiiiii=Module["dynCall_viiiiii"]=asm["dynCall_viiiiii"];var dynCall_iii=Module["dynCall_iii"]=asm["dynCall_iii"];var dynCall_viiii=Module["dynCall_viiii"]=asm["dynCall_viiii"];Runtime.stackAlloc=Module["stackAlloc"];Runtime.stackSave=Module["stackSave"];Runtime.stackRestore=Module["stackRestore"];Runtime.establishStackSpace=Module["establishStackSpace"];Runtime.setTempRet0=Module["setTempRet0"];Runtime.getTempRet0=Module["getTempRet0"];Module["asm"]=asm;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}ExitStatus.prototype=new Error;ExitStatus.prototype.constructor=ExitStatus;var initialStackTop;var preloadStartTime=null;var calledMain=false;dependenciesFulfilled=function runCaller(){if(!Module["calledRun"])run();if(!Module["calledRun"])dependenciesFulfilled=runCaller};Module["callMain"]=Module.callMain=function callMain(args){assert(runDependencies==0,"cannot call main when async dependencies remain! (listen on __ATMAIN__)");assert(__ATPRERUN__.length==0,"cannot call main when preRun functions remain to be called");args=args||[];ensureInitRuntime();var argc=args.length+1;function pad(){for(var i=0;i<4-1;i++){argv.push(0)}}var argv=[allocate(intArrayFromString(Module["thisProgram"]),"i8",ALLOC_NORMAL)];pad();for(var i=0;i0){Module.printErr("run() called, but dependencies remain, so not running");return}writeStackCookie();preRun();if(runDependencies>0)return;if(Module["calledRun"])return;function doRun(){if(Module["calledRun"])return;Module["calledRun"]=true;if(ABORT)return;ensureInitRuntime();preMain();if(ENVIRONMENT_IS_WEB&&preloadStartTime!==null){Module.printErr("pre-main prep time: "+(Date.now()-preloadStartTime)+" ms")}if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(Module["_main"]&&shouldRunNow)Module["callMain"](args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout((function(){setTimeout((function(){Module["setStatus"]("")}),1);doRun()}),1)}else{doRun()}checkStackCookie()}Module["run"]=Module.run=run;function exit(status,implicit){if(implicit&&Module["noExitRuntime"]){Module.printErr("exit("+status+") implicitly called by end of main(), but noExitRuntime, so not exiting the runtime (you can use emscripten_force_exit, if you want to force a true shutdown)");return}if(Module["noExitRuntime"]){Module.printErr("exit("+status+") called, but noExitRuntime, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)")}else{ABORT=true;EXITSTATUS=status;STACKTOP=initialStackTop;exitRuntime();if(Module["onExit"])Module["onExit"](status)}if(ENVIRONMENT_IS_NODE){process["exit"](status)}else if(ENVIRONMENT_IS_SHELL&&typeof quit==="function"){quit(status)}throw new ExitStatus(status)}Module["exit"]=Module.exit=exit;var abortDecorators=[];function abort(what){if(what!==undefined){Module.print(what);Module.printErr(what);what=JSON.stringify(what)}else{what=""}ABORT=true;EXITSTATUS=1;var extra="";var output="abort("+what+") at "+stackTrace()+extra;if(abortDecorators){abortDecorators.forEach((function(decorator){output=decorator(output,what)}))}throw output}Module["abort"]=Module.abort=abort;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"]){shouldRunNow=false}run() diff --git a/src/emscriptif-test.ts b/src/emscriptif-test.ts index cd99d0ed1..8b7a9eff4 100644 --- a/src/emscriptif-test.ts +++ b/src/emscriptif-test.ts @@ -1,4 +1,4 @@ -import {test, TestLib} from "testlib/talertest"; +import {test, TestLib} from "talertest"; import * as native from "./emscriptif"; test("string hashing", (t: TestLib) => { diff --git a/src/emscriptif.ts b/src/emscriptif.ts index aeb645c70..0b3f2ae71 100644 --- a/src/emscriptif.ts +++ b/src/emscriptif.ts @@ -15,7 +15,7 @@ */ import {AmountJson} from "./types"; -import Module, {EmscFunGen} from "src/emscripten/taler-emscripten-lib"; +import * as emscLib from "./emscripten/taler-emscripten-lib"; /** * Medium-level interface to emscripten-compiled modules used @@ -40,9 +40,9 @@ const GNUNET_SYSERR = -1; /** * Get an emscripten-compiled function. */ -const getEmsc: EmscFunGen = (name: string, ret: any, argTypes: any[]) => { +const getEmsc: emscLib.EmscFunGen = (name: string, ret: any, argTypes: any[]) => { return (...args: any[]) => { - return Module.ccall(name, ret, argTypes, args); + return emscLib.ccall(name, ret, argTypes, args); } }; @@ -51,7 +51,7 @@ const getEmsc: EmscFunGen = (name: string, ret: any, argTypes: any[]) => { * Wrapped emscripten functions that do not allocate any memory. */ const emsc = { - free: (ptr: number) => Module._free(ptr), + free: (ptr: number) => emscLib._free(ptr), get_value: getEmsc("TALER_WR_get_value", "number", ["number"]), @@ -193,7 +193,7 @@ const emscAlloc = { hash_context_start: getEmsc("GNUNET_CRYPTO_hash_context_start", "number", []), - malloc: (size: number) => Module._malloc(size), + malloc: (size: number) => emscLib._malloc(size), }; @@ -530,7 +530,7 @@ abstract class PackedArenaObject extends MallocArenaObject { toCrock(): string { var d = emscAlloc.data_to_string_alloc(this.nativePtr, this.size()); - var s = Module.Pointer_stringify(d); + var s = emscLib.Pointer_stringify(d); emsc.free(d); return s; } @@ -574,7 +574,7 @@ abstract class PackedArenaObject extends MallocArenaObject { hexdump() { let bytes: string[] = []; for (let i = 0; i < this.size(); i++) { - let b = Module.getValue(this.nativePtr + i, "i8"); + let b = emscLib.getValue(this.nativePtr + i, "i8"); b = (b + 256) % 256; bytes.push("0".concat(b.toString(16)).slice(-2)); } @@ -637,7 +637,7 @@ function encode(obj: T, encodeFn: any, arena?: Aren let ptr = emscAlloc.malloc(PTR_SIZE); let len = encodeFn(obj.nativePtr, ptr); let res = new ByteArray(len, undefined, arena); - res.nativePtr = Module.getValue(ptr, '*'); + res.nativePtr = emscLib.getValue(ptr, '*'); emsc.free(ptr); return res; } @@ -812,7 +812,7 @@ export class ByteArray extends PackedArenaObject { // UTF-8 bytes, including 0-terminator let terminatedByteLength = countUtf8Bytes(s) + 1; let hstr = emscAlloc.malloc(terminatedByteLength); - Module.stringToUTF8(s, hstr, terminatedByteLength); + emscLib.stringToUTF8(s, hstr, terminatedByteLength); return new ByteArray(terminatedByteLength - 1, hstr, a); } @@ -820,7 +820,7 @@ export class ByteArray extends PackedArenaObject { // UTF-8 bytes, including 0-terminator let terminatedByteLength = countUtf8Bytes(s) + 1; let hstr = emscAlloc.malloc(terminatedByteLength); - Module.stringToUTF8(s, hstr, terminatedByteLength); + emscLib.stringToUTF8(s, hstr, terminatedByteLength); return new ByteArray(terminatedByteLength, hstr, a); } @@ -829,7 +829,7 @@ export class ByteArray extends PackedArenaObject { // since we don't have a fixed size let byteLength = countUtf8Bytes(s); let hstr = emscAlloc.malloc(byteLength + 1); - Module.stringToUTF8(s, hstr, byteLength + 1); + emscLib.stringToUTF8(s, hstr, byteLength + 1); let decodedLen = Math.floor((byteLength * 5) / 8); let ba = new ByteArray(decodedLen, undefined, a); let res = emsc.string_to_data(hstr, byteLength, ba.nativePtr, decodedLen); @@ -1016,7 +1016,7 @@ export class AbsoluteTimeNbo extends PackedArenaObject { // XXX: This only works up to 54 bit numbers. function set64(p: number, n: number) { for (let i = 0; i < 8; ++i) { - Module.setValue(p + (7 - i), n & 0xFF, "i8"); + emscLib.setValue(p + (7 - i), n & 0xFF, "i8"); n = Math.floor(n / 256); } } @@ -1024,7 +1024,7 @@ function set64(p: number, n: number) { // XXX: This only works up to 54 bit numbers. function set32(p: number, n: number) { for (let i = 0; i < 4; ++i) { - Module.setValue(p + (3 - i), n & 0xFF, "i8"); + emscLib.setValue(p + (3 - i), n & 0xFF, "i8"); n = Math.floor(n / 256); } } @@ -1195,8 +1195,8 @@ export function rsaBlind(hashCode: HashCode, pkey.nativePtr, buf_ptr_out, buf_size_out); - let buf_ptr = Module.getValue(buf_ptr_out, '*'); - let buf_size = Module.getValue(buf_size_out, '*'); + let buf_ptr = emscLib.getValue(buf_ptr_out, '*'); + let buf_size = emscLib.getValue(buf_size_out, '*'); emsc.free(buf_ptr_out); emsc.free(buf_size_out); if (res != GNUNET_OK) { diff --git a/src/helpers-test.ts b/src/helpers-test.ts index 4aac5ebec..d252e9720 100644 --- a/src/helpers-test.ts +++ b/src/helpers-test.ts @@ -1,4 +1,4 @@ -import {test, TestLib} from "testlib/talertest"; +import {test, TestLib} from "talertest"; import * as helpers from "./helpers"; diff --git a/src/helpers.ts b/src/helpers.ts index d9b62aa22..7b9470271 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -21,10 +21,8 @@ * @author Florian Dold */ -/// - import {AmountJson, Amounts} from "./types"; -import URI = uri.URI; +import URI = require("urijs"); export function substituteFulfillmentUrl(url: string, vars: any) { url = url.replace("${H_contract}", vars.H_contract); @@ -45,7 +43,7 @@ export function amountToPretty(amount: AmountJson): string { * See http://api.taler.net/wallet.html#general */ export function canonicalizeBaseUrl(url: string) { - let x: URI = new URI(url); + let x = new URI(url); if (!x.protocol()) { x.protocol("https"); } diff --git a/src/http.ts b/src/http.ts index 1d22c4eb2..5e6580016 100644 --- a/src/http.ts +++ b/src/http.ts @@ -22,7 +22,6 @@ "use strict"; - export interface HttpResponse { status: number; responseText: string; @@ -31,31 +30,24 @@ export interface HttpResponse { export interface HttpRequestLibrary { req(method: string, - url: string | uri.URI, + url: string, options?: any): Promise; - get(url: string | uri.URI): Promise; + get(url: string): Promise; - postJson(url: string | uri.URI, body: any): Promise; + postJson(url: string, body: any): Promise; - postForm(url: string | uri.URI, form: any): Promise; + postForm(url: string, form: any): Promise; } export class BrowserHttpLib { req(method: string, - url: string|uri.URI, + url: string, options?: any): Promise { - let urlString: string; - if (url instanceof URI) { - urlString = url.href(); - } else if (typeof url === "string") { - urlString = url; - } - - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { let myRequest = new XMLHttpRequest(); - myRequest.open(method, urlString); + myRequest.open(method, url); if (options && options.req) { myRequest.send(options.req); } else { @@ -74,17 +66,17 @@ export class BrowserHttpLib { } - get(url: string|uri.URI) { + get(url: string) { return this.req("get", url); } - postJson(url: string|uri.URI, body: any) { + postJson(url: string, body: any) { return this.req("post", url, {req: JSON.stringify(body)}); } - postForm(url: string|uri.URI, form: any) { + postForm(url: string, form: any) { return this.req("post", url, {req: form}); } } diff --git a/src/i18n.tsx b/src/i18n.tsx index d03fd52ef..dcc678900 100644 --- a/src/i18n.tsx +++ b/src/i18n.tsx @@ -16,10 +16,12 @@ "use strict"; -import {default as Jed} from "src/vendor/jed"; -import {strings} from "src/i18n/strings"; +import * as jedLib from "jed"; +import {strings} from "./i18n/strings"; -console.log("jed:", Jed); +import * as React from "react"; + +console.log("jed:", jedLib); /** * Information about the last two i18n results, used by plural() @@ -35,7 +37,7 @@ try { console.warn("i18n default language not available"); } -let jed = new Jed(strings[lang]); +let jed = new jedLib.Jed(strings[lang]); class PluralNumber { diff --git a/src/logging.ts b/src/logging.ts index 788a7df55..d5d6debf4 100644 --- a/src/logging.ts +++ b/src/logging.ts @@ -198,7 +198,7 @@ const loggingDbVersion = 1; const logsStore: Store = new Store("logs"); export function openLoggingDb(): Promise { - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { const req = indexedDB.open("taler-logging", loggingDbVersion); req.onerror = (e) => { reject(e); diff --git a/src/moduleTrampoline.ts b/src/moduleTrampoline.ts deleted file mode 100644 index acbf2afcf..000000000 --- a/src/moduleTrampoline.ts +++ /dev/null @@ -1,80 +0,0 @@ -/* - This file is part of TALER - (C) 2016 GNUnet e.V. - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see - */ - - -/** - * Boilerplate to initialize the module system and call main() - * - * @author Florian Dold - */ - -"use strict"; - -if (typeof System === "undefined") { - throw Error("system loader not present (must be included before the" + - " trampoline"); -} - -System.config({ - defaultJSExtensions: true, - map: { - src: "/src/", - }, -}); - -let me = window.location.protocol - + "//" + window.location.host - + window.location.pathname.replace(/[.]html$/, ".js"); - -let domLoaded = false; - -document.addEventListener("DOMContentLoaded", function(event) { - domLoaded = true; -}); - -function execMain(m: any) { - if (m.main) { - console.log("executing module main"); - let res = m.main(); - } else { - console.warn("module does not export a main() function"); - } -} - -console.log("loading", me); - -System.import("src/logging").then((logging) => { - window.onerror = (m, source, lineno, colno, error) => { - logging.record("error", m + error, source || "(unknown)", undefined, lineno || 0, colno || 0); - }; - window.addEventListener('unhandledrejection', (evt: any) => { - logging.recordException("unhandled promise rejection", evt.reason); - }); - System.import(me).then((m) => { - if (domLoaded) { - execMain(m); - return; - } - document.addEventListener("DOMContentLoaded", function(event) { - execMain(m); - }); - }); -}) -.catch((e) => { - console.log("trampoline failed"); - console.error(e.stack); -}); - diff --git a/src/pages/add-auditor.html b/src/pages/add-auditor.html index 7966e211f..dce391ff4 100644 --- a/src/pages/add-auditor.html +++ b/src/pages/add-auditor.html @@ -2,39 +2,37 @@ - Taler Wallet: Add Auditor + - - + Taler Wallet: Add Auditor - + + - - - + - - + + - - + + - + - -

- + +
+ diff --git a/src/pages/add-auditor.tsx b/src/pages/add-auditor.tsx index 3ec21f509..db283eade 100644 --- a/src/pages/add-auditor.tsx +++ b/src/pages/add-auditor.tsx @@ -21,15 +21,27 @@ */ -import { ExchangeRecord, DenominationRecord } from "src/types"; -import { AuditorRecord, CurrencyRecord, ReserveRecord, CoinRecord, PreCoinRecord, Denomination } from "src/types"; -import { ImplicitStateComponent, StateHolder } from "src/components"; +import { + ExchangeRecord, + DenominationRecord, + AuditorRecord, + CurrencyRecord, + ReserveRecord, + CoinRecord, + PreCoinRecord, + Denomination +} from "../types"; +import { ImplicitStateComponent, StateHolder } from "../components"; import { getCurrencies, updateCurrency, -} from "src/wxApi"; -import { prettyAmount } from "src/renderHtml"; -import { getTalerStampDate } from "src/helpers"; +} from "../wxApi"; +import { prettyAmount } from "../renderHtml"; +import { getTalerStampDate } from "../helpers"; + +import * as React from "react"; +import * as ReactDOM from "react-dom"; +import URI = require("urijs"); interface ConfirmAuditorProps { url: string; @@ -101,7 +113,7 @@ class ConfirmAuditor extends ImplicitStateComponent { } export function main() { - const walletPageUrl = URI(document.location.href); + const walletPageUrl = new URI(document.location.href); const query: any = JSON.parse((URI.parseQuery(walletPageUrl.query()) as any)["req"]); const url = query.url; const currency: string = query.currency; @@ -110,3 +122,5 @@ export function main() { const args = { url, currency, auditorPub, expirationStamp }; ReactDOM.render(, document.getElementById("container")!); } + +document.addEventListener("DOMContentLoaded", main); diff --git a/src/pages/auditors.html b/src/pages/auditors.html index 0a9740f03..7e01f4e1f 100644 --- a/src/pages/auditors.html +++ b/src/pages/auditors.html @@ -2,36 +2,33 @@ - Taler Wallet: Auditors + + Taler Wallet: Auditors - - + + - + - - - + + - - + - - - -
- + +
+ diff --git a/src/pages/auditors.tsx b/src/pages/auditors.tsx index 7cffec403..4aa922128 100644 --- a/src/pages/auditors.tsx +++ b/src/pages/auditors.tsx @@ -21,15 +21,25 @@ */ -import { ExchangeRecord, DenominationRecord } from "src/types"; -import { AuditorRecord, CurrencyRecord, ReserveRecord, CoinRecord, PreCoinRecord, Denomination } from "src/types"; -import { ImplicitStateComponent, StateHolder } from "src/components"; +import { + ExchangeRecord, + DenominationRecord, + AuditorRecord, + CurrencyRecord, + ReserveRecord, + CoinRecord, + PreCoinRecord, + Denomination +} from "../types"; +import { ImplicitStateComponent, StateHolder } from "../components"; import { getCurrencies, updateCurrency, -} from "src/wxApi"; -import { prettyAmount } from "src/renderHtml"; -import { getTalerStampDate } from "src/helpers"; +} from "../wxApi"; +import { prettyAmount } from "../renderHtml"; +import { getTalerStampDate } from "../helpers"; +import * as React from "react"; +import * as ReactDOM from "react-dom"; interface CurrencyListState { currencies?: CurrencyRecord[]; diff --git a/src/pages/confirm-contract.html b/src/pages/confirm-contract.html index c42479c29..52b68e627 100644 --- a/src/pages/confirm-contract.html +++ b/src/pages/confirm-contract.html @@ -2,6 +2,7 @@ + Taler Wallet: Confirm Reserve Creation @@ -9,12 +10,8 @@ - - - - - - + + - - - -
- + +
+ diff --git a/src/pages/logs.tsx b/src/pages/logs.tsx index 15bb3d270..716eebae6 100644 --- a/src/pages/logs.tsx +++ b/src/pages/logs.tsx @@ -20,7 +20,9 @@ * @author Florian Dold */ -import {LogEntry, getLogs} from "src/logging"; +import * as React from "react"; +import * as ReactDOM from "react-dom"; +import {LogEntry, getLogs} from "../logging"; interface LogViewProps { log: LogEntry; diff --git a/src/popup/popup.css b/src/pages/popup.css similarity index 100% rename from src/popup/popup.css rename to src/pages/popup.css diff --git a/src/popup/popup.html b/src/pages/popup.html similarity index 50% rename from src/popup/popup.html rename to src/pages/popup.html index a8b339b05..7ff5cffaf 100644 --- a/src/popup/popup.html +++ b/src/pages/popup.html @@ -7,12 +7,8 @@ - - - - - - + + diff --git a/src/popup/popup.tsx b/src/pages/popup.tsx similarity index 92% rename from src/popup/popup.tsx rename to src/pages/popup.tsx index 424c38110..c8d52b45c 100644 --- a/src/popup/popup.tsx +++ b/src/pages/popup.tsx @@ -25,15 +25,18 @@ "use strict"; -import {substituteFulfillmentUrl} from "src/helpers"; +import {substituteFulfillmentUrl} from "../helpers"; import BrowserClickedEvent = chrome.browserAction.BrowserClickedEvent; -import {HistoryRecord, HistoryLevel} from "src/wallet"; +import {HistoryRecord, HistoryLevel} from "../wallet"; import { AmountJson, WalletBalance, Amounts, WalletBalanceEntry -} from "src/types"; -import {abbrev, prettyAmount} from "src/renderHtml"; -import * as i18n from "src/i18n"; +} from "../types"; +import {abbrev, prettyAmount} from "../renderHtml"; +import * as i18n from "../i18n"; +import * as React from "react"; +import * as ReactDOM from "react-dom"; +import URI = require("urijs"); function onUpdateNotification(f: () => void): () => void { let port = chrome.runtime.connect({name: "notifications"}); @@ -108,24 +111,6 @@ class Router extends React.Component { } } -export function main() { - console.log("popup main"); - - let el = ( -
- -
- - - - - -
-
- ); - - ReactDOM.render(el, document.getElementById("content")!); -} interface TabProps { target: string; @@ -137,7 +122,7 @@ function Tab(props: TabProps) { if (props.target == Router.getRoute()) { cssClass = "active"; } - let onClick = (e: React.MouseEvent) => { + let onClick = (e: React.MouseEvent) => { Router.setRoute(props.target); e.preventDefault(); }; @@ -183,7 +168,7 @@ class WalletNavBar extends React.Component { function ExtensionLink(props: any) { - let onClick = (e: React.MouseEvent) => { + let onClick = (e: React.MouseEvent) => { chrome.tabs.create({ "url": chrome.extension.getURL(props.target) }); @@ -353,7 +338,7 @@ function formatHistoryItem(historyItem: HistoryRecord) { ); case "confirm-reserve": { // FIXME: eventually remove compat fix - let exchange = d.exchangeBaseUrl ? URI(d.exchangeBaseUrl).host() : "??"; + let exchange = d.exchangeBaseUrl ? (new URI(d.exchangeBaseUrl)).host() : "??"; let pub = abbrev(d.reservePub); return ( @@ -374,7 +359,7 @@ function formatHistoryItem(historyItem: HistoryRecord) { ); } case "depleted-reserve": { - let exchange = d.exchangeBaseUrl ? URI(d.exchangeBaseUrl).host() : "??"; + let exchange = d.exchangeBaseUrl ? (new URI(d.exchangeBaseUrl)).host() : "??"; let amount = prettyAmount(d.requestedAmount); let pub = abbrev(d.reservePub); return ( @@ -499,7 +484,7 @@ function confirmReset() { function WalletDebug(props: any) { return (

Debug tools:

-